From ff79414fb0d24a7572c0e6695c5dfb72ea4e1f4f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Apr 2000 06:28:51 +0000 Subject: [PATCH 0001/7878] Whoops... ungetchar wasn't used on Win32 either... but we seem to be broken. This finished up that patch on another os. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59974 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 1 - 1 file changed, 1 deletion(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 1ab30ae0a18..f18e6aca015 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -101,7 +101,6 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*in)->pipe = 1; (*in)->fname = ap_pstrdup(cont, "PIPE"); (*in)->timeout = -1; - (*in)->ungetchar = -1; (*out) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); (*out)->cntxt = cont; From de81428d4cdde19dc033542fd23e6e6f8912a2d5 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 28 Apr 2000 06:49:50 +0000 Subject: [PATCH 0002/7878] prefix TRUE,FALSE with APR_ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59975 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/beos/readwrite.c | 10 +++++----- file_io/os2/dir.c | 6 +++--- file_io/os2/open.c | 26 +++++++++++++------------- file_io/os2/pipe.c | 10 +++++----- file_io/os2/readwrite.c | 6 +++--- file_io/unix/readwrite.c | 10 +++++----- file_io/win32/filedup.c | 2 +- file_io/win32/fileio.h | 2 +- file_io/win32/filestat.c | 4 ++-- file_io/win32/pipe.c | 2 +- file_io/win32/readwrite.c | 4 ++-- include/apr_general.h | 4 ++-- include/arch/win32/fileio.h | 2 +- lib/apr_pools.c | 2 +- lib/apr_snprintf.c | 30 +++++++++++++++--------------- locks/os2/locks.c | 2 +- locks/win32/locks.c | 8 ++++---- memory/unix/apr_pools.c | 2 +- misc/win32/names.c | 20 ++++++++++---------- misc/win32/start.c | 4 ++-- network_io/os2/sockets.c | 4 ++-- network_io/win32/sendrecv.c | 2 +- shmem/unix/mm/mm.h | 8 ++++---- shmem/unix/mm/mm_alloc.c | 4 ++-- shmem/unix/mm/mm_core.c | 16 ++++++++-------- shmem/unix/mm/mm_global.c | 10 +++++----- threadproc/os2/proc.c | 12 ++++++------ threadproc/win32/proc.c | 10 +++++----- 28 files changed, 111 insertions(+), 111 deletions(-) diff --git a/file_io/beos/readwrite.c b/file_io/beos/readwrite.c index 96aaf5247db..033c2bdabcb 100644 --- a/file_io/beos/readwrite.c +++ b/file_io/beos/readwrite.c @@ -83,7 +83,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) if (thefile->bufpos >= thefile->dataRead) { thefile->dataRead = read(thefile->filedes, thefile->buffer, APR_FILE_BUFSIZE); if (thefile->dataRead == 0) { - thefile->eof_hit = TRUE; + thefile->eof_hit = APR_TRUE; break; } thefile->filePtr += thefile->dataRead; @@ -219,7 +219,7 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) } rv = read(thefile->filedes, ch, 1); if (rv == 0) { - thefile->eof_hit = TRUE; + thefile->eof_hit = APR_TRUE; return APR_EOF; } else if (rv != 1) { @@ -266,14 +266,14 @@ ap_status_t ap_flush(ap_file_t *thefile) ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) { ssize_t rv; - int i, used_unget = FALSE, beg_idx; + int i, used_unget = APR_FALSE, beg_idx; if(len <= 1) /* as per fgets() */ return APR_SUCCESS; if(thefile->ungetchar != -1){ str[0] = thefile->ungetchar; - used_unget = TRUE; + used_unget = APR_TRUE; beg_idx = 1; if(str[0] == '\n' || str[0] == '\r'){ thefile->ungetchar = -1; @@ -286,7 +286,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) for (i = beg_idx; i < len; i++) { rv = read(thefile->filedes, &str[i], 1); if (rv == 0) { - thefile->eof_hit = TRUE; + thefile->eof_hit = APR_TRUE; if(used_unget) thefile->filedes = -1; str[i] = '\0'; return APR_EOF; diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 34f973ec63c..a175dee5d9e 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -82,7 +82,7 @@ ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cntxt) return APR_ENOMEM; thedir->handle = 0; - thedir->validentry = FALSE; + thedir->validentry = APR_FALSE; *new = thedir; ap_register_cleanup(cntxt, thedir, dir_cleanup, ap_null_cleanup); return APR_SUCCESS; @@ -122,11 +122,11 @@ ap_status_t ap_readdir(ap_dir_t *thedir) } if (rv == 0 && entries == 1) { - thedir->validentry = TRUE; + thedir->validentry = APR_TRUE; return APR_SUCCESS; } - thedir->validentry = FALSE; + thedir->validentry = APR_FALSE; if (rv) return APR_OS2_STATUS(rv); diff --git a/file_io/os2/open.c b/file_io/os2/open.c index b65805c546b..f24e5095551 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -79,8 +79,8 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil *new = dafile; dafile->cntxt = cntxt; - dafile->isopen = FALSE; - dafile->eof_hit = FALSE; + dafile->isopen = APR_FALSE; + dafile->eof_hit = APR_FALSE; dafile->buffer = NULL; dafile->flags = flag; @@ -137,13 +137,13 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil if (rv != 0) return APR_OS2_STATUS(rv); - dafile->isopen = TRUE; + dafile->isopen = APR_TRUE; dafile->fname = ap_pstrdup(cntxt, fname); dafile->filePtr = 0; dafile->bufpos = 0; dafile->dataRead = 0; dafile->direction = 0; - dafile->pipe = FALSE; + dafile->pipe = APR_FALSE; ap_register_cleanup(dafile->cntxt, dafile, apr_file_cleanup, ap_null_cleanup); return APR_SUCCESS; @@ -161,7 +161,7 @@ ap_status_t ap_close(ap_file_t *file) rc = DosClose(file->filedes); if (rc == 0) { - file->isopen = FALSE; + file->isopen = APR_FALSE; status = APR_SUCCESS; if (file->flags & APR_DELONCLOSE) { @@ -208,11 +208,11 @@ ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, ap_pool_t *c (*file)->cntxt = cont; } (*file)->filedes = *dafile; - (*file)->isopen = TRUE; - (*file)->buffered = FALSE; - (*file)->eof_hit = FALSE; + (*file)->isopen = APR_TRUE; + (*file)->buffered = APR_FALSE; + (*file)->eof_hit = APR_FALSE; (*file)->flags = 0; - (*file)->pipe = FALSE; + (*file)->pipe = APR_FALSE; return APR_SUCCESS; } @@ -237,11 +237,11 @@ ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont) (*thefile)->cntxt = cont; (*thefile)->filedes = 2; (*thefile)->fname = NULL; - (*thefile)->isopen = TRUE; - (*thefile)->buffered = FALSE; - (*thefile)->eof_hit = FALSE; + (*thefile)->isopen = APR_TRUE; + (*thefile)->buffered = APR_FALSE; + (*thefile)->eof_hit = APR_FALSE; (*thefile)->flags = 0; - (*thefile)->pipe = FALSE; + (*thefile)->pipe = APR_FALSE; return APR_SUCCESS; } diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 4ec94a889d8..bf4779888d8 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -91,7 +91,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) } (*in) = (ap_file_t *)ap_palloc(cont, sizeof(ap_file_t)); - rc = DosCreateEventSem(NULL, &(*in)->pipeSem, DC_SEM_SHARED, FALSE); + rc = DosCreateEventSem(NULL, &(*in)->pipeSem, DC_SEM_SHARED, APR_FALSE); if (rc) { DosClose(filedes[0]); @@ -111,8 +111,8 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*in)->cntxt = cont; (*in)->filedes = filedes[0]; (*in)->fname = ap_pstrdup(cont, pipename); - (*in)->isopen = TRUE; - (*in)->buffered = FALSE; + (*in)->isopen = APR_TRUE; + (*in)->buffered = APR_FALSE; (*in)->flags = 0; (*in)->pipe = 1; (*in)->timeout = -1; @@ -122,8 +122,8 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*out)->cntxt = cont; (*out)->filedes = filedes[1]; (*out)->fname = ap_pstrdup(cont, pipename); - (*out)->isopen = TRUE; - (*out)->buffered = FALSE; + (*out)->isopen = APR_TRUE; + (*out)->buffered = APR_FALSE; (*out)->flags = 0; (*out)->pipe = 1; (*out)->timeout = -1; diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index d63ae181353..19f97feb106 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -91,7 +91,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) rc = DosRead(thefile->filedes, thefile->buffer, APR_FILE_BUFSIZE, &thefile->dataRead ); if (thefile->dataRead == 0) { if (rc == 0) - thefile->eof_hit = TRUE; + thefile->eof_hit = APR_TRUE; break; } thefile->filePtr += thefile->dataRead; @@ -129,7 +129,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) *nbytes = bytesread; if (bytesread == 0) { - thefile->eof_hit = TRUE; + thefile->eof_hit = APR_TRUE; } return APR_SUCCESS; @@ -255,7 +255,7 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) } if (bytesread == 0) { - thefile->eof_hit = TRUE; + thefile->eof_hit = APR_TRUE; return APR_EOF; } diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 5b0d1d6a6cd..c4724798010 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -121,7 +121,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) if (thefile->bufpos >= thefile->dataRead) { thefile->dataRead = read(thefile->filedes, thefile->buffer, APR_FILE_BUFSIZE); if (thefile->dataRead == 0) { - thefile->eof_hit = TRUE; + thefile->eof_hit = APR_TRUE; break; } thefile->filePtr += thefile->dataRead; @@ -300,7 +300,7 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) } rv = read(thefile->filedes, ch, 1); if (rv == 0) { - thefile->eof_hit = TRUE; + thefile->eof_hit = APR_TRUE; return APR_EOF; } else if (rv != 1) { @@ -347,14 +347,14 @@ ap_status_t ap_flush(ap_file_t *thefile) ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) { ssize_t rv; - int i, used_unget = FALSE, beg_idx; + int i, used_unget = APR_FALSE, beg_idx; if(len <= 1) /* as per fgets() */ return APR_SUCCESS; if(thefile->ungetchar != -1){ str[0] = thefile->ungetchar; - used_unget = TRUE; + used_unget = APR_TRUE; beg_idx = 1; if(str[0] == '\n' || str[0] == '\r'){ thefile->ungetchar = -1; @@ -367,7 +367,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) for (i = beg_idx; i < len; i++) { rv = read(thefile->filedes, &str[i], 1); if (rv == 0) { - thefile->eof_hit = TRUE; + thefile->eof_hit = APR_TRUE; if(used_unget) thefile->filedes = -1; str[i] = '\0'; return APR_EOF; diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 012a523dc77..6827b8315b5 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -74,7 +74,7 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) } if (!DuplicateHandle(hCurrentProcess, old_file->filehand, hCurrentProcess, - &(*new_file)->filehand, 0, FALSE, + &(*new_file)->filehand, 0, APR_FALSE, DUPLICATE_SAME_ACCESS)) { return GetLastError(); } diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 974889dd03a..0d0a67dc540 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -92,7 +92,7 @@ * ugly way windows deals with case in the filesystem. * append -- Windows doesn't support the append concept when opening files. * APR needs to keep track of this, and always make sure we append - * correctly when writing to a file with this flag set TRUE. + * correctly when writing to a file with this flag set APR_TRUE. */ struct ap_file_t { diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 861f12b32e3..678a1e9f0c5 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -96,9 +96,9 @@ BOOLEAN is_exe(const char* fname, ap_pool_t *cont) { if (ext && (!strcasecmp(ext,".exe") || !strcasecmp(ext,".com") || !strcasecmp(ext,".bat") || !strcasecmp(ext,".cmd"))) { - return TRUE; + return APR_TRUE; } - return FALSE; + return APR_FALSE; } ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index f18e6aca015..f8fb906a8be 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -93,7 +93,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) SECURITY_ATTRIBUTES sa; sa.nLength = sizeof(sa); - sa.bInheritHandle = TRUE; + sa.bInheritHandle = APR_TRUE; sa.lpSecurityDescriptor = NULL; (*in) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index fb16769d834..46e957f5165 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -174,7 +174,7 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) return GetLastError(); } if (bread == 0) { - thefile->eof_hit = TRUE; + thefile->eof_hit = APR_TRUE; return APR_EOF; } return APR_SUCCESS; @@ -200,7 +200,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) } } if (bread == 0) { - thefile->eof_hit = TRUE; + thefile->eof_hit = APR_TRUE; return APR_EOF; } for (i=0; i> 8, TRUE, &is_negative, p, &sub_len); + p = conv_10((addr & 0x0000FF00) >> 8, APR_TRUE, &is_negative, p, &sub_len); *--p = '.'; - p = conv_10((addr & 0x00FF0000) >> 16, TRUE, &is_negative, p, &sub_len); + p = conv_10((addr & 0x00FF0000) >> 16, APR_TRUE, &is_negative, p, &sub_len); *--p = '.'; - p = conv_10((addr & 0xFF000000) >> 24, TRUE, &is_negative, p, &sub_len); + p = conv_10((addr & 0xFF000000) >> 24, APR_TRUE, &is_negative, p, &sub_len); *len = buf_end - p; return (p); @@ -495,7 +495,7 @@ static char *conv_sockaddr_in(struct sockaddr_in *si, char *buf_end, int *len) bool_int is_negative; int sub_len; - p = conv_10(ntohs(si->sin_port), TRUE, &is_negative, p, &sub_len); + p = conv_10(ntohs(si->sin_port), APR_TRUE, &is_negative, p, &sub_len); *--p = ':'; p = conv_in_addr(&si->sin_addr, p, &sub_len); @@ -530,7 +530,7 @@ static char *conv_fp(register char format, register double num, */ if (ap_isalpha(*p)) { *len = strlen(strcpy(buf, p)); - *is_negative = FALSE; + *is_negative = APR_FALSE; return (buf); } @@ -572,7 +572,7 @@ static char *conv_fp(register char format, register double num, *s++ = format; /* either e or E */ decimal_point--; if (decimal_point != 0) { - p = conv_10((wide_int) decimal_point, FALSE, &exponent_is_negative, + p = conv_10((wide_int) decimal_point, APR_FALSE, &exponent_is_negative, &temp[EXPONENT_LENGTH], &t_len); *s++ = exponent_is_negative ? '-' : '+'; diff --git a/locks/os2/locks.c b/locks/os2/locks.c index dc288b6c9c5..f4620fac8ee 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -99,7 +99,7 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, ap_lockscope_e else semname = ap_pstrcat(cont, "/SEM32/", fname, NULL); - rc = DosCreateMutexSem(semname, &(new->hMutex), scope == APR_CROSS_PROCESS ? DC_SEM_SHARED : 0, FALSE); + rc = DosCreateMutexSem(semname, &(new->hMutex), scope == APR_CROSS_PROCESS ? DC_SEM_SHARED : 0, APR_FALSE); *lock = new; if (!rc) diff --git a/locks/win32/locks.c b/locks/win32/locks.c index a9031a05d47..cfb0207428a 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -77,16 +77,16 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, sec.lpSecurityDescriptor = NULL; if (scope == APR_CROSS_PROCESS || scope == APR_LOCKALL) { - sec.bInheritHandle = TRUE; + sec.bInheritHandle = APR_TRUE; } else { - sec.bInheritHandle = FALSE; + sec.bInheritHandle = APR_FALSE; } if (scope == APR_INTRAPROCESS) { InitializeCriticalSection(&newlock->section); } else { - newlock->mutex = CreateMutex(&sec, FALSE, fname); + newlock->mutex = CreateMutex(&sec, APR_FALSE, fname); } *lock = newlock; return APR_SUCCESS; @@ -104,7 +104,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, return APR_ENOMEM; } (*lock)->fname = ap_pstrdup(cont, fname); - (*lock)->mutex = OpenMutex(MUTEX_ALL_ACCESS, TRUE, fname); + (*lock)->mutex = OpenMutex(MUTEX_ALL_ACCESS, APR_TRUE, fname); if ((*lock)->mutex == NULL) { return APR_EEXIST; diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 0d853a730ab..db1a6a40249 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -872,7 +872,7 @@ API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode return NULL; } -/* return TRUE iff a is an ancestor of b +/* return APR_TRUE iff a is an ancestor of b * NULL is considered an ancestor of all pools */ API_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) diff --git a/misc/win32/names.c b/misc/win32/names.c index d831842c929..4999045e88f 100644 --- a/misc/win32/names.c +++ b/misc/win32/names.c @@ -60,7 +60,7 @@ #include #include -/* Returns TRUE if the input string is a string +/* Returns APR_TRUE if the input string is a string * of one or more '.' characters. */ static BOOL OnlyDots(char *pString) @@ -68,13 +68,13 @@ static BOOL OnlyDots(char *pString) char *c; if (*pString == '\0') - return FALSE; + return APR_FALSE; for (c = pString;*c;c++) if (*c != '.') - return FALSE; + return APR_FALSE; - return TRUE; + return APR_TRUE; } /* Accepts as input a pathname, and tries to match it to an @@ -88,8 +88,8 @@ API_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, char buf[HUGE_STRING_LEN]; char *pInputName; char *p, *q; - BOOL bDone = FALSE; - BOOL bFileExists = TRUE; + BOOL bDone = APR_FALSE; + BOOL bFileExists = APR_TRUE; HANDLE hFind; WIN32_FIND_DATA wfd; @@ -114,7 +114,7 @@ API_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, /* If all we have is a drive letter, then we are done */ if (strlen(pInputName) == 2) - bDone = TRUE; + bDone = APR_TRUE; } q = p; @@ -151,7 +151,7 @@ API_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, *p = '\0'; if (strchr(q, '*') || strchr(q, '?')) - bFileExists = FALSE; + bFileExists = APR_FALSE; /* If the path exists so far, call FindFirstFile * again. However, if this portion of the path contains @@ -164,7 +164,7 @@ API_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, hFind = FindFirstFile(pInputName, &wfd); if (hFind == INVALID_HANDLE_VALUE) { - bFileExists = FALSE; + bFileExists = APR_FALSE; } else { FindClose(hFind); @@ -185,7 +185,7 @@ API_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, p = strchr(p, '\\'); } else { - bDone = TRUE; + bDone = APR_TRUE; } } diff --git a/misc/win32/start.c b/misc/win32/start.c index 95fa14d960e..e56172811b0 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -100,11 +100,11 @@ ap_status_t ap_get_oslevel(ap_pool_t *cont, ap_oslevel_e *level) { static OSVERSIONINFO oslev; static unsigned int servpack = 0; - static BOOL first = TRUE; + static BOOL first = APR_TRUE; char *pservpack; if (first) { - first = FALSE; + first = APR_FALSE; oslev.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&oslev); if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) { diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 737af928b10..5e6514392d7 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -106,7 +106,7 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) return APR_OS2_STATUS(sock_errno()); } (*new)->timeout = -1; - (*new)->nonblock = FALSE; + (*new)->nonblock = APR_FALSE; ap_register_cleanup((*new)->cntxt, (void *)(*new), socket_cleanup, ap_null_cleanup); return APR_SUCCESS; @@ -158,7 +158,7 @@ ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_pool_t *con (*new)->local_addr = sock->local_addr; (*new)->addr_len = sizeof(struct sockaddr_in); (*new)->timeout = -1; - (*new)->nonblock = FALSE; + (*new)->nonblock = APR_FALSE; (*new)->socketdes = accept(sock->socketdes, (struct sockaddr *)(*new)->remote_addr, &(*new)->addr_len); diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 33d39fb0713..008a8d54055 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -225,7 +225,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, overlapped.Offset = *offset; } #ifdef WAIT_FOR_EVENT - overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + overlapped.hEvent = CreateEvent(NULL, FALSE, APR_FALSE, NULL); #endif rv = TransmitFile(sock->sock, /* socket */ diff --git a/shmem/unix/mm/mm.h b/shmem/unix/mm/mm.h index 3c029e63061..b925efe3b6e 100644 --- a/shmem/unix/mm/mm.h +++ b/shmem/unix/mm/mm.h @@ -92,11 +92,11 @@ extern int flock(int, int); extern char *strerror(int); #endif -#if !defined(FALSE) -#define FALSE 0 +#if !defined(APR_FALSE) +#define APR_FALSE 0 #endif -#if !defined(TRUE) -#define TRUE !FALSE +#if !defined(APR_TRUE) +#define APR_TRUE !APR_FALSE #endif #if !defined(NULL) #define NULL (void *)0 diff --git a/shmem/unix/mm/mm_alloc.c b/shmem/unix/mm/mm_alloc.c index 049a4ab20f2..6add51c0c74 100644 --- a/shmem/unix/mm/mm_alloc.c +++ b/shmem/unix/mm/mm_alloc.c @@ -120,7 +120,7 @@ void mm_destroy(MM *mm) int mm_lock(MM *mm, mm_lock_mode mode) { if (mm == NULL) - return FALSE; + return APR_FALSE; return mm_core_lock((void *)mm, mode); } @@ -130,7 +130,7 @@ int mm_lock(MM *mm, mm_lock_mode mode) int mm_unlock(MM *mm) { if (mm == NULL) - return FALSE; + return APR_FALSE; return mm_core_unlock((void *)mm); } diff --git a/shmem/unix/mm/mm_core.c b/shmem/unix/mm/mm_core.c index 37d938ea0b1..4225cd0359f 100644 --- a/shmem/unix/mm/mm_core.c +++ b/shmem/unix/mm/mm_core.c @@ -73,7 +73,7 @@ static size_t mm_core_mapoffset = 1024*1024*1; /* we share with other apps */ static void mm_core_init(void) { - static int initialized = FALSE; + static int initialized = APR_FALSE; if (!initialized) { #if defined(MM_SEMT_FCNTL) mm_core_dolock_rd.l_whence = SEEK_SET; /* from current point */ @@ -103,7 +103,7 @@ static void mm_core_init(void) mm_core_dounlock[0].sem_op = -1; mm_core_dounlock[0].sem_flg = SEM_UNDO; #endif - initialized = TRUE; + initialized = APR_TRUE; } return; } @@ -519,7 +519,7 @@ int mm_core_lock(const void *core, mm_lock_mode mode) int fdsem; if (core == NULL) - return FALSE; + return APR_FALSE; mc = (mem_core *)((char *)core-SIZEOF_mem_core); #if !defined(MM_SEMT_FLOCK) fdsem = mc->mc_fdsem; @@ -566,10 +566,10 @@ int mm_core_lock(const void *core, mm_lock_mode mode) if (rc < 0) { ERR(MM_ERR_CORE|MM_ERR_SYSTEM, "Failed to lock"); - rc = FALSE; + rc = APR_FALSE; } else - rc = TRUE; + rc = APR_TRUE; return rc; } @@ -580,7 +580,7 @@ int mm_core_unlock(const void *core) int fdsem; if (core == NULL) - return FALSE; + return APR_FALSE; mc = (mem_core *)((char *)core-SIZEOF_mem_core); #if !defined(MM_SEMT_FLOCK) fdsem = mc->mc_fdsem; @@ -616,10 +616,10 @@ int mm_core_unlock(const void *core) if (rc < 0) { ERR(MM_ERR_CORE|MM_ERR_SYSTEM, "Failed to unlock"); - rc = FALSE; + rc = APR_FALSE; } else - rc = TRUE; + rc = APR_TRUE; return rc; } diff --git a/shmem/unix/mm/mm_global.c b/shmem/unix/mm/mm_global.c index 53efcca58c7..c42415880db 100644 --- a/shmem/unix/mm/mm_global.c +++ b/shmem/unix/mm/mm_global.c @@ -52,10 +52,10 @@ static MM *mm_global = NULL; int MM_create(size_t size, const char *file) { if (mm_global != NULL) - return FALSE; + return APR_FALSE; if ((mm_global = mm_create(size, file)) == NULL) - return FALSE; - return TRUE; + return APR_FALSE; + return APR_TRUE; } int MM_permission(mode_t mode, uid_t owner, gid_t group) @@ -77,14 +77,14 @@ void MM_destroy(void) int MM_lock(mm_lock_mode mode) { if (mm_global == NULL) - return FALSE; + return APR_FALSE; return mm_lock(mm_global, mode); } int MM_unlock(void) { if (mm_global == NULL) - return FALSE; + return APR_FALSE; return mm_unlock(mm_global); } diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 6fc0f755a9c..726fbf5f0be 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -88,7 +88,7 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) (*new)->child_err = NULL; (*new)->currdir = NULL; (*new)->cmdtype = APR_PROGRAM; - (*new)->detached = FALSE; + (*new)->detached = APR_FALSE; return APR_SUCCESS; } @@ -177,13 +177,13 @@ ap_status_t ap_fork(ap_proc_t **proc, ap_pool_t *cont) } else if (pid == 0) { (*proc)->pid = pid; (*proc)->attr = NULL; - (*proc)->running = TRUE; + (*proc)->running = APR_TRUE; return APR_INCHILD; } (*proc)->pid = pid; (*proc)->attr = NULL; - (*proc)->running = TRUE; + (*proc)->running = APR_TRUE; return APR_INPARENT; } @@ -226,7 +226,7 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, char **newargs; char savedir[300]; HFILE save_in, save_out, save_err, dup; - int criticalsection = FALSE; + int criticalsection = APR_FALSE; char *extension, *newprogname, *extra_arg = NULL, *cmdline, *cmdline_pos; char interpreter[1024]; char error_object[260]; @@ -242,11 +242,11 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, } (*new)->cntxt = cont; - (*new)->running = FALSE; + (*new)->running = APR_FALSE; /* Prevent other threads from running while these process-wide resources are modified */ if (attr->child_in || attr->child_out || attr->child_err || attr->currdir) { - criticalsection = TRUE; + criticalsection = APR_TRUE; DosEnterCritSec(); } diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index b516a2cdcb5..12c221135ac 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -82,7 +82,7 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) (*new)->child_err = NULL; (*new)->currdir = NULL; (*new)->cmdtype = APR_PROGRAM; - (*new)->detached = TRUE; + (*new)->detached = APR_TRUE; memset(&(*new)->si, 0, sizeof((*new)->si)); @@ -277,14 +277,14 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, hCurrentProcess = GetCurrentProcess(); if ((attr->child_in && !DuplicateHandle(hCurrentProcess, attr->parent_in->filehand, hCurrentProcess, - &hParentindup, 0, FALSE, + &hParentindup, 0, APR_FALSE, DUPLICATE_SAME_ACCESS)) || (attr->child_out && !DuplicateHandle(hCurrentProcess, attr->parent_out->filehand, hCurrentProcess, &hParentoutdup, - 0, FALSE, DUPLICATE_SAME_ACCESS)) + 0, APR_FALSE, DUPLICATE_SAME_ACCESS)) || (attr->child_err && !DuplicateHandle(hCurrentProcess, attr->parent_err->filehand, hCurrentProcess, &hParenterrdup, - 0, FALSE, DUPLICATE_SAME_ACCESS))) { + 0, APR_FALSE, DUPLICATE_SAME_ACCESS))) { if (attr->child_in) { ap_close(attr->child_in); ap_close(attr->parent_in); @@ -346,7 +346,7 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, } - if (CreateProcess(NULL, cmdline, NULL, NULL, TRUE, 0, pEnvBlock, attr->currdir, + if (CreateProcess(NULL, cmdline, NULL, NULL, APR_TRUE, 0, pEnvBlock, attr->currdir, &attr->si, &(*new)->pi)) { if (attr->child_in) { ap_close(attr->child_in); From 8be7771c7187c66bed4bd81a68f2442db5d0a045 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Apr 2000 08:30:20 +0000 Subject: [PATCH 0003/7878] Clean up a few Win32 build oversights before the alpha. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59976 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ---- aprlib.dsp | 4 ---- 2 files changed, 8 deletions(-) diff --git a/apr.dsp b/apr.dsp index c30f9ecc16b..746feec5732 100644 --- a/apr.dsp +++ b/apr.dsp @@ -278,10 +278,6 @@ SOURCE=.\include\apr_network_io.h # End Source File # Begin Source File -SOURCE=.\inc\apr_pools.h -# End Source File -# Begin Source File - SOURCE=.\include\apr_pools.h # End Source File # Begin Source File diff --git a/aprlib.dsp b/aprlib.dsp index c30f9ecc16b..746feec5732 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -278,10 +278,6 @@ SOURCE=.\include\apr_network_io.h # End Source File # Begin Source File -SOURCE=.\inc\apr_pools.h -# End Source File -# Begin Source File - SOURCE=.\include\apr_pools.h # End Source File # Begin Source File From 85d08e1f5d10ad48f8697025fe80bee184f4d60b Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 28 Apr 2000 15:17:00 +0000 Subject: [PATCH 0004/7878] Backout APR_TRUE|FALSE patch on Windows system calls. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59977 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index f8fb906a8be..f18e6aca015 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -93,7 +93,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) SECURITY_ATTRIBUTES sa; sa.nLength = sizeof(sa); - sa.bInheritHandle = APR_TRUE; + sa.bInheritHandle = TRUE; sa.lpSecurityDescriptor = NULL; (*in) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); From 0c49c68fc86d2cdf00a009c935c8ecd49ac818c4 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 28 Apr 2000 15:21:14 +0000 Subject: [PATCH 0005/7878] Back out APR_TRUE|FALSE patch for Win32 system calls. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59978 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/locks.c | 8 ++++---- threadproc/win32/proc.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/locks/win32/locks.c b/locks/win32/locks.c index cfb0207428a..a9031a05d47 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -77,16 +77,16 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, sec.lpSecurityDescriptor = NULL; if (scope == APR_CROSS_PROCESS || scope == APR_LOCKALL) { - sec.bInheritHandle = APR_TRUE; + sec.bInheritHandle = TRUE; } else { - sec.bInheritHandle = APR_FALSE; + sec.bInheritHandle = FALSE; } if (scope == APR_INTRAPROCESS) { InitializeCriticalSection(&newlock->section); } else { - newlock->mutex = CreateMutex(&sec, APR_FALSE, fname); + newlock->mutex = CreateMutex(&sec, FALSE, fname); } *lock = newlock; return APR_SUCCESS; @@ -104,7 +104,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, return APR_ENOMEM; } (*lock)->fname = ap_pstrdup(cont, fname); - (*lock)->mutex = OpenMutex(MUTEX_ALL_ACCESS, APR_TRUE, fname); + (*lock)->mutex = OpenMutex(MUTEX_ALL_ACCESS, TRUE, fname); if ((*lock)->mutex == NULL) { return APR_EEXIST; diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 12c221135ac..a171cb447c9 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -277,14 +277,14 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, hCurrentProcess = GetCurrentProcess(); if ((attr->child_in && !DuplicateHandle(hCurrentProcess, attr->parent_in->filehand, hCurrentProcess, - &hParentindup, 0, APR_FALSE, + &hParentindup, 0, FALSE, DUPLICATE_SAME_ACCESS)) || (attr->child_out && !DuplicateHandle(hCurrentProcess, attr->parent_out->filehand, hCurrentProcess, &hParentoutdup, - 0, APR_FALSE, DUPLICATE_SAME_ACCESS)) + 0, FALSE, DUPLICATE_SAME_ACCESS)) || (attr->child_err && !DuplicateHandle(hCurrentProcess, attr->parent_err->filehand, hCurrentProcess, &hParenterrdup, - 0, APR_FALSE, DUPLICATE_SAME_ACCESS))) { + 0, FALSE, DUPLICATE_SAME_ACCESS))) { if (attr->child_in) { ap_close(attr->child_in); ap_close(attr->parent_in); @@ -346,7 +346,7 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, } - if (CreateProcess(NULL, cmdline, NULL, NULL, APR_TRUE, 0, pEnvBlock, attr->currdir, + if (CreateProcess(NULL, cmdline, NULL, NULL, TRUE, 0, pEnvBlock, attr->currdir, &attr->si, &(*new)->pi)) { if (attr->child_in) { ap_close(attr->child_in); From 081c896615ebf9c1d0b052bafa8ceeb4193b7367 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 28 Apr 2000 15:23:14 +0000 Subject: [PATCH 0006/7878] Backout APR_TRUE|FALSE patch for Win32 system calls. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59979 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 008a8d54055..33d39fb0713 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -225,7 +225,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, overlapped.Offset = *offset; } #ifdef WAIT_FOR_EVENT - overlapped.hEvent = CreateEvent(NULL, FALSE, APR_FALSE, NULL); + overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); #endif rv = TransmitFile(sock->sock, /* socket */ From ff6c7d8f423d69bf63dae3bbb8691479e015bb7b Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 28 Apr 2000 15:24:40 +0000 Subject: [PATCH 0007/7878] One more... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59980 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 6827b8315b5..012a523dc77 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -74,7 +74,7 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) } if (!DuplicateHandle(hCurrentProcess, old_file->filehand, hCurrentProcess, - &(*new_file)->filehand, 0, APR_FALSE, + &(*new_file)->filehand, 0, FALSE, DUPLICATE_SAME_ACCESS)) { return GetLastError(); } From bd242bc8cfee5868bf4037b8e1c9635c57264864 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 28 Apr 2000 18:24:58 +0000 Subject: [PATCH 0008/7878] Win32: install ab.exe fix dependency in Apache.dsw (ab is dependent on aprlib and ap) fix ab and htdigest projects so that they find all header files define ap_signal() in apr.hw - this is o.k. for casual use as with cmd-line programs use API_VAR_EXPORT as appropriate in getopt.c general: ab doesn't need to declare ap_optarg/ap_optind; fix a warning htdigest needs to call ap_initialize() to avoid segfault at startup git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59981 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 ++ misc/win32/getopt.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index fab1dd365ab..4b29e31d68e 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -140,6 +140,8 @@ typedef int gid_t; #define API_VAR_IMPORT extern _declspec(dllimport) #define API_VAR_EXPORT +#define ap_signal(a,b) signal(a,b) + /* struct iovec is needed to emulate Unix writev */ struct iovec { char* iov_base; diff --git a/misc/win32/getopt.c b/misc/win32/getopt.c index bae5406a0f2..ee086dd5d35 100644 --- a/misc/win32/getopt.c +++ b/misc/win32/getopt.c @@ -36,11 +36,13 @@ #include #include "misc.h" -int ap_opterr = 1, /* if error message should be printed */ +API_VAR_EXPORT int + ap_opterr = 1, /* if error message should be printed */ ap_optind = 1, /* index into parent argv vector */ ap_optopt, /* character checked for validity */ ap_optreset; /* reset getopt */ -char *ap_optarg = ""; /* argument associated with option */ +API_VAR_EXPORT char * + ap_optarg = ""; /* argument associated with option */ #define EMSG "" From a837b007d064c135065fdad5e50b3c535e2c0ccb Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 28 Apr 2000 18:27:45 +0000 Subject: [PATCH 0009/7878] Use $(MAKE) instead of make in Makefiles. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59982 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- shmem/unix/Makefile.in | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index b885139d8bc..a95c476fb75 100644 --- a/Makefile.in +++ b/Makefile.in @@ -61,7 +61,7 @@ distclean: subdirs_distclean -$(RM) -f config.cache config.status config.log configure -$(RM) -f Makefile -$(RM) -rf objs - cd test; make distclean; cd .. + cd test; $(MAKE) distclean; cd .. subdirs: @for i in $(SUBDIRS); do \ diff --git a/shmem/unix/Makefile.in b/shmem/unix/Makefile.in index 085863ddb8c..4717c9994da 100644 --- a/shmem/unix/Makefile.in +++ b/shmem/unix/Makefile.in @@ -25,17 +25,17 @@ all: $(LIB) clean: $(RM) -f *.o *.a *.so - cd mm; make clean; cd .. + cd mm; $(MAKE) clean; cd .. distclean: clean -$(RM) -f Makefile - cd mm; make distclean; cd .. + cd mm; $(MAKE) distclean; cd .. $(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ - cd mm; make; cd .. + cd mm; $(MAKE); cd .. cp mm/mm_global.o mm/mm_alloc.o mm/mm_core.o mm/mm_lib.o mm/mm_vers.o . $(AR) cr $@ $(OBJS) $(RANLIB) $@ From fc1fa3bd6a6fec38de12dceeed48e63f1b702100 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 28 Apr 2000 18:27:49 +0000 Subject: [PATCH 0010/7878] back out APR_ prefix for TRUE,FALSE git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59983 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/beos/readwrite.c | 10 +++++----- file_io/os2/dir.c | 6 +++--- file_io/os2/open.c | 26 +++++++++++++------------- file_io/os2/pipe.c | 10 +++++----- file_io/os2/readwrite.c | 6 +++--- file_io/unix/readwrite.c | 10 +++++----- file_io/win32/fileio.h | 2 +- file_io/win32/filestat.c | 4 ++-- file_io/win32/readwrite.c | 4 ++-- include/apr_general.h | 4 ++-- include/arch/win32/fileio.h | 2 +- lib/apr_pools.c | 2 +- lib/apr_snprintf.c | 30 +++++++++++++++--------------- locks/os2/locks.c | 2 +- memory/unix/apr_pools.c | 2 +- misc/win32/names.c | 20 ++++++++++---------- misc/win32/start.c | 4 ++-- network_io/os2/sockets.c | 4 ++-- shmem/unix/mm/mm.h | 8 ++++---- shmem/unix/mm/mm_alloc.c | 4 ++-- shmem/unix/mm/mm_core.c | 16 ++++++++-------- shmem/unix/mm/mm_global.c | 10 +++++----- threadproc/os2/proc.c | 12 ++++++------ threadproc/win32/proc.c | 2 +- 24 files changed, 100 insertions(+), 100 deletions(-) diff --git a/file_io/beos/readwrite.c b/file_io/beos/readwrite.c index 033c2bdabcb..96aaf5247db 100644 --- a/file_io/beos/readwrite.c +++ b/file_io/beos/readwrite.c @@ -83,7 +83,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) if (thefile->bufpos >= thefile->dataRead) { thefile->dataRead = read(thefile->filedes, thefile->buffer, APR_FILE_BUFSIZE); if (thefile->dataRead == 0) { - thefile->eof_hit = APR_TRUE; + thefile->eof_hit = TRUE; break; } thefile->filePtr += thefile->dataRead; @@ -219,7 +219,7 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) } rv = read(thefile->filedes, ch, 1); if (rv == 0) { - thefile->eof_hit = APR_TRUE; + thefile->eof_hit = TRUE; return APR_EOF; } else if (rv != 1) { @@ -266,14 +266,14 @@ ap_status_t ap_flush(ap_file_t *thefile) ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) { ssize_t rv; - int i, used_unget = APR_FALSE, beg_idx; + int i, used_unget = FALSE, beg_idx; if(len <= 1) /* as per fgets() */ return APR_SUCCESS; if(thefile->ungetchar != -1){ str[0] = thefile->ungetchar; - used_unget = APR_TRUE; + used_unget = TRUE; beg_idx = 1; if(str[0] == '\n' || str[0] == '\r'){ thefile->ungetchar = -1; @@ -286,7 +286,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) for (i = beg_idx; i < len; i++) { rv = read(thefile->filedes, &str[i], 1); if (rv == 0) { - thefile->eof_hit = APR_TRUE; + thefile->eof_hit = TRUE; if(used_unget) thefile->filedes = -1; str[i] = '\0'; return APR_EOF; diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index a175dee5d9e..34f973ec63c 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -82,7 +82,7 @@ ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cntxt) return APR_ENOMEM; thedir->handle = 0; - thedir->validentry = APR_FALSE; + thedir->validentry = FALSE; *new = thedir; ap_register_cleanup(cntxt, thedir, dir_cleanup, ap_null_cleanup); return APR_SUCCESS; @@ -122,11 +122,11 @@ ap_status_t ap_readdir(ap_dir_t *thedir) } if (rv == 0 && entries == 1) { - thedir->validentry = APR_TRUE; + thedir->validentry = TRUE; return APR_SUCCESS; } - thedir->validentry = APR_FALSE; + thedir->validentry = FALSE; if (rv) return APR_OS2_STATUS(rv); diff --git a/file_io/os2/open.c b/file_io/os2/open.c index f24e5095551..b65805c546b 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -79,8 +79,8 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil *new = dafile; dafile->cntxt = cntxt; - dafile->isopen = APR_FALSE; - dafile->eof_hit = APR_FALSE; + dafile->isopen = FALSE; + dafile->eof_hit = FALSE; dafile->buffer = NULL; dafile->flags = flag; @@ -137,13 +137,13 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil if (rv != 0) return APR_OS2_STATUS(rv); - dafile->isopen = APR_TRUE; + dafile->isopen = TRUE; dafile->fname = ap_pstrdup(cntxt, fname); dafile->filePtr = 0; dafile->bufpos = 0; dafile->dataRead = 0; dafile->direction = 0; - dafile->pipe = APR_FALSE; + dafile->pipe = FALSE; ap_register_cleanup(dafile->cntxt, dafile, apr_file_cleanup, ap_null_cleanup); return APR_SUCCESS; @@ -161,7 +161,7 @@ ap_status_t ap_close(ap_file_t *file) rc = DosClose(file->filedes); if (rc == 0) { - file->isopen = APR_FALSE; + file->isopen = FALSE; status = APR_SUCCESS; if (file->flags & APR_DELONCLOSE) { @@ -208,11 +208,11 @@ ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, ap_pool_t *c (*file)->cntxt = cont; } (*file)->filedes = *dafile; - (*file)->isopen = APR_TRUE; - (*file)->buffered = APR_FALSE; - (*file)->eof_hit = APR_FALSE; + (*file)->isopen = TRUE; + (*file)->buffered = FALSE; + (*file)->eof_hit = FALSE; (*file)->flags = 0; - (*file)->pipe = APR_FALSE; + (*file)->pipe = FALSE; return APR_SUCCESS; } @@ -237,11 +237,11 @@ ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont) (*thefile)->cntxt = cont; (*thefile)->filedes = 2; (*thefile)->fname = NULL; - (*thefile)->isopen = APR_TRUE; - (*thefile)->buffered = APR_FALSE; - (*thefile)->eof_hit = APR_FALSE; + (*thefile)->isopen = TRUE; + (*thefile)->buffered = FALSE; + (*thefile)->eof_hit = FALSE; (*thefile)->flags = 0; - (*thefile)->pipe = APR_FALSE; + (*thefile)->pipe = FALSE; return APR_SUCCESS; } diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index bf4779888d8..4ec94a889d8 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -91,7 +91,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) } (*in) = (ap_file_t *)ap_palloc(cont, sizeof(ap_file_t)); - rc = DosCreateEventSem(NULL, &(*in)->pipeSem, DC_SEM_SHARED, APR_FALSE); + rc = DosCreateEventSem(NULL, &(*in)->pipeSem, DC_SEM_SHARED, FALSE); if (rc) { DosClose(filedes[0]); @@ -111,8 +111,8 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*in)->cntxt = cont; (*in)->filedes = filedes[0]; (*in)->fname = ap_pstrdup(cont, pipename); - (*in)->isopen = APR_TRUE; - (*in)->buffered = APR_FALSE; + (*in)->isopen = TRUE; + (*in)->buffered = FALSE; (*in)->flags = 0; (*in)->pipe = 1; (*in)->timeout = -1; @@ -122,8 +122,8 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*out)->cntxt = cont; (*out)->filedes = filedes[1]; (*out)->fname = ap_pstrdup(cont, pipename); - (*out)->isopen = APR_TRUE; - (*out)->buffered = APR_FALSE; + (*out)->isopen = TRUE; + (*out)->buffered = FALSE; (*out)->flags = 0; (*out)->pipe = 1; (*out)->timeout = -1; diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 19f97feb106..d63ae181353 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -91,7 +91,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) rc = DosRead(thefile->filedes, thefile->buffer, APR_FILE_BUFSIZE, &thefile->dataRead ); if (thefile->dataRead == 0) { if (rc == 0) - thefile->eof_hit = APR_TRUE; + thefile->eof_hit = TRUE; break; } thefile->filePtr += thefile->dataRead; @@ -129,7 +129,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) *nbytes = bytesread; if (bytesread == 0) { - thefile->eof_hit = APR_TRUE; + thefile->eof_hit = TRUE; } return APR_SUCCESS; @@ -255,7 +255,7 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) } if (bytesread == 0) { - thefile->eof_hit = APR_TRUE; + thefile->eof_hit = TRUE; return APR_EOF; } diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index c4724798010..5b0d1d6a6cd 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -121,7 +121,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) if (thefile->bufpos >= thefile->dataRead) { thefile->dataRead = read(thefile->filedes, thefile->buffer, APR_FILE_BUFSIZE); if (thefile->dataRead == 0) { - thefile->eof_hit = APR_TRUE; + thefile->eof_hit = TRUE; break; } thefile->filePtr += thefile->dataRead; @@ -300,7 +300,7 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) } rv = read(thefile->filedes, ch, 1); if (rv == 0) { - thefile->eof_hit = APR_TRUE; + thefile->eof_hit = TRUE; return APR_EOF; } else if (rv != 1) { @@ -347,14 +347,14 @@ ap_status_t ap_flush(ap_file_t *thefile) ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) { ssize_t rv; - int i, used_unget = APR_FALSE, beg_idx; + int i, used_unget = FALSE, beg_idx; if(len <= 1) /* as per fgets() */ return APR_SUCCESS; if(thefile->ungetchar != -1){ str[0] = thefile->ungetchar; - used_unget = APR_TRUE; + used_unget = TRUE; beg_idx = 1; if(str[0] == '\n' || str[0] == '\r'){ thefile->ungetchar = -1; @@ -367,7 +367,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) for (i = beg_idx; i < len; i++) { rv = read(thefile->filedes, &str[i], 1); if (rv == 0) { - thefile->eof_hit = APR_TRUE; + thefile->eof_hit = TRUE; if(used_unget) thefile->filedes = -1; str[i] = '\0'; return APR_EOF; diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 0d0a67dc540..974889dd03a 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -92,7 +92,7 @@ * ugly way windows deals with case in the filesystem. * append -- Windows doesn't support the append concept when opening files. * APR needs to keep track of this, and always make sure we append - * correctly when writing to a file with this flag set APR_TRUE. + * correctly when writing to a file with this flag set TRUE. */ struct ap_file_t { diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 678a1e9f0c5..861f12b32e3 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -96,9 +96,9 @@ BOOLEAN is_exe(const char* fname, ap_pool_t *cont) { if (ext && (!strcasecmp(ext,".exe") || !strcasecmp(ext,".com") || !strcasecmp(ext,".bat") || !strcasecmp(ext,".cmd"))) { - return APR_TRUE; + return TRUE; } - return APR_FALSE; + return FALSE; } ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 46e957f5165..fb16769d834 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -174,7 +174,7 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) return GetLastError(); } if (bread == 0) { - thefile->eof_hit = APR_TRUE; + thefile->eof_hit = TRUE; return APR_EOF; } return APR_SUCCESS; @@ -200,7 +200,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) } } if (bread == 0) { - thefile->eof_hit = APR_TRUE; + thefile->eof_hit = TRUE; return APR_EOF; } for (i=0; i> 8, APR_TRUE, &is_negative, p, &sub_len); + p = conv_10((addr & 0x0000FF00) >> 8, TRUE, &is_negative, p, &sub_len); *--p = '.'; - p = conv_10((addr & 0x00FF0000) >> 16, APR_TRUE, &is_negative, p, &sub_len); + p = conv_10((addr & 0x00FF0000) >> 16, TRUE, &is_negative, p, &sub_len); *--p = '.'; - p = conv_10((addr & 0xFF000000) >> 24, APR_TRUE, &is_negative, p, &sub_len); + p = conv_10((addr & 0xFF000000) >> 24, TRUE, &is_negative, p, &sub_len); *len = buf_end - p; return (p); @@ -495,7 +495,7 @@ static char *conv_sockaddr_in(struct sockaddr_in *si, char *buf_end, int *len) bool_int is_negative; int sub_len; - p = conv_10(ntohs(si->sin_port), APR_TRUE, &is_negative, p, &sub_len); + p = conv_10(ntohs(si->sin_port), TRUE, &is_negative, p, &sub_len); *--p = ':'; p = conv_in_addr(&si->sin_addr, p, &sub_len); @@ -530,7 +530,7 @@ static char *conv_fp(register char format, register double num, */ if (ap_isalpha(*p)) { *len = strlen(strcpy(buf, p)); - *is_negative = APR_FALSE; + *is_negative = FALSE; return (buf); } @@ -572,7 +572,7 @@ static char *conv_fp(register char format, register double num, *s++ = format; /* either e or E */ decimal_point--; if (decimal_point != 0) { - p = conv_10((wide_int) decimal_point, APR_FALSE, &exponent_is_negative, + p = conv_10((wide_int) decimal_point, FALSE, &exponent_is_negative, &temp[EXPONENT_LENGTH], &t_len); *s++ = exponent_is_negative ? '-' : '+'; diff --git a/locks/os2/locks.c b/locks/os2/locks.c index f4620fac8ee..dc288b6c9c5 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -99,7 +99,7 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, ap_lockscope_e else semname = ap_pstrcat(cont, "/SEM32/", fname, NULL); - rc = DosCreateMutexSem(semname, &(new->hMutex), scope == APR_CROSS_PROCESS ? DC_SEM_SHARED : 0, APR_FALSE); + rc = DosCreateMutexSem(semname, &(new->hMutex), scope == APR_CROSS_PROCESS ? DC_SEM_SHARED : 0, FALSE); *lock = new; if (!rc) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index db1a6a40249..0d853a730ab 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -872,7 +872,7 @@ API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode return NULL; } -/* return APR_TRUE iff a is an ancestor of b +/* return TRUE iff a is an ancestor of b * NULL is considered an ancestor of all pools */ API_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) diff --git a/misc/win32/names.c b/misc/win32/names.c index 4999045e88f..d831842c929 100644 --- a/misc/win32/names.c +++ b/misc/win32/names.c @@ -60,7 +60,7 @@ #include #include -/* Returns APR_TRUE if the input string is a string +/* Returns TRUE if the input string is a string * of one or more '.' characters. */ static BOOL OnlyDots(char *pString) @@ -68,13 +68,13 @@ static BOOL OnlyDots(char *pString) char *c; if (*pString == '\0') - return APR_FALSE; + return FALSE; for (c = pString;*c;c++) if (*c != '.') - return APR_FALSE; + return FALSE; - return APR_TRUE; + return TRUE; } /* Accepts as input a pathname, and tries to match it to an @@ -88,8 +88,8 @@ API_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, char buf[HUGE_STRING_LEN]; char *pInputName; char *p, *q; - BOOL bDone = APR_FALSE; - BOOL bFileExists = APR_TRUE; + BOOL bDone = FALSE; + BOOL bFileExists = TRUE; HANDLE hFind; WIN32_FIND_DATA wfd; @@ -114,7 +114,7 @@ API_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, /* If all we have is a drive letter, then we are done */ if (strlen(pInputName) == 2) - bDone = APR_TRUE; + bDone = TRUE; } q = p; @@ -151,7 +151,7 @@ API_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, *p = '\0'; if (strchr(q, '*') || strchr(q, '?')) - bFileExists = APR_FALSE; + bFileExists = FALSE; /* If the path exists so far, call FindFirstFile * again. However, if this portion of the path contains @@ -164,7 +164,7 @@ API_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, hFind = FindFirstFile(pInputName, &wfd); if (hFind == INVALID_HANDLE_VALUE) { - bFileExists = APR_FALSE; + bFileExists = FALSE; } else { FindClose(hFind); @@ -185,7 +185,7 @@ API_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, p = strchr(p, '\\'); } else { - bDone = APR_TRUE; + bDone = TRUE; } } diff --git a/misc/win32/start.c b/misc/win32/start.c index e56172811b0..95fa14d960e 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -100,11 +100,11 @@ ap_status_t ap_get_oslevel(ap_pool_t *cont, ap_oslevel_e *level) { static OSVERSIONINFO oslev; static unsigned int servpack = 0; - static BOOL first = APR_TRUE; + static BOOL first = TRUE; char *pservpack; if (first) { - first = APR_FALSE; + first = FALSE; oslev.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&oslev); if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) { diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 5e6514392d7..737af928b10 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -106,7 +106,7 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) return APR_OS2_STATUS(sock_errno()); } (*new)->timeout = -1; - (*new)->nonblock = APR_FALSE; + (*new)->nonblock = FALSE; ap_register_cleanup((*new)->cntxt, (void *)(*new), socket_cleanup, ap_null_cleanup); return APR_SUCCESS; @@ -158,7 +158,7 @@ ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_pool_t *con (*new)->local_addr = sock->local_addr; (*new)->addr_len = sizeof(struct sockaddr_in); (*new)->timeout = -1; - (*new)->nonblock = APR_FALSE; + (*new)->nonblock = FALSE; (*new)->socketdes = accept(sock->socketdes, (struct sockaddr *)(*new)->remote_addr, &(*new)->addr_len); diff --git a/shmem/unix/mm/mm.h b/shmem/unix/mm/mm.h index b925efe3b6e..3c029e63061 100644 --- a/shmem/unix/mm/mm.h +++ b/shmem/unix/mm/mm.h @@ -92,11 +92,11 @@ extern int flock(int, int); extern char *strerror(int); #endif -#if !defined(APR_FALSE) -#define APR_FALSE 0 +#if !defined(FALSE) +#define FALSE 0 #endif -#if !defined(APR_TRUE) -#define APR_TRUE !APR_FALSE +#if !defined(TRUE) +#define TRUE !FALSE #endif #if !defined(NULL) #define NULL (void *)0 diff --git a/shmem/unix/mm/mm_alloc.c b/shmem/unix/mm/mm_alloc.c index 6add51c0c74..049a4ab20f2 100644 --- a/shmem/unix/mm/mm_alloc.c +++ b/shmem/unix/mm/mm_alloc.c @@ -120,7 +120,7 @@ void mm_destroy(MM *mm) int mm_lock(MM *mm, mm_lock_mode mode) { if (mm == NULL) - return APR_FALSE; + return FALSE; return mm_core_lock((void *)mm, mode); } @@ -130,7 +130,7 @@ int mm_lock(MM *mm, mm_lock_mode mode) int mm_unlock(MM *mm) { if (mm == NULL) - return APR_FALSE; + return FALSE; return mm_core_unlock((void *)mm); } diff --git a/shmem/unix/mm/mm_core.c b/shmem/unix/mm/mm_core.c index 4225cd0359f..37d938ea0b1 100644 --- a/shmem/unix/mm/mm_core.c +++ b/shmem/unix/mm/mm_core.c @@ -73,7 +73,7 @@ static size_t mm_core_mapoffset = 1024*1024*1; /* we share with other apps */ static void mm_core_init(void) { - static int initialized = APR_FALSE; + static int initialized = FALSE; if (!initialized) { #if defined(MM_SEMT_FCNTL) mm_core_dolock_rd.l_whence = SEEK_SET; /* from current point */ @@ -103,7 +103,7 @@ static void mm_core_init(void) mm_core_dounlock[0].sem_op = -1; mm_core_dounlock[0].sem_flg = SEM_UNDO; #endif - initialized = APR_TRUE; + initialized = TRUE; } return; } @@ -519,7 +519,7 @@ int mm_core_lock(const void *core, mm_lock_mode mode) int fdsem; if (core == NULL) - return APR_FALSE; + return FALSE; mc = (mem_core *)((char *)core-SIZEOF_mem_core); #if !defined(MM_SEMT_FLOCK) fdsem = mc->mc_fdsem; @@ -566,10 +566,10 @@ int mm_core_lock(const void *core, mm_lock_mode mode) if (rc < 0) { ERR(MM_ERR_CORE|MM_ERR_SYSTEM, "Failed to lock"); - rc = APR_FALSE; + rc = FALSE; } else - rc = APR_TRUE; + rc = TRUE; return rc; } @@ -580,7 +580,7 @@ int mm_core_unlock(const void *core) int fdsem; if (core == NULL) - return APR_FALSE; + return FALSE; mc = (mem_core *)((char *)core-SIZEOF_mem_core); #if !defined(MM_SEMT_FLOCK) fdsem = mc->mc_fdsem; @@ -616,10 +616,10 @@ int mm_core_unlock(const void *core) if (rc < 0) { ERR(MM_ERR_CORE|MM_ERR_SYSTEM, "Failed to unlock"); - rc = APR_FALSE; + rc = FALSE; } else - rc = APR_TRUE; + rc = TRUE; return rc; } diff --git a/shmem/unix/mm/mm_global.c b/shmem/unix/mm/mm_global.c index c42415880db..53efcca58c7 100644 --- a/shmem/unix/mm/mm_global.c +++ b/shmem/unix/mm/mm_global.c @@ -52,10 +52,10 @@ static MM *mm_global = NULL; int MM_create(size_t size, const char *file) { if (mm_global != NULL) - return APR_FALSE; + return FALSE; if ((mm_global = mm_create(size, file)) == NULL) - return APR_FALSE; - return APR_TRUE; + return FALSE; + return TRUE; } int MM_permission(mode_t mode, uid_t owner, gid_t group) @@ -77,14 +77,14 @@ void MM_destroy(void) int MM_lock(mm_lock_mode mode) { if (mm_global == NULL) - return APR_FALSE; + return FALSE; return mm_lock(mm_global, mode); } int MM_unlock(void) { if (mm_global == NULL) - return APR_FALSE; + return FALSE; return mm_unlock(mm_global); } diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 726fbf5f0be..6fc0f755a9c 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -88,7 +88,7 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) (*new)->child_err = NULL; (*new)->currdir = NULL; (*new)->cmdtype = APR_PROGRAM; - (*new)->detached = APR_FALSE; + (*new)->detached = FALSE; return APR_SUCCESS; } @@ -177,13 +177,13 @@ ap_status_t ap_fork(ap_proc_t **proc, ap_pool_t *cont) } else if (pid == 0) { (*proc)->pid = pid; (*proc)->attr = NULL; - (*proc)->running = APR_TRUE; + (*proc)->running = TRUE; return APR_INCHILD; } (*proc)->pid = pid; (*proc)->attr = NULL; - (*proc)->running = APR_TRUE; + (*proc)->running = TRUE; return APR_INPARENT; } @@ -226,7 +226,7 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, char **newargs; char savedir[300]; HFILE save_in, save_out, save_err, dup; - int criticalsection = APR_FALSE; + int criticalsection = FALSE; char *extension, *newprogname, *extra_arg = NULL, *cmdline, *cmdline_pos; char interpreter[1024]; char error_object[260]; @@ -242,11 +242,11 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, } (*new)->cntxt = cont; - (*new)->running = APR_FALSE; + (*new)->running = FALSE; /* Prevent other threads from running while these process-wide resources are modified */ if (attr->child_in || attr->child_out || attr->child_err || attr->currdir) { - criticalsection = APR_TRUE; + criticalsection = TRUE; DosEnterCritSec(); } diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index a171cb447c9..b516a2cdcb5 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -82,7 +82,7 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) (*new)->child_err = NULL; (*new)->currdir = NULL; (*new)->cmdtype = APR_PROGRAM; - (*new)->detached = APR_TRUE; + (*new)->detached = TRUE; memset(&(*new)->si, 0, sizeof((*new)->si)); From 9c3ce3a76863c1f668689a5580e7c733e025bb75 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 28 Apr 2000 18:31:20 +0000 Subject: [PATCH 0011/7878] don't redefine TRUE/FALSE git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59985 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/apr_general.h b/include/apr_general.h index 5e86b6bc58d..6d8917599d5 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -72,8 +72,12 @@ extern "C" { #endif /* __cplusplus */ -#define TRUE 1 +#ifndef FALSE #define FALSE 0 +#endif +#ifndef TRUE +#define TRUE (!FALSE) +#endif #define MAXIMUM_WAIT_OBJECTS 64 From 13a6ac417d7ff744202cefe9e6525d55ef11c66a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 28 Apr 2000 18:48:14 +0000 Subject: [PATCH 0012/7878] apr_errno.h: APR_OS_START_ERROR needs to be at least 2000 for OS/390 and needs to be much higher than 10000 for Win32; 20000 seems nice and round and large enough to keep folks happy for a while; without this change, Win32 ap_strerror() is broken for common socket error codes unix/errorcodes.c: fix bug in stuffbuffer(); it chopped off the last char of the message win32/errorcodes.c: fix same bug in stuffbuffer() when Windows doesn't return a msg, provide a default one test/client.c: call ap_strerror() in a couple of places for easy testing get rid of the loop around ap_connect(); no current ap_connect() closes the socket or anything else required to make this work git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59986 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 +- misc/unix/errorcodes.c | 14 ++++++------- misc/win32/errorcodes.c | 44 +++++++++++++++++++++-------------------- test/client.c | 11 ++++++----- 4 files changed, 36 insertions(+), 35 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 9eb186e41fd..2628943e682 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -74,7 +74,7 @@ int ap_canonical_error(ap_status_t err); * APR_OS_START_SYSERR should be used for system error values on * each platform. */ -#define APR_OS_START_ERROR 1000 +#define APR_OS_START_ERROR 20000 #define APR_OS_START_STATUS (APR_OS_START_ERROR + 500) #define APR_OS_START_USEERR (APR_OS_START_STATUS + 500) #define APR_OS_START_CANONERR (APR_OS_START_USEERR + 500) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 7d1e4cd4469..b50fb5c1f94 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -55,17 +55,12 @@ #include "misc.h" /* - * stuffbuffer - Stuff contents of string 's' into buffer 'buf' - * w/o overflowing 'buf' then NULL terminate. + * stuffbuffer - like ap_cpystrn() but returns the address of the + * dest buffer instead of the address of the terminating '\0' */ static char *stuffbuffer(char *buf, ap_size_t bufsize, const char *s) { - ap_size_t len = strlen(s); - if (len > bufsize) - len = bufsize; - memcpy(buf, s, len); - if (len) - buf[len-1] = '\0'; + ap_cpystrn(buf,s,bufsize); return buf; } @@ -209,6 +204,9 @@ char *ap_strerror(ap_status_t statcode, char *buf, ap_size_t bufsize) return stuffbuffer(buf, bufsize, "APR does not understand this error code"); } else { + /* TODO - recognize when the system has hstrerror() and call it here for + * Unix since on Unix this would be a resolver error code + */ return apr_os_strerror(buf, bufsize, statcode - APR_OS_START_SYSERR); } } diff --git a/misc/win32/errorcodes.c b/misc/win32/errorcodes.c index bd725273f8c..8a3e96a87b6 100644 --- a/misc/win32/errorcodes.c +++ b/misc/win32/errorcodes.c @@ -60,17 +60,12 @@ */ /* - * stuffbuffer - Stuff contents of string 's' into buffer 'buf' - * w/o overflowing 'buf' then NULL terminate. + * stuffbuffer - like ap_cpystrn() but returns the address of the + * dest buffer instead of the address of the terminating '\0' */ static char *stuffbuffer(char *buf, ap_size_t bufsize, const char *s) { - ap_size_t len = strlen(s); - if (len > bufsize) - len = bufsize; - memcpy(buf, s, len); - if (len) - buf[len-1] = '\0'; + ap_cpystrn(buf,s,bufsize); return buf; } @@ -154,8 +149,6 @@ static char *apr_os_strerror(char *buf, ap_size_t bufsize, ap_status_t errcode) DWORD len; DWORD i; - buf = ""; - len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, errcode, @@ -164,18 +157,27 @@ static char *apr_os_strerror(char *buf, ap_size_t bufsize, ap_status_t errcode) bufsize, NULL); - /* FormatMessage put the message in the buffer, but it may - * have embedded a newline (\r\n), and possible more than one. - * Remove the newlines replacing them with a space. This is not - * as visually perfect as moving all the remaining message over, - * but more efficient. - */ - i = len; - while (i) { - i--; - if ((buf[i] == '\r') || (buf[i] == '\n')) - buf[i] = ' '; + if (len) { + /* FormatMessage put the message in the buffer, but it may + * have embedded a newline (\r\n), and possible more than one. + * Remove the newlines replacing them with a space. This is not + * as visually perfect as moving all the remaining message over, + * but more efficient. + */ + i = len; + while (i) { + i--; + if ((buf[i] == '\r') || (buf[i] == '\n')) + buf[i] = ' '; + } + } + else { + /* Windows didn't provide us with a message. Even stuff like + * WSAECONNREFUSED won't get a message. + */ + ap_cpystrn(buf, "Unrecognized error code", bufsize); } + return buf; } diff --git a/test/client.c b/test/client.c index cd78ce11142..ab63c1d6ef2 100644 --- a/test/client.c +++ b/test/client.c @@ -68,6 +68,7 @@ int main(int argc, char *argv[]) ap_status_t stat; char datasend[STRLEN] = "Send data test"; char datarecv[STRLEN]; + char msgbuf[80]; char *local_ipaddr, *remote_ipaddr; char *dest = "127.0.0.1"; ap_uint32_t local_port, remote_port; @@ -124,13 +125,12 @@ int main(int argc, char *argv[]) fprintf(stdout, "\tClient: Connecting to socket......."); - do { - stat = ap_connect(sock, dest); - } while (stat == APR_ECONNREFUSED); + stat = ap_connect(sock, dest); if (stat != APR_SUCCESS) { ap_close_socket(sock); - fprintf(stderr, "Could not connect %d\n", stat); + fprintf(stderr, "Could not connect: %s (%d)\n", + ap_strerror(stat, msgbuf, sizeof(msgbuf)), stat); fflush(stderr); exit(-1); } @@ -166,7 +166,8 @@ int main(int argc, char *argv[]) if ((stat = ap_recv(sock, datarecv, &length)) != APR_SUCCESS) { ap_close_socket(sock); - fprintf(stderr, "Problem receiving data: %d\n", stat); + fprintf(stderr, "Problem receiving data: %s (%d)\n", + ap_strerror(stat, msgbuf, sizeof(msgbuf)), stat); exit(-1); } if (strcmp(datarecv, "Recv data test")) { From e80a6685bc3e2fef5071437bc34673a1ce24aae2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 28 Apr 2000 23:09:30 +0000 Subject: [PATCH 0013/7878] lib/apr/test/ab_apr no longer exists, so get rid of ab_apr.dsp git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59987 13f79535-47bb-0310-9956-ffa450edef68 --- test/ab_apr.dsp | 90 ------------------------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 test/ab_apr.dsp diff --git a/test/ab_apr.dsp b/test/ab_apr.dsp deleted file mode 100644 index 522b6312ca4..00000000000 --- a/test/ab_apr.dsp +++ /dev/null @@ -1,90 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ab_apr" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=ab_apr - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ab_apr.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ab_apr.mak" CFG="ab_apr - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ab_apr - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "ab_apr - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ab_apr - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\Release\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\Release\ab_apr.exe" - -!ELSEIF "$(CFG)" == "ab_apr - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ab_apr__" -# PROP BASE Intermediate_Dir "ab_apr__" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ab_apr" -# PROP Intermediate_Dir "ab_apr" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /Fr /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\Debug\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\Debug\ab_apr.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "ab_apr - Win32 Release" -# Name "ab_apr - Win32 Debug" -# Begin Source File - -SOURCE=.\ab_apr.c -# End Source File -# End Target -# End Project From cb7b4ab3cdee8301ef799d873691f6f58a726a9e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 28 Apr 2000 23:20:38 +0000 Subject: [PATCH 0014/7878] Teach ap_strerror() on Unix to handle resolver error codes. Update CHANGES to mention ap_strerror() fixes that will be in a4. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59988 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + misc/unix/errorcodes.c | 38 ++++++++++++++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 0817ac7f37f..113f194ae65 100644 --- a/configure.in +++ b/configure.in @@ -125,6 +125,7 @@ AC_CHECK_FUNC(inet_network, [ inet_network="1" ], [ inet_network="0" ]) AC_CHECK_FUNC(_getch) AC_CHECK_FUNCS(gmtime_r localtime_r) AC_CHECK_FUNCS(iconv, [ iconv="1" ], [ iconv="0" ]) +AC_CHECK_FUNCS(hstrerror) AC_SUBST(sendfile) AC_SUBST(fork) AC_SUBST(inet_addr) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index b50fb5c1f94..cca70707227 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -54,6 +54,10 @@ #include "misc.h" +#ifdef HAVE_NETDB_H +#include +#endif + /* * stuffbuffer - like ap_cpystrn() but returns the address of the * dest buffer instead of the address of the terminating '\0' @@ -186,9 +190,38 @@ static char *apr_os_strerror(char* buf, ap_size_t bufsize, int err) return stuffbuffer(buf, bufsize, result); } #else + +/* On Unix, apr_os_strerror() handles error codes from the resolver + * (h_errno). + e*/ static char *apr_os_strerror(char* buf, ap_size_t bufsize, int err) { - return stuffbuffer(buf, bufsize,strerror(err)); +#ifdef HAVE_HSTRERROR + return stuffbuffer(buf, bufsize, hstrerror(err)); +#else /* HAVE_HSTRERROR */ + const char *msg; + + switch(err) { + case HOST_NOT_FOUND: + msg = "Unknown host"; + break; +#if defined(NO_DATA) + case NO_DATA: +#if defined(NO_ADDRESS) && (NO_DATA != NO_ADDRESS) + case NO_ADDRESS: +#endif + msg = "No address for host"; + break; +#elif defined(NO_ADDRESS) + case NO_ADDRESS: + msg = "No address for host"; + break; +#endif /* NO_DATA */ + default: + msg = "Unrecognized resolver error"; + } + return stuffbuffer(buf, bufsize, msg); +#endif /* HAVE_STRERROR */ } #endif @@ -204,9 +237,6 @@ char *ap_strerror(ap_status_t statcode, char *buf, ap_size_t bufsize) return stuffbuffer(buf, bufsize, "APR does not understand this error code"); } else { - /* TODO - recognize when the system has hstrerror() and call it here for - * Unix since on Unix this would be a resolver error code - */ return apr_os_strerror(buf, bufsize, statcode - APR_OS_START_SYSERR); } } From 6658b923a394dbc8463f8c36c995601a796ea4b2 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sat, 29 Apr 2000 14:37:48 +0000 Subject: [PATCH 0015/7878] * refine platform-dependent flags * add -Kthread to pthread_cflags check (SCO UnixWare/OpenServer) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59989 13f79535-47bb-0310-9956-ffa450edef68 --- threads.m4 | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/threads.m4 b/threads.m4 index 04207aa79bc..6608ab143da 100644 --- a/threads.m4 +++ b/threads.m4 @@ -4,13 +4,31 @@ dnl dnl Set some magic defines dnl AC_DEFUN(REENTRANCY_FLAGS,[ - case "`uname -sr`" in - "SunOS 5"*) - CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS";; + if test -z "$host_alias"; then + host_alias=`$ac_config_guess` +dnl AC_MSG_ERROR(host_alias is not set. Make sure to run config.guess) + fi + case "$host_alias" in + *solaris*) + PTHREAD_FLAGS="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";; + *freebsd*) + PTHREAD_FLAGS="-D_REENTRANT -D_THREAD_SAFE";; + *linux*) + PTHREAD_FLAGS="-D_REENTRANT";; + *aix*) + PTHREAD_FLAGS="-D_THREAD_SAFE";; + *irix*) + PTHREAD_FLAGS="-D_POSIX_THREAD_SAFE_FUNCTIONS";; + *hpux*) + PTHREAD_FLAGS="-D_REENTRANT";; esac - -dnl This works for now.. - CFLAGS="$CFLAGS -D_REENTRANT" + +dnl These flags should go into CPPFLAGS. APR needs to be improved to use +dnl the right names. + + if test -n "$PTHREAD_FLAGS"; then + CFLAGS="$CFLAGS $PTHREAD_FLAGS" + fi ])dnl dnl dnl PTHREADS_CHECK_COMPILE @@ -56,10 +74,10 @@ PTHREADS_CHECK_COMPILE AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[ ac_cv_pthreads_cflags="" if test "$pthreads_working" != "yes"; then - for flag in -pthreads -pthread -mthreads; do + for flag in -pthreads -pthread -mthreads -Kthread; do ac_save="$CFLAGS" CFLAGS="$CFLAGS $flag" - PTHREADS_CHECK_COMPILE + PTHREADS_CHECK_COMPILE if test "$pthreads_working" = "yes"; then ac_cv_pthreads_cflags="$flag" break From 2642fc224c9fe2e4fa79b4504072d04d61fe7a1a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 29 Apr 2000 16:00:32 +0000 Subject: [PATCH 0016/7878] PR: Obtained from: Submitted by: William Rowe Reviewed by: Created ap_base64.h to extract those declarations for clarity from ap.h CORE_PRIVATE, httpd.h do not belong in library functions, removed from ap.lib Use apr headers for declarations in ap.lib stuff, kill AP_LONG from ap_sha1.h Move credit to lib/apr/lib/ap_snprintf.c from ap.h for authorship git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59990 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_snprintf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/apr_snprintf.c b/lib/apr_snprintf.c index c5ea415ec35..db2cec14020 100644 --- a/lib/apr_snprintf.c +++ b/lib/apr_snprintf.c @@ -50,6 +50,10 @@ * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . + * + * The ap_vsnprintf/ap_snprintf functions are based on, and used with the + * permission of, the SIO stdio-replacement strx_* functions by Panos + * Tsirigotis for xinetd. */ #ifdef WIN32 From 2fd1eddd84ebb2d68d9eb6af66207278843df0ba Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sat, 29 Apr 2000 23:41:09 +0000 Subject: [PATCH 0017/7878] Small cleanup: * configure.in is in multiple locations, use threads.m4 instead for AC_INIT * use standard way to access config.(sub|guess) * respect CPPFLAGS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59991 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 113f194ae65..83e5f62e385 100644 --- a/configure.in +++ b/configure.in @@ -2,11 +2,14 @@ dnl ## dnl ## Autoconf configuration file for APR dnl ## +dnl Process this file with autoconf to produce a configure script. +AC_INIT(threads.m4) +AC_CONFIG_HEADER(include/apr_private.h) +AC_CONFIG_AUX_DIR_DEFAULT -AC_CONFIG_AUX_DIR(./helpers) echo "Configuring APR library" -OS=`./config.guess` -OS=`./config.sub $OS` +OS=`$ac_config_guess` +OS=`$ac_config_sub $OS` echo "Platform: ${OS}" dnl # Some initial steps for configuration. We setup the default directory @@ -17,10 +20,6 @@ DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" MODULES="file_io network_io threadproc misc locks time mmap shmem dso i18n" -dnl Process this file with autoconf to produce a configure script. -AC_INIT(configure.in) -AC_CONFIG_HEADER(include/apr_private.h) - # Most platforms use a prefix of 'lib' on their library files. LIBPREFIX='lib' @@ -541,5 +540,10 @@ done MAKEFILE3="test/Makefile" AC_SUBST(SUBDIRS) AC_SUBST(MODULES) + +if test -n "$CPPFLAGS"; then + CFLAGS="$CFLAGS $CPPFLAGS" +fi + AC_OUTPUT($MAKEFILE1 $MAKEFILE2 $MAKEFILE3 include/apr.h) From 93a268cc2abe4c8d164e5e4cd49904ac908775cf Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sat, 29 Apr 2000 23:42:23 +0000 Subject: [PATCH 0018/7878] REENTRANCY_FLAGS changes: * Add SCO OpenServer/UnixWare flag * Use CPPFLAGS instead of CFLAGS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59992 13f79535-47bb-0310-9956-ffa450edef68 --- threads.m4 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/threads.m4 b/threads.m4 index 6608ab143da..4ad40dfd8b4 100644 --- a/threads.m4 +++ b/threads.m4 @@ -21,13 +21,14 @@ dnl AC_MSG_ERROR(host_alias is not set. Make sure to run config.guess) PTHREAD_FLAGS="-D_POSIX_THREAD_SAFE_FUNCTIONS";; *hpux*) PTHREAD_FLAGS="-D_REENTRANT";; + *sco*) + PTHREAD_FLAGS="-D_REENTRANT";; +dnl Solves sigwait() problem, creates problems with u_long etc. +dnl PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE_EXTENDED=1";; esac -dnl These flags should go into CPPFLAGS. APR needs to be improved to use -dnl the right names. - if test -n "$PTHREAD_FLAGS"; then - CFLAGS="$CFLAGS $PTHREAD_FLAGS" + CPPFLAGS="$CPPFLAGS $PTHREAD_FLAGS" fi ])dnl dnl From 48745f6b9aad3bfaf7120f856442f07221d10627 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 30 Apr 2000 01:17:03 +0000 Subject: [PATCH 0019/7878] Fix ap_readdir() problem on systems where d_name[] field in struct dirent is declared with only one byte. (This problem only affected multithreaded builds.) This caused a segfault during pool cleanup with mod_autoindex on Solaris (Solaris 8 x86, at least). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59993 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index d8312408516..13c5220beb7 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -68,12 +68,21 @@ static ap_status_t dir_cleanup(void *thedir) ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cont) { + /* On some platforms (e.g., Linux+GNU libc), d_name[] in struct + * dirent is declared with enough storage for the name. On other + * platforms (e.g., Solaris 8 for Intel), d_name is declared as a + * one-byte array. Note: gcc evaluates this at compile time. + */ + ap_size_t dirent_size = + (sizeof((*new)->entry->d_name) > 1 ? + sizeof(struct dirent) : sizeof (struct dirent) + 255); + (*new) = (ap_dir_t *)ap_palloc(cont, sizeof(ap_dir_t)); (*new)->cntxt = cont; (*new)->dirname = ap_pstrdup(cont, dirname); (*new)->dirstruct = opendir(dirname); - (*new)->entry = ap_pcalloc(cont, sizeof(struct dirent)); + (*new)->entry = ap_pcalloc(cont, dirent_size); if ((*new)->dirstruct == NULL) { return errno; From 20faaeff906b9877b87d40ea39e6f9e24bf4fde5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 30 Apr 2000 03:01:36 +0000 Subject: [PATCH 0020/7878] Fix mm configuration on Solaris 8 x86 and OS/390. Don't require /sbin in PATH on FreeBSD. (all submitted to rse previously) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59994 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/mm/aclocal.m4 | 9 +++++++++ shmem/unix/mm/config.guess | 2 +- shmem/unix/mm/mm.h | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/shmem/unix/mm/aclocal.m4 b/shmem/unix/mm/aclocal.m4 index ad9f0147d07..0bbf26bc42c 100644 --- a/shmem/unix/mm/aclocal.m4 +++ b/shmem/unix/mm/aclocal.m4 @@ -231,6 +231,9 @@ changequote(<<, >>)dnl #include #include #include +#ifdef HAVE_FCNTL_H +#include +#endif #ifdef TEST_MMAP #include #endif @@ -238,6 +241,12 @@ changequote(<<, >>)dnl #include #ifndef _OSD_POSIX #include +#if !defined(SHM_R) +#define SHM_R 0400 +#endif +#if !defined(SHM_W) +#define SHM_W 0200 +#endif #else #define _KMEMUSER 1 /* BS2000 needs this to enable SHM_[RW] */ #include diff --git a/shmem/unix/mm/config.guess b/shmem/unix/mm/config.guess index 16942ccf63b..5523028afc2 100755 --- a/shmem/unix/mm/config.guess +++ b/shmem/unix/mm/config.guess @@ -581,7 +581,7 @@ EOF *:FreeBSD:*:*) # echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` VERS=`echo ${UNAME_RELEASE} | sed -e 's/[-(].*//'` - MACH=`sysctl -n hw.model` + MACH=`/sbin/sysctl -n hw.model` ARCH='unknown' case ${MACH} in *386* ) MACH="i386" ;; diff --git a/shmem/unix/mm/mm.h b/shmem/unix/mm/mm.h index 3c029e63061..314478bd338 100644 --- a/shmem/unix/mm/mm.h +++ b/shmem/unix/mm/mm.h @@ -170,6 +170,12 @@ extern char *strerror(int); #if defined(MM_SHMT_IPCSHM) #include +#if !defined(SHM_R) +#define SHM_R 0400 +#endif +#if !defined(SHM_W) +#define SHM_W 0200 +#endif #endif #if defined(MM_SEMT_IPCSEM) From f88af35e39864e387f3305cb583410eab50fa1d3 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 30 Apr 2000 03:11:43 +0000 Subject: [PATCH 0021/7878] Fix mm's memcpy/memset macros; pointer arithmetic was broken. Patch submitted to author. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59995 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/mm/mm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shmem/unix/mm/mm.h b/shmem/unix/mm/mm.h index 314478bd338..531dca1b40f 100644 --- a/shmem/unix/mm/mm.h +++ b/shmem/unix/mm/mm.h @@ -122,12 +122,12 @@ extern char *strerror(int); #define memcpy(to,from,len) bcopy(from,to,len) #else #define memcpy(to,from,len) \ - { int i; for (i = 0; i < (len); i++) *((to)+i) = *((from)+i); } + { int i; for (i = 0; i < (len); i++) *((char *)(to)+i) = *((char *)(from)+i); } #endif #endif #if !defined(HAVE_MEMSET) #define memset(to,ch,len) \ - { int i; for (i = 0; i < (len); i++) *((to)+i) = (ch); } + { int i; for (i = 0; i < (len); i++) *((char *)(to)+i) = (ch); } #endif #define ERR(type,str) mm_lib_error_set(type,str) From fbef35d03100761be9090acfbe74f05557a24a33 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 30 Apr 2000 16:04:06 +0000 Subject: [PATCH 0022/7878] Update comment for depend target. The template makefiles are now called Makefile.in, and Configure became configure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59996 13f79535-47bb-0310-9956-ffa450edef68 --- dso/aix/Makefile.in | 2 +- dso/beos/Makefile.in | 2 +- dso/os2/Makefile.in | 2 +- dso/unix/Makefile.in | 2 +- file_io/beos/Makefile.in | 2 +- file_io/os2/Makefile.in | 2 +- file_io/unix/Makefile.in | 2 +- i18n/unix/Makefile.in | 2 +- lib/Makefile.in | 2 +- locks/beos/Makefile.in | 2 +- locks/os2/Makefile.in | 2 +- locks/unix/Makefile.in | 2 +- misc/beos/Makefile.in | 2 +- misc/unix/Makefile.in | 2 +- mmap/beos/Makefile.in | 2 +- mmap/unix/Makefile.in | 2 +- network_io/beos/Makefile.in | 2 +- network_io/os2/Makefile.in | 2 +- network_io/unix/Makefile.in | 2 +- shmem/os2/Makefile.in | 2 +- shmem/unix/Makefile.in | 2 +- test/Makefile.in | 2 +- threadproc/beos/Makefile.in | 2 +- threadproc/os2/Makefile.in | 2 +- threadproc/unix/Makefile.in | 2 +- time/unix/Makefile.in | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/dso/aix/Makefile.in b/dso/aix/Makefile.in index 56714ed3aa5..95176ffcd46 100644 --- a/dso/aix/Makefile.in +++ b/dso/aix/Makefile.in @@ -36,7 +36,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/dso/beos/Makefile.in b/dso/beos/Makefile.in index 6c5788d86f1..dd11d7c6e81 100644 --- a/dso/beos/Makefile.in +++ b/dso/beos/Makefile.in @@ -35,7 +35,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/dso/os2/Makefile.in b/dso/os2/Makefile.in index 8fadaff4bb5..6c32402d94e 100644 --- a/dso/os2/Makefile.in +++ b/dso/os2/Makefile.in @@ -36,7 +36,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/dso/unix/Makefile.in b/dso/unix/Makefile.in index 0be9515cc43..2d5728a4455 100644 --- a/dso/unix/Makefile.in +++ b/dso/unix/Makefile.in @@ -36,7 +36,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/file_io/beos/Makefile.in b/file_io/beos/Makefile.in index c06254b2da1..00762b3cf6c 100644 --- a/file_io/beos/Makefile.in +++ b/file_io/beos/Makefile.in @@ -36,7 +36,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index 934134b5ee5..a7af4f4b308 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -44,7 +44,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index 084572d4069..1b48860b6a2 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -43,7 +43,7 @@ $(OBJS): Makefile # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/i18n/unix/Makefile.in b/i18n/unix/Makefile.in index 99b72897335..665992534bd 100644 --- a/i18n/unix/Makefile.in +++ b/i18n/unix/Makefile.in @@ -25,7 +25,7 @@ $(OBJS): Makefile # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/lib/Makefile.in b/lib/Makefile.in index 183a3293264..7e03c2d749e 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -47,7 +47,7 @@ $(OBJS): Makefile # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in index 7fa364b431d..e9e7240e386 100644 --- a/locks/beos/Makefile.in +++ b/locks/beos/Makefile.in @@ -38,7 +38,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/locks/os2/Makefile.in b/locks/os2/Makefile.in index 9ba454f10f7..b8de0e78464 100644 --- a/locks/os2/Makefile.in +++ b/locks/os2/Makefile.in @@ -37,7 +37,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index 80bd8da69fc..851daa6675f 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -39,7 +39,7 @@ $(OBJS): Makefile # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/misc/beos/Makefile.in b/misc/beos/Makefile.in index 6ba04bef4d8..218abdd7d6f 100644 --- a/misc/beos/Makefile.in +++ b/misc/beos/Makefile.in @@ -37,7 +37,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index 23c3d6c96eb..45365faceff 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -39,7 +39,7 @@ $(OBJS): Makefile # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/mmap/beos/Makefile.in b/mmap/beos/Makefile.in index eac4bf5dd97..17d08b4b659 100644 --- a/mmap/beos/Makefile.in +++ b/mmap/beos/Makefile.in @@ -36,7 +36,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/mmap/unix/Makefile.in b/mmap/unix/Makefile.in index e24de80e4d5..9286e2b806c 100644 --- a/mmap/unix/Makefile.in +++ b/mmap/unix/Makefile.in @@ -37,7 +37,7 @@ $(OBJS): Makefile # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/network_io/beos/Makefile.in b/network_io/beos/Makefile.in index a8b094ef698..0459cf1823f 100644 --- a/network_io/beos/Makefile.in +++ b/network_io/beos/Makefile.in @@ -40,7 +40,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/network_io/os2/Makefile.in b/network_io/os2/Makefile.in index 54dfb7d331a..8a73374fcad 100644 --- a/network_io/os2/Makefile.in +++ b/network_io/os2/Makefile.in @@ -41,7 +41,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/network_io/unix/Makefile.in b/network_io/unix/Makefile.in index ee0bc8bf6f4..d35bf02c5a9 100644 --- a/network_io/unix/Makefile.in +++ b/network_io/unix/Makefile.in @@ -40,7 +40,7 @@ $(OBJS): Makefile # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/shmem/os2/Makefile.in b/shmem/os2/Makefile.in index 5e25e40384e..ec9174c6d7a 100644 --- a/shmem/os2/Makefile.in +++ b/shmem/os2/Makefile.in @@ -37,7 +37,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/shmem/unix/Makefile.in b/shmem/unix/Makefile.in index 4717c9994da..d71b1785ce4 100644 --- a/shmem/unix/Makefile.in +++ b/shmem/unix/Makefile.in @@ -42,7 +42,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/test/Makefile.in b/test/Makefile.in index e911abf4d8a..e8a553e095f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -95,7 +95,7 @@ $(OBJS): Makefile # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/threadproc/beos/Makefile.in b/threadproc/beos/Makefile.in index c2b8c6f1728..a07aa531008 100644 --- a/threadproc/beos/Makefile.in +++ b/threadproc/beos/Makefile.in @@ -45,7 +45,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/threadproc/os2/Makefile.in b/threadproc/os2/Makefile.in index 49fcb6b0281..34169994f9d 100644 --- a/threadproc/os2/Makefile.in +++ b/threadproc/os2/Makefile.in @@ -40,7 +40,7 @@ $(LIB): $(OBJS) # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index 016f07a49c7..28a4facdc1d 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -41,7 +41,7 @@ $(OBJS): Makefile # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: diff --git a/time/unix/Makefile.in b/time/unix/Makefile.in index 352364d25da..5b00855ad43 100644 --- a/time/unix/Makefile.in +++ b/time/unix/Makefile.in @@ -37,7 +37,7 @@ $(OBJS): Makefile # # We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: From 35ee1baab7368c0de984eab116028e3b466ff1ae Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 30 Apr 2000 17:43:39 +0000 Subject: [PATCH 0023/7878] Fix ap_tokenize_to_argv to respect the const arguments it is passed. This is the first step to getting piped and reliable piped logs workin in 2.0 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59997 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 3 ++- lib/apr_cpystrn.c | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index 4b9153b8540..64d6d7323e1 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -127,7 +127,8 @@ enum kill_conditions { * Define the prototypes for the various APR GP routines. */ API_EXPORT(char *) ap_cpystrn(char *d, const char *s, size_t l); -API_EXPORT(ap_status_t) ap_tokenize_to_argv(char *arg_str, char ***argv_out, +API_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, + char ***argv_out, ap_pool_t *token_context); API_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); API_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src); diff --git a/lib/apr_cpystrn.c b/lib/apr_cpystrn.c index 7dbb615a9ae..3e67baa36cd 100644 --- a/lib/apr_cpystrn.c +++ b/lib/apr_cpystrn.c @@ -118,10 +118,12 @@ API_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size) * pool and filled in with copies of the tokens * found during parsing of the arg_str. */ -API_EXPORT(ap_status_t) ap_tokenize_to_argv(char *arg_str, char ***argv_out, +API_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, + char ***argv_out, ap_pool_t *token_context) { - char *cp, *tmpCnt; + const char *cp; + const char *tmpCnt; int isquoted, numargs = 0, rc = APR_SUCCESS; #define SKIP_WHITESPACE(cp) \ @@ -186,8 +188,9 @@ API_EXPORT(ap_status_t) ap_tokenize_to_argv(char *arg_str, char ***argv_out, break; } else { - *cp++ = '\0'; - (*argv_out)[numargs] = ap_pstrdup(token_context, tmpCnt); + cp++; + (*argv_out)[numargs] = ap_palloc(token_context, cp - tmpCnt); + ap_cpystrn((*argv_out)[numargs], tmpCnt, cp - tmpCnt); numargs++; } From 41f71347d3fe19012a439af8475b6030ffbf24d8 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 30 Apr 2000 17:58:34 +0000 Subject: [PATCH 0024/7878] Make `mm' an INCDIR in shmem/unix, so that the INCDIR rewriter can automatically adapt it for VPATH use. Remove $(OBJS): Makefile dependency to avoid unnecessary rebuilds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59998 13f79535-47bb-0310-9956-ffa450edef68 --- dso/aix/Makefile.in | 1 - dso/beos/Makefile.in | 1 - dso/os2/Makefile.in | 1 - dso/unix/Makefile.in | 1 - file_io/beos/Makefile.in | 1 - file_io/os2/Makefile.in | 1 - file_io/unix/Makefile.in | 1 - i18n/unix/Makefile.in | 1 - lib/Makefile.in | 1 - locks/beos/Makefile.in | 1 - locks/os2/Makefile.in | 1 - locks/unix/Makefile.in | 1 - misc/beos/Makefile.in | 1 - misc/unix/Makefile.in | 1 - mmap/beos/Makefile.in | 1 - mmap/unix/Makefile.in | 1 - network_io/beos/Makefile.in | 1 - network_io/os2/Makefile.in | 1 - network_io/unix/Makefile.in | 1 - shmem/os2/Makefile.in | 1 - shmem/unix/Makefile.in | 10 +++++----- test/Makefile.in | 1 - threadproc/beos/Makefile.in | 1 - threadproc/os2/Makefile.in | 1 - threadproc/unix/Makefile.in | 1 - time/unix/Makefile.in | 1 - 26 files changed, 5 insertions(+), 30 deletions(-) diff --git a/dso/aix/Makefile.in b/dso/aix/Makefile.in index 95176ffcd46..f755b93e69d 100644 --- a/dso/aix/Makefile.in +++ b/dso/aix/Makefile.in @@ -27,7 +27,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/dso/beos/Makefile.in b/dso/beos/Makefile.in index dd11d7c6e81..2ff8a52b5a1 100644 --- a/dso/beos/Makefile.in +++ b/dso/beos/Makefile.in @@ -26,7 +26,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/dso/os2/Makefile.in b/dso/os2/Makefile.in index 6c32402d94e..c9526a90bae 100644 --- a/dso/os2/Makefile.in +++ b/dso/os2/Makefile.in @@ -27,7 +27,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/dso/unix/Makefile.in b/dso/unix/Makefile.in index 2d5728a4455..972c4ca6c25 100644 --- a/dso/unix/Makefile.in +++ b/dso/unix/Makefile.in @@ -27,7 +27,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/file_io/beos/Makefile.in b/file_io/beos/Makefile.in index 00762b3cf6c..64cdff57bfa 100644 --- a/file_io/beos/Makefile.in +++ b/file_io/beos/Makefile.in @@ -27,7 +27,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index a7af4f4b308..05dcbe46c01 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -35,7 +35,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index 1b48860b6a2..cbf5a1059a9 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -34,7 +34,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile #$(LIB): $(OBJS) # $(RM) -f $@ diff --git a/i18n/unix/Makefile.in b/i18n/unix/Makefile.in index 665992534bd..72998b6d90a 100644 --- a/i18n/unix/Makefile.in +++ b/i18n/unix/Makefile.in @@ -21,7 +21,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile # # We really don't expect end users to use this rule. It works only with diff --git a/lib/Makefile.in b/lib/Makefile.in index 7e03c2d749e..da1a211895b 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -38,7 +38,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile #$(LIB): $(OBJS) # $(RM) -f $@ diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in index e9e7240e386..b12efecf594 100644 --- a/locks/beos/Makefile.in +++ b/locks/beos/Makefile.in @@ -29,7 +29,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/locks/os2/Makefile.in b/locks/os2/Makefile.in index b8de0e78464..8ed2eb817b2 100644 --- a/locks/os2/Makefile.in +++ b/locks/os2/Makefile.in @@ -28,7 +28,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index 851daa6675f..c6131037ba1 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -30,7 +30,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile #$(LIB): $(OBJS) # $(RM) -f $@ diff --git a/misc/beos/Makefile.in b/misc/beos/Makefile.in index 218abdd7d6f..7fbb627843a 100644 --- a/misc/beos/Makefile.in +++ b/misc/beos/Makefile.in @@ -28,7 +28,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index 45365faceff..a95615097ff 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -30,7 +30,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile #$(LIB): $(OBJS) # $(RM) -f $@ diff --git a/mmap/beos/Makefile.in b/mmap/beos/Makefile.in index 17d08b4b659..4216af1637e 100644 --- a/mmap/beos/Makefile.in +++ b/mmap/beos/Makefile.in @@ -27,7 +27,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/mmap/unix/Makefile.in b/mmap/unix/Makefile.in index 9286e2b806c..116c4a2f6b3 100644 --- a/mmap/unix/Makefile.in +++ b/mmap/unix/Makefile.in @@ -28,7 +28,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile #$(LIB): $(OBJS) # $(RM) -f $@ diff --git a/network_io/beos/Makefile.in b/network_io/beos/Makefile.in index 0459cf1823f..68a440a654a 100644 --- a/network_io/beos/Makefile.in +++ b/network_io/beos/Makefile.in @@ -31,7 +31,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/network_io/os2/Makefile.in b/network_io/os2/Makefile.in index 8a73374fcad..63514b0eb22 100644 --- a/network_io/os2/Makefile.in +++ b/network_io/os2/Makefile.in @@ -32,7 +32,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/network_io/unix/Makefile.in b/network_io/unix/Makefile.in index d35bf02c5a9..afab54c1f87 100644 --- a/network_io/unix/Makefile.in +++ b/network_io/unix/Makefile.in @@ -31,7 +31,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile #$(LIB): $(OBJS) # $(RM) -f $@ diff --git a/shmem/os2/Makefile.in b/shmem/os2/Makefile.in index ec9174c6d7a..f2dd8bce2a8 100644 --- a/shmem/os2/Makefile.in +++ b/shmem/os2/Makefile.in @@ -28,7 +28,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/shmem/unix/Makefile.in b/shmem/unix/Makefile.in index d71b1785ce4..b2156bde22a 100644 --- a/shmem/unix/Makefile.in +++ b/shmem/unix/Makefile.in @@ -12,7 +12,8 @@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../inc INCDIR1=../../include INCDIR2=../../misc/@OSDIR@ -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I$(INCDIR2) -Imm -I. +INCDIR3=mm +INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I$(INCDIR2) -I$(INCDIR3) -I. LIB=libshmem.a @@ -25,17 +26,16 @@ all: $(LIB) clean: $(RM) -f *.o *.a *.so - cd mm; $(MAKE) clean; cd .. + (cd mm && $(MAKE) clean) distclean: clean -$(RM) -f Makefile - cd mm; $(MAKE) distclean; cd .. + (cd mm && $(MAKE) distclean) -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ - cd mm; $(MAKE); cd .. + (cd mm && $(MAKE) libmm.la) cp mm/mm_global.o mm/mm_alloc.o mm/mm_core.o mm/mm_lib.o mm/mm_vers.o . $(AR) cr $@ $(OBJS) $(RANLIB) $@ diff --git a/test/Makefile.in b/test/Makefile.in index e8a553e095f..f372231d9cd 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -91,7 +91,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile # # We really don't expect end users to use this rule. It works only with diff --git a/threadproc/beos/Makefile.in b/threadproc/beos/Makefile.in index a07aa531008..e68764c43dd 100644 --- a/threadproc/beos/Makefile.in +++ b/threadproc/beos/Makefile.in @@ -36,7 +36,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/threadproc/os2/Makefile.in b/threadproc/os2/Makefile.in index 34169994f9d..24b36196fd8 100644 --- a/threadproc/os2/Makefile.in +++ b/threadproc/os2/Makefile.in @@ -31,7 +31,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile $(LIB): $(OBJS) $(RM) -f $@ diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index 28a4facdc1d..caaf880927c 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -32,7 +32,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile #$(LIB): $(OBJS) # $(RM) -f $@ diff --git a/time/unix/Makefile.in b/time/unix/Makefile.in index 5b00855ad43..fcab84a7761 100644 --- a/time/unix/Makefile.in +++ b/time/unix/Makefile.in @@ -28,7 +28,6 @@ clean: distclean: clean -$(RM) -f Makefile -$(OBJS): Makefile #$(LIB): $(OBJS) # $(RM) -f $@ From df23510cbebef7197a921bc1445fd4fe295e7695 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 30 Apr 2000 18:01:21 +0000 Subject: [PATCH 0025/7878] Add OpenBSD flag to m4 macro REENTRANCY_FLAGS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59999 13f79535-47bb-0310-9956-ffa450edef68 --- threads.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/threads.m4 b/threads.m4 index 4ad40dfd8b4..d5f4b56017e 100644 --- a/threads.m4 +++ b/threads.m4 @@ -13,6 +13,8 @@ dnl AC_MSG_ERROR(host_alias is not set. Make sure to run config.guess) PTHREAD_FLAGS="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";; *freebsd*) PTHREAD_FLAGS="-D_REENTRANT -D_THREAD_SAFE";; + *openbsd*) + PTHREAD_FLAGS="-D_POSIX_THREADS";; *linux*) PTHREAD_FLAGS="-D_REENTRANT";; *aix*) From 0303e31021c5162f4ab53fa733a0eed0923b8dc2 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 30 Apr 2000 18:10:35 +0000 Subject: [PATCH 0026/7878] Add VPATH support to APR: If mm and vpath are enabled, we first prepare mm's home directory by populating it with some files from its source directory. After mm's Makefile is created, we add -I$(srcdir) -I. to CFLAGS, and delete a dependency line (causes problems with BSD makes). If vpath is enabled, we prepend a header to each Makefile, consisting of srcdir and VPATH. Then we substitute -I$(INCDIRn) with -I$(INCDIRn) -I($srcdir)/$(INCDIRn). Additionally, we try to preserve the modification time of apr.h and apr_private.h to avoid unnecessary rebuilds of APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60000 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 83e5f62e385..4b603164cef 100644 --- a/configure.in +++ b/configure.in @@ -15,6 +15,14 @@ echo "Platform: ${OS}" dnl # Some initial steps for configuration. We setup the default directory dnl # and which files are to be configured. +dnl Absolute source/build directory +abs_srcdir=`(cd $srcdir && pwd)` +abs_builddir=`pwd` + +if test "$abs_builddir" != "$abs_srcdir"; then + USE_VPATH=1 +fi + # These added to allow default directories to be used... DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" @@ -433,6 +441,8 @@ echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" # run the MM config script regardless of whether we are going to use # it or not. When we have a much better idea of who is using MM, we can # run this on a more conditional basis. +USE_MM=yes +mm_dir=shmem/unix/mm AC_CONFIG_SUBDIRS($config_subdirs) AC_MSG_CHECKING(Checking for Shared memory support) @@ -512,6 +522,16 @@ AC_MSG_RESULT([$msg]) AC_SUBST(have_in_addr) +dnl #----------------------------- Prepare mm directory for VPATH support +if test -n "$USE_MM" && test -n "$USE_VPATH"; then + test -d $mm_dir || mkdir -p $mm_dir + + for i in shtool config.guess config.sub fbtool ltconfig \ + ltmain.sh mm_vers.c; do + test -r $mm_dir/$i || ln -s $abs_srcdir/$mm_dir/$i $mm_dir/$i + done +fi + dnl #----------------------------- Construct the files AC_SUBST(LDLIBS) AC_SUBST(OPTIM) @@ -528,7 +548,8 @@ MAKEFILE1="Makefile lib/Makefile " SUBDIRS="lib " for dir in $MODULES do - if test -f $dir/$OSDIR/Makefile.in; then + test -d $dir || mkdir -p $dir + if test -f $srcdir/$dir/$OSDIR/Makefile.in; then MAKEFILE2="$MAKEFILE2 $dir/$OSDIR/Makefile " SUBDIRS="$SUBDIRS $dir/$OSDIR " else @@ -545,5 +566,54 @@ if test -n "$CPPFLAGS"; then CFLAGS="$CFLAGS $CPPFLAGS" fi -AC_OUTPUT($MAKEFILE1 $MAKEFILE2 $MAKEFILE3 include/apr.h) +SAVE_FILES="include/apr.h include/apr_private.h" + +for i in $SAVE_FILES; do + test -r $i && mv $i $i.save +done + +AC_OUTPUT($MAKEFILE1 $MAKEFILE2 $MAKEFILE3 include/apr.h,[ + +SAVE_FILES="include/apr.h include/apr_private.h" + +for i in $SAVE_FILES; do + if cmp -s $i $i.save 2>/dev/null; then + mv $i.save $i + AC_MSG_RESULT($i is unchanged) + fi + rm -f $i.save +done + +]) + +dnl #----------------------------- Fixup Makefiles for VPATH support + +changequote({,}) + +if test -n "$USE_VPATH"; then + if test -n "$USE_MM"; then + MAKEFILE3="$MAKEFILE3 $mm_dir/Makefile" + fi + for makefile in $MAKEFILE1 $MAKEFILE2 $MAKEFILE3; do + dir=`echo $makefile|sed 's%[^/][^/]*$%%'` + (cat < tmp + cp tmp $makefile + done + if test -n "$USE_MM"; then + cat $mm_dir/Makefile | \ + sed \ + -e 's#\($(CFLAGS)\)#\1 -I$(srcdir) -I.#' \ + -e '/mm_global\.c/d' \ + > tmp + cp tmp $mm_dir/Makefile + fi + rm -f tmp +fi +changequote([,]) From 18a498797640aae100b60019ddc93549b1127d73 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sun, 30 Apr 2000 19:26:37 +0000 Subject: [PATCH 0027/7878] Force the use of "out" mkdir.sh script when we require the '-p' option. We check to see if the local mkdir supports -p, but I don't think we actually use it or set it anywhere :/ PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60001 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 4b603164cef..829b8eb6162 100644 --- a/configure.in +++ b/configure.in @@ -19,6 +19,10 @@ dnl Absolute source/build directory abs_srcdir=`(cd $srcdir && pwd)` abs_builddir=`pwd` +dnl Get location of helpers directory +abs_helpersdir=$abs_srcdir/helpers +MKDIR=$abs_helpersdir/mkdir.sh + if test "$abs_builddir" != "$abs_srcdir"; then USE_VPATH=1 fi @@ -524,7 +528,7 @@ AC_SUBST(have_in_addr) dnl #----------------------------- Prepare mm directory for VPATH support if test -n "$USE_MM" && test -n "$USE_VPATH"; then - test -d $mm_dir || mkdir -p $mm_dir + test -d $mm_dir || $MKDIR -p $mm_dir for i in shtool config.guess config.sub fbtool ltconfig \ ltmain.sh mm_vers.c; do @@ -548,7 +552,7 @@ MAKEFILE1="Makefile lib/Makefile " SUBDIRS="lib " for dir in $MODULES do - test -d $dir || mkdir -p $dir + test -d $dir || $MKDIR -p $dir if test -f $srcdir/$dir/$OSDIR/Makefile.in; then MAKEFILE2="$MAKEFILE2 $dir/$OSDIR/Makefile " SUBDIRS="$SUBDIRS $dir/$OSDIR " From 5195516472880b696fa6b6d6e25ab9003f2f89d2 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sun, 30 Apr 2000 19:29:40 +0000 Subject: [PATCH 0028/7878] Make a note about needing to fix this git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60002 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index 829b8eb6162..85634567b1a 100644 --- a/configure.in +++ b/configure.in @@ -20,6 +20,8 @@ abs_srcdir=`(cd $srcdir && pwd)` abs_builddir=`pwd` dnl Get location of helpers directory +dnl XXX This assumes that APR "lives" under Apache. +dnl XXX We'll need to fix this when we pull it out. abs_helpersdir=$abs_srcdir/helpers MKDIR=$abs_helpersdir/mkdir.sh From 8181bc3448b402cd5dbf25ba51ce04cf2cb48db9 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sun, 30 Apr 2000 19:31:49 +0000 Subject: [PATCH 0029/7878] Fix real absolute path git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60003 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 85634567b1a..bc1e5b5637f 100644 --- a/configure.in +++ b/configure.in @@ -22,7 +22,7 @@ abs_builddir=`pwd` dnl Get location of helpers directory dnl XXX This assumes that APR "lives" under Apache. dnl XXX We'll need to fix this when we pull it out. -abs_helpersdir=$abs_srcdir/helpers +abs_helpersdir=$abs_srcdir/../../helpers MKDIR=$abs_helpersdir/mkdir.sh if test "$abs_builddir" != "$abs_srcdir"; then From 90a0f19eb9b763dae0f5b7cc73f91ebce82b72ad Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 30 Apr 2000 20:49:28 +0000 Subject: [PATCH 0030/7878] AC_MSG_RESULT does not work in EXTRA-CMDS. Noticed by: Jim Jagielski git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60004 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index bc1e5b5637f..47f13a3c9ab 100644 --- a/configure.in +++ b/configure.in @@ -585,7 +585,7 @@ SAVE_FILES="include/apr.h include/apr_private.h" for i in $SAVE_FILES; do if cmp -s $i $i.save 2>/dev/null; then mv $i.save $i - AC_MSG_RESULT($i is unchanged) + echo "$i is unchanged" fi rm -f $i.save done From ba2ed5121b7b53796d06a221829669998093add2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 30 Apr 2000 21:17:57 +0000 Subject: [PATCH 0031/7878] Use ap_pcalloc instead of ap_palloc where it makes sense. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60005 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 2 +- file_io/unix/pipe.c | 4 ++-- include/arch/unix/mmap.c | 2 +- locks/unix/locks.c | 4 ++-- misc/unix/start.c | 2 +- mmap/unix/mmap.c | 2 +- network_io/unix/poll.c | 12 ++++++------ network_io/unix/sockets.c | 18 +++++++++--------- threadproc/unix/proc.c | 17 ++++------------- threadproc/unix/thread.c | 12 +++++------- threadproc/unix/threadpriv.c | 4 ++-- 11 files changed, 34 insertions(+), 45 deletions(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 13c5220beb7..9d39d893d02 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -263,7 +263,7 @@ ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir, ap_pool_t *cont) { if ((*dir) == NULL) { - (*dir) = (ap_dir_t *)ap_palloc(cont, sizeof(ap_dir_t)); + (*dir) = (ap_dir_t *)ap_pcalloc(cont, sizeof(ap_dir_t)); (*dir)->cntxt = cont; } (*dir)->dirstruct = thedir; diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 2f2091bd821..5e00e643606 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -93,7 +93,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) return errno; } - (*in) = (ap_file_t *)ap_palloc(cont, sizeof(ap_file_t)); + (*in) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); (*in)->cntxt = cont; (*in)->filedes = filedes[0]; (*in)->pipe = 1; @@ -105,7 +105,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*in)->thlock = NULL; #endif - (*out) = (ap_file_t *)ap_palloc(cont, sizeof(ap_file_t)); + (*out) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); (*out)->cntxt = cont; (*out)->filedes = filedes[1]; (*out)->pipe = 1; diff --git a/include/arch/unix/mmap.c b/include/arch/unix/mmap.c index 5e5b571f7d1..aec2122650b 100644 --- a/include/arch/unix/mmap.c +++ b/include/arch/unix/mmap.c @@ -84,7 +84,7 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, if (file == NULL || file->filedes == -1) return APR_EBADF; - (*new) = (ap_mmap_t *)ap_palloc(cont, sizeof(ap_mmap_t)); + (*new) = (ap_mmap_t *)ap_pcalloc(cont, sizeof(ap_mmap_t)); ap_seek(file, APR_SET, &offset); mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes ,0); diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 2a648654c78..5b40cc24224 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -62,7 +62,7 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, ap_lock_t *new; ap_status_t stat; - new = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + new = (ap_lock_t *)ap_pcalloc(cont, sizeof(ap_lock_t)); new->cntxt = cont; new->type = type; @@ -216,7 +216,7 @@ ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, return APR_ENOPOOL; } if ((*lock) == NULL) { - (*lock) = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + (*lock) = (ap_lock_t *)ap_pcalloc(cont, sizeof(ap_lock_t)); (*lock)->cntxt = cont; } (*lock)->interproc = thelock->crossproc; diff --git a/misc/unix/start.c b/misc/unix/start.c index fad86b50757..90096a10634 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -97,7 +97,7 @@ ap_status_t ap_set_userdata(void *data, char *key, dptr = dptr->next; } if (dptr == NULL) { - dptr = ap_palloc(cont, sizeof(datastruct)); + dptr = ap_pcalloc(cont, sizeof(datastruct)); dptr->next = dptr->prev = NULL; dptr->key = ap_pstrdup(cont, key); if (dptr2) { diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 5e5b571f7d1..aec2122650b 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -84,7 +84,7 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, if (file == NULL || file->filedes == -1) return APR_EBADF; - (*new) = (ap_mmap_t *)ap_palloc(cont, sizeof(ap_mmap_t)); + (*new) = (ap_mmap_t *)ap_pcalloc(cont, sizeof(ap_mmap_t)); ap_seek(file, APR_SET, &offset); mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes ,0); diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index df1cfba97ce..aa736c06935 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -58,11 +58,11 @@ ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) { - (*new) = (ap_pollfd_t *)ap_palloc(cont, sizeof(ap_pollfd_t)); + (*new) = (ap_pollfd_t *)ap_pcalloc(cont, sizeof(ap_pollfd_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->pollset = (struct pollfd *)ap_palloc(cont, + (*new)->pollset = (struct pollfd *)ap_pcalloc(cont, sizeof(struct pollfd) * num); if ((*new)->pollset == NULL) { @@ -223,14 +223,14 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events) ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) { - (*new) = (ap_pollfd_t *)ap_palloc(cont, sizeof(ap_pollfd_t) * num); + (*new) = (ap_pollfd_t *)ap_pcalloc(cont, sizeof(ap_pollfd_t) * num); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->read = (fd_set *)ap_palloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)ap_palloc(cont, sizeof(fd_set)); - (*new)->except = (fd_set *)ap_palloc(cont, sizeof(fd_set)); + (*new)->read = (fd_set *)ap_pcalloc(cont, sizeof(fd_set)); + (*new)->write = (fd_set *)ap_cpalloc(cont, sizeof(fd_set)); + (*new)->except = (fd_set *)ap_pcalloc(cont, sizeof(fd_set)); FD_ZERO((*new)->read); FD_ZERO((*new)->write); FD_ZERO((*new)->except); diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index a583c2ef783..6eff664fad3 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -69,15 +69,15 @@ static ap_status_t socket_cleanup(void *sock) ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) { - (*new) = (ap_socket_t *)ap_palloc(cont, sizeof(ap_socket_t)); + (*new) = (ap_socket_t *)ap_pcalloc(cont, sizeof(ap_socket_t)); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->local_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); if ((*new)->local_addr == NULL || (*new)->remote_addr == NULL) { @@ -134,14 +134,14 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_pool_t *connection_context) { - (*new) = (ap_socket_t *)ap_palloc(connection_context, + (*new) = (ap_socket_t *)ap_pcalloc(connection_context, sizeof(ap_socket_t)); (*new)->cntxt = connection_context; - (*new)->local_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); (*new)->addr_len = sizeof(struct sockaddr_in); #ifndef HAVE_POLL @@ -237,11 +237,11 @@ ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, return APR_ENOPOOL; } if ((*sock) == NULL) { - (*sock) = (ap_socket_t *)ap_palloc(cont, sizeof(ap_socket_t)); + (*sock) = (ap_socket_t *)ap_pcalloc(cont, sizeof(ap_socket_t)); (*sock)->cntxt = cont; - (*sock)->local_addr = (struct sockaddr_in *)ap_palloc((*sock)->cntxt, + (*sock)->local_addr = (struct sockaddr_in *)ap_pcalloc((*sock)->cntxt, sizeof(struct sockaddr_in)); - (*sock)->remote_addr = (struct sockaddr_in *)ap_palloc((*sock)->cntxt, + (*sock)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*sock)->cntxt, sizeof(struct sockaddr_in)); if ((*sock)->local_addr == NULL || (*sock)->remote_addr == NULL) { diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 0d951f8527d..94f2b43a5d0 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -57,22 +57,13 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) { - (*new) = (ap_procattr_t *)ap_palloc(cont, - sizeof(ap_procattr_t)); + (*new) = (ap_procattr_t *)ap_pcalloc(cont, sizeof(ap_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->parent_in = NULL; - (*new)->child_in = NULL; - (*new)->parent_out = NULL; - (*new)->child_out = NULL; - (*new)->parent_err = NULL; - (*new)->child_err = NULL; - (*new)->currdir = NULL; (*new)->cmdtype = APR_PROGRAM; - (*new)->detached = 0; return APR_SUCCESS; } @@ -204,7 +195,7 @@ ap_status_t ap_fork(ap_proc_t **proc, ap_pool_t *cont) { int pid; - (*proc) = ap_palloc(cont, sizeof(ap_proc_t)); + (*proc) = ap_pcalloc(cont, sizeof(ap_proc_t)); if ((pid = fork()) < 0) { return errno; @@ -228,7 +219,7 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, my_stupid_string *newargs; ap_proc_t *pgrp; - (*new) = (ap_proc_t *)ap_palloc(cont, sizeof(ap_proc_t)); + (*new) = (ap_proc_t *)ap_pcalloc(cont, sizeof(ap_proc_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -369,7 +360,7 @@ ap_status_t ap_put_os_proc(ap_proc_t **proc, ap_os_proc_t *theproc, return APR_ENOPOOL; } if ((*proc) == NULL) { - (*proc) = (ap_proc_t *)ap_palloc(cont, sizeof(ap_proc_t)); + (*proc) = (ap_proc_t *)ap_pcalloc(cont, sizeof(ap_proc_t)); (*proc)->cntxt = cont; } (*proc)->pid = *theproc; diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 300818e0fa6..d6190d8a7d8 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -62,10 +62,8 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) { ap_status_t stat; - (*new) = (ap_threadattr_t *)ap_palloc(cont, - sizeof(ap_threadattr_t)); - (*new)->attr = (pthread_attr_t *)ap_palloc(cont, - sizeof(pthread_attr_t)); + (*new) = (ap_threadattr_t *)ap_pcalloc(cont, sizeof(ap_threadattr_t)); + (*new)->attr = (pthread_attr_t *)ap_pcalloc(cont, sizeof(pthread_attr_t)); if ((*new) == NULL || (*new)->attr == NULL) { return APR_ENOMEM; @@ -108,13 +106,13 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, ap_status_t stat; pthread_attr_t *temp; - (*new) = (ap_thread_t *)ap_palloc(cont, sizeof(ap_thread_t)); + (*new) = (ap_thread_t *)ap_pcalloc(cont, sizeof(ap_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->td = (pthread_t *)ap_palloc(cont, sizeof(pthread_t)); + (*new)->td = (pthread_t *)ap_pcalloc(cont, sizeof(pthread_t)); if ((*new)->td == NULL) { return APR_ENOMEM; @@ -211,7 +209,7 @@ ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd, return APR_ENOPOOL; } if ((*thd) == NULL) { - (*thd) = (ap_thread_t *)ap_palloc(cont, sizeof(ap_thread_t)); + (*thd) = (ap_thread_t *)ap_pcalloc(cont, sizeof(ap_thread_t)); (*thd)->cntxt = cont; } (*thd)->td = thethd; diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 9d82395a6e9..0c74f47841a 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -62,7 +62,7 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key, void (*dest)(void *), ap_pool_t *cont) { ap_status_t stat; - (*key) = (ap_threadkey_t *)ap_palloc(cont, sizeof(ap_threadkey_t)); + (*key) = (ap_threadkey_t *)ap_pcalloc(cont, sizeof(ap_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; @@ -142,7 +142,7 @@ ap_status_t ap_put_os_threadkey(ap_threadkey_t **key, return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (ap_threadkey_t *)ap_palloc(cont, sizeof(ap_threadkey_t)); + (*key) = (ap_threadkey_t *)ap_pcalloc(cont, sizeof(ap_threadkey_t)); (*key)->cntxt = cont; } (*key)->key = *thekey; From fd760334248d67df69c3b4170eee1de3e31b9f68 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 1 May 2000 00:38:23 +0000 Subject: [PATCH 0032/7878] fix typo in Ryan's recent change (ap_pcalloc, not ap_cpalloc) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60006 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/poll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index aa736c06935..10b22ccdcd6 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -229,7 +229,7 @@ ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) } (*new)->cntxt = cont; (*new)->read = (fd_set *)ap_pcalloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)ap_cpalloc(cont, sizeof(fd_set)); + (*new)->write = (fd_set *)ap_pcalloc(cont, sizeof(fd_set)); (*new)->except = (fd_set *)ap_pcalloc(cont, sizeof(fd_set)); FD_ZERO((*new)->read); FD_ZERO((*new)->write); From 23b98d3e80a50f395043a10dfd5b236b1cb41131 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 1 May 2000 03:24:35 +0000 Subject: [PATCH 0033/7878] Fix various return code problems in APR on Win32. For most of these, APR was returning APR_EEXIST instead of GetLastError()/ WSAGetLastError(). There are still a few remaining places where APR_EEXIST is returned on Win32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60007 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 2 +- file_io/win32/seek.c | 2 +- locks/win32/locks.c | 6 +++--- misc/win32/start.c | 13 +------------ network_io/win32/poll.c | 3 +-- network_io/win32/sockets.c | 2 +- network_io/win32/sockopt.c | 33 +++++---------------------------- threadproc/win32/proc.c | 4 +++- threadproc/win32/thread.c | 26 +++++++++++++------------- threadproc/win32/threadpriv.c | 10 ++++++---- 10 files changed, 35 insertions(+), 66 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index df08302f861..c8f405e0621 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -177,7 +177,7 @@ ap_status_t ap_remove_file(char *path, ap_pool_t *cont) return APR_SUCCESS; } else { - return APR_EEXIST; + return GetLastError(); } } diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 34b1fa22679..16b8a6eace3 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -80,7 +80,7 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) rv = SetFilePointer(thefile->filehand, *offset, NULL, howmove); if (rv == -1) { *offset = -1; - return APR_EEXIST; + return GetLastError(); } else { *offset = rv; diff --git a/locks/win32/locks.c b/locks/win32/locks.c index a9031a05d47..3df71e7ef20 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -107,7 +107,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, (*lock)->mutex = OpenMutex(MUTEX_ALL_ACCESS, TRUE, fname); if ((*lock)->mutex == NULL) { - return APR_EEXIST; + return GetLastError(); } return APR_SUCCESS; } @@ -135,7 +135,7 @@ ap_status_t ap_unlock(ap_lock_t *lock) return APR_SUCCESS; } else { if (ReleaseMutex(lock->mutex) == 0) { - return APR_EEXIST; + return GetLastError(); } } return APR_SUCCESS; @@ -148,7 +148,7 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock) return APR_SUCCESS; } else { if (CloseHandle(lock->mutex) == 0) { - return APR_EEXIST; + return GetLastError(); } } return APR_SUCCESS; diff --git a/misc/win32/start.c b/misc/win32/start.c index 95fa14d960e..a780edf047a 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -237,22 +237,11 @@ ap_status_t ap_initialize(void) int iVersionRequested; WSADATA wsaData; int err; -#if 0 - unsigned tid; - - if (_beginthreadex(NULL, 0, SignalHandling, NULL, 0, &tid) == 0) { - return APR_EEXIST; - } - - while (thread_ready() != 1) { - sleep(1); - } -#endif iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); err = WSAStartup((WORD) iVersionRequested, &wsaData); if (err) { - return APR_EEXIST; + return err; } if (LOBYTE(wsaData.wVersion) != WSAHighByte || HIBYTE(wsaData.wVersion) != WSALowByte) { diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index b7eb0603629..b61193e25cc 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -136,8 +136,7 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, (*nsds) = rv; if ((*nsds) < 0) { - rv = GetLastError(); - return APR_EEXIST; /* TODO - get everybody in synch with Win32 ap_status_t */ + return WSAGetLastError(); } return APR_SUCCESS; } diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 02f243bdc55..6a9c486be5f 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -70,7 +70,7 @@ static ap_status_t socket_cleanup(void *sock) return APR_SUCCESS; } else { - return APR_EEXIST; + return WSAGetLastError(); } } diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index d269b64e6a2..40da086e94f 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -64,7 +64,7 @@ ap_status_t soblock(SOCKET sd) int one = 1; if (ioctlsocket(sd, FIONBIO, &one) == SOCKET_ERROR) { - return APR_EEXIST; + return WSAGetLastError(); } return APR_SUCCESS; } @@ -74,7 +74,7 @@ ap_status_t sononblock(SOCKET sd) int zero = 0; if (ioctlsocket(sd, FIONBIO, &zero) == SOCKET_ERROR) { - return APR_EEXIST; + return WSAGetLastError(); } return APR_SUCCESS; } @@ -128,7 +128,7 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) li.l_onoff = on; li.l_linger = MAX_SECS_TO_LINGER; if (setsockopt(sock->sock, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { - return APR_EEXIST; + return WSAGetLastError(); } } return APR_SUCCESS; @@ -137,7 +137,7 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) ap_status_t ap_gethostname(char *buf, int len, ap_pool_t *cont) { if (gethostname(buf, len) == -1) - return APR_EEXIST; + return WSAGetLastError(); else return APR_SUCCESS; } @@ -157,30 +157,7 @@ ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) return APR_ENOMEM; } - return (WSAGetLastError() + APR_OS_START_SYSERR); -} -#if 0 -ap_status_t status_from_res_error(int reserr) -{ - ap_status_t status; - switch(reserr) { - case WSAHOST_NOT_FOUND: - status = APR_EHOSTNOTFOUND; - break; - case WSATRY_AGAIN: - status = APR_EAGAIN; - break; - case WSANO_RECOVERY: - status = APR_ENORECOVERY; - break; - case WSANO_DATA: - status = APR_ENODATA; - break; - default: - status = APR_ENORECOVERY; - } - return status; + return WSAGetLastError(); } -#endif diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index b516a2cdcb5..0deb6f87cfe 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -194,6 +194,7 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, char ppid[20]; char *envstr; char *pEnvBlock, *pNext; + ap_status_t rv; (*new) = (ap_proc_t *)ap_palloc(cont, sizeof(ap_proc_t)); @@ -285,6 +286,7 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, || (attr->child_err && !DuplicateHandle(hCurrentProcess, attr->parent_err->filehand, hCurrentProcess, &hParenterrdup, 0, FALSE, DUPLICATE_SAME_ACCESS))) { + rv = GetLastError(); if (attr->child_in) { ap_close(attr->child_in); ap_close(attr->parent_in); @@ -297,7 +299,7 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, ap_close(attr->child_err); ap_close(attr->parent_err); } - return APR_EEXIST; + return rv; } else { if (attr->child_in) { diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 5e38f066c07..79a132f90f1 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -108,20 +108,20 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, return stat; } - /* Use 0 for Thread Stack Size, because that will default the stack to the - * same size as the calling thread. - */ + /* Use 0 for Thread Stack Size, because that will default the stack to the + * same size as the calling thread. + */ if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, (unsigned int (API_THREAD_FUNC *)(void *))func, data, 0, &temp)) == 0) { lasterror = GetLastError(); - return APR_EEXIST; + return APR_EEXIST; /* MSVC++ doc doesn't mention any additional error info */ } - if (attr && attr->detach) { - CloseHandle((*new)->td); - } + if (attr && attr->detach) { + CloseHandle((*new)->td); + } - return APR_SUCCESS; + return APR_SUCCESS; } ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) @@ -136,10 +136,10 @@ ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) ap_status_t stat; if ((stat = WaitForSingleObject(thd->td, INFINITE)) == WAIT_OBJECT_0) { - if (GetExitCodeThread(thd->td, retval) == 0) { - return APR_SUCCESS; - } - return APR_EEXIST; + if (GetExitCodeThread(thd->td, retval) == 0) { + return APR_SUCCESS; + } + return GetLastError(); } else { return stat; @@ -152,7 +152,7 @@ ap_status_t ap_thread_detach(ap_thread_t *thd) return APR_SUCCESS; } else { - return APR_EEXIST; + return GetLastError(); } } diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index c556be1926f..a05b6f16725 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -62,8 +62,10 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key, void (*dest)(void *), ap_pool_t *cont) { - (*key)->key = TlsAlloc(); + if (((*key)->key = TlsAlloc()) != 0xFFFFFFFF) { return APR_SUCCESS; + } + return GetLastError(); } ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) @@ -71,7 +73,7 @@ ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) if ((*new) = TlsGetValue(key->key)) { return APR_SUCCESS; } - return APR_EEXIST; + return GetLastError(); } ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) @@ -79,7 +81,7 @@ ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) if (TlsSetValue(key->key, priv)) { return APR_SUCCESS; } - return APR_EEXIST; + return GetLastError(); } ap_status_t ap_delete_thread_private(ap_threadkey_t *key) @@ -87,7 +89,7 @@ ap_status_t ap_delete_thread_private(ap_threadkey_t *key) if (TlsFree(key->key)) { return APR_SUCCESS; } - return APR_EEXIST; + return GetLastError(); } ap_status_t ap_get_threadkeydata(void **data, char *key, ap_threadkey_t *threadkey) From 2e11951de37c496ea0b3f699da9cc940dd07f057 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 1 May 2000 14:26:12 +0000 Subject: [PATCH 0034/7878] Eliminates dead apr\inc from Win32 .dsp projects. Add additional header paths to .dsp cpp includes lists. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60008 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 12 ++++++------ aprlib.dsp | 12 ++++++------ aprlibdll.dsp | 4 ++-- libapr.dsp | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apr.dsp b/apr.dsp index 746feec5732..b4ab2761121 100644 --- a/apr.dsp +++ b/apr.dsp @@ -39,14 +39,14 @@ CPP=cl.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./inc" /I "./misc/win32" /I "./file_io/win32" /I "./time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:".\LibR\apr.lib" -# ADD LIB32 /nologo /out:".\LibR\apr.lib" +# ADD BASE LIB32 /nologo /out:"LibR\apr.lib" +# ADD LIB32 /nologo /out:"LibR\apr.lib" !ELSEIF "$(CFG)" == "aprlib - Win32 Debug" @@ -62,14 +62,14 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "./include" /I "./inc" /I "./misc/win32" /I "./file_io/win32" /I "./time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:".\LibD\apr.lib" -# ADD LIB32 /nologo /out:".\LibD\apr.lib" +# ADD BASE LIB32 /nologo /out:"LibD\apr.lib" +# ADD LIB32 /nologo /out:"LibD\apr.lib" !ENDIF diff --git a/aprlib.dsp b/aprlib.dsp index 746feec5732..b4ab2761121 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -39,14 +39,14 @@ CPP=cl.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./inc" /I "./misc/win32" /I "./file_io/win32" /I "./time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:".\LibR\apr.lib" -# ADD LIB32 /nologo /out:".\LibR\apr.lib" +# ADD BASE LIB32 /nologo /out:"LibR\apr.lib" +# ADD LIB32 /nologo /out:"LibR\apr.lib" !ELSEIF "$(CFG)" == "aprlib - Win32 Debug" @@ -62,14 +62,14 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "./include" /I "./inc" /I "./misc/win32" /I "./file_io/win32" /I "./time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:".\LibD\apr.lib" -# ADD LIB32 /nologo /out:".\LibD\apr.lib" +# ADD BASE LIB32 /nologo /out:"LibD\apr.lib" +# ADD LIB32 /nologo /out:"LibD\apr.lib" !ENDIF diff --git a/aprlibdll.dsp b/aprlibdll.dsp index 05f5831e2a3..4575f664154 100644 --- a/aprlibdll.dsp +++ b/aprlibdll.dsp @@ -44,7 +44,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./inc" /I "./misc/win32" /I "./file_io/win32" /I "./time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 @@ -71,7 +71,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "./include" /I "./inc" /I "./misc/win32" /I "./file_io/win32" /I "./time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 diff --git a/libapr.dsp b/libapr.dsp index 05f5831e2a3..4575f664154 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -44,7 +44,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./inc" /I "./misc/win32" /I "./file_io/win32" /I "./time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 @@ -71,7 +71,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "./include" /I "./inc" /I "./misc/win32" /I "./file_io/win32" /I "./time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 From 581b8a275bf742c18bee501129973e9d466d7572 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 1 May 2000 14:39:35 +0000 Subject: [PATCH 0035/7878] Significantly shorten the Win32 build and shrink symbol tables for precompiled headers and debugging by eliminating large chunks of the windows.h declarations, especially the graphical user interface declarations. Also eliminates redundant inclusion of winsock and windows headers. As the GUI sections can be included by adding the windows.h include prior to any apr headers, these includes now imply something completely different. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60009 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 1 - include/apr.hw | 34 +++++++++++++++++++++++++++++--- include/apr_network_io.h | 4 ---- include/apr_private.hw | 33 ++++++++++++++++++++++++++++--- include/arch/win32/apr_private.h | 33 ++++++++++++++++++++++++++++--- include/arch/win32/threadproc.h | 1 - lib/apr_snprintf.c | 3 --- network_io/win32/poll.c | 1 - network_io/win32/sockets.c | 2 -- network_io/win32/sockopt.c | 1 - threadproc/win32/threadproc.h | 1 - 11 files changed, 91 insertions(+), 23 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index fb16769d834..bc835a22278 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -58,7 +58,6 @@ #include "apr_lib.h" #include "apr_errno.h" #include -#include #include "atime.h" #define GetFilePointer(hfile) SetFilePointer(hfile,0,NULL, FILE_CURRENT) diff --git a/include/apr.hw b/include/apr.hw index 4b29e31d68e..b481af03ca5 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -61,19 +61,47 @@ #ifndef APR_H #define APR_H +/* Has windows.h already been included? If so, our preferences don't matter, + * but we will still need the winsock things no matter what was included. + * If not, include a restricted set of windows headers to our tastes. + */ +#ifndef _WINDOWS_ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #ifndef _WIN32_WINNT -/* - * Compile the server including all the Windows NT 4.0 header files by - * default. + +/* Restrict the server to a subset of Windows NT 4.0 header files by default */ #define _WIN32_WINNT 0x0400 #endif +#ifndef NOUSER +#define NOUSER +#endif +#ifndef NOGDI +#define NOGDI +#endif +#ifndef NONLS +#define NONLS +#endif +#ifndef NOMCX +#define NOMCX +#endif +#ifndef NOIME +#define NOIME +#endif +#include #include +/* + * Add a _very_few_ declarations missing from the restricted set of headers + * (If this list becomes extensive, re-enable the required headers above!) + * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now + */ +#define SW_HIDE 0 #include #include +#endif /* !_WINDOWS_ */ + #include #include #include diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 8646f939efc..ca215f5221e 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -55,10 +55,6 @@ #ifndef APR_NETWORK_IO_H #define APR_NETWORK_IO_H -#ifdef WIN32 -#include -#endif - #include "apr_general.h" #include "apr_file_io.h" #include "apr_errno.h" diff --git a/include/apr_private.hw b/include/apr_private.hw index d3015e35862..2cafe1ab9a3 100644 --- a/include/apr_private.hw +++ b/include/apr_private.hw @@ -65,19 +65,46 @@ #ifndef APR_CONFIG_H #define APR_CONFIG_H +/* Has windows.h already been included? If so, our preferences don't matter, + * but we will still need the winsock things no matter what was included. + * If not, include a restricted set of windows headers to our tastes. + */ +#ifndef _WINDOWS_ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #ifndef _WIN32_WINNT -/* - * Compile the server including all the Windows NT 4.0 header files by - * default. + +/* Restrict the server to a subset of Windows NT 4.0 header files by default */ #define _WIN32_WINNT 0x0400 #endif +#ifndef NOUSER +#define NOUSER +#endif +#ifndef NOGDI +#define NOGDI +#endif +#ifndef NONLS +#define NONLS +#endif +#ifndef NOMCX +#define NOMCX +#endif +#ifndef NOIME +#define NOIME +#endif #include +/* + * Add a _very_few_ declarations missing from the restricted set of headers + * (If this list becomes extensive, re-enable the required headers above!) + * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now + */ +#define SW_HIDE 0 #include #include +#endif /* !_WINDOWS_ */ + #include #include #include diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index d3015e35862..2cafe1ab9a3 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -65,19 +65,46 @@ #ifndef APR_CONFIG_H #define APR_CONFIG_H +/* Has windows.h already been included? If so, our preferences don't matter, + * but we will still need the winsock things no matter what was included. + * If not, include a restricted set of windows headers to our tastes. + */ +#ifndef _WINDOWS_ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #ifndef _WIN32_WINNT -/* - * Compile the server including all the Windows NT 4.0 header files by - * default. + +/* Restrict the server to a subset of Windows NT 4.0 header files by default */ #define _WIN32_WINNT 0x0400 #endif +#ifndef NOUSER +#define NOUSER +#endif +#ifndef NOGDI +#define NOGDI +#endif +#ifndef NONLS +#define NONLS +#endif +#ifndef NOMCX +#define NOMCX +#endif +#ifndef NOIME +#define NOIME +#endif #include +/* + * Add a _very_few_ declarations missing from the restricted set of headers + * (If this list becomes extensive, re-enable the required headers above!) + * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now + */ +#define SW_HIDE 0 #include #include +#endif /* !_WINDOWS_ */ + #include #include #include diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/threadproc.h index 16667de67e7..274626f6132 100644 --- a/include/arch/win32/threadproc.h +++ b/include/arch/win32/threadproc.h @@ -55,7 +55,6 @@ #include "apr_private.h" #include "apr_thread_proc.h" #include "apr_file_io.h" -#include #ifndef THREAD_PROC_H #define THREAD_PROC_H diff --git a/lib/apr_snprintf.c b/lib/apr_snprintf.c index db2cec14020..354843a3d46 100644 --- a/lib/apr_snprintf.c +++ b/lib/apr_snprintf.c @@ -56,9 +56,6 @@ * Tsirigotis for xinetd. */ -#ifdef WIN32 -#include -#endif #include "apr_private.h" #include "apr_lib.h" diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index b61193e25cc..b252e131d02 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -57,7 +57,6 @@ #include "apr_general.h" #include "apr_lib.h" #include -#include #include diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 6a9c486be5f..bfc2295607c 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -58,8 +58,6 @@ #include "apr_lib.h" #include "apr_portable.h" #include -#include -#include static ap_status_t socket_cleanup(void *sock) diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 40da086e94f..238d488510c 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -57,7 +57,6 @@ #include "apr_general.h" #include "apr_lib.h" #include -#include ap_status_t soblock(SOCKET sd) { diff --git a/threadproc/win32/threadproc.h b/threadproc/win32/threadproc.h index 16667de67e7..274626f6132 100644 --- a/threadproc/win32/threadproc.h +++ b/threadproc/win32/threadproc.h @@ -55,7 +55,6 @@ #include "apr_private.h" #include "apr_thread_proc.h" #include "apr_file_io.h" -#include #ifndef THREAD_PROC_H #define THREAD_PROC_H From b18abebfc21c3283ffb212eeb6a75051f77dc43b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 1 May 2000 16:51:24 +0000 Subject: [PATCH 0036/7878] Final .dsp changes to produce the lightest weight builds without precompiled headers or source browse files under Win32. Enabling these is straightforward, if that's what the user desires. Also correct minor errors, and reset some project defaults to their current config. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60010 13f79535-47bb-0310-9956-ffa450edef68 --- aprlibdll.dsp | 11 +++++------ libapr.dsp | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/aprlibdll.dsp b/aprlibdll.dsp index 4575f664154..627fa0a570e 100644 --- a/aprlibdll.dsp +++ b/aprlibdll.dsp @@ -54,8 +54,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /def:".\aprlib.def" /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /def:".\aprlib.def" /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib !ELSEIF "$(CFG)" == "aprlibdll - Win32 Debug" @@ -71,7 +71,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 @@ -81,8 +81,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 aprlib.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /def:".\aprlib.def" /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /def:".\aprlib.def" /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib !ENDIF @@ -97,7 +97,6 @@ SOURCE=.\misc\win32\aprlib.c # Begin Source File SOURCE=.\aprlib.def -# PROP Exclude_From_Build 1 # End Source File # End Target # End Project diff --git a/libapr.dsp b/libapr.dsp index 4575f664154..627fa0a570e 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -54,8 +54,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /def:".\aprlib.def" /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /def:".\aprlib.def" /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib !ELSEIF "$(CFG)" == "aprlibdll - Win32 Debug" @@ -71,7 +71,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 @@ -81,8 +81,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 aprlib.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /def:".\aprlib.def" /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /def:".\aprlib.def" /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib !ENDIF @@ -97,7 +97,6 @@ SOURCE=.\misc\win32\aprlib.c # Begin Source File SOURCE=.\aprlib.def -# PROP Exclude_From_Build 1 # End Source File # End Target # End Project From 5dcbc80255577aea9821950e383d649daa91fd09 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 1 May 2000 21:22:46 +0000 Subject: [PATCH 0037/7878] Add options to APR to allow OTHER_CHILD support to be turned on and off. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60011 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 20 ++++++++++++++++---- include/apr.h.in | 1 + include/apr_thread_proc.h | 6 ++++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 47f13a3c9ab..184e3f0c620 100644 --- a/configure.in +++ b/configure.in @@ -60,8 +60,7 @@ echo $ac_n "${nl}Check for compiler flags..." AC_ARG_WITH(optim,[ --with-optim="FLAGS" compiler optimisation flags], [OPTIM="$withval"]) -AC_ARG_WITH(debug,[ --with-debug Turn on debugging and compile tim -e warnings], +AC_ARG_WITH(debug,[ --with-debug Turn on debugging and compile time warnings], [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall"; else CFLAGS="$CFLAGS -g"; fi]) dnl # this is the place to put specific options for platform/compiler @@ -313,7 +312,7 @@ dnl #----------------------------- Checking for Threads echo $ac_n "${nl}Checking for Threads...${nl}" AC_CACHE_CHECK([for threads], ac_cv_enable_threads, [ AC_ARG_ENABLE(threads, - [ --enable-threads Enable threading support in APR.], + [ --enable-threads Enable threading support in APR.], [ ac_cv_enable_threads=$enableval] , [ AC_CHECK_HEADERS(pthread.h, [ ac_cv_enable_threads="pthread" ] , @@ -362,6 +361,19 @@ fi AC_SUBST(threads) +dnl #----------------------------- Checking for Processes +echo $ac_n "${nl}Checking for Processes...${nl}" +AC_ARG_ENABLE(other-child, + [ --enable-other-child Enable reliable child processes ], + [ if test "$enableval" = "yes"; then + oc="1" + else + oc="0" + fi ], + [ oc=1 ] ) + +AC_SUBST(oc) + dnl #----------------------------- Checking for MMAP echo $ac_n "${nl}Checking for MMAP...${nl}" AC_FUNC_MMAP @@ -453,7 +465,7 @@ AC_CONFIG_SUBDIRS($config_subdirs) AC_MSG_CHECKING(Checking for Shared memory support) AC_ARG_ENABLE(shmem, - [ --enable-shmem Enable shared memory support in APR. ], + [ --enable-shmem Enable shared memory support in APR. ], [ ], ac_cv_enable_shmem="mm" ) diff --git a/include/apr.h.in b/include/apr.h.in index ce4e597755e..5b020a5c27e 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -63,6 +63,7 @@ #define APR_HAS_FORK @fork@ #define APR_HAS_RANDOM @rand@ #define APR_HAS_XLATE @iconv@ +#define APR_HAS_OTHER_CHILD @oc@ /* Typedefs that APR needs. */ diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index b2625366c80..73874009854 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -72,6 +72,7 @@ typedef enum {APR_WAIT, APR_NOWAIT} ap_wait_how_e; #define APR_PARENT_BLOCK 3 #define APR_CHILD_BLOCK 4 +#if APR_HAS_OTHER_CHILD #define APR_OC_REASON_DEATH 0 /* child has died, caller must call * unregister still */ #define APR_OC_REASON_UNWRITABLE 1 /* write_fd is unwritable */ @@ -84,6 +85,7 @@ typedef enum {APR_WAIT, APR_NOWAIT} ap_wait_how_e; * kill the child) */ #define APR_OC_REASON_LOST 4 /* somehow the child exited without * us knowing ... buggy os? */ +#endif /* APR_HAS_OTHER_CHILD */ typedef struct ap_thread_t ap_thread_t; typedef struct ap_threadattr_t ap_threadattr_t; @@ -91,7 +93,9 @@ typedef struct ap_proc_t ap_proc_t; typedef struct ap_procattr_t ap_procattr_t; typedef struct ap_threadkey_t ap_threadkey_t; +#if APR_HAS_OTHER_CHILD typedef struct ap_other_child_rec_t ap_other_child_rec_t; +#endif /* APR_HAS_OTHER_CHILD */ typedef void *(API_THREAD_FUNC *ap_thread_start_t)(void *); @@ -583,6 +587,7 @@ B */ ap_status_t ap_detach(ap_proc_t **new, ap_pool_t *cont); +#if APR_HAS_OTHER_CHILD /* =head1 void ap_register_other_child(ap_proc_t *pid, void (*maintenance) (int reason, void *data, int status), void *data, int write_fd, ap_pool_t *p) @@ -645,6 +650,7 @@ B Date: Tue, 2 May 2000 03:01:02 +0000 Subject: [PATCH 0038/7878] Substitute sigthreadmask for pthread_sigmask, if necessary. Note that the behaviour of sigprocmask in a multi-threaded program is undefined. The AIX 4.3 documentation explicitly says "The sigprocmask, sigsetmask, and sigblock subroutines must not be used in a multi-threaded application." This change allows us to build the Dexter and mpmt_pthread MPM on AIX. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60012 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 4 ---- configure.in | 1 + include/apr.h.in | 5 +++++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/acconfig.h b/acconfig.h index 5ad3008c6a7..40abfb3255a 100644 --- a/acconfig.h +++ b/acconfig.h @@ -56,10 +56,6 @@ /* Make sure we have ssize_t defined to be somethine */ #undef ssize_t -#if !defined(HAVE_PTHREAD_SIGMASK) && defined(_AIX) -#define pthread_sigmask sigprocmask -#endif - #if !defined(HAVE_STRCASECMP) && defined(HAVE_STRICMP) #define strcasecmp(s1,s2) stricmp(s1,s2) #endif diff --git a/configure.in b/configure.in index 184e3f0c620..351c73207eb 100644 --- a/configure.in +++ b/configure.in @@ -126,6 +126,7 @@ AC_CHECK_LIB(truerand,main) dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. AC_CHECK_FUNCS(pthread_sigmask) +AC_CHECK_FUNCS(sigthreadmask) AC_CHECK_FUNCS(strcasecmp stricmp poll setsid) AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) AC_CHECK_FUNCS(writev) diff --git a/include/apr.h.in b/include/apr.h.in index 5b020a5c27e..5513c166898 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -117,4 +117,9 @@ Sigfunc *ap_signal(int signo, Sigfunc * func); #define ap_signal(a,b) signal(a,b) #endif +#if !defined(HAVE_PTHREAD_SIGMASK) && defined(HAVE_SIGTHREADMASK) +#define pthread_sigmask sigthreadmask +#define HAVE_PTHREAD_SIGMASK 1 +#endif + #endif /* APR_H */ From 53064bd9e27e8930e6589787cc8c90732f0776eb Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Tue, 2 May 2000 03:55:36 +0000 Subject: [PATCH 0039/7878] Back out sigthreadmask support. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60013 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 - include/apr.h.in | 5 ----- 2 files changed, 6 deletions(-) diff --git a/configure.in b/configure.in index 351c73207eb..184e3f0c620 100644 --- a/configure.in +++ b/configure.in @@ -126,7 +126,6 @@ AC_CHECK_LIB(truerand,main) dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. AC_CHECK_FUNCS(pthread_sigmask) -AC_CHECK_FUNCS(sigthreadmask) AC_CHECK_FUNCS(strcasecmp stricmp poll setsid) AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) AC_CHECK_FUNCS(writev) diff --git a/include/apr.h.in b/include/apr.h.in index 5513c166898..5b020a5c27e 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -117,9 +117,4 @@ Sigfunc *ap_signal(int signo, Sigfunc * func); #define ap_signal(a,b) signal(a,b) #endif -#if !defined(HAVE_PTHREAD_SIGMASK) && defined(HAVE_SIGTHREADMASK) -#define pthread_sigmask sigthreadmask -#define HAVE_PTHREAD_SIGMASK 1 -#endif - #endif /* APR_H */ From 1383b3b9738f41b53730c0ed88eb2df57cf9e307 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 3 May 2000 00:00:54 +0000 Subject: [PATCH 0040/7878] Initial hack of the Apache/APR "hints" file, which uses information from the 1.3.x builds and "preloads" various compile-time ENV vars, such as CC, CFLAGS, LIBS, etc... with values. At present, the design is as follows: o First of all, we only use these hints if they haven't already been set on the command line. For example: % CC=c89 ./configure will override the setting of CC in hints.m4. If this isn't correct for some platforms, we can use the APR_ADDTO macro instead. o If we set them, we also export them... This makes the most sense at present, but we may rethink this. Methinks another macro?? :) o In many cases, this is a straight grab from the 1.3.x tree. The hooks for Apache will come soon. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60014 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 1 + configure.in | 3 + hints.m4 | 345 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 349 insertions(+) create mode 100644 hints.m4 diff --git a/aclocal.m4 b/aclocal.m4 index ce2128a4a88..84ae7b7b69d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -197,3 +197,4 @@ AC_DEFUN(AC_PROG_RANLIB_NC, [AC_CHECK_PROG(RANLIB, ranlib, ranlib, true)]) sinclude(threads.m4) +sinclude(hints.m4) diff --git a/configure.in b/configure.in index 184e3f0c620..43d178d4e3a 100644 --- a/configure.in +++ b/configure.in @@ -15,6 +15,9 @@ echo "Platform: ${OS}" dnl # Some initial steps for configuration. We setup the default directory dnl # and which files are to be configured. +dnl Preload +APR_PRELOAD + dnl Absolute source/build directory abs_srcdir=`(cd $srcdir && pwd)` abs_builddir=`pwd` diff --git a/hints.m4 b/hints.m4 new file mode 100644 index 00000000000..8d56df7bac9 --- /dev/null +++ b/hints.m4 @@ -0,0 +1,345 @@ +dnl +dnl Apache and APR "hints" file +dnl We preload various configure settings depending +dnl on previously obtained platform knowledge. +dnl We allow all settings to be overridden from +dnl the command-line. +dnl + +dnl +dnl APR_SETIFNULL(variable, value) +dnl +dnl Set variable iff it's currently null +dnl +AC_DEFUN(APR_SETIFNULL,[ + if test -z "$$1"; then + $1="$2$3$4$5$6$7$8$9"; export $1 + fi +]) + +dnl +dnl APR_ADDTO(variable, value) +dnl +dnl Add value to variable +dnl +AC_DEFUN(APR_ADDTO,[ + $1="$$1 $2$3$4$5$6$7$8$9"; export $1 +]) + +dnl +dnl APR_PRELOAD +dnl +dnl Preload various ENV/makefile paramsm such as CC, CFLAGS, etc +dnl based on outside knowledge +AC_DEFUN(APR_PRELOAD, [ +echo "Applying hints file rules" +PLAT=`$ac_config_guess` +PLAT=`$ac_config_sub $PLAT` + +case "$PLAT" in + *mint) + APR_SETIFNULL(CFLAGS, -DMINT) + APR_SETIFNULL(LIBS, -lportlib -lsocket) + ;; + *MPE/iX*) + APR_SETIFNULL(CFLAGS, -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE) + APR_SETIFNULL(LIBS, -lsocket -lsvipc -lcurses) + APR_SETIFNULL(LDFLAGS, -Xlinker \"-WL,cap=ia,ba,ph;nmstack=1024000\") + APR_SETIFNULL(CAT, /bin/cat) + ;; + *-apple-aux3*) + APR_SETIFNULL(CFLAGS, -DAUX3 -D_POSIX_SOURCE) + APR_SETIFNULL(LIBS, -lposix -lbsd) + APR_SETIFNULL(LDFLAGS, -s) + ;; + i386-ibm-aix*) + APR_SETIFNULL(CFLAGS, -DAIX=1 -U__STR__ -DUSEBCOPY) + ;; + *-ibm-aix[1-2].*) + APR_SETIFNULL(CFLAGS, -DAIX=1 -DNEED_RLIM_T -U__STR__) + ;; + *-ibm-aix3.*) + APR_SETIFNULL(CFLAGS, -DAIX=30 -DNEED_RLIM_T -U__STR__) + ;; + *-ibm-aix4.1) + APR_SETIFNULL(CFLAGS, -DAIX=41 -DNEED_RLIM_T -U__STR__) + ;; + *-ibm-aix4.2) + APR_SETIFNULL(CFLAGS, -DAIX=42 -U__STR__) + APR_SETIFNULL(LDFLAGS, -lm) + ;; + *-ibm-aix4.3) + APR_SETIFNULL(CFLAGS, -DAIX=43 -U__STR__) + APR_SETIFNULL(LDFLAGS, -lm) + ;; + *-ibm-aix*) + APR_SETIFNULL(CFLAGS, -DAIX=1 -U__STR__) + APR_SETIFNULL(LDFLAGS, -lm) + ;; + *-apollo-*) + APR_SETIFNULL(CFLAGS, -DAPOLLO) + ;; + *-dg-dgux*) + APR_SETIFNULL(CFLAGS, -DDGUX) + ;; + *OS/2*) + APR_SETIFNULL(CFLAGS, -DOS2 -DTCPIPV4 -g -Zmt) + APR_SETIFNULL(LDFLAGS, -Zexe -Zmtd -Zsysv-signals -Zbin-files) + APR_SETIFNULL(LIBS, -lsocket -lufc -lbsd) + APR_SETIFNULL(SHELL, sh) + ;; + *-hi-hiux) + APR_SETIFNULL(CFLAGS, -DHIUX) + ;; + *-hp-hpux11.*) + APR_SETIFNULL(CFLAGS, -DHPUX11) + APR_SETIFNULL(LIBS, -lm -lpthread) + ;; + *-hp-hpux10.*) + APR_SETIFNULL(CFLAGS, -DHPUX10) + case $PLAT in + *-hp-hpux10.01) +dnl # We know this is a problem in 10.01. +dnl # Not a problem in 10.20. Otherwise, who knows? + APR_ADDTO(CFLAGS, -DSELECT_NEEDS_CAST) + ;; + esac + ;; + *-hp-hpux*) + APR_SETIFNULL(CFLAGS, -DHPUX) + APR_SETIFNULL(LIBS, -lm) + ;; + *-linux2) + APR_SETIFNULL(CFLAGS, -DLINUX=2) + APR_SETIFNULL(LIBS, -lm) + ;; + *-GNU*) + APR_SETIFNULL(CFLAGS, -DHURD) + APR_SETIFNULL(LIBS, -lm -lcrypt) + ;; + *-linux1) + APR_SETIFNULL(CFLAGS, -DLINUX=1) + ;; + *-lynx-lynxos) + APR_SETIFNULL(CFLAGS, -D__NO_INCLUDE_WARN__ -DLYNXOS) + APR_SETIFNULL(LIBS, -lbsd -lcrypt) + ;; + *486-*-bsdi*) + APR_SETIFNULL(CFLAGS, -m486) + ;; + *-netbsd*) + APR_SETIFNULL(CFLAGS, -DNETBSD) + APR_SETIFNULL(LIBS, -lcrypt) + ;; + *-freebsd*) + case $PLAT in + *freebsd[2345]*) + APR_SETIFNULL(CFLAGS, -funsigned-char) + ;; + esac + APR_SETIFNULL(LIBS, -lcrypt) + ;; + *-next-nextstep*) + APR_SETIFNULL(OPTIM, -O) + APR_SETIFNULL(CFLAGS, -DNEXT) + ;; + *-next-openstep*) + APR_SETIFNULL(CC, cc) + APR_SETIFNULL(OPTIM, -O) + APR_SETIFNULL(CFLAGS, -DNEXT) + ;; +dnl *-apple-rhapsody*) +dnl APR_SETIFNULL(CFLAGS, -DDARWIN -DMAC_OS_X_SERVER) +dnl ;; + *-apple-darwin*) + APR_SETIFNULL(CFLAGS, -DDARWIN) + ;; + *-dec-osf*) + APR_SETIFNULL(CFLAGS, -DOSF1) + APR_SETIFNULL(LIBS, -lm) + ;; + *-qnx) + APR_SETIFNULL(CFLAGS, -DQNX) + APR_SETIFNULL(LIBS, -N128k -lsocket -lunix) + ;; + *-qnx32) + APR_SETIFNULL(CC, cc -F) + APR_SETIFNULL(CFLAGS, -DQNX -mf -3) + APR_SETIFNULL(LIBS, -N128k -lsocket -lunix) + ;; + *-isc4*) + APR_SETIFNULL(CC, gcc) + APR_SETIFNULL(CFLAGS, -posix -DISC) + APR_SETIFNULL(LDFLAGS, -posix) + APR_SETIFNULL(LIBS, -linet) + ;; + *-sco3*) + APR_SETIFNULL(CFLAGS, -DSCO -Oacgiltz) + APR_SETIFNULL(LIBS, -lPW -lsocket -lmalloc -lcrypt_i) + ;; + *-sco5*) + APR_SETIFNULL(CFLAGS, -DSCO5) + APR_SETIFNULL(LIBS, -lsocket -lmalloc -lprot -ltinfo -lx -lm) + ;; + *-sco_sv*|*-SCO_SV*) + APR_SETIFNULL(CFLAGS, -DSCO) + APR_SETIFNULL(LIBS, -lPW -lsocket -lmalloc -lcrypt_i) + ;; + *-solaris2*) + PLATOSVERS=`echo $PLAT | sed 's/^.*solaris2.//'` + APR_SETIFNULL(CFLAGS, -DSOLARIS2=$PLATOSVERS) + APR_SETIFNULL(LIBS, -lsocket -lnsl) + ;; + *-sunos4*) + APR_SETIFNULL(CFLAGS, -DSUNOS4 -DUSEBCOPY) + ;; + *-unixware1) + APR_SETIFNULL(CFLAGS, -DUW=100) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lcrypt) + ;; + *-unixware2) + APR_SETIFNULL(CFLAGS, -DUW=200) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lcrypt -lgen) + ;; + *-unixware211) + APR_SETIFNULL(CFLAGS, -DUW=211) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lcrypt -lgen) + ;; + *-unixware212) + APR_SETIFNULL(CFLAGS, -DUW=212) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lcrypt -lgen) + ;; + *-unixware7) + APR_SETIFNULL(CFLAGS, -DUW=700) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lcrypt -lgen) + ;; + maxion-*-sysv4*) + APR_SETIFNULL(CFLAGS, -DSVR4) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lc -lgen) + ;; + *-*-powermax*) + APR_SETIFNULL(CFLAGS, -DSVR4) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lgen) + ;; + TPF) + APR_SETIFNULL(CC, c89) + APR_SETIFNULL(CFLAGS, -DTPF -DCHARSET_EBCDIC -D_POSIX_SOURCE) + ;; + BS2000*-siemens-sysv4*) + APR_SETIFNULL(CC, c89 -XLLML -XLLMK -XL -Kno_integer_overflow) + APR_SETIFNULL(CFLAGS, -DCHARSET_EBCDIC -DSVR4 -D_XPG_IV) + ;; + *-siemens-sysv4*) + APR_SETIFNULL(CFLAGS, -DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT -DNEED_UNION_SEMUN) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lc) + ;; + pyramid-pyramid-svr4) + APR_SETIFNULL(CFLAGS, -DSVR4 -DNO_LONG_DOUBLE) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lc) + ;; + DS/90\ 7000-*-sysv4*) + APR_SETIFNULL(CFLAGS, -DUXPDS) + APR_SETIFNULL(LIBS, -lsocket -lnsl) + ;; + *-tandem-sysv4*) + APR_SETIFNULL(CFLAGS, -DSVR4) + APR_SETIFNULL(LIBS, -lsocket -lnsl) + ;; + *-ncr-sysv4) + APR_SETIFNULL(CFLAGS, -DSVR4 -DMPRAS) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lc -L/usr/ucblib -lucb) + ;; + *-sysv4*) + APR_SETIFNULL(CFLAGS, -DSVR4) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lc) + ;; + 88k-encore-sysv4) + APR_SETIFNULL(CFLAGS, -DSVR4 -DENCORE) + APR_SETIFNULL(LIBS, -lPW) + ;; + *-uts*) + PLATOSVERS=`echo $PLAT | sed 's/^.*,//'` + case $PLATOSVERS in + 2*) APR_SETIFNULL(CFLAGS, -Xa -eft -DUTS21 -DUSEBCOPY) + APR_SETIFNULL(LIBS, -lsocket -lbsd -la) + ;; + *) APR_SETIFNULL(CFLAGS, -Xa -DSVR4) + APR_SETIFNULL(LIBS, -lsocket -lnsl) + ;; + esac + ;; + *-ultrix) + APR_SETIFNULL(CFLAGS=-DULTRIX) + APR_SETIFNULL(SHELL=/bin/sh5) + ;; + *powerpc-tenon-machten*) + APR_SETIFNULL(LDFLAGS, -Xlstack=0x14000 -Xldelcsect) + ;; + *-machten*) + APR_SETIFNULL(LDFLAGS, -stack 0x14000) + ;; + *convex-v11*) + APR_SETIFNULL(CFLAGS, -ext -DCONVEXOS11) + APR_SETIFNULL(OPTIM, -O1) + APR_SETIFNULL(CC, cc) + ;; + i860-intel-osf1) + APR_SETIFNULL(CFLAGS, -DPARAGON) + ;; + *-sequent-ptx2.*.*) + APR_SETIFNULL(CFLAGS, -DSEQUENT=20 -Wc,-pw) + APR_SETIFNULL(LIBS, -lsocket -linet -lnsl -lc -lseq) + ;; + *-sequent-ptx4.0.*) + APR_SETIFNULL(CFLAGS, -DSEQUENT=40 -Wc,-pw) + APR_SETIFNULL(LIBS, -lsocket -linet -lnsl -lc) + ;; + *-sequent-ptx4.[123].*) + APR_SETIFNULL(CFLAGS, -DSEQUENT=41 -Wc,-pw) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lc) + ;; + *-sequent-ptx4.4.*) + APR_SETIFNULL(CFLAGS, -DSEQUENT=44 -Wc,-pw) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lc) + ;; + *-sequent-ptx4.5.*) + APR_SETIFNULL(CFLAGS, -DSEQUENT=45 -Wc,-pw) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lc) + ;; + *-sequent-ptx5.0.*) + APR_SETIFNULL(CFLAGS, -DSEQUENT=50 -Wc,-pw) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lc) + ;; + *NEWS-OS*) + APR_SETIFNULL(CFLAGS, -DNEWSOS) + ;; + *-riscix) + APR_SETIFNULL(CFLAGS, -DRISCIX) + APR_SETIFNULL(OPTIM, -O) + APR_SETIFNULL(MAKE, make) + ;; + *-BeOS*) + APR_SETIFNULL(CFLAGS, -DBEOS) + ;; + 4850-*.*) + APR_SETIFNULL(CFLAGS, -DSVR4 -DMPRAS) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lc -L/usr/ucblib -lucb) + ;; + drs6000*) + APR_SETIFNULL(CFLAGS, -DSVR4) + APR_SETIFNULL(LIBS, -lsocket -lnsl -lc -L/usr/ucblib -lucb) + ;; + m88k-*-CX/SX|CYBER) + APR_SETIFNULL(CFLAGS, -D_CX_SX -Xa) + APR_SETIFNULL(CC, cc) + ;; + *-tandem-oss) + APR_SETIFNULL(CFLAGS=-D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED=1) + APR_SETIFNULL(CC, c89) + ;; + *-IBM-OS390*) + APR_SETIFNULL(CC, c89) + APR_SETIFNULL(CFLAGS, -DOS390 -DCHARSET_EBCDIC -D_ALL_SOURCE) + ;; +esac +]) From 833dd1938fdc8d3936ee088383b8e10b203ba1a9 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 3 May 2000 00:37:03 +0000 Subject: [PATCH 0041/7878] Minor fluff... Nice to note what system is being preloaded, just in case :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60015 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hints.m4 b/hints.m4 index 8d56df7bac9..28c1c4ef9a9 100644 --- a/hints.m4 +++ b/hints.m4 @@ -32,9 +32,9 @@ dnl dnl Preload various ENV/makefile paramsm such as CC, CFLAGS, etc dnl based on outside knowledge AC_DEFUN(APR_PRELOAD, [ -echo "Applying hints file rules" PLAT=`$ac_config_guess` PLAT=`$ac_config_sub $PLAT` +echo "Applying hints file rules for $PLAT" case "$PLAT" in *mint) From b4787c5d52fcadc1c2eaebb314400e9c69555607 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 3 May 2000 13:18:58 +0000 Subject: [PATCH 0042/7878] Test for file readable rather than file exist. Submitted by: Brian Martin git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60016 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 43d178d4e3a..6e817239317 100644 --- a/configure.in +++ b/configure.in @@ -503,7 +503,7 @@ if test -r "/dev/random"; then AC_DEFINE(DEV_RANDOM, [/dev/random]) AC_MSG_RESULT(/dev/random) rand="1" -elif test -f "/dev/urandom"; then +elif test -r "/dev/urandom"; then AC_DEFINE(DEV_RANDOM, [/dev/urandom]) AC_MSG_RESULT(/dev/urandom) rand="1" From 0ffc8b749c96ed90df2186f875684020efad095d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 3 May 2000 15:49:45 +0000 Subject: [PATCH 0043/7878] helpers directory has been copied to apr/helpers. The configure script should now be using APR's copies of the helpers scripts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60017 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 6e817239317..e18e64c94d6 100644 --- a/configure.in +++ b/configure.in @@ -25,7 +25,7 @@ abs_builddir=`pwd` dnl Get location of helpers directory dnl XXX This assumes that APR "lives" under Apache. dnl XXX We'll need to fix this when we pull it out. -abs_helpersdir=$abs_srcdir/../../helpers +abs_helpersdir=$abs_srcdir/helpers MKDIR=$abs_helpersdir/mkdir.sh if test "$abs_builddir" != "$abs_srcdir"; then From 45f7a985c95c8111eca16ed542ea88f192cb1069 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 3 May 2000 17:15:49 +0000 Subject: [PATCH 0044/7878] Update MM to the latest version. retrieved from http://www.engelschall.com/sw/mm git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60018 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/mm/ChangeLog | 250 +++++ shmem/unix/mm/INSTALL | 5 +- shmem/unix/mm/LICENSE | 2 +- shmem/unix/mm/Makefile.in | 21 +- shmem/unix/mm/PORTING | 87 ++ shmem/unix/mm/README | 68 +- shmem/unix/mm/THANKS | 61 ++ shmem/unix/mm/aclocal.m4 | 112 ++- shmem/unix/mm/config.guess | 196 +--- shmem/unix/mm/config.sub | 2 +- shmem/unix/mm/configure.in | 22 +- shmem/unix/mm/fbtool | 2 +- shmem/unix/mm/ltconfig | 183 ++-- shmem/unix/mm/ltmain.sh | 99 +- shmem/unix/mm/mm-config.1 | 13 +- shmem/unix/mm/mm-config.in | 2 +- shmem/unix/mm/mm-config.pod | 2 +- shmem/unix/mm/mm.3 | 156 ++-- shmem/unix/mm/mm.h | 46 +- shmem/unix/mm/mm.pod | 144 +-- shmem/unix/mm/mm_alloc.c | 6 +- shmem/unix/mm/mm_conf.h.in | 50 +- shmem/unix/mm/mm_core.c | 47 +- shmem/unix/mm/mm_global.c | 2 +- shmem/unix/mm/mm_lib.c | 2 +- shmem/unix/mm/mm_test.c | 42 + shmem/unix/mm/mm_vers.c | 20 +- shmem/unix/mm/shtool | 1744 +++-------------------------------- 28 files changed, 1173 insertions(+), 2213 deletions(-) create mode 100644 shmem/unix/mm/ChangeLog create mode 100644 shmem/unix/mm/PORTING create mode 100644 shmem/unix/mm/THANKS diff --git a/shmem/unix/mm/ChangeLog b/shmem/unix/mm/ChangeLog new file mode 100644 index 00000000000..2f0503ef652 --- /dev/null +++ b/shmem/unix/mm/ChangeLog @@ -0,0 +1,250 @@ + __ __ __ __ + | \/ | \/ | + | |\/| | |\/| | + | | | | | | | + |_| |_|_| |_| + + MM - Shared Memory Library + + ChangeLog + ========= + _ _ + / | / | + | | | | + | |_| | + __|_(_)_|__________________________________________________________ + + Changes between 1.1.0 and 1.1.1 (30-Apr-2000 to 30-Apr-2000) + + *) Fixed compilation under Solaris where the SunOS4 and BS2000 kludges + for conflicted with the Sun vendor includes (which + unfortunately use the defines). + [Ralf S. Engelschall, Jeff Beard ] + + Changes between 1.0.12 and 1.1.0 (28-Sep-1999 to 30-Apr-2000) + + *) Fixed `make test' feedback procedure in Makefile.in now that the + platform list is stored in the PORTING file. + [Ralf S. Engelschall] + + *) Renamed file CHANGES to ChangeLog. + [Ralf S. Engelschall] + + *) Fixed pointer arithmentic in memset/memcpy replacements + by casting `void *' arguments to `char *'. + [Sascha Schumann ] + + *) Added BS2000 support for stuff. + [Martin Kraemer ] + + *) Added an include for to maximum shared mem segment size + check in aclocal.m4. This especially fixes compile problems under for + Solaris 8. + [Alexander Demenchuk , Greg Gears ] + + *) Fixed a warning under IRIX related to size_t comparisons + [Ralf S. Engelschall] + + *) Added support for IBM OS/390 + [Jeff Trawick ] + + *) Upgraded to GNU libtool from version 1.3.3 to 1.3.4 + and upgraded GNU shtool from version 1.4.6 to 1.4.9 + [Ralf S. Engelschall] + + *) Upgraded config.guess to GNU Pth's version and + use "/sbin/sysctl" under FreeBSD instead of just "sysctl" + [Jeff Trawick ] + + *) Added platform support for the esoteric Unix look-alike BeOS + [David Reid" ] + + *) Added `make check' as an alias for `make test' + [Ralf S. Engelschall] + + *) Adjusted copyright messages for year 2000 + [Ralf S. Engelschall] + + *) Fixed Autoconf checks for SunOS + [Ralf S. Engelschall] + + *) Fixed a bug in aclocal.m4's AC_CHECK_DEFINE macro. + [Ralf S. Engelschall] + + *) Updated the manual page (typos, fixes, etc.) + [Ralf S. Engelschall] + + *) Splitted README into README, PORTING and THANKS document. + [Ralf S. Engelschall] + + _ ___ + / | / _ \ + | || | | | + | || |_| | + __|_(_)___/________________________________________________________ + + Changes between 1.0.11 and 1.0.12 (06-Sep-1999 to 28-Sep-1999) + + *) Recreated configure with latest Autoconf 2.13.1 (snapshot) + *) Always use --mode=xxx for libtool calls to avoid problems under + situations where $CC doesn't allow libtool to guess the mode + correctly. + + Changes between 1.0.10 and 1.0.11 (27-Aug-1999 to 06-Sep-1999) + + *) Cleaned up various file permission in source tree + *) Enhanced mm-config.in: new --all option and less newlines + *) Added support --silent to libtool glue code in aclocal.m4 + *) Upgraded to GNU Pth's more recent config.{guess,sub} + *) Upgraded to GNU shtool 1.4.6 + *) Fixed --section for mm-config in Makefile.in + *) Added `void *' casts to MAP_FAILED (= -1) values to avoid + warnings under some platforms. + *) Fixed a few typos in mm.pod + + Changes between 1.0.9 and 1.0.10 (02-Jul-1999 to 27-Aug-1999) + + *) Changed "make dist" and "make snap" to use "shtool tarball" + *) Added #define KERNEL for SunOS to get SHM_R und SHM_W values. + *) Upgraded to GNU libtool 1.3.3 + *) Upgraded to GNU shtool 1.4.5 + *) Downgraded required Autoconf version to 2.12 + *) Added MM version number to test report + *) Added --enable-batch + *) Moved mm_lock_mode in mm.h to top to avoid warnings + + Changes between 1.0.8 and 1.0.9 (24-Jun-1999 to 02-Jul-1999) + + *) Fixed a nasty bug related to {MM,mm}_[un]lock(): + an additional semicolon broke the semantics. + *) Upgraded to released shtool 1.4.0 + *) Fixed `make test' + + Changes between 1.0.7 and 1.0.8 (22-Jun-1999 to 24-Jun-1999) + + *) Added important MAP_FAILED fallback also to Autoconf stuff + *) Upgraded to latest shtool 1.3.0-dev to fix two Awk problems + + Changes between 1.0.6 and 1.0.7 (06-Jun-1999 to 22-Jun-1999) + + *) Upgraded to latest shtool 1.3.0-dev + *) Avoid -g under non-debugging situation + *) Complain with a fatal error message when MM_SHM_MAXSEGSIZE + couldn't be determined. + *) Updated config.guess/config.sub + *) Fixed a nasty permission bug for the lock files: + they were opened write-only, but at least fcntl() + requires them to be opened read-write. + *) Check return value of mm_core_lock() in mm_alloc.c + + Changes between 1.0.5 and 1.0.6 (02-Jun-1999 to 06-Jun-1999) + + *) Fixed mm_malloc() function: it returned the wrong pointer when a chunk + was reused and forgot to lock/unlock the data structures. + *) Fixed internal best-fit algorithm for finding a free memory chunk: + - things got inserted out of order in the list + - when chunk is found which matches size exactly it stops immediately + - lowered chunk splitting threshold to MIN(2*size,128) + *) Moved internal definitions in mm.h to private section + + Changes between 1.0.4 and 1.0.5 (21-May-1999 to 02-Jun-1999) + + *) Fixed output of mm-config.in + *) Fixed output of configure --help + *) Upgraded to GNU libtool 1.3.2 + *) Upgraded to shtool 1.2.9 + *) Made libtool calls visible but use --quiet + *) Hint user to send feedback only on errors or for new platform + *) Removed unnecessary "elf" hint for FreeBSD from config.guess + + Changes between 1.0.3 and 1.0.4 (15-May-1999 to 21-May-1999) + + *) Fixed maximum memory size determination and internal handling + *) Documented the mm_lib_xxx() functions. + + Changes between 1.0.2 and 1.0.3 (26-Apr-1999 to 15-May-1999) + + *) Added {MM,mm,mm_core}_permission() function + *) Fixed version information and mod_ssl URL in manual page + *) Upgraded config.{guess,sub} from libtool 1.3 distribution + *) Upgraded to GNU libtool 1.3 + *) Upgraded to shtool 1.2.7 + *) Fixed public includes for xx_t types + *) Fixed mm_vers.c and shtool type inside CVS + + Changes between 1.0.1 and 1.0.2 (18-Apr-1999 to 26-Apr-1999) + + *) Upgraded to GNU libtool 1.2f + *) Upgraded to shtool 1.1.0 + + Changes between 1.0.0 and 1.0.1 (18-Mar-1999 to 18-Apr-1999) + + *) Fixed "dist" Makefile target to not distribute CVS stuff + *) Upgraded lshtool to the latest version + *) Const'ification of the API + + Changes between 1.0b6 and 1.0.0 (18-Mar-1999 to 28-Mar-1999) + + *) Finally cleaned up and polished the mm.pod manual page. + *) Fixed mm-config program + + Changes between 1.0b5 and 1.0b6 (18-Mar-1999 to 18-Mar-1999) + + *) Added {MM,mm}_maxsize() to manual page + *) Changed MM_create() signature to match mm_create() + + Changes between 1.0b4 and 1.0b5 (15-Mar-1999 to 18-Mar-1999) + + *) Make sure the maximum allocateable size takes + the overhead of the memory pool into account. + *) Fixed lshtool and this way hex version string + *) Fixed Makefile for mm_test target dependecies + *) Added {MM,mm}_maxsize() function to let one + determine in advance the maximum allocateable pool + + Changes between 1.0b3 and 1.0b4 (15-Mar-1999 to 15-Mar-1999) + + *) Added mm-config.pod manpage + *) Split mm-config --ldflags into --ldflags and --libs + *) Removed TODO and fulltest files + + Changes between 1.0b2 and 1.0b3 (13-Mar-1999 to 15-Mar-1999) + + *) Added Autoconf check for determining max shared mem segment size + *) Changed -1 to MAP_FAILED when available + *) Replaced 8KB default shared memory segment size with max size + *) Added mm_core_maxsegsize() function + *) Use a remembered offset for mmap() on temporary files + *) Imported source tree into CVS + *) Added read-only locking support + *) Fixed MMFILE and MMZERO variants + + Changes between 1.0b1 and 1.0b2 (12-Mar-1999 to 13-Mar-1999) + + *) Updated the mm.pod manual page. + *) Split README into README and LICENSE files + *) Fixed becho problems + *) Added a test suite summary + *) Added INSTALL file + *) Reduced mm_test's memory size from 1MB to 512KB + *) Fixed unsigned long and %X related warnings + + Changes between 1.0b0 and 1.0b1 (11-Mar-1999 to 12-Mar-1999) + + *) Enhanced mm_test + *) Added {MM,mm}_available() function + *) Fixed MMZERO + *) Fixed IPC Semaphore initialization + *) Added --with-{sem,shm}=TYPE options + *) Fixed "make test" and mm_memory_display() function + *) Added mm_lib.c source with mm_lib_xx() functions + + Changes between 0.9.0 and 1.0b0 (10-Mar-1999 to 11-Mar-1999) + + *) Switched to GNU Autoconf and GNU Libtool + + Changes between GENESIS and 0.9.0 (Jan-1999 to 10-Mar-1999) + + *) Created initial version on FreeBSD + *) Ported to Linux and Solaris + diff --git a/shmem/unix/mm/INSTALL b/shmem/unix/mm/INSTALL index 1f42c1d4abd..15b6388634c 100644 --- a/shmem/unix/mm/INSTALL +++ b/shmem/unix/mm/INSTALL @@ -3,9 +3,12 @@ | |\/| | |\/| | | | | | | | | |_| |_|_| |_| - + MM - Shared Memory Library + INSTALL + ======= + To install the MM library into /path/to/mm/{bin,lib,include,man}/ perform the following steps in your shell: diff --git a/shmem/unix/mm/LICENSE b/shmem/unix/mm/LICENSE index 3bd1c3d4131..c95b7d240ab 100644 --- a/shmem/unix/mm/LICENSE +++ b/shmem/unix/mm/LICENSE @@ -1,6 +1,6 @@ ==================================================================== - Copyright (c) 1999 Ralf S. Engelschall. All rights reserved. + Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/shmem/unix/mm/Makefile.in b/shmem/unix/mm/Makefile.in index 206580d2c05..681f7ab48af 100644 --- a/shmem/unix/mm/Makefile.in +++ b/shmem/unix/mm/Makefile.in @@ -1,5 +1,5 @@ ## ==================================================================== -## Copyright (c) 1999 Ralf S. Engelschall. All rights reserved. +## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions @@ -74,31 +74,29 @@ _VERSION = \ .SUFFIXES: .o .lo .c.o: - $(LIBTOOL) --quiet --mode=compile \ - $(CC) -c $(CFLAGS) $< + $(LIBTOOL) --quiet --mode=compile $(CC) -c $(CFLAGS) $< .c.lo: - $(LIBTOOL) --quiet --mode=compile \ - $(CC) -c $(CFLAGS) $< + $(LIBTOOL) --quiet --mode=compile $(CC) -c $(CFLAGS) $< all: libmm.la $(MAN) mm_test libmm.la: $(OBJ) $(LOBJ) - $(LIBTOOL) --quiet --mode=link \ - $(CC) -o libmm.la $(LOBJ) \ + $(LIBTOOL) --quiet --mode=link $(CC) -o libmm.la $(LOBJ) \ -rpath $(libdir) -version-info `$(SHTOOL) version -l c -d libtool mm_vers.c` mm_alloc.c mm_core.c mm_global.c: mm_conf.h mm.h mm_vers.c +check: test test: mm_test -@./mm_test; \ if [ $$? -eq 0 ]; then \ PLATFORM=`$(SHELL) ./config.guess`; \ PLATFORM=`$(SHELL) ./config.sub $$PLATFORM`; \ - if [ ".`grep $$PLATFORM README`" = . ]; then \ + if [ ".`grep $$PLATFORM PORTING`" = . ]; then \ echo "Please send the following summary via Email to the author"; \ echo "Ralf S. Engelschall for inclusion into"; \ - echo "the list of successfully tested platforms (see README file):"; \ + echo "the list of successfully tested platforms (see PORTING file):"; \ echo ""; \ echo "Ok" >.fbtool; \ $(SHELL) ./fbtool -d; \ @@ -118,8 +116,7 @@ debug: mm_test @$(LIBTOOL) --mode=execute gdb mm_test mm_test: mm_test.lo libmm.la - $(LIBTOOL) --quiet --mode=link \ - $(CC) -o $@ mm_test.lo libmm.la + $(LIBTOOL) --quiet --mode=link $(CC) -o $@ mm_test.lo libmm.la mm.3: mm.pod V1=`$(SHTOOL) version -l c -d short $(_VERSION_FILE)`; \ @@ -157,7 +154,7 @@ ltconfig: echo "ltconfig <-- $$F"; cp $$F . shtool: - shtoolize -o shtool all + shtoolize -o shtool version echo mkdir install fixperm tarball install: all $(SHTOOL) mkdir -f -p -m 755 $(bindir) diff --git a/shmem/unix/mm/PORTING b/shmem/unix/mm/PORTING new file mode 100644 index 00000000000..04d4c241969 --- /dev/null +++ b/shmem/unix/mm/PORTING @@ -0,0 +1,87 @@ + __ __ __ __ + | \/ | \/ | + | |\/| | |\/| | + | | | | | | | + |_| |_|_| |_| + + MM - Shared Memory Library + + PORTING + ======= + + The MM library was successfully tested on the following platforms (and + should automatically adjust to other platforms, of course): + + o i686-pc-freebsd3.1 FreeBSD 3.1 + o i686-pc-freebsd3.2 FreeBSD 3.2 + o i686-pc-freebsd3.3 FreeBSD 3.3 + o i586-pc-freebsd3.4 FreeBSD 3.4 + o i686-pc-freebsd3.4 FreeBSD 3.4 + o i586-pc-freebsd2.2.7 FreeBSD 2.2.7 + o i586-pc-freebsd2.2.8 FreeBSD 2.2.8 + o i486-pc-freebsd2.2.6 FreeBSD 2.2.6 + o i586-pc-freebsd2.2.2 FreeBSD 2.2.2 + o i686-pc-freebsd4.0 FreeBSD 4.0 + o i386-unknown-openbsd2.4 OpenBSD 2.4 + o i386-unknown-openbsd2.5 OpenBSD 2.5 + o i386-unknown-netbsd1.4 NetBSD 1.4/x86 + o i386-unknown-netbsd1.4.2 NetBSD 1.4.2/x86 + o sparc-unknown-netbsd1.4.1 NetBSD 1.4.1/sparc + o sparc-unknown-netbsd1.4.2 NetBSD 1.4.2/sparc + o alpha-unknown-netbsd1.4.2 NetBSD 1.4.2/alpha + o i386-pc-bsdi2.1 BSDI 2.1 + o i386-pc-bsdi4.0.1 BSDI 4.0.1 + o i586-pc-linux-gnu RedHat 5.2 + o i586-pc-linux-gnu RedHat 5.0 + o i686-pc-linux-gnu Redhat 6.0 + o i686-pc-linux-gnu Slackware 7.0 + o i486-pc-linux-gnulibc1 Linux + o i686-pc-linux-gnulibc1 Linux + o i686-pc-linux-gnulibc1 Slackware 4.0 + o i586-pc-linux-gnulibc1 Slackware 4.0 + o sparc64-unknown-linux-gnu Linux + o sparc-unknown-linux-gnu Linux + o alphaev6-unknown-linux-gnu Linux + o alpha-unknown-linux-gnu Linux + o powerpc-unknown-linux-gnulibc1 MkLinux DR3 + o sparc-sun-sunos4.1.4 SunOS 4.1.4 + o sparc-sun-sunos4.1.3_U1 SunOS 4.1.3_U1 + o sparc-sun-solaris2.5.1 Solaris 2.5.1 + o sparc-sun-solaris2.6 Solaris 2.6 + o sparc-sun-solaris2.7 Solaris 2.7 + o i386-pc-solaris2.6 Solaris 2.6/x86 + o i386-pc-solaris2.7 Solaris 2.7/x86 + o i386-pc-solaris2.8 Solaris 2.7/x86 + o sparc-sun-solaris2.8 Solaris 2.8 + o alphaev56-dec-osf4.0d Digital Unix v4.0D + o alphaev56-dec-osf4.0c Digital Unix v4.0C + o alphaev6-dec-osf5.0 Digital Unix v5.0 (Tru64) + o powerpc-ibm-aix4.2.0.0 AIX 4.2.0 + o powerpc-ibm-aix4.2.1.0 AIX 4.2.1 + o rs6000-ibm-aix4.2.1.0 AIX 4.2.1 + o powerpc-ibm-aix4.3.1.0 AIX 4.3.1 + o powerpc-ibm-aix4.3.2.0 AIX 4.3.2 + o rs6000-ibm-aix4.3.2.0 AIX 4.3.2 + o alphaev56-unknown-linux-gnu Linux/Alpha + o powerpc-unknown-linux-gnu LinuxPPC 4 + o m68k-apple-aux3.1.1 A/UX 3.1.1 + o hppa1.1-hp-hpux10.10 HP-UX 10.10 + o hppa1.1-hp-hpux10.20 HP-UX 10.20 + o hppa2.0-hp-hpux10.20 HP-UX 10.20 + o hppa1.1-hp-hpux11.00 HP-UX 11.00 + o hppa2.0w-hp-hpux11.00 HP-UX 11.00 + o arm-unknown-linux-gnu Corel Netwinder SA110 + o mips-sni-sysv4 SIEMENS ReliantUNIX + o mips-sgi-irix5.3 IRIX 5.3 + o mips-sgi-irix6.2 IRIX 6.2 + o mips-sgi-irix6.3 IRIX 6.3 + o mips-sgi-irix6.4 IRIX 6.4 + o mips-sgi-irix6.5 IRIX 6.5.4 + o i686-pc-cygwin Win32 CygWin 20.1 + o alpha-dec-osf3.2 OSF/1 3.2 + o alpha-dec-osf4.0d OSF/1 4.0d + o alpha-dec-osf4.0e OSF/1 4.0e + o alphaev6-dec-osf4.0f OSF/1 4.0f + o i686-UnixWare7.1.0-sysv5 UnixWare 7.1 + o i686-pc-sco3.2v5.0.5 SCO OpenServer 5.0.5 + diff --git a/shmem/unix/mm/README b/shmem/unix/mm/README index 5a19d6c08ad..626e130e5f3 100644 --- a/shmem/unix/mm/README +++ b/shmem/unix/mm/README @@ -5,8 +5,8 @@ |_| |_|_| |_| MM - Shared Memory Library - Copyright (c) 1999 Ralf S. Engelschall, All rights reserved. - Version 1.0.8 (24-Jun-1999) + Copyright (c) 1999-2000 Ralf S. Engelschall, All rights reserved. + Version 1.1.1 (30-Apr-2000) The MM library is a 2-layer abstraction library which simplifies the usage of shared memory between forked (and this way strongly related) processes @@ -16,67 +16,9 @@ high-level malloc(3)-style API for a convenient and well known way to work with data-structures inside those shared memory segments. - This library was successfully tested on the following platforms (and - should automatically adjust to other platforms, of course): - - o i386-unknown-freebsd3.1 FreeBSD 3.1 - o i386-unknown-freebsd3.2 FreeBSD 3.2 - o i386-unknown-freebsd2.2.7 FreeBSD 2.2.7 - o i386-unknown-freebsd2.2.8 FreeBSD 2.2.8 - o i386-unknown-freebsd2.2.2 FreeBSD 2.2.2 - o i386-unknown-openbsd2.5 OpenBSD 2.5 - o i386-pc-bsdi4.0.1 BSDI 4.0.1 - o i586-pc-linux-gnu RedHat 5.2 - o i586-pc-linux-gnu RedHat 5.0 - o i686-pc-linux-gnu Redhat 6.0 - o i486-pc-linux-gnulibc1 Linux - o i686-pc-linux-gnulibc1 Slackware 4.0 - o i586-pc-linux-gnulibc1 Slackware 4.0 - o sparc-sun-solaris2.6 Solaris 2.6 - o sparc-sun-solaris2.7 Solaris 2.7 - o i386-pc-solaris2.7 Solaris 2.7 - o alphaev56-dec-osf4.0d Digital Unix v4.0D - o alphaev56-dec-osf4.0c Digital Unix v4.0C - o powerpc-ibm-aix4.2.0.0 AIX 4.2 - o powerpc-ibm-aix4.3.1.0 AIX 4.2 - o alphaev56-unknown-linux-gnu Linux/Alpha - o powerpc-unknown-linux-gnu LinuxPPC 4 - o m68k-apple-aux3.1.1 A/UX 3.1.1 - o hppa1.1-hp-hpux10.10 HP-UX 10.10 - o hppa1.1-hp-hpux10.20 HP-UX 10.20 - o hppa2.0-hp-hpux10.20 HP-UX 10.20 - o arm-unknown-linux-gnu Corel Netwinder SA110 - o mips-sni-sysv4 SIEMENS ReliantUNIX - o mips-sgi-irix6.2 IRIX 6.2 - o mips-sgi-irix6.3 IRIX 6.3 - o mips-sgi-irix6.4 IRIX 6.4 - o mips-sgi-irix6.5 IRIX 6.5.4 - - Credit has to be given to the following people who contributed ideas, - bugfixes, hints, gave platform feedback, etc. (in alphabetical order): - - o Ronald Appelfelder - o Robert Belleman - o Jeff Clark - o Eric Cholet - o Dean Gaudet - o Ask Bjoern Hansen - o Jim Jagielski - o Mats Josefsson - o Sergey Kachanovsky - o Martin Kraemer - o Rasmus Lerdorf - o Dave Malhotra - o Christophe Massiot - o Patrick - o Charles Randall - o David Rees - o Christian Reiber - o Dan Sullivan - o Tom Vaughan - o Rick Watson - o Mark Wilkie - o Cliff Woolley + This library was successfully tested on FreeBSD, OpenBSD, NetBSD, BSDI, + Linux, SunOS, Solaris, Tru64, AIX, A/UX, HP-UX, ReliantUNIX, IRIX, UnixWare + and even Win32 Cygwin, BeOS and OS/390. The documentation and latest release can be found on http://www.engelschall.com/sw/mm/ diff --git a/shmem/unix/mm/THANKS b/shmem/unix/mm/THANKS new file mode 100644 index 00000000000..d2081ee0b80 --- /dev/null +++ b/shmem/unix/mm/THANKS @@ -0,0 +1,61 @@ + __ __ __ __ + | \/ | \/ | + | |\/| | |\/| | + | | | | | | | + |_| |_|_| |_| + + MM - Shared Memory Library + + THANKS + ====== + + Credit has to be given to the following people who contributed ideas, + bugfixes, hints, gave platform feedback, etc. (in alphabetical order): + + o Ronald Appelfelder + o Robert Belleman + o Ryan Bloom + o Volker Borchert + o William Campbell + o Richard Cardwell + o Jeff Clark + o Eric Cholet + o Alexander Demenchuk + o Jason Dillon + o Joe France + o Richard Furda + o Dean Gaudet + o Greg Gears + o Ask Bjoern Hansen + o Robin Hunt + o Markus Kilbinger + o Kristian Köhntopp + o Jim Jagielski + o Bob Jones + o Mats Josefsson + o Sergey Kachanovsky + o Martin Kraemer + o Mike Latinovich + o Rasmus Lerdorf + o Dave Malhotra + o Christophe Massiot + o Thomas J. Menini + o Patrick + o Charles Randall + o David Rees + o Martin Rosenbach + o David Reid + o Scott Rothgaber + o Saeid Sadeghi + o Mehul N. Sanghvi + o Joaquim Sanmarti + o Sascha Schumann + o Dan Sullivan + o Jeff Trawick + o Tom Vaughan + o Kai Voigt + o Martin Waterworth + o Rick Watson + o Mark Wilkie + o Cliff Woolley + diff --git a/shmem/unix/mm/aclocal.m4 b/shmem/unix/mm/aclocal.m4 index 0bbf26bc42c..d7b97fc4560 100644 --- a/shmem/unix/mm/aclocal.m4 +++ b/shmem/unix/mm/aclocal.m4 @@ -1,6 +1,43 @@ -dnl ## -dnl ## -dnl ## +## ==================================================================== +## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in +## the documentation and/or other materials provided with the +## distribution. +## +## 3. All advertising materials mentioning features or use of this +## software must display the following acknowledgment: +## "This product includes software developed by +## Ralf S. Engelschall ." +## +## 4. Redistributions of any form whatsoever must retain the following +## acknowledgment: +## "This product includes software developed by +## Ralf S. Engelschall ." +## +## THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY +## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR +## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +## OF THE POSSIBILITY OF SUCH DAMAGE. +## ==================================================================== +divert(-1) + define(AC_PROG_LIBTOOL,[dnl AC_ARG_ENABLE(static,dnl [ --enable-static build static libraries (default=yes)], @@ -25,9 +62,7 @@ AC_MSG_ERROR([libtool configuration failed]) LIBTOOL="\$(TOP)/libtool" AC_SUBST(LIBTOOL) ])dnl -dnl ## -dnl ## -dnl ## + define(AC_CHECK_DEBUGGING,[dnl AC_MSG_CHECKING(for compilation debug mode) AC_ARG_ENABLE(debug,dnl @@ -62,28 +97,27 @@ msg=disabled ])dnl AC_MSG_RESULT([$msg]) ]) -dnl ## -dnl ## -dnl ## + define(AC_CONFIGURE_PART,[dnl AC_MSG_RESULT() AC_MSG_RESULT(${T_MD}$1:${T_ME}) ])dnl -dnl ## -dnl ## -dnl ## + define(AC_CHECK_DEFINE,[dnl -AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1, -AC_EGREP_CPP([YES_IS_DEFINED], [ + AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1, + AC_EGREP_CPP([YES_IS_DEFINED], [ #include <$2> #ifdef $1 YES_IS_DEFINED #endif -], ac_cv_define_$1=yes; AC_DEFINE(HAVE_$1), ac_cv_define_$1=no) -)])dnl -dnl ## -dnl ## -dnl ## + ], ac_cv_define_$1=yes, ac_cv_define_$1=no) + ) + if test "$ac_cv_define_$1" = "yes" ; then + AC_DEFINE(HAVE_$1) + fi +])dnl +AC_DEFINE(HAVE_$1) + define(AC_IFALLYES,[dnl ac_rc=yes for ac_spec in $1; do @@ -116,9 +150,7 @@ else $3 fi ])dnl -dnl ## -dnl ## -dnl ## + define(AC_BEGIN_DECISION,[dnl ac_decision_item='$1' ac_decision_msg='FAILED' @@ -155,9 +187,7 @@ else AC_MSG_RESULT([decision on $ac_decision_item... $ac_decision_msg]) fi ])dnl -dnl ## -dnl ## -dnl ## + AC_DEFUN(AC_TEST_FILE, [AC_REQUIRE([AC_PROG_CC]) ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` @@ -177,9 +207,7 @@ else ifelse([$3], , , [$3]) fi ]) -dnl ## -dnl ## AC_PROG_NM - find the path to a BSD-compatible name lister -dnl ## + AC_DEFUN(AC_PROG_NM, [AC_MSG_CHECKING([for BSD-compatible nm]) AC_CACHE_VAL(ac_cv_path_NM, @@ -211,9 +239,7 @@ NM="$ac_cv_path_NM" AC_MSG_RESULT([$NM]) AC_SUBST(NM) ]) -dnl # -dnl # -dnl # + define(AC_CHECK_MAXSEGSIZE,[dnl AC_MSG_CHECKING(for shared memory maximum segment size) OCFLAGS="$CFLAGS" @@ -228,29 +254,33 @@ changequote(<<, >>)dnl #include #include #include +#include #include #include #include -#ifdef HAVE_FCNTL_H -#include -#endif #ifdef TEST_MMAP #include #endif #ifdef TEST_SHMGET +#ifdef MM_OS_SUNOS +#define KERNEL 1 +#endif +#ifdef MM_OS_BS2000 +#define _KMEMUSER +#endif #include -#ifndef _OSD_POSIX #include +#ifdef MM_OS_SUNOS +#undef KERNEL +#endif +#ifdef MM_OS_BS2000 +#undef _KMEMUSER +#endif #if !defined(SHM_R) #define SHM_R 0400 #endif #if !defined(SHM_W) #define SHM_W 0200 -#endif -#else -#define _KMEMUSER 1 /* BS2000 needs this to enable SHM_[RW] */ -#include -#undef _KMEMUSER #endif #endif #if !defined(MAP_FAILED) @@ -369,3 +399,5 @@ test ".$msg" = .unknown && AC_MSG_ERROR([Unable to determine maximum shared memo AC_MSG_RESULT([$msg]) AC_DEFINE_UNQUOTED(MM_SHM_MAXSEGSIZE, $MM_SHM_MAXSEGSIZE) ]) + +divert diff --git a/shmem/unix/mm/config.guess b/shmem/unix/mm/config.guess index 5523028afc2..9c362ec93d8 100755 --- a/shmem/unix/mm/config.guess +++ b/shmem/unix/mm/config.guess @@ -226,7 +226,7 @@ EOF exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor + # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not @@ -627,172 +627,52 @@ EOF echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:Linux:*:*) - # uname on the ARM produces all sorts of strangeness, and we need to - # filter it out. - case "$UNAME_MACHINE" in - armv*) UNAME_MACHINE=$UNAME_MACHINE ;; - arm* | sa110*) UNAME_MACHINE="arm" ;; + # determine canonical machine name + MACHINE="$UNAME_MACHINE" + case "$MACHINE" in + arm*|sa110*) MACHINE="arm" ;; esac - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - ld_help_string=`cd /; ld --help 2>&1` - ld_supported_emulations=`echo $ld_help_string \ - | sed -ne '/supported emulations:/!d - s/[ ][ ]*/ /g - s/.*supported emulations: *// - s/ .*// - p'` - case "$ld_supported_emulations" in - *ia64) echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 ;; - i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; - i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; - sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - elf32ppc | elf32ppclinux) - # Determine Lib Version - cat >$dummy.c </dev/null`; do + test ! -f /etc/$tagfile && continue + VENDOR=`echo $tagfile | sed -e 's/-release$//' -e 's/_version$//' |\ + tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + done + + # determine kernel version + KERNEL=`echo ${UNAME_RELEASE} | sed -e 's/^\([0-9]*\.[0-9]*\)\..*$/\1/'` + + # determine [g]libc version + cat >$dummy.c < #include -#if defined(__GLIBC__) -extern char __libc_version[]; -extern char __libc_release[]; -#endif main(argc, argv) - int argc; - char *argv[]; +int argc; +char *argv[]; { -#if defined(__GLIBC__) - printf("%s %s\n", __libc_version, __libc_release); +#if defined(__GLIBC__) && !defined(__GLIBC_MINOR__) + printf("%d", __GLIBC__); +#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) + printf("%d.%d", __GLIBC__, __GLIBC_MINOR__); +#elif defined(__GNU_LIBRARY__) + printf("%d", __GNU_LIBRARY__); #else - printf("unkown\n"); + printf("1"); #endif - return 0; + return 0; } EOF - LIBC="" - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy | grep 1\.99 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.c $dummy - echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;; - esac - - if test "${UNAME_MACHINE}" = "alpha" ; then - sed 's/^ //' <$dummy.s - .globl main - .ent main - main: - .frame \$30,0,\$26,0 - .prologue 0 - .long 0x47e03d80 # implver $0 - lda \$2,259 - .long 0x47e20c21 # amask $2,$1 - srl \$1,8,\$2 - sll \$2,2,\$2 - sll \$0,3,\$0 - addl \$1,\$0,\$0 - addl \$2,\$0,\$0 - ret \$31,(\$26),1 - .end main -EOF - LIBC="" - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy - case "$?" in - 7) - UNAME_MACHINE="alpha" - ;; - 15) - UNAME_MACHINE="alphaev5" - ;; - 14) - UNAME_MACHINE="alphaev56" - ;; - 10) - UNAME_MACHINE="alphapca56" - ;; - 16) - UNAME_MACHINE="alphaev6" - ;; - esac - - objdump --private-headers $dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 - elif test "${UNAME_MACHINE}" = "mips" ; then - cat >$dummy.c </dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - else - # Either a pre-BFD a.out linker (linux-gnuoldld) - # or one that does not give us useful --help. - # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. - # If ld does not provide *any* "supported emulations:" - # that means it is gnuoldld. - echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" - test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + LIBC="1" + $CC_FOR_BUILD $dummy.c -o $dummy # 2>/dev/null + if [ $? = 0 ]; then + LIBC=`./$dummy | sed -e 's/^\([0-9]*\.[0-9]*\)\..*$/\1/'` + fi + rm -f $dummy.c $dummy - case "${UNAME_MACHINE}" in - i?86) - VENDOR=pc; - ;; - *) - VENDOR=unknown; - ;; - esac - # Determine whether the default compiler is a.out or elf - cat >$dummy.c < -#ifdef __cplusplus - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __ELF__ -# ifdef __GLIBC__ -# if __GLIBC__ >= 2 - printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -#else - printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - fi ;; + echo "${MACHINE}-${VENDOR}-linux${KERNEL}glibc${LIBC}" + ;; # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # are messed up and put the nodename in both sysname and nodename. i?86:DYNIX/ptx:4*:*) @@ -896,7 +776,7 @@ EOF echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; BS2000:POSIX-BC:*:*) - echo bs2000-siemens-sysv4 + echo BS2000-siemens-sysv4 exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 diff --git a/shmem/unix/mm/config.sub b/shmem/unix/mm/config.sub index 0fd1ade4a9c..a3239783747 100755 --- a/shmem/unix/mm/config.sub +++ b/shmem/unix/mm/config.sub @@ -850,7 +850,7 @@ case $basic_machine in basic_machine=c4x-none os=-coff ;; - bs2000-siemens) + BS2000-siemens) ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 diff --git a/shmem/unix/mm/configure.in b/shmem/unix/mm/configure.in index e7de4dd965c..3f2bb7b9501 100644 --- a/shmem/unix/mm/configure.in +++ b/shmem/unix/mm/configure.in @@ -7,7 +7,7 @@ dnl # standard Autoconf prolog dnl # AC_PREREQ(2.12)dnl -AC_REVISION(1.0)dnl +AC_REVISION($1.0$)dnl dnl # shtool bootstrap SHTOOL="\$(TOP)/shtool" @@ -22,12 +22,12 @@ AC_SUBST(MM_VERSION_STR) dnl # friendly header ;-) echo "Configuring ${T_MD}MM${T_ME} (Shared Memory Library), Version ${T_MD}${MM_VERSION_STR}${T_ME}" -echo "Copyright (c) 1999 Ralf S. Engelschall, All Rights Reserved." +echo "Copyright (c) 1999-2000 Ralf S. Engelschall, All Rights Reserved." echo "Platform: ${T_MD}${PLATFORM}${T_ME}" dnl # autoconf initialization AC_INIT(README) -AC_CONFIG_HEADER(mm_conf.h)dnl +AC_CONFIG_HEADER(mm_conf.h) AC_PREFIX_DEFAULT(/usr/local) dnl # determine build mode @@ -81,7 +81,8 @@ AC_CHECK_DEFINE(CHILD_MAX, limits.h) dnl # some special defines for brain dead platforms case $PLATFORM in - *-*-sunos* ) AC_DEFINE(MM_OS_SUNOS) ;; + *-*-sunos* ) AC_DEFINE(MM_OS_SUNOS) ;; + BS2000-*-* ) AC_DEFINE(MM_OS_BS2000) ;; esac dnl # @@ -90,10 +91,9 @@ dnl # AC_CONFIGURE_PART(Virtual Memory Page Size) -AC_HAVE_HEADERS(unistd.h) +AC_HAVE_HEADERS(unistd.h kernel/OS.h) AC_HAVE_FUNCS(getpagesize sysconf) AC_CHECK_DEFINE(_SC_PAGESIZE, unistd.h) -AC_HAVE_HEADERS(kernel/OS.h) AC_CHECK_DEFINE(B_PAGE_SIZE, kernel/OS.h) AC_BEGIN_DECISION([memory page size determination]) @@ -134,7 +134,7 @@ AC_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl AC_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON, AC_DECIDE(MM_SHMT_MMANON, [4.4BSD-style mmap() via MAP_ANON])) AC_IFALLYES(header:kernel/OS.h func:create_area, - AC_DECIDE(MM_SHMT_BEOS, [BeOS areas])) + AC_DECIDE(MM_SHMT_BEOS, [BeOS areas])) case $PLATFORM in *-*-linux* ) # Linux has problems with MM_SHMT_MMANON @@ -143,7 +143,7 @@ case $PLATFORM in ;; esac AC_ARG_WITH(shm,dnl -[ --with-shm=TYPE force shared memory type: MMFILE MMZERO MMPOSX MMANON IPCSHM], +[ --with-shm=TYPE force shared memory type: MMFILE MMZERO MMPOSX MMANON IPCSHM BEOS], AC_DECISION_FORCE(MM_SHMT_$withval) )dnl AC_END_DECISION @@ -164,7 +164,7 @@ AC_CHECK_DEFINE(F_SETLK, fcntl.h) AC_CHECK_DEFINE(IPC_PRIVATE, sys/ipc.h) AC_CHECK_DEFINE(SEM_UNDO, sys/sem.h) AC_HAVE_HEADERS(kernel/OS.h) -AC_CHECK_FUNCS(create_sem, kernel/OS.h) +AC_CHECK_FUNCS(create_sem) AC_MSG_CHECKING(whether union semun is defined in sys/sem.h) AC_TRY_COMPILE([ @@ -189,9 +189,9 @@ AC_IFALLYES(header:sys/ipc.h header:sys/sem.h header:sys/file.h dnl AC_IFALLYES(header:fcntl.h define:F_SETLK, AC_DECIDE(MM_SEMT_FCNTL, [SVR4-style fcntl() on temporary file])) AC_IFALLYES(header:kernel/OS.h func:create_sem, - AC_DECIDE(MM_SEMT_BEOS, [BeOS semaphores/benaphores])) + AC_DECIDE(MM_SEMT_BEOS, [BeOS semaphores])) AC_ARG_WITH(sem,dnl -[ --with-sem=TYPE force semaphore type: FLOCK FCNTL IPCSEM], +[ --with-sem=TYPE force semaphore type: FLOCK FCNTL IPCSEM BEOS], AC_DECISION_FORCE(MM_SEMT_$withval) )dnl AC_END_DECISION diff --git a/shmem/unix/mm/fbtool b/shmem/unix/mm/fbtool index 5b6b2231896..ead314880b5 100755 --- a/shmem/unix/mm/fbtool +++ b/shmem/unix/mm/fbtool @@ -1,7 +1,7 @@ #!/bin/sh ## ## fbtool -- MM library feedback tool -## Copyright (c) 1999 Ralf S. Engelschall, All Rights Reserved. +## Copyright (c) 1999-2000 Ralf S. Engelschall, All Rights Reserved. ## if [ ! -f .fbtool ]; then diff --git a/shmem/unix/mm/ltconfig b/shmem/unix/mm/ltconfig index 65ec6f65d0f..a01334f9212 100755 --- a/shmem/unix/mm/ltconfig +++ b/shmem/unix/mm/ltconfig @@ -53,7 +53,7 @@ fi # Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. -if test "X${PATH_SEPARATOR+set}" != "Xset"; then +if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) PATH_SEPARATOR=';' ;; @@ -63,9 +63,9 @@ fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. -if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi +if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi -if test "X${echo_test_string+set}" != "Xset"; then +if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... @@ -169,10 +169,10 @@ progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` # Constants: PROGRAM=ltconfig PACKAGE=libtool -VERSION=1.3.3 -TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)" -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5' +VERSION=1.3.4 +TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)" +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' rm="rm -f" help="Try \`$progname --help' for more information." @@ -369,8 +369,8 @@ exec 5>>./config.log # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi +if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi if test -n "$cache_file" && test -r "$cache_file"; then echo "loading cache $cache_file within ltconfig" @@ -462,7 +462,7 @@ aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test "${COLLECT_NAMES+set}" != set; then + if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -663,7 +663,7 @@ if test "$with_gcc" = yes; then link_static_flag='-static' case "$host_os" in - beos* | irix5* | irix6* | osf3* | osf4*) + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; aix*) @@ -718,7 +718,7 @@ else # We can build DLLs from non-PIC. ;; - osf3* | osf4*) + osf3* | osf4* | osf5*) # All OSF/1 code is PIC. wl='-Wl,' link_static_flag='-non_shared' @@ -1187,7 +1187,7 @@ EOF ;; netbsd*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else @@ -1196,7 +1196,7 @@ EOF fi ;; - solaris*) + solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 @@ -1244,7 +1244,12 @@ EOF whole_archive_flag_spec= ;; *) - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi ;; esac fi @@ -1405,7 +1410,7 @@ else old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' ;; - osf3* | osf4*) + osf3*) if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' @@ -1417,6 +1422,18 @@ else hardcode_libdir_separator=: ;; + osf4* | osf5*) # As osf3* with the addition of the -msym flag + if test "$with_gcc" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no @@ -1461,6 +1478,18 @@ else export_dynamic_flag_spec='-Bexport' ;; + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' @@ -1474,14 +1503,28 @@ else ;; sysv4*MP*) - if test -d /usr/nec ;then - # archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs' - archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs' + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' + hardcode_direct=yes + hardcode_minus_L=no hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH hardcode_runpath_var=yes - ld_shlibs=yes - fi + runpath_var=LD_RUN_PATH + ;; + + unixware7*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no ;; *) @@ -1589,11 +1632,11 @@ void nm_test_func(){} main(){nm_test_var='a';nm_test_func();return(0);} EOF - echo "$progname:1592: checking if global_symbol_pipe works" >&5 - if { (eval echo $progname:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then + echo "$progname:1635: checking if global_symbol_pipe works" >&5 + if { (eval echo $progname:1636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then # Now try to grab the symbols. nlist=conftest.nm - if { echo "$progname:1596: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then + if { echo "$progname:1639: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -1645,7 +1688,7 @@ EOF save_CFLAGS="$CFLAGS" LIBS="conftstm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo $progname:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo $progname:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 @@ -1787,8 +1830,9 @@ beos*) bsdi4*) version_type=linux - library_names_spec='${libname}.so$major ${libname}.so' - soname_spec='${libname}.so' + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' @@ -1796,6 +1840,7 @@ bsdi4*) file_magic_test_file=/shlib/libc.so sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs @@ -1841,10 +1886,9 @@ freebsd*) need_version=yes ;; esac - finish_cmds='PATH="\$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH case "$host_os" in - freebsd2* | freebsd3.[01]*) + freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes ;; *) # from 3.2 on @@ -1896,8 +1940,6 @@ irix5* | irix6*) *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac - # this will be overridden with pass_all, but let us keep it just in case - deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH @@ -1972,7 +2014,7 @@ os2*) shlibpath_var=LIBPATH ;; -osf3* | osf4*) +osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so' @@ -2167,7 +2209,7 @@ else if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then lt_cv_dlopen=no lt_cv_dlopen_libs= echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "$progname:2170: checking for dlopen in -ldl" >&5 +echo "$progname:2212: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2175,17 +2217,20 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2204,18 +2249,21 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "$progname:2207: checking for dlopen" >&5 +echo "$progname:2252: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char dlopen(); int main() { @@ -2231,7 +2279,7 @@ dlopen(); ; return 0; } EOF -if { (eval echo $progname:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -2248,7 +2296,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -echo "$progname:2251: checking for dld_link in -ldld" >&5 +echo "$progname:2299: checking for dld_link in -ldld" >&5 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2256,17 +2304,20 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2285,18 +2336,21 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "$progname:2288: checking for shl_load" >&5 +echo "$progname:2339: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif char shl_load(); int main() { @@ -2312,7 +2366,7 @@ shl_load(); ; return 0; } EOF -if { (eval echo $progname:2315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else @@ -2330,7 +2384,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "$progname:2333: checking for shl_load in -ldld" >&5 +echo "$progname:2387: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2338,18 +2392,21 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2392,17 +2449,17 @@ fi for ac_hdr in dlfcn.h; do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "$progname:2395: checking for $ac_hdr" >&5 +echo "$progname:2452: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int fnord = 0; EOF -ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo $progname:2405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_try="$ac_compile >/dev/null 2>conftest.out" +{ (eval echo $progname:2462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2430,7 +2487,7 @@ done LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2433: checking whether a program can dlopen itself" >&5 +echo "$progname:2490: checking whether a program can dlopen itself" >&5 if test "${lt_cv_dlopen_self+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2438,7 +2495,7 @@ else lt_cv_dlopen_self=cross else cat > conftest.c < @@ -2484,7 +2541,7 @@ main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF -if { (eval echo $progname:2487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo $progname:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self=yes else @@ -2503,7 +2560,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "$lt_cv_dlopen_self" = yes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2506: checking whether a statically linked program can dlopen itself" >&5 +echo "$progname:2563: checking whether a statically linked program can dlopen itself" >&5 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2511,7 +2568,7 @@ else lt_cv_dlopen_self_static=cross else cat > conftest.c < @@ -2557,7 +2614,7 @@ main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF -if { (eval echo $progname:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo $progname:2617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self_static=yes else @@ -2649,7 +2706,7 @@ case "$ltmain" in # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. # # Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Gordon Matzigkeit , 1996 +# Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -2675,7 +2732,7 @@ Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. -if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi ### BEGIN LIBTOOL CONFIG EOF @@ -2938,7 +2995,7 @@ case "$ltmain" in # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test "${COLLECT_NAMES+set}" != set; then +if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -2948,6 +3005,10 @@ EOF # Append the ltmain.sh script. sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? chmod +x "$ofile" ;; diff --git a/shmem/unix/mm/ltmain.sh b/shmem/unix/mm/ltmain.sh index f479d1ef57f..b01e311ffdf 100644 --- a/shmem/unix/mm/ltmain.sh +++ b/shmem/unix/mm/ltmain.sh @@ -54,8 +54,8 @@ modename="$progname" # Constants. PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.3.3 -TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)" +VERSION=1.3.4 +TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)" default_mode= help="Try \`$progname --help' for more information." @@ -435,7 +435,7 @@ compiler." fbsd_hideous_sh_bug=$base_compile # All platforms use -DPIC, to notify preprocessed assembler code. - command="$base_compile $pic_flag -DPIC $srcfile" + command="$base_compile $srcfile $pic_flag -DPIC" if test "$build_old_libs" = yes; then lo_libobj="$libobj" dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` @@ -521,9 +521,17 @@ compiler." exit $error fi + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` + libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` # Now arrange that obj and lo_libobj become the same file - $show "$LN_S $obj $lo_libobj" - if $run $LN_S $obj $lo_libobj; then + $show "(cd $xdir && $LN_S $baseobj $libobj)" + if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then exit 0 else error=$? @@ -613,8 +621,6 @@ compiler." # libtool link mode link) modename="$modename: link" - C_compiler="$CC" # save it, to compile generated C sources - CC="$nonopt" case "$host" in *-*-cygwin* | *-*-mingw* | *-*-os2*) # It is impossible to link a dll without this setting, and @@ -802,8 +808,8 @@ compiler." allow_undefined=yes ;; esac - compile_command="$CC" - finalize_command="$CC" + compile_command="$nonopt" + finalize_command="$nonopt" compile_rpath= finalize_rpath= @@ -1851,7 +1857,7 @@ compiler." int main() { return 0; } EOF $rm conftest - $C_compiler -o conftest conftest.c $deplibs + $CC -o conftest conftest.c $deplibs if test $? -eq 0 ; then ldd_output=`ldd conftest` for i in $deplibs; do @@ -1884,7 +1890,7 @@ EOF # If $name is empty we are operating on a -L argument. if test "$name" != "" ; then $rm conftest - $C_compiler -o conftest conftest.c $i + $CC -o conftest conftest.c $i # Did it work? if test $? -eq 0 ; then ldd_output=`ldd conftest` @@ -2047,12 +2053,19 @@ EOF done # Ensure that we have .o objects for linkers which dislike .lo - # (e.g. aix) incase we are running --disable-static + # (e.g. aix) in case we are running --disable-static for obj in $libobjs; do - oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"` - if test ! -f $oldobj; then - $show "${LN_S} $obj $oldobj" - $run ${LN_S} $obj $oldobj || exit $? + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` + if test ! -f $xdir/$oldobj; then + $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" + $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? fi done @@ -2311,8 +2324,16 @@ EOF # Just create a symlink. $show $rm $libobj $run $rm $libobj - $show "$LN_S $obj $libobj" - $run $LN_S $obj $libobj || exit $? + xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$libobj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` + oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` + $show "(cd $xdir && $LN_S $oldobj $baseobj)" + $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? fi if test -n "$gentop"; then @@ -2598,16 +2619,21 @@ static const void *lt_preloaded_setup() { # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*) + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DPIC";; esac esac # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" @@ -2776,7 +2802,7 @@ sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. -if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi +if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" @@ -2865,7 +2891,7 @@ else fi" else echo >> $output "\ - program='$outputname$exeext' + program='$outputname' progdir=\"\$thisdir/$objdir\" " fi @@ -2995,14 +3021,21 @@ fi\ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else - # Ensure that we have .o objects in place incase we decided + # Ensure that we have .o objects in place in case we decided # not to build a shared library, and have fallen back to building # static libs even though --disable-static was passed! for oldobj in $oldobjs; do if test ! -f $oldobj; then - obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"` - $show "${LN_S} $obj $oldobj" - $run ${LN_S} $obj $oldobj || exit $? + xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$oldobj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` + obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` + $show "(cd $xdir && ${LN_S} $obj $baseobj)" + $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? fi done @@ -3672,8 +3705,10 @@ libdir='$install_libdir'\ done if test -z "$run"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then @@ -3690,8 +3725,10 @@ libdir='$install_libdir'\ exit 1 else # Display what would be done. - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi $echo "$cmd$args" exit 0 fi diff --git a/shmem/unix/mm/mm-config.1 b/shmem/unix/mm/mm-config.1 index 512f0d4e830..16e1f9fbeba 100644 --- a/shmem/unix/mm/mm-config.1 +++ b/shmem/unix/mm/mm-config.1 @@ -1,11 +1,12 @@ .rn '' }` -''' $RCSfile: mm-config.1,v $$Revision: 1.2 $$Date: 1999/09/27 07:42:06 $ +''' $RCSfile: mm-config.1,v $$Revision: 1.3 $$Date: 2000/05/03 17:15:48 $ ''' ''' $Log: mm-config.1,v $ -''' Revision 1.2 1999/09/27 07:42:06 rse -''' Update the MM version APR contains to a more recent one. +''' Revision 1.3 2000/05/03 17:15:48 rbb +''' Update MM to the latest version. retrieved from +''' http://www.engelschall.com/sw/mm ''' -''' Revision 1.7 1999/09/06 11:32:17 rse +''' Revision 1.11 2000/04/30 18:35:59 rse ''' *** empty log message *** ''' ''' @@ -99,7 +100,7 @@ .nr % 0 .rr F .\} -.TH MM-CONFIG 1 "06-Sep-1999" "MM 1.0.11" "Shared Memory Library" +.TH MM-CONFIG 1 "30-Apr-2000" "MM 1.1.1" "Shared Memory Library" .UC .if n .hy 0 .if n .na @@ -196,7 +197,7 @@ .SH "NAME" \fBmm-config\fR \- MM library configuration/build utility .SH "VERSION" -MM 1.0.11 (06-Sep-1999) +MM 1.1.1 (30-Apr-2000) .SH "SYNOPSIS" \fBmm-config\fR [\fB--help\fR] diff --git a/shmem/unix/mm/mm-config.in b/shmem/unix/mm/mm-config.in index 7e4e774cfbd..bfb3a248bb9 100644 --- a/shmem/unix/mm/mm-config.in +++ b/shmem/unix/mm/mm-config.in @@ -3,7 +3,7 @@ ## mm-config -- MM library build configuration utility ## ## ==================================================================== -## Copyright (c) 1999 Ralf S. Engelschall. All rights reserved. +## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions diff --git a/shmem/unix/mm/mm-config.pod b/shmem/unix/mm/mm-config.pod index 1891a62e802..9dbf6c4a1e6 100644 --- a/shmem/unix/mm/mm-config.pod +++ b/shmem/unix/mm/mm-config.pod @@ -1,5 +1,5 @@ ## ==================================================================== -## Copyright (c) 1999 Ralf S. Engelschall. All rights reserved. +## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions diff --git a/shmem/unix/mm/mm.3 b/shmem/unix/mm/mm.3 index 94ef391a31b..46108f406ce 100644 --- a/shmem/unix/mm/mm.3 +++ b/shmem/unix/mm/mm.3 @@ -1,12 +1,10 @@ .rn '' }` -''' $RCSfile: mm.3,v $$Revision: 1.3 $$Date: 2000/03/10 00:06:32 $ +''' $RCSfile: mm.3,v $$Revision: 1.4 $$Date: 2000/05/03 17:15:49 $ ''' ''' $Log: mm.3,v $ -''' Revision 1.3 2000/03/10 00:06:32 rbb -''' Fix all the License issues. Including: -''' s/Apache Group/Apache Software Foundation/ -''' s/1999/2000/ -''' s/Sascha's license/ASF license +''' Revision 1.4 2000/05/03 17:15:49 rbb +''' Update MM to the latest version. retrieved from +''' http://www.engelschall.com/sw/mm ''' ''' .de Sh @@ -99,7 +97,7 @@ .nr % 0 .rr F .\} -.TH mm 3 "06-Sep-1999" "MM 1.0.11" "Shared Memory Library" +.TH mm 3 "30-Apr-2000" "MM 1.1.1" "Shared Memory Library" .UC .if n .hy 0 .if n .na @@ -196,7 +194,7 @@ .SH "NAME" \fBMM \- Shared Memory Library\fR .SH "VERSION" -MM 1.0.11 (06-Sep-1999) +MM 1.1.1 (30-Apr-2000) .SH "SYNOPSIS" .PP .Vb 1 @@ -270,7 +268,7 @@ with data-structures inside those shared memory segments. .PP The abbreviation \fBMM\fR is historically and originally comes from the phrase ``\fImemory mapped\fR'\*(R' as used by the POSIX.1 \fImmap\fR\|(2) function. Because this -facility is internally used by this library on most platforms to create the +facility is internally used by this library on most platforms to establish the shared memory segments. .Sh "\s-1LIBRARY\s0 \s-1STRUCTURE\s0" This library is structured into three main APIs which are internally based on @@ -283,89 +281,90 @@ based data structures without the need to change the code dramatically. All which is needed is to prefix the \s-1POSIX\s0.1 memory allocation functions with `\f(CWMM_\fR\*(R', i.e. `\f(CWmalloc\fR\*(R' becomes `\f(CWMM_malloc\fR\*(R', `\f(CWstrdup\fR\*(R' becomes `\f(CWMM_strdup\fR\*(R', etc. This \s-1API\s0 internally uses just a global `\f(CWMM *\fR\*(R' pool for -calling the corresponding functions (with prefix `\f(CWmm_\fR') of the \fIStandard -Malloc-Style \s-1API\s0\fR. +calling the corresponding functions (those with prefix `\f(CWmm_\fR') of the +\fIStandard Malloc-Style \s-1API\s0\fR. .Ip "\fBStandard Malloc-Style \s-1API\s0\fR" 4 This is the standard high-level memory allocation \s-1API\s0. Its interface is similar to the \fIGlobal Malloc-Replacement \s-1API\s0\fR but it uses an explicit `\f(CWMM *\fR\*(R' -pool to operate on. That's why every function of this \s-1API\s0 has an argument of -type `\f(CWMM *\fR\*(R' as the first argument. This \s-1API\s0 provides a comfortable way to +pool to operate on. That is why every function of this \s-1API\s0 has an argument of +type `\f(CWMM *\fR\*(R' as its first argument. This \s-1API\s0 provides a comfortable way to work with small dynamically allocated shared memory chunks inside large -statically allocated shared memory segments. It's internally based on the +statically allocated shared memory segments. It is internally based on the \fILow-Level Shared Memory \s-1API\s0\fR for creating the underlaying shared memory segment. .Ip "\fBLow-Level Shared Memory \s-1API\s0\fR" 4 This is the basis of the whole \fB\s-1MM\s0\fR library. It provides low-level functions -for creating shared memory segments with mutual exclusion (in short: \fImutex\fR) +for creating shared memory segments with mutual exclusion (in short \fImutex\fR) capabilities in a portable way. Internally the shared memory and mutex facility is implemented in various platform-dependent ways. A list of implementation variants follows under the next topic. .Sh "\s-1SHARED\s0 \s-1MEMORY\s0 \s-1IMPLEMENTATION\s0" Internally the shared memory facility is implemented in various -platform-dependent variants. Each has it's own advantages and disadvantages +platform-dependent ways. Each way has its own advantages and disadvantages (in addition to the fact that some variants aren't available at all on some -platforms). The \s-1MM\s0 libraries configuration procedure tried hard to make a good -decision. The implemented variants are now given for overview and background -reasons with their advantages and disadvantages and in an ascending order, -i.e. the \s-1MM\s0 configuration mechanism chooses the last available one in the list -as the preferred variant. +platforms). The \fB\s-1MM\s0\fR library's configuration procedure tries hard to make a +good decision. The implemented variants are now given for overview and +background reasons with their advantages and disadvantages and in an ascending +order, i.e. the \fB\s-1MM\s0\fR configuration mechanism chooses the last available one +in the list as the preferred variant. .Ip "Classical mmap(2) on temporary file (\s-1MMFILE\s0)" 4 \fIAdvantage:\fR maximum portable. -\fIDisadvantage:\fR needs a temporary file on the filesystem +\fIDisadvantage:\fR needs a temporary file on the filesystem. .Ip "mmap(2) via \s-1POSIX\s0.1 shm_open(3) on temporary file (\s-1MMPOSX\s0)" 4 \fIAdvantage:\fR standardized by \s-1POSIX\s0.1 and theoretically portable. \fIDisadvantage:\fR needs a temporary file on the filesystem and is is usually not available on existing Unix platform. .Ip "\s-1SVR4-\s0style mmap(2) on \f(CW/dev/zero\fR device (\s-1MMZERO\s0)" 4 -\fIAdvantage:\fR widely available on mostly portable on \s-1SVR4\s0 platforms. -\fIDisadvantage:\fR needs the \f(CW/dev/zero/\fR device and an \fImmap\fR\|(2) -which supports memory mapping through it. +\fIAdvantage:\fR widely available and mostly portable on \s-1SVR4\s0 platforms. +\fIDisadvantage:\fR needs the \f(CW/dev/zero/\fR device and a \fImmap\fR\|(2) +which supports memory mapping through this device. .Ip "4.4BSD\-style mmap(2) via \f(CWMAP_ANON\fR facility (\s-1MMANON\s0)" 4 -\fIAdvantage:\fR doesn't need a temporary file or external device +\fIAdvantage:\fR does not need a temporary file or external device. \fIDisadvantage:\fR usually only available on \s-1BSD\s0 platforms and derivatives. .Ip "SysV \s-1IPC\s0 shmget(2) (\s-1IPCSHM\s0)" 4 -\fIAdvantage:\fR doesn't need a temporary file or external device -\fIDisadvantage:\fR although available on mostly all modern Unix platforms it has -hard restrictions like the maximum size of a single shared memory segment (can +\fIAdvantage:\fR does not need a temporary file or external device. +\fIDisadvantage:\fR although available on mostly all modern Unix platforms, it has +strong restrictions like the maximum size of a single shared memory segment (can be as small as 100KB, but depends on the platform). .Sh "\s-1LOCKING\s0 \s-1IMPLEMENTATION\s0" As for the shared memory facility, internally the locking facility is -implemented in various platform-dependent variants. A short overview of +implemented in various platform-dependent ways. A short overview of implemented variants is given: .Ip "4.2BSD\-style flock(2) on temporary file (\s-1FLOCK\s0)" 4 \fIAdvantage:\fR exists on a lot of platforms, especially on older Unix derivates. \fIDisadvantage:\fR needs a temporary file on the filesystem and has -to reopen filedescriptors to it in \fIeach\fR\|(!) \fIfork\fR\|(2)ed child process. +to re-open file-descriptors to it in \fIeach\fR\|(!) \fIfork\fR\|(2)'ed child process. .Ip "SysV \s-1IPC\s0 semget(2) (\s-1IPCSEM\s0)" 4 -\fIAdvantage:\fR exists on a lot of platforms and doesn't need a temporary file. +\fIAdvantage:\fR exists on a lot of platforms and does not need a temporary file. \fIDisadvantage:\fR an unmeant termination of the application leads to a -semaphore leak because the facility doesn't allow an \*(L"remove in advance\*(R" trick -(as the \s-1IPC\s0 shared memory facility does!) for safe cleanups. +semaphore leak because the facility does not allow a ``remove in advance'\*(R' +trick (as the \s-1IPC\s0 shared memory facility does) for safe cleanups. .Ip "\s-1SVR4-\s0style fcntl(2) on temporary file (\s-1FCNTL\s0)" 4 \fIAdvantage:\fR exists on a lot of platforms and is also the most powerful -variant (although not always the fastest one). \fIDisadvantage:\fR needs a +variant (although not always the fastest one). \fIDisadvantage:\fR needs a temporary file. .Sh "\s-1MEMORY\s0 \s-1ALLOCATION\s0 \s-1STRATEGY\s0" The memory allocation strategy the \fIStandard Malloc-Style \s-1API\s0\fR functions use internally is the following: .Ip "\fBAllocation\fR" 4 -When a chunk of memory has to be allocated, the internal list of free chunks -is searched for a minimal-sized chunk which is larger or equal than the size -of the to be allocated chunk (some sort of a \fIbest fit algorithm\fR). +If a chunk of memory has to be allocated, the internal list of free chunks +is searched for a minimal-size chunk which is larger or equal than the size of +the to be allocated chunk (a \fIbest fit\fR strategy>). .Sp -When a chunk is found which matches this best-fit criteria, but is still a lot +If a chunk is found which matches this best-fit criteria, but is still a lot larger than the requested size, it is split into two chunks: One with exactly -the requested size (which is the resulting chunk) and one with the remaining -size (which is immediately re-inserted into the list of free chunks). +the requested size (which is the resulting chunk given back) and one with the +remaining size (which is immediately re-inserted into the list of free +chunks). .Sp -When no fitting chunk is found at all in the list of free chunks, a new one is +If no fitting chunk is found at all in the list of free chunks, a new one is created from the spare area of the shared memory segment until the segment is full (in which case an \fIout of memory\fR error occurs). .Ip "\fBDeallocation\fR" 4 -When a chunk of memory has to be deallocated, it is inserted in sorted manner -into the internal list of free chunks. The insertion operation automatically -merges the chunk with a previous and/or next free chunk when possible, i.e. -the free chunks stay physically seamless (one after another) in memory, to +If a chunk of memory has to be deallocated, it is inserted in sorted manner +into the internal list of free chunks. The insertion operation automatically +merges the chunk with a previous and/or a next free chunk if possible, i.e. +if the free chunks stay physically seamless (one after another) in memory, to automatically form larger free chunks out of smaller ones. .Sp This way the shared memory segment is automatically defragmented when memory @@ -375,22 +374,22 @@ This strategy reduces memory waste and fragmentation caused by small and frequent allocations and deallocations to a minimum. .PP The internal implementation of the list of free chunks is not specially -optimized (for instance by using binary search trees or even splay trees, -etc.), because it's assumed that the total amount of entries in the list of +optimized (for instance by using binary search trees or even \fIsplay\fR trees, +etc), because it is assumed that the total amount of entries in the list of free chunks is always small (caused both by the fact that shared memory segments are usually a lot smaller than heaps and the fact that we always -defragment by merging the free chunks when possible). +defragment by merging the free chunks if possible). .SH "API FUNCTIONS" In the following all API functions are described in detail. -The order directly follows the one in the SYNOPSIS. +The order directly follows the one in the \fBSYNOPSIS\fR. .Sh "Global Malloc-Replacement \s-1API\s0" .Ip "int \fBMM_create\fR(size_t \fIsize\fR, const char *\fIfile\fR);" 4 -This initialized the global shared memory pool with \fIsize\fR and \fIfile\fR and -has be called \fIbefore\fR any \fIfork\fR\|(2) operations are performed by the +This initializes the global shared memory pool with \fIsize\fR and \fIfile\fR and +has to be called \fIbefore\fR any \fIfork\fR\|(2) operations are performed by the application. .Ip "int \fBMM_permission\fR(mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" 4 This sets the filesystem \fImode\fR, \fIowner\fR and \fIgroup\fR for the global shared -memory pool (has effects only when the underlaying shared memory segment +memory pool (has effects only if the underlaying shared memory segment implementation is actually based on external auxiliary files). The arguments are directly passed through to \fIchmod\fR\|(2) and \fIchown\fR\|(2). .Ip "void \fBMM_destroy\fR(void);" 4 @@ -399,12 +398,11 @@ child processes were killed. .Ip "int \fBMM_lock\fR(mm_lock_mode \fImode\fR);" 4 This locks the global shared memory pool for the current process in order to perform either shared/read-only (\fImode\fR is \f(CWMM_LOCK_RD\fR) or -exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) operations inside the global -shared memory pool. +exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) critical operations inside the +global shared memory pool. .Ip "int \fBMM_unlock\fR(void);" 4 -This unlocks the global shared memory pool for the current process after -mutual exclusion operations were performed inside the global shared memory -pool. +This unlocks the global shared memory pool for the current process after the +critical operations were performed inside the global shared memory pool. .Ip "void *\fBMM_malloc\fR(size_t \fIsize\fR);" 4 Identical to the \s-1POSIX\s0.1 \fImalloc\fR\|(3) function but instead of allocating memory from the \fIheap\fR it allocates it from the global shared memory pool. @@ -424,7 +422,7 @@ string copy in the \fIheap\fR it creates it in the global shared memory pool. .Ip "size_t \fBMM_sizeof\fR(const void *\fIptr\fR);" 4 This function returns the size in bytes of the chunk starting at \fIptr\fR when \fIptr\fR was previously allocated with \fIMM_malloc\fR\|(3). The result is undefined -when \fIptr\fR was not previously allocated with \fIMM_malloc\fR\|(3). +if \fIptr\fR was not previously allocated with \fIMM_malloc\fR\|(3). .Ip "size_t \fBMM_maxsize\fR(void);" 4 This function returns the maximum size which is allowed as the first argument to the \fIMM_create\fR\|(3) function. @@ -439,10 +437,10 @@ This creates a shared memory pool which has space for approximately a total of \fIsize\fR bytes with the help of \fIfile\fR. Here \fIfile\fR is a filesystem path to a file which need not to exist (and perhaps is never created because this depends on the platform and chosen shared memory and mutex implementation). -The return value is a pointer to an \f(CWMM\fR structure which should be treated as +The return value is a pointer to a \f(CWMM\fR structure which should be treated as opaque by the application. It describes the internals of the created shared memory pool. In case of an error \f(CWNULL\fR is returned. A \fIsize\fR of 0 means to -allocate the maximum allowed size which is platform dependent and between a +allocate the maximum allowed size which is platform dependent and is between a few \s-1KB\s0 and the soft limit of 64MB. .Ip "int \fBmm_permission\fR(\s-1MM\s0 *\fImm\fR, mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" 4 This sets the filesystem \fImode\fR, \fIowner\fR and \fIgroup\fR for the shared memory @@ -456,11 +454,11 @@ filesystem corresponding the to shared memory pool are unlinked. .Ip "int \fBmm_lock\fR(\s-1MM\s0 *\fImm\fR, mm_lock_mode \fImode\fR);" 4 This locks the shared memory pool \fImm\fR for the current process in order to perform either shared/read-only (\fImode\fR is \f(CWMM_LOCK_RD\fR) or -exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) operations inside the global -shared memory pool. +exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) critical operations inside the +global shared memory pool. .Ip "int \fBmm_unlock\fR(\s-1MM\s0 *\fImm\fR);" 4 -This unlocks the shared memory pool \fImm\fR for the current process after mutual -exclusion operations were performed inside the global shared memory pool. +This unlocks the shared memory pool \fImm\fR for the current process after +critical operations were performed inside the global shared memory pool. .Ip "void *\fBmm_malloc\fR(\s-1MM\s0 *\fImm\fR, size_t \fIsize\fR);" 4 This function allocates \fIsize\fR bytes from the shared memory pool \fImm\fR and returns either a (virtual memory word aligned) pointer to it or \f(CWNULL\fR in @@ -528,7 +526,7 @@ at \fIcore\fR is no longer allowed and will usually lead to a segmentation fault .Ip "int \fBmm_core_lock\fR(const void *\fIcore\fR, mm_lock_mode \fImode\fR);" 4 This function acquires an advisory lock for the current process on the shared memory segment \fIcore\fR for either shared/read-only (\fImode\fR is \f(CWMM_LOCK_RD\fR) -or exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) operations between +or exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) critical operations between \fIfork\fR\|(2)'ed child processes. .Ip "int \fBmm_core_unlock\fR(const void *\fIcore\fR);" 4 This function releases a previously acquired advisory lock for the current @@ -546,15 +544,15 @@ limit of 64MB. This is just a utility function which can be used to align the number \fIsize\fR to the next virtual memory \fIpage\fR boundary used by the underlaying platform. The memory page boundary under Unix platforms is usually somewhere between -2048 and 16384 bytes. You don't have to align the \fIsize\fR arguments of other +2048 and 16384 bytes. You do not have to align the \fIsize\fR arguments of other \fB\s-1MM\s0\fR library functions yourself, because this is already done internally. This function is exported by the \fB\s-1MM\s0\fR library just for convenience reasons in -case an application wants to perform simular calculations for other purposes. +case an application wants to perform similar calculations for other purposes. .Ip "size_t \fBmm_core_align2word\fR(size_t \fIsize\fR);" 4 This is another utility function which can be used to align the number \fIsize\fR to the next virtual memory \fIword\fR boundary used by the underlaying platform. The memory word boundary under Unix platforms is usually somewhere between 4 -and 16 bytes. You don't have to align the \fIsize\fR arguments of other \fB\s-1MM\s0\fR +and 16 bytes. You do not have to align the \fIsize\fR arguments of other \fB\s-1MM\s0\fR library functions yourself, because this is already done internally. This function is exported by the \fB\s-1MM\s0\fR library just for convenience reasons in case an application wants to perform simular calculations for other purposes. @@ -564,24 +562,24 @@ This is a function which is used internally by the various \s-1MM\s0 function to an error string. It's usually not called directly from applications. .Ip "char *\fBmm_lib_error_get\fR(void);" 4 This is a function which is used internally by \fIMM_error\fR\|(3) and \fImm_error\fR\|(3) -functions to get the current error string. It's usually not called directly +functions to get the current error string. It is usually not called directly from applications. .Ip "int \fBmm_lib_version\fR(void);" 4 This function returns a hex-value ``0x\fIV\fR\fI\s-1RR\s0\fR\fIT\fR\fI\s-1LL\s0\fR'\*(R' which describes the -current \s-1MM\s0 library version. \fIV\fR is the version, \fI\s-1RR\s0\fR the revisions, \fI\s-1LL\s0\fR +current \fB\s-1MM\s0\fR library version. \fIV\fR is the version, \fI\s-1RR\s0\fR the revisions, \fI\s-1LL\s0\fR the level and \fIT\fR the type of the level (alphalevel=0, betalevel=1, -patchlevel=2, etc). For instance \s-1MM\s0 version 1.0.4 is encoded as 0x100204. The -reason for this unusual mapping is that this way the version number is +patchlevel=2, etc). For instance \fB\s-1MM\s0\fR version 1.0.4 is encoded as 0x100204. +The reason for this unusual mapping is that this way the version number is steadily \fIincreasing\fR. .SH "RESTRICTIONS" The maximum size of a continuous shared memory segment one can allocate depends on the underlaying platform. This cannot be changed, of course. But currently the high-level \fImalloc\fR\|(3)\-style API just uses a single shared memory segment as the underlaying data structure for an \f(CWMM\fR object which means that -the maximum amount of memory a \f(CWMM\fR object represents also depends on the +the maximum amount of memory an \f(CWMM\fR object represents also depends on the platform. .PP -This should be changed in later versions by allowing the high-level +This should be changed in later versions by allowing at least the high-level \fImalloc\fR\|(3)\-style API to internally use multiple shared memory segments to form the \f(CWMM\fR object. This way \f(CWMM\fR objects could have arbitrary sizes, although the maximum size of an allocatable chunk still is bounded by the maximum size @@ -595,10 +593,10 @@ mm-\fIconfig\fR\|(1). http://www.engelschall.com/sw/mm/ .SH "HISTORY" -This library was originally written in January 1999 by \fIRalf S. Engelschall\fR - for use in the \fBExtended API\fR (EAPI) of the \fBApache\fR -HTTP server project (see www.apache.org), which was originally invented for -\fBmod_ssl\fR (see http://www.modssl.org/). +This library was originally written in January 1999 by \fIRalf S. +Engelschall\fR for use in the \fBExtended API\fR (EAPI) +of the \fBApache\fR HTTP server project (see www.apache.org), which was +originally invented for \fBmod_ssl\fR (see http://www.modssl.org/). .PP Its base idea (a malloc-style API for handling shared memory) was originally derived from the non-publically available \fImm_malloc\fR library written in diff --git a/shmem/unix/mm/mm.h b/shmem/unix/mm/mm.h index 531dca1b40f..bc14b1ac8b3 100644 --- a/shmem/unix/mm/mm.h +++ b/shmem/unix/mm/mm.h @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 1999 Ralf S. Engelschall. All rights reserved. + * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -44,8 +44,8 @@ ** */ -#ifndef MM_H -#define MM_H 1 +#ifndef _MM_H_ +#define _MM_H_ #ifdef __cplusplus extern "C" { @@ -82,9 +82,8 @@ typedef enum { #include #ifdef MM_OS_SUNOS -#define KERNEL 1 #include -/* SunOS lacks prototypes */ +/* SunOS4 lacks prototypes */ extern int getpagesize(void); extern int munmap(caddr_t, int); extern int ftruncate(int, off_t); @@ -122,12 +121,12 @@ extern char *strerror(int); #define memcpy(to,from,len) bcopy(from,to,len) #else #define memcpy(to,from,len) \ - { int i; for (i = 0; i < (len); i++) *((char *)(to)+i) = *((char *)(from)+i); } + { int i; for (i = 0; i < (len); i++) *(((char *)(to))+i) = *(((char *)(from))+i); } #endif #endif #if !defined(HAVE_MEMSET) #define memset(to,ch,len) \ - { int i; for (i = 0; i < (len); i++) *((char *)(to)+i) = (ch); } + { int i; for (i = 0; i < (len); i++) *(((char *)(to))+i) = (ch); } #endif #define ERR(type,str) mm_lib_error_set(type,str) @@ -169,13 +168,29 @@ extern char *strerror(int); #endif #if defined(MM_SHMT_IPCSHM) +#ifdef MM_OS_SUNOS +#define KERNEL 1 +#endif +#ifdef MM_OS_BS2000 +#define _KMEMUSER +#endif #include +#ifdef MM_OS_SUNOS +#undef KERNEL +#endif +#ifdef MM_OS_BS2000 +#undef _KMEMUSER +#endif #if !defined(SHM_R) #define SHM_R 0400 #endif #if !defined(SHM_W) #define SHM_W 0200 -#endif +#endif +#endif + +#ifdef MM_SHMT_BEOS +#include #endif #if defined(MM_SEMT_IPCSEM) @@ -193,10 +208,6 @@ union semun { #include #endif -#ifdef MM_SHMT_BEOS -#include -#endif - #define MM_ALLOC_MINSIZE (1024*8) #define MM_CORE_FILEMODE (S_IRUSR|S_IWUSR) #define MM_CORE_DEFAULT_PAGESIZE (1024*8) @@ -276,10 +287,6 @@ struct mem_core { #if defined(MM_SHMT_BEOS) area_id mc_areaid; #endif -#if defined(MM_SEMT_BEOS) - sem_id mc_semid; - int32 mc_ben; -#endif #if !defined(MM_SEMT_FLOCK) int mc_fdsem; #endif @@ -293,6 +300,10 @@ struct mem_core { #endif #if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL) char mc_fnsem[MM_MAXPATH]; +#endif +#if defined(MM_SEMT_BEOS) + sem_id mc_semid; + int32 mc_ben; #endif mem_word mc_base; }; @@ -364,4 +375,5 @@ int mm_lib_version(void); } #endif -#endif /* MM_H */ +#endif /* _MM_H_ */ + diff --git a/shmem/unix/mm/mm.pod b/shmem/unix/mm/mm.pod index 7746612b5d6..e462dacaf35 100644 --- a/shmem/unix/mm/mm.pod +++ b/shmem/unix/mm/mm.pod @@ -1,5 +1,5 @@ ## ==================================================================== -## Copyright (c) 1999 Ralf S. Engelschall. All rights reserved. +## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions @@ -120,7 +120,7 @@ with data-structures inside those shared memory segments. The abbreviation B is historically and originally comes from the phrase ``I'' as used by the POSIX.1 mmap(2) function. Because this -facility is internally used by this library on most platforms to create the +facility is internally used by this library on most platforms to establish the shared memory segments. =head2 LIBRARY STRUCTURE @@ -139,24 +139,24 @@ based data structures without the need to change the code dramatically. All which is needed is to prefix the POSIX.1 memory allocation functions with `C', i.e. `C' becomes `C', `C' becomes `C', etc. This API internally uses just a global `C' pool for -calling the corresponding functions (with prefix `C') of the I. +calling the corresponding functions (those with prefix `C') of the +I. =item B This is the standard high-level memory allocation API. Its interface is similar to the I but it uses an explicit `C' -pool to operate on. That's why every function of this API has an argument of -type `C' as the first argument. This API provides a comfortable way to +pool to operate on. That is why every function of this API has an argument of +type `C' as its first argument. This API provides a comfortable way to work with small dynamically allocated shared memory chunks inside large -statically allocated shared memory segments. It's internally based on the +statically allocated shared memory segments. It is internally based on the I for creating the underlaying shared memory segment. =item B This is the basis of the whole B library. It provides low-level functions -for creating shared memory segments with mutual exclusion (in short: I) +for creating shared memory segments with mutual exclusion (in short I) capabilities in a portable way. Internally the shared memory and mutex facility is implemented in various platform-dependent ways. A list of implementation variants follows under the next topic. @@ -166,20 +166,20 @@ implementation variants follows under the next topic. =head2 SHARED MEMORY IMPLEMENTATION Internally the shared memory facility is implemented in various -platform-dependent variants. Each has it's own advantages and disadvantages +platform-dependent ways. Each way has its own advantages and disadvantages (in addition to the fact that some variants aren't available at all on some -platforms). The MM libraries configuration procedure tried hard to make a good -decision. The implemented variants are now given for overview and background -reasons with their advantages and disadvantages and in an ascending order, -i.e. the MM configuration mechanism chooses the last available one in the list -as the preferred variant. +platforms). The B library's configuration procedure tries hard to make a +good decision. The implemented variants are now given for overview and +background reasons with their advantages and disadvantages and in an ascending +order, i.e. the B configuration mechanism chooses the last available one +in the list as the preferred variant. =over 4 =item Classical mmap(2) on temporary file (MMFILE) I maximum portable. -I needs a temporary file on the filesystem +I needs a temporary file on the filesystem. =item mmap(2) via POSIX.1 shm_open(3) on temporary file (MMPOSX) @@ -189,20 +189,20 @@ is usually not available on existing Unix platform. =item SVR4-style mmap(2) on C device (MMZERO) -I widely available on mostly portable on SVR4 platforms. -I needs the C device and an mmap(2) -which supports memory mapping through it. +I widely available and mostly portable on SVR4 platforms. +I needs the C device and a mmap(2) +which supports memory mapping through this device. =item 4.4BSD-style mmap(2) via C facility (MMANON) -I doesn't need a temporary file or external device +I does not need a temporary file or external device. I usually only available on BSD platforms and derivatives. =item SysV IPC shmget(2) (IPCSHM) -I doesn't need a temporary file or external device -I although available on mostly all modern Unix platforms it has -hard restrictions like the maximum size of a single shared memory segment (can +I does not need a temporary file or external device. +I although available on mostly all modern Unix platforms, it has +strong restrictions like the maximum size of a single shared memory segment (can be as small as 100KB, but depends on the platform). =back @@ -210,7 +210,7 @@ be as small as 100KB, but depends on the platform). =head2 LOCKING IMPLEMENTATION As for the shared memory facility, internally the locking facility is -implemented in various platform-dependent variants. A short overview of +implemented in various platform-dependent ways. A short overview of implemented variants is given: =over 4 @@ -219,19 +219,19 @@ implemented variants is given: I exists on a lot of platforms, especially on older Unix derivates. I needs a temporary file on the filesystem and has -to reopen filedescriptors to it in each(!) fork(2)ed child process. +to re-open file-descriptors to it in each(!) fork(2)'ed child process. =item SysV IPC semget(2) (IPCSEM) -I exists on a lot of platforms and doesn't need a temporary file. +I exists on a lot of platforms and does not need a temporary file. I an unmeant termination of the application leads to a -semaphore leak because the facility doesn't allow an "remove in advance" trick -(as the IPC shared memory facility does!) for safe cleanups. +semaphore leak because the facility does not allow a ``remove in advance'' +trick (as the IPC shared memory facility does) for safe cleanups. =item SVR4-style fcntl(2) on temporary file (FCNTL) I exists on a lot of platforms and is also the most powerful -variant (although not always the fastest one). I needs a +variant (although not always the fastest one). I needs a temporary file. =back @@ -245,25 +245,26 @@ internally is the following: =item B -When a chunk of memory has to be allocated, the internal list of free chunks -is searched for a minimal-sized chunk which is larger or equal than the size -of the to be allocated chunk (some sort of a I). +If a chunk of memory has to be allocated, the internal list of free chunks +is searched for a minimal-size chunk which is larger or equal than the size of +the to be allocated chunk (a I strategy>). -When a chunk is found which matches this best-fit criteria, but is still a lot +If a chunk is found which matches this best-fit criteria, but is still a lot larger than the requested size, it is split into two chunks: One with exactly -the requested size (which is the resulting chunk) and one with the remaining -size (which is immediately re-inserted into the list of free chunks). +the requested size (which is the resulting chunk given back) and one with the +remaining size (which is immediately re-inserted into the list of free +chunks). -When no fitting chunk is found at all in the list of free chunks, a new one is +If no fitting chunk is found at all in the list of free chunks, a new one is created from the spare area of the shared memory segment until the segment is full (in which case an I error occurs). =item B -When a chunk of memory has to be deallocated, it is inserted in sorted manner -into the internal list of free chunks. The insertion operation automatically -merges the chunk with a previous and/or next free chunk when possible, i.e. -the free chunks stay physically seamless (one after another) in memory, to +If a chunk of memory has to be deallocated, it is inserted in sorted manner +into the internal list of free chunks. The insertion operation automatically +merges the chunk with a previous and/or a next free chunk if possible, i.e. +if the free chunks stay physically seamless (one after another) in memory, to automatically form larger free chunks out of smaller ones. This way the shared memory segment is automatically defragmented when memory @@ -275,16 +276,16 @@ This strategy reduces memory waste and fragmentation caused by small and frequent allocations and deallocations to a minimum. The internal implementation of the list of free chunks is not specially -optimized (for instance by using binary search trees or even splay trees, -etc.), because it's assumed that the total amount of entries in the list of +optimized (for instance by using binary search trees or even I trees, +etc), because it is assumed that the total amount of entries in the list of free chunks is always small (caused both by the fact that shared memory segments are usually a lot smaller than heaps and the fact that we always -defragment by merging the free chunks when possible). +defragment by merging the free chunks if possible). =head1 API FUNCTIONS In the following all API functions are described in detail. -The order directly follows the one in the SYNOPSIS. +The order directly follows the one in the B. =head2 Global Malloc-Replacement API @@ -292,14 +293,14 @@ The order directly follows the one in the SYNOPSIS. =item int B(size_t I, const char *I); -This initialized the global shared memory pool with I and I and -has be called I any fork(2) operations are performed by the +This initializes the global shared memory pool with I and I and +has to be called I any fork(2) operations are performed by the application. =item int B(mode_t I, uid_t I, gid_t I); This sets the filesystem I, I and I for the global shared -memory pool (has effects only when the underlaying shared memory segment +memory pool (has effects only if the underlaying shared memory segment implementation is actually based on external auxiliary files). The arguments are directly passed through to chmod(2) and chown(2). @@ -312,14 +313,13 @@ child processes were killed. This locks the global shared memory pool for the current process in order to perform either shared/read-only (I is C) or -exclusive/read-write (I is C) operations inside the global -shared memory pool. +exclusive/read-write (I is C) critical operations inside the +global shared memory pool. =item int B(void); -This unlocks the global shared memory pool for the current process after -mutual exclusion operations were performed inside the global shared memory -pool. +This unlocks the global shared memory pool for the current process after the +critical operations were performed inside the global shared memory pool. =item void *B(size_t I); @@ -351,7 +351,7 @@ string copy in the I it creates it in the global shared memory pool. This function returns the size in bytes of the chunk starting at I when I was previously allocated with MM_malloc(3). The result is undefined -when I was not previously allocated with MM_malloc(3). +if I was not previously allocated with MM_malloc(3). =item size_t B(void); @@ -379,10 +379,10 @@ This creates a shared memory pool which has space for approximately a total of I bytes with the help of I. Here I is a filesystem path to a file which need not to exist (and perhaps is never created because this depends on the platform and chosen shared memory and mutex implementation). -The return value is a pointer to an C structure which should be treated as +The return value is a pointer to a C structure which should be treated as opaque by the application. It describes the internals of the created shared memory pool. In case of an error C is returned. A I of 0 means to -allocate the maximum allowed size which is platform dependent and between a +allocate the maximum allowed size which is platform dependent and is between a few KB and the soft limit of 64MB. =item int B(MM *I, mode_t I, uid_t I, gid_t I); @@ -402,13 +402,13 @@ filesystem corresponding the to shared memory pool are unlinked. This locks the shared memory pool I for the current process in order to perform either shared/read-only (I is C) or -exclusive/read-write (I is C) operations inside the global -shared memory pool. +exclusive/read-write (I is C) critical operations inside the +global shared memory pool. =item int B(MM *I); -This unlocks the shared memory pool I for the current process after mutual -exclusion operations were performed inside the global shared memory pool. +This unlocks the shared memory pool I for the current process after +critical operations were performed inside the global shared memory pool. =item void *B(MM *I, size_t I); @@ -509,7 +509,7 @@ at I is no longer allowed and will usually lead to a segmentation fault. This function acquires an advisory lock for the current process on the shared memory segment I for either shared/read-only (I is C) -or exclusive/read-write (I is C) operations between +or exclusive/read-write (I is C) critical operations between fork(2)'ed child processes. =item int B(const void *I); @@ -535,17 +535,17 @@ limit of 64MB. This is just a utility function which can be used to align the number I to the next virtual memory I boundary used by the underlaying platform. The memory page boundary under Unix platforms is usually somewhere between -2048 and 16384 bytes. You don't have to align the I arguments of other +2048 and 16384 bytes. You do not have to align the I arguments of other B library functions yourself, because this is already done internally. This function is exported by the B library just for convenience reasons in -case an application wants to perform simular calculations for other purposes. +case an application wants to perform similar calculations for other purposes. =item size_t B(size_t I); This is another utility function which can be used to align the number I to the next virtual memory I boundary used by the underlaying platform. The memory word boundary under Unix platforms is usually somewhere between 4 -and 16 bytes. You don't have to align the I arguments of other B +and 16 bytes. You do not have to align the I arguments of other B library functions yourself, because this is already done internally. This function is exported by the B library just for convenience reasons in case an application wants to perform simular calculations for other purposes. @@ -564,16 +564,16 @@ an error string. It's usually not called directly from applications. =item char *B(void); This is a function which is used internally by MM_error(3) and mm_error(3) -functions to get the current error string. It's usually not called directly +functions to get the current error string. It is usually not called directly from applications. =item int B(void); This function returns a hex-value ``0xIIII'' which describes the -current MM library version. I is the version, I the revisions, I +current B library version. I is the version, I the revisions, I the level and I the type of the level (alphalevel=0, betalevel=1, -patchlevel=2, etc). For instance MM version 1.0.4 is encoded as 0x100204. The -reason for this unusual mapping is that this way the version number is +patchlevel=2, etc). For instance B version 1.0.4 is encoded as 0x100204. +The reason for this unusual mapping is that this way the version number is steadily I. =back @@ -584,10 +584,10 @@ The maximum size of a continuous shared memory segment one can allocate depends on the underlaying platform. This cannot be changed, of course. But currently the high-level malloc(3)-style API just uses a single shared memory segment as the underlaying data structure for an C object which means that -the maximum amount of memory a C object represents also depends on the +the maximum amount of memory an C object represents also depends on the platform. -This should be changed in later versions by allowing the high-level +This should be changed in later versions by allowing at least the high-level malloc(3)-style API to internally use multiple shared memory segments to form the C object. This way C objects could have arbitrary sizes, although the maximum size of an allocatable chunk still is bounded by the maximum size @@ -613,10 +613,10 @@ http://www.engelschall.com/sw/mm/ =head1 HISTORY -This library was originally written in January 1999 by I - for use in the B (EAPI) of the B -HTTP server project (see www.apache.org), which was originally invented for -B (see http://www.modssl.org/). +This library was originally written in January 1999 by I for use in the B (EAPI) +of the B HTTP server project (see www.apache.org), which was +originally invented for B (see http://www.modssl.org/). Its base idea (a malloc-style API for handling shared memory) was originally derived from the non-publically available I library written in diff --git a/shmem/unix/mm/mm_alloc.c b/shmem/unix/mm/mm_alloc.c index 049a4ab20f2..00d59d295a9 100644 --- a/shmem/unix/mm/mm_alloc.c +++ b/shmem/unix/mm/mm_alloc.c @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 1999 Ralf S. Engelschall. All rights reserved. + * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -59,10 +59,6 @@ MM *mm_create(size_t usize, const char *file) /* defaults */ maxsize = mm_maxsize(); - if (usize < 0) { - errno = EINVAL; - return NULL; - } if (usize == 0) usize = maxsize; if (usize > maxsize) diff --git a/shmem/unix/mm/mm_conf.h.in b/shmem/unix/mm/mm_conf.h.in index 5d6be09f06e..e9d81f1a3d9 100644 --- a/shmem/unix/mm/mm_conf.h.in +++ b/shmem/unix/mm/mm_conf.h.in @@ -1,9 +1,51 @@ +/* ==================================================================== + * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by + * Ralf S. Engelschall ." + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by + * Ralf S. Engelschall ." + * + * THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + */ + /* +** ** mm_conf.h +** */ -#ifndef MM_CONF_HH -#define MM_CONF_HH +#ifndef _MM_CONF_H_ +#define _MM_CONF_H_ /* VM Page Size Determination */ #undef MM_VMPS_GETPAGESIZE @@ -36,9 +78,11 @@ #undef HAVE_BCOPY #undef HAVE_MEMORY_H #undef MM_OS_SUNOS +#undef MM_OS_BS2000 #undef HAVE_PATH_MAX #undef HAVE__POSIX_PATH_MAX #undef HAVE_MAXPATHLEN #undef HAVE_UNION_SEMUN -#endif /* MM_CONF_HH */ +#endif /* _MM_CONF_H_ */ + diff --git a/shmem/unix/mm/mm_core.c b/shmem/unix/mm/mm_core.c index 37d938ea0b1..4b9a62bd90b 100644 --- a/shmem/unix/mm/mm_core.c +++ b/shmem/unix/mm/mm_core.c @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 1999 Ralf S. Engelschall. All rights reserved. + * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -242,10 +242,11 @@ void *mm_core_create(size_t usersize, const char *file) #endif /* MM_SHMT_MMANON */ #if defined(MM_SHMT_BEOS) - if ((temparea = create_area("mm",(void*)&area, B_ANY_ADDRESS, - size, B_LAZY_LOCK, B_READ_AREA | B_WRITE_AREA)) < 0) + if ((temparea = create_area("mm", (void*)&area, B_ANY_ADDRESS, + size, B_LAZY_LOCK, B_READ_AREA|B_WRITE_AREA)) < 0) FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to create the memory area"); #endif /* MM_SHMT_BEOS */ + #if defined(MM_SHMT_MMPOSX) shm_unlink(fnmem); /* Ok when it fails */ if ((fdmem = shm_open(fnmem, O_RDWR|O_CREAT, MM_CORE_FILEMODE)) == -1) @@ -343,18 +344,18 @@ void *mm_core_create(size_t usersize, const char *file) mc->mc_fdsem[1].pid = 0; mc->mc_fdsem[1].fd = -1; #else - mc->mc_fdsem = fdsem; + mc->mc_fdsem = fdsem; #endif #if defined(MM_SEMT_BEOS) mc->mc_semid = create_sem(0, "mm_semid"); - mc->mc_ben=0; + mc->mc_ben = 0; #endif #if defined(MM_SHMT_BEOS) mc->mc_areaid = temparea; #endif #if defined(MM_SEMT_IPCSEM) mc->mc_fdsem_rd = fdsem_rd; - mc->mc_readers = 0; + mc->mc_readers = 0; #endif #if defined(MM_SHMT_MMFILE) memcpy(mc->mc_fnmem, fnmem, MM_MAXPATH); @@ -384,17 +385,16 @@ void *mm_core_create(size_t usersize, const char *file) if (fdmem != -1) close(fdmem); #endif -#if defined(MM_SHMT_IPCSHM) - if (fdmem != -1) - shmctl(fdmem, IPC_RMID, NULL); +#if defined(MM_SEMT_BEOS) + delete_sem(mc->mc_semid); #endif #if defined(MM_SHMT_BEOS) delete_area(mc->mc_areaid); #endif -#if defined(MM_SEMT_BEOS) - delete_sem(mc->mc_semid); +#if defined(MM_SHMT_IPCSHM) + if (fdmem != -1) + shmctl(fdmem, IPC_RMID, NULL); #endif - #if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL) if (fdsem != -1) close(fdsem); @@ -554,16 +554,16 @@ int mm_core_lock(const void *core, mm_lock_mode mode) mc->mc_lockmode = mode; #endif #if defined(MM_SEMT_BEOS) - rc=0; - if (atomic_add (&mc->mc_ben, 1) > 0){ - /* someone already in lock..acquire sem and wait */ - if (acquire_sem(mc->mc_semid) != B_NO_ERROR){ - atomic_add(&mc->mc_ben,-1); - rc = -1; - } + rc = 0; + if (atomic_add(&mc->mc_ben, 1) > 0) { + /* someone already in lock... acquire sem and wait */ + if (acquire_sem(mc->mc_semid) != B_NO_ERROR) { + atomic_add(&mc->mc_ben, -1); + rc = -1; + } } #endif - + if (rc < 0) { ERR(MM_ERR_CORE|MM_ERR_SYSTEM, "Failed to lock"); rc = FALSE; @@ -608,10 +608,9 @@ int mm_core_unlock(const void *core) } #endif #if defined(MM_SEMT_BEOS) - rc=0; - if (atomic_add(&mc->mc_ben, -1) > 1){ - release_sem(mc->mc_semid); - } + rc = 0; + if (atomic_add(&mc->mc_ben, -1) > 1) + release_sem(mc->mc_semid); #endif if (rc < 0) { diff --git a/shmem/unix/mm/mm_global.c b/shmem/unix/mm/mm_global.c index 53efcca58c7..33b04646370 100644 --- a/shmem/unix/mm/mm_global.c +++ b/shmem/unix/mm/mm_global.c @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 1999 Ralf S. Engelschall. All rights reserved. + * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/shmem/unix/mm/mm_lib.c b/shmem/unix/mm/mm_lib.c index 0e7c34e86c9..967c336ff3a 100644 --- a/shmem/unix/mm/mm_lib.c +++ b/shmem/unix/mm/mm_lib.c @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 1999 Ralf S. Engelschall. All rights reserved. + * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/shmem/unix/mm/mm_test.c b/shmem/unix/mm/mm_test.c index 38e5570ec16..5c344d49a4e 100644 --- a/shmem/unix/mm/mm_test.c +++ b/shmem/unix/mm/mm_test.c @@ -1,5 +1,47 @@ +/* ==================================================================== + * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by + * Ralf S. Engelschall ." + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by + * Ralf S. Engelschall ." + * + * THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + */ + /* +** ** mm_test.c -- Test Suite for MM Library +** */ #include diff --git a/shmem/unix/mm/mm_vers.c b/shmem/unix/mm/mm_vers.c index ab61a88b199..706beb5478e 100644 --- a/shmem/unix/mm/mm_vers.c +++ b/shmem/unix/mm/mm_vers.c @@ -1,13 +1,13 @@ /* ** mm_vers.c -- Version Information -** [automatically generated and maintained by shtool] +** [automatically generated and maintained by GNU shtool] */ #ifdef _AS_HEADER #ifndef _MM_VERS_C #define _MM_VERS_C -#define MM_VERSION 0x100211 +#define MM_VERSION 0x101201 extern const int MM_Version; extern const char MM_VersionStr[]; extern const char MM_Hello[]; @@ -20,13 +20,13 @@ extern const char MM_PlainID[]; #else -const int MM_Version = 0x100211; -const char MM_VersionStr[] = "1.0.11 (06-Sep-1999)"; -const char MM_Hello[] = "This is MM, Version 1.0.11 (06-Sep-1999)"; -const char MM_GNUVersion[] = "MM Version 1.0.11"; -const char MM_WhatID[] = "@(#)MM Version 1.0.11 (06-Sep-1999)"; -const char MM_RCSIdentID[] = "$Id: mm_vers.c,v 1.2 1999/09/27 07:42:10 rse Exp $"; -const char MM_WebID[] = "MM/1.0.11"; -const char MM_PlainID[] = "1.0.11"; +const int MM_Version = 0x101201; +const char MM_VersionStr[] = "1.1.1 (30-Apr-2000)"; +const char MM_Hello[] = "This is MM, Version 1.1.1 (30-Apr-2000)"; +const char MM_GNUVersion[] = "MM Version 1.1.1"; +const char MM_WhatID[] = "@(#)MM Version 1.1.1 (30-Apr-2000)"; +const char MM_RCSIdentID[] = "$Id: mm_vers.c,v 1.3 2000/05/03 17:15:49 rbb Exp $"; +const char MM_WebID[] = "MM/1.1.1"; +const char MM_PlainID[] = "1.1.1"; #endif diff --git a/shmem/unix/mm/shtool b/shmem/unix/mm/shtool index cacca7eb67f..183a3185bf6 100755 --- a/shmem/unix/mm/shtool +++ b/shmem/unix/mm/shtool @@ -1,13 +1,13 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-1999 Ralf S. Engelschall +## Copyright (c) 1994-2000 Ralf S. Engelschall ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version 1.4.6 (05-Sep-1999) -## Ingredients: all available modules +## Version 1.4.9 (16-Apr-2000) +## Ingredients: 6/17 available modules ## ## @@ -39,21 +39,23 @@ ## ## Available commands: ## echo Print string with optional construct expansion -## mdate Pretty-print modification time of a file or dir -## table Pretty print a field-separated list as a table -## prop Display progress with a running propeller -## move Move files with simultan substitution ## install Install a program, script or datafile ## mkdir Make one or more directories -## mkln Make link with calculation of relative paths -## mkshadow Make a shadow tree ## fixperm Fix file permissions inside a source tree ## tarball Roll distribution tarballs -## guessos Simple OS/platform guesser +## version Generate and maintain a version information file +## +## Not available commands (because module was not built-in): +## mdate Pretty-print modification time of a file or dir +## table Pretty-print a field-separated list as a table +## prop Display progress with a running propeller +## move Move files with simultaneous substitution +## mkln Make link with calculation of relative paths +## mkshadow Make a shadow tree through symbolic links +## guessos Simple operating system guesser ## arx Extended archive command ## slo Separate linker options by library class ## scpp Sharing C Pre-Processor -## version Generate and maintain a version information file ## path Deal with program paths ## @@ -63,8 +65,8 @@ if [ $# -eq 0 ]; then exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.4.6 (05-Sep-1999)" - echo "Copyright (c) 1994-1999 Ralf S. Engelschall " + echo "This is GNU shtool, version 1.4.9 (16-Apr-2000)" + echo "Copyright (c) 1994-2000 Ralf S. Engelschall " echo "Report bugs to " echo '' echo "Usage: shtool [] [ [] []]" @@ -76,31 +78,33 @@ if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then echo '' echo 'Available [] []:' echo ' echo [-n] [-e] [ ...]' - echo ' mdate [-n] [-z] [-s] [-d] [-f] [-o] ' - echo ' table [-F] [-w] [-c] [-s] ...' - echo ' prop [-p]' - echo ' move [-v] [-t] [-e] [-p] ' echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' echo ' [-e] ' echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' - echo ' mkln [-t] [-f] [-s] [ ...] ' - echo ' mkshadow [-v] [-t] [-a] ' echo ' fixperm [-v] [-t] [ ...]' echo ' tarball [-t] [-v] [-o ] [-c ] [-d ] [-u' echo ' ] [-g ] [-e ] [ ...]' - echo ' guessos ' - echo ' arx [-t] [-C] [ ...]' - echo ' slo -- -L -l [ -L -l ... ]' - echo ' scpp [-v] [-p] [-o] [-t] [-M] [-D]' - echo ' [-C] [ ...]' echo ' version [-l] [-n] [-p] [-s] [-i]' echo ' [-d] ' + echo '' + echo 'Not available (because module was not built-in):' + echo ' mdate [-n] [-z] [-s] [-d] [-f] [-o] ' + echo ' table [-F] [-w] [-c] [-s] ...' + echo ' prop [-p]' + echo ' move [-v] [-t] [-e] [-p] ' + echo ' mkln [-t] [-f] [-s] [ ...] ' + echo ' mkshadow [-v] [-t] [-a] ' + echo ' guessos ' + echo ' arx [-t] [-C] [ ...]' + echo ' slo [-p] -- -L -l [-L -l ...]' + echo ' scpp [-v] [-p] [-f] [-o] [-t] [-M]' + echo ' [-D] [-C] [ ...]' echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' echo '' exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.4.6 (05-Sep-1999)" + echo "GNU shtool 1.4.9 (16-Apr-2000)" exit 0 fi if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then @@ -109,7 +113,7 @@ if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then fi name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'` case "$name" in - echo|mdate|table|prop|move|install|mkdir|mkln|mkshadow|fixperm|tarball|guessos|arx|slo|scpp|version|path ) + echo|install|mkdir|fixperm|tarball|version ) # implicit tool command selection tool="$name" ;; @@ -132,113 +136,63 @@ case $tool in str_tool="echo" str_usage="[-n] [-e] [ ...]" arg_spec="0+" - opt_spec="ne" - ;; - mdate ) - str_tool="mdate" - str_usage="[-n] [-z] [-s] [-d] [-f] [-o] " - arg_spec="1" - opt_spec="nzsdf:!o:!" - opt_f=" " - opt_o="dmy" - ;; - table ) - str_tool="table" - str_usage="[-F] [-w] [-c] [-s] ..." - arg_spec="1+" - opt_spec="F:!w:!c:!s:!" - opt_F=":" - opt_w=15 - opt_c=3 - opt_s=79 - ;; - prop ) - str_tool="prop" - str_usage="[-p]" - arg_spec="0" - opt_spec="p:" - ;; - move ) - str_tool="move" - str_usage="[-v] [-t] [-e] [-p] " - arg_spec="2" - opt_spec="vtep" + opt_spec="n.e." + opt_n=no + opt_e=no ;; install ) str_tool="install" str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] " - arg_spec="2" - opt_spec="vtcCsm:o:g:e:" + arg_spec="2=" + opt_spec="v.t.c.C.s.m:o:g:e:" + opt_v=no + opt_t=no + opt_c=no + opt_C=no + opt_s=no + opt_m="" + opt_o="" + opt_g="" + opt_e="" ;; mkdir ) str_tool="mkdir" str_usage="[-t] [-f] [-p] [-m] [ ...]" arg_spec="1+" - opt_spec="tfpm:" - ;; - mkln ) - str_tool="mkln" - str_usage="[-t] [-f] [-s] [ ...] " - arg_spec="2+" - opt_spec="tfs" - ;; - mkshadow ) - str_tool="mkshadow" - str_usage="[-v] [-t] [-a] " - arg_spec="2" - opt_spec="vta" + opt_spec="t.f.p.m:" + opt_t=no + opt_f=no + opt_p=no + opt_m="" ;; fixperm ) str_tool="fixperm" str_usage="[-v] [-t] [ ...]" - gen_tmpfile=yes arg_spec="1+" - opt_spec="vt" + opt_spec="v.t." + opt_v=no + opt_t=no ;; tarball ) str_tool="tarball" str_usage="[-t] [-v] [-o ] [-c ] [-d ] [-u ] [-g ] [-e ] [ ...]" gen_tmpfile=yes arg_spec="1+" - opt_spec="tvo:c:d:u:g:e:!" + opt_spec="t.v.o:c:d:u:g:e:" + opt_t=no + opt_v=no + opt_o="" + opt_c="" + opt_d="" + opt_u="" + opt_g="" opt_e="CVS,\\.cvsignore,\\.[oa]\$" ;; - guessos ) - str_tool="guessos" - str_usage="" - arg_spec="0" - opt_spec="" - ;; - arx ) - str_tool="arx" - str_usage="[-t] [-C] [ ...]" - arg_spec="2+" - opt_spec="tC:!" - opt_C="ar" - ;; - slo ) - str_tool="slo" - str_usage="-- -L -l [ -L -l ... ]" - arg_spec="1+" - opt_spec="" - ;; - scpp ) - str_tool="scpp" - str_usage="[-v] [-p] [-o] [-t] [-M] [-D] [-C] [ ...]" - gen_tmpfile=yes - arg_spec="1+" - opt_spec="vpo:!t:!M:!D:!C:!" - opt_o="lib.h" - opt_t="lib.h.in" - opt_M="%%MARK%%" - opt_D="cpp" - opt_C="intern" - ;; version ) str_tool="version" str_usage="[-l] [-n] [-p] [-s] [-i] [-d] " arg_spec="1+" - opt_spec="l:!n:!p:!s:!i:!d:!" + opt_spec="l:n:p:s:i:d:" opt_l="txt" opt_n="unknown" opt_p="unknown" @@ -247,13 +201,10 @@ case $tool in opt_d="NO" gen_tmpfile=yes ;; - path ) - str_tool="path" - str_usage="[-s] [-r] [-d] [-b] [-m] [-p] [ ...]" - gen_tmpfile=yes - arg_spec="1+" - opt_spec="srdbmp:!" - opt_p="$PATH" + -* ) + echo "$0:Error: unknown option \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 + exit 1 ;; * ) echo "$0:Error: unknown command \`$tool'" 2>&1 @@ -268,36 +219,24 @@ esac # determine name of tool if [ ".$tool" != . ]; then - # inside shtool + # used inside shtool script toolcmd="$0 $tool" toolcmdhelp="shtool $tool" msgprefix="shtool:$tool" else - # standalone + # used as standalone script toolcmd="$0" - toolcmdhelp="sh.$tool" + toolcmdhelp="sh $0" msgprefix="$str_tool" fi # parse argument specification string -eval `echo $arg_spec | sed -e 's/^\([0-9]*\)\(.*\)/arg_NUMS="\1"; arg_MODE="\2"/'` -test ".$arg_MODE" = . && arg_MODE="=" +eval `echo $arg_spec |\ + sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'` # parse option specification string -for opt in `echo "h$opt_spec" | sed -e 's/\([a-zA-Z0-9][!:+]*\)/\1 /g'`; do - opt_MODE="."; opt_INIT="." - eval `echo $opt |\ - sed -e 's/^\([a-zA-Z0-9]\)/opt_THIS="\1";/' \ - -e 's/";\([:+]\)/"; opt_MODE="\1";/' \ - -e 's/";\(!\)/"; opt_INIT="\1"/'` - eval "opt_MODE_${opt_THIS}=${opt_MODE}" - if [ ".$opt_INIT" != ".!" ]; then - case "$opt_MODE" in - "." ) eval "opt_${opt_THIS}=no" ;; - ":"|"+" ) eval "opt_${opt_THIS}=\"\"" ;; - esac - fi -done +eval `echo h.$opt_spec |\ + sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'` # interate over argument line opt_PREV='' @@ -315,7 +254,7 @@ while [ $# -gt 0 ]; do opt_OPT="$opt_PREV" opt_ARG="$1" opt_ARG_OK=yes - opt_PREV="" + opt_PREV='' else # split argument into option and argument case "$1" in @@ -325,8 +264,7 @@ while [ $# -gt 0 ]; do -e 's/";\(.*\)$/"; opt_ARG="\1"/'` ;; -[a-zA-Z0-9]) - opt_OPT=`awk 'BEGIN { printf("%s", substr(OPT, 2)); }' \ - "OPT=$1" &2 echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 exit 1 fi ;; - "+" ) + '+' ) if [ $# -lt $arg_NUMS ]; then echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 @@ -400,13 +338,12 @@ esac # establish a temporary file on request if [ ".$gen_tmpfile" = .yes ]; then - tmpdir="/tmp" if [ ".$TMPDIR" != . ]; then tmpdir="$TMPDIR" + elif [ ".$TEMPDIR" != . ]; then + tmpdir="$TEMPDIR" else - if [ ".$TEMPDIR" != . ]; then - tmpdir="$TEMPDIR" - fi + tmpdir="/tmp" fi tmpfile="$tmpdir/.shtool.$$" rm -f $tmpfile >/dev/null 2>&1 @@ -422,7 +359,7 @@ case $tool in echo ) ## ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-1999 Ralf S. Engelschall + ## Copyright (c) 1998-2000 Ralf S. Engelschall ## Originally written for WML as buildinfo ## @@ -449,8 +386,8 @@ echo ) term_bold='' term_norm='' if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then - # the most important terminals we directly know case $TERM in + # for the most important terminal types we directly know the sequences xterm|xterm*|vt220|vt220*) term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' /dev/null` term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' /dev/null` @@ -459,35 +396,37 @@ echo ) term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' /dev/null` term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' /dev/null` ;; - esac - # then try a possibly existing "tput" or "tcout" utility - paths=`echo $PATH | sed -e 's/:/ /g'` - for tool in tput tcout; do - for dir in $paths; do - if [ -r "$dir/$tool" ]; then - for seq in bold md smso; do # smso is last - bold="`$dir/$tool $seq 2>/dev/null`" - if [ ".$bold" != . ]; then - term_bold="$bold" + # for all others, we try to use a possibly existing `tput' or `tcout' utility + * ) + paths=`echo $PATH | sed -e 's/:/ /g'` + for tool in tput tcout; do + for dir in $paths; do + if [ -r "$dir/$tool" ]; then + for seq in bold md smso; do # 'smso' is last + bold="`$dir/$tool $seq 2>/dev/null`" + if [ ".$bold" != . ]; then + term_bold="$bold" + break + fi + done + if [ ".$term_bold" != . ]; then + for seq in sgr0 me rmso reset; do # 'reset' is last + norm="`$dir/$tool $seq 2>/dev/null`" + if [ ".$norm" != . ]; then + term_norm="$norm" + break + fi + done + fi break fi done - if [ ".$term_bold" != . ]; then - for seq in sgr0 me rmso reset; do # 'reset' is last - norm="`$dir/$tool $seq 2>/dev/null`" - if [ ".$norm" != . ]; then - term_norm="$norm" - break - fi - done + if [ ".$term_bold" != . -a ".$term_norm" != . ]; then + break; fi - break - fi - done - if [ ".$term_bold" != . -a ".$term_norm" != . ]; then - break; - fi - done + done + ;; + esac if [ ".$term_bold" = . -o ".$term_norm" = . ]; then echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2 fi @@ -628,348 +567,22 @@ echo ) # create output if [ .$opt_n = .no ]; then - echo $seo $text + echo $seo "$text" else # the harder part: echo -n is best, because - # awk complains about some \xx sequences. + # awk may complain about some \xx sequences. if [ ".$minusn" != . ]; then - echo $seo $minusn $text + echo $seo $minusn "$text" else echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text" fi fi ;; -mdate ) - ## - ## mdate -- Pretty-print modification time of a file or dir - ## Copyright (c) 1995-1997 Free Software Foundation, Inc. - ## Originally idea and basis code by Ulrich Drepper - ## Enhanced by Ralf S. Engelschall for shtool - ## - - fod="$1" - case "$opt_o" in - [dmy][dmy][dmy] ) - ;; - * ) echo "$msgprefix:Error: invalid argument to option \`-o': $opt_o" 1>&2 - exit 1 - ;; - esac - if [ ! -r "$fod" ]; then - echo "$msgprefix:Error: file or directory not found: $fod" 1>&2 - exit 1 - fi - - # prevent "date" giving response in another language - LANG=C; export LANG - LC_ALL=C; export LC_ALL - LC_TIME=C; export LC_TIME - - # get the extended ls output of the file or directory. - if ls -L /dev/null >/dev/null 2>&1; then - set - x`ls -L -l -d $fod` - else - set - x`ls -l -d $fod` - fi - - # The month is at least the fourth argument - # (3 shifts here, the next inside the loop). - shift; shift; shift - - # Find the month. Next argument is day, followed by the year or time. - month="" - while [ ".$month" = . ]; do - shift - case $1 in - Jan) month=January; nummonth=1 ;; - Feb) month=February; nummonth=2 ;; - Mar) month=March; nummonth=3 ;; - Apr) month=April; nummonth=4 ;; - May) month=May; nummonth=5 ;; - Jun) month=June; nummonth=6 ;; - Jul) month=July; nummonth=7 ;; - Aug) month=August; nummonth=8 ;; - Sep) month=September; nummonth=9 ;; - Oct) month=October; nummonth=10 ;; - Nov) month=November; nummonth=11 ;; - Dec) month=December; nummonth=12 ;; - esac - done - day="$2" - year="$3" - - # We finally have to deal with the problem that the "ls" output - # gives either the time of the day or the year. - case $year in - *:*) - this_year=`date '+%Y' 2>/dev/null` - if [ ".$this_year" = . ]; then - this_year=`date '+%y'` - case $this_year in - [5-9][0-9]) this_year="19$this_year" ;; - [0-4][0-9]) this_year="20$this_year" ;; - esac - fi - # for the following months of the last year the time notation - # is usually also used for files modified in the last year. - this_month=`date '+%m'` - if (expr $nummonth \> $this_month) >/dev/null; then - this_year=`expr $this_year - 1` - fi - year="$this_year" - ;; - esac - - # Optionally fill day and month with leeding zeros - if [ ".$opt_z" = .yes ]; then - case $day in - [0-9][0-9] ) ;; - [0-9] ) day="0$day" ;; - esac - case $nummonth in - [0-9][0-9] ) ;; - [0-9] ) nummonth="0$nummonth" ;; - esac - fi - - # Optionally use digits for month - if [ ".$opt_d" = .yes ]; then - month="$nummonth" - fi - - # Optionally shorten the month name to three characters - if [ ".$opt_s" = .yes ]; then - month=`echo $month | cut -c1-3` - fi - - # Output the resulting date string - echo dummy | awk '{ - for (i = 0; i < 3; i++) { - now = substr(order, 1, 1); - order = substr(order, 2); - if (now == "d") - out = day; - else if (now == "m") - out = month; - else if (now == "y") - out = year; - if (i < 2) - printf("%s%s", out, field); - else - printf("%s", out); - } - if (newline != "yes") - printf("\n"); - }' "day=$day" "month=$month" "year=$year" \ - "field=$opt_f" "order=$opt_o" "newline=$opt_n" - ;; - -table ) - ## - ## table -- Pretty print a field-separated list as a table - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - if [ $opt_c -gt 4 ]; then - echo "$msgprefix:Error: Invalid number of colums (1..4 allowed only)" 1>&2 - exit 1 - fi - case "x$opt_F" in - x? ) ;; - * ) echo "$msgprefix:Error: Invalid separator (one char allowed only)" 1>&2; exit 1 ;; - esac - - # split the list into a table - list=` - IFS="$opt_F" - for entry in $*; do - if [ ".$entry" != . ]; then - echo "$entry" - fi - done |\ - awk " - BEGIN { list = \"\"; n = 0; } - { - list = list \\$1; - n = n + 1; - if (n < $opt_c) { - list = list \":\"; - } - if (n == $opt_c) { - list = list \"\\n\"; - n = 0; - } - } - END { print list; } - " - ` - - # format table cells and make sure table - # doesn't exceed maximum width - OIFS="$IFS" - IFS=' -' - for entry in $list; do - case $opt_c in - 1 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s\\n\", \$1); }'" ;; - 2 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s\\n\", \$1, \$2); }'" ;; - 3 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3); }'" ;; - 4 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3, \$4); }'" ;; - esac - done |\ - awk "{ - if (length(\$0) > $opt_s) { - printf(\"%s\\n\", substr(\$0, 0, $opt_s-1)); - } else { - print \$0; - } - }" - IFS="$OIFS" - ;; - -prop ) - ## - ## prop -- Display progress with a running propeller - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for mod_ssl - ## - - perl='' - for dir in `echo $PATH | sed -e 's/:/ /g'` .; do - if [ -f "$dir/perl" ]; then - perl="$dir/perl" - break - fi - done - if [ ".$perl" != . ]; then - # Perl is preferred because writing to STDERR in - # Perl really writes immediately as one would expect - $perl -e ' - @p = ("|","/","-","\\"); - $i = 0; - while () { - printf(STDERR "\r%s...%s\b", $ARGV[0], $p[$i++]); - $i = 0 if ($i > 3); - } - printf(STDERR "\r%s \n", $ARGV[0]); - ' "$opt_p" - else - # But when Perl doesn't exists we use Awk even - # some Awk's buffer even the /dev/stderr writing :-( - awk ' - BEGIN { - split("|#/#-#\\", p, "#"); - i = 1; - } - { - printf("\r%s%c\b", prefix, p[i++]) > "/dev/stderr"; - if (i > 4) { i = 1; } - } - END { - printf("\r%s \n", prefix) > "/dev/stderr"; - } - ' "prefix=$opt_p" - fi - ;; - -move ) - ## - ## move -- Move files with simultan substitution - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - src="$1" - dst="$2" - - # consistency checks - if [ ".$src" = . -o ".$dst" = . ]; then - echo "$msgprefix:Error: Invalid arguments" 1>&2 - exit 1 - fi - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: Source and destination files are the same" 1>&2 - exit 1 - fi - expsrc="$src" - if [ ".$opt_e" = .yes ]; then - expsrc="`echo $expsrc`" - fi - if [ ".$opt_e" = .yes ]; then - if [ ".`echo "$src" | sed -e 's;^.*\\*.*$;;'`" = ".$src" ]; then - echo "$msgprefix:Error: Source doesn't contain wildcard ('*'): $dst" 1>&2 - exit 1 - fi - if [ ".`echo "$dst" | sed -e 's;^.*%[1-9].*$;;'`" = ".$dst" ]; then - echo "$msgprefix:Error: Destination doesn't contain substitution ('%N'): $dst" 1>&2 - exit 1 - fi - if [ ".$expsrc" = ".$src" ]; then - echo "$msgprefix:Error: Sources not found or no asterisk : $src" 1>&2 - exit 1 - fi - else - if [ ! -r "$src" ]; then - echo "$msgprefix:Error: Source not found: $src" 1>&2 - exit 1 - fi - fi - - # determine substitution patterns - if [ ".$opt_e" = .yes ]; then - srcpat=`echo "$src" | sed -e 's/\\./\\\\./g' -e 's/;/\\;/g' -e 's;\\*;\\\\(.*\\\\);g'` - dstpat=`echo "$dst" | sed -e 's;%\([1-9]\);\\\\\1;g'` - fi - - # iterate over source(s) - for onesrc in $expsrc; do - if [ .$opt_e = .yes ]; then - onedst=`echo $onesrc | sed -e "s;$srcpat;$dstpat;"` - else - onedst="$dst" - fi - errorstatus=0 - if [ ".$opt_v" = .yes ]; then - echo "$onesrc -> $onedst" - fi - if [ ".$opt_p" = .yes ]; then - if [ -r $onedst ]; then - if cmp -s $onesrc $onedst; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $onesrc" 1>&2 - fi - rm -f $onesrc || errorstatus=$? - else - if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 - fi - mv -f $onesrc $onedst || errorstatus=$? - fi - else - if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 - fi - mv -f $onesrc $onedst || errorstatus=$? - fi - else - if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 - fi - mv -f $onesrc $onedst || errorstatus=$? - fi - if [ $errorstatus -ne 0 ]; then - break; - fi - done - exit $errorstatus - ;; - install ) ## ## install -- Install a program, script or datafile - ## Copyright (c) 1997-1999 Ralf S. Engelschall + ## Copyright (c) 1997-2000 Ralf S. Engelschall ## Originally written for shtool ## @@ -1076,24 +689,24 @@ install ) mkdir ) ## ## mkdir -- Make one or more directories - ## Copyright (c) 1996-1999 Ralf S. Engelschall + ## Copyright (c) 1996-2000 Ralf S. Engelschall ## Originally written for public domain by Noah Friedman ## Cleaned up and enhanced for shtool ## errstatus=0 for p in ${1+"$@"}; do - # when the directory already exists... + # if the directory already exists... if [ -d "$p" ]; then if [ ".$opt_f" = .no ]; then - echo "$msgprefix:Error: file exists: $p" 1>&2 + echo "$msgprefix:Error: directory already exists: $p" 1>&2 errstatus=1 break else continue fi fi - # when the directory has to be created + # if the directory has to be created... if [ ".$opt_p" = .no ]; then if [ ".$opt_t" = .yes ]; then echo "mkdir $p" 1>&2 @@ -1107,7 +720,7 @@ mkdir ) -e 's/\// /g' \ -e 's/^%/\//'` shift - pathcomp= + pathcomp='' for d in ${1+"$@"}; do pathcomp="$pathcomp$d" case "$pathcomp" in @@ -1132,273 +745,21 @@ mkdir ) exit $errstatus ;; -mkln ) - ## - ## mkln -- Make link with calculation of relative paths - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - args=$? - srcs="" - while [ $# -gt 1 ]; do - srcs="$srcs $1" - shift - done - dst="$1" - if [ ! -d $dst ]; then - if [ $args -gt 2 ]; then - echo "$msgprefix:Error: multiple sources not allowed when target isn't a directory" 1>&2 - exit 1 - fi - fi - - # determine link options - lnopt="" - if [ ".$opt_f" = .yes ]; then - lnopt="$lnopt -f" - fi - if [ ".$opt_s" = .yes ]; then - lnopt="$lnopt -s" - fi - - # iterate over sources - for src in $srcs; do - # determine if one of the paths is an absolute path, - # because then we _have_ to use an absolute symlink - oneisabs=0 - srcisabs=0 - dstisabs=0 - case $src in - /* ) oneisabs=1; srcisabs=1 ;; - esac - case $dst in - /* ) oneisabs=1; dstisabs=1 ;; - esac - - # split source and destination into dir and base name - if [ -d $src ]; then - srcdir=`echo $src | sed -e 's;/*$;;'` - srcbase="" - else - srcdir=`echo $src | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'` - srcbase=`echo $src | sed -e 's;.*/\([^/]*\)$;\1;'` - fi - if [ -d $dst ]; then - dstdir=`echo $dst | sed -e 's;/*$;;'` - dstbase="" - else - dstdir=`echo $dst | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'` - dstbase=`echo $dst | sed -e 's;.*/\([^/]*\)$;\1;'` - fi - - # consistency check - if [ ".$dstdir" != . ]; then - if [ ! -d $dstdir ]; then - echo "$msgprefix:Error: destination directory not found: $dstdir" 1>&2 - exit 1 - fi - fi - - # make sure the source is reachable from the destination - if [ $dstisabs = 1 ]; then - if [ $srcisabs = 0 ]; then - if [ -d $srcdir ]; then - srcdir="`cd $srcdir; pwd | sed -e 's;/*$;;'`" - srcisabs=1 - oneisabs=1 - fi - fi - fi - - # split away a common prefix - prefix="" - if [ ".$srcdir" = ".$dstdir" ] && [ ".$srcdir" != . ]; then - prefix="$srcdir/" - srcdir="" - dstdir="" - else - while [ ".$srcdir" != . ] && [ ".$dstdir" != . ]; do - presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'` - predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'` - if [ ".$presrc" != ".$predst" ]; then - break - fi - prefix="$prefix$presrc/" - srcdir=`echo $srcdir | sed -e 's;^[^/]*/*;;'` - dstdir=`echo $dstdir | sed -e 's;^[^/]*/*;;'` - done - fi - - # destination prefix is just the common prefix - dstpre="$prefix" - - # determine source prefix which is the reverse directory - # step-up corresponding to the destination directory - srcpre="" - if [ $oneisabs = 0 ] || [ ".$prefix" != . -a ".$prefix" != ./ ]; then - pl="$dstdir/" - OIFS="$IFS"; IFS='/' - for pe in $pl; do - [ ".$pe" = . ] && continue - srcpre="../$srcpre" - done - IFS="$OIFS" - else - if [ $srcisabs = 1 ]; then - srcpre="$prefix" - fi - fi - - # determine destination symlink name - if [ ".$dstbase" = . ]; then - if [ ".$srcbase" != . ]; then - dstbase="$srcbase" - else - dstbase=`echo "$prefix$srcdir" | sed -e 's;/*$;;' -e 's;.*/\([^/]*\)$;\1;'` - fi - fi - - # now finalize source and destination directory paths - srcdir=`echo $srcdir | sed -e 's;\([^/]\)$;\1/;'` - dstdir=`echo $dstdir | sed -e 's;\([^/]\)$;\1/;'` - - # run the final link command - if [ ".$opt_t" = .yes ]; then - echo "ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase" - fi - eval ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase - done - ;; - -mkshadow ) - ## - ## mkshadow -- Make a shadow tree - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - # source and destination directory - src=`echo "$1" | sed -e 's:/$::'` - dst=`echo "$2" | sed -e 's:/$::'` - - # check whether source exists - if [ ! -d $src ]; then - echo "$msgprefix:Error: source directory not found: \`$src'" 1>&2 - exit 1 - fi - - # determine if one of the paths is an absolute path, - # because then we have to use an absolute symlink - oneisabs=0 - case $src in - /* ) oneisabs=1 ;; - esac - case $dst in - /* ) oneisabs=1 ;; - esac - - # determine reverse directory for destination directory - dstrevdir='' - if [ $oneisabs = 0 ]; then - # (inlined fp2rp) - OIFS="$IFS"; IFS='/' - for pe in $dst; do - dstrevdir="../$dstrevdir" - done - IFS="$OIFS" - else - src="`cd $src; pwd`"; - fi - - # create directory tree at destination - if [ ! -d $dst ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $dst" 1>&2 - fi - mkdir $dst - fi - if [ ".$opt_a" = .yes ]; then - DIRS=`cd $src; find . -type d -print |\ - sed -e '/^\.$/d' -e 's:^\./::'` - else - DIRS=`cd $src; find . -type d -print |\ - sed -e '/\/CVS/d' -e '/^\.$/d' -e 's:^\./::'` - fi - for dir in $DIRS; do - if [ ".$opt_t" = .yes ]; then - echo "mkdir $dst/$dir" 1>&2 - fi - mkdir $dst/$dir - done - - # fill directory tree with symlinks to files - if [ ".$opt_a" = .yes ]; then - FILES="`cd $src; find . -depth -print |\ - sed -e 's/^\.\///'`" - else - FILES="`cd $src; find . -depth -print |\ - sed -e '/\.o$/d' -e '/\.a$/d' -e '/\.so$/d' \ - -e '/\.cvsignore$/d' -e '/\/CVS/d' \ - -e '/\/\.#/d' -e '/\.orig$/d' \ - -e 's/^\.\///'`" - fi - for file in $FILES; do - # don't use `-type f' above for find because of symlinks - if [ -d "$src/$file" ]; then - continue - fi - basename=`echo $file | sed -e 's:^.*/::'` - dir=`echo $file | sed -e 's:[^/]*$::' -e 's:/$::' -e 's:$:/:' -e 's:^/$::'` - from=`echo "$src/$file" | sed -e 's/^\.\///'` - to="$dst/$dir$basename" - if [ $oneisabs = 0 ]; then - if [ ".$dir" != . ]; then - subdir=`echo $dir | sed -e 's:/$::'` - # (inlined fp2rp) - revdir='' - OIFS="$IFS"; IFS='/' - for pe in $subdir; do - revdir="../$revdir" - done - IFS="$OIFS" - # finalize from - from="$revdir$from" - fi - from="$dstrevdir$from" - fi - if [ ".$opt_v" = .yes ]; then - echo " $to" 1>&2 - fi - if [ ".$opt_t" = .yes ]; then - echo "ln -s $from $to" 1>&2 - fi - ln -s $from $to - done - ;; - fixperm ) ## ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-1999 Ralf S. Engelschall + ## Copyright (c) 1996-2000 Ralf S. Engelschall ## Originally written for ePerl ## paths="$*" # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then + if [ -x /bin/sh ] 2>/dev/null; then minusx="-x" else minusx="-r" fi - rm -f $tmpfile # iterate over paths for p in $paths; do @@ -1443,25 +804,18 @@ EOT tarball ) ## ## tarball -- Roll distribution tarballs - ## Copyright (c) 1999 Ralf S. Engelschall + ## Copyright (c) 1999-2000 Ralf S. Engelschall ## Originally written for shtool ## srcs="$*" # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then + if [ -x /bin/sh ] 2>/dev/null; then minusx="-x" else minusx="-r" fi - rm -f $tmpfile # find the tools paths="`echo $PATH |\ @@ -1579,14 +933,14 @@ EOT echo "chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1" 2>&1 fi chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1 ||\ - echo "$msgprefix:Warning: cannot set user name \`$opt_u' (need root priviledges)" + echo "$msgprefix:Warning: cannot set user name \`$opt_u' (would require root priviledges)" fi if [ ".$opt_g" != . ]; then if [ ".$opt_t" = .yes ]; then echo "chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1" 2>&1 fi chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1 ||\ - echo "$msgprefix:Warning: cannot set group name \`$opt_g' (need root priviledges)" + echo "$msgprefix:Warning: cannot set group name \`$opt_g' (would require root priviledges)" fi if [ ".$opt_t" = .yes ]; then echo "(cd $tmpdir && $prg_find $tarname -type f -depth -print | sort | xargs $prg_tar cf -) | cat $compress >$tmpfile.out" 1>&2 @@ -1610,697 +964,10 @@ EOT rm -f $tmpfile.lst $tmpfile.out ;; -guessos ) - ## - ## guessos -- Simple OS/platform guesser - ## Copyright (c) 1996-2000 The Apache Group, http://www.apache.org/ - ## The Apache license applies (see http://www.apache.org/docs/LICENSE) - ## Originally written for Apache - ## - - MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown" - RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown" - SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown" - VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown" - - XREL=`(uname -X) 2>/dev/null | grep "^Release" | awk '{print $3}'` - if [ "x$XREL" != "x" ]; then - if [ -f /etc/kconfig ]; then - case "$XREL" in - 4.0|4.1) echo "${MACHINE}-whatever-isc4"; exit 0 ;; - esac - else - case "$XREL" in - 3.2v4.2) - echo "whatever-whatever-sco3"; exit 0 - ;; - 3.2v5.0*) - echo "whatever-whatever-sco5"; exit 0 - ;; - 4.2MP) - if [ "x$VERSION" = "x2.1.1" ]; then - echo "${MACHINE}-whatever-unixware211"; exit 0 - elif [ "x$VERSION" = "x2.1.2" ]; then - echo "${MACHINE}-whatever-unixware212"; exit 0 - else - echo "${MACHINE}-whatever-unixware2"; exit 0 - fi - ;; - 4.2) - echo "whatever-whatever-unixware1"; exit 0 - ;; - 5) - case "$VERSION" in - 7*) echo "${MACHINE}-whatever-unixware7"; exit 0 ;; - esac - ;; - esac - fi - fi - case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in - MiNT:*) - echo "m68k-atari-mint"; exit 0 - ;; - A/UX:*) - echo "m68k-apple-aux3"; exit 0 - ;; - AIX:*) - MACH=`echo $MACHINE | sed -e 's;[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F];;'` - echo "${MACH}-ibm-aix${VERSION}.${RELEASE}"; exit 0 - ;; - dgux:*) - echo "${MACHINE}-dg-dgux"; exit 0 - ;; - HI-UX:*) - echo "${MACHINE}-hi-hiux"; exit 0 - ;; - HP-UX:*) - HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo "${MACHINE}-hp-hpux${HPUXVER}"; exit 0 - ;; - IRIX:*) - if [ -f /usr/lib32/mips4/libm.so ]; then - echo "${MACHINE}/32-sgi-irix${RELEASE}"; exit 0 - else - echo "${MACHINE}-sgi-irix${RELEASE}"; exit 0 - fi - ;; - IRIX64:*) - echo "${MACHINE}/64-sgi-irix${RELEASE}"; exit 0 - ;; - Linux:*) - V='whatever' - case "$MACHINE" in - i?86) V='pc' ;; - esac - R='' - case "$RELEASE" in - [1-9].*) R=`echo $RELEASE | cut -c1` ;; - esac - echo "${MACHINE}-${V}-linux-gnu${R}"; exit 0 - ;; - LynxOS:*) - echo "${MACHINE}-lynx-lynxos"; exit 0 - ;; - BSD/386|BSD/OS:3.*) - echo "${MACHINE}-whatever-bsdi3"; exit 0 - ;; - BSD/386:*:*:*486*|BSD/OS:*:*:*:*486*) - echo "i486-whatever-bsdi"; exit 0 - ;; - BSD/386:*|BSD/OS:*) - echo "${MACHINE}-whatever-bsdi"; exit 0 - ;; - FreeBSD:*) - VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'` - MACH=`/sbin/sysctl -n hw.model` - ARCH='whatever' - case ${MACH} in - *386* ) MACH="i386" ;; - *486* ) MACH="i486" ;; - Pentium\ II*) MACH="i686" ;; - Pentium* ) MACH="i586" ;; - Alpha* ) MACH="alpha" ;; - * ) MACH="$MACHINE" ;; - esac - case ${MACH} in - i[0-9]86 ) ARCH="pc" ;; - esac - echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0 - ;; - NetBSD:*:*:*486*) - echo "i486-whatever-netbsd${RELEASE}"; exit 0 - ;; - NetBSD:*) - echo "${MACHINE}-whatever-netbsd${RELEASE}"; exit 0 - ;; - OpenBSD:*) - echo "${MACHINE}-whatever-openbsd"; exit 0 - ;; - OSF1:*:*:*alpha*) - VERS=`echo $RELEASE | sed -e 's;^V;;'` - echo "${MACHINE}-dec-osf${VERS}"; exit 0 - ;; - QNX:*) - if [ "$VERSION" -gt 422 ]; then - echo "${MACHINE}-qssl-qnx32" - else - echo "${MACHINE}-qssl-qnx" - fi - exit 0 - ;; - Paragon*:*:*:*) - echo "i860-intel-osf1"; exit 0 - ;; - SunOS:5.*) - VERSION=`echo $RELEASE | sed -e 's;^5\.;;'` - echo "${MACHINE}-sun-solaris2.${VERSION}"; exit 0 - ;; - SunOS:*) - echo "${MACHINE}-sun-sunos4"; exit 0 - ;; - UNIX_System_V:4.*:*) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - unix:3.0.9*:*:88k) - echo "${MACHINE}-encore-sysv4"; exit 0 - ;; - *:4*:R4*:m88k) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - UnixWare:5:99*:*) - # Gemini, beta release of next rev of unixware - echo "${MACHINE}-whatever-unixware212"; exit 0 - ;; - DYNIX/ptx:4*:*) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - *:4.0:3.0:[345][0-9]?? | *:4.0:3.0:3[34]??[/,]* | library:*) - echo "x86-ncr-sysv4"; exit 0 - ;; - ULTRIX:*) - echo "${MACHINE}-unknown-ultrix"; exit 0 - ;; - SINIX-?:* | ReliantUNIX-?:*) - echo "${MACHINE}-siemens-sysv4"; exit 0 - ;; - POSIX*BS2000) - echo "${MACHINE}-siemens-sysv4"; exit 0 - ;; - machten:*) - echo "${MACHINE}-tenon-${SYSTEM}"; exit 0; - ;; - ConvexOS:*:11.*:*) - echo "${MACHINE}-v11-${SYSTEM}"; exit 0; - ;; - UNIX_SV:*:*:maxion) - echo "${MACHINE}-ccur-sysv4"; exit 0; - ;; - PowerMAX_OS:*:*:Night_Hawk) - MACHINE=`uname -p` - echo "${MACHINE}-concurrent-powermax"; exit 0; - ;; - UNIX_SV:*) - if [ -d /usr/nec ];then - echo "mips-nec-sysv4"; exit 0; - fi - ;; - NonStop-UX:4.[02]*:[BC]*:*) - echo "${MACHINE}-tandem-sysv4"; exit 0; - ;; - Rhapsody:*:*:*) - case "${MACHINE}" in - "Power Macintosh") MACHINE=powerpc ;; - esac - echo "${MACHINE}-apple-rhapsody${RELEASE}"; exit 0 - ;; - "Mac OS":*:*:*) - MACHINE=`uname -p` - echo "${MACHINE}-apple-macos${RELEASE}"; exit 0 - ;; - "RISC iX":*) - echo "arm-whatever-riscix"; exit 0; - ;; - *:4.0:2:*) - echo "whatever-unisys-sysv4"; exit 0; - ;; - *:*:dcosx:NILE*) - echo "pyramid-pyramid-svr4"; exit 0; - ;; - *:*:*:"DRS 6000") - echo "drs6000-whatever-whatever"; exit 0; - ;; - AmigaOS:*:*:* ) - echo "${MACHINE}-whatever-${SYSTEM}${RELEASE}"; exit 0 - ;; - esac - - # Now NeXT - ISNEXT=`(hostinfo) 2>/dev/null` - case "$ISNEXT" in - *NeXT*) - # Swiped from a friendly uname clone for NEXT/OPEN Step. - NEXTOSVER="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`" - if [ "$NEXTOSVER" -gt 3.3 ]; then - NEXTOS="openstep" - else - NEXTOS="nextstep" - fi - NEXTREL="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`" - NEXTARCH=`arch` - echo "${NEXTARCH}-next-${NEXTOS}${NEXTREL}" ; exit 0 - ;; - esac - - # Fallback - echo "${MACHINE}-whatever-${SYSTEM}/${RELEASE}/${VERSION}" - ;; - -arx ) - ## - ## arx -- Extended archive command - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - ar_prg="$opt_C" - ar_cmd="$1"; shift - archive="$1"; shift - files="$*" - - # walk through the file list and expand archives members - tmpdir=`echo $archive | sed -e 's;[^/]*$;.arx;'` - nfiles='' - if [ ".$files" != . ]; then - for file in $files; do - if [ ! -f $file ]; then - echo "$msgprefix:Error: input file not found: $file" 1>&2 - exit 1 - fi - case $file in - *.a ) - if [ ! -d $tmpdir ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $tmpdir" 1>&2 - fi - mkdir $tmpdir - fi - case $tmpdir in - .arx ) - from="../$file" - ;; - * ) - dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - base=`echo $file | sed -e 's;.*/\([^/]*\)$;\1;'` - from="`cd $dir; pwd`/$base" - ;; - esac - if [ ".$opt_t" = .yes ]; then - echo "(cd $tmpdir && $ar_prg x $from)" 1>&2 - fi - (cd $tmpdir && eval $ar_prg x $from) - if [ $? -ne 0 ]; then - echo "$msgprefix:Error: member extraction failed for archive: $file" 1>&2 - exit 1 - fi - for member in - `eval $ar_prg t $file`; do - [ ".$member" = .- ] && continue - nfiles="$nfiles $tmpdir/$member" - done - ;; - * ) - nfiles="$nfiles $file" - ;; - esac - done - fi - - # run the final archive command - if [ ".$opt_t" = .yes ]; then - echo "$ar_prg $ar_cmd $archive $nfiles" 1>&2 - fi - eval $ar_prg $ar_cmd $archive $nfiles - if [ $? -ne 0 ]; then - echo "$msgprefix:Error: archive command failed" 1>&2 - exit $? - fi - - # cleanup and die gracefully - if [ -d $tmpdir ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -rf $tmpdir" 1>&2 - fi - rm -rf $tmpdir - fi - ;; - -slo ) - ## - ## slo -- Separate linker options by library class - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - DIFS="$IFS" - - # parse out -L and -l options from command line - DIRS='' - LIBS='' - ARGV='' - optprev='' - for opt - do - # concatenate with previous option if exists - if [ ".$optprev" != . ]; then - opt="${optprev}${opt}"; - optprev='' - fi - # remember options for arg when used stand-alone - if [ ".$opt" = ".-L" -o ".$opt" = ".-l" ]; then - optprev="$opt" - continue; - fi - # split argument into option plus option argument - arg="`echo $opt | cut -c3-`" - opt="`echo $opt | cut -c1-2`" - # store into containers - case $opt in - -L) DIRS="$DIRS:$arg" ;; - -l) LIBS="$LIBS:$arg" ;; - *) ARGV="$ARGV $opt" ;; - esac - done - - # set linker default directories - DIRS_DEFAULT='/lib:/usr/lib' - if [ ".$LD_LIBRARY_PATH" != . ]; then - DIRS_DEFAULT="$DIRS_DEFAULT:$LD_LIBRARY_PATH" - fi - - # sort options by class - DIRS_OBJ='' - LIBS_OBJ='' - DIRS_PIC='' - LIBS_PIC='' - DIRS_DSO='' - LIBS_DSO='' - - # for each library... - OIFS="$IFS" IFS=':' - for lib in $LIBS; do - [ ".$lib" = . ] && continue - - found='no' - found_indefdir='no' - found_type='' - found_dir='' - - # for each directory... - OIFS2="$IFS" IFS=":$DIFS" - for dir in ${DIRS} switch-to-defdirs ${DIRS_DEFAULT}; do - [ ".$dir" = . ] && continue - [ ".$dir" = .switch-to-defdirs ] && found_indefdir=yes - [ ! -d $dir ] && continue - - # search the file - OIFS3="$IFS" IFS="$DIFS" - for file in '' `cd $dir && ls lib${lib}.* 2>/dev/null`; do - [ ".$file" = . ] && continue - case $file in - *.so|*.so.[0-9]*|*.sl|*.sl.[0-9]* ) - found=yes; - found_type=DSO; - break - ;; - *.lo|*.la ) - found=yes; - found_type=PIC - ;; - *.a ) - if [ ".$found_type" = . ]; then - found=yes - found_type=OBJ - fi - ;; - esac - done - IFS="$OIFS3" - if [ ".$found" = .yes ]; then - found_dir="$dir" - break - fi - done - IFS="$OIFS2" - - if [ ".$found" = .yes ]; then - if [ ".$found_indefdir" != .yes ]; then - eval "dirlist=\"\${DIRS_${found_type}}:\"" - if [ ".`echo \"$dirlist\" | fgrep :$found_dir:`" = . ]; then - eval "DIRS_${found_type}=\"\$DIRS_${found_type}:${found_dir}\"" - fi - eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\"" - else - eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\"" - fi - else - LIBS_OBJ="$LIBS_OBJ:$lib" - #dirlist="`echo $DIRS $DIRS_DEFAULT | sed -e 's/:/ /g'`" - #echo "slo:Warning: library \"$lib\" not found in any of the following dirs:" 2>&1 - #echo "slo:Warning: $dirlist" 1>&1 - fi - done - IFS="$OIFS" - - # also pass-through unused dirs even if it's useless - OIFS="$IFS" IFS=':' - for dir in $DIRS; do - dirlist="${DIRS_OBJ}:${DIRS_PIC}:${DIRS_DSO}:" - if [ ".`echo \"$dirlist\" | fgrep :$dir:`" = . ]; then - DIRS_OBJ="$DIRS_OBJ:$dir" - fi - done - IFS="$OIFS" - - # reassemble the options but separated by type - for type in OBJ PIC DSO; do - OIFS="$IFS" IFS=':' - eval "libs=\"\$LIBS_${type}\"" - opts='' - for lib in $libs; do - [ ".$lib" = . ] && continue - opts="$opts -l$lib" - done - eval "LIBS_${type}=\"$opts\"" - - eval "dirs=\"\$DIRS_${type}\"" - opts='' - for dir in $dirs; do - [ ".$dir" = . ] && continue - opts="$opts -L$dir" - done - eval "DIRS_${type}=\"$opts\"" - IFS="$OIFS" - done - - # give back results - for var in ARGV DIRS_OBJ LIBS_OBJ DIRS_PIC LIBS_PIC DIRS_DSO LIBS_DSO; do - eval "val=\"\$${var}\"" - val="`echo $val | sed -e 's/^ *//'`" - echo "SLO_${var}=\"${val}\"" - done - ;; - -scpp ) - ## - ## scpp -- Sharing C Pre-Processor - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for GNU pth - ## - - srcs="$*" - output="${opt_o}.n" - - # find a reasonable Awk - awk='' - paths=`echo $PATH |\ - sed -e 's%/*:%:%g' -e 's%/$%%' \ - -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \ - -e 's/:/ /g'` - for name in gawk nawk awk; do - for path in $paths; do - if [ -r "$path/$name" ]; then - awk="$path/$name" - break - fi - done - if [ ".$awk" != . ]; then - break - fi - done - if [ ".$awk" = . ]; then - echo "$msgprefix:Error: cannot find a reasonable Awk" 1>&2 - exit 1 - fi - - # parse source file(s) - if [ ".$opt_v" = .yes ]; then - echo "Parsing:" | $awk '{ printf("%s", $0); }' 1>&2 - fi - for src in $srcs; do - if [ ".$opt_v" = .yes ]; then - echo $src | $awk '{ printf(" %s", $0); }' 1>&2 - fi - $awk <$src ' - BEGIN { - ln = 0; - fln = 0; - level = 0; - mode = ""; - store = ""; - } - { - ln++; - } - /^#if.*/ { - level++; - } - /^#if [a-zA-Z_][a-zA-Z0-9_]* *$/ { - if ($2 == define) { - mode = "D"; - printf("D:#line %d \"%s\"\n", ln, src); - next; - } - } - /^#endif.*/ { - level--; - if (mode == "D" && level == 0) { - mode = ""; - next; - } - } - /^[a-zA-Z_][a-zA-Z0-9_].*;.*/ { - if ($1 == class) { - printf("V:#line %d \"%s\"\n", ln, src); - printf("V:%s\n", $0); - printf("J:%s\n", $0); - next; - } - } - /^[a-zA-Z_][a-zA-Z0-9_].*=.*/ { - if ($1 == class) { - printf("V:#line %d \"%s\"\n", ln, src); - printf("V:%s\n", $0); - printf("J:%s\n", $0); - next; - } - } - /^[a-zA-Z_][a-zA-Z0-9_]*/ { - if ($1 == class) { - fln = ln; - store = $0; - mode = "F"; - next; - } - } - /^\{ *$/ { - if (mode == "F") { - printf("F:#line %d \"%s\"\n", fln, src); - printf("F:%s;\n", store); - printf("I:%s;\n", store); - store = ""; - mode = ""; - next; - } - } - { - if (mode == "D") - printf("D:%s\n", $0); - else if (mode == "F") - store = store " " $0; - } - ' "src=$src" "define=$opt_D" "class=$opt_C" >>$tmpfile - done - if [ ".$opt_v" = .yes ]; then - echo "" 1>&2 - fi - - # start generating output header - echo "/* $opt_o -- autogenerated from $opt_t, DO NOT EDIT! */" >$output - echo "#line 1 \"$opt_t\"" >>$output - sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd' |\ - sed -e "/^${opt_M} *\$/d" >>$output - - # merge in the define blocks - grep '^D:' $tmpfile | sed -e 's/^D://' >>$output - - # generate standard prolog - echo "#line 1 \"_ON_THE_FLY_\"" >>$output - echo "" >>$output - echo "/* make sure the scpp source extensions are skipped */" >>$output - echo "#define $opt_D 0" >>$output - echo "#define $opt_C /**/" >>$output - - # generate namespace hiding for variables - echo "" >>$output - echo "/* move intern variables to hidden namespace */" >>$output - grep '^J:' $tmpfile | sed >>$output \ - -e 's/^J://' \ - -e 's/ */ /g' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\];.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\] =.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\);.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\) =.*$/#define \1 __\1/' - - # generate namespace hiding for functions - echo "" >>$output - echo "/* move intern functions to hidden namespace */" >>$output - grep '^I:' $tmpfile | sed >>$output \ - -e 's/^I://' \ - -e 's/\([ (]\) */\1/g' \ - -e 's/ *\([),]\)/\1/g' \ - -e 's/^[^(]*[ *]\([a-zA-Z0-9_]*\)(.*$/#define \1 __\1/' - - # generate prototypes for variables - echo "" >>$output - echo "/* prototypes for intern variables */" >>$output - grep '^V:' $tmpfile | sed >>$output \ - -e 's/^V://' \ - -e 's/ */ /g' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\);.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\) =.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\);.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\) =.*$/\1;/' \ - -e 's/ ;/;/g' \ - -e "s/^$opt_C /extern /" - - # generate prototypes for functions - echo "" >>$output - echo "/* prototypes for intern functions */" >>$output - grep '^F:' $tmpfile | sed >>$output \ - -e 's/^F://' \ - -e 's/\([ (]\) */\1/g' \ - -e 's/ *\([),]\)/\1/g' \ - -e 's/\([* ]\)[a-zA-Z0-9_]*,/\1,/g' \ - -e 's/\([* ]\)[a-zA-Z0-9_]*);/\1);/g' \ - -e 's/(\*[a-zA-Z0-9_]*)(/(*)(/g' \ - -e 's/\([ (]\) */\1/g' \ - -e 's/ *\([),]\)/\1/g' \ - -e "s/^$opt_C /extern /" - - # finish generating output header - n=`(echo ''; sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd') |\ - wc -l | sed -e 's;^ *\([0-9]*\) *$;\1;'` - echo "#line $n \"$opt_t\"" >>$output - sed <$opt_t -e "/^${opt_M} *\$/,\$p" -e 'd' |\ - sed -e "/^${opt_M} *\$/d" >>$output - - # create final output file - if [ -f $opt_o ]; then - if [ ".$opt_p" = .yes ]; then - grep -v '^#line' $opt_o >$tmpfile.o - grep -v '^#line' $output >$tmpfile.n - out_old="$tmpfile.o" - out_new="$tmpfile.n" - else - out_old="$opt_o" - out_new="$output" - fi - if cmp -s $out_old $out_new; then - : - else - cp $output $opt_o - fi - else - cp $output $opt_o - fi - rm -f $output - rm -f $tmpfile $tmpfile.* >/dev/null 2>&1 - ;; - version ) ## ## version -- Generate and maintain a version information file - ## Copyright (c) 1994-1999 Ralf S. Engelschall + ## Copyright (c) 1994-2000 Ralf S. Engelschall ## Originally written for ePerl ## @@ -2493,7 +1160,7 @@ EOT cat >$tmpfile <<'EOT' /* ** @FILE@ -- Version Information -** [automatically generated and maintained by shtool] +** [automatically generated and maintained by GNU shtool] */ #ifdef _AS_HEADER @@ -2518,7 +1185,7 @@ const char @PREFIX@_VersionStr[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@ const char @PREFIX@_Hello[] = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; const char @PREFIX@_GNUVersion[] = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; const char @PREFIX@_WhatID[] = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_RCSIdentID[] = "$Id: shtool,v 1.4 2000/03/31 08:36:19 fielding Exp $"; +const char @PREFIX@_RCSIdentID[] = "$Id: shtool,v 1.5 2000/05/03 17:15:49 rbb Exp $"; const char @PREFIX@_WebID[] = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; const char @PREFIX@_PlainID[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; @@ -2529,7 +1196,7 @@ EOT cat >$tmpfile <<'EOT' ## ## @FILE@ -- Version Information -## [automatically generated and maintained by shtool] +## [automatically generated and maintained by GNU shtool] ## $@PREFIX@_Version = 0x@HEX@; @@ -2537,7 +1204,7 @@ $@PREFIX@_VersionStr = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YE $@PREFIX@_Hello = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; $@PREFIX@_GNUVersion = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; $@PREFIX@_WhatID = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_RCSIdentID = "\$Id: shtool,v 1.4 2000/03/31 08:36:19 fielding Exp $/"; +$@PREFIX@_RCSIdentID = "\$Id: shtool,v 1.5 2000/05/03 17:15:49 rbb Exp $/"; $@PREFIX@_WebID = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; $@PREFIX@_PlainID = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; @@ -2565,155 +1232,6 @@ EOT exit 0 ;; -path ) - ## - ## path -- Deal with program paths - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - namelist="$*" - - # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then - minusx="-x" - else - minusx="-r" - fi - rm -f $tmpfile - - # split path string - paths="`echo $opt_p |\ - sed -e 's/^:/.:/' \ - -e 's/::/:.:/g' \ - -e 's/:$/:./' \ - -e 's/:/ /g'`" - - # SPECIAL REQUEST - # translate forward to reverse path - if [ ".$opt_r" = .yes ]; then - if [ "x$namelist" = "x." ]; then - rp='.' - else - rp='' - for pe in `IFS="$IFS/"; echo $namelist`; do - rp="../$rp" - done - fi - echo $rp | sed -e 's:/$::' - exit 0 - fi - - # SPECIAL REQUEST - # strip out directory or base name - if [ ".$opt_d" = .yes ]; then - echo "$namelist" |\ - sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' - exit 0 - fi - if [ ".$opt_b" = .yes ]; then - echo "$namelist" |\ - sed -e 's;.*/\([^/]*\)$;\1;' - exit 0 - fi - - # MAGIC SITUATION - # Perl Interpreter (perl) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then - rm -f $tmpfile - touch $tmpfile - c=0 - found=0 - for dir in $paths; do - dir=`echo $dir | sed -e 's;/*$;;'` - for perl in perl5 perl miniperl; do - if [ $minusx "$dir/$perl" ] && [ ! -d "$dir/$perl" ]; then - perl="$dir/$perl" - version=`$perl -v | grep version |\ - sed -e 's/.* version //' -e 's/ built.*//' -e 's/ with.*//'` - versionnum="`echo $version | sed -e 's/\.//g' -e 's/_//g'`" - versionnum=`expr $versionnum - $c` - echo "$versionnum $perl" >>$tmpfile - found=1 - fi - done - c=`expr $c + 1` - done - if [ $found = 1 ]; then - perl="`cat $tmpfile | sort -u | tail -1 | cut '-d ' -f2`" - rm -f $tmpfile - echo "$perl" - exit 0 - fi - exit 1 - fi - - # MAGIC SITUATION - # C pre-processor (cpp) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then - cat >$tmpfile.c < - Syntax Error -EOT - # 1. try the standard cc -E approach - cpp="${CC-cc} -E" - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # 2. try the cc -E approach and GCC's -traditional-ccp option - cpp="${CC-cc} -E -traditional-cpp" - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # 3. try a standalone cpp command in path and lib dirs - for path in $paths /lib /usr/lib /usr/local/lib; do - path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/cpp" ] && [ ! -d "$path/cpp" ]; then - cpp="$path/cpp" - break - fi - done - if [ ".$cpp" != . ]; then - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # ok, we gave up... - cpp='' - fi - fi - fi - fi - rm -f $tmpfile.c $tmpfile.out - if [ ".$cpp" != . ]; then - echo "$cpp" - exit 0 - fi - exit 1 - fi - - # STANDARD SITUATION - # iterate over names - for name in $namelist; do - # iterate over paths - for path in $paths; do - path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then - if [ ".$opt_s" != .yes ]; then - echo "$path/$name" 2>&1 - fi - exit 0 - fi - done - done - exit 1 - ;; - esac exit 0 From 5591c1d70a5676f12d8c07685aca70e2be684e3d Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Wed, 3 May 2000 17:24:44 +0000 Subject: [PATCH 0045/7878] Import support for hash tables. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60019 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 196 ++++++++++++++++++++++++++++++++ lib/Makefile.in | 6 + lib/apr_hash.c | 275 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 477 insertions(+) create mode 100644 include/apr_hash.h create mode 100644 lib/apr_hash.c diff --git a/include/apr_hash.h b/include/apr_hash.h new file mode 100644 index 00000000000..f93c4b06ab2 --- /dev/null +++ b/include/apr_hash.h @@ -0,0 +1,196 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + +#ifndef ap_HASH_H +#define ap_HASH_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Abstract type for hash tables. + */ +typedef struct ap_hash_t ap_hash_t; + +/* + * Abstract type for scanning hash tables. + */ +typedef struct ap_hash_index_t ap_hash_index_t; + +/* + +=head1 ap_hash_t *ap_make_hash(ap_pool_t *pool) + +B + +=cut +*/ +ap_hash_t *ap_make_hash(ap_pool_t *pool); + +/* + +=head1 void ap_hash_set(ap_hash_t *ht, void *key, size_t klen, void *val) + +B + + arg 1) The hash table + arg 2) Pointer to the key + arg 3) Length of the key + arg 4) Value to associate with the key + +If the value is NULL the hash entry is deleted. + +=cut +*/ +void ap_hash_set(ap_hash_t *ht, void *key, size_t klen, void *val); + +/* + +=head1 void *ap_hash_get(ap_hash_t *ht, void *key, size_t klen) + +B + + arg 1) The hash table + arg 2) Pointer to the key + arg 3) Length of the key + +Returns NULL if the key is not present. + +=cut +*/ +void *ap_hash_get(ap_hash_t *ht, void *key, size_t klen); + +/* + +=head1 ap_hash_index_t *ap_hash_first(ap_hash_t *ht) + +B + + arg 1) The hash table + +Returns a pointer to the iteration state, or NULL if there are no +entries. + +=cut +*/ +ap_hash_index_t *ap_hash_first(ap_hash_t *ht); + +/* + +=head1 ap_hash_index_t *ap_hash_next(ap_hash_index_t *hi) + +B + + arg 1) The iteration state + +Returns a pointer to the updated iteration state, or NULL if there are +no more entries. + +*/ +ap_hash_index_t *ap_hash_next(ap_hash_index_t *hi); + +/* + +=head1 void ap_hash_this(ap_hash_index_t *hi, void **key, size_t *klen, void **val) + +B + + arg 1) The iteration state + arg 2) Return pointer for the pointer to the key. + arg 3) Return pointer for the key length. + arg 4) Return pointer for the associated value. + +The return pointers should point to a variable that will be set to the +corresponding data, or they may be NULL if the data isn't interesting. + +=cut +*/ +void ap_hash_this(ap_hash_index_t *hi, void **key, size_t *klen, void **val); + +/* + +=head2 Using the iteration functions + +Example: + + int sum_values(ap_hash_t *ht) + { + ap_hash_index_t *hi; + void *val; + int sum = 0; + for (hi = ap_hash_first(ht); hi; hi = ap_hash_next(hi)) { + ap_hash_this(hi, NULL, NULL, &val); + sum += *(int *)val; + } + return sum; + } + +There is no restriction on adding or deleting hash entries during an +iteration (although the results may be unpredictable unless all you do +is delete the current entry) and multiple iterations can be in +progress at the same time. + +=cut +*/ + +#ifdef __cplusplus +} +#endif + +#endif /* !ap_HASH_H */ diff --git a/lib/Makefile.in b/lib/Makefile.in index da1a211895b..61a74555d99 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -24,6 +24,7 @@ OBJS=apr_cpystrn.o \ apr_signal.o \ apr_snprintf.o \ apr_tables.o \ + apr_hash.o \ apr_getpass.o \ apr_strnatcmp.o @@ -73,6 +74,11 @@ apr_getpass.o: apr_getpass.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_thread_proc.h +apr_hash.o: apr_hash.c $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_hash.h apr_md5.o: apr_md5.c $(INCDIR)/apr_private.h $(INCDIR)/apr_md5.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ diff --git a/lib/apr_hash.c b/lib/apr_hash.c new file mode 100644 index 00000000000..5ef3c8faf91 --- /dev/null +++ b/lib/apr_hash.c @@ -0,0 +1,275 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + +#include "apr_private.h" + +#include "apr_general.h" +#include "apr_pools.h" + +#include "apr_hash.h" + +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + + +/* + * The internal form of a hash table. + * + * The table is an array indexed by the hash of the key; collisions + * are resolved by hanging a linked list of hash entries off each + * element of the array. Although this is a really simple design it + * isn't too bad given that pools have a low allocation overhead. + */ + +typedef struct ap_hash_entry_t ap_hash_entry_t; + +struct ap_hash_entry_t { + ap_hash_entry_t *next; + int hash; + void *key; + size_t klen; + void *val; +}; + +/* + * The size of the array is always a power of two. We use the maximum + * index rather than the size so that we can use bitwise-AND for + * modular arithmetic. + * The count of hash entries may be greater depending on the chosen + * collision rate. + */ +struct ap_hash_t { + ap_pool_t *pool; + ap_hash_entry_t **array; + size_t count, max; +}; +#define INITIAL_MAX 15 /* tunable == 2^n - 1 */ + +/* + * Data structure for iterating through a hash table. + * + * We keep a pointer to the next hash entry here to allow the current + * hash entry to be freed or otherwise mangled between calls to + * ap_hash_next(). + */ +struct ap_hash_index_t { + ap_hash_t *ht; + ap_hash_entry_t *this, *next; + int index; +}; + + +/* + * Hash creation functions. + */ + +static ap_hash_entry_t **alloc_array(ap_hash_t *ht) +{ + return ap_pcalloc(ht->pool, sizeof(*ht->array) * (ht->max + 1)); +} + +API_EXPORT(ap_hash_t *) ap_make_hash(ap_pool_t *pool) +{ + ap_hash_t *ht; + ht = ap_palloc(ht->pool, sizeof(*ht)); + ht->pool = pool; + ht->count = 0; + ht->max = INITIAL_MAX; + ht->array = alloc_array(ht); + return ht; +} + + +/* + * Hash iteration functions. + */ + +API_EXPORT(ap_hash_index_t *) ap_hash_next(ap_hash_index_t *hi) +{ + hi->this = hi->next; + while (!hi->this) { + if (hi->index > hi->ht->max) + return NULL; + hi->this = hi->ht->array[hi->index++]; + } + hi->next = hi->this->next; + return hi; +} + +API_EXPORT(ap_hash_index_t *) ap_hash_first(ap_hash_t *ht) +{ + ap_hash_index_t *hi; + hi = ap_palloc(ht->pool, sizeof(*hi)); + hi->ht = ht; + hi->index = 0; + hi->this = NULL; + hi->next = NULL; + return ap_hash_next(hi); +} + +API_EXPORT(void) ap_hash_this(ap_hash_index_t *hi, + void **key, + size_t *klen, + void **val) +{ + if (key) *key = hi->this->key; + if (klen) *klen = hi->this->klen; + if (val) *val = hi->this->val; +} + + +/* + * Resizing a hash table + */ + +static void resize_array(ap_hash_t *ht) +{ + ap_hash_index_t *hi; + ap_hash_entry_t **new_array; + int i; + + new_array = alloc_array(ht); + for (hi = ap_hash_first(ht); hi; hi = ap_hash_next(hi)) { + i = hi->this->hash & ht->max; + hi->this->next = new_array[i]; + new_array[i] = hi->this; + } + ht->array = new_array; +} + +/* + * This is where we keep the details of the hash function and control + * the maximum collision rate. + * + * If val is non-NULL it creates and initializes a new hash entry if + * there isn't already one there; it returns an updatable pointer so + * that hash entries can be removed. + */ + +static ap_hash_entry_t **find_entry(ap_hash_t *ht, + void *key, + size_t klen, + void *val) +{ + ap_hash_entry_t **hep, *he; + unsigned char *p; + int hash; + int i; + + /* + * This hash function is used by perl 5; RSE attributes it to DJB. + * (See Message-ID: <19991013131827.A17702@engelschall.com> + * in the new-httpd archive for October 1999.) + */ + hash = 0; + for (p = key, i = klen; i; i--, p++) + hash = hash * 33 + *p; + + /* scan linked list */ + for (hep = &ht->array[hash & ht->max], he = *hep; + he; + hep = &he->next, he = *hep) { + if (he->hash == hash && + he->klen == klen && + memcmp(he->key, key, klen) == 0) + break; + } + if (he || !val) + return hep; + /* add a new entry for non-NULL values */ + he = ap_pcalloc(ht->pool, sizeof(*he)); + he->hash = hash; + he->key = key; + he->klen = klen; + he->val = val; + *hep = he; + /* check that the collision rate isn't too high */ + if (++ht->count > ht->max) { + ht->max = ht->max * 2 + 1; + resize_array(ht); + } + return hep; +} + +API_EXPORT(void *) ap_hash_get(ap_hash_t *ht, + void *key, + size_t klen) +{ + ap_hash_entry_t *he; + he = *find_entry(ht, key, klen, NULL); + if (he) + return he->val; + else + return NULL; +} + +API_EXPORT(void) ap_hash_set(ap_hash_t *ht, + void *key, + size_t klen, + void *val) +{ + ap_hash_entry_t **hep; + hep = find_entry(ht, key, klen, val); + if (*hep && !val) + /* delete entry */ + *hep = (*hep)->next; +} From 111d7a1359d700ea5a809780e3b3c2c6489dba5e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 3 May 2000 18:12:51 +0000 Subject: [PATCH 0046/7878] Improve the other_child test program. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60020 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 5 +++++ test/occhild.c | 13 +++++++++++++ test/testoc.c | 15 +++++++++++---- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 test/occhild.c diff --git a/test/Makefile.in b/test/Makefile.in index f372231d9cd..625dddd7bac 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -25,6 +25,7 @@ TARGETS= testfile@EXEEXT@ \ testpipe@EXEEXT@ \ testdso@EXEEXT@ \ testoc@EXEEXT@ \ + occhild@EXEEXT@ \ mod_test.so OBJS= testfile.o \ @@ -37,6 +38,7 @@ OBJS= testfile.o \ testmmap.o \ testdso.o \ testoc.o \ + occhild.o \ mod_test.o .c.o: @@ -53,6 +55,9 @@ testdso@EXEEXT@: testdso.o testoc@EXEEXT@: testoc.o $(CC) $(CFLAGS) testoc.o -o testoc@EXEEXT@ $(LDFLAGS) +occhild.so: occhild.o + $(CC) -shared occhild.o -o occhild.so + mod_test.so: mod_test.o $(CC) -shared mod_test.o -o mod_test.so diff --git a/test/occhild.c b/test/occhild.c new file mode 100644 index 00000000000..19ca58c596b --- /dev/null +++ b/test/occhild.c @@ -0,0 +1,13 @@ +#include +#include +#include + +int main() +{ + int rc=1; + char buf[256]; + + while (rc == 1) { + read(STDERR_FILENO, buf, 256); + } +} diff --git a/test/testoc.c b/test/testoc.c index dbdd26efe54..3d897273951 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -90,6 +90,7 @@ int main(int argc, char *argv[]) ap_ssize_t nbytes = 0; ap_proc_t *newproc = NULL; ap_procattr_t *procattr = NULL; + ap_file_t *std = NULL; char *args[3]; if (argc > 1) { @@ -106,7 +107,7 @@ int main(int argc, char *argv[]) exit(-1); } - args[0] = ap_pstrdup(context, "testoc"); + args[0] = ap_pstrdup(context, "occhild"); args[1] = ap_pstrdup(context, "-X"); args[2] = NULL; @@ -116,22 +117,27 @@ int main(int argc, char *argv[]) fprintf(stderr, "Could not create attr\n"); exit(-1);; } + else { + ap_setprocattr_io(procattr, APR_FULL_BLOCK, APR_NO_PIPE, APR_NO_PIPE); + } fprintf(stdout, "OK\n"); fprintf(stdout, "[PARENT] Starting other child.........."); fflush(stdout); - if (ap_create_process(&newproc, "../testoc", args, NULL, procattr, context) + if (ap_create_process(&newproc, "./occhild", args, NULL, procattr, context) != APR_SUCCESS) { fprintf(stderr, "error starting other child\n"); exit(-1); } fprintf(stdout, "OK\n"); + ap_get_childin(&std, newproc); - ap_register_other_child(newproc, ocmaint, NULL, -1, context); + ap_register_other_child(newproc, ocmaint, NULL, std, context); fprintf(stdout, "[PARENT] Sending SIGKILL to child......"); fflush(stdout); + sleep(1); if (ap_kill(newproc, SIGKILL) != APR_SUCCESS) { fprintf(stderr,"couldn't send the signal!\n"); exit(-1); @@ -139,7 +145,8 @@ int main(int argc, char *argv[]) fprintf(stdout,"OK\n"); /* allow time for things to settle... */ - sleep(1); + sleep(3); + ap_probe_writable_fds(); fprintf(stdout, "[PARENT] Checking on children..........\n"); ap_check_other_child(); From a7809d135560192d4ca344a1da9d3705f29202d8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 3 May 2000 18:27:13 +0000 Subject: [PATCH 0047/7878] Customize hints.m4 for OS/390. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60021 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hints.m4 b/hints.m4 index 28c1c4ef9a9..0608e5fc683 100644 --- a/hints.m4 +++ b/hints.m4 @@ -337,9 +337,9 @@ dnl ;; APR_SETIFNULL(CFLAGS=-D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED=1) APR_SETIFNULL(CC, c89) ;; - *-IBM-OS390*) - APR_SETIFNULL(CC, c89) - APR_SETIFNULL(CFLAGS, -DOS390 -DCHARSET_EBCDIC -D_ALL_SOURCE) + *-ibm-os390) + APR_SETIFNULL(CC, cc) + APR_ADDTO(CFLAGS, -U_NO_PROTO) ;; esac ]) From b27cbab70ce604ef5cdf3872d4f13991a01be623 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 4 May 2000 00:27:53 +0000 Subject: [PATCH 0048/7878] Add a new function to APR, ap_wait_all_procs. This waits for any current child process to die, and then returns that child's information. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60022 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 35 +++++++++++++++++++++++++++++++++-- misc/unix/otherchild.c | 12 +++++++++--- threadproc/unix/proc.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 5 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 73874009854..de659feeb24 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -574,6 +574,27 @@ B: The childs status is in the return code to this process. It is */ ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e waithow); + +/* + +=head1 ap_status_t ap_wait_all_procs(ap_proc_t **proc, ap_wait_how waithow, ap_pool_t *p) + +B + + arg 1) Pointer to NULL on entry, will be filled out with child's + information + arg 2) How should we wait. One of: + APR_WAIT -- block until the child process dies. + APR_NOWAIT -- return immediately regardless of if the + child is dead or not. + arg 3) Pool to allocate child information out of. + +=cut + */ + +ap_status_t ap_wait_all_proc(ap_proc_t **proc, ap_wait_how_e waithow, + ap_pool_t *p); + /* =head1 ap_status_t ap_detach(ap_proc_t **new, ap_pool_t *cont) @@ -590,7 +611,7 @@ ap_status_t ap_detach(ap_proc_t **new, ap_pool_t *cont); #if APR_HAS_OTHER_CHILD /* -=head1 void ap_register_other_child(ap_proc_t *pid, void (*maintenance) (int reason, void *data, int status), void *data, int write_fd, ap_pool_t *p) +=head1 void ap_register_other_child(ap_proc_t *pid, void (*maintenance) (int reason, void *data, int status), void *data, ap_file_t *write_fd, ap_pool_t *p) B @@ -609,7 +630,7 @@ B + +=cut + */ +void ap_probe_writable_fds(void); #endif /* APR_HAS_OTHER_CHILD */ /* diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index dd2368685ad..d2255cc560d 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -54,6 +54,7 @@ #include "misc.h" #include "threadproc.h" +#include "../../file_io/unix/fileio.h" #ifdef HAVE_TIME_H #include #endif @@ -68,7 +69,7 @@ static ap_other_child_rec_t *other_children = NULL; API_EXPORT(void) ap_register_other_child(ap_proc_t *pid, void (*maintenance) (int reason, void *, int status), - void *data, int write_fd, ap_pool_t *p) + void *data, ap_file_t *write_fd, ap_pool_t *p) { ap_other_child_rec_t *ocr; @@ -76,7 +77,12 @@ API_EXPORT(void) ap_register_other_child(ap_proc_t *pid, ocr->pid = pid->pid; ocr->maintenance = maintenance; ocr->data = data; - ocr->write_fd = write_fd; + if (write_fd == NULL) { + ocr->write_fd = -1; + } + else { + ocr->write_fd = write_fd->filedes; + } ocr->next = other_children; other_children = ocr; } @@ -98,7 +104,7 @@ API_EXPORT(void) ap_unregister_other_child(void *data) /* test to ensure that the write_fds are all still writable, otherwise * invoke the maintenance functions as appropriate */ -static void probe_writable_fds(void) +void ap_probe_writable_fds(void) { fd_set writable_fds; int fd_max; diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 94f2b43a5d0..7f00b860dde 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -320,6 +320,40 @@ ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc) return APR_SUCCESS; } +ap_status_t ap_wait_all_procs(ap_proc_t **proc, + ap_wait_how_e waithow, ap_pool_t *p) +{ + pid_t status; + if (waithow == APR_WAIT) { + if ((status = waitpid(-1, NULL, WUNTRACED)) > 0) { + if (!*proc) { + (*proc) = ap_pcalloc(p, sizeof(ap_proc_t)); + (*proc)->cntxt = p; + } + (*proc)->pid = status; + return APR_CHILD_DONE; + } + else if (status == 0) { + (*proc) = NULL; + return APR_CHILD_NOTDONE; + } + return errno; + } + if ((status = waitpid(-1, NULL, WUNTRACED | WNOHANG)) > 0) { + if (!*proc) { + (*proc) = ap_pcalloc(p, sizeof(ap_proc_t)); + (*proc)->cntxt = p; + } + (*proc)->pid = status; + return APR_CHILD_DONE; + } + else if (status == 0) { + (*proc) = NULL; + return APR_CHILD_NOTDONE; + } + return errno; +} + ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e waithow) { From 3454d07ed99010a52a59b3bfc36cd191a25f4cf2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 4 May 2000 01:21:34 +0000 Subject: [PATCH 0049/7878] fix a typo in a comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60023 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acconfig.h b/acconfig.h index 40abfb3255a..75ec15b7866 100644 --- a/acconfig.h +++ b/acconfig.h @@ -53,7 +53,7 @@ @BOTTOM@ -/* Make sure we have ssize_t defined to be somethine */ +/* Make sure we have ssize_t defined to be something */ #undef ssize_t #if !defined(HAVE_STRCASECMP) && defined(HAVE_STRICMP) From 238ddbf416d9048d243f2425a6666e1dd43a9182 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 4 May 2000 03:43:49 +0000 Subject: [PATCH 0050/7878] Add support to APR configuration to recognize several non-standard characteristics of OS/390, at least two of which are shared with some other platforms: 1) whether or not the character set is an EBCDIC variant 2) whether or not gethostbyname() supports numeric address strings (e.g., gethostbyname("127.0.0.1")) 3) whether or not pthread_getspecific() has two arguments (for most platforms it has one argument) The Unix ap_connect() now has logic to handle numeric address strings when gethostbyname() can't handle them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60024 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 61 +++++++++++++++++++++++++++++++++++++++ configure.in | 10 +++++-- network_io/unix/sockets.c | 11 +++++++ threads.m4 | 21 ++++++++++++++ 4 files changed, 101 insertions(+), 2 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 84ae7b7b69d..f79b7dd016c 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -161,6 +161,49 @@ undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl ]) +dnl +dnl check for gethostbyname() which handles numeric address strings +dnl + +AC_DEFUN(APR_CHECK_GETHOSTBYNAME_NAS,[ + AC_CACHE_CHECK(for gethostbyname() which handles numeric address strings, ac_cv_gethostbyname_nas,[ + AC_TRY_RUN( [ +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_NETINET_IN_H +#include +#endif +#if HAVE_ARPA_INET_H +#include +#endif +#if HAVE_NETDB_H +#include +#endif +#if HAVE_STDLIB_H +#include +#endif +void main(void) { + struct hostent *he = gethostbyname("127.0.0.1"); + if (he == NULL) { + exit(1); + } + else { + exit(0); + } +} +],[ + ac_cv_gethostbyname_nas="yes" +],[ + ac_cv_gethostbyname_nas="no" +],[ + ac_cv_gethostbyname_nas="yes" +])]) +if test "$ac_cv_gethostbyname_nas" = "yes"; then + AC_DEFINE(GETHOSTBYNAME_HANDLES_NAS, 1, [Define if gethostbyname() handles nnn.nnn.nnn.nnn]) +fi +]) + dnl dnl check for socklen_t, fall back to unsigned int dnl @@ -196,5 +239,23 @@ dnl the way we might want it to. AC_DEFUN(AC_PROG_RANLIB_NC, [AC_CHECK_PROG(RANLIB, ranlib, ranlib, true)]) +AC_DEFUN(APR_EBCDIC,[ + AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ + AC_TRY_RUN( [ +int main(void) { + return (unsigned char)'A' != (unsigned char)0xC1; +} +],[ + ac_cv_ebcdic="yes" +],[ + ac_cv_ebcdic="no" +],[ + ac_cv_ebcdic="no" +])]) + if test "$ac_cv_ebcdic" = "yes"; then + AC_DEFINE(CHARSET_EBCDIC,, [Define if system uses EBCDIC]) + fi +]) + sinclude(threads.m4) sinclude(hints.m4) diff --git a/configure.in b/configure.in index e18e64c94d6..bf075be650e 100644 --- a/configure.in +++ b/configure.in @@ -50,6 +50,8 @@ AC_CHECK_PROG(AR, ar, ar) # This macro needs to be here in case we are on an AIX box. AC_AIX +APR_EBCDIC + # Use /bin/sh if it exists, otherwise go looking for sh in the path if test ".$SH" = . -a -f /bin/sh; then SH="/bin/sh" @@ -353,6 +355,8 @@ else fi fi +APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS + ac_cv_define_READDIR_IS_THREAD_SAFE=no AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE)) @@ -495,7 +499,7 @@ AC_SUBST(sharedmem) AC_SUBST(anonymous_shm) AC_SUBST(filebased_shm) AC_SUBST(keybased_shm) - + dnl #----------------------------- Checking for /dev/random AC_MSG_CHECKING(for /dev/random) @@ -529,7 +533,7 @@ if test "$ac_cv_struct_tm_gmtoff" = "yes"; then fi dnl #----------------------------- Checking for Networking Support -echo $ac_n "${nl}Checking for Networking support..." +echo $ac_n "${nl}Checking for Networking support...${nl}" AC_MSG_CHECKING(looking for in_addr in netinet/in.h) AC_TRY_COMPILE([ #include @@ -543,6 +547,8 @@ AC_MSG_RESULT([$msg]) AC_SUBST(have_in_addr) +APR_CHECK_GETHOSTBYNAME_NAS + dnl #----------------------------- Prepare mm directory for VPATH support if test -n "$USE_MM" && test -n "$USE_VPATH"; then test -d $mm_dir || $MKDIR -p $mm_dir diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 6eff664fad3..f2ea3cc9ffa 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -170,6 +170,14 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) struct hostent *hp; if (hostname != NULL) { +#ifndef GETHOSTBYNAME_HANDLES_NAS + if (*hostname >= '0' && *hostname <= '9' && + strspn(hostname, "0123456789.") == strlen(hostname)) { + sock->remote_addr->sin_addr.s_addr = inet_addr(hostname); + sock->addr_len = sizeof(*sock->remote_addr); + } + else { +#endif hp = gethostbyname(hostname); if ((sock->socketdes < 0) || (!sock->remote_addr)) { @@ -182,6 +190,9 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr_list[0], hp->h_length); sock->addr_len = sizeof(*sock->remote_addr); +#ifndef GETHOSTBYNAME_HANDLES_NAS + } +#endif } if ((connect(sock->socketdes, (const struct sockaddr *)sock->remote_addr, sock->addr_len) < 0) && diff --git a/threads.m4 b/threads.m4 index d5f4b56017e..14cd99c5085 100644 --- a/threads.m4 +++ b/threads.m4 @@ -33,6 +33,27 @@ dnl PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 CPPFLAGS="$CPPFLAGS $PTHREAD_FLAGS" fi ])dnl + +AC_DEFUN(APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS, [ +AC_CACHE_CHECK(whether pthread_getspecific takes two arguments, ac_cv_pthread_getspecific_two_args,[ +AC_TRY_COMPILE([ +#include +],[ +pthread_key_t key; +void *tmp; +pthread_getspecific(key,&tmp); +],[ + ac_cv_pthread_getspecific_two_args=yes +],[ + ac_cv_pthread_getspecific_two_args=no +]) +]) + +if test "$ac_cv_pthread_getspecific_two_args" = "yes"; then + AC_DEFINE(PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS, 1, [Define if pthread_getspecific() has two args]) +fi + +])dnl dnl dnl PTHREADS_CHECK_COMPILE dnl From 66876060613fc14f05dd960041cd3fc88f15b7f2 Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" Date: Thu, 4 May 2000 21:35:58 +0000 Subject: [PATCH 0051/7878] prevent trap when restarting under debugger git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60025 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 012a523dc77..41e07ba1ae6 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -60,6 +60,7 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) { + BOOLEAN isStdHandle = FALSE; HANDLE hCurrentProcess = GetCurrentProcess(); if ((*new_file) == NULL) { @@ -84,14 +85,17 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) * can, however, emulate dup2 for the standard i/o handles. */ if (hFile == GetStdHandle(STD_ERROR_HANDLE)) { + isStdHandle = TRUE; if (!SetStdHandle(STD_ERROR_HANDLE, old_file->filehand)) return GetLastError(); } else if (hFile == GetStdHandle(STD_OUTPUT_HANDLE)) { + isStdHandle = TRUE; if (!SetStdHandle(STD_OUTPUT_HANDLE, old_file->filehand)) return GetLastError(); } else if (hFile == GetStdHandle(STD_INPUT_HANDLE)) { + isStdHandle = TRUE; if (!SetStdHandle(STD_INPUT_HANDLE, old_file->filehand)) return GetLastError(); } @@ -111,8 +115,11 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) (*new_file)->atime = old_file->atime; (*new_file)->mtime = old_file->mtime; (*new_file)->ctime = old_file->ctime; - ap_register_cleanup((*new_file)->cntxt, (void *)(*new_file), file_cleanup, - ap_null_cleanup); + + if (!isStdHandle) { + ap_register_cleanup((*new_file)->cntxt, (void *)(*new_file), file_cleanup, + ap_null_cleanup); + } return APR_SUCCESS; } From 8f6e7a97272972305307e0fba37764a264dbd621 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 6 May 2000 11:52:27 +0000 Subject: [PATCH 0052/7878] handle OS/390 flavor of pthread_getspecific git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60026 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/threadpriv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 0c74f47841a..95ca7c7bed2 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -78,7 +78,12 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key, ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) { +#ifdef PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS + if (pthread_getspecific(key->key,new)) + *new = NULL; +#else (*new) = pthread_getspecific(key->key); +#endif return APR_SUCCESS; } From 6aa93576aab9ceee3a2dbfd9fb19d1f93355b012 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 6 May 2000 13:41:59 +0000 Subject: [PATCH 0053/7878] serious bug fix: htdigest didn't init the first parm to ap_open(), so ap_open() segfaults thinking it was passed valid storage build portability: make most src/lib/apr/test/Makefile.in compatible with OS/390 make (no -o outfile after infile specified) MD5 translation support: when APR_HAS_XLATE, low-level routines allow translation handle to be specified when CHARSET_EBCDIC, password-specific routines always translate, but client app must set handle before using git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60027 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_md5.h | 13 +++- lib/apr_md5.c | 94 +++++++++++++++++------- test/.cvsignore | 1 + test/Makefile.in | 39 +++++----- test/testmd5.c | 180 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 282 insertions(+), 45 deletions(-) create mode 100644 test/testmd5.c diff --git a/include/apr_md5.h b/include/apr_md5.h index 8f2506bc4bb..4d28d0a62c8 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -82,10 +82,11 @@ * . */ -#ifndef APACHE_MD5_H -#define APACHE_MD5_H +#ifndef APR_MD5_H +#define APR_MD5_H #include "apr_lib.h" +#include "apr_xlate.h" #ifdef __cplusplus extern "C" { @@ -101,9 +102,15 @@ typedef struct { UINT4 state[4]; /* state (ABCD) */ UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ +#if APR_HAS_XLATE + ap_xlate_t *xlate; /* translation handle */ +#endif } ap_md5_ctx_t; API_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context); +#if APR_HAS_XLATE +API_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate); +#endif API_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen); @@ -116,4 +123,4 @@ API_EXPORT(ap_status_t) ap_MD5Encode(const char *password, const char *salt, } #endif -#endif /* !APACHE_MD5_H */ +#endif /* !APR_MD5_H */ diff --git a/lib/apr_md5.c b/lib/apr_md5.c index 6db49eda742..8e70113ef54 100644 --- a/lib/apr_md5.c +++ b/lib/apr_md5.c @@ -144,6 +144,10 @@ static unsigned char PADDING[64] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +#ifdef CHARSET_EBCDIC +static ap_xlate_t *xlate_ebcdic_to_ascii; /* used in ap_MD5Encode() */ +#endif + /* F, G, H and I are basic MD5 functions. */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) @@ -189,9 +193,25 @@ API_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context) context->state[1] = 0xefcdab89; context->state[2] = 0x98badcfe; context->state[3] = 0x10325476; +#if APR_HAS_XLATE + context->xlate = NULL; +#endif return APR_SUCCESS; } +#if APR_HAS_XLATE +/* MD5 translation setup. Provides the APR translation handle + * to be used for translating the content before calculating the + * digest. + */ + +API_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) +{ + context->xlate = xlate; + return APR_SUCCESS; +} +#endif /* APR_HAS_XLATE */ + /* MD5 block update operation. Continues an MD5 message-digest operation, processing another message block, and updating the context. @@ -201,6 +221,9 @@ API_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, unsigned int inputLen) { unsigned int i, idx, partLen; +#if APR_HAS_XLATE + ap_size_t inbytes_left, outbytes_left; +#endif /* Compute number of bytes mod 64 */ idx = (unsigned int) ((context->count[0] >> 3) & 0x3F); @@ -213,7 +236,7 @@ API_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, partLen = 64 - idx; /* Transform as many times as possible. */ -#ifndef CHARSET_EBCDIC +#if !APR_HAS_XLATE if (inputLen >= partLen) { memcpy(&context->buffer[idx], input, partLen); MD5Transform(context->state, context->buffer); @@ -228,15 +251,29 @@ API_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, /* Buffer remaining input */ memcpy(&context->buffer[idx], &input[i], inputLen - i); -#else /*CHARSET_EBCDIC*/ +#else /*APR_HAS_XLATE*/ if (inputLen >= partLen) { - ebcdic2ascii_strictly(&context->buffer[idx], input, partLen); + if (context->xlate) { + inbytes_left = outbytes_left = partLen; + ap_xlate_conv_buffer(context->xlate, input, &inbytes_left, + &context->buffer[idx],&outbytes_left); + } + else { + memcpy(&context->buffer[idx], input, partLen); + } MD5Transform(context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) { - unsigned char inp_tmp[64]; - ebcdic2ascii_strictly(inp_tmp, &input[i], 64); - MD5Transform(context->state, inp_tmp); + if (context->xlate) { + unsigned char inp_tmp[64]; + inbytes_left = outbytes_left = 64; + ap_xlate_conv_buffer(context->xlate, &input[i], &inbytes_left, + inp_tmp, &outbytes_left); + MD5Transform(context->state, inp_tmp); + } + else { + MD5Transform(context->state, &input[i]); + } } idx = 0; @@ -245,8 +282,15 @@ API_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, i = 0; /* Buffer remaining input */ - ebcdic2ascii_strictly(&context->buffer[idx], &input[i], inputLen - i); -#endif /*CHARSET_EBCDIC*/ + if (context->xlate) { + inbytes_left = outbytes_left = inputLen - i; + ap_xlate_conv_buffer(context->xlate, &input[i], &inbytes_left, + &context->buffer[idx], &outbytes_left); + } + else { + memcpy(&context->buffer[idx], &input[i], inputLen - i); + } +#endif /*APR_HAS_XLATE*/ return APR_SUCCESS; } @@ -259,24 +303,13 @@ API_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], unsigned char bits[8]; unsigned int idx, padLen; - /* Save number of bits */ Encode(bits, context->count, 8); -#ifdef CHARSET_EBCDIC - /* XXX: @@@: In order to make this no more complex than necessary, - * this kludge converts the bits[] array using the ascii-to-ebcdic - * table, because the following ap_MD5Update() re-translates - * its input (ebcdic-to-ascii). - * Otherwise, we would have to pass a "conversion" flag to ap_MD5Update() - */ - ascii2ebcdic(bits,bits,8); - - /* Since everything is converted to ascii within ap_MD5Update(), - * the initial 0x80 (PADDING[0]) must be stored as 0x20 - */ - PADDING[0] = os_toebcdic[0x80]; -#endif /*CHARSET_EBCDIC*/ +#if APR_HAS_XLATE + /* ap_MD5Update() should not translate for this final round. */ + context->xlate = NULL; +#endif /*APR_HAS_XLATE*/ /* Pad out to 56 mod 64. */ idx = (unsigned int) ((context->count[0] >> 3) & 0x3f); @@ -413,6 +446,14 @@ static void Decode(UINT4 *output, const unsigned char *input, unsigned int len) (((UINT4) input[j + 2]) << 16) | (((UINT4) input[j + 3]) << 24); } +#ifdef CHARSET_EBCDIC +API_EXPORT(ap_status_t) ap_MD5InitEBCDIC(ap_xlate_t *xlate) +{ + xlate_ebcdic_to_ascii = xlate; + return APR_SUCCESS; +} +#endif + /* * Define the Magic String prefix that identifies a password as being * hashed using our algorithm. @@ -437,7 +478,7 @@ static void to64(char *s, unsigned long v, int n) } API_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, - char *result, size_t nbytes) + char *result, size_t nbytes) { /* * Minimum size is 8 bytes for salt, plus 1 for the trailing NUL, @@ -482,7 +523,10 @@ API_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, * 'Time to make the doughnuts..' */ ap_MD5Init(&ctx); - +#ifdef CHARSET_EBCDIC + ap_MD5SetXlate(&ctx, xlate_ebcdic_to_ascii); +#endif + /* * The password first, since that is what is most unknown */ diff --git a/test/.cvsignore b/test/.cvsignore index 71ba7393632..e84d3bc806b 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -1,4 +1,5 @@ Makefile +testmd5 testmmap htdigest ab diff --git a/test/Makefile.in b/test/Makefile.in index 625dddd7bac..ee088964fe9 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -7,13 +7,14 @@ RM=@RM@ CC=@CC@ RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=-L.. -lapr @LIBS@ +CFLAGS=@CFLAGS@ @OPTIM@ +LIBS=../libapr.a @LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include INCLUDES=-I$(INCDIR) -TARGETS= testfile@EXEEXT@ \ +TARGETS= testmd5@EXEEXT@ \ + testfile@EXEEXT@ \ testproc@EXEEXT@ \ testsock@EXEEXT@ \ testthread@EXEEXT@ \ @@ -28,7 +29,8 @@ TARGETS= testfile@EXEEXT@ \ occhild@EXEEXT@ \ mod_test.so -OBJS= testfile.o \ +OBJS= testmd5.o \ + testfile.o \ testproc.o \ testsock.o \ testthread.o \ @@ -46,14 +48,17 @@ OBJS= testfile.o \ all: $(TARGETS) +testmd5@EXEEXT@: testmd5.o + $(CC) $(CFLAGS) -o testmd5@EXEEXT@ testmd5.o $(LDFLAGS) + testfile@EXEEXT@: testfile.o - $(CC) $(CFLAGS) testfile.o -o testfile@EXEEXT@ $(LDFLAGS) + $(CC) $(CFLAGS) -o testfile@EXEEXT@ testfile.o $(LDFLAGS) testdso@EXEEXT@: testdso.o $(CC) $(CFLAGS) --export-dynamic -fPIC testdso.o -o testdso@EXEEXT@ $(LDFLAGS) testoc@EXEEXT@: testoc.o - $(CC) $(CFLAGS) testoc.o -o testoc@EXEEXT@ $(LDFLAGS) + $(CC) $(CFLAGS) -o testoc@EXEEXT@ testoc.o $(LDFLAGS) occhild.so: occhild.o $(CC) -shared occhild.o -o occhild.so @@ -62,33 +67,33 @@ mod_test.so: mod_test.o $(CC) -shared mod_test.o -o mod_test.so testargs@EXEEXT@: testargs.o - $(CC) $(CFLAGS) testargs.o -o testargs@EXEEXT@ $(LDFLAGS) + $(CC) $(CFLAGS) -o testargs@EXEEXT@ testargs.o $(LDFLAGS) testcontext@EXEEXT@: testcontext.o - $(CC) $(CFLAGS) testcontext.o -o testcontext@EXEEXT@ $(LDFLAGS) + $(CC) $(CFLAGS) -o testcontext@EXEEXT@ testcontext.o $(LDFLAGS) testproc@EXEEXT@: testproc.o - $(CC) $(CFLAGS) testproc.o -o testproc@EXEEXT@ $(LDFLAGS) + $(CC) $(CFLAGS) -o testproc@EXEEXT@ testproc.o $(LDFLAGS) testthread@EXEEXT@: testthread.o - $(CC) $(CFLAGS) testthread.o -o testthread@EXEEXT@ $(LDFLAGS) + $(CC) $(CFLAGS) -o testthread@EXEEXT@ testthread.o $(LDFLAGS) testsock@EXEEXT@: testsock.o client.o server.o - $(CC) $(CFLAGS) testsock.o -o testsock@EXEEXT@ $(LDFLAGS) - $(CC) $(CFLAGS) server.o -o server@EXEEXT@ $(LDFLAGS) - $(CC) $(CFLAGS) client.o -o client@EXEEXT@ $(LDFLAGS) + $(CC) $(CFLAGS) -o testsock@EXEEXT@ testsock.o $(LDFLAGS) + $(CC) $(CFLAGS) -o server@EXEEXT@ server.o $(LDFLAGS) + $(CC) $(CFLAGS) -o client@EXEEXT@ client.o $(LDFLAGS) testtime@EXEEXT@: testtime.o - $(CC) $(CFLAGS) testtime.o -o testtime@EXEEXT@ $(LDFLAGS) + $(CC) $(CFLAGS) -o testtime@EXEEXT@ testtime.o $(LDFLAGS) testmmap@EXEEXT@: testmmap.o - $(CC) $(CFLAGS) testmmap.o -o testmmap@EXEEXT@ $(LDFLAGS) + $(CC) $(CFLAGS) -o testmmap@EXEEXT@ testmmap.o $(LDFLAGS) testshmem@EXEEXT@: testshmem.o - $(CC) $(CFLAGS) testshmem.o -o testshmem@EXEEXT@ $(LDFLAGS) + $(CC) $(CFLAGS) -o testshmem@EXEEXT@ testshmem.o $(LDFLAGS) testpipe@EXEEXT@: testpipe.o - $(CC) $(CFLAGS) testpipe.o -o testpipe@EXEEXT@ $(LDFLAGS) + $(CC) $(CFLAGS) -o testpipe@EXEEXT@ testpipe.o $(LDFLAGS) clean: $(RM) -f *.o *.a *.so $(TARGETS) diff --git a/test/testmd5.c b/test/testmd5.c new file mode 100644 index 00000000000..5c6ce6f2b7d --- /dev/null +++ b/test/testmd5.c @@ -0,0 +1,180 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include +#include + +#include "apr_md5.h" +#include "apr_xlate.h" + +struct testcase { + const char *s; + const char *digest; +}; + +struct testcase testcases[] = +{ + {"Jeff was here!", + "\xa5\x25\x8a\x89\x11\xb2\x9d\x1f\x81\x75\x96\x3b\x60\x94\x49\xc0"}, + {"01234567890aBcDeFASDFGHJKLPOIUYTR" + "POIUYTREWQZXCVBN LLLLLLLLLLLLLLL", + "\xd4\x1a\x06\x2c\xc5\xfd\x6f\x24\x67\x68\x56\x7c\x40\x8a\xd5\x69"}, + {"111111118888888888888888*******%%%%%%%%%%#####" + "142134u8097289720432098409289nkjlfkjlmn,m.. ", + "\xb6\xea\x5b\xe8\xca\x45\x8a\x33\xf0\xf1\x84\x6f\xf9\x65\xa8\xe1"}, + {"01234567890aBcDeFASDFGHJKLPOIUYTR" + "POIUYTREWQZXCVBN LLLLLLLLLLLLLLL" + "01234567890aBcDeFASDFGHJKLPOIUYTR" + "POIUYTREWQZXCVBN LLLLLLLLLLLLLLL" + "1", + "\xd1\xa1\xc0\x97\x8a\x60\xbb\xfb\x2a\x25\x46\x9d\xa5\xae\xd0\xb0"} +}; + +static void try(const void *buf, size_t bufLen, ap_xlate_t *xlate, + const void *digest) +{ + int i; + ap_status_t rv; + ap_md5_ctx_t context; + unsigned char hash[MD5_DIGESTSIZE]; + + rv = ap_MD5Init(&context); + assert(!rv); + + if (xlate) { +#if APR_HAS_XLATE + ap_MD5SetXlate(&context, xlate); +#else + fprintf(stderr, + "A translation handle was unexpected.\n"); +#endif + } + + rv = ap_MD5Update(&context, buf, bufLen); + assert(!rv); + + rv = ap_MD5Final(hash, &context); + assert(!rv); + + for (i = 0; i < MD5_DIGESTSIZE; i++) { + printf("%02x",hash[i]); + } + + printf("\n"); + + if (memcmp(hash, digest, MD5_DIGESTSIZE)) { + fprintf(stderr, + "The digest is not as expected!\n"); +#if 'A' != 0x41 + fprintf(stderr, + "Maybe you didn't tell me what character sets " + "to translate between?\n" + "The expected digest is based on the string " + "being in ASCII.\n"); +#endif + } +} + +int main(int argc, char **argv) +{ + ap_status_t rv; + ap_xlate_t *xlate = NULL; + ap_pool_t *pool; + const char *src = NULL, *dst = NULL; + int cur; + + switch(argc) { + case 1: + break; + case 3: + src = argv[1]; + dst = argv[2]; + break; + default: + fprintf(stderr, + "Usage: %s [src-charset dst-charset]\n", + argv[0]); + exit(1); + } + + rv = ap_initialize(); + assert(!rv); + atexit(ap_terminate); + + rv = ap_create_pool(&pool, NULL); + + if (src) { +#if APR_HAS_XLATE + rv = ap_xlate_open(&xlate, dst, src, pool); + if (rv) { + char buf[80]; + + fprintf(stderr, "ap_xlate_open()->%s (%d)\n", + ap_strerror(rv, buf, sizeof(buf)), rv); + exit(1); + } +#else + fprintf(stderr, + "APR doesn't implement translation for this " + "configuration.\n"); +#endif + } + + for (cur = 0; cur < sizeof(testcases) / sizeof(testcases[0]); cur++) { + try(testcases[cur].s, strlen(testcases[cur].s), xlate, + testcases[cur].digest); + } + + return 0; +} From dad852b7eaea73351bbdf2e4d3f761e78e8d5bff Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 7 May 2000 01:47:08 +0000 Subject: [PATCH 0054/7878] Check for the flavor of pthread_attr_getdetachstate(); normally it has 2 parms; on OS/390 it has one parm (based on some earlier POSIX threads draft?). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60028 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + threadproc/unix/thread.c | 4 ++++ threads.m4 | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/configure.in b/configure.in index bf075be650e..d1862618ce3 100644 --- a/configure.in +++ b/configure.in @@ -356,6 +356,7 @@ else fi APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS +APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG ac_cv_define_READDIR_IS_THREAD_SAFE=no AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE)) diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index d6190d8a7d8..7ba240d4b21 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -93,7 +93,11 @@ ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) { int state; +#ifdef PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG + state = pthread_attr_getdetachstate(attr->attr); +#else pthread_attr_getdetachstate(attr->attr, &state); +#endif if (state == 1) return APR_DETACH; return APR_NOTDETACH; diff --git a/threads.m4 b/threads.m4 index 14cd99c5085..bdff9b9df8e 100644 --- a/threads.m4 +++ b/threads.m4 @@ -53,6 +53,26 @@ if test "$ac_cv_pthread_getspecific_two_args" = "yes"; then AC_DEFINE(PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS, 1, [Define if pthread_getspecific() has two args]) fi +])dnl + +AC_DEFUN(APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG, [ +AC_CACHE_CHECK(whether pthread_attr_getdetachstate takes one argument, ac_cv_pthread_attr_getdetachstate_one_arg,[ +AC_TRY_COMPILE([ +#include +],[ +pthread_attr_t *attr; +pthread_attr_getdetachstate(attr); +],[ + ac_cv_pthread_attr_getdetachstate_one_arg=yes +],[ + ac_cv_pthread_attr_getdetachstate_one_arg=no +]) +]) + +if test "$ac_cv_pthread_attr_getdetachstate_one_arg" = "yes"; then + AC_DEFINE(PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG, 1, [Define if pthread_attr_getdetachstate() has one arg]) +fi + ])dnl dnl dnl PTHREADS_CHECK_COMPILE From e27977975cf92e99cd3fb26421ab9eca079a2443 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 9 May 2000 01:40:14 +0000 Subject: [PATCH 0055/7878] VERY ugly hack of implementing the EXTRA_* settings. Good enough for now, but those evals are painful to look at. No doubt, something more elegant is staring me in the face, but it's been a long day :) We unset all EXTRA_* settings when we first run through these, to prevent them from being constantly added, if we call APR_PRELOAD multiple times.... Zzzzzzzzz PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60029 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/hints.m4 b/hints.m4 index 0608e5fc683..adc8143fbf8 100644 --- a/hints.m4 +++ b/hints.m4 @@ -5,11 +5,36 @@ dnl on previously obtained platform knowledge. dnl We allow all settings to be overridden from dnl the command-line. dnl +dnl We maintain the "format" that we've used +dnl under 1.3.x, so we don't exactly follow +dnl what is "recommended" by autoconf. + +dnl +dnl APR_DOEXTRA +dnl +dnl Handle the use of EXTRA_* variables. +dnl Basically, EXTRA_* vars are added to the +dnl current settings of their "parents". We +dnl can expand as needed. This is ugly +dnl +AC_DEFUN(APR_DOEXTRA, [ + for i in CFLAGS LDFLAGS LIBS + do + XYZ="APR_TMP=\$EXTRA_$i"; eval $XYZ + if test -n "$APR_TMP"; then + XYZ="$i=\"\$$i $APR_TMP\"" + eval $XYZ + eval export $i + eval unset EXTRA_${i} + eval export EXTRA_${i} + fi + done +]) dnl dnl APR_SETIFNULL(variable, value) dnl -dnl Set variable iff it's currently null +dnl Set variable iff it's currently null dnl AC_DEFUN(APR_SETIFNULL,[ if test -z "$$1"; then @@ -20,7 +45,7 @@ AC_DEFUN(APR_SETIFNULL,[ dnl dnl APR_ADDTO(variable, value) dnl -dnl Add value to variable +dnl Add value to variable dnl AC_DEFUN(APR_ADDTO,[ $1="$$1 $2$3$4$5$6$7$8$9"; export $1 @@ -29,8 +54,9 @@ AC_DEFUN(APR_ADDTO,[ dnl dnl APR_PRELOAD dnl -dnl Preload various ENV/makefile paramsm such as CC, CFLAGS, etc -dnl based on outside knowledge +dnl Preload various ENV/makefile paramsm such as CC, CFLAGS, etc +dnl based on outside knowledge +dnl AC_DEFUN(APR_PRELOAD, [ PLAT=`$ac_config_guess` PLAT=`$ac_config_sub $PLAT` @@ -342,4 +368,5 @@ dnl ;; APR_ADDTO(CFLAGS, -U_NO_PROTO) ;; esac +APR_DOEXTRA ]) From 2b6c1d1b81ccfe1043ca21ee8e2d74ae2e356f77 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 9 May 2000 17:01:50 +0000 Subject: [PATCH 0056/7878] fix a bug in the definition of APR_ENOMEM git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60030 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 2628943e682..cd59dfa7995 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -178,7 +178,7 @@ int ap_canonical_error(ap_status_t err); #define APR_ENOSPC (APR_OS_START_CANONERR + 6) #endif -#ifdef ENONOMEM +#ifdef ENOMEM #define APR_ENOMEM ENOMEM #else #define APR_ENOMEM (APR_OS_START_CANONERR + 7) From a4f1bc7b59eec6ad8ab277a94097f9d50fe96055 Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Tue, 9 May 2000 18:56:12 +0000 Subject: [PATCH 0057/7878] Make the hash API nicer when dealing with nul-terminated strings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60031 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 2 ++ lib/apr_hash.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/apr_hash.h b/include/apr_hash.h index f93c4b06ab2..bba7680f9fa 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -92,6 +92,7 @@ B arg 1) The hash table arg 2) Pointer to the key arg 3) Length of the key + If the length is 0 it is assumed to be strlen(key)+1 arg 4) Value to associate with the key If the value is NULL the hash entry is deleted. @@ -109,6 +110,7 @@ B arg 1) The hash table arg 2) Pointer to the key arg 3) Length of the key + If the length is 0 it is assumed to be strlen(key)+1 Returns NULL if the key is not present. diff --git a/lib/apr_hash.c b/lib/apr_hash.c index 5ef3c8faf91..8d31d07f5ff 100644 --- a/lib/apr_hash.c +++ b/lib/apr_hash.c @@ -215,6 +215,9 @@ static ap_hash_entry_t **find_entry(ap_hash_t *ht, int hash; int i; + if (klen == 0) + klen = strlen(key) + 1; + /* * This hash function is used by perl 5; RSE attributes it to DJB. * (See Message-ID: <19991013131827.A17702@engelschall.com> From f29b693f935ddffa1f2ccfaec06855722e40ff47 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 9 May 2000 19:32:56 +0000 Subject: [PATCH 0058/7878] ignore occhild too git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60032 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.cvsignore b/test/.cvsignore index e84d3bc806b..8dee9b7e794 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -17,3 +17,4 @@ server testsock testproc testfile +occhild From 645af109fd954748d19cabd7a69c868c6cef3429 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 10 May 2000 00:15:25 +0000 Subject: [PATCH 0059/7878] src/lib/apr/hints.m4 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60033 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hints.m4 b/hints.m4 index adc8143fbf8..ff6d500fc4e 100644 --- a/hints.m4 +++ b/hints.m4 @@ -20,10 +20,9 @@ dnl AC_DEFUN(APR_DOEXTRA, [ for i in CFLAGS LDFLAGS LIBS do - XYZ="APR_TMP=\$EXTRA_$i"; eval $XYZ + eval APR_TMP=\$EXTRA_$i if test -n "$APR_TMP"; then - XYZ="$i=\"\$$i $APR_TMP\"" - eval $XYZ + eval $i=\"\$$i $APR_TMP\" eval export $i eval unset EXTRA_${i} eval export EXTRA_${i} From 4bde53c48d3dc52337d8e867dd28502f2d715223 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 10 May 2000 19:45:31 +0000 Subject: [PATCH 0060/7878] Add ap_xlate_conv_byte() to convert one char between single-byte character sets. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60034 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/xlate.c | 10 ++++++++++ include/apr_xlate.h | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index ce9db86c58e..d4b0838be4e 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -268,6 +268,16 @@ ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, return status; } +ap_int32_t ap_xlate_conv_byte(ap_xlate_t *convset, unsigned char inchar) +{ + if (convset->sbcs_table) { + return convset->sbcs_table[inchar]; + } + else { + return -1; + } +} + ap_status_t ap_xlate_close(ap_xlate_t *convset) { ap_status_t status; diff --git a/include/apr_xlate.h b/include/apr_xlate.h index 39c891da7fb..df82e520131 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -84,6 +84,8 @@ typedef void ap_xlate_t; #define ap_xlate_conv_buffer(convset, inbuf, inbytes_left, outbuf, \ outbytes_left) APR_ENOTIMPL +#define ap_xlate_conv_byte(convset, inchar) (-1) + /* The purpose of ap_xlate_conv_char is to translate one character * at a time. This needs to be written carefully so that it works * with double-byte character sets. @@ -152,6 +154,23 @@ ap_status_t ap_xlate_conv_char(ap_xlate_t *convset, char inchar, char outchar); /* +=head1 ap_int32_t ap_xlate_conv_byte(ap_xlate_t *convset, unsigned char inchar) + +B + + arg 1) The handle allocated by ap_xlate_open, specifying the parameters + of conversion + arg 2) The single-byte character to convert. + +B: This only works when converting between single-byte character sets. + -1 will be returned if the conversion can't be performed. + +=cut +*/ +ap_int32_t ap_xlate_conv_byte(ap_xlate_t *convset, unsigned char inchar); + +/* + =head1 ap_status_t ap_xlate_close(ap_xlate_t *convset) B From b656010b5d2eea245727180aef165d839fa8f2de Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 11 May 2000 20:34:28 +0000 Subject: [PATCH 0061/7878] repair some compile warnings, axe a wasted getsockname() call and some unnecessary local vars, fix bug in a rare trace of a pid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60035 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index de659feeb24..31bf5c5871a 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -592,8 +592,8 @@ B Date: Fri, 12 May 2000 00:14:43 +0000 Subject: [PATCH 0062/7878] Add ap_sendfile() flag APR_SENDFILE_DISCONNECT_SOCKET to tell TransmitFile it is okay to disconnect the socket after successful send. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60036 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 3 +++ network_io/win32/sendrecv.c | 8 ++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index ca215f5221e..3509f2f5e6c 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -122,6 +122,9 @@ typedef struct ap_hdtr_t ap_hdtr_t; typedef struct in_addr ap_in_addr; #if APR_HAS_SENDFILE +/* Define flags passed in on ap_sendfile() */ +#define APR_SENDFILE_DISCONNECT_SOCKET 1 + /* A structure to encapsulate headers and trailers for ap_sendfile */ struct ap_hdtr_t { struct iovec* headers; diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 33d39fb0713..aca38155355 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -167,14 +167,10 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, int lasterror = APR_SUCCESS; DWORD dwFlags = 0; -#if 0 - if (flags | APR_SENDFILE_KEEP_SOCKET) + if (flags & APR_SENDFILE_DISCONNECT_SOCKET) { dwFlags |= TF_REUSE_SOCKET; - if (flags | APR_SENDFILE_CLOSE_SOCKET) dwFlags |= TF_DISCONNECT; -#else - dwFlags = 0; -#endif + } /* TransmitFile can only send one header and one footer */ memset(&tfb, '\0', sizeof (tfb)); From 34ff6f9ea36327b8a763f4210c054e70bec0b412 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 12 May 2000 03:59:50 +0000 Subject: [PATCH 0063/7878] I'm sure Mr. Stoddard will recognize this, so I'm committing it. Unfortunately it doesn't do a whit of good since it is an APR private required by the windows mpm... argh git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60037 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/misc.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/win32/misc.h b/misc/win32/misc.h index a1acdbccb44..b2d8b4f20a8 100644 --- a/misc/win32/misc.h +++ b/misc/win32/misc.h @@ -133,6 +133,11 @@ DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( #undef GetFileAttributesEx #define GetFileAttributesEx LateGetFileAttributesExA +DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( + IN HANDLE hFile), + (hFile)); +#define CancelIo LateCancelIo + ap_status_t ap_get_oslevel(struct ap_pool_t *, ap_oslevel_e *); #endif /* ! MISC_H */ From add19d00d1ee627fcc39bde7b679b02ab762f951 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 12 May 2000 10:36:40 +0000 Subject: [PATCH 0064/7878] First commit to allow Apache to build with the latest BeOS version. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60038 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/networkio.h | 7 ++++++- network_io/beos/inet_aton.c | 4 ++++ network_io/beos/networkio.h | 7 ++++++- network_io/beos/poll.c | 6 ++++++ network_io/beos/sendrecv.c | 6 +++++- network_io/beos/sockaddr.c | 5 +++++ network_io/beos/sockets.c | 5 +++++ network_io/beos/sockopt.c | 5 +++++ 8 files changed, 42 insertions(+), 3 deletions(-) diff --git a/include/arch/beos/networkio.h b/include/arch/beos/networkio.h index 3966acf433b..b37797cb7d2 100644 --- a/include/arch/beos/networkio.h +++ b/include/arch/beos/networkio.h @@ -52,9 +52,14 @@ * . */ +#ifdef HAVE_NETINET_TCP_H +#include "../unix/network_io.h" +#else + #ifndef NETWORK_IO_H #define NETWORK_IO_H + #include #include #include @@ -109,4 +114,4 @@ ap_int16_t get_event(ap_int16_t); int inet_aton(const char *cp, struct in_addr *addr); #endif /* ! NETWORK_IO_H */ - +#endif diff --git a/network_io/beos/inet_aton.c b/network_io/beos/inet_aton.c index 732019c1177..1489487d8dc 100644 --- a/network_io/beos/inet_aton.c +++ b/network_io/beos/inet_aton.c @@ -68,6 +68,9 @@ * SOFTWARE. */ +#include "apr_private.h" +#ifndef HAVE_NETINET_TCP_H + #include "networkio.h" /* BeOS doesn't yet have it's own inet_aton and Bind won't be ported @@ -171,3 +174,4 @@ int inet_aton(const char *cp, struct in_addr *addr) { addr->s_addr = htonl(val); return (1); } +#endif diff --git a/network_io/beos/networkio.h b/network_io/beos/networkio.h index 3966acf433b..b37797cb7d2 100644 --- a/network_io/beos/networkio.h +++ b/network_io/beos/networkio.h @@ -52,9 +52,14 @@ * . */ +#ifdef HAVE_NETINET_TCP_H +#include "../unix/network_io.h" +#else + #ifndef NETWORK_IO_H #define NETWORK_IO_H + #include #include #include @@ -109,4 +114,4 @@ ap_int16_t get_event(ap_int16_t); int inet_aton(const char *cp, struct in_addr *addr); #endif /* ! NETWORK_IO_H */ - +#endif diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index 82e011ceac8..86b0a009478 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -52,6 +52,10 @@ * . */ +#include "apr_private.h" +#ifdef HAVE_NETINET_TCP_H +#include "../unix/poll.c" +#else #include "networkio.h" /* BeOS R4 doesn't have a poll function, but R5 will have */ @@ -216,3 +220,5 @@ ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key, return APR_ENOFILE; } } +#endif + diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 2cccb0b9b7e..8d52f8d988a 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -52,6 +52,10 @@ * . */ +#include "apr_private.h" +#ifdef HAVE_NETINET_TCP_H +#include "../unix/sendrecv.c" +#else #include "networkio.h" static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) @@ -143,4 +147,4 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) (*len) = rv; return APR_SUCCESS; } - +#endif diff --git a/network_io/beos/sockaddr.c b/network_io/beos/sockaddr.c index e880fc364e1..76fd25d2ed8 100644 --- a/network_io/beos/sockaddr.c +++ b/network_io/beos/sockaddr.c @@ -52,6 +52,10 @@ * . */ +#include "apr_private.h" +#ifdef HAVE_NETINET_TCP_H +#include "../unix/sockaddr.c" +#else #include "networkio.h" ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) @@ -176,3 +180,4 @@ ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *soc *name = sock->remote_addr; return APR_SUCCESS; } +#endif \ No newline at end of file diff --git a/network_io/beos/sockets.c b/network_io/beos/sockets.c index 5a8afa6257e..f6f109e20f2 100644 --- a/network_io/beos/sockets.c +++ b/network_io/beos/sockets.c @@ -52,6 +52,10 @@ * . */ +#include "apr_private.h" +#ifdef HAVE_NETINET_TCP_H +#include "../unix/sockets.c" +#else #include "networkio.h" ap_status_t socket_cleanup(void *sock) @@ -231,3 +235,4 @@ ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, (*sock)->socketdes = *thesock; return APR_SUCCESS; } +#endif \ No newline at end of file diff --git a/network_io/beos/sockopt.c b/network_io/beos/sockopt.c index 6472fe4eed7..9710ff2def5 100644 --- a/network_io/beos/sockopt.c +++ b/network_io/beos/sockopt.c @@ -52,6 +52,10 @@ * . */ +#include "apr_private.h" +#ifdef HAVE_NETINET_TCP_H +#include "../unix/sockopt.c" +#else #include "networkio.h" ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) @@ -110,3 +114,4 @@ ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) /* on BeOS h_errno is a global... */ return h_errno; } +#endif \ No newline at end of file From 8c132bc919b1820a05b7bc273fcb3a9d14f40cde Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 12 May 2000 10:38:34 +0000 Subject: [PATCH 0065/7878] The latest BeOS version uses the unix network code, so make the changes to allow it to work. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60039 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 45f64a5f5ef..26f7f0a9942 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -128,6 +128,7 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) } } if (opt & APR_SO_NONBLOCK) { +#ifndef BEOS if (on) { if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) return stat; @@ -136,6 +137,11 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) return stat; } +#else + stat = setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(int)); + if (stat != 0) + return stat; +#endif } if (opt & APR_SO_LINGER) { li.l_onoff = on; From 4bdb4d483aac805980ce812bbc0932d69b048117 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 12 May 2000 15:32:37 +0000 Subject: [PATCH 0066/7878] Create a true misc.c for ap_get_oslevel and ap_load_dll_func, and clean up the naming of the entire LoadLateDll declaration. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60040 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++ aprlib.dsp | 4 ++ misc/win32/misc.c | 137 +++++++++++++++++++++++++++++++++++++++++++++ misc/win32/misc.h | 28 ++++----- misc/win32/start.c | 80 -------------------------- 5 files changed, 159 insertions(+), 94 deletions(-) create mode 100644 misc/win32/misc.c diff --git a/apr.dsp b/apr.dsp index b4ab2761121..05fac6e52e2 100644 --- a/apr.dsp +++ b/apr.dsp @@ -162,6 +162,10 @@ SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File +SOURCE=.\misc\win32\misc.c +# End Source File +# Begin Source File + SOURCE=.\misc\win32\names.c # End Source File # Begin Source File diff --git a/aprlib.dsp b/aprlib.dsp index b4ab2761121..05fac6e52e2 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -162,6 +162,10 @@ SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File +SOURCE=.\misc\win32\misc.c +# End Source File +# Begin Source File + SOURCE=.\misc\win32\names.c # End Source File # Begin Source File diff --git a/misc/win32/misc.c b/misc/win32/misc.c new file mode 100644 index 00000000000..79235604f4a --- /dev/null +++ b/misc/win32/misc.c @@ -0,0 +1,137 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_private.h" +#include "misc.h" + +ap_status_t ap_get_oslevel(ap_pool_t *cont, ap_oslevel_e *level) +{ + static OSVERSIONINFO oslev; + static unsigned int servpack = 0; + static BOOL first = TRUE; + char *pservpack; + + if (first) { + first = FALSE; + oslev.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&oslev); + if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) { + for (pservpack = oslev.szCSDVersion; + *pservpack && !isdigit(*pservpack); pservpack++) + ; + if (*pservpack) + servpack = atoi(pservpack); + } + } + if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) { + if (oslev.dwMajorVersion == 5) { + (*level) = APR_WIN_2000; + } + else if (oslev.dwMajorVersion == 4) { + if (servpack >= 6) { + (*level) = APR_WIN_NT_4_SP6; + } + else if (servpack >= 4) { + (*level) = APR_WIN_NT_4_SP4; + } + else if (servpack >= 3) { + (*level) = APR_WIN_NT_4_SP3; + } + else if (servpack >= 2) { + (*level) = APR_WIN_NT_4_SP2; + } + else { + (*level) = APR_WIN_NT_4; + } + } + else { + (*level) = APR_WIN_NT; + } + return APR_SUCCESS; + } + else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { + if (oslev.dwMinorVersion == 0) { + (*level) = APR_WIN_95; + return APR_SUCCESS; + } + else if (oslev.dwMinorVersion > 0) { + (*level) = APR_WIN_98; + return APR_SUCCESS; + } + } + return APR_EEXIST; +} + + +/* This is the helper code to resolve late bound entry points + * missing from one or more releases of the Win32 API + */ + +static const char* const lateDllName[DLL_defined] = { + "kernel32", "advapi32", "mswsock", "ws2_32" }; +static HMODULE lateDllHandle[DLL_defined] = { + NULL, NULL, NULL, NULL }; + +FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char* fnName, int ordinal) +{ + if (!lateDllHandle[fnLib]) { + lateDllHandle[fnLib] = LoadLibrary(lateDllName[fnLib]); + if (!lateDllHandle[fnLib]) + return NULL; + } + if (ordinal) + return GetProcAddress(lateDllHandle[fnLib], (char *) ordinal); + else + return GetProcAddress(lateDllHandle[fnLib], fnName); +} diff --git a/misc/win32/misc.h b/misc/win32/misc.h index b2d8b4f20a8..5ddb2d2ffad 100644 --- a/misc/win32/misc.h +++ b/misc/win32/misc.h @@ -94,23 +94,23 @@ typedef enum { DLL_defined = 4 // must define as last idx_ + 1 } ap_dlltoken_e; -FARPROC LoadLateDllFunc(ap_dlltoken_e fnLib, char *fnName, int ordinal); +FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char *fnName, int ordinal); -/* The LateFunctionName call WILL fault if the function cannot be loaded */ +/* The ap_load_dll_func call WILL fault if the function cannot be loaded */ -#define DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ - typedef rettype (calltype *fpt##fn) args; \ - static fpt##fn pfn##fn = NULL; \ - __inline rettype Late##fn args \ - { if (!pfn##fn) \ - pfn##fn = (fpt##fn) LoadLateDllFunc(lib, #fn, ord); \ - return (*(pfn##fn)) names; }; \ +#define AP_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ + typedef rettype (calltype *ap_winapi_fpt_##fn) args; \ + static ap_winapi_fpt_##fn ap_winapi_pfn_##fn = NULL; \ + __inline rettype ap_winapi_##fn args \ + { if (!ap_winapi_pfn_##fn) \ + ap_winapi_pfn_##fn = (ap_winapi_fpt_##fn) ap_load_dll_func(lib, #fn, ord); \ + return (*(ap_winapi_pfn_##fn)) names; }; \ /* Provide late bound declarations of every API function missing from * one or more supported releases of the Win32 API * * lib is the enumerated token from ap_dlltoken_e, and must correspond - * to the string table entry in start.c used by the LoadLateDllFunc(). + * to the string table entry in start.c used by the ap_load_dll_func(). * Token names (attempt to) follow Windows.h declarations prefixed by DLL_ * in order to facilitate comparison. Use the exact declaration syntax * and names from Windows.h to prevent ambigutity and bugs. @@ -125,18 +125,18 @@ FARPROC LoadLateDllFunc(ap_dlltoken_e fnLib, char *fnName, int ordinal); * In the case of non-text functions, simply #define the original name */ -DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( +AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( IN LPCSTR lpFileName, IN GET_FILEEX_INFO_LEVELS fInfoLevelId, OUT LPVOID lpFileInformation), (lpFileName, fInfoLevelId, lpFileInformation)); #undef GetFileAttributesEx -#define GetFileAttributesEx LateGetFileAttributesExA +#define GetFileAttributesEx ap_winapi_GetFileAttributesExA -DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( +AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( IN HANDLE hFile), (hFile)); -#define CancelIo LateCancelIo +#define CancelIo ap_winapi_CancelIo ap_status_t ap_get_oslevel(struct ap_pool_t *, ap_oslevel_e *); diff --git a/misc/win32/start.c b/misc/win32/start.c index a780edf047a..fa35f8f2604 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -96,64 +96,6 @@ ap_status_t ap_destroy_context(ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_get_oslevel(ap_pool_t *cont, ap_oslevel_e *level) -{ - static OSVERSIONINFO oslev; - static unsigned int servpack = 0; - static BOOL first = TRUE; - char *pservpack; - - if (first) { - first = FALSE; - oslev.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&oslev); - if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) { - for (pservpack = oslev.szCSDVersion; - *pservpack && !isdigit(*pservpack); pservpack++) - ; - if (*pservpack) - servpack = atoi(pservpack); - } - } - if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) { - if (oslev.dwMajorVersion == 5) { - (*level) = APR_WIN_2000; - } - else if (oslev.dwMajorVersion == 4) { - if (servpack >= 6) { - (*level) = APR_WIN_NT_4_SP6; - } - else if (servpack >= 4) { - (*level) = APR_WIN_NT_4_SP4; - } - else if (servpack >= 3) { - (*level) = APR_WIN_NT_4_SP3; - } - else if (servpack >= 2) { - (*level) = APR_WIN_NT_4_SP2; - } - else { - (*level) = APR_WIN_NT_4; - } - } - else { - (*level) = APR_WIN_NT; - } - return APR_SUCCESS; - } - else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { - if (oslev.dwMinorVersion == 0) { - (*level) = APR_WIN_95; - return APR_SUCCESS; - } - else if (oslev.dwMinorVersion > 0) { - (*level) = APR_WIN_98; - return APR_SUCCESS; - } - } - return APR_EEXIST; -} - ap_status_t ap_set_userdata(void *data, char *key, ap_status_t (*cleanup) (void *), ap_pool_t *cont) @@ -208,28 +150,6 @@ ap_status_t ap_get_userdata(void **data, char *key, ap_pool_t *cont) return APR_ENOPOOL; } -/* This is the helper code to resolve late bound entry points - * missing from one or more releases of the Win32 API - */ - -static const char* const lateDllName[DLL_defined] = { - "kernel32", "advapi32", "mswsock", "ws2_32" }; -static HMODULE lateDllHandle[DLL_defined] = { - NULL, NULL, NULL, NULL }; - -FARPROC LoadLateDllFunc(ap_dlltoken_e fnLib, char* fnName, int ordinal) -{ - if (!lateDllHandle[fnLib]) { - lateDllHandle[fnLib] = LoadLibrary(lateDllName[fnLib]); - if (!lateDllHandle[fnLib]) - return NULL; - } - if (ordinal) - return GetProcAddress(lateDllHandle[fnLib], (char *) ordinal); - else - return GetProcAddress(lateDllHandle[fnLib], fnName); -} - /* This puts one thread in a Listen for signals mode */ ap_status_t ap_initialize(void) { From 059f8a3d249dc5de24b8f0d12035931fd26d9761 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 13 May 2000 08:11:58 +0000 Subject: [PATCH 0067/7878] OS/2: Fix return code on failure to create a file handle's mutex lock. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60041 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index b65805c546b..081cee791e7 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -102,7 +102,7 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil rv = ap_create_lock(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cntxt); if (rv) - return APR_OS2_STATUS(rv); + return rv; } if (flag & APR_CREATE) { From b51dffe97e474a58b4789774ddeb3479958f3dc7 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 16 May 2000 16:43:53 +0000 Subject: [PATCH 0068/7878] Remove the check for pthread_sigmask. This function is never used inside APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60042 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.in b/configure.in index d1862618ce3..3db37293946 100644 --- a/configure.in +++ b/configure.in @@ -130,7 +130,6 @@ AC_CHECK_LIB(truerand,main) dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. -AC_CHECK_FUNCS(pthread_sigmask) AC_CHECK_FUNCS(strcasecmp stricmp poll setsid) AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) AC_CHECK_FUNCS(writev) From c6825b8dfcb0a88a2f9fe6135a5292cb4f34edb3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 16 May 2000 16:55:24 +0000 Subject: [PATCH 0069/7878] Remove Beos specific file_io directory. The file that was left there was basically just an old version of the file from Unix, so BeOS should be using the Unix routines directly for file_io. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60043 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/beos/Makefile.in | 62 ------- file_io/beos/file_io_common.c | 73 -------- file_io/beos/readwrite.c | 334 ---------------------------------- 3 files changed, 469 deletions(-) delete mode 100644 file_io/beos/Makefile.in delete mode 100644 file_io/beos/file_io_common.c delete mode 100644 file_io/beos/readwrite.c diff --git a/file_io/beos/Makefile.in b/file_io/beos/Makefile.in deleted file mode 100644 index 64cdff57bfa..00000000000 --- a/file_io/beos/Makefile.in +++ /dev/null @@ -1,62 +0,0 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../include -I../unix -INCLUDES=-I$(INCDIR) -I. - -LIB=libfile.a - -OBJS=file_io_common.o readwrite.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(LIB) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# -depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new - -# DO NOT REMOVE -file_io_common.o: file_io_common.c ../unix/dir.c ../unix/fileio.h \ - ../../include/apr_private.h ../../include/apr_general.h \ - ../../include/apr.h ../../include/apr_errno.h \ - ../../include/apr_file_io.h ../../include/apr_lib.h \ - ../../include/apr_portable.h ../../include/apr_thread_proc.h \ - ../../include/apr_network_io.h ../../include/apr_lock.h \ - ../../include/apr_time.h ../unix/fileacc.c ../unix/filedup.c \ - ../unix/filestat.c ../unix/open.c ../unix/pipe.c ../unix/seek.c -readwrite.o: readwrite.c ../unix/fileio.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_file_io.h \ - ../../include/apr_lib.h diff --git a/file_io/beos/file_io_common.c b/file_io/beos/file_io_common.c deleted file mode 100644 index 63ffac03e9d..00000000000 --- a/file_io/beos/file_io_common.c +++ /dev/null @@ -1,73 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* common.c */ - -/* The code used in readwrite.c in the Unix directory won't work on - BeOS so I've moved to using a common.c file for all the common - code. */ - -#include "../unix/dir.c" - -#include "../unix/fileacc.c" - -#include "../unix/filedup.c" - -#include "../unix/filestat.c" - -#include "../unix/open.c" - -#include "../unix/pipe.c" - -#include "../unix/seek.c" diff --git a/file_io/beos/readwrite.c b/file_io/beos/readwrite.c deleted file mode 100644 index 96aaf5247db..00000000000 --- a/file_io/beos/readwrite.c +++ /dev/null @@ -1,334 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "../unix/fileio.h" - -ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) -{ - ap_ssize_t rv; - ap_ssize_t bytes_read; - - if(*nbytes <= 0) { - *nbytes = 0; - return APR_SUCCESS; - } - - if (thefile->buffered) { - char *pos = (char *)buf; - ap_uint64_t blocksize; - ap_uint64_t size = *nbytes; - - ap_lock(thefile->thlock); - - if (thefile->direction == 1) { - ap_flush(thefile); - thefile->bufpos = 0; - thefile->direction = 0; - thefile->dataRead = 0; - } - - rv = 0; - while (rv == 0 && size > 0) { - if (thefile->bufpos >= thefile->dataRead) { - thefile->dataRead = read(thefile->filedes, thefile->buffer, APR_FILE_BUFSIZE); - if (thefile->dataRead == 0) { - thefile->eof_hit = TRUE; - break; - } - thefile->filePtr += thefile->dataRead; - thefile->bufpos = 0; - } - - blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size; memcpy(pos, thefile->buffer + thefile->bufpos, blocksize); - thefile->bufpos += blocksize; - pos += blocksize; - size -= blocksize; - } - - *nbytes = rv == 0 ? pos - (char *)buf : 0; - ap_unlock(thefile->thlock); - return rv; - } - else { - bytes_read = 0; - if (thefile->ungetchar != -1) { - bytes_read = 1; - *(char *)buf = (char)thefile->ungetchar; - buf = (char *)buf + 1; - (*nbytes)--; - thefile->ungetchar = -1; - if (*nbytes == 0) { - *nbytes = bytes_read; - return APR_SUCCESS; - } - } - do { - rv = read(thefile->filedes, buf, *nbytes); - } while (rv == -1 && errno == EINTR); - *nbytes = bytes_read; - if (rv == 0) { - return APR_EOF; - } - if (rv > 0) { - *nbytes += rv; - return APR_SUCCESS; - } - return errno; - } -} - -ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) -{ - ap_size_t rv; - - if (thefile->buffered) { - char *pos = (char *)buf; - int blocksize; - int size = *nbytes; - - ap_lock(thefile->thlock); - - if ( thefile->direction == 0 ) { - /* Position file pointer for writing at the offset we are - * logically reading from - */ - ap_int64_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; - if (offset != thefile->filePtr) - lseek(thefile->filedes, offset, SEEK_SET); - thefile->bufpos = thefile->dataRead = 0; - thefile->direction = 1; - } - - rv = 0; - while (rv == 0 && size > 0) { - if (thefile->bufpos == APR_FILE_BUFSIZE) /* write buffer is full*/ - ap_flush(thefile); - - blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? - APR_FILE_BUFSIZE - thefile->bufpos : size; - memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); thefile->bufpos += blocksize; - pos += blocksize; - size -= blocksize; - } - - ap_unlock(thefile->thlock); - return rv; - } - else { - do { - rv = write(thefile->filedes, buf, *nbytes); - } while (rv == (ap_size_t)-1 && errno == EINTR); - - if (rv == (ap_size_t)-1) { - (*nbytes) = 0; - return errno; - } - *nbytes = rv; - return APR_SUCCESS; - } -} - -ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, - ap_size_t nvec, ap_ssize_t *nbytes) -{ - int bytes; - - if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { - *nbytes = 0; - return errno; - } - else { - *nbytes = bytes; - return APR_SUCCESS; - } -} - -ap_status_t ap_putc(char ch, ap_file_t *thefile) -{ - if (write(thefile->filedes, &ch, 1) != 1) { - return errno; - } - return APR_SUCCESS; -} - -ap_status_t ap_ungetc(char ch, ap_file_t *thefile) -{ - thefile->ungetchar = (unsigned char)ch; - return APR_SUCCESS; -} - -ap_status_t ap_getc(char *ch, ap_file_t *thefile) -{ - ssize_t rv; - - if (thefile->ungetchar != -1) { - *ch = (char) thefile->ungetchar; - thefile->ungetchar = -1; - return APR_SUCCESS; - } - rv = read(thefile->filedes, ch, 1); - if (rv == 0) { - thefile->eof_hit = TRUE; - return APR_EOF; - } - else if (rv != 1) { - return errno; - } - return APR_SUCCESS; -} - -ap_status_t ap_puts(char *str, ap_file_t *thefile) -{ - ssize_t rv; - int len; - - len = strlen(str); - rv = write(thefile->filedes, str, len); - if (rv != len) { - return errno; - } - return APR_SUCCESS; -} - -ap_status_t ap_flush(ap_file_t *thefile) -{ - if (thefile->buffered) { - ap_int64_t written = 0; - int rc = 0; - - if (thefile->direction == 1 && thefile->bufpos) { - written= write(thefile->filedes, thefile->buffer, thefile->bufpos); - thefile->filePtr += written; - - if (rc == 0) - thefile->bufpos = 0; - } - - return rc; - } - /* There isn't anything to do if we aren't buffering the output - * so just return success. - */ - return APR_SUCCESS; -} - -ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) -{ - ssize_t rv; - int i, used_unget = FALSE, beg_idx; - - if(len <= 1) /* as per fgets() */ - return APR_SUCCESS; - - if(thefile->ungetchar != -1){ - str[0] = thefile->ungetchar; - used_unget = TRUE; - beg_idx = 1; - if(str[0] == '\n' || str[0] == '\r'){ - thefile->ungetchar = -1; - str[1] = '\0'; - return APR_SUCCESS; - } - } else - beg_idx = 0; - - for (i = beg_idx; i < len; i++) { - rv = read(thefile->filedes, &str[i], 1); - if (rv == 0) { - thefile->eof_hit = TRUE; - if(used_unget) thefile->filedes = -1; - str[i] = '\0'; - return APR_EOF; - } - else if (rv != 1) { - return errno; - } - if (str[i] == '\n' || str[i] == '\r') - break; - } - if (i < len-1) - str[i+1] = '\0'; - return APR_SUCCESS; -} - -#if 0 /* not currently used */ -static int printf_flush(ap_vformatter_buff_t *vbuff) -{ - /* I would love to print this stuff out to the file, but I will - * get that working later. :) For now, just return. - */ - return -1; -} -#endif - -API_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) -{ - int cc; - va_list ap; - char *buf; - int len; - - buf = malloc(HUGE_STRING_LEN); - if (buf == NULL) { - return 0; - } - va_start(ap, format); - len = ap_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = ap_puts(buf, fptr); - va_end(ap); - free(buf); - return (cc == APR_SUCCESS) ? len : -1; -} - - From 88fa95d13bdd8b7ec23542e67a009b9e81d0fb0a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 16 May 2000 17:01:02 +0000 Subject: [PATCH 0070/7878] Add a couple of necessary brackets to the windows version of getopt (this may be removed soon and Windows will just use the Unix version). I do not personally see how this was ever working correctly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60044 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/getopt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/misc/win32/getopt.c b/misc/win32/getopt.c index ee086dd5d35..7a5b369e97c 100644 --- a/misc/win32/getopt.c +++ b/misc/win32/getopt.c @@ -72,9 +72,10 @@ ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap * if the user didn't specify '-' as an option, * assume it means -1. */ - if (ap_optopt == (int) '-') + if (ap_optopt == (int) '-') { *rv = ap_optopt; return (APR_EOF); + } if (!*place) ++ap_optind; if (ap_opterr && *ostr != ':') { @@ -98,9 +99,10 @@ ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap ap_optarg = place; else if (nargc <= ++ap_optind) { /* no arg */ place = EMSG; - if (*ostr == ':') + if (*ostr == ':') { *rv = ap_optopt; return (APR_BADARG); + } if (ap_opterr) { if (!(p = strrchr(*nargv, '/'))) p = *nargv; From f93a5e16a3f09ed75b133ac7e88c86b2bd48bf80 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 16 May 2000 17:04:09 +0000 Subject: [PATCH 0071/7878] Remove the separate beos directory and add support to the unix directory for BeOS support. The diffs are minimal, and this makes it much easier to find and fix bugs, without duplicating nearly as much code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60045 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/misc.h | 5 +- include/arch/win32/misc.h | 5 +- misc/beos/Makefile.in | 61 ------------- misc/beos/misc.h | 97 -------------------- misc/beos/misc_common.c | 64 -------------- misc/beos/otherchild.c | 180 -------------------------------------- misc/beos/start.c | 153 -------------------------------- misc/unix/getopt.c | 6 +- misc/unix/misc.h | 5 +- misc/unix/otherchild.c | 16 ++-- 10 files changed, 22 insertions(+), 570 deletions(-) delete mode 100644 misc/beos/Makefile.in delete mode 100644 misc/beos/misc.h delete mode 100644 misc/beos/misc_common.c delete mode 100644 misc/beos/otherchild.c delete mode 100644 misc/beos/start.c diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index bb754bbf62e..736eb60df78 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -77,6 +77,9 @@ #ifdef HAVE_PTHREAD_H #include #endif +#ifdef BEOS +#include +#endif typedef struct datastruct { void *data; @@ -87,7 +90,7 @@ typedef struct datastruct { struct ap_other_child_rec_t { struct ap_other_child_rec_t *next; - int pid; + int id; /* This is either a pid or tid depending on the platform */ void (*maintenance) (int, void *, int); void *data; int write_fd; diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index bb754bbf62e..736eb60df78 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -77,6 +77,9 @@ #ifdef HAVE_PTHREAD_H #include #endif +#ifdef BEOS +#include +#endif typedef struct datastruct { void *data; @@ -87,7 +90,7 @@ typedef struct datastruct { struct ap_other_child_rec_t { struct ap_other_child_rec_t *next; - int pid; + int id; /* This is either a pid or tid depending on the platform */ void (*maintenance) (int, void *, int); void *data; int write_fd; diff --git a/misc/beos/Makefile.in b/misc/beos/Makefile.in deleted file mode 100644 index 7fbb627843a..00000000000 --- a/misc/beos/Makefile.in +++ /dev/null @@ -1,61 +0,0 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../include -INCDIR1=../../file_io/unix -I../../locks/beos -I../../threadproc/beos - -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. - -LIB=libmisc.a - -OBJS=misc_common.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(LIB) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# -depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new - -# DO NOT REMOVE -getopt.o: getopt.c misc.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_file_io.h \ - ../../include/apr_getopt.h -start.o: start.c misc.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_file_io.h \ - ../../include/apr_getopt.h diff --git a/misc/beos/misc.h b/misc/beos/misc.h deleted file mode 100644 index 7c99c206a83..00000000000 --- a/misc/beos/misc.h +++ /dev/null @@ -1,97 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef MISC_H -#define MISC_H - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_getopt.h" -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_SIGNAL_H -#include -#endif - -#include - -typedef struct datastruct { - void *data; - char *key; - struct datastruct *next; - struct datastruct *prev; -} datastruct; - -struct ap_other_child_rec_t { - struct ap_other_child_rec_t *next; - thread_id pid; /* this is actually a thread_id, but in order to - restrict the amount of code duplication we'll use - pid so that the Unix code won't have too many #ifdef's - */ - void (*maintenance) (int, void *); - void *data; - int write_fd; -}; - - -#endif /* ! MISC_H */ - diff --git a/misc/beos/misc_common.c b/misc/beos/misc_common.c deleted file mode 100644 index 86a11c4cfc2..00000000000 --- a/misc/beos/misc_common.c +++ /dev/null @@ -1,64 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* BeOS uses identical code so let's not have 2 copies... */ - -#include "../unix/start.c" - -#include "../unix/getopt.c" - -#include "../unix/otherchild.c" - -#include "../unix/canonerr.c" -#include "../unix/errorcodes.c" diff --git a/misc/beos/otherchild.c b/misc/beos/otherchild.c deleted file mode 100644 index 1239eedbc69..00000000000 --- a/misc/beos/otherchild.c +++ /dev/null @@ -1,180 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "misc.h" -#include "../../threadproc/beos/threadproc.h" - -static ap_other_child_rec_t *other_children = NULL; - -API_EXPORT(void) ap_register_other_child(ap_proc_t *pid, - void (*maintenance) (int reason, void *), - void *data, int write_fd, ap_pool_t *p) -{ - ap_other_child_rec_t *ocr; - - ocr = ap_palloc(p, sizeof(*ocr)); - ocr->tid = pid->tid; - ocr->maintenance = maintenance; - ocr->data = data; - ocr->write_fd = write_fd; - ocr->next = other_children; - other_children = ocr; -} - -API_EXPORT(void) ap_unregister_other_child(void *data) -{ - ap_other_child_rec_t **pocr, *nocr; - - for (pocr = &other_children; *pocr; pocr = &(*pocr)->next) { - if ((*pocr)->data == data) { - nocr = (*pocr)->next; - (*(*pocr)->maintenance) (APR_OC_REASON_UNREGISTER, (*pocr)->data); - *pocr = nocr; - /* XXX: um, well we've just wasted some space in pconf ? */ - return; - } - } -} - -/* test to ensure that the write_fds are all still writable, otherwise - * invoke the maintenance functions as appropriate */ -static void probe_writable_fds(void) -{ - fd_set writable_fds; - int fd_max; - ap_other_child_rec_t *ocr, *nocr; - struct timeval tv; - int rc; - - if (other_children == NULL) - return; - - fd_max = 0; - FD_ZERO(&writable_fds); - do { - for (ocr = other_children; ocr; ocr = ocr->next) { - if (ocr->write_fd == -1) - continue; - FD_SET(ocr->write_fd, &writable_fds); - if (ocr->write_fd > fd_max) { - fd_max = ocr->write_fd; - } - } - if (fd_max == 0) - return; - - tv.tv_sec = 0; - tv.tv_usec = 0; - rc = select(fd_max + 1, NULL, &writable_fds, NULL, &tv); - } while (rc == -1 && errno == EINTR); - - if (rc == -1) { - /* XXX: uhh this could be really bad, we could have a bad file - * descriptor due to a bug in one of the maintenance routines */ - return; - } - if (rc == 0) - return; - - for (ocr = other_children; ocr; ocr = nocr) { - nocr = ocr->next; - if (ocr->write_fd == -1) - continue; - if (FD_ISSET(ocr->write_fd, &writable_fds)) - continue; - (*ocr->maintenance) (APR_OC_REASON_UNWRITABLE, ocr->data); - } -} - -API_EXPORT(ap_status_t) reap_other_child(ap_proc_t *pid) -{ - ap_other_child_rec_t *ocr, *nocr; - - for (ocr = other_children; ocr; ocr = nocr) { - nocr = ocr->next; - if (ocr->tid != pid->tid) - continue; - ocr->tid = -1; - (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data); - return 0; - } - return APR_CHILD_NOTDONE; -} - -API_EXPORT(void) check_other_child(void) -{ - ap_other_child_rec_t *ocr, *nocr; - pid_t waitret; - - for (ocr = other_children; ocr; ocr = nocr) { - nocr = ocr->next; - if (ocr->tid == -1) - continue; - - waitret = waitpid(ocr->tid, NULL, WNOHANG); - if (waitret == ocr->tid) { - ocr->tid = -1; - (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data); - } - else if (waitret == 0) { - (*ocr->maintenance) (APR_OC_REASON_RESTART, ocr->data); - } - else if (waitret == -1) { - /* uh what the heck? they didn't call unregister? */ - ocr->tid = -1; - (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data); - } - } -} - diff --git a/misc/beos/start.c b/misc/beos/start.c deleted file mode 100644 index f46f1bfe53b..00000000000 --- a/misc/beos/start.c +++ /dev/null @@ -1,153 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "misc.h" - -ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont) -{ - ap_pool_t *new; - ap_pool_t *pool; - - if (cont) { - pool = ap_make_sub_pool(cont->pool, cont->apr_abort); - } - else { - pool = ap_make_sub_pool(NULL, NULL); - } - - if (pool == NULL) { - return APR_ENOPOOL; - } - - new = (ap_pool_t *)ap_palloc(cont, sizeof(ap_pool_t)); - - new->pool = pool; - new->prog_data = NULL; - - *newcont = new; - return APR_SUCCESS; -} - -ap_status_t ap_destroy_context(ap_pool_t *cont) -{ - ap_destroy_pool(cont); - return APR_SUCCESS; -} - -ap_status_t ap_set_userdata(void *data, char *key, - ap_status_t (*cleanup) (void *), - ap_pool_t *cont) -{ - datastruct *dptr = NULL, *dptr2 = NULL; - if (cont) { - dptr = cont->prog_data; - while (dptr) { - if (!strcmp(dptr->key, key)) - break; - dptr2 = dptr; - dptr = dptr->next; - } - if (dptr == NULL) { - dptr = ap_palloc(cont, sizeof(datastruct)); - dptr->next = dptr->prev = NULL; - dptr->key = ap_pstrdup(cont, key); - if (dptr2) { - dptr2->next = dptr; - dptr->prev = dptr2; - } - else { - cont->prog_data = dptr; - } - } - dptr->data = data; - ap_register_cleanup(cont, dptr->data, cleanup, cleanup); - return APR_SUCCESS; - } - return APR_ENOPOOL; -} - -ap_status_t ap_get_userdata(void **data, char *key, ap_pool_t *cont) -{ - datastruct *dptr = NULL; - if (cont) { - dptr = cont->prog_data; - while (dptr) { - if (!strcmp(dptr->key, key)) { - break; - } - dptr = dptr->next; - } - if (dptr) { - (*data) = dptr->data; - } - else { - (*data) = NULL; - } - return APR_SUCCESS; - } - return APR_ENOPOOL; -} - -ap_status_t ap_initialize(void) -{ - ap_status_t status; - status = ap_init_alloc(); - return status; -} - -void ap_terminate(void) -{ - ap_term_alloc(); -} - diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 940e5b61217..0272e2c5b11 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -67,8 +67,7 @@ ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap * if the user didn't specify '-' as an option, * assume it means -1. */ - if (ap_optopt == (int) '-') - { + if (ap_optopt == (int) '-') { *rv = ap_optopt; return (APR_EOF); } @@ -95,8 +94,7 @@ ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap ap_optarg = place; else if (nargc <= ++ap_optind) { /* no arg */ place = EMSG; - if (*ostr == ':') - { + if (*ostr == ':') { *rv = ap_optopt; return (APR_BADARG); } diff --git a/misc/unix/misc.h b/misc/unix/misc.h index bb754bbf62e..736eb60df78 100644 --- a/misc/unix/misc.h +++ b/misc/unix/misc.h @@ -77,6 +77,9 @@ #ifdef HAVE_PTHREAD_H #include #endif +#ifdef BEOS +#include +#endif typedef struct datastruct { void *data; @@ -87,7 +90,7 @@ typedef struct datastruct { struct ap_other_child_rec_t { struct ap_other_child_rec_t *next; - int pid; + int id; /* This is either a pid or tid depending on the platform */ void (*maintenance) (int, void *, int); void *data; int write_fd; diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index d2255cc560d..9c752656f8d 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -74,7 +74,7 @@ API_EXPORT(void) ap_register_other_child(ap_proc_t *pid, ap_other_child_rec_t *ocr; ocr = ap_palloc(p, sizeof(*ocr)); - ocr->pid = pid->pid; + ocr->id = pid->pid; ocr->maintenance = maintenance; ocr->data = data; if (write_fd == NULL) { @@ -158,10 +158,10 @@ API_EXPORT(ap_status_t) ap_reap_other_child(ap_proc_t *pid, int status) for (ocr = other_children; ocr; ocr = nocr) { nocr = ocr->next; - if (ocr->pid != pid->pid) + if (ocr->id != pid->pid) continue; - ocr->pid = -1; + ocr->id = -1; (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status); return 0; } @@ -176,12 +176,12 @@ API_EXPORT(void) ap_check_other_child(void) for (ocr = other_children; ocr; ocr = nocr) { nocr = ocr->next; - if (ocr->pid == -1) + if (ocr->id == -1) continue; - waitret = waitpid(ocr->pid, &status, WNOHANG); - if (waitret == ocr->pid) { - ocr->pid = -1; + waitret = waitpid(ocr->id, &status, WNOHANG); + if (waitret == ocr->id) { + ocr->id = -1; (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status); } else if (waitret == 0) { @@ -189,7 +189,7 @@ API_EXPORT(void) ap_check_other_child(void) } else if (waitret == -1) { /* uh what the heck? they didn't call unregister? */ - ocr->pid = -1; + ocr->id = -1; (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1); } } From fdb9ab412794b177413d742a8522a85f738b2326 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 16 May 2000 17:12:45 +0000 Subject: [PATCH 0072/7878] Update the unix code to support BeOS. Remove the now un-necessary BeOS directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60046 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/mmap.c | 45 ++++++++++++--- mmap/beos/Makefile.in | 63 -------------------- mmap/beos/mmap.c | 122 --------------------------------------- mmap/beos/mmap_common.c | 2 - mmap/beos/mmap_h.h | 79 ------------------------- mmap/unix/common.c | 4 -- mmap/unix/mmap.c | 45 ++++++++++++--- mmap/unix/mmap_h.h | 7 +-- 8 files changed, 75 insertions(+), 292 deletions(-) delete mode 100644 mmap/beos/Makefile.in delete mode 100644 mmap/beos/mmap.c delete mode 100644 mmap/beos/mmap_common.c delete mode 100644 mmap/beos/mmap_h.h diff --git a/include/arch/unix/mmap.c b/include/arch/unix/mmap.c index aec2122650b..cd60750173a 100644 --- a/include/arch/unix/mmap.c +++ b/include/arch/unix/mmap.c @@ -52,12 +52,7 @@ * . */ -#ifdef BEOS -#include "../beos/mmap_h.h" -#else #include "mmap_h.h" -#endif - #include "apr_portable.h" #if HAVE_MMAP @@ -66,33 +61,65 @@ static ap_status_t mmap_cleanup(void *themmap) { ap_mmap_t *mm = themmap; int rv; +#ifdef BEOS + rv = delete_area(mm->area); + + if (rv == 0) { + mm->mm = (caddr_t)-1; + return APR_SUCCESS; + } +#else rv = munmap(mm->mm, mm->size); if (rv == 0) { mm->mm = (caddr_t)-1; return APR_SUCCESS; } - else - return errno; +#endif + return errno; } ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, ap_size_t size, ap_pool_t *cont) { +#ifdef BEOS + void *mm; + area_id aid = -1; + char *areaname = "apr_mmap\0"; + uint32 pages = 0; +#else caddr_t mm; +#endif - if (file == NULL || file->filedes == -1) + if (file == NULL || file->filedes == -1 || file->buffered) return APR_EBADF; - (*new) = (ap_mmap_t *)ap_pcalloc(cont, sizeof(ap_mmap_t)); ap_seek(file, APR_SET, &offset); +#ifdef BEOS + pages = ((size -1) / B_PAGE_SIZE) + 1; + + aid = create_area(areaname, &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, + B_FULL_LOCK, B_READ_AREA|B_WRITE_AREA); + + if (aid < B_NO_ERROR) { + /* we failed to get an mmap'd file... */ + return APR_ENOMEM; + } + + if (aid >= B_NO_ERROR) + read(file->filedes, mm, size); + (*new)->area = aid; +#else + mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes ,0); if (mm == (caddr_t)-1) { /* we failed to get an mmap'd file... */ return APR_ENOMEM; } +#endif + (*new)->mm = mm; (*new)->size = size; (*new)->cntxt = cont; diff --git a/mmap/beos/Makefile.in b/mmap/beos/Makefile.in deleted file mode 100644 index 4216af1637e..00000000000 --- a/mmap/beos/Makefile.in +++ /dev/null @@ -1,63 +0,0 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../include -I../../file_io/unix -INCLUDES=-I$(INCDIR) -I. - -LIB=libmmap.a - -OBJS=mmap.o mmap_common.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(LIB) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# -depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new - -# DO NOT REMOVE -mmap.o: mmap.c mmap_h.h ../../include/apr_general.h \ - ../../include/apr.h ../../include/apr_errno.h \ - ../../include/apr_mmap.h ../../include/apr_network_io.h \ - ../../include/apr_file_io.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../include/apr_time.h ../../include/apr_lib.h \ - ../../file_io/unix/fileio.h ../../include/apr_private.h -mmap_common.o: mmap_common.c ../unix/common.c ../unix/../beos/mmap_h.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_mmap.h \ - ../../include/apr_network_io.h ../../include/apr_file_io.h \ - ../../include/apr_portable.h ../../include/apr_thread_proc.h \ - ../../include/apr_lock.h ../../include/apr_time.h diff --git a/mmap/beos/mmap.c b/mmap/beos/mmap.c deleted file mode 100644 index f7d97c4579b..00000000000 --- a/mmap/beos/mmap.c +++ /dev/null @@ -1,122 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "mmap_h.h" - -static ap_status_t mmap_cleanup(void *themmap) -{ - ap_mmap_t *mm = themmap; - int rv; - rv = delete_area(mm->area); - - if (rv == 0) { - mm->mm = 0; - mm->area = -1; - return APR_SUCCESS; - } - else - return errno; -} - -ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, ap_size_t size, - ap_pool_t *cont) -{ - void *mm; - area_id aid = -1; - char *areaname = "apr_mmap\0"; - uint32 pages = 0; - - if (file == NULL || file->buffered || file->filedes == -1) - return APR_EBADF; - (*new) = (ap_mmap_t *)ap_palloc(cont, sizeof(ap_mmap_t)); - - pages = ((size -1) / B_PAGE_SIZE) + 1; - - ap_seek(file, APR_SET, &offset); - - aid = create_area(areaname, &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, - B_FULL_LOCK, B_READ_AREA|B_WRITE_AREA); - - if (aid < B_NO_ERROR) { - /* we failed to get an mmap'd file... */ - return APR_ENOMEM; - } - - if (aid >= B_NO_ERROR) - read(file->filedes, mm, size); - - (*new)->mm = mm; - (*new)->size = size; - (*new)->area = aid; - (*new)->cntxt = cont; - - /* register the cleanup... */ - ap_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, - ap_null_cleanup); - - return APR_SUCCESS; -} - -ap_status_t ap_mmap_delete(ap_mmap_t *mmap) -{ - ap_status_t rv; - if (mmap->area == -1) - return APR_ENOENT; - - if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { - ap_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); - return APR_SUCCESS; - } - return rv; -} diff --git a/mmap/beos/mmap_common.c b/mmap/beos/mmap_common.c deleted file mode 100644 index 7742d0f9a77..00000000000 --- a/mmap/beos/mmap_common.c +++ /dev/null @@ -1,2 +0,0 @@ -#include "../unix/common.c" - diff --git a/mmap/beos/mmap_h.h b/mmap/beos/mmap_h.h deleted file mode 100644 index 89895377122..00000000000 --- a/mmap/beos/mmap_h.h +++ /dev/null @@ -1,79 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef MMAP_H_H -#define MMAP_H_H - -#include "apr_general.h" -#include "apr_mmap.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_portable.h" -#include "apr_lib.h" -#include "fileio.h" -#include -#include -#include -#include -#include - -struct ap_mmap_t { - ap_pool_t *cntxt; - area_id area; - void *mm; - size_t size; -}; - -#endif /* ! FILE_IO_H */ - diff --git a/mmap/unix/common.c b/mmap/unix/common.c index 34eb8fe929f..d2fc6cc018d 100644 --- a/mmap/unix/common.c +++ b/mmap/unix/common.c @@ -61,11 +61,7 @@ * */ -#ifdef BEOS -#include "../beos/mmap_h.h" -#else #include "mmap_h.h" -#endif #if HAVE_MMAP diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index aec2122650b..cd60750173a 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -52,12 +52,7 @@ * . */ -#ifdef BEOS -#include "../beos/mmap_h.h" -#else #include "mmap_h.h" -#endif - #include "apr_portable.h" #if HAVE_MMAP @@ -66,33 +61,65 @@ static ap_status_t mmap_cleanup(void *themmap) { ap_mmap_t *mm = themmap; int rv; +#ifdef BEOS + rv = delete_area(mm->area); + + if (rv == 0) { + mm->mm = (caddr_t)-1; + return APR_SUCCESS; + } +#else rv = munmap(mm->mm, mm->size); if (rv == 0) { mm->mm = (caddr_t)-1; return APR_SUCCESS; } - else - return errno; +#endif + return errno; } ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, ap_size_t size, ap_pool_t *cont) { +#ifdef BEOS + void *mm; + area_id aid = -1; + char *areaname = "apr_mmap\0"; + uint32 pages = 0; +#else caddr_t mm; +#endif - if (file == NULL || file->filedes == -1) + if (file == NULL || file->filedes == -1 || file->buffered) return APR_EBADF; - (*new) = (ap_mmap_t *)ap_pcalloc(cont, sizeof(ap_mmap_t)); ap_seek(file, APR_SET, &offset); +#ifdef BEOS + pages = ((size -1) / B_PAGE_SIZE) + 1; + + aid = create_area(areaname, &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, + B_FULL_LOCK, B_READ_AREA|B_WRITE_AREA); + + if (aid < B_NO_ERROR) { + /* we failed to get an mmap'd file... */ + return APR_ENOMEM; + } + + if (aid >= B_NO_ERROR) + read(file->filedes, mm, size); + (*new)->area = aid; +#else + mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes ,0); if (mm == (caddr_t)-1) { /* we failed to get an mmap'd file... */ return APR_ENOMEM; } +#endif + (*new)->mm = mm; (*new)->size = size; (*new)->cntxt = cont; diff --git a/mmap/unix/mmap_h.h b/mmap/unix/mmap_h.h index fbb42b63d6f..c698528b2b2 100644 --- a/mmap/unix/mmap_h.h +++ b/mmap/unix/mmap_h.h @@ -60,11 +60,7 @@ #include "apr_mmap.h" #include "apr_errno.h" #include "fileio.h" -#ifdef BEOS -#include "../beos/mmap_h.h" -#else #include "mmap_h.h" -#endif /* System headers required for the mmap library */ #ifdef BEOS @@ -86,6 +82,9 @@ struct ap_mmap_t { ap_pool_t *cntxt; +#ifdef BEOS + area_id; +#endif void *mm; size_t size; }; From e9aeb4a5c18b5818765acb4aa4b55ef04b0b8996 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 16 May 2000 17:48:57 +0000 Subject: [PATCH 0073/7878] Handle some OS/390-isms dealing with pthreads: . the types of the parameters to pthread_attr_setdetachstate() and pthread_detach() . the fact that sigprocmask() must be use to set a thread's signal mask git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60047 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 3 +++ threadproc/unix/thread.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/hints.m4 b/hints.m4 index ff6d500fc4e..0f249229d4d 100644 --- a/hints.m4 +++ b/hints.m4 @@ -365,6 +365,9 @@ dnl ;; *-ibm-os390) APR_SETIFNULL(CC, cc) APR_ADDTO(CFLAGS, -U_NO_PROTO) + APR_ADDTO(CFLAGS, -DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR) + APR_ADDTO(CFLAGS, -DPTHREAD_DETACH_ARG1_ADDR) + APR_ADDTO(CFLAGS, -DSIGPROCMASK_SETS_THREAD_MASK) ;; esac APR_DOEXTRA diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 7ba240d4b21..ca2cdff962c 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -81,7 +81,13 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) { ap_status_t stat; +#ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR + int arg = on; + + if ((stat = pthread_attr_setdetachstate(attr->attr, &arg)) == 0) { +#else if ((stat = pthread_attr_setdetachstate(attr->attr, on)) == 0) { +#endif return APR_SUCCESS; } else { @@ -165,7 +171,11 @@ ap_status_t ap_thread_detach(ap_thread_t *thd) { ap_status_t stat; +#ifdef PTHREAD_DETACH_ARG1_ADDR + if ((stat = pthread_detach(thd->td)) == 0) { +#else if ((stat = pthread_detach(*thd->td)) == 0) { +#endif return APR_SUCCESS; } else { From 6a8e96336c77a9435cd4139ffd1c9aa5d06ffef5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 16 May 2000 17:53:56 +0000 Subject: [PATCH 0074/7878] Fix a typo in the new beos code in the unix dir. Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60048 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/unix/mmap_h.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmap/unix/mmap_h.h b/mmap/unix/mmap_h.h index c698528b2b2..87300f19cbd 100644 --- a/mmap/unix/mmap_h.h +++ b/mmap/unix/mmap_h.h @@ -83,7 +83,7 @@ struct ap_mmap_t { ap_pool_t *cntxt; #ifdef BEOS - area_id; + area_id area; #endif void *mm; size_t size; From eab7b0cccafba7fafb01bb034016989167f3aa77 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 16 May 2000 20:35:39 +0000 Subject: [PATCH 0075/7878] Remove the beos network I/O code and merge it with the unix code. Most of this was common code already. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60049 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/networkio.h | 117 ------------- include/arch/unix/networkio.h | 24 +++ network_io/beos/Makefile.in | 96 ----------- network_io/beos/networkio.h | 117 ------------- network_io/beos/poll.c | 224 ------------------------ network_io/beos/sendrecv.c | 150 ---------------- network_io/beos/sockaddr.c | 183 -------------------- network_io/beos/sockets.c | 238 -------------------------- network_io/beos/sockopt.c | 117 ------------- network_io/{beos => unix}/inet_aton.c | 0 network_io/unix/networkio.h | 24 +++ network_io/unix/poll.c | 22 ++- network_io/unix/sendrecv.c | 54 +++--- network_io/unix/sockets.c | 27 ++- network_io/unix/sockopt.c | 4 + 15 files changed, 124 insertions(+), 1273 deletions(-) delete mode 100644 include/arch/beos/networkio.h delete mode 100644 network_io/beos/Makefile.in delete mode 100644 network_io/beos/networkio.h delete mode 100644 network_io/beos/poll.c delete mode 100644 network_io/beos/sendrecv.c delete mode 100644 network_io/beos/sockaddr.c delete mode 100644 network_io/beos/sockets.c delete mode 100644 network_io/beos/sockopt.c rename network_io/{beos => unix}/inet_aton.c (100%) diff --git a/include/arch/beos/networkio.h b/include/arch/beos/networkio.h deleted file mode 100644 index b37797cb7d2..00000000000 --- a/include/arch/beos/networkio.h +++ /dev/null @@ -1,117 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifdef HAVE_NETINET_TCP_H -#include "../unix/network_io.h" -#else - -#ifndef NETWORK_IO_H -#define NETWORK_IO_H - - -#include -#include -#include -#include -#include -#include -#include "apr_network_io.h" -#include "apr_general.h" -#include "apr_portable.h" -#include "apr_lib.h" -#include "fileio.h" -#include "apr_errno.h" - -/* The definition of isascii was missed from the PowerPC ctype.h - * - * It will be included in the next release, but until then... */ -#if __POWERPC__ -#define isascii(c) (((c) & ~0x7f)==0) -#endif - -#include "apr_general.h" -#include /* for the ntohs definition */ - -#define POLLIN 1 -#define POLLPRI 2 -#define POLLOUT 4 -#define POLLERR 8 -#define POLLHUP 16 -#define POLLNVAL 32 - -struct ap_socket_t { - ap_pool_t *cntxt; - int socketdes; - struct sockaddr_in *local_addr; - struct sockaddr_in *remote_addr; - int addr_len; - ap_interval_time_t timeout; - int connected; -}; - -struct ap_pollfd_t { - ap_pool_t *cntxt; - struct ap_socket_t *sock; - fd_set *read; - fd_set *write; - fd_set *except; - int highsock; -}; - -ap_int16_t get_event(ap_int16_t); - -int inet_aton(const char *cp, struct in_addr *addr); - -#endif /* ! NETWORK_IO_H */ -#endif diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 9880b04318d..5ab06d7ed99 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -104,8 +104,28 @@ #if HAVE_SYS_SENDFILE_H #include #endif +#if HAVE_BYTEORDER_H +#include /* for ntohs on BeOS */ +#endif /* End System Headers */ +/* The definition of isascii was missed from the PowerPC ctype.h + * + * It will be included in the next release, but until then... + */ +#if (HAVE_ISASCII == 0) +#define isascii(c) (((c) & ~0x7f)==0) +#endif + +#ifndef HAVE_POLLIN +#define POLLIN 1 +#define POLLPRI 2 +#define POLLOUT 4 +#define POLLERR 8 +#define POLLHUP 16 +#define POLLNVAL 32 +#endif + struct ap_socket_t { ap_pool_t *cntxt; int socketdes; @@ -135,5 +155,9 @@ struct ap_pollfd_t { }; +#if BEOS +int inet_aton(const char *cp, struct in_addr *addr); +#endif + #endif /* ! NETWORK_IO_H */ diff --git a/network_io/beos/Makefile.in b/network_io/beos/Makefile.in deleted file mode 100644 index 68a440a654a..00000000000 --- a/network_io/beos/Makefile.in +++ /dev/null @@ -1,96 +0,0 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../include -I../../file_io/unix -INCLUDES=-I$(INCDIR) -I. - -LIB=libnetwork.a - -OBJS=poll.o \ - sendrecv.o \ - sockets.o \ - sockopt.o \ - inet_aton.o \ - sockaddr.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(LIB) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# -depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new - -# DO NOT REMOVE -inet_aton.o: inet_aton.c networkio.h ../../include/apr_network_io.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../include/apr_lib.h ../../file_io/unix/fileio.h \ - ../../include/apr_private.h -poll.o: poll.c networkio.h ../../include/apr_network_io.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../include/apr_lib.h ../../file_io/unix/fileio.h \ - ../../include/apr_private.h -sendrecv.o: sendrecv.c networkio.h ../../include/apr_network_io.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../include/apr_lib.h ../../file_io/unix/fileio.h \ - ../../include/apr_private.h -sockaddr.o: sockaddr.c networkio.h ../../include/apr_network_io.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../include/apr_lib.h ../../file_io/unix/fileio.h \ - ../../include/apr_private.h -sockets.o: sockets.c networkio.h ../../include/apr_network_io.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../include/apr_lib.h ../../file_io/unix/fileio.h \ - ../../include/apr_private.h -sockopt.o: sockopt.c networkio.h ../../include/apr_network_io.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../include/apr_lib.h ../../file_io/unix/fileio.h \ - ../../include/apr_private.h diff --git a/network_io/beos/networkio.h b/network_io/beos/networkio.h deleted file mode 100644 index b37797cb7d2..00000000000 --- a/network_io/beos/networkio.h +++ /dev/null @@ -1,117 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifdef HAVE_NETINET_TCP_H -#include "../unix/network_io.h" -#else - -#ifndef NETWORK_IO_H -#define NETWORK_IO_H - - -#include -#include -#include -#include -#include -#include -#include "apr_network_io.h" -#include "apr_general.h" -#include "apr_portable.h" -#include "apr_lib.h" -#include "fileio.h" -#include "apr_errno.h" - -/* The definition of isascii was missed from the PowerPC ctype.h - * - * It will be included in the next release, but until then... */ -#if __POWERPC__ -#define isascii(c) (((c) & ~0x7f)==0) -#endif - -#include "apr_general.h" -#include /* for the ntohs definition */ - -#define POLLIN 1 -#define POLLPRI 2 -#define POLLOUT 4 -#define POLLERR 8 -#define POLLHUP 16 -#define POLLNVAL 32 - -struct ap_socket_t { - ap_pool_t *cntxt; - int socketdes; - struct sockaddr_in *local_addr; - struct sockaddr_in *remote_addr; - int addr_len; - ap_interval_time_t timeout; - int connected; -}; - -struct ap_pollfd_t { - ap_pool_t *cntxt; - struct ap_socket_t *sock; - fd_set *read; - fd_set *write; - fd_set *except; - int highsock; -}; - -ap_int16_t get_event(ap_int16_t); - -int inet_aton(const char *cp, struct in_addr *addr); - -#endif /* ! NETWORK_IO_H */ -#endif diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c deleted file mode 100644 index 86b0a009478..00000000000 --- a/network_io/beos/poll.c +++ /dev/null @@ -1,224 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_private.h" -#ifdef HAVE_NETINET_TCP_H -#include "../unix/poll.c" -#else -#include "networkio.h" - -/* BeOS R4 doesn't have a poll function, but R5 will have */ -/* so for the time being we try our best with an implementaion that */ -/* uses select. However, select on beos isn't that hot either, so */ -/* until R5 we have to live with a less than perfect implementation */ - -/* Apparently those sneaky people at Be included support for write in */ -/* select for R4.5 of BeOS. So here we use code that uses the write */ -/* bits. */ - -ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) -{ - (*new) = (ap_pollfd_t *)ap_palloc(cont, sizeof(ap_pollfd_t) * num); - if ((*new) == NULL) { - return APR_ENOMEM; - } - (*new)->cntxt = cont; - (*new)->read = (fd_set *)ap_palloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)ap_palloc(cont, sizeof(fd_set)); - (*new)->except = (fd_set *)ap_palloc(cont, sizeof(fd_set)); - FD_ZERO((*new)->read); - FD_ZERO((*new)->write); - FD_ZERO((*new)->except); - (*new)->highsock = -1; - return APR_SUCCESS; -} - -ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t event) -{ - if (event & APR_POLLIN) { - FD_SET(sock->socketdes, aprset->read); - } - if (event & APR_POLLPRI) { - FD_SET(sock->socketdes, aprset->read); - } - if (event & APR_POLLOUT) { - FD_SET(sock->socketdes, aprset->write); - } - if (sock->socketdes > aprset->highsock) { - aprset->highsock = sock->socketdes; - } - return APR_SUCCESS; -} - -ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, - ap_interval_time_t timeout) -{ - int rv; - struct timeval tv, *tvptr; - - if (timeout < 0) { - tvptr = NULL; - } - else { - tv.tv_sec = timeout / AP_USEC_PER_SEC; - tv.tv_usec = timeout % AP_USEC_PER_SEC; - tvptr = &tv; - } - - rv = select(aprset->highsock + 1, aprset->read, aprset->write, - NULL, tvptr); - - (*nsds) = rv; - if ((*nsds) == 0) { - return APR_TIMEUP; - } - if ((*nsds) < 0) { - return APR_EEXIST; - } - return APR_SUCCESS; -} - -ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) -{ - ap_int16_t revents = 0; - char data[256]; - int dummy = 256; - - if (FD_ISSET(sock->socketdes, aprset->read)) { - revents |= APR_POLLIN; - if (recv(sock->socketdes, &data, 0, 0) == -1) { - switch (errno) { - case ECONNRESET: - case ECONNABORTED: - case ESHUTDOWN: - case ENETRESET: { - revents ^= APR_POLLIN; - revents |= APR_POLLHUP; - break; - } - case ENOTSOCK: { - revents ^= APR_POLLIN; - revents |= APR_POLLNVAL; - } - default: { - revents ^= APR_POLLIN; - revents |= APR_POLLERR; - } - } - } - } - if (FD_ISSET(sock->socketdes, aprset->write)) { - revents |= APR_POLLOUT; - } - - /* Still no support for execpt bits in BeOS R4.5 so for the time being */ - /* we can't check this. Hopefully the error checking above will allow */ - /* sufficient errors to be recognised to cover this. */ - - /*if (FD_ISSET(sock->socketdes, aprset->except)) { - revents |= APR_POLLPRI; - }*/ - - (*event) = revents; - return APR_SUCCESS; -} - -ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) -{ - FD_CLR(sock->socketdes, aprset->read); - FD_CLR(sock->socketdes, aprset->read); - FD_CLR(sock->socketdes, aprset->write); - return APR_SUCCESS; -} - -ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) -{ - if (event & APR_POLLIN) { - FD_ZERO(aprset->read); - } - if (event & APR_POLLPRI) { - FD_ZERO(aprset->read); - } - if (event & APR_POLLOUT) { - FD_ZERO(aprset->write); - } - aprset->highsock = 0; - return APR_SUCCESS; -} - -ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data) -{ - if (pollfd != NULL) { - return ap_get_userdata(data, key, pollfd->cntxt); - } - else { - data = NULL; - return APR_ENOFILE; - } -} - -ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key, - ap_status_t (*cleanup) (void *)) -{ - if (pollfd != NULL) { - return ap_set_userdata(data, key, cleanup, pollfd->cntxt); - } - else { - data = NULL; - return APR_ENOFILE; - } -} -#endif - diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c deleted file mode 100644 index 8d52f8d988a..00000000000 --- a/network_io/beos/sendrecv.c +++ /dev/null @@ -1,150 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_private.h" -#ifdef HAVE_NETINET_TCP_H -#include "../unix/sendrecv.c" -#else -#include "networkio.h" - -static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) -{ - struct timeval tv, *tvptr; - fd_set fdset; - int srv; - - do { - FD_ZERO(&fdset); - FD_SET(sock->socketdes, &fdset); - if (sock->timeout < 0) { - tvptr = NULL; - } - else { - tv.tv_sec = sock->timeout / AP_USEC_PER_SEC; - tv.tv_usec = sock->timeout % AP_USEC_PER_SEC; - tvptr = &tv; - } - srv = select(sock->socketdes + 1, - for_read ? &fdset : NULL, - for_read ? NULL : &fdset, - NULL, - tvptr); - /* TODO - timeout should be smaller on repeats of this loop */ - } while (srv == -1 && errno == EINTR); - - if (srv == 0) { - return APR_TIMEUP; - } - else if (srv < 0) { - return errno; - } - return APR_SUCCESS; -} - -ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) -{ - ssize_t rv; - - do { - rv = send(sock->socketdes, buf, (*len), 0); - } while (rv == -1 && errno == EINTR); - - if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } - else { - do { - rv = send(sock->socketdes, buf, (*len), 0); - } while (rv == -1 && errno == EINTR); - } - } - if (rv == -1) { - *len = 0; - return errno; - } - (*len) = rv; - return APR_SUCCESS; -} - -ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) -{ - ap_ssize_t rv; - - do { - rv = recv(sock->socketdes, buf, (*len), 0); - } while (rv == -1 && errno == EINTR); - - if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 1); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } - else { - do { - rv = recv(sock->socketdes, buf, (*len), 0); - } while (rv == -1 && errno == EINTR); - } - } - if (rv == -1) { - (*len) = 0; - return errno; - } - (*len) = rv; - return APR_SUCCESS; -} -#endif diff --git a/network_io/beos/sockaddr.c b/network_io/beos/sockaddr.c deleted file mode 100644 index 76fd25d2ed8..00000000000 --- a/network_io/beos/sockaddr.c +++ /dev/null @@ -1,183 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_private.h" -#ifdef HAVE_NETINET_TCP_H -#include "../unix/sockaddr.c" -#else -#include "networkio.h" - -ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) -{ - if (!sock) { - return APR_EBADF; - } - sock->local_addr->sin_port = htons((short)port); - return APR_SUCCESS; -} - -ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) -{ - if (!sock) { - return APR_EBADF; - } - sock->remote_addr->sin_port = htons((short)port); - return APR_SUCCESS; -} - -ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) -{ - if (!sock) { - return APR_EBADF; - } - *port = ntohs(sock->local_addr->sin_port); - return APR_SUCCESS; -} - -ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) -{ - if (!sock) { - return APR_EBADF; - } - *port = ntohs(sock->remote_addr->sin_port); - return APR_SUCCESS; -} - -ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) -{ - u_long ipaddr; - - if (!sock) { - return APR_EBADF; - } - - if (!strcmp(addr, APR_ANYADDR)) { - sock->local_addr->sin_addr.s_addr = htonl(INADDR_ANY); - return APR_SUCCESS; - } - - ipaddr = inet_addr(addr); - - if (ipaddr == -1) { - return errno; - } - - sock->local_addr->sin_addr.s_addr = ipaddr; - return APR_SUCCESS; -} - -ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) -{ - u_long ipaddr; - - if (!sock) { - return APR_EBADF; - } - - if (!strcmp(addr, APR_ANYADDR)) { - sock->remote_addr->sin_addr.s_addr = htonl(INADDR_ANY); - return APR_SUCCESS; - } - - ipaddr = inet_addr(addr); - - if (ipaddr == (u_long)-1) { - return errno; - } - - sock->remote_addr->sin_addr.s_addr = ipaddr; - return APR_SUCCESS; -} - -ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) -{ - if (!sock) { - return APR_EBADF; - } - - *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); - return APR_SUCCESS; -} - -ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) -{ - if (!sock) { - return APR_EBADF; - } - - *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); - return APR_SUCCESS; -} - - -ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock) -{ - if (!sock) { - return APR_EBADF; - } - - *name = sock->local_addr; - return APR_SUCCESS; -} - -ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *sock) -{ - if (!sock) { - return APR_EBADF; - } - - *name = sock->remote_addr; - return APR_SUCCESS; -} -#endif \ No newline at end of file diff --git a/network_io/beos/sockets.c b/network_io/beos/sockets.c deleted file mode 100644 index f6f109e20f2..00000000000 --- a/network_io/beos/sockets.c +++ /dev/null @@ -1,238 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_private.h" -#ifdef HAVE_NETINET_TCP_H -#include "../unix/sockets.c" -#else -#include "networkio.h" - -ap_status_t socket_cleanup(void *sock) -{ - ap_socket_t *thesocket = sock; - if (closesocket(thesocket->socketdes) == 0) { - thesocket->socketdes = -1; - return APR_SUCCESS; - } - else { - return errno; - } -} - -ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) -{ - (*new) = (ap_socket_t *)ap_palloc(cont,sizeof(ap_socket_t)); - - if ((*new) == NULL){ - return APR_ENOMEM; - } - - (*new)->cntxt = cont; - (*new)->local_addr = (struct sockaddr_in *) ap_palloc((*new)->cntxt, - sizeof (struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *) ap_palloc((*new)->cntxt, - sizeof (struct sockaddr_in)); - if ((*new)->local_addr == NULL || (*new)->remote_addr==NULL){ - return APR_ENOMEM; - } - - (*new)->socketdes = socket(AF_INET ,SOCK_STREAM, 0); - (*new)->local_addr->sin_family = AF_INET; - (*new)->remote_addr->sin_family = AF_INET; - (*new)->addr_len = sizeof(*(*new)->local_addr); - memset(&(*new)->local_addr->sin_zero, 0, sizeof((*new)->local_addr->sin_zero)); - memset(&(*new)->remote_addr->sin_zero, 0, sizeof((*new)->remote_addr->sin_zero)); - - if ((*new)->socketdes < 0) { - return errno; - } - - (*new)->timeout = -1; - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); - return APR_SUCCESS; -} - -ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) -{ - return shutdown(thesocket->socketdes, how); -} - -ap_status_t ap_close_socket(ap_socket_t *thesocket) -{ - ap_kill_cleanup(thesocket->cntxt,thesocket,socket_cleanup); - return socket_cleanup(thesocket); -} - -ap_status_t ap_bind(ap_socket_t *sock) -{ - if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) - return errno; - else - return APR_SUCCESS; -} - -ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) -{ - if (listen(sock->socketdes, backlog) == -1) - return errno; - else - return APR_SUCCESS; -} - -ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_pool_t *connection_context) -{ - (*new) = (ap_socket_t *)ap_palloc(connection_context, - sizeof(ap_socket_t)); - - (*new)->cntxt = connection_context; - (*new)->local_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, - sizeof(struct sockaddr_in)); - - (*new)->remote_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, - sizeof(struct sockaddr_in)); - (*new)->addr_len = sizeof(struct sockaddr_in); - (*new)->connected = 1; - - (*new)->socketdes = accept(sock->socketdes, (struct sockaddr *)(*new)->remote_addr, - &(*new)->addr_len); - - if (getsockname((*new)->socketdes, (struct sockaddr *)(*new)->local_addr, - &((*new)->addr_len)) < 0) { - return errno; - } - if ((*new)->socketdes <0){ - return errno; - } - - ap_register_cleanup((*new)->cntxt, (void *)new, - socket_cleanup, ap_null_cleanup); - return APR_SUCCESS; -} - -ap_status_t ap_connect(ap_socket_t *sock, char *hostname) -{ - struct hostent *hp; - - hp = gethostbyname(hostname); - if ((sock->socketdes < 0) || (!sock->remote_addr)) { - return APR_ENOTSOCK; - } - - memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr , hp->h_length); - - sock->remote_addr->sin_family = AF_INET; - - memset(sock->remote_addr->sin_zero, 0, sizeof(sock->remote_addr->sin_zero)); - - sock->addr_len = sizeof(sock->remote_addr); - - if ((connect(sock->socketdes, (const struct sockaddr *)sock->remote_addr, sock->addr_len) < 0) - && (errno != EINPROGRESS)) { - return errno; - } else { - int namelen = sizeof(*sock->local_addr); - getsockname(sock->socketdes, (struct sockaddr *)sock->local_addr, &namelen); - sock->connected = 1; - } - - return APR_SUCCESS; -} - -ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock) -{ - if (socket != NULL) { - return ap_get_userdata(data, key, sock->cntxt); - } - else { - data = NULL; - return APR_ENOSOCKET; - } -} - -ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key, - ap_status_t (*cleanup) (void *)) -{ - if (sock != NULL) { - return ap_set_userdata(data, key, cleanup, sock->cntxt); - } - else { - data = NULL; - return APR_ENOSOCKET; - } -} - -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) -{ - if (sock == NULL) { - return APR_ENOSOCKET; - } - *thesock = sock->socketdes; - return APR_SUCCESS; -} - -ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, - ap_pool_t *cont) -{ - if (cont == NULL) { - return APR_ENOPOOL; - } - if ((*sock) == NULL) { - (*sock) = (ap_socket_t *)ap_palloc(cont, sizeof(ap_socket_t)); - (*sock)->cntxt = cont; - } - (*sock)->socketdes = *thesock; - return APR_SUCCESS; -} -#endif \ No newline at end of file diff --git a/network_io/beos/sockopt.c b/network_io/beos/sockopt.c deleted file mode 100644 index 9710ff2def5..00000000000 --- a/network_io/beos/sockopt.c +++ /dev/null @@ -1,117 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_private.h" -#ifdef HAVE_NETINET_TCP_H -#include "../unix/sockopt.c" -#else -#include "networkio.h" - -ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) -{ - int one; - if (on){ - one = 1; - }else { - one = 0; - } - if (opt & APR_SO_SNDBUF) - return APR_ENOTIMPL; - - if (opt & APR_SO_DEBUG) { - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, &one, sizeof(one)) == -1) { - return errno; - } - } - if (opt & APR_SO_REUSEADDR) { - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) == -1) { - return errno; - } - } - if (opt & APR_SO_NONBLOCK) { - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_NONBLOCK, &one, sizeof(one)) == -1){ - return errno; - } - } - return APR_SUCCESS; -} - -ap_status_t ap_gethostname(char * buf, int len, ap_pool_t *cont) -{ - if (gethostname(buf, len) == -1){ - return errno; - } else { - return APR_SUCCESS; - } -} - -ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) -{ - struct hostent *hptr; - - hptr = gethostbyaddr((char *)&(sock->remote_addr->sin_addr), - sizeof(struct in_addr), AF_INET); - if (hptr != NULL) { - *name = ap_pstrdup(sock->cntxt, hptr->h_name); - if (*name) { - return APR_SUCCESS; - } - return APR_ENOMEM; - } - - /* XXX - Is this threadsafe? - manoj */ - /* on BeOS h_errno is a global... */ - return h_errno; -} -#endif \ No newline at end of file diff --git a/network_io/beos/inet_aton.c b/network_io/unix/inet_aton.c similarity index 100% rename from network_io/beos/inet_aton.c rename to network_io/unix/inet_aton.c diff --git a/network_io/unix/networkio.h b/network_io/unix/networkio.h index 9880b04318d..5ab06d7ed99 100644 --- a/network_io/unix/networkio.h +++ b/network_io/unix/networkio.h @@ -104,8 +104,28 @@ #if HAVE_SYS_SENDFILE_H #include #endif +#if HAVE_BYTEORDER_H +#include /* for ntohs on BeOS */ +#endif /* End System Headers */ +/* The definition of isascii was missed from the PowerPC ctype.h + * + * It will be included in the next release, but until then... + */ +#if (HAVE_ISASCII == 0) +#define isascii(c) (((c) & ~0x7f)==0) +#endif + +#ifndef HAVE_POLLIN +#define POLLIN 1 +#define POLLPRI 2 +#define POLLOUT 4 +#define POLLERR 8 +#define POLLHUP 16 +#define POLLNVAL 32 +#endif + struct ap_socket_t { ap_pool_t *cntxt; int socketdes; @@ -135,5 +155,9 @@ struct ap_pollfd_t { }; +#if BEOS +int inet_aton(const char *cp, struct in_addr *addr); +#endif + #endif /* ! NETWORK_IO_H */ diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index 10b22ccdcd6..fedffdc5361 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -272,7 +272,11 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, } rv = select(aprset->highsock + 1, aprset->read, aprset->write, - aprset->except, tvptr); +#ifdef BEOS + NULL, tvptr); +#else + aprset->except, tvptr); +#endif (*nsds) = rv; if ((*nsds) == 0) { @@ -296,7 +300,14 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap if (FD_ISSET(sock->socketdes, aprset->read)) { revents |= APR_POLLIN; if (sock->connected +#ifdef BEOS + /* XXX I would really like to understand why this difference + * exists. Can we get rid of it? rbb + */ + && recv(sock->socketdes, data, 0, 0) == -1) { +#else && recv(sock->socketdes, data, sizeof data, flags) == -1) { +#endif switch (errno) { case ECONNRESET: case ECONNABORTED: @@ -308,17 +319,22 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap case ENOTSOCK: revents ^= APR_POLLIN; revents |= APR_POLLNVAL; - break; + break; default: revents ^= APR_POLLIN; revents |= APR_POLLERR; - break; + break; } } } +#ifndef BEOS + /* Still no support for execpt bits in BeOS R4.5 so for the time being */ + /* we can't check this. Hopefully the error checking above will allow */ + /* sufficient errors to be recognised to cover this. */ if (FD_ISSET(sock->socketdes, aprset->write)) { revents |= APR_POLLOUT; } +#endif /* I am assuming that the except is for out of band data, not a failed * connection on a non-blocking socket. Might be a bad assumption, but * it works for now. rbb. diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index be163461a57..4f6ab7c11da 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -54,6 +54,17 @@ #include "networkio.h" +/* BeOS needs to use send/recv for socket I/O, this allows us to do that + * with minimal changes in the code. + */ +#ifdef BEOS +#define WRITE(x,y,z) send(x,y,z,0) +#define READ(x,y,z) recv(x,y,z,0) +#else +#define WRITE(x,y,z) write(x,y,z) +#define READ(x,y,z) read(x,y,z) +#endif + #ifdef HAVE_SENDFILE /* This file is needed to allow us access to the ap_file_t internals. */ #include "../../file_io/unix/fileio.h" @@ -74,8 +85,8 @@ static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) int srv; do { - FD_ZERO(&fdset); - FD_SET(sock->socketdes, &fdset); + FD_ZERO(&fdset); + FD_SET(sock->socketdes, &fdset); if (sock->timeout < 0) { tvptr = NULL; } @@ -84,19 +95,19 @@ static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) tv.tv_usec = sock->timeout % AP_USEC_PER_SEC; tvptr = &tv; } - srv = select(sock->socketdes + 1, - for_read ? &fdset : NULL, - for_read ? NULL : &fdset, - NULL, - tvptr); + srv = select(sock->socketdes + 1, + for_read ? &fdset : NULL, + for_read ? NULL : &fdset, + NULL, + tvptr); /* TODO - timeout should be smaller on repeats of this loop */ } while (srv == -1 && errno == EINTR); if (srv == 0) { - return APR_TIMEUP; + return APR_TIMEUP; } else if (srv < 0) { - return errno; + return errno; } return APR_SUCCESS; } @@ -106,20 +117,19 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) ssize_t rv; do { - rv = write(sock->socketdes, buf, (*len)); + rv = WRITE(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR); - if (rv == -1 && - (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout != 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } + if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) + && sock->timeout != 0) { + ap_status_t arv = wait_for_io_or_timeout(sock, 0); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } else { do { - rv = write(sock->socketdes, buf, (*len)); + rv = WRITE(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR); } } @@ -136,7 +146,7 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) ssize_t rv; do { - rv = read(sock->socketdes, buf, (*len)); + rv = READ(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR); if (rv == -1 && @@ -149,7 +159,7 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) } else { do { - rv = read(sock->socketdes, buf, (*len)); + rv = READ(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR); } } @@ -161,6 +171,7 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) return APR_SUCCESS; } +#ifdef HAVE_WRITEV ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, ap_int32_t nvec, ap_int32_t *len) { @@ -191,6 +202,7 @@ ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, (*len) = rv; return APR_SUCCESS; } +#endif #if defined(HAVE_SENDFILE) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index f2ea3cc9ffa..1bdbcaddf07 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -55,10 +55,19 @@ #include "networkio.h" #include "apr_portable.h" +/* BeOS uses closesocket instead of close to close their sockets and they + * don't provide inet_aton. This small ifndef takes care of both problems. + */ +#ifndef BEOS +#define closesocket close +#else +#include "inet_aton.c" +#endif + static ap_status_t socket_cleanup(void *sock) { ap_socket_t *thesocket = sock; - if (close(thesocket->socketdes) == 0) { + if (closesocket(thesocket->socketdes) == 0) { thesocket->socketdes = -1; return APR_SUCCESS; } @@ -102,6 +111,9 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) { +#ifdef BEOS + return shutdown(thesocket->socketdes, how); +#endif if (shutdown(thesocket->socketdes, how) == 0) { return APR_SUCCESS; } @@ -169,6 +181,9 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) { struct hostent *hp; + if ((sock->socketdes < 0) || (!sock->remote_addr)) { + return APR_ENOTSOCK; + } if (hostname != NULL) { #ifndef GETHOSTBYNAME_HANDLES_NAS if (*hostname >= '0' && *hostname <= '9' && @@ -180,14 +195,12 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) #endif hp = gethostbyname(hostname); - if ((sock->socketdes < 0) || (!sock->remote_addr)) { - return APR_ENOTSOCK; - } if (!hp) { return (h_errno + APR_OS_START_SYSERR); } - memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr_list[0], hp->h_length); + memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr_list[0], + hp->h_length); sock->addr_len = sizeof(*sock->remote_addr); #ifndef GETHOSTBYNAME_HANDLES_NAS @@ -195,8 +208,8 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) #endif } - if ((connect(sock->socketdes, (const struct sockaddr *)sock->remote_addr, sock->addr_len) < 0) && - (errno != EINPROGRESS)) { + if ((connect(sock->socketdes, (const struct sockaddr *)sock->remote_addr, + sock->addr_len) < 0) && (errno != EINPROGRESS)) { return errno; } else { diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 26f7f0a9942..80ce008d2be 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -123,9 +123,13 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) } } if (opt & APR_SO_SNDBUF) { +#ifdef BEOS + return APR_ENOTIMPLE; +#else if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { return errno; } +#endif } if (opt & APR_SO_NONBLOCK) { #ifndef BEOS From 5d397ec2dda6325eb19d2a2d3a8637f1e834c2d4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 16 May 2000 21:04:20 +0000 Subject: [PATCH 0076/7878] Add a #else to keep us from getting "Unreachable code" warnings. Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60050 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 1bdbcaddf07..2ec4a2b3efd 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -113,13 +113,14 @@ ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) { #ifdef BEOS return shutdown(thesocket->socketdes, how); -#endif +#else if (shutdown(thesocket->socketdes, how) == 0) { return APR_SUCCESS; } else { return errno; } +#endif } ap_status_t ap_close_socket(ap_socket_t *thesocket) From 9b4f5da9c45c5d67e7b03f495a638219dddf4998 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 16 May 2000 21:37:05 +0000 Subject: [PATCH 0077/7878] Add a couple of checks necessary because unix and BeOS code are being combined git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60051 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 2 ++ configure.in | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/acconfig.h b/acconfig.h index 75ec15b7866..5ee866c0390 100644 --- a/acconfig.h +++ b/acconfig.h @@ -32,6 +32,8 @@ #undef HAVE_PTHREAD_PROCESS_SHARED #undef DEV_RANDOM #undef HAVE_TRUERAND +#undef HAVE_POLLIN +#undef HAVE_isascii /* Cross process serialization techniques */ #undef USE_FLOCK_SERIALIZE diff --git a/configure.in b/configure.in index 3db37293946..e426da660d5 100644 --- a/configure.in +++ b/configure.in @@ -153,6 +153,7 @@ AC_SUBST(iconv) dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC +AC_CHECK_HEADERS(ByteOrder.h) AC_CHECK_HEADERS(conio.h) AC_CHECK_HEADERS(crypt.h) AC_CHECK_HEADERS(ctype.h) @@ -413,6 +414,10 @@ AC_SUBST(have_union_semun) dnl Checks for libraries. AC_CHECK_DEFINE(LOCK_EX, sys/file.h) AC_CHECK_DEFINE(F_SETLK, fcntl.h) +AC_CHECK_DEFINE(isascii, ctype.h) +# We are assuming that if the platform doesn't have POLLIN, it doesn't have +# any POLL definitions. +AC_CHECK_DEFINE(POLLIN, poll.h) pthreadser="0" if test "$threads" = "1"; then From d9586a4d24b82545205969355e1140cbf4b04421 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 16 May 2000 23:42:02 +0000 Subject: [PATCH 0078/7878] Procsup was basically the same file between Unix and BeOS, they care share the code now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60052 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/procsup.c | 114 ---------------------------- threadproc/beos/threadproc_common.c | 3 +- 2 files changed, 2 insertions(+), 115 deletions(-) delete mode 100644 threadproc/beos/procsup.c diff --git a/threadproc/beos/procsup.c b/threadproc/beos/procsup.c deleted file mode 100644 index 0512855cd20..00000000000 --- a/threadproc/beos/procsup.c +++ /dev/null @@ -1,114 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "threadproc.h" - -ap_status_t ap_detach(ap_proc_t **new, ap_pool_t *cont) -{ - int x; - - (*new) = (ap_proc_t *)ap_palloc(cont, sizeof(ap_proc_t)); - (*new)->cntxt = cont; - (*new)->attr = NULL; - - chdir("/"); - - if (((*new)->pid = setsid()) == -1) { - return errno; - } - - /* close out the standard file descriptors */ - if (freopen("/dev/null", "r", stdin) == NULL) { - return errno; - /* continue anyhow -- note we can't close out descriptor 0 because we - * have nothing to replace it with, and if we didn't have a descriptor - * 0 the next file would be created with that value ... leading to - * havoc. - */ - } - if (freopen("/dev/null", "w", stdout) == NULL) { - return errno; - } - /* We are going to reopen this again in a little while to the error - * log file, but better to do it twice and suffer a small performance - * hit for consistancy than not reopen it here. - */ - if (freopen("/dev/null", "w", stderr) == NULL) { - return errno; - } -} - -ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc) -{ - if (proc != NULL) { - return ap_get_userdata(data, key, proc->cntxt); - } - else { - data = NULL; - return APR_ENOPROC; - } -} - -ap_status_t ap_set_procdata(void *data, char *key, - ap_status_t (*cleanup) (void *), - ap_proc_t *proc) -{ - if (proc != NULL) { - return ap_set_userdata(data, key, cleanup, proc->cntxt); - } - else { - data = NULL; - return APR_ENOPROC; - } -} diff --git a/threadproc/beos/threadproc_common.c b/threadproc/beos/threadproc_common.c index 548344fd3bd..077f6818141 100644 --- a/threadproc/beos/threadproc_common.c +++ b/threadproc/beos/threadproc_common.c @@ -54,5 +54,6 @@ /* As the signal code is identical, use the unix version to reduce code duplication */ - #include "../unix/signals.c" +#include "../unix/procsup.c" + From 6deaee3c12b19910745f0b4f44720c70c1f4a53b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 16 May 2000 23:43:36 +0000 Subject: [PATCH 0079/7878] Procsup was basically the same file between Unix and BeOS, they can share the code now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60053 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/Makefile.in | 1 - 1 file changed, 1 deletion(-) diff --git a/threadproc/beos/Makefile.in b/threadproc/beos/Makefile.in index e68764c43dd..04f8fd3a611 100644 --- a/threadproc/beos/Makefile.in +++ b/threadproc/beos/Makefile.in @@ -18,7 +18,6 @@ OBJS=proc.o \ thread.o \ threadpriv.o \ threadproc_common.o \ - procsup.o \ apr_proc_stub .c.o: From fa89db6227ae9a677fbf3521609d1aaa065f1f14 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 May 2000 01:52:47 +0000 Subject: [PATCH 0080/7878] Cleanup ap_config.h fallout for Win32. Only a few very minor changes to ap_config.h and util.c, but they might hurt someone... please watch those two carefully. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60054 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr.hw b/include/apr.hw index b481af03ca5..e52a1a23d76 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -124,6 +124,8 @@ #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 0 #define APR_HAVE_IN_ADDR 1 +#define APR_HAVE_INET_ADDR 1 + #define APR_USE_FLOCK_SERIALIZE 0 #define APR_USE_SYSVSEM_SERIALIZE 0 From 9109d391b46285d5d39a9448d8e3f674b6f707a8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 17 May 2000 16:45:45 +0000 Subject: [PATCH 0081/7878] Combine the Unix and OS/2 fileacc.c code. They are basically the same, and with two well placed ifdefs, they are the same. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60055 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/Makefile.in | 2 +- file_io/os2/{fileacc.c => common.c} | 48 +---------------------------- file_io/unix/fileacc.c | 14 ++++++++- 3 files changed, 15 insertions(+), 49 deletions(-) rename file_io/os2/{fileacc.c => common.c} (72%) diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index 05dcbe46c01..72bc9fe4025 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -15,7 +15,7 @@ INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. LIB=file.a OBJS=dir.o \ - fileacc.o \ + common.o \ filedup.o \ filestat.o \ open.o \ diff --git a/file_io/os2/fileacc.c b/file_io/os2/common.c similarity index 72% rename from file_io/os2/fileacc.c rename to file_io/os2/common.c index 0dfee57f02b..52aef93a520 100644 --- a/file_io/os2/fileacc.c +++ b/file_io/os2/common.c @@ -52,51 +52,5 @@ * . */ -#include "fileio.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_lib.h" -#include -#include -#include - -/* A file to put ALL of the accessor functions for ap_file_t types. */ - -ap_status_t ap_get_filename(char **new, ap_file_t *thefile) -{ - if (thefile != NULL) { - *new = ap_pstrdup(thefile->cntxt, thefile->fname); - return APR_SUCCESS; - } else { - *new = NULL; - return APR_ENOFILE; - } -} - - - -ap_status_t ap_get_filedata(void **data, char *key, ap_file_t *file) -{ - if (file != NULL) { - return ap_get_userdata(data, key, file->cntxt); - } - else { - data = NULL; - return APR_ENOFILE; - } -} - - - -ap_status_t ap_set_filedata(ap_file_t *file, void *data, char *key, - ap_status_t (*cleanup) (void *)) -{ - if (file != NULL) { - return ap_set_userdata(data, key, cleanup, file->cntxt); - } - else { - data = NULL; - return APR_ENOFILE; - } -} +#include "../unix/fileacc.c" diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 76041a3600a..9478222b224 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -52,8 +52,17 @@ * . */ +#ifdef OS2 +#include "../os2/fileio.h" +#include "apr_file_io.h" +#include "apr_general.h" +#include "apr_lib.h" +#include +#include +#include +#else #include "fileio.h" - +#endif /* A file to put ALL of the accessor functions for ap_file_t types. */ ap_status_t ap_get_filename(char **new, ap_file_t *thefile) @@ -68,6 +77,7 @@ ap_status_t ap_get_filename(char **new, ap_file_t *thefile) } } +#ifndef (OS2) mode_t ap_unix_get_fileperms(ap_fileperms_t mode) { mode_t rv = 0; @@ -95,6 +105,7 @@ mode_t ap_unix_get_fileperms(ap_fileperms_t mode) return rv; } +#endif ap_status_t ap_get_filedata(void **data, char *key, ap_file_t *file) { @@ -114,6 +125,7 @@ ap_status_t ap_set_filedata(ap_file_t *file, void *data, char *key, return ap_set_userdata(data, key, cleanup, file->cntxt); } else { + *data = NULL; return APR_ENOFILE; } } From 440a0eaddcd556d12695979f3fdfa41e6d5bc33a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 17 May 2000 17:58:23 +0000 Subject: [PATCH 0082/7878] Combine the fileacc.c file from Windows and Unix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60056 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileacc.c | 6 +- file_io/win32/{fileacc.c => common.c} | 87 +-------------------------- 2 files changed, 6 insertions(+), 87 deletions(-) rename file_io/win32/{fileacc.c => common.c} (59%) diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 9478222b224..4a4852ba617 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -54,6 +54,10 @@ #ifdef OS2 #include "../os2/fileio.h" +#elif defined(WIN32) +#include "../win32/fileio.h" +#endif +#if defined(OS2) || defined(WIN32) #include "apr_file_io.h" #include "apr_general.h" #include "apr_lib.h" @@ -77,7 +81,7 @@ ap_status_t ap_get_filename(char **new, ap_file_t *thefile) } } -#ifndef (OS2) +#if !defined(OS2) && !defined(WIN32) mode_t ap_unix_get_fileperms(ap_fileperms_t mode) { mode_t rv = 0; diff --git a/file_io/win32/fileacc.c b/file_io/win32/common.c similarity index 59% rename from file_io/win32/fileacc.c rename to file_io/win32/common.c index 7edb8e3edf5..52aef93a520 100644 --- a/file_io/win32/fileacc.c +++ b/file_io/win32/common.c @@ -52,90 +52,5 @@ * . */ -#include "fileio.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_lib.h" -#include -#include -#include +#include "../unix/fileacc.c" -/* A file to put ALL of the accessor functions for ap_file_t types. */ - -ap_status_t ap_get_filename(char **new, ap_file_t *thefile) -{ - if (thefile != NULL) { - *new = ap_pstrdup(thefile->cntxt, thefile->fname); - return APR_SUCCESS; - } - else { - *new = NULL; - return APR_ENOFILE; - } -} - -/*mode_t get_fileperms(ap_fileperms_t mode) -{ - mode_t rv = 0; - - if (mode & APR_UREAD) - rv |= S_IRUSR; - if (mode & APR_UWRITE) - rv |= S_IWUSR; - if (mode & APR_UEXECUTE) - rv |= S_IXUSR; - - if (mode & APR_GREAD) - rv |= S_IRGRP; - if (mode & APR_GWRITE) - rv |= S_IWGRP; - if (mode & APR_GEXECUTE) - rv |= S_IXGRP; - - if (mode & APR_WREAD) - rv |= S_IROTH; - if (mode & APR_WWRITE) - rv |= S_IWOTH; - if (mode & APR_WEXECUTE) - rv |= S_IXOTH; - - return rv; -}*/ - - -/* -ap_status_t ap_get_fileperms(ap_fileperms_t *perm, ap_file_t *file) -{ - if (file != NULL) { - *perm = file->protection; - return APR_SUCCESS; - } - else { - *perm = -1; - return APR_ENOFILE; - } -} -*/ - -ap_status_t ap_get_filedata(void **data, char *key, ap_file_t *file) -{ - if (file != NULL) { - return ap_get_userdata(data, key, file->cntxt); - } - else { - data = NULL; - return APR_ENOFILE; - } -} - -ap_status_t ap_set_filedata(ap_file_t *file, void *data, char *key, - ap_status_t (*cleanup) (void *)) -{ - if (file != NULL) { - return ap_set_userdata(data, key, cleanup, file->cntxt); - } - else { - data = NULL; - return APR_ENOFILE; - } -} From 92f37f07381503639a4a14b64d7b2c2d06c24b36 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 17 May 2000 20:03:05 +0000 Subject: [PATCH 0083/7878] Remove the misc/os2 directory completely. IF the directory isn't there, make automagically goes to the unix dir, and that looks like what we want in this case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60057 13f79535-47bb-0310-9956-ffa450edef68 --- misc/os2/.cvsignore | 1 - misc/os2/misc.h | 55 --------------------------------------------- 2 files changed, 56 deletions(-) delete mode 100644 misc/os2/.cvsignore delete mode 100644 misc/os2/misc.h diff --git a/misc/os2/.cvsignore b/misc/os2/.cvsignore deleted file mode 100644 index f3c7a7c5da6..00000000000 --- a/misc/os2/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -Makefile diff --git a/misc/os2/misc.h b/misc/os2/misc.h deleted file mode 100644 index f6b0e4833f4..00000000000 --- a/misc/os2/misc.h +++ /dev/null @@ -1,55 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "../unix/misc.h" From dfb047c80594a5b5de0f0919657b06402c7f52c4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 17 May 2000 22:06:15 +0000 Subject: [PATCH 0084/7878] "*data = NULL" added inappropriately earlier today... it won't compile and we don't want to play withe the user's storage on a "set" operation (shouldn't it be const void *?) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60058 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileacc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 4a4852ba617..7ff1d2cdc7a 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -129,7 +129,6 @@ ap_status_t ap_set_filedata(ap_file_t *file, void *data, char *key, return ap_set_userdata(data, key, cleanup, file->cntxt); } else { - *data = NULL; return APR_ENOFILE; } } From 7b31ca15af2b3f991540b0b3d5b6288f2735fdd6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 17 May 2000 22:31:14 +0000 Subject: [PATCH 0085/7878] Merging windows and Unix common misc files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60059 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/misc.h | 76 +++++++++++ include/arch/win32/misc.h | 76 +++++++++++ misc/unix/canonerr.c | 2 +- misc/unix/errorcodes.c | 52 +++++++- misc/unix/getopt.c | 5 +- misc/unix/misc.h | 76 +++++++++++ misc/unix/start.c | 17 ++- misc/win32/{canonerr.c => common.c} | 22 +--- misc/win32/errorcodes.c | 198 ---------------------------- misc/win32/getopt.c | 127 ------------------ misc/win32/misc.h | 144 -------------------- misc/win32/start.c | 180 ------------------------- 12 files changed, 304 insertions(+), 671 deletions(-) rename misc/win32/{canonerr.c => common.c} (84%) delete mode 100644 misc/win32/errorcodes.c delete mode 100644 misc/win32/getopt.c delete mode 100644 misc/win32/misc.h delete mode 100644 misc/win32/start.c diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index 736eb60df78..333ea0defe8 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -61,7 +61,9 @@ #include "apr_pools.h" #include "apr_getopt.h" #include "apr_thread_proc.h" +#include "apr_file_io.h" #include "apr_errno.h" +#include "apr_getopt.h" #ifdef HAVE_STDLIB_H #include #endif @@ -96,6 +98,80 @@ struct ap_other_child_rec_t { int write_fd; }; +#ifdef WIN32 +#define WSAHighByte 2 +#define WSALowByte 0 +/* Platform specific designation of run time os version. + * Gaps allow for specific service pack levels that + * export new kernel or winsock functions or behavior. + */ +typedef enum { + APR_WIN_95 = 0, + APR_WIN_98 = 4, + APR_WIN_NT = 8, + APR_WIN_NT_4 = 12, + APR_WIN_NT_4_SP2 = 14, + APR_WIN_NT_4_SP3 = 15, + APR_WIN_NT_4_SP4 = 16, + APR_WIN_NT_4_SP6 = 18, + APR_WIN_2000 = 24 +} ap_oslevel_e; + + +typedef enum { + DLL_WINBASEAPI = 0, // kernel32 From WinBase.h + DLL_WINADVAPI = 1, // advapi32 From WinBase.h + DLL_WINSOCKAPI = 2, // mswsock From WinSock.h + DLL_WINSOCK2API = 3, // ws2_32 From WinSock2.h + DLL_defined = 4 // must define as last idx_ + 1 +} ap_dlltoken_e; + +FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char *fnName, int ordinal); + +/* The ap_load_dll_func call WILL fault if the function cannot be loaded */ + +#define AP_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ + typedef rettype (calltype *ap_winapi_fpt_##fn) args; \ + static ap_winapi_fpt_##fn ap_winapi_pfn_##fn = NULL; \ + __inline rettype ap_winapi_##fn args \ + { if (!ap_winapi_pfn_##fn) \ + ap_winapi_pfn_##fn = (ap_winapi_fpt_##fn) ap_load_dll_func(lib, #fn, ord); \ + return (*(ap_winapi_pfn_##fn)) names; }; \ + +/* Provide late bound declarations of every API function missing from + * one or more supported releases of the Win32 API + * + * lib is the enumerated token from ap_dlltoken_e, and must correspond + * to the string table entry in start.c used by the ap_load_dll_func(). + * Token names (attempt to) follow Windows.h declarations prefixed by DLL_ + * in order to facilitate comparison. Use the exact declaration syntax + * and names from Windows.h to prevent ambigutity and bugs. + * + * rettype and calltype follow the original declaration in Windows.h + * fn is the true function name - beware Ansi/Unicode #defined macros + * ord is the ordinal within the library, use 0 if it varies between versions + * args is the parameter list following the original declaration, in parens + * names is the parameter list sans data types, enclosed in parens + * + * #undef/re#define the Ansi/Unicode generic name to abate confusion + * In the case of non-text functions, simply #define the original name + */ + +AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( + IN LPCSTR lpFileName, + IN GET_FILEEX_INFO_LEVELS fInfoLevelId, + OUT LPVOID lpFileInformation), + (lpFileName, fInfoLevelId, lpFileInformation)); +#undef GetFileAttributesEx +#define GetFileAttributesEx ap_winapi_GetFileAttributesExA + +AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( + IN HANDLE hFile), + (hFile)); +#define CancelIo ap_winapi_CancelIo + +ap_status_t ap_get_oslevel(struct ap_pool_t *, ap_oslevel_e *); +#endif /* WIN32 */ #endif /* ! MISC_H */ diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 736eb60df78..333ea0defe8 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -61,7 +61,9 @@ #include "apr_pools.h" #include "apr_getopt.h" #include "apr_thread_proc.h" +#include "apr_file_io.h" #include "apr_errno.h" +#include "apr_getopt.h" #ifdef HAVE_STDLIB_H #include #endif @@ -96,6 +98,80 @@ struct ap_other_child_rec_t { int write_fd; }; +#ifdef WIN32 +#define WSAHighByte 2 +#define WSALowByte 0 +/* Platform specific designation of run time os version. + * Gaps allow for specific service pack levels that + * export new kernel or winsock functions or behavior. + */ +typedef enum { + APR_WIN_95 = 0, + APR_WIN_98 = 4, + APR_WIN_NT = 8, + APR_WIN_NT_4 = 12, + APR_WIN_NT_4_SP2 = 14, + APR_WIN_NT_4_SP3 = 15, + APR_WIN_NT_4_SP4 = 16, + APR_WIN_NT_4_SP6 = 18, + APR_WIN_2000 = 24 +} ap_oslevel_e; + + +typedef enum { + DLL_WINBASEAPI = 0, // kernel32 From WinBase.h + DLL_WINADVAPI = 1, // advapi32 From WinBase.h + DLL_WINSOCKAPI = 2, // mswsock From WinSock.h + DLL_WINSOCK2API = 3, // ws2_32 From WinSock2.h + DLL_defined = 4 // must define as last idx_ + 1 +} ap_dlltoken_e; + +FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char *fnName, int ordinal); + +/* The ap_load_dll_func call WILL fault if the function cannot be loaded */ + +#define AP_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ + typedef rettype (calltype *ap_winapi_fpt_##fn) args; \ + static ap_winapi_fpt_##fn ap_winapi_pfn_##fn = NULL; \ + __inline rettype ap_winapi_##fn args \ + { if (!ap_winapi_pfn_##fn) \ + ap_winapi_pfn_##fn = (ap_winapi_fpt_##fn) ap_load_dll_func(lib, #fn, ord); \ + return (*(ap_winapi_pfn_##fn)) names; }; \ + +/* Provide late bound declarations of every API function missing from + * one or more supported releases of the Win32 API + * + * lib is the enumerated token from ap_dlltoken_e, and must correspond + * to the string table entry in start.c used by the ap_load_dll_func(). + * Token names (attempt to) follow Windows.h declarations prefixed by DLL_ + * in order to facilitate comparison. Use the exact declaration syntax + * and names from Windows.h to prevent ambigutity and bugs. + * + * rettype and calltype follow the original declaration in Windows.h + * fn is the true function name - beware Ansi/Unicode #defined macros + * ord is the ordinal within the library, use 0 if it varies between versions + * args is the parameter list following the original declaration, in parens + * names is the parameter list sans data types, enclosed in parens + * + * #undef/re#define the Ansi/Unicode generic name to abate confusion + * In the case of non-text functions, simply #define the original name + */ + +AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( + IN LPCSTR lpFileName, + IN GET_FILEEX_INFO_LEVELS fInfoLevelId, + OUT LPVOID lpFileInformation), + (lpFileName, fInfoLevelId, lpFileInformation)); +#undef GetFileAttributesEx +#define GetFileAttributesEx ap_winapi_GetFileAttributesExA + +AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( + IN HANDLE hFile), + (hFile)); +#define CancelIo ap_winapi_CancelIo + +ap_status_t ap_get_oslevel(struct ap_pool_t *, ap_oslevel_e *); +#endif /* WIN32 */ #endif /* ! MISC_H */ diff --git a/misc/unix/canonerr.c b/misc/unix/canonerr.c index 6fee3e34deb..b2aaa6fad73 100644 --- a/misc/unix/canonerr.c +++ b/misc/unix/canonerr.c @@ -58,7 +58,7 @@ int ap_canonical_error(ap_status_t errcode) { -#if defined(EAGAIN) && defined(EWOULDBLOCK) && (EAGAIN != EWOULDBLOCK) +#if defined(EAGAIN) && defined(EWOULDBLOCK) && (EAGAIN != EWOULDBLOCK) && !defined(WIN32) if (errcode == EWOULDBLOCK) { errcode = EAGAIN; } diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index cca70707227..e196a2ea8cd 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -189,8 +189,46 @@ static char *apr_os_strerror(char* buf, ap_size_t bufsize, int err) */ return stuffbuffer(buf, bufsize, result); } -#else +#elif defined(WIN32) + +static char *apr_os_strerror(char *buf, ap_size_t bufsize, ap_status_t errcode) +{ + DWORD len; + DWORD i; + + len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + errcode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ + (LPTSTR) buf, + bufsize, + NULL); + + if (len) { + /* FormatMessage put the message in the buffer, but it may + * have embedded a newline (\r\n), and possible more than one. + * Remove the newlines replacing them with a space. This is not + * as visually perfect as moving all the remaining message over, + * but more efficient. + */ + i = len; + while (i) { + i--; + if ((buf[i] == '\r') || (buf[i] == '\n')) + buf[i] = ' '; + } + } + else { + /* Windows didn't provide us with a message. Even stuff like * WSAECONNREFUSED won't get a message. + */ + ap_cpystrn(buf, "Unrecognized error code", bufsize); + } + + return buf; +} + +#else /* On Unix, apr_os_strerror() handles error codes from the resolver * (h_errno). e*/ @@ -228,7 +266,17 @@ static char *apr_os_strerror(char* buf, ap_size_t bufsize, int err) char *ap_strerror(ap_status_t statcode, char *buf, ap_size_t bufsize) { if (statcode < APR_OS_START_ERROR) { +#ifdef WIN32 + /* XXX This is just plain wrong. We started discussing this one + * day, and then it dropped, but doing this here is a symptom of a + * problem with the design that will keep us from safely sharing + * Windows code with any other platform. This needs to be changed, + * Windows is NOT a special platform when it comes to APR. rbb + */ + return apr_os_strerror(buf, bufsize, statcode); +#else return stuffbuffer(buf, bufsize, strerror(statcode)); +#endif } else if (statcode < APR_OS_START_USEERR) { return stuffbuffer(buf, bufsize, apr_error_string(statcode)); @@ -237,7 +285,7 @@ char *ap_strerror(ap_status_t statcode, char *buf, ap_size_t bufsize) return stuffbuffer(buf, bufsize, "APR does not understand this error code"); } else { - return apr_os_strerror(buf, bufsize, statcode - APR_OS_START_SYSERR); + return apr_os_strerror(buf, bufsize, statcode - APR_OS_START_SYSERR); } } diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 0272e2c5b11..776d2e224b3 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -33,11 +33,12 @@ #include "misc.h" -int ap_opterr = 1, /* if error message should be printed */ +API_VAR_EXPORT int + ap_opterr = 1, /* if error message should be printed */ ap_optind = 1, /* index into parent argv vector */ ap_optopt, /* character checked for validity */ ap_optreset; /* reset getopt */ -char *ap_optarg = ""; /* argument associated with option */ +API_VAR_EXPORT char *ap_optarg = ""; /* argument associated with option */ #define EMSG "" diff --git a/misc/unix/misc.h b/misc/unix/misc.h index 736eb60df78..333ea0defe8 100644 --- a/misc/unix/misc.h +++ b/misc/unix/misc.h @@ -61,7 +61,9 @@ #include "apr_pools.h" #include "apr_getopt.h" #include "apr_thread_proc.h" +#include "apr_file_io.h" #include "apr_errno.h" +#include "apr_getopt.h" #ifdef HAVE_STDLIB_H #include #endif @@ -96,6 +98,80 @@ struct ap_other_child_rec_t { int write_fd; }; +#ifdef WIN32 +#define WSAHighByte 2 +#define WSALowByte 0 +/* Platform specific designation of run time os version. + * Gaps allow for specific service pack levels that + * export new kernel or winsock functions or behavior. + */ +typedef enum { + APR_WIN_95 = 0, + APR_WIN_98 = 4, + APR_WIN_NT = 8, + APR_WIN_NT_4 = 12, + APR_WIN_NT_4_SP2 = 14, + APR_WIN_NT_4_SP3 = 15, + APR_WIN_NT_4_SP4 = 16, + APR_WIN_NT_4_SP6 = 18, + APR_WIN_2000 = 24 +} ap_oslevel_e; + + +typedef enum { + DLL_WINBASEAPI = 0, // kernel32 From WinBase.h + DLL_WINADVAPI = 1, // advapi32 From WinBase.h + DLL_WINSOCKAPI = 2, // mswsock From WinSock.h + DLL_WINSOCK2API = 3, // ws2_32 From WinSock2.h + DLL_defined = 4 // must define as last idx_ + 1 +} ap_dlltoken_e; + +FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char *fnName, int ordinal); + +/* The ap_load_dll_func call WILL fault if the function cannot be loaded */ + +#define AP_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ + typedef rettype (calltype *ap_winapi_fpt_##fn) args; \ + static ap_winapi_fpt_##fn ap_winapi_pfn_##fn = NULL; \ + __inline rettype ap_winapi_##fn args \ + { if (!ap_winapi_pfn_##fn) \ + ap_winapi_pfn_##fn = (ap_winapi_fpt_##fn) ap_load_dll_func(lib, #fn, ord); \ + return (*(ap_winapi_pfn_##fn)) names; }; \ + +/* Provide late bound declarations of every API function missing from + * one or more supported releases of the Win32 API + * + * lib is the enumerated token from ap_dlltoken_e, and must correspond + * to the string table entry in start.c used by the ap_load_dll_func(). + * Token names (attempt to) follow Windows.h declarations prefixed by DLL_ + * in order to facilitate comparison. Use the exact declaration syntax + * and names from Windows.h to prevent ambigutity and bugs. + * + * rettype and calltype follow the original declaration in Windows.h + * fn is the true function name - beware Ansi/Unicode #defined macros + * ord is the ordinal within the library, use 0 if it varies between versions + * args is the parameter list following the original declaration, in parens + * names is the parameter list sans data types, enclosed in parens + * + * #undef/re#define the Ansi/Unicode generic name to abate confusion + * In the case of non-text functions, simply #define the original name + */ + +AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( + IN LPCSTR lpFileName, + IN GET_FILEEX_INFO_LEVELS fInfoLevelId, + OUT LPVOID lpFileInformation), + (lpFileName, fInfoLevelId, lpFileInformation)); +#undef GetFileAttributesEx +#define GetFileAttributesEx ap_winapi_GetFileAttributesExA + +AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( + IN HANDLE hFile), + (hFile)); +#define CancelIo ap_winapi_CancelIo + +ap_status_t ap_get_oslevel(struct ap_pool_t *, ap_oslevel_e *); +#endif /* WIN32 */ #endif /* ! MISC_H */ diff --git a/misc/unix/start.c b/misc/unix/start.c index 90096a10634..94962d5b67d 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -140,8 +140,23 @@ ap_status_t ap_get_userdata(void **data, char *key, ap_pool_t *cont) ap_status_t ap_initialize(void) { ap_status_t status; -#if !defined(BEOS) && !defined(OS2) +#if !defined(BEOS) && !defined(OS2) && !defined(WIN32) ap_unix_setup_lock(); +#elif defined WIN32 + int iVersionRequested; + WSADATA wsaData; + int err; + + iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); + err = WSAStartup((WORD) iVersionRequested, &wsaData); + if (err) { + return err; + } + if (LOBYTE(wsaData.wVersion) != WSAHighByte || + HIBYTE(wsaData.wVersion) != WSALowByte) { + WSACleanup(); + return APR_EEXIST; + } #endif status = ap_init_alloc(); return status; diff --git a/misc/win32/canonerr.c b/misc/win32/common.c similarity index 84% rename from misc/win32/canonerr.c rename to misc/win32/common.c index aff1e0fc438..fbf2f755c64 100644 --- a/misc/win32/canonerr.c +++ b/misc/win32/common.c @@ -52,20 +52,10 @@ * . */ -#include "misc.h" +#include "../unix/canonerr.c" -/* - * Map Windows system errors to APR specific error codes. - * This routine should only be called when it is necessary to - * selectively react to errors returned by APR functions. - * - * hack alert: - * Certain Windows APR routines already canonicalize their - * return codes in most (and maybe all) cases that are - * interesting to Apache. For now, canonicalization - * on Windows is a no-op. - */ -int ap_canonical_error(ap_status_t code) -{ - return code; -} +#include "../unix/getopt.c" + +#include "../unix/errorcodes.c" + +#include "../unix/start.c" diff --git a/misc/win32/errorcodes.c b/misc/win32/errorcodes.c deleted file mode 100644 index 8a3e96a87b6..00000000000 --- a/misc/win32/errorcodes.c +++ /dev/null @@ -1,198 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_lib.h" -#include "misc.h" - -/* Todo: Merge this code with the code in the misc/unix directory. - * Most of it is common - */ - -/* - * stuffbuffer - like ap_cpystrn() but returns the address of the - * dest buffer instead of the address of the terminating '\0' - */ -static char *stuffbuffer(char *buf, ap_size_t bufsize, const char *s) -{ - ap_cpystrn(buf,s,bufsize); - return buf; -} - -static char *apr_error_string(ap_status_t statcode) -{ - switch (statcode) { - case APR_ENOPOOL: - return "A new pool could not be created."; - case APR_ENOFILE: - return "No file was provided and one was required."; - case APR_EBADDATE: - return "An invalid date has been provided"; - case APR_EINVALSOCK: - return "An invalid socket was returned"; - case APR_ENOPROC: - return "No process was provided and one was required."; - case APR_ENOTIME: - return "No time was provided and one was required."; - case APR_ENODIR: - return "No directory was provided and one was required."; - case APR_ENOLOCK: - return "No lock was provided and one was required."; - case APR_ENOPOLL: - return "No poll structure was provided and one was required."; - case APR_ENOSOCKET: - return "No socket was provided and one was required."; - case APR_ENOTHREAD: - return "No thread was provided and one was required."; - case APR_ENOTHDKEY: - return "No thread key structure was provided and one was required."; - case APR_ENOSHMAVAIL: - return "No shared memory is currently available"; - case APR_EDSOOPEN: - return "Could not open the dso."; - case APR_INCHILD: - return - "Your code just forked, and you are currently executing in the " - "child process"; - case APR_INPARENT: - return - "Your code just forked, and you are currently executing in the " - "parent process"; - case APR_DETACH: - return "The specified thread is detached"; - case APR_NOTDETACH: - return "The specified thread is not detached"; - case APR_CHILD_DONE: - return "The specified child process is done executing"; - case APR_CHILD_NOTDONE: - return "The specified child process is not done executing"; - case APR_TIMEUP: - return "The timeout specified has expired"; - case APR_BADCH: - return "Bad character specified on command line"; - case APR_BADARG: - return "Missing parameter for the specified command line option"; - case APR_EOF: - return "End of file found"; - case APR_NOTFOUND: - return "Could not find specified socket in poll list."; - case APR_ANONYMOUS: - return "Shared memory is implemented anonymously"; - case APR_FILEBASED: - return "Shared memory is implemented using files"; - case APR_KEYBASED: - return "Shared memory is implemented using a key system"; - case APR_EINIT: - return "There is no error, this value signifies an initialized " - "error code"; - case APR_ENOTIMPL: - return "This function has not been implemented on this platform"; - case APR_EMISMATCH: - return "passwords do not match"; - default: - return "Error string not specified yet"; - } -} - -static char *apr_os_strerror(char *buf, ap_size_t bufsize, ap_status_t errcode) -{ - DWORD len; - DWORD i; - - len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - errcode, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ - (LPTSTR) buf, - bufsize, - NULL); - - if (len) { - /* FormatMessage put the message in the buffer, but it may - * have embedded a newline (\r\n), and possible more than one. - * Remove the newlines replacing them with a space. This is not - * as visually perfect as moving all the remaining message over, - * but more efficient. - */ - i = len; - while (i) { - i--; - if ((buf[i] == '\r') || (buf[i] == '\n')) - buf[i] = ' '; - } - } - else { - /* Windows didn't provide us with a message. Even stuff like - * WSAECONNREFUSED won't get a message. - */ - ap_cpystrn(buf, "Unrecognized error code", bufsize); - } - - return buf; -} - -char *ap_strerror(ap_status_t statcode, char* buf, ap_size_t bufsize) -{ - if (statcode < APR_OS_START_ERROR) { - return apr_os_strerror(buf, bufsize, statcode); - } - else if (statcode < APR_OS_START_USEERR) { - return stuffbuffer(buf, bufsize, apr_error_string(statcode)); - } - else if (statcode < APR_OS_START_SYSERR) { - return stuffbuffer(buf, bufsize, "APR does not understand this error code"); - } - else { - return apr_os_strerror(buf, bufsize, statcode - APR_OS_START_SYSERR); - } -} diff --git a/misc/win32/getopt.c b/misc/win32/getopt.c deleted file mode 100644 index 7a5b369e97c..00000000000 --- a/misc/win32/getopt.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 1987, 1993, 1994 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include -#include "misc.h" - -API_VAR_EXPORT int - ap_opterr = 1, /* if error message should be printed */ - ap_optind = 1, /* index into parent argv vector */ - ap_optopt, /* character checked for validity */ - ap_optreset; /* reset getopt */ -API_VAR_EXPORT char * - ap_optarg = ""; /* argument associated with option */ - -#define EMSG "" - -ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap_int32_t *rv, ap_pool_t *cont) -{ - char *p; - static char *place = EMSG; /* option letter processing */ - char *oli; /* option letter list index */ - - if (ap_optreset || !*place) { /* update scanning pointer */ - ap_optreset = 0; - if (ap_optind >= nargc || *(place = nargv[ap_optind]) != '-') { - place = EMSG; - *rv = ap_optopt; - return (APR_EOF); - } - if (place[1] && *++place == '-') { /* found "--" */ - ++ap_optind; - place = EMSG; - *rv = ap_optopt; - return (APR_EOF); - } - } /* option letter okay? */ - if ((ap_optopt = (int) *place++) == (int) ':' || - !(oli = strchr(ostr, ap_optopt))) { - /* - * if the user didn't specify '-' as an option, - * assume it means -1. - */ - if (ap_optopt == (int) '-') { - *rv = ap_optopt; - return (APR_EOF); - } - if (!*place) - ++ap_optind; - if (ap_opterr && *ostr != ':') { - if (!(p = strrchr(*nargv, '/'))) - p = *nargv; - else - ++p; - (void) fprintf(stderr, - "%s: illegal option -- %c\n", p, ap_optopt); - } - *rv = ap_optopt; - return APR_BADCH; - } - if (*++oli != ':') { /* don't need argument */ - ap_optarg = NULL; - if (!*place) - ++ap_optind; - } - else { /* need an argument */ - if (*place) /* no white space */ - ap_optarg = place; - else if (nargc <= ++ap_optind) { /* no arg */ - place = EMSG; - if (*ostr == ':') { - *rv = ap_optopt; - return (APR_BADARG); - } - if (ap_opterr) { - if (!(p = strrchr(*nargv, '/'))) - p = *nargv; - else - ++p; - (void) fprintf(stderr, - "%s: option requires an argument -- %c\n", - p, ap_optopt); - } - *rv = ap_optopt; - return (APR_BADCH); - } - else /* white space */ - ap_optarg = nargv[ap_optind]; - place = EMSG; - ++ap_optind; - } - *rv = ap_optopt; - return APR_SUCCESS; -} - - diff --git a/misc/win32/misc.h b/misc/win32/misc.h deleted file mode 100644 index 5ddb2d2ffad..00000000000 --- a/misc/win32/misc.h +++ /dev/null @@ -1,144 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef MISC_H -#define MISC_H - -#include "apr_general.h" -#include "apr_file_io.h" -#include "apr_errno.h" -#include "apr_getopt.h" - -typedef struct datastruct { - void *data; - char *key; - struct datastruct *next; - struct datastruct *prev; -} datastruct; - -#define WSAHighByte 2 -#define WSALowByte 0 -/* Platform specific designation of run time os version. - * Gaps allow for specific service pack levels that - * export new kernel or winsock functions or behavior. - */ -typedef enum { - APR_WIN_95 = 0, - APR_WIN_98 = 4, - APR_WIN_NT = 8, - APR_WIN_NT_4 = 12, - APR_WIN_NT_4_SP2 = 14, - APR_WIN_NT_4_SP3 = 15, - APR_WIN_NT_4_SP4 = 16, - APR_WIN_NT_4_SP6 = 18, - APR_WIN_2000 = 24 -} ap_oslevel_e; - - -typedef enum { - DLL_WINBASEAPI = 0, // kernel32 From WinBase.h - DLL_WINADVAPI = 1, // advapi32 From WinBase.h - DLL_WINSOCKAPI = 2, // mswsock From WinSock.h - DLL_WINSOCK2API = 3, // ws2_32 From WinSock2.h - DLL_defined = 4 // must define as last idx_ + 1 -} ap_dlltoken_e; - -FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char *fnName, int ordinal); - -/* The ap_load_dll_func call WILL fault if the function cannot be loaded */ - -#define AP_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ - typedef rettype (calltype *ap_winapi_fpt_##fn) args; \ - static ap_winapi_fpt_##fn ap_winapi_pfn_##fn = NULL; \ - __inline rettype ap_winapi_##fn args \ - { if (!ap_winapi_pfn_##fn) \ - ap_winapi_pfn_##fn = (ap_winapi_fpt_##fn) ap_load_dll_func(lib, #fn, ord); \ - return (*(ap_winapi_pfn_##fn)) names; }; \ - -/* Provide late bound declarations of every API function missing from - * one or more supported releases of the Win32 API - * - * lib is the enumerated token from ap_dlltoken_e, and must correspond - * to the string table entry in start.c used by the ap_load_dll_func(). - * Token names (attempt to) follow Windows.h declarations prefixed by DLL_ - * in order to facilitate comparison. Use the exact declaration syntax - * and names from Windows.h to prevent ambigutity and bugs. - * - * rettype and calltype follow the original declaration in Windows.h - * fn is the true function name - beware Ansi/Unicode #defined macros - * ord is the ordinal within the library, use 0 if it varies between versions - * args is the parameter list following the original declaration, in parens - * names is the parameter list sans data types, enclosed in parens - * - * #undef/re#define the Ansi/Unicode generic name to abate confusion - * In the case of non-text functions, simply #define the original name - */ - -AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( - IN LPCSTR lpFileName, - IN GET_FILEEX_INFO_LEVELS fInfoLevelId, - OUT LPVOID lpFileInformation), - (lpFileName, fInfoLevelId, lpFileInformation)); -#undef GetFileAttributesEx -#define GetFileAttributesEx ap_winapi_GetFileAttributesExA - -AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( - IN HANDLE hFile), - (hFile)); -#define CancelIo ap_winapi_CancelIo - -ap_status_t ap_get_oslevel(struct ap_pool_t *, ap_oslevel_e *); - -#endif /* ! MISC_H */ - diff --git a/misc/win32/start.c b/misc/win32/start.c deleted file mode 100644 index fa35f8f2604..00000000000 --- a/misc/win32/start.c +++ /dev/null @@ -1,180 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_private.h" -#include "misc.h" -#include "apr_general.h" -#include "apr_errno.h" -#include "apr_pools.h" -#include "apr_lib.h" -#include -#include -#include - -ap_status_t clean_cont(void *data) -{ - return APR_SUCCESS; -} - - -ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont) -{ - ap_pool_t *new; - - if (cont) { - new = ap_make_sub_pool(cont, cont->apr_abort); - } - else { - new = ap_make_sub_pool(NULL, NULL); - } - - if (new == NULL) { - return APR_ENOPOOL; - } - - new->prog_data = NULL; - new->apr_abort = NULL; - - *newcont = new; - return APR_SUCCESS; -} - -ap_status_t ap_destroy_context(ap_pool_t *cont) -{ - ap_destroy_pool(cont); - return APR_SUCCESS; -} - -ap_status_t ap_set_userdata(void *data, char *key, - ap_status_t (*cleanup) (void *), - ap_pool_t *cont) -{ - datastruct *dptr = NULL, *dptr2 = NULL; - if (cont) { - dptr = cont->prog_data; - while (dptr) { - if (!strcmp(dptr->key, key)) - break; - dptr2 = dptr; - dptr = dptr->next; - } - if (dptr == NULL) { - dptr = ap_palloc(cont, sizeof(datastruct)); - dptr->next = dptr->prev = NULL; - dptr->key = ap_pstrdup(cont, key); - if (dptr2) { - dptr2->next = dptr; - dptr->prev = dptr2; - } - else { - cont->prog_data = dptr; - } - } - dptr->data = data; - ap_register_cleanup(cont, dptr->data, cleanup, cleanup); - return APR_SUCCESS; - } - return APR_ENOPOOL; -} - -ap_status_t ap_get_userdata(void **data, char *key, ap_pool_t *cont) -{ - datastruct *dptr = NULL; - if (cont) { - dptr = cont->prog_data; - while (dptr) { - if (!strcmp(dptr->key, key)) { - break; - } - dptr = dptr->next; - } - if (dptr) { - (*data) = dptr->data; - } - else { - (*data) = NULL; - } - return APR_SUCCESS; - } - return APR_ENOPOOL; -} - -/* This puts one thread in a Listen for signals mode */ -ap_status_t ap_initialize(void) -{ - ap_status_t status; - int iVersionRequested; - WSADATA wsaData; - int err; - - iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); - err = WSAStartup((WORD) iVersionRequested, &wsaData); - if (err) { - return err; - } - if (LOBYTE(wsaData.wVersion) != WSAHighByte || - HIBYTE(wsaData.wVersion) != WSALowByte) { - WSACleanup(); - return APR_EEXIST; - } - - status = ap_init_alloc(); - return status; -} - -void ap_terminate(void) -{ - WSACleanup(); - ap_term_alloc(); -} From dc78315bebcf167c82134aa6137fb97677adaccb Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 17 May 2000 23:12:56 +0000 Subject: [PATCH 0086/7878] Commit a file I forgot to commit yesterday while I was removing BeOS thread/process merge changes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60060 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/Makefile.in | 6 ------ threadproc/unix/procsup.c | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index caaf880927c..18b8e4a8329 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -77,12 +77,6 @@ thread.o: thread.c threadproc.h $(INCDIR)/apr_private.h \ ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ $(INCDIR)/apr_lock.h -threadcancel.o: threadcancel.c threadproc.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h ../../file_io/unix/fileio.h \ - $(INCDIR)/apr_lib.h threadpriv.o: threadpriv.c threadproc.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index a2bdf38f1e5..9db506ece1f 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -63,7 +63,7 @@ ap_status_t ap_detach(ap_proc_t **new, ap_pool_t *cont) (*new)->attr = NULL; chdir("/"); -#if !defined(MPE) && !defined(OS2) && !defined(TPF) +#if !defined(MPE) && !defined(OS2) && !defined(TPF) && !defined(BEOS) /* Don't detach for MPE because child processes can't survive the death of the parent. */ if ((x = fork()) > 0) @@ -114,7 +114,6 @@ ap_status_t ap_detach(ap_proc_t **new, ap_pool_t *cont) if (freopen("/dev/null", "w", stderr) == NULL) { return errno; } - return APR_SUCCESS; } From 8e0d1c2ebba86b4ee04f2312e957518d41196ca3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 17 May 2000 23:24:41 +0000 Subject: [PATCH 0087/7878] Common files are the wrong way to solve this for Win32. The correct way to solve this problem is to add the ../unix/foo file to the MSVC project file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60061 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/common.c | 56 -------------------------------------- misc/win32/common.c | 61 ------------------------------------------ 2 files changed, 117 deletions(-) delete mode 100644 file_io/win32/common.c delete mode 100644 misc/win32/common.c diff --git a/file_io/win32/common.c b/file_io/win32/common.c deleted file mode 100644 index 52aef93a520..00000000000 --- a/file_io/win32/common.c +++ /dev/null @@ -1,56 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "../unix/fileacc.c" - diff --git a/misc/win32/common.c b/misc/win32/common.c deleted file mode 100644 index fbf2f755c64..00000000000 --- a/misc/win32/common.c +++ /dev/null @@ -1,61 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "../unix/canonerr.c" - -#include "../unix/getopt.c" - -#include "../unix/errorcodes.c" - -#include "../unix/start.c" From ec42bc8426f5b44bf13f250e8cb06119d50a9b15 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 17 May 2000 23:30:08 +0000 Subject: [PATCH 0088/7878] This commit will most likely break everybody on Windows. The .dsp files I am checking in though will build a usable Apache on Windows. This finishes at least the first round of the merge work to get the common code into common files in APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60062 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 11 ++++++----- aprlib.dsp | 11 ++++++----- aprlibdll.dsp | 16 +++++++--------- libapr.dsp | 16 +++++++--------- 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/apr.dsp b/apr.dsp index 05fac6e52e2..976e3775b15 100644 --- a/apr.dsp +++ b/apr.dsp @@ -25,6 +25,7 @@ CFG=aprlib - Win32 Debug # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe +RSC=rc.exe !IF "$(CFG)" == "aprlib - Win32 Release" @@ -41,6 +42,8 @@ CPP=cl.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -62,8 +65,10 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -326,10 +331,6 @@ SOURCE=.\locks\win32\locks.h # End Source File # Begin Source File -SOURCE=.\misc\win32\misc.h -# End Source File -# Begin Source File - SOURCE=.\network_io\win32\networkio.h # End Source File # Begin Source File diff --git a/aprlib.dsp b/aprlib.dsp index 05fac6e52e2..976e3775b15 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -25,6 +25,7 @@ CFG=aprlib - Win32 Debug # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe +RSC=rc.exe !IF "$(CFG)" == "aprlib - Win32 Release" @@ -41,6 +42,8 @@ CPP=cl.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -62,8 +65,10 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -326,10 +331,6 @@ SOURCE=.\locks\win32\locks.h # End Source File # Begin Source File -SOURCE=.\misc\win32\misc.h -# End Source File -# Begin Source File - SOURCE=.\network_io\win32\networkio.h # End Source File # Begin Source File diff --git a/aprlibdll.dsp b/aprlibdll.dsp index 627fa0a570e..f5c1fefc0db 100644 --- a/aprlibdll.dsp +++ b/aprlibdll.dsp @@ -17,10 +17,8 @@ CFG=aprlibdll - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "aprlibdll - Win32 Release" (based on\ - "Win32 (x86) Dynamic-Link Library") -!MESSAGE "aprlibdll - Win32 Debug" (based on\ - "Win32 (x86) Dynamic-Link Library") +!MESSAGE "aprlibdll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "aprlibdll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project @@ -46,8 +44,8 @@ RSC=rc.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -71,10 +69,10 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/libapr.dsp b/libapr.dsp index 627fa0a570e..f5c1fefc0db 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -17,10 +17,8 @@ CFG=aprlibdll - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "aprlibdll - Win32 Release" (based on\ - "Win32 (x86) Dynamic-Link Library") -!MESSAGE "aprlibdll - Win32 Debug" (based on\ - "Win32 (x86) Dynamic-Link Library") +!MESSAGE "aprlibdll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "aprlibdll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project @@ -46,8 +44,8 @@ RSC=rc.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -71,10 +69,10 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe From 5b58b54bf817f3f838b6347d6ab38de9e076f3ec Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 18 May 2000 01:37:43 +0000 Subject: [PATCH 0089/7878] Fix typo in prototype. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60063 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 31bf5c5871a..c0953501a17 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -648,7 +648,7 @@ B: Since this can be called by a maintenance function while we're =cut */ -void ap_unregister_other_children(void *data); +void ap_unregister_other_child(void *data); /* From 33feba91c1f4a4fd082c8142c77e763230778d10 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 18 May 2000 02:17:24 +0000 Subject: [PATCH 0090/7878] Fix problem where the Unix mpms had an unitialized variable for child exit status by adding an exit status parameter to ap_wait_all_procs(); with this change, the mpms use ap_wait_all_procs() more like they previously used waitpid(). With the introduction of the exit status parameter, the definition of ap_wait_t was moved from Apache to APR. There was some handling of union wait for the type of the exit status parameter to waitpid() which I retained (but cannot test). For WIN32, ap_wait_t was defined as int (in apr.hw). No current Windows code uses ap_wait_t, but a type is required so that references to ap_wait_t in apr_thread_proc.h can compile on Windows. Note: There is still a storage leak in the way that the Unix mpms call ap_wait_all_procs()... this will be resolved at some later time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60064 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 ++- include/apr.h.in | 18 ++++++++++++++++++ include/apr.hw | 2 ++ include/apr_thread_proc.h | 21 ++++++++++++--------- threadproc/unix/proc.c | 29 ++++++++++------------------- 5 files changed, 44 insertions(+), 29 deletions(-) diff --git a/configure.in b/configure.in index e426da660d5..a21588a8f72 100644 --- a/configure.in +++ b/configure.in @@ -209,7 +209,7 @@ AC_CHECK_HEADERS(sys/signal.h) AC_CHECK_HEADERS(sys/socket.h) AC_CHECK_HEADERS(sys/stat.h) AC_CHECK_HEADERS(sys/types.h, sys_typesh="1", sys_typesh="0") -AC_CHECK_HEADERS(sys/wait.h) +AC_CHECK_HEADERS(sys/wait.h, sys_waith="1", sys_waith="0") AC_CHECK_HEADERS(dlfcn.h) AC_CHECK_HEADERS(dl.h) @@ -224,6 +224,7 @@ AC_SUBST(stdioh) AC_SUBST(sys_typesh) AC_SUBST(sys_uioh) AC_SUBST(signalh) +AC_SUBST(sys_waith) AC_SUBST(pthreadh) dnl #----------------------------- Checks for standard typedefs diff --git a/include/apr.h.in b/include/apr.h.in index 5b020a5c27e..921779594e7 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -34,6 +34,7 @@ #define APR_HAVE_SYS_TYPES_H @sys_typesh@ #define APR_HAVE_SYS_UIO_H @sys_uioh@ #define APR_HAVE_SIGNAL_H @signalh@ +#define APR_HAVE_SYS_WAIT_H @sys_waith@ #define APR_USE_FLOCK_SERIALIZE @flockser@ #define APR_USE_SYSVSEM_SERIALIZE @sysvser@ @@ -117,4 +118,21 @@ Sigfunc *ap_signal(int signo, Sigfunc * func); #define ap_signal(a,b) signal(a,b) #endif +#ifdef APR_HAVE_SYS_WAIT_H + +/* We have a POSIX wait interface */ +#include + +#ifdef WEXITSTATUS +#define ap_wait_t int +#else +/* We don't have a POSIX wait interface. Assume we have the old-style. Is this + * a bad assumption? */ +/* Yessiree bob, it was... but will this work instead? */ +#define ap_wait_t union wait +#define WEXITSTATUS(status) (int)((status).w_retcode) +#define WTERMSIG(status) (int)((status).w_termsig) +#endif /* !WEXITSTATUS */ +#endif /* HAVE_SYS_WAIT_H */ + #endif /* APR_H */ diff --git a/include/apr.hw b/include/apr.hw index e52a1a23d76..7d58f7e086e 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -172,6 +172,8 @@ typedef int gid_t; #define ap_signal(a,b) signal(a,b) +typedef int ap_wait_t; + /* struct iovec is needed to emulate Unix writev */ struct iovec { char* iov_base; diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index c0953501a17..4cdac39f230 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -468,7 +468,7 @@ ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc); B arg 1) The user data to associate with the file. - arg 2) The key to use for assocaiteing data with the file. + arg 2) The key to use for associating data with the file. arg 3) The cleanup routine to use when the file is destroyed. arg 4) The current process. @@ -481,7 +481,7 @@ ap_status_t ap_set_procdata(void *data, char *key, =head1 ap_status_t ap_get_childin(ap_file_t **new, ap_proc_t *proc) -B +B arg 1) The returned file handle. arg 2) The process handle that corresponds to the desired child process @@ -494,7 +494,7 @@ ap_status_t ap_get_childin(ap_file_t **new, ap_proc_t *proc); =head1 ap_status_t ap_get_childout(ap_file_t **new, ap_proc_t *proc) -B +B arg 1) The returned file handle. arg 2) The process handle that corresponds to the desired child process @@ -507,7 +507,7 @@ ap_status_t ap_get_childout(ap_file_t **new, ap_proc_t *proc); =head1 ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc) -B +B arg 1) The returned file handle. arg 2) The process handle that corresponds to the desired child process @@ -577,23 +577,26 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e waithow); /* -=head1 ap_status_t ap_wait_all_procs(ap_proc_t **proc, ap_wait_how waithow, ap_pool_t *p) +=head1 ap_status_t ap_wait_all_procs(ap_proc_t **proc, ap_wait_t *status, ap_wait_how waithow, ap_pool_t *p) B arg 1) Pointer to NULL on entry, will be filled out with child's information - arg 2) How should we wait. One of: + arg 2) The returned exit status of the child, if a child process dies + On platforms that don't support obtaining this information, the + status parameter will be returned as APR_ENOTIMPL. + arg 3) How should we wait. One of: APR_WAIT -- block until the child process dies. APR_NOWAIT -- return immediately regardless of if the child is dead or not. - arg 3) Pool to allocate child information out of. + arg 4) Pool to allocate child information out of. =cut */ -ap_status_t ap_wait_all_procs(ap_proc_t **proc, ap_wait_how_e waithow, - ap_pool_t *p); +ap_status_t ap_wait_all_procs(ap_proc_t **proc, ap_wait_t *status, + ap_wait_how_e waithow, ap_pool_t *p); /* diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 7f00b860dde..e515e5d02cc 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -320,34 +320,25 @@ ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc) return APR_SUCCESS; } -ap_status_t ap_wait_all_procs(ap_proc_t **proc, +ap_status_t ap_wait_all_procs(ap_proc_t **proc, ap_wait_t *status, ap_wait_how_e waithow, ap_pool_t *p) { - pid_t status; - if (waithow == APR_WAIT) { - if ((status = waitpid(-1, NULL, WUNTRACED)) > 0) { - if (!*proc) { - (*proc) = ap_pcalloc(p, sizeof(ap_proc_t)); - (*proc)->cntxt = p; - } - (*proc)->pid = status; - return APR_CHILD_DONE; - } - else if (status == 0) { - (*proc) = NULL; - return APR_CHILD_NOTDONE; - } - return errno; + pid_t pid; + int waitpid_options = WUNTRACED; + + if (waithow != APR_WAIT) { + waitpid_options |= WNOHANG; } - if ((status = waitpid(-1, NULL, WUNTRACED | WNOHANG)) > 0) { + + if ((pid = waitpid(-1, status, waitpid_options)) > 0) { if (!*proc) { (*proc) = ap_pcalloc(p, sizeof(ap_proc_t)); (*proc)->cntxt = p; } - (*proc)->pid = status; + (*proc)->pid = pid; return APR_CHILD_DONE; } - else if (status == 0) { + else if (pid == 0) { (*proc) = NULL; return APR_CHILD_NOTDONE; } From 31fe12a41ca544c25de420e489e338a4449c4b68 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 18 May 2000 11:21:22 +0000 Subject: [PATCH 0091/7878] Allow apr/lib to build on platforms that don't have their own apr/misc/OSDIR by adding path to misc/unix at the end of the include list. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60065 13f79535-47bb-0310-9956-ffa450edef68 --- lib/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Makefile.in b/lib/Makefile.in index 61a74555d99..39e69cbf4f3 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -12,7 +12,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include INCDIR1=../misc/@OSDIR@ -INCLUDES=-I$(INCDIR) -I$(INCDIR1) +INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix #LIB=@LIBPREFIX@apr.a From d26b7be1822c88a462d647e0501f85dc843e79dd Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 18 May 2000 19:30:05 +0000 Subject: [PATCH 0092/7878] Fix some logic in mm's configuration that removes -g from CFLAGS. It incorrectly collapsed " -g " to "", which could lead to invalid CFLAGS. Example: input: -DAPACHE_XLATE -g -Wall otherstuff old output: -DAPACHE_XLATE-Wall otherstuff new output: -DAPACHE_XLATE -Wall otherstuff (Note: This fix will also be sent to rse.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60066 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/mm/aclocal.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shmem/unix/mm/aclocal.m4 b/shmem/unix/mm/aclocal.m4 index d7b97fc4560..f436b7b8698 100644 --- a/shmem/unix/mm/aclocal.m4 +++ b/shmem/unix/mm/aclocal.m4 @@ -91,7 +91,7 @@ AC_DEFINE(MM_DEBUG) ],[ case "$CFLAGS" in *-g* ) CFLAGS=`echo "$CFLAGS" |\ - sed -e 's/ -g //g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;; + sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;; esac msg=disabled ])dnl From b6d8732ddf8f1a54dccb04642d97f30028a978a8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 18 May 2000 19:36:15 +0000 Subject: [PATCH 0093/7878] Provide a dummy implementation of ap_MD5SetXlate() on platforms where APR doesn't implement character set translation. This is in the same style as the dummy routines in apr_xlate.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60067 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_md5.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_md5.h b/include/apr_md5.h index 4d28d0a62c8..8bdf1e3037f 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -110,6 +110,8 @@ typedef struct { API_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context); #if APR_HAS_XLATE API_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate); +#else +#define ap_MD5SetXlate(context, xlate) APR_ENOTIMPL #endif API_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, From 3c4d308b703a259fc9a08593a653614665b29bb6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 18 May 2000 23:24:55 +0000 Subject: [PATCH 0094/7878] First function removed from Unix MPM's and moved to a common file. This work is not anywhere near finished, but the cleanup has begun at least. Had to make a couple of variables non-static, so a name change was required since they are now viewable from outside the library. The advantage to this is code that is much easier to maintain into the future, because it is duplicated less often. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60068 13f79535-47bb-0310-9956-ffa450edef68 --- lib/Makefile.in | 2 +- network_io/unix/Makefile.in | 1 + threadproc/unix/Makefile.in | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Makefile.in b/lib/Makefile.in index 39e69cbf4f3..8d6f69a32f8 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -82,7 +82,7 @@ apr_hash.o: apr_hash.c $(INCDIR)/apr_private.h \ apr_md5.o: apr_md5.c $(INCDIR)/apr_private.h $(INCDIR)/apr_md5.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_xlate.h apr_pools.o: apr_pools.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ diff --git a/network_io/unix/Makefile.in b/network_io/unix/Makefile.in index afab54c1f87..c1c245d6ce6 100644 --- a/network_io/unix/Makefile.in +++ b/network_io/unix/Makefile.in @@ -52,6 +52,7 @@ depend: && rm Makefile.new # DO NOT REMOVE +inet_aton.o: inet_aton.c $(INCDIR)/apr_private.h poll.o: poll.c networkio.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index 18b8e4a8329..caaf880927c 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -77,6 +77,12 @@ thread.o: thread.c threadproc.h $(INCDIR)/apr_private.h \ ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ $(INCDIR)/apr_lock.h +threadcancel.o: threadcancel.c threadproc.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_time.h ../../file_io/unix/fileio.h \ + $(INCDIR)/apr_lib.h threadpriv.o: threadpriv.c threadproc.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ From 1cbc5e0ddf394069cce0fd53cadcc13c26310124 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 19 May 2000 05:01:52 +0000 Subject: [PATCH 0095/7878] Fixes to allow Apache to run as a Win95 service... highlights main_win32.h : Moved delarations to a header, by request ap_listen.h : References types declared in http_config.h http_main.h : Add the Win32 flavor entry point declaration apr.hw : Cleanup the redundancy department of redundancy win32/proc.c : Double null termination was required here Everything else should be obvious and isolated to Win32. Build files will be committed seperately. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60069 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 1 - threadproc/win32/proc.c | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 7d58f7e086e..1f346e4ec9b 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -91,7 +91,6 @@ #define NOIME #endif #include -#include /* * Add a _very_few_ declarations missing from the restricted set of headers * (If this list becomes extensive, re-enable the required headers above!) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 0deb6f87cfe..6d40919b9b3 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -340,7 +340,9 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, pNext = pNext + strlen(pNext) + 1; i++; } - strcpy(pNext, envstr); + strcpy(pNext, envstr); + pNext = pNext + strlen(pNext) + 1; + *pNext = '\0'; } else { SetEnvironmentVariable("parentpid", ppid); From fd22d33e9cc98e6475466fe7206b102c4ecfe302 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 19 May 2000 05:09:14 +0000 Subject: [PATCH 0096/7878] Current and clean make files for Win95. Changes Include: All projects link incrementally with no link maps in Debug mode. New cvstodsp6.pl and dsp6tocvs.pl will fix up /the /ZI - /Zi issue. Includes corrections noted by Tim Costello git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60070 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 14 +++++++------- aprlib.dsp | 14 +++++++------- aprlibdll.dsp | 19 +++++++++++-------- libapr.dsp | 19 +++++++++++-------- 4 files changed, 36 insertions(+), 30 deletions(-) diff --git a/apr.dsp b/apr.dsp index 976e3775b15..c0203ff7759 100644 --- a/apr.dsp +++ b/apr.dsp @@ -40,7 +40,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 @@ -131,7 +131,7 @@ SOURCE=.\aprlib.def # End Source File # Begin Source File -SOURCE=.\misc\win32\canonerr.c +SOURCE=.\misc\unix\canonerr.c # End Source File # Begin Source File @@ -143,11 +143,11 @@ SOURCE=.\dso\win32\dso.c # End Source File # Begin Source File -SOURCE=.\misc\win32\errorcodes.c +SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\fileacc.c +SOURCE=.\file_io\unix\fileacc.c # End Source File # Begin Source File @@ -159,7 +159,7 @@ SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File -SOURCE=.\misc\win32\getopt.c +SOURCE=.\misc\unix\getopt.c # End Source File # Begin Source File @@ -223,7 +223,7 @@ SOURCE=.\network_io\win32\sockopt.c # End Source File # Begin Source File -SOURCE=.\misc\win32\start.c +SOURCE=.\misc\unix\start.c # End Source File # Begin Source File diff --git a/aprlib.dsp b/aprlib.dsp index 976e3775b15..c0203ff7759 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -40,7 +40,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 @@ -131,7 +131,7 @@ SOURCE=.\aprlib.def # End Source File # Begin Source File -SOURCE=.\misc\win32\canonerr.c +SOURCE=.\misc\unix\canonerr.c # End Source File # Begin Source File @@ -143,11 +143,11 @@ SOURCE=.\dso\win32\dso.c # End Source File # Begin Source File -SOURCE=.\misc\win32\errorcodes.c +SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\fileacc.c +SOURCE=.\file_io\unix\fileacc.c # End Source File # Begin Source File @@ -159,7 +159,7 @@ SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File -SOURCE=.\misc\win32\getopt.c +SOURCE=.\misc\unix\getopt.c # End Source File # Begin Source File @@ -223,7 +223,7 @@ SOURCE=.\network_io\win32\sockopt.c # End Source File # Begin Source File -SOURCE=.\misc\win32\start.c +SOURCE=.\misc\unix\start.c # End Source File # Begin Source File diff --git a/aprlibdll.dsp b/aprlibdll.dsp index f5c1fefc0db..e51f740f36b 100644 --- a/aprlibdll.dsp +++ b/aprlibdll.dsp @@ -17,8 +17,10 @@ CFG=aprlibdll - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "aprlibdll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "aprlibdll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "aprlibdll - Win32 Release" (based on\ + "Win32 (x86) Dynamic-Link Library") +!MESSAGE "aprlibdll - Win32 Debug" (based on\ + "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project @@ -44,8 +46,8 @@ RSC=rc.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -69,10 +71,10 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -80,7 +82,8 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# SUBTRACT LINK32 /incremental:no /map !ENDIF diff --git a/libapr.dsp b/libapr.dsp index f5c1fefc0db..e51f740f36b 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -17,8 +17,10 @@ CFG=aprlibdll - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "aprlibdll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "aprlibdll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "aprlibdll - Win32 Release" (based on\ + "Win32 (x86) Dynamic-Link Library") +!MESSAGE "aprlibdll - Win32 Debug" (based on\ + "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project @@ -44,8 +46,8 @@ RSC=rc.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -69,10 +71,10 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -80,7 +82,8 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# SUBTRACT LINK32 /incremental:no /map !ENDIF From feac287e7c4e660b83d95605f1f4eb77bb6807ac Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 19 May 2000 21:44:11 +0000 Subject: [PATCH 0097/7878] Add two APR docs. The first talks about why we are using incomplete types. The second talks about using APR'ized programs with non-APR'ized programs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60071 13f79535-47bb-0310-9956-ffa450edef68 --- docs/incomplete_types | 84 +++++++++++++++++++++++++++++++++++++++++++ docs/non_apr_programs | 47 ++++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 docs/incomplete_types create mode 100644 docs/non_apr_programs diff --git a/docs/incomplete_types b/docs/incomplete_types new file mode 100644 index 00000000000..cbed7774232 --- /dev/null +++ b/docs/incomplete_types @@ -0,0 +1,84 @@ +The question has been asked multiple times, "Why is APR using Incomplete +types?" This document will try to explain that. + +Incomplete types are used in APR because they can enforce portability, and +they make the APR developers job easier, as well as allowing APR to use native +types on all platforms. Imagine a scenario where APR wasn't using incomplete +types. The ap_file_t type would have to be defined as: + +typedef struct ap_file_t { + ap_pool_t *pool + char *fname; + int eof_hit; + int pipe; + ap_interval_time_t timeout; +#ifdef WIN32 + HANDLE file_handle; + DWORD dwFileAttributes; +#elif defined(OS2) + HFILE filedes; + HEV PipeSem +#else + int filedes; + int ungetchar; +#endif + +#ifndef WIN32 + int buffered; + ap_int32_flags + int isopen; + + /* Stuff for buffered mode */ + char *buffer; + int bufpos; + unsigned long dataRead; + int direction; + unsigned long filePtr; + ap_lock_t *mutex; +#endif +} ap_file_t; + +This captures the essense of what is currently being defined for ap_file_t +using incomplete types. However, using this structure leads developers to +believe that they are safe accessing any of the fields in this structure. +This is not true. On some platforms, such as Windows, about half of the +structure disappears. We could combine some of these definitions with +macros, for example: + +#ifdef WIN32 +#define filetype HANDLE +#elif OS2 +#define filetype HFILE +#else +#define filetype int +#endif + +And then in the defintion for ap_file_t, we could say: + filetype filedes; + +This gets rid of some of the complexity, by moving it off to the side, but +it is still not safe for a programmers to access the filedes field directly +outside of APR, because the programmer has no way of knowing what the actual +type is. So for example printing the filedes using printf would yield wildly +varying results on Windows and OS2 when compared to Unix. + +Another option also presents itself. Stick strictly to POSIX. This means +that all code can be shared on any POSIX compliant platform. The problem +with this is performance. One of the benefits to APR, is that it allows +developers to easily use native types on all platforms with the same code. +This has proven to provide a substantial performance boost on most non-Unix +platforms. + +Having said all of that, sometimes incomplete types just don't make sense. +For example, the first implementation of time functions used incomplete types, +which added a layer of complexity that turned out to be unnecessary. If +a platform cannot provide a simple number that represents the number of seconds +elapsed since a specifed date and time, then APR doesn't really want to +provide support for that platform. + +APR is trying hard to provide a balance of incomplete and complete types, +but like all things, sometimes the developers make mistakes. If you are +using APR and find that there is an incomplete type that doesn't need to be +an incomplete type, please let us know, we are more than willing to listen +and design parts of APR that do not use incomplete types. + diff --git a/docs/non_apr_programs b/docs/non_apr_programs new file mode 100644 index 00000000000..47b7d8ec60c --- /dev/null +++ b/docs/non_apr_programs @@ -0,0 +1,47 @@ +How do I use APR'ized programs in connection with programs that don't +use APR? These darn incomplete types don't let me fill out the APR types. + +The APR developers acknowledge that most programs are not using APR, and +we don't expect them to migrate to using APR just because APR has been +released. So, we have provided a way for non-APR'ized programs to interact +very cleanly with APR. + +There are a set of programs, all documented in apr_portable.h, which allow +a programmer to either get a native type from an APR type, or to setup an +APR type from a native type. + +For example, if you are writing an add-on to another program that does not use +APR for file I/O, but you (in your infinite wisdom) want to use APR to make +sure your section is portable. Assume the program provides a type foo_t with +a file descriptor in it (fd). + +void function_using_apr(foo_t non_apr_struct, ap_pool_t *p) +{ + ap_file_t *apr_file = NULL; + + ap_put_os_file(&apr_file, &non_apr_struct->fd, p); + + ... +} + +There are portable functions for each APR incomplete type. They are all +called ap_put_os_foobar(), and they each take the same basic arguments, a +pointer to a pointer to the incomplete type (the last pointer in that list +should be NULL), a pointer to the native type, and a pool. Each of these can +be found in apr_portable.h. + +If you have to do the exact opposite (take an APR type and convert it to a +native type, there are functions for that too. For example: + +void function_not_using_apr(apr_file_t *apr_file) +{ + int unix_file_desc; + + ap_get_os_file(&unix_file_desc, apr_file); + + ... +} + +For each ap_put_os_foobar, there is a corresponding ap_get_os_file. These are +also documented in apr_portable.h. + From 4e4b99af70dcb284e3be50d1cb0fdc43cc414e88 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 19 May 2000 23:04:39 +0000 Subject: [PATCH 0098/7878] Remove some stuff left over from the old context code. The removes a warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60072 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_pools.c | 20 -------------------- memory/unix/apr_pools.c | 20 -------------------- 2 files changed, 40 deletions(-) diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 0d853a730ab..e488dce7392 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -575,26 +575,6 @@ struct cleanup { struct cleanup *next; }; -static void * ap_pool_palloc(ap_pool_t *a, int reqsize, int (*apr_abort)(int retcode)); - -#if 0 -static void ap_register_pool_cleanup(struct ap_pool_t *p, void *data, - ap_status_t (*plain_cleanup) (void *), - ap_status_t (*child_cleanup) (void *)) -{ - struct cleanup *c; - - if (p != NULL) { - c = (struct cleanup *) ap_pool_palloc(p, sizeof(struct cleanup), NULL); - c->data = data; - c->plain_cleanup = plain_cleanup; - c->child_cleanup = child_cleanup; - c->next = p->cleanups; - p->cleanups = c; - } -} -#endif - API_EXPORT(void) ap_register_cleanup(ap_pool_t *p, void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 0d853a730ab..e488dce7392 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -575,26 +575,6 @@ struct cleanup { struct cleanup *next; }; -static void * ap_pool_palloc(ap_pool_t *a, int reqsize, int (*apr_abort)(int retcode)); - -#if 0 -static void ap_register_pool_cleanup(struct ap_pool_t *p, void *data, - ap_status_t (*plain_cleanup) (void *), - ap_status_t (*child_cleanup) (void *)) -{ - struct cleanup *c; - - if (p != NULL) { - c = (struct cleanup *) ap_pool_palloc(p, sizeof(struct cleanup), NULL); - c->data = data; - c->plain_cleanup = plain_cleanup; - c->child_cleanup = child_cleanup; - c->next = p->cleanups; - p->cleanups = c; - } -} -#endif - API_EXPORT(void) ap_register_cleanup(ap_pool_t *p, void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)) From 840edb3de361f809c2b636327ec2e30db13bcdc1 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 19 May 2000 23:08:27 +0000 Subject: [PATCH 0099/7878] Fix a bug in the hash code. I can't see how this was ever working. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60073 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/apr_hash.c b/lib/apr_hash.c index 8d31d07f5ff..1242aac751c 100644 --- a/lib/apr_hash.c +++ b/lib/apr_hash.c @@ -130,7 +130,7 @@ static ap_hash_entry_t **alloc_array(ap_hash_t *ht) API_EXPORT(ap_hash_t *) ap_make_hash(ap_pool_t *pool) { ap_hash_t *ht; - ht = ap_palloc(ht->pool, sizeof(*ht)); + ht = ap_palloc(pool, sizeof(ap_hash_t)); ht->pool = pool; ht->count = 0; ht->max = INITIAL_MAX; From 620d044277eccbe638d919658ba5c72025c0b4c6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 19 May 2000 23:13:31 +0000 Subject: [PATCH 0100/7878] Make Apache and APR use the same flags to specify maintainer mode. I chose to use --with-maintainer-mode, because that flag can be passed down using AC_CONFIG_SUBDIRS. I couldn't find any easy way to pass environment variables to configure scripts called from within Apache's configure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60074 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.in b/configure.in index a21588a8f72..f0b4b434e83 100644 --- a/configure.in +++ b/configure.in @@ -68,6 +68,9 @@ AC_ARG_WITH(optim,[ --with-optim="FLAGS" compiler optimisation flags], AC_ARG_WITH(debug,[ --with-debug Turn on debugging and compile time warnings], [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall"; else CFLAGS="$CFLAGS -g"; fi]) +AC_ARG_WITH(maintainer-mode,[ --with-maintainer-mode Turn on debugging and compile time warnings], + [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"; else CFLAGS="$CFLAGS -g"; fi]) + dnl # this is the place to put specific options for platform/compiler dnl # combinations case "$OS:$CC" in From e31245580b51516c813324c175f5668bbef1e6ef Mon Sep 17 00:00:00 2001 From: Manoj Kasichainula Date: Sun, 21 May 2000 05:13:10 +0000 Subject: [PATCH 0101/7878] Since cleanups return an APR status, ap_run_cleanup should too. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60075 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 2 +- lib/apr_pools.c | 7 +++++-- memory/unix/apr_pools.c | 7 +++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index 64d6d7323e1..60daf956fa5 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -341,7 +341,7 @@ API_EXPORT(void) ap_register_cleanup(struct ap_pool_t *p, void *data, ap_status_t (*child_cleanup) (void *)); API_EXPORT(void) ap_kill_cleanup(struct ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)); -API_EXPORT(void) ap_run_cleanup(struct ap_pool_t *p, void *data, +API_EXPORT(ap_status_t) ap_run_cleanup(struct ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)); API_EXPORT(void) ap_cleanup_for_exec(void); API_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize); diff --git a/lib/apr_pools.c b/lib/apr_pools.c index e488dce7392..d4bc790eccd 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -612,13 +612,16 @@ API_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, } } -API_EXPORT(void) ap_run_cleanup(ap_pool_t *p, void *data, +API_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)) { + ap_status_t rv; + ap_block_alarms(); /* Run cleanup only once! */ - (*cleanup) (data); + rv = (*cleanup) (data); ap_kill_cleanup(p, data, cleanup); ap_unblock_alarms(); + return rv; } static void run_cleanups(struct cleanup *c) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index e488dce7392..d4bc790eccd 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -612,13 +612,16 @@ API_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, } } -API_EXPORT(void) ap_run_cleanup(ap_pool_t *p, void *data, +API_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)) { + ap_status_t rv; + ap_block_alarms(); /* Run cleanup only once! */ - (*cleanup) (data); + rv = (*cleanup) (data); ap_kill_cleanup(p, data, cleanup); ap_unblock_alarms(); + return rv; } static void run_cleanups(struct cleanup *c) From e39a7f1a9e76ed7dcfb667c59f24f40b8231a812 Mon Sep 17 00:00:00 2001 From: Manoj Kasichainula Date: Sun, 21 May 2000 05:31:05 +0000 Subject: [PATCH 0102/7878] Remove all remaining instances in Apache code of ap_{block,unblock}_alarms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60076 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 12 ------------ lib/apr_pools.c | 27 --------------------------- memory/unix/apr_pools.c | 27 --------------------------- 3 files changed, 66 deletions(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index 60daf956fa5..9f58b214cd3 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -358,18 +358,6 @@ API_EXPORT(int) API_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size); -/* - * Routine definitions that only work on Windows. - */ - -/*#ifdef TPF*/ -#define ap_block_alarms() -#define ap_unblock_alarms() -/*#else -API_EXPORT(void) ap_block_alarms(void); -API_EXPORT(void) ap_unblock_alarms(void); -#endif */ - #ifdef __cplusplus } #endif diff --git a/lib/apr_pools.c b/lib/apr_pools.c index d4bc790eccd..45f4827f333 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -497,7 +497,6 @@ API_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retc union block_hdr *blok; ap_pool_t *new_pool; - ap_block_alarms(); #if APR_HAS_THREADS ap_lock(alloc_mutex); @@ -529,7 +528,6 @@ API_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retc #if APR_HAS_THREADS ap_unlock(alloc_mutex); #endif - ap_unblock_alarms(); return new_pool; } @@ -617,10 +615,8 @@ API_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, { ap_status_t rv; - ap_block_alarms(); /* Run cleanup only once! */ rv = (*cleanup) (data); ap_kill_cleanup(p, data, cleanup); - ap_unblock_alarms(); return rv; } @@ -662,9 +658,7 @@ API_EXPORT(void) ap_cleanup_for_exec(void) * I can do about that (except if the child decides * to go out and close them */ - ap_block_alarms(); cleanup_pool_for_exec(permanent_pool); - ap_unblock_alarms(); #endif /* ndef WIN32 */ } @@ -723,8 +717,6 @@ void ap_term_alloc(void) */ API_EXPORT(void) ap_clear_pool(ap_pool_t *a) { - ap_block_alarms(); - while (a->sub_pools) { ap_destroy_pool(a->sub_pools); } @@ -754,13 +746,10 @@ API_EXPORT(void) ap_clear_pool(ap_pool_t *a) a->allocation_list = NULL; } #endif - - ap_unblock_alarms(); } API_EXPORT(void) ap_destroy_pool(ap_pool_t *a) { - ap_block_alarms(); ap_clear_pool(a); #if APR_HAS_THREADS ap_lock(alloc_mutex); @@ -781,7 +770,6 @@ API_EXPORT(void) ap_destroy_pool(ap_pool_t *a) ap_unlock(alloc_mutex); #endif free_blocks(a->first); - ap_unblock_alarms(); } API_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p) @@ -829,7 +817,6 @@ API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode (stack_direction == 1 && is_ptr_in_range(s, known_stack_point, &ts)), 1, apr_abort, "Ouch! find_pool() called on pointer in a free block\n"); - ap_block_alarms(); /* search the global_block_list */ for (pb = &global_block_list; *pb; pb = &b->h.global_next) { b = *pb; @@ -847,11 +834,9 @@ API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode b->h.global_next = global_block_list; global_block_list = b; } - ap_unblock_alarms(); return b->h.owning_pool; } } - ap_unblock_alarms(); return NULL; } @@ -888,7 +873,6 @@ API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, /* We could handle more general cases... but this is it for now. */ APR_ABORT(sub->parent != p, 1, apr_abort, "pool_join: p is not a parent of sub\n"); - ap_block_alarms(); while (p->joined) { p = p->joined; } @@ -898,7 +882,6 @@ API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, b->h.owning_pool = p; } } - ap_unblock_alarms(); } #endif @@ -916,7 +899,6 @@ void * ap_palloc(ap_pool_t *a, int reqsize) if (a == NULL) { return malloc(reqsize); } - ap_block_alarms(); if (c == NULL) { return malloc(reqsize); } @@ -928,7 +910,6 @@ void * ap_palloc(ap_pool_t *a, int reqsize) debug_fill(ptr, size); /* might as well get uninitialized protection */ *(void **)ptr = a->allocation_list; a->allocation_list = ptr; - ap_unblock_alarms(); return (char *)ptr + CLICK_SZ; #else @@ -977,8 +958,6 @@ void * ap_palloc(ap_pool_t *a, int reqsize) /* Nope --- get a new one that's guaranteed to be big enough */ - ap_block_alarms(); - #if APR_HAS_THREADS ap_lock(alloc_mutex); #endif @@ -994,8 +973,6 @@ void * ap_palloc(ap_pool_t *a, int reqsize) ap_unlock(alloc_mutex); #endif - ap_unblock_alarms(); - first_avail = blok->h.first_avail; blok->h.first_avail += size; @@ -1168,7 +1145,6 @@ API_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) struct psprintf_data ps; void *ptr; - ap_block_alarms(); ps.base = malloc(512); if (ps.base == NULL) { fputs("Ouch! Out of memory!\n", stderr); @@ -1188,14 +1164,12 @@ API_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) } *(void **)ptr = p->allocation_list; p->allocation_list = ptr; - ap_unblock_alarms(); return (char *)ptr + CLICK_SZ; #else struct psprintf_data ps; char *strp; int size; - ap_block_alarms(); ps.blok = p->last; ps.vbuff.curpos = ps.blok->h.first_avail; ps.vbuff.endpos = ps.blok->h.endp - 1; /* save one for NUL */ @@ -1219,7 +1193,6 @@ API_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) ps.blok->h.owning_pool = p; #endif } - ap_unblock_alarms(); return strp; #endif diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index d4bc790eccd..45f4827f333 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -497,7 +497,6 @@ API_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retc union block_hdr *blok; ap_pool_t *new_pool; - ap_block_alarms(); #if APR_HAS_THREADS ap_lock(alloc_mutex); @@ -529,7 +528,6 @@ API_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retc #if APR_HAS_THREADS ap_unlock(alloc_mutex); #endif - ap_unblock_alarms(); return new_pool; } @@ -617,10 +615,8 @@ API_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, { ap_status_t rv; - ap_block_alarms(); /* Run cleanup only once! */ rv = (*cleanup) (data); ap_kill_cleanup(p, data, cleanup); - ap_unblock_alarms(); return rv; } @@ -662,9 +658,7 @@ API_EXPORT(void) ap_cleanup_for_exec(void) * I can do about that (except if the child decides * to go out and close them */ - ap_block_alarms(); cleanup_pool_for_exec(permanent_pool); - ap_unblock_alarms(); #endif /* ndef WIN32 */ } @@ -723,8 +717,6 @@ void ap_term_alloc(void) */ API_EXPORT(void) ap_clear_pool(ap_pool_t *a) { - ap_block_alarms(); - while (a->sub_pools) { ap_destroy_pool(a->sub_pools); } @@ -754,13 +746,10 @@ API_EXPORT(void) ap_clear_pool(ap_pool_t *a) a->allocation_list = NULL; } #endif - - ap_unblock_alarms(); } API_EXPORT(void) ap_destroy_pool(ap_pool_t *a) { - ap_block_alarms(); ap_clear_pool(a); #if APR_HAS_THREADS ap_lock(alloc_mutex); @@ -781,7 +770,6 @@ API_EXPORT(void) ap_destroy_pool(ap_pool_t *a) ap_unlock(alloc_mutex); #endif free_blocks(a->first); - ap_unblock_alarms(); } API_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p) @@ -829,7 +817,6 @@ API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode (stack_direction == 1 && is_ptr_in_range(s, known_stack_point, &ts)), 1, apr_abort, "Ouch! find_pool() called on pointer in a free block\n"); - ap_block_alarms(); /* search the global_block_list */ for (pb = &global_block_list; *pb; pb = &b->h.global_next) { b = *pb; @@ -847,11 +834,9 @@ API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode b->h.global_next = global_block_list; global_block_list = b; } - ap_unblock_alarms(); return b->h.owning_pool; } } - ap_unblock_alarms(); return NULL; } @@ -888,7 +873,6 @@ API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, /* We could handle more general cases... but this is it for now. */ APR_ABORT(sub->parent != p, 1, apr_abort, "pool_join: p is not a parent of sub\n"); - ap_block_alarms(); while (p->joined) { p = p->joined; } @@ -898,7 +882,6 @@ API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, b->h.owning_pool = p; } } - ap_unblock_alarms(); } #endif @@ -916,7 +899,6 @@ void * ap_palloc(ap_pool_t *a, int reqsize) if (a == NULL) { return malloc(reqsize); } - ap_block_alarms(); if (c == NULL) { return malloc(reqsize); } @@ -928,7 +910,6 @@ void * ap_palloc(ap_pool_t *a, int reqsize) debug_fill(ptr, size); /* might as well get uninitialized protection */ *(void **)ptr = a->allocation_list; a->allocation_list = ptr; - ap_unblock_alarms(); return (char *)ptr + CLICK_SZ; #else @@ -977,8 +958,6 @@ void * ap_palloc(ap_pool_t *a, int reqsize) /* Nope --- get a new one that's guaranteed to be big enough */ - ap_block_alarms(); - #if APR_HAS_THREADS ap_lock(alloc_mutex); #endif @@ -994,8 +973,6 @@ void * ap_palloc(ap_pool_t *a, int reqsize) ap_unlock(alloc_mutex); #endif - ap_unblock_alarms(); - first_avail = blok->h.first_avail; blok->h.first_avail += size; @@ -1168,7 +1145,6 @@ API_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) struct psprintf_data ps; void *ptr; - ap_block_alarms(); ps.base = malloc(512); if (ps.base == NULL) { fputs("Ouch! Out of memory!\n", stderr); @@ -1188,14 +1164,12 @@ API_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) } *(void **)ptr = p->allocation_list; p->allocation_list = ptr; - ap_unblock_alarms(); return (char *)ptr + CLICK_SZ; #else struct psprintf_data ps; char *strp; int size; - ap_block_alarms(); ps.blok = p->last; ps.vbuff.curpos = ps.blok->h.first_avail; ps.vbuff.endpos = ps.blok->h.endp - 1; /* save one for NUL */ @@ -1219,7 +1193,6 @@ API_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) ps.blok->h.owning_pool = p; #endif } - ap_unblock_alarms(); return strp; #endif From 1b2984e5db77e252c8d3a36c7de6921f419aad31 Mon Sep 17 00:00:00 2001 From: Manoj Kasichainula Date: Sun, 21 May 2000 05:32:13 +0000 Subject: [PATCH 0103/7878] In ap_run_cleanup(), swap the actual running of the cleanup and ap_kill_cleanup. This allows some simplification. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60077 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_pools.c | 5 +---- memory/unix/apr_pools.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 45f4827f333..2822c6c4efb 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -613,11 +613,8 @@ API_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, API_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)) { - ap_status_t rv; - - rv = (*cleanup) (data); ap_kill_cleanup(p, data, cleanup); - return rv; + return (*cleanup) (data); } static void run_cleanups(struct cleanup *c) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 45f4827f333..2822c6c4efb 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -613,11 +613,8 @@ API_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, API_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)) { - ap_status_t rv; - - rv = (*cleanup) (data); ap_kill_cleanup(p, data, cleanup); - return rv; + return (*cleanup) (data); } static void run_cleanups(struct cleanup *c) From dae06856a1deca94b59281174d602a49ec571522 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 22 May 2000 05:59:05 +0000 Subject: [PATCH 0104/7878] pool->prog_data structures are allocated from within the pool. make sure to clear them out when the pool is cleared. Submitted by: Tim Costello Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60078 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_pools.c | 2 ++ memory/unix/apr_pools.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 2822c6c4efb..488af83bfd8 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -727,6 +727,8 @@ API_EXPORT(void) ap_clear_pool(ap_pool_t *a) free_blocks(a->first->h.next); a->first->h.next = NULL; + a->prog_data = NULL; + a->last = a->first; a->first->h.first_avail = a->free_first_avail; debug_fill(a->first->h.first_avail, diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 2822c6c4efb..488af83bfd8 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -727,6 +727,8 @@ API_EXPORT(void) ap_clear_pool(ap_pool_t *a) free_blocks(a->first->h.next); a->first->h.next = NULL; + a->prog_data = NULL; + a->last = a->first; a->first->h.first_avail = a->free_first_avail; debug_fill(a->first->h.first_avail, From 7e3263baa35b11db1a985cddf6e492e59d7c7491 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 22 May 2000 17:05:16 +0000 Subject: [PATCH 0105/7878] Remove ap_destroy_context from Apache 2.0. With the name change back to ap_pool_t, this function doesn't make sense. This also changes all references to ap_destroy_context back to ap_destroy_pool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60079 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/misc/unix/start.c b/misc/unix/start.c index 94962d5b67d..d66c50a95f3 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -77,12 +77,6 @@ ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_destroy_context(ap_pool_t *cont) -{ - ap_destroy_pool(cont); - return APR_SUCCESS; -} - ap_status_t ap_set_userdata(void *data, char *key, ap_status_t (*cleanup) (void *), ap_pool_t *cont) From 2a5ed3a4cda26b3f4c99d17801e3ecd34dbba497 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 22 May 2000 18:13:17 +0000 Subject: [PATCH 0106/7878] Rewrite AC_CHECK_DEFINE so that when the appropriate variable is found in the cache we execute AC_DEFINE(HAVE_symbol). Before this change, the AC_DEFINE(HAVE_symbol) was only executed if the variable was not found in the cache. Affected APR checks: LOCK_EX, F_SETLK, isascii, POLLIN, PTHREAD_PROCESS_SHARED The omission of HAVE_POLLIN from apr_private.h led to a bunch of warnings compiling APR's network_io stuff for Unix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60080 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index f79b7dd016c..2854823a66a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -10,15 +10,19 @@ fi dnl ## dnl ## dnl ## -define(AC_CHECK_DEFINE,[dnl -AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1, -AC_EGREP_CPP([YES_IS_DEFINED], [ -#include <$2> -#ifdef $1 -YES_IS_DEFINED -#endif -], ac_cv_define_$1=yes; AC_DEFINE(HAVE_$1), ac_cv_define_$1=no) -)])dnl +AC_DEFUN(AC_CHECK_DEFINE,[ + AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ + AC_EGREP_CPP(YES_IS_DEFINED, [ + #include <$2> + #ifdef $1 + YES_IS_DEFINED + #endif + ], ac_cv_define_$1=yes, ac_cv_define_$1=no) + ]) + if test "$ac_cv_define_$1" = "yes"; then + AC_DEFINE(HAVE_$1) + fi +]) dnl ## dnl ## dnl ## From ee75a905e350ef07d4819ea39d7019f10041db84 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 22 May 2000 20:16:03 +0000 Subject: [PATCH 0107/7878] Solaris needs stdlib.h for the getpass() prototype. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60081 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_getpass.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/apr_getpass.c b/lib/apr_getpass.c index 1eaf30346ad..4afea4a85cc 100644 --- a/lib/apr_getpass.c +++ b/lib/apr_getpass.c @@ -69,6 +69,9 @@ #if HAVE_CONIO_H #include #endif +#if HAVE_STDLIB_H +#include +#endif #if defined(HAVE_TERMIOS_H) && !defined(HAVE_GETPASS) #include From 9976bfaa55a4fdd6711dfb641abdab85a251f8af Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 23 May 2000 01:58:46 +0000 Subject: [PATCH 0108/7878] bug fix: ap_xlate_open() neglected to clear field sbcs_table in the newly-created ap_xlate_t structure... this led to a problem when sbcs_table wasn't NULL for a non-sbcs conversion git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60082 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/xlate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index d4b0838be4e..787d31322f5 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -185,7 +185,7 @@ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, frompage = get_default_codepage(); } - new = (ap_xlate_t *)ap_palloc(pool, sizeof(ap_xlate_t)); + new = (ap_xlate_t *)ap_pcalloc(pool, sizeof(ap_xlate_t)); if (!new) { return APR_ENOMEM; } From 938cbac8962ffaad4e7872a98c3b6f93ba0a2292 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 23 May 2000 02:19:36 +0000 Subject: [PATCH 0109/7878] Win32: Add buffered file I/O Note that this code is tested to compile only. It needs some Win32 folk to have a bash on it to see if it works & fix if necessary. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60083 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 1 + file_io/win32/fileio.h | 11 +++ file_io/win32/open.c | 15 ++++ file_io/win32/readwrite.c | 152 +++++++++++++++++++++++++++++------- file_io/win32/seek.c | 97 +++++++++++++++++------ include/arch/win32/fileio.h | 11 +++ 6 files changed, 235 insertions(+), 52 deletions(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 41e07ba1ae6..821649f900f 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -115,6 +115,7 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) (*new_file)->atime = old_file->atime; (*new_file)->mtime = old_file->mtime; (*new_file)->ctime = old_file->ctime; + (*new_file)->buffered = FALSE; if (!isStdHandle) { ap_register_cleanup((*new_file)->cntxt, (void *)(*new_file), file_cleanup, diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 974889dd03a..7d9adf35381 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -79,9 +79,12 @@ #include "apr_private.h" #include "apr_pools.h" #include "apr_general.h" +#include "apr_lock.h" #include "apr_file_io.h" #include "apr_errno.h" +#define APR_FILE_BUFSIZE 4096 + /* quick run-down of fields in windows' ap_file_t structure that may have * obvious uses. * fname -- the filename as passed to the open call. @@ -114,6 +117,14 @@ struct ap_file_t { ap_time_t atime; ap_time_t mtime; ap_time_t ctime; + + /* Stuff for buffered mode */ + char *buffer; + int bufpos; // Read/Write position in buffer + unsigned long dataRead; // amount of valid data read into buffer + int direction; // buffer being used for 0 = read, 1 = write + unsigned long filePtr; // position in file of handle + ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields }; struct ap_dir_t { diff --git a/file_io/win32/open.c b/file_io/win32/open.c index c8f405e0621..d7d9b5b06ec 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -82,6 +82,7 @@ ap_status_t ap_open(ap_file_t **dafile, const char *fname, DWORD attributes = 0; DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE; ap_oslevel_e level; + ap_status_t rv; (*dafile) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); @@ -98,6 +99,16 @@ ap_status_t ap_open(ap_file_t **dafile, const char *fname, return APR_EACCES; } + (*dafile)->buffered = (flag & APR_BUFFERED) > 0; + + if ((*dafile)->buffered) { + (*dafile)->buffer = ap_palloc(cont, APR_FILE_BUFSIZE); + rv = ap_create_lock(&(*dafile)->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cont); + + if (rv) + return rv; + } + (*dafile)->fname = ap_pstrdup(cont, fname); (*dafile)->demonfname = canonical_filename((*dafile)->cntxt, fname); @@ -164,6 +175,10 @@ ap_status_t ap_close(ap_file_t *file) ap_status_t stat; if ((stat = file_cleanup(file)) == APR_SUCCESS) { ap_kill_cleanup(file->cntxt, file, file_cleanup); + + if (file->buffered) + ap_destroy_lock(file->mutex); + return APR_SUCCESS; } return stat; diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index bc835a22278..0f3d18b7e0f 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -67,19 +67,58 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) DWORD bread; int lasterror; - if (ReadFile(thefile->filehand, buf, *nbytes, &bread, NULL)) { - *nbytes = bread; - return APR_SUCCESS; - } + if (thefile->buffered) { + char *pos = (char *)buf; + ULONG blocksize; + ULONG size = *nbytes; - *nbytes = 0; - lasterror = GetLastError(); - if (lasterror == ERROR_BROKEN_PIPE) { - /* Assume ERROR_BROKEN_PIPE signals an EOF reading from a pipe */ - return APR_SUCCESS; - } else if (lasterror == ERROR_NO_DATA) { - /* Receive this error on a read to a pipe in nonblocking mode */ - return APR_EAGAIN; + ap_lock(thefile->mutex); + + if (thefile->direction == 1) { + ap_flush(thefile); + thefile->bufpos = 0; + thefile->direction = 0; + thefile->dataRead = 0; + } + + while (lasterror == 0 && size > 0) { + if (thefile->bufpos >= thefile->dataRead) { + lasterror = ReadFile(thefile->filehand, thefile->buffer, APR_FILE_BUFSIZE, &thefile->dataRead, NULL ) ? 0 : GetLastError(); + + if (thefile->dataRead == 0) { + if (lasterror == 0) + thefile->eof_hit = TRUE; + break; + } + + thefile->filePtr += thefile->dataRead; + thefile->bufpos = 0; + } + + blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size; + memcpy(pos, thefile->buffer + thefile->bufpos, blocksize); + thefile->bufpos += blocksize; + pos += blocksize; + size -= blocksize; + } + + *nbytes = lasterror == 0 ? pos - (char *)buf : 0; + ap_unlock(thefile->mutex); + } else { + if (ReadFile(thefile->filehand, buf, *nbytes, &bread, NULL)) { + *nbytes = bread; + return APR_SUCCESS; + } + + *nbytes = 0; + lasterror = GetLastError(); + if (lasterror == ERROR_BROKEN_PIPE) { + /* Assume ERROR_BROKEN_PIPE signals an EOF reading from a pipe */ + return APR_SUCCESS; + } else if (lasterror == ERROR_NO_DATA) { + /* Receive this error on a read to a pipe in nonblocking mode */ + return APR_EAGAIN; + } } return lasterror; @@ -90,22 +129,53 @@ ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) ap_status_t rv; DWORD bwrote; - if (!thefile->pipe && thefile->append) { - SetFilePointer(thefile->filehand, 0, NULL, FILE_END); - } - if (WriteFile(thefile->filehand, buf, *nbytes, &bwrote, NULL)) { - *nbytes = bwrote; - rv = APR_SUCCESS; - } - else { - (*nbytes) = 0; - rv = GetLastError(); + if (thefile->buffered) { + char *pos = (char *)buf; + int blocksize; + int size = *nbytes; + + ap_lock(thefile->mutex); + + if (thefile->direction == 0) { + // Position file pointer for writing at the offset we are logically reading from + ULONG offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + if (offset != thefile->filePtr) + SetFilePointer(thefile->filehand, offset, NULL, FILE_BEGIN); + thefile->bufpos = thefile->dataRead = 0; + thefile->direction = 1; + } + + while (rv == 0 && size > 0) { + if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full + rv = ap_flush(thefile); + + blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; + memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); + thefile->bufpos += blocksize; + pos += blocksize; + size -= blocksize; + } + + ap_unlock(thefile->mutex); + return rv; + } else { + if (!thefile->pipe && thefile->append) { + SetFilePointer(thefile->filehand, 0, NULL, FILE_END); + } + if (WriteFile(thefile->filehand, buf, *nbytes, &bwrote, NULL)) { + *nbytes = bwrote; + rv = APR_SUCCESS; + } + else { + (*nbytes) = 0; + rv = GetLastError(); + } } return rv; } /* - * Too bad WriteFileGather() is not supported on 95&98 (or NT prior to SP2) + * Too bad WriteFileGather() is not supported on 95&98 (or NT prior to SP2) */ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nvec, ap_ssize_t *nbytes) @@ -155,11 +225,18 @@ ap_status_t ap_ungetc(char ch, ap_file_t *thefile) if (GetFileType(thefile->filehand) != FILE_TYPE_DISK) { return GetLastError(); } - /* and the file pointer is not pointing to the start of the file. */ - if (GetFilePointer(thefile->filehand)) { - if (SetFilePointer(thefile->filehand, -1, NULL, FILE_CURRENT) - == 0xFFFFFFFF) { - return GetLastError(); + + if (thefile->buffered) { + ap_off_t offset = -1; + return ap_seek(thefile, APR_CUR, &offset); + } + else { + /* and the file pointer is not pointing to the start of the file. */ + if (GetFilePointer(thefile->filehand)) { + if (SetFilePointer(thefile->filehand, -1, NULL, FILE_CURRENT) + == 0xFFFFFFFF) { + return GetLastError(); + } } } @@ -218,8 +295,23 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) } ap_status_t ap_flush(ap_file_t *thefile) { - FlushFileBuffers(thefile->filehand); - return APR_SUCCESS; + if (thefile->buffered) { + DWORD written = 0; + ap_status_t rc = 0; + + if (thefile->direction == 1 && thefile->bufpos) { + rc = WriteFile(thefile->filehand, thefile->buffer, thefile->bufpos, &written, NULL ) ? 0 : GetLastError(); + thefile->filePtr += written; + + if (rc == 0) + thefile->bufpos = 0; + } + + return rc; + } else { + FlushFileBuffers(thefile->filehand); + return APR_SUCCESS; + } } static int printf_flush(ap_vformatter_buff_t *vbuff) diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 16b8a6eace3..9ab9404e42c 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -57,33 +57,86 @@ #include #include +static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) +{ + long newbufpos; + DWORD rc; + + if (thefile->direction == 1) { + ap_flush(thefile); + thefile->bufpos = thefile->direction = thefile->dataRead = 0; + } + + newbufpos = pos - (thefile->filePtr - thefile->dataRead); + + if (newbufpos >= 0 && newbufpos <= thefile->dataRead) { + thefile->bufpos = newbufpos; + rc = 0; + } else { + rc = SetFilePointer(thefile->filehand, pos, NULL, FILE_BEGIN); + + if ( rc == 0xFFFFFFFF ) + rc = GetLastError(); + else + rc = thefile->bufpos = thefile->dataRead = 0; + } + + return rc; +} + + + ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) { DWORD howmove; DWORD rv; - switch(where) { - case APR_SET: { - howmove = FILE_BEGIN; - break; - } - case APR_CUR: { - howmove = FILE_CURRENT; - break; - } - case APR_END: { - howmove = FILE_END; - break; - } - } + if (thefile->buffered) { + int rc = APR_EINVAL; + ap_finfo_t finfo; - rv = SetFilePointer(thefile->filehand, *offset, NULL, howmove); - if (rv == -1) { - *offset = -1; - return GetLastError(); - } - else { - *offset = rv; - return APR_SUCCESS; + switch (where) { + case APR_SET: + rc = setptr(thefile, *offset); + break; + + case APR_CUR: + rc = setptr(thefile, thefile->filePtr - thefile->dataRead + thefile->bufpos + *offset); + break; + + case APR_END: + rc = ap_getfileinfo(&finfo, thefile); + if (rc == APR_SUCCESS) + rc = setptr(thefile, finfo.size - *offset); + break; + } + + *offset = thefile->filePtr + thefile->bufpos; + return rc; + } else { + switch(where) { + case APR_SET: { + howmove = FILE_BEGIN; + break; + } + case APR_CUR: { + howmove = FILE_CURRENT; + break; + } + case APR_END: { + howmove = FILE_END; + break; + } + } + + rv = SetFilePointer(thefile->filehand, *offset, NULL, howmove); + if (rv == -1) { + *offset = -1; + return GetLastError(); + } + else { + *offset = rv; + return APR_SUCCESS; + } } } diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 974889dd03a..7d9adf35381 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -79,9 +79,12 @@ #include "apr_private.h" #include "apr_pools.h" #include "apr_general.h" +#include "apr_lock.h" #include "apr_file_io.h" #include "apr_errno.h" +#define APR_FILE_BUFSIZE 4096 + /* quick run-down of fields in windows' ap_file_t structure that may have * obvious uses. * fname -- the filename as passed to the open call. @@ -114,6 +117,14 @@ struct ap_file_t { ap_time_t atime; ap_time_t mtime; ap_time_t ctime; + + /* Stuff for buffered mode */ + char *buffer; + int bufpos; // Read/Write position in buffer + unsigned long dataRead; // amount of valid data read into buffer + int direction; // buffer being used for 0 = read, 1 = write + unsigned long filePtr; // position in file of handle + ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields }; struct ap_dir_t { From d5d265f8dae0c1be40ef7669e71081a9206894d6 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 23 May 2000 04:26:32 +0000 Subject: [PATCH 0110/7878] Win32: Replace ap_destroy_context with ap_destroy_pool in the export file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60084 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 2 +- libapr.def | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aprlib.def b/aprlib.def index b9fe301fef7..ae91d3f28a2 100644 --- a/aprlib.def +++ b/aprlib.def @@ -121,7 +121,7 @@ EXPORTS ap_os_systemcase_filename @112 canonical_filename @113 ap_create_pool @114 - ap_destroy_context @115 + ap_destroy_pool @115 ; WinTimeToUnixTime @116 ; ap_get_oslevel @117 ap_get_userdata @118 diff --git a/libapr.def b/libapr.def index b9fe301fef7..ae91d3f28a2 100644 --- a/libapr.def +++ b/libapr.def @@ -121,7 +121,7 @@ EXPORTS ap_os_systemcase_filename @112 canonical_filename @113 ap_create_pool @114 - ap_destroy_context @115 + ap_destroy_pool @115 ; WinTimeToUnixTime @116 ; ap_get_oslevel @117 ap_get_userdata @118 From 9fdddd848c6cb92fe751b8c8445c5d3ad216aefe Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 23 May 2000 05:49:27 +0000 Subject: [PATCH 0111/7878] BEOS: ap_shutdown should return APR_SUCCESS or errno. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60085 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 2ec4a2b3efd..2ab7b126f4f 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -111,16 +111,10 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) { -#ifdef BEOS - return shutdown(thesocket->socketdes, how); -#else - if (shutdown(thesocket->socketdes, how) == 0) { - return APR_SUCCESS; - } - else { - return errno; - } -#endif + /* BEOS internal documentation indicates that this system call + * may not work in 5.0, but we don't have any alternatives. + */ + return (shutdown(thesocket->socketdes, how) == -1) ? errno : APR_SUCCESS; } ap_status_t ap_close_socket(ap_socket_t *thesocket) From 9eaeb1afc632902ebec80be9be48bf1df7ef396f Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 23 May 2000 16:50:41 +0000 Subject: [PATCH 0112/7878] Win32: Fix compile problems. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60086 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 10 +++++----- libapr.def | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/aprlib.def b/aprlib.def index ae91d3f28a2..845ac04b960 100644 --- a/aprlib.def +++ b/aprlib.def @@ -121,8 +121,8 @@ EXPORTS ap_os_systemcase_filename @112 canonical_filename @113 ap_create_pool @114 - ap_destroy_pool @115 -; WinTimeToUnixTime @116 + ap_clear_pool @115 + ap_destroy_pool @116 ; ap_get_oslevel @117 ap_get_userdata @118 ap_set_userdata @119 @@ -180,8 +180,8 @@ EXPORTS ap_validate_password @159 ap_make_sub_pool @160 ap_init_alloc @161 - ap_clear_pool @162 - ap_destroy_pool @163 +; ap_clear_pool @162 +; ap_destroy_pool @163 ap_bytes_in_pool @164 ap_bytes_in_free_blocks @165 ap_palloc @166 @@ -216,7 +216,7 @@ EXPORTS ap_cleanup_for_exec @195 ap_null_cleanup @196 ap_note_subprocess @197 -; ap_slack @198 +; ap_vformatter @199 ap_snprintf @200 ap_vsnprintf @201 diff --git a/libapr.def b/libapr.def index ae91d3f28a2..845ac04b960 100644 --- a/libapr.def +++ b/libapr.def @@ -121,8 +121,8 @@ EXPORTS ap_os_systemcase_filename @112 canonical_filename @113 ap_create_pool @114 - ap_destroy_pool @115 -; WinTimeToUnixTime @116 + ap_clear_pool @115 + ap_destroy_pool @116 ; ap_get_oslevel @117 ap_get_userdata @118 ap_set_userdata @119 @@ -180,8 +180,8 @@ EXPORTS ap_validate_password @159 ap_make_sub_pool @160 ap_init_alloc @161 - ap_clear_pool @162 - ap_destroy_pool @163 +; ap_clear_pool @162 +; ap_destroy_pool @163 ap_bytes_in_pool @164 ap_bytes_in_free_blocks @165 ap_palloc @166 @@ -216,7 +216,7 @@ EXPORTS ap_cleanup_for_exec @195 ap_null_cleanup @196 ap_note_subprocess @197 -; ap_slack @198 +; ap_vformatter @199 ap_snprintf @200 ap_vsnprintf @201 From 5e0ec0548b7918fd8414a89d1db4a9fac009eb6d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 23 May 2000 21:03:59 +0000 Subject: [PATCH 0113/7878] Convert ap_proc_t to a complete type. This lets us access the pid directly. Only the prefork MPM has been ported so far, the rest of the Unix MPM's are coming later today. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60087 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 28 ---------- include/apr_thread_proc.h | 93 ++++++---------------------------- include/arch/unix/threadproc.h | 8 +-- test/testproc.c | 14 ++--- test/testsock.c | 16 +++--- threadproc/unix/proc.c | 92 +++++++-------------------------- threadproc/unix/procsup.c | 33 +----------- threadproc/unix/threadproc.h | 8 +-- 8 files changed, 50 insertions(+), 242 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index dca3d43dd25..46042dabe99 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -235,19 +235,6 @@ ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock); /* -=head1 ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc) - -B - - arg 1) The os specific proc we are converting to - arg 2) The apr proc we are converting - -=cut - */ -ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc); - -/* - =head1 ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *aprtime) B @@ -364,21 +351,6 @@ ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, /* -=head1 ap_status_t ap_put_os_proc(ap_proc_t *proc, ap_os_proc_t *theproc, ap_pool_t *cont) - -B - - arg 1) The apr proc we are converting to. - arg 2) The os specific proc to convert - arg 3) The pool to use if it is needed. - -=cut - */ -ap_status_t ap_put_os_proc(ap_proc_t **proc, ap_os_proc_t *theproc, - ap_pool_t *cont); - -/* - =head1 ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime, ap_pool_t, *cont) B diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 4cdac39f230..c5c2a9e88e1 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -87,9 +87,15 @@ typedef enum {APR_WAIT, APR_NOWAIT} ap_wait_how_e; * us knowing ... buggy os? */ #endif /* APR_HAS_OTHER_CHILD */ +typedef struct ap_proc_t { + pid_t pid; + ap_file_t *stdin; /* Parent's side of pipe to child's stdin */ + ap_file_t *stdout; /* Parent's side of pipe to child's stdout */ + ap_file_t *stderr; /* Parent's side of pipe to child's stdouterr */ +} ap_proc_t; + typedef struct ap_thread_t ap_thread_t; typedef struct ap_threadattr_t ap_threadattr_t; -typedef struct ap_proc_t ap_proc_t; typedef struct ap_procattr_t ap_procattr_t; typedef struct ap_threadkey_t ap_threadkey_t; @@ -447,79 +453,10 @@ B */ ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach); -/* - -=head1 ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc) - -B - - arg 1) The key associated with the data to retreive. - arg 2) The user data associated with the proc. - arg 3) The currently open proc. - -=cut - */ -ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc); - -/* - -=head1 ap_status_t ap_set_procdata(void *data, char *key, ap_status_t (*cleanup) (void *), ap_proc_t *proc) - -B - - arg 1) The user data to associate with the file. - arg 2) The key to use for associating data with the file. - arg 3) The cleanup routine to use when the file is destroyed. - arg 4) The current process. - -=cut - */ -ap_status_t ap_set_procdata(void *data, char *key, - ap_status_t (*cleanup) (void *), ap_proc_t *proc); - -/* - -=head1 ap_status_t ap_get_childin(ap_file_t **new, ap_proc_t *proc) - -B - - arg 1) The returned file handle. - arg 2) The process handle that corresponds to the desired child process - -=cut - */ -ap_status_t ap_get_childin(ap_file_t **new, ap_proc_t *proc); - -/* - -=head1 ap_status_t ap_get_childout(ap_file_t **new, ap_proc_t *proc) - -B - - arg 1) The returned file handle. - arg 2) The process handle that corresponds to the desired child process - -=cut - */ -ap_status_t ap_get_childout(ap_file_t **new, ap_proc_t *proc); - -/* - -=head1 ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc) - -B - - arg 1) The returned file handle. - arg 2) The process handle that corresponds to the desired child process - -=cut - */ -ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc); - #if APR_HAS_FORK /* -=head1 ap_status_t ap_fork(ap_proc_t **proc, ap_pool_t *cont) +=head1 ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) B @@ -528,12 +465,12 @@ B @@ -549,7 +486,7 @@ B =cut */ -ap_status_t ap_create_process(ap_proc_t **new, const char *progname, +ap_status_t ap_create_process(ap_proc_t *new, const char *progname, char *const args[], char **env, ap_procattr_t *attr, ap_pool_t *cont); @@ -577,7 +514,7 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e waithow); /* -=head1 ap_status_t ap_wait_all_procs(ap_proc_t **proc, ap_wait_t *status, ap_wait_how waithow, ap_pool_t *p) +=head1 ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, ap_wait_how waithow, ap_pool_t *p) B @@ -595,12 +532,12 @@ B @@ -609,7 +546,7 @@ B =cut */ -ap_status_t ap_detach(ap_proc_t **new, ap_pool_t *cont); +ap_status_t ap_detach(ap_proc_t *new, ap_pool_t *cont); #if APR_HAS_OTHER_CHILD /* diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index ea4c8289db7..0fdb6119eff 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -111,16 +111,10 @@ struct ap_procattr_t { ap_int32_t detached; }; -struct ap_proc_t { - ap_pool_t *cntxt; - pid_t pid; - struct ap_procattr_t *attr; -}; - /*This will move to ap_threadproc.h in time, but I need to figure it out * on windows first. :) */ -ap_status_t ap_detach(struct ap_proc_t **, ap_pool_t *); +ap_status_t ap_detach(struct ap_proc_t *, ap_pool_t *); #endif /* ! THREAD_PROC_H */ diff --git a/test/testproc.c b/test/testproc.c index 74903d24672..9383482b81f 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -71,7 +71,7 @@ int testdirs(void); int main(int argc, char *argv[]) { ap_pool_t *context; - ap_proc_t *newproc; + ap_proc_t newproc; ap_procattr_t *attr; ap_file_t *testfile = NULL; ap_ssize_t length; @@ -143,10 +143,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK.\n"); fprintf(stdout, "Grabbing child's stdin......."); - if (ap_get_childin(&testfile, newproc) != APR_SUCCESS) { - fprintf(stderr, "Could not get child's stdout\n"); - exit(-1); - } + testfile = newproc.stdin; fprintf(stdout, "OK.\n"); length = 256; @@ -157,10 +154,7 @@ int main(int argc, char *argv[]) else fprintf(stderr, "Write failed.\n"); fprintf(stdout, "Grabbing child's stdout......."); - if (ap_get_childout(&testfile, newproc) != APR_SUCCESS) { - fprintf(stderr, "Could not get child's stdout\n"); - exit(-1); - } + testfile = newproc.stdout; fprintf(stdout, "OK.\n"); length = 256; @@ -174,7 +168,7 @@ int main(int argc, char *argv[]) else fprintf(stderr, "Read failed.\n"); fprintf(stdout, "Waiting for child to die......."); - if (ap_wait_proc(newproc, APR_WAIT) != APR_CHILD_DONE) { + if (ap_wait_proc(&newproc, APR_WAIT) != APR_CHILD_DONE) { fprintf(stderr, "Wait for child failed\n"); exit(-1); } diff --git a/test/testsock.c b/test/testsock.c index 98f164480be..a0b8350e0ea 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -68,8 +68,8 @@ int main(int argc, char *argv[]) ap_procattr_t *attr1 = NULL; ap_procattr_t *attr2 = NULL; - ap_proc_t *proc1 = NULL; - ap_proc_t *proc2 = NULL; + ap_proc_t proc1; + ap_proc_t proc2; ap_status_t s1; ap_status_t s2; char *args[2]; @@ -115,18 +115,18 @@ int main(int argc, char *argv[]) exit(-1); } - while ((s1 = ap_wait_proc(proc1, APR_NOWAIT)) != APR_CHILD_DONE || - (s2 = ap_wait_proc(proc2, APR_NOWAIT)) != APR_CHILD_DONE) { + while ((s1 = ap_wait_proc(&proc1, APR_NOWAIT)) != APR_CHILD_DONE || + (s2 = ap_wait_proc(&proc2, APR_NOWAIT)) != APR_CHILD_DONE) { continue; } if (s1 == APR_SUCCESS) { - ap_kill(proc2, SIGTERM); - ap_wait_proc(proc2, APR_WAIT); + ap_kill(&proc2, SIGTERM); + ap_wait_proc(&proc2, APR_WAIT); } else { - ap_kill(proc1, SIGTERM); - ap_wait_proc(proc1, APR_WAIT); + ap_kill(&proc1, SIGTERM); + ap_wait_proc(&proc1, APR_WAIT); } fprintf(stdout, "Network test completed.\n"); diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index e515e5d02cc..1357ca18752 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -191,46 +191,43 @@ ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach) return APR_SUCCESS; } -ap_status_t ap_fork(ap_proc_t **proc, ap_pool_t *cont) +ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) { int pid; - (*proc) = ap_pcalloc(cont, sizeof(ap_proc_t)); - if ((pid = fork()) < 0) { return errno; } else if (pid == 0) { - (*proc)->pid = pid; - (*proc)->attr = NULL; + proc->pid = pid; + proc->stdin = NULL; + proc->stdout = NULL; + proc->stderr = NULL; return APR_INCHILD; } - (*proc)->pid = pid; - (*proc)->attr = NULL; + proc->pid = pid; + proc->stdin = NULL; + proc->stdout = NULL; + proc->stderr = NULL; return APR_INPARENT; } -ap_status_t ap_create_process(ap_proc_t **new, const char *progname, +ap_status_t ap_create_process(ap_proc_t *new, const char *progname, char *const args[], char **env, ap_procattr_t *attr, ap_pool_t *cont) { int i; typedef const char *my_stupid_string; my_stupid_string *newargs; - ap_proc_t *pgrp; - - (*new) = (ap_proc_t *)ap_pcalloc(cont, sizeof(ap_proc_t)); + ap_proc_t pgrp; - if ((*new) == NULL) { - return APR_ENOMEM; - } - - (*new)->cntxt = cont; - - if (((*new)->pid = fork()) < 0) { + new->stdin = attr->parent_in; + new->stderr = attr->parent_err; + new->stdout = attr->parent_out; + if ((new->pid = fork()) < 0) { return errno; } - else if ((*new)->pid == 0) { + else if (new->pid == 0) { /* child process */ if (attr->child_in) { ap_close(attr->parent_in); @@ -297,49 +294,22 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, if (attr->child_err) { ap_close(attr->child_err); } - - (*new)->attr = attr; return APR_SUCCESS; } -ap_status_t ap_get_childin(ap_file_t **new, ap_proc_t *proc) -{ - (*new) = proc->attr->parent_in; - return APR_SUCCESS; -} - -ap_status_t ap_get_childout(ap_file_t **new, ap_proc_t *proc) -{ - (*new) = proc->attr->parent_out; - return APR_SUCCESS; -} - -ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc) -{ - (*new) = proc->attr->parent_err; - return APR_SUCCESS; -} - -ap_status_t ap_wait_all_procs(ap_proc_t **proc, ap_wait_t *status, +ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, ap_wait_how_e waithow, ap_pool_t *p) { - pid_t pid; int waitpid_options = WUNTRACED; if (waithow != APR_WAIT) { waitpid_options |= WNOHANG; } - if ((pid = waitpid(-1, status, waitpid_options)) > 0) { - if (!*proc) { - (*proc) = ap_pcalloc(p, sizeof(ap_proc_t)); - (*proc)->cntxt = p; - } - (*proc)->pid = pid; + if ((proc->pid = waitpid(-1, status, waitpid_options)) > 0) { return APR_CHILD_DONE; } - else if (pid == 0) { - (*proc) = NULL; + else if (proc->pid == 0) { return APR_CHILD_NOTDONE; } return errno; @@ -368,27 +338,3 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, } return errno; } - -ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc) -{ - if (proc == NULL) { - return APR_ENOPROC; - } - *theproc = proc->pid; - return APR_SUCCESS; -} - -ap_status_t ap_put_os_proc(ap_proc_t **proc, ap_os_proc_t *theproc, - ap_pool_t *cont) -{ - if (cont == NULL) { - return APR_ENOPOOL; - } - if ((*proc) == NULL) { - (*proc) = (ap_proc_t *)ap_pcalloc(cont, sizeof(ap_proc_t)); - (*proc)->cntxt = cont; - } - (*proc)->pid = *theproc; - return APR_SUCCESS; -} - diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index 9db506ece1f..fb1e51ab7fc 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -54,14 +54,10 @@ #include "threadproc.h" -ap_status_t ap_detach(ap_proc_t **new, ap_pool_t *cont) +ap_status_t ap_detach(ap_proc_t *new, ap_pool_t *cont) { int x; - (*new) = (ap_proc_t *)ap_palloc(cont, sizeof(ap_proc_t)); - (*new)->cntxt = cont; - (*new)->attr = NULL; - chdir("/"); #if !defined(MPE) && !defined(OS2) && !defined(TPF) && !defined(BEOS) /* Don't detach for MPE because child processes can't survive the death of @@ -76,7 +72,7 @@ ap_status_t ap_detach(ap_proc_t **new, ap_pool_t *cont) /* RAISE_SIGSTOP(DETACH);*/ #endif #if HAVE_SETSID - if (((*new)->pid = setsid()) == -1) { + if ((new->pid = setsid()) == -1) { return errno; } #elif defined(NEXT) || defined(NEWSOS) @@ -116,28 +112,3 @@ ap_status_t ap_detach(ap_proc_t **new, ap_pool_t *cont) } return APR_SUCCESS; } - -ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc) -{ - if (proc != NULL) { - return ap_get_userdata(data, key, proc->cntxt); - } - else { - data = NULL; - return APR_ENOPROC; - } -} - -ap_status_t ap_set_procdata(void *data, char *key, - ap_status_t (*cleanup) (void *), - ap_proc_t *proc) -{ - if (proc != NULL) { - return ap_set_userdata(data, key, cleanup, proc->cntxt); - } - else { - data = NULL; - return APR_ENOPROC; - } -} - diff --git a/threadproc/unix/threadproc.h b/threadproc/unix/threadproc.h index ea4c8289db7..0fdb6119eff 100644 --- a/threadproc/unix/threadproc.h +++ b/threadproc/unix/threadproc.h @@ -111,16 +111,10 @@ struct ap_procattr_t { ap_int32_t detached; }; -struct ap_proc_t { - ap_pool_t *cntxt; - pid_t pid; - struct ap_procattr_t *attr; -}; - /*This will move to ap_threadproc.h in time, but I need to figure it out * on windows first. :) */ -ap_status_t ap_detach(struct ap_proc_t **, ap_pool_t *); +ap_status_t ap_detach(struct ap_proc_t *, ap_pool_t *); #endif /* ! THREAD_PROC_H */ From 2f0ad1b46021fa3ae43d359b4be139c0cebceefd Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 24 May 2000 00:15:05 +0000 Subject: [PATCH 0114/7878] Rename stdin, stdout, stderr from new ap_proc_t to in, out, and err because Windows was having problems with the original names. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60088 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 6 +++--- threadproc/unix/proc.c | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index c5c2a9e88e1..fe56ac5eef9 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -89,9 +89,9 @@ typedef enum {APR_WAIT, APR_NOWAIT} ap_wait_how_e; typedef struct ap_proc_t { pid_t pid; - ap_file_t *stdin; /* Parent's side of pipe to child's stdin */ - ap_file_t *stdout; /* Parent's side of pipe to child's stdout */ - ap_file_t *stderr; /* Parent's side of pipe to child's stdouterr */ + ap_file_t *in; /* Parent's side of pipe to child's stdin */ + ap_file_t *out; /* Parent's side of pipe to child's stdout */ + ap_file_t *err; /* Parent's side of pipe to child's stdouterr */ } ap_proc_t; typedef struct ap_thread_t ap_thread_t; diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 1357ca18752..9175585a309 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -200,15 +200,15 @@ ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) } else if (pid == 0) { proc->pid = pid; - proc->stdin = NULL; - proc->stdout = NULL; - proc->stderr = NULL; + proc->in = NULL; + proc->out = NULL; + proc->err = NULL; return APR_INCHILD; } proc->pid = pid; - proc->stdin = NULL; - proc->stdout = NULL; - proc->stderr = NULL; + proc->in = NULL; + proc->out = NULL; + proc->err = NULL; return APR_INPARENT; } @@ -221,9 +221,9 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, my_stupid_string *newargs; ap_proc_t pgrp; - new->stdin = attr->parent_in; - new->stderr = attr->parent_err; - new->stdout = attr->parent_out; + new->in = attr->parent_in; + new->err = attr->parent_err; + new->out = attr->parent_out; if ((new->pid = fork()) < 0) { return errno; } From 67ef1b7562d9e1c24d005d2b655cd2ef930fe07f Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Wed, 24 May 2000 11:16:36 +0000 Subject: [PATCH 0115/7878] Add enable-threads flag for gcc on HPUX git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60089 13f79535-47bb-0310-9956-ffa450edef68 --- threads.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threads.m4 b/threads.m4 index bdff9b9df8e..b5fc1a81c97 100644 --- a/threads.m4 +++ b/threads.m4 @@ -118,7 +118,7 @@ PTHREADS_CHECK_COMPILE AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[ ac_cv_pthreads_cflags="" if test "$pthreads_working" != "yes"; then - for flag in -pthreads -pthread -mthreads -Kthread; do + for flag in -pthreads -pthread -mthreads -Kthread -threads; do ac_save="$CFLAGS" CFLAGS="$CFLAGS $flag" PTHREADS_CHECK_COMPILE From 74fb8e63870ecb1d089abb3fc011d9e98f4a571c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 24 May 2000 11:45:44 +0000 Subject: [PATCH 0116/7878] Add ap_xlate_get_sb() so that an app can find out whether or not a conversion is single-byte only. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60090 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/xlate.c | 6 ++++++ include/apr_xlate.h | 19 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 787d31322f5..a2bb502d29d 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -230,6 +230,12 @@ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, return status; } +ap_status_t ap_xlate_get_sb(ap_xlate_t *convset, int *onoff) +{ + *onoff = convset->sbcs_table != NULL; + return APR_SUCCESS; +} + ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, ap_size_t *inbytes_left, char *outbuf, ap_size_t *outbytes_left) diff --git a/include/apr_xlate.h b/include/apr_xlate.h index df82e520131..fda8d6d5d53 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -81,6 +81,8 @@ typedef void ap_xlate_t; #define ap_xlate_open(convset, topage, frompage, pool) APR_ENOTIMPL +#define ap_xlate_get_sb(convset, onoff) APR_ENOTIMPL + #define ap_xlate_conv_buffer(convset, inbuf, inbytes_left, outbuf, \ outbytes_left) APR_ENOTIMPL @@ -121,12 +123,27 @@ B: Specify APR_DEFAULT_CHARSET for one of the charset =cut */ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, - const char *frompage, ap_pool_t *pool); + const char *frompage, ap_pool_t *pool); #define APR_DEFAULT_CHARSET NULL /* +=head1 ap_status_t ap_xlate_get_sb(ap_xlate_t *convset, int *onoff) + +B + + arg 1) The handle allocated by ap_xlate_open, specifying the parameters + of conversion + arg 2) Output: whether or not the conversion is single-byte-only + +=cut + */ + +ap_status_t ap_xlate_get_sb(ap_xlate_t *convset, int *onoff); + +/* + =head1 ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, ap_size_t *inbytes_left, char *outbuf, ap_size_t outbytes_left) B From 3fb8c6c9363752f13cb605eeff192eaec0084e4b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 24 May 2000 19:19:18 +0000 Subject: [PATCH 0117/7878] Implement saferead in Apache 2.0. This has had minimal testing, and it seems to work, but only really hammering on it will tell for sure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60091 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 18 ++++++++++++++++++ include/apr_file_io.h | 12 ++++++++++++ 2 files changed, 30 insertions(+) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 5b0d1d6a6cd..8ec48becc16 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -412,3 +412,21 @@ API_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) return (cc == APR_SUCCESS) ? len : -1; } +ap_status_t ap_file_check_read(ap_file_t *fd) +{ + fd_set fds; + int rv; + struct timeval tv; + + FD_ZERO(&fds); + FD_SET(fd->filedes, &fds); + tv.tv_sec = 0; + tv.tv_usec = 0; + if (rv = select(fd->filedes + 1, &fds, NULL, NULL, &tv) == -1) { + return errno; + } + else { + return rv; + } +} + diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 3bee3987e33..02f072de16a 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -253,6 +253,18 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes); /* +=head1 ap_status_t ap_file_check_read(ap_file_t *fd) + +B + + arg 1) The file descriptor to check. + +=cut + */ +ap_status_t ap_file_check_read(ap_file_t *fd); + +/* + =head1 ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) B From a817b6390367cb6ffd352fe88b46e27b8ab2fdb2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 24 May 2000 22:14:51 +0000 Subject: [PATCH 0118/7878] Make the testproc stuff work again after re-naming the stdin, stdout, stderr to in, out, err in the ap_proc_t structure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60092 13f79535-47bb-0310-9956-ffa450edef68 --- test/testproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testproc.c b/test/testproc.c index 9383482b81f..d568d2302ec 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK.\n"); fprintf(stdout, "Grabbing child's stdin......."); - testfile = newproc.stdin; + testfile = newproc.in; fprintf(stdout, "OK.\n"); length = 256; @@ -154,7 +154,7 @@ int main(int argc, char *argv[]) else fprintf(stderr, "Write failed.\n"); fprintf(stdout, "Grabbing child's stdout......."); - testfile = newproc.stdout; + testfile = newproc.out; fprintf(stdout, "OK.\n"); length = 256; From d586adcb07dcba98fe18760035a82bc94248bfde Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 24 May 2000 22:18:04 +0000 Subject: [PATCH 0119/7878] Update testoc to make it work properly with the new ap_proc_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60093 13f79535-47bb-0310-9956-ffa450edef68 --- test/testoc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testoc.c b/test/testoc.c index 3d897273951..dbdbfc971e4 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -88,7 +88,7 @@ int main(int argc, char *argv[]) ap_pool_t *cont2; ap_status_t status = 0; ap_ssize_t nbytes = 0; - ap_proc_t *newproc = NULL; + ap_proc_t newproc; ap_procattr_t *procattr = NULL; ap_file_t *std = NULL; char *args[3]; @@ -131,14 +131,14 @@ int main(int argc, char *argv[]) } fprintf(stdout, "OK\n"); - ap_get_childin(&std, newproc); + std = newproc.in; - ap_register_other_child(newproc, ocmaint, NULL, std, context); + ap_register_other_child(&newproc, ocmaint, NULL, std, context); fprintf(stdout, "[PARENT] Sending SIGKILL to child......"); fflush(stdout); sleep(1); - if (ap_kill(newproc, SIGKILL) != APR_SUCCESS) { + if (ap_kill(&newproc, SIGKILL) != APR_SUCCESS) { fprintf(stderr,"couldn't send the signal!\n"); exit(-1); } From a40588afd324b44c8fe58c36dbbe5492295321c1 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Wed, 24 May 2000 22:27:19 +0000 Subject: [PATCH 0120/7878] fix two problems with Ryan's recent checkin: missing entries in an iol_methods structure, and some missing parens in the check_read impl. also, fix the return value for APR check_read -- it cannot be 0/1. instead, APR_TIMEUP means that nothing is available and APR_SUCCESS means that the thing is ready for reading. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60094 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 8ec48becc16..d71c0205d39 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -416,17 +416,18 @@ ap_status_t ap_file_check_read(ap_file_t *fd) { fd_set fds; int rv; - struct timeval tv; + struct timeval tv = { 0 }; FD_ZERO(&fds); FD_SET(fd->filedes, &fds); - tv.tv_sec = 0; - tv.tv_usec = 0; - if (rv = select(fd->filedes + 1, &fds, NULL, NULL, &tv) == -1) { + if ((rv = select(fd->filedes + 1, &fds, NULL, NULL, &tv)) == -1) { return errno; } + else if (rv == 0) { + return APR_TIMEUP; + } else { - return rv; + return APR_SUCCESS; } } From daf6cb58abdd1e5957a855cdc5548033e3b7424f Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 24 May 2000 22:32:44 +0000 Subject: [PATCH 0121/7878] Add a new APR function. This function basically lets a file masquerade as a socket so that we can poll on it. This is not my favorite idea, but since some platforms don't allow us to poll files and some do, we have to find a happy medium, this is it. :-| git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60095 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileacc.c | 1 - include/apr.h.in | 8 ++++++++ include/apr_network_io.h | 18 ++++++++++++++++++ network_io/unix/poll.c | 14 ++++++++++++++ test/testfile.c | 29 +++++++++++++++++++++++++++++ 5 files changed, 69 insertions(+), 1 deletion(-) diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 7ff1d2cdc7a..32a574dc3cc 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -132,4 +132,3 @@ ap_status_t ap_set_filedata(ap_file_t *file, void *data, char *key, return APR_ENOFILE; } } - diff --git a/include/apr.h.in b/include/apr.h.in index 921779594e7..581ac5b34af 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -66,6 +66,14 @@ #define APR_HAS_XLATE @iconv@ #define APR_HAS_OTHER_CHILD @oc@ +/* Any time a file and socket are represented as the same type, this macro + * should be true. I don't know of any platforms using Autoconf where this + * isn't true (OS/2? maybe), but I know it isn't true for Windows. For right + * now, just define it as 1, and Windows will define it correctly, if this + * turns out to not work, we can devise an Autoconf test for it later. rbb + */ +#define APR_FILES_AS_SOCKETS 1 + /* Typedefs that APR needs. */ typedef @short_value@ ap_int16_t; diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 3509f2f5e6c..9d2b08f33df 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -711,6 +711,24 @@ B ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key, ap_status_t (*cleanup) (void *)); +/* + +=head1 ap_status_t ap_socket_from_file(ap_socket_t **newsock, ap_file_t *file) + +B + + arg 1) the newly created socket which represents a file. + arg 2) the file to mask as a socket. + +B: This is not available on all platforms. Platforms that have the + ability to poll files for data to be read/written/exceptions will + have the APR_FILES_AS_SOCKETS macro defined as true. + +=cut + */ +ap_status_t ap_socket_from_file(ap_socket_t **newsock, ap_file_t *file); + + /* accessor functions */ #ifdef __cplusplus diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index fedffdc5361..5c33be86530 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -53,6 +53,7 @@ */ #include "networkio.h" +#include "../../file_io/unix/fileio.h" #ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ @@ -395,3 +396,16 @@ ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key, } } +#if APR_FILES_AS_SOCKETS +/* I'm not sure if this needs to return an ap_status_t or not, but + * for right now, we'll leave it this way, and change it later if + * necessary. + */ +ap_status_t ap_socket_from_file(ap_socket_t **newsock, ap_file_t *file) +{ + (*newsock) = ap_pcalloc(file->cntxt, sizeof(**newsock)); + (*newsock)->socketdes = file->filedes; + (*newsock)->cntxt = file->cntxt; + return APR_SUCCESS; +} +#endif diff --git a/test/testfile.c b/test/testfile.c index 1b164515e6f..32311354a28 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -55,6 +55,7 @@ #include #include #include "apr_file_io.h" +#include "apr_network_io.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" @@ -70,9 +71,12 @@ int main() ap_pool_t *context; ap_pool_t *cont2; ap_file_t *thefile = NULL; + ap_socket_t *testsock = NULL; + ap_pollfd_t *sdset = NULL; ap_status_t status = 0; ap_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; ap_ssize_t nbytes = 0; + ap_int32_t rv; ap_off_t zer = 0; char *buf; char *str; @@ -143,6 +147,31 @@ int main() fprintf(stdout, "OK\n"); } +#if APR_FILES_AS_SOCKETS + fprintf(stdout, "\tThis platform supports files_like_sockets\n"); + fprintf(stdout, "\t\tMaking file look like a socket......."); + if (ap_socket_from_file(&testsock, thefile) != APR_SUCCESS) { + perror("Something went wrong"); + exit(-1); + } + fprintf(stdout, "OK\n"); + + fprintf(stdout, "\t\tChecking for incoming data......."); + ap_setup_poll(&sdset, 1, context); + ap_add_poll_socket(sdset, testsock, APR_POLLIN); + rv = 1; + if (ap_poll(sdset, &rv, -1) != APR_SUCCESS) { + fprintf(stderr, "Select caused an error\n"); + exit(-1); + } + else if (rv == 0) { + fprintf(stderr, "I should not return until rv == 1\n"); + exit(-1); + } + fprintf(stdout, "OK\n"); +#endif + + fprintf(stdout, "\tReading from the file......."); nbytes = (ap_ssize_t)strlen("this is a test"); buf = (char *)ap_palloc(context, nbytes + 1); From 2c17b5fc545aa67c41127983b6b674678f1f0aab Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 24 May 2000 23:44:50 +0000 Subject: [PATCH 0122/7878] Win32: Convert ap_proc_t to tranparent type. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60096 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 5 +- aprlib.def | 10 ++-- aprlib.dsp | 5 +- aprlibdll.dsp | 11 ++-- include/arch/win32/threadproc.h | 6 -- lib/apr_pools.c | 4 +- libapr.def | 10 ++-- libapr.dsp | 11 ++-- memory/unix/apr_pools.c | 4 +- threadproc/win32/proc.c | 98 ++++++--------------------------- threadproc/win32/signals.c | 4 +- threadproc/win32/threadproc.h | 6 -- 12 files changed, 46 insertions(+), 128 deletions(-) diff --git a/apr.dsp b/apr.dsp index c0203ff7759..8cf6c603a6a 100644 --- a/apr.dsp +++ b/apr.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="aprlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 @@ -22,6 +22,7 @@ CFG=aprlib - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -65,7 +66,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 diff --git a/aprlib.def b/aprlib.def index 845ac04b960..36fe4868c3e 100644 --- a/aprlib.def +++ b/aprlib.def @@ -92,9 +92,9 @@ EXPORTS ap_setprocattr_cmdtype @83 ap_setprocattr_detach @84 ap_create_process @85 - ap_get_childin @86 - ap_get_childout @87 - ap_get_childerr @88 +; ap_get_childin @86 +; ap_get_childout @87 +; ap_get_childerr @88 ap_wait_proc @89 ap_kill @90 ap_create_threadattr @91 @@ -113,9 +113,9 @@ EXPORTS ap_set_threaddata @104 ap_get_threadkeydata @105 ap_set_threadkeydata @106 - ap_get_procdata @107 +; ap_get_procdata @107 ; ap_set_procdata @108 - ap_get_os_proc @109 +; ap_get_os_proc @109 ap_get_os_thread @110 ap_get_os_threadkey @111 ap_os_systemcase_filename @112 diff --git a/aprlib.dsp b/aprlib.dsp index c0203ff7759..8cf6c603a6a 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="aprlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 @@ -22,6 +22,7 @@ CFG=aprlib - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -65,7 +66,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 diff --git a/aprlibdll.dsp b/aprlibdll.dsp index e51f740f36b..05c8fe9e02d 100644 --- a/aprlibdll.dsp +++ b/aprlibdll.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="aprlibdll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 @@ -17,13 +17,12 @@ CFG=aprlibdll - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "aprlibdll - Win32 Release" (based on\ - "Win32 (x86) Dynamic-Link Library") -!MESSAGE "aprlibdll - Win32 Debug" (based on\ - "Win32 (x86) Dynamic-Link Library") +!MESSAGE "aprlibdll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "aprlibdll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -71,7 +70,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/threadproc.h index 274626f6132..936747783d9 100644 --- a/include/arch/win32/threadproc.h +++ b/include/arch/win32/threadproc.h @@ -92,11 +92,5 @@ struct ap_procattr_t { ap_int32_t detached; }; -struct ap_proc_t { - ap_pool_t *cntxt; - PROCESS_INFORMATION pi; - struct ap_procattr_t *attr; -}; - #endif /* ! THREAD_PROC_H */ diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 488af83bfd8..c8976ba5465 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -1302,10 +1302,8 @@ static void free_proc_chain(struct process_chain *procs) * Do we need an APR function to clean-up a proc_t? */ { - PROCESS_INFORMATION pi; for (p = procs; p; p = p->next) { - ap_get_os_proc(&pi, p->pid); - CloseHandle(pi.hProcess); + CloseHandle(p->pid->pid); } } #endif /* WIN32 */ diff --git a/libapr.def b/libapr.def index 845ac04b960..36fe4868c3e 100644 --- a/libapr.def +++ b/libapr.def @@ -92,9 +92,9 @@ EXPORTS ap_setprocattr_cmdtype @83 ap_setprocattr_detach @84 ap_create_process @85 - ap_get_childin @86 - ap_get_childout @87 - ap_get_childerr @88 +; ap_get_childin @86 +; ap_get_childout @87 +; ap_get_childerr @88 ap_wait_proc @89 ap_kill @90 ap_create_threadattr @91 @@ -113,9 +113,9 @@ EXPORTS ap_set_threaddata @104 ap_get_threadkeydata @105 ap_set_threadkeydata @106 - ap_get_procdata @107 +; ap_get_procdata @107 ; ap_set_procdata @108 - ap_get_os_proc @109 +; ap_get_os_proc @109 ap_get_os_thread @110 ap_get_os_threadkey @111 ap_os_systemcase_filename @112 diff --git a/libapr.dsp b/libapr.dsp index e51f740f36b..05c8fe9e02d 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="aprlibdll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 @@ -17,13 +17,12 @@ CFG=aprlibdll - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "aprlibdll - Win32 Release" (based on\ - "Win32 (x86) Dynamic-Link Library") -!MESSAGE "aprlibdll - Win32 Debug" (based on\ - "Win32 (x86) Dynamic-Link Library") +!MESSAGE "aprlibdll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "aprlibdll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -71,7 +70,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 488af83bfd8..c8976ba5465 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1302,10 +1302,8 @@ static void free_proc_chain(struct process_chain *procs) * Do we need an APR function to clean-up a proc_t? */ { - PROCESS_INFORMATION pi; for (p = procs; p; p = p->next) { - ap_get_os_proc(&pi, p->pid); - CloseHandle(pi.hProcess); + CloseHandle(p->pid->pid); } } #endif /* WIN32 */ diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 6d40919b9b3..4d22458c0c0 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -67,8 +67,7 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) { - (*new) = (ap_procattr_t *)ap_palloc(cont, - sizeof(ap_procattr_t)); + (*new) = (ap_procattr_t *)ap_palloc(cont, sizeof(ap_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -183,7 +182,7 @@ ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t det) return APR_SUCCESS; } -ap_status_t ap_create_process(ap_proc_t **new, const char *progname, +ap_status_t ap_create_process(ap_proc_t *new, const char *progname, char *const args[], char **env, ap_procattr_t *attr, ap_pool_t *cont) { @@ -195,15 +194,11 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, char *envstr; char *pEnvBlock, *pNext; ap_status_t rv; + PROCESS_INFORMATION pi; - (*new) = (ap_proc_t *)ap_palloc(cont, sizeof(ap_proc_t)); - - if ((*new) == NULL) { - return APR_ENOMEM; - } - - (*new)->cntxt = cont; - (*new)->attr = attr; + new->in = attr->parent_in; + new->err = attr->parent_err; + new->out = attr->parent_out; attr->si.cb = sizeof(attr->si); if (attr->detached) { @@ -246,7 +241,7 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, cmdline = ap_pstrcat(cont, attr->currdir, progname, NULL); } else { - cmdline = ap_pstrcat(cont, attr->currdir, "\\", progname, NULL); + cmdline = ap_pstrcat(cont, attr->currdir, "\\", progname, NULL); } } } @@ -351,7 +346,10 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, if (CreateProcess(NULL, cmdline, NULL, NULL, TRUE, 0, pEnvBlock, attr->currdir, - &attr->si, &(*new)->pi)) { + &attr->si, &pi)) { + + new->pid = pi.hProcess; + if (attr->child_in) { ap_close(attr->child_in); } @@ -361,39 +359,21 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, if (attr->child_err) { ap_close(attr->child_err); } - CloseHandle((*new)->pi.hThread); + CloseHandle(pi.hThread); + return APR_SUCCESS; } return GetLastError(); } -ap_status_t ap_get_childin(ap_file_t **new, ap_proc_t *proc) -{ - (*new) = proc->attr->parent_in; - return APR_SUCCESS; -} - -ap_status_t ap_get_childout(ap_file_t **new, ap_proc_t *proc) -{ - (*new) = proc->attr->parent_out; - return APR_SUCCESS; -} - -ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc) -{ - (*new) = proc->attr->parent_err; - return APR_SUCCESS; -} - -ap_status_t ap_wait_proc(ap_proc_t *proc, - ap_wait_how_e wait) +ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e wait) { DWORD stat; if (!proc) return APR_ENOPROC; if (wait == APR_WAIT) { - if ((stat = WaitForSingleObject(proc->pi.hProcess, INFINITE)) == WAIT_OBJECT_0) { + if ((stat = WaitForSingleObject(proc->pid, INFINITE)) == WAIT_OBJECT_0) { return APR_CHILD_DONE; } else if (stat == WAIT_TIMEOUT) { @@ -401,7 +381,7 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, } return GetLastError(); } - if ((stat = WaitForSingleObject(proc->pi.hProcess, 0)) == WAIT_OBJECT_0) { + if ((stat = WaitForSingleObject(proc->pid, 0)) == WAIT_OBJECT_0) { return APR_CHILD_DONE; } else if (stat == WAIT_TIMEOUT) { @@ -410,49 +390,3 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, return GetLastError(); } -ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc) -{ - if (proc != NULL) { - return ap_get_userdata(data, key, proc->cntxt); - } - else { - data = NULL; - return APR_ENOPROC; - } -} - -ap_status_t ap_set_procdata(void *data, char *key, - ap_status_t (*cleanup) (void *), - ap_proc_t *proc) -{ - if (proc != NULL) { - return ap_set_userdata(data, key, cleanup, proc->cntxt); - } - else { - data = NULL; - return APR_ENOPROC; - } -} - -ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc) -{ - if (proc == NULL) { - return APR_ENOPROC; - } - *theproc = proc->pi; - return APR_SUCCESS; -} - -ap_status_t ap_put_os_proc(ap_proc_t **proc, ap_os_proc_t *theproc, - ap_pool_t *cont) -{ - if (cont == NULL) { - return APR_ENOPOOL; - } - if ((*proc) == NULL) { - (*proc) = (ap_proc_t *)ap_palloc(cont, sizeof(ap_proc_t)); - (*proc)->cntxt = cont; - } - (*proc)->pi = *theproc; - return APR_SUCCESS; -} diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 08119b78d05..0de2653f1b9 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -66,8 +66,8 @@ /* Windows only really support killing process, but that will do for now. */ ap_status_t ap_kill(ap_proc_t *proc, int signal) { - if (TerminateProcess(proc->pi.hProcess, signal) == 0) { - return errno; + if (TerminateProcess(proc->pid, signal) == 0) { + return GetLastError(); } return APR_SUCCESS; } diff --git a/threadproc/win32/threadproc.h b/threadproc/win32/threadproc.h index 274626f6132..936747783d9 100644 --- a/threadproc/win32/threadproc.h +++ b/threadproc/win32/threadproc.h @@ -92,11 +92,5 @@ struct ap_procattr_t { ap_int32_t detached; }; -struct ap_proc_t { - ap_pool_t *cntxt; - PROCESS_INFORMATION pi; - struct ap_procattr_t *attr; -}; - #endif /* ! THREAD_PROC_H */ From aba12d6ab0c50d7432d5613030565710229c378e Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 25 May 2000 03:05:27 +0000 Subject: [PATCH 0123/7878] OS/2: Adapt to new ap_proc_t type & add missing ap_setprocattr_child* functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60097 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/threadproc.h | 7 --- threadproc/os2/proc.c | 112 ++++++++++++++++++++-------------- threadproc/os2/threadproc.h | 7 --- 3 files changed, 65 insertions(+), 61 deletions(-) diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/threadproc.h index cfcca8d621c..d6971dbb300 100644 --- a/include/arch/os2/threadproc.h +++ b/include/arch/os2/threadproc.h @@ -95,13 +95,6 @@ struct ap_procattr_t { ap_int32_t detached; }; -struct ap_proc_t { - ap_pool_t *cntxt; - pid_t pid; - struct ap_procattr_t *attr; - int running; -}; - typedef void (*os2_thread_start_t)(void *); #endif /* ! THREAD_PROC_H */ diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 6fc0f755a9c..acfd80f639e 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -144,6 +144,54 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, return APR_SUCCESS; } +ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in, + ap_file_t *parent_in) +{ + if (attr->child_in == NULL && attr->parent_in == NULL) + ap_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); + + if (child_in != NULL) + ap_dupfile(&attr->child_in, child_in, attr->cntxt); + + if (parent_in != NULL) + ap_dupfile(&attr->parent_in, parent_in, attr->cntxt); + + return APR_SUCCESS; +} + + +ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, ap_file_t *child_out, + ap_file_t *parent_out) +{ + if (attr->child_out == NULL && attr->parent_out == NULL) + ap_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + + if (child_out != NULL) + ap_dupfile(&attr->child_out, child_out, attr->cntxt); + + if (parent_out != NULL) + ap_dupfile(&attr->parent_out, parent_out, attr->cntxt); + + return APR_SUCCESS; +} + + +ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err, + ap_file_t *parent_err) +{ + if (attr->child_err == NULL && attr->parent_err == NULL) + ap_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + + if (child_err != NULL) + ap_dupfile(&attr->child_err, child_err, attr->cntxt); + + if (parent_err != NULL) + ap_dupfile(&attr->parent_err, parent_err, attr->cntxt); + + return APR_SUCCESS; +} + + ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, const char *dir) { attr->currdir = ap_pstrdup(attr->cntxt, dir); @@ -166,24 +214,24 @@ ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach) return APR_SUCCESS; } -ap_status_t ap_fork(ap_proc_t **proc, ap_pool_t *cont) +ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) { int pid; - (*proc) = ap_palloc(cont, sizeof(ap_proc_t)); - if ((pid = fork()) < 0) { return errno; - } else if (pid == 0) { - (*proc)->pid = pid; - (*proc)->attr = NULL; - (*proc)->running = TRUE; + } + else if (pid == 0) { + proc->pid = pid; + proc->in = NULL; + proc->out = NULL; + proc->err = NULL; return APR_INCHILD; } - - (*proc)->pid = pid; - (*proc)->attr = NULL; - (*proc)->running = TRUE; + proc->pid = pid; + proc->in = NULL; + proc->out = NULL; + proc->err = NULL; return APR_INPARENT; } @@ -217,7 +265,7 @@ static char *double_quotes(ap_pool_t *cntxt, char *str) -ap_status_t ap_create_process(ap_proc_t **new, const char *progname, +ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, char *const args[], char **env, ap_procattr_t *attr, ap_pool_t *cont) { @@ -235,15 +283,6 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, char *env_block, *env_block_pos; RESULTCODES rescodes; - (*new) = (ap_proc_t *)ap_palloc(cont, sizeof(ap_proc_t)); - - if ((*new) == NULL) { - return APR_ENOMEM; - } - - (*new)->cntxt = cont; - (*new)->running = FALSE; - /* Prevent other threads from running while these process-wide resources are modified */ if (attr->child_in || attr->child_out || attr->child_err || attr->currdir) { criticalsection = TRUE; @@ -402,7 +441,7 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, attr->detached ? EXEC_BACKGROUND : EXEC_ASYNCRESULT, cmdline, env_block, &rescodes, cmdline); - (*new)->pid = rescodes.codeTerminate; + proc->pid = rescodes.codeTerminate; if (attr->currdir != NULL) { chdir(savedir); @@ -432,32 +471,15 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, if (criticalsection) DosExitCritSec(); - (*new)->attr = attr; - (*new)->running = status == APR_SUCCESS; + proc->in = attr->parent_in; + proc->err = attr->parent_err; + proc->out = attr->parent_out; return status; } -ap_status_t ap_get_childin(ap_file_t **new, ap_proc_t *proc) -{ - (*new) = proc->attr->parent_in; - return APR_SUCCESS; -} - -ap_status_t ap_get_childout(ap_file_t **new, ap_proc_t *proc) -{ - (*new) = proc->attr->parent_out; - return APR_SUCCESS; -} - -ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc) -{ - (*new) = proc->attr->parent_err; - return APR_SUCCESS; -} - -ap_status_t ap_wait_proc(ap_proc_t *proc, +ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e wait) { RESULTCODES codes; @@ -467,13 +489,9 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, if (!proc) return APR_ENOPROC; - if (!proc->running) - return APR_CHILD_DONE; - rc = DosWaitChild(DCWA_PROCESS, wait == APR_WAIT ? DCWW_WAIT : DCWW_NOWAIT, &codes, &pid, proc->pid); if (rc == 0) { - proc->running = 0; return APR_CHILD_DONE; } else if (rc == ERROR_CHILD_NOT_COMPLETE) { return APR_CHILD_NOTDONE; diff --git a/threadproc/os2/threadproc.h b/threadproc/os2/threadproc.h index cfcca8d621c..d6971dbb300 100644 --- a/threadproc/os2/threadproc.h +++ b/threadproc/os2/threadproc.h @@ -95,13 +95,6 @@ struct ap_procattr_t { ap_int32_t detached; }; -struct ap_proc_t { - ap_pool_t *cntxt; - pid_t pid; - struct ap_procattr_t *attr; - int running; -}; - typedef void (*os2_thread_start_t)(void *); #endif /* ! THREAD_PROC_H */ From 7a0f4749ce6993bebd8de2dcf744f60b6378edba Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 25 May 2000 18:15:20 +0000 Subject: [PATCH 0124/7878] When translation is performed during MD5 digest calculation, verify in ap_MD5SetXlate() that translation is single-byte-only. The translation logic does not currently handle other types of translation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60098 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_md5.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/apr_md5.c b/lib/apr_md5.c index 8e70113ef54..a6b6c897bbf 100644 --- a/lib/apr_md5.c +++ b/lib/apr_md5.c @@ -204,9 +204,20 @@ API_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context) * to be used for translating the content before calculating the * digest. */ - API_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) { + ap_status_t rv; + int is_sb; + + /* TODO: remove the single-byte-only restriction from this code + */ + rv = ap_xlate_get_sb(xlate, &is_sb); + if (rv != APR_SUCCESS) { + return rv; + } + if (!is_sb) { + return APR_EINVAL; + } context->xlate = xlate; return APR_SUCCESS; } From 7f95adce04e297b5da38ebabe2e06110a732474c Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 25 May 2000 18:15:48 +0000 Subject: [PATCH 0125/7878] Clean up the files_as_sockets commit from yesterday. I am using the hints file to determine if a platform supports this. Currently, only OS/2 and BeOS do not. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60099 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 +++++ hints.m4 | 2 ++ include/apr.h.in | 14 ++++++++------ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index f0b4b434e83..3c511934309 100644 --- a/configure.in +++ b/configure.in @@ -554,7 +554,12 @@ msg=yes ] , [ have_in_addr="0" msg=no ]) AC_MSG_RESULT([$msg]) +if test "x$file_as_socket" = "x" ; then + file_as_socket="1"; +fi + AC_SUBST(have_in_addr) +AC_SUBST(file_as_socket) APR_CHECK_GETHOSTBYNAME_NAS diff --git a/hints.m4 b/hints.m4 index 0f249229d4d..e025ab67eb5 100644 --- a/hints.m4 +++ b/hints.m4 @@ -112,6 +112,7 @@ case "$PLAT" in APR_SETIFNULL(LDFLAGS, -Zexe -Zmtd -Zsysv-signals -Zbin-files) APR_SETIFNULL(LIBS, -lsocket -lufc -lbsd) APR_SETIFNULL(SHELL, sh) + APR_SETIFNULL(file_as_socket, 0) ;; *-hi-hiux) APR_SETIFNULL(CFLAGS, -DHIUX) @@ -345,6 +346,7 @@ dnl ;; ;; *-BeOS*) APR_SETIFNULL(CFLAGS, -DBEOS) + APR_SETIFNULL(file_as_socket, 0) ;; 4850-*.*) APR_SETIFNULL(CFLAGS, -DSVR4 -DMPRAS) diff --git a/include/apr.h.in b/include/apr.h.in index 581ac5b34af..91031e86e56 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -66,13 +66,15 @@ #define APR_HAS_XLATE @iconv@ #define APR_HAS_OTHER_CHILD @oc@ -/* Any time a file and socket are represented as the same type, this macro - * should be true. I don't know of any platforms using Autoconf where this - * isn't true (OS/2? maybe), but I know it isn't true for Windows. For right - * now, just define it as 1, and Windows will define it correctly, if this - * turns out to not work, we can devise an Autoconf test for it later. rbb +/* This macro tells APR that it is safe to make a file masquerade as a + * socket. This is necessary, because some platforms support poll'ing + * on pipes/files, while some don't. APR only supports poll'ing on + * sockets to handle this inconsistensy. However, it is often useful to + * be able to poll on files/pipes on platforms that support it. This + * feature macro allows us to find those platforms and support the feature + * where available. */ -#define APR_FILES_AS_SOCKETS 1 +#define APR_FILES_AS_SOCKETS @file_as_socket@ /* Typedefs that APR needs. */ From c353b54fe58b2a00dcaf508f27c8c13be962abe2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 26 May 2000 05:09:11 +0000 Subject: [PATCH 0126/7878] PR: Obtained from: Submitted by: Reviewed by: All waiting to bite us... just go ahead and ignore this commit. Better now that when we are deciphering real changes. This knocks all the projects into what I expect is a clean VC6 format. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60100 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 2 +- aprlib.dsp | 2 +- aprlibdll.dsp | 2 +- libapr.dsp | 2 +- test/client.dsp | 7 ++++--- test/htdigest.dsp | 10 +++++----- test/server.dsp | 7 ++++--- test/testarg.dsp | 7 ++++--- test/testfile.dsp | 10 +++++----- test/testproc.dsp | 10 +++++----- test/testsig.dsp | 7 ++++--- test/testsock.dsp | 10 +++++----- test/testthread.dsp | 13 ++++++------- test/timetest.dsp | 10 +++++----- 14 files changed, 51 insertions(+), 48 deletions(-) diff --git a/apr.dsp b/apr.dsp index 8cf6c603a6a..38ebe77eb3a 100644 --- a/apr.dsp +++ b/apr.dsp @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 diff --git a/aprlib.dsp b/aprlib.dsp index 8cf6c603a6a..38ebe77eb3a 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 diff --git a/aprlibdll.dsp b/aprlibdll.dsp index 05c8fe9e02d..0547a14b1e5 100644 --- a/aprlibdll.dsp +++ b/aprlibdll.dsp @@ -69,7 +69,7 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" diff --git a/libapr.dsp b/libapr.dsp index 05c8fe9e02d..0547a14b1e5 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -69,7 +69,7 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" diff --git a/test/client.dsp b/test/client.dsp index 2afd1150a16..c2bed0fe45f 100644 --- a/test/client.dsp +++ b/test/client.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="client" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 @@ -22,6 +22,7 @@ CFG=client - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -64,8 +65,8 @@ LINK32=link.exe # PROP Intermediate_Dir "client" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_STDIO_H" /FD /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_STDIO_H" /FD /c # SUBTRACT CPP /YX /Yc /Yu # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" diff --git a/test/htdigest.dsp b/test/htdigest.dsp index a0f8f0bf363..cdb61fae172 100644 --- a/test/htdigest.dsp +++ b/test/htdigest.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="htdigest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 @@ -17,12 +17,12 @@ CFG=htdigest - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "htdigest - Win32 Release" (based on\ - "Win32 (x86) Console Application") +!MESSAGE "htdigest - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "htdigest - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -65,8 +65,8 @@ LINK32=link.exe # PROP Intermediate_Dir "htdigest" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/test/server.dsp b/test/server.dsp index 219546b8c28..105e92b77dc 100644 --- a/test/server.dsp +++ b/test/server.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="server" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 @@ -22,6 +22,7 @@ CFG=server - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -64,8 +65,8 @@ LINK32=link.exe # PROP Intermediate_Dir "server" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_STDIO_H" /FD /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_STDIO_H" /FD /c # SUBTRACT CPP /YX /Yc /Yu # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" diff --git a/test/testarg.dsp b/test/testarg.dsp index a9caadec0d4..9fccdc3774c 100644 --- a/test/testarg.dsp +++ b/test/testarg.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="testarg" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 @@ -22,6 +22,7 @@ CFG=testarg - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -65,8 +66,8 @@ LINK32=link.exe # PROP Intermediate_Dir "testarg" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /YX /Yc /Yu # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" diff --git a/test/testfile.dsp b/test/testfile.dsp index 25671fdf927..97958bbe430 100644 --- a/test/testfile.dsp +++ b/test/testfile.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="testfile" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 @@ -17,12 +17,12 @@ CFG=testfile - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "testfile - Win32 Release" (based on\ - "Win32 (x86) Console Application") +!MESSAGE "testfile - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "testfile - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -66,8 +66,8 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /c # SUBTRACT CPP /YX /Yc /Yu # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" diff --git a/test/testproc.dsp b/test/testproc.dsp index b0a547c8288..e867b563ff9 100644 --- a/test/testproc.dsp +++ b/test/testproc.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="testproc" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 @@ -17,12 +17,12 @@ CFG=testproc - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "testproc - Win32 Release" (based on\ - "Win32 (x86) Console Application") +!MESSAGE "testproc - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "testproc - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -65,8 +65,8 @@ LINK32=link.exe # PROP Intermediate_Dir "testproc" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /YX /Yc /Yu # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" diff --git a/test/testsig.dsp b/test/testsig.dsp index c88c6be9669..c2ba064f517 100644 --- a/test/testsig.dsp +++ b/test/testsig.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="testsig" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 @@ -22,6 +22,7 @@ CFG=testsig - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -64,8 +65,8 @@ LINK32=link.exe # PROP Intermediate_Dir "testsig" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /YX /Yc /Yu # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" diff --git a/test/testsock.dsp b/test/testsock.dsp index ea18db0c7d9..74293b6e350 100644 --- a/test/testsock.dsp +++ b/test/testsock.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="testsock" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 @@ -17,12 +17,12 @@ CFG=testsock - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "testsock - Win32 Release" (based on\ - "Win32 (x86) Console Application") +!MESSAGE "testsock - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "testsock - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -65,8 +65,8 @@ LINK32=link.exe # PROP Intermediate_Dir "testsock" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /YX /Yc /Yu # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" diff --git a/test/testthread.dsp b/test/testthread.dsp index a4b798f0cff..b5d05db3db7 100644 --- a/test/testthread.dsp +++ b/test/testthread.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="testthread" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 @@ -17,13 +17,12 @@ CFG=testthread - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "testthread - Win32 Release" (based on\ - "Win32 (x86) Console Application") -!MESSAGE "testthread - Win32 Debug" (based on\ - "Win32 (x86) Console Application") +!MESSAGE "testthread - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "testthread - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -66,8 +65,8 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /YX /Yc /Yu # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" diff --git a/test/timetest.dsp b/test/timetest.dsp index 007376cfd52..367149d85ce 100644 --- a/test/timetest.dsp +++ b/test/timetest.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="timetest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 @@ -17,12 +17,12 @@ CFG=timetest - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "timetest - Win32 Release" (based on\ - "Win32 (x86) Console Application") +!MESSAGE "timetest - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "timetest - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -65,8 +65,8 @@ LINK32=link.exe # PROP Intermediate_Dir "timetest" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /YX /Yc /Yu # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" From 9f7b6f6fc28a06488a4bc166e8e231565f362c34 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 26 May 2000 16:23:37 +0000 Subject: [PATCH 0127/7878] Mass update of API_IMPORT/EXPORT symbols TO APR_ symbols. APR is -NOT- the Apache server, so the import/export declations cannot use the same defined symbols. Other minor changes API_THREAD_PROC is now APR_THREAD_PROC. API_VAR_IMPORT/EXPORT are now APR_IMPORT/EXPORT_VAR, to allow easier grepping. The new compilation switches APR_STATIC and APR_EXPORT_SYMBOLS allow the builder to select either static linked or the creation of the export symbols for APR. The aprlib and aprlibdll .dsp projects now include the later symbol. More cleanups from recent commits are still needed, as well as a thorough review of the distinction between APR_EXPORT and APR_EXPORT_NONSTD. The later is used only for pure __cdecl required functions, such as variable arguments (not va array arguments, those are not an issue.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60101 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 15 ++--- aprlib.dsp | 15 ++--- aprlibdll.dsp | 8 +-- file_io/os2/readwrite.c | 2 +- file_io/unix/readwrite.c | 2 +- file_io/win32/fileio.h | 2 +- file_io/win32/readwrite.c | 2 +- include/apr.h.in | 10 ++-- include/apr.hw | 24 ++++++-- include/apr_file_io.h | 2 +- include/apr_fnmatch.h | 4 +- include/apr_getopt.h | 4 +- include/apr_lib.h | 114 ++++++++++++++++++------------------ include/apr_md5.h | 10 ++-- include/apr_pools.h | 6 +- include/apr_thread_proc.h | 2 +- include/apr_time.h | 4 +- include/arch/win32/fileio.h | 2 +- lib/apr_cpystrn.c | 6 +- lib/apr_fnmatch.c | 4 +- lib/apr_getpass.c | 2 +- lib/apr_hash.c | 12 ++-- lib/apr_md5.c | 14 ++--- lib/apr_pools.c | 40 ++++++------- lib/apr_snprintf.c | 6 +- lib/apr_tables.c | 42 ++++++------- libapr.dsp | 8 +-- memory/unix/apr_pools.c | 40 ++++++------- misc/unix/getopt.c | 4 +- misc/unix/otherchild.c | 8 +-- misc/win32/names.c | 2 +- test/testthread.c | 16 ++--- threadproc/win32/thread.c | 2 +- time/unix/timestr.c | 4 +- time/win32/timestr.c | 4 +- 35 files changed, 229 insertions(+), 213 deletions(-) diff --git a/apr.dsp b/apr.dsp index 38ebe77eb3a..138a620dd24 100644 --- a/apr.dsp +++ b/apr.dsp @@ -26,7 +26,6 @@ CFG=aprlib - Win32 Debug # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe -RSC=rc.exe !IF "$(CFG)" == "aprlib - Win32 Release" @@ -40,11 +39,12 @@ RSC=rc.exe # PROP Output_Dir "LibR" # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX +RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -65,11 +65,12 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX +RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/aprlib.dsp b/aprlib.dsp index 38ebe77eb3a..138a620dd24 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -26,7 +26,6 @@ CFG=aprlib - Win32 Debug # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe -RSC=rc.exe !IF "$(CFG)" == "aprlib - Win32 Release" @@ -40,11 +39,12 @@ RSC=rc.exe # PROP Output_Dir "LibR" # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX +RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -65,11 +65,12 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX +RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/aprlibdll.dsp b/aprlibdll.dsp index 0547a14b1e5..9fadaf51d9a 100644 --- a/aprlibdll.dsp +++ b/aprlibdll.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" @@ -54,7 +54,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib !ELSEIF "$(CFG)" == "aprlibdll - Win32 Debug" @@ -70,7 +70,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" @@ -81,7 +81,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib # SUBTRACT LINK32 /incremental:no /map !ENDIF diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index d63ae181353..5fb3f72a39c 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -325,7 +325,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) -API_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) +APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) { int cc; va_list ap; diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index d71c0205d39..85e323e9d6e 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -393,7 +393,7 @@ static int printf_flush(ap_vformatter_buff_t *vbuff) } #endif -API_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) +APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) { int cc; va_list ap; diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 7d9adf35381..55d6847d6a8 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -137,7 +137,7 @@ struct ap_dir_t { ap_status_t file_cleanup(void *); /*mode_t get_fileperms(ap_fileperms_t); */ -API_EXPORT(char *) ap_os_systemcase_filename(struct ap_pool_t *pCont, +APR_EXPORT(char *) ap_os_systemcase_filename(struct ap_pool_t *pCont, const char *szFile); char * canonical_filename(struct ap_pool_t *pCont, const char *szFile); diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 0f3d18b7e0f..8124f3fa660 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -322,7 +322,7 @@ static int printf_flush(ap_vformatter_buff_t *vbuff) return -1; } -API_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) +APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) { int cc; va_list ap; diff --git a/include/apr.h.in b/include/apr.h.in index 91031e86e56..98a9f6b420e 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -93,11 +93,11 @@ typedef @off_t_value@ ap_off_t; /* Definitions that APR programs need to work properly. */ -#define API_THREAD_FUNC -#define API_EXPORT(type) type -#define API_EXPORT_NONSTD(type) type -#define API_VAR_IMPORT extern -#define API_VAR_EXPORT +#define APR_THREAD_FUNC +#define APR_EXPORT(type) type +#define APR_EXPORT_NONSTD(type) type +#define APR_IMPORT_VAR extern +#define APR_EXPORT_VAR /* Define APR_SSIZE_T_FMT. * If ssize_t is an integer we define it to be "d", diff --git a/include/apr.hw b/include/apr.hw index 1f346e4ec9b..ad9cc3e85e9 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -163,11 +163,25 @@ typedef int gid_t; /* Definitions that APR programs need to work properly. */ #define APR_SSIZE_T_FMT "d" -#define API_THREAD_FUNC __stdcall -#define API_EXPORT(type) type -#define API_EXPORT_NONSTD(type) type -#define API_VAR_IMPORT extern _declspec(dllimport) -#define API_VAR_EXPORT +#define APR_THREAD_FUNC __stdcall + +#if defined(APR_EXPORT_SYMBOLS) +#define APR_EXPORT(type) __declspec(dllexport) type +#define APR_EXPORT_NONSTD(type) __declspec(dllexport) type +#define APR_EXPORT_VAR __declspec(dllexport) +#define APR_IMPORT_VAR extern __declspec(dllexport) +#elif defined(APR_STATIC) +#define APR_EXPORT(type) type +#define APR_EXPORT_NONSTD(type) type +#define APR_EXPORT_VAR +#define APR_IMPORT_VAR extern +#else +/* Default behavior is to import the shared .dll */ +#define APR_EXPORT(type) __declspec(dllimport) type +#define APR_EXPORT_NONSTD(type) __declspec(dllimport) type +#define APR_EXPORT_VAR __declspec(dllimport) +#define APR_IMPORT_VAR extern __declspec(dllimport) +#endif #define ap_signal(a,b) signal(a,b) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 02f072de16a..a58463ce6b2 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -391,7 +391,7 @@ B =cut */ ap_status_t ap_flush(ap_file_t *thefile); -API_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) +APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) __attribute__((format(printf,2,3))); /* diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index c0300b6389b..ba27efd1c18 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -51,11 +51,11 @@ extern "C" { /* This flag is an Apache addition */ #define FNM_CASE_BLIND 0x08 /* Compare characters case ap_pool_t nsensitively. */ -API_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *strings, +APR_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *strings, int flags); /* this function is an Apache addition */ -API_EXPORT(int) ap_is_fnmatch(const char *pattern); +APR_EXPORT(int) ap_is_fnmatch(const char *pattern); #ifdef __cplusplus } diff --git a/include/apr_getopt.h b/include/apr_getopt.h index f9ae7603f91..e98d1e6dac1 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -55,12 +55,12 @@ #ifndef APR_GETOPT_H #define APR_GETOPT_H -API_VAR_IMPORT int +APR_IMPORT_VAR int ap_opterr, /* if error message should be printed */ ap_optind, /* index into parent argv vector */ ap_optopt, /* character checked for validity */ ap_optreset; /* reset getopt */ -API_VAR_IMPORT char * +APR_IMPORT_VAR char * ap_optarg; /* argument associated with option */ /* diff --git a/include/apr_lib.h b/include/apr_lib.h index 9f58b214cd3..f706756406f 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -126,17 +126,17 @@ enum kill_conditions { /* * Define the prototypes for the various APR GP routines. */ -API_EXPORT(char *) ap_cpystrn(char *d, const char *s, size_t l); -API_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, +APR_EXPORT(char *) ap_cpystrn(char *d, const char *s, size_t l); +APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, char ***argv_out, ap_pool_t *token_context); -API_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); -API_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src); +APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); +APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src); -/*API_EXPORT(ap_mutex_t *) ap_create_mutex(void *m);*/ -API_EXPORT(int) ap_slack(int l, int h); -API_EXPORT_NONSTD(ap_status_t) ap_execle(const char *c, const char *a, ...); -API_EXPORT_NONSTD(ap_status_t) ap_execve(const char *c, const char *argv[], +/*APR_EXPORT(ap_mutex_t *) ap_create_mutex(void *m);*/ +APR_EXPORT(int) ap_slack(int l, int h); +APR_EXPORT_NONSTD(ap_status_t) ap_execle(const char *c, const char *a, ...); +APR_EXPORT_NONSTD(ap_status_t) ap_execve(const char *c, const char *argv[], const char *envp[]); #define ap_create_mutex(x) (0) @@ -230,7 +230,7 @@ API_EXPORT_NONSTD(ap_status_t) ap_execve(const char *c, const char *argv[], * or until ap_vformatter returns. */ -API_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b), +APR_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b), ap_vformatter_buff_t *c, const char *fmt, va_list ap); @@ -238,7 +238,7 @@ API_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b), /* A small routine to validate a plain text password with a password * that has been encrypted using any algorithm APR knows about. */ -API_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *hash); +APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *hash); /* @@ -257,22 +257,22 @@ API_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *has * to distinguish between an output which was truncated, and an output which * exactly filled the buffer. */ -API_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format, ...) +APR_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format, ...) __attribute__((format(printf,3,4))); -API_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, +APR_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap); /* * APR memory structure manipulators (pools, tables, and arrays). */ -API_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)); -API_EXPORT(void) ap_clear_pool(struct ap_pool_t *p); -API_EXPORT(void) ap_destroy_pool(struct ap_pool_t *p); -API_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p); -API_EXPORT(long) ap_bytes_in_free_blocks(void); -API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts); -API_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); -API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub); +APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)); +APR_EXPORT(void) ap_clear_pool(struct ap_pool_t *p); +APR_EXPORT(void) ap_destroy_pool(struct ap_pool_t *p); +APR_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p); +APR_EXPORT(long) ap_bytes_in_free_blocks(void); +APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts); +APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); +APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub); /* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t will not be * destroyed before the parent pool @@ -285,78 +285,78 @@ API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub); #endif /* POOL_DEBUG */ -API_EXPORT(void *) ap_palloc(struct ap_pool_t *c, int reqsize); -API_EXPORT(void *) ap_pcalloc(struct ap_pool_t *p, int size); -API_EXPORT(char *) ap_pstrdup(struct ap_pool_t *p, const char *s); -API_EXPORT(char *) ap_pstrndup(struct ap_pool_t *p, const char *s, int n); -API_EXPORT_NONSTD(char *) ap_pstrcat(struct ap_pool_t *p, ...); -API_EXPORT(char *) ap_pvsprintf(struct ap_pool_t *p, const char *fmt, va_list ap); -API_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *p, const char *fmt, ...); -API_EXPORT(ap_array_header_t *) ap_make_array(struct ap_pool_t *p, int nelts, +APR_EXPORT(void *) ap_palloc(struct ap_pool_t *c, int reqsize); +APR_EXPORT(void *) ap_pcalloc(struct ap_pool_t *p, int size); +APR_EXPORT(char *) ap_pstrdup(struct ap_pool_t *p, const char *s); +APR_EXPORT(char *) ap_pstrndup(struct ap_pool_t *p, const char *s, int n); +APR_EXPORT_NONSTD(char *) ap_pstrcat(struct ap_pool_t *p, ...); +APR_EXPORT(char *) ap_pvsprintf(struct ap_pool_t *p, const char *fmt, va_list ap); +APR_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *p, const char *fmt, ...); +APR_EXPORT(ap_array_header_t *) ap_make_array(struct ap_pool_t *p, int nelts, int elt_size); -API_EXPORT(void *) ap_push_array(ap_array_header_t *arr); -API_EXPORT(void) ap_array_cat(ap_array_header_t *dst, +APR_EXPORT(void *) ap_push_array(ap_array_header_t *arr); +APR_EXPORT(void) ap_array_cat(ap_array_header_t *dst, const ap_array_header_t *src); -API_EXPORT(ap_array_header_t *) ap_copy_array(struct ap_pool_t *p, +APR_EXPORT(ap_array_header_t *) ap_copy_array(struct ap_pool_t *p, const ap_array_header_t *arr); -API_EXPORT(ap_array_header_t *) +APR_EXPORT(ap_array_header_t *) ap_copy_array_hdr(struct ap_pool_t *p, const ap_array_header_t *arr); -API_EXPORT(ap_array_header_t *) +APR_EXPORT(ap_array_header_t *) ap_append_arrays(struct ap_pool_t *p, const ap_array_header_t *first, const ap_array_header_t *second); -API_EXPORT(char *) ap_array_pstrcat(struct ap_pool_t *p, +APR_EXPORT(char *) ap_array_pstrcat(struct ap_pool_t *p, const ap_array_header_t *arr, const char sep); -API_EXPORT(ap_table_t *) ap_make_table(struct ap_pool_t *p, int nelts); -API_EXPORT(ap_table_t *) ap_copy_table(struct ap_pool_t *p, const ap_table_t *t); -API_EXPORT(void) ap_clear_table(ap_table_t *t); -API_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key); -API_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, +APR_EXPORT(ap_table_t *) ap_make_table(struct ap_pool_t *p, int nelts); +APR_EXPORT(ap_table_t *) ap_copy_table(struct ap_pool_t *p, const ap_table_t *t); +APR_EXPORT(void) ap_clear_table(ap_table_t *t); +APR_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key); +APR_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, const char *val); -API_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, +APR_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, const char *val); -API_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key); -API_EXPORT(void) ap_table_merge(ap_table_t *t, const char *key, +APR_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key); +APR_EXPORT(void) ap_table_merge(ap_table_t *t, const char *key, const char *val); -API_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, +APR_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, const char *val); -API_EXPORT(void) ap_table_add(ap_table_t *t, const char *key, +APR_EXPORT(void) ap_table_add(ap_table_t *t, const char *key, const char *val); -API_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, +APR_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, const char *val); -API_EXPORT(ap_table_t *) ap_overlay_tables(struct ap_pool_t *p, +APR_EXPORT(ap_table_t *) ap_overlay_tables(struct ap_pool_t *p, const ap_table_t *overlay, const ap_table_t *base); -API_EXPORT(void) +APR_EXPORT(void) ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, const ap_table_t *t, ...); #define AP_OVERLAP_TABLES_SET (0) #define AP_OVERLAP_TABLES_MERGE (1) -API_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, +APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, unsigned flags); -API_EXPORT(void) ap_register_cleanup(struct ap_pool_t *p, void *data, +APR_EXPORT(void) ap_register_cleanup(struct ap_pool_t *p, void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)); -API_EXPORT(void) ap_kill_cleanup(struct ap_pool_t *p, void *data, +APR_EXPORT(void) ap_kill_cleanup(struct ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)); -API_EXPORT(ap_status_t) ap_run_cleanup(struct ap_pool_t *p, void *data, +APR_EXPORT(ap_status_t) ap_run_cleanup(struct ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)); -API_EXPORT(void) ap_cleanup_for_exec(void); -API_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize); -API_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data); +APR_EXPORT(void) ap_cleanup_for_exec(void); +APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize); +APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data); -API_EXPORT(void) ap_note_subprocess(struct ap_pool_t *a, ap_proc_t *pid, +APR_EXPORT(void) ap_note_subprocess(struct ap_pool_t *a, ap_proc_t *pid, enum kill_conditions how); -API_EXPORT(int) +APR_EXPORT(int) ap_spawn_child(ap_pool_t *p, int (*func) (void *a, ap_child_info_t *c), void *data, enum kill_conditions kill_how, FILE **pipe_in, FILE **pipe_out, FILE **pipe_err); -API_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size); +APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size); #ifdef __cplusplus } diff --git a/include/apr_md5.h b/include/apr_md5.h index 8bdf1e3037f..25586c1d81c 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -107,18 +107,18 @@ typedef struct { #endif } ap_md5_ctx_t; -API_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context); +APR_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context); #if APR_HAS_XLATE -API_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate); +APR_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate); #else #define ap_MD5SetXlate(context, xlate) APR_ENOTIMPL #endif -API_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, +APR_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen); -API_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], +APR_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], ap_md5_ctx_t *context); -API_EXPORT(ap_status_t) ap_MD5Encode(const char *password, const char *salt, +APR_EXPORT(ap_status_t) ap_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes); #ifdef __cplusplus diff --git a/include/apr_pools.h b/include/apr_pools.h index c485464e2d4..5d46ba8b8f6 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -135,7 +135,7 @@ void ap_term_alloc(void); /* Tear down everything */ /* routines to allocate memory from an pool... */ -API_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *, const char *fmt, ...) +APR_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *, const char *fmt, ...) __attribute__((format(printf,2,3))); /* array and alist management... keeping lists of things. @@ -234,8 +234,8 @@ extern int raise_sigstop_flags; /* Finally, some accounting */ -API_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p); -API_EXPORT(long) ap_bytes_in_free_blocks(void); +APR_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p); +APR_EXPORT(long) ap_bytes_in_free_blocks(void); #ifdef __cplusplus } diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index fe56ac5eef9..bcf3b50132e 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -103,7 +103,7 @@ typedef struct ap_threadkey_t ap_threadkey_t; typedef struct ap_other_child_rec_t ap_other_child_rec_t; #endif /* APR_HAS_OTHER_CHILD */ -typedef void *(API_THREAD_FUNC *ap_thread_start_t)(void *); +typedef void *(APR_THREAD_FUNC *ap_thread_start_t)(void *); /* Thread Function definitions */ diff --git a/include/apr_time.h b/include/apr_time.h index e38cdb84b75..c423c068bdb 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -62,8 +62,8 @@ extern "C" { #endif /* __cplusplus */ -API_VAR_IMPORT const char ap_month_snames[12][4]; -API_VAR_IMPORT const char ap_day_snames[7][4]; +APR_IMPORT_VAR const char ap_month_snames[12][4]; +APR_IMPORT_VAR const char ap_day_snames[7][4]; /* number of microseconds since 00:00:00 january 1, 1970 UTC */ typedef ap_int64_t ap_time_t; diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 7d9adf35381..55d6847d6a8 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -137,7 +137,7 @@ struct ap_dir_t { ap_status_t file_cleanup(void *); /*mode_t get_fileperms(ap_fileperms_t); */ -API_EXPORT(char *) ap_os_systemcase_filename(struct ap_pool_t *pCont, +APR_EXPORT(char *) ap_os_systemcase_filename(struct ap_pool_t *pCont, const char *szFile); char * canonical_filename(struct ap_pool_t *pCont, const char *szFile); diff --git a/lib/apr_cpystrn.c b/lib/apr_cpystrn.c index 3e67baa36cd..160e0b9e9d5 100644 --- a/lib/apr_cpystrn.c +++ b/lib/apr_cpystrn.c @@ -78,7 +78,7 @@ * ap_cpystrn() follows the same call structure as strncpy(). */ -API_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size) +APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size) { char *d, *end; @@ -118,7 +118,7 @@ API_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size) * pool and filled in with copies of the tokens * found during parsing of the arg_str. */ -API_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, +APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, char ***argv_out, ap_pool_t *token_context) { @@ -232,7 +232,7 @@ const char *ap_filename_of_pathname(const char *pathname) * collapse in place (src == dest) is legal. * returns terminating null ptr to dest string. */ -API_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src) +APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src) { while (*src) { if (!ap_isspace(*src)) diff --git a/lib/apr_fnmatch.c b/lib/apr_fnmatch.c index 9936917b53f..b8449ef3710 100644 --- a/lib/apr_fnmatch.c +++ b/lib/apr_fnmatch.c @@ -56,7 +56,7 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; static const char *rangematch(const char *, int, int); -API_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *string, int flags) +APR_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *string, int flags) { const char *stringstart; char c, test; @@ -210,7 +210,7 @@ static const char *rangematch(const char *pattern, int test, int flags) /* This function is an Apache addition */ /* return non-zero if pattern has any glob chars in it */ -API_EXPORT(int) ap_is_fnmatch(const char *pattern) +APR_EXPORT(int) ap_is_fnmatch(const char *pattern) { int nesting; diff --git a/lib/apr_getpass.c b/lib/apr_getpass.c index 4afea4a85cc..13cac5f783a 100644 --- a/lib/apr_getpass.c +++ b/lib/apr_getpass.c @@ -203,7 +203,7 @@ static char *getpass(const char *prompt) * but the caller is *not* made aware of it. */ -API_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsiz) +APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsiz) { char *pw_got = NULL; int result = 0; diff --git a/lib/apr_hash.c b/lib/apr_hash.c index 1242aac751c..5033c8a08b1 100644 --- a/lib/apr_hash.c +++ b/lib/apr_hash.c @@ -127,7 +127,7 @@ static ap_hash_entry_t **alloc_array(ap_hash_t *ht) return ap_pcalloc(ht->pool, sizeof(*ht->array) * (ht->max + 1)); } -API_EXPORT(ap_hash_t *) ap_make_hash(ap_pool_t *pool) +APR_EXPORT(ap_hash_t *) ap_make_hash(ap_pool_t *pool) { ap_hash_t *ht; ht = ap_palloc(pool, sizeof(ap_hash_t)); @@ -143,7 +143,7 @@ API_EXPORT(ap_hash_t *) ap_make_hash(ap_pool_t *pool) * Hash iteration functions. */ -API_EXPORT(ap_hash_index_t *) ap_hash_next(ap_hash_index_t *hi) +APR_EXPORT(ap_hash_index_t *) ap_hash_next(ap_hash_index_t *hi) { hi->this = hi->next; while (!hi->this) { @@ -155,7 +155,7 @@ API_EXPORT(ap_hash_index_t *) ap_hash_next(ap_hash_index_t *hi) return hi; } -API_EXPORT(ap_hash_index_t *) ap_hash_first(ap_hash_t *ht) +APR_EXPORT(ap_hash_index_t *) ap_hash_first(ap_hash_t *ht) { ap_hash_index_t *hi; hi = ap_palloc(ht->pool, sizeof(*hi)); @@ -166,7 +166,7 @@ API_EXPORT(ap_hash_index_t *) ap_hash_first(ap_hash_t *ht) return ap_hash_next(hi); } -API_EXPORT(void) ap_hash_this(ap_hash_index_t *hi, +APR_EXPORT(void) ap_hash_this(ap_hash_index_t *hi, void **key, size_t *klen, void **val) @@ -253,7 +253,7 @@ static ap_hash_entry_t **find_entry(ap_hash_t *ht, return hep; } -API_EXPORT(void *) ap_hash_get(ap_hash_t *ht, +APR_EXPORT(void *) ap_hash_get(ap_hash_t *ht, void *key, size_t klen) { @@ -265,7 +265,7 @@ API_EXPORT(void *) ap_hash_get(ap_hash_t *ht, return NULL; } -API_EXPORT(void) ap_hash_set(ap_hash_t *ht, +APR_EXPORT(void) ap_hash_set(ap_hash_t *ht, void *key, size_t klen, void *val) diff --git a/lib/apr_md5.c b/lib/apr_md5.c index a6b6c897bbf..1ba56bff627 100644 --- a/lib/apr_md5.c +++ b/lib/apr_md5.c @@ -185,7 +185,7 @@ static ap_xlate_t *xlate_ebcdic_to_ascii; /* used in ap_MD5Encode() */ /* MD5 initialization. Begins an MD5 operation, writing a new context. */ -API_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context) +APR_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context) { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ @@ -204,7 +204,7 @@ API_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context) * to be used for translating the content before calculating the * digest. */ -API_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) +APR_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) { ap_status_t rv; int is_sb; @@ -227,7 +227,7 @@ API_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) operation, processing another message block, and updating the context. */ -API_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, +APR_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) { @@ -308,7 +308,7 @@ API_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ -API_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], +APR_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], ap_md5_ctx_t *context) { unsigned char bits[8]; @@ -458,7 +458,7 @@ static void Decode(UINT4 *output, const unsigned char *input, unsigned int len) } #ifdef CHARSET_EBCDIC -API_EXPORT(ap_status_t) ap_MD5InitEBCDIC(ap_xlate_t *xlate) +APR_EXPORT(ap_status_t) ap_MD5InitEBCDIC(ap_xlate_t *xlate) { xlate_ebcdic_to_ascii = xlate; return APR_SUCCESS; @@ -488,7 +488,7 @@ static void to64(char *s, unsigned long v, int n) } } -API_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, +APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, char *result, size_t nbytes) { /* @@ -648,7 +648,7 @@ API_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, * APR_EMISMATCH if they don't. */ -API_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *hash) +APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *hash) { char sample[120]; #ifndef WIN32 diff --git a/lib/apr_pools.c b/lib/apr_pools.c index c8976ba5465..f91f9160811 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -492,7 +492,7 @@ static ap_pool_t *permanent_pool; #define POOL_HDR_CLICKS (1 + ((sizeof(struct ap_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -API_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) +APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) { union block_hdr *blok; ap_pool_t *new_pool; @@ -573,7 +573,7 @@ struct cleanup { struct cleanup *next; }; -API_EXPORT(void) ap_register_cleanup(ap_pool_t *p, void *data, +APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)) { @@ -589,7 +589,7 @@ API_EXPORT(void) ap_register_cleanup(ap_pool_t *p, void *data, } } -API_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, +APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)) { struct cleanup *c; @@ -610,7 +610,7 @@ API_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, } } -API_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, +APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)) { ap_kill_cleanup(p, data, cleanup); @@ -643,7 +643,7 @@ static void cleanup_pool_for_exec(ap_pool_t *p) } } -API_EXPORT(void) ap_cleanup_for_exec(void) +APR_EXPORT(void) ap_cleanup_for_exec(void) { #if !defined(WIN32) && !defined(OS2) /* @@ -659,7 +659,7 @@ API_EXPORT(void) ap_cleanup_for_exec(void) #endif /* ndef WIN32 */ } -API_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data) +APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data) { /* do nothing cleanup routine */ return APR_SUCCESS; @@ -712,7 +712,7 @@ void ap_term_alloc(void) * This way, we are garaunteed that we only lock this mutex once when calling * either one of these functions. */ -API_EXPORT(void) ap_clear_pool(ap_pool_t *a) +APR_EXPORT(void) ap_clear_pool(ap_pool_t *a) { while (a->sub_pools) { ap_destroy_pool(a->sub_pools); @@ -747,7 +747,7 @@ API_EXPORT(void) ap_clear_pool(ap_pool_t *a) #endif } -API_EXPORT(void) ap_destroy_pool(ap_pool_t *a) +APR_EXPORT(void) ap_destroy_pool(ap_pool_t *a) { ap_clear_pool(a); #if APR_HAS_THREADS @@ -771,11 +771,11 @@ API_EXPORT(void) ap_destroy_pool(ap_pool_t *a) free_blocks(a->first); } -API_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p) +APR_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p) { return bytes_in_block_list(p->first); } -API_EXPORT(long) ap_bytes_in_free_blocks(void) +APR_EXPORT(long) ap_bytes_in_free_blocks(void) { return bytes_in_block_list(block_freelist); } @@ -798,7 +798,7 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode)) +APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode)) { const char *s = ts; union block_hdr **pb; @@ -842,7 +842,7 @@ API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode /* return TRUE iff a is an ancestor of b * NULL is considered an ancestor of all pools */ -API_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) +APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) { if (a == NULL) { return 1; @@ -864,7 +864,7 @@ API_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, +APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, int (*apr_abort)(int retcode)) { union block_hdr *b; @@ -979,14 +979,14 @@ void * ap_palloc(ap_pool_t *a, int reqsize) #endif } -API_EXPORT(void *) ap_pcalloc(ap_pool_t *a, int size) +APR_EXPORT(void *) ap_pcalloc(ap_pool_t *a, int size) { void *res = ap_palloc(a, size); memset(res, '\0', size); return res; } -API_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) +APR_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) { char *res; size_t len; @@ -1000,7 +1000,7 @@ API_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) return res; } -API_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, int n) +APR_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, int n) { char *res; @@ -1013,7 +1013,7 @@ API_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, int n) return res; } -API_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *a, ...) +APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *a, ...) { char *cp, *argp, *res; @@ -1138,7 +1138,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) #endif } -API_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) +APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) { #ifdef ALLOC_USE_MALLOC struct psprintf_data ps; @@ -1197,7 +1197,7 @@ API_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) #endif } -API_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) +APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) { va_list ap; char *res; @@ -1220,7 +1220,7 @@ API_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -API_EXPORT(void) ap_note_subprocess(ap_pool_t *a, ap_proc_t *pid, +APR_EXPORT(void) ap_note_subprocess(ap_pool_t *a, ap_proc_t *pid, enum kill_conditions how) { struct process_chain *new = diff --git a/lib/apr_snprintf.c b/lib/apr_snprintf.c index 354843a3d46..5f9da46774c 100644 --- a/lib/apr_snprintf.c +++ b/lib/apr_snprintf.c @@ -655,7 +655,7 @@ static char *conv_p2_quad(u_widest_int num, register int nbits, /* * Do format conversion placing the output in buffer */ -API_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *), +APR_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *), ap_vformatter_buff_t *vbuff, const char *fmt, va_list ap) { register char *sp; @@ -1157,7 +1157,7 @@ static int snprintf_flush(ap_vformatter_buff_t *vbuff) } -API_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format,...) +APR_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format,...) { int cc; va_list ap; @@ -1177,7 +1177,7 @@ API_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format,...) } -API_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, +APR_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap) { int cc; diff --git a/lib/apr_tables.c b/lib/apr_tables.c index 79181ab8283..b42b1d6ceef 100644 --- a/lib/apr_tables.c +++ b/lib/apr_tables.c @@ -103,7 +103,7 @@ static void make_array_core(ap_array_header_t *res, ap_pool_t *c, res->nalloc = nelts; /* ...but this many allocated */ } -API_EXPORT(ap_array_header_t *) ap_make_array(ap_pool_t *p, +APR_EXPORT(ap_array_header_t *) ap_make_array(ap_pool_t *p, int nelts, int elt_size) { ap_array_header_t *res; @@ -113,7 +113,7 @@ API_EXPORT(ap_array_header_t *) ap_make_array(ap_pool_t *p, return res; } -API_EXPORT(void *) ap_push_array(ap_array_header_t *arr) +APR_EXPORT(void *) ap_push_array(ap_array_header_t *arr) { if (arr->nelts == arr->nalloc) { int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2; @@ -130,7 +130,7 @@ API_EXPORT(void *) ap_push_array(ap_array_header_t *arr) return arr->elts + (arr->elt_size * (arr->nelts - 1)); } -API_EXPORT(void) ap_array_cat(ap_array_header_t *dst, +APR_EXPORT(void) ap_array_cat(ap_array_header_t *dst, const ap_array_header_t *src) { int elt_size = dst->elt_size; @@ -155,7 +155,7 @@ API_EXPORT(void) ap_array_cat(ap_array_header_t *dst, dst->nelts += src->nelts; } -API_EXPORT(ap_array_header_t *) ap_copy_array(ap_pool_t *p, +APR_EXPORT(ap_array_header_t *) ap_copy_array(ap_pool_t *p, const ap_array_header_t *arr) { ap_array_header_t *res = ap_make_array(p, arr->nalloc, arr->elt_size); @@ -181,7 +181,7 @@ static APR_INLINE void copy_array_hdr_core(ap_array_header_t *res, res->nalloc = arr->nelts; /* Force overflow on push */ } -API_EXPORT(ap_array_header_t *) +APR_EXPORT(ap_array_header_t *) ap_copy_array_hdr(ap_pool_t *p, const ap_array_header_t *arr) { @@ -195,7 +195,7 @@ API_EXPORT(ap_array_header_t *) /* The above is used here to avoid consing multiple new array bodies... */ -API_EXPORT(ap_array_header_t *) +APR_EXPORT(ap_array_header_t *) ap_append_arrays(ap_pool_t *p, const ap_array_header_t *first, const ap_array_header_t *second) @@ -212,7 +212,7 @@ API_EXPORT(ap_array_header_t *) * or if there are no elements in the array. * If sep is non-NUL, it will be inserted between elements as a separator. */ -API_EXPORT(char *) ap_array_pstrcat(ap_pool_t *p, +APR_EXPORT(char *) ap_array_pstrcat(ap_pool_t *p, const ap_array_header_t *arr, const char sep) { @@ -289,7 +289,7 @@ static ap_table_entry_t *table_push(ap_table_t *t) #endif /* MAKE_TABLE_PROFILE */ -API_EXPORT(ap_table_t *) ap_make_table(ap_pool_t *p, int nelts) +APR_EXPORT(ap_table_t *) ap_make_table(ap_pool_t *p, int nelts) { ap_table_t *t = ap_palloc(p, sizeof(ap_table_t)); @@ -300,7 +300,7 @@ API_EXPORT(ap_table_t *) ap_make_table(ap_pool_t *p, int nelts) return t; } -API_EXPORT(ap_table_t *) ap_copy_table(ap_pool_t *p, const ap_table_t *t) +APR_EXPORT(ap_table_t *) ap_copy_table(ap_pool_t *p, const ap_table_t *t) { ap_table_t *new = ap_palloc(p, sizeof(ap_table_t)); @@ -319,12 +319,12 @@ API_EXPORT(ap_table_t *) ap_copy_table(ap_pool_t *p, const ap_table_t *t) return new; } -API_EXPORT(void) ap_clear_table(ap_table_t *t) +APR_EXPORT(void) ap_clear_table(ap_table_t *t) { t->a.nelts = 0; } -API_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key) +APR_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key) { ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; int i; @@ -342,7 +342,7 @@ API_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key) return NULL; } -API_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, +APR_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, const char *val) { register int i, j, k; @@ -376,7 +376,7 @@ API_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, } } -API_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, +APR_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, const char *val) { register int i, j, k; @@ -423,7 +423,7 @@ API_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, } } -API_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key) +APR_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key) { register int i, j, k; ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; @@ -448,7 +448,7 @@ API_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key) } } -API_EXPORT(void) ap_table_merge(ap_table_t *t, const char *key, +APR_EXPORT(void) ap_table_merge(ap_table_t *t, const char *key, const char *val) { ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; @@ -466,7 +466,7 @@ API_EXPORT(void) ap_table_merge(ap_table_t *t, const char *key, elts->val = ap_pstrdup(t->a.cont, val); } -API_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, +APR_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, const char *val) { ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; @@ -497,7 +497,7 @@ API_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, elts->val = (char *)val; } -API_EXPORT(void) ap_table_add(ap_table_t *t, const char *key, +APR_EXPORT(void) ap_table_add(ap_table_t *t, const char *key, const char *val) { ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; @@ -507,7 +507,7 @@ API_EXPORT(void) ap_table_add(ap_table_t *t, const char *key, elts->val = ap_pstrdup(t->a.cont, val); } -API_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, +APR_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, const char *val) { ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; @@ -530,7 +530,7 @@ API_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, elts->val = (char *)val; } -API_EXPORT(ap_table_t *) ap_overlay_tables(ap_pool_t *p, +APR_EXPORT(ap_table_t *) ap_overlay_tables(ap_pool_t *p, const ap_table_t *overlay, const ap_table_t *base) { @@ -584,7 +584,7 @@ API_EXPORT(ap_table_t *) ap_overlay_tables(ap_pool_t *p, * Note that rec is simply passed-on to the comp function, so that the * caller can pass additional info for the task. */ -API_EXPORT(void) ap_table_do(int (*comp) (void *, const char *, const char *), +APR_EXPORT(void) ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, const ap_table_t *t, ...) { va_list vp; @@ -639,7 +639,7 @@ static int sort_overlap(const void *va, const void *vb) #define ap_OVERLAP_TABLES_ON_STACK (512) #endif -API_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, +APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, unsigned flags) { overlap_key cat_keys_buf[ap_OVERLAP_TABLES_ON_STACK]; diff --git a/libapr.dsp b/libapr.dsp index 0547a14b1e5..9fadaf51d9a 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" @@ -54,7 +54,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib !ELSEIF "$(CFG)" == "aprlibdll - Win32 Debug" @@ -70,7 +70,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" @@ -81,7 +81,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib # SUBTRACT LINK32 /incremental:no /map !ENDIF diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index c8976ba5465..f91f9160811 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -492,7 +492,7 @@ static ap_pool_t *permanent_pool; #define POOL_HDR_CLICKS (1 + ((sizeof(struct ap_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -API_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) +APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) { union block_hdr *blok; ap_pool_t *new_pool; @@ -573,7 +573,7 @@ struct cleanup { struct cleanup *next; }; -API_EXPORT(void) ap_register_cleanup(ap_pool_t *p, void *data, +APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)) { @@ -589,7 +589,7 @@ API_EXPORT(void) ap_register_cleanup(ap_pool_t *p, void *data, } } -API_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, +APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)) { struct cleanup *c; @@ -610,7 +610,7 @@ API_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, } } -API_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, +APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)) { ap_kill_cleanup(p, data, cleanup); @@ -643,7 +643,7 @@ static void cleanup_pool_for_exec(ap_pool_t *p) } } -API_EXPORT(void) ap_cleanup_for_exec(void) +APR_EXPORT(void) ap_cleanup_for_exec(void) { #if !defined(WIN32) && !defined(OS2) /* @@ -659,7 +659,7 @@ API_EXPORT(void) ap_cleanup_for_exec(void) #endif /* ndef WIN32 */ } -API_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data) +APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data) { /* do nothing cleanup routine */ return APR_SUCCESS; @@ -712,7 +712,7 @@ void ap_term_alloc(void) * This way, we are garaunteed that we only lock this mutex once when calling * either one of these functions. */ -API_EXPORT(void) ap_clear_pool(ap_pool_t *a) +APR_EXPORT(void) ap_clear_pool(ap_pool_t *a) { while (a->sub_pools) { ap_destroy_pool(a->sub_pools); @@ -747,7 +747,7 @@ API_EXPORT(void) ap_clear_pool(ap_pool_t *a) #endif } -API_EXPORT(void) ap_destroy_pool(ap_pool_t *a) +APR_EXPORT(void) ap_destroy_pool(ap_pool_t *a) { ap_clear_pool(a); #if APR_HAS_THREADS @@ -771,11 +771,11 @@ API_EXPORT(void) ap_destroy_pool(ap_pool_t *a) free_blocks(a->first); } -API_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p) +APR_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p) { return bytes_in_block_list(p->first); } -API_EXPORT(long) ap_bytes_in_free_blocks(void) +APR_EXPORT(long) ap_bytes_in_free_blocks(void) { return bytes_in_block_list(block_freelist); } @@ -798,7 +798,7 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode)) +APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode)) { const char *s = ts; union block_hdr **pb; @@ -842,7 +842,7 @@ API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode /* return TRUE iff a is an ancestor of b * NULL is considered an ancestor of all pools */ -API_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) +APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) { if (a == NULL) { return 1; @@ -864,7 +864,7 @@ API_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, +APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, int (*apr_abort)(int retcode)) { union block_hdr *b; @@ -979,14 +979,14 @@ void * ap_palloc(ap_pool_t *a, int reqsize) #endif } -API_EXPORT(void *) ap_pcalloc(ap_pool_t *a, int size) +APR_EXPORT(void *) ap_pcalloc(ap_pool_t *a, int size) { void *res = ap_palloc(a, size); memset(res, '\0', size); return res; } -API_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) +APR_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) { char *res; size_t len; @@ -1000,7 +1000,7 @@ API_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) return res; } -API_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, int n) +APR_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, int n) { char *res; @@ -1013,7 +1013,7 @@ API_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, int n) return res; } -API_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *a, ...) +APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *a, ...) { char *cp, *argp, *res; @@ -1138,7 +1138,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) #endif } -API_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) +APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) { #ifdef ALLOC_USE_MALLOC struct psprintf_data ps; @@ -1197,7 +1197,7 @@ API_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) #endif } -API_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) +APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) { va_list ap; char *res; @@ -1220,7 +1220,7 @@ API_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -API_EXPORT(void) ap_note_subprocess(ap_pool_t *a, ap_proc_t *pid, +APR_EXPORT(void) ap_note_subprocess(ap_pool_t *a, ap_proc_t *pid, enum kill_conditions how) { struct process_chain *new = diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 776d2e224b3..d7d788c7040 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -33,12 +33,12 @@ #include "misc.h" -API_VAR_EXPORT int +APR_EXPORT_VAR int ap_opterr = 1, /* if error message should be printed */ ap_optind = 1, /* index into parent argv vector */ ap_optopt, /* character checked for validity */ ap_optreset; /* reset getopt */ -API_VAR_EXPORT char *ap_optarg = ""; /* argument associated with option */ +APR_EXPORT_VAR char *ap_optarg = ""; /* argument associated with option */ #define EMSG "" diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 9c752656f8d..e3f7e51727d 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -67,7 +67,7 @@ static ap_other_child_rec_t *other_children = NULL; -API_EXPORT(void) ap_register_other_child(ap_proc_t *pid, +APR_EXPORT(void) ap_register_other_child(ap_proc_t *pid, void (*maintenance) (int reason, void *, int status), void *data, ap_file_t *write_fd, ap_pool_t *p) { @@ -87,7 +87,7 @@ API_EXPORT(void) ap_register_other_child(ap_proc_t *pid, other_children = ocr; } -API_EXPORT(void) ap_unregister_other_child(void *data) +APR_EXPORT(void) ap_unregister_other_child(void *data) { ap_other_child_rec_t **pocr, *nocr; @@ -152,7 +152,7 @@ void ap_probe_writable_fds(void) } } -API_EXPORT(ap_status_t) ap_reap_other_child(ap_proc_t *pid, int status) +APR_EXPORT(ap_status_t) ap_reap_other_child(ap_proc_t *pid, int status) { ap_other_child_rec_t *ocr, *nocr; @@ -168,7 +168,7 @@ API_EXPORT(ap_status_t) ap_reap_other_child(ap_proc_t *pid, int status) return APR_CHILD_NOTDONE; } -API_EXPORT(void) ap_check_other_child(void) +APR_EXPORT(void) ap_check_other_child(void) { ap_other_child_rec_t *ocr, *nocr; pid_t waitret; diff --git a/misc/win32/names.c b/misc/win32/names.c index d831842c929..c6979a1995c 100644 --- a/misc/win32/names.c +++ b/misc/win32/names.c @@ -82,7 +82,7 @@ static BOOL OnlyDots(char *pString) * is present on the existing path. This routine also * converts alias names to long names. */ -API_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, +APR_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, const char *szFile) { char buf[HUGE_STRING_LEN]; diff --git a/test/testthread.c b/test/testthread.c index f82f496ce69..eeba90c1b67 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -63,17 +63,17 @@ #endif -void * API_THREAD_FUNC thread_func1(void *data); -void * API_THREAD_FUNC thread_func2(void *data); -void * API_THREAD_FUNC thread_func3(void *data); -void * API_THREAD_FUNC thread_func4(void *data); +void * APR_THREAD_FUNC thread_func1(void *data); +void * APR_THREAD_FUNC thread_func2(void *data); +void * APR_THREAD_FUNC thread_func3(void *data); +void * APR_THREAD_FUNC thread_func4(void *data); ap_lock_t *thread_lock; ap_pool_t *context; int x = 0; -void * API_THREAD_FUNC thread_func1(void *data) +void * APR_THREAD_FUNC thread_func1(void *data) { int i; for (i = 0; i < 10000; i++) { @@ -84,7 +84,7 @@ void * API_THREAD_FUNC thread_func1(void *data) return NULL; } -void * API_THREAD_FUNC thread_func2(void *data) +void * APR_THREAD_FUNC thread_func2(void *data) { int i; for (i = 0; i < 10000; i++) { @@ -95,7 +95,7 @@ void * API_THREAD_FUNC thread_func2(void *data) return NULL; } -void * API_THREAD_FUNC thread_func3(void *data) +void * APR_THREAD_FUNC thread_func3(void *data) { int i; for (i = 0; i < 10000; i++) { @@ -106,7 +106,7 @@ void * API_THREAD_FUNC thread_func3(void *data) return NULL; } -void * API_THREAD_FUNC thread_func4(void *data) +void * APR_THREAD_FUNC thread_func4(void *data) { int i; for (i = 0; i < 10000; i++) { diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 79a132f90f1..fcebc75f789 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -111,7 +111,7 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, /* Use 0 for Thread Stack Size, because that will default the stack to the * same size as the calling thread. */ - if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, (unsigned int (API_THREAD_FUNC *)(void *))func, + if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, (unsigned int (APR_THREAD_FUNC *)(void *))func, data, 0, &temp)) == 0) { lasterror = GetLastError(); return APR_EEXIST; /* MSVC++ doc doesn't mention any additional error info */ diff --git a/time/unix/timestr.c b/time/unix/timestr.c index 889f4799734..24f0c7a6bf5 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -57,11 +57,11 @@ #include -API_VAR_EXPORT const char ap_month_snames[12][4] = +APR_EXPORT_VAR const char ap_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -API_VAR_EXPORT const char ap_day_snames[7][4] = +APR_EXPORT_VAR const char ap_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 099fc1448a4..4a4ca5ba9fc 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -55,11 +55,11 @@ #include "atime.h" #include "apr_portable.h" -API_VAR_EXPORT const char ap_month_snames[12][4] = +APR_EXPORT_VAR const char ap_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -API_VAR_EXPORT const char ap_day_snames[7][4] = +APR_EXPORT_VAR const char ap_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; From 148a534d17cd4e23bfcff3230f97760f1137a480 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 26 May 2000 16:24:10 +0000 Subject: [PATCH 0128/7878] Fix error handling for DSO opening. This probably doesn't fix all of the dso error handling, but it reports errors when opening with much more detail. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60102 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 4 ++++ misc/unix/errorcodes.c | 5 ++++- test/testdso.c | 7 +++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index c25986b85e3..69eff0bb705 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -71,7 +71,11 @@ ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, #endif if(os_handle == NULL) +#if defined(HPUX) || defined(HPUX10) || defined(HPUX11) + return errno; +#else return APR_EDSOOPEN; +#endif *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = (void*)os_handle; diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index e196a2ea8cd..8522d2b3a97 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -57,6 +57,9 @@ #ifdef HAVE_NETDB_H #include #endif +#ifdef HAVE_DLFCN_H +#include +#endif /* * stuffbuffer - like ap_cpystrn() but returns the address of the @@ -98,7 +101,7 @@ static char *apr_error_string(ap_status_t statcode) case APR_ENOSHMAVAIL: return "No shared memory is currently available"; case APR_EDSOOPEN: - return "Could not open the dso."; + return dlerror(); case APR_INCHILD: return "Your code just forked, and you are currently executing in the " diff --git a/test/testdso.c b/test/testdso.c index ecc6eeaa119..70e1a0a0c9f 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -12,6 +12,7 @@ int main (int argc, char ** argv) ap_dso_handle_t *h = NULL; ap_dso_handle_sym_t func1 = NULL; ap_dso_handle_sym_t func2 = NULL; + ap_status_t status; ap_pool_t *cont; void (*function)(void); void (*function1)(int); @@ -38,8 +39,10 @@ int main (int argc, char ** argv) fprintf(stdout,"OK\n"); fprintf(stdout,"Trying to load DSO now....................."); fflush(stdout); - if (ap_dso_load(&h, filename, cont) != APR_SUCCESS){ - fprintf(stderr, "Failed to load %s!\n", filename); + if ((status = ap_dso_load(&h, filename, cont)) != APR_SUCCESS){ + char my_error[256]; + ap_strerror(status, my_error, sizeof(my_error)); + fprintf(stderr, "%s!\n", my_error); exit (-1); } fprintf(stdout,"OK\n"); From 5c8f7ea3e97d956d7b38f6e7f2dfb0459c360d4b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 26 May 2000 18:54:00 +0000 Subject: [PATCH 0129/7878] PR: Obtained from: Submitted by: Reviewed by: Just a few functions missing linkage specs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60103 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 5 +++-- lib/apr_cpystrn.c | 2 +- misc/unix/getopt.c | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index e98d1e6dac1..e1ca5728847 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -87,8 +87,9 @@ B: Arguments 2 and 3 are most commonly argc and argv from =cut */ -ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, - ap_int32_t *rv, ap_pool_t *cont); +APR_EXPORT(ap_status_t) ap_getopt(ap_int32_t nargc, char *const *nargv, + const char *ostr, ap_int32_t *rv, + ap_pool_t *cont); #endif /* ! APR_GETOPT_H */ diff --git a/lib/apr_cpystrn.c b/lib/apr_cpystrn.c index 160e0b9e9d5..2245d53b9fd 100644 --- a/lib/apr_cpystrn.c +++ b/lib/apr_cpystrn.c @@ -210,7 +210,7 @@ APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, * Corrected Win32 to accept "a/b\\stuff", "a:stuff" */ -const char *ap_filename_of_pathname(const char *pathname) +APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname) { const char path_separator = '/'; const char *s = strrchr(pathname, path_separator); diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index d7d788c7040..7b47f439719 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -42,7 +42,9 @@ APR_EXPORT_VAR char *ap_optarg = ""; /* argument associated with option */ #define EMSG "" -ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap_int32_t *rv, ap_pool_t *cont) +APR_EXPORT(ap_status_t) ap_getopt(ap_int32_t nargc, char *const *nargv, + const char *ostr, ap_int32_t *rv, + ap_pool_t *cont) { char *p; static char *place = EMSG; /* option letter processing */ From 96f6d4da2f874d2e1096877d15d52b1966b7aeb1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 27 May 2000 07:01:20 +0000 Subject: [PATCH 0130/7878] PR: Obtained from: Submitted by: Reviewed by: Just fixing a reference to an non-existant function on Win32... for an equally non-existant error for the Win32 dso. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60104 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 8522d2b3a97..044c87d74ad 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -100,8 +100,10 @@ static char *apr_error_string(ap_status_t statcode) return "No thread key structure was provided and one was required."; case APR_ENOSHMAVAIL: return "No shared memory is currently available"; +#ifndef WIN32 case APR_EDSOOPEN: return dlerror(); +#endif case APR_INCHILD: return "Your code just forked, and you are currently executing in the " From d428acd43cd796948b1501228ef9a314bda2a65f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 27 May 2000 17:18:57 +0000 Subject: [PATCH 0131/7878] PR: Obtained from: Submitted by: Reviewed by: Just a few missing headers to add to the apr project. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60105 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 8 ++++++++ aprlib.dsp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/apr.dsp b/apr.dsp index 138a620dd24..39dfd947653 100644 --- a/apr.dsp +++ b/apr.dsp @@ -317,6 +317,10 @@ SOURCE=.\include\apr_time.h # End Source File # Begin Source File +SOURCE=.\include\apr_xlate.h +# End Source File +# Begin Source File + SOURCE=.\time\win32\atime.h # End Source File # Begin Source File @@ -333,6 +337,10 @@ SOURCE=.\locks\win32\locks.h # End Source File # Begin Source File +SOURCE=.\misc\unix\misc.h +# End Source File +# Begin Source File + SOURCE=.\network_io\win32\networkio.h # End Source File # Begin Source File diff --git a/aprlib.dsp b/aprlib.dsp index 138a620dd24..39dfd947653 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -317,6 +317,10 @@ SOURCE=.\include\apr_time.h # End Source File # Begin Source File +SOURCE=.\include\apr_xlate.h +# End Source File +# Begin Source File + SOURCE=.\time\win32\atime.h # End Source File # Begin Source File @@ -333,6 +337,10 @@ SOURCE=.\locks\win32\locks.h # End Source File # Begin Source File +SOURCE=.\misc\unix\misc.h +# End Source File +# Begin Source File + SOURCE=.\network_io\win32\networkio.h # End Source File # Begin Source File From 8df99b997f258fc709e81a2637f559275013b03b Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 27 May 2000 17:52:01 +0000 Subject: [PATCH 0132/7878] OS/2: Fix ap_write() to use the handle's mutex lock instead of critical sections & report write errors correctly in buffered mode. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60106 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 5fb3f72a39c..dd44cece856 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -153,7 +153,7 @@ ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) int blocksize; int size = *nbytes; - DosEnterCritSec(); + ap_lock(thefile->mutex); if ( thefile->direction == 0 ) { // Position file pointer for writing at the offset we are logically reading from @@ -166,7 +166,7 @@ ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) while (rc == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full - ap_flush(thefile); + rc = ap_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); @@ -175,7 +175,7 @@ ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) size -= blocksize; } - DosExitCritSec(); + ap_unlock(thefile->mutex); return APR_OS2_STATUS(rc); } else { rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten); From dcc2c2483b8e868970c564f325fbad91a1a5c1e7 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 27 May 2000 18:01:00 +0000 Subject: [PATCH 0133/7878] OS/2: Add an implementation of ap_file_check_read(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60107 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index dd44cece856..fb0c5d2e686 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -345,3 +345,18 @@ APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) } + +ap_status_t ap_file_check_read(ap_file_t *fd) +{ + int rc; + + if (!fd->pipe) + return APR_SUCCESS; /* Not a pipe, assume no waiting */ + + rc = DosWaitEventSem(fd->pipeSem, SEM_IMMEDIATE_RETURN); + + if (rc == ERROR_TIMEOUT) + return APR_TIMEUP; + + return APR_OS2_STATUS(rc); +} From 728d192fb61a29635cffc71d066800e005ad97ee Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 27 May 2000 21:40:18 +0000 Subject: [PATCH 0134/7878] Fix the dso error handling. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60108 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 11 +++++++++++ include/apr_dso.h | 2 ++ misc/unix/errorcodes.c | 5 ++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 69eff0bb705..390566b0e4d 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -133,3 +133,14 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, return APR_SUCCESS; } + +char *ap_dso_error(void) +{ +#if defined(HPUX) || defined(HPUX10) || defined(HPUX11) + return strerror(errno); +#elif defined(HAVE_DYLD) + return NULL; +#else + return dlerror(); +#endif +} diff --git a/include/apr_dso.h b/include/apr_dso.h index 01f71c34ca1..f8070e55dd5 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -120,4 +120,6 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, } #endif + +char *ap_dso_error(void); #endif diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 044c87d74ad..f1f2d8acbe2 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -53,6 +53,7 @@ */ #include "misc.h" +#include "apr_dso.h" #ifdef HAVE_NETDB_H #include @@ -100,10 +101,8 @@ static char *apr_error_string(ap_status_t statcode) return "No thread key structure was provided and one was required."; case APR_ENOSHMAVAIL: return "No shared memory is currently available"; -#ifndef WIN32 case APR_EDSOOPEN: - return dlerror(); -#endif + return ap_dso_error(); case APR_INCHILD: return "Your code just forked, and you are currently executing in the " From b7cce6456b3c73a8649740af26c45210391ea8e2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 27 May 2000 22:30:12 +0000 Subject: [PATCH 0135/7878] PR: Obtained from: Submitted by: Reviewed by: Reverse out APR_EXPORT_VAR to APR_VAR_EXPORT from early this week, to maintain consistency with the Apache core project. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60109 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 6 +++--- misc/unix/getopt.c | 4 ++-- time/unix/timestr.c | 4 ++-- time/win32/timestr.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index ad9cc3e85e9..edb853b9565 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -168,18 +168,18 @@ typedef int gid_t; #if defined(APR_EXPORT_SYMBOLS) #define APR_EXPORT(type) __declspec(dllexport) type #define APR_EXPORT_NONSTD(type) __declspec(dllexport) type -#define APR_EXPORT_VAR __declspec(dllexport) +#define APR_VAR_EXPORT __declspec(dllexport) #define APR_IMPORT_VAR extern __declspec(dllexport) #elif defined(APR_STATIC) #define APR_EXPORT(type) type #define APR_EXPORT_NONSTD(type) type -#define APR_EXPORT_VAR +#define APR_VAR_EXPORT #define APR_IMPORT_VAR extern #else /* Default behavior is to import the shared .dll */ #define APR_EXPORT(type) __declspec(dllimport) type #define APR_EXPORT_NONSTD(type) __declspec(dllimport) type -#define APR_EXPORT_VAR __declspec(dllimport) +#define APR_VAR_EXPORT __declspec(dllimport) #define APR_IMPORT_VAR extern __declspec(dllimport) #endif diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 7b47f439719..3bd36c73f9f 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -33,12 +33,12 @@ #include "misc.h" -APR_EXPORT_VAR int +APR_VAR_EXPORT int ap_opterr = 1, /* if error message should be printed */ ap_optind = 1, /* index into parent argv vector */ ap_optopt, /* character checked for validity */ ap_optreset; /* reset getopt */ -APR_EXPORT_VAR char *ap_optarg = ""; /* argument associated with option */ +APR_VAR_EXPORT char *ap_optarg = ""; /* argument associated with option */ #define EMSG "" diff --git a/time/unix/timestr.c b/time/unix/timestr.c index 24f0c7a6bf5..aa65f534fc4 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -57,11 +57,11 @@ #include -APR_EXPORT_VAR const char ap_month_snames[12][4] = +APR_VAR_EXPORT const char ap_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -APR_EXPORT_VAR const char ap_day_snames[7][4] = +APR_VAR_EXPORT const char ap_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 4a4ca5ba9fc..1c118b07eb9 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -55,11 +55,11 @@ #include "atime.h" #include "apr_portable.h" -APR_EXPORT_VAR const char ap_month_snames[12][4] = +APR_VAR_EXPORT const char ap_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -APR_EXPORT_VAR const char ap_day_snames[7][4] = +APR_VAR_EXPORT const char ap_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; From 9e5a3733bc7589faad54efa2ae3b3b6be3f72e2c Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 27 May 2000 23:05:11 +0000 Subject: [PATCH 0136/7878] Fixup a couple of rename's missed APR_VAR_EXPORT->APR_EXPORT_VAR git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60110 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getopt.c | 4 ++-- time/unix/timestr.c | 4 ++-- time/win32/timestr.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 3bd36c73f9f..7b47f439719 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -33,12 +33,12 @@ #include "misc.h" -APR_VAR_EXPORT int +APR_EXPORT_VAR int ap_opterr = 1, /* if error message should be printed */ ap_optind = 1, /* index into parent argv vector */ ap_optopt, /* character checked for validity */ ap_optreset; /* reset getopt */ -APR_VAR_EXPORT char *ap_optarg = ""; /* argument associated with option */ +APR_EXPORT_VAR char *ap_optarg = ""; /* argument associated with option */ #define EMSG "" diff --git a/time/unix/timestr.c b/time/unix/timestr.c index aa65f534fc4..24f0c7a6bf5 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -57,11 +57,11 @@ #include -APR_VAR_EXPORT const char ap_month_snames[12][4] = +APR_EXPORT_VAR const char ap_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -APR_VAR_EXPORT const char ap_day_snames[7][4] = +APR_EXPORT_VAR const char ap_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 1c118b07eb9..4a4ca5ba9fc 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -55,11 +55,11 @@ #include "atime.h" #include "apr_portable.h" -APR_VAR_EXPORT const char ap_month_snames[12][4] = +APR_EXPORT_VAR const char ap_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -APR_VAR_EXPORT const char ap_day_snames[7][4] = +APR_EXPORT_VAR const char ap_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; From ffc5b95cba8fef2de8a9f4f3269788739cba45e8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 28 May 2000 02:47:10 +0000 Subject: [PATCH 0137/7878] PR: Obtained from: Submitted by: Reviewed by: Fix the last of the tags APR_EXPORT_VAR and APR_IMPORT_VAR to the accepted APR_VAR_EXPORT and APR_VAR_IMPORT. This patch finally includes the apr.h.in file (newly added to my grepper). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60111 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 4 ++-- include/apr.hw | 19 ++++++++++--------- include/apr_getopt.h | 4 ++-- include/apr_time.h | 4 ++-- misc/unix/getopt.c | 4 ++-- time/unix/timestr.c | 4 ++-- time/win32/timestr.c | 4 ++-- 7 files changed, 22 insertions(+), 21 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 98a9f6b420e..e3c6dde3dc1 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -96,8 +96,8 @@ typedef @off_t_value@ ap_off_t; #define APR_THREAD_FUNC #define APR_EXPORT(type) type #define APR_EXPORT_NONSTD(type) type -#define APR_IMPORT_VAR extern -#define APR_EXPORT_VAR +#define APR_VAR_IMPORT extern +#define APR_VAR_EXPORT /* Define APR_SSIZE_T_FMT. * If ssize_t is an integer we define it to be "d", diff --git a/include/apr.hw b/include/apr.hw index edb853b9565..828894cb46e 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -165,22 +165,23 @@ typedef int gid_t; #define APR_SSIZE_T_FMT "d" #define APR_THREAD_FUNC __stdcall -#if defined(APR_EXPORT_SYMBOLS) -#define APR_EXPORT(type) __declspec(dllexport) type -#define APR_EXPORT_NONSTD(type) __declspec(dllexport) type -#define APR_VAR_EXPORT __declspec(dllexport) -#define APR_IMPORT_VAR extern __declspec(dllexport) -#elif defined(APR_STATIC) +#if !defined(WIN32) || defined(APR_STATIC) +/* Default Non-WIN32 behavior removes all MSVCisms */ #define APR_EXPORT(type) type #define APR_EXPORT_NONSTD(type) type #define APR_VAR_EXPORT -#define APR_IMPORT_VAR extern +#define APR_VAR_IMPORT extern +#elif defined(APR_EXPORT_SYMBOLS) +#define APR_EXPORT(type) __declspec(dllexport) type +#define APR_EXPORT_NONSTD(type) __declspec(dllexport) type +#define APR_VAR_EXPORT __declspec(dllexport) +#define APR_VAR_IMPORT extern __declspec(dllexport) #else -/* Default behavior is to import the shared .dll */ +/* Default WIN32 behavior is to import the shared .dll */ #define APR_EXPORT(type) __declspec(dllimport) type #define APR_EXPORT_NONSTD(type) __declspec(dllimport) type #define APR_VAR_EXPORT __declspec(dllimport) -#define APR_IMPORT_VAR extern __declspec(dllimport) +#define APR_VAR_IMPORT extern __declspec(dllimport) #endif #define ap_signal(a,b) signal(a,b) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index e1ca5728847..617f469c535 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -55,12 +55,12 @@ #ifndef APR_GETOPT_H #define APR_GETOPT_H -APR_IMPORT_VAR int +APR_VAR_IMPORT int ap_opterr, /* if error message should be printed */ ap_optind, /* index into parent argv vector */ ap_optopt, /* character checked for validity */ ap_optreset; /* reset getopt */ -APR_IMPORT_VAR char * +APR_VAR_IMPORT char * ap_optarg; /* argument associated with option */ /* diff --git a/include/apr_time.h b/include/apr_time.h index c423c068bdb..02e12e0ce6f 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -62,8 +62,8 @@ extern "C" { #endif /* __cplusplus */ -APR_IMPORT_VAR const char ap_month_snames[12][4]; -APR_IMPORT_VAR const char ap_day_snames[7][4]; +APR_VAR_IMPORT const char ap_month_snames[12][4]; +APR_VAR_IMPORT const char ap_day_snames[7][4]; /* number of microseconds since 00:00:00 january 1, 1970 UTC */ typedef ap_int64_t ap_time_t; diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 7b47f439719..3bd36c73f9f 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -33,12 +33,12 @@ #include "misc.h" -APR_EXPORT_VAR int +APR_VAR_EXPORT int ap_opterr = 1, /* if error message should be printed */ ap_optind = 1, /* index into parent argv vector */ ap_optopt, /* character checked for validity */ ap_optreset; /* reset getopt */ -APR_EXPORT_VAR char *ap_optarg = ""; /* argument associated with option */ +APR_VAR_EXPORT char *ap_optarg = ""; /* argument associated with option */ #define EMSG "" diff --git a/time/unix/timestr.c b/time/unix/timestr.c index 24f0c7a6bf5..aa65f534fc4 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -57,11 +57,11 @@ #include -APR_EXPORT_VAR const char ap_month_snames[12][4] = +APR_VAR_EXPORT const char ap_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -APR_EXPORT_VAR const char ap_day_snames[7][4] = +APR_VAR_EXPORT const char ap_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 4a4ca5ba9fc..1c118b07eb9 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -55,11 +55,11 @@ #include "atime.h" #include "apr_portable.h" -APR_EXPORT_VAR const char ap_month_snames[12][4] = +APR_VAR_EXPORT const char ap_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -APR_EXPORT_VAR const char ap_day_snames[7][4] = +APR_VAR_EXPORT const char ap_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; From 2a6a5ce958a62d25c05f32d60fb8b1e9e9065198 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 28 May 2000 03:02:43 +0000 Subject: [PATCH 0138/7878] PR: Obtained from: Submitted by: Reviewed by: Close this symbol error on Win32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60112 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index b8dde20e4a3..a741276b35b 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -93,3 +93,8 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, return APR_SUCCESS; } + +char *ap_dso_error(void) +{ + return "An error occured loading a DLL."; +} From 949077cb7ea650a7612aa5fb19ddfa1f26786224 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 28 May 2000 03:59:24 +0000 Subject: [PATCH 0139/7878] PR: Obtained from: Submitted by: Reviewed by: Namespace protect ap_dso_error() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60113 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_dso.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/apr_dso.h b/include/apr_dso.h index f8070e55dd5..a3c3ed6a306 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -116,10 +116,11 @@ B */ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, const char *symname); + +char *ap_dso_error(void); + #ifdef __cplusplus } #endif - -char *ap_dso_error(void); #endif From b3784749b31760195463a79195764ee09bbeff21 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 28 May 2000 14:03:08 +0000 Subject: [PATCH 0140/7878] OS/2: provide a stub ap_dso_error(). It will never be called because ap_dso_load() never returns APR_EDSOOPEN git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60114 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os2/dso.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dso/os2/dso.c b/dso/os2/dso.c index 25043c130d5..90f4069ce9d 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -126,3 +126,11 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, *ressym = func; return APR_SUCCESS; } + + + +/* Just a stub, it will never be called because we never return APR_EDSOOPEN */ +char *ap_dso_error() +{ + return NULL; +} From c0cd1c031325dc289d5760a69e6a6315913cc495 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 28 May 2000 14:06:24 +0000 Subject: [PATCH 0141/7878] Ignore a generated Makefile. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60115 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os2/.cvsignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 dso/os2/.cvsignore diff --git a/dso/os2/.cvsignore b/dso/os2/.cvsignore new file mode 100644 index 00000000000..f3c7a7c5da6 --- /dev/null +++ b/dso/os2/.cvsignore @@ -0,0 +1 @@ +Makefile From 23557f7815ddaa9131f45037f78e984c9a7bea2e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 29 May 2000 02:18:44 +0000 Subject: [PATCH 0142/7878] Update the ap_dso_error API to work with other platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60116 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os2/dso.c | 2 +- dso/unix/dso.c | 2 +- dso/win32/dso.c | 2 +- include/apr_dso.h | 2 +- misc/unix/errorcodes.c | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dso/os2/dso.c b/dso/os2/dso.c index 90f4069ce9d..e9129fe13b9 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -130,7 +130,7 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, /* Just a stub, it will never be called because we never return APR_EDSOOPEN */ -char *ap_dso_error() +char *ap_dso_error(char *buf, int bufsize, ap_status_t errcode) { return NULL; } diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 390566b0e4d..4357edb3787 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -134,7 +134,7 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, return APR_SUCCESS; } -char *ap_dso_error(void) +char *ap_dso_error(char *buf, int bufsize, ap_status_t errcode) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) return strerror(errno); diff --git a/dso/win32/dso.c b/dso/win32/dso.c index a741276b35b..8e64a56d72e 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -94,7 +94,7 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, return APR_SUCCESS; } -char *ap_dso_error(void) +char *ap_dso_error(char *buf, int bufsize, ap_status_t errcode) { return "An error occured loading a DLL."; } diff --git a/include/apr_dso.h b/include/apr_dso.h index a3c3ed6a306..052798b4e38 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -117,7 +117,7 @@ B ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, const char *symname); -char *ap_dso_error(void); +char *ap_dso_error(char *buf, int bufsize, ap_status_t errcode); #ifdef __cplusplus } diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index f1f2d8acbe2..ce6d7eeb689 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -74,6 +74,7 @@ static char *stuffbuffer(char *buf, ap_size_t bufsize, const char *s) static char *apr_error_string(ap_status_t statcode) { + char buf[256]; switch (statcode) { case APR_ENOPOOL: return "A new pool could not be created."; @@ -102,7 +103,7 @@ static char *apr_error_string(ap_status_t statcode) case APR_ENOSHMAVAIL: return "No shared memory is currently available"; case APR_EDSOOPEN: - return ap_dso_error(); + return ap_dso_error(buf, sizeof(buf), APR_EDSOOPEN); case APR_INCHILD: return "Your code just forked, and you are currently executing in the " From 85271948b003c63f5c675bc6cab13103a84a9e4e Mon Sep 17 00:00:00 2001 From: Ronald Tschalar Date: Mon, 29 May 2000 09:02:52 +0000 Subject: [PATCH 0143/7878] The name is supposed to be set to NULL when anonymous shared mem is used. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60117 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/os2/shmem.c | 1 + shmem/unix/shmem.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/shmem/os2/shmem.c b/shmem/os2/shmem.c index 364f1941501..87536e546c9 100644 --- a/shmem/os2/shmem.c +++ b/shmem/os2/shmem.c @@ -124,6 +124,7 @@ ap_status_t ap_shm_free(struct shmem_t *m, void *entity) ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name) { + *name = NULL; return APR_ANONYMOUS; } diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index c728f550142..726a171fe68 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -103,7 +103,7 @@ ap_status_t ap_shm_free(struct shmem_t *shared, void *entity) ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name) { #if APR_USES_ANONYMOUS_SHM - name = NULL; + *name = NULL; return APR_ANONYMOUS; /* Currently, we are not supporting name based shared memory on Unix * systems. This may change in the future however, so I will leave From aa13de98633d3ebe7d2b0f389dfb7084c6e138c0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 30 May 2000 02:34:59 +0000 Subject: [PATCH 0144/7878] Fix a small typo in a comment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60118 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index cd59dfa7995..c93efa22c79 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -128,7 +128,7 @@ int ap_canonical_error(ap_status_t err); #define APR_FILEBASED (APR_OS_START_STATUS + 20) #define APR_KEYBASED (APR_OS_START_STATUS + 21) -/* A simple value to be used to initialze a status variable. */ +/* A simple value to be used to initialize a status variable. */ #define APR_EINIT (APR_OS_START_STATUS + 22) /* Not implemented either because we haven't gotten to it yet, or From 533d63b679e690c296d50d9b263203b9f674bfac Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 30 May 2000 18:43:06 +0000 Subject: [PATCH 0145/7878] Put the BeOS network code back into APR. According the David Reid, without this code the newer releases of BeOS don't work. I would still like to see this code combined with the Unix code, but I get the feeling that this code is going to morph as the native BeOS networking API becomes more mature. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60119 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/networkio.h | 117 +++++++++++++++++ network_io/beos/Makefile.in | 96 ++++++++++++++ network_io/beos/inet_aton.c | 177 +++++++++++++++++++++++++ network_io/beos/networkio.h | 117 +++++++++++++++++ network_io/beos/poll.c | 224 ++++++++++++++++++++++++++++++++ network_io/beos/sendrecv.c | 150 +++++++++++++++++++++ network_io/beos/sockaddr.c | 183 ++++++++++++++++++++++++++ network_io/beos/sockets.c | 238 ++++++++++++++++++++++++++++++++++ network_io/beos/sockopt.c | 117 +++++++++++++++++ 9 files changed, 1419 insertions(+) create mode 100644 include/arch/beos/networkio.h create mode 100644 network_io/beos/Makefile.in create mode 100644 network_io/beos/inet_aton.c create mode 100644 network_io/beos/networkio.h create mode 100644 network_io/beos/poll.c create mode 100644 network_io/beos/sendrecv.c create mode 100644 network_io/beos/sockaddr.c create mode 100644 network_io/beos/sockets.c create mode 100644 network_io/beos/sockopt.c diff --git a/include/arch/beos/networkio.h b/include/arch/beos/networkio.h new file mode 100644 index 00000000000..b37797cb7d2 --- /dev/null +++ b/include/arch/beos/networkio.h @@ -0,0 +1,117 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifdef HAVE_NETINET_TCP_H +#include "../unix/network_io.h" +#else + +#ifndef NETWORK_IO_H +#define NETWORK_IO_H + + +#include +#include +#include +#include +#include +#include +#include "apr_network_io.h" +#include "apr_general.h" +#include "apr_portable.h" +#include "apr_lib.h" +#include "fileio.h" +#include "apr_errno.h" + +/* The definition of isascii was missed from the PowerPC ctype.h + * + * It will be included in the next release, but until then... */ +#if __POWERPC__ +#define isascii(c) (((c) & ~0x7f)==0) +#endif + +#include "apr_general.h" +#include /* for the ntohs definition */ + +#define POLLIN 1 +#define POLLPRI 2 +#define POLLOUT 4 +#define POLLERR 8 +#define POLLHUP 16 +#define POLLNVAL 32 + +struct ap_socket_t { + ap_pool_t *cntxt; + int socketdes; + struct sockaddr_in *local_addr; + struct sockaddr_in *remote_addr; + int addr_len; + ap_interval_time_t timeout; + int connected; +}; + +struct ap_pollfd_t { + ap_pool_t *cntxt; + struct ap_socket_t *sock; + fd_set *read; + fd_set *write; + fd_set *except; + int highsock; +}; + +ap_int16_t get_event(ap_int16_t); + +int inet_aton(const char *cp, struct in_addr *addr); + +#endif /* ! NETWORK_IO_H */ +#endif diff --git a/network_io/beos/Makefile.in b/network_io/beos/Makefile.in new file mode 100644 index 00000000000..68a440a654a --- /dev/null +++ b/network_io/beos/Makefile.in @@ -0,0 +1,96 @@ +#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) +#LIBS=$(EXTRA_LIBS) $(LIBS1) +#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) +#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) + +CC=@CC@ +RANLIB=@RANLIB@ +CFLAGS=@CFLAGS@ @OPTIM@ +LIBS=@LIBS@ +LDFLAGS=@LDFLAGS@ $(LIBS) +INCDIR=../../include -I../../file_io/unix +INCLUDES=-I$(INCDIR) -I. + +LIB=libnetwork.a + +OBJS=poll.o \ + sendrecv.o \ + sockets.o \ + sockopt.o \ + inet_aton.o \ + sockaddr.o + +.c.o: + $(CC) $(CFLAGS) -c $(INCLUDES) $< + +all: $(LIB) + +clean: + $(RM) -f *.o *.a *.so + +distclean: clean + -$(RM) -f Makefile + + +$(LIB): $(OBJS) + $(RM) -f $@ + $(AR) cr $@ $(OBJS) + $(RANLIB) $@ + +# +# We really don't expect end users to use this rule. It works only with +# gcc, and rebuilds Makefile.in. You have to re-run configure after +# using it. +# +depend: + cp Makefile.in Makefile.in.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ + && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ + && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ + -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + > Makefile.in \ + && rm Makefile.new + +# DO NOT REMOVE +inet_aton.o: inet_aton.c networkio.h ../../include/apr_network_io.h \ + ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_errno.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_portable.h \ + ../../include/apr_thread_proc.h ../../include/apr_lock.h \ + ../../include/apr_lib.h ../../file_io/unix/fileio.h \ + ../../include/apr_private.h +poll.o: poll.c networkio.h ../../include/apr_network_io.h \ + ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_errno.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_portable.h \ + ../../include/apr_thread_proc.h ../../include/apr_lock.h \ + ../../include/apr_lib.h ../../file_io/unix/fileio.h \ + ../../include/apr_private.h +sendrecv.o: sendrecv.c networkio.h ../../include/apr_network_io.h \ + ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_errno.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_portable.h \ + ../../include/apr_thread_proc.h ../../include/apr_lock.h \ + ../../include/apr_lib.h ../../file_io/unix/fileio.h \ + ../../include/apr_private.h +sockaddr.o: sockaddr.c networkio.h ../../include/apr_network_io.h \ + ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_errno.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_portable.h \ + ../../include/apr_thread_proc.h ../../include/apr_lock.h \ + ../../include/apr_lib.h ../../file_io/unix/fileio.h \ + ../../include/apr_private.h +sockets.o: sockets.c networkio.h ../../include/apr_network_io.h \ + ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_errno.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_portable.h \ + ../../include/apr_thread_proc.h ../../include/apr_lock.h \ + ../../include/apr_lib.h ../../file_io/unix/fileio.h \ + ../../include/apr_private.h +sockopt.o: sockopt.c networkio.h ../../include/apr_network_io.h \ + ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_errno.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_portable.h \ + ../../include/apr_thread_proc.h ../../include/apr_lock.h \ + ../../include/apr_lib.h ../../file_io/unix/fileio.h \ + ../../include/apr_private.h diff --git a/network_io/beos/inet_aton.c b/network_io/beos/inet_aton.c new file mode 100644 index 00000000000..1489487d8dc --- /dev/null +++ b/network_io/beos/inet_aton.c @@ -0,0 +1,177 @@ +/* + * Copyright (c) 1983, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Portions Copyright (c) 1993 by Digital Equipment Corporation. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies, and that + * the name of Digital Equipment Corporation not be used in advertising or + * publicity pertaining to distribution of the document or software without + * specific, written prior permission. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT + * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +/* + * Portions Copyright (c) 1996-1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#include "apr_private.h" +#ifndef HAVE_NETINET_TCP_H + +#include "networkio.h" + +/* BeOS doesn't yet have it's own inet_aton and Bind won't be ported + * until R5, so this is from a Bind 8 distribution. It's currently untested. + */ + +int inet_aton(const char *cp, struct in_addr *addr) { + u_long val; + int base, n; + char c; + short parts[4]; + short *pp = parts; + int digit; + + c = *cp; + for (;;) { + /* + * Collect number up to ``.''. + * Values are specified as for C: + * 0x=hex, 0=octal, isdigit=decimal. + */ + if (!isdigit(c)) + return (0); + val = 0; base = 10; digit = 0; + if (c == '0') { + c = *++cp; + if (c == 'x' || c == 'X') + base = 16, c = *++cp; + else { + base = 8; + digit = 1 ; + } + } + for (;;) { + if (isascii(c) && isdigit(c)) { + if (base == 8 && (c == '8' || c == '9')) + return (0); + val = (val * base) + (c - '0'); + c = *++cp; + digit = 1; + } else if (base == 16 && isascii(c) && isxdigit(c)) { + val = (val << 4) | + (c + 10 - (islower(c) ? 'a' : 'A')); + c = *++cp; + digit = 1; + } else + break; + } + if (c == '.') { + /* + * Internet format: + * a.b.c.d + * a.b.c (with c treated as 16 bits) + * a.b (with b treated as 24 bits) + */ + if (pp >= parts + 3 || val > 0xff) + return (0); + *pp++ = val; + c = *++cp; + } else + break; + } + /* + * Check for trailing characters. + */ + if (c != '\0' && (!isascii(c) || !isspace(c))) + return (0); + /* + * Did we get a valid digit? + */ + if (!digit) + return (0); + /* + * Concoct the address according to + * the number of parts specified. + */ + n = pp - parts + 1; + switch (n) { + case 1: /* a -- 32 bits */ + break; + + case 2: /* a.b -- 8.24 bits */ + if (val > 0xffffff) + return (0); + val |= parts[0] << 24; + break; + + case 3: /* a.b.c -- 8.8.16 bits */ + if (val > 0xffff) + return (0); + val |= (parts[0] << 24) | (parts[1] << 16); + break; + + case 4: /* a.b.c.d -- 8.8.8.8 bits */ + if (val > 0xff) + return (0); + val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); + break; + } + if (addr != NULL) + addr->s_addr = htonl(val); + return (1); +} +#endif diff --git a/network_io/beos/networkio.h b/network_io/beos/networkio.h new file mode 100644 index 00000000000..b37797cb7d2 --- /dev/null +++ b/network_io/beos/networkio.h @@ -0,0 +1,117 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifdef HAVE_NETINET_TCP_H +#include "../unix/network_io.h" +#else + +#ifndef NETWORK_IO_H +#define NETWORK_IO_H + + +#include +#include +#include +#include +#include +#include +#include "apr_network_io.h" +#include "apr_general.h" +#include "apr_portable.h" +#include "apr_lib.h" +#include "fileio.h" +#include "apr_errno.h" + +/* The definition of isascii was missed from the PowerPC ctype.h + * + * It will be included in the next release, but until then... */ +#if __POWERPC__ +#define isascii(c) (((c) & ~0x7f)==0) +#endif + +#include "apr_general.h" +#include /* for the ntohs definition */ + +#define POLLIN 1 +#define POLLPRI 2 +#define POLLOUT 4 +#define POLLERR 8 +#define POLLHUP 16 +#define POLLNVAL 32 + +struct ap_socket_t { + ap_pool_t *cntxt; + int socketdes; + struct sockaddr_in *local_addr; + struct sockaddr_in *remote_addr; + int addr_len; + ap_interval_time_t timeout; + int connected; +}; + +struct ap_pollfd_t { + ap_pool_t *cntxt; + struct ap_socket_t *sock; + fd_set *read; + fd_set *write; + fd_set *except; + int highsock; +}; + +ap_int16_t get_event(ap_int16_t); + +int inet_aton(const char *cp, struct in_addr *addr); + +#endif /* ! NETWORK_IO_H */ +#endif diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c new file mode 100644 index 00000000000..86b0a009478 --- /dev/null +++ b/network_io/beos/poll.c @@ -0,0 +1,224 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_private.h" +#ifdef HAVE_NETINET_TCP_H +#include "../unix/poll.c" +#else +#include "networkio.h" + +/* BeOS R4 doesn't have a poll function, but R5 will have */ +/* so for the time being we try our best with an implementaion that */ +/* uses select. However, select on beos isn't that hot either, so */ +/* until R5 we have to live with a less than perfect implementation */ + +/* Apparently those sneaky people at Be included support for write in */ +/* select for R4.5 of BeOS. So here we use code that uses the write */ +/* bits. */ + +ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) +{ + (*new) = (ap_pollfd_t *)ap_palloc(cont, sizeof(ap_pollfd_t) * num); + if ((*new) == NULL) { + return APR_ENOMEM; + } + (*new)->cntxt = cont; + (*new)->read = (fd_set *)ap_palloc(cont, sizeof(fd_set)); + (*new)->write = (fd_set *)ap_palloc(cont, sizeof(fd_set)); + (*new)->except = (fd_set *)ap_palloc(cont, sizeof(fd_set)); + FD_ZERO((*new)->read); + FD_ZERO((*new)->write); + FD_ZERO((*new)->except); + (*new)->highsock = -1; + return APR_SUCCESS; +} + +ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, + ap_socket_t *sock, ap_int16_t event) +{ + if (event & APR_POLLIN) { + FD_SET(sock->socketdes, aprset->read); + } + if (event & APR_POLLPRI) { + FD_SET(sock->socketdes, aprset->read); + } + if (event & APR_POLLOUT) { + FD_SET(sock->socketdes, aprset->write); + } + if (sock->socketdes > aprset->highsock) { + aprset->highsock = sock->socketdes; + } + return APR_SUCCESS; +} + +ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, + ap_interval_time_t timeout) +{ + int rv; + struct timeval tv, *tvptr; + + if (timeout < 0) { + tvptr = NULL; + } + else { + tv.tv_sec = timeout / AP_USEC_PER_SEC; + tv.tv_usec = timeout % AP_USEC_PER_SEC; + tvptr = &tv; + } + + rv = select(aprset->highsock + 1, aprset->read, aprset->write, + NULL, tvptr); + + (*nsds) = rv; + if ((*nsds) == 0) { + return APR_TIMEUP; + } + if ((*nsds) < 0) { + return APR_EEXIST; + } + return APR_SUCCESS; +} + +ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) +{ + ap_int16_t revents = 0; + char data[256]; + int dummy = 256; + + if (FD_ISSET(sock->socketdes, aprset->read)) { + revents |= APR_POLLIN; + if (recv(sock->socketdes, &data, 0, 0) == -1) { + switch (errno) { + case ECONNRESET: + case ECONNABORTED: + case ESHUTDOWN: + case ENETRESET: { + revents ^= APR_POLLIN; + revents |= APR_POLLHUP; + break; + } + case ENOTSOCK: { + revents ^= APR_POLLIN; + revents |= APR_POLLNVAL; + } + default: { + revents ^= APR_POLLIN; + revents |= APR_POLLERR; + } + } + } + } + if (FD_ISSET(sock->socketdes, aprset->write)) { + revents |= APR_POLLOUT; + } + + /* Still no support for execpt bits in BeOS R4.5 so for the time being */ + /* we can't check this. Hopefully the error checking above will allow */ + /* sufficient errors to be recognised to cover this. */ + + /*if (FD_ISSET(sock->socketdes, aprset->except)) { + revents |= APR_POLLPRI; + }*/ + + (*event) = revents; + return APR_SUCCESS; +} + +ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) +{ + FD_CLR(sock->socketdes, aprset->read); + FD_CLR(sock->socketdes, aprset->read); + FD_CLR(sock->socketdes, aprset->write); + return APR_SUCCESS; +} + +ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) +{ + if (event & APR_POLLIN) { + FD_ZERO(aprset->read); + } + if (event & APR_POLLPRI) { + FD_ZERO(aprset->read); + } + if (event & APR_POLLOUT) { + FD_ZERO(aprset->write); + } + aprset->highsock = 0; + return APR_SUCCESS; +} + +ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data) +{ + if (pollfd != NULL) { + return ap_get_userdata(data, key, pollfd->cntxt); + } + else { + data = NULL; + return APR_ENOFILE; + } +} + +ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key, + ap_status_t (*cleanup) (void *)) +{ + if (pollfd != NULL) { + return ap_set_userdata(data, key, cleanup, pollfd->cntxt); + } + else { + data = NULL; + return APR_ENOFILE; + } +} +#endif + diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c new file mode 100644 index 00000000000..8d52f8d988a --- /dev/null +++ b/network_io/beos/sendrecv.c @@ -0,0 +1,150 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_private.h" +#ifdef HAVE_NETINET_TCP_H +#include "../unix/sendrecv.c" +#else +#include "networkio.h" + +static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) +{ + struct timeval tv, *tvptr; + fd_set fdset; + int srv; + + do { + FD_ZERO(&fdset); + FD_SET(sock->socketdes, &fdset); + if (sock->timeout < 0) { + tvptr = NULL; + } + else { + tv.tv_sec = sock->timeout / AP_USEC_PER_SEC; + tv.tv_usec = sock->timeout % AP_USEC_PER_SEC; + tvptr = &tv; + } + srv = select(sock->socketdes + 1, + for_read ? &fdset : NULL, + for_read ? NULL : &fdset, + NULL, + tvptr); + /* TODO - timeout should be smaller on repeats of this loop */ + } while (srv == -1 && errno == EINTR); + + if (srv == 0) { + return APR_TIMEUP; + } + else if (srv < 0) { + return errno; + } + return APR_SUCCESS; +} + +ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) +{ + ssize_t rv; + + do { + rv = send(sock->socketdes, buf, (*len), 0); + } while (rv == -1 && errno == EINTR); + + if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { + ap_status_t arv = wait_for_io_or_timeout(sock, 0); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } + else { + do { + rv = send(sock->socketdes, buf, (*len), 0); + } while (rv == -1 && errno == EINTR); + } + } + if (rv == -1) { + *len = 0; + return errno; + } + (*len) = rv; + return APR_SUCCESS; +} + +ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) +{ + ap_ssize_t rv; + + do { + rv = recv(sock->socketdes, buf, (*len), 0); + } while (rv == -1 && errno == EINTR); + + if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { + ap_status_t arv = wait_for_io_or_timeout(sock, 1); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } + else { + do { + rv = recv(sock->socketdes, buf, (*len), 0); + } while (rv == -1 && errno == EINTR); + } + } + if (rv == -1) { + (*len) = 0; + return errno; + } + (*len) = rv; + return APR_SUCCESS; +} +#endif diff --git a/network_io/beos/sockaddr.c b/network_io/beos/sockaddr.c new file mode 100644 index 00000000000..76fd25d2ed8 --- /dev/null +++ b/network_io/beos/sockaddr.c @@ -0,0 +1,183 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_private.h" +#ifdef HAVE_NETINET_TCP_H +#include "../unix/sockaddr.c" +#else +#include "networkio.h" + +ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) +{ + if (!sock) { + return APR_EBADF; + } + sock->local_addr->sin_port = htons((short)port); + return APR_SUCCESS; +} + +ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) +{ + if (!sock) { + return APR_EBADF; + } + sock->remote_addr->sin_port = htons((short)port); + return APR_SUCCESS; +} + +ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) +{ + if (!sock) { + return APR_EBADF; + } + *port = ntohs(sock->local_addr->sin_port); + return APR_SUCCESS; +} + +ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) +{ + if (!sock) { + return APR_EBADF; + } + *port = ntohs(sock->remote_addr->sin_port); + return APR_SUCCESS; +} + +ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) +{ + u_long ipaddr; + + if (!sock) { + return APR_EBADF; + } + + if (!strcmp(addr, APR_ANYADDR)) { + sock->local_addr->sin_addr.s_addr = htonl(INADDR_ANY); + return APR_SUCCESS; + } + + ipaddr = inet_addr(addr); + + if (ipaddr == -1) { + return errno; + } + + sock->local_addr->sin_addr.s_addr = ipaddr; + return APR_SUCCESS; +} + +ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) +{ + u_long ipaddr; + + if (!sock) { + return APR_EBADF; + } + + if (!strcmp(addr, APR_ANYADDR)) { + sock->remote_addr->sin_addr.s_addr = htonl(INADDR_ANY); + return APR_SUCCESS; + } + + ipaddr = inet_addr(addr); + + if (ipaddr == (u_long)-1) { + return errno; + } + + sock->remote_addr->sin_addr.s_addr = ipaddr; + return APR_SUCCESS; +} + +ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) +{ + if (!sock) { + return APR_EBADF; + } + + *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); + return APR_SUCCESS; +} + +ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) +{ + if (!sock) { + return APR_EBADF; + } + + *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); + return APR_SUCCESS; +} + + +ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock) +{ + if (!sock) { + return APR_EBADF; + } + + *name = sock->local_addr; + return APR_SUCCESS; +} + +ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *sock) +{ + if (!sock) { + return APR_EBADF; + } + + *name = sock->remote_addr; + return APR_SUCCESS; +} +#endif \ No newline at end of file diff --git a/network_io/beos/sockets.c b/network_io/beos/sockets.c new file mode 100644 index 00000000000..f6f109e20f2 --- /dev/null +++ b/network_io/beos/sockets.c @@ -0,0 +1,238 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_private.h" +#ifdef HAVE_NETINET_TCP_H +#include "../unix/sockets.c" +#else +#include "networkio.h" + +ap_status_t socket_cleanup(void *sock) +{ + ap_socket_t *thesocket = sock; + if (closesocket(thesocket->socketdes) == 0) { + thesocket->socketdes = -1; + return APR_SUCCESS; + } + else { + return errno; + } +} + +ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) +{ + (*new) = (ap_socket_t *)ap_palloc(cont,sizeof(ap_socket_t)); + + if ((*new) == NULL){ + return APR_ENOMEM; + } + + (*new)->cntxt = cont; + (*new)->local_addr = (struct sockaddr_in *) ap_palloc((*new)->cntxt, + sizeof (struct sockaddr_in)); + (*new)->remote_addr = (struct sockaddr_in *) ap_palloc((*new)->cntxt, + sizeof (struct sockaddr_in)); + if ((*new)->local_addr == NULL || (*new)->remote_addr==NULL){ + return APR_ENOMEM; + } + + (*new)->socketdes = socket(AF_INET ,SOCK_STREAM, 0); + (*new)->local_addr->sin_family = AF_INET; + (*new)->remote_addr->sin_family = AF_INET; + (*new)->addr_len = sizeof(*(*new)->local_addr); + memset(&(*new)->local_addr->sin_zero, 0, sizeof((*new)->local_addr->sin_zero)); + memset(&(*new)->remote_addr->sin_zero, 0, sizeof((*new)->remote_addr->sin_zero)); + + if ((*new)->socketdes < 0) { + return errno; + } + + (*new)->timeout = -1; + ap_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, ap_null_cleanup); + return APR_SUCCESS; +} + +ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) +{ + return shutdown(thesocket->socketdes, how); +} + +ap_status_t ap_close_socket(ap_socket_t *thesocket) +{ + ap_kill_cleanup(thesocket->cntxt,thesocket,socket_cleanup); + return socket_cleanup(thesocket); +} + +ap_status_t ap_bind(ap_socket_t *sock) +{ + if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) + return errno; + else + return APR_SUCCESS; +} + +ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) +{ + if (listen(sock->socketdes, backlog) == -1) + return errno; + else + return APR_SUCCESS; +} + +ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_pool_t *connection_context) +{ + (*new) = (ap_socket_t *)ap_palloc(connection_context, + sizeof(ap_socket_t)); + + (*new)->cntxt = connection_context; + (*new)->local_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + sizeof(struct sockaddr_in)); + + (*new)->remote_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + sizeof(struct sockaddr_in)); + (*new)->addr_len = sizeof(struct sockaddr_in); + (*new)->connected = 1; + + (*new)->socketdes = accept(sock->socketdes, (struct sockaddr *)(*new)->remote_addr, + &(*new)->addr_len); + + if (getsockname((*new)->socketdes, (struct sockaddr *)(*new)->local_addr, + &((*new)->addr_len)) < 0) { + return errno; + } + if ((*new)->socketdes <0){ + return errno; + } + + ap_register_cleanup((*new)->cntxt, (void *)new, + socket_cleanup, ap_null_cleanup); + return APR_SUCCESS; +} + +ap_status_t ap_connect(ap_socket_t *sock, char *hostname) +{ + struct hostent *hp; + + hp = gethostbyname(hostname); + if ((sock->socketdes < 0) || (!sock->remote_addr)) { + return APR_ENOTSOCK; + } + + memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr , hp->h_length); + + sock->remote_addr->sin_family = AF_INET; + + memset(sock->remote_addr->sin_zero, 0, sizeof(sock->remote_addr->sin_zero)); + + sock->addr_len = sizeof(sock->remote_addr); + + if ((connect(sock->socketdes, (const struct sockaddr *)sock->remote_addr, sock->addr_len) < 0) + && (errno != EINPROGRESS)) { + return errno; + } else { + int namelen = sizeof(*sock->local_addr); + getsockname(sock->socketdes, (struct sockaddr *)sock->local_addr, &namelen); + sock->connected = 1; + } + + return APR_SUCCESS; +} + +ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock) +{ + if (socket != NULL) { + return ap_get_userdata(data, key, sock->cntxt); + } + else { + data = NULL; + return APR_ENOSOCKET; + } +} + +ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key, + ap_status_t (*cleanup) (void *)) +{ + if (sock != NULL) { + return ap_set_userdata(data, key, cleanup, sock->cntxt); + } + else { + data = NULL; + return APR_ENOSOCKET; + } +} + +ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) +{ + if (sock == NULL) { + return APR_ENOSOCKET; + } + *thesock = sock->socketdes; + return APR_SUCCESS; +} + +ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, + ap_pool_t *cont) +{ + if (cont == NULL) { + return APR_ENOPOOL; + } + if ((*sock) == NULL) { + (*sock) = (ap_socket_t *)ap_palloc(cont, sizeof(ap_socket_t)); + (*sock)->cntxt = cont; + } + (*sock)->socketdes = *thesock; + return APR_SUCCESS; +} +#endif \ No newline at end of file diff --git a/network_io/beos/sockopt.c b/network_io/beos/sockopt.c new file mode 100644 index 00000000000..9710ff2def5 --- /dev/null +++ b/network_io/beos/sockopt.c @@ -0,0 +1,117 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_private.h" +#ifdef HAVE_NETINET_TCP_H +#include "../unix/sockopt.c" +#else +#include "networkio.h" + +ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) +{ + int one; + if (on){ + one = 1; + }else { + one = 0; + } + if (opt & APR_SO_SNDBUF) + return APR_ENOTIMPL; + + if (opt & APR_SO_DEBUG) { + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, &one, sizeof(one)) == -1) { + return errno; + } + } + if (opt & APR_SO_REUSEADDR) { + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) == -1) { + return errno; + } + } + if (opt & APR_SO_NONBLOCK) { + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_NONBLOCK, &one, sizeof(one)) == -1){ + return errno; + } + } + return APR_SUCCESS; +} + +ap_status_t ap_gethostname(char * buf, int len, ap_pool_t *cont) +{ + if (gethostname(buf, len) == -1){ + return errno; + } else { + return APR_SUCCESS; + } +} + +ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) +{ + struct hostent *hptr; + + hptr = gethostbyaddr((char *)&(sock->remote_addr->sin_addr), + sizeof(struct in_addr), AF_INET); + if (hptr != NULL) { + *name = ap_pstrdup(sock->cntxt, hptr->h_name); + if (*name) { + return APR_SUCCESS; + } + return APR_ENOMEM; + } + + /* XXX - Is this threadsafe? - manoj */ + /* on BeOS h_errno is a global... */ + return h_errno; +} +#endif \ No newline at end of file From 4d73d7f8451c620cbf67c9dfc9d723a877bbd9e6 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 31 May 2000 02:30:27 +0000 Subject: [PATCH 0146/7878] Rework DSO error reporting to be more flexible & informative. This patch covers os/2, unix & win32. Other platforms still need some adjustment (BeOS, AIX). Reviewed by: rbb, gstein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60120 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os2/dso.c | 19 +++++++++++++------ dso/os2/dso.h | 1 + dso/unix/dso.c | 18 +++++++++--------- dso/unix/dso.h | 1 + dso/win32/dso.c | 11 +++++++---- dso/win32/dso.h | 1 + include/apr_dso.h | 2 +- include/arch/os2/dso.h | 1 + include/arch/unix/dso.h | 1 + include/arch/win32/dso.h | 1 + misc/unix/errorcodes.c | 7 +++++-- 11 files changed, 41 insertions(+), 22 deletions(-) diff --git a/dso/os2/dso.c b/dso/os2/dso.c index e9129fe13b9..4f4f71d62e5 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -73,20 +73,22 @@ static ap_status_t dso_cleanup(void *thedso) ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, ap_pool_t *ctx) { - char failed_module[1024]; + char failed_module[20]; HMODULE handle; int rc; *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); + (*res_handle)->cont = ctx; + (*res_handle)->load_error = APR_SUCCESS; + (*res_handle)->failed_module = NULL; if ((rc = DosLoadModule(failed_module, sizeof(failed_module), path, &handle)) != 0) { + (*res_handle)->load_error = APR_OS2_STATUS(rc); (*res_handle)->failed_module = ap_pstrdup(ctx, failed_module); return APR_OS2_STATUS(rc); } (*res_handle)->handle = handle; - (*res_handle)->cont = ctx; - (*res_handle)->failed_module = NULL; ap_register_cleanup(ctx, *res_handle, dso_cleanup, ap_null_cleanup); return APR_SUCCESS; } @@ -129,8 +131,13 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, -/* Just a stub, it will never be called because we never return APR_EDSOOPEN */ -char *ap_dso_error(char *buf, int bufsize, ap_status_t errcode) +char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) { - return NULL; + char message[200]; + ap_strerror(dso->load_error, message, sizeof(message)); + strcat(message, " ("); + strcat(message, dso->failed_module); + strcat(message, ")"); + ap_cpystrn(buffer, message, buflen); + return buffer; } diff --git a/dso/os2/dso.h b/dso/os2/dso.h index 02855bb0c7b..86d82f22a18 100644 --- a/dso/os2/dso.h +++ b/dso/os2/dso.h @@ -66,6 +66,7 @@ struct ap_dso_handle_t { ap_pool_t *cont; /* Context for returning error strings */ HMODULE handle; /* Handle to the DSO loaded */ + ap_status_t load_error; char *failed_module; }; diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 4357edb3787..a62bd92f5f6 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -70,16 +70,20 @@ ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, void *os_handle = dlopen(path, RTLD_NOW | RTLD_GLOBAL); #endif - if(os_handle == NULL) + if(os_handle == NULL) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) + (*res_handle)->errormsg = strerror(errno); return errno; #else + (*res_handle)->errormsg = dlerror(); return APR_EDSOOPEN; #endif + } *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; + (*res_handle)->errormsg = NULL; return APR_SUCCESS; } @@ -134,13 +138,9 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, return APR_SUCCESS; } -char *ap_dso_error(char *buf, int bufsize, ap_status_t errcode) +char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) { -#if defined(HPUX) || defined(HPUX10) || defined(HPUX11) - return strerror(errno); -#elif defined(HAVE_DYLD) - return NULL; -#else - return dlerror(); -#endif + if (dso->errormsg) + return dso->errormsg; + return "No Error"; } diff --git a/dso/unix/dso.h b/dso/unix/dso.h index 67bf85104d2..548b2121d64 100644 --- a/dso/unix/dso.h +++ b/dso/unix/dso.h @@ -85,6 +85,7 @@ struct ap_dso_handle_t { ap_pool_t *cont; void *handle; + char *errormsg; }; #endif diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 8e64a56d72e..d04b6a054a4 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -62,13 +62,16 @@ ap_status_t ap_dso_load(struct ap_dso_handle_t **res_handle, const char *path, ap_pool_t *ctx) { HINSTANCE os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); + if(os_handle == NULL) { - return GetLastError(); + (*res_handle)->load_error = GetLastError(); + return (*res_handle)->load_error; } - *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; + (*res_handle)->load_error = APR_SUCCESS; return APR_SUCCESS; } @@ -94,7 +97,7 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, return APR_SUCCESS; } -char *ap_dso_error(char *buf, int bufsize, ap_status_t errcode) +char *ap_dso_error(ap_dso_handle_t *dso, char *buf, ap_size_t bufsize) { - return "An error occured loading a DLL."; + return ap_strerror(dso->load_error, buf, bufsize); } diff --git a/dso/win32/dso.h b/dso/win32/dso.h index 745db192dce..d4e0df9053c 100644 --- a/dso/win32/dso.h +++ b/dso/win32/dso.h @@ -63,6 +63,7 @@ struct ap_dso_handle_t { ap_pool_t *cont; void *handle; + ap_status_t load_error; }; #endif diff --git a/include/apr_dso.h b/include/apr_dso.h index 052798b4e38..c15fef3eca7 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -117,7 +117,7 @@ B ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, const char *symname); -char *ap_dso_error(char *buf, int bufsize, ap_status_t errcode); +char *ap_dso_error(ap_dso_handle_t *dso, char *buf, ap_size_t bufsize); #ifdef __cplusplus } diff --git a/include/arch/os2/dso.h b/include/arch/os2/dso.h index 02855bb0c7b..86d82f22a18 100644 --- a/include/arch/os2/dso.h +++ b/include/arch/os2/dso.h @@ -66,6 +66,7 @@ struct ap_dso_handle_t { ap_pool_t *cont; /* Context for returning error strings */ HMODULE handle; /* Handle to the DSO loaded */ + ap_status_t load_error; char *failed_module; }; diff --git a/include/arch/unix/dso.h b/include/arch/unix/dso.h index 67bf85104d2..548b2121d64 100644 --- a/include/arch/unix/dso.h +++ b/include/arch/unix/dso.h @@ -85,6 +85,7 @@ struct ap_dso_handle_t { ap_pool_t *cont; void *handle; + char *errormsg; }; #endif diff --git a/include/arch/win32/dso.h b/include/arch/win32/dso.h index 745db192dce..d4e0df9053c 100644 --- a/include/arch/win32/dso.h +++ b/include/arch/win32/dso.h @@ -63,6 +63,7 @@ struct ap_dso_handle_t { ap_pool_t *cont; void *handle; + ap_status_t load_error; }; #endif diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index ce6d7eeb689..bea9264be6b 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -74,7 +74,6 @@ static char *stuffbuffer(char *buf, ap_size_t bufsize, const char *s) static char *apr_error_string(ap_status_t statcode) { - char buf[256]; switch (statcode) { case APR_ENOPOOL: return "A new pool could not be created."; @@ -103,7 +102,11 @@ static char *apr_error_string(ap_status_t statcode) case APR_ENOSHMAVAIL: return "No shared memory is currently available"; case APR_EDSOOPEN: - return ap_dso_error(buf, sizeof(buf), APR_EDSOOPEN); +#ifdef HAVE_LIBDL + return dlerror(); +#else + return "DSO load failed"; +#endif case APR_INCHILD: return "Your code just forked, and you are currently executing in the " From e9aae4e2803d177d14bc00b77b32edf09955d8f4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 31 May 2000 18:34:12 +0000 Subject: [PATCH 0147/7878] PR: Obtained from: Submitted by: Reviewed by: Make Win32 build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60121 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 1 + libapr.def | 1 + 2 files changed, 2 insertions(+) diff --git a/aprlib.def b/aprlib.def index 36fe4868c3e..0cb5bc1ce75 100644 --- a/aprlib.def +++ b/aprlib.def @@ -249,3 +249,4 @@ EXPORTS ap_generate_random_bytes @228 ap_strnatcmp @229 ap_strnatcasecmp @230 + ap_dso_error @231 diff --git a/libapr.def b/libapr.def index 36fe4868c3e..0cb5bc1ce75 100644 --- a/libapr.def +++ b/libapr.def @@ -249,3 +249,4 @@ EXPORTS ap_generate_random_bytes @228 ap_strnatcmp @229 ap_strnatcasecmp @230 + ap_dso_error @231 From 23cee2776a3edb401558f0e5296a092e096a2aa1 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 1 Jun 2000 01:01:16 +0000 Subject: [PATCH 0148/7878] Fix building with DSO support. If any module is configured to be compiled for shared support then APR_HAS_DSO is enabled and -ldl is added to the LIBS variable. -ldl may need to be modified based on platform. If no modules are designated as shared then APR_HAS_DSO is disabled and nothing is added to LIBS. In basic testing this compiled without errors or warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60122 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 16 ++++++++++++++++ dso/aix/dso.c | 4 ++++ dso/aix/dso.h | 5 +++++ dso/beos/dso.c | 3 +++ dso/beos/dso.h | 5 +++++ dso/os2/dso.c | 4 ++++ dso/os2/dso.h | 5 +++++ dso/unix/dso.c | 4 ++++ dso/unix/dso.h | 5 +++++ dso/win32/dso.c | 4 ++++ dso/win32/dso.h | 5 +++++ include/apr.h.in | 1 + include/arch/aix/dso.h | 5 +++++ include/arch/beos/dso.h | 5 +++++ include/arch/os2/dso.h | 5 +++++ include/arch/unix/dso.h | 5 +++++ include/arch/win32/dso.h | 5 +++++ misc/unix/errorcodes.c | 4 +++- 18 files changed, 89 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 3c511934309..58123a7bd69 100644 --- a/configure.in +++ b/configure.in @@ -317,6 +317,22 @@ AC_SUBST(ssize_t_value) AC_SUBST(ssize_t_fmt) AC_SUBST(off_t_fmt) +dnl #----------------------------- Checking for DSO support +echo $ac_n "${nl}Checking for DSO...${nl}" +AC_CACHE_CHECK([for DSO support], ac_cv_enable_dso, + [ AC_ARG_ENABLE(dso, + [ --enable-dso Enable reliable child processes ], + [ ac_cv_enable_dso=$enableval], + [ aprdso="1" ] ) ] ) + +if test "$ac_cv_enable_dso" = "no"; then + aprdso="0" +else + aprdso="1" +fi + +AC_SUBST(aprdso) + dnl #----------------------------- Checking for Threads echo $ac_n "${nl}Checking for Threads...${nl}" AC_CACHE_CHECK([for threads], ac_cv_enable_threads, diff --git a/dso/aix/dso.c b/dso/aix/dso.c index d43c8fdd99d..e433985f83b 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -87,6 +87,8 @@ #include #include "dso.h" +#if APR_HAS_DSO + #undef FREAD #undef FWRITE #include @@ -704,3 +706,5 @@ static void *findMain(void) free(buf); return ret; } + +#endif diff --git a/dso/aix/dso.h b/dso/aix/dso.h index 392a92015ab..ae89f9ee585 100644 --- a/dso/aix/dso.h +++ b/dso/aix/dso.h @@ -59,6 +59,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO void *dlopen(const char *path, int mode); void *dlsym(void *handle, const char *symbol); @@ -71,3 +74,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/dso/beos/dso.c b/dso/beos/dso.c index c63102739b5..acb05b58f08 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -54,6 +54,7 @@ #include "dso.h" +#if APR_HAS_DSO ap_status_t ap_dso_init(void){ return APR_SUCCESS; @@ -97,3 +98,5 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, return APR_SUCCESS; } + +#endif diff --git a/dso/beos/dso.h b/dso/beos/dso.h index 2666d779ad2..27e35f87e67 100644 --- a/dso/beos/dso.h +++ b/dso/beos/dso.h @@ -60,11 +60,16 @@ #include "apr_pools.h" #include "apr_errno.h" #include "apr_dso.h" +#include "apr.h" #include +#if APR_HAS_DSO + struct ap_dso_handle_t { image_id handle; /* Handle to the DSO loaded */ ap_pool_t *cont; }; #endif + +#endif diff --git a/dso/os2/dso.c b/dso/os2/dso.c index 4f4f71d62e5..b95c8680155 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -58,6 +58,8 @@ #include #include +#if APR_HAS_DSO + ap_status_t ap_dso_init() { return APR_SUCCESS; @@ -141,3 +143,5 @@ char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) ap_cpystrn(buffer, message, buflen); return buffer; } + +#endif diff --git a/dso/os2/dso.h b/dso/os2/dso.h index 86d82f22a18..b37e1a54c10 100644 --- a/dso/os2/dso.h +++ b/dso/os2/dso.h @@ -62,6 +62,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO struct ap_dso_handle_t { ap_pool_t *cont; /* Context for returning error strings */ @@ -71,3 +74,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/dso/unix/dso.c b/dso/unix/dso.c index a62bd92f5f6..2ed08958a98 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -54,6 +54,8 @@ #include "dso.h" +#if APR_HAS_DSO + ap_status_t ap_dso_init(void){ return APR_SUCCESS; } @@ -144,3 +146,5 @@ char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) return dso->errormsg; return "No Error"; } + +#endif diff --git a/dso/unix/dso.h b/dso/unix/dso.h index 548b2121d64..55e7e324690 100644 --- a/dso/unix/dso.h +++ b/dso/unix/dso.h @@ -59,6 +59,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO #ifdef HAVE_DLFCN_H #include @@ -89,3 +92,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/dso/win32/dso.c b/dso/win32/dso.c index d04b6a054a4..33ad2717fb3 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -54,6 +54,8 @@ #include "dso.h" +#if APR_HAS_DSO + ap_status_t ap_dso_init(void){ return APR_SUCCESS; } @@ -101,3 +103,5 @@ char *ap_dso_error(ap_dso_handle_t *dso, char *buf, ap_size_t bufsize) { return ap_strerror(dso->load_error, buf, bufsize); } + +#endif diff --git a/dso/win32/dso.h b/dso/win32/dso.h index d4e0df9053c..73ab8b1ed58 100644 --- a/dso/win32/dso.h +++ b/dso/win32/dso.h @@ -59,6 +59,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO struct ap_dso_handle_t { ap_pool_t *cont; @@ -67,3 +70,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/include/apr.h.in b/include/apr.h.in index e3c6dde3dc1..1252a052462 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -65,6 +65,7 @@ #define APR_HAS_RANDOM @rand@ #define APR_HAS_XLATE @iconv@ #define APR_HAS_OTHER_CHILD @oc@ +#define APR_HAS_DSO @aprdso@ /* This macro tells APR that it is safe to make a file masquerade as a * socket. This is necessary, because some platforms support poll'ing diff --git a/include/arch/aix/dso.h b/include/arch/aix/dso.h index 392a92015ab..ae89f9ee585 100644 --- a/include/arch/aix/dso.h +++ b/include/arch/aix/dso.h @@ -59,6 +59,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO void *dlopen(const char *path, int mode); void *dlsym(void *handle, const char *symbol); @@ -71,3 +74,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/include/arch/beos/dso.h b/include/arch/beos/dso.h index 2666d779ad2..27e35f87e67 100644 --- a/include/arch/beos/dso.h +++ b/include/arch/beos/dso.h @@ -60,11 +60,16 @@ #include "apr_pools.h" #include "apr_errno.h" #include "apr_dso.h" +#include "apr.h" #include +#if APR_HAS_DSO + struct ap_dso_handle_t { image_id handle; /* Handle to the DSO loaded */ ap_pool_t *cont; }; #endif + +#endif diff --git a/include/arch/os2/dso.h b/include/arch/os2/dso.h index 86d82f22a18..b37e1a54c10 100644 --- a/include/arch/os2/dso.h +++ b/include/arch/os2/dso.h @@ -62,6 +62,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO struct ap_dso_handle_t { ap_pool_t *cont; /* Context for returning error strings */ @@ -71,3 +74,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/include/arch/unix/dso.h b/include/arch/unix/dso.h index 548b2121d64..55e7e324690 100644 --- a/include/arch/unix/dso.h +++ b/include/arch/unix/dso.h @@ -59,6 +59,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO #ifdef HAVE_DLFCN_H #include @@ -89,3 +92,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/include/arch/win32/dso.h b/include/arch/win32/dso.h index d4e0df9053c..73ab8b1ed58 100644 --- a/include/arch/win32/dso.h +++ b/include/arch/win32/dso.h @@ -59,6 +59,9 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO struct ap_dso_handle_t { ap_pool_t *cont; @@ -67,3 +70,5 @@ struct ap_dso_handle_t { }; #endif + +#endif diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index bea9264be6b..3af1bc56a5b 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -101,12 +101,14 @@ static char *apr_error_string(ap_status_t statcode) return "No thread key structure was provided and one was required."; case APR_ENOSHMAVAIL: return "No shared memory is currently available"; +#if APR_HAS_DSO case APR_EDSOOPEN: #ifdef HAVE_LIBDL return dlerror(); #else return "DSO load failed"; -#endif +#endif /* HAVE_LIBDL */ +#endif /* APR_HAS_DSO */ case APR_INCHILD: return "Your code just forked, and you are currently executing in the " From c300063151144408c1cc4fccbc56a03472801c6a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 1 Jun 2000 01:59:19 +0000 Subject: [PATCH 0149/7878] PR: Obtained from: Submitted by: Reviewed by: Fix some Win32 APR feature macro declarations git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60123 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 9 ++++----- include/apr_private.hw | 3 +++ include/arch/win32/apr_private.h | 3 +++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 828894cb46e..2d69dd89bff 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -137,11 +137,10 @@ #endif /* APR Feature Macros */ -#define APR_HAS_THREADS 1 -#define APR_HAS_SENDFILE 1 -#define APR_HAS_MMAP 0 -#define APR_HAS_RANDOM 1 -#define APR_HAS_XLATE 0 +#define APR_HAS_THREADS 1 +#define APR_HAS_SENDFILE 1 +#define APR_HAS_RANDOM 1 +#define APR_HAS_DSO 1 /* Typedefs that APR needs. */ diff --git a/include/apr_private.hw b/include/apr_private.hw index 2cafe1ab9a3..c42ff0df000 100644 --- a/include/apr_private.hw +++ b/include/apr_private.hw @@ -171,6 +171,9 @@ typedef void (Sigfunc)(int); * that the windows port needs. */ #define APR_HAS_THREADS 1 +#define APR_HAS_SENDFILE 1 +#define APR_HAS_RANDOM 1 +#define APR_HAS_DSO 1 #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 2cafe1ab9a3..c42ff0df000 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -171,6 +171,9 @@ typedef void (Sigfunc)(int); * that the windows port needs. */ #define APR_HAS_THREADS 1 +#define APR_HAS_SENDFILE 1 +#define APR_HAS_RANDOM 1 +#define APR_HAS_DSO 1 #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 From 294323eed890404176451551b5489bdca83234c8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 1 Jun 2000 03:11:23 +0000 Subject: [PATCH 0150/7878] PR: Obtained from: Submitted by: Reviewed by: Add declarations of missing APR features (Win32) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60124 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 3 +++ include/apr_private.hw | 3 +++ include/arch/win32/apr_private.h | 3 +++ 3 files changed, 9 insertions(+) diff --git a/include/apr.hw b/include/apr.hw index 2d69dd89bff..479cc19ea3b 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -142,6 +142,9 @@ #define APR_HAS_RANDOM 1 #define APR_HAS_DSO 1 +#define APR_HAS_MMAP 0 +#define APR_HAS_XLATE 0 + /* Typedefs that APR needs. */ typedef short ap_int16_t; diff --git a/include/apr_private.hw b/include/apr_private.hw index c42ff0df000..40b3221f7da 100644 --- a/include/apr_private.hw +++ b/include/apr_private.hw @@ -175,6 +175,9 @@ typedef void (Sigfunc)(int); #define APR_HAS_RANDOM 1 #define APR_HAS_DSO 1 +#define APR_HAS_MMAP 0 +#define APR_HAS_XLATE 0 + #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 #define SIZEOF_LONGLONG 8 diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index c42ff0df000..40b3221f7da 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -175,6 +175,9 @@ typedef void (Sigfunc)(int); #define APR_HAS_RANDOM 1 #define APR_HAS_DSO 1 +#define APR_HAS_MMAP 0 +#define APR_HAS_XLATE 0 + #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 #define SIZEOF_LONGLONG 8 From 09ee9c948409b5bb99943d9b1030931bf6d7dd6e Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 1 Jun 2000 14:27:05 +0000 Subject: [PATCH 0151/7878] Add an ap_dso_error function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60125 13f79535-47bb-0310-9956-ffa450edef68 --- dso/beos/dso.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dso/beos/dso.c b/dso/beos/dso.c index acb05b58f08..76b5d2b9ea1 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -99,4 +99,9 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, return APR_SUCCESS; } +char *ap_dso_error(char *buf, int bufsize, ap_status_t errcode) +{ + return strerror(errno); +} + #endif From e554879097bb314a564798ded9f9298b2625e6a6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 1 Jun 2000 15:45:18 +0000 Subject: [PATCH 0152/7878] Fix DSO enabling logic. Basically if --enable-dso was specified on the command line but the cache had DSO off, we used to turn DSO off. This has been fixed with this patch. Also, if we specify ANY Apache module as being compiled shared, then we automatically turn on mod_so. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60126 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 58123a7bd69..e5292e6f0f7 100644 --- a/configure.in +++ b/configure.in @@ -319,11 +319,11 @@ AC_SUBST(off_t_fmt) dnl #----------------------------- Checking for DSO support echo $ac_n "${nl}Checking for DSO...${nl}" -AC_CACHE_CHECK([for DSO support], ac_cv_enable_dso, - [ AC_ARG_ENABLE(dso, - [ --enable-dso Enable reliable child processes ], - [ ac_cv_enable_dso=$enableval], - [ aprdso="1" ] ) ] ) +AC_ARG_ENABLE(dso, + [ --enable-dso Enable reliable child processes ], + [ ac_cv_enable_dso=$enableval], + [ AC_CACHE_CHECK([for DSO support], ac_cv_enable_dso, + [ac_cv_enable_dso="yes"] ) ] ) if test "$ac_cv_enable_dso" = "no"; then aprdso="0" From 38c425ce9eccd4139558d8eaba6dd7ed86893795 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 1 Jun 2000 18:45:11 +0000 Subject: [PATCH 0153/7878] 2 weeks and so many changes to catch up on... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60127 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/threadproc.h | 11 +----- threadproc/beos/proc.c | 72 +++++++--------------------------- threadproc/beos/threadproc.h | 11 +----- 3 files changed, 16 insertions(+), 78 deletions(-) diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h index 4588105d15f..d7ce37f793e 100644 --- a/include/arch/beos/threadproc.h +++ b/include/arch/beos/threadproc.h @@ -53,7 +53,7 @@ */ #include "apr_thread_proc.h" -#include "fileio.h" +#include "../../file_io/unix/fileio.h" #include "apr_file_io.h" #include "apr_thread_proc.h" #include "apr_file_io.h" @@ -121,14 +121,5 @@ struct ap_procattr_t { ap_int32_t detached; }; -struct ap_proc_t { - ap_pool_t *cntxt; - thread_id pid; - struct ap_procattr_t *attr; -}; - -/* we need a structure to pass off to the thread that will run any - * new process we create */ - #endif /* ! THREAD_PROC_H */ diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index adeb0db967e..9661778dda0 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -166,27 +166,29 @@ ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach) return APR_SUCCESS; } -ap_status_t ap_fork(ap_proc_t **proc, ap_pool_t *cont) +ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) { int pid; - (*proc) = (ap_proc_t *)ap_palloc(cont, sizeof(ap_proc_t)); - if ((pid = fork()) < 0) { return errno; } else if (pid == 0) { - (*proc)->pid = pid; - (*proc)->attr = NULL; + proc->pid = pid; + proc->in = NULL; + proc->out = NULL; + proc->err = NULL; return APR_INCHILD; } - (*proc)->pid = pid; - (*proc)->attr = NULL; + proc->pid = pid; + proc->in = NULL; + proc->out = NULL; + proc->err = NULL; return APR_INPARENT; } -ap_status_t ap_create_process(ap_proc_t **new, const char *progname, +ap_status_t ap_create_process(ap_proc_t *new, const char *progname, char *const args[], char **env, ap_procattr_t *attr, ap_pool_t *cont) { @@ -198,15 +200,11 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, struct send_pipe *sp; char * dir = NULL; - (*new) = (ap_proc_t *)ap_palloc(cont, sizeof(ap_proc_t)); sp = (struct send_pipe *)ap_palloc(cont, sizeof(struct send_pipe)); - if ((*new) == NULL){ - return APR_ENOMEM; - } - - (*new)->cntxt = cont; - + new->in = attr->parent_in; + new->err = attr->parent_err; + new->out = attr->parent_out; sp->in = attr->child_in?attr->child_in->filedes:-1; sp->out = attr->child_out?attr->child_out->filedes:-1; sp->err = attr->child_err?attr->child_err->filedes:-1; @@ -259,35 +257,16 @@ ap_status_t ap_create_process(ap_proc_t **new, const char *progname, } send_data(newproc, 0, (void*)sp, sizeof(struct send_pipe)); - (*new)->pid = newproc; + new->pid = newproc; /* before we go charging on we need the new process to get to a * certain point. When it gets there it'll let us know and we * can carry on. */ receive_data(&sender, (void*)NULL,0); - (*new)->attr = attr; - return APR_SUCCESS; -} - -ap_status_t ap_get_childin(ap_file_t **new, ap_proc_t *proc) -{ - (*new) = proc->attr->parent_in; return APR_SUCCESS; } -ap_status_t ap_get_childout(ap_file_t **new, ap_proc_t *proc) -{ - (*new) = proc->attr->parent_out; - return APR_SUCCESS; -} - -ap_status_t ap_get_childerr(ap_file_t **new, ap_proc_t *proc) -{ - (*new) = proc->attr->parent_err; - return APR_SUCCESS; -} - ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e wait) { @@ -358,26 +337,3 @@ ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err, return APR_SUCCESS; } -ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc) -{ - if (proc == NULL) { - return APR_ENOPROC; - } - *theproc = proc->pid; - return APR_SUCCESS; -} - -ap_status_t ap_put_os_proc(ap_proc_t **proc, ap_os_proc_t *theproc, - ap_pool_t *cont) -{ - if (cont == NULL) { - return APR_ENOPOOL; - } - if ((*proc) == NULL) { - (*proc) = (ap_proc_t *)ap_palloc(cont, sizeof(ap_proc_t)); - (*proc)->cntxt = cont; - } - (*proc)->pid = *theproc; - return APR_SUCCESS; -} - diff --git a/threadproc/beos/threadproc.h b/threadproc/beos/threadproc.h index 4588105d15f..d7ce37f793e 100644 --- a/threadproc/beos/threadproc.h +++ b/threadproc/beos/threadproc.h @@ -53,7 +53,7 @@ */ #include "apr_thread_proc.h" -#include "fileio.h" +#include "../../file_io/unix/fileio.h" #include "apr_file_io.h" #include "apr_thread_proc.h" #include "apr_file_io.h" @@ -121,14 +121,5 @@ struct ap_procattr_t { ap_int32_t detached; }; -struct ap_proc_t { - ap_pool_t *cntxt; - thread_id pid; - struct ap_procattr_t *attr; -}; - -/* we need a structure to pass off to the thread that will run any - * new process we create */ - #endif /* ! THREAD_PROC_H */ From 88b50312dff5a115be219eb22c593e62d22dd51d Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 1 Jun 2000 18:48:24 +0000 Subject: [PATCH 0154/7878] Small change to get mmap support for BeOS working again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60128 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/mmap.c | 2 +- mmap/unix/mmap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/arch/unix/mmap.c b/include/arch/unix/mmap.c index cd60750173a..504970a7efd 100644 --- a/include/arch/unix/mmap.c +++ b/include/arch/unix/mmap.c @@ -55,7 +55,7 @@ #include "mmap_h.h" #include "apr_portable.h" -#if HAVE_MMAP +#if HAVE_MMAP || defined(BEOS) static ap_status_t mmap_cleanup(void *themmap) { diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index cd60750173a..504970a7efd 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -55,7 +55,7 @@ #include "mmap_h.h" #include "apr_portable.h" -#if HAVE_MMAP +#if HAVE_MMAP || defined(BEOS) static ap_status_t mmap_cleanup(void *themmap) { From ff04b229c41197eab05cf457c6c5d1d5065d3b36 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 1 Jun 2000 18:50:41 +0000 Subject: [PATCH 0155/7878] Remove the file_check_read function. This should have been removed with the change to saferead, but I forgot about it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60129 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 20 -------------------- include/apr_file_io.h | 12 ------------ 2 files changed, 32 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 85e323e9d6e..5b491d4ff7b 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -411,23 +411,3 @@ APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) free(buf); return (cc == APR_SUCCESS) ? len : -1; } - -ap_status_t ap_file_check_read(ap_file_t *fd) -{ - fd_set fds; - int rv; - struct timeval tv = { 0 }; - - FD_ZERO(&fds); - FD_SET(fd->filedes, &fds); - if ((rv = select(fd->filedes + 1, &fds, NULL, NULL, &tv)) == -1) { - return errno; - } - else if (rv == 0) { - return APR_TIMEUP; - } - else { - return APR_SUCCESS; - } -} - diff --git a/include/apr_file_io.h b/include/apr_file_io.h index a58463ce6b2..790a136c497 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -253,18 +253,6 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes); /* -=head1 ap_status_t ap_file_check_read(ap_file_t *fd) - -B - - arg 1) The file descriptor to check. - -=cut - */ -ap_status_t ap_file_check_read(ap_file_t *fd); - -/* - =head1 ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) B From c1699d61cf00a97b32308629ffc143665781f04e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 1 Jun 2000 22:23:16 +0000 Subject: [PATCH 0156/7878] Fix readwrite to support BeOS. BeOS doesn't currently support select'ing on files, so wait_for_io_or_timeout doesn't work there. Submitted by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60130 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 5b491d4ff7b..f3a81c5d3b2 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -55,6 +55,7 @@ #include "fileio.h" #include "apr_lock.h" +#ifndef BEOS static ap_status_t wait_for_io_or_timeout(ap_file_t *file, int for_read) { struct timeval tv, *tvptr; @@ -89,6 +90,7 @@ static ap_status_t wait_for_io_or_timeout(ap_file_t *file, int for_read) } return APR_SUCCESS; } +#endif ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) { @@ -157,7 +159,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) do { rv = read(thefile->filedes, buf, *nbytes); } while (rv == -1 && errno == EINTR); - +#ifndef BEOS if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && thefile->timeout != 0) { @@ -172,7 +174,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) } while (rv == -1 && errno == EINTR); } } - +#endif *nbytes = bytes_read; if (rv == 0) { return APR_EOF; @@ -230,7 +232,7 @@ ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) do { rv = write(thefile->filedes, buf, *nbytes); } while (rv == (ap_size_t)-1 && errno == EINTR); - +#ifndef BEOS if (rv == (ap_size_t)-1 && (errno == EAGAIN || errno == EWOULDBLOCK) && thefile->timeout != 0) { @@ -245,7 +247,7 @@ ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) } while (rv == (ap_size_t)-1 && errno == EINTR); } } - +#endif if (rv == (ap_size_t)-1) { (*nbytes) = 0; return errno; From 86f3d8e161acdf15bb2d2ef8aae9d59111938577 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 2 Jun 2000 16:47:30 +0000 Subject: [PATCH 0157/7878] Use "standard" m4 quoting to remove the ugly hack in case some of the arguments have ','s in them, which some do. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60131 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 298 +++++++++++++++++++++++++++---------------------------- 1 file changed, 149 insertions(+), 149 deletions(-) diff --git a/hints.m4 b/hints.m4 index e025ab67eb5..71652666be8 100644 --- a/hints.m4 +++ b/hints.m4 @@ -37,7 +37,7 @@ dnl Set variable iff it's currently null dnl AC_DEFUN(APR_SETIFNULL,[ if test -z "$$1"; then - $1="$2$3$4$5$6$7$8$9"; export $1 + $1="$2"; export $1 fi ]) @@ -47,7 +47,7 @@ dnl dnl Add value to variable dnl AC_DEFUN(APR_ADDTO,[ - $1="$$1 $2$3$4$5$6$7$8$9"; export $1 + $1="$$1 $2"; export $1 ]) dnl @@ -63,313 +63,313 @@ echo "Applying hints file rules for $PLAT" case "$PLAT" in *mint) - APR_SETIFNULL(CFLAGS, -DMINT) - APR_SETIFNULL(LIBS, -lportlib -lsocket) + APR_SETIFNULL(CFLAGS, [-DMINT]) + APR_SETIFNULL(LIBS, [-lportlib -lsocket]) ;; *MPE/iX*) - APR_SETIFNULL(CFLAGS, -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE) - APR_SETIFNULL(LIBS, -lsocket -lsvipc -lcurses) - APR_SETIFNULL(LDFLAGS, -Xlinker \"-WL,cap=ia,ba,ph;nmstack=1024000\") - APR_SETIFNULL(CAT, /bin/cat) + APR_SETIFNULL(CFLAGS, [-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE]) + APR_SETIFNULL(LIBS, [-lsocket -lsvipc -lcurses]) + APR_SETIFNULL(LDFLAGS, [-Xlinker \"-WL,cap=ia,ba,ph;nmstack=1024000\"]) + APR_SETIFNULL(CAT, [/bin/cat]) ;; *-apple-aux3*) - APR_SETIFNULL(CFLAGS, -DAUX3 -D_POSIX_SOURCE) - APR_SETIFNULL(LIBS, -lposix -lbsd) - APR_SETIFNULL(LDFLAGS, -s) + APR_SETIFNULL(CFLAGS, [-DAUX3 -D_POSIX_SOURCE]) + APR_SETIFNULL(LIBS, [-lposix -lbsd]) + APR_SETIFNULL(LDFLAGS, [-s]) ;; i386-ibm-aix*) - APR_SETIFNULL(CFLAGS, -DAIX=1 -U__STR__ -DUSEBCOPY) + APR_SETIFNULL(CFLAGS, [-DAIX=1 -U__STR__ -DUSEBCOPY]) ;; *-ibm-aix[1-2].*) - APR_SETIFNULL(CFLAGS, -DAIX=1 -DNEED_RLIM_T -U__STR__) + APR_SETIFNULL(CFLAGS, [-DAIX=1 -DNEED_RLIM_T -U__STR__]) ;; *-ibm-aix3.*) - APR_SETIFNULL(CFLAGS, -DAIX=30 -DNEED_RLIM_T -U__STR__) + APR_SETIFNULL(CFLAGS, [-DAIX=30 -DNEED_RLIM_T -U__STR__]) ;; *-ibm-aix4.1) - APR_SETIFNULL(CFLAGS, -DAIX=41 -DNEED_RLIM_T -U__STR__) + APR_SETIFNULL(CFLAGS, [-DAIX=41 -DNEED_RLIM_T -U__STR__]) ;; *-ibm-aix4.2) - APR_SETIFNULL(CFLAGS, -DAIX=42 -U__STR__) - APR_SETIFNULL(LDFLAGS, -lm) + APR_SETIFNULL(CFLAGS, [-DAIX=42 -U__STR__]) + APR_SETIFNULL(LDFLAGS, [-lm]) ;; *-ibm-aix4.3) - APR_SETIFNULL(CFLAGS, -DAIX=43 -U__STR__) - APR_SETIFNULL(LDFLAGS, -lm) + APR_SETIFNULL(CFLAGS, [-DAIX=43 -U__STR__]) + APR_SETIFNULL(LDFLAGS, [-lm]) ;; *-ibm-aix*) - APR_SETIFNULL(CFLAGS, -DAIX=1 -U__STR__) - APR_SETIFNULL(LDFLAGS, -lm) + APR_SETIFNULL(CFLAGS, [-DAIX=1 -U__STR__]) + APR_SETIFNULL(LDFLAGS, [-lm]) ;; *-apollo-*) - APR_SETIFNULL(CFLAGS, -DAPOLLO) + APR_SETIFNULL(CFLAGS, [-DAPOLLO]) ;; *-dg-dgux*) - APR_SETIFNULL(CFLAGS, -DDGUX) + APR_SETIFNULL(CFLAGS, [-DDGUX]) ;; *OS/2*) - APR_SETIFNULL(CFLAGS, -DOS2 -DTCPIPV4 -g -Zmt) - APR_SETIFNULL(LDFLAGS, -Zexe -Zmtd -Zsysv-signals -Zbin-files) - APR_SETIFNULL(LIBS, -lsocket -lufc -lbsd) - APR_SETIFNULL(SHELL, sh) - APR_SETIFNULL(file_as_socket, 0) + APR_SETIFNULL(CFLAGS, [-DOS2 -DTCPIPV4 -g -Zmt]) + APR_SETIFNULL(LDFLAGS, [-Zexe -Zmtd -Zsysv-signals -Zbin-files]) + APR_SETIFNULL(LIBS, [-lsocket -lufc -lbsd]) + APR_SETIFNULL(SHELL, [sh]) + APR_SETIFNULL(file_as_socket, [0]) ;; *-hi-hiux) - APR_SETIFNULL(CFLAGS, -DHIUX) + APR_SETIFNULL(CFLAGS, [-DHIUX]) ;; *-hp-hpux11.*) - APR_SETIFNULL(CFLAGS, -DHPUX11) - APR_SETIFNULL(LIBS, -lm -lpthread) + APR_SETIFNULL(CFLAGS, [-DHPUX11]) + APR_SETIFNULL(LIBS, [-lm -lpthread]) ;; *-hp-hpux10.*) - APR_SETIFNULL(CFLAGS, -DHPUX10) + APR_SETIFNULL(CFLAGS, [-DHPUX10]) case $PLAT in *-hp-hpux10.01) dnl # We know this is a problem in 10.01. dnl # Not a problem in 10.20. Otherwise, who knows? - APR_ADDTO(CFLAGS, -DSELECT_NEEDS_CAST) + APR_ADDTO(CFLAGS, [-DSELECT_NEEDS_CAST]) ;; esac ;; *-hp-hpux*) - APR_SETIFNULL(CFLAGS, -DHPUX) - APR_SETIFNULL(LIBS, -lm) + APR_SETIFNULL(CFLAGS, [-DHPUX]) + APR_SETIFNULL(LIBS, [-lm]) ;; *-linux2) - APR_SETIFNULL(CFLAGS, -DLINUX=2) - APR_SETIFNULL(LIBS, -lm) + APR_SETIFNULL(CFLAGS, [-DLINUX=2]) + APR_SETIFNULL(LIBS, [-lm]) ;; *-GNU*) - APR_SETIFNULL(CFLAGS, -DHURD) - APR_SETIFNULL(LIBS, -lm -lcrypt) + APR_SETIFNULL(CFLAGS, [-DHURD]) + APR_SETIFNULL(LIBS, [-lm -lcrypt]) ;; *-linux1) - APR_SETIFNULL(CFLAGS, -DLINUX=1) + APR_SETIFNULL(CFLAGS, [-DLINUX=1]) ;; *-lynx-lynxos) - APR_SETIFNULL(CFLAGS, -D__NO_INCLUDE_WARN__ -DLYNXOS) - APR_SETIFNULL(LIBS, -lbsd -lcrypt) + APR_SETIFNULL(CFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) + APR_SETIFNULL(LIBS, [-lbsd -lcrypt]) ;; *486-*-bsdi*) - APR_SETIFNULL(CFLAGS, -m486) + APR_SETIFNULL(CFLAGS, [-m486]) ;; *-netbsd*) - APR_SETIFNULL(CFLAGS, -DNETBSD) - APR_SETIFNULL(LIBS, -lcrypt) + APR_SETIFNULL(CFLAGS, [-DNETBSD]) + APR_SETIFNULL(LIBS, [-lcrypt]) ;; *-freebsd*) case $PLAT in *freebsd[2345]*) - APR_SETIFNULL(CFLAGS, -funsigned-char) + APR_SETIFNULL(CFLAGS, [-funsigned-char]) ;; esac - APR_SETIFNULL(LIBS, -lcrypt) + APR_SETIFNULL(LIBS, [-lcrypt]) ;; *-next-nextstep*) - APR_SETIFNULL(OPTIM, -O) - APR_SETIFNULL(CFLAGS, -DNEXT) + APR_SETIFNULL(OPTIM, [-O]) + APR_SETIFNULL(CFLAGS, [-DNEXT]) ;; *-next-openstep*) - APR_SETIFNULL(CC, cc) - APR_SETIFNULL(OPTIM, -O) - APR_SETIFNULL(CFLAGS, -DNEXT) + APR_SETIFNULL(CC, [cc]) + APR_SETIFNULL(OPTIM, [-O]) + APR_SETIFNULL(CFLAGS, [-DNEXT]) ;; dnl *-apple-rhapsody*) -dnl APR_SETIFNULL(CFLAGS, -DDARWIN -DMAC_OS_X_SERVER) +dnl APR_SETIFNULL(CFLAGS, [-DDARWIN -DMAC_OS_X_SERVER]) dnl ;; *-apple-darwin*) - APR_SETIFNULL(CFLAGS, -DDARWIN) + APR_SETIFNULL(CFLAGS, [-DDARWIN]) ;; *-dec-osf*) - APR_SETIFNULL(CFLAGS, -DOSF1) - APR_SETIFNULL(LIBS, -lm) + APR_SETIFNULL(CFLAGS, [-DOSF1]) + APR_SETIFNULL(LIBS, [-lm]) ;; *-qnx) - APR_SETIFNULL(CFLAGS, -DQNX) - APR_SETIFNULL(LIBS, -N128k -lsocket -lunix) + APR_SETIFNULL(CFLAGS, [-DQNX]) + APR_SETIFNULL(LIBS, [-N128k -lsocket -lunix]) ;; *-qnx32) - APR_SETIFNULL(CC, cc -F) - APR_SETIFNULL(CFLAGS, -DQNX -mf -3) - APR_SETIFNULL(LIBS, -N128k -lsocket -lunix) + APR_SETIFNULL(CC, [cc -F]) + APR_SETIFNULL(CFLAGS, [-DQNX -mf -3]) + APR_SETIFNULL(LIBS, [-N128k -lsocket -lunix]) ;; *-isc4*) - APR_SETIFNULL(CC, gcc) - APR_SETIFNULL(CFLAGS, -posix -DISC) - APR_SETIFNULL(LDFLAGS, -posix) - APR_SETIFNULL(LIBS, -linet) + APR_SETIFNULL(CC, [gcc]) + APR_SETIFNULL(CFLAGS, [-posix -DISC]) + APR_SETIFNULL(LDFLAGS, [-posix]) + APR_SETIFNULL(LIBS, [-linet]) ;; *-sco3*) - APR_SETIFNULL(CFLAGS, -DSCO -Oacgiltz) - APR_SETIFNULL(LIBS, -lPW -lsocket -lmalloc -lcrypt_i) + APR_SETIFNULL(CFLAGS, [-DSCO -Oacgiltz]) + APR_SETIFNULL(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) ;; *-sco5*) - APR_SETIFNULL(CFLAGS, -DSCO5) - APR_SETIFNULL(LIBS, -lsocket -lmalloc -lprot -ltinfo -lx -lm) + APR_SETIFNULL(CFLAGS, [-DSCO5]) + APR_SETIFNULL(LIBS, [-lsocket -lmalloc -lprot -ltinfo -lx -lm]) ;; *-sco_sv*|*-SCO_SV*) - APR_SETIFNULL(CFLAGS, -DSCO) - APR_SETIFNULL(LIBS, -lPW -lsocket -lmalloc -lcrypt_i) + APR_SETIFNULL(CFLAGS, [-DSCO]) + APR_SETIFNULL(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) ;; *-solaris2*) PLATOSVERS=`echo $PLAT | sed 's/^.*solaris2.//'` - APR_SETIFNULL(CFLAGS, -DSOLARIS2=$PLATOSVERS) - APR_SETIFNULL(LIBS, -lsocket -lnsl) + APR_SETIFNULL(CFLAGS, [-DSOLARIS2=$PLATOSVERS]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl]) ;; *-sunos4*) - APR_SETIFNULL(CFLAGS, -DSUNOS4 -DUSEBCOPY) + APR_SETIFNULL(CFLAGS, [-DSUNOS4 -DUSEBCOPY]) ;; *-unixware1) - APR_SETIFNULL(CFLAGS, -DUW=100) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lcrypt) + APR_SETIFNULL(CFLAGS, [-DUW=100]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lcrypt]) ;; *-unixware2) - APR_SETIFNULL(CFLAGS, -DUW=200) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lcrypt -lgen) + APR_SETIFNULL(CFLAGS, [-DUW=200]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lcrypt -lgen]) ;; *-unixware211) - APR_SETIFNULL(CFLAGS, -DUW=211) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lcrypt -lgen) + APR_SETIFNULL(CFLAGS, [-DUW=211]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lcrypt -lgen]) ;; *-unixware212) - APR_SETIFNULL(CFLAGS, -DUW=212) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lcrypt -lgen) + APR_SETIFNULL(CFLAGS, [-DUW=212]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lcrypt -lgen]) ;; *-unixware7) - APR_SETIFNULL(CFLAGS, -DUW=700) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lcrypt -lgen) + APR_SETIFNULL(CFLAGS, [-DUW=700]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lcrypt -lgen]) ;; maxion-*-sysv4*) - APR_SETIFNULL(CFLAGS, -DSVR4) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lc -lgen) + APR_SETIFNULL(CFLAGS, [-DSVR4]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc -lgen]) ;; *-*-powermax*) - APR_SETIFNULL(CFLAGS, -DSVR4) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lgen) + APR_SETIFNULL(CFLAGS, [-DSVR4]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lgen]) ;; TPF) - APR_SETIFNULL(CC, c89) - APR_SETIFNULL(CFLAGS, -DTPF -DCHARSET_EBCDIC -D_POSIX_SOURCE) + APR_SETIFNULL(CC, [c89]) + APR_SETIFNULL(CFLAGS, [-DTPF -DCHARSET_EBCDIC -D_POSIX_SOURCE]) ;; BS2000*-siemens-sysv4*) - APR_SETIFNULL(CC, c89 -XLLML -XLLMK -XL -Kno_integer_overflow) - APR_SETIFNULL(CFLAGS, -DCHARSET_EBCDIC -DSVR4 -D_XPG_IV) + APR_SETIFNULL(CC, [c89 -XLLML -XLLMK -XL -Kno_integer_overflow]) + APR_SETIFNULL(CFLAGS, [-DCHARSET_EBCDIC -DSVR4 -D_XPG_IV]) ;; *-siemens-sysv4*) - APR_SETIFNULL(CFLAGS, -DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT -DNEED_UNION_SEMUN) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lc) + APR_SETIFNULL(CFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT -DNEED_UNION_SEMUN]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc]) ;; pyramid-pyramid-svr4) - APR_SETIFNULL(CFLAGS, -DSVR4 -DNO_LONG_DOUBLE) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lc) + APR_SETIFNULL(CFLAGS, [-DSVR4 -DNO_LONG_DOUBLE]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc]) ;; DS/90\ 7000-*-sysv4*) - APR_SETIFNULL(CFLAGS, -DUXPDS) - APR_SETIFNULL(LIBS, -lsocket -lnsl) + APR_SETIFNULL(CFLAGS, [-DUXPDS]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl]) ;; *-tandem-sysv4*) - APR_SETIFNULL(CFLAGS, -DSVR4) - APR_SETIFNULL(LIBS, -lsocket -lnsl) + APR_SETIFNULL(CFLAGS, [-DSVR4]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl]) ;; *-ncr-sysv4) - APR_SETIFNULL(CFLAGS, -DSVR4 -DMPRAS) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lc -L/usr/ucblib -lucb) + APR_SETIFNULL(CFLAGS, [-DSVR4 -DMPRAS]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) ;; *-sysv4*) - APR_SETIFNULL(CFLAGS, -DSVR4) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lc) + APR_SETIFNULL(CFLAGS, [-DSVR4]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc]) ;; 88k-encore-sysv4) - APR_SETIFNULL(CFLAGS, -DSVR4 -DENCORE) - APR_SETIFNULL(LIBS, -lPW) + APR_SETIFNULL(CFLAGS, [-DSVR4 -DENCORE]) + APR_SETIFNULL(LIBS, [-lPW]) ;; *-uts*) PLATOSVERS=`echo $PLAT | sed 's/^.*,//'` case $PLATOSVERS in - 2*) APR_SETIFNULL(CFLAGS, -Xa -eft -DUTS21 -DUSEBCOPY) - APR_SETIFNULL(LIBS, -lsocket -lbsd -la) + 2*) APR_SETIFNULL(CFLAGS, [-Xa -eft -DUTS21 -DUSEBCOPY]) + APR_SETIFNULL(LIBS, [-lsocket -lbsd -la]) ;; - *) APR_SETIFNULL(CFLAGS, -Xa -DSVR4) - APR_SETIFNULL(LIBS, -lsocket -lnsl) + *) APR_SETIFNULL(CFLAGS, [-Xa -DSVR4]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl]) ;; esac ;; *-ultrix) - APR_SETIFNULL(CFLAGS=-DULTRIX) - APR_SETIFNULL(SHELL=/bin/sh5) + APR_SETIFNULL(CFLAGS, [-DULTRIX]) + APR_SETIFNULL(SHELL, [/bin/sh5]) ;; *powerpc-tenon-machten*) - APR_SETIFNULL(LDFLAGS, -Xlstack=0x14000 -Xldelcsect) + APR_SETIFNULL(LDFLAGS, [-Xlstack=0x14000 -Xldelcsect]) ;; *-machten*) - APR_SETIFNULL(LDFLAGS, -stack 0x14000) + APR_SETIFNULL(LDFLAGS, [-stack 0x14000]) ;; *convex-v11*) - APR_SETIFNULL(CFLAGS, -ext -DCONVEXOS11) - APR_SETIFNULL(OPTIM, -O1) - APR_SETIFNULL(CC, cc) + APR_SETIFNULL(CFLAGS, [-ext -DCONVEXOS11]) + APR_SETIFNULL(OPTIM, [-O1]) + APR_SETIFNULL(CC, [cc]) ;; i860-intel-osf1) - APR_SETIFNULL(CFLAGS, -DPARAGON) + APR_SETIFNULL(CFLAGS, [-DPARAGON]) ;; *-sequent-ptx2.*.*) - APR_SETIFNULL(CFLAGS, -DSEQUENT=20 -Wc,-pw) - APR_SETIFNULL(LIBS, -lsocket -linet -lnsl -lc -lseq) + APR_SETIFNULL(CFLAGS, [-DSEQUENT=20 -Wc,-pw]) + APR_SETIFNULL(LIBS, [-lsocket -linet -lnsl -lc -lseq]) ;; *-sequent-ptx4.0.*) - APR_SETIFNULL(CFLAGS, -DSEQUENT=40 -Wc,-pw) - APR_SETIFNULL(LIBS, -lsocket -linet -lnsl -lc) + APR_SETIFNULL(CFLAGS, [-DSEQUENT=40 -Wc,-pw]) + APR_SETIFNULL(LIBS, [-lsocket -linet -lnsl -lc]) ;; *-sequent-ptx4.[123].*) - APR_SETIFNULL(CFLAGS, -DSEQUENT=41 -Wc,-pw) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lc) + APR_SETIFNULL(CFLAGS, [-DSEQUENT=41 -Wc,-pw]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc]) ;; *-sequent-ptx4.4.*) - APR_SETIFNULL(CFLAGS, -DSEQUENT=44 -Wc,-pw) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lc) + APR_SETIFNULL(CFLAGS, [-DSEQUENT=44 -Wc,-pw]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc]) ;; *-sequent-ptx4.5.*) - APR_SETIFNULL(CFLAGS, -DSEQUENT=45 -Wc,-pw) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lc) + APR_SETIFNULL(CFLAGS, [-DSEQUENT=45 -Wc,-pw]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc]) ;; *-sequent-ptx5.0.*) - APR_SETIFNULL(CFLAGS, -DSEQUENT=50 -Wc,-pw) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lc) + APR_SETIFNULL(CFLAGS, [-DSEQUENT=50 -Wc,-pw]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc]) ;; *NEWS-OS*) - APR_SETIFNULL(CFLAGS, -DNEWSOS) + APR_SETIFNULL(CFLAGS, [-DNEWSOS]) ;; *-riscix) - APR_SETIFNULL(CFLAGS, -DRISCIX) - APR_SETIFNULL(OPTIM, -O) - APR_SETIFNULL(MAKE, make) + APR_SETIFNULL(CFLAGS, [-DRISCIX]) + APR_SETIFNULL(OPTIM, [-O]) + APR_SETIFNULL(MAKE, [make]) ;; *-BeOS*) - APR_SETIFNULL(CFLAGS, -DBEOS) - APR_SETIFNULL(file_as_socket, 0) + APR_SETIFNULL(CFLAGS, [-DBEOS]) + APR_SETIFNULL(file_as_socket, [0]) ;; 4850-*.*) - APR_SETIFNULL(CFLAGS, -DSVR4 -DMPRAS) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lc -L/usr/ucblib -lucb) + APR_SETIFNULL(CFLAGS, [-DSVR4 -DMPRAS]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) ;; drs6000*) - APR_SETIFNULL(CFLAGS, -DSVR4) - APR_SETIFNULL(LIBS, -lsocket -lnsl -lc -L/usr/ucblib -lucb) + APR_SETIFNULL(CFLAGS, [-DSVR4]) + APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) ;; m88k-*-CX/SX|CYBER) - APR_SETIFNULL(CFLAGS, -D_CX_SX -Xa) - APR_SETIFNULL(CC, cc) + APR_SETIFNULL(CFLAGS, [-D_CX_SX -Xa]) + APR_SETIFNULL(CC, [cc]) ;; *-tandem-oss) - APR_SETIFNULL(CFLAGS=-D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED=1) - APR_SETIFNULL(CC, c89) + APR_SETIFNULL(CFLAGS, [-D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED=1]) + APR_SETIFNULL(CC, [c89]) ;; *-ibm-os390) - APR_SETIFNULL(CC, cc) - APR_ADDTO(CFLAGS, -U_NO_PROTO) - APR_ADDTO(CFLAGS, -DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR) - APR_ADDTO(CFLAGS, -DPTHREAD_DETACH_ARG1_ADDR) - APR_ADDTO(CFLAGS, -DSIGPROCMASK_SETS_THREAD_MASK) + APR_SETIFNULL(CC, [cc]) + APR_ADDTO(CFLAGS, [-U_NO_PROTO]) + APR_ADDTO(CFLAGS, [-DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR]) + APR_ADDTO(CFLAGS, [-DPTHREAD_DETACH_ARG1_ADDR]) + APR_ADDTO(CFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK]) ;; esac APR_DOEXTRA From b3f86d00a0ea5076062edf5a3f2ff0314d992518 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 2 Jun 2000 22:34:58 +0000 Subject: [PATCH 0158/7878] ap_xlate_conv_buffer(): don't treat it as an error if we run out of output buffer in a multi-byte translation (single-byte translation doesn't treat it as an error). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60132 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/xlate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index a2bb502d29d..92543b7a673 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -250,7 +250,11 @@ ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, translated = iconv(convset->ich, (const char **)&inbufptr, inbytes_left, &outbufptr, outbytes_left); - if (translated == (size_t)-1) { + /* If everything went fine but we ran out of buffer, don't + * report it as an error. Caller needs to look at the two + * bytes-left values anyway. + */ + if (translated == (size_t)-1 && *outbytes_left) { return errno; } } From 7446895b9328ce4960476feb2f05f0031e09d9c1 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 3 Jun 2000 00:31:14 +0000 Subject: [PATCH 0159/7878] FreeBSD 4.0 doesn't like tempnam, so we are using mkstemp now. I hope this works on all platforms, but if not we'll just use a #ifdef later. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60133 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/locks.h | 3 +++ locks/unix/locks.c | 4 +++- locks/unix/locks.h | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index f6d37100d5e..847a8107b7b 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -85,6 +85,9 @@ #if HAVE_STDIO_H #include #endif +#if HAVE_STDLIB_H +#include +#endif #if HAVE_FCNTL_H #include #endif diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 5b40cc24224..48de7a75d32 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -74,7 +74,9 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, new->fname = ap_pstrdup(cont, fname); } else { - new->fname = ap_pstrdup(cont, tempnam(NULL, NULL)); + char *filename = "/tmp/aprXXXXXX"; + new->interproc = mkstemp(filename); + new->fname = ap_pstrdup(cont, filename); unlink(new->fname); } } diff --git a/locks/unix/locks.h b/locks/unix/locks.h index f6d37100d5e..847a8107b7b 100644 --- a/locks/unix/locks.h +++ b/locks/unix/locks.h @@ -85,6 +85,9 @@ #if HAVE_STDIO_H #include #endif +#if HAVE_STDLIB_H +#include +#endif #if HAVE_FCNTL_H #include #endif From 4380724c006b83a2a8fd9134bf5092885e2648e2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 3 Jun 2000 03:24:38 +0000 Subject: [PATCH 0160/7878] fix problems in recent change to use mkstemp(); also, fix not-so-recent bug in flock support (destroy_inter_lock was renamed to ap_unix_destroy_inter_lock) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60134 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/crossproc.c | 18 +++++++++++++++--- locks/unix/locks.c | 6 ------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index cddd80f4a36..b96b11bdc92 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -269,7 +269,13 @@ static ap_status_t lock_cleanup(void *lock_) ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) { - new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644); + if (new->fname) { + new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644); + } + else { + new->fname = ap_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); + new->interproc = mkstemp(new->fname); + } if (new->interproc < 0) { lock_cleanup(new); @@ -338,7 +344,13 @@ static ap_status_t lock_cleanup(void *lock_) ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) { - new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600); + if (new->fname) { + new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644); + } + else { + new->fname = ap_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); + new->interproc = mkstemp(new->fname); + } if (new->interproc < 0) { lock_cleanup(new); @@ -387,7 +399,7 @@ ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, new->fname = ap_pstrdup(cont, fname); new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600); if (new->interproc == -1) { - destroy_inter_lock(new); + ap_unix_destroy_inter_lock(new); return errno; } return APR_SUCCESS; diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 48de7a75d32..8f34633d5b9 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -73,12 +73,6 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, if (fname != NULL) { new->fname = ap_pstrdup(cont, fname); } - else { - char *filename = "/tmp/aprXXXXXX"; - new->interproc = mkstemp(filename); - new->fname = ap_pstrdup(cont, filename); - unlink(new->fname); - } } #endif From 7c4d67688751b29a298946a140f1caea99c6f092 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 3 Jun 2000 03:30:10 +0000 Subject: [PATCH 0161/7878] Change flock support to create file with 0600 (as it did for a long time, up until the last commit). Somebody else can deal with the discrepency between permissions among different functions which open the file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60135 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/crossproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index b96b11bdc92..e5f3d5f48c5 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -345,7 +345,7 @@ static ap_status_t lock_cleanup(void *lock_) ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) { if (new->fname) { - new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644); + new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600); } else { new->fname = ap_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); From 9b07968b3025dfdcbb92072a4ab06e48c5656466 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 3 Jun 2000 15:16:47 +0000 Subject: [PATCH 0162/7878] Fix the hints file for BeOS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60136 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hints.m4 b/hints.m4 index 71652666be8..52b7a676339 100644 --- a/hints.m4 +++ b/hints.m4 @@ -344,7 +344,7 @@ dnl ;; APR_SETIFNULL(OPTIM, [-O]) APR_SETIFNULL(MAKE, [make]) ;; - *-BeOS*) + *-beos*) APR_SETIFNULL(CFLAGS, [-DBEOS]) APR_SETIFNULL(file_as_socket, [0]) ;; From a27b9897f088fc83034522d2fc4a1892263e1b13 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 3 Jun 2000 15:17:45 +0000 Subject: [PATCH 0163/7878] Remove some dependancies that shouldn't be there... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60137 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index ee088964fe9..b69fb82f076 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -121,7 +121,7 @@ abc.o: abc.c $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h client.o: client.c $(INCDIR)/apr_network_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h $(OSDIR)/usr/include/errno.h + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h mod_test.o: mod_test.c server.o: server.c $(INCDIR)/apr_network_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ @@ -149,26 +149,23 @@ testmmap.o: testmmap.c $(INCDIR)/apr_mmap.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_lock.h $(INCDIR)/apr_lib.h testoc.o: testoc.c $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(OSDIR)/usr/include/errno.h + $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h testpipe.o: testpipe.c $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_thread_proc.h testproc.o: testproc.c $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(OSDIR)/usr/include/errno.h + $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h testshmem.o: testshmem.c $(INCDIR)/apr_shmem.h $(INCDIR)/apr.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_lock.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h $(OSDIR)/usr/include/errno.h + $(INCDIR)/apr_thread_proc.h testsock.o: testsock.c $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h testthread.o: testthread.c $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_lock.h \ - $(OSDIR)/usr/include/errno.h + $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_lock.h testtime.o: testtime.c $(INCDIR)/apr_time.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(OSDIR)/usr/include/errno.h + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h From 55622cf88fa1bffbab6520a18ba03c8018d514f2 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 3 Jun 2000 15:27:55 +0000 Subject: [PATCH 0164/7878] BeOS doesn't have a native MMAp, but there the ap_mmap functions have been written and work just fine. This allows us to tell APR that this is the case and have the APR_HAS_MMAP flag set accordingly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60138 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.in b/configure.in index e5292e6f0f7..c9cfe7b64a9 100644 --- a/configure.in +++ b/configure.in @@ -94,6 +94,7 @@ case "$OS" in CFLAGS="$CFLAGS -DBEOS" enable_apr_threads="system_threads" config_subdirs="shmem/unix/mm" + native_mmap_emul="1" ;; *) OSDIR="unix" @@ -407,6 +408,8 @@ echo $ac_n "${nl}Checking for MMAP...${nl}" AC_FUNC_MMAP if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then mmap="1" +elif test "$native_mmap_emul" = "1"; then + mmap="1" else mmap="0" fi From 568746c5b64f10829efca1a5a39c9f8abc726324 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 3 Jun 2000 15:56:00 +0000 Subject: [PATCH 0165/7878] Fix up configure hints for OS/2: - config.guess returns "i386-pc-os2_emx" so test for that. It's uname that returns "OS/2" - CFLAGS, LDFLAGS & LIBS are set just fine by configure without any hints so remove them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60139 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hints.m4 b/hints.m4 index 52b7a676339..8719c8eecaf 100644 --- a/hints.m4 +++ b/hints.m4 @@ -107,10 +107,7 @@ case "$PLAT" in *-dg-dgux*) APR_SETIFNULL(CFLAGS, [-DDGUX]) ;; - *OS/2*) - APR_SETIFNULL(CFLAGS, [-DOS2 -DTCPIPV4 -g -Zmt]) - APR_SETIFNULL(LDFLAGS, [-Zexe -Zmtd -Zsysv-signals -Zbin-files]) - APR_SETIFNULL(LIBS, [-lsocket -lufc -lbsd]) + *os2_emx*) APR_SETIFNULL(SHELL, [sh]) APR_SETIFNULL(file_as_socket, [0]) ;; From ec0649619df8983ff134a653ccbf119593883d2c Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 3 Jun 2000 15:59:38 +0000 Subject: [PATCH 0166/7878] Prevent incorrect generation of dependencies on system header files by using angle brackets instead of quotes in their #includes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60140 13f79535-47bb-0310-9956-ffa450edef68 --- test/client.c | 2 +- test/testoc.c | 2 +- test/testproc.c | 2 +- test/testshmem.c | 2 +- test/testtime.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/client.c b/test/client.c index ab63c1d6ef2..438fa03cf57 100644 --- a/test/client.c +++ b/test/client.c @@ -56,7 +56,7 @@ #include "apr_network_io.h" #include "apr_errno.h" #include "apr_general.h" -#include "errno.h" +#include #define STRLEN 15 diff --git a/test/testoc.c b/test/testoc.c index dbdbfc971e4..170c47c6968 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -56,7 +56,7 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" -#include "errno.h" +#include #include #include #ifdef HAVE_UNISTD_H diff --git a/test/testproc.c b/test/testproc.c index d568d2302ec..29a96f51985 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -56,7 +56,7 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" -#include "errno.h" +#include #ifndef WIN32 #include #endif diff --git a/test/testshmem.c b/test/testshmem.c index 1da1e28f8a7..fc76ec3e9f8 100644 --- a/test/testshmem.c +++ b/test/testshmem.c @@ -57,7 +57,7 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" -#include "errno.h" +#include #include #include /*#include */ diff --git a/test/testtime.c b/test/testtime.c index 05c3c4d77dc..8314259600c 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -55,7 +55,7 @@ #include "apr_time.h" #include "apr_errno.h" #include "apr_general.h" -#include "errno.h" +#include #include #ifdef BEOS #include From 04afb0d5200ba303042eef85cfdf0969b7cf7584 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 3 Jun 2000 17:01:29 +0000 Subject: [PATCH 0167/7878] Fix the ap_dso_error function. Not sure if this is what was intended or not when it was added, but it follows what other implementations do. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60141 13f79535-47bb-0310-9956-ffa450edef68 --- dso/beos/dso.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 76b5d2b9ea1..0eb280bf54d 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -99,9 +99,10 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, return APR_SUCCESS; } -char *ap_dso_error(char *buf, int bufsize, ap_status_t errcode) +char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) { - return strerror(errno); + strncpy(strerror(errno), buffer, buflen); + return buffer; } #endif From ae24eae8452d7bc859fb938ac4c7adfd414cb2b8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 5 Jun 2000 23:14:35 +0000 Subject: [PATCH 0168/7878] Remove the ability to enable/disable DSO support in APR. The only current way to check for DSO support is to look for libdl. Apache automatically adds -ldl to it's LIBS flag from config.m4 in modules/standard. Other platforms will need to add the correct flag for their system. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60143 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/configure.in b/configure.in index c9cfe7b64a9..eb213e13b0e 100644 --- a/configure.in +++ b/configure.in @@ -124,7 +124,6 @@ if test ".$SYS_SW" = ".AIX"; then fi dnl #----------------------------- Checks for Any required Libraries -AC_CHECK_LIB(dl, dlopen) AC_CHECK_LIB(nsl,gethostbyname) AC_CHECK_LIB(nsl,gethostname) AC_CHECK_LIB(socket,socket) @@ -320,17 +319,7 @@ AC_SUBST(off_t_fmt) dnl #----------------------------- Checking for DSO support echo $ac_n "${nl}Checking for DSO...${nl}" -AC_ARG_ENABLE(dso, - [ --enable-dso Enable reliable child processes ], - [ ac_cv_enable_dso=$enableval], - [ AC_CACHE_CHECK([for DSO support], ac_cv_enable_dso, - [ac_cv_enable_dso="yes"] ) ] ) - -if test "$ac_cv_enable_dso" = "no"; then - aprdso="0" -else - aprdso="1" -fi +AC_CHECK_LIB(dl, dlopen, aprdso="1", apr_dso="0") AC_SUBST(aprdso) From 4afde8d3657836625387171e8a8afdb5014777ef Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 5 Jun 2000 23:31:52 +0000 Subject: [PATCH 0169/7878] I've had better thoughts about this. APR needs to be configurable. If Apache doesn't want to use this feature, then fine. However APR should have the ability to be compiled without DSO support. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60144 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index eb213e13b0e..aa61a3d66f0 100644 --- a/configure.in +++ b/configure.in @@ -319,7 +319,16 @@ AC_SUBST(off_t_fmt) dnl #----------------------------- Checking for DSO support echo $ac_n "${nl}Checking for DSO...${nl}" -AC_CHECK_LIB(dl, dlopen, aprdso="1", apr_dso="0") +AC_ARG_ENABLE(dso, + [ --enable-dso Enable reliable child processes ], + [ tempdso=$enableval], + [ AC_CHECK_LIB(dl, dlopen, tempdso="yes", tempdso="no") ] ) + +if test "$tempdso" = "no"; then + aprdso="0" +else + aprdso="1" +fi AC_SUBST(aprdso) From b45510d84dd0ee0b231521fcd4f70429ece3a262 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 6 Jun 2000 00:57:08 +0000 Subject: [PATCH 0170/7878] Fix bad call to ap_pcalloc() in ap_dso_load(); the bug led to a storage overlay as not enough storage was allocated for the ap_dso_handle_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60145 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 2ed08958a98..d6c01c86aca 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -82,7 +82,7 @@ ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, #endif } - *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); + *res_handle = ap_pcalloc(ctx, sizeof(**res_handle)); (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; (*res_handle)->errormsg = NULL; From 312d11a08f819d6381970e0ecdc429e1bd6454fa Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 6 Jun 2000 15:35:51 +0000 Subject: [PATCH 0171/7878] Fix problems introduced as part of the "Convert ap_proc_t to a complete type." change. It is in rarely-compiled code, so probably noone noticed that it was broken. (Now if I could figure out why I'm erroneously getting into that code, I'd be really happy...) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60146 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/procsup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index fb1e51ab7fc..e604238be5c 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -76,17 +76,17 @@ ap_status_t ap_detach(ap_proc_t *new, ap_pool_t *cont) return errno; } #elif defined(NEXT) || defined(NEWSOS) - if (setpgrp(0, getpid()) == -1 || ((*new)->pid = getpgrp(0)) == -1) { + if (setpgrp(0, getpid()) == -1 || (new->pid = getpgrp(0)) == -1) { return errno; } #elif defined(OS2) || defined(TPF) /* OS/2 don't support process group IDs */ - (*new)->pid = getpid(); + new->pid = getpid(); #elif defined(MPE) /* MPE uses negative pid for process group */ - (*new)->pid = -getpid(); + new->pid = -getpid(); #else - if (((*new)->pid = setpgrp(getpid(), 0)) == -1) { + if ((new->pid = setpgrp(getpid(), 0)) == -1) { return errno; } #endif From 4a2787d88a148faec1c695d8cb35662224b34981 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 6 Jun 2000 21:45:11 +0000 Subject: [PATCH 0172/7878] Add the resource limiting code back to Apache 2.0. This only works on Unix because I can't find any other platforms with rlimit. If there are other platforms that need this code, then some of the code needs to move. This has just barely been tested, so it could probably use some good testing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60147 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 18 ++++++++ include/apr.h.in | 1 + include/apr_thread_proc.h | 29 ++++++++++++- include/arch/unix/threadproc.h | 12 ++++++ threadproc/unix/proc.c | 75 ++++++++++++++++++++++++++++++++++ threadproc/unix/threadproc.h | 12 ++++++ 6 files changed, 146 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index aa61a3d66f0..301f743b1e1 100644 --- a/configure.in +++ b/configure.in @@ -401,6 +401,24 @@ AC_ARG_ENABLE(other-child, AC_SUBST(oc) +AC_MSG_CHECKING(struct rlimit) +AC_TRY_RUN([#include +main() +{ + struct rlimit limit; + limit.rlim_cur = 0; + limit.rlim_max = 0; + exit(0); +}], [ + struct_rlimit="1" + AC_MSG_RESULT(yes) ], [ + struct_rlimit="0" + AC_MSG_RESULT(no) ], [ + struct_rlimit="0" + AC_MSG_RESULT(no) ] ) + +AC_SUBST(struct_rlimit) + dnl #----------------------------- Checking for MMAP echo $ac_n "${nl}Checking for MMAP...${nl}" AC_FUNC_MMAP diff --git a/include/apr.h.in b/include/apr.h.in index 1252a052462..c7d3056d390 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -51,6 +51,7 @@ #define APR_HAVE_INET_ADDR @inet_addr@ #define APR_HAVE_INET_NETWORK @inet_network@ #define APR_HAVE_UNION_SEMUN @have_union_semun@ +#define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@ #if APR_HAVE_SYS_TYPES_H #include diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index bcf3b50132e..35e06f78d03 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -58,6 +58,9 @@ #include "apr_file_io.h" #include "apr_general.h" #include "apr_errno.h" +#if APR_HAVE_STRUCT_RLIMIT +#include +#endif #ifdef __cplusplus extern "C" { @@ -72,6 +75,10 @@ typedef enum {APR_WAIT, APR_NOWAIT} ap_wait_how_e; #define APR_PARENT_BLOCK 3 #define APR_CHILD_BLOCK 4 +#define APR_LIMIT_CPU 0 +#define APR_LIMIT_MEM 1 +#define APR_LIMIT_NPROC 2 + #if APR_HAS_OTHER_CHILD #define APR_OC_REASON_DEATH 0 /* child has died, caller must call * unregister still */ @@ -332,7 +339,7 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont); /* -=head1 ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, ap_int32_t *out, ap_int32_t err) +=head1 ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, ap_int32_t out, ap_int32_t err) B @@ -453,6 +460,26 @@ B */ ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach); +#if APR_HAVE_STRUCT_RLIMIT +/* + +=head1 ap_status_t ap_setprocattr_limit(ap_procattr_t *attr, ap_int32_t what, struct rlimit *limit) + +B + + arg 1) The procattr we care about. + arg 2) Which limit to set, one of: + APR_LIMIT_CPU + APR_LIMIT_MEM + APR_LIMIT_NPROC + arg 3) Value to set the limit to. + +=cut + */ +ap_status_t ap_setprocattr_limit(ap_procattr_t *attr, ap_int32_t what, + struct rlimit *limit); +#endif + #if APR_HAS_FORK /* diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index 0fdb6119eff..07c97b966dd 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -61,6 +61,9 @@ #if HAVE_PTHREAD_H #include #endif +#if HAVE_SYS_RESOURCE_H +#include +#endif #if HAVE_SIGNAL_H #include #endif @@ -109,6 +112,15 @@ struct ap_procattr_t { char *currdir; ap_int32_t cmdtype; ap_int32_t detached; +#ifdef RLIMIT_CPU + struct rlimit *limit_cpu; +#endif +#if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS) + struct rlimit *limit_mem; +#endif +#ifdef RLIMIT_NPROC + struct rlimit *limit_nproc; +#endif }; /*This will move to ap_threadproc.h in time, but I need to figure it out diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 9175585a309..c74fdc0d6e0 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -212,6 +212,48 @@ ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) return APR_INPARENT; } +#if APR_HAVE_STRUCT_RLIMIT +#if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) +static ap_status_t limit_proc(ap_procattr_t *attr) +{ +#ifdef RLIMIT_CPU + if (attr->limit_cpu != NULL) { + if ((setrlimit(RLIMIT_CPU, attr->limit_cpu)) != 0) { + return errno; + } + } +#endif +#ifdef RLIMIT_NPROC + if (attr->limit_nproc != NULL) { + if ((setrlimit(RLIMIT_NPROC, attr->limit_nproc)) != 0) { + return errno; + } + } +#endif +#if defined(RLIMIT_AS) + if (attr->limit_mem != NULL) { + if ((setrlimit(RLIMIT_AS, attr->limit_mem)) != 0) { + return errno; + } + } +#elif defined(RLIMIT_DATA) + if (attr->limit_mem != NULL) { + if ((setrlimit(RLIMIT_DATA, attr->limit_mem)) != 0) { + return errno; + } + } +#elif defined(RLIMIT_VMEM) + if (attr->limit_mem != NULL) { + if ((setrlimit(RLIMIT_VMEM, attr->limit_mem)) != 0) { + return errno; + } + } +#endif + return APR_SUCCESS; +} +#endif +#endif + ap_status_t ap_create_process(ap_proc_t *new, const char *progname, char *const args[], char **env, ap_procattr_t *attr, ap_pool_t *cont) @@ -228,6 +270,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, return errno; } else if (new->pid == 0) { + int status; /* child process */ if (attr->child_in) { ap_close(attr->parent_in); @@ -255,6 +298,12 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, ap_cleanup_for_exec(); +#if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) + if ((status = limit_proc(attr)) != APR_SUCCESS) { + return status; + } +#endif + if (attr->cmdtype == APR_SHELLCMD) { i = 0; while (args[i]) { @@ -338,3 +387,29 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, } return errno; } + +ap_status_t ap_setprocattr_limit(ap_procattr_t *attr, ap_int32_t what, + struct rlimit *limit) +{ + switch(what) { + case APR_LIMIT_CPU: +#ifdef RLIMIT_CPU + attr->limit_cpu = limit; +#else + return APR_ENOTIMPL; +#endif + case APR_LIMIT_MEM: +#if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS) + attr->limit_mem = limit; +#else + return APR_ENOTIMPL; +#endif + case APR_LIMIT_NPROC: +#ifdef RLIMIT_NPROC + attr->limit_nproc = limit; +#else + return APR_ENOTIMPL; +#endif + } + return APR_SUCCESS; +} diff --git a/threadproc/unix/threadproc.h b/threadproc/unix/threadproc.h index 0fdb6119eff..07c97b966dd 100644 --- a/threadproc/unix/threadproc.h +++ b/threadproc/unix/threadproc.h @@ -61,6 +61,9 @@ #if HAVE_PTHREAD_H #include #endif +#if HAVE_SYS_RESOURCE_H +#include +#endif #if HAVE_SIGNAL_H #include #endif @@ -109,6 +112,15 @@ struct ap_procattr_t { char *currdir; ap_int32_t cmdtype; ap_int32_t detached; +#ifdef RLIMIT_CPU + struct rlimit *limit_cpu; +#endif +#if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS) + struct rlimit *limit_mem; +#endif +#ifdef RLIMIT_NPROC + struct rlimit *limit_nproc; +#endif }; /*This will move to ap_threadproc.h in time, but I need to figure it out From a531b053c9103a2bc694336cf12aee7da0bff87c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 7 Jun 2000 12:36:51 +0000 Subject: [PATCH 0173/7878] Change the mmap() feature test to check only for existence. The autoconf-provided check used previously fails when the platform doesn't support MAP_FIXED. Apache doesn't use that mmap() feature, so we don't want to require it. Submitted by: Greg Ames git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60148 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/configure.in b/configure.in index 301f743b1e1..0153c7decda 100644 --- a/configure.in +++ b/configure.in @@ -144,6 +144,10 @@ AC_CHECK_FUNC(inet_network, [ inet_network="1" ], [ inet_network="0" ]) AC_CHECK_FUNC(_getch) AC_CHECK_FUNCS(gmtime_r localtime_r) AC_CHECK_FUNCS(iconv, [ iconv="1" ], [ iconv="0" ]) +AC_CHECK_FUNCS(mmap, [ mmap="1" ], [ mmap="0" ]) +if test "$native_mmap_emul" = "1"; then + mmap="1" +fi AC_CHECK_FUNCS(hstrerror) AC_SUBST(sendfile) AC_SUBST(fork) @@ -151,7 +155,7 @@ AC_SUBST(inet_addr) AC_SUBST(inet_network) AC_SUBST(have_sigaction) AC_SUBST(iconv) - +AC_SUBST(mmap) dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC @@ -419,18 +423,6 @@ main() AC_SUBST(struct_rlimit) -dnl #----------------------------- Checking for MMAP -echo $ac_n "${nl}Checking for MMAP...${nl}" -AC_FUNC_MMAP -if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then - mmap="1" -elif test "$native_mmap_emul" = "1"; then - mmap="1" -else - mmap="0" -fi -AC_SUBST(mmap) - dnl #----------------------------- Checking for Locking Characteristics echo $ac_n "${nl}Checking for Locking..." From 08391581b1c4a94f1884e890aa3c38a1a68b538e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 7 Jun 2000 22:32:51 +0000 Subject: [PATCH 0174/7878] We don't actually use anything in atime.h, so get rid of it, and include all of the headers in the .c files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60149 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/Makefile.in | 4 +-- time/unix/atime.h | 80 ------------------------------------------- time/unix/time.c | 12 ++++++- time/unix/timestr.c | 14 ++++++-- 4 files changed, 25 insertions(+), 85 deletions(-) delete mode 100644 time/unix/atime.h diff --git a/time/unix/Makefile.in b/time/unix/Makefile.in index fcab84a7761..cdfe91da154 100644 --- a/time/unix/Makefile.in +++ b/time/unix/Makefile.in @@ -49,13 +49,13 @@ depend: && rm Makefile.new # DO NOT REMOVE -time.o: time.c atime.h $(INCDIR)/apr_private.h \ +time.o: time.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ $(INCDIR)/apr_lock.h -timestr.o: timestr.c atime.h $(INCDIR)/apr_private.h \ +timestr.o: timestr.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_thread_proc.h \ diff --git a/time/unix/atime.h b/time/unix/atime.h deleted file mode 100644 index f22167486e5..00000000000 --- a/time/unix/atime.h +++ /dev/null @@ -1,80 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef ATIME_H -#define ATIME_H - -#include "apr_private.h" -#include "apr_time.h" -#include "apr_lib.h" - -/* System Headers required for time library */ -#if HAVE_SYS_TIME_H -#include -#endif -#if HAVE_TIME_H -#include -#endif -/* End System Headers */ - -struct atime_t { - ap_pool_t *cntxt; - struct timeval *currtime; - struct tm *explodedtime; - int time_ex; /* have we already exploded the time? */ -}; - - -#endif /* ! ATIME_H */ - diff --git a/time/unix/time.c b/time/unix/time.c index bbd0dd31261..20344ac4777 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -52,8 +52,18 @@ * . */ -#include "atime.h" #include "apr_portable.h" +#include "apr_time.h" +#include "apr_lib.h" +/* System Headers required for time library */ +#if HAVE_SYS_TIME_H +#include +#endif +#if HAVE_TIME_H +#include +#endif +/* End System Headers */ + ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input) { diff --git a/time/unix/timestr.c b/time/unix/timestr.c index aa65f534fc4..9b9cb9b4afb 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -52,10 +52,20 @@ * . */ -#include "atime.h" #include "apr_portable.h" - +#include "apr_time.h" +#include "apr_lib.h" +/* System Headers required for time library */ +#if HAVE_SYS_TIME_H +#include +#endif +#if HAVE_TIME_H +#include +#endif +#if HAVE_STRING_H #include +#endif +/* End System Headers */ APR_VAR_EXPORT const char ap_month_snames[12][4] = { From fdf89c11eeff3a93b4a528ffc137057dc79b7fdd Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 7 Jun 2000 23:23:51 +0000 Subject: [PATCH 0175/7878] Add a new ap_sleep function for apr. This basically sleeps for a specified number of microseconds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60150 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 14 ++++++++++++++ time/unix/time.c | 8 +++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/include/apr_time.h b/include/apr_time.h index 02e12e0ce6f..fe5f5633d4d 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -163,6 +163,20 @@ B + + arg 1) desired amount of time to sleep. + +B: May sleep for longer than the specified time. + +=cut + */ +void ap_sleep(ap_time_t t); + /* ap_rfc822_date formats dates in the RFC822 format in an efficient manner. it is a fixed length format and requires the indicated amount of storage diff --git a/time/unix/time.c b/time/unix/time.c index 20344ac4777..05bed702688 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -247,7 +247,13 @@ ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, return APR_SUCCESS; } - +void ap_sleep(ap_time_t t) +{ + struct timeval tv; + tv.tv_usec = t % AP_USEC_PER_SEC; + tv.tv_sec = t / AP_USEC_PER_SEC; + select(0, NULL, NULL, NULL, &tv); +} #ifdef OS2 #define INCL_DOS From f46b2477b6e6fde623065f983c677bd81b8b9a1b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 7 Jun 2000 23:56:15 +0000 Subject: [PATCH 0176/7878] Both of these need apr_private.h in order to include the correct headers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60151 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 4 ++++ time/unix/timestr.c | 1 + 2 files changed, 5 insertions(+) diff --git a/time/unix/time.c b/time/unix/time.c index 05bed702688..b82a2490f0f 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -55,10 +55,14 @@ #include "apr_portable.h" #include "apr_time.h" #include "apr_lib.h" +#include "apr_private.h" /* System Headers required for time library */ #if HAVE_SYS_TIME_H #include #endif +#if HAVE_UNISTD_H +#include +#endif #if HAVE_TIME_H #include #endif diff --git a/time/unix/timestr.c b/time/unix/timestr.c index 9b9cb9b4afb..e64766c66bf 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -55,6 +55,7 @@ #include "apr_portable.h" #include "apr_time.h" #include "apr_lib.h" +#include "apr_private.h" /* System Headers required for time library */ #if HAVE_SYS_TIME_H #include From 9a7ea5c9517bf548bdd7b49c43895dc3cc64a057 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 8 Jun 2000 00:05:14 +0000 Subject: [PATCH 0177/7878] Change ap_time_t to ap_interval_time_t for ap_sleep. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60152 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 4 ++-- time/unix/time.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_time.h b/include/apr_time.h index fe5f5633d4d..218553072c2 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -165,7 +165,7 @@ ap_status_t ap_implode_time(ap_time_t *result, ap_exploded_time_t *input); /* -=head1 void ap_sleep(ap_time_t t) +=head1 void ap_sleep(ap_interval_time_t t) B @@ -175,7 +175,7 @@ B: May sleep for longer than the specified time. =cut */ -void ap_sleep(ap_time_t t); +void ap_sleep(ap_interval_time_t t); /* ap_rfc822_date formats dates in the RFC822 format in an efficient manner. it is a fixed length diff --git a/time/unix/time.c b/time/unix/time.c index b82a2490f0f..52733d3abf7 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -251,7 +251,7 @@ ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, return APR_SUCCESS; } -void ap_sleep(ap_time_t t) +void ap_sleep(ap_interval_time_t t) { struct timeval tv; tv.tv_usec = t % AP_USEC_PER_SEC; From e1d4e2d78ec0b3b3076f3f0cfe1ad666e89c98cb Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 8 Jun 2000 19:29:39 +0000 Subject: [PATCH 0178/7878] Cleanup APR header files a bit. Basically, this splits ap_table_t related functions into their own header file, away from apr_pools.h. At the same time as I was doing this, I removed a couple of definitions that aren't used anywhere anymore, like ap_child_info_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60153 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 89 +---------------------- include/apr_pools.h | 30 -------- include/apr_tables.h | 167 +++++++++++++++++++++++++++++++++++++++++++ lib/apr_tables.c | 1 + 4 files changed, 169 insertions(+), 118 deletions(-) create mode 100644 include/apr_tables.h diff --git a/include/apr_lib.h b/include/apr_lib.h index f706756406f..5c3960f8385 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -56,6 +56,7 @@ #define APR_LIB_H #include "apr_general.h" +#include "apr_tables.h" #include "apr_file_io.h" #include "apr_thread_proc.h" @@ -76,37 +77,6 @@ extern "C" { * Define the structures used by the APR general-purpose library. */ -/* - * Memory allocation stuff, like pools, arrays, and tables. Pools - * and tables are opaque structures to applications, but arrays are - * published. - */ -typedef struct ap_table_t ap_table_t; -typedef struct ap_child_info_t ap_child_info_t; -typedef void ap_mutex_t; -typedef struct ap_array_header_t { - ap_pool_t *cont; - int elt_size; - int nelts; - int nalloc; - char *elts; -} ap_array_header_t; - -typedef struct ap_table_entry_t { - char *key; /* maybe NULL in future; - * check when iterating thru table_elts - */ - char *val; -} ap_table_entry_t; - -/* XXX: these know about the definition of struct ap_table_t in alloc.c. That - * definition is not here because it is supposed to be private, and by not - * placing it here we are able to get compile-time diagnostics from modules - * written which assume that a ap_table_t is the same as an ap_array_header_t. -djg - */ -#define ap_table_elts(t) ((ap_array_header_t *)(t)) -#define ap_is_empty_table(t) (((t) == NULL)||(((ap_array_header_t *)(t))->nelts == 0)) - /* * Structure used by the variable-formatter routines. */ @@ -139,10 +109,6 @@ APR_EXPORT_NONSTD(ap_status_t) ap_execle(const char *c, const char *a, ...); APR_EXPORT_NONSTD(ap_status_t) ap_execve(const char *c, const char *argv[], const char *envp[]); -#define ap_create_mutex(x) (0) -#define ap_release_mutex(x) (0) -#define ap_acquire_mutex(x) (0) - /* These macros allow correct support of 8-bit characters on systems which * support 8-bit characters. Pretty dumb how the cast is required, but * that's legacy libc for ya. These new macros do not support EOF like @@ -162,9 +128,6 @@ APR_EXPORT_NONSTD(ap_status_t) ap_execve(const char *c, const char *argv[], #define ap_tolower(c) (tolower(((unsigned char)(c)))) #define ap_toupper(c) (toupper(((unsigned char)(c)))) - - - /* * Small utility macros to make things easier to read. Not usually a * goal, to be sure.. @@ -292,50 +255,6 @@ APR_EXPORT(char *) ap_pstrndup(struct ap_pool_t *p, const char *s, int n); APR_EXPORT_NONSTD(char *) ap_pstrcat(struct ap_pool_t *p, ...); APR_EXPORT(char *) ap_pvsprintf(struct ap_pool_t *p, const char *fmt, va_list ap); APR_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *p, const char *fmt, ...); -APR_EXPORT(ap_array_header_t *) ap_make_array(struct ap_pool_t *p, int nelts, - int elt_size); -APR_EXPORT(void *) ap_push_array(ap_array_header_t *arr); -APR_EXPORT(void) ap_array_cat(ap_array_header_t *dst, - const ap_array_header_t *src); -APR_EXPORT(ap_array_header_t *) ap_copy_array(struct ap_pool_t *p, - const ap_array_header_t *arr); -APR_EXPORT(ap_array_header_t *) - ap_copy_array_hdr(struct ap_pool_t *p, - const ap_array_header_t *arr); -APR_EXPORT(ap_array_header_t *) - ap_append_arrays(struct ap_pool_t *p, - const ap_array_header_t *first, - const ap_array_header_t *second); -APR_EXPORT(char *) ap_array_pstrcat(struct ap_pool_t *p, - const ap_array_header_t *arr, - const char sep); -APR_EXPORT(ap_table_t *) ap_make_table(struct ap_pool_t *p, int nelts); -APR_EXPORT(ap_table_t *) ap_copy_table(struct ap_pool_t *p, const ap_table_t *t); -APR_EXPORT(void) ap_clear_table(ap_table_t *t); -APR_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key); -APR_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, - const char *val); -APR_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, - const char *val); -APR_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key); -APR_EXPORT(void) ap_table_merge(ap_table_t *t, const char *key, - const char *val); -APR_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, - const char *val); -APR_EXPORT(void) ap_table_add(ap_table_t *t, const char *key, - const char *val); -APR_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, - const char *val); -APR_EXPORT(ap_table_t *) ap_overlay_tables(struct ap_pool_t *p, - const ap_table_t *overlay, - const ap_table_t *base); -APR_EXPORT(void) - ap_table_do(int (*comp) (void *, const char *, const char *), - void *rec, const ap_table_t *t, ...); -#define AP_OVERLAP_TABLES_SET (0) -#define AP_OVERLAP_TABLES_MERGE (1) -APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, - unsigned flags); APR_EXPORT(void) ap_register_cleanup(struct ap_pool_t *p, void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)); @@ -349,12 +268,6 @@ APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data); APR_EXPORT(void) ap_note_subprocess(struct ap_pool_t *a, ap_proc_t *pid, enum kill_conditions how); -APR_EXPORT(int) - ap_spawn_child(ap_pool_t *p, - int (*func) (void *a, ap_child_info_t *c), - void *data, enum kill_conditions kill_how, - FILE **pipe_in, FILE **pipe_out, - FILE **pipe_err); APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size); diff --git a/include/apr_pools.h b/include/apr_pools.h index 5d46ba8b8f6..9a2fb5fd293 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -92,28 +92,6 @@ struct process_chain { struct process_chain *next; }; -struct ap_table_t { - /* This has to be first to promote backwards compatibility with - * older modules which cast a ap_table_t * to an ap_array_header_t *... - * they should use the table_elts() function for most of the - * cases they do this for. - */ - ap_array_header_t a; -#ifdef MAKE_TABLE_PROFILE - void *creator; -#endif -}; - -/* - * Tables. Implemented alist style, for now, though we try to keep - * it so that imposing a hash table structure on top in the future - * wouldn't be *too* hard... - * - * Note that key comparisons for these are case-insensitive, largely - * because that's what's appropriate and convenient everywhere they're - * currently being used... - */ - ap_status_t ap_init_alloc(void); /* Set up everything */ void ap_term_alloc(void); /* Tear down everything */ @@ -214,14 +192,6 @@ extern int raise_sigstop_flags; -/* XXX: these know about the definition of struct ap_table_t in alloc.c. That - * definition is not here because it is supposed to be private, and by not - * placing it here we are able to get compile-time diagnostics from modules - * written which assume that a ap_table_t is the same as an ap_array_header_t. -djg - */ -#define ap_table_elts(t) ((ap_array_header_t *)(t)) -#define ap_is_empty_table(t) (((t) == NULL)||(((ap_array_header_t *)(t))->nelts == 0)) - /* magic numbers --- min free bytes to consider a free ap_pool_t block useable, * and the min amount to allocate if we have to go to malloc() */ diff --git a/include/apr_tables.h b/include/apr_tables.h new file mode 100644 index 00000000000..a9e7058e458 --- /dev/null +++ b/include/apr_tables.h @@ -0,0 +1,167 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_TABLES_H +#define APR_TABLES_H + +#include "apr_general.h" +#include "apr_file_io.h" +#include "apr_thread_proc.h" + +#if APR_HAVE_STDARG_H +#include +#endif +#if APR_HAVE_SYS_TYPES_H +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + * Define the structures used by the APR general-purpose library. + */ + +/* + * Memory allocation stuff, like pools, arrays, and tables. Pools + * and tables are opaque structures to applications, but arrays are + * published. + */ +typedef struct ap_table_t ap_table_t; +typedef struct ap_array_header_t { + ap_pool_t *cont; + int elt_size; + int nelts; + int nalloc; + char *elts; +} ap_array_header_t; + +struct ap_table_t { + /* This has to be first to promote backwards compatibility with + * older modules which cast a ap_table_t * to an ap_array_header_t *... + * they should use the table_elts() function for most of the + * cases they do this for. + */ + ap_array_header_t a; +#ifdef MAKE_TABLE_PROFILE + void *creator; +#endif +}; + +typedef struct ap_table_entry_t { + char *key; /* maybe NULL in future; + * check when iterating thru table_elts + */ + char *val; +} ap_table_entry_t; + +/* XXX: these know about the definition of struct ap_table_t in alloc.c. That + * definition is not here because it is supposed to be private, and by not + * placing it here we are able to get compile-time diagnostics from modules + * written which assume that a ap_table_t is the same as an ap_array_header_t. -djg + */ +#define ap_table_elts(t) ((ap_array_header_t *)(t)) +#define ap_is_empty_table(t) (((t) == NULL)||(((ap_array_header_t *)(t))->nelts == 0)) + +APR_EXPORT(ap_array_header_t *) ap_make_array(struct ap_pool_t *p, int nelts, + int elt_size); +APR_EXPORT(void *) ap_push_array(ap_array_header_t *arr); +APR_EXPORT(void) ap_array_cat(ap_array_header_t *dst, + const ap_array_header_t *src); +APR_EXPORT(ap_array_header_t *) ap_copy_array(struct ap_pool_t *p, + const ap_array_header_t *arr); +APR_EXPORT(ap_array_header_t *) + ap_copy_array_hdr(struct ap_pool_t *p, + const ap_array_header_t *arr); +APR_EXPORT(ap_array_header_t *) + ap_append_arrays(struct ap_pool_t *p, + const ap_array_header_t *first, + const ap_array_header_t *second); +APR_EXPORT(char *) ap_array_pstrcat(struct ap_pool_t *p, + const ap_array_header_t *arr, + const char sep); +APR_EXPORT(ap_table_t *) ap_make_table(struct ap_pool_t *p, int nelts); +APR_EXPORT(ap_table_t *) ap_copy_table(struct ap_pool_t *p, const ap_table_t *t); +APR_EXPORT(void) ap_clear_table(ap_table_t *t); +APR_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key); +APR_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, + const char *val); +APR_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, + const char *val); +APR_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key); +APR_EXPORT(void) ap_table_merge(ap_table_t *t, const char *key, + const char *val); +APR_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, + const char *val); +APR_EXPORT(void) ap_table_add(ap_table_t *t, const char *key, + const char *val); +APR_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, + const char *val); +APR_EXPORT(ap_table_t *) ap_overlay_tables(struct ap_pool_t *p, + const ap_table_t *overlay, + const ap_table_t *base); +APR_EXPORT(void) + ap_table_do(int (*comp) (void *, const char *, const char *), + void *rec, const ap_table_t *t, ...); +#define AP_OVERLAP_TABLES_SET (0) +#define AP_OVERLAP_TABLES_MERGE (1) +APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, + unsigned flags); + +#ifdef __cplusplus +} +#endif + +#endif /* ! APR_TABLES_H */ diff --git a/lib/apr_tables.c b/lib/apr_tables.c index b42b1d6ceef..1bb5c363aa5 100644 --- a/lib/apr_tables.c +++ b/lib/apr_tables.c @@ -63,6 +63,7 @@ #include "apr_general.h" #include "apr_pools.h" +#include "apr_tables.h" #include "apr_lib.h" #include "misc.h" #ifdef HAVE_STDLIB_H From d9cc01f5ee09f1de67fec35f6cab20b34a2a1361 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 8 Jun 2000 20:34:13 +0000 Subject: [PATCH 0179/7878] Remove some Apache-centric definitions from APR's header files. This is really just more cleanup of the stuff moved from 1.3 to APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60154 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 9a2fb5fd293..1161c6ca148 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -159,25 +159,6 @@ APR_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *, const char *fmt, ...) #define ap_OVERLAP_TABLES_SET (0) #define ap_OVERLAP_TABLES_MERGE (1) -/* A set of flags which indicate places where the server should raise(SIGSTOP). - * This is useful for debugging, because you can then attach to that process - * with gdb and continue. This is important in cases where one_process - * debugging isn't possible. - */ -#define SIGSTOP_DETACH 1 -#define SIGSTOP_MAKE_CHILD 2 #define SIGSTOP_SPAWN_CHILD 4 -#define SIGSTOP_PIPED_LOG_SPAWN 8 -#define SIGSTOP_CGI_CHILD 16 - -#ifdef DEBUG_SIGSTOP -extern int raise_sigstop_flags; -#define RAISE_SIGSTOP(x) do { \ - if (raise_sigstop_flags & SIGSTOP_##x) raise(SIGSTOP);\ - } while (0) -#else -#define RAISE_SIGSTOP(x) -#endif - #ifdef ULTRIX_BRAIN_DEATH #define ap_fdopen(d,m) fdopen((d), (char *)(m)) #else From af7fac5da182a63d75537add37067e4a56b234d0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 9 Jun 2000 21:19:50 +0000 Subject: [PATCH 0180/7878] Remove a bunch of string functions from Apache. These are basically standard string functions like strstr, strcasecmp, etc that Apache used to define for platforms that don't have them. These functions and the feature tests have moved down to APR where they really belong. In doing this, I am also able to remove a bunch of tests from the Apache configure process. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60155 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 15 ++++++++ include/apr.h.in | 6 +++ include/apr_general.h | 16 ++++++++ lib/apr_cpystrn.c | 86 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 123 insertions(+) diff --git a/configure.in b/configure.in index 0153c7decda..836bbe745cb 100644 --- a/configure.in +++ b/configure.in @@ -321,6 +321,21 @@ AC_SUBST(ssize_t_value) AC_SUBST(ssize_t_fmt) AC_SUBST(off_t_fmt) +dnl #----------------------------- Checking for string functions +AC_CHECK_FUNCS(strnicmp, have_strnicmp="1", have_strnicmp="0") +AC_CHECK_FUNCS(strncasecmp, have_strncasecmp="1", have_strncasecmp="0") +AC_CHECK_FUNCS(stricmp, have_stricmp="1", have_stricmp="0") +AC_CHECK_FUNCS(strcasecmp, have_strcasecmp="1", have_strcasecmp="0") +AC_CHECK_FUNCS(strdup, have_strdup="1", have_strdup="0") +AC_CHECK_FUNCS(strstr, have_strstr="1", have_strstr="0") + +AC_SUBST(have_strnicmp) +AC_SUBST(have_strncasecmp) +AC_SUBST(have_stricmp) +AC_SUBST(have_strcasecmp) +AC_SUBST(have_strdup) +AC_SUBST(have_strstr) + dnl #----------------------------- Checking for DSO support echo $ac_n "${nl}Checking for DSO...${nl}" AC_ARG_ENABLE(dso, diff --git a/include/apr.h.in b/include/apr.h.in index c7d3056d390..3e83b1100f1 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -52,6 +52,12 @@ #define APR_HAVE_INET_NETWORK @inet_network@ #define APR_HAVE_UNION_SEMUN @have_union_semun@ #define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@ +#define APR_HAVE_STRICMP @have_strcasecmp@ +#define APR_HAVE_STRNICMP @have_strncasecmp@ +#define APR_HAVE_STRCASECMP @have_strcasecmp@ +#define APR_HAVE_STRNCASECMP @have_strncasecmp@ +#define APR_HAVE_STRDUP @have_strdup@ +#define APR_HAVE_STRSTR @have_strstr@ #if APR_HAVE_SYS_TYPES_H #include diff --git a/include/apr_general.h b/include/apr_general.h index 6d8917599d5..f25079e158a 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -215,6 +215,22 @@ typedef int ap_signum_t; #define XtOffsetOf(s_type,field) XtOffset(s_type*,field) #endif +/* A couple of prototypes for functions in case some platform doesn't + * have it + */ +#if (!APR_HAVE_STRCASECMP) && (APR_HAVE_STRICMP) +#define strcasecmp(s1, s2) stricmp(s1, s2) +#elif (!APR_HAVE_STRCASECMP) +int strcasecmp(const char *a, const char *b); +#endif + +#if (!APR_HAVE_STRNCASECMP) && (APR_HAVE_STRNICMP) +#define strncasecmp(s1, s2) strnicmp(s1, s2) +#elif (!APR_HAVE_STRNCASECMP) +int strncasecmp(const char *a, const char *b, size_t n); +#endif + + #if APR_HAS_RANDOM /* diff --git a/lib/apr_cpystrn.c b/lib/apr_cpystrn.c index 2245d53b9fd..3a15f393973 100644 --- a/lib/apr_cpystrn.c +++ b/lib/apr_cpystrn.c @@ -242,3 +242,89 @@ APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src) *dest = 0; return (dest); } + +#ifndef HAVE_STRDUP +char *strdup(const char *str) +{ + char *sdup; + if (!(sdup = (char *) malloc(strlen(str) + 1))) { + ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Ouch! + Out of memory in our strdup()!"); + return NULL; + } + sdup = strcpy(sdup, str); + + return sdup; +} +#endif + +/* The following two routines were donated for SVR4 by Andreas Vogel */ +#ifndef HAVE_STRCASECMP +int strcasecmp(const char *a, const char *b) +{ + const char *p = a; + const char *q = b; + for (p = a, q = b; *p && *q; p++, q++) { + int diff = ap_tolower(*p) - ap_tolower(*q); + if (diff) + return diff; + } + if (*p) + return 1; /* p was longer than q */ + if (*q) + return -1; /* p was shorter than q */ + return 0; /* Exact match */ +} + +#endif + +#ifndef HAVE_STRNCASECMP +int strncasecmp(const char *a, const char *b, size_t n) +{ + const char *p = a; + const char *q = b; + + for (p = a, q = b; /*NOTHING */ ; p++, q++) { + int diff; + if (p == a + n) + return 0; /* Match up to n characters */ + if (!(*p && *q)) + return *p - *q; + diff = ap_tolower(*p) - ap_tolower(*q); + if (diff) + return diff; + } + /*NOTREACHED */ +} +#endif + +/* The following routine was donated for UTS21 by dwd@bell-labs.com */ +#ifndef HAVE_STRSTR +char *strstr(char *s1, char *s2) +{ + char *p1, *p2; + if (*s2 == '\0') { + /* an empty s2 */ + return(s1); + } + while((s1 = strchr(s1, *s2)) != NULL) { + /* found first character of s2, see if the rest matches */ + p1 = s1; + p2 = s2; + while (*++p1 == *++p2) { + if (*p1 == '\0') { + /* both strings ended together */ + return(s1); + } + } + if (*p2 == '\0') { + /* second string ended, a match */ + break; + } + /* didn't find a match here, try starting at next character in s1 */ + s1++; + } + return(s1); +} +#endif + From f98564fb3cc54bd5e98d364bb84b45449a150967 Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" Date: Fri, 9 Jun 2000 21:24:27 +0000 Subject: [PATCH 0181/7878] Catch fname length = MAX_PATH since for some strange reason Win32 returns PATH_NOT_FOUND and that's not what we want. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60156 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 861f12b32e3..0bba47a00b0 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -139,7 +139,16 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) memset(finfo,'\0', sizeof(*finfo)); - if (!ap_get_oslevel(cont, &os_level) && os_level >= APR_WIN_98) { + /* We need to catch the case where fname length == MAX_PATH since for + * some strange reason GetFileAttributesEx fails with PATH_NOT_FOUND. + * We would rather indicate length error than 'not found' + * since in many cases the apr user is testing for 'not found' + * and this is not such a case. + */ + if (strlen(fname) >= MAX_PATH) { + rv = ERROR_FILENAME_EXCED_RANGE; + } + else if (!ap_get_oslevel(cont, &os_level) && os_level >= APR_WIN_98) { if (!GetFileAttributesEx(fname, GetFileExInfoStandard, (WIN32_FILE_ATTRIBUTE_DATA*) &FileInformation)) { rv = GetLastError(); From 106e76e2f6c31563791fb4b2a3c0933605e2f5fc Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 9 Jun 2000 22:05:36 +0000 Subject: [PATCH 0182/7878] Remove waitpid from the config checks and all calls to waitpid from the server. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60157 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +++ threadproc/unix/procsup.c | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/configure.in b/configure.in index 836bbe745cb..3d12c423dfb 100644 --- a/configure.in +++ b/configure.in @@ -409,6 +409,9 @@ AC_SUBST(threads) dnl #----------------------------- Checking for Processes echo $ac_n "${nl}Checking for Processes...${nl}" + +AC_CHECK_FUNCS(waitpid) + AC_ARG_ENABLE(other-child, [ --enable-other-child Enable reliable child processes ], [ if test "$enableval" = "yes"; then diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index e604238be5c..b848fe9a56c 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -112,3 +112,24 @@ ap_status_t ap_detach(ap_proc_t *new, ap_pool_t *cont) } return APR_SUCCESS; } + +#if (!HAVE_WAITPID) +/* From ikluft@amdahl.com + * this is not ideal but it works for SVR3 variants + * Modified by dwd@bell-labs.com to call wait3 instead of wait because + * apache started to use the WNOHANG option. + */ +int waitpid(pid_t pid, int *statusp, int options) +{ + int tmp_pid; + if (kill(pid, 0) == -1) { + errno = ECHILD; + return -1; + } + while (((tmp_pid = wait3(statusp, options, 0)) != pid) && + (tmp_pid != -1) && (tmp_pid != 0) && (pid != -1)) + ; + return tmp_pid; +} +#endif + From 8d834e50f52d14c8ceaaf7b67fe625d909848b0a Mon Sep 17 00:00:00 2001 From: dgaudet Date: Sat, 10 Jun 2000 00:44:46 +0000 Subject: [PATCH 0183/7878] fix a typo and add a pointer in comments so folks know where to find out what ap_canonical_error does. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60158 13f79535-47bb-0310-9956-ffa450edef68 --- APRDesign | 4 ++-- include/apr_errno.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/APRDesign b/APRDesign index 905f94568bb..2a5ffa6b43e 100644 --- a/APRDesign +++ b/APRDesign @@ -254,7 +254,7 @@ APR_OS_START_SYSERR, those codes are reserved for APR applications. To programmatically correct an error in a running application, the error codes need to be consistent across platforms. This should make sense. To get -consistent error codes, APR provides a function ap_canonicalize_error(). +consistent error codes, APR provides a function ap_canonical_error(). This function will take as input any ap_status_t value, and return a small subset of canonical APR error codes. These codes will be equivalent to Unix errno's. Why is it a small subset? Because we don't want to try to @@ -303,7 +303,7 @@ Using option 2: make syscall that fails return error code - convert to common error code (using ap_canonicalize_error) + convert to common error code (using ap_canonical_error) decide execution based on common error code Finally, there is one more operation on error codes. You can get a string diff --git a/include/apr_errno.h b/include/apr_errno.h index c93efa22c79..059b5553387 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -64,6 +64,9 @@ extern "C" { typedef int ap_status_t; +/* see lib/apr/APRDesign for why this inane function needs to be used + * everywhere. + */ int ap_canonical_error(ap_status_t err); From 67043329824d5c29b6d7d932b7d3f4bb1cc3eb99 Mon Sep 17 00:00:00 2001 From: dgaudet Date: Sat, 10 Jun 2000 01:41:06 +0000 Subject: [PATCH 0184/7878] don't seek when setting up an mmap PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60159 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/mmap.c | 5 +++-- mmap/unix/mmap.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/arch/unix/mmap.c b/include/arch/unix/mmap.c index 504970a7efd..a4800ddbb3f 100644 --- a/include/arch/unix/mmap.c +++ b/include/arch/unix/mmap.c @@ -95,8 +95,9 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, return APR_EBADF; (*new) = (ap_mmap_t *)ap_pcalloc(cont, sizeof(ap_mmap_t)); - ap_seek(file, APR_SET, &offset); #ifdef BEOS + /* XXX: mmap shouldn't really change the seek offset */ + ap_seek(file, APR_SET, &offset); pages = ((size -1) / B_PAGE_SIZE) + 1; aid = create_area(areaname, &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, @@ -112,7 +113,7 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, (*new)->area = aid; #else - mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes ,0); + mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes, offset); if (mm == (caddr_t)-1) { /* we failed to get an mmap'd file... */ diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 504970a7efd..a4800ddbb3f 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -95,8 +95,9 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, return APR_EBADF; (*new) = (ap_mmap_t *)ap_pcalloc(cont, sizeof(ap_mmap_t)); - ap_seek(file, APR_SET, &offset); #ifdef BEOS + /* XXX: mmap shouldn't really change the seek offset */ + ap_seek(file, APR_SET, &offset); pages = ((size -1) / B_PAGE_SIZE) + 1; aid = create_area(areaname, &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, @@ -112,7 +113,7 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, (*new)->area = aid; #else - mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes ,0); + mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes, offset); if (mm == (caddr_t)-1) { /* we failed to get an mmap'd file... */ From 5263bc7ec28304af415b5ab51a05592aae977d54 Mon Sep 17 00:00:00 2001 From: dgaudet Date: Sat, 10 Jun 2000 02:02:45 +0000 Subject: [PATCH 0185/7878] - don't call fcntl more than once for the socket - accepted socket timeouts start at -1 just like sockets created by other means git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60160 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 1 + network_io/unix/sockopt.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 2ab7b126f4f..e1b09d38244 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -154,6 +154,7 @@ ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_pool_t *con #ifndef HAVE_POLL (*new)->connected = 1; #endif + (*new)->timeout = -1; (*new)->socketdes = accept(sock->socketdes, (struct sockaddr *)(*new)->remote_addr, &(*new)->addr_len); diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 80ce008d2be..5d211f96616 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -155,10 +155,16 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) } } if (opt & APR_SO_TIMEOUT) { - sock->timeout = on; - if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) { + /* don't do the fcntl foo more than needed */ + if (on >= 0 && sock->timeout < 0 + && (stat = sononblock(sock->socketdes)) != APR_SUCCESS) { return stat; } + else if (on < 0 && sock->timeout >= 0 + && (stat = soblock(sock->socketdes)) != APR_SUCCESS) { + return stat; + } + sock->timeout = on; } return APR_SUCCESS; } From e062985d8c0730ef96154d2d8ebe2de563842d4b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 10 Jun 2000 12:02:31 +0000 Subject: [PATCH 0186/7878] Get FreeBSD building again with the resource limiting changes (FreeBSD 3.4, at least). rlim_t is defined in , so we usually need that. Some stuff in needs for timeval just to be able to compile :( git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60161 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 ++++- include/apr_thread_proc.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 3d12c423dfb..bb447beecf8 100644 --- a/configure.in +++ b/configure.in @@ -424,7 +424,10 @@ AC_ARG_ENABLE(other-child, AC_SUBST(oc) AC_MSG_CHECKING(struct rlimit) -AC_TRY_RUN([#include +AC_TRY_RUN([ +#include +#include +#include main() { struct rlimit limit; diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 35e06f78d03..89db1eaafa2 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -59,6 +59,7 @@ #include "apr_general.h" #include "apr_errno.h" #if APR_HAVE_STRUCT_RLIMIT +#include #include #endif From c406f6aacb153b867b0da86487fca806939173dd Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 10 Jun 2000 14:49:52 +0000 Subject: [PATCH 0187/7878] make help text for a couple of APR configure options more neat/correct git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60162 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index bb447beecf8..0baddea148b 100644 --- a/configure.in +++ b/configure.in @@ -68,7 +68,7 @@ AC_ARG_WITH(optim,[ --with-optim="FLAGS" compiler optimisation flags], AC_ARG_WITH(debug,[ --with-debug Turn on debugging and compile time warnings], [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall"; else CFLAGS="$CFLAGS -g"; fi]) -AC_ARG_WITH(maintainer-mode,[ --with-maintainer-mode Turn on debugging and compile time warnings], +AC_ARG_WITH(maintainer-mode,[ --with-maintainer-mode Turn on debugging and compile time warnings], [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"; else CFLAGS="$CFLAGS -g"; fi]) dnl # this is the place to put specific options for platform/compiler @@ -339,7 +339,7 @@ AC_SUBST(have_strstr) dnl #----------------------------- Checking for DSO support echo $ac_n "${nl}Checking for DSO...${nl}" AC_ARG_ENABLE(dso, - [ --enable-dso Enable reliable child processes ], + [ --enable-dso Enable dso support ], [ tempdso=$enableval], [ AC_CHECK_LIB(dl, dlopen, tempdso="yes", tempdso="no") ] ) From a2456bddae2a2cf02da4fe67de662fe129e38123 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 10 Jun 2000 16:08:37 +0000 Subject: [PATCH 0188/7878] Change the APR configure process to call MM's configure script early instead of at the end of the script. With this change, APR can determine if shared memory is provided using a file that multiple platforms can open, or if it is acheived using some sort of shared memory (including MMAP'ed files). This information is used in Apache to provide some optimizations. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60163 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 2 ++ aclocal.m4 | 33 +++++++++++++++++ configure.in | 94 +++++++++++++++++++++++++++--------------------- include/apr.h.in | 10 ++++++ 4 files changed, 99 insertions(+), 40 deletions(-) diff --git a/acconfig.h b/acconfig.h index 5ee866c0390..1403c40a305 100644 --- a/acconfig.h +++ b/acconfig.h @@ -53,6 +53,8 @@ #undef SIZEOF_SSIZE_T #undef SIZEOF_OFF_T +#undef HAVE_MM_SHMT_MMFILE + @BOTTOM@ /* Make sure we have ssize_t defined to be something */ diff --git a/aclocal.m4 b/aclocal.m4 index 2854823a66a..1366dbc53c2 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -261,5 +261,38 @@ int main(void) { fi ]) +AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [ + echo "configuring package in $1 now" + ac_popdir=`pwd` + cd $1 + + # Make the cache file name correct relative to the subdirectory. + case "$cache_file" in + /*) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file="$ac_dots$cache_file" ;; + esac + + case "$srcdir" in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + /*) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_config_dir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; + esac + + # The eval makes quoting arguments work. + + if eval ./configure --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir + then : + echo "$1 configured properly" + else + echo "configure failed for $1" + fi + + cd $ac_popdir +]) + sinclude(threads.m4) sinclude(hints.m4) diff --git a/configure.in b/configure.in index 0baddea148b..879ec0c9192 100644 --- a/configure.in +++ b/configure.in @@ -102,6 +102,60 @@ case "$OS" in ;; esac +dnl #----------------------------- Checking for Shared Memory Support +echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" + +# run the MM config script regardless of whether we are going to use +# it or not. When we have a much better idea of who is using MM, we can +# run this on a more conditional basis. +USE_MM=yes +mm_dir=shmem/unix/mm +RUN_SUBDIR_CONFIG_NOW($config_subdirs) + +AC_MSG_CHECKING(Checking for Shared memory support) +AC_ARG_ENABLE(shmem, + [ --enable-shmem Enable shared memory support in APR. ], + [ ], + ac_cv_enable_shmem="mm" ) + +sharedmem="0" +anonymous_shm="0" +filebased_shm="0" +keybased_shm="0" +if test "$ac_cv_enable_shmem" = "mm"; then + sharedmem="1" + anonymous_shm="1" + AC_MSG_RESULT(anonymous) +elif test "$ac_cv_enable_shmem" = "file"; then + sharedmem="1" + filebased_shm="1" + AC_MSG_RESULT(file based) +elif test "$ac_cv_enable_shmem" = "key"; then + sharedmem="1" + keybased_shm="1" + AC_MSG_RESULT(key based) +else + AC_MSG_RESULT(no) +fi +AC_SUBST(sharedmem) +AC_SUBST(anonymous_shm) +AC_SUBST(filebased_shm) +AC_SUBST(keybased_shm) + +echo "$srcdir" +AC_CHECK_DEFINE(MM_SHMT_MMFILE, $srcdir/shmem/unix/mm/mm_conf.h) + +if test "ac_cv_define_MM_SHMT_MMFILE" = "yes"; then + file_based="1" + mem_based="0" +else + file_based="0" + mem_based="1" +fi + +AC_SUBST(mem_based) +AC_SUBST(file_based) + if test ".$SYS_SW" = ".AIX"; then CFLAGS="$CFLAGS -U__STR__" case "$SYS_KV" in @@ -517,46 +571,6 @@ AC_SUBST(fcntlser) AC_SUBST(procpthreadser) AC_SUBST(pthreadser) -dnl #----------------------------- Checking for Shared Memory Support -echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" - -# run the MM config script regardless of whether we are going to use -# it or not. When we have a much better idea of who is using MM, we can -# run this on a more conditional basis. -USE_MM=yes -mm_dir=shmem/unix/mm -AC_CONFIG_SUBDIRS($config_subdirs) - -AC_MSG_CHECKING(Checking for Shared memory support) -AC_ARG_ENABLE(shmem, - [ --enable-shmem Enable shared memory support in APR. ], - [ ], - ac_cv_enable_shmem="mm" ) - -sharedmem="0" -anonymous_shm="0" -filebased_shm="0" -keybased_shm="0" -if test "$ac_cv_enable_shmem" = "mm"; then - sharedmem="1" - anonymous_shm="1" - AC_MSG_RESULT(anonymous) -elif test "$ac_cv_enable_shmem" = "file"; then - sharedmem="1" - filebased_shm="1" - AC_MSG_RESULT(file based) -elif test "$ac_cv_enable_shmem" = "key"; then - sharedmem="1" - keybased_shm="1" - AC_MSG_RESULT(key based) -else - AC_MSG_RESULT(no) -fi -AC_SUBST(sharedmem) -AC_SUBST(anonymous_shm) -AC_SUBST(filebased_shm) -AC_SUBST(keybased_shm) - dnl #----------------------------- Checking for /dev/random AC_MSG_CHECKING(for /dev/random) diff --git a/include/apr.h.in b/include/apr.h.in index 3e83b1100f1..e3e8b7d1c8c 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -46,6 +46,16 @@ #define APR_USES_FILEBASED_SHM @filebased_shm@ #define APR_USES_KEYBASED_SHM @keybased_shm@ +/* These look VERY similar to the macro's above. They aren't. The + * difference is in implementation. The above macros describe how to + * access the shared memory, either anonymously, through a key or through + * a file. The macros defined below describe actually how the shared + * memory is actually implemented. Is it actually a file that has been + * opened by multiple processes, or it is stored in memory somehow. This + * is important for some optimizations in Apache. + */ +#define APR_FILE_BASED_SHM @file_based@ +#define APR_MEM_BASED_SHM @mem_based@ #define APR_HAVE_IN_ADDR @have_in_addr@ #define APR_HAVE_INET_ADDR @inet_addr@ From be0c3d74d8c53c487df6d07592f8fb07ce76e2fe Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 10 Jun 2000 17:14:05 +0000 Subject: [PATCH 0189/7878] Decry the horrible state the completion of ap_proc_t has left some platforms in... since pid is a process id (valid across all processes) but the handle we stuff in this field is invalid outside the process that created the handle. Oh, and cast the cr*p to dump the compiler warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60164 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 4d22458c0c0..5f22460a6da 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -348,7 +348,11 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, if (CreateProcess(NULL, cmdline, NULL, NULL, TRUE, 0, pEnvBlock, attr->currdir, &attr->si, &pi)) { - new->pid = pi.hProcess; + // TODO: THIS IS BADNESS + // The completion of the ap_proc_t type leaves us ill equiped to track both + // the pid (Process ID) and handle to the process, which are entirely + // different things and each useful in their own rights. + new->pid = (pid_t) pi.hProcess; if (attr->child_in) { ap_close(attr->child_in); From b361ed17dc7e841a32155e51c52268e7e00a1cce Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 10 Jun 2000 17:15:42 +0000 Subject: [PATCH 0190/7878] Some serious completion of stricmp, strnicmp, strdup and strstr issues on Win32... these all happily reside in the standard runtime library. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60165 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++++ aprlib.dsp | 4 ++++ include/apr.hw | 8 ++++++++ include/apr_general.h | 2 +- include/apr_private.hw | 8 +++++++- include/arch/win32/apr_private.h | 8 +++++++- lib/apr_cpystrn.c | 4 ++-- 7 files changed, 33 insertions(+), 5 deletions(-) diff --git a/apr.dsp b/apr.dsp index 39dfd947653..be34fd83bb3 100644 --- a/apr.dsp +++ b/apr.dsp @@ -309,6 +309,10 @@ SOURCE=.\include\apr_strnatcmp.h # End Source File # Begin Source File +SOURCE=.\include\apr_tables.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_thread_proc.h # End Source File # Begin Source File diff --git a/aprlib.dsp b/aprlib.dsp index 39dfd947653..be34fd83bb3 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -309,6 +309,10 @@ SOURCE=.\include\apr_strnatcmp.h # End Source File # Begin Source File +SOURCE=.\include\apr_tables.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_thread_proc.h # End Source File # Begin Source File diff --git a/include/apr.hw b/include/apr.hw index 479cc19ea3b..f39eb44367d 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -125,6 +125,14 @@ #define APR_HAVE_IN_ADDR 1 #define APR_HAVE_INET_ADDR 1 +#define APR_HAVE_STRCASECMP 0 +#define APR_HAVE_STRICMP 1 +#define APR_HAVE_STRNCASECMP 0 +#define APR_HAVE_STRNICMP 1 +#define APR_HAVE_STRNICMP 1 + +#define APR_HAVE_STRDUP 1 +#define APR_HAVE_STRSTR 1 #define APR_USE_FLOCK_SERIALIZE 0 #define APR_USE_SYSVSEM_SERIALIZE 0 diff --git a/include/apr_general.h b/include/apr_general.h index f25079e158a..c1ef4f3cc84 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -225,7 +225,7 @@ int strcasecmp(const char *a, const char *b); #endif #if (!APR_HAVE_STRNCASECMP) && (APR_HAVE_STRNICMP) -#define strncasecmp(s1, s2) strnicmp(s1, s2) +#define strncasecmp(s1, s2, n) strnicmp(s1, s2, n) #elif (!APR_HAVE_STRNCASECMP) int strncasecmp(const char *a, const char *b, size_t n); #endif diff --git a/include/apr_private.hw b/include/apr_private.hw index 40b3221f7da..67cb7a74206 100644 --- a/include/apr_private.hw +++ b/include/apr_private.hw @@ -115,12 +115,18 @@ /* Use this section to define all of the HAVE_FOO_H * that are required to build properly. */ -#define HAVE_CONIO_H 1 +#define HAVE_CONIO_H 1 #define HAVE_MALLOC_H 1 #define HAVE_STDLIB_H 1 #define HAVE_LIMITS_H 1 #define HAVE_SIGNAL_H 1 +#define HAVE_STRICMP 1 +#define HAVE_STRNICMP 1 +#define HAVE_STRNICMP 1 +#define HAVE_STRDUP 1 +#define HAVE_STRSTR 1 + #define SIGHUP 1 /* 2 is used for SIGINT on windows */ #define SIGQUIT 3 diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 40b3221f7da..67cb7a74206 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -115,12 +115,18 @@ /* Use this section to define all of the HAVE_FOO_H * that are required to build properly. */ -#define HAVE_CONIO_H 1 +#define HAVE_CONIO_H 1 #define HAVE_MALLOC_H 1 #define HAVE_STDLIB_H 1 #define HAVE_LIMITS_H 1 #define HAVE_SIGNAL_H 1 +#define HAVE_STRICMP 1 +#define HAVE_STRNICMP 1 +#define HAVE_STRNICMP 1 +#define HAVE_STRDUP 1 +#define HAVE_STRSTR 1 + #define SIGHUP 1 /* 2 is used for SIGINT on windows */ #define SIGQUIT 3 diff --git a/lib/apr_cpystrn.c b/lib/apr_cpystrn.c index 3a15f393973..444e005a256 100644 --- a/lib/apr_cpystrn.c +++ b/lib/apr_cpystrn.c @@ -259,7 +259,7 @@ char *strdup(const char *str) #endif /* The following two routines were donated for SVR4 by Andreas Vogel */ -#ifndef HAVE_STRCASECMP +#if !defined(HAVE_STRCASECMP) && !defined(HAVE_STRICMP) int strcasecmp(const char *a, const char *b) { const char *p = a; @@ -278,7 +278,7 @@ int strcasecmp(const char *a, const char *b) #endif -#ifndef HAVE_STRNCASECMP +#if !defined(HAVE_STRNCASECMP) && !defined(HAVE_STRNICMP) int strncasecmp(const char *a, const char *b, size_t n) { const char *p = a; From 14f2431d116544ab6aaf54040125677f9b35d366 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 10 Jun 2000 17:31:49 +0000 Subject: [PATCH 0191/7878] Fix a dup... and not even a compiler warning emitted? How odd... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60166 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index f39eb44367d..cdef7cddf36 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -129,8 +129,6 @@ #define APR_HAVE_STRICMP 1 #define APR_HAVE_STRNCASECMP 0 #define APR_HAVE_STRNICMP 1 -#define APR_HAVE_STRNICMP 1 - #define APR_HAVE_STRDUP 1 #define APR_HAVE_STRSTR 1 From d8996a09e4a6ff149b5aac5d975505615bd22de4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 10 Jun 2000 17:34:03 +0000 Subject: [PATCH 0192/7878] Hmmm... no warning, not even informational... well here's the fix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60167 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_private.hw | 1 - include/arch/win32/apr_private.h | 1 - 2 files changed, 2 deletions(-) diff --git a/include/apr_private.hw b/include/apr_private.hw index 67cb7a74206..9d4c033a55c 100644 --- a/include/apr_private.hw +++ b/include/apr_private.hw @@ -123,7 +123,6 @@ #define HAVE_STRICMP 1 #define HAVE_STRNICMP 1 -#define HAVE_STRNICMP 1 #define HAVE_STRDUP 1 #define HAVE_STRSTR 1 diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 67cb7a74206..9d4c033a55c 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -123,7 +123,6 @@ #define HAVE_STRICMP 1 #define HAVE_STRNICMP 1 -#define HAVE_STRNICMP 1 #define HAVE_STRDUP 1 #define HAVE_STRSTR 1 From 2834a6c13c7248a02ea30d5f387e5ee22918e3bd Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 10 Jun 2000 18:20:35 +0000 Subject: [PATCH 0193/7878] Get FreeBSD 3.4 building again. It doesn't have lib dl, so the build was broken as of the time we started always sticking in -ldl. src/modules/standard/config.m4: . don't add "-ldl" to LIBS for FreeBSD either . back out previous change regarding LTFLAGS; it should be o.k. to add it for any platform, because libtool knows what to do with it (no, Greg A., I haven't added support for it to OS/390 libtool yet :) ) src/lib/apr/configure.in: . if dlopen() isn't found in lib dl, don't fret (yet); try to find it in the default libraries; git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60168 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 879ec0c9192..6fa4495bac5 100644 --- a/configure.in +++ b/configure.in @@ -395,7 +395,12 @@ echo $ac_n "${nl}Checking for DSO...${nl}" AC_ARG_ENABLE(dso, [ --enable-dso Enable dso support ], [ tempdso=$enableval], - [ AC_CHECK_LIB(dl, dlopen, tempdso="yes", tempdso="no") ] ) + [ + AC_CHECK_LIB(dl, dlopen, tempdso="yes", tempdso="no") + if test "$tempdso" = "no"; then + AC_CHECK_FUNCS(dlopen, [ tempdso="yes" ], [ tempdso="no" ]) + fi + ] ) if test "$tempdso" = "no"; then aprdso="0" From 46b7d03e238f882363e7664db0362b21d503d3d5 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 11 Jun 2000 07:16:51 +0000 Subject: [PATCH 0194/7878] Use OS/2 native call in ap_sleep(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60169 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/time/unix/time.c b/time/unix/time.c index 52733d3abf7..492e4116810 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -66,6 +66,10 @@ #if HAVE_TIME_H #include #endif +#ifdef OS2 +#define INCL_DOS +#include +#endif /* End System Headers */ @@ -253,16 +257,17 @@ ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, void ap_sleep(ap_interval_time_t t) { +#ifdef OS2 + DosSleep(t/1000); +#else struct timeval tv; tv.tv_usec = t % AP_USEC_PER_SEC; tv.tv_sec = t / AP_USEC_PER_SEC; select(0, NULL, NULL, NULL, &tv); +#endif } #ifdef OS2 -#define INCL_DOS -#include - ap_status_t ap_os2_time_to_ap_time(ap_time_t *result, FDATE os2date, FTIME os2time) { struct tm tmpdate; From a952c0a8b9192152a8733b15714d1ec2649cb926 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 11 Jun 2000 09:08:05 +0000 Subject: [PATCH 0195/7878] Fix definition of APR_HAVE_STRICMP & APR_HAVE_STRNICMP. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60170 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index e3e8b7d1c8c..18764a646f2 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -62,8 +62,8 @@ #define APR_HAVE_INET_NETWORK @inet_network@ #define APR_HAVE_UNION_SEMUN @have_union_semun@ #define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@ -#define APR_HAVE_STRICMP @have_strcasecmp@ -#define APR_HAVE_STRNICMP @have_strncasecmp@ +#define APR_HAVE_STRICMP @have_stricmp@ +#define APR_HAVE_STRNICMP @have_strnicmp@ #define APR_HAVE_STRCASECMP @have_strcasecmp@ #define APR_HAVE_STRNCASECMP @have_strncasecmp@ #define APR_HAVE_STRDUP @have_strdup@ From 36935e57fcbec235a636e0ef4cff71be3c2c2b4e Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 11 Jun 2000 11:42:05 +0000 Subject: [PATCH 0196/7878] * RUN_SUBDIR_CONFIG_NOW needs to run the configure script found in srcdir. * The mm directory is now made VPATH-ready again before mm's configure script is run. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60171 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 24 ++++++++++++++---------- configure.in | 11 +---------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 1366dbc53c2..88e83d34a17 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -264,6 +264,7 @@ int main(void) { AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [ echo "configuring package in $1 now" ac_popdir=`pwd` + ac_abs_srcdir=`(cd $srcdir/$1 && pwd)` cd $1 # Make the cache file name correct relative to the subdirectory. @@ -273,18 +274,9 @@ AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [ ac_sub_cache_file="$ac_dots$cache_file" ;; esac - case "$srcdir" in - .) # No --srcdir option. We are building in place. - ac_sub_srcdir=$srcdir ;; - /*) # Absolute path. - ac_sub_srcdir=$srcdir/$ac_config_dir ;; - *) # Relative path. - ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; - esac - # The eval makes quoting arguments work. - if eval ./configure --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir + if eval $ac_abs_srcdir/configure --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir then : echo "$1 configured properly" else @@ -294,5 +286,17 @@ AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [ cd $ac_popdir ]) +AC_DEFUN(APR_PREPARE_MM_DIR,[ +dnl #----------------------------- Prepare mm directory for VPATH support +if test -n "$USE_MM" && test -n "$USE_VPATH"; then + test -d $mm_dir || $MKDIR -p $mm_dir + + for i in shtool config.guess config.sub fbtool ltconfig \ + ltmain.sh mm_vers.c; do + test -r $mm_dir/$i || ln -s $abs_srcdir/$mm_dir/$i $mm_dir/$i + done +fi +]) + sinclude(threads.m4) sinclude(hints.m4) diff --git a/configure.in b/configure.in index 6fa4495bac5..c927f584613 100644 --- a/configure.in +++ b/configure.in @@ -110,6 +110,7 @@ echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" # run this on a more conditional basis. USE_MM=yes mm_dir=shmem/unix/mm +APR_PREPARE_MM_DIR RUN_SUBDIR_CONFIG_NOW($config_subdirs) AC_MSG_CHECKING(Checking for Shared memory support) @@ -630,16 +631,6 @@ AC_SUBST(file_as_socket) APR_CHECK_GETHOSTBYNAME_NAS -dnl #----------------------------- Prepare mm directory for VPATH support -if test -n "$USE_MM" && test -n "$USE_VPATH"; then - test -d $mm_dir || $MKDIR -p $mm_dir - - for i in shtool config.guess config.sub fbtool ltconfig \ - ltmain.sh mm_vers.c; do - test -r $mm_dir/$i || ln -s $abs_srcdir/$mm_dir/$i $mm_dir/$i - done -fi - dnl #----------------------------- Construct the files AC_SUBST(LDLIBS) AC_SUBST(OPTIM) From bce6e337d24ebbab4fb22fb5e6f00c677483e893 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 11 Jun 2000 11:48:02 +0000 Subject: [PATCH 0197/7878] Add -kthread (new FreeBSD switch) Add -mt (WorkShop cc switch) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60172 13f79535-47bb-0310-9956-ffa450edef68 --- threads.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threads.m4 b/threads.m4 index b5fc1a81c97..e308a12659d 100644 --- a/threads.m4 +++ b/threads.m4 @@ -118,7 +118,7 @@ PTHREADS_CHECK_COMPILE AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[ ac_cv_pthreads_cflags="" if test "$pthreads_working" != "yes"; then - for flag in -pthreads -pthread -mthreads -Kthread -threads; do + for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt; do ac_save="$CFLAGS" CFLAGS="$CFLAGS $flag" PTHREADS_CHECK_COMPILE From 53e8d629abee924c04f1743ce7388a8b7a6a40cf Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Sun, 11 Jun 2000 14:12:02 +0000 Subject: [PATCH 0198/7878] Update dependencies. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60173 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/Makefile.in | 6 +++--- file_io/unix/Makefile.in | 26 ++++++++++++++---------- i18n/unix/Makefile.in | 6 +++--- lib/Makefile.in | 34 ++++++++++++++++++------------- locks/unix/Makefile.in | 17 +++++++++------- misc/unix/Makefile.in | 40 +++++++++++++++++++------------------ mmap/unix/Makefile.in | 30 +++++++++++++++------------- network_io/unix/Makefile.in | 18 ++++++++++------- threadproc/unix/Makefile.in | 20 ++++++++++--------- time/unix/Makefile.in | 26 +++++++++++++----------- 10 files changed, 124 insertions(+), 99 deletions(-) diff --git a/dso/unix/Makefile.in b/dso/unix/Makefile.in index 972c4ca6c25..d4a046566bc 100644 --- a/dso/unix/Makefile.in +++ b/dso/unix/Makefile.in @@ -51,6 +51,6 @@ depend: dso.o: dso.c dso.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_dso.h + $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_dso.h diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index cbf5a1059a9..5d702245adf 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -59,42 +59,46 @@ dir.o: dir.c fileio.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_lock.h fileacc.o: fileacc.c fileio.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_thread_proc.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h filedup.o: filedup.c fileio.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_lock.h filestat.o: filestat.c fileio.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_thread_proc.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h open.o: open.c fileio.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_lock.h pipe.o: pipe.c fileio.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_thread_proc.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h readwrite.o: readwrite.c fileio.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lock.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_lock.h seek.o: seek.c fileio.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_thread_proc.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h diff --git a/i18n/unix/Makefile.in b/i18n/unix/Makefile.in index 72998b6d90a..9fe02a58fab 100644 --- a/i18n/unix/Makefile.in +++ b/i18n/unix/Makefile.in @@ -39,6 +39,6 @@ depend: # DO NOT REMOVE xlate.o: xlate.c $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_xlate.h + $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_xlate.h diff --git a/lib/Makefile.in b/lib/Makefile.in index 8d6f69a32f8..001775c4580 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -62,45 +62,51 @@ depend: # DO NOT REMOVE apr_cpystrn.o: apr_cpystrn.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_thread_proc.h apr_execve.o: apr_execve.c $(INCDIR)/apr_private.h apr_fnmatch.o: apr_fnmatch.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_fnmatch.h $(INCDIR)/apr_errno.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr_tables.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_thread_proc.h apr_getpass.o: apr_getpass.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_thread_proc.h apr_hash.o: apr_hash.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_hash.h + $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_hash.h apr_md5.o: apr_md5.c $(INCDIR)/apr_private.h $(INCDIR)/apr_md5.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_xlate.h apr_pools.o: apr_pools.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h ../misc/unix/misc.h \ - $(INCDIR)/apr_getopt.h + $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + ../misc/unix/misc.h $(INCDIR)/apr_getopt.h apr_signal.o: apr_signal.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_thread_proc.h apr_snprintf.o: apr_snprintf.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_thread_proc.h apr_strnatcmp.o: apr_strnatcmp.c $(INCDIR)/apr_strnatcmp.h apr_tables.o: apr_tables.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_thread_proc.h \ - ../misc/unix/misc.h $(INCDIR)/apr_getopt.h + $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_thread_proc.h ../misc/unix/misc.h \ + $(INCDIR)/apr_getopt.h diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index c6131037ba1..4240ed67dda 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -54,16 +54,19 @@ depend: crossproc.o: crossproc.c locks.h ../../include/apr_private.h \ ../../include/apr_general.h ../../include/apr.h \ ../../include/apr_errno.h ../../include/apr_lib.h \ - ../../include/apr_file_io.h ../../include/apr_time.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h + ../../include/apr_tables.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_thread_proc.h \ + ../../include/apr_lock.h intraproc.o: intraproc.c locks.h ../../include/apr_private.h \ ../../include/apr_general.h ../../include/apr.h \ ../../include/apr_errno.h ../../include/apr_lib.h \ - ../../include/apr_file_io.h ../../include/apr_time.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h + ../../include/apr_tables.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_thread_proc.h \ + ../../include/apr_lock.h locks.o: locks.c locks.h ../../include/apr_private.h \ ../../include/apr_general.h ../../include/apr.h \ ../../include/apr_errno.h ../../include/apr_lib.h \ - ../../include/apr_file_io.h ../../include/apr_time.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../include/apr_portable.h ../../include/apr_network_io.h + ../../include/apr_tables.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_thread_proc.h \ + ../../include/apr_lock.h ../../include/apr_portable.h \ + ../../include/apr_network_io.h diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index a95615097ff..fc8781c68dd 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -54,37 +54,39 @@ depend: canonerr.o: canonerr.c misc.h ../../include/apr.h \ ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_thread_proc.h \ - ../../include/apr_getopt.h + ../../include/apr_lib.h ../../include/apr_tables.h \ + ../../include/apr_file_io.h ../../include/apr_time.h \ + ../../include/apr_thread_proc.h ../../include/apr_getopt.h errorcodes.o: errorcodes.c misc.h ../../include/apr.h \ ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_thread_proc.h \ - ../../include/apr_getopt.h + ../../include/apr_lib.h ../../include/apr_tables.h \ + ../../include/apr_file_io.h ../../include/apr_time.h \ + ../../include/apr_thread_proc.h ../../include/apr_getopt.h \ + ../../include/apr_dso.h getopt.o: getopt.c misc.h ../../include/apr.h \ ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_thread_proc.h \ - ../../include/apr_getopt.h + ../../include/apr_lib.h ../../include/apr_tables.h \ + ../../include/apr_file_io.h ../../include/apr_time.h \ + ../../include/apr_thread_proc.h ../../include/apr_getopt.h otherchild.o: otherchild.c misc.h ../../include/apr.h \ ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_thread_proc.h \ - ../../include/apr_getopt.h ../../threadproc/unix/threadproc.h \ - ../../file_io/unix/fileio.h + ../../include/apr_lib.h ../../include/apr_tables.h \ + ../../include/apr_file_io.h ../../include/apr_time.h \ + ../../include/apr_thread_proc.h ../../include/apr_getopt.h \ + ../../threadproc/unix/threadproc.h ../../file_io/unix/fileio.h rand.o: rand.c misc.h ../../include/apr.h ../../include/apr_private.h \ ../../include/apr_general.h ../../include/apr_errno.h \ ../../include/apr_pools.h ../../include/apr_lib.h \ - ../../include/apr_file_io.h ../../include/apr_time.h \ - ../../include/apr_thread_proc.h ../../include/apr_getopt.h + ../../include/apr_tables.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_thread_proc.h \ + ../../include/apr_getopt.h start.o: start.c misc.h ../../include/apr.h \ ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_thread_proc.h \ - ../../include/apr_getopt.h ../../locks/unix/locks.h \ - ../../include/apr_lock.h + ../../include/apr_lib.h ../../include/apr_tables.h \ + ../../include/apr_file_io.h ../../include/apr_time.h \ + ../../include/apr_thread_proc.h ../../include/apr_getopt.h \ + ../../locks/unix/locks.h ../../include/apr_lock.h diff --git a/mmap/unix/Makefile.in b/mmap/unix/Makefile.in index 116c4a2f6b3..950b9b366d3 100644 --- a/mmap/unix/Makefile.in +++ b/mmap/unix/Makefile.in @@ -49,17 +49,19 @@ depend: && rm Makefile.new # DO NOT REMOVE -common.o: common.c mmap_h.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_mmap.h \ - ../../include/apr_network_io.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../file_io/unix/fileio.h ../../include/apr_lib.h -mmap.o: mmap.c mmap_h.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_mmap.h \ - ../../include/apr_network_io.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../file_io/unix/fileio.h ../../include/apr_lib.h +common.o: common.c mmap_h.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_mmap.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lock.h \ + ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_tables.h +mmap.o: mmap.c mmap_h.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_mmap.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lock.h \ + ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_tables.h diff --git a/network_io/unix/Makefile.in b/network_io/unix/Makefile.in index c1c245d6ce6..8ebd82879ce 100644 --- a/network_io/unix/Makefile.in +++ b/network_io/unix/Makefile.in @@ -57,26 +57,30 @@ poll.o: poll.c networkio.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_thread_proc.h + $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_thread_proc.h ../../file_io/unix/fileio.h sendrecv.o: sendrecv.c networkio.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_thread_proc.h \ - ../../file_io/unix/fileio.h + $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_thread_proc.h ../../file_io/unix/fileio.h sockaddr.o: sockaddr.c networkio.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_thread_proc.h + $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_thread_proc.h sockets.o: sockets.c networkio.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_lock.h + $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_lock.h sockopt.o: sockopt.c networkio.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_thread_proc.h + $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_thread_proc.h diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index caaf880927c..d2cfa8c7595 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -58,35 +58,37 @@ proc.o: proc.c threadproc.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h procsup.o: procsup.c threadproc.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h + ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_tables.h signals.o: signals.c threadproc.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h + ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_tables.h thread.o: thread.c threadproc.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h threadcancel.o: threadcancel.c threadproc.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_time.h ../../file_io/unix/fileio.h \ - $(INCDIR)/apr_lib.h + $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h threadpriv.o: threadpriv.c threadproc.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h diff --git a/time/unix/Makefile.in b/time/unix/Makefile.in index cdfe91da154..72ee76bb29c 100644 --- a/time/unix/Makefile.in +++ b/time/unix/Makefile.in @@ -49,15 +49,17 @@ depend: && rm Makefile.new # DO NOT REMOVE -time.o: time.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h -timestr.o: timestr.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h +time.o: time.c $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_private.h +timestr.o: timestr.c $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_private.h From 5a3c60ce0055737f11f1941f670a5ec85d94e46c Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Sun, 11 Jun 2000 15:01:13 +0000 Subject: [PATCH 0199/7878] Test for poll() _after_ testeng for threading. Again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60174 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index c927f584613..8802966568f 100644 --- a/configure.in +++ b/configure.in @@ -187,8 +187,8 @@ AC_CHECK_LIB(ufc,crypt) AC_CHECK_LIB(truerand,main) dnl #----------------------------- Checks for Any required Functions -dnl Checks for library functions. -AC_CHECK_FUNCS(strcasecmp stricmp poll setsid) +dnl Checks for library functions. (N.B. poll is further down) +AC_CHECK_FUNCS(strcasecmp stricmp setsid) AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) AC_CHECK_FUNCS(writev) AC_CHECK_FUNCS(sendfile, [ sendfile="1" ], [ sendfile="0" ]) @@ -467,6 +467,11 @@ fi AC_SUBST(threads) +dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a +dnl threaded poll() + +AC_CHECK_FUNCS(poll) + dnl #----------------------------- Checking for Processes echo $ac_n "${nl}Checking for Processes...${nl}" From 7b05ecc0f78a266dc51ccf1ca545969f03b612f2 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Sun, 11 Jun 2000 15:01:55 +0000 Subject: [PATCH 0200/7878] constification. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60175 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 2 +- dso/unix/dso.h | 2 +- include/apr_dso.h | 2 +- include/arch/unix/dso.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index d6c01c86aca..6f09a01126e 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -140,7 +140,7 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, return APR_SUCCESS; } -char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) +const char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) { if (dso->errormsg) return dso->errormsg; diff --git a/dso/unix/dso.h b/dso/unix/dso.h index 55e7e324690..ef8aa572a52 100644 --- a/dso/unix/dso.h +++ b/dso/unix/dso.h @@ -88,7 +88,7 @@ struct ap_dso_handle_t { ap_pool_t *cont; void *handle; - char *errormsg; + const char *errormsg; }; #endif diff --git a/include/apr_dso.h b/include/apr_dso.h index c15fef3eca7..e7c1ba7afbf 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -117,7 +117,7 @@ B ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, const char *symname); -char *ap_dso_error(ap_dso_handle_t *dso, char *buf, ap_size_t bufsize); +const char *ap_dso_error(ap_dso_handle_t *dso, char *buf, ap_size_t bufsize); #ifdef __cplusplus } diff --git a/include/arch/unix/dso.h b/include/arch/unix/dso.h index 55e7e324690..ef8aa572a52 100644 --- a/include/arch/unix/dso.h +++ b/include/arch/unix/dso.h @@ -88,7 +88,7 @@ struct ap_dso_handle_t { ap_pool_t *cont; void *handle; - char *errormsg; + const char *errormsg; }; #endif From 68ac82efe8954be1759405fe4e020411f48edddb Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 11 Jun 2000 19:57:30 +0000 Subject: [PATCH 0201/7878] trailing space caused build to break for me, remove it. did somebody say it's sunny outside? PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60176 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/unix/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmap/unix/Makefile.in b/mmap/unix/Makefile.in index 950b9b366d3..f98c1ecf3eb 100644 --- a/mmap/unix/Makefile.in +++ b/mmap/unix/Makefile.in @@ -9,7 +9,7 @@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../include +INCDIR=../../include INCDIR1=../../file_io/@OSDIR@ INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. From fc93900031636f4b54ee488e744bce4b5b080493 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 12 Jun 2000 12:54:20 +0000 Subject: [PATCH 0202/7878] OK so finally I get my cvs working again! These small diffs get mmap building on BeOS after the merge. Missed them last time around. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60177 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/unix/common.c | 2 +- mmap/unix/mmap_h.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mmap/unix/common.c b/mmap/unix/common.c index d2fc6cc018d..b80653d8044 100644 --- a/mmap/unix/common.c +++ b/mmap/unix/common.c @@ -63,7 +63,7 @@ #include "mmap_h.h" -#if HAVE_MMAP +#if HAVE_MMAP || defined(BEOS) ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_off_t offset) { diff --git a/mmap/unix/mmap_h.h b/mmap/unix/mmap_h.h index 87300f19cbd..7cb71b851f6 100644 --- a/mmap/unix/mmap_h.h +++ b/mmap/unix/mmap_h.h @@ -59,7 +59,7 @@ #include "apr_general.h" #include "apr_mmap.h" #include "apr_errno.h" -#include "fileio.h" +#include "../../file_io/unix/fileio.h" #include "mmap_h.h" /* System headers required for the mmap library */ From a24ee46300dbb3c2b091f69146359eadd515e6e4 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 12 Jun 2000 13:00:05 +0000 Subject: [PATCH 0203/7878] This gets BeOS working again but I need to look at the whole business of waitpid and so on. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60178 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/proc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 9661778dda0..247b082bfc4 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -267,6 +267,24 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, return APR_SUCCESS; } +ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, + ap_wait_how_e waithow, ap_pool_t *p) +{ + int waitpid_options = WUNTRACED; + + if (waithow != APR_WAIT) { + waitpid_options |= WNOHANG; + } + + if ((proc->pid = waitpid(-1, status, waitpid_options)) > 0) { + return APR_CHILD_DONE; + } + else if (proc->pid == 0) { + return APR_CHILD_NOTDONE; + } + return errno; +} + ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e wait) { From d0a28822433797409154f6b87bffad8bfa6d2c81 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 12 Jun 2000 13:39:39 +0000 Subject: [PATCH 0204/7878] Tidy up the unix network code in light of the latest network update on BeOS. This makes things much tidier. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60179 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/networkio.h | 9 +------ network_io/unix/networkio.h | 9 +------ network_io/unix/poll.c | 16 ------------ network_io/unix/sockets.c | 16 ++---------- network_io/unix/sockopt.c | 49 +++++++++++++++++++---------------- 5 files changed, 30 insertions(+), 69 deletions(-) diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 5ab06d7ed99..e2ebc842b45 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -104,12 +104,9 @@ #if HAVE_SYS_SENDFILE_H #include #endif -#if HAVE_BYTEORDER_H -#include /* for ntohs on BeOS */ -#endif /* End System Headers */ -/* The definition of isascii was missed from the PowerPC ctype.h +/* The definition of isascii was missed from the BeOS PowerPC ctype.h * * It will be included in the next release, but until then... */ @@ -155,9 +152,5 @@ struct ap_pollfd_t { }; -#if BEOS -int inet_aton(const char *cp, struct in_addr *addr); -#endif - #endif /* ! NETWORK_IO_H */ diff --git a/network_io/unix/networkio.h b/network_io/unix/networkio.h index 5ab06d7ed99..e2ebc842b45 100644 --- a/network_io/unix/networkio.h +++ b/network_io/unix/networkio.h @@ -104,12 +104,9 @@ #if HAVE_SYS_SENDFILE_H #include #endif -#if HAVE_BYTEORDER_H -#include /* for ntohs on BeOS */ -#endif /* End System Headers */ -/* The definition of isascii was missed from the PowerPC ctype.h +/* The definition of isascii was missed from the BeOS PowerPC ctype.h * * It will be included in the next release, but until then... */ @@ -155,9 +152,5 @@ struct ap_pollfd_t { }; -#if BEOS -int inet_aton(const char *cp, struct in_addr *addr); -#endif - #endif /* ! NETWORK_IO_H */ diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index 5c33be86530..853e445dd57 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -273,11 +273,7 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, } rv = select(aprset->highsock + 1, aprset->read, aprset->write, -#ifdef BEOS - NULL, tvptr); -#else aprset->except, tvptr); -#endif (*nsds) = rv; if ((*nsds) == 0) { @@ -301,14 +297,7 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap if (FD_ISSET(sock->socketdes, aprset->read)) { revents |= APR_POLLIN; if (sock->connected -#ifdef BEOS - /* XXX I would really like to understand why this difference - * exists. Can we get rid of it? rbb - */ - && recv(sock->socketdes, data, 0, 0) == -1) { -#else && recv(sock->socketdes, data, sizeof data, flags) == -1) { -#endif switch (errno) { case ECONNRESET: case ECONNABORTED: @@ -328,14 +317,9 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap } } } -#ifndef BEOS - /* Still no support for execpt bits in BeOS R4.5 so for the time being */ - /* we can't check this. Hopefully the error checking above will allow */ - /* sufficient errors to be recognised to cover this. */ if (FD_ISSET(sock->socketdes, aprset->write)) { revents |= APR_POLLOUT; } -#endif /* I am assuming that the except is for out of band data, not a failed * connection on a non-blocking socket. Might be a bad assumption, but * it works for now. rbb. diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index e1b09d38244..2f14cdc2529 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -55,19 +55,10 @@ #include "networkio.h" #include "apr_portable.h" -/* BeOS uses closesocket instead of close to close their sockets and they - * don't provide inet_aton. This small ifndef takes care of both problems. - */ -#ifndef BEOS -#define closesocket close -#else -#include "inet_aton.c" -#endif - static ap_status_t socket_cleanup(void *sock) { ap_socket_t *thesocket = sock; - if (closesocket(thesocket->socketdes) == 0) { + if (close(thesocket->socketdes) == 0) { thesocket->socketdes = -1; return APR_SUCCESS; } @@ -111,9 +102,6 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) { - /* BEOS internal documentation indicates that this system call - * may not work in 5.0, but we don't have any alternatives. - */ return (shutdown(thesocket->socketdes, how) == -1) ? errno : APR_SUCCESS; } @@ -155,7 +143,7 @@ ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_pool_t *con (*new)->connected = 1; #endif (*new)->timeout = -1; - + (*new)->socketdes = accept(sock->socketdes, (struct sockaddr *)(*new)->remote_addr, &(*new)->addr_len); diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 5d211f96616..dc6e69673c8 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -56,6 +56,8 @@ static ap_status_t soblock(int sd) { +/* BeOS uses setsockopt at present for non blocking... */ +#ifndef BEOS int fd_flags; fd_flags = fcntl(sd, F_GETFL, 0); @@ -72,11 +74,17 @@ static ap_status_t soblock(int sd) if (fcntl(sd, F_SETFL, fd_flags) == -1) { return errno; } +#else + int on = 0; + if (setsockopt(sd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(int)) < 0) + return errno; +#endif /* BEOS */ return APR_SUCCESS; } static ap_status_t sononblock(int sd) { +#ifndef BEOS int fd_flags; fd_flags = fcntl(sd, F_GETFL, 0); @@ -93,6 +101,11 @@ static ap_status_t sononblock(int sd) if (fcntl(sd, F_SETFL, fd_flags) == -1) { return errno; } +#else + int on = 1; + if (setsockopt(sd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(int)) < 0) + return errno; +#endif /* BEOS */ return APR_SUCCESS; } @@ -123,16 +136,11 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) } } if (opt & APR_SO_SNDBUF) { -#ifdef BEOS - return APR_ENOTIMPLE; -#else if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { return errno; } -#endif } if (opt & APR_SO_NONBLOCK) { -#ifndef BEOS if (on) { if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) return stat; @@ -141,11 +149,6 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) return stat; } -#else - stat = setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(int)); - if (stat != 0) - return stat; -#endif } if (opt & APR_SO_LINGER) { li.l_onoff = on; @@ -154,19 +157,19 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) return errno; } } - if (opt & APR_SO_TIMEOUT) { - /* don't do the fcntl foo more than needed */ - if (on >= 0 && sock->timeout < 0 - && (stat = sononblock(sock->socketdes)) != APR_SUCCESS) { - return stat; - } - else if (on < 0 && sock->timeout >= 0 - && (stat = soblock(sock->socketdes)) != APR_SUCCESS) { - return stat; - } - sock->timeout = on; - } - return APR_SUCCESS; + if (opt & APR_SO_TIMEOUT) { + /* don't do the fcntl foo more than needed */ + if (on >= 0 && sock->timeout < 0 + && (stat = sononblock(sock->socketdes)) != APR_SUCCESS) { + return stat; + } + else if (on < 0 && sock->timeout >= 0 + && (stat = soblock(sock->socketdes)) != APR_SUCCESS) { + return stat; + } + sock->timeout = on; + } + return APR_SUCCESS; } ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_pool_t *cont) From 663ccb39218580b6c4559913de751534b23a4980 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 12 Jun 2000 13:51:22 +0000 Subject: [PATCH 0205/7878] Another change to allow the newest version of BeOS to be used to it's full potential. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60180 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileio.h | 3 +++ file_io/unix/readwrite.c | 10 +++++++--- include/arch/unix/fileio.h | 3 +++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/file_io/unix/fileio.h b/file_io/unix/fileio.h index 1ef43ba0922..3e9c2ca04b5 100644 --- a/file_io/unix/fileio.h +++ b/file_io/unix/fileio.h @@ -98,6 +98,9 @@ #ifdef BEOS #include #endif +#if BEOS && HAVE_ARPA_INET_H +#include /* for fd_set definitions */ +#endif /* End System headers */ #define APR_FILE_BUFSIZE 4096 diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index f3a81c5d3b2..aa3668ebb09 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -55,7 +55,11 @@ #include "fileio.h" #include "apr_lock.h" -#ifndef BEOS +#if !BEOS || (BEOS && HAVE_ARPA_INET_H) +#define USE_WAIT_FOR_IO +#endif + +#ifdef USE_WAIT_FOR_IO static ap_status_t wait_for_io_or_timeout(ap_file_t *file, int for_read) { struct timeval tv, *tvptr; @@ -159,7 +163,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) do { rv = read(thefile->filedes, buf, *nbytes); } while (rv == -1 && errno == EINTR); -#ifndef BEOS +#ifdef USE_WAIT_FOR_IO if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && thefile->timeout != 0) { @@ -232,7 +236,7 @@ ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) do { rv = write(thefile->filedes, buf, *nbytes); } while (rv == (ap_size_t)-1 && errno == EINTR); -#ifndef BEOS +#ifdef USE_WAIT_FOR_IO if (rv == (ap_size_t)-1 && (errno == EAGAIN || errno == EWOULDBLOCK) && thefile->timeout != 0) { diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 1ef43ba0922..3e9c2ca04b5 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -98,6 +98,9 @@ #ifdef BEOS #include #endif +#if BEOS && HAVE_ARPA_INET_H +#include /* for fd_set definitions */ +#endif /* End System headers */ #define APR_FILE_BUFSIZE 4096 From c29fe3e9b71707bedcacb07a05a5c25327541255 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 12 Jun 2000 15:28:52 +0000 Subject: [PATCH 0206/7878] Remove the final vestiges of stat.h from Apache 2.0. All calls are now to ap_stat. This also adds the new function ap_lstat(). This function is analogous to lstat. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60181 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 21 +++++++++++++++++++++ include/apr_file_io.h | 17 +++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index e6baf7191ca..7ed8a238f75 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -121,3 +121,24 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) return errno; } } + +ap_status_t ap_lstat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) +{ + struct stat info; + + if (lstat(fname, &info) == 0) { + finfo->protection = info.st_mode; + finfo->filetype = filetype_from_mode(info.st_mode); + finfo->user = info.st_uid; + finfo->group = info.st_gid; + finfo->size = info.st_size; + finfo->inode = info.st_ino; + ap_ansi_time_to_ap_time(&finfo->atime, info.st_atime); + ap_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); + ap_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); + return APR_SUCCESS; + } + else { + return errno; + } +} diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 790a136c497..58fb6a5944f 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -410,11 +410,10 @@ B =cut */ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile); -ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont); /* -=head1 ap_status_t ap_stat(ap_file_t **finfo, char *fname, ap_pool_t *cont) +=head1 ap_status_t ap_stat(ap_finfo_t **finfo, char *fname, ap_pool_t *cont) B @@ -428,6 +427,20 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont); /* +=head1 ap_status_t ap_lstat(ap_finfo_t **finfo, char *fname, ap_pool_t *cont) + +B + + arg 1) Where to store the information about the file. + arg 2) The name of the file to stat. + arg 3) the pool to use to allocate the new file. + +=cut + */ +ap_status_t ap_lstat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont); + +/* + =head1 ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) B From 382b359872b23850d5949b1080f86b171af75a72 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 12 Jun 2000 15:46:21 +0000 Subject: [PATCH 0207/7878] Don't configure MM on OS/2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60182 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 8802966568f..2832475b610 100644 --- a/configure.in +++ b/configure.in @@ -95,10 +95,12 @@ case "$OS" in enable_apr_threads="system_threads" config_subdirs="shmem/unix/mm" native_mmap_emul="1" + USE_MM=yes ;; *) OSDIR="unix" config_subdirs="shmem/unix/mm" + USE_MM=yes ;; esac @@ -108,10 +110,12 @@ echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" # run the MM config script regardless of whether we are going to use # it or not. When we have a much better idea of who is using MM, we can # run this on a more conditional basis. -USE_MM=yes mm_dir=shmem/unix/mm -APR_PREPARE_MM_DIR -RUN_SUBDIR_CONFIG_NOW($config_subdirs) + +if test "$USE_MM" = "yes"; then + APR_PREPARE_MM_DIR + RUN_SUBDIR_CONFIG_NOW($config_subdirs) +fi AC_MSG_CHECKING(Checking for Shared memory support) AC_ARG_ENABLE(shmem, From 5da4321e7858142cdc92a4ec8b5007cf56386582 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 12 Jun 2000 16:00:32 +0000 Subject: [PATCH 0208/7878] Add a new function ap_set_default_fperms. This allows people to set the umask to be used when creating files. This should change the permissions of files created using APR_DEFAULT_OS. Also removed a warning introduced with the sys/stat.h changes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60183 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 5 +++++ include/apr_file_io.h | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 6e0039ac73c..bbdc88d34b5 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -79,6 +79,11 @@ ap_status_t ap_unix_file_cleanup(void *thefile) } } +ap_fileperms_t ap_set_default_fperms(ap_fileperms_t perm) +{ + return umask(perm); +} + ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cont) { int oflags = 0; diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 58fb6a5944f..d2d40cbf6e0 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -158,6 +158,21 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, /* +=head1 ap_fileperms_t ap_set_default_fperms(ap_fileperms_t perm) + +B + + arg 1) The permissions to use as the defaults for all files created by APR. + +B: This function can not fail, and it returns the current default + permissions. + +=cut + */ +ap_fileperms_t ap_set_default_fperms(ap_fileperms_t perm); + +/* + =head1 ap_status_t ap_close(ap_file_t *file) B From 3d7c512d721b08b1a881430dd20315b2f8019614 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 12 Jun 2000 17:54:58 +0000 Subject: [PATCH 0209/7878] Add definition of APR_OFF_T_FMT to apr.hw (for Windows) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60184 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr.hw b/include/apr.hw index cdef7cddf36..12aa8953c07 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -172,6 +172,7 @@ typedef int gid_t; /* Definitions that APR programs need to work properly. */ #define APR_SSIZE_T_FMT "d" #define APR_THREAD_FUNC __stdcall +#define APR_OFF_T_FMT "ld" #if !defined(WIN32) || defined(APR_STATIC) /* Default Non-WIN32 behavior removes all MSVCisms */ From 4a592689c28c39239608020f3e6940aef98c9c5d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 12 Jun 2000 18:07:43 +0000 Subject: [PATCH 0210/7878] Correct the return type for a recent commit to the dso header declaration. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60185 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 33ad2717fb3..7f395be29b3 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -99,7 +99,7 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, return APR_SUCCESS; } -char *ap_dso_error(ap_dso_handle_t *dso, char *buf, ap_size_t bufsize) +const char *ap_dso_error(ap_dso_handle_t *dso, char *buf, ap_size_t bufsize) { return ap_strerror(dso->load_error, buf, bufsize); } From 04df594e976ef9410099eea27f0fbbab7956e717 Mon Sep 17 00:00:00 2001 From: Chuck Murcko Date: Mon, 12 Jun 2000 20:45:26 +0000 Subject: [PATCH 0211/7878] changes for mod_proxy/mod_cache PR: Obtained from: Submitted by: Sam Magnuson Reviewed by: Chuck Murcko, Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60186 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 2 ++ include/apr_tables.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 9d2b08f33df..7bfe8302fa3 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -86,6 +86,7 @@ extern "C" { #define APR_SO_REUSEADDR 16 #define APR_SO_TIMEOUT 32 #define APR_SO_SNDBUF 64 +#define APR_SO_RCVBUF 128 #define APR_POLLIN 0x001 #define APR_POLLPRI 0x002 @@ -412,6 +413,7 @@ B values < 0 mean wait forever. 0 means don't wait at all. APR_SO_SNDBUF -- Set the SendBufferSize + APR_SO_RCVBUF -- Set the ReceiveBufferSize arg 3) Are we turning the option on or off. =cut diff --git a/include/apr_tables.h b/include/apr_tables.h index a9e7058e458..050b058e4f3 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -155,6 +155,9 @@ APR_EXPORT(ap_table_t *) ap_overlay_tables(struct ap_pool_t *p, APR_EXPORT(void) ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, const ap_table_t *t, ...); +APR_EXPORT(void) + ap_table_vdo(int (*comp) (void *, const char *, const char *), + void *rec, const ap_table_t *t, va_list); #define AP_OVERLAP_TABLES_SET (0) #define AP_OVERLAP_TABLES_MERGE (1) APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, From a5f20c2e9ca478c99b4ec5320c8024a982a19970 Mon Sep 17 00:00:00 2001 From: Chuck Murcko Date: Mon, 12 Jun 2000 20:46:58 +0000 Subject: [PATCH 0212/7878] added ap_table_vdo() for mod_proxy PR: Obtained from: Submitted by: Sam Magnuson Reviewed by: Chuck Murcko, Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60187 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_tables.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/apr_tables.c b/lib/apr_tables.c index 1bb5c363aa5..556e408d386 100644 --- a/lib/apr_tables.c +++ b/lib/apr_tables.c @@ -589,14 +589,17 @@ APR_EXPORT(void) ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, const ap_table_t *t, ...) { va_list vp; + va_start(vp, t); + ap_table_vdo(comp, rec, t, vp); + va_end(vp); +} +APR_EXPORT(void) ap_table_vdo(int (*comp) (void *, const char *, const char *), + void *rec, const ap_table_t *t, va_list vp) +{ char *argp; ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; int rv, i; - - va_start(vp, t); - argp = va_arg(vp, char *); - do { for (rv = 1, i = 0; rv && (i < t->a.nelts); ++i) { if (elts[i].key && (!argp || !strcasecmp(elts[i].key, argp))) { @@ -604,8 +607,6 @@ APR_EXPORT(void) ap_table_do(int (*comp) (void *, const char *, const char *), } } } while (argp && ((argp = va_arg(vp, char *)) != NULL)); - - va_end(vp); } /* Curse libc and the fact that it doesn't guarantee a stable sort. We From 7063839abead5fcceec5102fc1e0e24e8bda2850 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 12 Jun 2000 21:08:25 +0000 Subject: [PATCH 0213/7878] Back out ap_set_default_perms(). Remove old logic to play with umask around the creation of the httpd.pid file. Pass explicit permissions to ap_open(), omitting write-ability except by the owning user. As always, we end up with rw-r--r-- for the permissions unless the umask is something unusual. Note that the OS/2 and Win32 implementations of ap_open() ignore the permissions parameter altogether. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60188 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 5 ----- include/apr_file_io.h | 15 --------------- 2 files changed, 20 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index bbdc88d34b5..6e0039ac73c 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -79,11 +79,6 @@ ap_status_t ap_unix_file_cleanup(void *thefile) } } -ap_fileperms_t ap_set_default_fperms(ap_fileperms_t perm) -{ - return umask(perm); -} - ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cont) { int oflags = 0; diff --git a/include/apr_file_io.h b/include/apr_file_io.h index d2d40cbf6e0..58fb6a5944f 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -158,21 +158,6 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, /* -=head1 ap_fileperms_t ap_set_default_fperms(ap_fileperms_t perm) - -B - - arg 1) The permissions to use as the defaults for all files created by APR. - -B: This function can not fail, and it returns the current default - permissions. - -=cut - */ -ap_fileperms_t ap_set_default_fperms(ap_fileperms_t perm); - -/* - =head1 ap_status_t ap_close(ap_file_t *file) B From cf829596e17b3e0c4edf786ca3a7456c0fa9404a Mon Sep 17 00:00:00 2001 From: Chuck Murcko Date: Mon, 12 Jun 2000 21:31:03 +0000 Subject: [PATCH 0214/7878] Added comments concerning ap_table_vdo and its use for the caching API: The caching api will allow a user to walk the header values: ap_status_t ap_cache_el_header_walk(ap_cache_el *el, int (*comp)(void *, const char *, const char *), void *rec, ...); So it can be ..., however from there I use a callback that uses a va_list: ap_status_t (*cache_el_header_walk)(ap_cache_el *el, int (*comp)(void *, const char *, const char *), void *rec, va_list); To pass those ...'s on down to the actual module that will handle walking their headers, in the file case this is actually just an ap_table - and rather than reimplementing ap_table_do (which IMHO would be bad) I just called it with the va_list. For mod_shmem_cache I don't need it since I can't use ap_table's, but mod_file_cache should (though a good hash would be better, but that's a different issue :). So short answer, to make mod_file_cache easier to maintain, it's a good thing PR: Obtained from: Submitted by: Sam Magnuson Reviewed by: Chuck Murcko, Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60189 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_tables.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/apr_tables.c b/lib/apr_tables.c index 556e408d386..a7d2b67617b 100644 --- a/lib/apr_tables.c +++ b/lib/apr_tables.c @@ -584,6 +584,27 @@ APR_EXPORT(ap_table_t *) ap_overlay_tables(ap_pool_t *p, * * Note that rec is simply passed-on to the comp function, so that the * caller can pass additional info for the task. + * + * ADDENDUM for ap_table_vdo(): + * + * The caching api will allow a user to walk the header values: + * + * ap_status_t ap_cache_el_header_walk(ap_cache_el *el, + * int (*comp)(void *, const char *, const char *), void *rec, ...); + * + * So it can be ..., however from there I use a callback that use a va_list: + * + * ap_status_t (*cache_el_header_walk)(ap_cache_el *el, + * int (*comp)(void *, const char *, const char *), void *rec, va_list); + * + * To pass those ...'s on down to the actual module that will handle walking + * their headers, in the file case this is actually just an ap_table - and + * rather than reimplementing ap_table_do (which IMHO would be bad) I just + * called it with the va_list. For mod_shmem_cache I don't need it since I + * can't use ap_table's, but mod_file_cache should (though a good hash would + * be better, but that's a different issue :). + * + * So to make mod_file_cache easier to maintain, it's a good thing */ APR_EXPORT(void) ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, const ap_table_t *t, ...) From 5b74d4f868b6596b12442146068ccd9bfa52e937 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 13 Jun 2000 12:56:12 +0000 Subject: [PATCH 0215/7878] Update ap_dso_error so it builds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60190 13f79535-47bb-0310-9956-ffa450edef68 --- dso/beos/dso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 0eb280bf54d..2ed8c53de6d 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -99,7 +99,7 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, return APR_SUCCESS; } -char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) +const char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) { strncpy(strerror(errno), buffer, buflen); return buffer; From 472ddd8c70a44332a88835fb7b66a4b8e50e5299 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 13 Jun 2000 13:05:33 +0000 Subject: [PATCH 0216/7878] This small change does the following... - add a check to allow us to detect BONE (new BeOS networking stack) - add checks to detect dso on BeOS - reorder some of the threads detection to do fewer checks if they're not required. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60191 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 2832475b610..dc5a29cb807 100644 --- a/configure.in +++ b/configure.in @@ -96,6 +96,7 @@ case "$OS" in config_subdirs="shmem/unix/mm" native_mmap_emul="1" USE_MM=yes + AC_CHECK_DEFINE(BONE_VERSION, sys/socket.h) ;; *) OSDIR="unix" @@ -405,7 +406,10 @@ AC_ARG_ENABLE(dso, if test "$tempdso" = "no"; then AC_CHECK_FUNCS(dlopen, [ tempdso="yes" ], [ tempdso="no" ]) fi - ] ) + if test "$tempdso" = "no"; then + AC_CHECK_LIB(root, load_image, tempdso="yes", tempdso="no") + fi + ] ) if test "$tempdso" = "no"; then aprdso="0" @@ -426,6 +430,7 @@ AC_CACHE_CHECK([for threads], ac_cv_enable_threads, [ ac_cv_enable_threads="no" ] ) ] ) ] ) if test "$ac_cv_enable_threads" = "no"; then +echo "Don't enable threads" threads="0" pthreadh="0" else @@ -441,8 +446,8 @@ else threads="0" pthreadh="0" ] ) elif test "$enable_apr_threads" = "system_threads"; then - threads="1" - pthreadh="0" + threads="1" + pthreadh="0" else # We basically specified that we wanted threads, but not how to implement # them. In this case, just look for pthreads. In the future, we can check @@ -457,14 +462,15 @@ else fi fi -APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS -APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG +if test "$pthreads" = "1"; then + APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS + APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG +fi ac_cv_define_READDIR_IS_THREAD_SAFE=no -AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE)) - if test "$threads" = "1"; then echo "APR will use threads" + AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE)) else echo "APR will be non-threaded" fi From d2b9dcd1f069784490aea64bdcd0a3d5d6cb322d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 13 Jun 2000 13:41:21 +0000 Subject: [PATCH 0217/7878] ap_bwrite_xlate() now handles the case where it was passed a partial character at the end of the input buffer. A new APR status code was added for non-error situations where more input data is needed to complete the task. ap_xlate_conv_buffer() returns this when it is passed a partial character at the end of the input buffer. ap_bwrite_xlate() checks for this status code so it knows when to hold onto the partial character until the next call, at which point it can try to translate the entire character. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60192 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/xlate.c | 25 +++++++++++++++++++++++-- include/apr_errno.h | 2 +- misc/unix/errorcodes.c | 2 ++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 92543b7a673..a0d4435db5e 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -253,9 +253,30 @@ ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, /* If everything went fine but we ran out of buffer, don't * report it as an error. Caller needs to look at the two * bytes-left values anyway. + * + * There are three expected cases where rc is -1. In each of + * these cases, *inbytes_left != 0. + * a) the non-error condition where we ran out of output + * buffer + * b) the non-error condition where we ran out of input (i.e., + * the last input character is incomplete) + * c) the error condition where the input is invalid */ - if (translated == (size_t)-1 && *outbytes_left) { - return errno; + if (translated == (size_t)-1) { + switch (errno) { + case E2BIG: /* out of space on output */ + status = 0; /* change table lookup code below if you + make this an error */ + break; + case EINVAL: /* input character not complete (yet) */ + status = APR_INCOMPLETE; + break; + case EILSEQ: /* bad input byte */ + status = APR_EINVAL; + break; + default: + status = errno; + } } } else diff --git a/include/apr_errno.h b/include/apr_errno.h index 059b5553387..49f62964f85 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -116,7 +116,7 @@ int ap_canonical_error(ap_status_t err); #define APR_CHILD_DONE (APR_OS_START_STATUS + 5) #define APR_CHILD_NOTDONE (APR_OS_START_STATUS + 6) #define APR_TIMEUP (APR_OS_START_STATUS + 7) -/* empty slot: +8 */ +#define APR_INCOMPLETE (APR_OS_START_STATUS + 8) /* empty slot: +9 */ /* empty slot: +10 */ /* empty slot: +11 */ diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 3af1bc56a5b..79986544358 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -127,6 +127,8 @@ static char *apr_error_string(ap_status_t statcode) return "The specified child process is not done executing"; case APR_TIMEUP: return "The timeout specified has expired"; + case APR_INCOMPLETE: + return "The input data is incomplete"; case APR_BADCH: return "Bad character specified on command line"; case APR_BADARG: From 0e936dacf70004aea0001ad7b864f8a82b120117 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 13 Jun 2000 15:57:28 +0000 Subject: [PATCH 0218/7878] Allow buildconf to work again. Basiaclly #undef HAVE_BONE_VERSION so that autoconf knows what to do with the AC_DEFINE for it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60193 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/acconfig.h b/acconfig.h index 1403c40a305..cbf02b8cc5a 100644 --- a/acconfig.h +++ b/acconfig.h @@ -55,6 +55,9 @@ #undef HAVE_MM_SHMT_MMFILE +/* BeOS specific flag */ +#undef HAVE_BONE_VERSION + @BOTTOM@ /* Make sure we have ssize_t defined to be something */ From bf754ac40128e9aa227f07dec8a23fd7f459e31f Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 13 Jun 2000 16:26:26 +0000 Subject: [PATCH 0219/7878] Next part of adding support for BONE. Basically this sets up defines that we can use to know what level of support BeOS has available. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60194 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/acconfig.h b/acconfig.h index cbf02b8cc5a..bf3bee3f953 100644 --- a/acconfig.h +++ b/acconfig.h @@ -71,4 +71,11 @@ typedef int socklen_t; #endif +/* switch this on if we have a BeOS version below BONE */ +#if BEOS && !HAVE_BONE_VERSION +#define BEOS_R5 1 +#else +#define BEOS_BONE 1 +#endif + #endif /* APR_PRIVATE_H */ From c14746e88f431d4f6d2de666d8be27a787e4261e Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 13 Jun 2000 16:30:40 +0000 Subject: [PATCH 0220/7878] This starts to take the BeOS defines into the source. I've added support for blocking/non-blocking of pipes as cleanly as I could and have changed the indentation to try and make it clearer. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60195 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileio.h | 5 ++- file_io/unix/pipe.c | 84 +++++++++++++++++++++++--------------- file_io/unix/readwrite.c | 4 +- include/arch/unix/fileio.h | 5 ++- 4 files changed, 63 insertions(+), 35 deletions(-) diff --git a/file_io/unix/fileio.h b/file_io/unix/fileio.h index 3e9c2ca04b5..91306e0d3ed 100644 --- a/file_io/unix/fileio.h +++ b/file_io/unix/fileio.h @@ -98,7 +98,10 @@ #ifdef BEOS #include #endif -#if BEOS && HAVE_ARPA_INET_H +/* BeOS still defines fd_set in sys/socket.h so include it here. + * I'm not just including it as most platforms won't need it... + */ +#if BEOS_BONE #include /* for fd_set definitions */ #endif /* End System headers */ diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 5e00e643606..3b78772676b 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -54,25 +54,36 @@ #include "fileio.h" -static ap_status_t pipenonblock(ap_file_t *thefile) +static ap_status_t pipenonblock(ap_file_t *thepipe) { -#ifndef BEOS /* this code won't work on BeOS */ - int fd_flags = fcntl(thefile->filedes, F_GETFL, 0); - -#if defined(O_NONBLOCK) - fd_flags |= O_NONBLOCK; -#elif defined(O_NDELAY) - fd_flags |= O_NDELAY; -#elif defined(FNDELAY) - fd_flags |= O_FNDELAY; -#else - /* XXXX: this breaks things, but an alternative isn't obvious...*/ - return -1; -#endif - if (fcntl(thefile->filedes, F_SETFL, fd_flags) == -1) { +#if !BEOS /* this code won't work on BeOS */ + int fd_flags; + + int fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); + + #if defined(O_NONBLOCK) + fd_flags |= O_NONBLOCK; + #elif defined(O_NDELAY) + fd_flags |= O_NDELAY; + #elif defined(FNDELAY) + fd_flags |= O_FNDELAY; + #else + /* XXXX: this breaks things, but an alternative isn't obvious...*/ + return -1; + #endif + if (fcntl(thepipe->filedes, F_SETFL, fd_flags) == -1) { + return errno; + } + +#else /* !BEOS */ + +#if BEOS_BONE /* This only works on BONE and later...*/ + int on = 0; + if (ioctl(thepipe->filedes, FIONBIO, &on, sizeof(on)) < 0) return errno; - } -#endif /* !BeOS */ +#endif /* BEOS_BONE */ + +#endif /* !BEOS */ return APR_SUCCESS; } @@ -135,24 +146,33 @@ ap_status_t ap_create_namedpipe(char *filename, ap_status_t ap_block_pipe(ap_file_t *thepipe) { -#ifndef BEOS /* this code won't work on BeOS */ - int fd_flags; - - fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); -#if defined(O_NONBLOCK) - fd_flags &= ~O_NONBLOCK; -#elif defined(~O_NDELAY) - fd_flags &= ~O_NDELAY; -#elif defined(FNDELAY) - fd_flags &= ~O_FNDELAY; -#else - /* XXXX: this breaks things, but an alternative isn't obvious...*/ - return -1; -#endif +#if !BEOS /* this code won't work on BeOS */ + int fd_flags; + + fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); + #if defined(O_NONBLOCK) + fd_flags &= ~O_NONBLOCK; + #elif defined(~O_NDELAY) + fd_flags &= ~O_NDELAY; + #elif defined(FNDELAY) + fd_flags &= ~O_FNDELAY; + #else + /* XXXX: this breaks things, but an alternative isn't obvious...*/ + return -1; + #endif if (fcntl(thepipe->filedes, F_SETFL, fd_flags) == -1) { return errno; } -#endif /* !BeOS */ + +#else + +#if BEOS_BONE /* This only works on BONE or beyond */ + int on = 0; + if (ioctl(thepipe->filedes, FIONBIO, &on, sizeof(on)) < 0) + return errno; +#endif /* BEOS_BONE */ + +#endif /* !BEOS_R5 */ return APR_SUCCESS; } diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index aa3668ebb09..50efa238380 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -55,7 +55,9 @@ #include "fileio.h" #include "apr_lock.h" -#if !BEOS || (BEOS && HAVE_ARPA_INET_H) +/* The only case where we don't use wait_for_io_or_timeout is on + * pre-BONE BeOS, so this check should be sufficient and simpler */ +#if !BEOS_R5 #define USE_WAIT_FOR_IO #endif diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 3e9c2ca04b5..91306e0d3ed 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -98,7 +98,10 @@ #ifdef BEOS #include #endif -#if BEOS && HAVE_ARPA_INET_H +/* BeOS still defines fd_set in sys/socket.h so include it here. + * I'm not just including it as most platforms won't need it... + */ +#if BEOS_BONE #include /* for fd_set definitions */ #endif /* End System headers */ From 809a302a102bc761d44e7239ebe63748ca941e72 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 13 Jun 2000 16:44:34 +0000 Subject: [PATCH 0221/7878] This takes the BeOS defines to include the networking code. Removed some uneeded defines and change some to be more obvious. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60196 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/networkio.h | 12 +++++++----- include/arch/unix/networkio.h | 8 -------- network_io/beos/inet_aton.c | 2 +- network_io/beos/networkio.h | 12 +++++++----- network_io/beos/poll.c | 2 +- network_io/beos/sendrecv.c | 2 +- network_io/beos/sockaddr.c | 2 +- network_io/beos/sockets.c | 2 +- network_io/beos/sockopt.c | 2 +- network_io/unix/networkio.h | 8 -------- 10 files changed, 20 insertions(+), 32 deletions(-) diff --git a/include/arch/beos/networkio.h b/include/arch/beos/networkio.h index b37797cb7d2..3c2bcc5358a 100644 --- a/include/arch/beos/networkio.h +++ b/include/arch/beos/networkio.h @@ -52,8 +52,9 @@ * . */ -#ifdef HAVE_NETINET_TCP_H -#include "../unix/network_io.h" +#include "apr_private.h" +#if BEOS_BONE /* woohoo - we can use the Unix code! */ +#include "../unix/networkio.h" #else #ifndef NETWORK_IO_H @@ -75,13 +76,13 @@ /* The definition of isascii was missed from the PowerPC ctype.h * - * It will be included in the next release, but until then... */ -#if __POWERPC__ + * It will be included in the next release, but until then... + */ +#if !HAVE_isascii #define isascii(c) (((c) & ~0x7f)==0) #endif #include "apr_general.h" -#include /* for the ntohs definition */ #define POLLIN 1 #define POLLPRI 2 @@ -112,6 +113,7 @@ struct ap_pollfd_t { ap_int16_t get_event(ap_int16_t); int inet_aton(const char *cp, struct in_addr *addr); +#include /* for the ntohs definition */ #endif /* ! NETWORK_IO_H */ #endif diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index e2ebc842b45..ad51736873e 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -106,14 +106,6 @@ #endif /* End System Headers */ -/* The definition of isascii was missed from the BeOS PowerPC ctype.h - * - * It will be included in the next release, but until then... - */ -#if (HAVE_ISASCII == 0) -#define isascii(c) (((c) & ~0x7f)==0) -#endif - #ifndef HAVE_POLLIN #define POLLIN 1 #define POLLPRI 2 diff --git a/network_io/beos/inet_aton.c b/network_io/beos/inet_aton.c index 1489487d8dc..7b4103e06b5 100644 --- a/network_io/beos/inet_aton.c +++ b/network_io/beos/inet_aton.c @@ -69,7 +69,7 @@ */ #include "apr_private.h" -#ifndef HAVE_NETINET_TCP_H +#if BEOS_R5 /* this isn't needed for BONE */ #include "networkio.h" diff --git a/network_io/beos/networkio.h b/network_io/beos/networkio.h index b37797cb7d2..3c2bcc5358a 100644 --- a/network_io/beos/networkio.h +++ b/network_io/beos/networkio.h @@ -52,8 +52,9 @@ * . */ -#ifdef HAVE_NETINET_TCP_H -#include "../unix/network_io.h" +#include "apr_private.h" +#if BEOS_BONE /* woohoo - we can use the Unix code! */ +#include "../unix/networkio.h" #else #ifndef NETWORK_IO_H @@ -75,13 +76,13 @@ /* The definition of isascii was missed from the PowerPC ctype.h * - * It will be included in the next release, but until then... */ -#if __POWERPC__ + * It will be included in the next release, but until then... + */ +#if !HAVE_isascii #define isascii(c) (((c) & ~0x7f)==0) #endif #include "apr_general.h" -#include /* for the ntohs definition */ #define POLLIN 1 #define POLLPRI 2 @@ -112,6 +113,7 @@ struct ap_pollfd_t { ap_int16_t get_event(ap_int16_t); int inet_aton(const char *cp, struct in_addr *addr); +#include /* for the ntohs definition */ #endif /* ! NETWORK_IO_H */ #endif diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index 86b0a009478..258b000a51b 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -53,7 +53,7 @@ */ #include "apr_private.h" -#ifdef HAVE_NETINET_TCP_H +#if BEOS_BONE /* BONE uses the unix code - woohoo */ #include "../unix/poll.c" #else #include "networkio.h" diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 8d52f8d988a..389bcdbd23c 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -53,7 +53,7 @@ */ #include "apr_private.h" -#ifdef HAVE_NETINET_TCP_H +#if BEOS_BONE /* BONE uses the unix code - woohoo */ #include "../unix/sendrecv.c" #else #include "networkio.h" diff --git a/network_io/beos/sockaddr.c b/network_io/beos/sockaddr.c index 76fd25d2ed8..17bcb4b1998 100644 --- a/network_io/beos/sockaddr.c +++ b/network_io/beos/sockaddr.c @@ -53,7 +53,7 @@ */ #include "apr_private.h" -#ifdef HAVE_NETINET_TCP_H +#if BEOS_BONE /* BONE uses the unix code - woohoo */ #include "../unix/sockaddr.c" #else #include "networkio.h" diff --git a/network_io/beos/sockets.c b/network_io/beos/sockets.c index f6f109e20f2..9a251bf9182 100644 --- a/network_io/beos/sockets.c +++ b/network_io/beos/sockets.c @@ -53,7 +53,7 @@ */ #include "apr_private.h" -#ifdef HAVE_NETINET_TCP_H +#if BEOS_BONE /* BONE uses the unix code - woohoo */ #include "../unix/sockets.c" #else #include "networkio.h" diff --git a/network_io/beos/sockopt.c b/network_io/beos/sockopt.c index 9710ff2def5..c487dfc29b8 100644 --- a/network_io/beos/sockopt.c +++ b/network_io/beos/sockopt.c @@ -53,7 +53,7 @@ */ #include "apr_private.h" -#ifdef HAVE_NETINET_TCP_H +#if BEOS_BONE /* BONE uses the unix code - woohoo */ #include "../unix/sockopt.c" #else #include "networkio.h" diff --git a/network_io/unix/networkio.h b/network_io/unix/networkio.h index e2ebc842b45..ad51736873e 100644 --- a/network_io/unix/networkio.h +++ b/network_io/unix/networkio.h @@ -106,14 +106,6 @@ #endif /* End System Headers */ -/* The definition of isascii was missed from the BeOS PowerPC ctype.h - * - * It will be included in the next release, but until then... - */ -#if (HAVE_ISASCII == 0) -#define isascii(c) (((c) & ~0x7f)==0) -#endif - #ifndef HAVE_POLLIN #define POLLIN 1 #define POLLPRI 2 From 4e2b9e95fe7eed26ad965df2f855ac9b1859e57e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 13 Jun 2000 19:44:16 +0000 Subject: [PATCH 0222/7878] repair compile breakage from BeOS change a few hours ago (and ViewCVS *is* bitchin') git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60197 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/pipe.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 3b78772676b..cfddb5b453e 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -57,8 +57,6 @@ static ap_status_t pipenonblock(ap_file_t *thepipe) { #if !BEOS /* this code won't work on BeOS */ - int fd_flags; - int fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); #if defined(O_NONBLOCK) From 5117a0b3a20f8362a3908ad0f46332b27f6f177c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 14 Jun 2000 02:58:34 +0000 Subject: [PATCH 0223/7878] straighten out some formatting problems in file_io/unix/readwrite.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60198 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 50efa238380..921fe0882d6 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -103,7 +103,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) ap_ssize_t rv; ap_ssize_t bytes_read; - if(*nbytes <= 0) { + if (*nbytes <= 0) { *nbytes = 0; return APR_SUCCESS; } @@ -136,7 +136,8 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) thefile->bufpos = 0; } - blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size; memcpy(pos, thefile->buffer + thefile->bufpos, blocksize); + blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size; + memcpy(pos, thefile->buffer + thefile->bufpos, blocksize); thefile->bufpos += blocksize; pos += blocksize; size -= blocksize; @@ -156,10 +157,10 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) buf = (char *)buf + 1; (*nbytes)--; thefile->ungetchar = -1; - if (*nbytes == 0) { + if (*nbytes == 0) { *nbytes = bytes_read; return APR_SUCCESS; - } + } } do { @@ -183,11 +184,11 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) #endif *nbytes = bytes_read; if (rv == 0) { - return APR_EOF; + return APR_EOF; } if (rv > 0) { - *nbytes += rv; - return APR_SUCCESS; + *nbytes += rv; + return APR_SUCCESS; } return errno; } @@ -224,7 +225,8 @@ ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; - memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); thefile->bufpos += blocksize; + memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); + thefile->bufpos += blocksize; pos += blocksize; size -= blocksize; } @@ -357,37 +359,44 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) ssize_t rv; int i, used_unget = FALSE, beg_idx; - if(len <= 1) /* as per fgets() */ + if (len <= 1) { /* as per fgets() */ return APR_SUCCESS; + } - if(thefile->ungetchar != -1){ + if (thefile->ungetchar != -1) { str[0] = thefile->ungetchar; used_unget = TRUE; beg_idx = 1; - if(str[0] == '\n' || str[0] == '\r'){ + if (str[0] == '\n' || str[0] == '\r') { thefile->ungetchar = -1; str[1] = '\0'; return APR_SUCCESS; } - } else + } + else { beg_idx = 0; + } for (i = beg_idx; i < len; i++) { rv = read(thefile->filedes, &str[i], 1); if (rv == 0) { thefile->eof_hit = TRUE; - if(used_unget) thefile->filedes = -1; + if (used_unget) { + thefile->filedes = -1; + } str[i] = '\0'; return APR_EOF; } else if (rv != 1) { return errno; } - if (str[i] == '\n' || str[i] == '\r') + if (str[i] == '\n' || str[i] == '\r') { break; + } } - if (i < len-1) + if (i < len-1) { str[i+1] = '\0'; + } return APR_SUCCESS; } From e996abd1bff024dedee610a7d73698a1766bf146 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 14 Jun 2000 14:01:40 +0000 Subject: [PATCH 0224/7878] Fix saferead on beos. The server now works as expected again :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60199 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/sockopt.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/network_io/beos/sockopt.c b/network_io/beos/sockopt.c index c487dfc29b8..333898a8d84 100644 --- a/network_io/beos/sockopt.c +++ b/network_io/beos/sockopt.c @@ -58,9 +58,16 @@ #else #include "networkio.h" +int setnonblocking(int on, int sock) +{ + return setsockopt(sock, SOL_SOCKET, SO_NONBLOCK, + &on, sizeof(on)); +} + ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) { int one; + int rv; if (on){ one = 1; }else { @@ -80,10 +87,26 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) } } if (opt & APR_SO_NONBLOCK) { - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_NONBLOCK, &one, sizeof(one)) == -1){ - return errno; + if ((rv = setnonblocking (one, sock->socketdes)) < 0) { + return errno; } } + if (opt & APR_SO_TIMEOUT) { + if (on > 0 && sock->timeout < 0) + /* we should be in non-blocking mode right now... */ + one = 1; + else if (on < 0 && sock->timeout >= 0) + /* they've set a timeout so we should be blocking... */ + one = 0; + else if (on == 0) + /* we need to be in nonblocking or this will hang the server */ + one = 1; + + if ((rv = setnonblocking (one, sock->socketdes)) < 0) + return rv; + + sock->timeout = on; + } return APR_SUCCESS; } From 0e690dbb62d2038397d75e8c90b492d86f86c3ad Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 14 Jun 2000 16:10:45 +0000 Subject: [PATCH 0225/7878] Win32: use ap_read() in ap_getc() so that it benefits from & doesn't mess with buffering. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60200 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 8124f3fa660..324be185e48 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -245,10 +245,16 @@ ap_status_t ap_ungetc(char ch, ap_file_t *thefile) ap_status_t ap_getc(char *ch, ap_file_t *thefile) { - DWORD bread; - if (!ReadFile(thefile->filehand, ch, 1, &bread, NULL)) { - return GetLastError(); + ap_status_t rc; + int bread; + + bread = 1; + rc = ap_read(thefile, ch, &bread); + + if (rc) { + return rc; } + if (bread == 0) { thefile->eof_hit = TRUE; return APR_EOF; From 5103801b36e26b00d0c9caf92893c9c03c30b826 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 14 Jun 2000 16:31:43 +0000 Subject: [PATCH 0226/7878] Win32: Replace ap_fgets() with the code from OS/2 to make it work properly in buffered mode. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60201 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 44 +++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 324be185e48..4e890554541 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -271,34 +271,28 @@ ap_status_t ap_puts(char *str, ap_file_t *thefile) ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) { - DWORD bread; - int i; - if (!ReadFile(thefile->filehand, str, len, &bread, NULL)) { - switch(GetLastError()) { - case ERROR_HANDLE_EOF: - return APR_EOF; - default: - return GetLastError(); - } - } - if (bread == 0) { - thefile->eof_hit = TRUE; - return APR_EOF; - } - for (i=0; ifilehand, (i - bread), NULL, FILE_CURRENT); - return APR_SUCCESS; + ap_ssize_t readlen; + ap_status_t rv = APR_SUCCESS; + int i; + + for (i = 0; i < len-1; i++) { + readlen = 1; + rv = ap_read(thefile, str+i, &readlen); + + if (readlen != 1) { + rv = APR_EOF; + break; } + + if (str[i] == '\r' || str[i] == '\x1A') + i--; + else if (str[i] == '\n') + break; } - str[i] = '\0'; - return APR_SUCCESS; + str[i] = 0; + return rv; } + ap_status_t ap_flush(ap_file_t *thefile) { if (thefile->buffered) { From 479f29287abddeda667e36722c7c47304cc505ab Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 14 Jun 2000 17:16:47 +0000 Subject: [PATCH 0227/7878] Get non-blocking network I/O working on Windows. Apache serves pages on Windows now. Cleaned up some Windows specific bugs with timing out connections as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60202 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 7 ++++-- network_io/win32/sockopt.c | 47 ++++++++++++++++++++++++++++++-------- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index bfc2295607c..63c19b03a7b 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -97,11 +97,13 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) } (*new)->local_addr->sin_family = AF_INET; + (*new)->remote_addr->sin_family = AF_INET; (*new)->addr_len = sizeof(*(*new)->local_addr); (*new)->local_addr->sin_port = 0; - + + (*new)->timeout = -1; ap_register_cleanup((*new)->cntxt, (void *)(*new), socket_cleanup, ap_null_cleanup); return APR_SUCCESS; @@ -169,6 +171,7 @@ ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_pool_t *con memcpy((*new)->local_addr, sock->local_addr, sizeof(struct sockaddr_in)); (*new)->addr_len = sizeof(struct sockaddr_in); + (*new)->timeout = -1; (*new)->sock = accept(sock->sock, (struct sockaddr *)(*new)->local_addr, &(*new)->addr_len); @@ -176,7 +179,7 @@ ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_pool_t *con if ((*new)->sock == INVALID_SOCKET) { return WSAGetLastError(); } - + ap_register_cleanup((*new)->cntxt, (void *)(*new), socket_cleanup, ap_null_cleanup); return APR_SUCCESS; diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 238d488510c..047f8940f3b 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -60,9 +60,9 @@ ap_status_t soblock(SOCKET sd) { - int one = 1; + int zero = 0; - if (ioctlsocket(sd, FIONBIO, &one) == SOCKET_ERROR) { + if (ioctlsocket(sd, FIONBIO, &zero) == SOCKET_ERROR) { return WSAGetLastError(); } return APR_SUCCESS; @@ -70,9 +70,9 @@ ap_status_t soblock(SOCKET sd) ap_status_t sononblock(SOCKET sd) { - int zero = 0; + int one = 1; - if (ioctlsocket(sd, FIONBIO, &zero) == SOCKET_ERROR) { + if (ioctlsocket(sd, FIONBIO, &one) == SOCKET_ERROR) { return WSAGetLastError(); } return APR_SUCCESS; @@ -90,13 +90,40 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) one = 0; if (opt & APR_SO_TIMEOUT) { - int timeout; - sock->timeout = on; - timeout = on / 1000; /* Windows needs timeout in mSeconds */ - if (setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, (char*) &timeout, - sizeof(timeout)) == SOCKET_ERROR) { - return WSAGetLastError(); + int new_timeout; + if (on <= 0) + new_timeout = on; + else + new_timeout = on/1000; /* Windows needs timeout in mSeconds */ + + if (new_timeout == 0) { + /* Set the socket non-blocking if it isn't already set to non-blocking */ + if (sock->timeout != 0) { + if ((stat = sononblock(sock->sock)) != APR_SUCCESS) + return stat; + } + } + else if (new_timeout > 0) { + /* Set the socket to blocking if it was previously non-blocking */ + if (sock->timeout == 0) { + if ((stat = soblock(sock->sock)) != APR_SUCCESS) + return stat; + } + /* Reset socket timeouts if the new timeout differs from the old timeout */ + if (sock->timeout != new_timeout) { + setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, (char *) &new_timeout, sizeof(new_timeout)); + setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, (char *) &new_timeout, sizeof(new_timeout)); + } + } + else if (new_timeout < 0) { + int zero = 0; + /* Set the socket to blocking with infinite timeouts */ + if ((stat = soblock(sock->sock)) != APR_SUCCESS) + return stat; + setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, (char *) &zero, sizeof(zero)); + setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, (char *) &zero, sizeof(zero)); } + sock->timeout = new_timeout; } if (opt & APR_SO_KEEPALIVE) { if (setsockopt(sock->sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { From ad53bfac0c703512006b5b99f5752fb1e2222487 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 14 Jun 2000 20:38:29 +0000 Subject: [PATCH 0228/7878] Add support to ap_xlate_open() for an app to specify that the charset of the locale is to be used for the source or target charset. At EBCDIC initialization, use the locale charset as one of the pair when setting up the default translation handles for content. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60203 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 1 + configure.in | 4 +++- i18n/unix/xlate.c | 47 ++++++++++++++++++++++++++++++++++++--------- include/apr_xlate.h | 6 +++++- 4 files changed, 47 insertions(+), 11 deletions(-) diff --git a/acconfig.h b/acconfig.h index bf3bee3f953..d639d360dbd 100644 --- a/acconfig.h +++ b/acconfig.h @@ -29,6 +29,7 @@ /* Various #defines we need to know about */ #undef HAVE_LOCK_EX #undef HAVE_F_SETLK +#undef HAVE_CODESET #undef HAVE_PTHREAD_PROCESS_SHARED #undef DEV_RANDOM #undef HAVE_TRUERAND diff --git a/configure.in b/configure.in index dc5a29cb807..fb3b3463661 100644 --- a/configure.in +++ b/configure.in @@ -193,7 +193,7 @@ AC_CHECK_LIB(truerand,main) dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) -AC_CHECK_FUNCS(strcasecmp stricmp setsid) +AC_CHECK_FUNCS(strcasecmp stricmp setsid nl_langinfo) AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) AC_CHECK_FUNCS(writev) AC_CHECK_FUNCS(sendfile, [ sendfile="1" ], [ sendfile="0" ]) @@ -264,6 +264,7 @@ AC_CHECK_HEADERS(arpa/inet.h) AC_CHECK_HEADERS(netinet/in.h, netinet_inh="1", netinet_inh="0") AC_CHECK_HEADERS(netinet/tcp.h) AC_CHECK_HEADERS(iconv.h) +AC_CHECK_HEADERS(langinfo.h) AC_CHECK_HEADERS(sys/file.h) AC_CHECK_HEADERS(sys/ioctl.h) @@ -541,6 +542,7 @@ AC_SUBST(have_union_semun) dnl Checks for libraries. AC_CHECK_DEFINE(LOCK_EX, sys/file.h) AC_CHECK_DEFINE(F_SETLK, fcntl.h) +AC_CHECK_DEFINE(CODESET, langinfo.h) AC_CHECK_DEFINE(isascii, ctype.h) # We are assuming that if the platform doesn't have POLLIN, it doesn't have # any POLL definitions. diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index a0d4435db5e..d7f2fa13735 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -63,6 +63,9 @@ #if APR_HAS_XLATE +#ifdef HAVE_LANGINFO_H +#include +#endif #ifdef HAVE_ICONV_H #include #endif @@ -81,7 +84,7 @@ struct ap_xlate_t { #endif }; -/* get_default_codepage() +/* get_default_charset() * * simple heuristic to determine codepage of source code so that * literal strings (e.g., "GET /\r\n") in source code can be translated @@ -92,7 +95,7 @@ struct ap_xlate_t { * unpacked. */ -static const char *get_default_codepage(void) +static const char *get_default_charset(void) { #ifdef __MVS__ #ifdef __CODESET__ @@ -121,6 +124,37 @@ static const char *get_default_codepage(void) return "unknown"; } +/* get_locale_charset() + * + * If possible on this system, get the charset of the locale. Otherwise, + * defer to get_default_charset(). + */ + +static const char *get_locale_charset(void) +{ +#if defined(HAVE_NL_LANGINFO) && defined(HAVE_CODESET) + const char *charset; + charset = nl_langinfo(CODESET); + if (charset) { + return charset; + } +#endif + return get_default_charset(); +} + +static const char *handle_special_names(const char *page) +{ + if (page == APR_DEFAULT_CHARSET) { + return get_default_charset(); + } + else if (page == APR_LOCALE_CHARSET) { + return get_locale_charset(); + } + else { + return page; + } +} + static ap_status_t ap_xlate_cleanup(void *convset) { #ifdef HAVE_ICONV @@ -176,14 +210,9 @@ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, int found = 0; *convset = NULL; - - if (!topage) { - topage = get_default_codepage(); - } - if (!frompage) { - frompage = get_default_codepage(); - } + topage = handle_special_names(topage); + frompage = handle_special_names(frompage); new = (ap_xlate_t *)ap_pcalloc(pool, sizeof(ap_xlate_t)); if (!new) { diff --git a/include/apr_xlate.h b/include/apr_xlate.h index fda8d6d5d53..0a7a8a71052 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -120,12 +120,16 @@ B: Specify APR_DEFAULT_CHARSET for one of the charset of the caller was not encoded in the same charset as APR at compile time. + Specify APR_LOCALE_CHARSET for one of the charset + names to indicate the charset of the current locale. + =cut */ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, const char *frompage, ap_pool_t *pool); -#define APR_DEFAULT_CHARSET NULL +#define APR_DEFAULT_CHARSET (const char *)0 +#define APR_LOCALE_CHARSET (const char *)1 /* From 01c49cb0042e7c71fc98229ccdefc5f1f82fd43f Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 14 Jun 2000 20:55:59 +0000 Subject: [PATCH 0229/7878] Win32: Cleanup ap_setsockopt(). First cut at implementing ap_getsockopt() and iol_getopt(). Do we need to move iol into APR? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60204 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 2 +- include/apr_network_io.h | 26 ++++++++++++++++ libapr.def | 2 +- network_io/win32/sendrecv.c | 1 + network_io/win32/sockopt.c | 61 ++++++++++++++++++++++++++----------- 5 files changed, 73 insertions(+), 19 deletions(-) diff --git a/aprlib.def b/aprlib.def index 0cb5bc1ce75..869b01f3aea 100644 --- a/aprlib.def +++ b/aprlib.def @@ -79,7 +79,7 @@ EXPORTS ap_get_os_sock @70 ap_remove_poll_socket @71 ap_clear_poll_sockets @72 -; ap_setipaddr @73 + ap_getsocketopt @73 ; ap_getipaddr @74 ; ap_create_signal @75 ; ap_setup_signal @76 diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 7bfe8302fa3..2de4247c935 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -422,6 +422,32 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on); /* +=head1 ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t* on) + +B + + arg 1) The socket to query + arg 2) The option we would like to query. One of: + APR_SO_DEBUG -- turn on debugging information + APR_SO_KEEPALIVE -- keep connections active + APR_SO_LINGER -- lingers on close if data is present + APR_SO_NONBLOCK -- Turns blocking on/off for socket + APR_SO_REUSEADDR -- The rules used in validating addresses + supplied to bind should allow reuse + of local addresses. + APR_SO_TIMEOUT -- Set the timeout value in microseconds. + values < 0 mean wait forever. 0 means + don't wait at all. + APR_SO_SNDBUF -- Set the SendBufferSize + APR_SO_RCVBUF -- Set the ReceiveBufferSize + arg 3) Socket option returned on the call. + +=cut + */ +ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t* on); + +/* + =head1 ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) Assocaite a local port with a socket. diff --git a/libapr.def b/libapr.def index 0cb5bc1ce75..869b01f3aea 100644 --- a/libapr.def +++ b/libapr.def @@ -79,7 +79,7 @@ EXPORTS ap_get_os_sock @70 ap_remove_poll_socket @71 ap_clear_poll_sockets @72 -; ap_setipaddr @73 + ap_getsocketopt @73 ; ap_getipaddr @74 ; ap_create_signal @75 ; ap_setup_signal @76 diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index aca38155355..06230bf247e 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -100,6 +100,7 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) *len = dwBytes; return APR_SUCCESS; + } ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 047f8940f3b..afe2b6c11d4 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -81,23 +81,21 @@ ap_status_t sononblock(SOCKET sd) ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) { int one; - struct linger li; ap_status_t stat; - if (on) - one = 1; - else - one = 0; + one = on ? 1 : 0; - if (opt & APR_SO_TIMEOUT) { + switch (opt) { + case APR_SO_TIMEOUT: + { int new_timeout; if (on <= 0) new_timeout = on; else new_timeout = on/1000; /* Windows needs timeout in mSeconds */ - + if (new_timeout == 0) { - /* Set the socket non-blocking if it isn't already set to non-blocking */ + /* Set the socket non-blocking if it was previously blocking */ if (sock->timeout != 0) { if ((stat = sononblock(sock->sock)) != APR_SUCCESS) return stat; @@ -124,23 +122,24 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, (char *) &zero, sizeof(zero)); } sock->timeout = new_timeout; + break; } - if (opt & APR_SO_KEEPALIVE) { + case APR_SO_KEEPALIVE: if (setsockopt(sock->sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { return WSAGetLastError(); } - } - if (opt & APR_SO_DEBUG) { + break; + case APR_SO_DEBUG: if (setsockopt(sock->sock, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { return WSAGetLastError(); } - } - if (opt & APR_SO_REUSEADDR) { + break; + case APR_SO_REUSEADDR: if (setsockopt(sock->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { return WSAGetLastError(); } - } - if (opt & APR_SO_NONBLOCK) { + break; + case APR_SO_NONBLOCK: if (on) { if ((stat = soblock(sock->sock)) != APR_SUCCESS) return stat; @@ -149,17 +148,45 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) if ((stat = sononblock(sock->sock)) != APR_SUCCESS) return stat; } - } - if (opt & APR_SO_LINGER) { + break; + case APR_SO_LINGER: + { + struct linger li; li.l_onoff = on; li.l_linger = MAX_SECS_TO_LINGER; if (setsockopt(sock->sock, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { return WSAGetLastError(); } + break; + } + default: + return APR_EINVAL; + break; } return APR_SUCCESS; } +ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) +{ + switch (opt) { + case APR_SO_TIMEOUT: + /* Do we want to store sock->timeout in APR units or windows units? */ + *on = sock->timeout * 1000; /* Convert from milliseconds (windows units) to microseconds + * (APR units) */ + break; + case APR_SO_KEEPALIVE: + case APR_SO_DEBUG: + case APR_SO_REUSEADDR: + case APR_SO_NONBLOCK: + case APR_SO_LINGER: + default: + return APR_ENOTIMPL; + break; + } + return APR_SUCCESS; +} + + ap_status_t ap_gethostname(char *buf, int len, ap_pool_t *cont) { if (gethostname(buf, len) == -1) From 36006b5b7622d6ca9155156af50d17dcde5a509f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 15 Jun 2000 00:07:22 +0000 Subject: [PATCH 0230/7878] Get rid of some unnecessary parameter checking (let it segfault). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60205 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 2f14cdc2529..ba0d24355d9 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -208,32 +208,17 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock) { - if (sock != NULL) { - return ap_get_userdata(data, key, sock->cntxt); - } - else { - data = NULL; - return APR_ENOSOCKET; - } + return ap_get_userdata(data, key, sock->cntxt); } ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key, ap_status_t (*cleanup) (void *)) { - if (sock != NULL) { - return ap_set_userdata(data, key, cleanup, sock->cntxt); - } - else { - data = NULL; - return APR_ENOSOCKET; - } + return ap_set_userdata(data, key, cleanup, sock->cntxt); } ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) { - if (sock == NULL) { - return APR_ENOSOCKET; - } *thesock = sock->socketdes; return APR_SUCCESS; } @@ -241,9 +226,6 @@ ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, ap_pool_t *cont) { - if (cont == NULL) { - return APR_ENOPOOL; - } if ((*sock) == NULL) { (*sock) = (ap_socket_t *)ap_pcalloc(cont, sizeof(ap_socket_t)); (*sock)->cntxt = cont; From 9e19890e313b3e5450645c43942da3545a3ba3c9 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Thu, 15 Jun 2000 13:12:12 +0000 Subject: [PATCH 0231/7878] Add -Kthread for ReliantUNIX git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60206 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index fb3b3463661..38ca6a1e6a9 100644 --- a/configure.in +++ b/configure.in @@ -74,12 +74,17 @@ AC_ARG_WITH(maintainer-mode,[ --with-maintainer-mode Turn on debugging and com dnl # this is the place to put specific options for platform/compiler dnl # combinations case "$OS:$CC" in - *-hp-hpux*:cc ) CFLAGS="$CFLAGS -Ae +DAportable" ;; + *-hp-hpux*:cc ) + CFLAGS="$CFLAGS -Ae +DAportable" + ;; powerpc-*-beos:mwcc* ) CPP="mwcc -E" CC="mwcc" AR="ar" ;; + mips-sni-sysv4:cc ) + CFLAGS="$CFLAGS -Kthread" + ;; esac case "$OS" in From 6b19572fd144b52c08eb6308f3e1f929eb9b2f41 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 15 Jun 2000 15:33:21 +0000 Subject: [PATCH 0232/7878] Fix some typos in the doc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60207 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 58fb6a5944f..bb08ec1f842 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -127,7 +127,7 @@ struct ap_finfo_t { /* Function definitions */ /* -=head1 ap_status_t ap_open(ap_file_t **new, char *fname, ap_int32 flag, ap_fileperms perm, ap_pool_t *cont) +=head1 ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cont) B @@ -278,7 +278,7 @@ ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes); /* -=head1 ap_status_t ap_writev(ap_file_t *thefile, struct iovec *vec, ap_size_t nvec, ap_ssize_t *nbytes) +=head1 ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nvec, ap_ssize_t *nbytes) B @@ -413,7 +413,7 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile); /* -=head1 ap_status_t ap_stat(ap_finfo_t **finfo, char *fname, ap_pool_t *cont) +=head1 ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) B @@ -427,7 +427,7 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont); /* -=head1 ap_status_t ap_lstat(ap_finfo_t **finfo, char *fname, ap_pool_t *cont) +=head1 ap_status_t ap_lstat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) B @@ -461,7 +461,7 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where,ap_off_t *offset); /* -=head1 ap_status_t ap_opendir(ap_dir_t **new, char *dirname, ap_pool_t *cont) +=head1 ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cont) B @@ -570,12 +570,12 @@ ap_status_t ap_create_namedpipe(char *filename, ap_fileperms_t perm, /* -=head1 ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_int32_t timeout) +=head1 ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) B arg 1) The pipe we are setting a timeout on. - arg 2) The timeout value in seconds. Values < 0 mean wait forever, 0 + arg 2) The timeout value in microseconds. Values < 0 mean wait forever, 0 means do not wait at all. =cut @@ -638,7 +638,7 @@ ap_status_t ap_get_filedata(void **data, char *key, ap_file_t *file); /* -=head1 ap_status_t ap_set_filedata(ap_file_t *file, void *data, char *key, ap_status (*cleanup) (void *)) +=head1 ap_status_t ap_set_filedata(ap_file_t *file, void *data, char *key, ap_status_t (*cleanup) (void *)) B From b57375e1d97576c720e641c08de9062a1a467727 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 15 Jun 2000 17:03:58 +0000 Subject: [PATCH 0233/7878] Add missing const qualifier to two ap_unix_child_init_lock() implementations. Submitted by: Victor Orlikowski Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60208 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/crossproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index e5f3d5f48c5..0958529ba0b 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -130,7 +130,7 @@ ap_status_t ap_unix_destroy_inter_lock(ap_lock_t *lock) return stat; } -ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, char *fname) +ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const char *fname) { return APR_SUCCESS; } @@ -230,7 +230,7 @@ ap_status_t ap_unix_destroy_inter_lock(ap_lock_t *lock) return stat; } -ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, char *fname) +ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const char *fname) { return APR_SUCCESS; } From d67b7906e25a58212f3cbc061c34a550c60cb971 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 15 Jun 2000 17:39:17 +0000 Subject: [PATCH 0234/7878] Change filename arg of ap_remove_file() from char * to const char *. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60209 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 2 +- file_io/unix/open.c | 2 +- file_io/win32/open.c | 2 +- include/apr_file_io.h | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 081cee791e7..7047878bf98 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -180,7 +180,7 @@ ap_status_t ap_close(ap_file_t *file) -ap_status_t ap_remove_file(char *path, ap_pool_t *cntxt) +ap_status_t ap_remove_file(const char *path, ap_pool_t *cntxt) { ULONG rc = DosDelete(path); return APR_OS2_STATUS(rc); diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 6e0039ac73c..dff6a0fb4b4 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -169,7 +169,7 @@ ap_status_t ap_close(ap_file_t *file) return rv; } -ap_status_t ap_remove_file(char *path, ap_pool_t *cont) +ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) { if (unlink(path) == 0) { return APR_SUCCESS; diff --git a/file_io/win32/open.c b/file_io/win32/open.c index d7d9b5b06ec..222fd14bb86 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -184,7 +184,7 @@ ap_status_t ap_close(ap_file_t *file) return stat; } -ap_status_t ap_remove_file(char *path, ap_pool_t *cont) +ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) { char *temp = canonical_filename(cont, path); diff --git a/include/apr_file_io.h b/include/apr_file_io.h index bb08ec1f842..490c676a5a2 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -170,7 +170,7 @@ ap_status_t ap_close(ap_file_t *file); /* -=head1 ap_status_t ap_remove_file(char *path, ap_pool_t *cont) +=head1 ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) B @@ -182,7 +182,7 @@ B: If the file is open, it won't be removed until all instances are =cut */ -ap_status_t ap_remove_file(char *path, ap_pool_t *cont); +ap_status_t ap_remove_file(const char *path, ap_pool_t *cont); /* From a57b55a385919ff7ce48bd8168a00524743b216b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 15 Jun 2000 18:54:09 +0000 Subject: [PATCH 0235/7878] Use ap_interval_time_t for timeout arg of ap_set_pipe_timeout() (to match prototype in apr_file_io.h). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60210 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index f18e6aca015..d967c9ca6af 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -63,7 +63,7 @@ #include #include "misc.h" -ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_int32_t timeout) +ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) { DWORD dwMode; ap_oslevel_e oslevel; From 4707780b56c450707ca32dec91bf6a934899b6a5 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 16 Jun 2000 15:09:43 +0000 Subject: [PATCH 0236/7878] Win32: Fix problem with UTC offset not being correctly reported in the access log. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60211 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/time.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/time/win32/time.c b/time/win32/time.c index 76d62de33e1..ebe3addc03f 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -89,6 +89,9 @@ void AprTimeToFileTime(LPFILETIME pft, ap_time_t t) void SystemTimeToAprExpTime(ap_exploded_time_t *xt, SYSTEMTIME *tm) { + TIME_ZONE_INFORMATION tz; + DWORD rc; + xt->tm_usec = tm->wMilliseconds * 1000; xt->tm_sec = tm->wSecond; xt->tm_min = tm->wMinute; @@ -98,8 +101,25 @@ void SystemTimeToAprExpTime(ap_exploded_time_t *xt, SYSTEMTIME *tm) xt->tm_year = tm->wYear - 1900; xt->tm_wday = tm->wDayOfWeek; xt->tm_yday = 0; /* ToDo: need to compute this */ - xt->tm_isdst = 0; /* ToDo: need to compute this */ - xt->tm_gmtoff = 0; /* ToDo: maybe the caller should set this explicitly */ + + rc = GetTimeZoneInformation(&tz); + switch (rc) { + case TIME_ZONE_ID_UNKNOWN: + case TIME_ZONE_ID_STANDARD: + xt->tm_isdst = 0; + /* Bias = UTC - local time in minutes + * tm_gmtoff is seconds east of UTC + */ + xt->tm_gmtoff = tz.Bias * 60; + break; + case TIME_ZONE_ID_DAYLIGHT: + xt->tm_isdst = 1; + xt->tm_gmtoff = tz.Bias * 60; + break; + default: + xt->tm_isdst = 0; + xt->tm_gmtoff = 0; + } return; } @@ -109,7 +129,7 @@ ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input) return APR_SUCCESS; } -/* Return micro-seconds since the Unix epoch (jan. 1, 1970) */ +/* Return micro-seconds since the Unix epoch (jan. 1, 1970) UTC */ ap_time_t ap_now(void) { LONGLONG aprtime = 0; @@ -126,7 +146,6 @@ ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input) AprTimeToFileTime(&ft, input); FileTimeToSystemTime(&ft, &st); SystemTimeToAprExpTime(result, &st); - result->tm_gmtoff = 0; return APR_SUCCESS; } From cc9321008cdff70280175ae5e051040421b18837 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 16 Jun 2000 16:41:09 +0000 Subject: [PATCH 0237/7878] Turn on buffering for config file reads. This is dependent on ap_fgets() doing the right thing. Brian Havard implemented buffering for ap_fgets() on Win32 recently; OS/2 had it already. This provides it for Unix. changes to ap_read(), ap_getc(), ap_fgets() for Unix: 1) this fixes a problem in where ap_open() where a lock is created for non-buffered files 2) this fixes problems setting rv correctly in the ap_read() buffered path 3) since ap_read() works as expected, it is possible to make ap_getc() and ap_fgets() even smaller 4) ap_fgets() no longer cares about '\r' git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60212 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 21 +++- file_io/unix/readwrite.c | 93 +++++++----------- test/testfile.c | 200 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 250 insertions(+), 64 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index dff6a0fb4b4..e5c8aa6af0a 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -82,6 +82,9 @@ ap_status_t ap_unix_file_cleanup(void *thefile) ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cont) { int oflags = 0; +#if APR_HAS_THREADS + ap_status_t rv; +#endif if ((*new) == NULL) { (*new) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); @@ -90,10 +93,6 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil (*new)->cntxt = cont; (*new)->oflags = oflags; (*new)->filedes = -1; - (*new)->buffer = NULL; -#if APR_HAS_THREADS - ap_create_lock(&((*new)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, cont); -#endif if ((flag & APR_READ) && (flag & APR_WRITE)) { oflags = O_RDWR; @@ -112,6 +111,20 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil (*new)->buffered = (flag & APR_BUFFERED) > 0; + if ((*new)->buffered) { + (*new)->buffer = ap_palloc(cont, APR_FILE_BUFSIZE); +#if APR_HAS_THREADS + rv = ap_create_lock(&((*new)->thlock), APR_MUTEX, APR_INTRAPROCESS, + NULL, cont); + if (rv) { + return rv; + } +#endif + } + else { + (*new)->buffer = NULL; + } + if (flag & APR_CREATE) { oflags |= O_CREAT; if (flag & APR_EXCL) { diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 921fe0882d6..5fa1bd4e171 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -98,6 +98,9 @@ static ap_status_t wait_for_io_or_timeout(ap_file_t *file, int for_read) } #endif +/* problems: + * 1) ungetchar not used for buffered files + */ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) { ap_ssize_t rv; @@ -130,6 +133,11 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) thefile->dataRead = read(thefile->filedes, thefile->buffer, APR_FILE_BUFSIZE); if (thefile->dataRead == 0) { thefile->eof_hit = TRUE; + rv = APR_EOF; + break; + } + else if (thefile->dataRead == -1) { + rv = errno; break; } thefile->filePtr += thefile->dataRead; @@ -143,7 +151,10 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) size -= blocksize; } - *nbytes = rv == 0 ? pos - (char *)buf : 0; + *nbytes = pos - (char *)buf; + if (*nbytes) { + rv = 0; + } #if APR_HAS_THREADS ap_unlock(thefile->thlock); #endif @@ -301,22 +312,9 @@ ap_status_t ap_ungetc(char ch, ap_file_t *thefile) ap_status_t ap_getc(char *ch, ap_file_t *thefile) { - ssize_t rv; - - if (thefile->ungetchar != -1) { - *ch = (char) thefile->ungetchar; - thefile->ungetchar = -1; - return APR_SUCCESS; - } - rv = read(thefile->filedes, ch, 1); - if (rv == 0) { - thefile->eof_hit = TRUE; - return APR_EOF; - } - else if (rv != 1) { - return errno; - } - return APR_SUCCESS; + ap_ssize_t nbytes = 1; + + return ap_read(thefile, ch, &nbytes); } ap_status_t ap_puts(char *str, ap_file_t *thefile) @@ -356,59 +354,34 @@ ap_status_t ap_flush(ap_file_t *thefile) ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) { - ssize_t rv; - int i, used_unget = FALSE, beg_idx; + ap_status_t rv = APR_SUCCESS; /* get rid of gcc warning */ + ap_ssize_t nbytes; + char *final = str + len - 1; - if (len <= 1) { /* as per fgets() */ + if (len <= 1) { + /* sort of like fgets(), which returns NULL and stores no bytes + */ return APR_SUCCESS; } - if (thefile->ungetchar != -1) { - str[0] = thefile->ungetchar; - used_unget = TRUE; - beg_idx = 1; - if (str[0] == '\n' || str[0] == '\r') { - thefile->ungetchar = -1; - str[1] = '\0'; - return APR_SUCCESS; - } - } - else { - beg_idx = 0; - } - - for (i = beg_idx; i < len; i++) { - rv = read(thefile->filedes, &str[i], 1); - if (rv == 0) { - thefile->eof_hit = TRUE; - if (used_unget) { - thefile->filedes = -1; - } - str[i] = '\0'; - return APR_EOF; - } - else if (rv != 1) { - return errno; + while (str < final) { /* leave room for trailing '\0' */ + nbytes = 1; + rv = ap_read(thefile, str, &nbytes); + if (rv != APR_SUCCESS) { + break; } - if (str[i] == '\n' || str[i] == '\r') { + if (*str == '\n') { + ++str; break; } + ++str; } - if (i < len-1) { - str[i+1] = '\0'; - } - return APR_SUCCESS; -} - -#if 0 /* not currently used */ -static int printf_flush(ap_vformatter_buff_t *vbuff) -{ - /* I would love to print this stuff out to the file, but I will - * get that working later. :) For now, just return. + /* We must store a terminating '\0' if we've stored any chars. We can + * get away with storing it if we hit an error first. */ - return -1; + *str = '\0'; + return rv; } -#endif APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) { diff --git a/test/testfile.c b/test/testfile.c index 32311354a28..d0ce629f32d 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -52,6 +52,7 @@ * . */ +#include #include #include #include "apr_file_io.h" @@ -65,6 +66,7 @@ int test_filedel(ap_pool_t *); int testdirs(ap_pool_t *); +static void test_read(ap_pool_t *); int main() { @@ -239,6 +241,7 @@ int main() testdirs(context); test_filedel(context); + test_read(context); return 1; } @@ -383,3 +386,200 @@ int testdirs(ap_pool_t *context) return 1; } +#define TESTREAD_BLKSIZE 1024 +#define APR_BUFFERSIZE 4096 /* This should match APR's buffer size. */ + +static void create_testread(ap_pool_t *p, const char *fname) +{ + ap_file_t *f = NULL; + ap_status_t rv; + char buf[TESTREAD_BLKSIZE]; + ap_ssize_t nbytes; + + /* Create a test file with known content. + */ + rv = ap_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); + if (rv) { + fprintf(stderr, "ap_open()->%d/%s\n", + rv, ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + nbytes = 4; + rv = ap_write(f, "abc\n", &nbytes); + assert(!rv && nbytes == 4); + memset(buf, 'a', sizeof buf); + nbytes = sizeof buf; + rv = ap_write(f, buf, &nbytes); + assert(!rv && nbytes == sizeof buf); + nbytes = 2; + rv = ap_write(f, "\n\n", &nbytes); + assert(!rv && nbytes == 2); + rv = ap_close(f); + assert(!rv); +} + +static char read_one(ap_file_t *f, int expected) +{ + char bytes[3]; + ap_status_t rv; + static int counter = 0; + ap_ssize_t nbytes; + + counter += 1; + + bytes[0] = bytes[2] = 0x01; + if (counter % 2) { + rv = ap_getc(bytes + 1, f); + } + else { + nbytes = 1; + rv = ap_read(f, bytes + 1, &nbytes); + assert(nbytes == 1); + } + assert(!rv); + assert(bytes[0] == 0x01 && bytes[2] == 0x01); + if (expected != -1) { + assert(bytes[1] == expected); + } + return bytes[1]; +} + +static void test_read_guts(ap_pool_t *p, const char *fname, ap_int32_t extra_flags) +{ + ap_file_t *f = NULL; + ap_status_t rv; + ap_ssize_t nbytes; + char buf[1024]; + int i; + + rv = ap_open(&f, fname, APR_READ | extra_flags, 0, p); + assert(!rv); + read_one(f, 'a'); + read_one(f, 'b'); + if (extra_flags & APR_BUFFERED) { + fprintf(stdout, + "\n\t\tskipping ap_ungetc() for APR_BUFFERED... " + "doesn't work yet...\n\t\t\t\t "); + } + else { + rv = ap_ungetc('z', f); + assert(!rv); + rv = ap_ungetc('a', f); + assert(!rv); /* we just overwrote the previously-un-got char */ + read_one(f, 'a'); + } + read_one(f, 'c'); + read_one(f, '\n'); + for (i = 0; i < TESTREAD_BLKSIZE; i++) { + read_one(f, 'a'); + } + read_one(f, '\n'); + read_one(f, '\n'); + rv = ap_getc(buf, f); + assert(rv == APR_EOF); + rv = ap_close(f); + assert(!rv); + + f = NULL; + rv = ap_open(&f, fname, APR_READ | extra_flags, 0, p); + assert(!rv); + rv = ap_fgets(buf, 10, f); + assert(!rv); + assert(!strcmp(buf, "abc\n")); + /* read first 800 of TESTREAD_BLKSIZE 'a's + */ + rv = ap_fgets(buf, 801, f); + assert(!rv); + assert(strlen(buf) == 800); + for (i = 0; i < 800; i++) { + assert(buf[i] == 'a'); + } + /* read rest of the 'a's and the first newline + */ + rv = ap_fgets(buf, sizeof buf, f); + assert(!rv); + assert(strlen(buf) == TESTREAD_BLKSIZE - 800 + 1); + for (i = 0; i < TESTREAD_BLKSIZE - 800; i++) { + assert(buf[i] == 'a'); + } + assert(buf[TESTREAD_BLKSIZE - 800] == '\n'); + /* read the last newline + */ + rv = ap_fgets(buf, sizeof buf, f); + assert(!rv); + assert(!strcmp(buf, "\n")); + /* get APR_EOF + */ + rv = ap_fgets(buf, sizeof buf, f); + assert(rv == APR_EOF); + /* get APR_EOF with ap_getc + */ + rv = ap_getc(buf, f); + assert(rv == APR_EOF); + /* get APR_EOF with ap_read + */ + nbytes = sizeof buf; + rv = ap_read(f, buf, &nbytes); + assert(rv == APR_EOF); + rv = ap_close(f); + assert(!rv); +} + +static void test_bigread(ap_pool_t *p, const char *fname, ap_int32_t extra_flags) +{ + ap_file_t *f = NULL; + ap_status_t rv; + char buf[APR_BUFFERSIZE * 2]; + ap_ssize_t nbytes; + + /* Create a test file with known content. + */ + rv = ap_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); + if (rv) { + fprintf(stderr, "ap_open()->%d/%s\n", + rv, ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + nbytes = APR_BUFFERSIZE; + memset(buf, 0xFE, nbytes); + rv = ap_write(f, buf, &nbytes); + assert(!rv && nbytes == APR_BUFFERSIZE); + rv = ap_close(f); + assert(!rv); + + f = NULL; + rv = ap_open(&f, fname, APR_READ | extra_flags, 0, p); + assert(!rv); + nbytes = sizeof buf; + rv = ap_read(f, buf, &nbytes); + assert(!rv); + assert(nbytes == APR_BUFFERSIZE); + rv = ap_close(f); + assert(!rv); +} + +static void test_read(ap_pool_t *p) +{ + const char *fname = "testread.dat"; + ap_status_t rv; + + fprintf(stdout, "Testing file read functions.\n"); + + create_testread(p, fname); + fprintf(stdout, "\tBuffered file tests......"); + test_read_guts(p, fname, APR_BUFFERED); + fprintf(stdout, "OK\n"); + fprintf(stdout, "\tUnbuffered file tests...."); + test_read_guts(p, fname, 0); + fprintf(stdout, "OK\n"); + fprintf(stdout, "\tMore buffered file tests......"); + test_bigread(p, fname, APR_BUFFERED); + fprintf(stdout, "OK\n"); + fprintf(stdout, "\tMore unbuffered file tests......"); + test_bigread(p, fname, 0); + fprintf(stdout, "OK\n"); + rv = ap_remove_file(fname, p); + assert(!rv); + fprintf(stdout, "\tAll read tests...........OK\n"); +} + From e1283b2b01c20cdfad655414a0256a4b9505102b Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 17 Jun 2000 11:11:40 +0000 Subject: [PATCH 0238/7878] Tidy up some warnings in the threadproc directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60213 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/threadproc.h | 3 ++- threadproc/beos/proc.c | 4 +--- threadproc/beos/thread.c | 3 +-- threadproc/beos/threadpriv.c | 2 +- threadproc/beos/threadproc.h | 3 ++- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h index d7ce37f793e..2af13722578 100644 --- a/include/arch/beos/threadproc.h +++ b/include/arch/beos/threadproc.h @@ -59,10 +59,11 @@ #include "apr_file_io.h" #include "apr_general.h" #include "apr_portable.h" -#include +#include #include #include #include +#include #ifndef THREAD_PROC_H #define THREAD_PROC_H diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 247b082bfc4..84b7ce9e393 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -195,8 +195,6 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, int i=0,nargs=0; char **newargs = NULL; thread_id newproc, sender; - char * buffer = NULL; - size_t bufsize = 0; struct send_pipe *sp; char * dir = NULL; @@ -234,7 +232,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, } newargs[nargs] = NULL; - newproc = load_image(nargs, newargs, env); + newproc = load_image(nargs, (const char**)newargs, (const char**)env); /* load_image copies the data so now we can free it... */ while (--nargs >= 0) diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 85988eb93ae..0793f1e8044 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -56,8 +56,6 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) { - ap_status_t stat; - (*new) = (ap_threadattr_t *)ap_palloc(cont, sizeof(ap_threadattr_t)); (*new)->attr = (int32)ap_palloc(cont, @@ -135,6 +133,7 @@ ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) { ap_destroy_pool(thd->cntxt); exit_thread ((status_t)retval); + return APR_SUCCESS; } ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index bb81fe23e2c..a2d7de6f4f6 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -122,7 +122,7 @@ ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) tid = find_thread(NULL); for (i=0; i < BEOS_MAX_DATAKEYS; i++){ if (beos_data[i]->data){ - if (beos_data[i]->td = tid){index = i;} + if (beos_data[i]->td == tid){index = i;} } } if (index==0){ diff --git a/threadproc/beos/threadproc.h b/threadproc/beos/threadproc.h index d7ce37f793e..2af13722578 100644 --- a/threadproc/beos/threadproc.h +++ b/threadproc/beos/threadproc.h @@ -59,10 +59,11 @@ #include "apr_file_io.h" #include "apr_general.h" #include "apr_portable.h" -#include +#include #include #include #include +#include #ifndef THREAD_PROC_H #define THREAD_PROC_H From c209d080846ef19f4404f8e52abd0a7993aee5a5 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 17 Jun 2000 11:32:38 +0000 Subject: [PATCH 0239/7878] Continuing the cleanup of beos code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60214 13f79535-47bb-0310-9956-ffa450edef68 --- dso/beos/dso.h | 1 + include/arch/beos/dso.h | 1 + include/arch/beos/locks.h | 27 +++++++++++++++++++-------- lib/apr_md5.c | 2 +- locks/beos/crossproc.c | 2 +- locks/beos/locks.h | 27 +++++++++++++++++++-------- misc/unix/otherchild.c | 3 +++ network_io/unix/sockopt.c | 4 ++-- time/unix/time.c | 3 +++ 9 files changed, 50 insertions(+), 20 deletions(-) diff --git a/dso/beos/dso.h b/dso/beos/dso.h index 27e35f87e67..71a75ef58d6 100644 --- a/dso/beos/dso.h +++ b/dso/beos/dso.h @@ -62,6 +62,7 @@ #include "apr_dso.h" #include "apr.h" #include +#include #if APR_HAS_DSO diff --git a/include/arch/beos/dso.h b/include/arch/beos/dso.h index 27e35f87e67..71a75ef58d6 100644 --- a/include/arch/beos/dso.h +++ b/include/arch/beos/dso.h @@ -62,6 +62,7 @@ #include "apr_dso.h" #include "apr.h" #include +#include #if APR_HAS_DSO diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h index 0160b5e71aa..fefc0d30ae9 100644 --- a/include/arch/beos/locks.h +++ b/include/arch/beos/locks.h @@ -68,15 +68,26 @@ struct ap_lock_t { int curr_locked; char *fname; /* Inter proc */ - sem_id sem_interproc; - int32 ben_interproc; - /* Intra Proc */ - sem_id sem_intraproc; - int32 ben_intraproc; - /* At some point, we should do a scope for both inter and intra process - * locking here. Something like pthread_mutex with PTHREAD_PROCESS_SHARED - */ + sem_id sem_interproc; + int32 ben_interproc; + /* Intra Proc */ + sem_id sem_intraproc; + int32 ben_intraproc; }; +ap_status_t create_intra_lock(struct ap_lock_t *new); +ap_status_t lock_intra(struct ap_lock_t *lock); +ap_status_t unlock_intra(struct ap_lock_t *lock); +ap_status_t destroy_intra_lock(struct ap_lock_t *lock); + +ap_status_t create_inter_lock(struct ap_lock_t *new); +ap_status_t lock_inter(struct ap_lock_t *lock); +ap_status_t unlock_inter(struct ap_lock_t *lock); +ap_status_t destroy_inter_lock(struct ap_lock_t *lock); + +ap_status_t child_init_lock(struct ap_lock_t **lock, ap_pool_t *cont, + const char *fname); + + #endif /* LOCKS_H */ diff --git a/lib/apr_md5.c b/lib/apr_md5.c index 1ba56bff627..d553551edae 100644 --- a/lib/apr_md5.c +++ b/lib/apr_md5.c @@ -651,7 +651,7 @@ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *hash) { char sample[120]; -#ifndef WIN32 +#if !defined(WIN32) && !defined(BEOS) char *crypt_pw; #endif if (!strncmp(hash, apr1_id, strlen(apr1_id))) { diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c index 388dba8edfc..8a27e0d6e10 100644 --- a/locks/beos/crossproc.c +++ b/locks/beos/crossproc.c @@ -123,7 +123,7 @@ ap_status_t destroy_inter_lock(ap_lock_t *lock) return stat; } -ap_status_t child_init_lock(ap_lock_t **lock, ap_pool_t *cont, char *fname) +ap_status_t child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const char *fname) { return APR_SUCCESS; } diff --git a/locks/beos/locks.h b/locks/beos/locks.h index 0160b5e71aa..fefc0d30ae9 100644 --- a/locks/beos/locks.h +++ b/locks/beos/locks.h @@ -68,15 +68,26 @@ struct ap_lock_t { int curr_locked; char *fname; /* Inter proc */ - sem_id sem_interproc; - int32 ben_interproc; - /* Intra Proc */ - sem_id sem_intraproc; - int32 ben_intraproc; - /* At some point, we should do a scope for both inter and intra process - * locking here. Something like pthread_mutex with PTHREAD_PROCESS_SHARED - */ + sem_id sem_interproc; + int32 ben_interproc; + /* Intra Proc */ + sem_id sem_intraproc; + int32 ben_intraproc; }; +ap_status_t create_intra_lock(struct ap_lock_t *new); +ap_status_t lock_intra(struct ap_lock_t *lock); +ap_status_t unlock_intra(struct ap_lock_t *lock); +ap_status_t destroy_intra_lock(struct ap_lock_t *lock); + +ap_status_t create_inter_lock(struct ap_lock_t *new); +ap_status_t lock_inter(struct ap_lock_t *lock); +ap_status_t unlock_inter(struct ap_lock_t *lock); +ap_status_t destroy_inter_lock(struct ap_lock_t *lock); + +ap_status_t child_init_lock(struct ap_lock_t **lock, ap_pool_t *cont, + const char *fname); + + #endif /* LOCKS_H */ diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index e3f7e51727d..d0bee0b6db3 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -64,6 +64,9 @@ #ifdef HAVE_SYS_WAIT_H #include #endif +#ifdef BEOS +#include /* for fd_set definition! */ +#endif static ap_other_child_rec_t *other_children = NULL; diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index dc6e69673c8..e0d3c979640 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -76,7 +76,7 @@ static ap_status_t soblock(int sd) } #else int on = 0; - if (setsockopt(sd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(int)) < 0) + if (setsockopt(sd, SOL_SOCKET, SO_NONBLOCK, &on, sizeof(int)) < 0) return errno; #endif /* BEOS */ return APR_SUCCESS; @@ -103,7 +103,7 @@ static ap_status_t sononblock(int sd) } #else int on = 1; - if (setsockopt(sd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(int)) < 0) + if (setsockopt(sd, SOL_SOCKET, SO_NONBLOCK, &on, sizeof(int)) < 0) return errno; #endif /* BEOS */ return APR_SUCCESS; diff --git a/time/unix/time.c b/time/unix/time.c index 492e4116810..d3a701ab5f5 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -70,6 +70,9 @@ #define INCL_DOS #include #endif +#ifdef BEOS +#include /* for select */ +#endif /* End System Headers */ From d3bfdb283adc8b6ecda006cbd06fe6569242610c Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 17 Jun 2000 11:51:38 +0000 Subject: [PATCH 0240/7878] This commit gets the debugging of alloc and pools working again. I'm committing as it helped me find a problem and may help other people out. It's now turned on in apr_general.h but is, of course, turned off by default. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60215 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 18 +++++++++++++++++- include/apr_pools.h | 20 +++++++------------- lib/apr_pools.c | 20 +++++++++++++++----- lib/apr_tables.c | 18 +++++++++--------- memory/unix/apr_pools.c | 20 +++++++++++++++----- 5 files changed, 63 insertions(+), 33 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index c1ef4f3cc84..c64929bfdb8 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -247,6 +247,22 @@ B ap_status_t ap_generate_random_bytes(unsigned char * buf, int length); #endif +/* Memory allocation/Pool debugging options... + * + * Look in ap_pools.c for definitions of what these mean/do + * + * NB These should ALL normally be commented out unless you REALLY + * need them!! + */ + +/* +#define ALLOC_DEBUG +#define POOL_DEBUG +#define ALLOC_USE_MALLOC +#define MAKE_TABLE_PROFILE +#define ALLOC_STATS +*/ + typedef struct ap_pool_t { union block_hdr *first; union block_hdr *last; @@ -261,7 +277,7 @@ typedef struct ap_pool_t { void *allocation_list; #endif #ifdef POOL_DEBUG - ap_pool_t *joined; + struct ap_pool_t *joined; #endif int (*apr_abort)(int retcode); struct datastruct *prog_data; diff --git a/include/apr_pools.h b/include/apr_pools.h index 1161c6ca148..9cef6528533 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -95,16 +95,18 @@ struct process_chain { ap_status_t ap_init_alloc(void); /* Set up everything */ void ap_term_alloc(void); /* Tear down everything */ -/* used to guarantee to the pool debugging code that the sub pool will not be +/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t will not be * destroyed before the parent pool */ #ifndef POOL_DEBUG -#ifdef ap_pool_join -#undef ap_pool_join -#endif /* ap_pool_join */ -#define ap_pool_join(a,b) +APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts); +#define ap_pool_join (a,b) +#else +APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, int (apr_abort)(int retcode)); +APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode)); #endif /* POOL_DEBUG */ + /* Clearing out EVERYTHING in an pool... destroys any sub-pools */ /* Preparing for exec() --- close files, etc., but *don't* flush I/O @@ -165,14 +167,6 @@ APR_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *, const char *fmt, ...) #define ap_fdopen(d,m) fdopen((d), (m)) #endif -/* XXX - the socket functions for pools should (and will) use APR sockets. - * This is temporary. */ -#ifndef BEOS /* this really screws up BeOS R4.5 !! */ -#define closesocket(s) close(s) -#endif - - - /* magic numbers --- min free bytes to consider a free ap_pool_t block useable, * and the min amount to allocate if we have to go to malloc() */ diff --git a/lib/apr_pools.c b/lib/apr_pools.c index f91f9160811..2b427d21e25 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -150,7 +150,13 @@ */ /* #define ALLOC_STATS */ + +/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t will not be + * destroyed before the parent pool + */ + #ifdef POOL_DEBUG +/* first do some option checking... */ #ifdef ALLOC_USE_MALLOC #error "sorry, no support for ALLOC_USE_MALLOC and POOL_DEBUG at the same time" #endif /* ALLOC_USE_MALLOC */ @@ -290,6 +296,7 @@ static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) APR_ABORT(blok == NULL, APR_ENOMEM, apr_abort, "Ouch! malloc failed in malloc_block()\n"); debug_fill(blok, size + sizeof(union block_hdr)); + blok->h.next = NULL; blok->h.first_avail = (char *) (blok + 1); blok->h.endp = size + blok->h.first_avail; @@ -313,7 +320,7 @@ static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) static void chk_on_blk_list(union block_hdr *blok, union block_hdr *free_blk) { debug_verify_filled(blok->h.endp, blok->h.endp + CLICK_SZ, - "Ouch! Someone trounced the padding " + "[chk_on_blk_list] Ouch! Someone trounced the padding " "at the end of a block!\n"); while (free_blk) { if (free_blk == blok) { @@ -382,7 +389,7 @@ static void free_blocks(union block_hdr *blok) chk_on_blk_list(blok, old_free_list); blok->h.first_avail = (char *) (blok + 1); debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#ifdef POOL_DEBUG +#ifdef POOL_DEBUG blok->h.owning_pool = FREE_POOL; #endif /* POOL_DEBUG */ blok = blok->h.next; @@ -432,7 +439,7 @@ static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) *lastptr = blok->h.next; blok->h.next = NULL; debug_verify_filled(blok->h.first_avail, blok->h.endp, - "Ouch! Someone trounced a block " + "[new_block] Ouch! Someone trounced a block " "on the free list!\n"); return blok; } @@ -864,7 +871,7 @@ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, +APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, int (*apr_abort)(int retcode)) { union block_hdr *b; @@ -881,6 +888,7 @@ APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, b->h.owning_pool = p; } } + return 0; } #endif @@ -927,10 +935,12 @@ void * ap_palloc(ap_pool_t *a, int reqsize) char *first_avail; char *new_first_avail; + if (a == NULL) { return malloc(reqsize); } + nclicks = 1 + ((reqsize - 1) / CLICK_SZ); size = nclicks * CLICK_SZ; @@ -949,7 +959,7 @@ void * ap_palloc(ap_pool_t *a, int reqsize) if (new_first_avail <= blok->h.endp) { debug_verify_filled(first_avail, blok->h.endp, - "Ouch! Someone trounced past the end " + "[ap_palloc] Ouch! Someone trounced past the end " "of their allocation!\n"); blok->h.first_avail = new_first_avail; return (void *) first_avail; diff --git a/lib/apr_tables.c b/lib/apr_tables.c index a7d2b67617b..d3a2069cb3f 100644 --- a/lib/apr_tables.c +++ b/lib/apr_tables.c @@ -309,7 +309,7 @@ APR_EXPORT(ap_table_t *) ap_copy_table(ap_pool_t *p, const ap_table_t *t) /* we don't copy keys and values, so it's necessary that t->a.pool * have a life span at least as long as p */ - if (!ap_pool_is_ancestor(t->a.cont->pool, p->pool)) { + if (!ap_pool_is_ancestor(t->a.cont, p)) { fprintf(stderr, "copy_table: t's pool is not an ancestor of p\n"); abort(); } @@ -386,11 +386,11 @@ APR_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!ap_pool_is_ancestor(ap_find_pool(key), t->a.cont->pool)) { + if (!ap_pool_is_ancestor(ap_find_pool(key, NULL), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!ap_pool_is_ancestor(ap_find_pool(val), t->a.cont->pool)) { + if (!ap_pool_is_ancestor(ap_find_pool(val, NULL), t->a.cont)) { fprintf(stderr, "table_set: val not in ancestor pool of t\n"); abort(); } @@ -475,11 +475,11 @@ APR_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!ap_pool_is_ancestor(ap_find_pool(key), t->a.cont->pool)) { + if (!ap_pool_is_ancestor(ap_find_pool(key, NULL), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!ap_pool_is_ancestor(ap_find_pool(val), t->a.cont->pool)) { + if (!ap_pool_is_ancestor(ap_find_pool(val, NULL), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } @@ -515,11 +515,11 @@ APR_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!ap_pool_is_ancestor(ap_find_pool(key), t->a.cont->pool)) { + if (!ap_pool_is_ancestor(ap_find_pool(key, NULL), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!ap_pool_is_ancestor(ap_find_pool(val), t->a.cont->pool)) { + if (!ap_pool_is_ancestor(ap_find_pool(val, NULL), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } @@ -542,12 +542,12 @@ APR_EXPORT(ap_table_t *) ap_overlay_tables(ap_pool_t *p, * overlay->a.pool and base->a.pool have a life span at least * as long as p */ - if (!ap_pool_is_ancestor(overlay->a.cont->pool, p->pool)) { + if (!ap_pool_is_ancestor(overlay->a.cont, p)) { fprintf(stderr, "overlay_tables: overlay's pool is not an ancestor of p\n"); abort(); } - if (!ap_pool_is_ancestor(base->a.cont->pool, p->pool)) { + if (!ap_pool_is_ancestor(base->a.cont, p)) { fprintf(stderr, "overlay_tables: base's pool is not an ancestor of p\n"); abort(); diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index f91f9160811..2b427d21e25 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -150,7 +150,13 @@ */ /* #define ALLOC_STATS */ + +/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t will not be + * destroyed before the parent pool + */ + #ifdef POOL_DEBUG +/* first do some option checking... */ #ifdef ALLOC_USE_MALLOC #error "sorry, no support for ALLOC_USE_MALLOC and POOL_DEBUG at the same time" #endif /* ALLOC_USE_MALLOC */ @@ -290,6 +296,7 @@ static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) APR_ABORT(blok == NULL, APR_ENOMEM, apr_abort, "Ouch! malloc failed in malloc_block()\n"); debug_fill(blok, size + sizeof(union block_hdr)); + blok->h.next = NULL; blok->h.first_avail = (char *) (blok + 1); blok->h.endp = size + blok->h.first_avail; @@ -313,7 +320,7 @@ static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) static void chk_on_blk_list(union block_hdr *blok, union block_hdr *free_blk) { debug_verify_filled(blok->h.endp, blok->h.endp + CLICK_SZ, - "Ouch! Someone trounced the padding " + "[chk_on_blk_list] Ouch! Someone trounced the padding " "at the end of a block!\n"); while (free_blk) { if (free_blk == blok) { @@ -382,7 +389,7 @@ static void free_blocks(union block_hdr *blok) chk_on_blk_list(blok, old_free_list); blok->h.first_avail = (char *) (blok + 1); debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#ifdef POOL_DEBUG +#ifdef POOL_DEBUG blok->h.owning_pool = FREE_POOL; #endif /* POOL_DEBUG */ blok = blok->h.next; @@ -432,7 +439,7 @@ static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) *lastptr = blok->h.next; blok->h.next = NULL; debug_verify_filled(blok->h.first_avail, blok->h.endp, - "Ouch! Someone trounced a block " + "[new_block] Ouch! Someone trounced a block " "on the free list!\n"); return blok; } @@ -864,7 +871,7 @@ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, +APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, int (*apr_abort)(int retcode)) { union block_hdr *b; @@ -881,6 +888,7 @@ APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, b->h.owning_pool = p; } } + return 0; } #endif @@ -927,10 +935,12 @@ void * ap_palloc(ap_pool_t *a, int reqsize) char *first_avail; char *new_first_avail; + if (a == NULL) { return malloc(reqsize); } + nclicks = 1 + ((reqsize - 1) / CLICK_SZ); size = nclicks * CLICK_SZ; @@ -949,7 +959,7 @@ void * ap_palloc(ap_pool_t *a, int reqsize) if (new_first_avail <= blok->h.endp) { debug_verify_filled(first_avail, blok->h.endp, - "Ouch! Someone trounced past the end " + "[ap_palloc] Ouch! Someone trounced past the end " "of their allocation!\n"); blok->h.first_avail = new_first_avail; return (void *) first_avail; From bebfcdba48b38fbd7acc80c62d2f9ec851618342 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Sat, 17 Jun 2000 16:33:08 +0000 Subject: [PATCH 0241/7878] Remove duplicate definition. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60216 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 9cef6528533..77293bd66fd 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -100,7 +100,6 @@ void ap_term_alloc(void); /* Tear down everything */ */ #ifndef POOL_DEBUG APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts); -#define ap_pool_join (a,b) #else APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, int (apr_abort)(int retcode)); APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode)); From e2bbad5ce0ad1170069784af7c293a9192027b1b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 17 Jun 2000 17:04:17 +0000 Subject: [PATCH 0242/7878] ap_puts(), ap_write(): make input buffer ptr const * instead of * ap_create_namedpipe(): make input path name ptr const * instead of * git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60217 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/pipe.c | 2 +- file_io/os2/readwrite.c | 4 ++-- file_io/unix/pipe.c | 2 +- file_io/unix/readwrite.c | 4 ++-- file_io/win32/readwrite.c | 4 ++-- include/apr_file_io.h | 12 ++++++------ 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 4ec94a889d8..b59c1684689 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -134,7 +134,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) -ap_status_t ap_create_namedpipe(char *filename, ap_fileperms_t perm, ap_pool_t *cont) +ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, ap_pool_t *cont) { /* Not yet implemented, interface not suitable */ return APR_ENOTIMPL; diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index fb0c5d2e686..234689aaa3f 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -138,7 +138,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) -ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) +ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) { ULONG rc = 0; ULONG byteswritten; @@ -264,7 +264,7 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) -ap_status_t ap_puts(char *str, ap_file_t *thefile) +ap_status_t ap_puts(const char *str, ap_file_t *thefile) { ap_ssize_t len; diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index cfddb5b453e..786ea0ac2d3 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -131,7 +131,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_create_namedpipe(char *filename, +ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, ap_pool_t *cont) { mode_t mode = ap_unix_get_fileperms(perm); diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 5fa1bd4e171..a3fb36ee047 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -205,7 +205,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) } } -ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) +ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) { ap_size_t rv; @@ -317,7 +317,7 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) return ap_read(thefile, ch, &nbytes); } -ap_status_t ap_puts(char *str, ap_file_t *thefile) +ap_status_t ap_puts(const char *str, ap_file_t *thefile) { ssize_t rv; int len; diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 4e890554541..ccddca3fedd 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -124,7 +124,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) return lasterror; } -ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) +ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) { ap_status_t rv; DWORD bwrote; @@ -262,7 +262,7 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) return APR_SUCCESS; } -ap_status_t ap_puts(char *str, ap_file_t *thefile) +ap_status_t ap_puts(const char *str, ap_file_t *thefile) { DWORD len = strlen(str); diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 490c676a5a2..e7102722368 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -253,7 +253,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes); /* -=head1 ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) +=head1 ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) B @@ -274,7 +274,7 @@ B: ap_write will write up to the specified number of bytes, but never =cut */ -ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes); +ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes); /* @@ -357,7 +357,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile); /* -=head1 ap_status_t ap_puts(char *str, ap_file_t *thefile) +=head1 ap_status_t ap_puts(const char *str, ap_file_t *thefile) B @@ -366,7 +366,7 @@ B =cut */ -ap_status_t ap_puts(char *str, ap_file_t *thefile); +ap_status_t ap_puts(const char *str, ap_file_t *thefile); /* @@ -555,7 +555,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont); /* -=head1 ap_status_t ap_create_namedpipe(char *filename, ap_fileperms_t perm, ap_pool_t *cont) +=head1 ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, ap_pool_t *cont) B @@ -565,7 +565,7 @@ B =cut */ -ap_status_t ap_create_namedpipe(char *filename, ap_fileperms_t perm, +ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, ap_pool_t *cont); /* From f911b9c2e70bbe846f2d38bdd9d6092de7c33dd7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 17 Jun 2000 18:16:10 +0000 Subject: [PATCH 0243/7878] Don't get a lock for the ap_file_t in ap_put_os_file(); we won't ever use it, as there is no way to enable buffering for such an ap_file_t created this way. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60218 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index e5c8aa6af0a..8c045d8b87d 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -215,10 +215,9 @@ ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, (*file)->buffered = 0; (*file)->timeout = -1; (*file)->filedes = *dafile; - /* buffer already NULL */ -#if APR_HAS_THREADS - ap_create_lock(&((*file)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, cont); -#endif + /* buffer already NULL; + * don't get a lock (only for buffered files) + */ return APR_SUCCESS; } From f06f6e06f5a6aef6d880218dac9de5fdd76438ed Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 17 Jun 2000 21:08:29 +0000 Subject: [PATCH 0244/7878] Get recently-added tests in testfile.c to work on Win32. testfile was doing some improper ap_ungetc() checks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60219 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/testfile.c b/test/testfile.c index d0ce629f32d..98afaf40f9a 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -462,11 +462,14 @@ static void test_read_guts(ap_pool_t *p, const char *fname, ap_int32_t extra_fla "doesn't work yet...\n\t\t\t\t "); } else { - rv = ap_ungetc('z', f); + rv = ap_ungetc('b', f); assert(!rv); - rv = ap_ungetc('a', f); - assert(!rv); /* we just overwrote the previously-un-got char */ - read_one(f, 'a'); + /* Note: some implementations move the file ptr back; + * others just save up to one char; it isn't + * portable to unget more than once. + */ + /* Don't do this: rv = ap_ungetc('a', f); */ + read_one(f, 'b'); } read_one(f, 'c'); read_one(f, '\n'); From e60d4c9bd612f143cd5cefb9e0f3a27db3b7e0f8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 17 Jun 2000 21:14:09 +0000 Subject: [PATCH 0245/7878] Win32 changes to ap_read() and ap_fgets(): . ap_read() wasn't checking for *nbytes <= 0 on entry; it now handles it like the Unix code . the buffering logic in ap_read() started "while (lasterror == 0..." but didn't initialize lasterror . ap_read() returns APR_EOF if it hits eof before giving the caller any data . if ap_read() hits an error after reading data, error reporting is deferred to the next call . ap_fgets() clobbered the '\n' git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60220 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index ccddca3fedd..65f05771bc7 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -67,6 +67,11 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) DWORD bread; int lasterror; + if (*nbytes <= 0) { + *nbytes = 0; + return APR_SUCCESS; + } + if (thefile->buffered) { char *pos = (char *)buf; ULONG blocksize; @@ -81,13 +86,16 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) thefile->dataRead = 0; } + lasterror = 0; while (lasterror == 0 && size > 0) { if (thefile->bufpos >= thefile->dataRead) { lasterror = ReadFile(thefile->filehand, thefile->buffer, APR_FILE_BUFSIZE, &thefile->dataRead, NULL ) ? 0 : GetLastError(); if (thefile->dataRead == 0) { - if (lasterror == 0) + if (lasterror == 0) { thefile->eof_hit = TRUE; + lasterror = APR_EOF; + } break; } @@ -102,12 +110,20 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) size -= blocksize; } - *nbytes = lasterror == 0 ? pos - (char *)buf : 0; + *nbytes = pos - (char *)buf; + if (*nbytes) { + lasterror = 0; + } ap_unlock(thefile->mutex); } else { if (ReadFile(thefile->filehand, buf, *nbytes, &bread, NULL)) { *nbytes = bread; - return APR_SUCCESS; + if (bread) { + return APR_SUCCESS; + } + else { + return APR_EOF; + } } *nbytes = 0; @@ -285,9 +301,11 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) } if (str[i] == '\r' || str[i] == '\x1A') - i--; - else if (str[i] == '\n') + i--; /* don't keep this char */ + else if (str[i] == '\n') { + i++; /* don't clobber this char below */ break; + } } str[i] = 0; return rv; From f6f0085be3525a693ab787866c7528126a028a0e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 18 Jun 2000 02:38:51 +0000 Subject: [PATCH 0246/7878] ap_dupfile(): If the file being duped was buffered, existing code marked the new handle as buffered too. However, it neglected to allocate a buffer or lock for it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60221 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index f7c19ac9e38..b21f91a093c 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -75,12 +75,15 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) else { (*new_file)->filedes = dup(old_file->filedes); } -#if APR_HAS_THREADS - ap_create_lock(&((*new_file)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, - p); -#endif (*new_file)->fname = ap_pstrdup(p, old_file->fname); (*new_file)->buffered = old_file->buffered; + if ((*new_file)->buffered) { +#if APR_HAS_THREADS + ap_create_lock(&((*new_file)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, + p); +#endif + (*new_file)->buffer = ap_palloc(p, APR_FILE_BUFSIZE); + } ap_register_cleanup((*new_file)->cntxt, (void *)(*new_file), ap_unix_file_cleanup, ap_null_cleanup); return APR_SUCCESS; From 6d654ad79e832794be636cb2338649174c6bac8e Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 18 Jun 2000 10:58:21 +0000 Subject: [PATCH 0247/7878] Tidy up the debugging documentation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60222 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 2 +- lib/apr_pools.c | 61 ++--------------------------------------- memory/unix/apr_pools.c | 61 ++--------------------------------------- 3 files changed, 7 insertions(+), 117 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index c64929bfdb8..b34dea78e2b 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -249,7 +249,7 @@ ap_status_t ap_generate_random_bytes(unsigned char * buf, int length); /* Memory allocation/Pool debugging options... * - * Look in ap_pools.c for definitions of what these mean/do + * Look in the developer documentation for details of what these do. * * NB These should ALL normally be commented out unless you REALLY * need them!! diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 2b427d21e25..58ab329a543 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -97,64 +97,9 @@ #include #endif -/* - * Debugging support: Define this to enable code which helps detect re-use - * of freed memory and other such nonsense. - * - * The theory is simple. The FILL_BYTE (0xa5) is written over all malloc'd - * memory as we receive it, and is written over everything that we free up - * during a clear_pool. We check that blocks on the free list always - * have the FILL_BYTE in them, and we check during palloc() that the bytes - * still have FILL_BYTE in them. If you ever see garbage URLs or whatnot - * containing lots of 0xa5s then you know something used data that's been - * freed or uninitialized. - */ -/* #define ALLOC_DEBUG */ - -/* - * Debugging support: If defined all allocations will be done with - * malloc and free()d appropriately at the end. This is intended to be - * used with something like Electric Fence or Purify to help detect - * memory problems. Note that if you're using efence then you should also - * add in ALLOC_DEBUG. But don't add in ALLOC_DEBUG if you're using Purify - * because ALLOC_DEBUG would hide all the uninitialized read errors that - * Purify can diagnose. - */ -/* #define ALLOC_USE_MALLOC */ - -/* - * Pool debugging support: This is intended to detect cases where the - * wrong pool is used when assigning data to an object in another pool. - * In particular, it causes the table_{set,add,merge}n routines to check - * that their arguments are safe for the ap_table_t they're being placed in. - * It currently only works with the unix multiprocess model, but could - * be extended to others. - */ -/* #define POOL_DEBUG */ - -/* - * Provide diagnostic information about make_table() calls which are - * possibly too small. This requires a recent gcc which supports - * __builtin_return_address(). The error_log output will be a - * message such as: - * table_push: ap_table_t created by 0x804d874 hit limit of 10 - * Use "l *0x804d874" to find the source that corresponds to. It - * indicates that a ap_table_t allocated by a call at that address has - * possibly too small an initial ap_table_t size guess. - */ -/* #define MAKE_TABLE_PROFILE */ - -/* - * Provide some statistics on the cost of allocations. It requires a - * bit of an understanding of how alloc.c works. - */ -/* #define ALLOC_STATS */ - - -/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t will not be - * destroyed before the parent pool - */ - +/* Details of the debugging options can now be found in the developer + * section of the documentaion. */ + #ifdef POOL_DEBUG /* first do some option checking... */ #ifdef ALLOC_USE_MALLOC diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 2b427d21e25..58ab329a543 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -97,64 +97,9 @@ #include #endif -/* - * Debugging support: Define this to enable code which helps detect re-use - * of freed memory and other such nonsense. - * - * The theory is simple. The FILL_BYTE (0xa5) is written over all malloc'd - * memory as we receive it, and is written over everything that we free up - * during a clear_pool. We check that blocks on the free list always - * have the FILL_BYTE in them, and we check during palloc() that the bytes - * still have FILL_BYTE in them. If you ever see garbage URLs or whatnot - * containing lots of 0xa5s then you know something used data that's been - * freed or uninitialized. - */ -/* #define ALLOC_DEBUG */ - -/* - * Debugging support: If defined all allocations will be done with - * malloc and free()d appropriately at the end. This is intended to be - * used with something like Electric Fence or Purify to help detect - * memory problems. Note that if you're using efence then you should also - * add in ALLOC_DEBUG. But don't add in ALLOC_DEBUG if you're using Purify - * because ALLOC_DEBUG would hide all the uninitialized read errors that - * Purify can diagnose. - */ -/* #define ALLOC_USE_MALLOC */ - -/* - * Pool debugging support: This is intended to detect cases where the - * wrong pool is used when assigning data to an object in another pool. - * In particular, it causes the table_{set,add,merge}n routines to check - * that their arguments are safe for the ap_table_t they're being placed in. - * It currently only works with the unix multiprocess model, but could - * be extended to others. - */ -/* #define POOL_DEBUG */ - -/* - * Provide diagnostic information about make_table() calls which are - * possibly too small. This requires a recent gcc which supports - * __builtin_return_address(). The error_log output will be a - * message such as: - * table_push: ap_table_t created by 0x804d874 hit limit of 10 - * Use "l *0x804d874" to find the source that corresponds to. It - * indicates that a ap_table_t allocated by a call at that address has - * possibly too small an initial ap_table_t size guess. - */ -/* #define MAKE_TABLE_PROFILE */ - -/* - * Provide some statistics on the cost of allocations. It requires a - * bit of an understanding of how alloc.c works. - */ -/* #define ALLOC_STATS */ - - -/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t will not be - * destroyed before the parent pool - */ - +/* Details of the debugging options can now be found in the developer + * section of the documentaion. */ + #ifdef POOL_DEBUG /* first do some option checking... */ #ifdef ALLOC_USE_MALLOC From 153b2eec416c7b374b23aa8552ace6e9a66f1af8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 18 Jun 2000 16:28:55 +0000 Subject: [PATCH 0248/7878] make a tiny cleanup in ap_unix_file_cleanup(); add a comment about possible code reuse in ap_open_stderr(); git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60223 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 8c045d8b87d..d12dd6413ed 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -68,10 +68,8 @@ ap_status_t ap_unix_file_cleanup(void *thefile) if (file->thlock) { return ap_destroy_lock(file->thlock); } - return APR_SUCCESS; -#else - return APR_SUCCESS; #endif + return APR_SUCCESS; } else { return errno; @@ -237,6 +235,9 @@ ap_status_t ap_ferror(ap_file_t *fptr) return APR_SUCCESS; } +/* ap_open_stderr() could just call ap_put_os_file() with + * STDERR_FILENO for the descriptor... + */ ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont) { (*thefile) = ap_pcalloc(cont, sizeof(ap_file_t)); From c39a63eeec4fbc3f8dd706ee1e8d30096d84e7e1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 19 Jun 2000 00:45:40 +0000 Subject: [PATCH 0249/7878] Repair C++ compatibility in ap_config.h, apr_file_io.h, apr_network_io.h, and apr_thread_proc.h. Submitted by: Tyler J. Brooks git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60224 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 16 ++++++++-------- include/apr_network_io.h | 12 ++++++------ include/apr_thread_proc.h | 26 +++++++++++++------------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index e7102722368..824e92dc039 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -127,7 +127,7 @@ struct ap_finfo_t { /* Function definitions */ /* -=head1 ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cont) +=head1 ap_status_t ap_open(ap_file_t **new_file, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cont) B @@ -153,7 +153,7 @@ B: If perm is APR_OS_DEFAULT and the file is being created, appropriate =cut */ -ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, +ap_status_t ap_open(ap_file_t **new_file, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cont); /* @@ -461,7 +461,7 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where,ap_off_t *offset); /* -=head1 ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cont) +=head1 ap_status_t ap_opendir(ap_dir_t **new_dir, const char *dirname, ap_pool_t *cont) B @@ -471,7 +471,7 @@ B =cut */ -ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cont); +ap_status_t ap_opendir(ap_dir_t **new_dir, const char *dirname, ap_pool_t *cont); /* @@ -598,7 +598,7 @@ ap_status_t ap_block_pipe(ap_file_t *thepipe); /* -=head1 ap_status_t ap_get_filename(char **new, ap_file_t *thefile) +=head1 ap_status_t ap_get_filename(char **new_path, ap_file_t *thefile) B @@ -607,11 +607,11 @@ B =cut */ -ap_status_t ap_get_filename(char **new, ap_file_t *thefile); +ap_status_t ap_get_filename(char **new_path, ap_file_t *thefile); /* -=head1 ap_status_t ap_get_dir_filename(char **new, ap_dir_t *thedir) +=head1 ap_status_t ap_get_dir_filename(char **new_path, ap_dir_t *thedir) B @@ -620,7 +620,7 @@ B =cut */ -ap_status_t ap_get_dir_filename(char **new, ap_dir_t *thedir); +ap_status_t ap_get_dir_filename(char **new_path, ap_dir_t *thedir); /* diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 2de4247c935..26a92dd514f 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -139,7 +139,7 @@ struct ap_hdtr_t { /* -=head1 ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) +=head1 ap_status_t ap_create_tcp_socket(ap_socket_t **new_sock, ap_pool_t *cont) B @@ -148,7 +148,7 @@ B =cut */ -ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont); +ap_status_t ap_create_tcp_socket(ap_socket_t **new_sock, ap_pool_t *cont); /* @@ -213,7 +213,7 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog); /* -=head1 ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_pool) +=head1 ap_status_t ap_accept(ap_socket_t **new_sock, ap_socket_t *sock, ap_pool_t *connection_pool) B @@ -225,7 +225,7 @@ B =cut */ -ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, +ap_status_t ap_accept(ap_socket_t **new_sock, const ap_socket_t *sock, ap_pool_t *connection_pool); /* @@ -591,7 +591,7 @@ ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *soc /* -=head1 ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) +=head1 ap_status_t ap_setup_poll(ap_pollfd_t **new_poll, ap_int32_t num, ap_pool_t *cont) B @@ -601,7 +601,7 @@ B =cut */ -ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, +ap_status_t ap_setup_poll(ap_pollfd_t **new_poll, ap_int32_t num, ap_pool_t *cont); /* diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 89db1eaafa2..5e04aadbff8 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -117,7 +117,7 @@ typedef void *(APR_THREAD_FUNC *ap_thread_start_t)(void *); /* -=head1 ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) +=head1 ap_status_t ap_create_threadattr(ap_threadattr_t **new_attr, ap_pool_t *cont) B @@ -126,7 +126,7 @@ B =cut */ -ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont); +ap_status_t ap_create_threadattr(ap_threadattr_t **new_attr, ap_pool_t *cont); /* @@ -151,11 +151,11 @@ B =cut */ -ap_status_t ap_getthreadattr_detach(ap_threadattr_t *iattr); +ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr); /* -=head1 ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, ap_thread_start_t func, void *data, ap_pool_t *cont) +=head1 ap_status_t ap_create_thread(ap_thread_t **new_thread, ap_threadattr_t *attr, ap_thread_start_t func, void *data, ap_pool_t *cont) B @@ -167,7 +167,7 @@ B =cut */ -ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, +ap_status_t ap_create_thread(ap_thread_t **new_thread, ap_threadattr_t *attr, ap_thread_start_t func, void *data, ap_pool_t *cont); @@ -257,7 +257,7 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key, void (*dest)(void *), /* -=head1 ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) +=head1 ap_status_t ap_get_thread_private(void **new_mem, ap_threadkey_t *key) B @@ -266,7 +266,7 @@ B =cut */ -ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key); +ap_status_t ap_get_thread_private(void **new_mem, ap_threadkey_t *key); /* @@ -327,7 +327,7 @@ ap_status_t ap_set_threadkeydata(void *data, char *key, /* Process Function definitions */ /* -=head1 ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) +=head1 ap_status_t ap_createprocattr_init(ap_procattr_t **new_attr, ap_pool_t *cont) B @@ -336,7 +336,7 @@ B =cut */ -ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont); +ap_status_t ap_createprocattr_init(ap_procattr_t **new_attr, ap_pool_t *cont); /* @@ -498,7 +498,7 @@ ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont); /* -=head1 ap_status_t ap_create_process(ap_proc_t *new, const char *progname, char *const args[], char **env, ap_procattr_t *attr, ap_pool_t *cont) +=head1 ap_status_t ap_create_process(ap_proc_t *new_proc, const char *progname, char *const args[], char **env, ap_procattr_t *attr, ap_pool_t *cont) B @@ -514,7 +514,7 @@ B =cut */ -ap_status_t ap_create_process(ap_proc_t *new, const char *progname, +ap_status_t ap_create_process(ap_proc_t *new_proc, const char *progname, char *const args[], char **env, ap_procattr_t *attr, ap_pool_t *cont); @@ -565,7 +565,7 @@ ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, /* -=head1 ap_status_t ap_detach(ap_proc_t *new, ap_pool_t *cont) +=head1 ap_status_t ap_detach(ap_proc_t *new_proc, ap_pool_t *cont) B @@ -574,7 +574,7 @@ B =cut */ -ap_status_t ap_detach(ap_proc_t *new, ap_pool_t *cont); +ap_status_t ap_detach(ap_proc_t *new_proc, ap_pool_t *cont); #if APR_HAS_OTHER_CHILD /* From c3cd377bb33f97c5cfcd70f0b9ec73d02339a785 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 19 Jun 2000 13:54:49 +0000 Subject: [PATCH 0250/7878] win32/pipe.c: clean up some error handling logic: on Win9x, return APR_ENOTIMPL instead of APR_SUCCESS from ap_set_pipe_timeout() test/testpipe.c: don't use perror() to report an APR error git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60225 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 15 ++++++++++++--- test/testpipe.c | 19 ++++++++++--------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index d967c9ca6af..167cf7a72fb 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -73,7 +73,6 @@ ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) * (which support nonblocking I/O) on Windows NT. */ if (thepipe->pipe == 1) { - thepipe->timeout = timeout; if (ap_get_oslevel(thepipe->cntxt, &oslevel) == APR_SUCCESS && oslevel >= APR_WIN_NT) { if (timeout == 0) { @@ -81,9 +80,19 @@ ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) } else { dwMode = PIPE_WAIT; } - SetNamedPipeHandleState(thepipe->filehand, &dwMode, NULL, NULL); + if (SetNamedPipeHandleState(thepipe->filehand, &dwMode, NULL, NULL)) { + thepipe->timeout = timeout; + return APR_SUCCESS; + } + else { + return GetLastError(); + } + } + else { + /* can't make anonymous pipes non-blocking on Win9x + */ + return APR_ENOTIMPL; } - return APR_SUCCESS; } return APR_EINVAL; } diff --git a/test/testpipe.c b/test/testpipe.c index 1c96ac92ab4..91ec156a75a 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -62,16 +62,15 @@ #include #endif -int test_filedel(ap_pool_t *); -int testdirs(ap_pool_t *); - -int main() +int main(void) { ap_pool_t *context; ap_file_t *readp = NULL; ap_file_t *writep = NULL; ap_size_t nbytes; + ap_status_t rv; char *buf; + char msgbuf[120]; if (ap_initialize() != APR_SUCCESS) { fprintf(stderr, "Couldn't initialize."); @@ -86,8 +85,9 @@ int main() fprintf(stdout, "Testing pipe functions.\n"); fprintf(stdout, "\tCreating pipes......."); - if (ap_create_pipe(&readp, &writep, context) != APR_SUCCESS) { - perror("Didn't create the pipe"); + if ((rv = ap_create_pipe(&readp, &writep, context)) != APR_SUCCESS) { + fprintf(stderr, "ap_create_pipe()->%d/%s\n", + rv, ap_strerror(rv, msgbuf, sizeof msgbuf)); exit(-1); } else { @@ -95,14 +95,15 @@ int main() } fprintf(stdout, "\tSetting pipe timeout......."); - if (ap_set_pipe_timeout(readp, 1 * AP_USEC_PER_SEC) != APR_SUCCESS) { - perror("Couldn't set a timeout"); + if ((rv = ap_set_pipe_timeout(readp, 1 * AP_USEC_PER_SEC)) != APR_SUCCESS) { + fprintf(stderr, "ap_set_pipe_timeout()->%d/%s\n", + rv, ap_strerror(rv, msgbuf, sizeof msgbuf)); exit(-1); } else { fprintf(stdout, "OK\n"); } - fprintf(stdout, "\tReading from the file......."); + fprintf(stdout, "\tReading from the pipe......."); nbytes = (ap_ssize_t)strlen("this is a test"); buf = (char *)ap_palloc(context, nbytes + 1); if (ap_read(readp, buf, &nbytes) == APR_TIMEUP) { From 0e4f9c7f9c67706105d8c472f2fc77d7f5031301 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 19 Jun 2000 15:06:39 +0000 Subject: [PATCH 0251/7878] Well, Jeff fixed the uninitialized return code problem over the weekend, so I'll just commit the other part of this patch to normalize on a more standard return code variable name. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60226 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 65f05771bc7..35ac2ae441f 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -65,7 +65,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) { DWORD bread; - int lasterror; + int rv; if (*nbytes <= 0) { *nbytes = 0; @@ -86,15 +86,15 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) thefile->dataRead = 0; } - lasterror = 0; - while (lasterror == 0 && size > 0) { + rv = 0; + while (rv == 0 && size > 0) { if (thefile->bufpos >= thefile->dataRead) { - lasterror = ReadFile(thefile->filehand, thefile->buffer, APR_FILE_BUFSIZE, &thefile->dataRead, NULL ) ? 0 : GetLastError(); + rv = ReadFile(thefile->filehand, thefile->buffer, APR_FILE_BUFSIZE, &thefile->dataRead, NULL ) ? 0 : GetLastError(); if (thefile->dataRead == 0) { - if (lasterror == 0) { + if (rv == 0) { thefile->eof_hit = TRUE; - lasterror = APR_EOF; + rv = APR_EOF; } break; } @@ -112,7 +112,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) *nbytes = pos - (char *)buf; if (*nbytes) { - lasterror = 0; + rv = 0; } ap_unlock(thefile->mutex); } else { @@ -127,17 +127,17 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) } *nbytes = 0; - lasterror = GetLastError(); - if (lasterror == ERROR_BROKEN_PIPE) { + rv = GetLastError(); + if (rv == ERROR_BROKEN_PIPE) { /* Assume ERROR_BROKEN_PIPE signals an EOF reading from a pipe */ return APR_SUCCESS; - } else if (lasterror == ERROR_NO_DATA) { + } else if (rv == ERROR_NO_DATA) { /* Receive this error on a read to a pipe in nonblocking mode */ return APR_EAGAIN; } } - return lasterror; + return rv; } ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) From f4c1c70a09e62c11a632dab276ed7fcc47ceeaa8 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 19 Jun 2000 17:45:15 +0000 Subject: [PATCH 0252/7878] Win32: Eliminate some warnings git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60227 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/fileio.h | 10 +++++----- file_io/win32/readwrite.c | 6 +++--- include/arch/win32/fileio.h | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 55d6847d6a8..35d60dc2bac 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -106,8 +106,8 @@ struct ap_file_t { int eof_hit; int pipe; ap_interval_time_t timeout; - int buffered; /* Not currently used on Windows */ - int ungetchar; /* Not used. Last char provided by an unget op. (-1 = no char)*/ + int buffered; + int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ char *demonfname; char *lowerdemonfname; @@ -120,10 +120,10 @@ struct ap_file_t { /* Stuff for buffered mode */ char *buffer; - int bufpos; // Read/Write position in buffer - unsigned long dataRead; // amount of valid data read into buffer + ap_ssize_t bufpos; // Read/Write position in buffer + ap_ssize_t dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write - unsigned long filePtr; // position in file of handle + ap_ssize_t filePtr; // position in file of handle ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields }; diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 35ac2ae441f..acb15e80f11 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -74,8 +74,8 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) if (thefile->buffered) { char *pos = (char *)buf; - ULONG blocksize; - ULONG size = *nbytes; + ap_ssize_t blocksize; + ap_ssize_t size = *nbytes; ap_lock(thefile->mutex); @@ -154,7 +154,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) if (thefile->direction == 0) { // Position file pointer for writing at the offset we are logically reading from - ULONG offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + ap_ssize_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; if (offset != thefile->filePtr) SetFilePointer(thefile->filehand, offset, NULL, FILE_BEGIN); thefile->bufpos = thefile->dataRead = 0; diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 55d6847d6a8..35d60dc2bac 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -106,8 +106,8 @@ struct ap_file_t { int eof_hit; int pipe; ap_interval_time_t timeout; - int buffered; /* Not currently used on Windows */ - int ungetchar; /* Not used. Last char provided by an unget op. (-1 = no char)*/ + int buffered; + int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ char *demonfname; char *lowerdemonfname; @@ -120,10 +120,10 @@ struct ap_file_t { /* Stuff for buffered mode */ char *buffer; - int bufpos; // Read/Write position in buffer - unsigned long dataRead; // amount of valid data read into buffer + ap_ssize_t bufpos; // Read/Write position in buffer + ap_ssize_t dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write - unsigned long filePtr; // position in file of handle + ap_ssize_t filePtr; // position in file of handle ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields }; From 11b6e06d1acb46a3bc443910a602190c3b858edd Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" Date: Mon, 19 Jun 2000 17:53:12 +0000 Subject: [PATCH 0253/7878] Include dso api's git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60228 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr_portable.h b/include/apr_portable.h index 46042dabe99..728764328a4 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -70,6 +70,7 @@ extern "C" { #include "apr_errno.h" #include "apr_lock.h" #include "apr_time.h" +#include "apr_dso.h" #if APR_HAVE_DIRENT_H #include From b97d84e6b39679c793927e2aaf03442929077731 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 19 Jun 2000 19:38:30 +0000 Subject: [PATCH 0254/7878] Implement ap_sendfile on AIX Submitted by: Victor Orlikowski Reviewed by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60229 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 114 ++++++++++++++++++++++++++++++++++--- 1 file changed, 107 insertions(+), 7 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 4f6ab7c11da..1d2b9a9bd31 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -65,7 +65,7 @@ #define READ(x,y,z) read(x,y,z) #endif -#ifdef HAVE_SENDFILE +#if defined(HAVE_SENDFILE) || defined(HAVE_SEND_FILE) /* This file is needed to allow us access to the ap_file_t internals. */ #include "../../file_io/unix/fileio.h" @@ -76,7 +76,7 @@ #define TCP_CORK 3 #endif -#endif /* HAVE_SENDFILE */ +#endif /* HAVE_SENDFILE || HAVE_SEND_FILE */ static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) { @@ -204,7 +204,7 @@ ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, } #endif -#if defined(HAVE_SENDFILE) +#if defined(HAVE_SENDFILE) || defined(HAVE_SEND_FILE) /* TODO: Verify that all platforms handle the fd the same way * (i.e. not moving current file pointer) @@ -451,8 +451,108 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, (*len) = rv; return APR_SUCCESS; } -#else -/* TODO: Add AIX support */ -#endif /* __linux__, __FreeBSD__, __HPUX__ */ -#endif /* HAVE_SENDFILE */ +#elif defined(_AIX) +/* Need another check to make sure the dependencies are checked */ +/* AIX, version 4.3.2 with APAR IX85388, or version 4.3.3 and above */ +ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, + ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, + ap_int32_t flags) +{ + int i, ptr, rv = 0; + void * hbuf=NULL, * tbuf=NULL; + ap_status_t arv; + struct sf_parms parms; + + /* AIX can also send the headers/footers as part of the system call + ... badly.*/ + parms.header_length = 0; + if (hdtr && hdtr->numheaders) { + if (hdtr->numheaders == 1) { + parms.header_data = hdtr->headers[0].iov_base; + parms.header_length = hdtr->headers[0].iov_len; + } + else { + for (i = 0; i < hdtr->numheaders; i++) { + parms.header_length += hdtr->headers[i].iov_len; + } + /* Keepalives make ap_palloc a bad idea */ + hbuf = malloc(parms.header_length); + ptr = 0; + for (i = 0; i < hdtr->numheaders; i++) { + memcpy(hbuf + ptr, hdtr->headers[i].iov_base, + hdtr->headers[i].iov_len); + ptr += hdtr->headers[i].iov_len; + } + parms.header_data = hbuf; + } + } + else parms.header_data = NULL; + parms.trailer_length = 0; + if (hdtr && hdtr->numtrailers) { + if (hdtr->numtrailers == 1) { + parms.trailer_data = hdtr->trailers[0].iov_base; + parms.trailer_length = hdtr->trailers[0].iov_len; + } + else { + for (i = 0; i < hdtr->numtrailers; i++) { + parms.trailer_length += hdtr->trailers[i].iov_len; + } + /* Keepalives make ap_palloc a bad idea */ + tbuf = malloc(parms.trailer_length); + ptr = 0; + for (i = 0; i < hdtr->numtrailers; i++) { + memcpy(tbuf + ptr, hdtr->trailers[i].iov_base, + hdtr->trailers[i].iov_len); + ptr += hdtr->trailers[i].iov_len; + } + parms.trailer_data = tbuf; + } + } + else parms.trailer_data = NULL; + + /* Whew! Headers and trailers set up. Now for the file data */ + + parms.file_descriptor = file->filedes; + parms.file_offset = *offset; + parms.file_bytes = *len; + + /* O.K. All set up now. Let's go to town */ + + do { + rv = send_file(&(sock->socketdes), /* socket */ + &(parms), /* all data */ + flags /* flags */ + ); + } while (rv == -1 && errno == EINTR); + + if (rv == -1 && + (errno == EAGAIN || errno == EWOULDBLOCK) && + sock->timeout != 0) { + arv = wait_for_io_or_timeout(sock, 0); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } + else { + do { + rv = send_file(&(sock->socketdes), /* socket */ + &(parms), /* all data */ + flags /* flags */ + ); + } while (rv == -1 && errno == EINTR); + } + } + + (*len) = parms.bytes_sent; + /* Clean up after ourselves */ + if(hbuf) free(hbuf); + if(tbuf) free(tbuf); + + if (rv == -1) { + return errno; + } + return APR_SUCCESS; +} +#endif /* __linux__, __FreeBSD__, __HPUX__, _AIX */ +#endif /* HAVE_SENDFILE */ From 7369ace1de641f88fcb4300150b08bff19b7395e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 20 Jun 2000 03:13:30 +0000 Subject: [PATCH 0255/7878] Whack that bug... stat functions now almost reasonably implemented on Win32... but security dectection issues linger. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60230 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 128 ++++++++++++++++++++++++++++++--------- 1 file changed, 98 insertions(+), 30 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 0bba47a00b0..f81b09f8c6b 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -103,30 +103,84 @@ BOOLEAN is_exe(const char* fname, ap_pool_t *cont) { ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) { - /* TODO: - * Windows should call GetFileInformationByHandle(), which is similar - * to fstat(), for the best performance. Then we would need to map the - * BY_HANDLE_FILE_INFORMATION to ap_finfo_t. + BY_HANDLE_FILE_INFORMATION FileInformation; + DWORD FileType; + + if (!GetFileInformationByHandle(thefile->filehand, &FileInformation)) { + return GetLastError(); + } + + FileType = GetFileType(thefile->filehand); + if (!FileType) { + return GetLastError(); + } + + /* If my rudimentary knowledge of posix serves... inode is the absolute + * id of the file (uniquifier) that is returned by NT as follows: + * user and group could be related as SID's, although this would ensure + * it's own unique set of issues. All three fields are significantly + * longer than the posix compatible kernals would ever require. + * TODO: Someday solve this, and fix the executable flag below the + * right way with a security permission test (as well as r/w flags.) + * + * dwVolumeSerialNumber + * nFileIndexHigh + * nFileIndexLow + */ + finfo->user = 0; + finfo->group = 0; + finfo->inode = 0; + + /* Filetype - Directory or file: this case _will_ never happen */ + if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + finfo->protection = S_IFDIR; + finfo->filetype = APR_DIR; + } + else if (FileType == FILE_TYPE_DISK) { + finfo->protection = S_IFREG; + finfo->filetype = APR_REG; + } + else if (FileType == FILE_TYPE_CHAR) { + finfo->protection = S_IFCHR; + finfo->filetype = APR_CHR; + } + else if (FileType == FILE_TYPE_PIPE) { + /* obscure ommission in msvc... missing declaration sans underscore */ +#ifdef _MSC_VER + finfo->protection = _S_IFIFO; +#else + finfo->protection = S_IFIFO; +#endif + } + else { + finfo->protection = 0; + finfo->filetype = APR_NOFILE; + } + + /* Read, write execute for owner + * In the Win32 environment, anything readable is executable + * (well, not entirely 100% true, but I'm looking for a way + * to get at the acl permissions in simplified fashion.) */ - struct stat info; - int rv = stat(thefile->fname, &info); - - if (rv == 0) { - finfo->protection = info.st_mode; - finfo->filetype = filetype_from_mode(info.st_mode); - finfo->user = info.st_uid; - finfo->group = info.st_gid; - finfo->size = info.st_size; - finfo->inode = info.st_ino; - ap_ansi_time_to_ap_time(&finfo->atime, info.st_atime); - ap_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); - ap_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); - return APR_SUCCESS; + if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { + finfo->protection |= S_IREAD | S_IEXEC; } else { - return errno; + finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; } + + /* File times */ + FileTimeToAprTime(&finfo->atime, &FileInformation.ftLastAccessTime); + FileTimeToAprTime(&finfo->ctime, &FileInformation.ftCreationTime); + FileTimeToAprTime(&finfo->mtime, &FileInformation.ftLastWriteTime); + + /* File size + * Note: This cannot handle files greater than can be held by an int */ + finfo->size = FileInformation.nFileSizeLow; + + return APR_SUCCESS; } + ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) { /* WIN32_FILE_ATTRIBUTE_DATA is an exact subset of the first @@ -175,27 +229,41 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) return rv; } - /* Filetype - Directory or file? */ + /* Filetype - Directory or file? + * Short of opening the handle to the file, the 'FileType' appears + * to be unknowable (in any trustworthy or consistent sense.) + */ if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - finfo->protection |= S_IFDIR; + finfo->protection = S_IFDIR; finfo->filetype = APR_DIR; } else { - finfo->protection |= S_IFREG; + finfo->protection = S_IFREG; finfo->filetype = APR_REG; } - /* Read, write execute for owner */ + + /* Read, write execute for owner + * In the Win32 environment, anything readable is executable + * (well, not entirely 100% true, but I'm looking for a way + * to get at the acl permissions in simplified fashion.) + */ if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { - finfo->protection |= S_IREAD; + finfo->protection |= S_IREAD | S_IEXEC; } else { - finfo->protection |= S_IREAD; - finfo->protection |= S_IWRITE; - } - /* Is this an executable? Guess based on the file extension. */ - if (is_exe(fname, cont)) { - finfo->protection |= S_IEXEC; + finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; } + + /* Is this an executable? Guess based on the file extension. + * This is a rather silly test, IMHO... we are looking to test + * if the user 'may' execute a file (permissions), + * not if the filetype is executable. + */ +/* if (is_exe(fname, cont)) { + * finfo->protection |= S_IEXEC; + * } + */ + /* File times */ FileTimeToAprTime(&finfo->atime, &FileInformation.ftLastAccessTime); FileTimeToAprTime(&finfo->ctime, &FileInformation.ftCreationTime); From ca0de8f96bdfb9d0648f5a9aba1b730a013778db Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 20 Jun 2000 16:16:20 +0000 Subject: [PATCH 0256/7878] Remove a duplicate definition of ap_inline. This is provided by apr.h, so we don't need it in ap_private.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60231 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/acconfig.h b/acconfig.h index d639d360dbd..1edd878d303 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,29 +1,6 @@ #ifndef APR_PRIVATE_H #define APR_PRIVATE_H -/* So that we can use inline on some critical functions, and use - * GNUC attributes (such as to get -Wall warnings for printf-like - * functions). Only do this in gcc 2.7 or later ... it may work - * on earlier stuff, but why chance it. - * - * We've since discovered that the gcc shipped with NeXT systems - * as "cc" is completely broken. It claims to be __GNUC__ and so - * on, but it doesn't implement half of the things that __GNUC__ - * means. In particular it's missing inline and the __attribute__ - * stuff. So we hack around it. PR#1613. -djg - */ -#if !defined(__GNUC__) || __GNUC__ < 2 || \ - (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\ - defined(NEXT) -#define ap_inline -#define __attribute__(__x) -#define ENUM_BITFIELD(e,n,w) signed int n : w -#else -#define ap_inline __inline__ -#define USE_GNU_INLINE -#define ENUM_BITFIELD(e,n,w) e n : w -#endif - @TOP@ /* Various #defines we need to know about */ From beef3485438dd271de8f66d6a1ee9522f8df05e9 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 20 Jun 2000 18:03:15 +0000 Subject: [PATCH 0257/7878] Win32: Eliminate bogus ap_ungetc implementation. The question remains, should ap_ungetc just decrement the buf pointer (which will accomodate multiple calls to ap_ungetc and eliminate the char ch argument) or only allow a single call to ap_ungetc (implemented by saving char ch in thefile->ungetchar, like the unix implementation today). I'll make Unix and Win32 consistent once this decision is made. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60232 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index acb15e80f11..d691db9a0a9 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -223,40 +223,17 @@ ap_status_t ap_putc(char ch, ap_file_t *thefile) ap_status_t ap_ungetc(char ch, ap_file_t *thefile) { - /* - * Your application must provide its own serialization (locking) if - * it allows multiple threads to access the same file handle - * concurrently. - * - * ToDo: This function does not use the char ch argument. Could add - * gorpy code to read the file after the SetFilePointer() call to - * make sure the character pushed back on the stream is the same as - * arg ch. Then, need to SetFilePointer() once more to reset the - * file pointer to the point before the read. Yech... Just assume - * the caller knows what he is doing. There may be a nifty Win32 - * call for this I've not discovered.... - */ - - /* SetFilePointer is only valid for a file device ...*/ - if (GetFileType(thefile->filehand) != FILE_TYPE_DISK) { - return GetLastError(); - } - + /* ungetc only makes sense when using buffered i/o */ if (thefile->buffered) { - ap_off_t offset = -1; - return ap_seek(thefile, APR_CUR, &offset); - } - else { - /* and the file pointer is not pointing to the start of the file. */ - if (GetFilePointer(thefile->filehand)) { - if (SetFilePointer(thefile->filehand, -1, NULL, FILE_CURRENT) - == 0xFFFFFFFF) { - return GetLastError(); - } + ap_lock(thefile->mutex); + if (thefile->bufpos > 0){ + thefile->bufpos--; } + ap_unlock(thefile->mutex); + return APR_SUCCESS; } - return APR_SUCCESS; + return APR_ENOTIMPL; } ap_status_t ap_getc(char *ch, ap_file_t *thefile) From 39e0c72be471ebf74c1220a0e71ec772f17176f9 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 20 Jun 2000 18:50:00 +0000 Subject: [PATCH 0258/7878] Win32: Update ap_set_pipe_timeout to not call SetNamedPipeHandleState more than necessary git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60233 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 167cf7a72fb..9420b143eac 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -63,9 +63,16 @@ #include #include "misc.h" +static ap_status_t setpipeblockmode(ap_file_t *pipe, DWORD dwMode) { + if (!SetNamedPipeHandleState(pipe->filehand, &dwMode, NULL, NULL)) { + return GetLastError(); + } + return APR_SUCCESS; +} + ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) { - DWORD dwMode; + ap_status_t rc = APR_SUCCESS; ap_oslevel_e oslevel; /* This code relies on the fact that anonymous pipes (which @@ -75,26 +82,28 @@ ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) if (thepipe->pipe == 1) { if (ap_get_oslevel(thepipe->cntxt, &oslevel) == APR_SUCCESS && oslevel >= APR_WIN_NT) { - if (timeout == 0) { - dwMode = PIPE_NOWAIT; - } else { - dwMode = PIPE_WAIT; - } - if (SetNamedPipeHandleState(thepipe->filehand, &dwMode, NULL, NULL)) { - thepipe->timeout = timeout; - return APR_SUCCESS; + if (timeout >= 0) { + /* Set the pipe non-blocking if it was previously blocking */ + if (thepipe->timeout < 0) { + rc = setpipeblockmode(thepipe, PIPE_NOWAIT); + } } - else { - return GetLastError(); + else if (thepipe->timeout >= 0) { + rc = setpipeblockmode(thepipe, PIPE_WAIT); } } else { - /* can't make anonymous pipes non-blocking on Win9x - */ - return APR_ENOTIMPL; + /* can't make anonymous pipes non-blocking on Win9x */ + rc = APR_ENOTIMPL; } + thepipe->timeout = timeout; } - return APR_EINVAL; + else { + /* Timeout not valid for file i/o (yet...) */ + rc = APR_EINVAL; + } + + return rc; } ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) From dee6ba3e486149492fd4e9f910e2a9650d72856e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 20 Jun 2000 19:16:11 +0000 Subject: [PATCH 0259/7878] Remove unixd_detach function, because it is provided by APR as ap_detach. This also modifies the ap_detach function to look like unixd_detach. Finally all calls to unixd_detach are changed to ap_detach. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60234 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 7 ++----- include/arch/unix/threadproc.h | 5 ----- threadproc/unix/proc.c | 5 ++--- threadproc/unix/procsup.c | 13 +++++++------ threadproc/unix/threadproc.h | 5 ----- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 5e04aadbff8..84d5b194cb1 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -565,16 +565,13 @@ ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, /* -=head1 ap_status_t ap_detach(ap_proc_t *new_proc, ap_pool_t *cont) +=head1 ap_status_t ap_detach(void) B - arg 1) The new process handler - arg 2) The pool to use if it is needed. - =cut */ -ap_status_t ap_detach(ap_proc_t *new_proc, ap_pool_t *cont); +ap_status_t ap_detach(void); #if APR_HAS_OTHER_CHILD /* diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index 07c97b966dd..812dead632c 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -123,10 +123,5 @@ struct ap_procattr_t { #endif }; -/*This will move to ap_threadproc.h in time, but I need to figure it out - * on windows first. :) - */ -ap_status_t ap_detach(struct ap_proc_t *, ap_pool_t *); - #endif /* ! THREAD_PROC_H */ diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index c74fdc0d6e0..2c96c8aa9e6 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -261,7 +261,6 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, int i; typedef const char *my_stupid_string; my_stupid_string *newargs; - ap_proc_t pgrp; new->in = attr->parent_in; new->err = attr->parent_err; @@ -320,13 +319,13 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, } newargs[i + 3] = NULL; if (attr->detached) { - ap_detach(&pgrp, attr->cntxt); + ap_detach(); } execve(SHELL_PATH, (char **) newargs, env); } else { if (attr->detached) { - ap_detach(&pgrp, attr->cntxt); + ap_detach(); } execve(progname, args, env); } diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index b848fe9a56c..d928058822a 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -54,9 +54,10 @@ #include "threadproc.h" -ap_status_t ap_detach(ap_proc_t *new, ap_pool_t *cont) +ap_status_t ap_detach(void) { int x; + pid_t pgrp; chdir("/"); #if !defined(MPE) && !defined(OS2) && !defined(TPF) && !defined(BEOS) @@ -72,21 +73,21 @@ ap_status_t ap_detach(ap_proc_t *new, ap_pool_t *cont) /* RAISE_SIGSTOP(DETACH);*/ #endif #if HAVE_SETSID - if ((new->pid = setsid()) == -1) { + if ((pgrp = setsid()) == -1) { return errno; } #elif defined(NEXT) || defined(NEWSOS) - if (setpgrp(0, getpid()) == -1 || (new->pid = getpgrp(0)) == -1) { + if (setpgrp(0, getpid()) == -1 || (pgrp = getpgrp(0)) == -1) { return errno; } #elif defined(OS2) || defined(TPF) /* OS/2 don't support process group IDs */ - new->pid = getpid(); + pgrp = getpid(); #elif defined(MPE) /* MPE uses negative pid for process group */ - new->pid = -getpid(); + pgrp = -getpid(); #else - if ((new->pid = setpgrp(getpid(), 0)) == -1) { + if ((pgrp = setpgrp(getpid(), 0)) == -1) { return errno; } #endif diff --git a/threadproc/unix/threadproc.h b/threadproc/unix/threadproc.h index 07c97b966dd..812dead632c 100644 --- a/threadproc/unix/threadproc.h +++ b/threadproc/unix/threadproc.h @@ -123,10 +123,5 @@ struct ap_procattr_t { #endif }; -/*This will move to ap_threadproc.h in time, but I need to figure it out - * on windows first. :) - */ -ap_status_t ap_detach(struct ap_proc_t *, ap_pool_t *); - #endif /* ! THREAD_PROC_H */ From fd91e1eb390a4d2933237a2ee59d01d30dffa984 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 20 Jun 2000 19:36:48 +0000 Subject: [PATCH 0260/7878] ap_create_pipe was changed to return a pipe with both handles blocking (previously, both handles were non-blocking). ap_set_pipe_timeout() is now the only way to manipulate the blocking state of the pipe. Pass -1 for timeout to make it blocking; pass 0 for timeout to make it non-blocking. ap_block_pipe() is gone. A few minor bugs were fixed along the way. OS-specific notes: non-Unix in general: Only Unix/BeOS currently has the optimization to keep track of the blocking state. This is used to avoid syscalls as well as to handle ap_put_os_file(), which is a case where we don't know the blocking state of the handle we are given. OS/2: ap_set_pipe_timeout() with timeout value > 0: The code didn't play with the blocking state before and it doesn't still. I did add logic for special timeout values 0 and -1 to play with the blocking state. ap_create_pipe(): old logic didn't do anything with the blocking state of the second handle; it still doesn't; hopefully it is blocking pre-BONE BEOS: old code to make a pipe non-blocking was a no-op; now it returns APR_ENOTIMPL BONE: old code to make a pipe non-blocking; it passed &zero as the parm to FIONBIO instead of &one; this bug was fixed Win32: The pipe was always created blocking before; no change previously, ap_setprocattr_io() ignored the blocking flag; now it respects it like other platforms and calls ap_set_pipe_timeout(p,0) on appropriate pipe handles (Bill Stoddard was just working in ap_set_pipe_timeout(), so I presume this is golden) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60235 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/pipe.c | 14 +++--- file_io/unix/filedup.c | 1 + file_io/unix/fileio.h | 1 + file_io/unix/open.c | 3 ++ file_io/unix/pipe.c | 90 +++++++++++++++++++++++--------------- include/apr_file_io.h | 14 +----- include/arch/unix/fileio.h | 1 + threadproc/beos/proc.c | 36 ++++++++++----- threadproc/os2/proc.c | 36 ++++++++++----- threadproc/unix/proc.c | 36 ++++++++++----- threadproc/win32/proc.c | 39 +++++++++++++++++ 11 files changed, 179 insertions(+), 92 deletions(-) diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index b59c1684689..9ee856d1c75 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -68,7 +68,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) char pipename[50]; sprintf(pipename, "/pipe/%d.%d", getpid(), id++); - rc = DosCreateNPipe(pipename, filedes, NP_ACCESS_INBOUND, NP_NOWAIT|1, 4096, 4096, 0); + rc = DosCreateNPipe(pipename, filedes, NP_ACCESS_INBOUND, 1, 4096, 4096, 0); if (rc) return APR_OS2_STATUS(rc); @@ -146,13 +146,13 @@ ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; + if (thepipe->timeout == 0) { + return APR_OS2_STATUS(DosSetNPHState (thepipe->filedes, NP_NOWAIT)); + } + else if (thepipe->timeout == -1) { + return APR_OS2_STATUS(DosSetNPHState (thepipe->filedes, NP_WAIT)); + } return APR_SUCCESS; } return APR_EINVAL; } - - -ap_status_t ap_block_pipe(ap_file_t *thepipe) -{ - return APR_OS2_STATUS(DosSetNPHState (thepipe->filedes, NP_WAIT)); -} diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index b21f91a093c..2a953da087c 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -84,6 +84,7 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) #endif (*new_file)->buffer = ap_palloc(p, APR_FILE_BUFSIZE); } + (*new_file)->blocking = old_file->blocking; /* this is the way dup() works */ ap_register_cleanup((*new_file)->cntxt, (void *)(*new_file), ap_unix_file_cleanup, ap_null_cleanup); return APR_SUCCESS; diff --git a/file_io/unix/fileio.h b/file_io/unix/fileio.h index 91306e0d3ed..df2b80a5386 100644 --- a/file_io/unix/fileio.h +++ b/file_io/unix/fileio.h @@ -117,6 +117,7 @@ struct ap_file_t { int pipe; ap_interval_time_t timeout; int buffered; + enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ /* Stuff for buffered mode */ diff --git a/file_io/unix/open.c b/file_io/unix/open.c index d12dd6413ed..b891a494ca8 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -107,6 +107,7 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil (*new)->fname = ap_pstrdup(cont, fname); + (*new)->blocking = BLK_ON; (*new)->buffered = (flag & APR_BUFFERED) > 0; if ((*new)->buffered) { @@ -211,6 +212,7 @@ ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, } (*file)->eof_hit = 0; (*file)->buffered = 0; + (*file)->blocking = BLK_UNKNOWN; /* in case it is a pipe */ (*file)->timeout = -1; (*file)->filedes = *dafile; /* buffer already NULL; @@ -247,6 +249,7 @@ ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont) (*thefile)->filedes = STDERR_FILENO; (*thefile)->cntxt = cont; (*thefile)->buffered = 0; + (*thefile)->blocking = BLK_UNKNOWN; (*thefile)->fname = NULL; (*thefile)->eof_hit = 0; diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 786ea0ac2d3..f68fcbcf75d 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -54,6 +54,42 @@ #include "fileio.h" +static ap_status_t pipeblock(ap_file_t *thepipe) +{ +#if !BEOS /* this code won't work on BeOS */ + int fd_flags; + + fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); + #if defined(O_NONBLOCK) + fd_flags &= ~O_NONBLOCK; + #elif defined(~O_NDELAY) + fd_flags &= ~O_NDELAY; + #elif defined(FNDELAY) + fd_flags &= ~O_FNDELAY; + #else + /* XXXX: this breaks things, but an alternative isn't obvious...*/ + return APR_ENOTIMPL; + #endif + if (fcntl(thepipe->filedes, F_SETFL, fd_flags) == -1) { + return errno; + } + +#else + +#if BEOS_BONE /* This only works on BONE or beyond */ + int on = 0; + if (ioctl(thepipe->filedes, FIONBIO, &on, sizeof(on)) < 0) + return errno; +#else /* BEOS_BONE */ + return APR_ENOTIMPL; +#endif /* BEOS_BONE */ + +#endif /* !BEOS_R5 */ + + thepipe->blocking = BLK_ON; + return APR_SUCCESS; +} + static ap_status_t pipenonblock(ap_file_t *thepipe) { #if !BEOS /* this code won't work on BeOS */ @@ -67,7 +103,7 @@ static ap_status_t pipenonblock(ap_file_t *thepipe) fd_flags |= O_FNDELAY; #else /* XXXX: this breaks things, but an alternative isn't obvious...*/ - return -1; + return APR_ENOTIMPL; #endif if (fcntl(thepipe->filedes, F_SETFL, fd_flags) == -1) { return errno; @@ -76,12 +112,16 @@ static ap_status_t pipenonblock(ap_file_t *thepipe) #else /* !BEOS */ #if BEOS_BONE /* This only works on BONE and later...*/ - int on = 0; + int on = 1; if (ioctl(thepipe->filedes, FIONBIO, &on, sizeof(on)) < 0) return errno; +#else /* BEOS_BONE */ + return APR_ENOTIMPL; #endif /* BEOS_BONE */ #endif /* !BEOS */ + + thepipe->blocking = BLK_OFF; return APR_SUCCESS; } @@ -89,6 +129,16 @@ ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; + if (timeout >= 0) { + if (thepipe->blocking != BLK_OFF) { /* blocking or unknown state */ + return pipenonblock(thepipe); + } + } + else { + if (thepipe->blocking != BLK_ON) { /* non-blocking or unknown state */ + return pipeblock(thepipe); + } + } return APR_SUCCESS; } return APR_EINVAL; @@ -108,6 +158,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*in)->pipe = 1; (*in)->fname = ap_pstrdup(cont, "PIPE"); (*in)->buffered = 0; + (*in)->blocking = BLK_ON; (*in)->timeout = -1; (*in)->ungetchar = -1; #if APR_HAS_THREADS @@ -120,14 +171,12 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*out)->pipe = 1; (*out)->fname = ap_pstrdup(cont, "PIPE"); (*out)->buffered = 0; + (*out)->blocking = BLK_ON; (*out)->timeout = -1; #if APR_HAS_THREADS (*in)->thlock = NULL; #endif - pipenonblock(*in); - pipenonblock(*out); - return APR_SUCCESS; } @@ -142,36 +191,5 @@ ap_status_t ap_create_namedpipe(const char *filename, return APR_SUCCESS; } -ap_status_t ap_block_pipe(ap_file_t *thepipe) -{ -#if !BEOS /* this code won't work on BeOS */ - int fd_flags; - - fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); - #if defined(O_NONBLOCK) - fd_flags &= ~O_NONBLOCK; - #elif defined(~O_NDELAY) - fd_flags &= ~O_NDELAY; - #elif defined(FNDELAY) - fd_flags &= ~O_FNDELAY; - #else - /* XXXX: this breaks things, but an alternative isn't obvious...*/ - return -1; - #endif - if (fcntl(thepipe->filedes, F_SETFL, fd_flags) == -1) { - return errno; - } - -#else - -#if BEOS_BONE /* This only works on BONE or beyond */ - int on = 0; - if (ioctl(thepipe->filedes, FIONBIO, &on, sizeof(on)) < 0) - return errno; -#endif /* BEOS_BONE */ - -#endif /* !BEOS_R5 */ - return APR_SUCCESS; -} diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 824e92dc039..de5e6708fe6 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -572,7 +572,7 @@ ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, =head1 ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) -B +B arg 1) The pipe we are setting a timeout on. arg 2) The timeout value in microseconds. Values < 0 mean wait forever, 0 @@ -582,18 +582,6 @@ B */ ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout); -/* - -=head1 ap_status_t ap_block_pipe(ap_file_t *thepipe) - -B - - arg 1) The pipe to operate on. - -=cut - */ -ap_status_t ap_block_pipe(ap_file_t *thepipe); - /*accessor and general file_io functions. */ /* diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 91306e0d3ed..df2b80a5386 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -117,6 +117,7 @@ struct ap_file_t { int pipe; ap_interval_time_t timeout; int buffered; + enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ /* Stuff for buffered mode */ diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 84b7ce9e393..de3b04737e1 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -92,12 +92,16 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, } switch (in) { case APR_FULL_BLOCK: - ap_block_pipe(attr->child_in); - ap_block_pipe(attr->parent_in); + break; case APR_PARENT_BLOCK: - ap_block_pipe(attr->parent_in); + ap_set_pipe_timeout(attr->child_in, 0); + break; case APR_CHILD_BLOCK: - ap_block_pipe(attr->child_in); + ap_set_pipe_timeout(attr->parent_in, 0); + break; + default: + ap_set_pipe_timeout(attr->child_in, 0); + ap_set_pipe_timeout(attr->parent_in, 0); } } if (out) { @@ -107,12 +111,16 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, } switch (out) { case APR_FULL_BLOCK: - ap_block_pipe(attr->child_out); - ap_block_pipe(attr->parent_out); + break; case APR_PARENT_BLOCK: - ap_block_pipe(attr->parent_out); + ap_set_pipe_timeout(attr->child_out, 0); + break; case APR_CHILD_BLOCK: - ap_block_pipe(attr->child_out); + ap_set_pipe_timeout(attr->parent_out, 0); + break; + default: + ap_set_pipe_timeout(attr->child_out, 0); + ap_set_pipe_timeout(attr->parent_out, 0); } } if (err) { @@ -122,12 +130,16 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, } switch (err) { case APR_FULL_BLOCK: - ap_block_pipe(attr->child_err); - ap_block_pipe(attr->parent_err); + break; case APR_PARENT_BLOCK: - ap_block_pipe(attr->parent_err); + ap_set_pipe_timeout(attr->child_err, 0); + break; case APR_CHILD_BLOCK: - ap_block_pipe(attr->child_err); + ap_set_pipe_timeout(attr->parent_err, 0); + break; + default: + ap_set_pipe_timeout(attr->child_err, 0); + ap_set_pipe_timeout(attr->parent_err, 0); } } return APR_SUCCESS; diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index acfd80f639e..03f82ccd7f8 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -103,12 +103,16 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, } switch (in) { case APR_FULL_BLOCK: - ap_block_pipe(attr->child_in); - ap_block_pipe(attr->parent_in); + break; case APR_PARENT_BLOCK: - ap_block_pipe(attr->parent_in); + ap_set_pipe_timeout(attr->child_in, 0); + break; case APR_CHILD_BLOCK: - ap_block_pipe(attr->child_in); + ap_set_pipe_timeout(attr->parent_in, 0); + break; + default: + ap_set_pipe_timeout(attr->child_in, 0); + ap_set_pipe_timeout(attr->parent_in, 0); } } if (out) { @@ -118,12 +122,16 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, } switch (out) { case APR_FULL_BLOCK: - ap_block_pipe(attr->child_out); - ap_block_pipe(attr->parent_out); + break; case APR_PARENT_BLOCK: - ap_block_pipe(attr->parent_out); + ap_set_pipe_timeout(attr->child_out, 0); + break; case APR_CHILD_BLOCK: - ap_block_pipe(attr->child_out); + ap_set_pipe_timeout(attr->parent_out, 0); + break; + default: + ap_set_pipe_timeout(attr->child_out, 0); + ap_set_pipe_timeout(attr->parent_out, 0); } } if (err) { @@ -133,12 +141,16 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, } switch (err) { case APR_FULL_BLOCK: - ap_block_pipe(attr->child_err); - ap_block_pipe(attr->parent_err); + break; case APR_PARENT_BLOCK: - ap_block_pipe(attr->parent_err); + ap_set_pipe_timeout(attr->child_err, 0); + break; case APR_CHILD_BLOCK: - ap_block_pipe(attr->child_err); + ap_set_pipe_timeout(attr->parent_err, 0); + break; + default: + ap_set_pipe_timeout(attr->child_err, 0); + ap_set_pipe_timeout(attr->parent_err, 0); } } return APR_SUCCESS; diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 2c96c8aa9e6..787501a1a6d 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -78,12 +78,16 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, } switch (in) { case APR_FULL_BLOCK: - ap_block_pipe(attr->child_in); - ap_block_pipe(attr->parent_in); + break; case APR_PARENT_BLOCK: - ap_block_pipe(attr->parent_in); + ap_set_pipe_timeout(attr->child_in, 0); + break; case APR_CHILD_BLOCK: - ap_block_pipe(attr->child_in); + ap_set_pipe_timeout(attr->parent_in, 0); + break; + default: + ap_set_pipe_timeout(attr->child_in, 0); + ap_set_pipe_timeout(attr->parent_in, 0); } } if (out) { @@ -93,12 +97,16 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, } switch (out) { case APR_FULL_BLOCK: - ap_block_pipe(attr->child_out); - ap_block_pipe(attr->parent_out); + break; case APR_PARENT_BLOCK: - ap_block_pipe(attr->parent_out); + ap_set_pipe_timeout(attr->child_out, 0); + break; case APR_CHILD_BLOCK: - ap_block_pipe(attr->child_out); + ap_set_pipe_timeout(attr->parent_out, 0); + break; + default: + ap_set_pipe_timeout(attr->child_out, 0); + ap_set_pipe_timeout(attr->parent_out, 0); } } if (err) { @@ -108,12 +116,16 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, } switch (err) { case APR_FULL_BLOCK: - ap_block_pipe(attr->child_err); - ap_block_pipe(attr->parent_err); + break; case APR_PARENT_BLOCK: - ap_block_pipe(attr->parent_err); + ap_set_pipe_timeout(attr->child_err, 0); + break; case APR_CHILD_BLOCK: - ap_block_pipe(attr->child_err); + ap_set_pipe_timeout(attr->parent_err, 0); + break; + default: + ap_set_pipe_timeout(attr->child_err, 0); + ap_set_pipe_timeout(attr->parent_err, 0); } } return APR_SUCCESS; diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 5f22460a6da..25fe9ba5462 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -97,18 +97,57 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, attr->cntxt)) != APR_SUCCESS) { return stat; } + switch (in) { + case APR_FULL_BLOCK: + break; + case APR_PARENT_BLOCK: + ap_set_pipe_timeout(attr->child_in, 0); + break; + case APR_CHILD_BLOCK: + ap_set_pipe_timeout(attr->parent_in, 0); + break; + default: + ap_set_pipe_timeout(attr->child_in, 0); + ap_set_pipe_timeout(attr->parent_in, 0); + } } if (out) { if ((stat = ap_create_pipe(&attr->parent_out, &attr->child_out, attr->cntxt)) != APR_SUCCESS) { return stat; } + switch (out) { + case APR_FULL_BLOCK: + break; + case APR_PARENT_BLOCK: + ap_set_pipe_timeout(attr->child_out, 0); + break; + case APR_CHILD_BLOCK: + ap_set_pipe_timeout(attr->parent_out, 0); + break; + default: + ap_set_pipe_timeout(attr->child_out, 0); + ap_set_pipe_timeout(attr->parent_out, 0); + } } if (err) { if ((stat = ap_create_pipe(&attr->parent_err, &attr->child_err, attr->cntxt)) != APR_SUCCESS) { return stat; } + switch (err) { + case APR_FULL_BLOCK: + break; + case APR_PARENT_BLOCK: + ap_set_pipe_timeout(attr->child_err, 0); + break; + case APR_CHILD_BLOCK: + ap_set_pipe_timeout(attr->parent_err, 0); + break; + default: + ap_set_pipe_timeout(attr->child_err, 0); + ap_set_pipe_timeout(attr->parent_err, 0); + } } return APR_SUCCESS; } From e6d55e09e425583fe5c7048417af9593226b8455 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 20 Jun 2000 22:58:29 +0000 Subject: [PATCH 0261/7878] Fix the config.cache used for MM. MM now uses the same cache file as the rest of Apache. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60236 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aclocal.m4 b/aclocal.m4 index 88e83d34a17..fd5daa746bb 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -267,6 +267,11 @@ AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [ ac_abs_srcdir=`(cd $srcdir/$1 && pwd)` cd $1 +changequote(, )dnl + # A "../" for each directory in /$config_subdirs. + ac_dots=`echo $config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` +changequote([, ])dnl + # Make the cache file name correct relative to the subdirectory. case "$cache_file" in /*) ac_sub_cache_file=$cache_file ;; From 120edfc7a5ae3096edd448a00bd2411073f8c6d5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 20 Jun 2000 23:51:05 +0000 Subject: [PATCH 0262/7878] Remvoe some checks that are producing macros that are never used. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60237 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 --------- 1 file changed, 9 deletions(-) diff --git a/configure.in b/configure.in index 38ca6a1e6a9..1b32f7d9b49 100644 --- a/configure.in +++ b/configure.in @@ -234,22 +234,16 @@ AC_CHECK_HEADERS(dirent.h, direnth="1", dirent="0") AC_CHECK_HEADERS(errno.h, errnoh="1", errnoh="0") AC_CHECK_HEADERS(net/errno.h) AC_CHECK_HEADERS(fcntl.h, fcntlh="1", fcntl="0") -AC_CHECK_HEADERS(features.h) -AC_CHECK_HEADERS(grp.h) AC_CHECK_HEADERS(io.h) AC_CHECK_HEADERS(limits.h) AC_CHECK_HEADERS(malloc.h) -AC_CHECK_HEADERS(math.h) AC_CHECK_HEADERS(memory.h) AC_CHECK_HEADERS(netdb.h) AC_CHECK_HEADERS(osreldate.h) AC_CHECK_HEADERS(process.h) -AC_CHECK_HEADERS(pwd.h) AC_CHECK_HEADERS(sys/sem.h) -AC_CHECK_HEADERS(setjmp.h) AC_CHECK_HEADERS(signal.h, signalh="1", signalh="0") AC_CHECK_HEADERS(stdarg.h, stdargh="1", stdargh="0") -AC_CHECK_HEADERS(stddef.h) AC_CHECK_HEADERS(stdio.h, stdioh="1", stdioh"0") AC_CHECK_HEADERS(stdlib.h) AC_CHECK_HEADERS(string.h) @@ -258,7 +252,6 @@ AC_CHECK_HEADERS(sysgtime.h) AC_CHECK_HEADERS(termios.h) AC_CHECK_HEADERS(time.h) AC_CHECK_HEADERS(sys/time.h) -AC_CHECK_HEADERS(sys/times.h) AC_CHECK_HEADERS(tpfeq.h) AC_CHECK_HEADERS(tpfio.h) AC_CHECK_HEADERS(sys/uio.h, sys_uioh="1", sys_uioh="0") @@ -272,9 +265,7 @@ AC_CHECK_HEADERS(iconv.h) AC_CHECK_HEADERS(langinfo.h) AC_CHECK_HEADERS(sys/file.h) -AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/mman.h) -AC_CHECK_HEADERS(sys/param.h) AC_CHECK_HEADERS(sys/resource.h) AC_CHECK_HEADERS(sys/select.h) AC_CHECK_HEADERS(sys/sendfile.h) From 6152cae608162fa6834762e4a4c02604a548bd47 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 21 Jun 2000 23:11:28 +0000 Subject: [PATCH 0263/7878] Remove warnings on some 64 bit machines because we were return 32 bit integers and we wanted 64 bit integers Submitted by: Victor J. Orlikowski Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60238 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 4 ++-- network_io/unix/sendrecv.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 26a92dd514f..dcf50afb435 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -324,7 +324,7 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len); /* -=head1 ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, ap_int32_t nvec, ap_int32_t *len) +=head1 ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, ap_int32_t nvec, ap_ssize_t *len) B @@ -344,7 +344,7 @@ B: This functions acts like a blocking write by default. To change =cut */ ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, - ap_int32_t nvec, ap_int32_t *len); + ap_int32_t nvec, ap_ssize_t *len); #if APR_HAS_SENDFILE /* diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 1d2b9a9bd31..3fb33a5498f 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -173,9 +173,9 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) #ifdef HAVE_WRITEV ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, - ap_int32_t nvec, ap_int32_t *len) + ap_int32_t nvec, ap_ssize_t *len) { - ssize_t rv; + ap_ssize_t rv; do { rv = writev(sock->socketdes, vec, nvec); From 5f2b51d63ebad8e779db6a8685d9d198d5fe7290 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 22 Jun 2000 00:36:07 +0000 Subject: [PATCH 0264/7878] Big commit. Basically, if APR defines a public feature macro, then APR should also use that macro internally. This keeps us from checking for multiple macros as we were doing in the SENDFILE case. It also means that APR is definately building the same way that external programs expect it to. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60239 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileio.h | 13 +++++++------ file_io/win32/dir.c | 16 +++++++++------- file_io/win32/fileio.h | 18 ++++++++++-------- include/apr_network_io.h | 2 +- include/arch/unix/fileio.h | 13 +++++++------ include/arch/unix/locks.h | 19 ++++++++++--------- include/arch/unix/misc.h | 6 +++--- include/arch/unix/mmap.c | 2 +- include/arch/unix/networkio.h | 9 +++++---- include/arch/unix/threadproc.h | 7 ++++--- include/arch/win32/fileio.h | 18 ++++++++++-------- include/arch/win32/misc.h | 6 +++--- lib/apr_cpystrn.c | 11 ++++++----- lib/apr_pools.c | 9 +++++---- lib/apr_signal.c | 2 +- lib/apr_snprintf.c | 3 ++- locks/unix/crossproc.c | 9 +++++---- locks/unix/intraproc.c | 2 +- locks/unix/locks.c | 6 +++--- locks/unix/locks.h | 19 ++++++++++--------- memory/unix/apr_pools.c | 9 +++++---- misc/unix/misc.h | 6 +++--- misc/unix/otherchild.c | 3 ++- mmap/unix/common.c | 2 +- mmap/unix/mmap.c | 2 +- mmap/unix/mmap_h.h | 3 ++- network_io/unix/networkio.h | 9 +++++---- network_io/unix/sendrecv.c | 8 ++++---- network_io/unix/sockaddr.c | 2 +- network_io/win32/sendrecv.c | 2 +- threadproc/unix/thread.c | 5 +++-- threadproc/unix/threadpriv.c | 5 +++-- threadproc/unix/threadproc.h | 7 ++++--- 33 files changed, 138 insertions(+), 115 deletions(-) diff --git a/file_io/unix/fileio.h b/file_io/unix/fileio.h index df2b80a5386..46e55f7f998 100644 --- a/file_io/unix/fileio.h +++ b/file_io/unix/fileio.h @@ -55,6 +55,7 @@ #ifndef FILE_IO_H #define FILE_IO_H +#include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_file_io.h" @@ -62,19 +63,19 @@ #include "apr_lib.h" /* System headers the file I/O library needs */ -#if HAVE_FCNTL_H +#if APR_HAVE_FCNTL_H #include #endif -#if HAVE_SYS_TYPES_H +#if APR_HAVE_SYS_TYPES_H #include #endif -#if HAVE_ERRNO_H +#if APR_HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif -#if HAVE_DIRENT_H +#if APR_HAVE_DIRENT_H #include #endif #if HAVE_SYS_STAT_H @@ -83,13 +84,13 @@ #if HAVE_UNISTD_H #include #endif -#if HAVE_STDIO_H +#if APR_HAVE_STDIO_H #include #endif #if HAVE_STDLIB_H #include #endif -#if HAVE_SYS_UIO_H +#if APR_HAVE_SYS_UIO_H #include #endif #if HAVE_SYS_TIME_H diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index a74a5aa90fb..066a96aecc1 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -52,23 +52,25 @@ * . */ -#ifdef HAVE_ERRNO_H +#include "apr.h" +#include "fileio.h" +#include "apr_file_io.h" +#include "apr_lib.h" +#include "apr_portable.h" +#include "atime.h" + +#ifdef APR_HAVE_ERRNO_H #include #endif #ifdef HAVE_STRING_H #include #endif -#ifdef HAVE_DIRENT_H +#ifdef APR_HAVE_DIRENT_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif -#include "fileio.h" -#include "apr_file_io.h" -#include "apr_lib.h" -#include "apr_portable.h" -#include "atime.h" ap_status_t dir_cleanup(void *thedir) { diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 35d60dc2bac..90df1729e95 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -55,7 +55,15 @@ #ifndef FILE_IO_H #define FILE_IO_H -#ifdef HAVE_SYS_STAT_H +#include "apr.h" +#include "apr_private.h" +#include "apr_pools.h" +#include "apr_general.h" +#include "apr_lock.h" +#include "apr_file_io.h" +#include "apr_errno.h" + +#ifdef APR_HAVE_SYS_STAT_H #include #endif #ifdef HAVE_SYS_TYPES_H @@ -67,7 +75,7 @@ #ifdef HAVE_TIME_H #include #endif -#ifdef HAVE_DIRENT_H +#ifdef APR_HAVE_DIRENT_H #include #endif #ifdef HAVE_MALLOC_H @@ -76,12 +84,6 @@ #ifdef HAVE_UIO_H #include #endif -#include "apr_private.h" -#include "apr_pools.h" -#include "apr_general.h" -#include "apr_lock.h" -#include "apr_file_io.h" -#include "apr_errno.h" #define APR_FILE_BUFSIZE 4096 diff --git a/include/apr_network_io.h b/include/apr_network_io.h index dcf50afb435..99dd8435595 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -101,7 +101,7 @@ typedef enum {APR_SHUTDOWN_READ, APR_SHUTDOWN_WRITE, /* We need to make sure we always have an in_addr type, so APR will just * define it ourselves, if the platform doesn't provide it. */ -#if !defined(APR_HAVE_IN_ADDR) +#if (!APR_HAVE_IN_ADDR) struct in_addr { ap_uint32_t s_addr; } diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index df2b80a5386..46e55f7f998 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -55,6 +55,7 @@ #ifndef FILE_IO_H #define FILE_IO_H +#include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_file_io.h" @@ -62,19 +63,19 @@ #include "apr_lib.h" /* System headers the file I/O library needs */ -#if HAVE_FCNTL_H +#if APR_HAVE_FCNTL_H #include #endif -#if HAVE_SYS_TYPES_H +#if APR_HAVE_SYS_TYPES_H #include #endif -#if HAVE_ERRNO_H +#if APR_HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif -#if HAVE_DIRENT_H +#if APR_HAVE_DIRENT_H #include #endif #if HAVE_SYS_STAT_H @@ -83,13 +84,13 @@ #if HAVE_UNISTD_H #include #endif -#if HAVE_STDIO_H +#if APR_HAVE_STDIO_H #include #endif #if HAVE_STDLIB_H #include #endif -#if HAVE_SYS_UIO_H +#if APR_HAVE_SYS_UIO_H #include #endif #if HAVE_SYS_TIME_H diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index 847a8107b7b..d6ecae5dbb6 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -55,6 +55,7 @@ #ifndef LOCKS_H #define LOCKS_H +#include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_lib.h" @@ -70,7 +71,7 @@ #if HAVE_USLOCKS_H #include #endif -#if HAVE_SYS_TYPES_H +#if APR_HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_IPC_H @@ -82,13 +83,13 @@ #if HAVE_SYS_FILE_H #include #endif -#if HAVE_STDIO_H +#if APR_HAVE_STDIO_H #include #endif #if HAVE_STDLIB_H #include #endif -#if HAVE_FCNTL_H +#if APR_HAVE_FCNTL_H #include #endif #if HAVE_SYS_MMAN_H @@ -96,7 +97,7 @@ #endif #if APR_HAS_THREADS -#if HAVE_PTHREAD_H +#if APR_HAVE_PTHREAD_H #include #endif #endif @@ -117,13 +118,13 @@ struct ap_lock_t { ap_lockscope_e scope; int curr_locked; char *fname; -#if USE_SYSVSEM_SERIALIZE +#if APR_USE_SYSVSEM_SERIALIZE int interproc; -#elif USE_FCNTL_SERIALIZE +#elif APR_USE_FCNTL_SERIALIZE int interproc; -#elif USE_PROC_PTHREAD_SERIALIZE +#elif APR_USE_PROC_PTHREAD_SERIALIZE pthread_mutex_t *interproc; -#elif USE_FLOCK_SERIALIZE +#elif APR_USE_FLOCK_SERIALIZE int interproc; #else /* No Interprocess serialization. Too bad. */ @@ -131,7 +132,7 @@ struct ap_lock_t { #if APR_HAS_THREADS /* APR doesn't have threads, no sense in having an thread lock mechanism. */ -#if USE_PTHREAD_SERIALIZE +#if APR_USE_PTHREAD_SERIALIZE pthread_mutex_t *intraproc; #endif #endif diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index 333ea0defe8..e4b10ee7e50 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -67,16 +67,16 @@ #ifdef HAVE_STDLIB_H #include #endif -#ifdef HAVE_STDIO_H +#ifdef APR_HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif -#ifdef HAVE_SIGNAL_H +#ifdef APR_HAVE_SIGNAL_H #include #endif -#ifdef HAVE_PTHREAD_H +#ifdef APR_HAVE_PTHREAD_H #include #endif #ifdef BEOS diff --git a/include/arch/unix/mmap.c b/include/arch/unix/mmap.c index a4800ddbb3f..90609ea62a9 100644 --- a/include/arch/unix/mmap.c +++ b/include/arch/unix/mmap.c @@ -55,7 +55,7 @@ #include "mmap_h.h" #include "apr_portable.h" -#if HAVE_MMAP || defined(BEOS) +#if APR_HAVE_MMAP || defined(BEOS) static ap_status_t mmap_cleanup(void *themmap) { diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index ad51736873e..6dccfaad8cc 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -55,6 +55,7 @@ #ifndef NETWORK_IO_H #define NETWORK_IO_H +#include "apr.h" #include "apr_private.h" #include "apr_network_io.h" #include "apr_errno.h" @@ -62,16 +63,16 @@ #include "apr_lib.h" /* System headers the network I/O library needs */ -#if HAVE_SYS_TYPES_H +#if APR_HAVE_SYS_TYPES_H #include #endif -#if HAVE_SYS_UIO_H +#if APR_HAVE_SYS_UIO_H #include #endif #if HAVE_POLL_H #include #endif -#if HAVE_ERRNO_H +#if APR_HAVE_ERRNO_H #include #endif #if HAVE_SYS_TIME_H @@ -98,7 +99,7 @@ #if HAVE_NETDB_H #include #endif -#if HAVE_FCNTL_H +#if APR_HAVE_FCNTL_H #include #endif #if HAVE_SYS_SENDFILE_H diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index 812dead632c..e6d9e36aa3f 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -52,25 +52,26 @@ * . */ +#include "apr.h" #include "apr_private.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #include "fileio.h" /* System headers required for thread/process library */ -#if HAVE_PTHREAD_H +#if APR_HAVE_PTHREAD_H #include #endif #if HAVE_SYS_RESOURCE_H #include #endif -#if HAVE_SIGNAL_H +#if APR_HAVE_SIGNAL_H #include #endif #if HAVE_STRING_H #include #endif -#if HAVE_SYS_WAIT_H +#if APR_HAVE_SYS_WAIT_H #include #endif #if HAVE_STRING_H diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 35d60dc2bac..90df1729e95 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -55,7 +55,15 @@ #ifndef FILE_IO_H #define FILE_IO_H -#ifdef HAVE_SYS_STAT_H +#include "apr.h" +#include "apr_private.h" +#include "apr_pools.h" +#include "apr_general.h" +#include "apr_lock.h" +#include "apr_file_io.h" +#include "apr_errno.h" + +#ifdef APR_HAVE_SYS_STAT_H #include #endif #ifdef HAVE_SYS_TYPES_H @@ -67,7 +75,7 @@ #ifdef HAVE_TIME_H #include #endif -#ifdef HAVE_DIRENT_H +#ifdef APR_HAVE_DIRENT_H #include #endif #ifdef HAVE_MALLOC_H @@ -76,12 +84,6 @@ #ifdef HAVE_UIO_H #include #endif -#include "apr_private.h" -#include "apr_pools.h" -#include "apr_general.h" -#include "apr_lock.h" -#include "apr_file_io.h" -#include "apr_errno.h" #define APR_FILE_BUFSIZE 4096 diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 333ea0defe8..e4b10ee7e50 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -67,16 +67,16 @@ #ifdef HAVE_STDLIB_H #include #endif -#ifdef HAVE_STDIO_H +#ifdef APR_HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif -#ifdef HAVE_SIGNAL_H +#ifdef APR_HAVE_SIGNAL_H #include #endif -#ifdef HAVE_PTHREAD_H +#ifdef APR_HAVE_PTHREAD_H #include #endif #ifdef BEOS diff --git a/lib/apr_cpystrn.c b/lib/apr_cpystrn.c index 444e005a256..17f27014571 100644 --- a/lib/apr_cpystrn.c +++ b/lib/apr_cpystrn.c @@ -52,10 +52,11 @@ * . */ +#include "apr.h" #include "apr_private.h" #include "apr_lib.h" -#if HAVE_SYS_TYPES_H +#if APR_HAVE_SYS_TYPES_H #include #endif #if HAVE_STRING_H @@ -243,7 +244,7 @@ APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src) return (dest); } -#ifndef HAVE_STRDUP +#if !APR_HAVE_STRDUP char *strdup(const char *str) { char *sdup; @@ -259,7 +260,7 @@ char *strdup(const char *str) #endif /* The following two routines were donated for SVR4 by Andreas Vogel */ -#if !defined(HAVE_STRCASECMP) && !defined(HAVE_STRICMP) +#if (!APR_HAVE_STRCASECMP && !APR_HAVE_STRICMP) int strcasecmp(const char *a, const char *b) { const char *p = a; @@ -278,7 +279,7 @@ int strcasecmp(const char *a, const char *b) #endif -#if !defined(HAVE_STRNCASECMP) && !defined(HAVE_STRNICMP) +#if (!APR_HAVE_STRNCASECMP && !APR_HAVE_STRNICMP) int strncasecmp(const char *a, const char *b, size_t n) { const char *p = a; @@ -299,7 +300,7 @@ int strncasecmp(const char *a, const char *b, size_t n) #endif /* The following routine was donated for UTS21 by dwd@bell-labs.com */ -#ifndef HAVE_STRSTR +#if (!APR_HAVE_STRSTR) char *strstr(char *s1, char *s2) { char *p1, *p2; diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 58ab329a543..89ebdf9da00 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -59,6 +59,7 @@ * rst --- 4/95 --- 6/95 */ +#include "apr.h" #include "apr_private.h" #include "apr_portable.h" /* for get_os_proc */ @@ -74,19 +75,19 @@ #ifdef HAVE_SYS_SIGNAL_H #include #endif -#ifdef HAVE_SIGNAL_H +#ifdef APR_HAVE_SIGNAL_H #include #endif -#ifdef HAVE_SYS_WAIT_H +#ifdef APR_HAVE_SYS_WAIT_H #include #endif -#ifdef HAVE_SYS_TYPES_H +#ifdef APR_HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_UNISTD_H #include #endif -#ifdef HAVE_FCNTL_H +#ifdef APR_HAVE_FCNTL_H #include #endif diff --git a/lib/apr_signal.c b/lib/apr_signal.c index 9fd1164c8a7..340a88bf45b 100644 --- a/lib/apr_signal.c +++ b/lib/apr_signal.c @@ -54,7 +54,7 @@ #include "apr_private.h" #include "apr_lib.h" -#ifdef HAVE_SIGNAL_H +#ifdef APR_HAVE_SIGNAL_H #include #endif diff --git a/lib/apr_snprintf.c b/lib/apr_snprintf.c index 5f9da46774c..2fa0461ffc2 100644 --- a/lib/apr_snprintf.c +++ b/lib/apr_snprintf.c @@ -56,6 +56,7 @@ * Tsirigotis for xinetd. */ +#include "apr.h" #include "apr_private.h" #include "apr_lib.h" @@ -63,7 +64,7 @@ #ifdef HAVE_CTYPE_H #include #endif -#if HAVE_NETINET_IN_H +#if APR_HAVE_NETINET_IN_H #include #endif #ifdef HAVE_SYS_SOCKET_H diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 0958529ba0b..e543814dc29 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -52,9 +52,10 @@ * . */ +#include "apr.h" #include "locks.h" -#if defined (USE_SYSVSEM_SERIALIZE) +#if APR_USE_SYSVSEM_SERIALIZE static struct sembuf op_on; static struct sembuf op_off; @@ -135,7 +136,7 @@ ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const cha return APR_SUCCESS; } -#elif defined (USE_PROC_PTHREAD_SERIALIZE) +#elif (APR_USE_PROC_PTHREAD_SERIALIZE) void ap_unix_setup_lock(void) { @@ -235,7 +236,7 @@ ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const cha return APR_SUCCESS; } -#elif defined (USE_FCNTL_SERIALIZE) +#elif (APR_USE_FCNTL_SERIALIZE) static struct flock lock_it; static struct flock unlock_it; @@ -322,7 +323,7 @@ ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, return APR_SUCCESS; } -#elif defined (USE_FLOCK_SERIALIZE) +#elif (APR_USE_FLOCK_SERIALIZE) void ap_unix_setup_lock(void) { diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index feb2c52c62f..68ab1a88c37 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -56,7 +56,7 @@ #if APR_HAS_THREADS -#if defined(USE_PTHREAD_SERIALIZE) +#if (APR_USE_PTHREAD_SERIALIZE) static ap_status_t lock_intra_cleanup(void *data) { diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 8f34633d5b9..d36c4e1cd9d 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -67,7 +67,7 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, new->cntxt = cont; new->type = type; new->scope = scope; -#if defined(USE_FCNTL_SERIALIZE) || defined(USE_FLOCK_SERIALIZE) +#if (APR_USE_FCNTL_SERIALIZE) || (APR_USE_FLOCK_SERIALIZE) /* file-based serialization primitives */ if (scope != APR_INTRAPROCESS) { if (fname != NULL) { @@ -197,7 +197,7 @@ ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock) } oslock->crossproc = lock->interproc; #if APR_HAS_THREADS -#if USE_PTHREAD_SERIALIZE +#if APR_USE_PTHREAD_SERIALIZE oslock->intraproc = lock->intraproc; #endif #endif @@ -217,7 +217,7 @@ ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, } (*lock)->interproc = thelock->crossproc; #if APR_HAS_THREADS -#if defined (USE_PTHREAD_SERIALIZE) +#if (APR_USE_PTHREAD_SERIALIZE) (*lock)->intraproc = thelock->intraproc; #endif #endif diff --git a/locks/unix/locks.h b/locks/unix/locks.h index 847a8107b7b..d6ecae5dbb6 100644 --- a/locks/unix/locks.h +++ b/locks/unix/locks.h @@ -55,6 +55,7 @@ #ifndef LOCKS_H #define LOCKS_H +#include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_lib.h" @@ -70,7 +71,7 @@ #if HAVE_USLOCKS_H #include #endif -#if HAVE_SYS_TYPES_H +#if APR_HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_IPC_H @@ -82,13 +83,13 @@ #if HAVE_SYS_FILE_H #include #endif -#if HAVE_STDIO_H +#if APR_HAVE_STDIO_H #include #endif #if HAVE_STDLIB_H #include #endif -#if HAVE_FCNTL_H +#if APR_HAVE_FCNTL_H #include #endif #if HAVE_SYS_MMAN_H @@ -96,7 +97,7 @@ #endif #if APR_HAS_THREADS -#if HAVE_PTHREAD_H +#if APR_HAVE_PTHREAD_H #include #endif #endif @@ -117,13 +118,13 @@ struct ap_lock_t { ap_lockscope_e scope; int curr_locked; char *fname; -#if USE_SYSVSEM_SERIALIZE +#if APR_USE_SYSVSEM_SERIALIZE int interproc; -#elif USE_FCNTL_SERIALIZE +#elif APR_USE_FCNTL_SERIALIZE int interproc; -#elif USE_PROC_PTHREAD_SERIALIZE +#elif APR_USE_PROC_PTHREAD_SERIALIZE pthread_mutex_t *interproc; -#elif USE_FLOCK_SERIALIZE +#elif APR_USE_FLOCK_SERIALIZE int interproc; #else /* No Interprocess serialization. Too bad. */ @@ -131,7 +132,7 @@ struct ap_lock_t { #if APR_HAS_THREADS /* APR doesn't have threads, no sense in having an thread lock mechanism. */ -#if USE_PTHREAD_SERIALIZE +#if APR_USE_PTHREAD_SERIALIZE pthread_mutex_t *intraproc; #endif #endif diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 58ab329a543..89ebdf9da00 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -59,6 +59,7 @@ * rst --- 4/95 --- 6/95 */ +#include "apr.h" #include "apr_private.h" #include "apr_portable.h" /* for get_os_proc */ @@ -74,19 +75,19 @@ #ifdef HAVE_SYS_SIGNAL_H #include #endif -#ifdef HAVE_SIGNAL_H +#ifdef APR_HAVE_SIGNAL_H #include #endif -#ifdef HAVE_SYS_WAIT_H +#ifdef APR_HAVE_SYS_WAIT_H #include #endif -#ifdef HAVE_SYS_TYPES_H +#ifdef APR_HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_UNISTD_H #include #endif -#ifdef HAVE_FCNTL_H +#ifdef APR_HAVE_FCNTL_H #include #endif diff --git a/misc/unix/misc.h b/misc/unix/misc.h index 333ea0defe8..e4b10ee7e50 100644 --- a/misc/unix/misc.h +++ b/misc/unix/misc.h @@ -67,16 +67,16 @@ #ifdef HAVE_STDLIB_H #include #endif -#ifdef HAVE_STDIO_H +#ifdef APR_HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif -#ifdef HAVE_SIGNAL_H +#ifdef APR_HAVE_SIGNAL_H #include #endif -#ifdef HAVE_PTHREAD_H +#ifdef APR_HAVE_PTHREAD_H #include #endif #ifdef BEOS diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index d0bee0b6db3..4019716497e 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -52,6 +52,7 @@ * . */ +#include "apr.h" #include "misc.h" #include "threadproc.h" #include "../../file_io/unix/fileio.h" @@ -61,7 +62,7 @@ #ifdef HAVE_SYS_SELECT_H #include #endif -#ifdef HAVE_SYS_WAIT_H +#ifdef APR_HAVE_SYS_WAIT_H #include #endif #ifdef BEOS diff --git a/mmap/unix/common.c b/mmap/unix/common.c index b80653d8044..4e1ccfd13df 100644 --- a/mmap/unix/common.c +++ b/mmap/unix/common.c @@ -63,7 +63,7 @@ #include "mmap_h.h" -#if HAVE_MMAP || defined(BEOS) +#if APR_HAVE_MMAP || defined(BEOS) ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_off_t offset) { diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index a4800ddbb3f..90609ea62a9 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -55,7 +55,7 @@ #include "mmap_h.h" #include "apr_portable.h" -#if HAVE_MMAP || defined(BEOS) +#if APR_HAVE_MMAP || defined(BEOS) static ap_status_t mmap_cleanup(void *themmap) { diff --git a/mmap/unix/mmap_h.h b/mmap/unix/mmap_h.h index 7cb71b851f6..394ff1bfbe2 100644 --- a/mmap/unix/mmap_h.h +++ b/mmap/unix/mmap_h.h @@ -55,6 +55,7 @@ #ifndef MMAP_H_H #define MMAP_H_H +#include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_mmap.h" @@ -69,7 +70,7 @@ #if HAVE_STRING_H #include #endif -#if HAVE_STDIO_H +#if APR_HAVE_STDIO_H #include #endif #if HAVE_SYS_STAT_H diff --git a/network_io/unix/networkio.h b/network_io/unix/networkio.h index ad51736873e..6dccfaad8cc 100644 --- a/network_io/unix/networkio.h +++ b/network_io/unix/networkio.h @@ -55,6 +55,7 @@ #ifndef NETWORK_IO_H #define NETWORK_IO_H +#include "apr.h" #include "apr_private.h" #include "apr_network_io.h" #include "apr_errno.h" @@ -62,16 +63,16 @@ #include "apr_lib.h" /* System headers the network I/O library needs */ -#if HAVE_SYS_TYPES_H +#if APR_HAVE_SYS_TYPES_H #include #endif -#if HAVE_SYS_UIO_H +#if APR_HAVE_SYS_UIO_H #include #endif #if HAVE_POLL_H #include #endif -#if HAVE_ERRNO_H +#if APR_HAVE_ERRNO_H #include #endif #if HAVE_SYS_TIME_H @@ -98,7 +99,7 @@ #if HAVE_NETDB_H #include #endif -#if HAVE_FCNTL_H +#if APR_HAVE_FCNTL_H #include #endif #if HAVE_SYS_SENDFILE_H diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 3fb33a5498f..e96b1b11139 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -65,7 +65,7 @@ #define READ(x,y,z) read(x,y,z) #endif -#if defined(HAVE_SENDFILE) || defined(HAVE_SEND_FILE) +#if APR_HAVE_SENDFILE /* This file is needed to allow us access to the ap_file_t internals. */ #include "../../file_io/unix/fileio.h" @@ -76,7 +76,7 @@ #define TCP_CORK 3 #endif -#endif /* HAVE_SENDFILE || HAVE_SEND_FILE */ +#endif /* APR_HAVE_SENDFILE */ static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) { @@ -204,7 +204,7 @@ ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, } #endif -#if defined(HAVE_SENDFILE) || defined(HAVE_SEND_FILE) +#if APR_HAVE_SENDFILE /* TODO: Verify that all platforms handle the fd the same way * (i.e. not moving current file pointer) @@ -555,4 +555,4 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, return APR_SUCCESS; } #endif /* __linux__, __FreeBSD__, __HPUX__, _AIX */ -#endif /* HAVE_SENDFILE */ +#endif /* APR_HAVE_SENDFILE */ diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index a95fa8f0333..0a67769a2f4 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -144,7 +144,7 @@ ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) -#if HAVE_NETINET_IN_H +#if APR_HAVE_NETINET_IN_H ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock) { *name = sock->local_addr; diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 06230bf247e..57019ba0a49 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -133,7 +133,7 @@ ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, *nbytes = dwBytes; return APR_SUCCESS; } -#if defined(HAVE_SENDFILE) +#if APR_HAVE_SENDFILE /* * ap_status_t ap_sendfile(ap_socket_t *, ap_file_t *, ap_hdtr_t *, * ap_off_t *, ap_size_t *, ap_int32_t flags) diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index ca2cdff962c..09e49106451 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -52,12 +52,13 @@ * . */ -#include "threadproc.h" +#include "apr.h" #include "apr_portable.h" +#include "threadproc.h" #if APR_HAS_THREADS -#ifdef HAVE_PTHREAD_H +#ifdef APR_HAVE_PTHREAD_H ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) { ap_status_t stat; diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 95ca7c7bed2..3d083835c8c 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -52,12 +52,13 @@ * . */ -#include "threadproc.h" +#include "apr.h" #include "apr_portable.h" +#include "threadproc.h" #if APR_HAS_THREADS -#ifdef HAVE_PTHREAD_H +#ifdef APR_HAVE_PTHREAD_H ap_status_t ap_create_thread_private(ap_threadkey_t **key, void (*dest)(void *), ap_pool_t *cont) { diff --git a/threadproc/unix/threadproc.h b/threadproc/unix/threadproc.h index 812dead632c..e6d9e36aa3f 100644 --- a/threadproc/unix/threadproc.h +++ b/threadproc/unix/threadproc.h @@ -52,25 +52,26 @@ * . */ +#include "apr.h" #include "apr_private.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #include "fileio.h" /* System headers required for thread/process library */ -#if HAVE_PTHREAD_H +#if APR_HAVE_PTHREAD_H #include #endif #if HAVE_SYS_RESOURCE_H #include #endif -#if HAVE_SIGNAL_H +#if APR_HAVE_SIGNAL_H #include #endif #if HAVE_STRING_H #include #endif -#if HAVE_SYS_WAIT_H +#if APR_HAVE_SYS_WAIT_H #include #endif #if HAVE_STRING_H From ee5b593d236e02b38832cfd7fe416d8135727231 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Thu, 22 Jun 2000 04:42:51 +0000 Subject: [PATCH 0265/7878] Win32: Handle ap_ungetchar in the posix way (can only issue it once). Also, ap_ungetc will work on buffered of unbuffered i/o. Bring ap_open more in-line with the Uni implementation. Next todo: timeouts for ap_read() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60240 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 50 ++++++++++++++++++++++++--------------- file_io/win32/pipe.c | 16 +++++++++++-- file_io/win32/readwrite.c | 42 ++++++++++++++++---------------- 3 files changed, 67 insertions(+), 41 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 222fd14bb86..ba3795cc583 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -74,7 +74,7 @@ ap_status_t file_cleanup(void *thefile) return APR_SUCCESS; } -ap_status_t ap_open(ap_file_t **dafile, const char *fname, +ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cont) { DWORD oflags = 0; @@ -84,9 +84,11 @@ ap_status_t ap_open(ap_file_t **dafile, const char *fname, ap_oslevel_e level; ap_status_t rv; - (*dafile) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); + if ((*new) == NULL) { + (*new) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); + } - (*dafile)->cntxt = cont; + (*new)->cntxt = cont; if (flag & APR_READ) { oflags |= GENERIC_READ; @@ -95,24 +97,24 @@ ap_status_t ap_open(ap_file_t **dafile, const char *fname, oflags |= GENERIC_WRITE; } if (!(flag & APR_READ) && !(flag & APR_WRITE)) { - (*dafile)->filehand = INVALID_HANDLE_VALUE; + (*new)->filehand = INVALID_HANDLE_VALUE; return APR_EACCES; } - (*dafile)->buffered = (flag & APR_BUFFERED) > 0; + (*new)->buffered = (flag & APR_BUFFERED) > 0; - if ((*dafile)->buffered) { - (*dafile)->buffer = ap_palloc(cont, APR_FILE_BUFSIZE); - rv = ap_create_lock(&(*dafile)->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cont); + if ((*new)->buffered) { + (*new)->buffer = ap_palloc(cont, APR_FILE_BUFSIZE); + rv = ap_create_lock(&(*new)->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cont); if (rv) return rv; } - (*dafile)->fname = ap_pstrdup(cont, fname); + (*new)->fname = ap_pstrdup(cont, fname); - (*dafile)->demonfname = canonical_filename((*dafile)->cntxt, fname); - (*dafile)->lowerdemonfname = strlwr((*dafile)->demonfname); + (*new)->demonfname = canonical_filename((*new)->cntxt, fname); + (*new)->lowerdemonfname = strlwr((*new)->demonfname); if (ap_get_oslevel(cont, &level) == APR_SUCCESS && level >= APR_WIN_NT) { sharemode |= FILE_SHARE_DELETE; @@ -138,15 +140,15 @@ ap_status_t ap_open(ap_file_t **dafile, const char *fname, } if ((flag & APR_EXCL) && !(flag & APR_CREATE)) { - (*dafile)->filehand = INVALID_HANDLE_VALUE; + (*new)->filehand = INVALID_HANDLE_VALUE; return APR_EACCES; } if (flag & APR_APPEND) { - (*dafile)->append = 1; + (*new)->append = 1; } else { - (*dafile)->append = 0; + (*new)->append = 0; } attributes = FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN; @@ -154,18 +156,28 @@ ap_status_t ap_open(ap_file_t **dafile, const char *fname, attributes |= FILE_FLAG_DELETE_ON_CLOSE; } - (*dafile)->filehand = CreateFile(fname, oflags, sharemode, + (*new)->filehand = CreateFile(fname, oflags, sharemode, NULL, createflags, attributes, 0); - if ((*dafile)->filehand == INVALID_HANDLE_VALUE) { + if ((*new)->filehand == INVALID_HANDLE_VALUE) { return GetLastError(); } if (flag & APR_APPEND) { - SetFilePointer((*dafile)->filehand, 0, NULL, FILE_END); + SetFilePointer((*new)->filehand, 0, NULL, FILE_END); } - (*dafile)->eof_hit = 0; - ap_register_cleanup((*dafile)->cntxt, (void *)(*dafile), file_cleanup, + (*new)->pipe = 0; + (*new)->timeout = -1; + (*new)->ungetchar = -1; + (*new)->eof_hit = 0; + + /* Buffered mode fields not initialized above */ + (*new)->bufpos = 0; + (*new)->dataRead = 0; + (*new)->direction = 0; + (*new)->filePtr = 0; + + ap_register_cleanup((*new)->cntxt, (void *)(*new), file_cleanup, ap_null_cleanup); return APR_SUCCESS; } diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 9420b143eac..55edc3b4332 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -116,15 +116,27 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*in) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); (*in)->cntxt = cont; - (*in)->pipe = 1; (*in)->fname = ap_pstrdup(cont, "PIPE"); + (*in)->pipe = 1; (*in)->timeout = -1; + (*in)->ungetchar = -1; + (*in)->eof_hit = 0; + (*in)->filePtr = 0; + (*in)->bufpos = 0; + (*in)->dataRead = 0; + (*in)->direction = 0; (*out) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); (*out)->cntxt = cont; - (*out)->pipe = 1; (*out)->fname = ap_pstrdup(cont, "PIPE"); + (*out)->pipe = 1; (*out)->timeout = -1; + (*out)->ungetchar = -1; + (*out)->eof_hit = 0; + (*out)->filePtr = 0; + (*out)->bufpos = 0; + (*out)->dataRead = 0; + (*out)->direction = 0; if (!CreatePipe(&(*in)->filehand, &(*out)->filehand, &sa, 0)) { return GetLastError(); diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index d691db9a0a9..e0d0422650d 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -60,18 +60,28 @@ #include #include "atime.h" -#define GetFilePointer(hfile) SetFilePointer(hfile,0,NULL, FILE_CURRENT) - ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) { - DWORD bread; - int rv; + ap_ssize_t rv; + DWORD bytes_read = 0; if (*nbytes <= 0) { *nbytes = 0; return APR_SUCCESS; } + /* Handle the ungetchar if there is one */ + if (thefile->ungetchar != -1) { + bytes_read = 1; + *(char *)buf = (char)thefile->ungetchar; + buf = (char *)buf + 1; + (*nbytes)--; + thefile->ungetchar = -1; + if (*nbytes == 0) { + *nbytes = bytes_read; + return APR_SUCCESS; + } + } if (thefile->buffered) { char *pos = (char *)buf; ap_ssize_t blocksize; @@ -90,7 +100,6 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) while (rv == 0 && size > 0) { if (thefile->bufpos >= thefile->dataRead) { rv = ReadFile(thefile->filehand, thefile->buffer, APR_FILE_BUFSIZE, &thefile->dataRead, NULL ) ? 0 : GetLastError(); - if (thefile->dataRead == 0) { if (rv == 0) { thefile->eof_hit = TRUE; @@ -115,10 +124,12 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) rv = 0; } ap_unlock(thefile->mutex); - } else { - if (ReadFile(thefile->filehand, buf, *nbytes, &bread, NULL)) { - *nbytes = bread; - if (bread) { + } else { + /* Unbuffered i/o */ + DWORD dwBytesRead; + if (ReadFile(thefile->filehand, buf, *nbytes, &dwBytesRead, NULL)) { + *nbytes = bytes_read + dwBytesRead; + if (*nbytes) { return APR_SUCCESS; } else { @@ -223,17 +234,8 @@ ap_status_t ap_putc(char ch, ap_file_t *thefile) ap_status_t ap_ungetc(char ch, ap_file_t *thefile) { - /* ungetc only makes sense when using buffered i/o */ - if (thefile->buffered) { - ap_lock(thefile->mutex); - if (thefile->bufpos > 0){ - thefile->bufpos--; - } - ap_unlock(thefile->mutex); - return APR_SUCCESS; - } - - return APR_ENOTIMPL; + thefile->ungetchar = (unsigned char) ch; + return APR_SUCCESS; } ap_status_t ap_getc(char *ch, ap_file_t *thefile) From 604a079b9a74ecdd1749192b10e68386534245a0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 22 Jun 2000 16:05:39 +0000 Subject: [PATCH 0266/7878] Cleanup yesterday's patch to make APR use APR namespace protected macros. This makes APR use #if instead of #ifdef when using an APR macro. Since APR has stated that it will be using #if always, this is at least a step in that direction. This also fixes a problem with building MMAP that I think I introduced yesterday. Submitted by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60241 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 4 ++-- file_io/win32/fileio.h | 4 ++-- include/arch/unix/misc.h | 6 +++--- include/arch/unix/mmap.c | 2 +- include/arch/win32/fileio.h | 4 ++-- include/arch/win32/misc.h | 6 +++--- lib/apr_pools.c | 8 ++++---- lib/apr_signal.c | 2 +- memory/unix/apr_pools.c | 8 ++++---- misc/unix/misc.h | 6 +++--- mmap/unix/common.c | 2 +- mmap/unix/mmap.c | 2 +- threadproc/unix/thread.c | 2 +- threadproc/unix/threadpriv.c | 2 +- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 066a96aecc1..d537c635b01 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -59,13 +59,13 @@ #include "apr_portable.h" #include "atime.h" -#ifdef APR_HAVE_ERRNO_H +#if APR_HAVE_ERRNO_H #include #endif #ifdef HAVE_STRING_H #include #endif -#ifdef APR_HAVE_DIRENT_H +#if APR_HAVE_DIRENT_H #include #endif #ifdef HAVE_SYS_STAT_H diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 90df1729e95..47fc910c986 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -63,7 +63,7 @@ #include "apr_file_io.h" #include "apr_errno.h" -#ifdef APR_HAVE_SYS_STAT_H +#if APR_HAVE_SYS_STAT_H #include #endif #ifdef HAVE_SYS_TYPES_H @@ -75,7 +75,7 @@ #ifdef HAVE_TIME_H #include #endif -#ifdef APR_HAVE_DIRENT_H +#if APR_HAVE_DIRENT_H #include #endif #ifdef HAVE_MALLOC_H diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index e4b10ee7e50..c659a4698fa 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -67,16 +67,16 @@ #ifdef HAVE_STDLIB_H #include #endif -#ifdef APR_HAVE_STDIO_H +#if APR_HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif -#ifdef APR_HAVE_SIGNAL_H +#if APR_HAVE_SIGNAL_H #include #endif -#ifdef APR_HAVE_PTHREAD_H +#if APR_HAVE_PTHREAD_H #include #endif #ifdef BEOS diff --git a/include/arch/unix/mmap.c b/include/arch/unix/mmap.c index 90609ea62a9..67116e2a33c 100644 --- a/include/arch/unix/mmap.c +++ b/include/arch/unix/mmap.c @@ -55,7 +55,7 @@ #include "mmap_h.h" #include "apr_portable.h" -#if APR_HAVE_MMAP || defined(BEOS) +#if APR_HAS_MMAP || defined(BEOS) static ap_status_t mmap_cleanup(void *themmap) { diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 90df1729e95..47fc910c986 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -63,7 +63,7 @@ #include "apr_file_io.h" #include "apr_errno.h" -#ifdef APR_HAVE_SYS_STAT_H +#if APR_HAVE_SYS_STAT_H #include #endif #ifdef HAVE_SYS_TYPES_H @@ -75,7 +75,7 @@ #ifdef HAVE_TIME_H #include #endif -#ifdef APR_HAVE_DIRENT_H +#if APR_HAVE_DIRENT_H #include #endif #ifdef HAVE_MALLOC_H diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index e4b10ee7e50..c659a4698fa 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -67,16 +67,16 @@ #ifdef HAVE_STDLIB_H #include #endif -#ifdef APR_HAVE_STDIO_H +#if APR_HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif -#ifdef APR_HAVE_SIGNAL_H +#if APR_HAVE_SIGNAL_H #include #endif -#ifdef APR_HAVE_PTHREAD_H +#if APR_HAVE_PTHREAD_H #include #endif #ifdef BEOS diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 89ebdf9da00..093b7802670 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -75,19 +75,19 @@ #ifdef HAVE_SYS_SIGNAL_H #include #endif -#ifdef APR_HAVE_SIGNAL_H +#if APR_HAVE_SIGNAL_H #include #endif -#ifdef APR_HAVE_SYS_WAIT_H +#if APR_HAVE_SYS_WAIT_H #include #endif -#ifdef APR_HAVE_SYS_TYPES_H +#if APR_HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_UNISTD_H #include #endif -#ifdef APR_HAVE_FCNTL_H +#if APR_HAVE_FCNTL_H #include #endif diff --git a/lib/apr_signal.c b/lib/apr_signal.c index 340a88bf45b..2285664cb4c 100644 --- a/lib/apr_signal.c +++ b/lib/apr_signal.c @@ -54,7 +54,7 @@ #include "apr_private.h" #include "apr_lib.h" -#ifdef APR_HAVE_SIGNAL_H +#if APR_HAVE_SIGNAL_H #include #endif diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 89ebdf9da00..093b7802670 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -75,19 +75,19 @@ #ifdef HAVE_SYS_SIGNAL_H #include #endif -#ifdef APR_HAVE_SIGNAL_H +#if APR_HAVE_SIGNAL_H #include #endif -#ifdef APR_HAVE_SYS_WAIT_H +#if APR_HAVE_SYS_WAIT_H #include #endif -#ifdef APR_HAVE_SYS_TYPES_H +#if APR_HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_UNISTD_H #include #endif -#ifdef APR_HAVE_FCNTL_H +#if APR_HAVE_FCNTL_H #include #endif diff --git a/misc/unix/misc.h b/misc/unix/misc.h index e4b10ee7e50..c659a4698fa 100644 --- a/misc/unix/misc.h +++ b/misc/unix/misc.h @@ -67,16 +67,16 @@ #ifdef HAVE_STDLIB_H #include #endif -#ifdef APR_HAVE_STDIO_H +#if APR_HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif -#ifdef APR_HAVE_SIGNAL_H +#if APR_HAVE_SIGNAL_H #include #endif -#ifdef APR_HAVE_PTHREAD_H +#if APR_HAVE_PTHREAD_H #include #endif #ifdef BEOS diff --git a/mmap/unix/common.c b/mmap/unix/common.c index 4e1ccfd13df..1d2db7a8cbf 100644 --- a/mmap/unix/common.c +++ b/mmap/unix/common.c @@ -63,7 +63,7 @@ #include "mmap_h.h" -#if APR_HAVE_MMAP || defined(BEOS) +#if APR_HAS_MMAP || defined(BEOS) ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_off_t offset) { diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 90609ea62a9..67116e2a33c 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -55,7 +55,7 @@ #include "mmap_h.h" #include "apr_portable.h" -#if APR_HAVE_MMAP || defined(BEOS) +#if APR_HAS_MMAP || defined(BEOS) static ap_status_t mmap_cleanup(void *themmap) { diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 09e49106451..97db69de38a 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -58,7 +58,7 @@ #if APR_HAS_THREADS -#ifdef APR_HAVE_PTHREAD_H +#if APR_HAVE_PTHREAD_H ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) { ap_status_t stat; diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 3d083835c8c..b783f9699a1 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -58,7 +58,7 @@ #if APR_HAS_THREADS -#ifdef APR_HAVE_PTHREAD_H +#if APR_HAVE_PTHREAD_H ap_status_t ap_create_thread_private(ap_threadkey_t **key, void (*dest)(void *), ap_pool_t *cont) { From 600edda0a5f969e2930d2fbfb710f65d91e91f3e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 22 Jun 2000 17:42:29 +0000 Subject: [PATCH 0267/7878] Implement retrieval of socket timeouts for Unix so that saferead() can restore the original timeout on exit. This is very similar to the Win32 implementation Bill Stoddard a week ago. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60242 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index e0d3c979640..a24df943fe3 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -172,6 +172,18 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) return APR_SUCCESS; } +ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) +{ + switch(opt) { + case APR_SO_TIMEOUT: + *on = sock->timeout; + break; + default: + return APR_EINVAL; + } + return APR_SUCCESS; +} + ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_pool_t *cont) { if (gethostname(buf, len) == -1) From c63fd190f6d8f0433f2786b0150a7c5e34779959 Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" Date: Thu, 22 Jun 2000 19:09:45 +0000 Subject: [PATCH 0268/7878] Get Win32 building with yesterday's patch to make APR use APR namespace protected macros. ------------------------------------------------------------ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60243 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- include/apr_network_io.h | 1 + include/apr_private.hw | 2 -- include/arch/win32/apr_private.h | 2 -- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 12aa8953c07..83beaa48451 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -144,7 +144,7 @@ /* APR Feature Macros */ #define APR_HAS_THREADS 1 -#define APR_HAS_SENDFILE 1 +#define APR_HAVE_SENDFILE 1 #define APR_HAS_RANDOM 1 #define APR_HAS_DSO 1 diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 99dd8435595..818d8581761 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -55,6 +55,7 @@ #ifndef APR_NETWORK_IO_H #define APR_NETWORK_IO_H +#include "apr_private.h" #include "apr_general.h" #include "apr_file_io.h" #include "apr_errno.h" diff --git a/include/apr_private.hw b/include/apr_private.hw index 9d4c033a55c..2dd9a0f0d6e 100644 --- a/include/apr_private.hw +++ b/include/apr_private.hw @@ -110,8 +110,6 @@ #include #include -#define HAVE_SENDFILE 1 - /* Use this section to define all of the HAVE_FOO_H * that are required to build properly. */ diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 9d4c033a55c..2dd9a0f0d6e 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -110,8 +110,6 @@ #include #include -#define HAVE_SENDFILE 1 - /* Use this section to define all of the HAVE_FOO_H * that are required to build properly. */ From fcdce5f823eb519b20483d5ea978ac70f8a87ca0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 22 Jun 2000 19:33:20 +0000 Subject: [PATCH 0269/7878] I accidentally renamed APR_HAS_SENDFILE to APR_HAVE_SENFILE yesterday. This patch changes it back on all platforms. This makes APR_HAS_SENDFILE look like the rest of the APR function feature macros. Sorry about the inadvertant change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60244 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- network_io/unix/sendrecv.c | 8 ++++---- network_io/win32/sendrecv.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 83beaa48451..2d95f748a5a 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -144,7 +144,7 @@ /* APR Feature Macros */ #define APR_HAS_THREADS 1 -#define APR_HAVE_SENDFILE 1 +#define APR_HAS_SENDFILE 1 #define APR_HAS_RANDOM 1 #define APR_HAS_DSO 1 diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index e96b1b11139..b2b491a0941 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -65,7 +65,7 @@ #define READ(x,y,z) read(x,y,z) #endif -#if APR_HAVE_SENDFILE +#if APR_HAS_SENDFILE /* This file is needed to allow us access to the ap_file_t internals. */ #include "../../file_io/unix/fileio.h" @@ -76,7 +76,7 @@ #define TCP_CORK 3 #endif -#endif /* APR_HAVE_SENDFILE */ +#endif /* APR_HAS_SENDFILE */ static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) { @@ -204,7 +204,7 @@ ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, } #endif -#if APR_HAVE_SENDFILE +#if APR_HAS_SENDFILE /* TODO: Verify that all platforms handle the fd the same way * (i.e. not moving current file pointer) @@ -555,4 +555,4 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, return APR_SUCCESS; } #endif /* __linux__, __FreeBSD__, __HPUX__, _AIX */ -#endif /* APR_HAVE_SENDFILE */ +#endif /* APR_HAS_SENDFILE */ diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 57019ba0a49..cf44b06b747 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -133,7 +133,7 @@ ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, *nbytes = dwBytes; return APR_SUCCESS; } -#if APR_HAVE_SENDFILE +#if APR_HAS_SENDFILE /* * ap_status_t ap_sendfile(ap_socket_t *, ap_file_t *, ap_hdtr_t *, * ap_off_t *, ap_size_t *, ap_int32_t flags) From f6fd617137ebdcb65a96c8a995a3d93dee3e9952 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 22 Jun 2000 22:43:27 +0000 Subject: [PATCH 0270/7878] Fix the OS/390 build. Submitted by: Greg Ames git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60245 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 1b32f7d9b49..d0abcbe4cba 100644 --- a/configure.in +++ b/configure.in @@ -459,7 +459,7 @@ else fi fi -if test "$pthreads" = "1"; then +if test "$pthreadh" = "1"; then APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG fi From e2090b9029febba8c69c26ee72be26050f8fb6c5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 23 Jun 2000 11:38:09 +0000 Subject: [PATCH 0271/7878] This change to the current state of CVS is supposed to fix a problem introduced when pipes were made blocking by default as well as makes it work a little faster when pipes are blocking. It also fixes a glitch where setting pipe timeout to an invalid negative value returned APR_SUCCESS. We leave the pipe blocking after ap_create(), but it is non-blocking during the DosConnectNPipe() call. The pipe is set non-blocking if ap_set_pipe_timeout() is called with timeout >= 0. The pipe is set blocking if called with timeout -1. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60246 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/pipe.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 9ee856d1c75..6b5556974dc 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -68,7 +68,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) char pipename[50]; sprintf(pipename, "/pipe/%d.%d", getpid(), id++); - rc = DosCreateNPipe(pipename, filedes, NP_ACCESS_INBOUND, 1, 4096, 4096, 0); + rc = DosCreateNPipe(pipename, filedes, NP_ACCESS_INBOUND, NP_NOWAIT|1, 4096, 4096, 0); if (rc) return APR_OS2_STATUS(rc); @@ -101,6 +101,10 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) rc = DosSetNPipeSem(filedes[0], (HSEM)(*in)->pipeSem, 1); + if (!rc) { + rc = DosSetNPHState(filedes[0], NP_WAIT) + } + if (rc) { DosClose(filedes[0]); DosClose(filedes[1]); @@ -146,13 +150,12 @@ ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; - if (thepipe->timeout == 0) { + if (thepipe->timeout >= 0) { return APR_OS2_STATUS(DosSetNPHState (thepipe->filedes, NP_NOWAIT)); } else if (thepipe->timeout == -1) { return APR_OS2_STATUS(DosSetNPHState (thepipe->filedes, NP_WAIT)); } - return APR_SUCCESS; } return APR_EINVAL; } From 4f0dd92c2b46c9d3a6d40323e225f76dc8fc0e02 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 23 Jun 2000 12:24:35 +0000 Subject: [PATCH 0272/7878] FreeBSD's needs explicitly included first. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60247 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index d0abcbe4cba..0e8f89cf877 100644 --- a/configure.in +++ b/configure.in @@ -626,6 +626,7 @@ dnl #----------------------------- Checking for Networking Support echo $ac_n "${nl}Checking for Networking support...${nl}" AC_MSG_CHECKING(looking for in_addr in netinet/in.h) AC_TRY_COMPILE([ +#include #include ],[ struct in_addr arg; From c71fd311ef9e737e21314eba9a89cdf4a95f600e Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 23 Jun 2000 16:00:44 +0000 Subject: [PATCH 0273/7878] Properly detect the existance of send_file() on AIX Submitted by: Victor Orlikowski Reviewed by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60248 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 0e8f89cf877..a1e181991cc 100644 --- a/configure.in +++ b/configure.in @@ -201,7 +201,7 @@ dnl Checks for library functions. (N.B. poll is further down) AC_CHECK_FUNCS(strcasecmp stricmp setsid nl_langinfo) AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) AC_CHECK_FUNCS(writev) -AC_CHECK_FUNCS(sendfile, [ sendfile="1" ], [ sendfile="0" ]) +AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ], [ sendfile="0" ]) AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ]) AC_CHECK_FUNCS(getpass) AC_CHECK_FUNC(inet_addr, [ inet_addr="1" ], [ inet_addr="0" ]) From 3d3c80f033fbb4e5d0d7c230f9440dab028084d2 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 23 Jun 2000 17:14:38 +0000 Subject: [PATCH 0274/7878] More AIX ap_sendfile() clean-up. Use ap_alloc rather than malloc to allocate storage for the headers. This will not cause us too much of a problem in practice for HTTP I think since keep alive connections do not tend to stay up long. OTOH, some benchmarking clients may keep a connection up for the duration of a test run. In this case, need to configure Apache to kill the connection after, say, 100 connections on the outside. Left the malloc code in but #if'ed out in case we want to change it back... Submitted by: Victor Orlikowski (with some munging by Bill) Reviewed by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60249 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index b2b491a0941..014ffabded2 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -463,8 +463,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, ap_status_t arv; struct sf_parms parms; - /* AIX can also send the headers/footers as part of the system call - ... badly.*/ + /* AIX can also send the headers/footers as part of the system call */ parms.header_length = 0; if (hdtr && hdtr->numheaders) { if (hdtr->numheaders == 1) { @@ -475,8 +474,15 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, for (i = 0; i < hdtr->numheaders; i++) { parms.header_length += hdtr->headers[i].iov_len; } +#if 0 /* Keepalives make ap_palloc a bad idea */ hbuf = malloc(parms.header_length); +#else + /* but headers are small, so maybe we can hold on to the + * memory for the life of the socket... + */ + hbuf = ap_palloc(sock->cntxt, parms.header_length); +#endif ptr = 0; for (i = 0; i < hdtr->numheaders; i++) { memcpy(hbuf + ptr, hdtr->headers[i].iov_base, @@ -497,8 +503,12 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, for (i = 0; i < hdtr->numtrailers; i++) { parms.trailer_length += hdtr->trailers[i].iov_len; } +#if 0 /* Keepalives make ap_palloc a bad idea */ tbuf = malloc(parms.trailer_length); +#else + tbuf = ap_palloc(sock->cntxt, parms.trailer_length); +#endif ptr = 0; for (i = 0; i < hdtr->numtrailers; i++) { memcpy(tbuf + ptr, hdtr->trailers[i].iov_base, @@ -521,8 +531,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, do { rv = send_file(&(sock->socketdes), /* socket */ &(parms), /* all data */ - flags /* flags */ - ); + flags); /* flags */ } while (rv == -1 && errno == EINTR); if (rv == -1 && @@ -537,22 +546,24 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, do { rv = send_file(&(sock->socketdes), /* socket */ &(parms), /* all data */ - flags /* flags */ - ); + flags); /* flags */ } while (rv == -1 && errno == EINTR); } } (*len) = parms.bytes_sent; +#if 0 /* Clean up after ourselves */ if(hbuf) free(hbuf); if(tbuf) free(tbuf); +#endif if (rv == -1) { return errno; } return APR_SUCCESS; } +#else #endif /* __linux__, __FreeBSD__, __HPUX__, _AIX */ #endif /* APR_HAS_SENDFILE */ From 752a15b8bba01daa19fe6c188cc42ca64fb453ef Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 23 Jun 2000 18:02:29 +0000 Subject: [PATCH 0275/7878] gcc issues warnings when parsing AIX 4.3.3's pthread.h which causes autoconf to incorrectly conclude that pthreads is not available. Turn off warnings for this check if we're using gcc. Submitted by: Victor Orlikowski Reviewed by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60250 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 ++++----- threads.m4 | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index a1e181991cc..3b5d6dd7a7b 100644 --- a/configure.in +++ b/configure.in @@ -422,9 +422,8 @@ AC_CACHE_CHECK([for threads], ac_cv_enable_threads, [ AC_ARG_ENABLE(threads, [ --enable-threads Enable threading support in APR.], [ ac_cv_enable_threads=$enableval] , - [ AC_CHECK_HEADERS(pthread.h, - [ ac_cv_enable_threads="pthread" ] , - [ ac_cv_enable_threads="no" ] ) ] ) ] ) + [ CHECK_PTHREADS_H([ ac_cv_enable_threads="pthread" ] , + [ ac_cv_enable_threads="no" ] ) ] ) ] ) if test "$ac_cv_enable_threads" = "no"; then echo "Don't enable threads" @@ -436,7 +435,7 @@ else # We have specified pthreads for our threading library, just make sure # that we have everything we need PTHREADS_CHECK - AC_CHECK_HEADERS(pthread.h, [ + CHECK_PTHREADS_H([ threads="1" pthreadh="1" AC_DEFINE(USE_THREADS) ], [ @@ -450,7 +449,7 @@ else # them. In this case, just look for pthreads. In the future, we can check # for other threading libraries as well. PTHREADS_CHECK - AC_CHECK_HEADERS(pthread.h, [ + CHECK_PTHREADS_H([ threads="1" pthreadh="1" AC_DEFINE(USE_THREADS) ], [ diff --git a/threads.m4 b/threads.m4 index e308a12659d..97e8b99ae1c 100644 --- a/threads.m4 +++ b/threads.m4 @@ -34,6 +34,21 @@ dnl PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 fi ])dnl +dnl gcc issues warnings when parsing AIX 4.3.3's pthread.h +dnl which causes autoconf to incorrectly conclude that +dnl pthreads is not available. +dnl Turn off warnings if we're using gcc. +AC_DEFUN(CHECK_PTHREADS_H, [ + if test "$GCC" = "yes"; then + SAVE_FL="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -w" + AC_CHECK_HEADERS(pthread.h, [ $1 ] , [ $2 ] ) + CPPFLAGS="$SAVE_FL" + else + AC_CHECK_HEADERS(pthread.h, [ $1 ] , [ $2 ] ) + fi +])dnl + AC_DEFUN(APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS, [ AC_CACHE_CHECK(whether pthread_getspecific takes two arguments, ac_cv_pthread_getspecific_two_args,[ AC_TRY_COMPILE([ From 718db2519074e3237c76f589f86a31539af18e9c Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 25 Jun 2000 08:19:24 +0000 Subject: [PATCH 0276/7878] Fix a missing ; git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60251 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 6b5556974dc..8c4482188d9 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -102,7 +102,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) rc = DosSetNPipeSem(filedes[0], (HSEM)(*in)->pipeSem, 1); if (!rc) { - rc = DosSetNPHState(filedes[0], NP_WAIT) + rc = DosSetNPHState(filedes[0], NP_WAIT); } if (rc) { From 38c4c99b23a9928b6b84f858686b93a08984ed6b Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 25 Jun 2000 22:48:18 +0000 Subject: [PATCH 0277/7878] allocate *res_handle before setting (*res_handle)->errormsg git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60252 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 6f09a01126e..8892a7dff4d 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -72,6 +72,8 @@ ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, void *os_handle = dlopen(path, RTLD_NOW | RTLD_GLOBAL); #endif + *res_handle = ap_pcalloc(ctx, sizeof(**res_handle)); + if(os_handle == NULL) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) (*res_handle)->errormsg = strerror(errno); @@ -82,7 +84,6 @@ ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, #endif } - *res_handle = ap_pcalloc(ctx, sizeof(**res_handle)); (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; (*res_handle)->errormsg = NULL; From b9760ae39bb7bce622a740bf7797b6d5a7ef6f7c Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 26 Jun 2000 00:05:13 +0000 Subject: [PATCH 0278/7878] This takes car of setting the variables for BONE to allow itto build without a having to rerun configure for APR. Hopefully this will go away once BONE moves from beta. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60253 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hints.m4 b/hints.m4 index 8719c8eecaf..7c11e021173 100644 --- a/hints.m4 +++ b/hints.m4 @@ -341,9 +341,17 @@ dnl ;; APR_SETIFNULL(OPTIM, [-O]) APR_SETIFNULL(MAKE, [make]) ;; - *-beos*) + *beos*) APR_SETIFNULL(CFLAGS, [-DBEOS]) - APR_SETIFNULL(file_as_socket, [0]) + APR_SETIFNULL(file_as_socket, [0]) + PLATOSVERS=`uname -r` + echo $PLATOSVERS + case $PLATOSVERS in + 5.1) + APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) + APR_ADDTO(LDFLAGS, [-nodefaultlibs -L/boot/develop/lib/x86 -L/boot/beos/system/lib -lbind -lsocket -lbe -lroot]) + ;; + esac ;; 4850-*.*) APR_SETIFNULL(CFLAGS, [-DSVR4 -DMPRAS]) From c7d03057c0b472324a53fffaf426f3b61784dd94 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 26 Jun 2000 13:18:02 +0000 Subject: [PATCH 0279/7878] Add a header file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60254 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/inet_aton.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/beos/inet_aton.c b/network_io/beos/inet_aton.c index 7b4103e06b5..2c955608c1c 100644 --- a/network_io/beos/inet_aton.c +++ b/network_io/beos/inet_aton.c @@ -72,6 +72,7 @@ #if BEOS_R5 /* this isn't needed for BONE */ #include "networkio.h" +#include /* BeOS doesn't yet have it's own inet_aton and Bind won't be ported * until R5, so this is from a Bind 8 distribution. It's currently untested. From d5193316b033d45d1c8ec21cd1e27b3e1f8d7421 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 26 Jun 2000 13:18:57 +0000 Subject: [PATCH 0280/7878] Tidy up a definition to stop a warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60255 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/threadproc.h | 2 +- threadproc/beos/threadproc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h index 2af13722578..4cb9c31e03f 100644 --- a/include/arch/beos/threadproc.h +++ b/include/arch/beos/threadproc.h @@ -106,7 +106,7 @@ struct beos_key { int count; sem_id lock; int32 ben_lock; - void (* destructor) (); + void (* destructor) (void *); }; struct ap_procattr_t { diff --git a/threadproc/beos/threadproc.h b/threadproc/beos/threadproc.h index 2af13722578..4cb9c31e03f 100644 --- a/threadproc/beos/threadproc.h +++ b/threadproc/beos/threadproc.h @@ -106,7 +106,7 @@ struct beos_key { int count; sem_id lock; int32 ben_lock; - void (* destructor) (); + void (* destructor) (void *); }; struct ap_procattr_t { From 54d14e6d2543abedd0cc6108639dcb6e9ebcc45e Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 26 Jun 2000 13:23:27 +0000 Subject: [PATCH 0281/7878] Adjust the extra libraries in hints.m4 to prevent a crash due to library ordering. Also add an extra check to configure.in to allow thread support to be correctly set for BeOS and OS/2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60256 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++++ hints.m4 | 18 +++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index 3b5d6dd7a7b..9464c0260ef 100644 --- a/configure.in +++ b/configure.in @@ -110,6 +110,10 @@ case "$OS" in ;; esac +if test $enable_apr_threads="system_threads"; then + ac_cv_enable_threads="yes" +fi + dnl #----------------------------- Checking for Shared Memory Support echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" diff --git a/hints.m4 b/hints.m4 index 7c11e021173..b03f56f3019 100644 --- a/hints.m4 +++ b/hints.m4 @@ -343,15 +343,15 @@ dnl ;; ;; *beos*) APR_SETIFNULL(CFLAGS, [-DBEOS]) - APR_SETIFNULL(file_as_socket, [0]) - PLATOSVERS=`uname -r` - echo $PLATOSVERS - case $PLATOSVERS in - 5.1) - APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) - APR_ADDTO(LDFLAGS, [-nodefaultlibs -L/boot/develop/lib/x86 -L/boot/beos/system/lib -lbind -lsocket -lbe -lroot]) - ;; - esac + APR_SETIFNULL(file_as_socket, [0]) + PLATOSVERS=`uname -r` + case $PLATOSVERS in + 5.1) + APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) + APR_ADDTO(LDFLAGS, [-nodefaultlibs -L/boot/develop/lib/x86 -L/boot/beos/system/lib]) + APR_SETIFNULL(EXTRA_LIBS, [-lbind -lsocket -lbe -lroot]) + ;; + esac ;; 4850-*.*) APR_SETIFNULL(CFLAGS, [-DSVR4 -DMPRAS]) From edc3ffafef2e368e6665fa12d90e0db18a57627b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 26 Jun 2000 17:19:18 +0000 Subject: [PATCH 0282/7878] Repair the logic to detect whether we have sendfile support. After the previous change, only send_file was supported. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60257 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 9464c0260ef..cf674894666 100644 --- a/configure.in +++ b/configure.in @@ -205,7 +205,8 @@ dnl Checks for library functions. (N.B. poll is further down) AC_CHECK_FUNCS(strcasecmp stricmp setsid nl_langinfo) AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) AC_CHECK_FUNCS(writev) -AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ], [ sendfile="0" ]) +sendfile="0" +AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ]) AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ]) AC_CHECK_FUNCS(getpass) AC_CHECK_FUNC(inet_addr, [ inet_addr="1" ], [ inet_addr="0" ]) From 8b3e07eadf750460f7c9a39bce576f7a8473ae51 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 26 Jun 2000 19:54:39 +0000 Subject: [PATCH 0283/7878] Fix some shell logic in a recent commit which caused APR thread support to be inadvertently enabled in some Unix configurations (like prefork). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60258 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index cf674894666..c8a00d74fda 100644 --- a/configure.in +++ b/configure.in @@ -110,8 +110,8 @@ case "$OS" in ;; esac -if test $enable_apr_threads="system_threads"; then - ac_cv_enable_threads="yes" +if test "$enable_apr_threads" = "system_threads"; then + ac_cv_enable_threads="yes" fi dnl #----------------------------- Checking for Shared Memory Support From cab39bcab8a898c525f7f6ee16f0fcf9beed495e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 26 Jun 2000 20:14:34 +0000 Subject: [PATCH 0284/7878] Add a test driver for ap_sendfile(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60259 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 5 + test/testsf.c | 462 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 467 insertions(+) create mode 100644 test/testsf.c diff --git a/test/Makefile.in b/test/Makefile.in index b69fb82f076..55820a8ed05 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -17,6 +17,7 @@ TARGETS= testmd5@EXEEXT@ \ testfile@EXEEXT@ \ testproc@EXEEXT@ \ testsock@EXEEXT@ \ + testsf@EXEEXT@ \ testthread@EXEEXT@ \ testtime@EXEEXT@ \ testargs@EXEEXT@ \ @@ -33,6 +34,7 @@ OBJS= testmd5.o \ testfile.o \ testproc.o \ testsock.o \ + testsf.o \ testthread.o \ testtime.o \ testargs.o \ @@ -83,6 +85,9 @@ testsock@EXEEXT@: testsock.o client.o server.o $(CC) $(CFLAGS) -o server@EXEEXT@ server.o $(LDFLAGS) $(CC) $(CFLAGS) -o client@EXEEXT@ client.o $(LDFLAGS) +testsf@EXEEXT@: testsf.o + $(CC) $(CFLAGS) -o testsf@EXEEXT@ testsf.o $(LDFLAGS) + testtime@EXEEXT@: testtime.o $(CC) $(CFLAGS) -o testtime@EXEEXT@ testtime.o $(LDFLAGS) diff --git a/test/testsf.c b/test/testsf.c new file mode 100644 index 00000000000..ef967b80df7 --- /dev/null +++ b/test/testsf.c @@ -0,0 +1,462 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include +#include +#include +#include +#include "apr_network_io.h" +#include "apr_errno.h" +#include "apr_general.h" + +#if !APR_HAS_SENDFILE +int main(void) +{ + fprintf(stderr, + "This program won't work on this platform because there is no " + "support for sendfile().\n"); + return 0; +} +#else /* !APR_HAS_SENDFILE */ + +#define FILE_LENGTH 100000 + +#define HDR1 "First header\n" +#define HDR2 "Last header\n" +#define TRL1 "First trailer\n" +#define TRL2 "Last trailer\n" + +#define TESTSF_PORT 8021 + +#define TESTFILE "testsf.dat" + +static void apr_setup(ap_pool_t **p, ap_socket_t **sock) +{ + char buf[120]; + ap_status_t rv; + + rv = ap_initialize(); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_initialize()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + atexit(ap_terminate); + + rv = ap_create_pool(p, NULL); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_create_pool()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + *sock = NULL; + rv = ap_create_tcp_socket(sock, *p); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_create_tcp_socket()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } +} + +static void create_testfile(ap_pool_t *p, const char *fname) +{ + ap_file_t *f = NULL; + ap_status_t rv; + char buf[120]; + int i; + ap_ssize_t nbytes; + + rv = ap_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); + if (rv) { + fprintf(stderr, "ap_open()->%d/%s\n", + rv, ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + for (i = 0; i < FILE_LENGTH; i++) { + nbytes = 1; + rv = ap_write(f, "0", &nbytes); + if (rv) { + fprintf(stderr, "ap_write()->%d/%s\n", + rv, ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + } + + rv = ap_close(f); + if (rv) { + fprintf(stderr, "ap_close()->%d/%s\n", + rv, ap_strerror(rv, buf, sizeof buf)); + exit(1); + } +} + +static int client(int blocking) +{ + ap_status_t rv; + ap_socket_t *sock; + ap_pool_t *p; + char buf[120]; + ap_file_t *f = NULL; + ap_size_t len; + ap_off_t offset; + ap_hdtr_t hdtr; + struct iovec headers[2]; + struct iovec trailers[2]; + ap_ssize_t bytes_read; + + apr_setup(&p, &sock); + create_testfile(p, TESTFILE); + + rv = ap_open(&f, TESTFILE, APR_READ, 0, p); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_open()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + rv = ap_set_remote_port(sock, TESTSF_PORT); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_set_remote_port()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + rv = ap_connect(sock, "127.0.0.1"); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_connect()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + if (!blocking) { + rv = ap_setsocketopt(sock, APR_SO_NONBLOCK, 1); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_setsocketopt(APR_SO_NONBLOCK)->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + } + + hdtr.headers = headers; + hdtr.numheaders = 2; + hdtr.headers[0].iov_base = HDR1; + hdtr.headers[0].iov_len = strlen(hdtr.headers[0].iov_base); + hdtr.headers[1].iov_base = HDR2; + hdtr.headers[1].iov_len = strlen(hdtr.headers[1].iov_base); + + hdtr.trailers = trailers; + hdtr.numtrailers = 2; + hdtr.trailers[0].iov_base = TRL1; + hdtr.trailers[0].iov_len = strlen(hdtr.trailers[0].iov_base); + hdtr.trailers[1].iov_base = TRL2; + hdtr.trailers[1].iov_len = strlen(hdtr.trailers[1].iov_base); + + offset = 0; + len = FILE_LENGTH; + rv = ap_sendfile(sock, f, &hdtr, &offset, &len, 0); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_sendfile()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + printf("ap_sendfile() updated len with %ld\n", + (long int)len); + + rv = ap_shutdown(sock, APR_SHUTDOWN_WRITE); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_shutdown()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + bytes_read = 1; + rv = ap_recv(sock, buf, &bytes_read); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_recv()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + if (bytes_read != 0) { + fprintf(stderr, "We expected the EOF condition on the connected\n" + "socket but instead we read %ld bytes.\n", + (long int)bytes_read); + exit(1); + } + + printf("client: ap_sendfile() worked as expected!\n"); + + rv = ap_remove_file(TESTFILE, p); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_remove_file()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + return 0; +} + +static int server(void) +{ + ap_status_t rv; + ap_socket_t *sock; + ap_pool_t *p; + char buf[120]; + int i; + ap_socket_t *newsock = NULL; + ap_ssize_t bytes_read; + + apr_setup(&p, &sock); + + rv = ap_set_local_port(sock, TESTSF_PORT); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_set_local_port()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + rv = ap_setsocketopt(sock, APR_SO_REUSEADDR, 1); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_setsocketopt()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + rv = ap_bind(sock); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_bind()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + rv = ap_listen(sock, 5); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_listen()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + printf("Waiting for a client to connect...\n"); + + rv = ap_accept(&newsock, sock, p); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_accept()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + assert(sizeof buf > strlen(HDR1)); + bytes_read = strlen(HDR1); + rv = ap_recv(newsock, buf, &bytes_read); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_recv()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + if (bytes_read != strlen(HDR1)) { + fprintf(stderr, "wrong data read (1)\n"); + exit(1); + } + if (memcmp(buf, HDR1, strlen(HDR1))) { + fprintf(stderr, "wrong data read (2)\n"); + fprintf(stderr, "received: `%.*s'\nexpected: `%s'\n", + bytes_read, buf, HDR1); + exit(1); + } + + assert(sizeof buf > strlen(HDR2)); + bytes_read = strlen(HDR2); + rv = ap_recv(newsock, buf, &bytes_read); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_recv()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + if (bytes_read != strlen(HDR2)) { + fprintf(stderr, "wrong data read (3)\n"); + exit(1); + } + if (memcmp(buf, HDR2, strlen(HDR2))) { + fprintf(stderr, "wrong data read (4)\n"); + fprintf(stderr, "received: `%.*s'\nexpected: `%s'\n", + bytes_read, buf, HDR2); + exit(1); + } + + for (i = 0; i < FILE_LENGTH; i++) { + bytes_read = 1; + rv = ap_recv(newsock, buf, &bytes_read); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_recv()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + if (bytes_read != 1) { + fprintf(stderr, "ap_recv()->%ld bytes instead of 1\n", + (long int)bytes_read); + exit(1); + } + } + + assert(sizeof buf > strlen(TRL1)); + bytes_read = strlen(TRL1); + rv = ap_recv(newsock, buf, &bytes_read); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_recv()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + if (bytes_read != strlen(TRL1)) { + fprintf(stderr, "wrong data read (5)\n"); + exit(1); + } + if (memcmp(buf, TRL1, strlen(TRL1))) { + fprintf(stderr, "wrong data read (6)\n"); + fprintf(stderr, "received: `%.*s'\nexpected: `%s'\n", + bytes_read, buf, TRL1); + exit(1); + } + + assert(sizeof buf > strlen(TRL2)); + bytes_read = strlen(TRL2); + rv = ap_recv(newsock, buf, &bytes_read); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_recv()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + if (bytes_read != strlen(TRL2)) { + fprintf(stderr, "wrong data read (7)\n"); + exit(1); + } + if (memcmp(buf, TRL2, strlen(TRL2))) { + fprintf(stderr, "wrong data read (8)\n"); + fprintf(stderr, "received: `%.*s'\nexpected: `%s'\n", + bytes_read, buf, TRL2); + exit(1); + } + + bytes_read = 1; + rv = ap_recv(newsock, buf, &bytes_read); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_recv()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + if (bytes_read != 0) { + fprintf(stderr, "We expected the EOF condition on the connected\n" + "socket but instead we read %ld bytes.\n", + (long int)bytes_read); + exit(1); + } + + printf("server: ap_sendfile() worked as expected!\n"); + + return 0; +} + +int main(int argc, char *argv[]) +{ +#ifdef SIGPIPE + signal(SIGPIPE, SIG_IGN); +#endif + + /* Gee whiz this is goofy logic but I wanna drive sendfile right now, + * not dork around with the command line! + */ + if (argc == 3 && !strcmp(argv[1], "client")) { + if (!strcmp(argv[2], "blocking")) { + return client(1); + } + else if (!strcmp(argv[2], "nonblocking")) { + return client(0); + } + } + else if (argc == 2 && !strcmp(argv[1], "server")) { + return server(); + } + + fprintf(stderr, + "Usage: %s client {blocking|nonblocking}\n" + " %s server\n", + argv[0], argv[0]); + return -1; +} + +#endif /* !APR_HAS_SENDFILE */ From 963a4bb5d4dcd7792ec1bd60cb87a9d9e06f69c2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 26 Jun 2000 20:37:46 +0000 Subject: [PATCH 0285/7878] Remove const from ap_socket_t parameters on APR functions so that APR can modify the ap_socket_t as it sees fit. It may choose to modify the ap_socket_t on functions which only read from the ap_socket_t conceptually. Note: http_connection::ap_new_apr_connection() passes its ap_socket_t arg to one of the changed functions, so const was removed there also. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60260 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 18 +++++++++--------- network_io/beos/sockaddr.c | 10 +++++----- network_io/beos/sockets.c | 4 ++-- network_io/os2/sockets.c | 2 +- network_io/unix/sockaddr.c | 8 ++++---- network_io/unix/sockets.c | 2 +- network_io/win32/sockaddr.c | 8 ++++---- network_io/win32/sockets.c | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 818d8581761..ae3696db3c0 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -226,7 +226,7 @@ B =cut */ -ap_status_t ap_accept(ap_socket_t **new_sock, const ap_socket_t *sock, +ap_status_t ap_accept(ap_socket_t **new_sock, ap_socket_t *sock, ap_pool_t *connection_pool); /* @@ -540,7 +540,7 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr); /* -=head1 ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) +=head1 ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock) B @@ -549,11 +549,11 @@ B =cut */ -ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock); +ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock); /* -=head1 ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) +=head1 ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock) B @@ -562,11 +562,11 @@ B =cut */ -ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock); +ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock); /* -=head1 ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock) +=head1 ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) B @@ -575,11 +575,11 @@ B =cut */ -ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock); +ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock); /* -=head1 ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *sock) +=head1 ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock) B @@ -588,7 +588,7 @@ B =cut */ -ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *sock); +ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock); /* diff --git a/network_io/beos/sockaddr.c b/network_io/beos/sockaddr.c index 17bcb4b1998..57ce8343dce 100644 --- a/network_io/beos/sockaddr.c +++ b/network_io/beos/sockaddr.c @@ -140,7 +140,7 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) return APR_SUCCESS; } -ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) +ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -150,7 +150,7 @@ ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) +ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -161,7 +161,7 @@ ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) } -ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock) +ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -171,7 +171,7 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock return APR_SUCCESS; } -ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *sock) +ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -180,4 +180,4 @@ ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *soc *name = sock->remote_addr; return APR_SUCCESS; } -#endif \ No newline at end of file +#endif diff --git a/network_io/beos/sockets.c b/network_io/beos/sockets.c index 9a251bf9182..0a9495f46b6 100644 --- a/network_io/beos/sockets.c +++ b/network_io/beos/sockets.c @@ -131,7 +131,7 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_pool_t *connection_context) +ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_context) { (*new) = (ap_socket_t *)ap_palloc(connection_context, sizeof(ap_socket_t)); @@ -235,4 +235,4 @@ ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, (*sock)->socketdes = *thesock; return APR_SUCCESS; } -#endif \ No newline at end of file +#endif diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 737af928b10..61f5b1959c1 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -147,7 +147,7 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_pool_t *connection_context) +ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_context) { (*new) = (ap_socket_t *)ap_palloc(connection_context, sizeof(ap_socket_t)); diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 0a67769a2f4..f17a16b9be4 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -128,7 +128,7 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) -ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) +ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock) { *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); return APR_SUCCESS; @@ -136,7 +136,7 @@ ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) -ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) +ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock) { *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); return APR_SUCCESS; @@ -145,7 +145,7 @@ ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) #if APR_HAVE_NETINET_IN_H -ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock) +ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) { *name = sock->local_addr; return APR_SUCCESS; @@ -153,7 +153,7 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock -ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *sock) +ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock) { *name = sock->remote_addr; return APR_SUCCESS; diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index ba0d24355d9..5445248b5ad 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -127,7 +127,7 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_pool_t *connection_context) +ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_context) { (*new) = (ap_socket_t *)ap_pcalloc(connection_context, sizeof(ap_socket_t)); diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index 7010539fb76..fe025c00c56 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -129,7 +129,7 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) return APR_SUCCESS; } -ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) +ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock) { *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); return APR_SUCCESS; @@ -137,14 +137,14 @@ ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) -ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) +ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock) { *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); return APR_SUCCESS; } -ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock) +ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) { *name = sock->local_addr; return APR_SUCCESS; @@ -152,7 +152,7 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock -ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *sock) +ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock) { *name = sock->remote_addr; return APR_SUCCESS; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 63c19b03a7b..9eb5143fee7 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -158,7 +158,7 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_pool_t *connection_context) +ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_context) { (*new) = (ap_socket_t *)ap_palloc(connection_context, sizeof(ap_socket_t)); From 838361b61a2015d1ee84ad0e1553ff7c1935a8d2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 26 Jun 2000 20:40:42 +0000 Subject: [PATCH 0286/7878] Ignore new executable file testsf. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60261 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.cvsignore b/test/.cvsignore index 8dee9b7e794..56becea1ab9 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -18,3 +18,4 @@ testsock testproc testfile occhild +testsf From a7f9950d75a885ecd5fa8fc0aa534c7ec833e354 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 26 Jun 2000 23:35:28 +0000 Subject: [PATCH 0287/7878] A string constant was straddling a newline. Badness. (separate fix by Greg: #if an Apache function call out of existence, and optimize the function by computing length once and memcpy'ing) Submitted by: "Victor J. Orlikowski" Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60262 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_cpystrn.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/apr_cpystrn.c b/lib/apr_cpystrn.c index 17f27014571..37fd2bad56d 100644 --- a/lib/apr_cpystrn.c +++ b/lib/apr_cpystrn.c @@ -248,12 +248,17 @@ APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src) char *strdup(const char *str) { char *sdup; - if (!(sdup = (char *) malloc(strlen(str) + 1))) { - ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Ouch! - Out of memory in our strdup()!"); + size_t len = strlen(str) + 1; + + if (!(sdup = (char *) malloc(len))) { + /* ### whoops! we can't call Apache logging routines here... */ +#if 0 + ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, + "Ouch! Out of memory in our strdup()!"); +#endif return NULL; } - sdup = strcpy(sdup, str); + memcpy(sdup, str, len); return sdup; } From 74a587c50671c2a9a0ee5c5ef3bb3915a321bee2 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 26 Jun 2000 23:38:34 +0000 Subject: [PATCH 0288/7878] Can't add anything to a void*. Make it a char* for these manipulations. Submitted by: "Victor J. Orlikowski" Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60263 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 014ffabded2..de5fdfb80c9 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -485,7 +485,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, #endif ptr = 0; for (i = 0; i < hdtr->numheaders; i++) { - memcpy(hbuf + ptr, hdtr->headers[i].iov_base, + memcpy((char *)hbuf + ptr, hdtr->headers[i].iov_base, hdtr->headers[i].iov_len); ptr += hdtr->headers[i].iov_len; } @@ -511,7 +511,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, #endif ptr = 0; for (i = 0; i < hdtr->numtrailers; i++) { - memcpy(tbuf + ptr, hdtr->trailers[i].iov_base, + memcpy((char *)tbuf + ptr, hdtr->trailers[i].iov_base, hdtr->trailers[i].iov_len); ptr += hdtr->trailers[i].iov_len; } From 9b1133d5dd579bef1164055bff7f01c2278f7f12 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 27 Jun 2000 01:26:15 +0000 Subject: [PATCH 0289/7878] ap_close() now calls ap_flush() for buffered files, so write operations work a whole lot better on buffered files :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60264 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index b891a494ca8..ce5731e5e0f 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -172,13 +172,17 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil ap_status_t ap_close(ap_file_t *file) { - ap_status_t rv; - + ap_status_t flush_rv = APR_SUCCESS, rv; + + if (file->buffered) { + flush_rv = ap_flush(file); + } + if ((rv = ap_unix_file_cleanup(file)) == APR_SUCCESS) { ap_kill_cleanup(file->cntxt, file, ap_unix_file_cleanup); return APR_SUCCESS; } - return rv; + return rv ? rv : flush_rv; } ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) From 2c192442f745deb696e1ba1e6c187fc72346f29f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 27 Jun 2000 02:00:58 +0000 Subject: [PATCH 0290/7878] Turn on SO_REUSEADDR in the server test program. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60265 13f79535-47bb-0310-9956-ffa450edef68 --- test/server.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/server.c b/test/server.c index 3207915f699..aad0de2708d 100644 --- a/test/server.c +++ b/test/server.c @@ -102,6 +102,14 @@ int main(int argc, char *argv[]) } fprintf(stdout, "OK\n"); + fprintf(stdout, "\tServer: Setting socket option REUSEADDR......."); + if (ap_setsocketopt(sock, APR_SO_REUSEADDR, 1) != APR_SUCCESS) { + ap_close_socket(sock); + fprintf(stderr, "Couldn't set socket option\n"); + exit(-1); + } + fprintf(stdout, "OK\n"); + fprintf(stdout, "\tServer: Setting port for socket......."); if (ap_set_local_port(sock, 8021) != APR_SUCCESS) { ap_close_socket(sock); From f6f4968fa43244f83a8405acd4ceda957e44245f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 27 Jun 2000 02:23:29 +0000 Subject: [PATCH 0291/7878] Change Unix and Win32 ap_setsockopt() so that APR_SO_NONBLOCK with non-zero argument makes the socket non-blocking. BeOS and OS/2 already worked this way. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60266 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 4 ++-- network_io/win32/sockopt.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index a24df943fe3..c4ca2ebc521 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -142,11 +142,11 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) } if (opt & APR_SO_NONBLOCK) { if (on) { - if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) + if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) return stat; } else { - if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) + if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) return stat; } } diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index afe2b6c11d4..40259b68aea 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -141,11 +141,11 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) break; case APR_SO_NONBLOCK: if (on) { - if ((stat = soblock(sock->sock)) != APR_SUCCESS) + if ((stat = sononblock(sock->sock)) != APR_SUCCESS) return stat; } else { - if ((stat = sononblock(sock->sock)) != APR_SUCCESS) + if ((stat = soblock(sock->sock)) != APR_SUCCESS) return stat; } break; From a7fc8fcd3afd313353b0bef44fc5e40c893a0432 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 27 Jun 2000 14:03:02 +0000 Subject: [PATCH 0292/7878] various updates to the ap_sendfile() test driver... . send a larger file so that we hit EAGAIN/EWOULDBLOCK more readily . distinguish bytes in headers and trailers better so I can see which bug we hit more quickly :) . turn on APR_BUFFERED when creating the test file (now that APR_BUFFERED on files opened for writing works better) . add APR_SO_TIMEOUT mode for the socket passed to ap_sendfile() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60267 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsf.c | 111 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 100 insertions(+), 11 deletions(-) diff --git a/test/testsf.c b/test/testsf.c index ef967b80df7..17376fa9494 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -70,12 +70,14 @@ int main(void) } #else /* !APR_HAS_SENDFILE */ -#define FILE_LENGTH 100000 +#define FILE_LENGTH 200000 -#define HDR1 "First header\n" -#define HDR2 "Last header\n" -#define TRL1 "First trailer\n" -#define TRL2 "Last trailer\n" +#define FILE_DATA_CHAR '0' + +#define HDR1 "1234567890ABCD\n" +#define HDR2 "EFGH\n" +#define TRL1 "IJKLMNOPQRSTUVWXYZ\n" +#define TRL2 "!@#$%&*()\n" #define TESTSF_PORT 8021 @@ -121,17 +123,22 @@ static void create_testfile(ap_pool_t *p, const char *fname) char buf[120]; int i; ap_ssize_t nbytes; + ap_finfo_t finfo; - rv = ap_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); + printf("Creating a test file...\n"); + rv = ap_open(&f, fname, + APR_CREATE | APR_WRITE | APR_TRUNCATE | APR_BUFFERED, + APR_UREAD | APR_UWRITE, p); if (rv) { fprintf(stderr, "ap_open()->%d/%s\n", rv, ap_strerror(rv, buf, sizeof buf)); exit(1); } + buf[0] = FILE_DATA_CHAR; for (i = 0; i < FILE_LENGTH; i++) { nbytes = 1; - rv = ap_write(f, "0", &nbytes); + rv = ap_write(f, buf, &nbytes); if (rv) { fprintf(stderr, "ap_write()->%d/%s\n", rv, ap_strerror(rv, buf, sizeof buf)); @@ -145,16 +152,33 @@ static void create_testfile(ap_pool_t *p, const char *fname) rv, ap_strerror(rv, buf, sizeof buf)); exit(1); } + + rv = ap_stat(&finfo, fname, p); + if (rv) { + fprintf(stderr, "ap_close()->%d/%s\n", + rv, ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + if (finfo.size != FILE_LENGTH) { + fprintf(stderr, + "test file %s should be %ld-bytes long\n" + "instead it is %ld-bytes long\n", + fname, + (long int)FILE_LENGTH, + (long int)finfo.size); + exit(1); + } } -static int client(int blocking) +static int client(int socket_mode) { ap_status_t rv; ap_socket_t *sock; ap_pool_t *p; char buf[120]; ap_file_t *f = NULL; - ap_size_t len; + ap_size_t len, expected_len; ap_off_t offset; ap_hdtr_t hdtr; struct iovec headers[2]; @@ -188,7 +212,12 @@ static int client(int blocking) exit(1); } - if (!blocking) { + switch(socket_mode) { + case 1: + /* leave it blocking */ + break; + case 0: + /* set it non-blocking */ rv = ap_setsocketopt(sock, APR_SO_NONBLOCK, 1); if (rv != APR_SUCCESS) { fprintf(stderr, "ap_setsocketopt(APR_SO_NONBLOCK)->%d/%s\n", @@ -196,8 +225,24 @@ static int client(int blocking) ap_strerror(rv, buf, sizeof buf)); exit(1); } + break; + case 2: + /* set a timeout */ + rv = ap_setsocketopt(sock, APR_SO_TIMEOUT, + 100 * AP_USEC_PER_SEC); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_setsocketopt(APR_SO_NONBLOCK)->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + break; + default: + assert(1 != 1); } + printf("Sending the file...\n"); + hdtr.headers = headers; hdtr.numheaders = 2; hdtr.headers[0].iov_base = HDR1; @@ -222,9 +267,39 @@ static int client(int blocking) exit(1); } + printf("ap_sendfile() updated offset with %ld\n", + (long int)offset); + printf("ap_sendfile() updated len with %ld\n", (long int)len); + expected_len = + strlen(HDR1) + strlen(HDR2) + + strlen(TRL1) + strlen(TRL2) + + FILE_LENGTH; + + printf("bytes really sent: %d\n", + expected_len); + + if (len != expected_len) { + fprintf(stderr, "ap_sendfile() didn't report the correct " + "number of bytes sent!\n"); + exit(1); + } + + offset = 0; + rv = ap_seek(f, APR_CUR, &offset); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_seek()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + printf("After ap_sendfile(), the kernel file pointer is " + "at offset %ld.\n", + (long int)offset); + rv = ap_shutdown(sock, APR_SHUTDOWN_WRITE); if (rv != APR_SUCCESS) { fprintf(stderr, "ap_shutdown()->%d/%s\n", @@ -315,6 +390,8 @@ static int server(void) exit(1); } + printf("Processing a client...\n"); + assert(sizeof buf > strlen(HDR1)); bytes_read = strlen(HDR1); rv = ap_recv(newsock, buf, &bytes_read); @@ -369,6 +446,15 @@ static int server(void) (long int)bytes_read); exit(1); } + if (buf[0] != FILE_DATA_CHAR) { + fprintf(stderr, + "problem with data read (byte %d of file):\n", + i); + fprintf(stderr, "read `%c' (0x%x) from client; expected " + "`%c'\n", + buf[0], buf[0], FILE_DATA_CHAR); + exit(1); + } } assert(sizeof buf > strlen(TRL1)); @@ -444,6 +530,9 @@ int main(int argc, char *argv[]) if (!strcmp(argv[2], "blocking")) { return client(1); } + else if (!strcmp(argv[2], "timeout")) { + return client(2); + } else if (!strcmp(argv[2], "nonblocking")) { return client(0); } @@ -453,7 +542,7 @@ int main(int argc, char *argv[]) } fprintf(stderr, - "Usage: %s client {blocking|nonblocking}\n" + "Usage: %s client {blocking|nonblocking|timeout}\n" " %s server\n", argv[0], argv[0]); return -1; From 6078d43511690136ae493a603d794f4cfc95bdd4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 27 Jun 2000 20:06:19 +0000 Subject: [PATCH 0293/7878] Detect libraries based on which platform configure is being run on. Basically, Apache now runs APR's configure script first. APR's configure script has been setup to create a new file, APRVARS. APRVARS is basically all of the environment variables that APR wants to export to the program that is using it. This allows the calling program to "source" APRVARS and get those environment variables. Removed hack to make platforms use -ldl. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60268 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 1 + aclocal.m4 | 8 ++++++++ configure.in | 5 ++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index a95c476fb75..d0d32dac42b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -60,6 +60,7 @@ distclean: subdirs_distclean -$(RM) -f *.o *.a *.so -$(RM) -f config.cache config.status config.log configure -$(RM) -f Makefile + -$(RM) -f APRVARS -$(RM) -rf objs cd test; $(MAKE) distclean; cd .. diff --git a/aclocal.m4 b/aclocal.m4 index fd5daa746bb..93e0f1dea97 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -303,5 +303,13 @@ if test -n "$USE_MM" && test -n "$USE_VPATH"; then fi ]) +AC_DEFUN(APR_OUTPUT_VARS,[ +dnl #----------------------------- output environment variables to a file to +dnl #----------------------------- be used by calling program. + rm APRVARS + echo "LIBS=\"$LIBS\"" >> APRVARS +]) + + sinclude(threads.m4) sinclude(hints.m4) diff --git a/configure.in b/configure.in index c8a00d74fda..84fc11cf878 100644 --- a/configure.in +++ b/configure.in @@ -404,7 +404,8 @@ AC_ARG_ENABLE(dso, [ --enable-dso Enable dso support ], [ tempdso=$enableval], [ - AC_CHECK_LIB(dl, dlopen, tempdso="yes", tempdso="no") + AC_CHECK_LIB(dl, dlopen, [ tempdso="yes" LIBS="$LIBS -ldl" ], + tempdso="no") if test "$tempdso" = "no"; then AC_CHECK_FUNCS(dlopen, [ tempdso="yes" ], [ tempdso="no" ]) fi @@ -650,6 +651,8 @@ AC_SUBST(file_as_socket) APR_CHECK_GETHOSTBYNAME_NAS dnl #----------------------------- Construct the files +APR_OUTPUT_VARS + AC_SUBST(LDLIBS) AC_SUBST(OPTIM) AC_SUBST(RANLIB) From 0e22e4e3e7286d3b51f49d5ea51cec977758c616 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 27 Jun 2000 20:37:50 +0000 Subject: [PATCH 0294/7878] ap_sendfile() fixes for OS/390 and FreeBSD... OS/390: just use Victor's AIX flavor... it works for OS/390 as well FreeBSD: account for header bytes when we tell the kernel how much to send; prior to this fix, we wouldn't send as much of the file as desired if headers were provided Note: APR_SO_TIMEOUT issues discussed on new-httpd today will be addressed later. (one step at a time!) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60269 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index de5fdfb80c9..4bcb1446824 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -306,21 +306,30 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, ap_int32_t flags) { off_t nbytes; - int rv; + int rv, i; struct sf_hdtr headerstruct; + size_t bytes_to_send = *len; + + /* On FreeBSD, the number of bytes to send must include the length of + * the headers. Don't look at the man page for this :( Instead, look + * at the the logic in src/sys/kern/uipc_syscalls::sendfile(). + */ + + for (i = 0; i < hdtr->numheaders; i++) { + bytes_to_send += hdtr->headers[i].iov_len; + } headerstruct.headers = hdtr->headers; headerstruct.hdr_cnt = hdtr->numheaders; headerstruct.trailers = hdtr->trailers; headerstruct.trl_cnt = hdtr->numtrailers; - /* FreeBSD can send the headers/footers as part of the system call */ do { rv = sendfile(file->filedes, /* open file descriptor of the file to be sent */ sock->socketdes, /* socket */ *offset, /* where in the file to start */ - (size_t) * len, /* number of bytes to send */ + bytes_to_send, /* number of bytes to send */ &headerstruct, /* Headers/footers */ &nbytes, /* number of bytes written */ flags /* undefined, set to 0 */ @@ -451,9 +460,17 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, (*len) = rv; return APR_SUCCESS; } -#elif defined(_AIX) -/* Need another check to make sure the dependencies are checked */ -/* AIX, version 4.3.2 with APAR IX85388, or version 4.3.3 and above */ +#elif defined(_AIX) || defined(__MVS__) +/* AIX and OS/390 have the same send_file() interface. + * + * subtle differences: + * AIX doesn't update the file ptr but OS/390 does + * + * availability (correctly determined by autoconf): + * + * AIX - version 4.3.2 with APAR IX85388, or version 4.3.3 and above + * OS/390 - V2R7 and above + */ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, ap_int32_t flags) From 90cf77e3d9dfb0c2b8ec499728309867ac2d27cd Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 27 Jun 2000 21:28:34 +0000 Subject: [PATCH 0295/7878] One bug and one fluff: need to use the '.' shell ``command'' to source the file; and remove error message first time APR's configure is run, and APRVAR doesn't exist. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60270 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index 93e0f1dea97..cd70424381b 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -306,7 +306,7 @@ fi AC_DEFUN(APR_OUTPUT_VARS,[ dnl #----------------------------- output environment variables to a file to dnl #----------------------------- be used by calling program. - rm APRVARS + rm -f APRVARS echo "LIBS=\"$LIBS\"" >> APRVARS ]) From 53c77cd0f7f75709bac170b3c16f2d34a3175e07 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 27 Jun 2000 21:35:29 +0000 Subject: [PATCH 0296/7878] Move the checks for bcopy and memmove down to APR. APR now defines memmove and bzero on platforms that do not natively support them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60271 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 +++++ include/apr.h.in | 2 ++ include/apr_general.h | 11 +++++++++++ 3 files changed, 18 insertions(+) diff --git a/configure.in b/configure.in index 84fc11cf878..02a0043a42f 100644 --- a/configure.in +++ b/configure.in @@ -219,6 +219,9 @@ if test "$native_mmap_emul" = "1"; then mmap="1" fi AC_CHECK_FUNCS(hstrerror) +AC_CHECK_FUNCS(memmove, [ have_memmove="1" ], [have_memmove="0" ]) +AC_CHECK_FUNCS(bcopy, [ have_bcopy="1" ], [ have_bcopy="0"] ) + AC_SUBST(sendfile) AC_SUBST(fork) AC_SUBST(inet_addr) @@ -226,6 +229,8 @@ AC_SUBST(inet_network) AC_SUBST(have_sigaction) AC_SUBST(iconv) AC_SUBST(mmap) +AC_SUBST(have_memmove) +AC_SUBST(have_bcopy) dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC diff --git a/include/apr.h.in b/include/apr.h.in index 18764a646f2..3aa5268b3fd 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -68,6 +68,8 @@ #define APR_HAVE_STRNCASECMP @have_strncasecmp@ #define APR_HAVE_STRDUP @have_strdup@ #define APR_HAVE_STRSTR @have_strstr@ +#define APR_HAVE_MEMMOVE @have_memmove@ +#define APR_HAVE_BCOPY @have_bcopy@ #if APR_HAVE_SYS_TYPES_H #include diff --git a/include/apr_general.h b/include/apr_general.h index b34dea78e2b..dea1face7ee 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -230,6 +230,17 @@ int strcasecmp(const char *a, const char *b); int strncasecmp(const char *a, const char *b, size_t n); #endif +/* + * String and memory functions + */ + +#if (!APR_HAVE_MEMMOVE) +#define memmove(a,b,c) bcopy(b,a,c) +#endif + +#if (!APR_HAVE_BZERO) +#define bzero(a,b) memset(a,0,b) +#endif #if APR_HAS_RANDOM /* From 1b6be02cd6f993177ec3fe346291b585f2b24362 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 27 Jun 2000 22:35:54 +0000 Subject: [PATCH 0297/7878] Pass the configure args to sub_configure scripts with the RUN_NOW macro. This allows people to specify --disable-threads on Apache's configure command line, and APR respects it. This is the first step to fixing a problem introduced by making Apache call APR's configure script before making any config decisions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60272 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index cd70424381b..4a4dcf7264c 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -281,7 +281,7 @@ changequote([, ])dnl # The eval makes quoting arguments work. - if eval $ac_abs_srcdir/configure --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir + if eval $ac_abs_srcdir/configure $ac_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir then : echo "$1 configured properly" else From c7351c9c73b5c1dbd5c512a3247c51a0a3e427d5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 27 Jun 2000 23:12:26 +0000 Subject: [PATCH 0298/7878] Fix the configure process. This does a couple of things to allow APR and Apache to share information. 1) Move the calling of APR after Apache decides which MPM is run, but before Apache generates the Makefiles and related files. This allows Apache to setup the threading cache values, while still allowing APR to generate APRVARS in time for Apache to use it. 2) Setup the cache files correctly for RUN_NOW configured subdirectories. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60273 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index 4a4dcf7264c..a8f81d90ff5 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -265,11 +265,12 @@ AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [ echo "configuring package in $1 now" ac_popdir=`pwd` ac_abs_srcdir=`(cd $srcdir/$1 && pwd)` + apr_config_subdirs="$1" cd $1 changequote(, )dnl # A "../" for each directory in /$config_subdirs. - ac_dots=`echo $config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` + ac_dots=`echo $apr_config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` changequote([, ])dnl # Make the cache file name correct relative to the subdirectory. From ee4459d666f21aaaee0e02e29411c75f390dc5a2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 28 Jun 2000 05:03:19 +0000 Subject: [PATCH 0299/7878] Win32 won't bcopy :) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60274 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr.hw b/include/apr.hw index 2d95f748a5a..bf8fbe6e895 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -125,6 +125,7 @@ #define APR_HAVE_IN_ADDR 1 #define APR_HAVE_INET_ADDR 1 +#define APR_HAVE_MEMMOVE 1 #define APR_HAVE_STRCASECMP 0 #define APR_HAVE_STRICMP 1 #define APR_HAVE_STRNCASECMP 0 From 67b1a835998a34fc49faf4c28e83082becbc05eb Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 28 Jun 2000 14:17:42 +0000 Subject: [PATCH 0300/7878] Change the check for bcopy to bzero, and the associated macros. Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60275 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- include/apr.h.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 02a0043a42f..79bdc20343d 100644 --- a/configure.in +++ b/configure.in @@ -220,7 +220,7 @@ if test "$native_mmap_emul" = "1"; then fi AC_CHECK_FUNCS(hstrerror) AC_CHECK_FUNCS(memmove, [ have_memmove="1" ], [have_memmove="0" ]) -AC_CHECK_FUNCS(bcopy, [ have_bcopy="1" ], [ have_bcopy="0"] ) +AC_CHECK_FUNCS(bzero, [ have_bzero="1" ], [ have_bzero="0"] ) AC_SUBST(sendfile) AC_SUBST(fork) diff --git a/include/apr.h.in b/include/apr.h.in index 3aa5268b3fd..4ef2ef615ec 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -69,7 +69,7 @@ #define APR_HAVE_STRDUP @have_strdup@ #define APR_HAVE_STRSTR @have_strstr@ #define APR_HAVE_MEMMOVE @have_memmove@ -#define APR_HAVE_BCOPY @have_bcopy@ +#define APR_HAVE_BZERO @have_bzero@ #if APR_HAVE_SYS_TYPES_H #include From 1c2e936312065ac644b5875fc0b7cb81c6f10750 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 28 Jun 2000 14:33:31 +0000 Subject: [PATCH 0301/7878] Include strings.h for strcasecmp(), strncasecmp(), and bzero(). Include time.h for time(). This removes a bunch of compiler warnings with gcc -Wall on AIX. Submitted by: Jeff Trawick, Victor Orlikowski git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60276 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + file_io/unix/fileio.h | 3 +++ include/arch/unix/fileio.h | 3 +++ lib/apr_tables.c | 3 +++ 4 files changed, 10 insertions(+) diff --git a/configure.in b/configure.in index 79bdc20343d..2b7c025b600 100644 --- a/configure.in +++ b/configure.in @@ -257,6 +257,7 @@ AC_CHECK_HEADERS(stdarg.h, stdargh="1", stdargh="0") AC_CHECK_HEADERS(stdio.h, stdioh="1", stdioh"0") AC_CHECK_HEADERS(stdlib.h) AC_CHECK_HEADERS(string.h) +AC_CHECK_HEADERS(strings.h) AC_CHECK_HEADERS(sysapi.h) AC_CHECK_HEADERS(sysgtime.h) AC_CHECK_HEADERS(termios.h) diff --git a/file_io/unix/fileio.h b/file_io/unix/fileio.h index 46e55f7f998..06e38ee84e3 100644 --- a/file_io/unix/fileio.h +++ b/file_io/unix/fileio.h @@ -75,6 +75,9 @@ #if HAVE_STRING_H #include #endif +#if HAVE_STRINGS_H +#include +#endif #if APR_HAVE_DIRENT_H #include #endif diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 46e55f7f998..06e38ee84e3 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -75,6 +75,9 @@ #if HAVE_STRING_H #include #endif +#if HAVE_STRINGS_H +#include +#endif #if APR_HAVE_DIRENT_H #include #endif diff --git a/lib/apr_tables.c b/lib/apr_tables.c index d3a2069cb3f..9c7ee119bef 100644 --- a/lib/apr_tables.c +++ b/lib/apr_tables.c @@ -75,6 +75,9 @@ #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_STRINGS_H +#include +#endif /***************************************************************** * This file contains array and ap_table_t functions only. From aa9377008d864f8f8e30a09154fee83d7f56c9a8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 28 Jun 2000 14:52:34 +0000 Subject: [PATCH 0302/7878] Somebody forgot to change an occurrence of have_bcopy to have_bzero :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60277 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 2b7c025b600..23285f3ab03 100644 --- a/configure.in +++ b/configure.in @@ -230,7 +230,7 @@ AC_SUBST(have_sigaction) AC_SUBST(iconv) AC_SUBST(mmap) AC_SUBST(have_memmove) -AC_SUBST(have_bcopy) +AC_SUBST(have_bzero) dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC From 9de45fc44f8326d986ed677dbab6cc77405dfdc3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 28 Jun 2000 15:12:44 +0000 Subject: [PATCH 0303/7878] Remove the new function to output APR variables. This is now done just using AC_OUTPUT. Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60278 13f79535-47bb-0310-9956-ffa450edef68 --- APRVARS.in | 1 + aclocal.m4 | 8 -------- configure.in | 3 +-- 3 files changed, 2 insertions(+), 10 deletions(-) create mode 100644 APRVARS.in diff --git a/APRVARS.in b/APRVARS.in new file mode 100644 index 00000000000..3f51b0b52a8 --- /dev/null +++ b/APRVARS.in @@ -0,0 +1 @@ +LIBS="@LIBS@" diff --git a/aclocal.m4 b/aclocal.m4 index a8f81d90ff5..7478d292618 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -304,13 +304,5 @@ if test -n "$USE_MM" && test -n "$USE_VPATH"; then fi ]) -AC_DEFUN(APR_OUTPUT_VARS,[ -dnl #----------------------------- output environment variables to a file to -dnl #----------------------------- be used by calling program. - rm -f APRVARS - echo "LIBS=\"$LIBS\"" >> APRVARS -]) - - sinclude(threads.m4) sinclude(hints.m4) diff --git a/configure.in b/configure.in index 23285f3ab03..c7f0802bb51 100644 --- a/configure.in +++ b/configure.in @@ -657,7 +657,6 @@ AC_SUBST(file_as_socket) APR_CHECK_GETHOSTBYNAME_NAS dnl #----------------------------- Construct the files -APR_OUTPUT_VARS AC_SUBST(LDLIBS) AC_SUBST(OPTIM) @@ -698,7 +697,7 @@ for i in $SAVE_FILES; do test -r $i && mv $i $i.save done -AC_OUTPUT($MAKEFILE1 $MAKEFILE2 $MAKEFILE3 include/apr.h,[ +AC_OUTPUT($MAKEFILE1 $MAKEFILE2 $MAKEFILE3 include/apr.h APRVARS,[ SAVE_FILES="include/apr.h include/apr_private.h" From 93117cdcdc5a54cb9abc50c229aee783fee0e9ce Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 28 Jun 2000 16:31:08 +0000 Subject: [PATCH 0304/7878] Finish the Configuration cleanup. This basically merges all of the autoconf scripts that APR provides for other programs into apr_common.m4. Other programs can then just include that file to get the APR checks that are required. Submitted by: Sascha Schumann git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60279 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 32 +------------------------------- threads.m4 => apr_common.m4 | 30 ++++++++++++++++++++++++++++++ configure.in | 2 +- 3 files changed, 32 insertions(+), 32 deletions(-) rename threads.m4 => apr_common.m4 (83%) diff --git a/aclocal.m4 b/aclocal.m4 index 7478d292618..293bb989429 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -261,37 +261,6 @@ int main(void) { fi ]) -AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [ - echo "configuring package in $1 now" - ac_popdir=`pwd` - ac_abs_srcdir=`(cd $srcdir/$1 && pwd)` - apr_config_subdirs="$1" - cd $1 - -changequote(, )dnl - # A "../" for each directory in /$config_subdirs. - ac_dots=`echo $apr_config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` -changequote([, ])dnl - - # Make the cache file name correct relative to the subdirectory. - case "$cache_file" in - /*) ac_sub_cache_file=$cache_file ;; - *) # Relative path. - ac_sub_cache_file="$ac_dots$cache_file" ;; - esac - - # The eval makes quoting arguments work. - - if eval $ac_abs_srcdir/configure $ac_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir - then : - echo "$1 configured properly" - else - echo "configure failed for $1" - fi - - cd $ac_popdir -]) - AC_DEFUN(APR_PREPARE_MM_DIR,[ dnl #----------------------------- Prepare mm directory for VPATH support if test -n "$USE_MM" && test -n "$USE_VPATH"; then @@ -305,4 +274,5 @@ fi ]) sinclude(threads.m4) +sinclude(apr_common.m4) sinclude(hints.m4) diff --git a/threads.m4 b/apr_common.m4 similarity index 83% rename from threads.m4 rename to apr_common.m4 index 97e8b99ae1c..66ff91006af 100644 --- a/threads.m4 +++ b/apr_common.m4 @@ -1,3 +1,33 @@ +AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [ + echo "configuring package in $1 now" + ac_popdir=`pwd` + ac_abs_srcdir=`(cd $srcdir/$1 && pwd)` + apr_config_subdirs="$1" + cd $1 + +changequote(, )dnl + # A "../" for each directory in /$config_subdirs. + ac_dots=`echo $apr_config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` +changequote([, ])dnl + + # Make the cache file name correct relative to the subdirectory. + case "$cache_file" in + /*) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file="$ac_dots$cache_file" ;; + esac + + # The eval makes quoting arguments work. + + if eval $ac_abs_srcdir/configure $ac_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir + then : + echo "$1 configured properly" + else + echo "configure failed for $1" + fi + + cd $ac_popdir +]) dnl dnl REENTRANCY_FLAGS dnl diff --git a/configure.in b/configure.in index c7f0802bb51..9847ff3b9fa 100644 --- a/configure.in +++ b/configure.in @@ -3,7 +3,7 @@ dnl ## Autoconf configuration file for APR dnl ## dnl Process this file with autoconf to produce a configure script. -AC_INIT(threads.m4) +AC_INIT(apr_common.m4) AC_CONFIG_HEADER(include/apr_private.h) AC_CONFIG_AUX_DIR_DEFAULT From fbcb6c55b721cc60b827973a3c4cbaafd30af5e0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 28 Jun 2000 22:36:28 +0000 Subject: [PATCH 0305/7878] APR network_io for Unix: Defer/avoid getsockname() whenever possible. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60280 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/networkio.h | 2 ++ network_io/unix/networkio.h | 2 ++ network_io/unix/sockaddr.c | 40 +++++++++++++++++++++++++++++++++ network_io/unix/sockets.c | 42 ++++++++++++++++++++++++++--------- 4 files changed, 76 insertions(+), 10 deletions(-) diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 6dccfaad8cc..af28dc7c710 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -126,6 +126,8 @@ struct ap_socket_t { #ifndef HAVE_POLL int connected; #endif + int local_port_unknown; + int local_interface_unknown; }; struct ap_pollfd_t { diff --git a/network_io/unix/networkio.h b/network_io/unix/networkio.h index 6dccfaad8cc..af28dc7c710 100644 --- a/network_io/unix/networkio.h +++ b/network_io/unix/networkio.h @@ -126,6 +126,8 @@ struct ap_socket_t { #ifndef HAVE_POLL int connected; #endif + int local_port_unknown; + int local_interface_unknown; }; struct ap_pollfd_t { diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index f17a16b9be4..1a912d7f6d5 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -70,8 +70,32 @@ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) +static ap_status_t get_local_addr(ap_socket_t *sock) +{ + socklen_t namelen = sizeof(*sock->local_addr); + + if (getsockname(sock->socketdes, (struct sockaddr *)sock->local_addr, + &namelen) < 0) { + return errno; + } + else { + sock->local_port_unknown = sock->local_interface_unknown = 0; + return APR_SUCCESS; + } +} + + + ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) { + if (sock->local_port_unknown) { + ap_status_t rv = get_local_addr(sock); + + if (rv != APR_SUCCESS) { + return rv; + } + } + *port = ntohs(sock->local_addr->sin_port); return APR_SUCCESS; } @@ -130,6 +154,14 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock) { + if (sock->local_interface_unknown) { + ap_status_t rv = get_local_addr(sock); + + if (rv != APR_SUCCESS) { + return rv; + } + } + *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); return APR_SUCCESS; } @@ -147,6 +179,14 @@ ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock) #if APR_HAVE_NETINET_IN_H ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) { + if (sock->local_port_unknown || sock->local_interface_unknown) { + ap_status_t rv = get_local_addr(sock); + + if (rv != APR_SUCCESS) { + return rv; + } + } + *name = sock->local_addr; return APR_SUCCESS; } diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 5445248b5ad..764d6861a00 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -115,8 +115,12 @@ ap_status_t ap_bind(ap_socket_t *sock) { if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) return errno; - else + else { + if (sock->local_addr->sin_port == 0) { /* no need for ntohs() when comparing w/ 0 */ + sock->local_port_unknown = 1; /* kernel got us an ephemeral port */ + } return APR_SUCCESS; + } } ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) @@ -151,9 +155,22 @@ ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connectio return errno; } - if (getsockname((*new)->socketdes, (struct sockaddr *)(*new)->local_addr, - &((*new)->addr_len)) < 0) { - return errno; + *(*new)->local_addr = *sock->local_addr; + + if (sock->local_port_unknown) { + /* not likely for a listening socket, but theoretically possible :) */ + (*new)->local_port_unknown = 1; + } + + if (sock->local_interface_unknown || + sock->local_addr->sin_addr.s_addr == 0) { + /* If the interface address inside the listening socket's local_addr wasn't + * up-to-date, we don't know local interface of the connected socket either. + * + * If the listening socket was not bound to a specific interface, we + * don't know the local_addr of the connected socket. + */ + (*new)->local_interface_unknown = 1; } ap_register_cleanup((*new)->cntxt, (void *)(*new), @@ -197,8 +214,16 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) return errno; } else { - socklen_t namelen = sizeof(*sock->local_addr); - getsockname(sock->socketdes, (struct sockaddr *)sock->local_addr, &namelen); + if (sock->local_addr->sin_port == 0) { + /* connect() got us an ephemeral port */ + sock->local_port_unknown = 1; + } + if (sock->local_addr->sin_addr.s_addr == 0) { + /* not bound to specific local interface; connect() had to assign + * one for the socket + */ + sock->local_interface_unknown = 1; + } #ifndef HAVE_POLL sock->connected=1; #endif @@ -240,11 +265,8 @@ ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, (*sock)->addr_len = sizeof(*(*sock)->local_addr); (*sock)->timeout = -1; - if (getsockname(*thesock, (struct sockaddr *)(*sock)->local_addr, - &((*sock)->addr_len)) < 0) { - return errno; - } } + (*sock)->local_port_unknown = (*sock)->local_interface_unknown = 1; (*sock)->socketdes = *thesock; return APR_SUCCESS; } From c7394a3eea4bfdba56d3a429b259ea7cddcfc617 Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" Date: Thu, 29 Jun 2000 14:41:22 +0000 Subject: [PATCH 0306/7878] remove unwanted include git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60281 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index ae3696db3c0..3a455824978 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -55,7 +55,6 @@ #ifndef APR_NETWORK_IO_H #define APR_NETWORK_IO_H -#include "apr_private.h" #include "apr_general.h" #include "apr_file_io.h" #include "apr_errno.h" From 2a29bcdcec81ce37c528dae482b032750c251c81 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 29 Jun 2000 16:34:38 +0000 Subject: [PATCH 0307/7878] Delete a commented-out invocation of AC_MSG_ERROR. For some unknown reason, this line led autoconf on OS/390 to bail out and say that it had an internal bug because AC_MSG_ERROR is undefined. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60282 13f79535-47bb-0310-9956-ffa450edef68 --- apr_common.m4 | 1 - 1 file changed, 1 deletion(-) diff --git a/apr_common.m4 b/apr_common.m4 index 66ff91006af..3f9208f0d19 100644 --- a/apr_common.m4 +++ b/apr_common.m4 @@ -36,7 +36,6 @@ dnl AC_DEFUN(REENTRANCY_FLAGS,[ if test -z "$host_alias"; then host_alias=`$ac_config_guess` -dnl AC_MSG_ERROR(host_alias is not set. Make sure to run config.guess) fi case "$host_alias" in *solaris*) From 2f88caadcf9df7d9c9c70577c88d06c3e0abe8ef Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 29 Jun 2000 19:14:52 +0000 Subject: [PATCH 0308/7878] Put in a hack to allow us to over-ride the APR_OFF_T_FMT and APR_SSIZE_T_FMT definitions. I tried to use AC_TRY_COMPILE, but autoconf doesn't consider warnings failures to compile. So, no matter how I wrote my test program, it generated a warning, and autoconf said it succeeded. :-( The code I am committing only sets the off_t fmt variable. Let's just use the same case statement for the ssize_t as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60283 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure.in b/configure.in index 9847ff3b9fa..cafa5bb1d34 100644 --- a/configure.in +++ b/configure.in @@ -380,6 +380,15 @@ else off_t_fmt='#error Can not determine the proper size for off_t' fi +# basically, we have tried to figure out the sizes of ap_ssize_t and +# ap_off_t, but we don't always get it right. If you find that we +# don't get it right for your platform, you can override our decision +# below. +case "$OS" in + *linux*) + off_t_fmt='#define APR_OFF_T_FMT "ld"' +esac + AC_SUBST(short_value) AC_SUBST(int_value) AC_SUBST(long_value) From c72baabd04487235e060348ae3ed525fb1b0f7c4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 30 Jun 2000 01:56:48 +0000 Subject: [PATCH 0309/7878] threads.m4 is no more... don't include it anymore git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60284 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 1 - 1 file changed, 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index 293bb989429..23db8b20dfd 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -273,6 +273,5 @@ if test -n "$USE_MM" && test -n "$USE_VPATH"; then fi ]) -sinclude(threads.m4) sinclude(apr_common.m4) sinclude(hints.m4) From 34037761e2581a132e85cb9eb3a4a70fb3e35b39 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 30 Jun 2000 18:14:48 +0000 Subject: [PATCH 0310/7878] Temp hack to get CGIs working again on NT. Better solution soon. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60285 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 55edc3b4332..897f8df3a0f 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -82,6 +82,18 @@ ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) if (thepipe->pipe == 1) { if (ap_get_oslevel(thepipe->cntxt, &oslevel) == APR_SUCCESS && oslevel >= APR_WIN_NT) { + /* Temporary hack to make CGIs work in alpha5 + * NT doesn't support timing out non-blocking pipes. Specifically, + * NT has no event notification to tell you when data has arrived + * on a pipe. select, WaitForSingleObject or WSASelect, et. al. + * do not tell you when data is available. You have to poll the read + * which just sucks. I will implement this using async i/o later. + * For now, if ap_set_pipe_timeout is set with a timeout, just make + * the pipe full blocking...*/ + if (timeout > 0) { + setpipeblockmode(thepipe, PIPE_WAIT); + return APR_SUCCESS; + } if (timeout >= 0) { /* Set the pipe non-blocking if it was previously blocking */ if (thepipe->timeout < 0) { From e0dc27017f4e8fe65174aef33868786d5a72d524 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 30 Jun 2000 19:18:16 +0000 Subject: [PATCH 0311/7878] Add a patch that Ralf has already committed to 1.1.3 of MM. This allows MM to build on Linux on OS/390 Submitted by: Greg Ames git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60286 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/mm/config.sub | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shmem/unix/mm/config.sub b/shmem/unix/mm/config.sub index a3239783747..416140415cf 100755 --- a/shmem/unix/mm/config.sub +++ b/shmem/unix/mm/config.sub @@ -723,6 +723,9 @@ case $basic_machine in basic_machine=i386-sequent os=-dynix ;; + s390*) + basic_machine=s390-ibm + ;; t3e) basic_machine=t3e-cray os=-unicos From 4a988e08227141e6995ea50f9c0915bb28935c8e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 30 Jun 2000 19:57:54 +0000 Subject: [PATCH 0312/7878] Fix the problem with ./buildconf not working right out of CVS. The general problem, is that we were using AC_CONFIG_AUX_DIR_DEFAULT, which the autoconf source says shouldn't be called directly. It should be called using AC_REQUIRE, but I couldn't make that work. So, since we know exactly where the files that we are looking for are located, we'll just point autoconf directly to them, and ignore all of the hoops. :-) I am not convinced the AC_CONFIG_AUX_DIR(.) call that I am using is strictly necessary, but it doesn't cause any problems and it logically makes sense. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60287 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index cafa5bb1d34..47aa3f1c301 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl ## dnl Process this file with autoconf to produce a configure script. AC_INIT(apr_common.m4) AC_CONFIG_HEADER(include/apr_private.h) -AC_CONFIG_AUX_DIR_DEFAULT +AC_CONFIG_AUX_DIR(.) echo "Configuring APR library" OS=`$ac_config_guess` From 5af55c62da16f4f1d5205523bdb995857c15c747 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 30 Jun 2000 21:09:06 +0000 Subject: [PATCH 0313/7878] Remove the AC_CONFIG_DIR_AUX_DEFAULT patch for APR. For some reason this works. I have stopped questioning autoconf today. :-) This also doesn't cause the problems that it caused in the top-level Apache tree. The fix I made earlier actually does cause problems at this level of the tree. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60288 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 47aa3f1c301..cafa5bb1d34 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl ## dnl Process this file with autoconf to produce a configure script. AC_INIT(apr_common.m4) AC_CONFIG_HEADER(include/apr_private.h) -AC_CONFIG_AUX_DIR(.) +AC_CONFIG_AUX_DIR_DEFAULT echo "Configuring APR library" OS=`$ac_config_guess` From f7c548634cc8ccb6130353080935ef3fa74a2342 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 1 Jul 2000 04:03:28 +0000 Subject: [PATCH 0314/7878] OS/2: Add ap_getsocketopt() implementation. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60289 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockopt.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 1da0c6bf6df..75b4c2a7844 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -118,6 +118,20 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) +ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) +{ + switch(opt) { + case APR_SO_TIMEOUT: + *on = sock->timeout; + break; + default: + return APR_EINVAL; + } + return APR_SUCCESS; +} + + + ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_pool_t *cont) { if (gethostname(buf, len) == -1) From 79261d6c212279c7b8a49496e7ac3b1145b63f3b Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 3 Jul 2000 03:21:13 +0000 Subject: [PATCH 0315/7878] Win32: First cut at implementing non-blocking pipes with timeout on Windows NT. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60290 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/fileio.h | 21 +++-- file_io/win32/open.c | 7 +- file_io/win32/pipe.c | 173 ++++++++++++++++++++++++------------ file_io/win32/readwrite.c | 129 ++++++++++++++++++++------- include/arch/win32/fileio.h | 21 +++-- threadproc/win32/proc.c | 67 ++++++++------ 6 files changed, 287 insertions(+), 131 deletions(-) diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 47fc910c986..232c4d057fd 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -103,18 +103,19 @@ struct ap_file_t { ap_pool_t *cntxt; HANDLE filehand; - char *fname; - DWORD dwFileAttributes; - int eof_hit; - int pipe; + BOOLEAN pipe; // Is this a pipe of a file? + OVERLAPPED *pOverlapped; ap_interval_time_t timeout; - int buffered; - int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ + /* File specific info */ + char *fname; char *demonfname; char *lowerdemonfname; + DWORD dwFileAttributes; + int eof_hit; + BOOLEAN buffered; // Use buffered I/O? + int ungetchar; // Last char provided by an unget op. (-1 = no char) int append; - off_t size; ap_time_t atime; ap_time_t mtime; @@ -127,6 +128,9 @@ struct ap_file_t { int direction; // buffer being used for 0 = read, 1 = write ap_ssize_t filePtr; // position in file of handle ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields + + /* Pipe specific info */ + }; struct ap_dir_t { @@ -143,5 +147,8 @@ APR_EXPORT(char *) ap_os_systemcase_filename(struct ap_pool_t *pCont, const char *szFile); char * canonical_filename(struct ap_pool_t *pCont, const char *szFile); +ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, + BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, + ap_pool_t *p); #endif /* ! FILE_IO_H */ diff --git a/file_io/win32/open.c b/file_io/win32/open.c index ba3795cc583..725b5cc2b68 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -67,10 +67,11 @@ ap_status_t file_cleanup(void *thefile) { ap_file_t *file = thefile; - if (!CloseHandle(file->filehand)) { - return GetLastError(); - } + CloseHandle(file->filehand); file->filehand = INVALID_HANDLE_VALUE; + if (file->pOverlapped) { + CloseHandle(file->pOverlapped->hEvent); + } return APR_SUCCESS; } diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 897f8df3a0f..a9cc0d69cbd 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -63,72 +63,89 @@ #include #include "misc.h" -static ap_status_t setpipeblockmode(ap_file_t *pipe, DWORD dwMode) { - if (!SetNamedPipeHandleState(pipe->filehand, &dwMode, NULL, NULL)) { - return GetLastError(); - } +ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) +{ + thepipe->timeout = timeout; return APR_SUCCESS; } -ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) +ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *p) { - ap_status_t rc = APR_SUCCESS; - ap_oslevel_e oslevel; - - /* This code relies on the fact that anonymous pipes (which - * do not support nonblocking I/O) are really named pipes - * (which support nonblocking I/O) on Windows NT. - */ - if (thepipe->pipe == 1) { - if (ap_get_oslevel(thepipe->cntxt, &oslevel) == APR_SUCCESS && - oslevel >= APR_WIN_NT) { - /* Temporary hack to make CGIs work in alpha5 - * NT doesn't support timing out non-blocking pipes. Specifically, - * NT has no event notification to tell you when data has arrived - * on a pipe. select, WaitForSingleObject or WSASelect, et. al. - * do not tell you when data is available. You have to poll the read - * which just sucks. I will implement this using async i/o later. - * For now, if ap_set_pipe_timeout is set with a timeout, just make - * the pipe full blocking...*/ - if (timeout > 0) { - setpipeblockmode(thepipe, PIPE_WAIT); - return APR_SUCCESS; - } - if (timeout >= 0) { - /* Set the pipe non-blocking if it was previously blocking */ - if (thepipe->timeout < 0) { - rc = setpipeblockmode(thepipe, PIPE_NOWAIT); - } - } - else if (thepipe->timeout >= 0) { - rc = setpipeblockmode(thepipe, PIPE_WAIT); - } - } - else { - /* can't make anonymous pipes non-blocking on Win9x */ - rc = APR_ENOTIMPL; - } - thepipe->timeout = timeout; - } - else { - /* Timeout not valid for file i/o (yet...) */ - rc = APR_EINVAL; + SECURITY_ATTRIBUTES sa; + + sa.nLength = sizeof(sa); + sa.bInheritHandle = TRUE; + sa.lpSecurityDescriptor = NULL; + + (*in) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t)); + (*in)->cntxt = p; + (*in)->fname = ap_pstrdup(p, "PIPE"); + (*in)->pipe = 1; + (*in)->timeout = -1; + (*in)->ungetchar = -1; + (*in)->eof_hit = 0; + (*in)->filePtr = 0; + (*in)->bufpos = 0; + (*in)->dataRead = 0; + (*in)->direction = 0; + + (*out) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t)); + (*out)->cntxt = p; + (*out)->fname = ap_pstrdup(p, "PIPE"); + (*out)->pipe = 1; + (*out)->timeout = -1; + (*out)->ungetchar = -1; + (*out)->eof_hit = 0; + (*out)->filePtr = 0; + (*out)->bufpos = 0; + (*out)->dataRead = 0; + (*out)->direction = 0; + + if (!CreatePipe(&(*in)->filehand, &(*out)->filehand, &sa, 0)) { + return GetLastError(); } - return rc; + return APR_SUCCESS; } -ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) +/* ap_create_nt_pipe() + * An internal (for now) APR function created for use by ap_create_process() + * when setting up pipes to communicate with the child process. + * ap_create_nt_pipe() allows setting the blocking mode of each end of + * the pipe when the pipe is created (rather than after the pipe is created). + * A pipe handle must be opened in full async i/o mode in order to + * emulate Unix non-blocking pipes with timeouts. + * + * In general, we don't want to enable child side pipe handles for async i/o. + * This prevents us from enabling both ends of the pipe for async i/o in + * ap_create_pipe. + * + * Why not use NamedPipes on NT which support setting pipe state to + * non-blocking? On NT, even though you can set a pipe non-blocking, + * there is no clean way to set event driven non-zero timeouts (e.g select(), + * WaitForSinglelObject, et. al. will not detect pipe i/o). On NT, you + * have to poll the pipe to detech i/o on a non-blocking pipe. + * + * wgs + */ +ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, + BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, + ap_pool_t *p) { + ap_oslevel_e level; SECURITY_ATTRIBUTES sa; + static unsigned long id = 0; + DWORD dwPipeMode; + DWORD dwOpenMode; + char name[50]; sa.nLength = sizeof(sa); sa.bInheritHandle = TRUE; sa.lpSecurityDescriptor = NULL; - (*in) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); - (*in)->cntxt = cont; - (*in)->fname = ap_pstrdup(cont, "PIPE"); + (*in) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t)); + (*in)->cntxt = p; + (*in)->fname = ap_pstrdup(p, "PIPE"); (*in)->pipe = 1; (*in)->timeout = -1; (*in)->ungetchar = -1; @@ -137,10 +154,11 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*in)->bufpos = 0; (*in)->dataRead = 0; (*in)->direction = 0; + (*in)->pOverlapped = NULL; - (*out) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); - (*out)->cntxt = cont; - (*out)->fname = ap_pstrdup(cont, "PIPE"); + (*out) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t)); + (*out)->cntxt = p; + (*out)->fname = ap_pstrdup(p, "PIPE"); (*out)->pipe = 1; (*out)->timeout = -1; (*out)->ungetchar = -1; @@ -149,9 +167,52 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*out)->bufpos = 0; (*out)->dataRead = 0; (*out)->direction = 0; + (*out)->pOverlapped = NULL; - if (!CreatePipe(&(*in)->filehand, &(*out)->filehand, &sa, 0)) { - return GetLastError(); + if (ap_get_oslevel(p, &level) == APR_SUCCESS && level >= APR_WIN_NT) { + /* Create the read end of the pipe */ + dwOpenMode = PIPE_ACCESS_INBOUND; + if (bAsyncRead) { + dwOpenMode |= FILE_FLAG_OVERLAPPED; + (*in)->pOverlapped = (OVERLAPPED*) ap_pcalloc(p, sizeof(OVERLAPPED)); + (*in)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + /* register a cleanup for the event handle... */ + } + + dwPipeMode = 0; + + sprintf(name, "\\\\.\\pipe\\%d.%d", getpid(), id++); + + (*in)->filehand = CreateNamedPipe(name, + dwOpenMode, + dwPipeMode, + 1, //nMaxInstances, + 8182, //nOutBufferSize, + 8192, //nInBufferSize, + 1, //nDefaultTimeOut, + &sa); + + /* Create the write end of the pipe */ + dwOpenMode = FILE_ATTRIBUTE_NORMAL; + if (bAsyncWrite) { + dwOpenMode |= FILE_FLAG_OVERLAPPED; + (*out)->pOverlapped = (OVERLAPPED*) ap_pcalloc(p, sizeof(OVERLAPPED)); + (*out)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + } + + (*out)->filehand = CreateFile(name, + GENERIC_WRITE, // access mode + 0, // share mode + &sa, // Security attributes + OPEN_EXISTING, // dwCreationDisposition + dwOpenMode, // Pipe attributes + NULL); // handle to template file + } + else { + /* Pipes on Win9* are blocking. Live with it. */ + if (!CreatePipe(&(*in)->filehand, &(*out)->filehand, &sa, 0)) { + return GetLastError(); + } } return APR_SUCCESS; diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index e0d0422650d..6fe52f3883a 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -60,13 +60,96 @@ #include #include "atime.h" -ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) +/* + * read_with_timeout() + * Uses async i/o to emulate unix non-blocking i/o with timeouts. + */ +static ap_status_t read_with_timeout(ap_file_t *file, void *buf, ap_ssize_t len, ap_ssize_t *nbytes) +{ + ap_status_t rv; + *nbytes = 0; + + /* Handle the zero timeout non-blocking case */ + if (file->timeout == 0) { + /* Peek at the pipe. If there is no data available, return APR_EAGAIN. + * If data is available, go ahead and read it. + */ + if (file->pipe) { + char tmpbuf[5]; + DWORD dwBytesRead; + DWORD dwBytesAvail; + DWORD dwBytesLeftThisMsg; + if (!PeekNamedPipe(file->filehand, // handle to pipe to copy from + &tmpbuf, // pointer to data buffer + sizeof(tmpbuf), // size, in bytes, of data buffer + &dwBytesRead, // pointer to number of bytes read + &dwBytesAvail, // pointer to total number of bytes available + &dwBytesLeftThisMsg)) { // pointer to unread bytes in this message + rv = GetLastError(); + if (rv = ERROR_BROKEN_PIPE) + return APR_SUCCESS; + } + else { + if (dwBytesRead == 0) { + return APR_EAGAIN; + } + } + } + else { + /* ToDo: Handle zero timeout non-blocking file i/o + * This is not needed until an APR application needs to + * timeout file i/o (which means setting file i/o non-blocking) + */ + } + } + + rv = ReadFile(file->filehand, buf, len, nbytes, file->pOverlapped); + + if (!rv) { + rv = GetLastError(); + if (rv == ERROR_IO_PENDING) { + /* Wait for the pending i/o */ + if (file->timeout > 0) { + rv = WaitForSingleObject(file->pOverlapped->hEvent, file->timeout/1000); // timeout in milliseconds... + } + else if (file->timeout == -1) { + rv = WaitForSingleObject(file->pOverlapped->hEvent, INFINITE); + } + switch (rv) { + case WAIT_OBJECT_0: + GetOverlappedResult(file->filehand, file->pOverlapped, nbytes, TRUE); + rv = APR_SUCCESS; + break; + case WAIT_TIMEOUT: + rv = APR_TIMEUP; + break; + case WAIT_FAILED: + rv = GetLastError(); + break; + default: + break; + } + if (rv != APR_SUCCESS) { + CancelIo(file->filehand); + } + } + else if (rv == ERROR_BROKEN_PIPE) { + /* Assume ERROR_BROKEN_PIPE signals an EOF reading from a pipe */ + rv = APR_SUCCESS; /* APR_EOF? */ + } + } else { + rv = APR_SUCCESS; + } + return rv; +} + +ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *len) { ap_ssize_t rv; DWORD bytes_read = 0; - if (*nbytes <= 0) { - *nbytes = 0; + if (*len <= 0) { + *len = 0; return APR_SUCCESS; } @@ -75,17 +158,17 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) bytes_read = 1; *(char *)buf = (char)thefile->ungetchar; buf = (char *)buf + 1; - (*nbytes)--; + (*len)--; thefile->ungetchar = -1; - if (*nbytes == 0) { - *nbytes = bytes_read; + if (*len == 0) { + *len = bytes_read; return APR_SUCCESS; } } if (thefile->buffered) { char *pos = (char *)buf; ap_ssize_t blocksize; - ap_ssize_t size = *nbytes; + ap_ssize_t size = *len; ap_lock(thefile->mutex); @@ -99,9 +182,10 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos >= thefile->dataRead) { - rv = ReadFile(thefile->filehand, thefile->buffer, APR_FILE_BUFSIZE, &thefile->dataRead, NULL ) ? 0 : GetLastError(); + rv = read_with_timeout(thefile, thefile->buffer, + APR_FILE_BUFSIZE, &thefile->dataRead); if (thefile->dataRead == 0) { - if (rv == 0) { + if (rv == APR_SUCCESS) { thefile->eof_hit = TRUE; rv = APR_EOF; } @@ -119,33 +203,16 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) size -= blocksize; } - *nbytes = pos - (char *)buf; - if (*nbytes) { + *len = pos - (char *)buf; + if (*len) { rv = 0; } ap_unlock(thefile->mutex); } else { /* Unbuffered i/o */ - DWORD dwBytesRead; - if (ReadFile(thefile->filehand, buf, *nbytes, &dwBytesRead, NULL)) { - *nbytes = bytes_read + dwBytesRead; - if (*nbytes) { - return APR_SUCCESS; - } - else { - return APR_EOF; - } - } - - *nbytes = 0; - rv = GetLastError(); - if (rv == ERROR_BROKEN_PIPE) { - /* Assume ERROR_BROKEN_PIPE signals an EOF reading from a pipe */ - return APR_SUCCESS; - } else if (rv == ERROR_NO_DATA) { - /* Receive this error on a read to a pipe in nonblocking mode */ - return APR_EAGAIN; - } + ap_ssize_t nbytes; + rv = read_with_timeout(thefile, buf, *len, &nbytes); + *len = nbytes; } return rv; diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 47fc910c986..232c4d057fd 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -103,18 +103,19 @@ struct ap_file_t { ap_pool_t *cntxt; HANDLE filehand; - char *fname; - DWORD dwFileAttributes; - int eof_hit; - int pipe; + BOOLEAN pipe; // Is this a pipe of a file? + OVERLAPPED *pOverlapped; ap_interval_time_t timeout; - int buffered; - int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ + /* File specific info */ + char *fname; char *demonfname; char *lowerdemonfname; + DWORD dwFileAttributes; + int eof_hit; + BOOLEAN buffered; // Use buffered I/O? + int ungetchar; // Last char provided by an unget op. (-1 = no char) int append; - off_t size; ap_time_t atime; ap_time_t mtime; @@ -127,6 +128,9 @@ struct ap_file_t { int direction; // buffer being used for 0 = read, 1 = write ap_ssize_t filePtr; // position in file of handle ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields + + /* Pipe specific info */ + }; struct ap_dir_t { @@ -143,5 +147,8 @@ APR_EXPORT(char *) ap_os_systemcase_filename(struct ap_pool_t *pCont, const char *szFile); char * canonical_filename(struct ap_pool_t *pCont, const char *szFile); +ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, + BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, + ap_pool_t *p); #endif /* ! FILE_IO_H */ diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 25fe9ba5462..8027aeaaa7c 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -92,61 +92,74 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, ap_int32_t out, ap_int32_t err) { ap_status_t stat; + BOOLEAN bAsyncRead, bAsyncWrite; if (in) { - if ((stat = ap_create_pipe(&attr->child_in, &attr->parent_in, - attr->cntxt)) != APR_SUCCESS) { - return stat; - } switch (in) { case APR_FULL_BLOCK: + bAsyncRead = bAsyncWrite = FALSE; break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_in, 0); + bAsyncRead = FALSE; + bAsyncWrite = TRUE; break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_in, 0); + bAsyncRead = TRUE; + bAsyncWrite = FALSE; break; default: - ap_set_pipe_timeout(attr->child_in, 0); - ap_set_pipe_timeout(attr->parent_in, 0); + bAsyncRead = TRUE; + bAsyncWrite = TRUE; + } + if ((stat = ap_create_nt_pipe(&attr->child_in, &attr->parent_in, + bAsyncRead, bAsyncWrite, + attr->cntxt)) != APR_SUCCESS) { + return stat; } } if (out) { - if ((stat = ap_create_pipe(&attr->parent_out, &attr->child_out, - attr->cntxt)) != APR_SUCCESS) { - return stat; - } switch (out) { case APR_FULL_BLOCK: + bAsyncRead = bAsyncWrite = FALSE; break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_out, 0); + bAsyncRead = FALSE; + bAsyncWrite = TRUE; break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_out, 0); + bAsyncRead = TRUE; + bAsyncWrite = FALSE; break; default: - ap_set_pipe_timeout(attr->child_out, 0); - ap_set_pipe_timeout(attr->parent_out, 0); + bAsyncRead = TRUE; + bAsyncWrite = TRUE; + } + if ((stat = ap_create_nt_pipe(&attr->parent_out, &attr->child_out, + bAsyncRead, bAsyncWrite, + attr->cntxt)) != APR_SUCCESS) { + return stat; } } if (err) { - if ((stat = ap_create_pipe(&attr->parent_err, &attr->child_err, - attr->cntxt)) != APR_SUCCESS) { - return stat; - } switch (err) { case APR_FULL_BLOCK: + bAsyncRead = bAsyncWrite = FALSE; break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_err, 0); + bAsyncRead = FALSE; + bAsyncWrite = TRUE; break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_err, 0); + bAsyncRead = TRUE; + bAsyncWrite = FALSE; break; default: - ap_set_pipe_timeout(attr->child_err, 0); - ap_set_pipe_timeout(attr->parent_err, 0); + bAsyncRead = TRUE; + bAsyncWrite = TRUE; + } + if ((stat = ap_create_nt_pipe(&attr->parent_err, &attr->child_err, + bAsyncRead, bAsyncWrite, + attr->cntxt)) != APR_SUCCESS) { + return stat; } } return APR_SUCCESS; @@ -337,15 +350,15 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, } else { if (attr->child_in) { - ap_close(attr->parent_in); + CloseHandle(attr->parent_in->filehand); attr->parent_in->filehand = hParentindup; } if (attr->child_out) { - ap_close(attr->parent_out); + CloseHandle(attr->parent_out->filehand); attr->parent_out->filehand = hParentoutdup; } if (attr->child_err) { - ap_close(attr->parent_err); + CloseHandle(attr->parent_err->filehand); attr->parent_err->filehand = hParenterrdup; } } From e8745ed0dd9b2392e0fd3452fd1f5bc7cf8b1337 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 3 Jul 2000 11:32:48 +0000 Subject: [PATCH 0316/7878] Bring beos back into line following the changes to iol_socket. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60291 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/sockopt.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/network_io/beos/sockopt.c b/network_io/beos/sockopt.c index 333898a8d84..87542f22003 100644 --- a/network_io/beos/sockopt.c +++ b/network_io/beos/sockopt.c @@ -58,7 +58,7 @@ #else #include "networkio.h" -int setnonblocking(int on, int sock) +static int setnonblocking(int on, int sock) { return setsockopt(sock, SOL_SOCKET, SO_NONBLOCK, &on, sizeof(on)); @@ -110,6 +110,18 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) return APR_SUCCESS; } +ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) +{ + switch(opt) { + case APR_SO_TIMEOUT: + *on = sock->timeout; + break; + default: + return APR_EINVAL; + } + return APR_SUCCESS; +} + ap_status_t ap_gethostname(char * buf, int len, ap_pool_t *cont) { if (gethostname(buf, len) == -1){ From 5c25a91da2765af51bfecd86ccbeb9074ed8e807 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 3 Jul 2000 12:06:38 +0000 Subject: [PATCH 0317/7878] add ap_finfo_t.device add ap_setfileperms() for setting file permissions (chmod cover). - OS/2 and Win32 currently return APR_ENOTIMPL fix the file perm handling in APR: some conversion between ap_fileperms_t and mode_t was not occurring; adding new conversion function; renamed old conversion func. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60292 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filestat.c | 5 +++ file_io/unix/dir.c | 2 +- file_io/unix/fileacc.c | 70 ++++++++++++++++++++++++++------------ file_io/unix/fileio.h | 4 ++- file_io/unix/filestat.c | 16 +++++++-- file_io/unix/open.c | 2 +- file_io/unix/pipe.c | 2 +- file_io/win32/filestat.c | 6 ++++ include/apr_file_io.h | 26 ++++++++++++-- include/arch/unix/fileio.h | 4 ++- 10 files changed, 105 insertions(+), 32 deletions(-) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 429686c2822..96d0deb2d3c 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -73,6 +73,7 @@ static void FS3_to_finfo(ap_finfo_t *finfo, FILESTATUS3 *fstatus) finfo->user = 0; finfo->group = 0; finfo->inode = 0; + finfo->device = 0; finfo->size = fstatus->cbFile; ap_os2_time_to_ap_time(&finfo->atime, fstatus->fdateLastAccess, fstatus->ftimeLastAccess ); ap_os2_time_to_ap_time(&finfo->mtime, fstatus->fdateLastWrite, fstatus->ftimeLastWrite ); @@ -136,6 +137,10 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) return APR_OS2_STATUS(rc); } +ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms) +{ + return APR_ENOTIMPL; +} ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 9d39d893d02..8791620e953 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -142,7 +142,7 @@ ap_status_t ap_rewinddir(ap_dir_t *thedir) ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, ap_pool_t *cont) { - mode_t mode = ap_unix_get_fileperms(perm); + mode_t mode = ap_unix_perms2mode(perm); if (mkdir(path, mode) == 0) { return APR_SUCCESS; diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 32a574dc3cc..4723aada9fa 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -82,32 +82,60 @@ ap_status_t ap_get_filename(char **new, ap_file_t *thefile) } #if !defined(OS2) && !defined(WIN32) -mode_t ap_unix_get_fileperms(ap_fileperms_t mode) +mode_t ap_unix_perms2mode(ap_fileperms_t perms) { - mode_t rv = 0; + mode_t mode = 0; - if (mode & APR_UREAD) - rv |= S_IRUSR; - if (mode & APR_UWRITE) - rv |= S_IWUSR; - if (mode & APR_UEXECUTE) - rv |= S_IXUSR; + if (perms & APR_UREAD) + mode |= S_IRUSR; + if (perms & APR_UWRITE) + mode |= S_IWUSR; + if (perms & APR_UEXECUTE) + mode |= S_IXUSR; - if (mode & APR_GREAD) - rv |= S_IRGRP; - if (mode & APR_GWRITE) - rv |= S_IWGRP; - if (mode & APR_GEXECUTE) - rv |= S_IXGRP; + if (perms & APR_GREAD) + mode |= S_IRGRP; + if (perms & APR_GWRITE) + mode |= S_IWGRP; + if (perms & APR_GEXECUTE) + mode |= S_IXGRP; - if (mode & APR_WREAD) - rv |= S_IROTH; - if (mode & APR_WWRITE) - rv |= S_IWOTH; - if (mode & APR_WEXECUTE) - rv |= S_IXOTH; + if (perms & APR_WREAD) + mode |= S_IROTH; + if (perms & APR_WWRITE) + mode |= S_IWOTH; + if (perms & APR_WEXECUTE) + mode |= S_IXOTH; - return rv; + return mode; +} + +ap_fileperms_t ap_unix_mode2perms(mode_t mode) +{ + ap_fileperms_t perms = 0; + + if (mode & S_IRUSR) + perms |= APR_UREAD; + if (mode & S_IWUSR) + perms |= APR_UWRITE; + if (mode & S_IXUSR) + perms |= APR_UEXECUTE; + + if (mode & S_IRGRP) + perms |= APR_GREAD; + if (mode & S_IWGRP) + perms |= APR_GWRITE; + if (mode & S_IXGRP) + perms |= APR_GEXECUTE; + + if (mode & S_IROTH) + perms |= APR_WREAD; + if (mode & S_IWOTH) + perms |= APR_WWRITE; + if (mode & S_IXOTH) + perms |= APR_WEXECUTE; + + return perms; } #endif diff --git a/file_io/unix/fileio.h b/file_io/unix/fileio.h index 06e38ee84e3..c91bb453d25 100644 --- a/file_io/unix/fileio.h +++ b/file_io/unix/fileio.h @@ -143,7 +143,9 @@ struct ap_dir_t { }; ap_status_t ap_unix_file_cleanup(void *); -mode_t ap_unix_get_fileperms(ap_fileperms_t); + +mode_t ap_unix_perms2mode(ap_fileperms_t perms); +ap_fileperms_t ap_unix_mode2perms(mode_t mode); #endif /* ! FILE_IO_H */ diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 7ed8a238f75..8f593b8dfd1 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -85,12 +85,13 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) struct stat info; if (fstat(thefile->filedes, &info) == 0) { - finfo->protection = info.st_mode; + finfo->protection = ap_unix_mode2perms(info.st_mode); finfo->filetype = filetype_from_mode(info.st_mode); finfo->user = info.st_uid; finfo->group = info.st_gid; finfo->size = info.st_size; finfo->inode = info.st_ino; + finfo->device = info.st_dev; ap_ansi_time_to_ap_time(&finfo->atime, info.st_atime); ap_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); ap_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); @@ -101,12 +102,21 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) } } +ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms) +{ + mode_t mode = ap_unix_perms2mode(perms); + + if (chmod(fname, mode) == -1) + return errno; + return APR_SUCCESS; +} + ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) { struct stat info; if (stat(fname, &info) == 0) { - finfo->protection = info.st_mode; + finfo->protection = ap_unix_mode2perms(info.st_mode); finfo->filetype = filetype_from_mode(info.st_mode); finfo->user = info.st_uid; finfo->group = info.st_gid; @@ -127,7 +137,7 @@ ap_status_t ap_lstat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) struct stat info; if (lstat(fname, &info) == 0) { - finfo->protection = info.st_mode; + finfo->protection = ap_unix_mode2perms(info.st_mode); finfo->filetype = filetype_from_mode(info.st_mode); finfo->user = info.st_uid; finfo->group = info.st_gid; diff --git a/file_io/unix/open.c b/file_io/unix/open.c index ce5731e5e0f..a461363709c 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -145,7 +145,7 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil (*new)->filedes = open(fname, oflags, 0666); } else { - (*new)->filedes = open(fname, oflags, ap_unix_get_fileperms(perm)); + (*new)->filedes = open(fname, oflags, ap_unix_perms2mode(perm)); } if ((*new)->filedes < 0) { diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index f68fcbcf75d..97bbf72ee54 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -183,7 +183,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, ap_pool_t *cont) { - mode_t mode = ap_unix_get_fileperms(perm); + mode_t mode = ap_unix_perms2mode(perm); if (mkfifo(filename, mode) == -1) { return errno; diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index f81b09f8c6b..f66fbf936bb 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -130,6 +130,7 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) finfo->user = 0; finfo->group = 0; finfo->inode = 0; + finfo->device = 0; /* ### use drive letter - 'A' ? */ /* Filetype - Directory or file: this case _will_ never happen */ if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { @@ -181,6 +182,11 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) return APR_SUCCESS; } +ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms) +{ + return APR_ENOTIMPL; +} + ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) { /* WIN32_FILE_ATTRIBUTE_DATA is an exact subset of the first diff --git a/include/apr_file_io.h b/include/apr_file_io.h index de5e6708fe6..5d24972b9eb 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -111,6 +111,7 @@ typedef ap_int32_t ap_fileperms_t; typedef uid_t ap_uid_t; typedef gid_t ap_gid_t; typedef ino_t ap_ino_t; +typedef dev_t ap_dev_t; struct ap_finfo_t { ap_fileperms_t protection; @@ -118,6 +119,7 @@ struct ap_finfo_t { ap_uid_t user; ap_gid_t group; ap_ino_t inode; + ap_dev_t device; ap_off_t size; ap_time_t atime; ap_time_t mtime; @@ -362,7 +364,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile); B arg 1) The string to write. - arg 2) The file descriptor to write to from + arg 2) The file descriptor to write to =cut */ @@ -402,10 +404,10 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p); =head1 ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) -B +B arg 1) Where to store the information about the file. - arg 2) The file to get information about. + arg 2) The file to get information about. =cut */ @@ -413,6 +415,24 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile); /* +=head1 ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms) + +B + + arg 1) The file (name) to apply the permissions to. + arg 2) The permission bits to apply to the file. + + Some platforms may not be able to apply all of the available permission + bits; APR_INCOMPLETE will be returned if some permissions are specified + which could not be set. + + Platforms which do not implement this feature will return APR_ENOTIMPL. +=cut + */ +ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms); + +/* + =head1 ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) B diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 06e38ee84e3..c91bb453d25 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -143,7 +143,9 @@ struct ap_dir_t { }; ap_status_t ap_unix_file_cleanup(void *); -mode_t ap_unix_get_fileperms(ap_fileperms_t); + +mode_t ap_unix_perms2mode(ap_fileperms_t perms); +ap_fileperms_t ap_unix_mode2perms(mode_t mode); #endif /* ! FILE_IO_H */ From 48528ce680c9341b50abf89910e503f65ff548b3 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 3 Jul 2000 22:08:30 +0000 Subject: [PATCH 0318/7878] set finfo->device in ap_stat and ap_lstat too. Submitted by: Joe Orton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60293 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 8f593b8dfd1..5085901ba14 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -122,6 +122,7 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) finfo->group = info.st_gid; finfo->size = info.st_size; finfo->inode = info.st_ino; + finfo->device = info.st_dev; ap_ansi_time_to_ap_time(&finfo->atime, info.st_atime); ap_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); ap_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); @@ -143,6 +144,7 @@ ap_status_t ap_lstat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) finfo->group = info.st_gid; finfo->size = info.st_size; finfo->inode = info.st_ino; + finfo->device = info.st_dev; ap_ansi_time_to_ap_time(&finfo->atime, info.st_atime); ap_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); ap_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); From eb76c8dd60c4e794fa1bab1877952df5c42a0445 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 4 Jul 2000 23:50:16 +0000 Subject: [PATCH 0319/7878] Begin to document the error codes in APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60294 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 53 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/include/apr_errno.h b/include/apr_errno.h index 49f62964f85..fa7d818fc88 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -52,6 +52,59 @@ * . */ +/* + +=head1 APR ERROR CODES + + APR_ENOSTAT APR was unable to perform a stat on the file + APR_ENOPOOL APR was not provided a pool with which to allocate memory + APR_EBADDATE APR was given an invalid date + APR_EINVALSOCK APR was given an invalid socket + APR_ENOFILE APR was not give a file structure + APR_ENOPROC APR was not given a process structure + APR_ENOTIME APR was not given a time structure + APR_ENODIR APR was not given a directory structure + APR_ENOLOCK APR was not given a lock structure + APR_ENOPOLL APR was not given a poll structure + APR_ENOSOCKET APR was not given a socket + APR_ENOTHREAD APR was nto given a thread structure + APR_ENOTHDKEY APR was not given a thread key structure + APR_ENOSHMAVAIL There is no more shared memory available + APR_EDSOOPEN APR was unable to open the dso object. For more + information consult ap_dso_error. + +=head1 APR STATUS CODES + + APR_INCHILD Program is currently executing in the child + APR_INPARENT Program is currently executing in the parent + APR_DETACH The thread is detached + APR_NOTDETACH The thread is not detached + APR_CHILD_DONE The child has finished executing + APR_CHILD_NOTDONE The child has not finished executing + APR_TIMEUP The operation did not finish before the timeout + APR_INCOMPLETE The character conversion stopped because of an + incomplete character or shift sequence at the end of + the input buffer. + APR_BADCH Getopt found an option not in the option string + APR_BADARG Getopt found an option that is missing an argument and + and argument was specified in the option string + APR_EOF APR has encountered the end of the file + APR_NOTFOUND APR was unable to find the socket in the poll structure + APR_ANONYMOUS APR is using anonymous shared memory + APR_FILEBASED APR is using a file name as the key to the shared memory + APR_KEYBASED APR is using a shared key as the key to the shared + memory + APR_EINIT Ininitalizer value. If no option has been found, but + the status variable requires a value, this should be + used + APR_ENOTIMPL The APR function has not been implemented on this + platform, either because nobody has gotten to it yet, + or the function is impossible on this platform. + APR_EMISMATCH Two passwords do not match. + +=cut + */ + #ifndef APR_ERRNO_H #define APR_ERRNO_H From ceda55f5a13f7c57be9f75a308cd2d5bf955a399 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 5 Jul 2000 00:12:44 +0000 Subject: [PATCH 0320/7878] Document apr_fnmatch.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60295 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_fnmatch.h | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index ba27efd1c18..beb99c7a3c0 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -1,4 +1,4 @@ -/*- +/* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * @@ -49,12 +49,38 @@ extern "C" { #define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ #define FNM_PERIOD 0x04 /* Period must be matched by period. */ /* This flag is an Apache addition */ -#define FNM_CASE_BLIND 0x08 /* Compare characters case ap_pool_t nsensitively. */ +#define FNM_CASE_BLIND 0x08 /* Compare characters case-insensitively. */ + +/* + +=head1 ap_status_t ap_fnmatch(const char *pattern, const char *strings, int flags) + +B + + arg 1) The pattern to match to + arg 2) The string we are trying to match + arg 3) flags to use in the match. Bitwise OR of: + FNM_NOESCAPE -- Disable backslash escaping + FNM_PATHNAME -- Slash must be matched by slash + FNM_PERIOD -- Period must be matched by period + FNM_CASE_BLIND -- Compare characters case-insensitively. + +=cut + */ APR_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *strings, int flags); -/* this function is an Apache addition */ +/* + +=head1 ap_status_t ap_is_fnmatch(const char *pattern) + +B + + arg 1) The pattern to search for glob characters. + +=cut + */ APR_EXPORT(int) ap_is_fnmatch(const char *pattern); #ifdef __cplusplus From 5d970454ac98cb9daea8d1edf84dbe1ccce4b10a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 5 Jul 2000 00:58:38 +0000 Subject: [PATCH 0321/7878] Document the MD5 functions in APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60296 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_md5.h | 61 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/include/apr_md5.h b/include/apr_md5.h index 25586c1d81c..dc3dba9e698 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -107,17 +107,78 @@ typedef struct { #endif } ap_md5_ctx_t; +/* + +=head1 ap_status_t ap_MD5Init(ap_md5_ctx_t *context) + +B + + arg 1) The MD5 context to initialize. + +=cut + */ APR_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context); + +/* + +=head1 ap_status_t ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) + +B + + arg 1) The MD5 content to set the translation for. + arg 2) The translation handle to use for this MD5 context + +=cut + */ #if APR_HAS_XLATE APR_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate); #else #define ap_MD5SetXlate(context, xlate) APR_ENOTIMPL #endif + +/* + +=head1 ap_status_t ap_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) + +B + + arg 1) The MD5 content to update. + arg 2) next message block to update + arg 3) The length of the next message block + +=cut + */ APR_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen); + +/* + +=head1 ap_status_t ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE, ap_md5_ctx_t *context) + +B + + arg 1) The final MD5 digest + arg 2) The MD5 content we are finalizing. + +=cut + */ APR_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], ap_md5_ctx_t *context); + +/* + +=head1 ap_status_t ap_MD5Encode(unsigned char *passwd, const char *salt, char *result, size_t nbytes) + +B + + arg 1) The password to encode + arg 2) The salt to use for the encoding + arg 3) The string to store the encoded password in + arg 4) The length of the string + +=cut + */ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes); From 2fe547c6ba66e8b30f7c8df1091fc61c836ba273 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 5 Jul 2000 01:10:23 +0000 Subject: [PATCH 0322/7878] Document the strnatcmp functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60297 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strnatcmp.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/apr_strnatcmp.h b/include/apr_strnatcmp.h index c65f6dfb6d5..fd0f93016dd 100644 --- a/include/apr_strnatcmp.h +++ b/include/apr_strnatcmp.h @@ -27,7 +27,36 @@ extern "C" { #endif /* __cplusplus */ +/* + +=head1 int ap_strnatcmp(char const *a, char const *b) + +B + + arg 1) The first string to compare + arg 2) The second string to compare + return) Either <0, 0, or >0. If the first string is less than the second + this returns <0, if they are equivalent it returns 0, and if the + first string is greater than second string it retuns >0. + +=cut + */ int ap_strnatcmp(char const *a, char const *b); + +/* + +=head1 int ap_strnatcmp(char const *a, char const *b) + +B + + arg 1) The first string to compare + arg 2) The second string to compare + return) Either <0, 0, or >0. If the first string is less than the second + this returns <0, if they are equivalent it returns 0, and if the + first string is greater than second string it retuns >0. + +=cut + */ int ap_strnatcasecmp(char const *a, char const *b); #ifdef __cplusplus From c8583a05c7a984594265e4d0cb67e91da128a3cf Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 5 Jul 2000 01:16:49 +0000 Subject: [PATCH 0323/7878] No file is actuall including apr_signal.h, and all it defines is a simple type. Off to the attic with you. :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60298 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_signal.h | 73 -------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 include/apr_signal.h diff --git a/include/apr_signal.h b/include/apr_signal.h deleted file mode 100644 index 34f02ce3737..00000000000 --- a/include/apr_signal.h +++ /dev/null @@ -1,73 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_SIGNAL_H -#define APR_SIGNAL_H - -#include "apr_general.h" -#include "apr_errno.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef int ap_signum_t; - -#ifdef __cplusplus -} -#endif - -#endif /* ! APR_SIGNAL_H */ - - From e1814674ed23e15a7be195eb7cc830e8077e0e62 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 5 Jul 2000 04:23:16 +0000 Subject: [PATCH 0324/7878] Document apr_lib.h and do some cleanup. This moves the definition of the rest of the pool functions to apr_pools.h where they belong. This also starts to document that file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60299 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 221 ++++++++++++++++++++++++++++++++++---------- include/apr_pools.h | 117 ++++++++++++++++++++++- 2 files changed, 285 insertions(+), 53 deletions(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index 5c3960f8385..9aad9405f79 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -55,6 +55,8 @@ #ifndef APR_LIB_H #define APR_LIB_H +#include "apr.h" +#include "apr_pools.h" #include "apr_general.h" #include "apr_tables.h" #include "apr_file_io.h" @@ -85,27 +87,81 @@ typedef struct ap_vformatter_buff_t { char *endpos; } ap_vformatter_buff_t; -enum kill_conditions { - kill_never, /* process is never sent any signals */ - kill_always, /* process is sent SIGKILL on ap_pool_t cleanup */ - kill_after_timeout, /* SIGTERM, wait 3 seconds, SIGKILL */ - just_wait, /* wait forever for the process to complete */ - kill_only_once /* send SIGTERM and then wait */ -}; - /* - * Define the prototypes for the various APR GP routines. + +=head1 ap_status_t ap_tokenize_to_argv(const char **arg_str, char ***argv_out, ap_pool_t *token_context) + +B + + arg 1) The arguments to convert + arg 2) Output location. This is a pointer to an array of strings. + arg 3) Pool to use. + +=cut */ -APR_EXPORT(char *) ap_cpystrn(char *d, const char *s, size_t l); APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, char ***argv_out, ap_pool_t *token_context); + +/* + +=head1 ap_status_t ap_filename_of_pathname(const char *pathname) + +B + + arg 1) The path to get the final element of + +B: Examples: "/foo/bar/gum" -> "gum" + "/foo/bar/gum/" -> "" + "gum" -> "gum" + "wi\\n32\\stuff" -> "stuff" + +=cut + */ APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); + + +/* + +=head1 ap_status_t ap_collapse_spaces(char *dest, const char *src) + +B + + arg 1) The destination string. It is okay to modify the string + in place. Namely dest == src + arg 2) The string to rid the spaces from. + +=cut + */ APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src); -/*APR_EXPORT(ap_mutex_t *) ap_create_mutex(void *m);*/ -APR_EXPORT(int) ap_slack(int l, int h); +/* + +=head1 ap_status_t ap_execle(const char *c, const char *a, ...) + +B + + arg 1) The path to the new program to run + arg 2) The first argument for the new program + ...) The rest of the arguments for the new program. + +=cut + */ APR_EXPORT_NONSTD(ap_status_t) ap_execle(const char *c, const char *a, ...); + +/* + +=head1 ap_status_t ap_execve(const char *c, const char *aargv[], const char *envp[]) + +B + + arg 1) The path to the new program to run + arg 2) The arguments for the new program in an array of char *. + arg 3) The environment for the new program in an array of char * of the + form key=value + +=cut + */ APR_EXPORT_NONSTD(ap_status_t) ap_execve(const char *c, const char *argv[], const char *envp[]); @@ -193,13 +249,38 @@ APR_EXPORT_NONSTD(ap_status_t) ap_execve(const char *c, const char *argv[], * or until ap_vformatter returns. */ +/* + +=head1 int ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b), ap_vformatter_buff_t *c, const char *fmt, va_list ap) + +B + + arg 1) The function to call when the buffer is full + arg 2) The buffer to write to + arg 3) The format string + arg 4) The arguments to use to fill out the format string. + +B: The extensions are: + %pA takes a struct in_addr *, and prints it as a.b.c.d + %pI takes a struct sockaddr_in * and prints it as a.b.c.d:port + %pp takes a void * and outputs it in hex + +=cut + */ APR_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b), ap_vformatter_buff_t *c, const char *fmt, va_list ap); +/* + +=head1 ap_status_t ap_validate_password(const char *passwd, const char *hash) + +B -/* A small routine to validate a plain text password with a password - * that has been encrypted using any algorithm APR knows about. + arg 1) The password to validate + arg 2) The password to validate against + +=cut */ APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *hash); @@ -220,55 +301,93 @@ APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *has * to distinguish between an output which was truncated, and an output which * exactly filled the buffer. */ + +/* + +=head1 int ap_snprintf(char *buf, size_t len, const char *format, ...) + +B + + arg 1) The buffer to write to + arg 2) The size of the buffer + arg 3) The format string + arg 4) The arguments to use to fill out the format string. + +=cut + */ APR_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format, ...) __attribute__((format(printf,3,4))); + +/* + +=head1 int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap) + +B + + arg 1) The buffer to write to + arg 2) The size of the buffer + arg 3) The format string + arg 4) The arguments to use to fill out the format string. + +=cut + */ APR_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap); /* - * APR memory structure manipulators (pools, tables, and arrays). - */ -APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)); -APR_EXPORT(void) ap_clear_pool(struct ap_pool_t *p); -APR_EXPORT(void) ap_destroy_pool(struct ap_pool_t *p); -APR_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p); -APR_EXPORT(long) ap_bytes_in_free_blocks(void); -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts); -APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); -APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub); - -/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t will not be - * destroyed before the parent pool + +=head1 ap_status_t ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize) + +B + + arg 1) The prompt to display + arg 2) Where to store the password + arg 3) The length of the password string. + +=cut */ -#ifndef POOL_DEBUG -#ifdef ap_pool_join -#undef ap_pool_join -#endif /* ap_pool_join */ -#define ap_pool_join(a,b) -#endif /* POOL_DEBUG */ - - -APR_EXPORT(void *) ap_palloc(struct ap_pool_t *c, int reqsize); -APR_EXPORT(void *) ap_pcalloc(struct ap_pool_t *p, int size); -APR_EXPORT(char *) ap_pstrdup(struct ap_pool_t *p, const char *s); -APR_EXPORT(char *) ap_pstrndup(struct ap_pool_t *p, const char *s, int n); -APR_EXPORT_NONSTD(char *) ap_pstrcat(struct ap_pool_t *p, ...); -APR_EXPORT(char *) ap_pvsprintf(struct ap_pool_t *p, const char *fmt, va_list ap); -APR_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *p, const char *fmt, ...); -APR_EXPORT(void) ap_register_cleanup(struct ap_pool_t *p, void *data, - ap_status_t (*plain_cleanup) (void *), - ap_status_t (*child_cleanup) (void *)); -APR_EXPORT(void) ap_kill_cleanup(struct ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)); -APR_EXPORT(ap_status_t) ap_run_cleanup(struct ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)); -APR_EXPORT(void) ap_cleanup_for_exec(void); APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize); -APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data); +/* + +=head1 ap_status_t ap_note_subprocess(ap_pool_t *a, ap_proc_t *pid, enum kill_conditions how) + +B + + arg 1) The pool to use to define the processes lifetime + arg 2) The process to register + arg 3) How to kill the process, one of: + kill_never -- process is never sent any signals + kill_always -- process is sent SIGKILL on ap_pool_t cleanup + kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL + just_wait -- wait forever for the process to complete + kill_only_once -- send SIGTERM and then wait + +=cut + */ APR_EXPORT(void) ap_note_subprocess(struct ap_pool_t *a, ap_proc_t *pid, enum kill_conditions how); +/* + +=head1 char *ap_cpystrn(char *dst, const char *src, size_t dst_size) + +B + + arg 1) The destination string + arg 2) The source string + arg 3) The number of characters to copy + +B: We re-implement this function to implement these specific changes: + 1) strncpy() doesn't always null terminate and we want it to. + 2) strncpy() null fills, which is bogus, esp. when copy 8byte strings + into 8k blocks. + 3) Instead of returning the pointer to the beginning of the + destination string, we return a pointer to the terminating '\0' + to allow us to check for truncation. + +=cut + */ APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size); #ifdef __cplusplus diff --git a/include/apr_pools.h b/include/apr_pools.h index 77293bd66fd..4fe34c7b268 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -80,11 +80,23 @@ extern "C" { * alloc.c. */ -#include "apr_lib.h" +#include "apr.h" +#include "apr_thread_proc.h" #if APR_HAVE_SYS_TYPES_H #include #endif +#if APR_HAVE_STDARG_H +#include +#endif + +enum kill_conditions { + kill_never, /* process is never sent any signals */ + kill_always, /* process is sent SIGKILL on ap_pool_t cleanup */ + kill_after_timeout, /* SIGTERM, wait 3 seconds, SIGKILL */ + just_wait, /* wait forever for the process to complete */ + kill_only_once /* send SIGTERM and then wait */ +}; struct process_chain { ap_proc_t *pid; @@ -176,11 +188,112 @@ APR_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *, const char *fmt, ...) #define BLOCK_MINALLOC 8192 #endif -/* Finally, some accounting */ +/* + * APR memory structure manipulators (pools, tables, and arrays). + */ +/* + +=head1 ap_pool_t *ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) + +B + + arg 1) The pool to use as a parent pool + arg 2) A function to use if the pool cannot allocate more memory. + return) The new sub-pool + +B: The apr_abort function provides a way to quit the program if the + machine is out of memory. By default, APR will return with an + error. + +=cut + */ +APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)); + +/* + +=head1 void ap_clear_pool(ap_pool_t *p) + +B + + arg 1) The pool to clear + +B: This does not actually free the memory, it just allows the pool + to re-use this memory for the next allocation. + +=cut + */ +APR_EXPORT(void) ap_clear_pool(struct ap_pool_t *p); + +/* + +=head1 void ap_destroy_pool(ap_pool_t *p) + +B + + arg 1) The pool to destroy +B: This will actually free the memory + +=cut + */ +APR_EXPORT(void) ap_destroy_pool(struct ap_pool_t *p); + +/* + +=head1 long *ap_bytes_in_pool(ap_pool_t *p) + +B + + arg 1) The pool to inspect + return) The number of bytes + +=cut + */ APR_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p); + +/* + +=head1 long *ap_bytes_in_free_blocks(ap_pool_t *p) + +B + + return) The number of bytes + +=cut + */ APR_EXPORT(long) ap_bytes_in_free_blocks(void); +APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); + +APR_EXPORT(void *) ap_palloc(struct ap_pool_t *c, int reqsize); +APR_EXPORT(void *) ap_pcalloc(struct ap_pool_t *p, int size); +APR_EXPORT(char *) ap_pstrdup(struct ap_pool_t *p, const char *s); +APR_EXPORT(char *) ap_pstrndup(struct ap_pool_t *p, const char *s, int n); +APR_EXPORT_NONSTD(char *) ap_pstrcat(struct ap_pool_t *p, ...); +APR_EXPORT(char *) ap_pvsprintf(struct ap_pool_t *p, const char *fmt, va_list ap); +APR_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *p, const char *fmt, ...); +APR_EXPORT(void) ap_register_cleanup(struct ap_pool_t *p, void *data, + ap_status_t (*plain_cleanup) (void *), + ap_status_t (*child_cleanup) (void *)); +APR_EXPORT(void) ap_kill_cleanup(struct ap_pool_t *p, void *data, + ap_status_t (*cleanup) (void *)); +APR_EXPORT(ap_status_t) ap_run_cleanup(struct ap_pool_t *p, void *data, + ap_status_t (*cleanup) (void *)); +APR_EXPORT(void) ap_cleanup_for_exec(void); +APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize); +APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data); + + +/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t will not be + * destroyed before the parent pool + */ +#ifndef POOL_DEBUG +#ifdef ap_pool_join +#undef ap_pool_join +#endif /* ap_pool_join */ +#define ap_pool_join(a,b) +#endif /* POOL_DEBUG */ + #ifdef __cplusplus } #endif From 8d15d4406dd535d24e1adbbfcaa816ca75b07cff Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 5 Jul 2000 16:32:29 +0000 Subject: [PATCH 0325/7878] Add a needed header file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60300 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 79986544358..fe98e55a986 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -53,6 +53,7 @@ */ #include "misc.h" +#include "apr_lib.h" #include "apr_dso.h" #ifdef HAVE_NETDB_H From f0eece9278b3085648f768b948c6bb544196497c Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 5 Jul 2000 19:17:52 +0000 Subject: [PATCH 0326/7878] Document apr_pools.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60301 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 160 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 155 insertions(+), 5 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 4fe34c7b268..5579fada646 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -124,11 +124,6 @@ APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode * buffers, *don't* wait for subprocesses, and *don't* free any memory. */ -/* routines to allocate memory from an pool... */ - -APR_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *, const char *fmt, ...) - __attribute__((format(printf,2,3))); - /* array and alist management... keeping lists of things. * Common enough to want common support code ... */ @@ -263,22 +258,177 @@ B */ APR_EXPORT(long) ap_bytes_in_free_blocks(void); +/* + +=head1 ap_pool_t *ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) + +B + + arg 1) The pool to search + arg 2) The pool to search for + return) True if a is an ancestor of b, NULL is considered an ancestor + of all pools. + +=cut + */ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); +/* + +=head1 void *ap_palloc(ap_pool_t *c, int reqsize) + +B + + arg 1) The pool to allocate out of + arg 2) The amount of memory to allocate + return) The allocated memory + +=cut + */ APR_EXPORT(void *) ap_palloc(struct ap_pool_t *c, int reqsize); + +/* + +=head1 void *ap_pcalloc(ap_pool_t *c, int reqsize) + +B + + arg 1) The pool to allocate out of + arg 2) The amount of memory to allocate + return) The allocated memory + +=cut + */ APR_EXPORT(void *) ap_pcalloc(struct ap_pool_t *p, int size); + +/* + +=head1 char *ap_pstrdup(ap_pool_t *c, const char *s) + +B + + arg 1) The pool to allocate out of + arg 2) The string to allocate + return) The new string + +=cut + */ APR_EXPORT(char *) ap_pstrdup(struct ap_pool_t *p, const char *s); + +/* + +=head1 char *ap_pstrndup(ap_pool_t *c, const char *s, int n) + +B + + arg 1) The pool to allocate out of + arg 2) The string to allocate + arg 3) The number of characters to duplicate + return) The new string + +=cut + */ APR_EXPORT(char *) ap_pstrndup(struct ap_pool_t *p, const char *s, int n); + +/* + +=head1 char *ap_pstrcat(ap_pool_t *c, ...) + +B + + arg 1) The pool to allocate out of + ...) The strings to concatenate. The final string must be NULL + return) The new string + +=cut + */ APR_EXPORT_NONSTD(char *) ap_pstrcat(struct ap_pool_t *p, ...); + +/* + +=head1 char *ap_pvsprintf(ap_pool_t *c, const char *fmt, va_list ap) + +B + + arg 1) The pool to allocate out of + arg 2) The format of the string + arg 3) The arguments to use while printing the data + return) The new string + +=cut + */ APR_EXPORT(char *) ap_pvsprintf(struct ap_pool_t *p, const char *fmt, va_list ap); + +/* + +=head1 char *ap_psprintf(ap_pool_t *c, const char *fmt, ...) + +B + + arg 1) The pool to allocate out of + arg 2) The format of the string + ...) The arguments to use while printing the data + return) The new string + +=cut + */ APR_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *p, const char *fmt, ...); + +/* + +=head1 void ap_register_cleanup(ap_pool_t *p, void *data, ap_status_t (*plain_cleanup(void *), ap_status_t (*child_cleanup)(void *)) + +B + + arg 1) The pool register the cleanup with + arg 2) The data to pass to the cleanup function. + arg 3) The function to call when the pool is cleared or destroyed + arg 4) The function to call when a child process is created + +=cut + */ APR_EXPORT(void) ap_register_cleanup(struct ap_pool_t *p, void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)); + +/* + +=head1 void ap_kill_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup(void *)) + +B + + arg 1) The pool remove the cleanup from + arg 2) The data to remove from cleanup + arg 3) The function to remove from cleanup + +=cut + */ APR_EXPORT(void) ap_kill_cleanup(struct ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)); + +/* + +=head1 ap_status_t ap_run_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup(void *)) + +B + + arg 1) The pool remove the cleanup from + arg 2) The data to remove from cleanup + arg 3) The function to remove from cleanup + +=cut + */ APR_EXPORT(ap_status_t) ap_run_cleanup(struct ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)); + +/* + +=head1 void ap_cleanup_for_exec(void) + +B + +=cut + */ APR_EXPORT(void) ap_cleanup_for_exec(void); APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize); APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data); From b04bc959de7dd440b7bc204d8e6da874be640a87 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 5 Jul 2000 20:22:25 +0000 Subject: [PATCH 0327/7878] Clean up apr_pools.h. This basically moves a lot of comments from the top of apr_pools.h to other headers where they belong. Now, comments for a function are near the function they document. Also, remove some duplicated definitions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60302 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 86 ++++++++++++++++---------------------------- include/apr_tables.h | 35 ++++++++++++++++++ 2 files changed, 66 insertions(+), 55 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 5579fada646..603b5e47ebc 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -104,11 +104,8 @@ struct process_chain { struct process_chain *next; }; -ap_status_t ap_init_alloc(void); /* Set up everything */ -void ap_term_alloc(void); /* Tear down everything */ - -/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t will not be - * destroyed before the parent pool +/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t + * will not be destroyed before the parent pool */ #ifndef POOL_DEBUG APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts); @@ -117,56 +114,6 @@ APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, int (apr_abort)(int r APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode)); #endif /* POOL_DEBUG */ - -/* Clearing out EVERYTHING in an pool... destroys any sub-pools */ - -/* Preparing for exec() --- close files, etc., but *don't* flush I/O - * buffers, *don't* wait for subprocesses, and *don't* free any memory. - */ - -/* array and alist management... keeping lists of things. - * Common enough to want common support code ... - */ - -/* ap_array_pstrcat generates a new string from the ap_pool_t containing - * the concatenated sequence of substrings referenced as elements within - * the array. The string will be empty if all substrings are empty or null, - * or if there are no elements in the array. - * If sep is non-NUL, it will be inserted between elements as a separator. - */ - -/* copy_array copies the *entire* array. copy_array_hdr just copies - * the header, and arranges for the elements to be copied if (and only - * if) the code subsequently does a push or arraycat. - */ - - - -/* Conceptually, ap_overlap_tables does this: - - ap_array_header_t *barr = ap_table_elts(b); - ap_table_entry_t *belt = (ap_table_entry_t *)barr->elts; - int i; - - for (i = 0; i < barr->nelts; ++i) { - if (flags & ap_OVERLAP_TABLES_MERGE) { - ap_table_mergen(a, belt[i].key, belt[i].val); - } - else { - ap_table_setn(a, belt[i].key, belt[i].val); - } - } - - Except that it is more efficient (less space and cpu-time) especially - when b has many elements. - - Notice the assumptions on the keys and values in b -- they must be - in an ancestor of a's pool. In practice b and a are usually from - the same pool. -*/ -#define ap_OVERLAP_TABLES_SET (0) -#define ap_OVERLAP_TABLES_MERGE (1) - #ifdef ULTRIX_BRAIN_DEATH #define ap_fdopen(d,m) fdopen((d), (char *)(m)) #else @@ -186,6 +133,32 @@ APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode /* * APR memory structure manipulators (pools, tables, and arrays). */ + +/* + +=head1 ap_status_t ap_init_alloc(void) + +B + +B: Programs do B need to call this directly. APR will call this + automatically from ap_initialize. +=cut + */ +ap_status_t ap_init_alloc(void); /* Set up everything */ + +/* + +=head1 void ap_term_alloc(void) + +B + +B: Programs do B need to call this directly. APR will call this + automatically from ap_terminate. + +=cut + */ +void ap_term_alloc(void); /* Tear down everything */ + /* =head1 ap_pool_t *ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) @@ -429,6 +402,9 @@ Belts; + int i; + + for (i = 0; i < barr->nelts; ++i) { + if (flags & ap_OVERLAP_TABLES_MERGE) { + ap_table_mergen(a, belt[i].key, belt[i].val); + } + else { + ap_table_setn(a, belt[i].key, belt[i].val); + } + } + + Except that it is more efficient (less space and cpu-time) especially + when b has many elements. + + Notice the assumptions on the keys and values in b -- they must be + in an ancestor of a's pool. In practice b and a are usually from + the same pool. +*/ #define AP_OVERLAP_TABLES_SET (0) #define AP_OVERLAP_TABLES_MERGE (1) APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, From 508eb2013851d2a88750d457f770edf92221be2b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 5 Jul 2000 20:23:20 +0000 Subject: [PATCH 0328/7878] Fix some code after the last cleanup. This just makes the tables compile again, bu making them use the correct macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60303 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_tables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/apr_tables.c b/lib/apr_tables.c index 9c7ee119bef..cb4920438af 100644 --- a/lib/apr_tables.c +++ b/lib/apr_tables.c @@ -735,7 +735,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, * appropriate. */ - if (flags & ap_OVERLAP_TABLES_MERGE) { + if (flags & AP_OVERLAP_TABLES_MERGE) { left = cat_keys; last = left + nkeys; while (left < last) { From db72533e3a3762f9b0e6a1edb96b570b62d89f63 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 5 Jul 2000 20:52:33 +0000 Subject: [PATCH 0329/7878] Move some private information for pools from a public header file to the C file. Just a good idea to keep private information private. :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60304 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 10 ---------- lib/apr_pools.c | 10 ++++++++++ memory/unix/apr_pools.c | 10 ++++++++++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 603b5e47ebc..42c952bb4cd 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -120,16 +120,6 @@ APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode #define ap_fdopen(d,m) fdopen((d), (m)) #endif -/* magic numbers --- min free bytes to consider a free ap_pool_t block useable, - * and the min amount to allocate if we have to go to malloc() */ - -#ifndef BLOCK_MINFREE -#define BLOCK_MINFREE 4096 -#endif -#ifndef BLOCK_MINALLOC -#define BLOCK_MINALLOC 8192 -#endif - /* * APR memory structure manipulators (pools, tables, and arrays). */ diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 093b7802670..0cb0e03bc77 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -100,6 +100,16 @@ /* Details of the debugging options can now be found in the developer * section of the documentaion. */ + +/* magic numbers --- min free bytes to consider a free ap_pool_t block useable, + * and the min amount to allocate if we have to go to malloc() */ + +#ifndef BLOCK_MINFREE +#define BLOCK_MINFREE 4096 +#endif +#ifndef BLOCK_MINALLOC +#define BLOCK_MINALLOC 8192 +#endif #ifdef POOL_DEBUG /* first do some option checking... */ diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 093b7802670..0cb0e03bc77 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -100,6 +100,16 @@ /* Details of the debugging options can now be found in the developer * section of the documentaion. */ + +/* magic numbers --- min free bytes to consider a free ap_pool_t block useable, + * and the min amount to allocate if we have to go to malloc() */ + +#ifndef BLOCK_MINFREE +#define BLOCK_MINFREE 4096 +#endif +#ifndef BLOCK_MINALLOC +#define BLOCK_MINALLOC 8192 +#endif #ifdef POOL_DEBUG /* first do some option checking... */ From db30e04694ee44e4130c3a880f37ddb81bf97042 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Thu, 6 Jul 2000 15:13:25 +0000 Subject: [PATCH 0330/7878] WinNT: Implement acceptex socket reuse. Make sure that the ap_sendfile flags argument is properly initialized for all platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60305 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 5 ++++- include/arch/win32/networkio.h | 1 + network_io/unix/sendrecv.c | 11 +++++++++++ network_io/win32/networkio.h | 1 + network_io/win32/sendrecv.c | 13 ++++++++++++- network_io/win32/sockets.c | 32 +++++++++++++++++++------------- network_io/win32/sockopt.c | 3 +++ 7 files changed, 51 insertions(+), 15 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 3a455824978..06cb37cb981 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -87,6 +87,7 @@ extern "C" { #define APR_SO_TIMEOUT 32 #define APR_SO_SNDBUF 64 #define APR_SO_RCVBUF 128 +#define APR_SO_DISCONNECTED 256 #define APR_POLLIN 0x001 #define APR_POLLPRI 0x002 @@ -358,7 +359,7 @@ B: This functions acts like a blocking write by default. To change this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. @@ -440,6 +441,8 @@ B don't wait at all. APR_SO_SNDBUF -- Set the SendBufferSize APR_SO_RCVBUF -- Set the ReceiveBufferSize + APR_SO_DISCONNECTED -- Query the disconnected state of the socket. + (Currently only used on Windows) arg 3) Socket option returned on the call. =cut diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 58d82f8b126..8f1437ef5ee 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -65,6 +65,7 @@ struct ap_socket_t { struct sockaddr_in *remote_addr; size_t addr_len; ap_interval_time_t timeout; + ap_int32_t disconnected; }; struct ap_pollfd_t { diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 4bcb1446824..1cd62762487 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -221,6 +221,9 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, int rv, nbytes = 0; ap_status_t arv; + /* Ignore flags for now. */ + flags = 0; + /* TCP_CORK keeps us from sending partial frames when we shouldn't */ rv = setsockopt(sock->socketdes, SOL_TCP, TCP_CORK, (const void *) &corkflag, sizeof(corkflag)); @@ -310,6 +313,9 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, struct sf_hdtr headerstruct; size_t bytes_to_send = *len; + /* Ignore flags for now. */ + flags = 0; + /* On FreeBSD, the number of bytes to send must include the length of * the headers. Don't look at the man page for this :( Instead, look * at the the logic in src/sys/kern/uipc_syscalls::sendfile(). @@ -380,6 +386,8 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, struct iovec hdtrarray[2]; void *headerbuf, *trailerbuf; + /* Ignore flags for now. */ + flags = 0; /* HP-UX can only send one header iovec and one footer iovec */ @@ -480,6 +488,9 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, ap_status_t arv; struct sf_parms parms; + /* Ignore flags for now. */ + flags = 0; + /* AIX can also send the headers/footers as part of the system call */ parms.header_length = 0; if (hdtr && hdtr->numheaders) { diff --git a/network_io/win32/networkio.h b/network_io/win32/networkio.h index 58d82f8b126..8f1437ef5ee 100644 --- a/network_io/win32/networkio.h +++ b/network_io/win32/networkio.h @@ -65,6 +65,7 @@ struct ap_socket_t { struct sockaddr_in *remote_addr; size_t addr_len; ap_interval_time_t timeout; + ap_int32_t disconnected; }; struct ap_pollfd_t { diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index cf44b06b747..cca0f841164 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -144,7 +144,7 @@ ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, * arg 3) A structure containing the headers and trailers to send * arg 4) Offset into the file where we should begin writing * arg 5) Number of bytes to send - * arg 6) OS-specific flags to pass to sendfile() + * arg 6) APR flags that are mapped to OS specific flags */ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, @@ -168,6 +168,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, int lasterror = APR_SUCCESS; DWORD dwFlags = 0; + /* Map APR flags to OS specific flags */ if (flags & APR_SENDFILE_DISCONNECT_SOCKET) { dwFlags |= TF_REUSE_SOCKET; dwFlags |= TF_DISCONNECT; @@ -252,6 +253,16 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, lasterror = GetLastError(); } } + + /* Mark the socket as disconnected, but do not close it. + * Note: The application must have stored the socket prior to making + * the call to ap_sendfile in order to either reuse it or close it. + */ + if ((lasterror == APR_SUCCESS) && (flags & APR_SENDFILE_DISCONNECT_SOCKET)) { + sock->disconnected = 1; + sock->sock = INVALID_SOCKET; + } + #ifdef WAIT_FOR_EVENT CloseHandle(overlapped.hEvent); #endif diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 9eb5143fee7..c2429808f0a 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -63,18 +63,19 @@ static ap_status_t socket_cleanup(void *sock) { ap_socket_t *thesocket = sock; - if (closesocket(thesocket->sock) != SOCKET_ERROR) { + + if (thesocket->sock != INVALID_SOCKET) { + if (closesocket(thesocket->sock) == SOCKET_ERROR) { + return WSAGetLastError(); + } thesocket->sock = INVALID_SOCKET; - return APR_SUCCESS; - } - else { - return WSAGetLastError(); } + return APR_SUCCESS; } ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) { - (*new) = (ap_socket_t *)ap_palloc(cont, sizeof(ap_socket_t)); + (*new) = (ap_socket_t *)ap_pcalloc(cont, sizeof(ap_socket_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -82,7 +83,7 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) (*new)->cntxt = cont; (*new)->local_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); if (((*new)->local_addr == NULL) || ((*new)->remote_addr == NULL)) { @@ -104,8 +105,11 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) (*new)->local_addr->sin_port = 0; (*new)->timeout = -1; + (*new)->disconnected = 0; + ap_register_cleanup((*new)->cntxt, (void *)(*new), socket_cleanup, ap_null_cleanup); + return APR_SUCCESS; } @@ -160,18 +164,19 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_context) { - (*new) = (ap_socket_t *)ap_palloc(connection_context, + (*new) = (ap_socket_t *)ap_pcalloc(connection_context, sizeof(ap_socket_t)); (*new)->cntxt = connection_context; - (*new)->local_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); memcpy((*new)->local_addr, sock->local_addr, sizeof(struct sockaddr_in)); (*new)->addr_len = sizeof(struct sockaddr_in); (*new)->timeout = -1; + (*new)->disconnected = 0; (*new)->sock = accept(sock->sock, (struct sockaddr *)(*new)->local_addr, &(*new)->addr_len); @@ -251,11 +256,11 @@ ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, return APR_ENOPOOL; } if ((*sock) == NULL) { - (*sock) = (ap_socket_t *)ap_palloc(cont, sizeof(ap_socket_t)); + (*sock) = (ap_socket_t *)ap_pcalloc(cont, sizeof(ap_socket_t)); (*sock)->cntxt = cont; - (*sock)->local_addr = (struct sockaddr_in *)ap_palloc((*sock)->cntxt, + (*sock)->local_addr = (struct sockaddr_in *)ap_pcalloc((*sock)->cntxt, sizeof(struct sockaddr_in)); - (*sock)->remote_addr = (struct sockaddr_in *)ap_palloc((*sock)->cntxt, + (*sock)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*sock)->cntxt, sizeof(struct sockaddr_in)); if ((*sock)->local_addr == NULL || (*sock)->remote_addr == NULL) { @@ -264,6 +269,7 @@ ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, (*sock)->addr_len = sizeof(*(*sock)->local_addr); (*sock)->timeout = -1; + (*sock)->disconnected = 0; } (*sock)->sock = *thesock; return APR_SUCCESS; diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 40259b68aea..b997e37f308 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -174,6 +174,9 @@ ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) *on = sock->timeout * 1000; /* Convert from milliseconds (windows units) to microseconds * (APR units) */ break; + case APR_SO_DISCONNECTED: + *on = sock->disconnected; + break; case APR_SO_KEEPALIVE: case APR_SO_DEBUG: case APR_SO_REUSEADDR: From e7109ffe5c04f1cc1a6cfbff6af4a06999b36ff7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 7 Jul 2000 01:42:52 +0000 Subject: [PATCH 0331/7878] fix a mispelled word git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60306 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 06cb37cb981..771fdaf6130 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -650,7 +650,7 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, ap_socket_t *socket, =head1 ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock, ap_int16_t events) -B +B arg 1) The poll structure we will be using. arg 2) The socket to modify in poll structure. From 9e65c24bf6774c932687c2ce173224e342b2604b Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Fri, 7 Jul 2000 02:16:01 +0000 Subject: [PATCH 0332/7878] add ap_rename_file() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60307 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 13 +++++++++++++ file_io/unix/open.c | 9 +++++++++ file_io/win32/open.c | 26 ++++++++++++++++++++++++++ include/apr_file_io.h | 19 +++++++++++++++++++ 4 files changed, 67 insertions(+) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 7047878bf98..cd000ab79b1 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -188,6 +188,19 @@ ap_status_t ap_remove_file(const char *path, ap_pool_t *cntxt) +ap_status_t ap_rename_file(const char *from_path, const char *to_path, + ap_pool_t *p) +{ + /* ### use an OS/2 specific function and error handling here... */ + if (rename(from_path, to_path) != 0) { + /* ### wrong error code, but we don't have APR_ERROR */ + return APR_EINVAL; + } + return APR_SUCCESS; +} + + + ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) { if (file == NULL) { diff --git a/file_io/unix/open.c b/file_io/unix/open.c index a461363709c..6becd812c4f 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -195,6 +195,15 @@ ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) } } +ap_status_t ap_rename_file(const char *from_path, const char *to_path, + ap_pool_t *p) +{ + if (rename(from_path, to_path) != 0) { + return errno; + } + return APR_SUCCESS; +} + ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) { if (file == NULL) { diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 725b5cc2b68..0877b6c20d0 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -209,6 +209,32 @@ ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) } } +ap_status_t ap_rename_file(const char *from_path, const char *to_path, + ap_pool_t *p) +{ + const char *from_canon = canonical_filename(p, from_path); + const char *to_canon = canonical_filename(p, to_path); + DWORD err; + + /* ### would be nice to use MoveFileEx() here, but it isn't available + ### on Win95/98. MoveFileEx could theoretically help prevent the + ### case where we delete the target but don't move the file(!). + ### it can also copy across devices... + */ + + if (MoveFile(from_canon, to_canon)) { + return APR_SUCCESS; + } + err = GetLastError(); + if (err == ERROR_FILE_EXISTS || err == ERROR_ALREADY_EXISTS) { + (void) DeleteFile(to_canon); + if (MoveFile(from_canon, to_canon)) + return APR_SUCCESS; + err = GetLastError(); + } + return err; +} + ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) { if (file == NULL) { diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 5d24972b9eb..c4c54a40c6a 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -188,6 +188,25 @@ ap_status_t ap_remove_file(const char *path, ap_pool_t *cont); /* +=head1 ap_status_t ap_rename_file(const char *from_path, const char *to_path, + ap_pool_t *cont) + +B + + arg 1) The full path to the original file (using / on all systems) + arg 2) The full path to the new file (using / on all systems) + arg 3) The pool to use. + +B: If a file exists at the new location, then it will be overwritten. + Moving files or directories across devices may not be possible. + +=cut + */ +ap_status_t ap_rename_file(const char *from_path, const char *to_path, + ap_pool_t *pool); + +/* + =head1 ap_status_t ap_eof(ap_file_t *fptr) B From 4bf95f3ac0f48660f937966f71ea30b4587e3fe0 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Fri, 7 Jul 2000 02:45:19 +0000 Subject: [PATCH 0333/7878] use ap_size_t rather than "int" or "long" git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60308 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 32 ++++++++++++++++---------------- lib/apr_pools.c | 35 ++++++++++++++++++----------------- memory/unix/apr_pools.c | 35 ++++++++++++++++++----------------- 3 files changed, 52 insertions(+), 50 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 42c952bb4cd..0bd983186d9 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -110,8 +110,8 @@ struct process_chain { #ifndef POOL_DEBUG APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts); #else -APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, int (apr_abort)(int retcode)); -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode)); +APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, int (*apr_abort)(int retcode)); +APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (*apr_abort)(int retcode)); #endif /* POOL_DEBUG */ #ifdef ULTRIX_BRAIN_DEATH @@ -198,7 +198,7 @@ APR_EXPORT(void) ap_destroy_pool(struct ap_pool_t *p); /* -=head1 long *ap_bytes_in_pool(ap_pool_t *p) +=head1 ap_size_t ap_bytes_in_pool(ap_pool_t *p) B @@ -207,11 +207,11 @@ B =cut */ -APR_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p); +APR_EXPORT(ap_size_t) ap_bytes_in_pool(ap_pool_t *p); /* -=head1 long *ap_bytes_in_free_blocks(ap_pool_t *p) +=head1 ap_size_t ap_bytes_in_free_blocks(ap_pool_t *p) B @@ -219,7 +219,7 @@ B =cut */ -APR_EXPORT(long) ap_bytes_in_free_blocks(void); +APR_EXPORT(ap_size_t) ap_bytes_in_free_blocks(void); /* @@ -238,7 +238,7 @@ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); /* -=head1 void *ap_palloc(ap_pool_t *c, int reqsize) +=head1 void *ap_palloc(ap_pool_t *c, ap_size_t reqsize) B @@ -248,11 +248,11 @@ B =cut */ -APR_EXPORT(void *) ap_palloc(struct ap_pool_t *c, int reqsize); +APR_EXPORT(void *) ap_palloc(struct ap_pool_t *c, ap_size_t reqsize); /* -=head1 void *ap_pcalloc(ap_pool_t *c, int reqsize) +=head1 void *ap_pcalloc(ap_pool_t *c, ap_size_t reqsize) B @@ -262,7 +262,7 @@ B =cut */ -APR_EXPORT(void *) ap_pcalloc(struct ap_pool_t *p, int size); +APR_EXPORT(void *) ap_pcalloc(struct ap_pool_t *p, ap_size_t size); /* @@ -280,7 +280,7 @@ APR_EXPORT(char *) ap_pstrdup(struct ap_pool_t *p, const char *s); /* -=head1 char *ap_pstrndup(ap_pool_t *c, const char *s, int n) +=head1 char *ap_pstrndup(ap_pool_t *c, const char *s, ap_size_t n) B @@ -291,7 +291,7 @@ B =cut */ APR_EXPORT(void) ap_register_cleanup(struct ap_pool_t *p, void *data, - ap_status_t (*plain_cleanup) (void *), - ap_status_t (*child_cleanup) (void *)); + ap_status_t (*plain_cleanup) (void *), + ap_status_t (*child_cleanup) (void *)); /* @@ -367,7 +367,7 @@ B =cut */ APR_EXPORT(void) ap_kill_cleanup(struct ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)); + ap_status_t (*cleanup) (void *)); /* @@ -382,7 +382,7 @@ B =cut */ APR_EXPORT(ap_status_t) ap_run_cleanup(struct ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)); + ap_status_t (*cleanup) (void *)); /* diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 0cb0e03bc77..77f0490f47f 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -416,9 +416,9 @@ static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) /* Accounting */ -static long bytes_in_block_list(union block_hdr *blok) +static ap_size_t bytes_in_block_list(union block_hdr *blok) { - long size = 0; + ap_size_t size = 0; while (blok) { size += blok->h.endp - (char *) (blok + 1); @@ -734,11 +734,11 @@ APR_EXPORT(void) ap_destroy_pool(ap_pool_t *a) free_blocks(a->first); } -APR_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p) +APR_EXPORT(ap_size_t) ap_bytes_in_pool(ap_pool_t *p) { return bytes_in_block_list(p->first); } -APR_EXPORT(long) ap_bytes_in_free_blocks(void) +APR_EXPORT(ap_size_t) ap_bytes_in_free_blocks(void) { return bytes_in_block_list(block_freelist); } @@ -761,7 +761,8 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode)) +APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, + int (*apr_abort)(int retcode)) { const char *s = ts; union block_hdr **pb; @@ -828,7 +829,7 @@ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) * be destroyed before p is. */ APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, - int (*apr_abort)(int retcode)) + int (*apr_abort)(int retcode)) { union block_hdr *b; @@ -853,10 +854,10 @@ APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, * Allocating stuff... */ -void * ap_palloc(ap_pool_t *a, int reqsize) +void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) { #ifdef ALLOC_USE_MALLOC - int size = reqsize + CLICK_SZ; + ap_size_t size = reqsize + CLICK_SZ; void *ptr; if (a == NULL) { @@ -880,8 +881,8 @@ void * ap_palloc(ap_pool_t *a, int reqsize) * Round up requested size to an even number of alignment units * (core clicks) */ - int nclicks; - int size; + ap_size_t nclicks; + ap_size_t size; /* First, see if we have space in the block most recently * allocated to this pool @@ -945,7 +946,7 @@ void * ap_palloc(ap_pool_t *a, int reqsize) #endif } -APR_EXPORT(void *) ap_pcalloc(ap_pool_t *a, int size) +APR_EXPORT(void *) ap_pcalloc(ap_pool_t *a, ap_size_t size) { void *res = ap_palloc(a, size); memset(res, '\0', size); @@ -966,7 +967,7 @@ APR_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) return res; } -APR_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, int n) +APR_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, ap_size_t n) { char *res; @@ -985,7 +986,7 @@ APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *a, ...) /* Pass one --- find length of required string */ - int len = 0; + ap_size_t len = 0; va_list adummy; va_start(adummy, a); @@ -1046,7 +1047,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) { struct psprintf_data *ps = (struct psprintf_data *)vbuff; #ifdef ALLOC_USE_MALLOC - int size; + ap_size_t size; char *ptr; size = (char *)ps->vbuff.curpos - ps->base; @@ -1062,7 +1063,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) #else union block_hdr *blok; union block_hdr *nblok; - size_t cur_len; + ap_size_t cur_len; char *strp; blok = ps->blok; @@ -1133,7 +1134,7 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) #else struct psprintf_data ps; char *strp; - int size; + ap_size_t size; ps.blok = p->last; ps.vbuff.curpos = ps.blok->h.first_avail; @@ -1187,7 +1188,7 @@ APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) */ APR_EXPORT(void) ap_note_subprocess(ap_pool_t *a, ap_proc_t *pid, - enum kill_conditions how) + enum kill_conditions how) { struct process_chain *new = (struct process_chain *) ap_palloc(a, sizeof(struct process_chain)); diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 0cb0e03bc77..77f0490f47f 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -416,9 +416,9 @@ static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) /* Accounting */ -static long bytes_in_block_list(union block_hdr *blok) +static ap_size_t bytes_in_block_list(union block_hdr *blok) { - long size = 0; + ap_size_t size = 0; while (blok) { size += blok->h.endp - (char *) (blok + 1); @@ -734,11 +734,11 @@ APR_EXPORT(void) ap_destroy_pool(ap_pool_t *a) free_blocks(a->first); } -APR_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p) +APR_EXPORT(ap_size_t) ap_bytes_in_pool(ap_pool_t *p) { return bytes_in_block_list(p->first); } -APR_EXPORT(long) ap_bytes_in_free_blocks(void) +APR_EXPORT(ap_size_t) ap_bytes_in_free_blocks(void) { return bytes_in_block_list(block_freelist); } @@ -761,7 +761,8 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode)) +APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, + int (*apr_abort)(int retcode)) { const char *s = ts; union block_hdr **pb; @@ -828,7 +829,7 @@ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) * be destroyed before p is. */ APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, - int (*apr_abort)(int retcode)) + int (*apr_abort)(int retcode)) { union block_hdr *b; @@ -853,10 +854,10 @@ APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, * Allocating stuff... */ -void * ap_palloc(ap_pool_t *a, int reqsize) +void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) { #ifdef ALLOC_USE_MALLOC - int size = reqsize + CLICK_SZ; + ap_size_t size = reqsize + CLICK_SZ; void *ptr; if (a == NULL) { @@ -880,8 +881,8 @@ void * ap_palloc(ap_pool_t *a, int reqsize) * Round up requested size to an even number of alignment units * (core clicks) */ - int nclicks; - int size; + ap_size_t nclicks; + ap_size_t size; /* First, see if we have space in the block most recently * allocated to this pool @@ -945,7 +946,7 @@ void * ap_palloc(ap_pool_t *a, int reqsize) #endif } -APR_EXPORT(void *) ap_pcalloc(ap_pool_t *a, int size) +APR_EXPORT(void *) ap_pcalloc(ap_pool_t *a, ap_size_t size) { void *res = ap_palloc(a, size); memset(res, '\0', size); @@ -966,7 +967,7 @@ APR_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) return res; } -APR_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, int n) +APR_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, ap_size_t n) { char *res; @@ -985,7 +986,7 @@ APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *a, ...) /* Pass one --- find length of required string */ - int len = 0; + ap_size_t len = 0; va_list adummy; va_start(adummy, a); @@ -1046,7 +1047,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) { struct psprintf_data *ps = (struct psprintf_data *)vbuff; #ifdef ALLOC_USE_MALLOC - int size; + ap_size_t size; char *ptr; size = (char *)ps->vbuff.curpos - ps->base; @@ -1062,7 +1063,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) #else union block_hdr *blok; union block_hdr *nblok; - size_t cur_len; + ap_size_t cur_len; char *strp; blok = ps->blok; @@ -1133,7 +1134,7 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) #else struct psprintf_data ps; char *strp; - int size; + ap_size_t size; ps.blok = p->last; ps.vbuff.curpos = ps.blok->h.first_avail; @@ -1187,7 +1188,7 @@ APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) */ APR_EXPORT(void) ap_note_subprocess(ap_pool_t *a, ap_proc_t *pid, - enum kill_conditions how) + enum kill_conditions how) { struct process_chain *new = (struct process_chain *) ap_palloc(a, sizeof(struct process_chain)); From 3363a900bbdbada534badcf46f16fedf8f549400 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 7 Jul 2000 02:50:50 +0000 Subject: [PATCH 0334/7878] Update ap_sendfile() test driver to properly use it in non-blocking mode. Expand headers and trailers so that the kernel would have to block when sending a header and when sending a trailer. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60309 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsf.c | 266 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 224 insertions(+), 42 deletions(-) diff --git a/test/testsf.c b/test/testsf.c index 17376fa9494..933d11226bd 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -56,6 +56,7 @@ #include #include #include +#include #include "apr_network_io.h" #include "apr_errno.h" #include "apr_general.h" @@ -76,13 +77,19 @@ int main(void) #define HDR1 "1234567890ABCD\n" #define HDR2 "EFGH\n" +#define HDR3_LEN 80000 +#define HDR3_CHAR '^' #define TRL1 "IJKLMNOPQRSTUVWXYZ\n" #define TRL2 "!@#$%&*()\n" +#define TRL3_LEN 90000 +#define TRL3_CHAR '@' #define TESTSF_PORT 8021 #define TESTFILE "testsf.dat" +typedef enum {BLK, NONBLK, TIMEOUT} client_socket_mode_t; + static void apr_setup(ap_pool_t **p, ap_socket_t **sock) { char buf[120]; @@ -171,19 +178,22 @@ static void create_testfile(ap_pool_t *p, const char *fname) } } -static int client(int socket_mode) +static int client(client_socket_mode_t socket_mode) { - ap_status_t rv; + ap_status_t rv, tmprv; ap_socket_t *sock; ap_pool_t *p; char buf[120]; ap_file_t *f = NULL; ap_size_t len, expected_len; - ap_off_t offset; + ap_off_t current_file_offset; ap_hdtr_t hdtr; - struct iovec headers[2]; - struct iovec trailers[2]; + struct iovec headers[3]; + struct iovec trailers[3]; ap_ssize_t bytes_read; + ap_pollfd_t *pfd; + ap_int32_t nsocks; + int i; apr_setup(&p, &sock); create_testfile(p, TESTFILE); @@ -213,10 +223,10 @@ static int client(int socket_mode) } switch(socket_mode) { - case 1: + case BLK: /* leave it blocking */ break; - case 0: + case NONBLK: /* set it non-blocking */ rv = ap_setsocketopt(sock, APR_SO_NONBLOCK, 1); if (rv != APR_SUCCESS) { @@ -226,7 +236,7 @@ static int client(int socket_mode) exit(1); } break; - case 2: + case TIMEOUT: /* set a timeout */ rv = ap_setsocketopt(sock, APR_SO_TIMEOUT, 100 * AP_USEC_PER_SEC); @@ -244,51 +254,173 @@ static int client(int socket_mode) printf("Sending the file...\n"); hdtr.headers = headers; - hdtr.numheaders = 2; + hdtr.numheaders = 3; hdtr.headers[0].iov_base = HDR1; hdtr.headers[0].iov_len = strlen(hdtr.headers[0].iov_base); hdtr.headers[1].iov_base = HDR2; hdtr.headers[1].iov_len = strlen(hdtr.headers[1].iov_base); + hdtr.headers[2].iov_base = malloc(HDR3_LEN); + assert(hdtr.headers[2].iov_base); + memset(hdtr.headers[2].iov_base, HDR3_CHAR, HDR3_LEN); + hdtr.headers[2].iov_len = HDR3_LEN; hdtr.trailers = trailers; - hdtr.numtrailers = 2; + hdtr.numtrailers = 3; hdtr.trailers[0].iov_base = TRL1; hdtr.trailers[0].iov_len = strlen(hdtr.trailers[0].iov_base); hdtr.trailers[1].iov_base = TRL2; hdtr.trailers[1].iov_len = strlen(hdtr.trailers[1].iov_base); - - offset = 0; - len = FILE_LENGTH; - rv = ap_sendfile(sock, f, &hdtr, &offset, &len, 0); - if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_sendfile()->%d/%s\n", - rv, - ap_strerror(rv, buf, sizeof buf)); - exit(1); - } - - printf("ap_sendfile() updated offset with %ld\n", - (long int)offset); - - printf("ap_sendfile() updated len with %ld\n", - (long int)len); + hdtr.trailers[2].iov_base = malloc(TRL3_LEN); + memset(hdtr.trailers[2].iov_base, TRL3_CHAR, TRL3_LEN); + assert(hdtr.trailers[2].iov_base); + hdtr.trailers[2].iov_len = TRL3_LEN; expected_len = - strlen(HDR1) + strlen(HDR2) + - strlen(TRL1) + strlen(TRL2) + + strlen(HDR1) + strlen(HDR2) + HDR3_LEN + + strlen(TRL1) + strlen(TRL2) + TRL3_LEN + FILE_LENGTH; + + if (socket_mode == BLK || socket_mode == TIMEOUT) { + current_file_offset = 0; + len = FILE_LENGTH; + rv = ap_sendfile(sock, f, &hdtr, ¤t_file_offset, &len, 0); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_sendfile()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + + printf("ap_sendfile() updated offset with %ld\n", + (long int)current_file_offset); + + printf("ap_sendfile() updated len with %ld\n", + (long int)len); + + printf("bytes really sent: %d\n", + expected_len); - printf("bytes really sent: %d\n", - expected_len); + if (len != expected_len) { + fprintf(stderr, "ap_sendfile() didn't report the correct " + "number of bytes sent!\n"); + exit(1); + } + } + else { + /* non-blocking... wooooooo */ + ap_size_t total_bytes_sent; + + pfd = NULL; + rv = ap_setup_poll(&pfd, 1, p); + assert(!rv); + rv = ap_add_poll_socket(pfd, sock, APR_POLLOUT); + assert(!rv); + + total_bytes_sent = 0; + current_file_offset = 0; + len = FILE_LENGTH; + do { + ap_size_t tmplen; + + tmplen = len; /* bytes remaining to send from the file */ + printf("Calling ap_sendfile()...\n"); + printf("Headers:\n"); + for (i = 0; i < hdtr.numheaders; i++) { + printf("\t%d bytes\n", + hdtr.headers[i].iov_len); + } + printf("File: %ld bytes from offset %ld\n", + (long)tmplen, (long)current_file_offset); + printf("Trailers:\n"); + for (i = 0; i < hdtr.numtrailers; i++) { + printf("\t%d bytes\n", + hdtr.trailers[i].iov_len); + } + + rv = ap_sendfile(sock, f, &hdtr, ¤t_file_offset, &tmplen, 0); + printf("ap_sendfile()->%d, sent %ld bytes\n", rv, (long)tmplen); + if (rv) { + if (ap_canonical_error(rv) == APR_EAGAIN) { + nsocks = 1; + tmprv = ap_poll(pfd, &nsocks, -1); + assert(!tmprv); + assert(nsocks == 1); + /* continue; */ + } + } + + total_bytes_sent += tmplen; + + /* Adjust hdtr to compensate for partially-written + * data. + */ + + /* First, skip over any header data which might have + * been written. + */ + while (tmplen && hdtr.numheaders) { + if (tmplen >= hdtr.headers[0].iov_len) { + tmplen -= hdtr.headers[0].iov_len; + --hdtr.numheaders; + ++hdtr.headers; + } + else { + hdtr.headers[0].iov_len -= tmplen; + hdtr.headers[0].iov_base += tmplen; + tmplen = 0; + } + } + + /* Now, skip over any file data which might have been + * written. + */ + + if (tmplen <= len) { + current_file_offset += tmplen; + len -= tmplen; + tmplen = 0; + } + else { + tmplen -= len; + len = 0; + current_file_offset = 0; + } + + /* Last, skip over any trailer data which might have + * been written. + */ + + while (tmplen && hdtr.numtrailers) { + if (tmplen >= hdtr.trailers[0].iov_len) { + tmplen -= hdtr.trailers[0].iov_len; + --hdtr.numtrailers; + ++hdtr.trailers; + } + else { + hdtr.trailers[0].iov_len -= tmplen; + hdtr.trailers[0].iov_base += tmplen; + tmplen = 0; + } + } + + } while (total_bytes_sent < expected_len && + (rv == APR_SUCCESS || + ap_canonical_error(rv) == APR_EAGAIN)); + if (total_bytes_sent != expected_len) { + fprintf(stderr, + "client problem: sent %ld of %ld bytes\n", + (long)total_bytes_sent, (long)expected_len); + } - if (len != expected_len) { - fprintf(stderr, "ap_sendfile() didn't report the correct " - "number of bytes sent!\n"); - exit(1); + if (rv) { + fprintf(stderr, + "client problem: rv %d\n", + rv); + } } - offset = 0; - rv = ap_seek(f, APR_CUR, &offset); + current_file_offset = 0; + rv = ap_seek(f, APR_CUR, ¤t_file_offset); if (rv != APR_SUCCESS) { fprintf(stderr, "ap_seek()->%d/%s\n", rv, @@ -298,7 +430,7 @@ static int client(int socket_mode) printf("After ap_sendfile(), the kernel file pointer is " "at offset %ld.\n", - (long int)offset); + (long int)current_file_offset); rv = ap_shutdown(sock, APR_SHUTDOWN_WRITE); if (rv != APR_SUCCESS) { @@ -432,6 +564,31 @@ static int server(void) exit(1); } + for (i = 0; i < HDR3_LEN; i++) { + bytes_read = 1; + rv = ap_recv(newsock, buf, &bytes_read); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_recv()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + if (bytes_read != 1) { + fprintf(stderr, "ap_recv()->%ld bytes instead of 1\n", + (long int)bytes_read); + exit(1); + } + if (buf[0] != HDR3_CHAR) { + fprintf(stderr, + "problem with data read (byte %d of hdr 3):\n", + i); + fprintf(stderr, "read `%c' (0x%x) from client; expected " + "`%c'\n", + buf[0], buf[0], HDR3_CHAR); + exit(1); + } + } + for (i = 0; i < FILE_LENGTH; i++) { bytes_read = 1; rv = ap_recv(newsock, buf, &bytes_read); @@ -497,6 +654,31 @@ static int server(void) exit(1); } + for (i = 0; i < TRL3_LEN; i++) { + bytes_read = 1; + rv = ap_recv(newsock, buf, &bytes_read); + if (rv != APR_SUCCESS) { + fprintf(stderr, "ap_recv()->%d/%s\n", + rv, + ap_strerror(rv, buf, sizeof buf)); + exit(1); + } + if (bytes_read != 1) { + fprintf(stderr, "ap_recv()->%ld bytes instead of 1\n", + (long int)bytes_read); + exit(1); + } + if (buf[0] != TRL3_CHAR) { + fprintf(stderr, + "problem with data read (byte %d of trl 3):\n", + i); + fprintf(stderr, "read `%c' (0x%x) from client; expected " + "`%c'\n", + buf[0], buf[0], TRL3_CHAR); + exit(1); + } + } + bytes_read = 1; rv = ap_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { @@ -507,8 +689,8 @@ static int server(void) } if (bytes_read != 0) { fprintf(stderr, "We expected the EOF condition on the connected\n" - "socket but instead we read %ld bytes.\n", - (long int)bytes_read); + "socket but instead we read %ld bytes (%c).\n", + (long int)bytes_read, buf[0]); exit(1); } @@ -528,13 +710,13 @@ int main(int argc, char *argv[]) */ if (argc == 3 && !strcmp(argv[1], "client")) { if (!strcmp(argv[2], "blocking")) { - return client(1); + return client(BLK); } else if (!strcmp(argv[2], "timeout")) { - return client(2); + return client(TIMEOUT); } else if (!strcmp(argv[2], "nonblocking")) { - return client(0); + return client(NONBLK); } } else if (argc == 2 && !strcmp(argv[1], "server")) { From 69e842b33431ba607d3b3600db796de741937367 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 7 Jul 2000 02:54:54 +0000 Subject: [PATCH 0335/7878] ap_sendfile() fixes: all Unix flavors: fix the check for whether or not we have a timeout FreeBSD flavor: make it work correct with a non-blocking socket that doesn't have a timeout git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60310 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 41 +++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 1cd62762487..3d749e0fe47 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -253,7 +253,7 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout != 0) { + sock->timeout > 0) { arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -331,20 +331,37 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, headerstruct.trl_cnt = hdtr->numtrailers; /* FreeBSD can send the headers/footers as part of the system call */ + do { - rv = sendfile(file->filedes, /* open file descriptor of the file to be sent */ - sock->socketdes, /* socket */ - *offset, /* where in the file to start */ - bytes_to_send, /* number of bytes to send */ - &headerstruct, /* Headers/footers */ - &nbytes, /* number of bytes written */ - flags /* undefined, set to 0 */ - ); + if (bytes_to_send) { + /* We won't dare call sendfile() if we don't have + * header or file bytes to send because bytes_to_send == 0 + * means send the whole file. + */ + rv = sendfile(file->filedes, /* file to be sent */ + sock->socketdes, /* socket */ + *offset, /* where in the file to start */ + bytes_to_send, /* number of bytes to send */ + &headerstruct, /* Headers/footers */ + &nbytes, /* number of bytes written */ + flags); /* undefined, set to 0 */ + } + else { + /* just trailer bytes... use writev() + */ + rv = writev(sock->socketdes, + hdtr->trailers, + hdtr->numtrailers); + if (rv > 0) { + nbytes = rv; + rv = 0; + } + } } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout != 0) { + sock->timeout > 0) { ap_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -435,7 +452,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout != 0) { + sock->timeout > 0) { ap_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { @@ -564,7 +581,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout != 0) { + sock->timeout > 0) { arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; From b7d9204e0f2dc59f39665449b3727d6acfc8ae3c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 7 Jul 2000 03:00:44 +0000 Subject: [PATCH 0336/7878] ap_sendfile() fixes: Linux flavor: get it working with non-blocking sockets which don't have a timeout git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60311 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 3d749e0fe47..159359591de 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -218,7 +218,7 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, { off_t off = *offset; int corkflag = 1; - int rv, nbytes = 0; + int rv, nbytes = 0, total_hdrbytes, i; ap_status_t arv; /* Ignore flags for now. */ @@ -241,6 +241,21 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, return errno; } nbytes += hdrbytes; + + /* If this was a partial write and we aren't doing timeouts, + * return now with the partial byte count; this is a non-blocking + * socket. + */ + if (sock->timeout <= 0) { + total_hdrbytes = 0; + for (i = 0; i < hdtr->numheaders; i++) { + total_hdrbytes += hdtr->headers[i].iov_len; + } + if (hdrbytes < total_hdrbytes) { + *len = hdrbytes; + return APR_SUCCESS; + } + } } do { @@ -276,6 +291,15 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, nbytes += rv; + /* If this was a partial write, return now with the partial byte count; + * this is a non-blocking socket. + */ + + if (rv < *len) { + *len = nbytes; + return APR_SUCCESS; + } + /* Now write the footers */ if (hdtr->numtrailers > 0) { ap_int32_t trbytes; From a694349457bfffa6ec599044f169619ba565a572 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Fri, 7 Jul 2000 06:01:20 +0000 Subject: [PATCH 0337/7878] OS/2: Provide native implementation of ap_rename_file(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60312 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/fileio.h | 1 + file_io/os2/open.c | 18 ++++++++++-------- include/arch/os2/fileio.h | 1 + 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/file_io/os2/fileio.h b/file_io/os2/fileio.h index b2d6d6d2ef0..738e17f2ec2 100644 --- a/file_io/os2/fileio.h +++ b/file_io/os2/fileio.h @@ -56,6 +56,7 @@ #define FILE_IO_H #define INCL_DOS +#define INCL_DOSERRORS #include #include "apr_private.h" diff --git a/file_io/os2/open.c b/file_io/os2/open.c index cd000ab79b1..0e77ad27c11 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -58,9 +58,6 @@ #include "apr_portable.h" #include -#define INCL_DOS -#include - ap_status_t apr_file_cleanup(void *thefile) { ap_file_t *file = thefile; @@ -191,12 +188,17 @@ ap_status_t ap_remove_file(const char *path, ap_pool_t *cntxt) ap_status_t ap_rename_file(const char *from_path, const char *to_path, ap_pool_t *p) { - /* ### use an OS/2 specific function and error handling here... */ - if (rename(from_path, to_path) != 0) { - /* ### wrong error code, but we don't have APR_ERROR */ - return APR_EINVAL; + ULONG rc = DosMove(from_path, to_path); + + if (rc == ERROR_ACCESS_DENIED) { + rc = DosDelete(to_path); + + if (rc == 0 || rc == ERROR_FILE_NOT_FOUND) { + rc = DosMove(from_path, to_path); + } } - return APR_SUCCESS; + + return APR_OS2_STATUS(rc); } diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index b2d6d6d2ef0..738e17f2ec2 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -56,6 +56,7 @@ #define FILE_IO_H #define INCL_DOS +#define INCL_DOSERRORS #include #include "apr_private.h" From 7dbf52c98f778ea23894f374faa5f64f180a3007 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Fri, 7 Jul 2000 06:07:43 +0000 Subject: [PATCH 0338/7878] The strcasecmp()->stricmp() mapping is done in apr_general.h so don't do it in apr_private.h as well as it causes redefinition warnings all through the APR build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60313 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/acconfig.h b/acconfig.h index 1edd878d303..8c840451414 100644 --- a/acconfig.h +++ b/acconfig.h @@ -41,10 +41,6 @@ /* Make sure we have ssize_t defined to be something */ #undef ssize_t -#if !defined(HAVE_STRCASECMP) && defined(HAVE_STRICMP) -#define strcasecmp(s1,s2) stricmp(s1,s2) -#endif - #if !defined(HAVE_SOCKLEN_T) typedef int socklen_t; #endif From 8734345d63f2b9142abf5874c456d0eddf352f69 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 7 Jul 2000 19:14:54 +0000 Subject: [PATCH 0339/7878] Stop using an incomplete type for MMAP files. The only sane way to really store an MMAP file as far as I can see is as a void * and a length. BeOS requires another variable, but it doesn't do any harm to expose that too. This cleans up some code for Apache, and it makes sense IMHO. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60314 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_mmap.h | 15 ++++++- include/arch/unix/mmap.c | 24 +++++++++- mmap/unix/Makefile.in | 28 ++++++------ mmap/unix/common.c | 5 ++- mmap/unix/mmap.c | 24 +++++++++- mmap/unix/mmap_h.h | 94 ---------------------------------------- 6 files changed, 77 insertions(+), 113 deletions(-) delete mode 100644 mmap/unix/mmap_h.h diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 598b0e3f964..dc46958befa 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -64,8 +64,21 @@ extern "C" { #endif /* __cplusplus */ - typedef struct ap_mmap_t ap_mmap_t; +/* As far as I can tell the only really sane way to store an MMAP is as a + * void * and a length. BeOS requires this area_id, but that's just a little + * something extra. I am exposing this type, because it doesn't make much + * sense to keep it private, and opening it up makes some stuff easier in + * Apache. + */ +struct ap_mmap_t { + ap_pool_t *cntxt; +#ifdef BEOS + area_id area; +#endif + void *mm; + size_t size; +}; /* Function definitions */ diff --git a/include/arch/unix/mmap.c b/include/arch/unix/mmap.c index 67116e2a33c..d708b977e46 100644 --- a/include/arch/unix/mmap.c +++ b/include/arch/unix/mmap.c @@ -52,9 +52,31 @@ * . */ -#include "mmap_h.h" +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_mmap.h" +#include "apr_errno.h" +#include "../../file_io/unix/fileio.h" #include "apr_portable.h" +/* System headers required for the mmap library */ +#ifdef BEOS +#include +#endif +#if HAVE_STRING_H +#include +#endif +#if APR_HAVE_STDIO_H +#include +#endif +#if HAVE_SYS_STAT_H +#include +#endif +#if HAVE_SYS_MMAN_H +#include +#endif + #if APR_HAS_MMAP || defined(BEOS) static ap_status_t mmap_cleanup(void *themmap) diff --git a/mmap/unix/Makefile.in b/mmap/unix/Makefile.in index f98c1ecf3eb..2677f3e77ea 100644 --- a/mmap/unix/Makefile.in +++ b/mmap/unix/Makefile.in @@ -49,19 +49,17 @@ depend: && rm Makefile.new # DO NOT REMOVE -common.o: common.c mmap_h.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_mmap.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lock.h \ +common.o: common.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_mmap.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h +mmap.o: mmap.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_mmap.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h -mmap.o: mmap.c mmap_h.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_mmap.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lock.h \ - ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h diff --git a/mmap/unix/common.c b/mmap/unix/common.c index 1d2db7a8cbf..25597c56a5b 100644 --- a/mmap/unix/common.c +++ b/mmap/unix/common.c @@ -61,7 +61,10 @@ * */ -#include "mmap_h.h" +#include "apr.h" +#include "apr_private.h" +#include "apr_mmap.h" +#include "apr_errno.h" #if APR_HAS_MMAP || defined(BEOS) diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 67116e2a33c..d708b977e46 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -52,9 +52,31 @@ * . */ -#include "mmap_h.h" +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_mmap.h" +#include "apr_errno.h" +#include "../../file_io/unix/fileio.h" #include "apr_portable.h" +/* System headers required for the mmap library */ +#ifdef BEOS +#include +#endif +#if HAVE_STRING_H +#include +#endif +#if APR_HAVE_STDIO_H +#include +#endif +#if HAVE_SYS_STAT_H +#include +#endif +#if HAVE_SYS_MMAN_H +#include +#endif + #if APR_HAS_MMAP || defined(BEOS) static ap_status_t mmap_cleanup(void *themmap) diff --git a/mmap/unix/mmap_h.h b/mmap/unix/mmap_h.h deleted file mode 100644 index 394ff1bfbe2..00000000000 --- a/mmap/unix/mmap_h.h +++ /dev/null @@ -1,94 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef MMAP_H_H -#define MMAP_H_H - -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_mmap.h" -#include "apr_errno.h" -#include "../../file_io/unix/fileio.h" -#include "mmap_h.h" - -/* System headers required for the mmap library */ -#ifdef BEOS -#include -#endif -#if HAVE_STRING_H -#include -#endif -#if APR_HAVE_STDIO_H -#include -#endif -#if HAVE_SYS_STAT_H -#include -#endif -#if HAVE_SYS_MMAN_H -#include -#endif -/* End System Headers */ - -struct ap_mmap_t { - ap_pool_t *cntxt; -#ifdef BEOS - area_id area; -#endif - void *mm; - size_t size; -}; - -#endif /* ! MMAP_H_H */ - From 3568fc4d7c0f38a0971ad6267c4dd899ac9f48e1 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 7 Jul 2000 19:20:47 +0000 Subject: [PATCH 0340/7878] Update dependancies in APR git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60315 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/Makefile.in | 5 ++- file_io/unix/Makefile.in | 70 ++++++++++++++++++++----------------- i18n/unix/Makefile.in | 9 ++--- lib/Makefile.in | 68 +++++++++++++++++------------------ locks/unix/Makefile.in | 33 ++++++++--------- misc/unix/Makefile.in | 37 +++++++++----------- network_io/unix/Makefile.in | 55 +++++++++++++++-------------- threadproc/unix/Makefile.in | 59 +++++++++++++++---------------- time/unix/Makefile.in | 6 ++-- 9 files changed, 174 insertions(+), 168 deletions(-) diff --git a/dso/unix/Makefile.in b/dso/unix/Makefile.in index d4a046566bc..fed8392b254 100644 --- a/dso/unix/Makefile.in +++ b/dso/unix/Makefile.in @@ -51,6 +51,5 @@ depend: dso.o: dso.c dso.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_dso.h + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_dso.h diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index 5d702245adf..7cc3f7ee4ef 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -55,50 +55,56 @@ depend: && rm Makefile.new # DO NOT REMOVE -dir.o: dir.c fileio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h \ +dir.o: dir.c fileio.h $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h -fileacc.o: fileacc.c fileio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h +fileacc.o: fileacc.c fileio.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h -filedup.o: filedup.c fileio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_tables.h +filedup.o: filedup.c fileio.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h -filestat.o: filestat.c fileio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_dso.h +filestat.o: filestat.c fileio.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h -open.o: open.c fileio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_tables.h +open.o: open.c fileio.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h -pipe.o: pipe.c fileio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_dso.h +pipe.o: pipe.c fileio.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h -readwrite.o: readwrite.c fileio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_tables.h +readwrite.o: readwrite.c fileio.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_lock.h -seek.o: seek.c fileio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_lock.h +seek.o: seek.c fileio.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_thread_proc.h + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_tables.h diff --git a/i18n/unix/Makefile.in b/i18n/unix/Makefile.in index 9fe02a58fab..88c6bad7d14 100644 --- a/i18n/unix/Makefile.in +++ b/i18n/unix/Makefile.in @@ -38,7 +38,8 @@ depend: # DO NOT REMOVE xlate.o: xlate.c $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_xlate.h + $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_xlate.h diff --git a/lib/Makefile.in b/lib/Makefile.in index 001775c4580..3e290ff26e2 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -60,53 +60,53 @@ depend: && rm Makefile.new # DO NOT REMOVE -apr_cpystrn.o: apr_cpystrn.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h +apr_cpystrn.o: apr_cpystrn.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h apr_execve.o: apr_execve.c $(INCDIR)/apr_private.h apr_fnmatch.o: apr_fnmatch.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_fnmatch.h $(INCDIR)/apr_errno.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h apr_getpass.o: apr_getpass.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h + $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h apr_hash.o: apr_hash.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_hash.h + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h $(INCDIR)/apr_hash.h apr_md5.o: apr_md5.c $(INCDIR)/apr_private.h $(INCDIR)/apr_md5.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_xlate.h -apr_pools.o: apr_pools.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_xlate.h +apr_pools.o: apr_pools.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ - ../misc/unix/misc.h $(INCDIR)/apr_getopt.h + $(INCDIR)/apr_dso.h $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_tables.h ../misc/unix/misc.h $(INCDIR)/apr_getopt.h apr_signal.o: apr_signal.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h -apr_snprintf.o: apr_snprintf.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h + $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h +apr_snprintf.o: apr_snprintf.c $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h apr_strnatcmp.o: apr_strnatcmp.c $(INCDIR)/apr_strnatcmp.h apr_tables.o: apr_tables.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h ../misc/unix/misc.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_lib.h ../misc/unix/misc.h \ $(INCDIR)/apr_getopt.h diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index 4240ed67dda..40e0aa09967 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -51,22 +51,23 @@ depend: && rm Makefile.new # DO NOT REMOVE -crossproc.o: crossproc.c locks.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr.h \ +crossproc.o: crossproc.c ../../include/apr.h locks.h \ + ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_lib.h \ - ../../include/apr_tables.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_thread_proc.h \ - ../../include/apr_lock.h -intraproc.o: intraproc.c locks.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_pools.h ../../include/apr_thread_proc.h \ + ../../include/apr_file_io.h ../../include/apr_time.h \ + ../../include/apr_tables.h ../../include/apr_lock.h +intraproc.o: intraproc.c locks.h ../../include/apr.h \ + ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_lib.h \ - ../../include/apr_tables.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_thread_proc.h \ - ../../include/apr_lock.h -locks.o: locks.c locks.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_pools.h ../../include/apr_thread_proc.h \ + ../../include/apr_file_io.h ../../include/apr_time.h \ + ../../include/apr_tables.h ../../include/apr_lock.h +locks.o: locks.c locks.h ../../include/apr.h \ + ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_lib.h \ - ../../include/apr_tables.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_thread_proc.h \ - ../../include/apr_lock.h ../../include/apr_portable.h \ - ../../include/apr_network_io.h + ../../include/apr_pools.h ../../include/apr_thread_proc.h \ + ../../include/apr_file_io.h ../../include/apr_time.h \ + ../../include/apr_tables.h ../../include/apr_lock.h \ + ../../include/apr_portable.h ../../include/apr_network_io.h \ + ../../include/apr_dso.h diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index fc8781c68dd..f5c6f8c028f 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -54,39 +54,36 @@ depend: canonerr.o: canonerr.c misc.h ../../include/apr.h \ ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_tables.h \ - ../../include/apr_file_io.h ../../include/apr_time.h \ - ../../include/apr_thread_proc.h ../../include/apr_getopt.h + ../../include/apr_thread_proc.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_getopt.h errorcodes.o: errorcodes.c misc.h ../../include/apr.h \ ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_pools.h \ + ../../include/apr_thread_proc.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_getopt.h \ ../../include/apr_lib.h ../../include/apr_tables.h \ - ../../include/apr_file_io.h ../../include/apr_time.h \ - ../../include/apr_thread_proc.h ../../include/apr_getopt.h \ ../../include/apr_dso.h getopt.o: getopt.c misc.h ../../include/apr.h \ ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_tables.h \ - ../../include/apr_file_io.h ../../include/apr_time.h \ - ../../include/apr_thread_proc.h ../../include/apr_getopt.h -otherchild.o: otherchild.c misc.h ../../include/apr.h \ + ../../include/apr_thread_proc.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_getopt.h +otherchild.o: otherchild.c ../../include/apr.h misc.h \ ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_tables.h \ - ../../include/apr_file_io.h ../../include/apr_time.h \ - ../../include/apr_thread_proc.h ../../include/apr_getopt.h \ - ../../threadproc/unix/threadproc.h ../../file_io/unix/fileio.h + ../../include/apr_thread_proc.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_getopt.h \ + ../../threadproc/unix/threadproc.h ../../file_io/unix/fileio.h \ + ../../include/apr_lib.h ../../include/apr_tables.h rand.o: rand.c misc.h ../../include/apr.h ../../include/apr_private.h \ ../../include/apr_general.h ../../include/apr_errno.h \ - ../../include/apr_pools.h ../../include/apr_lib.h \ - ../../include/apr_tables.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_thread_proc.h \ + ../../include/apr_pools.h ../../include/apr_thread_proc.h \ + ../../include/apr_file_io.h ../../include/apr_time.h \ ../../include/apr_getopt.h start.o: start.c misc.h ../../include/apr.h \ ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_tables.h \ - ../../include/apr_file_io.h ../../include/apr_time.h \ - ../../include/apr_thread_proc.h ../../include/apr_getopt.h \ - ../../locks/unix/locks.h ../../include/apr_lock.h + ../../include/apr_thread_proc.h ../../include/apr_file_io.h \ + ../../include/apr_time.h ../../include/apr_getopt.h \ + ../../locks/unix/locks.h ../../include/apr_lib.h \ + ../../include/apr_tables.h ../../include/apr_lock.h diff --git a/network_io/unix/Makefile.in b/network_io/unix/Makefile.in index 8ebd82879ce..2e372fb4e83 100644 --- a/network_io/unix/Makefile.in +++ b/network_io/unix/Makefile.in @@ -53,34 +53,37 @@ depend: # DO NOT REMOVE inet_aton.o: inet_aton.c $(INCDIR)/apr_private.h -poll.o: poll.c networkio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ +poll.o: poll.c networkio.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_thread_proc.h ../../file_io/unix/fileio.h -sendrecv.o: sendrecv.c networkio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ + ../../file_io/unix/fileio.h +sendrecv.o: sendrecv.c networkio.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_thread_proc.h ../../file_io/unix/fileio.h -sockaddr.o: sockaddr.c networkio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ + ../../file_io/unix/fileio.h +sockaddr.o: sockaddr.c networkio.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_thread_proc.h -sockets.o: sockets.c networkio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h +sockets.o: sockets.c networkio.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_lock.h -sockopt.o: sockopt.c networkio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_dso.h +sockopt.o: sockopt.c networkio.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_thread_proc.h + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index d2cfa8c7595..7299f0c08c1 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -53,42 +53,39 @@ depend: && rm Makefile.new # DO NOT REMOVE -proc.o: proc.c threadproc.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h -procsup.o: procsup.c threadproc.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h -signals.o: signals.c threadproc.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ +proc.o: proc.c threadproc.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h -thread.o: thread.c threadproc.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h +procsup.o: procsup.c threadproc.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h -threadcancel.o: threadcancel.c threadproc.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h +signals.o: signals.c threadproc.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h ../../file_io/unix/fileio.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h -threadpriv.o: threadpriv.c threadproc.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h +thread.o: thread.c $(INCDIR)/apr.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h threadproc.h \ + $(INCDIR)/apr_private.h ../../file_io/unix/fileio.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_tables.h +threadpriv.o: threadpriv.c $(INCDIR)/apr.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_dso.h threadproc.h $(INCDIR)/apr_private.h \ + ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h diff --git a/time/unix/Makefile.in b/time/unix/Makefile.in index 72ee76bb29c..de9b04326e8 100644 --- a/time/unix/Makefile.in +++ b/time/unix/Makefile.in @@ -54,12 +54,14 @@ time.o: time.c $(INCDIR)/apr_portable.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_dso.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h \ $(INCDIR)/apr_private.h timestr.o: timestr.c $(INCDIR)/apr_portable.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_dso.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h \ $(INCDIR)/apr_private.h From 1670cc222d64fcb64f48cac76008dd1ff1521b51 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sat, 8 Jul 2000 11:01:57 +0000 Subject: [PATCH 0341/7878] torch some obsolete/unused functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60316 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/access.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/time/win32/access.c b/time/win32/access.c index 7ec0e4ec7d2..88fbdbe3595 100644 --- a/time/win32/access.c +++ b/time/win32/access.c @@ -240,28 +240,3 @@ ap_status_t ap_set_wday(struct atime_t *time, ap_int32_t value) time->explodedtime->wDayOfWeek = value; return APR_SUCCESS; } - -ap_status_t ap_get_timedata(struct atime_t *atime, char *key, void *data) -{ - if (atime != NULL) { - return ap_get_userdata(data, key, atime->cntxt); - } - else { - data = NULL; - return APR_ENOTIME; - } -} - -ap_status_t ap_set_timedata(struct atime_t *atime, void *data, char *key, - ap_status_t (*cleanup) (void *)) -{ - if (atime != NULL) { - return ap_set_userdata(data, key, cleanup, atime->cntxt); - } - else { - data = NULL; - return APR_ENOTIME; - } -} - - From adbca5c9724777021aa16f8a08625942e7d8192b Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sat, 8 Jul 2000 11:15:53 +0000 Subject: [PATCH 0342/7878] const-ify the userdata interfaces git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60317 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileacc.c | 4 ++-- include/apr_file_io.h | 8 ++++---- include/apr_general.h | 8 ++++---- include/apr_lock.h | 8 ++++---- include/apr_network_io.h | 16 ++++++++-------- include/apr_thread_proc.h | 16 ++++++++-------- locks/beos/locks.c | 4 ++-- locks/unix/locks.c | 4 ++-- locks/win32/locks.c | 4 ++-- misc/unix/start.c | 4 ++-- network_io/beos/poll.c | 4 ++-- network_io/beos/sockets.c | 4 ++-- network_io/os2/sockets.c | 5 +++-- network_io/unix/poll.c | 4 ++-- network_io/unix/sockets.c | 4 ++-- network_io/win32/poll.c | 4 ++-- network_io/win32/sockets.c | 4 ++-- threadproc/unix/thread.c | 4 ++-- threadproc/unix/threadpriv.c | 7 ++++--- threadproc/win32/thread.c | 4 ++-- threadproc/win32/threadpriv.c | 6 ++++-- 21 files changed, 65 insertions(+), 61 deletions(-) diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 4723aada9fa..7039d9e6586 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -139,7 +139,7 @@ ap_fileperms_t ap_unix_mode2perms(mode_t mode) } #endif -ap_status_t ap_get_filedata(void **data, char *key, ap_file_t *file) +ap_status_t ap_get_filedata(void **data, const char *key, ap_file_t *file) { if (file != NULL) { return ap_get_userdata(data, key, file->cntxt); @@ -150,7 +150,7 @@ ap_status_t ap_get_filedata(void **data, char *key, ap_file_t *file) } } -ap_status_t ap_set_filedata(ap_file_t *file, void *data, char *key, +ap_status_t ap_set_filedata(ap_file_t *file, void *data, const char *key, ap_status_t (*cleanup) (void *)) { if (file != NULL) { diff --git a/include/apr_file_io.h b/include/apr_file_io.h index c4c54a40c6a..3b651706102 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -651,7 +651,7 @@ ap_status_t ap_get_dir_filename(char **new_path, ap_dir_t *thedir); /* -=head1 ap_status_t ap_get_filedata(void **data, char *key, ap_file_t *file) +=head1 ap_status_t ap_get_filedata(void **data, const char *key, ap_file_t *file) B @@ -661,11 +661,11 @@ B =cut */ -ap_status_t ap_get_filedata(void **data, char *key, ap_file_t *file); +ap_status_t ap_get_filedata(void **data, const char *key, ap_file_t *file); /* -=head1 ap_status_t ap_set_filedata(ap_file_t *file, void *data, char *key, ap_status_t (*cleanup) (void *)) +=head1 ap_status_t ap_set_filedata(ap_file_t *file, void *data, const char *key, ap_status_t (*cleanup) (void *)) B @@ -676,7 +676,7 @@ B =cut */ -ap_status_t ap_set_filedata(ap_file_t *file, void *data, char *key, +ap_status_t ap_set_filedata(ap_file_t *file, void *data, const char *key, ap_status_t (*cleanup) (void *)); /* diff --git a/include/apr_general.h b/include/apr_general.h index dea1face7ee..625e73253f3 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -326,7 +326,7 @@ ap_status_t ap_exit(ap_pool_t *); /* -=head1 ap_status_t ap_set_userdata(void *data, char *key, ap_status_t (*cleanup) (void *), ap_pool_t *cont) +=head1 ap_status_t ap_set_userdata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_pool_t *cont) B. @@ -346,13 +346,13 @@ B: The data to be attached to the pool should have the same =cut */ -ap_status_t ap_set_userdata(void *data, char *key, +ap_status_t ap_set_userdata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_pool_t *cont); /* -=head1 ap_status_t ap_get_userdata(void **data, char *key, ap_pool_t *cont) +=head1 ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont) B @@ -362,7 +362,7 @@ B =cut */ -ap_status_t ap_get_userdata(void **, char *key, ap_pool_t *cont); +ap_status_t ap_get_userdata(void **, const char *key, ap_pool_t *cont); /* diff --git a/include/apr_lock.h b/include/apr_lock.h index b2ebc2382a8..f2d65676abe 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -162,7 +162,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, /* -=head1 ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data) +=head1 ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) B @@ -172,11 +172,11 @@ B =cut */ -ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data); +ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data); /* -=head1 ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, char *key, ap_status_t (*cleanup) (void *)) +=head1 ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, ap_status_t (*cleanup) (void *)) B @@ -187,7 +187,7 @@ B =cut */ -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, char *key, +ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, ap_status_t (*cleanup) (void *)); #ifdef __cplusplus diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 771fdaf6130..188150afc46 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -274,7 +274,7 @@ ap_status_t ap_gethostname(char *buf, int len, ap_pool_t *cont); /* -=head1 ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock) +=head1 ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock) B @@ -283,11 +283,11 @@ B =cut */ -ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock); +ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock); /* -=head1 ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key, ap_status_t (*cleanup) (void *)) +=head1 ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, ap_status_t (*cleanup) (void *)) B @@ -298,7 +298,7 @@ B =cut */ -ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key, +ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, ap_status_t (*cleanup) (void*)); /* @@ -716,7 +716,7 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, /* -=head1 ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data) +=head1 ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data) B @@ -726,11 +726,11 @@ B =cut */ -ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data); +ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data); /* -=head1 ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key, ap_status_t (*cleanup) (void *)) +=head1 ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, ap_status_t (*cleanup) (void *)) B @@ -739,7 +739,7 @@ B =cut */ -ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key, +ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, ap_status_t (*cleanup) (void *)); /* diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 84d5b194cb1..6697e19c31c 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -211,7 +211,7 @@ ap_status_t ap_thread_detach(ap_thread_t *thd); /* -=head1 ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t *thread) +=head1 ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread) B @@ -221,11 +221,11 @@ B =cut */ -ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t *thread); +ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread); /* -=head1 ap_status_t ap_set_threaddata(void *data, char *key, ap_status_t (*cleanup) (void *), ap_thread_t *thread) +=head1 ap_status_t ap_set_threaddata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_thread_t *thread) B @@ -236,7 +236,7 @@ B =cut */ -ap_status_t ap_set_threaddata(void *data, char *key, +ap_status_t ap_set_threaddata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_thread_t *thread); @@ -295,7 +295,7 @@ ap_status_t ap_delete_thread_private(ap_threadkey_t *key); /* -=head1 ap_status_t ap_get_threadkeydata(void **data, char *key, ap_threadkey_t *threadkey) +=head1 ap_status_t ap_get_threadkeydata(void **data, const char *key, ap_threadkey_t *threadkey) B @@ -305,11 +305,11 @@ B =cut */ -ap_status_t ap_get_threadkeydata(void **data, char *key, ap_threadkey_t *threadkey); +ap_status_t ap_get_threadkeydata(void **data, const char *key, ap_threadkey_t *threadkey); /* -=head1 ap_status_t ap_set_threadkeydata(void *data, char *key, ap_status_t (*cleanup) (void *), ap_threadkey_t *threadkey) +=head1 ap_status_t ap_set_threadkeydata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_threadkey_t *threadkey) B @@ -320,7 +320,7 @@ B =cut */ -ap_status_t ap_set_threadkeydata(void *data, char *key, +ap_status_t ap_set_threadkeydata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_threadkey_t *threadkey); diff --git a/locks/beos/locks.c b/locks/beos/locks.c index 362b281771c..dbf571bdcae 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -146,7 +146,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, return APR_SUCCESS; } -ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data) +ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) { if (lock != NULL) { return ap_get_userdata(data, key, lock->cntxt); @@ -157,7 +157,7 @@ ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data) } } -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, char *key, +ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, ap_status_t (*cleanup) (void *)) { if (lock != NULL) { diff --git a/locks/unix/locks.c b/locks/unix/locks.c index d36c4e1cd9d..5eaa83319a9 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -167,7 +167,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, return APR_SUCCESS; } -ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data) +ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) { if (lock != NULL) { return ap_get_userdata(data, key, lock->cntxt); @@ -178,7 +178,7 @@ ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data) } } -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, char *key, +ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, ap_status_t (*cleanup) (void *)) { if (lock != NULL) { diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 3df71e7ef20..5cdc26dc14f 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -154,7 +154,7 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data) +ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) { if (lock != NULL) { return ap_get_userdata(data, key, lock->cntxt); @@ -165,7 +165,7 @@ ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data) } } -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, char *key, +ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, ap_status_t (*cleanup) (void *)) { if (lock != NULL) { diff --git a/misc/unix/start.c b/misc/unix/start.c index d66c50a95f3..18a3f23420b 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -77,7 +77,7 @@ ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_set_userdata(void *data, char *key, +ap_status_t ap_set_userdata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_pool_t *cont) { @@ -109,7 +109,7 @@ ap_status_t ap_set_userdata(void *data, char *key, return APR_ENOPOOL; } -ap_status_t ap_get_userdata(void **data, char *key, ap_pool_t *cont) +ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont) { datastruct *dptr = NULL; if (cont) { diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index 258b000a51b..d41047f17cb 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -198,7 +198,7 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) return APR_SUCCESS; } -ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data) +ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data) { if (pollfd != NULL) { return ap_get_userdata(data, key, pollfd->cntxt); @@ -209,7 +209,7 @@ ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data) } } -ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key, +ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, ap_status_t (*cleanup) (void *)) { if (pollfd != NULL) { diff --git a/network_io/beos/sockets.c b/network_io/beos/sockets.c index 0a9495f46b6..84539cbb778 100644 --- a/network_io/beos/sockets.c +++ b/network_io/beos/sockets.c @@ -190,7 +190,7 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) return APR_SUCCESS; } -ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock) +ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock) { if (socket != NULL) { return ap_get_userdata(data, key, sock->cntxt); @@ -201,7 +201,7 @@ ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock) } } -ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key, +ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, ap_status_t (*cleanup) (void *)) { if (sock != NULL) { diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 61f5b1959c1..63f4b031b98 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -206,7 +206,8 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) -ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *socket) +ap_status_t ap_get_socketdata(void **data, const char *key, + ap_socket_t *socket) { if (socket != NULL) { return ap_get_userdata(data, key, socket->cntxt); @@ -219,7 +220,7 @@ ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *socket) -ap_status_t ap_set_socketdata(ap_socket_t *socket, void *data, char *key, +ap_status_t ap_set_socketdata(ap_socket_t *socket, void *data, const char *key, ap_status_t (*cleanup) (void *)) { if (socket != NULL) { diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index 853e445dd57..35b2354c8c4 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -357,7 +357,7 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) #endif -ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data) +ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data) { if (pollfd != NULL) { return ap_get_userdata(data, key, pollfd->cntxt); @@ -368,7 +368,7 @@ ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data) } } -ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key, +ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, ap_status_t (*cleanup) (void *)) { if (pollfd != NULL) { diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 764d6861a00..cdf8042c374 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -231,12 +231,12 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) } } -ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock) +ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock) { return ap_get_userdata(data, key, sock->cntxt); } -ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key, +ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, ap_status_t (*cleanup) (void *)) { return ap_set_userdata(data, key, cleanup, sock->cntxt); diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index b252e131d02..242f5c1d1b2 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -193,7 +193,7 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap return APR_SUCCESS; } -ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data) +ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data) { if (pollfd != NULL) { return ap_get_userdata(data, key, pollfd->cntxt); @@ -204,7 +204,7 @@ ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data) } } -ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key, +ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, ap_status_t (*cleanup) (void *)) { if (pollfd != NULL) { diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index c2429808f0a..147c000ffc8 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -232,12 +232,12 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) } } -ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *socket) +ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *socket) { return ap_get_userdata(data, key, socket->cntxt); } -ap_status_t ap_set_socketdata(ap_socket_t *socket, void *data, char *key, +ap_status_t ap_set_socketdata(ap_socket_t *socket, void *data, const char *key, ap_status_t (*cleanup) (void *)) { return ap_set_userdata(data, key, cleanup, socket->cntxt); diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 97db69de38a..3852525f606 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -184,7 +184,7 @@ ap_status_t ap_thread_detach(ap_thread_t *thd) } } -ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t *thread) +ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread) { if (thread != NULL) { return ap_get_userdata(data, key, thread->cntxt); @@ -195,7 +195,7 @@ ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t *thread) } } -ap_status_t ap_set_threaddata(void *data, char *key, +ap_status_t ap_set_threaddata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_thread_t *thread) { diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index b783f9699a1..2100fad23c8 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -108,7 +108,8 @@ ap_status_t ap_delete_thread_private(ap_threadkey_t *key) return stat; } -ap_status_t ap_get_threadkeydata(void **data, char *key, ap_threadkey_t *threadkey) +ap_status_t ap_get_threadkeydata(void **data, const char *key, + ap_threadkey_t *threadkey) { if (threadkey != NULL) { return ap_get_userdata(data, key, threadkey->cntxt); @@ -119,8 +120,8 @@ ap_status_t ap_get_threadkeydata(void **data, char *key, ap_threadkey_t *threadk } } -ap_status_t ap_set_threadkeydata(void *data, - char *key, ap_status_t (*cleanup) (void *), +ap_status_t ap_set_threadkeydata(void *data, const char *key, + ap_status_t (*cleanup) (void *), ap_threadkey_t *threadkey) { if (threadkey != NULL) { diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index fcebc75f789..d952839011a 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -156,7 +156,7 @@ ap_status_t ap_thread_detach(ap_thread_t *thd) } } -ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t *thread) +ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread) { if (thread != NULL) { return ap_get_userdata(data, key, thread->cntxt); @@ -167,7 +167,7 @@ ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t *thread) } } -ap_status_t ap_set_threaddata(void *data, char *key, +ap_status_t ap_set_threaddata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_thread_t *thread) { diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index a05b6f16725..872b348af60 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -92,7 +92,8 @@ ap_status_t ap_delete_thread_private(ap_threadkey_t *key) return GetLastError(); } -ap_status_t ap_get_threadkeydata(void **data, char *key, ap_threadkey_t *threadkey) +ap_status_t ap_get_threadkeydata(void **data, const char *key, + ap_threadkey_t *threadkey) { if (threadkey != NULL) { return ap_get_userdata(data, key, threadkey->cntxt); @@ -103,7 +104,8 @@ ap_status_t ap_get_threadkeydata(void **data, char *key, ap_threadkey_t *threadk } } -ap_status_t ap_set_threadkeydata(void *data, char *key, ap_status_t (*cleanup) (void *), +ap_status_t ap_set_threadkeydata(void *data, const char *key, + ap_status_t (*cleanup) (void *), ap_threadkey_t *threadkey) { if (threadkey != NULL) { From 92db9df2c2a8b9ef87a49dd940990709194cbe09 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sat, 8 Jul 2000 11:31:49 +0000 Subject: [PATCH 0343/7878] a while back, we said "segfault on invalid params rather than returning an error." this removes some of the error checking that was occurring in the "user data" functions. also saw some in the "get/set OS type" functions and nuked those; there are still checks for pool==NULL, though, since that would end up making us malloc() rather than segfault'ing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60318 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileacc.c | 27 ++-------- locks/beos/locks.c | 16 +----- locks/unix/locks.c | 19 +------ locks/win32/locks.c | 20 ++----- misc/unix/start.c | 98 ++++++++++++++++------------------- network_io/beos/poll.c | 18 ++----- network_io/beos/sockets.c | 21 ++------ network_io/os2/sockets.c | 19 +------ network_io/unix/poll.c | 16 +----- network_io/win32/poll.c | 16 +----- threadproc/unix/thread.c | 20 ++----- threadproc/unix/threadpriv.c | 24 ++------- threadproc/win32/thread.c | 17 ++---- threadproc/win32/threadpriv.c | 20 ++----- 14 files changed, 84 insertions(+), 267 deletions(-) diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 7039d9e6586..e64336421fb 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -69,16 +69,10 @@ #endif /* A file to put ALL of the accessor functions for ap_file_t types. */ -ap_status_t ap_get_filename(char **new, ap_file_t *thefile) +ap_status_t ap_get_filename(char **fname, ap_file_t *thefile) { - if (thefile != NULL) { - *new = ap_pstrdup(thefile->cntxt, thefile->fname); - return APR_SUCCESS; - } - else { - *new = NULL; - return APR_ENOFILE; - } + *fname = ap_pstrdup(thefile->cntxt, thefile->fname); + return APR_SUCCESS; } #if !defined(OS2) && !defined(WIN32) @@ -141,22 +135,11 @@ ap_fileperms_t ap_unix_mode2perms(mode_t mode) ap_status_t ap_get_filedata(void **data, const char *key, ap_file_t *file) { - if (file != NULL) { - return ap_get_userdata(data, key, file->cntxt); - } - else { - *data = NULL; - return APR_ENOFILE; - } + return ap_get_userdata(data, key, file->cntxt); } ap_status_t ap_set_filedata(ap_file_t *file, void *data, const char *key, ap_status_t (*cleanup) (void *)) { - if (file != NULL) { - return ap_set_userdata(data, key, cleanup, file->cntxt); - } - else { - return APR_ENOFILE; - } + return ap_set_userdata(data, key, cleanup, file->cntxt); } diff --git a/locks/beos/locks.c b/locks/beos/locks.c index dbf571bdcae..18c9ebea9c9 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -148,24 +148,12 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) { - if (lock != NULL) { - return ap_get_userdata(data, key, lock->cntxt); - } - else { - data = NULL; - return APR_ENOLOCK; - } + return ap_get_userdata(data, key, lock->cntxt); } ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, ap_status_t (*cleanup) (void *)) { - if (lock != NULL) { - return ap_set_userdata(data, key, cleanup, lock->cntxt); - } - else { - data = NULL; - return APR_ENOLOCK; - } + return ap_set_userdata(data, key, cleanup, lock->cntxt); } diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 5eaa83319a9..8e9784017fe 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -169,32 +169,17 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) { - if (lock != NULL) { - return ap_get_userdata(data, key, lock->cntxt); - } - else { - data = NULL; - return APR_ENOLOCK; - } + return ap_get_userdata(data, key, lock->cntxt); } ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, ap_status_t (*cleanup) (void *)) { - if (lock != NULL) { - return ap_set_userdata(data, key, cleanup, lock->cntxt); - } - else { - data = NULL; - return APR_ENOLOCK; - } + return ap_set_userdata(data, key, cleanup, lock->cntxt); } ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock) { - if (lock == NULL) { - return APR_ENOLOCK; - } oslock->crossproc = lock->interproc; #if APR_HAS_THREADS #if APR_USE_PTHREAD_SERIALIZE diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 5cdc26dc14f..d8ac24edd09 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -156,32 +156,18 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock) ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) { - if (lock != NULL) { - return ap_get_userdata(data, key, lock->cntxt); - } - else { - data = NULL; - return APR_ENOLOCK; - } + return ap_get_userdata(data, key, lock->cntxt); } ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, ap_status_t (*cleanup) (void *)) { - if (lock != NULL) { - return ap_set_userdata(data, key, cleanup, lock->cntxt); - } - else { - data = NULL; - return APR_ENOLOCK; - } + return ap_set_userdata(data, key, cleanup, lock->cntxt); } ap_status_t ap_get_os_lock(ap_os_lock_t *thelock, ap_lock_t *lock) { - if (lock == NULL) { - return APR_ENOFILE; - } + /* ### this is broken. is the signature broken? */ thelock = &(lock->mutex); return APR_SUCCESS; } diff --git a/misc/unix/start.c b/misc/unix/start.c index 18a3f23420b..ab8ee4d3dc0 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -57,23 +57,23 @@ ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont) { - ap_pool_t *new; + ap_pool_t *newpool; if (cont) { - new = ap_make_sub_pool(cont, cont->apr_abort); + newpool = ap_make_sub_pool(cont, cont->apr_abort); } else { - new = ap_make_sub_pool(NULL, NULL); + newpool = ap_make_sub_pool(NULL, NULL); } - if (new == NULL) { + if (newpool == NULL) { return APR_ENOPOOL; } - new->prog_data = NULL; - new->apr_abort = NULL; + newpool->prog_data = NULL; + newpool->apr_abort = NULL; - *newcont = new; + *newcont = newpool; return APR_SUCCESS; } @@ -82,53 +82,53 @@ ap_status_t ap_set_userdata(void *data, const char *key, ap_pool_t *cont) { datastruct *dptr = NULL, *dptr2 = NULL; - if (cont) { - dptr = cont->prog_data; - while (dptr) { - if (!strcmp(dptr->key, key)) - break; - dptr2 = dptr; - dptr = dptr->next; + + /* ### replace with an ap_hash_t */ + + dptr = cont->prog_data; + while (dptr) { + if (!strcmp(dptr->key, key)) + break; + dptr2 = dptr; + dptr = dptr->next; + } + if (dptr == NULL) { + dptr = ap_pcalloc(cont, sizeof(datastruct)); + dptr->next = dptr->prev = NULL; + dptr->key = ap_pstrdup(cont, key); + if (dptr2) { + dptr2->next = dptr; + dptr->prev = dptr2; } - if (dptr == NULL) { - dptr = ap_pcalloc(cont, sizeof(datastruct)); - dptr->next = dptr->prev = NULL; - dptr->key = ap_pstrdup(cont, key); - if (dptr2) { - dptr2->next = dptr; - dptr->prev = dptr2; - } - else { - cont->prog_data = dptr; - } + else { + cont->prog_data = dptr; } - dptr->data = data; - ap_register_cleanup(cont, dptr->data, cleanup, cleanup); - return APR_SUCCESS; } - return APR_ENOPOOL; + dptr->data = data; + ap_register_cleanup(cont, dptr->data, cleanup, cleanup); + return APR_SUCCESS; } ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont) { datastruct *dptr = NULL; - if (cont) { - dptr = cont->prog_data; - while (dptr) { - if (!strcmp(dptr->key, key)) { - break; - } - dptr = dptr->next; - } - if (dptr) { - (*data) = dptr->data; - } - else { - (*data) = NULL; + + /* ### replace with an ap_hash_t */ + + dptr = cont->prog_data; + while (dptr) { + if (!strcmp(dptr->key, key)) { + break; } - return APR_SUCCESS; + dptr = dptr->next; } - return APR_ENOPOOL; + if (dptr) { + (*data) = dptr->data; + } + else { + (*data) = NULL; + } + return APR_SUCCESS; } ap_status_t ap_initialize(void) @@ -163,12 +163,6 @@ void ap_terminate(void) ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_pool_t *cont) { - if (cont == NULL) { - return APR_ENOPOOL; - } - else { - cont->apr_abort = apr_abort; - return APR_SUCCESS; - } + cont->apr_abort = apr_abort; + return APR_SUCCESS; } - diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index d41047f17cb..dffc8d43b4f 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -200,25 +200,13 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data) { - if (pollfd != NULL) { - return ap_get_userdata(data, key, pollfd->cntxt); - } - else { - data = NULL; - return APR_ENOFILE; - } + return ap_get_userdata(data, key, pollfd->cntxt); } ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, ap_status_t (*cleanup) (void *)) { - if (pollfd != NULL) { - return ap_set_userdata(data, key, cleanup, pollfd->cntxt); - } - else { - data = NULL; - return APR_ENOFILE; - } + return ap_set_userdata(data, key, cleanup, pollfd->cntxt); } -#endif +#endif /* BEOS_BONE */ diff --git a/network_io/beos/sockets.c b/network_io/beos/sockets.c index 84539cbb778..671492bfa65 100644 --- a/network_io/beos/sockets.c +++ b/network_io/beos/sockets.c @@ -192,32 +192,17 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock) { - if (socket != NULL) { - return ap_get_userdata(data, key, sock->cntxt); - } - else { - data = NULL; - return APR_ENOSOCKET; - } + return ap_get_userdata(data, key, sock->cntxt); } ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, ap_status_t (*cleanup) (void *)) { - if (sock != NULL) { - return ap_set_userdata(data, key, cleanup, sock->cntxt); - } - else { - data = NULL; - return APR_ENOSOCKET; - } + return ap_set_userdata(data, key, cleanup, sock->cntxt); } ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) { - if (sock == NULL) { - return APR_ENOSOCKET; - } *thesock = sock->socketdes; return APR_SUCCESS; } @@ -235,4 +220,4 @@ ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, (*sock)->socketdes = *thesock; return APR_SUCCESS; } -#endif +#endif /* BEOS_BONE */ diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 63f4b031b98..ddd58151005 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -209,13 +209,7 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *socket) { - if (socket != NULL) { - return ap_get_userdata(data, key, socket->cntxt); - } - else { - data = NULL; - return APR_ENOSOCKET; - } + return ap_get_userdata(data, key, socket->cntxt); } @@ -223,20 +217,11 @@ ap_status_t ap_get_socketdata(void **data, const char *key, ap_status_t ap_set_socketdata(ap_socket_t *socket, void *data, const char *key, ap_status_t (*cleanup) (void *)) { - if (socket != NULL) { - return ap_set_userdata(data, key, cleanup, socket->cntxt); - } - else { - data = NULL; - return APR_ENOSOCKET; - } + return ap_set_userdata(data, key, cleanup, socket->cntxt); } ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) { - if (sock == NULL) { - return APR_ENOSOCKET; - } *thesock = sock->socketdes; return APR_SUCCESS; } diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index 35b2354c8c4..a946f5b5147 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -359,25 +359,13 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data) { - if (pollfd != NULL) { - return ap_get_userdata(data, key, pollfd->cntxt); - } - else { - data = NULL; - return APR_ENOFILE; - } + return ap_get_userdata(data, key, pollfd->cntxt); } ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, ap_status_t (*cleanup) (void *)) { - if (pollfd != NULL) { - return ap_set_userdata(data, key, cleanup, pollfd->cntxt); - } - else { - data = NULL; - return APR_ENOFILE; - } + return ap_set_userdata(data, key, cleanup, pollfd->cntxt); } #if APR_FILES_AS_SOCKETS diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 242f5c1d1b2..11e9e35bb45 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -195,25 +195,13 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data) { - if (pollfd != NULL) { - return ap_get_userdata(data, key, pollfd->cntxt); - } - else { - data = NULL; - return APR_ENOFILE; - } + return ap_get_userdata(data, key, pollfd->cntxt); } ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, ap_status_t (*cleanup) (void *)) { - if (pollfd != NULL) { - return ap_set_userdata(data, key, cleanup, pollfd->cntxt); - } - else { - data = NULL; - return APR_ENOFILE; - } + return ap_set_userdata(data, key, cleanup, pollfd->cntxt); } ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 3852525f606..03ac8c242ae 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -186,33 +186,19 @@ ap_status_t ap_thread_detach(ap_thread_t *thd) ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread) { - if (thread != NULL) { - return ap_get_userdata(data, key, thread->cntxt); - } - else { - data = NULL; - return APR_ENOTHREAD; - } + return ap_get_userdata(data, key, thread->cntxt); } ap_status_t ap_set_threaddata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_thread_t *thread) { - if (thread != NULL) { - return ap_set_userdata(data, key, cleanup, thread->cntxt); - } - else { - data = NULL; - return APR_ENOTHREAD; - } + return ap_set_userdata(data, key, cleanup, thread->cntxt); } ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, ap_thread_t *thd) { - if (thd == NULL) { - return APR_ENOTHREAD; - } + /* ### broken. is the signature broken? */ thethd = thd->td; return APR_SUCCESS; } diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 2100fad23c8..5b8f3aaa907 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -111,33 +111,19 @@ ap_status_t ap_delete_thread_private(ap_threadkey_t *key) ap_status_t ap_get_threadkeydata(void **data, const char *key, ap_threadkey_t *threadkey) { - if (threadkey != NULL) { - return ap_get_userdata(data, key, threadkey->cntxt); - } - else { - data = NULL; - return APR_ENOTHDKEY; - } + return ap_get_userdata(data, key, threadkey->cntxt); } ap_status_t ap_set_threadkeydata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_threadkey_t *threadkey) { - if (threadkey != NULL) { - return ap_set_userdata(data, key, cleanup, threadkey->cntxt); - } - else { - data = NULL; - return APR_ENOTHDKEY; - } + return ap_set_userdata(data, key, cleanup, threadkey->cntxt); } ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key) { - if (key == NULL) { - return APR_ENOFILE; - } + /* ### broken. is the signature broken? */ thekey = &(key->key); return APR_SUCCESS; } @@ -155,5 +141,5 @@ ap_status_t ap_put_os_threadkey(ap_threadkey_t **key, (*key)->key = *thekey; return APR_SUCCESS; } -#endif -#endif +#endif /* APR_HAVE_PTHREAD_H */ +#endif /* APR_HAS_THREADS */ diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index d952839011a..d9d58a69374 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -158,26 +158,14 @@ ap_status_t ap_thread_detach(ap_thread_t *thd) ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread) { - if (thread != NULL) { - return ap_get_userdata(data, key, thread->cntxt); - } - else { - data = NULL; - return APR_ENOTHREAD; - } + return ap_get_userdata(data, key, thread->cntxt); } ap_status_t ap_set_threaddata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_thread_t *thread) { - if (thread != NULL) { - return ap_set_userdata(data, key, cleanup, thread->cntxt); - } - else { - data = NULL; - return APR_ENOTHREAD; - } + return ap_set_userdata(data, key, cleanup, thread->cntxt); } ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, ap_thread_t *thd) @@ -185,6 +173,7 @@ ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, ap_thread_t *thd) if (thd == NULL) { return APR_ENOTHREAD; } + /* ### this is broken. is the signature broken? */ thethd = thd->td; return APR_SUCCESS; } diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 872b348af60..dc5d0f3a715 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -95,33 +95,19 @@ ap_status_t ap_delete_thread_private(ap_threadkey_t *key) ap_status_t ap_get_threadkeydata(void **data, const char *key, ap_threadkey_t *threadkey) { - if (threadkey != NULL) { - return ap_get_userdata(data, key, threadkey->cntxt); - } - else { - data = NULL; - return APR_ENOTHDKEY; - } + return ap_get_userdata(data, key, threadkey->cntxt); } ap_status_t ap_set_threadkeydata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_threadkey_t *threadkey) { - if (threadkey != NULL) { - return ap_set_userdata(data, key, cleanup, threadkey->cntxt); - } - else { - data = NULL; - return APR_ENOTHDKEY; - } + return ap_set_userdata(data, key, cleanup, threadkey->cntxt); } ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key) { - if (key == NULL) { - return APR_ENOFILE; - } + /* ### this is broken. dunno if the signature is broken... */ thekey = &(key->key); return APR_SUCCESS; } From 55de5ccbaa1b82c544bf443e59679a8797a7096b Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sat, 8 Jul 2000 11:57:15 +0000 Subject: [PATCH 0344/7878] const-ify the cleanup functions remove some useless "struct" keywords in apr_pools.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60319 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 31 +++++++++++++++++-------------- lib/apr_pools.c | 14 +++++++------- memory/unix/apr_pools.c | 14 +++++++------- 3 files changed, 31 insertions(+), 28 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 0bd983186d9..2d0a937cb67 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -180,7 +180,7 @@ B: This does not actually free the memory, it just allows the pool =cut */ -APR_EXPORT(void) ap_clear_pool(struct ap_pool_t *p); +APR_EXPORT(void) ap_clear_pool(ap_pool_t *p); /* @@ -194,7 +194,7 @@ B: This will actually free the memory =cut */ -APR_EXPORT(void) ap_destroy_pool(struct ap_pool_t *p); +APR_EXPORT(void) ap_destroy_pool(ap_pool_t *p); /* @@ -248,7 +248,7 @@ B =cut */ -APR_EXPORT(void *) ap_palloc(struct ap_pool_t *c, ap_size_t reqsize); +APR_EXPORT(void *) ap_palloc(ap_pool_t *c, ap_size_t reqsize); /* @@ -262,7 +262,7 @@ B =cut */ -APR_EXPORT(void *) ap_pcalloc(struct ap_pool_t *p, ap_size_t size); +APR_EXPORT(void *) ap_pcalloc(ap_pool_t *p, ap_size_t size); /* @@ -276,7 +276,7 @@ B =cut */ -APR_EXPORT(char *) ap_pstrdup(struct ap_pool_t *p, const char *s); +APR_EXPORT(char *) ap_pstrdup(ap_pool_t *p, const char *s); /* @@ -291,7 +291,7 @@ B =cut */ -APR_EXPORT_NONSTD(char *) ap_pstrcat(struct ap_pool_t *p, ...); +APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *p, ...); /* @@ -320,7 +320,7 @@ B @@ -350,13 +352,14 @@ B =cut */ -APR_EXPORT(void) ap_register_cleanup(struct ap_pool_t *p, void *data, +APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, const void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)); /* -=head1 void ap_kill_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup(void *)) +=head1 void ap_kill_cleanup(ap_pool_t *p, const void *data, + ap_status_t (*cleanup(void *)) B @@ -366,7 +369,7 @@ B =cut */ -APR_EXPORT(void) ap_kill_cleanup(struct ap_pool_t *p, void *data, +APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, const void *data, ap_status_t (*cleanup) (void *)); /* @@ -381,7 +384,7 @@ B =cut */ -APR_EXPORT(ap_status_t) ap_run_cleanup(struct ap_pool_t *p, void *data, +APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)); /* diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 77f0490f47f..a3289977880 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -530,13 +530,13 @@ static void dump_stats(void) */ struct cleanup { - void *data; + const void *data; ap_status_t (*plain_cleanup) (void *); ap_status_t (*child_cleanup) (void *); struct cleanup *next; }; -APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, void *data, +APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, const void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)) { @@ -552,8 +552,8 @@ APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, void *data, } } -APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)) +APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, const void *data, + ap_status_t (*cleanup) (void *)) { struct cleanup *c; struct cleanup **lastp; @@ -574,7 +574,7 @@ APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, } APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)) + ap_status_t (*cleanup) (void *)) { ap_kill_cleanup(p, data, cleanup); return (*cleanup) (data); @@ -583,7 +583,7 @@ APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, static void run_cleanups(struct cleanup *c) { while (c) { - (*c->plain_cleanup) (c->data); + (*c->plain_cleanup) ((void *)c->data); c = c->next; } } @@ -591,7 +591,7 @@ static void run_cleanups(struct cleanup *c) static void run_child_cleanups(struct cleanup *c) { while (c) { - (*c->child_cleanup) (c->data); + (*c->child_cleanup) ((void *)c->data); c = c->next; } } diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 77f0490f47f..a3289977880 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -530,13 +530,13 @@ static void dump_stats(void) */ struct cleanup { - void *data; + const void *data; ap_status_t (*plain_cleanup) (void *); ap_status_t (*child_cleanup) (void *); struct cleanup *next; }; -APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, void *data, +APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, const void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)) { @@ -552,8 +552,8 @@ APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, void *data, } } -APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)) +APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, const void *data, + ap_status_t (*cleanup) (void *)) { struct cleanup *c; struct cleanup **lastp; @@ -574,7 +574,7 @@ APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, } APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)) + ap_status_t (*cleanup) (void *)) { ap_kill_cleanup(p, data, cleanup); return (*cleanup) (data); @@ -583,7 +583,7 @@ APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, static void run_cleanups(struct cleanup *c) { while (c) { - (*c->plain_cleanup) (c->data); + (*c->plain_cleanup) ((void *)c->data); c = c->next; } } @@ -591,7 +591,7 @@ static void run_cleanups(struct cleanup *c) static void run_child_cleanups(struct cleanup *c) { while (c) { - (*c->child_cleanup) (c->data); + (*c->child_cleanup) ((void *)c->data); c = c->next; } } From 79caca86fbf34b75fb1165cb782a77e0094f67f7 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sat, 8 Jul 2000 11:59:48 +0000 Subject: [PATCH 0345/7878] damn. went through all that work to const-ify "key" but missed the data. I'll get the rest later, but this constifies the two core userdata functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60320 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 4 ++-- include/arch/unix/misc.h | 4 ++-- include/arch/win32/misc.h | 4 ++-- misc/unix/misc.h | 4 ++-- misc/unix/start.c | 7 +++++-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index 625e73253f3..1af22b9874a 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -346,7 +346,7 @@ B: The data to be attached to the pool should have the same =cut */ -ap_status_t ap_set_userdata(void *data, const char *key, +ap_status_t ap_set_userdata(const void *data, const char *key, ap_status_t (*cleanup) (void *), ap_pool_t *cont); @@ -362,7 +362,7 @@ B =cut */ -ap_status_t ap_get_userdata(void **, const char *key, ap_pool_t *cont); +ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont); /* diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index c659a4698fa..7a364850286 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -84,8 +84,8 @@ #endif typedef struct datastruct { - void *data; - char *key; + const void *data; + const char *key; struct datastruct *next; struct datastruct *prev; } datastruct; diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index c659a4698fa..7a364850286 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -84,8 +84,8 @@ #endif typedef struct datastruct { - void *data; - char *key; + const void *data; + const char *key; struct datastruct *next; struct datastruct *prev; } datastruct; diff --git a/misc/unix/misc.h b/misc/unix/misc.h index c659a4698fa..7a364850286 100644 --- a/misc/unix/misc.h +++ b/misc/unix/misc.h @@ -84,8 +84,8 @@ #endif typedef struct datastruct { - void *data; - char *key; + const void *data; + const char *key; struct datastruct *next; struct datastruct *prev; } datastruct; diff --git a/misc/unix/start.c b/misc/unix/start.c index ab8ee4d3dc0..c84782f0ddd 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -77,7 +77,7 @@ ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_set_userdata(void *data, const char *key, +ap_status_t ap_set_userdata(const void *data, const char *key, ap_status_t (*cleanup) (void *), ap_pool_t *cont) { @@ -123,7 +123,10 @@ ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont) dptr = dptr->next; } if (dptr) { - (*data) = dptr->data; + /* ->data is const because we never change it. however, we want to + cast because the caller may want to change the contents (and + it knows whether it can). */ + (*data) = (void *)dptr->data; } else { (*data) = NULL; From be6ad3a493a72df52fe72d436b0b49a73523ae5f Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Sun, 9 Jul 2000 16:27:27 +0000 Subject: [PATCH 0346/7878] Make depend. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60321 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/Makefile.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index 7299f0c08c1..18df47393d5 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -81,6 +81,12 @@ thread.o: thread.c $(INCDIR)/apr.h $(INCDIR)/apr_portable.h \ $(INCDIR)/apr_private.h ../../file_io/unix/fileio.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_tables.h +threadcancel.o: threadcancel.c threadproc.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h threadpriv.o: threadpriv.c $(INCDIR)/apr.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ From 081e083232154543080891e062f6e06e270c2961 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 10 Jul 2000 02:58:20 +0000 Subject: [PATCH 0347/7878] const-ify the hash table interfaces/implementation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60322 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 15 +++++++++------ lib/apr_hash.c | 24 ++++++++++++------------ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index bba7680f9fa..e70d8b78f49 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -85,7 +85,8 @@ ap_hash_t *ap_make_hash(ap_pool_t *pool); /* -=head1 void ap_hash_set(ap_hash_t *ht, void *key, size_t klen, void *val) +=head1 void ap_hash_set(ap_hash_t *ht, const void *key, size_t klen, + const void *val) B @@ -99,11 +100,11 @@ If the value is NULL the hash entry is deleted. =cut */ -void ap_hash_set(ap_hash_t *ht, void *key, size_t klen, void *val); +void ap_hash_set(ap_hash_t *ht, const void *key, size_t klen, const void *val); /* -=head1 void *ap_hash_get(ap_hash_t *ht, void *key, size_t klen) +=head1 void *ap_hash_get(ap_hash_t *ht, const void *key, size_t klen) B @@ -116,7 +117,7 @@ Returns NULL if the key is not present. =cut */ -void *ap_hash_get(ap_hash_t *ht, void *key, size_t klen); +void *ap_hash_get(ap_hash_t *ht, const void *key, size_t klen); /* @@ -149,7 +150,8 @@ ap_hash_index_t *ap_hash_next(ap_hash_index_t *hi); /* -=head1 void ap_hash_this(ap_hash_index_t *hi, void **key, size_t *klen, void **val) +=head1 void ap_hash_this(ap_hash_index_t *hi, const void **key, size_t *klen, + void **val) B @@ -163,7 +165,8 @@ corresponding data, or they may be NULL if the data isn't interesting. =cut */ -void ap_hash_this(ap_hash_index_t *hi, void **key, size_t *klen, void **val); +void ap_hash_this(ap_hash_index_t *hi, const void **key, size_t *klen, + void **val); /* diff --git a/lib/apr_hash.c b/lib/apr_hash.c index 5033c8a08b1..e2162e17672 100644 --- a/lib/apr_hash.c +++ b/lib/apr_hash.c @@ -85,9 +85,9 @@ typedef struct ap_hash_entry_t ap_hash_entry_t; struct ap_hash_entry_t { ap_hash_entry_t *next; int hash; - void *key; + const void *key; size_t klen; - void *val; + const void *val; }; /* @@ -167,13 +167,13 @@ APR_EXPORT(ap_hash_index_t *) ap_hash_first(ap_hash_t *ht) } APR_EXPORT(void) ap_hash_this(ap_hash_index_t *hi, - void **key, + const void **key, size_t *klen, - void **val) + void **val) { if (key) *key = hi->this->key; if (klen) *klen = hi->this->klen; - if (val) *val = hi->this->val; + if (val) *val = (void *)hi->this->val; } @@ -206,12 +206,12 @@ static void resize_array(ap_hash_t *ht) */ static ap_hash_entry_t **find_entry(ap_hash_t *ht, - void *key, + const void *key, size_t klen, - void *val) + const void *val) { ap_hash_entry_t **hep, *he; - unsigned char *p; + const unsigned char *p; int hash; int i; @@ -254,21 +254,21 @@ static ap_hash_entry_t **find_entry(ap_hash_t *ht, } APR_EXPORT(void *) ap_hash_get(ap_hash_t *ht, - void *key, + const void *key, size_t klen) { ap_hash_entry_t *he; he = *find_entry(ht, key, klen, NULL); if (he) - return he->val; + return (void *)he->val; else return NULL; } APR_EXPORT(void) ap_hash_set(ap_hash_t *ht, - void *key, + const void *key, size_t klen, - void *val) + const void *val) { ap_hash_entry_t **hep; hep = find_entry(ht, key, klen, val); From 84f8836f71cfe2fbfee901a63df837dc801a7822 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 10 Jul 2000 23:00:32 +0000 Subject: [PATCH 0348/7878] A nit... PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60323 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index fa7d818fc88..954e4855fd3 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -60,7 +60,7 @@ APR_ENOPOOL APR was not provided a pool with which to allocate memory APR_EBADDATE APR was given an invalid date APR_EINVALSOCK APR was given an invalid socket - APR_ENOFILE APR was not give a file structure + APR_ENOFILE APR was not given a file structure APR_ENOPROC APR was not given a process structure APR_ENOTIME APR was not given a time structure APR_ENODIR APR was not given a directory structure From 1c15f1169d23fdfbe06958305ede117f50f5d850 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 10 Jul 2000 23:29:36 +0000 Subject: [PATCH 0349/7878] This should fix a broken function on Windows. Could somebody with a windows machine please check me. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60324 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/locks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/locks/win32/locks.c b/locks/win32/locks.c index d8ac24edd09..0a43fd3044b 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -167,8 +167,7 @@ ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, ap_status_t ap_get_os_lock(ap_os_lock_t *thelock, ap_lock_t *lock) { - /* ### this is broken. is the signature broken? */ - thelock = &(lock->mutex); + *thelock = lock->mutex; return APR_SUCCESS; } From 1518a9934a6b5ca917c805c2a5b2f07c2c687a86 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 10 Jul 2000 23:35:31 +0000 Subject: [PATCH 0350/7878] Fix ap_get_os_thread. This should work on Windows and Unix now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60325 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 2 +- threadproc/unix/thread.c | 5 ++--- threadproc/win32/thread.c | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 728764328a4..1c296da71da 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -262,7 +262,7 @@ ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **, ap_time_t *); #if APR_HAS_THREADS /* -=head1 ap_status_t ap_get_os_thread(ap_thread_t *thethd, ap_os_thread_t *thd) +=head1 ap_status_t ap_get_os_thread(ap_thread_t **thethd, ap_os_thread_t *thd) B diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 03ac8c242ae..c036db60b1d 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -196,10 +196,9 @@ ap_status_t ap_set_threaddata(void *data, const char *key, return ap_set_userdata(data, key, cleanup, thread->cntxt); } -ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, ap_thread_t *thd) +ap_status_t ap_get_os_thread(ap_os_thread_t **thethd, ap_thread_t *thd) { - /* ### broken. is the signature broken? */ - thethd = thd->td; + *thethd = thd->td; return APR_SUCCESS; } diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index d9d58a69374..beed161c413 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -168,13 +168,12 @@ ap_status_t ap_set_threaddata(void *data, const char *key, return ap_set_userdata(data, key, cleanup, thread->cntxt); } -ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, ap_thread_t *thd) +ap_status_t ap_get_os_thread(ap_os_thread_t **thethd, ap_thread_t *thd) { if (thd == NULL) { return APR_ENOTHREAD; } - /* ### this is broken. is the signature broken? */ - thethd = thd->td; + *thethd = thd->td; return APR_SUCCESS; } From 89bc8e804c8bac176f49b23de9a39f7ca5456bbf Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 10 Jul 2000 23:37:44 +0000 Subject: [PATCH 0351/7878] Fix ap_get_os_threadkey. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60326 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/threadpriv.c | 3 +-- threadproc/win32/threadpriv.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 5b8f3aaa907..e872dc9799e 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -123,8 +123,7 @@ ap_status_t ap_set_threadkeydata(void *data, const char *key, ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key) { - /* ### broken. is the signature broken? */ - thekey = &(key->key); + *thekey = key->key; return APR_SUCCESS; } diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index dc5d0f3a715..275326cf595 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -107,8 +107,7 @@ ap_status_t ap_set_threadkeydata(void *data, const char *key, ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key) { - /* ### this is broken. dunno if the signature is broken... */ - thekey = &(key->key); + *thekey = key->key; return APR_SUCCESS; } From 97c3bbd27a6bdd971a2e934c9d0d69743f4d8ebd Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 11 Jul 2000 00:25:57 +0000 Subject: [PATCH 0352/7878] First pass at buckets brigades. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60327 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/Makefile.in | 52 ++++++++ buckets/ap_buf.c | 270 +++++++++++++++++++++++++++++++++++++++++ buckets/ap_mmap_buf.c | 90 ++++++++++++++ buckets/ap_rwmem_buf.c | 152 +++++++++++++++++++++++ buckets/apr_buf.h | 215 ++++++++++++++++++++++++++++++++ configure.in | 4 +- include/apr_buf.h | 215 ++++++++++++++++++++++++++++++++ 7 files changed, 996 insertions(+), 2 deletions(-) create mode 100644 buckets/Makefile.in create mode 100644 buckets/ap_buf.c create mode 100644 buckets/ap_mmap_buf.c create mode 100644 buckets/ap_rwmem_buf.c create mode 100644 buckets/apr_buf.h create mode 100644 include/apr_buf.h diff --git a/buckets/Makefile.in b/buckets/Makefile.in new file mode 100644 index 00000000000..4c635b8bc50 --- /dev/null +++ b/buckets/Makefile.in @@ -0,0 +1,52 @@ +#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) +#LIBS=$(EXTRA_LIBS) $(LIBS1) +#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) +#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) + +RM=@RM@ +CC=@CC@ +RANLIB=@RANLIB@ +CFLAGS=@CFLAGS@ @OPTIM@ +LIBS=@LIBS@ +LDFLAGS=@LDFLAGS@ $(LIBS) +INCDIR=../include +INCLUDES=-I$(INCDIR) -I. + +#LIB=libfile.a + +OBJS=ap_buf.o \ + ap_rwmem_buf.o \ + ap_mmap_buf.o \ + +.c.o: + $(CC) $(CFLAGS) -c $(INCLUDES) $< + +all: $(OBJS) + +clean: + $(RM) -f *.o *.a *.so + +distclean: clean + -$(RM) -f Makefile + + +#$(LIB): $(OBJS) +# $(RM) -f $@ +# $(AR) cr $@ $(OBJS) +# $(RANLIB) $@ + +# +# We really don't expect end users to use this rule. It works only with +# gcc, and rebuilds Makefile.in. You have to re-run configure after +# using it. +# +depend: + cp Makefile.in Makefile.in.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ + && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ + && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ + -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + > Makefile.in \ + && rm Makefile.new + +# DO NOT REMOVE diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c new file mode 100644 index 00000000000..46ae0b55f48 --- /dev/null +++ b/buckets/ap_buf.c @@ -0,0 +1,270 @@ +/* ==================================================================== + * Copyright (c) 1996-1999 The Apache Group. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Group" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Group and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Group and the Apache HTTP server + * project, please see . + * + */ + +#include "apr_private.h" +#include "apr_lib.h" +#include "apr_errno.h" +#include +#include +#include "apr_buf.h" + +/* We are creating a new bucket here. We could replace the switch with a + * function pointer if we want to. I'm not sure it's a real win though. + */ +APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color) +{ + /* TODO: keep a free list of ap_bufels... and allocate them in big chunks */ + ap_bucket *newbuf; + newbuf = malloc(sizeof(*newbuf)); + newbuf->color = color; + switch (color) { + case AP_BUCKET_rwmem: + newbuf->data = ap_rwmem_create(); + newbuf->free = ap_rwmem_destroy; + break; + case AP_BUCKET_mmap: + newbuf->data = ap_mmap_bucket_create(); + newbuf->free = ap_mmap_bucket_destroy; + break; + case AP_BUCKET_rmem: + case AP_BUCKET_file: + case AP_BUCKET_filename: + case AP_BUCKET_cached_entity: + case AP_BUCKET_URI: + /* not implemented yet */ + break; + } + return newbuf; +} + +APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e) +{ + e->free(e); + free(e); + return APR_SUCCESS; +} + +APR_EXPORT(ap_status_t) ap_bucket_brigade_destroy(void *data) +{ + ap_bucket_brigade *b = data; + ap_bucket_list *bl = b->head; + + ap_destroy_bucket_list(bl); + + return APR_SUCCESS; +} + +APR_EXPORT(ap_bucket_brigade *) ap_bucket_brigade_create(ap_pool_t *p) +{ + ap_bucket_brigade *b; + + b = malloc(sizeof(*b)); + b->p = p; + b->head = b->tail = NULL; + + ap_register_cleanup(b->p, b, ap_bucket_brigade_destroy, + ap_bucket_brigade_destroy); + return b; +} + +APR_EXPORT(ap_bucket_list *) ap_bucket_list_create(void) +{ + ap_bucket_list *b; + + b = malloc(sizeof(*b)); + return b; +} + +APR_EXPORT(void) ap_bucket_list_init(ap_bucket_list *b) +{ + b->bucket = NULL; + b->next = b->prev = NULL; +} + +APR_EXPORT(void) ap_bucket_brigade_append(ap_bucket_brigade *b, + ap_bucket_list *e) +{ + e->next = b->tail; + b->tail->prev = e; + /* This doesn't actually work */ + b->tail = e->next; +} + +APR_EXPORT(int) ap_bucket_brigade_to_iovec(ap_bucket_brigade *b, + struct iovec *vec, int nvec) +{ + ap_bucket_list *e; + struct iovec *orig; + + orig = vec; + e = b->head; + while (e && nvec) { + vec->iov_base = ap_get_bucket_char_str(e->bucket); + vec->iov_len = ap_get_bucket_len(e->bucket); + e = e->next; + --nvec; + ++vec; + } + return vec - orig; +} + +APR_EXPORT(void) ap_bucket_brigade_catenate(ap_bucket_brigade *a, + ap_bucket_brigade *b) +{ + if (b->head) { + if (a->tail) { + a->tail->next = b->head; + } + a->tail = b->tail; + if (!a->head) { + a->head = b->head; + } + b->head = NULL; + b->tail = b->head; + } +} + +APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, + ap_bucket_brigade *b, + ap_iol *iol) +{ + ap_status_t status; + int iov_used; + struct iovec vec[16]; /* seems like a reasonable number to me */ + ap_ssize_t bytes = 0; + + *total_bytes = 0; + do { + iov_used = ap_bucket_brigade_to_iovec(b, vec, 16); + status = iol_writev(iol, vec, iov_used, &bytes); + if (status != APR_SUCCESS) { + return status; + } + *total_bytes += bytes; + } while (iov_used == 16); + return APR_SUCCESS; +} + +APR_EXPORT(ap_status_t) ap_destroy_bucket_list(ap_bucket_list *buf) +{ + ap_bucket_list *dptr = buf; + + while (dptr) { + ap_bucket_destroy(dptr->bucket); + dptr = dptr->next; + } + return APR_SUCCESS; +} + +APR_EXPORT(char *) ap_get_bucket_char_str(ap_bucket *b) +{ + switch (b->color) { + case AP_BUCKET_rwmem: + return ap_rwmem_get_char_str(b->data); + case AP_BUCKET_mmap: + return ap_mmap_get_char_str(b->data); + case AP_BUCKET_rmem: + case AP_BUCKET_file: + case AP_BUCKET_filename: + case AP_BUCKET_cached_entity: + case AP_BUCKET_URI: + /* not implemented yet */ + return NULL; + } + /* We should NEVER actually get here */ + return NULL; +} + +APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b) +{ + switch (b->color) { + case AP_BUCKET_rwmem: + return ap_rwmem_get_len(b->data); + case AP_BUCKET_mmap: + return ap_mmap_get_len(b->data); + case AP_BUCKET_rmem: + case AP_BUCKET_file: + case AP_BUCKET_filename: + case AP_BUCKET_cached_entity: + case AP_BUCKET_URI: + /* not implemented yet */ + return 0; + } + /* We should NEVER actually get here */ + return 0; +} + +APR_EXPORT(int) ap_brigade_vputs(ap_bucket_brigade *b, ...) +{ + ap_bucket_list *dptr = b->tail; + ap_bucket_rwmem *r; + va_list va; + int n; + + if (dptr->bucket->color != AP_BUCKET_rwmem) { + r = ap_rwmem_create(); + } + else { + r = dptr->bucket->data; + } + + va_start(va, b); + n = ap_rwmem_vputstrs(r, va); + va_end(va); + + return n; +} diff --git a/buckets/ap_mmap_buf.c b/buckets/ap_mmap_buf.c new file mode 100644 index 00000000000..c8d73bc41f2 --- /dev/null +++ b/buckets/ap_mmap_buf.c @@ -0,0 +1,90 @@ +/* ==================================================================== + * Copyright (c) 1996-1999 The Apache Group. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Group" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Group and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Group and the Apache HTTP server + * project, please see . + * + */ + +#include "apr_private.h" +#include "apr_buf.h" +#include + +APR_EXPORT(ap_bucket_mmap *) ap_mmap_bucket_create(void) +{ + ap_bucket_mmap *newbuf; + newbuf = malloc(sizeof(*newbuf)); + newbuf->data = NULL; + return newbuf; +} + +APR_EXPORT(void) ap_mmap_bucket_destroy(void *e) +{ + ap_bucket_mmap *d = (ap_bucket_mmap *)e; + free(d); +} + +APR_EXPORT(char *) ap_mmap_get_char_str(ap_bucket_mmap *b) +{ + return b->data->mm; +} + +APR_EXPORT(int) ap_mmap_get_len(ap_bucket_mmap *b) +{ + return b->data->size; +} + +APR_EXPORT(void) ap_mmap_bucket_insert(ap_bucket_mmap *b, ap_mmap_t *mm) +{ + b->data = mm; +} + diff --git a/buckets/ap_rwmem_buf.c b/buckets/ap_rwmem_buf.c new file mode 100644 index 00000000000..d0e010a22e2 --- /dev/null +++ b/buckets/ap_rwmem_buf.c @@ -0,0 +1,152 @@ +/* ==================================================================== + * Copyright (c) 1996-1999 The Apache Group. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Group" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Group and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Group and the Apache HTTP server + * project, please see . + * + */ + +#include "apr_private.h" +#include "apr_buf.h" +#include + +#ifndef DEFAULT_RWBUF_SIZE +#define DEFAULT_RWBUF_SIZE (4096) +#endif + +APR_EXPORT(ap_bucket_rwmem *) ap_rwmem_create(void) +{ + ap_bucket_rwmem *newbuf; + newbuf = malloc(sizeof(*newbuf)); + newbuf->alloc_addr = calloc(DEFAULT_RWBUF_SIZE, 1); + newbuf->alloc_len = DEFAULT_RWBUF_SIZE; + newbuf->start = newbuf->alloc_addr; + newbuf->end = newbuf->alloc_addr; + return newbuf; +} + +APR_EXPORT(void) ap_rwmem_destroy(void *e) +{ + ap_bucket_rwmem *d = (ap_bucket_rwmem *)e; + free(d->alloc_addr); + free(d); +} + +APR_EXPORT(char *) ap_rwmem_get_char_str(ap_bucket_rwmem *b) +{ + return b->start; +} + +APR_EXPORT(int) ap_rwmem_get_len(ap_bucket_rwmem *b) +{ + return b->end - b->start; +} + +/* + * save nbyte bytes to the bucket. + * Only returns fewer than nbyte if an error ocurred. + * Returns -1 if no bytes were written before the error ocurred. + * It is worth noting that if an error occurs, the buffer is in an unknown + * state. + */ +APR_EXPORT(int) ap_rwmem_write(ap_bucket_rwmem *b, const void *buf, + ap_size_t nbyte, ap_ssize_t *bytes_written) +{ + int amt; + int total; + + if (nbyte == 0) { + *bytes_written = 0; + return APR_SUCCESS; + } + +/* + * At this point, we need to make sure we aren't trying to write too much + * data to the bucket. We will need to write to the dist here, but I am + * leaving that for a later pass. The basics are presented below, but this + * is horribly broken. + */ + amt = b->alloc_len - (b->end - b->start); + total = 0; + if (nbyte > amt) { + /* loop through and write to the disk */ + /* Replace the rwmem buckets with file buckets */ + } + /* now we know that nbyte < b->alloc_len */ + memcpy(b->end, buf, nbyte); + b->end += nbyte; + *bytes_written = total + nbyte; + return APR_SUCCESS; +} + +APR_EXPORT(int) ap_rwmem_vputstrs(ap_bucket_rwmem *b, va_list va) +{ + int j, k; + ap_ssize_t i; + const char *x; + int rv; + + for (k = 0;;) { + x = va_arg(va, const char *); + if (x == NULL) + break; + j = strlen(x); + rv = ap_rwmem_write(b, x, j, &i); + if (i != j) { + /* Do we need better error reporting? */ + return -1; + } + k += i; + } + + return k; +} diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h new file mode 100644 index 00000000000..2f515a8891e --- /dev/null +++ b/buckets/apr_buf.h @@ -0,0 +1,215 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef AP_BUF_H +#define AP_BUF_H + +#include "apr_mmap.h" +#include "apr_errno.h" +#include "../../../include/ap_iol.h" +#include "apr_private.h" +#ifdef HAVE_SYS_UIO_H +#include /* for struct iovec */ +#endif +#ifdef HAVE_STDARG_H +#include +#endif + +typedef enum { + AP_BUCKET_rwmem, + AP_BUCKET_rmem, + AP_BUCKET_file, + AP_BUCKET_mmap, + AP_BUCKET_filename, + AP_BUCKET_cached_entity, + AP_BUCKET_URI, +} ap_bucket_color_e; + +typedef struct ap_bucket ap_bucket; +struct ap_bucket { + ap_bucket_color_e color; /* what type of bucket is it */ + void (*free)(void *e); /* never NULL */ + void *data; /* for use by free() */ +}; + +typedef struct ap_bucket_list ap_bucket_list; +struct ap_bucket_list { + ap_bucket *bucket; /* The bucket */ + ap_bucket_list *next; /* The start of the bucket list */ + ap_bucket_list *prev; /* The end of the bucket list */ +}; + +typedef struct ap_bucket_brigade ap_bucket_brigade; +struct ap_bucket_brigade { + ap_pool_t *p; /* The pool to associate this with. + I do not allocate out of the pool, + but this lets me register a cleanup + to put a limit on the brigade's + lifetime. */ + ap_bucket_list *head; /* The start of the brigade */ + ap_bucket_list *tail; /* The end of the brigade */ +}; + +/* ****** Bucket Brigade Functions ***** */ + +/* Create a new bucket brigade */ +APR_EXPORT(ap_bucket_brigade *) ap_bucket_brigade_create(ap_pool_t *p); + +/* destroy an enitre bucket brigade */ +APR_EXPORT(ap_status_t) ap_bucket_brigade_destroy(void *b); + +/* append a bucket_brigade to a bucket_brigade */ +APR_EXPORT(void) ap_bucket_brigade_append(ap_bucket_brigade *b, + ap_bucket_list *e); + +/* consume nbytes from beginning of b -- call ap_bucket_destroy as + appropriate, and/or modify start on last element */ +APR_EXPORT(void) ap_bucket_brigade_consume(ap_bucket_brigade *, int nbytes); + +/* create an iovec of the elements in a bucket_brigade... return number + of elements used */ +APR_EXPORT(int) ap_bucket_brigade_to_iovec(ap_bucket_brigade *, + struct iovec *vec, int nvec); + +/* catenate bucket_brigade b onto bucket_brigade a, bucket_brigade b is + empty after this */ +APR_EXPORT(void) ap_bucket_brigade_catenate(ap_bucket_brigade *a, + ap_bucket_brigade *b); + +/* save the buf out to the specified iol. This can be used to flush the + data to the disk, or to send it out to the network. */ +APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, + ap_bucket_brigade *a, + ap_iol *iol); + +APR_EXPORT(int) ap_brigade_vputs(ap_bucket_brigade *b, ...); + +/* ****** Bucket List Functions ***** */ + +/* create a new bucket_list */ +APR_EXPORT(ap_bucket_list *) ap_bucket_list_create(void); + +/* initialize a bucket_list */ +APR_EXPORT(void) ap_bucket_list_init(ap_bucket_list *b); + +/* destroy an entire bucket_list */ +APR_EXPORT(ap_status_t) ap_destroy_bucket_list(ap_bucket_list *b); + +/* ****** Bucket Functions ***** */ + +/* allocate a bucket of type color */ +APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color); + +/* destroy a bucket */ +APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e); + +/* Convert a bucket to a char * */ +APR_EXPORT(char *) ap_get_bucket_char_str(ap_bucket *b); + +/* get the length of the data in the bucket */ +APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b); + +/* ****** RWMEM Functions ***** */ + +typedef struct ap_bucket_rwmem ap_bucket_rwmem; +struct ap_bucket_rwmem { + void *alloc_addr; /* Where does the data start */ + size_t alloc_len; /* how much was allocated */ + void *start; /* Where does the actual data start + in the alloc'ed block */ + void *end; /* where does the data actually end? */ +}; + +/* Create a read/write memory bucket */ +APR_EXPORT(ap_bucket_rwmem *) ap_rwmem_create(void); + +/* destroy a read/write memory bucket */ +APR_EXPORT(void) ap_rwmem_destroy(void *e); + +/* Convert a rwmem bucket into a char * */ +APR_EXPORT(char *) ap_rwmem_get_char_str(ap_bucket_rwmem *b); + +/* get the length of the data in the rwmem bucket */ +APR_EXPORT(int) ap_rwmem_get_len(ap_bucket_rwmem *b); + +APR_EXPORT(int) ap_rwmem_write(ap_bucket_rwmem *b, const void *buf, + ap_size_t nbyte, ap_ssize_t *bytes_written); + +APR_EXPORT(int) ap_rwmem_vputs(ap_bucket_rwmem *b, va_list va); + +APR_EXPORT(int) ap_rwmem_vputstrs(ap_bucket_rwmem *b, va_list va); + +/* ****** MMAP Functions ***** */ + +typedef struct ap_bucket_mmap ap_bucket_mmap; +struct ap_bucket_mmap { + ap_mmap_t *data; +}; + +/* Create a read/write memory bucket */ +APR_EXPORT(ap_bucket_mmap *) ap_mmap_bucket_create(void); + +/* destroy a read/write memory bucket */ +APR_EXPORT(void) ap_mmap_bucket_destroy(void *e); + +/* Convert a mmap bucket into a char * */ +APR_EXPORT(char *) ap_mmap_get_char_str(ap_bucket_mmap *b); + +/* get the length of the data in the mmap bucket */ +APR_EXPORT(int) ap_mmap_get_len(ap_bucket_mmap *b); + +APR_EXPORT(void) ap_mmap_bucket_insert(ap_bucket_mmap *b, ap_mmap_t *mm); + +#endif + diff --git a/configure.in b/configure.in index cafa5bb1d34..051a3bf6a26 100644 --- a/configure.in +++ b/configure.in @@ -678,8 +678,8 @@ AC_SUBST(LIBPREFIX) AC_SUBST(EXEEXT) echo "Construct Makefiles and header files." -MAKEFILE1="Makefile lib/Makefile " -SUBDIRS="lib " +MAKEFILE1="Makefile lib/Makefile buckets/Makefile" +SUBDIRS="lib buckets" for dir in $MODULES do test -d $dir || $MKDIR -p $dir diff --git a/include/apr_buf.h b/include/apr_buf.h new file mode 100644 index 00000000000..2f515a8891e --- /dev/null +++ b/include/apr_buf.h @@ -0,0 +1,215 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef AP_BUF_H +#define AP_BUF_H + +#include "apr_mmap.h" +#include "apr_errno.h" +#include "../../../include/ap_iol.h" +#include "apr_private.h" +#ifdef HAVE_SYS_UIO_H +#include /* for struct iovec */ +#endif +#ifdef HAVE_STDARG_H +#include +#endif + +typedef enum { + AP_BUCKET_rwmem, + AP_BUCKET_rmem, + AP_BUCKET_file, + AP_BUCKET_mmap, + AP_BUCKET_filename, + AP_BUCKET_cached_entity, + AP_BUCKET_URI, +} ap_bucket_color_e; + +typedef struct ap_bucket ap_bucket; +struct ap_bucket { + ap_bucket_color_e color; /* what type of bucket is it */ + void (*free)(void *e); /* never NULL */ + void *data; /* for use by free() */ +}; + +typedef struct ap_bucket_list ap_bucket_list; +struct ap_bucket_list { + ap_bucket *bucket; /* The bucket */ + ap_bucket_list *next; /* The start of the bucket list */ + ap_bucket_list *prev; /* The end of the bucket list */ +}; + +typedef struct ap_bucket_brigade ap_bucket_brigade; +struct ap_bucket_brigade { + ap_pool_t *p; /* The pool to associate this with. + I do not allocate out of the pool, + but this lets me register a cleanup + to put a limit on the brigade's + lifetime. */ + ap_bucket_list *head; /* The start of the brigade */ + ap_bucket_list *tail; /* The end of the brigade */ +}; + +/* ****** Bucket Brigade Functions ***** */ + +/* Create a new bucket brigade */ +APR_EXPORT(ap_bucket_brigade *) ap_bucket_brigade_create(ap_pool_t *p); + +/* destroy an enitre bucket brigade */ +APR_EXPORT(ap_status_t) ap_bucket_brigade_destroy(void *b); + +/* append a bucket_brigade to a bucket_brigade */ +APR_EXPORT(void) ap_bucket_brigade_append(ap_bucket_brigade *b, + ap_bucket_list *e); + +/* consume nbytes from beginning of b -- call ap_bucket_destroy as + appropriate, and/or modify start on last element */ +APR_EXPORT(void) ap_bucket_brigade_consume(ap_bucket_brigade *, int nbytes); + +/* create an iovec of the elements in a bucket_brigade... return number + of elements used */ +APR_EXPORT(int) ap_bucket_brigade_to_iovec(ap_bucket_brigade *, + struct iovec *vec, int nvec); + +/* catenate bucket_brigade b onto bucket_brigade a, bucket_brigade b is + empty after this */ +APR_EXPORT(void) ap_bucket_brigade_catenate(ap_bucket_brigade *a, + ap_bucket_brigade *b); + +/* save the buf out to the specified iol. This can be used to flush the + data to the disk, or to send it out to the network. */ +APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, + ap_bucket_brigade *a, + ap_iol *iol); + +APR_EXPORT(int) ap_brigade_vputs(ap_bucket_brigade *b, ...); + +/* ****** Bucket List Functions ***** */ + +/* create a new bucket_list */ +APR_EXPORT(ap_bucket_list *) ap_bucket_list_create(void); + +/* initialize a bucket_list */ +APR_EXPORT(void) ap_bucket_list_init(ap_bucket_list *b); + +/* destroy an entire bucket_list */ +APR_EXPORT(ap_status_t) ap_destroy_bucket_list(ap_bucket_list *b); + +/* ****** Bucket Functions ***** */ + +/* allocate a bucket of type color */ +APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color); + +/* destroy a bucket */ +APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e); + +/* Convert a bucket to a char * */ +APR_EXPORT(char *) ap_get_bucket_char_str(ap_bucket *b); + +/* get the length of the data in the bucket */ +APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b); + +/* ****** RWMEM Functions ***** */ + +typedef struct ap_bucket_rwmem ap_bucket_rwmem; +struct ap_bucket_rwmem { + void *alloc_addr; /* Where does the data start */ + size_t alloc_len; /* how much was allocated */ + void *start; /* Where does the actual data start + in the alloc'ed block */ + void *end; /* where does the data actually end? */ +}; + +/* Create a read/write memory bucket */ +APR_EXPORT(ap_bucket_rwmem *) ap_rwmem_create(void); + +/* destroy a read/write memory bucket */ +APR_EXPORT(void) ap_rwmem_destroy(void *e); + +/* Convert a rwmem bucket into a char * */ +APR_EXPORT(char *) ap_rwmem_get_char_str(ap_bucket_rwmem *b); + +/* get the length of the data in the rwmem bucket */ +APR_EXPORT(int) ap_rwmem_get_len(ap_bucket_rwmem *b); + +APR_EXPORT(int) ap_rwmem_write(ap_bucket_rwmem *b, const void *buf, + ap_size_t nbyte, ap_ssize_t *bytes_written); + +APR_EXPORT(int) ap_rwmem_vputs(ap_bucket_rwmem *b, va_list va); + +APR_EXPORT(int) ap_rwmem_vputstrs(ap_bucket_rwmem *b, va_list va); + +/* ****** MMAP Functions ***** */ + +typedef struct ap_bucket_mmap ap_bucket_mmap; +struct ap_bucket_mmap { + ap_mmap_t *data; +}; + +/* Create a read/write memory bucket */ +APR_EXPORT(ap_bucket_mmap *) ap_mmap_bucket_create(void); + +/* destroy a read/write memory bucket */ +APR_EXPORT(void) ap_mmap_bucket_destroy(void *e); + +/* Convert a mmap bucket into a char * */ +APR_EXPORT(char *) ap_mmap_get_char_str(ap_bucket_mmap *b); + +/* get the length of the data in the mmap bucket */ +APR_EXPORT(int) ap_mmap_get_len(ap_bucket_mmap *b); + +APR_EXPORT(void) ap_mmap_bucket_insert(ap_bucket_mmap *b, ap_mmap_t *mm); + +#endif + From b699620d2fadee7e6c36a8af32f30e039fb6e2dc Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 11 Jul 2000 15:29:37 +0000 Subject: [PATCH 0353/7878] Fix compile break. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60328 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 1c296da71da..5861dd58bb5 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -271,7 +271,7 @@ B =cut */ -ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, ap_thread_t *thd); +ap_status_t ap_get_os_thread(ap_os_thread_t **thethd, ap_thread_t *thd); /* From 3b16bf91c5ce07cef01569e4e1ce5bd967009180 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 11 Jul 2000 17:15:51 +0000 Subject: [PATCH 0354/7878] Fix the segfault that was happening with the current buckets. Basically, with an MMAP bucket, there is nothing for us to free, so we shouldn't try to. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60329 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 6 ++++-- buckets/ap_mmap_buf.c | 6 ------ buckets/apr_buf.h | 5 +---- include/apr_buf.h | 5 +---- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 46ae0b55f48..e61edd93862 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -78,7 +78,7 @@ APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color) break; case AP_BUCKET_mmap: newbuf->data = ap_mmap_bucket_create(); - newbuf->free = ap_mmap_bucket_destroy; + newbuf->free = NULL; break; case AP_BUCKET_rmem: case AP_BUCKET_file: @@ -93,7 +93,9 @@ APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color) APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e) { - e->free(e); + if (e->free) { + e->free(e); + } free(e); return APR_SUCCESS; } diff --git a/buckets/ap_mmap_buf.c b/buckets/ap_mmap_buf.c index c8d73bc41f2..895b37032c5 100644 --- a/buckets/ap_mmap_buf.c +++ b/buckets/ap_mmap_buf.c @@ -67,12 +67,6 @@ APR_EXPORT(ap_bucket_mmap *) ap_mmap_bucket_create(void) return newbuf; } -APR_EXPORT(void) ap_mmap_bucket_destroy(void *e) -{ - ap_bucket_mmap *d = (ap_bucket_mmap *)e; - free(d); -} - APR_EXPORT(char *) ap_mmap_get_char_str(ap_bucket_mmap *b) { return b->data->mm; diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index 2f515a8891e..1cf88fe318e 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -197,12 +197,9 @@ struct ap_bucket_mmap { ap_mmap_t *data; }; -/* Create a read/write memory bucket */ +/* Create a mmap memory bucket */ APR_EXPORT(ap_bucket_mmap *) ap_mmap_bucket_create(void); -/* destroy a read/write memory bucket */ -APR_EXPORT(void) ap_mmap_bucket_destroy(void *e); - /* Convert a mmap bucket into a char * */ APR_EXPORT(char *) ap_mmap_get_char_str(ap_bucket_mmap *b); diff --git a/include/apr_buf.h b/include/apr_buf.h index 2f515a8891e..1cf88fe318e 100644 --- a/include/apr_buf.h +++ b/include/apr_buf.h @@ -197,12 +197,9 @@ struct ap_bucket_mmap { ap_mmap_t *data; }; -/* Create a read/write memory bucket */ +/* Create a mmap memory bucket */ APR_EXPORT(ap_bucket_mmap *) ap_mmap_bucket_create(void); -/* destroy a read/write memory bucket */ -APR_EXPORT(void) ap_mmap_bucket_destroy(void *e); - /* Convert a mmap bucket into a char * */ APR_EXPORT(char *) ap_mmap_get_char_str(ap_bucket_mmap *b); From c9cfe94222d77a49c954e5e9b1cdbc5d12f1973b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 11 Jul 2000 17:28:18 +0000 Subject: [PATCH 0355/7878] Remove an extra free with the read/write buckets. This would cause the same seg fault that the mmap buckets were suffering from. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60330 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_rwmem_buf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/buckets/ap_rwmem_buf.c b/buckets/ap_rwmem_buf.c index d0e010a22e2..96aa64eecb8 100644 --- a/buckets/ap_rwmem_buf.c +++ b/buckets/ap_rwmem_buf.c @@ -78,7 +78,6 @@ APR_EXPORT(void) ap_rwmem_destroy(void *e) { ap_bucket_rwmem *d = (ap_bucket_rwmem *)e; free(d->alloc_addr); - free(d); } APR_EXPORT(char *) ap_rwmem_get_char_str(ap_bucket_rwmem *b) From 65689bffc6bcacbda4c9344fb7d3577f508502bd Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 11 Jul 2000 21:33:04 +0000 Subject: [PATCH 0356/7878] Add dependancies, and a new file that will be added in the next commit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60331 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/Makefile.in | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/buckets/Makefile.in b/buckets/Makefile.in index 4c635b8bc50..c8a015e0da0 100644 --- a/buckets/Makefile.in +++ b/buckets/Makefile.in @@ -17,6 +17,7 @@ INCLUDES=-I$(INCDIR) -I. OBJS=ap_buf.o \ ap_rwmem_buf.o \ ap_mmap_buf.o \ + ap_rmem_buf.o .c.o: $(CC) $(CFLAGS) -c $(INCLUDES) $< @@ -50,3 +51,32 @@ depend: && rm Makefile.new # DO NOT REMOVE +ap_buf.o: ap_buf.c $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_buf.h $(INCDIR)/apr_mmap.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ + $(INCDIR)/../../../include/ap_iol.h +ap_mmap_buf.o: ap_mmap_buf.c $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_buf.h $(INCDIR)/apr_mmap.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ + $(INCDIR)/../../../include/ap_iol.h +ap_rmem_buf.o: ap_rmem_buf.c $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_buf.h $(INCDIR)/apr_mmap.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ + $(INCDIR)/../../../include/ap_iol.h +ap_rwmem_buf.o: ap_rwmem_buf.c $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_buf.h $(INCDIR)/apr_mmap.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ + $(INCDIR)/../../../include/ap_iol.h From ac83966a4bae214a1d19663b23192de688f100e4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 11 Jul 2000 21:33:36 +0000 Subject: [PATCH 0357/7878] First pass at implementing read only memory buckets. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60332 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 58 +++++++++++++++++----- buckets/ap_rmem_buf.c | 109 ++++++++++++++++++++++++++++++++++++++++++ buckets/apr_buf.h | 31 +++++++++++- include/apr_buf.h | 31 +++++++++++- 4 files changed, 215 insertions(+), 14 deletions(-) create mode 100644 buckets/ap_rmem_buf.c diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index e61edd93862..5356227cca0 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -81,6 +81,9 @@ APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color) newbuf->free = NULL; break; case AP_BUCKET_rmem: + newbuf->data = ap_rmem_create(); + newbuf->free = NULL; + break; case AP_BUCKET_file: case AP_BUCKET_filename: case AP_BUCKET_cached_entity: @@ -155,7 +158,7 @@ APR_EXPORT(int) ap_bucket_brigade_to_iovec(ap_bucket_brigade *b, orig = vec; e = b->head; while (e && nvec) { - vec->iov_base = ap_get_bucket_char_str(e->bucket); + vec->iov_base = (void *)ap_get_bucket_char_str(e->bucket); vec->iov_len = ap_get_bucket_len(e->bucket); e = e->next; --nvec; @@ -212,7 +215,7 @@ APR_EXPORT(ap_status_t) ap_destroy_bucket_list(ap_bucket_list *buf) return APR_SUCCESS; } -APR_EXPORT(char *) ap_get_bucket_char_str(ap_bucket *b) +APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b) { switch (b->color) { case AP_BUCKET_rwmem: @@ -220,6 +223,7 @@ APR_EXPORT(char *) ap_get_bucket_char_str(ap_bucket *b) case AP_BUCKET_mmap: return ap_mmap_get_char_str(b->data); case AP_BUCKET_rmem: + return ap_rmem_get_char_str(b->data); case AP_BUCKET_file: case AP_BUCKET_filename: case AP_BUCKET_cached_entity: @@ -239,6 +243,7 @@ APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b) case AP_BUCKET_mmap: return ap_mmap_get_len(b->data); case AP_BUCKET_rmem: + return ap_rmem_get_len(b->data); case AP_BUCKET_file: case AP_BUCKET_filename: case AP_BUCKET_cached_entity: @@ -252,21 +257,50 @@ APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b) APR_EXPORT(int) ap_brigade_vputs(ap_bucket_brigade *b, ...) { - ap_bucket_list *dptr = b->tail; - ap_bucket_rwmem *r; + ap_bucket *r; va_list va; - int n; + const char *x; + int n, j, k, rv; + ap_ssize_t i; - if (dptr->bucket->color != AP_BUCKET_rwmem) { - r = ap_rwmem_create(); - } - else { - r = dptr->bucket->data; + if (b->tail->bucket->color == AP_BUCKET_rwmem) { + ap_bucket_rwmem *rw; + rw = b->tail->bucket->data; + /* I have no idea if this is a good idea or not. Probably not. + * Basically, if the last bucket in the list is a rwmem bucket, + * then we just add to it instead of allocating a new read only + * bucket. This is incredibly easy to take out if it is a bad + * idea. RBB + */ + va_start(va, b); + ap_rwmem_vputstrs(rw, va); + va_end(va); } va_start(va, b); - n = ap_rwmem_vputstrs(r, va); - va_end(va); + for (k = 0;;) { + r = ap_bucket_new(AP_BUCKET_rmem); + x = va_arg(va, const char *); + if (x == NULL) + break; + j = strlen(x); + + rv = ap_rmem_write(r->data, x, j, &i); + if (i != j) { + /* Do we need better error reporting? */ + return -1; + } + k += i; + + /* This really requires an API. Basically we are just adding + * a bucket to a bucket list. + */ + b->tail->next = ap_bucket_list_create(); + b->tail->next->prev = b->tail->next; + b->tail = b->tail->next; + b->tail->bucket = r; + } + va_end(v); return n; } diff --git a/buckets/ap_rmem_buf.c b/buckets/ap_rmem_buf.c new file mode 100644 index 00000000000..a74324b9fd0 --- /dev/null +++ b/buckets/ap_rmem_buf.c @@ -0,0 +1,109 @@ +/* ==================================================================== + * Copyright (c) 1996-1999 The Apache Group. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Group" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Group and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Group and the Apache HTTP server + * project, please see . + * + */ + +#include "apr_private.h" +#include "apr_buf.h" +#include + +#ifndef DEFAULT_RWBUF_SIZE +#define DEFAULT_RWBUF_SIZE (4096) +#endif + +APR_EXPORT(ap_bucket_rmem *) ap_rmem_create(void) +{ + ap_bucket_rmem *newbuf; + newbuf = calloc(1, sizeof(*newbuf)); + return newbuf; +} + +APR_EXPORT(const char *) ap_rmem_get_char_str(ap_bucket_rmem *b) +{ + return b->start; +} + +APR_EXPORT(int) ap_rmem_get_len(ap_bucket_rmem *b) +{ + return b->end - b->start; +} + +/* + * save nbyte bytes to the bucket. + * Only returns fewer than nbyte if an error ocurred. + * Returns -1 if no bytes were written before the error ocurred. + * It is worth noting that if an error occurs, the buffer is in an unknown + * state. + */ +APR_EXPORT(int) ap_rmem_write(ap_bucket_rmem *b, const void *buf, + ap_size_t nbyte, ap_ssize_t *bytes_written) +{ + int amt; + int total; + + if (nbyte == 0) { + *bytes_written = 0; + return APR_SUCCESS; + } + + /* We should probably do some checking to make sure we don't allocate too + * much memory, but that can wait for the second pass. + */ + b->start = buf; + b->end = b->start + nbyte; + *bytes_written = nbyte; + return APR_SUCCESS; +} + diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index 1cf88fe318e..f361b5355c4 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -155,7 +155,7 @@ APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color); APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e); /* Convert a bucket to a char * */ -APR_EXPORT(char *) ap_get_bucket_char_str(ap_bucket *b); +APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b); /* get the length of the data in the bucket */ APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b); @@ -208,5 +208,34 @@ APR_EXPORT(int) ap_mmap_get_len(ap_bucket_mmap *b); APR_EXPORT(void) ap_mmap_bucket_insert(ap_bucket_mmap *b, ap_mmap_t *mm); +/* ****** RMEM Functions ***** */ + +typedef struct ap_bucket_rmem ap_bucket_rmem; +struct ap_bucket_rmem { + size_t alloc_len; /* how much was allocated */ + const void *start; /* Where does the actual data start + in the alloc'ed block */ + const void *end; /* where does the data actually end? */ +}; + +/* Create a read only memory bucket */ +APR_EXPORT(ap_bucket_rmem *) ap_rmem_create(void); + +/* destroy a read only memory bucket */ +APR_EXPORT(void) ap_rmem_destroy(void *e); + +/* Convert a read only bucket into a char * */ +APR_EXPORT(const char *) ap_rmem_get_char_str(ap_bucket_rmem *b); + +/* get the length of the data in the rmem bucket */ +APR_EXPORT(int) ap_rmem_get_len(ap_bucket_rmem *b); + +APR_EXPORT(int) ap_rmem_write(ap_bucket_rmem *b, const void *buf, + ap_size_t nbyte, ap_ssize_t *bytes_written); + +APR_EXPORT(int) ap_rmem_vputs(ap_bucket_rmem *b, va_list va); + +APR_EXPORT(int) ap_rmem_vputstrs(ap_bucket_rmem *b, va_list va); + #endif diff --git a/include/apr_buf.h b/include/apr_buf.h index 1cf88fe318e..f361b5355c4 100644 --- a/include/apr_buf.h +++ b/include/apr_buf.h @@ -155,7 +155,7 @@ APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color); APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e); /* Convert a bucket to a char * */ -APR_EXPORT(char *) ap_get_bucket_char_str(ap_bucket *b); +APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b); /* get the length of the data in the bucket */ APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b); @@ -208,5 +208,34 @@ APR_EXPORT(int) ap_mmap_get_len(ap_bucket_mmap *b); APR_EXPORT(void) ap_mmap_bucket_insert(ap_bucket_mmap *b, ap_mmap_t *mm); +/* ****** RMEM Functions ***** */ + +typedef struct ap_bucket_rmem ap_bucket_rmem; +struct ap_bucket_rmem { + size_t alloc_len; /* how much was allocated */ + const void *start; /* Where does the actual data start + in the alloc'ed block */ + const void *end; /* where does the data actually end? */ +}; + +/* Create a read only memory bucket */ +APR_EXPORT(ap_bucket_rmem *) ap_rmem_create(void); + +/* destroy a read only memory bucket */ +APR_EXPORT(void) ap_rmem_destroy(void *e); + +/* Convert a read only bucket into a char * */ +APR_EXPORT(const char *) ap_rmem_get_char_str(ap_bucket_rmem *b); + +/* get the length of the data in the rmem bucket */ +APR_EXPORT(int) ap_rmem_get_len(ap_bucket_rmem *b); + +APR_EXPORT(int) ap_rmem_write(ap_bucket_rmem *b, const void *buf, + ap_size_t nbyte, ap_ssize_t *bytes_written); + +APR_EXPORT(int) ap_rmem_vputs(ap_bucket_rmem *b, va_list va); + +APR_EXPORT(int) ap_rmem_vputstrs(ap_bucket_rmem *b, va_list va); + #endif From b888e918db824a16e23f6fd22f9b7705a88a32e5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 11 Jul 2000 22:54:16 +0000 Subject: [PATCH 0358/7878] Remove two prototypes that we haven't actually implemented. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60333 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_buf.h | 4 ---- include/apr_buf.h | 4 ---- 2 files changed, 8 deletions(-) diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index f361b5355c4..f8c47b95d47 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -186,8 +186,6 @@ APR_EXPORT(int) ap_rwmem_get_len(ap_bucket_rwmem *b); APR_EXPORT(int) ap_rwmem_write(ap_bucket_rwmem *b, const void *buf, ap_size_t nbyte, ap_ssize_t *bytes_written); -APR_EXPORT(int) ap_rwmem_vputs(ap_bucket_rwmem *b, va_list va); - APR_EXPORT(int) ap_rwmem_vputstrs(ap_bucket_rwmem *b, va_list va); /* ****** MMAP Functions ***** */ @@ -233,8 +231,6 @@ APR_EXPORT(int) ap_rmem_get_len(ap_bucket_rmem *b); APR_EXPORT(int) ap_rmem_write(ap_bucket_rmem *b, const void *buf, ap_size_t nbyte, ap_ssize_t *bytes_written); -APR_EXPORT(int) ap_rmem_vputs(ap_bucket_rmem *b, va_list va); - APR_EXPORT(int) ap_rmem_vputstrs(ap_bucket_rmem *b, va_list va); #endif diff --git a/include/apr_buf.h b/include/apr_buf.h index f361b5355c4..f8c47b95d47 100644 --- a/include/apr_buf.h +++ b/include/apr_buf.h @@ -186,8 +186,6 @@ APR_EXPORT(int) ap_rwmem_get_len(ap_bucket_rwmem *b); APR_EXPORT(int) ap_rwmem_write(ap_bucket_rwmem *b, const void *buf, ap_size_t nbyte, ap_ssize_t *bytes_written); -APR_EXPORT(int) ap_rwmem_vputs(ap_bucket_rwmem *b, va_list va); - APR_EXPORT(int) ap_rwmem_vputstrs(ap_bucket_rwmem *b, va_list va); /* ****** MMAP Functions ***** */ @@ -233,8 +231,6 @@ APR_EXPORT(int) ap_rmem_get_len(ap_bucket_rmem *b); APR_EXPORT(int) ap_rmem_write(ap_bucket_rmem *b, const void *buf, ap_size_t nbyte, ap_ssize_t *bytes_written); -APR_EXPORT(int) ap_rmem_vputs(ap_bucket_rmem *b, va_list va); - APR_EXPORT(int) ap_rmem_vputstrs(ap_bucket_rmem *b, va_list va); #endif From cc277b9ae782bc930c073974bb59cd41d20c600a Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Wed, 12 Jul 2000 11:04:08 +0000 Subject: [PATCH 0359/7878] files for Roy git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60334 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_filter.h | 379 ++++++++++++++++++++++++++++++ buckets/filters.c | 149 ++++++++++++ buckets/greg_patch.txt | 509 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1037 insertions(+) create mode 100644 buckets/ap_filter.h create mode 100644 buckets/filters.c create mode 100644 buckets/greg_patch.txt diff --git a/buckets/ap_filter.h b/buckets/ap_filter.h new file mode 100644 index 00000000000..3ab38e5190d --- /dev/null +++ b/buckets/ap_filter.h @@ -0,0 +1,379 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef AP_FILTER_H +#define AP_FILTER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_STDARG_H +#include +#endif + +#include "httpd.h" +#include "apr.h" + +/* + * FILTER CHAIN + * + * Filters operate using a "chaining" mechanism. The filters are chained + * together into a sequence. When output is generated, it is passed through + * each of the filters on this chain, until it reaches the end (or "bottom") + * and is placed onto the network. + * + * The top of the chain, the code generating the output, is typically called + * a "content generator." The content generator's output is fed into the + * filter chain using the standard Apache output mechanisms: ap_rputs(), + * ap_rprintf(), ap_rwrite(), etc. + * + * Each filter is defined by a callback. This callback takes the output from + * the previous filter (or the content generator if there is no previous + * filter), operates on it, and passes the result to the next filter in the + * chain. This pass-off is performed using the ap_fc_* functions, such as + * ap_fc_puts(), ap_fc_printf(), ap_fc_write(), etc. + * + * When content generation is complete, the system will pass an "end of + * stream" marker into the filter chain. The filters will use this to flush + * out any internal state and to detect incomplete syntax (for example, an + * unterminated SSI directive). + */ + +/* + * BUCKETS + * + * Filtering uses a "bucket" metaphor for holding content to be processed. + * These buckets may contain arbitrary types of data. The selection of the + * type is dependent upon how the "upstream" filter/generator places content + * into the filter chain stream. + * + * For example, if a content generator uses ap_rwrite(), then the data will + * be placed into an AP_BUCKET_PTRLEN bucket. This bucket type contains a + * single pointer/length pair which will refer to the data. + * + * Buckets types are defined around the need to avoid copying the data if + * at all possible. Whatever the "natural" input form is for a piece of + * content, this is modelled within the bucket types. For example, when a + * content generator uses ap_rprintf() or a filter uses ap_fc_printf(), + * the format string and arguments are fed into/down the filter chain as + * just theat: a format string and its arguments. The filter mechanism avoids + * reducing the format/args to a final string for as long as possible. At + * some point, a filter or the output of the chain will combine these to + * produce actual bytes, but it is most optimal to defer this until it is + * truly needed. + * + * See the ap_bucket_type enumeration for the different bucket types which + * are currently defined. + * + * Buckets may also be linked into a list so that they may be passed as + * entire groups of content. The filter may insert/remove/replace the buckets + * within this list before passing the list to the next filter. + */ + +/* forward declare some types */ +typedef struct ap_filter_t ap_filter_t; +typedef struct ap_bucket_t ap_bucket_t; + +/* + * ap_filter_bucket_cb: + * + * This function type is used for filter callbacks. It will be passed a + * pointer to "this" filter, and a "bucket" containing the content to be + * filtered. + * + * In filter->ctx, the callback will find its context. This context is + * provided here, so that a filter may be installed multiple times, each + * receiving its own per-install context pointer. + * + * Callbacks are associated with a filter definition, which is specified + * by name. See ap_register_filter() for setting the association between + * a name for a filter and its associated callback (and other information). + * + * The *bucket structure (and all those referenced by ->next and ->prev) + * should be considered "const". The filter is allowed to modify the + * next/prev to insert/remove/replace elements in the bucket list, but + * the types and values of the individual buckets should not be altered. + */ +typedef void (*ap_filter_bucket_cb)(ap_filter_t *filter, + ap_bucket_t *bucket); + +/* + * ap_filter_type: + * + * Filters have different types/classifications. These are used to group + * and sort the filters to properly sequence their operation. + * + * AP_FTYPE_CONTENT: + * These filters are used to alter the content that is passed through + * them. Examples are SSI or PHP. + * + * AP_FTYPE_CONNECTION: + * These filters will alter the content, but in ways that are more + * strongly associated with the output connection. Examples are + * compression, character recoding, or chunked transfer coding. + * + * It is important to note that these types of filters are not allowed + * in a sub-request. A sub-requests output can certainly be filtered + * by AP_FTYPE_CONTENT filters, but all of the "final processing" is + * determined by the main request. + * + * The types have a particular sort order, which allows us to insert them + * into the filter chain in a determistic order. Within a particular grouping, + * the ordering is equivalent to the order of calls to ap_add_filter(). + */ +typedef enum { + AP_FTYPE_CONTENT, + AP_FTYPE_CONNECTION +} ap_filter_type; + +/* + * ap_filter_t: + * + * This is the request-time context structure for an installed filter (in + * the output filter chain). It provides the callback to use for filtering, + * the request this filter is associated with (which is important when + * an output chain also includes sub-request filters), the context for this + * installed filter, and the filter ordering/chaining fields. + * + * Filter callbacks are free to use ->ctx as they please, to store context + * during the filter process. Generally, this is superior over associating + * the state directly with the request. A callback should not change any of + * the other fields. + */ +struct ap_filter_t { + ap_filter_bucket_cb bucket_cb; + request_rec *r; + + void *ctx; + + ap_filter_type ftype; + ap_filter_t *next; +}; + +/* + * ap_bucket_type: + * + * This enumeration is used to specify what type of bucket is present when + * an ap_bucket_t is provided. + * + * AP_BUCKET_PTRLEN: + * This bucket type defines a simple pointer/length pair for the content. + * The content is NOT necessarily null-terminated. + * + * This type occurs when ap_rwrite(), ap_fc_write(), ap_rputs(), + * ap_fc_puts(), ap_rputc(), or ap_fc_putc() is used by the upstream + * filter/generator. + * + * AP_BUCKET_STRINGS: + * This bucket type defines a set of null-terminated strings. The actual + * representation is through varargs' va_list type. A filter can sequence + * through the arguments using the va_arg() macro (and the "const char *" + * type). The filter should NOT use va_start() or va_end(). When va_arg() + * returns a NULL pointer, the list of strings is complete. + * + * Note that you can only sequence through the strings once, due to the + * definition of va_list. Thus, the first filter to do this sequencing + * must pass the resulting content to the next filter in a new form (the + * bucket cannot simply be passed because ->va is useless). + * + * This type occurs when ap_rvputs(), ap_fc_putstrs, or ap_fc_vputstrs() + * is used by the upstream filter/generator. + * + * AP_BUCKET_PRINTF: + * This bucket type defines a printf-style format and arguments. Similar + * to AP_BUCKET_STRINGS, this type also uses the ->va field to refer to + * the arguments. The format for the printf is stored in ->fmt. + * + * Also similar to AP_BUCKET_STRINGS, the va_start/va_end macros should + * not be used, and ->va should be processed only once. The bucket may + * not be passed after this processing. + * + * This type occurs when ap_rprintf(), ap_vrprintf(), ap_fc_printf(), or + * ap_fc_vprintf() is used by the upstream filter/generator. + * + * AP_BUCKET_FILE: + * This bucket type refers to an open file, from the current position + * and extending for ->flen bytes. Since there are some ap_file_t + * implementations/types that are not seekable, it may be impossible to + * "rewind" the file's current position after reading the contenxt. + * Therefore, it is important to note that once the content has been + * read, it must be passed to the next filter in a different form. + * + * Note: if there is a way to determine whether a file is seekable, then + * it would be legal to fetch the current position, read the contents, + * rewind to the original position, and then pass this bucket/file down + * to the next filter in the output chain. + * + * This type occurs when ap_send_fd(), ap_send_fd_length(), or + * ap_fc_sendfile() are used by the upstream filter/generator. + * + * AP_BUCKET_EOS: + * This bucket signals the end of the content stream. The filter should + * flush any internal state and issue errors if the state specifies that + * and end of stream cannot occur now (e.g. a command directive is + * incomplete). + * + * This type occurs when Apache finalizes a (sub)request, or when an + * upstream filter passes this bucket along. + */ +typedef enum { + AP_BUCKET_PTRLEN, + AP_BUCKET_STRINGS, + AP_BUCKET_PRINTF, + AP_BUCKET_FILE, + AP_BUCKET_EOS +} ap_bucket_type; + +/* + * ap_bucket_t: + * + * The actual bucket definition. The type is determined by the ->type field. + * Which fields are valid/useful in the bucket is determined by the type, + * as noted below and in the comments above for each type. + * + * Buckets are arranged in a doubly-linked list so that a filter may insert, + * remove, or replace elements in a list of buckets. Generally, a filter + * should not change any bucket values other than these link pointers. + */ +struct ap_bucket_t { + ap_bucket_type type; + + const char *buf; /* AP_BUCKET_PTRLEN */ + ap_size_t len; /* AP_BUCKET_PTRLEN */ + + const char *fmt; /* AP_BUCKET_PRINTF */ + va_list va; /* AP_BUCKET_STRINGS, _PRINTF */ + + ap_file_t *file; /* AP_BUCKET_FILE */ + ap_ssize_t flen; /* AP_BUCKET_FILE */ + + ap_bucket_t *next; /* next bucket in list */ + ap_bucket_t *prev; /* previous bucket in list */ +}; + +/* + * FILTER CHAIN OUTPUT FUNCTIONS + * + * These functions are used to deliver output/content down to the next + * filter in the chain. + * + * ap_fc_write(): write a block of bytes + * ap_fc_putc(): write a single character + * ap_fc_puts(): write a null-terminated string + * ap_fc_putstrs(): write a set of null-termianted strings; the end is + * signaled by a NULL parameter + * ap_fc_vputstrs(): same as ap_fc_putstrs(), but where the set of strings + * is defined by a va_list + * ap_fc_printf(): use printf-like semantics for writing a string + * ap_fc_vprintf(): use printf-like semantics, but with a va_list for the args + * ap_fc_sendfile(): send the file contents, from the current file position, + * and extending for "len" bytes; AP_FC_SENDFILE_ALL is + * used to send from current-position to the end-of-file. + * ap_fc_putbucket(): write a bucket into the filter chain + */ +API_EXPORT(void) ap_fc_write(ap_filter_t *filter, const char *buf, + ap_size_t len); +API_EXPORT(void) ap_fc_putc(ap_filter_t *filter, int c); +API_EXPORT(void) ap_fc_puts(ap_filter_t *filter, const char *str); + +API_EXPORT_NONSTD(void) ap_fc_putstrs(ap_filter_t *filter, ...); +API_EXPORT(void) ap_fc_vputstrs(ap_filter_t *filter, va_list va); + +API_EXPORT_NONSTD(void) ap_fc_printf(ap_filter_t *filter, + const char *fmt, ...); +API_EXPORT(void) ap_fc_vprintf(ap_filter_t *filter, + const char *fmt, va_list va); + +API_EXPORT(void) ap_fc_sendfile(ap_filter_t *filter, ap_file_t *file, + ap_ssize_t flen); +#define AP_FC_SENDFILE_ALL ((ap_ssize_t) -1) + +/* note: bucket->next and ->prev may be changed upon return from this */ +API_EXPORT(void) ap_fc_putbucket(ap_filter_t *filter, ap_bucket_t *bucket); + + +/* + * ap_register_filter(): + * + * This function is used to register a filter with the system. After this + * registration is performed, then a filter may be added into the filter + * chain by using ap_add_filter() and simply specifying the name. + * + * The filter's callback and type should be passed. + */ +API_EXPORT(void) ap_register_filter(const char *name, + ap_filter_bucket_cb bucket_cb, + ap_filter_type ftype); + +/* + * ap_add_filter(): + * + * Adds a named filter into the filter chain on the specified request record. + * The filter will be installed with the specified context pointer. + * + * Filters added in this way will always be placed at the end of the filters + * that have the same type (thus, the filters have the same order as the + * calls to ap_add_filter). If the current filter chain contains filters + * from another request, then this filter will be added before those other + * filters. + */ +API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r); + + +#ifdef __cplusplus +} +#endif + +#endif /* !AP_FILTER_H */ diff --git a/buckets/filters.c b/buckets/filters.c new file mode 100644 index 00000000000..05a4538e1d4 --- /dev/null +++ b/buckets/filters.c @@ -0,0 +1,149 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "ap_filter.h" + + + +/* + * ap_filter_rec_t: + * + * This (internal) structure is used for recording information about the + * registered filters. It associates a name with the filter's callback + * and filter type. + * + * At the moment, these are simply linked in a chain, so a ->next pointer + * is available. + */ +typedef struct ap_filter_rec_t { + const char *name; + ap_filter_bucket_cb bucket_cb; + ap_filter_type ftype; + + struct ap_filter_rec_t *next; +} ap_filter_rec_t; + +/* ### make this visible for direct manipulation? + ### use a hash table +*/ +static ap_filter_rec_t *registered_filters = NULL; + +/* NOTE: Apache's current design doesn't allow a pool to be passed thu, + so we depend on a global to hold the correct pool +*/ +#define FILTER_POOL ap_global_hook_pool +#include "ap_hooks.h" /* for ap_global_hook_pool */ + +/* +** This macro returns true/false if a given filter should be inserted BEFORE +** another filter. This will happen when one of: 1) there isn't another +** filter; 2) that filter has a higher filter type (class); 3) that filter +** corresponds to a different request. +*/ +#define INSERT_BEFORE(f, before_this) ((before_this) == NULL \ + || (before_this)->ftype > (f)->ftype \ + || (before_this)->r != (f)->r) + + +static ap_status_t filter_cleanup(void *ctx) +{ + registered_filters = NULL; + return APR_SUCCESS; +} + +API_EXPORT(void) ap_register_filter(const char *name, + ap_filter_bucket_cb bucket_cb, + ap_filter_type ftype) +{ + ap_filter_rec_t *frec = ap_palloc(FILTER_POOL, sizeof(*frec)); + + frec->name = name; + frec->bucket_cb = bucket_cb; + frec->ftype = ftype; + + frec->next = registered_filters; + registered_filters = frec; + + ap_register_cleanup(FILTER_POOL, NULL, filter_cleanup, NULL); +} + +API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) +{ + ap_filter_rec_t *frec = registered_filters; + + for (; frec != NULL; frec = frec->next) { + if (!strcasecmp(name, frec->name)) { + ap_filter_t *f = ap_pcalloc(r->pool, sizeof(*f)); + + f->bucket_cb = frec->bucket_cb; + f->r = r; + f->ctx = ctx; + f->ftype = frec->ftype; + + if (INSERT_BEFORE(f, r->filters)) { + f->next = r->filters; + r->filters = f; + } + else { + ap_filter_t *fscan = r->filters; + while (!INSERT_BEFORE(f, fscan->next)) + fscan = fscan->next; + f->next = fscan->next; + fscan->next = f; + } + + break; + } + } +} diff --git a/buckets/greg_patch.txt b/buckets/greg_patch.txt new file mode 100644 index 00000000000..3895633aca2 --- /dev/null +++ b/buckets/greg_patch.txt @@ -0,0 +1,509 @@ +Index: include/httpd.h +=================================================================== +RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v +retrieving revision 1.64 +diff -u -r1.64 httpd.h +--- include/httpd.h 2000/06/30 21:18:13 1.64 ++++ include/httpd.h 2000/07/12 11:00:55 +@@ -731,7 +731,9 @@ + #ifdef APACHE_XLATE + struct ap_rr_xlate *rrx; + #endif /*APACHE_XLATE*/ +- ++ ++ struct ap_filter_t *filters; ++ + /* Things placed at the end of the record to avoid breaking binary + * compatibility. It would be nice to remember to reorder the entire + * record to improve 64bit alignment the next time we need to break +Index: main/http_protocol.c +=================================================================== +RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v +retrieving revision 1.95 +diff -u -r1.95 http_protocol.c +--- main/http_protocol.c 2000/07/11 03:48:18 1.95 ++++ main/http_protocol.c 2000/07/12 11:01:10 +@@ -77,6 +77,8 @@ + #include "util_date.h" /* For parseHTTPdate and BAD_DATE */ + #include "util_charset.h" + #include "mpm_status.h" ++#include "ap_filter.h" ++ + #ifdef HAVE_STDARG_H + #include + #endif +@@ -99,6 +101,9 @@ + ap_bgetopt (r->connection->client, BO_BYTECT, &r->bytes_sent); \ + } while (0) + ++#define DECL_FILTER_HEAD(r, f) \ ++ ap_filter_t f = { NULL, (r), NULL, 0, (r)->filters } ++ + + /* if this is the first error, then log an INFO message and shut down the + * connection. +@@ -406,6 +411,9 @@ + + API_EXPORT(int) ap_set_content_length(request_rec *r, long clength) + { ++ if (r->filters != NULL) ++ return 0; ++ + r->clength = clength; + ap_table_setn(r->headers_out, "Content-Length", ap_psprintf(r->pool, "%ld", clength)); + return 0; +@@ -1277,8 +1285,17 @@ + rnew->main = (request_rec *) r; + } + ++static void flush_filters(request_rec *r) ++{ ++ DECL_FILTER_HEAD(r, filter); ++ ap_bucket_t bucket = { AP_BUCKET_EOS }; ++ ++ ap_fc_putbucket(&filter, &bucket); ++} ++ + void ap_finalize_sub_req_protocol(request_rec *sub) + { ++ flush_filters(sub); + SET_BYTES_SENT(sub->main); + } + +@@ -1832,11 +1849,6 @@ + #endif /*APACHE_XLATE*/ + } + +-static void flush_filters(request_rec *r) +-{ +- /* ### place holder to flush pending content through the filters */ +-} +- + /* finalize_request_protocol is called at completion of sending the + * response. It's sole purpose is to send the terminating protocol + * information for any wrappers around the response message body +@@ -2475,107 +2487,88 @@ + + API_EXPORT(int) ap_rputc(int c, request_rec *r) + { ++ DECL_FILTER_HEAD(r, filter); ++ + if (r->connection->aborted) + return EOF; + +- if (ap_bputc(c, r->connection->client) < 0) { +- check_first_conn_error(r, "rputc", 0); +- return EOF; +- } ++ ap_fc_putc(&filter, c); ++ + SET_BYTES_SENT(r); +- return c; ++ return 1; + } + + API_EXPORT(int) ap_rputs(const char *str, request_rec *r) + { +- int rcode; ++ DECL_FILTER_HEAD(r, filter); + + if (r->connection->aborted) + return EOF; + +- rcode = ap_bputs(str, r->connection->client); +- if (rcode < 0) { +- check_first_conn_error(r, "rputs", 0); +- return EOF; +- } ++ ap_fc_puts(&filter, str); ++ + SET_BYTES_SENT(r); +- return rcode; ++ return 1; + } + + API_EXPORT(int) ap_rwrite(const void *buf, int nbyte, request_rec *r) + { +- ap_ssize_t n; +- ap_status_t rv; ++ DECL_FILTER_HEAD(r, filter); + + if (r->connection->aborted) + return EOF; + +- /* ### should loop to avoid partial writes */ +- rv = ap_bwrite(r->connection->client, buf, nbyte, &n); +- if (rv != APR_SUCCESS) { +- check_first_conn_error(r, "rwrite", rv); +- return EOF; +- } ++ ap_fc_write(&filter, buf, nbyte); ++ + SET_BYTES_SENT(r); +- return n; ++ return nbyte; + } + + API_EXPORT(int) ap_vrprintf(request_rec *r, const char *fmt, va_list va) + { +- int n; ++ DECL_FILTER_HEAD(r, filter); + + if (r->connection->aborted) + return EOF; + +- n = ap_vbprintf(r->connection->client, fmt, va); ++ ap_fc_vprintf(&filter, fmt, va); + +- if (n < 0) { +- check_first_conn_error(r, "vrprintf", 0); +- return EOF; +- } + SET_BYTES_SENT(r); +- return n; ++ return 1; + } + + API_EXPORT_NONSTD(int) ap_rprintf(request_rec *r, const char *fmt, ...) + { + va_list va; +- int n; ++ ++ DECL_FILTER_HEAD(r, filter); + + if (r->connection->aborted) + return EOF; + + va_start(va, fmt); +- n = ap_vbprintf(r->connection->client, fmt, va); ++ ap_fc_vprintf(&filter, fmt, va); + va_end(va); + +- if (n < 0) { +- check_first_conn_error(r, "rprintf", 0); +- return EOF; +- } + SET_BYTES_SENT(r); +- return n; ++ return 1; + } + + API_EXPORT_NONSTD(int) ap_rvputs(request_rec *r, ...) + { + va_list va; +- int n; ++ ++ DECL_FILTER_HEAD(r, filter); + + if (r->connection->aborted) + return EOF; + + va_start(va, r); +- n = ap_vbputstrs(r->connection->client, va); ++ ap_fc_vputstrs(&filter, va); + va_end(va); + +- if (n < 0) { +- check_first_conn_error(r, "rvputs", 0); +- return EOF; +- } +- + SET_BYTES_SENT(r); +- return n; ++ return 1; + } + + API_EXPORT(int) ap_rflush(request_rec *r) +@@ -2589,6 +2582,210 @@ + return 0; + } + ++static void BUFF_filter_callback(ap_filter_t *filter, ap_bucket_t *bucket) ++{ ++ ap_bucket_t *bscan = bucket; ++ ++ for (bscan = bucket; bscan != NULL; bscan = bscan->next) { ++ int n = 0; ++ ++ switch (bscan->type) { ++ case AP_BUCKET_PTRLEN: ++ if (bscan->len == 1) { ++ n = ap_bputc(*bscan->buf, filter->r->connection->client); ++ } ++ else { ++ ap_status_t rv; ++ ap_ssize_t written; ++ ++ /* ### should loop to ensure everything is written */ ++ rv = ap_bwrite(filter->r->connection->client, bscan->buf, ++ bscan->len, &written); ++ if (rv != APR_SUCCESS) { ++ check_first_conn_error(filter->r, "BUFF_filter_callback", ++ rv); ++ } ++ /* fallthru; n == 0 */ ++ } ++ break; ++ ++ case AP_BUCKET_STRINGS: ++ n = ap_vbputstrs(filter->r->connection->client, bscan->va); ++ break; ++ ++ case AP_BUCKET_PRINTF: ++ n = ap_vbprintf(filter->r->connection->client, bscan->fmt, ++ bscan->va); ++ break; ++ ++ case AP_BUCKET_FILE: ++ /* ### fill in file case */ ++ /* ### fallthru; n == 0 */ ++ break; ++ ++ case AP_BUCKET_EOS: ++ /* there is nothing to do here */ ++ /* fallthru; n == 0 */ ++ break; ++ ++ default: ++ /* ### set some kind of error */ ++ break; ++ } ++ ++ if (n < 0) ++ check_first_conn_error(filter->r, "BUFF_filter_callback", 0); ++ } ++} ++ ++API_EXPORT(void) ap_fc_write(ap_filter_t *filter, const char *buf, ++ ap_size_t len) ++{ ++ ap_filter_t *next; ++ ap_bucket_t bucket = { AP_BUCKET_PTRLEN, buf, len }; ++ ++ if (filter->r->connection->aborted || len == 0) ++ return; ++ ++ if ((next = filter->next) == NULL) { ++ /* ### until we really put it into place */ ++ BUFF_filter_callback(filter, &bucket); ++ } ++ else { ++ (*next->bucket_cb)(next, &bucket); ++ } ++} ++ ++API_EXPORT(void) ap_fc_putc(ap_filter_t *filter, int c) ++{ ++ ap_filter_t *next; ++ char c2 = (char)c; ++ ap_bucket_t bucket = { AP_BUCKET_PTRLEN, &c2, 1 }; ++ ++ if (filter->r->connection->aborted) ++ return; ++ ++ if ((next = filter->next) == NULL) { ++ /* ### until we really put it into place */ ++ BUFF_filter_callback(filter, &bucket); ++ } ++ else { ++ (*next->bucket_cb)(next, &bucket); ++ } ++} ++ ++API_EXPORT(void) ap_fc_puts(ap_filter_t *filter, const char *str) ++{ ++ ap_filter_t *next; ++ ap_bucket_t bucket = { AP_BUCKET_PTRLEN, str, strlen(str) }; ++ ++ if (filter->r->connection->aborted || *str == '\0') ++ return; ++ ++ if ((next = filter->next) == NULL) { ++ /* ### until we really put it into place */ ++ BUFF_filter_callback(filter, &bucket); ++ } ++ else { ++ (*next->bucket_cb)(next, &bucket); ++ } ++} ++ ++API_EXPORT_NONSTD(void) ap_fc_putstrs(ap_filter_t *filter, ...) ++{ ++ va_list va; ++ ++ if (filter->r->connection->aborted) ++ return; ++ ++ va_start(va, filter); ++ ap_fc_vputstrs(filter, va); ++ va_end(va); ++} ++ ++API_EXPORT(void) ap_fc_vputstrs(ap_filter_t *filter, va_list va) ++{ ++ ap_filter_t *next; ++ ap_bucket_t bucket = { AP_BUCKET_STRINGS, NULL, 0, NULL, va }; ++ ++ if (filter->r->connection->aborted) ++ return; ++ ++ if ((next = filter->next) == NULL) { ++ /* ### until we really put it into place */ ++ BUFF_filter_callback(filter, &bucket); ++ } ++ else { ++ (*next->bucket_cb)(next, &bucket); ++ } ++} ++ ++API_EXPORT_NONSTD(void) ap_fc_printf(ap_filter_t *filter, const char *fmt, ...) ++{ ++ va_list va; ++ ++ if (filter->r->connection->aborted) ++ return; ++ ++ va_start(va, fmt); ++ ap_fc_vprintf(filter, fmt, va); ++ va_end(va); ++} ++ ++API_EXPORT(void) ap_fc_vprintf(ap_filter_t *filter, ++ const char *fmt, va_list va) ++{ ++ ap_filter_t *next; ++ ap_bucket_t bucket = { AP_BUCKET_PRINTF, NULL, 0, fmt, va }; ++ ++ if (filter->r->connection->aborted) ++ return; ++ ++ if ((next = filter->next) == NULL) { ++ /* ### until we really put it into place */ ++ BUFF_filter_callback(filter, &bucket); ++ } ++ else { ++ (*next->bucket_cb)(next, &bucket); ++ } ++} ++ ++API_EXPORT(void) ap_fc_sendfile(ap_filter_t *filter, ap_file_t *file, ++ ap_ssize_t flen) ++{ ++ ap_filter_t *next; ++ ap_bucket_t bucket = { ++ AP_BUCKET_FILE, NULL, 0, NULL, NULL, file, flen ++ }; ++ ++ if (filter->r->connection->aborted || flen == 0) ++ return; ++ ++ if ((next = filter->next) == NULL) { ++ /* ### until we really put it into place */ ++ BUFF_filter_callback(filter, &bucket); ++ } ++ else { ++ (*next->bucket_cb)(next, &bucket); ++ } ++} ++ ++API_EXPORT(void) ap_fc_putbucket(ap_filter_t *filter, ap_bucket_t *bucket) ++{ ++ ap_filter_t *next; ++ ++ if (filter->r->connection->aborted) ++ return; ++ ++ if ((next = filter->next) == NULL) { ++ /* ### until we really put it into place */ ++ BUFF_filter_callback(filter, bucket); ++ } ++ else { ++ (*next->bucket_cb)(next, bucket); ++ } ++} ++ + /* We should have named this send_canned_response, since it is used for any + * response that can be generated by the server from the request record. + * This includes all 204 (no content), 3xx (redirect), 4xx (client error), +@@ -2977,6 +3174,7 @@ + ap_finalize_request_protocol(r); + ap_rflush(r); + } ++ + + AP_IMPLEMENT_HOOK_RUN_ALL(int,post_read_request, + (request_rec *r),(r),OK,DECLINED) +Index: main/http_request.c +=================================================================== +RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v +retrieving revision 1.35 +diff -u -r1.35 http_request.c +--- main/http_request.c 2000/06/24 17:33:57 1.35 ++++ main/http_request.c 2000/07/12 11:01:23 +@@ -769,6 +769,9 @@ + rnew->htaccess = r->htaccess; + rnew->per_dir_config = r->server->lookup_defaults; + ++ /* start with the same set of output filters */ ++ rnew->filters = r->filters; ++ + ap_set_sub_req_protocol(rnew, r); + + /* would be nicer to pass "method" to ap_set_sub_req_protocol */ +@@ -857,6 +860,9 @@ + rnew->htaccess = r->htaccess; + rnew->chunked = r->chunked; + ++ /* start with the same set of output filters */ ++ rnew->filters = r->filters; ++ + ap_set_sub_req_protocol(rnew, r); + fdir = ap_make_dirstr_parent(rnew->pool, r->filename); + +@@ -960,16 +966,22 @@ + + API_EXPORT(int) ap_run_sub_req(request_rec *r) + { +-#ifndef APACHE_XLATE +- int retval = ap_invoke_handler(r); +-#else /*APACHE_XLATE*/ +- /* Save the output conversion setting of the caller across subrequests */ + int retval; +- ap_xlate_t *saved_xlate; + +- ap_bgetopt(r->connection->client, BO_WXLATE, &saved_xlate); +- retval = ap_invoke_handler(r); +- ap_bsetopt(r->connection->client, BO_WXLATE, &saved_xlate); ++ /* see comments in process_request_internal() */ ++ ap_run_insert_filter(r); ++ ++#ifndef APACHE_XLATE ++ retval = ap_invoke_handler(r); ++#else /*APACHE_XLATE*/ ++ { ++ /* Save the output conversion setting across subrequests */ ++ ap_xlate_t *saved_xlate; ++ ++ ap_bgetopt(r->connection->client, BO_WXLATE, &saved_xlate); ++ retval = ap_invoke_handler(r); ++ ap_bsetopt(r->connection->client, BO_WXLATE, &saved_xlate); ++ } + #endif /*APACHE_XLATE*/ + ap_finalize_sub_req_protocol(r); + return retval; +Index: main/Makefile.in +=================================================================== +RCS file: /home/cvs/apache-2.0/src/main/Makefile.in,v +retrieving revision 1.16 +diff -u -r1.16 Makefile.in +--- main/Makefile.in 2000/07/01 14:14:15 1.16 ++++ main/Makefile.in 2000/07/12 11:01:35 +@@ -8,7 +8,7 @@ + http_protocol.c http_request.c http_vhost.c util.c util_date.c \ + util_script.c util_uri.c util_md5.c util_cfgtree.c util_ebcdic.c \ + rfc1413.c http_connection.c iol_file.c iol_socket.c listen.c \ +- mpm_common.c util_charset.c util_debug.c util_xml.c ++ mpm_common.c util_charset.c util_debug.c util_xml.c filters.c + + include $(top_srcdir)/build/ltlib.mk + From 7472ed66470416d089df406e70944a67555fd39f Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 12 Jul 2000 14:48:09 +0000 Subject: [PATCH 0360/7878] Remove some warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60335 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 11 +++-------- buckets/ap_rmem_buf.c | 3 --- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 5356227cca0..771bc48f630 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -255,12 +255,11 @@ APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b) return 0; } -APR_EXPORT(int) ap_brigade_vputs(ap_bucket_brigade *b, ...) +APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) { ap_bucket *r; - va_list va; const char *x; - int n, j, k, rv; + int j, k, rv; ap_ssize_t i; if (b->tail->bucket->color == AP_BUCKET_rwmem) { @@ -272,12 +271,9 @@ APR_EXPORT(int) ap_brigade_vputs(ap_bucket_brigade *b, ...) * bucket. This is incredibly easy to take out if it is a bad * idea. RBB */ - va_start(va, b); ap_rwmem_vputstrs(rw, va); - va_end(va); } - va_start(va, b); for (k = 0;;) { r = ap_bucket_new(AP_BUCKET_rmem); x = va_arg(va, const char *); @@ -300,7 +296,6 @@ APR_EXPORT(int) ap_brigade_vputs(ap_bucket_brigade *b, ...) b->tail = b->tail->next; b->tail->bucket = r; } - va_end(v); - return n; + return k; } diff --git a/buckets/ap_rmem_buf.c b/buckets/ap_rmem_buf.c index a74324b9fd0..4410b452cf8 100644 --- a/buckets/ap_rmem_buf.c +++ b/buckets/ap_rmem_buf.c @@ -90,9 +90,6 @@ APR_EXPORT(int) ap_rmem_get_len(ap_bucket_rmem *b) APR_EXPORT(int) ap_rmem_write(ap_bucket_rmem *b, const void *buf, ap_size_t nbyte, ap_ssize_t *bytes_written) { - int amt; - int total; - if (nbyte == 0) { *bytes_written = 0; return APR_SUCCESS; From 83b9ea855b035072c1b4ec9c3f65eec3f9a2ef83 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 12 Jul 2000 16:47:19 +0000 Subject: [PATCH 0361/7878] Various bucket fixes. Basically just casts the pointers to (char *) for the pointer arithmetic. Submitted by: Victor J. Orlikowski Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60336 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_rmem_buf.c | 4 ++-- buckets/ap_rwmem_buf.c | 10 +++++----- buckets/apr_buf.h | 2 +- include/apr_buf.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/buckets/ap_rmem_buf.c b/buckets/ap_rmem_buf.c index 4410b452cf8..55e871f3d88 100644 --- a/buckets/ap_rmem_buf.c +++ b/buckets/ap_rmem_buf.c @@ -77,7 +77,7 @@ APR_EXPORT(const char *) ap_rmem_get_char_str(ap_bucket_rmem *b) APR_EXPORT(int) ap_rmem_get_len(ap_bucket_rmem *b) { - return b->end - b->start; + return (char *)b->end - (char *)b->start; } /* @@ -99,7 +99,7 @@ APR_EXPORT(int) ap_rmem_write(ap_bucket_rmem *b, const void *buf, * much memory, but that can wait for the second pass. */ b->start = buf; - b->end = b->start + nbyte; + b->end = (char *)b->start + nbyte; *bytes_written = nbyte; return APR_SUCCESS; } diff --git a/buckets/ap_rwmem_buf.c b/buckets/ap_rwmem_buf.c index 96aa64eecb8..82cacae5f79 100644 --- a/buckets/ap_rwmem_buf.c +++ b/buckets/ap_rwmem_buf.c @@ -87,13 +87,13 @@ APR_EXPORT(char *) ap_rwmem_get_char_str(ap_bucket_rwmem *b) APR_EXPORT(int) ap_rwmem_get_len(ap_bucket_rwmem *b) { - return b->end - b->start; + return (char *)b->end - (char *)b->start; } /* * save nbyte bytes to the bucket. - * Only returns fewer than nbyte if an error ocurred. - * Returns -1 if no bytes were written before the error ocurred. + * Only returns fewer than nbyte if an error occurred. + * Returns -1 if no bytes were written before the error occurred. * It is worth noting that if an error occurs, the buffer is in an unknown * state. */ @@ -114,7 +114,7 @@ APR_EXPORT(int) ap_rwmem_write(ap_bucket_rwmem *b, const void *buf, * leaving that for a later pass. The basics are presented below, but this * is horribly broken. */ - amt = b->alloc_len - (b->end - b->start); + amt = b->alloc_len - ((char *)b->end - (char *)b->start); total = 0; if (nbyte > amt) { /* loop through and write to the disk */ @@ -122,7 +122,7 @@ APR_EXPORT(int) ap_rwmem_write(ap_bucket_rwmem *b, const void *buf, } /* now we know that nbyte < b->alloc_len */ memcpy(b->end, buf, nbyte); - b->end += nbyte; + b->end = (char *)b->end + nbyte; *bytes_written = total + nbyte; return APR_SUCCESS; } diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index f8c47b95d47..b1f8b1d8623 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -73,7 +73,7 @@ typedef enum { AP_BUCKET_mmap, AP_BUCKET_filename, AP_BUCKET_cached_entity, - AP_BUCKET_URI, + AP_BUCKET_URI } ap_bucket_color_e; typedef struct ap_bucket ap_bucket; diff --git a/include/apr_buf.h b/include/apr_buf.h index f8c47b95d47..b1f8b1d8623 100644 --- a/include/apr_buf.h +++ b/include/apr_buf.h @@ -73,7 +73,7 @@ typedef enum { AP_BUCKET_mmap, AP_BUCKET_filename, AP_BUCKET_cached_entity, - AP_BUCKET_URI, + AP_BUCKET_URI } ap_bucket_color_e; typedef struct ap_bucket ap_bucket; From 16314b3fac6daec9e6dc13e0c3dc66920bf1f1ff Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 12 Jul 2000 16:57:54 +0000 Subject: [PATCH 0362/7878] A couple of bucket fixes. These just keep us from seg faulting in some cases. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60337 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 18 ++++++++++++------ buckets/apr_buf.h | 2 +- include/apr_buf.h | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 771bc48f630..7bf19a10993 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -130,7 +130,7 @@ APR_EXPORT(ap_bucket_list *) ap_bucket_list_create(void) { ap_bucket_list *b; - b = malloc(sizeof(*b)); + b = calloc(1, sizeof(*b)); return b; } @@ -262,7 +262,8 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) int j, k, rv; ap_ssize_t i; - if (b->tail->bucket->color == AP_BUCKET_rwmem) { + if (b->tail && b->tail->bucket && + b->tail->bucket->color == AP_BUCKET_rwmem) { ap_bucket_rwmem *rw; rw = b->tail->bucket->data; /* I have no idea if this is a good idea or not. Probably not. @@ -291,10 +292,15 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) /* This really requires an API. Basically we are just adding * a bucket to a bucket list. */ - b->tail->next = ap_bucket_list_create(); - b->tail->next->prev = b->tail->next; - b->tail = b->tail->next; - b->tail->bucket = r; + if (b->tail->bucket == NULL) { + b->tail->bucket = r; + } + else { + b->tail->next = ap_bucket_list_create(); + b->tail->next->prev = b->tail->next; + b->tail = b->tail->next; + b->tail->bucket = r; + } } return k; diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index b1f8b1d8623..cf009f9b0f9 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -133,7 +133,7 @@ APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, ap_bucket_brigade *a, ap_iol *iol); -APR_EXPORT(int) ap_brigade_vputs(ap_bucket_brigade *b, ...); +APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va); /* ****** Bucket List Functions ***** */ diff --git a/include/apr_buf.h b/include/apr_buf.h index b1f8b1d8623..cf009f9b0f9 100644 --- a/include/apr_buf.h +++ b/include/apr_buf.h @@ -133,7 +133,7 @@ APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, ap_bucket_brigade *a, ap_iol *iol); -APR_EXPORT(int) ap_brigade_vputs(ap_bucket_brigade *b, ...); +APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va); /* ****** Bucket List Functions ***** */ From cce777108faedd8b894f53d463e346096be545e3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 12 Jul 2000 22:00:08 +0000 Subject: [PATCH 0363/7878] Add an End-Of-Stream bucket type. This also makes a couple of relatively minor bug fixes in the buckets code. The bug fixes where found because of the EOS bucket, so I am including them in this patch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60338 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 16 ++++++++++++++-- buckets/apr_buf.h | 5 ++++- include/apr_buf.h | 5 ++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 7bf19a10993..dbb68002d39 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -84,6 +84,9 @@ APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color) newbuf->data = ap_rmem_create(); newbuf->free = NULL; break; + case AP_BUCKET_eos: + newbuf->data = NULL; + newbuf->free = NULL; case AP_BUCKET_file: case AP_BUCKET_filename: case AP_BUCKET_cached_entity: @@ -96,7 +99,7 @@ APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color) APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e) { - if (e->free) { + if (e->free != NULL) { e->free(e); } free(e); @@ -174,6 +177,7 @@ APR_EXPORT(void) ap_bucket_brigade_catenate(ap_bucket_brigade *a, if (a->tail) { a->tail->next = b->head; } + b->head->prev = a->tail; a->tail = b->tail; if (!a->head) { a->head = b->head; @@ -196,6 +200,9 @@ APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, do { iov_used = ap_bucket_brigade_to_iovec(b, vec, 16); status = iol_writev(iol, vec, iov_used, &bytes); + + ap_consume_buckets(b, 16); + if (status != APR_SUCCESS) { return status; } @@ -224,6 +231,8 @@ APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b) return ap_mmap_get_char_str(b->data); case AP_BUCKET_rmem: return ap_rmem_get_char_str(b->data); + case AP_BUCKET_eos: + return NULL; case AP_BUCKET_file: case AP_BUCKET_filename: case AP_BUCKET_cached_entity: @@ -244,6 +253,8 @@ APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b) return ap_mmap_get_len(b->data); case AP_BUCKET_rmem: return ap_rmem_get_len(b->data); + case AP_BUCKET_eos: + return 0; case AP_BUCKET_file: case AP_BUCKET_filename: case AP_BUCKET_cached_entity: @@ -297,7 +308,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) } else { b->tail->next = ap_bucket_list_create(); - b->tail->next->prev = b->tail->next; + b->tail->next->prev = b->tail; b->tail = b->tail->next; b->tail->bucket = r; } @@ -305,3 +316,4 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) return k; } + diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index cf009f9b0f9..1f8051c9860 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -73,7 +73,10 @@ typedef enum { AP_BUCKET_mmap, AP_BUCKET_filename, AP_BUCKET_cached_entity, - AP_BUCKET_URI + AP_BUCKET_URI, + AP_BUCKET_eos /* End-of-stream bucket. Special case to say this is + * the end of the bucket so all data should be sent + * immediately. */ } ap_bucket_color_e; typedef struct ap_bucket ap_bucket; diff --git a/include/apr_buf.h b/include/apr_buf.h index cf009f9b0f9..1f8051c9860 100644 --- a/include/apr_buf.h +++ b/include/apr_buf.h @@ -73,7 +73,10 @@ typedef enum { AP_BUCKET_mmap, AP_BUCKET_filename, AP_BUCKET_cached_entity, - AP_BUCKET_URI + AP_BUCKET_URI, + AP_BUCKET_eos /* End-of-stream bucket. Special case to say this is + * the end of the bucket so all data should be sent + * immediately. */ } ap_bucket_color_e; typedef struct ap_bucket ap_bucket; From b68a13296f16d4da0ff5df5a4beb8323353da73c Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 12 Jul 2000 22:09:58 +0000 Subject: [PATCH 0364/7878] Implement very basic versions of ap_bucket_printf and ap_bucket_vprintf for read only buckets. These really should just write directly into the bucket, but I am need something that works, and we can correct this later. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60339 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 40 ++++++++++++++++++++++++++++++++++++++++ buckets/apr_buf.h | 5 +++++ include/apr_buf.h | 5 +++++ 3 files changed, 50 insertions(+) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index dbb68002d39..1e289410327 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -317,3 +317,43 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) return k; } +APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...) +{ + va_list ap; + int res; + + va_start(ap, fmt); + res = ap_brigade_vprintf(b, fmt, ap); + va_end(ap); + return res; +} + +APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_list va) +{ + /* THIS IS A HACK. This needs to be replaced with a function to printf + * directly into a bucket. I'm being lazy right now. RBB + */ + char buf[4096]; + ap_bucket *r; + int res, i; + + res = ap_vsnprintf(buf, 4096, fmt, va); + + r = ap_bucket_new(AP_BUCKET_rmem); + res = ap_rmem_write(r->data, buf, strlen(buf), &i); + + /* This really requires an API. Basically we are just adding + * a bucket to a bucket list. + */ + if (b->tail->bucket == NULL) { + b->tail->bucket = r; + } + else { + b->tail->next = ap_bucket_list_create(); + b->tail->next->prev = b->tail; + b->tail = b->tail->next; + b->tail->bucket = r; + } + return res; +} + diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index 1f8051c9860..adee93c4c82 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -138,6 +138,11 @@ APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va); +APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...); + +APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis +t va); + /* ****** Bucket List Functions ***** */ /* create a new bucket_list */ diff --git a/include/apr_buf.h b/include/apr_buf.h index 1f8051c9860..adee93c4c82 100644 --- a/include/apr_buf.h +++ b/include/apr_buf.h @@ -138,6 +138,11 @@ APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va); +APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...); + +APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis +t va); + /* ****** Bucket List Functions ***** */ /* create a new bucket_list */ From 8264486bce6607158dd5cdafd12255a87cc2dbad Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 12 Jul 2000 22:12:49 +0000 Subject: [PATCH 0365/7878] Add ap_consume_buckets. This just destroys a specified number of buckets off the front of the brigade. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60340 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 16 ++++++++++++++++ buckets/apr_buf.h | 6 ++++-- include/apr_buf.h | 6 ++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 1e289410327..308e9fb1b67 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -187,6 +187,22 @@ APR_EXPORT(void) ap_bucket_brigade_catenate(ap_bucket_brigade *a, } } +APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec) +{ + int i; + + for (i=0; i < nvec; i++) { + if (b->head == b->tail) { + ap_bucket_destroy(b->head->bucket); + b->head = b->tail = NULL; + break; + } + b->head = b->head->next; + ap_bucket_destroy(b->head->prev->bucket); + b->head->prev = NULL; + } +} + APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, ap_bucket_brigade *b, ap_iol *iol) diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index adee93c4c82..2301465723f 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -130,6 +130,9 @@ APR_EXPORT(int) ap_bucket_brigade_to_iovec(ap_bucket_brigade *, APR_EXPORT(void) ap_bucket_brigade_catenate(ap_bucket_brigade *a, ap_bucket_brigade *b); +/* Destroy the first nvec buckets. */ +APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec); + /* save the buf out to the specified iol. This can be used to flush the data to the disk, or to send it out to the network. */ APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, @@ -140,8 +143,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va); APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...); -APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis -t va); +APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_list va); /* ****** Bucket List Functions ***** */ diff --git a/include/apr_buf.h b/include/apr_buf.h index adee93c4c82..2301465723f 100644 --- a/include/apr_buf.h +++ b/include/apr_buf.h @@ -130,6 +130,9 @@ APR_EXPORT(int) ap_bucket_brigade_to_iovec(ap_bucket_brigade *, APR_EXPORT(void) ap_bucket_brigade_catenate(ap_bucket_brigade *a, ap_bucket_brigade *b); +/* Destroy the first nvec buckets. */ +APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec); + /* save the buf out to the specified iol. This can be used to flush the data to the disk, or to send it out to the network. */ APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, @@ -140,8 +143,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va); APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...); -APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis -t va); +APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_list va); /* ****** Bucket List Functions ***** */ From 3598e70648e7357e20911e446ffd7ebfcc0a8bb7 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 12 Jul 2000 23:24:32 +0000 Subject: [PATCH 0366/7878] Change to use read/write buckets by default. This will need to be cleaned up a bit. Basically, I will think we want to use rwmem if they are the last bucket in the list, and rmem if there are no rwmem buckets at the end of the brigade. This solves the problem of current modules not working with the filtering. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60341 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 308e9fb1b67..e9ce81a25bd 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -303,13 +303,13 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) } for (k = 0;;) { - r = ap_bucket_new(AP_BUCKET_rmem); + r = ap_bucket_new(AP_BUCKET_rwmem); x = va_arg(va, const char *); if (x == NULL) break; j = strlen(x); - rv = ap_rmem_write(r->data, x, j, &i); + rv = ap_rwmem_write(r->data, x, j, &i); if (i != j) { /* Do we need better error reporting? */ return -1; @@ -355,8 +355,8 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis res = ap_vsnprintf(buf, 4096, fmt, va); - r = ap_bucket_new(AP_BUCKET_rmem); - res = ap_rmem_write(r->data, buf, strlen(buf), &i); + r = ap_bucket_new(AP_BUCKET_rwmem); + res = ap_rwmem_write(r->data, buf, strlen(buf), &i); /* This really requires an API. Basically we are just adding * a bucket to a bucket list. From fc6abff6a41e6ecc7cbcf1d8dd4039e916d79146 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 12 Jul 2000 23:25:27 +0000 Subject: [PATCH 0367/7878] Ignore the Makefile git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60342 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/.cvsignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 buckets/.cvsignore diff --git a/buckets/.cvsignore b/buckets/.cvsignore new file mode 100644 index 00000000000..f3c7a7c5da6 --- /dev/null +++ b/buckets/.cvsignore @@ -0,0 +1 @@ +Makefile From 91cec0752c3055cc63603182b168e0d437985f31 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 13 Jul 2000 00:07:44 +0000 Subject: [PATCH 0368/7878] Add my most recent patch and the other files necessary to make it work. This patch brings Apache to a point, where most pages are sent without using BUFF except for the headers. All legacy modules will work with this patch, although they will all require a memcopy just to be on the safe side. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60343 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ryan.patch | 604 ++++++++++++++++++++++++++++++++++++++++++ buckets/util_filter.c | 140 ++++++++++ buckets/util_filter.h | 115 ++++++++ 3 files changed, 859 insertions(+) create mode 100644 buckets/ryan.patch create mode 100644 buckets/util_filter.c create mode 100644 buckets/util_filter.h diff --git a/buckets/ryan.patch b/buckets/ryan.patch new file mode 100644 index 00000000000..541ebca6d4e --- /dev/null +++ b/buckets/ryan.patch @@ -0,0 +1,604 @@ +? build.log +? build.err +? .inslog2 +? include/util_filter.h +? lib/apr/build.log +? lib/apr/build.err +? lib/apr/shmem/config.cache +? main/util_filter.c +Index: configure.in +=================================================================== +RCS file: /home/cvs/apache-2.0/src/configure.in,v +retrieving revision 1.72 +diff -u -d -b -w -u -r1.72 configure.in +--- configure.in 2000/07/01 14:08:21 1.72 ++++ configure.in 2000/07/12 23:26:38 +@@ -78,7 +78,7 @@ + netdb.h \ + pwd.h \ + grp.h \ +-strings.h ++strings.h \ + ) + AC_HEADER_SYS_WAIT + +Index: ap/Makefile.in +=================================================================== +RCS file: /home/cvs/apache-2.0/src/ap/Makefile.in,v +retrieving revision 1.4 +diff -u -d -b -w -u -r1.4 Makefile.in +--- ap/Makefile.in 2000/06/12 20:41:13 1.4 ++++ ap/Makefile.in 2000/07/12 23:26:38 +@@ -1,5 +1,5 @@ + + LTLIBRARY_NAME = libap.la +-LTLIBRARY_SOURCES = ap_cache.c ap_base64.c ap_sha1.c ap_buf.c ap_hooks.c ++LTLIBRARY_SOURCES = ap_cache.c ap_base64.c ap_sha1.c ap_hooks.c + + include $(top_srcdir)/build/ltlib.mk +Index: include/ap_iol.h +=================================================================== +RCS file: /home/cvs/apache-2.0/src/include/ap_iol.h,v +retrieving revision 1.19 +diff -u -d -b -w -u -r1.19 ap_iol.h +--- include/ap_iol.h 2000/05/29 04:22:02 1.19 ++++ include/ap_iol.h 2000/07/12 23:26:39 +@@ -58,6 +58,7 @@ + #define AP_IOL_H + + #include "apr_general.h" /* For ap_s?size_t */ ++#include "apr_network_io.h" /* For ap_hdtr_t */ + #include "apr_errno.h" /* For ap_status_t and the APR_errnos */ + + typedef struct ap_iol ap_iol; +Index: include/buff.h +=================================================================== +RCS file: /home/cvs/apache-2.0/src/include/buff.h,v +retrieving revision 1.30 +diff -u -d -b -w -u -r1.30 buff.h +--- include/buff.h 2000/06/29 14:34:24 1.30 ++++ include/buff.h 2000/07/12 23:26:39 +@@ -63,7 +63,7 @@ + extern "C" { + #endif + +-#ifdef HAVE_STDARG_H ++#ifdef APR_HAVE_STDARG_H + #include + #endif + #include "ap.h" +Index: include/http_protocol.h +=================================================================== +RCS file: /home/cvs/apache-2.0/src/include/http_protocol.h,v +retrieving revision 1.19 +diff -u -d -b -w -u -r1.19 http_protocol.h +--- include/http_protocol.h 2000/07/11 03:48:17 1.19 ++++ include/http_protocol.h 2000/07/12 23:26:39 +@@ -89,8 +89,15 @@ + API_EXPORT(void) ap_basic_http_header(request_rec *r); + + /* Send the Status-Line and header fields for HTTP response */ ++API_EXPORT(void) ap_send_http_header_real(request_rec *l); + +-API_EXPORT(void) ap_send_http_header(request_rec *l); ++/* this is the old function that used to send headers to the network. We ++ * don't want handlers using it anymore, becuase the filter that actually ++ * writes to the network has to send the headers. I am defining it to be ++ * NULL, because everybody seems to want to not break existing modules. ++ * The new function ap_send_http_header_real() actually sends the data. ++ */ ++#define ap_send_http_header(l) /* No-op*/ + + /* Send the response to special method requests */ + +Index: include/httpd.h +=================================================================== +RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v +retrieving revision 1.64 +diff -u -d -b -w -u -r1.64 httpd.h +--- include/httpd.h 2000/06/30 21:18:13 1.64 ++++ include/httpd.h 2000/07/12 23:26:39 +@@ -596,6 +596,11 @@ + * pointer back to the main request. + */ + ++ ap_array_header_t *filters; /* The array of filters to call */ ++ int headers_sent; /* Have we sent the headers for this request ++ * yet. ++ */ ++ + /* Info about the request itself... we begin with stuff that only + * protocol.c should ever touch... + */ +Index: main/Makefile.in +=================================================================== +RCS file: /home/cvs/apache-2.0/src/main/Makefile.in,v +retrieving revision 1.16 +diff -u -d -b -w -u -r1.16 Makefile.in +--- main/Makefile.in 2000/07/01 14:14:15 1.16 ++++ main/Makefile.in 2000/07/12 23:26:48 +@@ -8,7 +8,7 @@ + http_protocol.c http_request.c http_vhost.c util.c util_date.c \ + util_script.c util_uri.c util_md5.c util_cfgtree.c util_ebcdic.c \ + rfc1413.c http_connection.c iol_file.c iol_socket.c listen.c \ +- mpm_common.c util_charset.c util_debug.c util_xml.c ++ mpm_common.c util_charset.c util_debug.c util_xml.c util_filter.c + + include $(top_srcdir)/build/ltlib.mk + +Index: main/http_core.c +=================================================================== +RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v +retrieving revision 1.88 +diff -u -d -b -w -u -r1.88 http_core.c +--- main/http_core.c 2000/07/11 03:48:18 1.88 ++++ main/http_core.c 2000/07/12 23:26:48 +@@ -71,6 +71,8 @@ + #include "util_md5.h" + #include "apr_fnmatch.h" + #include "http_connection.h" ++#include "apr_buf.h" ++#include "util_filter.h" + #include "util_ebcdic.h" + #include "mpm.h" + #ifdef HAVE_NETDB_H +@@ -86,6 +88,10 @@ + #include + #endif + ++/* Make sure we don't write less than 4096 bytes at any one time. ++ */ ++#define MIN_SIZE_TO_WRITE 4096 ++ + /* Allow Apache to use ap_mmap */ + #ifdef USE_MMAP_FILES + #include "apr_mmap.h" +@@ -2872,6 +2878,51 @@ + return OK; + } + ++/* Default filter. This filter should almost always be used. It's only job ++ * is to send the headers if they haven't already been sent, and then send ++ * the actual data. To send the data, we create an iovec out of the bucket ++ * brigade and then call the iol's writev function. On platforms that don't ++ * have writev, we have the problem of creating a lot of potentially small ++ * packets that we are sending to the network. ++ * ++ * This can be solved later by making the buckets buffer everything into a ++ * single memory block that can be written using write (on those systems ++ * without writev only !) ++ */ ++static int core_filter(request_rec *r, ap_filter_t *f, ap_bucket_brigade *b) ++{ ++ ap_ssize_t bytes_sent; ++ ap_bucket_list *dptr; ++ int len = 0; ++ ++ if (!r->headers_sent) { ++ ap_send_http_header_real(r); ++ r->headers_sent = 1; ++ } ++ ++ /* At this point we need to discover if there was any data saved from ++ * the last call to core_filter. ++ */ ++ b = ap_get_saved_data(r, f, &b); ++ ++ /* It is very obvious that we need to make sure it makes sense to send data ++ * out at this point. ++ */ ++ dptr = b->head; ++ while (dptr) { ++ len += ap_get_bucket_len(dptr->bucket); ++ dptr = dptr->next; ++ } ++ if (len < MIN_SIZE_TO_WRITE && b->tail->bucket->color != AP_BUCKET_eos) { ++ ap_save_data_to_filter(r, f, b); ++ return 0; ++ } ++ else { ++ ap_bucket_brigade_to_iol(&bytes_sent, b, r->connection->client->iol); ++ return bytes_sent; ++ } ++} ++ + static const handler_rec core_handlers[] = { + { "*/*", default_handler }, + { "default-handler", default_handler }, +@@ -2894,6 +2945,11 @@ + static unsigned short core_port(const request_rec *r) + { return DEFAULT_HTTP_PORT; } + ++static void core_register_filter(request_rec *r) ++{ ++ ap_hook_filter(core_filter, r, NULL, NULL, AP_HOOK_TRANSPORT_LAST); ++} ++ + static void register_hooks(void) + { + ap_hook_post_config(core_post_config,NULL,NULL,AP_HOOK_REALLY_FIRST); +@@ -2906,6 +2962,8 @@ + /* FIXME: I suspect we can eliminate the need for these - Ben */ + ap_hook_type_checker(do_nothing,NULL,NULL,AP_HOOK_REALLY_LAST); + ap_hook_access_checker(do_nothing,NULL,NULL,AP_HOOK_REALLY_LAST); ++ ++ ap_hook_insert_filter(core_register_filter, NULL, NULL, AP_HOOK_MIDDLE); + } + + API_VAR_EXPORT module core_module = { +Index: main/http_protocol.c +=================================================================== +RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v +retrieving revision 1.95 +diff -u -d -b -w -u -r1.95 http_protocol.c +--- main/http_protocol.c 2000/07/11 03:48:18 1.95 ++++ main/http_protocol.c 2000/07/12 23:26:49 +@@ -64,6 +64,8 @@ + */ + + #define CORE_PRIVATE ++#include "apr_buf.h" ++#include "util_filter.h" + #include "ap_config.h" + #include "httpd.h" + #include "http_config.h" +@@ -1720,7 +1722,7 @@ + } + } + +-API_EXPORT(void) ap_send_http_header(request_rec *r) ++API_EXPORT(void) ap_send_http_header_real(request_rec *r) + { + int i; + const long int zero = 0L; +@@ -2443,15 +2445,23 @@ + size_t length) + { + size_t total_bytes_sent = 0; +- int n; +- ap_ssize_t w; +- char *addr; ++ ap_bucket_brigade *bb = NULL; ++ ap_bucket *b = NULL; ++ ap_filter_t *f; ++ ++ /* if you are using the older API's, then Apache will initiate the ++ * filtering for you. ++ */ ++ f = ap_init_filter(r->pool); + + if (length == 0) + return 0; + +- + length += offset; ++/* We can remove all of the MMAP_SEGMENT_SIZE stuff from Apache, because ++ * it is an optimization to be used for sending data. Since we are using ++ * bucket-brigades we need to move this optimization down to the bucket ++ * brigade stuff, but that can wait for a day or two. + while (!r->connection->aborted && offset < length) { + if (length - offset > MMAP_SEGMENT_SIZE) { + n = MMAP_SEGMENT_SIZE; +@@ -2467,76 +2477,142 @@ + total_bytes_sent += w; + offset += w; + } ++ */ + +- SET_BYTES_SENT(r); ++ /* This is far too complex for a final API, but it is an okay ++ * start. To finish this off, we will need a very clean API ++ * that does all of this for us. ++ */ ++ bb = ap_bucket_brigade_create(r->pool); ++ bb->head = bb->tail = ap_bucket_list_create(); ++ ap_bucket_list_init(bb->head); ++ b = ap_bucket_new(AP_BUCKET_mmap); ++ ap_mmap_bucket_insert((ap_bucket_mmap *)b->data, mm); ++ bb->head->bucket = b; ++ total_bytes_sent = ap_pass_brigade(r, f, bb); ++ + return total_bytes_sent; + } + #endif /* USE_MMAP_FILES */ + + API_EXPORT(int) ap_rputc(int c, request_rec *r) + { ++ ap_bucket_brigade *bb = NULL; ++ ap_bucket *b = NULL; ++ ap_ssize_t written; ++ ap_filter_t *f; ++ + if (r->connection->aborted) + return EOF; + +- if (ap_bputc(c, r->connection->client) < 0) { +- check_first_conn_error(r, "rputc", 0); +- return EOF; +- } +- SET_BYTES_SENT(r); ++ /* if you are using the older API's, then Apache will initiate the ++ * filtering for you. ++ */ ++ f = ap_init_filter(r->pool); ++ ++ /* This is far too complex for a final API, but it is an okay ++ * start. To finish this off, we will need a very clean API ++ * that does all of this for us. ++ */ ++ bb = ap_bucket_brigade_create(r->pool); ++ bb->head = bb->tail = ap_bucket_list_create(); ++ ap_bucket_list_init(bb->head); ++ b = ap_bucket_new(AP_BUCKET_rwmem); ++ ap_rwmem_write(b->data, &c, 1, &written); ++ bb->head->bucket = b; ++ ap_pass_brigade(r, f, bb); ++ + return c; + } + + API_EXPORT(int) ap_rputs(const char *str, request_rec *r) + { +- int rcode; ++ ap_bucket_brigade *bb = NULL; ++ ap_bucket *b = NULL; ++ ap_ssize_t written; ++ ap_filter_t *f; + + if (r->connection->aborted) + return EOF; + +- rcode = ap_bputs(str, r->connection->client); +- if (rcode < 0) { +- check_first_conn_error(r, "rputs", 0); +- return EOF; +- } +- SET_BYTES_SENT(r); +- return rcode; ++ /* if you are using the older API's, then Apache will initiate the ++ * filtering for you. ++ */ ++ f = ap_init_filter(r->pool); ++ ++ /* This is far too complex for a final API, but it is an okay ++ * start. To finish this off, we will need a very clean API ++ * that does all of this for us. ++ */ ++ bb = ap_bucket_brigade_create(r->pool); ++ bb->head = bb->tail = ap_bucket_list_create(); ++ ap_bucket_list_init(bb->head); ++ b = ap_bucket_new(AP_BUCKET_rwmem); ++ ap_rwmem_write(b->data, str, strlen(str), &written); ++ bb->head->bucket = b; ++ ap_pass_brigade(r, f, bb); ++ ++ return written; + } + + API_EXPORT(int) ap_rwrite(const void *buf, int nbyte, request_rec *r) + { +- ap_ssize_t n; +- ap_status_t rv; ++ ap_bucket_brigade *bb = NULL; ++ ap_bucket *b = NULL; ++ ap_ssize_t written; ++ ap_filter_t *f; + + if (r->connection->aborted) + return EOF; + +- /* ### should loop to avoid partial writes */ +- rv = ap_bwrite(r->connection->client, buf, nbyte, &n); +- if (rv != APR_SUCCESS) { +- check_first_conn_error(r, "rwrite", rv); +- return EOF; +- } +- SET_BYTES_SENT(r); +- return n; ++ /* if you are using the older API's, then Apache will initiate the ++ * filtering for you. ++ */ ++ f = ap_init_filter(r->pool); ++ ++ /* This is far too complex for a final API, but it is an okay ++ * start. To finish this off, we will need a very clean API ++ * that does all of this for us. ++ */ ++ bb = ap_bucket_brigade_create(r->pool); ++ bb->head = bb->tail = ap_bucket_list_create(); ++ ap_bucket_list_init(bb->head); ++ b = ap_bucket_new(AP_BUCKET_rwmem); ++ ap_rwmem_write(b->data, buf, nbyte, &written); ++ bb->head->bucket = b; ++ ap_pass_brigade(r, f, bb); ++ return written; + } + + API_EXPORT(int) ap_vrprintf(request_rec *r, const char *fmt, va_list va) + { +- int n; ++ ap_bucket_brigade *bb = NULL; ++ ap_ssize_t written; ++ ap_filter_t *f; + + if (r->connection->aborted) + return EOF; + +- n = ap_vbprintf(r->connection->client, fmt, va); ++ /* if you are using the older API's, then Apache will initiate the ++ * filtering for you. ++ */ ++ f = ap_init_filter(r->pool); + +- if (n < 0) { +- check_first_conn_error(r, "vrprintf", 0); +- return EOF; +- } +- SET_BYTES_SENT(r); +- return n; ++ /* This is far too complex for a final API, but it is an okay ++ * start. To finish this off, we will need a very clean API ++ * that does all of this for us. ++ */ ++ bb = ap_bucket_brigade_create(r->pool); ++ bb->head = bb->tail = ap_bucket_list_create(); ++ ap_bucket_list_init(bb->head); ++ written = ap_brigade_vprintf(bb, fmt, va); ++ ap_pass_brigade(r, f, bb); ++ return written; + } + ++/* TODO: Make ap pa_bucket_vprintf that printfs directly into a ++ * bucket. ++ */ + API_EXPORT_NONSTD(int) ap_rprintf(request_rec *r, const char *fmt, ...) + { + va_list va; +@@ -2546,46 +2622,62 @@ + return EOF; + + va_start(va, fmt); +- n = ap_vbprintf(r->connection->client, fmt, va); ++ n = ap_vrprintf(r, fmt, va); + va_end(va); + +- if (n < 0) { +- check_first_conn_error(r, "rprintf", 0); +- return EOF; +- } +- SET_BYTES_SENT(r); + return n; + } + + API_EXPORT_NONSTD(int) ap_rvputs(request_rec *r, ...) + { ++ ap_bucket_brigade *bb = NULL; ++ ap_ssize_t written; ++ ap_filter_t *f; + va_list va; +- int n; + + if (r->connection->aborted) + return EOF; + ++ /* if you are using the older API's, then Apache will initiate the ++ * filtering for you. ++ */ ++ f = ap_init_filter(r->pool); ++ ++ /* This is far too complex for a final API, but it is an okay ++ * start. To finish this off, we will need a very clean API ++ * that does all of this for us. ++ */ ++ bb = ap_bucket_brigade_create(r->pool); ++ bb->head = bb->tail = ap_bucket_list_create(); ++ ap_bucket_list_init(bb->head); + va_start(va, r); +- n = ap_vbputstrs(r->connection->client, va); ++ written = ap_brigade_vputstrs(bb, va); + va_end(va); +- +- if (n < 0) { +- check_first_conn_error(r, "rvputs", 0); +- return EOF; +- } +- +- SET_BYTES_SENT(r); +- return n; ++ ap_pass_brigade(r, f, bb); ++ return written; + } + + API_EXPORT(int) ap_rflush(request_rec *r) + { +- ap_status_t rv; ++ ap_bucket_brigade *bb; ++ ap_bucket *b; ++ ap_filter_t *f; + +- if ((rv = ap_bflush(r->connection->client)) != APR_SUCCESS) { +- check_first_conn_error(r, "rflush", rv); +- return EOF; +- } ++ /* if you are using the older API's, then Apache will initiate the ++ * filtering for you. ++ */ ++ f = ap_init_filter(r->pool); ++ ++ /* This is far too complex for a final API, but it is an okay ++ * start. To finish this off, we will need a very clean API ++ * that does all of this for us. ++ */ ++ bb = ap_bucket_brigade_create(r->pool); ++ bb->head = bb->tail = ap_bucket_list_create(); ++ ap_bucket_list_init(bb->head); ++ b = ap_bucket_new(AP_BUCKET_eos); ++ bb->head->bucket = b; ++ ap_pass_brigade(r, f, bb); + return 0; + } + +Index: main/http_request.c +=================================================================== +RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v +retrieving revision 1.35 +diff -u -d -b -w -u -r1.35 http_request.c +--- main/http_request.c 2000/06/24 17:33:57 1.35 ++++ main/http_request.c 2000/07/12 23:26:49 +@@ -1263,6 +1263,12 @@ + return; + } + ++ /* We need to flush the data out at this point. We probably only want to ++ * do this on the main request, but this is fine for an initial patch. ++ * Once we look into this more, we won't flush sub-requests. ++ */ ++ ap_rflush(r); ++ + /* Take care of little things that need to happen when we're done */ + ap_finalize_request_protocol(r); + } +Index: modules/mpm/config.m4 +=================================================================== +RCS file: /home/cvs/apache-2.0/src/modules/mpm/config.m4,v +retrieving revision 1.23 +diff -u -d -b -w -u -r1.23 config.m4 +--- modules/mpm/config.m4 2000/07/11 19:00:16 1.23 ++++ modules/mpm/config.m4 2000/07/12 23:26:51 +@@ -3,7 +3,6 @@ + [ --with-mpm=MPM Choose the process model for Apache to use. + MPM={dexter,mpmt_beos,mpmt_pthread,prefork,spmt_os2}],[ + APACHE_MPM=$withval +- mpm_explicit="yes" + ],[ + APACHE_MPM=mpmt_pthread + PLAT=`$ac_config_guess` +@@ -14,7 +13,6 @@ + *os2_emx*) + APACHE_MPM=spmt_os2;; + esac +- mpm_explicit="no" + ]) + AC_MSG_RESULT($APACHE_MPM) + +@@ -41,10 +39,11 @@ + MPM_DIR=modules/mpm/$MPM_NAME + MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la + +-if test "$mpm_explicit" = "no"; then + if test "$MPM_NAME" = "prefork" ; then + MPM_NAME="prefork" + MPM_FAKE_NAME=prefork.c ++ ln -s mpmt.c modules/mpm/mpmt/prefork.c ++ + EXTRA_CFLAGS="$EXTRA_CFLAGS -DPREFORK" + + ac_cv_enable_threads="no" +@@ -78,7 +77,6 @@ + MPM_DIR=modules/mpm/$MPM_NAME + MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la + fi +-fi + + APACHE_SUBST(MPM_NAME) + APACHE_SUBST(MPM_FAKE_NAME) diff --git a/buckets/util_filter.c b/buckets/util_filter.c new file mode 100644 index 00000000000..177617854ba --- /dev/null +++ b/buckets/util_filter.c @@ -0,0 +1,140 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + +#include "httpd.h" +#include "util_filter.h" + +API_EXPORT(ap_filter_t *) ap_init_filter(ap_pool_t *p) +{ + ap_filter_t *f = ap_pcalloc(p, sizeof(f)); + return f; +} + +API_EXPORT(int) ap_pass_brigade(request_rec *r, ap_filter_t *next, + ap_bucket_brigade *buf) +{ + int rv; + LINK_filter *hook; + + if (next->current_filter > r->filters->nelts) { + return AP_ENOBODY_WROTE; + } + + hook = (LINK_filter *)r->filters->elts; + rv = hook[next->current_filter++].pFunc(r, next, buf); + next->current_filter--; + return rv; +} + +API_EXPORT(void) ap_save_data_to_filter(request_rec *r, ap_filter_t *next, + ap_bucket_brigade *data) +{ + LINK_filter *hook; + + hook = ((LINK_filter *)r->filters->elts); + + if (hook->filter_data) { + ap_bucket_brigade_catenate(hook->filter_data, data); + } + else { + hook->filter_data = data; + } +} + +API_EXPORT(ap_bucket_brigade *) ap_get_saved_data(request_rec *r, + ap_filter_t *next, + ap_bucket_brigade **data) +{ + LINK_filter *hook; + + hook = ((LINK_filter *)r->filters->elts); + + if (hook->filter_data) { + ap_bucket_brigade_catenate(hook->filter_data, *data); + *data = hook->filter_data; + } + hook->filter_data = NULL; + return *data; +} + +API_EXPORT(void) ap_hook_filter(HOOK_filter *pf, request_rec *r, + const char * const *aszPre, + const char * const *aszSucc, int nOrder) +{ + LINK_filter *hook; + + if(!r->filters) { + r->filters=ap_make_array(ap_global_hook_pool,1,sizeof(LINK_filter)); + ap_hook_sort_register("filter",&r->filters); + } + + hook = (LINK_filter *)r->filters->elts; + + hook=ap_push_array(r->filters); + hook->pFunc=pf; + hook->aszPredecessors=aszPre; + hook->aszSuccessors=aszSucc; + hook->nOrder=nOrder; + hook->szName=ap_debug_module_name; + hook->filter_data = ap_bucket_brigade_create(r->pool); + if(ap_debug_module_hooks) { + ap_show_hook("filter",aszPre,aszSucc); + } +} + + diff --git a/buckets/util_filter.h b/buckets/util_filter.h new file mode 100644 index 00000000000..4921c3ca4d6 --- /dev/null +++ b/buckets/util_filter.h @@ -0,0 +1,115 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APACHE_FILTER_H +#define APACHE_FILTER_H + +#include "ap_config.h" + +/* For ap_array_header_t */ +#include "apr_lib.h" +#include "httpd.h" +#include "apr_buf.h" +#include "ap_hooks.h" /* For the hooks ordering stuff */ + +typedef struct ap_filter_t { + int current_filter; +} ap_filter_t; + +typedef int HOOK_filter(request_rec *r, ap_filter_t *next, ap_bucket_brigade *buckets); + +typedef struct _LINK_filter { + HOOK_filter *pFunc; + const char *szName; + const char * const *aszPredecessors; + const char * const *aszSuccessors; + int nOrder; + ap_bucket_brigade *filter_data; +} LINK_filter; + +#define AP_HOOK_FILTER 0 /* content-filter/munger/processor */ +#define AP_HOOK_ENCODING 10 /* content-encoding */ +#define AP_HOOK_PROCESSOR 20 /* digest/message processor */ +#define AP_HOOK_TRANSPORT 30 /* transport-encoding */ + +/* This is usually the core filter. This ensures that there is always a + * filter that can/will write out to the network. If some other module + * wants to actually do the writing, they just insert themselves before + * this filter. This is just like the default handler in 1.3. If no other + * handler took care of the request, then the default took it. Same thing, if + * no other Transport filter writes this to the network, then the default + * (core) filter will be used. + */ +#define AP_HOOK_TRANSPORT_LAST 40 + +/* If we go past the end of the filter stack, we have a big problem. */ +#define AP_ENOBODY_WROTE (-1) + + +API_EXPORT(ap_filter_t *) ap_init_filter(ap_pool_t *p); + +API_EXPORT(void) ap_hook_filter(HOOK_filter *pf, request_rec *r, + const char * const *aszPre, + const char * const *aszSucc, int nOrder); + +API_EXPORT(int) ap_pass_brigade(request_rec *r, ap_filter_t *next, + ap_bucket_brigade *bucket); +API_EXPORT(void) ap_save_data_to_filter(request_rec *r, ap_filter_t *next, + ap_bucket_brigade *data); + +API_EXPORT(ap_bucket_brigade *) ap_get_saved_data(request_rec *r, + ap_filter_t *next, + ap_bucket_brigade **data); + +#endif /* ndef(AP_FILTER_H) */ From 398cf292ba1a44bd87cf4d529ec1f5a607211cfe Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 03:41:05 +0000 Subject: [PATCH 0369/7878] Back-out premature config changes for buckets. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60344 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/Makefile.in | 82 --------------------------------------------- configure.in | 4 +-- 2 files changed, 2 insertions(+), 84 deletions(-) delete mode 100644 buckets/Makefile.in diff --git a/buckets/Makefile.in b/buckets/Makefile.in deleted file mode 100644 index c8a015e0da0..00000000000 --- a/buckets/Makefile.in +++ /dev/null @@ -1,82 +0,0 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../include -INCLUDES=-I$(INCDIR) -I. - -#LIB=libfile.a - -OBJS=ap_buf.o \ - ap_rwmem_buf.o \ - ap_mmap_buf.o \ - ap_rmem_buf.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(OBJS) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - - -#$(LIB): $(OBJS) -# $(RM) -f $@ -# $(AR) cr $@ $(OBJS) -# $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# -depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new - -# DO NOT REMOVE -ap_buf.o: ap_buf.c $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_buf.h $(INCDIR)/apr_mmap.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ - $(INCDIR)/../../../include/ap_iol.h -ap_mmap_buf.o: ap_mmap_buf.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_buf.h $(INCDIR)/apr_mmap.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ - $(INCDIR)/../../../include/ap_iol.h -ap_rmem_buf.o: ap_rmem_buf.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_buf.h $(INCDIR)/apr_mmap.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ - $(INCDIR)/../../../include/ap_iol.h -ap_rwmem_buf.o: ap_rwmem_buf.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_buf.h $(INCDIR)/apr_mmap.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ - $(INCDIR)/../../../include/ap_iol.h diff --git a/configure.in b/configure.in index 051a3bf6a26..cafa5bb1d34 100644 --- a/configure.in +++ b/configure.in @@ -678,8 +678,8 @@ AC_SUBST(LIBPREFIX) AC_SUBST(EXEEXT) echo "Construct Makefiles and header files." -MAKEFILE1="Makefile lib/Makefile buckets/Makefile" -SUBDIRS="lib buckets" +MAKEFILE1="Makefile lib/Makefile " +SUBDIRS="lib " for dir in $MODULES do test -d $dir || $MKDIR -p $dir From 9c11468223fbeb7013e5e75c084a6abb471dd49f Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 03:48:29 +0000 Subject: [PATCH 0370/7878] Move apr_buf.h to buckets directory until fleshed-out. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60345 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_buf.h | 247 ---------------------------------------------- 1 file changed, 247 deletions(-) delete mode 100644 include/apr_buf.h diff --git a/include/apr_buf.h b/include/apr_buf.h deleted file mode 100644 index 2301465723f..00000000000 --- a/include/apr_buf.h +++ /dev/null @@ -1,247 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef AP_BUF_H -#define AP_BUF_H - -#include "apr_mmap.h" -#include "apr_errno.h" -#include "../../../include/ap_iol.h" -#include "apr_private.h" -#ifdef HAVE_SYS_UIO_H -#include /* for struct iovec */ -#endif -#ifdef HAVE_STDARG_H -#include -#endif - -typedef enum { - AP_BUCKET_rwmem, - AP_BUCKET_rmem, - AP_BUCKET_file, - AP_BUCKET_mmap, - AP_BUCKET_filename, - AP_BUCKET_cached_entity, - AP_BUCKET_URI, - AP_BUCKET_eos /* End-of-stream bucket. Special case to say this is - * the end of the bucket so all data should be sent - * immediately. */ -} ap_bucket_color_e; - -typedef struct ap_bucket ap_bucket; -struct ap_bucket { - ap_bucket_color_e color; /* what type of bucket is it */ - void (*free)(void *e); /* never NULL */ - void *data; /* for use by free() */ -}; - -typedef struct ap_bucket_list ap_bucket_list; -struct ap_bucket_list { - ap_bucket *bucket; /* The bucket */ - ap_bucket_list *next; /* The start of the bucket list */ - ap_bucket_list *prev; /* The end of the bucket list */ -}; - -typedef struct ap_bucket_brigade ap_bucket_brigade; -struct ap_bucket_brigade { - ap_pool_t *p; /* The pool to associate this with. - I do not allocate out of the pool, - but this lets me register a cleanup - to put a limit on the brigade's - lifetime. */ - ap_bucket_list *head; /* The start of the brigade */ - ap_bucket_list *tail; /* The end of the brigade */ -}; - -/* ****** Bucket Brigade Functions ***** */ - -/* Create a new bucket brigade */ -APR_EXPORT(ap_bucket_brigade *) ap_bucket_brigade_create(ap_pool_t *p); - -/* destroy an enitre bucket brigade */ -APR_EXPORT(ap_status_t) ap_bucket_brigade_destroy(void *b); - -/* append a bucket_brigade to a bucket_brigade */ -APR_EXPORT(void) ap_bucket_brigade_append(ap_bucket_brigade *b, - ap_bucket_list *e); - -/* consume nbytes from beginning of b -- call ap_bucket_destroy as - appropriate, and/or modify start on last element */ -APR_EXPORT(void) ap_bucket_brigade_consume(ap_bucket_brigade *, int nbytes); - -/* create an iovec of the elements in a bucket_brigade... return number - of elements used */ -APR_EXPORT(int) ap_bucket_brigade_to_iovec(ap_bucket_brigade *, - struct iovec *vec, int nvec); - -/* catenate bucket_brigade b onto bucket_brigade a, bucket_brigade b is - empty after this */ -APR_EXPORT(void) ap_bucket_brigade_catenate(ap_bucket_brigade *a, - ap_bucket_brigade *b); - -/* Destroy the first nvec buckets. */ -APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec); - -/* save the buf out to the specified iol. This can be used to flush the - data to the disk, or to send it out to the network. */ -APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, - ap_bucket_brigade *a, - ap_iol *iol); - -APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va); - -APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...); - -APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_list va); - -/* ****** Bucket List Functions ***** */ - -/* create a new bucket_list */ -APR_EXPORT(ap_bucket_list *) ap_bucket_list_create(void); - -/* initialize a bucket_list */ -APR_EXPORT(void) ap_bucket_list_init(ap_bucket_list *b); - -/* destroy an entire bucket_list */ -APR_EXPORT(ap_status_t) ap_destroy_bucket_list(ap_bucket_list *b); - -/* ****** Bucket Functions ***** */ - -/* allocate a bucket of type color */ -APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color); - -/* destroy a bucket */ -APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e); - -/* Convert a bucket to a char * */ -APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b); - -/* get the length of the data in the bucket */ -APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b); - -/* ****** RWMEM Functions ***** */ - -typedef struct ap_bucket_rwmem ap_bucket_rwmem; -struct ap_bucket_rwmem { - void *alloc_addr; /* Where does the data start */ - size_t alloc_len; /* how much was allocated */ - void *start; /* Where does the actual data start - in the alloc'ed block */ - void *end; /* where does the data actually end? */ -}; - -/* Create a read/write memory bucket */ -APR_EXPORT(ap_bucket_rwmem *) ap_rwmem_create(void); - -/* destroy a read/write memory bucket */ -APR_EXPORT(void) ap_rwmem_destroy(void *e); - -/* Convert a rwmem bucket into a char * */ -APR_EXPORT(char *) ap_rwmem_get_char_str(ap_bucket_rwmem *b); - -/* get the length of the data in the rwmem bucket */ -APR_EXPORT(int) ap_rwmem_get_len(ap_bucket_rwmem *b); - -APR_EXPORT(int) ap_rwmem_write(ap_bucket_rwmem *b, const void *buf, - ap_size_t nbyte, ap_ssize_t *bytes_written); - -APR_EXPORT(int) ap_rwmem_vputstrs(ap_bucket_rwmem *b, va_list va); - -/* ****** MMAP Functions ***** */ - -typedef struct ap_bucket_mmap ap_bucket_mmap; -struct ap_bucket_mmap { - ap_mmap_t *data; -}; - -/* Create a mmap memory bucket */ -APR_EXPORT(ap_bucket_mmap *) ap_mmap_bucket_create(void); - -/* Convert a mmap bucket into a char * */ -APR_EXPORT(char *) ap_mmap_get_char_str(ap_bucket_mmap *b); - -/* get the length of the data in the mmap bucket */ -APR_EXPORT(int) ap_mmap_get_len(ap_bucket_mmap *b); - -APR_EXPORT(void) ap_mmap_bucket_insert(ap_bucket_mmap *b, ap_mmap_t *mm); - -/* ****** RMEM Functions ***** */ - -typedef struct ap_bucket_rmem ap_bucket_rmem; -struct ap_bucket_rmem { - size_t alloc_len; /* how much was allocated */ - const void *start; /* Where does the actual data start - in the alloc'ed block */ - const void *end; /* where does the data actually end? */ -}; - -/* Create a read only memory bucket */ -APR_EXPORT(ap_bucket_rmem *) ap_rmem_create(void); - -/* destroy a read only memory bucket */ -APR_EXPORT(void) ap_rmem_destroy(void *e); - -/* Convert a read only bucket into a char * */ -APR_EXPORT(const char *) ap_rmem_get_char_str(ap_bucket_rmem *b); - -/* get the length of the data in the rmem bucket */ -APR_EXPORT(int) ap_rmem_get_len(ap_bucket_rmem *b); - -APR_EXPORT(int) ap_rmem_write(ap_bucket_rmem *b, const void *buf, - ap_size_t nbyte, ap_ssize_t *bytes_written); - -APR_EXPORT(int) ap_rmem_vputstrs(ap_bucket_rmem *b, va_list va); - -#endif - From 99817813400924b6d1c528b65c8638e9fd471d80 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 03:54:13 +0000 Subject: [PATCH 0371/7878] Provide a map for the reviewers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60346 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/README.txt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 buckets/README.txt diff --git a/buckets/README.txt b/buckets/README.txt new file mode 100644 index 00000000000..9e69582c716 --- /dev/null +++ b/buckets/README.txt @@ -0,0 +1,30 @@ + +This directory contains several prototype implementations of +layered IO with filtering. None of these will be distributed +as part of the server until we agree on a solution. + +Design Rationale +---------------- + + [Roy is collecting these from his mail archives] + layered-IO-1998.txt + bucket_brigades.txt + +Bachelor #1 +----------- + + apr_buf.h + ap_buf.c + ap_mmap_buf.c + ap_rwmem_buf.c + util_filter.h + util_filter.c + ryan.patch + +Bachelor #2 +----------- + + ap_filter.h + filters.c + greg_patch.txt + From 4db51c6e98676245befcbfc152a473f8744443e1 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 05:00:03 +0000 Subject: [PATCH 0372/7878] Alexei's summary of the 1998 design meeting in San Francisco. Submitted by: Alexei Kosut git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60347 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/doc_SFmtg.txt | 172 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 buckets/doc_SFmtg.txt diff --git a/buckets/doc_SFmtg.txt b/buckets/doc_SFmtg.txt new file mode 100644 index 00000000000..bf2fed23cc6 --- /dev/null +++ b/buckets/doc_SFmtg.txt @@ -0,0 +1,172 @@ + +From akosut@leland.Stanford.EDU Thu Jul 23 09:38:40 1998 +Date: Sun, 19 Jul 1998 00:12:37 -0700 (PDT) +From: Alexei Kosut +To: new-httpd@apache.org +Subject: Apache 2.0 - an overview + +For those not at the Apache meeting in SF, and even for those who were, +here's a quick overview of (my understanding of) the Apache 2.0 +architecture that we came up with. I present this to make sure that I have +it right, and to get opinions from the rest of the group. Enjoy. + + +1. "Well, if we haven't released 2.0 by Christmas of 1999, it won't + matter anyway." + +A couple of notes about this plan: I'm looking at this right now from a +design standpoint, not an implementation one. If the plan herein were +actually coded as-is, you'd get a very inefficient web server. But as +Donald Knuth (Professor emeritus at Stanford, btw... :) points out, +"premature optimization is the root of all evil." Rest assured there are +plenty of ways to make sure Apache 2.0 is much faster than Apache 1.3. +Taking out all the "slowness" code, for example... :) + +Also, the main ideas in this document mainly come from Dean Gaudet, Simon +Spero, Cliff Skolnick and a bunch of other people, from the Apache Group's +meeting in San Francisco, July 2 and 3, 1998. The other ideas come from +other people. I'm being vague because I can't quite remember. We should +have videotaped it. I've titled the sections of this document with quotes +from our meeting, but they are paraphrased from memory, so don't take them +too seriously. + +2. "But Simon, how can you have a *middle* end?" + +One of the main goals of Apache 2.0 is protocol independence (i.e., +serving HTTP/1.1, HTTP-NG, and maybe FTP or gopher or something). Another +is to rid the server of the belief that everything is a file. Towards this +end, we divide the server up into three parts, the front end, the middle +end, and the back end. + +The front end is essentially a combination of http_main and http_protocol +today. It takes care of all network and protocol matters, interpreting the +request, putting it into a protocol-neutral form, and (possibly) passing +it off to the rest of the server. This is approximately equivalent to the +part of Apache contained in Dean's flow stuff, and it also works very well +in certain non-Unix-like architectures such as clustered mainframes. In +addition, part of this front-end might be optionally run in kernel space, +giving a very fast server indeed... + +The back end is what generates the content. At the back of the back end we +have backing stores (Cliff's term), which contain actual data. These might +represent files on a disk, entries in a database, CGI scripts, etc... The +back end also consists of other modules, which can alter the request in +various fashions. The objects the server acts on can be thought of (Cliff +again) as a filehandle and a set of key/value pairs (metainformation). +The modules are set up as filters that can alter either one of those, +stacking I/O routines onto the stream of data, or altering the +metainformation. + +The middle end is what comes between the front and back ends. Think of +http_request. This section takes care of arranging the modules, backing +stores, etc... into a manner so that the path of the request will result +in the correct entity being delivered to the front end and sent to the +client. + +3. "I won't embarrass you guys with the numbers for how well Apache + performs compared to IIS." (on NT) + +For a server that was designed to handle flat files, Apache does it +surprisingly poorly, compared with other servers that have been optimized +for it. And the performance for non-static files is, of course, worse. +While Apache is still more than fast enough for 95% of Web servers, we'd +be remiss to dismiss those other 5% (they're the fun ones anyway). Another +problem Apache has is its lack of a good, caching, proxy module. + +Put these together, along with the work Dean has done with the flow and +mod_mmap_static stuff, and we realize the most important part of Apache +2.0: a built-in, all-pervasive, cache. Every part of the request process +will involve caching. In the path outlined above, between each layer of +the request, between each module, sits the cache, which can (when it is +useful), cache the response and its metainformation - including its +variance, so it knows when it is safe to give out the cached copy. This +gives every opportunity to increase the speed of the server by making sure +it never has to dynamically create content more than it needs to, and +renders accelerators such as Squid unnecessary. + +This also allows what I alluded to earlier: a kernel (or near-to-kernel) +based web server component, which could read the request, consult the +cache to find the requested object, and spit it back out, without so much +as an interrupt in the way. Of course, the rest of Apache (with all its +modules - it's generally a bad idea to let unknown, untrusted code, insert +itself into the kernel) sits up in user-space, ready to handle any request +the micro-Apache can't. + +A built-in cache also makes a real working HTTP/1.1 proxy server trivially +easy to write. + +4. "Stop asking about backwards compatibility with the API. We'll write a + compatibility module... later." + +If modules are as described above, then obviously they are very much +distinct from how Apache's current modules function. The only module +function that is similar to the current model is the handler, or backing +store, that actually provides the basic stream of data that the server +alters to product a response entity. + +The basic module's approach to its job is to stack a filter onto the +output. But it's better to think of the modules not as a stack that the +request flows through (a layer cake with cache icing between the layers), +but more of a mosaic (pretend I didn't use that word. I wrote collage. You +can't prove anything), with modules stuck onto various sides of the +request at different points, altering the request/response. + +Today's Apache modules take an all-or-nothing approach to request +handlers. They tell Apache what they can do, overestimating, and then are +supposed to DECLINE if they don't pass a number of checks they are +supposed to make. Most modules don't do this correctly. The better +approach is to allow the modules to inform Apache exactly of what they can +do, and have Apache (the middle-end) take care of invoking them when +appropriate. + +The final goal of all of this, of course, is simply to allow CGI output to +be parsed for server-side includes. But don't tell Dean that. + +5. "Will Apache run without any of the normal Unix binaries installed, + only the BSD/POSIX libraries?" + +Another major issue is, of course, configuration of the server. There are +a number of distinct opinions on this, both as to what should be +configured and how it should be done. We talked mainly about the latter, +but the did touch on the former. Obviously, with a radically distinct +module API, the configuration is radically different. We need a good way +to specify how the modules are supposed to interact, and of controlling +what they can do, when and how, balancing what the user asks the server to +do, and what the module (author) wants the server to do. We didn't really +come up with a good answer to this. + +However, we did make some progress on the other side of the issue: We +agreed that the current configuration system is definitely taking the +right approach. Having a well-defined repository of the configuration +scheme, containing the possible directives, when they are applicable, what +their parameters are, etc... is the right way to go. We agreed that more +information and stronger-typing (no RAW_ARGS!) would be good, and may +enable on-the-fly generated configuration managers. + +We agreed that such a program, probably external to Apache, would generate +a configuration and pass it to Apache, either via a standard config file, +or by calling Apache API functions. It is desirable to be able to go the +other way, pulling current configuration from Apache to look at, and +perhaps change it on the fly, but unfortunately is unlikely this +information would always be available; modules may perform optimizations +on their configuration that makes the original configuration unavailable. + +For the language and specification of the configuration, we thought +perhaps XML might be a good approach, and agreed it should be looked +into. Other issues, such as SNMP, were brought up and laughed at. + +6. "So you're saying that the OS that controls half the banks, and 90% of + the airlines, doesn't even have memory protection for seperate + processes?" + +Obviously, there are a lot more items that have to be part of Apache 2.0, +and we talked about a number of them. However, the four points above, I +think, represent the core of the architecture we agreed on as a starting +point. + +-- Alexei Kosut + Stanford University, Class of 2001 * Apache * + + + + From 4f82797ba44a3a9d2dd7b57a0dcda1427209db39 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 05:03:41 +0000 Subject: [PATCH 0373/7878] Wishes for Layered-IO (Use Cases) Submitted by: Dirk-Willem van Gulik git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60348 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/doc_wishes.txt | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 buckets/doc_wishes.txt diff --git a/buckets/doc_wishes.txt b/buckets/doc_wishes.txt new file mode 100644 index 00000000000..a905cbefc2d --- /dev/null +++ b/buckets/doc_wishes.txt @@ -0,0 +1,45 @@ +Wishes -- use cases for layered IO +================================== + +[Feel free to add your own] + +Dirk's original list: +--------------------- + +This file is there so that I do not have to remind myself +about the reasons for Layered IO, apart from the obvious one. + +0. To get away from a 1 to 1 mapping + + i.e. a single URI can cause multiple backend requests, + in arbitrary configurations, such as in paralel, tunnel/piped, + or in some sort of funnel mode. Such multiple backend + requests, with fully layered IO can be treated exactly + like any URI request; and recursion is born :-) + +1. To do on the fly charset conversion + + Be, theoretically, be able to send out your content using + latin1, latin2 or any other charset; generated from static + _and_ dynamic content in other charsets (typically unicode + encoded as UTF7 or UTF8). Such conversion is prompted by + things like the user-agent string, a cookie, or other hints + about the capabilities of the OS, language preferences and + other (in)capabilities of the final receipient. + +2. To be able to do fancy templates + + Have your application/cgi sending out an XML structure of + field/value pair-ed contents; which is substituted into a + template by the web server; possibly based on information + accessible/known to the webserver which you do not want to + be known to the backend script. Ideally that template would + be just as easy to generate by a backend as well (see 0). + +3. On the fly translation + + And other general text and output mungling, such as translating + an english page in spanish whilst it goes through your Proxy, + or JPEG-ing a GIF generated by mod_perl+gd. + +Dw. From e2e3fe1adc072758559b47ba3847d9f22e32edb3 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 05:15:39 +0000 Subject: [PATCH 0374/7878] Early design notes from Ed and Alexei [and Dean] Submitted by: Ed Korthof, Alexei Kosut, Dean Gaudet git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60349 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/doc_stacked_io.txt | 554 +++++++++++++++++++++++++++++++++++++ 1 file changed, 554 insertions(+) create mode 100644 buckets/doc_stacked_io.txt diff --git a/buckets/doc_stacked_io.txt b/buckets/doc_stacked_io.txt new file mode 100644 index 00000000000..8828abb2d2e --- /dev/null +++ b/buckets/doc_stacked_io.txt @@ -0,0 +1,554 @@ +[djg: comments like this are from dean] + +This past summer, Alexei and I wrote a spec for an I/O Filters API... +this proposal addresses one part of that -- 'stacked' I/O with buff.c. + +We have a couple of options for stacked I/O: we can either use existing +code, such as sfio, or we can rewrite buff.c to do it. We've gone over +the first possibility at length, though, and there were problems with each +implemenation which was mentioned (licensing and compatibility, +specifically); so far as I know, those remain issues. + +Btw -- sfio will be supported w/in this model... it just wouldn't be the +basis for the model's implementation. + + -- Ed Korthof | Web Server Engineer -- + -- ed@organic.com | Organic Online, Inc -- + -- (415) 278-5676 | Fax: (415) 284-6891 -- + +--------------------------------------------------------------------------- +Stacked I/O With BUFFs + Sections: + + 1.) Overview + 2.) The API + User-supplied structures + API functions + 3.) Detailed Description + The bfilter structure + The bbottomfilter structure + The BUFF structure + Public functions in buff.c + 4.) Efficiency Considerations + Buffering + Memory copies + Function chaining + writev + 5.) Code in buff.c + Default Functions + Heuristics for writev + Writing + Reading + Flushing data + Closing stacks and filters + Flags and Options + +************************************************************************* + Overview + +The intention of this API is to make Apache's BUFF structure modular +while retaining high efficiency. Basically, it involves rewriting +buff.c to provide 'stacked' I/O -- where the data passed through a +series of 'filters', which may modify it. + +There are two parts to this, the core code for BUFF structures, and the +"filters" used to implement new behavior. "filter" is used to refer to +both the sets of 5 functions, as shown in the bfilter structure in the +next section, and to BUFFs which are created using a specific bfliter. +These will also be occasionally refered to as "user-supplied", though +the Apache core will need to use these as well for basic functions. + +The user-supplied functions should use only the public BUFF API, rather +than any internal details or functions. One thing which may not be +clear is that in the core BUFF functions, the BUFF pointer passed in +refers to the BUFF on which the operation will happen. OTOH, in the +user-supplied code, the BUFF passed in is the next buffer down the +chain, not the current one. + +************************************************************************* + The API + + User-supplied structures + +First, the bfilter structure is used in all filters: + typedef struct { + int (*writev)(BUFF *, void *, struct iovect *, int); + int (*read)(BUFF *, void *, char *, int); + int (*write)(BUFF *, void *, const char *, int); + int (*flush)(BUFF *, void *, const char *, int, bfilter *); + int (*transmitfile)(BUFF *, void *, file_info_ptr *); + void (*close)(BUFF *, void *); + } bfilter; + +bfilters are placed into a BUFF structure along with a +user-supplied void * pointer. + +Second, the following structure is for use with a filter which can +sit at the bottom of the stack: + + typedef struct { + void *(*bgetfileinfo)(BUFF *, void *); + void (*bpushfileinfo)(BUFF *, void *, void *); + } bbottomfilter; + + + BUFF API functions + +The following functions are new BUFF API functions: + +For filters: + +BUFF * bcreatestack(pool *p, int flags, struct bfilter *, + struct bbottomfilter *, void *); +BUFF * bpushfilter (BUFF *, struct bfilter *, void *); +BUFF * bpushbuffer (BUFF *, BUFF *); +BUFF * bpopfilter(BUFF *); +BUFF * bpopbuffer(BUFF *); +void bclosestack(BUFF *); + +For BUFFs in general: + +int btransmitfile(BUFF *, file_info_ptr *); +int bsetstackopts(BUFF *, int, const void *); +int bsetstackflags(BUFF *, int, int); + +Note that a new flag is needed for bsetstackflags: +B_MAXBUFFERING + +The current bcreate should become + +BUFF * bcreatebuffer (pool *p, int flags, struct bfilter *, void *); + +************************************************************************* + Detailed Explanation + + bfilter structure + +The void * pointer used in all these functions, as well as those in the +bbottomfilter structure and the filter API functions, is always the same +pointer w/in an individual BUFF. + +The first function in a bfilter structure is 'writev'; this is only +needed for high efficiency writing, generally at the level of the system +interface. In it's absence, multiple writes will be done w/ 'write'. +Note that defining 'writev' means you must define 'write'. + +The second is 'write'; this is the generic writing function, taking a BUFF +* to which to write, a block of text, and the length of that block of +text. The expected return is the number of characters (out of that block +of text) which were successfully processed (rather than the number of +characters actually written). + +The third is 'read'; this is the generic reading function, taking a BUFF * +from which to read data, and a void * buffer in which to put text, and the +number of characters to put in that buffer. The expected return is the +number of characters placed in the buffer. + +The fourth is 'flush'; this is intended to force the buffer to spit out +any data it may have been saving, as well as to clear any data the +BUFF code was storing. If the third argument is non-null, then it +contains more text to be printed; that text need not be null terminated, +but the fourth argument contains the length of text to be processed. The +expected return value should be the number of characters handled out +from the third argument (0 if there are none), or -1 on error. Finally, +the fifth argument is a pointer to the bfilter struct containing this +function, so that it may use the write or writev functions in it. Note +that general buffering is handled by BUFF's internal code, and module +writers should not store data for performance reasons. + +The fifth is 'transmitfile', which takes as its arguments a buffer to +which to write (if non-null), the void * pointer containing configuration +(or other) information for this filter, and a system-dependent pointer +(the file_info_ptr structure will be defined on a per-system basis) +containing information required to print the 'file' in question. +This is intended to allow zero-copy TCP in Win32. + +The sixth is 'close'; this is what is called when the connection is being +closed. The 'close' should not be passed on to the next filter in the +stack. Most filters will not need to use this, but if database handles +or some other object is created, this is the point at which to remove it. +Note that flush is called automatically before this. + + bbottomfilter Structure + +The first function, bgetfileinfo, is designed to allow Apache to get +information from a BUFF struct regarding the input and output sources. +This is currently used to get the input file number to select on a +socket to see if there's data waiting to be read. The information +returned is platform specific; the void * pointer passed in holds +the void * pointer passed to all user-supplied functions. + +The second function, bpushfileinfo, is used to push file information +onto a buffer, so that the buffer can be fully constructed and ready +to handle data as soon as possible after a client has connected. +The first void * pointer holds platform specific information (in +Unix, it would be a pair of file descriptors); the second holds the +void * pointer passed to all user-supplied functions. + +[djg: I don't think I really agree with the distinction here between +the bottom and the other filters. Take the select() example, it's +valid for any layer to define a fd that can be used for select... +in fact it's the topmost layer that should really get to make this +definition. Or maybe I just have your top and bottom flipped. In +any event I think this should be part of the filter structure and +not separate.] + + The BUFF structure + +A couple of changes are needed for this structure: remove fd and +fd_in; add a bfilter structure; add a pointer to a bbottomfilter; +add three pointers to the next BUFFs: one for the next BUFF in the +stack, one for the next BUFF which implements write, and one +for the next BUFF which implements read. + + + Public functions in buff.c + +BUFF * bpushfilter (BUFF *, struct bfilter *, void *); + +This function adds the filter functions from bfilter, stacking them on +top of the BUFF. It returns the new top BUFF, or NULL on error. + +BUFF * bpushbuffer (BUFF *, BUFF *); + +This function places the second buffer on the top of the stack that +the first one is on. It returns the new top BUFF, or NULL on error. + +BUFF * bpopfilter(BUFF *); +BUFF * bpopbuffer(BUFF *); + +Unattaches the top-most filter from the stack, and returns the new +top-level BUFF, or NULL on error or when there are no BUFFs +remaining. The two are synonymous. + +void bclosestack(BUFF *); + +Closes the I/O stack, removing all the filters in it. + +BUFF * bcreatestack(pool *p, int flags, struct bfilter *, + struct bbottomfilter *, void *); + +This creates an I/O stack. It returns NULL on error. + +BUFF * bcreatebuffer(pool *p, int flags, struct bfilter *, void *); + +This creates a BUFF for later use with bpushbuffer. The BUFF is +not set up to be used as an I/O stack, however. It returns NULL +on error. + +int bsetstackopts(BUFF *, int, const void *); +int bsetstackflags(BUFF *, int, int); + +These functions, respectively, set options on all the BUFFs in a +stack. The new flag, B_MAXBUFFERING is used to disable a feature +described in the next section, whereby only the first and last +BUFFs will buffer data. + +************************************************************************* + Efficiency Considerations + + Buffering + +All input and output is buffered by the standard buffering code. +People writing code to use buff.c should not concern themselves with +buffering for efficiency, and should not buffer except when necessary. + +The write function will typically be called with large blocks of text; +the read function will attempt to place the specified number of bytes +into the buffer. + +Dean noted that there are possible problems w/ multiple buffers; +further, some applications must not be buffered. This can be +partially dealt with by turning off buffering, or by flushing the +data when appropriate. + +However, some potential problems arise anyway. The simplest example +involves shrinking transformations; suppose that you have a set +of filters, A, B, and C, such that A outputs less text than it +recieves, as does B (say A strips comments, and B gzips the result). +Then after a write to A which fills the buffer, A writes to B. +However, A won't write enough to fill B's buffer, so a memory copy +will be needed. This continues till B's buffer fills up, then +B will write to C's buffer -- with the same effect. + +[djg: I don't think this is the issue I was really worried about -- +in the case of shrinking transformations you are already doing +non-trivial amounts of CPU activity with the data, and there's +no copying of data that you can eliminate anyway. I do recognize +that there are non-CPU intensive filters -- such as DMA-capable +hardware crypto cards. I don't think they're hard to support in +a zero-copy manner though.] + +The maximum additional number of bytes which will be copied in this +scenario is on the order of nk, where n is the total number of bytes, +and k is the number of filters doing shrinking transformations. + +There are several possible solutions to this issue. The first +is to turn off buffering in all but the first filter and the +last filter. This reduces the number of unnecessary byte copies +to at most one per byte, however it means that the functions in +the stack will get called more frequently; but it is the default +behavior, overridable by setting the B_MAXBUFFERING with +bsetstackflags. Most filters won't involve a net shrinking +transformation, so even this will rarely be an issue; however, +if the filters do involve a net shrinking transformation, for +the sake of network-efficiency (sending reasonably sized blocks), +it may be more efficient anyway. + +A second solution is more general use of writev for communication +between different buffers. This complicates the programing work, +however. + + + Memory copies + +Each write function is passed a pointer to constant text; if any changes +are being made to the text, it must be copied. However, if no changes +are made to the text (or to some smaller part of it), then it may be +sent to the next filter without any additional copying. This should +provide the minimal necessary memory copies. + +[djg: Unfortunately this makes it hard to support page-flipping and +async i/o because you don't have any reference counts on the data. +But I go into a little detail that already in docs/page_io.] + + Function chaining + +In order to avoid unnecessary function chaining for reads and writes, +when a filter is pushed onto the stack, the buff.c code will determine +which is the next BUFF which contains a read or write function, and +reads and writes, respectively, will go directly to that BUFF. + + writev + +writev is a function for efficient writing to the system; in terms of +this API, however, it also works for dealing with multiple blocks of +text without doing unnecessary byte copies. It is not required. + +Currently, the system level writev is used in two contexts: for +chunking and when a block of text is writen which, combined with +the text already in the buffer, would make the buffer overflow. + +writev would be implemented both by the default bottom level filter +and by the chunking filter for these operations. In addition, writev +may, be used, as noted above, to pass multiple blocks of text w/o +copying them into a single buffer. Note that if the next filter does +not implement writev, however, this will be equivalent to repeated +calls to write, which may or may not be more efficient. Up to +IOV_MAX-2 blocks of text may be passed along in this manner. Unlike +the system writev call, the writev in this API should be called only +once, with a array with iovec's and a count as to the number of +iovecs in it. + +If a bfilter defines writev, writev will be called whether or not +NO_WRITEV is set; hence, it should deal with that case in a reasonable +manner. + +[djg: We can't guarantee atomicity of writev() when we emulate it. +Probably not a problem, just an observation.] + +************************************************************************* + Code in buff.c + + Default Functions + +The default actions are generally those currently performed by Apache, +save that they they'll only attempt to write to a buffer, and they'll +return an error if there are no more buffers. That is, you must implement +read, write, and flush in the bottom-most filter. + +Except for close(), the default code will simply pass the function call +on to the next filter in the stack. Some samples follow. + + Heuristics for writev + +Currently, we call writev for chunking, and when we get a enough so that +the total overflows the buffer. Since chunking is going to become a +filter, the chunking filter will use writev; in addition, bwrite will +trigger bwritev as shown (note that system specific information should +be kept at the filter level): + +in bwrite: + + if (fb->outcnt > 0 && nbyte + fb->outcnt >= fb->bufsiz) { + /* build iovec structs */ + struct iovec vec[2]; + vec[0].iov_base = (void *) fb->outbase; + vec[0].iov_len = fb->outcnt; + fb->outcnt = 0; + vec[1].iov_base = (void *)buff; + vec[1].iov_length = nbyte; + return bwritev (fb, vec, 2); + } else if (nbye >= fb->bufsiz) { + return write_with_errors(fb,buff,nbyte); + } + +Note that the code above takes the place of large_write (as well +as taking code from it). + +So, bwritev would look something like this (copying and pasting freely +from the current source for writev_it_all, which could be replaced): + +----- +int bwritev (BUFF * fb, struct iovec * vec, int nvecs) { + if (!fb) + return -1; /* the bottom level filter implemented neither write nor + * writev. */ + if (fb->bfilter.bwritev) { + return bf->bfilter.writev(fb->next, vec, nvecs); + } else if (fb->bfilter.write) { + /* while it's nice an easy to build the vector and crud, it's painful + * to deal with partial writes (esp. w/ the vector) + */ + int i = 0,rv; + while (i < nvecs) { + do { + rv = fb->bfilter.write(fb, vec[i].iov_base, vec[i].iov_len); + } while (rv == -1 && (errno == EINTR || errno == EAGAIN) + && !(fb->flags & B_EOUT)); + if (rv == -1) { + if (errno != EINTR && errno != EAGAIN) { + doerror (fb, B_WR); + } + return -1; + } + fb->bytes_sent += rv; + /* recalculate vec to deal with partial writes */ + while (rv > 0) { + if (rv < vec[i].iov_len) { + vec[i].iov_base = (char *)vec[i].iov_base + rv; + vec[i].iov_len -= rv; + rv = 0; + if (vec[i].iov_len == 0) { + ++i; + } + } else { + rv -= vec[i].iov_len; + ++i; + } + } + if (fb->flags & B_EOUT) + return -1; + } + /* if we got here, we wrote it all */ + return 0; + } else { + return bwritev(fb->next,vec,nvecs); + } +} +----- +The default filter's writev function will pretty much like +writev_it_all. + + + Writing + +The general case for writing data is significantly simpler with this +model. Because special cases are not dealt with in the BUFF core, +a single internal interface to writing data is possible; I'm going +to assume it's reasonable to standardize on write_with_errors, but +some other function may be more appropriate. + +In the revised bwrite (which I'll ommit for brievity), the following +must be done: + check for error conditions + check to see if any buffering is done; if not, send the data + directly to the write_with_errors function + check to see if we should use writev or write_with_errors + as above + copy the data to the buffer (we know it fits since we didn't + need writev or write_with_errors) + +The other work the current bwrite is doing is + ifdef'ing around NO_WRITEV + numerous decisions regarding whether or not to send chunks + +Generally, buff.c has a number of functions whose entire purpose is +to handle particular special cases wrt chunking, all of which could +be simplified with a chunking filter. + +write_with_errors would not need to change; buff_write would. Here +is a new version of it: + +----- +/* the lowest level writing primitive */ +static ap_inline int buff_write(BUFF *fb, const void *buf, int nbyte) +{ + if (fb->bfilter.write) + return fb->bfilter.write(fb->next_writer,buff,nbyte); + else + return bwrite(fb->next_writer,buff,nbyte); +} +----- + +If the btransmitfile function is called on a buffer which doesn't implement +it, the system will attempt to read data from the file identified +by the file_info_ptr structure and use other methods to write to it. + + Reading + +One of the basic reading functions in Apache 1.3b3 is buff_read; +here is how it would look within this spec: + +----- +/* the lowest level reading primitive */ +static ap_inline int buff_read(BUFF *fb, void *buf, int nbyte) +{ + int rv; + + if (!fb) + return -1; /* the bottom level filter is not set up properly */ + + if (fb->bfilter.read) + return fb->bfilter.read(fb->next_reader,buf,nbyte,fb->bfilter_info); + else + return bread(fb->next_reader,buff,nbyte); +} +----- +The code currently in buff_read would become part of the default +filter. + + + Flushing data + +flush will get passed on down the stack automatically, with recursive +calls to bflush. The user-supplied flush function will be called then, +and also before close is called. The user-supplied flush should not +call flush on the next buffer. + +[djg: Poorly written "expanding" filters can cause some nastiness +here. In order to flush a layer you have to write out your current +buffer, and that may cause the layer below to overflow a buffer and +flush it. If the filter is expanding then it may have to add more to +the buffer before flushing it to the layer below. It's possible that +the layer below will end up having to flush twice. It's a case where +writev-like capabilities are useful.] + + Closing Stacks and Filters + +When a filter is removed from the stack, flush will be called then close +will be called. When the entire stack is being closed, this operation +will be done automatically on each filter within the stack; generally, +filters should not operate on other filters further down the stack, +except to pass data along when flush is called. + + Flags and Options + +Changes to flags and options using the current functions only affect +one buffer. To affect all the buffers on down the chain, use +bsetstackopts or bsetstackflags. + +bgetopt is currently only used to grab a count of the bytes sent; +it will continue to provide that functionality. bgetflags is +used to provide information on whether or not the connection is +still open; it'll continue to provide that functionality as well. + +The core BUFF operations will remain, though some operations which +are done via flags and options will be done by attaching appropriate +filters instead (eg. chunking). + +[djg: I'd like to consider filesystem metadata as well -- we only need +a few bits of metadata to do HTTP: file size and last modified. We +need an etag generation function, it is specific to the filters in +use. You see, I'm envisioning a bottom layer which pulls data out of +a database rather than reading from a file.] From 0725ec1854948d948b805d2c888710fae1c1c7a5 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 05:18:43 +0000 Subject: [PATCH 0375/7878] Some notes from Dean on zero-copy IO and its ilk Submitted by: Dean Gaudet git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60350 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/doc_page_io.txt | 166 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 buckets/doc_page_io.txt diff --git a/buckets/doc_page_io.txt b/buckets/doc_page_io.txt new file mode 100644 index 00000000000..7e8d885f181 --- /dev/null +++ b/buckets/doc_page_io.txt @@ -0,0 +1,166 @@ + +From dgaudet@arctic.org Fri Feb 20 00:36:52 1998 +Date: Fri, 20 Feb 1998 00:35:37 -0800 (PST) +From: Dean Gaudet +To: new-httpd@apache.org +Subject: page-based i/o +X-Comment: Visit http://www.arctic.org/~dgaudet/legal for information regarding copyright and disclaimer. +Reply-To: new-httpd@apache.org + +Ed asked me for more details on what I mean when I talk about "paged based +zero copy i/o". + +While writing mod_mmap_static I was thinking about the primitives that the +core requires of the filesystem. What exactly is it that ties us into the +filesystem? and how would we abstract it? The metadata (last modified +time, file length) is actually pretty easy to abstract. It's also easy to +define an "index" function so that MultiViews and such can be implemented. +And with layered I/O we can hide the actual details of how you access +these "virtual" files. + +But therein lies an inefficiency. If we had only bread() for reading +virtual files, then we would enforce at least one copy of the data. +bread() supplies the place that the caller wants to see the data, and so +the bread() code has to copy it. But there's very little reason that +bread() callers have to supply the buffer... bread() itself could supply +the buffer. Call this new interface page_read(). It looks something like +this: + + typedef struct { + const void *data; + size_t data_len; /* amt of data on page which is valid */ + ... other stuff necessary for managing the page pool ... + } a_page_head; + + /* returns NULL if an error or EOF occurs, on EOF errno will be + * set to 0 + */ + a_page_head *page_read(BUFF *fb); + + /* queues entire page for writing, returns 0 on success, -1 on + * error + */ + int page_write(BUFF *fb, a_page_head *); + +It's very important that a_page_head structures point to the data page +rather than be part of the data page. This way we can build a_page_head +structures which refer to parts of mmap()d memory. + +This stuff is a little more tricky to do, but is a big win for performance. +With this integrated into our layered I/O it means that we can have +zero-copy performance while still getting the advantages of layering. + +But note I'm glossing over a bunch of details... like the fact that we +have to decide if a_page_heads are shared data, and hence need reference +counting (i.e. I said "queues for writing" up there, which means some +bit of the a_page_head data has to be kept until its actually written). +Similarly for the page data. + +There are other tricks in this area that we can take advantage of -- +like interprocess communication on architectures that do page flipping. +On these boxes if you write() something that's page-aligned and page-sized +to a pipe or unix socket, and the other end read()s into a page-aligned +page-sized buffer then the kernel can get away without copying any data. +It just marks the two pages as shared copy-on-write, and only when +they're written to will the copy be made. So to make this work, your +writer uses a ring of 2+ page-aligned/sized buffers so that it's not +writing on something the reader is still reading. + +Dean + +---- + +For details on HPUX and avoiding extra data copies, see +. + +(note that if you get the postscript version instead, you have to +manually edit it to remove the front page before any version of +ghostscript that I have used will read it) + +---- + +I've been told by an engineer in Sun's TCP/IP group that zero-copy TCP +in Solaris 2.6 occurs when: + + - you've got the right interface card (OC-12 ATM card I think) + - you use write() + - your write buffer is 16k aligned and a multiple of 16k in size + +We currently get the 16k stuff for free by using mmap(). But sun's +current code isn't smart enough to deal with our initial writev() +of the headers and first part of the response. + +---- + +Systems that have a system call to efficiently send the contents of a +descriptor across the network. This is probably the single best way +to do static content on systems that support it. + +HPUX: (10.30 and on) + + ssize_t sendfile(int s, int fd, off_t offset, size_t nbytes, + const struct iovec *hdtrl, int flags); + + (allows you to add headers and trailers in the form of iovec + structs) Marc has a man page; ask if you want a copy. Not included + due to copyright issues. man page also available from + http://docs.hp.com/ (in particular, + http://docs.hp.com:80/dynaweb/hpux11/hpuxen1a/rvl3en1a/@Generic__BookTextView/59894;td=3 ) + +Windows NT: + + BOOL TransmitFile( SOCKET hSocket, + HANDLE hFile, + DWORD nNumberOfBytesToWrite, + DWORD nNumberOfBytesPerSend, + LPOVERLAPPED lpOverlapped, + LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers, + DWORD dwFlags + ); + + (does it start from the current position in the handle? I would + hope so, or else it is pretty dumb.) + + lpTransmitBuffers allows for headers and trailers. + + Documentation at: + + http://premium.microsoft.com/msdn/library/sdkdoc/wsapiref_3pwy.htm + http://premium.microsoft.com/msdn/library/conf/html/sa8ff.htm + + Even less related to page based IO: just context switching: + AcceptEx does an accept(), and returns the start of the + input data. see: + + http://premium.microsoft.com/msdn/library/sdkdoc/pdnds/sock2/wsapiref_17jm.htm + + What this means is you require one less syscall to do a + typical request, especially if you have a cache of handles + so you don't have to do an open or close. Hmm. Interesting + question: then, if TransmitFile starts from the current + position, you need a mutex around the seek and the + TransmitFile. If not, you are just limited (eg. byte + ranges) in what you can use it for. + + Also note that TransmitFile can specify TF_REUSE_SOCKET, so that + after use the same socket handle can be passed to AcceptEx. + Obviously only good where we don't have a persistent connection + to worry about. + +---- + +Note that all this is shot to bloody hell by HTTP-NG's multiplexing. +If fragment sizes are big enough, it could still be worthwhile to +do copy avoidence. It also causes performance issues because of +its credit system that limits how much you can write in a single +chunk. + +Don't tell me that if HTTP-NG becomes popular we will seen vendors +embedding SMUX (or whatever multiplexing is used) in the kernel to +get around this stuff. There we go, Apache with a loadable kernel +module. + +---- + +Larry McVoy's document for SGI regarding sendfile/TransmitFile: +ftp://ftp.bitmover.com/pub/splice.ps.gz From f5b6109acbace2c4a60d0ce118594e4a2c3d4fcf Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 05:23:19 +0000 Subject: [PATCH 0376/7878] Notes from Dean on the later iol implementation. Submitted by: Dean Gaudet git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60351 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/doc_dean_iol.txt | 83 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 buckets/doc_dean_iol.txt diff --git a/buckets/doc_dean_iol.txt b/buckets/doc_dean_iol.txt new file mode 100644 index 00000000000..16444c68d2e --- /dev/null +++ b/buckets/doc_dean_iol.txt @@ -0,0 +1,83 @@ +goals? we need an i/o abstraction which has these properties: + +- buffered and non-buffered modes + + The buffered mode should look like FILE *. + + The non-buffered mode should look more like read(2)/write(2). + +- blocking and non-blocking modes + + The blocking mode is the "easy" mode -- it's what most module writers + will see. The non-blocking mode is the "hard" mode, this is where + module writers wanting to squeeze out some speed will have to play. + In order to build async/sync hybrid models we need the + non-blocking i/o abstraction. + +- timed reads and writes (for blocking cases) + + This is part of my jihad against asynchronous notification. + +- i/o filtering or layering + + Yet another Holy Grail of computing. But I digress. These are + hard when you take into consideration non-blocking i/o -- you have + to keep lots of state. I expect our core filters will all support + non-blocking i/o, well at least the ones I need to make sure we kick + ass on benchmarks. A filter can deny a switch to non-blocking mode, + the server will have to recover gracefully (ha). + +- copy-avoidance + + Hey what about zero copy a la IO-Lite? After having experienced it + in a production setting I'm no longer convinced of its benefits. + There is an enormous amount of overhead keeping lists of buffers, + and reference counts, and cleanup functions, and such which requires + a lot of tuning to get right. I think there may be something here, + but it's not a cakewalk. + + What I do know is that the heuristics I put into apache-1.3 to choose + writev() at times are almost as good as what you can get from doing + full zero-copy in the cases we *currently* care about. To put it + another way, let's wait another generation to deal with zero copy. + + But sendfile/transmitfile/etc. those are still interesting. + + So instead of listing "zero copy" as a property, I'll list + "copy-avoidance". + +So far? + +- ap_bungetc added +- ap_blookc changed to return the character, rather than take a char *buff +- in theory, errno is always useful on return from a BUFF routine +- ap_bhalfduplex, B_SAFEREAD will be re-implemented using a layer I think +- chunking gone for now, will return as a layer +- ebcdic gone for now... it should be a layer + +- ap_iol.h defined, first crack at the layers... + + Step back a second to think on it. Much like we have fread(3) + and read(2), I've got a BUFF and an ap_iol abstraction. An ap_iol + could use a BUFF if it requires some form of buffering, but many + won't require buffering... or can do a better job themselves. + + Consider filters such as: + - ebcdic -> ascii + - encryption + - compression + These all share the property that no matter what, they're going to make + an extra copy of the data. In some cases they can do it in place (read) + or into a fixed buffer... in most cases their buffering requirements + are different than what BUFF offers. + + Consider a filter such as chunking. This could actually use the writev + method to get its job done... depends on the chunks being used. This + is where zero-copy would be really nice, but we can get by with a few + heuristics. + + At any rate -- the NSPR folks didn't see any reason to included a + buffered i/o abstraction on top of their layered i/o abstraction... so + I feel like I'm not the only one who's thinking this way. + +- iol_unix.c implemented... should hold us for a bit From 31c8ade8244d00f8a2b459910fa27a8892775192 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 06:48:11 +0000 Subject: [PATCH 0377/7878] Add more design discussion of Dean's iol stuff. Submitted by: Martin Kraemer, Dean Gaudet git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60352 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/doc_dean_iol.txt | 342 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 342 insertions(+) diff --git a/buckets/doc_dean_iol.txt b/buckets/doc_dean_iol.txt index 16444c68d2e..67b319cecd7 100644 --- a/buckets/doc_dean_iol.txt +++ b/buckets/doc_dean_iol.txt @@ -81,3 +81,345 @@ So far? I feel like I'm not the only one who's thinking this way. - iol_unix.c implemented... should hold us for a bit + + +============================== +Date: Tue, 2 May 2000 15:51:30 +0200 +From: Martin Kraemer +To: new-httpd@apache.org +Subject: BUFF, IOL, Chunking, and Unicode in 2.0 (long) +Message-ID: <20000502155129.A10548@pgtm0035.mch.sni.de> + +Sorry for a long silence in the past weeks, I've been busy with other +stuff. + +Putting the catch-words "Chunking, Unicode and 2.0" into the subject +was on purpose: I didn't want to scare off anyone because of the word +EBCDIC: the problems I describe here, and the proposed new buff.c +layering, are mostly independent from the EBCDIC port. + + +In the past weeks, I've been thinking about today's buff.c (and +studied its applicability for automatic conversion stuff like in the +russian apache, see apache.lexa.ru). I think it would be neat to be +able to do automatic character set conversion in the server, for +example by negotiation (when the client sends an Accept-Charset and +the server doesn't have a document with exactly the right Charset, but +knows how to generate it from an existing representation). + +IMO it is a reoccurring problem, + +* not only in today's russian internet environment (de facto browsers + support 5 different cyrillic character sets, but the server doesn't + want to hold every document in 5 copies, so an automatic translation + is performed by the russian apache, depending on information supplied + by the client, or by explicit configuration). One of the supported + character sets is Unicode (UTF-7 or UTF-8) + +* in japanese/chinese environments, support for 16 bit character sets + is an absolute requirement. (Other oriental scripts like Thai get + along with 8 bit: they only have 44 consonants and 16 vowels). + Having success on the eastern markets depends to a great deal on + having support for these character sets. The japanese Apache + community hasn't had much contact with new-httpd in the past, but + I'm absolutely sure that there is a "standard japanese patch" for + Apache which would well be worth integrating into the standard + distribution. (Anyone on the list to provide a pointer?) + +* In the future, more and more browsers will support unicode, and so + will the demand grow for servers supporting unicode. Why not + integrate ONE solution for the MANY problems worldwide? + +* The EBCDIC port of 1997 has been a simple solution for a rather + simple problem. If we would "do it right" for 2.0 and provide a + generic translation layer, we would solve many problems in a single + blow. The EBCDIC translation would be only one of them. + +Jeff has been digging through the EBCDIC stuff and apparently +succeeded in porting a lot of the 1.3 stuff to 2.0 already. Jeff, I'd +sure be interested in having a look at it. However, when I looked at +buff.c and the new iol_* functionality, I found out that iol's are not +the way to go: they give us no solution for any of the conversion +problems: + +* iol's sit below BUFF. Therefore, they don't have enough information + to know which part of the written byte stream is net client data, + and which part is protocol information (chunks, MIME headers for + multipart/*). + +* iol's don't allow simplification of today's chunking code. It is + spread thruout buff.c and there's a very hairy balance between + efficiency and code correctness. Re-adding (EBCDIC/UTF) conversion, + possibly with sup[port for multi byte character sets (MBCS), would + make a code nightmare out of it. (buff.c in 1.3 was "almost" a + nightmare because we had onlu single byte translations. + +* Putting conversion to a hierarchy level any higher than buff.c is no + solution either: for chunks, as well as for multipart headers and + buffering boundaries, we need character set translation. Pulling it + to a higher level means that a lot of redundant information has to + be passed down and up. + +In my understanding, we need a layered buff.c (which I number from 0 +upwards): + +0) at the lowest layer, there's a "block mode" which basically + supports bread/bwrite/bwritev by calling the equivalent iol_* + routines. It doesn't know about chunking, conversion, buffering and + the like. All it does is read/write with error handling. + +1) the next layer handles chunking. It knows about the current + chunking state and adds chunking information into the written + byte stream at appropriate places. It does not need to know about + buffering, or what the current (ebcdic?) conversion setting is. + +2) this layer handles conversion. I was thinking about a concept + where a generic character set conversion would be possible based on + Unicode-to-any translation tables. This would also deal with + multibyte character sets, because at this layer, it would + be easy to convert SBCS to MBCS. + Note that conversion *MUST* be positioned above the chunking layer + and below the buffering layer. The former guarantees that chunking + information is not converted twice (or not at all), and the latter + guarantees that ap_bgets() is looking at the converted data + (-- otherwise it would fail to find the '\n' which indicates end- + of-line). + Using (loadable?) translation tables based on unicode definitions + is a very similar approach to what libiconv offers you (see + http://clisp.cons.org/~haible/packages-libiconv.html -- though my + inspiration came from the russian apache, and I only heard about + libiconv recently). Every character set can be defined as a list + of pairs, and translations between + several SBCS's can be collapsed into a single 256 char table. + Efficiently building them once only, and finding them fast is an + optimization task. + +3) This last layer adds buffering to the byte stream of the lower + layers. Because chunking and translation have already been dealt + with, it only needs to implement efficient buffering. Code + complexity is reduced to simple stdio-like buffering. + + +Creating a BUFF stream involves creation of the basic (layer 0) BUFF, +and then pushing zero or more filters (in the right order) on top of +it. Usually, this will always add the chunking layer, optionally add +the conversion layer, and usually add the buffering layer (look for +ap_bcreate() in the code: it almost always uses B_RD/B_WR). + +Here's code from a conceptual prototype I wrote: + BUFF *buf = ap_bcreate(NULL, B_RDWR), *chunked, *buffered; + chunked = ap_bpush_filter(buf, chunked_filter, 0); + buffered = ap_bpush_filter(chunked, buffered_filter, B_RDWR); + ap_bputs("Data for buffered ap_bputs\n", buffered); + + +Using a BUFF stream doesn't change: simply invoke the well known API +and call ap_bputs() or ap_bwrite() as you would today. Only, these +would be wrapper macros + + #define ap_bputs(data, buf) buf->bf_puts(data, buf) + #define ap_write(buf, data, max, lenp) buf->bf_write(buf, data, max, lenp) + +where a BUFF struct would hold function pointers and flags for the +various levels' input/output functions, in addition to today's BUFF +layout. + +For performance improvement, the following can be added to taste: + +* fewer buffering (zero copy where possible) by putting the buffers + for buffered reading/writing down as far as possible (for SBCS: from + layer 3 to layer 0). By doing this, the buffer can also hold a + chunking prefix (used by layer 1) in front of the buffering buffer + to reduce the number of vectors in a writev, or the number of copies + between buffers. Each layer could indicate whether it needs a + private buffer or not. + +* intra-module calls can be hardcoded to call the appropriate lower + layer directly, instead of using the ap_bwrite() etc macros. That + means we don't use the function pointers all the time, but instead + call the lower levels directly. OTOH we have iol_* stuff which uses + function pointers anyway. We decided in 1.3 that we wanted to avoid + the C++ type stuff (esp. function pointers) for performance reasons. + But it would sure reduces the code complexity a lot. + +The resulting layering would look like this: + + | Caller: using ap_bputs() | or ap_bgets/apbwrite etc. + +--------------------------+ + | Layer 3: Buffered I/O | gets/puts/getchar functionality + +--------------------------+ + | Layer 2: Code Conversion | (optional conversions) + +--------------------------+ + | Layer 1: Chunking Layer | Adding chunks on writes + +--------------------------+ + | Layer 0: Binary Output | bwrite/bwritev, error handling + +--------------------------+ + | iol_* functionality | basic i/o + +--------------------------+ + | apr_* functionality | + .... + +-- + | Fujitsu Siemens +Fon: +49-89-636-46021, FAX: +49-89-636-41143 | 81730 Munich, Germany + + +============================== +Date: Tue, 2 May 2000 09:09:28 -0700 (PDT) +From: dean gaudet +To: new-httpd@apache.org +Subject: Re: BUFF, IOL, Chunking, and Unicode in 2.0 (long) +In-Reply-To: <20000502155129.A10548@pgtm0035.mch.sni.de> +Message-ID: + +On Tue, 2 May 2000, Martin Kraemer wrote: + +> * iol's sit below BUFF. Therefore, they don't have enough information +> to know which part of the written byte stream is net client data, +> and which part is protocol information (chunks, MIME headers for +> multipart/*). + +there's not much stopping you from writing an iol which takes a BUFF * in +its initialiser, and then bcreating a second BUFF, and bpushing your iol. +like: + + /* this is in r->pool rather than r->connection->pool because + * we expect to create & destroy this inside request boundaries + * and if we stuck it in r->connection->pool the storage wouldn't + * be reclaimed earlier enough on pipelined connections. + * + * also, no need for buffering in new_buff because the translation + * layer can easily assume lower level BUFF is doing the buffering. + */ + new_buff = ap_bcreate(r->pool, B_WR); + ap_bpush_iol(new_buff, + ap_utf8_to_ebcdic(r->pool, r->connection->client)); + r->connection->client = new_buff; + +main problem is that the new_buff only works for writing, and you +potentially need a separate conversion layer for reading from the +client. + +shouldn't be too hard to split up r->connection->client into a read and +write half. + +think of iol as the equivalent of the low level read/write, and BUFF +as the equivalent of FILE *. there's a reason for both layers in +the interface. + +> * iol's don't allow simplification of today's chunking code. It is +> spread thruout buff.c and there's a very hairy balance between +> efficiency and code correctness. Re-adding (EBCDIC/UTF) conversion, +> possibly with sup[port for multi byte character sets (MBCS), would +> make a code nightmare out of it. (buff.c in 1.3 was "almost" a +> nightmare because we had onlu single byte translations. + +as i've said before, i welcome anyone to do it otherwise without adding +network packets, without adding unnecessary byte copies, and without +making it even more complex. until you've tried it, it's pretty easy +to just say "this is a mess". once you've tried it i suspect you'll +discover why it is a mess. + +that said, i'm still trying to prove to myself that the zero-copy +crud necessary to clean this up can be done in a less complex manner. + +> * Putting conversion to a hierarchy level any higher than buff.c is no +> solution either: for chunks, as well as for multipart headers and +> buffering boundaries, we need character set translation. Pulling it +> to a higher level means that a lot of redundant information has to +> be passed down and up. + +huh? HTTP is in ASCII -- you don't need any conversion -- if a chunking +BUFF below a converting BUFF/iol is writing those things in ascii +it works. no? at least that's my understanding of the code in 1.3. + +you wouldn't do the extra BUFF layer above until after you've written +the headers into the plain-text BUFF. + +i would expect you'd: + + write headers through plain text BUFF + push conversion BUFF + run method + pop conversion BUFF + pump multipart header + push conversion BUFF + ... + pop conversion BUFF + +> In my understanding, we need a layered buff.c (which I number from 0 +> upwards): + +you've already got it :) + +> | Caller: using ap_bputs() | or ap_bgets/apbwrite etc. +> +--------------------------+ +> | Layer 3: Buffered I/O | gets/puts/getchar functionality +> +--------------------------+ +> | Layer 2: Code Conversion | (optional conversions) +> +--------------------------+ +> | Layer 1: Chunking Layer | Adding chunks on writes +> +--------------------------+ +> | Layer 0: Binary Output | bwrite/bwritev, error handling +> +--------------------------+ +> | iol_* functionality | basic i/o +> +--------------------------+ +> | apr_* functionality | + +there are two cases you need to consider: + +chunking and a partial write occurs -- you need to keep track of how much +of the chunk header/trailer was written so that on the next loop around +(which happens in the application at the top) you continue where you +left off. + +and more importantly at the moment, and easier to grasp -- consider what +happens when you've got a pipelined connection. a dozen requests come +in from the client, and apache-1.3 will send back the minimal number +of packets. 2.0-current still needs fixing in this area (specifically +saferead needs to be implemented). + +for example, suppose the client sends one packet: + + GET /images/a.gif HTTP/1.1 + Host: foo + + GET /images/b.gif HTTP/1.1 + Host: foo + +suppose that a.gif and b.gif are small 200 byte files. + +apache-1.3 sends back one response packet: + + HTTP/1.1 OK + headers + + a.gif body + HTTP/1.1 OK + headers + + b.gif body + +consider what happens with your proposal. in between each of those +requests you remove the buffering -- which means you have to flush a +packet boundary. so your proposal generates two network packets. + +like i've said before on this topic -- if all unixes had TCP_CORK, +it'd be a breeze. but only linux has TCP_CORK. + +you pretty much require a layer of buffering right above the iol which +talks to the network. + +and once you put that layer of buffering there, you might as well merge +chunking into it, because chunking needs buffering as well (specifically +for the async i/o case). + +and then you either have to double-buffer, or you can only stack +non-buffered layers above it. fortunately, character-set conversion +should be doable without any buffering. + +*or* you implement a zero-copy library, and hope it all works out in +the end. + +-dean + From 270724b14bf4fbc3b65b941ab29148e1a4e8050c Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 07:25:44 +0000 Subject: [PATCH 0378/7878] More use cases and functional desires. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60353 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/doc_wishes.txt | 280 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 252 insertions(+), 28 deletions(-) diff --git a/buckets/doc_wishes.txt b/buckets/doc_wishes.txt index a905cbefc2d..c85d01ae045 100644 --- a/buckets/doc_wishes.txt +++ b/buckets/doc_wishes.txt @@ -6,40 +6,264 @@ Wishes -- use cases for layered IO Dirk's original list: --------------------- -This file is there so that I do not have to remind myself -about the reasons for Layered IO, apart from the obvious one. + This file is there so that I do not have to remind myself + about the reasons for Layered IO, apart from the obvious one. -0. To get away from a 1 to 1 mapping + 0. To get away from a 1 to 1 mapping - i.e. a single URI can cause multiple backend requests, - in arbitrary configurations, such as in paralel, tunnel/piped, - or in some sort of funnel mode. Such multiple backend - requests, with fully layered IO can be treated exactly - like any URI request; and recursion is born :-) + i.e. a single URI can cause multiple backend requests, + in arbitrary configurations, such as in paralel, tunnel/piped, + or in some sort of funnel mode. Such multiple backend + requests, with fully layered IO can be treated exactly + like any URI request; and recursion is born :-) -1. To do on the fly charset conversion + 1. To do on the fly charset conversion - Be, theoretically, be able to send out your content using - latin1, latin2 or any other charset; generated from static - _and_ dynamic content in other charsets (typically unicode - encoded as UTF7 or UTF8). Such conversion is prompted by - things like the user-agent string, a cookie, or other hints - about the capabilities of the OS, language preferences and - other (in)capabilities of the final receipient. + Be, theoretically, be able to send out your content using + latin1, latin2 or any other charset; generated from static + _and_ dynamic content in other charsets (typically unicode + encoded as UTF7 or UTF8). Such conversion is prompted by + things like the user-agent string, a cookie, or other hints + about the capabilities of the OS, language preferences and + other (in)capabilities of the final receipient. -2. To be able to do fancy templates + 2. To be able to do fancy templates - Have your application/cgi sending out an XML structure of - field/value pair-ed contents; which is substituted into a - template by the web server; possibly based on information - accessible/known to the webserver which you do not want to - be known to the backend script. Ideally that template would - be just as easy to generate by a backend as well (see 0). + Have your application/cgi sending out an XML structure of + field/value pair-ed contents; which is substituted into a + template by the web server; possibly based on information + accessible/known to the webserver which you do not want to + be known to the backend script. Ideally that template would + be just as easy to generate by a backend as well (see 0). -3. On the fly translation + 3. On the fly translation - And other general text and output mungling, such as translating - an english page in spanish whilst it goes through your Proxy, - or JPEG-ing a GIF generated by mod_perl+gd. + And other general text and output mungling, such as translating + an english page in spanish whilst it goes through your Proxy, + or JPEG-ing a GIF generated by mod_perl+gd. + + Dw. + + +Dean's canonical list of use cases +---------------------------------- + +Date: Mon, 27 Mar 2000 17:37:25 -0800 (PST) +From: Dean Gaudet +To: new-httpd@apache.org +Subject: canonical list of i/o layering use cases +Message-ID: + +i really hope this helps this discussion move forward. + +the following is the list of all applications i know of which have been +proposed to benefit from i/o layering. + +- data sink abstractions: + - memory destination (for ipc; for caching; or even for abstracting + things such as strings, which can be treated as an i/o + object) + - pipe/socket destination + - portability variations on the above + +- data source abstraction, such as: + - file source (includes proxy caching) + - memory source (includes most dynamic content generation) + - network source (TCP-to-TCP proxying) + - database source (which is probably, under the covers, something like + a memory source mapped from the db process on the same box, + or from a network source on another box) + - portability variations in the above sources + +- filters: + - encryption + - translation (ebcdic, unicode) + - compression + - chunking + - MUX + - mod_include et al + +and here are some of my thoughts on trying to further quantify filters: + +a filter separates two layers and is both a sink and a source. a +filter takes an input stream of bytes OOOO... and generates an +output stream of bytes which can be broken into blocks such +as: + + OOO NNN O NNNNN ... + + where O = an old or original byte copied from the input + and N = a new byte generated by the filter + +for each filter we can calculate a quantity i'll call the copied-content +ratio, or CCR: + + nbytes_old / nbytes_new + +where: + nbytes_old = number of bytes in the output of the + filter which are copied from the input + (in zero-copy this would mean "copy by + reference counting an input buffer") + nbytes_new = number of bytes which are generated + by the filter which weren't present in the + input + +examples: + +CCR = infinity: who cares -- straight through with no + transformation. the filter shouldn't even be there. + +CCR = 0: encryption, translation (ebcdic, unicode), compression. + these get zero benefit from zero-copy. + +CCR > 0: chunking, MUX, mod_include + +from the point of view of evaluating the benefit of zero-copy we only +care about filters with CCR > 0 -- because CCR = 0 cases degenerate into +a single-copy scheme anyhow. + +it is worth noting that the large_write heuristic in BUFF fairly +clearly handles zero-copy at very little overhead for CCRs larger than +DEFAULT_BUFSIZE. + +what needs further quantification is what the CCR of mod_include would +be. + +for a particular zero-copy implementation we can find some threshold k +where filters with CCRs >= k are faster with the zero-copy implementation +and CCRs < k are slower... faster/slower as compared to a baseline +implementation such as the existing BUFF. + +it's my opinion that when you consider the data sources listed above, and +the filters listed above that *in general* the existing BUFF heuristics +are faster than a complete zero-copy implementation. + +you might ask how does this jive with published research such as the +IO-Lite stuff? well, when it comes right down to it, the research in +the IO-Lite papers deal with very large CCRs and contrast them against +a naive buffering implementation such as stdio -- they don't consider +what a few heuristics such as apache's BUFF can do. + +Dean + + +Jim's summary of a discussion +----------------------------- + + OK, so the main points we wish to address are (in no particular order): + + 1. zero-copy + 2. prevent modules/filters from having to glob the entire + data stream in order to start processing/filtering + 3. the ability to layer and "multiplex" data and meta-data + in the stream + 4. the ability to perform all HTTP processing at the + filter level (including proxy), even if not implemented in + this phase + 5. Room for optimization and recursion + + Jim Jagielski + + +Roy's ramblings +--------------- + + Data flow networks are a very well-defined and understood software + architecture. They have a single, very important constraint: no filter + is allowed to know anything about the nature of its upstream or downstream + neighbors beyond what is defined by the filter's own interface. + That constraint is what makes data flow networks highly configurable and + reusable. Those are properties that we want from our filters. + + ... + + One of the goals of the filter concept was to fix the bird's nest of + interconnected side-effect conditions that allow buff to perform well + without losing the performance. That's why there is so much trepidation + about anyone messin with 1.3.x buff. + + ... + + Content filtering is my least important goal. Completely replacing HTTP + parsing with a filter is my primary goal, followed by a better proxy, + then internal memory caches, and finally zero-copy sendfile (in order of + importance, but in reverse order of likely implementation). Content + filtering is something we get for free using the bucket brigade interface, + but we don't get anything for free if we start with an interface that only + supports content filtering. + + ... + + I don't think it is safe to implement filters in Apache without either + a smart allocation system or a strict limiting mechanism that prevents + filters from buffering more than 8KB [or user-definable amount] of memory + at a time (for the entire non-flushed stream). It isn't possible to + create a robust server implementation using filters that allocate memory + from a pool (or the heap, or a stack, or whatever) without somehow + reclaiming and reusing the memory that gets written out to the network. + There is a certain level of "optimization" that must be present before + any filtering mechanism can be in Apache, and that means meeting the + requirement that the server not keel over and die the first time a user + requests a large filtered file. XML tree manipulation is an example + where that can happen. + + ... + + Disabling content-length just because there are filters in the stream + is a blatant cop-out. If you have to do that then the design is wrong. + At the very least the HTTP filter/buff should be capable of discovering + whether it knows the content length by examing whether it has the whole + response in buffer (or fd) before it sends out the headers. + + ... + + No layered-IO solution will work with the existing memory allocation + mechanisms of Apache. The reason is simply that some filters can + incrementally process data and some filters cannot, and they often + won't know the answer until they have processed the data they are given. + This means the buffering mechanism needs some form of overflow mechanism + that diverts parts of the stream into a slower-but-larger buffer (file), + and the only clean way to do that is to have the memory allocator for the + stream also do paging to disk. You can't do this within the request pool + because each layer may need to allocate more total memory than is available + on the machine, and you can't depend on some parts of the response being + written before later parts are generated because some filtering + decisions require knowledge of the end of the stream before they + can process the beginning. + + ... + + The purpose of the filtering mechanism is to provide a useful + and easy to understand means for extending the functionality of + independent modules (filters) by rearranging them in stacks + via a uniform interface. + + +Paul J. Reder's use cases for filters +------------------------------------- + + 1) Containing only text. + 2) Containing 10 .gif or .jpg references (perhaps filtering + from one format to the other). + 3) Containing an exec of a cgi that generates a text only file + 4) Containing an exec of a cgi that generates an SSI of a text only file. + 5) Containing an exec of a cgi that generates an SSI that execs a cgi + that generates a text only file (that swallows a fly, I don't know why). + 6) Containing an SSI that execs a cgi that generates an SSI that + includes a text only file. + NOTE: Solutions must be able to handle *both* 5 and 6. Order + shouldn't matter. + 7) Containing text that must be altered via a regular expression + filter to change all occurrences of "rederpj" to "misguided" + 8) Containing text that must be altered via a regular expression + filter to change all occurrences of "rederpj" to "lost" + 9) Containing perl or php that must be handed off for processing. + 10) A page in ascii that needs to be converted to ebcdic, or from + one code page to another. + 11) Use the babelfish translation filter to translate text on a + page from Spanish to Martian-Swahili. + 12) Translate to Esperanto, compress, and encrypt the output from + a php program generated by a perl script called from a cgi exec + embedded in a file included by an SSI :) -Dw. From c27151eb73651a1fbb2b07389b1196f9c3e95cf5 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 07:27:47 +0000 Subject: [PATCH 0379/7878] More thoughts on iol performance. Submitted by: Dean Gaudet git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60354 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/doc_dean_iol.txt | 71 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/buckets/doc_dean_iol.txt b/buckets/doc_dean_iol.txt index 67b319cecd7..95c0c34c025 100644 --- a/buckets/doc_dean_iol.txt +++ b/buckets/doc_dean_iol.txt @@ -83,6 +83,77 @@ So far? - iol_unix.c implemented... should hold us for a bit +============================== +Date: Mon, 10 Apr 2000 14:39:48 -0700 (PDT) +From: dean gaudet +To: new-httpd@apache.org +Subject: Re: Buff should be an I/O layer +In-Reply-To: <20000410123109.C3931@manojk.users.mindspring.com> +Message-ID: + +[hope you don't mind me taking this back to new-httpd so that it's +archived this time :)] + +On Mon, 10 Apr 2000, Manoj Kasichainula wrote: + +> On Mon, Mar 27, 2000 at 04:48:23PM -0800, Dean Gaudet wrote: +> > On Sat, 25 Mar 2000, Manoj Kasichainula wrote: +> > > (aside: Though my unschooled brain still sees no +> > > problem if our chunking layer maintains a pile of 6-byte blocks that +> > > get used in an iol_writev. I'll read the archived discussions.) +> > +> > there's little in the way of archived discussions, there's just me admitting +> > that i couldn't find a solution which was not complex. +> +> OK, there's got to be something wrong with this: +> +> chunk_iol->iol_write(char *buffer) { +> pull a 10-byte (or whatever) piece out of our local stash +> construct a chunk header in it +> set the iovec = chunk header + buffer +> writev(iovec) +> } +> +> But what is it? + +when i was doing the new apache-2.0 buffering i was focusing a lot on +supporting non-blocking sockets so we could do the async i/o stuff -- and +to support a partial write you need to keep more state than what your +suggestion has. + +also, the real complexity comes when you consider handling a pipelined +HTTP/1.1 connection -- consider what happens when you get 5 requests +for /cgi-bin/printenv smack after the other. + +if you do that against apache-1.3 and the current apache-2.0 you get +back maximally packed packets. but if you make chunking a layer then +every time you add/remove the layer you'll cause a packet boundary -- +unless you add another buffering layer... or otherwise shift around +the buffering. + +as a reminder, visit + for a +description of how much we win on the wire from such an effort. + +also, at some point i worry that passing the kernel dozens of tiny +iovecs is more expensive than an extra byte copy into a staging buffer, +and passing it one large buffer. but i haven't done any benchmarks to +prove this. (my suscipions have to do with the way that at least the +linux kernel's copying routine is written regarding aligned copies) + +oh it's totally worth pointing out that at least Solaris allows at +most 16 iovecs in a single writev()... which probably means every sysv +derived system is similarly limited. linux sets the limit at 1024. +freebsd has an optimisation for up to 8, but otherwise handles 1024. + +i'm still doing work in this area though -- after all my ranting about +zero-copy a few weeks back i set out to prove myself wrong by writing +a zero-copy buffering library using every trick in my book. i've no +results to share yet though. + +-dean + + ============================== Date: Tue, 2 May 2000 15:51:30 +0200 From: Martin Kraemer From b434bf8fff5c8c869995f92e7e98ce4df8bc3d7c Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 08:00:11 +0000 Subject: [PATCH 0380/7878] Save another old thread on stacked-io Submitted by: Ed Korthof, Ben Hyde git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60355 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/doc_stacked_io.txt | 257 +++++++++++++++++++++++++++++++++++++ 1 file changed, 257 insertions(+) diff --git a/buckets/doc_stacked_io.txt b/buckets/doc_stacked_io.txt index 8828abb2d2e..8adfa8c864d 100644 --- a/buckets/doc_stacked_io.txt +++ b/buckets/doc_stacked_io.txt @@ -552,3 +552,260 @@ a few bits of metadata to do HTTP: file size and last modified. We need an etag generation function, it is specific to the filters in use. You see, I'm envisioning a bottom layer which pulls data out of a database rather than reading from a file.] + + +************************************************************************* +Date: Sun, 27 Dec 1998 13:08:22 -0800 (PST) +From: Ed Korthof +To: new-httpd@apache.org +Subject: I/O filters & reference counts +Message-ID: + +Hi -- + +A while back, I indicated I'd propose a way to do reference counts w/ the +layered I/O I want to implement for 2.0 (assuming we don't use nspr)... +for single-threaded Apache, this seems unnecessary (assuming you don't use +shared memory in your filters to share data amoung the processes), but in +other situations it does have advantages. + +Anyway, what I'd propose involves using a special syntax when you want to +use reference counts. This allows Apache to continue using the +'pool'-based memory system (it may not be perfect, but imo it's reasonably +good), without creating difficult when you wish to free memory. + +If you're creating memory which you'll want to share amoung multiple +threads, you'll create it using a function more or less like: + + ap_palloc_share(pool *p, size_t size); + +you get back a void * pointer for use as normal. When you want to give +someone else a reference to it, you do the following: + + ap_pshare_data(pool *p1, pool *p2, void * data); + +where data is the return from above (and it must be the same). Then both +pools have a reference to the data & to a counter; when each pool is +cleaned up, it will automatically decrement the counter, and free the data +if the counter is down to zero. + +In addition, a pool can decrement the counter with the following: + + ap_pshare_free(pool * p1, void * data); + +after which the data may be freed. There would also be a function, + + ap_pshare_countrefs(pool * p1, void * data); + +which would return the number of pools holding a ref to 'data', or 1 if +it's not a shared block. + +Internally, the pool might either keep a list of the shared blocks, or a +balanced b-tree; if those are too slow, I'd look into passing back and +forth a (pointer to an) int, and simply use an array. The filter +declaring the shared memory would need to keep track of such an int, but +no one else would. + +In the context of I/O filters, this would mean that each read function +returns a const char *, which should not be cast to a non-const char * (at +least, not without calling ap_pshare_countrefs()). If a filter screwed +this up, you'd have a problem -- but that's more or less unavoidable with +sharing data amoung threads using reference counts. + +It might make sense to build a more general reference counting system; if +that's what people want, I'm also up for working on that. But one of the +advantages the pool system has is its simplicity, some of which would be +lost. + +Anyway, how does this sound? Reasonable or absurd? + +Thanks -- + +Ed + ---------------------------------------- +History repeats itself, first as tragedy, second as farce. - Karl Marx + +************************************************************************* +From: Ben Hyde +Date: Tue, 29 Dec 1998 11:50:01 -0500 (EST) +To: new-httpd@apache.org +Subject: Re: I/O filters & reference counts +In-Reply-To: +References: + +Message-ID: <13960.60942.186393.799490@zap.ml.org> + + +There are two problems that reference counts address that we have, +but I still don't like them. + +These two are: pipeline memory management, and response paste up. A +good pipeline ought not _require_ memory proportional to the size of +the response but only proportional to the diameter of the pipe. +Response paste up is interesting because the library of clip art is +longer lived than the response or connection pool. There is a lot to +be said for leveraging the configuration pool life cycle for this kind +of thing. + +The pipeline design, and the handling of the memory it uses become +very entangled after a while - I can't think about one without the +other. This is the right place to look at this problem. I.e. this +is a problem to be lead by buff.c rework, not alloc.c rework. + +Many pipeline operations require tight coupling to primitive +operations that happen to be efficient. Neat instructions, memory +mapping, etc. Extreme efficiency in this pipeline makes it desirable +that the chunks in the pipeline be large. I like the phrase "chunks +and pumps" to summarize that there are two elements to design to get +modularity right here. + +The pasteup problem - one yearns for a library of fragments (call it a +cache, clip art, or templates if you like) which then readers in that +library can assemble these into responses. Some librarians like to +discard stale bits and they need a scheme to know that the readers +have all finished. The library resides in a pool that lives longer +than a single response connection. If the librarian can be convinced +that the server restart cycles are useful we get to a fall back to +there. + +I can't smell yet where the paste up problem belong in the 2.0 design +problem. (a) in the core, (b) in a module, (c) as a subpart of the +pipeline design, or (d) ostracized outside 2.0 to await a gift (XML?) +we then fold into Apache. I could probably argue any one of these. A +good coupling between this mechanism and the pipeline is good, limits +on the pipeline design space are very good. + + - ben + + +************************************************************************* +Date: Mon, 4 Jan 1999 18:26:36 -0800 (PST) +From: Ed Korthof +To: new-httpd@apache.org +Subject: Re: I/O filters & reference counts +In-Reply-To: <13960.60942.186393.799490@zap.ml.org> +Message-ID: + +On Tue, 29 Dec 1998, Ben Hyde wrote: + +> There are two problems that reference counts address that we have, +> but I still don't like them. + +They certainly add some clutter. But they offer a solution to the +problems listed below... and specifically to an issue which you brought up +a while back: avoiding a memcpy in each read layer which has a read +function other than the default one. Sometimes a memcpy is required, +sometimes not; with "reference counts", you can go either way. + +> These two are: pipeline memory management, and response paste up. A +> good pipeline ought not _require_ memory proportional to the size of +> the response but only proportional to the diameter of the pipe. +> Response paste up is interesting because the library of clip art is +> longer lived than the response or connection pool. There is a lot to +> be said for leveraging the configuration pool life cycle for this kind +> of thing. + +I was indeed assuming that we would use pools which would last from one +restart (and a run through of the configuration functions) to the next. + +So far as limiting the memory requirements of the pipeline -- this is +primarily a function of the module programming. Because the pipeline will +generally live in a single thread (with the possible exception of the data +source, which could be another processes), the thread will only be +operating on a single filter at a time (unless you added custom code to +create a new thread to handle one part of the pipeline -- ugg). + +For writing, the idea would be to print one or more blocks of text with +each call; wait for the write function to return; and then recycle the +buffers used. + +Reading has no writev equivalent, so you only be able to do it one block +at a time, but this seems alright to me (reading data is actually a much +less complicated procedure in practice -- at least, with the applications +which I've seen). + +Recycling read buffers (so as to limit the size of the memory pipeline) +is the hardest part, when we add in this 'reference count' scheme -- but +it can be done, if the modules recieving the data are polite and indicate +when they're done with the buffer. Ie.: + + module 1 module 2 +1.) reads from module 2: + char * ap_bread(BUFF *, pool *, int); + +2.) returns a block of text w/ ref counts: + str= char* ap_pshare_alloc(size_t); + ... + return str; + keeps a ref to str. + +3.) handles the block of data + returned, and indicates it's + finished with: + void ap_pshare_free(char * block); + reads more data via + char * ap_bread(BUFF *, pool *, int); + +4.) tries to recycle the buffer used: + if (ap_pshare_count_refs(str)==1) + reuse str + else + str = ap_pshare_alloc(...) + ... + return str; + +5.) handles the block of data + returned... +... + +One disadvantage is that if module 1 doesn't release its hold on a memory +block it got from step 2 until step 5, then the memory block wouldn't be +reused -- you'd pay w/ a free & a malloc (or with a significant increase +in complexity -- I'd probably choose the free & malloc). And if the module +failed to release the memory (via ap_pshare_free), then the memory +requirements would be as large as the response (or request). + +I believe this is only relevant for clients PUTting large files onto their +servers; but w/ files which are potentially many gigabytes, it is +important that filters handling reading do this correctly. Of course, +that's currently the situation anyhow. + +> The pipeline design, and the handling of the memory it uses become +> very entangled after a while - I can't think about one without the +> other. This is the right place to look at this problem. I.e. this +> is a problem to be lead by buff.c rework, not alloc.c rework. + +Yeah, after thinking about it a little bit I realized that no (or very +little) alloc.c work would be needed to implement the system which I +described. Basically, you'd have an Apache API function which does malloc +on its own, and other functions (also in the API) which register a cleanup +function (for the malloc'ed memory) in appropriate pools. + +IMO, the 'pipeline' is likely to be the easiest place to work with this, +at least in terms of getting the most efficient & clean design which we +can. + +[snip good comments] +> I can't smell yet where the paste up problem belong in the 2.0 design +> problem. (a) in the core, (b) in a module, (c) as a subpart of the +> pipeline design, or (d) ostracized outside 2.0 to await a gift (XML?) +> we then fold into Apache. I could probably argue any one of these. A +> good coupling between this mechanism and the pipeline is good, limits +> on the pipeline design space are very good. + +An overdesigned pipeline system (or an overly large one) would definitely +not be helpful. If it would be useful, I'm happy to work on this (even if +y'all aren't sure if you'd want to use it); if not, I'm sure I can find +things to do with my time. + +Anyway, I went to CPAN and got a copy of sfio... the latest version I +found is from Oct, 1997. I'd guess that using it (assuming this is +possible) might give us slightly less efficency (simply because sfio +wasn't built specifically for Apache, and customizing it is a much more +involved processes), but possibly fewer bugs to work out & lots of +interesting features. + +thanks -- + +Ed, slowly reading through the sfio source code + From 087026ee1f92156b4bdc69e5813fea54dade39a6 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 08:01:45 +0000 Subject: [PATCH 0381/7878] Gather together the main points of bucket brigades. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60356 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/doc_bucket_brigades.txt | 381 ++++++++++++++++++++++++++++++++ 1 file changed, 381 insertions(+) create mode 100644 buckets/doc_bucket_brigades.txt diff --git a/buckets/doc_bucket_brigades.txt b/buckets/doc_bucket_brigades.txt new file mode 100644 index 00000000000..9fc3c7a0397 --- /dev/null +++ b/buckets/doc_bucket_brigades.txt @@ -0,0 +1,381 @@ +To: new-httpd@apache.org +Subject: bucket brigades and IOL +Date: Fri, 12 Nov 1999 23:57:43 -0800 +From: "Roy T. Fielding" +Message-ID: <199911122357.aa18914@gremlin-relay.ics.uci.edu> + +About two years ago I wasted a lot of time writing an Ada95 library +called Onions that provides a stackable stream abstraction for files, +sockets, etc. It is at +if you want to take a look at it, but I don't recommend looking at the +code since it is almost all just working around Ada95's lack of a +system interface. I'll describe the worthwhile bits here. + +The heart of Onions is the input and output stream object +classes and classwide types for building a data stream via a +stack of stream objects (Input_Pipe and Output_Pipe). Reading +from the head of an input pipe causes the head stream object +to read from the next outbound stream object, and on down the line. +Likewise for writing to the head of an output pipe. One of the +main features of streams is that they can filter the data as it +passes, converting, adding to, and/or removing from the data +before giving it to the next object. Since multiple streams can be +cascaded, the complete data conversion is the sum of the individual +data conversions performed by the stream objects. + +So far, no big deal -- this can be manually created by stacking ap_iol +types in a meaningful way. But, the one unique thing I did in Onions was +abstract the memory handling into something called Buckets and moved them +around in Bucket_Brigades. A bucket is an allocated segment of memory +with pointers to its allocation address and current size. If I were doing +this in C, I'd also add a pointer to current start address and allocated +size, so that a single bucket could be shrunk from both ends without +copying, and a function pointer for freeing it at the stream end. +Note that this is the same type of memory structure that IO-Lite uses, +though developed independently and for different reasons. + +A bucket brigade is a list-queue of buckets. Each of the stream read/write +calls would pass a bucket brigade instead of single bucket, since this +made insertion by filters more efficient, with the general idea being that +the outbound end of the sream would be writing them out using writev +or reading them in using readv, which is about as efficient as I could +get with Ada95. [I call it a list-queue instead of just queue because you +have the choice of removing buckets from (or adding to) the queue one +bucket at a time or an entire linked list of buckets.] + +But we could go one step further. A bucket is an ADT, and as such can +be used as a general handle for read-only memory, read-write memory, +cache object, file handle, mmap handle, file name, URL, whatever. +What if, instead of just a stream of memory, it could pass around a +stream of memory interspersed with file handles or references to +remote objects? A filter could then add stuff around the stream without +causing too much parsing overhead, and if it needed to look at all the +bytes in the stream it would just replace the bucket handle with a stream +of memory sucked from that handle. Something like this was talked about +last year (see threads on "Stacking up Response Handling" on 23 Sep 1998 +and "I/O filters & reference counts" in late December 1998 and January 1999). +And Dean started something with ap_buf.h, but I don't know how he meant +to finish it. + +What I was thinking of was + + typedef enum { + AP_BUCKET_rwmem, + AP_BUCKET_rmem, + AP_BUCKET_file_t, + AP_BUCKET_mmap_t, + AP_BUCKET_filename, + AP_BUCKET_cached_entity, + AP_BUCKET_URI, + } ap_bucket_color_t; + + typedef struct ap_bucket_t ap_bucket_t; + struct ap_bucket_t { + ap_bucket_color_t color; + void *content; + ap_status_t (*free)(ap_bucket_t *bucket); + unsigned int refcount; + }; + + typedef struct ap_bucket_rwmem_t ap_bucket_rwmem_t; + struct ap_bucket_rwmem_t { + void *alloc_addr; + size_t alloc_len; + void *addr; + size_t len; + }; + + typedef struct ap_bucket_rmem_t ap_bucket_rmem_t; + struct ap_bucket_rmem_t { + void *addr; + size_t len; + }; + + typedef struct ap_bucket_filename ap_bucket_filename; + struct ap_bucket_filename { + ap_context_t *ctx; + char *name; + ap_stat_t *stat; /* useful if already stat'ed */ + ap_aa_t *conf; /* access control structure for this file */ + }; + + ... + +and then + + typedef struct ap_bucket_list_t ap_bucket_list_t; + struct ap_bucket_list_t { + ap_bucket_t *bucket; + ap_bucket_list_t *prev; + ap_bucket_list_t *next; + }; + + typedef struct ap_brigade_t ap_brigade_t; + struct ap_brigade_t { + ap_context_t *ctx; + ap_bucket_list_t *first; + ap_bucket_list_t *last; + unsigned int count; + }; + +and then construct the input and output streams as pushing these +bucket brigades to or from the client. The streams would have to +be a little more complicated than Onions, since I learned later that +you also need a parallel stream of header fields (in tokenized form) +in order for it to work with anything HTTP-like. + +Why use an enum instead of a bunch of file pointers for each type +of bucket, kind of like ap_iol? Because it allows adjacent memory +buckets (the most frequent kind after a filter operation) to be +gathered into a single writev. Also, we need a way to be able to +set up an operation and figure out what it will produce without +actually performing the operation -- this is for OPTIONS and HEAD. + +Note that this would completely change the way we handle internal +redirects, subrequests, server-side include, mod_proxy, access control, etc. +And then most of the API hooks would need to change. I think that is why +Dean was putting it off until 2.1. The annoying thing is that this is the +most useful rearchitecting of the server -- the MPM, APR, and hook changes +make 2.0 easier/cleaner/faster to port to other platforms, but layering +enables in one fell swoop almost every significant non-config feature +that our users have requested. A cache would just be a hash table or +btree of file buckets, complete with AA info. + +Anyway, that was stuck in the back of my head and had to get out. +I won't be able to work on it until after the dissertation is done, +which every day seems to be further away. Maybe 3.0, with rHTTP/2.0. + +....Roy + +================================================= +To: new-httpd@apache.org +Subject: Re: bucket brigades and IOL +In-reply-to: Your message of "Sat, 13 Nov 1999 20:43:58 GMT." + <382DCD8E.881B8468@algroup.co.uk> +Date: Sun, 14 Nov 1999 22:24:03 -0800 +From: "Roy T. Fielding" +Message-ID: <199911142224.aa22545@gremlin-relay.ics.uci.edu> + +BenL wrote: +>I've got to say that this is the most coherent suggestion along these +>lines that I've seen yet. I rather like it. One thing I'd add is that if +>you are going to have a movable "start of block" pointer, and changeable +>length, it can be nice to allocate extra around the edges under some +>circumstances, so that lower layers can expand the block without having +>to add extra chunks. + +Or, alternatively, allocate equal size blocks and just pass around +a reference pair within the buckets that, when the bucket is freed, +access a more complicated reference-counting pool. I think that is +closer to what IO-Lite does. + +>Also, the usual objections still apply - i.e. it is awkward to do things +>like searching for particular strings, since they may cross boundaries. +>I'm beginning to think that the right answer to this is to provide nice +>matching functions that know about the chunked structures, and last +>resort functions that'll glue it all back into one chunk... + +Yep, that's what I ended up doing for Ada95, though in that case there +were no easier alternatives. + +....Roy + +================================================= +To: new-httpd@apache.org +Subject: Re: layered I/O (was: cvs commit: ...) +In-reply-to: Your message of "Wed, 29 Mar 2000 01:21:09 PST." + +Date: Wed, 29 Mar 2000 02:05:08 -0800 +From: "Roy T. Fielding" +Message-ID: <200003290205.aa19557@gremlin-relay.ics.uci.edu> + +>Selection of IO Layers +> +>The core selects a source module and IO layers based on the urlspace +>configuration. Content might be generated by mod_perl, and the result is +>piped through mod_chunk, mod_ssl, and mod_net, in turn. When the content +>generator runs, the core enforces that the module set the content type +>before the first call to ap_bput. The content type is set by a function +>call. The function (ap_set_content_type(request_rec *, char *)) examines +>the content type and adds IO layers as neccessary. For server parsed +>html, the core might insert mod_include immediately after mod_perl. + +The problem of thinking of it that way is that, like Dean mentioned, +the output of one module may be filtered and the filter indicate that +content should be embedded from another URL, which turns out to be a +CGI script that outputs further parseable content. In this instance, +the goal of layered-IO is to abstract away such behavior so that the +instance is processed recursively and thus doesn't result in some tangled +mess of processing code for subrequests. Doing it requires that each +layer be able to pass both data and metadata, and have both data and +metadata be processed at each layer (if desired), rather than call a +single function that would set the metadata for the entire response. + +My "solution" to that is to pass three interlaced streams -- data, +metadata, and meta-metadata -- through each layer. The metadata +streams would point to a table of tokenized name-value pairs. +There are lots of ways to do that, going back to my description of +bucket brigades long ago. Basically, each block of memory would +indicate what type of data, with metadata occurring in a block before +the data block(s) that it describes (just like chunk-size describes +the subsequent chunk-data) and the layers could be dynamically +rearranged based on the metadata that passed through them, in +accordance with the purpose of the filter. + +>(Can anyone produce a use case where the IO chain could change after +>output begins?) + +Output is a little easier, but that is the normal case for input. +We don't know what filters to apply to the request body until after +we have passed through the HTTP headers, and the HTTP message processor +is itself a filter in this model. + +....Roy + + +================================================= +To: new-httpd@apache.org +Subject: Re: filtering patches +In-reply-to: Your message of "Mon, 10 Jul 2000 15:33:25 PDT." + +Date: Mon, 10 Jul 2000 16:58:00 -0700 +From: "Roy T. Fielding" +Message-ID: <200007101657.aa21782@gremlin-relay.ics.uci.edu> + +[...] +I meant that the filters, when written to as part of the output stream, +are treated as a stack (write to the top-most filter without any knowledge +of what may lie underneath it). So the process of arranging filters +for a particular response is like dropping them onto a stack. When a +filter is done or the stream is closed, each instantiated filter cleans +up according to its local state and then destroys itself (as it is popped +off the stack). + +This is completely separate from the registration of filters by +name and purpose, which could be done by hooks. The difference is that +filters are registered at config time but only instantiated (given local +storage) and arranged on a per stream basis. + +Bucket brigades is simply a way to encapsulate and pass data down the stream +such that it can be as efficient as the sender desires, while retaining +a simple interface. The purpose of the bucket is to make handling of the +data uniform regardless of its type, or make type-specific conversions +via a single ADT call if and only if they are needed by some filter. +The purpose of the brigade is to reduce the number of calling arguments +and linearize the calling sequence for insertion filters. Each filter +definition is separate from its instantiation on the stream because +there may be many streams operating at once within a single program. +Each bucket is independent of the brigade so that the filters can rearrange +and insert buckets at will. Each data item is isolated by the bucket +structure, which allows them to be split across child buckets or shared +with multiple streams (e.g., cached objects). We don't need to implement +all of this on the first pass -- we just need to implement the ADT external +interfaces such that they don't have to change as we make the overall +stream more efficient. + +BTW, in case I didn't make this clear in past messages, this design is +an amalgam of the best aspects of the designs from Henrik's Streams +(see w3c-libwww), sfio (AT&T Research), IO-Lite (Rice Univ.), and +libwww-ada95 (UCI). The MIME stuff in MSIE is based on Henrik's streams. +Henrik's stuff is very fast, but is spaghetti code because it relies on +callbacks and legacy stuff in libwww. sfio is great but is intended to +be a complete replacement for stdio and hence does way too much and is +subject to a few patents that I don't appreciate. IO-Lite is cool but +is probably only worth it when the entire OS is based on IO-Lite memory +management, but regardless the code isn't available for commercial use. +As Dean has mentioned many times, we already get most of the performance +benefit of IO-Lite simply by avoiding memory copies on large writes. +libwww-ada95 was an attempt to make Ada95 suck less for systems programming, +which was only a partial success (it is very fast compared to other Ada95 +libraries, but memory management became a problem with complex filters). + +Writing our own streams library isn't NIH syndrome -- both Dean and I +have independently investigated the other available alternatives and they +just aren't suitable for our purpose. Even with all that, my own design +only truly pays off (versus plain old BUFF) when you make good use of +sendfile and shared object caching. + +[...] + + +================================================= +Other stuff Roy wrote on new-httpd: + +My buckets are passed around in list-queues (really just lists with front +and back pointers). My buckets carry data and metadata and meta-metadata. +My buckets are used to indicate stream-end, and the filter configuration +itself is determined by the stream content. It probably sounds weird, but +the effects of this interface are completely different than mere content +filters. They simplify everything. I'm not saying that we have to +simplify everything right away, but I am saying that it is just as easy +to implement a fully-general filter using bucket brigades as it is +to implement string interface filters -- all of the complex parts +are handled by the ADTs. + +... + +The real psychedelic stuff happens when you can pass metadata (tokenized +header fields) as buckets and the filters know how to pass that down the +chain without treating them as data. + +... + +The purpose of passing a list of buckets around is to linearize +the call stack for the frequent case of filtered content +splitting one large bucket into separate buckets with filtered results +interspersed in between. The effect is that a filter chain can frequently +process an entire message in one pass down the chain, which enables the +stream end to send the entire response in one go, which also allows it +to do interesting things like provide a content length by summing the +data length of all the buckets' data, and set a last-modified time +by picking the most recent time from a set of static file buckets. + +I think it would help if we stopped using artificial examples. Let's +try something simple: + + socket <-- http <-- add_footer <-- add_header <-- send_file + +send_file calls its filter with an ap_file_t bucket and End-of-Stream (EOS) +in the bucket list. add_header sets a flag, prepends another ap_file_t +bucket to the list and sends the list to its filter. add_footer looks +at the list, finds the EOS, inserts another ap_file_t bucket in +front of the EOS, and sends the list on to its filter. http walks through +the list picking up the (cached) stat values, notes the EOS and seeing +that its own flag for headers_sent is false, sets the cumulative metadata +and sends the header fields, followed by three calls to the kernel to +send out the three files using whatever mechanism is most efficient. + +The point here isn't that this is the only way to implement filters. +The point is that no other interface can implement them as efficiently. +Not even close. Yes, there are cases where string filters are just as +efficient as any other design, but there is no case in which they are +more efficient than bucket brigades. The reason is that being able +to process a list of strings in one call more than offsets the extra +cost of list processing, regardless of the filter type, and allows +for additional features that have benefits for http processing. +Like, for example, being able to determine the entire set of resources +that make up the source of this dynamic resource without teaching every +filter about WebDAV. + +... + +Making many small calls down the filter chain is something best +avoided, which is why the bucket brigades interface consists of +a linked list of buckets, such that all of the currently available +data can be passed-on in a single call. + +Being able to handle sendfile, cached objects and subrequests is very +effective at improving efficiency, which is why the buckets are typed. +A filter that needs to do byte-level processing will have to call a +routine to convert the typed bucket into a data stream, but that decision +is delayed until no other choice is available and adds no overhead to +the common cases of non-filtered or pre-/post-filtered objects. + +Being able to process header fields (metadata) through the same filter +set as the data is necessary for correctness and simplicity in the +proper ordering of independently developed filter modules, which is +why the buckets can carry metadata on the same stream. Every filter +has to be knowledgeable about metadata because only the filter knows +whether or not its actions will change the nature of the data. + + From 407d4a5589cd755bba2485a23e6d2b9a6f50d5f4 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 08:03:21 +0000 Subject: [PATCH 0382/7878] Record Greg's filter approach rationale. This is probably documented in the code as well (or should be). Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60357 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/doc_greg_filters.txt | 102 +++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 buckets/doc_greg_filters.txt diff --git a/buckets/doc_greg_filters.txt b/buckets/doc_greg_filters.txt new file mode 100644 index 00000000000..346e877f4ed --- /dev/null +++ b/buckets/doc_greg_filters.txt @@ -0,0 +1,102 @@ +Date: Fri, 14 Apr 2000 13:46:50 -0700 (PDT) +From: Greg Stein +To: new-httpd@apache.org +Subject: Re: I/O filtering in 2.0 +In-Reply-To: +Message-ID: + +On Fri, 14 Apr 2000 rbb@covalent.net wrote: +> I am not calling this I/O Layering, because this is really output +> filtering. The patch I am submitting allows modules to edit data after a +> handler has finished with it. This is basically Greg's approach. + +I'll detail my approach here, as your patch has some pieces, but it is +quite different. + +All of this is obviously IMO... + + +*) we definitely want multiple output filters. each filter is recorded in + a linked list in the request_rec. + +*) a filter has a name and is implemented by a module. this mapping is set + up similarly to handler maps in the 'module' structure. + +*) output from normal modules is identical to today. they use ap_rputs, + ap_rwrite, etc. Filtering occurs under the covers. + +*) Apache defines ap_lwrite(ap_layer *next_layer, + const void *buf, size_t len, + request_rec *r) + and possibly some similar ones for printf, puts, etc + +*) struct ap_layer_s { + const char *layer_name; + layer_func_t *func; + struct ap_layer_s *next; + } + + /* filters implement function with this type: */ + typedef ap_status_t (*layer_func_t)(ap_layer *next_layer, + const void *buf, size_t len, + request_rec *r); + /* ### dunno about that return type */ + /* looks remarkably similar to ap_lwrite(), eh? */ + +*) ap_status_t ap_lwrite(ap_layer *layer, const void *buf, + size_t len, request_rec *r) + { + if (layer == NULL) { + ap_bwrite(r->connection->client, buf, len, &amt); + return OK; + } + return (*layer->func)(layer->next, buf, len, r); + } + +*) a new Apache directive can detail the sequence of filters and install + them into the request_rec. + +*) ap_rwrite() and friends calls ap_lwrite(r->first_layer, ...). this will + perform actual output filtering, or go off to the BUFF stuff. + +*) a new hook is added: install_filters. it is called right before + invoke_handlers and is responsible for setting r->first_layer and/or + elements along the list. + +*) a new, small module can implement a directive which responds to + install_filters and sets up a sequence of filters based on their names. + for example: + SetFilters PHP SSI + +*) content handlers (e.g. during invoke_handler processing) have a new + function to call: ap_set_content_type(r, const char *type). when the + type is changed, such as during CGI processing, this function is called + and an opportunity (somehow? haven't thought on this part) is provided + for new output layers to be inserted. + [ this provides for a CGI output'ing application/x-httpd-php3 ] + + ap_set_content_type() should probably know where it is during the + request processing so that it can be used any time. maybe it should be + allowed to set up layers at any time? + + +That's it. :-) + +Helper functions to set up a pipe and a sub-thread would be handy. That +would allow some modules to keep their "read from an fd" approach, rather +than switching to a stateful parser approach. As Dean stated before, +output filtering is necessarily asynchronous: a sub thread or a state +machine thingy is required. + +[ flipping things around, you could say that the initial content can be + generated asynchronously (where the first filter demands the next chunk + of output). this would be incredibly difficult for things like + mod_autoindex. at some point, somebody is pulling content and shoving it + down the BUFF. the above form is "everybody shoves content" ] + +Cheers, +-g + +-- +Greg Stein, http://www.lyra.org/ + From f80e667202f60813e1a90c7a4bde9e7be3987088 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Thu, 13 Jul 2000 12:06:48 +0000 Subject: [PATCH 0383/7878] fix apr_hash_set() -- it wasn't replacing values git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60358 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_hash.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/apr_hash.c b/lib/apr_hash.c index e2162e17672..c9da1ce7cfa 100644 --- a/lib/apr_hash.c +++ b/lib/apr_hash.c @@ -272,7 +272,15 @@ APR_EXPORT(void) ap_hash_set(ap_hash_t *ht, { ap_hash_entry_t **hep; hep = find_entry(ht, key, klen, val); - if (*hep && !val) - /* delete entry */ - *hep = (*hep)->next; + if (*hep) { + if (!val) { + /* delete entry */ + *hep = (*hep)->next; + } + else { + /* replace entry */ + (*hep)->val = val; + } + } + /* else key not present and val==NULL */ } From ce5d1e7c0ca5b5cf523d5ab2fd48ac6b06a0dc51 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 13 Jul 2000 15:10:05 +0000 Subject: [PATCH 0384/7878] Add ap_bucket_brigade_append_list and ap_bucket_brigade_append_bucket functions. These add either a list or a bucket to the end of a bucket brigade. Also, remove ap_bucket_list_init. This is no longer needed. Submitted by: Cliff Woolley Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60359 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 67 ++++++++++++++++++++++++----------------------- buckets/apr_buf.h | 19 +++++++------- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index e9ce81a25bd..7bc4d9f45ea 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -137,19 +137,42 @@ APR_EXPORT(ap_bucket_list *) ap_bucket_list_create(void) return b; } -APR_EXPORT(void) ap_bucket_list_init(ap_bucket_list *b) +APR_EXPORT(void) ap_bucket_brigade_append_list(ap_bucket_brigade *b, + ap_bucket_list *e) { - b->bucket = NULL; - b->next = b->prev = NULL; + ap_bucket_list *cur = e; + + if (b->tail) { + b->tail->next = e; + e->prev = b->tail; + while (cur->next) { + cur = cur->next; + } + b->tail = cur; + } + else { + b->head = b->tail = e; + } } -APR_EXPORT(void) ap_bucket_brigade_append(ap_bucket_brigade *b, - ap_bucket_list *e) +APR_EXPORT(void) ap_bucket_brigade_append_bucket(ap_bucket_brigade *b, + ap_bucket *r) { - e->next = b->tail; - b->tail->prev = e; - /* This doesn't actually work */ - b->tail = e->next; + if (b->tail) { + if (b->tail->bucket == NULL) { + b->tail->bucket = r; + } + else { + b->tail->next = ap_bucket_list_create(); + b->tail->next->prev = b->tail; + b->tail = b->tail->next; + b->tail->bucket = r; + } + } + else { + b->head = b->tail = ap_bucket_list_create(); + b->tail->bucket = r; + } } APR_EXPORT(int) ap_bucket_brigade_to_iovec(ap_bucket_brigade *b, @@ -316,18 +339,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) } k += i; - /* This really requires an API. Basically we are just adding - * a bucket to a bucket list. - */ - if (b->tail->bucket == NULL) { - b->tail->bucket = r; - } - else { - b->tail->next = ap_bucket_list_create(); - b->tail->next->prev = b->tail; - b->tail = b->tail->next; - b->tail->bucket = r; - } + ap_bucket_brigade_append_bucket(b, r); } return k; @@ -357,19 +369,8 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis r = ap_bucket_new(AP_BUCKET_rwmem); res = ap_rwmem_write(r->data, buf, strlen(buf), &i); + ap_bucket_brigade_append_bucket(b, r); - /* This really requires an API. Basically we are just adding - * a bucket to a bucket list. - */ - if (b->tail->bucket == NULL) { - b->tail->bucket = r; - } - else { - b->tail->next = ap_bucket_list_create(); - b->tail->next->prev = b->tail; - b->tail = b->tail->next; - b->tail->bucket = r; - } return res; } diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index 2301465723f..92802d3b692 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -82,15 +82,15 @@ typedef enum { typedef struct ap_bucket ap_bucket; struct ap_bucket { ap_bucket_color_e color; /* what type of bucket is it */ - void (*free)(void *e); /* never NULL */ + void (*free)(void *e); /* can be NULL */ void *data; /* for use by free() */ }; typedef struct ap_bucket_list ap_bucket_list; struct ap_bucket_list { ap_bucket *bucket; /* The bucket */ - ap_bucket_list *next; /* The start of the bucket list */ - ap_bucket_list *prev; /* The end of the bucket list */ + ap_bucket_list *next; /* The next node in the bucket list */ + ap_bucket_list *prev; /* The prev node in the bucket list */ }; typedef struct ap_bucket_brigade ap_bucket_brigade; @@ -112,9 +112,13 @@ APR_EXPORT(ap_bucket_brigade *) ap_bucket_brigade_create(ap_pool_t *p); /* destroy an enitre bucket brigade */ APR_EXPORT(ap_status_t) ap_bucket_brigade_destroy(void *b); -/* append a bucket_brigade to a bucket_brigade */ -APR_EXPORT(void) ap_bucket_brigade_append(ap_bucket_brigade *b, - ap_bucket_list *e); +/* append a bucket_list to a bucket_brigade */ +APR_EXPORT(void) ap_bucket_brigade_append_list(ap_bucket_brigade *b, + ap_bucket_list *e); + +/* append a bucket to a bucket_brigade */ +APR_EXPORT(void) ap_bucket_brigade_append_bucket(ap_bucket_brigade *b, + ap_bucket *r); /* consume nbytes from beginning of b -- call ap_bucket_destroy as appropriate, and/or modify start on last element */ @@ -150,9 +154,6 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis /* create a new bucket_list */ APR_EXPORT(ap_bucket_list *) ap_bucket_list_create(void); -/* initialize a bucket_list */ -APR_EXPORT(void) ap_bucket_list_init(ap_bucket_list *b); - /* destroy an entire bucket_list */ APR_EXPORT(ap_status_t) ap_destroy_bucket_list(ap_bucket_list *b); From 7b44d87f05ffa2b9335c5dfc39be9a67ebfa9eda Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 13 Jul 2000 16:23:35 +0000 Subject: [PATCH 0385/7878] Remove unnecessary INCDIR1 Submitted by: Dave Hill Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60360 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dso/unix/Makefile.in b/dso/unix/Makefile.in index fed8392b254..1435d0d53ba 100644 --- a/dso/unix/Makefile.in +++ b/dso/unix/Makefile.in @@ -10,7 +10,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. +INCLUDES=-I$(INCDIR) -I. LIB=libdso.a From d7202c338e9091bb60d67868d10a069632898d4a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 13 Jul 2000 16:26:38 +0000 Subject: [PATCH 0386/7878] Apache doesn't actually check for stdarg.h, but APR does. Just use the APR defined APR_HAVE_STDARG_H to check for the existance of stdarg.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60361 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_filter.h | 2 +- buckets/apr_buf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buckets/ap_filter.h b/buckets/ap_filter.h index 3ab38e5190d..747e810a10f 100644 --- a/buckets/ap_filter.h +++ b/buckets/ap_filter.h @@ -59,7 +59,7 @@ extern "C" { #endif -#ifdef HAVE_STDARG_H +#ifdef APR_HAVE_STDARG_H #include #endif diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index 92802d3b692..d4ec87c5c35 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -62,7 +62,7 @@ #ifdef HAVE_SYS_UIO_H #include /* for struct iovec */ #endif -#ifdef HAVE_STDARG_H +#ifdef APR_HAVE_STDARG_H #include #endif From 6eb4bd3232001d96b4861f903842352153e1a8b8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 13 Jul 2000 16:37:06 +0000 Subject: [PATCH 0387/7878] Update the patch to work since buckets were removed from the build process. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60362 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ryan.patch | 88 +++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 55 deletions(-) diff --git a/buckets/ryan.patch b/buckets/ryan.patch index 541ebca6d4e..13d75c60c24 100644 --- a/buckets/ryan.patch +++ b/buckets/ryan.patch @@ -2,33 +2,16 @@ ? build.err ? .inslog2 ? include/util_filter.h -? lib/apr/build.log -? lib/apr/build.err +? lib/apr/include/apr_buf.h ? lib/apr/shmem/config.cache ? main/util_filter.c -Index: configure.in -=================================================================== -RCS file: /home/cvs/apache-2.0/src/configure.in,v -retrieving revision 1.72 -diff -u -d -b -w -u -r1.72 configure.in ---- configure.in 2000/07/01 14:08:21 1.72 -+++ configure.in 2000/07/12 23:26:38 -@@ -78,7 +78,7 @@ - netdb.h \ - pwd.h \ - grp.h \ --strings.h -+strings.h \ - ) - AC_HEADER_SYS_WAIT - Index: ap/Makefile.in =================================================================== RCS file: /home/cvs/apache-2.0/src/ap/Makefile.in,v retrieving revision 1.4 diff -u -d -b -w -u -r1.4 Makefile.in --- ap/Makefile.in 2000/06/12 20:41:13 1.4 -+++ ap/Makefile.in 2000/07/12 23:26:38 ++++ ap/Makefile.in 2000/07/13 16:30:51 @@ -1,5 +1,5 @@ LTLIBRARY_NAME = libap.la @@ -42,7 +25,7 @@ RCS file: /home/cvs/apache-2.0/src/include/ap_iol.h,v retrieving revision 1.19 diff -u -d -b -w -u -r1.19 ap_iol.h --- include/ap_iol.h 2000/05/29 04:22:02 1.19 -+++ include/ap_iol.h 2000/07/12 23:26:39 ++++ include/ap_iol.h 2000/07/13 16:30:52 @@ -58,6 +58,7 @@ #define AP_IOL_H @@ -51,29 +34,13 @@ diff -u -d -b -w -u -r1.19 ap_iol.h #include "apr_errno.h" /* For ap_status_t and the APR_errnos */ typedef struct ap_iol ap_iol; -Index: include/buff.h -=================================================================== -RCS file: /home/cvs/apache-2.0/src/include/buff.h,v -retrieving revision 1.30 -diff -u -d -b -w -u -r1.30 buff.h ---- include/buff.h 2000/06/29 14:34:24 1.30 -+++ include/buff.h 2000/07/12 23:26:39 -@@ -63,7 +63,7 @@ - extern "C" { - #endif - --#ifdef HAVE_STDARG_H -+#ifdef APR_HAVE_STDARG_H - #include - #endif - #include "ap.h" Index: include/http_protocol.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/http_protocol.h,v retrieving revision 1.19 diff -u -d -b -w -u -r1.19 http_protocol.h --- include/http_protocol.h 2000/07/11 03:48:17 1.19 -+++ include/http_protocol.h 2000/07/12 23:26:39 ++++ include/http_protocol.h 2000/07/13 16:30:52 @@ -89,8 +89,15 @@ API_EXPORT(void) ap_basic_http_header(request_rec *r); @@ -97,7 +64,7 @@ RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v retrieving revision 1.64 diff -u -d -b -w -u -r1.64 httpd.h --- include/httpd.h 2000/06/30 21:18:13 1.64 -+++ include/httpd.h 2000/07/12 23:26:39 ++++ include/httpd.h 2000/07/13 16:30:52 @@ -596,6 +596,11 @@ * pointer back to the main request. */ @@ -110,13 +77,31 @@ diff -u -d -b -w -u -r1.64 httpd.h /* Info about the request itself... we begin with stuff that only * protocol.c should ever touch... */ +Index: lib/apr/configure.in +=================================================================== +RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v +retrieving revision 1.133 +diff -u -d -b -w -u -r1.133 configure.in +--- lib/apr/configure.in 2000/07/13 03:41:04 1.133 ++++ lib/apr/configure.in 2000/07/13 16:30:52 +@@ -678,8 +678,8 @@ + AC_SUBST(EXEEXT) + + echo "Construct Makefiles and header files." +-MAKEFILE1="Makefile lib/Makefile " +-SUBDIRS="lib " ++MAKEFILE1="Makefile lib/Makefile buckets/Makefile" ++SUBDIRS="lib buckets" + for dir in $MODULES + do + test -d $dir || $MKDIR -p $dir Index: main/Makefile.in =================================================================== RCS file: /home/cvs/apache-2.0/src/main/Makefile.in,v retrieving revision 1.16 diff -u -d -b -w -u -r1.16 Makefile.in --- main/Makefile.in 2000/07/01 14:14:15 1.16 -+++ main/Makefile.in 2000/07/12 23:26:48 ++++ main/Makefile.in 2000/07/13 16:31:02 @@ -8,7 +8,7 @@ http_protocol.c http_request.c http_vhost.c util.c util_date.c \ util_script.c util_uri.c util_md5.c util_cfgtree.c util_ebcdic.c \ @@ -132,7 +117,7 @@ RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v retrieving revision 1.88 diff -u -d -b -w -u -r1.88 http_core.c --- main/http_core.c 2000/07/11 03:48:18 1.88 -+++ main/http_core.c 2000/07/12 23:26:48 ++++ main/http_core.c 2000/07/13 16:31:03 @@ -71,6 +71,8 @@ #include "util_md5.h" #include "apr_fnmatch.h" @@ -229,10 +214,10 @@ diff -u -d -b -w -u -r1.88 http_core.c Index: main/http_protocol.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v -retrieving revision 1.95 -diff -u -d -b -w -u -r1.95 http_protocol.c ---- main/http_protocol.c 2000/07/11 03:48:18 1.95 -+++ main/http_protocol.c 2000/07/12 23:26:49 +retrieving revision 1.96 +diff -u -d -b -w -u -r1.96 http_protocol.c +--- main/http_protocol.c 2000/07/13 16:26:42 1.96 ++++ main/http_protocol.c 2000/07/13 16:31:03 @@ -64,6 +64,8 @@ */ @@ -279,7 +264,7 @@ diff -u -d -b -w -u -r1.95 http_protocol.c while (!r->connection->aborted && offset < length) { if (length - offset > MMAP_SEGMENT_SIZE) { n = MMAP_SEGMENT_SIZE; -@@ -2467,76 +2477,142 @@ +@@ -2467,76 +2477,137 @@ total_bytes_sent += w; offset += w; } @@ -292,7 +277,6 @@ diff -u -d -b -w -u -r1.95 http_protocol.c + */ + bb = ap_bucket_brigade_create(r->pool); + bb->head = bb->tail = ap_bucket_list_create(); -+ ap_bucket_list_init(bb->head); + b = ap_bucket_new(AP_BUCKET_mmap); + ap_mmap_bucket_insert((ap_bucket_mmap *)b->data, mm); + bb->head->bucket = b; @@ -328,7 +312,6 @@ diff -u -d -b -w -u -r1.95 http_protocol.c + */ + bb = ap_bucket_brigade_create(r->pool); + bb->head = bb->tail = ap_bucket_list_create(); -+ ap_bucket_list_init(bb->head); + b = ap_bucket_new(AP_BUCKET_rwmem); + ap_rwmem_write(b->data, &c, 1, &written); + bb->head->bucket = b; @@ -366,7 +349,6 @@ diff -u -d -b -w -u -r1.95 http_protocol.c + */ + bb = ap_bucket_brigade_create(r->pool); + bb->head = bb->tail = ap_bucket_list_create(); -+ ap_bucket_list_init(bb->head); + b = ap_bucket_new(AP_BUCKET_rwmem); + ap_rwmem_write(b->data, str, strlen(str), &written); + bb->head->bucket = b; @@ -406,7 +388,6 @@ diff -u -d -b -w -u -r1.95 http_protocol.c + */ + bb = ap_bucket_brigade_create(r->pool); + bb->head = bb->tail = ap_bucket_list_create(); -+ ap_bucket_list_init(bb->head); + b = ap_bucket_new(AP_BUCKET_rwmem); + ap_rwmem_write(b->data, buf, nbyte, &written); + bb->head->bucket = b; @@ -442,7 +423,6 @@ diff -u -d -b -w -u -r1.95 http_protocol.c + */ + bb = ap_bucket_brigade_create(r->pool); + bb->head = bb->tail = ap_bucket_list_create(); -+ ap_bucket_list_init(bb->head); + written = ap_brigade_vprintf(bb, fmt, va); + ap_pass_brigade(r, f, bb); + return written; @@ -454,7 +434,7 @@ diff -u -d -b -w -u -r1.95 http_protocol.c API_EXPORT_NONSTD(int) ap_rprintf(request_rec *r, const char *fmt, ...) { va_list va; -@@ -2546,46 +2622,62 @@ +@@ -2546,46 +2617,60 @@ return EOF; va_start(va, fmt); @@ -492,7 +472,6 @@ diff -u -d -b -w -u -r1.95 http_protocol.c + */ + bb = ap_bucket_brigade_create(r->pool); + bb->head = bb->tail = ap_bucket_list_create(); -+ ap_bucket_list_init(bb->head); va_start(va, r); - n = ap_vbputstrs(r->connection->client, va); + written = ap_brigade_vputstrs(bb, va); @@ -531,7 +510,6 @@ diff -u -d -b -w -u -r1.95 http_protocol.c + */ + bb = ap_bucket_brigade_create(r->pool); + bb->head = bb->tail = ap_bucket_list_create(); -+ ap_bucket_list_init(bb->head); + b = ap_bucket_new(AP_BUCKET_eos); + bb->head->bucket = b; + ap_pass_brigade(r, f, bb); @@ -544,7 +522,7 @@ RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v retrieving revision 1.35 diff -u -d -b -w -u -r1.35 http_request.c --- main/http_request.c 2000/06/24 17:33:57 1.35 -+++ main/http_request.c 2000/07/12 23:26:49 ++++ main/http_request.c 2000/07/13 16:31:03 @@ -1263,6 +1263,12 @@ return; } @@ -564,7 +542,7 @@ RCS file: /home/cvs/apache-2.0/src/modules/mpm/config.m4,v retrieving revision 1.23 diff -u -d -b -w -u -r1.23 config.m4 --- modules/mpm/config.m4 2000/07/11 19:00:16 1.23 -+++ modules/mpm/config.m4 2000/07/12 23:26:51 ++++ modules/mpm/config.m4 2000/07/13 16:31:05 @@ -3,7 +3,6 @@ [ --with-mpm=MPM Choose the process model for Apache to use. MPM={dexter,mpmt_beos,mpmt_pthread,prefork,spmt_os2}],[ From 9bed9be152f19f8ae5047660773b07b47fa99329 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Thu, 13 Jul 2000 20:58:47 +0000 Subject: [PATCH 0388/7878] fix deletion: it didn't decrement the count of items in the hash git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60363 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_hash.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/apr_hash.c b/lib/apr_hash.c index c9da1ce7cfa..cae1434400e 100644 --- a/lib/apr_hash.c +++ b/lib/apr_hash.c @@ -276,6 +276,7 @@ APR_EXPORT(void) ap_hash_set(ap_hash_t *ht, if (!val) { /* delete entry */ *hep = (*hep)->next; + --ht->count; } else { /* replace entry */ From 9909a7bf4f467d332971c69793dd0c8a1f35d988 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 13 Jul 2000 21:22:25 +0000 Subject: [PATCH 0389/7878] More discussion of stacked io with cached objects git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60364 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/doc_stacked_io.txt | 501 +++++++++++++++++++++++++++++++++++++ 1 file changed, 501 insertions(+) diff --git a/buckets/doc_stacked_io.txt b/buckets/doc_stacked_io.txt index 8adfa8c864d..9d2ac9ee84e 100644 --- a/buckets/doc_stacked_io.txt +++ b/buckets/doc_stacked_io.txt @@ -554,6 +554,507 @@ use. You see, I'm envisioning a bottom layer which pulls data out of a database rather than reading from a file.] +************************************************************** +************************************************************** +Date: Wed, 9 Sep 1998 18:55:40 -0700 (PDT) +From: Alexei Kosut +To: new-httpd@apache.org +Subject: A Magic Cache example +Message-ID: + +During the drive home, I came up with a good example of how I envision the +new module/cache/layer model thingy working. Comments please: + +The middle end of the server is responsible for taking the request the +front end gives it and somehow telling the back end how to fulfill it. I +look at it like this: The request is a URI (Uniform Resource Identifier) +and a set of request dimensions (the request headers, the remote IP +address, the time of day, etc...). The middle end, via its configuration, +translates this into a request for content from a backing store module, +plus possibly some filter modules. Since the term "filename" is too +flat-file specific, let's call the parameter we pass to the backing store +a SRI (Specific Resource Identifier), in a format specific to that module. + +Our example is similar to the one I was using earlier, with some +additions: The request is for a URI, say "/skzb/teckla.html". The response +is a lookup from a (slow) database. The URI maps to the mod_database SRI +of "BOOK:0-441-7997-9" (I made that format up). We want to take that +output and convert it from whatever charset it's in into Unicode. We then +have a PHP script that works on a Unicode document and does things based +on whether the browser is Netscape or not. Then we translate the document +to the best charset that matches the characters used and the client's +capabilities and send it. + +So upon request for /skzb/teckla.html, the middle end translates the +request into the following "equation": + + SRI: mod_database("BOOK:0-441-7997-9") + + filter: mod_charset("Unicode") + + filter: mod_php() + + fllter: mod_charset("best_fit") + ------------------------------------------------- + URI: /skzb/teckla.html + +It then constructs a stack of IO (NSPR) filters like this: + +mod_database -> cache-write -> mod_charset -> cache-write -> mod_php -> +cache_write -> mod_charset -> cache-write -> client + +And sets it to running. Each of the cache filters is a write-through +filter that copies its data into the cache with a tag based on what +equation the middle end uses to get to it, plus the request dimensions it +uses (info it gets from the modules). + +The database access is stored under "SRI: mod_database(BOOK:0-441-79977-9" +with no dimensions (because it's the same for all requests). The first +charset manipulation is stored under "SRI: mod_database(BOOK...) + filter: +mod_charset(Unicode)", again with no dimensions. The PHP output is stored +under "SRI: mod_database(BOOK...) + filter: mod_charset(Unicode) + filter: +mod_php()" with dimesions of (User-Agent). The final output is stored both +as "SRI: mod_database(BOOK...) + filter: mod_charset(Unicode) + filter: +mod_php() + filter: mod_charset(best_fit)" and "URI: /skzb/teckla.html" +(they're the same thing), both with dimensions of (User-Agent, +Accept-Charset). + +So far so good. Now, when another request for /skzb/teckla.html comes in, +the cache is consulted to see how much we can use. First, the URI is +looked up. This can be done by a kernel or other streamlined part of the +server. So "URI: /skzb/teckla.html" is looked up, and one entry pops out +with dimensions of (User-Agent, Accept-Charset). The user-agent and +accept-charset of the request are compared against the ones of the stored +entiry(ies). If one matches, it can be sent directly. + +If not, the server proceeds to look up "SRI: mod_database(BOOK...) + +filter: mod_charset(Unicode) + filter: mod_php()". If the request has a +different accept-charset, but the same user-agent, then this can be +reprocessed by mod_charset and used. Otherwise, the server proceeds back +to "SRI: mod_database(BOOK...) + filter: mod_charset(Unicode)", which will +match any request. There's probably some sort of cache invalidation +(expires, etc...) that happens eventually to result in a new database +lookup, but mostly, that very costly operation is avoided. + +I think I've made it out to be a bit more complicated than it is, with the +long equation strings mixed in there. But the above reflects my +understanding of how the new Apache 2.0 system should work. + +Note 1: The cache is smarter than I make it out here when it comes to +adding new entries. It should realize that, since the translation to +Unicode doesn't change or restrict the dimensions of the request, it +really is pointless to cache the original database lookup, since it will +always be translated in exactly the same manner. Knowing this, it will +only cache the Unicode version. + +Note 2: PHP probably doesn't work with Unicode. And there may not be a way +to identify a script as only acting on the User-Agent dimension. That's +not the point. + +Note 3: Ten bonus points to anyone who's read this far, and is the first +person to answer today's trivia question: What does the skzb referred to +in the example URI stand for? There's enough information in this mail to +figure it out (with some help from the Net), even if you don't know +offhand (though if you do, I'd be happier). + +-- Alexei Kosut + Stanford University, Class of 2001 * Apache * + + +************************************************************** +Message-ID: <19980922224326.A16219@aisa.fi.muni.cz> +Date: Tue, 22 Sep 1998 22:43:26 +0200 +From: Honza Pazdziora +To: new-httpd@apache.org +Subject: Re: I/O Layering in next version of Apache. +References: <19980922111627.19784.qmail@hyperreal.org> <3607D53A.1FF6D93@algroup.co.uk> <13831.55021.929560.977122@zap.ml.org> +In-Reply-To: <13831.55021.929560.977122@zap.ml.org>; from Ben Hyde on Tue, Sep 22, 1998 at 01:04:12PM -0400 + +> >Does anyone have a starting point for layered I/O? I know we kicked it + +Hello, + +there has been a thread on modperl mailing list recently about +problems we have with the current architecture. Some of the points +were: what requerements will be put on modules to be new I/O +compliant. I believe it's the Apache::SSI vs. Apache::SSIChain +difference between 1.3.* and 2.*. The first fetches the file _and_ +does the SSI, the second takes input from a different module that +either gets the HTML or runs the CGI or so, and processes its output. +Should all modules be capable of working on some other module's +output? Probably except those that actually go to disk or database for +the primary data. + +Randal's point was that output of any module could be processed, so +that no module should make any assumption whether it's sending data +directly to the browser or to some other module. This can be used both +for caching, but it also one of the things to get the filtering +transparent. + +Also, as Apache::GzipChain module shows, once you process the output, +you may need to modify the headers as well. I was hit by this when I +tried to convert between charsets, to send out those that the browsers +would understand. The Apache::Mason module shows that you can build +a page from pieces. Each of the pieces might have different +characteristics (charset, for example), so with each piece of code we +might need to have its own headers that describe it, or at least the +difference between the final (global) header-outs and its local. + +Sorry for bringing so much Perl module names in, but modperl is +currently a way to get some layered I/O done in 1.3.*, so I only have +practical experiance with it. + +Yours, + +------------------------------------------------------------------------ + Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/ + I can take or leave it if I please +------------------------------------------------------------------------ + +************************************************************** +Date: Wed, 23 Sep 1998 10:46:47 -0700 (PDT) +From: Dean Gaudet +To: new-httpd@apache.org +Subject: Re: I/O Layering in next version of Apache. +In-Reply-To: <36092F2D.BCC4E5C1@algroup.co.uk> +Message-ID: + +On Wed, 23 Sep 1998, Ben Laurie wrote: + +> Dean Gaudet wrote: +> > +> > On Wed, 23 Sep 1998, Ben Laurie wrote: +> > +> > > Is the simplest model that accomodates this actually just a stack +> > > (tree?) of webservers? Naturally, we wouldn't talk HTTP between the +> > > layers, but pass (header,content) pairs around (effectively). +> > > Interesting. +> > +> > We could just talk "compiled" HTTP -- using a parsed representation of +> > everything essentially. +> +> That's pretty much what I had in mind - but does it make sense? I have +> to admit, it makes a certain amount of sense to me, but I still have +> this nagging suspicion that there's a catch. + +We talked about this during the developers meeting earlier this summer... +while we were hiking, so I don't think there were any notes. + +I think it'd be a useful exercise to specify a few example applications we +want to be able to support, and then consider methods of implementing +those applications. Make the set as diverse and small as possible. I'll +take the easiest one :) + +- serve static content from arbitrary backing store (e.g. file, database) + +Once we flesh such a list out it may be easier to consider implementation +variations... + +I think it was Cliff who said it this way: in a multiple layer setup he +wants to be able to partition the layers across servers in an arbtrary +manner. For example, a proxy cache on one box which the world talks to, +and which backends to various other boxes for dynamic and static content. +Or maybe the static content is on the same server as the proxy. If this is +something we want to support then talking (a restricted form of) HTTP +between layers is interesting. + +Now we can all start worrying about performance ;) + +Dean + + +************************************************************** +Date: Wed, 23 Sep 1998 11:23:30 -0700 (PDT) +From: Alexei Kosut +To: new-httpd@apache.org +Subject: Re: I/O Layering in next version of Apache. +In-Reply-To: <36092F2D.BCC4E5C1@algroup.co.uk> +Message-ID: + +On Wed, 23 Sep 1998, Ben Laurie wrote: + +> > We could just talk "compiled" HTTP -- using a parsed representation of +> > everything essentially. +> +> That's pretty much what I had in mind - but does it make sense? I have +> to admit, it makes a certain amount of sense to me, but I still have +> this nagging suspicion that there's a catch. + +One important thing to note is that we want this server to be able to +handle non-HTTP requests. So using HTTP as the internal language (as we do +now) is not the way to go. What we talked about in SF was using a basic +set of key/value pairs to represent the metadata of the response. Which +would of course bear an uncanny resemblance to HTTP-style MIME headers... + +Certainly, and this is the point I think the originator of this thread +raised, each module layer (see the emails I sent a few weeks ago for more +details on how I see *that*) needs to provide both a content filter and a +metadata filter. Certainly a module that does encoding has to be able to +alter the headers to add a Content-Encoding, Transfer-Encoding, TE, or +what have you. Many module that does anything to the content will +want to add headers, and many others will need to alter the dimensions on +which the request is served, or what the parameters to those dimensions +are for the current request. The latter is absolutely vital for cacheing. + +The problem, as I see it, is this: Often, I suspect it will be the case +that the module does not know what metadata it will be altering (and how) +until after it has processed the request. i.e., a PHP script may not +discover what dimensions it uses (as we discussed earlier) until after it +has parsed the entire script. But if the module is functioning as an +in-place filter, that can cause massive headaches if we need the metadata +in a complete form *before* we sent the entity, as we do for HTTP. + +I'm not quite sure how to solve that problem. Anyone have any brilliant +ideas? + +(Note that for internal caching, we don't actually need the dimension data +until after the request, because we can alter the state of the cache at +any time, but if we want to place nice with HTTP and send Vary: headers +and such, we do need that information. I guess we could send Vary: +footers...) + +-- Alexei Kosut + Stanford University, Class of 2001 * Apache * + + +************************************************************** +Date: 23 Sep 1998 20:26:58 -0000 +Message-ID: <19980923202658.25736.qmail@zap.ml.org> +From: Ben Hyde +To: new-httpd@apache.org +Subject: Stacking up Response Handling +In-Reply-To: +References: <36092F2D.BCC4E5C1@algroup.co.uk> + + +Alexei Kosut writes: +>The problem, as I see it, is this: Often, I suspect it will be the case +>that the module does not know what metadata it will be altering (and how) +>until after it has processed the request. i.e., a PHP script may not +>discover what dimensions it uses (as we discussed earlier) until after it +>has parsed the entire script. But if the module is functioning as an +>in-place filter, that can cause massive headaches if we need the metadata +>in a complete form *before* we sent the entity, as we do for HTTP. +> +>I'm not quite sure how to solve that problem. Anyone have any brilliant +>ideas? + +This is the same as building a layout engine that incremental layout +but simpler since I doubt we'd want to allow for reflow. + +Sometimes you can send output right along, sometimes you have to wait. +I visualize the output as a tree/outline and as it is swept out a +stack holds the path to the leave. Handlers for the individual nodes +wait or proceed depending on if they can. + +It's pretty design with the pipeline consisting of this stack of +output transformers/generators. Each pipeline stage accepts a stream +of output_chunks. I think of these output_chunks as coming in plenty +of flavors, for example transmit_file, transmit_memory, etc. Some +pipeline stages might handle very symbolic chunks. For example +transmit_xml_tree might be handed to transform_xml_to_html stage in +the pipeline. + +I'm assuming the core server would have only a few kinds of pipeline +nodes, generate_response, generate_content_from_url_via_file_system, +generate_via_classic_module_api. Things like convert_char_set or +do_cool_transfer_encoding, could easily be loaded at runtime and +authored outside the core. That would be nice. + +For typical fast responses we wouldn't push much on this stack at +all. It might go something like this: Push generate_response node, +it selects an appropriate content generator by consulting the +module community and pushes that. Often this is +generate_content_from_url_via_file_system which in turn does +all that ugly mapping to a file name and then passes +transmit_file down the pipeline and pops it's self off the stack. +generate_response once back on top again does the transmit and +pops off. + +For rich complex output generation we might push all kinds of things +(charset converters, transfer encoders, XML -> HTML rewriters, cache +builders, old style apache module API simulators, what ever). + +The intra-stack element protocol get's interesting around issues +like error handling, blocking, etc. + +I particularly like how this allows simulation of the old module API, +as well as the API of other servers, and experimenting with other +module API which cross process or machine boundaries. + +In many ways this isn't that much different from what was proposed +a year ago. + + - ben + +************************************************************** +From: Ben Hyde +Date: Wed, 23 Sep 1998 21:58:54 -0400 (EDT) +To: new-httpd@apache.org +Subject: Re: Core server caching +In-Reply-To: +References: <19980923210119.25763.qmail@zap.ml.org> + +Message-ID: <13833.39467.942203.885143@zap.ml.org> + +Alexei Kosut writes: +>On 23 Sep 1998, Ben Hyde wrote: +> +>> The core problem of caching seems to me to get confused by the +>> complexity of designing a caching proxy. If one ignores that then the +>> core problem of caching seems quite simple. +> +>Actually, for an HTTP server, they're the same problem, if you want to be +>able to cache any sort of dynamic request. And caching static requests is +>kind of silly (Dean's flow stuff notwithstanding, making copies of static +>files in either memory or on disk is silly, since the OS can do it better +>than we can). + +I don't disagree with any of the things you said, so I guess I'm +failing to get across where in this structure the functions your +pointing out as necessary would reside as versus where the "chunk +cache" mechanism I'm yearning for would fit. + +Well, that's not entirely true I do feel it's helpful to make this +point. + +The HTTP spec's definition of proper caching is terribly constrained +by the poverty of information available to the proxy server. He is +trapped in the middle between an opinionated content provider and an +opinionated content consumer. It was written in an attempt to keep +people like AOL from making their opinions dominate either of those +other two. Proper caching by a server that is right next to the +content generation can and ought to include both more or less +heuristics that are tunable by the opinions of the content provider +who presumably we are right next to. + +Imagine the server that has a loop that goes like so: + + loop + r<-swallow_incomming_request + h<-select_response_handler(r) + initialize_response_pipeline() + push_pipeline_element(h) + tend_pipeline_until_done() + end loop + +In most of the web based applications I've seen the +select_response_handler step evolves into something that looks like an +AI expert system. That said, what I'd like to see is in Apache2 is a +simple dispatch along with a way to plug-in more complex dispatching +mechanisms. I'd very much like to avoid having that get confused with +the suite of response_handlers. + +I ignored the complexity of when to you can safely select +a cached value because I think it's in the select_response_handler +step. And possibly, I'll admit, not part of what I called the +"core server" + +Clearly I'm a fool for using this term 'core server' since it +doesn't mean anything. I wanted it to mean that loop above +and the most minimal implementations for the pipeline and +the select_response_handler one could imagine before starting +to pile on. The server as shipped would have a lot more +stuff in it! + +What I'm focused on is what has to be in that core versus +what has to be, but can be outside of it. + +So. as i thought about the state of the pipeline just after +the call on initialize_response_pipeline I at first thought +it would have something much like the current buffer abstraction +in the pipeline. Then i got to wondering if transfer encoding, +charset conversion, or caching ought to be in there. + +I think there is an argument for putting some caching functionality +in there. Possibly because that entire knot is what you'd move +into the OS if you could. Possibly because this is the bit +that must fly. + +Recall that I think the pipeline takes a stream of response +chunks with things like memory_chunk, transfer_file_chunk, etc. +in that stream. The question is what flavors of chunks does +that bottom element in the pipeline take. It's the chunks +that fly (and nothing more?). So I got to thinking about +what does it mean to have a cached_chunk. + +A cached_chunk needs only the small operation set along +the lines of what I mentioned. A full caching scheme +can build on it. As an added benefit the caching scheme +can be dumb, standard, extremely witty without effecting +this portion of the design. + +A quick point about why I wanted the cache to handle things +smaller than entire responses. This isn't central I guess. + +I want a protocol with content generators that encourages +them to use dynamic programming tricks to quickly generate +portions of pages that are static over long periods. Such +a scheme has worked well in systems we've built. + + - ben hyde + +************************************************************** +From: Ben Hyde +Date: Thu, 29 Oct 1998 23:16:37 -0500 (EST) +To: new-httpd@apache.org +Subject: Re: Core server caching +In-Reply-To: +References: + +Message-ID: <13881.12903.661334.819447@zap.ml.org> + +Dean Gaudet writes: +>On Thu, 29 Oct 1998, Rasmus Lerdorf wrote: +> +>> There are also weird and wacky things you would be able to do if you could +>> stack mod_php on top of mod_perl. +> +>You people scare me. +> +>Isn't that redundant though? +> +>Dean + +Yes it's scary, but oddly erotic, when these behemoths with their +gigantic interpreters try to mate. + +It's interesting syndrome, systems as soon as they get an interpreter +they tend to loose their bearings and grow into vast behemoths that +lumber about slowly crushing little problems with their vast mass. +Turing syndrome? + +I've heard people say modules can help avoid this, but I've rarely +seen it. Olde Unix kinda manages it remember being frightened by +awk. + +Can we nudge alloc.c/buff.c toward a bit of connective glue that +continues to let individual modules evolve their own gigantism while +avoiding vile effects on the core performance of the server? Stuff +like this: + + memory chunk alignment for optimal I/O + memory hand off along the pipeline + memory hand off crossing pool boundaries + memory hand off in zero copy cases + transmit file + transmit cache elements + insert/remove cache elements + leverage unique hardware and instructions + +That memcpy in ap_bread really bugs me. + +I'd be rather have routines that let me handoff chunks. Presumably +these would need to be able to move chunks across pool and buffer +boundaries. But zero copy if I don't touch the content and never a +memcpy just to let my lex the input. + +I've built systems like this with the buffers exposing a emacs +buffer style of abstraction, but with special kinds of marks +to denote what's released for sending, and what's been accepted +and lex'd on the input side. It does create mean all your +lexical and printf stuff has to be able to smoothly slide +over chunk boundaries. + + - ben + ************************************************************************* Date: Sun, 27 Dec 1998 13:08:22 -0800 (PST) From: Ed Korthof From d370559e523b1e2e85813fe0ea3578b8092f4a91 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 13 Jul 2000 21:48:34 +0000 Subject: [PATCH 0390/7878] Update the bucket brigades to be a bit less complex. This makes the functions get_str and get_len function pointers inside the bucket itself. This is the first step in cleaning these up just a bit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60365 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 60 ++++++----------------------- buckets/ap_eos_buf.c | 86 ++++++++++++++++++++++++++++++++++++++++++ buckets/ap_mmap_buf.c | 31 ++++++++++----- buckets/ap_rmem_buf.c | 30 +++++++++++---- buckets/ap_rwmem_buf.c | 43 +++++++++++++-------- buckets/apr_buf.h | 45 +++++++--------------- 6 files changed, 183 insertions(+), 112 deletions(-) create mode 100644 buckets/ap_eos_buf.c diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 7bc4d9f45ea..9bdb88dd0fc 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -68,38 +68,28 @@ APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color) { /* TODO: keep a free list of ap_bufels... and allocate them in big chunks */ - ap_bucket *newbuf; - newbuf = malloc(sizeof(*newbuf)); - newbuf->color = color; switch (color) { case AP_BUCKET_rwmem: - newbuf->data = ap_rwmem_create(); - newbuf->free = ap_rwmem_destroy; - break; + return ap_rwmem_create(); case AP_BUCKET_mmap: - newbuf->data = ap_mmap_bucket_create(); - newbuf->free = NULL; - break; + return ap_mmap_bucket_create(); case AP_BUCKET_rmem: - newbuf->data = ap_rmem_create(); - newbuf->free = NULL; - break; + return ap_rmem_create(); case AP_BUCKET_eos: - newbuf->data = NULL; - newbuf->free = NULL; + return ap_eos_create(); case AP_BUCKET_file: case AP_BUCKET_filename: case AP_BUCKET_cached_entity: case AP_BUCKET_URI: /* not implemented yet */ - break; + return NULL; } - return newbuf; + return NULL; } APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e) { - if (e->free != NULL) { + if (e->free) { e->free(e); } free(e); @@ -263,45 +253,17 @@ APR_EXPORT(ap_status_t) ap_destroy_bucket_list(ap_bucket_list *buf) APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b) { - switch (b->color) { - case AP_BUCKET_rwmem: - return ap_rwmem_get_char_str(b->data); - case AP_BUCKET_mmap: - return ap_mmap_get_char_str(b->data); - case AP_BUCKET_rmem: - return ap_rmem_get_char_str(b->data); - case AP_BUCKET_eos: - return NULL; - case AP_BUCKET_file: - case AP_BUCKET_filename: - case AP_BUCKET_cached_entity: - case AP_BUCKET_URI: - /* not implemented yet */ - return NULL; + if (b) { + return b->getstr(b); } - /* We should NEVER actually get here */ return NULL; } APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b) { - switch (b->color) { - case AP_BUCKET_rwmem: - return ap_rwmem_get_len(b->data); - case AP_BUCKET_mmap: - return ap_mmap_get_len(b->data); - case AP_BUCKET_rmem: - return ap_rmem_get_len(b->data); - case AP_BUCKET_eos: - return 0; - case AP_BUCKET_file: - case AP_BUCKET_filename: - case AP_BUCKET_cached_entity: - case AP_BUCKET_URI: - /* not implemented yet */ - return 0; + if (b) { + return b->getlen(b); } - /* We should NEVER actually get here */ return 0; } diff --git a/buckets/ap_eos_buf.c b/buckets/ap_eos_buf.c new file mode 100644 index 00000000000..3b53feb2282 --- /dev/null +++ b/buckets/ap_eos_buf.c @@ -0,0 +1,86 @@ +/* ==================================================================== + * Copyright (c) 1996-1999 The Apache Group. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Group" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Group and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Group and the Apache HTTP server + * project, please see . + * + */ + +#include "apr_private.h" +#include "apr_buf.h" +#include + +static const char * eos_get_str(ap_bucket *e) +{ + return NULL; +} + +static int eos_get_len(ap_bucket *e) +{ + return 0; +} + +APR_EXPORT(ap_bucket *) ap_eos_create(void) +{ + ap_bucket *newbuf; + + newbuf = malloc(sizeof(*newbuf)); + + newbuf->color = AP_BUCKET_eos; + newbuf->getstr = eos_get_str; + newbuf->getlen = eos_get_len; + newbuf->free = NULL; + newbuf->data = NULL; + + return newbuf; +} + diff --git a/buckets/ap_mmap_buf.c b/buckets/ap_mmap_buf.c index 895b37032c5..c2ba6f1fc80 100644 --- a/buckets/ap_mmap_buf.c +++ b/buckets/ap_mmap_buf.c @@ -59,22 +59,35 @@ #include "apr_buf.h" #include -APR_EXPORT(ap_bucket_mmap *) ap_mmap_bucket_create(void) +static const char * mmap_get_str(ap_bucket *e) { - ap_bucket_mmap *newbuf; - newbuf = malloc(sizeof(*newbuf)); - newbuf->data = NULL; - return newbuf; + ap_bucket_mmap *b = (ap_bucket_mmap *)e->data; + return b->data->mm; } -APR_EXPORT(char *) ap_mmap_get_char_str(ap_bucket_mmap *b) +static int mmap_get_len(ap_bucket *e) { - return b->data->mm; + ap_bucket_mmap *b = (ap_bucket_mmap *)e->data; + return b->data->size; } -APR_EXPORT(int) ap_mmap_get_len(ap_bucket_mmap *b) +APR_EXPORT(ap_bucket *) ap_mmap_bucket_create(void) { - return b->data->size; + ap_bucket *newbuf; + ap_bucket_mmap *b; + + newbuf = malloc(sizeof(*newbuf)); + b = malloc(sizeof(*b)); + + b->data = NULL; + + newbuf->color = AP_BUCKET_mmap; + newbuf->getstr = mmap_get_str; + newbuf->getlen = mmap_get_len; + newbuf->free = NULL; + newbuf->data = b; + + return newbuf; } APR_EXPORT(void) ap_mmap_bucket_insert(ap_bucket_mmap *b, ap_mmap_t *mm) diff --git a/buckets/ap_rmem_buf.c b/buckets/ap_rmem_buf.c index 55e871f3d88..985d2efb549 100644 --- a/buckets/ap_rmem_buf.c +++ b/buckets/ap_rmem_buf.c @@ -63,21 +63,35 @@ #define DEFAULT_RWBUF_SIZE (4096) #endif -APR_EXPORT(ap_bucket_rmem *) ap_rmem_create(void) +static const char * rmem_get_str(ap_bucket *e) { - ap_bucket_rmem *newbuf; - newbuf = calloc(1, sizeof(*newbuf)); - return newbuf; + ap_bucket_rmem *b = (ap_bucket_rmem *)e->data; + return b->start; } -APR_EXPORT(const char *) ap_rmem_get_char_str(ap_bucket_rmem *b) +static int rmem_get_len(ap_bucket *e) { - return b->start; + ap_bucket_rmem *b = (ap_bucket_rmem *)e->data; + return (char *)b->end - (char *)b->start; } -APR_EXPORT(int) ap_rmem_get_len(ap_bucket_rmem *b) +APR_EXPORT(ap_bucket *) ap_rmem_create(void) { - return (char *)b->end - (char *)b->start; + ap_bucket *newbuf; + ap_bucket_rmem *b; + + newbuf = malloc(sizeof(*newbuf)); + b = malloc(sizeof(*b)); + + b->alloc_len = 0; + b->start = b->end = NULL; + + newbuf->color = AP_BUCKET_rmem; + newbuf->getstr = rmem_get_str; + newbuf->getlen = rmem_get_len; + newbuf->free = NULL; + newbuf->data = b; + return newbuf; } /* diff --git a/buckets/ap_rwmem_buf.c b/buckets/ap_rwmem_buf.c index 82cacae5f79..f36fcb192cc 100644 --- a/buckets/ap_rwmem_buf.c +++ b/buckets/ap_rwmem_buf.c @@ -63,31 +63,44 @@ #define DEFAULT_RWBUF_SIZE (4096) #endif -APR_EXPORT(ap_bucket_rwmem *) ap_rwmem_create(void) +static const char * rwmem_get_str(ap_bucket *e) { - ap_bucket_rwmem *newbuf; - newbuf = malloc(sizeof(*newbuf)); - newbuf->alloc_addr = calloc(DEFAULT_RWBUF_SIZE, 1); - newbuf->alloc_len = DEFAULT_RWBUF_SIZE; - newbuf->start = newbuf->alloc_addr; - newbuf->end = newbuf->alloc_addr; - return newbuf; + ap_bucket_rwmem *b = (ap_bucket_rwmem *)e->data; + return b->start; } -APR_EXPORT(void) ap_rwmem_destroy(void *e) +static int rwmem_get_len(ap_bucket *e) { - ap_bucket_rwmem *d = (ap_bucket_rwmem *)e; - free(d->alloc_addr); + ap_bucket_rwmem *b = (ap_bucket_rwmem *)e->data; + return (char *)b->end - (char *)b->start; } -APR_EXPORT(char *) ap_rwmem_get_char_str(ap_bucket_rwmem *b) +static void rwmem_destroy(void *e) { - return b->start; + ap_bucket_rwmem *d = (ap_bucket_rwmem *)e; + free(d->alloc_addr); } -APR_EXPORT(int) ap_rwmem_get_len(ap_bucket_rwmem *b) +APR_EXPORT(ap_bucket *) ap_rwmem_create(void) { - return (char *)b->end - (char *)b->start; + ap_bucket *newbuf; + ap_bucket_rwmem *b; + + newbuf = malloc(sizeof(*newbuf)); + b = malloc(sizeof(*b)); + + b->alloc_addr = calloc(DEFAULT_RWBUF_SIZE, 1); + b->alloc_len = DEFAULT_RWBUF_SIZE; + b->start = b->alloc_addr; + b->end = b->alloc_addr; + + newbuf->color = AP_BUCKET_rwmem; + newbuf->getstr = rwmem_get_str; + newbuf->getlen = rwmem_get_len; + newbuf->free = rwmem_destroy; + newbuf->data = b; + + return newbuf; } /* diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index d4ec87c5c35..00701e94bb2 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -62,7 +62,7 @@ #ifdef HAVE_SYS_UIO_H #include /* for struct iovec */ #endif -#ifdef APR_HAVE_STDARG_H +#ifdef HAVE_STDARG_H #include #endif @@ -81,9 +81,11 @@ typedef enum { typedef struct ap_bucket ap_bucket; struct ap_bucket { - ap_bucket_color_e color; /* what type of bucket is it */ - void (*free)(void *e); /* can be NULL */ - void *data; /* for use by free() */ + ap_bucket_color_e color; /* what type of bucket is it */ + void (*free)(void *e); /* can be NULL */ + void *data; /* for use by free() */ + const char *(*getstr)(ap_bucket *e); /* Get the string */ + int (*getlen)(ap_bucket *e); /* Get the length of the string */ }; typedef struct ap_bucket_list ap_bucket_list; @@ -183,16 +185,7 @@ struct ap_bucket_rwmem { }; /* Create a read/write memory bucket */ -APR_EXPORT(ap_bucket_rwmem *) ap_rwmem_create(void); - -/* destroy a read/write memory bucket */ -APR_EXPORT(void) ap_rwmem_destroy(void *e); - -/* Convert a rwmem bucket into a char * */ -APR_EXPORT(char *) ap_rwmem_get_char_str(ap_bucket_rwmem *b); - -/* get the length of the data in the rwmem bucket */ -APR_EXPORT(int) ap_rwmem_get_len(ap_bucket_rwmem *b); +APR_EXPORT(ap_bucket *) ap_rwmem_create(void); APR_EXPORT(int) ap_rwmem_write(ap_bucket_rwmem *b, const void *buf, ap_size_t nbyte, ap_ssize_t *bytes_written); @@ -207,13 +200,7 @@ struct ap_bucket_mmap { }; /* Create a mmap memory bucket */ -APR_EXPORT(ap_bucket_mmap *) ap_mmap_bucket_create(void); - -/* Convert a mmap bucket into a char * */ -APR_EXPORT(char *) ap_mmap_get_char_str(ap_bucket_mmap *b); - -/* get the length of the data in the mmap bucket */ -APR_EXPORT(int) ap_mmap_get_len(ap_bucket_mmap *b); +APR_EXPORT(ap_bucket *) ap_mmap_bucket_create(void); APR_EXPORT(void) ap_mmap_bucket_insert(ap_bucket_mmap *b, ap_mmap_t *mm); @@ -228,21 +215,17 @@ struct ap_bucket_rmem { }; /* Create a read only memory bucket */ -APR_EXPORT(ap_bucket_rmem *) ap_rmem_create(void); - -/* destroy a read only memory bucket */ -APR_EXPORT(void) ap_rmem_destroy(void *e); - -/* Convert a read only bucket into a char * */ -APR_EXPORT(const char *) ap_rmem_get_char_str(ap_bucket_rmem *b); - -/* get the length of the data in the rmem bucket */ -APR_EXPORT(int) ap_rmem_get_len(ap_bucket_rmem *b); +APR_EXPORT(ap_bucket *) ap_rmem_create(void); APR_EXPORT(int) ap_rmem_write(ap_bucket_rmem *b, const void *buf, ap_size_t nbyte, ap_ssize_t *bytes_written); APR_EXPORT(int) ap_rmem_vputstrs(ap_bucket_rmem *b, va_list va); +/* ****** RMEM Functions ***** */ + +/* Create an End of Stream bucket */ +APR_EXPORT(ap_bucket *) ap_eos_create(void); + #endif From 3255a0bc651e781888b7de4408fd2627ba133013 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 13 Jul 2000 22:37:43 +0000 Subject: [PATCH 0391/7878] I've added a couple of files, so I'm updating the README to reflect that. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60366 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/README.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buckets/README.txt b/buckets/README.txt index 9e69582c716..540a232b779 100644 --- a/buckets/README.txt +++ b/buckets/README.txt @@ -17,6 +17,8 @@ Bachelor #1 ap_buf.c ap_mmap_buf.c ap_rwmem_buf.c + ap_rmem_buf.c + ap_eos_buf.c util_filter.h util_filter.c ryan.patch From e7e7441f9bac4767963e26a7edd5875713e76b25 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 14 Jul 2000 00:24:33 +0000 Subject: [PATCH 0392/7878] The write functions are now also function pointers. This allows people to easily insert data to a bucket brigade. I need to re-write the brigade insert routines, but that can come tomorrow. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60367 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 31 +++++++++++----- buckets/ap_mmap_buf.c | 22 ++++++++---- buckets/ap_rmem_buf.c | 49 +++++++++++++------------ buckets/ap_rwmem_buf.c | 68 +++++++++++++---------------------- buckets/apr_buf.h | 82 ++++++++++++++++++++---------------------- 5 files changed, 128 insertions(+), 124 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 9bdb88dd0fc..604deacefd2 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -56,14 +56,15 @@ */ #include "apr_private.h" +#include "apr_pools.h" #include "apr_lib.h" #include "apr_errno.h" #include #include #include "apr_buf.h" -/* We are creating a new bucket here. We could replace the switch with a - * function pointer if we want to. I'm not sure it's a real win though. +/* We are creating a new bucket here. The buckets that are created + * have the correct function pointers and types when they are created. */ APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color) { @@ -110,7 +111,7 @@ APR_EXPORT(ap_bucket_brigade *) ap_bucket_brigade_create(ap_pool_t *p) { ap_bucket_brigade *b; - b = malloc(sizeof(*b)); + b = ap_palloc(p, sizeof(*b)); b->p = p; b->head = b->tail = NULL; @@ -276,15 +277,29 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) if (b->tail && b->tail->bucket && b->tail->bucket->color == AP_BUCKET_rwmem) { - ap_bucket_rwmem *rw; - rw = b->tail->bucket->data; + ap_bucket *rw; + rw = b->tail->bucket; /* I have no idea if this is a good idea or not. Probably not. * Basically, if the last bucket in the list is a rwmem bucket, * then we just add to it instead of allocating a new read only * bucket. This is incredibly easy to take out if it is a bad * idea. RBB */ - ap_rwmem_vputstrs(rw, va); + for (k = 0;;) { + x = va_arg(va, const char *); + if (x == NULL) + break; + j = strlen(x); + + rv = rw->insert(rw, x, j, &i); + if (i != j) { + /* Do we need better error reporting? */ + return -1; + } + k += i; + + ap_bucket_brigade_append_bucket(b, rw); + } } for (k = 0;;) { @@ -294,7 +309,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) break; j = strlen(x); - rv = ap_rwmem_write(r->data, x, j, &i); + rv = r->insert(r, x, j, &i); if (i != j) { /* Do we need better error reporting? */ return -1; @@ -330,7 +345,7 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis res = ap_vsnprintf(buf, 4096, fmt, va); r = ap_bucket_new(AP_BUCKET_rwmem); - res = ap_rwmem_write(r->data, buf, strlen(buf), &i); + res = r->insert(r, buf, strlen(buf), &i); ap_bucket_brigade_append_bucket(b, r); return res; diff --git a/buckets/ap_mmap_buf.c b/buckets/ap_mmap_buf.c index c2ba6f1fc80..d51ecd3c545 100644 --- a/buckets/ap_mmap_buf.c +++ b/buckets/ap_mmap_buf.c @@ -68,9 +68,22 @@ static const char * mmap_get_str(ap_bucket *e) static int mmap_get_len(ap_bucket *e) { ap_bucket_mmap *b = (ap_bucket_mmap *)e->data; - return b->data->size; + return b->len; } +static ap_status_t mmap_bucket_insert(ap_bucket *e, const void *buf, + ap_size_t nbytes, ap_ssize_t *w) +{ + ap_bucket_mmap *b = (ap_bucket_mmap *)e->data; + const ap_mmap_t *mm = buf; + + b->data = mm; + b->len = nbytes; + *w = nbytes; + return APR_SUCCESS; +} + + APR_EXPORT(ap_bucket *) ap_mmap_bucket_create(void) { ap_bucket *newbuf; @@ -80,18 +93,15 @@ APR_EXPORT(ap_bucket *) ap_mmap_bucket_create(void) b = malloc(sizeof(*b)); b->data = NULL; + b->len = 0; newbuf->color = AP_BUCKET_mmap; newbuf->getstr = mmap_get_str; newbuf->getlen = mmap_get_len; + newbuf->insert = mmap_bucket_insert; newbuf->free = NULL; newbuf->data = b; return newbuf; } -APR_EXPORT(void) ap_mmap_bucket_insert(ap_bucket_mmap *b, ap_mmap_t *mm) -{ - b->data = mm; -} - diff --git a/buckets/ap_rmem_buf.c b/buckets/ap_rmem_buf.c index 985d2efb549..40e78f56834 100644 --- a/buckets/ap_rmem_buf.c +++ b/buckets/ap_rmem_buf.c @@ -75,25 +75,6 @@ static int rmem_get_len(ap_bucket *e) return (char *)b->end - (char *)b->start; } -APR_EXPORT(ap_bucket *) ap_rmem_create(void) -{ - ap_bucket *newbuf; - ap_bucket_rmem *b; - - newbuf = malloc(sizeof(*newbuf)); - b = malloc(sizeof(*b)); - - b->alloc_len = 0; - b->start = b->end = NULL; - - newbuf->color = AP_BUCKET_rmem; - newbuf->getstr = rmem_get_str; - newbuf->getlen = rmem_get_len; - newbuf->free = NULL; - newbuf->data = b; - return newbuf; -} - /* * save nbyte bytes to the bucket. * Only returns fewer than nbyte if an error ocurred. @@ -101,11 +82,13 @@ APR_EXPORT(ap_bucket *) ap_rmem_create(void) * It is worth noting that if an error occurs, the buffer is in an unknown * state. */ -APR_EXPORT(int) ap_rmem_write(ap_bucket_rmem *b, const void *buf, - ap_size_t nbyte, ap_ssize_t *bytes_written) +static ap_status_t rmem_insert(ap_bucket *e, const void *buf, + ap_size_t nbyte, ap_ssize_t *w) { + ap_bucket_rmem *b = (ap_bucket_rmem *)e->data; + if (nbyte == 0) { - *bytes_written = 0; + *w = 0; return APR_SUCCESS; } @@ -114,7 +97,27 @@ APR_EXPORT(int) ap_rmem_write(ap_bucket_rmem *b, const void *buf, */ b->start = buf; b->end = (char *)b->start + nbyte; - *bytes_written = nbyte; + *w = nbyte; return APR_SUCCESS; } +APR_EXPORT(ap_bucket *) ap_rmem_create(void) +{ + ap_bucket *newbuf; + ap_bucket_rmem *b; + + newbuf = malloc(sizeof(*newbuf)); + b = malloc(sizeof(*b)); + + b->alloc_len = 0; + b->start = b->end = NULL; + + newbuf->color = AP_BUCKET_rmem; + newbuf->getstr = rmem_get_str; + newbuf->getlen = rmem_get_len; + newbuf->insert = rmem_insert; + newbuf->free = NULL; + newbuf->data = b; + return newbuf; +} + diff --git a/buckets/ap_rwmem_buf.c b/buckets/ap_rwmem_buf.c index f36fcb192cc..f7ce26e6420 100644 --- a/buckets/ap_rwmem_buf.c +++ b/buckets/ap_rwmem_buf.c @@ -81,28 +81,6 @@ static void rwmem_destroy(void *e) free(d->alloc_addr); } -APR_EXPORT(ap_bucket *) ap_rwmem_create(void) -{ - ap_bucket *newbuf; - ap_bucket_rwmem *b; - - newbuf = malloc(sizeof(*newbuf)); - b = malloc(sizeof(*b)); - - b->alloc_addr = calloc(DEFAULT_RWBUF_SIZE, 1); - b->alloc_len = DEFAULT_RWBUF_SIZE; - b->start = b->alloc_addr; - b->end = b->alloc_addr; - - newbuf->color = AP_BUCKET_rwmem; - newbuf->getstr = rwmem_get_str; - newbuf->getlen = rwmem_get_len; - newbuf->free = rwmem_destroy; - newbuf->data = b; - - return newbuf; -} - /* * save nbyte bytes to the bucket. * Only returns fewer than nbyte if an error occurred. @@ -110,14 +88,15 @@ APR_EXPORT(ap_bucket *) ap_rwmem_create(void) * It is worth noting that if an error occurs, the buffer is in an unknown * state. */ -APR_EXPORT(int) ap_rwmem_write(ap_bucket_rwmem *b, const void *buf, - ap_size_t nbyte, ap_ssize_t *bytes_written) +static ap_status_t rwmem_insert(ap_bucket *e, const void *buf, + ap_size_t nbyte, ap_ssize_t *w) { int amt; int total; + ap_bucket_rwmem *b = (ap_bucket_rwmem *)e->data; if (nbyte == 0) { - *bytes_written = 0; + *w = 0; return APR_SUCCESS; } @@ -136,29 +115,30 @@ APR_EXPORT(int) ap_rwmem_write(ap_bucket_rwmem *b, const void *buf, /* now we know that nbyte < b->alloc_len */ memcpy(b->end, buf, nbyte); b->end = (char *)b->end + nbyte; - *bytes_written = total + nbyte; + *w = total + nbyte; return APR_SUCCESS; } -APR_EXPORT(int) ap_rwmem_vputstrs(ap_bucket_rwmem *b, va_list va) +APR_EXPORT(ap_bucket *) ap_rwmem_create(void) { - int j, k; - ap_ssize_t i; - const char *x; - int rv; + ap_bucket *newbuf; + ap_bucket_rwmem *b; - for (k = 0;;) { - x = va_arg(va, const char *); - if (x == NULL) - break; - j = strlen(x); - rv = ap_rwmem_write(b, x, j, &i); - if (i != j) { - /* Do we need better error reporting? */ - return -1; - } - k += i; - } + newbuf = malloc(sizeof(*newbuf)); + b = malloc(sizeof(*b)); + + b->alloc_addr = calloc(DEFAULT_RWBUF_SIZE, 1); + b->alloc_len = DEFAULT_RWBUF_SIZE; + b->start = b->alloc_addr; + b->end = b->alloc_addr; + + newbuf->color = AP_BUCKET_rwmem; + newbuf->getstr = rwmem_get_str; + newbuf->getlen = rwmem_get_len; + newbuf->insert = rwmem_insert; + newbuf->free = rwmem_destroy; + newbuf->data = b; - return k; + return newbuf; } + diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index 00701e94bb2..512e0660477 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -86,6 +86,15 @@ struct ap_bucket { void *data; /* for use by free() */ const char *(*getstr)(ap_bucket *e); /* Get the string */ int (*getlen)(ap_bucket *e); /* Get the length of the string */ + /* Insert into a bucket. The buf is a different type based on the + * bucket type used. For example, with AP_BUCKET_mmap it is an ap_mmap_t + * for AP_BUCKET_file it is an ap_file_t, and for AP_BUCKET_rwmem it is + * a char *. The nbytes is the amount of actual data in buf. This is + * not the sizeof(buf), it is the actual number of bytes in the char * + * that buf resolves to. written is how much of that data was inserted + * into the bucket. + */ + int (*insert)(ap_bucket *e, const void *buf, ap_size_t nbytes, ap_ssize_t *w); }; typedef struct ap_bucket_list ap_bucket_list; @@ -106,6 +115,35 @@ struct ap_bucket_brigade { ap_bucket_list *tail; /* The end of the brigade */ }; +/* ****** Different bucket types *****/ + +typedef struct ap_bucket_rmem ap_bucket_rmem; +struct ap_bucket_rmem { + size_t alloc_len; /* how much was allocated */ + const void *start; /* Where does the actual data start + in the alloc'ed block */ + const void *end; /* where does the data actually end? */ +}; + +typedef struct ap_bucket_rwmem ap_bucket_rwmem; +struct ap_bucket_rwmem { + void *alloc_addr; /* Where does the data start */ + size_t alloc_len; /* how much was allocated */ + void *start; /* Where does the actual data start + in the alloc'ed block */ + void *end; /* where does the data actually end? */ +}; + +typedef struct ap_bucket_mmap ap_bucket_mmap; +struct ap_bucket_mmap { + const ap_mmap_t *data; + int len; /* The amount of data in the mmap that we are + * referencing with this bucket. This may be + * smaller than the length in the data object, + * but it may not be bigger. + */ +}; + /* ****** Bucket Brigade Functions ***** */ /* Create a new bucket brigade */ @@ -173,57 +211,15 @@ APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b); /* get the length of the data in the bucket */ APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b); -/* ****** RWMEM Functions ***** */ - -typedef struct ap_bucket_rwmem ap_bucket_rwmem; -struct ap_bucket_rwmem { - void *alloc_addr; /* Where does the data start */ - size_t alloc_len; /* how much was allocated */ - void *start; /* Where does the actual data start - in the alloc'ed block */ - void *end; /* where does the data actually end? */ -}; - /* Create a read/write memory bucket */ APR_EXPORT(ap_bucket *) ap_rwmem_create(void); -APR_EXPORT(int) ap_rwmem_write(ap_bucket_rwmem *b, const void *buf, - ap_size_t nbyte, ap_ssize_t *bytes_written); - -APR_EXPORT(int) ap_rwmem_vputstrs(ap_bucket_rwmem *b, va_list va); - -/* ****** MMAP Functions ***** */ - -typedef struct ap_bucket_mmap ap_bucket_mmap; -struct ap_bucket_mmap { - ap_mmap_t *data; -}; - /* Create a mmap memory bucket */ APR_EXPORT(ap_bucket *) ap_mmap_bucket_create(void); -APR_EXPORT(void) ap_mmap_bucket_insert(ap_bucket_mmap *b, ap_mmap_t *mm); - -/* ****** RMEM Functions ***** */ - -typedef struct ap_bucket_rmem ap_bucket_rmem; -struct ap_bucket_rmem { - size_t alloc_len; /* how much was allocated */ - const void *start; /* Where does the actual data start - in the alloc'ed block */ - const void *end; /* where does the data actually end? */ -}; - -/* Create a read only memory bucket */ +/* Create a read only memory bucket. */ APR_EXPORT(ap_bucket *) ap_rmem_create(void); -APR_EXPORT(int) ap_rmem_write(ap_bucket_rmem *b, const void *buf, - ap_size_t nbyte, ap_ssize_t *bytes_written); - -APR_EXPORT(int) ap_rmem_vputstrs(ap_bucket_rmem *b, va_list va); - -/* ****** RMEM Functions ***** */ - /* Create an End of Stream bucket */ APR_EXPORT(ap_bucket *) ap_eos_create(void); From ccf029dcb480cafc42e904571353fa478456703b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 14 Jul 2000 00:27:28 +0000 Subject: [PATCH 0393/7878] Apache serves pages with the latest buckets changes and this new patch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60368 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ryan.patch | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/buckets/ryan.patch b/buckets/ryan.patch index 13d75c60c24..671a6669ecc 100644 --- a/buckets/ryan.patch +++ b/buckets/ryan.patch @@ -11,7 +11,7 @@ RCS file: /home/cvs/apache-2.0/src/ap/Makefile.in,v retrieving revision 1.4 diff -u -d -b -w -u -r1.4 Makefile.in --- ap/Makefile.in 2000/06/12 20:41:13 1.4 -+++ ap/Makefile.in 2000/07/13 16:30:51 ++++ ap/Makefile.in 2000/07/14 00:24:57 @@ -1,5 +1,5 @@ LTLIBRARY_NAME = libap.la @@ -25,7 +25,7 @@ RCS file: /home/cvs/apache-2.0/src/include/ap_iol.h,v retrieving revision 1.19 diff -u -d -b -w -u -r1.19 ap_iol.h --- include/ap_iol.h 2000/05/29 04:22:02 1.19 -+++ include/ap_iol.h 2000/07/13 16:30:52 ++++ include/ap_iol.h 2000/07/14 00:24:57 @@ -58,6 +58,7 @@ #define AP_IOL_H @@ -40,7 +40,7 @@ RCS file: /home/cvs/apache-2.0/src/include/http_protocol.h,v retrieving revision 1.19 diff -u -d -b -w -u -r1.19 http_protocol.h --- include/http_protocol.h 2000/07/11 03:48:17 1.19 -+++ include/http_protocol.h 2000/07/13 16:30:52 ++++ include/http_protocol.h 2000/07/14 00:24:57 @@ -89,8 +89,15 @@ API_EXPORT(void) ap_basic_http_header(request_rec *r); @@ -64,7 +64,7 @@ RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v retrieving revision 1.64 diff -u -d -b -w -u -r1.64 httpd.h --- include/httpd.h 2000/06/30 21:18:13 1.64 -+++ include/httpd.h 2000/07/13 16:30:52 ++++ include/httpd.h 2000/07/14 00:24:57 @@ -596,6 +596,11 @@ * pointer back to the main request. */ @@ -83,7 +83,7 @@ RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v retrieving revision 1.133 diff -u -d -b -w -u -r1.133 configure.in --- lib/apr/configure.in 2000/07/13 03:41:04 1.133 -+++ lib/apr/configure.in 2000/07/13 16:30:52 ++++ lib/apr/configure.in 2000/07/14 00:24:58 @@ -678,8 +678,8 @@ AC_SUBST(EXEEXT) @@ -101,7 +101,7 @@ RCS file: /home/cvs/apache-2.0/src/main/Makefile.in,v retrieving revision 1.16 diff -u -d -b -w -u -r1.16 Makefile.in --- main/Makefile.in 2000/07/01 14:14:15 1.16 -+++ main/Makefile.in 2000/07/13 16:31:02 ++++ main/Makefile.in 2000/07/14 00:25:04 @@ -8,7 +8,7 @@ http_protocol.c http_request.c http_vhost.c util.c util_date.c \ util_script.c util_uri.c util_md5.c util_cfgtree.c util_ebcdic.c \ @@ -117,7 +117,7 @@ RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v retrieving revision 1.88 diff -u -d -b -w -u -r1.88 http_core.c --- main/http_core.c 2000/07/11 03:48:18 1.88 -+++ main/http_core.c 2000/07/13 16:31:03 ++++ main/http_core.c 2000/07/14 00:25:04 @@ -71,6 +71,8 @@ #include "util_md5.h" #include "apr_fnmatch.h" @@ -217,7 +217,7 @@ RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v retrieving revision 1.96 diff -u -d -b -w -u -r1.96 http_protocol.c --- main/http_protocol.c 2000/07/13 16:26:42 1.96 -+++ main/http_protocol.c 2000/07/13 16:31:03 ++++ main/http_protocol.c 2000/07/14 00:25:04 @@ -64,6 +64,8 @@ */ @@ -278,7 +278,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + bb = ap_bucket_brigade_create(r->pool); + bb->head = bb->tail = ap_bucket_list_create(); + b = ap_bucket_new(AP_BUCKET_mmap); -+ ap_mmap_bucket_insert((ap_bucket_mmap *)b->data, mm); ++ b->insert(b, mm, mm->size, &total_bytes_sent); + bb->head->bucket = b; + total_bytes_sent = ap_pass_brigade(r, f, bb); + @@ -313,7 +313,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + bb = ap_bucket_brigade_create(r->pool); + bb->head = bb->tail = ap_bucket_list_create(); + b = ap_bucket_new(AP_BUCKET_rwmem); -+ ap_rwmem_write(b->data, &c, 1, &written); ++ b->insert(b, &c, 1, &written); + bb->head->bucket = b; + ap_pass_brigade(r, f, bb); + @@ -350,7 +350,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + bb = ap_bucket_brigade_create(r->pool); + bb->head = bb->tail = ap_bucket_list_create(); + b = ap_bucket_new(AP_BUCKET_rwmem); -+ ap_rwmem_write(b->data, str, strlen(str), &written); ++ b->insert(b, str, strlen(str), &written); + bb->head->bucket = b; + ap_pass_brigade(r, f, bb); + @@ -389,7 +389,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + bb = ap_bucket_brigade_create(r->pool); + bb->head = bb->tail = ap_bucket_list_create(); + b = ap_bucket_new(AP_BUCKET_rwmem); -+ ap_rwmem_write(b->data, buf, nbyte, &written); ++ b->insert(b, buf, nbyte, &written); + bb->head->bucket = b; + ap_pass_brigade(r, f, bb); + return written; @@ -522,7 +522,7 @@ RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v retrieving revision 1.35 diff -u -d -b -w -u -r1.35 http_request.c --- main/http_request.c 2000/06/24 17:33:57 1.35 -+++ main/http_request.c 2000/07/13 16:31:03 ++++ main/http_request.c 2000/07/14 00:25:04 @@ -1263,6 +1263,12 @@ return; } @@ -542,7 +542,7 @@ RCS file: /home/cvs/apache-2.0/src/modules/mpm/config.m4,v retrieving revision 1.23 diff -u -d -b -w -u -r1.23 config.m4 --- modules/mpm/config.m4 2000/07/11 19:00:16 1.23 -+++ modules/mpm/config.m4 2000/07/13 16:31:05 ++++ modules/mpm/config.m4 2000/07/14 00:25:05 @@ -3,7 +3,6 @@ [ --with-mpm=MPM Choose the process model for Apache to use. MPM={dexter,mpmt_beos,mpmt_pthread,prefork,spmt_os2}],[ From 7e38eb7ff14c84b1e114372e08a248231dcd8e58 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Fri, 14 Jul 2000 13:42:33 +0000 Subject: [PATCH 0394/7878] OS/2: off_t is a long in EMX gcc, use "ld" format for it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60369 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index cafa5bb1d34..93afc536c29 100644 --- a/configure.in +++ b/configure.in @@ -385,7 +385,7 @@ fi # don't get it right for your platform, you can override our decision # below. case "$OS" in - *linux*) + *linux* | *os2_emx) off_t_fmt='#define APR_OFF_T_FMT "ld"' esac From 13299c19a102e7a6b6dbf5e728fb61fcc398da27 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Fri, 14 Jul 2000 14:20:08 +0000 Subject: [PATCH 0395/7878] OS/2: Add implementation of ap_wait_all_procs(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60370 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/proc.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 03f82ccd7f8..e2f004d5be3 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -491,6 +491,34 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, +ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, + ap_wait_how_e waithow, ap_pool_t *p) +{ + RESULTCODES codes; + ULONG rc; + PID pid; + + if (!proc) + return APR_ENOPROC; + + rc = DosWaitChild(DCWA_PROCESSTREE, wait == APR_WAIT ? DCWW_WAIT : DCWW_NOWAIT, &codes, &pid, 0); + + if (rc == 0) { + proc->pid = pid; + + if (status) + *status = codes.codeResult; + + return APR_CHILD_DONE; + } else if (rc == ERROR_CHILD_NOT_COMPLETE) { + return APR_CHILD_NOTDONE; + } + + return APR_OS2_STATUS(rc); +} + + + ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e wait) { From 20c319ff5e6994d4d2d1ec0afb3eb29777e07a76 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Fri, 14 Jul 2000 14:23:38 +0000 Subject: [PATCH 0396/7878] OS/2: Fix a canonical error mismatch, allowing .exe files to be spawned without explicitly including the .exe extension. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60371 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index e2f004d5be3..d98952b36a0 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -349,7 +349,7 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, } else if (stricmp(extension, ".exe") != 0) { status = ap_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, cont); - if (status == APR_ENOENT) { + if (status != APR_SUCCESS && ap_canonical_error(status) == APR_ENOENT) { progname = ap_pstrcat(cont, progname, ".exe", NULL); } From e7ee137b17ee0b9e8fd5be2927144327c1e7c1ee Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 14 Jul 2000 18:05:59 +0000 Subject: [PATCH 0397/7878] Move config.guess and config.sub from src/lib/apr to src/lib/apr/helpers. This is the first step in allowing APR to build on it's own again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60372 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/config.guess | 1091 +++++++++++++++++++++++++++++++++++++ helpers/config.sub | 1218 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2309 insertions(+) create mode 100755 helpers/config.guess create mode 100755 helpers/config.sub diff --git a/helpers/config.guess b/helpers/config.guess new file mode 100755 index 00000000000..19b0a0a7182 --- /dev/null +++ b/helpers/config.guess @@ -0,0 +1,1091 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 +# Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner . +# The master version of this file is at the FSF in /home/gd/gnu/lib. +# Please send patches to the Autoconf mailing list . +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit system type (host/target name). +# +# Only a few systems have been added to this list; please add others +# (but try to keep the structure clean). +# + +# Use $HOST_CC if defined. $CC may point to a cross-compiler +if test x"$CC_FOR_BUILD" = x; then + if test x"$HOST_CC" != x; then + CC_FOR_BUILD="$HOST_CC" + else + if test x"$CC" != x; then + CC_FOR_BUILD="$CC" + else + CC_FOR_BUILD=cc + fi + fi +fi + + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 8/24/94.) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <$dummy.s + .globl main + .ent main +main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-cbm-sysv4 + exit 0;; + amiga:NetBSD:*:*) + echo m68k-cbm-netbsd${UNAME_RELEASE} + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + arm32:NetBSD:*:*) + echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + SR2?01:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + atari*:NetBSD:*:*) + echo m68k-atari-netbsd${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + sun3*:NetBSD:*:*) + echo m68k-sun-netbsd${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:NetBSD:*:*) + echo m68k-apple-netbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + macppc:NetBSD:*:*) + echo powerpc-apple-netbsd${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ + -o ${TARGET_BINARY_INTERFACE}x = x ] ; then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i?86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:4) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=4.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + sed 's/^ //' << EOF >$dummy.c + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + rm -f $dummy.c $dummy + esac + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i?86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + hppa*:OpenBSD:*:*) + echo hppa-unknown-openbsd + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*T3E:*:*:*) + echo t3e-cray-unicosmk${UNAME_RELEASE} + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F300:UNIX_System_V:*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + F301:UNIX_System_V:*:*) + echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` + exit 0 ;; + hp3[0-9][05]:NetBSD:*:*) + echo m68k-hp-netbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + i?86:BSD/386:*:* | i?86:BSD/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + if test -x /usr/bin/objformat; then + if test "elf" = "`/usr/bin/objformat`"; then + echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` + exit 0 + fi + fi + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:NetBSD:*:*) + echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + *:Linux:*:*) +# # uname on the ARM produces all sorts of strangeness, and we need to +# # filter it out. +# case "$UNAME_MACHINE" in +# armv*) UNAME_MACHINE=$UNAME_MACHINE ;; +# arm* | sa110*) UNAME_MACHINE="arm" ;; +# esac + + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_help_string=`cd /; ld --help 2>&1` + ld_supported_emulations=`echo $ld_help_string \ + | sed -ne '/supported emulations:/!d + s/[ ][ ]*/ /g + s/.*supported emulations: *// + s/ .*// + p'` + case "$ld_supported_emulations" in + i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; + i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; + sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + elf32arm) echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 ;; + elf32ppc) + # Determine Lib Version + cat >$dummy.c < +#if defined(__GLIBC__) +extern char __libc_version[]; +extern char __libc_release[]; +#endif +main(argc, argv) + int argc; + char *argv[]; +{ +#if defined(__GLIBC__) + printf("%s %s\n", __libc_version, __libc_release); +#else + printf("unkown\n"); +#endif + return 0; +} +EOF + LIBC="" + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy | grep 1\.99 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.c $dummy + echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;; + esac + + if test "${UNAME_MACHINE}" = "alpha" ; then + sed 's/^ //' <$dummy.s + .globl main + .ent main + main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + LIBC="" + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + + objdump --private-headers $dummy | \ + grep ld.so.1 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 + elif test "${UNAME_MACHINE}" = "mips" ; then + cat >$dummy.c </dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + else + # Either a pre-BFD a.out linker (linux-gnuoldld) + # or one that does not give us useful --help. + # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. + # If ld does not provide *any* "supported emulations:" + # that means it is gnuoldld. + echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" + test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + + case "${UNAME_MACHINE}" in + i?86) + VENDOR=pc; + ;; + *) + VENDOR=unknown; + ;; + esac + # Determine whether the default compiler is a.out or elf + cat >$dummy.c < +#ifdef __cplusplus + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + fi ;; +# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions +# are messed up and put the nodename in both sysname and nodename. + i?86:DYNIX/ptx:4*:*) + echo i386-sequent-sysv4 + exit 0 ;; + i?86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + fi + exit 0 ;; + i?86:*:5:7*) + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585 + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE} + exit 0 ;; + i?86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + pc:*:*:*) + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:*:6*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:OS/2:*:*) + echo "i386-pc-os2_emx" + exit 0;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +#if !defined (ultrix) + printf ("vax-dec-bsd\n"); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +#echo '(Unable to guess system type)' 1>&2 + +exit 1 diff --git a/helpers/config.sub b/helpers/config.sub new file mode 100755 index 00000000000..8e7cdd62ce4 --- /dev/null +++ b/helpers/config.sub @@ -0,0 +1,1218 @@ +#! /bin/sh +# Configuration validation subroutine script, version 1.1. +# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +if [ x$1 = x ] +then + echo Configuration name missing. 1>&2 + echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 + echo "or $0 ALIAS" 1>&2 + echo where ALIAS is a recognized configuration type. 1>&2 + exit 1 +fi + +# First pass through any local machine types. +case $1 in + *local*) + echo $1 + exit 0 + ;; + *) + ;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + linux-gnu*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=vxworks + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + | 580 | i960 | h8300 \ + | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \ + | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ + | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ + | mips64orion | mips64orionel | mipstx39 | mipstx39el \ + | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ + | mips64vr5000 | miprs64vr5000el \ + | armv[34][lb] | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ + | thumb | d10v) + basic_machine=$basic_machine-unknown + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i[34567]86) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ + | xmp-* | ymp-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ + | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \ + | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ + | clipper-* | orion-* \ + | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ + | mipstx39-* | mipstx39el-* \ + | armv[34][lb]-* \ + | f301-* | armv*-* | t3e-* \ + | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ + | thumb-* | v850-* | d30v-* | tic30-* | c30-* ) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-cbm + ;; + amigaos | amigados) + basic_machine=m68k-cbm + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-cbm + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [ctj]90-cray) + basic_machine=c90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + os=-mvs + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i[34567]86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i[34567]86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i[34567]86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i[34567]86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + i386-go32 | go32) + basic_machine=i386-unknown + os=-go32 + ;; + i386-mingw32 | mingw32) + basic_machine=i386-unknown + os=-mingw32 + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | *MiNT) + basic_machine=m68k-atari + os=-mint + ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + msdos) + basic_machine=i386-unknown + os=-msdos + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-corel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + np1) + basic_machine=np1-gould + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexen-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=rs6000-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=t3e-cray + os=-unicos + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + mips) + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sparc | sparcv9) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + -os2_emx) + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -*MiNT) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-corel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f301-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -*MiNT) + vendor=atari + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os From 9fde26d9146ed67eebd8a26e14b067c77d10efe4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 14 Jul 2000 18:16:19 +0000 Subject: [PATCH 0398/7878] Allow APR to build without Apache. buildconf builds the configure scripts for APR and MM. Config.guess and Config.sub have been moved to helpers/ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60373 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 3 + config.guess | 1091 -------------------------------------------- config.sub | 1218 -------------------------------------------------- configure.in | 2 +- 4 files changed, 4 insertions(+), 2310 deletions(-) create mode 100755 buildconf delete mode 100755 config.guess delete mode 100755 config.sub diff --git a/buildconf b/buildconf new file mode 100755 index 00000000000..06ef374b04a --- /dev/null +++ b/buildconf @@ -0,0 +1,3 @@ +autoconf;autoheader + +(cd shmem/unix/mm && autoconf) diff --git a/config.guess b/config.guess deleted file mode 100755 index 19b0a0a7182..00000000000 --- a/config.guess +++ /dev/null @@ -1,1091 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 -# Free Software Foundation, Inc. -# -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Written by Per Bothner . -# The master version of this file is at the FSF in /home/gd/gnu/lib. -# Please send patches to the Autoconf mailing list . -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit system type (host/target name). -# -# Only a few systems have been added to this list; please add others -# (but try to keep the structure clean). -# - -# Use $HOST_CC if defined. $CC may point to a cross-compiler -if test x"$CC_FOR_BUILD" = x; then - if test x"$HOST_CC" != x; then - CC_FOR_BUILD="$HOST_CC" - else - if test x"$CC" != x; then - CC_FOR_BUILD="$CC" - else - CC_FOR_BUILD=cc - fi - fi -fi - - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - cat <$dummy.s - .globl main - .ent main -main: - .frame \$30,0,\$26,0 - .prologue 0 - .long 0x47e03d80 # implver $0 - lda \$2,259 - .long 0x47e20c21 # amask $2,$1 - srl \$1,8,\$2 - sll \$2,2,\$2 - sll \$0,3,\$0 - addl \$1,\$0,\$0 - addl \$2,\$0,\$0 - ret \$31,(\$26),1 - .end main -EOF - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy - case "$?" in - 7) - UNAME_MACHINE="alpha" - ;; - 15) - UNAME_MACHINE="alphaev5" - ;; - 14) - UNAME_MACHINE="alphaev56" - ;; - 10) - UNAME_MACHINE="alphapca56" - ;; - 16) - UNAME_MACHINE="alphaev6" - ;; - esac - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-cbm-sysv4 - exit 0;; - amiga:NetBSD:*:*) - echo m68k-cbm-netbsd${UNAME_RELEASE} - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - arc64:OpenBSD:*:*) - echo mips64el-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hkmips:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - arm32:NetBSD:*:*) - echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - SR2?01:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - atari*:NetBSD:*:*) - echo m68k-atari-netbsd${UNAME_RELEASE} - exit 0 ;; - atari*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - sun3*:NetBSD:*:*) - echo m68k-sun-netbsd${UNAME_RELEASE} - exit 0 ;; - sun3*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:NetBSD:*:*) - echo m68k-apple-netbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - macppc:NetBSD:*:*) - echo powerpc-apple-netbsd${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy \ - && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ - -o ${TARGET_BINARY_INTERFACE}x = x ] ; then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i?86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:4) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` - if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=4.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - sed 's/^ //' << EOF >$dummy.c - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` - rm -f $dummy.c $dummy - esac - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i?86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - hppa*:OpenBSD:*:*) - echo hppa-unknown-openbsd - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*X-MP:*:*:*) - echo xmp-cray-unicos - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} - exit 0 ;; - CRAY*T3E:*:*:*) - echo t3e-cray-unicosmk${UNAME_RELEASE} - exit 0 ;; - CRAY-2:*:*:*) - echo cray2-cray-unicos - exit 0 ;; - F300:UNIX_System_V:*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - F301:UNIX_System_V:*:*) - echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` - exit 0 ;; - hp3[0-9][05]:NetBSD:*:*) - echo m68k-hp-netbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*) - if test -x /usr/bin/objformat; then - if test "elf" = "`/usr/bin/objformat`"; then - echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` - exit 0 - fi - fi - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; - *:NetBSD:*:*) - echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i386-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - *:Linux:*:*) -# # uname on the ARM produces all sorts of strangeness, and we need to -# # filter it out. -# case "$UNAME_MACHINE" in -# armv*) UNAME_MACHINE=$UNAME_MACHINE ;; -# arm* | sa110*) UNAME_MACHINE="arm" ;; -# esac - - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - ld_help_string=`cd /; ld --help 2>&1` - ld_supported_emulations=`echo $ld_help_string \ - | sed -ne '/supported emulations:/!d - s/[ ][ ]*/ /g - s/.*supported emulations: *// - s/ .*// - p'` - case "$ld_supported_emulations" in - i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; - i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; - sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - elf32arm) echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 ;; - elf32ppc) - # Determine Lib Version - cat >$dummy.c < -#if defined(__GLIBC__) -extern char __libc_version[]; -extern char __libc_release[]; -#endif -main(argc, argv) - int argc; - char *argv[]; -{ -#if defined(__GLIBC__) - printf("%s %s\n", __libc_version, __libc_release); -#else - printf("unkown\n"); -#endif - return 0; -} -EOF - LIBC="" - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy | grep 1\.99 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.c $dummy - echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;; - esac - - if test "${UNAME_MACHINE}" = "alpha" ; then - sed 's/^ //' <$dummy.s - .globl main - .ent main - main: - .frame \$30,0,\$26,0 - .prologue 0 - .long 0x47e03d80 # implver $0 - lda \$2,259 - .long 0x47e20c21 # amask $2,$1 - srl \$1,8,\$2 - sll \$2,2,\$2 - sll \$0,3,\$0 - addl \$1,\$0,\$0 - addl \$2,\$0,\$0 - ret \$31,(\$26),1 - .end main -EOF - LIBC="" - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy - case "$?" in - 7) - UNAME_MACHINE="alpha" - ;; - 15) - UNAME_MACHINE="alphaev5" - ;; - 14) - UNAME_MACHINE="alphaev56" - ;; - 10) - UNAME_MACHINE="alphapca56" - ;; - 16) - UNAME_MACHINE="alphaev6" - ;; - esac - - objdump --private-headers $dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 - elif test "${UNAME_MACHINE}" = "mips" ; then - cat >$dummy.c </dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - else - # Either a pre-BFD a.out linker (linux-gnuoldld) - # or one that does not give us useful --help. - # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. - # If ld does not provide *any* "supported emulations:" - # that means it is gnuoldld. - echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" - test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 - - case "${UNAME_MACHINE}" in - i?86) - VENDOR=pc; - ;; - *) - VENDOR=unknown; - ;; - esac - # Determine whether the default compiler is a.out or elf - cat >$dummy.c < -#ifdef __cplusplus - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __ELF__ -# ifdef __GLIBC__ -# if __GLIBC__ >= 2 - printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -#else - printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - fi ;; -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions -# are messed up and put the nodename in both sysname and nodename. - i?86:DYNIX/ptx:4*:*) - echo i386-sequent-sysv4 - exit 0 ;; - i?86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} - fi - exit 0 ;; - i?86:*:5:7*) - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585 - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE} - exit 0 ;; - i?86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - pc:*:*:*) - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:*:6*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:OS/2:*:*) - echo "i386-pc-os2_emx" - exit 0;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -#if !defined (ultrix) - printf ("vax-dec-bsd\n"); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 -rm -f $dummy.c $dummy - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -#echo '(Unable to guess system type)' 1>&2 - -exit 1 diff --git a/config.sub b/config.sub deleted file mode 100755 index 8e7cdd62ce4..00000000000 --- a/config.sub +++ /dev/null @@ -1,1218 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -if [ x$1 = x ] -then - echo Configuration name missing. 1>&2 - echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 - echo "or $0 ALIAS" 1>&2 - echo where ALIAS is a recognized configuration type. 1>&2 - exit 1 -fi - -# First pass through any local machine types. -case $1 in - *local*) - echo $1 - exit 0 - ;; - *) - ;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - linux-gnu*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=vxworks - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ - | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ - | 580 | i960 | h8300 \ - | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \ - | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ - | mips64orion | mips64orionel | mipstx39 | mipstx39el \ - | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ - | mips64vr5000 | miprs64vr5000el \ - | armv[34][lb] | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v) - basic_machine=$basic_machine-unknown - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i[34567]86) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ - | xmp-* | ymp-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ - | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \ - | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ - | clipper-* | orion-* \ - | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ - | mipstx39-* | mipstx39el-* \ - | armv[34][lb]-* \ - | f301-* | armv*-* | t3e-* \ - | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* ) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-cbm - ;; - amigaos | amigados) - basic_machine=m68k-cbm - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-cbm - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | ymp) - basic_machine=ymp-cray - os=-unicos - ;; - cray2) - basic_machine=cray2-cray - os=-unicos - ;; - [ctj]90-cray) - basic_machine=c90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - os=-mvs - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[34567]86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i[34567]86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i[34567]86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i[34567]86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - i386-go32 | go32) - basic_machine=i386-unknown - os=-go32 - ;; - i386-mingw32 | mingw32) - basic_machine=i386-unknown - os=-mingw32 - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | *MiNT) - basic_machine=m68k-atari - os=-mint - ;; - mipsel*-linux*) - basic_machine=mipsel-unknown - os=-linux-gnu - ;; - mips*-linux*) - basic_machine=mips-unknown - os=-linux-gnu - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - msdos) - basic_machine=i386-unknown - os=-msdos - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-corel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - np1) - basic_machine=np1-gould - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexen) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86) - basic_machine=i686-pc - ;; - pentiumii | pentium2) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexen-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=rs6000-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sparclite-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=t3e-cray - os=-unicos - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xmp) - basic_machine=xmp-cray - os=-unicos - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - mips) - if [ x$os = x-linux-gnu ]; then - basic_machine=mips-unknown - else - basic_machine=mips-mips - fi - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sparc | sparcv9) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - c4x*) - basic_machine=c4x-none - os=-coff - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - -os2_emx) - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -ns2 ) - os=-nextstep2 - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -*MiNT) - os=-mint - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-corel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f301-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -*MiNT) - vendor=atari - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os diff --git a/configure.in b/configure.in index 93afc536c29..8306767fc46 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl ## dnl Process this file with autoconf to produce a configure script. AC_INIT(apr_common.m4) AC_CONFIG_HEADER(include/apr_private.h) -AC_CONFIG_AUX_DIR_DEFAULT +AC_CONFIG_AUX_DIR(helpers) echo "Configuring APR library" OS=`$ac_config_guess` From 5697d4af83e9b98c6dfaf5c1cb64d43b55413bc1 Mon Sep 17 00:00:00 2001 From: "Ralf S. Engelschall" Date: Fri, 14 Jul 2000 19:55:50 +0000 Subject: [PATCH 0399/7878] Clarify the rumor around this stuff a little bit more by cut & pasting a little bit of explanation I wrote in the source of one of my forthcoming libraries. In short: The trick of the multiplier 33 is not that it is magic, it is more because it can be easily replaced with a shift+add function. So, let's actually do it here or the whole trick would be null. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60374 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_hash.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/lib/apr_hash.c b/lib/apr_hash.c index cae1434400e..6960362ddb7 100644 --- a/lib/apr_hash.c +++ b/lib/apr_hash.c @@ -219,13 +219,40 @@ static ap_hash_entry_t **find_entry(ap_hash_t *ht, klen = strlen(key) + 1; /* - * This hash function is used by perl 5; RSE attributes it to DJB. - * (See Message-ID: <19991013131827.A17702@engelschall.com> - * in the new-httpd archive for October 1999.) + * This is Daniel J. Bernstein's popular `times 33' hash function + * as posted by him years ago on comp.lang.c. It basically uses a + * function like ``hash(i) = hash(i-1) * 33 + str[i]''. This is one + * of the best known hash functions for strings. Because it is both + * computed very fast and distributes very well. + * + * The magic of number 33, i.e. why it works better than many other + * constants, prime or not, has never been adequately explained by + * anyone. So I try an explanation: if one experimentally tests all + * multipliers between 1 and 256 (as I did while writing a low-level + * data structure library some time ago) one detects that even + * numbers are not useable at all. The remaining 128 odd numbers + * (except for the number 1) work more or less all equally well. + * They all distribute in an acceptable way and this way fill a hash + * table with an average percent of approx. 86%. + * + * If one compares the Chi/2 values of the variants (see + * Bob Jenkins ``Hashing Frequently Asked Questions'' at + * http://burtleburtle.net/bob/hash/hashfaq.html for a description + * of Chi/2), the number 33 not even has the best value. But the + * number 33 and a few other equally good numbers like 17, 31, 63, + * 127 and 129 have nevertheless a great advantage to the remaining + * numbers in the large set of possible multipliers: their multiply + * operation can be replaced by a faster operation based on just one + * shift plus either a single addition or subtraction operation. And + * because a hash function has to both distribute good _and_ has to + * be very fast to compute, those few numbers should be preferred + * and seems to be the reason why Daniel J. Bernstein also preferred + * it. + * -- Ralf S. Engelschall */ hash = 0; for (p = key, i = klen; i; i--, p++) - hash = hash * 33 + *p; + hash = ((hash << 5) + hash) + *p; /* scan linked list */ for (hep = &ht->array[hash & ht->max], he = *hep; From ae71446b06b3ef5728ad96ed71be7cb39273d7cd Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Fri, 14 Jul 2000 23:40:58 +0000 Subject: [PATCH 0400/7878] minor typo. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60375 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_dso.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_dso.h b/include/apr_dso.h index e7c1ba7afbf..c5d4568c66c 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -104,7 +104,7 @@ ap_status_t ap_dso_unload(ap_dso_handle_t *handle); /* -=head1 ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle *, const char *symname) +=head1 ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, const char *symname) B From eeb8fc127fb7fd5c14541fec8624e50cb719f233 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sat, 15 Jul 2000 01:07:45 +0000 Subject: [PATCH 0401/7878] ap_dso_init() isn't needed. if/when a platform needs it, then ap_initialize() can be used to init DSO support. or set up a lazy initialization for it. solves the questions, "when do I call it? can I call it more than once?" Submitted by: Ben Collins-Sussman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60376 13f79535-47bb-0310-9956-ffa450edef68 --- dso/aix/dso.c | 4 ---- dso/beos/dso.c | 4 ---- dso/os2/dso.c | 6 ------ dso/unix/dso.c | 4 ---- dso/win32/dso.c | 4 ---- include/apr_dso.h | 10 ---------- test/testdso.c | 6 ------ 7 files changed, 38 deletions(-) diff --git a/dso/aix/dso.c b/dso/aix/dso.c index e433985f83b..9c92aa04d83 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -132,10 +132,6 @@ struct dl_info { * add the basic "wrappers" here. */ -ap_status_t ap_dso_init(void){ - return APR_SUCCESS; -} - ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, ap_pool_t *ctx) { diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 2ed8c53de6d..c6ed29f1f0f 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -56,10 +56,6 @@ #if APR_HAS_DSO -ap_status_t ap_dso_init(void){ - return APR_SUCCESS; -} - ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, ap_pool_t *ctx) { diff --git a/dso/os2/dso.c b/dso/os2/dso.c index b95c8680155..5bd913b2e0e 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -60,12 +60,6 @@ #if APR_HAS_DSO -ap_status_t ap_dso_init() -{ - return APR_SUCCESS; -} - - static ap_status_t dso_cleanup(void *thedso) { ap_dso_handle_t *dso = thedso; diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 8892a7dff4d..e20d16014ea 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -56,10 +56,6 @@ #if APR_HAS_DSO -ap_status_t ap_dso_init(void){ - return APR_SUCCESS; -} - ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, ap_pool_t *ctx) { diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 7f395be29b3..fadde87b923 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -56,10 +56,6 @@ #if APR_HAS_DSO -ap_status_t ap_dso_init(void){ - return APR_SUCCESS; -} - ap_status_t ap_dso_load(struct ap_dso_handle_t **res_handle, const char *path, ap_pool_t *ctx) { diff --git a/include/apr_dso.h b/include/apr_dso.h index c5d4568c66c..562f9479f82 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -67,16 +67,6 @@ typedef void * ap_dso_handle_sym_t; /* -=head1 ap_status_t ap_dso_init(void) - -B - -=cut - */ -ap_status_t ap_dso_init(void); - -/* - =head1 ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, ap_pool_t *ctx) B diff --git a/test/testdso.c b/test/testdso.c index 70e1a0a0c9f..110a74f1b88 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -31,12 +31,6 @@ int main (int argc, char ** argv) exit(-1); } - fprintf(stdout,"Initializing DSO's........................."); - if (ap_dso_init() != APR_SUCCESS) { - fprintf(stderr, "Couldn't initialize DSO's !"); - exit (-1); - } - fprintf(stdout,"OK\n"); fprintf(stdout,"Trying to load DSO now....................."); fflush(stdout); if ((status = ap_dso_load(&h, filename, cont)) != APR_SUCCESS){ From d7661f230375743a742ad376a5896831633a1708 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sat, 15 Jul 2000 02:03:05 +0000 Subject: [PATCH 0402/7878] toss in a dependent include git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60377 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/apr_hash.h b/include/apr_hash.h index e70d8b78f49..5172fd830bf 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -63,6 +63,9 @@ extern "C" { #endif +#include "apr_pools.h" + + /* * Abstract type for hash tables. */ From 789fe7476cc3e9eed5f296ddee6a1865ec8a726d Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sat, 15 Jul 2000 02:07:20 +0000 Subject: [PATCH 0403/7878] add ap_full_read() and ap_full_write(). they guarantee to read/write the full buffer unless an error occurs. use the new functions in SDBM and DAV. [and Subversion] Win32 and OS/2 can directly include/use file_io/unix/fullrw.c since it is written in terms of other APR functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60378 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/Makefile.in | 4 ++ file_io/unix/fullrw.c | 98 ++++++++++++++++++++++++++++++++++++++++ include/apr_file_io.h | 54 +++++++++++++++++++++- 3 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 file_io/unix/fullrw.c diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index 7cc3f7ee4ef..eef95f9b37f 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -18,6 +18,7 @@ OBJS=dir.o \ fileacc.o \ filedup.o \ filestat.o \ + fullrw.o \ open.o \ pipe.o \ readwrite.o \ @@ -82,6 +83,9 @@ filestat.o: filestat.c fileio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_tables.h +fullrw.o: fullrw.c $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h open.o: open.c fileio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c new file mode 100644 index 00000000000..8264f142e32 --- /dev/null +++ b/file_io/unix/fullrw.c @@ -0,0 +1,98 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_file_io.h" + + +ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes, + ap_size_t *bytes_read) +{ + ap_status_t status; + ap_size_t total_read = 0; + + do { + ap_ssize_t amt = (ap_ssize_t)nbytes; + + status = ap_read(thefile, buf, &amt); + buf += amt; + nbytes -= amt; + total_read += amt; + } while (status == APR_SUCCESS && nbytes > 0); + + if (bytes_read != NULL) + *bytes_read = total_read; + + return status; +} + +ap_status_t ap_full_write(ap_file_t *thefile, const void *buf, + ap_size_t nbytes, ap_size_t *bytes_written) +{ + ap_status_t status; + ap_size_t total_written = 0; + + do { + ap_ssize_t amt = (ap_ssize_t)nbytes; + + status = ap_write(thefile, buf, &amt); + buf += amt; + nbytes -= amt; + total_written += amt; + } while (status == APR_SUCCESS && nbytes > 0); + + if (bytes_written != NULL) + *bytes_written = total_written; + + return status; +} diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 3b651706102..74c24cf437c 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -281,7 +281,7 @@ B arg 1) The file descriptor to write to. arg 2) The buffer which contains the data. arg 3) On entry, the number of bytes to write; on exit, the number - of bytes write. + of bytes written. B: ap_write will write up to the specified number of bytes, but never more. If the OS cannot write that many bytes, it will write as many as it @@ -325,6 +325,58 @@ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, /* +=head1 ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes, ap_size_t *bytes_read) + +B + + arg 1) The file descriptor to read from. + arg 2) The buffer to store the data to. + arg 3) The number of bytes to read. + arg 4) If non-NULL, this will contain the number of bytes read. + +B: ap_read will read up to the specified number of bytes, but never + more. If there isn't enough data to fill that number of bytes, then the + process/thread will block until it is available or EOF is reached. If a + char was put back into the stream via ungetc, it will be the first + character returned. + + It is possible for both bytes to be read and an APR_EOF or other error + to be returned. + + APR_EINTR is never returned. + +=cut + */ +ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes, + ap_size_t *bytes_read); + +/* + +=head1 ap_status_t ap_full_write(ap_file_t *thefile, const void *buf, ap_size_t nbytes, ap_size_t *bytes_written) + +B + + arg 1) The file descriptor to write to. + arg 2) The buffer which contains the data. + arg 3) The number of bytes to write. + arg 4) If non-NULL, this will contain the number of bytes written. + +B: ap_write will write up to the specified number of bytes, but never + more. If the OS cannot write that many bytes, the process/thread will + block until they can be written. Exceptional error such as "out of space" + or "pipe closed" will terminate with an error. + + It is possible for both bytes to be written and an error to be returned. + + APR_EINTR is never returned. + +=cut + */ +ap_status_t ap_full_write(ap_file_t *thefile, const void *buf, + ap_size_t nbytes, ap_size_t *bytes_written); + +/* + =head1 ap_status_t ap_putc(char ch, ap_file_t *thefile) B From 0be9d1479cbbeea8a0882070d1bb1946e14e53da Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 15 Jul 2000 15:39:05 +0000 Subject: [PATCH 0404/7878] Remove warnings on Tru64 Unix. Basically, long and long long are the same size on Tru64, so if we use long long we get a lot of warnings. This just cleans those up. Submitted by: Dave Hill Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60379 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 8306767fc46..f1fa5223567 100644 --- a/configure.in +++ b/configure.in @@ -336,7 +336,11 @@ if test "$ac_cv_sizeof_long_double" = "8"; then long_value="long double" fi if test "$ac_cv_sizeof_long_long" = "8"; then - long_value="long long" + if test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_long"; then + long_value="long" + else + long_value="long long" + fi fi if test "$ac_cv_sizeof_longlong" = "8"; then long_value="__int64" From 45bb546c39c77f79c5f8e4ec89e71894f2803786 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 15 Jul 2000 16:00:50 +0000 Subject: [PATCH 0405/7878] Add ap_sendfile for Tru64 Unix. This needs to be tested better, but it is a start. Also, add an error message for machines where sendfile is detected, but nobody has written ap_sendfile. Submitted by: Dave Hill Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60380 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 144 ++++++++++++++++++++++++++++++++++++- 1 file changed, 143 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 159359591de..369dc0b22b5 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -633,6 +633,148 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, } return APR_SUCCESS; } +#elif defined(__osf__) && defined (__alpha) +/* + * ap_sendfile for Tru64 Unix. + */ +ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, + ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, + ap_int32_t flags) +{ + off_t nbytes = 0; + int rv, i; + ap_status_t arv; + struct iovec headerstruct[2]; + size_t bytes_to_send = *len; + + /* Ignore flags for now. */ + flags = 0; + + /* + Tru64 can send 1 header and 1 trailer per sendfile(). + with > 1, we have the choice to build 1 header/trailer or + to send them before/after the sendfile. I did the later. + + headerstruct is a 2 iovec array with the first pointing + to the header, the second pointing to the trailer. + iov_len must be set to zero on any not being used. + */ + + if(hdtr->numheaders == 0) { + headerstruct[0].iov_len = 0; + } else if (hdtr->numheaders == 1) { + headerstruct[0].iov_base = hdtr->headers[0].iov_base; + headerstruct[0].iov_len = hdtr->headers[0].iov_len; + } else { + ap_size_t hdrbytes = 0; + /* sending them in bits.. if more than one header/trailer */ + headerstruct[0].iov_len = 0; + + arv = ap_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); + if (arv != APR_SUCCESS) { + *len = 0; + return errno; + } + + nbytes += hdrbytes; + + /* If this was a partial write and we aren't doing timeouts, + * return now with the partial byte count; this is a non-blocking + * socket. + */ + if (sock->timeout <= 0) { + ap_size_t total_hdrbytes = 0; + for (i = 0; i < hdtr->numheaders; i++) { + total_hdrbytes += hdtr->headers[i].iov_len; + } + if (hdrbytes < total_hdrbytes) { + *len = hdrbytes; + return APR_SUCCESS; + } + } + } + + if(hdtr->numtrailers == 0) { + headerstruct[1].iov_len = 0; + } else if (hdtr->numtrailers == 1) { + headerstruct[1].iov_base = hdtr->trailers[0].iov_base; + headerstruct[1].iov_len = hdtr->trailers[0].iov_len; + } else { + /* we will send them after the file as more than one */ + headerstruct[1].iov_len = 0; + } + + if (bytes_to_send) { + /* We won't dare call sendfile() if we don't have + * header or file bytes to send because bytes_to_send == 0 + * means send the whole file. + */ + do { + rv = sendfile( + sock->socketdes, /* socket */ + file->filedes, /* file to be sent */ + *offset, /* where in the file to start */ + bytes_to_send, /* number of bytes to send */ + headerstruct, /* Headers/footers */ + flags); /* currently unused */ + } while (rv == -1 && errno == EINTR); + } else + rv = 0; + + if (rv == -1 && + (errno == EAGAIN || errno == EWOULDBLOCK) && + sock->timeout > 0) { + ap_status_t arv = wait_for_io_or_timeout(sock, 0); + + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } + else { + do { + rv = sendfile( + sock->socketdes, /* socket */ + file->filedes, /* file to be sent */ + *offset, /* where in the file to start */ + bytes_to_send, /* number of bytes to send */ + headerstruct, /* Headers/footers */ + flags /* undefined, set to 0 */ + ); + } while (rv == -1 && errno == EINTR); + } + } + + if(rv != -1) { + nbytes += rv; + } + + if((rv != -1) && (hdtr->numtrailers > 1)) { + ap_size_t trlbytes = 0; + + /* send the trailers now */ + arv = ap_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trlbytes); + if (arv != APR_SUCCESS) { + *len = 0; + return errno; + } + + nbytes += trlbytes; + } + + /* + question: + should this be the sum of all of them ? + sendfile returns a total byte count incl headers/trailers + but when headers/trailers is > 1 hdrbytes and trlbytes + will be non-zero + */ + (*len) = nbytes; + + return (rv < 0) ? errno : APR_SUCCESS; +} #else -#endif /* __linux__, __FreeBSD__, __HPUX__, _AIX */ +#error APR has detected sendfile on your system, but nobody has written a +#error version of it for APR yet. To get past this, either write ap_sendfile +#error or change APR_HAS_SENDFILE in apr.h to 0. +#endif /* __linux__, __FreeBSD__, __HPUX__, _AIX, Tru64/OSF1 */ #endif /* APR_HAS_SENDFILE */ From e706cb2079c2ebd28be6a180e109654932f36425 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 15 Jul 2000 16:08:00 +0000 Subject: [PATCH 0406/7878] Fix broken symbol PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60381 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 2 +- libapr.def | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aprlib.def b/aprlib.def index 869b01f3aea..5e64ca2e58f 100644 --- a/aprlib.def +++ b/aprlib.def @@ -240,7 +240,7 @@ EXPORTS ap_dso_load @219 ap_dso_unload @220 ap_dso_sym @221 - ap_dso_init @222 +; ap_dso_init @222 ap_collapse_spaces @223 ap_month_snames @224 ap_day_snames @225 diff --git a/libapr.def b/libapr.def index 869b01f3aea..5e64ca2e58f 100644 --- a/libapr.def +++ b/libapr.def @@ -240,7 +240,7 @@ EXPORTS ap_dso_load @219 ap_dso_unload @220 ap_dso_sym @221 - ap_dso_init @222 +; ap_dso_init @222 ap_collapse_spaces @223 ap_month_snames @224 ap_day_snames @225 From 68c14ef570411687e999c34b7ff3ad1b132a23ca Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 15 Jul 2000 16:14:31 +0000 Subject: [PATCH 0407/7878] Clean up the detection of various versions of AIX. This has one glaring annoyance; xlC must be detected early on, and passed a certain flag to quit on needed error conditions. Submitted by: Victor J. Orlikowski Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60382 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 67 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 23 deletions(-) diff --git a/hints.m4 b/hints.m4 index b03f56f3019..eeb943d43b4 100644 --- a/hints.m4 +++ b/hints.m4 @@ -77,30 +77,51 @@ case "$PLAT" in APR_SETIFNULL(LIBS, [-lposix -lbsd]) APR_SETIFNULL(LDFLAGS, [-s]) ;; - i386-ibm-aix*) - APR_SETIFNULL(CFLAGS, [-DAIX=1 -U__STR__ -DUSEBCOPY]) - ;; - *-ibm-aix[1-2].*) - APR_SETIFNULL(CFLAGS, [-DAIX=1 -DNEED_RLIM_T -U__STR__]) - ;; - *-ibm-aix3.*) - APR_SETIFNULL(CFLAGS, [-DAIX=30 -DNEED_RLIM_T -U__STR__]) - ;; - *-ibm-aix4.1) - APR_SETIFNULL(CFLAGS, [-DAIX=41 -DNEED_RLIM_T -U__STR__]) - ;; - *-ibm-aix4.2) - APR_SETIFNULL(CFLAGS, [-DAIX=42 -U__STR__]) - APR_SETIFNULL(LDFLAGS, [-lm]) - ;; - *-ibm-aix4.3) - APR_SETIFNULL(CFLAGS, [-DAIX=43 -U__STR__]) - APR_SETIFNULL(LDFLAGS, [-lm]) - ;; *-ibm-aix*) - APR_SETIFNULL(CFLAGS, [-DAIX=1 -U__STR__]) - APR_SETIFNULL(LDFLAGS, [-lm]) - ;; + case $PLAT in + i386-ibm-aix*) + APR_SETIFNULL(CFLAGS, [-U__STR__ -DUSEBCOPY]) + ;; + *-ibm-aix[1-2].*) + APR_SETIFNULL(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + ;; + *-ibm-aix3.*) + APR_SETIFNULL(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + ;; + *-ibm-aix4.1) + APR_SETIFNULL(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + ;; + *-ibm-aix4.1.*) + APR_SETIFNULL(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + ;; + *-ibm-aix4.2) + APR_SETIFNULL(CFLAGS, [-U__STR__]) + APR_SETIFNULL(LDFLAGS, [-lm]) + ;; + *-ibm-aix4.2.*) + APR_SETIFNULL(CFLAGS, [-U__STR__]) + APR_SETIFNULL(LDFLAGS, [-lm]) + ;; + *-ibm-aix4.3) + APR_SETIFNULL(CFLAGS, [-D_USE_IRS -U__STR__]) + APR_SETIFNULL(LDFLAGS, [-lm]) + ;; + *-ibm-aix4.3.*) + APR_SETIFNULL(CFLAGS, [-D_USE_IRS -U__STR__]) + APR_SETIFNULL(LDFLAGS, [-lm]) + ;; + *-ibm-aix*) + APR_SETIFNULL(CFLAGS, [-U__STR__]) + APR_SETIFNULL(LDFLAGS, [-lm]) + ;; + esac + dnl Must do a check for gcc or egcs here, to get the right options + dnl to the compiler. + AC_PROG_CC + if test "$GCC" != "yes"; then + APR_ADDTO(CFLAGS, [-qHALT=E]) + fi + ;; *-apollo-*) APR_SETIFNULL(CFLAGS, [-DAPOLLO]) ;; From a3f344118b6f5fa97f4e9abb39da5e722b7b1e68 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 17 Jul 2000 23:49:35 +0000 Subject: [PATCH 0408/7878] Remove the ap_bucket_list type. This moves the next/prev pointers down to the ap_bucket type. The reasoning behind the bucket_list was never very clear, and there were some annoyming memory leaks caused by keeping that type filters. This also cleans up those memory leaks. finally, this tightens up the API a bit more. Submitted by: Cliff Woolley Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60383 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 87 ++++------ buckets/ap_eos_buf.c | 2 +- buckets/ap_mmap_buf.c | 2 +- buckets/ap_rmem_buf.c | 2 +- buckets/ap_rwmem_buf.c | 2 +- buckets/apr_buf.h | 34 ++-- buckets/ryan.patch | 376 +++++++++++++++++++++++++++++++++++++---- 7 files changed, 384 insertions(+), 121 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 604deacefd2..fe6eed15693 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -100,12 +100,27 @@ APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e) APR_EXPORT(ap_status_t) ap_bucket_brigade_destroy(void *data) { ap_bucket_brigade *b = data; - ap_bucket_list *bl = b->head; - ap_destroy_bucket_list(bl); + ap_bucket_list_destroy(b->head); + /* The brigade itself is allocated out of a pool, so we don't actually + * want to free it. If we did, we would do that free() here. + */ + + return APR_SUCCESS; +} +APR_EXPORT(ap_status_t) ap_bucket_list_destroy(ap_bucket *e) +{ + ap_bucket *cur = e; + ap_bucket *next; + + while (cur) { + next = cur->next; + ap_bucket_destroy(cur); + cur = next; + } return APR_SUCCESS; -} +} APR_EXPORT(ap_bucket_brigade *) ap_bucket_brigade_create(ap_pool_t *p) { @@ -120,18 +135,10 @@ APR_EXPORT(ap_bucket_brigade *) ap_bucket_brigade_create(ap_pool_t *p) return b; } -APR_EXPORT(ap_bucket_list *) ap_bucket_list_create(void) +APR_EXPORT(void) ap_bucket_brigade_append_buckets(ap_bucket_brigade *b, + ap_bucket *e) { - ap_bucket_list *b; - - b = calloc(1, sizeof(*b)); - return b; -} - -APR_EXPORT(void) ap_bucket_brigade_append_list(ap_bucket_brigade *b, - ap_bucket_list *e) -{ - ap_bucket_list *cur = e; + ap_bucket *cur = e; if (b->tail) { b->tail->next = e; @@ -146,37 +153,17 @@ APR_EXPORT(void) ap_bucket_brigade_append_list(ap_bucket_brigade *b, } } -APR_EXPORT(void) ap_bucket_brigade_append_bucket(ap_bucket_brigade *b, - ap_bucket *r) -{ - if (b->tail) { - if (b->tail->bucket == NULL) { - b->tail->bucket = r; - } - else { - b->tail->next = ap_bucket_list_create(); - b->tail->next->prev = b->tail; - b->tail = b->tail->next; - b->tail->bucket = r; - } - } - else { - b->head = b->tail = ap_bucket_list_create(); - b->tail->bucket = r; - } -} - APR_EXPORT(int) ap_bucket_brigade_to_iovec(ap_bucket_brigade *b, struct iovec *vec, int nvec) { - ap_bucket_list *e; + ap_bucket *e; struct iovec *orig; orig = vec; e = b->head; while (e && nvec) { - vec->iov_base = (void *)ap_get_bucket_char_str(e->bucket); - vec->iov_len = ap_get_bucket_len(e->bucket); + vec->iov_base = (void *)ap_get_bucket_char_str(e); + vec->iov_len = ap_get_bucket_len(e); e = e->next; --nvec; ++vec; @@ -207,12 +194,12 @@ APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec) for (i=0; i < nvec; i++) { if (b->head == b->tail) { - ap_bucket_destroy(b->head->bucket); + ap_bucket_destroy(b->head); b->head = b->tail = NULL; break; } b->head = b->head->next; - ap_bucket_destroy(b->head->prev->bucket); + ap_bucket_destroy(b->head->prev); b->head->prev = NULL; } } @@ -241,17 +228,6 @@ APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, return APR_SUCCESS; } -APR_EXPORT(ap_status_t) ap_destroy_bucket_list(ap_bucket_list *buf) -{ - ap_bucket_list *dptr = buf; - - while (dptr) { - ap_bucket_destroy(dptr->bucket); - dptr = dptr->next; - } - return APR_SUCCESS; -} - APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b) { if (b) { @@ -275,10 +251,9 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) int j, k, rv; ap_ssize_t i; - if (b->tail && b->tail->bucket && - b->tail->bucket->color == AP_BUCKET_rwmem) { + if (b->tail && b->tail->color == AP_BUCKET_rwmem) { ap_bucket *rw; - rw = b->tail->bucket; + rw = b->tail; /* I have no idea if this is a good idea or not. Probably not. * Basically, if the last bucket in the list is a rwmem bucket, * then we just add to it instead of allocating a new read only @@ -298,7 +273,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) } k += i; - ap_bucket_brigade_append_bucket(b, rw); + ap_bucket_brigade_append_buckets(b, rw); } } @@ -316,7 +291,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) } k += i; - ap_bucket_brigade_append_bucket(b, r); + ap_bucket_brigade_append_buckets(b, r); } return k; @@ -346,7 +321,7 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis r = ap_bucket_new(AP_BUCKET_rwmem); res = r->insert(r, buf, strlen(buf), &i); - ap_bucket_brigade_append_bucket(b, r); + ap_bucket_brigade_append_buckets(b, r); return res; } diff --git a/buckets/ap_eos_buf.c b/buckets/ap_eos_buf.c index 3b53feb2282..0a788abafe6 100644 --- a/buckets/ap_eos_buf.c +++ b/buckets/ap_eos_buf.c @@ -73,7 +73,7 @@ APR_EXPORT(ap_bucket *) ap_eos_create(void) { ap_bucket *newbuf; - newbuf = malloc(sizeof(*newbuf)); + newbuf = calloc(1, sizeof(*newbuf)); newbuf->color = AP_BUCKET_eos; newbuf->getstr = eos_get_str; diff --git a/buckets/ap_mmap_buf.c b/buckets/ap_mmap_buf.c index d51ecd3c545..d99ee903e80 100644 --- a/buckets/ap_mmap_buf.c +++ b/buckets/ap_mmap_buf.c @@ -89,7 +89,7 @@ APR_EXPORT(ap_bucket *) ap_mmap_bucket_create(void) ap_bucket *newbuf; ap_bucket_mmap *b; - newbuf = malloc(sizeof(*newbuf)); + newbuf = calloc(1, sizeof(*newbuf)); b = malloc(sizeof(*b)); b->data = NULL; diff --git a/buckets/ap_rmem_buf.c b/buckets/ap_rmem_buf.c index 40e78f56834..55aeaaff53a 100644 --- a/buckets/ap_rmem_buf.c +++ b/buckets/ap_rmem_buf.c @@ -106,7 +106,7 @@ APR_EXPORT(ap_bucket *) ap_rmem_create(void) ap_bucket *newbuf; ap_bucket_rmem *b; - newbuf = malloc(sizeof(*newbuf)); + newbuf = calloc(1, sizeof(*newbuf)); b = malloc(sizeof(*b)); b->alloc_len = 0; diff --git a/buckets/ap_rwmem_buf.c b/buckets/ap_rwmem_buf.c index f7ce26e6420..6b01c3af5ac 100644 --- a/buckets/ap_rwmem_buf.c +++ b/buckets/ap_rwmem_buf.c @@ -124,7 +124,7 @@ APR_EXPORT(ap_bucket *) ap_rwmem_create(void) ap_bucket *newbuf; ap_bucket_rwmem *b; - newbuf = malloc(sizeof(*newbuf)); + newbuf = calloc(1, sizeof(*newbuf)); b = malloc(sizeof(*b)); b->alloc_addr = calloc(DEFAULT_RWBUF_SIZE, 1); diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index 512e0660477..aeb0b34e690 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -95,13 +95,8 @@ struct ap_bucket { * into the bucket. */ int (*insert)(ap_bucket *e, const void *buf, ap_size_t nbytes, ap_ssize_t *w); -}; - -typedef struct ap_bucket_list ap_bucket_list; -struct ap_bucket_list { - ap_bucket *bucket; /* The bucket */ - ap_bucket_list *next; /* The next node in the bucket list */ - ap_bucket_list *prev; /* The prev node in the bucket list */ + ap_bucket *next; /* The next node in the bucket list */ + ap_bucket *prev; /* The prev node in the bucket list */ }; typedef struct ap_bucket_brigade ap_bucket_brigade; @@ -111,8 +106,8 @@ struct ap_bucket_brigade { but this lets me register a cleanup to put a limit on the brigade's lifetime. */ - ap_bucket_list *head; /* The start of the brigade */ - ap_bucket_list *tail; /* The end of the brigade */ + ap_bucket *head; /* The start of the brigade */ + ap_bucket *tail; /* The end of the brigade */ }; /* ****** Different bucket types *****/ @@ -152,13 +147,9 @@ APR_EXPORT(ap_bucket_brigade *) ap_bucket_brigade_create(ap_pool_t *p); /* destroy an enitre bucket brigade */ APR_EXPORT(ap_status_t) ap_bucket_brigade_destroy(void *b); -/* append a bucket_list to a bucket_brigade */ -APR_EXPORT(void) ap_bucket_brigade_append_list(ap_bucket_brigade *b, - ap_bucket_list *e); - -/* append a bucket to a bucket_brigade */ -APR_EXPORT(void) ap_bucket_brigade_append_bucket(ap_bucket_brigade *b, - ap_bucket *r); +/* append bucket(s) to a bucket_brigade */ +APR_EXPORT(void) ap_bucket_brigade_append_buckets(ap_bucket_brigade *b, + ap_bucket *e); /* consume nbytes from beginning of b -- call ap_bucket_destroy as appropriate, and/or modify start on last element */ @@ -189,14 +180,6 @@ APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...); APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_list va); -/* ****** Bucket List Functions ***** */ - -/* create a new bucket_list */ -APR_EXPORT(ap_bucket_list *) ap_bucket_list_create(void); - -/* destroy an entire bucket_list */ -APR_EXPORT(ap_status_t) ap_destroy_bucket_list(ap_bucket_list *b); - /* ****** Bucket Functions ***** */ /* allocate a bucket of type color */ @@ -205,6 +188,9 @@ APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color); /* destroy a bucket */ APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e); +/* destroy an entire list of buckets */ +APR_EXPORT(ap_status_t) ap_bucket_list_destroy(ap_bucket *e); + /* Convert a bucket to a char * */ APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b); diff --git a/buckets/ryan.patch b/buckets/ryan.patch index 671a6669ecc..90147490861 100644 --- a/buckets/ryan.patch +++ b/buckets/ryan.patch @@ -1,9 +1,6 @@ -? build.log -? build.err -? .inslog2 ? include/util_filter.h +? lib/apr/buckets/Makefile.in ? lib/apr/include/apr_buf.h -? lib/apr/shmem/config.cache ? main/util_filter.c Index: ap/Makefile.in =================================================================== @@ -11,7 +8,7 @@ RCS file: /home/cvs/apache-2.0/src/ap/Makefile.in,v retrieving revision 1.4 diff -u -d -b -w -u -r1.4 Makefile.in --- ap/Makefile.in 2000/06/12 20:41:13 1.4 -+++ ap/Makefile.in 2000/07/14 00:24:57 ++++ ap/Makefile.in 2000/07/17 23:40:28 @@ -1,5 +1,5 @@ LTLIBRARY_NAME = libap.la @@ -25,7 +22,7 @@ RCS file: /home/cvs/apache-2.0/src/include/ap_iol.h,v retrieving revision 1.19 diff -u -d -b -w -u -r1.19 ap_iol.h --- include/ap_iol.h 2000/05/29 04:22:02 1.19 -+++ include/ap_iol.h 2000/07/14 00:24:57 ++++ include/ap_iol.h 2000/07/17 23:40:31 @@ -58,6 +58,7 @@ #define AP_IOL_H @@ -40,7 +37,7 @@ RCS file: /home/cvs/apache-2.0/src/include/http_protocol.h,v retrieving revision 1.19 diff -u -d -b -w -u -r1.19 http_protocol.h --- include/http_protocol.h 2000/07/11 03:48:17 1.19 -+++ include/http_protocol.h 2000/07/14 00:24:57 ++++ include/http_protocol.h 2000/07/17 23:40:31 @@ -89,8 +89,15 @@ API_EXPORT(void) ap_basic_http_header(request_rec *r); @@ -64,7 +61,7 @@ RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v retrieving revision 1.64 diff -u -d -b -w -u -r1.64 httpd.h --- include/httpd.h 2000/06/30 21:18:13 1.64 -+++ include/httpd.h 2000/07/14 00:24:57 ++++ include/httpd.h 2000/07/17 23:40:32 @@ -596,6 +596,11 @@ * pointer back to the main request. */ @@ -80,11 +77,11 @@ diff -u -d -b -w -u -r1.64 httpd.h Index: lib/apr/configure.in =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v -retrieving revision 1.133 -diff -u -d -b -w -u -r1.133 configure.in ---- lib/apr/configure.in 2000/07/13 03:41:04 1.133 -+++ lib/apr/configure.in 2000/07/14 00:24:58 -@@ -678,8 +678,8 @@ +retrieving revision 1.136 +diff -u -d -b -w -u -r1.136 configure.in +--- lib/apr/configure.in 2000/07/15 15:39:05 1.136 ++++ lib/apr/configure.in 2000/07/17 23:40:32 +@@ -682,8 +682,8 @@ AC_SUBST(EXEEXT) echo "Construct Makefiles and header files." @@ -95,13 +92,325 @@ diff -u -d -b -w -u -r1.133 configure.in for dir in $MODULES do test -d $dir || $MKDIR -p $dir +Index: lib/apr/buckets/ap_buf.c +=================================================================== +RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_buf.c,v +retrieving revision 1.12 +diff -u -d -b -w -u -r1.12 ap_buf.c +--- lib/apr/buckets/ap_buf.c 2000/07/14 00:24:33 1.12 ++++ lib/apr/buckets/ap_buf.c 2000/07/17 23:40:33 +@@ -100,10 +100,25 @@ + APR_EXPORT(ap_status_t) ap_bucket_brigade_destroy(void *data) + { + ap_bucket_brigade *b = data; +- ap_bucket_list *bl = b->head; + +- ap_destroy_bucket_list(bl); ++ ap_bucket_list_destroy(b->head); ++ /* The brigade itself is allocated out of a pool, so we don't actually ++ * want to free it. If we did, we would do that free() here. ++ */ ++ ++ return APR_SUCCESS; ++} ++ ++APR_EXPORT(ap_status_t) ap_bucket_list_destroy(ap_bucket *e) ++{ ++ ap_bucket *cur = e; ++ ap_bucket *next; + ++ while (cur) { ++ next = cur->next; ++ ap_bucket_destroy(cur); ++ cur = next; ++ } + return APR_SUCCESS; + } + +@@ -120,18 +135,10 @@ + return b; + } + +-APR_EXPORT(ap_bucket_list *) ap_bucket_list_create(void) +-{ +- ap_bucket_list *b; +- +- b = calloc(1, sizeof(*b)); +- return b; +-} +- +-APR_EXPORT(void) ap_bucket_brigade_append_list(ap_bucket_brigade *b, +- ap_bucket_list *e) ++APR_EXPORT(void) ap_bucket_brigade_append_buckets(ap_bucket_brigade *b, ++ ap_bucket *e) + { +- ap_bucket_list *cur = e; ++ ap_bucket *cur = e; + + if (b->tail) { + b->tail->next = e; +@@ -146,37 +153,17 @@ + } + } + +-APR_EXPORT(void) ap_bucket_brigade_append_bucket(ap_bucket_brigade *b, +- ap_bucket *r) +-{ +- if (b->tail) { +- if (b->tail->bucket == NULL) { +- b->tail->bucket = r; +- } +- else { +- b->tail->next = ap_bucket_list_create(); +- b->tail->next->prev = b->tail; +- b->tail = b->tail->next; +- b->tail->bucket = r; +- } +- } +- else { +- b->head = b->tail = ap_bucket_list_create(); +- b->tail->bucket = r; +- } +-} +- + APR_EXPORT(int) ap_bucket_brigade_to_iovec(ap_bucket_brigade *b, + struct iovec *vec, int nvec) + { +- ap_bucket_list *e; ++ ap_bucket *e; + struct iovec *orig; + + orig = vec; + e = b->head; + while (e && nvec) { +- vec->iov_base = (void *)ap_get_bucket_char_str(e->bucket); +- vec->iov_len = ap_get_bucket_len(e->bucket); ++ vec->iov_base = (void *)ap_get_bucket_char_str(e); ++ vec->iov_len = ap_get_bucket_len(e); + e = e->next; + --nvec; + ++vec; +@@ -207,12 +194,12 @@ + + for (i=0; i < nvec; i++) { + if (b->head == b->tail) { +- ap_bucket_destroy(b->head->bucket); ++ ap_bucket_destroy(b->head); + b->head = b->tail = NULL; + break; + } + b->head = b->head->next; +- ap_bucket_destroy(b->head->prev->bucket); ++ ap_bucket_destroy(b->head->prev); + b->head->prev = NULL; + } + } +@@ -241,17 +228,6 @@ + return APR_SUCCESS; + } + +-APR_EXPORT(ap_status_t) ap_destroy_bucket_list(ap_bucket_list *buf) +-{ +- ap_bucket_list *dptr = buf; +- +- while (dptr) { +- ap_bucket_destroy(dptr->bucket); +- dptr = dptr->next; +- } +- return APR_SUCCESS; +-} +- + APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b) + { + if (b) { +@@ -275,10 +251,9 @@ + int j, k, rv; + ap_ssize_t i; + +- if (b->tail && b->tail->bucket && +- b->tail->bucket->color == AP_BUCKET_rwmem) { ++ if (b->tail && b->tail->color == AP_BUCKET_rwmem) { + ap_bucket *rw; +- rw = b->tail->bucket; ++ rw = b->tail; + /* I have no idea if this is a good idea or not. Probably not. + * Basically, if the last bucket in the list is a rwmem bucket, + * then we just add to it instead of allocating a new read only +@@ -298,7 +273,7 @@ + } + k += i; + +- ap_bucket_brigade_append_bucket(b, rw); ++ ap_bucket_brigade_append_buckets(b, rw); + } + } + +@@ -316,7 +291,7 @@ + } + k += i; + +- ap_bucket_brigade_append_bucket(b, r); ++ ap_bucket_brigade_append_buckets(b, r); + } + + return k; +@@ -346,7 +321,7 @@ + + r = ap_bucket_new(AP_BUCKET_rwmem); + res = r->insert(r, buf, strlen(buf), &i); +- ap_bucket_brigade_append_bucket(b, r); ++ ap_bucket_brigade_append_buckets(b, r); + + return res; + } +Index: lib/apr/buckets/ap_eos_buf.c +=================================================================== +RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_eos_buf.c,v +retrieving revision 1.1 +diff -u -d -b -w -u -r1.1 ap_eos_buf.c +--- lib/apr/buckets/ap_eos_buf.c 2000/07/13 21:48:33 1.1 ++++ lib/apr/buckets/ap_eos_buf.c 2000/07/17 23:40:33 +@@ -73,7 +73,7 @@ + { + ap_bucket *newbuf; + +- newbuf = malloc(sizeof(*newbuf)); ++ newbuf = calloc(1, sizeof(*newbuf)); + + newbuf->color = AP_BUCKET_eos; + newbuf->getstr = eos_get_str; +Index: lib/apr/buckets/ap_mmap_buf.c +=================================================================== +RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_mmap_buf.c,v +retrieving revision 1.4 +diff -u -d -b -w -u -r1.4 ap_mmap_buf.c +--- lib/apr/buckets/ap_mmap_buf.c 2000/07/14 00:24:33 1.4 ++++ lib/apr/buckets/ap_mmap_buf.c 2000/07/17 23:40:33 +@@ -89,7 +89,7 @@ + ap_bucket *newbuf; + ap_bucket_mmap *b; + +- newbuf = malloc(sizeof(*newbuf)); ++ newbuf = calloc(1, sizeof(*newbuf)); + b = malloc(sizeof(*b)); + + b->data = NULL; +Index: lib/apr/buckets/ap_rmem_buf.c +=================================================================== +RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_rmem_buf.c,v +retrieving revision 1.5 +diff -u -d -b -w -u -r1.5 ap_rmem_buf.c +--- lib/apr/buckets/ap_rmem_buf.c 2000/07/14 00:24:33 1.5 ++++ lib/apr/buckets/ap_rmem_buf.c 2000/07/17 23:40:33 +@@ -106,7 +106,7 @@ + ap_bucket *newbuf; + ap_bucket_rmem *b; + +- newbuf = malloc(sizeof(*newbuf)); ++ newbuf = calloc(1, sizeof(*newbuf)); + b = malloc(sizeof(*b)); + + b->alloc_len = 0; +Index: lib/apr/buckets/ap_rwmem_buf.c +=================================================================== +RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_rwmem_buf.c,v +retrieving revision 1.5 +diff -u -d -b -w -u -r1.5 ap_rwmem_buf.c +--- lib/apr/buckets/ap_rwmem_buf.c 2000/07/14 00:24:33 1.5 ++++ lib/apr/buckets/ap_rwmem_buf.c 2000/07/17 23:40:33 +@@ -124,7 +124,7 @@ + ap_bucket *newbuf; + ap_bucket_rwmem *b; + +- newbuf = malloc(sizeof(*newbuf)); ++ newbuf = calloc(1, sizeof(*newbuf)); + b = malloc(sizeof(*b)); + + b->alloc_addr = calloc(DEFAULT_RWBUF_SIZE, 1); +Index: lib/apr/buckets/apr_buf.h +=================================================================== +RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/apr_buf.h,v +retrieving revision 1.13 +diff -u -d -b -w -u -r1.13 apr_buf.h +--- lib/apr/buckets/apr_buf.h 2000/07/14 00:24:33 1.13 ++++ lib/apr/buckets/apr_buf.h 2000/07/17 23:40:33 +@@ -95,13 +95,8 @@ + * into the bucket. + */ + int (*insert)(ap_bucket *e, const void *buf, ap_size_t nbytes, ap_ssize_t *w); +-}; +- +-typedef struct ap_bucket_list ap_bucket_list; +-struct ap_bucket_list { +- ap_bucket *bucket; /* The bucket */ +- ap_bucket_list *next; /* The next node in the bucket list */ +- ap_bucket_list *prev; /* The prev node in the bucket list */ ++ ap_bucket *next; /* The next node in the bucket list */ ++ ap_bucket *prev; /* The prev node in the bucket list */ + }; + + typedef struct ap_bucket_brigade ap_bucket_brigade; +@@ -111,8 +106,8 @@ + but this lets me register a cleanup + to put a limit on the brigade's + lifetime. */ +- ap_bucket_list *head; /* The start of the brigade */ +- ap_bucket_list *tail; /* The end of the brigade */ ++ ap_bucket *head; /* The start of the brigade */ ++ ap_bucket *tail; /* The end of the brigade */ + }; + + /* ****** Different bucket types *****/ +@@ -151,14 +146,10 @@ + + /* destroy an enitre bucket brigade */ + APR_EXPORT(ap_status_t) ap_bucket_brigade_destroy(void *b); +- +-/* append a bucket_list to a bucket_brigade */ +-APR_EXPORT(void) ap_bucket_brigade_append_list(ap_bucket_brigade *b, +- ap_bucket_list *e); + +-/* append a bucket to a bucket_brigade */ +-APR_EXPORT(void) ap_bucket_brigade_append_bucket(ap_bucket_brigade *b, +- ap_bucket *r); ++/* append bucket(s) to a bucket_brigade */ ++APR_EXPORT(void) ap_bucket_brigade_append_buckets(ap_bucket_brigade *b, ++ ap_bucket *e); + + /* consume nbytes from beginning of b -- call ap_bucket_destroy as + appropriate, and/or modify start on last element */ +@@ -189,14 +180,6 @@ + + APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_list va); + +-/* ****** Bucket List Functions ***** */ +- +-/* create a new bucket_list */ +-APR_EXPORT(ap_bucket_list *) ap_bucket_list_create(void); +- +-/* destroy an entire bucket_list */ +-APR_EXPORT(ap_status_t) ap_destroy_bucket_list(ap_bucket_list *b); +- + /* ****** Bucket Functions ***** */ + + /* allocate a bucket of type color */ +@@ -204,6 +187,9 @@ + + /* destroy a bucket */ + APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e); ++ ++/* destroy an entire list of buckets */ ++APR_EXPORT(ap_status_t) ap_bucket_list_destroy(ap_bucket *e); + + /* Convert a bucket to a char * */ + APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b); Index: main/Makefile.in =================================================================== RCS file: /home/cvs/apache-2.0/src/main/Makefile.in,v retrieving revision 1.16 diff -u -d -b -w -u -r1.16 Makefile.in --- main/Makefile.in 2000/07/01 14:14:15 1.16 -+++ main/Makefile.in 2000/07/14 00:25:04 ++++ main/Makefile.in 2000/07/17 23:40:52 @@ -8,7 +8,7 @@ http_protocol.c http_request.c http_vhost.c util.c util_date.c \ util_script.c util_uri.c util_md5.c util_cfgtree.c util_ebcdic.c \ @@ -117,7 +426,7 @@ RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v retrieving revision 1.88 diff -u -d -b -w -u -r1.88 http_core.c --- main/http_core.c 2000/07/11 03:48:18 1.88 -+++ main/http_core.c 2000/07/14 00:25:04 ++++ main/http_core.c 2000/07/17 23:40:52 @@ -71,6 +71,8 @@ #include "util_md5.h" #include "apr_fnmatch.h" @@ -156,7 +465,7 @@ diff -u -d -b -w -u -r1.88 http_core.c +static int core_filter(request_rec *r, ap_filter_t *f, ap_bucket_brigade *b) +{ + ap_ssize_t bytes_sent; -+ ap_bucket_list *dptr; ++ ap_bucket *dptr; + int len = 0; + + if (!r->headers_sent) { @@ -174,10 +483,10 @@ diff -u -d -b -w -u -r1.88 http_core.c + */ + dptr = b->head; + while (dptr) { -+ len += ap_get_bucket_len(dptr->bucket); ++ len += ap_get_bucket_len(dptr); + dptr = dptr->next; + } -+ if (len < MIN_SIZE_TO_WRITE && b->tail->bucket->color != AP_BUCKET_eos) { ++ if (len < MIN_SIZE_TO_WRITE && b->tail->color != AP_BUCKET_eos) { + ap_save_data_to_filter(r, f, b); + return 0; + } @@ -217,7 +526,7 @@ RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v retrieving revision 1.96 diff -u -d -b -w -u -r1.96 http_protocol.c --- main/http_protocol.c 2000/07/13 16:26:42 1.96 -+++ main/http_protocol.c 2000/07/14 00:25:04 ++++ main/http_protocol.c 2000/07/17 23:40:52 @@ -64,6 +64,8 @@ */ @@ -246,12 +555,12 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + ap_bucket_brigade *bb = NULL; + ap_bucket *b = NULL; + ap_filter_t *f; -+ + + /* if you are using the older API's, then Apache will initiate the + * filtering for you. + */ + f = ap_init_filter(r->pool); - ++ if (length == 0) return 0; @@ -264,7 +573,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c while (!r->connection->aborted && offset < length) { if (length - offset > MMAP_SEGMENT_SIZE) { n = MMAP_SEGMENT_SIZE; -@@ -2467,76 +2477,137 @@ +@@ -2467,76 +2477,132 @@ total_bytes_sent += w; offset += w; } @@ -276,10 +585,9 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + * that does all of this for us. + */ + bb = ap_bucket_brigade_create(r->pool); -+ bb->head = bb->tail = ap_bucket_list_create(); + b = ap_bucket_new(AP_BUCKET_mmap); + b->insert(b, mm, mm->size, &total_bytes_sent); -+ bb->head->bucket = b; ++ bb->head = bb->tail = b; + total_bytes_sent = ap_pass_brigade(r, f, bb); + return total_bytes_sent; @@ -311,10 +619,9 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + * that does all of this for us. + */ + bb = ap_bucket_brigade_create(r->pool); -+ bb->head = bb->tail = ap_bucket_list_create(); + b = ap_bucket_new(AP_BUCKET_rwmem); + b->insert(b, &c, 1, &written); -+ bb->head->bucket = b; ++ bb->head = bb->tail = b; + ap_pass_brigade(r, f, bb); + return c; @@ -348,10 +655,9 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + * that does all of this for us. + */ + bb = ap_bucket_brigade_create(r->pool); -+ bb->head = bb->tail = ap_bucket_list_create(); + b = ap_bucket_new(AP_BUCKET_rwmem); + b->insert(b, str, strlen(str), &written); -+ bb->head->bucket = b; ++ bb->head = bb->tail = b; + ap_pass_brigade(r, f, bb); + + return written; @@ -387,10 +693,9 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + * that does all of this for us. + */ + bb = ap_bucket_brigade_create(r->pool); -+ bb->head = bb->tail = ap_bucket_list_create(); + b = ap_bucket_new(AP_BUCKET_rwmem); + b->insert(b, buf, nbyte, &written); -+ bb->head->bucket = b; ++ bb->head = bb->tail = b; + ap_pass_brigade(r, f, bb); + return written; } @@ -422,7 +727,6 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + * that does all of this for us. + */ + bb = ap_bucket_brigade_create(r->pool); -+ bb->head = bb->tail = ap_bucket_list_create(); + written = ap_brigade_vprintf(bb, fmt, va); + ap_pass_brigade(r, f, bb); + return written; @@ -434,7 +738,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c API_EXPORT_NONSTD(int) ap_rprintf(request_rec *r, const char *fmt, ...) { va_list va; -@@ -2546,46 +2617,60 @@ +@@ -2546,46 +2612,58 @@ return EOF; va_start(va, fmt); @@ -471,7 +775,6 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + * that does all of this for us. + */ + bb = ap_bucket_brigade_create(r->pool); -+ bb->head = bb->tail = ap_bucket_list_create(); va_start(va, r); - n = ap_vbputstrs(r->connection->client, va); + written = ap_brigade_vputstrs(bb, va); @@ -509,9 +812,8 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + * that does all of this for us. + */ + bb = ap_bucket_brigade_create(r->pool); -+ bb->head = bb->tail = ap_bucket_list_create(); + b = ap_bucket_new(AP_BUCKET_eos); -+ bb->head->bucket = b; ++ bb->head = bb->tail = b; + ap_pass_brigade(r, f, bb); return 0; } @@ -522,7 +824,7 @@ RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v retrieving revision 1.35 diff -u -d -b -w -u -r1.35 http_request.c --- main/http_request.c 2000/06/24 17:33:57 1.35 -+++ main/http_request.c 2000/07/14 00:25:04 ++++ main/http_request.c 2000/07/17 23:40:52 @@ -1263,6 +1263,12 @@ return; } @@ -542,7 +844,7 @@ RCS file: /home/cvs/apache-2.0/src/modules/mpm/config.m4,v retrieving revision 1.23 diff -u -d -b -w -u -r1.23 config.m4 --- modules/mpm/config.m4 2000/07/11 19:00:16 1.23 -+++ modules/mpm/config.m4 2000/07/14 00:25:05 ++++ modules/mpm/config.m4 2000/07/17 23:40:58 @@ -3,7 +3,6 @@ [ --with-mpm=MPM Choose the process model for Apache to use. MPM={dexter,mpmt_beos,mpmt_pthread,prefork,spmt_os2}],[ From c4507eb74e054a69222a0422fb8fed659ffe1560 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 18 Jul 2000 00:32:31 +0000 Subject: [PATCH 0409/7878] Add a split function for buckets. This basically just takes one bucket and makes it two buckets. This is useful if you want to insert something in the middle of some data already in the brigade. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60384 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 1 - buckets/ap_eos_buf.c | 2 ++ buckets/ap_mmap_buf.c | 30 +++++++++++++++++++++++++----- buckets/ap_rmem_buf.c | 24 ++++++++++++++++++++++++ buckets/ap_rwmem_buf.c | 23 +++++++++++++++++++++++ buckets/apr_buf.h | 4 +++- 6 files changed, 77 insertions(+), 7 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index fe6eed15693..9ff396d1395 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -325,4 +325,3 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis return res; } - diff --git a/buckets/ap_eos_buf.c b/buckets/ap_eos_buf.c index 0a788abafe6..6d491f9b002 100644 --- a/buckets/ap_eos_buf.c +++ b/buckets/ap_eos_buf.c @@ -78,6 +78,8 @@ APR_EXPORT(ap_bucket *) ap_eos_create(void) newbuf->color = AP_BUCKET_eos; newbuf->getstr = eos_get_str; newbuf->getlen = eos_get_len; + newbuf->insert = NULL; + newbuf->split = NULL; newbuf->free = NULL; newbuf->data = NULL; diff --git a/buckets/ap_mmap_buf.c b/buckets/ap_mmap_buf.c index d99ee903e80..6634ee9726f 100644 --- a/buckets/ap_mmap_buf.c +++ b/buckets/ap_mmap_buf.c @@ -62,7 +62,7 @@ static const char * mmap_get_str(ap_bucket *e) { ap_bucket_mmap *b = (ap_bucket_mmap *)e->data; - return b->data->mm; + return b->alloc_addr; } static int mmap_get_len(ap_bucket *e) @@ -75,14 +75,33 @@ static ap_status_t mmap_bucket_insert(ap_bucket *e, const void *buf, ap_size_t nbytes, ap_ssize_t *w) { ap_bucket_mmap *b = (ap_bucket_mmap *)e->data; - const ap_mmap_t *mm = buf; + ap_mmap_t *mm = (ap_mmap_t *)buf; - b->data = mm; + b->alloc_addr = mm->mm;; b->len = nbytes; *w = nbytes; return APR_SUCCESS; } +static ap_status_t mmap_split(ap_bucket *e, ap_size_t nbyte) +{ + ap_bucket *newbuck; + ap_bucket_mmap *a = (ap_bucket_mmap *)e->data; + ap_bucket_mmap *b; + + newbuck = ap_bucket_new(AP_BUCKET_mmap); + b = (ap_bucket_mmap *)newbuck->data; + a->alloc_addr = a->alloc_addr + nbyte; + a->len = b->len - nbyte; + + a->len = nbyte; + + newbuck->prev = e; + newbuck->next = e->next; + e->next = newbuck; + + return APR_SUCCESS; +} APR_EXPORT(ap_bucket *) ap_mmap_bucket_create(void) { @@ -92,13 +111,14 @@ APR_EXPORT(ap_bucket *) ap_mmap_bucket_create(void) newbuf = calloc(1, sizeof(*newbuf)); b = malloc(sizeof(*b)); - b->data = NULL; - b->len = 0; + b->alloc_addr = NULL; + b->len = 0; newbuf->color = AP_BUCKET_mmap; newbuf->getstr = mmap_get_str; newbuf->getlen = mmap_get_len; newbuf->insert = mmap_bucket_insert; + newbuf->split = mmap_split; newbuf->free = NULL; newbuf->data = b; diff --git a/buckets/ap_rmem_buf.c b/buckets/ap_rmem_buf.c index 55aeaaff53a..6772b3a8996 100644 --- a/buckets/ap_rmem_buf.c +++ b/buckets/ap_rmem_buf.c @@ -75,6 +75,29 @@ static int rmem_get_len(ap_bucket *e) return (char *)b->end - (char *)b->start; } +static ap_status_t rmem_split(ap_bucket *e, ap_size_t nbyte) +{ + ap_bucket *newbuck; + ap_bucket_rmem *a = (ap_bucket_rmem *)e->data; + ap_bucket_rmem *b; + + newbuck = ap_bucket_new(AP_BUCKET_rmem); + b = (ap_bucket_rmem *)newbuck->data; + + b->alloc_len = a->alloc_len - nbyte; + a->alloc_len = nbyte; + b->end = a->end; + a->end = a->start + nbyte; + b->start = a->end + 1; + + newbuck->prev = e; + newbuck->next = e->next; + e->next = newbuck; + + + return APR_SUCCESS; +} + /* * save nbyte bytes to the bucket. * Only returns fewer than nbyte if an error ocurred. @@ -116,6 +139,7 @@ APR_EXPORT(ap_bucket *) ap_rmem_create(void) newbuf->getstr = rmem_get_str; newbuf->getlen = rmem_get_len; newbuf->insert = rmem_insert; + newbuf->split = rmem_split; newbuf->free = NULL; newbuf->data = b; return newbuf; diff --git a/buckets/ap_rwmem_buf.c b/buckets/ap_rwmem_buf.c index 6b01c3af5ac..b252cac6831 100644 --- a/buckets/ap_rwmem_buf.c +++ b/buckets/ap_rwmem_buf.c @@ -81,6 +81,28 @@ static void rwmem_destroy(void *e) free(d->alloc_addr); } +static ap_status_t rwmem_split(ap_bucket *e, ap_size_t nbyte) +{ + ap_bucket *newbuck; + ap_bucket_rwmem *a = (ap_bucket_rwmem *)e; + ap_bucket_rwmem *b; + + newbuck = ap_bucket_new(AP_BUCKET_rwmem); + b = (ap_bucket_rwmem *)newbuck; + + b->alloc_addr = a->alloc_addr; + b->alloc_len = a->alloc_len; + b->end = a->end; + a->end = a->start + nbyte; + b->start = a->end + 1; + + newbuck->prev = e; + newbuck->next = e->next; + e->next = newbuck; + + return APR_SUCCESS; +} + /* * save nbyte bytes to the bucket. * Only returns fewer than nbyte if an error occurred. @@ -136,6 +158,7 @@ APR_EXPORT(ap_bucket *) ap_rwmem_create(void) newbuf->getstr = rwmem_get_str; newbuf->getlen = rwmem_get_len; newbuf->insert = rwmem_insert; + newbuf->split = rwmem_split; newbuf->free = rwmem_destroy; newbuf->data = b; diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index aeb0b34e690..83700b5e4dd 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -95,6 +95,8 @@ struct ap_bucket { * into the bucket. */ int (*insert)(ap_bucket *e, const void *buf, ap_size_t nbytes, ap_ssize_t *w); + ap_status_t (*split)(ap_bucket *e, ap_size_t nbytes); + ap_bucket *next; /* The next node in the bucket list */ ap_bucket *prev; /* The prev node in the bucket list */ }; @@ -131,7 +133,7 @@ struct ap_bucket_rwmem { typedef struct ap_bucket_mmap ap_bucket_mmap; struct ap_bucket_mmap { - const ap_mmap_t *data; + void *alloc_addr; /* Where does the mmap start? */ int len; /* The amount of data in the mmap that we are * referencing with this bucket. This may be * smaller than the length in the data object, From 0ad7818334dd234d069489995b584e01f34f3894 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 18 Jul 2000 02:25:38 +0000 Subject: [PATCH 0410/7878] If TCP_NODELAY is set, ap_sendfile fails on Linux w/EINVAL. The setsockopt() for TCP_CORK gets the failure. Submitted by: Greg Ames Reviewed by: Jeff Trawick, who tweaked Greg's latest patch to avoid a compile warning and to work with non-blocking sockets. We can't leave the socket corked when we bail out when a write would block. Not even shutdown will uncork it (Linux kernel 2.2.5). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60385 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 93 ++++++++++++++++++++++++++++++-------- 1 file changed, 75 insertions(+), 18 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 369dc0b22b5..5d59c482601 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -212,29 +212,75 @@ ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, */ #if defined(__linux__) && defined(HAVE_WRITEV) + +/* TCP_CORK keeps us from sending partial frames when we shouldn't + * however, it is mutually exclusive w/TCP_NODELAY + */ + +static int os_cork(ap_socket_t *sock) +{ + /* Linux only for now */ + + int nodelay_off = 0, corkflag = 1, rv, delayflag; + socklen_t delaylen = sizeof(delayflag); + + /* XXX it would be cheaper to use an ap_socket_t flag here */ + rv = getsockopt(sock->socketdes, SOL_TCP, TCP_NODELAY, + (void *) &delayflag, &delaylen); + if (rv == 0) { + if (delayflag != 0) { + /* turn off nodelay temporarily to allow cork */ + rv = setsockopt(sock->socketdes, SOL_TCP, TCP_NODELAY, + (const void *) &nodelay_off, sizeof(nodelay_off)); + /* XXX nuke the rv checking once this is proven solid */ + if (rv < 0) { + return rv; + } + } + } + rv = setsockopt(sock->socketdes, SOL_TCP, TCP_CORK, + (const void *) &corkflag, sizeof(corkflag)); + return rv == 0 ? delayflag : rv; +} + +static int os_uncork(ap_socket_t *sock, int delayflag) +{ + /* Uncork to send queued frames - Linux only for now */ + + int corkflag = 0, rv; + rv = setsockopt(sock->socketdes, SOL_TCP, TCP_CORK, + (const void *) &corkflag, sizeof(corkflag)); + if (rv == 0) { + /* restore TCP_NODELAY to its original setting */ + rv = setsockopt(sock->socketdes, SOL_TCP, TCP_NODELAY, + (const void *) &delayflag, sizeof(delayflag)); + } + return rv; +} + ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr, ap_off_t *offset, ap_size_t *len, ap_int32_t flags) { off_t off = *offset; - int corkflag = 1; - int rv, nbytes = 0, total_hdrbytes, i; + int rv, nbytes = 0, total_hdrbytes, i, delayflag = APR_EINIT, corked = 0; ap_status_t arv; /* Ignore flags for now. */ flags = 0; - /* TCP_CORK keeps us from sending partial frames when we shouldn't */ - rv = setsockopt(sock->socketdes, SOL_TCP, TCP_CORK, - (const void *) &corkflag, sizeof(corkflag)); - if (rv == -1) { - *len = 0; - return errno; - } - - /* Now write the headers */ if (hdtr->numheaders > 0) { ap_int32_t hdrbytes; + + /* cork before writing headers */ + rv = os_cork(sock); + if (rv < 0) { + return errno; + } + delayflag = rv; + corked = 1; + + /* Now write the headers */ arv = ap_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); if (arv != APR_SUCCESS) { *len = 0; @@ -253,7 +299,7 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, } if (hdrbytes < total_hdrbytes) { *len = hdrbytes; - return APR_SUCCESS; + return os_uncork(sock, delayflag); } } } @@ -286,7 +332,11 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, if (rv == -1) { *len = nbytes; - return errno; + rv = errno; + if (corked) { + os_uncork(sock, delayflag); + } + return rv; } nbytes += rv; @@ -297,6 +347,9 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, if (rv < *len) { *len = nbytes; + if (corked) { + os_uncork(sock, delayflag); + } return APR_SUCCESS; } @@ -307,14 +360,18 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, nbytes += trbytes; if (arv != APR_SUCCESS) { *len = nbytes; - return errno; + rv = errno; + if (corked) { + os_uncork(sock, delayflag); + } + return rv; } } - /* Uncork to send queued frames */ - corkflag = 0; - rv = setsockopt(sock->socketdes, SOL_TCP, TCP_CORK, - (const void *) &corkflag, sizeof(corkflag)); + if (corked) { + /* if we corked, uncork & restore TCP_NODELAY setting */ + rv = os_uncork(sock, delayflag); + } (*len) = nbytes; return rv < 0 ? errno : APR_SUCCESS; From 5a4673457656be67857f2b7c7f1b2d3fe8f80c72 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 18 Jul 2000 02:30:28 +0000 Subject: [PATCH 0411/7878] Cast some void * ptrs to char * so that some ptr arithmetic can work on all compilers. Submitted by: Dave Hill Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60386 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/testsf.c b/test/testsf.c index 933d11226bd..a06012f6f43 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -366,7 +366,8 @@ static int client(client_socket_mode_t socket_mode) } else { hdtr.headers[0].iov_len -= tmplen; - hdtr.headers[0].iov_base += tmplen; + hdtr.headers[0].iov_base = + (char*) hdtr.headers[0].iov_base + tmplen; tmplen = 0; } } @@ -398,7 +399,8 @@ static int client(client_socket_mode_t socket_mode) } else { hdtr.trailers[0].iov_len -= tmplen; - hdtr.trailers[0].iov_base += tmplen; + hdtr.trailers[0].iov_base = + (char *)hdtr.trailers[0].iov_base + tmplen; tmplen = 0; } } From 3e83e6522c3a8a2752f8cba5533836174bef0923 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 18 Jul 2000 03:02:17 +0000 Subject: [PATCH 0412/7878] Update the Tru64 flavor of ap_sendfile() with latest version from Dave Hill. It supports non-blocking sockets. Submitted by: Dave Hill Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60387 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 193 ++++++++++++++++--------------------- 1 file changed, 83 insertions(+), 110 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 5d59c482601..16c635bb0cf 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -693,145 +693,118 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, #elif defined(__osf__) && defined (__alpha) /* * ap_sendfile for Tru64 Unix. + * + * Note: while the sendfile implementation on Tru64 can send + * a one header/trailer with the file, it will send only one + * each and not an array as is passed into this function. In + * addition, there is a limitation on the size of the header/trailer + * that can be referenced ( > 4096 seems to cause an ENOMEM) + * Rather than code these special cases in, using ap_sendv for + * all cases of the headers and trailers seems to be a good idea. */ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, - ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, - ap_int32_t flags) + ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, + ap_int32_t flags) { off_t nbytes = 0; int rv, i; ap_status_t arv; - struct iovec headerstruct[2]; + struct iovec headerstruct[2] = {(0, 0), (0, 0)}; size_t bytes_to_send = *len; - + /* Ignore flags for now. */ flags = 0; + + if (hdtr->numheaders > 0) { + ap_ssize_t hdrbytes = 0; - /* - Tru64 can send 1 header and 1 trailer per sendfile(). - with > 1, we have the choice to build 1 header/trailer or - to send them before/after the sendfile. I did the later. - - headerstruct is a 2 iovec array with the first pointing - to the header, the second pointing to the trailer. - iov_len must be set to zero on any not being used. - */ - - if(hdtr->numheaders == 0) { - headerstruct[0].iov_len = 0; - } else if (hdtr->numheaders == 1) { - headerstruct[0].iov_base = hdtr->headers[0].iov_base; - headerstruct[0].iov_len = hdtr->headers[0].iov_len; - } else { - ap_size_t hdrbytes = 0; - /* sending them in bits.. if more than one header/trailer */ - headerstruct[0].iov_len = 0; - - arv = ap_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); - if (arv != APR_SUCCESS) { - *len = 0; - return errno; - } + arv = ap_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); + if (arv != APR_SUCCESS) { + *len = 0; + return errno; + } - nbytes += hdrbytes; - - /* If this was a partial write and we aren't doing timeouts, - * return now with the partial byte count; this is a non-blocking - * socket. - */ - if (sock->timeout <= 0) { - ap_size_t total_hdrbytes = 0; - for (i = 0; i < hdtr->numheaders; i++) { - total_hdrbytes += hdtr->headers[i].iov_len; - } - if (hdrbytes < total_hdrbytes) { - *len = hdrbytes; - return APR_SUCCESS; - } - } - } + nbytes += hdrbytes; - if(hdtr->numtrailers == 0) { - headerstruct[1].iov_len = 0; - } else if (hdtr->numtrailers == 1) { - headerstruct[1].iov_base = hdtr->trailers[0].iov_base; - headerstruct[1].iov_len = hdtr->trailers[0].iov_len; - } else { - /* we will send them after the file as more than one */ - headerstruct[1].iov_len = 0; + /* If this was a partial write and we aren't doing timeouts, + * return now with the partial byte count; this is a non-blocking + * socket. + */ + if (sock->timeout <= 0) { + ap_size_t total_hdrbytes = 0; + for (i = 0; i < hdtr->numheaders; i++) { + total_hdrbytes += hdtr->headers[i].iov_len; + } + if (hdrbytes < total_hdrbytes) { + *len = hdrbytes; + return APR_SUCCESS; + } + } } - + if (bytes_to_send) { - /* We won't dare call sendfile() if we don't have - * header or file bytes to send because bytes_to_send == 0 - * means send the whole file. - */ - do { - rv = sendfile( - sock->socketdes, /* socket */ - file->filedes, /* file to be sent */ - *offset, /* where in the file to start */ - bytes_to_send, /* number of bytes to send */ - headerstruct, /* Headers/footers */ - flags); /* currently unused */ - } while (rv == -1 && errno == EINTR); - } else - rv = 0; + /* We won't dare call sendfile() if we don't have + * header or file bytes to send because bytes_to_send == 0 + * means send the whole file. + */ + do { + rv = sendfile(sock->socketdes, /* socket */ + file->filedes, /* file to be sent */ + *offset, /* where in the file to start */ + bytes_to_send, /* number of bytes to send */ + headerstruct, /* Headers/footers */ + flags); /* currently unused */ + } while (rv == -1 && errno == EINTR); + } + else + rv = 0; - if (rv == -1 && - (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout > 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); + if (rv == -1 && + (errno == EAGAIN || errno == EWOULDBLOCK) && + sock->timeout > 0) { + ap_status_t arv = wait_for_io_or_timeout(sock, 0); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } - else { - do { - rv = sendfile( - sock->socketdes, /* socket */ - file->filedes, /* file to be sent */ - *offset, /* where in the file to start */ - bytes_to_send, /* number of bytes to send */ - headerstruct, /* Headers/footers */ - flags /* undefined, set to 0 */ - ); - } while (rv == -1 && errno == EINTR); - } + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } + else { + do { + rv = sendfile(sock->socketdes, /* socket */ + file->filedes, /* file to be sent */ + *offset, /* where in the file to start */ + bytes_to_send, /* number of bytes to send */ + headerstruct, /* Headers/footers */ + flags); /* undefined, set to 0 */ + } while (rv == -1 && errno == EINTR); + } } - if(rv != -1) { - nbytes += rv; - } + if (rv != -1) { + nbytes += rv; - if((rv != -1) && (hdtr->numtrailers > 1)) { - ap_size_t trlbytes = 0; + if (hdtr->numtrailers > 0) { + ap_ssize_t trlbytes = 0; - /* send the trailers now */ - arv = ap_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trlbytes); - if (arv != APR_SUCCESS) { - *len = 0; - return errno; - } + /* send the trailers now */ + arv = ap_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trlbytes); + if (arv != APR_SUCCESS) { + *len = 0; + return errno; + } - nbytes += trlbytes; + nbytes += trlbytes; + } } - /* - question: - should this be the sum of all of them ? - sendfile returns a total byte count incl headers/trailers - but when headers/trailers is > 1 hdrbytes and trlbytes - will be non-zero - */ (*len) = nbytes; return (rv < 0) ? errno : APR_SUCCESS; } + #else #error APR has detected sendfile on your system, but nobody has written a #error version of it for APR yet. To get past this, either write ap_sendfile #error or change APR_HAS_SENDFILE in apr.h to 0. -#endif /* __linux__, __FreeBSD__, __HPUX__, _AIX, Tru64/OSF1 */ +#endif /* __linux__, __FreeBSD__, __HPUX__, _AIX, __MVS__, Tru64/OSF1 */ #endif /* APR_HAS_SENDFILE */ From 02d887e5c18ddd5ecb2abfdff2b1cfd3cdda347c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 18 Jul 2000 03:15:12 +0000 Subject: [PATCH 0413/7878] Cast a void * ptr to char * in a couple of places so that ptr arithmetic works. Submitted by: "Victor J. Orlikowski" Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60388 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fullrw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index 8264f142e32..b88a7e5c71d 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -65,7 +65,7 @@ ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes, ap_ssize_t amt = (ap_ssize_t)nbytes; status = ap_read(thefile, buf, &amt); - buf += amt; + buf = (char *)buf + amt; nbytes -= amt; total_read += amt; } while (status == APR_SUCCESS && nbytes > 0); @@ -86,7 +86,7 @@ ap_status_t ap_full_write(ap_file_t *thefile, const void *buf, ap_ssize_t amt = (ap_ssize_t)nbytes; status = ap_write(thefile, buf, &amt); - buf += amt; + buf = (char *)buf + amt; nbytes -= amt; total_written += amt; } while (status == APR_SUCCESS && nbytes > 0); From 4306d971e373eabed87413307d330c64040ba08d Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 18 Jul 2000 05:16:46 +0000 Subject: [PATCH 0414/7878] Describe the design threads I committed last week. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60389 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/README.txt | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/buckets/README.txt b/buckets/README.txt index 540a232b779..f69e3434712 100644 --- a/buckets/README.txt +++ b/buckets/README.txt @@ -6,9 +6,26 @@ as part of the server until we agree on a solution. Design Rationale ---------------- - [Roy is collecting these from his mail archives] - layered-IO-1998.txt - bucket_brigades.txt + doc_SFmtg.txt + -- notes from the 1998 design meeting in SF + + doc_stacked_io.txt + -- Ed and Alexei's vision of stacked-io with layer caching + + doc_page_io.txt + -- Dean's comments on performance considerations + + doc_dean_iol.txt + -- Rationale behind the IOL stuff that is now in APR + + doc_bucket_brigades.txt + -- Roy's ramblings about the bucket brigades design + + doc_wishes.txt + -- Everyone's requirements for layered-IO and filters + + doc_greg_filters.txt + -- Greg's initial filter design rationale Bachelor #1 ----------- From 6809f18534b572308ad0dbf4fd7cbfd323c6aa26 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 18 Jul 2000 15:16:46 +0000 Subject: [PATCH 0415/7878] ap_sendfile() fix: If the caller passes NULL for the ap_hdtr_t *, set hdtr to the address of one that specifies no headers and trailers. This prevents accessing low core while keeping the following code simpler (no need to check hdtr != NULL later). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60390 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 16c635bb0cf..9ebb612d982 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -211,6 +211,8 @@ ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, * - Should flags be an int_32 or what? */ +static ap_hdtr_t no_hdtr; /* used below when caller passes NULL for ap_hdtr_t */ + #if defined(__linux__) && defined(HAVE_WRITEV) /* TCP_CORK keeps us from sending partial frames when we shouldn't @@ -266,6 +268,10 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, int rv, nbytes = 0, total_hdrbytes, i, delayflag = APR_EINIT, corked = 0; ap_status_t arv; + if (!hdtr) { + hdtr = &no_hdtr; + } + /* Ignore flags for now. */ flags = 0; @@ -394,6 +400,10 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, struct sf_hdtr headerstruct; size_t bytes_to_send = *len; + if (!hdtr) { + hdtr = &no_hdtr; + } + /* Ignore flags for now. */ flags = 0; @@ -484,6 +494,10 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, struct iovec hdtrarray[2]; void *headerbuf, *trailerbuf; + if (!hdtr) { + hdtr = &no_hdtr; + } + /* Ignore flags for now. */ flags = 0; @@ -586,6 +600,10 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, ap_status_t arv; struct sf_parms parms; + if (!hdtr) { + hdtr = &no_hdtr; + } + /* Ignore flags for now. */ flags = 0; @@ -712,6 +730,10 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, struct iovec headerstruct[2] = {(0, 0), (0, 0)}; size_t bytes_to_send = *len; + if (!hdtr) { + hdtr = &no_hdtr; + } + /* Ignore flags for now. */ flags = 0; From 707e5756fb275fdf58ebd82179b2f184c0d0d2bb Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Tue, 18 Jul 2000 23:39:01 +0000 Subject: [PATCH 0416/7878] Restore the reference to perl's use of DJB's hash function; Fix the name of the chi^2 distribution; Let the compiler decide how to multiply by 33. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60391 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_hash.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/apr_hash.c b/lib/apr_hash.c index 6960362ddb7..f486a269857 100644 --- a/lib/apr_hash.c +++ b/lib/apr_hash.c @@ -220,10 +220,10 @@ static ap_hash_entry_t **find_entry(ap_hash_t *ht, /* * This is Daniel J. Bernstein's popular `times 33' hash function - * as posted by him years ago on comp.lang.c. It basically uses a - * function like ``hash(i) = hash(i-1) * 33 + str[i]''. This is one - * of the best known hash functions for strings. Because it is both - * computed very fast and distributes very well. + * as posted by him years ago on comp.lang.c and used by perl. + * This is one of the best known hash functions for strings + * because it is both computed very fast and distributes very + * well. * * The magic of number 33, i.e. why it works better than many other * constants, prime or not, has never been adequately explained by @@ -235,10 +235,10 @@ static ap_hash_entry_t **find_entry(ap_hash_t *ht, * They all distribute in an acceptable way and this way fill a hash * table with an average percent of approx. 86%. * - * If one compares the Chi/2 values of the variants (see + * If one compares the chi^2 values of the variants (see * Bob Jenkins ``Hashing Frequently Asked Questions'' at * http://burtleburtle.net/bob/hash/hashfaq.html for a description - * of Chi/2), the number 33 not even has the best value. But the + * of chi^2), the number 33 not even has the best value. But the * number 33 and a few other equally good numbers like 17, 31, 63, * 127 and 129 have nevertheless a great advantage to the remaining * numbers in the large set of possible multipliers: their multiply @@ -252,7 +252,7 @@ static ap_hash_entry_t **find_entry(ap_hash_t *ht, */ hash = 0; for (p = key, i = klen; i; i--, p++) - hash = ((hash << 5) + hash) + *p; + hash = hash * 33 + *p; /* scan linked list */ for (hep = &ht->array[hash & ht->max], he = *hep; From 089c0020df2d36af987eb31b644da620fe751585 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 19 Jul 2000 16:35:48 +0000 Subject: [PATCH 0417/7878] APR lock fixes: when using SysV sems, flock(), or fcntl(), be sure to repeat the syscall until we stop getting EINTR. I noticed a related problem at termination (SIGTERM) on FreeBSD when using fcntl(). Apache 1.3 had these new loops too. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60392 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/crossproc.c | 58 +++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index e543814dc29..2b0fb74aab8 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -104,16 +104,26 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) ap_status_t ap_unix_lock_inter(ap_lock_t *lock) { - lock->curr_locked = 1; - if (semop(lock->interproc, &op_on, 1) < 0) { + int rc; + + do { + rc = semop(lock->interproc, &op_on, 1); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { return errno; } + lock->curr_locked = 1; return APR_SUCCESS; } ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) { - if (semop(lock->interproc, &op_off, 1) < 0) { + int rc; + + do { + rc = semop(lock->interproc, &op_off, 1); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { return errno; } lock->curr_locked = 0; @@ -260,10 +270,7 @@ static ap_status_t lock_cleanup(void *lock_) ap_lock_t *lock=lock_; if (lock->curr_locked == 1) { - if (fcntl(lock->interproc, F_SETLKW, &unlock_it) < 0) { - return errno; - } - lock->curr_locked=0; + return ap_unix_unlock_inter(lock); } return APR_SUCCESS; } @@ -291,16 +298,26 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) ap_status_t ap_unix_lock_inter(ap_lock_t *lock) { - lock->curr_locked=1; - if (fcntl(lock->interproc, F_SETLKW, &lock_it) < 0) { + int rc; + + do { + rc = fcntl(lock->interproc, F_SETLKW, &lock_it); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { return errno; } + lock->curr_locked=1; return APR_SUCCESS; } ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) { - if (fcntl(lock->interproc, F_SETLKW, &unlock_it) < 0) { + int rc; + + do { + rc = fcntl(lock->interproc, F_SETLKW, &unlock_it); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { return errno; } lock->curr_locked=0; @@ -334,10 +351,7 @@ static ap_status_t lock_cleanup(void *lock_) ap_lock_t *lock=lock_; if (lock->curr_locked == 1) { - if (flock(lock->interproc, LOCK_UN) < 0) { - return errno; - } - lock->curr_locked = 0; + return ap_unix_unlock_inter(lock); } unlink(lock->fname); return APR_SUCCESS; @@ -364,16 +378,26 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) ap_status_t ap_unix_lock_inter(ap_lock_t *lock) { - lock->curr_locked = 1; - if (flock(lock->interproc, LOCK_EX) < 0) { + int rc; + + do { + rc = flock(lock->interproc, LOCK_EX); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { return errno; } + lock->curr_locked = 1; return APR_SUCCESS; } ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) { - if (flock(lock->interproc, LOCK_UN) < 0) { + int rc; + + do { + rc = flock(lock->interproc, LOCK_UN); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { return errno; } lock->curr_locked = 0; From db0d787a4ef26e4b973798033564b5b1ccf1672a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 19 Jul 2000 17:42:55 +0000 Subject: [PATCH 0418/7878] Make ap_child_init_lock() work properly... It didn't call ap_unix_child_init_lock() at the right time, so any lock mechanism which had interesting work to do (only flock()) was broken. Fix the flock() flavor of ap_unix_child_init_lock(). It expected to create the lock file when it should in fact open the existing one. It also neglected to return the new ap_lock_t structure to the caller. Improve logging of lock init errors in prefork (I know, prefork is a lame duck, but I used the improved logging in prefork to help debug the problem). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60393 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/crossproc.c | 3 ++- locks/unix/locks.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 2b0fb74aab8..274b9d89ad2 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -422,11 +422,12 @@ ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, new = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); new->fname = ap_pstrdup(cont, fname); - new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600); + new->interproc = open(new->fname, O_WRONLY, 0600); if (new->interproc == -1) { ap_unix_destroy_inter_lock(new); return errno; } + *lock = new; return APR_SUCCESS; } diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 8e9784017fe..823c9ca37e8 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -159,7 +159,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, ap_pool_t *cont) { ap_status_t stat; - if ((*lock)->scope != APR_CROSS_PROCESS) { + if ((*lock)->scope != APR_INTRAPROCESS) { if ((stat = ap_unix_child_init_lock(lock, cont, fname)) != APR_SUCCESS) { return stat; } From 6664a3ecf31dacd22198b6b69bff756e51fa77f4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 20 Jul 2000 16:14:24 +0000 Subject: [PATCH 0419/7878] Remove the ap_bucket_new function. This was basically a case statement around a couple of other functions. This keeps people from implementing their own bucket types and plugging them into the server. With this change buckets are created by ap_bucket_foo_create, and modified/used with the function pointers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60394 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 29 ++--------------------------- buckets/ap_eos_buf.c | 2 +- buckets/ap_mmap_buf.c | 4 ++-- buckets/ap_rmem_buf.c | 4 ++-- buckets/ap_rwmem_buf.c | 4 ++-- buckets/apr_buf.h | 11 ++++------- 6 files changed, 13 insertions(+), 41 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 9ff396d1395..29b223dc0d6 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -63,31 +63,6 @@ #include #include "apr_buf.h" -/* We are creating a new bucket here. The buckets that are created - * have the correct function pointers and types when they are created. - */ -APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color) -{ - /* TODO: keep a free list of ap_bufels... and allocate them in big chunks */ - switch (color) { - case AP_BUCKET_rwmem: - return ap_rwmem_create(); - case AP_BUCKET_mmap: - return ap_mmap_bucket_create(); - case AP_BUCKET_rmem: - return ap_rmem_create(); - case AP_BUCKET_eos: - return ap_eos_create(); - case AP_BUCKET_file: - case AP_BUCKET_filename: - case AP_BUCKET_cached_entity: - case AP_BUCKET_URI: - /* not implemented yet */ - return NULL; - } - return NULL; -} - APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e) { if (e->free) { @@ -278,7 +253,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) } for (k = 0;;) { - r = ap_bucket_new(AP_BUCKET_rwmem); + r = ap_bucket_rwmem_create(); x = va_arg(va, const char *); if (x == NULL) break; @@ -319,7 +294,7 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis res = ap_vsnprintf(buf, 4096, fmt, va); - r = ap_bucket_new(AP_BUCKET_rwmem); + r = ap_bucket_rwmem_create(); res = r->insert(r, buf, strlen(buf), &i); ap_bucket_brigade_append_buckets(b, r); diff --git a/buckets/ap_eos_buf.c b/buckets/ap_eos_buf.c index 6d491f9b002..dcd406fbd04 100644 --- a/buckets/ap_eos_buf.c +++ b/buckets/ap_eos_buf.c @@ -69,7 +69,7 @@ static int eos_get_len(ap_bucket *e) return 0; } -APR_EXPORT(ap_bucket *) ap_eos_create(void) +APR_EXPORT(ap_bucket *) ap_bucket_eos_create(void) { ap_bucket *newbuf; diff --git a/buckets/ap_mmap_buf.c b/buckets/ap_mmap_buf.c index 6634ee9726f..352347155b0 100644 --- a/buckets/ap_mmap_buf.c +++ b/buckets/ap_mmap_buf.c @@ -89,7 +89,7 @@ static ap_status_t mmap_split(ap_bucket *e, ap_size_t nbyte) ap_bucket_mmap *a = (ap_bucket_mmap *)e->data; ap_bucket_mmap *b; - newbuck = ap_bucket_new(AP_BUCKET_mmap); + newbuck = ap_bucket_mmap_create(); b = (ap_bucket_mmap *)newbuck->data; a->alloc_addr = a->alloc_addr + nbyte; a->len = b->len - nbyte; @@ -103,7 +103,7 @@ static ap_status_t mmap_split(ap_bucket *e, ap_size_t nbyte) return APR_SUCCESS; } -APR_EXPORT(ap_bucket *) ap_mmap_bucket_create(void) +APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(void) { ap_bucket *newbuf; ap_bucket_mmap *b; diff --git a/buckets/ap_rmem_buf.c b/buckets/ap_rmem_buf.c index 6772b3a8996..3a2e4e49783 100644 --- a/buckets/ap_rmem_buf.c +++ b/buckets/ap_rmem_buf.c @@ -81,7 +81,7 @@ static ap_status_t rmem_split(ap_bucket *e, ap_size_t nbyte) ap_bucket_rmem *a = (ap_bucket_rmem *)e->data; ap_bucket_rmem *b; - newbuck = ap_bucket_new(AP_BUCKET_rmem); + newbuck = ap_bucket_rmem_create(); b = (ap_bucket_rmem *)newbuck->data; b->alloc_len = a->alloc_len - nbyte; @@ -124,7 +124,7 @@ static ap_status_t rmem_insert(ap_bucket *e, const void *buf, return APR_SUCCESS; } -APR_EXPORT(ap_bucket *) ap_rmem_create(void) +APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(void) { ap_bucket *newbuf; ap_bucket_rmem *b; diff --git a/buckets/ap_rwmem_buf.c b/buckets/ap_rwmem_buf.c index b252cac6831..6f43638b355 100644 --- a/buckets/ap_rwmem_buf.c +++ b/buckets/ap_rwmem_buf.c @@ -87,7 +87,7 @@ static ap_status_t rwmem_split(ap_bucket *e, ap_size_t nbyte) ap_bucket_rwmem *a = (ap_bucket_rwmem *)e; ap_bucket_rwmem *b; - newbuck = ap_bucket_new(AP_BUCKET_rwmem); + newbuck = ap_bucket_rwmem_create(); b = (ap_bucket_rwmem *)newbuck; b->alloc_addr = a->alloc_addr; @@ -141,7 +141,7 @@ static ap_status_t rwmem_insert(ap_bucket *e, const void *buf, return APR_SUCCESS; } -APR_EXPORT(ap_bucket *) ap_rwmem_create(void) +APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(void) { ap_bucket *newbuf; ap_bucket_rwmem *b; diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index 83700b5e4dd..a787057b851 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -184,9 +184,6 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis /* ****** Bucket Functions ***** */ -/* allocate a bucket of type color */ -APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color); - /* destroy a bucket */ APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e); @@ -200,16 +197,16 @@ APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b); APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b); /* Create a read/write memory bucket */ -APR_EXPORT(ap_bucket *) ap_rwmem_create(void); +APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(void); /* Create a mmap memory bucket */ -APR_EXPORT(ap_bucket *) ap_mmap_bucket_create(void); +APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(void); /* Create a read only memory bucket. */ -APR_EXPORT(ap_bucket *) ap_rmem_create(void); +APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(void); /* Create an End of Stream bucket */ -APR_EXPORT(ap_bucket *) ap_eos_create(void); +APR_EXPORT(ap_bucket *) ap_bucket_eos_create(void); #endif From 2ca78c55bf975b1d228860a1b9a9b4bd6431c3a4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 20 Jul 2000 16:21:21 +0000 Subject: [PATCH 0420/7878] Update ryan.patch to work with the latest changes in the buckets. This also includes a small chunking filter that doesn't work correctly. The chunking filter is not enabled, and hopefully I will be able to fix it later today. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60395 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ryan.patch | 467 +++++++-------------------------------------- 1 file changed, 70 insertions(+), 397 deletions(-) diff --git a/buckets/ryan.patch b/buckets/ryan.patch index 90147490861..2c4d549c4ad 100644 --- a/buckets/ryan.patch +++ b/buckets/ryan.patch @@ -1,14 +1,18 @@ -? include/util_filter.h -? lib/apr/buckets/Makefile.in -? lib/apr/include/apr_buf.h -? main/util_filter.c -Index: ap/Makefile.in +? src/build.log +? src/build.err +? src/.inslog2 +? src/include/util_filter.h +? src/lib/apr/buckets/Makefile.in +? src/main/build.log +? src/main/build.err +? src/main/util_filter.c +Index: src/ap/Makefile.in =================================================================== RCS file: /home/cvs/apache-2.0/src/ap/Makefile.in,v retrieving revision 1.4 diff -u -d -b -w -u -r1.4 Makefile.in ---- ap/Makefile.in 2000/06/12 20:41:13 1.4 -+++ ap/Makefile.in 2000/07/17 23:40:28 +--- src/ap/Makefile.in 2000/06/12 20:41:13 1.4 ++++ src/ap/Makefile.in 2000/07/20 16:17:56 @@ -1,5 +1,5 @@ LTLIBRARY_NAME = libap.la @@ -16,13 +20,13 @@ diff -u -d -b -w -u -r1.4 Makefile.in +LTLIBRARY_SOURCES = ap_cache.c ap_base64.c ap_sha1.c ap_hooks.c include $(top_srcdir)/build/ltlib.mk -Index: include/ap_iol.h +Index: src/include/ap_iol.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/ap_iol.h,v retrieving revision 1.19 diff -u -d -b -w -u -r1.19 ap_iol.h ---- include/ap_iol.h 2000/05/29 04:22:02 1.19 -+++ include/ap_iol.h 2000/07/17 23:40:31 +--- src/include/ap_iol.h 2000/05/29 04:22:02 1.19 ++++ src/include/ap_iol.h 2000/07/20 16:17:56 @@ -58,6 +58,7 @@ #define AP_IOL_H @@ -31,13 +35,13 @@ diff -u -d -b -w -u -r1.19 ap_iol.h #include "apr_errno.h" /* For ap_status_t and the APR_errnos */ typedef struct ap_iol ap_iol; -Index: include/http_protocol.h +Index: src/include/http_protocol.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/http_protocol.h,v retrieving revision 1.19 diff -u -d -b -w -u -r1.19 http_protocol.h ---- include/http_protocol.h 2000/07/11 03:48:17 1.19 -+++ include/http_protocol.h 2000/07/17 23:40:31 +--- src/include/http_protocol.h 2000/07/11 03:48:17 1.19 ++++ src/include/http_protocol.h 2000/07/20 16:17:56 @@ -89,8 +89,15 @@ API_EXPORT(void) ap_basic_http_header(request_rec *r); @@ -55,13 +59,13 @@ diff -u -d -b -w -u -r1.19 http_protocol.h /* Send the response to special method requests */ -Index: include/httpd.h +Index: src/include/httpd.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v retrieving revision 1.64 diff -u -d -b -w -u -r1.64 httpd.h ---- include/httpd.h 2000/06/30 21:18:13 1.64 -+++ include/httpd.h 2000/07/17 23:40:32 +--- src/include/httpd.h 2000/06/30 21:18:13 1.64 ++++ src/include/httpd.h 2000/07/20 16:17:56 @@ -596,6 +596,11 @@ * pointer back to the main request. */ @@ -74,13 +78,13 @@ diff -u -d -b -w -u -r1.64 httpd.h /* Info about the request itself... we begin with stuff that only * protocol.c should ever touch... */ -Index: lib/apr/configure.in +Index: src/lib/apr/configure.in =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v retrieving revision 1.136 diff -u -d -b -w -u -r1.136 configure.in ---- lib/apr/configure.in 2000/07/15 15:39:05 1.136 -+++ lib/apr/configure.in 2000/07/17 23:40:32 +--- src/lib/apr/configure.in 2000/07/15 15:39:05 1.136 ++++ src/lib/apr/configure.in 2000/07/20 16:17:57 @@ -682,8 +682,8 @@ AC_SUBST(EXEEXT) @@ -92,325 +96,13 @@ diff -u -d -b -w -u -r1.136 configure.in for dir in $MODULES do test -d $dir || $MKDIR -p $dir -Index: lib/apr/buckets/ap_buf.c -=================================================================== -RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_buf.c,v -retrieving revision 1.12 -diff -u -d -b -w -u -r1.12 ap_buf.c ---- lib/apr/buckets/ap_buf.c 2000/07/14 00:24:33 1.12 -+++ lib/apr/buckets/ap_buf.c 2000/07/17 23:40:33 -@@ -100,10 +100,25 @@ - APR_EXPORT(ap_status_t) ap_bucket_brigade_destroy(void *data) - { - ap_bucket_brigade *b = data; -- ap_bucket_list *bl = b->head; - -- ap_destroy_bucket_list(bl); -+ ap_bucket_list_destroy(b->head); -+ /* The brigade itself is allocated out of a pool, so we don't actually -+ * want to free it. If we did, we would do that free() here. -+ */ -+ -+ return APR_SUCCESS; -+} -+ -+APR_EXPORT(ap_status_t) ap_bucket_list_destroy(ap_bucket *e) -+{ -+ ap_bucket *cur = e; -+ ap_bucket *next; - -+ while (cur) { -+ next = cur->next; -+ ap_bucket_destroy(cur); -+ cur = next; -+ } - return APR_SUCCESS; - } - -@@ -120,18 +135,10 @@ - return b; - } - --APR_EXPORT(ap_bucket_list *) ap_bucket_list_create(void) --{ -- ap_bucket_list *b; -- -- b = calloc(1, sizeof(*b)); -- return b; --} -- --APR_EXPORT(void) ap_bucket_brigade_append_list(ap_bucket_brigade *b, -- ap_bucket_list *e) -+APR_EXPORT(void) ap_bucket_brigade_append_buckets(ap_bucket_brigade *b, -+ ap_bucket *e) - { -- ap_bucket_list *cur = e; -+ ap_bucket *cur = e; - - if (b->tail) { - b->tail->next = e; -@@ -146,37 +153,17 @@ - } - } - --APR_EXPORT(void) ap_bucket_brigade_append_bucket(ap_bucket_brigade *b, -- ap_bucket *r) --{ -- if (b->tail) { -- if (b->tail->bucket == NULL) { -- b->tail->bucket = r; -- } -- else { -- b->tail->next = ap_bucket_list_create(); -- b->tail->next->prev = b->tail; -- b->tail = b->tail->next; -- b->tail->bucket = r; -- } -- } -- else { -- b->head = b->tail = ap_bucket_list_create(); -- b->tail->bucket = r; -- } --} -- - APR_EXPORT(int) ap_bucket_brigade_to_iovec(ap_bucket_brigade *b, - struct iovec *vec, int nvec) - { -- ap_bucket_list *e; -+ ap_bucket *e; - struct iovec *orig; - - orig = vec; - e = b->head; - while (e && nvec) { -- vec->iov_base = (void *)ap_get_bucket_char_str(e->bucket); -- vec->iov_len = ap_get_bucket_len(e->bucket); -+ vec->iov_base = (void *)ap_get_bucket_char_str(e); -+ vec->iov_len = ap_get_bucket_len(e); - e = e->next; - --nvec; - ++vec; -@@ -207,12 +194,12 @@ - - for (i=0; i < nvec; i++) { - if (b->head == b->tail) { -- ap_bucket_destroy(b->head->bucket); -+ ap_bucket_destroy(b->head); - b->head = b->tail = NULL; - break; - } - b->head = b->head->next; -- ap_bucket_destroy(b->head->prev->bucket); -+ ap_bucket_destroy(b->head->prev); - b->head->prev = NULL; - } - } -@@ -241,17 +228,6 @@ - return APR_SUCCESS; - } - --APR_EXPORT(ap_status_t) ap_destroy_bucket_list(ap_bucket_list *buf) --{ -- ap_bucket_list *dptr = buf; -- -- while (dptr) { -- ap_bucket_destroy(dptr->bucket); -- dptr = dptr->next; -- } -- return APR_SUCCESS; --} -- - APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b) - { - if (b) { -@@ -275,10 +251,9 @@ - int j, k, rv; - ap_ssize_t i; - -- if (b->tail && b->tail->bucket && -- b->tail->bucket->color == AP_BUCKET_rwmem) { -+ if (b->tail && b->tail->color == AP_BUCKET_rwmem) { - ap_bucket *rw; -- rw = b->tail->bucket; -+ rw = b->tail; - /* I have no idea if this is a good idea or not. Probably not. - * Basically, if the last bucket in the list is a rwmem bucket, - * then we just add to it instead of allocating a new read only -@@ -298,7 +273,7 @@ - } - k += i; - -- ap_bucket_brigade_append_bucket(b, rw); -+ ap_bucket_brigade_append_buckets(b, rw); - } - } - -@@ -316,7 +291,7 @@ - } - k += i; - -- ap_bucket_brigade_append_bucket(b, r); -+ ap_bucket_brigade_append_buckets(b, r); - } - - return k; -@@ -346,7 +321,7 @@ - - r = ap_bucket_new(AP_BUCKET_rwmem); - res = r->insert(r, buf, strlen(buf), &i); -- ap_bucket_brigade_append_bucket(b, r); -+ ap_bucket_brigade_append_buckets(b, r); - - return res; - } -Index: lib/apr/buckets/ap_eos_buf.c -=================================================================== -RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_eos_buf.c,v -retrieving revision 1.1 -diff -u -d -b -w -u -r1.1 ap_eos_buf.c ---- lib/apr/buckets/ap_eos_buf.c 2000/07/13 21:48:33 1.1 -+++ lib/apr/buckets/ap_eos_buf.c 2000/07/17 23:40:33 -@@ -73,7 +73,7 @@ - { - ap_bucket *newbuf; - -- newbuf = malloc(sizeof(*newbuf)); -+ newbuf = calloc(1, sizeof(*newbuf)); - - newbuf->color = AP_BUCKET_eos; - newbuf->getstr = eos_get_str; -Index: lib/apr/buckets/ap_mmap_buf.c -=================================================================== -RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_mmap_buf.c,v -retrieving revision 1.4 -diff -u -d -b -w -u -r1.4 ap_mmap_buf.c ---- lib/apr/buckets/ap_mmap_buf.c 2000/07/14 00:24:33 1.4 -+++ lib/apr/buckets/ap_mmap_buf.c 2000/07/17 23:40:33 -@@ -89,7 +89,7 @@ - ap_bucket *newbuf; - ap_bucket_mmap *b; - -- newbuf = malloc(sizeof(*newbuf)); -+ newbuf = calloc(1, sizeof(*newbuf)); - b = malloc(sizeof(*b)); - - b->data = NULL; -Index: lib/apr/buckets/ap_rmem_buf.c -=================================================================== -RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_rmem_buf.c,v -retrieving revision 1.5 -diff -u -d -b -w -u -r1.5 ap_rmem_buf.c ---- lib/apr/buckets/ap_rmem_buf.c 2000/07/14 00:24:33 1.5 -+++ lib/apr/buckets/ap_rmem_buf.c 2000/07/17 23:40:33 -@@ -106,7 +106,7 @@ - ap_bucket *newbuf; - ap_bucket_rmem *b; - -- newbuf = malloc(sizeof(*newbuf)); -+ newbuf = calloc(1, sizeof(*newbuf)); - b = malloc(sizeof(*b)); - - b->alloc_len = 0; -Index: lib/apr/buckets/ap_rwmem_buf.c -=================================================================== -RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_rwmem_buf.c,v -retrieving revision 1.5 -diff -u -d -b -w -u -r1.5 ap_rwmem_buf.c ---- lib/apr/buckets/ap_rwmem_buf.c 2000/07/14 00:24:33 1.5 -+++ lib/apr/buckets/ap_rwmem_buf.c 2000/07/17 23:40:33 -@@ -124,7 +124,7 @@ - ap_bucket *newbuf; - ap_bucket_rwmem *b; - -- newbuf = malloc(sizeof(*newbuf)); -+ newbuf = calloc(1, sizeof(*newbuf)); - b = malloc(sizeof(*b)); - - b->alloc_addr = calloc(DEFAULT_RWBUF_SIZE, 1); -Index: lib/apr/buckets/apr_buf.h -=================================================================== -RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/apr_buf.h,v -retrieving revision 1.13 -diff -u -d -b -w -u -r1.13 apr_buf.h ---- lib/apr/buckets/apr_buf.h 2000/07/14 00:24:33 1.13 -+++ lib/apr/buckets/apr_buf.h 2000/07/17 23:40:33 -@@ -95,13 +95,8 @@ - * into the bucket. - */ - int (*insert)(ap_bucket *e, const void *buf, ap_size_t nbytes, ap_ssize_t *w); --}; -- --typedef struct ap_bucket_list ap_bucket_list; --struct ap_bucket_list { -- ap_bucket *bucket; /* The bucket */ -- ap_bucket_list *next; /* The next node in the bucket list */ -- ap_bucket_list *prev; /* The prev node in the bucket list */ -+ ap_bucket *next; /* The next node in the bucket list */ -+ ap_bucket *prev; /* The prev node in the bucket list */ - }; - - typedef struct ap_bucket_brigade ap_bucket_brigade; -@@ -111,8 +106,8 @@ - but this lets me register a cleanup - to put a limit on the brigade's - lifetime. */ -- ap_bucket_list *head; /* The start of the brigade */ -- ap_bucket_list *tail; /* The end of the brigade */ -+ ap_bucket *head; /* The start of the brigade */ -+ ap_bucket *tail; /* The end of the brigade */ - }; - - /* ****** Different bucket types *****/ -@@ -151,14 +146,10 @@ - - /* destroy an enitre bucket brigade */ - APR_EXPORT(ap_status_t) ap_bucket_brigade_destroy(void *b); -- --/* append a bucket_list to a bucket_brigade */ --APR_EXPORT(void) ap_bucket_brigade_append_list(ap_bucket_brigade *b, -- ap_bucket_list *e); - --/* append a bucket to a bucket_brigade */ --APR_EXPORT(void) ap_bucket_brigade_append_bucket(ap_bucket_brigade *b, -- ap_bucket *r); -+/* append bucket(s) to a bucket_brigade */ -+APR_EXPORT(void) ap_bucket_brigade_append_buckets(ap_bucket_brigade *b, -+ ap_bucket *e); - - /* consume nbytes from beginning of b -- call ap_bucket_destroy as - appropriate, and/or modify start on last element */ -@@ -189,14 +180,6 @@ - - APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_list va); - --/* ****** Bucket List Functions ***** */ -- --/* create a new bucket_list */ --APR_EXPORT(ap_bucket_list *) ap_bucket_list_create(void); -- --/* destroy an entire bucket_list */ --APR_EXPORT(ap_status_t) ap_destroy_bucket_list(ap_bucket_list *b); -- - /* ****** Bucket Functions ***** */ - - /* allocate a bucket of type color */ -@@ -204,6 +187,9 @@ - - /* destroy a bucket */ - APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e); -+ -+/* destroy an entire list of buckets */ -+APR_EXPORT(ap_status_t) ap_bucket_list_destroy(ap_bucket *e); - - /* Convert a bucket to a char * */ - APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b); -Index: main/Makefile.in +Index: src/main/Makefile.in =================================================================== RCS file: /home/cvs/apache-2.0/src/main/Makefile.in,v retrieving revision 1.16 diff -u -d -b -w -u -r1.16 Makefile.in ---- main/Makefile.in 2000/07/01 14:14:15 1.16 -+++ main/Makefile.in 2000/07/17 23:40:52 +--- src/main/Makefile.in 2000/07/01 14:14:15 1.16 ++++ src/main/Makefile.in 2000/07/20 16:18:04 @@ -8,7 +8,7 @@ http_protocol.c http_request.c http_vhost.c util.c util_date.c \ util_script.c util_uri.c util_md5.c util_cfgtree.c util_ebcdic.c \ @@ -420,13 +112,13 @@ diff -u -d -b -w -u -r1.16 Makefile.in include $(top_srcdir)/build/ltlib.mk -Index: main/http_core.c +Index: src/main/http_core.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v retrieving revision 1.88 diff -u -d -b -w -u -r1.88 http_core.c ---- main/http_core.c 2000/07/11 03:48:18 1.88 -+++ main/http_core.c 2000/07/17 23:40:52 +--- src/main/http_core.c 2000/07/11 03:48:18 1.88 ++++ src/main/http_core.c 2000/07/20 16:18:04 @@ -71,6 +71,8 @@ #include "util_md5.h" #include "apr_fnmatch.h" @@ -447,10 +139,31 @@ diff -u -d -b -w -u -r1.88 http_core.c /* Allow Apache to use ap_mmap */ #ifdef USE_MMAP_FILES #include "apr_mmap.h" -@@ -2872,6 +2878,51 @@ +@@ -2872,6 +2878,73 @@ return OK; } ++/* This is an incredibly stupid chunking filter. This will need to be somewhat ++ * smart about when it actually sends the data, but this implements some sort ++ * of chunking for right now. ++ */ ++static int chunk_filter(request_rec *r, ap_filter_t *f, ap_bucket_brigade *b) ++{ ++ ap_bucket *dptr = b->head; ++ ap_bucket_brigade *c = ap_bucket_brigade_create(r->pool); ++ int len = 0; ++ ++ while (dptr) { ++ len += ap_get_bucket_len(dptr); ++ dptr = dptr->next; ++ } ++ ++ ap_brigade_printf(c, "%d\r\n", len); ++ ap_bucket_brigade_catenate(c, b); ++ ++ return ap_pass_brigade(r, f, c); ++} ++ +/* Default filter. This filter should almost always be used. It's only job + * is to send the headers if they haven't already been sent, and then send + * the actual data. To send the data, we create an iovec out of the bucket @@ -464,12 +177,13 @@ diff -u -d -b -w -u -r1.88 http_core.c + */ +static int core_filter(request_rec *r, ap_filter_t *f, ap_bucket_brigade *b) +{ ++ ap_bucket *dptr = b->head; + ap_ssize_t bytes_sent; -+ ap_bucket *dptr; + int len = 0; + + if (!r->headers_sent) { + ap_send_http_header_real(r); ++ ap_bflush(r->connection->client); + r->headers_sent = 1; + } + @@ -499,19 +213,22 @@ diff -u -d -b -w -u -r1.88 http_core.c static const handler_rec core_handlers[] = { { "*/*", default_handler }, { "default-handler", default_handler }, -@@ -2894,6 +2945,11 @@ +@@ -2894,6 +2967,14 @@ static unsigned short core_port(const request_rec *r) { return DEFAULT_HTTP_PORT; } +static void core_register_filter(request_rec *r) +{ ++#if 0 ++ ap_hook_filter(chunk_filter, r, NULL, NULL, AP_HOOK_TRANSPORT); ++#endif + ap_hook_filter(core_filter, r, NULL, NULL, AP_HOOK_TRANSPORT_LAST); +} + static void register_hooks(void) { ap_hook_post_config(core_post_config,NULL,NULL,AP_HOOK_REALLY_FIRST); -@@ -2906,6 +2962,8 @@ +@@ -2906,6 +2987,8 @@ /* FIXME: I suspect we can eliminate the need for these - Ben */ ap_hook_type_checker(do_nothing,NULL,NULL,AP_HOOK_REALLY_LAST); ap_hook_access_checker(do_nothing,NULL,NULL,AP_HOOK_REALLY_LAST); @@ -520,13 +237,13 @@ diff -u -d -b -w -u -r1.88 http_core.c } API_VAR_EXPORT module core_module = { -Index: main/http_protocol.c +Index: src/main/http_protocol.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v retrieving revision 1.96 diff -u -d -b -w -u -r1.96 http_protocol.c ---- main/http_protocol.c 2000/07/13 16:26:42 1.96 -+++ main/http_protocol.c 2000/07/17 23:40:52 +--- src/main/http_protocol.c 2000/07/13 16:26:42 1.96 ++++ src/main/http_protocol.c 2000/07/20 16:18:04 @@ -64,6 +64,8 @@ */ @@ -560,7 +277,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + * filtering for you. + */ + f = ap_init_filter(r->pool); -+ ++ if (length == 0) return 0; @@ -585,7 +302,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + * that does all of this for us. + */ + bb = ap_bucket_brigade_create(r->pool); -+ b = ap_bucket_new(AP_BUCKET_mmap); ++ b = ap_bucket_mmap_create(); + b->insert(b, mm, mm->size, &total_bytes_sent); + bb->head = bb->tail = b; + total_bytes_sent = ap_pass_brigade(r, f, bb); @@ -619,7 +336,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + * that does all of this for us. + */ + bb = ap_bucket_brigade_create(r->pool); -+ b = ap_bucket_new(AP_BUCKET_rwmem); ++ b = ap_bucket_rwmem_create(); + b->insert(b, &c, 1, &written); + bb->head = bb->tail = b; + ap_pass_brigade(r, f, bb); @@ -655,7 +372,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + * that does all of this for us. + */ + bb = ap_bucket_brigade_create(r->pool); -+ b = ap_bucket_new(AP_BUCKET_rwmem); ++ b = ap_bucket_rwmem_create(); + b->insert(b, str, strlen(str), &written); + bb->head = bb->tail = b; + ap_pass_brigade(r, f, bb); @@ -693,7 +410,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + * that does all of this for us. + */ + bb = ap_bucket_brigade_create(r->pool); -+ b = ap_bucket_new(AP_BUCKET_rwmem); ++ b = ap_bucket_rwmem_create(); + b->insert(b, buf, nbyte, &written); + bb->head = bb->tail = b; + ap_pass_brigade(r, f, bb); @@ -812,19 +529,19 @@ diff -u -d -b -w -u -r1.96 http_protocol.c + * that does all of this for us. + */ + bb = ap_bucket_brigade_create(r->pool); -+ b = ap_bucket_new(AP_BUCKET_eos); ++ b = ap_bucket_eos_create(); + bb->head = bb->tail = b; + ap_pass_brigade(r, f, bb); return 0; } -Index: main/http_request.c +Index: src/main/http_request.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v retrieving revision 1.35 diff -u -d -b -w -u -r1.35 http_request.c ---- main/http_request.c 2000/06/24 17:33:57 1.35 -+++ main/http_request.c 2000/07/17 23:40:52 +--- src/main/http_request.c 2000/06/24 17:33:57 1.35 ++++ src/main/http_request.c 2000/07/20 16:18:04 @@ -1263,6 +1263,12 @@ return; } @@ -838,47 +555,3 @@ diff -u -d -b -w -u -r1.35 http_request.c /* Take care of little things that need to happen when we're done */ ap_finalize_request_protocol(r); } -Index: modules/mpm/config.m4 -=================================================================== -RCS file: /home/cvs/apache-2.0/src/modules/mpm/config.m4,v -retrieving revision 1.23 -diff -u -d -b -w -u -r1.23 config.m4 ---- modules/mpm/config.m4 2000/07/11 19:00:16 1.23 -+++ modules/mpm/config.m4 2000/07/17 23:40:58 -@@ -3,7 +3,6 @@ - [ --with-mpm=MPM Choose the process model for Apache to use. - MPM={dexter,mpmt_beos,mpmt_pthread,prefork,spmt_os2}],[ - APACHE_MPM=$withval -- mpm_explicit="yes" - ],[ - APACHE_MPM=mpmt_pthread - PLAT=`$ac_config_guess` -@@ -14,7 +13,6 @@ - *os2_emx*) - APACHE_MPM=spmt_os2;; - esac -- mpm_explicit="no" - ]) - AC_MSG_RESULT($APACHE_MPM) - -@@ -41,10 +39,11 @@ - MPM_DIR=modules/mpm/$MPM_NAME - MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la - --if test "$mpm_explicit" = "no"; then - if test "$MPM_NAME" = "prefork" ; then - MPM_NAME="prefork" - MPM_FAKE_NAME=prefork.c -+ ln -s mpmt.c modules/mpm/mpmt/prefork.c -+ - EXTRA_CFLAGS="$EXTRA_CFLAGS -DPREFORK" - - ac_cv_enable_threads="no" -@@ -78,7 +77,6 @@ - MPM_DIR=modules/mpm/$MPM_NAME - MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la - fi --fi - - APACHE_SUBST(MPM_NAME) - APACHE_SUBST(MPM_FAKE_NAME) From 4588c26823a7d8946ec87d7751fdb1c903c3399b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 20 Jul 2000 21:24:39 +0000 Subject: [PATCH 0421/7878] Include the chunking filter in the current build. This doesn't work correctly currently, but it isn't actually turned on right now either, so I don't mind that too much. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60396 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ryan.patch | 118 +++++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 62 deletions(-) diff --git a/buckets/ryan.patch b/buckets/ryan.patch index 2c4d549c4ad..2e0be79cd48 100644 --- a/buckets/ryan.patch +++ b/buckets/ryan.patch @@ -1,18 +1,14 @@ -? src/build.log -? src/build.err -? src/.inslog2 -? src/include/util_filter.h -? src/lib/apr/buckets/Makefile.in -? src/main/build.log -? src/main/build.err -? src/main/util_filter.c -Index: src/ap/Makefile.in +? include/util_filter.h +? lib/apr/buckets/Makefile.in +? lib/apr/include/apr_buf.h +? main/util_filter.c +Index: ap/Makefile.in =================================================================== RCS file: /home/cvs/apache-2.0/src/ap/Makefile.in,v retrieving revision 1.4 diff -u -d -b -w -u -r1.4 Makefile.in ---- src/ap/Makefile.in 2000/06/12 20:41:13 1.4 -+++ src/ap/Makefile.in 2000/07/20 16:17:56 +--- ap/Makefile.in 2000/06/12 20:41:13 1.4 ++++ ap/Makefile.in 2000/07/20 21:16:23 @@ -1,5 +1,5 @@ LTLIBRARY_NAME = libap.la @@ -20,13 +16,13 @@ diff -u -d -b -w -u -r1.4 Makefile.in +LTLIBRARY_SOURCES = ap_cache.c ap_base64.c ap_sha1.c ap_hooks.c include $(top_srcdir)/build/ltlib.mk -Index: src/include/ap_iol.h +Index: include/ap_iol.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/ap_iol.h,v retrieving revision 1.19 diff -u -d -b -w -u -r1.19 ap_iol.h ---- src/include/ap_iol.h 2000/05/29 04:22:02 1.19 -+++ src/include/ap_iol.h 2000/07/20 16:17:56 +--- include/ap_iol.h 2000/05/29 04:22:02 1.19 ++++ include/ap_iol.h 2000/07/20 21:16:23 @@ -58,6 +58,7 @@ #define AP_IOL_H @@ -35,37 +31,29 @@ diff -u -d -b -w -u -r1.19 ap_iol.h #include "apr_errno.h" /* For ap_status_t and the APR_errnos */ typedef struct ap_iol ap_iol; -Index: src/include/http_protocol.h +Index: include/http_protocol.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/http_protocol.h,v retrieving revision 1.19 diff -u -d -b -w -u -r1.19 http_protocol.h ---- src/include/http_protocol.h 2000/07/11 03:48:17 1.19 -+++ src/include/http_protocol.h 2000/07/20 16:17:56 -@@ -89,8 +89,15 @@ +--- include/http_protocol.h 2000/07/11 03:48:17 1.19 ++++ include/http_protocol.h 2000/07/20 21:16:23 +@@ -89,7 +89,7 @@ API_EXPORT(void) ap_basic_http_header(request_rec *r); /* Send the Status-Line and header fields for HTTP response */ +- +API_EXPORT(void) ap_send_http_header_real(request_rec *l); - --API_EXPORT(void) ap_send_http_header(request_rec *l); -+/* this is the old function that used to send headers to the network. We -+ * don't want handlers using it anymore, becuase the filter that actually -+ * writes to the network has to send the headers. I am defining it to be -+ * NULL, because everybody seems to want to not break existing modules. -+ * The new function ap_send_http_header_real() actually sends the data. -+ */ -+#define ap_send_http_header(l) /* No-op*/ + API_EXPORT(void) ap_send_http_header(request_rec *l); /* Send the response to special method requests */ - -Index: src/include/httpd.h +Index: include/httpd.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v retrieving revision 1.64 diff -u -d -b -w -u -r1.64 httpd.h ---- src/include/httpd.h 2000/06/30 21:18:13 1.64 -+++ src/include/httpd.h 2000/07/20 16:17:56 +--- include/httpd.h 2000/06/30 21:18:13 1.64 ++++ include/httpd.h 2000/07/20 21:16:23 @@ -596,6 +596,11 @@ * pointer back to the main request. */ @@ -78,13 +66,13 @@ diff -u -d -b -w -u -r1.64 httpd.h /* Info about the request itself... we begin with stuff that only * protocol.c should ever touch... */ -Index: src/lib/apr/configure.in +Index: lib/apr/configure.in =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v retrieving revision 1.136 diff -u -d -b -w -u -r1.136 configure.in ---- src/lib/apr/configure.in 2000/07/15 15:39:05 1.136 -+++ src/lib/apr/configure.in 2000/07/20 16:17:57 +--- lib/apr/configure.in 2000/07/15 15:39:05 1.136 ++++ lib/apr/configure.in 2000/07/20 21:16:24 @@ -682,8 +682,8 @@ AC_SUBST(EXEEXT) @@ -96,13 +84,13 @@ diff -u -d -b -w -u -r1.136 configure.in for dir in $MODULES do test -d $dir || $MKDIR -p $dir -Index: src/main/Makefile.in +Index: main/Makefile.in =================================================================== RCS file: /home/cvs/apache-2.0/src/main/Makefile.in,v retrieving revision 1.16 diff -u -d -b -w -u -r1.16 Makefile.in ---- src/main/Makefile.in 2000/07/01 14:14:15 1.16 -+++ src/main/Makefile.in 2000/07/20 16:18:04 +--- main/Makefile.in 2000/07/01 14:14:15 1.16 ++++ main/Makefile.in 2000/07/20 21:16:29 @@ -8,7 +8,7 @@ http_protocol.c http_request.c http_vhost.c util.c util_date.c \ util_script.c util_uri.c util_md5.c util_cfgtree.c util_ebcdic.c \ @@ -112,13 +100,13 @@ diff -u -d -b -w -u -r1.16 Makefile.in include $(top_srcdir)/build/ltlib.mk -Index: src/main/http_core.c +Index: main/http_core.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v retrieving revision 1.88 diff -u -d -b -w -u -r1.88 http_core.c ---- src/main/http_core.c 2000/07/11 03:48:18 1.88 -+++ src/main/http_core.c 2000/07/20 16:18:04 +--- main/http_core.c 2000/07/11 03:48:18 1.88 ++++ main/http_core.c 2000/07/20 21:16:29 @@ -71,6 +71,8 @@ #include "util_md5.h" #include "apr_fnmatch.h" @@ -139,7 +127,7 @@ diff -u -d -b -w -u -r1.88 http_core.c /* Allow Apache to use ap_mmap */ #ifdef USE_MMAP_FILES #include "apr_mmap.h" -@@ -2872,6 +2878,73 @@ +@@ -2872,6 +2878,76 @@ return OK; } @@ -158,8 +146,11 @@ diff -u -d -b -w -u -r1.88 http_core.c + dptr = dptr->next; + } + -+ ap_brigade_printf(c, "%d\r\n", len); ++ ap_brigade_printf(c, "%x\r\n", len); + ap_bucket_brigade_catenate(c, b); ++ dptr = ap_bucket_rwmem_create(); ++ dptr->insert(dptr, "\r\n", 2, &len); ++ ap_bucket_brigade_append_buckets(c, dptr); + + return ap_pass_brigade(r, f, c); +} @@ -213,22 +204,22 @@ diff -u -d -b -w -u -r1.88 http_core.c static const handler_rec core_handlers[] = { { "*/*", default_handler }, { "default-handler", default_handler }, -@@ -2894,6 +2967,14 @@ +@@ -2894,6 +2970,14 @@ static unsigned short core_port(const request_rec *r) { return DEFAULT_HTTP_PORT; } +static void core_register_filter(request_rec *r) +{ -+#if 0 -+ ap_hook_filter(chunk_filter, r, NULL, NULL, AP_HOOK_TRANSPORT); -+#endif ++ if (r->chunked) { ++ ap_hook_filter(chunk_filter, r, NULL, NULL, AP_HOOK_TRANSPORT); ++ } + ap_hook_filter(core_filter, r, NULL, NULL, AP_HOOK_TRANSPORT_LAST); +} + static void register_hooks(void) { ap_hook_post_config(core_post_config,NULL,NULL,AP_HOOK_REALLY_FIRST); -@@ -2906,6 +2987,8 @@ +@@ -2906,6 +2990,8 @@ /* FIXME: I suspect we can eliminate the need for these - Ben */ ap_hook_type_checker(do_nothing,NULL,NULL,AP_HOOK_REALLY_LAST); ap_hook_access_checker(do_nothing,NULL,NULL,AP_HOOK_REALLY_LAST); @@ -237,13 +228,13 @@ diff -u -d -b -w -u -r1.88 http_core.c } API_VAR_EXPORT module core_module = { -Index: src/main/http_protocol.c +Index: main/http_protocol.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v retrieving revision 1.96 diff -u -d -b -w -u -r1.96 http_protocol.c ---- src/main/http_protocol.c 2000/07/13 16:26:42 1.96 -+++ src/main/http_protocol.c 2000/07/20 16:18:04 +--- main/http_protocol.c 2000/07/13 16:26:42 1.96 ++++ main/http_protocol.c 2000/07/20 21:16:29 @@ -64,6 +64,8 @@ */ @@ -253,16 +244,19 @@ diff -u -d -b -w -u -r1.96 http_protocol.c #include "ap_config.h" #include "httpd.h" #include "http_config.h" -@@ -1720,7 +1722,7 @@ +@@ -1812,7 +1814,11 @@ + ap_rfc822_date(date, r->request_time); + ap_table_addn(r->headers_out, "Expires", date); } - } ++} --API_EXPORT(void) ap_send_http_header(request_rec *r) +API_EXPORT(void) ap_send_http_header_real(request_rec *r) - { - int i; - const long int zero = 0L; -@@ -2443,15 +2445,23 @@ ++{ ++ const long int zero = 0L; + /* Send the entire ap_table_t of header fields, terminated by an empty line. */ + + ap_table_do((int (*) (void *, const char *, const char *)) ap_send_header_field, +@@ -2443,15 +2449,23 @@ size_t length) { size_t total_bytes_sent = 0; @@ -290,7 +284,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c while (!r->connection->aborted && offset < length) { if (length - offset > MMAP_SEGMENT_SIZE) { n = MMAP_SEGMENT_SIZE; -@@ -2467,76 +2477,132 @@ +@@ -2467,76 +2481,132 @@ total_bytes_sent += w; offset += w; } @@ -455,7 +449,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c API_EXPORT_NONSTD(int) ap_rprintf(request_rec *r, const char *fmt, ...) { va_list va; -@@ -2546,46 +2612,58 @@ +@@ -2546,46 +2616,58 @@ return EOF; va_start(va, fmt); @@ -535,13 +529,13 @@ diff -u -d -b -w -u -r1.96 http_protocol.c return 0; } -Index: src/main/http_request.c +Index: main/http_request.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v retrieving revision 1.35 diff -u -d -b -w -u -r1.35 http_request.c ---- src/main/http_request.c 2000/06/24 17:33:57 1.35 -+++ src/main/http_request.c 2000/07/20 16:18:04 +--- main/http_request.c 2000/06/24 17:33:57 1.35 ++++ main/http_request.c 2000/07/20 21:16:29 @@ -1263,6 +1263,12 @@ return; } From ad70bb8725bf7a6de92e50a0a74a6aec03f4d71e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 21 Jul 2000 16:48:28 +0000 Subject: [PATCH 0422/7878] Fix some error-trapping logic in the APR_USE_PROC_PTHREAD_SERIALIZE implementation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60397 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/crossproc.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 274b9d89ad2..96d28625aa4 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -185,22 +185,25 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) return errno; } close(fd); - if ((stat = pthread_mutexattr_init(&mattr))) { + if (pthread_mutexattr_init(&mattr)) { + stat = errno; lock_cleanup(new); return stat; } - if ((stat = pthread_mutexattr_setpshared(&mattr, - PTHREAD_PROCESS_SHARED))) { + if (pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED)) { + stat = errno; lock_cleanup(new); return stat; } - if ((stat = pthread_mutex_init(new->interproc, &mattr))) { + if (pthread_mutex_init(new->interproc, &mattr)) { + stat = errno; lock_cleanup(new); return stat; } - if ((stat = pthread_mutexattr_destroy(&mattr))) { + if (pthread_mutexattr_destroy(&mattr)) { + stat = errno; lock_cleanup(new); return stat; } @@ -212,20 +215,17 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) ap_status_t ap_unix_lock_inter(ap_lock_t *lock) { - ap_status_t stat; - lock->curr_locked = 1; - if (stat = pthread_mutex_lock(lock->interproc)) { - return stat; + if (pthread_mutex_lock(lock->interproc)) { + return errno; } + lock->curr_locked = 1; return APR_SUCCESS; } ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) { - ap_status_t stat; - - if (stat = pthread_mutex_unlock(lock->interproc)) { - return stat; + if (pthread_mutex_unlock(lock->interproc)) { + return errno; } lock->curr_locked = 0; return APR_SUCCESS; From 347c7d87c5ebe61871640f1a877bf155e043c7e5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 21 Jul 2000 19:50:46 +0000 Subject: [PATCH 0423/7878] Move all APR functions related to strings to their own directory, and create a new header for those functions. This is the first step to removing the apr/lib directory completely, and moving those files/functions to descriptive directories. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60398 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 +- file_io/unix/dir.c | 1 + file_io/unix/fileacc.c | 1 + file_io/unix/filedup.c | 1 + file_io/unix/open.c | 1 + file_io/unix/pipe.c | 1 + i18n/unix/xlate.c | 1 + include/apr_lib.h | 22 ----- include/apr_pools.h | 73 -------------- include/apr_strings.h | 164 +++++++++++++++++++++++++++++++ lib/Makefile.in | 7 +- lib/apr_getpass.c | 1 + lib/apr_md5.c | 1 + lib/apr_pools.c | 67 +------------ lib/apr_tables.c | 1 + locks/unix/crossproc.c | 1 + locks/unix/locks.c | 1 + memory/unix/apr_pools.c | 67 +------------ misc/unix/errorcodes.c | 1 + misc/unix/start.c | 1 + network_io/unix/sockaddr.c | 1 + network_io/unix/sockopt.c | 1 + strings/.cvsignore | 1 + strings/Makefile.in | 105 ++++++++++++++++++++ {lib => strings}/apr_cpystrn.c | 1 + {lib => strings}/apr_snprintf.c | 0 strings/apr_strings.c | 125 +++++++++++++++++++++++ {lib => strings}/apr_strnatcmp.c | 0 threadproc/unix/proc.c | 1 + 29 files changed, 418 insertions(+), 234 deletions(-) create mode 100644 include/apr_strings.h create mode 100644 strings/.cvsignore create mode 100644 strings/Makefile.in rename {lib => strings}/apr_cpystrn.c (99%) rename {lib => strings}/apr_snprintf.c (100%) create mode 100644 strings/apr_strings.c rename {lib => strings}/apr_strnatcmp.c (100%) diff --git a/configure.in b/configure.in index f1fa5223567..6efc8856015 100644 --- a/configure.in +++ b/configure.in @@ -682,8 +682,8 @@ AC_SUBST(LIBPREFIX) AC_SUBST(EXEEXT) echo "Construct Makefiles and header files." -MAKEFILE1="Makefile lib/Makefile " -SUBDIRS="lib " +MAKEFILE1="Makefile lib/Makefile strings/Makefile" +SUBDIRS="lib strings " for dir in $MODULES do test -d $dir || $MKDIR -p $dir diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 8791620e953..f1599d1de52 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -53,6 +53,7 @@ */ #include "fileio.h" +#include "apr_strings.h" #include "apr_portable.h" static ap_status_t dir_cleanup(void *thedir) diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index e64336421fb..2a5135e82e3 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -52,6 +52,7 @@ * . */ +#include "apr_strings.h" #ifdef OS2 #include "../os2/fileio.h" #elif defined(WIN32) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 2a953da087c..b1f4f5e4b44 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -53,6 +53,7 @@ */ #include "fileio.h" +#include "apr_strings.h" #include "apr_portable.h" ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 6becd812c4f..a7c88cada4b 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -53,6 +53,7 @@ */ #include "fileio.h" +#include "apr_strings.h" #include "apr_portable.h" ap_status_t ap_unix_file_cleanup(void *thefile) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 97bbf72ee54..0c666d6745e 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -53,6 +53,7 @@ */ #include "fileio.h" +#include "apr_strings.h" static ap_status_t pipeblock(ap_file_t *thepipe) { diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index d7f2fa13735..a357a90dc5e 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -55,6 +55,7 @@ #include "apr_private.h" #include "apr_lib.h" +#include "apr_strings.h" #include "apr_xlate.h" /* If no implementation is available, don't generate code here since diff --git a/include/apr_lib.h b/include/apr_lib.h index 9aad9405f79..e52c81e5c86 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -368,28 +368,6 @@ B APR_EXPORT(void) ap_note_subprocess(struct ap_pool_t *a, ap_proc_t *pid, enum kill_conditions how); -/* - -=head1 char *ap_cpystrn(char *dst, const char *src, size_t dst_size) - -B - - arg 1) The destination string - arg 2) The source string - arg 3) The number of characters to copy - -B: We re-implement this function to implement these specific changes: - 1) strncpy() doesn't always null terminate and we want it to. - 2) strncpy() null fills, which is bogus, esp. when copy 8byte strings - into 8k blocks. - 3) Instead of returning the pointer to the beginning of the - destination string, we return a pointer to the terminating '\0' - to allow us to check for truncation. - -=cut - */ -APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size); - #ifdef __cplusplus } #endif diff --git a/include/apr_pools.h b/include/apr_pools.h index 2d0a937cb67..1c00114aaf8 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -266,79 +266,6 @@ APR_EXPORT(void *) ap_pcalloc(ap_pool_t *p, ap_size_t size); /* -=head1 char *ap_pstrdup(ap_pool_t *c, const char *s) - -B - - arg 1) The pool to allocate out of - arg 2) The string to allocate - return) The new string - -=cut - */ -APR_EXPORT(char *) ap_pstrdup(ap_pool_t *p, const char *s); - -/* - -=head1 char *ap_pstrndup(ap_pool_t *c, const char *s, ap_size_t n) - -B - - arg 1) The pool to allocate out of - arg 2) The string to allocate - arg 3) The number of characters to duplicate - return) The new string - -=cut - */ -APR_EXPORT(char *) ap_pstrndup(ap_pool_t *p, const char *s, ap_size_t n); - -/* - -=head1 char *ap_pstrcat(ap_pool_t *c, ...) - -B - - arg 1) The pool to allocate out of - ...) The strings to concatenate. The final string must be NULL - return) The new string - -=cut - */ -APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *p, ...); - -/* - -=head1 char *ap_pvsprintf(ap_pool_t *c, const char *fmt, va_list ap) - -B - - arg 1) The pool to allocate out of - arg 2) The format of the string - arg 3) The arguments to use while printing the data - return) The new string - -=cut - */ -APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap); - -/* - -=head1 char *ap_psprintf(ap_pool_t *c, const char *fmt, ...) - -B - - arg 1) The pool to allocate out of - arg 2) The format of the string - ...) The arguments to use while printing the data - return) The new string - -=cut - */ -APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...); - -/* - =head1 void ap_register_cleanup(ap_pool_t *p, const void *data, ap_status_t (*plain_cleanup)(void *), ap_status_t (*child_cleanup)(void *)) diff --git a/include/apr_strings.h b/include/apr_strings.h new file mode 100644 index 00000000000..b241e5a8db4 --- /dev/null +++ b/include/apr_strings.h @@ -0,0 +1,164 @@ +/* -*- mode: c; c-file-style: "k&r" -*- + + strnatcmp.c -- Perform 'natural order' comparisons of strings in C. + Copyright (C) 2000 by Martin Pool + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "apr.h" +#include "apr_lib.h" + +#ifndef APR_STRINGS_H +#define APR_STRINGS_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + +=head1 int ap_strnatcmp(char const *a, char const *b) + +B + + arg 1) The first string to compare + arg 2) The second string to compare + return) Either <0, 0, or >0. If the first string is less than the second + this returns <0, if they are equivalent it returns 0, and if the + first string is greater than second string it retuns >0. + +=cut + */ +int ap_strnatcmp(char const *a, char const *b); + +/* + +=head1 int ap_strnatcmp(char const *a, char const *b) + +B + + arg 1) The first string to compare + arg 2) The second string to compare + return) Either <0, 0, or >0. If the first string is less than the second + this returns <0, if they are equivalent it returns 0, and if the + first string is greater than second string it retuns >0. + +=cut + */ +int ap_strnatcasecmp(char const *a, char const *b); + +/* + +=head1 char *ap_pstrdup(ap_pool_t *c, const char *s) + +B + + arg 1) The pool to allocate out of + arg 2) The string to allocate + return) The new string + +=cut + */ +APR_EXPORT(char *) ap_pstrdup(ap_pool_t *p, const char *s); + +/* + +=head1 char *ap_pstrndup(ap_pool_t *c, const char *s, ap_size_t n) + +B + + arg 1) The pool to allocate out of + arg 2) The string to allocate + arg 3) The number of characters to duplicate + return) The new string + +=cut + */ +APR_EXPORT(char *) ap_pstrndup(ap_pool_t *p, const char *s, ap_size_t n); + +/* +=head1 char *ap_pstrcat(ap_pool_t *c, ...) + +B + + arg 1) The pool to allocate out of + ...) The strings to concatenate. The final string must be NULL + return) The new string + +=cut + */ +APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *p, ...); + +/* + +=head1 char *ap_pvsprintf(ap_pool_t *c, const char *fmt, va_list ap) +B + + arg 1) The pool to allocate out of + arg 2) The format of the string + arg 3) The arguments to use while printing the data + return) The new string + +=cut + */ +APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap); + +/* + +=head1 char *ap_psprintf(ap_pool_t *c, const char *fmt, ...) + +B + + arg 1) The pool to allocate out of + arg 2) The format of the string + ...) The arguments to use while printing the data + return) The new string + +=cut + */ +APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...); + +/* + +=head1 char *ap_cpystrn(char *dst, const char *src, size_t dst_size) + +B + + arg 1) The destination string + arg 2) The source string + arg 3) The number of characters to copy + +B: We re-implement this function to implement these specific changes: + 1) strncpy() doesn't always null terminate and we want it to. + 2) strncpy() null fills, which is bogus, esp. when copy 8byte strings + into 8k blocks. + 3) Instead of returning the pointer to the beginning of the + destination string, we return a pointer to the terminating '\0' + to allow us to check for truncation. + +=cut + */ +APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size); + +#ifdef __cplusplus +} +#endif + +#endif /* !APR_STRINGS_H */ diff --git a/lib/Makefile.in b/lib/Makefile.in index 3e290ff26e2..c508ec63617 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -16,17 +16,14 @@ INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix #LIB=@LIBPREFIX@apr.a -OBJS=apr_cpystrn.o \ - apr_fnmatch.o \ +OBJS=apr_fnmatch.o \ apr_execve.o \ apr_md5.o \ apr_pools.o \ apr_signal.o \ - apr_snprintf.o \ apr_tables.o \ apr_hash.o \ - apr_getpass.o \ - apr_strnatcmp.o + apr_getpass.o .c.o: $(CC) $(CFLAGS) -c $(INCLUDES) $< diff --git a/lib/apr_getpass.c b/lib/apr_getpass.c index 13cac5f783a..2c1797775de 100644 --- a/lib/apr_getpass.c +++ b/lib/apr_getpass.c @@ -58,6 +58,7 @@ * use one we define ourselves. */ #include "apr_private.h" +#include "apr_strings.h" #include "apr_lib.h" #include "apr_errno.h" #include diff --git a/lib/apr_md5.c b/lib/apr_md5.c index d553551edae..68aebfb8b85 100644 --- a/lib/apr_md5.c +++ b/lib/apr_md5.c @@ -98,6 +98,7 @@ #ifndef WIN32 #include "apr_private.h" #endif +#include "apr_strings.h" #include "apr_md5.h" #include "apr_lib.h" diff --git a/lib/apr_pools.c b/lib/apr_pools.c index a3289977880..8b7321bf6fb 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -63,6 +63,7 @@ #include "apr_private.h" #include "apr_portable.h" /* for get_os_proc */ +#include "apr_strings.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_lib.h" @@ -953,72 +954,6 @@ APR_EXPORT(void *) ap_pcalloc(ap_pool_t *a, ap_size_t size) return res; } -APR_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) -{ - char *res; - size_t len; - - if (s == NULL) { - return NULL; - } - len = strlen(s) + 1; - res = ap_palloc(a, len); - memcpy(res, s, len); - return res; -} - -APR_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, ap_size_t n) -{ - char *res; - - if (s == NULL) { - return NULL; - } - res = ap_palloc(a, n + 1); - memcpy(res, s, n); - res[n] = '\0'; - return res; -} - -APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *a, ...) -{ - char *cp, *argp, *res; - - /* Pass one --- find length of required string */ - - ap_size_t len = 0; - va_list adummy; - - va_start(adummy, a); - - while ((cp = va_arg(adummy, char *)) != NULL) { - len += strlen(cp); - } - - va_end(adummy); - - /* Allocate the required string */ - - res = (char *) ap_palloc(a, len + 1); - cp = res; - *cp = '\0'; - - /* Pass two --- copy the argument strings into the result space */ - - va_start(adummy, a); - - while ((argp = va_arg(adummy, char *)) != NULL) { - strcpy(cp, argp); - cp += strlen(argp); - } - - va_end(adummy); - - /* Return the result string */ - - return res; -} - /* * ap_psprintf is implemented by writing directly into the current * block of the pool, starting right at first_avail. If there's diff --git a/lib/apr_tables.c b/lib/apr_tables.c index cb4920438af..8c417b2eba2 100644 --- a/lib/apr_tables.c +++ b/lib/apr_tables.c @@ -64,6 +64,7 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_tables.h" +#include "apr_strings.h" #include "apr_lib.h" #include "misc.h" #ifdef HAVE_STDLIB_H diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 96d28625aa4..ed01583b35f 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -53,6 +53,7 @@ */ #include "apr.h" +#include "apr_strings.h" #include "locks.h" #if APR_USE_SYSVSEM_SERIALIZE diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 823c9ca37e8..3e25cc67e22 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -53,6 +53,7 @@ */ #include "locks.h" +#include "apr_strings.h" #include "apr_portable.h" ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index a3289977880..8b7321bf6fb 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -63,6 +63,7 @@ #include "apr_private.h" #include "apr_portable.h" /* for get_os_proc */ +#include "apr_strings.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_lib.h" @@ -953,72 +954,6 @@ APR_EXPORT(void *) ap_pcalloc(ap_pool_t *a, ap_size_t size) return res; } -APR_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) -{ - char *res; - size_t len; - - if (s == NULL) { - return NULL; - } - len = strlen(s) + 1; - res = ap_palloc(a, len); - memcpy(res, s, len); - return res; -} - -APR_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, ap_size_t n) -{ - char *res; - - if (s == NULL) { - return NULL; - } - res = ap_palloc(a, n + 1); - memcpy(res, s, n); - res[n] = '\0'; - return res; -} - -APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *a, ...) -{ - char *cp, *argp, *res; - - /* Pass one --- find length of required string */ - - ap_size_t len = 0; - va_list adummy; - - va_start(adummy, a); - - while ((cp = va_arg(adummy, char *)) != NULL) { - len += strlen(cp); - } - - va_end(adummy); - - /* Allocate the required string */ - - res = (char *) ap_palloc(a, len + 1); - cp = res; - *cp = '\0'; - - /* Pass two --- copy the argument strings into the result space */ - - va_start(adummy, a); - - while ((argp = va_arg(adummy, char *)) != NULL) { - strcpy(cp, argp); - cp += strlen(argp); - } - - va_end(adummy); - - /* Return the result string */ - - return res; -} - /* * ap_psprintf is implemented by writing directly into the current * block of the pool, starting right at first_avail. If there's diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index fe98e55a986..0aee7c07102 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -53,6 +53,7 @@ */ #include "misc.h" +#include "apr_strings.h" #include "apr_lib.h" #include "apr_dso.h" diff --git a/misc/unix/start.c b/misc/unix/start.c index c84782f0ddd..4543f597036 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -54,6 +54,7 @@ #include "misc.h" #include "locks.h" +#include "apr_strings.h" ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont) { diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 1a912d7f6d5..4bfd0b50e3e 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -53,6 +53,7 @@ */ #include "networkio.h" +#include "apr_strings.h" ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) { diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index c4ca2ebc521..d8044c9acdf 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -53,6 +53,7 @@ */ #include "networkio.h" +#include "apr_strings.h" static ap_status_t soblock(int sd) { diff --git a/strings/.cvsignore b/strings/.cvsignore new file mode 100644 index 00000000000..f3c7a7c5da6 --- /dev/null +++ b/strings/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/strings/Makefile.in b/strings/Makefile.in new file mode 100644 index 00000000000..ef370c61cdc --- /dev/null +++ b/strings/Makefile.in @@ -0,0 +1,105 @@ +#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) +#LIBS=$(EXTRA_LIBS) $(LIBS1) +#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) +#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) + +CC=@CC@ +RANLIB=@RANLIB@ +AR=@AR@ +RM=@RM@ +CFLAGS=@CFLAGS@ @OPTIM@ +LIBS=@LIBS@ +LDFLAGS=@LDFLAGS@ $(LIBS) +INCDIR=../include +INCDIR1=../misc/@OSDIR@ +INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix + +#LIB=@LIBPREFIX@apr.a + +OBJS=apr_cpystrn.o \ + apr_snprintf.o \ + apr_strnatcmp.o \ + apr_strings.o + +.c.o: + $(CC) $(CFLAGS) -c $(INCLUDES) $< + +all: $(OBJS) + +clean: + $(RM) -f *.o *.a *.so + +distclean: clean + -$(RM) -f Makefile + + +#$(LIB): $(OBJS) +# $(RM) -f $@ +# $(AR) cr $@ $(OBJS) +# $(RANLIB) $@ + +# +# We really don't expect end users to use this rule. It works only with +# gcc, and rebuilds Makefile.in. You have to re-run configure after +# using it. +# +depend: + cp Makefile.in Makefile.in.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ + && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ + && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ + -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + > Makefile.in \ + && rm Makefile.new + +# DO NOT REMOVE +apr_cpystrn.o: apr_cpystrn.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h +apr_execve.o: apr_execve.c $(INCDIR)/apr_private.h +apr_fnmatch.o: apr_fnmatch.c $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_fnmatch.h $(INCDIR)/apr_errno.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h +apr_getpass.o: apr_getpass.c $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h +apr_hash.o: apr_hash.c $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h $(INCDIR)/apr_hash.h +apr_md5.o: apr_md5.c $(INCDIR)/apr_private.h $(INCDIR)/apr_md5.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_xlate.h +apr_pools.o: apr_pools.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_dso.h $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_tables.h ../misc/unix/misc.h $(INCDIR)/apr_getopt.h +apr_signal.o: apr_signal.c $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h +apr_snprintf.o: apr_snprintf.c $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h +apr_strnatcmp.o: apr_strnatcmp.c $(INCDIR)/apr_strnatcmp.h +apr_tables.o: apr_tables.c $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_lib.h ../misc/unix/misc.h \ + $(INCDIR)/apr_getopt.h diff --git a/lib/apr_cpystrn.c b/strings/apr_cpystrn.c similarity index 99% rename from lib/apr_cpystrn.c rename to strings/apr_cpystrn.c index 37fd2bad56d..0f6a503b220 100644 --- a/lib/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -53,6 +53,7 @@ */ #include "apr.h" +#include "apr_strings.h" #include "apr_private.h" #include "apr_lib.h" diff --git a/lib/apr_snprintf.c b/strings/apr_snprintf.c similarity index 100% rename from lib/apr_snprintf.c rename to strings/apr_snprintf.c diff --git a/strings/apr_strings.c b/strings/apr_strings.c new file mode 100644 index 00000000000..2d53695f8e5 --- /dev/null +++ b/strings/apr_strings.c @@ -0,0 +1,125 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_strings.h" +#include "apr_private.h" +#include "apr_lib.h" + +APR_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) +{ + char *res; + size_t len; + + if (s == NULL) { + return NULL; + } + len = strlen(s) + 1; + res = ap_palloc(a, len); + memcpy(res, s, len); + return res; +} + +APR_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, ap_size_t n) +{ + char *res; + + if (s == NULL) { + return NULL; + } + res = ap_palloc(a, n + 1); + memcpy(res, s, n); + res[n] = '\0'; + return res; +} + +APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *a, ...) +{ + char *cp, *argp, *res; + + /* Pass one --- find length of required string */ + + ap_size_t len = 0; + va_list adummy; + + va_start(adummy, a); + + while ((cp = va_arg(adummy, char *)) != NULL) { + len += strlen(cp); + } + + va_end(adummy); + + /* Allocate the required string */ + + res = (char *) ap_palloc(a, len + 1); + cp = res; + *cp = '\0'; + + /* Pass two --- copy the argument strings into the result space */ + + va_start(adummy, a); + + while ((argp = va_arg(adummy, char *)) != NULL) { + strcpy(cp, argp); + cp += strlen(argp); + } + + va_end(adummy); + + /* Return the result string */ + + return res; +} + diff --git a/lib/apr_strnatcmp.c b/strings/apr_strnatcmp.c similarity index 100% rename from lib/apr_strnatcmp.c rename to strings/apr_strnatcmp.c diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 787501a1a6d..ca8be5050ad 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -53,6 +53,7 @@ */ #include "threadproc.h" +#include "apr_strings.h" #include "apr_portable.h" ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) From 06abeac7250148b1971a1b0bb124871b3d1381c2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 21 Jul 2000 20:05:58 +0000 Subject: [PATCH 0424/7878] Move apr_fnmatch.c from lib/apr/lib to lib/apr/strings. Just the next move to clean out the lib/apr/lib directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60399 13f79535-47bb-0310-9956-ffa450edef68 --- lib/Makefile.in | 3 +-- strings/Makefile.in | 3 ++- {lib => strings}/apr_fnmatch.c | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename {lib => strings}/apr_fnmatch.c (100%) diff --git a/lib/Makefile.in b/lib/Makefile.in index c508ec63617..bc2d8b4b6a8 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -16,8 +16,7 @@ INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix #LIB=@LIBPREFIX@apr.a -OBJS=apr_fnmatch.o \ - apr_execve.o \ +OBJS=apr_execve.o \ apr_md5.o \ apr_pools.o \ apr_signal.o \ diff --git a/strings/Makefile.in b/strings/Makefile.in index ef370c61cdc..1e3ab7bad8f 100644 --- a/strings/Makefile.in +++ b/strings/Makefile.in @@ -19,7 +19,8 @@ INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix OBJS=apr_cpystrn.o \ apr_snprintf.o \ apr_strnatcmp.o \ - apr_strings.o + apr_strings.o \ + apr_fnmatch.o .c.o: $(CC) $(CFLAGS) -c $(INCLUDES) $< diff --git a/lib/apr_fnmatch.c b/strings/apr_fnmatch.c similarity index 100% rename from lib/apr_fnmatch.c rename to strings/apr_fnmatch.c From 8503555503d67e64cf9b3c79d3e07eca514afa79 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 21 Jul 2000 20:24:27 +0000 Subject: [PATCH 0425/7878] Sort-of back out the previous change (return errno from a pthread_* failure). As before my prior commit, we normally use the return code from pthread_* instead of errno as the ap_status_t; now however there is a way to have errno used instead; currently, this is only enabled for OS/390. There are other places in APR with this issue. Also, a long-standing buglet was fixed: in lock_cleanup(), errno was returned after a failed pthread_mutex_unlock() call. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60400 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 1 + locks/unix/crossproc.c | 42 ++++++++++++++++++++++++++++++++---------- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/hints.m4 b/hints.m4 index eeb943d43b4..f93bbf8d887 100644 --- a/hints.m4 +++ b/hints.m4 @@ -394,6 +394,7 @@ dnl ;; APR_SETIFNULL(CC, [cc]) APR_ADDTO(CFLAGS, [-U_NO_PROTO]) APR_ADDTO(CFLAGS, [-DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR]) + APR_ADDTO(CFLAGS, [-DPTHREAD_SETS_ERRNO]) APR_ADDTO(CFLAGS, [-DPTHREAD_DETACH_ARG1_ADDR]) APR_ADDTO(CFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK]) ;; diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index ed01583b35f..556e8443f8a 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -156,10 +156,14 @@ void ap_unix_setup_lock(void) static ap_status_t lock_cleanup(void *lock_) { ap_lock_t *lock=lock_; + ap_status_t stat; if (lock->curr_locked == 1) { - if (pthread_mutex_unlock(lock->interproc)) { - return errno; + if ((stat = pthread_mutex_unlock(lock->interproc))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + return stat; } if (munmap((caddr_t)lock->interproc, sizeof(pthread_mutex_t))){ return errno; @@ -186,25 +190,33 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) return errno; } close(fd); - if (pthread_mutexattr_init(&mattr)) { + if ((stat = pthread_mutexattr_init(&mattr))) { +#ifdef PTHREAD_SETS_ERRNO stat = errno; +#endif lock_cleanup(new); return stat; } - if (pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED)) { + if ((stat = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED))) { +#ifdef PTHREAD_SETS_ERRNO stat = errno; +#endif lock_cleanup(new); return stat; } - if (pthread_mutex_init(new->interproc, &mattr)) { + if ((stat = pthread_mutex_init(new->interproc, &mattr))) { +#ifdef PTHREAD_SETS_ERRNO stat = errno; +#endif lock_cleanup(new); return stat; } - if (pthread_mutexattr_destroy(&mattr)) { + if ((stat = pthread_mutexattr_destroy(&mattr))) { +#ifdef PTHREAD_SETS_ERRNO stat = errno; +#endif lock_cleanup(new); return stat; } @@ -216,8 +228,13 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) ap_status_t ap_unix_lock_inter(ap_lock_t *lock) { - if (pthread_mutex_lock(lock->interproc)) { - return errno; + ap_status_t stat; + + if ((stat = pthread_mutex_lock(lock->interproc))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + return stat; } lock->curr_locked = 1; return APR_SUCCESS; @@ -225,8 +242,13 @@ ap_status_t ap_unix_lock_inter(ap_lock_t *lock) ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) { - if (pthread_mutex_unlock(lock->interproc)) { - return errno; + ap_status_t stat; + + if ((stat = pthread_mutex_unlock(lock->interproc))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + return stat; } lock->curr_locked = 0; return APR_SUCCESS; From 8e2013a84ce47c41081b4384582f6ccb48c9495f Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 21 Jul 2000 20:30:43 +0000 Subject: [PATCH 0426/7878] Move some prototypes from apr_lib.h to apr_strings.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60401 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 31 ------------------------------- include/apr_strings.h | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index e52c81e5c86..2b5ef99d9f9 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -89,22 +89,6 @@ typedef struct ap_vformatter_buff_t { /* -=head1 ap_status_t ap_tokenize_to_argv(const char **arg_str, char ***argv_out, ap_pool_t *token_context) - -B - - arg 1) The arguments to convert - arg 2) Output location. This is a pointer to an array of strings. - arg 3) Pool to use. - -=cut - */ -APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, - char ***argv_out, - ap_pool_t *token_context); - -/* - =head1 ap_status_t ap_filename_of_pathname(const char *pathname) B @@ -120,21 +104,6 @@ B: Examples: "/foo/bar/gum" -> "gum" */ APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); - -/* - -=head1 ap_status_t ap_collapse_spaces(char *dest, const char *src) - -B - - arg 1) The destination string. It is okay to modify the string - in place. Namely dest == src - arg 2) The string to rid the spaces from. - -=cut - */ -APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src); - /* =head1 ap_status_t ap_execle(const char *c, const char *a, ...) diff --git a/include/apr_strings.h b/include/apr_strings.h index b241e5a8db4..2d1816485f3 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -157,6 +157,38 @@ B: We re-implement this function to implement these specific changes: */ APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size); +/* + +=head1 ap_status_t ap_collapse_spaces(char *dest, const char *src) + +B + + arg 1) The destination string. It is okay to modify the string + in place. Namely dest == src + arg 2) The string to rid the spaces from. + +=cut + */ +APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src); + +/* + +=head1 ap_status_t ap_tokenize_to_argv(const char **arg_str, char ***argv_out, a +p_pool_t *token_context) + +B + + arg 1) The arguments to convert + arg 2) Output location. This is a pointer to an array of strings. + arg 3) Pool to use. + +=cut + */ +APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, + char ***argv_out, + ap_pool_t *token_context); + #ifdef __cplusplus } #endif From c612531f32596df0fe44903a359d32a3f6409dde Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 21 Jul 2000 21:06:25 +0000 Subject: [PATCH 0427/7878] Remove all of the ap_exec* functions. Nobody is currently using these functions, and since we don't really have a fork function in APR, I'm not sure having exec functions makes sense. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60402 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 30 ---- lib/Makefile.in | 3 +- lib/apr_execve.c | 386 ---------------------------------------------- 3 files changed, 1 insertion(+), 418 deletions(-) delete mode 100644 lib/apr_execve.c diff --git a/include/apr_lib.h b/include/apr_lib.h index 2b5ef99d9f9..f3b9c0ea9b0 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -104,36 +104,6 @@ B: Examples: "/foo/bar/gum" -> "gum" */ APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); -/* - -=head1 ap_status_t ap_execle(const char *c, const char *a, ...) - -B - - arg 1) The path to the new program to run - arg 2) The first argument for the new program - ...) The rest of the arguments for the new program. - -=cut - */ -APR_EXPORT_NONSTD(ap_status_t) ap_execle(const char *c, const char *a, ...); - -/* - -=head1 ap_status_t ap_execve(const char *c, const char *aargv[], const char *envp[]) - -B - - arg 1) The path to the new program to run - arg 2) The arguments for the new program in an array of char *. - arg 3) The environment for the new program in an array of char * of the - form key=value - -=cut - */ -APR_EXPORT_NONSTD(ap_status_t) ap_execve(const char *c, const char *argv[], - const char *envp[]); - /* These macros allow correct support of 8-bit characters on systems which * support 8-bit characters. Pretty dumb how the cast is required, but * that's legacy libc for ya. These new macros do not support EOF like diff --git a/lib/Makefile.in b/lib/Makefile.in index bc2d8b4b6a8..5e8dd631a89 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -16,8 +16,7 @@ INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix #LIB=@LIBPREFIX@apr.a -OBJS=apr_execve.o \ - apr_md5.o \ +OBJS=apr_md5.o \ apr_pools.o \ apr_signal.o \ apr_tables.o \ diff --git a/lib/apr_execve.c b/lib/apr_execve.c deleted file mode 100644 index d972a182148..00000000000 --- a/lib/apr_execve.c +++ /dev/null @@ -1,386 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* - * Portions of this code are under this license: - * - * Copyright (c) 1980, 1991 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#ifndef WIN32 -#include "apr_private.h" -#endif -/*---------------------------------------------------------------*/ - -#ifdef NEED_HASHBANG_EMUL - -#undef execle -#undef execve - -static const char **hashbang(const char *filename, char * const *argv); - - -/* Historically, a list of arguments on the stack was often treated as - * being equivalent to an array (since they already were "contiguous" - * on the stack, and the arguments were pushed in the correct order). - * On today's processors, this is not necessarily equivalent, because - * often arguments are padded or passed partially in registers, - * or the stack direction is backwards. - * To be on the safe side, we copy the argument list to our own - * local argv[] array. The va_arg logic makes sure we do the right thing. - * XXX: malloc() is used because we expect to be overlaid soon. - */ -APR_EXPORT_NONSTD(ap_status_t) ap_execle(const char *filename, - const char *argv0, ...) -{ - va_list adummy; - char **envp; - char **argv; - int argc, ret; - - /* First pass: Count arguments on stack */ - va_start(adummy, argv0); - for (argc = 1; va_arg(adummy, char *) != NULL; ++argc) { - continue; - } - va_end(adummy); - - if ((argv = (char **) malloc((argc + 2) * sizeof(*argv))) == NULL) { - return APR_ENOMEM; - } - - /* Pass two --- copy the argument strings into the result space */ - va_start(adummy, argv0); - argv[0] = (char *)argv0; - for (argc = 1; (argv[argc] = va_arg(adummy, char *)) != NULL; ++argc) { - continue; - } - envp = va_arg(adummy, char **); - va_end(adummy); - - ap_execve(filename, argv, envp); - ret = errno; - free(argv); - - return ret; -} - -/* Count number of entries in vector "args", including the trailing NULL entry - */ -static int -count_args(char * const *args) -{ - int i; - for (i = 0; args[i] != NULL; ++i) { - continue; - } - return i+1; -} - -/* Emulate the execve call, respecting a #!/interpreter line if present. - * On "real" unixes, the kernel does this. - * We have to fiddle with the argv array to make it work on platforms - * which don't support the "hashbang" interpreter line by default. - */ -APR_EXPORT(ap_status_t) ap_execve(const char *filename, char * const argv[], - char * const envp[]) -{ - char **script_argv; - extern char **environ; - - if (envp == NULL) { - envp = (char * const *) environ; - } - - /* Try to execute the file directly first: */ - execve(filename, argv, envp); - - /* Still with us? Then something went seriously wrong. - * From the (linux) man page: - * EACCES The file is not a regular file. - * EACCES Execute permission is denied for the file. - * EACCES Search permission is denied on a component of the path prefix. - * EPERM The file system is mounted noexec. - * EPERM The file system is mounted nosuid and the file has an SUID - * or SGID bit set. - * E2BIG The argument list is too big. - * ENOEXEC The magic number in the file is incorrect. - * EFAULT filename points outside your accessible address space. - * ENAMETOOLONG filename is too long. - * ENOENT The file does not exist. - * ENOMEM Insufficient kernel memory was available. - * ENOTDIR A component of the path prefix is not a directory. - * ELOOP filename contains a circular reference (i.e., via a symbolic link) - */ - - if (errno == ENOEXEC) { - /* Probably a script. - * Have a look; if there's a "#!" header then try to emulate - * the feature found in all modern OS's: - * Interpret the line following the #! as a command line - * in shell style. - */ - if ((script_argv = (char **)hashbang(filename, argv)) != NULL) { - - /* new filename is the interpreter to call */ - filename = script_argv[0]; - - /* Restore argv[0] as on entry */ - if (argv[0] != NULL) { - script_argv[0] = argv[0]; - } - - execve(filename, script_argv, envp); - - free(script_argv); - } - /* - * Script doesn't start with a hashbang line! - * So, try to have the default shell execute it. - * For this, the size of argv must be increased by one - * entry: the shell's name. The remaining args are appended. - */ - else { - int i = count_args(argv) + 1; /* +1 for leading SHELL_PATH */ - - if ((script_argv = malloc(sizeof(*script_argv) * i)) == NULL) { - return APR_ENOMEM; - } - - script_argv[0] = SHELL_PATH; - - while (i > 0) { - script_argv[i] = argv[i-1]; - --i; - } - - execve(SHELL_PATH, script_argv, envp); - - free(script_argv); - } - } - return errno; -} - -/*---------------------------------------------------------------*/ - -/* - * From: peter@zeus.dialix.oz.au (Peter Wemm) - * (taken from tcsh) - * If exec() fails look first for a #! [word] [word] .... - * If it is, splice the header into the argument list and retry. - * Return value: the original argv array (sans argv[0]), with the - * script's argument list prepended. - * XXX: malloc() is used so that everything can be free()ed after a failure. - */ -#define HACKBUFSZ 1024 /* Max chars in #! vector */ -#define HACKVECSZ 128 /* Max words in #! vector */ -static const char **hashbang(const char *filename, char * const *argv) -{ - char lbuf[HACKBUFSZ]; - char *sargv[HACKVECSZ]; - const char **newargv; - char *p, *ws; - int fd; - int sargc = 0; - int i, j; -#ifdef WIN32 - int fw = 0; /* found at least one word */ - int first_word = 0; -#endif /* WIN32 */ - - if ((fd = open(filename, O_RDONLY)) == -1) { - return NULL; - } - - if (read(fd, (char *) lbuf, 2) != 2 - || lbuf[0] != '#' || lbuf[1] != '!' - || read(fd, (char *) lbuf, HACKBUFSZ) <= 0) { - close(fd); - return NULL; - } - - close(fd); - - ws = NULL; /* word started = 0 */ - - for (p = lbuf; p < &lbuf[HACKBUFSZ];) { - switch (*p) { - case ' ': - case '\t': -#ifdef NEW_CRLF - case '\r': -#endif /*NEW_CRLF */ - if (ws) { /* a blank after a word.. save it */ - *p = '\0'; -#ifndef WIN32 - if (sargc < HACKVECSZ - 1) { - sargv[sargc++] = ws; - } - ws = NULL; -#else /* WIN32 */ - if (sargc < HACKVECSZ - 1) { - sargv[sargc] = first_word ? NULL : hb_subst(ws); - if (sargv[sargc] == NULL) { - sargv[sargc] = ws; - } - sargc++; - } - ws = NULL; - fw = 1; - first_word = 1; -#endif /* WIN32 */ - } - p++; - continue; - - case '\0': /* Whoa!! what the hell happened */ - return NULL; - - case '\n': /* The end of the line. */ - if ( -#ifdef WIN32 - fw || -#endif /* WIN32 */ - ws) { /* terminate the last word */ - *p = '\0'; -#ifndef WIN32 - if (sargc < HACKVECSZ - 1) { - sargv[sargc++] = ws; - } -#else /* WIN32 */ - if (sargc < HACKVECSZ - 1) { /* deal with the 1-word case */ - sargv[sargc] = first_word ? NULL : hb_subst(ws); - if (sargv[sargc] == NULL) { - sargv[sargc] = ws; - } - sargc++; - } -#endif /* !WIN32 */ - sargv[sargc] = NULL; - } - /* Count number of entries in the old argv vector */ - for (i = 0; argv[i] != NULL; ++i) { - continue; - } - ++i; - - newargv = (const char **) malloc((p - lbuf + 1) - + (i + sargc + 1) * sizeof(*newargv)); - if (newargv == NULL) { - return NULL; - } - ws = &((char *) newargv)[(i + sargc + 1) * sizeof(*newargv)]; - - /* Copy entries to allocated memory */ - for (j = 0; j < sargc; ++j) { - newargv[j] = strcpy(ws, sargv[j]); - ws += strlen(ws) + 1; /* skip trailing '\0' */ - } - newargv[sargc] = filename; - - /* Append the old array. The old argv[0] is skipped. */ - if (i > 1) { - memcpy(&newargv[sargc + 1], &argv[1], - (i - 1) * sizeof(*newargv)); - } - - newargv[sargc + i] = NULL; - - ws = NULL; - - return newargv; - - default: - if (!ws) { /* Start a new word? */ - ws = p; - } - p++; - break; - } - } - return NULL; -} -#else -extern void ap_execve_is_not_here(void); -void ap_execve_is_not_here(void) {} -#endif /* NEED_HASHBANG_EMUL */ From ef74642c584e9260ec9f14abfd6f0bf48f7bacc6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 21 Jul 2000 21:27:12 +0000 Subject: [PATCH 0428/7878] Tweak setting of APR_OFF_T_FMT for Solaris (pc, not sparc). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60403 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 6efc8856015..6f4f8247c4c 100644 --- a/configure.in +++ b/configure.in @@ -389,7 +389,7 @@ fi # don't get it right for your platform, you can override our decision # below. case "$OS" in - *linux* | *os2_emx) + *linux* | *os2_emx | *-pc-solaris*) off_t_fmt='#define APR_OFF_T_FMT "ld"' esac From e039bb619a2731eb5b99be1ba1e50a3fcccf82f7 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 21 Jul 2000 22:24:28 +0000 Subject: [PATCH 0429/7878] Fix a small memory leak in the buckets. Basically, an extra bucket was being created and never inserted into the list, so it was never destroyed. Submitted by: Cliff Woolley Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60404 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 29b223dc0d6..678410e8ea2 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -253,12 +253,12 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) } for (k = 0;;) { - r = ap_bucket_rwmem_create(); x = va_arg(va, const char *); if (x == NULL) break; j = strlen(x); + r = ap_bucket_rwmem_create(); rv = r->insert(r, x, j, &i); if (i != j) { /* Do we need better error reporting? */ From 2cf5c5d7bd45764955693f451e6de40dbb81c1ec Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 21 Jul 2000 22:25:25 +0000 Subject: [PATCH 0430/7878] Fix typo. Submitted by: Cliff Woolley Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60405 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_mmap_buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buckets/ap_mmap_buf.c b/buckets/ap_mmap_buf.c index 352347155b0..353f08e3a67 100644 --- a/buckets/ap_mmap_buf.c +++ b/buckets/ap_mmap_buf.c @@ -77,7 +77,7 @@ static ap_status_t mmap_bucket_insert(ap_bucket *e, const void *buf, ap_bucket_mmap *b = (ap_bucket_mmap *)e->data; ap_mmap_t *mm = (ap_mmap_t *)buf; - b->alloc_addr = mm->mm;; + b->alloc_addr = mm->mm; b->len = nbytes; *w = nbytes; return APR_SUCCESS; From f51571761a7e431d416364e5d69ebe07a3e4a3b4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 22 Jul 2000 20:06:19 +0000 Subject: [PATCH 0431/7878] Convert the dso docs to the ScanDoc format. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60406 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_dso.h | 55 +++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/include/apr_dso.h b/include/apr_dso.h index 562f9479f82..c55179d3853 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -58,6 +58,10 @@ #include "apr_general.h" #include "apr_errno.h" +/** + * @package dso + */ + #ifdef __cplusplus extern "C" { #endif @@ -65,48 +69,37 @@ extern "C" { typedef struct ap_dso_handle_t ap_dso_handle_t; typedef void * ap_dso_handle_sym_t; -/* - -=head1 ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, ap_pool_t *ctx) - -B - - arg 1) Location to store new handle for the DSO. - arg 2) Path to the DSO library - arg 3) Pool to use. - -=cut +/** + * Load a DSO library. + * @param res_handle Location to store new handle for the DSO. + * @param path Path to the DSO library + * @param ctx Pool to use. + * @keyword load DSO */ ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, ap_pool_t *ctx); -/* - -=head1 ap_status_t ap_dso_unload(ap_dso_handle_t *handle) - -B - - arg 1) handle to close. - -=cut +/** + * Close a DSO library. + * @param handle handle to close. */ ap_status_t ap_dso_unload(ap_dso_handle_t *handle); -/* - -=head1 ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, const char *symname) - -B - - arg 1) Location to store the loaded symbol - arg 2) handle to load from. - arg 3) Name of the symbol to load. - -=cut +/** + * Load a symbol from a DSO handle. + * @param dso Location to store the loaded symbol + * @param handle handle to load from. + * @param symname Name of the symbol to load. */ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, const char *symname); +/** + * Report more information when a DSO function fails. + * @param dso Location to store the loaded symbol + * @param buf handle to load from. + * @param bufsize Name of the symbol to load. + */ const char *ap_dso_error(ap_dso_handle_t *dso, char *buf, ap_size_t bufsize); #ifdef __cplusplus From 0f6d23671ab2bea8a5e330991ee21cbeacd03f9a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 22 Jul 2000 23:08:36 +0000 Subject: [PATCH 0432/7878] Commit the apr_errno.h changes to use ScanDoc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60407 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 117 +++++++++++++++++++++++--------------------- 1 file changed, 61 insertions(+), 56 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 954e4855fd3..e5512c6253f 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -52,59 +52,6 @@ * . */ -/* - -=head1 APR ERROR CODES - - APR_ENOSTAT APR was unable to perform a stat on the file - APR_ENOPOOL APR was not provided a pool with which to allocate memory - APR_EBADDATE APR was given an invalid date - APR_EINVALSOCK APR was given an invalid socket - APR_ENOFILE APR was not given a file structure - APR_ENOPROC APR was not given a process structure - APR_ENOTIME APR was not given a time structure - APR_ENODIR APR was not given a directory structure - APR_ENOLOCK APR was not given a lock structure - APR_ENOPOLL APR was not given a poll structure - APR_ENOSOCKET APR was not given a socket - APR_ENOTHREAD APR was nto given a thread structure - APR_ENOTHDKEY APR was not given a thread key structure - APR_ENOSHMAVAIL There is no more shared memory available - APR_EDSOOPEN APR was unable to open the dso object. For more - information consult ap_dso_error. - -=head1 APR STATUS CODES - - APR_INCHILD Program is currently executing in the child - APR_INPARENT Program is currently executing in the parent - APR_DETACH The thread is detached - APR_NOTDETACH The thread is not detached - APR_CHILD_DONE The child has finished executing - APR_CHILD_NOTDONE The child has not finished executing - APR_TIMEUP The operation did not finish before the timeout - APR_INCOMPLETE The character conversion stopped because of an - incomplete character or shift sequence at the end of - the input buffer. - APR_BADCH Getopt found an option not in the option string - APR_BADARG Getopt found an option that is missing an argument and - and argument was specified in the option string - APR_EOF APR has encountered the end of the file - APR_NOTFOUND APR was unable to find the socket in the poll structure - APR_ANONYMOUS APR is using anonymous shared memory - APR_FILEBASED APR is using a file name as the key to the shared memory - APR_KEYBASED APR is using a shared key as the key to the shared - memory - APR_EINIT Ininitalizer value. If no option has been found, but - the status variable requires a value, this should be - used - APR_ENOTIMPL The APR function has not been implemented on this - platform, either because nobody has gotten to it yet, - or the function is impossible on this platform. - APR_EMISMATCH Two passwords do not match. - -=cut - */ - #ifndef APR_ERRNO_H #define APR_ERRNO_H @@ -115,15 +62,23 @@ extern "C" { #endif /* __cplusplus */ +/** + * @package Error Codes + */ + typedef int ap_status_t; -/* see lib/apr/APRDesign for why this inane function needs to be used - * everywhere. +/** + * Convert an APR error to a canonical error + * @param err The APR error value + * @return The canonical error value + * @tip see apr/APRDesgin for an explanation of why this is necessary. */ int ap_canonical_error(ap_status_t err); -/* APR_OS_START_ERROR is where the APR specific error values should start. +/* + * APR_OS_START_ERROR is where the APR specific error values should start. * APR_OS_START_STATUS is where the APR specific status codes should start. * APR_OS_START_USEERR are reserved for applications that use APR that * layer their own error codes along with APR's. @@ -140,6 +95,56 @@ int ap_canonical_error(ap_status_t err); #define APR_SUCCESS 0 +/** + *
+ * APR ERROR VALUES
+ * APR_ENOSTAT      APR was unable to perform a stat on the file 
+ * APR_ENOPOOL      APR was not provided a pool with which to allocate memory
+ * APR_EBADDATE     APR was given an invalid date 
+ * APR_EINVALSOCK   APR was given an invalid socket
+ * APR_ENOFILE      APR was not given a file structure
+ * APR_ENOPROC      APR was not given a process structure
+ * APR_ENOTIME      APR was not given a time structure
+ * APR_ENODIR       APR was not given a directory structure
+ * APR_ENOLOCK      APR was not given a lock structure
+ * APR_ENOPOLL      APR was not given a poll structure
+ * APR_ENOSOCKET    APR was not given a socket
+ * APR_ENOTHREAD    APR was nto given a thread structure
+ * APR_ENOTHDKEY    APR was not given a thread key structure
+ * APR_ENOSHMAVAIL  There is no more shared memory available
+ * APR_EDSOOPEN     APR was unable to open the dso object.  For more 
+ *                  information call ap_dso_error().
+ * 
+ * + *
+ * APR STATUS VALUES
+ * APR_INCHILD        Program is currently executing in the child
+ * APR_INPARENT       Program is currently executing in the parent
+ * APR_DETACH         The thread is detached
+ * APR_NOTDETACH      The thread is not detached
+ * APR_CHILD_DONE     The child has finished executing
+ * APR_CHILD_NOTDONE  The child has not finished executing
+ * APR_TIMEUP         The operation did not finish before the timeout
+ * APR_INCOMPLETE     The character conversion stopped because of an 
+ *                    incomplete character or shift sequence at the end 
+ *                    of the input buffer.
+ * APR_BADCH          Getopt found an option not in the option string
+ * APR_BADARG         Getopt found an option that is missing an argument 
+ *                    and and argument was specified in the option string
+ * APR_EOF            APR has encountered the end of the file
+ * APR_NOTFOUND       APR was unable to find the socket in the poll structure
+ * APR_ANONYMOUS      APR is using anonymous shared memory
+ * APR_FILEBASED      APR is using a file name as the key to the shared memory
+ * APR_KEYBASED       APR is using a shared key as the key to the shared memory
+ * APR_EINIT          Ininitalizer value.  If no option has been found, but 
+ *                    the status variable requires a value, this should be used
+ * APR_ENOTIMPL       The APR function has not been implemented on this 
+ *                    platform, either because nobody has gotten to it yet, 
+ *                    or the function is impossible on this platform.
+ * APR_EMISMATCH      Two passwords do not match.
+ * 
+ */ + /* APR ERROR VALUES */ #define APR_ENOSTAT (APR_OS_START_ERROR + 1) #define APR_ENOPOOL (APR_OS_START_ERROR + 2) From 5b2aa21b47f335fa848df576c5c0b277bcdb0aa2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 22 Jul 2000 23:09:09 +0000 Subject: [PATCH 0433/7878] Change the name of the DSO heading. This is a bit more clear IMO. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60408 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_dso.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_dso.h b/include/apr_dso.h index c55179d3853..3f8e7b1c687 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -59,7 +59,7 @@ #include "apr_errno.h" /** - * @package dso + * @package Dynamic Object Handling */ #ifdef __cplusplus From c82a7eae4082bac2862db7e12b5dbc69b5963902 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 22 Jul 2000 23:29:44 +0000 Subject: [PATCH 0434/7878] Remove a keyword that isn't working properly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60409 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_dso.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/apr_dso.h b/include/apr_dso.h index 3f8e7b1c687..bcd333b968f 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -74,7 +74,6 @@ typedef void * ap_dso_handle_sym_t; * @param res_handle Location to store new handle for the DSO. * @param path Path to the DSO library * @param ctx Pool to use. - * @keyword load DSO */ ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, ap_pool_t *ctx); From cca77d099bdfc4c04bd0ee6faee966ff462de8c3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 04:05:15 +0000 Subject: [PATCH 0435/7878] Update apr_file_io.h's docs to ScanDoc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60410 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 795 +++++++++++++++--------------------------- 1 file changed, 278 insertions(+), 517 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 74c24cf437c..77a5c6bf4a4 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -66,6 +66,10 @@ extern "C" { #endif /* __cplusplus */ +/** + * @package APR File handling + */ + typedef enum {APR_NOFILE, APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, APR_LNK, APR_SOCK} ap_filetype_e; @@ -104,9 +108,9 @@ typedef enum {APR_NOFILE, APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, APR_LNK, /* should be same as whence type in lseek, POSIX defines this as int */ typedef ap_int32_t ap_seek_where_t; -typedef struct ap_file_t ap_file_t; +typedef struct ap_file_t ap_file_t; typedef struct ap_finfo_t ap_finfo_t; -typedef struct ap_dir_t ap_dir_t; +typedef struct ap_dir_t ap_dir_t; typedef ap_int32_t ap_fileperms_t; typedef uid_t ap_uid_t; typedef gid_t ap_gid_t; @@ -127,649 +131,406 @@ struct ap_finfo_t { }; /* Function definitions */ -/* - -=head1 ap_status_t ap_open(ap_file_t **new_file, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cont) - -B - - arg 1) The opened file descriptor. - arg 2) The full path to the file (using / on all systems) - arg 3) Or'ed value of: - APR_READ open for reading - APR_WRITE open for writing - APR_CREATE create the file if not there - APR_APPEND file ptr is set to end prior to all writes - APR_TRUNCATE set length to zero if file exists - APR_BINARY not a text file (This flag is ignored on - UNIX because it has no meaning) - APR_BUFFERED buffer the data. Default is non-buffered - APR_EXCL return error if APR_CREATE and file exists - APR_DELONCLOSE delete the file after closing. - arg 4) Access permissions for file. - arg 5) The pool to use. - -B: If perm is APR_OS_DEFAULT and the file is being created, appropriate - default permissions will be used. *arg1 must point to a valid file_t, - or NULL (in which case it will be allocated) - -=cut + +/** + * Open the specified file. + * @param new_file The opened file descriptor. + * @param fname The full path to the file (using / on all systems) + * @param flag Or'ed value of: + *
+ *           APR_READ             open for reading
+ *           APR_WRITE            open for writing
+ *           APR_CREATE           create the file if not there
+ *           APR_APPEND           file ptr is set to end prior to all writes
+ *           APR_TRUNCATE         set length to zero if file exists
+ *           APR_BINARY           not a text file (This flag is ignored on 
+ *                                UNIX because it has no meaning)
+ *           APR_BUFFERED         buffer the data.  Default is non-buffered
+ *           APR_EXCL             return error if APR_CREATE and file exists
+ *           APR_DELONCLOSE       delete the file after closing.
+ * 
+ * @param perm Access permissions for file. + * @param cont The pool to use. + * @tip If perm is APR_OS_DEFAULT and the file is being created, appropriate + * default permissions will be used. *arg1 must point to a valid file_t, + * or NULL (in which case it will be allocated) */ ap_status_t ap_open(ap_file_t **new_file, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_close(ap_file_t *file) - -B - - arg 1) The file descriptor to close. - -=cut +/** + * Close the specified file. + * @param file The file descriptor to close. */ ap_status_t ap_close(ap_file_t *file); -/* - -=head1 ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) - -B - - arg 1) The full path to the file (using / on all systems) - arg 2) The pool to use. - -B: If the file is open, it won't be removed until all instances are - closed. - -=cut +/** + * delete the specified file. + * @param path The full path to the file (using / on all systems) + * @param cont The pool to use. + * @tip If the file is open, it won't be removed until all instances are closed. */ ap_status_t ap_remove_file(const char *path, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_rename_file(const char *from_path, const char *to_path, - ap_pool_t *cont) - -B - - arg 1) The full path to the original file (using / on all systems) - arg 2) The full path to the new file (using / on all systems) - arg 3) The pool to use. - -B: If a file exists at the new location, then it will be overwritten. - Moving files or directories across devices may not be possible. - -=cut +/** + * rename the specified file. + * @param from_path The full path to the original file (using / on all systems) + * @param to_path The full path to the new file (using / on all systems) + * @param pool The pool to use. + * @tip If a file exists at the new location, then it will be overwritten. + * Moving files or directories across devices may not be possible. */ ap_status_t ap_rename_file(const char *from_path, const char *to_path, ap_pool_t *pool); -/* - -=head1 ap_status_t ap_eof(ap_file_t *fptr) - -B - - arg 1) The apr file we are testing. - -B: Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise. - -=cut +/** + * Are we at the end of the file + * @param fptr The apr file we are testing. + * @tip Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise. */ ap_status_t ap_eof(ap_file_t *fptr); -/* - -=head1 ap_status_t ap_ferror(ap_file_t *fptr) - -B - - arg 1) The apr file we are testing. - -B: Returns -1 if the error indicator is set, APR_SUCCESS otherwise. - -=cut +/** + * Is there an error on the stream? + * @param fptr The apr file we are testing. + * @tip Returns -1 if the error indicator is set, APR_SUCCESS otherwise. */ ap_status_t ap_ferror(ap_file_t *fptr); -/* - -=head1 ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont) - -B - - arg 1) The apr file to use as stderr. - arg 2) The pool to allocate the file out of. - -=cut +/** + * open standard error as an apr file pointer. + * @param thefile The apr file to use as stderr. + * @param cont The pool to allocate the file out of. */ ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) - -B - - arg 1) The file descriptor to read from. - arg 2) The buffer to store the data to. - arg 3) On entry, the number of bytes to read; on exit, the number - of bytes read. - -B: ap_read will read up to the specified number of bytes, but never - more. If there isn't enough data to fill that number of bytes, all of - the available data is read. The third argument is modified to reflect the - number of bytes read. If a char was put back into the stream via - ungetc, it will be the first character returned. - - It is possible for both bytes to be read and an APR_EOF or other error - to be returned. - - APR_EINTR is never returned. - -=cut +/** + * Read data from the specified file. + * @param thefile The file descriptor to read from. + * @param buf The buffer to store the data to. + * @param nbytes On entry, the number of bytes to read; on exit, the number of bytes read. + * @tip ap_read will read up to the specified number of bytes, but never + * more. If there isn't enough data to fill that number of bytes, all + * of the available data is read. The third argument is modified to + * reflect the number of bytes read. If a char was put back into the + * stream via ungetc, it will be the first character returned. + * + * It is possible for both bytes to be read and an APR_EOF or other + * error to be returned. + * + * APR_EINTR is never returned. */ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes); -/* - -=head1 ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) - -B - - arg 1) The file descriptor to write to. - arg 2) The buffer which contains the data. - arg 3) On entry, the number of bytes to write; on exit, the number - of bytes written. - -B: ap_write will write up to the specified number of bytes, but never - more. If the OS cannot write that many bytes, it will write as many as it - can. The third argument is modified to reflect the * number of bytes - written. - - It is possible for both bytes to be written and an error to be - returned. - - APR_EINTR is never returned. - -=cut +/** + * Write data to the specified file. + * @param thefile The file descriptor to write to. + * @param buf The buffer which contains the data. + * @param nbytes On entry, the number of bytes to write; on exit, the number of bytes written. + * @tip ap_write will write up to the specified number of bytes, but never + * more. If the OS cannot write that many bytes, it will write as many + * as it can. The third argument is modified to reflect the * number + * of bytes written. + * + * It is possible for both bytes to be written and an error to be returned. + * + * APR_EINTR is never returned. */ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes); -/* - -=head1 ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nvec, ap_ssize_t *nbytes) - -B - - arg 1) The file descriptor to write to. - arg 2) The array from which to get the data to write to the file. - arg 3) The number of elements in the struct iovec array. This must be - smaller than AP_MAX_IOVEC_SIZE. If it isn't, the function will - fail with APR_EINVAL. - arg 4) The number of bytes written. - - It is possible for both bytes to be written and an error to be - returned. - - APR_EINTR is never returned. - - ap_writev is available even if the underlying operating system - doesn't provide writev(). - -=cut +/** + * Write data from iovec array to the specified file. + * @param thefile The file descriptor to write to. + * @param vec The array from which to get the data to write to the file. + * @param nvec The number of elements in the struct iovec array. This must + * be smaller than AP_MAX_IOVEC_SIZE. If it isn't, the function + * will fail with APR_EINVAL. + * @param nbytes The number of bytes written. + * @tip It is possible for both bytes to be written and an error to be returned. + * APR_EINTR is never returned. + * + * ap_writev is available even if the underlying operating system + * + * doesn't provide writev(). */ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nvec, ap_ssize_t *nbytes); -/* - -=head1 ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes, ap_size_t *bytes_read) - -B - - arg 1) The file descriptor to read from. - arg 2) The buffer to store the data to. - arg 3) The number of bytes to read. - arg 4) If non-NULL, this will contain the number of bytes read. - -B: ap_read will read up to the specified number of bytes, but never - more. If there isn't enough data to fill that number of bytes, then the - process/thread will block until it is available or EOF is reached. If a - char was put back into the stream via ungetc, it will be the first - character returned. - - It is possible for both bytes to be read and an APR_EOF or other error - to be returned. - - APR_EINTR is never returned. - -=cut +/** + * Read data from the specified file. + * @param thefile The file descriptor to read from. + * @param buf The buffer to store the data to. + * @param nbytes The number of bytes to read. + * @param bytes_read If non-NULL, this will contain the number of bytes read. + * @tip ap_read will read up to the specified number of bytes, but never + * more. If there isn't enough data to fill that number of bytes, + * then the process/thread will block until it is available or EOF + * is reached. If a char was put back into the stream via ungetc, + * it will be the first character returned. + * + * It is possible for both bytes to be read and an APR_EOF or other + * error to be returned. + * + * APR_EINTR is never returned. */ ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes, ap_size_t *bytes_read); -/* - -=head1 ap_status_t ap_full_write(ap_file_t *thefile, const void *buf, ap_size_t nbytes, ap_size_t *bytes_written) - -B - - arg 1) The file descriptor to write to. - arg 2) The buffer which contains the data. - arg 3) The number of bytes to write. - arg 4) If non-NULL, this will contain the number of bytes written. - -B: ap_write will write up to the specified number of bytes, but never - more. If the OS cannot write that many bytes, the process/thread will - block until they can be written. Exceptional error such as "out of space" - or "pipe closed" will terminate with an error. - - It is possible for both bytes to be written and an error to be returned. - - APR_EINTR is never returned. - -=cut +/** + * Write data to the specified file. + * @param thefile The file descriptor to write to. + * @param buf The buffer which contains the data. + * @param nbytes The number of bytes to write. + * @param bytes_written If non-NULL, this will contain the number of bytes written. + * @tip ap_write will write up to the specified number of bytes, but never + * more. If the OS cannot write that many bytes, the process/thread + * will block until they can be written. Exceptional error such as + * "out of space" or "pipe closed" will terminate with an error. + * + * It is possible for both bytes to be written and an error to be returned. + * + * APR_EINTR is never returned. */ ap_status_t ap_full_write(ap_file_t *thefile, const void *buf, ap_size_t nbytes, ap_size_t *bytes_written); -/* - -=head1 ap_status_t ap_putc(char ch, ap_file_t *thefile) - -B - - arg 1) The character to write. - arg 2) The file descriptor to write to - -=cut +/** + * put a character into the specified file. + * @param ch The character to write. + * @param thefile The file descriptor to write to */ ap_status_t ap_putc(char ch, ap_file_t *thefile); -/* - -=head1 ap_status_t ap_getc(char *ch, ap_file_t *thefil) - -B - - arg 1) The character to write. - arg 2) The file descriptor to write to - -=cut +/** + * get a character from the specified file. + * @param ch The character to write. + * @param thefile The file descriptor to write to */ ap_status_t ap_getc(char *ch, ap_file_t *thefile); -/* - -=head1 ap_status_t ap_ungetc(char ch, ap_file_t *thefile) - -B - - arg 1) The character to write. - arg 2) The file descriptor to write to - -=cut +/** + * put a character back onto a specified stream. + * @param ch The character to write. + * @param thefile The file descriptor to write to */ ap_status_t ap_ungetc(char ch, ap_file_t *thefile); -/* - -=head1 ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) - -B - - arg 1) The buffer to store the string in. - arg 2) The length of the string - arg 3) The file descriptor to read from - -=cut +/** + * Get a string from a specified file. + * @param str The buffer to store the string in. + * @param len The length of the string + * @param thefile The file descriptor to read from */ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile); -/* - -=head1 ap_status_t ap_puts(const char *str, ap_file_t *thefile) - -B - - arg 1) The string to write. - arg 2) The file descriptor to write to - -=cut +/** + * Put the string into a specified file. + * @param str The string to write. + * @param thefile The file descriptor to write to */ ap_status_t ap_puts(const char *str, ap_file_t *thefile); -/* - -=head1 ap_status_t ap_flush(ap_file_t *thefile) - -B - - arg 1) The file descriptor to flush - -=cut +/** + * Flush the file's buffer. + * @param thefile The file descriptor to flush */ ap_status_t ap_flush(ap_file_t *thefile); -APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) - __attribute__((format(printf,2,3))); - -/* - -=head1 ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) - -B - - arg 1) The structure to duplicate into. - arg 2) The file to duplicate. - arg 3) The pool to use for the new file. - -B: *arg1 must point to a valid ap_file_t, or point to NULL -=cut +/** + * duplicate the specified file descriptor. + * @param new_file The structure to duplicate into. + * @param old_file The file to duplicate. + * @param p The pool to use for the new file. + * @tip *arg1 must point to a valid ap_file_t, or point to NULL */ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p); -/* - -=head1 ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) - -B - - arg 1) Where to store the information about the file. - arg 2) The file to get information about. - -=cut +/** + * get the specified file's stats. + * @param finfo Where to store the information about the file. + * @param thefile The file to get information about. */ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile); -/* - -=head1 ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms) - -B - - arg 1) The file (name) to apply the permissions to. - arg 2) The permission bits to apply to the file. - - Some platforms may not be able to apply all of the available permission - bits; APR_INCOMPLETE will be returned if some permissions are specified - which could not be set. - - Platforms which do not implement this feature will return APR_ENOTIMPL. -=cut +/** + * set the specified file's permission bits. + * @param fname The file (name) to apply the permissions to. + * @param perms The permission bits to apply to the file. + * @tip Some platforms may not be able to apply all of the available + * permission bits; APR_INCOMPLETE will be returned if some permissions + * are specified which could not be set. + * + * Platforms which do not implement this feature will return APR_ENOTIMPL. */ ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms); -/* - -=head1 ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) - -B - - arg 1) Where to store the information about the file. - arg 2) The name of the file to stat. - arg 3) the pool to use to allocate the new file. - -=cut +/** + * get the specified file's stats. The file is specified by filename, + * instead of using a pre-opened file. + * @param finfo Where to store the information about the file. + * @param fname The name of the file to stat. + * @param cont the pool to use to allocate the new file. */ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_lstat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) - -B - - arg 1) Where to store the information about the file. - arg 2) The name of the file to stat. - arg 3) the pool to use to allocate the new file. - -=cut +/** + * get the specified file's stats. The file is specified by filename, + * instead of using a pre-opened file. If the file is a symlink, this function + * will get the stats for the symlink not the file the symlink refers to. + * @param finfo Where to store the information about the file. + * @param fname The name of the file to stat. + * @param cont the pool to use to allocate the new file. */ ap_status_t ap_lstat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) - -B - - arg 1) The file descriptor - arg 2) How to move the pointer, one of: - APR_SET -- set the offset to offset - APR_CUR -- add the offset to the current position - APR_END -- add the offset to the current file size - arg 3) The offset to move the pointer to. - -B: The third argument is modified to be the offset the pointer +/** + * Move the read/write file offset to a specified byte within a file. + * @param thefile The file descriptor + * @param where How to move the pointer, one of: + *
+ *            APR_SET  --  set the offset to offset
+ *            APR_CUR  --  add the offset to the current position 
+ *            APR_END  --  add the offset to the current file size 
+ * @param offset The offset to move the pointer to.
+ * @tip The third argument is modified to be the offset the pointer
           was actually moved to.
-
-=cut
  */
 ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where,ap_off_t *offset);
 
-/*
-
-=head1 ap_status_t ap_opendir(ap_dir_t **new_dir, const char *dirname, ap_pool_t *cont)
-
-B
-
-    arg 1) The opened directory descriptor.
-    arg 2) The full path to the directory (use / on all systems)
-    arg 3) The pool to use.
-
-=cut
+/**
+ * Open the specified directory.
+ * @param new_dir The opened directory descriptor.
+ * @param dirname The full path to the directory (use / on all systems)
+ * @param cont The pool to use.
  */                        
 ap_status_t ap_opendir(ap_dir_t **new_dir, const char *dirname, ap_pool_t *cont);
 
-/*
-
-=head1 ap_status_t ap_closedir(ap_dir_t *thedir)
-
-B 
-
-    arg 1) the directory descriptor to close.
-
-=cut
+/**
+ * close the specified directory. 
+ * @param thedir the directory descriptor to close.
  */                        
 ap_status_t ap_closedir(ap_dir_t *thedir);
 
-/*
-
-=head1 ap_status_t ap_readdir(ap_dir_t *thedir)
-
-B 
-
-    arg 1) the directory descriptor to read from, and fill out.
-
-B: All systems return . and .. as the first two files.
-
-=cut
+/**
+ * Read the next entry from the specified directory. 
+ * @param thedir the directory descriptor to read from, and fill out.
+ * @tip All systems return . and .. as the first two files.
  */                        
 ap_status_t ap_readdir(ap_dir_t *thedir);
 
-/*
-
-=head1 ap_status_t ap_rewinddir(ap_dir_t *thedir)
-
-B
-
-     arg 1) the directory descriptor to rewind.
-
-=cut
+/**
+ * Rewind the directory to the first entry.
+ * @param thedir the directory descriptor to rewind.
  */                        
 ap_status_t ap_rewinddir(ap_dir_t *thedir);
 
-/*
-
-=head1 ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, ap_pool_t *cont)
-
-B
-
-    arg 1) the path for the directory to be created.  (use / on all systems)
-    arg 2) Permissions for the new direcoty.
-    arg 3) the pool to use.
-
-=cut
+/**
+ * Create a new directory on the file system.
+ * @param path the path for the directory to be created.  (use / on all systems)
+ * @param perm Permissions for the new direcoty.
+ * @param cont the pool to use.
  */                        
 ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, 
                         ap_pool_t *cont);
 
-/*
-
-=head1 ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont)
-
-B
-
-    arg 1) the path for the directory to be removed.  (use / on all systems)
-    arg 2) the pool to use.
-
-=cut
+/**
+ * Remove directory from the file system.
+ * @param path the path for the directory to be removed.  (use / on all systems)
+ * @param cont the pool to use.
  */                        
 ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont);
 
-/*
-
-=head1 ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont)
-
-B
-
-    arg 1) The file descriptor to use as input to the pipe.
-    arg 2) The file descriptor to use as output from the pipe.
-    arg 3) The pool to operate on.
-
-=cut
+/**
+ * Create an anonymous pipe.
+ * @param in The file descriptor to use as input to the pipe.
+ * @param out The file descriptor to use as output from the pipe.
+ * @param cont The pool to operate on.
  */
 ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont);
 
-/*
-
-=head1 ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, ap_pool_t *cont)
-
-B
-
-    arg 1) The filename of the named pipe
-    arg 2) The permissions for the newly created pipe.
-    arg 3) The pool to operate on.
-
-=cut
+/**
+ * Create a named pipe.
+ * @param filename The filename of the named pipe
+ * @param perm The permissions for the newly created pipe.
+ * @param cont The pool to operate on.
  */
 ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, 
                                 ap_pool_t *cont);
 
-/*
-
-=head1 ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout)
-
-B
-
-    arg 1) The pipe we are setting a timeout on.
-    arg 2) The timeout value in microseconds.  Values < 0 mean wait forever, 0
-           means do not wait at all.
-
-=cut
+/**
+ * Set the timeout value for a pipe or manipulate the blocking state.
+ * @param thepipe The pipe we are setting a timeout on.
+ * @param timeoutThe timeout value in microseconds.  Values < 0 mean wait 
+ *        forever, 0 means do not wait at all.
  */
 ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout);
 
-/*accessor and general file_io functions. */
+/**accessor and general file_io functions. */
 
-/*
-
-=head1 ap_status_t ap_get_filename(char **new_path, ap_file_t *thefile)
-
-B
-
-    arg 1) The path of the file.  
-    arg 2) The currently open file.
-
-=cut
+/**
+ * return the file name of the current file.
+ * @param new_path The path of the file.  
+ * @param thefile The currently open file.
  */                     
 ap_status_t ap_get_filename(char **new_path, ap_file_t *thefile);
 
-/*
-
-=head1 ap_status_t ap_get_dir_filename(char **new_path, ap_dir_t *thedir) 
-
-B
-
-    arg 1) the file name of the directory entry. 
-    arg 2) the currently open directory.
-
-=cut
+/**
+ * Get the file name of the current directory entry.
+ * @param new_path the file name of the directory entry. 
+ * @param thedir the currently open directory.
  */                        
 ap_status_t ap_get_dir_filename(char **new_path, ap_dir_t *thedir);
 
-/*
-
-=head1 ap_status_t ap_get_filedata(void **data, const char *key, ap_file_t *file)
-
-B
-
-    arg 1) The user data associated with the file.  
-    arg 2) The key to use for retreiving data associated with this file.
-    arg 3) The currently open file.
-
-=cut
+/**
+ * Return the data associated with the current file.
+ * @param data The user data associated with the file.  
+ * @param key The key to use for retreiving data associated with this file.
+ * @param file The currently open file.
  */                     
 ap_status_t ap_get_filedata(void **data, const char *key, ap_file_t *file);
 
-/*
-
-=head1 ap_status_t ap_set_filedata(ap_file_t *file, void *data, const char *key, ap_status_t (*cleanup) (void *))
-
-B
-
-    arg 1) The currently open file.
-    arg 2) The user data to associate with the file.  
-    arg 3) The key to use for assocaiteing data with the file.
-    arg 4) The cleanup routine to use when the file is destroyed.
-
-=cut
+/**
+ * Set the data associated with the current file.
+ * @param file The currently open file.
+ * @param data The user data to associate with the file.  
+ * @param key The key to use for assocaiteing data with the file.
+ * @param cleanup The cleanup routine to use when the file is destroyed.
  */                     
 ap_status_t ap_set_filedata(ap_file_t *file, void *data, const char *key,
                             ap_status_t (*cleanup) (void *));
 
-/*
-
-=head1 ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir)
-
-B
-
-    arg 1) the size of the directory entry. 
-    arg 2) the currently open directory.
-
-=cut
+/**
+ * Get the size of the current directory entry.
+ * @param size the size of the directory entry. 
+ * @param thedir the currently open directory.
  */                        
 ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir);
 
-/*
-
-=head1 ap_status_t ap_dir_entry_mtime(ap_time_t *mtime, ap_dir_t *thedir)
-
-B
-
-    arg 1) the last modified time of the directory entry. 
-    arg 2) the currently open directory.
-
-=cut
- */                        
+/**
+ * Get the last modified time of the current directory entry.
+ * @param mtime the last modified time of the directory entry. 
+ * @param thedir the currently open directory.
+ */ 
 ap_status_t ap_dir_entry_mtime(ap_time_t *mtime, ap_dir_t *thedir);
 
-/*
-
-=head1 ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir)
-
-B
-
-    arg 1) the file type of the directory entry. 
-    arg 2) the currently open directory.
-
-=cut
- */                        
+/**
+ * Get the file type of the current directory entry.
+ * @param type the file type of the directory entry. 
+ * @param thedir the currently open directory.
+ */
 ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir);
 
+/**
+ * Write a string to a file using a printf format.
+ * @param fptr The file to write to.
+ * @param format The format string
+ * @param ... The values to substitute in the format string
+ * @return The number of bytes written
+ * @deffunc int ap_fprintf(ap_file_t *fptr, const char *format, ...)
+ */ 
+APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...)
+        __attribute__((format(printf,2,3)));
+
 #ifdef __cplusplus
 }
 #endif

From 7db33ca7016f9c940417413bd645857476ba2d78 Mon Sep 17 00:00:00 2001
From: Ryan Bloom 
Date: Sun, 23 Jul 2000 04:15:05 +0000
Subject: [PATCH 0436/7878] Update the apr_fnmatch.c docs to use ScanDoc.

git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60411 13f79535-47bb-0310-9956-ffa450edef68
---
 include/apr_fnmatch.h | 45 ++++++++++++++++++++-----------------------
 1 file changed, 21 insertions(+), 24 deletions(-)

diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h
index beb99c7a3c0..b04e679cfa8 100644
--- a/include/apr_fnmatch.h
+++ b/include/apr_fnmatch.h
@@ -43,6 +43,10 @@
 extern "C" {
 #endif
 
+/**
+ * @package Fnmatch functions 
+ */
+
 #define	FNM_NOMATCH	1	/* Match failed. */
 
 #define	FNM_NOESCAPE	0x01	/* Disable backslash escaping. */
@@ -51,35 +55,28 @@ extern "C" {
 /* This flag is an Apache addition */
 #define FNM_CASE_BLIND  0x08    /* Compare characters case-insensitively. */
 
-/*
-
-=head1 ap_status_t ap_fnmatch(const char *pattern, const char *strings, int flags)
-
-B
-
-    arg 1) The pattern to match to
-    arg 2) The string we are trying to match
-    arg 3) flags to use in the match.  Bitwise OR of:
-                FNM_NOESCAPE   --  Disable backslash escaping
-                FNM_PATHNAME   --  Slash must be matched by slash
-                FNM_PERIOD     --  Period must be matched by period
-                FNM_CASE_BLIND --  Compare characters case-insensitively.
-
-=cut
+/**
+ * Try to match the string to the given pattern.
+ * @param pattern The pattern to match to
+ * @param strings The string we are trying to match
+ * @param flags flags to use in the match.  Bitwise OR of:
+ * 
+ *              FNM_NOESCAPE   --  Disable backslash escaping
+ *              FNM_PATHNAME   --  Slash must be matched by slash
+ *              FNM_PERIOD     --  Period must be matched by period
+ *              FNM_CASE_BLIND --  Compare characters case-insensitively.
+ * 
+ * @deffunc ap_status_t ap_fnmatch(const char *pattern, const char *strings, int flags) */ APR_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *strings, int flags); -/* - -=head1 ap_status_t ap_is_fnmatch(const char *pattern) - -B - - arg 1) The pattern to search for glob characters. - -=cut +/** + * Determine if the given pattern is a regular expression. + * @param pattern The pattern to search for glob characters. + * @return non-zero if pattern has any glob characters in it + * @deffunc int ap_is_fnmatch(const char *pattern) */ APR_EXPORT(int) ap_is_fnmatch(const char *pattern); From 96c94bb41a8fad741b8a07ec4db7ab24d4982f05 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 04:34:44 +0000 Subject: [PATCH 0437/7878] Update apr_general.h's docs to use ScanDoc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60412 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 164 ++++++++++++++---------------------------- 1 file changed, 55 insertions(+), 109 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index 1af22b9874a..944e1bc83ce 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -242,17 +242,15 @@ int strncasecmp(const char *a, const char *b, size_t n); #define bzero(a,b) memset(a,0,b) #endif -#if APR_HAS_RANDOM -/* - -=head1 ap_status_t ap_generate_random_bytes(unsigned char * buf, int length) - -B - - arg 1) Random bytes go here - arg 2) size of the buffer +/** + * package APR Random Functions + */ -=cut +#if APR_HAS_RANDOM +/** + * Generate a string of random bytes. + * @param buf Random bytes go here + * @param length size of the buffer */ /* TODO: I'm not sure this is the best place to put this prototype...*/ ap_status_t ap_generate_random_bytes(unsigned char * buf, int length); @@ -295,126 +293,74 @@ typedef struct ap_pool_t { }ap_pool_t; /* pool functions */ -/* - -=head1 ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont) - -B - arg 1) The pool we have just created. - arg 2) The parent pool. If this is NULL, the new pool is a root - pool. If it is non-NULL, the new pool will inherit all - of it's parent pool's attributes, except the ap_pool_t will - be a sub-pool. - -=cut +/** + * Create a new pool. + * @param newcont The pool we have just created. + * @param cont The parent pool. If this is NULL, the new pool is a root + * pool. If it is non-NULL, the new pool will inherit all + * of it's parent pool's attributes, except the ap_pool_t will + * be a sub-pool. */ ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_destroy_pool(ap_pool_t *cont) - -B - - arg 1) The pool to free. - -=cut - */ - -ap_status_t ap_exit(ap_pool_t *); - -/* - -=head1 ap_status_t ap_set_userdata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_pool_t *cont) - -B. - - arg 1) The user data associated with the pool. - arg 2) The key to use for association - arg 3) The cleanup program to use to cleanup the data; - arg 4) The current pool. - -B: The data to be attached to the pool should have the same - life span as the pool it is being attached to. - - Users of APR must take EXTREME care when choosing a key to - use for their data. It is possible to accidentally overwrite - data by choosing a key that another part of the program is using - It is advised that steps are taken to ensure that a unique - key is used at all times. - -=cut +/** + * Set the data associated with the current pool + * @param data The user data associated with the pool. + * @param key The key to use for association + * @param cleanup The cleanup program to use to cleanup the data; + * @param cont The current pool. + * @tip The data to be attached to the pool should have the same + * life span as the pool it is being attached to. + * + * Users of APR must take EXTREME care when choosing a key to + * use for their data. It is possible to accidentally overwrite + * data by choosing a key that another part of the program is using + * It is advised that steps are taken to ensure that a unique + * key is used at all times. */ ap_status_t ap_set_userdata(const void *data, const char *key, ap_status_t (*cleanup) (void *), ap_pool_t *cont); -/* - -=head1 ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont) - -B - - arg 1) The key for the data to retrieve - arg 2) The user data associated with the pool. - arg 3) The current pool. - -=cut +/** + * Return the data associated with the current pool. + * @param data The key for the data to retrieve + * @param key The user data associated with the pool. + * @param cont The current pool. */ ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_initialize(void) - -B - -=cut +/** + * Setup any APR internal data structures. This MUST be the first function + * called for any APR program. */ ap_status_t ap_initialize(void); -/* - -=head1 void ap_terminate(void) - -B - -B: An APR program must call this function at termination once it - has stopped using APR services. - -=cut +/** + * Tear down any APR internal data structures which aren't torn down + * automatically. + * @tip An APR program must call this function at termination once it + * has stopped using APR services. */ void ap_terminate(void); -/* - -=head1 ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_pool_t *cont) - -B - -B: This is in for backwards compatability. If the program using - APR wants APR to exit on a memory allocation error, then this - function should be called to set the function to use in order - to actually exit the program. If this function is not called, - then APR will return an error and expect the calling program to - deal with the error accordingly. - -=cut +/** + * Set the APR_ABORT function. + * @tip This is in for backwards compatability. If the program using + * APR wants APR to exit on a memory allocation error, then this + * function should be called to set the function to use in order + * to actually exit the program. If this function is not called, + * then APR will return an error and expect the calling program to + * deal with the error accordingly. */ ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_pool_t *cont); -/* - -=head1 char *ap_strerror(ap_status_t statcode, char *buf, ap_size_t bufsize) - -B - - arg 1) The error code the get a string for. - arg 2) A buffer to hold the error string. - arg 3) Size of the buffer to hold the string. - -=cut +/** + * Return a human readable string describing the specified error. + * @param statcode The error code the get a string for. + * @param buf A buffer to hold the error string. + * @param bufsize Size of the buffer to hold the string. */ char *ap_strerror(ap_status_t statcode, char *buf, ap_size_t bufsize); From 50defeb861a64ac8589c344a6a6a0bc5b36d9ad8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 04:41:27 +0000 Subject: [PATCH 0438/7878] Update apr_getopt.h's documentation to use ScanDoc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60413 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 617f469c535..a3e5b2c68b3 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -63,29 +63,24 @@ APR_VAR_IMPORT int APR_VAR_IMPORT char * ap_optarg; /* argument associated with option */ -/* - -=head1 ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap_int32_t *rv, ap_pool_t *cont) - -B - - arg 1) The number of arguments passed to ap_getopt to parse - arg 2) The array of command line options to parse - arg 3) A string of characters that are acceptable options to the program. - characters followed by ":" are required to have an option - associated - arg 4) The next option found. There are four potential values for - this variable on exit. They are: - APR_EOF -- No more options to parse - APR_BADCH -- Found a bad option character - APR_BADARG -- Missing parameter for the found option - Other -- The next option found. - arg 5) The pool to operate on. - -B: Arguments 2 and 3 are most commonly argc and argv from - main(argc, argv) - -=cut +/** + * Parse the command line options passed to the program. + * @param nargc The number of arguments passed to ap_getopt to parse + * @param nargv The array of command line options to parse + * @param ostr A string of characters that are acceptable options to the + * program. Characters followed by ":" are required to have an + * option associated + * @param rv The next option found. There are four potential values for + * this variable on exit. They are: + *
+ *             APR_EOF    --  No more options to parse
+ *             APR_BADCH  --  Found a bad option character
+ *             APR_BADARG --  Missing @parameter for the found option
+ *             Other      --  The next option found.
+ * 
+ * @param cont The pool to operate on. + * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) + * @deffunc ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap_int32_t *rv, ap_pool_t *cont) */ APR_EXPORT(ap_status_t) ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap_int32_t *rv, From d8bfe02abaf72bca02a72c73a9442153d4313f83 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 04:52:59 +0000 Subject: [PATCH 0439/7878] Update apr_hash.h's docs to use ScanDoc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60414 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 174 +++++++++++++++++---------------------------- 1 file changed, 65 insertions(+), 109 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index 5172fd830bf..44fcb6e4763 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -63,8 +63,11 @@ extern "C" { #endif -#include "apr_pools.h" +/** + * package Hash Tables + */ +#include "apr_pools.h" /* * Abstract type for hash tables. @@ -76,127 +79,80 @@ typedef struct ap_hash_t ap_hash_t; */ typedef struct ap_hash_index_t ap_hash_index_t; -/* - -=head1 ap_hash_t *ap_make_hash(ap_pool_t *pool) - -B - -=cut -*/ +/** + * Create a hash table within a pool. + * @param pool The pool to allocate the hash table out of + * @return The hash table just created + */ ap_hash_t *ap_make_hash(ap_pool_t *pool); -/* - -=head1 void ap_hash_set(ap_hash_t *ht, const void *key, size_t klen, - const void *val) - -B - - arg 1) The hash table - arg 2) Pointer to the key - arg 3) Length of the key - If the length is 0 it is assumed to be strlen(key)+1 - arg 4) Value to associate with the key - -If the value is NULL the hash entry is deleted. - -=cut -*/ +/** + * Associate a value with a key in a hash table. + * @param ht The hash table + * @param key Pointer to the key + * @param klen Length of the key + * If the length is 0 it is assumed to be strlen(key)+1 + * @param val Value to associate with the key + * @tip If the value is NULL the hash entry is deleted. + */ void ap_hash_set(ap_hash_t *ht, const void *key, size_t klen, const void *val); -/* - -=head1 void *ap_hash_get(ap_hash_t *ht, const void *key, size_t klen) - -B - - arg 1) The hash table - arg 2) Pointer to the key - arg 3) Length of the key - If the length is 0 it is assumed to be strlen(key)+1 - -Returns NULL if the key is not present. - -=cut -*/ +/** + * Look up the value associated with a key in a hash table. + * @param ht The hash table + * @param key Pointer to the key + * @param klen Length of the key + * If the length is 0 it is assumed to be strlen(key)+1 + * @return Returns NULL if the key is not present. + */ void *ap_hash_get(ap_hash_t *ht, const void *key, size_t klen); -/* - -=head1 ap_hash_index_t *ap_hash_first(ap_hash_t *ht) - -B - - arg 1) The hash table - -Returns a pointer to the iteration state, or NULL if there are no -entries. - -=cut -*/ +/** + * Start iterating over the entries in a hash table. + * @param ht The hash table + * @return a pointer to the iteration state, or NULL if there are no entries. + * @tip Example: + *
+ * 
+ *     int sum_values(ap_hash_t *ht)
+ *     {
+ *         ap_hash_index_t *hi;
+ * 	   void *val;
+ * 	   int sum = 0;
+ * 	   for (hi = ap_hash_first(ht); hi; hi = ap_hash_next(hi)) {
+ * 	       ap_hash_this(hi, NULL, NULL, &val);
+ * 	       sum += *(int *)val;
+ * 	   }
+ * 	   return sum;
+ *     }
+ * 
+ * There is no restriction on adding or deleting hash entries during an
+ * iteration (although the results may be unpredictable unless all you do
+ * is delete the current entry) and multiple iterations can be in
+ * progress at the same time.
+ * 
+ */ ap_hash_index_t *ap_hash_first(ap_hash_t *ht); -/* - -=head1 ap_hash_index_t *ap_hash_next(ap_hash_index_t *hi) - -B - - arg 1) The iteration state - -Returns a pointer to the updated iteration state, or NULL if there are -no more entries. - -*/ +/** + * Continue iterating over the entries in a hash table. + * @param hi The iteration state + * @return a pointer to the updated iteration state. NULL if there are no more * entries. + */ ap_hash_index_t *ap_hash_next(ap_hash_index_t *hi); -/* - -=head1 void ap_hash_this(ap_hash_index_t *hi, const void **key, size_t *klen, - void **val) - -B - - arg 1) The iteration state - arg 2) Return pointer for the pointer to the key. - arg 3) Return pointer for the key length. - arg 4) Return pointer for the associated value. - -The return pointers should point to a variable that will be set to the -corresponding data, or they may be NULL if the data isn't interesting. - -=cut -*/ +/** + * Get the current entry's details from the iteration state. + * @param hi The iteration state + * @param key Return pointer for the pointer to the key. + * @param klen Return pointer for the key length. + * @param val Return pointer for the associated value. + * @tip The return pointers should point to a variable that will be set to the + * corresponding data, or they may be NULL if the data isn't interesting. + */ void ap_hash_this(ap_hash_index_t *hi, const void **key, size_t *klen, void **val); -/* - -=head2 Using the iteration functions - -Example: - - int sum_values(ap_hash_t *ht) - { - ap_hash_index_t *hi; - void *val; - int sum = 0; - for (hi = ap_hash_first(ht); hi; hi = ap_hash_next(hi)) { - ap_hash_this(hi, NULL, NULL, &val); - sum += *(int *)val; - } - return sum; - } - -There is no restriction on adding or deleting hash entries during an -iteration (although the results may be unpredictable unless all you do -is delete the current entry) and multiple iterations can be in -progress at the same time. - -=cut -*/ - #ifdef __cplusplus } #endif From a6ab0a9f4f64b6a8c669fbeef56ccb3304a508de Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 05:43:35 +0000 Subject: [PATCH 0440/7878] Change some function pointer names to reflect what they do better. And, add some docs about what the bucket brigades do and how they are used. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60415 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 8 +++--- buckets/ap_eos_buf.c | 4 +-- buckets/ap_mmap_buf.c | 4 +-- buckets/ap_rmem_buf.c | 4 +-- buckets/ap_rwmem_buf.c | 4 +-- buckets/apr_buf.h | 60 +++++++++++++++++++++++++++++++++++++++--- 6 files changed, 68 insertions(+), 16 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 678410e8ea2..1d9d43860f2 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -206,7 +206,7 @@ APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b) { if (b) { - return b->getstr(b); + return b->read(b); } return NULL; } @@ -241,7 +241,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) break; j = strlen(x); - rv = rw->insert(rw, x, j, &i); + rv = rw->write(rw, x, j, &i); if (i != j) { /* Do we need better error reporting? */ return -1; @@ -259,7 +259,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) j = strlen(x); r = ap_bucket_rwmem_create(); - rv = r->insert(r, x, j, &i); + rv = r->write(r, x, j, &i); if (i != j) { /* Do we need better error reporting? */ return -1; @@ -295,7 +295,7 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis res = ap_vsnprintf(buf, 4096, fmt, va); r = ap_bucket_rwmem_create(); - res = r->insert(r, buf, strlen(buf), &i); + res = r->write(r, buf, strlen(buf), &i); ap_bucket_brigade_append_buckets(b, r); return res; diff --git a/buckets/ap_eos_buf.c b/buckets/ap_eos_buf.c index dcd406fbd04..44a4e6551c5 100644 --- a/buckets/ap_eos_buf.c +++ b/buckets/ap_eos_buf.c @@ -76,9 +76,9 @@ APR_EXPORT(ap_bucket *) ap_bucket_eos_create(void) newbuf = calloc(1, sizeof(*newbuf)); newbuf->color = AP_BUCKET_eos; - newbuf->getstr = eos_get_str; + newbuf->read = eos_get_str; newbuf->getlen = eos_get_len; - newbuf->insert = NULL; + newbuf->write = NULL; newbuf->split = NULL; newbuf->free = NULL; newbuf->data = NULL; diff --git a/buckets/ap_mmap_buf.c b/buckets/ap_mmap_buf.c index 353f08e3a67..2edce928d00 100644 --- a/buckets/ap_mmap_buf.c +++ b/buckets/ap_mmap_buf.c @@ -115,9 +115,9 @@ APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(void) b->len = 0; newbuf->color = AP_BUCKET_mmap; - newbuf->getstr = mmap_get_str; + newbuf->read = mmap_get_str; newbuf->getlen = mmap_get_len; - newbuf->insert = mmap_bucket_insert; + newbuf->write = mmap_bucket_insert; newbuf->split = mmap_split; newbuf->free = NULL; newbuf->data = b; diff --git a/buckets/ap_rmem_buf.c b/buckets/ap_rmem_buf.c index 3a2e4e49783..9f33afbbacd 100644 --- a/buckets/ap_rmem_buf.c +++ b/buckets/ap_rmem_buf.c @@ -136,9 +136,9 @@ APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(void) b->start = b->end = NULL; newbuf->color = AP_BUCKET_rmem; - newbuf->getstr = rmem_get_str; + newbuf->read = rmem_get_str; newbuf->getlen = rmem_get_len; - newbuf->insert = rmem_insert; + newbuf->write = rmem_insert; newbuf->split = rmem_split; newbuf->free = NULL; newbuf->data = b; diff --git a/buckets/ap_rwmem_buf.c b/buckets/ap_rwmem_buf.c index 6f43638b355..ad34213b266 100644 --- a/buckets/ap_rwmem_buf.c +++ b/buckets/ap_rwmem_buf.c @@ -155,9 +155,9 @@ APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(void) b->end = b->alloc_addr; newbuf->color = AP_BUCKET_rwmem; - newbuf->getstr = rwmem_get_str; + newbuf->read = rwmem_get_str; newbuf->getlen = rwmem_get_len; - newbuf->insert = rwmem_insert; + newbuf->write = rwmem_insert; newbuf->split = rwmem_split; newbuf->free = rwmem_destroy; newbuf->data = b; diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index a787057b851..ba2ff927e25 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -66,6 +66,49 @@ #include #endif + +/* The basic concept behind bucket_brigades..... + * + * A bucket brigade is simply a Queue of buckets, where we aren't limited + * to inserting at the front and removing at the end. + * + * Buckets are just data stores. They can be files, mmap areas, or just + * pre-allocated memory. The point of buckets is to store data. Along with + * that data, come some functions to access it. The functions are relatively + * simple, read, write, getlen, split, and free. + * + * read reads a string of data. Currently, it assumes we read all of the + * data in the bucket. This should be changed to only read the specified + * amount. + * + * getlen gets the number of bytes stored in the bucket. + * + * write writes the specified data to the bucket. Depending on the type of + * bucket, this may append to the end of previous data, or wipe out the data + * currently in the bucket. rwmem buckets append currently, all others + * erase the current bucket. + * + * split just makes one bucket into two at the spefied location. To implement + * this correctly, we really need to implement reference counting. + * + * free just destroys the data associated with the bucket. + * + * We may add more functions later. There has been talk of needing a stat, + * which would probably replace the getlen. And, we definately need a convert + * function. Convert would make one bucket type into another bucket type. + * + * To write a bucket brigade, they are first made into an iovec, so that we + * don't write too little data at one time. Currently we ignore compacting the + * buckets into as few buckets as possible, but if we really want to be + * performant, then we need to compact the buckets before we convert to an + * iovec, or possibly while we are converting to an iovec. + * + * I'm not really sure what else to say about the buckets. They are relatively + * simple and straight forward IMO. It is just a way to organize data in + * memory that allows us to modify that data and move it around quickly and + * easily. + */ + typedef enum { AP_BUCKET_rwmem, AP_BUCKET_rmem, @@ -82,11 +125,16 @@ typedef enum { typedef struct ap_bucket ap_bucket; struct ap_bucket { ap_bucket_color_e color; /* what type of bucket is it */ - void (*free)(void *e); /* can be NULL */ void *data; /* for use by free() */ - const char *(*getstr)(ap_bucket *e); /* Get the string */ + + /* All of the function pointers that can act on a bucket. */ + void (*free)(void *e); /* can be NULL */ int (*getlen)(ap_bucket *e); /* Get the length of the string */ - /* Insert into a bucket. The buf is a different type based on the + + /* Read the data from the bucket. */ + const char *(*read)(ap_bucket *e); /* Get the string */ + + /* Write into a bucket. The buf is a different type based on the * bucket type used. For example, with AP_BUCKET_mmap it is an ap_mmap_t * for AP_BUCKET_file it is an ap_file_t, and for AP_BUCKET_rwmem it is * a char *. The nbytes is the amount of actual data in buf. This is @@ -94,7 +142,9 @@ struct ap_bucket { * that buf resolves to. written is how much of that data was inserted * into the bucket. */ - int (*insert)(ap_bucket *e, const void *buf, ap_size_t nbytes, ap_ssize_t *w); + int (*write)(ap_bucket *e, const void *buf, ap_size_t nbytes, ap_ssize_t *w); + + /* Split one bucket into to at the specified position */ ap_status_t (*split)(ap_bucket *e, ap_size_t nbytes); ap_bucket *next; /* The next node in the bucket list */ @@ -196,6 +246,8 @@ APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b); /* get the length of the data in the bucket */ APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b); +/****** Functions to Create Buckets of varying type ******/ + /* Create a read/write memory bucket */ APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(void); From a724e9e77a341303c3fb59555b7e7839fbd1704e Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 23 Jul 2000 12:32:17 +0000 Subject: [PATCH 0441/7878] Fix VPATH builds git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60416 13f79535-47bb-0310-9956-ffa450edef68 --- apr_common.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/apr_common.m4 b/apr_common.m4 index 3f9208f0d19..ab3fbfbf7f3 100644 --- a/apr_common.m4 +++ b/apr_common.m4 @@ -3,6 +3,7 @@ AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [ ac_popdir=`pwd` ac_abs_srcdir=`(cd $srcdir/$1 && pwd)` apr_config_subdirs="$1" + test -d $1 || $srcdir/helpers/mkdir.sh $1 cd $1 changequote(, )dnl From 0a01c7f484e65b27dddb88c36439acda984beadb Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 15:41:28 +0000 Subject: [PATCH 0442/7878] Convert apr_lib.h to use Scandoc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60417 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 163 +++++++++++++++++++--------------------------- 1 file changed, 67 insertions(+), 96 deletions(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index f3b9c0ea9b0..7f9e60afaf9 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -69,6 +69,10 @@ #include #endif +/** + * @package APR general-purpose library + */ + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -87,20 +91,18 @@ typedef struct ap_vformatter_buff_t { char *endpos; } ap_vformatter_buff_t; -/* - -=head1 ap_status_t ap_filename_of_pathname(const char *pathname) - -B - - arg 1) The path to get the final element of - -B: Examples: "/foo/bar/gum" -> "gum" - "/foo/bar/gum/" -> "" - "gum" -> "gum" - "wi\\n32\\stuff" -> "stuff" - -=cut +/** + * return the final element of the pathname + * @param pathname The path to get the final element of + * @return the final element of the path + * @tip Examples: + *
+ *                 "/foo/bar/gum"   -> "gum"
+ *                 "/foo/bar/gum/"  -> ""
+ *                 "gum"            -> "gum"
+ *                 "wi\\n32\\stuff" -> "stuff"
+ * 
+ * @deffunc const char * ap_filename_of_pathname(const char *pathname) */ APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); @@ -138,9 +140,16 @@ APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); #endif /* NO_KILLPG */ #endif /* WIN32 */ -/* +/** * ap_vformatter() is a generic printf-style formatting routine - * with some extensions. The extensions are: + * with some extensions. + * @param flush_func The function to call when the buffer is full + * @param c The buffer to write to + * @param fmt The format string + * @param ap The arguments to use to fill out the format string. + * + * @tip
+ * The extensions are:
  *
  * %pA	takes a struct in_addr *, and prints it as a.b.c.d
  * %pI	takes a struct sockaddr_in * and prints it as a.b.c.d:port
@@ -186,40 +195,18 @@ APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname);
  * space at the end of its output buffer, and doesn't actually note
  * that the space is in use until it either has to flush the buffer
  * or until ap_vformatter returns.
- */
-
-/*
-
-=head1 int ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b), ap_vformatter_buff_t *c, const char *fmt, va_list ap)
-
-B
-
-    arg 1) The function to call when the buffer is full
-    arg 2) The buffer to write to
-    arg 3) The format string
-    arg 4) The arguments to use to fill out the format string.
-
-B:  The extensions are:
-    %pA		takes a struct in_addr *, and prints it as a.b.c.d
-    %pI		takes a struct sockaddr_in * and prints it as a.b.c.d:port
-    %pp  	takes a void * and outputs it in hex
-
-=cut
+ * 
+ * @deffunc int ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b), ap_vformatter_buff_t *c, const char *fmt, va_list ap) */ APR_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b), ap_vformatter_buff_t *c, const char *fmt, va_list ap); -/* - -=head1 ap_status_t ap_validate_password(const char *passwd, const char *hash) - -B - - arg 1) The password to validate - arg 2) The password to validate against - -=cut +/** + * Validate any password encypted with any algorithm that APR understands + * @param passwd The password to validate + * @param hash The password to validate against + * @deffunc ap_status_t ap_validate_password(const char *passwd, const char *hash) */ APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *hash); @@ -241,68 +228,52 @@ APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *has * exactly filled the buffer. */ -/* - -=head1 int ap_snprintf(char *buf, size_t len, const char *format, ...) - -B - - arg 1) The buffer to write to - arg 2) The size of the buffer - arg 3) The format string - arg 4) The arguments to use to fill out the format string. - -=cut +/** + *snprintf routine based on ap_vformatter. This means it understands the + *same extensions.> + * @param buf The buffer to write to + * @param len The size of the buffer + * @param format The format string + * @param ... The arguments to use to fill out the format string. + * @deffunc int ap_snprintf(char *buf, size_t len, const char *format, ...) */ APR_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format, ...) __attribute__((format(printf,3,4))); -/* - -=head1 int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap) - -B - - arg 1) The buffer to write to - arg 2) The size of the buffer - arg 3) The format string - arg 4) The arguments to use to fill out the format string. - -=cut +/** + * vsnprintf routine based on ap_vformatter. This means it understands the + * same extensions. + * @param buf The buffer to write to + * @param len The size of the buffer + * @param format The format string + * @param ap The arguments to use to fill out the format string. + * @deffunc int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap) */ APR_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap); -/* - -=head1 ap_status_t ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize) - -B - - arg 1) The prompt to display - arg 2) Where to store the password - arg 3) The length of the password string. - -=cut +/** + * Display a prompt and read in the password from stdin. + * @param prompt The prompt to display + * @param pwbuf Where to store the password + * @param bufsize The length of the password string. + * @deffunc ap_status_t ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize) */ APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize); -/* - -=head1 ap_status_t ap_note_subprocess(ap_pool_t *a, ap_proc_t *pid, enum kill_conditions how) - -B - - arg 1) The pool to use to define the processes lifetime - arg 2) The process to register - arg 3) How to kill the process, one of: - kill_never -- process is never sent any signals - kill_always -- process is sent SIGKILL on ap_pool_t cleanup - kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL - just_wait -- wait forever for the process to complete - kill_only_once -- send SIGTERM and then wait - -=cut +/** + * Register a process to be killed when a pool dies. + * @param a The pool to use to define the processes lifetime + * @param pid The process to register + * @param how How to kill the process, one of: + *
+ *         kill_never   	   -- process is never sent any signals
+ *         kill_always 	   -- process is sent SIGKILL on ap_pool_t cleanup	
+ *         kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL
+ *         just_wait          -- wait forever for the process to complete
+ *         kill_only_once     -- send SIGTERM and then wait
+ * 
+ * @deffunc void ap_note_subprocess(struct ap_pool_t *a, ap_proc_t *pid, enum kill_conditions how) */ APR_EXPORT(void) ap_note_subprocess(struct ap_pool_t *a, ap_proc_t *pid, enum kill_conditions how); From 9b6dc5ecb2329d2b41ed4011e63d193168352e5f Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 15:51:59 +0000 Subject: [PATCH 0443/7878] Update apr_lock.h to use ScanDoc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60418 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lock.h | 156 +++++++++++++++++---------------------------- 1 file changed, 60 insertions(+), 96 deletions(-) diff --git a/include/apr_lock.h b/include/apr_lock.h index f2d65676abe..333bc5c9102 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -62,6 +62,10 @@ extern "C" { #endif /* __cplusplus */ +/** + * @package APR lock library + */ + typedef enum {APR_CROSS_PROCESS, APR_INTRAPROCESS, APR_LOCKALL} ap_lockscope_e; typedef enum {APR_MUTEX, APR_READWRITE} ap_locktype_e; @@ -69,123 +73,83 @@ typedef enum {APR_MUTEX, APR_READWRITE} ap_locktype_e; typedef struct ap_lock_t ap_lock_t; /* Function definitions */ -/* - -=head1 ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, ap_lockscope_e scope, const char *fname, ap_pool_t *cont) - -B - - arg 1) The newly created lock structure. - arg 2) The type of lock to create, one of: - APR_MUTEX - APR_READWRITE - arg 3) The scope of the lock to create, one of: - APR_CROSS_PROCESS -- lock processes from the protected area. - APR_INTRAPROCESS -- lock threads from the protected area. - APR_LOCKALL -- lock processes and threads from the - protected area. - arg 4) A file name to use if the lock mechanism requires one. This - argument should always be provided. The lock code itself will - determine if it should be used. - arg 5) The pool to operate on. - -B: APR_CROSS_PROCESS may lock both processes and threads, but it is - only guaranteed to lock processes. - -=cut + +/** + * Create a new instance of a lock structure. + * @param lock The newly created lock structure. + * @param type The type of lock to create, one of: + *
+ *            APR_MUTEX
+ *            APR_READWRITE
+ * 
+ * @param scope The scope of the lock to create, one of: + *
+ *            APR_CROSS_PROCESS -- lock processes from the protected area.
+ *            APR_INTRAPROCESS  -- lock threads from the protected area.
+ *            APR_LOCKALL       -- lock processes and threads from the
+ *                                 protected area.
+ * 
+ * @param fname A file name to use if the lock mechanism requires one. This + * argument should always be provided. The lock code itself will + * determine if it should be used. + * @param cont The pool to operate on. + * @tip APR_CROSS_PROCESS may lock both processes and threads, but it is + * only guaranteed to lock processes. */ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, ap_lockscope_e scope, const char *fname, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_lock(ap_lock_t *lock) - -B - - arg 1) The lock to set. - -=cut +/** + * Lock a protected region. + * @param lock The lock to set. */ ap_status_t ap_lock(ap_lock_t *lock); -/* - -=head1 ap_status_t ap_unlock(ap_lock_t *lock) - -B - - arg 1) The lock to reset. - -=cut +/** + * Unlock a protected region. + * @param lock The lock to reset. */ ap_status_t ap_unlock(ap_lock_t *lock); -/* - -=head1 ap_status_t ap_destroy_lock(ap_lock_t *lock) - -B - - arg 1) The lock to free. - -B: If the lock is currently active when it is destroyed, it - will be unlocked first. - -=cut +/** + * Free the memory associated with a lock. + * @param lock The lock to free. + * @tip If the lock is currently active when it is destroyed, it + * will be unlocked first. */ ap_status_t ap_destroy_lock(ap_lock_t *lock); -/* - -=head1 ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, ap_pool_t *cont) - -B - - arg 1) The newly re-opened lock structure. - arg 2) A file name to use if the lock mechanism requires one. This - argument should always be provided. The lock code itself will - determine if it should be used. This filename should be the same - one that was passed to ap_create_lock - arg 3) The pool to operate on. - -B: This function doesn't always do something, it depends on the - locking mechanism chosen for the platform, but it is a good - idea to call it regardless, because it makes the code more - portable. - -=cut +/** + * Re-open a lock in a child process. + * @param lock The newly re-opened lock structure. + * @param fname A file name to use if the lock mechanism requires one. This + * argument should always be provided. The lock code itself will + * determine if it should be used. This filename should be the + * same one that was passed to ap_create_lock + * @param cont The pool to operate on. + * @tip This function doesn't always do something, it depends on the + * locking mechanism chosen for the platform, but it is a good + * idea to call it regardless, because it makes the code more + * portable. */ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) - -B - - arg 1) The currently open lock. - arg 2) The key to use when retreiving data associated with this lock - arg 3) The user data associated with the lock. - -=cut +/** + * Return the pool associated with the current lock. + * @param lock The currently open lock. + * @param key The key to use when retreiving data associated with this lock + * @param data The user data associated with the lock. */ ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data); -/* - -=head1 ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, ap_status_t (*cleanup) (void *)) - -B - - arg 1) The currently open lock. - arg 2) The user data to associate with the lock. - arg 3) The key to use when associating data with this lock - arg 4) The cleanup to use when the lock is destroyed. - -=cut +/** + * Return the pool associated with the current lock. + * @param lock The currently open lock. + * @param data The user data to associate with the lock. + * @param key The key to use when associating data with this lock + * @param cleanup The cleanup to use when the lock is destroyed. */ ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, ap_status_t (*cleanup) (void *)); From cf2dd3ec528198770f545ca5f8f5bc350e6a6827 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 15:58:52 +0000 Subject: [PATCH 0444/7878] Update apr_md5.h to use ScanDoc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60419 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_md5.h | 86 +++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 52 deletions(-) diff --git a/include/apr_md5.h b/include/apr_md5.h index dc3dba9e698..774bfef1100 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -92,6 +92,10 @@ extern "C" { #endif +/** + * @package APR MD5 Library + */ + #define MD5_DIGESTSIZE 16 /* UINT4 defines a four byte word */ @@ -107,28 +111,19 @@ typedef struct { #endif } ap_md5_ctx_t; -/* - -=head1 ap_status_t ap_MD5Init(ap_md5_ctx_t *context) - -B - - arg 1) The MD5 context to initialize. - -=cut +/** + * MD5 Initialize. Begins an MD5 operation, writing a new context. + * @param context The MD5 context to initialize. + * @deffunc ap_status_t ap_MD5Init(ap_md5_ctx_t *context) */ APR_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context); -/* - -=head1 ap_status_t ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) - -B - - arg 1) The MD5 content to set the translation for. - arg 2) The translation handle to use for this MD5 context - -=cut +/** + * MD5 translation setup. Provides the APR translation handle to be used + * for translating the content before calculating the digest. + * @param context The MD5 content to set the translation for. + * @param xlate The translation handle to use for this MD5 context + * @deffunc ap_status_t ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) */ #if APR_HAS_XLATE APR_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate); @@ -136,48 +131,35 @@ APR_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) #define ap_MD5SetXlate(context, xlate) APR_ENOTIMPL #endif -/* - -=head1 ap_status_t ap_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) - -B - - arg 1) The MD5 content to update. - arg 2) next message block to update - arg 3) The length of the next message block - -=cut +/** + * MD5 block update operation. Continue an MD5 message-digest operation, + * processing another message block, and updating the context. + * @param context The MD5 content to update. + * @param input next message block to update + * @param inputLen The length of the next message block + * @deffunc ap_status_t ap_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) */ APR_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen); -/* - -=head1 ap_status_t ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE, ap_md5_ctx_t *context) - -B - - arg 1) The final MD5 digest - arg 2) The MD5 content we are finalizing. - -=cut +/** + * MD5 finalization. Ends an MD5 message-digest operation, writing the + * message digest and zeroing the context + * @param digest The final MD5 digest + * @param context The MD5 content we are finalizing. + * @deffunc ap_status_t ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], ap_md5_ctx_t *context) */ APR_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], ap_md5_ctx_t *context); -/* - -=head1 ap_status_t ap_MD5Encode(unsigned char *passwd, const char *salt, char *result, size_t nbytes) - -B - - arg 1) The password to encode - arg 2) The salt to use for the encoding - arg 3) The string to store the encoded password in - arg 4) The length of the string - -=cut +/** + * Encode a password using an MD5 algorithm + * @param password The password to encode + * @param salt The salt to use for the encoding + * @param result The string to store the encoded password in + * @param nbytes The length of the string + * @deffunc ap_status_t ap_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes) */ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes); From 9daaa8213b27c6b21048da8c63b38756b87b8b09 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 16:03:07 +0000 Subject: [PATCH 0445/7878] Update apr_mmap.h to use ScanDoc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60420 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_mmap.h | 52 +++++++++++++++++----------------------------- 1 file changed, 19 insertions(+), 33 deletions(-) diff --git a/include/apr_mmap.h b/include/apr_mmap.h index dc46958befa..3334ac17791 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -64,6 +64,10 @@ extern "C" { #endif /* __cplusplus */ +/** + * @package APR MMAP library + */ + typedef struct ap_mmap_t ap_mmap_t; /* As far as I can tell the only really sane way to store an MMAP is as a * void * and a length. BeOS requires this area_id, but that's just a little @@ -82,46 +86,28 @@ struct ap_mmap_t { /* Function definitions */ -/* - -=head1 ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset) - -B - - arg 1) The newly created mmap'ed file. - arg 2) The file turn into an mmap. - arg 3) The offset into the file to start the data pointer at. - arg 4) The size of the file - arg 5) The pool to use when creating the mmap. - -=cut +/** + * Create a new mmap'ed file out of an existing APR file. + * @param newmmap The newly created mmap'ed file. + * @param file The file turn into an mmap. + * @param offset The offset into the file to start the data pointer at. + * @param size The size of the file + * @param cntxt The pool to use when creating the mmap. */ ap_status_t ap_mmap_create(ap_mmap_t ** newmmap, ap_file_t *file, ap_off_t offset, ap_size_t size, ap_pool_t *cntxt); -/* - -=head1 ap_status_t ap_mmap_delete(ap_mmap_t *mmap) - -B - - arg 1) The mmap'ed file. - -=cut +/** + * Remove a mmap'ed. + * @param mmap The mmap'ed file. */ ap_status_t ap_mmap_delete(ap_mmap_t *mmap); -/* - -=head1 ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_offset_t offset) - -B - - arg 1) The pointer to the offset specified. - arg 2) The mmap'ed file. - arg 3) The offset to move to. - -=cut +/** + * Move the pointer into the mmap'ed file to the specified offset. + * @param addr The pointer to the offset specified. + * @param mmap The mmap'ed file. + * @param offset The offset to move to. */ ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_off_t offset); From 9be80fea1ecfda122cbe0e834cf05b136c1d7feb Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 16:28:12 +0000 Subject: [PATCH 0446/7878] Update apr_network_io.h to use ScanDoc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60421 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 808 +++++++++++++++------------------------ 1 file changed, 304 insertions(+), 504 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 188150afc46..375b071e4e8 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -55,6 +55,10 @@ #ifndef APR_NETWORK_IO_H #define APR_NETWORK_IO_H +/** + * @package APR Network library + */ + #include "apr_general.h" #include "apr_file_io.h" #include "apr_errno.h" @@ -138,630 +142,426 @@ struct ap_hdtr_t { /* function definitions */ -/* - -=head1 ap_status_t ap_create_tcp_socket(ap_socket_t **new_sock, ap_pool_t *cont) - -B - - arg 1) The new socket that has been setup. - arg 2) The pool to use - -=cut +/** + * Create a socket for tcp communication. + * @param new_sock The new socket that has been setup. + * @param cont The pool to use */ ap_status_t ap_create_tcp_socket(ap_socket_t **new_sock, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) - -B - - arg 1) The socket to close - arg 2) How to shutdown the socket. One of: - APR_SHUTDOWN_READ -- no longer allow read requests - APR_SHUTDOWN_WRITE -- no longer allow write requests - APR_SHUTDOWN_READWRITE -- no longer allow read or write requests - -B: This does not actually close the socket descriptor, it just - controls which calls are still valid on the socket. - -=cut +/** + * Shutdown either reading, writing, or both sides of a tcp socket. + * @param thesocket The socket to close + * @param how How to shutdown the socket. One of: + *
+ *            APR_SHUTDOWN_READ      -- no longer allow read requests
+ *            APR_SHUTDOWN_WRITE     -- no longer allow write requests
+ *            APR_SHUTDOWN_READWRITE -- no longer allow read or write requests 
+ * 
+ * @tip This does not actually close the socket descriptor, it just + * controls which calls are still valid on the socket. */ -ap_status_t ap_shutdown(ap_socket_t *ithesocket, ap_shutdown_how_e how); +ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how); -/* - -=head1 ap_status_t ap_close_socket(ap_socket_t *thesocket) - -B - - arg 1) The socket to close - -=cut +/** + * Close a tcp socket. + * @param thesocket The socket to close */ ap_status_t ap_close_socket(ap_socket_t *thesocket); -/* - -=head1 ap_status_t ap_bind(ap_socket_t *sock) - -B - - arg 1) The socket to bind - -B: This is where we will find out if there is any other process - using the selected port. - -=cut +/** + * Bind the socket to it's assocaited port + * @param sock The socket to bind + * @tip This is where we will find out if there is any other process + * using the selected port. */ ap_status_t ap_bind(ap_socket_t *sock); -/* - -=head1 ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) - -B - - arg 1) The socket to listen on - arg 2) The number of outstanding connections allowed in the sockets - listen queue. If this value is less than zero, the listen - queue size is set to zero. - -=cut +/** + * Listen to a bound socketi for connections. + * @param sock The socket to listen on + * @param backlog The number of outstanding connections allowed in the sockets + * listen queue. If this value is less than zero, the listen + * queue size is set to zero. */ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog); -/* - -=head1 ap_status_t ap_accept(ap_socket_t **new_sock, ap_socket_t *sock, ap_pool_t *connection_pool) - -B - - arg 1) A copy of the socket that is connected to the socket that - made the connection request. This is the socket which should - be used for all future communication. - arg 2) The socket we are listening on. - arg 3) The pool for the new socket. - -=cut +/** + * Accept a new connection request + * @param new_sock A copy of the socket that is connected to the socket that + * made the connection request. This is the socket which should + * be used for all future communication. + * @param sock The socket we are listening on. + * @param connection_pool The pool for the new socket. */ ap_status_t ap_accept(ap_socket_t **new_sock, ap_socket_t *sock, ap_pool_t *connection_pool); -/* - -=head1 ap_status_t ap_connect(ap_socket_t *sock, char *hostname) - -B - - arg 1) The socket we wish to use for our side of the connection - arg 2) The hostname of the machine we wish to connect to. If NULL, - APR assumes that the sockaddr_in in the apr_socket is completely - filled out. - -=cut +/** + * Issue a connection request to a socket either on the same machine + * or a different one. + * @param sock The socket we wish to use for our side of the connection + * @param hostname The hostname of the machine we wish to connect to. If NULL, + * APR assumes that the sockaddr_in in the apr_socket is + * completely filled out. */ ap_status_t ap_connect(ap_socket_t *sock, char *hostname); -/* - -=head1 ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) - -B - - arg 1) A buffer to store the hostname in. - arg 2) The socket to examine. - -=cut +/** + * Get name of the machine we are currently connected to. + * @param name A buffer to store the hostname in. + * @param sock The socket to examine. */ ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock); -/* - -=head1 ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_pool_t *cont) - -B - - arg 1) A buffer to store the hostname in. - arg 2) The maximum length of the hostname that can be stored in the - buffer provided. - arg 3) The pool to use. - -=cut +/** + * Get name of the current machine + * @param buf A buffer to store the hostname in. + * @param len The maximum length of the hostname that can be stored in the + * buffer provided. + * @param cont The pool to use. */ ap_status_t ap_gethostname(char *buf, int len, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock) - -B - - arg 1) The currently open socket. - arg 2) The user data associated with the socket. - -=cut +/** + * Return the pool associated with the current socket> + * @param data The user data associated with the socket. + * @param key The key to associate with the user data. + * @param sock The currently open socket. */ ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock); -/* - -=head1 ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, ap_status_t (*cleanup) (void *)) - -B - - arg 1) The currently open socket. - arg 2) The user data to associate with the socket. - arg 3) The key to associate with the data. - arg 4) The cleanup to call when the socket is destroyed. - -=cut +/** + * Set the pool associated with the current socket. + * @param sock The currently open socket. + * @param data The user data to associate with the socket. + * @param key The key to associate with the data. + * @param cleanup The cleanup to call when the socket is destroyed. */ ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, ap_status_t (*cleanup) (void*)); -/* - -=head1 ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) - -B - - arg 1) The socket to send the data over. - arg 2) The buffer which contains the data to be sent. - arg 3) On entry, the number of bytes to send; on exit, the number - of bytes sent. - -B: This functions acts like a blocking write by default. To change - this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. - - It is possible for both bytes to be sent and an error to be returned. - - APR_EINTR is never returned. - -=cut +/** + * Send data over a network. + * @param sock The socket to send the data over. + * @param buf The buffer which contains the data to be sent. + * @param len On entry, the number of bytes to send; on exit, the number + * of bytes sent. + * @tip + *
+ * This functions acts like a blocking write by default.  To change 
+ * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option.
+ *
+ * It is possible for both bytes to be sent and an error to be returned.
+ *
+ * APR_EINTR is never returned.
+ * 
*/ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len); -/* - -=head1 ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, ap_int32_t nvec, ap_ssize_t *len) - -B - - arg 1) The socket to send the data over. - arg 2) The array of iovec structs containing the data to send - arg 3) The number of iovec structs in the array - arg 4) Receives the number of bytes actually written - -B: This functions acts like a blocking write by default. To change - this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. - The number of bytes actually sent is stored in argument 3. - - It is possible for both bytes to be sent and an error to be returned. - - APR_EINTR is never returned. - -=cut +/** + * Send multiple packets of data over a network. + * @param sock The socket to send the data over. + * @param vec The array of iovec structs containing the data to send + * @param nvec The number of iovec structs in the array + * @param len Receives the number of bytes actually written + * @tip + *
+ * This functions acts like a blocking write by default.  To change 
+ * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option.
+ * The number of bytes actually sent is stored in argument 3.
+ *
+ * It is possible for both bytes to be sent and an error to be returned.
+ *
+ * APR_EINTR is never returned.
+ * 
*/ ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, ap_int32_t nvec, ap_ssize_t *len); #if APR_HAS_SENDFILE -/* - -=head1 ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr, ap_off_t *offset, ap_size_t *len, ap_int32_t flags) - -B - - arg 1) The socket to which we're writing - arg 2) The open file from which to read - arg 3) A structure containing the headers and trailers to send - arg 4) Offset into the file where we should begin writing - arg 5) Number of bytes to send - arg 6) APR flags that are mapped to OS specific flags - -B: This functions acts like a blocking write by default. To change - this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. - The number of bytes actually sent is stored in argument 5. - -=cut +/** + * Send a file from an open file descriptor to a socket, along with + * optional headers and trailers + * @param sock The socket to which we're writing + * @param file The open file from which to read + * @param hdtr A structure containing the headers and trailers to send + * @param offset Offset into the file where we should begin writing + * @param len Number of bytes to send + * @param flags APR flags that are mapped to OS specific flags + * @tip This functions acts like a blocking write by default. To change + * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. + * The number of bytes actually sent is stored in argument 5. */ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr, ap_off_t *offset, ap_size_t *len, ap_int32_t flags); #endif -/* - -=head1 ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) - -B - - arg 1) The socket to read the data from. - arg 2) The buffer to store the data in. - arg 3) On entry, the number of bytes to receive; on exit, the number - of bytes received. - -B: This functions acts like a blocking read by default. To change - this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. - The number of bytes actually sent is stored in argument 3. - - It is possible for both bytes to be received and an APR_EOF or - other error to be returned. - - APR_EINTR is never returned. - -=cut +/** + * Read data from a network. + * @param sock The socket to read the data from. + * @param buf The buffer to store the data in. + * @param len On entry, the number of bytes to receive; on exit, the number + * of bytes received. + * @tip + *
+ * This functions acts like a blocking read by default.  To change 
+ * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option.
+ * The number of bytes actually sent is stored in argument 3.
+ *
+ * It is possible for both bytes to be received and an APR_EOF or
+ * other error to be returned.
+ *
+ * APR_EINTR is never returned.
+ * 
*/ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len); -/* - -=head1 ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) - -B - - arg 1) The socket to set up. - arg 2) The option we would like to configure. One of: - APR_SO_DEBUG -- turn on debugging information - APR_SO_KEEPALIVE -- keep connections active - APR_SO_LINGER -- lingers on close if data is present - APR_SO_NONBLOCK -- Turns blocking on/off for socket - APR_SO_REUSEADDR -- The rules used in validating addresses - supplied to bind should allow reuse - of local addresses. - APR_SO_TIMEOUT -- Set the timeout value in microseconds. - values < 0 mean wait forever. 0 means - don't wait at all. - APR_SO_SNDBUF -- Set the SendBufferSize - APR_SO_RCVBUF -- Set the ReceiveBufferSize - arg 3) Are we turning the option on or off. - -=cut +/** + * Setup socket options for the specified socket + * @param sock The socket to set up. + * @param opt The option we would like to configure. One of: + *
+ *            APR_SO_DEBUG      --  turn on debugging information 
+ *            APR_SO_KEEPALIVE  --  keep connections active
+ *            APR_SO_LINGER     --  lingers on close if data is present
+ *            APR_SO_NONBLOCK   --  Turns blocking on/off for socket
+ *            APR_SO_REUSEADDR  --  The rules used in validating addresses
+ *                                  supplied to bind should allow reuse
+ *                                  of local addresses.
+ *            APR_SO_TIMEOUT    --  Set the timeout value in microseconds.
+ *                                  values < 0 mean wait forever.  0 means
+ *                                  don't wait at all.
+ *            APR_SO_SNDBUF     --  Set the SendBufferSize
+ *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
+ * 
+ * @param on Are we turning the option on or off. */ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on); -/* - -=head1 ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t* on) - -B - - arg 1) The socket to query - arg 2) The option we would like to query. One of: - APR_SO_DEBUG -- turn on debugging information - APR_SO_KEEPALIVE -- keep connections active - APR_SO_LINGER -- lingers on close if data is present - APR_SO_NONBLOCK -- Turns blocking on/off for socket - APR_SO_REUSEADDR -- The rules used in validating addresses - supplied to bind should allow reuse - of local addresses. - APR_SO_TIMEOUT -- Set the timeout value in microseconds. - values < 0 mean wait forever. 0 means - don't wait at all. - APR_SO_SNDBUF -- Set the SendBufferSize - APR_SO_RCVBUF -- Set the ReceiveBufferSize - APR_SO_DISCONNECTED -- Query the disconnected state of the socket. - (Currently only used on Windows) - arg 3) Socket option returned on the call. - -=cut +/** + * Query socket options for the specified socket + * @param sock The socket to query + * @param opt The option we would like to query. One of: + *
+ *            APR_SO_DEBUG      --  turn on debugging information 
+ *            APR_SO_KEEPALIVE  --  keep connections active
+ *            APR_SO_LINGER     --  lingers on close if data is present
+ *            APR_SO_NONBLOCK   --  Turns blocking on/off for socket
+ *            APR_SO_REUSEADDR  --  The rules used in validating addresses
+ *                                  supplied to bind should allow reuse
+ *                                  of local addresses.
+ *            APR_SO_TIMEOUT    --  Set the timeout value in microseconds.
+ *                                  values < 0 mean wait forever.  0 means
+ *                                  don't wait at all.
+ *            APR_SO_SNDBUF     --  Set the SendBufferSize
+ *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
+ *            APR_SO_DISCONNECTED -- Query the disconnected state of the socket.
+ *                                  (Currently only used on Windows)
+ * 
+ * @param on Socket option returned on the call. */ ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t* on); -/* - -=head1 ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) - Assocaite a local port with a socket. - - arg 1) The socket to set - arg 2) The local port this socket will be dealing with. - -B: This does not bind the two together, it is just telling apr - that this socket is going to use this port if possible. If - the port is already used, we won't find out about it here. - -=cut +/** + * Associate a local port with a socket. + * @param sock The socket to set + * @param port The local port this socket will be dealing with. + * @tip This does not bind the two together, it is just telling apr + * that this socket is going to use this port if possible. If + * the port is already used, we won't find out about it here. */ ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port); -/* - -=head1 ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) - -B - - arg 1) The socket to enquire about. - arg 2) The local port this socket will be dealing with. - -B: This does not make a connection to the remote port, it is just - telling apr which port ap_connect() should attempt to connect to. - -=cut +/** + * Assocaite a remote port with a socket. + * @param sock The socket to enquire about. + * @param port The local port this socket will be dealing with. + * @tip This does not make a connection to the remote port, it is just + * telling apr which port ap_connect() should attempt to connect to. */ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port); -/* - -=head1 ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) - -B - - arg 1) The local port this socket is associated with. - arg 2) The socket to enquire about. - -=cut +/** + * Return the local port with a socket. + * @param port The local port this socket is associated with. + * @param sock The socket to enquire about. */ ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock); -/* - -=head1 ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) - -B - - arg 1) The remote port this socket is associated with. - arg 2) The socket to enquire about. - -=cut +/** + * Return the remote port associated with a socket. + * @param port The remote port this socket is associated with. + * @param sock The socket to enquire about. */ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock); -/* - -=head1 ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, cont char *addr) - -B - - arg 1) The socket to use - arg 2) The IP address to attach to the socket. - Use APR_ANYADDR to use any IP addr on the machine. - -B: This does not bind the two together, it is just telling apr - that this socket is going to use this address if possible. - -=cut +/** + * Assocaite a local socket addr with an apr socket. + * @param sock The socket to use + * @param addr The IP address to attach to the socket. + * Use APR_ANYADDR to use any IP addr on the machine. + * @tip This does not bind the two together, it is just telling apr + * that this socket is going to use this address if possible. */ ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr); -/* - -=head1 ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, cont char *addr) - -B - - arg 1) The socket to use - arg 2) The IP address to attach to the socket. - -B: This does not make a connection to the remote address, it is just - telling apr which address ap_connect() should attempt to connect to. - -=cut +/** + * Assocaite a remote socket addr with an apr socket. + * @param sock The socket to use + * @param addr The IP address to attach to the socket. + * @tip This does not make a connection to the remote address, it is just + * telling apr which address ap_connect() should attempt to connect to. */ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr); -/* - -=head1 ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock) - -B - - arg 1) The local IP address associated with the socket. - arg 2) The socket to use - -=cut +/** + * Return the local IP address associated with an apr socket. + * @param addr The local IP address associated with the socket. + * @param sock The socket to use */ ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock); -/* - -=head1 ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock) - -B - - arg 1) The remote IP address associated with the socket. - arg 2) The socket to use - -=cut +/** + * Return the remote IP address associated with an apr socket. + * @param addr The remote IP address associated with the socket. + * @param sock The socket to use */ ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock); -/* - -=head1 ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) - -B - - arg 1) The local name associated with the socket. - arg 2) The socket to use - -=cut +/** + * Return the local socket name as a BSD style struct sockaddr_in. + * @param name The local name associated with the socket. + * @param sock The socket to use */ ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock); -/* - -=head1 ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock) - -B - - arg 1) The remote name associated with the socket. - arg 2) The socket to use - -=cut +/** + * Return the remote socket name as a BSD style struct sockaddr_in. + * @param name The remote name associated with the socket. + * @param sock The socket to use */ ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock); -/* - -=head1 ap_status_t ap_setup_poll(ap_pollfd_t **new_poll, ap_int32_t num, ap_pool_t *cont) - -B - - arg 1) The poll structure to be used. - arg 2) The number of socket descriptors to be polled. - arg 3) The pool to operate on. - -=cut +/** + * Setup the memory required for poll to operate properly> + * @param new_poll The poll structure to be used. + * @param num The number of socket descriptors to be polled. + * @param cont The pool to operate on. */ ap_status_t ap_setup_poll(ap_pollfd_t **new_poll, ap_int32_t num, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, ap_interval_time_t timeout) - -B - - arg 1) The poll structure we will be using. - arg 2) The number of sockets we are polling. - arg 3) The amount of time in microseconds to wait. This is a maximum, not - a minimum. If a socket is signalled, we will wake up before this - time. A negative number means wait until a socket is signalled. - -B: The number of sockets signalled is returned in the second argument. - - This is a blocking call, and it will not return until either a - socket has been signalled, or the timeout has expired. - -=cut +/** + * Poll the sockets in the poll structure + * @param aprset The poll structure we will be using. + * @param nsds The number of sockets we are polling. + * @param timeout The amount of time in microseconds to wait. This is + * a maximum, not a minimum. If a socket is signalled, we + * will wake up before this time. A negative number means + * wait until a socket is signalled. + * @tip + *
+ * The number of sockets signalled is returned in the second argument. 
+ *
+ *        This is a blocking call, and it will not return until either a 
+ *        socket has been signalled, or the timeout has expired. 
+ * 
*/ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, ap_interval_time_t timeout); -/* - -=head1 ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock, ap_int16_t event) - -B - - arg 1) The poll structure we will be using. - arg 2) The socket to add to the current poll structure. - arg 3) The events to look for when we do the poll. One of: - APR_POLLIN -- signal if read will not block - APR_POLLPRI -- signal if prioirty data is availble to be read - APR_POLLOUT -- signal if write will not block - -=cut +/** + * Add a socket to the poll structure. + * @param aprset The poll structure we will be using. + * @param socket The socket to add to the current poll structure. + * @param event The events to look for when we do the poll. One of: + *
+ *            APR_POLLIN    -- signal if read will not block
+ *            APR_POLLPRI   -- signal if prioirty data is availble to be read
+ *            APR_POLLOUT   -- signal if write will not block
+ * 
*/ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, ap_socket_t *socket, ap_int16_t event); -/* - -=head1 ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock, ap_int16_t events) - -B - - arg 1) The poll structure we will be using. - arg 2) The socket to modify in poll structure. - arg 3) The events to stop looking for during the poll. One of: - APR_POLLIN -- signal if read will not block - APR_POLLPRI -- signal if prioirty data is availble to be read - APR_POLLOUT -- signal if write will not block - -=cut +/** + * Modify a socket in the poll structure with mask. + * @param aprset The poll structure we will be using. + * @param sock The socket to modify in poll structure. + * @param events The events to stop looking for during the poll. One of: + *
+ *            APR_POLLIN    -- signal if read will not block
+ *            APR_POLLPRI   -- signal if prioirty data is availble to be read
+ *            APR_POLLOUT   -- signal if write will not block
+ * 
*/ ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock, ap_int16_t events); -/* - -=head1 ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) - -B - - arg 1) The poll structure we will be using. - arg 2) The socket to remove from the current poll structure. - -=cut +/** + * Remove a socket from the poll structure. + * @param aprset The poll structure we will be using. + * @param sock The socket to remove from the current poll structure. */ ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock); -/* - -=head1 ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events) - -B - - arg 1) The poll structure we will be using. - arg 2) The events to clear from all sockets. One of: - APR_POLLIN -- signal if read will not block - APR_POLLPRI -- signal if prioirty data is availble to be read - APR_POLLOUT -- signal if write will not block - -=cut +/** + * Remove all sockets from the poll structure. + * @param aprset The poll structure we will be using. + * @param events The events to clear from all sockets. One of: + *
+ *            APR_POLLIN    -- signal if read will not block
+ *            APR_POLLPRI   -- signal if prioirty data is availble to be read
+ *            APR_POLLOUT   -- signal if write will not block
+ * 
*/ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events); -/* - -=head1 ap_status_t ap_get_revents(ap_int_16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) - -B - - arg 1) The returned events for the socket. One of: - APR_POLLIN -- Data is available to be read - APR_POLLPRI -- Prioirty data is availble to be read - APR_POLLOUT -- Write will succeed - APR_POLLERR -- An error occurred on the socket - APR_POLLHUP -- The connection has been terminated - APR_POLLNVAL -- This is an invalid socket to poll on. - Socket not open. - arg 2) The socket we wish to get information about. - arg 3) The poll structure we will be using. - -=cut +/** + * Get the return events for the specified socket. + * @param event The returned events for the socket. One of: + *
+ *            APR_POLLIN    -- Data is available to be read 
+ *            APR_POLLPRI   -- Prioirty data is availble to be read
+ *            APR_POLLOUT   -- Write will succeed
+ *            APR_POLLERR   -- An error occurred on the socket
+ *            APR_POLLHUP   -- The connection has been terminated
+ *            APR_POLLNVAL  -- This is an invalid socket to poll on.
+ *                             Socket not open.
+ * 
+ * @param sock The socket we wish to get information about. + * @param aprset The poll structure we will be using. */ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset); -/* - -=head1 ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data) - -B - - arg 1) The currently open pollfd. - arg 2) The key to use for retreiving data associated with a poll struct. - arg 3) The user data associated with the pollfd. - -=cut +/** + * Return the data associated with the current poll. + * @param pollfd The currently open pollfd. + * @param key The key to use for retreiving data associated with a poll struct. + * @param data The user data associated with the pollfd. */ ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data); -/* - -=head1 ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, ap_status_t (*cleanup) (void *)) - -B - - arg 1) The currently open pollfd. - arg 2) The user data to associate with the pollfd. - -=cut +/** + * Set the data associated with the current poll. + * @param pollfd The currently open pollfd. + * @param data The key to associate with the data. + * @param key The user data to associate with the pollfd. + * @param cleanup The cleanup function */ ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, ap_status_t (*cleanup) (void *)); -/* - -=head1 ap_status_t ap_socket_from_file(ap_socket_t **newsock, ap_file_t *file) - -B - - arg 1) the newly created socket which represents a file. - arg 2) the file to mask as a socket. - -B: This is not available on all platforms. Platforms that have the - ability to poll files for data to be read/written/exceptions will - have the APR_FILES_AS_SOCKETS macro defined as true. - -=cut +/** + * Convert a File type to a socket so that it can be used in a poll operation. + * @param newsock the newly created socket which represents a file. + * @param file the file to mask as a socket. + * @tip This is not available on all platforms. Platforms that have the + * ability to poll files for data to be read/written/exceptions will + * have the APR_FILES_AS_SOCKETS macro defined as true. */ ap_status_t ap_socket_from_file(ap_socket_t **newsock, ap_file_t *file); - -/* accessor functions */ - #ifdef __cplusplus } #endif From 97064279cd8179e172321a0aa95beff937c5b44d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 16:49:19 +0000 Subject: [PATCH 0447/7878] Update apr_pools.h to use ScanDoc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60422 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 251 ++++++++++++++++---------------------------- 1 file changed, 93 insertions(+), 158 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 1c00114aaf8..0a70da34693 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -59,6 +59,10 @@ extern "C" { #endif +/** + * @package APR memory allocation + */ + /* * Resource allocation routines... * @@ -124,209 +128,140 @@ APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (*apr_abort)(int retcod * APR memory structure manipulators (pools, tables, and arrays). */ -/* - -=head1 ap_status_t ap_init_alloc(void) - -B - -B: Programs do B need to call this directly. APR will call this - automatically from ap_initialize. -=cut +/** + * Setup all of the internal structures required to use pools + * @tip Programs do NOT need to call this directly. APR will call this + * automatically from ap_initialize. */ ap_status_t ap_init_alloc(void); /* Set up everything */ -/* - -=head1 void ap_term_alloc(void) - -B - -B: Programs do B need to call this directly. APR will call this - automatically from ap_terminate. - -=cut +/** + * Tear down all of the internal structures required to use pools + * @tip Programs do NOT need to call this directly. APR will call this + * automatically from ap_terminate. */ -void ap_term_alloc(void); /* Tear down everything */ - -/* - -=head1 ap_pool_t *ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) - -B - - arg 1) The pool to use as a parent pool - arg 2) A function to use if the pool cannot allocate more memory. - return) The new sub-pool - -B: The apr_abort function provides a way to quit the program if the - machine is out of memory. By default, APR will return with an - error. - -=cut +void ap_term_alloc(void); /* Tear down everything */ + +/** + * make a sub pool from the current pool + * @param p The pool to use as a parent pool + * @param apr_abort A function to use if the pool cannot allocate more memory. + * @return The new sub-pool + * @tip The apr_abort function provides a way to quit the program if the + * machine is out of memory. By default, APR will return with an + * error. + * @deffunc ap_pool_t *ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) */ APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)); -/* - -=head1 void ap_clear_pool(ap_pool_t *p) - -B - - arg 1) The pool to clear - -B: This does not actually free the memory, it just allows the pool - to re-use this memory for the next allocation. - -=cut +/** + * clear all memory in the pool + * @param p The pool to clear + * @tip This does not actually free the memory, it just allows the pool + * to re-use this memory for the next allocation. + * @deffunc void ap_clear_pool(ap_pool_t *p) */ APR_EXPORT(void) ap_clear_pool(ap_pool_t *p); -/* - -=head1 void ap_destroy_pool(ap_pool_t *p) - -B - - arg 1) The pool to destroy - -B: This will actually free the memory - -=cut +/** + * destroy the pool + * @param p The pool to destroy + * @tip This will actually free the memory + * @deffunc void ap_destroy_pool(ap_pool_t *p) */ APR_EXPORT(void) ap_destroy_pool(ap_pool_t *p); -/* - -=head1 ap_size_t ap_bytes_in_pool(ap_pool_t *p) - -B - - arg 1) The pool to inspect - return) The number of bytes - -=cut +/** + * report the number of bytes currently in the pool + * @param p The pool to inspect + * @return The number of bytes + * @deffunc ap_size_t ap_bytes_in_pool(ap_pool_t *p) */ APR_EXPORT(ap_size_t) ap_bytes_in_pool(ap_pool_t *p); -/* - -=head1 ap_size_t ap_bytes_in_free_blocks(ap_pool_t *p) - -B - - return) The number of bytes - -=cut +/** + * report the number of bytes currently in the list of free blocks + * @return The number of bytes + * @deffunc ap_size_t ap_bytes_in_free_blocks(void) */ APR_EXPORT(ap_size_t) ap_bytes_in_free_blocks(void); -/* - -=head1 ap_pool_t *ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) - -B - - arg 1) The pool to search - arg 2) The pool to search for - return) True if a is an ancestor of b, NULL is considered an ancestor - of all pools. - -=cut +/** + * Determine if pool a is an ancestor of pool b + * @param a The pool to search + * @param b The pool to search for + * @return True if a is an ancestor of b, NULL is considered an ancestor + * of all pools. + * @deffunc int ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) */ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); -/* - -=head1 void *ap_palloc(ap_pool_t *c, ap_size_t reqsize) - -B - - arg 1) The pool to allocate out of - arg 2) The amount of memory to allocate - return) The allocated memory - -=cut +/** + * Allocate a block of memory from a pool + * @param c The pool to allocate out of + * @param reqsize The amount of memory to allocate + * @return The allocated memory + * @deffunc void *ap_palloc(ap_pool_t *c, ap_size_t reqsize) */ APR_EXPORT(void *) ap_palloc(ap_pool_t *c, ap_size_t reqsize); -/* - -=head1 void *ap_pcalloc(ap_pool_t *c, ap_size_t reqsize) - -B - - arg 1) The pool to allocate out of - arg 2) The amount of memory to allocate - return) The allocated memory - -=cut +/** + * Allocate a block of memory from a pool and set all of the memory to 0 + * @param p The pool to allocate out of + * @param size The amount of memory to allocate + * @return The allocated memory + * @deffunc void *ap_pcalloc(ap_pool_t *p, ap_size_t size) */ APR_EXPORT(void *) ap_pcalloc(ap_pool_t *p, ap_size_t size); -/* - -=head1 void ap_register_cleanup(ap_pool_t *p, const void *data, - ap_status_t (*plain_cleanup)(void *), - ap_status_t (*child_cleanup)(void *)) - -B - - arg 1) The pool register the cleanup with - arg 2) The data to pass to the cleanup function. - arg 3) The function to call when the pool is cleared or destroyed - arg 4) The function to call when a child process is created - -=cut +/** + * Register a function to be called when a pool is cleared or destroyed + * @param p The pool register the cleanup with + * @param data The data to pass to the cleanup function. + * @param plain_cleanup The function to call when the pool is cleared + * or destroyed + * @param child_cleanup The function to call when a child process is created + * @deffunc void ap_register_cleanup(ap_pool_t *p, const void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)) */ APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, const void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)); -/* - -=head1 void ap_kill_cleanup(ap_pool_t *p, const void *data, - ap_status_t (*cleanup(void *)) - -B - - arg 1) The pool remove the cleanup from - arg 2) The data to remove from cleanup - arg 3) The function to remove from cleanup - -=cut +/** + * remove a previously registered cleanup function + * @param p The pool remove the cleanup from + * @param data The data to remove from cleanup + * @param cleanup The function to remove from cleanup + * @deffunc void ap_kill_cleanup(ap_pool_t *p, const void *data, ap_status_t (*cleanup) (void *)) */ APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, const void *data, ap_status_t (*cleanup) (void *)); -/* - -=head1 ap_status_t ap_run_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup(void *)) - -B - - arg 1) The pool remove the cleanup from - arg 2) The data to remove from cleanup - arg 3) The function to remove from cleanup - -=cut +/** + * Run the specified cleanup function immediately and unregister it + * @param p The pool remove the cleanup from + * @param data The data to remove from cleanup + * @param cleanup The function to remove from cleanup + * @deffunc ap_status_t ap_run_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)) */ APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)); -/* - -=head1 void ap_cleanup_for_exec(void) - -B - -=cut - */ /* Preparing for exec() --- close files, etc., but *don't* flush I/O * buffers, *don't* wait for subprocesses, and *don't* free any memory. */ +/** + * Run all of the child_cleanups, so that any unnecessary files are + * closed because we are about to exec a new program + * @deffunc void ap_cleanup_for_exec(void) + */ APR_EXPORT(void) ap_cleanup_for_exec(void); -APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize); + +/** + * An empty cleanup function + * @param data The data to cleanup + * @deffunc ap_status_t ap_null_cleanup(void *data) + */ APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data); From 57a71f827bc9ebaa201ee5c8091dbc9fd9fe1708 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 17:00:44 +0000 Subject: [PATCH 0448/7878] Update apr_portable.h to use ScanDoc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60423 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 263 +++++++++++++---------------------------- 1 file changed, 85 insertions(+), 178 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 5861dd58bb5..4401d5b23b2 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -59,6 +59,10 @@ #ifndef APR_PORTABLE_H #define APR_PORTABLE_H +/** + * @package APR portability Routines + */ + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -179,232 +183,135 @@ typedef struct timeval ap_os_imp_time_t; typedef struct tm ap_os_exp_time_t; #endif -/* - -=head1 ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) - -B - - arg 1) The os specific file we are converting to - arg 2) The apr file to convert. - -B: On Unix, it is only possible to get a file descriptor from - an apr file type. - -=cut +/** + * convert the file from apr type to os specific type. + * @param thefile The os specific file we are converting to + * @param file The apr file to convert. + * @tip On Unix, it is only possible to get a file descriptor from + * an apr file type. */ ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file); -/* - -=head1 ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir) - -B - - arg 1) The os specific dir we are converting to - arg 2) The apr dir to convert. - -=cut +/** + * convert the dir from apr type to os specific type. + * @param thedir The os specific dir we are converting to + * @param dir The apr dir to convert. */ ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir); -/* - -=head1 ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) - -B - - arg 1) The socket to convert. - arg 2) The os specifc equivelant of the apr socket.. - -=cut +/** + * Convert the socket from an apr type to an OS specific socket + * @param thesock The socket to convert. + * @param sock The os specifc equivelant of the apr socket.. */ ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock); -/* - -=head1 ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock) - -B - - arg 1) The os specific lock we are converting to. - arg 2) The apr lock to convert. - -=cut +/** + * Convert the lock from os specific type to apr type + * @param oslock The os specific lock we are converting to. + * @param lock The apr lock to convert. */ ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock); -/* - -=head1 ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *aprtime) - -B - - arg 1) the native time format - arg 2) the time to convert - -=cut +/** + * Get the exploded time in the platforms native format. + * @param ostime the native time format + * @param aprtime the time to convert */ -ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **, ap_exploded_time_t *); - -/* - -=head1 ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime) - -B - - arg 1) the native time format - arg 2) the time to convert +ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *aprtime); -=cut +/** + * Get the imploded time in the platforms native format. + * @param ostime the native time format + * @param aprtimethe time to convert */ -ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **, ap_time_t *); -#if APR_HAS_THREADS -/* - -=head1 ap_status_t ap_get_os_thread(ap_thread_t **thethd, ap_os_thread_t *thd) - -B - - arg 1) The apr thread to convert - arg 2) The os specific thread we are converting to +ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime); -=cut +#if APR_HAS_THREADS +/** + * convert the thread to os specific type from apr type. + * @param thethd The apr thread to convert + * @param thd The os specific thread we are converting to */ ap_status_t ap_get_os_thread(ap_os_thread_t **thethd, ap_thread_t *thd); -/* - -=head1 ap_status_t ap_get_os_threadkey(ap_threadkey_t *thekey, ap_os_threadkey_t *key) - -B - - arg 1) The apr handle we are converting from. - arg 2) The os specific handle we are converting to. - -=cut +/** + * convert the thread private memory key to os specific type from an apr type. + * @param thekey The apr handle we are converting from. + * @param key The os specific handle we are converting to. */ ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key); #endif -/* - -=head1 ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, ap_pool_t *cont) - -B - - arg 1) The apr file we are converting to. - arg 2) The os specific file to convert - arg 3) The pool to use if it is needed. - -B: On Unix, it is only possible to put a file descriptor into - an apr file type. - -=cut +/** + * convert the file from os specific type to apr type. + * @param file The apr file we are converting to. + * @param thefile The os specific file to convert + * @param cont The pool to use if it is needed. + * @tip On Unix, it is only possible to put a file descriptor into + * an apr file type. */ ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir, ap_pool_t *cont) - -B - - arg 1) The apr dir we are converting to. - arg 2) The os specific dir to convert - arg 3) The pool to use when creating to apr directory. - -=cut +/** + * convert the dir from os specific type to apr type. + * @param dir The apr dir we are converting to. + * @param thedir The os specific dir to convert + * @param cont The pool to use when creating to apr directory. */ ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_socket_t *thesock, ap_pool_t *cont) - -B - - arg 1) The pool to use. - arg 2) The socket to convert to. - arg 3) The socket we are converting to an apr type. - -=cut +/** + * Convert a socket from the os specific type to the apr type + * @param sock The pool to use. + * @param thesock The socket to convert to. + * @param cont The socket we are converting to an apr type. */ ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *, ap_pool_t *cont) - -B - - arg 1) The apr lock we are converting to. - arg 2) The os specific lock to convert. - arg 3) The pool to use if it is needed. - -=cut +/** + * Convert the lock from os specific type to apr type + * @param lock The apr lock we are converting to. + * @param thelock The os specific lock to convert. + * @param cont The pool to use if it is needed. */ ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime, ap_pool_t, *cont) - -B - - arg 1) the APR time format - arg 2) the time to convert - arg 3) the pool to use if necessary - -=cut +/** + * Put the imploded time in the APR format. + * @param aprtime the APR time format + * @param ostime the time to convert + * @param cont the pool to use if necessary */ -ap_status_t ap_put_os_imp_time(ap_time_t *, ap_os_imp_time_t **, ap_pool_t *); - -/* - -=head1 ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, ap_os_exp_time_t **ostime, ap_pool_t, *cont) - -B - - arg 1) the APR time format - arg 2) the time to convert - arg 3) the pool to use if necessary +ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime, ap_pool_t *cont); -=cut +/** + * Put the exploded time in the APR format. + * @param aprtime the APR time format + * @param ostime the time to convert + * @param cont the pool to use if necessary */ -ap_status_t ap_put_os_exp_time(ap_exploded_time_t *, ap_os_exp_time_t **, ap_pool_t *); +ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, ap_os_exp_time_t **ostime, ap_pool_t *cont); #if APR_HAS_THREADS -/* - -=head1 ap_status_t ap_put_os_thread(ap_thread_t *thd, ap_os_thread_t *thethd, ap_pool_t *cont) - -B - - arg 1) The apr thread we are converting to. - arg 2) The os specific thread to convert - arg 3) The pool to use if it is needed. - -=cut +/** + * convert the thread from os specific type to apr type. + * @param thd The apr thread we are converting to. + * @param thethd The os specific thread to convert + * @param cont The pool to use if it is needed. */ ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_put_os_threadkey(ap_threadkey_t *key, ap_os_threadkey_t *thekey, ap_pool_t *cont) - -B - - arg 1) The apr handle we are converting to. - arg 2) The os specific handle to convert - arg 3) The pool to use if it is needed. - -=cut +/** + * convert the thread private memory key from os specific type to apr type. + * @param key The apr handle we are converting to. + * @param thekey The os specific handle to convert + * @param cont The pool to use if it is needed. */ ap_status_t ap_put_os_threadkey(ap_threadkey_t **key, ap_os_threadkey_t *thekey, ap_pool_t *cont); From f9946fd34c509fe726c982664eff67a57b5558e2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 17:08:52 +0000 Subject: [PATCH 0449/7878] Update apr_shmem.h to use ScanDoc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60424 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_shmem.h | 163 +++++++++++++++----------------------------- 1 file changed, 56 insertions(+), 107 deletions(-) diff --git a/include/apr_shmem.h b/include/apr_shmem.h index 47cf5944fe4..dd0559b1015 100644 --- a/include/apr_shmem.h +++ b/include/apr_shmem.h @@ -55,6 +55,10 @@ #ifndef APR_SHMEM_H #define APR_SHMEM_H +/** + * @package Shared Memory library + */ + #include "apr.h" #include "apr_general.h" #include "apr_errno.h" @@ -73,134 +77,80 @@ typedef key_t ap_shm_name_t; typedef struct shmem_t ap_shmem_t; -/* - -=head1 ap_status_t ap_shm_init(ap_shmem_t *m, ap_size_t reqsize, char *file) - -B - - arg 1) The shared memory block. - arg 2) The size of the shared memory pool. - arg 3) The file to use for the shared memory on platforms that - require it. - arg 4) The pool to use - -=cut +/** + * Create a pool of shared memory for use later. + * @param m The shared memory block. + * @param reqsize The size of the shared memory pool. + * @param file The file to use for the shared memory on platforms + * that require it. + * @param cont The pool to use */ ap_status_t ap_shm_init(ap_shmem_t **m, ap_size_t reqsize, const char *file, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_shm_destroy(ap_shmem_t *m) - -B - - arg 1) The shared memory block to destroy. - -=cut +/** + * Destroy the shared memory block. + * @param m The shared memory block to destroy. */ ap_status_t ap_shm_destroy(ap_shmem_t *m); -/* - -=head1 ap_status_t ap_shm_malloc(ap_shmem_t *c, ap_size_t reqsize) - -B - - arg 1) The shared memory block to destroy. - arg 2) How much memory to allocate - -=cut +/** + * allocate memory from the block of shared memory. + * @param c The shared memory block to destroy. + * @param reqsize How much memory to allocate */ void *ap_shm_malloc(ap_shmem_t *c, ap_size_t reqsize); -/* - -=head1 void *ap_shm_calloc(ap_shmem_t *shared, ap_size_t size) - -B - - arg 1) The shared memory block to destroy. - arg 2) How much memory to allocate - -=cut +/** + * allocate memory from the block of shared memory and initialize it to zero. + * @param shared The shared memory block to destroy. + * @param size How much memory to allocate */ void *ap_shm_calloc(ap_shmem_t *shared, ap_size_t size); -/* - -=head1 ap_status_t ap_shm_free(ap_shmem_t *shared, void *entity) - -B - - arg 1) The shared memory block to destroy. - -=cut +/** + * free shared memory previously allocated. + * @param shared The shared memory block to destroy. + * @param entity The actual data to free. */ -ap_status_t ap_shm_free(ap_shmem_t *shared, void *free); - -/* - -=head1 ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name) - -B - - arg 1) The shared memory block to destroy. - arg 2) The name of the shared memory block, NULL if anonymous - shared memory. - return) APR_USES_ANONYMOUS_SHM if we are using anonymous shared - memory. APR_USES_FILEBASED_SHM if our shared memory is - based on file access. APR_USES_KEYBASED_SHM if shared - memory is based on a key value such as shmctl. If the - shared memory is anonymous, the name is NULL. - -=cut +ap_status_t ap_shm_free(ap_shmem_t *shared, void *entity); + +/** + * Get the name of the shared memory segment if not using anonymous + * shared memory. + * @param c The shared memory block to destroy. + * @param name The name of the shared memory block, NULL if anonymous + * shared memory. + * @return APR_USES_ANONYMOUS_SHM if we are using anonymous shared + * memory. APR_USES_FILEBASED_SHM if our shared memory is + * based on file access. APR_USES_KEYBASED_SHM if shared + * memory is based on a key value such as shmctl. If the + * shared memory is anonymous, the name is NULL. */ ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name); -/* - -=head1 ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name) - -B This is to allow processes to open -shared memory created by another process. - - arg 1) The shared memory block to destroy. - arg 2) The name of the shared memory block, NULL if anonymous - shared memory. - return) APR_USES_ANONYMOUS_SHM if we are using anonymous shared - memory. APR_SUCCESS if we are using named shared memory - and we were able to assign the name correctly. - -=cut +/** + * Set the name of the shared memory segment if not using anonymous + * shared memory. This is to allow processes to open shared memory + * created by another process. + * @param c The shared memory block to destroy. + * @param name The name of the shared memory block, NULL if anonymous + * shared memory. + * @return APR_USES_ANONYMOUS_SHM if we are using anonymous shared + * memory. APR_SUCCESS if we are using named shared memory + * and we were able to assign the name correctly. */ ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name); -/* - -=head1 ap_status_t ap_open_shmem(ap_shmem_t *c) - -B - - arg 1) The shared memory block to open in the child. - return) This should be called after ap_set_shm_name. The ap_shmem_t - variable must refer to the memory segment to open. - -=cut +/** + * Open the shared memory block in a child process. + * @param The shared memory block to open in the child. */ ap_status_t ap_open_shmem(ap_shmem_t *c); -/* - -=head1 ap_status_t ap_shm_avail(ap_shmem_t *c, ap_size_t *size) - -B - - arg 1) The shared memory block to open in the child. - arg 2) The amount of space available in the shared memory block. - -=cut +/** + * Determine how much memory is available in the specified shared memory block + * @param c The shared memory block to open in the child. + * @param avail The amount of space available in the shared memory block. */ ap_status_t ap_shm_avail(ap_shmem_t *c, ap_size_t *avail); @@ -210,4 +160,3 @@ ap_status_t ap_shm_avail(ap_shmem_t *c, ap_size_t *avail); #endif /* ! APR_FILE_IO_H */ - From 3df1af21435ff862a6f429e6c52365eb87b604f3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 17:19:34 +0000 Subject: [PATCH 0450/7878] Update the docs in apr_strings.h to use ScanDoc. Also add Apache License to top of the file, and mention that parts of the file are covered by the other license. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60425 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 265 ++++++++++++++++++++++-------------------- 1 file changed, 139 insertions(+), 126 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index 2d1816485f3..9e0c1c37384 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -1,3 +1,58 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/* Portions of this file are covered by */ /* -*- mode: c; c-file-style: "k&r" -*- strnatcmp.c -- Perform 'natural order' comparisons of strings in C. @@ -20,6 +75,7 @@ 3. This notice may not be removed or altered from any source distribution. */ + #include "apr.h" #include "apr_lib.h" @@ -30,160 +86,117 @@ extern "C" { #endif /* __cplusplus */ -/* - -=head1 int ap_strnatcmp(char const *a, char const *b) - -B - - arg 1) The first string to compare - arg 2) The second string to compare - return) Either <0, 0, or >0. If the first string is less than the second - this returns <0, if they are equivalent it returns 0, and if the - first string is greater than second string it retuns >0. +/** + * @package APR strings library + */ -=cut +/** + * Do a natural order comparison of two strings. + * @param The first string to compare + * @param The second string to compare + * @return Either <0, 0, or >0. If the first string is less than the second + * this returns <0, if they are equivalent it returns 0, and if the + * first string is greater than second string it retuns >0. */ int ap_strnatcmp(char const *a, char const *b); -/* - -=head1 int ap_strnatcmp(char const *a, char const *b) - -B - - arg 1) The first string to compare - arg 2) The second string to compare - return) Either <0, 0, or >0. If the first string is less than the second - this returns <0, if they are equivalent it returns 0, and if the - first string is greater than second string it retuns >0. - -=cut +/** + * Do a natural order comparison of two strings ignoring the case of the + * strings. + * @param a The first string to compare + * @param b The second string to compare + * @return Either <0, 0, or >0. If the first string is less than the second + * this returns <0, if they are equivalent it returns 0, and if the + * first string is greater than second string it retuns >0. */ int ap_strnatcasecmp(char const *a, char const *b); -/* - -=head1 char *ap_pstrdup(ap_pool_t *c, const char *s) - -B - - arg 1) The pool to allocate out of - arg 2) The string to allocate - return) The new string - -=cut +/** + * duplicate a string into memory allocated out of a pool + * @param p The pool to allocate out of + * @param s The string to allocate + * @return The new string + * @deffunc char *ap_pstrdup(ap_pool_t *p, const char *s) */ APR_EXPORT(char *) ap_pstrdup(ap_pool_t *p, const char *s); -/* - -=head1 char *ap_pstrndup(ap_pool_t *c, const char *s, ap_size_t n) - -B - - arg 1) The pool to allocate out of - arg 2) The string to allocate - arg 3) The number of characters to duplicate - return) The new string - -=cut +/** + * duplicate the first n characters ofa string into memory allocated + * out of a pool + * @param p The pool to allocate out of + * @param s The string to allocate + * @param n The number of characters to duplicate + * @return The new string + * @deffunc char *ap_pstrndup(ap_pool_t *p, const char *s, ap_size_t n) */ APR_EXPORT(char *) ap_pstrndup(ap_pool_t *p, const char *s, ap_size_t n); -/* -=head1 char *ap_pstrcat(ap_pool_t *c, ...) - -B - - arg 1) The pool to allocate out of - ...) The strings to concatenate. The final string must be NULL - return) The new string - -=cut +/** + * Concatenate multiple strings, allocating memory out a pool + * @param p The pool to allocate out of + * @param ... The strings to concatenate. The final string must be NULL + * @return The new string + * @deffunc char *ap_pstrcat(ap_pool_t *p, ...) */ APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *p, ...); -/* - -=head1 char *ap_pvsprintf(ap_pool_t *c, const char *fmt, va_list ap) -B - - arg 1) The pool to allocate out of - arg 2) The format of the string - arg 3) The arguments to use while printing the data - return) The new string - -=cut +/** + * printf-style style printing routine. The data is output to a string + * allocated from a pool + * @param p The pool to allocate out of + * @param fmt The format of the string + * @param ap The arguments to use while printing the data + * @return The new string + * @deffunc char *ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) */ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap); -/* - -=head1 char *ap_psprintf(ap_pool_t *c, const char *fmt, ...) - -B - - arg 1) The pool to allocate out of - arg 2) The format of the string - ...) The arguments to use while printing the data - return) The new string - -=cut +/** + * printf-style style printing routine. The data is output to a string + * allocated from a pool + * @param p The pool to allocate out of + * @param fmt The format of the string + * @param ... The arguments to use while printing the data + * @return The new string + * @deffunc char *ap_psprintf(ap_pool_t *p, const char *fmt, ...) */ APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...); -/* - -=head1 char *ap_cpystrn(char *dst, const char *src, size_t dst_size) - -B - - arg 1) The destination string - arg 2) The source string - arg 3) The number of characters to copy - -B: We re-implement this function to implement these specific changes: - 1) strncpy() doesn't always null terminate and we want it to. - 2) strncpy() null fills, which is bogus, esp. when copy 8byte strings - into 8k blocks. - 3) Instead of returning the pointer to the beginning of the - destination string, we return a pointer to the terminating '\0' - to allow us to check for truncation. - -=cut +/** + * copy n characters from src to des> + * @param dst The destination string + * @param src The source string + * @param dst_size The number of characters to copy + * @tip + *
+ * We re-implement this function to implement these specific changes:
+ *       1) strncpy() doesn't always null terminate and we want it to.
+ *       2) strncpy() null fills, which is bogus, esp. when copy 8byte strings
+ *          into 8k blocks.
+ *       3) Instead of returning the pointer to the beginning of the
+ *          destination string, we return a pointer to the terminating '\0'
+ *          to allow us to check for truncation.
+ * 
+ * @deffunc char *ap_cpystrn(char *dst, const char *src, size_t dst_size) */ APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size); -/* - -=head1 ap_status_t ap_collapse_spaces(char *dest, const char *src) - -B - - arg 1) The destination string. It is okay to modify the string - in place. Namely dest == src - arg 2) The string to rid the spaces from. - -=cut +/** + * Strip spaces from a string + * @param dest The destination string. It is okay to modify the string + * in place. Namely dest == src + * @param src The string to rid the spaces from. + * @deffunc char *ap_collapse_spaces(char *dest, const char *src) */ APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src); -/* - -=head1 ap_status_t ap_tokenize_to_argv(const char **arg_str, char ***argv_out, a -p_pool_t *token_context) - -B - - arg 1) The arguments to convert - arg 2) Output location. This is a pointer to an array of strings. - arg 3) Pool to use. - -=cut +/** + * Convert the arguments to a program from one string to an array of + * strings term inated by a NULL + * @param str The arguments to convert + * @param argv_out Output location. This is a pointer to an array of strings. + * @param token_context Pool to use. + * @deffunc ap_status_t ap_tokenize_to_argv(const char *arg_str, char ***argv_out, ap_pool_t *token_context); */ APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, char ***argv_out, From f54175f5b66968be1c089efae7c50d943df8ba03 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 23 Jul 2000 17:24:52 +0000 Subject: [PATCH 0451/7878] Update dependencies git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60426 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/Makefile.in | 31 ++++++++++++++------------- i18n/unix/Makefile.in | 2 +- lib/Makefile.in | 41 +++++++++++------------------------- locks/unix/Makefile.in | 15 ++++++------- misc/unix/Makefile.in | 7 ++++--- network_io/unix/Makefile.in | 6 ++++-- strings/Makefile.in | 42 +++++++------------------------------ threadproc/unix/Makefile.in | 11 +++------- 8 files changed, 55 insertions(+), 100 deletions(-) diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index eef95f9b37f..379e62b286a 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -61,22 +61,23 @@ dir.o: dir.c fileio.h $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h -fileacc.o: fileacc.c fileio.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h + $(INCDIR)/apr_strings.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_dso.h +fileacc.o: fileacc.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h fileio.h \ + $(INCDIR)/apr_private.h filedup.o: filedup.c fileio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_dso.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h filestat.o: filestat.c fileio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ @@ -91,15 +92,15 @@ open.o: open.c fileio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_dso.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h pipe.o: pipe.c fileio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h readwrite.o: readwrite.c fileio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ diff --git a/i18n/unix/Makefile.in b/i18n/unix/Makefile.in index 88c6bad7d14..82cee3e0e51 100644 --- a/i18n/unix/Makefile.in +++ b/i18n/unix/Makefile.in @@ -42,4 +42,4 @@ xlate.o: xlate.c $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_xlate.h + $(INCDIR)/apr_strings.h $(INCDIR)/apr_xlate.h diff --git a/lib/Makefile.in b/lib/Makefile.in index 5e8dd631a89..b31e09a2a95 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -55,53 +55,36 @@ depend: && rm Makefile.new # DO NOT REMOVE -apr_cpystrn.o: apr_cpystrn.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h -apr_execve.o: apr_execve.c $(INCDIR)/apr_private.h -apr_fnmatch.o: apr_fnmatch.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_fnmatch.h $(INCDIR)/apr_errno.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h apr_getpass.o: apr_getpass.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h + $(INCDIR)/apr_strings.h $(INCDIR)/apr.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h apr_hash.o: apr_hash.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h $(INCDIR)/apr_hash.h -apr_md5.o: apr_md5.c $(INCDIR)/apr_private.h $(INCDIR)/apr_md5.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ +apr_md5.o: apr_md5.c $(INCDIR)/apr_private.h $(INCDIR)/apr_strings.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_xlate.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_md5.h $(INCDIR)/apr_xlate.h apr_pools.o: apr_pools.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_dso.h $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h ../misc/unix/misc.h $(INCDIR)/apr_getopt.h + $(INCDIR)/apr_dso.h $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h ../misc/unix/misc.h \ + $(INCDIR)/apr_getopt.h apr_signal.o: apr_signal.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_tables.h -apr_snprintf.o: apr_snprintf.c $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h -apr_strnatcmp.o: apr_strnatcmp.c $(INCDIR)/apr_strnatcmp.h apr_tables.o: apr_tables.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_lib.h ../misc/unix/misc.h \ - $(INCDIR)/apr_getopt.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ + ../misc/unix/misc.h $(INCDIR)/apr_getopt.h diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index 40e0aa09967..f77ee653d99 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -51,12 +51,13 @@ depend: && rm Makefile.new # DO NOT REMOVE -crossproc.o: crossproc.c ../../include/apr.h locks.h \ - ../../include/apr_private.h ../../include/apr_general.h \ - ../../include/apr_errno.h ../../include/apr_lib.h \ +crossproc.o: crossproc.c ../../include/apr.h \ + ../../include/apr_strings.h ../../include/apr_lib.h \ ../../include/apr_pools.h ../../include/apr_thread_proc.h \ - ../../include/apr_file_io.h ../../include/apr_time.h \ - ../../include/apr_tables.h ../../include/apr_lock.h + ../../include/apr_file_io.h ../../include/apr_general.h \ + ../../include/apr_errno.h ../../include/apr_time.h \ + ../../include/apr_tables.h locks.h ../../include/apr_private.h \ + ../../include/apr_lock.h intraproc.o: intraproc.c locks.h ../../include/apr.h \ ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_lib.h \ @@ -69,5 +70,5 @@ locks.o: locks.c locks.h ../../include/apr.h \ ../../include/apr_pools.h ../../include/apr_thread_proc.h \ ../../include/apr_file_io.h ../../include/apr_time.h \ ../../include/apr_tables.h ../../include/apr_lock.h \ - ../../include/apr_portable.h ../../include/apr_network_io.h \ - ../../include/apr_dso.h + ../../include/apr_strings.h ../../include/apr_portable.h \ + ../../include/apr_network_io.h ../../include/apr_dso.h diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index f5c6f8c028f..7db1ea6b650 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -61,8 +61,8 @@ errorcodes.o: errorcodes.c misc.h ../../include/apr.h \ ../../include/apr_errno.h ../../include/apr_pools.h \ ../../include/apr_thread_proc.h ../../include/apr_file_io.h \ ../../include/apr_time.h ../../include/apr_getopt.h \ - ../../include/apr_lib.h ../../include/apr_tables.h \ - ../../include/apr_dso.h + ../../include/apr_strings.h ../../include/apr_lib.h \ + ../../include/apr_tables.h ../../include/apr_dso.h getopt.o: getopt.c misc.h ../../include/apr.h \ ../../include/apr_private.h ../../include/apr_general.h \ ../../include/apr_errno.h ../../include/apr_pools.h \ @@ -86,4 +86,5 @@ start.o: start.c misc.h ../../include/apr.h \ ../../include/apr_thread_proc.h ../../include/apr_file_io.h \ ../../include/apr_time.h ../../include/apr_getopt.h \ ../../locks/unix/locks.h ../../include/apr_lib.h \ - ../../include/apr_tables.h ../../include/apr_lock.h + ../../include/apr_tables.h ../../include/apr_lock.h \ + ../../include/apr_strings.h diff --git a/network_io/unix/Makefile.in b/network_io/unix/Makefile.in index 2e372fb4e83..d509193e518 100644 --- a/network_io/unix/Makefile.in +++ b/network_io/unix/Makefile.in @@ -72,7 +72,8 @@ sockaddr.o: sockaddr.c networkio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_strings.h sockets.o: sockets.c networkio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ @@ -86,4 +87,5 @@ sockopt.o: sockopt.c networkio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_strings.h diff --git a/strings/Makefile.in b/strings/Makefile.in index 1e3ab7bad8f..d38dbd8082f 100644 --- a/strings/Makefile.in +++ b/strings/Makefile.in @@ -54,53 +54,25 @@ depend: && rm Makefile.new # DO NOT REMOVE -apr_cpystrn.o: apr_cpystrn.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ +apr_cpystrn.o: apr_cpystrn.c $(INCDIR)/apr.h $(INCDIR)/apr_strings.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h -apr_execve.o: apr_execve.c $(INCDIR)/apr_private.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_private.h apr_fnmatch.o: apr_fnmatch.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_fnmatch.h $(INCDIR)/apr_errno.h $(INCDIR)/apr.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_tables.h -apr_getpass.o: apr_getpass.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h -apr_hash.o: apr_hash.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h $(INCDIR)/apr_hash.h -apr_md5.o: apr_md5.c $(INCDIR)/apr_private.h $(INCDIR)/apr_md5.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_xlate.h -apr_pools.o: apr_pools.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_dso.h $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h ../misc/unix/misc.h $(INCDIR)/apr_getopt.h -apr_signal.o: apr_signal.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h apr_snprintf.o: apr_snprintf.c $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_tables.h +apr_strings.o: apr_strings.c $(INCDIR)/apr.h $(INCDIR)/apr_strings.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_private.h apr_strnatcmp.o: apr_strnatcmp.c $(INCDIR)/apr_strnatcmp.h -apr_tables.o: apr_tables.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_lib.h ../misc/unix/misc.h \ - $(INCDIR)/apr_getopt.h diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index 18df47393d5..81ff6fedc1d 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -59,8 +59,9 @@ proc.o: proc.c threadproc.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h + $(INCDIR)/apr_strings.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_dso.h procsup.o: procsup.c threadproc.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ @@ -81,12 +82,6 @@ thread.o: thread.c $(INCDIR)/apr.h $(INCDIR)/apr_portable.h \ $(INCDIR)/apr_private.h ../../file_io/unix/fileio.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_tables.h -threadcancel.o: threadcancel.c threadproc.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h threadpriv.o: threadpriv.c $(INCDIR)/apr.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ From c26345d7c71d013e8f3bbef90c637f7ffd5df692 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 17:31:08 +0000 Subject: [PATCH 0452/7878] Remove apr_strnatcmp.h. All of the functions prototyped in this file have been moved to apr_strings.h. This also modifes Apache to include apr_strings.h instead of apr_strnatcmp.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60427 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strnatcmp.h | 66 ----------------------------------------- strings/apr_strnatcmp.c | 2 +- 2 files changed, 1 insertion(+), 67 deletions(-) delete mode 100644 include/apr_strnatcmp.h diff --git a/include/apr_strnatcmp.h b/include/apr_strnatcmp.h deleted file mode 100644 index fd0f93016dd..00000000000 --- a/include/apr_strnatcmp.h +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- mode: c; c-file-style: "k&r" -*- - - strnatcmp.c -- Perform 'natural order' comparisons of strings in C. - Copyright (C) 2000 by Martin Pool - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef APR_STRNATCMP_H -#define APR_STRNATCMP_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* - -=head1 int ap_strnatcmp(char const *a, char const *b) - -B - - arg 1) The first string to compare - arg 2) The second string to compare - return) Either <0, 0, or >0. If the first string is less than the second - this returns <0, if they are equivalent it returns 0, and if the - first string is greater than second string it retuns >0. - -=cut - */ -int ap_strnatcmp(char const *a, char const *b); - -/* - -=head1 int ap_strnatcmp(char const *a, char const *b) - -B - - arg 1) The first string to compare - arg 2) The second string to compare - return) Either <0, 0, or >0. If the first string is less than the second - this returns <0, if they are equivalent it returns 0, and if the - first string is greater than second string it retuns >0. - -=cut - */ -int ap_strnatcasecmp(char const *a, char const *b); - -#ifdef __cplusplus -} -#endif - -#endif /* !APR_STRNATCMP_H */ diff --git a/strings/apr_strnatcmp.c b/strings/apr_strnatcmp.c index ea29fd1778d..8eeaf41cd50 100644 --- a/strings/apr_strnatcmp.c +++ b/strings/apr_strnatcmp.c @@ -25,7 +25,7 @@ #include #include -#include "apr_strnatcmp.h" +#include "apr_strings.h" #if defined(__GNUC__) # define UNUSED __attribute__((__unused__)) From 3613ce101e929f9f9d1b67aed9004a5621b04501 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 17:51:11 +0000 Subject: [PATCH 0453/7878] Update apr_threadproc.h to use ScanDoc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60428 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 634 ++++++++++++++------------------------ 1 file changed, 223 insertions(+), 411 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 6697e19c31c..b04664c2218 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -67,6 +67,10 @@ extern "C" { #endif /* __cplusplus */ +/** + * @package APR Thread library + */ + typedef enum {APR_SHELLCMD, APR_PROGRAM} ap_cmdtype_e; typedef enum {APR_WAIT, APR_NOWAIT} ap_wait_how_e; @@ -115,549 +119,357 @@ typedef void *(APR_THREAD_FUNC *ap_thread_start_t)(void *); /* Thread Function definitions */ -/* - -=head1 ap_status_t ap_create_threadattr(ap_threadattr_t **new_attr, ap_pool_t *cont) - -B - - arg 1) The newly created threadattr. - arg 2) The pool to use - -=cut +/** + * Create and initialize a new threadattr variable + * @param new_attr The newly created threadattr. + * @param cont The pool to use */ ap_status_t ap_create_threadattr(ap_threadattr_t **new_attr, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) - -B - - arg 1) The threadattr to affect - arg 2) Thread detach state on or off - -=cut +/** + * Set if newly created threads should be created in detach mode. + * @param attr The threadattr to affect + * @param on Thread detach state on or off */ ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on); -/* - -=head1 ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) - -B - - arg 1) The threadattr to reference - -=cut +/** + * Get the detach mode for this threadattr. + * @param attr The threadattr to reference */ ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr); -/* - -=head1 ap_status_t ap_create_thread(ap_thread_t **new_thread, ap_threadattr_t *attr, ap_thread_start_t func, void *data, ap_pool_t *cont) - -B - - arg 1) The newly created thread handle. - arg 2) The threadattr to use to determine how to create the thread - arg 3) The function to start the new thread in - arg 4) Any data to be passed to the starting function - arg 5) The pool to use - -=cut +/** + * Create a new thread of execution + * @param new_thread The newly created thread handle. + * @param attr The threadattr to use to determine how to create the thread + * @param func The function to start the new thread in + * @param data Any data to be passed to the starting function + * @param cont The pool to use */ ap_status_t ap_create_thread(ap_thread_t **new_thread, ap_threadattr_t *attr, ap_thread_start_t func, void *data, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) - -B - - arg 1) The thread to stop - arg 2) The return value to pass back to any thread that cares - -=cut +/** + * stop the current thread + * @param thd The thread to stop + * @param retval The return value to pass back to any thread that cares */ ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval); -/* - -=head1 ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) - -B - - arg 1) The return value from the dead thread. - arg 2) The thread to join - -=cut +/** + * block until the desired thread stops executing. + * @param retval The return value from the dead thread. + * @param thd The thread to join */ ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd); -/* - -=head1 ap_status_t ap_thread_detach(ap_thread_t *thd) - -B - - arg 1) The thread to detach - -=cut +/** + * detach a thread + * @param thd The thread to detach */ ap_status_t ap_thread_detach(ap_thread_t *thd); -/* - -=head1 ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread) - -B - - arg 1) The user data associated with the thread. - arg 2) The key to associate with the data - arg 3) The currently open thread. - -=cut +/** + * Return the pool associated with the current thread. + * @param data The user data associated with the thread. + * @param key The key to associate with the data + * @param thread The currently open thread. */ ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread); -/* - -=head1 ap_status_t ap_set_threaddata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_thread_t *thread) - -B - - arg 1) The user data to associate with the thread. - arg 2) The key to use for associating the data with the tread - arg 3) The cleanup routine to use when the thread is destroyed. - arg 4) The currently open thread. - -=cut +/** + * Return the pool associated with the current thread. + * @param data The user data to associate with the thread. + * @param key The key to use for associating the data with the tread + * @param cleanup The cleanup routine to use when the thread is destroyed. + * @param thread The currently open thread. */ ap_status_t ap_set_threaddata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_thread_t *thread); -/* - -=head1 ap_status_t ap_create_thread_private(ap_threadkey_t **key, void (*dest)(void *), ap_pool_t *cont) - -B - - arg 1) The thread private handle. - arg 2) The destructor to use when freeing the private memory. - arg 3) The pool to use - -=cut +/** + * Create and initialize a new thread private address space + * @param key The thread private handle. + * @param dest The destructor to use when freeing the private memory. + * @param cont The pool to use */ ap_status_t ap_create_thread_private(ap_threadkey_t **key, void (*dest)(void *), ap_pool_t *cont); -/* - -=head1 ap_status_t ap_get_thread_private(void **new_mem, ap_threadkey_t *key) - -B - - arg 1) The data stored in private memory - arg 2) The handle for the desired thread private memory - -=cut +/** + * Get a pointer to the thread private memory + * @param new_mem The data stored in private memory + * @param key The handle for the desired thread private memory */ ap_status_t ap_get_thread_private(void **new_mem, ap_threadkey_t *key); -/* - -=head1 ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) - -B - - arg 1) The data to be stored in private memory - arg 2) The handle for the desired thread private memory - -=cut +/** + * Set the data to be stored in thread private memory + * @param priv The data to be stored in private memory + * @param key The handle for the desired thread private memory */ ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key); -/* - -=head1 ap_status_t ap_delete_thread_private(ap_threadkey_t *key) - -B - - arg 1) The handle for the desired thread private memory - -=cut +/** + * Free the thread private memory + * @param key The handle for the desired thread private memory */ ap_status_t ap_delete_thread_private(ap_threadkey_t *key); -/* - -=head1 ap_status_t ap_get_threadkeydata(void **data, const char *key, ap_threadkey_t *threadkey) - -B - - arg 1) The user data associated with the threadkey. - arg 2) The key associated with the data - arg 3) The currently open threadkey. - -=cut +/** + * Return the pool associated with the current threadkey. + * @param data The user data associated with the threadkey. + * @param key The key associated with the data + * @param threadkey The currently open threadkey. */ ap_status_t ap_get_threadkeydata(void **data, const char *key, ap_threadkey_t *threadkey); -/* - -=head1 ap_status_t ap_set_threadkeydata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_threadkey_t *threadkey) - -B - - arg 1) The data to set. - arg 2) The key to associate with the data. - arg 3) The cleanup routine to use when the file is destroyed. - arg 4) The currently open threadkey. - -=cut +/** + * Return the pool associated with the current threadkey. + * @param data The data to set. + * @param key The key to associate with the data. + * @param cleanup The cleanup routine to use when the file is destroyed. + * @param threadkey The currently open threadkey. */ ap_status_t ap_set_threadkeydata(void *data, const char *key, ap_status_t (*cleanup) (void *), ap_threadkey_t *threadkey); /* Process Function definitions */ -/* - -=head1 ap_status_t ap_createprocattr_init(ap_procattr_t **new_attr, ap_pool_t *cont) -B - - arg 1) The newly created procattr. - arg 2) The pool to use +/** + * @package APR Process library + */ -=cut +/** + * Create and initialize a new procattr variable + * @param new_attr The newly created procattr. + * @param cont The pool to use */ ap_status_t ap_createprocattr_init(ap_procattr_t **new_attr, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, ap_int32_t out, ap_int32_t err) - -B - - arg 1) The procattr we care about. - arg 2) Should stdin be a pipe back to the parent? - arg 3) Should stdout be a pipe back to the parent? - arg 4) Should stderr be a pipe back to the parent? - -=cut +/** + * Determine if any of stdin, stdout, or stderr should be linked to pipes + * when starting a child process. + * @param attr The procattr we care about. + * @param in Should stdin be a pipe back to the parent? + * @param out Should stdout be a pipe back to the parent? + * @param err Should stderr be a pipe back to the parent? */ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, ap_int32_t out, ap_int32_t err); -/* - -=head1 ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in, ap_file_t *parent_in) - -B - - arg 1) The procattr we care about. - arg 2) ap_file_t value to use as child_in. Must be a valid file. - arg 3) ap_file_t value to use as parent_in. Must be a valid file. - -B: This is NOT a required initializer function. This is - useful if you have already opened a pipe (or multiple files) - that you wish to use, perhaps persistently across mutiple - process invocations - such as a log file. You can save some - extra function calls by not creating your own pipe since this - creates one in the process space for you. - -=cut +/** + * Set the child_in and/or parent_in values to existing ap_file_t values. + * @param attr The procattr we care about. + * @param child_in ap_file_t value to use as child_in. Must be a valid file. + * @param parent_in ap_file_t value to use as parent_in. Must be a valid file. + * @tip This is NOT a required initializer function. This is + * useful if you have already opened a pipe (or multiple files) + * that you wish to use, perhaps persistently across mutiple + * process invocations - such as a log file. You can save some + * extra function calls by not creating your own pipe since this + * creates one in the process space for you. */ ap_status_t ap_setprocattr_childin(struct ap_procattr_t *attr, ap_file_t *child_in, ap_file_t *parent_in); -/* - -=head1 ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, ap_file_t *child_out, ap_file_t *parent_out) - -B - - arg 1) The procattr we care about. - arg 2) ap_file_t value to use as child_out. Must be a valid file. - arg 3) ap_file_t value to use as parent_out. Must be a valid file. - -B: This is NOT a required initializer function. This is - useful if you have already opened a pipe (or multiple files) - that you wish to use, perhaps persistently across mutiple - process invocations - such as a log file. - -=cut +/** + * Set the child_out and parent_out values to existing ap_file_t values. + * @param attr The procattr we care about. + * @param child_out ap_file_t value to use as child_out. Must be a valid file. + * @param parent_out ap_file_t value to use as parent_out. Must be a valid file. + * @tip This is NOT a required initializer function. This is + * useful if you have already opened a pipe (or multiple files) + * that you wish to use, perhaps persistently across mutiple + * process invocations - such as a log file. */ ap_status_t ap_setprocattr_childout(struct ap_procattr_t *attr, ap_file_t *child_out, ap_file_t *parent_out); -/* - -=head1 ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err, ap_file_t *parent_err) - -B - - arg 1) The procattr we care about. - arg 2) ap_file_t value to use as child_err. Must be a valid file. - arg 3) ap_file_t value to use as parent_err. Must be a valid file. - -B: This is NOT a required initializer function. This is - useful if you have already opened a pipe (or multiple files) - that you wish to use, perhaps persistently across mutiple - process invocations - such as a log file. - -=cut +/** + * Set the child_err and parent_err values to existing ap_file_t values. + * @param attr The procattr we care about. + * @param child_err ap_file_t value to use as child_err. Must be a valid file. + * @param parent_err ap_file_t value to use as parent_err. Must be a valid file. + * @tip This is NOT a required initializer function. This is + * useful if you have already opened a pipe (or multiple files) + * that you wish to use, perhaps persistently across mutiple + * process invocations - such as a log file. */ ap_status_t ap_setprocattr_childerr(struct ap_procattr_t *attr, ap_file_t *child_err, ap_file_t *parent_err); -/* - -=head1 ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, constchar *dir) - -B - - arg 1) The procattr we care about. - arg 2) Which dir to start in. By default, this is the same dir as - the parent currently resides in, when the createprocess call - is made. - -=cut +/** + * Set which directory the child process should start executing in. + * @param attr The procattr we care about. + * @param dir Which dir to start in. By default, this is the same dir as + * the parent currently resides in, when the createprocess call + * is made. */ ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, const char *dir); -/* - -=head1 ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, ap_cmdtype_e cmd) - -B - - arg 1) The procattr we care about. - arg 2) The type of command. One of: - APR_SHELLCMD -- Shell script - APR_PROGRAM -- Executable program (default) - -=cut +/** + * Set what type of command the child process will call. + * @param attr The procattr we care about. + * @param cmd The type of command. One of: + *
+ *            APR_SHELLCMD --  Shell script
+ *            APR_PROGRAM  --  Executable program   (default) 
+ * 
*/ ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, ap_cmdtype_e cmd); -/* - -=head1 ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach) - -B - - arg 1) The procattr we care about. - arg 2) Should the child start in detached state? Default is no. - -=cut +/** + * Determine if the chlid should start in detached state. + * @param attr The procattr we care about. + * @param detach Should the child start in detached state? Default is no. */ ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach); #if APR_HAVE_STRUCT_RLIMIT -/* - -=head1 ap_status_t ap_setprocattr_limit(ap_procattr_t *attr, ap_int32_t what, struct rlimit *limit) - -B - - arg 1) The procattr we care about. - arg 2) Which limit to set, one of: - APR_LIMIT_CPU - APR_LIMIT_MEM - APR_LIMIT_NPROC - arg 3) Value to set the limit to. - -=cut +/** + * Set the Resource Utilization limits when starting a new process. + * @param attr The procattr we care about. + * @param what Which limit to set, one of: + *
+ *                 APR_LIMIT_CPU
+ *                 APR_LIMIT_MEM
+ *                 APR_LIMIT_NPROC
+ * 
+ * @param limit Value to set the limit to. */ ap_status_t ap_setprocattr_limit(ap_procattr_t *attr, ap_int32_t what, struct rlimit *limit); #endif #if APR_HAS_FORK -/* - -=head1 ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) - -B - - arg 1) The resulting process handle. - arg 2) The pool to use. - -=cut +/** + * This is currently the only non-portable call in APR. This executes + * a standard unix fork. + * @param proc The resulting process handle. + * @param cont The pool to use. */ ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont); #endif -/* - -=head1 ap_status_t ap_create_process(ap_proc_t *new_proc, const char *progname, char *const args[], char **env, ap_procattr_t *attr, ap_pool_t *cont) - -B - - arg 1) The resulting process handle. - arg 2) The program to run - arg 3) the arguments to pass to the new program. The first one should - be the program name. - arg 4) The new environment ap_table_t for the new process. This should be a - list of NULL-terminated strings. - arg 5) the procattr we should use to determine how to create the new - process - arg 6) The pool to use. - -=cut +/** + * Create a new process and execute a new program within that process. + * @param new_proc The resulting process handle. + * @param progname The program to run + * @param const_args the arguments to pass to the new program. The first + * one should be the program name. + * @param env The new environment ap_table_t for the new process. This + * should be a list of NULL-terminated strings. + * @param attr the procattr we should use to determine how to create the new + * process + * @param cont The pool to use. */ ap_status_t ap_create_process(ap_proc_t *new_proc, const char *progname, char *const args[], char **env, ap_procattr_t *attr, ap_pool_t *cont); -/* - -=head1 ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how waithow) - -B - - arg 1) The process handle that corresponds to the desired child process - arg 2) How should we wait. One of: - APR_WAIT -- block until the child process dies. - APR_NOWAIT -- return immediately regardless of if the - child is dead or not. - -B: The childs status is in the return code to this process. It is - one of: - APR_CHILD_DONE -- child is no longer running. - APR_CHILD_NOTDONE -- child is still running. - -=cut +/** + * Wait for a child process to die + * @param proc The process handle that corresponds to the desired child process + * @param waithow How should we wait. One of: + *
+ *            APR_WAIT   -- block until the child process dies.
+ *            APR_NOWAIT -- return immediately regardless of if the 
+ *                          child is dead or not.
+ * 
+ * @tip The childs status is in the return code to this process. It is one of: + *
+ *            APR_CHILD_DONE     -- child is no longer running.
+ *            APR_CHILD_NOTDONE  -- child is still running.
+ * 
*/ ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e waithow); -/* - -=head1 ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, ap_wait_how waithow, ap_pool_t *p) - -B - - arg 1) Pointer to NULL on entry, will be filled out with child's - information - arg 2) The returned exit status of the child, if a child process dies - On platforms that don't support obtaining this information, the - status parameter will be returned as APR_ENOTIMPL. - arg 3) How should we wait. One of: - APR_WAIT -- block until the child process dies. - APR_NOWAIT -- return immediately regardless of if the - child is dead or not. - arg 4) Pool to allocate child information out of. - -=cut +/** + * Wait for any current child process to die and return information + * about that child. + * @param proc Pointer to NULL on entry, will be filled out with child's + * information + * @param status The returned exit status of the child, if a child process dies + * On platforms that don't support obtaining this information, + * the status parameter will be returned as APR_ENOTIMPL. + * @param waithow How should we wait. One of: + *
+ *            APR_WAIT   -- block until the child process dies.
+ *            APR_NOWAIT -- return immediately regardless of if the 
+ *                          child is dead or not.
+ * 
+ * @param p Pool to allocate child information out of. */ ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, ap_wait_how_e waithow, ap_pool_t *p); -/* - -=head1 ap_status_t ap_detach(void) - -B - -=cut +/** + * Detach the process from the controlling terminal. */ ap_status_t ap_detach(void); #if APR_HAS_OTHER_CHILD -/* - -=head1 void ap_register_other_child(ap_proc_t *pid, void (*maintenance) (int reason, void *data, int status), void *data, ap_file_t *write_fd, ap_pool_t *p) - -B - - arg 1) pid is the pid of the child. - arg 2) maintenance is a function that is invoked with a reason and the - data pointer passed here. - arg 3) The data to pass to the maintenance function. - arg 4) An fd that is probed for writing. If it is ever unwritable - then the maintenance is invoked with reason OC_REASON_UNWRITABLE. - arg 5) The pool to use for allocating memory. - -=cut - */ -/* XXX: it's not clear how write_fd can be made portable -- i think this - * needs to take an ap_file_t, expecting the write_fd to be a pipe. -dean +/** + * Register an other_child -- a child which must be kept track of so + * that the program knows when it has dies or disappeared. + * @param pid pid is the pid of the child. + * @param maintenance maintenance is a function that is invoked with a + * reason and the data pointer passed here. + * @param data The data to pass to the maintenance function. + * @param write_fd An fd that is probed for writing. If it is ever unwritable + * then the maintenance is invoked with reason + * OC_REASON_UNWRITABLE. + * @param p The pool to use for allocating memory. */ void ap_register_other_child(ap_proc_t *pid, void (*maintenance) (int reason, void *, int status), void *data, ap_file_t *write_fd, ap_pool_t *p); -/* - -=head1 void ap_unregister_other_child(void *data) - -B - - arg 1) The data to pass to the maintenance function. This is - used to find the process to unregister. - -B: Since this can be called by a maintenance function while we're - scanning the other_children list, all scanners should protect - themself by loading ocr->next before calling any maintenance - function. - -=cut +/** + * Stop watching the specified process. + * @param data The data to pass to the maintenance function. This is + * used to find the process to unregister. + * @tip Since this can be called by a maintenance function while we're + * scanning the other_children list, all scanners should protect + * themself by loading ocr->next before calling any maintenance + * function. */ void ap_unregister_other_child(void *data); -/* - -=head1 ap_status_t ap_reap_other_child(ap_proc_t *pid, int status) - -B - - arg 1) The process to check. - -=cut +/** + * Check on the specified process. If it is gone, call the maintenance + * function. + * @param pid The process to check. + * @param status The status to pass to the maintenance function. */ ap_status_t ap_reap_other_child(ap_proc_t *pid, int status); -/* - -=head1 void ap_check_other_child(void) - -B - -=cut +/** + * Loop through all registered other_children and call the appropriate + * maintenance function when necessary. */ void ap_check_other_child(void); -/* - -=head1 void ap_probe_writable_fds(void) - -B - -=cut +/** + * Ensure all the registered write_fds are still writable, otherwise + * invoke the maintenance functions as appropriate. */ void ap_probe_writable_fds(void); #endif /* APR_HAS_OTHER_CHILD */ -/* - -=head1 ap_status_t ap_kill(ap_proc_t *proc, int sig) - -B - - arg 1) The process to terminate. - arg 2) How to kill the process. - -=cut +/** + * Terminate a process. + * @param proc The process to terminate. + * @param sig How to kill the process. */ ap_status_t ap_kill(ap_proc_t *proc, int sig); #ifdef __cplusplus From 6df02f5cabd04ffeadca6340e8510361c18d70fa Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 18:00:19 +0000 Subject: [PATCH 0454/7878] Update apr_time.h to use ScanDoc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60429 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 117 ++++++++++++++++++++------------------------- 1 file changed, 51 insertions(+), 66 deletions(-) diff --git a/include/apr_time.h b/include/apr_time.h index 218553072c2..d4adbe5098c 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -62,6 +62,10 @@ extern "C" { #endif /* __cplusplus */ +/** + * @package APR Time library + */ + APR_VAR_IMPORT const char ap_month_snames[12][4]; APR_VAR_IMPORT const char ap_day_snames[7][4]; @@ -83,13 +87,8 @@ typedef ap_int32_t ap_interval_time_t; #define AP_USEC_PER_SEC (1000000LL) #endif -/* - -=head1 ap_time_t ap_now(void) - -B - -=cut +/** + * return the current time */ ap_time_t ap_now(void); @@ -111,86 +110,72 @@ typedef struct { ap_int32_t tm_gmtoff; /* seconds east of UTC */ } ap_exploded_time_t; -/* - -=head1 ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input) - -B - - arg 1) the resulting ap_time_t - arg 2) the time_t to convert - -=cut +/** + * convert an ansi time_t to an ap_time_t + * @param result the resulting ap_time_t + * @param input the time_t to convert */ ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input); -/* - -=head1 ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input) - -B - - arg 1) the exploded time - arg 2) the time to explode - -=cut +/** + * convert a time to its human readable components in GMT timezone + * @param result the exploded time + * @param input the time to explode */ ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input); -/* - -=head1 ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input) - -B - - arg 1) the exploded time - arg 2) the time to explode - -=cut +/** + * convert a time to its human readable components in local timezone + * @param result the exploded time + * @param input the time to explode */ ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input); -/* - -=head1 ap_status_t ap_implode_time(ap_time_t *t, ap_exploded_time_t *xt) - -B - - arg 1) the resulting imploded time - arg 2) the input exploded time - -=cut +/** + * Convert time value from human readable format to number of seconds + * since epoch + * @param result the resulting imploded time + * @param input the input exploded time */ ap_status_t ap_implode_time(ap_time_t *result, ap_exploded_time_t *input); -/* - -=head1 void ap_sleep(ap_interval_time_t t) - -B - - arg 1) desired amount of time to sleep. - -B: May sleep for longer than the specified time. - -=cut +/** + * Sleep for the specified number of micro-seconds. + * @param t desired amount of time to sleep. + * @tip May sleep for longer than the specified time. */ void ap_sleep(ap_interval_time_t t); -/* ap_rfc822_date formats dates in the RFC822 - format in an efficient manner. it is a fixed length - format and requires the indicated amount of storage - including trailing \0 */ #define AP_RFC822_DATE_LEN (30) +/** + * ap_rfc822_date formats dates in the RFC822 + * format in an efficient manner. it is a fixed length + * format and requires the indicated amount of storage + * including trailing \0 + * @param date_str String to write to. + * @param t the time to convert + */ ap_status_t ap_rfc822_date(char *date_str, ap_time_t t); -/* ap_ctime formats dates in the ctime() format - in an efficient manner. it is a fixed length format - and requires the indicated amount of storage - including trailing \0 */ #define AP_CTIME_LEN (25) +/** + * ap_ctime formats dates in the ctime() format + * in an efficient manner. it is a fixed length format + * and requires the indicated amount of storage + * including trailing \0 + * @param date_str String to write to. + * @param t the time to convert + */ ap_status_t ap_ctime(char *date_str, ap_time_t t); +/** + * formats the exploded time according to the format specified + * @param s string to write to + * @param retsize The length of the returned string + * @param max The maximum length of the string + * @param format The format for the time string + * @param tm The time to convert + */ ap_status_t ap_strftime(char *s, ap_size_t *retsize, ap_size_t max, const char *format, ap_exploded_time_t *tm); #ifdef __cplusplus From d5d9e83f4df8ed7c5b1b03a92c684cad416e23b5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 18:07:18 +0000 Subject: [PATCH 0455/7878] Update apr_xlate.h to use ScanDoc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60430 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_xlate.h | 130 +++++++++++++++++++------------------------- 1 file changed, 55 insertions(+), 75 deletions(-) diff --git a/include/apr_xlate.h b/include/apr_xlate.h index 0a7a8a71052..4d0f5bdfe35 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -64,6 +64,10 @@ extern "C" { #endif /* __cplusplus */ +/** + * @package APR I18N translation library + */ + /* APR_HAS_XLATE determines whether or not useful implementations of * ap_xlate_open() et al are provided. * @@ -100,30 +104,26 @@ typedef void ap_xlate_t; typedef struct ap_xlate_t ap_xlate_t; -/* - -=head1 ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, const char *frompage, ap_pool_t *pool) - -B - - arg 1) The handle to be filled in by this function - arg 2) The name of the target charset - arg 3) The name of the source charset - arg 4) The pool to use - -B: Specify APR_DEFAULT_CHARSET for one of the charset - names to indicate the charset of the source code at - compile time. This is useful if there are literal - strings in the source code which must be translated - according to the charset of the source code. - APR_DEFAULT_CHARSET is not useful if the source code - of the caller was not encoded in the same charset as - APR at compile time. - - Specify APR_LOCALE_CHARSET for one of the charset - names to indicate the charset of the current locale. - -=cut +/** + * Set up for converting text from one charset to another. + * @param convset The handle to be filled in by this function + * @param topage The name of the target charset + * @param frompage The name of the source charset + * @param pool The pool to use + * @tip + *
+ *  Specify APR_DEFAULT_CHARSET for one of the charset
+ *  names to indicate the charset of the source code at
+ *  compile time.  This is useful if there are literal
+ *  strings in the source code which must be translated
+ *  according to the charset of the source code.
+ *  APR_DEFAULT_CHARSET is not useful if the source code
+ *  of the caller was not encoded in the same charset as
+ *  APR at compile time.
+ *
+ *  Specify APR_LOCALE_CHARSET for one of the charset
+ *  names to indicate the charset of the current locale.
+ * 
*/ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, const char *frompage, ap_pool_t *pool); @@ -131,74 +131,54 @@ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, #define APR_DEFAULT_CHARSET (const char *)0 #define APR_LOCALE_CHARSET (const char *)1 -/* - -=head1 ap_status_t ap_xlate_get_sb(ap_xlate_t *convset, int *onoff) - -B - - arg 1) The handle allocated by ap_xlate_open, specifying the parameters - of conversion - arg 2) Output: whether or not the conversion is single-byte-only - -=cut +/** + * Find out whether or not the specified conversion is single-byte-only. + * @param convset The handle allocated by ap_xlate_open, specifying the + * parameters of conversion + * @param onoff Output: whether or not the conversion is single-byte-only */ ap_status_t ap_xlate_get_sb(ap_xlate_t *convset, int *onoff); -/* - -=head1 ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, ap_size_t *inbytes_left, char *outbuf, ap_size_t outbytes_left) - -B - - arg 1) The handle allocated by ap_xlate_open, specifying the parameters - of conversion - arg 2) The address of the source buffer - arg 3) Input: the amount of input data to be translated - Output: the amount of input data not yet translated - arg 4) The address of the destination buffer - arg 5) Input: the size of the output buffer - Output: the amount of the output buffer not yet used - -=cut +/** + * Convert a buffer of text from one codepage to another. + * @param convset The handle allocated by ap_xlate_open, specifying + * the parameters of conversion + * @param inbuf The address of the source buffer + * @param inbytes_left Input: the amount of input data to be translated + * Output: the amount of input data not yet translated + * @param outbuf The address of the destination buffer + * @param outbytes_left Input: the size of the output buffer + * Output: the amount of the output buffer not yet used */ ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, ap_size_t *inbytes_left, char *outbuf, ap_size_t *outbytes_left); -/* The purpose of ap_xlate_conv_char is to translate one character +/** + * The purpose of ap_xlate_conv_char is to translate one character * at a time. This needs to be written carefully so that it works * with double-byte character sets. + * @param convset The handle allocated by ap_xlate_open, specifying the + * parameters of conversion + * @param inchar The character to convert + * @param outchar The converted character */ ap_status_t ap_xlate_conv_char(ap_xlate_t *convset, char inchar, char outchar); -/* - -=head1 ap_int32_t ap_xlate_conv_byte(ap_xlate_t *convset, unsigned char inchar) - -B - - arg 1) The handle allocated by ap_xlate_open, specifying the parameters - of conversion - arg 2) The single-byte character to convert. - -B: This only works when converting between single-byte character sets. - -1 will be returned if the conversion can't be performed. - -=cut +/** + * Convert a single-byte character from one charset to another. + * @param convset The handle allocated by ap_xlate_open, specifying the + * parameters of conversion + * @param inchar The single-byte character to convert. + * @tip This only works when converting between single-byte character sets. + -1 will be returned if the conversion can't be performed. */ ap_int32_t ap_xlate_conv_byte(ap_xlate_t *convset, unsigned char inchar); -/* - -=head1 ap_status_t ap_xlate_close(ap_xlate_t *convset) - -B - - arg 1) The codepage translation handle to close - -=cut +/** + * Close a codepage translation handle. + * @param convset The codepage translation handle to close */ ap_status_t ap_xlate_close(ap_xlate_t *convset); From 0b34fd08d37f8f4c6bd791db0e664f60b12eb098 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 18:11:14 +0000 Subject: [PATCH 0456/7878] Add scandoc and the default template to APR's helpers directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60431 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/default.pl | 488 ++++++++++++++++ helpers/scandoc | 1325 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1813 insertions(+) create mode 100644 helpers/default.pl create mode 100755 helpers/scandoc diff --git a/helpers/default.pl b/helpers/default.pl new file mode 100644 index 00000000000..3cd9eb50add --- /dev/null +++ b/helpers/default.pl @@ -0,0 +1,488 @@ +<< +# Scandoc template file. +# +# This is an example set of templates that is designed to create several +# different kinds of index files. It generates a "master index" which intended +# for use with a frames browser; A "package index" which is the root page of +# the index, and then "package files" containing documentation for all of the +# classes within a single package. + +###################################################################### + +## For quick and superficial customization, +## simply change these variables + +$project_name = '[My Project]'; +$company_logo = ''; # change this to an image tag. +$copyright = '© 2000 [My Name]'; +$image_directory = "../images/"; +$bullet1_image = $image_directory . "ball1.gif"; +$bullet2_image = $image_directory . "ball2.gif"; +$bgcolor1 = "#FFFFFF"; +$bgcolor2 = "#FFFFFF"; + +###################################################################### + +## Begin generating frame index file. + +file "index.html"; +>> + + + $project_name + + + + + + <body bgcolor="$bgcolor2" stylesrc="index.html"> + <p>Some Documentation</p> + </body> + + + +<< + +###################################################################### + +## Begin generating master index file (left-hand frame). + +file "master.html"; +>> + + Master Index + + +
+

+ Master Index +

+

+ + +<< + +## For each package, generate an index entry. + +foreach $p (packages()) { + >>$(p.name)
+

+ << + foreach $e ($p->classes()) { + >>
  • $(e.fullname) + << + } + foreach $e ($p->globals()) { + >>
  • $(e.fullname) + << + } + >>
  • << +} + +>> + To-Do List
    +
    +
    +

    + + +<< + +###################################################################### + +## Begin generating package index file + +file "packages.html"; +>> + + $project_name -- Packages + + + +
    $company_logo +

    Documentation for $project_name

    +
    +

    Package List

    +<< + +## For each package, generate an index entry. + +foreach $p (packages()) { + >>$(p.name)
    + << +} + +>> +

    +


    + $copyright
    + Generated by ScanDoc $majorVersion.$minorVersion
    + Last Updated: $date
    + + + +<< + +###################################################################### + +## Generate "To-do list" + +file "to-do.html"; +>> + + $project_name -- To-Do list + + + + $company_logo + +

    To-do list for $project_name

    +<< + +if (&todolistFiles()) { + >>

    + << + foreach $f (&todolistFiles()) { + my @m = &todolistEntries( $f ); + if ($f =~ /([^\/]+)$/) { $f = $1; } + >>$f:

      + << + foreach $text (@m) { + if ($text) { + print "
    • ", &processDescription( $text ), "\n"; + } + } + >>
    + << + } +} + +>> +
    + $copyright
    + Generated by ScanDoc $majorVersion.$minorVersion
    + Last Updated: $date
    + + +<< + +###################################################################### + +## Generate individual files for each package. + +my $p; +foreach $p (packages()) { + file $p->name() . ".html"; + >> + + $project_name -- $(p.name) + + +
    + $project_name +

    +

    + +

    Package Name: $(p.name)

    + +<< + +## Generate class and member index at the top of the file. + +foreach $c ($p->classes()) { + >>

    + $(c.fullname)

    +
      + << + foreach $m ($c->members()) { + >>
    • $(m.longname) + << + } + >>
    + << +} + +>> +
    +<< + +## Generate detailed class documentation +foreach $c ($p->classes()) { + ## Output searchable keyword list + if ($c->keywords()) { + print "\n"; + } + + >>
    + +

    $(c.fullname)

    + + + + + << + + # Output author tag + if ($c->author()) { + >><< + >><< + } + + # Output package version + if ($c->version()) { + >><< + >><< + } + + # Output Source file + if ($c->sourcefile()) { + >><< + >><< + } + + # Output base class list + if ($c->baseclasses()) { + >> + + << + } + + # Output subclasses list + if ($c->subclasses()) { + >> + << + } + + # Output main class description + >> +
    +
    Author:$(c.author)
    Version:$(c.version)
    Source:$(c.sourcefile)
    Base classes:<< + my @t = (); + foreach $b ($c->baseclasses()) { + my $name = $b->name(); + if ($url = $b->url()) { + push @t, "$name"; + } + else { push @t, $name; } + } + print join( ', ', @t ); + >>
    Subclasses:<< + my @t = (); + foreach $s ($c->subclasses()) { + my $name = $s->name(); + if ($url = $s->url()) { + push @t, "$name"; + } + else { push @t, $name; } + } + print join( ', ', @t ); + >>
    +

    + << + print &processDescription( $c->description() ); + + # Output "see also" information + if ($c->seealso()) { + >>

    See Also
    + << + my @r = (); + foreach $a ($c->seealso()) { + my $name = $a->name(); + if ($url = $a->url()) { + push @r, "$name"; + } + else { push @r, $name; } + } + print join( ',', @r ); + >>

    + << + } + + # Output class member index + if ($c->members()) { + print "

    Member Index

    \n"; + print "
      "; + foreach $m ($c->members()) { + >>
    • $(m.fullname) + << + } + >>
    << + } + + # Output class member variable documentation + if ($c->membervars()) { + print "

    Class Variables

    \n"; + print "
    \n"; + foreach $m ($c->membervars()) { &variable( $m ); } + print "
    \n"; + } + + # Output class member function documentation + if ($c->memberfuncs()) { + print "

    Class Methods

    \n"; + print "
    \n"; + foreach $m ($c->memberfuncs()) { &function( $m ); } + print "
    \n"; + } +} + +# Output global variables +if ($p->globalvars()) { + >>

    Global Variables

    +
    + << + foreach $m ($p->globalvars()) { &variable( $m ); } + print "
    \n"; +} + +# Output global functions +if ($p->globalfuncs()) { + >>

    Global Functions

    +
    + << + foreach $m ($p->globalfuncs()) { &function( $m ); } + print "
    \n"; +} + +>> +
    + $copyright
    + Generated by ScanDoc $majorVersion.$minorVersion
    + Last Updated: $date
    + + +<< +} # end of foreach (packages) loop + +###################################################################### + +## Subroutine to generate documentation for a member function or global function + +sub function { + local ($f) = @_; + + if ($f->keywords()) { + >> + << + } + >> + +
    +
    + $(f.fullname); +
    + << + print &processDescription( $f->description() ); + >> +

    + << + if ($f->params()) { + >> +
    Parameters
    + + << + foreach $a ($f->params()) { + >> + << + } + >>
    + $(a.name)<< + print &processDescription( $a->description() ); + >>
    + << + } + + if ($f->returnValue()) { + >>
    Return Value +
    << + print &processDescription( $f->returnValue() ); + >>

    << + } + + if ($f->exceptions()) { + >>

    Exceptions
    + + << + foreach $a ($f->exceptions()) { + >> + << + } + >>

    + $(a.name)<< + print &processDescription( $a->description() ); + >>

    + << + } + + if ($f->seealso()) { + >>
    See Also
    + << + my @r = (); + foreach $a ($f->seealso()) { + my $name = $a->name(); + if ($url = $a->url()) { + push @r, "$name"; + } + else { push @r, $name; } + } + print join( ',', @r ); + >>

    << + } + >>

    + << +} + +###################################################################### + +## Subroutine to generate documentation for a member variable or global variable. + +sub variable { + local ($v) = @_; + + if ($v->keywords()) { + print ""; + } + + >> + +
    + $(v.fullname); +
    + <description() );>> +

    + << + if ($v->seealso()) { + >>
    See Also
    + << + $comma = 0; + foreach $a ($v->seealso()) { + if ($comma) { print ","; } + $comma = 1; + >>$(a.name) + << + } + >>

    + << + } + >>

    + << +} + +###################################################################### + +sub processDescription { + local ($_) = @_; + + s/^\s+//; # Remove whitespace from beginning + s/\s+$/\n/; # Remove whitespace from end + s/\n\n/

    \n/g; # Replace multiple CR's with paragraph markers + s:\@heading(.*)\n:

    $1

    :; # Handle heading text + + # Handle embedded image tags + s:\@caution:

    :; + s:\@warning:

    :; + s:\@bug:

    :; + s:\@tip:

    :; + + return $_; +} diff --git a/helpers/scandoc b/helpers/scandoc new file mode 100755 index 00000000000..5a0ebb4923c --- /dev/null +++ b/helpers/scandoc @@ -0,0 +1,1325 @@ +#!/usr/bin/perl +# +# ScanDoc - Version 0.12, A C/C++ Embedded Documentation Analyser +# ---------------------------------------------------------------- +# +# Distributed under the "Artistic License". See the file +# "COPYING" that accompanies the ScanDoc distribution. +# +# See http://scandoc.sourceforge.net/ for more information and +# complete documentation. +# +# (c) 1997 - 2000 Talin and others. + +require "ctime.pl"; +require "getopts.pl"; + +# 1 = on (verbose); 0 = off +$debug = 0; + +# Get the current date +$date = &ctime(time); + +# Set the default tab size +$tabSize = 4; + +$minorVersion = 12; +$majorVersion = 0; +$scandocURL = "http://scandoc.sourceforge.net/"; + +# Set up default templates +&Getopts( 'i:d:p:t:' ); + +if ($#ARGV < 0) { + die "Usage: -i -p -t -d= [ ... ]\n"; +} + +# Read the template +if (!defined $opt_i) { + $opt_i = "default.pl"; +} +&readTemplate( $opt_i ); + +# Set the destination path. +$destPath = ""; +$destPath = $opt_p if (defined($opt_p)); + +# Set the tab size. +$tabSize = $opt_t if (defined($opt_t)); + +# Handle defines +if ($opt_d) { + foreach $def (split( /,/, $opt_d )) { + if ($def =~ /\s*(\w*)\=(.*)/) { + $${1} = $2; + } + else { + $${1} = 1; + } + } +} + +# For each input filename, parse it +while ($srcfile = shift(@ARGV)) { + + $linenumber = 0; + open( FILE, $srcfile ) || die "Can't open file $srcfile\n"; + print STDERR "Reading \"$srcfile\"\n"; + + $docTag = 'description'; + $docEmpty = 1; + $packageName = '.general'; + $author = ''; + $version = ''; + $class = 0; + $_ = ''; + + while (&parseDeclaration( '' )) {} +} + +# Collate subclasses and associate with class record. +foreach $className (keys %subclasses) { + my $class = &classRecord( $className ); + + if ($class) { + my @subs = (); + # print STDERR "$className ", join( ',', @{$subclasses{ $className }} ), "\n"; + foreach $subName ($subclasses{ $className }) { + if (&classRecord( $subName )) { + push @subs, $subName; + } + $class->{ 'subs' } = @subs; + } + } +} + +# Turn packages into objects. Special case for "default" package. +foreach $pkg (keys %packages) +{ + # print STDERR $pkg, "\n"; + bless $packages{ $pkg }, PackageRecord; + if ($pkg eq '.general') { + $packages{ $pkg }{ 'name' } = "General"; + } + else { + $packages{ $pkg }{ 'name' } = $pkg; + } + # print STDERR $packages{ $pkg }->Classes(), "\n"; +} + +# Execute template file +# print STDERR $docTemplate; # For debugging +eval $docTemplate; +print STDERR $@; + +exit; + +# ======================= Subroutines ================================ + +# Read a line of input, and remove blank lines and preprocessor directives. +sub rdln { + my ($skip_next_line) = 0; + if (defined ($_)) { + my ($previous_line) = $_; + while ( (/^(\s*|\#.*)$/ || $skip_next_line ) && ($_ = )) { + if ($previous_line =~ m/\\\s*/) { $skip_next_line = 1; } + else { $skip_next_line = 0; } + $previous_line = $_; + $linenumber++; + if ($debug) { print STDERR "(0:$srcfile) $linenumber.\n"; } + } + } +} + +# Don't skip "#" +sub rdln2 { + if (defined ($_)) { + while (/^(\s*)$/ && ($_ = )) {$linenumber++; if ($debug) { print STDERR "(0:$srcfile) $linenumber.\n"; } } + } +} + +# Remove comments from current line +sub removeComment { + s|//.*||; +} + +# parsing functions +sub matchKW { &rdln; return (s/^\s*($_[0])//, $1) if defined ($_); return (0, 0); } +#sub matchStruct { &rdln; return (s/^\s*(struct|class)//, $1) if defined ($_); return (0, 0); } +#sub matchPermission { &rdln; return (s/^\s*(public|private|protected)// && $1) if defined ($_); return (0,0); } +sub matchID { &rdln; return (s/^\s*([A-Za-z_]\w*)//, $1) if defined ($_); return (0,0); } +sub matchColon { &rdln; return (s/^\s*\://) if defined ($_); return 0; } +sub matchComma { &rdln; return (s/^\s*\,//) if defined ($_); return 0; } +sub matchSemi { &rdln; return (s/^\s*\;//) if defined ($_); return 0; } +sub matchRBracket { &rdln; return (s/^\s*\{//) if defined ($_); return 0; } +sub matchLBracket { &rdln; return (s/^\s*\}//) if defined ($_); return 0; } +sub matchRParen { &rdln; return (s/^\s*\(//) if defined ($_); return 0; } +sub matchLParen { &rdln; return (s/^\s*\)//) if defined ($_); return 0; } +sub matchRAngle { &rdln; return (s/^\s*\//) if defined ($_); return 0; } +sub matchDecl { &rdln; return (s/^(\s*[\s\w\*\[\]\~\&\n\:]+)//, $1) if defined ($_); return (0, 0); } +sub matchOper { &rdln; return (s/^\s*([\~\&\^\>\<\=\!\%\*\+\-\/\|\w]*)// && $1) if defined ($_); return 0; } +sub matchFuncOper { &rdln; return (s/^\s*(\(\))// && $1) if defined ($_); return 0; } +sub matchAny { &rdln; return (s/^\s*(\S+)//, $1) if defined ($_); return (0, 0); } +sub matchChar { &rdln; return (s/^(.)//, $1) if defined ($_); return (0, 0); } +sub matchChar2 { &rdln2; return (s/^(.)//, $1) if defined ($_); return (0, 0); } +sub matchString { &rdln; return (s/^\"(([^\\\"]|(\\.)))*\"//, $1) if defined ($_); return (0, 0); } + +# Skip to next semicolon +sub skipToSemi { + + while (!&matchSemi) { + + &rdln; + s|//.*||; # Eat comments + if (&matchLBracket) { + &skipBody; + next; + } + last if !s/^\s*([^\s\{\;]+)//; + # print STDERR "$1 "; + } +} + +# Skip function body +sub skipBody { + local( $nest ); + + $nest = 1; + +# for (;;) { +# if (&matchRBracket) { $nest++; } +# elsif (&matchLBracket) { +# $nest--; +# last if !$nest; +# } +# else { +# last if ((($valid,) = &matchKW( "[^\{\}]")) && !$valid); +# } +# } +} + +# Skip a string. (multiline) +sub skipString { + local( $char, $lastchar); + $lastchar = "\""; + + for (;;) { + ($valid, $char) = &matchChar2; + if (($char eq "\"") && ($lastchar ne "\\")) { last; } + if ($lastchar eq "\\") { $lastchar = " "; } + else { $lastchar = $char; } + } +} + + +# Skip everything in parenthesis. +sub skipParenBody { + local( $nest ); + + $nest = 1; + + for (;;) { + if (&matchRParen) { $nest++; } + elsif (&matchLParen) { + $nest--; + last if !$nest; + } + else { + last if ((($valid,) = &matchKW( "[^\(\)]")) && !$valid); + } + } +} + +# Parse (*name) syntax +sub parseParenPointer { + if (s/^(\s*\(\s*\*)//) { + $decl .= $1; + $nest = 1; + + for (;;) { + # Preserve spaces, eliminate in-line comments + &removeComment; + while (s/^(\s+)//) { $decl .= $1; &rdln; } + + if (&matchRParen) { $nest++; $decl .= "("; } + elsif (&matchLParen) { + $decl .= ")"; + $nest--; + last if !$nest; + } + elsif ((($valid, $d) = &matchKW( "[^\(\)]*")) && $valid) { $decl .= $d; } + else { last; } + } + + # Just in case there are array braces afterwards. + while ((($valid, $d) = &matchDecl) && $valid) { $decl .= $d; } + } +} + +# Parse template arguments +sub matchAngleArgs { + + if (&matchRAngle) { + local ($args, $nest); + + $args = "<"; + $nest = 1; + + for (;;) { + if (&matchRAngle) { $nest++; $args .= "<"; } + elsif (&matchLAngle) { + $nest--; + $args .= ">"; + last if !$nest; + } + elsif ((($valid, $d) = &matchChar) && $valid) { $args .= $d; } + else { last; } + } + return $args; + } + else { return ''; } +} + +# convert tabs to spaces +sub expandTabs { + local ($text) = @_; + local ($n); + + while (($n = index($text,"\t")) >= 0) { + substr($text, $n, 1) = " " x ($tabSize-($n % $tabSize)); + } + + return $text; +} + +# Process a line of text from a "special" comment +sub handleCommentLine { + local ($_) = @_; + + if ($docEmpty) { + # Eliminate blank lines at the head of the doc. + return if (/^\s*$/); + } + + # First, expand tabs. + $_ = &expandTabs( $_ ); + + # Remove gratuitous \s*\s (james) + s/(^|\n)\s*\*\s/$1/g; + + # If it's one of the standard tags + if (s/^\s*\@(see|package|version|author|param|return|result|exception|keywords|deffunc|defvar|heading|todo)\s*//) { + my $tag = $1; + $tag = 'return' if ($tag eq 'result'); + + # for param and exception, split the param name and the text + # seperate them with tabs. + if ($tag eq "param" || $tag eq "exception") { + s/^\s*(\w+)\s*(.*)/\t$1\t$2/; + } + elsif ($tag eq "heading") { + # 'heading' is processed by the template, if at all. + $_ = "\@heading\t$_"; + $tag = "description"; + } + elsif ($tag eq 'todo') { + if ($todolist{ $srcfile } ne '') { + $todolist{ $srcfile } .= "\n"; + } + } + + # If it's @deffunc or @defvar + if ($tag =~ /def(.*)/) { + + $type = $1; + + # @deffunc and @defvar force a comment to be written out as if there was a + # declaration. + # Designed for use with macros and other constructs I can't parse. + + if (/(\S+)\s+(.*)$/) { + $name = $1; + $decl = $2; + $dbname = &uniqueName( "$baseScope$name" ); + + my $entry = { 'type' => $type, + 'name' => $name, + 'longname'=> $name, + 'fullname'=> "$name$decl", + 'scopename'=>"$baseScope$name", + 'uname' => $dbname, + 'decl' => $decl, + 'package' => $packageName }; + + bless $entry, MemberRecord; + + if ($class) { + $entry->{ 'class' } = "$context"; + $class->{ 'members' }{ $dbname } = $entry; + } + else { + $packages{ $packageName }{ 'globals' }{ $dbname } = $entry; + } + $docTag = 'description'; + &dumpComments( $entry ); + return; + } + } + elsif ($tag eq 'package') { + s/^\s*//; + s/\s*$//; + $packageName = $_; + $docTag = 'description'; + return; + } + elsif ($tag eq 'author') { + $author = $_; + $docTag = 'description'; + return; + } + elsif ($tag eq 'version') { + $version = $_; + $docTag = 'description'; + return; + } + + $docTag = $tag; + } + elsif (/^\s*@\w+/) { + # any other line that begins with an @ should be inserted into the main + # description for later expansion. + $docTag = 'description'; + } + + # "To-do" lists are handled specially, and not associated with a class. + if ($docTag eq 'todo') { + $todolist{ $srcfile } .= $_; + return; + } + + # Append to current doc tag, regardless of whether it's a new line + # or a continuation. Also mark this doc as non-empty. + $docTags{ $docTag } .= $_; + $docEmpty = 0; + + # @see doesn't persist. + if ($docTag eq 'see') { $docTag = 'description'; } + + # print STDERR ":$_"; +} + +# Clear doc tag information at end of class or file +sub clearComments { + + $docTag = 'description'; + $docEmpty = 1; + %docTags = (); +} + +# Add doc tag information to current documented item +sub dumpComments { + local ($hashref) = @_; + + if ($docEmpty == 0) { + + if ($author ne '') { $hashref->{ 'author' } = $author; } + if ($version ne '') { $hashref->{ 'version' } = $version; } + $hashref->{ 'sourcefile' } = $srcfile; + + # Store the tags for this documentation into the global doc symbol table + foreach $key (keys %docTags) { + my $data = $docTags{ $key }; + + $data =~ s/\s*$//; + + $hashref->{ $key } = $data; + } + } + + &clearComments(); +} + +# Generate a unique name from the given name. +sub uniqueName { + local ($name) = @_; + + # Duplicate doc entries need to be distinguished, so give them a different label. + while ($docs{ $name }) { + if ($name =~ /-(\d+)$/) { + $name = $` . "-" . ($1 + 1); + } + else { $name .= "-2"; } + } + + $docs{ $name } = 1; + return $name; +} + +# Get the current class record. +sub classRecord { + local ($className) = @_; + local ($pkg) = $classToPackage{ $className }; + + if ($pkg) { + return $packages{ $pkg }{ 'classes' }{ $className }; + } + return 0; +} + +# Parse a declaration in the file +sub parseDeclaration { + + local ($context) = @_; + local ($baseScope) = ''; + local ($decl); + my ($token); + + if ($context) { $baseScope = $context . "::"; } + + &rdln; + + if (!defined ($_)) { return 0; } + + if (s|^\s*//\*\s+||) { + # Special C++ comment + &handleCommentLine( $' ); + $_ = ''; &rdln; + } + elsif (s|^\s*//||) { + # Ordinary C++ comment + $_ = ''; + &rdln; + } + elsif (s|^\s*\/\*\*\s+||) { + # Special C comments + + s/\={3,}|\-{3,}|\*{3,}//; # Eliminate banner strips + $text = ''; + $docTag = 'description'; + + # Special comment + while (!/\*\//) { &handleCommentLine( $_ ); $text .= $_; $_ = ; $linenumber++; if ($debug) { print STDERR "(1) $linenumber\n."; }} + s/\={3,}|\-{3,}|\*{3,}//; # Eliminate banner strips + /\*\//; + &handleCommentLine( $` ); + $text.= $`; $_ = $'; + } + elsif (s|^\s*\/\*||) { + # Ordinary C comment + $text = ""; + + while (!/\*\//) { $text .= $_; $_ = ; $linenumber++; if ($debug) { print STDERR "(2) $linenumber\n."; }} + /\*\//; + $text.= $`; $_ = $'; + } + elsif ((($valid, $tag) = &matchKW( "template")) && $valid) { + # Template definition + $args = &matchAngleArgs; + &rdln; + + ##$tmplParams = $args; JAMES + $result = &parseDeclaration( $context ); + ##$tmplParams = ''; JAMES + return $result; + } + elsif ((($valid, $tag) = &matchKW("class|struct")) && $valid) { + # Class or structure definition + local ($className,$class); + + if ((($valid, $className) = &matchID) && $valid) { + + return 1 if (&matchSemi); # Only a struct tag + + # A class instance + if ((($valid,)=&matchID) && $valid) { + &matchSemi; + return 1; + } + + my $fullName = "$baseScope$className"; ##$tmplParams"; JAMES + # print STDERR "CLASS $fullName\n"; + + my @bases = (); + + if (&matchColon) { + + for (;;) { + my $p; + &matchKW( "virtual" ); + $perm = "private"; + if ((($valid, $p) = &matchKW( "public|private|protected" )) && $valid) { $perm = $p; } + &matchKW( "virtual" ); + + last if !( (($valid, $base) = &matchID) && $valid ); + + push @bases, $base; + push @{ $subclasses{ $base } }, $fullName; + # print STDERR " : $perm $base\n"; + last if !&matchComma; + } + } + + # print STDERR "\n"; + # print STDERR "parsing class $fullName\n"; + + if ($docEmpty == 0) { + $class = { 'type' => $tag, + 'name' => $fullName, + 'longname'=> "$tag $className", + 'fullname'=> "$tag $className", + 'scopename'=> "$tag $fullName", + 'uname' => $fullName, + 'bases' => \@bases, + 'package' => $packageName, + 'members' => {} }; + + # print STDERR "$className: @bases\n"; + + bless $class, ClassRecord; + + print STDERR " parsing class $fullName\n"; + # $classToPackage{ $className } = $packageName; + $classToPackage{ $fullName } = $packageName; + # $classList{ $className } = $class; + $classList{ $fullName } = $class; + $packages{ $packageName }{ 'classes' }{ $fullName } = $class; + &dumpComments( $class ); + } + + if (&matchRBracket) { + local ($perm) = ("private"); + + while (!&matchLBracket) { + my $p; + if ((($valid, $p) = &matchKW( "public\:|private\:|protected\:" )) && $valid) { + $perm = $p; + } + else { + &parseDeclaration( $fullName ) + || die "Unmatched brace! line = $linenumber\n"; + } + } + + &matchSemi; + } + + &clearComments; + } + } + elsif ( ((($valid,)=&matchKW( "enum")) && $valid) || ((($valid,)=&matchKW( "typedef" )) && $valid)) { + &skipToSemi; + } + elsif ((($valid,)=&matchKW( "friend\s*class" )) && $valid) { + &skipToSemi; + } + # elsif ($kw = &matchID) { + # $type = "$kw "; + # + # if ($kw =~/virtual|static|const|volatile/) { + # $type .= &typ; + # } + # } + elsif ((($valid, $decl) = &matchDecl) && $valid) { + my ($instanceClass) = ""; + + # print STDERR "DECLARATION=$decl, REST=$_, baseScope=$baseScope\n"; + + return 1 if ($decl =~ /^\s*$/); + + if (!($class)) { + if ($decl =~ s/(\S*\s*)(\S+)\:\:(\S+)\s*$/$1$3/) { + $instanceClass = $2; + } + } + + # Eliminate in-line comments + &removeComment; + + # Check for multi-line declaration + while ((($valid, $d) = &matchDecl) && $valid) { $decl .= $d; } + + # Handle template args, but don't let operator overloading confuse us! + $tempArgs = ''; + if (!($decl =~ /\boperator\b/) && ($tempArgs = &matchAngleArgs)) { + $tempArgs = $decl . $tempArgs; + $decl = ''; + while ((($valid, $d) = &matchDecl) && $valid) { $decl .= $d; } + } + + # Look for (*name) syntax + &parseParenPointer; + + # Special handling for operator... syntax + $oper = ""; + if ($decl =~ s/\boperator\b(.*)/operator/) { + $oper = $1; + $oper .= &matchOper; + # If, after all that there's no opers, then try a () operator + if (!($oper =~ /\S/)) { $oper .= &matchFuncOper; } + } + + ($type,$mod,$decl) = $decl =~ /([\s\w]*)([\s\*\&]+\s?)(\~?\w+(\[.*\])*)/; + + $type = $tempArgs . $type; + $decl .= $oper; + + if ($mod =~ /\s/) { $type .= $mod; $mod = ""; } + + for (;;) { + + # print STDERR "Looping: $type/$mod/$decl\n"; + + if (&matchRParen) { + $nest = 1; + $args = ""; + + for (;;) { + # print STDERR "Argloop $_\n"; + + # Process argument lists. + + # Preserve spaces, eliminate in-line comments + # REM: Change this to save inline comments and automatically + # generate @param clauses + s|//.*||; + while (s/^(\s+)//) { $args .= " "; &rdln; } + + if (&matchRParen) { $nest++; $args .= "("; } + elsif (&matchLParen) { + $nest--; + last if !$nest; + $args .= ")"; + } + elsif ((($valid, $d) = &matchKW( "[\,\=\.\:\-]" )) && $valid) { $args .= $d; } + elsif ((($valid, $d) = &matchDecl) && $valid) { $args .= $d; } + elsif ((($valid, $d) = &matchAngleArgs) && $valid) { $args .= $d; } + elsif ((($valid, $d) = &matchString) && $valid) { $args .= "\"$d\""; } + else { last; } + } + + # print STDERR "$type$mod$baseScope$decl($args);\n"; + + &matchKW( "const" ); + + # Search for any text within the name field + # if ($docTag && $decl =~ /\W*(~?\w*).*/) + if ($docEmpty == 0) { + $type =~ s/^\s+//; + $mod =~ s/\&/\&/g; + $args =~ s/\&/\&/g; + $args =~ s/\s+/ /g; + $dbname = &uniqueName( "$baseScope$decl" ); + + my $entry = { 'type' => 'func', + 'name' => $decl, + 'longname'=> "$decl()", + 'fullname'=> "$type$mod$decl($args)", + 'scopename'=>"$type$mod$baseScope$decl($args)", + 'uname' => $dbname, + 'decl' => "$type$mod$decl($args)", + 'package' => $packageName }; + + bless $entry, MemberRecord; + + if ($class) { + $entry->{ 'class' } = "$context"; + $class->{ 'members' }{ $dbname } = $entry; + } + elsif ($instanceClass) { + $class = &classRecord ($instanceClass); + if (!($class)) { + print STDERR "WARNING: Skipping \"$instanceClass\:\:$decl\". Class \"$instanceClass\" not declared ($linenumber).\n"; + } else { + $entry->{ 'class' } = "$instanceClass"; + $class->{ 'members' }{ $dbname } = $entry; + $class = 0; + } + } + else { + $packages{ $packageName }{ 'globals' }{ $dbname } = $entry; + } + &dumpComments( $entry ); + } + else { &clearComments; } + + s|//.*||; + + # Constructor super-call syntax + if (&matchColon) { + + # Skip over it. + for (;;) { + &rdln; + last if /^\s*(\{|\;)/; + last if !((($valid,)=&matchAny) && $valid); + } + } + + last if &matchSemi; + if (&matchRBracket) { &skipBody; last; } + last if !&matchComma; + last if !((($valid, $decl) = &matchDecl) && $valid); + + # Look for (*name) syntax + &parseParenPointer; + + $decl =~ s/^\s*//; + $oper = ""; + if ($decl =~ /\boperator\b/) { + $decl =~ s/\boperator\b(.*)/operator/; + $oper = $1 . &matchOper; + } + ($mod,$d) = $decl =~ /^\s*([\*\&]*)\s*(\~?\w+(\[.*\])*)/; + $decl .= $oper; + $decl = $d if $d ne ""; + } + else { + s|//.*||; + + $final = 0; + + if ((($valid,)=&matchKW( "\=" )) && $valid) { + for (;;) { + + if (&matchRBracket) { + &skipBody; + $final = 1; + last; + } + + if (&matchSemi) { + $final = 1; + last; + } + + # var = new ... (...) + if ((($valid,)=&matchKW("new")) && $valid) { + &matchKW("[A-Za-z_0-9 ]*"); + if (&matchRParen) { + &skipParenBody; + } + } + + # var = (.....) ... + if (&matchRParen) { + &skipParenBody; + } + + # var = ... * ... + &matchKW ("[\/\*\-\+]*"); + + # var = "..." + if ((($valid,) = &matchKW ("[\"]")) && $valid) { + &skipString; + } + #&matchString; + + last if /^\s*,/; + #last if !((($valid,)=&matchAny) && $valid); + last if !((($valid,)=&matchKW("[A-Za-z_0-9 \-]*")) && $valid); + if (&matchSemi) { + $final = 1; + last; + } + } + } + + s|//.*||; + + # void ~*&foo[]; + # void foo[]; + # void far*foo[]; + # print STDERR "Decl: $type$mod$baseScope$decl;\n"; + + # Search for any text within the name field + if ($docEmpty == 0 && ($decl =~ /\W*(~?\w*).*/)) + { + $mod =~ s/\&/\&/g; + $name = $decl; + + $dbname = &uniqueName( "$baseScope$1" ); + + my $entry = { 'type' => 'var', + 'name' => $1, + 'longname' => "$name", + 'fullname' => "$type$mod$decl", + 'scopename'=> "$baseScope$type$mod$decl", + 'uname' => $dbname, + 'decl' => "$type$mod$decl", + 'package' => $packageName }; + + bless $entry, MemberRecord; + + if ($class) { + $entry->{ 'class' } = "$context"; + $class->{ 'members' }{ $dbname } = $entry; + } + else { + $packages{ $packageName }{ 'globals' }{ $dbname } = $entry; + } + &dumpComments( $entry ); + } + else { &clearComments; } + + last if $final; + last if &matchSemi; + last if !&matchComma; + last if !((($valid, $decl) = &matchDecl) && $valid); + + # Look for (*name) syntax + &parseParenPointer; + + $decl =~ s/^\s*//; + ($mod,$d) = $decl =~ /^\s*([\*\&]*)(\~?\w+(\[.*\])*)/; + $decl = $d if $d ne ""; + } + } + } + elsif ($context ne "" && /^\s*\}/) { + # print STDERR "Popping!\n"; + return 1; + } + elsif (&matchRBracket) { + &skipBody; + } + elsif ((($valid, $token) = &matchAny) && $valid) { + # Comment in for debugging + # print STDERR "token: $token \n"; + } + else { return 0; } + + return 1; +} + +# read a file into a string ( filename, default-value ) +sub readFile { + local ( $filename, $result ) = @_; + + if ($filename && open( FILE, $filename )) { + $result = ""; + while () { $result .= $_; } + close( FILE ); + } + return $result; +} + +# Read the entire document template and translate into PERL code. +sub readTemplate { + local ( $filename ) = @_; + $docTemplate = ''; + $indent = ''; + $literal = 1; # We're in literal mode. + + if (!-e $filename) { + if (-e "./templates/$filename") { $filename = "./templates/$filename"; } + elsif (-e "../templates/$filename") { $filename = "../templates/$filename"; } + else { die "Could not find template '$filename'.\n"; } + } + + open( FILE, $filename ) || die "Error opening '$filename'.\n"; + while () { + last if (/END/); + + # if we found a code entry. + for (;;) { + &expandTabs( $_ ); + if ($literal) { + # Check for beginning of code block. + if (s/^(.*)\<\$2() \. \"/g; + $docTemplate .= "${indent}print\"$line\";"; + } + # else { $docTemplate .= "\n"; } + $literal = 0; + } + else { + if (substr( $_, 0, length( $indent ) ) eq $indent) { + substr( $_, 0, length( $indent ) ) = ""; + } + chop; + s/\"/\\\"/g; + s/\$\((\w+)\.(\w+)\)/\" \. \$$1->$2() \. \"/g; + $_ = $indent . "print \"" . $_ . "\\n\";\n"; + last; + } + } + else { + # Check for beginning of literal block. + if (s/^(\s*)\>\>//) { + $indent = $1; + $literal = 1; + } + elsif (s/^(\s*)(.*)\>\>//) { + $docTemplate .= "$indent$2"; + $literal = 1; + } + else { + last; + } + } + } + + $docTemplate .= $_; + } + close( FILE ); + # print $docTemplate; +} + +# Functions intended to be called from doc template file. + +# Open a new output file +sub file { + my $mfile = $_[ 0 ]; + + open( STDOUT, ">$destPath$mfile" ) || die "Error writing to '$mfile'\n"; +} + +# return list of package objects +sub packages { + my ($p, @r); + @r = (); + + foreach $p (sort keys %packages) { + push @r, $packages{ $p }; + } + return @r; +} + +# return list of source files which have to-do lists +sub todolistFiles { + my ($p, @r); + @r = (); + + foreach $p (sort keys %todolist) { + push @r, $p; + } + return @r; +} + +# return list of tab-delimited to-do-list texts. +sub todolistEntries { + local $_ = $todolist{ $_[0] }; + s/^\s+//; # Remove whitespace from beginning + s/\s+$/\n/; # Remove whitespace from end + return split( /\n/, $_ ); +} + +# Convert package name to URL. +sub packageURL { + my $p = $_[0]; + + if ($p eq 'General') { $p = '.general'; } + if ($p eq '') { $p = '.general'; } + + if (ref $packages{ $p }) { + return $packages{ $p }->url(); + } + return 0; +} + +# Get the see-also list for an object +sub seealsoList { + my $self = shift; + my ($see, $name, $url, $p, @r); + @r = (); + + if (defined ($self->{ 'see' })) { + foreach $_ (split(/\n/,$self->{ 'see' })) { + + if (/^\ $name, + 'url' => $url }; + + bless $entry, DocReference; + + push @r, $entry; + } + } + return @r; +} + +# Class for parsed package +package PackageRecord; + +sub classes { + my $self = shift; + my $classes = $self->{ 'classes' }; + return map $classes->{ $_ }, (sort keys %$classes); +} + +sub globals { + my $self = shift; + my $globals = $self->{ 'globals' }; + return map $globals->{ $_ }, (sort keys %$globals); +} + +sub globalvars { + my $self = shift; + my $globals = $self->{ 'globals' }; + my ($p, @r); + @r = (); + + foreach $p (sort keys %$globals) { + my $m = $globals->{ $p }; + if ($m->{ 'type' } ne 'func') { push @r, $m; } + } + return @r; +} + +sub globalfuncs { + my $self = shift; + my $globals = $self->{ 'globals' }; + my ($p, @r); + @r = (); + + foreach $p (sort keys %$globals) { + my $m = $globals->{ $p }; + if ($m->{ 'type' } eq 'func') { push @r, $m; } + } + return @r; +} + +sub name { + my $self = shift; + return $self->{ 'name' }; +} + +sub url { + my $self = shift; + return "default-pkg.html" if ($self->{ 'name' } eq '.general'); + return $self->{ 'name' } . '.html'; +} + +sub anchor { + my $self = shift; + my $url = $self->{ 'name' }; + return $url; +} + +# Class for parsed class +package ClassRecord; + +sub keywords { return ${$_[0]}{ 'keywords' }; } +sub author { return ${$_[0]}{ 'author' }; } +sub version { return ${$_[0]}{ 'version' }; } +sub name { return ${$_[0]}{ 'name' }; } +sub longname { return ${$_[0]}{ 'longname' }; } +sub fullname { return ${$_[0]}{ 'fullname' }; } +sub scopename { return ${$_[0]}{ 'scopename' }; } +sub sourcefile { return ${$_[0]}{ 'sourcefile' }; } +#sub description { return &::processDescription( ${$_[0]}{ 'description' } ); } +sub description { return ${$_[0]}{ 'description' }; } +sub seealso { &::seealsoList( $_[0] ); } + +sub url { + my $self = shift; + return 0 unless $self->{ 'package' }; + my $pname = ::packageURL( $self->{ 'package' } ); + my $url = $self->{ 'uname' }; + $url =~ s/::/-/g; + return "$pname#$url"; +} + +sub anchor { + my $self = shift; + my $url = $self->{ 'uname' }; + $url =~ s/::/-/g; + return $url; +} + +sub members { + my $self = shift; + my $members = $self->{ 'members' }; + my ($p, @r); + @r = (); + + foreach $p (sort keys %$members) { + push @r, $members->{ $p }; + } + return @r; +} + +sub membervars { + my $self = shift; + my $members = $self->{ 'members' }; + my ($p, @r); + @r = (); + + foreach $p (sort keys %$members) { + my $m = $members->{ $p }; + if ($m->{ 'type' } ne 'func') { push @r, $m; } + } + return @r; +} + +sub memberfuncs { + my $self = shift; + my $members = $self->{ 'members' }; + my ($p, @r); + @r = (); + + foreach $p (sort keys %$members) { + my $m = $members->{ $p }; + if ($m->{ 'type' } eq 'func') { push @r, $m; } + } + return @r; +} + +sub baseclasses { + my $self = shift; + my $bases = $self->{ 'bases' }; + my ($p, $class, @r); + @r = (); + + foreach $p (@$bases) { + + unless ($class = $::classList{ $p }) { + # It's one we don't know about, so just make something up + $class = { 'name' => $p, + 'longname'=> "class $p", + 'fullname'=> "class $p", + 'scopename'=>"class $p", + 'uname' => $p, + 'members' => {} }; + + if ($::classToPackage{ $p }) { + $class->{ 'package' } = $::classToPackage{ $p }; + } + + bless $class, ClassRecord; + } + push @r, $class; + } + return @r; +} + +sub subclasses { + my $self = shift; + my $subs; + my ($p, $class, @r); + @r = (); + + if (defined ($self->{ 'subs' })) { + $subs = $self->{ 'subs' }; + foreach $p (sort @$subs) { + $class = $::classList{ $p }; + push @r, $class; + } + } + return @r; +} + +# Class for parsed class member or global +package MemberRecord; + +sub type { return ${$_[0]}{ 'type' }; } +sub keywords { return ${$_[0]}{ 'keywords' }; } +sub author { return ${$_[0]}{ 'author' }; } +sub version { return ${$_[0]}{ 'version' }; } +sub name { return ${$_[0]}{ 'name' }; } +sub longname { return ${$_[0]}{ 'longname' }; } +sub fullname { return ${$_[0]}{ 'fullname' }; } +sub scopename { return ${$_[0]}{ 'scopename' }; } +sub returnValue { return ${$_[0]}{ 'return' }; } +sub sourcefile { return ${$_[0]}{ 'sourcefile' }; } +sub description { return ${$_[0]}{ 'description' }; } +sub seealso { &::seealsoList( $_[0] ); } + +sub url { + my $self = shift; + return 0 unless $self->{ 'package' }; + my $pname = ::packageURL( $self->{ 'package' } ); + my $url = $self->{ 'uname' }; + $url =~ s/::/-/g; + return "$pname#$url"; +} + +sub anchor { + my $self = shift; + my $url = $self->{ 'uname' }; + $url =~ s/::/-/g; + $url; +} + +sub params { + my $self = shift; + my $params = $self->{ 'param' }; + my @r; + @r = (); + + return 0 unless ($params); + + my @paramList = split( /\t/, $params ); + + for ($i = 1; $i < $#paramList; $i += 2) { + my $entry = { 'name' => $paramList[ $i ], + 'description' => $paramList[ $i + 1 ] }; + + bless $entry, ArgRecord; + + push @r, $entry; + } + return @r; +} + +sub exceptions { + my $self = shift; + my $params = $self->{ 'exception' }; + my @r; + @r = (); + + return 0 unless ($params); + + my @paramList = split( /\t/, $params ); + + for ($i = 1; $i < $#paramList; $i += 2) { + my $entry = { 'name' => $paramList[ $i ], + 'description' => $paramList[ $i + 1 ] }; + + bless $entry, ArgRecord; + + push @r, $entry; + } + return @r; +} + +package ArgRecord; +sub name { return ${$_[0]}{ 'name' }; } +sub description { return ${$_[0]}{ 'description' }; } + +package DocReference; +sub name { return ${$_[0]}{ 'name' }; } +sub url { return ${$_[0]}{ 'url' }; } From a44106872afe16b89ddc04722ba231dcfbce79e2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 18:17:54 +0000 Subject: [PATCH 0457/7878] Add a rule to make the docs from APR's header files. And add a .cvsignore so that those generated html pages are ignored by CVS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60432 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 4 ++++ docs/.cvsignore | 1 + 2 files changed, 5 insertions(+) create mode 100644 docs/.cvsignore diff --git a/Makefile.in b/Makefile.in index d0d32dac42b..b8f8f271a72 100644 --- a/Makefile.in +++ b/Makefile.in @@ -98,5 +98,9 @@ subdirs_distclean: done; install: all + +docs: + ./helpers/scandoc -i./helpers/default.pl -p./docs/ ./include/*.h # DO NOT REMOVE +docs: $(INCDIR)/*.h diff --git a/docs/.cvsignore b/docs/.cvsignore new file mode 100644 index 00000000000..2d19fc766d9 --- /dev/null +++ b/docs/.cvsignore @@ -0,0 +1 @@ +*.html From 46290c68ebda500a2f13310919f40f2fcf39feb0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 18:23:17 +0000 Subject: [PATCH 0458/7878] Customize the ScanDoc template just a bit to mention that this is APR and owned by the ASF git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60433 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/default.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/default.pl b/helpers/default.pl index 3cd9eb50add..cdacd8d4613 100644 --- a/helpers/default.pl +++ b/helpers/default.pl @@ -12,9 +12,9 @@ ## For quick and superficial customization, ## simply change these variables -$project_name = '[My Project]'; +$project_name = '[Apache Portable RunTime]'; $company_logo = ''; # change this to an image tag. -$copyright = '© 2000 [My Name]'; +$copyright = '© 2000 [Apache Software Foundation]'; $image_directory = "../images/"; $bullet1_image = $image_directory . "ball1.gif"; $bullet2_image = $image_directory . "ball2.gif"; From 0385f2181cc3a322127af05bb632698479c06d0e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 Jul 2000 18:26:17 +0000 Subject: [PATCH 0459/7878] Add the default ScanDoc images. I expect these will all be replaced relatively quickly. I am adding these, because without them the generated docs have broken images, and I think having the wrong images is better. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60434 13f79535-47bb-0310-9956-ffa450edef68 --- images/ScanDocBig.jpg | Bin 0 -> 5319 bytes images/ScanDocSmall.jpg | Bin 0 -> 2382 bytes images/ball1.gif | Bin 0 -> 1012 bytes images/ball2.gif | Bin 0 -> 1014 bytes images/bug.gif | Bin 0 -> 1040 bytes images/caution.gif | Bin 0 -> 923 bytes images/master.gif | Bin 0 -> 3955 bytes images/tip.gif | Bin 0 -> 1018 bytes images/warning.gif | Bin 0 -> 923 bytes 9 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 images/ScanDocBig.jpg create mode 100644 images/ScanDocSmall.jpg create mode 100644 images/ball1.gif create mode 100644 images/ball2.gif create mode 100644 images/bug.gif create mode 100644 images/caution.gif create mode 100644 images/master.gif create mode 100644 images/tip.gif create mode 100644 images/warning.gif diff --git a/images/ScanDocBig.jpg b/images/ScanDoc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m4hB`^kE6xI`~y$HLA%os|uUTaTfAPjh9wa{#G_(dzA3q(pCaGLkY-?J%*#A9@W? zL4F;w*U!`Y$z603S-EL+e=Vr2>crIBWXSLEhO#d3|7a`!LF2zvvHxZDKTM13ss92| C{__w3 literal 0 HcmV?d00001 diff --git a/images/ScanDocSmall.jpg b/images/ScanDocSmall.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a10964aa1331c65ee1e06e20a4eb8c1eede4cc87 GIT binary patch literal 2382 zcmb7=dpy&N8^^!1ixJi^%YB8INx4*Xj+2qgrre_tXO&-3)MUm==Om(E4l~R-GQ#GP z<`$!sOKHa~m0N6@TnRD#B=U`n8cXlqr*I7eD{F_S%tG0qHs~Mhzfb@Q10W!HNjDiVM|Rd-sz)OM-k9lXfB1{sAlPrW~XL0OV+j7vp;5?F>r%3_Cs z)fII=1b@Vg``$0>Kw>tQXagVuvH=$KY`qa27m(nc!63Av+z0Mv|I9m7at8H^Vuv^* z0ZD<3Z`qD-#g|Msu$S*OmT)_403CF*>Do2ZyKdA*p`uB{`i9R-^t0RE;GD$H&*`0C zOLW8{e)*<=Cx~dVujS}BJ6%kAoXIF0oip3>Q&Vo2$G7Pmb8EX#WD3Y@(+8_={U1UmJp3BI)AF&x@>EwW=fcZOsY_<~F@9 z=v=T&&|lx^o5nqRQis0SX)%8I=31#T>Wd+ECjpaS316wI6A<4sY#6I^~x^AevKyI_cAj=9Exg7K{-tp<}x zxCP?edl zr<7jDY_0nmMT_<<&QoFIc#_ADv(LN>I#(5EAI{B>xz#_TZ9{(}SY#ipUSM`EI%i{G%by`*5GxPDaZTod3=4qqOQXtC}BX|6#L z0eLsM^-kShZ|nZTQMeVXY-RIvk&+FgWW0&VPTNJjd#8)`bH7TO0@)Ghwd%XapN;u- z)APMw7csMZGdmEm7)kGxa9pTp|Hk;r564UlQpoP-PX=e!!8w+c{V81*P3(@#xO7$W z8x9^Kr-EO!9!x2z;*ew?bxAt%;KaGg?k`0BE ze=^_g*jgFP37#NE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l$4!lY-?C{gF&Owd=4TEwC6hZTH9LO=NJe5YCm*v6?_PPFP78P z)aVl$vfVjXB8l+tdJvhPt98c%YsRK_2m|F;ulBE0*r{(W5h%5yuhx2^@$PesrT@UI z_VGm`%CW|Tq7=5@fZ5*J6*|SGmlR0yA7*JR!cmIB^^M7X8PJZmhmzUvqH1 z^86?Io!>fFUmqSmp174vOf9;<#OltpNXJ%eWv6bwxOp&7VZAqyuytHFW%G!G4brncmtZNpnQ;?N(Vuvfh!zi@)8i~Q`d1Q#V-;2;D>1@Wk=rNF&$-uT$~%>WFRvJboe25Q)}l8 zYmX)=LO5)AeY0Zmd{JGD-|i@dWz>ZR@l^w)=6Eb2e5Mel7^NufBO*;iilQVz36D#J6fbaykZg}dgcS3bM3^KWfV_!**bJFO znl(_)0BOpkNDfIyS)F*~K%+WA5s=cJRKf~yNO4FO<0Q#RqL|zWkQQ+L;+E@+X|5;k zr$Jl;r?tGo2Bn zP$`m|MHzw8lSl!HXJ=7HpooSjm9(@#8bgW}phWYiIf14;wykWzNvbl0Z{Z~7Ak#v6BB0ttBB}%t7ja(2_P@V#Xjw^VsC--Wb5~i##&EcEN$-U(=WCC(bPNs9@y8c8omkoTn!M95 zm+U**exvJITf_CMPlqZGbUsO_Q7wrel0(9ula55+DpH8 zU+MWc+`6ai;8uIho3X)9cf)7vZ_bbQb&Sk>_-gGP>v`3G{O`i-hMfaPOm6q@STr2% zn{ItrQ|ER!pEUll=z|wk6LVHMOV>~T9IsBbT^l*Qd9*tju6Z;PaahxePzW0T0|OO! AqyPW_ literal 0 HcmV?d00001 diff --git a/images/ball2.gif b/images/ball2.gif new file mode 100644 index 0000000000000000000000000000000000000000..9adc11c6473fac16d23a998033587fcd15b834b3 GIT binary patch literal 1014 zcmYk*Pe>F|9KiA4%A!v<;;mUsq13<ryh=SXsN z8^oao;Qv=HEGu$F8DHl_j;~9OEFETtS=lV-x{@U`i))gbHv^_@$g3e^sVo&eL(t1> zoa-UBy1{v&LY@V3J`0#RCTKozHG)(hxQ)<~tpLbwVhAslc+s(=F!qafso5x^55x{w4CV3aTlCgTiO(z75j(2*)J8#qfa zfFU9PFaXUK4A25e&;lxG2rmGrcE|!18G;TfVuAu{fPhLsF$4t^gsVUekdi==7NS4} z!T{lGf1(k9D751Y{7(S+0*xdw^5OKOj#T}=OBZQr``(et=J30L(dCA-mDzY=JpN{? zZn_IfDX(>A{^QBzfluT?N4&r3`ok;VXQQ$C?!>{ldwT{CeJi9Bk@eEE<{S0ZT6^!{ z?UB;v`6tyMi({`Ry4otQWD7fZ|^+sd%87pUw?UGs-^i?Q~S}nhUxg&?pR;<iy*Kt(M9{=T8qBqft2a4{r%bBme*a literal 0 HcmV?d00001 diff --git a/images/bug.gif b/images/bug.gif new file mode 100644 index 0000000000000000000000000000000000000000..abf4c845618be8897c1e71f0cb55dabd957b1f83 GIT binary patch literal 1040 zcmc(e%}dmA5XMJyMI~cRFe3xEG{O}k2Cb-I3C#=y4OcNL&~mglp*QRpA^1`q1PLaH z#E1gZTn~{_AQS}g4bomNUGz{9T{>9MrRka9Khc+EVVId`KJ(0OL*v2Sdpb+0l)e#} zzhI_jV#a3VQ3w{)f>>Y+W`c7_kuo zXhRxWXht>p9Df>uguo$?k42;!RDyC)atb6xgGdk#LJoym*1!^&0}~k08b||4AP$77 zpoSQrK?yA6Fc{j9h8CL17xEZSR9TgLKa52rqQWZV>w*GF7G+i@Y!4{ZDv1&+VLkW( zOmxEz><Ty|ZPDLh> zOb*2}Bahw{yuQAnV|4C!Ch;m2-*sZ^a2_2Vh_y`5cXg+eXD8b-TQ(MbO(m0UGc#S4 z@s{4n@yyZgx7)AXUK=Z^pUeJor0r8}-|Fzvo0nDXH~Z=e3hz`u$#0L}J(GU8bSrm? z4*XcHNDf^}Y`oERT_&|EOGvN(QxARaqk_aS|*erm_B_{ZdhlkX>X=5*vA8(nUl v7|gj+a<%_rnkqMy71uGqdf_ENR5WKUdxK$r<>L61bmgZ=Rz#*}TBc@7Wf2*k zVHuhsRrE;rbW7KCsa}gTPqQ>llN!}X^;ApMQ~@a^Qar^{G=&6gpuu98ZmB&L9$^t0 zA+?swJ>0@IT#5xn^Dqn3Fey^>s)t&rh6)@R4e<~Q(Ga%68Zb!15?a()3^veUF)Ssh za>CrzT}mHo$;{l;O-e2-D5|-ttDqiI^tzafx*!ifpvg3LpdS(_gf(E0h9#}=U@_Q0 zgC*r$mB|S;lQI&0tR+)56?{c5EGU|&2|nU92EdDUj7BY1;s-RD#tt|k7=^F~4AM+O z3mz;68)&H$RX1gFLbw=4qK~y?D)l(Z*LLqJwiA}k?JCvVj4s!kcQxAVs3SCmh15vb zO&X5^ZqPgju7r7LYOC5y{O>>We^0EBH#U3s@7%lH8w}U4$^4(0sber&;FJ27NXKNV zGk5Oy?7_p%>+#~&n{WHm$Io_0H*P-vG&#J~e{yAU@ALLay*o2`@nP%nnG3g;C*9qT zI}3vcqociztB=mFetq_K>HE-Ej{G`3T;4p`y|g_$_wM?SwWpW&*53E`Uw(NtIy5b- F{{RLp?QsAA literal 0 HcmV?d00001 diff --git a/images/master.gif b/images/master.gif new file mode 100644 index 0000000000000000000000000000000000000000..5751a4030bcc1ebba86ee205492f0ac5f5286077 GIT binary patch literal 3955 zcmbV}`#;nB;bW*Fu+bD!H7l3Td%l$`*zKnoZBcMmdQr)0w zzlgM7_^L^o1N9Y$Q^R8QP^lFRh8BQ107d}l0-y!}E}yGqF;p_i2QH_Ff}b4dSrAox zzyKPRG(y4GjP!irFuF(>E|)PtqjDIO9$Ce!BE}qxRzxFJ3`iDgI5#*H85Pg1;mZbk zMyL)nSKp{HOZo1zkrAg*eefLC*CJ z2b_aMv>0woUTbSwOM5$4+R{oqeuCK6E~XujNDdv69B>LxL0lL_ggezYrRANxB5M{m zHcFbij&Hd=F*!jja0ze>aC4(h`}&4PMJ3KBMui5L`!R!ddw3zN;>`sk;L0Acap!yMycT zoBa1^s=CjJTJ22~QENF~k8NV^(7u|@QKe`?|xM>@gDy)a=i7+5vSA0Z3 z%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x+b*G+A?A%+wzB>7-dB^g{@&2_8o%;M^bYyzA(7d(TP#CIR zE7X^_&39HEn0=gY%}Ce!fg|1BtqRr2Zu` zZ1VQh`K5P9pSr_i)Ay%#V^K!W?R`9Z^z+O1$mM&R2cs8cYwX1KhacU^#huByXTJ|- zUVnXlapC3D<3BHM?@q1n4VKp4+}OYR Date: Sun, 23 Jul 2000 19:07:56 +0000 Subject: [PATCH 0460/7878] Update dependencies. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60435 13f79535-47bb-0310-9956-ffa450edef68 --- strings/Makefile.in | 6 +++++- threadproc/unix/Makefile.in | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/strings/Makefile.in b/strings/Makefile.in index d38dbd8082f..7b531e7ef1e 100644 --- a/strings/Makefile.in +++ b/strings/Makefile.in @@ -75,4 +75,8 @@ apr_strings.o: apr_strings.c $(INCDIR)/apr.h $(INCDIR)/apr_strings.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_tables.h $(INCDIR)/apr_private.h -apr_strnatcmp.o: apr_strnatcmp.c $(INCDIR)/apr_strnatcmp.h +apr_strnatcmp.o: apr_strnatcmp.c $(INCDIR)/apr_strings.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index 81ff6fedc1d..464d0b8aef4 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -82,6 +82,12 @@ thread.o: thread.c $(INCDIR)/apr.h $(INCDIR)/apr_portable.h \ $(INCDIR)/apr_private.h ../../file_io/unix/fileio.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_tables.h +threadcancel.o: threadcancel.c threadproc.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h threadpriv.o: threadpriv.c $(INCDIR)/apr.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ From 44f8582772b9317efd41262745222495a1325098 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 24 Jul 2000 14:22:16 +0000 Subject: [PATCH 0461/7878] ScanDoc recently committed a change that correctly parsed "extern C". I am adding that change to the scanDoc in our tree and removing the horrible hack I added to make it work in the meantime. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60436 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/scandoc | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/helpers/scandoc b/helpers/scandoc index 5a0ebb4923c..a35bdc26906 100755 --- a/helpers/scandoc +++ b/helpers/scandoc @@ -187,16 +187,16 @@ sub skipBody { $nest = 1; -# for (;;) { -# if (&matchRBracket) { $nest++; } -# elsif (&matchLBracket) { -# $nest--; -# last if !$nest; -# } -# else { -# last if ((($valid,) = &matchKW( "[^\{\}]")) && !$valid); -# } -# } + for (;;) { + if (&matchRBracket) { $nest++; } + elsif (&matchLBracket) { + $nest--; + last if !$nest; + } + else { + last if ((($valid,) = &matchKW( "[^\{\}]")) && !$valid); + } + } } # Skip a string. (multiline) @@ -613,6 +613,13 @@ sub parseDeclaration { elsif ((($valid,)=&matchKW( "friend\s*class" )) && $valid) { &skipToSemi; } + elsif ((($valid, $token) = &matchKW("extern\\s*\\\"C\\\"")) && $valid) { + &matchRBracket; + while (!&matchLBracket) { + &parseDeclaration( '' ) || die "Unmatched brace! line = $linenumber\n"; + } + &matchSemi; + } # elsif ($kw = &matchID) { # $type = "$kw "; # From 66a3342d39b3e367732073b3d0bcfc99eeb59a29 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 24 Jul 2000 21:42:40 +0000 Subject: [PATCH 0462/7878] Remove util_filter.c and util_filter.h. This is in preparation for combining all of the code that registers a filter. I am also removing these from README. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60437 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/README.txt | 2 - buckets/util_filter.c | 140 ------------------------------------------ buckets/util_filter.h | 115 ---------------------------------- 3 files changed, 257 deletions(-) delete mode 100644 buckets/util_filter.c delete mode 100644 buckets/util_filter.h diff --git a/buckets/README.txt b/buckets/README.txt index f69e3434712..d0814e6c609 100644 --- a/buckets/README.txt +++ b/buckets/README.txt @@ -36,8 +36,6 @@ Bachelor #1 ap_rwmem_buf.c ap_rmem_buf.c ap_eos_buf.c - util_filter.h - util_filter.c ryan.patch Bachelor #2 diff --git a/buckets/util_filter.c b/buckets/util_filter.c deleted file mode 100644 index 177617854ba..00000000000 --- a/buckets/util_filter.c +++ /dev/null @@ -1,140 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#include "httpd.h" -#include "util_filter.h" - -API_EXPORT(ap_filter_t *) ap_init_filter(ap_pool_t *p) -{ - ap_filter_t *f = ap_pcalloc(p, sizeof(f)); - return f; -} - -API_EXPORT(int) ap_pass_brigade(request_rec *r, ap_filter_t *next, - ap_bucket_brigade *buf) -{ - int rv; - LINK_filter *hook; - - if (next->current_filter > r->filters->nelts) { - return AP_ENOBODY_WROTE; - } - - hook = (LINK_filter *)r->filters->elts; - rv = hook[next->current_filter++].pFunc(r, next, buf); - next->current_filter--; - return rv; -} - -API_EXPORT(void) ap_save_data_to_filter(request_rec *r, ap_filter_t *next, - ap_bucket_brigade *data) -{ - LINK_filter *hook; - - hook = ((LINK_filter *)r->filters->elts); - - if (hook->filter_data) { - ap_bucket_brigade_catenate(hook->filter_data, data); - } - else { - hook->filter_data = data; - } -} - -API_EXPORT(ap_bucket_brigade *) ap_get_saved_data(request_rec *r, - ap_filter_t *next, - ap_bucket_brigade **data) -{ - LINK_filter *hook; - - hook = ((LINK_filter *)r->filters->elts); - - if (hook->filter_data) { - ap_bucket_brigade_catenate(hook->filter_data, *data); - *data = hook->filter_data; - } - hook->filter_data = NULL; - return *data; -} - -API_EXPORT(void) ap_hook_filter(HOOK_filter *pf, request_rec *r, - const char * const *aszPre, - const char * const *aszSucc, int nOrder) -{ - LINK_filter *hook; - - if(!r->filters) { - r->filters=ap_make_array(ap_global_hook_pool,1,sizeof(LINK_filter)); - ap_hook_sort_register("filter",&r->filters); - } - - hook = (LINK_filter *)r->filters->elts; - - hook=ap_push_array(r->filters); - hook->pFunc=pf; - hook->aszPredecessors=aszPre; - hook->aszSuccessors=aszSucc; - hook->nOrder=nOrder; - hook->szName=ap_debug_module_name; - hook->filter_data = ap_bucket_brigade_create(r->pool); - if(ap_debug_module_hooks) { - ap_show_hook("filter",aszPre,aszSucc); - } -} - - diff --git a/buckets/util_filter.h b/buckets/util_filter.h deleted file mode 100644 index 4921c3ca4d6..00000000000 --- a/buckets/util_filter.h +++ /dev/null @@ -1,115 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APACHE_FILTER_H -#define APACHE_FILTER_H - -#include "ap_config.h" - -/* For ap_array_header_t */ -#include "apr_lib.h" -#include "httpd.h" -#include "apr_buf.h" -#include "ap_hooks.h" /* For the hooks ordering stuff */ - -typedef struct ap_filter_t { - int current_filter; -} ap_filter_t; - -typedef int HOOK_filter(request_rec *r, ap_filter_t *next, ap_bucket_brigade *buckets); - -typedef struct _LINK_filter { - HOOK_filter *pFunc; - const char *szName; - const char * const *aszPredecessors; - const char * const *aszSuccessors; - int nOrder; - ap_bucket_brigade *filter_data; -} LINK_filter; - -#define AP_HOOK_FILTER 0 /* content-filter/munger/processor */ -#define AP_HOOK_ENCODING 10 /* content-encoding */ -#define AP_HOOK_PROCESSOR 20 /* digest/message processor */ -#define AP_HOOK_TRANSPORT 30 /* transport-encoding */ - -/* This is usually the core filter. This ensures that there is always a - * filter that can/will write out to the network. If some other module - * wants to actually do the writing, they just insert themselves before - * this filter. This is just like the default handler in 1.3. If no other - * handler took care of the request, then the default took it. Same thing, if - * no other Transport filter writes this to the network, then the default - * (core) filter will be used. - */ -#define AP_HOOK_TRANSPORT_LAST 40 - -/* If we go past the end of the filter stack, we have a big problem. */ -#define AP_ENOBODY_WROTE (-1) - - -API_EXPORT(ap_filter_t *) ap_init_filter(ap_pool_t *p); - -API_EXPORT(void) ap_hook_filter(HOOK_filter *pf, request_rec *r, - const char * const *aszPre, - const char * const *aszSucc, int nOrder); - -API_EXPORT(int) ap_pass_brigade(request_rec *r, ap_filter_t *next, - ap_bucket_brigade *bucket); -API_EXPORT(void) ap_save_data_to_filter(request_rec *r, ap_filter_t *next, - ap_bucket_brigade *data); - -API_EXPORT(ap_bucket_brigade *) ap_get_saved_data(request_rec *r, - ap_filter_t *next, - ap_bucket_brigade **data); - -#endif /* ndef(AP_FILTER_H) */ From 2e632a1c780a846d78fe7e835691d466ec936605 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 24 Jul 2000 22:37:14 +0000 Subject: [PATCH 0463/7878] Move apr_getpass.c and apr_md5.c from apr/lib to apr/passwd. The directory name is probably wrong, but at least this moves everything dealing with passwords to a common directory. If people hate the name, we can fix/change it later. We never actually came up with a name on the list, so rather than wait, I just moved things. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60438 13f79535-47bb-0310-9956-ffa450edef68 --- lib/Makefile.in | 16 ++-------------- {lib => passwd}/apr_getpass.c | 0 {lib => passwd}/apr_md5.c | 0 3 files changed, 2 insertions(+), 14 deletions(-) rename {lib => passwd}/apr_getpass.c (100%) rename {lib => passwd}/apr_md5.c (100%) diff --git a/lib/Makefile.in b/lib/Makefile.in index b31e09a2a95..c6c23342ba1 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -16,12 +16,10 @@ INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix #LIB=@LIBPREFIX@apr.a -OBJS=apr_md5.o \ - apr_pools.o \ +OBJS=apr_pools.o \ apr_signal.o \ apr_tables.o \ - apr_hash.o \ - apr_getpass.o + apr_hash.o .c.o: $(CC) $(CFLAGS) -c $(INCLUDES) $< @@ -55,20 +53,10 @@ depend: && rm Makefile.new # DO NOT REMOVE -apr_getpass.o: apr_getpass.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_strings.h $(INCDIR)/apr.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h apr_hash.o: apr_hash.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h $(INCDIR)/apr_hash.h -apr_md5.o: apr_md5.c $(INCDIR)/apr_private.h $(INCDIR)/apr_strings.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_md5.h $(INCDIR)/apr_xlate.h apr_pools.o: apr_pools.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ diff --git a/lib/apr_getpass.c b/passwd/apr_getpass.c similarity index 100% rename from lib/apr_getpass.c rename to passwd/apr_getpass.c diff --git a/lib/apr_md5.c b/passwd/apr_md5.c similarity index 100% rename from lib/apr_md5.c rename to passwd/apr_md5.c From 5ec77b7b26aa24dd5f645745d9a956bf230eaaf7 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 24 Jul 2000 22:42:05 +0000 Subject: [PATCH 0464/7878] Update dependancies. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60439 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/Makefile.in | 6 ------ 1 file changed, 6 deletions(-) diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index 464d0b8aef4..81ff6fedc1d 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -82,12 +82,6 @@ thread.o: thread.c $(INCDIR)/apr.h $(INCDIR)/apr_portable.h \ $(INCDIR)/apr_private.h ../../file_io/unix/fileio.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_tables.h -threadcancel.o: threadcancel.c threadproc.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h threadpriv.o: threadpriv.c $(INCDIR)/apr.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ From 41b5536d8dab1a0a32a31ac816f0fa8506d75674 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 24 Jul 2000 22:44:02 +0000 Subject: [PATCH 0465/7878] Enable the passwd directory to be built by APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60440 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 +-- passwd/.cvsignore | 1 + passwd/Makefile.in | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 passwd/.cvsignore create mode 100644 passwd/Makefile.in diff --git a/configure.in b/configure.in index 6f4f8247c4c..fe91e8fc39d 100644 --- a/configure.in +++ b/configure.in @@ -682,8 +682,8 @@ AC_SUBST(LIBPREFIX) AC_SUBST(EXEEXT) echo "Construct Makefiles and header files." -MAKEFILE1="Makefile lib/Makefile strings/Makefile" -SUBDIRS="lib strings " +MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile" +SUBDIRS="lib strings passwd " for dir in $MODULES do test -d $dir || $MKDIR -p $dir diff --git a/passwd/.cvsignore b/passwd/.cvsignore new file mode 100644 index 00000000000..f3c7a7c5da6 --- /dev/null +++ b/passwd/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/passwd/Makefile.in b/passwd/Makefile.in new file mode 100644 index 00000000000..025f5ca2baa --- /dev/null +++ b/passwd/Makefile.in @@ -0,0 +1,63 @@ +#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) +#LIBS=$(EXTRA_LIBS) $(LIBS1) +#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) +#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) + +CC=@CC@ +RANLIB=@RANLIB@ +AR=@AR@ +RM=@RM@ +CFLAGS=@CFLAGS@ @OPTIM@ +LIBS=@LIBS@ +LDFLAGS=@LDFLAGS@ $(LIBS) +INCDIR=../include +INCDIR1=../misc/@OSDIR@ +INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix + +#LIB=@LIBPREFIX@apr.a + +OBJS=apr_md5.o \ + apr_getpass.o + +.c.o: + $(CC) $(CFLAGS) -c $(INCLUDES) $< + +all: $(OBJS) + +clean: + $(RM) -f *.o *.a *.so + +distclean: clean + -$(RM) -f Makefile + + +#$(LIB): $(OBJS) +# $(RM) -f $@ +# $(AR) cr $@ $(OBJS) +# $(RANLIB) $@ + +# +# We really don't expect end users to use this rule. It works only with +# gcc, and rebuilds Makefile.in. You have to re-run configure after +# using it. +# +depend: + cp Makefile.in Makefile.in.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ + && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ + && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ + -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + > Makefile.in \ + && rm Makefile.new + +# DO NOT REMOVE +apr_getpass.o: apr_getpass.c $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_strings.h $(INCDIR)/apr.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h +apr_md5.o: apr_md5.c $(INCDIR)/apr_private.h $(INCDIR)/apr_strings.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_md5.h $(INCDIR)/apr_xlate.h From 5249912d47566c398494b5702238e59e4a2da548 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 24 Jul 2000 23:07:47 +0000 Subject: [PATCH 0466/7878] Move the ap_signal code form apr_signal.c in lib to signals.c in threadproc/unix. All in the name of removing the lib directory once and for all. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60441 13f79535-47bb-0310-9956-ffa450edef68 --- lib/Makefile.in | 6 ------ threadproc/unix/signals.c | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/lib/Makefile.in b/lib/Makefile.in index c6c23342ba1..4728e4f099b 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -17,7 +17,6 @@ INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix #LIB=@LIBPREFIX@apr.a OBJS=apr_pools.o \ - apr_signal.o \ apr_tables.o \ apr_hash.o @@ -65,11 +64,6 @@ apr_pools.o: apr_pools.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_dso.h $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h ../misc/unix/misc.h \ $(INCDIR)/apr_getopt.h -apr_signal.o: apr_signal.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h apr_tables.o: apr_tables.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index d31edd324b7..39292c14fa1 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -57,6 +57,11 @@ #else #include "../beos/threadproc.h" #endif +#include "apr_private.h" +#include "apr_lib.h" +#if APR_HAVE_SIGNAL_H +#include +#endif ap_status_t ap_kill(ap_proc_t *proc, int sig) { @@ -66,3 +71,25 @@ ap_status_t ap_kill(ap_proc_t *proc, int sig) return APR_SUCCESS; } +#if !defined(NO_USE_SIGACTION) && defined(HAVE_SIGACTION) +/* + * Replace standard signal() with the more reliable sigaction equivalent + * from W. Richard Stevens' "Advanced Programming in the UNIX Environment" + * (the version that does not automatically restart system calls). + */ +Sigfunc *ap_signal(int signo, Sigfunc * func) +{ + struct sigaction act, oact; + + act.sa_handler = func; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; +#ifdef SA_INTERRUPT /* SunOS */ + act.sa_flags |= SA_INTERRUPT; +#endif + if (sigaction(signo, &act, &oact) < 0) + return SIG_ERR; + return oact.sa_handler; +} +#endif + From 35c4d48b3d45daeeb2cdb2835ec7f204d41caacc Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 24 Jul 2000 23:28:08 +0000 Subject: [PATCH 0467/7878] Move apr_tables.c and apr_hash.c from apr/lib to apr/tables. This is just to help organize all of the APR .c files in directories that make sense. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60442 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 +-- lib/Makefile.in | 14 +-------- tables/.cvsignore | 1 + tables/Makefile.in | 61 ++++++++++++++++++++++++++++++++++++ {lib => tables}/apr_hash.c | 0 {lib => tables}/apr_tables.c | 0 6 files changed, 65 insertions(+), 15 deletions(-) create mode 100644 tables/.cvsignore create mode 100644 tables/Makefile.in rename {lib => tables}/apr_hash.c (100%) rename {lib => tables}/apr_tables.c (100%) diff --git a/configure.in b/configure.in index fe91e8fc39d..7328b70a479 100644 --- a/configure.in +++ b/configure.in @@ -682,8 +682,8 @@ AC_SUBST(LIBPREFIX) AC_SUBST(EXEEXT) echo "Construct Makefiles and header files." -MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile" -SUBDIRS="lib strings passwd " +MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile" +SUBDIRS="lib strings passwd tables " for dir in $MODULES do test -d $dir || $MKDIR -p $dir diff --git a/lib/Makefile.in b/lib/Makefile.in index 4728e4f099b..ba267968b16 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -16,9 +16,7 @@ INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix #LIB=@LIBPREFIX@apr.a -OBJS=apr_pools.o \ - apr_tables.o \ - apr_hash.o +OBJS=apr_pools.o .c.o: $(CC) $(CFLAGS) -c $(INCLUDES) $< @@ -52,10 +50,6 @@ depend: && rm Makefile.new # DO NOT REMOVE -apr_hash.o: apr_hash.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h $(INCDIR)/apr_hash.h apr_pools.o: apr_pools.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ @@ -64,9 +58,3 @@ apr_pools.o: apr_pools.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_dso.h $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h ../misc/unix/misc.h \ $(INCDIR)/apr_getopt.h -apr_tables.o: apr_tables.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ - ../misc/unix/misc.h $(INCDIR)/apr_getopt.h diff --git a/tables/.cvsignore b/tables/.cvsignore new file mode 100644 index 00000000000..f3c7a7c5da6 --- /dev/null +++ b/tables/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/tables/Makefile.in b/tables/Makefile.in new file mode 100644 index 00000000000..53d47af9f89 --- /dev/null +++ b/tables/Makefile.in @@ -0,0 +1,61 @@ +#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) +#LIBS=$(EXTRA_LIBS) $(LIBS1) +#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) +#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) + +CC=@CC@ +RANLIB=@RANLIB@ +AR=@AR@ +RM=@RM@ +CFLAGS=@CFLAGS@ @OPTIM@ +LIBS=@LIBS@ +LDFLAGS=@LDFLAGS@ $(LIBS) +INCDIR=../include +INCDIR1=../misc/@OSDIR@ +INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix + +OBJS=apr_tables.o \ + apr_hash.o + +.c.o: + $(CC) $(CFLAGS) -c $(INCLUDES) $< + +all: $(OBJS) + +clean: + $(RM) -f *.o *.a *.so + +distclean: clean + -$(RM) -f Makefile + + +#$(LIB): $(OBJS) +# $(RM) -f $@ +# $(AR) cr $@ $(OBJS) +# $(RANLIB) $@ + +# +# We really don't expect end users to use this rule. It works only with +# gcc, and rebuilds Makefile.in. You have to re-run configure after +# using it. +# +depend: + cp Makefile.in Makefile.in.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ + && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ + && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ + -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + > Makefile.in \ + && rm Makefile.new + +# DO NOT REMOVE +apr_hash.o: apr_hash.c $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h $(INCDIR)/apr_hash.h +apr_tables.o: apr_tables.c $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ + ../misc/unix/misc.h $(INCDIR)/apr_getopt.h diff --git a/lib/apr_hash.c b/tables/apr_hash.c similarity index 100% rename from lib/apr_hash.c rename to tables/apr_hash.c diff --git a/lib/apr_tables.c b/tables/apr_tables.c similarity index 100% rename from lib/apr_tables.c rename to tables/apr_tables.c From 21b33fd4efbe6359afff8794820a3bafd793a38e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 25 Jul 2000 00:26:30 +0000 Subject: [PATCH 0468/7878] Add the newest try for filter registration to the repository. This is a combination of Greg's and Ryan's previous code. Submitted by: Greg Stein and Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60443 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/README.txt | 6 ++ buckets/util_filter.c | 158 +++++++++++++++++++++++++++++++ buckets/util_filter.h | 209 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 373 insertions(+) create mode 100644 buckets/util_filter.c create mode 100644 buckets/util_filter.h diff --git a/buckets/README.txt b/buckets/README.txt index d0814e6c609..78b39801b2a 100644 --- a/buckets/README.txt +++ b/buckets/README.txt @@ -45,3 +45,9 @@ Bachelor #2 filters.c greg_patch.txt +Bachelor #3 -- The combination of #1 and #2 (hopefully) +----------- + + util_filter.h + util_filter.c + diff --git a/buckets/util_filter.c b/buckets/util_filter.c new file mode 100644 index 00000000000..5a30a0415ac --- /dev/null +++ b/buckets/util_filter.c @@ -0,0 +1,158 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "util_filter.h" +#include "apr_buf.h" + +/* + * ap_filter_rec_t: + * + * This (internal) structure is used for recording information about the + * registered filters. It associates a name with the filter's callback + * and filter type. + * + * At the moment, these are simply linked in a chain, so a ->next pointer + * is available. + */ +typedef struct ap_filter_rec_t { + const char *name; + ap_filter_func filter_func; + ap_filter_type ftype; + + struct ap_filter_rec_t *next; +} ap_filter_rec_t; + +/* ### make this visible for direct manipulation? + ### use a hash table +*/ +static ap_filter_rec_t *registered_filters = NULL; + +/* NOTE: Apache's current design doesn't allow a pool to be passed thu, + so we depend on a global to hold the correct pool +*/ +#define FILTER_POOL ap_global_hook_pool +#include "ap_hooks.h" /* for ap_global_hook_pool */ + +/* +** This macro returns true/false if a given filter should be inserted BEFORE +** another filter. This will happen when one of: 1) there isn't another +** filter; 2) that filter has a higher filter type (class); 3) that filter +** corresponds to a different request. +*/ +#define INSERT_BEFORE(f, before_this) ((before_this) == NULL \ + || (before_this)->ftype > (f)->ftype) + + +static ap_status_t filter_cleanup(void *ctx) +{ + registered_filters = NULL; + return APR_SUCCESS; +} + +API_EXPORT(void) ap_register_filter(const char *name, + ap_filter_func filter_func, + ap_filter_type ftype) +{ + ap_filter_rec_t *frec = ap_palloc(FILTER_POOL, sizeof(*frec)); + + frec->name = name; + frec->filter_func = filter_func; + frec->ftype = ftype; + + frec->next = registered_filters; + registered_filters = frec; + + ap_register_cleanup(FILTER_POOL, NULL, filter_cleanup, NULL); +} + +API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) +{ + ap_filter_rec_t *frec = registered_filters; + + for (; frec != NULL; frec = frec->next) { + if (!strcasecmp(name, frec->name)) { + ap_filter_t *f = ap_pcalloc(r->pool, sizeof(*f)); + + f->filter_func = frec->filter_func; + f->ctx = ctx; + f->ftype = frec->ftype; + + if (INSERT_BEFORE(f, r->filters)) { + f->next = r->filters; + r->filters = f; + } + else { + ap_filter_t *fscan = r->filters; + while (!INSERT_BEFORE(f, fscan->next)) + fscan = fscan->next; + f->next = fscan->next; + fscan->next = f; + } + + break; + } + } +} + +API_EXPORT(int) ap_pass_brigade(request_rec *r, ap_filter_t *filter, + ap_bucket_brigade *bucket) +{ + if (filter == NULL) { + return APR_ENOTIMPL; + } + else { + return (*filter->filter_func)(r, filter->next, bucket); + } +} + diff --git a/buckets/util_filter.h b/buckets/util_filter.h new file mode 100644 index 00000000000..830912cba2a --- /dev/null +++ b/buckets/util_filter.h @@ -0,0 +1,209 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef AP_FILTER_H +#define AP_FILTER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef APR_HAVE_STDARG_H +#include +#endif + +#include "httpd.h" +#include "apr_buf.h" +#include "apr.h" + +/* + * FILTER CHAIN + * + * Filters operate using a "chaining" mechanism. The filters are chained + * together into a sequence. When output is generated, it is passed through + * each of the filters on this chain, until it reaches the end (or "bottom") + * and is placed onto the network. + * + * The top of the chain, the code generating the output, is typically called + * a "content generator." The content generator's output is fed into the + * filter chain using the standard Apache output mechanisms: ap_rputs(), + * ap_rprintf(), ap_rwrite(), etc. + * + * Each filter is defined by a callback. This callback takes the output from + * the previous filter (or the content generator if there is no previous + * filter), operates on it, and passes the result to the next filter in the + * chain. This pass-off is performed using the ap_fc_* functions, such as + * ap_fc_puts(), ap_fc_printf(), ap_fc_write(), etc. + * + * When content generation is complete, the system will pass an "end of + * stream" marker into the filter chain. The filters will use this to flush + * out any internal state and to detect incomplete syntax (for example, an + * unterminated SSI directive). + */ + +/* forward declare the filter type */ +typedef struct ap_filter_t ap_filter_t; + +/* + * ap_filter_func: + * + * This function type is used for filter callbacks. It will be passed a + * pointer to "this" filter, and a "bucket" containing the content to be + * filtered. + * + * In filter->ctx, the callback will find its context. This context is + * provided here, so that a filter may be installed multiple times, each + * receiving its own per-install context pointer. + * + * Callbacks are associated with a filter definition, which is specified + * by name. See ap_register_filter() for setting the association between + * a name for a filter and its associated callback (and other information). + * + * The *bucket structure (and all those referenced by ->next and ->prev) + * should be considered "const". The filter is allowed to modify the + * next/prev to insert/remove/replace elements in the bucket list, but + * the types and values of the individual buckets should not be altered. + */ +typedef int (*ap_filter_func)(request_rec *r, ap_filter_t *filter, + ap_bucket_brigade *bucket); + +/* + * ap_filter_type: + * + * Filters have different types/classifications. These are used to group + * and sort the filters to properly sequence their operation. + * + * AP_FTYPE_CONTENT: + * These filters are used to alter the content that is passed through + * them. Examples are SSI or PHP. + * + * AP_FTYPE_CONNECTION: + * These filters will alter the content, but in ways that are more + * strongly associated with the output connection. Examples are + * compression, character recoding, or chunked transfer coding. + * + * It is important to note that these types of filters are not allowed + * in a sub-request. A sub-requests output can certainly be filtered + * by AP_FTYPE_CONTENT filters, but all of the "final processing" is + * determined by the main request. + * + * The types have a particular sort order, which allows us to insert them + * into the filter chain in a determistic order. Within a particular grouping, + * the ordering is equivalent to the order of calls to ap_add_filter(). + */ +typedef enum { + AP_FTYPE_CONTENT, + AP_FTYPE_CONNECTION +} ap_filter_type; + +/* + * ap_filter_t: + * + * This is the request-time context structure for an installed filter (in + * the output filter chain). It provides the callback to use for filtering, + * the request this filter is associated with (which is important when + * an output chain also includes sub-request filters), the context for this + * installed filter, and the filter ordering/chaining fields. + * + * Filter callbacks are free to use ->ctx as they please, to store context + * during the filter process. Generally, this is superior over associating + * the state directly with the request. A callback should not change any of + * the other fields. + */ +struct ap_filter_t { + ap_filter_func filter_func; + + void *ctx; + + ap_filter_type ftype; + ap_filter_t *next; +}; + +API_EXPORT(int) ap_pass_brigade(request_rec *r, ap_filter_t *filter, + ap_bucket_brigade *bucket); + + +/* + * ap_register_filter(): + * + * This function is used to register a filter with the system. After this + * registration is performed, then a filter may be added into the filter + * chain by using ap_add_filter() and simply specifying the name. + * + * The filter's callback and type should be passed. + */ +API_EXPORT(void) ap_register_filter(const char *name, + ap_filter_func filter_func, + ap_filter_type ftype); + +/* + * ap_add_filter(): + * + * Adds a named filter into the filter chain on the specified request record. + * The filter will be installed with the specified context pointer. + * + * Filters added in this way will always be placed at the end of the filters + * that have the same type (thus, the filters have the same order as the + * calls to ap_add_filter). If the current filter chain contains filters + * from another request, then this filter will be added before those other + * filters. + */ +API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r); + + +#ifdef __cplusplus +} +#endif + +#endif /* !AP_FILTER_H */ From 2354efda2354627fe65c01f6d279fe6c1e30142f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 25 Jul 2000 00:42:14 +0000 Subject: [PATCH 0469/7878] Changes to get Win32 compiling again, including substituting apr_string.h for apr_lib.h, fix some bad linkage declarations, and some more comments on threadproc/win32/proc.c PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60444 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 222 +++++++++++++++++++----------------- aprlib.dsp | 222 +++++++++++++++++++----------------- file_io/win32/dir.c | 2 +- file_io/win32/filedup.c | 2 +- file_io/win32/open.c | 2 +- file_io/win32/pipe.c | 2 +- include/apr_hash.h | 15 +-- locks/win32/locks.c | 2 +- misc/win32/names.c | 2 +- network_io/win32/sockaddr.c | 2 +- network_io/win32/sockopt.c | 2 +- threadproc/win32/proc.c | 5 +- 12 files changed, 260 insertions(+), 220 deletions(-) diff --git a/apr.dsp b/apr.dsp index be34fd83bb3..fd30b5d352b 100644 --- a/apr.dsp +++ b/apr.dsp @@ -68,8 +68,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -93,23 +93,23 @@ SOURCE=.\time\win32\access.c # End Source File # Begin Source File -SOURCE=.\lib\apr_cpystrn.c +SOURCE=.\strings\apr_cpystrn.c # End Source File # Begin Source File -SOURCE=.\lib\apr_execve.c +SOURCE=.\strings\apr_fnmatch.c # End Source File # Begin Source File -SOURCE=.\lib\apr_fnmatch.c +SOURCE=.\passwd\apr_getpass.c # End Source File # Begin Source File -SOURCE=.\lib\apr_getpass.c +SOURCE=.\tables\apr_hash.c # End Source File # Begin Source File -SOURCE=.\lib\apr_md5.c +SOURCE=.\passwd\apr_md5.c # End Source File # Begin Source File @@ -117,19 +117,23 @@ SOURCE=.\lib\apr_pools.c # End Source File # Begin Source File -SOURCE=.\lib\apr_snprintf.c +SOURCE=.\lib\apr_signal.c # End Source File # Begin Source File -SOURCE=.\lib\apr_strnatcmp.c +SOURCE=.\strings\apr_snprintf.c # End Source File # Begin Source File -SOURCE=.\lib\apr_tables.c +SOURCE=.\strings\apr_strings.c # End Source File # Begin Source File -SOURCE=.\aprlib.def +SOURCE=.\strings\apr_strnatcmp.c +# End Source File +# Begin Source File + +SOURCE=.\tables\apr_tables.c # End Source File # Begin Source File @@ -209,6 +213,11 @@ SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File +SOURCE=.\shmem\win32\shmem.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + SOURCE=.\threadproc\win32\signals.c # End Source File # Begin Source File @@ -244,191 +253,200 @@ SOURCE=.\time\win32\time.c SOURCE=.\time\win32\timestr.c # End Source File # End Group -# Begin Group "Header Files" +# Begin Group "Generated Header Files" -# PROP Default_Filter ".h" +# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr_dso.h +SOURCE=.\include\apr.h # End Source File # Begin Source File -SOURCE=.\include\apr_errno.h +SOURCE=.\include\apr_private.h # End Source File +# End Group +# Begin Group "Internal Header Files" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr_file_io.h +SOURCE=.\include\apr_private.hw + +!IF "$(CFG)" == "aprlib - Win32 Release" + +# Begin Custom Build +InputPath=.\include\apr_private.hw + +".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr_private.hw .\include\apr_private.h > nul + echo Created apr_private.h from apr_private.hw + +# End Custom Build + +!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" + +# Begin Custom Build +InputPath=.\include\apr_private.hw + +".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr_private.hw .\include\apr_private.h > nul + echo Created apr_private.h from apr_private.hw + +# End Custom Build + +!ENDIF + # End Source File # Begin Source File -SOURCE=.\include\apr_fnmatch.h +SOURCE=.\time\win32\atime.h # End Source File # Begin Source File -SOURCE=.\include\apr_general.h +SOURCE=.\dso\win32\dso.h # End Source File # Begin Source File -SOURCE=.\include\apr_getopt.h +SOURCE=.\file_io\win32\fileio.h # End Source File # Begin Source File -SOURCE=.\include\apr_lib.h +SOURCE=.\locks\win32\locks.h # End Source File # Begin Source File -SOURCE=.\include\apr_lock.h +SOURCE=.\misc\unix\misc.h # End Source File # Begin Source File -SOURCE=.\include\apr_md5.h +SOURCE=.\network_io\win32\networkio.h # End Source File # Begin Source File -SOURCE=.\include\apr_network_io.h +SOURCE=.\threadproc\win32\threadproc.h # End Source File +# End Group +# Begin Group "External Header Files" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr_pools.h +SOURCE=.\include\apr.h.in # End Source File # Begin Source File -SOURCE=.\include\apr_portable.h +SOURCE=.\include\apr.hw + +!IF "$(CFG)" == "aprlib - Win32 Release" + +# Begin Custom Build +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + +# End Custom Build + +!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" + +# Begin Custom Build +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + +# End Custom Build + +!ENDIF + # End Source File # Begin Source File -SOURCE=.\include\apr_shmem.h +SOURCE=.\include\apr_dso.h # End Source File # Begin Source File -SOURCE=.\include\apr_signal.h +SOURCE=.\include\apr_errno.h # End Source File # Begin Source File -SOURCE=.\include\apr_strnatcmp.h +SOURCE=.\include\apr_file_io.h # End Source File # Begin Source File -SOURCE=.\include\apr_tables.h +SOURCE=.\include\apr_fnmatch.h # End Source File # Begin Source File -SOURCE=.\include\apr_thread_proc.h +SOURCE=.\include\apr_general.h # End Source File # Begin Source File -SOURCE=.\include\apr_time.h +SOURCE=.\include\apr_getopt.h # End Source File # Begin Source File -SOURCE=.\include\apr_xlate.h +SOURCE=.\include\apr_hash.h # End Source File # Begin Source File -SOURCE=.\time\win32\atime.h +SOURCE=.\include\apr_lib.h # End Source File # Begin Source File -SOURCE=.\dso\win32\dso.h +SOURCE=.\include\apr_lock.h # End Source File # Begin Source File -SOURCE=.\file_io\win32\fileio.h +SOURCE=.\include\apr_md5.h # End Source File # Begin Source File -SOURCE=.\locks\win32\locks.h +SOURCE=.\include\apr_mmap.h # End Source File # Begin Source File -SOURCE=.\misc\unix\misc.h +SOURCE=.\include\apr_network_io.h # End Source File # Begin Source File -SOURCE=.\network_io\win32\networkio.h +SOURCE=.\include\apr_pools.h # End Source File # Begin Source File -SOURCE=.\threadproc\win32\threadproc.h +SOURCE=.\include\apr_portable.h # End Source File -# End Group -# Begin Group "Generated Header Files" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr.h +SOURCE=.\include\apr_shmem.h # End Source File # Begin Source File -SOURCE=.\include\apr_private.h +SOURCE=.\include\apr_strings.h # End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr_private.hw - -!IF "$(CFG)" == "aprlib - Win32 Release" - -# Begin Custom Build -InputPath=.\include\apr_private.hw - -".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr_private.hw .\include\apr_private.h > nul - echo Created apr_private.h from apr_private.hw - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" - -# Begin Custom Build -InputPath=.\include\apr_private.hw +SOURCE=.\include\apr_tables.h +# End Source File +# Begin Source File -".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr_private.hw .\include\apr_private.h > nul - echo Created apr_private.h from apr_private.hw - -# End Custom Build +SOURCE=.\include\apr_thread_proc.h +# End Source File +# Begin Source File -!ENDIF +SOURCE=.\include\apr_time.h +# End Source File +# Begin Source File +SOURCE=.\include\apr_xlate.h # End Source File # End Group -# Begin Group "External Header Files" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr.hw - -!IF "$(CFG)" == "aprlib - Win32 Release" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ENDIF - +SOURCE=.\aprlib.def +# PROP Exclude_From_Build 1 # End Source File -# End Group # End Target # End Project diff --git a/aprlib.dsp b/aprlib.dsp index be34fd83bb3..fd30b5d352b 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -68,8 +68,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -93,23 +93,23 @@ SOURCE=.\time\win32\access.c # End Source File # Begin Source File -SOURCE=.\lib\apr_cpystrn.c +SOURCE=.\strings\apr_cpystrn.c # End Source File # Begin Source File -SOURCE=.\lib\apr_execve.c +SOURCE=.\strings\apr_fnmatch.c # End Source File # Begin Source File -SOURCE=.\lib\apr_fnmatch.c +SOURCE=.\passwd\apr_getpass.c # End Source File # Begin Source File -SOURCE=.\lib\apr_getpass.c +SOURCE=.\tables\apr_hash.c # End Source File # Begin Source File -SOURCE=.\lib\apr_md5.c +SOURCE=.\passwd\apr_md5.c # End Source File # Begin Source File @@ -117,19 +117,23 @@ SOURCE=.\lib\apr_pools.c # End Source File # Begin Source File -SOURCE=.\lib\apr_snprintf.c +SOURCE=.\lib\apr_signal.c # End Source File # Begin Source File -SOURCE=.\lib\apr_strnatcmp.c +SOURCE=.\strings\apr_snprintf.c # End Source File # Begin Source File -SOURCE=.\lib\apr_tables.c +SOURCE=.\strings\apr_strings.c # End Source File # Begin Source File -SOURCE=.\aprlib.def +SOURCE=.\strings\apr_strnatcmp.c +# End Source File +# Begin Source File + +SOURCE=.\tables\apr_tables.c # End Source File # Begin Source File @@ -209,6 +213,11 @@ SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File +SOURCE=.\shmem\win32\shmem.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + SOURCE=.\threadproc\win32\signals.c # End Source File # Begin Source File @@ -244,191 +253,200 @@ SOURCE=.\time\win32\time.c SOURCE=.\time\win32\timestr.c # End Source File # End Group -# Begin Group "Header Files" +# Begin Group "Generated Header Files" -# PROP Default_Filter ".h" +# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr_dso.h +SOURCE=.\include\apr.h # End Source File # Begin Source File -SOURCE=.\include\apr_errno.h +SOURCE=.\include\apr_private.h # End Source File +# End Group +# Begin Group "Internal Header Files" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr_file_io.h +SOURCE=.\include\apr_private.hw + +!IF "$(CFG)" == "aprlib - Win32 Release" + +# Begin Custom Build +InputPath=.\include\apr_private.hw + +".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr_private.hw .\include\apr_private.h > nul + echo Created apr_private.h from apr_private.hw + +# End Custom Build + +!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" + +# Begin Custom Build +InputPath=.\include\apr_private.hw + +".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr_private.hw .\include\apr_private.h > nul + echo Created apr_private.h from apr_private.hw + +# End Custom Build + +!ENDIF + # End Source File # Begin Source File -SOURCE=.\include\apr_fnmatch.h +SOURCE=.\time\win32\atime.h # End Source File # Begin Source File -SOURCE=.\include\apr_general.h +SOURCE=.\dso\win32\dso.h # End Source File # Begin Source File -SOURCE=.\include\apr_getopt.h +SOURCE=.\file_io\win32\fileio.h # End Source File # Begin Source File -SOURCE=.\include\apr_lib.h +SOURCE=.\locks\win32\locks.h # End Source File # Begin Source File -SOURCE=.\include\apr_lock.h +SOURCE=.\misc\unix\misc.h # End Source File # Begin Source File -SOURCE=.\include\apr_md5.h +SOURCE=.\network_io\win32\networkio.h # End Source File # Begin Source File -SOURCE=.\include\apr_network_io.h +SOURCE=.\threadproc\win32\threadproc.h # End Source File +# End Group +# Begin Group "External Header Files" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr_pools.h +SOURCE=.\include\apr.h.in # End Source File # Begin Source File -SOURCE=.\include\apr_portable.h +SOURCE=.\include\apr.hw + +!IF "$(CFG)" == "aprlib - Win32 Release" + +# Begin Custom Build +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + +# End Custom Build + +!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" + +# Begin Custom Build +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + +# End Custom Build + +!ENDIF + # End Source File # Begin Source File -SOURCE=.\include\apr_shmem.h +SOURCE=.\include\apr_dso.h # End Source File # Begin Source File -SOURCE=.\include\apr_signal.h +SOURCE=.\include\apr_errno.h # End Source File # Begin Source File -SOURCE=.\include\apr_strnatcmp.h +SOURCE=.\include\apr_file_io.h # End Source File # Begin Source File -SOURCE=.\include\apr_tables.h +SOURCE=.\include\apr_fnmatch.h # End Source File # Begin Source File -SOURCE=.\include\apr_thread_proc.h +SOURCE=.\include\apr_general.h # End Source File # Begin Source File -SOURCE=.\include\apr_time.h +SOURCE=.\include\apr_getopt.h # End Source File # Begin Source File -SOURCE=.\include\apr_xlate.h +SOURCE=.\include\apr_hash.h # End Source File # Begin Source File -SOURCE=.\time\win32\atime.h +SOURCE=.\include\apr_lib.h # End Source File # Begin Source File -SOURCE=.\dso\win32\dso.h +SOURCE=.\include\apr_lock.h # End Source File # Begin Source File -SOURCE=.\file_io\win32\fileio.h +SOURCE=.\include\apr_md5.h # End Source File # Begin Source File -SOURCE=.\locks\win32\locks.h +SOURCE=.\include\apr_mmap.h # End Source File # Begin Source File -SOURCE=.\misc\unix\misc.h +SOURCE=.\include\apr_network_io.h # End Source File # Begin Source File -SOURCE=.\network_io\win32\networkio.h +SOURCE=.\include\apr_pools.h # End Source File # Begin Source File -SOURCE=.\threadproc\win32\threadproc.h +SOURCE=.\include\apr_portable.h # End Source File -# End Group -# Begin Group "Generated Header Files" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr.h +SOURCE=.\include\apr_shmem.h # End Source File # Begin Source File -SOURCE=.\include\apr_private.h +SOURCE=.\include\apr_strings.h # End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr_private.hw - -!IF "$(CFG)" == "aprlib - Win32 Release" - -# Begin Custom Build -InputPath=.\include\apr_private.hw - -".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr_private.hw .\include\apr_private.h > nul - echo Created apr_private.h from apr_private.hw - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" - -# Begin Custom Build -InputPath=.\include\apr_private.hw +SOURCE=.\include\apr_tables.h +# End Source File +# Begin Source File -".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr_private.hw .\include\apr_private.h > nul - echo Created apr_private.h from apr_private.hw - -# End Custom Build +SOURCE=.\include\apr_thread_proc.h +# End Source File +# Begin Source File -!ENDIF +SOURCE=.\include\apr_time.h +# End Source File +# Begin Source File +SOURCE=.\include\apr_xlate.h # End Source File # End Group -# Begin Group "External Header Files" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr.hw - -!IF "$(CFG)" == "aprlib - Win32 Release" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ENDIF - +SOURCE=.\aprlib.def +# PROP Exclude_From_Build 1 # End Source File -# End Group # End Target # End Project diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index d537c635b01..7dd3704bd46 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -55,7 +55,7 @@ #include "apr.h" #include "fileio.h" #include "apr_file_io.h" -#include "apr_lib.h" +#include "apr_strings.h" #include "apr_portable.h" #include "atime.h" diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 821649f900f..9e85387000f 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -55,7 +55,7 @@ #include "fileio.h" #include "apr_file_io.h" #include "apr_general.h" -#include "apr_lib.h" +#include "apr_strings.h" #include ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 0877b6c20d0..3944ffcd00b 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -56,7 +56,7 @@ #include "fileio.h" #include "apr_file_io.h" #include "apr_general.h" -#include "apr_lib.h" +#include "apr_strings.h" #include "apr_portable.h" #include #include diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index a9cc0d69cbd..85eb51f027d 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -55,7 +55,7 @@ #include "fileio.h" #include "apr_file_io.h" #include "apr_general.h" -#include "apr_lib.h" +#include "apr_strings.h" #include #include #include diff --git a/include/apr_hash.h b/include/apr_hash.h index 44fcb6e4763..02e3ca0bded 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -84,7 +84,7 @@ typedef struct ap_hash_index_t ap_hash_index_t; * @param pool The pool to allocate the hash table out of * @return The hash table just created */ -ap_hash_t *ap_make_hash(ap_pool_t *pool); +APR_EXPORT(ap_hash_t *) ap_make_hash(ap_pool_t *pool); /** * Associate a value with a key in a hash table. @@ -95,7 +95,8 @@ ap_hash_t *ap_make_hash(ap_pool_t *pool); * @param val Value to associate with the key * @tip If the value is NULL the hash entry is deleted. */ -void ap_hash_set(ap_hash_t *ht, const void *key, size_t klen, const void *val); +APR_EXPORT(void) ap_hash_set(ap_hash_t *ht, const void *key, size_t klen, + const void *val); /** * Look up the value associated with a key in a hash table. @@ -105,7 +106,7 @@ void ap_hash_set(ap_hash_t *ht, const void *key, size_t klen, const void *val); * If the length is 0 it is assumed to be strlen(key)+1 * @return Returns NULL if the key is not present. */ -void *ap_hash_get(ap_hash_t *ht, const void *key, size_t klen); +APR_EXPORT(void) *ap_hash_get(ap_hash_t *ht, const void *key, size_t klen); /** * Start iterating over the entries in a hash table. @@ -132,14 +133,14 @@ void *ap_hash_get(ap_hash_t *ht, const void *key, size_t klen); * progress at the same time. *

    */ -ap_hash_index_t *ap_hash_first(ap_hash_t *ht); +APR_EXPORT(ap_hash_index_t *) ap_hash_first(ap_hash_t *ht); /** * Continue iterating over the entries in a hash table. * @param hi The iteration state * @return a pointer to the updated iteration state. NULL if there are no more * entries. */ -ap_hash_index_t *ap_hash_next(ap_hash_index_t *hi); +APR_EXPORT(ap_hash_index_t *) ap_hash_next(ap_hash_index_t *hi); /** * Get the current entry's details from the iteration state. @@ -150,8 +151,8 @@ ap_hash_index_t *ap_hash_next(ap_hash_index_t *hi); * @tip The return pointers should point to a variable that will be set to the * corresponding data, or they may be NULL if the data isn't interesting. */ -void ap_hash_this(ap_hash_index_t *hi, const void **key, size_t *klen, - void **val); +APR_EXPORT(void) ap_hash_this(ap_hash_index_t *hi, const void **key, + size_t *klen, void **val); #ifdef __cplusplus } diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 0a43fd3044b..22f53b7b576 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -53,7 +53,7 @@ */ #include "apr_general.h" -#include "apr_lib.h" +#include "apr_strings.h" #include "locks.h" #include "apr_portable.h" diff --git a/misc/win32/names.c b/misc/win32/names.c index c6979a1995c..b5ca744d20f 100644 --- a/misc/win32/names.c +++ b/misc/win32/names.c @@ -55,7 +55,7 @@ #include "apr_private.h" #include "apr_file_io.h" #include "apr_general.h" -#include "apr_lib.h" +#include "apr_strings.h" #include #include #include diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index fe025c00c56..553b02084b3 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -55,7 +55,7 @@ #include "networkio.h" #include "apr_network_io.h" #include "apr_general.h" -#include "apr_lib.h" +#include "apr_strings.h" #include diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index b997e37f308..2d0845d63c7 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -55,7 +55,7 @@ #include "networkio.h" #include "apr_network_io.h" #include "apr_general.h" -#include "apr_lib.h" +#include "apr_strings.h" #include ap_status_t soblock(SOCKET sd) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 8027aeaaa7c..14819bfd7dc 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -58,7 +58,7 @@ #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_general.h" -#include "apr_lib.h" +#include "apr_strings.h" #include "apr_portable.h" #include #include @@ -404,6 +404,9 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, // The completion of the ap_proc_t type leaves us ill equiped to track both // the pid (Process ID) and handle to the process, which are entirely // different things and each useful in their own rights. + // + // Signals are broken since the hProcess varies from process to process, + // while the true process ID would not. new->pid = (pid_t) pi.hProcess; if (attr->child_in) { From 7a5775b260c25404b687271feedbbd6dd880d33a Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Tue, 25 Jul 2000 00:44:59 +0000 Subject: [PATCH 0470/7878] teeny patch to get the util_filter.[ch] built git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60445 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/README.txt | 2 +- buckets/register_patch.txt | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 buckets/register_patch.txt diff --git a/buckets/README.txt b/buckets/README.txt index 78b39801b2a..06a7758b964 100644 --- a/buckets/README.txt +++ b/buckets/README.txt @@ -50,4 +50,4 @@ Bachelor #3 -- The combination of #1 and #2 (hopefully) util_filter.h util_filter.c - + register_patch.txt diff --git a/buckets/register_patch.txt b/buckets/register_patch.txt new file mode 100644 index 00000000000..897e888443c --- /dev/null +++ b/buckets/register_patch.txt @@ -0,0 +1,17 @@ +Index: Makefile.in +=================================================================== +RCS file: /home/cvs/apache-2.0/src/main/Makefile.in,v +retrieving revision 1.16 +diff -u -r1.16 Makefile.in +--- Makefile.in 2000/07/01 14:14:15 1.16 ++++ Makefile.in 2000/07/25 00:42:50 +@@ -8,7 +8,8 @@ + http_protocol.c http_request.c http_vhost.c util.c util_date.c \ + util_script.c util_uri.c util_md5.c util_cfgtree.c util_ebcdic.c \ + rfc1413.c http_connection.c iol_file.c iol_socket.c listen.c \ +- mpm_common.c util_charset.c util_debug.c util_xml.c ++ mpm_common.c util_charset.c util_debug.c util_xml.c \ ++ util_filter.c + + include $(top_srcdir)/build/ltlib.mk + From 2c4bc2610410f858ec0ee91d41bede5a1cb29fe3 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Tue, 25 Jul 2000 00:52:11 +0000 Subject: [PATCH 0471/7878] oops. gotta declare r->filters. also need a bit of subrequest mgmt for the inserted filters. Submitted by: Greg Stein, Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60446 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/register_patch.txt | 76 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/buckets/register_patch.txt b/buckets/register_patch.txt index 897e888443c..417bafc9c42 100644 --- a/buckets/register_patch.txt +++ b/buckets/register_patch.txt @@ -15,3 +15,79 @@ diff -u -r1.16 Makefile.in include $(top_srcdir)/build/ltlib.mk +Index: httpd.h +=================================================================== +RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v +retrieving revision 1.64 +diff -u -r1.64 httpd.h +--- httpd.h 2000/06/30 21:18:13 1.64 ++++ httpd.h 2000/07/25 00:49:52 +@@ -731,7 +731,9 @@ + #ifdef APACHE_XLATE + struct ap_rr_xlate *rrx; + #endif /*APACHE_XLATE*/ +- ++ ++ struct ap_filter_t *filters; ++ + /* Things placed at the end of the record to avoid breaking binary + * compatibility. It would be nice to remember to reorder the entire + * record to improve 64bit alignment the next time we need to break +Index: http_request.c +=================================================================== +RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v +retrieving revision 1.35 +diff -u -r1.35 http_request.c +--- http_request.c 2000/06/24 17:33:57 1.35 ++++ http_request.c 2000/07/25 00:50:35 +@@ -769,6 +769,9 @@ + rnew->htaccess = r->htaccess; + rnew->per_dir_config = r->server->lookup_defaults; + ++ /* start with the same set of output filters */ ++ rnew->filters = r->filters; ++ + ap_set_sub_req_protocol(rnew, r); + + /* would be nicer to pass "method" to ap_set_sub_req_protocol */ +@@ -857,6 +860,9 @@ + rnew->htaccess = r->htaccess; + rnew->chunked = r->chunked; + ++ /* start with the same set of output filters */ ++ rnew->filters = r->filters; ++ + ap_set_sub_req_protocol(rnew, r); + fdir = ap_make_dirstr_parent(rnew->pool, r->filename); + +@@ -960,16 +966,22 @@ + + API_EXPORT(int) ap_run_sub_req(request_rec *r) + { +-#ifndef APACHE_XLATE +- int retval = ap_invoke_handler(r); +-#else /*APACHE_XLATE*/ +- /* Save the output conversion setting of the caller across subrequests */ + int retval; +- ap_xlate_t *saved_xlate; + +- ap_bgetopt(r->connection->client, BO_WXLATE, &saved_xlate); +- retval = ap_invoke_handler(r); +- ap_bsetopt(r->connection->client, BO_WXLATE, &saved_xlate); ++ /* see comments in process_request_internal() */ ++ ap_run_insert_filter(r); ++ ++#ifndef APACHE_XLATE ++ retval = ap_invoke_handler(r); ++#else /*APACHE_XLATE*/ ++ { ++ /* Save the output conversion setting across subrequests */ ++ ap_xlate_t *saved_xlate; ++ ++ ap_bgetopt(r->connection->client, BO_WXLATE, &saved_xlate); ++ retval = ap_invoke_handler(r); ++ ap_bsetopt(r->connection->client, BO_WXLATE, &saved_xlate); ++ } + #endif /*APACHE_XLATE*/ + ap_finalize_sub_req_protocol(r); + return retval; From 1e52e980cfb509a75b5dd76d6684580cc57ef421 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 25 Jul 2000 01:06:26 +0000 Subject: [PATCH 0472/7878] Add APR_EOL_STR for a platform specific text delimiter, provided by apr.h (defined in apr.h.in and apr.hw). This is needed -only- in APR created files (true raw files) such as logs. It is not required in any splat to screen (stderr/stdout) formatting, nor any html markup. Some other modules slipped through in the prior apr_strings.h commit. Sorry 'bout that. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60447 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 3 +++ include/apr.hw | 3 +++ 2 files changed, 6 insertions(+) diff --git a/include/apr.h.in b/include/apr.h.in index 4ef2ef615ec..cefa0534be9 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -132,6 +132,9 @@ typedef @off_t_value@ ap_off_t; /* And APR_OFF_T_FMT */ @off_t_fmt@ +/* Local machine definition for console and log output. */ +#define APR_EOL_STR "\n" + /* Define ap_signal and related necessary definitions. */ /* We are checking for HAVE_SIGACTION, but autoconf is filling this in diff --git a/include/apr.hw b/include/apr.hw index bf8fbe6e895..4bdf2812348 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -175,6 +175,9 @@ typedef int gid_t; #define APR_THREAD_FUNC __stdcall #define APR_OFF_T_FMT "ld" +/* Local machine definition for console and log output. */ +#define APR_EOL_STR "\r\n" + #if !defined(WIN32) || defined(APR_STATIC) /* Default Non-WIN32 behavior removes all MSVCisms */ #define APR_EXPORT(type) type From 6a6f9c38d80b9a3a2e7689c6c684032c31607a5d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 25 Jul 2000 01:33:27 +0000 Subject: [PATCH 0473/7878] Caught a bad var arg linkage declaration. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60448 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 3 ++- strings/apr_snprintf.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index 7f9e60afaf9..e8bfcb9bc7d 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -237,7 +237,8 @@ APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *has * @param ... The arguments to use to fill out the format string. * @deffunc int ap_snprintf(char *buf, size_t len, const char *format, ...) */ -APR_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format, ...) +APR_EXPORT_NONSTD(int) ap_snprintf(char *buf, size_t len, + const char *format, ...) __attribute__((format(printf,3,4))); /** diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 2fa0461ffc2..4e377f8a3db 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -1158,7 +1158,8 @@ static int snprintf_flush(ap_vformatter_buff_t *vbuff) } -APR_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format,...) +APR_EXPORT_NONSTD(int) ap_snprintf(char *buf, size_t len, + const char *format, ...) { int cc; va_list ap; From cf72fd79736fb6e2b39b0215288c3bb377ebe407 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 25 Jul 2000 03:31:41 +0000 Subject: [PATCH 0474/7878] Make the changes requested by Greg. 1) remove all instances of apr_buf.h from the two util_filter files. 2) remove ap_pass_brigade from the two files 3) remove parameters from ap_filter_func type. #3 causes warnings until we add those parameters back in. We can't release 2.0 with these files until we have a filter mechanism in place, so those warnings will go away in time. In the meantime, we just have to live with it. I also added some comments to the bottom of this file mentioning those things that were removed. I tried to keep those comments patch neutral while still leaving enough information for the next guy to help out with the patch implementation Submitted by: Greg Stein and Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60449 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/util_filter.c | 12 ------------ buckets/util_filter.h | 25 ++++++++++++++++++------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/buckets/util_filter.c b/buckets/util_filter.c index 5a30a0415ac..77bdc98728f 100644 --- a/buckets/util_filter.c +++ b/buckets/util_filter.c @@ -53,7 +53,6 @@ */ #include "util_filter.h" -#include "apr_buf.h" /* * ap_filter_rec_t: @@ -145,14 +144,3 @@ API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) } } -API_EXPORT(int) ap_pass_brigade(request_rec *r, ap_filter_t *filter, - ap_bucket_brigade *bucket) -{ - if (filter == NULL) { - return APR_ENOTIMPL; - } - else { - return (*filter->filter_func)(r, filter->next, bucket); - } -} - diff --git a/buckets/util_filter.h b/buckets/util_filter.h index 830912cba2a..f2f564a5a21 100644 --- a/buckets/util_filter.h +++ b/buckets/util_filter.h @@ -64,7 +64,6 @@ extern "C" { #endif #include "httpd.h" -#include "apr_buf.h" #include "apr.h" /* @@ -115,8 +114,7 @@ typedef struct ap_filter_t ap_filter_t; * next/prev to insert/remove/replace elements in the bucket list, but * the types and values of the individual buckets should not be altered. */ -typedef int (*ap_filter_func)(request_rec *r, ap_filter_t *filter, - ap_bucket_brigade *bucket); +typedef ap_status_t (*ap_filter_func)(); /* * ap_filter_type: @@ -170,10 +168,6 @@ struct ap_filter_t { ap_filter_t *next; }; -API_EXPORT(int) ap_pass_brigade(request_rec *r, ap_filter_t *filter, - ap_bucket_brigade *bucket); - - /* * ap_register_filter(): * @@ -202,6 +196,23 @@ API_EXPORT(void) ap_register_filter(const char *name, API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r); +/* + * Things to do later: + * Add parameters to ap_filter_func type. Those parameters will be something + * like: + * (request_rec *r, ap_filter_t *filter, ap_data_list *the_data) + * obviously, the request_rec is the current request, and the filter + * is the current filter stack. The data_list is a bucket list or + * bucket_brigade, but I am trying to keep this patch neutral. (If this + * comment breaks that, well sorry, but the information must be there + * somewhere. :-) + * + * Add a function like ap_pass_data. This function will basically just + * call the next filter in the chain, until the current filter is NULL. If the + * current filter is NULL, that means that nobody wrote to the network, and + * we have a HUGE bug, so we need to return an error and log it to the + * log file. + */ #ifdef __cplusplus } #endif From 576e9c56e853c4ebf8a55ff763eb7b1792cad695 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Tue, 25 Jul 2000 11:48:10 +0000 Subject: [PATCH 0475/7878] "flush_filters" is a misnomer. rename it. also shift it so that we can call it from sub-request finalization. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60450 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/register_patch.txt | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/buckets/register_patch.txt b/buckets/register_patch.txt index 417bafc9c42..07c1ae41bfb 100644 --- a/buckets/register_patch.txt +++ b/buckets/register_patch.txt @@ -91,3 +91,52 @@ diff -u -r1.35 http_request.c #endif /*APACHE_XLATE*/ ap_finalize_sub_req_protocol(r); return retval; +Index: http_protocol.c +=================================================================== +RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v +retrieving revision 1.97 +diff -u -r1.97 http_protocol.c +--- http_protocol.c 2000/07/21 19:50:47 1.97 ++++ http_protocol.c 2000/07/25 11:47:14 +@@ -1278,8 +1278,19 @@ + rnew->main = (request_rec *) r; + } + ++static void end_output_stream(request_rec *r) ++{ ++ /* ++ ** ### place holder to tell filters that no more content will be ++ ** ### arriving. typically, they will flush any pending content ++ */ ++} ++ + void ap_finalize_sub_req_protocol(request_rec *sub) + { ++ /* tell the filter chain there is no more content coming */ ++ end_output_stream(sub); ++ + SET_BYTES_SENT(sub->main); + } + +@@ -1833,11 +1844,6 @@ + #endif /*APACHE_XLATE*/ + } + +-static void flush_filters(request_rec *r) +-{ +- /* ### place holder to flush pending content through the filters */ +-} +- + /* finalize_request_protocol is called at completion of sending the + * response. It's sole purpose is to send the terminating protocol + * information for any wrappers around the response message body +@@ -1845,7 +1851,8 @@ + */ + API_EXPORT(void) ap_finalize_request_protocol(request_rec *r) + { +- flush_filters(r); ++ /* tell the filter chain there is no more content coming */ ++ end_output_stream(r); + + if (r->chunked && !r->connection->aborted) { + #ifdef APACHE_XLATE From 188f59e5a613358fc08bc388329b256166f58a53 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 25 Jul 2000 15:50:52 +0000 Subject: [PATCH 0476/7878] win32 ap_connect(): check for hostname; it is valid not to pass one, so don't fall over if hostname is NULL. The caller should have called ap_set_remote_ipaddr() if hostname is NULL. Submitted by: Gregory Nicholls git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60451 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 147c000ffc8..6c64a36e9dd 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -200,17 +200,19 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) return APR_ENOTSOCK; } - if (*hostname >= '0' && *hostname <= '9' && - strspn(hostname, "0123456789.") == strlen(hostname)) { - sock->remote_addr->sin_addr.s_addr = inet_addr(hostname); - } - else { - hp = gethostbyname(hostname); - if (!hp) { - return WSAGetLastError(); + if (hostname != NULL) { + if (*hostname >= '0' && *hostname <= '9' && + strspn(hostname, "0123456789.") == strlen(hostname)) { + sock->remote_addr->sin_addr.s_addr = inet_addr(hostname); + } + else { + hp = gethostbyname(hostname); + if (!hp) { + return WSAGetLastError(); + } + memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr_list[0], hp->h_length); + sock->addr_len = sizeof(*sock->remote_addr); } - memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr_list[0], hp->h_length); - sock->addr_len = sizeof(*sock->remote_addr); } sock->remote_addr->sin_family = AF_INET; From 8dd4f01c375c2e3a08c603ce7c2887fe48173947 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 25 Jul 2000 19:53:28 +0000 Subject: [PATCH 0477/7878] Change APRVARS.in to output EXTRA_LIBS instead of LIBS. Apache doesn't include LIBS in its build process. But it does include EXTRA_LIBS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60452 13f79535-47bb-0310-9956-ffa450edef68 --- APRVARS.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APRVARS.in b/APRVARS.in index 3f51b0b52a8..039ac16854b 100644 --- a/APRVARS.in +++ b/APRVARS.in @@ -1 +1 @@ -LIBS="@LIBS@" +EXTRA_LIBS="@LIBS@" From a3bf9e2ecdf72764c0da62fdb9f1fe0454ba5d39 Mon Sep 17 00:00:00 2001 From: dgaudet Date: Wed, 26 Jul 2000 01:56:02 +0000 Subject: [PATCH 0478/7878] - fix POOL_DEBUG ... restored the ap_pool_joins that dreid removed. - removed the apr_abort foo since every caller was passing it NULL anyway; and this is debugging code, so i don't have any qualms about using stderr or abort(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60453 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 50 ++++++++++++++++++++++++++++++++++++----- lib/apr_pools.c | 24 +++++++++++--------- memory/unix/apr_pools.c | 24 +++++++++++--------- tables/apr_tables.c | 12 +++++----- 4 files changed, 76 insertions(+), 34 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 0a70da34693..e84555cc16c 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -108,15 +108,53 @@ struct process_chain { struct process_chain *next; }; -/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t - * will not be destroyed before the parent pool +/* pools have nested lifetimes -- sub_pools are destroyed when the + * parent pool is cleared. We allow certain liberties with operations + * on things such as tables (and on other structures in a more general + * sense) where we allow the caller to insert values into a table which + * were not allocated from the table's pool. The table's data will + * remain valid as long as all the pools from which its values are + * allocated remain valid. + * + * For example, if B is a sub pool of A, and you build a table T in + * pool B, then it's safe to insert data allocated in A or B into T + * (because B lives at most as long as A does, and T is destroyed when + * B is cleared/destroyed). On the other hand, if S is a table in + * pool A, it is safe to insert data allocated in A into S, but it + * is *not safe* to insert data allocated from B into S... because + * B can be cleared/destroyed before A is (which would leave dangling + * pointers in T's data structures). + * + * In general we say that it is safe to insert data into a table T + * if the data is allocated in any ancestor of T's pool. This is the + * basis on which the POOL_DEBUG code works -- it tests these ancestor + * relationships for all data inserted into tables. POOL_DEBUG also + * provides tools (ap_find_pool, and ap_pool_is_ancestor) for other + * folks to implement similar restrictions for their own data + * structures. + * + * However, sometimes this ancestor requirement is inconvenient -- + * sometimes we're forced to create a sub pool (such as through + * ap_sub_req_lookup_uri), and the sub pool is guaranteed to have + * the same lifetime as the parent pool. This is a guarantee implemented + * by the *caller*, not by the pool code. That is, the caller guarantees + * they won't destroy the sub pool individually prior to destroying the + * parent pool. + * + * In this case the caller must call ap_pool_join() to indicate this + * guarantee to the POOL_DEBUG code. There are a few examples spread + * through the standard modules. */ #ifndef POOL_DEBUG -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts); +#ifdef ap_pool_join +#undef ap_pool_join +#endif +#define ap_pool_join(a,b) #else -APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, int (*apr_abort)(int retcode)); -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (*apr_abort)(int retcode)); -#endif /* POOL_DEBUG */ +APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub); +APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts); +APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); +#endif #ifdef ULTRIX_BRAIN_DEATH #define ap_fdopen(d,m) fdopen((d), (char *)(m)) diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 8b7321bf6fb..1bd061a49b9 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -762,8 +762,7 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, - int (*apr_abort)(int retcode)) +APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts) { const char *s = ts; union block_hdr **pb; @@ -776,16 +775,18 @@ APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, /* consider stuff on the stack to also be in the NULL pool... * XXX: there's cases where we don't want to assume this */ - APR_ABORT((stack_direction == -1 && - is_ptr_in_range(s, &ts, known_stack_point)) || - (stack_direction == 1 && - is_ptr_in_range(s, known_stack_point, &ts)), 1, apr_abort, - "Ouch! find_pool() called on pointer in a free block\n"); + if ((stack_direction == -1 && is_ptr_in_range(s, &ts, known_stack_point)) + || (stack_direction == 1 && is_ptr_in_range(s, known_stack_point, &ts))) { + abort(); + return NULL; + } /* search the global_block_list */ for (pb = &global_block_list; *pb; pb = &b->h.global_next) { b = *pb; if (is_ptr_in_range(s, b, b->h.endp)) { if (b->h.owning_pool == FREE_POOL) { + fprintf(stderr, + "Ouch! find_pool() called on pointer in a free block\n"); abort(); exit(1); } @@ -829,14 +830,15 @@ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, - int (*apr_abort)(int retcode)) +APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub) { union block_hdr *b; /* We could handle more general cases... but this is it for now. */ - APR_ABORT(sub->parent != p, 1, apr_abort, - "pool_join: p is not a parent of sub\n"); + if (sub->parent != p) { + fprintf(stderr, "pool_join: p is not parent of sub\n"); + abort(); + } while (p->joined) { p = p->joined; } diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 8b7321bf6fb..1bd061a49b9 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -762,8 +762,7 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, - int (*apr_abort)(int retcode)) +APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts) { const char *s = ts; union block_hdr **pb; @@ -776,16 +775,18 @@ APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, /* consider stuff on the stack to also be in the NULL pool... * XXX: there's cases where we don't want to assume this */ - APR_ABORT((stack_direction == -1 && - is_ptr_in_range(s, &ts, known_stack_point)) || - (stack_direction == 1 && - is_ptr_in_range(s, known_stack_point, &ts)), 1, apr_abort, - "Ouch! find_pool() called on pointer in a free block\n"); + if ((stack_direction == -1 && is_ptr_in_range(s, &ts, known_stack_point)) + || (stack_direction == 1 && is_ptr_in_range(s, known_stack_point, &ts))) { + abort(); + return NULL; + } /* search the global_block_list */ for (pb = &global_block_list; *pb; pb = &b->h.global_next) { b = *pb; if (is_ptr_in_range(s, b, b->h.endp)) { if (b->h.owning_pool == FREE_POOL) { + fprintf(stderr, + "Ouch! find_pool() called on pointer in a free block\n"); abort(); exit(1); } @@ -829,14 +830,15 @@ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -APR_EXPORT(int) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, - int (*apr_abort)(int retcode)) +APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub) { union block_hdr *b; /* We could handle more general cases... but this is it for now. */ - APR_ABORT(sub->parent != p, 1, apr_abort, - "pool_join: p is not a parent of sub\n"); + if (sub->parent != p) { + fprintf(stderr, "pool_join: p is not parent of sub\n"); + abort(); + } while (p->joined) { p = p->joined; } diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 8c417b2eba2..f8b6b04c849 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -390,11 +390,11 @@ APR_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!ap_pool_is_ancestor(ap_find_pool(key, NULL), t->a.cont)) { + if (!ap_pool_is_ancestor(ap_find_pool(key), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!ap_pool_is_ancestor(ap_find_pool(val, NULL), t->a.cont)) { + if (!ap_pool_is_ancestor(ap_find_pool(val), t->a.cont)) { fprintf(stderr, "table_set: val not in ancestor pool of t\n"); abort(); } @@ -479,11 +479,11 @@ APR_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!ap_pool_is_ancestor(ap_find_pool(key, NULL), t->a.cont)) { + if (!ap_pool_is_ancestor(ap_find_pool(key), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!ap_pool_is_ancestor(ap_find_pool(val, NULL), t->a.cont)) { + if (!ap_pool_is_ancestor(ap_find_pool(val), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } @@ -519,11 +519,11 @@ APR_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!ap_pool_is_ancestor(ap_find_pool(key, NULL), t->a.cont)) { + if (!ap_pool_is_ancestor(ap_find_pool(key), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!ap_pool_is_ancestor(ap_find_pool(val, NULL), t->a.cont)) { + if (!ap_pool_is_ancestor(ap_find_pool(val), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } From 42882d2bc7334e08f9741e85f7b6012f2b60d7bc Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 26 Jul 2000 15:31:29 +0000 Subject: [PATCH 0479/7878] Remove all of the ap_is* functions from Apache. They were already in APR, and we all hate duplicate code. :-) This also required adding ap_isascii to APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60454 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 ++- include/apr.h.in | 1 + include/apr_lib.h | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 7328b70a479..4aac7f0e5f2 100644 --- a/configure.in +++ b/configure.in @@ -238,7 +238,7 @@ AC_HEADER_STDC AC_CHECK_HEADERS(ByteOrder.h) AC_CHECK_HEADERS(conio.h) AC_CHECK_HEADERS(crypt.h) -AC_CHECK_HEADERS(ctype.h) +AC_CHECK_HEADERS(ctype.h, ctypeh="1", ctypeh="0") AC_CHECK_HEADERS(dir.h) AC_CHECK_HEADERS(dirent.h, direnth="1", dirent="0") AC_CHECK_HEADERS(errno.h, errnoh="1", errnoh="0") @@ -290,6 +290,7 @@ AC_CHECK_HEADERS(dl.h) AC_CHECK_HEADERS(kernel/OS.h) +AC_SUBST(ctypeh) AC_SUBST(errnoh) AC_SUBST(direnth) AC_SUBST(fcntlh) diff --git a/include/apr.h.in b/include/apr.h.in index cefa0534be9..e9b95ee0fbc 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -24,6 +24,7 @@ #define ENUM_BITFIELD(e,n,w) e n : w #endif +#define APR_HAVE_CTYPE_H @ctypeh@ #define APR_HAVE_ERRNO_H @errnoh@ #define APR_HAVE_DIRENT_H @direnth@ #define APR_HAVE_FCNTL_H @fcntlh@ diff --git a/include/apr_lib.h b/include/apr_lib.h index e8bfcb9bc7d..e5e76ee1800 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -62,6 +62,9 @@ #include "apr_file_io.h" #include "apr_thread_proc.h" +#if APR_HAVE_CTYPE_H +#include +#endif #if APR_HAVE_STDARG_H #include #endif @@ -117,6 +120,7 @@ APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); #define ap_isdigit(c) (isdigit(((unsigned char)(c)))) #define ap_isgraph(c) (isgraph(((unsigned char)(c)))) #define ap_islower(c) (islower(((unsigned char)(c)))) +#define ap_isascii(c) (isascii(((unsigned char)(c)))) #define ap_isprint(c) (isprint(((unsigned char)(c)))) #define ap_ispunct(c) (ispunct(((unsigned char)(c)))) #define ap_isspace(c) (isspace(((unsigned char)(c)))) From 4ab38cbca2087548528c804253b0bfb63f448206 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 28 Jul 2000 20:21:13 +0000 Subject: [PATCH 0480/7878] Update the APR docs about how to document APR functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60455 13f79535-47bb-0310-9956-ffa450edef68 --- APRDesign | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/APRDesign b/APRDesign index 2a5ffa6b43e..1fb06ac6d7c 100644 --- a/APRDesign +++ b/APRDesign @@ -161,33 +161,29 @@ Documentation Whenever a new function is added to APR, it MUST be documented. New functions will not be committed unless there are docs to go along with them. -The documentation should be a comment block above the function in the unix -.c file. This does not mean you must implement the function for Unix. But, -it would be nice if you submitted a file with the prototypes and the comments -above the prototypes to be checked into the unix tree. +The documentation should be a comment block above the function in the header +file. The format for the comment block is: -/* - -=head1 function prototype - -B - - arg 1) explanation of arg 1 - arg 2) explanation of arg 2 - arg N) explanation of arg N - -B: Any extra information the programmer needs. - -=cut +/** + * Brief description of the function + * @param parma_1_name explanation + * @param parma_2_name explanation + * @param parma_n_name explanation + * @tip Any extra information people should know. + * @deffunc function prototype if required */ -The spacing for the documentation is VERY important, because the docs are -processed with perldoc, and this spacing is required for the perldoc scripts -to work properly. +The last line is not strictly needed. The parser in ScanDoc is not perfect +yet, and it can not parse prototypes that are in any form other than + return_type program_name(type1 param1, type2 param2, ...) +This means that any function prototype that resembles: + APR_EXPORT(ap_status_t) ap_foo(int f1, char *f2) +will need the deffunc. -For an actual example, look at any function in the fileio/unix directory. +For an actual example, look at any file in the include directory (ap_tables.h +hasn't been done yet). APR Error reporting From 6ddac115625b75f29b91255219bcf193073b7c79 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 29 Jul 2000 12:52:09 +0000 Subject: [PATCH 0481/7878] ap_setprocattr_limit() was broken due to missing break statements. The caller could get APR_ENOTIMPL when the limit was set; the limit argument could be used for more than what the caller specified. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60456 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index ca8be5050ad..07f977b60b8 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -407,18 +407,21 @@ ap_status_t ap_setprocattr_limit(ap_procattr_t *attr, ap_int32_t what, case APR_LIMIT_CPU: #ifdef RLIMIT_CPU attr->limit_cpu = limit; + break; #else return APR_ENOTIMPL; #endif case APR_LIMIT_MEM: #if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS) attr->limit_mem = limit; + break; #else return APR_ENOTIMPL; #endif case APR_LIMIT_NPROC: #ifdef RLIMIT_NPROC attr->limit_nproc = limit; + break; #else return APR_ENOTIMPL; #endif From 4c417e62de204f95e429e8835553b07d31d02081 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 29 Jul 2000 16:24:11 +0000 Subject: [PATCH 0482/7878] Remove iol_socket.h. This file had one declaration, and it makes more sense for that declaraion to move to ap_iol.h. This also modifies all of the files that include iol_socket.h to include ap_iol.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60457 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/scandoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/scandoc b/helpers/scandoc index a35bdc26906..5d6804eb4c6 100755 --- a/helpers/scandoc +++ b/helpers/scandoc @@ -346,7 +346,7 @@ sub handleCommentLine { my $entry = { 'type' => $type, 'name' => $name, 'longname'=> $name, - 'fullname'=> "$name$decl", + 'fullname'=> "$name $decl", 'scopename'=>"$baseScope$name", 'uname' => $dbname, 'decl' => $decl, From 2d82ce3ae9e5dc09bc350d3997bac086deee7108 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 30 Jul 2000 01:58:18 +0000 Subject: [PATCH 0483/7878] ap_dso_sym: . if using dlsym() to look for the symbol, use dlerror() to store an error message if dlsym() fails . slightly increase the chances that the HP-UX code will actually work by avoiding the reference to retval (compile problem) and updating *ressym (run-time problem) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60458 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index e20d16014ea..c3e815fa67e 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -113,10 +113,11 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, status = shl_findsym((shl_t *)&handle->handle, symname, TYPE_DATA, &symaddr); if (status = -1) return APR_EINIT; - ressym = symaddr; - + *ressym = symaddr; + return APR_SUCCESS; +#else /* not HP-UX; use dlsym()/dlerror() */ -#elif defined(DLSYM_NEEDS_UNDERSCORE) +#if defined(DLSYM_NEEDS_UNDERSCORE) void *retval; char *symbol = (char*)malloc(sizeof(char)*(strlen(symname)+2)); sprintf(symbol, "_%s", symname); @@ -129,12 +130,15 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, void *retval = dlsym(handle->handle, symname); #endif - if (retval == NULL) + if (retval == NULL) { + handle->errormsg = dlerror(); return APR_EINIT; + } *ressym = retval; return APR_SUCCESS; +#endif /* not HP-UX; use dlsym()/dlerror() */ } const char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) From 50514770aa62627948ac3818d1c471e83b1d4c0e Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 30 Jul 2000 12:01:53 +0000 Subject: [PATCH 0484/7878] Use the correct CR/LF line terminators on OS/2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60459 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 +++++ include/apr.h.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 4aac7f0e5f2..863c65fa97a 100644 --- a/configure.in +++ b/configure.in @@ -93,6 +93,7 @@ case "$OS" in OSDIR="os2" LIBPREFIX="" enable_apr_threads="system_threads" + eolstr="\\r\\n" ;; *beos*) OSDIR="beos" @@ -102,14 +103,18 @@ case "$OS" in native_mmap_emul="1" USE_MM=yes AC_CHECK_DEFINE(BONE_VERSION, sys/socket.h) + eolstr="\\n" ;; *) OSDIR="unix" config_subdirs="shmem/unix/mm" USE_MM=yes + eolstr="\\n" ;; esac +AC_SUBST(eolstr) + if test "$enable_apr_threads" = "system_threads"; then ac_cv_enable_threads="yes" fi diff --git a/include/apr.h.in b/include/apr.h.in index e9b95ee0fbc..c91c82febdd 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -134,7 +134,7 @@ typedef @off_t_value@ ap_off_t; @off_t_fmt@ /* Local machine definition for console and log output. */ -#define APR_EOL_STR "\n" +#define APR_EOL_STR "@eolstr@" /* Define ap_signal and related necessary definitions. */ From db41a75f583c9b805ed825e6ddd1d5518614147c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 31 Jul 2000 15:39:01 +0000 Subject: [PATCH 0485/7878] Fix some problems with which error code to use after a pthread_ failure. Most of the changes added support for PTHREAD_SETS_ERRNO; a few of the changes fixed bugs in existing code which always used errno (which doesn't get the right error code on most platforms). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60460 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/intraproc.c | 34 ++++++++++++++++++++++++++++++++-- threadproc/unix/thread.c | 15 +++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index 68ab1a88c37..e598e56e357 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -61,7 +61,15 @@ static ap_status_t lock_intra_cleanup(void *data) { ap_lock_t *lock = (ap_lock_t *) data; - return pthread_mutex_unlock(lock->intraproc); + ap_status_t stat; + + stat = pthread_mutex_unlock(lock->intraproc); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + return stat; } ap_status_t ap_unix_create_intra_lock(ap_lock_t *new) @@ -75,16 +83,25 @@ ap_status_t ap_unix_create_intra_lock(ap_lock_t *new) return errno; } if ((stat = pthread_mutexattr_init(&mattr))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif lock_intra_cleanup(new); return stat; } if ((stat = pthread_mutex_init(new->intraproc, &mattr))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif lock_intra_cleanup(new); return stat; } if ((stat = pthread_mutexattr_destroy(&mattr))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif lock_intra_cleanup(new); return stat; } @@ -97,7 +114,15 @@ ap_status_t ap_unix_create_intra_lock(ap_lock_t *new) ap_status_t ap_unix_lock_intra(ap_lock_t *lock) { - return pthread_mutex_lock(lock->intraproc); + ap_status_t stat; + + stat = pthread_mutex_lock(lock->intraproc); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + return stat; } ap_status_t ap_unix_unlock_intra(ap_lock_t *lock) @@ -105,6 +130,11 @@ ap_status_t ap_unix_unlock_intra(ap_lock_t *lock) ap_status_t status; status = pthread_mutex_unlock(lock->intraproc); +#ifdef PTHREAD_SETS_ERRNO + if (status) { + status = errno; + } +#endif return status; } diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index c036db60b1d..469722d2550 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -76,6 +76,9 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) if (stat == 0) { return APR_SUCCESS; } +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif return stat; } @@ -92,6 +95,9 @@ ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) return APR_SUCCESS; } else { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif return stat; } } @@ -145,6 +151,9 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, return APR_SUCCESS; } else { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif return stat; } } @@ -164,6 +173,9 @@ ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) return APR_SUCCESS; } else { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif return stat; } } @@ -180,6 +192,9 @@ ap_status_t ap_thread_detach(ap_thread_t *thd) return APR_SUCCESS; } else { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif return stat; } } From 6985da0e94b21d3f12f4851e3358a0b30ec9e7a7 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 31 Jul 2000 19:51:22 +0000 Subject: [PATCH 0486/7878] Win32: Return error codes on ap_generate_random() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60461 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/rand.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 1f6770e6275..2c7abd595b7 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -61,18 +61,10 @@ ap_status_t ap_generate_random_bytes(unsigned char * buf, int length) HCRYPTPROV hProv; if (!CryptAcquireContext(&hProv,NULL,NULL,PROV_RSA_FULL,0)) { - /* ap_log_error(APLOG_MARK, APLOG_CRIT, 0, s, - "Digest: Error acquiring context. Errno = %d", - GetLastError()); - exit(EXIT_FAILURE);*/ - return 1; + return GetLastError(); } if (!CryptGenRandom(hProv,length,buf)) { - /* ap_log_error(APLOG_MARK, APLOG_CRIT, 0, s, - "Digest: Error generating secret. Errno = %d", - GetLastError()); - exit(EXIT_FAILURE);*/ - return 1; + return GetLastError(); } return APR_SUCCESS; } From 48d15c6ac89ecb8f879f889fc5e8117c1b844270 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 31 Jul 2000 22:28:58 +0000 Subject: [PATCH 0487/7878] Combine the create and write functions. I am leaving the write function pointer in the structure because I think it is still useful, but having one API to create a bucket and put data in it is much cleaner. If we decide to have a list of free buckets, then the create function may not call malloc, it may grab a bucket off the free list. Regardless of where the memory comes from, create's job is to grab the memory from someplace and fill out the structure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60462 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 6 ++---- buckets/ap_mmap_buf.c | 10 +++++++--- buckets/ap_rmem_buf.c | 10 +++++++--- buckets/ap_rwmem_buf.c | 12 ++++++++---- buckets/apr_buf.h | 12 ++++++++---- 5 files changed, 32 insertions(+), 18 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 1d9d43860f2..92e8d6b72f1 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -258,8 +258,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) break; j = strlen(x); - r = ap_bucket_rwmem_create(); - rv = r->write(r, x, j, &i); + r = ap_bucket_rwmem_create(x, j, &i); if (i != j) { /* Do we need better error reporting? */ return -1; @@ -294,8 +293,7 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis res = ap_vsnprintf(buf, 4096, fmt, va); - r = ap_bucket_rwmem_create(); - res = r->write(r, buf, strlen(buf), &i); + r = ap_bucket_rwmem_create(buf, strlen(buf), &i); ap_bucket_brigade_append_buckets(b, r); return res; diff --git a/buckets/ap_mmap_buf.c b/buckets/ap_mmap_buf.c index 2edce928d00..7f1a3dc6d8d 100644 --- a/buckets/ap_mmap_buf.c +++ b/buckets/ap_mmap_buf.c @@ -88,8 +88,9 @@ static ap_status_t mmap_split(ap_bucket *e, ap_size_t nbyte) ap_bucket *newbuck; ap_bucket_mmap *a = (ap_bucket_mmap *)e->data; ap_bucket_mmap *b; + ap_ssize_t dump; - newbuck = ap_bucket_mmap_create(); + newbuck = ap_bucket_mmap_create(a->alloc_addr, a->len, &dump); b = (ap_bucket_mmap *)newbuck->data; a->alloc_addr = a->alloc_addr + nbyte; a->len = b->len - nbyte; @@ -103,7 +104,8 @@ static ap_status_t mmap_split(ap_bucket *e, ap_size_t nbyte) return APR_SUCCESS; } -APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(void) +APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(const void *buf, + ap_size_t nbytes, ap_ssize_t *w) { ap_bucket *newbuf; ap_bucket_mmap *b; @@ -114,13 +116,15 @@ APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(void) b->alloc_addr = NULL; b->len = 0; + newbuf->data = b; + mmap_bucket_insert(newbuf, buf, nbytes, w); + newbuf->color = AP_BUCKET_mmap; newbuf->read = mmap_get_str; newbuf->getlen = mmap_get_len; newbuf->write = mmap_bucket_insert; newbuf->split = mmap_split; newbuf->free = NULL; - newbuf->data = b; return newbuf; } diff --git a/buckets/ap_rmem_buf.c b/buckets/ap_rmem_buf.c index 9f33afbbacd..6b2719d6537 100644 --- a/buckets/ap_rmem_buf.c +++ b/buckets/ap_rmem_buf.c @@ -80,8 +80,9 @@ static ap_status_t rmem_split(ap_bucket *e, ap_size_t nbyte) ap_bucket *newbuck; ap_bucket_rmem *a = (ap_bucket_rmem *)e->data; ap_bucket_rmem *b; + ap_ssize_t dump; - newbuck = ap_bucket_rmem_create(); + newbuck = ap_bucket_rmem_create(a->start, a->alloc_len, &dump); b = (ap_bucket_rmem *)newbuck->data; b->alloc_len = a->alloc_len - nbyte; @@ -124,7 +125,8 @@ static ap_status_t rmem_insert(ap_bucket *e, const void *buf, return APR_SUCCESS; } -APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(void) +APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(const void *buf, + ap_size_t nbyte, ap_ssize_t *w) { ap_bucket *newbuf; ap_bucket_rmem *b; @@ -135,13 +137,15 @@ APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(void) b->alloc_len = 0; b->start = b->end = NULL; + newbuf->data = b; + rmem_insert(newbuf, buf, nbyte, w); + newbuf->color = AP_BUCKET_rmem; newbuf->read = rmem_get_str; newbuf->getlen = rmem_get_len; newbuf->write = rmem_insert; newbuf->split = rmem_split; newbuf->free = NULL; - newbuf->data = b; return newbuf; } diff --git a/buckets/ap_rwmem_buf.c b/buckets/ap_rwmem_buf.c index ad34213b266..b01ef7427f9 100644 --- a/buckets/ap_rwmem_buf.c +++ b/buckets/ap_rwmem_buf.c @@ -86,9 +86,10 @@ static ap_status_t rwmem_split(ap_bucket *e, ap_size_t nbyte) ap_bucket *newbuck; ap_bucket_rwmem *a = (ap_bucket_rwmem *)e; ap_bucket_rwmem *b; + ap_ssize_t dump; - newbuck = ap_bucket_rwmem_create(); - b = (ap_bucket_rwmem *)newbuck; + newbuck = ap_bucket_rwmem_create(a->alloc_addr, a->alloc_len, &dump); + b = (ap_bucket_rwmem *)newbuck->data; b->alloc_addr = a->alloc_addr; b->alloc_len = a->alloc_len; @@ -141,7 +142,8 @@ static ap_status_t rwmem_insert(ap_bucket *e, const void *buf, return APR_SUCCESS; } -APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(void) +APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(const void *buf, + ap_size_t nbyte, ap_ssize_t *w) { ap_bucket *newbuf; ap_bucket_rwmem *b; @@ -154,13 +156,15 @@ APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(void) b->start = b->alloc_addr; b->end = b->alloc_addr; + newbuf->data = b; + rwmem_insert(newbuf, buf, nbyte, w); + newbuf->color = AP_BUCKET_rwmem; newbuf->read = rwmem_get_str; newbuf->getlen = rwmem_get_len; newbuf->write = rwmem_insert; newbuf->split = rwmem_split; newbuf->free = rwmem_destroy; - newbuf->data = b; return newbuf; } diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index ba2ff927e25..9ed2621df8c 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -57,8 +57,8 @@ #include "apr_mmap.h" #include "apr_errno.h" -#include "../../../include/ap_iol.h" #include "apr_private.h" +#include "../../../include/ap_iol.h" #ifdef HAVE_SYS_UIO_H #include /* for struct iovec */ #endif @@ -249,13 +249,17 @@ APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b); /****** Functions to Create Buckets of varying type ******/ /* Create a read/write memory bucket */ -APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(void); +APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(const void *buf, + ap_size_t nbyte, ap_ssize_t *w); + /* Create a mmap memory bucket */ -APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(void); +APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(const void *buf, + ap_size_t nbytes, ap_ssize_t *w); /* Create a read only memory bucket. */ -APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(void); +APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(const void *buf, + ap_size_t nbyte, ap_ssize_t *w); /* Create an End of Stream bucket */ APR_EXPORT(ap_bucket *) ap_bucket_eos_create(void); From 4e918ef0a11c8793f2c8a07afdbeb63e548c1d9d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 31 Jul 2000 23:23:38 +0000 Subject: [PATCH 0488/7878] bucket_brigade is too long to type in every function name. This just changes to names of all of the brigade functions to ap_brigade_foo. I don't think this should cause any confusion, and it sure makes coding this stuff much easier. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60463 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 24 ++++++++++++------------ buckets/apr_buf.h | 14 +++++++------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 92e8d6b72f1..1c6238da638 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -72,7 +72,7 @@ APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e) return APR_SUCCESS; } -APR_EXPORT(ap_status_t) ap_bucket_brigade_destroy(void *data) +APR_EXPORT(ap_status_t) ap_brigade_destroy(void *data) { ap_bucket_brigade *b = data; @@ -97,7 +97,7 @@ APR_EXPORT(ap_status_t) ap_bucket_list_destroy(ap_bucket *e) return APR_SUCCESS; } -APR_EXPORT(ap_bucket_brigade *) ap_bucket_brigade_create(ap_pool_t *p) +APR_EXPORT(ap_bucket_brigade *) ap_brigade_create(ap_pool_t *p) { ap_bucket_brigade *b; @@ -105,12 +105,12 @@ APR_EXPORT(ap_bucket_brigade *) ap_bucket_brigade_create(ap_pool_t *p) b->p = p; b->head = b->tail = NULL; - ap_register_cleanup(b->p, b, ap_bucket_brigade_destroy, - ap_bucket_brigade_destroy); + ap_register_cleanup(b->p, b, ap_brigade_destroy, + ap_brigade_destroy); return b; } -APR_EXPORT(void) ap_bucket_brigade_append_buckets(ap_bucket_brigade *b, +APR_EXPORT(void) ap_brigade_append_buckets(ap_bucket_brigade *b, ap_bucket *e) { ap_bucket *cur = e; @@ -128,7 +128,7 @@ APR_EXPORT(void) ap_bucket_brigade_append_buckets(ap_bucket_brigade *b, } } -APR_EXPORT(int) ap_bucket_brigade_to_iovec(ap_bucket_brigade *b, +APR_EXPORT(int) ap_brigade_to_iovec(ap_bucket_brigade *b, struct iovec *vec, int nvec) { ap_bucket *e; @@ -146,7 +146,7 @@ APR_EXPORT(int) ap_bucket_brigade_to_iovec(ap_bucket_brigade *b, return vec - orig; } -APR_EXPORT(void) ap_bucket_brigade_catenate(ap_bucket_brigade *a, +APR_EXPORT(void) ap_brigade_catenate(ap_bucket_brigade *a, ap_bucket_brigade *b) { if (b->head) { @@ -179,7 +179,7 @@ APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec) } } -APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, +APR_EXPORT(ap_status_t) ap_brigade_to_iol(ap_ssize_t *total_bytes, ap_bucket_brigade *b, ap_iol *iol) { @@ -190,7 +190,7 @@ APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, *total_bytes = 0; do { - iov_used = ap_bucket_brigade_to_iovec(b, vec, 16); + iov_used = ap_brigade_to_iovec(b, vec, 16); status = iol_writev(iol, vec, iov_used, &bytes); ap_consume_buckets(b, 16); @@ -248,7 +248,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) } k += i; - ap_bucket_brigade_append_buckets(b, rw); + ap_brigade_append_buckets(b, rw); } } @@ -265,7 +265,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) } k += i; - ap_bucket_brigade_append_buckets(b, r); + ap_brigade_append_buckets(b, r); } return k; @@ -294,7 +294,7 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis res = ap_vsnprintf(buf, 4096, fmt, va); r = ap_bucket_rwmem_create(buf, strlen(buf), &i); - ap_bucket_brigade_append_buckets(b, r); + ap_brigade_append_buckets(b, r); return res; } diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index 9ed2621df8c..fa3098962e8 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -194,27 +194,27 @@ struct ap_bucket_mmap { /* ****** Bucket Brigade Functions ***** */ /* Create a new bucket brigade */ -APR_EXPORT(ap_bucket_brigade *) ap_bucket_brigade_create(ap_pool_t *p); +APR_EXPORT(ap_bucket_brigade *) ap_brigade_create(ap_pool_t *p); /* destroy an enitre bucket brigade */ -APR_EXPORT(ap_status_t) ap_bucket_brigade_destroy(void *b); +APR_EXPORT(ap_status_t) ap_brigade_destroy(void *b); /* append bucket(s) to a bucket_brigade */ -APR_EXPORT(void) ap_bucket_brigade_append_buckets(ap_bucket_brigade *b, +APR_EXPORT(void) ap_brigade_append_buckets(ap_bucket_brigade *b, ap_bucket *e); /* consume nbytes from beginning of b -- call ap_bucket_destroy as appropriate, and/or modify start on last element */ -APR_EXPORT(void) ap_bucket_brigade_consume(ap_bucket_brigade *, int nbytes); +APR_EXPORT(void) ap_brigade_consume(ap_bucket_brigade *, int nbytes); /* create an iovec of the elements in a bucket_brigade... return number of elements used */ -APR_EXPORT(int) ap_bucket_brigade_to_iovec(ap_bucket_brigade *, +APR_EXPORT(int) ap_brigade_to_iovec(ap_bucket_brigade *, struct iovec *vec, int nvec); /* catenate bucket_brigade b onto bucket_brigade a, bucket_brigade b is empty after this */ -APR_EXPORT(void) ap_bucket_brigade_catenate(ap_bucket_brigade *a, +APR_EXPORT(void) ap_brigade_catenate(ap_bucket_brigade *a, ap_bucket_brigade *b); /* Destroy the first nvec buckets. */ @@ -222,7 +222,7 @@ APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec); /* save the buf out to the specified iol. This can be used to flush the data to the disk, or to send it out to the network. */ -APR_EXPORT(ap_status_t) ap_bucket_brigade_to_iol(ap_ssize_t *total_bytes, +APR_EXPORT(ap_status_t) ap_brigade_to_iol(ap_ssize_t *total_bytes, ap_bucket_brigade *a, ap_iol *iol); From 60c49a268cd935c9755a562e5f0ec869346af86d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 31 Jul 2000 23:30:04 +0000 Subject: [PATCH 0489/7878] Update the bucket brigade patch to work with the latest code. This is a much smaller patch than previous ones IMO. It also contains a lot of comments to help explain what is happening. This patch works with all legacy modules, as well as newer modules. I have removed the chunking filter with the understanding that it was mucking up the patch, and making things hard to follow. After we decide on a filter design, adding chunking back in should be easy to do. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60464 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ryan.patch | 526 ++++++++++++++++++++++++++------------------- 1 file changed, 306 insertions(+), 220 deletions(-) diff --git a/buckets/ryan.patch b/buckets/ryan.patch index 2e0be79cd48..977a86c8f80 100644 --- a/buckets/ryan.patch +++ b/buckets/ryan.patch @@ -1,14 +1,10 @@ -? include/util_filter.h -? lib/apr/buckets/Makefile.in -? lib/apr/include/apr_buf.h -? main/util_filter.c Index: ap/Makefile.in =================================================================== RCS file: /home/cvs/apache-2.0/src/ap/Makefile.in,v retrieving revision 1.4 diff -u -d -b -w -u -r1.4 Makefile.in --- ap/Makefile.in 2000/06/12 20:41:13 1.4 -+++ ap/Makefile.in 2000/07/20 21:16:23 ++++ ap/Makefile.in 2000/07/31 23:24:38 @@ -1,5 +1,5 @@ LTLIBRARY_NAME = libap.la @@ -19,30 +15,45 @@ diff -u -d -b -w -u -r1.4 Makefile.in Index: include/ap_iol.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/ap_iol.h,v -retrieving revision 1.19 -diff -u -d -b -w -u -r1.19 ap_iol.h ---- include/ap_iol.h 2000/05/29 04:22:02 1.19 -+++ include/ap_iol.h 2000/07/20 21:16:23 -@@ -58,6 +58,7 @@ +retrieving revision 1.21 +diff -u -d -b -w -u -r1.21 ap_iol.h +--- include/ap_iol.h 2000/07/29 17:43:01 1.21 ++++ include/ap_iol.h 2000/07/31 23:24:40 +@@ -58,7 +58,9 @@ #define AP_IOL_H #include "apr_general.h" /* For ap_s?size_t */ +#include "apr_network_io.h" /* For ap_hdtr_t */ #include "apr_errno.h" /* For ap_status_t and the APR_errnos */ ++#include "ap_config.h" /* For ap_status_t and the APR_errnos */ typedef struct ap_iol ap_iol; + typedef struct ap_iol_methods ap_iol_methods; Index: include/http_protocol.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/http_protocol.h,v retrieving revision 1.19 diff -u -d -b -w -u -r1.19 http_protocol.h --- include/http_protocol.h 2000/07/11 03:48:17 1.19 -+++ include/http_protocol.h 2000/07/20 21:16:23 -@@ -89,7 +89,7 @@ ++++ include/http_protocol.h 2000/07/31 23:24:40 +@@ -88,8 +88,19 @@ + */ API_EXPORT(void) ap_basic_http_header(request_rec *r); - /* Send the Status-Line and header fields for HTTP response */ +-/* Send the Status-Line and header fields for HTTP response */ - ++/* Send the Status-Line and header fields for HTTP response. Two functions ++ * are needed here because we are doing two very different things. 1) We ++ * setup the response based on the header values. For example, se setup ++ * chunking based on the values in the headers. This is done in ++ * ap_send_http_header. A slightly incorrect name, but it is the name from ++ * 1.3, so this means modules don't need to change as much. 2) Actually ++ * send the headers over the wire. Currently this is done in ++ * ap_send_http_header_real. This should most likely be changed to just ++ * create a bucket that contains the headers. In this way, the headers are ++ * treated just like regular data, and we avoid BUFF all together. That however ++ * is an enhancement that can be made after the core filtering is in place. ++ */ +API_EXPORT(void) ap_send_http_header_real(request_rec *l); API_EXPORT(void) ap_send_http_header(request_rec *l); @@ -50,15 +61,14 @@ diff -u -d -b -w -u -r1.19 http_protocol.h Index: include/httpd.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v -retrieving revision 1.64 -diff -u -d -b -w -u -r1.64 httpd.h ---- include/httpd.h 2000/06/30 21:18:13 1.64 -+++ include/httpd.h 2000/07/20 21:16:23 -@@ -596,6 +596,11 @@ +retrieving revision 1.66 +diff -u -d -b -w -u -r1.66 httpd.h +--- include/httpd.h 2000/07/29 19:50:07 1.66 ++++ include/httpd.h 2000/07/31 23:24:41 +@@ -589,6 +589,10 @@ * pointer back to the main request. */ -+ ap_array_header_t *filters; /* The array of filters to call */ + int headers_sent; /* Have we sent the headers for this request + * yet. + */ @@ -66,48 +76,121 @@ diff -u -d -b -w -u -r1.64 httpd.h /* Info about the request itself... we begin with stuff that only * protocol.c should ever touch... */ +Index: include/util_filter.h +=================================================================== +RCS file: /home/cvs/apache-2.0/src/include/util_filter.h,v +retrieving revision 1.1 +diff -u -d -b -w -u -r1.1 util_filter.h +--- include/util_filter.h 2000/07/28 20:30:53 1.1 ++++ include/util_filter.h 2000/07/31 23:24:41 +@@ -65,6 +65,7 @@ + + #include "httpd.h" + #include "apr.h" ++#include "apr_buf.h" + + /* + * FILTER CHAIN +@@ -114,7 +115,7 @@ + * next/prev to insert/remove/replace elements in the bucket list, but + * the types and values of the individual buckets should not be altered. + */ +-typedef ap_status_t (*ap_filter_func)(); ++typedef ap_status_t (*ap_filter_func)(request_rec *r, ap_filter_t *f, ap_bucket_brigade *b); + + /* + * ap_filter_type: +@@ -166,8 +167,22 @@ + + ap_filter_type ftype; + ap_filter_t *next; ++ ap_filter_t *prev; + }; + ++/* This function just passes the current bucket brigade down to the next ++ * filter on the filter stack. When a filter actually writes to the network ++ * (usually either core or SSL), that filter should return the number of bytes ++ * actually written and it will get propogated back up to the handler. If ++ * nobody writes the data to the network, then this function will most likely ++ * seg fault. I haven't come up with a good way to detect that case yet, and ++ * it should never happen. Regardless, it's an unrecoverable error for the ++ * current request. I would just rather it didn't take out the whole child ++ * process. ++ */ ++API_EXPORT(int) ap_pass_brigade(request_rec *r, ap_filter_t *filter, ++ ap_bucket_brigade *bucket); ++ + /* + * ap_register_filter(): + * +@@ -192,9 +207,28 @@ + * calls to ap_add_filter). If the current filter chain contains filters + * from another request, then this filter will be added before those other + * filters. ++ * ++ * To re-iterate that last comment. This function is building a FIFO ++ * list of filters. Take note of that when adding your filter to the chain. + */ + API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r); + ++/* The next two filters are for abstraction purposes only. They could be ++ * done away with, but that would require that we break modules if we ever ++ * want to change our filter registration method. The basic idea, is that ++ * all filters have a place to store data, the ctx pointer. These functions ++ * fill out that pointer with a bucket brigade, and retrieve that data on ++ * the next call. The nice thing about these functions, is that they ++ * automatically concatenate the bucket brigades together for you. This means ++ * that if you have already stored a brigade in the filters ctx pointer, then ++ * when you add more it will be tacked onto the end of that brigade. When ++ * you retrieve data, if you pass in a bucket brigade to the get function, ++ * it will append the current brigade onto the one that you are retrieving. ++ */ ++API_EXPORT(ap_bucket_brigade *) ap_get_saved_data(request_rec *r, ++ ap_filter_t *f, ap_bucket_brigade **b); ++API_EXPORT(void) ap_save_data_to_filter(request_rec *r, ap_filter_t *f, ++ ap_bucket_brigade **b); + + /* + * Things to do later: +@@ -206,12 +240,6 @@ + * bucket_brigade, but I am trying to keep this patch neutral. (If this + * comment breaks that, well sorry, but the information must be there + * somewhere. :-) +- * +- * Add a function like ap_pass_data. This function will basically just +- * call the next filter in the chain, until the current filter is NULL. If the +- * current filter is NULL, that means that nobody wrote to the network, and +- * we have a HUGE bug, so we need to return an error and log it to the +- * log file. + */ + #ifdef __cplusplus + } Index: lib/apr/configure.in =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v -retrieving revision 1.136 -diff -u -d -b -w -u -r1.136 configure.in ---- lib/apr/configure.in 2000/07/15 15:39:05 1.136 -+++ lib/apr/configure.in 2000/07/20 21:16:24 -@@ -682,8 +682,8 @@ +retrieving revision 1.142 +diff -u -d -b -w -u -r1.142 configure.in +--- lib/apr/configure.in 2000/07/30 12:01:53 1.142 ++++ lib/apr/configure.in 2000/07/31 23:24:42 +@@ -688,8 +688,8 @@ AC_SUBST(EXEEXT) echo "Construct Makefiles and header files." --MAKEFILE1="Makefile lib/Makefile " --SUBDIRS="lib " -+MAKEFILE1="Makefile lib/Makefile buckets/Makefile" -+SUBDIRS="lib buckets" +-MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile" +-SUBDIRS="lib strings passwd tables " ++MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile buckets/Makefile" ++SUBDIRS="lib strings passwd tables buckets " for dir in $MODULES do test -d $dir || $MKDIR -p $dir -Index: main/Makefile.in -=================================================================== -RCS file: /home/cvs/apache-2.0/src/main/Makefile.in,v -retrieving revision 1.16 -diff -u -d -b -w -u -r1.16 Makefile.in ---- main/Makefile.in 2000/07/01 14:14:15 1.16 -+++ main/Makefile.in 2000/07/20 21:16:29 -@@ -8,7 +8,7 @@ - http_protocol.c http_request.c http_vhost.c util.c util_date.c \ - util_script.c util_uri.c util_md5.c util_cfgtree.c util_ebcdic.c \ - rfc1413.c http_connection.c iol_file.c iol_socket.c listen.c \ -- mpm_common.c util_charset.c util_debug.c util_xml.c -+ mpm_common.c util_charset.c util_debug.c util_xml.c util_filter.c - - include $(top_srcdir)/build/ltlib.mk - Index: main/http_core.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v -retrieving revision 1.88 -diff -u -d -b -w -u -r1.88 http_core.c ---- main/http_core.c 2000/07/11 03:48:18 1.88 -+++ main/http_core.c 2000/07/20 21:16:29 -@@ -71,6 +71,8 @@ +retrieving revision 1.93 +diff -u -d -b -w -u -r1.93 http_core.c +--- main/http_core.c 2000/07/29 19:50:08 1.93 ++++ main/http_core.c 2000/07/31 23:24:56 +@@ -72,6 +72,8 @@ #include "util_md5.h" #include "apr_fnmatch.h" #include "http_connection.h" @@ -116,7 +199,7 @@ diff -u -d -b -w -u -r1.88 http_core.c #include "util_ebcdic.h" #include "mpm.h" #ifdef HAVE_NETDB_H -@@ -86,6 +88,10 @@ +@@ -87,6 +89,10 @@ #include #endif @@ -127,34 +210,10 @@ diff -u -d -b -w -u -r1.88 http_core.c /* Allow Apache to use ap_mmap */ #ifdef USE_MMAP_FILES #include "apr_mmap.h" -@@ -2872,6 +2878,76 @@ +@@ -2880,6 +2886,52 @@ return OK; } -+/* This is an incredibly stupid chunking filter. This will need to be somewhat -+ * smart about when it actually sends the data, but this implements some sort -+ * of chunking for right now. -+ */ -+static int chunk_filter(request_rec *r, ap_filter_t *f, ap_bucket_brigade *b) -+{ -+ ap_bucket *dptr = b->head; -+ ap_bucket_brigade *c = ap_bucket_brigade_create(r->pool); -+ int len = 0; -+ -+ while (dptr) { -+ len += ap_get_bucket_len(dptr); -+ dptr = dptr->next; -+ } -+ -+ ap_brigade_printf(c, "%x\r\n", len); -+ ap_bucket_brigade_catenate(c, b); -+ dptr = ap_bucket_rwmem_create(); -+ dptr->insert(dptr, "\r\n", 2, &len); -+ ap_bucket_brigade_append_buckets(c, dptr); -+ -+ return ap_pass_brigade(r, f, c); -+} -+ +/* Default filter. This filter should almost always be used. It's only job + * is to send the headers if they haven't already been sent, and then send + * the actual data. To send the data, we create an iovec out of the bucket @@ -192,11 +251,11 @@ diff -u -d -b -w -u -r1.88 http_core.c + dptr = dptr->next; + } + if (len < MIN_SIZE_TO_WRITE && b->tail->color != AP_BUCKET_eos) { -+ ap_save_data_to_filter(r, f, b); ++ ap_save_data_to_filter(r, f, &b); + return 0; + } + else { -+ ap_bucket_brigade_to_iol(&bytes_sent, b, r->connection->client->iol); ++ ap_brigade_to_iol(&bytes_sent, b, r->connection->client->iol); + return bytes_sent; + } +} @@ -204,37 +263,40 @@ diff -u -d -b -w -u -r1.88 http_core.c static const handler_rec core_handlers[] = { { "*/*", default_handler }, { "default-handler", default_handler }, -@@ -2894,6 +2970,14 @@ +@@ -2902,6 +2954,11 @@ static unsigned short core_port(const request_rec *r) { return DEFAULT_HTTP_PORT; } +static void core_register_filter(request_rec *r) +{ -+ if (r->chunked) { -+ ap_hook_filter(chunk_filter, r, NULL, NULL, AP_HOOK_TRANSPORT); -+ } -+ ap_hook_filter(core_filter, r, NULL, NULL, AP_HOOK_TRANSPORT_LAST); ++ ap_add_filter("CORE", NULL, r); +} + static void register_hooks(void) { ap_hook_post_config(core_post_config,NULL,NULL,AP_HOOK_REALLY_FIRST); -@@ -2906,6 +2990,8 @@ +@@ -2914,6 +2971,14 @@ /* FIXME: I suspect we can eliminate the need for these - Ben */ ap_hook_type_checker(do_nothing,NULL,NULL,AP_HOOK_REALLY_LAST); ap_hook_access_checker(do_nothing,NULL,NULL,AP_HOOK_REALLY_LAST); + ++ /* This is kind of odd, and it would be cool to clean it up a bit. ++ * The first function just registers the core's register_filter hook. ++ * The other associates a global name with the filter defined ++ * by the core module. ++ */ + ap_hook_insert_filter(core_register_filter, NULL, NULL, AP_HOOK_MIDDLE); ++ ap_register_filter("CORE", core_filter, AP_FTYPE_CONNECTION); } API_VAR_EXPORT module core_module = { Index: main/http_protocol.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v -retrieving revision 1.96 -diff -u -d -b -w -u -r1.96 http_protocol.c ---- main/http_protocol.c 2000/07/13 16:26:42 1.96 -+++ main/http_protocol.c 2000/07/20 21:16:29 +retrieving revision 1.99 +diff -u -d -b -w -u -r1.99 http_protocol.c +--- main/http_protocol.c 2000/07/28 20:31:00 1.99 ++++ main/http_protocol.c 2000/07/31 23:24:57 @@ -64,6 +64,8 @@ */ @@ -242,9 +304,9 @@ diff -u -d -b -w -u -r1.96 http_protocol.c +#include "apr_buf.h" +#include "util_filter.h" #include "ap_config.h" + #include "apr_strings.h" #include "httpd.h" - #include "http_config.h" -@@ -1812,7 +1814,11 @@ +@@ -1824,7 +1826,11 @@ ap_rfc822_date(date, r->request_time); ap_table_addn(r->headers_out, "Expires", date); } @@ -256,61 +318,56 @@ diff -u -d -b -w -u -r1.96 http_protocol.c /* Send the entire ap_table_t of header fields, terminated by an empty line. */ ap_table_do((int (*) (void *, const char *, const char *)) ap_send_header_field, -@@ -2443,15 +2449,23 @@ +@@ -2468,101 +2474,84 @@ + API_EXPORT(size_t) ap_send_mmap(ap_mmap_t *mm, request_rec *r, size_t offset, size_t length) { - size_t total_bytes_sent = 0; +- size_t total_bytes_sent = 0; - int n; - ap_ssize_t w; - char *addr; +- +- if (length == 0) +- return 0; +- +- +- length += offset; +- while (!r->connection->aborted && offset < length) { +- if (length - offset > MMAP_SEGMENT_SIZE) { +- n = MMAP_SEGMENT_SIZE; +- } +- else { +- n = length - offset; +- } ++ size_t bytes_sent = 0; + ap_bucket_brigade *bb = NULL; -+ ap_bucket *b = NULL; -+ ap_filter_t *f; - -+ /* if you are using the older API's, then Apache will initiate the -+ * filtering for you. -+ */ -+ f = ap_init_filter(r->pool); -+ - if (length == 0) - return 0; -- - length += offset; -+/* We can remove all of the MMAP_SEGMENT_SIZE stuff from Apache, because -+ * it is an optimization to be used for sending data. Since we are using -+ * bucket-brigades we need to move this optimization down to the bucket -+ * brigade stuff, but that can wait for a day or two. - while (!r->connection->aborted && offset < length) { - if (length - offset > MMAP_SEGMENT_SIZE) { - n = MMAP_SEGMENT_SIZE; -@@ -2467,76 +2481,132 @@ - total_bytes_sent += w; - offset += w; - } -+ */ +- ap_mmap_offset((void**)&addr, mm, offset); +- w = ap_rwrite(addr, n, r); +- if (w < 0) +- break; +- total_bytes_sent += w; +- offset += w; +- } ++ /* WE probably need to do something to make sure we are respecting the ++ * offset and length. I think I know how to do this, but I will wait ++ * until after the commit to actually write the code. ++ */ ++ bb = ap_brigade_create(r->pool); ++ ap_brigade_append_buckets(bb, ++ ap_bucket_mmap_create(mm, mm->size, &bytes_sent)); ++ bytes_sent = ap_pass_brigade(r, NULL, bb); - SET_BYTES_SENT(r); -+ /* This is far too complex for a final API, but it is an okay -+ * start. To finish this off, we will need a very clean API -+ * that does all of this for us. -+ */ -+ bb = ap_bucket_brigade_create(r->pool); -+ b = ap_bucket_mmap_create(); -+ b->insert(b, mm, mm->size, &total_bytes_sent); -+ bb->head = bb->tail = b; -+ total_bytes_sent = ap_pass_brigade(r, f, bb); -+ - return total_bytes_sent; +- return total_bytes_sent; ++ return bytes_sent; } #endif /* USE_MMAP_FILES */ API_EXPORT(int) ap_rputc(int c, request_rec *r) { + ap_bucket_brigade *bb = NULL; -+ ap_bucket *b = NULL; + ap_ssize_t written; -+ ap_filter_t *f; + if (r->connection->aborted) return EOF; @@ -320,20 +377,9 @@ diff -u -d -b -w -u -r1.96 http_protocol.c - return EOF; - } - SET_BYTES_SENT(r); -+ /* if you are using the older API's, then Apache will initiate the -+ * filtering for you. -+ */ -+ f = ap_init_filter(r->pool); -+ -+ /* This is far too complex for a final API, but it is an okay -+ * start. To finish this off, we will need a very clean API -+ * that does all of this for us. -+ */ -+ bb = ap_bucket_brigade_create(r->pool); -+ b = ap_bucket_rwmem_create(); -+ b->insert(b, &c, 1, &written); -+ bb->head = bb->tail = b; -+ ap_pass_brigade(r, f, bb); ++ bb = ap_brigade_create(r->pool); ++ ap_brigade_append_buckets(bb, ap_bucket_rwmem_create(&c, 1, &written)); ++ ap_pass_brigade(r, NULL, bb); + return c; } @@ -342,9 +388,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c { - int rcode; + ap_bucket_brigade *bb = NULL; -+ ap_bucket *b = NULL; + ap_ssize_t written; -+ ap_filter_t *f; if (r->connection->aborted) return EOF; @@ -356,20 +400,10 @@ diff -u -d -b -w -u -r1.96 http_protocol.c - } - SET_BYTES_SENT(r); - return rcode; -+ /* if you are using the older API's, then Apache will initiate the -+ * filtering for you. -+ */ -+ f = ap_init_filter(r->pool); -+ -+ /* This is far too complex for a final API, but it is an okay -+ * start. To finish this off, we will need a very clean API -+ * that does all of this for us. -+ */ -+ bb = ap_bucket_brigade_create(r->pool); -+ b = ap_bucket_rwmem_create(); -+ b->insert(b, str, strlen(str), &written); -+ bb->head = bb->tail = b; -+ ap_pass_brigade(r, f, bb); ++ bb = ap_brigade_create(r->pool); ++ ap_brigade_append_buckets(bb, ++ ap_bucket_rwmem_create(str, strlen(str), &written)); ++ ap_pass_brigade(r, NULL, bb); + + return written; } @@ -379,9 +413,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c - ap_ssize_t n; - ap_status_t rv; + ap_bucket_brigade *bb = NULL; -+ ap_bucket *b = NULL; + ap_ssize_t written; -+ ap_filter_t *f; if (r->connection->aborted) return EOF; @@ -394,20 +426,9 @@ diff -u -d -b -w -u -r1.96 http_protocol.c - } - SET_BYTES_SENT(r); - return n; -+ /* if you are using the older API's, then Apache will initiate the -+ * filtering for you. -+ */ -+ f = ap_init_filter(r->pool); -+ -+ /* This is far too complex for a final API, but it is an okay -+ * start. To finish this off, we will need a very clean API -+ * that does all of this for us. -+ */ -+ bb = ap_bucket_brigade_create(r->pool); -+ b = ap_bucket_rwmem_create(); -+ b->insert(b, buf, nbyte, &written); -+ bb->head = bb->tail = b; -+ ap_pass_brigade(r, f, bb); ++ bb = ap_brigade_create(r->pool); ++ ap_brigade_append_buckets(bb, ap_bucket_rwmem_create(buf, nbyte, &written)); ++ ap_pass_brigade(r, NULL, bb); + return written; } @@ -416,16 +437,11 @@ diff -u -d -b -w -u -r1.96 http_protocol.c - int n; + ap_bucket_brigade *bb = NULL; + ap_ssize_t written; -+ ap_filter_t *f; if (r->connection->aborted) return EOF; - +- - n = ap_vbprintf(r->connection->client, fmt, va); -+ /* if you are using the older API's, then Apache will initiate the -+ * filtering for you. -+ */ -+ f = ap_init_filter(r->pool); - if (n < 0) { - check_first_conn_error(r, "vrprintf", 0); @@ -433,13 +449,9 @@ diff -u -d -b -w -u -r1.96 http_protocol.c - } - SET_BYTES_SENT(r); - return n; -+ /* This is far too complex for a final API, but it is an okay -+ * start. To finish this off, we will need a very clean API -+ * that does all of this for us. -+ */ -+ bb = ap_bucket_brigade_create(r->pool); ++ bb = ap_brigade_create(r->pool); + written = ap_brigade_vprintf(bb, fmt, va); -+ ap_pass_brigade(r, f, bb); ++ ap_pass_brigade(r, NULL, bb); + return written; } @@ -449,7 +461,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c API_EXPORT_NONSTD(int) ap_rprintf(request_rec *r, const char *fmt, ...) { va_list va; -@@ -2546,46 +2616,58 @@ +@@ -2572,46 +2561,35 @@ return EOF; va_start(va, fmt); @@ -469,23 +481,13 @@ diff -u -d -b -w -u -r1.96 http_protocol.c { + ap_bucket_brigade *bb = NULL; + ap_ssize_t written; -+ ap_filter_t *f; va_list va; - int n; if (r->connection->aborted) return EOF; - -+ /* if you are using the older API's, then Apache will initiate the -+ * filtering for you. -+ */ -+ f = ap_init_filter(r->pool); -+ -+ /* This is far too complex for a final API, but it is an okay -+ * start. To finish this off, we will need a very clean API -+ * that does all of this for us. -+ */ -+ bb = ap_bucket_brigade_create(r->pool); +- ++ bb = ap_brigade_create(r->pool); va_start(va, r); - n = ap_vbputstrs(r->connection->client, va); + written = ap_brigade_vputstrs(bb, va); @@ -498,7 +500,7 @@ diff -u -d -b -w -u -r1.96 http_protocol.c - - SET_BYTES_SENT(r); - return n; -+ ap_pass_brigade(r, f, bb); ++ ap_pass_brigade(r, NULL, bb); + return written; } @@ -506,37 +508,25 @@ diff -u -d -b -w -u -r1.96 http_protocol.c { - ap_status_t rv; + ap_bucket_brigade *bb; -+ ap_bucket *b; -+ ap_filter_t *f; - if ((rv = ap_bflush(r->connection->client)) != APR_SUCCESS) { - check_first_conn_error(r, "rflush", rv); - return EOF; - } -+ /* if you are using the older API's, then Apache will initiate the -+ * filtering for you. -+ */ -+ f = ap_init_filter(r->pool); -+ -+ /* This is far too complex for a final API, but it is an okay -+ * start. To finish this off, we will need a very clean API -+ * that does all of this for us. -+ */ -+ bb = ap_bucket_brigade_create(r->pool); -+ b = ap_bucket_eos_create(); -+ bb->head = bb->tail = b; -+ ap_pass_brigade(r, f, bb); ++ bb = ap_brigade_create(r->pool); ++ ap_brigade_append_buckets(bb, ap_bucket_eos_create()); ++ ap_pass_brigade(r, NULL, bb); return 0; } Index: main/http_request.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v -retrieving revision 1.35 -diff -u -d -b -w -u -r1.35 http_request.c ---- main/http_request.c 2000/06/24 17:33:57 1.35 -+++ main/http_request.c 2000/07/20 21:16:29 -@@ -1263,6 +1263,12 @@ +retrieving revision 1.37 +diff -u -d -b -w -u -r1.37 http_request.c +--- main/http_request.c 2000/07/28 20:31:01 1.37 ++++ main/http_request.c 2000/07/31 23:24:57 +@@ -1276,6 +1276,12 @@ return; } @@ -549,3 +539,99 @@ diff -u -d -b -w -u -r1.35 http_request.c /* Take care of little things that need to happen when we're done */ ap_finalize_request_protocol(r); } +Index: main/util_filter.c +=================================================================== +RCS file: /home/cvs/apache-2.0/src/main/util_filter.c,v +retrieving revision 1.1 +diff -u -d -b -w -u -r1.1 util_filter.c +--- main/util_filter.c 2000/07/28 20:31:02 1.1 ++++ main/util_filter.c 2000/07/31 23:24:57 +@@ -73,7 +73,7 @@ + } ap_filter_rec_t; + + /* ### make this visible for direct manipulation? +- ### use a hash table ++ * ### use a hash table + */ + static ap_filter_rec_t *registered_filters = NULL; + +@@ -144,3 +144,63 @@ + } + } + ++/* Pass the buckets to the next filter in the filter stack. If the ++ * current filter is a handler, we should get NULL passed in instead of ++ * the current filter. At that point, we can just call the first filter in ++ * the stack, or r->filters. ++ */ ++API_EXPORT(int) ap_pass_brigade(request_rec *r, ap_filter_t *filter, ++ ap_bucket_brigade *bb) ++{ ++ if (filter) { ++ return (*filter->next->filter_func)(r, filter->next, bb); ++ } ++ else { ++ return (*r->filters->filter_func)(r, r->filters, bb); ++ } ++} ++ ++API_EXPORT(ap_bucket_brigade *) ap_get_saved_data(request_rec *r, ++ ap_filter_t *f, ap_bucket_brigade **b) ++{ ++ ap_bucket_brigade *bb = (ap_bucket_brigade *)f->ctx; ++ ++ /* If we have never stored any data in the filter, then we had better ++ * create an empty bucket brigade so that we can concat. ++ */ ++ if (!bb) { ++ bb = ap_brigade_create(r->pool); ++ } ++ ++ /* join the two brigades together. *b is now empty so we can ++ * safely destroy it. ++ */ ++ ap_brigade_catenate(bb, *b); ++ ap_brigade_destroy(*b); ++ /* clear out the filter's context pointer. If we don't do this, then ++ * when we save more data to the filter, we will be appended to what is ++ * currently there. This will mean repeating data.... BAD! :-) ++ */ ++ f->ctx = NULL; ++ ++ return bb; ++} ++ ++API_EXPORT(void) ap_save_data_to_filter(request_rec *r, ap_filter_t *f, ++ ap_bucket_brigade **b) ++{ ++ ap_bucket_brigade *bb = (ap_bucket_brigade *)f->ctx; ++ ++ /* If have never stored any data in the filter, then we had better ++ * create an empty bucket brigade so that we can concat. ++ */ ++ if (!bb) { ++ bb = ap_brigade_create(r->pool); ++ } ++ ++ /* Apend b to bb. This means b is now empty, and we can destory it safely. ++ */ ++ ap_brigade_catenate(bb, *b); ++ ap_brigade_destroy(*b); ++ f->ctx = bb; ++} +Index: os/unix/os.h +=================================================================== +RCS file: /home/cvs/apache-2.0/src/os/unix/os.h,v +retrieving revision 1.10 +diff -u -d -b -w -u -r1.10 os.h +--- os/unix/os.h 2000/05/15 23:02:57 1.10 ++++ os/unix/os.h 2000/07/31 23:25:01 +@@ -59,8 +59,6 @@ + #ifndef APACHE_OS_H + #define APACHE_OS_H + +-#include "ap_config.h" +- + #ifndef PLATFORM + #define PLATFORM "Unix" + #endif From db8c4287def3e8cb20089adcd9cd9e8f4a94d078 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 1 Aug 2000 00:26:54 +0000 Subject: [PATCH 0490/7878] Commit a bunch of docs for the bucket brigades code. This should clear up where things are and where I would like to see them go. Please, if there are any questions, or if I have been unclear, ask. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60465 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_buf.h | 163 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 149 insertions(+), 14 deletions(-) diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index fa3098962e8..72ef78cb22f 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -58,6 +58,8 @@ #include "apr_mmap.h" #include "apr_errno.h" #include "apr_private.h" +/* Currently we need this, but when the filtering is done, the iol's should + * just go away all together, and so will this. :-) */ #include "../../../include/ap_iol.h" #ifdef HAVE_SYS_UIO_H #include /* for struct iovec */ @@ -109,6 +111,14 @@ * easily. */ +/* The types of bucket brigades the code knows about. We really don't need + * this enum. All access to the bucket brigades can be done through function + * pointers in the bucket type. However, when we start to do conversion + * routines, this enum will be a huge performance benefit, so we leave it + * alone. As of this moment, only rwmem, rmem, mmap, and eos buckets have + * been implemented. The rest will wait until the filtering design is + * decided upon, or until somebody gets around to them. + */ typedef enum { AP_BUCKET_rwmem, AP_BUCKET_rmem, @@ -123,6 +133,30 @@ typedef enum { } ap_bucket_color_e; typedef struct ap_bucket ap_bucket; +/* + * The basic bucket type. This is an abstraction on top of all other bucket + * types. This contains the type of bucket, a pointer to the bucket, and + * a couple of function pointers. Doing it this way, lets us morph buckets + * from one type to another relatively easily. Just change the data pointer + * to point to the new bucket, and replace all of the function pointers. + * + * This also allows for a very simple interface for all features of buckets + * for all bucket types. (does that make any sense at all?) + * + * The current functions are: + * getlen -- get the length of the data in the bucket + * (likely to be replaced soon) + * read -- read the data in the bucket (not garaunteed to read it all) + * write -- insert data into the bucket + * split -- split one bucket into two buckets + * free -- destroy the bucket, freeing it's memory + * + * funtions to be added: + * stat -- get all of the metadata about the bucket (lifetime, type, etc.) + * convert -- change one bucket type into another bucket type. + * + * There are also pointer to the next and previus buckets in the list. + */ struct ap_bucket { ap_bucket_color_e color; /* what type of bucket is it */ void *data; /* for use by free() */ @@ -152,6 +186,16 @@ struct ap_bucket { }; typedef struct ap_bucket_brigade ap_bucket_brigade; +/* + * This is the basic bucket brigade. That means it is a list of buckets. + * It has a pool out of which the buckets and the bucket brigade are allocated. + * That may change though, because I am leaning towards make the buckets have + * the same lifetime as the data they store in most cases. It also has a + * pointer to the head and tail of the bucket list. This allows us to + * easily remove data from the bucket list, and to easily append data at + * the end. By walking the list, it is also possible to insert in the middle + * of the list. + */ struct ap_bucket_brigade { ap_pool_t *p; /* The pool to associate this with. I do not allocate out of the pool, @@ -165,6 +209,13 @@ struct ap_bucket_brigade { /* ****** Different bucket types *****/ typedef struct ap_bucket_rmem ap_bucket_rmem; +/* + * The Read only bucket type. This is basically for memory allocated off the + * stack or literal strings. It cannot be modified, and the lifetime is + * defined by when it was allocated. Most likely these should be split into + * two different types. This contains a pointer to the front and end of the + * string so that it is possible to remove characters at either end. + */ struct ap_bucket_rmem { size_t alloc_len; /* how much was allocated */ const void *start; /* Where does the actual data start @@ -173,6 +224,28 @@ struct ap_bucket_rmem { }; typedef struct ap_bucket_rwmem ap_bucket_rwmem; +/* + * The read/write memory bucket type. This is for data that has been + * allocated out of the heap. This bucket actually starts by allocating + * 4K of memory. We do this so that the bucket has room to grow. At the + * bottom of the filter stack, we are likely to have to condense the buckets + * to as few as possible. By allocating a big space at the beginning, we + * don't have to make as many allocations at the bottom. If the top level + * handlers are written correctly, we won't have to do much copying either. + * Of course, for legacy handlers, we will have to condense. + * + * This bucket type has a pointer to the start of the allocation. This will + * never be modified. This is used a a reference for the free call. It also + * has the length of the amount allocated. The length could probably go + * away. + * + * Finally, we have a pointer to the start and end of the string currently + * referenced by the bucket. The end cannot be past the original allocation + * pointer + the allocation length. The start cannot be before the original + * allocation pointer. We keep a pointer to the start and end so that we can + * easily add and remove characters at either end. Oh, the start cannot be + * after the end either. + */ struct ap_bucket_rwmem { void *alloc_addr; /* Where does the data start */ size_t alloc_len; /* how much was allocated */ @@ -182,6 +255,13 @@ struct ap_bucket_rwmem { }; typedef struct ap_bucket_mmap ap_bucket_mmap; + +/* + * The mmap bucket type. This is basically just an allocation address and a + * length. This needs to be changed to a pointer to an mmap structure that + * has a reference count in it, and a pointer to the beginning and end of + * the data the bucket is referencing. + */ struct ap_bucket_mmap { void *alloc_addr; /* Where does the mmap start? */ int len; /* The amount of data in the mmap that we are @@ -193,13 +273,17 @@ struct ap_bucket_mmap { /* ****** Bucket Brigade Functions ***** */ -/* Create a new bucket brigade */ +/* Create a new bucket brigade. The bucket brigade is originally empty. */ APR_EXPORT(ap_bucket_brigade *) ap_brigade_create(ap_pool_t *p); -/* destroy an enitre bucket brigade */ +/* destroy an enitre bucket brigade. This includes destroying all of the + * buckets within the bucket brigade's bucket list. */ APR_EXPORT(ap_status_t) ap_brigade_destroy(void *b); -/* append bucket(s) to a bucket_brigade */ +/* append bucket(s) to a bucket_brigade. This is the correct way to add + * buckets to the end of a bucket briagdes bucket list. This will accept + * a list of buckets of any length. + */ APR_EXPORT(void) ap_brigade_append_buckets(ap_bucket_brigade *b, ap_bucket *e); @@ -208,46 +292,97 @@ APR_EXPORT(void) ap_brigade_append_buckets(ap_bucket_brigade *b, APR_EXPORT(void) ap_brigade_consume(ap_bucket_brigade *, int nbytes); /* create an iovec of the elements in a bucket_brigade... return number - of elements used */ + * of elements used. This is useful for writing to a file or to the + * network efficiently. + */ APR_EXPORT(int) ap_brigade_to_iovec(ap_bucket_brigade *, struct iovec *vec, int nvec); /* catenate bucket_brigade b onto bucket_brigade a, bucket_brigade b is - empty after this */ + * empty after this. Neither bucket brigade can be NULL, but either one of + * them can be emtpy when calling this function. + */ APR_EXPORT(void) ap_brigade_catenate(ap_bucket_brigade *a, ap_bucket_brigade *b); -/* Destroy the first nvec buckets. */ +/* Destroy the first nvec buckets. This is very much like ap_brigade_consume + * except instead of specifying the number of bytes to consume, it consumes + * a specified number of buckets. The original purpose for this function + * was in ap_brigade_to_iovec. After converting the first 16 buckets to + * vectors, we would destroy those 16 buckets. My gut is that this is the + * wrong approach. I plan to change this soon-ish. + */ APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec); /* save the buf out to the specified iol. This can be used to flush the - data to the disk, or to send it out to the network. */ + * data to the disk, or to send it out to the network. This is a poor + * function. It never should have been implemented. Unfortunately, it is + * also required. Once filters have been finished, the whole concept of + * iol's can just go away, and this function can go away with it. The + * correct solution, is to have the functions that are currently calling + * this just call either ap_sendv or ap_writev directly. + */ APR_EXPORT(ap_status_t) ap_brigade_to_iol(ap_ssize_t *total_bytes, ap_bucket_brigade *a, ap_iol *iol); +/* + * This function writes a bunch of strings into a bucket brigade. How this + * works is a bit strange. If there is already a rwmem bucket at the end of + * the list, we just add the next string to the end. This requires a memcpy, + * but it is assumed that we will have to condense buckets at the bottom of + * the stack anyway, so we would have to do the memcpy anyway. If there is no + * rwmem bucket, then we just allocate a new rmem bucket for each string. + * this avoids the memory allocation, and we hope that one of the intervening + * filters will be removing some of the data. This may be a dubios + * optimization, I just don't know. + */ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va); +/* + * Both of these functions evaluate the printf and put the resulting string + * into a bucket at the end of the bucket brigade. The only reason there are + * two of them, is that the ap_r* functions needed both. I would love to be + * able to remove one, but I don't think it's feasible. + */ APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...); - APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_list va); /* ****** Bucket Functions ***** */ -/* destroy a bucket */ +/* destroy a bucket, and remove it's memory. This does not necessarily + * free the actual data. For example, an mmap may have multiple buckets + * referenceing it (not currently implemented). Those would only get freed + * when the bucket with the last reference is destroyed. Rwmem buckets + * always have their data destroyed currently. + */ APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e); -/* destroy an entire list of buckets */ +/* destroy an entire list of buckets. I am not sure how useful this is, + * because it basically duplicates some logic in the bucket_brigade section. + * I need to review where this is used and remove it if at all possible. + */ APR_EXPORT(ap_status_t) ap_bucket_list_destroy(ap_bucket *e); -/* Convert a bucket to a char * */ -APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b); - -/* get the length of the data in the bucket */ +/* get the length of the data in the bucket that is currently being + * referenced. The bucket may contain more data, but if the start or end + * has been moved, we really don't care about it. + */ APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b); /****** Functions to Create Buckets of varying type ******/ +/* + * All of these functions are responsibly for creating a bucket and filling + * it out with an initial value. Some buckets can be over-written, others + * can't. What should happen, is that buckets that can't be over-written, + * will have NULL write functions. That is currently broken, although it is + * easy to fix. The creation routines may not allocate the space for the + * buckets, because we may be using a free list. Regardless, creation + * routines are responsible for getting space for a bucket from someplace + * and inserting the initial data. + */ + /* Create a read/write memory bucket */ APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(const void *buf, ap_size_t nbyte, ap_ssize_t *w); From 5c0f42466c4e50e4b5919b573a52c7f1b3b035e9 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 1 Aug 2000 15:41:54 +0000 Subject: [PATCH 0491/7878] Make ap_bucket_list_destroy a static function. It should never be used outside the buckets code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60466 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 36 ++++++++++++++---------------------- buckets/apr_buf.h | 6 ------ 2 files changed, 14 insertions(+), 28 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 1c6238da638..69de82cd461 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -72,19 +72,7 @@ APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e) return APR_SUCCESS; } -APR_EXPORT(ap_status_t) ap_brigade_destroy(void *data) -{ - ap_bucket_brigade *b = data; - - ap_bucket_list_destroy(b->head); - /* The brigade itself is allocated out of a pool, so we don't actually - * want to free it. If we did, we would do that free() here. - */ - - return APR_SUCCESS; -} - -APR_EXPORT(ap_status_t) ap_bucket_list_destroy(ap_bucket *e) +static ap_status_t ap_bucket_list_destroy(ap_bucket *e) { ap_bucket *cur = e; ap_bucket *next; @@ -97,6 +85,18 @@ APR_EXPORT(ap_status_t) ap_bucket_list_destroy(ap_bucket *e) return APR_SUCCESS; } +APR_EXPORT(ap_status_t) ap_brigade_destroy(void *data) +{ + ap_bucket_brigade *b = data; + + ap_bucket_list_destroy(b->head); + /* The brigade itself is allocated out of a pool, so we don't actually + * want to free it. If we did, we would do that free() here. + */ + + return APR_SUCCESS; +} + APR_EXPORT(ap_bucket_brigade *) ap_brigade_create(ap_pool_t *p) { ap_bucket_brigade *b; @@ -137,8 +137,8 @@ APR_EXPORT(int) ap_brigade_to_iovec(ap_bucket_brigade *b, orig = vec; e = b->head; while (e && nvec) { - vec->iov_base = (void *)ap_get_bucket_char_str(e); vec->iov_len = ap_get_bucket_len(e); + vec->iov_base = (void *)e->read(e); e = e->next; --nvec; ++vec; @@ -203,14 +203,6 @@ APR_EXPORT(ap_status_t) ap_brigade_to_iol(ap_ssize_t *total_bytes, return APR_SUCCESS; } -APR_EXPORT(const char *) ap_get_bucket_char_str(ap_bucket *b) -{ - if (b) { - return b->read(b); - } - return NULL; -} - APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b) { if (b) { diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index 72ef78cb22f..3c1d4b59bea 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -358,12 +358,6 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis */ APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e); -/* destroy an entire list of buckets. I am not sure how useful this is, - * because it basically duplicates some logic in the bucket_brigade section. - * I need to review where this is used and remove it if at all possible. - */ -APR_EXPORT(ap_status_t) ap_bucket_list_destroy(ap_bucket *e); - /* get the length of the data in the bucket that is currently being * referenced. The bucket may contain more data, but if the start or end * has been moved, we really don't care about it. From 2258decafea8e0af6168e30b9d1ffec904544f37 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 1 Aug 2000 19:33:17 +0000 Subject: [PATCH 0492/7878] ap_recv() on Win32: Set bytes-read to 0 on error. Submitted by: Gregory Nicholls Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60467 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index cca0f841164..5a46b3d1db3 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -95,6 +95,7 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) rv = WSARecv(sock->sock, &wsaData, 1, &dwBytes, &flags, NULL, NULL); if (rv == SOCKET_ERROR) { lasterror = WSAGetLastError(); + *len = 0; return lasterror; } From 722a57cc9003c79df5295b7a32e4cfe82b186339 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 1 Aug 2000 20:59:52 +0000 Subject: [PATCH 0493/7878] Fix problems with APR sockaddr handling on Win32. It didn't always return the right information on the local socket address. This change uses the Unix logic for delaying/avoiding getsockname() to ensure that it is done when needed. Submitted by: Gregory Nicholls Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60468 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/networkio.h | 2 ++ network_io/win32/networkio.h | 2 ++ network_io/win32/sockaddr.c | 39 ++++++++++++++++++++++++ network_io/win32/sockets.c | 54 ++++++++++++++++++++++++++-------- 4 files changed, 85 insertions(+), 12 deletions(-) diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 8f1437ef5ee..296127288f8 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -66,6 +66,8 @@ struct ap_socket_t { size_t addr_len; ap_interval_time_t timeout; ap_int32_t disconnected; + int local_port_unknown; + int local_interface_unknown; }; struct ap_pollfd_t { diff --git a/network_io/win32/networkio.h b/network_io/win32/networkio.h index 8f1437ef5ee..296127288f8 100644 --- a/network_io/win32/networkio.h +++ b/network_io/win32/networkio.h @@ -66,6 +66,8 @@ struct ap_socket_t { size_t addr_len; ap_interval_time_t timeout; ap_int32_t disconnected; + int local_port_unknown; + int local_interface_unknown; }; struct ap_pollfd_t { diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index 553b02084b3..d4c72433829 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -58,6 +58,21 @@ #include "apr_strings.h" #include +static ap_status_t get_local_addr(ap_socket_t *sock) +{ + size_t namelen = sizeof(*sock->local_addr); + + if (getsockname(sock->sock, (struct sockaddr *)sock->local_addr, + &namelen) < 0) { + return WSAGetLastError(); + } + else { + sock->local_port_unknown = sock->local_interface_unknown = 0; + return APR_SUCCESS; + } +} + + ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) { @@ -77,6 +92,14 @@ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) { + if (sock->local_port_unknown) { + ap_status_t rv = get_local_addr(sock); + + if (rv != APR_SUCCESS) { + return rv; + } + } + *port = ntohs(sock->local_addr->sin_port); return APR_SUCCESS; } @@ -131,6 +154,14 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock) { + if (sock->local_interface_unknown) { + ap_status_t rv = get_local_addr(sock); + + if (rv != APR_SUCCESS) { + return rv; + } + } + *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); return APR_SUCCESS; } @@ -146,6 +177,14 @@ ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock) ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) { + if (sock->local_port_unknown || sock->local_interface_unknown) { + ap_status_t rv = get_local_addr(sock); + + if (rv != APR_SUCCESS) { + return rv; + } + } + *name = sock->local_addr; return APR_SUCCESS; } diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 6c64a36e9dd..3a5cf8445ca 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -150,8 +150,12 @@ ap_status_t ap_bind(ap_socket_t *sock) if (bind(sock->sock, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) { return WSAGetLastError(); } - else + else { + if (sock->local_addr->sin_port == 0) { + sock->local_port_unknown = 1; /* ephemeral port */ + } return APR_SUCCESS; + } } ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) @@ -185,6 +189,24 @@ ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connectio return WSAGetLastError(); } + *(*new)->local_addr = *sock->local_addr; + + if (sock->local_port_unknown) { + /* not likely for a listening socket, but theoretically possible :) */ + (*new)->local_port_unknown = 1; + } + + if (sock->local_interface_unknown || + sock->local_addr->sin_addr.s_addr == 0) { + /* If the interface address inside the listening socket's local_addr wasn't + * up-to-date, we don't know local interface of the connected socket either. + * + * If the listening socket was not bound to a specific interface, we + * don't know the local_addr of the connected socket. + */ + (*new)->local_interface_unknown = 1; + } + ap_register_cleanup((*new)->cntxt, (void *)(*new), socket_cleanup, ap_null_cleanup); return APR_SUCCESS; @@ -218,20 +240,27 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) sock->remote_addr->sin_family = AF_INET; if (connect(sock->sock, (const struct sockaddr *)sock->remote_addr, - sock->addr_len) == 0) { - return APR_SUCCESS; - } - else { + sock->addr_len) == SOCKET_ERROR) { lasterror = WSAGetLastError(); - if (lasterror == WSAEWOULDBLOCK) { - FD_ZERO(&temp); - FD_SET(sock->sock, &temp); - if (select(sock->sock+1, NULL, &temp, NULL, NULL) == 1) { - return APR_SUCCESS; - } + if (lasterror != WSAEWOULDBLOCK) { + return lasterror; } - return lasterror; + /* wait for the connect to complete */ + FD_ZERO(&temp); + FD_SET(sock->sock, &temp); + if (select(sock->sock+1, NULL, &temp, NULL, NULL) == SOCKET_ERROR) { + return WSAGetLastError(); + } + } + /* connect was OK .. amazing */ + if (sock->local_addr->sin_port == 0) { + sock->local_port_unknown = 1; } + if (sock->local_addr->sin_addr.s_addr == 0) { + /* must be using free-range port */ + sock->local_interface_unknown = 1; + } + return APR_SUCCESS; } ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *socket) @@ -273,6 +302,7 @@ ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, (*sock)->timeout = -1; (*sock)->disconnected = 0; } + (*sock)->local_port_unknown = (*sock)->local_interface_unknown = 1; (*sock)->sock = *thesock; return APR_SUCCESS; } From 1e928d68570d4e8e26f8ce62ccd0a5b61ab82437 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 1 Aug 2000 23:10:30 +0000 Subject: [PATCH 0494/7878] Clean up compile warnings, mostly by including apr_strings.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60469 13f79535-47bb-0310-9956-ffa450edef68 --- test/mod_test.c | 1 + test/occhild.c | 1 + test/testcontext.c | 1 + test/testoc.c | 4 +--- test/testproc.c | 1 + test/testshmem.c | 1 + test/testsock.c | 1 + 7 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/mod_test.c b/test/mod_test.c index 088d748420c..d9d9f6b4d84 100644 --- a/test/mod_test.c +++ b/test/mod_test.c @@ -14,4 +14,5 @@ int print_goodbye(int reps) fprintf (stdout, "Goodbye from the DSO! (%d of %d)\n", i+1, reps); } goodbyes = reps; + return 0; } diff --git a/test/occhild.c b/test/occhild.c index 19ca58c596b..d5171ec6ef9 100644 --- a/test/occhild.c +++ b/test/occhild.c @@ -10,4 +10,5 @@ int main() while (rc == 1) { read(STDERR_FILENO, buf, 256); } + return 0; /* just to keep the compiler happy */ } diff --git a/test/testcontext.c b/test/testcontext.c index 0c91d508002..7d11ae05719 100644 --- a/test/testcontext.c +++ b/test/testcontext.c @@ -58,6 +58,7 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" +#include "apr_strings.h" #ifdef BEOS #include #endif diff --git a/test/testoc.c b/test/testoc.c index 170c47c6968..3b60b091326 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -56,6 +56,7 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" +#include "apr_strings.h" #include #include #include @@ -85,9 +86,6 @@ void ocmaint(int reason, void *data, int status) int main(int argc, char *argv[]) { ap_pool_t *context; - ap_pool_t *cont2; - ap_status_t status = 0; - ap_ssize_t nbytes = 0; ap_proc_t newproc; ap_procattr_t *procattr = NULL; ap_file_t *std = NULL; diff --git a/test/testproc.c b/test/testproc.c index 29a96f51985..72afd2f46fe 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -56,6 +56,7 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" +#include "apr_strings.h" #include #ifndef WIN32 #include diff --git a/test/testshmem.c b/test/testshmem.c index fc76ec3e9f8..8411e33c6d1 100644 --- a/test/testshmem.c +++ b/test/testshmem.c @@ -57,6 +57,7 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" +#include "apr_strings.h" #include #include #include diff --git a/test/testsock.c b/test/testsock.c index a0b8350e0ea..7cc1a3ce09a 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -59,6 +59,7 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" +#include "apr_strings.h" #define STRLEN 15 From 45969dccccb16712469ddf6aaff7801d548d8e1b Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 2 Aug 2000 05:26:45 +0000 Subject: [PATCH 0495/7878] prefix libapr functions and types with apr_ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60470 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ap_buf.c | 44 +++--- buckets/ap_filter.h | 62 ++++---- buckets/ap_mmap_buf.c | 26 ++-- buckets/ap_rmem_buf.c | 24 ++-- buckets/ap_rwmem_buf.c | 26 ++-- buckets/apr_buf.h | 62 ++++---- buckets/filters.c | 14 +- buckets/util_filter.c | 14 +- buckets/util_filter.h | 20 +-- dso/aix/dso.c | 12 +- dso/aix/dso.h | 4 +- dso/beos/dso.c | 12 +- dso/beos/dso.h | 4 +- dso/os2/dso.c | 26 ++-- dso/os2/dso.h | 6 +- dso/unix/dso.c | 14 +- dso/unix/dso.h | 4 +- dso/win32/dso.c | 16 +-- dso/win32/dso.h | 6 +- file_io/os2/dir.c | 38 ++--- file_io/os2/filedup.c | 12 +- file_io/os2/fileio.h | 16 +-- file_io/os2/filestat.c | 12 +- file_io/os2/maperrorcode.c | 4 +- file_io/os2/open.c | 46 +++--- file_io/os2/pipe.c | 18 +-- file_io/os2/readwrite.c | 52 +++---- file_io/os2/seek.c | 10 +- file_io/unix/dir.c | 62 ++++---- file_io/unix/fileacc.c | 22 +-- file_io/unix/filedup.c | 14 +- file_io/unix/fileio.h | 18 +-- file_io/unix/filestat.c | 34 ++--- file_io/unix/fullrw.c | 24 ++-- file_io/unix/open.c | 58 ++++---- file_io/unix/pipe.c | 22 +-- file_io/unix/readwrite.c | 78 +++++----- file_io/unix/seek.c | 12 +- file_io/win32/dir.c | 58 ++++---- file_io/win32/filedup.c | 16 +-- file_io/win32/fileio.h | 38 ++--- file_io/win32/filestat.c | 10 +- file_io/win32/open.c | 50 +++---- file_io/win32/pipe.c | 32 ++--- file_io/win32/readwrite.c | 76 +++++----- file_io/win32/seek.c | 10 +- i18n/unix/xlate.c | 48 +++---- include/apr_dso.h | 14 +- include/apr_errno.h | 6 +- include/apr_file_io.h | 158 ++++++++++----------- include/apr_fnmatch.h | 8 +- include/apr_general.h | 38 ++--- include/apr_getopt.h | 10 +- include/apr_hash.h | 24 ++-- include/apr_lib.h | 72 +++++----- include/apr_lock.h | 30 ++-- include/apr_md5.h | 22 +-- include/apr_mmap.h | 14 +- include/apr_network_io.h | 116 +++++++-------- include/apr_pools.h | 84 +++++------ include/apr_portable.h | 120 ++++++++-------- include/apr_shmem.h | 26 ++-- include/apr_strings.h | 38 ++--- include/apr_tables.h | 108 +++++++------- include/apr_thread_proc.h | 148 +++++++++---------- include/apr_time.h | 52 +++---- include/apr_xlate.h | 22 +-- include/arch/aix/dso.h | 4 +- include/arch/beos/dso.h | 4 +- include/arch/beos/locks.h | 26 ++-- include/arch/beos/networkio.h | 14 +- include/arch/beos/threadproc.h | 32 ++--- include/arch/os2/dso.h | 6 +- include/arch/os2/fileio.h | 16 +-- include/arch/os2/locks.h | 8 +- include/arch/os2/networkio.h | 10 +- include/arch/os2/threadproc.h | 36 ++--- include/arch/unix/dso.h | 4 +- include/arch/unix/fileio.h | 18 +-- include/arch/unix/locks.h | 28 ++-- include/arch/unix/misc.h | 6 +- include/arch/unix/mmap.c | 22 +-- include/arch/unix/networkio.h | 14 +- include/arch/unix/threadproc.h | 32 ++--- include/arch/win32/atime.h | 8 +- include/arch/win32/dso.h | 6 +- include/arch/win32/fileio.h | 38 ++--- include/arch/win32/locks.h | 8 +- include/arch/win32/misc.h | 6 +- include/arch/win32/networkio.h | 14 +- include/arch/win32/threadproc.h | 38 ++--- lib/apr_pools.c | 172 +++++++++++------------ lib/apr_signal.c | 2 +- locks/beos/crossproc.c | 26 ++-- locks/beos/intraproc.c | 24 ++-- locks/beos/locks.c | 42 +++--- locks/beos/locks.h | 26 ++-- locks/os2/locks.c | 38 ++--- locks/os2/locks.h | 8 +- locks/unix/crossproc.c | 112 +++++++-------- locks/unix/intraproc.c | 30 ++-- locks/unix/locks.c | 68 ++++----- locks/unix/locks.h | 28 ++-- locks/win32/locks.c | 44 +++--- locks/win32/locks.h | 8 +- memory/unix/apr_pools.c | 172 +++++++++++------------ misc/unix/canonerr.c | 2 +- misc/unix/errorcodes.c | 20 +-- misc/unix/getopt.c | 6 +- misc/unix/misc.h | 6 +- misc/unix/otherchild.c | 26 ++-- misc/unix/rand.c | 2 +- misc/unix/start.c | 40 +++--- misc/win32/misc.c | 2 +- misc/win32/names.c | 16 +-- misc/win32/rand.c | 2 +- mmap/unix/common.c | 2 +- mmap/unix/mmap.c | 22 +-- network_io/beos/networkio.h | 14 +- network_io/beos/poll.c | 36 ++--- network_io/beos/sendrecv.c | 12 +- network_io/beos/sockaddr.c | 24 ++-- network_io/beos/sockets.c | 60 ++++---- network_io/beos/sockopt.c | 10 +- network_io/os2/networkio.h | 10 +- network_io/os2/poll.c | 26 ++-- network_io/os2/sendrecv.c | 8 +- network_io/os2/sockets.c | 58 ++++---- network_io/os2/sockopt.c | 10 +- network_io/unix/networkio.h | 14 +- network_io/unix/poll.c | 78 +++++----- network_io/unix/sendrecv.c | 102 +++++++------- network_io/unix/sockaddr.c | 32 ++--- network_io/unix/sockets.c | 64 ++++----- network_io/unix/sockopt.c | 16 +-- network_io/win32/networkio.h | 14 +- network_io/win32/poll.c | 46 +++--- network_io/win32/sendrecv.c | 30 ++-- network_io/win32/sockaddr.c | 32 ++--- network_io/win32/sockets.c | 64 ++++----- network_io/win32/sockopt.c | 16 +-- passwd/apr_getpass.c | 6 +- passwd/apr_md5.c | 80 +++++------ shmem/os2/shmem.c | 22 +-- shmem/unix/shmem.c | 18 +-- strings/apr_cpystrn.c | 20 +-- strings/apr_fnmatch.c | 6 +- strings/apr_snprintf.c | 22 +-- strings/apr_strings.c | 14 +- strings/apr_strnatcmp.c | 4 +- tables/apr_hash.c | 46 +++--- tables/apr_tables.c | 206 +++++++++++++-------------- test/abc.c | 10 +- test/client.c | 62 ++++---- test/server.c | 92 ++++++------ test/testargs.c | 12 +- test/testcontext.c | 16 +-- test/testdso.c | 30 ++-- test/testfile.c | 230 +++++++++++++++--------------- test/testmd5.c | 24 ++-- test/testmmap.c | 26 ++-- test/testoc.c | 32 ++--- test/testpipe.c | 34 ++--- test/testproc.c | 46 +++--- test/testsf.c | 242 ++++++++++++++++---------------- test/testshmem.c | 16 +-- test/testsock.c | 44 +++--- test/testthread.c | 58 ++++---- test/testtime.c | 20 +-- threadproc/beos/proc.c | 106 +++++++------- threadproc/beos/thread.c | 34 ++--- threadproc/beos/threadpriv.c | 12 +- threadproc/beos/threadproc.h | 32 ++--- threadproc/os2/proc.c | 134 +++++++++--------- threadproc/os2/signals.c | 4 +- threadproc/os2/thread.c | 34 ++--- threadproc/os2/threadpriv.c | 12 +- threadproc/os2/threadproc.h | 36 ++--- threadproc/unix/proc.c | 126 ++++++++--------- threadproc/unix/procsup.c | 2 +- threadproc/unix/signals.c | 4 +- threadproc/unix/thread.c | 60 ++++---- threadproc/unix/threadpriv.c | 40 +++--- threadproc/unix/threadproc.h | 32 ++--- threadproc/win32/proc.c | 92 ++++++------ threadproc/win32/signals.c | 2 +- threadproc/win32/thread.c | 52 +++---- threadproc/win32/threadpriv.c | 32 ++--- threadproc/win32/threadproc.h | 38 ++--- time/unix/time.c | 28 ++-- time/unix/timestr.c | 10 +- time/win32/access.c | 44 +++--- time/win32/atime.h | 8 +- time/win32/time.c | 30 ++-- time/win32/timestr.c | 10 +- 195 files changed, 3484 insertions(+), 3484 deletions(-) diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 69de82cd461..9b3e2b2cddf 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -63,7 +63,7 @@ #include #include "apr_buf.h" -APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e) +APR_EXPORT(apr_status_t) ap_bucket_destroy(ap_bucket *e) { if (e->free) { e->free(e); @@ -72,7 +72,7 @@ APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e) return APR_SUCCESS; } -static ap_status_t ap_bucket_list_destroy(ap_bucket *e) +static apr_status_t ap_bucket_list_destroy(ap_bucket *e) { ap_bucket *cur = e; ap_bucket *next; @@ -85,9 +85,9 @@ static ap_status_t ap_bucket_list_destroy(ap_bucket *e) return APR_SUCCESS; } -APR_EXPORT(ap_status_t) ap_brigade_destroy(void *data) +APR_EXPORT(apr_status_t) ap_brigade_destroy(void *data) { - ap_bucket_brigade *b = data; + apr_bucket_brigade *b = data; ap_bucket_list_destroy(b->head); /* The brigade itself is allocated out of a pool, so we don't actually @@ -97,20 +97,20 @@ APR_EXPORT(ap_status_t) ap_brigade_destroy(void *data) return APR_SUCCESS; } -APR_EXPORT(ap_bucket_brigade *) ap_brigade_create(ap_pool_t *p) +APR_EXPORT(apr_bucket_brigade *) ap_brigade_create(apr_pool_t *p) { - ap_bucket_brigade *b; + apr_bucket_brigade *b; - b = ap_palloc(p, sizeof(*b)); + b = apr_palloc(p, sizeof(*b)); b->p = p; b->head = b->tail = NULL; - ap_register_cleanup(b->p, b, ap_brigade_destroy, + apr_register_cleanup(b->p, b, ap_brigade_destroy, ap_brigade_destroy); return b; } -APR_EXPORT(void) ap_brigade_append_buckets(ap_bucket_brigade *b, +APR_EXPORT(void) ap_brigade_append_buckets(apr_bucket_brigade *b, ap_bucket *e) { ap_bucket *cur = e; @@ -128,7 +128,7 @@ APR_EXPORT(void) ap_brigade_append_buckets(ap_bucket_brigade *b, } } -APR_EXPORT(int) ap_brigade_to_iovec(ap_bucket_brigade *b, +APR_EXPORT(int) ap_brigade_to_iovec(apr_bucket_brigade *b, struct iovec *vec, int nvec) { ap_bucket *e; @@ -146,8 +146,8 @@ APR_EXPORT(int) ap_brigade_to_iovec(ap_bucket_brigade *b, return vec - orig; } -APR_EXPORT(void) ap_brigade_catenate(ap_bucket_brigade *a, - ap_bucket_brigade *b) +APR_EXPORT(void) ap_brigade_catenate(apr_bucket_brigade *a, + apr_bucket_brigade *b) { if (b->head) { if (a->tail) { @@ -163,7 +163,7 @@ APR_EXPORT(void) ap_brigade_catenate(ap_bucket_brigade *a, } } -APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec) +APR_EXPORT(void) ap_consume_buckets(apr_bucket_brigade *b, int nvec) { int i; @@ -179,14 +179,14 @@ APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec) } } -APR_EXPORT(ap_status_t) ap_brigade_to_iol(ap_ssize_t *total_bytes, - ap_bucket_brigade *b, +APR_EXPORT(apr_status_t) ap_brigade_to_iol(apr_ssize_t *total_bytes, + apr_bucket_brigade *b, ap_iol *iol) { - ap_status_t status; + apr_status_t status; int iov_used; struct iovec vec[16]; /* seems like a reasonable number to me */ - ap_ssize_t bytes = 0; + apr_ssize_t bytes = 0; *total_bytes = 0; do { @@ -211,12 +211,12 @@ APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b) return 0; } -APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) +APR_EXPORT(int) ap_brigade_vputstrs(apr_bucket_brigade *b, va_list va) { ap_bucket *r; const char *x; int j, k, rv; - ap_ssize_t i; + apr_ssize_t i; if (b->tail && b->tail->color == AP_BUCKET_rwmem) { ap_bucket *rw; @@ -263,7 +263,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) return k; } -APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...) +APR_EXPORT(int) ap_brigade_printf(apr_bucket_brigade *b, const char *fmt, ...) { va_list ap; int res; @@ -274,7 +274,7 @@ APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...) return res; } -APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_list va) +APR_EXPORT(int) ap_brigade_vprintf(apr_bucket_brigade *b, const char *fmt, va_list va) { /* THIS IS A HACK. This needs to be replaced with a function to printf * directly into a bucket. I'm being lazy right now. RBB @@ -283,7 +283,7 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis ap_bucket *r; int res, i; - res = ap_vsnprintf(buf, 4096, fmt, va); + res = apr_vsnprintf(buf, 4096, fmt, va); r = ap_bucket_rwmem_create(buf, strlen(buf), &i); ap_brigade_append_buckets(b, r); diff --git a/buckets/ap_filter.h b/buckets/ap_filter.h index 747e810a10f..5785b66f93a 100644 --- a/buckets/ap_filter.h +++ b/buckets/ap_filter.h @@ -123,11 +123,11 @@ extern "C" { */ /* forward declare some types */ -typedef struct ap_filter_t ap_filter_t; -typedef struct ap_bucket_t ap_bucket_t; +typedef struct apr_filter_t apr_filter_t; +typedef struct apr_bucket_t apr_bucket_t; /* - * ap_filter_bucket_cb: + * apr_filter_bucket_cb: * * This function type is used for filter callbacks. It will be passed a * pointer to "this" filter, and a "bucket" containing the content to be @@ -146,8 +146,8 @@ typedef struct ap_bucket_t ap_bucket_t; * next/prev to insert/remove/replace elements in the bucket list, but * the types and values of the individual buckets should not be altered. */ -typedef void (*ap_filter_bucket_cb)(ap_filter_t *filter, - ap_bucket_t *bucket); +typedef void (*apr_filter_bucket_cb)(apr_filter_t *filter, + apr_bucket_t *bucket); /* * ap_filter_type: @@ -179,7 +179,7 @@ typedef enum { } ap_filter_type; /* - * ap_filter_t: + * apr_filter_t: * * This is the request-time context structure for an installed filter (in * the output filter chain). It provides the callback to use for filtering, @@ -192,21 +192,21 @@ typedef enum { * the state directly with the request. A callback should not change any of * the other fields. */ -struct ap_filter_t { - ap_filter_bucket_cb bucket_cb; +struct apr_filter_t { + apr_filter_bucket_cb bucket_cb; request_rec *r; void *ctx; ap_filter_type ftype; - ap_filter_t *next; + apr_filter_t *next; }; /* * ap_bucket_type: * * This enumeration is used to specify what type of bucket is present when - * an ap_bucket_t is provided. + * an apr_bucket_t is provided. * * AP_BUCKET_PTRLEN: * This bucket type defines a simple pointer/length pair for the content. @@ -245,7 +245,7 @@ struct ap_filter_t { * * AP_BUCKET_FILE: * This bucket type refers to an open file, from the current position - * and extending for ->flen bytes. Since there are some ap_file_t + * and extending for ->flen bytes. Since there are some apr_file_t * implementations/types that are not seekable, it may be impossible to * "rewind" the file's current position after reading the contenxt. * Therefore, it is important to note that once the content has been @@ -277,7 +277,7 @@ typedef enum { } ap_bucket_type; /* - * ap_bucket_t: + * apr_bucket_t: * * The actual bucket definition. The type is determined by the ->type field. * Which fields are valid/useful in the bucket is determined by the type, @@ -287,20 +287,20 @@ typedef enum { * remove, or replace elements in a list of buckets. Generally, a filter * should not change any bucket values other than these link pointers. */ -struct ap_bucket_t { +struct apr_bucket_t { ap_bucket_type type; const char *buf; /* AP_BUCKET_PTRLEN */ - ap_size_t len; /* AP_BUCKET_PTRLEN */ + apr_size_t len; /* AP_BUCKET_PTRLEN */ const char *fmt; /* AP_BUCKET_PRINTF */ va_list va; /* AP_BUCKET_STRINGS, _PRINTF */ - ap_file_t *file; /* AP_BUCKET_FILE */ - ap_ssize_t flen; /* AP_BUCKET_FILE */ + apr_file_t *file; /* AP_BUCKET_FILE */ + apr_ssize_t flen; /* AP_BUCKET_FILE */ - ap_bucket_t *next; /* next bucket in list */ - ap_bucket_t *prev; /* previous bucket in list */ + apr_bucket_t *next; /* next bucket in list */ + apr_bucket_t *prev; /* previous bucket in list */ }; /* @@ -323,25 +323,25 @@ struct ap_bucket_t { * used to send from current-position to the end-of-file. * ap_fc_putbucket(): write a bucket into the filter chain */ -API_EXPORT(void) ap_fc_write(ap_filter_t *filter, const char *buf, - ap_size_t len); -API_EXPORT(void) ap_fc_putc(ap_filter_t *filter, int c); -API_EXPORT(void) ap_fc_puts(ap_filter_t *filter, const char *str); +API_EXPORT(void) ap_fc_write(apr_filter_t *filter, const char *buf, + apr_size_t len); +API_EXPORT(void) ap_fc_putc(apr_filter_t *filter, int c); +API_EXPORT(void) ap_fc_puts(apr_filter_t *filter, const char *str); -API_EXPORT_NONSTD(void) ap_fc_putstrs(ap_filter_t *filter, ...); -API_EXPORT(void) ap_fc_vputstrs(ap_filter_t *filter, va_list va); +API_EXPORT_NONSTD(void) ap_fc_putstrs(apr_filter_t *filter, ...); +API_EXPORT(void) ap_fc_vputstrs(apr_filter_t *filter, va_list va); -API_EXPORT_NONSTD(void) ap_fc_printf(ap_filter_t *filter, +API_EXPORT_NONSTD(void) ap_fc_printf(apr_filter_t *filter, const char *fmt, ...); -API_EXPORT(void) ap_fc_vprintf(ap_filter_t *filter, +API_EXPORT(void) ap_fc_vprintf(apr_filter_t *filter, const char *fmt, va_list va); -API_EXPORT(void) ap_fc_sendfile(ap_filter_t *filter, ap_file_t *file, - ap_ssize_t flen); -#define AP_FC_SENDFILE_ALL ((ap_ssize_t) -1) +API_EXPORT(void) ap_fc_sendfile(apr_filter_t *filter, apr_file_t *file, + apr_ssize_t flen); +#define AP_FC_SENDFILE_ALL ((apr_ssize_t) -1) /* note: bucket->next and ->prev may be changed upon return from this */ -API_EXPORT(void) ap_fc_putbucket(ap_filter_t *filter, ap_bucket_t *bucket); +API_EXPORT(void) ap_fc_putbucket(apr_filter_t *filter, apr_bucket_t *bucket); /* @@ -354,7 +354,7 @@ API_EXPORT(void) ap_fc_putbucket(ap_filter_t *filter, ap_bucket_t *bucket); * The filter's callback and type should be passed. */ API_EXPORT(void) ap_register_filter(const char *name, - ap_filter_bucket_cb bucket_cb, + apr_filter_bucket_cb bucket_cb, ap_filter_type ftype); /* diff --git a/buckets/ap_mmap_buf.c b/buckets/ap_mmap_buf.c index 7f1a3dc6d8d..c98a4988178 100644 --- a/buckets/ap_mmap_buf.c +++ b/buckets/ap_mmap_buf.c @@ -61,21 +61,21 @@ static const char * mmap_get_str(ap_bucket *e) { - ap_bucket_mmap *b = (ap_bucket_mmap *)e->data; + apr_bucket_mmap *b = (apr_bucket_mmap *)e->data; return b->alloc_addr; } static int mmap_get_len(ap_bucket *e) { - ap_bucket_mmap *b = (ap_bucket_mmap *)e->data; + apr_bucket_mmap *b = (apr_bucket_mmap *)e->data; return b->len; } -static ap_status_t mmap_bucket_insert(ap_bucket *e, const void *buf, - ap_size_t nbytes, ap_ssize_t *w) +static apr_status_t mmap_bucket_insert(ap_bucket *e, const void *buf, + apr_size_t nbytes, apr_ssize_t *w) { - ap_bucket_mmap *b = (ap_bucket_mmap *)e->data; - ap_mmap_t *mm = (ap_mmap_t *)buf; + apr_bucket_mmap *b = (apr_bucket_mmap *)e->data; + apr_mmap_t *mm = (apr_mmap_t *)buf; b->alloc_addr = mm->mm; b->len = nbytes; @@ -83,15 +83,15 @@ static ap_status_t mmap_bucket_insert(ap_bucket *e, const void *buf, return APR_SUCCESS; } -static ap_status_t mmap_split(ap_bucket *e, ap_size_t nbyte) +static apr_status_t mmap_split(ap_bucket *e, apr_size_t nbyte) { ap_bucket *newbuck; - ap_bucket_mmap *a = (ap_bucket_mmap *)e->data; - ap_bucket_mmap *b; - ap_ssize_t dump; + apr_bucket_mmap *a = (apr_bucket_mmap *)e->data; + apr_bucket_mmap *b; + apr_ssize_t dump; newbuck = ap_bucket_mmap_create(a->alloc_addr, a->len, &dump); - b = (ap_bucket_mmap *)newbuck->data; + b = (apr_bucket_mmap *)newbuck->data; a->alloc_addr = a->alloc_addr + nbyte; a->len = b->len - nbyte; @@ -105,10 +105,10 @@ static ap_status_t mmap_split(ap_bucket *e, ap_size_t nbyte) } APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(const void *buf, - ap_size_t nbytes, ap_ssize_t *w) + apr_size_t nbytes, apr_ssize_t *w) { ap_bucket *newbuf; - ap_bucket_mmap *b; + apr_bucket_mmap *b; newbuf = calloc(1, sizeof(*newbuf)); b = malloc(sizeof(*b)); diff --git a/buckets/ap_rmem_buf.c b/buckets/ap_rmem_buf.c index 6b2719d6537..30886063fe9 100644 --- a/buckets/ap_rmem_buf.c +++ b/buckets/ap_rmem_buf.c @@ -65,25 +65,25 @@ static const char * rmem_get_str(ap_bucket *e) { - ap_bucket_rmem *b = (ap_bucket_rmem *)e->data; + apr_bucket_rmem *b = (apr_bucket_rmem *)e->data; return b->start; } static int rmem_get_len(ap_bucket *e) { - ap_bucket_rmem *b = (ap_bucket_rmem *)e->data; + apr_bucket_rmem *b = (apr_bucket_rmem *)e->data; return (char *)b->end - (char *)b->start; } -static ap_status_t rmem_split(ap_bucket *e, ap_size_t nbyte) +static apr_status_t rmem_split(ap_bucket *e, apr_size_t nbyte) { ap_bucket *newbuck; - ap_bucket_rmem *a = (ap_bucket_rmem *)e->data; - ap_bucket_rmem *b; - ap_ssize_t dump; + apr_bucket_rmem *a = (apr_bucket_rmem *)e->data; + apr_bucket_rmem *b; + apr_ssize_t dump; newbuck = ap_bucket_rmem_create(a->start, a->alloc_len, &dump); - b = (ap_bucket_rmem *)newbuck->data; + b = (apr_bucket_rmem *)newbuck->data; b->alloc_len = a->alloc_len - nbyte; a->alloc_len = nbyte; @@ -106,10 +106,10 @@ static ap_status_t rmem_split(ap_bucket *e, ap_size_t nbyte) * It is worth noting that if an error occurs, the buffer is in an unknown * state. */ -static ap_status_t rmem_insert(ap_bucket *e, const void *buf, - ap_size_t nbyte, ap_ssize_t *w) +static apr_status_t rmem_insert(ap_bucket *e, const void *buf, + apr_size_t nbyte, apr_ssize_t *w) { - ap_bucket_rmem *b = (ap_bucket_rmem *)e->data; + apr_bucket_rmem *b = (apr_bucket_rmem *)e->data; if (nbyte == 0) { *w = 0; @@ -126,10 +126,10 @@ static ap_status_t rmem_insert(ap_bucket *e, const void *buf, } APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(const void *buf, - ap_size_t nbyte, ap_ssize_t *w) + apr_size_t nbyte, apr_ssize_t *w) { ap_bucket *newbuf; - ap_bucket_rmem *b; + apr_bucket_rmem *b; newbuf = calloc(1, sizeof(*newbuf)); b = malloc(sizeof(*b)); diff --git a/buckets/ap_rwmem_buf.c b/buckets/ap_rwmem_buf.c index b01ef7427f9..4ee983776d5 100644 --- a/buckets/ap_rwmem_buf.c +++ b/buckets/ap_rwmem_buf.c @@ -65,31 +65,31 @@ static const char * rwmem_get_str(ap_bucket *e) { - ap_bucket_rwmem *b = (ap_bucket_rwmem *)e->data; + apr_bucket_rwmem *b = (apr_bucket_rwmem *)e->data; return b->start; } static int rwmem_get_len(ap_bucket *e) { - ap_bucket_rwmem *b = (ap_bucket_rwmem *)e->data; + apr_bucket_rwmem *b = (apr_bucket_rwmem *)e->data; return (char *)b->end - (char *)b->start; } static void rwmem_destroy(void *e) { - ap_bucket_rwmem *d = (ap_bucket_rwmem *)e; + apr_bucket_rwmem *d = (apr_bucket_rwmem *)e; free(d->alloc_addr); } -static ap_status_t rwmem_split(ap_bucket *e, ap_size_t nbyte) +static apr_status_t rwmem_split(ap_bucket *e, apr_size_t nbyte) { ap_bucket *newbuck; - ap_bucket_rwmem *a = (ap_bucket_rwmem *)e; - ap_bucket_rwmem *b; - ap_ssize_t dump; + apr_bucket_rwmem *a = (apr_bucket_rwmem *)e; + apr_bucket_rwmem *b; + apr_ssize_t dump; newbuck = ap_bucket_rwmem_create(a->alloc_addr, a->alloc_len, &dump); - b = (ap_bucket_rwmem *)newbuck->data; + b = (apr_bucket_rwmem *)newbuck->data; b->alloc_addr = a->alloc_addr; b->alloc_len = a->alloc_len; @@ -111,12 +111,12 @@ static ap_status_t rwmem_split(ap_bucket *e, ap_size_t nbyte) * It is worth noting that if an error occurs, the buffer is in an unknown * state. */ -static ap_status_t rwmem_insert(ap_bucket *e, const void *buf, - ap_size_t nbyte, ap_ssize_t *w) +static apr_status_t rwmem_insert(ap_bucket *e, const void *buf, + apr_size_t nbyte, apr_ssize_t *w) { int amt; int total; - ap_bucket_rwmem *b = (ap_bucket_rwmem *)e->data; + apr_bucket_rwmem *b = (apr_bucket_rwmem *)e->data; if (nbyte == 0) { *w = 0; @@ -143,10 +143,10 @@ static ap_status_t rwmem_insert(ap_bucket *e, const void *buf, } APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(const void *buf, - ap_size_t nbyte, ap_ssize_t *w) + apr_size_t nbyte, apr_ssize_t *w) { ap_bucket *newbuf; - ap_bucket_rwmem *b; + apr_bucket_rwmem *b; newbuf = calloc(1, sizeof(*newbuf)); b = malloc(sizeof(*b)); diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index 3c1d4b59bea..6d8c2fcb81c 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -169,23 +169,23 @@ struct ap_bucket { const char *(*read)(ap_bucket *e); /* Get the string */ /* Write into a bucket. The buf is a different type based on the - * bucket type used. For example, with AP_BUCKET_mmap it is an ap_mmap_t - * for AP_BUCKET_file it is an ap_file_t, and for AP_BUCKET_rwmem it is + * bucket type used. For example, with AP_BUCKET_mmap it is an apr_mmap_t + * for AP_BUCKET_file it is an apr_file_t, and for AP_BUCKET_rwmem it is * a char *. The nbytes is the amount of actual data in buf. This is * not the sizeof(buf), it is the actual number of bytes in the char * * that buf resolves to. written is how much of that data was inserted * into the bucket. */ - int (*write)(ap_bucket *e, const void *buf, ap_size_t nbytes, ap_ssize_t *w); + int (*write)(ap_bucket *e, const void *buf, apr_size_t nbytes, apr_ssize_t *w); /* Split one bucket into to at the specified position */ - ap_status_t (*split)(ap_bucket *e, ap_size_t nbytes); + apr_status_t (*split)(ap_bucket *e, apr_size_t nbytes); ap_bucket *next; /* The next node in the bucket list */ ap_bucket *prev; /* The prev node in the bucket list */ }; -typedef struct ap_bucket_brigade ap_bucket_brigade; +typedef struct apr_bucket_brigade apr_bucket_brigade; /* * This is the basic bucket brigade. That means it is a list of buckets. * It has a pool out of which the buckets and the bucket brigade are allocated. @@ -196,8 +196,8 @@ typedef struct ap_bucket_brigade ap_bucket_brigade; * the end. By walking the list, it is also possible to insert in the middle * of the list. */ -struct ap_bucket_brigade { - ap_pool_t *p; /* The pool to associate this with. +struct apr_bucket_brigade { + apr_pool_t *p; /* The pool to associate this with. I do not allocate out of the pool, but this lets me register a cleanup to put a limit on the brigade's @@ -208,7 +208,7 @@ struct ap_bucket_brigade { /* ****** Different bucket types *****/ -typedef struct ap_bucket_rmem ap_bucket_rmem; +typedef struct apr_bucket_rmem apr_bucket_rmem; /* * The Read only bucket type. This is basically for memory allocated off the * stack or literal strings. It cannot be modified, and the lifetime is @@ -216,14 +216,14 @@ typedef struct ap_bucket_rmem ap_bucket_rmem; * two different types. This contains a pointer to the front and end of the * string so that it is possible to remove characters at either end. */ -struct ap_bucket_rmem { +struct apr_bucket_rmem { size_t alloc_len; /* how much was allocated */ const void *start; /* Where does the actual data start in the alloc'ed block */ const void *end; /* where does the data actually end? */ }; -typedef struct ap_bucket_rwmem ap_bucket_rwmem; +typedef struct apr_bucket_rwmem apr_bucket_rwmem; /* * The read/write memory bucket type. This is for data that has been * allocated out of the heap. This bucket actually starts by allocating @@ -246,7 +246,7 @@ typedef struct ap_bucket_rwmem ap_bucket_rwmem; * easily add and remove characters at either end. Oh, the start cannot be * after the end either. */ -struct ap_bucket_rwmem { +struct apr_bucket_rwmem { void *alloc_addr; /* Where does the data start */ size_t alloc_len; /* how much was allocated */ void *start; /* Where does the actual data start @@ -254,7 +254,7 @@ struct ap_bucket_rwmem { void *end; /* where does the data actually end? */ }; -typedef struct ap_bucket_mmap ap_bucket_mmap; +typedef struct apr_bucket_mmap apr_bucket_mmap; /* * The mmap bucket type. This is basically just an allocation address and a @@ -262,7 +262,7 @@ typedef struct ap_bucket_mmap ap_bucket_mmap; * has a reference count in it, and a pointer to the beginning and end of * the data the bucket is referencing. */ -struct ap_bucket_mmap { +struct apr_bucket_mmap { void *alloc_addr; /* Where does the mmap start? */ int len; /* The amount of data in the mmap that we are * referencing with this bucket. This may be @@ -274,36 +274,36 @@ struct ap_bucket_mmap { /* ****** Bucket Brigade Functions ***** */ /* Create a new bucket brigade. The bucket brigade is originally empty. */ -APR_EXPORT(ap_bucket_brigade *) ap_brigade_create(ap_pool_t *p); +APR_EXPORT(apr_bucket_brigade *) ap_brigade_create(apr_pool_t *p); /* destroy an enitre bucket brigade. This includes destroying all of the * buckets within the bucket brigade's bucket list. */ -APR_EXPORT(ap_status_t) ap_brigade_destroy(void *b); +APR_EXPORT(apr_status_t) ap_brigade_destroy(void *b); /* append bucket(s) to a bucket_brigade. This is the correct way to add * buckets to the end of a bucket briagdes bucket list. This will accept * a list of buckets of any length. */ -APR_EXPORT(void) ap_brigade_append_buckets(ap_bucket_brigade *b, +APR_EXPORT(void) ap_brigade_append_buckets(apr_bucket_brigade *b, ap_bucket *e); /* consume nbytes from beginning of b -- call ap_bucket_destroy as appropriate, and/or modify start on last element */ -APR_EXPORT(void) ap_brigade_consume(ap_bucket_brigade *, int nbytes); +APR_EXPORT(void) ap_brigade_consume(apr_bucket_brigade *, int nbytes); /* create an iovec of the elements in a bucket_brigade... return number * of elements used. This is useful for writing to a file or to the * network efficiently. */ -APR_EXPORT(int) ap_brigade_to_iovec(ap_bucket_brigade *, +APR_EXPORT(int) ap_brigade_to_iovec(apr_bucket_brigade *, struct iovec *vec, int nvec); /* catenate bucket_brigade b onto bucket_brigade a, bucket_brigade b is * empty after this. Neither bucket brigade can be NULL, but either one of * them can be emtpy when calling this function. */ -APR_EXPORT(void) ap_brigade_catenate(ap_bucket_brigade *a, - ap_bucket_brigade *b); +APR_EXPORT(void) ap_brigade_catenate(apr_bucket_brigade *a, + apr_bucket_brigade *b); /* Destroy the first nvec buckets. This is very much like ap_brigade_consume * except instead of specifying the number of bytes to consume, it consumes @@ -312,7 +312,7 @@ APR_EXPORT(void) ap_brigade_catenate(ap_bucket_brigade *a, * vectors, we would destroy those 16 buckets. My gut is that this is the * wrong approach. I plan to change this soon-ish. */ -APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec); +APR_EXPORT(void) ap_consume_buckets(apr_bucket_brigade *b, int nvec); /* save the buf out to the specified iol. This can be used to flush the * data to the disk, or to send it out to the network. This is a poor @@ -320,10 +320,10 @@ APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec); * also required. Once filters have been finished, the whole concept of * iol's can just go away, and this function can go away with it. The * correct solution, is to have the functions that are currently calling - * this just call either ap_sendv or ap_writev directly. + * this just call either apr_sendv or apr_writev directly. */ -APR_EXPORT(ap_status_t) ap_brigade_to_iol(ap_ssize_t *total_bytes, - ap_bucket_brigade *a, +APR_EXPORT(apr_status_t) ap_brigade_to_iol(apr_ssize_t *total_bytes, + apr_bucket_brigade *a, ap_iol *iol); /* @@ -337,7 +337,7 @@ APR_EXPORT(ap_status_t) ap_brigade_to_iol(ap_ssize_t *total_bytes, * filters will be removing some of the data. This may be a dubios * optimization, I just don't know. */ -APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va); +APR_EXPORT(int) ap_brigade_vputstrs(apr_bucket_brigade *b, va_list va); /* * Both of these functions evaluate the printf and put the resulting string @@ -345,8 +345,8 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va); * two of them, is that the ap_r* functions needed both. I would love to be * able to remove one, but I don't think it's feasible. */ -APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...); -APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_list va); +APR_EXPORT(int) ap_brigade_printf(apr_bucket_brigade *b, const char *fmt, ...); +APR_EXPORT(int) ap_brigade_vprintf(apr_bucket_brigade *b, const char *fmt, va_list va); /* ****** Bucket Functions ***** */ @@ -356,7 +356,7 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis * when the bucket with the last reference is destroyed. Rwmem buckets * always have their data destroyed currently. */ -APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e); +APR_EXPORT(apr_status_t) ap_bucket_destroy(ap_bucket *e); /* get the length of the data in the bucket that is currently being * referenced. The bucket may contain more data, but if the start or end @@ -379,16 +379,16 @@ APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b); /* Create a read/write memory bucket */ APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(const void *buf, - ap_size_t nbyte, ap_ssize_t *w); + apr_size_t nbyte, apr_ssize_t *w); /* Create a mmap memory bucket */ APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(const void *buf, - ap_size_t nbytes, ap_ssize_t *w); + apr_size_t nbytes, apr_ssize_t *w); /* Create a read only memory bucket. */ APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(const void *buf, - ap_size_t nbyte, ap_ssize_t *w); + apr_size_t nbyte, apr_ssize_t *w); /* Create an End of Stream bucket */ APR_EXPORT(ap_bucket *) ap_bucket_eos_create(void); diff --git a/buckets/filters.c b/buckets/filters.c index 05a4538e1d4..d4e7a4810cf 100644 --- a/buckets/filters.c +++ b/buckets/filters.c @@ -68,7 +68,7 @@ */ typedef struct ap_filter_rec_t { const char *name; - ap_filter_bucket_cb bucket_cb; + apr_filter_bucket_cb bucket_cb; ap_filter_type ftype; struct ap_filter_rec_t *next; @@ -96,17 +96,17 @@ static ap_filter_rec_t *registered_filters = NULL; || (before_this)->r != (f)->r) -static ap_status_t filter_cleanup(void *ctx) +static apr_status_t filter_cleanup(void *ctx) { registered_filters = NULL; return APR_SUCCESS; } API_EXPORT(void) ap_register_filter(const char *name, - ap_filter_bucket_cb bucket_cb, + apr_filter_bucket_cb bucket_cb, ap_filter_type ftype) { - ap_filter_rec_t *frec = ap_palloc(FILTER_POOL, sizeof(*frec)); + ap_filter_rec_t *frec = apr_palloc(FILTER_POOL, sizeof(*frec)); frec->name = name; frec->bucket_cb = bucket_cb; @@ -115,7 +115,7 @@ API_EXPORT(void) ap_register_filter(const char *name, frec->next = registered_filters; registered_filters = frec; - ap_register_cleanup(FILTER_POOL, NULL, filter_cleanup, NULL); + apr_register_cleanup(FILTER_POOL, NULL, filter_cleanup, NULL); } API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) @@ -124,7 +124,7 @@ API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) for (; frec != NULL; frec = frec->next) { if (!strcasecmp(name, frec->name)) { - ap_filter_t *f = ap_pcalloc(r->pool, sizeof(*f)); + apr_filter_t *f = apr_pcalloc(r->pool, sizeof(*f)); f->bucket_cb = frec->bucket_cb; f->r = r; @@ -136,7 +136,7 @@ API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) r->filters = f; } else { - ap_filter_t *fscan = r->filters; + apr_filter_t *fscan = r->filters; while (!INSERT_BEFORE(f, fscan->next)) fscan = fscan->next; f->next = fscan->next; diff --git a/buckets/util_filter.c b/buckets/util_filter.c index 77bdc98728f..228491bca1c 100644 --- a/buckets/util_filter.c +++ b/buckets/util_filter.c @@ -66,7 +66,7 @@ */ typedef struct ap_filter_rec_t { const char *name; - ap_filter_func filter_func; + apr_filter_func filter_func; ap_filter_type ftype; struct ap_filter_rec_t *next; @@ -93,17 +93,17 @@ static ap_filter_rec_t *registered_filters = NULL; || (before_this)->ftype > (f)->ftype) -static ap_status_t filter_cleanup(void *ctx) +static apr_status_t filter_cleanup(void *ctx) { registered_filters = NULL; return APR_SUCCESS; } API_EXPORT(void) ap_register_filter(const char *name, - ap_filter_func filter_func, + apr_filter_func filter_func, ap_filter_type ftype) { - ap_filter_rec_t *frec = ap_palloc(FILTER_POOL, sizeof(*frec)); + ap_filter_rec_t *frec = apr_palloc(FILTER_POOL, sizeof(*frec)); frec->name = name; frec->filter_func = filter_func; @@ -112,7 +112,7 @@ API_EXPORT(void) ap_register_filter(const char *name, frec->next = registered_filters; registered_filters = frec; - ap_register_cleanup(FILTER_POOL, NULL, filter_cleanup, NULL); + apr_register_cleanup(FILTER_POOL, NULL, filter_cleanup, NULL); } API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) @@ -121,7 +121,7 @@ API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) for (; frec != NULL; frec = frec->next) { if (!strcasecmp(name, frec->name)) { - ap_filter_t *f = ap_pcalloc(r->pool, sizeof(*f)); + apr_filter_t *f = apr_pcalloc(r->pool, sizeof(*f)); f->filter_func = frec->filter_func; f->ctx = ctx; @@ -132,7 +132,7 @@ API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) r->filters = f; } else { - ap_filter_t *fscan = r->filters; + apr_filter_t *fscan = r->filters; while (!INSERT_BEFORE(f, fscan->next)) fscan = fscan->next; f->next = fscan->next; diff --git a/buckets/util_filter.h b/buckets/util_filter.h index f2f564a5a21..1c523abf93c 100644 --- a/buckets/util_filter.h +++ b/buckets/util_filter.h @@ -92,10 +92,10 @@ extern "C" { */ /* forward declare the filter type */ -typedef struct ap_filter_t ap_filter_t; +typedef struct apr_filter_t apr_filter_t; /* - * ap_filter_func: + * apr_filter_func: * * This function type is used for filter callbacks. It will be passed a * pointer to "this" filter, and a "bucket" containing the content to be @@ -114,7 +114,7 @@ typedef struct ap_filter_t ap_filter_t; * next/prev to insert/remove/replace elements in the bucket list, but * the types and values of the individual buckets should not be altered. */ -typedef ap_status_t (*ap_filter_func)(); +typedef apr_status_t (*apr_filter_func)(); /* * ap_filter_type: @@ -146,7 +146,7 @@ typedef enum { } ap_filter_type; /* - * ap_filter_t: + * apr_filter_t: * * This is the request-time context structure for an installed filter (in * the output filter chain). It provides the callback to use for filtering, @@ -159,13 +159,13 @@ typedef enum { * the state directly with the request. A callback should not change any of * the other fields. */ -struct ap_filter_t { - ap_filter_func filter_func; +struct apr_filter_t { + apr_filter_func filter_func; void *ctx; ap_filter_type ftype; - ap_filter_t *next; + apr_filter_t *next; }; /* @@ -178,7 +178,7 @@ struct ap_filter_t { * The filter's callback and type should be passed. */ API_EXPORT(void) ap_register_filter(const char *name, - ap_filter_func filter_func, + apr_filter_func filter_func, ap_filter_type ftype); /* @@ -198,9 +198,9 @@ API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r); /* * Things to do later: - * Add parameters to ap_filter_func type. Those parameters will be something + * Add parameters to apr_filter_func type. Those parameters will be something * like: - * (request_rec *r, ap_filter_t *filter, ap_data_list *the_data) + * (request_rec *r, apr_filter_t *filter, ap_data_list *the_data) * obviously, the request_rec is the current request, and the filter * is the current filter stack. The data_list is a bucket list or * bucket_brigade, but I am trying to keep this patch neutral. (If this diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 9c92aa04d83..5e10b4ce276 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -132,21 +132,21 @@ struct dl_info { * add the basic "wrappers" here. */ -ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, - ap_pool_t *ctx) +apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, + apr_pool_t *ctx) { void *os_handle = dlopen((char *)path, RTLD_NOW | RTLD_GLOBAL); if(os_handle == NULL) return APR_EDSOOPEN; - *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); + *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; return APR_SUCCESS; } -ap_status_t ap_dso_unload(ap_dso_handle_t *handle) +apr_status_t apr_dso_unload(apr_dso_handle_t *handle) { if (dlclose(handle->handle) != 0) return APR_EINIT; @@ -154,8 +154,8 @@ ap_status_t ap_dso_unload(ap_dso_handle_t *handle) return APR_SUCCESS; } -ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, - ap_dso_handle_t *handle, +apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, + apr_dso_handle_t *handle, const char *symname) { void *retval = dlsym(handle->handle, symname); diff --git a/dso/aix/dso.h b/dso/aix/dso.h index ae89f9ee585..6b7ca8ea74e 100644 --- a/dso/aix/dso.h +++ b/dso/aix/dso.h @@ -68,8 +68,8 @@ void *dlsym(void *handle, const char *symbol); const char *dlerror(void); int dlclose(void *handle); -struct ap_dso_handle_t { - ap_pool_t *cont; +struct apr_dso_handle_t { + apr_pool_t *cont; void *handle; }; diff --git a/dso/beos/dso.c b/dso/beos/dso.c index c6ed29f1f0f..6a29f1efcbe 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -56,21 +56,21 @@ #if APR_HAS_DSO -ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, - ap_pool_t *ctx) +apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, + apr_pool_t *ctx) { image_id newid; if((newid = load_add_on(path)) < B_NO_ERROR) return APR_EINIT; - *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); + *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = newid; (*res_handle)->cont = ctx; return APR_SUCCESS; } -ap_status_t ap_dso_unload(ap_dso_handle_t *handle) +apr_status_t apr_dso_unload(apr_dso_handle_t *handle) { if(unload_add_on(handle->handle) < B_NO_ERROR) return APR_EINIT; @@ -78,7 +78,7 @@ ap_status_t ap_dso_unload(ap_dso_handle_t *handle) return APR_SUCCESS; } -ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, +apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, const char *symname) { int err; @@ -95,7 +95,7 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, return APR_SUCCESS; } -const char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) +const char *apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) { strncpy(strerror(errno), buffer, buflen); return buffer; diff --git a/dso/beos/dso.h b/dso/beos/dso.h index 71a75ef58d6..476e71c8fa4 100644 --- a/dso/beos/dso.h +++ b/dso/beos/dso.h @@ -66,9 +66,9 @@ #if APR_HAS_DSO -struct ap_dso_handle_t { +struct apr_dso_handle_t { image_id handle; /* Handle to the DSO loaded */ - ap_pool_t *cont; + apr_pool_t *cont; }; #endif diff --git a/dso/os2/dso.c b/dso/os2/dso.c index 5bd913b2e0e..d7706f13882 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -60,38 +60,38 @@ #if APR_HAS_DSO -static ap_status_t dso_cleanup(void *thedso) +static apr_status_t dso_cleanup(void *thedso) { - ap_dso_handle_t *dso = thedso; - return ap_dso_unload(dso); + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); } -ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, ap_pool_t *ctx) +apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { char failed_module[20]; HMODULE handle; int rc; - *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); + *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->cont = ctx; (*res_handle)->load_error = APR_SUCCESS; (*res_handle)->failed_module = NULL; if ((rc = DosLoadModule(failed_module, sizeof(failed_module), path, &handle)) != 0) { (*res_handle)->load_error = APR_OS2_STATUS(rc); - (*res_handle)->failed_module = ap_pstrdup(ctx, failed_module); + (*res_handle)->failed_module = apr_pstrdup(ctx, failed_module); return APR_OS2_STATUS(rc); } (*res_handle)->handle = handle; - ap_register_cleanup(ctx, *res_handle, dso_cleanup, ap_null_cleanup); + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_dso_unload(ap_dso_handle_t *handle) +apr_status_t apr_dso_unload(apr_dso_handle_t *handle) { int rc; @@ -108,8 +108,8 @@ ap_status_t ap_dso_unload(ap_dso_handle_t *handle) -ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, - ap_dso_handle_t *handle, +apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, + apr_dso_handle_t *handle, const char *symname) { PFN func; @@ -127,14 +127,14 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, -char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) +char *apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) { char message[200]; - ap_strerror(dso->load_error, message, sizeof(message)); + apr_strerror(dso->load_error, message, sizeof(message)); strcat(message, " ("); strcat(message, dso->failed_module); strcat(message, ")"); - ap_cpystrn(buffer, message, buflen); + apr_cpystrn(buffer, message, buflen); return buffer; } diff --git a/dso/os2/dso.h b/dso/os2/dso.h index b37e1a54c10..1597c81d112 100644 --- a/dso/os2/dso.h +++ b/dso/os2/dso.h @@ -66,10 +66,10 @@ #if APR_HAS_DSO -struct ap_dso_handle_t { - ap_pool_t *cont; /* Context for returning error strings */ +struct apr_dso_handle_t { + apr_pool_t *cont; /* Context for returning error strings */ HMODULE handle; /* Handle to the DSO loaded */ - ap_status_t load_error; + apr_status_t load_error; char *failed_module; }; diff --git a/dso/unix/dso.c b/dso/unix/dso.c index c3e815fa67e..9a6a0e0fbd0 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -56,8 +56,8 @@ #if APR_HAS_DSO -ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, - ap_pool_t *ctx) +apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, + apr_pool_t *ctx) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) shl_t os_handle = shl_load(path, BIND_IMMEDIATE|BIND_VERBOSE|BIND_NOSTART, 0L); @@ -68,7 +68,7 @@ ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, void *os_handle = dlopen(path, RTLD_NOW | RTLD_GLOBAL); #endif - *res_handle = ap_pcalloc(ctx, sizeof(**res_handle)); + *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); if(os_handle == NULL) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) @@ -86,7 +86,7 @@ ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, return APR_SUCCESS; } -ap_status_t ap_dso_unload(ap_dso_handle_t *handle) +apr_status_t apr_dso_unload(apr_dso_handle_t *handle) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) shl_unload((shl_t)handle->handle); @@ -99,8 +99,8 @@ ap_status_t ap_dso_unload(ap_dso_handle_t *handle) return APR_SUCCESS; } -ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, - ap_dso_handle_t *handle, +apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, + apr_dso_handle_t *handle, const char *symname) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) @@ -141,7 +141,7 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, #endif /* not HP-UX; use dlsym()/dlerror() */ } -const char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) +const char *apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) { if (dso->errormsg) return dso->errormsg; diff --git a/dso/unix/dso.h b/dso/unix/dso.h index ef8aa572a52..fc9b8325e17 100644 --- a/dso/unix/dso.h +++ b/dso/unix/dso.h @@ -85,8 +85,8 @@ #define DLSYM_NEEDS_UNDERSCORE #endif -struct ap_dso_handle_t { - ap_pool_t *cont; +struct apr_dso_handle_t { + apr_pool_t *cont; void *handle; const char *errormsg; }; diff --git a/dso/win32/dso.c b/dso/win32/dso.c index fadde87b923..732e86fc924 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -56,11 +56,11 @@ #if APR_HAS_DSO -ap_status_t ap_dso_load(struct ap_dso_handle_t **res_handle, const char *path, - ap_pool_t *ctx) +apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path, + apr_pool_t *ctx) { HINSTANCE os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); - *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); + *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); if(os_handle == NULL) { (*res_handle)->load_error = GetLastError(); @@ -73,7 +73,7 @@ ap_status_t ap_dso_load(struct ap_dso_handle_t **res_handle, const char *path, return APR_SUCCESS; } -ap_status_t ap_dso_unload(struct ap_dso_handle_t *handle) +apr_status_t apr_dso_unload(struct apr_dso_handle_t *handle) { if (!FreeLibrary(handle->handle)) { return GetLastError(); @@ -81,8 +81,8 @@ ap_status_t ap_dso_unload(struct ap_dso_handle_t *handle) return APR_SUCCESS; } -ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, - struct ap_dso_handle_t *handle, +apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, + struct apr_dso_handle_t *handle, const char *symname) { FARPROC retval = GetProcAddress(handle->handle, symname); @@ -95,9 +95,9 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, return APR_SUCCESS; } -const char *ap_dso_error(ap_dso_handle_t *dso, char *buf, ap_size_t bufsize) +const char *apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize) { - return ap_strerror(dso->load_error, buf, bufsize); + return apr_strerror(dso->load_error, buf, bufsize); } #endif diff --git a/dso/win32/dso.h b/dso/win32/dso.h index 73ab8b1ed58..32bf6b7be74 100644 --- a/dso/win32/dso.h +++ b/dso/win32/dso.h @@ -63,10 +63,10 @@ #if APR_HAS_DSO -struct ap_dso_handle_t { - ap_pool_t *cont; +struct apr_dso_handle_t { + apr_pool_t *cont; void *handle; - ap_status_t load_error; + apr_status_t load_error; }; #endif diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 34f973ec63c..05674c69edf 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -60,23 +60,23 @@ #define INCL_DOS #include -static ap_status_t dir_cleanup(void *thedir) +static apr_status_t dir_cleanup(void *thedir) { - ap_dir_t *dir = thedir; - return ap_closedir(dir); + apr_dir_t *dir = thedir; + return apr_closedir(dir); } -ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cntxt) +apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cntxt) { - ap_dir_t *thedir = (ap_dir_t *)ap_palloc(cntxt, sizeof(ap_dir_t)); + apr_dir_t *thedir = (apr_dir_t *)apr_palloc(cntxt, sizeof(apr_dir_t)); if (thedir == NULL) return APR_ENOMEM; thedir->cntxt = cntxt; - thedir->dirname = ap_pstrdup(cntxt, dirname); + thedir->dirname = apr_pstrdup(cntxt, dirname); if (thedir->dirname == NULL) return APR_ENOMEM; @@ -84,13 +84,13 @@ ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cntxt) thedir->handle = 0; thedir->validentry = FALSE; *new = thedir; - ap_register_cleanup(cntxt, thedir, dir_cleanup, ap_null_cleanup); + apr_register_cleanup(cntxt, thedir, dir_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_closedir(ap_dir_t *thedir) +apr_status_t apr_closedir(apr_dir_t *thedir) { int rv = 0; @@ -107,14 +107,14 @@ ap_status_t ap_closedir(ap_dir_t *thedir) -ap_status_t ap_readdir(ap_dir_t *thedir) +apr_status_t apr_readdir(apr_dir_t *thedir) { int rv; ULONG entries = 1; if (thedir->handle == 0) { thedir->handle = HDIR_CREATE; - rv = DosFindFirst(ap_pstrcat(thedir->cntxt, thedir->dirname, "/*", NULL), &thedir->handle, + rv = DosFindFirst(apr_pstrcat(thedir->cntxt, thedir->dirname, "/*", NULL), &thedir->handle, FILE_ARCHIVED|FILE_DIRECTORY|FILE_SYSTEM|FILE_HIDDEN|FILE_READONLY, &thedir->entry, sizeof(thedir->entry), &entries, FIL_STANDARD); } else { @@ -136,28 +136,28 @@ ap_status_t ap_readdir(ap_dir_t *thedir) -ap_status_t ap_rewinddir(ap_dir_t *thedir) +apr_status_t apr_rewinddir(apr_dir_t *thedir) { - return ap_closedir(thedir); + return apr_closedir(thedir); } -ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { return APR_OS2_STATUS(DosCreateDir(path, NULL)); } -ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont) +apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) { return APR_OS2_STATUS(DosDeleteDir(path)); } -ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) +apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir) { if (thedir->validentry) { *size = thedir->entry.cbFile; @@ -169,7 +169,7 @@ ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) -ap_status_t ap_dir_entry_mtime(ap_time_t *time, ap_dir_t *thedir) +apr_status_t apr_dir_entry_mtime(apr_time_t *time, apr_dir_t *thedir) { if (thedir->validentry) { ap_os2_time_to_ap_time(time, thedir->entry.fdateLastWrite, thedir->entry.ftimeLastWrite); @@ -181,7 +181,7 @@ ap_status_t ap_dir_entry_mtime(ap_time_t *time, ap_dir_t *thedir) -ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) +apr_status_t apr_dir_entry_ftype(ap_filetype_e *type, apr_dir_t *thedir) { int rc; HFILE hFile; @@ -193,7 +193,7 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) *type = APR_DIR; return APR_SUCCESS; } else { - rc = DosOpen(ap_pstrcat(thedir->cntxt, thedir->dirname, "/", thedir->entry.achName, NULL) , + rc = DosOpen(apr_pstrcat(thedir->cntxt, thedir->dirname, "/", thedir->entry.achName, NULL) , &hFile, &action, 0, 0, OPEN_ACTION_FAIL_IF_NEW|OPEN_ACTION_OPEN_IF_EXISTS, OPEN_SHARE_DENYNONE|OPEN_ACCESS_READONLY, NULL); @@ -216,7 +216,7 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) -ap_status_t ap_get_dir_filename(char **new, ap_dir_t *thedir) +apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) { if (thedir->validentry) { *new = thedir->entry.achName; diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index d3cedd6a70f..a921d096bbd 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -60,13 +60,13 @@ #define INCL_DOS #include -ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) +apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { int rv; - ap_file_t *dup_file; + apr_file_t *dup_file; if (*new_file == NULL) { - dup_file = (ap_file_t *)ap_palloc(p, sizeof(ap_file_t)); + dup_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t)); if (dup_file == NULL) { return APR_ENOMEM; @@ -84,7 +84,7 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) return APR_OS2_STATUS(rv); } - dup_file->fname = ap_pstrdup(dup_file->cntxt, old_file->fname); + dup_file->fname = apr_pstrdup(dup_file->cntxt, old_file->fname); dup_file->buffered = old_file->buffered; dup_file->isopen = old_file->isopen; dup_file->flags = old_file->flags; @@ -92,8 +92,8 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) dup_file->pipe = old_file->pipe; if (*new_file == NULL) { - ap_register_cleanup(dup_file->cntxt, dup_file, apr_file_cleanup, - ap_null_cleanup); + apr_register_cleanup(dup_file->cntxt, dup_file, apr_file_cleanup, + apr_null_cleanup); *new_file = dup_file; } diff --git a/file_io/os2/fileio.h b/file_io/os2/fileio.h index 738e17f2ec2..6aa1be1c5ee 100644 --- a/file_io/os2/fileio.h +++ b/file_io/os2/fileio.h @@ -67,14 +67,14 @@ #define APR_FILE_BUFSIZE 4096 -struct ap_file_t { - ap_pool_t *cntxt; +struct apr_file_t { + apr_pool_t *cntxt; HFILE filedes; char * fname; int isopen; int buffered; int eof_hit; - ap_int32_t flags; + apr_int32_t flags; int timeout; int pipe; HEV pipeSem; @@ -85,19 +85,19 @@ struct ap_file_t { unsigned long dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write unsigned long filePtr; // position in file of handle - ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields + apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields }; -struct ap_dir_t { - ap_pool_t *cntxt; +struct apr_dir_t { + apr_pool_t *cntxt; char *dirname; ULONG handle; FILEFINDBUF3 entry; int validentry; }; -ap_status_t apr_file_cleanup(void *); -ap_status_t ap_os2_time_to_ap_time(ap_time_t *result, FDATE os2date, FTIME os2time); +apr_status_t apr_file_cleanup(void *); +apr_status_t ap_os2_time_to_ap_time(apr_time_t *result, FDATE os2date, FTIME os2time); #endif /* ! FILE_IO_H */ diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 96d0deb2d3c..43dc3f1524a 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -61,7 +61,7 @@ #include -static void FS3_to_finfo(ap_finfo_t *finfo, FILESTATUS3 *fstatus) +static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus) { finfo->protection = (fstatus->attrFile & FILE_READONLY) ? 0555 : 0777; @@ -82,7 +82,7 @@ static void FS3_to_finfo(ap_finfo_t *finfo, FILESTATUS3 *fstatus) -static ap_status_t handle_type(ap_filetype_e *ftype, HFILE file) +static apr_status_t handle_type(ap_filetype_e *ftype, HFILE file) { ULONG filetype, fileattr, rc; @@ -110,7 +110,7 @@ static ap_status_t handle_type(ap_filetype_e *ftype, HFILE file) -ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) +apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) { ULONG rc; FILESTATUS3 fstatus; @@ -137,13 +137,13 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) return APR_OS2_STATUS(rc); } -ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms) +apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) { return APR_ENOTIMPL; } -ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) +apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) { ULONG rc; FILESTATUS3 fstatus; @@ -156,7 +156,7 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) FS3_to_finfo(finfo, &fstatus); return APR_SUCCESS; } else if (rc == ERROR_INVALID_ACCESS) { - memset(finfo, 0, sizeof(ap_finfo_t)); + memset(finfo, 0, sizeof(apr_finfo_t)); finfo->protection = 0444; finfo->filetype = APR_CHR; return APR_SUCCESS; diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c index 209eec026bc..5fa39815113 100644 --- a/file_io/os2/maperrorcode.c +++ b/file_io/os2/maperrorcode.c @@ -115,7 +115,7 @@ static int errormap[][2] = { #define MAPSIZE (sizeof(errormap)/sizeof(errormap[0])) -int ap_canonical_error(ap_status_t err) +int apr_canonical_error(apr_status_t err) { int rv = -1, index; @@ -129,7 +129,7 @@ int ap_canonical_error(ap_status_t err) if (index -ap_status_t apr_file_cleanup(void *thefile) +apr_status_t apr_file_cleanup(void *thefile) { - ap_file_t *file = thefile; - return ap_close(file); + apr_file_t *file = thefile; + return apr_close(file); } -ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cntxt) +apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cntxt) { int oflags = 0; int mflags = OPEN_FLAGS_FAIL_ON_ERROR|OPEN_SHARE_DENYNONE; int rv; ULONG action; - ap_file_t *dafile = (ap_file_t *)ap_palloc(cntxt, sizeof(ap_file_t)); + apr_file_t *dafile = (apr_file_t *)apr_palloc(cntxt, sizeof(apr_file_t)); *new = dafile; dafile->cntxt = cntxt; @@ -95,8 +95,8 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil dafile->buffered = (flag & APR_BUFFERED) > 0; if (dafile->buffered) { - dafile->buffer = ap_palloc(cntxt, APR_FILE_BUFSIZE); - rv = ap_create_lock(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cntxt); + dafile->buffer = apr_palloc(cntxt, APR_FILE_BUFSIZE); + rv = apr_create_lock(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cntxt); if (rv) return rv; @@ -135,26 +135,26 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil return APR_OS2_STATUS(rv); dafile->isopen = TRUE; - dafile->fname = ap_pstrdup(cntxt, fname); + dafile->fname = apr_pstrdup(cntxt, fname); dafile->filePtr = 0; dafile->bufpos = 0; dafile->dataRead = 0; dafile->direction = 0; dafile->pipe = FALSE; - ap_register_cleanup(dafile->cntxt, dafile, apr_file_cleanup, ap_null_cleanup); + apr_register_cleanup(dafile->cntxt, dafile, apr_file_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_close(ap_file_t *file) +apr_status_t apr_close(apr_file_t *file) { ULONG rc; - ap_status_t status; + apr_status_t status; if (file && file->isopen) { - ap_flush(file); + apr_flush(file); rc = DosClose(file->filedes); if (rc == 0) { @@ -170,14 +170,14 @@ ap_status_t ap_close(ap_file_t *file) } if (file->buffered) - ap_destroy_lock(file->mutex); + apr_destroy_lock(file->mutex); return APR_SUCCESS; } -ap_status_t ap_remove_file(const char *path, ap_pool_t *cntxt) +apr_status_t apr_remove_file(const char *path, apr_pool_t *cntxt) { ULONG rc = DosDelete(path); return APR_OS2_STATUS(rc); @@ -185,8 +185,8 @@ ap_status_t ap_remove_file(const char *path, ap_pool_t *cntxt) -ap_status_t ap_rename_file(const char *from_path, const char *to_path, - ap_pool_t *p) +apr_status_t apr_rename_file(const char *from_path, const char *to_path, + apr_pool_t *p) { ULONG rc = DosMove(from_path, to_path); @@ -203,7 +203,7 @@ ap_status_t ap_rename_file(const char *from_path, const char *to_path, -ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) +apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) { if (file == NULL) { return APR_ENOFILE; @@ -215,11 +215,11 @@ ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) -ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, ap_pool_t *cont) +apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) { - ap_os_file_t *dafile = thefile; + apr_os_file_t *dafile = thefile; if ((*file) == NULL) { - (*file) = (ap_file_t *)ap_palloc(cont, sizeof(ap_file_t)); + (*file) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); (*file)->cntxt = cont; } (*file)->filedes = *dafile; @@ -233,7 +233,7 @@ ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, ap_pool_t *c -ap_status_t ap_eof(ap_file_t *fptr) +apr_status_t apr_eof(apr_file_t *fptr) { if (!fptr->isopen || fptr->eof_hit == 1) { return APR_EOF; @@ -243,9 +243,9 @@ ap_status_t ap_eof(ap_file_t *fptr) -ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont) +apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { - (*thefile) = ap_palloc(cont, sizeof(ap_file_t)); + (*thefile) = apr_palloc(cont, sizeof(apr_file_t)); if ((*thefile) == NULL) { return APR_ENOMEM; } diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 8c4482188d9..c3b01aa8e74 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -60,7 +60,7 @@ #include #include -ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) +apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) { ULONG filedes[2]; ULONG rc, action; @@ -90,7 +90,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) return APR_OS2_STATUS(rc); } - (*in) = (ap_file_t *)ap_palloc(cont, sizeof(ap_file_t)); + (*in) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); rc = DosCreateEventSem(NULL, &(*in)->pipeSem, DC_SEM_SHARED, FALSE); if (rc) { @@ -114,31 +114,31 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*in)->cntxt = cont; (*in)->filedes = filedes[0]; - (*in)->fname = ap_pstrdup(cont, pipename); + (*in)->fname = apr_pstrdup(cont, pipename); (*in)->isopen = TRUE; (*in)->buffered = FALSE; (*in)->flags = 0; (*in)->pipe = 1; (*in)->timeout = -1; - ap_register_cleanup(cont, *in, apr_file_cleanup, ap_null_cleanup); + apr_register_cleanup(cont, *in, apr_file_cleanup, apr_null_cleanup); - (*out) = (ap_file_t *)ap_palloc(cont, sizeof(ap_file_t)); + (*out) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); (*out)->cntxt = cont; (*out)->filedes = filedes[1]; - (*out)->fname = ap_pstrdup(cont, pipename); + (*out)->fname = apr_pstrdup(cont, pipename); (*out)->isopen = TRUE; (*out)->buffered = FALSE; (*out)->flags = 0; (*out)->pipe = 1; (*out)->timeout = -1; - ap_register_cleanup(cont, *out, apr_file_cleanup, ap_null_cleanup); + apr_register_cleanup(cont, *out, apr_file_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) { /* Not yet implemented, interface not suitable */ return APR_ENOTIMPL; @@ -146,7 +146,7 @@ ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, ap_po -ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) +apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 234689aaa3f..5bf040ac32e 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -62,7 +62,7 @@ #include #include -ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) +apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *nbytes) { ULONG rc = 0; ULONG bytesread; @@ -77,10 +77,10 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) ULONG blocksize; ULONG size = *nbytes; - ap_lock(thefile->mutex); + apr_lock(thefile->mutex); if (thefile->direction == 1) { - ap_flush(thefile); + apr_flush(thefile); thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -106,7 +106,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) } *nbytes = rc == 0 ? pos - (char *)buf : 0; - ap_unlock(thefile->mutex); + apr_unlock(thefile->mutex); return APR_OS2_STATUS(rc); } else { if (thefile->pipe) @@ -138,7 +138,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) -ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) +apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes) { ULONG rc = 0; ULONG byteswritten; @@ -153,7 +153,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) int blocksize; int size = *nbytes; - ap_lock(thefile->mutex); + apr_lock(thefile->mutex); if ( thefile->direction == 0 ) { // Position file pointer for writing at the offset we are logically reading from @@ -166,7 +166,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) while (rc == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full - rc = ap_flush(thefile); + rc = apr_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); @@ -175,7 +175,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) size -= blocksize; } - ap_unlock(thefile->mutex); + apr_unlock(thefile->mutex); return APR_OS2_STATUS(rc); } else { rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten); @@ -194,7 +194,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) #ifdef HAVE_WRITEV -ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nvec, ap_ssize_t *nbytes) +apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_ssize_t *nbytes) { int bytes; if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { @@ -210,7 +210,7 @@ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nve -ap_status_t ap_putc(char ch, ap_file_t *thefile) +apr_status_t apr_putc(char ch, apr_file_t *thefile) { ULONG rc; ULONG byteswritten; @@ -230,15 +230,15 @@ ap_status_t ap_putc(char ch, ap_file_t *thefile) -ap_status_t ap_ungetc(char ch, ap_file_t *thefile) +apr_status_t apr_ungetc(char ch, apr_file_t *thefile) { - ap_off_t offset = -1; - return ap_seek(thefile, APR_CUR, &offset); + apr_off_t offset = -1; + return apr_seek(thefile, APR_CUR, &offset); } -ap_status_t ap_getc(char *ch, ap_file_t *thefile) +apr_status_t apr_getc(char *ch, apr_file_t *thefile) { ULONG rc; int bytesread; @@ -248,7 +248,7 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) } bytesread = 1; - rc = ap_read(thefile, ch, &bytesread); + rc = apr_read(thefile, ch, &bytesread); if (rc) { return rc; @@ -264,17 +264,17 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) -ap_status_t ap_puts(const char *str, ap_file_t *thefile) +apr_status_t apr_puts(const char *str, apr_file_t *thefile) { - ap_ssize_t len; + apr_ssize_t len; len = strlen(str); - return ap_write(thefile, str, &len); + return apr_write(thefile, str, &len); } -ap_status_t ap_flush(ap_file_t *thefile) +apr_status_t apr_flush(apr_file_t *thefile) { if (thefile->buffered) { ULONG written = 0; @@ -299,15 +299,15 @@ ap_status_t ap_flush(ap_file_t *thefile) -ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) +apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) { ssize_t readlen; - ap_status_t rv = APR_SUCCESS; + apr_status_t rv = APR_SUCCESS; int i; for (i = 0; i < len-1; i++) { readlen = 1; - rv = ap_read(thefile, str+i, &readlen); + rv = apr_read(thefile, str+i, &readlen); if (readlen != 1) { rv = APR_EOF; @@ -325,7 +325,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) -APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) +APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) { int cc; va_list ap; @@ -337,8 +337,8 @@ APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) return 0; } va_start(ap, format); - len = ap_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = ap_puts(buf, fptr); + len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); + cc = apr_puts(buf, fptr); va_end(ap); free(buf); return (cc == APR_SUCCESS) ? len : -1; @@ -346,7 +346,7 @@ APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) -ap_status_t ap_file_check_read(ap_file_t *fd) +apr_status_t ap_file_check_read(apr_file_t *fd) { int rc; diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index e303cf41cdb..948f423f63c 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -63,13 +63,13 @@ -static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) +static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) { long newbufpos; ULONG rc; if (thefile->direction == 1) { - ap_flush(thefile); + apr_flush(thefile); thefile->bufpos = thefile->direction = thefile->dataRead = 0; } @@ -89,7 +89,7 @@ static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) -ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) +apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { if (!thefile->isopen) { return APR_EBADF; @@ -97,7 +97,7 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) if (thefile->buffered) { int rc = EINVAL; - ap_finfo_t finfo; + apr_finfo_t finfo; switch (where) { case APR_SET: @@ -109,7 +109,7 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) break; case APR_END: - rc = ap_getfileinfo(&finfo, thefile); + rc = apr_getfileinfo(&finfo, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size - *offset); break; diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index f1599d1de52..2bddb4a313d 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -56,9 +56,9 @@ #include "apr_strings.h" #include "apr_portable.h" -static ap_status_t dir_cleanup(void *thedir) +static apr_status_t dir_cleanup(void *thedir) { - ap_dir_t *dir = thedir; + apr_dir_t *dir = thedir; if (closedir(dir->dirstruct) == 0) { return APR_SUCCESS; } @@ -67,50 +67,50 @@ static ap_status_t dir_cleanup(void *thedir) } } -ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cont) +apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) { /* On some platforms (e.g., Linux+GNU libc), d_name[] in struct * dirent is declared with enough storage for the name. On other * platforms (e.g., Solaris 8 for Intel), d_name is declared as a * one-byte array. Note: gcc evaluates this at compile time. */ - ap_size_t dirent_size = + apr_size_t dirent_size = (sizeof((*new)->entry->d_name) > 1 ? sizeof(struct dirent) : sizeof (struct dirent) + 255); - (*new) = (ap_dir_t *)ap_palloc(cont, sizeof(ap_dir_t)); + (*new) = (apr_dir_t *)apr_palloc(cont, sizeof(apr_dir_t)); (*new)->cntxt = cont; - (*new)->dirname = ap_pstrdup(cont, dirname); + (*new)->dirname = apr_pstrdup(cont, dirname); (*new)->dirstruct = opendir(dirname); - (*new)->entry = ap_pcalloc(cont, dirent_size); + (*new)->entry = apr_pcalloc(cont, dirent_size); if ((*new)->dirstruct == NULL) { return errno; } else { - ap_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, + apr_null_cleanup); return APR_SUCCESS; } } -ap_status_t ap_closedir(ap_dir_t *thedir) +apr_status_t apr_closedir(apr_dir_t *thedir) { - ap_status_t rv; + apr_status_t rv; if ((rv = dir_cleanup(thedir)) == APR_SUCCESS) { - ap_kill_cleanup(thedir->cntxt, thedir, dir_cleanup); + apr_kill_cleanup(thedir->cntxt, thedir, dir_cleanup); return APR_SUCCESS; } return rv; } -ap_status_t ap_readdir(ap_dir_t *thedir) +apr_status_t apr_readdir(apr_dir_t *thedir) { #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && !defined(READDIR_IS_THREAD_SAFE) - ap_status_t ret; + apr_status_t ret; #endif #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ @@ -135,15 +135,15 @@ ap_status_t ap_readdir(ap_dir_t *thedir) #endif } -ap_status_t ap_rewinddir(ap_dir_t *thedir) +apr_status_t apr_rewinddir(apr_dir_t *thedir) { rewinddir(thedir->dirstruct); return APR_SUCCESS; } -ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { - mode_t mode = ap_unix_perms2mode(perm); + mode_t mode = apr_unix_perms2mode(perm); if (mkdir(path, mode) == 0) { return APR_SUCCESS; @@ -153,7 +153,7 @@ ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, ap_pool_t *cont) } } -ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont) +apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) { if (rmdir(path) == 0) { return APR_SUCCESS; @@ -163,7 +163,7 @@ ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont) } } -ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) +apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir) { struct stat filestat; char *fname = NULL; @@ -172,7 +172,7 @@ ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) *size = -1; return APR_ENOFILE; } - fname = ap_pstrcat(thedir->cntxt, thedir->dirname, "/", + fname = apr_pstrcat(thedir->cntxt, thedir->dirname, "/", thedir->entry->d_name, NULL); if (stat(fname, &filestat) == -1) { *size = -1; @@ -183,7 +183,7 @@ ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) return APR_SUCCESS; } -ap_status_t ap_dir_entry_mtime(ap_time_t *mtime, ap_dir_t *thedir) +apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir) { struct stat filestat; char *fname = NULL; @@ -193,18 +193,18 @@ ap_status_t ap_dir_entry_mtime(ap_time_t *mtime, ap_dir_t *thedir) return APR_ENOFILE; } - fname = ap_pstrcat(thedir->cntxt, thedir->dirname, "/", + fname = apr_pstrcat(thedir->cntxt, thedir->dirname, "/", thedir->entry->d_name, NULL); if (stat(fname, &filestat) == -1) { *mtime = -1; return errno; } - ap_ansi_time_to_ap_time(mtime, filestat.st_mtime); + apr_ansi_time_to_ap_time(mtime, filestat.st_mtime); return APR_SUCCESS; } -ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) +apr_status_t apr_dir_entry_ftype(ap_filetype_e *type, apr_dir_t *thedir) { struct stat filestat; char *fname = NULL; @@ -214,7 +214,7 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) return APR_ENOFILE; } - fname = ap_pstrcat(thedir->cntxt, thedir->dirname, "/", + fname = apr_pstrcat(thedir->cntxt, thedir->dirname, "/", thedir->entry->d_name, NULL); if (stat(fname, &filestat) == -1) { *type = APR_REG; @@ -240,18 +240,18 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) return APR_SUCCESS; } -ap_status_t ap_get_dir_filename(char **new, ap_dir_t *thedir) +apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) { /* Detect End-Of-File */ if (thedir == NULL || thedir->entry == NULL) { *new = NULL; return APR_ENOENT; } - (*new) = ap_pstrdup(thedir->cntxt, thedir->entry->d_name); + (*new) = apr_pstrdup(thedir->cntxt, thedir->entry->d_name); return APR_SUCCESS; } -ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir) +apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) { if (dir == NULL) { return APR_ENODIR; @@ -260,11 +260,11 @@ ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir) return APR_SUCCESS; } -ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir, - ap_pool_t *cont) +apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, + apr_pool_t *cont) { if ((*dir) == NULL) { - (*dir) = (ap_dir_t *)ap_pcalloc(cont, sizeof(ap_dir_t)); + (*dir) = (apr_dir_t *)apr_pcalloc(cont, sizeof(apr_dir_t)); (*dir)->cntxt = cont; } (*dir)->dirstruct = thedir; diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 2a5135e82e3..f9ba9cd2131 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -68,16 +68,16 @@ #else #include "fileio.h" #endif -/* A file to put ALL of the accessor functions for ap_file_t types. */ +/* A file to put ALL of the accessor functions for apr_file_t types. */ -ap_status_t ap_get_filename(char **fname, ap_file_t *thefile) +apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) { - *fname = ap_pstrdup(thefile->cntxt, thefile->fname); + *fname = apr_pstrdup(thefile->cntxt, thefile->fname); return APR_SUCCESS; } #if !defined(OS2) && !defined(WIN32) -mode_t ap_unix_perms2mode(ap_fileperms_t perms) +mode_t apr_unix_perms2mode(apr_fileperms_t perms) { mode_t mode = 0; @@ -105,9 +105,9 @@ mode_t ap_unix_perms2mode(ap_fileperms_t perms) return mode; } -ap_fileperms_t ap_unix_mode2perms(mode_t mode) +apr_fileperms_t apr_unix_mode2perms(mode_t mode) { - ap_fileperms_t perms = 0; + apr_fileperms_t perms = 0; if (mode & S_IRUSR) perms |= APR_UREAD; @@ -134,13 +134,13 @@ ap_fileperms_t ap_unix_mode2perms(mode_t mode) } #endif -ap_status_t ap_get_filedata(void **data, const char *key, ap_file_t *file) +apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file) { - return ap_get_userdata(data, key, file->cntxt); + return apr_get_userdata(data, key, file->cntxt); } -ap_status_t ap_set_filedata(ap_file_t *file, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, file->cntxt); + return apr_set_userdata(data, key, cleanup, file->cntxt); } diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index b1f4f5e4b44..06956fac5c6 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -56,12 +56,12 @@ #include "apr_strings.h" #include "apr_portable.h" -ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) +apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { int have_file = 0; if ((*new_file) == NULL) { - (*new_file) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t)); + (*new_file) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); if ((*new_file) == NULL) { return APR_ENOMEM; } @@ -76,18 +76,18 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) else { (*new_file)->filedes = dup(old_file->filedes); } - (*new_file)->fname = ap_pstrdup(p, old_file->fname); + (*new_file)->fname = apr_pstrdup(p, old_file->fname); (*new_file)->buffered = old_file->buffered; if ((*new_file)->buffered) { #if APR_HAS_THREADS - ap_create_lock(&((*new_file)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, + apr_create_lock(&((*new_file)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, p); #endif - (*new_file)->buffer = ap_palloc(p, APR_FILE_BUFSIZE); + (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); } (*new_file)->blocking = old_file->blocking; /* this is the way dup() works */ - ap_register_cleanup((*new_file)->cntxt, (void *)(*new_file), ap_unix_file_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new_file)->cntxt, (void *)(*new_file), apr_unix_file_cleanup, + apr_null_cleanup); return APR_SUCCESS; } diff --git a/file_io/unix/fileio.h b/file_io/unix/fileio.h index c91bb453d25..2f202d90e0d 100644 --- a/file_io/unix/fileio.h +++ b/file_io/unix/fileio.h @@ -112,14 +112,14 @@ #define APR_FILE_BUFSIZE 4096 -struct ap_file_t { - ap_pool_t *cntxt; +struct apr_file_t { + apr_pool_t *cntxt; int filedes; char * fname; int oflags; int eof_hit; int pipe; - ap_interval_time_t timeout; + apr_interval_time_t timeout; int buffered; enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ @@ -131,21 +131,21 @@ struct ap_file_t { int direction; /* buffer being used for 0 = read, 1 = write */ unsigned long filePtr; /* position in file of handle */ #if APR_HAS_THREADS - struct ap_lock_t *thlock; + struct apr_lock_t *thlock; #endif }; -struct ap_dir_t { - ap_pool_t *cntxt; +struct apr_dir_t { + apr_pool_t *cntxt; char *dirname; DIR *dirstruct; struct dirent *entry; }; -ap_status_t ap_unix_file_cleanup(void *); +apr_status_t apr_unix_file_cleanup(void *); -mode_t ap_unix_perms2mode(ap_fileperms_t perms); -ap_fileperms_t ap_unix_mode2perms(mode_t mode); +mode_t apr_unix_perms2mode(apr_fileperms_t perms); +apr_fileperms_t apr_unix_mode2perms(mode_t mode); #endif /* ! FILE_IO_H */ diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 5085901ba14..07fc4281f42 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -80,21 +80,21 @@ static ap_filetype_e filetype_from_mode(int mode) return type; } -ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) +apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) { struct stat info; if (fstat(thefile->filedes, &info) == 0) { - finfo->protection = ap_unix_mode2perms(info.st_mode); + finfo->protection = apr_unix_mode2perms(info.st_mode); finfo->filetype = filetype_from_mode(info.st_mode); finfo->user = info.st_uid; finfo->group = info.st_gid; finfo->size = info.st_size; finfo->inode = info.st_ino; finfo->device = info.st_dev; - ap_ansi_time_to_ap_time(&finfo->atime, info.st_atime); - ap_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); - ap_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); + apr_ansi_time_to_ap_time(&finfo->atime, info.st_atime); + apr_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); + apr_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); return APR_SUCCESS; } else { @@ -102,30 +102,30 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) } } -ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms) +apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) { - mode_t mode = ap_unix_perms2mode(perms); + mode_t mode = apr_unix_perms2mode(perms); if (chmod(fname, mode) == -1) return errno; return APR_SUCCESS; } -ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) +apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) { struct stat info; if (stat(fname, &info) == 0) { - finfo->protection = ap_unix_mode2perms(info.st_mode); + finfo->protection = apr_unix_mode2perms(info.st_mode); finfo->filetype = filetype_from_mode(info.st_mode); finfo->user = info.st_uid; finfo->group = info.st_gid; finfo->size = info.st_size; finfo->inode = info.st_ino; finfo->device = info.st_dev; - ap_ansi_time_to_ap_time(&finfo->atime, info.st_atime); - ap_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); - ap_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); + apr_ansi_time_to_ap_time(&finfo->atime, info.st_atime); + apr_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); + apr_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); return APR_SUCCESS; } else { @@ -133,21 +133,21 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) } } -ap_status_t ap_lstat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) +apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) { struct stat info; if (lstat(fname, &info) == 0) { - finfo->protection = ap_unix_mode2perms(info.st_mode); + finfo->protection = apr_unix_mode2perms(info.st_mode); finfo->filetype = filetype_from_mode(info.st_mode); finfo->user = info.st_uid; finfo->group = info.st_gid; finfo->size = info.st_size; finfo->inode = info.st_ino; finfo->device = info.st_dev; - ap_ansi_time_to_ap_time(&finfo->atime, info.st_atime); - ap_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); - ap_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); + apr_ansi_time_to_ap_time(&finfo->atime, info.st_atime); + apr_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); + apr_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); return APR_SUCCESS; } else { diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index b88a7e5c71d..9e5e3158954 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -55,16 +55,16 @@ #include "apr_file_io.h" -ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes, - ap_size_t *bytes_read) +apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, + apr_size_t *bytes_read) { - ap_status_t status; - ap_size_t total_read = 0; + apr_status_t status; + apr_size_t total_read = 0; do { - ap_ssize_t amt = (ap_ssize_t)nbytes; + apr_ssize_t amt = (apr_ssize_t)nbytes; - status = ap_read(thefile, buf, &amt); + status = apr_read(thefile, buf, &amt); buf = (char *)buf + amt; nbytes -= amt; total_read += amt; @@ -76,16 +76,16 @@ ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes, return status; } -ap_status_t ap_full_write(ap_file_t *thefile, const void *buf, - ap_size_t nbytes, ap_size_t *bytes_written) +apr_status_t apr_full_write(apr_file_t *thefile, const void *buf, + apr_size_t nbytes, apr_size_t *bytes_written) { - ap_status_t status; - ap_size_t total_written = 0; + apr_status_t status; + apr_size_t total_written = 0; do { - ap_ssize_t amt = (ap_ssize_t)nbytes; + apr_ssize_t amt = (apr_ssize_t)nbytes; - status = ap_write(thefile, buf, &amt); + status = apr_write(thefile, buf, &amt); buf = (char *)buf + amt; nbytes -= amt; total_written += amt; diff --git a/file_io/unix/open.c b/file_io/unix/open.c index a7c88cada4b..199c2ae7592 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -56,9 +56,9 @@ #include "apr_strings.h" #include "apr_portable.h" -ap_status_t ap_unix_file_cleanup(void *thefile) +apr_status_t apr_unix_file_cleanup(void *thefile) { - ap_file_t *file = thefile; + apr_file_t *file = thefile; int rv; rv = close(file->filedes); @@ -67,7 +67,7 @@ ap_status_t ap_unix_file_cleanup(void *thefile) file->filedes = -1; #if APR_HAS_THREADS if (file->thlock) { - return ap_destroy_lock(file->thlock); + return apr_destroy_lock(file->thlock); } #endif return APR_SUCCESS; @@ -78,15 +78,15 @@ ap_status_t ap_unix_file_cleanup(void *thefile) } } -ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) { int oflags = 0; #if APR_HAS_THREADS - ap_status_t rv; + apr_status_t rv; #endif if ((*new) == NULL) { - (*new) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); + (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); } (*new)->cntxt = cont; @@ -106,15 +106,15 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil return APR_EACCES; } - (*new)->fname = ap_pstrdup(cont, fname); + (*new)->fname = apr_pstrdup(cont, fname); (*new)->blocking = BLK_ON; (*new)->buffered = (flag & APR_BUFFERED) > 0; if ((*new)->buffered) { - (*new)->buffer = ap_palloc(cont, APR_FILE_BUFSIZE); + (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); #if APR_HAS_THREADS - rv = ap_create_lock(&((*new)->thlock), APR_MUTEX, APR_INTRAPROCESS, + rv = apr_create_lock(&((*new)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, cont); if (rv) { return rv; @@ -146,7 +146,7 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil (*new)->filedes = open(fname, oflags, 0666); } else { - (*new)->filedes = open(fname, oflags, ap_unix_perms2mode(perm)); + (*new)->filedes = open(fname, oflags, apr_unix_perms2mode(perm)); } if ((*new)->filedes < 0) { @@ -166,27 +166,27 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil (*new)->bufpos = 0; (*new)->dataRead = 0; (*new)->direction = 0; - ap_register_cleanup((*new)->cntxt, (void *)(*new), ap_unix_file_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), apr_unix_file_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_close(ap_file_t *file) +apr_status_t apr_close(apr_file_t *file) { - ap_status_t flush_rv = APR_SUCCESS, rv; + apr_status_t flush_rv = APR_SUCCESS, rv; if (file->buffered) { - flush_rv = ap_flush(file); + flush_rv = apr_flush(file); } - if ((rv = ap_unix_file_cleanup(file)) == APR_SUCCESS) { - ap_kill_cleanup(file->cntxt, file, ap_unix_file_cleanup); + if ((rv = apr_unix_file_cleanup(file)) == APR_SUCCESS) { + apr_kill_cleanup(file->cntxt, file, apr_unix_file_cleanup); return APR_SUCCESS; } return rv ? rv : flush_rv; } -ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) +apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) { if (unlink(path) == 0) { return APR_SUCCESS; @@ -196,8 +196,8 @@ ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) } } -ap_status_t ap_rename_file(const char *from_path, const char *to_path, - ap_pool_t *p) +apr_status_t apr_rename_file(const char *from_path, const char *to_path, + apr_pool_t *p) { if (rename(from_path, to_path) != 0) { return errno; @@ -205,7 +205,7 @@ ap_status_t ap_rename_file(const char *from_path, const char *to_path, return APR_SUCCESS; } -ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) +apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) { if (file == NULL) { return APR_ENOFILE; @@ -215,13 +215,13 @@ ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) return APR_SUCCESS; } -ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, - ap_pool_t *cont) +apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, + apr_pool_t *cont) { int *dafile = thefile; if ((*file) == NULL) { - (*file) = ap_pcalloc(cont, sizeof(ap_file_t)); + (*file) = apr_pcalloc(cont, sizeof(apr_file_t)); (*file)->cntxt = cont; } (*file)->eof_hit = 0; @@ -235,7 +235,7 @@ ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, return APR_SUCCESS; } -ap_status_t ap_eof(ap_file_t *fptr) +apr_status_t apr_eof(apr_file_t *fptr) { if (fptr->eof_hit == 1) { return APR_EOF; @@ -243,7 +243,7 @@ ap_status_t ap_eof(ap_file_t *fptr) return APR_SUCCESS; } -ap_status_t ap_ferror(ap_file_t *fptr) +apr_status_t apr_ferror(apr_file_t *fptr) { /* This function should be removed ASAP. It is next on my list once * I am sure nobody is using it. @@ -251,12 +251,12 @@ ap_status_t ap_ferror(ap_file_t *fptr) return APR_SUCCESS; } -/* ap_open_stderr() could just call ap_put_os_file() with +/* apr_open_stderr() could just call apr_put_os_file() with * STDERR_FILENO for the descriptor... */ -ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont) +apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { - (*thefile) = ap_pcalloc(cont, sizeof(ap_file_t)); + (*thefile) = apr_pcalloc(cont, sizeof(apr_file_t)); if ((*thefile) == NULL) { return APR_ENOMEM; } diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 0c666d6745e..aa23bcc3eae 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -55,7 +55,7 @@ #include "fileio.h" #include "apr_strings.h" -static ap_status_t pipeblock(ap_file_t *thepipe) +static apr_status_t pipeblock(apr_file_t *thepipe) { #if !BEOS /* this code won't work on BeOS */ int fd_flags; @@ -91,7 +91,7 @@ static ap_status_t pipeblock(ap_file_t *thepipe) return APR_SUCCESS; } -static ap_status_t pipenonblock(ap_file_t *thepipe) +static apr_status_t pipenonblock(apr_file_t *thepipe) { #if !BEOS /* this code won't work on BeOS */ int fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); @@ -126,7 +126,7 @@ static ap_status_t pipenonblock(ap_file_t *thepipe) return APR_SUCCESS; } -ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) +apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; @@ -145,7 +145,7 @@ ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) return APR_EINVAL; } -ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) +apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) { int filedes[2]; @@ -153,11 +153,11 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) return errno; } - (*in) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); + (*in) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); (*in)->cntxt = cont; (*in)->filedes = filedes[0]; (*in)->pipe = 1; - (*in)->fname = ap_pstrdup(cont, "PIPE"); + (*in)->fname = apr_pstrdup(cont, "PIPE"); (*in)->buffered = 0; (*in)->blocking = BLK_ON; (*in)->timeout = -1; @@ -166,11 +166,11 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*in)->thlock = NULL; #endif - (*out) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); + (*out) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); (*out)->cntxt = cont; (*out)->filedes = filedes[1]; (*out)->pipe = 1; - (*out)->fname = ap_pstrdup(cont, "PIPE"); + (*out)->fname = apr_pstrdup(cont, "PIPE"); (*out)->buffered = 0; (*out)->blocking = BLK_ON; (*out)->timeout = -1; @@ -181,10 +181,10 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_create_namedpipe(const char *filename, - ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_create_namedpipe(const char *filename, + apr_fileperms_t perm, apr_pool_t *cont) { - mode_t mode = ap_unix_perms2mode(perm); + mode_t mode = apr_unix_perms2mode(perm); if (mkfifo(filename, mode) == -1) { return errno; diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index a3fb36ee047..6fdb136c27f 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -62,7 +62,7 @@ #endif #ifdef USE_WAIT_FOR_IO -static ap_status_t wait_for_io_or_timeout(ap_file_t *file, int for_read) +static apr_status_t wait_for_io_or_timeout(apr_file_t *file, int for_read) { struct timeval tv, *tvptr; fd_set fdset; @@ -101,10 +101,10 @@ static ap_status_t wait_for_io_or_timeout(ap_file_t *file, int for_read) /* problems: * 1) ungetchar not used for buffered files */ -ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) +apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *nbytes) { - ap_ssize_t rv; - ap_ssize_t bytes_read; + apr_ssize_t rv; + apr_ssize_t bytes_read; if (*nbytes <= 0) { *nbytes = 0; @@ -113,15 +113,15 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) if (thefile->buffered) { char *pos = (char *)buf; - ap_uint64_t blocksize; - ap_uint64_t size = *nbytes; + apr_uint64_t blocksize; + apr_uint64_t size = *nbytes; #if APR_HAS_THREADS - ap_lock(thefile->thlock); + apr_lock(thefile->thlock); #endif if (thefile->direction == 1) { - ap_flush(thefile); + apr_flush(thefile); thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -156,7 +156,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) rv = 0; } #if APR_HAS_THREADS - ap_unlock(thefile->thlock); + apr_unlock(thefile->thlock); #endif return rv; } @@ -181,7 +181,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && thefile->timeout != 0) { - ap_status_t arv = wait_for_io_or_timeout(thefile, 1); + apr_status_t arv = wait_for_io_or_timeout(thefile, 1); if (arv != APR_SUCCESS) { *nbytes = bytes_read; return arv; @@ -205,9 +205,9 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) } } -ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) +apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes) { - ap_size_t rv; + apr_size_t rv; if (thefile->buffered) { char *pos = (char *)buf; @@ -215,14 +215,14 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) int size = *nbytes; #if APR_HAS_THREADS - ap_lock(thefile->thlock); + apr_lock(thefile->thlock); #endif if ( thefile->direction == 0 ) { /* Position file pointer for writing at the offset we are * logically reading from */ - ap_int64_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + apr_int64_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; if (offset != thefile->filePtr) lseek(thefile->filedes, offset, SEEK_SET); thefile->bufpos = thefile->dataRead = 0; @@ -232,7 +232,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) /* write buffer is full*/ - ap_flush(thefile); + apr_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; @@ -243,19 +243,19 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) } #if APR_HAS_THREADS - ap_unlock(thefile->thlock); + apr_unlock(thefile->thlock); #endif return rv; } else { do { rv = write(thefile->filedes, buf, *nbytes); - } while (rv == (ap_size_t)-1 && errno == EINTR); + } while (rv == (apr_size_t)-1 && errno == EINTR); #ifdef USE_WAIT_FOR_IO - if (rv == (ap_size_t)-1 && + if (rv == (apr_size_t)-1 && (errno == EAGAIN || errno == EWOULDBLOCK) && thefile->timeout != 0) { - ap_status_t arv = wait_for_io_or_timeout(thefile, 0); + apr_status_t arv = wait_for_io_or_timeout(thefile, 0); if (arv != APR_SUCCESS) { *nbytes = 0; return arv; @@ -263,11 +263,11 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) else { do { rv = write(thefile->filedes, buf, *nbytes); - } while (rv == (ap_size_t)-1 && errno == EINTR); + } while (rv == (apr_size_t)-1 && errno == EINTR); } } #endif - if (rv == (ap_size_t)-1) { + if (rv == (apr_size_t)-1) { (*nbytes) = 0; return errno; } @@ -276,8 +276,8 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) } } -ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, - ap_size_t nvec, ap_ssize_t *nbytes) +apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, + apr_size_t nvec, apr_ssize_t *nbytes) { #ifdef HAVE_WRITEV int bytes; @@ -292,11 +292,11 @@ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, } #else *nbytes = vec[0].iov_len; - return ap_write(thefile, vec[0].iov_base, nbytes); + return apr_write(thefile, vec[0].iov_base, nbytes); #endif } -ap_status_t ap_putc(char ch, ap_file_t *thefile) +apr_status_t apr_putc(char ch, apr_file_t *thefile) { if (write(thefile->filedes, &ch, 1) != 1) { return errno; @@ -304,20 +304,20 @@ ap_status_t ap_putc(char ch, ap_file_t *thefile) return APR_SUCCESS; } -ap_status_t ap_ungetc(char ch, ap_file_t *thefile) +apr_status_t apr_ungetc(char ch, apr_file_t *thefile) { thefile->ungetchar = (unsigned char)ch; return APR_SUCCESS; } -ap_status_t ap_getc(char *ch, ap_file_t *thefile) +apr_status_t apr_getc(char *ch, apr_file_t *thefile) { - ap_ssize_t nbytes = 1; + apr_ssize_t nbytes = 1; - return ap_read(thefile, ch, &nbytes); + return apr_read(thefile, ch, &nbytes); } -ap_status_t ap_puts(const char *str, ap_file_t *thefile) +apr_status_t apr_puts(const char *str, apr_file_t *thefile) { ssize_t rv; int len; @@ -330,10 +330,10 @@ ap_status_t ap_puts(const char *str, ap_file_t *thefile) return APR_SUCCESS; } -ap_status_t ap_flush(ap_file_t *thefile) +apr_status_t apr_flush(apr_file_t *thefile) { if (thefile->buffered) { - ap_int64_t written = 0; + apr_int64_t written = 0; int rc = 0; if (thefile->direction == 1 && thefile->bufpos) { @@ -352,10 +352,10 @@ ap_status_t ap_flush(ap_file_t *thefile) return APR_SUCCESS; } -ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) +apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) { - ap_status_t rv = APR_SUCCESS; /* get rid of gcc warning */ - ap_ssize_t nbytes; + apr_status_t rv = APR_SUCCESS; /* get rid of gcc warning */ + apr_ssize_t nbytes; char *final = str + len - 1; if (len <= 1) { @@ -366,7 +366,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) while (str < final) { /* leave room for trailing '\0' */ nbytes = 1; - rv = ap_read(thefile, str, &nbytes); + rv = apr_read(thefile, str, &nbytes); if (rv != APR_SUCCESS) { break; } @@ -383,7 +383,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) return rv; } -APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) +APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) { int cc; va_list ap; @@ -395,8 +395,8 @@ APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) return 0; } va_start(ap, format); - len = ap_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = ap_puts(buf, fptr); + len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); + cc = apr_puts(buf, fptr); va_end(ap); free(buf); return (cc == APR_SUCCESS) ? len : -1; diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 1fcb0cbab90..3ab2aca93a7 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -54,13 +54,13 @@ #include "fileio.h" -static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) +static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) { long newbufpos; int rc; if (thefile->direction == 1) { - ap_flush(thefile); + apr_flush(thefile); thefile->bufpos = thefile->direction = thefile->dataRead = 0; } @@ -85,14 +85,14 @@ static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) } -ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) +apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { - ap_off_t rv; + apr_off_t rv; if (thefile->buffered) { int rc = EINVAL; - ap_finfo_t finfo; + apr_finfo_t finfo; switch (where) { case APR_SET: @@ -104,7 +104,7 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) break; case APR_END: - rc = ap_getfileinfo(&finfo, thefile); + rc = apr_getfileinfo(&finfo, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size - *offset); break; diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 7dd3704bd46..a9ce5d3fa02 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -72,47 +72,47 @@ #include #endif -ap_status_t dir_cleanup(void *thedir) +apr_status_t dir_cleanup(void *thedir) { - ap_dir_t *dir = thedir; + apr_dir_t *dir = thedir; if (!CloseHandle(dir->dirhand)) { return GetLastError(); } return APR_SUCCESS; } -ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cont) +apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) { char * temp; - (*new) = ap_pcalloc(cont, sizeof(ap_dir_t)); + (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); (*new)->cntxt = cont; (*new)->entry = NULL; temp = canonical_filename((*new)->cntxt, dirname); if (temp[strlen(temp)] == '/') { - (*new)->dirname = ap_pstrcat(cont, dirname, "*", NULL); + (*new)->dirname = apr_pstrcat(cont, dirname, "*", NULL); } else { - (*new)->dirname = ap_pstrcat(cont, dirname, "/*", NULL); + (*new)->dirname = apr_pstrcat(cont, dirname, "/*", NULL); } (*new)->dirhand = INVALID_HANDLE_VALUE; - ap_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_closedir(ap_dir_t *thedir) +apr_status_t apr_closedir(apr_dir_t *thedir) { if (!FindClose(thedir->dirhand)) { return GetLastError(); } - ap_kill_cleanup(thedir->cntxt, thedir, dir_cleanup); + apr_kill_cleanup(thedir->cntxt, thedir, dir_cleanup); return APR_SUCCESS; } -ap_status_t ap_readdir(ap_dir_t *thedir) +apr_status_t apr_readdir(apr_dir_t *thedir) { if (thedir->dirhand == INVALID_HANDLE_VALUE) { - thedir->entry = ap_pcalloc(thedir->cntxt, sizeof(WIN32_FIND_DATA)); + thedir->entry = apr_pcalloc(thedir->cntxt, sizeof(WIN32_FIND_DATA)); thedir->dirhand = FindFirstFile(thedir->dirname, thedir->entry); if (thedir->dirhand == INVALID_HANDLE_VALUE) { return GetLastError(); @@ -125,25 +125,25 @@ ap_status_t ap_readdir(ap_dir_t *thedir) return APR_SUCCESS; } -ap_status_t ap_rewinddir(ap_dir_t *thedir) +apr_status_t apr_rewinddir(apr_dir_t *thedir) { - ap_status_t stat; - ap_pool_t *cont = thedir->cntxt; - char *temp = ap_pstrdup(cont, thedir->dirname); + apr_status_t stat; + apr_pool_t *cont = thedir->cntxt; + char *temp = apr_pstrdup(cont, thedir->dirname); temp[strlen(temp) - 2] = '\0'; /*remove the \* at the end */ if (thedir->dirhand == INVALID_HANDLE_VALUE) { return APR_SUCCESS; } - if ((stat = ap_closedir(thedir)) == APR_SUCCESS) { - if ((stat = ap_opendir(&thedir, temp, cont)) == APR_SUCCESS) { - ap_readdir(thedir); + if ((stat = apr_closedir(thedir)) == APR_SUCCESS) { + if ((stat = apr_opendir(&thedir, temp, cont)) == APR_SUCCESS) { + apr_readdir(thedir); return APR_SUCCESS; } } return stat; } -ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { if (!CreateDirectory(path, NULL)) { return GetLastError(); @@ -151,7 +151,7 @@ ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont) +apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) { char *temp = canonical_filename(cont, path); if (!RemoveDirectory(temp)) { @@ -160,7 +160,7 @@ ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) +apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir) { if (thedir == NULL || thedir->entry == NULL) { return APR_ENODIR; @@ -170,7 +170,7 @@ ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) return APR_SUCCESS; } -ap_status_t ap_dir_entry_mtime(ap_time_t *time, ap_dir_t *thedir) +apr_status_t apr_dir_entry_mtime(apr_time_t *time, apr_dir_t *thedir) { if (thedir == NULL || thedir->entry == NULL) { return APR_ENODIR; @@ -179,7 +179,7 @@ ap_status_t ap_dir_entry_mtime(ap_time_t *time, ap_dir_t *thedir) return APR_SUCCESS; } -ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) +apr_status_t apr_dir_entry_ftype(ap_filetype_e *type, apr_dir_t *thedir) { switch(thedir->entry->dwFileAttributes) { case FILE_ATTRIBUTE_DIRECTORY: { @@ -197,13 +197,13 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) } } -ap_status_t ap_get_dir_filename(char **new, ap_dir_t *thedir) +apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) { - (*new) = ap_pstrdup(thedir->cntxt, thedir->entry->cFileName); + (*new) = apr_pstrdup(thedir->cntxt, thedir->entry->cFileName); return APR_SUCCESS; } -ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir) +apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) { if (dir == NULL) { return APR_ENODIR; @@ -212,13 +212,13 @@ ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir) return APR_SUCCESS; } -ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir, ap_pool_t *cont) +apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*dir) == NULL) { - (*dir) = (ap_dir_t *)ap_pcalloc(cont, sizeof(ap_dir_t)); + (*dir) = (apr_dir_t *)apr_pcalloc(cont, sizeof(apr_dir_t)); (*dir)->cntxt = cont; } (*dir)->dirhand = thedir; diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 9e85387000f..67eae006e4d 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -58,7 +58,7 @@ #include "apr_strings.h" #include -ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) +apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { BOOLEAN isStdHandle = FALSE; HANDLE hCurrentProcess = GetCurrentProcess(); @@ -68,8 +68,8 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) p = old_file->cntxt; } - (*new_file) = (ap_file_t *) ap_pcalloc(p, - sizeof(ap_file_t)); + (*new_file) = (apr_file_t *) apr_pcalloc(p, + sizeof(apr_file_t)); if ((*new_file) == NULL) { return APR_ENOMEM; } @@ -104,9 +104,9 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) } (*new_file)->cntxt = old_file->cntxt; - (*new_file)->fname = ap_pstrdup(old_file->cntxt, old_file->fname); - (*new_file)->demonfname = ap_pstrdup(old_file->cntxt, old_file->demonfname); - (*new_file)->lowerdemonfname = ap_pstrdup(old_file->cntxt, old_file->lowerdemonfname); + (*new_file)->fname = apr_pstrdup(old_file->cntxt, old_file->fname); + (*new_file)->demonfname = apr_pstrdup(old_file->cntxt, old_file->demonfname); + (*new_file)->lowerdemonfname = apr_pstrdup(old_file->cntxt, old_file->lowerdemonfname); (*new_file)->append = old_file->append; /* (*new_file)->protection = old_file->protection; (*new_file)->user = old_file->user; @@ -118,8 +118,8 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) (*new_file)->buffered = FALSE; if (!isStdHandle) { - ap_register_cleanup((*new_file)->cntxt, (void *)(*new_file), file_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new_file)->cntxt, (void *)(*new_file), file_cleanup, + apr_null_cleanup); } return APR_SUCCESS; diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 232c4d057fd..bfdda74213e 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -87,7 +87,7 @@ #define APR_FILE_BUFSIZE 4096 -/* quick run-down of fields in windows' ap_file_t structure that may have +/* quick run-down of fields in windows' apr_file_t structure that may have * obvious uses. * fname -- the filename as passed to the open call. * dwFileAttricutes -- Attributes used to open the file. @@ -100,12 +100,12 @@ * correctly when writing to a file with this flag set TRUE. */ -struct ap_file_t { - ap_pool_t *cntxt; +struct apr_file_t { + apr_pool_t *cntxt; HANDLE filehand; BOOLEAN pipe; // Is this a pipe of a file? OVERLAPPED *pOverlapped; - ap_interval_time_t timeout; + apr_interval_time_t timeout; /* File specific info */ char *fname; @@ -117,38 +117,38 @@ struct ap_file_t { int ungetchar; // Last char provided by an unget op. (-1 = no char) int append; off_t size; - ap_time_t atime; - ap_time_t mtime; - ap_time_t ctime; + apr_time_t atime; + apr_time_t mtime; + apr_time_t ctime; /* Stuff for buffered mode */ char *buffer; - ap_ssize_t bufpos; // Read/Write position in buffer - ap_ssize_t dataRead; // amount of valid data read into buffer + apr_ssize_t bufpos; // Read/Write position in buffer + apr_ssize_t dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write - ap_ssize_t filePtr; // position in file of handle - ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields + apr_ssize_t filePtr; // position in file of handle + apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields /* Pipe specific info */ }; -struct ap_dir_t { - ap_pool_t *cntxt; +struct apr_dir_t { + apr_pool_t *cntxt; char *dirname; HANDLE dirhand; WIN32_FIND_DATA *entry; }; -ap_status_t file_cleanup(void *); -/*mode_t get_fileperms(ap_fileperms_t); +apr_status_t file_cleanup(void *); +/*mode_t get_fileperms(apr_fileperms_t); */ -APR_EXPORT(char *) ap_os_systemcase_filename(struct ap_pool_t *pCont, +APR_EXPORT(char *) ap_os_systemcase_filename(struct apr_pool_t *pCont, const char *szFile); -char * canonical_filename(struct ap_pool_t *pCont, const char *szFile); +char * canonical_filename(struct apr_pool_t *pCont, const char *szFile); -ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, +apr_status_t ap_create_nt_pipe(apr_file_t **in, apr_file_t **out, BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, - ap_pool_t *p); + apr_pool_t *p); #endif /* ! FILE_IO_H */ diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index f66fbf936bb..05082aacdac 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -79,7 +79,7 @@ static ap_filetype_e filetype_from_mode(int mode) return type; } -BOOLEAN is_exe(const char* fname, ap_pool_t *cont) { +BOOLEAN is_exe(const char* fname, apr_pool_t *cont) { const char* exename; const char* ext; exename = strrchr(fname, '/'); @@ -101,7 +101,7 @@ BOOLEAN is_exe(const char* fname, ap_pool_t *cont) { return FALSE; } -ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) +apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) { BY_HANDLE_FILE_INFORMATION FileInformation; DWORD FileType; @@ -182,12 +182,12 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) return APR_SUCCESS; } -ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms) +apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) { return APR_ENOTIMPL; } -ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) +apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) { /* WIN32_FILE_ATTRIBUTE_DATA is an exact subset of the first * entries of WIN32_FIND_DATA @@ -195,7 +195,7 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) WIN32_FIND_DATA FileInformation; HANDLE hFind; ap_oslevel_e os_level; - ap_status_t rv = APR_SUCCESS; + apr_status_t rv = APR_SUCCESS; memset(finfo,'\0', sizeof(*finfo)); diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 3944ffcd00b..689453a0b0c 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -64,9 +64,9 @@ #include #include "misc.h" -ap_status_t file_cleanup(void *thefile) +apr_status_t file_cleanup(void *thefile) { - ap_file_t *file = thefile; + apr_file_t *file = thefile; CloseHandle(file->filehand); file->filehand = INVALID_HANDLE_VALUE; if (file->pOverlapped) { @@ -75,18 +75,18 @@ ap_status_t file_cleanup(void *thefile) return APR_SUCCESS; } -ap_status_t ap_open(ap_file_t **new, const char *fname, - ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_open(apr_file_t **new, const char *fname, + apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) { DWORD oflags = 0; DWORD createflags = 0; DWORD attributes = 0; DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE; ap_oslevel_e level; - ap_status_t rv; + apr_status_t rv; if ((*new) == NULL) { - (*new) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); + (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); } (*new)->cntxt = cont; @@ -105,14 +105,14 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, (*new)->buffered = (flag & APR_BUFFERED) > 0; if ((*new)->buffered) { - (*new)->buffer = ap_palloc(cont, APR_FILE_BUFSIZE); - rv = ap_create_lock(&(*new)->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cont); + (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); + rv = apr_create_lock(&(*new)->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cont); if (rv) return rv; } - (*new)->fname = ap_pstrdup(cont, fname); + (*new)->fname = apr_pstrdup(cont, fname); (*new)->demonfname = canonical_filename((*new)->cntxt, fname); (*new)->lowerdemonfname = strlwr((*new)->demonfname); @@ -178,26 +178,26 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, (*new)->direction = 0; (*new)->filePtr = 0; - ap_register_cleanup((*new)->cntxt, (void *)(*new), file_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), file_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_close(ap_file_t *file) +apr_status_t apr_close(apr_file_t *file) { - ap_status_t stat; + apr_status_t stat; if ((stat = file_cleanup(file)) == APR_SUCCESS) { - ap_kill_cleanup(file->cntxt, file, file_cleanup); + apr_kill_cleanup(file->cntxt, file, file_cleanup); if (file->buffered) - ap_destroy_lock(file->mutex); + apr_destroy_lock(file->mutex); return APR_SUCCESS; } return stat; } -ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) +apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) { char *temp = canonical_filename(cont, path); @@ -209,8 +209,8 @@ ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) } } -ap_status_t ap_rename_file(const char *from_path, const char *to_path, - ap_pool_t *p) +apr_status_t apr_rename_file(const char *from_path, const char *to_path, + apr_pool_t *p) { const char *from_canon = canonical_filename(p, from_path); const char *to_canon = canonical_filename(p, to_path); @@ -235,7 +235,7 @@ ap_status_t ap_rename_file(const char *from_path, const char *to_path, return err; } -ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) +apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) { if (file == NULL) { return APR_ENOFILE; @@ -244,21 +244,21 @@ ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) return APR_SUCCESS; } -ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, - ap_pool_t *cont) +apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, + apr_pool_t *cont) { if ((*file) == NULL) { if (cont == NULL) { return APR_ENOPOOL; } - (*file) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); + (*file) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); (*file)->cntxt = cont; } (*file)->filehand = *thefile; return APR_SUCCESS; } -ap_status_t ap_eof(ap_file_t *fptr) +apr_status_t apr_eof(apr_file_t *fptr) { if (fptr->eof_hit == 1) { return APR_EOF; @@ -266,9 +266,9 @@ ap_status_t ap_eof(ap_file_t *fptr) return APR_SUCCESS; } -ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont) +apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { - (*thefile) = ap_pcalloc(cont, sizeof(ap_file_t)); + (*thefile) = apr_pcalloc(cont, sizeof(apr_file_t)); if ((*thefile) == NULL) { return APR_ENOMEM; } diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 85eb51f027d..732ba577f95 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -63,13 +63,13 @@ #include #include "misc.h" -ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) +apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) { thepipe->timeout = timeout; return APR_SUCCESS; } -ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *p) +apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p) { SECURITY_ATTRIBUTES sa; @@ -77,9 +77,9 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *p) sa.bInheritHandle = TRUE; sa.lpSecurityDescriptor = NULL; - (*in) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t)); + (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*in)->cntxt = p; - (*in)->fname = ap_pstrdup(p, "PIPE"); + (*in)->fname = apr_pstrdup(p, "PIPE"); (*in)->pipe = 1; (*in)->timeout = -1; (*in)->ungetchar = -1; @@ -89,9 +89,9 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *p) (*in)->dataRead = 0; (*in)->direction = 0; - (*out) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t)); + (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*out)->cntxt = p; - (*out)->fname = ap_pstrdup(p, "PIPE"); + (*out)->fname = apr_pstrdup(p, "PIPE"); (*out)->pipe = 1; (*out)->timeout = -1; (*out)->ungetchar = -1; @@ -109,7 +109,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *p) } /* ap_create_nt_pipe() - * An internal (for now) APR function created for use by ap_create_process() + * An internal (for now) APR function created for use by apr_create_process() * when setting up pipes to communicate with the child process. * ap_create_nt_pipe() allows setting the blocking mode of each end of * the pipe when the pipe is created (rather than after the pipe is created). @@ -118,7 +118,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *p) * * In general, we don't want to enable child side pipe handles for async i/o. * This prevents us from enabling both ends of the pipe for async i/o in - * ap_create_pipe. + * apr_create_pipe. * * Why not use NamedPipes on NT which support setting pipe state to * non-blocking? On NT, even though you can set a pipe non-blocking, @@ -128,9 +128,9 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *p) * * wgs */ -ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, +apr_status_t ap_create_nt_pipe(apr_file_t **in, apr_file_t **out, BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, - ap_pool_t *p) + apr_pool_t *p) { ap_oslevel_e level; SECURITY_ATTRIBUTES sa; @@ -143,9 +143,9 @@ ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, sa.bInheritHandle = TRUE; sa.lpSecurityDescriptor = NULL; - (*in) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t)); + (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*in)->cntxt = p; - (*in)->fname = ap_pstrdup(p, "PIPE"); + (*in)->fname = apr_pstrdup(p, "PIPE"); (*in)->pipe = 1; (*in)->timeout = -1; (*in)->ungetchar = -1; @@ -156,9 +156,9 @@ ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, (*in)->direction = 0; (*in)->pOverlapped = NULL; - (*out) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t)); + (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*out)->cntxt = p; - (*out)->fname = ap_pstrdup(p, "PIPE"); + (*out)->fname = apr_pstrdup(p, "PIPE"); (*out)->pipe = 1; (*out)->timeout = -1; (*out)->ungetchar = -1; @@ -174,7 +174,7 @@ ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, dwOpenMode = PIPE_ACCESS_INBOUND; if (bAsyncRead) { dwOpenMode |= FILE_FLAG_OVERLAPPED; - (*in)->pOverlapped = (OVERLAPPED*) ap_pcalloc(p, sizeof(OVERLAPPED)); + (*in)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED)); (*in)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); /* register a cleanup for the event handle... */ } @@ -196,7 +196,7 @@ ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, dwOpenMode = FILE_ATTRIBUTE_NORMAL; if (bAsyncWrite) { dwOpenMode |= FILE_FLAG_OVERLAPPED; - (*out)->pOverlapped = (OVERLAPPED*) ap_pcalloc(p, sizeof(OVERLAPPED)); + (*out)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED)); (*out)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); } diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 6fe52f3883a..e9bd3340568 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -64,9 +64,9 @@ * read_with_timeout() * Uses async i/o to emulate unix non-blocking i/o with timeouts. */ -static ap_status_t read_with_timeout(ap_file_t *file, void *buf, ap_ssize_t len, ap_ssize_t *nbytes) +static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_ssize_t len, apr_ssize_t *nbytes) { - ap_status_t rv; + apr_status_t rv; *nbytes = 0; /* Handle the zero timeout non-blocking case */ @@ -143,9 +143,9 @@ static ap_status_t read_with_timeout(ap_file_t *file, void *buf, ap_ssize_t len, return rv; } -ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *len) +apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *len) { - ap_ssize_t rv; + apr_ssize_t rv; DWORD bytes_read = 0; if (*len <= 0) { @@ -167,13 +167,13 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *len) } if (thefile->buffered) { char *pos = (char *)buf; - ap_ssize_t blocksize; - ap_ssize_t size = *len; + apr_ssize_t blocksize; + apr_ssize_t size = *len; - ap_lock(thefile->mutex); + apr_lock(thefile->mutex); if (thefile->direction == 1) { - ap_flush(thefile); + apr_flush(thefile); thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -207,10 +207,10 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *len) if (*len) { rv = 0; } - ap_unlock(thefile->mutex); + apr_unlock(thefile->mutex); } else { /* Unbuffered i/o */ - ap_ssize_t nbytes; + apr_ssize_t nbytes; rv = read_with_timeout(thefile, buf, *len, &nbytes); *len = nbytes; } @@ -218,9 +218,9 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *len) return rv; } -ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) +apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes) { - ap_status_t rv; + apr_status_t rv; DWORD bwrote; if (thefile->buffered) { @@ -228,11 +228,11 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) int blocksize; int size = *nbytes; - ap_lock(thefile->mutex); + apr_lock(thefile->mutex); if (thefile->direction == 0) { // Position file pointer for writing at the offset we are logically reading from - ap_ssize_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + apr_ssize_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; if (offset != thefile->filePtr) SetFilePointer(thefile->filehand, offset, NULL, FILE_BEGIN); thefile->bufpos = thefile->dataRead = 0; @@ -241,7 +241,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) while (rv == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full - rv = ap_flush(thefile); + rv = apr_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); @@ -250,7 +250,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) size -= blocksize; } - ap_unlock(thefile->mutex); + apr_unlock(thefile->mutex); return rv; } else { if (!thefile->pipe && thefile->append) { @@ -271,10 +271,10 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) /* * Too bad WriteFileGather() is not supported on 95&98 (or NT prior to SP2) */ -ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nvec, - ap_ssize_t *nbytes) +apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, + apr_ssize_t *nbytes) { - ap_status_t rv = APR_SUCCESS; + apr_status_t rv = APR_SUCCESS; int i; DWORD bwrote = 0; char *buf; @@ -283,7 +283,7 @@ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nve for (i = 0; i < nvec; i++) { buf = vec[i].iov_base; bwrote = vec[i].iov_len; - rv = ap_write(thefile, buf, &bwrote); + rv = apr_write(thefile, buf, &bwrote); *nbytes += bwrote; if (rv != APR_SUCCESS) { break; @@ -292,26 +292,26 @@ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nve return rv; } -ap_status_t ap_putc(char ch, ap_file_t *thefile) +apr_status_t apr_putc(char ch, apr_file_t *thefile) { DWORD len = 1; - return ap_write(thefile, &ch, &len); + return apr_write(thefile, &ch, &len); } -ap_status_t ap_ungetc(char ch, ap_file_t *thefile) +apr_status_t apr_ungetc(char ch, apr_file_t *thefile) { thefile->ungetchar = (unsigned char) ch; return APR_SUCCESS; } -ap_status_t ap_getc(char *ch, ap_file_t *thefile) +apr_status_t apr_getc(char *ch, apr_file_t *thefile) { - ap_status_t rc; + apr_status_t rc; int bread; bread = 1; - rc = ap_read(thefile, ch, &bread); + rc = apr_read(thefile, ch, &bread); if (rc) { return rc; @@ -324,22 +324,22 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) return APR_SUCCESS; } -ap_status_t ap_puts(const char *str, ap_file_t *thefile) +apr_status_t apr_puts(const char *str, apr_file_t *thefile) { DWORD len = strlen(str); - return ap_write(thefile, str, &len); + return apr_write(thefile, str, &len); } -ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) +apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) { - ap_ssize_t readlen; - ap_status_t rv = APR_SUCCESS; + apr_ssize_t readlen; + apr_status_t rv = APR_SUCCESS; int i; for (i = 0; i < len-1; i++) { readlen = 1; - rv = ap_read(thefile, str+i, &readlen); + rv = apr_read(thefile, str+i, &readlen); if (readlen != 1) { rv = APR_EOF; @@ -357,11 +357,11 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) return rv; } -ap_status_t ap_flush(ap_file_t *thefile) +apr_status_t apr_flush(apr_file_t *thefile) { if (thefile->buffered) { DWORD written = 0; - ap_status_t rc = 0; + apr_status_t rc = 0; if (thefile->direction == 1 && thefile->bufpos) { rc = WriteFile(thefile->filehand, thefile->buffer, thefile->bufpos, &written, NULL ) ? 0 : GetLastError(); @@ -378,7 +378,7 @@ ap_status_t ap_flush(ap_file_t *thefile) } } -static int printf_flush(ap_vformatter_buff_t *vbuff) +static int printf_flush(apr_vformatter_buff_t *vbuff) { /* I would love to print this stuff out to the file, but I will * get that working later. :) For now, just return. @@ -386,7 +386,7 @@ static int printf_flush(ap_vformatter_buff_t *vbuff) return -1; } -APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) +APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) { int cc; va_list ap; @@ -398,8 +398,8 @@ APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) return 0; } va_start(ap, format); - len = ap_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = ap_puts(buf, fptr); + len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); + cc = apr_puts(buf, fptr); va_end(ap); free(buf); return (cc == APR_SUCCESS) ? len : -1; diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 9ab9404e42c..b2aaa5cbf94 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -57,13 +57,13 @@ #include #include -static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) +static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) { long newbufpos; DWORD rc; if (thefile->direction == 1) { - ap_flush(thefile); + apr_flush(thefile); thefile->bufpos = thefile->direction = thefile->dataRead = 0; } @@ -86,14 +86,14 @@ static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) -ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) +apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { DWORD howmove; DWORD rv; if (thefile->buffered) { int rc = APR_EINVAL; - ap_finfo_t finfo; + apr_finfo_t finfo; switch (where) { case APR_SET: @@ -105,7 +105,7 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) break; case APR_END: - rc = ap_getfileinfo(&finfo, thefile); + rc = apr_getfileinfo(&finfo, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size - *offset); break; diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index a357a90dc5e..8af33873e93 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -75,8 +75,8 @@ #define min(x,y) ((x) <= (y) ? (x) : (y)) #endif -struct ap_xlate_t { - ap_pool_t *pool; +struct apr_xlate_t { + apr_pool_t *pool; char *frompage; char *topage; char *sbcs_table; @@ -156,10 +156,10 @@ static const char *handle_special_names(const char *page) } } -static ap_status_t ap_xlate_cleanup(void *convset) +static apr_status_t ap_xlate_cleanup(void *convset) { #ifdef HAVE_ICONV - ap_xlate_t *old = convset; + apr_xlate_t *old = convset; if (old->ich != (iconv_t)-1) { if (iconv_close(old->ich)) { @@ -171,7 +171,7 @@ static ap_status_t ap_xlate_cleanup(void *convset) } #ifdef HAVE_ICONV -static void check_sbcs(ap_xlate_t *convset) +static void check_sbcs(apr_xlate_t *convset) { char inbuf[256], outbuf[256]; char *inbufptr = inbuf, *outbufptr = outbuf; @@ -193,7 +193,7 @@ static void check_sbcs(ap_xlate_t *convset) * close the iconv descriptor */ - convset->sbcs_table = ap_palloc(convset->pool, sizeof(outbuf)); + convset->sbcs_table = apr_palloc(convset->pool, sizeof(outbuf)); memcpy(convset->sbcs_table, outbuf, sizeof(outbuf)); iconv_close(convset->ich); convset->ich = (iconv_t)-1; @@ -203,11 +203,11 @@ static void check_sbcs(ap_xlate_t *convset) } #endif /* HAVE_ICONV */ -ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, - const char *frompage, ap_pool_t *pool) +apr_status_t ap_xlate_open(apr_xlate_t **convset, const char *topage, + const char *frompage, apr_pool_t *pool) { - ap_status_t status; - ap_xlate_t *new; + apr_status_t status; + apr_xlate_t *new; int found = 0; *convset = NULL; @@ -215,14 +215,14 @@ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, topage = handle_special_names(topage); frompage = handle_special_names(frompage); - new = (ap_xlate_t *)ap_pcalloc(pool, sizeof(ap_xlate_t)); + new = (apr_xlate_t *)apr_pcalloc(pool, sizeof(apr_xlate_t)); if (!new) { return APR_ENOMEM; } new->pool = pool; - new->topage = ap_pstrdup(pool, topage); - new->frompage = ap_pstrdup(pool, frompage); + new->topage = apr_pstrdup(pool, topage); + new->frompage = apr_pstrdup(pool, frompage); if (!new->topage || !new->frompage) { return APR_ENOMEM; } @@ -248,8 +248,8 @@ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, if (found) { *convset = new; - ap_register_cleanup(pool, (void *)new, ap_xlate_cleanup, - ap_null_cleanup); + apr_register_cleanup(pool, (void *)new, ap_xlate_cleanup, + apr_null_cleanup); status = APR_SUCCESS; } else { @@ -260,17 +260,17 @@ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, return status; } -ap_status_t ap_xlate_get_sb(ap_xlate_t *convset, int *onoff) +apr_status_t ap_xlate_get_sb(apr_xlate_t *convset, int *onoff) { *onoff = convset->sbcs_table != NULL; return APR_SUCCESS; } -ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, - ap_size_t *inbytes_left, char *outbuf, - ap_size_t *outbytes_left) +apr_status_t ap_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, + apr_size_t *inbytes_left, char *outbuf, + apr_size_t *outbytes_left) { - ap_status_t status = APR_SUCCESS; + apr_status_t status = APR_SUCCESS; #ifdef HAVE_ICONV size_t translated; @@ -329,7 +329,7 @@ ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, return status; } -ap_int32_t ap_xlate_conv_byte(ap_xlate_t *convset, unsigned char inchar) +apr_int32_t ap_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar) { if (convset->sbcs_table) { return convset->sbcs_table[inchar]; @@ -339,12 +339,12 @@ ap_int32_t ap_xlate_conv_byte(ap_xlate_t *convset, unsigned char inchar) } } -ap_status_t ap_xlate_close(ap_xlate_t *convset) +apr_status_t ap_xlate_close(apr_xlate_t *convset) { - ap_status_t status; + apr_status_t status; if ((status = ap_xlate_cleanup(convset)) == APR_SUCCESS) { - ap_kill_cleanup(convset->pool, convset, ap_xlate_cleanup); + apr_kill_cleanup(convset->pool, convset, ap_xlate_cleanup); } return status; diff --git a/include/apr_dso.h b/include/apr_dso.h index bcd333b968f..07cf2c71676 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -66,8 +66,8 @@ extern "C" { #endif -typedef struct ap_dso_handle_t ap_dso_handle_t; -typedef void * ap_dso_handle_sym_t; +typedef struct apr_dso_handle_t apr_dso_handle_t; +typedef void * apr_dso_handle_sym_t; /** * Load a DSO library. @@ -75,14 +75,14 @@ typedef void * ap_dso_handle_sym_t; * @param path Path to the DSO library * @param ctx Pool to use. */ -ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, - ap_pool_t *ctx); +apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, + apr_pool_t *ctx); /** * Close a DSO library. * @param handle handle to close. */ -ap_status_t ap_dso_unload(ap_dso_handle_t *handle); +apr_status_t apr_dso_unload(apr_dso_handle_t *handle); /** * Load a symbol from a DSO handle. @@ -90,7 +90,7 @@ ap_status_t ap_dso_unload(ap_dso_handle_t *handle); * @param handle handle to load from. * @param symname Name of the symbol to load. */ -ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, +apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, const char *symname); /** @@ -99,7 +99,7 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, * @param buf handle to load from. * @param bufsize Name of the symbol to load. */ -const char *ap_dso_error(ap_dso_handle_t *dso, char *buf, ap_size_t bufsize); +const char *apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize); #ifdef __cplusplus } diff --git a/include/apr_errno.h b/include/apr_errno.h index e5512c6253f..e777adc6a25 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -66,7 +66,7 @@ extern "C" { * @package Error Codes */ -typedef int ap_status_t; +typedef int apr_status_t; /** * Convert an APR error to a canonical error @@ -74,7 +74,7 @@ typedef int ap_status_t; * @return The canonical error value * @tip see apr/APRDesgin for an explanation of why this is necessary. */ -int ap_canonical_error(ap_status_t err); +int apr_canonical_error(apr_status_t err); /* @@ -113,7 +113,7 @@ int ap_canonical_error(ap_status_t err); * APR_ENOTHDKEY APR was not given a thread key structure * APR_ENOSHMAVAIL There is no more shared memory available * APR_EDSOOPEN APR was unable to open the dso object. For more - * information call ap_dso_error(). + * information call apr_dso_error(). * * *
    diff --git a/include/apr_file_io.h b/include/apr_file_io.h
    index 77a5c6bf4a4..32ae5eb74fb 100644
    --- a/include/apr_file_io.h
    +++ b/include/apr_file_io.h
    @@ -73,7 +73,7 @@ extern "C" {
     typedef enum {APR_NOFILE, APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, APR_LNK, 
                   APR_SOCK} ap_filetype_e; 
     
    -/* Flags for ap_open */
    +/* Flags for apr_open */
     #define APR_READ       1           /* Open the file for reading */
     #define APR_WRITE      2           /* Open the file for writing */
     #define APR_CREATE     4           /* Create the file if not there */
    @@ -85,7 +85,7 @@ typedef enum {APR_NOFILE, APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, APR_LNK,
     #define APR_BUFFERED   128         /* Open the file for buffered I/O */
     #define APR_DELONCLOSE 256         /* Delete the file after close */
     
    -/* flags for ap_seek */
    +/* flags for apr_seek */
     #define APR_SET SEEK_SET
     #define APR_CUR SEEK_CUR
     #define APR_END SEEK_END
    @@ -106,28 +106,28 @@ typedef enum {APR_NOFILE, APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, APR_LNK,
     #define APR_OS_DEFAULT 0xFFF
     
     /* should be same as whence type in lseek, POSIX defines this as int */
    -typedef ap_int32_t       ap_seek_where_t;
    -
    -typedef struct ap_file_t         ap_file_t;
    -typedef struct ap_finfo_t        ap_finfo_t;
    -typedef struct ap_dir_t          ap_dir_t;
    -typedef ap_int32_t               ap_fileperms_t;
    -typedef uid_t                    ap_uid_t;
    -typedef gid_t                    ap_gid_t;
    -typedef ino_t                    ap_ino_t;
    -typedef dev_t                    ap_dev_t;
    -
    -struct ap_finfo_t {
    -    ap_fileperms_t protection;
    +typedef apr_int32_t       apr_seek_where_t;
    +
    +typedef struct apr_file_t         apr_file_t;
    +typedef struct apr_finfo_t        apr_finfo_t;
    +typedef struct apr_dir_t          apr_dir_t;
    +typedef apr_int32_t               apr_fileperms_t;
    +typedef uid_t                    apr_uid_t;
    +typedef gid_t                    apr_gid_t;
    +typedef ino_t                    apr_ino_t;
    +typedef dev_t                    apr_dev_t;
    +
    +struct apr_finfo_t {
    +    apr_fileperms_t protection;
         ap_filetype_e filetype;
    -    ap_uid_t user;
    -    ap_gid_t group;
    -    ap_ino_t inode;
    -    ap_dev_t device;
    -    ap_off_t size;
    -    ap_time_t atime;
    -    ap_time_t mtime;
    -    ap_time_t ctime;
    +    apr_uid_t user;
    +    apr_gid_t group;
    +    apr_ino_t inode;
    +    apr_dev_t device;
    +    apr_off_t size;
    +    apr_time_t atime;
    +    apr_time_t mtime;
    +    apr_time_t ctime;
     };
     
     /*   Function definitions */
    @@ -155,14 +155,14 @@ struct ap_finfo_t {
      *      default permissions will be used.  *arg1 must point to a valid file_t, 
      *      or NULL (in which case it will be allocated)
      */
    -ap_status_t ap_open(ap_file_t **new_file, const char *fname, ap_int32_t flag, 
    -                    ap_fileperms_t perm, ap_pool_t *cont);
    +apr_status_t apr_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, 
    +                    apr_fileperms_t perm, apr_pool_t *cont);
     
     /**
      * Close the specified file.
      * @param file The file descriptor to close.
      */
    -ap_status_t ap_close(ap_file_t *file);
    +apr_status_t apr_close(apr_file_t *file);
     
     /**
      * delete the specified file.
    @@ -170,7 +170,7 @@ ap_status_t ap_close(ap_file_t *file);
      * @param cont The pool to use.
      * @tip If the file is open, it won't be removed until all instances are closed.
      */
    -ap_status_t ap_remove_file(const char *path, ap_pool_t *cont);
    +apr_status_t apr_remove_file(const char *path, apr_pool_t *cont);
     
     /**
      * rename the specified file.
    @@ -180,36 +180,36 @@ ap_status_t ap_remove_file(const char *path, ap_pool_t *cont);
      * @tip If a file exists at the new location, then it will be overwritten.  
      *      Moving files or directories across devices may not be possible.
      */
    -ap_status_t ap_rename_file(const char *from_path, const char *to_path,
    -                           ap_pool_t *pool);
    +apr_status_t apr_rename_file(const char *from_path, const char *to_path,
    +                           apr_pool_t *pool);
     
     /**
      * Are we at the end of the file
      * @param fptr The apr file we are testing.
      * @tip Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise.
      */
    -ap_status_t ap_eof(ap_file_t *fptr);
    +apr_status_t apr_eof(apr_file_t *fptr);
     
     /**
      * Is there an error on the stream?
      * @param fptr The apr file we are testing.
      * @tip Returns -1 if the error indicator is set, APR_SUCCESS otherwise.
      */
    -ap_status_t ap_ferror(ap_file_t *fptr);
    +apr_status_t apr_ferror(apr_file_t *fptr);
     
     /**
      * open standard error as an apr file pointer.
      * @param thefile The apr file to use as stderr.
      * @param cont The pool to allocate the file out of.
      */
    -ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont);
    +apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont);
     
     /**
      * Read data from the specified file.
      * @param thefile The file descriptor to read from.
      * @param buf The buffer to store the data to.
      * @param nbytes On entry, the number of bytes to read; on exit, the number of bytes read.
    - * @tip ap_read will read up to the specified number of bytes, but never 
    + * @tip apr_read will read up to the specified number of bytes, but never 
      *      more.  If there isn't enough data to fill that number of bytes, all 
      *      of the available data is read.  The third argument is modified to 
      *      reflect the number of bytes read.  If a char was put back into the 
    @@ -220,14 +220,14 @@ ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont);
      *
      *      APR_EINTR is never returned.
      */
    -ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes);
    +apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *nbytes);
     
     /**
      * Write data to the specified file.
      * @param thefile The file descriptor to write to.
      * @param buf The buffer which contains the data.
      * @param nbytes On entry, the number of bytes to write; on exit, the number of bytes written.
    - * @tip ap_write will write up to the specified number of bytes, but never 
    + * @tip apr_write will write up to the specified number of bytes, but never 
      *      more.  If the OS cannot write that many bytes, it will write as many 
      *      as it can.  The third argument is modified to reflect the * number 
      *      of bytes written. 
    @@ -236,7 +236,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes);
      *
      *      APR_EINTR is never returned.
      */
    -ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes);
    +apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes);
     
     /**
      * Write data from iovec array to the specified file.
    @@ -249,12 +249,12 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes);
      * @tip It is possible for both bytes to be written and an error to be returned.
      *      APR_EINTR is never returned.
      *
    - *      ap_writev is available even if the underlying operating system 
    + *      apr_writev is available even if the underlying operating system 
      *
      *      doesn't provide writev().
      */
    -ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, 
    -                      ap_size_t nvec, ap_ssize_t *nbytes);
    +apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, 
    +                      apr_size_t nvec, apr_ssize_t *nbytes);
     
     /**
      * Read data from the specified file.
    @@ -262,7 +262,7 @@ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec,
      * @param buf The buffer to store the data to.
      * @param nbytes The number of bytes to read.
      * @param bytes_read If non-NULL, this will contain the number of bytes read.
    - * @tip ap_read will read up to the specified number of bytes, but never 
    + * @tip apr_read will read up to the specified number of bytes, but never 
      *      more.  If there isn't enough data to fill that number of bytes, 
      *      then the process/thread will block until it is available or EOF 
      *      is reached.  If a char was put back into the stream via ungetc, 
    @@ -273,8 +273,8 @@ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec,
      *
      *      APR_EINTR is never returned.
      */
    -ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes,
    -                         ap_size_t *bytes_read);
    +apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes,
    +                         apr_size_t *bytes_read);
     
     /**
      * Write data to the specified file.
    @@ -282,7 +282,7 @@ ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes,
      * @param buf The buffer which contains the data.
      * @param nbytes The number of bytes to write.
      * @param bytes_written If non-NULL, this will contain the number of bytes written.
    - * @tip ap_write will write up to the specified number of bytes, but never 
    + * @tip apr_write will write up to the specified number of bytes, but never 
      *      more.  If the OS cannot write that many bytes, the process/thread 
      *      will block until they can be written. Exceptional error such as 
      *      "out of space" or "pipe closed" will terminate with an error.
    @@ -291,29 +291,29 @@ ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes,
      *
      *      APR_EINTR is never returned.
      */
    -ap_status_t ap_full_write(ap_file_t *thefile, const void *buf,
    -                          ap_size_t nbytes, ap_size_t *bytes_written);
    +apr_status_t apr_full_write(apr_file_t *thefile, const void *buf,
    +                          apr_size_t nbytes, apr_size_t *bytes_written);
     
     /**
      * put a character into the specified file.
      * @param ch The character to write.
      * @param thefile The file descriptor to write to
      */
    -ap_status_t ap_putc(char ch, ap_file_t *thefile);
    +apr_status_t apr_putc(char ch, apr_file_t *thefile);
     
     /**
      * get a character from the specified file.
      * @param ch The character to write.
      * @param thefile The file descriptor to write to
      */
    -ap_status_t ap_getc(char *ch, ap_file_t *thefile);
    +apr_status_t apr_getc(char *ch, apr_file_t *thefile);
     
     /**
      * put a character back onto a specified stream.
      * @param ch The character to write.
      * @param thefile The file descriptor to write to
      */
    -ap_status_t ap_ungetc(char ch, ap_file_t *thefile);
    +apr_status_t apr_ungetc(char ch, apr_file_t *thefile);
     
     /**
      * Get a string from a specified file.
    @@ -321,36 +321,36 @@ ap_status_t ap_ungetc(char ch, ap_file_t *thefile);
      * @param len The length of the string
      * @param thefile The file descriptor to read from
      */
    -ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile);
    +apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile);
     
     /**
      * Put the string into a specified file.
      * @param str The string to write. 
      * @param thefile The file descriptor to write to
      */
    -ap_status_t ap_puts(const char *str, ap_file_t *thefile);
    +apr_status_t apr_puts(const char *str, apr_file_t *thefile);
     
     /**
      * Flush the file's buffer.
      * @param thefile The file descriptor to flush
      */
    -ap_status_t ap_flush(ap_file_t *thefile);
    +apr_status_t apr_flush(apr_file_t *thefile);
     
     /**
      * duplicate the specified file descriptor.
      * @param new_file The structure to duplicate into. 
      * @param old_file The file to duplicate.
      * @param p The pool to use for the new file.
    - * @tip *arg1 must point to a valid ap_file_t, or point to NULL
    + * @tip *arg1 must point to a valid apr_file_t, or point to NULL
      */         
    -ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p);
    +apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p);
     
     /**
      * get the specified file's stats.
      * @param finfo Where to store the information about the file.
      * @param thefile The file to get information about.
      */ 
    -ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile);
    +apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile);
     
     /**
      * set the specified file's permission bits.
    @@ -362,7 +362,7 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile);
      *
      *      Platforms which do not implement this feature will return APR_ENOTIMPL.
      */
    -ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms);
    +apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms);
     
     /**
      * get the specified file's stats.  The file is specified by filename, 
    @@ -371,7 +371,7 @@ ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms);
      * @param fname The name of the file to stat.
      * @param cont the pool to use to allocate the new file. 
      */ 
    -ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont);
    +apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont);
     
     /**
      * get the specified file's stats.  The file is specified by filename, 
    @@ -381,7 +381,7 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont);
      * @param fname The name of the file to stat.
      * @param cont the pool to use to allocate the new file. 
      */ 
    -ap_status_t ap_lstat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont);
    +apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont);
     
     /**
      * Move the read/write file offset to a specified byte within a file.
    @@ -395,7 +395,7 @@ ap_status_t ap_lstat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont);
      * @tip The third argument is modified to be the offset the pointer
               was actually moved to.
      */
    -ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where,ap_off_t *offset);
    +apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where,apr_off_t *offset);
     
     /**
      * Open the specified directory.
    @@ -403,26 +403,26 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where,ap_off_t *offset);
      * @param dirname The full path to the directory (use / on all systems)
      * @param cont The pool to use.
      */                        
    -ap_status_t ap_opendir(ap_dir_t **new_dir, const char *dirname, ap_pool_t *cont);
    +apr_status_t apr_opendir(apr_dir_t **new_dir, const char *dirname, apr_pool_t *cont);
     
     /**
      * close the specified directory. 
      * @param thedir the directory descriptor to close.
      */                        
    -ap_status_t ap_closedir(ap_dir_t *thedir);
    +apr_status_t apr_closedir(apr_dir_t *thedir);
     
     /**
      * Read the next entry from the specified directory. 
      * @param thedir the directory descriptor to read from, and fill out.
      * @tip All systems return . and .. as the first two files.
      */                        
    -ap_status_t ap_readdir(ap_dir_t *thedir);
    +apr_status_t apr_readdir(apr_dir_t *thedir);
     
     /**
      * Rewind the directory to the first entry.
      * @param thedir the directory descriptor to rewind.
      */                        
    -ap_status_t ap_rewinddir(ap_dir_t *thedir);
    +apr_status_t apr_rewinddir(apr_dir_t *thedir);
     
     /**
      * Create a new directory on the file system.
    @@ -430,15 +430,15 @@ ap_status_t ap_rewinddir(ap_dir_t *thedir);
      * @param perm Permissions for the new direcoty.
      * @param cont the pool to use.
      */                        
    -ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, 
    -                        ap_pool_t *cont);
    +apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, 
    +                        apr_pool_t *cont);
     
     /**
      * Remove directory from the file system.
      * @param path the path for the directory to be removed.  (use / on all systems)
      * @param cont the pool to use.
      */                        
    -ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont);
    +apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont);
     
     /**
      * Create an anonymous pipe.
    @@ -446,7 +446,7 @@ ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont);
      * @param out The file descriptor to use as output from the pipe.
      * @param cont The pool to operate on.
      */
    -ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont);
    +apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont);
     
     /**
      * Create a named pipe.
    @@ -454,8 +454,8 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont);
      * @param perm The permissions for the newly created pipe.
      * @param cont The pool to operate on.
      */
    -ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, 
    -                                ap_pool_t *cont);
    +apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, 
    +                                apr_pool_t *cont);
     
     /**
      * Set the timeout value for a pipe or manipulate the blocking state.
    @@ -463,7 +463,7 @@ ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm,
      * @param timeoutThe timeout value in microseconds.  Values < 0 mean wait 
      *        forever, 0 means do not wait at all.
      */
    -ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout);
    +apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout);
     
     /**accessor and general file_io functions. */
     
    @@ -472,14 +472,14 @@ ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout);
      * @param new_path The path of the file.  
      * @param thefile The currently open file.
      */                     
    -ap_status_t ap_get_filename(char **new_path, ap_file_t *thefile);
    +apr_status_t apr_get_filename(char **new_path, apr_file_t *thefile);
     
     /**
      * Get the file name of the current directory entry.
      * @param new_path the file name of the directory entry. 
      * @param thedir the currently open directory.
      */                        
    -ap_status_t ap_get_dir_filename(char **new_path, ap_dir_t *thedir);
    +apr_status_t apr_get_dir_filename(char **new_path, apr_dir_t *thedir);
     
     /**
      * Return the data associated with the current file.
    @@ -487,7 +487,7 @@ ap_status_t ap_get_dir_filename(char **new_path, ap_dir_t *thedir);
      * @param key The key to use for retreiving data associated with this file.
      * @param file The currently open file.
      */                     
    -ap_status_t ap_get_filedata(void **data, const char *key, ap_file_t *file);
    +apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file);
     
     /**
      * Set the data associated with the current file.
    @@ -496,29 +496,29 @@ ap_status_t ap_get_filedata(void **data, const char *key, ap_file_t *file);
      * @param key The key to use for assocaiteing data with the file.
      * @param cleanup The cleanup routine to use when the file is destroyed.
      */                     
    -ap_status_t ap_set_filedata(ap_file_t *file, void *data, const char *key,
    -                            ap_status_t (*cleanup) (void *));
    +apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key,
    +                            apr_status_t (*cleanup) (void *));
     
     /**
      * Get the size of the current directory entry.
      * @param size the size of the directory entry. 
      * @param thedir the currently open directory.
      */                        
    -ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir);
    +apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir);
     
     /**
      * Get the last modified time of the current directory entry.
      * @param mtime the last modified time of the directory entry. 
      * @param thedir the currently open directory.
      */ 
    -ap_status_t ap_dir_entry_mtime(ap_time_t *mtime, ap_dir_t *thedir);
    +apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir);
     
     /**
      * Get the file type of the current directory entry.
      * @param type the file type of the directory entry. 
      * @param thedir the currently open directory.
      */
    -ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir);
    +apr_status_t apr_dir_entry_ftype(ap_filetype_e *type, apr_dir_t *thedir);
     
     /**
      * Write a string to a file using a printf format.
    @@ -526,9 +526,9 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir);
      * @param format The format string
      * @param ... The values to substitute in the format string
      * @return The number of bytes written
    - * @deffunc int ap_fprintf(ap_file_t *fptr, const char *format, ...)
    + * @deffunc int apr_fprintf(apr_file_t *fptr, const char *format, ...)
      */ 
    -APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...)
    +APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...)
             __attribute__((format(printf,2,3)));
     
     #ifdef __cplusplus
    diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h
    index b04e679cfa8..e15663337a7 100644
    --- a/include/apr_fnmatch.h
    +++ b/include/apr_fnmatch.h
    @@ -66,19 +66,19 @@ extern "C" {
      *              FNM_PERIOD     --  Period must be matched by period
      *              FNM_CASE_BLIND --  Compare characters case-insensitively.
      * 
    - * @deffunc ap_status_t ap_fnmatch(const char *pattern, const char *strings, int flags) + * @deffunc apr_status_t apr_fnmatch(const char *pattern, const char *strings, int flags) */ -APR_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *strings, +APR_EXPORT(apr_status_t) apr_fnmatch(const char *pattern, const char *strings, int flags); /** * Determine if the given pattern is a regular expression. * @param pattern The pattern to search for glob characters. * @return non-zero if pattern has any glob characters in it - * @deffunc int ap_is_fnmatch(const char *pattern) + * @deffunc int apr_is_fnmatch(const char *pattern) */ -APR_EXPORT(int) ap_is_fnmatch(const char *pattern); +APR_EXPORT(int) apr_is_fnmatch(const char *pattern); #ifdef __cplusplus } diff --git a/include/apr_general.h b/include/apr_general.h index 944e1bc83ce..33b9e3496e8 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -81,7 +81,7 @@ extern "C" { #define MAXIMUM_WAIT_OBJECTS 64 -typedef int ap_signum_t; +typedef int apr_signum_t; #ifdef SIGHUP #define APR_SIGHUP SIGHUP @@ -253,7 +253,7 @@ int strncasecmp(const char *a, const char *b, size_t n); * @param length size of the buffer */ /* TODO: I'm not sure this is the best place to put this prototype...*/ -ap_status_t ap_generate_random_bytes(unsigned char * buf, int length); +apr_status_t apr_generate_random_bytes(unsigned char * buf, int length); #endif /* Memory allocation/Pool debugging options... @@ -272,25 +272,25 @@ ap_status_t ap_generate_random_bytes(unsigned char * buf, int length); #define ALLOC_STATS */ -typedef struct ap_pool_t { +typedef struct apr_pool_t { union block_hdr *first; union block_hdr *last; struct cleanup *cleanups; struct process_chain *subprocesses; - struct ap_pool_t *sub_pools; - struct ap_pool_t *sub_next; - struct ap_pool_t *sub_prev; - struct ap_pool_t *parent; + struct apr_pool_t *sub_pools; + struct apr_pool_t *sub_next; + struct apr_pool_t *sub_prev; + struct apr_pool_t *parent; char *free_first_avail; #ifdef ALLOC_USE_MALLOC void *allocation_list; #endif #ifdef POOL_DEBUG - struct ap_pool_t *joined; + struct apr_pool_t *joined; #endif int (*apr_abort)(int retcode); struct datastruct *prog_data; -}ap_pool_t; +}apr_pool_t; /* pool functions */ @@ -299,10 +299,10 @@ typedef struct ap_pool_t { * @param newcont The pool we have just created. * @param cont The parent pool. If this is NULL, the new pool is a root * pool. If it is non-NULL, the new pool will inherit all - * of it's parent pool's attributes, except the ap_pool_t will + * of it's parent pool's attributes, except the apr_pool_t will * be a sub-pool. */ -ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont); +apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont); /** * Set the data associated with the current pool @@ -319,9 +319,9 @@ ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont); * It is advised that steps are taken to ensure that a unique * key is used at all times. */ -ap_status_t ap_set_userdata(const void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_pool_t *cont); +apr_status_t apr_set_userdata(const void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_pool_t *cont); /** * Return the data associated with the current pool. @@ -329,13 +329,13 @@ ap_status_t ap_set_userdata(const void *data, const char *key, * @param key The user data associated with the pool. * @param cont The current pool. */ -ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont); +apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont); /** * Setup any APR internal data structures. This MUST be the first function * called for any APR program. */ -ap_status_t ap_initialize(void); +apr_status_t apr_initialize(void); /** * Tear down any APR internal data structures which aren't torn down @@ -343,7 +343,7 @@ ap_status_t ap_initialize(void); * @tip An APR program must call this function at termination once it * has stopped using APR services. */ -void ap_terminate(void); +void apr_terminate(void); /** * Set the APR_ABORT function. @@ -354,7 +354,7 @@ void ap_terminate(void); * then APR will return an error and expect the calling program to * deal with the error accordingly. */ -ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_pool_t *cont); +apr_status_t apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont); /** * Return a human readable string describing the specified error. @@ -362,7 +362,7 @@ ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_pool_t *cont); * @param buf A buffer to hold the error string. * @param bufsize Size of the buffer to hold the string. */ -char *ap_strerror(ap_status_t statcode, char *buf, ap_size_t bufsize); +char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); #ifdef __cplusplus } diff --git a/include/apr_getopt.h b/include/apr_getopt.h index a3e5b2c68b3..55266153a10 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -65,7 +65,7 @@ APR_VAR_IMPORT char * /** * Parse the command line options passed to the program. - * @param nargc The number of arguments passed to ap_getopt to parse + * @param nargc The number of arguments passed to apr_getopt to parse * @param nargv The array of command line options to parse * @param ostr A string of characters that are acceptable options to the * program. Characters followed by ":" are required to have an @@ -80,11 +80,11 @@ APR_VAR_IMPORT char * * * @param cont The pool to operate on. * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) - * @deffunc ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap_int32_t *rv, ap_pool_t *cont) + * @deffunc apr_status_t apr_getopt(apr_int32_t nargc, char *const *nargv, const char *ostr, apr_int32_t *rv, apr_pool_t *cont) */ -APR_EXPORT(ap_status_t) ap_getopt(ap_int32_t nargc, char *const *nargv, - const char *ostr, ap_int32_t *rv, - ap_pool_t *cont); +APR_EXPORT(apr_status_t) apr_getopt(apr_int32_t nargc, char *const *nargv, + const char *ostr, apr_int32_t *rv, + apr_pool_t *cont); #endif /* ! APR_GETOPT_H */ diff --git a/include/apr_hash.h b/include/apr_hash.h index 02e3ca0bded..c4be2d9806b 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -72,19 +72,19 @@ extern "C" { /* * Abstract type for hash tables. */ -typedef struct ap_hash_t ap_hash_t; +typedef struct apr_hash_t apr_hash_t; /* * Abstract type for scanning hash tables. */ -typedef struct ap_hash_index_t ap_hash_index_t; +typedef struct apr_hash_index_t apr_hash_index_t; /** * Create a hash table within a pool. * @param pool The pool to allocate the hash table out of * @return The hash table just created */ -APR_EXPORT(ap_hash_t *) ap_make_hash(ap_pool_t *pool); +APR_EXPORT(apr_hash_t *) apr_make_hash(apr_pool_t *pool); /** * Associate a value with a key in a hash table. @@ -95,7 +95,7 @@ APR_EXPORT(ap_hash_t *) ap_make_hash(ap_pool_t *pool); * @param val Value to associate with the key * @tip If the value is NULL the hash entry is deleted. */ -APR_EXPORT(void) ap_hash_set(ap_hash_t *ht, const void *key, size_t klen, +APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, size_t klen, const void *val); /** @@ -106,7 +106,7 @@ APR_EXPORT(void) ap_hash_set(ap_hash_t *ht, const void *key, size_t klen, * If the length is 0 it is assumed to be strlen(key)+1 * @return Returns NULL if the key is not present. */ -APR_EXPORT(void) *ap_hash_get(ap_hash_t *ht, const void *key, size_t klen); +APR_EXPORT(void) *apr_hash_get(apr_hash_t *ht, const void *key, size_t klen); /** * Start iterating over the entries in a hash table. @@ -115,13 +115,13 @@ APR_EXPORT(void) *ap_hash_get(ap_hash_t *ht, const void *key, size_t klen); * @tip Example: *
      * 
    - *     int sum_values(ap_hash_t *ht)
    + *     int sum_values(apr_hash_t *ht)
      *     {
    - *         ap_hash_index_t *hi;
    + *         apr_hash_index_t *hi;
      * 	   void *val;
      * 	   int sum = 0;
    - * 	   for (hi = ap_hash_first(ht); hi; hi = ap_hash_next(hi)) {
    - * 	       ap_hash_this(hi, NULL, NULL, &val);
    + * 	   for (hi = apr_hash_first(ht); hi; hi = apr_hash_next(hi)) {
    + * 	       apr_hash_this(hi, NULL, NULL, &val);
      * 	       sum += *(int *)val;
      * 	   }
      * 	   return sum;
    @@ -133,14 +133,14 @@ APR_EXPORT(void) *ap_hash_get(ap_hash_t *ht, const void *key, size_t klen);
      * progress at the same time.
      * 
    */ -APR_EXPORT(ap_hash_index_t *) ap_hash_first(ap_hash_t *ht); +APR_EXPORT(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht); /** * Continue iterating over the entries in a hash table. * @param hi The iteration state * @return a pointer to the updated iteration state. NULL if there are no more * entries. */ -APR_EXPORT(ap_hash_index_t *) ap_hash_next(ap_hash_index_t *hi); +APR_EXPORT(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); /** * Get the current entry's details from the iteration state. @@ -151,7 +151,7 @@ APR_EXPORT(ap_hash_index_t *) ap_hash_next(ap_hash_index_t *hi); * @tip The return pointers should point to a variable that will be set to the * corresponding data, or they may be NULL if the data isn't interesting. */ -APR_EXPORT(void) ap_hash_this(ap_hash_index_t *hi, const void **key, +APR_EXPORT(void) apr_hash_this(apr_hash_index_t *hi, const void **key, size_t *klen, void **val); #ifdef __cplusplus diff --git a/include/apr_lib.h b/include/apr_lib.h index e5e76ee1800..3e4c84bd57e 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -89,10 +89,10 @@ extern "C" { /* * Structure used by the variable-formatter routines. */ -typedef struct ap_vformatter_buff_t { +typedef struct apr_vformatter_buff_t { char *curpos; char *endpos; -} ap_vformatter_buff_t; +} apr_vformatter_buff_t; /** * return the final element of the pathname @@ -105,9 +105,9 @@ typedef struct ap_vformatter_buff_t { * "gum" -> "gum" * "wi\\n32\\stuff" -> "stuff" * - * @deffunc const char * ap_filename_of_pathname(const char *pathname) + * @deffunc const char * apr_filename_of_pathname(const char *pathname) */ -APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); +APR_EXPORT(const char *) apr_filename_of_pathname(const char *pathname); /* These macros allow correct support of 8-bit characters on systems which * support 8-bit characters. Pretty dumb how the cast is required, but @@ -145,7 +145,7 @@ APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); #endif /* WIN32 */ /** - * ap_vformatter() is a generic printf-style formatting routine + * apr_vformatter() is a generic printf-style formatting routine * with some extensions. * @param flush_func The function to call when the buffer is full * @param c The buffer to write to @@ -165,96 +165,96 @@ APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); * work as expected at all, but that seems to be a fair trade-off * for the increased robustness of having printf-warnings work. * - * Additionally, ap_vformatter allows for arbitrary output methods + * Additionally, apr_vformatter allows for arbitrary output methods * using the ap_vformatter_buff and flush_func. * * The ap_vformatter_buff has two elements curpos and endpos. - * curpos is where ap_vformatter will write the next byte of output. + * curpos is where apr_vformatter will write the next byte of output. * It proceeds writing output to curpos, and updating curpos, until * either the end of output is reached, or curpos == endpos (i.e. the * buffer is full). * - * If the end of output is reached, ap_vformatter returns the + * If the end of output is reached, apr_vformatter returns the * number of bytes written. * * When the buffer is full, the flush_func is called. The flush_func * can return -1 to indicate that no further output should be attempted, - * and ap_vformatter will return immediately with -1. Otherwise + * and apr_vformatter will return immediately with -1. Otherwise * the flush_func should flush the buffer in whatever manner is - * appropriate, re ap_pool_t nitialize curpos and endpos, and return 0. + * appropriate, re apr_pool_t nitialize curpos and endpos, and return 0. * * Note that flush_func is only invoked as a result of attempting to * write another byte at curpos when curpos >= endpos. So for * example, it's possible when the output exactly matches the buffer * space available that curpos == endpos will be true when - * ap_vformatter returns. + * apr_vformatter returns. * - * ap_vformatter does not call out to any other code, it is entirely + * apr_vformatter does not call out to any other code, it is entirely * self-contained. This allows the callers to do things which are - * otherwise "unsafe". For example, ap_psprintf uses the "scratch" + * otherwise "unsafe". For example, apr_psprintf uses the "scratch" * space at the unallocated end of a block, and doesn't actually - * complete the allocation until ap_vformatter returns. ap_psprintf - * would be completely broken if ap_vformatter were to call anything - * that used a ap_pool_t. Similarly http_bprintf() uses the "scratch" + * complete the allocation until apr_vformatter returns. apr_psprintf + * would be completely broken if apr_vformatter were to call anything + * that used a apr_pool_t. Similarly http_bprintf() uses the "scratch" * space at the end of its output buffer, and doesn't actually note * that the space is in use until it either has to flush the buffer - * or until ap_vformatter returns. + * or until apr_vformatter returns. * - * @deffunc int ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b), ap_vformatter_buff_t *c, const char *fmt, va_list ap) + * @deffunc int apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), apr_vformatter_buff_t *c, const char *fmt, va_list ap) */ -APR_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b), - ap_vformatter_buff_t *c, const char *fmt, +APR_EXPORT(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), + apr_vformatter_buff_t *c, const char *fmt, va_list ap); /** * Validate any password encypted with any algorithm that APR understands * @param passwd The password to validate * @param hash The password to validate against - * @deffunc ap_status_t ap_validate_password(const char *passwd, const char *hash) + * @deffunc apr_status_t apr_validate_password(const char *passwd, const char *hash) */ -APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *hash); +APR_EXPORT(apr_status_t) apr_validate_password(const char *passwd, const char *hash); /* - * These are snprintf implementations based on ap_vformatter(). + * These are snprintf implementations based on apr_vformatter(). * * Note that various standards and implementations disagree on the return * value of snprintf, and side-effects due to %n in the formatting string. - * ap_snprintf behaves as follows: + * apr_snprintf behaves as follows: * * Process the format string until the entire string is exhausted, or * the buffer fills. If the buffer fills then stop processing immediately * (so no further %n arguments are processed), and return the buffer * length. In all cases the buffer is NUL terminated. * - * In no event does ap_snprintf return a negative number. It's not possible + * In no event does apr_snprintf return a negative number. It's not possible * to distinguish between an output which was truncated, and an output which * exactly filled the buffer. */ /** - *snprintf routine based on ap_vformatter. This means it understands the + *snprintf routine based on apr_vformatter. This means it understands the *same extensions.> * @param buf The buffer to write to * @param len The size of the buffer * @param format The format string * @param ... The arguments to use to fill out the format string. - * @deffunc int ap_snprintf(char *buf, size_t len, const char *format, ...) + * @deffunc int apr_snprintf(char *buf, size_t len, const char *format, ...) */ -APR_EXPORT_NONSTD(int) ap_snprintf(char *buf, size_t len, +APR_EXPORT_NONSTD(int) apr_snprintf(char *buf, size_t len, const char *format, ...) __attribute__((format(printf,3,4))); /** - * vsnprintf routine based on ap_vformatter. This means it understands the + * vsnprintf routine based on apr_vformatter. This means it understands the * same extensions. * @param buf The buffer to write to * @param len The size of the buffer * @param format The format string * @param ap The arguments to use to fill out the format string. - * @deffunc int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap) + * @deffunc int apr_vsnprintf(char *buf, size_t len, const char *format, va_list ap) */ -APR_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, +APR_EXPORT(int) apr_vsnprintf(char *buf, size_t len, const char *format, va_list ap); /** @@ -262,9 +262,9 @@ APR_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, * @param prompt The prompt to display * @param pwbuf Where to store the password * @param bufsize The length of the password string. - * @deffunc ap_status_t ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize) + * @deffunc apr_status_t apr_getpass(const char *prompt, char *pwbuf, size_t *bufsize) */ -APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize); +APR_EXPORT(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, size_t *bufsize); /** * Register a process to be killed when a pool dies. @@ -273,14 +273,14 @@ APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufs * @param how How to kill the process, one of: *
      *         kill_never   	   -- process is never sent any signals
    - *         kill_always 	   -- process is sent SIGKILL on ap_pool_t cleanup	
    + *         kill_always 	   -- process is sent SIGKILL on apr_pool_t cleanup	
      *         kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL
      *         just_wait          -- wait forever for the process to complete
      *         kill_only_once     -- send SIGTERM and then wait
      * 
    - * @deffunc void ap_note_subprocess(struct ap_pool_t *a, ap_proc_t *pid, enum kill_conditions how) + * @deffunc void apr_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) */ -APR_EXPORT(void) ap_note_subprocess(struct ap_pool_t *a, ap_proc_t *pid, +APR_EXPORT(void) apr_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how); #ifdef __cplusplus diff --git a/include/apr_lock.h b/include/apr_lock.h index 333bc5c9102..8557d10118f 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -66,11 +66,11 @@ extern "C" { * @package APR lock library */ -typedef enum {APR_CROSS_PROCESS, APR_INTRAPROCESS, APR_LOCKALL} ap_lockscope_e; +typedef enum {APR_CROSS_PROCESS, APR_INTRAPROCESS, APR_LOCKALL} apr_lockscope_e; -typedef enum {APR_MUTEX, APR_READWRITE} ap_locktype_e; +typedef enum {APR_MUTEX, APR_READWRITE} apr_locktype_e; -typedef struct ap_lock_t ap_lock_t; +typedef struct apr_lock_t apr_lock_t; /* Function definitions */ @@ -96,21 +96,21 @@ typedef struct ap_lock_t ap_lock_t; * @tip APR_CROSS_PROCESS may lock both processes and threads, but it is * only guaranteed to lock processes. */ -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, - ap_lockscope_e scope, const char *fname, - ap_pool_t *cont); +apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, const char *fname, + apr_pool_t *cont); /** * Lock a protected region. * @param lock The lock to set. */ -ap_status_t ap_lock(ap_lock_t *lock); +apr_status_t apr_lock(apr_lock_t *lock); /** * Unlock a protected region. * @param lock The lock to reset. */ -ap_status_t ap_unlock(ap_lock_t *lock); +apr_status_t apr_unlock(apr_lock_t *lock); /** * Free the memory associated with a lock. @@ -118,7 +118,7 @@ ap_status_t ap_unlock(ap_lock_t *lock); * @tip If the lock is currently active when it is destroyed, it * will be unlocked first. */ -ap_status_t ap_destroy_lock(ap_lock_t *lock); +apr_status_t apr_destroy_lock(apr_lock_t *lock); /** * Re-open a lock in a child process. @@ -126,15 +126,15 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock); * @param fname A file name to use if the lock mechanism requires one. This * argument should always be provided. The lock code itself will * determine if it should be used. This filename should be the - * same one that was passed to ap_create_lock + * same one that was passed to apr_create_lock * @param cont The pool to operate on. * @tip This function doesn't always do something, it depends on the * locking mechanism chosen for the platform, but it is a good * idea to call it regardless, because it makes the code more * portable. */ -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont); +apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, + apr_pool_t *cont); /** * Return the pool associated with the current lock. @@ -142,7 +142,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, * @param key The key to use when retreiving data associated with this lock * @param data The user data associated with the lock. */ -ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data); +apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data); /** * Return the pool associated with the current lock. @@ -151,8 +151,8 @@ ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data); * @param key The key to use when associating data with this lock * @param cleanup The cleanup to use when the lock is destroyed. */ -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, - ap_status_t (*cleanup) (void *)); +apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, + apr_status_t (*cleanup) (void *)); #ifdef __cplusplus } diff --git a/include/apr_md5.h b/include/apr_md5.h index 774bfef1100..412f1a7a18a 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -107,26 +107,26 @@ typedef struct { UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ #if APR_HAS_XLATE - ap_xlate_t *xlate; /* translation handle */ + apr_xlate_t *xlate; /* translation handle */ #endif } ap_md5_ctx_t; /** * MD5 Initialize. Begins an MD5 operation, writing a new context. * @param context The MD5 context to initialize. - * @deffunc ap_status_t ap_MD5Init(ap_md5_ctx_t *context) + * @deffunc apr_status_t apr_MD5Init(ap_md5_ctx_t *context) */ -APR_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context); +APR_EXPORT(apr_status_t) apr_MD5Init(ap_md5_ctx_t *context); /** * MD5 translation setup. Provides the APR translation handle to be used * for translating the content before calculating the digest. * @param context The MD5 content to set the translation for. * @param xlate The translation handle to use for this MD5 context - * @deffunc ap_status_t ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) + * @deffunc apr_status_t ap_MD5SetXlate(ap_md5_ctx_t *context, apr_xlate_t *xlate) */ #if APR_HAS_XLATE -APR_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate); +APR_EXPORT(apr_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, apr_xlate_t *xlate); #else #define ap_MD5SetXlate(context, xlate) APR_ENOTIMPL #endif @@ -137,9 +137,9 @@ APR_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) * @param context The MD5 content to update. * @param input next message block to update * @param inputLen The length of the next message block - * @deffunc ap_status_t ap_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) + * @deffunc apr_status_t apr_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) */ -APR_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, +APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen); @@ -148,9 +148,9 @@ APR_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, * message digest and zeroing the context * @param digest The final MD5 digest * @param context The MD5 content we are finalizing. - * @deffunc ap_status_t ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], ap_md5_ctx_t *context) + * @deffunc apr_status_t apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], ap_md5_ctx_t *context) */ -APR_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], +APR_EXPORT(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], ap_md5_ctx_t *context); /** @@ -159,9 +159,9 @@ APR_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], * @param salt The salt to use for the encoding * @param result The string to store the encoded password in * @param nbytes The length of the string - * @deffunc ap_status_t ap_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes) + * @deffunc apr_status_t apr_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes) */ -APR_EXPORT(ap_status_t) ap_MD5Encode(const char *password, const char *salt, +APR_EXPORT(apr_status_t) apr_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes); #ifdef __cplusplus diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 3334ac17791..7b57a50f8cd 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -68,15 +68,15 @@ extern "C" { * @package APR MMAP library */ -typedef struct ap_mmap_t ap_mmap_t; +typedef struct apr_mmap_t apr_mmap_t; /* As far as I can tell the only really sane way to store an MMAP is as a * void * and a length. BeOS requires this area_id, but that's just a little * something extra. I am exposing this type, because it doesn't make much * sense to keep it private, and opening it up makes some stuff easier in * Apache. */ -struct ap_mmap_t { - ap_pool_t *cntxt; +struct apr_mmap_t { + apr_pool_t *cntxt; #ifdef BEOS area_id area; #endif @@ -94,14 +94,14 @@ struct ap_mmap_t { * @param size The size of the file * @param cntxt The pool to use when creating the mmap. */ -ap_status_t ap_mmap_create(ap_mmap_t ** newmmap, ap_file_t *file, ap_off_t offset, - ap_size_t size, ap_pool_t *cntxt); +apr_status_t apr_mmap_create(apr_mmap_t ** newmmap, apr_file_t *file, apr_off_t offset, + apr_size_t size, apr_pool_t *cntxt); /** * Remove a mmap'ed. * @param mmap The mmap'ed file. */ -ap_status_t ap_mmap_delete(ap_mmap_t *mmap); +apr_status_t apr_mmap_delete(apr_mmap_t *mmap); /** * Move the pointer into the mmap'ed file to the specified offset. @@ -109,7 +109,7 @@ ap_status_t ap_mmap_delete(ap_mmap_t *mmap); * @param mmap The mmap'ed file. * @param offset The offset to move to. */ -ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_off_t offset); +apr_status_t apr_mmap_offset(void **addr, apr_mmap_t *mmap, apr_off_t offset); #ifdef __cplusplus } diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 375b071e4e8..ad0b3087dda 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -108,7 +108,7 @@ typedef enum {APR_SHUTDOWN_READ, APR_SHUTDOWN_WRITE, */ #if (!APR_HAVE_IN_ADDR) struct in_addr { - ap_uint32_t s_addr; + apr_uint32_t s_addr; } #endif @@ -122,17 +122,17 @@ struct in_addr { #define ap_inet_addr inet_network #endif -typedef struct ap_socket_t ap_socket_t; -typedef struct ap_pollfd_t ap_pollfd_t; -typedef struct ap_hdtr_t ap_hdtr_t; -typedef struct in_addr ap_in_addr; +typedef struct apr_socket_t apr_socket_t; +typedef struct apr_pollfd_t apr_pollfd_t; +typedef struct apr_hdtr_t apr_hdtr_t; +typedef struct in_addr apr_in_addr; #if APR_HAS_SENDFILE /* Define flags passed in on ap_sendfile() */ #define APR_SENDFILE_DISCONNECT_SOCKET 1 /* A structure to encapsulate headers and trailers for ap_sendfile */ -struct ap_hdtr_t { +struct apr_hdtr_t { struct iovec* headers; int numheaders; struct iovec* trailers; @@ -147,7 +147,7 @@ struct ap_hdtr_t { * @param new_sock The new socket that has been setup. * @param cont The pool to use */ -ap_status_t ap_create_tcp_socket(ap_socket_t **new_sock, ap_pool_t *cont); +apr_status_t apr_create_tcp_socket(apr_socket_t **new_sock, apr_pool_t *cont); /** * Shutdown either reading, writing, or both sides of a tcp socket. @@ -161,13 +161,13 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new_sock, ap_pool_t *cont); * @tip This does not actually close the socket descriptor, it just * controls which calls are still valid on the socket. */ -ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how); +apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how); /** * Close a tcp socket. * @param thesocket The socket to close */ -ap_status_t ap_close_socket(ap_socket_t *thesocket); +apr_status_t apr_close_socket(apr_socket_t *thesocket); /** * Bind the socket to it's assocaited port @@ -175,7 +175,7 @@ ap_status_t ap_close_socket(ap_socket_t *thesocket); * @tip This is where we will find out if there is any other process * using the selected port. */ -ap_status_t ap_bind(ap_socket_t *sock); +apr_status_t apr_bind(apr_socket_t *sock); /** * Listen to a bound socketi for connections. @@ -184,7 +184,7 @@ ap_status_t ap_bind(ap_socket_t *sock); * listen queue. If this value is less than zero, the listen * queue size is set to zero. */ -ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog); +apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog); /** * Accept a new connection request @@ -194,8 +194,8 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog); * @param sock The socket we are listening on. * @param connection_pool The pool for the new socket. */ -ap_status_t ap_accept(ap_socket_t **new_sock, ap_socket_t *sock, - ap_pool_t *connection_pool); +apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, + apr_pool_t *connection_pool); /** * Issue a connection request to a socket either on the same machine @@ -205,14 +205,14 @@ ap_status_t ap_accept(ap_socket_t **new_sock, ap_socket_t *sock, * APR assumes that the sockaddr_in in the apr_socket is * completely filled out. */ -ap_status_t ap_connect(ap_socket_t *sock, char *hostname); +apr_status_t apr_connect(apr_socket_t *sock, char *hostname); /** * Get name of the machine we are currently connected to. * @param name A buffer to store the hostname in. * @param sock The socket to examine. */ -ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock); +apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock); /** * Get name of the current machine @@ -221,7 +221,7 @@ ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock); * buffer provided. * @param cont The pool to use. */ -ap_status_t ap_gethostname(char *buf, int len, ap_pool_t *cont); +apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont); /** * Return the pool associated with the current socket> @@ -229,7 +229,7 @@ ap_status_t ap_gethostname(char *buf, int len, ap_pool_t *cont); * @param key The key to associate with the user data. * @param sock The currently open socket. */ -ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock); +apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock); /** * Set the pool associated with the current socket. @@ -238,8 +238,8 @@ ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock); * @param key The key to associate with the data. * @param cleanup The cleanup to call when the socket is destroyed. */ -ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, - ap_status_t (*cleanup) (void*)); +apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, + apr_status_t (*cleanup) (void*)); /** * Send data over a network. @@ -250,14 +250,14 @@ ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, * @tip *
      * This functions acts like a blocking write by default.  To change 
    - * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option.
    + * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option.
      *
      * It is possible for both bytes to be sent and an error to be returned.
      *
      * APR_EINTR is never returned.
      * 
    */ -ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len); +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len); /** * Send multiple packets of data over a network. @@ -268,7 +268,7 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len); * @tip *
      * This functions acts like a blocking write by default.  To change 
    - * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option.
    + * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option.
      * The number of bytes actually sent is stored in argument 3.
      *
      * It is possible for both bytes to be sent and an error to be returned.
    @@ -276,8 +276,8 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len);
      * APR_EINTR is never returned.
      * 
    */ -ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, - ap_int32_t nvec, ap_ssize_t *len); +apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, + apr_int32_t nvec, apr_ssize_t *len); #if APR_HAS_SENDFILE /** @@ -290,11 +290,11 @@ ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, * @param len Number of bytes to send * @param flags APR flags that are mapped to OS specific flags * @tip This functions acts like a blocking write by default. To change - * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. + * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. * The number of bytes actually sent is stored in argument 5. */ -ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr, - ap_off_t *offset, ap_size_t *len, ap_int32_t flags); +apr_status_t ap_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, + apr_off_t *offset, apr_size_t *len, apr_int32_t flags); #endif /** @@ -306,7 +306,7 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr, * @tip *
      * This functions acts like a blocking read by default.  To change 
    - * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option.
    + * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option.
      * The number of bytes actually sent is stored in argument 3.
      *
      * It is possible for both bytes to be received and an APR_EOF or
    @@ -315,7 +315,7 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr,
      * APR_EINTR is never returned.
      * 
    */ -ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len); +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len); /** * Setup socket options for the specified socket @@ -337,7 +337,7 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len); * * @param on Are we turning the option on or off. */ -ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on); +apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on); /** * Query socket options for the specified socket @@ -361,7 +361,7 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on); * * @param on Socket option returned on the call. */ -ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t* on); +apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t* on); /** * Associate a local port with a socket. @@ -371,30 +371,30 @@ ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t* on); * that this socket is going to use this port if possible. If * the port is already used, we won't find out about it here. */ -ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port); +apr_status_t apr_set_local_port(apr_socket_t *sock, apr_uint32_t port); /** * Assocaite a remote port with a socket. * @param sock The socket to enquire about. * @param port The local port this socket will be dealing with. * @tip This does not make a connection to the remote port, it is just - * telling apr which port ap_connect() should attempt to connect to. + * telling apr which port apr_connect() should attempt to connect to. */ -ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port); +apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_uint32_t port); /** * Return the local port with a socket. * @param port The local port this socket is associated with. * @param sock The socket to enquire about. */ -ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock); +apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock); /** * Return the remote port associated with a socket. * @param port The remote port this socket is associated with. * @param sock The socket to enquire about. */ -ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock); +apr_status_t apr_get_remote_port(apr_uint32_t *port, apr_socket_t *sock); /** * Assocaite a local socket addr with an apr socket. @@ -404,44 +404,44 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock); * @tip This does not bind the two together, it is just telling apr * that this socket is going to use this address if possible. */ -ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr); +apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr); /** * Assocaite a remote socket addr with an apr socket. * @param sock The socket to use * @param addr The IP address to attach to the socket. * @tip This does not make a connection to the remote address, it is just - * telling apr which address ap_connect() should attempt to connect to. + * telling apr which address apr_connect() should attempt to connect to. */ -ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr); +apr_status_t apr_set_remote_ipaddr(apr_socket_t *sock, const char *addr); /** * Return the local IP address associated with an apr socket. * @param addr The local IP address associated with the socket. * @param sock The socket to use */ -ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock); +apr_status_t apr_get_local_ipaddr(char **addr, apr_socket_t *sock); /** * Return the remote IP address associated with an apr socket. * @param addr The remote IP address associated with the socket. * @param sock The socket to use */ -ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock); +apr_status_t apr_get_remote_ipaddr(char **addr, apr_socket_t *sock); /** * Return the local socket name as a BSD style struct sockaddr_in. * @param name The local name associated with the socket. * @param sock The socket to use */ -ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock); +apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock); /** * Return the remote socket name as a BSD style struct sockaddr_in. * @param name The remote name associated with the socket. * @param sock The socket to use */ -ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock); +apr_status_t apr_get_remote_name(struct sockaddr_in **name, apr_socket_t *sock); /** * Setup the memory required for poll to operate properly> @@ -449,8 +449,8 @@ ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock); * @param num The number of socket descriptors to be polled. * @param cont The pool to operate on. */ -ap_status_t ap_setup_poll(ap_pollfd_t **new_poll, ap_int32_t num, - ap_pool_t *cont); +apr_status_t apr_setup_poll(apr_pollfd_t **new_poll, apr_int32_t num, + apr_pool_t *cont); /** * Poll the sockets in the poll structure @@ -468,7 +468,7 @@ ap_status_t ap_setup_poll(ap_pollfd_t **new_poll, ap_int32_t num, * socket has been signalled, or the timeout has expired. * */ -ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, ap_interval_time_t timeout); +apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_interval_time_t timeout); /** * Add a socket to the poll structure. @@ -481,8 +481,8 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, ap_interval_time_t ti * APR_POLLOUT -- signal if write will not block * */ -ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, ap_socket_t *socket, - ap_int16_t event); +apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, apr_socket_t *socket, + apr_int16_t event); /** * Modify a socket in the poll structure with mask. @@ -495,14 +495,14 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, ap_socket_t *socket, * APR_POLLOUT -- signal if write will not block * */ -ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock, - ap_int16_t events); +apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, + apr_int16_t events); /** * Remove a socket from the poll structure. * @param aprset The poll structure we will be using. * @param sock The socket to remove from the current poll structure. */ -ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock); +apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock); /** * Remove all sockets from the poll structure. @@ -514,7 +514,7 @@ ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock); * APR_POLLOUT -- signal if write will not block * */ -ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events); +apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events); /** * Get the return events for the specified socket. @@ -531,8 +531,8 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events); * @param sock The socket we wish to get information about. * @param aprset The poll structure we will be using. */ -ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, - ap_pollfd_t *aprset); +apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, + apr_pollfd_t *aprset); /** * Return the data associated with the current poll. @@ -540,7 +540,7 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, * @param key The key to use for retreiving data associated with a poll struct. * @param data The user data associated with the pollfd. */ -ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data); +apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data); /** * Set the data associated with the current poll. @@ -549,8 +549,8 @@ ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data); * @param key The user data to associate with the pollfd. * @param cleanup The cleanup function */ -ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, - ap_status_t (*cleanup) (void *)); +apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, + apr_status_t (*cleanup) (void *)); /** * Convert a File type to a socket so that it can be used in a poll operation. @@ -560,7 +560,7 @@ ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, * ability to poll files for data to be read/written/exceptions will * have the APR_FILES_AS_SOCKETS macro defined as true. */ -ap_status_t ap_socket_from_file(ap_socket_t **newsock, ap_file_t *file); +apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file); #ifdef __cplusplus } diff --git a/include/apr_pools.h b/include/apr_pools.h index e84555cc16c..75df3e01ca3 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -73,14 +73,14 @@ extern "C" { * Instead, we maintain pools, and allocate items (both memory and I/O * handlers) from the pools --- currently there are two, one for per * transaction info, and one for config info. When a transaction is over, - * we can delete everything in the per-transaction ap_pool_t without fear, and + * we can delete everything in the per-transaction apr_pool_t without fear, and * without thinking too hard about it either. * * rst */ /* Arenas for configuration info and transaction info - * --- actual layout of the ap_pool_t structure is private to + * --- actual layout of the apr_pool_t structure is private to * alloc.c. */ @@ -96,14 +96,14 @@ extern "C" { enum kill_conditions { kill_never, /* process is never sent any signals */ - kill_always, /* process is sent SIGKILL on ap_pool_t cleanup */ + kill_always, /* process is sent SIGKILL on apr_pool_t cleanup */ kill_after_timeout, /* SIGTERM, wait 3 seconds, SIGKILL */ just_wait, /* wait forever for the process to complete */ kill_only_once /* send SIGTERM and then wait */ }; struct process_chain { - ap_proc_t *pid; + apr_proc_t *pid; enum kill_conditions kill_how; struct process_chain *next; }; @@ -151,9 +151,9 @@ struct process_chain { #endif #define ap_pool_join(a,b) #else -APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub); -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts); -APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); +APR_EXPORT(void) ap_pool_join(apr_pool_t *p, apr_pool_t *sub); +APR_EXPORT(apr_pool_t *) ap_find_pool(const void *ts); +APR_EXPORT(int) ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); #endif #ifdef ULTRIX_BRAIN_DEATH @@ -169,16 +169,16 @@ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); /** * Setup all of the internal structures required to use pools * @tip Programs do NOT need to call this directly. APR will call this - * automatically from ap_initialize. + * automatically from apr_initialize. */ -ap_status_t ap_init_alloc(void); /* Set up everything */ +apr_status_t apr_init_alloc(void); /* Set up everything */ /** * Tear down all of the internal structures required to use pools * @tip Programs do NOT need to call this directly. APR will call this - * automatically from ap_terminate. + * automatically from apr_terminate. */ -void ap_term_alloc(void); /* Tear down everything */ +void apr_term_alloc(void); /* Tear down everything */ /** * make a sub pool from the current pool @@ -188,41 +188,41 @@ void ap_term_alloc(void); /* Tear down everything */ * @tip The apr_abort function provides a way to quit the program if the * machine is out of memory. By default, APR will return with an * error. - * @deffunc ap_pool_t *ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) + * @deffunc apr_pool_t *apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) */ -APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)); +APR_EXPORT(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)); /** * clear all memory in the pool * @param p The pool to clear * @tip This does not actually free the memory, it just allows the pool * to re-use this memory for the next allocation. - * @deffunc void ap_clear_pool(ap_pool_t *p) + * @deffunc void apr_clear_pool(apr_pool_t *p) */ -APR_EXPORT(void) ap_clear_pool(ap_pool_t *p); +APR_EXPORT(void) apr_clear_pool(apr_pool_t *p); /** * destroy the pool * @param p The pool to destroy * @tip This will actually free the memory - * @deffunc void ap_destroy_pool(ap_pool_t *p) + * @deffunc void apr_destroy_pool(apr_pool_t *p) */ -APR_EXPORT(void) ap_destroy_pool(ap_pool_t *p); +APR_EXPORT(void) apr_destroy_pool(apr_pool_t *p); /** * report the number of bytes currently in the pool * @param p The pool to inspect * @return The number of bytes - * @deffunc ap_size_t ap_bytes_in_pool(ap_pool_t *p) + * @deffunc apr_size_t apr_bytes_in_pool(apr_pool_t *p) */ -APR_EXPORT(ap_size_t) ap_bytes_in_pool(ap_pool_t *p); +APR_EXPORT(apr_size_t) apr_bytes_in_pool(apr_pool_t *p); /** * report the number of bytes currently in the list of free blocks * @return The number of bytes - * @deffunc ap_size_t ap_bytes_in_free_blocks(void) + * @deffunc apr_size_t apr_bytes_in_free_blocks(void) */ -APR_EXPORT(ap_size_t) ap_bytes_in_free_blocks(void); +APR_EXPORT(apr_size_t) apr_bytes_in_free_blocks(void); /** * Determine if pool a is an ancestor of pool b @@ -230,27 +230,27 @@ APR_EXPORT(ap_size_t) ap_bytes_in_free_blocks(void); * @param b The pool to search for * @return True if a is an ancestor of b, NULL is considered an ancestor * of all pools. - * @deffunc int ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) + * @deffunc int ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) */ -APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); +APR_EXPORT(int) ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); /** * Allocate a block of memory from a pool * @param c The pool to allocate out of * @param reqsize The amount of memory to allocate * @return The allocated memory - * @deffunc void *ap_palloc(ap_pool_t *c, ap_size_t reqsize) + * @deffunc void *apr_palloc(apr_pool_t *c, apr_size_t reqsize) */ -APR_EXPORT(void *) ap_palloc(ap_pool_t *c, ap_size_t reqsize); +APR_EXPORT(void *) apr_palloc(apr_pool_t *c, apr_size_t reqsize); /** * Allocate a block of memory from a pool and set all of the memory to 0 * @param p The pool to allocate out of * @param size The amount of memory to allocate * @return The allocated memory - * @deffunc void *ap_pcalloc(ap_pool_t *p, ap_size_t size) + * @deffunc void *apr_pcalloc(apr_pool_t *p, apr_size_t size) */ -APR_EXPORT(void *) ap_pcalloc(ap_pool_t *p, ap_size_t size); +APR_EXPORT(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); /** * Register a function to be called when a pool is cleared or destroyed @@ -259,31 +259,31 @@ APR_EXPORT(void *) ap_pcalloc(ap_pool_t *p, ap_size_t size); * @param plain_cleanup The function to call when the pool is cleared * or destroyed * @param child_cleanup The function to call when a child process is created - * @deffunc void ap_register_cleanup(ap_pool_t *p, const void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)) + * @deffunc void apr_register_cleanup(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup) (void *), apr_status_t (*child_cleanup) (void *)) */ -APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, const void *data, - ap_status_t (*plain_cleanup) (void *), - ap_status_t (*child_cleanup) (void *)); +APR_EXPORT(void) apr_register_cleanup(apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup) (void *), + apr_status_t (*child_cleanup) (void *)); /** * remove a previously registered cleanup function * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup - * @deffunc void ap_kill_cleanup(ap_pool_t *p, const void *data, ap_status_t (*cleanup) (void *)) + * @deffunc void apr_kill_cleanup(apr_pool_t *p, const void *data, apr_status_t (*cleanup) (void *)) */ -APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, const void *data, - ap_status_t (*cleanup) (void *)); +APR_EXPORT(void) apr_kill_cleanup(apr_pool_t *p, const void *data, + apr_status_t (*cleanup) (void *)); /** * Run the specified cleanup function immediately and unregister it * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup - * @deffunc ap_status_t ap_run_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)) + * @deffunc apr_status_t apr_run_cleanup(apr_pool_t *p, void *data, apr_status_t (*cleanup) (void *)) */ -APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)); +APR_EXPORT(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, + apr_status_t (*cleanup) (void *)); /* Preparing for exec() --- close files, etc., but *don't* flush I/O * buffers, *don't* wait for subprocesses, and *don't* free any memory. @@ -291,19 +291,19 @@ APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, /** * Run all of the child_cleanups, so that any unnecessary files are * closed because we are about to exec a new program - * @deffunc void ap_cleanup_for_exec(void) + * @deffunc void apr_cleanup_for_exec(void) */ -APR_EXPORT(void) ap_cleanup_for_exec(void); +APR_EXPORT(void) apr_cleanup_for_exec(void); /** * An empty cleanup function * @param data The data to cleanup - * @deffunc ap_status_t ap_null_cleanup(void *data) + * @deffunc apr_status_t apr_null_cleanup(void *data) */ -APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data); +APR_EXPORT_NONSTD(apr_status_t) apr_null_cleanup(void *data); -/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t will not be +/* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t will not be * destroyed before the parent pool */ #ifndef POOL_DEBUG diff --git a/include/apr_portable.h b/include/apr_portable.h index 4401d5b23b2..16be3b8f187 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -91,33 +91,33 @@ extern "C" { #ifdef WIN32 /* The primitives for Windows types */ -typedef HANDLE ap_os_file_t; -typedef HANDLE ap_os_dir_t; -typedef SOCKET ap_os_sock_t; -typedef HANDLE ap_os_lock_t; -typedef HANDLE ap_os_thread_t; -typedef PROCESS_INFORMATION ap_os_proc_t; -typedef DWORD ap_os_threadkey_t; -typedef FILETIME ap_os_imp_time_t; -typedef SYSTEMTIME ap_os_exp_time_t; +typedef HANDLE apr_os_file_t; +typedef HANDLE apr_os_dir_t; +typedef SOCKET apr_os_sock_t; +typedef HANDLE apr_os_lock_t; +typedef HANDLE apr_os_thread_t; +typedef PROCESS_INFORMATION apr_os_proc_t; +typedef DWORD apr_os_threadkey_t; +typedef FILETIME apr_os_imp_time_t; +typedef SYSTEMTIME apr_os_exp_time_t; #elif defined(OS2) #define INCL_DOS #include -typedef HFILE ap_os_file_t; -typedef HDIR ap_os_dir_t; -typedef int ap_os_sock_t; -typedef HMTX ap_os_lock_t; -typedef TID ap_os_thread_t; -typedef PID ap_os_proc_t; -typedef PULONG ap_os_threadkey_t; -typedef struct timeval ap_os_imp_time_t; -typedef struct tm ap_os_exp_time_t; +typedef HFILE apr_os_file_t; +typedef HDIR apr_os_dir_t; +typedef int apr_os_sock_t; +typedef HMTX apr_os_lock_t; +typedef TID apr_os_thread_t; +typedef PID apr_os_proc_t; +typedef PULONG apr_os_threadkey_t; +typedef struct timeval apr_os_imp_time_t; +typedef struct tm apr_os_exp_time_t; #elif defined(BEOS) #include -struct ap_os_lock_t { +struct apr_os_lock_t { /* Inter proc */ sem_id sem_interproc; int32 ben_interproc; @@ -126,15 +126,15 @@ struct ap_os_lock_t { int32 ben_intraproc; }; -typedef int ap_os_file_t; -typedef DIR ap_os_dir_t; -typedef int ap_os_sock_t; -typedef struct ap_os_lock_t ap_os_lock_t; -typedef thread_id ap_os_thread_t; -typedef thread_id ap_os_proc_t; -typedef int ap_os_threadkey_t; -typedef struct timeval ap_os_imp_time_t; -typedef struct tm ap_os_exp_time_t; +typedef int apr_os_file_t; +typedef DIR apr_os_dir_t; +typedef int apr_os_sock_t; +typedef struct apr_os_lock_t apr_os_lock_t; +typedef thread_id apr_os_thread_t; +typedef thread_id apr_os_proc_t; +typedef int apr_os_threadkey_t; +typedef struct timeval apr_os_imp_time_t; +typedef struct tm apr_os_exp_time_t; #else /* Any other OS should go above this one. This is the lowest common @@ -150,7 +150,7 @@ union semun { }; #endif -struct ap_os_lock_t { +struct apr_os_lock_t { #if APR_USE_SYSVSEM_SERIALIZE int crossproc; #elif APR_USE_FCNTL_SERIALIZE @@ -170,17 +170,17 @@ struct ap_os_lock_t { #endif }; -typedef int ap_os_file_t; -typedef DIR ap_os_dir_t; -typedef int ap_os_sock_t; -typedef struct ap_os_lock_t ap_os_lock_t; +typedef int apr_os_file_t; +typedef DIR apr_os_dir_t; +typedef int apr_os_sock_t; +typedef struct apr_os_lock_t apr_os_lock_t; #if APR_HAS_THREADS && APR_HAVE_PTHREAD_H -typedef pthread_t ap_os_thread_t; -typedef pthread_key_t ap_os_threadkey_t; +typedef pthread_t apr_os_thread_t; +typedef pthread_key_t apr_os_threadkey_t; #endif -typedef pid_t ap_os_proc_t; -typedef struct timeval ap_os_imp_time_t; -typedef struct tm ap_os_exp_time_t; +typedef pid_t apr_os_proc_t; +typedef struct timeval apr_os_imp_time_t; +typedef struct tm apr_os_exp_time_t; #endif /** @@ -190,42 +190,42 @@ typedef struct tm ap_os_exp_time_t; * @tip On Unix, it is only possible to get a file descriptor from * an apr file type. */ -ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file); +apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file); /** * convert the dir from apr type to os specific type. * @param thedir The os specific dir we are converting to * @param dir The apr dir to convert. */ -ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir); +apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir); /** * Convert the socket from an apr type to an OS specific socket * @param thesock The socket to convert. * @param sock The os specifc equivelant of the apr socket.. */ -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock); +apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock); /** * Convert the lock from os specific type to apr type * @param oslock The os specific lock we are converting to. * @param lock The apr lock to convert. */ -ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock); +apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock); /** * Get the exploded time in the platforms native format. * @param ostime the native time format * @param aprtime the time to convert */ -ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *aprtime); +apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, ap_exploded_time_t *aprtime); /** * Get the imploded time in the platforms native format. * @param ostime the native time format * @param aprtimethe time to convert */ -ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime); +apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime); #if APR_HAS_THREADS /** @@ -233,14 +233,14 @@ ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime); * @param thethd The apr thread to convert * @param thd The os specific thread we are converting to */ -ap_status_t ap_get_os_thread(ap_os_thread_t **thethd, ap_thread_t *thd); +apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd); /** * convert the thread private memory key to os specific type from an apr type. * @param thekey The apr handle we are converting from. * @param key The os specific handle we are converting to. */ -ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key); +apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key); #endif /** @@ -251,8 +251,8 @@ ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key); * @tip On Unix, it is only possible to put a file descriptor into * an apr file type. */ -ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, - ap_pool_t *cont); +apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, + apr_pool_t *cont); /** * convert the dir from os specific type to apr type. @@ -260,8 +260,8 @@ ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, * @param thedir The os specific dir to convert * @param cont The pool to use when creating to apr directory. */ -ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir, - ap_pool_t *cont); +apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, + apr_pool_t *cont); /** * Convert a socket from the os specific type to the apr type @@ -269,8 +269,8 @@ ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir, * @param thesock The socket to convert to. * @param cont The socket we are converting to an apr type. */ -ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, - ap_pool_t *cont); +apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, + apr_pool_t *cont); /** * Convert the lock from os specific type to apr type @@ -278,8 +278,8 @@ ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, * @param thelock The os specific lock to convert. * @param cont The pool to use if it is needed. */ -ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, - ap_pool_t *cont); +apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, + apr_pool_t *cont); /** * Put the imploded time in the APR format. @@ -287,7 +287,7 @@ ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, * @param ostime the time to convert * @param cont the pool to use if necessary */ -ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime, ap_pool_t *cont); +apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont); /** * Put the exploded time in the APR format. @@ -295,7 +295,7 @@ ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime, ap * @param ostime the time to convert * @param cont the pool to use if necessary */ -ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, ap_os_exp_time_t **ostime, ap_pool_t *cont); +apr_status_t apr_put_os_exp_time(ap_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont); #if APR_HAS_THREADS /** @@ -304,8 +304,8 @@ ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, ap_os_exp_time_t **o * @param thethd The os specific thread to convert * @param cont The pool to use if it is needed. */ -ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd, - ap_pool_t *cont); +apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, + apr_pool_t *cont); /** * convert the thread private memory key from os specific type to apr type. @@ -313,8 +313,8 @@ ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd, * @param thekey The os specific handle to convert * @param cont The pool to use if it is needed. */ -ap_status_t ap_put_os_threadkey(ap_threadkey_t **key, ap_os_threadkey_t *thekey, - ap_pool_t *cont); +apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, apr_os_threadkey_t *thekey, + apr_pool_t *cont); #endif #ifdef __cplusplus diff --git a/include/apr_shmem.h b/include/apr_shmem.h index dd0559b1015..1b0ef860c70 100644 --- a/include/apr_shmem.h +++ b/include/apr_shmem.h @@ -68,14 +68,14 @@ extern "C" { #endif /* __cplusplus */ #if APR_USES_ANONYMOUS_SHM -typedef void ap_shm_name_t; +typedef void apr_shm_name_t; #elif APR_USES_FILEBASED_SHM -typedef char * ap_shm_name_t; +typedef char * apr_shm_name_t; #elif APR_USES_KEYBASED_SHM -typedef key_t ap_shm_name_t; +typedef key_t apr_shm_name_t; #endif -typedef struct shmem_t ap_shmem_t; +typedef struct shmem_t apr_shmem_t; /** * Create a pool of shared memory for use later. @@ -85,34 +85,34 @@ typedef struct shmem_t ap_shmem_t; * that require it. * @param cont The pool to use */ -ap_status_t ap_shm_init(ap_shmem_t **m, ap_size_t reqsize, const char *file, ap_pool_t *cont); +apr_status_t apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont); /** * Destroy the shared memory block. * @param m The shared memory block to destroy. */ -ap_status_t ap_shm_destroy(ap_shmem_t *m); +apr_status_t apr_shm_destroy(apr_shmem_t *m); /** * allocate memory from the block of shared memory. * @param c The shared memory block to destroy. * @param reqsize How much memory to allocate */ -void *ap_shm_malloc(ap_shmem_t *c, ap_size_t reqsize); +void *apr_shm_malloc(apr_shmem_t *c, apr_size_t reqsize); /** * allocate memory from the block of shared memory and initialize it to zero. * @param shared The shared memory block to destroy. * @param size How much memory to allocate */ -void *ap_shm_calloc(ap_shmem_t *shared, ap_size_t size); +void *apr_shm_calloc(apr_shmem_t *shared, apr_size_t size); /** * free shared memory previously allocated. * @param shared The shared memory block to destroy. * @param entity The actual data to free. */ -ap_status_t ap_shm_free(ap_shmem_t *shared, void *entity); +apr_status_t apr_shm_free(apr_shmem_t *shared, void *entity); /** * Get the name of the shared memory segment if not using anonymous @@ -126,7 +126,7 @@ ap_status_t ap_shm_free(ap_shmem_t *shared, void *entity); * memory is based on a key value such as shmctl. If the * shared memory is anonymous, the name is NULL. */ -ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name); +apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name); /** * Set the name of the shared memory segment if not using anonymous @@ -139,20 +139,20 @@ ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name); * memory. APR_SUCCESS if we are using named shared memory * and we were able to assign the name correctly. */ -ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name); +apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name); /** * Open the shared memory block in a child process. * @param The shared memory block to open in the child. */ -ap_status_t ap_open_shmem(ap_shmem_t *c); +apr_status_t apr_open_shmem(apr_shmem_t *c); /** * Determine how much memory is available in the specified shared memory block * @param c The shared memory block to open in the child. * @param avail The amount of space available in the shared memory block. */ -ap_status_t ap_shm_avail(ap_shmem_t *c, ap_size_t *avail); +apr_status_t apr_shm_avail(apr_shmem_t *c, apr_size_t *avail); #ifdef __cplusplus } diff --git a/include/apr_strings.h b/include/apr_strings.h index 9e0c1c37384..fa16c4295fe 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -98,7 +98,7 @@ extern "C" { * this returns <0, if they are equivalent it returns 0, and if the * first string is greater than second string it retuns >0. */ -int ap_strnatcmp(char const *a, char const *b); +int apr_strnatcmp(char const *a, char const *b); /** * Do a natural order comparison of two strings ignoring the case of the @@ -109,16 +109,16 @@ int ap_strnatcmp(char const *a, char const *b); * this returns <0, if they are equivalent it returns 0, and if the * first string is greater than second string it retuns >0. */ -int ap_strnatcasecmp(char const *a, char const *b); +int apr_strnatcasecmp(char const *a, char const *b); /** * duplicate a string into memory allocated out of a pool * @param p The pool to allocate out of * @param s The string to allocate * @return The new string - * @deffunc char *ap_pstrdup(ap_pool_t *p, const char *s) + * @deffunc char *apr_pstrdup(apr_pool_t *p, const char *s) */ -APR_EXPORT(char *) ap_pstrdup(ap_pool_t *p, const char *s); +APR_EXPORT(char *) apr_pstrdup(apr_pool_t *p, const char *s); /** * duplicate the first n characters ofa string into memory allocated @@ -127,18 +127,18 @@ APR_EXPORT(char *) ap_pstrdup(ap_pool_t *p, const char *s); * @param s The string to allocate * @param n The number of characters to duplicate * @return The new string - * @deffunc char *ap_pstrndup(ap_pool_t *p, const char *s, ap_size_t n) + * @deffunc char *apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n) */ -APR_EXPORT(char *) ap_pstrndup(ap_pool_t *p, const char *s, ap_size_t n); +APR_EXPORT(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); /** * Concatenate multiple strings, allocating memory out a pool * @param p The pool to allocate out of * @param ... The strings to concatenate. The final string must be NULL * @return The new string - * @deffunc char *ap_pstrcat(ap_pool_t *p, ...) + * @deffunc char *apr_pstrcat(apr_pool_t *p, ...) */ -APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *p, ...); +APR_EXPORT_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...); /** * printf-style style printing routine. The data is output to a string @@ -147,9 +147,9 @@ APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *p, ...); * @param fmt The format of the string * @param ap The arguments to use while printing the data * @return The new string - * @deffunc char *ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) + * @deffunc char *apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) */ -APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap); +APR_EXPORT(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap); /** * printf-style style printing routine. The data is output to a string @@ -158,9 +158,9 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap); * @param fmt The format of the string * @param ... The arguments to use while printing the data * @return The new string - * @deffunc char *ap_psprintf(ap_pool_t *p, const char *fmt, ...) + * @deffunc char *apr_psprintf(apr_pool_t *p, const char *fmt, ...) */ -APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...); +APR_EXPORT_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...); /** * copy n characters from src to des> @@ -177,18 +177,18 @@ APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...); * destination string, we return a pointer to the terminating '\0' * to allow us to check for truncation. * - * @deffunc char *ap_cpystrn(char *dst, const char *src, size_t dst_size) + * @deffunc char *apr_cpystrn(char *dst, const char *src, size_t dst_size) */ -APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size); +APR_EXPORT(char *) apr_cpystrn(char *dst, const char *src, size_t dst_size); /** * Strip spaces from a string * @param dest The destination string. It is okay to modify the string * in place. Namely dest == src * @param src The string to rid the spaces from. - * @deffunc char *ap_collapse_spaces(char *dest, const char *src) + * @deffunc char *apr_collapse_spaces(char *dest, const char *src) */ -APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src); +APR_EXPORT(char *) apr_collapse_spaces(char *dest, const char *src); /** * Convert the arguments to a program from one string to an array of @@ -196,11 +196,11 @@ APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src); * @param str The arguments to convert * @param argv_out Output location. This is a pointer to an array of strings. * @param token_context Pool to use. - * @deffunc ap_status_t ap_tokenize_to_argv(const char *arg_str, char ***argv_out, ap_pool_t *token_context); + * @deffunc apr_status_t apr_tokenize_to_argv(const char *arg_str, char ***argv_out, apr_pool_t *token_context); */ -APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, +APR_EXPORT(apr_status_t) apr_tokenize_to_argv(const char *arg_str, char ***argv_out, - ap_pool_t *token_context); + apr_pool_t *token_context); #ifdef __cplusplus } diff --git a/include/apr_tables.h b/include/apr_tables.h index 76079f93544..837f4bcad83 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -79,110 +79,110 @@ extern "C" { * and tables are opaque structures to applications, but arrays are * published. */ -typedef struct ap_table_t ap_table_t; -typedef struct ap_array_header_t { - ap_pool_t *cont; +typedef struct apr_table_t apr_table_t; +typedef struct apr_array_header_t { + apr_pool_t *cont; int elt_size; int nelts; int nalloc; char *elts; -} ap_array_header_t; +} apr_array_header_t; -struct ap_table_t { +struct apr_table_t { /* This has to be first to promote backwards compatibility with - * older modules which cast a ap_table_t * to an ap_array_header_t *... + * older modules which cast a apr_table_t * to an apr_array_header_t *... * they should use the table_elts() function for most of the * cases they do this for. */ - ap_array_header_t a; + apr_array_header_t a; #ifdef MAKE_TABLE_PROFILE void *creator; #endif }; -typedef struct ap_table_entry_t { +typedef struct apr_table_entry_t { char *key; /* maybe NULL in future; * check when iterating thru table_elts */ char *val; -} ap_table_entry_t; +} apr_table_entry_t; -/* XXX: these know about the definition of struct ap_table_t in alloc.c. That +/* XXX: these know about the definition of struct apr_table_t in alloc.c. That * definition is not here because it is supposed to be private, and by not * placing it here we are able to get compile-time diagnostics from modules - * written which assume that a ap_table_t is the same as an ap_array_header_t. -djg + * written which assume that a apr_table_t is the same as an apr_array_header_t. -djg */ -#define ap_table_elts(t) ((ap_array_header_t *)(t)) -#define ap_is_empty_table(t) (((t) == NULL)||(((ap_array_header_t *)(t))->nelts == 0)) +#define ap_table_elts(t) ((apr_array_header_t *)(t)) +#define ap_is_empty_table(t) (((t) == NULL)||(((apr_array_header_t *)(t))->nelts == 0)) -APR_EXPORT(ap_array_header_t *) ap_make_array(struct ap_pool_t *p, int nelts, +APR_EXPORT(apr_array_header_t *) apr_make_array(struct apr_pool_t *p, int nelts, int elt_size); -APR_EXPORT(void *) ap_push_array(ap_array_header_t *arr); -APR_EXPORT(void) ap_array_cat(ap_array_header_t *dst, - const ap_array_header_t *src); +APR_EXPORT(void *) apr_push_array(apr_array_header_t *arr); +APR_EXPORT(void) apr_array_cat(apr_array_header_t *dst, + const apr_array_header_t *src); /* copy_array copies the *entire* array. copy_array_hdr just copies * the header, and arranges for the elements to be copied if (and only * if) the code subsequently does a push or arraycat. */ -APR_EXPORT(ap_array_header_t *) ap_copy_array(struct ap_pool_t *p, - const ap_array_header_t *arr); -APR_EXPORT(ap_array_header_t *) - ap_copy_array_hdr(struct ap_pool_t *p, - const ap_array_header_t *arr); -APR_EXPORT(ap_array_header_t *) - ap_append_arrays(struct ap_pool_t *p, - const ap_array_header_t *first, - const ap_array_header_t *second); - -/* ap_array_pstrcat generates a new string from the ap_pool_t containing +APR_EXPORT(apr_array_header_t *) apr_copy_array(struct apr_pool_t *p, + const apr_array_header_t *arr); +APR_EXPORT(apr_array_header_t *) + apr_copy_array_hdr(struct apr_pool_t *p, + const apr_array_header_t *arr); +APR_EXPORT(apr_array_header_t *) + apr_append_arrays(struct apr_pool_t *p, + const apr_array_header_t *first, + const apr_array_header_t *second); + +/* apr_array_pstrcat generates a new string from the apr_pool_t containing * the concatenated sequence of substrings referenced as elements within * the array. The string will be empty if all substrings are empty or null, * or if there are no elements in the array. * If sep is non-NUL, it will be inserted between elements as a separator. */ -APR_EXPORT(char *) ap_array_pstrcat(struct ap_pool_t *p, - const ap_array_header_t *arr, +APR_EXPORT(char *) apr_array_pstrcat(struct apr_pool_t *p, + const apr_array_header_t *arr, const char sep); -APR_EXPORT(ap_table_t *) ap_make_table(struct ap_pool_t *p, int nelts); -APR_EXPORT(ap_table_t *) ap_copy_table(struct ap_pool_t *p, const ap_table_t *t); -APR_EXPORT(void) ap_clear_table(ap_table_t *t); -APR_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key); -APR_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, +APR_EXPORT(apr_table_t *) apr_make_table(struct apr_pool_t *p, int nelts); +APR_EXPORT(apr_table_t *) apr_copy_table(struct apr_pool_t *p, const apr_table_t *t); +APR_EXPORT(void) apr_clear_table(apr_table_t *t); +APR_EXPORT(const char *) apr_table_get(const apr_table_t *t, const char *key); +APR_EXPORT(void) apr_table_set(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_setn(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key); -APR_EXPORT(void) ap_table_merge(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_unset(apr_table_t *t, const char *key); +APR_EXPORT(void) apr_table_merge(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_mergen(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) ap_table_add(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_add(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_addn(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(ap_table_t *) ap_overlay_tables(struct ap_pool_t *p, - const ap_table_t *overlay, - const ap_table_t *base); +APR_EXPORT(apr_table_t *) apr_overlay_tables(struct apr_pool_t *p, + const apr_table_t *overlay, + const apr_table_t *base); APR_EXPORT(void) - ap_table_do(int (*comp) (void *, const char *, const char *), - void *rec, const ap_table_t *t, ...); + apr_table_do(int (*comp) (void *, const char *, const char *), + void *rec, const apr_table_t *t, ...); APR_EXPORT(void) - ap_table_vdo(int (*comp) (void *, const char *, const char *), - void *rec, const ap_table_t *t, va_list); + apr_table_vdo(int (*comp) (void *, const char *, const char *), + void *rec, const apr_table_t *t, va_list); -/* Conceptually, ap_overlap_tables does this: +/* Conceptually, apr_overlap_tables does this: - ap_array_header_t *barr = ap_table_elts(b); - ap_table_entry_t *belt = (ap_table_entry_t *)barr->elts; + apr_array_header_t *barr = ap_table_elts(b); + apr_table_entry_t *belt = (apr_table_entry_t *)barr->elts; int i; for (i = 0; i < barr->nelts; ++i) { if (flags & ap_OVERLAP_TABLES_MERGE) { - ap_table_mergen(a, belt[i].key, belt[i].val); + apr_table_mergen(a, belt[i].key, belt[i].val); } else { - ap_table_setn(a, belt[i].key, belt[i].val); + apr_table_setn(a, belt[i].key, belt[i].val); } } @@ -195,7 +195,7 @@ APR_EXPORT(void) */ #define AP_OVERLAP_TABLES_SET (0) #define AP_OVERLAP_TABLES_MERGE (1) -APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, +APR_EXPORT(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, unsigned flags); #ifdef __cplusplus diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index b04664c2218..d9d94d77339 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -71,8 +71,8 @@ extern "C" { * @package APR Thread library */ -typedef enum {APR_SHELLCMD, APR_PROGRAM} ap_cmdtype_e; -typedef enum {APR_WAIT, APR_NOWAIT} ap_wait_how_e; +typedef enum {APR_SHELLCMD, APR_PROGRAM} apr_cmdtype_e; +typedef enum {APR_WAIT, APR_NOWAIT} apr_wait_how_e; #define APR_NO_PIPE 0 #define APR_FULL_BLOCK 1 @@ -99,23 +99,23 @@ typedef enum {APR_WAIT, APR_NOWAIT} ap_wait_how_e; * us knowing ... buggy os? */ #endif /* APR_HAS_OTHER_CHILD */ -typedef struct ap_proc_t { +typedef struct apr_proc_t { pid_t pid; - ap_file_t *in; /* Parent's side of pipe to child's stdin */ - ap_file_t *out; /* Parent's side of pipe to child's stdout */ - ap_file_t *err; /* Parent's side of pipe to child's stdouterr */ -} ap_proc_t; + apr_file_t *in; /* Parent's side of pipe to child's stdin */ + apr_file_t *out; /* Parent's side of pipe to child's stdout */ + apr_file_t *err; /* Parent's side of pipe to child's stdouterr */ +} apr_proc_t; -typedef struct ap_thread_t ap_thread_t; -typedef struct ap_threadattr_t ap_threadattr_t; -typedef struct ap_procattr_t ap_procattr_t; +typedef struct apr_thread_t apr_thread_t; +typedef struct apr_threadattr_t apr_threadattr_t; +typedef struct apr_procattr_t apr_procattr_t; -typedef struct ap_threadkey_t ap_threadkey_t; +typedef struct apr_threadkey_t apr_threadkey_t; #if APR_HAS_OTHER_CHILD -typedef struct ap_other_child_rec_t ap_other_child_rec_t; +typedef struct apr_other_child_rec_t apr_other_child_rec_t; #endif /* APR_HAS_OTHER_CHILD */ -typedef void *(APR_THREAD_FUNC *ap_thread_start_t)(void *); +typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(void *); /* Thread Function definitions */ @@ -124,20 +124,20 @@ typedef void *(APR_THREAD_FUNC *ap_thread_start_t)(void *); * @param new_attr The newly created threadattr. * @param cont The pool to use */ -ap_status_t ap_create_threadattr(ap_threadattr_t **new_attr, ap_pool_t *cont); +apr_status_t apr_create_threadattr(apr_threadattr_t **new_attr, apr_pool_t *cont); /** * Set if newly created threads should be created in detach mode. * @param attr The threadattr to affect * @param on Thread detach state on or off */ -ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on); +apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on); /** * Get the detach mode for this threadattr. * @param attr The threadattr to reference */ -ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr); +apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr); /** * Create a new thread of execution @@ -147,29 +147,29 @@ ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr); * @param data Any data to be passed to the starting function * @param cont The pool to use */ -ap_status_t ap_create_thread(ap_thread_t **new_thread, ap_threadattr_t *attr, - ap_thread_start_t func, void *data, - ap_pool_t *cont); +apr_status_t apr_create_thread(apr_thread_t **new_thread, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont); /** * stop the current thread * @param thd The thread to stop * @param retval The return value to pass back to any thread that cares */ -ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval); +apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval); /** * block until the desired thread stops executing. * @param retval The return value from the dead thread. * @param thd The thread to join */ -ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd); +apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd); /** * detach a thread * @param thd The thread to detach */ -ap_status_t ap_thread_detach(ap_thread_t *thd); +apr_status_t apr_thread_detach(apr_thread_t *thd); /** * Return the pool associated with the current thread. @@ -177,7 +177,7 @@ ap_status_t ap_thread_detach(ap_thread_t *thd); * @param key The key to associate with the data * @param thread The currently open thread. */ -ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread); +apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread); /** * Return the pool associated with the current thread. @@ -186,9 +186,9 @@ ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread) * @param cleanup The cleanup routine to use when the thread is destroyed. * @param thread The currently open thread. */ -ap_status_t ap_set_threaddata(void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_thread_t *thread); +apr_status_t apr_set_threaddata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread); /** * Create and initialize a new thread private address space @@ -196,28 +196,28 @@ ap_status_t ap_set_threaddata(void *data, const char *key, * @param dest The destructor to use when freeing the private memory. * @param cont The pool to use */ -ap_status_t ap_create_thread_private(ap_threadkey_t **key, void (*dest)(void *), - ap_pool_t *cont); +apr_status_t apr_create_thread_private(apr_threadkey_t **key, void (*dest)(void *), + apr_pool_t *cont); /** * Get a pointer to the thread private memory * @param new_mem The data stored in private memory * @param key The handle for the desired thread private memory */ -ap_status_t ap_get_thread_private(void **new_mem, ap_threadkey_t *key); +apr_status_t apr_get_thread_private(void **new_mem, apr_threadkey_t *key); /** * Set the data to be stored in thread private memory * @param priv The data to be stored in private memory * @param key The handle for the desired thread private memory */ -ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key); +apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key); /** * Free the thread private memory * @param key The handle for the desired thread private memory */ -ap_status_t ap_delete_thread_private(ap_threadkey_t *key); +apr_status_t apr_delete_thread_private(apr_threadkey_t *key); /** * Return the pool associated with the current threadkey. @@ -225,7 +225,7 @@ ap_status_t ap_delete_thread_private(ap_threadkey_t *key); * @param key The key associated with the data * @param threadkey The currently open threadkey. */ -ap_status_t ap_get_threadkeydata(void **data, const char *key, ap_threadkey_t *threadkey); +apr_status_t apr_get_threadkeydata(void **data, const char *key, apr_threadkey_t *threadkey); /** * Return the pool associated with the current threadkey. @@ -234,9 +234,9 @@ ap_status_t ap_get_threadkeydata(void **data, const char *key, ap_threadkey_t *t * @param cleanup The cleanup routine to use when the file is destroyed. * @param threadkey The currently open threadkey. */ -ap_status_t ap_set_threadkeydata(void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_threadkey_t *threadkey); +apr_status_t apr_set_threadkeydata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey); /* Process Function definitions */ @@ -249,7 +249,7 @@ ap_status_t ap_set_threadkeydata(void *data, const char *key, * @param new_attr The newly created procattr. * @param cont The pool to use */ -ap_status_t ap_createprocattr_init(ap_procattr_t **new_attr, ap_pool_t *cont); +apr_status_t apr_createprocattr_init(apr_procattr_t **new_attr, apr_pool_t *cont); /** * Determine if any of stdin, stdout, or stderr should be linked to pipes @@ -259,14 +259,14 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new_attr, ap_pool_t *cont); * @param out Should stdout be a pipe back to the parent? * @param err Should stderr be a pipe back to the parent? */ -ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, - ap_int32_t out, ap_int32_t err); +apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err); /** - * Set the child_in and/or parent_in values to existing ap_file_t values. + * Set the child_in and/or parent_in values to existing apr_file_t values. * @param attr The procattr we care about. - * @param child_in ap_file_t value to use as child_in. Must be a valid file. - * @param parent_in ap_file_t value to use as parent_in. Must be a valid file. + * @param child_in apr_file_t value to use as child_in. Must be a valid file. + * @param parent_in apr_file_t value to use as parent_in. Must be a valid file. * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across mutiple @@ -274,36 +274,36 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, * extra function calls by not creating your own pipe since this * creates one in the process space for you. */ -ap_status_t ap_setprocattr_childin(struct ap_procattr_t *attr, ap_file_t *child_in, - ap_file_t *parent_in); +apr_status_t apr_setprocattr_childin(struct apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in); /** - * Set the child_out and parent_out values to existing ap_file_t values. + * Set the child_out and parent_out values to existing apr_file_t values. * @param attr The procattr we care about. - * @param child_out ap_file_t value to use as child_out. Must be a valid file. - * @param parent_out ap_file_t value to use as parent_out. Must be a valid file. + * @param child_out apr_file_t value to use as child_out. Must be a valid file. + * @param parent_out apr_file_t value to use as parent_out. Must be a valid file. * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across mutiple * process invocations - such as a log file. */ -ap_status_t ap_setprocattr_childout(struct ap_procattr_t *attr, - ap_file_t *child_out, - ap_file_t *parent_out); +apr_status_t apr_setprocattr_childout(struct apr_procattr_t *attr, + apr_file_t *child_out, + apr_file_t *parent_out); /** - * Set the child_err and parent_err values to existing ap_file_t values. + * Set the child_err and parent_err values to existing apr_file_t values. * @param attr The procattr we care about. - * @param child_err ap_file_t value to use as child_err. Must be a valid file. - * @param parent_err ap_file_t value to use as parent_err. Must be a valid file. + * @param child_err apr_file_t value to use as child_err. Must be a valid file. + * @param parent_err apr_file_t value to use as parent_err. Must be a valid file. * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across mutiple * process invocations - such as a log file. */ -ap_status_t ap_setprocattr_childerr(struct ap_procattr_t *attr, - ap_file_t *child_err, - ap_file_t *parent_err); +apr_status_t apr_setprocattr_childerr(struct apr_procattr_t *attr, + apr_file_t *child_err, + apr_file_t *parent_err); /** * Set which directory the child process should start executing in. @@ -312,7 +312,7 @@ ap_status_t ap_setprocattr_childerr(struct ap_procattr_t *attr, * the parent currently resides in, when the createprocess call * is made. */ -ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, const char *dir); +apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir); /** * Set what type of command the child process will call. @@ -323,14 +323,14 @@ ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, const char *dir); * APR_PROGRAM -- Executable program (default) * */ -ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, ap_cmdtype_e cmd); +apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, apr_cmdtype_e cmd); /** * Determine if the chlid should start in detached state. * @param attr The procattr we care about. * @param detach Should the child start in detached state? Default is no. */ -ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach); +apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach); #if APR_HAVE_STRUCT_RLIMIT /** @@ -344,7 +344,7 @@ ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach); * * @param limit Value to set the limit to. */ -ap_status_t ap_setprocattr_limit(ap_procattr_t *attr, ap_int32_t what, +apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, struct rlimit *limit); #endif @@ -355,7 +355,7 @@ ap_status_t ap_setprocattr_limit(ap_procattr_t *attr, ap_int32_t what, * @param proc The resulting process handle. * @param cont The pool to use. */ -ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont); +apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont); #endif /** @@ -364,15 +364,15 @@ ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont); * @param progname The program to run * @param const_args the arguments to pass to the new program. The first * one should be the program name. - * @param env The new environment ap_table_t for the new process. This + * @param env The new environment apr_table_t for the new process. This * should be a list of NULL-terminated strings. * @param attr the procattr we should use to determine how to create the new * process * @param cont The pool to use. */ -ap_status_t ap_create_process(ap_proc_t *new_proc, const char *progname, +apr_status_t apr_create_process(apr_proc_t *new_proc, const char *progname, char *const args[], char **env, - ap_procattr_t *attr, ap_pool_t *cont); + apr_procattr_t *attr, apr_pool_t *cont); /** * Wait for a child process to die @@ -389,7 +389,7 @@ ap_status_t ap_create_process(ap_proc_t *new_proc, const char *progname, * APR_CHILD_NOTDONE -- child is still running. * */ -ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e waithow); +apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e waithow); /** @@ -409,13 +409,13 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e waithow); * @param p Pool to allocate child information out of. */ -ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, - ap_wait_how_e waithow, ap_pool_t *p); +apr_status_t apr_wait_all_procs(apr_proc_t *proc, ap_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p); /** * Detach the process from the controlling terminal. */ -ap_status_t ap_detach(void); +apr_status_t apr_detach(void); #if APR_HAS_OTHER_CHILD /** @@ -430,9 +430,9 @@ ap_status_t ap_detach(void); * OC_REASON_UNWRITABLE. * @param p The pool to use for allocating memory. */ -void ap_register_other_child(ap_proc_t *pid, +void apr_register_other_child(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), - void *data, ap_file_t *write_fd, ap_pool_t *p); + void *data, apr_file_t *write_fd, apr_pool_t *p); /** * Stop watching the specified process. @@ -443,7 +443,7 @@ void ap_register_other_child(ap_proc_t *pid, * themself by loading ocr->next before calling any maintenance * function. */ -void ap_unregister_other_child(void *data); +void apr_unregister_other_child(void *data); /** * Check on the specified process. If it is gone, call the maintenance @@ -451,19 +451,19 @@ void ap_unregister_other_child(void *data); * @param pid The process to check. * @param status The status to pass to the maintenance function. */ -ap_status_t ap_reap_other_child(ap_proc_t *pid, int status); +apr_status_t apr_reap_other_child(apr_proc_t *pid, int status); /** * Loop through all registered other_children and call the appropriate * maintenance function when necessary. */ -void ap_check_other_child(void); +void apr_check_other_child(void); /** * Ensure all the registered write_fds are still writable, otherwise * invoke the maintenance functions as appropriate. */ -void ap_probe_writable_fds(void); +void apr_probe_writable_fds(void); #endif /* APR_HAS_OTHER_CHILD */ /** @@ -471,7 +471,7 @@ void ap_probe_writable_fds(void); * @param proc The process to terminate. * @param sig How to kill the process. */ -ap_status_t ap_kill(ap_proc_t *proc, int sig); +apr_status_t apr_kill(apr_proc_t *proc, int sig); #ifdef __cplusplus } #endif diff --git a/include/apr_time.h b/include/apr_time.h index d4adbe5098c..aea367c7464 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -70,10 +70,10 @@ APR_VAR_IMPORT const char ap_month_snames[12][4]; APR_VAR_IMPORT const char ap_day_snames[7][4]; /* number of microseconds since 00:00:00 january 1, 1970 UTC */ -typedef ap_int64_t ap_time_t; +typedef apr_int64_t apr_time_t; /* intervals for I/O timeouts, in microseconds */ -typedef ap_int32_t ap_interval_time_t; +typedef apr_int32_t apr_interval_time_t; #ifdef WIN32 #define AP_USEC_PER_SEC ((LONGLONG) 1000000) @@ -90,46 +90,46 @@ typedef ap_int32_t ap_interval_time_t; /** * return the current time */ -ap_time_t ap_now(void); +apr_time_t apr_now(void); /* a structure similar to ANSI struct tm with the following differences: - tm_usec isn't an ANSI field - tm_gmtoff isn't an ANSI field (it's a bsdism) */ typedef struct { - ap_int32_t tm_usec; /* microseconds past tm_sec */ - ap_int32_t tm_sec; /* (0-61) seconds past tm_min */ - ap_int32_t tm_min; /* (0-59) minutes past tm_hour */ - ap_int32_t tm_hour; /* (0-23) hours past midnight */ - ap_int32_t tm_mday; /* (1-31) day of the month */ - ap_int32_t tm_mon; /* (0-11) month of the year */ - ap_int32_t tm_year; /* year since 1900 */ - ap_int32_t tm_wday; /* (0-6) days since sunday */ - ap_int32_t tm_yday; /* (0-365) days since jan 1 */ - ap_int32_t tm_isdst; /* daylight saving time */ - ap_int32_t tm_gmtoff; /* seconds east of UTC */ + apr_int32_t tm_usec; /* microseconds past tm_sec */ + apr_int32_t tm_sec; /* (0-61) seconds past tm_min */ + apr_int32_t tm_min; /* (0-59) minutes past tm_hour */ + apr_int32_t tm_hour; /* (0-23) hours past midnight */ + apr_int32_t tm_mday; /* (1-31) day of the month */ + apr_int32_t tm_mon; /* (0-11) month of the year */ + apr_int32_t tm_year; /* year since 1900 */ + apr_int32_t tm_wday; /* (0-6) days since sunday */ + apr_int32_t tm_yday; /* (0-365) days since jan 1 */ + apr_int32_t tm_isdst; /* daylight saving time */ + apr_int32_t tm_gmtoff; /* seconds east of UTC */ } ap_exploded_time_t; /** - * convert an ansi time_t to an ap_time_t - * @param result the resulting ap_time_t + * convert an ansi time_t to an apr_time_t + * @param result the resulting apr_time_t * @param input the time_t to convert */ -ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input); +apr_status_t apr_ansi_time_to_ap_time(apr_time_t *result, time_t input); /** * convert a time to its human readable components in GMT timezone * @param result the exploded time * @param input the time to explode */ -ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input); +apr_status_t apr_explode_gmt(ap_exploded_time_t *result, apr_time_t input); /** * convert a time to its human readable components in local timezone * @param result the exploded time * @param input the time to explode */ -ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input); +apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input); /** * Convert time value from human readable format to number of seconds @@ -137,36 +137,36 @@ ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input); * @param result the resulting imploded time * @param input the input exploded time */ -ap_status_t ap_implode_time(ap_time_t *result, ap_exploded_time_t *input); +apr_status_t apr_implode_time(apr_time_t *result, ap_exploded_time_t *input); /** * Sleep for the specified number of micro-seconds. * @param t desired amount of time to sleep. * @tip May sleep for longer than the specified time. */ -void ap_sleep(ap_interval_time_t t); +void apr_sleep(apr_interval_time_t t); #define AP_RFC822_DATE_LEN (30) /** - * ap_rfc822_date formats dates in the RFC822 + * apr_rfc822_date formats dates in the RFC822 * format in an efficient manner. it is a fixed length * format and requires the indicated amount of storage * including trailing \0 * @param date_str String to write to. * @param t the time to convert */ -ap_status_t ap_rfc822_date(char *date_str, ap_time_t t); +apr_status_t apr_rfc822_date(char *date_str, apr_time_t t); #define AP_CTIME_LEN (25) /** - * ap_ctime formats dates in the ctime() format + * apr_ctime formats dates in the ctime() format * in an efficient manner. it is a fixed length format * and requires the indicated amount of storage * including trailing \0 * @param date_str String to write to. * @param t the time to convert */ -ap_status_t ap_ctime(char *date_str, ap_time_t t); +apr_status_t apr_ctime(char *date_str, apr_time_t t); /** * formats the exploded time according to the format specified @@ -176,7 +176,7 @@ ap_status_t ap_ctime(char *date_str, ap_time_t t); * @param format The format for the time string * @param tm The time to convert */ -ap_status_t ap_strftime(char *s, ap_size_t *retsize, ap_size_t max, const char *format, ap_exploded_time_t *tm); +apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, ap_exploded_time_t *tm); #ifdef __cplusplus } diff --git a/include/apr_xlate.h b/include/apr_xlate.h index 4d0f5bdfe35..ffbbcc9fca0 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -77,7 +77,7 @@ extern "C" { #if ! APR_HAS_XLATE -typedef void ap_xlate_t; +typedef void apr_xlate_t; /* For platforms where we don't bother with translating between charsets, * these are macros which always return failure. @@ -102,7 +102,7 @@ typedef void ap_xlate_t; #else /* ! APR_HAS_XLATE */ -typedef struct ap_xlate_t ap_xlate_t; +typedef struct apr_xlate_t apr_xlate_t; /** * Set up for converting text from one charset to another. @@ -125,8 +125,8 @@ typedef struct ap_xlate_t ap_xlate_t; * names to indicate the charset of the current locale. * */ -ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, - const char *frompage, ap_pool_t *pool); +apr_status_t ap_xlate_open(apr_xlate_t **convset, const char *topage, + const char *frompage, apr_pool_t *pool); #define APR_DEFAULT_CHARSET (const char *)0 #define APR_LOCALE_CHARSET (const char *)1 @@ -138,7 +138,7 @@ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, * @param onoff Output: whether or not the conversion is single-byte-only */ -ap_status_t ap_xlate_get_sb(ap_xlate_t *convset, int *onoff); +apr_status_t ap_xlate_get_sb(apr_xlate_t *convset, int *onoff); /** * Convert a buffer of text from one codepage to another. @@ -151,9 +151,9 @@ ap_status_t ap_xlate_get_sb(ap_xlate_t *convset, int *onoff); * @param outbytes_left Input: the size of the output buffer * Output: the amount of the output buffer not yet used */ -ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, - ap_size_t *inbytes_left, char *outbuf, - ap_size_t *outbytes_left); +apr_status_t ap_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, + apr_size_t *inbytes_left, char *outbuf, + apr_size_t *outbytes_left); /** * The purpose of ap_xlate_conv_char is to translate one character @@ -164,7 +164,7 @@ ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, * @param inchar The character to convert * @param outchar The converted character */ -ap_status_t ap_xlate_conv_char(ap_xlate_t *convset, char inchar, char outchar); +apr_status_t ap_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar); /** * Convert a single-byte character from one charset to another. @@ -174,13 +174,13 @@ ap_status_t ap_xlate_conv_char(ap_xlate_t *convset, char inchar, char outchar); * @tip This only works when converting between single-byte character sets. -1 will be returned if the conversion can't be performed. */ -ap_int32_t ap_xlate_conv_byte(ap_xlate_t *convset, unsigned char inchar); +apr_int32_t ap_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar); /** * Close a codepage translation handle. * @param convset The codepage translation handle to close */ -ap_status_t ap_xlate_close(ap_xlate_t *convset); +apr_status_t ap_xlate_close(apr_xlate_t *convset); #endif /* ! APR_HAS_XLATE */ diff --git a/include/arch/aix/dso.h b/include/arch/aix/dso.h index ae89f9ee585..6b7ca8ea74e 100644 --- a/include/arch/aix/dso.h +++ b/include/arch/aix/dso.h @@ -68,8 +68,8 @@ void *dlsym(void *handle, const char *symbol); const char *dlerror(void); int dlclose(void *handle); -struct ap_dso_handle_t { - ap_pool_t *cont; +struct apr_dso_handle_t { + apr_pool_t *cont; void *handle; }; diff --git a/include/arch/beos/dso.h b/include/arch/beos/dso.h index 71a75ef58d6..476e71c8fa4 100644 --- a/include/arch/beos/dso.h +++ b/include/arch/beos/dso.h @@ -66,9 +66,9 @@ #if APR_HAS_DSO -struct ap_dso_handle_t { +struct apr_dso_handle_t { image_id handle; /* Handle to the DSO loaded */ - ap_pool_t *cont; + apr_pool_t *cont; }; #endif diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h index fefc0d30ae9..685f8a89b83 100644 --- a/include/arch/beos/locks.h +++ b/include/arch/beos/locks.h @@ -61,10 +61,10 @@ #include "apr_general.h" #include "apr_lib.h" -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; int curr_locked; char *fname; /* Inter proc */ @@ -75,17 +75,17 @@ struct ap_lock_t { int32 ben_intraproc; }; -ap_status_t create_intra_lock(struct ap_lock_t *new); -ap_status_t lock_intra(struct ap_lock_t *lock); -ap_status_t unlock_intra(struct ap_lock_t *lock); -ap_status_t destroy_intra_lock(struct ap_lock_t *lock); +apr_status_t create_intra_lock(struct apr_lock_t *new); +apr_status_t lock_intra(struct apr_lock_t *lock); +apr_status_t unlock_intra(struct apr_lock_t *lock); +apr_status_t destroy_intra_lock(struct apr_lock_t *lock); -ap_status_t create_inter_lock(struct ap_lock_t *new); -ap_status_t lock_inter(struct ap_lock_t *lock); -ap_status_t unlock_inter(struct ap_lock_t *lock); -ap_status_t destroy_inter_lock(struct ap_lock_t *lock); +apr_status_t create_inter_lock(struct apr_lock_t *new); +apr_status_t lock_inter(struct apr_lock_t *lock); +apr_status_t unlock_inter(struct apr_lock_t *lock); +apr_status_t destroy_inter_lock(struct apr_lock_t *lock); -ap_status_t child_init_lock(struct ap_lock_t **lock, ap_pool_t *cont, +apr_status_t child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, const char *fname); diff --git a/include/arch/beos/networkio.h b/include/arch/beos/networkio.h index 3c2bcc5358a..4a9ef6c14eb 100644 --- a/include/arch/beos/networkio.h +++ b/include/arch/beos/networkio.h @@ -91,26 +91,26 @@ #define POLLHUP 16 #define POLLNVAL 32 -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; int socketdes; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; int addr_len; - ap_interval_time_t timeout; + apr_interval_time_t timeout; int connected; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; - struct ap_socket_t *sock; +struct apr_pollfd_t { + apr_pool_t *cntxt; + struct apr_socket_t *sock; fd_set *read; fd_set *write; fd_set *except; int highsock; }; -ap_int16_t get_event(ap_int16_t); +apr_int16_t get_event(apr_int16_t); int inet_aton(const char *cp, struct in_addr *addr); #include /* for the ntohs definition */ diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h index 4cb9c31e03f..58c4fb67b33 100644 --- a/include/arch/beos/threadproc.h +++ b/include/arch/beos/threadproc.h @@ -78,20 +78,20 @@ #define BEOS_MAX_DATAKEYS 128 -struct ap_thread_t { - ap_pool_t *cntxt; +struct apr_thread_t { + apr_pool_t *cntxt; thread_id td; }; -struct ap_threadattr_t { - ap_pool_t *cntxt; +struct apr_threadattr_t { + apr_pool_t *cntxt; int32 attr; int detached; int joinable; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; int32 key; }; @@ -109,17 +109,17 @@ struct beos_key { void (* destructor) (void *); }; -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; +struct apr_procattr_t { + apr_pool_t *cntxt; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; }; #endif /* ! THREAD_PROC_H */ diff --git a/include/arch/os2/dso.h b/include/arch/os2/dso.h index b37e1a54c10..1597c81d112 100644 --- a/include/arch/os2/dso.h +++ b/include/arch/os2/dso.h @@ -66,10 +66,10 @@ #if APR_HAS_DSO -struct ap_dso_handle_t { - ap_pool_t *cont; /* Context for returning error strings */ +struct apr_dso_handle_t { + apr_pool_t *cont; /* Context for returning error strings */ HMODULE handle; /* Handle to the DSO loaded */ - ap_status_t load_error; + apr_status_t load_error; char *failed_module; }; diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index 738e17f2ec2..6aa1be1c5ee 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -67,14 +67,14 @@ #define APR_FILE_BUFSIZE 4096 -struct ap_file_t { - ap_pool_t *cntxt; +struct apr_file_t { + apr_pool_t *cntxt; HFILE filedes; char * fname; int isopen; int buffered; int eof_hit; - ap_int32_t flags; + apr_int32_t flags; int timeout; int pipe; HEV pipeSem; @@ -85,19 +85,19 @@ struct ap_file_t { unsigned long dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write unsigned long filePtr; // position in file of handle - ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields + apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields }; -struct ap_dir_t { - ap_pool_t *cntxt; +struct apr_dir_t { + apr_pool_t *cntxt; char *dirname; ULONG handle; FILEFINDBUF3 entry; int validentry; }; -ap_status_t apr_file_cleanup(void *); -ap_status_t ap_os2_time_to_ap_time(ap_time_t *result, FDATE os2date, FTIME os2time); +apr_status_t apr_file_cleanup(void *); +apr_status_t ap_os2_time_to_ap_time(apr_time_t *result, FDATE os2date, FTIME os2time); #endif /* ! FILE_IO_H */ diff --git a/include/arch/os2/locks.h b/include/arch/os2/locks.h index d416b6b0833..50ffdc65216 100644 --- a/include/arch/os2/locks.h +++ b/include/arch/os2/locks.h @@ -60,10 +60,10 @@ #define INCL_DOS #include -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; char *fname; HMTX hMutex; TID owner; diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index 63424de6a74..a87823ae9ed 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -59,18 +59,18 @@ #include "apr_general.h" #include "os2calls.h" -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; int socketdes; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; int addr_len; - ap_interval_time_t timeout; + apr_interval_time_t timeout; int nonblock; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; +struct apr_pollfd_t { + apr_pool_t *cntxt; int *socket_list; int *r_socket_list; int num_read; diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/threadproc.h index d6971dbb300..c14c54aa00c 100644 --- a/include/arch/os2/threadproc.h +++ b/include/arch/os2/threadproc.h @@ -63,36 +63,36 @@ #define SHELL_PATH "cmd.exe" #define APR_THREAD_STACKSIZE 65536 -struct ap_threadattr_t { - ap_pool_t *cntxt; +struct apr_threadattr_t { + apr_pool_t *cntxt; unsigned long attr; }; -struct ap_thread_t { - ap_pool_t *cntxt; - struct ap_threadattr_t *attr; +struct apr_thread_t { + apr_pool_t *cntxt; + struct apr_threadattr_t *attr; unsigned long tid; - ap_thread_start_t func; + apr_thread_start_t func; void *data; void *rv; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; unsigned long *key; }; -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; +struct apr_procattr_t { + apr_pool_t *cntxt; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; }; typedef void (*os2_thread_start_t)(void *); diff --git a/include/arch/unix/dso.h b/include/arch/unix/dso.h index ef8aa572a52..fc9b8325e17 100644 --- a/include/arch/unix/dso.h +++ b/include/arch/unix/dso.h @@ -85,8 +85,8 @@ #define DLSYM_NEEDS_UNDERSCORE #endif -struct ap_dso_handle_t { - ap_pool_t *cont; +struct apr_dso_handle_t { + apr_pool_t *cont; void *handle; const char *errormsg; }; diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index c91bb453d25..2f202d90e0d 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -112,14 +112,14 @@ #define APR_FILE_BUFSIZE 4096 -struct ap_file_t { - ap_pool_t *cntxt; +struct apr_file_t { + apr_pool_t *cntxt; int filedes; char * fname; int oflags; int eof_hit; int pipe; - ap_interval_time_t timeout; + apr_interval_time_t timeout; int buffered; enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ @@ -131,21 +131,21 @@ struct ap_file_t { int direction; /* buffer being used for 0 = read, 1 = write */ unsigned long filePtr; /* position in file of handle */ #if APR_HAS_THREADS - struct ap_lock_t *thlock; + struct apr_lock_t *thlock; #endif }; -struct ap_dir_t { - ap_pool_t *cntxt; +struct apr_dir_t { + apr_pool_t *cntxt; char *dirname; DIR *dirstruct; struct dirent *entry; }; -ap_status_t ap_unix_file_cleanup(void *); +apr_status_t apr_unix_file_cleanup(void *); -mode_t ap_unix_perms2mode(ap_fileperms_t perms); -ap_fileperms_t ap_unix_mode2perms(mode_t mode); +mode_t apr_unix_perms2mode(apr_fileperms_t perms); +apr_fileperms_t apr_unix_mode2perms(mode_t mode); #endif /* ! FILE_IO_H */ diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index d6ecae5dbb6..321cdd18a78 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -112,10 +112,10 @@ union semun { }; #endif -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; int curr_locked; char *fname; #if APR_USE_SYSVSEM_SERIALIZE @@ -142,19 +142,19 @@ struct ap_lock_t { }; #if APR_HAS_THREADS -ap_status_t ap_unix_create_intra_lock(struct ap_lock_t *new); -ap_status_t ap_unix_lock_intra(struct ap_lock_t *lock); -ap_status_t ap_unix_unlock_intra(struct ap_lock_t *lock); -ap_status_t ap_unix_destroy_intra_lock(struct ap_lock_t *lock); +apr_status_t apr_unix_create_intra_lock(struct apr_lock_t *new); +apr_status_t apr_unix_lock_intra(struct apr_lock_t *lock); +apr_status_t apr_unix_unlock_intra(struct apr_lock_t *lock); +apr_status_t apr_unix_destroy_intra_lock(struct apr_lock_t *lock); #endif -void ap_unix_setup_lock(void); -ap_status_t ap_unix_create_inter_lock(struct ap_lock_t *new); -ap_status_t ap_unix_lock_inter(struct ap_lock_t *lock); -ap_status_t ap_unix_unlock_inter(struct ap_lock_t *lock); -ap_status_t ap_unix_destroy_inter_lock(struct ap_lock_t *lock); +void apr_unix_setup_lock(void); +apr_status_t apr_unix_create_inter_lock(struct apr_lock_t *new); +apr_status_t apr_unix_lock_inter(struct apr_lock_t *lock); +apr_status_t apr_unix_unlock_inter(struct apr_lock_t *lock); +apr_status_t apr_unix_destroy_inter_lock(struct apr_lock_t *lock); -ap_status_t ap_unix_child_init_lock(struct ap_lock_t **lock, ap_pool_t *cont, +apr_status_t apr_unix_child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, const char *fname); #endif /* LOCKS_H */ diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index 7a364850286..f02c112dcf7 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -90,8 +90,8 @@ typedef struct datastruct { struct datastruct *prev; } datastruct; -struct ap_other_child_rec_t { - struct ap_other_child_rec_t *next; +struct apr_other_child_rec_t { + struct apr_other_child_rec_t *next; int id; /* This is either a pid or tid depending on the platform */ void (*maintenance) (int, void *, int); void *data; @@ -170,7 +170,7 @@ AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( (hFile)); #define CancelIo ap_winapi_CancelIo -ap_status_t ap_get_oslevel(struct ap_pool_t *, ap_oslevel_e *); +apr_status_t ap_get_oslevel(struct apr_pool_t *, ap_oslevel_e *); #endif /* WIN32 */ #endif /* ! MISC_H */ diff --git a/include/arch/unix/mmap.c b/include/arch/unix/mmap.c index d708b977e46..199b6fc74ed 100644 --- a/include/arch/unix/mmap.c +++ b/include/arch/unix/mmap.c @@ -79,9 +79,9 @@ #if APR_HAS_MMAP || defined(BEOS) -static ap_status_t mmap_cleanup(void *themmap) +static apr_status_t mmap_cleanup(void *themmap) { - ap_mmap_t *mm = themmap; + apr_mmap_t *mm = themmap; int rv; #ifdef BEOS rv = delete_area(mm->area); @@ -101,8 +101,8 @@ static ap_status_t mmap_cleanup(void *themmap) return errno; } -ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, - ap_size_t size, ap_pool_t *cont) +apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, apr_off_t offset, + apr_size_t size, apr_pool_t *cont) { #ifdef BEOS void *mm; @@ -115,11 +115,11 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, if (file == NULL || file->filedes == -1 || file->buffered) return APR_EBADF; - (*new) = (ap_mmap_t *)ap_pcalloc(cont, sizeof(ap_mmap_t)); + (*new) = (apr_mmap_t *)apr_pcalloc(cont, sizeof(apr_mmap_t)); #ifdef BEOS /* XXX: mmap shouldn't really change the seek offset */ - ap_seek(file, APR_SET, &offset); + apr_seek(file, APR_SET, &offset); pages = ((size -1) / B_PAGE_SIZE) + 1; aid = create_area(areaname, &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, @@ -148,20 +148,20 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, (*new)->cntxt = cont; /* register the cleanup... */ - ap_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_mmap_delete(ap_mmap_t *mmap) +apr_status_t apr_mmap_delete(apr_mmap_t *mmap) { - ap_status_t rv; + apr_status_t rv; if (mmap->mm == (caddr_t) -1) return APR_ENOENT; if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { - ap_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); + apr_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); return APR_SUCCESS; } return rv; diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index af28dc7c710..90868b06da0 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -116,13 +116,13 @@ #define POLLNVAL 32 #endif -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; int socketdes; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; socklen_t addr_len; - ap_interval_time_t timeout; + apr_interval_time_t timeout; #ifndef HAVE_POLL int connected; #endif @@ -130,8 +130,8 @@ struct ap_socket_t { int local_interface_unknown; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; +struct apr_pollfd_t { + apr_pool_t *cntxt; #ifdef HAVE_POLL struct pollfd *pollset; int num; @@ -142,8 +142,8 @@ struct ap_pollfd_t { fd_set *except; int highsock; #endif - ap_int16_t *events; - ap_int16_t *revents; + apr_int16_t *events; + apr_int16_t *revents; }; diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index e6d9e36aa3f..d5f0a679f4b 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -86,33 +86,33 @@ #define SHELL_PATH "/bin/sh" #if APR_HAS_THREADS -struct ap_thread_t { - ap_pool_t *cntxt; +struct apr_thread_t { + apr_pool_t *cntxt; pthread_t *td; }; -struct ap_threadattr_t { - ap_pool_t *cntxt; +struct apr_threadattr_t { + apr_pool_t *cntxt; pthread_attr_t *attr; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; pthread_key_t key; }; #endif -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; +struct apr_procattr_t { + apr_pool_t *cntxt; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; #ifdef RLIMIT_CPU struct rlimit *limit_cpu; #endif diff --git a/include/arch/win32/atime.h b/include/arch/win32/atime.h index cf5ab487386..d4a25731589 100644 --- a/include/arch/win32/atime.h +++ b/include/arch/win32/atime.h @@ -60,13 +60,13 @@ #include struct atime_t { - ap_pool_t *cntxt; - ap_time_t currtime; + apr_pool_t *cntxt; + apr_time_t currtime; SYSTEMTIME *explodedtime; }; -void FileTimeToAprTime(ap_time_t *atime, FILETIME *ft); -void AprTimeToFileTime(LPFILETIME pft, ap_time_t t); +void FileTimeToAprTime(apr_time_t *atime, FILETIME *ft); +void AprTimeToFileTime(LPFILETIME pft, apr_time_t t); #endif /* ! ATIME_H */ diff --git a/include/arch/win32/dso.h b/include/arch/win32/dso.h index 73ab8b1ed58..32bf6b7be74 100644 --- a/include/arch/win32/dso.h +++ b/include/arch/win32/dso.h @@ -63,10 +63,10 @@ #if APR_HAS_DSO -struct ap_dso_handle_t { - ap_pool_t *cont; +struct apr_dso_handle_t { + apr_pool_t *cont; void *handle; - ap_status_t load_error; + apr_status_t load_error; }; #endif diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 232c4d057fd..bfdda74213e 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -87,7 +87,7 @@ #define APR_FILE_BUFSIZE 4096 -/* quick run-down of fields in windows' ap_file_t structure that may have +/* quick run-down of fields in windows' apr_file_t structure that may have * obvious uses. * fname -- the filename as passed to the open call. * dwFileAttricutes -- Attributes used to open the file. @@ -100,12 +100,12 @@ * correctly when writing to a file with this flag set TRUE. */ -struct ap_file_t { - ap_pool_t *cntxt; +struct apr_file_t { + apr_pool_t *cntxt; HANDLE filehand; BOOLEAN pipe; // Is this a pipe of a file? OVERLAPPED *pOverlapped; - ap_interval_time_t timeout; + apr_interval_time_t timeout; /* File specific info */ char *fname; @@ -117,38 +117,38 @@ struct ap_file_t { int ungetchar; // Last char provided by an unget op. (-1 = no char) int append; off_t size; - ap_time_t atime; - ap_time_t mtime; - ap_time_t ctime; + apr_time_t atime; + apr_time_t mtime; + apr_time_t ctime; /* Stuff for buffered mode */ char *buffer; - ap_ssize_t bufpos; // Read/Write position in buffer - ap_ssize_t dataRead; // amount of valid data read into buffer + apr_ssize_t bufpos; // Read/Write position in buffer + apr_ssize_t dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write - ap_ssize_t filePtr; // position in file of handle - ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields + apr_ssize_t filePtr; // position in file of handle + apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields /* Pipe specific info */ }; -struct ap_dir_t { - ap_pool_t *cntxt; +struct apr_dir_t { + apr_pool_t *cntxt; char *dirname; HANDLE dirhand; WIN32_FIND_DATA *entry; }; -ap_status_t file_cleanup(void *); -/*mode_t get_fileperms(ap_fileperms_t); +apr_status_t file_cleanup(void *); +/*mode_t get_fileperms(apr_fileperms_t); */ -APR_EXPORT(char *) ap_os_systemcase_filename(struct ap_pool_t *pCont, +APR_EXPORT(char *) ap_os_systemcase_filename(struct apr_pool_t *pCont, const char *szFile); -char * canonical_filename(struct ap_pool_t *pCont, const char *szFile); +char * canonical_filename(struct apr_pool_t *pCont, const char *szFile); -ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, +apr_status_t ap_create_nt_pipe(apr_file_t **in, apr_file_t **out, BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, - ap_pool_t *p); + apr_pool_t *p); #endif /* ! FILE_IO_H */ diff --git a/include/arch/win32/locks.h b/include/arch/win32/locks.h index 602c2eb673f..a7515f2382d 100644 --- a/include/arch/win32/locks.h +++ b/include/arch/win32/locks.h @@ -57,10 +57,10 @@ #include "apr_lock.h" -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; HANDLE mutex; CRITICAL_SECTION section; char *fname; diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 7a364850286..f02c112dcf7 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -90,8 +90,8 @@ typedef struct datastruct { struct datastruct *prev; } datastruct; -struct ap_other_child_rec_t { - struct ap_other_child_rec_t *next; +struct apr_other_child_rec_t { + struct apr_other_child_rec_t *next; int id; /* This is either a pid or tid depending on the platform */ void (*maintenance) (int, void *, int); void *data; @@ -170,7 +170,7 @@ AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( (hFile)); #define CancelIo ap_winapi_CancelIo -ap_status_t ap_get_oslevel(struct ap_pool_t *, ap_oslevel_e *); +apr_status_t ap_get_oslevel(struct apr_pool_t *, ap_oslevel_e *); #endif /* WIN32 */ #endif /* ! MISC_H */ diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 296127288f8..3d5897a6249 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -58,20 +58,20 @@ #include "apr_network_io.h" #include "apr_general.h" -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; SOCKET sock; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; size_t addr_len; - ap_interval_time_t timeout; - ap_int32_t disconnected; + apr_interval_time_t timeout; + apr_int32_t disconnected; int local_port_unknown; int local_interface_unknown; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; +struct apr_pollfd_t { + apr_pool_t *cntxt; fd_set *read; int numread; fd_set *write; @@ -80,7 +80,7 @@ struct ap_pollfd_t { int numexcept; }; -ap_status_t status_from_res_error(int); +apr_status_t status_from_res_error(int); #endif /* ! NETWORK_IO_H */ diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/threadproc.h index 936747783d9..24a140bb1e1 100644 --- a/include/arch/win32/threadproc.h +++ b/include/arch/win32/threadproc.h @@ -61,35 +61,35 @@ #define SHELL_PATH "cmd.exe" -struct ap_thread_t { - ap_pool_t *cntxt; +struct apr_thread_t { + apr_pool_t *cntxt; HANDLE td; - ap_int32_t cancel; - ap_int32_t cancel_how; + apr_int32_t cancel; + apr_int32_t cancel_how; }; -struct ap_threadattr_t { - ap_pool_t *cntxt; - ap_int32_t detach; +struct apr_threadattr_t { + apr_pool_t *cntxt; + apr_int32_t detach; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; DWORD key; }; -struct ap_procattr_t { - ap_pool_t *cntxt; +struct apr_procattr_t { + apr_pool_t *cntxt; STARTUPINFO si; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; }; #endif /* ! THREAD_PROC_H */ diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 1bd061a49b9..ad6f4754cb0 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -102,7 +102,7 @@ /* Details of the debugging options can now be found in the developer * section of the documentaion. */ -/* magic numbers --- min free bytes to consider a free ap_pool_t block useable, +/* magic numbers --- min free bytes to consider a free apr_pool_t block useable, * and the min amount to allocate if we have to go to malloc() */ #ifndef BLOCK_MINFREE @@ -166,7 +166,7 @@ union block_hdr { char *first_avail; #ifdef POOL_DEBUG union block_hdr *global_next; - ap_pool_t *owning_pool; + apr_pool_t *owning_pool; #endif /* POOL_DEBUG */ } h; }; @@ -188,15 +188,15 @@ union block_hdr { static union block_hdr *block_freelist = NULL; #if APR_HAS_THREADS -static ap_lock_t *alloc_mutex; -static ap_lock_t *spawn_mutex; +static apr_lock_t *alloc_mutex; +static apr_lock_t *spawn_mutex; #endif #ifdef POOL_DEBUG static char *known_stack_point; static int stack_direction; static union block_hdr *global_block_list; -#define FREE_POOL ((ap_pool_t *)(-1)) +#define FREE_POOL ((apr_pool_t *)(-1)) #endif /* POOL_DEBUG */ #ifdef ALLOC_STATS @@ -322,7 +322,7 @@ static void free_blocks(union block_hdr *blok) } #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif old_free_list = block_freelist; block_freelist = blok; @@ -372,7 +372,7 @@ static void free_blocks(union block_hdr *blok) #endif /* ALLOC_STATS */ #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif /* APR_HAS_THREADS */ #endif /* ALLOC_USE_MALLOC */ } @@ -417,9 +417,9 @@ static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) /* Accounting */ -static ap_size_t bytes_in_block_list(union block_hdr *blok) +static apr_size_t bytes_in_block_list(union block_hdr *blok) { - ap_size_t size = 0; + apr_size_t size = 0; while (blok) { size += blok->h.endp - (char *) (blok + 1); @@ -444,7 +444,7 @@ struct cleanup; static void run_cleanups(struct cleanup *c); static void free_proc_chain(struct process_chain *p); -static ap_pool_t *permanent_pool; +static apr_pool_t *permanent_pool; /* Each pool structure is allocated in the start of its own first block, * so we need to know how many bytes that is (once properly aligned...). @@ -453,27 +453,27 @@ static ap_pool_t *permanent_pool; * gets taken off the parent's sub-pool list... */ -#define POOL_HDR_CLICKS (1 + ((sizeof(struct ap_pool_t) - 1) / CLICK_SZ)) +#define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) +APR_EXPORT(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) { union block_hdr *blok; - ap_pool_t *new_pool; + apr_pool_t *new_pool; #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif blok = new_block(POOL_HDR_BYTES, apr_abort); - new_pool = (ap_pool_t *) blok->h.first_avail; + new_pool = (apr_pool_t *) blok->h.first_avail; blok->h.first_avail += POOL_HDR_BYTES; #ifdef POOL_DEBUG blok->h.owning_pool = new_pool; #endif - memset((char *) new_pool, '\0', sizeof(struct ap_pool_t)); + memset((char *) new_pool, '\0', sizeof(struct apr_pool_t)); new_pool->free_first_avail = blok->h.first_avail; new_pool->first = new_pool->last = blok; @@ -490,7 +490,7 @@ APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retc } #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif return new_pool; @@ -532,19 +532,19 @@ static void dump_stats(void) struct cleanup { const void *data; - ap_status_t (*plain_cleanup) (void *); - ap_status_t (*child_cleanup) (void *); + apr_status_t (*plain_cleanup) (void *); + apr_status_t (*child_cleanup) (void *); struct cleanup *next; }; -APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, const void *data, - ap_status_t (*plain_cleanup) (void *), - ap_status_t (*child_cleanup) (void *)) +APR_EXPORT(void) apr_register_cleanup(apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup) (void *), + apr_status_t (*child_cleanup) (void *)) { struct cleanup *c; if (p != NULL) { - c = (struct cleanup *) ap_palloc(p, sizeof(struct cleanup)); + c = (struct cleanup *) apr_palloc(p, sizeof(struct cleanup)); c->data = data; c->plain_cleanup = plain_cleanup; c->child_cleanup = child_cleanup; @@ -553,8 +553,8 @@ APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, const void *data, } } -APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, const void *data, - ap_status_t (*cleanup) (void *)) +APR_EXPORT(void) apr_kill_cleanup(apr_pool_t *p, const void *data, + apr_status_t (*cleanup) (void *)) { struct cleanup *c; struct cleanup **lastp; @@ -574,10 +574,10 @@ APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, const void *data, } } -APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)) +APR_EXPORT(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, + apr_status_t (*cleanup) (void *)) { - ap_kill_cleanup(p, data, cleanup); + apr_kill_cleanup(p, data, cleanup); return (*cleanup) (data); } @@ -597,7 +597,7 @@ static void run_child_cleanups(struct cleanup *c) } } -static void cleanup_pool_for_exec(ap_pool_t *p) +static void cleanup_pool_for_exec(apr_pool_t *p) { run_child_cleanups(p->cleanups); p->cleanups = NULL; @@ -607,7 +607,7 @@ static void cleanup_pool_for_exec(ap_pool_t *p) } } -APR_EXPORT(void) ap_cleanup_for_exec(void) +APR_EXPORT(void) apr_cleanup_for_exec(void) { #if !defined(WIN32) && !defined(OS2) /* @@ -623,16 +623,16 @@ APR_EXPORT(void) ap_cleanup_for_exec(void) #endif /* ndef WIN32 */ } -APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data) +APR_EXPORT_NONSTD(apr_status_t) apr_null_cleanup(void *data) { /* do nothing cleanup routine */ return APR_SUCCESS; } -ap_status_t ap_init_alloc(void) +apr_status_t apr_init_alloc(void) { #if APR_HAS_THREADS - ap_status_t status; + apr_status_t status; #endif #ifdef POOL_DEBUG char s; @@ -641,16 +641,16 @@ ap_status_t ap_init_alloc(void) stack_var_init(&s); #endif #if APR_HAS_THREADS - status = ap_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, NULL); if (status != APR_SUCCESS) { - ap_destroy_lock(alloc_mutex); + apr_destroy_lock(alloc_mutex); return status; } - status = ap_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, NULL); if (status != APR_SUCCESS) { - ap_destroy_lock(spawn_mutex); + apr_destroy_lock(spawn_mutex); return status; } #endif @@ -662,24 +662,24 @@ ap_status_t ap_init_alloc(void) return APR_SUCCESS; } -void ap_term_alloc(void) +void apr_term_alloc(void) { #if APR_HAS_THREADS - ap_destroy_lock(alloc_mutex); - ap_destroy_lock(spawn_mutex); + apr_destroy_lock(alloc_mutex); + apr_destroy_lock(spawn_mutex); #endif } -/* We only want to lock the mutex if we are being called from ap_clear_pool. +/* We only want to lock the mutex if we are being called from apr_clear_pool. * This is because if we also call this function from ap_destroy_real_pool, * which also locks the same mutex, and recursive locks aren't portable. * This way, we are garaunteed that we only lock this mutex once when calling * either one of these functions. */ -APR_EXPORT(void) ap_clear_pool(ap_pool_t *a) +APR_EXPORT(void) apr_clear_pool(apr_pool_t *a) { while (a->sub_pools) { - ap_destroy_pool(a->sub_pools); + apr_destroy_pool(a->sub_pools); } /* * Don't hold the mutex during cleanups. @@ -711,11 +711,11 @@ APR_EXPORT(void) ap_clear_pool(ap_pool_t *a) #endif } -APR_EXPORT(void) ap_destroy_pool(ap_pool_t *a) +APR_EXPORT(void) apr_destroy_pool(apr_pool_t *a) { - ap_clear_pool(a); + apr_clear_pool(a); #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif if (a->parent) { @@ -730,16 +730,16 @@ APR_EXPORT(void) ap_destroy_pool(ap_pool_t *a) } } #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif free_blocks(a->first); } -APR_EXPORT(ap_size_t) ap_bytes_in_pool(ap_pool_t *p) +APR_EXPORT(apr_size_t) apr_bytes_in_pool(apr_pool_t *p) { return bytes_in_block_list(p->first); } -APR_EXPORT(ap_size_t) ap_bytes_in_free_blocks(void) +APR_EXPORT(apr_size_t) apr_bytes_in_free_blocks(void) { return bytes_in_block_list(block_freelist); } @@ -762,7 +762,7 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts) +APR_EXPORT(apr_pool_t *) ap_find_pool(const void *ts) { const char *s = ts; union block_hdr **pb; @@ -808,7 +808,7 @@ APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts) /* return TRUE iff a is an ancestor of b * NULL is considered an ancestor of all pools */ -APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) +APR_EXPORT(int) ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) { if (a == NULL) { return 1; @@ -830,7 +830,7 @@ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub) +APR_EXPORT(void) ap_pool_join(apr_pool_t *p, apr_pool_t *sub) { union block_hdr *b; @@ -857,10 +857,10 @@ APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub) * Allocating stuff... */ -void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) +void * apr_palloc(apr_pool_t *a, apr_size_t reqsize) { #ifdef ALLOC_USE_MALLOC - ap_size_t size = reqsize + CLICK_SZ; + apr_size_t size = reqsize + CLICK_SZ; void *ptr; if (a == NULL) { @@ -884,8 +884,8 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) * Round up requested size to an even number of alignment units * (core clicks) */ - ap_size_t nclicks; - ap_size_t size; + apr_size_t nclicks; + apr_size_t size; /* First, see if we have space in the block most recently * allocated to this pool @@ -919,7 +919,7 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) if (new_first_avail <= blok->h.endp) { debug_verify_filled(first_avail, blok->h.endp, - "[ap_palloc] Ouch! Someone trounced past the end " + "[apr_palloc] Ouch! Someone trounced past the end " "of their allocation!\n"); blok->h.first_avail = new_first_avail; return (void *) first_avail; @@ -928,7 +928,7 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) /* Nope --- get a new one that's guaranteed to be big enough */ #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif blok = new_block(size, a->apr_abort); @@ -939,7 +939,7 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) #endif #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif first_avail = blok->h.first_avail; @@ -949,29 +949,29 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) #endif } -APR_EXPORT(void *) ap_pcalloc(ap_pool_t *a, ap_size_t size) +APR_EXPORT(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) { - void *res = ap_palloc(a, size); + void *res = apr_palloc(a, size); memset(res, '\0', size); return res; } /* - * ap_psprintf is implemented by writing directly into the current + * apr_psprintf is implemented by writing directly into the current * block of the pool, starting right at first_avail. If there's * insufficient room, then a new block is allocated and the earlier * output is copied over. The new block isn't linked into the pool * until all the output is done. * * Note that this is completely safe because nothing else can - * allocate in this ap_pool_t while ap_psprintf is running. alarms are + * allocate in this apr_pool_t while apr_psprintf is running. alarms are * blocked, and the only thing outside of alloc.c that's invoked - * is ap_vformatter -- which was purposefully written to be + * is apr_vformatter -- which was purposefully written to be * self-contained with no callouts. */ struct psprintf_data { - ap_vformatter_buff_t vbuff; + apr_vformatter_buff_t vbuff; #ifdef ALLOC_USE_MALLOC char *base; #else @@ -980,11 +980,11 @@ struct psprintf_data { #endif }; -static int psprintf_flush(ap_vformatter_buff_t *vbuff) +static int psprintf_flush(apr_vformatter_buff_t *vbuff) { struct psprintf_data *ps = (struct psprintf_data *)vbuff; #ifdef ALLOC_USE_MALLOC - ap_size_t size; + apr_size_t size; char *ptr; size = (char *)ps->vbuff.curpos - ps->base; @@ -1000,7 +1000,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) #else union block_hdr *blok; union block_hdr *nblok; - ap_size_t cur_len; + apr_size_t cur_len; char *strp; blok = ps->blok; @@ -1009,11 +1009,11 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) /* must try another blok */ #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif nblok = new_block(2 * cur_len, NULL); #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif memcpy(nblok->h.first_avail, blok->h.first_avail, cur_len); ps->vbuff.curpos = nblok->h.first_avail + cur_len; @@ -1024,12 +1024,12 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) if (ps->got_a_new_block) { debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif blok->h.next = block_freelist; block_freelist = blok; #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif } ps->blok = nblok; @@ -1042,7 +1042,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) #endif } -APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) +APR_EXPORT(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) { #ifdef ALLOC_USE_MALLOC struct psprintf_data ps; @@ -1056,7 +1056,7 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) /* need room at beginning for allocation_list */ ps.vbuff.curpos = ps.base + CLICK_SZ; ps.vbuff.endpos = ps.base + 511; - ap_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); + apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); *ps.vbuff.curpos++ = '\0'; ptr = ps.base; /* shrink */ @@ -1071,14 +1071,14 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) #else struct psprintf_data ps; char *strp; - ap_size_t size; + apr_size_t size; ps.blok = p->last; ps.vbuff.curpos = ps.blok->h.first_avail; ps.vbuff.endpos = ps.blok->h.endp - 1; /* save one for NUL */ ps.got_a_new_block = 0; - ap_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); + apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); strp = ps.vbuff.curpos; *strp++ = '\0'; @@ -1101,13 +1101,13 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) #endif } -APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) +APR_EXPORT_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) { va_list ap; char *res; va_start(ap, fmt); - res = ap_pvsprintf(p, fmt, ap); + res = apr_pvsprintf(p, fmt, ap); va_end(ap); return res; } @@ -1124,11 +1124,11 @@ APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -APR_EXPORT(void) ap_note_subprocess(ap_pool_t *a, ap_proc_t *pid, +APR_EXPORT(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) { struct process_chain *new = - (struct process_chain *) ap_palloc(a, sizeof(struct process_chain)); + (struct process_chain *) apr_palloc(a, sizeof(struct process_chain)); new->pid = pid; new->kill_how = how; @@ -1159,7 +1159,7 @@ static void free_proc_chain(struct process_chain *procs) #ifndef NEED_WAITPID /* Pick up all defunct processes */ for (p = procs; p; p = p->next) { - if (ap_wait_proc(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { + if (apr_wait_proc(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { p->kill_how = kill_never; } } @@ -1170,20 +1170,20 @@ static void free_proc_chain(struct process_chain *procs) || (p->kill_how == kill_only_once)) { /* * Subprocess may be dead already. Only need the timeout if not. - * Note: ap_kill on Windows is TerminateProcess(), which is + * Note: apr_kill on Windows is TerminateProcess(), which is * similar to a SIGKILL, so always give the process a timeout * under Windows before killing it. */ #ifdef WIN32 need_timeout = 1; #else - if (ap_kill(p->pid, APR_SIGTERM) == APR_SUCCESS) { + if (apr_kill(p->pid, APR_SIGTERM) == APR_SUCCESS) { need_timeout = 1; } #endif } else if (p->kill_how == kill_always) { - ap_kill(p->pid, APR_SIGKILL); + apr_kill(p->pid, APR_SIGKILL); } } @@ -1198,7 +1198,7 @@ static void free_proc_chain(struct process_chain *procs) */ for (p = procs; p; p = p->next) { if (p->kill_how == kill_after_timeout) { - ap_kill(p->pid, APR_SIGKILL); + apr_kill(p->pid, APR_SIGKILL); } } #ifdef WIN32 @@ -1215,7 +1215,7 @@ static void free_proc_chain(struct process_chain *procs) /* Now wait for all the signaled processes to die */ for (p = procs; p; p = p->next) { if (p->kill_how != kill_never) { - (void) ap_wait_proc(p->pid, APR_WAIT); + (void) apr_wait_proc(p->pid, APR_WAIT); } } } diff --git a/lib/apr_signal.c b/lib/apr_signal.c index 2285664cb4c..df13f7acee2 100644 --- a/lib/apr_signal.c +++ b/lib/apr_signal.c @@ -64,7 +64,7 @@ * from W. Richard Stevens' "Advanced Programming in the UNIX Environment" * (the version that does not automatically restart system calls). */ -Sigfunc *ap_signal(int signo, Sigfunc * func) +Sigfunc *apr_signal(int signo, Sigfunc * func) { struct sigaction act, oact; diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c index 8a27e0d6e10..ee541cfcb2e 100644 --- a/locks/beos/crossproc.c +++ b/locks/beos/crossproc.c @@ -54,9 +54,9 @@ #include "locks.h" -ap_status_t lock_inter_cleanup(void * data) +apr_status_t lock_inter_cleanup(void * data) { - ap_lock_t *lock = (ap_lock_t*)data; + apr_lock_t *lock = (apr_lock_t*)data; if (lock->curr_locked == 1) { if (atomic_add(&lock->ben_interproc , -1) > 1){ release_sem (lock->sem_interproc); @@ -66,12 +66,12 @@ ap_status_t lock_inter_cleanup(void * data) return APR_SUCCESS; } -ap_status_t create_inter_lock(ap_lock_t *new) +apr_status_t create_inter_lock(apr_lock_t *new) { int32 stat; - new->sem_interproc = (sem_id)ap_palloc(new->cntxt, sizeof(sem_id)); - new->ben_interproc = (int32)ap_palloc(new->cntxt, sizeof(int32)); + new->sem_interproc = (sem_id)apr_palloc(new->cntxt, sizeof(sem_id)); + new->ben_interproc = (int32)apr_palloc(new->cntxt, sizeof(int32)); if ((stat = create_sem(0, "ap_interproc")) < B_NO_ERROR) { lock_inter_cleanup(new); @@ -80,12 +80,12 @@ ap_status_t create_inter_lock(ap_lock_t *new) new->ben_interproc = 0; new->curr_locked = 0; new->sem_interproc = stat; - ap_register_cleanup(new->cntxt, (void *)new, lock_inter_cleanup, - ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_inter_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t lock_inter(ap_lock_t *lock) +apr_status_t lock_inter(apr_lock_t *lock) { int32 stat; @@ -99,7 +99,7 @@ ap_status_t lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t unlock_inter(ap_lock_t *lock) +apr_status_t unlock_inter(apr_lock_t *lock) { int32 stat; @@ -113,17 +113,17 @@ ap_status_t unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t destroy_inter_lock(ap_lock_t *lock) +apr_status_t destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_inter_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_inter_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_inter_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const char *fname) +apr_status_t child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { return APR_SUCCESS; } diff --git a/locks/beos/intraproc.c b/locks/beos/intraproc.c index 89bfc17bc01..93032f5614d 100644 --- a/locks/beos/intraproc.c +++ b/locks/beos/intraproc.c @@ -54,9 +54,9 @@ #include "locks.h" -ap_status_t lock_intra_cleanup(void *data) +apr_status_t lock_intra_cleanup(void *data) { - ap_lock_t *lock = (ap_lock_t *)data; + apr_lock_t *lock = (apr_lock_t *)data; if (lock->curr_locked == 1) { if (atomic_add(&lock->ben_intraproc , -1) > 1){ release_sem (lock->sem_intraproc); @@ -68,11 +68,11 @@ ap_status_t lock_intra_cleanup(void *data) return APR_SUCCESS; } -ap_status_t create_intra_lock(ap_lock_t *new) +apr_status_t create_intra_lock(apr_lock_t *new) { int32 stat; - new->sem_intraproc = (sem_id)ap_palloc(new->cntxt, sizeof(sem_id)); - new->ben_intraproc = (int32)ap_palloc(new->cntxt, sizeof(int32)); + new->sem_intraproc = (sem_id)apr_palloc(new->cntxt, sizeof(sem_id)); + new->ben_intraproc = (int32)apr_palloc(new->cntxt, sizeof(int32)); if ((stat = create_sem(0, "ap_intraproc")) < B_NO_ERROR){ @@ -82,12 +82,12 @@ ap_status_t create_intra_lock(ap_lock_t *new) new->ben_intraproc = 0; new->sem_intraproc = stat; new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, - ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t lock_intra(ap_lock_t *lock) +apr_status_t lock_intra(apr_lock_t *lock) { int32 stat; @@ -101,7 +101,7 @@ ap_status_t lock_intra(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t unlock_intra(ap_lock_t *lock) +apr_status_t unlock_intra(apr_lock_t *lock) { int32 stat; @@ -115,11 +115,11 @@ ap_status_t unlock_intra(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t destroy_intra_lock(ap_lock_t *lock) +apr_status_t destroy_intra_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); return APR_SUCCESS; } return stat; diff --git a/locks/beos/locks.c b/locks/beos/locks.c index 18c9ebea9c9..37dbd236e9f 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -54,14 +54,14 @@ #include "locks.h" -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, - ap_lockscope_e scope, const char *fname, - ap_pool_t *cont) +apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, const char *fname, + apr_pool_t *cont) { - ap_lock_t *new; - ap_status_t stat; + apr_lock_t *new; + apr_status_t stat; - new = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); if (new == NULL){ return APR_ENOMEM; } @@ -69,7 +69,7 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, new->cntxt = cont; new->type = type; new->scope = scope; - new->fname = ap_pstrdup(cont, fname); + new->fname = apr_pstrdup(cont, fname); if (scope != APR_CROSS_PROCESS) { if ((stat = create_intra_lock(new)) != APR_SUCCESS) { @@ -85,9 +85,9 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, return APR_SUCCESS; } -ap_status_t ap_lock(ap_lock_t *lock) +apr_status_t apr_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { if ((stat = lock_intra(lock)) != APR_SUCCESS) { @@ -102,9 +102,9 @@ ap_status_t ap_lock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unlock(ap_lock_t *lock) +apr_status_t apr_unlock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { if ((stat = unlock_intra(lock)) != APR_SUCCESS) { return stat; @@ -118,9 +118,9 @@ ap_status_t ap_unlock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_destroy_lock(ap_lock_t *lock) +apr_status_t apr_destroy_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { if ((stat = destroy_intra_lock(lock)) != APR_SUCCESS) { return stat; @@ -134,10 +134,10 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont) +apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, + apr_pool_t *cont) { - ap_status_t stat; + apr_status_t stat; if ((*lock)->scope != APR_CROSS_PROCESS) { if ((stat = child_init_lock(lock, cont, fname)) != APR_SUCCESS) { return stat; @@ -146,14 +146,14 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, return APR_SUCCESS; } -ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) +apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) { - return ap_get_userdata(data, key, lock->cntxt); + return apr_get_userdata(data, key, lock->cntxt); } -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, lock->cntxt); + return apr_set_userdata(data, key, cleanup, lock->cntxt); } diff --git a/locks/beos/locks.h b/locks/beos/locks.h index fefc0d30ae9..685f8a89b83 100644 --- a/locks/beos/locks.h +++ b/locks/beos/locks.h @@ -61,10 +61,10 @@ #include "apr_general.h" #include "apr_lib.h" -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; int curr_locked; char *fname; /* Inter proc */ @@ -75,17 +75,17 @@ struct ap_lock_t { int32 ben_intraproc; }; -ap_status_t create_intra_lock(struct ap_lock_t *new); -ap_status_t lock_intra(struct ap_lock_t *lock); -ap_status_t unlock_intra(struct ap_lock_t *lock); -ap_status_t destroy_intra_lock(struct ap_lock_t *lock); +apr_status_t create_intra_lock(struct apr_lock_t *new); +apr_status_t lock_intra(struct apr_lock_t *lock); +apr_status_t unlock_intra(struct apr_lock_t *lock); +apr_status_t destroy_intra_lock(struct apr_lock_t *lock); -ap_status_t create_inter_lock(struct ap_lock_t *new); -ap_status_t lock_inter(struct ap_lock_t *lock); -ap_status_t unlock_inter(struct ap_lock_t *lock); -ap_status_t destroy_inter_lock(struct ap_lock_t *lock); +apr_status_t create_inter_lock(struct apr_lock_t *new); +apr_status_t lock_inter(struct apr_lock_t *lock); +apr_status_t unlock_inter(struct apr_lock_t *lock); +apr_status_t destroy_inter_lock(struct apr_lock_t *lock); -ap_status_t child_init_lock(struct ap_lock_t **lock, ap_pool_t *cont, +apr_status_t child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, const char *fname); diff --git a/locks/os2/locks.c b/locks/os2/locks.c index dc288b6c9c5..60184795aa0 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -69,54 +69,54 @@ void setup_lock() -static ap_status_t lock_cleanup(void *thelock) +static apr_status_t lock_cleanup(void *thelock) { - ap_lock_t *lock = thelock; - return ap_destroy_lock(lock); + apr_lock_t *lock = thelock; + return apr_destroy_lock(lock); } -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, ap_lockscope_e scope, - const char *fname, ap_pool_t *cont) +apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, + const char *fname, apr_pool_t *cont) { - ap_lock_t *new; + apr_lock_t *new; ULONG rc; char *semname; PIB *ppib; - new = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); new->cntxt = cont; new->type = type; new->scope = scope; new->owner = 0; new->lock_count = 0; - new->fname = ap_pstrdup(cont, fname); + new->fname = apr_pstrdup(cont, fname); DosGetInfoBlocks(&(new->tib), &ppib); if (fname == NULL) semname = NULL; else - semname = ap_pstrcat(cont, "/SEM32/", fname, NULL); + semname = apr_pstrcat(cont, "/SEM32/", fname, NULL); rc = DosCreateMutexSem(semname, &(new->hMutex), scope == APR_CROSS_PROCESS ? DC_SEM_SHARED : 0, FALSE); *lock = new; if (!rc) - ap_register_cleanup(cont, new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(cont, new, lock_cleanup, apr_null_cleanup); return APR_OS2_STATUS(rc); } -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont) +apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, + apr_pool_t *cont) { int rc; PIB *ppib; - *lock = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + *lock = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); if (lock == NULL) return APR_ENOMEM; @@ -127,14 +127,14 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, rc = DosOpenMutexSem( (char *)fname, &(*lock)->hMutex ); if (!rc) - ap_register_cleanup(cont, *lock, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(cont, *lock, lock_cleanup, apr_null_cleanup); return APR_OS2_STATUS(rc); } -ap_status_t ap_lock(ap_lock_t *lock) +apr_status_t apr_lock(apr_lock_t *lock) { ULONG rc; @@ -150,7 +150,7 @@ ap_status_t ap_lock(ap_lock_t *lock) -ap_status_t ap_unlock(ap_lock_t *lock) +apr_status_t apr_unlock(apr_lock_t *lock) { ULONG rc; @@ -165,14 +165,14 @@ ap_status_t ap_unlock(ap_lock_t *lock) -ap_status_t ap_destroy_lock(ap_lock_t *lock) +apr_status_t apr_destroy_lock(apr_lock_t *lock) { ULONG rc; - ap_status_t stat = APR_SUCCESS; + apr_status_t stat = APR_SUCCESS; if (lock->owner == CurrentTid) { while (lock->lock_count > 0 && stat == APR_SUCCESS) - stat = ap_unlock(lock); + stat = apr_unlock(lock); } if (stat != APR_SUCCESS) diff --git a/locks/os2/locks.h b/locks/os2/locks.h index d416b6b0833..50ffdc65216 100644 --- a/locks/os2/locks.h +++ b/locks/os2/locks.h @@ -60,10 +60,10 @@ #define INCL_DOS #include -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; char *fname; HMTX hMutex; TID owner; diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 556e8443f8a..f140183e156 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -61,7 +61,7 @@ static struct sembuf op_on; static struct sembuf op_off; -void ap_unix_setup_lock(void) +void apr_unix_setup_lock(void) { op_on.sem_num = 0; op_on.sem_op = -1; @@ -71,9 +71,9 @@ void ap_unix_setup_lock(void) op_off.sem_flg = SEM_UNDO; } -static ap_status_t lock_cleanup(void *lock_) +static apr_status_t lock_cleanup(void *lock_) { - ap_lock_t *lock=lock_; + apr_lock_t *lock=lock_; union semun ick; if (lock->interproc != -1) { @@ -83,7 +83,7 @@ static ap_status_t lock_cleanup(void *lock_) return APR_SUCCESS; } -ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) +apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) { union semun ick; @@ -99,11 +99,11 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) return errno; } new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_inter(ap_lock_t *lock) +apr_status_t apr_unix_lock_inter(apr_lock_t *lock) { int rc; @@ -117,7 +117,7 @@ ap_status_t ap_unix_lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) +apr_status_t apr_unix_unlock_inter(apr_lock_t *lock) { int rc; @@ -131,32 +131,32 @@ ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_destroy_inter_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const char *fname) +apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { return APR_SUCCESS; } #elif (APR_USE_PROC_PTHREAD_SERIALIZE) -void ap_unix_setup_lock(void) +void apr_unix_setup_lock(void) { } -static ap_status_t lock_cleanup(void *lock_) +static apr_status_t lock_cleanup(void *lock_) { - ap_lock_t *lock=lock_; - ap_status_t stat; + apr_lock_t *lock=lock_; + apr_status_t stat; if (lock->curr_locked == 1) { if ((stat = pthread_mutex_unlock(lock->interproc))) { @@ -172,9 +172,9 @@ static ap_status_t lock_cleanup(void *lock_) return APR_SUCCESS; } -ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) +apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) { - ap_status_t stat; + apr_status_t stat; int fd; pthread_mutexattr_t mattr; @@ -222,13 +222,13 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) } new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_inter(ap_lock_t *lock) +apr_status_t apr_unix_lock_inter(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = pthread_mutex_lock(lock->interproc))) { #ifdef PTHREAD_SETS_ERRNO @@ -240,9 +240,9 @@ ap_status_t ap_unix_lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) +apr_status_t apr_unix_unlock_inter(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = pthread_mutex_unlock(lock->interproc))) { #ifdef PTHREAD_SETS_ERRNO @@ -254,17 +254,17 @@ ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_destroy_inter_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const char *fname) +apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { return APR_SUCCESS; } @@ -274,7 +274,7 @@ ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const cha static struct flock lock_it; static struct flock unlock_it; -void ap_unix_setup_lock(void) +void apr_unix_setup_lock(void) { lock_it.l_whence = SEEK_SET; /* from current point */ lock_it.l_start = 0; /* -"- */ @@ -288,23 +288,23 @@ void ap_unix_setup_lock(void) unlock_it.l_pid = 0; /* pid not actually interesting */ } -static ap_status_t lock_cleanup(void *lock_) +static apr_status_t lock_cleanup(void *lock_) { - ap_lock_t *lock=lock_; + apr_lock_t *lock=lock_; if (lock->curr_locked == 1) { - return ap_unix_unlock_inter(lock); + return apr_unix_unlock_inter(lock); } return APR_SUCCESS; } -ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) +apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) { if (new->fname) { new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644); } else { - new->fname = ap_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); + new->fname = apr_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); new->interproc = mkstemp(new->fname); } @@ -315,11 +315,11 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) new->curr_locked=0; unlink(new->fname); - ap_register_cleanup(new->cntxt, new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(new->cntxt, new, lock_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_inter(ap_lock_t *lock) +apr_status_t apr_unix_lock_inter(apr_lock_t *lock) { int rc; @@ -333,7 +333,7 @@ ap_status_t ap_unix_lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) +apr_status_t apr_unix_unlock_inter(apr_lock_t *lock) { int rc; @@ -347,17 +347,17 @@ ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_destroy_inter_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, +apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { return APR_SUCCESS; @@ -365,28 +365,28 @@ ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, #elif (APR_USE_FLOCK_SERIALIZE) -void ap_unix_setup_lock(void) +void apr_unix_setup_lock(void) { } -static ap_status_t lock_cleanup(void *lock_) +static apr_status_t lock_cleanup(void *lock_) { - ap_lock_t *lock=lock_; + apr_lock_t *lock=lock_; if (lock->curr_locked == 1) { - return ap_unix_unlock_inter(lock); + return apr_unix_unlock_inter(lock); } unlink(lock->fname); return APR_SUCCESS; } -ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) +apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) { if (new->fname) { new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600); } else { - new->fname = ap_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); + new->fname = apr_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); new->interproc = mkstemp(new->fname); } @@ -395,11 +395,11 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) return errno; } new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_inter(ap_lock_t *lock) +apr_status_t apr_unix_lock_inter(apr_lock_t *lock) { int rc; @@ -413,7 +413,7 @@ ap_status_t ap_unix_lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) +apr_status_t apr_unix_unlock_inter(apr_lock_t *lock) { int rc; @@ -427,27 +427,27 @@ ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_destroy_inter_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, +apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { - ap_lock_t *new; + apr_lock_t *new; - new = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); - new->fname = ap_pstrdup(cont, fname); + new->fname = apr_pstrdup(cont, fname); new->interproc = open(new->fname, O_WRONLY, 0600); if (new->interproc == -1) { - ap_unix_destroy_inter_lock(new); + apr_unix_destroy_inter_lock(new); return errno; } *lock = new; diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index e598e56e357..3b5b9a97ed9 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -58,10 +58,10 @@ #if (APR_USE_PTHREAD_SERIALIZE) -static ap_status_t lock_intra_cleanup(void *data) +static apr_status_t lock_intra_cleanup(void *data) { - ap_lock_t *lock = (ap_lock_t *) data; - ap_status_t stat; + apr_lock_t *lock = (apr_lock_t *) data; + apr_status_t stat; stat = pthread_mutex_unlock(lock->intraproc); #ifdef PTHREAD_SETS_ERRNO @@ -72,12 +72,12 @@ static ap_status_t lock_intra_cleanup(void *data) return stat; } -ap_status_t ap_unix_create_intra_lock(ap_lock_t *new) +apr_status_t apr_unix_create_intra_lock(apr_lock_t *new) { - ap_status_t stat; + apr_status_t stat; pthread_mutexattr_t mattr; - new->intraproc = (pthread_mutex_t *)ap_palloc(new->cntxt, + new->intraproc = (pthread_mutex_t *)apr_palloc(new->cntxt, sizeof(pthread_mutex_t)); if (new->intraproc == NULL ) { return errno; @@ -107,14 +107,14 @@ ap_status_t ap_unix_create_intra_lock(ap_lock_t *new) } new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, - ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_intra(ap_lock_t *lock) +apr_status_t apr_unix_lock_intra(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; stat = pthread_mutex_lock(lock->intraproc); #ifdef PTHREAD_SETS_ERRNO @@ -125,9 +125,9 @@ ap_status_t ap_unix_lock_intra(ap_lock_t *lock) return stat; } -ap_status_t ap_unix_unlock_intra(ap_lock_t *lock) +apr_status_t apr_unix_unlock_intra(apr_lock_t *lock) { - ap_status_t status; + apr_status_t status; status = pthread_mutex_unlock(lock->intraproc); #ifdef PTHREAD_SETS_ERRNO @@ -138,11 +138,11 @@ ap_status_t ap_unix_unlock_intra(ap_lock_t *lock) return status; } -ap_status_t ap_unix_destroy_intra_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_intra_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); return APR_SUCCESS; } return stat; diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 3e25cc67e22..44feb31fa7b 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -56,14 +56,14 @@ #include "apr_strings.h" #include "apr_portable.h" -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, - ap_lockscope_e scope, const char *fname, - ap_pool_t *cont) +apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, const char *fname, + apr_pool_t *cont) { - ap_lock_t *new; - ap_status_t stat; + apr_lock_t *new; + apr_status_t stat; - new = (ap_lock_t *)ap_pcalloc(cont, sizeof(ap_lock_t)); + new = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t)); new->cntxt = cont; new->type = type; @@ -72,14 +72,14 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, /* file-based serialization primitives */ if (scope != APR_INTRAPROCESS) { if (fname != NULL) { - new->fname = ap_pstrdup(cont, fname); + new->fname = apr_pstrdup(cont, fname); } } #endif if (scope != APR_CROSS_PROCESS) { #if APR_HAS_THREADS - if ((stat = ap_unix_create_intra_lock(new)) != APR_SUCCESS) { + if ((stat = apr_unix_create_intra_lock(new)) != APR_SUCCESS) { return stat; } #else @@ -87,7 +87,7 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, #endif } if (scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_create_inter_lock(new)) != APR_SUCCESS) { + if ((stat = apr_unix_create_inter_lock(new)) != APR_SUCCESS) { return stat; } } @@ -95,12 +95,12 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, return APR_SUCCESS; } -ap_status_t ap_lock(ap_lock_t *lock) +apr_status_t apr_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { #if APR_HAS_THREADS - if ((stat = ap_unix_lock_intra(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_lock_intra(lock)) != APR_SUCCESS) { return stat; } #else @@ -108,20 +108,20 @@ ap_status_t ap_lock(ap_lock_t *lock) #endif } if (lock->scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_lock_inter(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_lock_inter(lock)) != APR_SUCCESS) { return stat; } } return APR_SUCCESS; } -ap_status_t ap_unlock(ap_lock_t *lock) +apr_status_t apr_unlock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { #if APR_HAS_THREADS - if ((stat = ap_unix_unlock_intra(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_unlock_intra(lock)) != APR_SUCCESS) { return stat; } #else @@ -129,19 +129,19 @@ ap_status_t ap_unlock(ap_lock_t *lock) #endif } if (lock->scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_unlock_inter(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_unlock_inter(lock)) != APR_SUCCESS) { return stat; } } return APR_SUCCESS; } -ap_status_t ap_destroy_lock(ap_lock_t *lock) +apr_status_t apr_destroy_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { #if APR_HAS_THREADS - if ((stat = ap_unix_destroy_intra_lock(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_destroy_intra_lock(lock)) != APR_SUCCESS) { return stat; } #else @@ -149,37 +149,37 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock) #endif } if (lock->scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_destroy_inter_lock(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_destroy_inter_lock(lock)) != APR_SUCCESS) { return stat; } } return APR_SUCCESS; } -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont) +apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, + apr_pool_t *cont) { - ap_status_t stat; + apr_status_t stat; if ((*lock)->scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_child_init_lock(lock, cont, fname)) != APR_SUCCESS) { + if ((stat = apr_unix_child_init_lock(lock, cont, fname)) != APR_SUCCESS) { return stat; } } return APR_SUCCESS; } -ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) +apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) { - return ap_get_userdata(data, key, lock->cntxt); + return apr_get_userdata(data, key, lock->cntxt); } -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, lock->cntxt); + return apr_set_userdata(data, key, cleanup, lock->cntxt); } -ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock) +apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) { oslock->crossproc = lock->interproc; #if APR_HAS_THREADS @@ -191,14 +191,14 @@ ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, - ap_pool_t *cont) +apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*lock) == NULL) { - (*lock) = (ap_lock_t *)ap_pcalloc(cont, sizeof(ap_lock_t)); + (*lock) = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t)); (*lock)->cntxt = cont; } (*lock)->interproc = thelock->crossproc; diff --git a/locks/unix/locks.h b/locks/unix/locks.h index d6ecae5dbb6..321cdd18a78 100644 --- a/locks/unix/locks.h +++ b/locks/unix/locks.h @@ -112,10 +112,10 @@ union semun { }; #endif -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; int curr_locked; char *fname; #if APR_USE_SYSVSEM_SERIALIZE @@ -142,19 +142,19 @@ struct ap_lock_t { }; #if APR_HAS_THREADS -ap_status_t ap_unix_create_intra_lock(struct ap_lock_t *new); -ap_status_t ap_unix_lock_intra(struct ap_lock_t *lock); -ap_status_t ap_unix_unlock_intra(struct ap_lock_t *lock); -ap_status_t ap_unix_destroy_intra_lock(struct ap_lock_t *lock); +apr_status_t apr_unix_create_intra_lock(struct apr_lock_t *new); +apr_status_t apr_unix_lock_intra(struct apr_lock_t *lock); +apr_status_t apr_unix_unlock_intra(struct apr_lock_t *lock); +apr_status_t apr_unix_destroy_intra_lock(struct apr_lock_t *lock); #endif -void ap_unix_setup_lock(void); -ap_status_t ap_unix_create_inter_lock(struct ap_lock_t *new); -ap_status_t ap_unix_lock_inter(struct ap_lock_t *lock); -ap_status_t ap_unix_unlock_inter(struct ap_lock_t *lock); -ap_status_t ap_unix_destroy_inter_lock(struct ap_lock_t *lock); +void apr_unix_setup_lock(void); +apr_status_t apr_unix_create_inter_lock(struct apr_lock_t *new); +apr_status_t apr_unix_lock_inter(struct apr_lock_t *lock); +apr_status_t apr_unix_unlock_inter(struct apr_lock_t *lock); +apr_status_t apr_unix_destroy_inter_lock(struct apr_lock_t *lock); -ap_status_t ap_unix_child_init_lock(struct ap_lock_t **lock, ap_pool_t *cont, +apr_status_t apr_unix_child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, const char *fname); #endif /* LOCKS_H */ diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 22f53b7b576..f499be5cf8a 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -57,20 +57,20 @@ #include "locks.h" #include "apr_portable.h" -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, - ap_lockscope_e scope, const char *fname, - ap_pool_t *cont) +apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, const char *fname, + apr_pool_t *cont) { - ap_lock_t *newlock; + apr_lock_t *newlock; SECURITY_ATTRIBUTES sec; - newlock = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + newlock = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); newlock->cntxt = cont; /* ToDo: How to handle the case when no context is available? * How to cleanup the storage properly? */ - newlock->fname = ap_pstrdup(cont, fname); + newlock->fname = apr_pstrdup(cont, fname); newlock->type = type; newlock->scope = scope; sec.nLength = sizeof(SECURITY_ATTRIBUTES); @@ -92,18 +92,18 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, return APR_SUCCESS; } -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont) +apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, + apr_pool_t *cont) { /* This routine should not be called (and OpenMutex will fail if called) * on a INTRAPROCESS lock */ - (*lock) = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + (*lock) = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); if ((*lock) == NULL) { return APR_ENOMEM; } - (*lock)->fname = ap_pstrdup(cont, fname); + (*lock)->fname = apr_pstrdup(cont, fname); (*lock)->mutex = OpenMutex(MUTEX_ALL_ACCESS, TRUE, fname); if ((*lock)->mutex == NULL) { @@ -112,7 +112,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, return APR_SUCCESS; } -ap_status_t ap_lock(ap_lock_t *lock) +apr_status_t apr_lock(apr_lock_t *lock) { DWORD rv; if (lock->scope == APR_INTRAPROCESS) { @@ -128,7 +128,7 @@ ap_status_t ap_lock(ap_lock_t *lock) return GetLastError(); } -ap_status_t ap_unlock(ap_lock_t *lock) +apr_status_t apr_unlock(apr_lock_t *lock) { if (lock->scope == APR_INTRAPROCESS) { LeaveCriticalSection(&lock->section); @@ -141,7 +141,7 @@ ap_status_t ap_unlock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_destroy_lock(ap_lock_t *lock) +apr_status_t apr_destroy_lock(apr_lock_t *lock) { if (lock->scope == APR_INTRAPROCESS) { DeleteCriticalSection(&lock->section); @@ -154,31 +154,31 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) +apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) { - return ap_get_userdata(data, key, lock->cntxt); + return apr_get_userdata(data, key, lock->cntxt); } -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, lock->cntxt); + return apr_set_userdata(data, key, cleanup, lock->cntxt); } -ap_status_t ap_get_os_lock(ap_os_lock_t *thelock, ap_lock_t *lock) +apr_status_t apr_get_os_lock(apr_os_lock_t *thelock, apr_lock_t *lock) { *thelock = lock->mutex; return APR_SUCCESS; } -ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, - ap_pool_t *cont) +apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*lock) == NULL) { - (*lock) = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + (*lock) = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); (*lock)->cntxt = cont; } (*lock)->mutex = *thelock; diff --git a/locks/win32/locks.h b/locks/win32/locks.h index 602c2eb673f..a7515f2382d 100644 --- a/locks/win32/locks.h +++ b/locks/win32/locks.h @@ -57,10 +57,10 @@ #include "apr_lock.h" -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; HANDLE mutex; CRITICAL_SECTION section; char *fname; diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 1bd061a49b9..ad6f4754cb0 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -102,7 +102,7 @@ /* Details of the debugging options can now be found in the developer * section of the documentaion. */ -/* magic numbers --- min free bytes to consider a free ap_pool_t block useable, +/* magic numbers --- min free bytes to consider a free apr_pool_t block useable, * and the min amount to allocate if we have to go to malloc() */ #ifndef BLOCK_MINFREE @@ -166,7 +166,7 @@ union block_hdr { char *first_avail; #ifdef POOL_DEBUG union block_hdr *global_next; - ap_pool_t *owning_pool; + apr_pool_t *owning_pool; #endif /* POOL_DEBUG */ } h; }; @@ -188,15 +188,15 @@ union block_hdr { static union block_hdr *block_freelist = NULL; #if APR_HAS_THREADS -static ap_lock_t *alloc_mutex; -static ap_lock_t *spawn_mutex; +static apr_lock_t *alloc_mutex; +static apr_lock_t *spawn_mutex; #endif #ifdef POOL_DEBUG static char *known_stack_point; static int stack_direction; static union block_hdr *global_block_list; -#define FREE_POOL ((ap_pool_t *)(-1)) +#define FREE_POOL ((apr_pool_t *)(-1)) #endif /* POOL_DEBUG */ #ifdef ALLOC_STATS @@ -322,7 +322,7 @@ static void free_blocks(union block_hdr *blok) } #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif old_free_list = block_freelist; block_freelist = blok; @@ -372,7 +372,7 @@ static void free_blocks(union block_hdr *blok) #endif /* ALLOC_STATS */ #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif /* APR_HAS_THREADS */ #endif /* ALLOC_USE_MALLOC */ } @@ -417,9 +417,9 @@ static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) /* Accounting */ -static ap_size_t bytes_in_block_list(union block_hdr *blok) +static apr_size_t bytes_in_block_list(union block_hdr *blok) { - ap_size_t size = 0; + apr_size_t size = 0; while (blok) { size += blok->h.endp - (char *) (blok + 1); @@ -444,7 +444,7 @@ struct cleanup; static void run_cleanups(struct cleanup *c); static void free_proc_chain(struct process_chain *p); -static ap_pool_t *permanent_pool; +static apr_pool_t *permanent_pool; /* Each pool structure is allocated in the start of its own first block, * so we need to know how many bytes that is (once properly aligned...). @@ -453,27 +453,27 @@ static ap_pool_t *permanent_pool; * gets taken off the parent's sub-pool list... */ -#define POOL_HDR_CLICKS (1 + ((sizeof(struct ap_pool_t) - 1) / CLICK_SZ)) +#define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) +APR_EXPORT(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) { union block_hdr *blok; - ap_pool_t *new_pool; + apr_pool_t *new_pool; #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif blok = new_block(POOL_HDR_BYTES, apr_abort); - new_pool = (ap_pool_t *) blok->h.first_avail; + new_pool = (apr_pool_t *) blok->h.first_avail; blok->h.first_avail += POOL_HDR_BYTES; #ifdef POOL_DEBUG blok->h.owning_pool = new_pool; #endif - memset((char *) new_pool, '\0', sizeof(struct ap_pool_t)); + memset((char *) new_pool, '\0', sizeof(struct apr_pool_t)); new_pool->free_first_avail = blok->h.first_avail; new_pool->first = new_pool->last = blok; @@ -490,7 +490,7 @@ APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retc } #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif return new_pool; @@ -532,19 +532,19 @@ static void dump_stats(void) struct cleanup { const void *data; - ap_status_t (*plain_cleanup) (void *); - ap_status_t (*child_cleanup) (void *); + apr_status_t (*plain_cleanup) (void *); + apr_status_t (*child_cleanup) (void *); struct cleanup *next; }; -APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, const void *data, - ap_status_t (*plain_cleanup) (void *), - ap_status_t (*child_cleanup) (void *)) +APR_EXPORT(void) apr_register_cleanup(apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup) (void *), + apr_status_t (*child_cleanup) (void *)) { struct cleanup *c; if (p != NULL) { - c = (struct cleanup *) ap_palloc(p, sizeof(struct cleanup)); + c = (struct cleanup *) apr_palloc(p, sizeof(struct cleanup)); c->data = data; c->plain_cleanup = plain_cleanup; c->child_cleanup = child_cleanup; @@ -553,8 +553,8 @@ APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, const void *data, } } -APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, const void *data, - ap_status_t (*cleanup) (void *)) +APR_EXPORT(void) apr_kill_cleanup(apr_pool_t *p, const void *data, + apr_status_t (*cleanup) (void *)) { struct cleanup *c; struct cleanup **lastp; @@ -574,10 +574,10 @@ APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, const void *data, } } -APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)) +APR_EXPORT(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, + apr_status_t (*cleanup) (void *)) { - ap_kill_cleanup(p, data, cleanup); + apr_kill_cleanup(p, data, cleanup); return (*cleanup) (data); } @@ -597,7 +597,7 @@ static void run_child_cleanups(struct cleanup *c) } } -static void cleanup_pool_for_exec(ap_pool_t *p) +static void cleanup_pool_for_exec(apr_pool_t *p) { run_child_cleanups(p->cleanups); p->cleanups = NULL; @@ -607,7 +607,7 @@ static void cleanup_pool_for_exec(ap_pool_t *p) } } -APR_EXPORT(void) ap_cleanup_for_exec(void) +APR_EXPORT(void) apr_cleanup_for_exec(void) { #if !defined(WIN32) && !defined(OS2) /* @@ -623,16 +623,16 @@ APR_EXPORT(void) ap_cleanup_for_exec(void) #endif /* ndef WIN32 */ } -APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data) +APR_EXPORT_NONSTD(apr_status_t) apr_null_cleanup(void *data) { /* do nothing cleanup routine */ return APR_SUCCESS; } -ap_status_t ap_init_alloc(void) +apr_status_t apr_init_alloc(void) { #if APR_HAS_THREADS - ap_status_t status; + apr_status_t status; #endif #ifdef POOL_DEBUG char s; @@ -641,16 +641,16 @@ ap_status_t ap_init_alloc(void) stack_var_init(&s); #endif #if APR_HAS_THREADS - status = ap_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, NULL); if (status != APR_SUCCESS) { - ap_destroy_lock(alloc_mutex); + apr_destroy_lock(alloc_mutex); return status; } - status = ap_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, NULL); if (status != APR_SUCCESS) { - ap_destroy_lock(spawn_mutex); + apr_destroy_lock(spawn_mutex); return status; } #endif @@ -662,24 +662,24 @@ ap_status_t ap_init_alloc(void) return APR_SUCCESS; } -void ap_term_alloc(void) +void apr_term_alloc(void) { #if APR_HAS_THREADS - ap_destroy_lock(alloc_mutex); - ap_destroy_lock(spawn_mutex); + apr_destroy_lock(alloc_mutex); + apr_destroy_lock(spawn_mutex); #endif } -/* We only want to lock the mutex if we are being called from ap_clear_pool. +/* We only want to lock the mutex if we are being called from apr_clear_pool. * This is because if we also call this function from ap_destroy_real_pool, * which also locks the same mutex, and recursive locks aren't portable. * This way, we are garaunteed that we only lock this mutex once when calling * either one of these functions. */ -APR_EXPORT(void) ap_clear_pool(ap_pool_t *a) +APR_EXPORT(void) apr_clear_pool(apr_pool_t *a) { while (a->sub_pools) { - ap_destroy_pool(a->sub_pools); + apr_destroy_pool(a->sub_pools); } /* * Don't hold the mutex during cleanups. @@ -711,11 +711,11 @@ APR_EXPORT(void) ap_clear_pool(ap_pool_t *a) #endif } -APR_EXPORT(void) ap_destroy_pool(ap_pool_t *a) +APR_EXPORT(void) apr_destroy_pool(apr_pool_t *a) { - ap_clear_pool(a); + apr_clear_pool(a); #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif if (a->parent) { @@ -730,16 +730,16 @@ APR_EXPORT(void) ap_destroy_pool(ap_pool_t *a) } } #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif free_blocks(a->first); } -APR_EXPORT(ap_size_t) ap_bytes_in_pool(ap_pool_t *p) +APR_EXPORT(apr_size_t) apr_bytes_in_pool(apr_pool_t *p) { return bytes_in_block_list(p->first); } -APR_EXPORT(ap_size_t) ap_bytes_in_free_blocks(void) +APR_EXPORT(apr_size_t) apr_bytes_in_free_blocks(void) { return bytes_in_block_list(block_freelist); } @@ -762,7 +762,7 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts) +APR_EXPORT(apr_pool_t *) ap_find_pool(const void *ts) { const char *s = ts; union block_hdr **pb; @@ -808,7 +808,7 @@ APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts) /* return TRUE iff a is an ancestor of b * NULL is considered an ancestor of all pools */ -APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) +APR_EXPORT(int) ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) { if (a == NULL) { return 1; @@ -830,7 +830,7 @@ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub) +APR_EXPORT(void) ap_pool_join(apr_pool_t *p, apr_pool_t *sub) { union block_hdr *b; @@ -857,10 +857,10 @@ APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub) * Allocating stuff... */ -void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) +void * apr_palloc(apr_pool_t *a, apr_size_t reqsize) { #ifdef ALLOC_USE_MALLOC - ap_size_t size = reqsize + CLICK_SZ; + apr_size_t size = reqsize + CLICK_SZ; void *ptr; if (a == NULL) { @@ -884,8 +884,8 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) * Round up requested size to an even number of alignment units * (core clicks) */ - ap_size_t nclicks; - ap_size_t size; + apr_size_t nclicks; + apr_size_t size; /* First, see if we have space in the block most recently * allocated to this pool @@ -919,7 +919,7 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) if (new_first_avail <= blok->h.endp) { debug_verify_filled(first_avail, blok->h.endp, - "[ap_palloc] Ouch! Someone trounced past the end " + "[apr_palloc] Ouch! Someone trounced past the end " "of their allocation!\n"); blok->h.first_avail = new_first_avail; return (void *) first_avail; @@ -928,7 +928,7 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) /* Nope --- get a new one that's guaranteed to be big enough */ #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif blok = new_block(size, a->apr_abort); @@ -939,7 +939,7 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) #endif #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif first_avail = blok->h.first_avail; @@ -949,29 +949,29 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) #endif } -APR_EXPORT(void *) ap_pcalloc(ap_pool_t *a, ap_size_t size) +APR_EXPORT(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) { - void *res = ap_palloc(a, size); + void *res = apr_palloc(a, size); memset(res, '\0', size); return res; } /* - * ap_psprintf is implemented by writing directly into the current + * apr_psprintf is implemented by writing directly into the current * block of the pool, starting right at first_avail. If there's * insufficient room, then a new block is allocated and the earlier * output is copied over. The new block isn't linked into the pool * until all the output is done. * * Note that this is completely safe because nothing else can - * allocate in this ap_pool_t while ap_psprintf is running. alarms are + * allocate in this apr_pool_t while apr_psprintf is running. alarms are * blocked, and the only thing outside of alloc.c that's invoked - * is ap_vformatter -- which was purposefully written to be + * is apr_vformatter -- which was purposefully written to be * self-contained with no callouts. */ struct psprintf_data { - ap_vformatter_buff_t vbuff; + apr_vformatter_buff_t vbuff; #ifdef ALLOC_USE_MALLOC char *base; #else @@ -980,11 +980,11 @@ struct psprintf_data { #endif }; -static int psprintf_flush(ap_vformatter_buff_t *vbuff) +static int psprintf_flush(apr_vformatter_buff_t *vbuff) { struct psprintf_data *ps = (struct psprintf_data *)vbuff; #ifdef ALLOC_USE_MALLOC - ap_size_t size; + apr_size_t size; char *ptr; size = (char *)ps->vbuff.curpos - ps->base; @@ -1000,7 +1000,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) #else union block_hdr *blok; union block_hdr *nblok; - ap_size_t cur_len; + apr_size_t cur_len; char *strp; blok = ps->blok; @@ -1009,11 +1009,11 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) /* must try another blok */ #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif nblok = new_block(2 * cur_len, NULL); #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif memcpy(nblok->h.first_avail, blok->h.first_avail, cur_len); ps->vbuff.curpos = nblok->h.first_avail + cur_len; @@ -1024,12 +1024,12 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) if (ps->got_a_new_block) { debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif blok->h.next = block_freelist; block_freelist = blok; #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif } ps->blok = nblok; @@ -1042,7 +1042,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) #endif } -APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) +APR_EXPORT(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) { #ifdef ALLOC_USE_MALLOC struct psprintf_data ps; @@ -1056,7 +1056,7 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) /* need room at beginning for allocation_list */ ps.vbuff.curpos = ps.base + CLICK_SZ; ps.vbuff.endpos = ps.base + 511; - ap_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); + apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); *ps.vbuff.curpos++ = '\0'; ptr = ps.base; /* shrink */ @@ -1071,14 +1071,14 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) #else struct psprintf_data ps; char *strp; - ap_size_t size; + apr_size_t size; ps.blok = p->last; ps.vbuff.curpos = ps.blok->h.first_avail; ps.vbuff.endpos = ps.blok->h.endp - 1; /* save one for NUL */ ps.got_a_new_block = 0; - ap_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); + apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); strp = ps.vbuff.curpos; *strp++ = '\0'; @@ -1101,13 +1101,13 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) #endif } -APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) +APR_EXPORT_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) { va_list ap; char *res; va_start(ap, fmt); - res = ap_pvsprintf(p, fmt, ap); + res = apr_pvsprintf(p, fmt, ap); va_end(ap); return res; } @@ -1124,11 +1124,11 @@ APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -APR_EXPORT(void) ap_note_subprocess(ap_pool_t *a, ap_proc_t *pid, +APR_EXPORT(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) { struct process_chain *new = - (struct process_chain *) ap_palloc(a, sizeof(struct process_chain)); + (struct process_chain *) apr_palloc(a, sizeof(struct process_chain)); new->pid = pid; new->kill_how = how; @@ -1159,7 +1159,7 @@ static void free_proc_chain(struct process_chain *procs) #ifndef NEED_WAITPID /* Pick up all defunct processes */ for (p = procs; p; p = p->next) { - if (ap_wait_proc(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { + if (apr_wait_proc(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { p->kill_how = kill_never; } } @@ -1170,20 +1170,20 @@ static void free_proc_chain(struct process_chain *procs) || (p->kill_how == kill_only_once)) { /* * Subprocess may be dead already. Only need the timeout if not. - * Note: ap_kill on Windows is TerminateProcess(), which is + * Note: apr_kill on Windows is TerminateProcess(), which is * similar to a SIGKILL, so always give the process a timeout * under Windows before killing it. */ #ifdef WIN32 need_timeout = 1; #else - if (ap_kill(p->pid, APR_SIGTERM) == APR_SUCCESS) { + if (apr_kill(p->pid, APR_SIGTERM) == APR_SUCCESS) { need_timeout = 1; } #endif } else if (p->kill_how == kill_always) { - ap_kill(p->pid, APR_SIGKILL); + apr_kill(p->pid, APR_SIGKILL); } } @@ -1198,7 +1198,7 @@ static void free_proc_chain(struct process_chain *procs) */ for (p = procs; p; p = p->next) { if (p->kill_how == kill_after_timeout) { - ap_kill(p->pid, APR_SIGKILL); + apr_kill(p->pid, APR_SIGKILL); } } #ifdef WIN32 @@ -1215,7 +1215,7 @@ static void free_proc_chain(struct process_chain *procs) /* Now wait for all the signaled processes to die */ for (p = procs; p; p = p->next) { if (p->kill_how != kill_never) { - (void) ap_wait_proc(p->pid, APR_WAIT); + (void) apr_wait_proc(p->pid, APR_WAIT); } } } diff --git a/misc/unix/canonerr.c b/misc/unix/canonerr.c index b2aaa6fad73..15f83fabbf3 100644 --- a/misc/unix/canonerr.c +++ b/misc/unix/canonerr.c @@ -56,7 +56,7 @@ #ifndef OS2 -int ap_canonical_error(ap_status_t errcode) +int apr_canonical_error(apr_status_t errcode) { #if defined(EAGAIN) && defined(EWOULDBLOCK) && (EAGAIN != EWOULDBLOCK) && !defined(WIN32) if (errcode == EWOULDBLOCK) { diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 0aee7c07102..697ea0a40a2 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -65,16 +65,16 @@ #endif /* - * stuffbuffer - like ap_cpystrn() but returns the address of the + * stuffbuffer - like apr_cpystrn() but returns the address of the * dest buffer instead of the address of the terminating '\0' */ -static char *stuffbuffer(char *buf, ap_size_t bufsize, const char *s) +static char *stuffbuffer(char *buf, apr_size_t bufsize, const char *s) { - ap_cpystrn(buf,s,bufsize); + apr_cpystrn(buf,s,bufsize); return buf; } -static char *apr_error_string(ap_status_t statcode) +static char *apr_error_string(apr_status_t statcode) { switch (statcode) { case APR_ENOPOOL: @@ -164,7 +164,7 @@ static char *apr_error_string(ap_status_t statcode) #include #include -static char *apr_os_strerror(char* buf, ap_size_t bufsize, int err) +static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) { char result[200]; unsigned char message[HUGE_STRING_LEN]; @@ -174,7 +174,7 @@ static char *apr_os_strerror(char* buf, ap_size_t bufsize, int err) if (err >= 10000 && err < 12000) { /* socket error codes */ return stuffbuffer(buf, bufsize, - strerror(ap_canonical_error(err+APR_OS_START_SYSERR))); + strerror(apr_canonical_error(err+APR_OS_START_SYSERR))); } else if (DosGetMessage(NULL, 0, message, HUGE_STRING_LEN, err, "OSO001.MSG", &len) == 0) { @@ -206,7 +206,7 @@ static char *apr_os_strerror(char* buf, ap_size_t bufsize, int err) #elif defined(WIN32) -static char *apr_os_strerror(char *buf, ap_size_t bufsize, ap_status_t errcode) +static char *apr_os_strerror(char *buf, apr_size_t bufsize, apr_status_t errcode) { DWORD len; DWORD i; @@ -236,7 +236,7 @@ static char *apr_os_strerror(char *buf, ap_size_t bufsize, ap_status_t errcode) else { /* Windows didn't provide us with a message. Even stuff like * WSAECONNREFUSED won't get a message. */ - ap_cpystrn(buf, "Unrecognized error code", bufsize); + apr_cpystrn(buf, "Unrecognized error code", bufsize); } return buf; @@ -246,7 +246,7 @@ static char *apr_os_strerror(char *buf, ap_size_t bufsize, ap_status_t errcode) /* On Unix, apr_os_strerror() handles error codes from the resolver * (h_errno). e*/ -static char *apr_os_strerror(char* buf, ap_size_t bufsize, int err) +static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) { #ifdef HAVE_HSTRERROR return stuffbuffer(buf, bufsize, hstrerror(err)); @@ -277,7 +277,7 @@ static char *apr_os_strerror(char* buf, ap_size_t bufsize, int err) } #endif -char *ap_strerror(ap_status_t statcode, char *buf, ap_size_t bufsize) +char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize) { if (statcode < APR_OS_START_ERROR) { #ifdef WIN32 diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 3bd36c73f9f..bdee3afbd46 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -42,9 +42,9 @@ APR_VAR_EXPORT char *ap_optarg = ""; /* argument associated with option */ #define EMSG "" -APR_EXPORT(ap_status_t) ap_getopt(ap_int32_t nargc, char *const *nargv, - const char *ostr, ap_int32_t *rv, - ap_pool_t *cont) +APR_EXPORT(apr_status_t) apr_getopt(apr_int32_t nargc, char *const *nargv, + const char *ostr, apr_int32_t *rv, + apr_pool_t *cont) { char *p; static char *place = EMSG; /* option letter processing */ diff --git a/misc/unix/misc.h b/misc/unix/misc.h index 7a364850286..f02c112dcf7 100644 --- a/misc/unix/misc.h +++ b/misc/unix/misc.h @@ -90,8 +90,8 @@ typedef struct datastruct { struct datastruct *prev; } datastruct; -struct ap_other_child_rec_t { - struct ap_other_child_rec_t *next; +struct apr_other_child_rec_t { + struct apr_other_child_rec_t *next; int id; /* This is either a pid or tid depending on the platform */ void (*maintenance) (int, void *, int); void *data; @@ -170,7 +170,7 @@ AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( (hFile)); #define CancelIo ap_winapi_CancelIo -ap_status_t ap_get_oslevel(struct ap_pool_t *, ap_oslevel_e *); +apr_status_t ap_get_oslevel(struct apr_pool_t *, ap_oslevel_e *); #endif /* WIN32 */ #endif /* ! MISC_H */ diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 4019716497e..61312da705b 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -69,15 +69,15 @@ #include /* for fd_set definition! */ #endif -static ap_other_child_rec_t *other_children = NULL; +static apr_other_child_rec_t *other_children = NULL; -APR_EXPORT(void) ap_register_other_child(ap_proc_t *pid, +APR_EXPORT(void) apr_register_other_child(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), - void *data, ap_file_t *write_fd, ap_pool_t *p) + void *data, apr_file_t *write_fd, apr_pool_t *p) { - ap_other_child_rec_t *ocr; + apr_other_child_rec_t *ocr; - ocr = ap_palloc(p, sizeof(*ocr)); + ocr = apr_palloc(p, sizeof(*ocr)); ocr->id = pid->pid; ocr->maintenance = maintenance; ocr->data = data; @@ -91,9 +91,9 @@ APR_EXPORT(void) ap_register_other_child(ap_proc_t *pid, other_children = ocr; } -APR_EXPORT(void) ap_unregister_other_child(void *data) +APR_EXPORT(void) apr_unregister_other_child(void *data) { - ap_other_child_rec_t **pocr, *nocr; + apr_other_child_rec_t **pocr, *nocr; for (pocr = &other_children; *pocr; pocr = &(*pocr)->next) { if ((*pocr)->data == data) { @@ -108,11 +108,11 @@ APR_EXPORT(void) ap_unregister_other_child(void *data) /* test to ensure that the write_fds are all still writable, otherwise * invoke the maintenance functions as appropriate */ -void ap_probe_writable_fds(void) +void apr_probe_writable_fds(void) { fd_set writable_fds; int fd_max; - ap_other_child_rec_t *ocr, *nocr; + apr_other_child_rec_t *ocr, *nocr; struct timeval tv; int rc; @@ -156,9 +156,9 @@ void ap_probe_writable_fds(void) } } -APR_EXPORT(ap_status_t) ap_reap_other_child(ap_proc_t *pid, int status) +APR_EXPORT(apr_status_t) apr_reap_other_child(apr_proc_t *pid, int status) { - ap_other_child_rec_t *ocr, *nocr; + apr_other_child_rec_t *ocr, *nocr; for (ocr = other_children; ocr; ocr = nocr) { nocr = ocr->next; @@ -172,9 +172,9 @@ APR_EXPORT(ap_status_t) ap_reap_other_child(ap_proc_t *pid, int status) return APR_CHILD_NOTDONE; } -APR_EXPORT(void) ap_check_other_child(void) +APR_EXPORT(void) apr_check_other_child(void) { - ap_other_child_rec_t *ocr, *nocr; + apr_other_child_rec_t *ocr, *nocr; pid_t waitret; int status; diff --git a/misc/unix/rand.c b/misc/unix/rand.c index aebd1d2f261..2b5b3ffb8db 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -65,7 +65,7 @@ #define XSTR(x) #x #define STR(x) XSTR(x) -ap_status_t ap_generate_random_bytes(unsigned char * buf, int length) +apr_status_t apr_generate_random_bytes(unsigned char * buf, int length) { #ifdef DEV_RANDOM diff --git a/misc/unix/start.c b/misc/unix/start.c index 4543f597036..3f0f03fda54 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -56,15 +56,15 @@ #include "locks.h" #include "apr_strings.h" -ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont) +apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) { - ap_pool_t *newpool; + apr_pool_t *newpool; if (cont) { - newpool = ap_make_sub_pool(cont, cont->apr_abort); + newpool = apr_make_sub_pool(cont, cont->apr_abort); } else { - newpool = ap_make_sub_pool(NULL, NULL); + newpool = apr_make_sub_pool(NULL, NULL); } if (newpool == NULL) { @@ -78,13 +78,13 @@ ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_set_userdata(const void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_pool_t *cont) +apr_status_t apr_set_userdata(const void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_pool_t *cont) { datastruct *dptr = NULL, *dptr2 = NULL; - /* ### replace with an ap_hash_t */ + /* ### replace with an apr_hash_t */ dptr = cont->prog_data; while (dptr) { @@ -94,9 +94,9 @@ ap_status_t ap_set_userdata(const void *data, const char *key, dptr = dptr->next; } if (dptr == NULL) { - dptr = ap_pcalloc(cont, sizeof(datastruct)); + dptr = apr_pcalloc(cont, sizeof(datastruct)); dptr->next = dptr->prev = NULL; - dptr->key = ap_pstrdup(cont, key); + dptr->key = apr_pstrdup(cont, key); if (dptr2) { dptr2->next = dptr; dptr->prev = dptr2; @@ -106,15 +106,15 @@ ap_status_t ap_set_userdata(const void *data, const char *key, } } dptr->data = data; - ap_register_cleanup(cont, dptr->data, cleanup, cleanup); + apr_register_cleanup(cont, dptr->data, cleanup, cleanup); return APR_SUCCESS; } -ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont) +apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) { datastruct *dptr = NULL; - /* ### replace with an ap_hash_t */ + /* ### replace with an apr_hash_t */ dptr = cont->prog_data; while (dptr) { @@ -135,11 +135,11 @@ ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_initialize(void) +apr_status_t apr_initialize(void) { - ap_status_t status; + apr_status_t status; #if !defined(BEOS) && !defined(OS2) && !defined(WIN32) - ap_unix_setup_lock(); + apr_unix_setup_lock(); #elif defined WIN32 int iVersionRequested; WSADATA wsaData; @@ -156,16 +156,16 @@ ap_status_t ap_initialize(void) return APR_EEXIST; } #endif - status = ap_init_alloc(); + status = apr_init_alloc(); return status; } -void ap_terminate(void) +void apr_terminate(void) { - ap_term_alloc(); + apr_term_alloc(); } -ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_pool_t *cont) +apr_status_t apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont) { cont->apr_abort = apr_abort; return APR_SUCCESS; diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 79235604f4a..734c5a018fb 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -55,7 +55,7 @@ #include "apr_private.h" #include "misc.h" -ap_status_t ap_get_oslevel(ap_pool_t *cont, ap_oslevel_e *level) +apr_status_t ap_get_oslevel(apr_pool_t *cont, ap_oslevel_e *level) { static OSVERSIONINFO oslev; static unsigned int servpack = 0; diff --git a/misc/win32/names.c b/misc/win32/names.c index b5ca744d20f..81587cf9c40 100644 --- a/misc/win32/names.c +++ b/misc/win32/names.c @@ -82,7 +82,7 @@ static BOOL OnlyDots(char *pString) * is present on the existing path. This routine also * converts alias names to long names. */ -APR_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, +APR_EXPORT(char *) ap_os_systemcase_filename(apr_pool_t *pCont, const char *szFile) { char buf[HUGE_STRING_LEN]; @@ -94,10 +94,10 @@ APR_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, WIN32_FIND_DATA wfd; if (!szFile || strlen(szFile) == 0 || strlen(szFile) >= sizeof(buf)) - return ap_pstrdup(pCont, ""); + return apr_pstrdup(pCont, ""); buf[0] = '\0'; - pInputName = ap_pstrdup(pCont, szFile); + pInputName = apr_pstrdup(pCont, szFile); /* First convert all slashes to \ so Win32 calls work OK */ for (p = pInputName; *p; p++) { @@ -195,13 +195,13 @@ APR_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, *p = '/'; } - return ap_pstrdup(pCont, buf); + return apr_pstrdup(pCont, buf); } /* Perform canonicalization with the exception that the * input case is preserved. */ -char * canonical_filename(ap_pool_t *pCont, const char *szFile) +char * canonical_filename(apr_pool_t *pCont, const char *szFile) { char *pNewStr; char *s; @@ -209,9 +209,9 @@ char * canonical_filename(ap_pool_t *pCont, const char *szFile) char *q; if (szFile == NULL || strlen(szFile) == 0) - return ap_pstrdup(pCont, ""); + return apr_pstrdup(pCont, ""); - pNewStr = ap_pstrdup(pCont, szFile); + pNewStr = apr_pstrdup(pCont, szFile); /* Change all '\' characters to '/' characters. * While doing this, remove any trailing '.'. @@ -309,7 +309,7 @@ char * canonical_filename(ap_pool_t *pCont, const char *szFile) } while (p != NULL); - pNewStr = ap_pstrdup(pCont, buf); + pNewStr = apr_pstrdup(pCont, buf); } } return pNewStr; diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 2c7abd595b7..2462b997353 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -56,7 +56,7 @@ #include "apr_general.h" #include -ap_status_t ap_generate_random_bytes(unsigned char * buf, int length) +apr_status_t apr_generate_random_bytes(unsigned char * buf, int length) { HCRYPTPROV hProv; diff --git a/mmap/unix/common.c b/mmap/unix/common.c index 25597c56a5b..f2a84438f4e 100644 --- a/mmap/unix/common.c +++ b/mmap/unix/common.c @@ -68,7 +68,7 @@ #if APR_HAS_MMAP || defined(BEOS) -ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_off_t offset) +apr_status_t apr_mmap_offset(void **addr, apr_mmap_t *mmap, apr_off_t offset) { if (offset < 0 || offset > mmap->size) return APR_EINVAL; diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index d708b977e46..199b6fc74ed 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -79,9 +79,9 @@ #if APR_HAS_MMAP || defined(BEOS) -static ap_status_t mmap_cleanup(void *themmap) +static apr_status_t mmap_cleanup(void *themmap) { - ap_mmap_t *mm = themmap; + apr_mmap_t *mm = themmap; int rv; #ifdef BEOS rv = delete_area(mm->area); @@ -101,8 +101,8 @@ static ap_status_t mmap_cleanup(void *themmap) return errno; } -ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, - ap_size_t size, ap_pool_t *cont) +apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, apr_off_t offset, + apr_size_t size, apr_pool_t *cont) { #ifdef BEOS void *mm; @@ -115,11 +115,11 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, if (file == NULL || file->filedes == -1 || file->buffered) return APR_EBADF; - (*new) = (ap_mmap_t *)ap_pcalloc(cont, sizeof(ap_mmap_t)); + (*new) = (apr_mmap_t *)apr_pcalloc(cont, sizeof(apr_mmap_t)); #ifdef BEOS /* XXX: mmap shouldn't really change the seek offset */ - ap_seek(file, APR_SET, &offset); + apr_seek(file, APR_SET, &offset); pages = ((size -1) / B_PAGE_SIZE) + 1; aid = create_area(areaname, &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, @@ -148,20 +148,20 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, (*new)->cntxt = cont; /* register the cleanup... */ - ap_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_mmap_delete(ap_mmap_t *mmap) +apr_status_t apr_mmap_delete(apr_mmap_t *mmap) { - ap_status_t rv; + apr_status_t rv; if (mmap->mm == (caddr_t) -1) return APR_ENOENT; if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { - ap_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); + apr_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); return APR_SUCCESS; } return rv; diff --git a/network_io/beos/networkio.h b/network_io/beos/networkio.h index 3c2bcc5358a..4a9ef6c14eb 100644 --- a/network_io/beos/networkio.h +++ b/network_io/beos/networkio.h @@ -91,26 +91,26 @@ #define POLLHUP 16 #define POLLNVAL 32 -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; int socketdes; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; int addr_len; - ap_interval_time_t timeout; + apr_interval_time_t timeout; int connected; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; - struct ap_socket_t *sock; +struct apr_pollfd_t { + apr_pool_t *cntxt; + struct apr_socket_t *sock; fd_set *read; fd_set *write; fd_set *except; int highsock; }; -ap_int16_t get_event(ap_int16_t); +apr_int16_t get_event(apr_int16_t); int inet_aton(const char *cp, struct in_addr *addr); #include /* for the ntohs definition */ diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index dffc8d43b4f..354de61ceb7 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -67,16 +67,16 @@ /* select for R4.5 of BeOS. So here we use code that uses the write */ /* bits. */ -ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) +apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { - (*new) = (ap_pollfd_t *)ap_palloc(cont, sizeof(ap_pollfd_t) * num); + (*new) = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t) * num); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->read = (fd_set *)ap_palloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)ap_palloc(cont, sizeof(fd_set)); - (*new)->except = (fd_set *)ap_palloc(cont, sizeof(fd_set)); + (*new)->read = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->write = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->except = (fd_set *)apr_palloc(cont, sizeof(fd_set)); FD_ZERO((*new)->read); FD_ZERO((*new)->write); FD_ZERO((*new)->except); @@ -84,8 +84,8 @@ ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t event) +apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t event) { if (event & APR_POLLIN) { FD_SET(sock->socketdes, aprset->read); @@ -102,8 +102,8 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, - ap_interval_time_t timeout) +apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, + apr_interval_time_t timeout) { int rv; struct timeval tv, *tvptr; @@ -130,9 +130,9 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, return APR_SUCCESS; } -ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) +apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { - ap_int16_t revents = 0; + apr_int16_t revents = 0; char data[256]; int dummy = 256; @@ -175,7 +175,7 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap return APR_SUCCESS; } -ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) +apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) { FD_CLR(sock->socketdes, aprset->read); FD_CLR(sock->socketdes, aprset->read); @@ -183,7 +183,7 @@ ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) +apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t event) { if (event & APR_POLLIN) { FD_ZERO(aprset->read); @@ -198,15 +198,15 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) return APR_SUCCESS; } -ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data) +apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) { - return ap_get_userdata(data, key, pollfd->cntxt); + return apr_get_userdata(data, key, pollfd->cntxt); } -ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, pollfd->cntxt); + return apr_set_userdata(data, key, cleanup, pollfd->cntxt); } #endif /* BEOS_BONE */ diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 389bcdbd23c..601881286c7 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -58,7 +58,7 @@ #else #include "networkio.h" -static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) +static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) { struct timeval tv, *tvptr; fd_set fdset; @@ -92,7 +92,7 @@ static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) return APR_SUCCESS; } -ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) { ssize_t rv; @@ -101,7 +101,7 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) } while (rv == -1 && errno == EINTR); if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -120,16 +120,16 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) return APR_SUCCESS; } -ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) { - ap_ssize_t rv; + apr_ssize_t rv; do { rv = recv(sock->socketdes, buf, (*len), 0); } while (rv == -1 && errno == EINTR); if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 1); + apr_status_t arv = wait_for_io_or_timeout(sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; diff --git a/network_io/beos/sockaddr.c b/network_io/beos/sockaddr.c index 57ce8343dce..699b95ad8be 100644 --- a/network_io/beos/sockaddr.c +++ b/network_io/beos/sockaddr.c @@ -58,7 +58,7 @@ #else #include "networkio.h" -ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) +apr_status_t apr_set_local_port(apr_socket_t *sock, apr_uint32_t port) { if (!sock) { return APR_EBADF; @@ -67,7 +67,7 @@ ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) return APR_SUCCESS; } -ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) +apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_uint32_t port) { if (!sock) { return APR_EBADF; @@ -76,7 +76,7 @@ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) return APR_SUCCESS; } -ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) +apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -85,7 +85,7 @@ ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) +apr_status_t apr_get_remote_port(apr_uint32_t *port, apr_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -94,7 +94,7 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) +apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr) { u_long ipaddr; @@ -117,7 +117,7 @@ ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) return APR_SUCCESS; } -ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) +apr_status_t apr_set_remote_ipaddr(apr_socket_t *sock, const char *addr) { u_long ipaddr; @@ -140,28 +140,28 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) return APR_SUCCESS; } -ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock) +apr_status_t apr_get_local_ipaddr(char **addr, apr_socket_t *sock) { if (!sock) { return APR_EBADF; } - *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); return APR_SUCCESS; } -ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock) +apr_status_t apr_get_remote_ipaddr(char **addr, apr_socket_t *sock) { if (!sock) { return APR_EBADF; } - *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); return APR_SUCCESS; } -ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) +apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -171,7 +171,7 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock) +apr_status_t apr_get_remote_name(struct sockaddr_in **name, apr_socket_t *sock) { if (!sock) { return APR_EBADF; diff --git a/network_io/beos/sockets.c b/network_io/beos/sockets.c index 671492bfa65..446d8a7d205 100644 --- a/network_io/beos/sockets.c +++ b/network_io/beos/sockets.c @@ -58,9 +58,9 @@ #else #include "networkio.h" -ap_status_t socket_cleanup(void *sock) +apr_status_t socket_cleanup(void *sock) { - ap_socket_t *thesocket = sock; + apr_socket_t *thesocket = sock; if (closesocket(thesocket->socketdes) == 0) { thesocket->socketdes = -1; return APR_SUCCESS; @@ -70,18 +70,18 @@ ap_status_t socket_cleanup(void *sock) } } -ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) +apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) { - (*new) = (ap_socket_t *)ap_palloc(cont,sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_palloc(cont,sizeof(apr_socket_t)); if ((*new) == NULL){ return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->local_addr = (struct sockaddr_in *) ap_palloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *) apr_palloc((*new)->cntxt, sizeof (struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *) ap_palloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *) apr_palloc((*new)->cntxt, sizeof (struct sockaddr_in)); if ((*new)->local_addr == NULL || (*new)->remote_addr==NULL){ return APR_ENOMEM; @@ -99,23 +99,23 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) } (*new)->timeout = -1; - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) +apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how) { return shutdown(thesocket->socketdes, how); } -ap_status_t ap_close_socket(ap_socket_t *thesocket) +apr_status_t apr_close_socket(apr_socket_t *thesocket) { - ap_kill_cleanup(thesocket->cntxt,thesocket,socket_cleanup); + apr_kill_cleanup(thesocket->cntxt,thesocket,socket_cleanup); return socket_cleanup(thesocket); } -ap_status_t ap_bind(ap_socket_t *sock) +apr_status_t apr_bind(apr_socket_t *sock) { if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) return errno; @@ -123,7 +123,7 @@ ap_status_t ap_bind(ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) +apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return errno; @@ -131,16 +131,16 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_context) +apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { - (*new) = (ap_socket_t *)ap_palloc(connection_context, - sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_palloc(connection_context, + sizeof(apr_socket_t)); (*new)->cntxt = connection_context; - (*new)->local_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, sizeof(struct sockaddr_in)); (*new)->addr_len = sizeof(struct sockaddr_in); (*new)->connected = 1; @@ -156,12 +156,12 @@ ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connectio return errno; } - ap_register_cleanup((*new)->cntxt, (void *)new, - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)new, + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_connect(ap_socket_t *sock, char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, char *hostname) { struct hostent *hp; @@ -190,31 +190,31 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) return APR_SUCCESS; } -ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock) +apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock) { - return ap_get_userdata(data, key, sock->cntxt); + return apr_get_userdata(data, key, sock->cntxt); } -ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, sock->cntxt); + return apr_set_userdata(data, key, cleanup, sock->cntxt); } -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) +apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->socketdes; return APR_SUCCESS; } -ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, - ap_pool_t *cont) +apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*sock) == NULL) { - (*sock) = (ap_socket_t *)ap_palloc(cont, sizeof(ap_socket_t)); + (*sock) = (apr_socket_t *)apr_palloc(cont, sizeof(apr_socket_t)); (*sock)->cntxt = cont; } (*sock)->socketdes = *thesock; diff --git a/network_io/beos/sockopt.c b/network_io/beos/sockopt.c index 87542f22003..c5921dfbc8c 100644 --- a/network_io/beos/sockopt.c +++ b/network_io/beos/sockopt.c @@ -64,7 +64,7 @@ static int setnonblocking(int on, int sock) &on, sizeof(on)); } -ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) +apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { int one; int rv; @@ -110,7 +110,7 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) return APR_SUCCESS; } -ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) +apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch(opt) { case APR_SO_TIMEOUT: @@ -122,7 +122,7 @@ ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) return APR_SUCCESS; } -ap_status_t ap_gethostname(char * buf, int len, ap_pool_t *cont) +apr_status_t apr_gethostname(char * buf, int len, apr_pool_t *cont) { if (gethostname(buf, len) == -1){ return errno; @@ -131,14 +131,14 @@ ap_status_t ap_gethostname(char * buf, int len, ap_pool_t *cont) } } -ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) +apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) { struct hostent *hptr; hptr = gethostbyaddr((char *)&(sock->remote_addr->sin_addr), sizeof(struct in_addr), AF_INET); if (hptr != NULL) { - *name = ap_pstrdup(sock->cntxt, hptr->h_name); + *name = apr_pstrdup(sock->cntxt, hptr->h_name); if (*name) { return APR_SUCCESS; } diff --git a/network_io/os2/networkio.h b/network_io/os2/networkio.h index 63424de6a74..a87823ae9ed 100644 --- a/network_io/os2/networkio.h +++ b/network_io/os2/networkio.h @@ -59,18 +59,18 @@ #include "apr_general.h" #include "os2calls.h" -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; int socketdes; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; int addr_len; - ap_interval_time_t timeout; + apr_interval_time_t timeout; int nonblock; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; +struct apr_pollfd_t { + apr_pool_t *cntxt; int *socket_list; int *r_socket_list; int num_read; diff --git a/network_io/os2/poll.c b/network_io/os2/poll.c index a36854ff018..f1bd5826aad 100644 --- a/network_io/os2/poll.c +++ b/network_io/os2/poll.c @@ -64,21 +64,21 @@ /* OS/2 doesn't have a poll function, implement using OS/2 style select */ -ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) +apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { - *new = (ap_pollfd_t *)ap_palloc(cont, sizeof(ap_pollfd_t)); + *new = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t)); if (*new == NULL) { return APR_ENOMEM; } - (*new)->socket_list = ap_palloc(cont, sizeof(int) * num); + (*new)->socket_list = apr_palloc(cont, sizeof(int) * num); if ((*new)->socket_list == NULL) { return APR_ENOMEM; } - (*new)->r_socket_list = ap_palloc(cont, sizeof(int) * num); + (*new)->r_socket_list = apr_palloc(cont, sizeof(int) * num); if ((*new)->r_socket_list == NULL) { return APR_ENOMEM; @@ -95,8 +95,8 @@ ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) -ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t events) +apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t events) { int i; @@ -126,8 +126,8 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, -ap_status_t ap_poll(ap_pollfd_t *pollfdset, ap_int32_t *nsds, - ap_interval_time_t timeout) +apr_status_t apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, + apr_interval_time_t timeout) { int i; int rv = 0; @@ -167,7 +167,7 @@ ap_status_t ap_poll(ap_pollfd_t *pollfdset, ap_int32_t *nsds, -ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) +apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { int i; @@ -189,8 +189,8 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap -ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t events) +apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t events) { int start, *count, pos; @@ -227,7 +227,7 @@ ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, -ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) +apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) { - return ap_mask_poll_socket(aprset, sock, APR_POLLIN|APR_POLLOUT|APR_POLLPRI); + return apr_mask_poll_socket(aprset, sock, APR_POLLIN|APR_POLLOUT|APR_POLLPRI); } diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index a2bf144295e..81a281e4dc8 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -59,7 +59,7 @@ #include "apr_lib.h" #include -ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) { ssize_t rv; int fds, err = 0; @@ -98,7 +98,7 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) -ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) { ssize_t rv; int fds, err = 0; @@ -137,9 +137,9 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) -ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, ap_int32_t nvec, ap_int32_t *len) +apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_int32_t *len) { - ap_status_t rv; + apr_status_t rv; struct iovec *tmpvec; int fds, err = 0; diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index ddd58151005..b6e417840c7 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -66,9 +66,9 @@ #include #include "os2calls.h" -static ap_status_t socket_cleanup(void *sock) +static apr_status_t socket_cleanup(void *sock) { - ap_socket_t *thesocket = sock; + apr_socket_t *thesocket = sock; if (soclose(thesocket->socketdes) == 0) { thesocket->socketdes = -1; return APR_SUCCESS; @@ -78,17 +78,17 @@ static ap_status_t socket_cleanup(void *sock) } } -ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) +apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) { - (*new) = (ap_socket_t *)ap_palloc(cont, sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_palloc(cont, sizeof(apr_socket_t)); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->local_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, sizeof(struct sockaddr_in)); if ((*new)->local_addr == NULL || (*new)->remote_addr == NULL) { @@ -107,12 +107,12 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) } (*new)->timeout = -1; (*new)->nonblock = FALSE; - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) +apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how) { if (shutdown(thesocket->socketdes, how) == 0) { return APR_SUCCESS; @@ -122,16 +122,16 @@ ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) } } -ap_status_t ap_close_socket(ap_socket_t *thesocket) +apr_status_t apr_close_socket(apr_socket_t *thesocket) { - ap_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); + apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } -ap_status_t ap_bind(ap_socket_t *sock) +apr_status_t apr_bind(apr_socket_t *sock) { if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) return APR_OS2_STATUS(sock_errno()); @@ -139,7 +139,7 @@ ap_status_t ap_bind(ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) +apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return APR_OS2_STATUS(sock_errno()); @@ -147,13 +147,13 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_context) +apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { - (*new) = (ap_socket_t *)ap_palloc(connection_context, - sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_palloc(connection_context, + sizeof(apr_socket_t)); (*new)->cntxt = connection_context; - (*new)->remote_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, sizeof(struct sockaddr_in)); (*new)->local_addr = sock->local_addr; (*new)->addr_len = sizeof(struct sockaddr_in); @@ -167,12 +167,12 @@ ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connectio return APR_OS2_STATUS(sock_errno()); } - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_connect(ap_socket_t *sock, char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, char *hostname) { struct hostent *hp; @@ -206,21 +206,21 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) -ap_status_t ap_get_socketdata(void **data, const char *key, - ap_socket_t *socket) +apr_status_t apr_get_socketdata(void **data, const char *key, + apr_socket_t *socket) { - return ap_get_userdata(data, key, socket->cntxt); + return apr_get_userdata(data, key, socket->cntxt); } -ap_status_t ap_set_socketdata(ap_socket_t *socket, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_socketdata(apr_socket_t *socket, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, socket->cntxt); + return apr_set_userdata(data, key, cleanup, socket->cntxt); } -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) +apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->socketdes; return APR_SUCCESS; @@ -228,13 +228,13 @@ ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) -ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, ap_pool_t *cont) +apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*sock) == NULL) { - (*sock) = (ap_socket_t *)ap_palloc(cont, sizeof(ap_socket_t)); + (*sock) = (apr_socket_t *)apr_palloc(cont, sizeof(apr_socket_t)); (*sock)->cntxt = cont; } (*sock)->socketdes = *thesock; diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 75b4c2a7844..a3c917f5595 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -66,7 +66,7 @@ #include -ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) +apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { int one; struct linger li; @@ -118,7 +118,7 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) -ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) +apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch(opt) { case APR_SO_TIMEOUT: @@ -132,7 +132,7 @@ ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) -ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_pool_t *cont) +apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { if (gethostname(buf, len) == -1) return APR_OS2_STATUS(sock_errno()); @@ -142,14 +142,14 @@ ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_pool_t *cont) -ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) +apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) { struct hostent *hptr; hptr = gethostbyaddr((char *)&(sock->remote_addr->sin_addr), sizeof(struct in_addr), AF_INET); if (hptr != NULL) { - *name = ap_pstrdup(sock->cntxt, hptr->h_name); + *name = apr_pstrdup(sock->cntxt, hptr->h_name); if (*name) { return APR_SUCCESS; } diff --git a/network_io/unix/networkio.h b/network_io/unix/networkio.h index af28dc7c710..90868b06da0 100644 --- a/network_io/unix/networkio.h +++ b/network_io/unix/networkio.h @@ -116,13 +116,13 @@ #define POLLNVAL 32 #endif -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; int socketdes; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; socklen_t addr_len; - ap_interval_time_t timeout; + apr_interval_time_t timeout; #ifndef HAVE_POLL int connected; #endif @@ -130,8 +130,8 @@ struct ap_socket_t { int local_interface_unknown; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; +struct apr_pollfd_t { + apr_pool_t *cntxt; #ifdef HAVE_POLL struct pollfd *pollset; int num; @@ -142,8 +142,8 @@ struct ap_pollfd_t { fd_set *except; int highsock; #endif - ap_int16_t *events; - ap_int16_t *revents; + apr_int16_t *events; + apr_int16_t *revents; }; diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index a946f5b5147..76679791b87 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -57,13 +57,13 @@ #ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ -ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) +apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { - (*new) = (ap_pollfd_t *)ap_pcalloc(cont, sizeof(ap_pollfd_t)); + (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->pollset = (struct pollfd *)ap_pcalloc(cont, + (*new)->pollset = (struct pollfd *)apr_pcalloc(cont, sizeof(struct pollfd) * num); if ((*new)->pollset == NULL) { @@ -75,9 +75,9 @@ ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) return APR_SUCCESS; } -static ap_int16_t get_event(ap_int16_t event) +static apr_int16_t get_event(apr_int16_t event) { - ap_int16_t rv = 0; + apr_int16_t rv = 0; if (event & APR_POLLIN) rv |= POLLIN; @@ -95,9 +95,9 @@ static ap_int16_t get_event(ap_int16_t event) return rv; } -static ap_int16_t get_revent(ap_int16_t event) +static apr_int16_t get_revent(apr_int16_t event) { - ap_int16_t rv = 0; + apr_int16_t rv = 0; if (event & POLLIN) rv |= APR_POLLIN; @@ -115,8 +115,8 @@ static ap_int16_t get_revent(ap_int16_t event) return rv; } -ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t event) +apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t event) { int i = 0; @@ -135,8 +135,8 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, - ap_interval_time_t timeout) +apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, + apr_interval_time_t timeout) { int rv; @@ -153,7 +153,7 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, return APR_SUCCESS; } -ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) +apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { int i = 0; @@ -167,10 +167,10 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap return APR_SUCCESS; } -ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t events) +apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t events) { - ap_int16_t newevents; + apr_int16_t newevents; int i = 0; while (i < aprset->curpos && aprset->pollset[i].fd != sock->socketdes) { @@ -187,7 +187,7 @@ ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) +apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) { int i = 0; while(i < aprset->curpos && aprset->pollset[i].fd != sock->socketdes) { @@ -204,10 +204,10 @@ ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events) +apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events) { int i = 0; - ap_int16_t newevents; + apr_int16_t newevents; newevents = get_event(events); @@ -222,16 +222,16 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events) #else /* Use select to mimic poll */ -ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) +apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { - (*new) = (ap_pollfd_t *)ap_pcalloc(cont, sizeof(ap_pollfd_t) * num); + (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->read = (fd_set *)ap_pcalloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)ap_pcalloc(cont, sizeof(fd_set)); - (*new)->except = (fd_set *)ap_pcalloc(cont, sizeof(fd_set)); + (*new)->read = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); + (*new)->write = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); + (*new)->except = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); FD_ZERO((*new)->read); FD_ZERO((*new)->write); FD_ZERO((*new)->except); @@ -239,8 +239,8 @@ ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t event) +apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t event) { if (event & APR_POLLIN) { FD_SET(sock->socketdes, aprset->read); @@ -257,8 +257,8 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, - ap_interval_time_t timeout) +apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, + apr_interval_time_t timeout) { int rv; struct timeval tv, *tvptr; @@ -285,9 +285,9 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, return APR_SUCCESS; } -ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) +apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { - ap_int16_t revents = 0; + apr_int16_t revents = 0; char data[1]; int flags = MSG_PEEK; @@ -332,7 +332,7 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap return APR_SUCCESS; } -ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) +apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) { FD_CLR(sock->socketdes, aprset->read); FD_CLR(sock->socketdes, aprset->read); @@ -340,7 +340,7 @@ ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) +apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t event) { if (event & APR_POLLIN) { FD_ZERO(aprset->read); @@ -357,25 +357,25 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) #endif -ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data) +apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) { - return ap_get_userdata(data, key, pollfd->cntxt); + return apr_get_userdata(data, key, pollfd->cntxt); } -ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, pollfd->cntxt); + return apr_set_userdata(data, key, cleanup, pollfd->cntxt); } #if APR_FILES_AS_SOCKETS -/* I'm not sure if this needs to return an ap_status_t or not, but +/* I'm not sure if this needs to return an apr_status_t or not, but * for right now, we'll leave it this way, and change it later if * necessary. */ -ap_status_t ap_socket_from_file(ap_socket_t **newsock, ap_file_t *file) +apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file) { - (*newsock) = ap_pcalloc(file->cntxt, sizeof(**newsock)); + (*newsock) = apr_pcalloc(file->cntxt, sizeof(**newsock)); (*newsock)->socketdes = file->filedes; (*newsock)->cntxt = file->cntxt; return APR_SUCCESS; diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 9ebb612d982..41a3dceb3a3 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -66,7 +66,7 @@ #endif #if APR_HAS_SENDFILE -/* This file is needed to allow us access to the ap_file_t internals. */ +/* This file is needed to allow us access to the apr_file_t internals. */ #include "../../file_io/unix/fileio.h" /* Glibc2.1.1 fails to define TCP_CORK. This is a bug that will be @@ -78,7 +78,7 @@ #endif /* APR_HAS_SENDFILE */ -static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) +static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) { struct timeval tv, *tvptr; fd_set fdset; @@ -112,7 +112,7 @@ static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) return APR_SUCCESS; } -ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) { ssize_t rv; @@ -122,7 +122,7 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -141,7 +141,7 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) return APR_SUCCESS; } -ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) { ssize_t rv; @@ -152,7 +152,7 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 1); + apr_status_t arv = wait_for_io_or_timeout(sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -172,10 +172,10 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) } #ifdef HAVE_WRITEV -ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, - ap_int32_t nvec, ap_ssize_t *len) +apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, + apr_int32_t nvec, apr_ssize_t *len) { - ap_ssize_t rv; + apr_ssize_t rv; do { rv = writev(sock->socketdes, vec, nvec); @@ -184,7 +184,7 @@ ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -211,7 +211,7 @@ ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, * - Should flags be an int_32 or what? */ -static ap_hdtr_t no_hdtr; /* used below when caller passes NULL for ap_hdtr_t */ +static apr_hdtr_t no_hdtr; /* used below when caller passes NULL for apr_hdtr_t */ #if defined(__linux__) && defined(HAVE_WRITEV) @@ -219,14 +219,14 @@ static ap_hdtr_t no_hdtr; /* used below when caller passes NULL for ap_hdtr_t */ * however, it is mutually exclusive w/TCP_NODELAY */ -static int os_cork(ap_socket_t *sock) +static int os_cork(apr_socket_t *sock) { /* Linux only for now */ int nodelay_off = 0, corkflag = 1, rv, delayflag; socklen_t delaylen = sizeof(delayflag); - /* XXX it would be cheaper to use an ap_socket_t flag here */ + /* XXX it would be cheaper to use an apr_socket_t flag here */ rv = getsockopt(sock->socketdes, SOL_TCP, TCP_NODELAY, (void *) &delayflag, &delaylen); if (rv == 0) { @@ -245,7 +245,7 @@ static int os_cork(ap_socket_t *sock) return rv == 0 ? delayflag : rv; } -static int os_uncork(ap_socket_t *sock, int delayflag) +static int os_uncork(apr_socket_t *sock, int delayflag) { /* Uncork to send queued frames - Linux only for now */ @@ -260,13 +260,13 @@ static int os_uncork(ap_socket_t *sock, int delayflag) return rv; } -ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, - ap_hdtr_t *hdtr, ap_off_t *offset, ap_size_t *len, - ap_int32_t flags) +apr_status_t ap_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, + apr_int32_t flags) { off_t off = *offset; int rv, nbytes = 0, total_hdrbytes, i, delayflag = APR_EINIT, corked = 0; - ap_status_t arv; + apr_status_t arv; if (!hdtr) { hdtr = &no_hdtr; @@ -276,7 +276,7 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, flags = 0; if (hdtr->numheaders > 0) { - ap_int32_t hdrbytes; + apr_int32_t hdrbytes; /* cork before writing headers */ rv = os_cork(sock); @@ -287,7 +287,7 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, corked = 1; /* Now write the headers */ - arv = ap_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); + arv = apr_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); if (arv != APR_SUCCESS) { *len = 0; return errno; @@ -361,8 +361,8 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, /* Now write the footers */ if (hdtr->numtrailers > 0) { - ap_int32_t trbytes; - arv = ap_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trbytes); + apr_int32_t trbytes; + arv = apr_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trbytes); nbytes += trbytes; if (arv != APR_SUCCESS) { *len = nbytes; @@ -391,9 +391,9 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, #elif defined(__FreeBSD__) /* Release 3.1 or greater */ -ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, - ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, - ap_int32_t flags) +apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_int32_t flags) { off_t nbytes; int rv, i; @@ -453,7 +453,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -484,9 +484,9 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, #error "there's no way this ap_sendfile implementation works -djg" /* HP-UX Version 10.30 or greater */ -ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, - ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, - ap_int32_t flags) +apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_int32_t flags) { int i, ptr = 0; size_t nbytes = 0, headerlen = 0, trailerlen = 0; @@ -508,7 +508,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, } /* XXX: BUHHH? wow, what a memory leak! */ - headerbuf = ap_palloc(sock->cntxt, headerlen); + headerbuf = apr_palloc(sock->cntxt, headerlen); for (i = 0; i < hdtr->numheaders; i++) { memcpy(headerbuf + ptr, hdtr->headers[i].iov_base, @@ -521,7 +521,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, } /* XXX: BUHHH? wow, what a memory leak! */ - trailerbuf = ap_palloc(sock->cntxt, trailerlen); + trailerbuf = apr_palloc(sock->cntxt, trailerlen); for (i = 0; i < hdtr->numtrailers; i++) { memcpy(trailerbuf + ptr, hdtr->trailers[i].iov_base, @@ -548,7 +548,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { /* jlt: not tested, but this matches other sendfile logic */ @@ -591,13 +591,13 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, * AIX - version 4.3.2 with APAR IX85388, or version 4.3.3 and above * OS/390 - V2R7 and above */ -ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, - ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, - ap_int32_t flags) +apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_int32_t flags) { int i, ptr, rv = 0; void * hbuf=NULL, * tbuf=NULL; - ap_status_t arv; + apr_status_t arv; struct sf_parms parms; if (!hdtr) { @@ -619,13 +619,13 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, parms.header_length += hdtr->headers[i].iov_len; } #if 0 - /* Keepalives make ap_palloc a bad idea */ + /* Keepalives make apr_palloc a bad idea */ hbuf = malloc(parms.header_length); #else /* but headers are small, so maybe we can hold on to the * memory for the life of the socket... */ - hbuf = ap_palloc(sock->cntxt, parms.header_length); + hbuf = apr_palloc(sock->cntxt, parms.header_length); #endif ptr = 0; for (i = 0; i < hdtr->numheaders; i++) { @@ -648,10 +648,10 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, parms.trailer_length += hdtr->trailers[i].iov_len; } #if 0 - /* Keepalives make ap_palloc a bad idea */ + /* Keepalives make apr_palloc a bad idea */ tbuf = malloc(parms.trailer_length); #else - tbuf = ap_palloc(sock->cntxt, parms.trailer_length); + tbuf = apr_palloc(sock->cntxt, parms.trailer_length); #endif ptr = 0; for (i = 0; i < hdtr->numtrailers; i++) { @@ -717,16 +717,16 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, * each and not an array as is passed into this function. In * addition, there is a limitation on the size of the header/trailer * that can be referenced ( > 4096 seems to cause an ENOMEM) - * Rather than code these special cases in, using ap_sendv for + * Rather than code these special cases in, using apr_sendv for * all cases of the headers and trailers seems to be a good idea. */ -ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, - ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, - ap_int32_t flags) +apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_int32_t flags) { off_t nbytes = 0; int rv, i; - ap_status_t arv; + apr_status_t arv; struct iovec headerstruct[2] = {(0, 0), (0, 0)}; size_t bytes_to_send = *len; @@ -738,9 +738,9 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, flags = 0; if (hdtr->numheaders > 0) { - ap_ssize_t hdrbytes = 0; + apr_ssize_t hdrbytes = 0; - arv = ap_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); + arv = apr_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); if (arv != APR_SUCCESS) { *len = 0; return errno; @@ -753,7 +753,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, * socket. */ if (sock->timeout <= 0) { - ap_size_t total_hdrbytes = 0; + apr_size_t total_hdrbytes = 0; for (i = 0; i < hdtr->numheaders; i++) { total_hdrbytes += hdtr->headers[i].iov_len; } @@ -784,7 +784,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -806,10 +806,10 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, nbytes += rv; if (hdtr->numtrailers > 0) { - ap_ssize_t trlbytes = 0; + apr_ssize_t trlbytes = 0; /* send the trailers now */ - arv = ap_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trlbytes); + arv = apr_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trlbytes); if (arv != APR_SUCCESS) { *len = 0; return errno; diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 4bfd0b50e3e..bce1053ff0f 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -55,7 +55,7 @@ #include "networkio.h" #include "apr_strings.h" -ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) +apr_status_t apr_set_local_port(apr_socket_t *sock, apr_uint32_t port) { sock->local_addr->sin_port = htons((short)port); return APR_SUCCESS; @@ -63,7 +63,7 @@ ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) -ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) +apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_uint32_t port) { sock->remote_addr->sin_port = htons((short)port); return APR_SUCCESS; @@ -71,7 +71,7 @@ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) -static ap_status_t get_local_addr(ap_socket_t *sock) +static apr_status_t get_local_addr(apr_socket_t *sock) { socklen_t namelen = sizeof(*sock->local_addr); @@ -87,10 +87,10 @@ static ap_status_t get_local_addr(ap_socket_t *sock) -ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) +apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock) { if (sock->local_port_unknown) { - ap_status_t rv = get_local_addr(sock); + apr_status_t rv = get_local_addr(sock); if (rv != APR_SUCCESS) { return rv; @@ -103,7 +103,7 @@ ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) -ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) +apr_status_t apr_get_remote_port(apr_uint32_t *port, apr_socket_t *sock) { *port = ntohs(sock->remote_addr->sin_port); return APR_SUCCESS; @@ -111,7 +111,7 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) -ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) +apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr) { u_long ipaddr; @@ -132,7 +132,7 @@ ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) -ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) +apr_status_t apr_set_remote_ipaddr(apr_socket_t *sock, const char *addr) { u_long ipaddr; @@ -153,35 +153,35 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) -ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock) +apr_status_t apr_get_local_ipaddr(char **addr, apr_socket_t *sock) { if (sock->local_interface_unknown) { - ap_status_t rv = get_local_addr(sock); + apr_status_t rv = get_local_addr(sock); if (rv != APR_SUCCESS) { return rv; } } - *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); return APR_SUCCESS; } -ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock) +apr_status_t apr_get_remote_ipaddr(char **addr, apr_socket_t *sock) { - *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); return APR_SUCCESS; } #if APR_HAVE_NETINET_IN_H -ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) +apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) { if (sock->local_port_unknown || sock->local_interface_unknown) { - ap_status_t rv = get_local_addr(sock); + apr_status_t rv = get_local_addr(sock); if (rv != APR_SUCCESS) { return rv; @@ -194,7 +194,7 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) -ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock) +apr_status_t apr_get_remote_name(struct sockaddr_in **name, apr_socket_t *sock) { *name = sock->remote_addr; return APR_SUCCESS; diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index cdf8042c374..377612f3fe1 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -55,9 +55,9 @@ #include "networkio.h" #include "apr_portable.h" -static ap_status_t socket_cleanup(void *sock) +static apr_status_t socket_cleanup(void *sock) { - ap_socket_t *thesocket = sock; + apr_socket_t *thesocket = sock; if (close(thesocket->socketdes) == 0) { thesocket->socketdes = -1; return APR_SUCCESS; @@ -67,17 +67,17 @@ static ap_status_t socket_cleanup(void *sock) } } -ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) +apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) { - (*new) = (ap_socket_t *)ap_pcalloc(cont, sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_pcalloc(cont, sizeof(apr_socket_t)); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->local_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); if ((*new)->local_addr == NULL || (*new)->remote_addr == NULL) { @@ -95,23 +95,23 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) return errno; } (*new)->timeout = -1; - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) +apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how) { return (shutdown(thesocket->socketdes, how) == -1) ? errno : APR_SUCCESS; } -ap_status_t ap_close_socket(ap_socket_t *thesocket) +apr_status_t apr_close_socket(apr_socket_t *thesocket) { - ap_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); + apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } -ap_status_t ap_bind(ap_socket_t *sock) +apr_status_t apr_bind(apr_socket_t *sock) { if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) return errno; @@ -123,7 +123,7 @@ ap_status_t ap_bind(ap_socket_t *sock) } } -ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) +apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return errno; @@ -131,16 +131,16 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_context) +apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { - (*new) = (ap_socket_t *)ap_pcalloc(connection_context, - sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_pcalloc(connection_context, + sizeof(apr_socket_t)); (*new)->cntxt = connection_context; - (*new)->local_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); (*new)->addr_len = sizeof(struct sockaddr_in); #ifndef HAVE_POLL @@ -173,12 +173,12 @@ ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connectio (*new)->local_interface_unknown = 1; } - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_connect(ap_socket_t *sock, char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, char *hostname) { struct hostent *hp; @@ -231,32 +231,32 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) } } -ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock) +apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock) { - return ap_get_userdata(data, key, sock->cntxt); + return apr_get_userdata(data, key, sock->cntxt); } -ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, sock->cntxt); + return apr_set_userdata(data, key, cleanup, sock->cntxt); } -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) +apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->socketdes; return APR_SUCCESS; } -ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, - ap_pool_t *cont) +apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, + apr_pool_t *cont) { if ((*sock) == NULL) { - (*sock) = (ap_socket_t *)ap_pcalloc(cont, sizeof(ap_socket_t)); + (*sock) = (apr_socket_t *)apr_pcalloc(cont, sizeof(apr_socket_t)); (*sock)->cntxt = cont; - (*sock)->local_addr = (struct sockaddr_in *)ap_pcalloc((*sock)->cntxt, + (*sock)->local_addr = (struct sockaddr_in *)apr_pcalloc((*sock)->cntxt, sizeof(struct sockaddr_in)); - (*sock)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*sock)->cntxt, + (*sock)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*sock)->cntxt, sizeof(struct sockaddr_in)); if ((*sock)->local_addr == NULL || (*sock)->remote_addr == NULL) { diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index d8044c9acdf..8cee5e30ad2 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -55,7 +55,7 @@ #include "networkio.h" #include "apr_strings.h" -static ap_status_t soblock(int sd) +static apr_status_t soblock(int sd) { /* BeOS uses setsockopt at present for non blocking... */ #ifndef BEOS @@ -83,7 +83,7 @@ static ap_status_t soblock(int sd) return APR_SUCCESS; } -static ap_status_t sononblock(int sd) +static apr_status_t sononblock(int sd) { #ifndef BEOS int fd_flags; @@ -110,11 +110,11 @@ static ap_status_t sononblock(int sd) return APR_SUCCESS; } -ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) +apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { int one; struct linger li; - ap_status_t stat; + apr_status_t stat; if (on) one = 1; @@ -173,7 +173,7 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) return APR_SUCCESS; } -ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) +apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch(opt) { case APR_SO_TIMEOUT: @@ -185,7 +185,7 @@ ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) return APR_SUCCESS; } -ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_pool_t *cont) +apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { if (gethostname(buf, len) == -1) return errno; @@ -193,14 +193,14 @@ ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) +apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) { struct hostent *hptr; hptr = gethostbyaddr((char *)&(sock->remote_addr->sin_addr), sizeof(struct in_addr), AF_INET); if (hptr != NULL) { - *name = ap_pstrdup(sock->cntxt, hptr->h_name); + *name = apr_pstrdup(sock->cntxt, hptr->h_name); if (*name) { return APR_SUCCESS; } diff --git a/network_io/win32/networkio.h b/network_io/win32/networkio.h index 296127288f8..3d5897a6249 100644 --- a/network_io/win32/networkio.h +++ b/network_io/win32/networkio.h @@ -58,20 +58,20 @@ #include "apr_network_io.h" #include "apr_general.h" -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; SOCKET sock; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; size_t addr_len; - ap_interval_time_t timeout; - ap_int32_t disconnected; + apr_interval_time_t timeout; + apr_int32_t disconnected; int local_port_unknown; int local_interface_unknown; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; +struct apr_pollfd_t { + apr_pool_t *cntxt; fd_set *read; int numread; fd_set *write; @@ -80,7 +80,7 @@ struct ap_pollfd_t { int numexcept; }; -ap_status_t status_from_res_error(int); +apr_status_t status_from_res_error(int); #endif /* ! NETWORK_IO_H */ diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 11e9e35bb45..843a4c5b261 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -60,16 +60,16 @@ #include -ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) +apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { - (*new) = (ap_pollfd_t *)ap_palloc(cont, sizeof(ap_pollfd_t) * num); + (*new) = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t) * num); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->read = (fd_set *)ap_palloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)ap_palloc(cont, sizeof(fd_set)); - (*new)->except = (fd_set *)ap_palloc(cont, sizeof(fd_set)); + (*new)->read = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->write = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->except = (fd_set *)apr_palloc(cont, sizeof(fd_set)); FD_ZERO((*new)->read); (*new)->numread = 0; FD_ZERO((*new)->write); @@ -79,8 +79,8 @@ ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t event) +apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t event) { if (event & APR_POLLIN) { FD_SET(sock->sock, aprset->read); @@ -97,8 +97,8 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, - ap_interval_time_t timeout) +apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, + apr_interval_time_t timeout) { int rv; struct timeval tv, *tvptr; @@ -118,7 +118,7 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, if (newread == NULL && newwrite == NULL && newexcept == NULL) { Sleep(timeout / 1000); /* convert microseconds into milliseconds */ - return APR_TIMEUP; /* TODO - get everybody in synch with Win32 ap_status_t */ + return APR_TIMEUP; /* TODO - get everybody in synch with Win32 apr_status_t */ } else { if (timeout < 0) { @@ -140,9 +140,9 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, return APR_SUCCESS; } -ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) +apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { - ap_int16_t revents = 0; + apr_int16_t revents = 0; WSABUF data; int dummy; int flags = MSG_PEEK; @@ -151,7 +151,7 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap * variable here. */ data.len = 256; - data.buf = (char *)ap_palloc(aprset->cntxt, 256); + data.buf = (char *)apr_palloc(aprset->cntxt, 256); if (FD_ISSET(sock->sock, aprset->read)) { revents |= APR_POLLIN; @@ -193,19 +193,19 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap return APR_SUCCESS; } -ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data) +apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) { - return ap_get_userdata(data, key, pollfd->cntxt); + return apr_get_userdata(data, key, pollfd->cntxt); } -ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, pollfd->cntxt); + return apr_set_userdata(data, key, cleanup, pollfd->cntxt); } -ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t events) +apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t events) { if (events & APR_POLLIN) { FD_CLR(sock->sock, aprset->read); @@ -222,12 +222,12 @@ ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) +apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) { - return ap_mask_poll_socket(aprset, sock, ~0); + return apr_mask_poll_socket(aprset, sock, ~0); } -ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events) +apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events) { if (events & APR_POLLIN) { FD_ZERO(aprset->read); diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 5a46b3d1db3..f26c724c197 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -60,9 +60,9 @@ #include "fileio.h" #include -ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) { - ap_ssize_t rv; + apr_ssize_t rv; WSABUF wsaData; int lasterror; DWORD dwBytes = 0; @@ -81,9 +81,9 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) return APR_SUCCESS; } -ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) { - ap_ssize_t rv; + apr_ssize_t rv; WSABUF wsaData; int lasterror; DWORD dwBytes = 0; @@ -104,10 +104,10 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) } -ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, - ap_int32_t nvec, ap_int32_t *nbytes) +apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, + apr_int32_t nvec, apr_int32_t *nbytes) { - ap_ssize_t rv; + apr_ssize_t rv; int i; int lasterror; DWORD dwBytes = 0; @@ -136,8 +136,8 @@ ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, } #if APR_HAS_SENDFILE /* - * ap_status_t ap_sendfile(ap_socket_t *, ap_file_t *, ap_hdtr_t *, - * ap_off_t *, ap_size_t *, ap_int32_t flags) + * apr_status_t ap_sendfile(apr_socket_t *, apr_file_t *, apr_hdtr_t *, + * apr_off_t *, apr_size_t *, apr_int32_t flags) * Send a file from an open file descriptor to a socket, along with * optional headers and trailers * arg 1) The socket to which we're writing @@ -147,9 +147,9 @@ ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, * arg 5) Number of bytes to send * arg 6) APR flags that are mapped to OS specific flags */ -ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, - ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, - ap_int32_t flags) +apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_int32_t flags) { /* *#define WAIT_FOR_EVENT @@ -162,7 +162,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, * socket timeout code will work. I am hoping the socket will be signaled if the * setsockopt timeout expires. Need to verify this... */ - ap_ssize_t rv; + apr_ssize_t rv; OVERLAPPED overlapped; TRANSMIT_FILE_BUFFERS tfb, *ptfb = NULL; int i, ptr = 0; @@ -188,7 +188,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, for (i = 0; i < hdtr->numheaders; i++) { ptfb->HeadLength += hdtr->headers[i].iov_len; } - ptfb->Head = ap_palloc(sock->cntxt, ptfb->HeadLength); /* Should this be a malloc? */ + ptfb->Head = apr_palloc(sock->cntxt, ptfb->HeadLength); /* Should this be a malloc? */ for (i = 0; i < hdtr->numheaders; i++) { memcpy((char*)ptfb->Head + ptr, hdtr->headers[i].iov_base, @@ -209,7 +209,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, ptfb->TailLength += hdtr->headers[i].iov_len; } - ptfb->Tail = ap_palloc(sock->cntxt, ptfb->TailLength); /* Should this be a malloc? */ + ptfb->Tail = apr_palloc(sock->cntxt, ptfb->TailLength); /* Should this be a malloc? */ for (i = 0; i < hdtr->numtrailers; i++) { memcpy((char*)ptfb->Tail + ptr, hdtr->trailers[i].iov_base, diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index d4c72433829..a80c8f5eac0 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -58,7 +58,7 @@ #include "apr_strings.h" #include -static ap_status_t get_local_addr(ap_socket_t *sock) +static apr_status_t get_local_addr(apr_socket_t *sock) { size_t namelen = sizeof(*sock->local_addr); @@ -74,7 +74,7 @@ static ap_status_t get_local_addr(ap_socket_t *sock) -ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) +apr_status_t apr_set_local_port(apr_socket_t *sock, apr_uint32_t port) { sock->local_addr->sin_port = htons((short)port); return APR_SUCCESS; @@ -82,7 +82,7 @@ ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) -ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) +apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_uint32_t port) { sock->remote_addr->sin_port = htons((short)port); return APR_SUCCESS; @@ -90,10 +90,10 @@ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) -ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) +apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock) { if (sock->local_port_unknown) { - ap_status_t rv = get_local_addr(sock); + apr_status_t rv = get_local_addr(sock); if (rv != APR_SUCCESS) { return rv; @@ -106,7 +106,7 @@ ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) -ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) +apr_status_t apr_get_remote_port(apr_uint32_t *port, apr_socket_t *sock) { *port = ntohs(sock->remote_addr->sin_port); return APR_SUCCESS; @@ -114,7 +114,7 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) -ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) +apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr) { u_long ipaddr; @@ -133,7 +133,7 @@ ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) return APR_SUCCESS; } -ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) +apr_status_t apr_set_remote_ipaddr(apr_socket_t *sock, const char *addr) { u_long ipaddr; @@ -152,33 +152,33 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) return APR_SUCCESS; } -ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock) +apr_status_t apr_get_local_ipaddr(char **addr, apr_socket_t *sock) { if (sock->local_interface_unknown) { - ap_status_t rv = get_local_addr(sock); + apr_status_t rv = get_local_addr(sock); if (rv != APR_SUCCESS) { return rv; } } - *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); return APR_SUCCESS; } -ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock) +apr_status_t apr_get_remote_ipaddr(char **addr, apr_socket_t *sock) { - *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); return APR_SUCCESS; } -ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) +apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) { if (sock->local_port_unknown || sock->local_interface_unknown) { - ap_status_t rv = get_local_addr(sock); + apr_status_t rv = get_local_addr(sock); if (rv != APR_SUCCESS) { return rv; @@ -191,7 +191,7 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) -ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock) +apr_status_t apr_get_remote_name(struct sockaddr_in **name, apr_socket_t *sock) { *name = sock->remote_addr; return APR_SUCCESS; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 3a5cf8445ca..dc6d5f72d29 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -60,9 +60,9 @@ #include -static ap_status_t socket_cleanup(void *sock) +static apr_status_t socket_cleanup(void *sock) { - ap_socket_t *thesocket = sock; + apr_socket_t *thesocket = sock; if (thesocket->sock != INVALID_SOCKET) { if (closesocket(thesocket->sock) == SOCKET_ERROR) { @@ -73,17 +73,17 @@ static ap_status_t socket_cleanup(void *sock) return APR_SUCCESS; } -ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) +apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) { - (*new) = (ap_socket_t *)ap_pcalloc(cont, sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_pcalloc(cont, sizeof(apr_socket_t)); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->local_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); if (((*new)->local_addr == NULL) || ((*new)->remote_addr == NULL)) { @@ -107,13 +107,13 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) (*new)->timeout = -1; (*new)->disconnected = 0; - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) +apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how) { int winhow; @@ -139,13 +139,13 @@ ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) } } -ap_status_t ap_close_socket(ap_socket_t *thesocket) +apr_status_t apr_close_socket(apr_socket_t *thesocket) { - ap_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); + apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } -ap_status_t ap_bind(ap_socket_t *sock) +apr_status_t apr_bind(apr_socket_t *sock) { if (bind(sock->sock, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) { return WSAGetLastError(); @@ -158,7 +158,7 @@ ap_status_t ap_bind(ap_socket_t *sock) } } -ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) +apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->sock, backlog) == SOCKET_ERROR) return WSAGetLastError(); @@ -166,15 +166,15 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_context) +apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { - (*new) = (ap_socket_t *)ap_pcalloc(connection_context, - sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_pcalloc(connection_context, + sizeof(apr_socket_t)); (*new)->cntxt = connection_context; - (*new)->local_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); memcpy((*new)->local_addr, sock->local_addr, sizeof(struct sockaddr_in)); @@ -207,12 +207,12 @@ ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connectio (*new)->local_interface_unknown = 1; } - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_connect(ap_socket_t *sock, char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, char *hostname) { struct hostent *hp; int lasterror; @@ -263,35 +263,35 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) return APR_SUCCESS; } -ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *socket) +apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *socket) { - return ap_get_userdata(data, key, socket->cntxt); + return apr_get_userdata(data, key, socket->cntxt); } -ap_status_t ap_set_socketdata(ap_socket_t *socket, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_socketdata(apr_socket_t *socket, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, socket->cntxt); + return apr_set_userdata(data, key, cleanup, socket->cntxt); } -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) +apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->sock; return APR_SUCCESS; } -ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, - ap_pool_t *cont) +apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*sock) == NULL) { - (*sock) = (ap_socket_t *)ap_pcalloc(cont, sizeof(ap_socket_t)); + (*sock) = (apr_socket_t *)apr_pcalloc(cont, sizeof(apr_socket_t)); (*sock)->cntxt = cont; - (*sock)->local_addr = (struct sockaddr_in *)ap_pcalloc((*sock)->cntxt, + (*sock)->local_addr = (struct sockaddr_in *)apr_pcalloc((*sock)->cntxt, sizeof(struct sockaddr_in)); - (*sock)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*sock)->cntxt, + (*sock)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*sock)->cntxt, sizeof(struct sockaddr_in)); if ((*sock)->local_addr == NULL || (*sock)->remote_addr == NULL) { diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 2d0845d63c7..2114ce92822 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -58,7 +58,7 @@ #include "apr_strings.h" #include -ap_status_t soblock(SOCKET sd) +apr_status_t soblock(SOCKET sd) { int zero = 0; @@ -68,7 +68,7 @@ ap_status_t soblock(SOCKET sd) return APR_SUCCESS; } -ap_status_t sononblock(SOCKET sd) +apr_status_t sononblock(SOCKET sd) { int one = 1; @@ -78,10 +78,10 @@ ap_status_t sononblock(SOCKET sd) return APR_SUCCESS; } -ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) +apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { int one; - ap_status_t stat; + apr_status_t stat; one = on ? 1 : 0; @@ -166,7 +166,7 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) return APR_SUCCESS; } -ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) +apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch (opt) { case APR_SO_TIMEOUT: @@ -190,7 +190,7 @@ ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) } -ap_status_t ap_gethostname(char *buf, int len, ap_pool_t *cont) +apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont) { if (gethostname(buf, len) == -1) return WSAGetLastError(); @@ -198,7 +198,7 @@ ap_status_t ap_gethostname(char *buf, int len, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) +apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) { struct hostent *hptr; @@ -206,7 +206,7 @@ ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) sizeof(struct in_addr), AF_INET); if (hptr != NULL) { - *name = ap_pstrdup(sock->cntxt, hptr->h_name); + *name = apr_pstrdup(sock->cntxt, hptr->h_name); if (*name) { return APR_SUCCESS; } diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 2c1797775de..e714aa7794c 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -52,7 +52,7 @@ * . */ -/* ap_getpass.c: abstraction to provide for obtaining a password from the +/* apr_getpass.c: abstraction to provide for obtaining a password from the * command line in whatever way the OS supports. In the best case, it's a * wrapper for the system library's getpass() routine; otherwise, we * use one we define ourselves. @@ -204,7 +204,7 @@ static char *getpass(const char *prompt) * but the caller is *not* made aware of it. */ -APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsiz) +APR_EXPORT(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, size_t *bufsiz) { char *pw_got = NULL; int result = 0; @@ -214,7 +214,7 @@ APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufs *bufsiz = ERR_OVERFLOW; return APR_ENAMETOOLONG; } - ap_cpystrn(pwbuf, pw_got, *bufsiz); + apr_cpystrn(pwbuf, pw_got, *bufsiz); *bufsiz = result; return APR_SUCCESS; } diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index 68aebfb8b85..edea993d431 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -86,7 +86,7 @@ */ /* - * The ap_MD5Encode() routine uses much code obtained from the FreeBSD 3.0 + * The apr_MD5Encode() routine uses much code obtained from the FreeBSD 3.0 * MD5 crypt() function, which is licenced as follows: * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): @@ -146,7 +146,7 @@ static unsigned char PADDING[64] = }; #ifdef CHARSET_EBCDIC -static ap_xlate_t *xlate_ebcdic_to_ascii; /* used in ap_MD5Encode() */ +static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_MD5Encode() */ #endif /* F, G, H and I are basic MD5 functions. @@ -186,7 +186,7 @@ static ap_xlate_t *xlate_ebcdic_to_ascii; /* used in ap_MD5Encode() */ /* MD5 initialization. Begins an MD5 operation, writing a new context. */ -APR_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context) +APR_EXPORT(apr_status_t) apr_MD5Init(ap_md5_ctx_t *context) { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ @@ -205,9 +205,9 @@ APR_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context) * to be used for translating the content before calculating the * digest. */ -APR_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) +APR_EXPORT(apr_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, apr_xlate_t *xlate) { - ap_status_t rv; + apr_status_t rv; int is_sb; /* TODO: remove the single-byte-only restriction from this code @@ -228,13 +228,13 @@ APR_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) operation, processing another message block, and updating the context. */ -APR_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, +APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) { unsigned int i, idx, partLen; #if APR_HAS_XLATE - ap_size_t inbytes_left, outbytes_left; + apr_size_t inbytes_left, outbytes_left; #endif /* Compute number of bytes mod 64 */ @@ -309,7 +309,7 @@ APR_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ -APR_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], +APR_EXPORT(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], ap_md5_ctx_t *context) { unsigned char bits[8]; @@ -319,17 +319,17 @@ APR_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], Encode(bits, context->count, 8); #if APR_HAS_XLATE - /* ap_MD5Update() should not translate for this final round. */ + /* apr_MD5Update() should not translate for this final round. */ context->xlate = NULL; #endif /*APR_HAS_XLATE*/ /* Pad out to 56 mod 64. */ idx = (unsigned int) ((context->count[0] >> 3) & 0x3f); padLen = (idx < 56) ? (56 - idx) : (120 - idx); - ap_MD5Update(context, PADDING, padLen); + apr_MD5Update(context, PADDING, padLen); /* Append length (before padding) */ - ap_MD5Update(context, bits, 8); + apr_MD5Update(context, bits, 8); /* Store state in digest */ Encode(digest, context->state, MD5_DIGESTSIZE); @@ -459,7 +459,7 @@ static void Decode(UINT4 *output, const unsigned char *input, unsigned int len) } #ifdef CHARSET_EBCDIC -APR_EXPORT(ap_status_t) ap_MD5InitEBCDIC(ap_xlate_t *xlate) +APR_EXPORT(apr_status_t) ap_MD5InitEBCDIC(apr_xlate_t *xlate) { xlate_ebcdic_to_ascii = xlate; return APR_SUCCESS; @@ -489,7 +489,7 @@ static void to64(char *s, unsigned long v, int n) } } -APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, +APR_EXPORT(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, char *result, size_t nbytes) { /* @@ -534,7 +534,7 @@ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, /* * 'Time to make the doughnuts..' */ - ap_MD5Init(&ctx); + apr_MD5Init(&ctx); #ifdef CHARSET_EBCDIC ap_MD5SetXlate(&ctx, xlate_ebcdic_to_ascii); #endif @@ -542,28 +542,28 @@ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, /* * The password first, since that is what is most unknown */ - ap_MD5Update(&ctx, (unsigned char *)pw, strlen(pw)); + apr_MD5Update(&ctx, (unsigned char *)pw, strlen(pw)); /* * Then our magic string */ - ap_MD5Update(&ctx, (unsigned char *)apr1_id, strlen(apr1_id)); + apr_MD5Update(&ctx, (unsigned char *)apr1_id, strlen(apr1_id)); /* * Then the raw salt */ - ap_MD5Update(&ctx, (unsigned char *)sp, sl); + apr_MD5Update(&ctx, (unsigned char *)sp, sl); /* * Then just as many characters of the MD5(pw, salt, pw) */ - ap_MD5Init(&ctx1); - ap_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); - ap_MD5Update(&ctx1, (unsigned char *)sp, sl); - ap_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); - ap_MD5Final(final, &ctx1); + apr_MD5Init(&ctx1); + apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_MD5Update(&ctx1, (unsigned char *)sp, sl); + apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_MD5Final(final, &ctx1); for (pl = strlen(pw); pl > 0; pl -= MD5_DIGESTSIZE) { - ap_MD5Update(&ctx, final, (pl > MD5_DIGESTSIZE) ? MD5_DIGESTSIZE : pl); + apr_MD5Update(&ctx, final, (pl > MD5_DIGESTSIZE) ? MD5_DIGESTSIZE : pl); } /* @@ -576,10 +576,10 @@ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, */ for (i = strlen(pw); i != 0; i >>= 1) { if (i & 1) { - ap_MD5Update(&ctx, final, 1); + apr_MD5Update(&ctx, final, 1); } else { - ap_MD5Update(&ctx, (unsigned char *)pw, 1); + apr_MD5Update(&ctx, (unsigned char *)pw, 1); } } @@ -591,7 +591,7 @@ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, strncat(passwd, sp, sl); strcat(passwd, "$"); - ap_MD5Final(final, &ctx); + apr_MD5Final(final, &ctx); /* * And now, just to make sure things don't run too fast.. @@ -599,28 +599,28 @@ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, * need 30 seconds to build a 1000 entry dictionary... */ for (i = 0; i < 1000; i++) { - ap_MD5Init(&ctx1); + apr_MD5Init(&ctx1); if (i & 1) { - ap_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); } else { - ap_MD5Update(&ctx1, final, MD5_DIGESTSIZE); + apr_MD5Update(&ctx1, final, MD5_DIGESTSIZE); } if (i % 3) { - ap_MD5Update(&ctx1, (unsigned char *)sp, sl); + apr_MD5Update(&ctx1, (unsigned char *)sp, sl); } if (i % 7) { - ap_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); } if (i & 1) { - ap_MD5Update(&ctx1, final, MD5_DIGESTSIZE); + apr_MD5Update(&ctx1, final, MD5_DIGESTSIZE); } else { - ap_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); } - ap_MD5Final(final,&ctx1); + apr_MD5Final(final,&ctx1); } p = passwd + strlen(passwd); @@ -638,18 +638,18 @@ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, */ memset(final, 0, sizeof(final)); - ap_cpystrn(result, passwd, nbytes - 1); + apr_cpystrn(result, passwd, nbytes - 1); return APR_SUCCESS; } /* * Validate a plaintext password against a smashed one. Use either - * crypt() (if available) or ap_MD5Encode(), depending upon the format + * crypt() (if available) or apr_MD5Encode(), depending upon the format * of the smashed input password. Return APR_SUCCESS if they match, or * APR_EMISMATCH if they don't. */ -APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *hash) +APR_EXPORT(apr_status_t) apr_validate_password(const char *passwd, const char *hash) { char sample[120]; #if !defined(WIN32) && !defined(BEOS) @@ -659,17 +659,17 @@ APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *has /* * The hash was created using our custom algorithm. */ - ap_MD5Encode(passwd, hash, sample, sizeof(sample)); + apr_MD5Encode(passwd, hash, sample, sizeof(sample)); } else { /* * It's not our algorithm, so feed it to crypt() if possible. */ #if defined(WIN32) || defined(BEOS) - ap_cpystrn(sample, passwd, sizeof(sample) - 1); + apr_cpystrn(sample, passwd, sizeof(sample) - 1); #else crypt_pw = crypt(passwd, hash); - ap_cpystrn(sample, crypt_pw, sizeof(sample) - 1); + apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); #endif } return (strcmp(sample, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; diff --git a/shmem/os2/shmem.c b/shmem/os2/shmem.c index 87536e546c9..7c8ade24e44 100644 --- a/shmem/os2/shmem.c +++ b/shmem/os2/shmem.c @@ -68,14 +68,14 @@ struct shmem_t { -ap_status_t ap_shm_init(struct shmem_t **m, ap_size_t reqsize, const char *file, ap_pool_t *cont) +apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) { int rc; - struct shmem_t *newm = (struct shmem_t *)ap_palloc(cont, sizeof(struct shmem_t)); + struct shmem_t *newm = (struct shmem_t *)apr_palloc(cont, sizeof(struct shmem_t)); char *name = NULL; if (file) - name = ap_pstrcat(cont, "\\SHAREMEM\\", file, NULL); + name = apr_pstrcat(cont, "\\SHAREMEM\\", file, NULL); rc = DosAllocSharedMem(&(newm->memblock), name, reqsize, PAG_COMMIT|OBJ_GETTABLE|PAG_READ|PAG_WRITE); @@ -90,7 +90,7 @@ ap_status_t ap_shm_init(struct shmem_t **m, ap_size_t reqsize, const char *file, -ap_status_t ap_shm_destroy(struct shmem_t *m) +apr_status_t apr_shm_destroy(struct shmem_t *m) { _uclose(m->heap); _udestroy(m->heap, _FORCE); @@ -100,21 +100,21 @@ ap_status_t ap_shm_destroy(struct shmem_t *m) -void *ap_shm_malloc(struct shmem_t *m, ap_size_t reqsize) +void *apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize) { return _umalloc(m->heap, reqsize); } -void *ap_shm_calloc(struct shmem_t *m, ap_size_t size) +void *apr_shm_calloc(struct shmem_t *m, apr_size_t size) { return _ucalloc(m->heap, size, 1); } -ap_status_t ap_shm_free(struct shmem_t *m, void *entity) +apr_status_t apr_shm_free(struct shmem_t *m, void *entity) { free(entity); return APR_SUCCESS; @@ -122,7 +122,7 @@ ap_status_t ap_shm_free(struct shmem_t *m, void *entity) -ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name) +apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) { *name = NULL; return APR_ANONYMOUS; @@ -130,14 +130,14 @@ ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name) -ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name) +apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) { return APR_ANONYMOUS; } -ap_status_t ap_open_shmem(struct shmem_t *m) +apr_status_t apr_open_shmem(struct shmem_t *m) { int rc; @@ -152,7 +152,7 @@ ap_status_t ap_open_shmem(struct shmem_t *m) -ap_status_t ap_shm_avail(struct shmem_t *c, ap_size_t *size) +apr_status_t apr_shm_avail(struct shmem_t *c, apr_size_t *size) { return APR_ENOTIMPL; diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 726a171fe68..34bb94ff612 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -61,7 +61,7 @@ struct shmem_t { MM *mm; }; -ap_status_t ap_shm_init(struct shmem_t **m, ap_size_t reqsize, const char *file, ap_pool_t *cont) +apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) { MM *newmm = mm_create(reqsize, file); if (newmm == NULL) { @@ -72,13 +72,13 @@ ap_status_t ap_shm_init(struct shmem_t **m, ap_size_t reqsize, const char *file, return APR_SUCCESS; } -ap_status_t ap_shm_destroy(struct shmem_t *m) +apr_status_t apr_shm_destroy(struct shmem_t *m) { mm_destroy(m->mm); return APR_SUCCESS; } -void *ap_shm_malloc(struct shmem_t *c, ap_size_t reqsize) +void *apr_shm_malloc(struct shmem_t *c, apr_size_t reqsize) { if (c->mm == NULL) { return NULL; @@ -86,7 +86,7 @@ void *ap_shm_malloc(struct shmem_t *c, ap_size_t reqsize) return mm_malloc(c->mm, reqsize); } -void *ap_shm_calloc(struct shmem_t *shared, ap_size_t size) +void *apr_shm_calloc(struct shmem_t *shared, apr_size_t size) { if (shared == NULL) { return NULL; @@ -94,13 +94,13 @@ void *ap_shm_calloc(struct shmem_t *shared, ap_size_t size) return mm_calloc(shared->mm, 1, size); } -ap_status_t ap_shm_free(struct shmem_t *shared, void *entity) +apr_status_t apr_shm_free(struct shmem_t *shared, void *entity) { mm_free(shared->mm, entity); return APR_SUCCESS; } -ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name) +apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) { #if APR_USES_ANONYMOUS_SHM *name = NULL; @@ -115,7 +115,7 @@ ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name) #endif } -ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name) +apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) { #if APR_USES_ANONYMOUS_SHM return APR_ANONYMOUS; @@ -129,7 +129,7 @@ ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name) #endif } -ap_status_t ap_open_shmem(struct shmem_t *c) +apr_status_t apr_open_shmem(struct shmem_t *c) { #if APR_USES_ANONYMOUS_SHM /* When using MM, we don't need to open shared memory segments in child @@ -146,7 +146,7 @@ ap_status_t ap_open_shmem(struct shmem_t *c) #endif } -ap_status_t ap_shm_avail(struct shmem_t *c, ap_size_t *size) +apr_status_t apr_shm_avail(struct shmem_t *c, apr_size_t *size) { *size = mm_available(c); if (*size == 0) { diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index 0f6a503b220..7c12cc8788f 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -77,10 +77,10 @@ * the destination string, we return a pointer to the * terminating '\0' to allow us to "check" for truncation * - * ap_cpystrn() follows the same call structure as strncpy(). + * apr_cpystrn() follows the same call structure as strncpy(). */ -APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size) +APR_EXPORT(char *) apr_cpystrn(char *dst, const char *src, size_t dst_size) { char *d, *end; @@ -120,9 +120,9 @@ APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size) * pool and filled in with copies of the tokens * found during parsing of the arg_str. */ -APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, +APR_EXPORT(apr_status_t) apr_tokenize_to_argv(const char *arg_str, char ***argv_out, - ap_pool_t *token_context) + apr_pool_t *token_context) { const char *cp; const char *tmpCnt; @@ -172,7 +172,7 @@ APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, SKIP_WHITESPACE(tmpCnt); } - *argv_out = ap_palloc(token_context, numargs*sizeof(char*)); + *argv_out = apr_palloc(token_context, numargs*sizeof(char*)); if (*argv_out == NULL) { return (APR_ENOMEM); } @@ -184,15 +184,15 @@ APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, tmpCnt = cp; DETERMINE_NEXTSTRING(cp, isquoted); if (*cp == '\0') { - (*argv_out)[numargs] = ap_pstrdup(token_context, tmpCnt); + (*argv_out)[numargs] = apr_pstrdup(token_context, tmpCnt); numargs++; (*argv_out)[numargs] = '\0'; break; } else { cp++; - (*argv_out)[numargs] = ap_palloc(token_context, cp - tmpCnt); - ap_cpystrn((*argv_out)[numargs], tmpCnt, cp - tmpCnt); + (*argv_out)[numargs] = apr_palloc(token_context, cp - tmpCnt); + apr_cpystrn((*argv_out)[numargs], tmpCnt, cp - tmpCnt); numargs++; } @@ -212,7 +212,7 @@ APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, * Corrected Win32 to accept "a/b\\stuff", "a:stuff" */ -APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname) +APR_EXPORT(const char *) apr_filename_of_pathname(const char *pathname) { const char path_separator = '/'; const char *s = strrchr(pathname, path_separator); @@ -234,7 +234,7 @@ APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname) * collapse in place (src == dest) is legal. * returns terminating null ptr to dest string. */ -APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src) +APR_EXPORT(char *) apr_collapse_spaces(char *dest, const char *src) { while (*src) { if (!ap_isspace(*src)) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index b8449ef3710..f1c86fca303 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -56,7 +56,7 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; static const char *rangematch(const char *, int, int); -APR_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *string, int flags) +APR_EXPORT(apr_status_t) apr_fnmatch(const char *pattern, const char *string, int flags) { const char *stringstart; char c, test; @@ -110,7 +110,7 @@ APR_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *string, int /* General case, use recursion. */ while ((test = *string) != EOS) { - if (!ap_fnmatch(pattern, string, flags & ~FNM_PERIOD)) { + if (!apr_fnmatch(pattern, string, flags & ~FNM_PERIOD)) { return (APR_SUCCESS); } if (test == '/' && flags & FNM_PATHNAME) { @@ -210,7 +210,7 @@ static const char *rangematch(const char *pattern, int test, int flags) /* This function is an Apache addition */ /* return non-zero if pattern has any glob chars in it */ -APR_EXPORT(int) ap_is_fnmatch(const char *pattern) +APR_EXPORT(int) apr_is_fnmatch(const char *pattern) { int nesting; diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 4e377f8a3db..3427baa6937 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -51,7 +51,7 @@ * information on the Apache Software Foundation, please see * . * - * The ap_vsnprintf/ap_snprintf functions are based on, and used with the + * The apr_vsnprintf/apr_snprintf functions are based on, and used with the * permission of, the SIO stdio-replacement strx_* functions by Panos * Tsirigotis for xinetd. */ @@ -656,8 +656,8 @@ static char *conv_p2_quad(u_widest_int num, register int nbits, /* * Do format conversion placing the output in buffer */ -APR_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *), - ap_vformatter_buff_t *vbuff, const char *fmt, va_list ap) +APR_EXPORT(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), + apr_vformatter_buff_t *vbuff, const char *fmt, va_list ap) { register char *sp; register char *bep; @@ -1149,21 +1149,21 @@ APR_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *), } -static int snprintf_flush(ap_vformatter_buff_t *vbuff) +static int snprintf_flush(apr_vformatter_buff_t *vbuff) { /* if the buffer fills we have to abort immediately, there is no way - * to "flush" an ap_snprintf... there's nowhere to flush it to. + * to "flush" an apr_snprintf... there's nowhere to flush it to. */ return -1; } -APR_EXPORT_NONSTD(int) ap_snprintf(char *buf, size_t len, +APR_EXPORT_NONSTD(int) apr_snprintf(char *buf, size_t len, const char *format, ...) { int cc; va_list ap; - ap_vformatter_buff_t vbuff; + apr_vformatter_buff_t vbuff; if (len == 0) return 0; @@ -1172,18 +1172,18 @@ APR_EXPORT_NONSTD(int) ap_snprintf(char *buf, size_t len, vbuff.curpos = buf; vbuff.endpos = buf + len - 1; va_start(ap, format); - cc = ap_vformatter(snprintf_flush, &vbuff, format, ap); + cc = apr_vformatter(snprintf_flush, &vbuff, format, ap); va_end(ap); *vbuff.curpos = '\0'; return (cc == -1) ? len : cc; } -APR_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, +APR_EXPORT(int) apr_vsnprintf(char *buf, size_t len, const char *format, va_list ap) { int cc; - ap_vformatter_buff_t vbuff; + apr_vformatter_buff_t vbuff; if (len == 0) return 0; @@ -1191,7 +1191,7 @@ APR_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, /* save one byte for nul terminator */ vbuff.curpos = buf; vbuff.endpos = buf + len - 1; - cc = ap_vformatter(snprintf_flush, &vbuff, format, ap); + cc = apr_vformatter(snprintf_flush, &vbuff, format, ap); *vbuff.curpos = '\0'; return (cc == -1) ? len : cc; } diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 2d53695f8e5..f072f260d43 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -57,7 +57,7 @@ #include "apr_private.h" #include "apr_lib.h" -APR_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) +APR_EXPORT(char *) apr_pstrdup(apr_pool_t *a, const char *s) { char *res; size_t len; @@ -66,31 +66,31 @@ APR_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) return NULL; } len = strlen(s) + 1; - res = ap_palloc(a, len); + res = apr_palloc(a, len); memcpy(res, s, len); return res; } -APR_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, ap_size_t n) +APR_EXPORT(char *) apr_pstrndup(apr_pool_t *a, const char *s, apr_size_t n) { char *res; if (s == NULL) { return NULL; } - res = ap_palloc(a, n + 1); + res = apr_palloc(a, n + 1); memcpy(res, s, n); res[n] = '\0'; return res; } -APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *a, ...) +APR_EXPORT_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) { char *cp, *argp, *res; /* Pass one --- find length of required string */ - ap_size_t len = 0; + apr_size_t len = 0; va_list adummy; va_start(adummy, a); @@ -103,7 +103,7 @@ APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *a, ...) /* Allocate the required string */ - res = (char *) ap_palloc(a, len + 1); + res = (char *) apr_palloc(a, len + 1); cp = res; *cp = '\0'; diff --git a/strings/apr_strnatcmp.c b/strings/apr_strnatcmp.c index 8eeaf41cd50..f1057fde69a 100644 --- a/strings/apr_strnatcmp.c +++ b/strings/apr_strnatcmp.c @@ -140,12 +140,12 @@ static int strnatcmp0(char const *a, char const *b, int fold_case) -int ap_strnatcmp(char const *a, char const *b) { +int apr_strnatcmp(char const *a, char const *b) { return strnatcmp0(a, b, 0); } /* Compare, recognizing numeric string and ignoring case. */ -int ap_strnatcasecmp(char const *a, char const *b) { +int apr_strnatcasecmp(char const *a, char const *b) { return strnatcmp0(a, b, 1); } diff --git a/tables/apr_hash.c b/tables/apr_hash.c index f486a269857..2cff888ba08 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -97,8 +97,8 @@ struct ap_hash_entry_t { * The count of hash entries may be greater depending on the chosen * collision rate. */ -struct ap_hash_t { - ap_pool_t *pool; +struct apr_hash_t { + apr_pool_t *pool; ap_hash_entry_t **array; size_t count, max; }; @@ -109,10 +109,10 @@ struct ap_hash_t { * * We keep a pointer to the next hash entry here to allow the current * hash entry to be freed or otherwise mangled between calls to - * ap_hash_next(). + * apr_hash_next(). */ -struct ap_hash_index_t { - ap_hash_t *ht; +struct apr_hash_index_t { + apr_hash_t *ht; ap_hash_entry_t *this, *next; int index; }; @@ -122,15 +122,15 @@ struct ap_hash_index_t { * Hash creation functions. */ -static ap_hash_entry_t **alloc_array(ap_hash_t *ht) +static ap_hash_entry_t **alloc_array(apr_hash_t *ht) { - return ap_pcalloc(ht->pool, sizeof(*ht->array) * (ht->max + 1)); + return apr_pcalloc(ht->pool, sizeof(*ht->array) * (ht->max + 1)); } -APR_EXPORT(ap_hash_t *) ap_make_hash(ap_pool_t *pool) +APR_EXPORT(apr_hash_t *) apr_make_hash(apr_pool_t *pool) { - ap_hash_t *ht; - ht = ap_palloc(pool, sizeof(ap_hash_t)); + apr_hash_t *ht; + ht = apr_palloc(pool, sizeof(apr_hash_t)); ht->pool = pool; ht->count = 0; ht->max = INITIAL_MAX; @@ -143,7 +143,7 @@ APR_EXPORT(ap_hash_t *) ap_make_hash(ap_pool_t *pool) * Hash iteration functions. */ -APR_EXPORT(ap_hash_index_t *) ap_hash_next(ap_hash_index_t *hi) +APR_EXPORT(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi) { hi->this = hi->next; while (!hi->this) { @@ -155,18 +155,18 @@ APR_EXPORT(ap_hash_index_t *) ap_hash_next(ap_hash_index_t *hi) return hi; } -APR_EXPORT(ap_hash_index_t *) ap_hash_first(ap_hash_t *ht) +APR_EXPORT(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht) { - ap_hash_index_t *hi; - hi = ap_palloc(ht->pool, sizeof(*hi)); + apr_hash_index_t *hi; + hi = apr_palloc(ht->pool, sizeof(*hi)); hi->ht = ht; hi->index = 0; hi->this = NULL; hi->next = NULL; - return ap_hash_next(hi); + return apr_hash_next(hi); } -APR_EXPORT(void) ap_hash_this(ap_hash_index_t *hi, +APR_EXPORT(void) apr_hash_this(apr_hash_index_t *hi, const void **key, size_t *klen, void **val) @@ -181,14 +181,14 @@ APR_EXPORT(void) ap_hash_this(ap_hash_index_t *hi, * Resizing a hash table */ -static void resize_array(ap_hash_t *ht) +static void resize_array(apr_hash_t *ht) { - ap_hash_index_t *hi; + apr_hash_index_t *hi; ap_hash_entry_t **new_array; int i; new_array = alloc_array(ht); - for (hi = ap_hash_first(ht); hi; hi = ap_hash_next(hi)) { + for (hi = apr_hash_first(ht); hi; hi = apr_hash_next(hi)) { i = hi->this->hash & ht->max; hi->this->next = new_array[i]; new_array[i] = hi->this; @@ -205,7 +205,7 @@ static void resize_array(ap_hash_t *ht) * that hash entries can be removed. */ -static ap_hash_entry_t **find_entry(ap_hash_t *ht, +static ap_hash_entry_t **find_entry(apr_hash_t *ht, const void *key, size_t klen, const void *val) @@ -266,7 +266,7 @@ static ap_hash_entry_t **find_entry(ap_hash_t *ht, if (he || !val) return hep; /* add a new entry for non-NULL values */ - he = ap_pcalloc(ht->pool, sizeof(*he)); + he = apr_pcalloc(ht->pool, sizeof(*he)); he->hash = hash; he->key = key; he->klen = klen; @@ -280,7 +280,7 @@ static ap_hash_entry_t **find_entry(ap_hash_t *ht, return hep; } -APR_EXPORT(void *) ap_hash_get(ap_hash_t *ht, +APR_EXPORT(void *) apr_hash_get(apr_hash_t *ht, const void *key, size_t klen) { @@ -292,7 +292,7 @@ APR_EXPORT(void *) ap_hash_get(ap_hash_t *ht, return NULL; } -APR_EXPORT(void) ap_hash_set(ap_hash_t *ht, +APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, size_t klen, const void *val) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index f8b6b04c849..f7661c49cab 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -81,7 +81,7 @@ #endif /***************************************************************** - * This file contains array and ap_table_t functions only. + * This file contains array and apr_table_t functions only. */ /***************************************************************** @@ -89,7 +89,7 @@ * The 'array' functions... */ -static void make_array_core(ap_array_header_t *res, ap_pool_t *c, +static void make_array_core(apr_array_header_t *res, apr_pool_t *c, int nelts, int elt_size) { /* @@ -100,7 +100,7 @@ static void make_array_core(ap_array_header_t *res, ap_pool_t *c, nelts = 1; } - res->elts = ap_pcalloc(c, nelts * elt_size); + res->elts = apr_pcalloc(c, nelts * elt_size); res->cont = c; res->elt_size = elt_size; @@ -108,23 +108,23 @@ static void make_array_core(ap_array_header_t *res, ap_pool_t *c, res->nalloc = nelts; /* ...but this many allocated */ } -APR_EXPORT(ap_array_header_t *) ap_make_array(ap_pool_t *p, +APR_EXPORT(apr_array_header_t *) apr_make_array(apr_pool_t *p, int nelts, int elt_size) { - ap_array_header_t *res; + apr_array_header_t *res; - res = (ap_array_header_t *) ap_palloc(p, sizeof(ap_array_header_t)); + res = (apr_array_header_t *) apr_palloc(p, sizeof(apr_array_header_t)); make_array_core(res, p, nelts, elt_size); return res; } -APR_EXPORT(void *) ap_push_array(ap_array_header_t *arr) +APR_EXPORT(void *) apr_push_array(apr_array_header_t *arr) { if (arr->nelts == arr->nalloc) { int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2; char *new_data; - new_data = ap_pcalloc(arr->cont, arr->elt_size * new_size); + new_data = apr_pcalloc(arr->cont, arr->elt_size * new_size); memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size); arr->elts = new_data; @@ -135,8 +135,8 @@ APR_EXPORT(void *) ap_push_array(ap_array_header_t *arr) return arr->elts + (arr->elt_size * (arr->nelts - 1)); } -APR_EXPORT(void) ap_array_cat(ap_array_header_t *dst, - const ap_array_header_t *src) +APR_EXPORT(void) apr_array_cat(apr_array_header_t *dst, + const apr_array_header_t *src) { int elt_size = dst->elt_size; @@ -148,7 +148,7 @@ APR_EXPORT(void) ap_array_cat(ap_array_header_t *dst, new_size *= 2; } - new_data = ap_pcalloc(dst->cont, elt_size * new_size); + new_data = apr_pcalloc(dst->cont, elt_size * new_size); memcpy(new_data, dst->elts, dst->nalloc * elt_size); dst->elts = new_data; @@ -160,10 +160,10 @@ APR_EXPORT(void) ap_array_cat(ap_array_header_t *dst, dst->nelts += src->nelts; } -APR_EXPORT(ap_array_header_t *) ap_copy_array(ap_pool_t *p, - const ap_array_header_t *arr) +APR_EXPORT(apr_array_header_t *) apr_copy_array(apr_pool_t *p, + const apr_array_header_t *arr) { - ap_array_header_t *res = ap_make_array(p, arr->nalloc, arr->elt_size); + apr_array_header_t *res = apr_make_array(p, arr->nalloc, arr->elt_size); memcpy(res->elts, arr->elts, arr->elt_size * arr->nelts); res->nelts = arr->nelts; @@ -177,8 +177,8 @@ APR_EXPORT(ap_array_header_t *) ap_copy_array(ap_pool_t *p, * overhead of the full copy only where it is really needed. */ -static APR_INLINE void copy_array_hdr_core(ap_array_header_t *res, - const ap_array_header_t *arr) +static APR_INLINE void copy_array_hdr_core(apr_array_header_t *res, + const apr_array_header_t *arr) { res->elts = arr->elts; res->elt_size = arr->elt_size; @@ -186,13 +186,13 @@ static APR_INLINE void copy_array_hdr_core(ap_array_header_t *res, res->nalloc = arr->nelts; /* Force overflow on push */ } -APR_EXPORT(ap_array_header_t *) - ap_copy_array_hdr(ap_pool_t *p, - const ap_array_header_t *arr) +APR_EXPORT(apr_array_header_t *) + apr_copy_array_hdr(apr_pool_t *p, + const apr_array_header_t *arr) { - ap_array_header_t *res; + apr_array_header_t *res; - res = (ap_array_header_t *) ap_palloc(p, sizeof(ap_array_header_t)); + res = (apr_array_header_t *) apr_palloc(p, sizeof(apr_array_header_t)); res->cont = p; copy_array_hdr_core(res, arr); return res; @@ -200,32 +200,32 @@ APR_EXPORT(ap_array_header_t *) /* The above is used here to avoid consing multiple new array bodies... */ -APR_EXPORT(ap_array_header_t *) - ap_append_arrays(ap_pool_t *p, - const ap_array_header_t *first, - const ap_array_header_t *second) +APR_EXPORT(apr_array_header_t *) + apr_append_arrays(apr_pool_t *p, + const apr_array_header_t *first, + const apr_array_header_t *second) { - ap_array_header_t *res = ap_copy_array_hdr(p, first); + apr_array_header_t *res = apr_copy_array_hdr(p, first); - ap_array_cat(res, second); + apr_array_cat(res, second); return res; } -/* ap_array_pstrcat generates a new string from the ap_pool_t containing +/* apr_array_pstrcat generates a new string from the apr_pool_t containing * the concatenated sequence of substrings referenced as elements within * the array. The string will be empty if all substrings are empty or null, * or if there are no elements in the array. * If sep is non-NUL, it will be inserted between elements as a separator. */ -APR_EXPORT(char *) ap_array_pstrcat(ap_pool_t *p, - const ap_array_header_t *arr, +APR_EXPORT(char *) apr_array_pstrcat(apr_pool_t *p, + const apr_array_header_t *arr, const char sep) { char *cp, *res, **strpp; int i, len; if (arr->nelts <= 0 || arr->elts == NULL) { /* Empty table? */ - return (char *) ap_pcalloc(p, 1); + return (char *) apr_pcalloc(p, 1); } /* Pass one --- find length of required string */ @@ -245,7 +245,7 @@ APR_EXPORT(char *) ap_array_pstrcat(ap_pool_t *p, /* Allocate the required string */ - res = (char *) ap_palloc(p, len + 1); + res = (char *) apr_palloc(p, len + 1); cp = res; /* Pass two --- copy the argument strings into the result space */ @@ -282,32 +282,32 @@ APR_EXPORT(char *) ap_array_pstrcat(ap_pool_t *p, * in alloc.h */ #ifdef MAKE_TABLE_PROFILE -static ap_table_entry_t *table_push(ap_table_t *t) +static apr_table_entry_t *table_push(apr_table_t *t) { if (t->a.nelts == t->a.nalloc) { return NULL; } - return (ap_table_entry_t *) ap_push_array(&t->a); + return (apr_table_entry_t *) apr_push_array(&t->a); } #else /* MAKE_TABLE_PROFILE */ -#define table_push(t) ((ap_table_entry_t *) ap_push_array(&(t)->a)) +#define table_push(t) ((apr_table_entry_t *) apr_push_array(&(t)->a)) #endif /* MAKE_TABLE_PROFILE */ -APR_EXPORT(ap_table_t *) ap_make_table(ap_pool_t *p, int nelts) +APR_EXPORT(apr_table_t *) apr_make_table(apr_pool_t *p, int nelts) { - ap_table_t *t = ap_palloc(p, sizeof(ap_table_t)); + apr_table_t *t = apr_palloc(p, sizeof(apr_table_t)); - make_array_core(&t->a, p, nelts, sizeof(ap_table_entry_t)); + make_array_core(&t->a, p, nelts, sizeof(apr_table_entry_t)); #ifdef MAKE_TABLE_PROFILE t->creator = __builtin_return_address(0); #endif return t; } -APR_EXPORT(ap_table_t *) ap_copy_table(ap_pool_t *p, const ap_table_t *t) +APR_EXPORT(apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) { - ap_table_t *new = ap_palloc(p, sizeof(ap_table_t)); + apr_table_t *new = apr_palloc(p, sizeof(apr_table_t)); #ifdef POOL_DEBUG /* we don't copy keys and values, so it's necessary that t->a.pool @@ -318,20 +318,20 @@ APR_EXPORT(ap_table_t *) ap_copy_table(ap_pool_t *p, const ap_table_t *t) abort(); } #endif - make_array_core(&new->a, p, t->a.nalloc, sizeof(ap_table_entry_t)); - memcpy(new->a.elts, t->a.elts, t->a.nelts * sizeof(ap_table_entry_t)); + make_array_core(&new->a, p, t->a.nalloc, sizeof(apr_table_entry_t)); + memcpy(new->a.elts, t->a.elts, t->a.nelts * sizeof(apr_table_entry_t)); new->a.nelts = t->a.nelts; return new; } -APR_EXPORT(void) ap_clear_table(ap_table_t *t) +APR_EXPORT(void) apr_clear_table(apr_table_t *t) { t->a.nelts = 0; } -APR_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key) +APR_EXPORT(const char *) apr_table_get(const apr_table_t *t, const char *key) { - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int i; if (key == NULL) { @@ -347,17 +347,17 @@ APR_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key) return NULL; } -APR_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_set(apr_table_t *t, const char *key, const char *val) { register int i, j, k; - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int done = 0; for (i = 0; i < t->a.nelts; ) { if (!strcasecmp(elts[i].key, key)) { if (!done) { - elts[i].val = ap_pstrdup(t->a.cont, val); + elts[i].val = apr_pstrdup(t->a.cont, val); done = 1; ++i; } @@ -375,17 +375,17 @@ APR_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, } if (!done) { - elts = (ap_table_entry_t *) table_push(t); - elts->key = ap_pstrdup(t->a.cont, key); - elts->val = ap_pstrdup(t->a.cont, val); + elts = (apr_table_entry_t *) table_push(t); + elts->key = apr_pstrdup(t->a.cont, key); + elts->val = apr_pstrdup(t->a.cont, val); } } -APR_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_setn(apr_table_t *t, const char *key, const char *val) { register int i, j, k; - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int done = 0; #ifdef POOL_DEBUG @@ -422,16 +422,16 @@ APR_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, } if (!done) { - elts = (ap_table_entry_t *) table_push(t); + elts = (apr_table_entry_t *) table_push(t); elts->key = (char *)key; elts->val = (char *)val; } } -APR_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key) +APR_EXPORT(void) apr_table_unset(apr_table_t *t, const char *key) { register int i, j, k; - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; for (i = 0; i < t->a.nelts; ) { if (!strcasecmp(elts[i].key, key)) { @@ -453,28 +453,28 @@ APR_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key) } } -APR_EXPORT(void) ap_table_merge(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_merge(apr_table_t *t, const char *key, const char *val) { - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int i; for (i = 0; i < t->a.nelts; ++i) { if (!strcasecmp(elts[i].key, key)) { - elts[i].val = ap_pstrcat(t->a.cont, elts[i].val, ", ", val, NULL); + elts[i].val = apr_pstrcat(t->a.cont, elts[i].val, ", ", val, NULL); return; } } - elts = (ap_table_entry_t *) table_push(t); - elts->key = ap_pstrdup(t->a.cont, key); - elts->val = ap_pstrdup(t->a.cont, val); + elts = (apr_table_entry_t *) table_push(t); + elts->key = apr_pstrdup(t->a.cont, key); + elts->val = apr_pstrdup(t->a.cont, val); } -APR_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_mergen(apr_table_t *t, const char *key, const char *val) { - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int i; #ifdef POOL_DEBUG @@ -492,30 +492,30 @@ APR_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, for (i = 0; i < t->a.nelts; ++i) { if (!strcasecmp(elts[i].key, key)) { - elts[i].val = ap_pstrcat(t->a.cont, elts[i].val, ", ", val, NULL); + elts[i].val = apr_pstrcat(t->a.cont, elts[i].val, ", ", val, NULL); return; } } - elts = (ap_table_entry_t *) table_push(t); + elts = (apr_table_entry_t *) table_push(t); elts->key = (char *)key; elts->val = (char *)val; } -APR_EXPORT(void) ap_table_add(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_add(apr_table_t *t, const char *key, const char *val) { - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; - elts = (ap_table_entry_t *) table_push(t); - elts->key = ap_pstrdup(t->a.cont, key); - elts->val = ap_pstrdup(t->a.cont, val); + elts = (apr_table_entry_t *) table_push(t); + elts->key = apr_pstrdup(t->a.cont, key); + elts->val = apr_pstrdup(t->a.cont, val); } -APR_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_addn(apr_table_t *t, const char *key, const char *val) { - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; #ifdef POOL_DEBUG { @@ -530,16 +530,16 @@ APR_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, } #endif - elts = (ap_table_entry_t *) table_push(t); + elts = (apr_table_entry_t *) table_push(t); elts->key = (char *)key; elts->val = (char *)val; } -APR_EXPORT(ap_table_t *) ap_overlay_tables(ap_pool_t *p, - const ap_table_t *overlay, - const ap_table_t *base) +APR_EXPORT(apr_table_t *) apr_overlay_tables(apr_pool_t *p, + const apr_table_t *overlay, + const apr_table_t *base) { - ap_table_t *res; + apr_table_t *res; #ifdef POOL_DEBUG /* we don't copy keys and values, so it's necessary that @@ -558,11 +558,11 @@ APR_EXPORT(ap_table_t *) ap_overlay_tables(ap_pool_t *p, } #endif - res = ap_palloc(p, sizeof(ap_table_t)); + res = apr_palloc(p, sizeof(apr_table_t)); /* behave like append_arrays */ res->a.cont = p; copy_array_hdr_core(&res->a, &overlay->a); - ap_array_cat(&res->a, &base->a); + apr_array_cat(&res->a, &base->a); return res; } @@ -572,7 +572,7 @@ APR_EXPORT(ap_table_t *) ap_overlay_tables(ap_pool_t *p, * For each key value given as a vararg: * run the function pointed to as * int comp(void *r, char *key, char *value); - * on each valid key-value pair in the ap_table_t t that matches the vararg key, + * on each valid key-value pair in the apr_table_t t that matches the vararg key, * or once for every valid key-value pair if the vararg list is empty, * until the function returns false (0) or we finish the table. * @@ -582,47 +582,47 @@ APR_EXPORT(ap_table_t *) ap_overlay_tables(ap_pool_t *p, * only one traversal will be made and will cut short if comp returns 0. * * Note that the table_get and table_merge functions assume that each key in - * the ap_table_t is unique (i.e., no multiple entries with the same key). This + * the apr_table_t is unique (i.e., no multiple entries with the same key). This * function does not make that assumption, since it (unfortunately) isn't * true for some of Apache's tables. * * Note that rec is simply passed-on to the comp function, so that the * caller can pass additional info for the task. * - * ADDENDUM for ap_table_vdo(): + * ADDENDUM for apr_table_vdo(): * * The caching api will allow a user to walk the header values: * - * ap_status_t ap_cache_el_header_walk(ap_cache_el *el, + * apr_status_t ap_cache_el_header_walk(ap_cache_el *el, * int (*comp)(void *, const char *, const char *), void *rec, ...); * * So it can be ..., however from there I use a callback that use a va_list: * - * ap_status_t (*cache_el_header_walk)(ap_cache_el *el, + * apr_status_t (*cache_el_header_walk)(ap_cache_el *el, * int (*comp)(void *, const char *, const char *), void *rec, va_list); * * To pass those ...'s on down to the actual module that will handle walking * their headers, in the file case this is actually just an ap_table - and - * rather than reimplementing ap_table_do (which IMHO would be bad) I just + * rather than reimplementing apr_table_do (which IMHO would be bad) I just * called it with the va_list. For mod_shmem_cache I don't need it since I * can't use ap_table's, but mod_file_cache should (though a good hash would * be better, but that's a different issue :). * * So to make mod_file_cache easier to maintain, it's a good thing */ -APR_EXPORT(void) ap_table_do(int (*comp) (void *, const char *, const char *), - void *rec, const ap_table_t *t, ...) +APR_EXPORT(void) apr_table_do(int (*comp) (void *, const char *, const char *), + void *rec, const apr_table_t *t, ...) { va_list vp; va_start(vp, t); - ap_table_vdo(comp, rec, t, vp); + apr_table_vdo(comp, rec, t, vp); va_end(vp); } -APR_EXPORT(void) ap_table_vdo(int (*comp) (void *, const char *, const char *), - void *rec, const ap_table_t *t, va_list vp) +APR_EXPORT(void) apr_table_vdo(int (*comp) (void *, const char *, const char *), + void *rec, const apr_table_t *t, va_list vp) { char *argp; - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int rv, i; argp = va_arg(vp, char *); do { @@ -666,14 +666,14 @@ static int sort_overlap(const void *va, const void *vb) #define ap_OVERLAP_TABLES_ON_STACK (512) #endif -APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, +APR_EXPORT(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, unsigned flags) { overlap_key cat_keys_buf[ap_OVERLAP_TABLES_ON_STACK]; overlap_key *cat_keys; int nkeys; - ap_table_entry_t *e; - ap_table_entry_t *last_e; + apr_table_entry_t *e; + apr_table_entry_t *last_e; overlap_key *left; overlap_key *right; overlap_key *last; @@ -686,7 +686,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, /* XXX: could use scratch free space in a or b's pool instead... * which could save an allocation in b's pool. */ - cat_keys = ap_palloc(b->a.cont, sizeof(overlap_key) * nkeys); + cat_keys = apr_palloc(b->a.cont, sizeof(overlap_key) * nkeys); } nkeys = 0; @@ -694,7 +694,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, /* Create a list of the entries from a concatenated with the entries * from b. */ - e = (ap_table_entry_t *)a->a.elts; + e = (apr_table_entry_t *)a->a.elts; last_e = e + a->a.nelts; while (e < last_e) { cat_keys[nkeys].key = e->key; @@ -704,7 +704,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, ++e; } - e = (ap_table_entry_t *)b->a.elts; + e = (apr_table_entry_t *)b->a.elts; last_e = e + b->a.nelts; while (e < last_e) { cat_keys[nkeys].key = e->key; @@ -721,7 +721,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, */ a->a.nelts = 0; if (a->a.nalloc < nkeys) { - a->a.elts = ap_palloc(a->a.cont, a->a.elt_size * nkeys * 2); + a->a.elts = apr_palloc(a->a.cont, a->a.elt_size * nkeys * 2); a->a.nalloc = nkeys * 2; } @@ -743,7 +743,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, right = left + 1; if (right == last || strcasecmp(left->key, right->key)) { - ap_table_addn(a, left->key, left->val); + apr_table_addn(a, left->key, left->val); left = right; } else { @@ -763,7 +763,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, } while (right < last && !strcasecmp(left->key, right->key)); /* right points one past the last header to merge */ - value = ap_palloc(a->a.cont, len + 1); + value = apr_palloc(a->a.cont, len + 1); strp = value; for (;;) { memcpy(strp, left->val, left->order); @@ -776,7 +776,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, *strp++ = ' '; } *strp = 0; - ap_table_addn(a, (left-1)->key, value); + apr_table_addn(a, (left-1)->key, value); } } } @@ -788,7 +788,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, while (right < last && !strcasecmp(left->key, right->key)) { ++right; } - ap_table_addn(a, (right-1)->key, (right-1)->val); + apr_table_addn(a, (right-1)->key, (right-1)->val); left = right; } } diff --git a/test/abc.c b/test/abc.c index eeb215e6ae7..894228d857b 100644 --- a/test/abc.c +++ b/test/abc.c @@ -6,17 +6,17 @@ int main(int argc, char *argv[]) { - ap_file_t *fd = NULL; + apr_file_t *fd = NULL; char ch; int status = 0; - ap_pool_t *context; + apr_pool_t *context; - ap_create_pool(&context, NULL); + apr_create_pool(&context, NULL); - ap_open(&fd, argv[1], APR_READ, -1, context); + apr_open(&fd, argv[1], APR_READ, -1, context); while (!status) { - status = ap_getc(&ch, fd); + status = apr_getc(&ch, fd); if (status == APR_EOF ) fprintf(stdout, "EOF, YEAH!!!!!!!!!\n"); else if (status == APR_SUCCESS) diff --git a/test/client.c b/test/client.c index 438fa03cf57..845e643b3a5 100644 --- a/test/client.c +++ b/test/client.c @@ -62,17 +62,17 @@ int main(int argc, char *argv[]) { - ap_pool_t *context; - ap_socket_t *sock; - ap_ssize_t length; - ap_status_t stat; + apr_pool_t *context; + apr_socket_t *sock; + apr_ssize_t length; + apr_status_t stat; char datasend[STRLEN] = "Send data test"; char datarecv[STRLEN]; char msgbuf[80]; char *local_ipaddr, *remote_ipaddr; char *dest = "127.0.0.1"; - ap_uint32_t local_port, remote_port; - ap_interval_time_t read_timeout = -1; + apr_uint32_t local_port, remote_port; + apr_interval_time_t read_timeout = -1; setbuf(stdout, NULL); if (argc > 1) { @@ -84,22 +84,22 @@ int main(int argc, char *argv[]) } fprintf(stdout, "Initializing........."); - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Something went wrong\n"); exit(-1); } fprintf(stdout, "OK\n"); - atexit(ap_terminate); + atexit(apr_terminate); fprintf(stdout, "Creating context......."); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Something went wrong\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Creating new socket......."); - if (ap_create_tcp_socket(&sock, context) != APR_SUCCESS) { + if (apr_create_tcp_socket(&sock, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); } @@ -107,8 +107,8 @@ int main(int argc, char *argv[]) if (read_timeout == -1) { fprintf(stdout, "\tClient: Setting socket option NONBLOCK......."); - if (ap_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Couldn't set socket option\n"); exit(-1); } @@ -116,8 +116,8 @@ int main(int argc, char *argv[]) } fprintf(stdout, "\tClient: Setting port for socket......."); - if (ap_set_remote_port(sock, 8021) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_set_remote_port(sock, 8021) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Couldn't set the port correctly\n"); exit(-1); } @@ -125,27 +125,27 @@ int main(int argc, char *argv[]) fprintf(stdout, "\tClient: Connecting to socket......."); - stat = ap_connect(sock, dest); + stat = apr_connect(sock, dest); if (stat != APR_SUCCESS) { - ap_close_socket(sock); + apr_close_socket(sock); fprintf(stderr, "Could not connect: %s (%d)\n", - ap_strerror(stat, msgbuf, sizeof(msgbuf)), stat); + apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); fflush(stderr); exit(-1); } fprintf(stdout, "OK\n"); - ap_get_remote_ipaddr(&remote_ipaddr, sock); - ap_get_remote_port(&remote_port, sock); - ap_get_local_ipaddr(&local_ipaddr, sock); - ap_get_local_port(&local_port, sock); + apr_get_remote_ipaddr(&remote_ipaddr, sock); + apr_get_remote_port(&remote_port, sock); + apr_get_local_ipaddr(&local_ipaddr, sock); + apr_get_local_port(&local_port, sock); fprintf(stdout, "\tClient socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); fprintf(stdout, "\tClient: Trying to send data over socket......."); length = STRLEN; - if (ap_send(sock, datasend, &length) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_send(sock, datasend, &length) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Problem sending data\n"); exit(-1); } @@ -153,7 +153,7 @@ int main(int argc, char *argv[]) if (read_timeout != -1) { fprintf(stdout, "\tClient: Setting read timeout......."); - stat = ap_setsocketopt(sock, APR_SO_TIMEOUT, read_timeout); + stat = apr_setsocketopt(sock, APR_SO_TIMEOUT, read_timeout); if (stat) { fprintf(stderr, "Problem setting timeout: %d\n", stat); exit(-1); @@ -164,29 +164,29 @@ int main(int argc, char *argv[]) length = STRLEN; fprintf(stdout, "\tClient: Trying to receive data over socket......."); - if ((stat = ap_recv(sock, datarecv, &length)) != APR_SUCCESS) { - ap_close_socket(sock); + if ((stat = apr_recv(sock, datarecv, &length)) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Problem receiving data: %s (%d)\n", - ap_strerror(stat, msgbuf, sizeof(msgbuf)), stat); + apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); exit(-1); } if (strcmp(datarecv, "Recv data test")) { - ap_close_socket(sock); + apr_close_socket(sock); fprintf(stderr, "I did not receive the correct data %s\n", datarecv); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Shutting down socket......."); - if (ap_shutdown(sock, APR_SHUTDOWN_WRITE) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_shutdown(sock, APR_SHUTDOWN_WRITE) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Could not shutdown socket\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Closing down socket......."); - if (ap_close_socket(sock) != APR_SUCCESS) { + if (apr_close_socket(sock) != APR_SUCCESS) { fprintf(stderr, "Could not shutdown socket\n"); exit(-1); } diff --git a/test/server.c b/test/server.c index aad0de2708d..77637db5db1 100644 --- a/test/server.c +++ b/test/server.c @@ -61,123 +61,123 @@ int main(int argc, char *argv[]) { - ap_pool_t *context; - ap_socket_t *sock; - ap_socket_t *sock2; - ap_ssize_t length; - ap_int32_t rv; - ap_pollfd_t *sdset; + apr_pool_t *context; + apr_socket_t *sock; + apr_socket_t *sock2; + apr_ssize_t length; + apr_int32_t rv; + apr_pollfd_t *sdset; char datasend[STRLEN]; char datarecv[STRLEN] = "Recv data test"; char *local_ipaddr, *remote_ipaddr; - ap_uint32_t local_port, remote_port; + apr_uint32_t local_port, remote_port; fprintf(stdout, "Initializing........."); - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Something went wrong\n"); exit(-1); } fprintf(stdout, "OK\n"); - atexit(ap_terminate); + atexit(apr_terminate); fprintf(stdout, "Creating context......."); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Could not create a context\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Creating new socket......."); - if (ap_create_tcp_socket(&sock, context) != APR_SUCCESS) { + if (apr_create_tcp_socket(&sock, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Setting socket option NONBLOCK......."); - if (ap_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Couldn't set socket option\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Setting socket option REUSEADDR......."); - if (ap_setsocketopt(sock, APR_SO_REUSEADDR, 1) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_setsocketopt(sock, APR_SO_REUSEADDR, 1) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Couldn't set socket option\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Setting port for socket......."); - if (ap_set_local_port(sock, 8021) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_set_local_port(sock, 8021) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Couldn't set the port correctly\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Binding socket to port......."); - if (ap_bind(sock) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_bind(sock) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Could not bind\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Listening to socket......."); - if (ap_listen(sock, 8021) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_listen(sock, 8021) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Could not listen\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Setting up socket for polling......."); - ap_setup_poll(&sdset, 1, context); - ap_add_poll_socket(sdset, sock, APR_POLLIN); + apr_setup_poll(&sdset, 1, context); + apr_add_poll_socket(sdset, sock, APR_POLLIN); fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Beginning to poll for socket......."); rv = 1; - if (ap_poll(sdset, &rv, -1) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_poll(sdset, &rv, -1) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Select caused an error\n"); exit(-1); } else if (rv == 0) { - ap_close_socket(sock); + apr_close_socket(sock); fprintf(stderr, "I should not return until rv == 1\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Accepting a connection......."); - if (ap_accept(&sock2, sock, context) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_accept(&sock2, sock, context) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Could not accept connection.\n"); exit(-1); } fprintf(stdout, "OK\n"); - ap_get_remote_ipaddr(&remote_ipaddr, sock2); - ap_get_remote_port(&remote_port, sock2); - ap_get_local_ipaddr(&local_ipaddr, sock2); - ap_get_local_port(&local_port, sock2); + apr_get_remote_ipaddr(&remote_ipaddr, sock2); + apr_get_remote_port(&remote_port, sock2); + apr_get_local_ipaddr(&local_ipaddr, sock2); + apr_get_local_port(&local_port, sock2); fprintf(stdout, "\tServer socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); length = STRLEN; fprintf(stdout, "\tServer: Trying to recv data from socket......."); - if (ap_recv(sock2, datasend, &length) != APR_SUCCESS) { - ap_close_socket(sock); - ap_close_socket(sock2); + if (apr_recv(sock2, datasend, &length) != APR_SUCCESS) { + apr_close_socket(sock); + apr_close_socket(sock2); fprintf(stderr, "Problem recving data\n"); exit(-1); } if (strcmp(datasend, "Send data test")) { - ap_close_socket(sock); - ap_close_socket(sock2); + apr_close_socket(sock); + apr_close_socket(sock2); fprintf(stderr, "I did not receive the correct data %s\n", datarecv); exit(-1); } @@ -185,33 +185,33 @@ int main(int argc, char *argv[]) length = STRLEN; fprintf(stdout, "\tServer: Sending data over socket......."); - if (ap_send(sock2, datarecv, &length) != APR_SUCCESS) { - ap_close_socket(sock); - ap_close_socket(sock2); + if (apr_send(sock2, datarecv, &length) != APR_SUCCESS) { + apr_close_socket(sock); + apr_close_socket(sock2); fprintf(stderr, "Problem sending data\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Shutting down accepte socket......."); - if (ap_shutdown(sock2, APR_SHUTDOWN_READ) != APR_SUCCESS) { - ap_close_socket(sock); - ap_close_socket(sock2); + if (apr_shutdown(sock2, APR_SHUTDOWN_READ) != APR_SUCCESS) { + apr_close_socket(sock); + apr_close_socket(sock2); fprintf(stderr, "Problem shutting down\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: closing duplicate socket......."); - if (ap_close_socket(sock2) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_close_socket(sock2) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Problem closing down\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: closing original socket......."); - if (ap_close_socket(sock) != APR_SUCCESS) { + if (apr_close_socket(sock) != APR_SUCCESS) { fprintf(stderr, "Problem closing down\n"); exit(-1); } diff --git a/test/testargs.c b/test/testargs.c index 52ddf668feb..448bf5cb80a 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -65,14 +65,14 @@ int main(int argc, char * const argv[]) { - ap_pool_t *context; - ap_int32_t data; + apr_pool_t *context; + apr_int32_t data; - ap_initialize(); - atexit(ap_terminate); - ap_create_pool(&context, NULL); + apr_initialize(); + atexit(apr_terminate); + apr_create_pool(&context, NULL); - while (ap_getopt(argc, argv, "abc:d::", &data, context) == APR_SUCCESS) { + while (apr_getopt(argc, argv, "abc:d::", &data, context) == APR_SUCCESS) { switch(data) { case 'a': case 'b': diff --git a/test/testcontext.c b/test/testcontext.c index 7d11ae05719..55efb11f351 100644 --- a/test/testcontext.c +++ b/test/testcontext.c @@ -63,33 +63,33 @@ #include #endif -ap_status_t string_cleanup(void *data) +apr_status_t string_cleanup(void *data) { return APR_SUCCESS; } int main() { - ap_pool_t *context; + apr_pool_t *context; char *testdata; char *retdata; - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(ap_terminate); + atexit(apr_terminate); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } - testdata = ap_pstrdup(context, "This is a test\n"); + testdata = apr_pstrdup(context, "This is a test\n"); - ap_set_userdata(testdata, "TEST", string_cleanup, context); + apr_set_userdata(testdata, "TEST", string_cleanup, context); - ap_get_userdata((void **)&retdata, "TEST", context); + apr_get_userdata((void **)&retdata, "TEST", context); if (!strcmp(testdata, retdata)) { fprintf(stdout, "User data is working ok\n"); diff --git a/test/testdso.c b/test/testdso.c index 110a74f1b88..a050c8fde97 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -9,11 +9,11 @@ int main (int argc, char ** argv) { - ap_dso_handle_t *h = NULL; - ap_dso_handle_sym_t func1 = NULL; - ap_dso_handle_sym_t func2 = NULL; - ap_status_t status; - ap_pool_t *cont; + apr_dso_handle_t *h = NULL; + apr_dso_handle_sym_t func1 = NULL; + apr_dso_handle_sym_t func2 = NULL; + apr_status_t status; + apr_pool_t *cont; void (*function)(void); void (*function1)(int); int *retval; @@ -23,19 +23,19 @@ int main (int argc, char ** argv) strcat(filename, "/"); strcat(filename, LIB_NAME); - ap_initialize(); - atexit(ap_terminate); + apr_initialize(); + atexit(apr_terminate); - if (ap_create_pool(&cont, NULL) != APR_SUCCESS) { + if (apr_create_pool(&cont, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } fprintf(stdout,"Trying to load DSO now....................."); fflush(stdout); - if ((status = ap_dso_load(&h, filename, cont)) != APR_SUCCESS){ + if ((status = apr_dso_load(&h, filename, cont)) != APR_SUCCESS){ char my_error[256]; - ap_strerror(status, my_error, sizeof(my_error)); + apr_strerror(status, my_error, sizeof(my_error)); fprintf(stderr, "%s!\n", my_error); exit (-1); } @@ -43,7 +43,7 @@ int main (int argc, char ** argv) fprintf(stdout,"Trying to get the DSO's attention.........."); fflush(stdout); - if (ap_dso_sym(&func1, h, "print_hello") != APR_SUCCESS) { + if (apr_dso_sym(&func1, h, "print_hello") != APR_SUCCESS) { fprintf(stderr, "Failed!\n"); exit (-1); } @@ -54,7 +54,7 @@ int main (int argc, char ** argv) fprintf(stdout,"Saying farewell 5 times...................."); fflush(stdout); - if (ap_dso_sym(&func2, h, "print_goodbye") != APR_SUCCESS) { + if (apr_dso_sym(&func2, h, "print_goodbye") != APR_SUCCESS) { fprintf(stderr, "Failed!\n"); exit (-1); } @@ -65,7 +65,7 @@ int main (int argc, char ** argv) fprintf(stdout,"Checking how many times I said goodbye.."); fflush(stdout); - if (ap_dso_sym(&func1, h, "goodbyes") != APR_SUCCESS) { + if (apr_dso_sym(&func1, h, "goodbyes") != APR_SUCCESS) { fprintf(stderr, "Failed!\n"); exit (-1); } @@ -79,7 +79,7 @@ int main (int argc, char ** argv) } fprintf(stdout,"Trying to unload DSO now..................."); - if (ap_dso_unload(h) != APR_SUCCESS) { + if (apr_dso_unload(h) != APR_SUCCESS) { fprintf(stderr, "Failed!\n"); exit (-1); } @@ -87,7 +87,7 @@ int main (int argc, char ** argv) fprintf(stdout,"Checking it's been unloaded................"); fflush(stdout); - if (ap_dso_sym(&func1, h, "print_hello") == APR_SUCCESS) { + if (apr_dso_sym(&func1, h, "print_hello") == APR_SUCCESS) { fprintf(stderr, "Failed!\n"); exit (-1); } diff --git a/test/testfile.c b/test/testfile.c index 98afaf40f9a..347cc53ad89 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -64,37 +64,37 @@ #include #endif -int test_filedel(ap_pool_t *); -int testdirs(ap_pool_t *); -static void test_read(ap_pool_t *); +int test_filedel(apr_pool_t *); +int testdirs(apr_pool_t *); +static void test_read(apr_pool_t *); int main() { - ap_pool_t *context; - ap_pool_t *cont2; - ap_file_t *thefile = NULL; - ap_socket_t *testsock = NULL; - ap_pollfd_t *sdset = NULL; - ap_status_t status = 0; - ap_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; - ap_ssize_t nbytes = 0; - ap_int32_t rv; - ap_off_t zer = 0; + apr_pool_t *context; + apr_pool_t *cont2; + apr_file_t *thefile = NULL; + apr_socket_t *testsock = NULL; + apr_pollfd_t *sdset = NULL; + apr_status_t status = 0; + apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; + apr_ssize_t nbytes = 0; + apr_int32_t rv; + apr_off_t zer = 0; char *buf; char *str; char *filename = "test.fil"; char *teststr; - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(ap_terminate); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + atexit(apr_terminate); + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } - if (ap_create_pool(&cont2, context) != APR_SUCCESS) { + if (apr_create_pool(&cont2, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } @@ -102,7 +102,7 @@ int main() fprintf(stdout, "Testing file functions.\n"); fprintf(stdout, "\tOpening file......."); - if (ap_open(&thefile, filename, flag, APR_UREAD | APR_UWRITE | APR_GREAD, context) != APR_SUCCESS) { + if (apr_open(&thefile, filename, flag, APR_UREAD | APR_UWRITE | APR_GREAD, context) != APR_SUCCESS) { perror("Didn't open file"); exit(-1); } @@ -115,7 +115,7 @@ int main() fprintf(stderr, "Bad file des\n"); exit(-1); } - ap_get_filename(&str, thefile); + apr_get_filename(&str, thefile); if (strcmp(str, filename) != 0) { fprintf(stderr, "wrong filename\n"); exit(-1); @@ -126,12 +126,12 @@ int main() fprintf(stdout, "\tWriting to file......."); - nbytes = (ap_ssize_t)strlen("this is a test"); - if (ap_write(thefile, "this is a test", &nbytes) != APR_SUCCESS) { + nbytes = (apr_ssize_t)strlen("this is a test"); + if (apr_write(thefile, "this is a test", &nbytes) != APR_SUCCESS) { perror("something's wrong"); exit(-1); } - if (nbytes != (ap_ssize_t)strlen("this is a test")) { + if (nbytes != (apr_ssize_t)strlen("this is a test")) { fprintf(stderr, "didn't write properly.\n"); exit(-1); } @@ -141,7 +141,7 @@ int main() fprintf(stdout, "\tMoving to start of file......."); zer = 0; - if (ap_seek(thefile, SEEK_SET, &zer) != 0) { + if (apr_seek(thefile, SEEK_SET, &zer) != 0) { perror("couldn't seek to beginning of file."); exit(-1); } @@ -152,17 +152,17 @@ int main() #if APR_FILES_AS_SOCKETS fprintf(stdout, "\tThis platform supports files_like_sockets\n"); fprintf(stdout, "\t\tMaking file look like a socket......."); - if (ap_socket_from_file(&testsock, thefile) != APR_SUCCESS) { + if (apr_socket_from_file(&testsock, thefile) != APR_SUCCESS) { perror("Something went wrong"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\t\tChecking for incoming data......."); - ap_setup_poll(&sdset, 1, context); - ap_add_poll_socket(sdset, testsock, APR_POLLIN); + apr_setup_poll(&sdset, 1, context); + apr_add_poll_socket(sdset, testsock, APR_POLLIN); rv = 1; - if (ap_poll(sdset, &rv, -1) != APR_SUCCESS) { + if (apr_poll(sdset, &rv, -1) != APR_SUCCESS) { fprintf(stderr, "Select caused an error\n"); exit(-1); } @@ -175,13 +175,13 @@ int main() fprintf(stdout, "\tReading from the file......."); - nbytes = (ap_ssize_t)strlen("this is a test"); - buf = (char *)ap_palloc(context, nbytes + 1); - if (ap_read(thefile, buf, &nbytes) != APR_SUCCESS) { + nbytes = (apr_ssize_t)strlen("this is a test"); + buf = (char *)apr_palloc(context, nbytes + 1); + if (apr_read(thefile, buf, &nbytes) != APR_SUCCESS) { perror("something's wrong"); exit(-1); } - if (nbytes != (ap_ssize_t)strlen("this is a test")) { + if (nbytes != (apr_ssize_t)strlen("this is a test")) { fprintf(stderr, "didn't read properly.\n"); exit(-1); } @@ -190,7 +190,7 @@ int main() } fprintf(stdout, "\tAdding user data to the file......."); - status = ap_set_filedata(thefile, "This is a test", "test", ap_null_cleanup); + status = apr_set_filedata(thefile, "This is a test", "test", apr_null_cleanup); if (status != APR_SUCCESS) { fprintf(stderr, "Couldn't add the data\n"); exit(-1); @@ -200,7 +200,7 @@ int main() } fprintf(stdout, "\tGetting user data from the file......."); - status = ap_get_filedata((void **)&teststr, "test", thefile); + status = apr_get_filedata((void **)&teststr, "test", thefile); if (status != APR_SUCCESS || strcmp(teststr, "This is a test")) { fprintf(stderr, "Couldn't get the data\n"); exit(-1); @@ -210,7 +210,7 @@ int main() } fprintf(stdout, "\tClosing File......."); - status = ap_close(thefile); + status = apr_close(thefile); if (status != APR_SUCCESS) { fprintf(stderr, "Couldn't close the file\n"); exit(-1); @@ -220,7 +220,7 @@ int main() } fprintf(stdout, "\tDeleting file......."); - status = ap_remove_file(filename, context); + status = apr_remove_file(filename, context); if (status != APR_SUCCESS) { fprintf(stderr, "Couldn't delete the file\n"); exit(-1); @@ -230,7 +230,7 @@ int main() } fprintf(stdout, "\tMaking sure it's gone......."); - status = ap_open(&thefile, filename, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); + status = apr_open(&thefile, filename, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); if (status == APR_SUCCESS) { fprintf(stderr, "I could open the file for some reason?\n"); exit(-1); @@ -246,26 +246,26 @@ int main() return 1; } -int test_filedel(ap_pool_t *context) +int test_filedel(apr_pool_t *context) { - ap_file_t *thefile = NULL; - ap_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; - ap_status_t stat; + apr_file_t *thefile = NULL; + apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; + apr_status_t stat; - stat = ap_open(&thefile, "testdel", flag, APR_UREAD | APR_UWRITE | APR_GREAD, context); + stat = apr_open(&thefile, "testdel", flag, APR_UREAD | APR_UWRITE | APR_GREAD, context); if (stat != APR_SUCCESS) { return stat; } - if ((stat = ap_close(thefile)) != APR_SUCCESS) { + if ((stat = apr_close(thefile)) != APR_SUCCESS) { return stat; } - if ((stat = ap_remove_file("testdel", context)) != APR_SUCCESS) { + if ((stat = apr_remove_file("testdel", context)) != APR_SUCCESS) { return stat; } - stat = ap_open(&thefile, "testdel", APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); + stat = apr_open(&thefile, "testdel", APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); if (stat == APR_SUCCESS) { return stat; } @@ -273,18 +273,18 @@ int test_filedel(ap_pool_t *context) return APR_SUCCESS; } -int testdirs(ap_pool_t *context) +int testdirs(apr_pool_t *context) { - ap_dir_t *temp; - ap_file_t *file = NULL; - ap_ssize_t bytes; + apr_dir_t *temp; + apr_file_t *file = NULL; + apr_ssize_t bytes; ap_filetype_e type; char *fname; fprintf(stdout, "Testing Directory functions.\n"); fprintf(stdout, "\tMakeing Directory......."); - if (ap_make_dir("testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE | APR_GREAD | APR_GWRITE | APR_GEXECUTE | APR_WREAD | APR_WWRITE | APR_WEXECUTE, context) != APR_SUCCESS) { + if (apr_make_dir("testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE | APR_GREAD | APR_GWRITE | APR_GEXECUTE | APR_WREAD | APR_WWRITE | APR_WEXECUTE, context) != APR_SUCCESS) { fprintf(stderr, "Could not create directory\n"); return -1; } @@ -292,16 +292,16 @@ int testdirs(ap_pool_t *context) fprintf(stdout, "OK\n"); } - if (ap_open(&file, "testdir/testfile", APR_READ | APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) {; + if (apr_open(&file, "testdir/testfile", APR_READ | APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) {; return -1; } bytes = strlen("Another test!!!"); - ap_write(file, "Another test!!", &bytes); - ap_close(file); + apr_write(file, "Another test!!", &bytes); + apr_close(file); fprintf(stdout, "\tOpening Directory......."); - if (ap_opendir(&temp, "testdir", context) != APR_SUCCESS) { + if (apr_opendir(&temp, "testdir", context) != APR_SUCCESS) { fprintf(stderr, "Could not open directory\n"); return -1; } @@ -310,7 +310,7 @@ int testdirs(ap_pool_t *context) } fprintf(stdout, "\tReading Directory......."); - if ((ap_readdir(temp)) != APR_SUCCESS) { + if ((apr_readdir(temp)) != APR_SUCCESS) { fprintf(stderr, "Could not read directory\n"); return -1; } @@ -324,11 +324,11 @@ int testdirs(ap_pool_t *context) /* Because I want the file I created, I am skipping the "." and ".." * files that are here. */ - if (ap_readdir(temp) != APR_SUCCESS) { + if (apr_readdir(temp) != APR_SUCCESS) { fprintf(stderr, "Error reading directory testdir"); return -1; } - ap_get_dir_filename(&fname, temp); + apr_get_dir_filename(&fname, temp); } while (fname[0] == '.'); if (strcmp(fname, "testfile")) { fprintf(stderr, "Got wrong file name %s\n", fname); @@ -337,7 +337,7 @@ int testdirs(ap_pool_t *context) fprintf(stdout, "OK\n"); fprintf(stdout, "\t\tFile type......."); - ap_dir_entry_ftype(&type, temp); + apr_dir_entry_ftype(&type, temp); if (type != APR_REG) { fprintf(stderr, "Got wrong file type\n"); return -1; @@ -345,19 +345,19 @@ int testdirs(ap_pool_t *context) fprintf(stdout, "OK\n"); fprintf(stdout, "\t\tFile size......."); - ap_dir_entry_size(&bytes, temp); - if (bytes != (ap_ssize_t)strlen("Another test!!!")) { + apr_dir_entry_size(&bytes, temp); + if (bytes != (apr_ssize_t)strlen("Another test!!!")) { fprintf(stderr, "Got wrong file size %d\n", bytes); return -1; } fprintf(stdout, "OK\n"); fprintf(stdout, "\tRewinding directory......."); - ap_rewinddir(temp); + apr_rewinddir(temp); fprintf(stdout, "OK\n"); fprintf(stdout, "\tClosing Directory......."); - if (ap_closedir(temp) != APR_SUCCESS) { + if (apr_closedir(temp) != APR_SUCCESS) { fprintf(stderr, "Could not close directory\n"); return -1; } @@ -366,7 +366,7 @@ int testdirs(ap_pool_t *context) } fprintf(stdout, "\tRemoving file from directory......."); - if (ap_remove_file("testdir/testfile", context) != APR_SUCCESS) { + if (apr_remove_file("testdir/testfile", context) != APR_SUCCESS) { fprintf(stderr, "Could not remove file\n"); return -1; } @@ -375,7 +375,7 @@ int testdirs(ap_pool_t *context) } fprintf(stdout, "\tRemoving Directory......."); - if (ap_remove_dir("testdir", context) != APR_SUCCESS) { + if (apr_remove_dir("testdir", context) != APR_SUCCESS) { fprintf(stderr, "Could not remove directory\n"); return -1; } @@ -389,51 +389,51 @@ int testdirs(ap_pool_t *context) #define TESTREAD_BLKSIZE 1024 #define APR_BUFFERSIZE 4096 /* This should match APR's buffer size. */ -static void create_testread(ap_pool_t *p, const char *fname) +static void create_testread(apr_pool_t *p, const char *fname) { - ap_file_t *f = NULL; - ap_status_t rv; + apr_file_t *f = NULL; + apr_status_t rv; char buf[TESTREAD_BLKSIZE]; - ap_ssize_t nbytes; + apr_ssize_t nbytes; /* Create a test file with known content. */ - rv = ap_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); + rv = apr_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); if (rv) { - fprintf(stderr, "ap_open()->%d/%s\n", - rv, ap_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "apr_open()->%d/%s\n", + rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } nbytes = 4; - rv = ap_write(f, "abc\n", &nbytes); + rv = apr_write(f, "abc\n", &nbytes); assert(!rv && nbytes == 4); memset(buf, 'a', sizeof buf); nbytes = sizeof buf; - rv = ap_write(f, buf, &nbytes); + rv = apr_write(f, buf, &nbytes); assert(!rv && nbytes == sizeof buf); nbytes = 2; - rv = ap_write(f, "\n\n", &nbytes); + rv = apr_write(f, "\n\n", &nbytes); assert(!rv && nbytes == 2); - rv = ap_close(f); + rv = apr_close(f); assert(!rv); } -static char read_one(ap_file_t *f, int expected) +static char read_one(apr_file_t *f, int expected) { char bytes[3]; - ap_status_t rv; + apr_status_t rv; static int counter = 0; - ap_ssize_t nbytes; + apr_ssize_t nbytes; counter += 1; bytes[0] = bytes[2] = 0x01; if (counter % 2) { - rv = ap_getc(bytes + 1, f); + rv = apr_getc(bytes + 1, f); } else { nbytes = 1; - rv = ap_read(f, bytes + 1, &nbytes); + rv = apr_read(f, bytes + 1, &nbytes); assert(nbytes == 1); } assert(!rv); @@ -444,31 +444,31 @@ static char read_one(ap_file_t *f, int expected) return bytes[1]; } -static void test_read_guts(ap_pool_t *p, const char *fname, ap_int32_t extra_flags) +static void test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_flags) { - ap_file_t *f = NULL; - ap_status_t rv; - ap_ssize_t nbytes; + apr_file_t *f = NULL; + apr_status_t rv; + apr_ssize_t nbytes; char buf[1024]; int i; - rv = ap_open(&f, fname, APR_READ | extra_flags, 0, p); + rv = apr_open(&f, fname, APR_READ | extra_flags, 0, p); assert(!rv); read_one(f, 'a'); read_one(f, 'b'); if (extra_flags & APR_BUFFERED) { fprintf(stdout, - "\n\t\tskipping ap_ungetc() for APR_BUFFERED... " + "\n\t\tskipping apr_ungetc() for APR_BUFFERED... " "doesn't work yet...\n\t\t\t\t "); } else { - rv = ap_ungetc('b', f); + rv = apr_ungetc('b', f); assert(!rv); /* Note: some implementations move the file ptr back; * others just save up to one char; it isn't * portable to unget more than once. */ - /* Don't do this: rv = ap_ungetc('a', f); */ + /* Don't do this: rv = apr_ungetc('a', f); */ read_one(f, 'b'); } read_one(f, 'c'); @@ -478,20 +478,20 @@ static void test_read_guts(ap_pool_t *p, const char *fname, ap_int32_t extra_fla } read_one(f, '\n'); read_one(f, '\n'); - rv = ap_getc(buf, f); + rv = apr_getc(buf, f); assert(rv == APR_EOF); - rv = ap_close(f); + rv = apr_close(f); assert(!rv); f = NULL; - rv = ap_open(&f, fname, APR_READ | extra_flags, 0, p); + rv = apr_open(&f, fname, APR_READ | extra_flags, 0, p); assert(!rv); - rv = ap_fgets(buf, 10, f); + rv = apr_fgets(buf, 10, f); assert(!rv); assert(!strcmp(buf, "abc\n")); /* read first 800 of TESTREAD_BLKSIZE 'a's */ - rv = ap_fgets(buf, 801, f); + rv = apr_fgets(buf, 801, f); assert(!rv); assert(strlen(buf) == 800); for (i = 0; i < 800; i++) { @@ -499,7 +499,7 @@ static void test_read_guts(ap_pool_t *p, const char *fname, ap_int32_t extra_fla } /* read rest of the 'a's and the first newline */ - rv = ap_fgets(buf, sizeof buf, f); + rv = apr_fgets(buf, sizeof buf, f); assert(!rv); assert(strlen(buf) == TESTREAD_BLKSIZE - 800 + 1); for (i = 0; i < TESTREAD_BLKSIZE - 800; i++) { @@ -508,63 +508,63 @@ static void test_read_guts(ap_pool_t *p, const char *fname, ap_int32_t extra_fla assert(buf[TESTREAD_BLKSIZE - 800] == '\n'); /* read the last newline */ - rv = ap_fgets(buf, sizeof buf, f); + rv = apr_fgets(buf, sizeof buf, f); assert(!rv); assert(!strcmp(buf, "\n")); /* get APR_EOF */ - rv = ap_fgets(buf, sizeof buf, f); + rv = apr_fgets(buf, sizeof buf, f); assert(rv == APR_EOF); - /* get APR_EOF with ap_getc + /* get APR_EOF with apr_getc */ - rv = ap_getc(buf, f); + rv = apr_getc(buf, f); assert(rv == APR_EOF); - /* get APR_EOF with ap_read + /* get APR_EOF with apr_read */ nbytes = sizeof buf; - rv = ap_read(f, buf, &nbytes); + rv = apr_read(f, buf, &nbytes); assert(rv == APR_EOF); - rv = ap_close(f); + rv = apr_close(f); assert(!rv); } -static void test_bigread(ap_pool_t *p, const char *fname, ap_int32_t extra_flags) +static void test_bigread(apr_pool_t *p, const char *fname, apr_int32_t extra_flags) { - ap_file_t *f = NULL; - ap_status_t rv; + apr_file_t *f = NULL; + apr_status_t rv; char buf[APR_BUFFERSIZE * 2]; - ap_ssize_t nbytes; + apr_ssize_t nbytes; /* Create a test file with known content. */ - rv = ap_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); + rv = apr_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); if (rv) { - fprintf(stderr, "ap_open()->%d/%s\n", - rv, ap_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "apr_open()->%d/%s\n", + rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } nbytes = APR_BUFFERSIZE; memset(buf, 0xFE, nbytes); - rv = ap_write(f, buf, &nbytes); + rv = apr_write(f, buf, &nbytes); assert(!rv && nbytes == APR_BUFFERSIZE); - rv = ap_close(f); + rv = apr_close(f); assert(!rv); f = NULL; - rv = ap_open(&f, fname, APR_READ | extra_flags, 0, p); + rv = apr_open(&f, fname, APR_READ | extra_flags, 0, p); assert(!rv); nbytes = sizeof buf; - rv = ap_read(f, buf, &nbytes); + rv = apr_read(f, buf, &nbytes); assert(!rv); assert(nbytes == APR_BUFFERSIZE); - rv = ap_close(f); + rv = apr_close(f); assert(!rv); } -static void test_read(ap_pool_t *p) +static void test_read(apr_pool_t *p) { const char *fname = "testread.dat"; - ap_status_t rv; + apr_status_t rv; fprintf(stdout, "Testing file read functions.\n"); @@ -581,7 +581,7 @@ static void test_read(ap_pool_t *p) fprintf(stdout, "\tMore unbuffered file tests......"); test_bigread(p, fname, 0); fprintf(stdout, "OK\n"); - rv = ap_remove_file(fname, p); + rv = apr_remove_file(fname, p); assert(!rv); fprintf(stdout, "\tAll read tests...........OK\n"); } diff --git a/test/testmd5.c b/test/testmd5.c index 5c6ce6f2b7d..b05c1c87fa4 100644 --- a/test/testmd5.c +++ b/test/testmd5.c @@ -81,15 +81,15 @@ struct testcase testcases[] = "\xd1\xa1\xc0\x97\x8a\x60\xbb\xfb\x2a\x25\x46\x9d\xa5\xae\xd0\xb0"} }; -static void try(const void *buf, size_t bufLen, ap_xlate_t *xlate, +static void try(const void *buf, size_t bufLen, apr_xlate_t *xlate, const void *digest) { int i; - ap_status_t rv; + apr_status_t rv; ap_md5_ctx_t context; unsigned char hash[MD5_DIGESTSIZE]; - rv = ap_MD5Init(&context); + rv = apr_MD5Init(&context); assert(!rv); if (xlate) { @@ -101,10 +101,10 @@ static void try(const void *buf, size_t bufLen, ap_xlate_t *xlate, #endif } - rv = ap_MD5Update(&context, buf, bufLen); + rv = apr_MD5Update(&context, buf, bufLen); assert(!rv); - rv = ap_MD5Final(hash, &context); + rv = apr_MD5Final(hash, &context); assert(!rv); for (i = 0; i < MD5_DIGESTSIZE; i++) { @@ -128,9 +128,9 @@ static void try(const void *buf, size_t bufLen, ap_xlate_t *xlate, int main(int argc, char **argv) { - ap_status_t rv; - ap_xlate_t *xlate = NULL; - ap_pool_t *pool; + apr_status_t rv; + apr_xlate_t *xlate = NULL; + apr_pool_t *pool; const char *src = NULL, *dst = NULL; int cur; @@ -148,11 +148,11 @@ int main(int argc, char **argv) exit(1); } - rv = ap_initialize(); + rv = apr_initialize(); assert(!rv); - atexit(ap_terminate); + atexit(apr_terminate); - rv = ap_create_pool(&pool, NULL); + rv = apr_create_pool(&pool, NULL); if (src) { #if APR_HAS_XLATE @@ -161,7 +161,7 @@ int main(int argc, char **argv) char buf[80]; fprintf(stderr, "ap_xlate_open()->%s (%d)\n", - ap_strerror(rv, buf, sizeof(buf)), rv); + apr_strerror(rv, buf, sizeof(buf)), rv); exit(1); } #else diff --git a/test/testmmap.c b/test/testmmap.c index 3f58ec3c6f6..da13fd86b1d 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -69,36 +69,36 @@ int main() { - ap_pool_t *context; - ap_mmap_t *themmap = NULL; - ap_file_t *thefile = NULL; - ap_finfo_t finfo; - ap_int32_t flag = APR_READ; + apr_pool_t *context; + apr_mmap_t *themmap = NULL; + apr_file_t *thefile = NULL; + apr_finfo_t finfo; + apr_int32_t flag = APR_READ; char *file1; fprintf (stdout,"APR MMAP Test\n*************\n\n"); fprintf(stdout,"Initializing........................"); - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Failed.\n"); exit(-1); } fprintf(stdout,"OK\n"); - atexit(ap_terminate); + atexit(apr_terminate); fprintf(stdout,"Creating context...................."); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Failed.\n"); exit(-1); } fprintf(stdout,"OK\n"); - file1 = (char*) ap_palloc(context, sizeof(char) * PATH_LEN); + file1 = (char*) apr_palloc(context, sizeof(char) * PATH_LEN); getcwd(file1, PATH_LEN); strncat(file1,"/testmmap.c",11); fprintf(stdout, "Opening file........................"); - if (ap_open(&thefile, file1, flag, APR_UREAD | APR_GREAD, context) != APR_SUCCESS) { + if (apr_open(&thefile, file1, flag, APR_UREAD | APR_GREAD, context) != APR_SUCCESS) { perror("Didn't open file"); exit(-1); } @@ -107,7 +107,7 @@ int main() } fprintf(stderr, "Getting file size..................."); - if (ap_getfileinfo(&finfo, thefile) != APR_SUCCESS) { + if (apr_getfileinfo(&finfo, thefile) != APR_SUCCESS) { perror("Didn't get file information!"); exit(-1); } @@ -116,14 +116,14 @@ int main() } fprintf(stdout,"Trying to mmap the file............."); - if (ap_mmap_create(&themmap, thefile, 0, finfo.size, context) != APR_SUCCESS) { + if (apr_mmap_create(&themmap, thefile, 0, finfo.size, context) != APR_SUCCESS) { fprintf(stderr,"Failed!\n"); exit(-1); } fprintf(stdout,"OK\n"); fprintf(stdout,"Trying to delete the mmap file......"); - if (ap_mmap_delete(themmap) != APR_SUCCESS) { + if (apr_mmap_delete(themmap) != APR_SUCCESS) { fprintf(stderr,"Failed!\n"); exit (-1); } diff --git a/test/testoc.c b/test/testoc.c index 3b60b091326..084b851871e 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -85,44 +85,44 @@ void ocmaint(int reason, void *data, int status) int main(int argc, char *argv[]) { - ap_pool_t *context; - ap_proc_t newproc; - ap_procattr_t *procattr = NULL; - ap_file_t *std = NULL; + apr_pool_t *context; + apr_proc_t newproc; + apr_procattr_t *procattr = NULL; + apr_file_t *std = NULL; char *args[3]; if (argc > 1) { while (1); } - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(ap_terminate); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + atexit(apr_terminate); + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } - args[0] = ap_pstrdup(context, "occhild"); - args[1] = ap_pstrdup(context, "-X"); + args[0] = apr_pstrdup(context, "occhild"); + args[1] = apr_pstrdup(context, "-X"); args[2] = NULL; fprintf(stdout, "[PARENT] Creating procattr............."); fflush(stdout); - if (ap_createprocattr_init(&procattr, context) != APR_SUCCESS) { + if (apr_createprocattr_init(&procattr, context) != APR_SUCCESS) { fprintf(stderr, "Could not create attr\n"); exit(-1);; } else { - ap_setprocattr_io(procattr, APR_FULL_BLOCK, APR_NO_PIPE, APR_NO_PIPE); + apr_setprocattr_io(procattr, APR_FULL_BLOCK, APR_NO_PIPE, APR_NO_PIPE); } fprintf(stdout, "OK\n"); fprintf(stdout, "[PARENT] Starting other child.........."); fflush(stdout); - if (ap_create_process(&newproc, "./occhild", args, NULL, procattr, context) + if (apr_create_process(&newproc, "./occhild", args, NULL, procattr, context) != APR_SUCCESS) { fprintf(stderr, "error starting other child\n"); exit(-1); @@ -131,12 +131,12 @@ int main(int argc, char *argv[]) std = newproc.in; - ap_register_other_child(&newproc, ocmaint, NULL, std, context); + apr_register_other_child(&newproc, ocmaint, NULL, std, context); fprintf(stdout, "[PARENT] Sending SIGKILL to child......"); fflush(stdout); sleep(1); - if (ap_kill(&newproc, SIGKILL) != APR_SUCCESS) { + if (apr_kill(&newproc, SIGKILL) != APR_SUCCESS) { fprintf(stderr,"couldn't send the signal!\n"); exit(-1); } @@ -144,10 +144,10 @@ int main(int argc, char *argv[]) /* allow time for things to settle... */ sleep(3); - ap_probe_writable_fds(); + apr_probe_writable_fds(); fprintf(stdout, "[PARENT] Checking on children..........\n"); - ap_check_other_child(); + apr_check_other_child(); return 1; } diff --git a/test/testpipe.c b/test/testpipe.c index 91ec156a75a..9075c056e0a 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -64,20 +64,20 @@ int main(void) { - ap_pool_t *context; - ap_file_t *readp = NULL; - ap_file_t *writep = NULL; - ap_size_t nbytes; - ap_status_t rv; + apr_pool_t *context; + apr_file_t *readp = NULL; + apr_file_t *writep = NULL; + apr_size_t nbytes; + apr_status_t rv; char *buf; char msgbuf[120]; - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(ap_terminate); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + atexit(apr_terminate); + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } @@ -85,9 +85,9 @@ int main(void) fprintf(stdout, "Testing pipe functions.\n"); fprintf(stdout, "\tCreating pipes......."); - if ((rv = ap_create_pipe(&readp, &writep, context)) != APR_SUCCESS) { - fprintf(stderr, "ap_create_pipe()->%d/%s\n", - rv, ap_strerror(rv, msgbuf, sizeof msgbuf)); + if ((rv = apr_create_pipe(&readp, &writep, context)) != APR_SUCCESS) { + fprintf(stderr, "apr_create_pipe()->%d/%s\n", + rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); exit(-1); } else { @@ -95,18 +95,18 @@ int main(void) } fprintf(stdout, "\tSetting pipe timeout......."); - if ((rv = ap_set_pipe_timeout(readp, 1 * AP_USEC_PER_SEC)) != APR_SUCCESS) { - fprintf(stderr, "ap_set_pipe_timeout()->%d/%s\n", - rv, ap_strerror(rv, msgbuf, sizeof msgbuf)); + if ((rv = apr_set_pipe_timeout(readp, 1 * AP_USEC_PER_SEC)) != APR_SUCCESS) { + fprintf(stderr, "apr_set_pipe_timeout()->%d/%s\n", + rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); exit(-1); } else { fprintf(stdout, "OK\n"); } fprintf(stdout, "\tReading from the pipe......."); - nbytes = (ap_ssize_t)strlen("this is a test"); - buf = (char *)ap_palloc(context, nbytes + 1); - if (ap_read(readp, buf, &nbytes) == APR_TIMEUP) { + nbytes = (apr_ssize_t)strlen("this is a test"); + buf = (char *)apr_palloc(context, nbytes + 1); + if (apr_read(readp, buf, &nbytes) == APR_TIMEUP) { fprintf(stdout, "OK\n"); } else { diff --git a/test/testproc.c b/test/testproc.c index 72afd2f46fe..793cb73aa82 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -71,47 +71,47 @@ int testdirs(void); int main(int argc, char *argv[]) { - ap_pool_t *context; - ap_proc_t newproc; - ap_procattr_t *attr; - ap_file_t *testfile = NULL; - ap_ssize_t length; + apr_pool_t *context; + apr_proc_t newproc; + apr_procattr_t *attr; + apr_file_t *testfile = NULL; + apr_ssize_t length; char *buf; char *args[3]; char *teststr; - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(ap_terminate); - ap_create_pool(&context, NULL); + atexit(apr_terminate); + apr_create_pool(&context, NULL); if (argc > 1) { - teststr = ap_palloc(context, 256); + teststr = apr_palloc(context, 256); teststr = fgets(teststr, 256, stdin); fprintf(stdout, "%s", teststr); exit(1); } - teststr = ap_pstrdup(context, "Whooo Hoooo\0"); + teststr = apr_pstrdup(context, "Whooo Hoooo\0"); fprintf(stdout, "Creating directory for later use......."); - if (ap_make_dir("proctest", APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) { + if (apr_make_dir("proctest", APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) { fprintf(stderr, "Could not create dir\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Creating procattr......."); - if (ap_createprocattr_init(&attr, context) != APR_SUCCESS) { + if (apr_createprocattr_init(&attr, context) != APR_SUCCESS) { fprintf(stderr, "Could not create attr\n"); exit(-1);; } fprintf(stdout, "OK.\n"); fprintf(stdout, "Setting attr pipes, all three......."); - if (ap_setprocattr_io(attr, APR_FULL_BLOCK, + if (apr_setprocattr_io(attr, APR_FULL_BLOCK, APR_CHILD_BLOCK, APR_NO_PIPE) != APR_SUCCESS) { fprintf(stderr, "Could not set pipes attr\n"); exit(-1); @@ -119,25 +119,25 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK.\n"); fprintf(stdout, "Setting attr dir......."); - if (ap_setprocattr_dir(attr, "proctest") != APR_SUCCESS) { + if (apr_setprocattr_dir(attr, "proctest") != APR_SUCCESS) { fprintf(stderr, "Could not set directory attr\n"); exit(-1); } fprintf(stdout, "OK.\n"); fprintf(stdout, "Setting attr cmd type......."); - if (ap_setprocattr_cmdtype(attr, APR_PROGRAM) != APR_SUCCESS) { + if (apr_setprocattr_cmdtype(attr, APR_PROGRAM) != APR_SUCCESS) { fprintf(stderr, "Could not set cmd type attr\n"); exit(-1); } fprintf(stdout, "OK.\n"); - args[0] = ap_pstrdup(context, "testproc"); - args[1] = ap_pstrdup(context, "-X"); + args[0] = apr_pstrdup(context, "testproc"); + args[1] = apr_pstrdup(context, "-X"); args[2] = NULL; fprintf(stdout, "Creating a new process......."); - if (ap_create_process(&newproc, "../testproc", args, NULL, attr, context) != APR_SUCCESS) { + if (apr_create_process(&newproc, "../testproc", args, NULL, attr, context) != APR_SUCCESS) { fprintf(stderr, "Could not create the new process\n"); exit(-1); } @@ -149,7 +149,7 @@ int main(int argc, char *argv[]) length = 256; fprintf(stdout, "Writing the data to child......."); - if (ap_write(testfile, teststr, &length) == APR_SUCCESS) { + if (apr_write(testfile, teststr, &length) == APR_SUCCESS) { fprintf(stdout,"OK\n"); } else fprintf(stderr, "Write failed.\n"); @@ -160,8 +160,8 @@ int main(int argc, char *argv[]) length = 256; fprintf(stdout, "Checking the data read from pipe to child......."); - buf = ap_pcalloc(context, length); - if (ap_read(testfile, buf, &length) == APR_SUCCESS) { + buf = apr_pcalloc(context, length); + if (apr_read(testfile, buf, &length) == APR_SUCCESS) { if (!strcmp(buf, teststr)) fprintf(stdout,"OK\n"); else fprintf(stderr, "Uh-Oh\n"); @@ -169,14 +169,14 @@ int main(int argc, char *argv[]) else fprintf(stderr, "Read failed.\n"); fprintf(stdout, "Waiting for child to die......."); - if (ap_wait_proc(&newproc, APR_WAIT) != APR_CHILD_DONE) { + if (apr_wait_proc(&newproc, APR_WAIT) != APR_CHILD_DONE) { fprintf(stderr, "Wait for child failed\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Removing directory......."); - if (ap_remove_dir("proctest", context) != APR_SUCCESS) { + if (apr_remove_dir("proctest", context) != APR_SUCCESS) { fprintf(stderr, "Could not remove directory.\n"); exit(-1); } diff --git a/test/testsf.c b/test/testsf.c index a06012f6f43..b0f26e7f564 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -90,80 +90,80 @@ int main(void) typedef enum {BLK, NONBLK, TIMEOUT} client_socket_mode_t; -static void apr_setup(ap_pool_t **p, ap_socket_t **sock) +static void apr_setup(apr_pool_t **p, apr_socket_t **sock) { char buf[120]; - ap_status_t rv; + apr_status_t rv; - rv = ap_initialize(); + rv = apr_initialize(); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_initialize()->%d/%s\n", + fprintf(stderr, "apr_initialize()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } - atexit(ap_terminate); + atexit(apr_terminate); - rv = ap_create_pool(p, NULL); + rv = apr_create_pool(p, NULL); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_create_pool()->%d/%s\n", + fprintf(stderr, "apr_create_pool()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } *sock = NULL; - rv = ap_create_tcp_socket(sock, *p); + rv = apr_create_tcp_socket(sock, *p); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_create_tcp_socket()->%d/%s\n", + fprintf(stderr, "apr_create_tcp_socket()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } } -static void create_testfile(ap_pool_t *p, const char *fname) +static void create_testfile(apr_pool_t *p, const char *fname) { - ap_file_t *f = NULL; - ap_status_t rv; + apr_file_t *f = NULL; + apr_status_t rv; char buf[120]; int i; - ap_ssize_t nbytes; - ap_finfo_t finfo; + apr_ssize_t nbytes; + apr_finfo_t finfo; printf("Creating a test file...\n"); - rv = ap_open(&f, fname, + rv = apr_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE | APR_BUFFERED, APR_UREAD | APR_UWRITE, p); if (rv) { - fprintf(stderr, "ap_open()->%d/%s\n", - rv, ap_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "apr_open()->%d/%s\n", + rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } buf[0] = FILE_DATA_CHAR; for (i = 0; i < FILE_LENGTH; i++) { nbytes = 1; - rv = ap_write(f, buf, &nbytes); + rv = apr_write(f, buf, &nbytes); if (rv) { - fprintf(stderr, "ap_write()->%d/%s\n", - rv, ap_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "apr_write()->%d/%s\n", + rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } } - rv = ap_close(f); + rv = apr_close(f); if (rv) { - fprintf(stderr, "ap_close()->%d/%s\n", - rv, ap_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "apr_close()->%d/%s\n", + rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = ap_stat(&finfo, fname, p); + rv = apr_stat(&finfo, fname, p); if (rv) { - fprintf(stderr, "ap_close()->%d/%s\n", - rv, ap_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "apr_close()->%d/%s\n", + rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -180,45 +180,45 @@ static void create_testfile(ap_pool_t *p, const char *fname) static int client(client_socket_mode_t socket_mode) { - ap_status_t rv, tmprv; - ap_socket_t *sock; - ap_pool_t *p; + apr_status_t rv, tmprv; + apr_socket_t *sock; + apr_pool_t *p; char buf[120]; - ap_file_t *f = NULL; - ap_size_t len, expected_len; - ap_off_t current_file_offset; - ap_hdtr_t hdtr; + apr_file_t *f = NULL; + apr_size_t len, expected_len; + apr_off_t current_file_offset; + apr_hdtr_t hdtr; struct iovec headers[3]; struct iovec trailers[3]; - ap_ssize_t bytes_read; - ap_pollfd_t *pfd; - ap_int32_t nsocks; + apr_ssize_t bytes_read; + apr_pollfd_t *pfd; + apr_int32_t nsocks; int i; apr_setup(&p, &sock); create_testfile(p, TESTFILE); - rv = ap_open(&f, TESTFILE, APR_READ, 0, p); + rv = apr_open(&f, TESTFILE, APR_READ, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_open()->%d/%s\n", + fprintf(stderr, "apr_open()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = ap_set_remote_port(sock, TESTSF_PORT); + rv = apr_set_remote_port(sock, TESTSF_PORT); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_set_remote_port()->%d/%s\n", + fprintf(stderr, "apr_set_remote_port()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = ap_connect(sock, "127.0.0.1"); + rv = apr_connect(sock, "127.0.0.1"); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_connect()->%d/%s\n", + fprintf(stderr, "apr_connect()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -228,22 +228,22 @@ static int client(client_socket_mode_t socket_mode) break; case NONBLK: /* set it non-blocking */ - rv = ap_setsocketopt(sock, APR_SO_NONBLOCK, 1); + rv = apr_setsocketopt(sock, APR_SO_NONBLOCK, 1); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_setsocketopt(APR_SO_NONBLOCK)->%d/%s\n", + fprintf(stderr, "apr_setsocketopt(APR_SO_NONBLOCK)->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } break; case TIMEOUT: /* set a timeout */ - rv = ap_setsocketopt(sock, APR_SO_TIMEOUT, + rv = apr_setsocketopt(sock, APR_SO_TIMEOUT, 100 * AP_USEC_PER_SEC); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_setsocketopt(APR_SO_NONBLOCK)->%d/%s\n", + fprintf(stderr, "apr_setsocketopt(APR_SO_NONBLOCK)->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } break; @@ -287,7 +287,7 @@ static int client(client_socket_mode_t socket_mode) if (rv != APR_SUCCESS) { fprintf(stderr, "ap_sendfile()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -308,19 +308,19 @@ static int client(client_socket_mode_t socket_mode) } else { /* non-blocking... wooooooo */ - ap_size_t total_bytes_sent; + apr_size_t total_bytes_sent; pfd = NULL; - rv = ap_setup_poll(&pfd, 1, p); + rv = apr_setup_poll(&pfd, 1, p); assert(!rv); - rv = ap_add_poll_socket(pfd, sock, APR_POLLOUT); + rv = apr_add_poll_socket(pfd, sock, APR_POLLOUT); assert(!rv); total_bytes_sent = 0; current_file_offset = 0; len = FILE_LENGTH; do { - ap_size_t tmplen; + apr_size_t tmplen; tmplen = len; /* bytes remaining to send from the file */ printf("Calling ap_sendfile()...\n"); @@ -340,9 +340,9 @@ static int client(client_socket_mode_t socket_mode) rv = ap_sendfile(sock, f, &hdtr, ¤t_file_offset, &tmplen, 0); printf("ap_sendfile()->%d, sent %ld bytes\n", rv, (long)tmplen); if (rv) { - if (ap_canonical_error(rv) == APR_EAGAIN) { + if (apr_canonical_error(rv) == APR_EAGAIN) { nsocks = 1; - tmprv = ap_poll(pfd, &nsocks, -1); + tmprv = apr_poll(pfd, &nsocks, -1); assert(!tmprv); assert(nsocks == 1); /* continue; */ @@ -407,7 +407,7 @@ static int client(client_socket_mode_t socket_mode) } while (total_bytes_sent < expected_len && (rv == APR_SUCCESS || - ap_canonical_error(rv) == APR_EAGAIN)); + apr_canonical_error(rv) == APR_EAGAIN)); if (total_bytes_sent != expected_len) { fprintf(stderr, "client problem: sent %ld of %ld bytes\n", @@ -422,11 +422,11 @@ static int client(client_socket_mode_t socket_mode) } current_file_offset = 0; - rv = ap_seek(f, APR_CUR, ¤t_file_offset); + rv = apr_seek(f, APR_CUR, ¤t_file_offset); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_seek()->%d/%s\n", + fprintf(stderr, "apr_seek()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -434,20 +434,20 @@ static int client(client_socket_mode_t socket_mode) "at offset %ld.\n", (long int)current_file_offset); - rv = ap_shutdown(sock, APR_SHUTDOWN_WRITE); + rv = apr_shutdown(sock, APR_SHUTDOWN_WRITE); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_shutdown()->%d/%s\n", + fprintf(stderr, "apr_shutdown()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } bytes_read = 1; - rv = ap_recv(sock, buf, &bytes_read); + rv = apr_recv(sock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 0) { @@ -459,11 +459,11 @@ static int client(client_socket_mode_t socket_mode) printf("client: ap_sendfile() worked as expected!\n"); - rv = ap_remove_file(TESTFILE, p); + rv = apr_remove_file(TESTFILE, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_remove_file()->%d/%s\n", + fprintf(stderr, "apr_remove_file()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -472,55 +472,55 @@ static int client(client_socket_mode_t socket_mode) static int server(void) { - ap_status_t rv; - ap_socket_t *sock; - ap_pool_t *p; + apr_status_t rv; + apr_socket_t *sock; + apr_pool_t *p; char buf[120]; int i; - ap_socket_t *newsock = NULL; - ap_ssize_t bytes_read; + apr_socket_t *newsock = NULL; + apr_ssize_t bytes_read; apr_setup(&p, &sock); - rv = ap_set_local_port(sock, TESTSF_PORT); + rv = apr_set_local_port(sock, TESTSF_PORT); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_set_local_port()->%d/%s\n", + fprintf(stderr, "apr_set_local_port()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = ap_setsocketopt(sock, APR_SO_REUSEADDR, 1); + rv = apr_setsocketopt(sock, APR_SO_REUSEADDR, 1); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_setsocketopt()->%d/%s\n", + fprintf(stderr, "apr_setsocketopt()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = ap_bind(sock); + rv = apr_bind(sock); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_bind()->%d/%s\n", + fprintf(stderr, "apr_bind()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = ap_listen(sock, 5); + rv = apr_listen(sock, 5); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_listen()->%d/%s\n", + fprintf(stderr, "apr_listen()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } printf("Waiting for a client to connect...\n"); - rv = ap_accept(&newsock, sock, p); + rv = apr_accept(&newsock, sock, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_accept()->%d/%s\n", + fprintf(stderr, "apr_accept()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -528,11 +528,11 @@ static int server(void) assert(sizeof buf > strlen(HDR1)); bytes_read = strlen(HDR1); - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != strlen(HDR1)) { @@ -548,11 +548,11 @@ static int server(void) assert(sizeof buf > strlen(HDR2)); bytes_read = strlen(HDR2); - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != strlen(HDR2)) { @@ -568,15 +568,15 @@ static int server(void) for (i = 0; i < HDR3_LEN; i++) { bytes_read = 1; - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 1) { - fprintf(stderr, "ap_recv()->%ld bytes instead of 1\n", + fprintf(stderr, "apr_recv()->%ld bytes instead of 1\n", (long int)bytes_read); exit(1); } @@ -593,15 +593,15 @@ static int server(void) for (i = 0; i < FILE_LENGTH; i++) { bytes_read = 1; - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 1) { - fprintf(stderr, "ap_recv()->%ld bytes instead of 1\n", + fprintf(stderr, "apr_recv()->%ld bytes instead of 1\n", (long int)bytes_read); exit(1); } @@ -618,11 +618,11 @@ static int server(void) assert(sizeof buf > strlen(TRL1)); bytes_read = strlen(TRL1); - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != strlen(TRL1)) { @@ -638,11 +638,11 @@ static int server(void) assert(sizeof buf > strlen(TRL2)); bytes_read = strlen(TRL2); - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != strlen(TRL2)) { @@ -658,15 +658,15 @@ static int server(void) for (i = 0; i < TRL3_LEN; i++) { bytes_read = 1; - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 1) { - fprintf(stderr, "ap_recv()->%ld bytes instead of 1\n", + fprintf(stderr, "apr_recv()->%ld bytes instead of 1\n", (long int)bytes_read); exit(1); } @@ -682,11 +682,11 @@ static int server(void) } bytes_read = 1; - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 0) { diff --git a/test/testshmem.c b/test/testshmem.c index 8411e33c6d1..c579b869913 100644 --- a/test/testshmem.c +++ b/test/testshmem.c @@ -70,7 +70,7 @@ typedef struct mbox { char msg[1024]; int msgavail; } mbox; -ap_pool_t *context; +apr_pool_t *context; mbox *boxes; void msgwait(int boxnum) @@ -87,27 +87,27 @@ void msgwait(int boxnum) void msgput(int boxnum, char *msg) { fprintf(stdout, "Sending message to box %d\n", boxnum); - ap_cpystrn(boxes[boxnum].msg, msg, strlen(msg)); + apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg)); boxes[boxnum].msgavail = 1; } int main() { - ap_shmem_t *shm; + apr_shmem_t *shm; pid_t pid; int size; - ap_initialize(); + apr_initialize(); fprintf(stdout, "Initializing the context......."); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "could not initialize\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Creating shared memory block......."); - if (ap_shm_init(&shm, 1048576, NULL, context) != APR_SUCCESS) { + if (apr_shm_init(&shm, 1048576, NULL, context) != APR_SUCCESS) { fprintf(stderr, "Error allocating shared memory block\n"); exit(-1); } @@ -115,7 +115,7 @@ int main() fprintf(stdout, "Allocating shared memory......."); size = sizeof(mbox) * 2; - boxes = ap_shm_calloc(shm, size); + boxes = apr_shm_calloc(shm, size); if (boxes == NULL) { fprintf(stderr, "Error creating message boxes.\n"); exit(-1); @@ -126,7 +126,7 @@ int main() pid = fork(); if (pid == 0) { sleep(1); - if (ap_open_shmem(shm) == APR_SUCCESS) { + if (apr_open_shmem(shm) == APR_SUCCESS) { msgwait(1); msgput(0, "Msg received\n"); } else { diff --git a/test/testsock.c b/test/testsock.c index 7cc1a3ce09a..0321eb4b210 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -65,26 +65,26 @@ int main(int argc, char *argv[]) { - ap_pool_t *context; + apr_pool_t *context; - ap_procattr_t *attr1 = NULL; - ap_procattr_t *attr2 = NULL; - ap_proc_t proc1; - ap_proc_t proc2; - ap_status_t s1; - ap_status_t s2; + apr_procattr_t *attr1 = NULL; + apr_procattr_t *attr2 = NULL; + apr_proc_t proc1; + apr_proc_t proc2; + apr_status_t s1; + apr_status_t s2; char *args[2]; fprintf(stdout, "Initializing........."); - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Something went wrong\n"); exit(-1); } fprintf(stdout, "OK\n"); - atexit(ap_terminate); + atexit(apr_terminate); fprintf(stdout, "Creating context......."); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Could not create context\n"); exit(-1); } @@ -96,38 +96,38 @@ int main(int argc, char *argv[]) fprintf(stdout, "server and client by yourself.\n"); fprintf(stdout, "Creating children to run network tests.......\n"); - s1 = ap_createprocattr_init(&attr1, context); - s2 = ap_createprocattr_init(&attr2, context); + s1 = apr_createprocattr_init(&attr1, context); + s2 = apr_createprocattr_init(&attr2, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { fprintf(stderr, "Problem creating proc attrs\n"); exit(-1); } - args[0] = ap_pstrdup(context, "server"); + args[0] = apr_pstrdup(context, "server"); args[1] = NULL; - s1 = ap_create_process(&proc1, "./server", args, NULL, attr1, context); + s1 = apr_create_process(&proc1, "./server", args, NULL, attr1, context); - args[0] = ap_pstrdup(context, "client"); - s2 = ap_create_process(&proc2, "./client", args, NULL, attr2, context); + args[0] = apr_pstrdup(context, "client"); + s2 = apr_create_process(&proc2, "./client", args, NULL, attr2, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { fprintf(stderr, "Problem spawning new process\n"); exit(-1); } - while ((s1 = ap_wait_proc(&proc1, APR_NOWAIT)) != APR_CHILD_DONE || - (s2 = ap_wait_proc(&proc2, APR_NOWAIT)) != APR_CHILD_DONE) { + while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) != APR_CHILD_DONE || + (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) != APR_CHILD_DONE) { continue; } if (s1 == APR_SUCCESS) { - ap_kill(&proc2, SIGTERM); - ap_wait_proc(&proc2, APR_WAIT); + apr_kill(&proc2, SIGTERM); + apr_wait_proc(&proc2, APR_WAIT); } else { - ap_kill(&proc1, SIGTERM); - ap_wait_proc(&proc1, APR_WAIT); + apr_kill(&proc1, SIGTERM); + apr_wait_proc(&proc1, APR_WAIT); } fprintf(stdout, "Network test completed.\n"); diff --git a/test/testthread.c b/test/testthread.c index eeba90c1b67..79ccfb698c2 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -69,17 +69,17 @@ void * APR_THREAD_FUNC thread_func3(void *data); void * APR_THREAD_FUNC thread_func4(void *data); -ap_lock_t *thread_lock; -ap_pool_t *context; +apr_lock_t *thread_lock; +apr_pool_t *context; int x = 0; void * APR_THREAD_FUNC thread_func1(void *data) { int i; for (i = 0; i < 10000; i++) { - ap_lock(thread_lock); + apr_lock(thread_lock); x++; - ap_unlock(thread_lock); + apr_unlock(thread_lock); } return NULL; } @@ -88,9 +88,9 @@ void * APR_THREAD_FUNC thread_func2(void *data) { int i; for (i = 0; i < 10000; i++) { - ap_lock(thread_lock); + apr_lock(thread_lock); x++; - ap_unlock(thread_lock); + apr_unlock(thread_lock); } return NULL; } @@ -99,9 +99,9 @@ void * APR_THREAD_FUNC thread_func3(void *data) { int i; for (i = 0; i < 10000; i++) { - ap_lock(thread_lock); + apr_lock(thread_lock); x++; - ap_unlock(thread_lock); + apr_unlock(thread_lock); } return NULL; } @@ -110,35 +110,35 @@ void * APR_THREAD_FUNC thread_func4(void *data) { int i; for (i = 0; i < 10000; i++) { - ap_lock(thread_lock); + apr_lock(thread_lock); x++; - ap_unlock(thread_lock); + apr_unlock(thread_lock); } return NULL; } int main() { - ap_thread_t *t1; - ap_thread_t *t2; - ap_thread_t *t3; - ap_thread_t *t4; - ap_status_t s1; - ap_status_t s2; - ap_status_t s3; - ap_status_t s4; + apr_thread_t *t1; + apr_thread_t *t2; + apr_thread_t *t3; + apr_thread_t *t4; + apr_status_t s1; + apr_status_t s2; + apr_status_t s3; + apr_status_t s4; - ap_initialize(); + apr_initialize(); fprintf(stdout, "Initializing the context......."); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "could not initialize\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Initializing the lock......."); - s1 = ap_create_lock(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); + s1 = apr_create_lock(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); if (s1 != APR_SUCCESS) { fprintf(stderr, "Could not create lock\n"); exit(-1); @@ -146,10 +146,10 @@ int main() fprintf(stdout, "OK\n"); fprintf(stdout, "Starting all the threads......."); - s1 = ap_create_thread(&t1, NULL, thread_func1, NULL, context); - s2 = ap_create_thread(&t2, NULL, thread_func2, NULL, context); - s3 = ap_create_thread(&t3, NULL, thread_func3, NULL, context); - s4 = ap_create_thread(&t4, NULL, thread_func4, NULL, context); + s1 = apr_create_thread(&t1, NULL, thread_func1, NULL, context); + s2 = apr_create_thread(&t2, NULL, thread_func2, NULL, context); + s3 = apr_create_thread(&t3, NULL, thread_func3, NULL, context); + s4 = apr_create_thread(&t4, NULL, thread_func4, NULL, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || s3 != APR_SUCCESS || s4 != APR_SUCCESS) { fprintf(stderr, "Error starting thread\n"); @@ -158,10 +158,10 @@ int main() fprintf(stdout, "OK\n"); fprintf(stdout, "Waiting for threads to exit......."); - ap_thread_join(&s1, t1); - ap_thread_join(&s2, t2); - ap_thread_join(&s3, t3); - ap_thread_join(&s4, t4); + apr_thread_join(&s1, t1); + apr_thread_join(&s2, t2); + apr_thread_join(&s3, t3); + apr_thread_join(&s4, t4); fprintf (stdout, "OK\n"); fprintf(stdout, "Checking if locks worked......."); diff --git a/test/testtime.c b/test/testtime.c index 8314259600c..1a5633fdb23 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -63,32 +63,32 @@ int main() { - ap_time_t now; + apr_time_t now; ap_exploded_time_t xt; - ap_time_t imp; + apr_time_t imp; fprintf(stdout, "Testing Time functions.\n"); - fprintf(stdout, "\tap_now......."); - now = ap_now(); + fprintf(stdout, "\tapr_now......."); + now = apr_now(); fprintf(stdout, "OK\n"); - fprintf(stdout, "\tap_explode_localtime......."); - if (ap_explode_localtime(&xt, now) != APR_SUCCESS) { + fprintf(stdout, "\tapr_explode_localtime......."); + if (apr_explode_localtime(&xt, now) != APR_SUCCESS) { fprintf(stderr, "Couldn't explode the time\n"); exit(-1); } fprintf(stdout, "OK\n"); - fprintf(stdout, "\tap_explode_gmt......."); - if (ap_explode_gmt(&xt, now) != APR_SUCCESS) { + fprintf(stdout, "\tapr_explode_gmt......."); + if (apr_explode_gmt(&xt, now) != APR_SUCCESS) { fprintf(stderr, "Couldn't explode the time\n"); exit(-1); } fprintf(stdout, "OK\n"); - fprintf(stdout, "\tap_implode_time........"); - if (ap_implode_time(&imp, &xt) != APR_SUCCESS) { + fprintf(stdout, "\tapr_implode_time........"); + if (apr_implode_time(&imp, &xt) != APR_SUCCESS) { fprintf(stderr, "Couldn't implode the time\n"); exit(-1); } diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index de3b04737e1..4092455f587 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -60,10 +60,10 @@ struct send_pipe { int err; }; -ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) +apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) { - (*new) = (ap_procattr_t *)ap_palloc(cont, - sizeof(ap_procattr_t)); + (*new) = (apr_procattr_t *)apr_palloc(cont, + sizeof(apr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -81,12 +81,12 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, - ap_int32_t out, ap_int32_t err) +apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) { - ap_status_t status; + apr_status_t status; if (in != 0) { - if ((status = ap_create_pipe(&attr->child_in, &attr->parent_in, + if ((status = apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -94,18 +94,18 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_in, 0); + apr_set_pipe_timeout(attr->child_in, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_in, 0); + apr_set_pipe_timeout(attr->parent_in, 0); break; default: - ap_set_pipe_timeout(attr->child_in, 0); - ap_set_pipe_timeout(attr->parent_in, 0); + apr_set_pipe_timeout(attr->child_in, 0); + apr_set_pipe_timeout(attr->parent_in, 0); } } if (out) { - if ((status = ap_create_pipe(&attr->parent_out, &attr->child_out, + if ((status = apr_create_pipe(&attr->parent_out, &attr->child_out, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -113,18 +113,18 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_out, 0); + apr_set_pipe_timeout(attr->child_out, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_out, 0); + apr_set_pipe_timeout(attr->parent_out, 0); break; default: - ap_set_pipe_timeout(attr->child_out, 0); - ap_set_pipe_timeout(attr->parent_out, 0); + apr_set_pipe_timeout(attr->child_out, 0); + apr_set_pipe_timeout(attr->parent_out, 0); } } if (err) { - if ((status = ap_create_pipe(&attr->parent_err, &attr->child_err, + if ((status = apr_create_pipe(&attr->parent_err, &attr->child_err, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -132,20 +132,20 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_err, 0); + apr_set_pipe_timeout(attr->child_err, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_err, 0); + apr_set_pipe_timeout(attr->parent_err, 0); break; default: - ap_set_pipe_timeout(attr->child_err, 0); - ap_set_pipe_timeout(attr->parent_err, 0); + apr_set_pipe_timeout(attr->child_err, 0); + apr_set_pipe_timeout(attr->parent_err, 0); } } return APR_SUCCESS; } -ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, +apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) { char * cwd; @@ -154,10 +154,10 @@ ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, getcwd(cwd, PATH_MAX); strncat(cwd,"/\0",2); strcat(cwd,dir); - attr->currdir = (char *)ap_pstrdup(attr->cntxt, cwd); + attr->currdir = (char *)apr_pstrdup(attr->cntxt, cwd); free(cwd); } else { - attr->currdir = (char *)ap_pstrdup(attr->cntxt, dir); + attr->currdir = (char *)apr_pstrdup(attr->cntxt, dir); } if (attr->currdir) { return APR_SUCCESS; @@ -165,20 +165,20 @@ ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, return APR_ENOMEM; } -ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, - ap_cmdtype_e cmd) +apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach) +apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) +apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -200,9 +200,9 @@ ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) } -ap_status_t ap_create_process(ap_proc_t *new, const char *progname, +apr_status_t apr_create_process(apr_proc_t *new, const char *progname, char *const args[], char **env, - ap_procattr_t *attr, ap_pool_t *cont) + apr_procattr_t *attr, apr_pool_t *cont) { int i=0,nargs=0; char **newargs = NULL; @@ -210,7 +210,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, struct send_pipe *sp; char * dir = NULL; - sp = (struct send_pipe *)ap_palloc(cont, sizeof(struct send_pipe)); + sp = (struct send_pipe *)apr_palloc(cont, sizeof(struct send_pipe)); new->in = attr->parent_in; new->err = attr->parent_err; @@ -257,13 +257,13 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, resume_thread(newproc); if (attr->child_in) { - ap_close(attr->child_in); + apr_close(attr->child_in); } if (attr->child_out) { - ap_close(attr->child_out); + apr_close(attr->child_out); } if (attr->child_err) { - ap_close(attr->child_err); + apr_close(attr->child_err); } send_data(newproc, 0, (void*)sp, sizeof(struct send_pipe)); @@ -277,8 +277,8 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, return APR_SUCCESS; } -ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, - ap_wait_how_e waithow, ap_pool_t *p) +apr_status_t apr_wait_all_procs(apr_proc_t *proc, ap_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p) { int waitpid_options = WUNTRACED; @@ -295,8 +295,8 @@ ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, return errno; } -ap_status_t ap_wait_proc(ap_proc_t *proc, - ap_wait_how_e wait) +apr_status_t apr_wait_proc(apr_proc_t *proc, + apr_wait_how_e wait) { status_t exitval; thread_info tinfo; @@ -320,47 +320,47 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, return APR_CHILD_NOTDONE; } -ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in, - ap_file_t *parent_in) +apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - ap_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); if (child_in != NULL) - ap_dupfile(&attr->child_in, child_in, attr->cntxt); + apr_dupfile(&attr->child_in, child_in, attr->cntxt); if (parent_in != NULL) - ap_dupfile(&attr->parent_in, parent_in, attr->cntxt); + apr_dupfile(&attr->parent_in, parent_in, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, ap_file_t *child_out, - ap_file_t *parent_out) +apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - ap_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - ap_dupfile(&attr->child_out, child_out, attr->cntxt); + apr_dupfile(&attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - ap_dupfile(&attr->parent_out, parent_out, attr->cntxt); + apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err, - ap_file_t *parent_err) +apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - ap_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - ap_dupfile(&attr->child_err, child_err, attr->cntxt); + apr_dupfile(&attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - ap_dupfile(&attr->parent_err, parent_err, attr->cntxt); + apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 0793f1e8044..c646b0ae577 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -54,11 +54,11 @@ #include "threadproc.h" -ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) +apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) { - (*new) = (ap_threadattr_t *)ap_palloc(cont, - sizeof(ap_threadattr_t)); - (*new)->attr = (int32)ap_palloc(cont, + (*new) = (apr_threadattr_t *)apr_palloc(cont, + sizeof(apr_threadattr_t)); + (*new)->attr = (int32)apr_palloc(cont, sizeof(int32)); if ((*new) == NULL) { @@ -71,7 +71,7 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) +apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) { if (on == 1){ attr->detached = 1; @@ -81,7 +81,7 @@ ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) return APR_SUCCESS; } -ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) +apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) { if (attr->detached == 1){ return APR_DETACH; @@ -89,19 +89,19 @@ ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) return APR_NOTDETACH; } -ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, - ap_thread_start_t func, void *data, - ap_pool_t *cont) +apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont) { int32 temp; - ap_status_t stat; + apr_status_t stat; - (*new) = (ap_thread_t *)ap_palloc(cont, sizeof(ap_thread_t)); + (*new) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->td = (thread_id) ap_palloc(cont, sizeof(thread_id)); + (*new)->td = (thread_id) apr_palloc(cont, sizeof(thread_id)); if ((*new)->td == (thread_id)NULL) { return APR_ENOMEM; } @@ -114,7 +114,7 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, else temp = B_NORMAL_PRIORITY; - stat = ap_create_pool(&(*new)->cntxt, cont); + stat = apr_create_pool(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } @@ -129,14 +129,14 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, } } -ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) +apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { - ap_destroy_pool(thd->cntxt); + apr_destroy_pool(thd->cntxt); exit_thread ((status_t)retval); return APR_SUCCESS; } -ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) +apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { if (wait_for_thread(thd->td,(void *)&retval) == B_NO_ERROR) { return APR_SUCCESS; @@ -146,7 +146,7 @@ ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) } } -ap_status_t ap_thread_detach(ap_thread_t *thd) +apr_status_t apr_thread_detach(apr_thread_t *thd) { if (suspend_thread(thd->td) == B_NO_ERROR){ return APR_SUCCESS; diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index a2d7de6f4f6..0044944f629 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -58,10 +58,10 @@ static struct beos_key key_table[BEOS_MAX_DATAKEYS]; static struct beos_private_data *beos_data[BEOS_MAX_DATAKEYS]; static sem_id lock; -ap_status_t ap_create_thread_private(ap_threadkey_t **key, - void (*dest)(void *), ap_pool_t *cont) +apr_status_t apr_create_thread_private(apr_threadkey_t **key, + void (*dest)(void *), apr_pool_t *cont) { - (*key) = (ap_threadkey_t *)ap_palloc(cont, sizeof(ap_threadkey_t)); + (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; } @@ -82,7 +82,7 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key, return APR_ENOMEM; } -ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) +apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) { thread_id tid; int i, index=0; @@ -114,7 +114,7 @@ ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) return APR_SUCCESS; } -ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) +apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) { thread_id tid; int i,index = 0, ret; @@ -169,7 +169,7 @@ ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) return APR_ENOMEM; } -ap_status_t ap_delete_thread_private(ap_threadkey_t *key) +apr_status_t apr_delete_thread_private(apr_threadkey_t *key) { if (key->key < BEOS_MAX_DATAKEYS){ acquire_sem(key_table[key->key].lock); diff --git a/threadproc/beos/threadproc.h b/threadproc/beos/threadproc.h index 4cb9c31e03f..58c4fb67b33 100644 --- a/threadproc/beos/threadproc.h +++ b/threadproc/beos/threadproc.h @@ -78,20 +78,20 @@ #define BEOS_MAX_DATAKEYS 128 -struct ap_thread_t { - ap_pool_t *cntxt; +struct apr_thread_t { + apr_pool_t *cntxt; thread_id td; }; -struct ap_threadattr_t { - ap_pool_t *cntxt; +struct apr_threadattr_t { + apr_pool_t *cntxt; int32 attr; int detached; int joinable; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; int32 key; }; @@ -109,17 +109,17 @@ struct beos_key { void (* destructor) (void *); }; -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; +struct apr_procattr_t { + apr_pool_t *cntxt; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; }; #endif /* ! THREAD_PROC_H */ diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index d98952b36a0..ea5e73fe32c 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -71,10 +71,10 @@ #include #include -ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) +apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) { - (*new) = (ap_procattr_t *)ap_palloc(cont, - sizeof(ap_procattr_t)); + (*new) = (apr_procattr_t *)apr_palloc(cont, + sizeof(apr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -92,12 +92,12 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, - ap_int32_t out, ap_int32_t err) +apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) { - ap_status_t stat; + apr_status_t stat; if (in) { - if ((stat = ap_create_pipe(&attr->child_in, &attr->parent_in, + if ((stat = apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt)) != APR_SUCCESS) { return stat; } @@ -105,18 +105,18 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_in, 0); + apr_set_pipe_timeout(attr->child_in, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_in, 0); + apr_set_pipe_timeout(attr->parent_in, 0); break; default: - ap_set_pipe_timeout(attr->child_in, 0); - ap_set_pipe_timeout(attr->parent_in, 0); + apr_set_pipe_timeout(attr->child_in, 0); + apr_set_pipe_timeout(attr->parent_in, 0); } } if (out) { - if ((stat = ap_create_pipe(&attr->parent_out, &attr->child_out, + if ((stat = apr_create_pipe(&attr->parent_out, &attr->child_out, attr->cntxt)) != APR_SUCCESS) { return stat; } @@ -124,18 +124,18 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_out, 0); + apr_set_pipe_timeout(attr->child_out, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_out, 0); + apr_set_pipe_timeout(attr->parent_out, 0); break; default: - ap_set_pipe_timeout(attr->child_out, 0); - ap_set_pipe_timeout(attr->parent_out, 0); + apr_set_pipe_timeout(attr->child_out, 0); + apr_set_pipe_timeout(attr->parent_out, 0); } } if (err) { - if ((stat = ap_create_pipe(&attr->parent_err, &attr->child_err, + if ((stat = apr_create_pipe(&attr->parent_err, &attr->child_err, attr->cntxt)) != APR_SUCCESS) { return stat; } @@ -143,90 +143,90 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_err, 0); + apr_set_pipe_timeout(attr->child_err, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_err, 0); + apr_set_pipe_timeout(attr->parent_err, 0); break; default: - ap_set_pipe_timeout(attr->child_err, 0); - ap_set_pipe_timeout(attr->parent_err, 0); + apr_set_pipe_timeout(attr->child_err, 0); + apr_set_pipe_timeout(attr->parent_err, 0); } } return APR_SUCCESS; } -ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in, - ap_file_t *parent_in) +apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - ap_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); if (child_in != NULL) - ap_dupfile(&attr->child_in, child_in, attr->cntxt); + apr_dupfile(&attr->child_in, child_in, attr->cntxt); if (parent_in != NULL) - ap_dupfile(&attr->parent_in, parent_in, attr->cntxt); + apr_dupfile(&attr->parent_in, parent_in, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, ap_file_t *child_out, - ap_file_t *parent_out) +apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - ap_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - ap_dupfile(&attr->child_out, child_out, attr->cntxt); + apr_dupfile(&attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - ap_dupfile(&attr->parent_out, parent_out, attr->cntxt); + apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err, - ap_file_t *parent_err) +apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - ap_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - ap_dupfile(&attr->child_err, child_err, attr->cntxt); + apr_dupfile(&attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - ap_dupfile(&attr->parent_err, parent_err, attr->cntxt); + apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, const char *dir) +apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) { - attr->currdir = ap_pstrdup(attr->cntxt, dir); + attr->currdir = apr_pstrdup(attr->cntxt, dir); if (attr->currdir) { return APR_SUCCESS; } return APR_ENOMEM; } -ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, - ap_cmdtype_e cmd) +apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach) +apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) +apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -252,7 +252,7 @@ ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) /* quotes in the string are doubled up. * Used to escape quotes in args passed to OS/2's cmd.exe */ -static char *double_quotes(ap_pool_t *cntxt, char *str) +static char *double_quotes(apr_pool_t *cntxt, char *str) { int num_quotes = 0; int len = 0; @@ -262,7 +262,7 @@ static char *double_quotes(ap_pool_t *cntxt, char *str) num_quotes += str[len++] == '\"'; } - quote_doubled_str = ap_palloc(cntxt, len + num_quotes + 1); + quote_doubled_str = apr_palloc(cntxt, len + num_quotes + 1); dest = quote_doubled_str; while (*str) { @@ -277,12 +277,12 @@ static char *double_quotes(ap_pool_t *cntxt, char *str) -ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, +apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, char *const args[], char **env, - ap_procattr_t *attr, ap_pool_t *cont) + apr_procattr_t *attr, apr_pool_t *cont) { int i, arg, numargs, cmdlen; - ap_status_t status; + apr_status_t status; char **newargs; char savedir[300]; HFILE save_in, save_out, save_err, dup; @@ -290,7 +290,7 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, char *extension, *newprogname, *extra_arg = NULL, *cmdline, *cmdline_pos; char interpreter[1024]; char error_object[260]; - ap_file_t *progfile; + apr_file_t *progfile; int env_len, e; char *env_block, *env_block_pos; RESULTCODES rescodes; @@ -325,7 +325,7 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, DosSetFHState(attr->parent_err->filedes, OPEN_FLAGS_NOINHERIT); } - ap_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ + apr_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ if (attr->currdir != NULL) { _getcwd2(savedir, sizeof(savedir)); @@ -347,14 +347,14 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, strcpy(interpreter, "#!" SHELL_PATH); extra_arg = "/C"; } else if (stricmp(extension, ".exe") != 0) { - status = ap_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, cont); + status = apr_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, cont); - if (status != APR_SUCCESS && ap_canonical_error(status) == APR_ENOENT) { - progname = ap_pstrcat(cont, progname, ".exe", NULL); + if (status != APR_SUCCESS && apr_canonical_error(status) == APR_ENOENT) { + progname = apr_pstrcat(cont, progname, ".exe", NULL); } if (status == APR_SUCCESS) { - status = ap_fgets(interpreter, sizeof(interpreter), progfile); + status = apr_fgets(interpreter, sizeof(interpreter), progfile); if (status == APR_SUCCESS) { if (interpreter[0] == '#' && interpreter[1] == '!') { @@ -375,7 +375,7 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, } } } - ap_close(progfile); + apr_close(progfile); } i = 0; @@ -384,7 +384,7 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, i++; } - newargs = (char **)ap_palloc(cont, sizeof (char *) * (i + 4)); + newargs = (char **)apr_palloc(cont, sizeof (char *) * (i + 4)); numargs = 0; if (interpreter[0]) @@ -392,7 +392,7 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, if (extra_arg) newargs[numargs++] = "/c"; - newargs[numargs++] = newprogname = ap_pstrdup(cont, progname); + newargs[numargs++] = newprogname = apr_pstrdup(cont, progname); arg = 1; while (args && args[arg]) { @@ -410,14 +410,14 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, for (i=0; i\" ")) - a = ap_pstrcat(cont, "\"", double_quotes(cont, a), "\"", NULL); + a = apr_pstrcat(cont, "\"", double_quotes(cont, a), "\"", NULL); *(cmdline_pos++) = ' '; strcpy(cmdline_pos, a); @@ -437,7 +437,7 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, for (env_len=1, e=0; env[e]; e++) env_len += strlen(env[e]) + 1; - env_block = ap_palloc(cont, env_len); + env_block = apr_palloc(cont, env_len); env_block_pos = env_block; for (e=0; env[e]; e++) { @@ -460,21 +460,21 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, } if (attr->child_in) { - ap_close(attr->child_in); + apr_close(attr->child_in); dup = STDIN_FILENO; DosDupHandle(save_in, &dup); DosClose(save_in); } if (attr->child_out) { - ap_close(attr->child_out); + apr_close(attr->child_out); dup = STDOUT_FILENO; DosDupHandle(save_out, &dup); DosClose(save_out); } if (attr->child_err) { - ap_close(attr->child_err); + apr_close(attr->child_err); dup = STDERR_FILENO; DosDupHandle(save_err, &dup); DosClose(save_err); @@ -491,8 +491,8 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, -ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, - ap_wait_how_e waithow, ap_pool_t *p) +apr_status_t apr_wait_all_procs(apr_proc_t *proc, ap_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p) { RESULTCODES codes; ULONG rc; @@ -519,8 +519,8 @@ ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, -ap_status_t ap_wait_proc(ap_proc_t *proc, - ap_wait_how_e wait) +apr_status_t apr_wait_proc(apr_proc_t *proc, + apr_wait_how_e wait) { RESULTCODES codes; ULONG rc; @@ -542,7 +542,7 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, -ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc) +apr_status_t ap_get_os_proc(apr_os_proc_t *theproc, apr_proc_t *proc) { if (proc == NULL) { return APR_ENOPROC; diff --git a/threadproc/os2/signals.c b/threadproc/os2/signals.c index 6ba71bada5b..5d7e7aee006 100644 --- a/threadproc/os2/signals.c +++ b/threadproc/os2/signals.c @@ -63,12 +63,12 @@ #define INCL_DOS #include -ap_status_t ap_kill(ap_proc_t *proc, int signal) +apr_status_t apr_kill(apr_proc_t *proc, int signal) { /* SIGTERM's don't work too well in OS/2 (only affects other EMX programs). CGIs may not be, esp. REXX scripts, so use a native call instead */ - ap_status_t rc; + apr_status_t rc; if ( signal == SIGTERM ) { rc = APR_OS2_STATUS(DosSendSignalException(proc->pid, XCPT_SIGNAL_BREAK)); diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index dbfa3482550..e44106be018 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -62,9 +62,9 @@ #include #include -ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) +apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) { - (*new) = (ap_threadattr_t *)ap_palloc(cont, sizeof(ap_threadattr_t)); + (*new) = (apr_threadattr_t *)apr_palloc(cont, sizeof(apr_threadattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -77,7 +77,7 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) -ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) +apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) { attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; @@ -85,7 +85,7 @@ ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) -ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) +apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) { return (attr->attr & APR_THREADATTR_DETACHED) ? APR_DETACH : APR_NOTDETACH; } @@ -94,20 +94,20 @@ ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) static void ap_thread_begin(void *arg) { - ap_thread_t *thread = (ap_thread_t *)arg; + apr_thread_t *thread = (apr_thread_t *)arg; thread->rv = thread->func(thread->data); } -ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, - ap_thread_start_t func, void *data, - ap_pool_t *cont) +apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont) { - ap_status_t stat; - ap_thread_t *thread; + apr_status_t stat; + apr_thread_t *thread; - thread = (ap_thread_t *)ap_palloc(cont, sizeof(ap_thread_t)); + thread = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); *new = thread; if (thread == NULL) { @@ -118,14 +118,14 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, thread->attr = attr; thread->func = func; thread->data = data; - stat = ap_create_pool(&thread->cntxt, cont); + stat = apr_create_pool(&thread->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } if (attr == NULL) { - stat = ap_create_threadattr(&thread->attr, thread->cntxt); + stat = apr_create_threadattr(&thread->attr, thread->cntxt); if (stat != APR_SUCCESS) { return stat; @@ -146,7 +146,7 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, -ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) +apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { thd->rv = retval; _endthread(); @@ -155,7 +155,7 @@ ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) -ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) +apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { ULONG rc; TID waittid = thd->tid; @@ -168,13 +168,13 @@ ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) if (rc == ERROR_INVALID_THREADID) rc = 0; /* Thread had already terminated */ - *retval = (ap_status_t)thd->rv; + *retval = (apr_status_t)thd->rv; return APR_OS2_STATUS(rc); } -ap_status_t ap_thread_detach(ap_thread_t *thd) +apr_status_t apr_thread_detach(apr_thread_t *thd) { thd->attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index cf436d23708..15143e512a4 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -59,10 +59,10 @@ #include "apr_lib.h" #include "fileio.h" -ap_status_t ap_create_thread_private(ap_threadkey_t **key, - void (*dest)(void *), ap_pool_t *cont) +apr_status_t apr_create_thread_private(apr_threadkey_t **key, + void (*dest)(void *), apr_pool_t *cont) { - (*key) = (ap_threadkey_t *)ap_palloc(cont, sizeof(ap_threadkey_t)); + (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; @@ -72,19 +72,19 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key, return APR_OS2_STATUS(DosAllocThreadLocalMemory(1, &((*key)->key))); } -ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) +apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) { (*new) = (void *)*(key->key); return APR_SUCCESS; } -ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) +apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) { *(key->key) = (ULONG)priv; return APR_SUCCESS; } -ap_status_t ap_delete_thread_private(ap_threadkey_t *key) +apr_status_t apr_delete_thread_private(apr_threadkey_t *key) { return APR_OS2_STATUS(DosFreeThreadLocalMemory(key->key)); } diff --git a/threadproc/os2/threadproc.h b/threadproc/os2/threadproc.h index d6971dbb300..c14c54aa00c 100644 --- a/threadproc/os2/threadproc.h +++ b/threadproc/os2/threadproc.h @@ -63,36 +63,36 @@ #define SHELL_PATH "cmd.exe" #define APR_THREAD_STACKSIZE 65536 -struct ap_threadattr_t { - ap_pool_t *cntxt; +struct apr_threadattr_t { + apr_pool_t *cntxt; unsigned long attr; }; -struct ap_thread_t { - ap_pool_t *cntxt; - struct ap_threadattr_t *attr; +struct apr_thread_t { + apr_pool_t *cntxt; + struct apr_threadattr_t *attr; unsigned long tid; - ap_thread_start_t func; + apr_thread_start_t func; void *data; void *rv; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; unsigned long *key; }; -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; +struct apr_procattr_t { + apr_pool_t *cntxt; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; }; typedef void (*os2_thread_start_t)(void *); diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 07f977b60b8..25a4b45c6ca 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -56,9 +56,9 @@ #include "apr_strings.h" #include "apr_portable.h" -ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) +apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) { - (*new) = (ap_procattr_t *)ap_pcalloc(cont, sizeof(ap_procattr_t)); + (*new) = (apr_procattr_t *)apr_pcalloc(cont, sizeof(apr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -68,12 +68,12 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, - ap_int32_t out, ap_int32_t err) +apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) { - ap_status_t status; + apr_status_t status; if (in != 0) { - if ((status = ap_create_pipe(&attr->child_in, &attr->parent_in, + if ((status = apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -81,18 +81,18 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_in, 0); + apr_set_pipe_timeout(attr->child_in, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_in, 0); + apr_set_pipe_timeout(attr->parent_in, 0); break; default: - ap_set_pipe_timeout(attr->child_in, 0); - ap_set_pipe_timeout(attr->parent_in, 0); + apr_set_pipe_timeout(attr->child_in, 0); + apr_set_pipe_timeout(attr->parent_in, 0); } } if (out) { - if ((status = ap_create_pipe(&attr->parent_out, &attr->child_out, + if ((status = apr_create_pipe(&attr->parent_out, &attr->child_out, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -100,18 +100,18 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_out, 0); + apr_set_pipe_timeout(attr->child_out, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_out, 0); + apr_set_pipe_timeout(attr->parent_out, 0); break; default: - ap_set_pipe_timeout(attr->child_out, 0); - ap_set_pipe_timeout(attr->parent_out, 0); + apr_set_pipe_timeout(attr->child_out, 0); + apr_set_pipe_timeout(attr->parent_out, 0); } } if (err) { - if ((status = ap_create_pipe(&attr->parent_err, &attr->child_err, + if ((status = apr_create_pipe(&attr->parent_err, &attr->child_err, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -119,92 +119,92 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_err, 0); + apr_set_pipe_timeout(attr->child_err, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_err, 0); + apr_set_pipe_timeout(attr->parent_err, 0); break; default: - ap_set_pipe_timeout(attr->child_err, 0); - ap_set_pipe_timeout(attr->parent_err, 0); + apr_set_pipe_timeout(attr->child_err, 0); + apr_set_pipe_timeout(attr->parent_err, 0); } } return APR_SUCCESS; } -ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in, - ap_file_t *parent_in) +apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - ap_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); if (child_in != NULL) - ap_dupfile(&attr->child_in, child_in, attr->cntxt); + apr_dupfile(&attr->child_in, child_in, attr->cntxt); if (parent_in != NULL) - ap_dupfile(&attr->parent_in, parent_in, attr->cntxt); + apr_dupfile(&attr->parent_in, parent_in, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, ap_file_t *child_out, - ap_file_t *parent_out) +apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - ap_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - ap_dupfile(&attr->child_out, child_out, attr->cntxt); + apr_dupfile(&attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - ap_dupfile(&attr->parent_out, parent_out, attr->cntxt); + apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err, - ap_file_t *parent_err) +apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - ap_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - ap_dupfile(&attr->child_err, child_err, attr->cntxt); + apr_dupfile(&attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - ap_dupfile(&attr->parent_err, parent_err, attr->cntxt); + apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, +apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) { - attr->currdir = ap_pstrdup(attr->cntxt, dir); + attr->currdir = apr_pstrdup(attr->cntxt, dir); if (attr->currdir) { return APR_SUCCESS; } return APR_ENOMEM; } -ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, - ap_cmdtype_e cmd) +apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach) +apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) +apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -227,7 +227,7 @@ ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) #if APR_HAVE_STRUCT_RLIMIT #if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) -static ap_status_t limit_proc(ap_procattr_t *attr) +static apr_status_t limit_proc(apr_procattr_t *attr) { #ifdef RLIMIT_CPU if (attr->limit_cpu != NULL) { @@ -267,9 +267,9 @@ static ap_status_t limit_proc(ap_procattr_t *attr) #endif #endif -ap_status_t ap_create_process(ap_proc_t *new, const char *progname, +apr_status_t apr_create_process(apr_proc_t *new, const char *progname, char *const args[], char **env, - ap_procattr_t *attr, ap_pool_t *cont) + apr_procattr_t *attr, apr_pool_t *cont) { int i; typedef const char *my_stupid_string; @@ -285,22 +285,22 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, int status; /* child process */ if (attr->child_in) { - ap_close(attr->parent_in); + apr_close(attr->parent_in); dup2(attr->child_in->filedes, STDIN_FILENO); - ap_close(attr->child_in); + apr_close(attr->child_in); } if (attr->child_out) { - ap_close(attr->parent_out); + apr_close(attr->parent_out); dup2(attr->child_out->filedes, STDOUT_FILENO); - ap_close(attr->child_out); + apr_close(attr->child_out); } if (attr->child_err) { - ap_close(attr->parent_err); + apr_close(attr->parent_err); dup2(attr->child_err->filedes, STDERR_FILENO); - ap_close(attr->child_err); + apr_close(attr->child_err); } - ap_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ + apr_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ if (attr->currdir != NULL) { if (chdir(attr->currdir) == -1) { @@ -308,7 +308,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, } } - ap_cleanup_for_exec(); + apr_cleanup_for_exec(); #if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) if ((status = limit_proc(attr)) != APR_SUCCESS) { @@ -322,7 +322,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, i++; } newargs = - (my_stupid_string *) ap_palloc(cont, sizeof (char *) * (i + 3)); + (my_stupid_string *) apr_palloc(cont, sizeof (char *) * (i + 3)); newargs[0] = SHELL_PATH; newargs[1] = "-c"; i = 0; @@ -332,13 +332,13 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, } newargs[i + 3] = NULL; if (attr->detached) { - ap_detach(); + apr_detach(); } execve(SHELL_PATH, (char **) newargs, env); } else { if (attr->detached) { - ap_detach(); + apr_detach(); } execve(progname, args, env); } @@ -347,19 +347,19 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, } /* Parent process */ if (attr->child_in) { - ap_close(attr->child_in); + apr_close(attr->child_in); } if (attr->child_out) { - ap_close(attr->child_out); + apr_close(attr->child_out); } if (attr->child_err) { - ap_close(attr->child_err); + apr_close(attr->child_err); } return APR_SUCCESS; } -ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, - ap_wait_how_e waithow, ap_pool_t *p) +apr_status_t apr_wait_all_procs(apr_proc_t *proc, ap_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p) { int waitpid_options = WUNTRACED; @@ -376,8 +376,8 @@ ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, return errno; } -ap_status_t ap_wait_proc(ap_proc_t *proc, - ap_wait_how_e waithow) +apr_status_t apr_wait_proc(apr_proc_t *proc, + apr_wait_how_e waithow) { pid_t status; if (!proc) @@ -400,7 +400,7 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, return errno; } -ap_status_t ap_setprocattr_limit(ap_procattr_t *attr, ap_int32_t what, +apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, struct rlimit *limit) { switch(what) { diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index d928058822a..c2f0fc6ec8b 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -54,7 +54,7 @@ #include "threadproc.h" -ap_status_t ap_detach(void) +apr_status_t apr_detach(void) { int x; pid_t pgrp; diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 39292c14fa1..61184423fd2 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -63,7 +63,7 @@ #include #endif -ap_status_t ap_kill(ap_proc_t *proc, int sig) +apr_status_t apr_kill(apr_proc_t *proc, int sig) { if (kill(proc->pid, sig) == -1) { return errno; @@ -77,7 +77,7 @@ ap_status_t ap_kill(ap_proc_t *proc, int sig) * from W. Richard Stevens' "Advanced Programming in the UNIX Environment" * (the version that does not automatically restart system calls). */ -Sigfunc *ap_signal(int signo, Sigfunc * func) +Sigfunc *apr_signal(int signo, Sigfunc * func) { struct sigaction act, oact; diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 469722d2550..482ef124db9 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -59,12 +59,12 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) +apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) { - ap_status_t stat; + apr_status_t stat; - (*new) = (ap_threadattr_t *)ap_pcalloc(cont, sizeof(ap_threadattr_t)); - (*new)->attr = (pthread_attr_t *)ap_pcalloc(cont, sizeof(pthread_attr_t)); + (*new) = (apr_threadattr_t *)apr_pcalloc(cont, sizeof(apr_threadattr_t)); + (*new)->attr = (pthread_attr_t *)apr_pcalloc(cont, sizeof(pthread_attr_t)); if ((*new) == NULL || (*new)->attr == NULL) { return APR_ENOMEM; @@ -82,9 +82,9 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) return stat; } -ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) +apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) { - ap_status_t stat; + apr_status_t stat; #ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR int arg = on; @@ -102,7 +102,7 @@ ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) } } -ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) +apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) { int state; @@ -116,20 +116,20 @@ ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) return APR_NOTDETACH; } -ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, - ap_thread_start_t func, void *data, - ap_pool_t *cont) +apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont) { - ap_status_t stat; + apr_status_t stat; pthread_attr_t *temp; - (*new) = (ap_thread_t *)ap_pcalloc(cont, sizeof(ap_thread_t)); + (*new) = (apr_thread_t *)apr_pcalloc(cont, sizeof(apr_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->td = (pthread_t *)ap_pcalloc(cont, sizeof(pthread_t)); + (*new)->td = (pthread_t *)apr_pcalloc(cont, sizeof(pthread_t)); if ((*new)->td == NULL) { return APR_ENOMEM; @@ -142,7 +142,7 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, else temp = NULL; - stat = ap_create_pool(&(*new)->cntxt, cont); + stat = apr_create_pool(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } @@ -158,16 +158,16 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, } } -ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) +apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { - ap_destroy_pool(thd->cntxt); + apr_destroy_pool(thd->cntxt); pthread_exit(retval); return APR_SUCCESS; } -ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) +apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { - ap_status_t stat; + apr_status_t stat; if ((stat = pthread_join(*thd->td,(void *)&retval)) == 0) { return APR_SUCCESS; @@ -180,9 +180,9 @@ ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) } } -ap_status_t ap_thread_detach(ap_thread_t *thd) +apr_status_t apr_thread_detach(apr_thread_t *thd) { - ap_status_t stat; + apr_status_t stat; #ifdef PTHREAD_DETACH_ARG1_ADDR if ((stat = pthread_detach(thd->td)) == 0) { @@ -199,32 +199,32 @@ ap_status_t ap_thread_detach(ap_thread_t *thd) } } -ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread) +apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) { - return ap_get_userdata(data, key, thread->cntxt); + return apr_get_userdata(data, key, thread->cntxt); } -ap_status_t ap_set_threaddata(void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_thread_t *thread) +apr_status_t apr_set_threaddata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread) { - return ap_set_userdata(data, key, cleanup, thread->cntxt); + return apr_set_userdata(data, key, cleanup, thread->cntxt); } -ap_status_t ap_get_os_thread(ap_os_thread_t **thethd, ap_thread_t *thd) +apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd) { *thethd = thd->td; return APR_SUCCESS; } -ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd, - ap_pool_t *cont) +apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*thd) == NULL) { - (*thd) = (ap_thread_t *)ap_pcalloc(cont, sizeof(ap_thread_t)); + (*thd) = (apr_thread_t *)apr_pcalloc(cont, sizeof(apr_thread_t)); (*thd)->cntxt = cont; } (*thd)->td = thethd; diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index e872dc9799e..6c02dd13020 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -59,11 +59,11 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -ap_status_t ap_create_thread_private(ap_threadkey_t **key, - void (*dest)(void *), ap_pool_t *cont) +apr_status_t apr_create_thread_private(apr_threadkey_t **key, + void (*dest)(void *), apr_pool_t *cont) { - ap_status_t stat; - (*key) = (ap_threadkey_t *)ap_pcalloc(cont, sizeof(ap_threadkey_t)); + apr_status_t stat; + (*key) = (apr_threadkey_t *)apr_pcalloc(cont, sizeof(apr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; @@ -77,7 +77,7 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key, return stat; } -ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) +apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) { #ifdef PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS if (pthread_getspecific(key->key,new)) @@ -88,9 +88,9 @@ ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) return APR_SUCCESS; } -ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) +apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) { - ap_status_t stat; + apr_status_t stat; if ((stat = pthread_setspecific(key->key, priv)) == 0) { return APR_SUCCESS; } @@ -99,42 +99,42 @@ ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) } } -ap_status_t ap_delete_thread_private(ap_threadkey_t *key) +apr_status_t apr_delete_thread_private(apr_threadkey_t *key) { - ap_status_t stat; + apr_status_t stat; if ((stat = pthread_key_delete(key->key)) == 0) { return APR_SUCCESS; } return stat; } -ap_status_t ap_get_threadkeydata(void **data, const char *key, - ap_threadkey_t *threadkey) +apr_status_t apr_get_threadkeydata(void **data, const char *key, + apr_threadkey_t *threadkey) { - return ap_get_userdata(data, key, threadkey->cntxt); + return apr_get_userdata(data, key, threadkey->cntxt); } -ap_status_t ap_set_threadkeydata(void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_threadkey_t *threadkey) +apr_status_t apr_set_threadkeydata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey) { - return ap_set_userdata(data, key, cleanup, threadkey->cntxt); + return apr_set_userdata(data, key, cleanup, threadkey->cntxt); } -ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key) +apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -ap_status_t ap_put_os_threadkey(ap_threadkey_t **key, - ap_os_threadkey_t *thekey, ap_pool_t *cont) +apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (ap_threadkey_t *)ap_pcalloc(cont, sizeof(ap_threadkey_t)); + (*key) = (apr_threadkey_t *)apr_pcalloc(cont, sizeof(apr_threadkey_t)); (*key)->cntxt = cont; } (*key)->key = *thekey; diff --git a/threadproc/unix/threadproc.h b/threadproc/unix/threadproc.h index e6d9e36aa3f..d5f0a679f4b 100644 --- a/threadproc/unix/threadproc.h +++ b/threadproc/unix/threadproc.h @@ -86,33 +86,33 @@ #define SHELL_PATH "/bin/sh" #if APR_HAS_THREADS -struct ap_thread_t { - ap_pool_t *cntxt; +struct apr_thread_t { + apr_pool_t *cntxt; pthread_t *td; }; -struct ap_threadattr_t { - ap_pool_t *cntxt; +struct apr_threadattr_t { + apr_pool_t *cntxt; pthread_attr_t *attr; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; pthread_key_t key; }; #endif -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; +struct apr_procattr_t { + apr_pool_t *cntxt; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; #ifdef RLIMIT_CPU struct rlimit *limit_cpu; #endif diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 14819bfd7dc..1741b87d798 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -65,9 +65,9 @@ #include #include -ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) +apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) { - (*new) = (ap_procattr_t *)ap_palloc(cont, sizeof(ap_procattr_t)); + (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -88,10 +88,10 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, - ap_int32_t out, ap_int32_t err) +apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) { - ap_status_t stat; + apr_status_t stat; BOOLEAN bAsyncRead, bAsyncWrite; if (in) { switch (in) { @@ -165,39 +165,39 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, return APR_SUCCESS; } #if 0 -ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in, - ap_file_t *parent_in) +apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in) { } -ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, ap_file_t *child_out, - ap_file_t *parent_out) +apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - ap_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - ap_dupfile(&attr->child_out, child_out, attr->cntxt); + apr_dupfile(&attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - ap_dupfile(&attr->parent_out, parent_out, attr->cntxt); + apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err, - ap_file_t *parent_err) +apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - ap_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - ap_dupfile(&attr->child_err, child_err, attr->cntxt); + apr_dupfile(&attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - ap_dupfile(&attr->parent_err, parent_err, attr->cntxt); + apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } #endif -ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, +apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) { char path[MAX_PATH]; @@ -209,10 +209,10 @@ ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, if (length == 0 || length + strlen(dir) + 1 >= MAX_PATH) return APR_ENOMEM; - attr->currdir = ap_pstrcat(attr->cntxt, path, "\\", dir, NULL); + attr->currdir = apr_pstrcat(attr->cntxt, path, "\\", dir, NULL); } else { - attr->currdir = ap_pstrdup(attr->cntxt, dir); + attr->currdir = apr_pstrdup(attr->cntxt, dir); } if (attr->currdir) { @@ -221,22 +221,22 @@ ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, return APR_ENOMEM; } -ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, - ap_cmdtype_e cmd) +apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t det) +apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t det) { attr->detached = det; return APR_SUCCESS; } -ap_status_t ap_create_process(ap_proc_t *new, const char *progname, +apr_status_t apr_create_process(apr_proc_t *new, const char *progname, char *const args[], char **env, - ap_procattr_t *attr, ap_pool_t *cont) + apr_procattr_t *attr, apr_pool_t *cont) { int i, iEnvBlockLen; char *cmdline; @@ -245,7 +245,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, char ppid[20]; char *envstr; char *pEnvBlock, *pNext; - ap_status_t rv; + apr_status_t rv; PROCESS_INFORMATION pi; new->in = attr->parent_in; @@ -282,18 +282,18 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, } if (*ptr == '\\' || *++ptr == ':') { - cmdline = ap_pstrdup(cont, progname); + cmdline = apr_pstrdup(cont, progname); } else if (attr->currdir == NULL) { - cmdline = ap_pstrdup(cont, progname); + cmdline = apr_pstrdup(cont, progname); } else { char lastchar = attr->currdir[strlen(attr->currdir)-1]; if ( lastchar == '\\' || lastchar == '/') { - cmdline = ap_pstrcat(cont, attr->currdir, progname, NULL); + cmdline = apr_pstrcat(cont, attr->currdir, progname, NULL); } else { - cmdline = ap_pstrcat(cont, attr->currdir, "\\", progname, NULL); + cmdline = apr_pstrcat(cont, attr->currdir, "\\", progname, NULL); } } } @@ -301,13 +301,13 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, char * shell_cmd = getenv("COMSPEC"); if (!shell_cmd) shell_cmd = SHELL_PATH; - shell_cmd = ap_pstrdup(cont, shell_cmd); - cmdline = ap_pstrcat(cont, shell_cmd, " /C ", progname, NULL); + shell_cmd = apr_pstrdup(cont, shell_cmd); + cmdline = apr_pstrcat(cont, shell_cmd, " /C ", progname, NULL); } i = 1; while (args && args[i]) { - cmdline = ap_pstrcat(cont, cmdline, " ", args[i], NULL); + cmdline = apr_pstrcat(cont, cmdline, " ", args[i], NULL); i++; } /* @@ -335,16 +335,16 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, 0, FALSE, DUPLICATE_SAME_ACCESS))) { rv = GetLastError(); if (attr->child_in) { - ap_close(attr->child_in); - ap_close(attr->parent_in); + apr_close(attr->child_in); + apr_close(attr->parent_in); } if (attr->child_out) { - ap_close(attr->child_out); - ap_close(attr->parent_out); + apr_close(attr->child_out); + apr_close(attr->parent_out); } if (attr->child_err) { - ap_close(attr->child_err); - ap_close(attr->parent_err); + apr_close(attr->child_err); + apr_close(attr->parent_err); } return rv; } @@ -365,7 +365,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, _itoa(_getpid(), ppid, 10); if (env) { - envstr = ap_pstrcat(cont, "parentpid=", ppid, NULL); + envstr = apr_pstrcat(cont, "parentpid=", ppid, NULL); /* * Win32's CreateProcess call requires that the environment * be passed in an environment block, a null terminated block of @@ -378,7 +378,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, i++; } - pEnvBlock = (char *)ap_pcalloc(cont, iEnvBlockLen + strlen(envstr)); + pEnvBlock = (char *)apr_pcalloc(cont, iEnvBlockLen + strlen(envstr)); i = 0; pNext = pEnvBlock; @@ -401,7 +401,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, &attr->si, &pi)) { // TODO: THIS IS BADNESS - // The completion of the ap_proc_t type leaves us ill equiped to track both + // The completion of the apr_proc_t type leaves us ill equiped to track both // the pid (Process ID) and handle to the process, which are entirely // different things and each useful in their own rights. // @@ -410,13 +410,13 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, new->pid = (pid_t) pi.hProcess; if (attr->child_in) { - ap_close(attr->child_in); + apr_close(attr->child_in); } if (attr->child_out) { - ap_close(attr->child_out); + apr_close(attr->child_out); } if (attr->child_err) { - ap_close(attr->child_err); + apr_close(attr->child_err); } CloseHandle(pi.hThread); @@ -426,7 +426,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, return GetLastError(); } -ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e wait) +apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e wait) { DWORD stat; if (!proc) diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 0de2653f1b9..a75cd530956 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -64,7 +64,7 @@ #endif /* Windows only really support killing process, but that will do for now. */ -ap_status_t ap_kill(ap_proc_t *proc, int signal) +apr_status_t apr_kill(apr_proc_t *proc, int signal) { if (TerminateProcess(proc->pid, signal) == 0) { return GetLastError(); diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index beed161c413..1d10d27d228 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -61,10 +61,10 @@ #include -ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) +apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) { - (*new) = (ap_threadattr_t *)ap_palloc(cont, - sizeof(ap_threadattr_t)); + (*new) = (apr_threadattr_t *)apr_palloc(cont, + sizeof(apr_threadattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -74,28 +74,28 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) +apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) { attr->detach = on; return APR_SUCCESS; } -ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) +apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) { if (attr->detach == 1) return APR_DETACH; return APR_NOTDETACH; } -ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, - ap_thread_start_t func, void *data, - ap_pool_t *cont) +apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont) { - ap_status_t stat; + apr_status_t stat; unsigned temp; int lasterror; - (*new) = (ap_thread_t *)ap_palloc(cont, sizeof(ap_thread_t)); + (*new) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -103,7 +103,7 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, (*new)->cntxt = cont; - stat = ap_create_pool(&(*new)->cntxt, cont); + stat = apr_create_pool(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } @@ -124,16 +124,16 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, return APR_SUCCESS; } -ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) +apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { - ap_destroy_pool(thd->cntxt); + apr_destroy_pool(thd->cntxt); _endthreadex(*retval); return APR_SUCCESS; } -ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) +apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { - ap_status_t stat; + apr_status_t stat; if ((stat = WaitForSingleObject(thd->td, INFINITE)) == WAIT_OBJECT_0) { if (GetExitCodeThread(thd->td, retval) == 0) { @@ -146,7 +146,7 @@ ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) } } -ap_status_t ap_thread_detach(ap_thread_t *thd) +apr_status_t apr_thread_detach(apr_thread_t *thd) { if (CloseHandle(thd->td)) { return APR_SUCCESS; @@ -156,19 +156,19 @@ ap_status_t ap_thread_detach(ap_thread_t *thd) } } -ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread) +apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) { - return ap_get_userdata(data, key, thread->cntxt); + return apr_get_userdata(data, key, thread->cntxt); } -ap_status_t ap_set_threaddata(void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_thread_t *thread) +apr_status_t apr_set_threaddata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread) { - return ap_set_userdata(data, key, cleanup, thread->cntxt); + return apr_set_userdata(data, key, cleanup, thread->cntxt); } -ap_status_t ap_get_os_thread(ap_os_thread_t **thethd, ap_thread_t *thd) +apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd) { if (thd == NULL) { return APR_ENOTHREAD; @@ -177,14 +177,14 @@ ap_status_t ap_get_os_thread(ap_os_thread_t **thethd, ap_thread_t *thd) return APR_SUCCESS; } -ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd, - ap_pool_t *cont) +apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*thd) == NULL) { - (*thd) = (ap_thread_t *)ap_palloc(cont, sizeof(ap_thread_t)); + (*thd) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); (*thd)->cntxt = cont; } (*thd)->td = thethd; diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 275326cf595..f7fca12f0a8 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -59,8 +59,8 @@ #include "apr_errno.h" #include "apr_portable.h" -ap_status_t ap_create_thread_private(ap_threadkey_t **key, - void (*dest)(void *), ap_pool_t *cont) +apr_status_t apr_create_thread_private(apr_threadkey_t **key, + void (*dest)(void *), apr_pool_t *cont) { if (((*key)->key = TlsAlloc()) != 0xFFFFFFFF) { return APR_SUCCESS; @@ -68,7 +68,7 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key, return GetLastError(); } -ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) +apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) { if ((*new) = TlsGetValue(key->key)) { return APR_SUCCESS; @@ -76,7 +76,7 @@ ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) return GetLastError(); } -ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) +apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) { if (TlsSetValue(key->key, priv)) { return APR_SUCCESS; @@ -84,7 +84,7 @@ ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) return GetLastError(); } -ap_status_t ap_delete_thread_private(ap_threadkey_t *key) +apr_status_t apr_delete_thread_private(apr_threadkey_t *key) { if (TlsFree(key->key)) { return APR_SUCCESS; @@ -92,33 +92,33 @@ ap_status_t ap_delete_thread_private(ap_threadkey_t *key) return GetLastError(); } -ap_status_t ap_get_threadkeydata(void **data, const char *key, - ap_threadkey_t *threadkey) +apr_status_t apr_get_threadkeydata(void **data, const char *key, + apr_threadkey_t *threadkey) { - return ap_get_userdata(data, key, threadkey->cntxt); + return apr_get_userdata(data, key, threadkey->cntxt); } -ap_status_t ap_set_threadkeydata(void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_threadkey_t *threadkey) +apr_status_t apr_set_threadkeydata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey) { - return ap_set_userdata(data, key, cleanup, threadkey->cntxt); + return apr_set_userdata(data, key, cleanup, threadkey->cntxt); } -ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key) +apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -ap_status_t ap_put_os_threadkey(ap_threadkey_t **key, - ap_os_threadkey_t *thekey, ap_pool_t *cont) +apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (ap_threadkey_t *)ap_palloc(cont, sizeof(ap_threadkey_t)); + (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); (*key)->cntxt = cont; } (*key)->key = *thekey; diff --git a/threadproc/win32/threadproc.h b/threadproc/win32/threadproc.h index 936747783d9..24a140bb1e1 100644 --- a/threadproc/win32/threadproc.h +++ b/threadproc/win32/threadproc.h @@ -61,35 +61,35 @@ #define SHELL_PATH "cmd.exe" -struct ap_thread_t { - ap_pool_t *cntxt; +struct apr_thread_t { + apr_pool_t *cntxt; HANDLE td; - ap_int32_t cancel; - ap_int32_t cancel_how; + apr_int32_t cancel; + apr_int32_t cancel_how; }; -struct ap_threadattr_t { - ap_pool_t *cntxt; - ap_int32_t detach; +struct apr_threadattr_t { + apr_pool_t *cntxt; + apr_int32_t detach; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; DWORD key; }; -struct ap_procattr_t { - ap_pool_t *cntxt; +struct apr_procattr_t { + apr_pool_t *cntxt; STARTUPINFO si; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; }; #endif /* ! THREAD_PROC_H */ diff --git a/time/unix/time.c b/time/unix/time.c index d3a701ab5f5..60a29c18973 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -76,14 +76,14 @@ /* End System Headers */ -ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input) +apr_status_t apr_ansi_time_to_ap_time(apr_time_t *result, time_t input) { - *result = (ap_time_t)input * AP_USEC_PER_SEC; + *result = (apr_time_t)input * AP_USEC_PER_SEC; return APR_SUCCESS; } -ap_time_t ap_now(void) +apr_time_t apr_now(void) { struct timeval tv; gettimeofday(&tv, NULL); @@ -105,7 +105,7 @@ static void tm_to_exp(ap_exploded_time_t *xt, struct tm *tm) } -ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input) +apr_status_t apr_explode_gmt(ap_exploded_time_t *result, apr_time_t input) { time_t t = input / AP_USEC_PER_SEC; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) @@ -124,7 +124,7 @@ ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input) return APR_SUCCESS; } -ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input) +apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input) { #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) time_t t = input / AP_USEC_PER_SEC; @@ -181,7 +181,7 @@ ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input) } -ap_status_t ap_implode_time(ap_time_t *t, ap_exploded_time_t *xt) +apr_status_t apr_implode_time(apr_time_t *t, ap_exploded_time_t *xt) { int year; time_t days; @@ -215,14 +215,14 @@ ap_status_t ap_implode_time(ap_time_t *t, ap_exploded_time_t *xt) return APR_SUCCESS; } -ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime) +apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime) { (*ostime)->tv_usec = *aprtime % AP_USEC_PER_SEC; (*ostime)->tv_sec = *aprtime / AP_USEC_PER_SEC; return APR_SUCCESS; } -ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *aprtime) +apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, ap_exploded_time_t *aprtime) { (*ostime)->tm_sec = aprtime->tm_sec; (*ostime)->tm_min = aprtime->tm_min; @@ -236,15 +236,15 @@ ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *ap return APR_SUCCESS; } -ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime, - ap_pool_t *cont) +apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, + apr_pool_t *cont) { *aprtime = (*ostime)->tv_sec * AP_USEC_PER_SEC + (*ostime)->tv_usec; return APR_SUCCESS; } -ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, - ap_os_exp_time_t **ostime, ap_pool_t *cont) +apr_status_t apr_put_os_exp_time(ap_exploded_time_t *aprtime, + apr_os_exp_time_t **ostime, apr_pool_t *cont) { aprtime->tm_sec = (*ostime)->tm_sec; aprtime->tm_min = (*ostime)->tm_min; @@ -258,7 +258,7 @@ ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, return APR_SUCCESS; } -void ap_sleep(ap_interval_time_t t) +void apr_sleep(apr_interval_time_t t) { #ifdef OS2 DosSleep(t/1000); @@ -271,7 +271,7 @@ void ap_sleep(ap_interval_time_t t) } #ifdef OS2 -ap_status_t ap_os2_time_to_ap_time(ap_time_t *result, FDATE os2date, FTIME os2time) +apr_status_t ap_os2_time_to_ap_time(apr_time_t *result, FDATE os2date, FTIME os2time) { struct tm tmpdate; diff --git a/time/unix/timestr.c b/time/unix/timestr.c index e64766c66bf..22b342dcf09 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -77,13 +77,13 @@ APR_VAR_EXPORT const char ap_day_snames[7][4] = "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; -ap_status_t ap_rfc822_date(char *date_str, ap_time_t t) +apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) { ap_exploded_time_t xt; const char *s; int real_year; - ap_explode_gmt(&xt, t); + apr_explode_gmt(&xt, t); /* example: "Sat, 08 Jan 2000 18:31:41 GMT" */ /* 12345678901234567890123456789 */ @@ -125,7 +125,7 @@ ap_status_t ap_rfc822_date(char *date_str, ap_time_t t) return APR_SUCCESS; } -ap_status_t ap_ctime(char *date_str, ap_time_t t) +apr_status_t apr_ctime(char *date_str, apr_time_t t) { ap_exploded_time_t xt; const char *s; @@ -134,7 +134,7 @@ ap_status_t ap_ctime(char *date_str, ap_time_t t) /* example: "Wed Jun 30 21:49:08 1993" */ /* 123456789012345678901234 */ - ap_explode_localtime(&xt, t); + apr_explode_localtime(&xt, t); s = &ap_day_snames[xt.tm_wday][0]; *date_str++ = *s++; *date_str++ = *s++; @@ -167,7 +167,7 @@ ap_status_t ap_ctime(char *date_str, ap_time_t t) return APR_SUCCESS; } -ap_status_t ap_strftime(char *s, ap_size_t *retsize, ap_size_t max, +apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, ap_exploded_time_t *xt) { struct tm tm; diff --git a/time/win32/access.c b/time/win32/access.c index 88fbdbe3595..e38d7d575ce 100644 --- a/time/win32/access.c +++ b/time/win32/access.c @@ -57,7 +57,7 @@ #include "apr_general.h" #include "apr_lib.h" -ap_status_t ap_get_curtime(struct atime_t *time, ap_time_t *rv) +apr_status_t ap_get_curtime(struct atime_t *time, apr_time_t *rv) { if (time) { (*rv) = time->currtime; @@ -66,7 +66,7 @@ ap_status_t ap_get_curtime(struct atime_t *time, ap_time_t *rv) return APR_ENOTIME; } -ap_status_t ap_get_sec(struct atime_t *time, ap_int32_t *rv) +apr_status_t ap_get_sec(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wSecond; @@ -75,7 +75,7 @@ ap_status_t ap_get_sec(struct atime_t *time, ap_int32_t *rv) return APR_ENOTIME; } -ap_status_t ap_get_min(struct atime_t *time, ap_int32_t *rv) +apr_status_t ap_get_min(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wMinute; @@ -84,7 +84,7 @@ ap_status_t ap_get_min(struct atime_t *time, ap_int32_t *rv) return APR_ENOTIME; } -ap_status_t ap_get_hour(struct atime_t *time, ap_int32_t *rv) +apr_status_t ap_get_hour(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wHour; @@ -93,7 +93,7 @@ ap_status_t ap_get_hour(struct atime_t *time, ap_int32_t *rv) return APR_ENOTIME; } -ap_status_t ap_get_mday(struct atime_t *time, ap_int32_t *rv) +apr_status_t ap_get_mday(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wDay; @@ -102,7 +102,7 @@ ap_status_t ap_get_mday(struct atime_t *time, ap_int32_t *rv) return APR_ENOTIME; } -ap_status_t ap_get_mon(struct atime_t *time, ap_int32_t *rv) +apr_status_t ap_get_mon(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wMonth; @@ -111,7 +111,7 @@ ap_status_t ap_get_mon(struct atime_t *time, ap_int32_t *rv) return APR_ENOTIME; } -ap_status_t ap_get_year(struct atime_t *time, ap_int32_t *rv) +apr_status_t ap_get_year(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wYear; @@ -120,7 +120,7 @@ ap_status_t ap_get_year(struct atime_t *time, ap_int32_t *rv) return APR_ENOTIME; } -ap_status_t ap_get_wday(struct atime_t *time, ap_int32_t *rv) +apr_status_t ap_get_wday(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wDayOfWeek; @@ -129,13 +129,13 @@ ap_status_t ap_get_wday(struct atime_t *time, ap_int32_t *rv) return APR_ENOTIME; } -ap_status_t ap_set_sec(struct atime_t *time, ap_int32_t value) +apr_status_t ap_set_sec(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)ap_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -145,13 +145,13 @@ ap_status_t ap_set_sec(struct atime_t *time, ap_int32_t value) return APR_SUCCESS; } -ap_status_t ap_set_min(struct atime_t *time, ap_int32_t value) +apr_status_t ap_set_min(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)ap_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -161,13 +161,13 @@ ap_status_t ap_set_min(struct atime_t *time, ap_int32_t value) return APR_SUCCESS; } -ap_status_t ap_set_hour(struct atime_t *time, ap_int32_t value) +apr_status_t ap_set_hour(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)ap_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -177,13 +177,13 @@ ap_status_t ap_set_hour(struct atime_t *time, ap_int32_t value) return APR_SUCCESS; } -ap_status_t ap_set_mday(struct atime_t *time, ap_int32_t value) +apr_status_t ap_set_mday(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)ap_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -193,13 +193,13 @@ ap_status_t ap_set_mday(struct atime_t *time, ap_int32_t value) return APR_SUCCESS; } -ap_status_t ap_set_mon(struct atime_t *time, ap_int32_t value) +apr_status_t ap_set_mon(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)ap_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -209,13 +209,13 @@ ap_status_t ap_set_mon(struct atime_t *time, ap_int32_t value) return APR_SUCCESS; } -ap_status_t ap_set_year(struct atime_t *time, ap_int32_t value) +apr_status_t ap_set_year(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)ap_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -225,13 +225,13 @@ ap_status_t ap_set_year(struct atime_t *time, ap_int32_t value) return APR_SUCCESS; } -ap_status_t ap_set_wday(struct atime_t *time, ap_int32_t value) +apr_status_t ap_set_wday(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)ap_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { diff --git a/time/win32/atime.h b/time/win32/atime.h index cf5ab487386..d4a25731589 100644 --- a/time/win32/atime.h +++ b/time/win32/atime.h @@ -60,13 +60,13 @@ #include struct atime_t { - ap_pool_t *cntxt; - ap_time_t currtime; + apr_pool_t *cntxt; + apr_time_t currtime; SYSTEMTIME *explodedtime; }; -void FileTimeToAprTime(ap_time_t *atime, FILETIME *ft); -void AprTimeToFileTime(LPFILETIME pft, ap_time_t t); +void FileTimeToAprTime(apr_time_t *atime, FILETIME *ft); +void AprTimeToFileTime(LPFILETIME pft, apr_time_t t); #endif /* ! ATIME_H */ diff --git a/time/win32/time.c b/time/win32/time.c index ebe3addc03f..899a57a55e1 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -67,7 +67,7 @@ */ #define AP_DELTA_EPOCH_IN_USEC 11644473600000000; -void FileTimeToAprTime(ap_time_t *result, FILETIME *input) +void FileTimeToAprTime(apr_time_t *result, FILETIME *input) { /* Convert FILETIME one 64 bit number so we can work with it. */ *result = input->dwHighDateTime; @@ -77,7 +77,7 @@ void FileTimeToAprTime(ap_time_t *result, FILETIME *input) *result -= AP_DELTA_EPOCH_IN_USEC; /* Convert from Windows epoch to Unix epoch */ return; } -void AprTimeToFileTime(LPFILETIME pft, ap_time_t t) +void AprTimeToFileTime(LPFILETIME pft, apr_time_t t) { LONGLONG ll; t += AP_DELTA_EPOCH_IN_USEC; @@ -123,14 +123,14 @@ void SystemTimeToAprExpTime(ap_exploded_time_t *xt, SYSTEMTIME *tm) return; } -ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input) +apr_status_t apr_ansi_time_to_ap_time(apr_time_t *result, time_t input) { - *result = (ap_time_t) input * AP_USEC_PER_SEC; + *result = (apr_time_t) input * AP_USEC_PER_SEC; return APR_SUCCESS; } /* Return micro-seconds since the Unix epoch (jan. 1, 1970) UTC */ -ap_time_t ap_now(void) +apr_time_t apr_now(void) { LONGLONG aprtime = 0; FILETIME time; @@ -139,7 +139,7 @@ ap_time_t ap_now(void) return aprtime; } -ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input) +apr_status_t apr_explode_gmt(ap_exploded_time_t *result, apr_time_t input) { FILETIME ft; SYSTEMTIME st; @@ -149,7 +149,7 @@ ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input) return APR_SUCCESS; } -ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input) +apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input) { SYSTEMTIME st; FILETIME ft, localft; @@ -161,7 +161,7 @@ ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input) return APR_SUCCESS; } -ap_status_t ap_implode_time(ap_time_t *t, ap_exploded_time_t *xt) +apr_status_t apr_implode_time(apr_time_t *t, ap_exploded_time_t *xt) { int year; time_t days; @@ -195,14 +195,14 @@ ap_status_t ap_implode_time(ap_time_t *t, ap_exploded_time_t *xt) return APR_SUCCESS; } -ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime) +apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime) { - /* TODO: Consider not passing in pointer to ap_time_t (e.g., call by value) */ + /* TODO: Consider not passing in pointer to apr_time_t (e.g., call by value) */ AprTimeToFileTime(*ostime, *aprtime); return APR_SUCCESS; } -ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *aprexptime) +apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, ap_exploded_time_t *aprexptime) { (*ostime)->wYear = aprexptime->tm_year + 1900; (*ostime)->wMonth = aprexptime->tm_mon + 1; @@ -215,15 +215,15 @@ ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *ap return APR_SUCCESS; } -ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime, - ap_pool_t *cont) +apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, + apr_pool_t *cont) { FileTimeToAprTime(aprtime, *ostime); return APR_SUCCESS; } -ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, - ap_os_exp_time_t **ostime, ap_pool_t *cont) +apr_status_t apr_put_os_exp_time(ap_exploded_time_t *aprtime, + apr_os_exp_time_t **ostime, apr_pool_t *cont) { SystemTimeToAprExpTime(aprtime, *ostime); return APR_SUCCESS; diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 1c118b07eb9..df8254c551f 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -64,13 +64,13 @@ APR_VAR_EXPORT const char ap_day_snames[7][4] = "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; -ap_status_t ap_rfc822_date(char *date_str, ap_time_t t) +apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) { ap_exploded_time_t xt; const char *s; int real_year; - ap_explode_gmt(&xt, t); + apr_explode_gmt(&xt, t); /* example: "Sat, 08 Jan 2000 18:31:41 GMT" */ /* 12345678901234567890123456789 */ @@ -112,7 +112,7 @@ ap_status_t ap_rfc822_date(char *date_str, ap_time_t t) return APR_SUCCESS; } -ap_status_t ap_ctime(char *date_str, ap_time_t t) +apr_status_t apr_ctime(char *date_str, apr_time_t t) { ap_exploded_time_t xt; const char *s; @@ -121,7 +121,7 @@ ap_status_t ap_ctime(char *date_str, ap_time_t t) /* example: "Wed Jun 30 21:49:08 1993" */ /* 123456789012345678901234 */ - ap_explode_localtime(&xt, t); + apr_explode_localtime(&xt, t); s = &ap_day_snames[xt.tm_wday][0]; *date_str++ = *s++; *date_str++ = *s++; @@ -154,7 +154,7 @@ ap_status_t ap_ctime(char *date_str, ap_time_t t) return APR_SUCCESS; } -ap_status_t ap_strftime(char *s, ap_size_t *retsize, ap_size_t max, +apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, ap_exploded_time_t *xt) { struct tm tm; From b85c6ad6066c3ae84202ac3a137bffac5813e4e5 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 2 Aug 2000 05:33:08 +0000 Subject: [PATCH 0496/7878] add apr_compat.h and note changes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60471 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_compat.h | 61 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 include/apr_compat.h diff --git a/include/apr_compat.h b/include/apr_compat.h new file mode 100644 index 00000000000..31a99e466aa --- /dev/null +++ b/include/apr_compat.h @@ -0,0 +1,61 @@ +#ifndef APR_COMPAT_H +#define APR_COMPAT_H + +/* redefine 1.3.x symbols to those that now live in libapr */ + +#define ap_MD5Encode apr_MD5Encode +#define ap_MD5Final apr_MD5Final +#define ap_MD5Init apr_MD5Init +#define ap_MD5Update apr_MD5Update +#define ap_append_arrays apr_append_arrays +#define ap_array_cat apr_array_cat +#define ap_array_pstrcat apr_array_pstrcat +#define ap_bytes_in_free_blocks apr_bytes_in_free_blocks +#define ap_bytes_in_pool apr_bytes_in_pool +#define ap_cleanup_for_exec apr_cleanup_for_exec +#define ap_clear_pool apr_clear_pool +#define ap_clear_table apr_clear_table +#define ap_copy_array apr_copy_array +#define ap_copy_array_hdr apr_copy_array_hdr +#define ap_copy_table apr_copy_table +#define ap_cpystrn apr_cpystrn +#define ap_destroy_pool apr_destroy_pool +#define ap_fnmatch apr_fnmatch +#define ap_init_alloc apr_init_alloc +#define ap_is_fnmatch apr_is_fnmatch +#define ap_kill_cleanup apr_kill_cleanup +#define ap_make_array apr_make_array +#define ap_make_sub_pool apr_make_sub_pool +#define ap_make_table apr_make_table +#define ap_note_subprocess apr_note_subprocess +#define ap_null_cleanup apr_null_cleanup +#define ap_overlap_tables apr_overlap_tables +#define ap_overlay_tables apr_overlay_tables +#define ap_palloc apr_palloc +#define ap_pcalloc apr_pcalloc +#define ap_psprintf apr_psprintf +#define ap_pstrcat apr_pstrcat +#define ap_pstrdup apr_pstrdup +#define ap_pstrndup apr_pstrndup +#define ap_push_array apr_push_array +#define ap_pvsprintf apr_pvsprintf +#define ap_register_cleanup apr_register_cleanup +#define ap_register_other_child apr_register_other_child +#define ap_run_cleanup apr_run_cleanup +#define ap_signal apr_signal +#define ap_snprintf apr_snprintf +#define ap_table_add apr_table_add +#define ap_table_addn apr_table_addn +#define ap_table_do apr_table_do +#define ap_table_get apr_table_get +#define ap_table_merge apr_table_merge +#define ap_table_mergen apr_table_mergen +#define ap_table_set apr_table_set +#define ap_table_setn apr_table_setn +#define ap_table_unset apr_table_unset +#define ap_unregister_other_child apr_unregister_other_child +#define ap_validate_password apr_validate_password +#define ap_vformatter apr_vformatter +#define ap_vsnprintf apr_vsnprintf + +#endif /* APR_COMPAT_H */ From 499c5a546a13d19e3aae86e56c0fb0872842cd2d Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 2 Aug 2000 05:51:39 +0000 Subject: [PATCH 0497/7878] first apr_ pass only touched .[ch] files git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60472 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 +++++----- include/apr.h.in | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/configure.in b/configure.in index 863c65fa97a..4661d192992 100644 --- a/configure.in +++ b/configure.in @@ -355,17 +355,17 @@ fi if test "$ac_cv_type_off_t" = "yes"; then off_t_value="off_t" else - off_t_value="ap_int32_t" + off_t_value="apr_int32_t" fi if test "$ac_cv_type_size_t" = "yes"; then size_t_value="size_t" else - size_t_value="ap_int32_t" + size_t_value="apr_int32_t" fi if test "$ac_cv_type_ssize_t" = "yes"; then ssize_t_value="ssize_t" else - ssize_t_value="ap_int32_t" + ssize_t_value="apr_int32_t" fi AC_CHECK_SIZEOF_EXTENDED([#include ], ssize_t, 8) @@ -390,8 +390,8 @@ else off_t_fmt='#error Can not determine the proper size for off_t' fi -# basically, we have tried to figure out the sizes of ap_ssize_t and -# ap_off_t, but we don't always get it right. If you find that we +# basically, we have tried to figure out the sizes of apr_ssize_t and +# apr_off_t, but we don't always get it right. If you find that we # don't get it right for your platform, you can override our decision # below. case "$OS" in diff --git a/include/apr.h.in b/include/apr.h.in index c91c82febdd..8f903fd2a2c 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -99,18 +99,18 @@ /* Typedefs that APR needs. */ -typedef @short_value@ ap_int16_t; -typedef unsigned @short_value@ ap_uint16_t; +typedef @short_value@ apr_int16_t; +typedef unsigned @short_value@ apr_uint16_t; -typedef @int_value@ ap_int32_t; -typedef unsigned @int_value@ ap_uint32_t; +typedef @int_value@ apr_int32_t; +typedef unsigned @int_value@ apr_uint32_t; -typedef @long_value@ ap_int64_t; -typedef unsigned @long_value@ ap_uint64_t; +typedef @long_value@ apr_int64_t; +typedef unsigned @long_value@ apr_uint64_t; -typedef @size_t_value@ ap_size_t; -typedef @ssize_t_value@ ap_ssize_t; -typedef @off_t_value@ ap_off_t; +typedef @size_t_value@ apr_size_t; +typedef @ssize_t_value@ apr_ssize_t; +typedef @off_t_value@ apr_off_t; /* Definitions that APR programs need to work properly. */ @@ -136,20 +136,20 @@ typedef @off_t_value@ ap_off_t; /* Local machine definition for console and log output. */ #define APR_EOL_STR "@eolstr@" -/* Define ap_signal and related necessary definitions. +/* Define apr_signal and related necessary definitions. */ /* We are checking for HAVE_SIGACTION, but autoconf is filling this in * for us automatically. */ #if @have_sigaction@ && !defined(NO_USE_SIGACTION) typedef void Sigfunc(int); -Sigfunc *ap_signal(int signo, Sigfunc * func); +Sigfunc *apr_signal(int signo, Sigfunc * func); #if defined(SIG_ING) && !defined(SIG_ERR) #define SIG_ERR ((Sigfunc *)-1) #endif #else -#define ap_signal(a,b) signal(a,b) +#define apr_signal(a,b) signal(a,b) #endif #ifdef APR_HAVE_SYS_WAIT_H From 8e7599a3054eae2823da2157c4b38bd5bbdec97e Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 4 Aug 2000 02:42:32 +0000 Subject: [PATCH 0498/7878] Win32: Fix problem with timeout units on TransmitFile. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60473 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 4 ++-- network_io/win32/sockopt.c | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index f26c724c197..eedb0de8a50 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -239,10 +239,10 @@ apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, if (lasterror == ERROR_IO_PENDING) { #ifdef WAIT_FOR_EVENT rv = WaitForSingleObject(overlapped.hEvent, - sock->timeout >= 0 ? sock->timeout / 1000 : INFINITE); + sock->timeout >= 0 ? sock->timeout : INFINITE); #else rv = WaitForSingleObject((HANDLE) sock->sock, - sock->timeout >= 0 ? sock->timeout / 1000 : INFINITE); + sock->timeout >= 0 ? sock->timeout : INFINITE); #endif if (rv == WAIT_OBJECT_0) lasterror = APR_SUCCESS; diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 2114ce92822..99d7fd093e5 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -92,8 +92,10 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o if (on <= 0) new_timeout = on; else - new_timeout = on/1000; /* Windows needs timeout in mSeconds */ - + /* Convert from APR units (microseconds) to windows units + * (milliseconds) */ + new_timeout = on/1000; + if (new_timeout == 0) { /* Set the socket non-blocking if it was previously blocking */ if (sock->timeout != 0) { @@ -170,9 +172,9 @@ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t * { switch (opt) { case APR_SO_TIMEOUT: - /* Do we want to store sock->timeout in APR units or windows units? */ - *on = sock->timeout * 1000; /* Convert from milliseconds (windows units) to microseconds - * (APR units) */ + /* Convert from milliseconds (windows units) to microseconds + * (APR units) */ + *on = sock->timeout * 1000; break; case APR_SO_DISCONNECTED: *on = sock->disconnected; From e6feed187b38d57621af5f5e327738b1420dfac3 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 4 Aug 2000 02:48:38 +0000 Subject: [PATCH 0499/7878] Fix Win32 compile break caused by ap_ to apr_ migration. Change ap_sendfile to apr_sendfile. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60474 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 464 ++++++++++++++++++------------------ include/apr.hw | 20 +- libapr.def | 464 ++++++++++++++++++------------------ network_io/unix/sendrecv.c | 16 +- network_io/win32/sendrecv.c | 6 +- 5 files changed, 485 insertions(+), 485 deletions(-) diff --git a/aprlib.def b/aprlib.def index 5e64ca2e58f..dbf1cdb1d2b 100644 --- a/aprlib.def +++ b/aprlib.def @@ -5,248 +5,248 @@ DESCRIPTION '' EXPORTS ; Add new API calls to the end of this list. - ap_opendir @1 - ap_closedir @2 - ap_readdir @3 - ap_rewinddir @4 - ap_make_dir @5 - ap_remove_dir @6 - ap_dir_entry_size @7 - ap_dir_entry_mtime @8 - ap_dir_entry_ftype @9 - ap_get_dir_filename @10 -; ap_get_filename @11 - ap_stat @11 -; ap_get_filesize @12 -; ap_get_fileatime @13 -; ap_get_filectime @14 -; ap_make_iov @15 - ap_dupfile @16 - ap_getfileinfo @17 - ap_open @18 - ap_close @19 - ap_remove_file @20 - ap_create_pipe @21 - ap_read @22 - ap_write @23 - ap_seek @24 - ap_get_filedata @25 - ap_set_filedata @26 - ap_get_os_file @27 - ap_put_os_file @28 - ap_get_os_dir @29 - ap_putc @30 - ap_getc @31 - ap_puts @32 - ap_fgets @33 - ap_flush @34 - ap_fprintf @35 - ap_eof @36 -; ap_get_filetype @37 - ap_writev @38 + apr_opendir @1 + apr_closedir @2 + apr_readdir @3 + apr_rewinddir @4 + apr_make_dir @5 + apr_remove_dir @6 + apr_dir_entry_size @7 + apr_dir_entry_mtime @8 + apr_dir_entry_ftype @9 + apr_get_dir_filename @10 +; apr_get_filename @11 + apr_stat @11 +; apr_get_filesize @12 +; apr_get_fileatime @13 +; apr_get_filectime @14 +; apr_make_iov @15 + apr_dupfile @16 + apr_getfileinfo @17 + apr_open @18 + apr_close @19 + apr_remove_file @20 + apr_create_pipe @21 + apr_read @22 + apr_write @23 + apr_seek @24 + apr_get_filedata @25 + apr_set_filedata @26 + apr_get_os_file @27 + apr_put_os_file @28 + apr_get_os_dir @29 + apr_putc @30 + apr_getc @31 + apr_puts @32 + apr_fgets @33 + apr_flush @34 + apr_fprintf @35 + apr_eof @36 +; apr_get_filetype @37 + apr_writev @38 ; locks - ap_create_lock @39 - ap_lock @40 - ap_unlock @41 - ap_destroy_lock @42 - ap_child_init_lock @43 - ap_get_lockdata @44 - ap_set_lockdata @45 - ap_get_os_lock @46 - ap_create_tcp_socket @47 - ap_shutdown @48 - ap_close_socket @49 - ap_bind @50 - ap_listen @51 - ap_accept @52 - ap_connect @53 - ap_get_remote_hostname @54 - ap_gethostname @55 - ap_send @56 - ap_recv @57 - ap_setsocketopt @58 - ap_sendv @59 - ap_sendfile @60 - ap_setup_poll @61 - ap_poll @62 - ap_add_poll_socket @63 - ap_get_revents @64 - ap_get_socketdata @65 - ap_set_socketdata @66 - ap_get_polldata @67 - ap_set_polldata @68 - ap_put_os_sock @69 - ap_get_os_sock @70 - ap_remove_poll_socket @71 - ap_clear_poll_sockets @72 - ap_getsocketopt @73 -; ap_getipaddr @74 -; ap_create_signal @75 -; ap_setup_signal @76 + apr_create_lock @39 + apr_lock @40 + apr_unlock @41 + apr_destroy_lock @42 + apr_child_init_lock @43 + apr_get_lockdata @44 + apr_set_lockdata @45 + apr_get_os_lock @46 + apr_create_tcp_socket @47 + apr_shutdown @48 + apr_close_socket @49 + apr_bind @50 + apr_listen @51 + apr_accept @52 + apr_connect @53 + apr_get_remote_hostname @54 + apr_gethostname @55 + apr_send @56 + apr_recv @57 + apr_setsocketopt @58 + apr_sendv @59 + apr_sendfile @60 + apr_setup_poll @61 + apr_poll @62 + apr_add_poll_socket @63 + apr_get_revents @64 + apr_get_socketdata @65 + apr_set_socketdata @66 + apr_get_polldata @67 + apr_set_polldata @68 + apr_put_os_sock @69 + apr_get_os_sock @70 + apr_remove_poll_socket @71 + apr_clear_poll_sockets @72 + apr_getsocketopt @73 +; apr_getipaddr @74 +; apr_create_signal @75 +; apr_setup_signal @76 ; SignalHandling @77 -; ap_send_signal @78 +; apr_send_signal @78 ; thread_ready @79 - ap_createprocattr_init @80 - ap_setprocattr_io @81 - ap_setprocattr_dir @82 - ap_setprocattr_cmdtype @83 - ap_setprocattr_detach @84 - ap_create_process @85 -; ap_get_childin @86 -; ap_get_childout @87 -; ap_get_childerr @88 - ap_wait_proc @89 - ap_kill @90 - ap_create_threadattr @91 - ap_setthreadattr_detach @92 - ap_getthreadattr_detach @93 - ap_create_thread @94 - ap_thread_exit @95 - ap_thread_join @96 - ap_thread_detach @97 -; ap_cancel_thread @98 - ap_create_thread_private @99 - ap_get_thread_private @100 - ap_set_thread_private @101 - ap_delete_thread_private @102 - ap_get_threaddata @103 - ap_set_threaddata @104 - ap_get_threadkeydata @105 - ap_set_threadkeydata @106 -; ap_get_procdata @107 -; ap_set_procdata @108 -; ap_get_os_proc @109 - ap_get_os_thread @110 - ap_get_os_threadkey @111 + apr_createprocattr_init @80 + apr_setprocattr_io @81 + apr_setprocattr_dir @82 + apr_setprocattr_cmdtype @83 + apr_setprocattr_detach @84 + apr_create_process @85 +; apr_get_childin @86 +; apr_get_childout @87 +; apr_get_childerr @88 + apr_wait_proc @89 + apr_kill @90 + apr_create_threadattr @91 + apr_setthreadattr_detach @92 + apr_getthreadattr_detach @93 + apr_create_thread @94 + apr_thread_exit @95 + apr_thread_join @96 + apr_thread_detach @97 +; apr_cancel_thread @98 + apr_create_thread_private @99 + apr_get_thread_private @100 + apr_set_thread_private @101 + apr_delete_thread_private @102 + apr_get_threaddata @103 + apr_set_threaddata @104 + apr_get_threadkeydata @105 + apr_set_threadkeydata @106 +; apr_get_procdata @107 +; apr_set_procdata @108 +; apr_get_os_proc @109 + apr_get_os_thread @110 + apr_get_os_threadkey @111 ap_os_systemcase_filename @112 canonical_filename @113 - ap_create_pool @114 - ap_clear_pool @115 - ap_destroy_pool @116 -; ap_get_oslevel @117 - ap_get_userdata @118 - ap_set_userdata @119 - ap_initialize @120 - ap_getopt @121 + apr_create_pool @114 + apr_clear_pool @115 + apr_destroy_pool @116 +; apr_get_oslevel @117 + apr_get_userdata @118 + apr_set_userdata @119 + apr_initialize @120 + apr_getopt @121 ap_opterr @122 DATA ap_optind @123 DATA ap_optopt @124 DATA ap_optreset @125 DATA ap_optarg @126 DATA -; ap_make_time @127 - ap_ansi_time_to_ap_time @127 -; ap_current_time @128 - ap_now @128 -; ap_explode_time @129 - ap_explode_gmt @129 -; ap_implode_time @130 - ap_explode_localtime @130 -; ap_get_curtime @131 - ap_implode_time @131 -; ap_get_sec @132 - ap_get_os_imp_time @132 -; ap_get_min @133 - ap_get_os_exp_time @133 -; ap_get_hour @134 - ap_put_os_imp_time @134 -; ap_get_mday @135 - ap_put_os_exp_time @135 -; ap_get_mon @136 - ap_ctime @136 -; ap_get_year @137 - ap_rfc822_date @137 -; ap_get_wday @138 - ap_strftime @138 -; ap_set_sec @139 -; ap_set_min @140 -; ap_set_hour @141 -; ap_set_mday @142 -; ap_set_mon @143 -; ap_set_year @144 -; ap_set_wday @145 -; ap_get_timedata @146 -; ap_set_timedata @147 -; ap_get_os_time @148 -; ap_timediff @149 - ap_MD5Final @150 - ap_MD5Init @151 - ap_MD5Update @152 - ap_cpystrn @153 - ap_register_cleanup @154 - ap_kill_cleanup @155 - ap_fnmatch @156 - ap_is_fnmatch @157 - ap_MD5Encode @158 - ap_validate_password @159 - ap_make_sub_pool @160 - ap_init_alloc @161 -; ap_clear_pool @162 -; ap_destroy_pool @163 - ap_bytes_in_pool @164 - ap_bytes_in_free_blocks @165 - ap_palloc @166 - ap_pcalloc @167 - ap_pstrdup @168 - ap_pstrndup @169 - ap_pstrcat @170 - ap_pvsprintf @171 - ap_psprintf @172 - ap_make_array @173 - ap_push_array @174 - ap_array_cat @175 - ap_copy_array @176 - ap_copy_array_hdr @177 - ap_append_arrays @178 - ap_array_pstrcat @179 - ap_make_table @180 - ap_copy_table @181 - ap_clear_table @182 - ap_table_get @183 - ap_table_set @184 - ap_table_setn @185 - ap_table_unset @186 - ap_table_merge @187 - ap_table_mergen @188 - ap_table_add @189 - ap_table_addn @190 - ap_overlay_tables @191 - ap_table_do @192 - ap_overlap_tables @193 - ap_run_cleanup @194 - ap_cleanup_for_exec @195 - ap_null_cleanup @196 - ap_note_subprocess @197 +; apr_make_time @127 + apr_ansi_time_to_ap_time @127 +; apr_current_time @128 + apr_now @128 +; apr_explode_time @129 + apr_explode_gmt @129 +; apr_implode_time @130 + apr_explode_localtime @130 +; apr_get_curtime @131 + apr_implode_time @131 +; apr_get_sec @132 + apr_get_os_imp_time @132 +; apr_get_min @133 + apr_get_os_exp_time @133 +; apr_get_hour @134 + apr_put_os_imp_time @134 +; apr_get_mday @135 + apr_put_os_exp_time @135 +; apr_get_mon @136 + apr_ctime @136 +; apr_get_year @137 + apr_rfc822_date @137 +; apr_get_wday @138 + apr_strftime @138 +; apr_set_sec @139 +; apr_set_min @140 +; apr_set_hour @141 +; apr_set_mday @142 +; apr_set_mon @143 +; apr_set_year @144 +; apr_set_wday @145 +; apr_get_timedata @146 +; apr_set_timedata @147 +; apr_get_os_time @148 +; apr_timediff @149 + apr_MD5Final @150 + apr_MD5Init @151 + apr_MD5Update @152 + apr_cpystrn @153 + apr_register_cleanup @154 + apr_kill_cleanup @155 + apr_fnmatch @156 + apr_is_fnmatch @157 + apr_MD5Encode @158 + apr_validate_password @159 + apr_make_sub_pool @160 + apr_init_alloc @161 +; apr_clear_pool @162 +; apr_destroy_pool @163 + apr_bytes_in_pool @164 + apr_bytes_in_free_blocks @165 + apr_palloc @166 + apr_pcalloc @167 + apr_pstrdup @168 + apr_pstrndup @169 + apr_pstrcat @170 + apr_pvsprintf @171 + apr_psprintf @172 + apr_make_array @173 + apr_push_array @174 + apr_array_cat @175 + apr_copy_array @176 + apr_copy_array_hdr @177 + apr_append_arrays @178 + apr_array_pstrcat @179 + apr_make_table @180 + apr_copy_table @181 + apr_clear_table @182 + apr_table_get @183 + apr_table_set @184 + apr_table_setn @185 + apr_table_unset @186 + apr_table_merge @187 + apr_table_mergen @188 + apr_table_add @189 + apr_table_addn @190 + apr_overlay_tables @191 + apr_table_do @192 + apr_overlap_tables @193 + apr_run_cleanup @194 + apr_cleanup_for_exec @195 + apr_null_cleanup @196 + apr_note_subprocess @197 ; - ap_vformatter @199 - ap_snprintf @200 - ap_vsnprintf @201 - ap_getpass @202 - ap_ungetc @203 - ap_tokenize_to_argv @204 - ap_filename_of_pathname @205 - ap_get_remote_name @206 - ap_get_local_name @207 - ap_get_local_ipaddr @208 - ap_set_local_ipaddr @209 - ap_get_remote_ipaddr @210 - ap_set_remote_ipaddr @211 - ap_get_local_port @212 - ap_set_local_port @213 - ap_get_remote_port @214 - ap_set_remote_port @215 - ap_open_stderr @216 - ap_set_pipe_timeout @217 - ap_terminate @218 - ap_dso_load @219 - ap_dso_unload @220 - ap_dso_sym @221 -; ap_dso_init @222 - ap_collapse_spaces @223 + apr_vformatter @199 + apr_snprintf @200 + apr_vsnprintf @201 + apr_getpass @202 + apr_ungetc @203 + apr_tokenize_to_argv @204 + apr_filename_of_pathname @205 + apr_get_remote_name @206 + apr_get_local_name @207 + apr_get_local_ipaddr @208 + apr_set_local_ipaddr @209 + apr_get_remote_ipaddr @210 + apr_set_remote_ipaddr @211 + apr_get_local_port @212 + apr_set_local_port @213 + apr_get_remote_port @214 + apr_set_remote_port @215 + apr_open_stderr @216 + apr_set_pipe_timeout @217 + apr_terminate @218 + apr_dso_load @219 + apr_dso_unload @220 + apr_dso_sym @221 +; apr_dso_init @222 + apr_collapse_spaces @223 ap_month_snames @224 ap_day_snames @225 - ap_canonical_error @226 - ap_strerror @227 - ap_generate_random_bytes @228 - ap_strnatcmp @229 - ap_strnatcasecmp @230 - ap_dso_error @231 + apr_canonical_error @226 + apr_strerror @227 + apr_generate_random_bytes @228 + apr_strnatcmp @229 + apr_strnatcasecmp @230 + apr_dso_error @231 diff --git a/include/apr.hw b/include/apr.hw index 4bdf2812348..1f6f31843b3 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -154,18 +154,18 @@ /* Typedefs that APR needs. */ -typedef short ap_int16_t; -typedef unsigned short ap_uint16_t; +typedef short apr_int16_t; +typedef unsigned short apr_uint16_t; -typedef int ap_int32_t; -typedef unsigned int ap_uint32_t; +typedef int apr_int32_t; +typedef unsigned int apr_uint32_t; -typedef __int64 ap_int64_t; -typedef unsigned __int64 ap_uint64_t; +typedef __int64 apr_int64_t; +typedef unsigned __int64 apr_uint64_t; -typedef int ap_size_t; -typedef int ap_ssize_t; -typedef _off_t ap_off_t; +typedef int apr_size_t; +typedef int apr_ssize_t; +typedef _off_t apr_off_t; typedef int pid_t; typedef int uid_t; typedef int gid_t; @@ -197,7 +197,7 @@ typedef int gid_t; #define APR_VAR_IMPORT extern __declspec(dllimport) #endif -#define ap_signal(a,b) signal(a,b) +#define apr_signal(a,b) signal(a,b) typedef int ap_wait_t; diff --git a/libapr.def b/libapr.def index 5e64ca2e58f..dbf1cdb1d2b 100644 --- a/libapr.def +++ b/libapr.def @@ -5,248 +5,248 @@ DESCRIPTION '' EXPORTS ; Add new API calls to the end of this list. - ap_opendir @1 - ap_closedir @2 - ap_readdir @3 - ap_rewinddir @4 - ap_make_dir @5 - ap_remove_dir @6 - ap_dir_entry_size @7 - ap_dir_entry_mtime @8 - ap_dir_entry_ftype @9 - ap_get_dir_filename @10 -; ap_get_filename @11 - ap_stat @11 -; ap_get_filesize @12 -; ap_get_fileatime @13 -; ap_get_filectime @14 -; ap_make_iov @15 - ap_dupfile @16 - ap_getfileinfo @17 - ap_open @18 - ap_close @19 - ap_remove_file @20 - ap_create_pipe @21 - ap_read @22 - ap_write @23 - ap_seek @24 - ap_get_filedata @25 - ap_set_filedata @26 - ap_get_os_file @27 - ap_put_os_file @28 - ap_get_os_dir @29 - ap_putc @30 - ap_getc @31 - ap_puts @32 - ap_fgets @33 - ap_flush @34 - ap_fprintf @35 - ap_eof @36 -; ap_get_filetype @37 - ap_writev @38 + apr_opendir @1 + apr_closedir @2 + apr_readdir @3 + apr_rewinddir @4 + apr_make_dir @5 + apr_remove_dir @6 + apr_dir_entry_size @7 + apr_dir_entry_mtime @8 + apr_dir_entry_ftype @9 + apr_get_dir_filename @10 +; apr_get_filename @11 + apr_stat @11 +; apr_get_filesize @12 +; apr_get_fileatime @13 +; apr_get_filectime @14 +; apr_make_iov @15 + apr_dupfile @16 + apr_getfileinfo @17 + apr_open @18 + apr_close @19 + apr_remove_file @20 + apr_create_pipe @21 + apr_read @22 + apr_write @23 + apr_seek @24 + apr_get_filedata @25 + apr_set_filedata @26 + apr_get_os_file @27 + apr_put_os_file @28 + apr_get_os_dir @29 + apr_putc @30 + apr_getc @31 + apr_puts @32 + apr_fgets @33 + apr_flush @34 + apr_fprintf @35 + apr_eof @36 +; apr_get_filetype @37 + apr_writev @38 ; locks - ap_create_lock @39 - ap_lock @40 - ap_unlock @41 - ap_destroy_lock @42 - ap_child_init_lock @43 - ap_get_lockdata @44 - ap_set_lockdata @45 - ap_get_os_lock @46 - ap_create_tcp_socket @47 - ap_shutdown @48 - ap_close_socket @49 - ap_bind @50 - ap_listen @51 - ap_accept @52 - ap_connect @53 - ap_get_remote_hostname @54 - ap_gethostname @55 - ap_send @56 - ap_recv @57 - ap_setsocketopt @58 - ap_sendv @59 - ap_sendfile @60 - ap_setup_poll @61 - ap_poll @62 - ap_add_poll_socket @63 - ap_get_revents @64 - ap_get_socketdata @65 - ap_set_socketdata @66 - ap_get_polldata @67 - ap_set_polldata @68 - ap_put_os_sock @69 - ap_get_os_sock @70 - ap_remove_poll_socket @71 - ap_clear_poll_sockets @72 - ap_getsocketopt @73 -; ap_getipaddr @74 -; ap_create_signal @75 -; ap_setup_signal @76 + apr_create_lock @39 + apr_lock @40 + apr_unlock @41 + apr_destroy_lock @42 + apr_child_init_lock @43 + apr_get_lockdata @44 + apr_set_lockdata @45 + apr_get_os_lock @46 + apr_create_tcp_socket @47 + apr_shutdown @48 + apr_close_socket @49 + apr_bind @50 + apr_listen @51 + apr_accept @52 + apr_connect @53 + apr_get_remote_hostname @54 + apr_gethostname @55 + apr_send @56 + apr_recv @57 + apr_setsocketopt @58 + apr_sendv @59 + apr_sendfile @60 + apr_setup_poll @61 + apr_poll @62 + apr_add_poll_socket @63 + apr_get_revents @64 + apr_get_socketdata @65 + apr_set_socketdata @66 + apr_get_polldata @67 + apr_set_polldata @68 + apr_put_os_sock @69 + apr_get_os_sock @70 + apr_remove_poll_socket @71 + apr_clear_poll_sockets @72 + apr_getsocketopt @73 +; apr_getipaddr @74 +; apr_create_signal @75 +; apr_setup_signal @76 ; SignalHandling @77 -; ap_send_signal @78 +; apr_send_signal @78 ; thread_ready @79 - ap_createprocattr_init @80 - ap_setprocattr_io @81 - ap_setprocattr_dir @82 - ap_setprocattr_cmdtype @83 - ap_setprocattr_detach @84 - ap_create_process @85 -; ap_get_childin @86 -; ap_get_childout @87 -; ap_get_childerr @88 - ap_wait_proc @89 - ap_kill @90 - ap_create_threadattr @91 - ap_setthreadattr_detach @92 - ap_getthreadattr_detach @93 - ap_create_thread @94 - ap_thread_exit @95 - ap_thread_join @96 - ap_thread_detach @97 -; ap_cancel_thread @98 - ap_create_thread_private @99 - ap_get_thread_private @100 - ap_set_thread_private @101 - ap_delete_thread_private @102 - ap_get_threaddata @103 - ap_set_threaddata @104 - ap_get_threadkeydata @105 - ap_set_threadkeydata @106 -; ap_get_procdata @107 -; ap_set_procdata @108 -; ap_get_os_proc @109 - ap_get_os_thread @110 - ap_get_os_threadkey @111 + apr_createprocattr_init @80 + apr_setprocattr_io @81 + apr_setprocattr_dir @82 + apr_setprocattr_cmdtype @83 + apr_setprocattr_detach @84 + apr_create_process @85 +; apr_get_childin @86 +; apr_get_childout @87 +; apr_get_childerr @88 + apr_wait_proc @89 + apr_kill @90 + apr_create_threadattr @91 + apr_setthreadattr_detach @92 + apr_getthreadattr_detach @93 + apr_create_thread @94 + apr_thread_exit @95 + apr_thread_join @96 + apr_thread_detach @97 +; apr_cancel_thread @98 + apr_create_thread_private @99 + apr_get_thread_private @100 + apr_set_thread_private @101 + apr_delete_thread_private @102 + apr_get_threaddata @103 + apr_set_threaddata @104 + apr_get_threadkeydata @105 + apr_set_threadkeydata @106 +; apr_get_procdata @107 +; apr_set_procdata @108 +; apr_get_os_proc @109 + apr_get_os_thread @110 + apr_get_os_threadkey @111 ap_os_systemcase_filename @112 canonical_filename @113 - ap_create_pool @114 - ap_clear_pool @115 - ap_destroy_pool @116 -; ap_get_oslevel @117 - ap_get_userdata @118 - ap_set_userdata @119 - ap_initialize @120 - ap_getopt @121 + apr_create_pool @114 + apr_clear_pool @115 + apr_destroy_pool @116 +; apr_get_oslevel @117 + apr_get_userdata @118 + apr_set_userdata @119 + apr_initialize @120 + apr_getopt @121 ap_opterr @122 DATA ap_optind @123 DATA ap_optopt @124 DATA ap_optreset @125 DATA ap_optarg @126 DATA -; ap_make_time @127 - ap_ansi_time_to_ap_time @127 -; ap_current_time @128 - ap_now @128 -; ap_explode_time @129 - ap_explode_gmt @129 -; ap_implode_time @130 - ap_explode_localtime @130 -; ap_get_curtime @131 - ap_implode_time @131 -; ap_get_sec @132 - ap_get_os_imp_time @132 -; ap_get_min @133 - ap_get_os_exp_time @133 -; ap_get_hour @134 - ap_put_os_imp_time @134 -; ap_get_mday @135 - ap_put_os_exp_time @135 -; ap_get_mon @136 - ap_ctime @136 -; ap_get_year @137 - ap_rfc822_date @137 -; ap_get_wday @138 - ap_strftime @138 -; ap_set_sec @139 -; ap_set_min @140 -; ap_set_hour @141 -; ap_set_mday @142 -; ap_set_mon @143 -; ap_set_year @144 -; ap_set_wday @145 -; ap_get_timedata @146 -; ap_set_timedata @147 -; ap_get_os_time @148 -; ap_timediff @149 - ap_MD5Final @150 - ap_MD5Init @151 - ap_MD5Update @152 - ap_cpystrn @153 - ap_register_cleanup @154 - ap_kill_cleanup @155 - ap_fnmatch @156 - ap_is_fnmatch @157 - ap_MD5Encode @158 - ap_validate_password @159 - ap_make_sub_pool @160 - ap_init_alloc @161 -; ap_clear_pool @162 -; ap_destroy_pool @163 - ap_bytes_in_pool @164 - ap_bytes_in_free_blocks @165 - ap_palloc @166 - ap_pcalloc @167 - ap_pstrdup @168 - ap_pstrndup @169 - ap_pstrcat @170 - ap_pvsprintf @171 - ap_psprintf @172 - ap_make_array @173 - ap_push_array @174 - ap_array_cat @175 - ap_copy_array @176 - ap_copy_array_hdr @177 - ap_append_arrays @178 - ap_array_pstrcat @179 - ap_make_table @180 - ap_copy_table @181 - ap_clear_table @182 - ap_table_get @183 - ap_table_set @184 - ap_table_setn @185 - ap_table_unset @186 - ap_table_merge @187 - ap_table_mergen @188 - ap_table_add @189 - ap_table_addn @190 - ap_overlay_tables @191 - ap_table_do @192 - ap_overlap_tables @193 - ap_run_cleanup @194 - ap_cleanup_for_exec @195 - ap_null_cleanup @196 - ap_note_subprocess @197 +; apr_make_time @127 + apr_ansi_time_to_ap_time @127 +; apr_current_time @128 + apr_now @128 +; apr_explode_time @129 + apr_explode_gmt @129 +; apr_implode_time @130 + apr_explode_localtime @130 +; apr_get_curtime @131 + apr_implode_time @131 +; apr_get_sec @132 + apr_get_os_imp_time @132 +; apr_get_min @133 + apr_get_os_exp_time @133 +; apr_get_hour @134 + apr_put_os_imp_time @134 +; apr_get_mday @135 + apr_put_os_exp_time @135 +; apr_get_mon @136 + apr_ctime @136 +; apr_get_year @137 + apr_rfc822_date @137 +; apr_get_wday @138 + apr_strftime @138 +; apr_set_sec @139 +; apr_set_min @140 +; apr_set_hour @141 +; apr_set_mday @142 +; apr_set_mon @143 +; apr_set_year @144 +; apr_set_wday @145 +; apr_get_timedata @146 +; apr_set_timedata @147 +; apr_get_os_time @148 +; apr_timediff @149 + apr_MD5Final @150 + apr_MD5Init @151 + apr_MD5Update @152 + apr_cpystrn @153 + apr_register_cleanup @154 + apr_kill_cleanup @155 + apr_fnmatch @156 + apr_is_fnmatch @157 + apr_MD5Encode @158 + apr_validate_password @159 + apr_make_sub_pool @160 + apr_init_alloc @161 +; apr_clear_pool @162 +; apr_destroy_pool @163 + apr_bytes_in_pool @164 + apr_bytes_in_free_blocks @165 + apr_palloc @166 + apr_pcalloc @167 + apr_pstrdup @168 + apr_pstrndup @169 + apr_pstrcat @170 + apr_pvsprintf @171 + apr_psprintf @172 + apr_make_array @173 + apr_push_array @174 + apr_array_cat @175 + apr_copy_array @176 + apr_copy_array_hdr @177 + apr_append_arrays @178 + apr_array_pstrcat @179 + apr_make_table @180 + apr_copy_table @181 + apr_clear_table @182 + apr_table_get @183 + apr_table_set @184 + apr_table_setn @185 + apr_table_unset @186 + apr_table_merge @187 + apr_table_mergen @188 + apr_table_add @189 + apr_table_addn @190 + apr_overlay_tables @191 + apr_table_do @192 + apr_overlap_tables @193 + apr_run_cleanup @194 + apr_cleanup_for_exec @195 + apr_null_cleanup @196 + apr_note_subprocess @197 ; - ap_vformatter @199 - ap_snprintf @200 - ap_vsnprintf @201 - ap_getpass @202 - ap_ungetc @203 - ap_tokenize_to_argv @204 - ap_filename_of_pathname @205 - ap_get_remote_name @206 - ap_get_local_name @207 - ap_get_local_ipaddr @208 - ap_set_local_ipaddr @209 - ap_get_remote_ipaddr @210 - ap_set_remote_ipaddr @211 - ap_get_local_port @212 - ap_set_local_port @213 - ap_get_remote_port @214 - ap_set_remote_port @215 - ap_open_stderr @216 - ap_set_pipe_timeout @217 - ap_terminate @218 - ap_dso_load @219 - ap_dso_unload @220 - ap_dso_sym @221 -; ap_dso_init @222 - ap_collapse_spaces @223 + apr_vformatter @199 + apr_snprintf @200 + apr_vsnprintf @201 + apr_getpass @202 + apr_ungetc @203 + apr_tokenize_to_argv @204 + apr_filename_of_pathname @205 + apr_get_remote_name @206 + apr_get_local_name @207 + apr_get_local_ipaddr @208 + apr_set_local_ipaddr @209 + apr_get_remote_ipaddr @210 + apr_set_remote_ipaddr @211 + apr_get_local_port @212 + apr_set_local_port @213 + apr_get_remote_port @214 + apr_set_remote_port @215 + apr_open_stderr @216 + apr_set_pipe_timeout @217 + apr_terminate @218 + apr_dso_load @219 + apr_dso_unload @220 + apr_dso_sym @221 +; apr_dso_init @222 + apr_collapse_spaces @223 ap_month_snames @224 ap_day_snames @225 - ap_canonical_error @226 - ap_strerror @227 - ap_generate_random_bytes @228 - ap_strnatcmp @229 - ap_strnatcasecmp @230 - ap_dso_error @231 + apr_canonical_error @226 + apr_strerror @227 + apr_generate_random_bytes @228 + apr_strnatcmp @229 + apr_strnatcasecmp @230 + apr_dso_error @231 diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 41a3dceb3a3..2ba230a5c4b 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -260,7 +260,7 @@ static int os_uncork(apr_socket_t *sock, int delayflag) return rv; } -apr_status_t ap_sendfile(apr_socket_t *sock, apr_file_t *file, +apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags) { @@ -391,7 +391,7 @@ apr_status_t ap_sendfile(apr_socket_t *sock, apr_file_t *file, #elif defined(__FreeBSD__) /* Release 3.1 or greater */ -apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, +apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, apr_int32_t flags) { @@ -481,10 +481,10 @@ apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, #elif defined(__HPUX__) -#error "there's no way this ap_sendfile implementation works -djg" +#error "there's no way this apr_sendfile implementation works -djg" /* HP-UX Version 10.30 or greater */ -apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, +apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, apr_int32_t flags) { @@ -591,7 +591,7 @@ apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, * AIX - version 4.3.2 with APAR IX85388, or version 4.3.3 and above * OS/390 - V2R7 and above */ -apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, +apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, apr_int32_t flags) { @@ -710,7 +710,7 @@ apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, } #elif defined(__osf__) && defined (__alpha) /* - * ap_sendfile for Tru64 Unix. + * apr_sendfile for Tru64 Unix. * * Note: while the sendfile implementation on Tru64 can send * a one header/trailer with the file, it will send only one @@ -720,7 +720,7 @@ apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, * Rather than code these special cases in, using apr_sendv for * all cases of the headers and trailers seems to be a good idea. */ -apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, +apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, apr_int32_t flags) { @@ -826,7 +826,7 @@ apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, #else #error APR has detected sendfile on your system, but nobody has written a -#error version of it for APR yet. To get past this, either write ap_sendfile +#error version of it for APR yet. To get past this, either write apr_sendfile #error or change APR_HAS_SENDFILE in apr.h to 0. #endif /* __linux__, __FreeBSD__, __HPUX__, _AIX, __MVS__, Tru64/OSF1 */ #endif /* APR_HAS_SENDFILE */ diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index eedb0de8a50..b7be1ad9f80 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -136,7 +136,7 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, } #if APR_HAS_SENDFILE /* - * apr_status_t ap_sendfile(apr_socket_t *, apr_file_t *, apr_hdtr_t *, + * apr_status_t apr_sendfile(apr_socket_t *, apr_file_t *, apr_hdtr_t *, * apr_off_t *, apr_size_t *, apr_int32_t flags) * Send a file from an open file descriptor to a socket, along with * optional headers and trailers @@ -147,7 +147,7 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, * arg 5) Number of bytes to send * arg 6) APR flags that are mapped to OS specific flags */ -apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, +apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, apr_int32_t flags) { @@ -257,7 +257,7 @@ apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, /* Mark the socket as disconnected, but do not close it. * Note: The application must have stored the socket prior to making - * the call to ap_sendfile in order to either reuse it or close it. + * the call to apr_sendfile in order to either reuse it or close it. */ if ((lasterror == APR_SUCCESS) && (flags & APR_SENDFILE_DISCONNECT_SOCKET)) { sock->disconnected = 1; From 8ee80d46990c9fcbbbe5d7db689e5471e19c3e66 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 4 Aug 2000 12:51:23 +0000 Subject: [PATCH 0500/7878] Finish converting "ap_sendfile" to "apr_sendfile". (Now if I could just get my cron-driven build tester to place a phone call to anybody who committed anything in the two-hour window since the previous clean build... nah... I could lose my job for that.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60475 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 8 ++++---- test/testsf.c | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index ad0b3087dda..c41922746e0 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -128,10 +128,10 @@ typedef struct apr_hdtr_t apr_hdtr_t; typedef struct in_addr apr_in_addr; #if APR_HAS_SENDFILE -/* Define flags passed in on ap_sendfile() */ +/* Define flags passed in on apr_sendfile() */ #define APR_SENDFILE_DISCONNECT_SOCKET 1 -/* A structure to encapsulate headers and trailers for ap_sendfile */ +/* A structure to encapsulate headers and trailers for apr_sendfile */ struct apr_hdtr_t { struct iovec* headers; int numheaders; @@ -293,8 +293,8 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. * The number of bytes actually sent is stored in argument 5. */ -apr_status_t ap_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, - apr_off_t *offset, apr_size_t *len, apr_int32_t flags); +apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, + apr_off_t *offset, apr_size_t *len, apr_int32_t flags); #endif /** diff --git a/test/testsf.c b/test/testsf.c index b0f26e7f564..8d2f8a5d3b3 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -283,25 +283,25 @@ static int client(client_socket_mode_t socket_mode) if (socket_mode == BLK || socket_mode == TIMEOUT) { current_file_offset = 0; len = FILE_LENGTH; - rv = ap_sendfile(sock, f, &hdtr, ¤t_file_offset, &len, 0); + rv = apr_sendfile(sock, f, &hdtr, ¤t_file_offset, &len, 0); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_sendfile()->%d/%s\n", + fprintf(stderr, "apr_sendfile()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } - printf("ap_sendfile() updated offset with %ld\n", + printf("apr_sendfile() updated offset with %ld\n", (long int)current_file_offset); - printf("ap_sendfile() updated len with %ld\n", + printf("apr_sendfile() updated len with %ld\n", (long int)len); printf("bytes really sent: %d\n", expected_len); if (len != expected_len) { - fprintf(stderr, "ap_sendfile() didn't report the correct " + fprintf(stderr, "apr_sendfile() didn't report the correct " "number of bytes sent!\n"); exit(1); } @@ -323,7 +323,7 @@ static int client(client_socket_mode_t socket_mode) apr_size_t tmplen; tmplen = len; /* bytes remaining to send from the file */ - printf("Calling ap_sendfile()...\n"); + printf("Calling apr_sendfile()...\n"); printf("Headers:\n"); for (i = 0; i < hdtr.numheaders; i++) { printf("\t%d bytes\n", @@ -337,8 +337,8 @@ static int client(client_socket_mode_t socket_mode) hdtr.trailers[i].iov_len); } - rv = ap_sendfile(sock, f, &hdtr, ¤t_file_offset, &tmplen, 0); - printf("ap_sendfile()->%d, sent %ld bytes\n", rv, (long)tmplen); + rv = apr_sendfile(sock, f, &hdtr, ¤t_file_offset, &tmplen, 0); + printf("apr_sendfile()->%d, sent %ld bytes\n", rv, (long)tmplen); if (rv) { if (apr_canonical_error(rv) == APR_EAGAIN) { nsocks = 1; @@ -430,7 +430,7 @@ static int client(client_socket_mode_t socket_mode) exit(1); } - printf("After ap_sendfile(), the kernel file pointer is " + printf("After apr_sendfile(), the kernel file pointer is " "at offset %ld.\n", (long int)current_file_offset); @@ -457,7 +457,7 @@ static int client(client_socket_mode_t socket_mode) exit(1); } - printf("client: ap_sendfile() worked as expected!\n"); + printf("client: apr_sendfile() worked as expected!\n"); rv = apr_remove_file(TESTFILE, p); if (rv != APR_SUCCESS) { @@ -696,7 +696,7 @@ static int server(void) exit(1); } - printf("server: ap_sendfile() worked as expected!\n"); + printf("server: apr_sendfile() worked as expected!\n"); return 0; } From a84789f2d78e59f6f01bb48b20e52df141281b45 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 5 Aug 2000 04:26:46 +0000 Subject: [PATCH 0501/7878] Document all of the public APR structures with DocBook. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60477 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 18 +++++++++++++++ include/apr_general.h | 24 ++++++++++++++++++-- include/apr_hash.h | 8 ++++++- include/apr_md5.h | 21 ++++++++++------- include/apr_mmap.h | 5 +++++ include/apr_network_io.h | 8 ++++++- include/apr_pools.h | 11 +++++++++ include/apr_tables.h | 28 +++++++++++++++++++---- include/apr_thread_proc.h | 17 +++++++++----- include/apr_time.h | 47 +++++++++++++++++++++++++-------------- 10 files changed, 149 insertions(+), 38 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 32ae5eb74fb..984c0ab737e 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -117,16 +117,34 @@ typedef gid_t apr_gid_t; typedef ino_t apr_ino_t; typedef dev_t apr_dev_t; +/** + * The file information structure. This is analogous to the POSIX + * stat structure. + */ struct apr_finfo_t { + /** The access permissions of the file. Currently this mimics Unix + * access rights. + */ apr_fileperms_t protection; + /** The type of file. One of APR_NOFILE, APR_REG, APR_DIR, APR_CHR, + * APR_BLK, APR_PIPE, APR_LNK, APR_SOCK + */ ap_filetype_e filetype; + /** The user id that owns the file */ apr_uid_t user; + /** The group id that owns the file */ apr_gid_t group; + /** The inode of the file. (Not portable?) */ apr_ino_t inode; + /** The id of the device the file is on. (Not portable?) */ apr_dev_t device; + /** The size of the file */ apr_off_t size; + /** The time the file was last accessed */ apr_time_t atime; + /** The time the file was last modified */ apr_time_t mtime; + /** The time the file was last changed */ apr_time_t ctime; }; diff --git a/include/apr_general.h b/include/apr_general.h index 33b9e3496e8..1671ef16e99 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -272,25 +272,45 @@ apr_status_t apr_generate_random_bytes(unsigned char * buf, int length); #define ALLOC_STATS */ -typedef struct apr_pool_t { +typedef struct apr_pool_t apr_pool_t; + +/** The memory allocation structure + */ +struct apr_pool_t { + /** The first block in this pool. */ union block_hdr *first; + /** The last block in this pool. */ union block_hdr *last; + /** The list of cleanups to run on pool cleanup. */ struct cleanup *cleanups; + /** A list of processes to kill when this pool is cleared */ struct process_chain *subprocesses; + /** The first sub_pool of this pool */ struct apr_pool_t *sub_pools; + /** The next sibling pool */ struct apr_pool_t *sub_next; + /** The previous sibling pool */ struct apr_pool_t *sub_prev; + /** The parent pool of this pool */ struct apr_pool_t *parent; + /** The first free byte in this pool */ char *free_first_avail; #ifdef ALLOC_USE_MALLOC + /** The allocation list if using malloc */ void *allocation_list; #endif #ifdef POOL_DEBUG + /** a list of joined pools + * @defvar apr_pool_t *joined */ struct apr_pool_t *joined; #endif + /** A function to control how pools behave when they receive ENOMEM + * @deffunc int apr_abort(int retcode) */ int (*apr_abort)(int retcode); + /** A place to hand user data associated with this pool + * @defvar datastruct *prog_data */ struct datastruct *prog_data; -}apr_pool_t; +}; /* pool functions */ diff --git a/include/apr_hash.h b/include/apr_hash.h index c4be2d9806b..bab59807b30 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -64,7 +64,7 @@ extern "C" { #endif /** - * package Hash Tables + * @package Hash Tables */ #include "apr_pools.h" @@ -83,6 +83,7 @@ typedef struct apr_hash_index_t apr_hash_index_t; * Create a hash table within a pool. * @param pool The pool to allocate the hash table out of * @return The hash table just created + * @deffunc apr_hash_t *apr_make_hash(apr_pool_t *pool) */ APR_EXPORT(apr_hash_t *) apr_make_hash(apr_pool_t *pool); @@ -94,6 +95,7 @@ APR_EXPORT(apr_hash_t *) apr_make_hash(apr_pool_t *pool); * If the length is 0 it is assumed to be strlen(key)+1 * @param val Value to associate with the key * @tip If the value is NULL the hash entry is deleted. + * @deffunc void apr_hash_set(apr_hash_t *ht, const void *key, size_t klen, const void *val) */ APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, size_t klen, const void *val); @@ -105,6 +107,7 @@ APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, size_t klen, * @param klen Length of the key * If the length is 0 it is assumed to be strlen(key)+1 * @return Returns NULL if the key is not present. + * @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, size_t klen) */ APR_EXPORT(void) *apr_hash_get(apr_hash_t *ht, const void *key, size_t klen); @@ -132,6 +135,7 @@ APR_EXPORT(void) *apr_hash_get(apr_hash_t *ht, const void *key, size_t klen); * is delete the current entry) and multiple iterations can be in * progress at the same time. * + * @deffunc apr_hash_index_t * apr_hash_first(apr_hash_t *ht) */ APR_EXPORT(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht); @@ -139,6 +143,7 @@ APR_EXPORT(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht); * Continue iterating over the entries in a hash table. * @param hi The iteration state * @return a pointer to the updated iteration state. NULL if there are no more * entries. + * @deffunc apr_hash_index_t * apr_hash_next(apr_hash_index_t *hi) */ APR_EXPORT(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); @@ -150,6 +155,7 @@ APR_EXPORT(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); * @param val Return pointer for the associated value. * @tip The return pointers should point to a variable that will be set to the * corresponding data, or they may be NULL if the data isn't interesting. + * @deffunc void apr_hash_this(apr_hash_index_t *hi, const void **key, size_t *klen, void **val); */ APR_EXPORT(void) apr_hash_this(apr_hash_index_t *hi, const void **key, size_t *klen, void **val); diff --git a/include/apr_md5.h b/include/apr_md5.h index 412f1a7a18a..d62eb0374b8 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -100,16 +100,21 @@ extern "C" { /* UINT4 defines a four byte word */ typedef unsigned int UINT4; - -/* MD5 context. */ -typedef struct { - UINT4 state[4]; /* state (ABCD) */ - UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ - unsigned char buffer[64]; /* input buffer */ +typedef struct ap_md5_ctx_t ap_md5_ctx_t; + +/** MD5 context. */ +struct ap_md5_ctx_t { + /** state (ABCD) */ + UINT4 state[4]; + /** number of bits, modulo 2^64 (lsb first) */ + UINT4 count[2]; + /** input buffer */ + unsigned char buffer[64]; #if APR_HAS_XLATE - apr_xlate_t *xlate; /* translation handle */ + /** translation handle */ + apr_xlate_t *xlate; #endif -} ap_md5_ctx_t; +}; /** * MD5 Initialize. Begins an MD5 operation, writing a new context. diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 7b57a50f8cd..5f47ebd5b63 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -75,12 +75,17 @@ typedef struct apr_mmap_t apr_mmap_t; * sense to keep it private, and opening it up makes some stuff easier in * Apache. */ +/** The MMAP structure */ struct apr_mmap_t { + /** The pool the mmap structure was allocated out of. */ apr_pool_t *cntxt; #ifdef BEOS + /** An area ID. Only valid on BeOS */ area_id area; #endif + /** The start of the memory mapped area */ void *mm; + /** The amount of data in the mmap */ size_t size; }; diff --git a/include/apr_network_io.h b/include/apr_network_io.h index c41922746e0..87e9bb377d2 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -131,11 +131,17 @@ typedef struct in_addr apr_in_addr; /* Define flags passed in on apr_sendfile() */ #define APR_SENDFILE_DISCONNECT_SOCKET 1 -/* A structure to encapsulate headers and trailers for apr_sendfile */ +/** A structure to encapsulate headers and trailers for apr_sendfile */ struct apr_hdtr_t { + /** An iovec to store the headers sent before the file. + * @defvar iovec *headers */ struct iovec* headers; + /** number of headers in the iovec */ int numheaders; + /** An iovec to store the trailers sent before the file. + * @defvar iovec *trailers */ struct iovec* trailers; + /** number of trailers in the iovec */ int numtrailers; }; #endif diff --git a/include/apr_pools.h b/include/apr_pools.h index 75df3e01ca3..80a5dc6d957 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -102,9 +102,20 @@ enum kill_conditions { kill_only_once /* send SIGTERM and then wait */ }; +/** A list of processes */ struct process_chain { + /** The process ID */ apr_proc_t *pid; + /** When the process should be sent a signal.
    +     *           kill_never   -- process is never sent any signals
    +     *           kill_always  -- process is sent SIGKILL on apr_pool_t cleanup
    +     *           kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL
    +     *           just_wait    -- wait forever for the process to complete
    +     *           kill_only_once -- send SIGTERM and then wait 
    + */ enum kill_conditions kill_how; + /** The next process in the list + * @defvar process_chain *next */ struct process_chain *next; }; diff --git a/include/apr_tables.h b/include/apr_tables.h index 837f4bcad83..43607d5e844 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -74,38 +74,58 @@ extern "C" { * Define the structures used by the APR general-purpose library. */ +/** + * @package APR Table library + */ + /* * Memory allocation stuff, like pools, arrays, and tables. Pools * and tables are opaque structures to applications, but arrays are * published. */ typedef struct apr_table_t apr_table_t; -typedef struct apr_array_header_t { +typedef struct apr_array_header_t apr_array_header_t; + +/** An opaque array type */ +struct apr_array_header_t { + /** The pool the array is allocated out of */ apr_pool_t *cont; + /** The amount of memory allocated for each element of the array */ int elt_size; + /** The number of active elements in the array */ int nelts; + /** The number of elements allocated in the array */ int nalloc; + /** The elements in the array */ char *elts; -} apr_array_header_t; +}; +/** The opaque table type */ struct apr_table_t { /* This has to be first to promote backwards compatibility with * older modules which cast a apr_table_t * to an apr_array_header_t *... * they should use the table_elts() function for most of the * cases they do this for. */ + /** The underlying array for the table */ apr_array_header_t a; #ifdef MAKE_TABLE_PROFILE + /** Who created the array. */ void *creator; #endif }; -typedef struct apr_table_entry_t { +typedef struct apr_table_entry_t apr_table_entry_t; + +/** The type for each entry in a table */ +struct apr_table_entry_t { + /** The key for the current table entry */ char *key; /* maybe NULL in future; * check when iterating thru table_elts */ + /** The value for the current table entry */ char *val; -} apr_table_entry_t; +}; /* XXX: these know about the definition of struct apr_table_t in alloc.c. That * definition is not here because it is supposed to be private, and by not diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index d9d94d77339..8cbbf5553e4 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -99,12 +99,19 @@ typedef enum {APR_WAIT, APR_NOWAIT} apr_wait_how_e; * us knowing ... buggy os? */ #endif /* APR_HAS_OTHER_CHILD */ -typedef struct apr_proc_t { +typedef struct apr_proc_t apr_proc_t; + +/** The APR process type */ +struct apr_proc_t { + /** The process ID */ pid_t pid; - apr_file_t *in; /* Parent's side of pipe to child's stdin */ - apr_file_t *out; /* Parent's side of pipe to child's stdout */ - apr_file_t *err; /* Parent's side of pipe to child's stdouterr */ -} apr_proc_t; + /** Parent's side of pipe to child's stdin */ + apr_file_t *in; + /** Parent's side of pipe to child's stdout */ + apr_file_t *out; + /* Parent's side of pipe to child's stdouterr */ + apr_file_t *err; +}; typedef struct apr_thread_t apr_thread_t; typedef struct apr_threadattr_t apr_threadattr_t; diff --git a/include/apr_time.h b/include/apr_time.h index aea367c7464..16cf1070995 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -92,23 +92,36 @@ typedef apr_int32_t apr_interval_time_t; */ apr_time_t apr_now(void); -/* a structure similar to ANSI struct tm with the following differences: - - tm_usec isn't an ANSI field - - tm_gmtoff isn't an ANSI field (it's a bsdism) -*/ -typedef struct { - apr_int32_t tm_usec; /* microseconds past tm_sec */ - apr_int32_t tm_sec; /* (0-61) seconds past tm_min */ - apr_int32_t tm_min; /* (0-59) minutes past tm_hour */ - apr_int32_t tm_hour; /* (0-23) hours past midnight */ - apr_int32_t tm_mday; /* (1-31) day of the month */ - apr_int32_t tm_mon; /* (0-11) month of the year */ - apr_int32_t tm_year; /* year since 1900 */ - apr_int32_t tm_wday; /* (0-6) days since sunday */ - apr_int32_t tm_yday; /* (0-365) days since jan 1 */ - apr_int32_t tm_isdst; /* daylight saving time */ - apr_int32_t tm_gmtoff; /* seconds east of UTC */ -} ap_exploded_time_t; +typedef struct ap_exploded_time_t ap_exploded_time_t; +/** + * a structure similar to ANSI struct tm with the following differences: + * - tm_usec isn't an ANSI field + * - tm_gmtoff isn't an ANSI field (it's a bsdism) + */ +struct ap_exploded_time_t { + /** microseconds past tm_sec */ + apr_int32_t tm_usec; + /** (0-61) seconds past tm_min */ + apr_int32_t tm_sec; + /** (0-59) minutes past tm_hour */ + apr_int32_t tm_min; + /** (0-23) hours past midnight */ + apr_int32_t tm_hour; + /** (1-31) day of the month */ + apr_int32_t tm_mday; + /** (0-11) month of the year */ + apr_int32_t tm_mon; + /** year since 1900 */ + apr_int32_t tm_year; + /** (0-6) days since sunday */ + apr_int32_t tm_wday; + /** (0-365) days since jan 1 */ + apr_int32_t tm_yday; + /** daylight saving time */ + apr_int32_t tm_isdst; + /** seconds east of UTC */ + apr_int32_t tm_gmtoff; +}; /** * convert an ansi time_t to an apr_time_t From b0f7216b7dbc70da341bd2b0a9974df1b232a5ca Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 5 Aug 2000 05:07:15 +0000 Subject: [PATCH 0502/7878] Make the patch apply and compile again after the apr_ rename. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60478 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_buf.h | 44 +++++------ buckets/ryan.patch | 185 +++++++++++++++++++++++++-------------------- 2 files changed, 126 insertions(+), 103 deletions(-) diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index 6d8c2fcb81c..13d1c973fd3 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -169,8 +169,8 @@ struct ap_bucket { const char *(*read)(ap_bucket *e); /* Get the string */ /* Write into a bucket. The buf is a different type based on the - * bucket type used. For example, with AP_BUCKET_mmap it is an apr_mmap_t - * for AP_BUCKET_file it is an apr_file_t, and for AP_BUCKET_rwmem it is + * bucket type used. For example, with AP_BUCKET_mmap it is an ap_mmap_t + * for AP_BUCKET_file it is an ap_file_t, and for AP_BUCKET_rwmem it is * a char *. The nbytes is the amount of actual data in buf. This is * not the sizeof(buf), it is the actual number of bytes in the char * * that buf resolves to. written is how much of that data was inserted @@ -185,7 +185,7 @@ struct ap_bucket { ap_bucket *prev; /* The prev node in the bucket list */ }; -typedef struct apr_bucket_brigade apr_bucket_brigade; +typedef struct ap_bucket_brigade ap_bucket_brigade; /* * This is the basic bucket brigade. That means it is a list of buckets. * It has a pool out of which the buckets and the bucket brigade are allocated. @@ -196,7 +196,7 @@ typedef struct apr_bucket_brigade apr_bucket_brigade; * the end. By walking the list, it is also possible to insert in the middle * of the list. */ -struct apr_bucket_brigade { +struct ap_bucket_brigade { apr_pool_t *p; /* The pool to associate this with. I do not allocate out of the pool, but this lets me register a cleanup @@ -208,7 +208,7 @@ struct apr_bucket_brigade { /* ****** Different bucket types *****/ -typedef struct apr_bucket_rmem apr_bucket_rmem; +typedef struct ap_bucket_rmem ap_bucket_rmem; /* * The Read only bucket type. This is basically for memory allocated off the * stack or literal strings. It cannot be modified, and the lifetime is @@ -216,14 +216,14 @@ typedef struct apr_bucket_rmem apr_bucket_rmem; * two different types. This contains a pointer to the front and end of the * string so that it is possible to remove characters at either end. */ -struct apr_bucket_rmem { +struct ap_bucket_rmem { size_t alloc_len; /* how much was allocated */ const void *start; /* Where does the actual data start in the alloc'ed block */ const void *end; /* where does the data actually end? */ }; -typedef struct apr_bucket_rwmem apr_bucket_rwmem; +typedef struct ap_bucket_rwmem ap_bucket_rwmem; /* * The read/write memory bucket type. This is for data that has been * allocated out of the heap. This bucket actually starts by allocating @@ -246,7 +246,7 @@ typedef struct apr_bucket_rwmem apr_bucket_rwmem; * easily add and remove characters at either end. Oh, the start cannot be * after the end either. */ -struct apr_bucket_rwmem { +struct ap_bucket_rwmem { void *alloc_addr; /* Where does the data start */ size_t alloc_len; /* how much was allocated */ void *start; /* Where does the actual data start @@ -254,7 +254,7 @@ struct apr_bucket_rwmem { void *end; /* where does the data actually end? */ }; -typedef struct apr_bucket_mmap apr_bucket_mmap; +typedef struct ap_bucket_mmap ap_bucket_mmap; /* * The mmap bucket type. This is basically just an allocation address and a @@ -262,7 +262,7 @@ typedef struct apr_bucket_mmap apr_bucket_mmap; * has a reference count in it, and a pointer to the beginning and end of * the data the bucket is referencing. */ -struct apr_bucket_mmap { +struct ap_bucket_mmap { void *alloc_addr; /* Where does the mmap start? */ int len; /* The amount of data in the mmap that we are * referencing with this bucket. This may be @@ -274,7 +274,7 @@ struct apr_bucket_mmap { /* ****** Bucket Brigade Functions ***** */ /* Create a new bucket brigade. The bucket brigade is originally empty. */ -APR_EXPORT(apr_bucket_brigade *) ap_brigade_create(apr_pool_t *p); +APR_EXPORT(ap_bucket_brigade *) ap_brigade_create(apr_pool_t *p); /* destroy an enitre bucket brigade. This includes destroying all of the * buckets within the bucket brigade's bucket list. */ @@ -284,26 +284,26 @@ APR_EXPORT(apr_status_t) ap_brigade_destroy(void *b); * buckets to the end of a bucket briagdes bucket list. This will accept * a list of buckets of any length. */ -APR_EXPORT(void) ap_brigade_append_buckets(apr_bucket_brigade *b, +APR_EXPORT(void) ap_brigade_append_buckets(ap_bucket_brigade *b, ap_bucket *e); /* consume nbytes from beginning of b -- call ap_bucket_destroy as appropriate, and/or modify start on last element */ -APR_EXPORT(void) ap_brigade_consume(apr_bucket_brigade *, int nbytes); +APR_EXPORT(void) ap_brigade_consume(ap_bucket_brigade *, int nbytes); /* create an iovec of the elements in a bucket_brigade... return number * of elements used. This is useful for writing to a file or to the * network efficiently. */ -APR_EXPORT(int) ap_brigade_to_iovec(apr_bucket_brigade *, +APR_EXPORT(int) ap_brigade_to_iovec(ap_bucket_brigade *, struct iovec *vec, int nvec); /* catenate bucket_brigade b onto bucket_brigade a, bucket_brigade b is * empty after this. Neither bucket brigade can be NULL, but either one of * them can be emtpy when calling this function. */ -APR_EXPORT(void) ap_brigade_catenate(apr_bucket_brigade *a, - apr_bucket_brigade *b); +APR_EXPORT(void) ap_brigade_catenate(ap_bucket_brigade *a, + ap_bucket_brigade *b); /* Destroy the first nvec buckets. This is very much like ap_brigade_consume * except instead of specifying the number of bytes to consume, it consumes @@ -312,7 +312,7 @@ APR_EXPORT(void) ap_brigade_catenate(apr_bucket_brigade *a, * vectors, we would destroy those 16 buckets. My gut is that this is the * wrong approach. I plan to change this soon-ish. */ -APR_EXPORT(void) ap_consume_buckets(apr_bucket_brigade *b, int nvec); +APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec); /* save the buf out to the specified iol. This can be used to flush the * data to the disk, or to send it out to the network. This is a poor @@ -320,10 +320,10 @@ APR_EXPORT(void) ap_consume_buckets(apr_bucket_brigade *b, int nvec); * also required. Once filters have been finished, the whole concept of * iol's can just go away, and this function can go away with it. The * correct solution, is to have the functions that are currently calling - * this just call either apr_sendv or apr_writev directly. + * this just call either ap_sendv or ap_writev directly. */ APR_EXPORT(apr_status_t) ap_brigade_to_iol(apr_ssize_t *total_bytes, - apr_bucket_brigade *a, + ap_bucket_brigade *a, ap_iol *iol); /* @@ -337,7 +337,7 @@ APR_EXPORT(apr_status_t) ap_brigade_to_iol(apr_ssize_t *total_bytes, * filters will be removing some of the data. This may be a dubios * optimization, I just don't know. */ -APR_EXPORT(int) ap_brigade_vputstrs(apr_bucket_brigade *b, va_list va); +APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va); /* * Both of these functions evaluate the printf and put the resulting string @@ -345,8 +345,8 @@ APR_EXPORT(int) ap_brigade_vputstrs(apr_bucket_brigade *b, va_list va); * two of them, is that the ap_r* functions needed both. I would love to be * able to remove one, but I don't think it's feasible. */ -APR_EXPORT(int) ap_brigade_printf(apr_bucket_brigade *b, const char *fmt, ...); -APR_EXPORT(int) ap_brigade_vprintf(apr_bucket_brigade *b, const char *fmt, va_list va); +APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...); +APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_list va); /* ****** Bucket Functions ***** */ diff --git a/buckets/ryan.patch b/buckets/ryan.patch index 977a86c8f80..1d45c410b84 100644 --- a/buckets/ryan.patch +++ b/buckets/ryan.patch @@ -1,10 +1,16 @@ -Index: ap/Makefile.in +? build.log +? build.err +? src/build.log +? src/build.err +? src/lib/apr/buckets/Makefile.in +? src/lib/apr/include/apr_buf.h +Index: src/ap/Makefile.in =================================================================== RCS file: /home/cvs/apache-2.0/src/ap/Makefile.in,v retrieving revision 1.4 diff -u -d -b -w -u -r1.4 Makefile.in ---- ap/Makefile.in 2000/06/12 20:41:13 1.4 -+++ ap/Makefile.in 2000/07/31 23:24:38 +--- src/ap/Makefile.in 2000/06/12 20:41:13 1.4 ++++ src/ap/Makefile.in 2000/08/05 05:01:14 @@ -1,5 +1,5 @@ LTLIBRARY_NAME = libap.la @@ -12,30 +18,31 @@ diff -u -d -b -w -u -r1.4 Makefile.in +LTLIBRARY_SOURCES = ap_cache.c ap_base64.c ap_sha1.c ap_hooks.c include $(top_srcdir)/build/ltlib.mk -Index: include/ap_iol.h +Index: src/include/ap_iol.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/ap_iol.h,v -retrieving revision 1.21 -diff -u -d -b -w -u -r1.21 ap_iol.h ---- include/ap_iol.h 2000/07/29 17:43:01 1.21 -+++ include/ap_iol.h 2000/07/31 23:24:40 +retrieving revision 1.23 +diff -u -d -b -w -u -r1.23 ap_iol.h +--- src/include/ap_iol.h 2000/08/02 17:51:36 1.23 ++++ src/include/ap_iol.h 2000/08/05 05:01:14 @@ -58,7 +58,9 @@ #define AP_IOL_H #include "apr_general.h" /* For ap_s?size_t */ +-#include "apr_errno.h" /* For apr_status_t and the APR_errnos */ +#include "apr_network_io.h" /* For ap_hdtr_t */ - #include "apr_errno.h" /* For ap_status_t and the APR_errnos */ ++#include "apr_errno.h" /* For ap_status_t and the APR_errnos */ +#include "ap_config.h" /* For ap_status_t and the APR_errnos */ typedef struct ap_iol ap_iol; typedef struct ap_iol_methods ap_iol_methods; -Index: include/http_protocol.h +Index: src/include/http_protocol.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/http_protocol.h,v -retrieving revision 1.19 -diff -u -d -b -w -u -r1.19 http_protocol.h ---- include/http_protocol.h 2000/07/11 03:48:17 1.19 -+++ include/http_protocol.h 2000/07/31 23:24:40 +retrieving revision 1.20 +diff -u -d -b -w -u -r1.20 http_protocol.h +--- src/include/http_protocol.h 2000/08/02 05:25:28 1.20 ++++ src/include/http_protocol.h 2000/08/05 05:01:14 @@ -88,8 +88,19 @@ */ API_EXPORT(void) ap_basic_http_header(request_rec *r); @@ -58,13 +65,13 @@ diff -u -d -b -w -u -r1.19 http_protocol.h API_EXPORT(void) ap_send_http_header(request_rec *l); /* Send the response to special method requests */ -Index: include/httpd.h +Index: src/include/httpd.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v -retrieving revision 1.66 -diff -u -d -b -w -u -r1.66 httpd.h ---- include/httpd.h 2000/07/29 19:50:07 1.66 -+++ include/httpd.h 2000/07/31 23:24:41 +retrieving revision 1.69 +diff -u -d -b -w -u -r1.69 httpd.h +--- src/include/httpd.h 2000/08/04 17:40:02 1.69 ++++ src/include/httpd.h 2000/08/05 05:01:15 @@ -589,6 +589,10 @@ * pointer back to the main request. */ @@ -76,13 +83,22 @@ diff -u -d -b -w -u -r1.66 httpd.h /* Info about the request itself... we begin with stuff that only * protocol.c should ever touch... */ -Index: include/util_filter.h +@@ -725,7 +729,7 @@ + struct ap_rr_xlate *rrx; + #endif /*APACHE_XLATE*/ + +- struct apr_filter_t *filters; ++ struct ap_filter_t *filters; + + /* Things placed at the end of the record to avoid breaking binary + * compatibility. It would be nice to remember to reorder the entire +Index: src/include/util_filter.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/util_filter.h,v -retrieving revision 1.1 -diff -u -d -b -w -u -r1.1 util_filter.h ---- include/util_filter.h 2000/07/28 20:30:53 1.1 -+++ include/util_filter.h 2000/07/31 23:24:41 +retrieving revision 1.3 +diff -u -d -b -w -u -r1.3 util_filter.h +--- src/include/util_filter.h 2000/08/05 04:38:57 1.3 ++++ src/include/util_filter.h 2000/08/05 05:01:15 @@ -65,6 +65,7 @@ #include "httpd.h" @@ -95,16 +111,13 @@ diff -u -d -b -w -u -r1.1 util_filter.h * next/prev to insert/remove/replace elements in the bucket list, but * the types and values of the individual buckets should not be altered. */ --typedef ap_status_t (*ap_filter_func)(); -+typedef ap_status_t (*ap_filter_func)(request_rec *r, ap_filter_t *f, ap_bucket_brigade *b); +-typedef apr_status_t (*ap_filter_func)(); ++typedef apr_status_t (*ap_filter_func)(request_rec *r, ap_filter_t *f, ap_bucket_brigade *b); /* * ap_filter_type: -@@ -166,8 +167,22 @@ - - ap_filter_type ftype; +@@ -168,6 +169,19 @@ ap_filter_t *next; -+ ap_filter_t *prev; }; +/* This function just passes the current bucket brigade down to the next @@ -123,7 +136,7 @@ diff -u -d -b -w -u -r1.1 util_filter.h /* * ap_register_filter(): * -@@ -192,9 +207,28 @@ +@@ -192,9 +206,28 @@ * calls to ap_add_filter). If the current filter chain contains filters * from another request, then this filter will be added before those other * filters. @@ -152,7 +165,7 @@ diff -u -d -b -w -u -r1.1 util_filter.h /* * Things to do later: -@@ -206,12 +240,6 @@ +@@ -206,12 +239,6 @@ * bucket_brigade, but I am trying to keep this patch neutral. (If this * comment breaks that, well sorry, but the information must be there * somewhere. :-) @@ -165,13 +178,13 @@ diff -u -d -b -w -u -r1.1 util_filter.h */ #ifdef __cplusplus } -Index: lib/apr/configure.in +Index: src/lib/apr/configure.in =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v -retrieving revision 1.142 -diff -u -d -b -w -u -r1.142 configure.in ---- lib/apr/configure.in 2000/07/30 12:01:53 1.142 -+++ lib/apr/configure.in 2000/07/31 23:24:42 +retrieving revision 1.143 +diff -u -d -b -w -u -r1.143 configure.in +--- src/lib/apr/configure.in 2000/08/02 05:51:39 1.143 ++++ src/lib/apr/configure.in 2000/08/05 05:01:15 @@ -688,8 +688,8 @@ AC_SUBST(EXEEXT) @@ -183,13 +196,13 @@ diff -u -d -b -w -u -r1.142 configure.in for dir in $MODULES do test -d $dir || $MKDIR -p $dir -Index: main/http_core.c +Index: src/main/http_core.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v -retrieving revision 1.93 -diff -u -d -b -w -u -r1.93 http_core.c ---- main/http_core.c 2000/07/29 19:50:08 1.93 -+++ main/http_core.c 2000/07/31 23:24:56 +retrieving revision 1.94 +diff -u -d -b -w -u -r1.94 http_core.c +--- src/main/http_core.c 2000/08/02 05:26:47 1.94 ++++ src/main/http_core.c 2000/08/05 05:01:22 @@ -72,6 +72,8 @@ #include "util_md5.h" #include "apr_fnmatch.h" @@ -228,7 +241,7 @@ diff -u -d -b -w -u -r1.93 http_core.c +static int core_filter(request_rec *r, ap_filter_t *f, ap_bucket_brigade *b) +{ + ap_bucket *dptr = b->head; -+ ap_ssize_t bytes_sent; ++ apr_ssize_t bytes_sent; + int len = 0; + + if (!r->headers_sent) { @@ -290,13 +303,13 @@ diff -u -d -b -w -u -r1.93 http_core.c } API_VAR_EXPORT module core_module = { -Index: main/http_protocol.c +Index: src/main/http_protocol.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v -retrieving revision 1.99 -diff -u -d -b -w -u -r1.99 http_protocol.c ---- main/http_protocol.c 2000/07/28 20:31:00 1.99 -+++ main/http_protocol.c 2000/07/31 23:24:57 +retrieving revision 1.100 +diff -u -d -b -w -u -r1.100 http_protocol.c +--- src/main/http_protocol.c 2000/08/02 05:26:48 1.100 ++++ src/main/http_protocol.c 2000/08/05 05:01:22 @@ -64,6 +64,8 @@ */ @@ -306,25 +319,27 @@ diff -u -d -b -w -u -r1.99 http_protocol.c #include "ap_config.h" #include "apr_strings.h" #include "httpd.h" -@@ -1824,7 +1826,11 @@ - ap_rfc822_date(date, r->request_time); - ap_table_addn(r->headers_out, "Expires", date); +@@ -1824,8 +1826,12 @@ + apr_rfc822_date(date, r->request_time); + apr_table_addn(r->headers_out, "Expires", date); } +} +- /* Send the entire apr_table_t of header fields, terminated by an empty line. */ +API_EXPORT(void) ap_send_http_header_real(request_rec *r) +{ + const long int zero = 0L; - /* Send the entire ap_table_t of header fields, terminated by an empty line. */ ++ /* Send the entire ap_table_t of header fields, terminated by an empty line. */ - ap_table_do((int (*) (void *, const char *, const char *)) ap_send_header_field, + apr_table_do((int (*) (void *, const char *, const char *)) ap_send_header_field, + (void *) r, r->headers_out, NULL); @@ -2468,101 +2474,84 @@ - API_EXPORT(size_t) ap_send_mmap(ap_mmap_t *mm, request_rec *r, size_t offset, + API_EXPORT(size_t) ap_send_mmap(apr_mmap_t *mm, request_rec *r, size_t offset, size_t length) { - size_t total_bytes_sent = 0; - int n; -- ap_ssize_t w; +- apr_ssize_t w; - char *addr; - - if (length == 0) @@ -342,7 +357,7 @@ diff -u -d -b -w -u -r1.99 http_protocol.c + size_t bytes_sent = 0; + ap_bucket_brigade *bb = NULL; -- ap_mmap_offset((void**)&addr, mm, offset); +- apr_mmap_offset((void**)&addr, mm, offset); - w = ap_rwrite(addr, n, r); - if (w < 0) - break; @@ -367,7 +382,7 @@ diff -u -d -b -w -u -r1.99 http_protocol.c API_EXPORT(int) ap_rputc(int c, request_rec *r) { + ap_bucket_brigade *bb = NULL; -+ ap_ssize_t written; ++ apr_ssize_t written; + if (r->connection->aborted) return EOF; @@ -388,7 +403,7 @@ diff -u -d -b -w -u -r1.99 http_protocol.c { - int rcode; + ap_bucket_brigade *bb = NULL; -+ ap_ssize_t written; ++ apr_ssize_t written; if (r->connection->aborted) return EOF; @@ -410,10 +425,10 @@ diff -u -d -b -w -u -r1.99 http_protocol.c API_EXPORT(int) ap_rwrite(const void *buf, int nbyte, request_rec *r) { -- ap_ssize_t n; -- ap_status_t rv; +- apr_ssize_t n; +- apr_status_t rv; + ap_bucket_brigade *bb = NULL; -+ ap_ssize_t written; ++ apr_ssize_t written; if (r->connection->aborted) return EOF; @@ -436,13 +451,13 @@ diff -u -d -b -w -u -r1.99 http_protocol.c { - int n; + ap_bucket_brigade *bb = NULL; -+ ap_ssize_t written; ++ apr_ssize_t written; if (r->connection->aborted) return EOF; -- -- n = ap_vbprintf(r->connection->client, fmt, va); +- n = ap_vbprintf(r->connection->client, fmt, va); +- - if (n < 0) { - check_first_conn_error(r, "vrprintf", 0); - return EOF; @@ -480,7 +495,7 @@ diff -u -d -b -w -u -r1.99 http_protocol.c API_EXPORT_NONSTD(int) ap_rvputs(request_rec *r, ...) { + ap_bucket_brigade *bb = NULL; -+ ap_ssize_t written; ++ apr_ssize_t written; va_list va; - int n; @@ -506,7 +521,7 @@ diff -u -d -b -w -u -r1.99 http_protocol.c API_EXPORT(int) ap_rflush(request_rec *r) { -- ap_status_t rv; +- apr_status_t rv; + ap_bucket_brigade *bb; - if ((rv = ap_bflush(r->connection->client)) != APR_SUCCESS) { @@ -519,13 +534,13 @@ diff -u -d -b -w -u -r1.99 http_protocol.c return 0; } -Index: main/http_request.c +Index: src/main/http_request.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v -retrieving revision 1.37 -diff -u -d -b -w -u -r1.37 http_request.c ---- main/http_request.c 2000/07/28 20:31:01 1.37 -+++ main/http_request.c 2000/07/31 23:24:57 +retrieving revision 1.38 +diff -u -d -b -w -u -r1.38 http_request.c +--- src/main/http_request.c 2000/08/02 05:26:48 1.38 ++++ src/main/http_request.c 2000/08/05 05:01:22 @@ -1276,6 +1276,12 @@ return; } @@ -539,14 +554,22 @@ diff -u -d -b -w -u -r1.37 http_request.c /* Take care of little things that need to happen when we're done */ ap_finalize_request_protocol(r); } -Index: main/util_filter.c +Index: src/main/util_filter.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/util_filter.c,v -retrieving revision 1.1 -diff -u -d -b -w -u -r1.1 util_filter.c ---- main/util_filter.c 2000/07/28 20:31:02 1.1 -+++ main/util_filter.c 2000/07/31 23:24:57 -@@ -73,7 +73,7 @@ +retrieving revision 1.3 +diff -u -d -b -w -u -r1.3 util_filter.c +--- src/main/util_filter.c 2000/08/05 04:38:58 1.3 ++++ src/main/util_filter.c 2000/08/05 05:01:22 +@@ -52,6 +52,7 @@ + * . + */ + ++#include "httpd.h" + #include "util_filter.h" + + /* +@@ -73,7 +74,7 @@ } ap_filter_rec_t; /* ### make this visible for direct manipulation? @@ -555,7 +578,7 @@ diff -u -d -b -w -u -r1.1 util_filter.c */ static ap_filter_rec_t *registered_filters = NULL; -@@ -144,3 +144,63 @@ +@@ -144,3 +145,63 @@ } } @@ -619,13 +642,13 @@ diff -u -d -b -w -u -r1.1 util_filter.c + ap_brigade_destroy(*b); + f->ctx = bb; +} -Index: os/unix/os.h +Index: src/os/unix/os.h =================================================================== RCS file: /home/cvs/apache-2.0/src/os/unix/os.h,v retrieving revision 1.10 diff -u -d -b -w -u -r1.10 os.h ---- os/unix/os.h 2000/05/15 23:02:57 1.10 -+++ os/unix/os.h 2000/07/31 23:25:01 +--- src/os/unix/os.h 2000/05/15 23:02:57 1.10 ++++ src/os/unix/os.h 2000/08/05 05:01:25 @@ -59,8 +59,6 @@ #ifndef APACHE_OS_H #define APACHE_OS_H From 449b35f80ccc2a13ae80de6710d82fc527364921 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sat, 5 Aug 2000 09:54:14 +0000 Subject: [PATCH 0503/7878] - remove patch #3 since it has been applied - regenerate patch #2 given ap_ -> apr_ rename and presence of patch #3 - update the README git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60479 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/README.txt | 9 - buckets/ap_filter.h | 379 ---------------------------------- buckets/filters.c | 149 -------------- buckets/greg_patch.txt | 412 ++++++++++++++++++++++++------------- buckets/register_patch.txt | 142 ------------- buckets/util_filter.c | 146 ------------- buckets/util_filter.h | 220 -------------------- 7 files changed, 267 insertions(+), 1190 deletions(-) delete mode 100644 buckets/ap_filter.h delete mode 100644 buckets/filters.c delete mode 100644 buckets/register_patch.txt delete mode 100644 buckets/util_filter.c delete mode 100644 buckets/util_filter.h diff --git a/buckets/README.txt b/buckets/README.txt index 06a7758b964..393798775c9 100644 --- a/buckets/README.txt +++ b/buckets/README.txt @@ -41,13 +41,4 @@ Bachelor #1 Bachelor #2 ----------- - ap_filter.h - filters.c greg_patch.txt - -Bachelor #3 -- The combination of #1 and #2 (hopefully) ------------ - - util_filter.h - util_filter.c - register_patch.txt diff --git a/buckets/ap_filter.h b/buckets/ap_filter.h deleted file mode 100644 index 5785b66f93a..00000000000 --- a/buckets/ap_filter.h +++ /dev/null @@ -1,379 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef AP_FILTER_H -#define AP_FILTER_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef APR_HAVE_STDARG_H -#include -#endif - -#include "httpd.h" -#include "apr.h" - -/* - * FILTER CHAIN - * - * Filters operate using a "chaining" mechanism. The filters are chained - * together into a sequence. When output is generated, it is passed through - * each of the filters on this chain, until it reaches the end (or "bottom") - * and is placed onto the network. - * - * The top of the chain, the code generating the output, is typically called - * a "content generator." The content generator's output is fed into the - * filter chain using the standard Apache output mechanisms: ap_rputs(), - * ap_rprintf(), ap_rwrite(), etc. - * - * Each filter is defined by a callback. This callback takes the output from - * the previous filter (or the content generator if there is no previous - * filter), operates on it, and passes the result to the next filter in the - * chain. This pass-off is performed using the ap_fc_* functions, such as - * ap_fc_puts(), ap_fc_printf(), ap_fc_write(), etc. - * - * When content generation is complete, the system will pass an "end of - * stream" marker into the filter chain. The filters will use this to flush - * out any internal state and to detect incomplete syntax (for example, an - * unterminated SSI directive). - */ - -/* - * BUCKETS - * - * Filtering uses a "bucket" metaphor for holding content to be processed. - * These buckets may contain arbitrary types of data. The selection of the - * type is dependent upon how the "upstream" filter/generator places content - * into the filter chain stream. - * - * For example, if a content generator uses ap_rwrite(), then the data will - * be placed into an AP_BUCKET_PTRLEN bucket. This bucket type contains a - * single pointer/length pair which will refer to the data. - * - * Buckets types are defined around the need to avoid copying the data if - * at all possible. Whatever the "natural" input form is for a piece of - * content, this is modelled within the bucket types. For example, when a - * content generator uses ap_rprintf() or a filter uses ap_fc_printf(), - * the format string and arguments are fed into/down the filter chain as - * just theat: a format string and its arguments. The filter mechanism avoids - * reducing the format/args to a final string for as long as possible. At - * some point, a filter or the output of the chain will combine these to - * produce actual bytes, but it is most optimal to defer this until it is - * truly needed. - * - * See the ap_bucket_type enumeration for the different bucket types which - * are currently defined. - * - * Buckets may also be linked into a list so that they may be passed as - * entire groups of content. The filter may insert/remove/replace the buckets - * within this list before passing the list to the next filter. - */ - -/* forward declare some types */ -typedef struct apr_filter_t apr_filter_t; -typedef struct apr_bucket_t apr_bucket_t; - -/* - * apr_filter_bucket_cb: - * - * This function type is used for filter callbacks. It will be passed a - * pointer to "this" filter, and a "bucket" containing the content to be - * filtered. - * - * In filter->ctx, the callback will find its context. This context is - * provided here, so that a filter may be installed multiple times, each - * receiving its own per-install context pointer. - * - * Callbacks are associated with a filter definition, which is specified - * by name. See ap_register_filter() for setting the association between - * a name for a filter and its associated callback (and other information). - * - * The *bucket structure (and all those referenced by ->next and ->prev) - * should be considered "const". The filter is allowed to modify the - * next/prev to insert/remove/replace elements in the bucket list, but - * the types and values of the individual buckets should not be altered. - */ -typedef void (*apr_filter_bucket_cb)(apr_filter_t *filter, - apr_bucket_t *bucket); - -/* - * ap_filter_type: - * - * Filters have different types/classifications. These are used to group - * and sort the filters to properly sequence their operation. - * - * AP_FTYPE_CONTENT: - * These filters are used to alter the content that is passed through - * them. Examples are SSI or PHP. - * - * AP_FTYPE_CONNECTION: - * These filters will alter the content, but in ways that are more - * strongly associated with the output connection. Examples are - * compression, character recoding, or chunked transfer coding. - * - * It is important to note that these types of filters are not allowed - * in a sub-request. A sub-requests output can certainly be filtered - * by AP_FTYPE_CONTENT filters, but all of the "final processing" is - * determined by the main request. - * - * The types have a particular sort order, which allows us to insert them - * into the filter chain in a determistic order. Within a particular grouping, - * the ordering is equivalent to the order of calls to ap_add_filter(). - */ -typedef enum { - AP_FTYPE_CONTENT, - AP_FTYPE_CONNECTION -} ap_filter_type; - -/* - * apr_filter_t: - * - * This is the request-time context structure for an installed filter (in - * the output filter chain). It provides the callback to use for filtering, - * the request this filter is associated with (which is important when - * an output chain also includes sub-request filters), the context for this - * installed filter, and the filter ordering/chaining fields. - * - * Filter callbacks are free to use ->ctx as they please, to store context - * during the filter process. Generally, this is superior over associating - * the state directly with the request. A callback should not change any of - * the other fields. - */ -struct apr_filter_t { - apr_filter_bucket_cb bucket_cb; - request_rec *r; - - void *ctx; - - ap_filter_type ftype; - apr_filter_t *next; -}; - -/* - * ap_bucket_type: - * - * This enumeration is used to specify what type of bucket is present when - * an apr_bucket_t is provided. - * - * AP_BUCKET_PTRLEN: - * This bucket type defines a simple pointer/length pair for the content. - * The content is NOT necessarily null-terminated. - * - * This type occurs when ap_rwrite(), ap_fc_write(), ap_rputs(), - * ap_fc_puts(), ap_rputc(), or ap_fc_putc() is used by the upstream - * filter/generator. - * - * AP_BUCKET_STRINGS: - * This bucket type defines a set of null-terminated strings. The actual - * representation is through varargs' va_list type. A filter can sequence - * through the arguments using the va_arg() macro (and the "const char *" - * type). The filter should NOT use va_start() or va_end(). When va_arg() - * returns a NULL pointer, the list of strings is complete. - * - * Note that you can only sequence through the strings once, due to the - * definition of va_list. Thus, the first filter to do this sequencing - * must pass the resulting content to the next filter in a new form (the - * bucket cannot simply be passed because ->va is useless). - * - * This type occurs when ap_rvputs(), ap_fc_putstrs, or ap_fc_vputstrs() - * is used by the upstream filter/generator. - * - * AP_BUCKET_PRINTF: - * This bucket type defines a printf-style format and arguments. Similar - * to AP_BUCKET_STRINGS, this type also uses the ->va field to refer to - * the arguments. The format for the printf is stored in ->fmt. - * - * Also similar to AP_BUCKET_STRINGS, the va_start/va_end macros should - * not be used, and ->va should be processed only once. The bucket may - * not be passed after this processing. - * - * This type occurs when ap_rprintf(), ap_vrprintf(), ap_fc_printf(), or - * ap_fc_vprintf() is used by the upstream filter/generator. - * - * AP_BUCKET_FILE: - * This bucket type refers to an open file, from the current position - * and extending for ->flen bytes. Since there are some apr_file_t - * implementations/types that are not seekable, it may be impossible to - * "rewind" the file's current position after reading the contenxt. - * Therefore, it is important to note that once the content has been - * read, it must be passed to the next filter in a different form. - * - * Note: if there is a way to determine whether a file is seekable, then - * it would be legal to fetch the current position, read the contents, - * rewind to the original position, and then pass this bucket/file down - * to the next filter in the output chain. - * - * This type occurs when ap_send_fd(), ap_send_fd_length(), or - * ap_fc_sendfile() are used by the upstream filter/generator. - * - * AP_BUCKET_EOS: - * This bucket signals the end of the content stream. The filter should - * flush any internal state and issue errors if the state specifies that - * and end of stream cannot occur now (e.g. a command directive is - * incomplete). - * - * This type occurs when Apache finalizes a (sub)request, or when an - * upstream filter passes this bucket along. - */ -typedef enum { - AP_BUCKET_PTRLEN, - AP_BUCKET_STRINGS, - AP_BUCKET_PRINTF, - AP_BUCKET_FILE, - AP_BUCKET_EOS -} ap_bucket_type; - -/* - * apr_bucket_t: - * - * The actual bucket definition. The type is determined by the ->type field. - * Which fields are valid/useful in the bucket is determined by the type, - * as noted below and in the comments above for each type. - * - * Buckets are arranged in a doubly-linked list so that a filter may insert, - * remove, or replace elements in a list of buckets. Generally, a filter - * should not change any bucket values other than these link pointers. - */ -struct apr_bucket_t { - ap_bucket_type type; - - const char *buf; /* AP_BUCKET_PTRLEN */ - apr_size_t len; /* AP_BUCKET_PTRLEN */ - - const char *fmt; /* AP_BUCKET_PRINTF */ - va_list va; /* AP_BUCKET_STRINGS, _PRINTF */ - - apr_file_t *file; /* AP_BUCKET_FILE */ - apr_ssize_t flen; /* AP_BUCKET_FILE */ - - apr_bucket_t *next; /* next bucket in list */ - apr_bucket_t *prev; /* previous bucket in list */ -}; - -/* - * FILTER CHAIN OUTPUT FUNCTIONS - * - * These functions are used to deliver output/content down to the next - * filter in the chain. - * - * ap_fc_write(): write a block of bytes - * ap_fc_putc(): write a single character - * ap_fc_puts(): write a null-terminated string - * ap_fc_putstrs(): write a set of null-termianted strings; the end is - * signaled by a NULL parameter - * ap_fc_vputstrs(): same as ap_fc_putstrs(), but where the set of strings - * is defined by a va_list - * ap_fc_printf(): use printf-like semantics for writing a string - * ap_fc_vprintf(): use printf-like semantics, but with a va_list for the args - * ap_fc_sendfile(): send the file contents, from the current file position, - * and extending for "len" bytes; AP_FC_SENDFILE_ALL is - * used to send from current-position to the end-of-file. - * ap_fc_putbucket(): write a bucket into the filter chain - */ -API_EXPORT(void) ap_fc_write(apr_filter_t *filter, const char *buf, - apr_size_t len); -API_EXPORT(void) ap_fc_putc(apr_filter_t *filter, int c); -API_EXPORT(void) ap_fc_puts(apr_filter_t *filter, const char *str); - -API_EXPORT_NONSTD(void) ap_fc_putstrs(apr_filter_t *filter, ...); -API_EXPORT(void) ap_fc_vputstrs(apr_filter_t *filter, va_list va); - -API_EXPORT_NONSTD(void) ap_fc_printf(apr_filter_t *filter, - const char *fmt, ...); -API_EXPORT(void) ap_fc_vprintf(apr_filter_t *filter, - const char *fmt, va_list va); - -API_EXPORT(void) ap_fc_sendfile(apr_filter_t *filter, apr_file_t *file, - apr_ssize_t flen); -#define AP_FC_SENDFILE_ALL ((apr_ssize_t) -1) - -/* note: bucket->next and ->prev may be changed upon return from this */ -API_EXPORT(void) ap_fc_putbucket(apr_filter_t *filter, apr_bucket_t *bucket); - - -/* - * ap_register_filter(): - * - * This function is used to register a filter with the system. After this - * registration is performed, then a filter may be added into the filter - * chain by using ap_add_filter() and simply specifying the name. - * - * The filter's callback and type should be passed. - */ -API_EXPORT(void) ap_register_filter(const char *name, - apr_filter_bucket_cb bucket_cb, - ap_filter_type ftype); - -/* - * ap_add_filter(): - * - * Adds a named filter into the filter chain on the specified request record. - * The filter will be installed with the specified context pointer. - * - * Filters added in this way will always be placed at the end of the filters - * that have the same type (thus, the filters have the same order as the - * calls to ap_add_filter). If the current filter chain contains filters - * from another request, then this filter will be added before those other - * filters. - */ -API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r); - - -#ifdef __cplusplus -} -#endif - -#endif /* !AP_FILTER_H */ diff --git a/buckets/filters.c b/buckets/filters.c deleted file mode 100644 index d4e7a4810cf..00000000000 --- a/buckets/filters.c +++ /dev/null @@ -1,149 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "ap_filter.h" - - - -/* - * ap_filter_rec_t: - * - * This (internal) structure is used for recording information about the - * registered filters. It associates a name with the filter's callback - * and filter type. - * - * At the moment, these are simply linked in a chain, so a ->next pointer - * is available. - */ -typedef struct ap_filter_rec_t { - const char *name; - apr_filter_bucket_cb bucket_cb; - ap_filter_type ftype; - - struct ap_filter_rec_t *next; -} ap_filter_rec_t; - -/* ### make this visible for direct manipulation? - ### use a hash table -*/ -static ap_filter_rec_t *registered_filters = NULL; - -/* NOTE: Apache's current design doesn't allow a pool to be passed thu, - so we depend on a global to hold the correct pool -*/ -#define FILTER_POOL ap_global_hook_pool -#include "ap_hooks.h" /* for ap_global_hook_pool */ - -/* -** This macro returns true/false if a given filter should be inserted BEFORE -** another filter. This will happen when one of: 1) there isn't another -** filter; 2) that filter has a higher filter type (class); 3) that filter -** corresponds to a different request. -*/ -#define INSERT_BEFORE(f, before_this) ((before_this) == NULL \ - || (before_this)->ftype > (f)->ftype \ - || (before_this)->r != (f)->r) - - -static apr_status_t filter_cleanup(void *ctx) -{ - registered_filters = NULL; - return APR_SUCCESS; -} - -API_EXPORT(void) ap_register_filter(const char *name, - apr_filter_bucket_cb bucket_cb, - ap_filter_type ftype) -{ - ap_filter_rec_t *frec = apr_palloc(FILTER_POOL, sizeof(*frec)); - - frec->name = name; - frec->bucket_cb = bucket_cb; - frec->ftype = ftype; - - frec->next = registered_filters; - registered_filters = frec; - - apr_register_cleanup(FILTER_POOL, NULL, filter_cleanup, NULL); -} - -API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) -{ - ap_filter_rec_t *frec = registered_filters; - - for (; frec != NULL; frec = frec->next) { - if (!strcasecmp(name, frec->name)) { - apr_filter_t *f = apr_pcalloc(r->pool, sizeof(*f)); - - f->bucket_cb = frec->bucket_cb; - f->r = r; - f->ctx = ctx; - f->ftype = frec->ftype; - - if (INSERT_BEFORE(f, r->filters)) { - f->next = r->filters; - r->filters = f; - } - else { - apr_filter_t *fscan = r->filters; - while (!INSERT_BEFORE(f, fscan->next)) - fscan = fscan->next; - f->next = fscan->next; - fscan->next = f; - } - - break; - } - } -} diff --git a/buckets/greg_patch.txt b/buckets/greg_patch.txt index 3895633aca2..48eb739039b 100644 --- a/buckets/greg_patch.txt +++ b/buckets/greg_patch.txt @@ -1,48 +1,244 @@ -Index: include/httpd.h +Index: include/util_filter.h =================================================================== -RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v -retrieving revision 1.64 -diff -u -r1.64 httpd.h ---- include/httpd.h 2000/06/30 21:18:13 1.64 -+++ include/httpd.h 2000/07/12 11:00:55 -@@ -731,7 +731,9 @@ - #ifdef APACHE_XLATE - struct ap_rr_xlate *rrx; - #endif /*APACHE_XLATE*/ -- -+ -+ struct ap_filter_t *filters; -+ - /* Things placed at the end of the record to avoid breaking binary - * compatibility. It would be nice to remember to reorder the entire - * record to improve 64bit alignment the next time we need to break +RCS file: /home/cvs/apache-2.0/src/include/util_filter.h,v +retrieving revision 1.3 +diff -u -r1.3 util_filter.h +--- include/util_filter.h 2000/08/05 04:38:57 1.3 ++++ include/util_filter.h 2000/08/05 09:48:20 +@@ -91,8 +91,40 @@ + * unterminated SSI directive). + */ + +-/* forward declare the filter type */ ++/* ++ * BUCKETS ++ * ++ * Filtering uses a "bucket" metaphor for holding content to be processed. ++ * These buckets may contain arbitrary types of data. The selection of the ++ * type is dependent upon how the "upstream" filter/generator places content ++ * into the filter chain stream. ++ * ++ * For example, if a content generator uses ap_rwrite(), then the data will ++ * be placed into an AP_BUCKET_PTRLEN bucket. This bucket type contains a ++ * single pointer/length pair which will refer to the data. ++ * ++ * Buckets types are defined around the need to avoid copying the data if ++ * at all possible. Whatever the "natural" input form is for a piece of ++ * content, this is modelled within the bucket types. For example, when a ++ * content generator uses ap_rprintf() or a filter uses ap_fc_printf(), ++ * the format string and arguments are fed into/down the filter chain as ++ * just theat: a format string and its arguments. The filter mechanism avoids ++ * reducing the format/args to a final string for as long as possible. At ++ * some point, a filter or the output of the chain will combine these to ++ * produce actual bytes, but it is most optimal to defer this until it is ++ * truly needed. ++ * ++ * See the ap_bucket_type enumeration for the different bucket types which ++ * are currently defined. ++ * ++ * Buckets may also be linked into a list so that they may be passed as ++ * entire groups of content. The filter may insert/remove/replace the buckets ++ * within this list before passing the list to the next filter. ++ */ ++ ++/* forward declare some types */ + typedef struct ap_filter_t ap_filter_t; ++typedef struct ap_bucket_t ap_bucket_t; + + /* + * ap_filter_func: +@@ -114,7 +146,7 @@ + * next/prev to insert/remove/replace elements in the bucket list, but + * the types and values of the individual buckets should not be altered. + */ +-typedef apr_status_t (*ap_filter_func)(); ++typedef void (*ap_filter_func)(ap_filter_t *filter, ap_bucket_t *bucket); + + /* + * ap_filter_type: +@@ -161,12 +193,155 @@ + */ + struct ap_filter_t { + ap_filter_func filter_func; ++ request_rec *r; + + void *ctx; + + ap_filter_type ftype; + ap_filter_t *next; + }; ++ ++/* ++ * ap_bucket_type: ++ * ++ * This enumeration is used to specify what type of bucket is present when ++ * an ap_bucket_t is provided. ++ * ++ * AP_BUCKET_PTRLEN: ++ * This bucket type defines a simple pointer/length pair for the content. ++ * The content is NOT necessarily null-terminated. ++ * ++ * This type occurs when ap_rwrite(), ap_fc_write(), ap_rputs(), ++ * ap_fc_puts(), ap_rputc(), or ap_fc_putc() is used by the upstream ++ * filter/generator. ++ * ++ * AP_BUCKET_STRINGS: ++ * This bucket type defines a set of null-terminated strings. The actual ++ * representation is through varargs' va_list type. A filter can sequence ++ * through the arguments using the va_arg() macro (and the "const char *" ++ * type). The filter should NOT use va_start() or va_end(). When va_arg() ++ * returns a NULL pointer, the list of strings is complete. ++ * ++ * Note that you can only sequence through the strings once, due to the ++ * definition of va_list. Thus, the first filter to do this sequencing ++ * must pass the resulting content to the next filter in a new form (the ++ * bucket cannot simply be passed because ->va is useless). ++ * ++ * This type occurs when ap_rvputs(), ap_fc_putstrs, or ap_fc_vputstrs() ++ * is used by the upstream filter/generator. ++ * ++ * AP_BUCKET_PRINTF: ++ * This bucket type defines a printf-style format and arguments. Similar ++ * to AP_BUCKET_STRINGS, this type also uses the ->va field to refer to ++ * the arguments. The format for the printf is stored in ->fmt. ++ * ++ * Also similar to AP_BUCKET_STRINGS, the va_start/va_end macros should ++ * not be used, and ->va should be processed only once. The bucket may ++ * not be passed after this processing. ++ * ++ * This type occurs when ap_rprintf(), ap_vrprintf(), ap_fc_printf(), or ++ * ap_fc_vprintf() is used by the upstream filter/generator. ++ * ++ * AP_BUCKET_FILE: ++ * This bucket type refers to an open file, from the current position ++ * and extending for ->flen bytes. Since there are some ap_file_t ++ * implementations/types that are not seekable, it may be impossible to ++ * "rewind" the file's current position after reading the contenxt. ++ * Therefore, it is important to note that once the content has been ++ * read, it must be passed to the next filter in a different form. ++ * ++ * Note: if there is a way to determine whether a file is seekable, then ++ * it would be legal to fetch the current position, read the contents, ++ * rewind to the original position, and then pass this bucket/file down ++ * to the next filter in the output chain. ++ * ++ * This type occurs when ap_send_fd(), ap_send_fd_length(), or ++ * ap_fc_sendfile() are used by the upstream filter/generator. ++ * ++ * AP_BUCKET_EOS: ++ * This bucket signals the end of the content stream. The filter should ++ * flush any internal state and issue errors if the state specifies that ++ * and end of stream cannot occur now (e.g. a command directive is ++ * incomplete). ++ * ++ * This type occurs when Apache finalizes a (sub)request, or when an ++ * upstream filter passes this bucket along. ++ */ ++typedef enum { ++ AP_BUCKET_PTRLEN, ++ AP_BUCKET_STRINGS, ++ AP_BUCKET_PRINTF, ++ AP_BUCKET_FILE, ++ AP_BUCKET_EOS ++} ap_bucket_type; ++ ++/* ++ * ap_bucket_t: ++ * ++ * The actual bucket definition. The type is determined by the ->type field. ++ * Which fields are valid/useful in the bucket is determined by the type, ++ * as noted below and in the comments above for each type. ++ * ++ * Buckets are arranged in a doubly-linked list so that a filter may insert, ++ * remove, or replace elements in a list of buckets. Generally, a filter ++ * should not change any bucket values other than these link pointers. ++ */ ++struct ap_bucket_t { ++ ap_bucket_type type; ++ ++ const char *buf; /* AP_BUCKET_PTRLEN */ ++ apr_size_t len; /* AP_BUCKET_PTRLEN */ ++ ++ const char *fmt; /* AP_BUCKET_PRINTF */ ++ va_list va; /* AP_BUCKET_STRINGS, _PRINTF */ ++ ++ apr_file_t *file; /* AP_BUCKET_FILE */ ++ apr_ssize_t flen; /* AP_BUCKET_FILE */ ++ ++ ap_bucket_t *next; /* next bucket in list */ ++ ap_bucket_t *prev; /* previous bucket in list */ ++}; ++ ++/* ++ * FILTER CHAIN OUTPUT FUNCTIONS ++ * ++ * These functions are used to deliver output/content down to the next ++ * filter in the chain. ++ * ++ * ap_fc_write(): write a block of bytes ++ * ap_fc_putc(): write a single character ++ * ap_fc_puts(): write a null-terminated string ++ * ap_fc_putstrs(): write a set of null-termianted strings; the end is ++ * signaled by a NULL parameter ++ * ap_fc_vputstrs(): same as ap_fc_putstrs(), but where the set of strings ++ * is defined by a va_list ++ * ap_fc_printf(): use printf-like semantics for writing a string ++ * ap_fc_vprintf(): use printf-like semantics, but with a va_list for the args ++ * ap_fc_sendfile(): send the file contents, from the current file position, ++ * and extending for "len" bytes; AP_FC_SENDFILE_ALL is ++ * used to send from current-position to the end-of-file. ++ * ap_fc_putbucket(): write a bucket into the filter chain ++ */ ++API_EXPORT(void) ap_fc_write(ap_filter_t *filter, const char *buf, ++ apr_size_t len); ++API_EXPORT(void) ap_fc_putc(ap_filter_t *filter, int c); ++API_EXPORT(void) ap_fc_puts(ap_filter_t *filter, const char *str); ++ ++API_EXPORT_NONSTD(void) ap_fc_putstrs(ap_filter_t *filter, ...); ++API_EXPORT(void) ap_fc_vputstrs(ap_filter_t *filter, va_list va); ++ ++API_EXPORT_NONSTD(void) ap_fc_printf(ap_filter_t *filter, ++ const char *fmt, ...); ++API_EXPORT(void) ap_fc_vprintf(ap_filter_t *filter, ++ const char *fmt, va_list va); ++ ++API_EXPORT(void) ap_fc_sendfile(ap_filter_t *filter, apr_file_t *file, ++ apr_ssize_t flen); ++#define AP_FC_SENDFILE_ALL ((apr_ssize_t) -1) ++ ++/* note: bucket->next and ->prev may be changed upon return from this */ ++API_EXPORT(void) ap_fc_putbucket(ap_filter_t *filter, ap_bucket_t *bucket); ++ + + /* + * ap_register_filter(): Index: main/http_protocol.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v -retrieving revision 1.95 -diff -u -r1.95 http_protocol.c ---- main/http_protocol.c 2000/07/11 03:48:18 1.95 -+++ main/http_protocol.c 2000/07/12 11:01:10 -@@ -77,6 +77,8 @@ +retrieving revision 1.100 +diff -u -r1.100 http_protocol.c +--- main/http_protocol.c 2000/08/02 05:26:48 1.100 ++++ main/http_protocol.c 2000/08/05 09:48:23 +@@ -77,6 +77,7 @@ + * support code... */ #include "util_date.h" /* For parseHTTPdate and BAD_DATE */ #include "util_charset.h" ++#include "util_filter.h" #include "mpm_status.h" -+#include "ap_filter.h" -+ - #ifdef HAVE_STDARG_H + #ifdef APR_HAVE_STDARG_H #include - #endif -@@ -99,6 +101,9 @@ +@@ -100,7 +101,10 @@ ap_bgetopt (r->connection->client, BO_BYTECT, &r->bytes_sent); \ } while (0) +#define DECL_FILTER_HEAD(r, f) \ + ap_filter_t f = { NULL, (r), NULL, 0, (r)->filters } -+ ++ /* if this is the first error, then log an INFO message and shut down the * connection. -@@ -406,6 +411,9 @@ + */ +@@ -407,6 +411,9 @@ API_EXPORT(int) ap_set_content_length(request_rec *r, long clength) { @@ -50,39 +246,24 @@ diff -u -r1.95 http_protocol.c + return 0; + r->clength = clength; - ap_table_setn(r->headers_out, "Content-Length", ap_psprintf(r->pool, "%ld", clength)); + apr_table_setn(r->headers_out, "Content-Length", apr_psprintf(r->pool, "%ld", clength)); return 0; -@@ -1277,8 +1285,17 @@ - rnew->main = (request_rec *) r; - } +@@ -1280,10 +1287,10 @@ -+static void flush_filters(request_rec *r) -+{ + static void end_output_stream(request_rec *r) + { +- /* +- ** ### place holder to tell filters that no more content will be +- ** ### arriving. typically, they will flush any pending content +- */ + DECL_FILTER_HEAD(r, filter); + ap_bucket_t bucket = { AP_BUCKET_EOS }; + + ap_fc_putbucket(&filter, &bucket); -+} -+ - void ap_finalize_sub_req_protocol(request_rec *sub) - { -+ flush_filters(sub); - SET_BYTES_SENT(sub->main); } -@@ -1832,11 +1849,6 @@ - #endif /*APACHE_XLATE*/ - } - --static void flush_filters(request_rec *r) --{ -- /* ### place holder to flush pending content through the filters */ --} -- - /* finalize_request_protocol is called at completion of sending the - * response. It's sole purpose is to send the terminating protocol - * information for any wrappers around the response message body -@@ -2475,107 +2487,88 @@ + void ap_finalize_sub_req_protocol(request_rec *sub) +@@ -2501,107 +2508,88 @@ API_EXPORT(int) ap_rputc(int c, request_rec *r) { @@ -124,8 +305,8 @@ diff -u -r1.95 http_protocol.c API_EXPORT(int) ap_rwrite(const void *buf, int nbyte, request_rec *r) { -- ap_ssize_t n; -- ap_status_t rv; +- apr_ssize_t n; +- apr_status_t rv; + DECL_FILTER_HEAD(r, filter); if (r->connection->aborted) @@ -168,9 +349,9 @@ diff -u -r1.95 http_protocol.c { va_list va; - int n; -+ -+ DECL_FILTER_HEAD(r, filter); ++ DECL_FILTER_HEAD(r, filter); ++ if (r->connection->aborted) return EOF; @@ -214,7 +395,7 @@ diff -u -r1.95 http_protocol.c } API_EXPORT(int) ap_rflush(request_rec *r) -@@ -2589,6 +2582,210 @@ +@@ -2615,6 +2603,210 @@ return 0; } @@ -231,8 +412,8 @@ diff -u -r1.95 http_protocol.c + n = ap_bputc(*bscan->buf, filter->r->connection->client); + } + else { -+ ap_status_t rv; -+ ap_ssize_t written; ++ apr_status_t rv; ++ apr_ssize_t written; + + /* ### should loop to ensure everything is written */ + rv = ap_bwrite(filter->r->connection->client, bscan->buf, @@ -275,7 +456,7 @@ diff -u -r1.95 http_protocol.c +} + +API_EXPORT(void) ap_fc_write(ap_filter_t *filter, const char *buf, -+ ap_size_t len) ++ apr_size_t len) +{ + ap_filter_t *next; + ap_bucket_t bucket = { AP_BUCKET_PTRLEN, buf, len }; @@ -288,7 +469,7 @@ diff -u -r1.95 http_protocol.c + BUFF_filter_callback(filter, &bucket); + } + else { -+ (*next->bucket_cb)(next, &bucket); ++ (*next->filter_func)(next, &bucket); + } +} + @@ -306,7 +487,7 @@ diff -u -r1.95 http_protocol.c + BUFF_filter_callback(filter, &bucket); + } + else { -+ (*next->bucket_cb)(next, &bucket); ++ (*next->filter_func)(next, &bucket); + } +} + @@ -323,7 +504,7 @@ diff -u -r1.95 http_protocol.c + BUFF_filter_callback(filter, &bucket); + } + else { -+ (*next->bucket_cb)(next, &bucket); ++ (*next->filter_func)(next, &bucket); + } +} + @@ -352,7 +533,7 @@ diff -u -r1.95 http_protocol.c + BUFF_filter_callback(filter, &bucket); + } + else { -+ (*next->bucket_cb)(next, &bucket); ++ (*next->filter_func)(next, &bucket); + } +} + @@ -382,12 +563,12 @@ diff -u -r1.95 http_protocol.c + BUFF_filter_callback(filter, &bucket); + } + else { -+ (*next->bucket_cb)(next, &bucket); ++ (*next->filter_func)(next, &bucket); + } +} + -+API_EXPORT(void) ap_fc_sendfile(ap_filter_t *filter, ap_file_t *file, -+ ap_ssize_t flen) ++API_EXPORT(void) ap_fc_sendfile(ap_filter_t *filter, apr_file_t *file, ++ apr_ssize_t flen) +{ + ap_filter_t *next; + ap_bucket_t bucket = { @@ -402,7 +583,7 @@ diff -u -r1.95 http_protocol.c + BUFF_filter_callback(filter, &bucket); + } + else { -+ (*next->bucket_cb)(next, &bucket); ++ (*next->filter_func)(next, &bucket); + } +} + @@ -418,14 +599,14 @@ diff -u -r1.95 http_protocol.c + BUFF_filter_callback(filter, bucket); + } + else { -+ (*next->bucket_cb)(next, bucket); ++ (*next->filter_func)(next, bucket); + } +} + /* We should have named this send_canned_response, since it is used for any * response that can be generated by the server from the request record. * This includes all 204 (no content), 3xx (redirect), 4xx (client error), -@@ -2977,6 +3174,7 @@ +@@ -3003,6 +3195,7 @@ ap_finalize_request_protocol(r); ap_rflush(r); } @@ -433,77 +614,18 @@ diff -u -r1.95 http_protocol.c AP_IMPLEMENT_HOOK_RUN_ALL(int,post_read_request, (request_rec *r),(r),OK,DECLINED) -Index: main/http_request.c -=================================================================== -RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v -retrieving revision 1.35 -diff -u -r1.35 http_request.c ---- main/http_request.c 2000/06/24 17:33:57 1.35 -+++ main/http_request.c 2000/07/12 11:01:23 -@@ -769,6 +769,9 @@ - rnew->htaccess = r->htaccess; - rnew->per_dir_config = r->server->lookup_defaults; - -+ /* start with the same set of output filters */ -+ rnew->filters = r->filters; -+ - ap_set_sub_req_protocol(rnew, r); - - /* would be nicer to pass "method" to ap_set_sub_req_protocol */ -@@ -857,6 +860,9 @@ - rnew->htaccess = r->htaccess; - rnew->chunked = r->chunked; - -+ /* start with the same set of output filters */ -+ rnew->filters = r->filters; -+ - ap_set_sub_req_protocol(rnew, r); - fdir = ap_make_dirstr_parent(rnew->pool, r->filename); - -@@ -960,16 +966,22 @@ - - API_EXPORT(int) ap_run_sub_req(request_rec *r) - { --#ifndef APACHE_XLATE -- int retval = ap_invoke_handler(r); --#else /*APACHE_XLATE*/ -- /* Save the output conversion setting of the caller across subrequests */ - int retval; -- ap_xlate_t *saved_xlate; - -- ap_bgetopt(r->connection->client, BO_WXLATE, &saved_xlate); -- retval = ap_invoke_handler(r); -- ap_bsetopt(r->connection->client, BO_WXLATE, &saved_xlate); -+ /* see comments in process_request_internal() */ -+ ap_run_insert_filter(r); -+ -+#ifndef APACHE_XLATE -+ retval = ap_invoke_handler(r); -+#else /*APACHE_XLATE*/ -+ { -+ /* Save the output conversion setting across subrequests */ -+ ap_xlate_t *saved_xlate; -+ -+ ap_bgetopt(r->connection->client, BO_WXLATE, &saved_xlate); -+ retval = ap_invoke_handler(r); -+ ap_bsetopt(r->connection->client, BO_WXLATE, &saved_xlate); -+ } - #endif /*APACHE_XLATE*/ - ap_finalize_sub_req_protocol(r); - return retval; -Index: main/Makefile.in +Index: main/util_filter.c =================================================================== -RCS file: /home/cvs/apache-2.0/src/main/Makefile.in,v -retrieving revision 1.16 -diff -u -r1.16 Makefile.in ---- main/Makefile.in 2000/07/01 14:14:15 1.16 -+++ main/Makefile.in 2000/07/12 11:01:35 -@@ -8,7 +8,7 @@ - http_protocol.c http_request.c http_vhost.c util.c util_date.c \ - util_script.c util_uri.c util_md5.c util_cfgtree.c util_ebcdic.c \ - rfc1413.c http_connection.c iol_file.c iol_socket.c listen.c \ -- mpm_common.c util_charset.c util_debug.c util_xml.c -+ mpm_common.c util_charset.c util_debug.c util_xml.c filters.c - - include $(top_srcdir)/build/ltlib.mk - +RCS file: /home/cvs/apache-2.0/src/main/util_filter.c,v +retrieving revision 1.3 +diff -u -r1.3 util_filter.c +--- main/util_filter.c 2000/08/05 04:38:58 1.3 ++++ main/util_filter.c 2000/08/05 09:48:23 +@@ -126,6 +126,7 @@ + f->filter_func = frec->filter_func; + f->ctx = ctx; + f->ftype = frec->ftype; ++ f->r = r; + + if (INSERT_BEFORE(f, r->filters)) { + f->next = r->filters; diff --git a/buckets/register_patch.txt b/buckets/register_patch.txt deleted file mode 100644 index 07c1ae41bfb..00000000000 --- a/buckets/register_patch.txt +++ /dev/null @@ -1,142 +0,0 @@ -Index: Makefile.in -=================================================================== -RCS file: /home/cvs/apache-2.0/src/main/Makefile.in,v -retrieving revision 1.16 -diff -u -r1.16 Makefile.in ---- Makefile.in 2000/07/01 14:14:15 1.16 -+++ Makefile.in 2000/07/25 00:42:50 -@@ -8,7 +8,8 @@ - http_protocol.c http_request.c http_vhost.c util.c util_date.c \ - util_script.c util_uri.c util_md5.c util_cfgtree.c util_ebcdic.c \ - rfc1413.c http_connection.c iol_file.c iol_socket.c listen.c \ -- mpm_common.c util_charset.c util_debug.c util_xml.c -+ mpm_common.c util_charset.c util_debug.c util_xml.c \ -+ util_filter.c - - include $(top_srcdir)/build/ltlib.mk - -Index: httpd.h -=================================================================== -RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v -retrieving revision 1.64 -diff -u -r1.64 httpd.h ---- httpd.h 2000/06/30 21:18:13 1.64 -+++ httpd.h 2000/07/25 00:49:52 -@@ -731,7 +731,9 @@ - #ifdef APACHE_XLATE - struct ap_rr_xlate *rrx; - #endif /*APACHE_XLATE*/ -- -+ -+ struct ap_filter_t *filters; -+ - /* Things placed at the end of the record to avoid breaking binary - * compatibility. It would be nice to remember to reorder the entire - * record to improve 64bit alignment the next time we need to break -Index: http_request.c -=================================================================== -RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v -retrieving revision 1.35 -diff -u -r1.35 http_request.c ---- http_request.c 2000/06/24 17:33:57 1.35 -+++ http_request.c 2000/07/25 00:50:35 -@@ -769,6 +769,9 @@ - rnew->htaccess = r->htaccess; - rnew->per_dir_config = r->server->lookup_defaults; - -+ /* start with the same set of output filters */ -+ rnew->filters = r->filters; -+ - ap_set_sub_req_protocol(rnew, r); - - /* would be nicer to pass "method" to ap_set_sub_req_protocol */ -@@ -857,6 +860,9 @@ - rnew->htaccess = r->htaccess; - rnew->chunked = r->chunked; - -+ /* start with the same set of output filters */ -+ rnew->filters = r->filters; -+ - ap_set_sub_req_protocol(rnew, r); - fdir = ap_make_dirstr_parent(rnew->pool, r->filename); - -@@ -960,16 +966,22 @@ - - API_EXPORT(int) ap_run_sub_req(request_rec *r) - { --#ifndef APACHE_XLATE -- int retval = ap_invoke_handler(r); --#else /*APACHE_XLATE*/ -- /* Save the output conversion setting of the caller across subrequests */ - int retval; -- ap_xlate_t *saved_xlate; - -- ap_bgetopt(r->connection->client, BO_WXLATE, &saved_xlate); -- retval = ap_invoke_handler(r); -- ap_bsetopt(r->connection->client, BO_WXLATE, &saved_xlate); -+ /* see comments in process_request_internal() */ -+ ap_run_insert_filter(r); -+ -+#ifndef APACHE_XLATE -+ retval = ap_invoke_handler(r); -+#else /*APACHE_XLATE*/ -+ { -+ /* Save the output conversion setting across subrequests */ -+ ap_xlate_t *saved_xlate; -+ -+ ap_bgetopt(r->connection->client, BO_WXLATE, &saved_xlate); -+ retval = ap_invoke_handler(r); -+ ap_bsetopt(r->connection->client, BO_WXLATE, &saved_xlate); -+ } - #endif /*APACHE_XLATE*/ - ap_finalize_sub_req_protocol(r); - return retval; -Index: http_protocol.c -=================================================================== -RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v -retrieving revision 1.97 -diff -u -r1.97 http_protocol.c ---- http_protocol.c 2000/07/21 19:50:47 1.97 -+++ http_protocol.c 2000/07/25 11:47:14 -@@ -1278,8 +1278,19 @@ - rnew->main = (request_rec *) r; - } - -+static void end_output_stream(request_rec *r) -+{ -+ /* -+ ** ### place holder to tell filters that no more content will be -+ ** ### arriving. typically, they will flush any pending content -+ */ -+} -+ - void ap_finalize_sub_req_protocol(request_rec *sub) - { -+ /* tell the filter chain there is no more content coming */ -+ end_output_stream(sub); -+ - SET_BYTES_SENT(sub->main); - } - -@@ -1833,11 +1844,6 @@ - #endif /*APACHE_XLATE*/ - } - --static void flush_filters(request_rec *r) --{ -- /* ### place holder to flush pending content through the filters */ --} -- - /* finalize_request_protocol is called at completion of sending the - * response. It's sole purpose is to send the terminating protocol - * information for any wrappers around the response message body -@@ -1845,7 +1851,8 @@ - */ - API_EXPORT(void) ap_finalize_request_protocol(request_rec *r) - { -- flush_filters(r); -+ /* tell the filter chain there is no more content coming */ -+ end_output_stream(r); - - if (r->chunked && !r->connection->aborted) { - #ifdef APACHE_XLATE diff --git a/buckets/util_filter.c b/buckets/util_filter.c deleted file mode 100644 index 228491bca1c..00000000000 --- a/buckets/util_filter.c +++ /dev/null @@ -1,146 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "util_filter.h" - -/* - * ap_filter_rec_t: - * - * This (internal) structure is used for recording information about the - * registered filters. It associates a name with the filter's callback - * and filter type. - * - * At the moment, these are simply linked in a chain, so a ->next pointer - * is available. - */ -typedef struct ap_filter_rec_t { - const char *name; - apr_filter_func filter_func; - ap_filter_type ftype; - - struct ap_filter_rec_t *next; -} ap_filter_rec_t; - -/* ### make this visible for direct manipulation? - ### use a hash table -*/ -static ap_filter_rec_t *registered_filters = NULL; - -/* NOTE: Apache's current design doesn't allow a pool to be passed thu, - so we depend on a global to hold the correct pool -*/ -#define FILTER_POOL ap_global_hook_pool -#include "ap_hooks.h" /* for ap_global_hook_pool */ - -/* -** This macro returns true/false if a given filter should be inserted BEFORE -** another filter. This will happen when one of: 1) there isn't another -** filter; 2) that filter has a higher filter type (class); 3) that filter -** corresponds to a different request. -*/ -#define INSERT_BEFORE(f, before_this) ((before_this) == NULL \ - || (before_this)->ftype > (f)->ftype) - - -static apr_status_t filter_cleanup(void *ctx) -{ - registered_filters = NULL; - return APR_SUCCESS; -} - -API_EXPORT(void) ap_register_filter(const char *name, - apr_filter_func filter_func, - ap_filter_type ftype) -{ - ap_filter_rec_t *frec = apr_palloc(FILTER_POOL, sizeof(*frec)); - - frec->name = name; - frec->filter_func = filter_func; - frec->ftype = ftype; - - frec->next = registered_filters; - registered_filters = frec; - - apr_register_cleanup(FILTER_POOL, NULL, filter_cleanup, NULL); -} - -API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) -{ - ap_filter_rec_t *frec = registered_filters; - - for (; frec != NULL; frec = frec->next) { - if (!strcasecmp(name, frec->name)) { - apr_filter_t *f = apr_pcalloc(r->pool, sizeof(*f)); - - f->filter_func = frec->filter_func; - f->ctx = ctx; - f->ftype = frec->ftype; - - if (INSERT_BEFORE(f, r->filters)) { - f->next = r->filters; - r->filters = f; - } - else { - apr_filter_t *fscan = r->filters; - while (!INSERT_BEFORE(f, fscan->next)) - fscan = fscan->next; - f->next = fscan->next; - fscan->next = f; - } - - break; - } - } -} - diff --git a/buckets/util_filter.h b/buckets/util_filter.h deleted file mode 100644 index 1c523abf93c..00000000000 --- a/buckets/util_filter.h +++ /dev/null @@ -1,220 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef AP_FILTER_H -#define AP_FILTER_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef APR_HAVE_STDARG_H -#include -#endif - -#include "httpd.h" -#include "apr.h" - -/* - * FILTER CHAIN - * - * Filters operate using a "chaining" mechanism. The filters are chained - * together into a sequence. When output is generated, it is passed through - * each of the filters on this chain, until it reaches the end (or "bottom") - * and is placed onto the network. - * - * The top of the chain, the code generating the output, is typically called - * a "content generator." The content generator's output is fed into the - * filter chain using the standard Apache output mechanisms: ap_rputs(), - * ap_rprintf(), ap_rwrite(), etc. - * - * Each filter is defined by a callback. This callback takes the output from - * the previous filter (or the content generator if there is no previous - * filter), operates on it, and passes the result to the next filter in the - * chain. This pass-off is performed using the ap_fc_* functions, such as - * ap_fc_puts(), ap_fc_printf(), ap_fc_write(), etc. - * - * When content generation is complete, the system will pass an "end of - * stream" marker into the filter chain. The filters will use this to flush - * out any internal state and to detect incomplete syntax (for example, an - * unterminated SSI directive). - */ - -/* forward declare the filter type */ -typedef struct apr_filter_t apr_filter_t; - -/* - * apr_filter_func: - * - * This function type is used for filter callbacks. It will be passed a - * pointer to "this" filter, and a "bucket" containing the content to be - * filtered. - * - * In filter->ctx, the callback will find its context. This context is - * provided here, so that a filter may be installed multiple times, each - * receiving its own per-install context pointer. - * - * Callbacks are associated with a filter definition, which is specified - * by name. See ap_register_filter() for setting the association between - * a name for a filter and its associated callback (and other information). - * - * The *bucket structure (and all those referenced by ->next and ->prev) - * should be considered "const". The filter is allowed to modify the - * next/prev to insert/remove/replace elements in the bucket list, but - * the types and values of the individual buckets should not be altered. - */ -typedef apr_status_t (*apr_filter_func)(); - -/* - * ap_filter_type: - * - * Filters have different types/classifications. These are used to group - * and sort the filters to properly sequence their operation. - * - * AP_FTYPE_CONTENT: - * These filters are used to alter the content that is passed through - * them. Examples are SSI or PHP. - * - * AP_FTYPE_CONNECTION: - * These filters will alter the content, but in ways that are more - * strongly associated with the output connection. Examples are - * compression, character recoding, or chunked transfer coding. - * - * It is important to note that these types of filters are not allowed - * in a sub-request. A sub-requests output can certainly be filtered - * by AP_FTYPE_CONTENT filters, but all of the "final processing" is - * determined by the main request. - * - * The types have a particular sort order, which allows us to insert them - * into the filter chain in a determistic order. Within a particular grouping, - * the ordering is equivalent to the order of calls to ap_add_filter(). - */ -typedef enum { - AP_FTYPE_CONTENT, - AP_FTYPE_CONNECTION -} ap_filter_type; - -/* - * apr_filter_t: - * - * This is the request-time context structure for an installed filter (in - * the output filter chain). It provides the callback to use for filtering, - * the request this filter is associated with (which is important when - * an output chain also includes sub-request filters), the context for this - * installed filter, and the filter ordering/chaining fields. - * - * Filter callbacks are free to use ->ctx as they please, to store context - * during the filter process. Generally, this is superior over associating - * the state directly with the request. A callback should not change any of - * the other fields. - */ -struct apr_filter_t { - apr_filter_func filter_func; - - void *ctx; - - ap_filter_type ftype; - apr_filter_t *next; -}; - -/* - * ap_register_filter(): - * - * This function is used to register a filter with the system. After this - * registration is performed, then a filter may be added into the filter - * chain by using ap_add_filter() and simply specifying the name. - * - * The filter's callback and type should be passed. - */ -API_EXPORT(void) ap_register_filter(const char *name, - apr_filter_func filter_func, - ap_filter_type ftype); - -/* - * ap_add_filter(): - * - * Adds a named filter into the filter chain on the specified request record. - * The filter will be installed with the specified context pointer. - * - * Filters added in this way will always be placed at the end of the filters - * that have the same type (thus, the filters have the same order as the - * calls to ap_add_filter). If the current filter chain contains filters - * from another request, then this filter will be added before those other - * filters. - */ -API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r); - - -/* - * Things to do later: - * Add parameters to apr_filter_func type. Those parameters will be something - * like: - * (request_rec *r, apr_filter_t *filter, ap_data_list *the_data) - * obviously, the request_rec is the current request, and the filter - * is the current filter stack. The data_list is a bucket list or - * bucket_brigade, but I am trying to keep this patch neutral. (If this - * comment breaks that, well sorry, but the information must be there - * somewhere. :-) - * - * Add a function like ap_pass_data. This function will basically just - * call the next filter in the chain, until the current filter is NULL. If the - * current filter is NULL, that means that nobody wrote to the network, and - * we have a HUGE bug, so we need to return an error and log it to the - * log file. - */ -#ifdef __cplusplus -} -#endif - -#endif /* !AP_FILTER_H */ From 03522058bbcc64a9c902af7cf4dd4d383a435471 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 5 Aug 2000 15:01:46 +0000 Subject: [PATCH 0504/7878] Fix the patch after Jeff removed the last apr_filter* from the request_rec. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60480 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/ryan.patch | 9 --------- 1 file changed, 9 deletions(-) diff --git a/buckets/ryan.patch b/buckets/ryan.patch index 1d45c410b84..6e41d0a913b 100644 --- a/buckets/ryan.patch +++ b/buckets/ryan.patch @@ -83,15 +83,6 @@ diff -u -d -b -w -u -r1.69 httpd.h /* Info about the request itself... we begin with stuff that only * protocol.c should ever touch... */ -@@ -725,7 +729,7 @@ - struct ap_rr_xlate *rrx; - #endif /*APACHE_XLATE*/ - -- struct apr_filter_t *filters; -+ struct ap_filter_t *filters; - - /* Things placed at the end of the record to avoid breaking binary - * compatibility. It would be nice to remember to reorder the entire Index: src/include/util_filter.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/util_filter.h,v From 17c6dfe8de95b847b81b4b2bb79deabe867d9d6e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 6 Aug 2000 06:07:33 +0000 Subject: [PATCH 0505/7878] 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/apr/apr/trunk@60481 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 +++ aprlib.def | 18 +++++------ aprlib.dsp | 4 +++ file_io/os2/dir.c | 7 ++-- file_io/os2/fileio.h | 3 +- file_io/os2/filestat.c | 11 ++++--- file_io/os2/readwrite.c | 2 +- file_io/unix/dir.c | 4 +-- file_io/unix/filestat.c | 22 ++++++------- file_io/unix/readwrite.c | 4 +-- file_io/win32/dir.c | 2 +- file_io/win32/fileio.h | 12 +++---- file_io/win32/filestat.c | 8 ++--- file_io/win32/open.c | 4 +-- file_io/win32/pipe.c | 14 ++++---- i18n/unix/xlate.c | 24 +++++++------- include/apr.h.in | 8 ++--- include/apr.hw | 4 +-- include/apr_compat.h | 37 +++++++++++++++++++++ include/apr_file_io.h | 8 ++--- include/apr_getopt.h | 10 +++--- include/apr_hash.h | 6 ++-- include/apr_lib.h | 38 +++++++++++----------- include/apr_md5.h | 27 ++++++++-------- include/apr_network_io.h | 10 +++--- include/apr_pools.h | 40 +++++++++++------------ include/apr_portable.h | 24 ++++++++------ include/apr_tables.h | 12 +++---- include/apr_thread_proc.h | 4 +-- include/apr_time.h | 28 ++++++++-------- include/apr_xlate.h | 46 +++++++++++++------------- include/arch/os2/fileio.h | 3 +- include/arch/unix/misc.h | 37 ++++++++++----------- include/arch/win32/fileio.h | 12 +++---- include/arch/win32/misc.h | 37 ++++++++++----------- lib/apr_pools.c | 14 ++++---- lib/apr_signal.c | 2 +- libapr.def | 18 +++++------ locks/beos/crossproc.c | 2 +- locks/beos/intraproc.c | 2 +- memory/unix/apr_pools.c | 14 ++++---- misc/unix/errorcodes.c | 4 +-- misc/unix/getopt.c | 64 ++++++++++++++++++------------------- misc/unix/misc.h | 37 ++++++++++----------- misc/win32/misc.c | 4 +-- misc/win32/names.c | 6 ++-- network_io/beos/poll.c | 4 +-- network_io/beos/sendrecv.c | 4 +-- network_io/beos/sockets.c | 2 +- network_io/os2/poll.c | 2 +- network_io/os2/sockets.c | 2 +- network_io/unix/poll.c | 4 +-- network_io/unix/sendrecv.c | 4 +-- network_io/unix/sockets.c | 2 +- network_io/win32/poll.c | 4 +-- network_io/win32/sockets.c | 2 +- passwd/apr_md5.c | 32 +++++++++++-------- strings/apr_cpystrn.c | 12 +++---- strings/apr_fnmatch.c | 8 ++--- strings/apr_snprintf.c | 43 +++++++++++++------------ tables/apr_hash.c | 36 ++++++++++----------- tables/apr_tables.c | 36 ++++++++++----------- test/client.c | 2 +- test/testargs.c | 6 ++-- test/testfile.c | 2 +- test/testmd5.c | 8 ++--- test/testpipe.c | 2 +- test/testsf.c | 2 +- test/testtime.c | 2 +- threadproc/beos/proc.c | 2 +- threadproc/os2/proc.c | 4 +-- threadproc/os2/thread.c | 8 +++-- threadproc/unix/proc.c | 2 +- threadproc/win32/proc.c | 23 ++++++------- threadproc/win32/signals.c | 2 +- time/unix/time.c | 50 +++++++++++++++-------------- time/unix/timestr.c | 18 +++++------ time/win32/access.c | 30 ++++++++--------- time/win32/time.c | 27 ++++++++-------- time/win32/timestr.c | 18 +++++------ 80 files changed, 588 insertions(+), 518 deletions(-) diff --git a/apr.dsp b/apr.dsp index fd30b5d352b..a566768973e 100644 --- a/apr.dsp +++ b/apr.dsp @@ -364,6 +364,10 @@ InputPath=.\include\apr.hw # End Source File # Begin Source File +SOURCE=.\include\apr_compat.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_dso.h # End Source File # Begin Source File diff --git a/aprlib.def b/aprlib.def index dbf1cdb1d2b..118cd997d83 100644 --- a/aprlib.def +++ b/aprlib.def @@ -118,7 +118,7 @@ EXPORTS ; apr_get_os_proc @109 apr_get_os_thread @110 apr_get_os_threadkey @111 - ap_os_systemcase_filename @112 + apr_os_systemcase_filename @112 canonical_filename @113 apr_create_pool @114 apr_clear_pool @115 @@ -128,13 +128,13 @@ EXPORTS apr_set_userdata @119 apr_initialize @120 apr_getopt @121 - ap_opterr @122 DATA - ap_optind @123 DATA - ap_optopt @124 DATA - ap_optreset @125 DATA - ap_optarg @126 DATA + apr_opterr @122 DATA + apr_optind @123 DATA + apr_optopt @124 DATA + apr_optreset @125 DATA + apr_optarg @126 DATA ; apr_make_time @127 - apr_ansi_time_to_ap_time @127 + apr_ansi_time_to_apr_time @127 ; apr_current_time @128 apr_now @128 ; apr_explode_time @129 @@ -242,8 +242,8 @@ EXPORTS apr_dso_sym @221 ; apr_dso_init @222 apr_collapse_spaces @223 - ap_month_snames @224 - ap_day_snames @225 + apr_month_snames @224 + apr_day_snames @225 apr_canonical_error @226 apr_strerror @227 apr_generate_random_bytes @228 diff --git a/aprlib.dsp b/aprlib.dsp index fd30b5d352b..a566768973e 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -364,6 +364,10 @@ InputPath=.\include\apr.hw # End Source File # Begin Source File +SOURCE=.\include\apr_compat.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_dso.h # End Source File # Begin Source File diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 05674c69edf..84529ba9eab 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -172,7 +172,8 @@ apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir) apr_status_t apr_dir_entry_mtime(apr_time_t *time, apr_dir_t *thedir) { if (thedir->validentry) { - ap_os2_time_to_ap_time(time, thedir->entry.fdateLastWrite, thedir->entry.ftimeLastWrite); + apr_os2_time_to_apr_time(time, thedir->entry.fdateLastWrite, + thedir->entry.ftimeLastWrite); return APR_SUCCESS; } @@ -181,12 +182,12 @@ apr_status_t apr_dir_entry_mtime(apr_time_t *time, apr_dir_t *thedir) -apr_status_t apr_dir_entry_ftype(ap_filetype_e *type, apr_dir_t *thedir) +apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) { int rc; HFILE hFile; ULONG action, Type, Attr; - ap_filetype_e typemap[8] = { APR_REG, APR_CHR, APR_PIPE }; + apr_filetype_e typemap[8] = { APR_REG, APR_CHR, APR_PIPE }; if (thedir->validentry) { if (thedir->entry.attrFile & FILE_DIRECTORY) { diff --git a/file_io/os2/fileio.h b/file_io/os2/fileio.h index 6aa1be1c5ee..5051cacc9ab 100644 --- a/file_io/os2/fileio.h +++ b/file_io/os2/fileio.h @@ -97,7 +97,8 @@ struct apr_dir_t { }; apr_status_t apr_file_cleanup(void *); -apr_status_t ap_os2_time_to_ap_time(apr_time_t *result, FDATE os2date, FTIME os2time); +apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, + FTIME os2time); #endif /* ! FILE_IO_H */ diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 43dc3f1524a..544f95ad41f 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -75,14 +75,17 @@ static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus) finfo->inode = 0; finfo->device = 0; finfo->size = fstatus->cbFile; - ap_os2_time_to_ap_time(&finfo->atime, fstatus->fdateLastAccess, fstatus->ftimeLastAccess ); - ap_os2_time_to_ap_time(&finfo->mtime, fstatus->fdateLastWrite, fstatus->ftimeLastWrite ); - ap_os2_time_to_ap_time(&finfo->ctime, fstatus->fdateCreation, fstatus->ftimeCreation ); + apr_os2_time_to_apr_time(&finfo->atime, fstatus->fdateLastAccess, + fstatus->ftimeLastAccess ); + apr_os2_time_to_apr_time(&finfo->mtime, fstatus->fdateLastWrite, + fstatus->ftimeLastWrite ); + apr_os2_time_to_apr_time(&finfo->ctime, fstatus->fdateCreation, + fstatus->ftimeCreation ); } -static apr_status_t handle_type(ap_filetype_e *ftype, HFILE file) +static apr_status_t handle_type(apr_filetype_e *ftype, HFILE file) { ULONG filetype, fileattr, rc; diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 5bf040ac32e..310e2df9aa4 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -346,7 +346,7 @@ APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) -apr_status_t ap_file_check_read(apr_file_t *fd) +apr_status_t apr_file_check_read(apr_file_t *fd) { int rc; diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 2bddb4a313d..bfbf85ab384 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -200,11 +200,11 @@ apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir) return errno; } - apr_ansi_time_to_ap_time(mtime, filestat.st_mtime); + apr_ansi_time_to_apr_time(mtime, filestat.st_mtime); return APR_SUCCESS; } -apr_status_t apr_dir_entry_ftype(ap_filetype_e *type, apr_dir_t *thedir) +apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) { struct stat filestat; char *fname = NULL; diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 07fc4281f42..0e14fdafd25 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -57,9 +57,9 @@ #include "apr_general.h" #include "apr_errno.h" -static ap_filetype_e filetype_from_mode(int mode) +static apr_filetype_e filetype_from_mode(int mode) { - ap_filetype_e type = APR_NOFILE; + apr_filetype_e type = APR_NOFILE; if (S_ISREG(mode)) type = APR_REG; @@ -92,9 +92,9 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) finfo->size = info.st_size; finfo->inode = info.st_ino; finfo->device = info.st_dev; - apr_ansi_time_to_ap_time(&finfo->atime, info.st_atime); - apr_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); - apr_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); + apr_ansi_time_to_apr_time(&finfo->atime, info.st_atime); + apr_ansi_time_to_apr_time(&finfo->mtime, info.st_mtime); + apr_ansi_time_to_apr_time(&finfo->ctime, info.st_ctime); return APR_SUCCESS; } else { @@ -123,9 +123,9 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) finfo->size = info.st_size; finfo->inode = info.st_ino; finfo->device = info.st_dev; - apr_ansi_time_to_ap_time(&finfo->atime, info.st_atime); - apr_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); - apr_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); + apr_ansi_time_to_apr_time(&finfo->atime, info.st_atime); + apr_ansi_time_to_apr_time(&finfo->mtime, info.st_mtime); + apr_ansi_time_to_apr_time(&finfo->ctime, info.st_ctime); return APR_SUCCESS; } else { @@ -145,9 +145,9 @@ apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) finfo->size = info.st_size; finfo->inode = info.st_ino; finfo->device = info.st_dev; - apr_ansi_time_to_ap_time(&finfo->atime, info.st_atime); - apr_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); - apr_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); + apr_ansi_time_to_apr_time(&finfo->atime, info.st_atime); + apr_ansi_time_to_apr_time(&finfo->mtime, info.st_mtime); + apr_ansi_time_to_apr_time(&finfo->ctime, info.st_ctime); return APR_SUCCESS; } else { diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 6fdb136c27f..f013f0f89e1 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -74,8 +74,8 @@ static apr_status_t wait_for_io_or_timeout(apr_file_t *file, int for_read) FD_ZERO(&fdset); FD_SET(file->filedes, &fdset); if (file->timeout >= 0) { - tv.tv_sec = file->timeout / AP_USEC_PER_SEC; - tv.tv_usec = file->timeout % AP_USEC_PER_SEC; + tv.tv_sec = file->timeout / APR_USEC_PER_SEC; + tv.tv_usec = file->timeout % APR_USEC_PER_SEC; tvptr = &tv; } else { diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index a9ce5d3fa02..2d0d6accb4f 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -179,7 +179,7 @@ apr_status_t apr_dir_entry_mtime(apr_time_t *time, apr_dir_t *thedir) return APR_SUCCESS; } -apr_status_t apr_dir_entry_ftype(ap_filetype_e *type, apr_dir_t *thedir) +apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) { switch(thedir->entry->dwFileAttributes) { case FILE_ATTRIBUTE_DIRECTORY: { diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index bfdda74213e..661154ead16 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -92,7 +92,7 @@ * fname -- the filename as passed to the open call. * dwFileAttricutes -- Attributes used to open the file. * demonfname -- the canonicalized filename. Used to store the result from - * ap_os_canonicalize_filename. + * apr_os_canonicalize_filename. * lowerdemonfname -- inserted at Ken Parzygnat's request, because of the * ugly way windows deals with case in the filesystem. * append -- Windows doesn't support the append concept when opening files. @@ -143,12 +143,12 @@ struct apr_dir_t { apr_status_t file_cleanup(void *); /*mode_t get_fileperms(apr_fileperms_t); */ -APR_EXPORT(char *) ap_os_systemcase_filename(struct apr_pool_t *pCont, - const char *szFile); +APR_EXPORT(char *) apr_os_systemcase_filename(struct apr_pool_t *pCont, + const char *szFile); char * canonical_filename(struct apr_pool_t *pCont, const char *szFile); -apr_status_t ap_create_nt_pipe(apr_file_t **in, apr_file_t **out, - BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, - apr_pool_t *p); +apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, + BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, + apr_pool_t *p); #endif /* ! FILE_IO_H */ diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 05082aacdac..2477cf94de0 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -66,9 +66,9 @@ #define S_ISREG(m) (((m) & (S_IFMT)) == S_IFREG) #define S_ISDIR(m) (((m) & (S_IFDIR)) == S_IFDIR) -static ap_filetype_e filetype_from_mode(int mode) +static apr_filetype_e filetype_from_mode(int mode) { - ap_filetype_e type = APR_NOFILE; + apr_filetype_e type = APR_NOFILE; if (S_ISREG(mode)) type = APR_REG; @@ -194,7 +194,7 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) */ WIN32_FIND_DATA FileInformation; HANDLE hFind; - ap_oslevel_e os_level; + apr_oslevel_e os_level; apr_status_t rv = APR_SUCCESS; memset(finfo,'\0', sizeof(*finfo)); @@ -208,7 +208,7 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) if (strlen(fname) >= MAX_PATH) { rv = ERROR_FILENAME_EXCED_RANGE; } - else if (!ap_get_oslevel(cont, &os_level) && os_level >= APR_WIN_98) { + else if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_98) { if (!GetFileAttributesEx(fname, GetFileExInfoStandard, (WIN32_FILE_ATTRIBUTE_DATA*) &FileInformation)) { rv = GetLastError(); diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 689453a0b0c..b303465b56d 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -82,7 +82,7 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, DWORD createflags = 0; DWORD attributes = 0; DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE; - ap_oslevel_e level; + apr_oslevel_e level; apr_status_t rv; if ((*new) == NULL) { @@ -117,7 +117,7 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, (*new)->demonfname = canonical_filename((*new)->cntxt, fname); (*new)->lowerdemonfname = strlwr((*new)->demonfname); - if (ap_get_oslevel(cont, &level) == APR_SUCCESS && level >= APR_WIN_NT) { + if (apr_get_oslevel(cont, &level) == APR_SUCCESS && level >= APR_WIN_NT) { sharemode |= FILE_SHARE_DELETE; } diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 732ba577f95..19c9e557b05 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -108,10 +108,10 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p) return APR_SUCCESS; } -/* ap_create_nt_pipe() +/* apr_create_nt_pipe() * An internal (for now) APR function created for use by apr_create_process() * when setting up pipes to communicate with the child process. - * ap_create_nt_pipe() allows setting the blocking mode of each end of + * apr_create_nt_pipe() allows setting the blocking mode of each end of * the pipe when the pipe is created (rather than after the pipe is created). * A pipe handle must be opened in full async i/o mode in order to * emulate Unix non-blocking pipes with timeouts. @@ -128,11 +128,11 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p) * * wgs */ -apr_status_t ap_create_nt_pipe(apr_file_t **in, apr_file_t **out, - BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, - apr_pool_t *p) +apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, + BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, + apr_pool_t *p) { - ap_oslevel_e level; + apr_oslevel_e level; SECURITY_ATTRIBUTES sa; static unsigned long id = 0; DWORD dwPipeMode; @@ -169,7 +169,7 @@ apr_status_t ap_create_nt_pipe(apr_file_t **in, apr_file_t **out, (*out)->direction = 0; (*out)->pOverlapped = NULL; - if (ap_get_oslevel(p, &level) == APR_SUCCESS && level >= APR_WIN_NT) { + if (apr_get_oslevel(p, &level) == APR_SUCCESS && level >= APR_WIN_NT) { /* Create the read end of the pipe */ dwOpenMode = PIPE_ACCESS_INBOUND; if (bAsyncRead) { diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 8af33873e93..acd2e58c1a7 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -156,7 +156,7 @@ static const char *handle_special_names(const char *page) } } -static apr_status_t ap_xlate_cleanup(void *convset) +static apr_status_t apr_xlate_cleanup(void *convset) { #ifdef HAVE_ICONV apr_xlate_t *old = convset; @@ -203,8 +203,8 @@ static void check_sbcs(apr_xlate_t *convset) } #endif /* HAVE_ICONV */ -apr_status_t ap_xlate_open(apr_xlate_t **convset, const char *topage, - const char *frompage, apr_pool_t *pool) +apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, + const char *frompage, apr_pool_t *pool) { apr_status_t status; apr_xlate_t *new; @@ -248,7 +248,7 @@ apr_status_t ap_xlate_open(apr_xlate_t **convset, const char *topage, if (found) { *convset = new; - apr_register_cleanup(pool, (void *)new, ap_xlate_cleanup, + apr_register_cleanup(pool, (void *)new, apr_xlate_cleanup, apr_null_cleanup); status = APR_SUCCESS; } @@ -260,15 +260,15 @@ apr_status_t ap_xlate_open(apr_xlate_t **convset, const char *topage, return status; } -apr_status_t ap_xlate_get_sb(apr_xlate_t *convset, int *onoff) +apr_status_t apr_xlate_get_sb(apr_xlate_t *convset, int *onoff) { *onoff = convset->sbcs_table != NULL; return APR_SUCCESS; } -apr_status_t ap_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, - apr_size_t *inbytes_left, char *outbuf, - apr_size_t *outbytes_left) +apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, + apr_size_t *inbytes_left, char *outbuf, + apr_size_t *outbytes_left) { apr_status_t status = APR_SUCCESS; #ifdef HAVE_ICONV @@ -329,7 +329,7 @@ apr_status_t ap_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, return status; } -apr_int32_t ap_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar) +apr_int32_t apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar) { if (convset->sbcs_table) { return convset->sbcs_table[inchar]; @@ -339,12 +339,12 @@ apr_int32_t ap_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar) } } -apr_status_t ap_xlate_close(apr_xlate_t *convset) +apr_status_t apr_xlate_close(apr_xlate_t *convset) { apr_status_t status; - if ((status = ap_xlate_cleanup(convset)) == APR_SUCCESS) { - apr_kill_cleanup(convset->pool, convset, ap_xlate_cleanup); + if ((status = apr_xlate_cleanup(convset)) == APR_SUCCESS) { + apr_kill_cleanup(convset->pool, convset, apr_xlate_cleanup); } return status; diff --git a/include/apr.h.in b/include/apr.h.in index 8f903fd2a2c..42e853b9d79 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -15,11 +15,11 @@ #if !defined(__GNUC__) || __GNUC__ < 2 || \ (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\ defined(NEXT) -#define ap_inline +#define apr_inline #define __attribute__(__x) #define ENUM_BITFIELD(e,n,w) signed int n : w #else -#define ap_inline __inline__ +#define apr_inline __inline__ #define USE_GNU_INLINE #define ENUM_BITFIELD(e,n,w) e n : w #endif @@ -158,12 +158,12 @@ Sigfunc *apr_signal(int signo, Sigfunc * func); #include #ifdef WEXITSTATUS -#define ap_wait_t int +#define apr_wait_t int #else /* We don't have a POSIX wait interface. Assume we have the old-style. Is this * a bad assumption? */ /* Yessiree bob, it was... but will this work instead? */ -#define ap_wait_t union wait +#define apr_wait_t union wait #define WEXITSTATUS(status) (int)((status).w_retcode) #define WTERMSIG(status) (int)((status).w_termsig) #endif /* !WEXITSTATUS */ diff --git a/include/apr.hw b/include/apr.hw index 1f6f31843b3..2e151108bea 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -109,7 +109,7 @@ #include #include -#define ap_inline +#define apr_inline #define __attribute__(__x) #define ENUM_BITFIELD(e,n,w) signed int n : w @@ -199,7 +199,7 @@ typedef int gid_t; #define apr_signal(a,b) signal(a,b) -typedef int ap_wait_t; +typedef int apr_wait_t; /* struct iovec is needed to emulate Unix writev */ struct iovec { diff --git a/include/apr_compat.h b/include/apr_compat.h index 31a99e466aa..e291a325fd3 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -3,12 +3,16 @@ /* redefine 1.3.x symbols to those that now live in libapr */ +#define ap_inline apr_inline + +#define ap_md5_ctx_t apr_md5_ctx_t #define ap_MD5Encode apr_MD5Encode #define ap_MD5Final apr_MD5Final #define ap_MD5Init apr_MD5Init #define ap_MD5Update apr_MD5Update #define ap_append_arrays apr_append_arrays #define ap_array_cat apr_array_cat +#define ap_array_header_t apr_array_header_t #define ap_array_pstrcat apr_array_pstrcat #define ap_bytes_in_free_blocks apr_bytes_in_free_blocks #define ap_bytes_in_pool apr_bytes_in_pool @@ -19,20 +23,31 @@ #define ap_copy_array_hdr apr_copy_array_hdr #define ap_copy_table apr_copy_table #define ap_cpystrn apr_cpystrn +#define ap_day_snames apr_day_snames #define ap_destroy_pool apr_destroy_pool +#define ap_exploded_time_t apr_exploded_time_t #define ap_fnmatch apr_fnmatch +#define ap_inet_addr apr_inet_addr #define ap_init_alloc apr_init_alloc +#define ap_is_empty_table apr_is_empty_table #define ap_is_fnmatch apr_is_fnmatch #define ap_kill_cleanup apr_kill_cleanup #define ap_make_array apr_make_array #define ap_make_sub_pool apr_make_sub_pool #define ap_make_table apr_make_table +#define ap_month_snames apr_month_snames #define ap_note_subprocess apr_note_subprocess #define ap_null_cleanup apr_null_cleanup +#define ap_optarg apr_optarg +#define ap_opterr apr_opterr +#define ap_optind apr_optind +#define ap_optopt apr_optopt +#define ap_optreset apr_optreset #define ap_overlap_tables apr_overlap_tables #define ap_overlay_tables apr_overlay_tables #define ap_palloc apr_palloc #define ap_pcalloc apr_pcalloc +#define ap_pool_join apr_pool_join #define ap_psprintf apr_psprintf #define ap_pstrcat apr_pstrcat #define ap_pstrdup apr_pstrdup @@ -47,6 +62,7 @@ #define ap_table_add apr_table_add #define ap_table_addn apr_table_addn #define ap_table_do apr_table_do +#define ap_table_elts apr_table_elts #define ap_table_get apr_table_get #define ap_table_merge apr_table_merge #define ap_table_mergen apr_table_mergen @@ -57,5 +73,26 @@ #define ap_validate_password apr_validate_password #define ap_vformatter apr_vformatter #define ap_vsnprintf apr_vsnprintf +#define ap_wait_t apr_wait_t + +#define ap_isalnum apr_isalnum +#define ap_isalpha apr_isalpha +#define ap_iscntrl apr_iscntrl +#define ap_isdigit apr_isdigit +#define ap_isgraph apr_isgraph +#define ap_islower apr_islower +#define ap_isascii apr_isascii +#define ap_isprint apr_isprint +#define ap_ispunct apr_ispunct +#define ap_isspace apr_isspace +#define ap_isupper apr_isupper +#define ap_isxdigit apr_isxdigit +#define ap_tolower apr_tolower +#define ap_toupper apr_toupper + +#define AP_USEC_PER_SEC APR_USEC_PER_SEC +#define AP_RFC822_DATE_LEN APR_RFC822_DATE_LEN +#define AP_OVERLAP_TABLES_MERGE APR_OVERLAP_TABLES_MERGE +#define AP_OVERLAP_TABLES_SET APR_OVERLAP_TABLES_SET #endif /* APR_COMPAT_H */ diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 984c0ab737e..eb31de3a0aa 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -71,7 +71,7 @@ extern "C" { */ typedef enum {APR_NOFILE, APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, APR_LNK, - APR_SOCK} ap_filetype_e; + APR_SOCK} apr_filetype_e; /* Flags for apr_open */ #define APR_READ 1 /* Open the file for reading */ @@ -129,7 +129,7 @@ struct apr_finfo_t { /** The type of file. One of APR_NOFILE, APR_REG, APR_DIR, APR_CHR, * APR_BLK, APR_PIPE, APR_LNK, APR_SOCK */ - ap_filetype_e filetype; + apr_filetype_e filetype; /** The user id that owns the file */ apr_uid_t user; /** The group id that owns the file */ @@ -261,7 +261,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes * @param thefile The file descriptor to write to. * @param vec The array from which to get the data to write to the file. * @param nvec The number of elements in the struct iovec array. This must - * be smaller than AP_MAX_IOVEC_SIZE. If it isn't, the function + * be smaller than APR_MAX_IOVEC_SIZE. If it isn't, the function * will fail with APR_EINVAL. * @param nbytes The number of bytes written. * @tip It is possible for both bytes to be written and an error to be returned. @@ -536,7 +536,7 @@ apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir); * @param type the file type of the directory entry. * @param thedir the currently open directory. */ -apr_status_t apr_dir_entry_ftype(ap_filetype_e *type, apr_dir_t *thedir); +apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir); /** * Write a string to a file using a printf format. diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 55266153a10..0abb5786566 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -56,12 +56,12 @@ #define APR_GETOPT_H APR_VAR_IMPORT int - ap_opterr, /* if error message should be printed */ - ap_optind, /* index into parent argv vector */ - ap_optopt, /* character checked for validity */ - ap_optreset; /* reset getopt */ + apr_opterr, /* if error message should be printed */ + apr_optind, /* index into parent argv vector */ + apr_optopt, /* character checked for validity */ + apr_optreset; /* reset getopt */ APR_VAR_IMPORT char * - ap_optarg; /* argument associated with option */ + apr_optarg; /* argument associated with option */ /** * Parse the command line options passed to the program. diff --git a/include/apr_hash.h b/include/apr_hash.h index bab59807b30..5bb50c0f2fa 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -56,8 +56,8 @@ * University of Illinois, Urbana-Champaign. */ -#ifndef ap_HASH_H -#define ap_HASH_H +#ifndef APR_HASH_H +#define APR_HASH_H #ifdef __cplusplus extern "C" { @@ -164,4 +164,4 @@ APR_EXPORT(void) apr_hash_this(apr_hash_index_t *hi, const void **key, } #endif -#endif /* !ap_HASH_H */ +#endif /* !APR_HASH_H */ diff --git a/include/apr_lib.h b/include/apr_lib.h index 3e4c84bd57e..7b5f362145c 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -114,20 +114,20 @@ APR_EXPORT(const char *) apr_filename_of_pathname(const char *pathname); * that's legacy libc for ya. These new macros do not support EOF like * the standard macros do. Tough. */ -#define ap_isalnum(c) (isalnum(((unsigned char)(c)))) -#define ap_isalpha(c) (isalpha(((unsigned char)(c)))) -#define ap_iscntrl(c) (iscntrl(((unsigned char)(c)))) -#define ap_isdigit(c) (isdigit(((unsigned char)(c)))) -#define ap_isgraph(c) (isgraph(((unsigned char)(c)))) -#define ap_islower(c) (islower(((unsigned char)(c)))) -#define ap_isascii(c) (isascii(((unsigned char)(c)))) -#define ap_isprint(c) (isprint(((unsigned char)(c)))) -#define ap_ispunct(c) (ispunct(((unsigned char)(c)))) -#define ap_isspace(c) (isspace(((unsigned char)(c)))) -#define ap_isupper(c) (isupper(((unsigned char)(c)))) -#define ap_isxdigit(c) (isxdigit(((unsigned char)(c)))) -#define ap_tolower(c) (tolower(((unsigned char)(c)))) -#define ap_toupper(c) (toupper(((unsigned char)(c)))) +#define apr_isalnum(c) (isalnum(((unsigned char)(c)))) +#define apr_isalpha(c) (isalpha(((unsigned char)(c)))) +#define apr_iscntrl(c) (iscntrl(((unsigned char)(c)))) +#define apr_isdigit(c) (isdigit(((unsigned char)(c)))) +#define apr_isgraph(c) (isgraph(((unsigned char)(c)))) +#define apr_islower(c) (islower(((unsigned char)(c)))) +#define apr_isascii(c) (isascii(((unsigned char)(c)))) +#define apr_isprint(c) (isprint(((unsigned char)(c)))) +#define apr_ispunct(c) (ispunct(((unsigned char)(c)))) +#define apr_isspace(c) (isspace(((unsigned char)(c)))) +#define apr_isupper(c) (isupper(((unsigned char)(c)))) +#define apr_isxdigit(c) (isxdigit(((unsigned char)(c)))) +#define apr_tolower(c) (tolower(((unsigned char)(c)))) +#define apr_toupper(c) (toupper(((unsigned char)(c)))) /* * Small utility macros to make things easier to read. Not usually a @@ -135,12 +135,12 @@ APR_EXPORT(const char *) apr_filename_of_pathname(const char *pathname); */ #ifdef WIN32 -#define ap_killpg(x, y) +#define apr_killpg(x, y) #else /* WIN32 */ #ifdef NO_KILLPG -#define ap_killpg(x, y) (kill (-(x), (y))) +#define apr_killpg(x, y) (kill (-(x), (y))) #else /* NO_KILLPG */ -#define ap_killpg(x, y) (killpg ((x), (y))) +#define apr_killpg(x, y) (killpg ((x), (y))) #endif /* NO_KILLPG */ #endif /* WIN32 */ @@ -166,9 +166,9 @@ APR_EXPORT(const char *) apr_filename_of_pathname(const char *pathname); * for the increased robustness of having printf-warnings work. * * Additionally, apr_vformatter allows for arbitrary output methods - * using the ap_vformatter_buff and flush_func. + * using the apr_vformatter_buff and flush_func. * - * The ap_vformatter_buff has two elements curpos and endpos. + * The apr_vformatter_buff has two elements curpos and endpos. * curpos is where apr_vformatter will write the next byte of output. * It proceeds writing output to curpos, and updating curpos, until * either the end of output is reached, or curpos == endpos (i.e. the diff --git a/include/apr_md5.h b/include/apr_md5.h index d62eb0374b8..54b48438df9 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -100,10 +100,10 @@ extern "C" { /* UINT4 defines a four byte word */ typedef unsigned int UINT4; -typedef struct ap_md5_ctx_t ap_md5_ctx_t; +typedef struct apr_md5_ctx_t apr_md5_ctx_t; /** MD5 context. */ -struct ap_md5_ctx_t { +struct apr_md5_ctx_t { /** state (ABCD) */ UINT4 state[4]; /** number of bits, modulo 2^64 (lsb first) */ @@ -119,21 +119,22 @@ struct ap_md5_ctx_t { /** * MD5 Initialize. Begins an MD5 operation, writing a new context. * @param context The MD5 context to initialize. - * @deffunc apr_status_t apr_MD5Init(ap_md5_ctx_t *context) + * @deffunc apr_status_t apr_MD5Init(apr_md5_ctx_t *context) */ -APR_EXPORT(apr_status_t) apr_MD5Init(ap_md5_ctx_t *context); +APR_EXPORT(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context); /** * MD5 translation setup. Provides the APR translation handle to be used * for translating the content before calculating the digest. * @param context The MD5 content to set the translation for. * @param xlate The translation handle to use for this MD5 context - * @deffunc apr_status_t ap_MD5SetXlate(ap_md5_ctx_t *context, apr_xlate_t *xlate) + * @deffunc apr_status_t apr_MD5SetXlate(apr_md5_ctx_t *context, apr_xlate_t *xlate) */ #if APR_HAS_XLATE -APR_EXPORT(apr_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, apr_xlate_t *xlate); +APR_EXPORT(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, + apr_xlate_t *xlate); #else -#define ap_MD5SetXlate(context, xlate) APR_ENOTIMPL +#define apr_MD5SetXlate(context, xlate) APR_ENOTIMPL #endif /** @@ -142,21 +143,21 @@ APR_EXPORT(apr_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, apr_xlate_t *xlat * @param context The MD5 content to update. * @param input next message block to update * @param inputLen The length of the next message block - * @deffunc apr_status_t apr_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) + * @deffunc apr_status_t apr_MD5Update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) */ -APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, - const unsigned char *input, - unsigned int inputLen); +APR_EXPORT(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, + const unsigned char *input, + unsigned int inputLen); /** * MD5 finalization. Ends an MD5 message-digest operation, writing the * message digest and zeroing the context * @param digest The final MD5 digest * @param context The MD5 content we are finalizing. - * @deffunc apr_status_t apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], ap_md5_ctx_t *context) + * @deffunc apr_status_t apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context) */ APR_EXPORT(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], - ap_md5_ctx_t *context); + apr_md5_ctx_t *context); /** * Encode a password using an MD5 algorithm diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 87e9bb377d2..3055eb712e7 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -101,7 +101,7 @@ extern "C" { #define APR_POLLNVAL 0x040 typedef enum {APR_SHUTDOWN_READ, APR_SHUTDOWN_WRITE, - APR_SHUTDOWN_READWRITE} ap_shutdown_how_e; + APR_SHUTDOWN_READWRITE} apr_shutdown_how_e; /* We need to make sure we always have an in_addr type, so APR will just * define it ourselves, if the platform doesn't provide it. @@ -112,14 +112,14 @@ struct in_addr { } #endif -/* I guess not everybody uses inet_addr. This defines ap_inet_addr +/* I guess not everybody uses inet_addr. This defines apr_inet_addr * appropriately. */ #if APR_HAVE_INET_ADDR -#define ap_inet_addr inet_addr +#define apr_inet_addr inet_addr #elif APR_HAVE_INET_NETWORK /* only DGUX, as far as I know */ -#define ap_inet_addr inet_network +#define apr_inet_addr inet_network #endif typedef struct apr_socket_t apr_socket_t; @@ -167,7 +167,7 @@ apr_status_t apr_create_tcp_socket(apr_socket_t **new_sock, apr_pool_t *cont); * @tip This does not actually close the socket descriptor, it just * controls which calls are still valid on the socket. */ -apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how); +apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how); /** * Close a tcp socket. diff --git a/include/apr_pools.h b/include/apr_pools.h index 80a5dc6d957..b368debcbb6 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -52,8 +52,8 @@ * . */ -#ifndef ap_POOLS_H -#define ap_POOLS_H +#ifndef APR_POOLS_H +#define APR_POOLS_H #ifdef __cplusplus extern "C" { @@ -140,37 +140,37 @@ struct process_chain { * if the data is allocated in any ancestor of T's pool. This is the * basis on which the POOL_DEBUG code works -- it tests these ancestor * relationships for all data inserted into tables. POOL_DEBUG also - * provides tools (ap_find_pool, and ap_pool_is_ancestor) for other + * provides tools (apr_find_pool, and apr_pool_is_ancestor) for other * folks to implement similar restrictions for their own data * structures. * * However, sometimes this ancestor requirement is inconvenient -- * sometimes we're forced to create a sub pool (such as through - * ap_sub_req_lookup_uri), and the sub pool is guaranteed to have + * apr_sub_req_lookup_uri), and the sub pool is guaranteed to have * the same lifetime as the parent pool. This is a guarantee implemented * by the *caller*, not by the pool code. That is, the caller guarantees * they won't destroy the sub pool individually prior to destroying the * parent pool. * - * In this case the caller must call ap_pool_join() to indicate this + * In this case the caller must call apr_pool_join() to indicate this * guarantee to the POOL_DEBUG code. There are a few examples spread * through the standard modules. */ #ifndef POOL_DEBUG -#ifdef ap_pool_join -#undef ap_pool_join +#ifdef apr_pool_join +#undef apr_pool_join #endif -#define ap_pool_join(a,b) +#define apr_pool_join(a,b) #else -APR_EXPORT(void) ap_pool_join(apr_pool_t *p, apr_pool_t *sub); -APR_EXPORT(apr_pool_t *) ap_find_pool(const void *ts); -APR_EXPORT(int) ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); +APR_EXPORT(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub); +APR_EXPORT(apr_pool_t *) apr_find_pool(const void *ts); +APR_EXPORT(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); #endif #ifdef ULTRIX_BRAIN_DEATH -#define ap_fdopen(d,m) fdopen((d), (char *)(m)) +#define apr_fdopen(d,m) fdopen((d), (char *)(m)) #else -#define ap_fdopen(d,m) fdopen((d), (m)) +#define apr_fdopen(d,m) fdopen((d), (m)) #endif /* @@ -241,9 +241,9 @@ APR_EXPORT(apr_size_t) apr_bytes_in_free_blocks(void); * @param b The pool to search for * @return True if a is an ancestor of b, NULL is considered an ancestor * of all pools. - * @deffunc int ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) + * @deffunc int apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) */ -APR_EXPORT(int) ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); +APR_EXPORT(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); /** * Allocate a block of memory from a pool @@ -318,14 +318,14 @@ APR_EXPORT_NONSTD(apr_status_t) apr_null_cleanup(void *data); * destroyed before the parent pool */ #ifndef POOL_DEBUG -#ifdef ap_pool_join -#undef ap_pool_join -#endif /* ap_pool_join */ -#define ap_pool_join(a,b) +#ifdef apr_pool_join +#undef apr_pool_join +#endif /* apr_pool_join */ +#define apr_pool_join(a,b) #endif /* POOL_DEBUG */ #ifdef __cplusplus } #endif -#endif /* !ap_POOLS_H */ +#endif /* !APR_POOLS_H */ diff --git a/include/apr_portable.h b/include/apr_portable.h index 16be3b8f187..bcdd6a0e635 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -218,7 +218,8 @@ apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock); * @param ostime the native time format * @param aprtime the time to convert */ -apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, ap_exploded_time_t *aprtime); +apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, + apr_exploded_time_t *aprtime); /** * Get the imploded time in the platforms native format. @@ -252,7 +253,7 @@ apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *k * an apr file type. */ apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, - apr_pool_t *cont); + apr_pool_t *cont); /** * convert the dir from os specific type to apr type. @@ -261,7 +262,7 @@ apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, * @param cont The pool to use when creating to apr directory. */ apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, - apr_pool_t *cont); + apr_pool_t *cont); /** * Convert a socket from the os specific type to the apr type @@ -270,7 +271,7 @@ apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, * @param cont The socket we are converting to an apr type. */ apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, - apr_pool_t *cont); + apr_pool_t *cont); /** * Convert the lock from os specific type to apr type @@ -279,7 +280,7 @@ apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, * @param cont The pool to use if it is needed. */ apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, - apr_pool_t *cont); + apr_pool_t *cont); /** * Put the imploded time in the APR format. @@ -287,7 +288,8 @@ apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, * @param ostime the time to convert * @param cont the pool to use if necessary */ -apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont); +apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, + apr_pool_t *cont); /** * Put the exploded time in the APR format. @@ -295,7 +297,8 @@ apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime * @param ostime the time to convert * @param cont the pool to use if necessary */ -apr_status_t apr_put_os_exp_time(ap_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont); +apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime, + apr_os_exp_time_t **ostime, apr_pool_t *cont); #if APR_HAS_THREADS /** @@ -305,7 +308,7 @@ apr_status_t apr_put_os_exp_time(ap_exploded_time_t *aprtime, apr_os_exp_time_t * @param cont The pool to use if it is needed. */ apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *cont); + apr_pool_t *cont); /** * convert the thread private memory key from os specific type to apr type. @@ -313,8 +316,9 @@ apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, * @param thekey The os specific handle to convert * @param cont The pool to use if it is needed. */ -apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, apr_os_threadkey_t *thekey, - apr_pool_t *cont); +apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, + apr_pool_t *cont); #endif #ifdef __cplusplus diff --git a/include/apr_tables.h b/include/apr_tables.h index 43607d5e844..a1c02c64193 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -132,8 +132,8 @@ struct apr_table_entry_t { * placing it here we are able to get compile-time diagnostics from modules * written which assume that a apr_table_t is the same as an apr_array_header_t. -djg */ -#define ap_table_elts(t) ((apr_array_header_t *)(t)) -#define ap_is_empty_table(t) (((t) == NULL)||(((apr_array_header_t *)(t))->nelts == 0)) +#define apr_table_elts(t) ((apr_array_header_t *)(t)) +#define apr_is_empty_table(t) (((t) == NULL)||(((apr_array_header_t *)(t))->nelts == 0)) APR_EXPORT(apr_array_header_t *) apr_make_array(struct apr_pool_t *p, int nelts, int elt_size); @@ -193,12 +193,12 @@ APR_EXPORT(void) /* Conceptually, apr_overlap_tables does this: - apr_array_header_t *barr = ap_table_elts(b); + apr_array_header_t *barr = apr_table_elts(b); apr_table_entry_t *belt = (apr_table_entry_t *)barr->elts; int i; for (i = 0; i < barr->nelts; ++i) { - if (flags & ap_OVERLAP_TABLES_MERGE) { + if (flags & apr_OVERLAP_TABLES_MERGE) { apr_table_mergen(a, belt[i].key, belt[i].val); } else { @@ -213,8 +213,8 @@ APR_EXPORT(void) in an ancestor of a's pool. In practice b and a are usually from the same pool. */ -#define AP_OVERLAP_TABLES_SET (0) -#define AP_OVERLAP_TABLES_MERGE (1) +#define APR_OVERLAP_TABLES_SET (0) +#define APR_OVERLAP_TABLES_MERGE (1) APR_EXPORT(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, unsigned flags); diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 8cbbf5553e4..57f847c8eaf 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -416,8 +416,8 @@ apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e waithow); * @param p Pool to allocate child information out of. */ -apr_status_t apr_wait_all_procs(apr_proc_t *proc, ap_wait_t *status, - apr_wait_how_e waithow, apr_pool_t *p); +apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p); /** * Detach the process from the controlling terminal. diff --git a/include/apr_time.h b/include/apr_time.h index 16cf1070995..5983c54eff1 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -66,8 +66,8 @@ extern "C" { * @package APR Time library */ -APR_VAR_IMPORT const char ap_month_snames[12][4]; -APR_VAR_IMPORT const char ap_day_snames[7][4]; +APR_VAR_IMPORT const char apr_month_snames[12][4]; +APR_VAR_IMPORT const char apr_day_snames[7][4]; /* number of microseconds since 00:00:00 january 1, 1970 UTC */ typedef apr_int64_t apr_time_t; @@ -76,15 +76,15 @@ typedef apr_int64_t apr_time_t; typedef apr_int32_t apr_interval_time_t; #ifdef WIN32 -#define AP_USEC_PER_SEC ((LONGLONG) 1000000) +#define APR_USEC_PER_SEC ((LONGLONG) 1000000) #else /* XXX: this is wrong -- the LL is only required if int64 is implemented as * a long long, it could be just a long on some platforms. the C99 * correct way of doing this is to use INT64_C(1000000) which comes * from stdint.h. we'd probably be doing a Good Thing to check for - * INT64_C in autoconf... or otherwise define an AP_INT64_C(). -dean + * INT64_C in autoconf... or otherwise define an APR_INT64_C(). -dean */ -#define AP_USEC_PER_SEC (1000000LL) +#define APR_USEC_PER_SEC (1000000LL) #endif /** @@ -92,13 +92,13 @@ typedef apr_int32_t apr_interval_time_t; */ apr_time_t apr_now(void); -typedef struct ap_exploded_time_t ap_exploded_time_t; +typedef struct apr_exploded_time_t apr_exploded_time_t; /** * a structure similar to ANSI struct tm with the following differences: * - tm_usec isn't an ANSI field * - tm_gmtoff isn't an ANSI field (it's a bsdism) */ -struct ap_exploded_time_t { +struct apr_exploded_time_t { /** microseconds past tm_sec */ apr_int32_t tm_usec; /** (0-61) seconds past tm_min */ @@ -128,21 +128,21 @@ struct ap_exploded_time_t { * @param result the resulting apr_time_t * @param input the time_t to convert */ -apr_status_t apr_ansi_time_to_ap_time(apr_time_t *result, time_t input); +apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input); /** * convert a time to its human readable components in GMT timezone * @param result the exploded time * @param input the time to explode */ -apr_status_t apr_explode_gmt(ap_exploded_time_t *result, apr_time_t input); +apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input); /** * convert a time to its human readable components in local timezone * @param result the exploded time * @param input the time to explode */ -apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input); +apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input); /** * Convert time value from human readable format to number of seconds @@ -150,7 +150,7 @@ apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input) * @param result the resulting imploded time * @param input the input exploded time */ -apr_status_t apr_implode_time(apr_time_t *result, ap_exploded_time_t *input); +apr_status_t apr_implode_time(apr_time_t *result, apr_exploded_time_t *input); /** * Sleep for the specified number of micro-seconds. @@ -159,7 +159,7 @@ apr_status_t apr_implode_time(apr_time_t *result, ap_exploded_time_t *input); */ void apr_sleep(apr_interval_time_t t); -#define AP_RFC822_DATE_LEN (30) +#define APR_RFC822_DATE_LEN (30) /** * apr_rfc822_date formats dates in the RFC822 * format in an efficient manner. it is a fixed length @@ -170,7 +170,7 @@ void apr_sleep(apr_interval_time_t t); */ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t); -#define AP_CTIME_LEN (25) +#define APR_CTIME_LEN (25) /** * apr_ctime formats dates in the ctime() format * in an efficient manner. it is a fixed length format @@ -189,7 +189,7 @@ apr_status_t apr_ctime(char *date_str, apr_time_t t); * @param format The format for the time string * @param tm The time to convert */ -apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, ap_exploded_time_t *tm); +apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, apr_exploded_time_t *tm); #ifdef __cplusplus } diff --git a/include/apr_xlate.h b/include/apr_xlate.h index ffbbcc9fca0..fb5eb14a849 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -69,9 +69,9 @@ extern "C" { */ /* APR_HAS_XLATE determines whether or not useful implementations of - * ap_xlate_open() et al are provided. + * apr_xlate_open() et al are provided. * - * If APR_HAS_XLATE is zero, ap_xlate_open() et al will all return + * If APR_HAS_XLATE is zero, apr_xlate_open() et al will all return * APR_ENOTIMPL at run-time. */ @@ -83,22 +83,22 @@ typedef void apr_xlate_t; * these are macros which always return failure. */ -#define ap_xlate_open(convset, topage, frompage, pool) APR_ENOTIMPL +#define apr_xlate_open(convset, topage, frompage, pool) APR_ENOTIMPL -#define ap_xlate_get_sb(convset, onoff) APR_ENOTIMPL +#define apr_xlate_get_sb(convset, onoff) APR_ENOTIMPL -#define ap_xlate_conv_buffer(convset, inbuf, inbytes_left, outbuf, \ - outbytes_left) APR_ENOTIMPL +#define apr_xlate_conv_buffer(convset, inbuf, inbytes_left, outbuf, \ + outbytes_left) APR_ENOTIMPL -#define ap_xlate_conv_byte(convset, inchar) (-1) +#define apr_xlate_conv_byte(convset, inchar) (-1) -/* The purpose of ap_xlate_conv_char is to translate one character +/* The purpose of apr_xlate_conv_char is to translate one character * at a time. This needs to be written carefully so that it works * with double-byte character sets. */ -#define ap_xlate_conv_char(convset, inchar, outchar) APR_ENOTIMPL +#define apr_xlate_conv_char(convset, inchar, outchar) APR_ENOTIMPL -#define ap_xlate_close(convset) APR_ENOTIMPL +#define apr_xlate_close(convset) APR_ENOTIMPL #else /* ! APR_HAS_XLATE */ @@ -125,7 +125,7 @@ typedef struct apr_xlate_t apr_xlate_t; * names to indicate the charset of the current locale. * */ -apr_status_t ap_xlate_open(apr_xlate_t **convset, const char *topage, +apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, const char *frompage, apr_pool_t *pool); #define APR_DEFAULT_CHARSET (const char *)0 @@ -133,16 +133,16 @@ apr_status_t ap_xlate_open(apr_xlate_t **convset, const char *topage, /** * Find out whether or not the specified conversion is single-byte-only. - * @param convset The handle allocated by ap_xlate_open, specifying the + * @param convset The handle allocated by apr_xlate_open, specifying the * parameters of conversion * @param onoff Output: whether or not the conversion is single-byte-only */ -apr_status_t ap_xlate_get_sb(apr_xlate_t *convset, int *onoff); +apr_status_t apr_xlate_get_sb(apr_xlate_t *convset, int *onoff); /** * Convert a buffer of text from one codepage to another. - * @param convset The handle allocated by ap_xlate_open, specifying + * @param convset The handle allocated by apr_xlate_open, specifying * the parameters of conversion * @param inbuf The address of the source buffer * @param inbytes_left Input: the amount of input data to be translated @@ -151,36 +151,36 @@ apr_status_t ap_xlate_get_sb(apr_xlate_t *convset, int *onoff); * @param outbytes_left Input: the size of the output buffer * Output: the amount of the output buffer not yet used */ -apr_status_t ap_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, - apr_size_t *inbytes_left, char *outbuf, - apr_size_t *outbytes_left); +apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, + apr_size_t *inbytes_left, char *outbuf, + apr_size_t *outbytes_left); /** - * The purpose of ap_xlate_conv_char is to translate one character + * The purpose of apr_xlate_conv_char is to translate one character * at a time. This needs to be written carefully so that it works * with double-byte character sets. - * @param convset The handle allocated by ap_xlate_open, specifying the + * @param convset The handle allocated by apr_xlate_open, specifying the * parameters of conversion * @param inchar The character to convert * @param outchar The converted character */ -apr_status_t ap_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar); +apr_status_t apr_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar); /** * Convert a single-byte character from one charset to another. - * @param convset The handle allocated by ap_xlate_open, specifying the + * @param convset The handle allocated by apr_xlate_open, specifying the * parameters of conversion * @param inchar The single-byte character to convert. * @tip This only works when converting between single-byte character sets. -1 will be returned if the conversion can't be performed. */ -apr_int32_t ap_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar); +apr_int32_t apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar); /** * Close a codepage translation handle. * @param convset The codepage translation handle to close */ -apr_status_t ap_xlate_close(apr_xlate_t *convset); +apr_status_t apr_xlate_close(apr_xlate_t *convset); #endif /* ! APR_HAS_XLATE */ diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index 6aa1be1c5ee..5051cacc9ab 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -97,7 +97,8 @@ struct apr_dir_t { }; apr_status_t apr_file_cleanup(void *); -apr_status_t ap_os2_time_to_ap_time(apr_time_t *result, FDATE os2date, FTIME os2time); +apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, + FTIME os2time); #endif /* ! FILE_IO_H */ diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index f02c112dcf7..e0ce1d050ab 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -115,7 +115,7 @@ typedef enum { APR_WIN_NT_4_SP4 = 16, APR_WIN_NT_4_SP6 = 18, APR_WIN_2000 = 24 -} ap_oslevel_e; +} apr_oslevel_e; typedef enum { @@ -124,25 +124,26 @@ typedef enum { DLL_WINSOCKAPI = 2, // mswsock From WinSock.h DLL_WINSOCK2API = 3, // ws2_32 From WinSock2.h DLL_defined = 4 // must define as last idx_ + 1 -} ap_dlltoken_e; +} apr_dlltoken_e; -FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char *fnName, int ordinal); +FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); -/* The ap_load_dll_func call WILL fault if the function cannot be loaded */ +/* The apr_load_dll_func call WILL fault if the function cannot be loaded */ -#define AP_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ - typedef rettype (calltype *ap_winapi_fpt_##fn) args; \ - static ap_winapi_fpt_##fn ap_winapi_pfn_##fn = NULL; \ - __inline rettype ap_winapi_##fn args \ - { if (!ap_winapi_pfn_##fn) \ - ap_winapi_pfn_##fn = (ap_winapi_fpt_##fn) ap_load_dll_func(lib, #fn, ord); \ - return (*(ap_winapi_pfn_##fn)) names; }; \ +#define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ + typedef rettype (calltype *apr_winapi_fpt_##fn) args; \ + static apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \ + __inline rettype apr_winapi_##fn args \ + { if (!apr_winapi_pfn_##fn) \ + apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \ + apr_load_dll_func(lib, #fn, ord); \ + return (*(apr_winapi_pfn_##fn)) names; }; \ /* Provide late bound declarations of every API function missing from * one or more supported releases of the Win32 API * - * lib is the enumerated token from ap_dlltoken_e, and must correspond - * to the string table entry in start.c used by the ap_load_dll_func(). + * lib is the enumerated token from apr_dlltoken_e, and must correspond + * to the string table entry in start.c used by the apr_load_dll_func(). * Token names (attempt to) follow Windows.h declarations prefixed by DLL_ * in order to facilitate comparison. Use the exact declaration syntax * and names from Windows.h to prevent ambigutity and bugs. @@ -157,20 +158,20 @@ FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char *fnName, int ordinal); * In the case of non-text functions, simply #define the original name */ -AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( IN LPCSTR lpFileName, IN GET_FILEEX_INFO_LEVELS fInfoLevelId, OUT LPVOID lpFileInformation), (lpFileName, fInfoLevelId, lpFileInformation)); #undef GetFileAttributesEx -#define GetFileAttributesEx ap_winapi_GetFileAttributesExA +#define GetFileAttributesEx apr_winapi_GetFileAttributesExA -AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( IN HANDLE hFile), (hFile)); -#define CancelIo ap_winapi_CancelIo +#define CancelIo apr_winapi_CancelIo -apr_status_t ap_get_oslevel(struct apr_pool_t *, ap_oslevel_e *); +apr_status_t apr_get_oslevel(struct apr_pool_t *, apr_oslevel_e *); #endif /* WIN32 */ #endif /* ! MISC_H */ diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index bfdda74213e..661154ead16 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -92,7 +92,7 @@ * fname -- the filename as passed to the open call. * dwFileAttricutes -- Attributes used to open the file. * demonfname -- the canonicalized filename. Used to store the result from - * ap_os_canonicalize_filename. + * apr_os_canonicalize_filename. * lowerdemonfname -- inserted at Ken Parzygnat's request, because of the * ugly way windows deals with case in the filesystem. * append -- Windows doesn't support the append concept when opening files. @@ -143,12 +143,12 @@ struct apr_dir_t { apr_status_t file_cleanup(void *); /*mode_t get_fileperms(apr_fileperms_t); */ -APR_EXPORT(char *) ap_os_systemcase_filename(struct apr_pool_t *pCont, - const char *szFile); +APR_EXPORT(char *) apr_os_systemcase_filename(struct apr_pool_t *pCont, + const char *szFile); char * canonical_filename(struct apr_pool_t *pCont, const char *szFile); -apr_status_t ap_create_nt_pipe(apr_file_t **in, apr_file_t **out, - BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, - apr_pool_t *p); +apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, + BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, + apr_pool_t *p); #endif /* ! FILE_IO_H */ diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index f02c112dcf7..e0ce1d050ab 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -115,7 +115,7 @@ typedef enum { APR_WIN_NT_4_SP4 = 16, APR_WIN_NT_4_SP6 = 18, APR_WIN_2000 = 24 -} ap_oslevel_e; +} apr_oslevel_e; typedef enum { @@ -124,25 +124,26 @@ typedef enum { DLL_WINSOCKAPI = 2, // mswsock From WinSock.h DLL_WINSOCK2API = 3, // ws2_32 From WinSock2.h DLL_defined = 4 // must define as last idx_ + 1 -} ap_dlltoken_e; +} apr_dlltoken_e; -FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char *fnName, int ordinal); +FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); -/* The ap_load_dll_func call WILL fault if the function cannot be loaded */ +/* The apr_load_dll_func call WILL fault if the function cannot be loaded */ -#define AP_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ - typedef rettype (calltype *ap_winapi_fpt_##fn) args; \ - static ap_winapi_fpt_##fn ap_winapi_pfn_##fn = NULL; \ - __inline rettype ap_winapi_##fn args \ - { if (!ap_winapi_pfn_##fn) \ - ap_winapi_pfn_##fn = (ap_winapi_fpt_##fn) ap_load_dll_func(lib, #fn, ord); \ - return (*(ap_winapi_pfn_##fn)) names; }; \ +#define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ + typedef rettype (calltype *apr_winapi_fpt_##fn) args; \ + static apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \ + __inline rettype apr_winapi_##fn args \ + { if (!apr_winapi_pfn_##fn) \ + apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \ + apr_load_dll_func(lib, #fn, ord); \ + return (*(apr_winapi_pfn_##fn)) names; }; \ /* Provide late bound declarations of every API function missing from * one or more supported releases of the Win32 API * - * lib is the enumerated token from ap_dlltoken_e, and must correspond - * to the string table entry in start.c used by the ap_load_dll_func(). + * lib is the enumerated token from apr_dlltoken_e, and must correspond + * to the string table entry in start.c used by the apr_load_dll_func(). * Token names (attempt to) follow Windows.h declarations prefixed by DLL_ * in order to facilitate comparison. Use the exact declaration syntax * and names from Windows.h to prevent ambigutity and bugs. @@ -157,20 +158,20 @@ FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char *fnName, int ordinal); * In the case of non-text functions, simply #define the original name */ -AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( IN LPCSTR lpFileName, IN GET_FILEEX_INFO_LEVELS fInfoLevelId, OUT LPVOID lpFileInformation), (lpFileName, fInfoLevelId, lpFileInformation)); #undef GetFileAttributesEx -#define GetFileAttributesEx ap_winapi_GetFileAttributesExA +#define GetFileAttributesEx apr_winapi_GetFileAttributesExA -AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( IN HANDLE hFile), (hFile)); -#define CancelIo ap_winapi_CancelIo +#define CancelIo apr_winapi_CancelIo -apr_status_t ap_get_oslevel(struct apr_pool_t *, ap_oslevel_e *); +apr_status_t apr_get_oslevel(struct apr_pool_t *, apr_oslevel_e *); #endif /* WIN32 */ #endif /* ! MISC_H */ diff --git a/lib/apr_pools.c b/lib/apr_pools.c index ad6f4754cb0..77352797c14 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -131,8 +131,8 @@ #define BLOCK_MINALLOC 0 #endif /* ALLOC_USE_MALLOC */ -#define AP_SLACK_LOW 1 -#define AP_SLACK_HIGH 2 +#define APR_SLACK_LOW 1 +#define APR_SLACK_HIGH 2 /***************************************************************** @@ -671,7 +671,7 @@ void apr_term_alloc(void) } /* We only want to lock the mutex if we are being called from apr_clear_pool. - * This is because if we also call this function from ap_destroy_real_pool, + * This is because if we also call this function from apr_destroy_real_pool, * which also locks the same mutex, and recursive locks aren't portable. * This way, we are garaunteed that we only lock this mutex once when calling * either one of these functions. @@ -762,7 +762,7 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -APR_EXPORT(apr_pool_t *) ap_find_pool(const void *ts) +APR_EXPORT(apr_pool_t *) apr_find_pool(const void *ts) { const char *s = ts; union block_hdr **pb; @@ -808,7 +808,7 @@ APR_EXPORT(apr_pool_t *) ap_find_pool(const void *ts) /* return TRUE iff a is an ancestor of b * NULL is considered an ancestor of all pools */ -APR_EXPORT(int) ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) +APR_EXPORT(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) { if (a == NULL) { return 1; @@ -830,7 +830,7 @@ APR_EXPORT(int) ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -APR_EXPORT(void) ap_pool_join(apr_pool_t *p, apr_pool_t *sub) +APR_EXPORT(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) { union block_hdr *b; @@ -1207,7 +1207,7 @@ static void free_proc_chain(struct process_chain *procs) */ { for (p = procs; p; p = p->next) { - CloseHandle(p->pid->pid); + CloseHandle((HANDLE)p->pid->pid); } } #endif /* WIN32 */ diff --git a/lib/apr_signal.c b/lib/apr_signal.c index df13f7acee2..adbc74d8811 100644 --- a/lib/apr_signal.c +++ b/lib/apr_signal.c @@ -80,5 +80,5 @@ Sigfunc *apr_signal(int signo, Sigfunc * func) } #else /* need some function in this file, otherwise the linker on NeXT bitches */ -void ap_signal_is_not_here(void) {} +void apr_signal_is_not_here(void) {} #endif diff --git a/libapr.def b/libapr.def index dbf1cdb1d2b..118cd997d83 100644 --- a/libapr.def +++ b/libapr.def @@ -118,7 +118,7 @@ EXPORTS ; apr_get_os_proc @109 apr_get_os_thread @110 apr_get_os_threadkey @111 - ap_os_systemcase_filename @112 + apr_os_systemcase_filename @112 canonical_filename @113 apr_create_pool @114 apr_clear_pool @115 @@ -128,13 +128,13 @@ EXPORTS apr_set_userdata @119 apr_initialize @120 apr_getopt @121 - ap_opterr @122 DATA - ap_optind @123 DATA - ap_optopt @124 DATA - ap_optreset @125 DATA - ap_optarg @126 DATA + apr_opterr @122 DATA + apr_optind @123 DATA + apr_optopt @124 DATA + apr_optreset @125 DATA + apr_optarg @126 DATA ; apr_make_time @127 - apr_ansi_time_to_ap_time @127 + apr_ansi_time_to_apr_time @127 ; apr_current_time @128 apr_now @128 ; apr_explode_time @129 @@ -242,8 +242,8 @@ EXPORTS apr_dso_sym @221 ; apr_dso_init @222 apr_collapse_spaces @223 - ap_month_snames @224 - ap_day_snames @225 + apr_month_snames @224 + apr_day_snames @225 apr_canonical_error @226 apr_strerror @227 apr_generate_random_bytes @228 diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c index ee541cfcb2e..06998e4abb8 100644 --- a/locks/beos/crossproc.c +++ b/locks/beos/crossproc.c @@ -73,7 +73,7 @@ apr_status_t create_inter_lock(apr_lock_t *new) new->sem_interproc = (sem_id)apr_palloc(new->cntxt, sizeof(sem_id)); new->ben_interproc = (int32)apr_palloc(new->cntxt, sizeof(int32)); - if ((stat = create_sem(0, "ap_interproc")) < B_NO_ERROR) { + if ((stat = create_sem(0, "apr_interproc")) < B_NO_ERROR) { lock_inter_cleanup(new); return stat; } diff --git a/locks/beos/intraproc.c b/locks/beos/intraproc.c index 93032f5614d..0c582a44914 100644 --- a/locks/beos/intraproc.c +++ b/locks/beos/intraproc.c @@ -75,7 +75,7 @@ apr_status_t create_intra_lock(apr_lock_t *new) new->ben_intraproc = (int32)apr_palloc(new->cntxt, sizeof(int32)); - if ((stat = create_sem(0, "ap_intraproc")) < B_NO_ERROR){ + if ((stat = create_sem(0, "apr_intraproc")) < B_NO_ERROR){ lock_intra_cleanup(new); return stat; } diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index ad6f4754cb0..77352797c14 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -131,8 +131,8 @@ #define BLOCK_MINALLOC 0 #endif /* ALLOC_USE_MALLOC */ -#define AP_SLACK_LOW 1 -#define AP_SLACK_HIGH 2 +#define APR_SLACK_LOW 1 +#define APR_SLACK_HIGH 2 /***************************************************************** @@ -671,7 +671,7 @@ void apr_term_alloc(void) } /* We only want to lock the mutex if we are being called from apr_clear_pool. - * This is because if we also call this function from ap_destroy_real_pool, + * This is because if we also call this function from apr_destroy_real_pool, * which also locks the same mutex, and recursive locks aren't portable. * This way, we are garaunteed that we only lock this mutex once when calling * either one of these functions. @@ -762,7 +762,7 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -APR_EXPORT(apr_pool_t *) ap_find_pool(const void *ts) +APR_EXPORT(apr_pool_t *) apr_find_pool(const void *ts) { const char *s = ts; union block_hdr **pb; @@ -808,7 +808,7 @@ APR_EXPORT(apr_pool_t *) ap_find_pool(const void *ts) /* return TRUE iff a is an ancestor of b * NULL is considered an ancestor of all pools */ -APR_EXPORT(int) ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) +APR_EXPORT(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) { if (a == NULL) { return 1; @@ -830,7 +830,7 @@ APR_EXPORT(int) ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -APR_EXPORT(void) ap_pool_join(apr_pool_t *p, apr_pool_t *sub) +APR_EXPORT(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) { union block_hdr *b; @@ -1207,7 +1207,7 @@ static void free_proc_chain(struct process_chain *procs) */ { for (p = procs; p; p = p->next) { - CloseHandle(p->pid->pid); + CloseHandle((HANDLE)p->pid->pid); } } #endif /* WIN32 */ diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 697ea0a40a2..9699cb5c8c2 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -187,9 +187,9 @@ static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) for (c=0; c= nargc || *(place = nargv[ap_optind]) != '-') { + if (apr_optreset || !*place) { /* update scanning pointer */ + apr_optreset = 0; + if (apr_optind >= nargc || *(place = nargv[apr_optind]) != '-') { place = EMSG; - *rv = ap_optopt; + *rv = apr_optopt; return (APR_EOF); } if (place[1] && *++place == '-') { /* found "--" */ - ++ap_optind; + ++apr_optind; place = EMSG; - *rv = ap_optopt; + *rv = apr_optopt; return (APR_EOF); } } /* option letter okay? */ - if ((ap_optopt = (int) *place++) == (int) ':' || - !(oli = strchr(ostr, ap_optopt))) { + if ((apr_optopt = (int) *place++) == (int) ':' || + !(oli = strchr(ostr, apr_optopt))) { /* * if the user didn't specify '-' as an option, * assume it means -1. */ - if (ap_optopt == (int) '-') { - *rv = ap_optopt; + if (apr_optopt == (int) '-') { + *rv = apr_optopt; return (APR_EOF); } if (!*place) - ++ap_optind; - if (ap_opterr && *ostr != ':') { + ++apr_optind; + if (apr_opterr && *ostr != ':') { if (!(p = strrchr(*nargv, '/'))) p = *nargv; else ++p; (void) fprintf(stderr, - "%s: illegal option -- %c\n", p, ap_optopt); + "%s: illegal option -- %c\n", p, apr_optopt); } - *rv = ap_optopt; + *rv = apr_optopt; return APR_BADCH; } if (*++oli != ':') { /* don't need argument */ - ap_optarg = NULL; + apr_optarg = NULL; if (!*place) - ++ap_optind; + ++apr_optind; } else { /* need an argument */ if (*place) /* no white space */ - ap_optarg = place; - else if (nargc <= ++ap_optind) { /* no arg */ + apr_optarg = place; + else if (nargc <= ++apr_optind) { /* no arg */ place = EMSG; if (*ostr == ':') { - *rv = ap_optopt; + *rv = apr_optopt; return (APR_BADARG); } - if (ap_opterr) { + if (apr_opterr) { if (!(p = strrchr(*nargv, '/'))) p = *nargv; else ++p; (void) fprintf(stderr, "%s: option requires an argument -- %c\n", - p, ap_optopt); + p, apr_optopt); } - *rv = ap_optopt; + *rv = apr_optopt; return (APR_BADCH); } else /* white space */ - ap_optarg = nargv[ap_optind]; + apr_optarg = nargv[apr_optind]; place = EMSG; - ++ap_optind; + ++apr_optind; } - *rv = ap_optopt; + *rv = apr_optopt; return APR_SUCCESS; } diff --git a/misc/unix/misc.h b/misc/unix/misc.h index f02c112dcf7..e0ce1d050ab 100644 --- a/misc/unix/misc.h +++ b/misc/unix/misc.h @@ -115,7 +115,7 @@ typedef enum { APR_WIN_NT_4_SP4 = 16, APR_WIN_NT_4_SP6 = 18, APR_WIN_2000 = 24 -} ap_oslevel_e; +} apr_oslevel_e; typedef enum { @@ -124,25 +124,26 @@ typedef enum { DLL_WINSOCKAPI = 2, // mswsock From WinSock.h DLL_WINSOCK2API = 3, // ws2_32 From WinSock2.h DLL_defined = 4 // must define as last idx_ + 1 -} ap_dlltoken_e; +} apr_dlltoken_e; -FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char *fnName, int ordinal); +FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); -/* The ap_load_dll_func call WILL fault if the function cannot be loaded */ +/* The apr_load_dll_func call WILL fault if the function cannot be loaded */ -#define AP_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ - typedef rettype (calltype *ap_winapi_fpt_##fn) args; \ - static ap_winapi_fpt_##fn ap_winapi_pfn_##fn = NULL; \ - __inline rettype ap_winapi_##fn args \ - { if (!ap_winapi_pfn_##fn) \ - ap_winapi_pfn_##fn = (ap_winapi_fpt_##fn) ap_load_dll_func(lib, #fn, ord); \ - return (*(ap_winapi_pfn_##fn)) names; }; \ +#define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ + typedef rettype (calltype *apr_winapi_fpt_##fn) args; \ + static apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \ + __inline rettype apr_winapi_##fn args \ + { if (!apr_winapi_pfn_##fn) \ + apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \ + apr_load_dll_func(lib, #fn, ord); \ + return (*(apr_winapi_pfn_##fn)) names; }; \ /* Provide late bound declarations of every API function missing from * one or more supported releases of the Win32 API * - * lib is the enumerated token from ap_dlltoken_e, and must correspond - * to the string table entry in start.c used by the ap_load_dll_func(). + * lib is the enumerated token from apr_dlltoken_e, and must correspond + * to the string table entry in start.c used by the apr_load_dll_func(). * Token names (attempt to) follow Windows.h declarations prefixed by DLL_ * in order to facilitate comparison. Use the exact declaration syntax * and names from Windows.h to prevent ambigutity and bugs. @@ -157,20 +158,20 @@ FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char *fnName, int ordinal); * In the case of non-text functions, simply #define the original name */ -AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( IN LPCSTR lpFileName, IN GET_FILEEX_INFO_LEVELS fInfoLevelId, OUT LPVOID lpFileInformation), (lpFileName, fInfoLevelId, lpFileInformation)); #undef GetFileAttributesEx -#define GetFileAttributesEx ap_winapi_GetFileAttributesExA +#define GetFileAttributesEx apr_winapi_GetFileAttributesExA -AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( IN HANDLE hFile), (hFile)); -#define CancelIo ap_winapi_CancelIo +#define CancelIo apr_winapi_CancelIo -apr_status_t ap_get_oslevel(struct apr_pool_t *, ap_oslevel_e *); +apr_status_t apr_get_oslevel(struct apr_pool_t *, apr_oslevel_e *); #endif /* WIN32 */ #endif /* ! MISC_H */ diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 734c5a018fb..f4b00b07420 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -55,7 +55,7 @@ #include "apr_private.h" #include "misc.h" -apr_status_t ap_get_oslevel(apr_pool_t *cont, ap_oslevel_e *level) +apr_status_t apr_get_oslevel(apr_pool_t *cont, apr_oslevel_e *level) { static OSVERSIONINFO oslev; static unsigned int servpack = 0; @@ -123,7 +123,7 @@ static const char* const lateDllName[DLL_defined] = { static HMODULE lateDllHandle[DLL_defined] = { NULL, NULL, NULL, NULL }; -FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char* fnName, int ordinal) +FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) { if (!lateDllHandle[fnLib]) { lateDllHandle[fnLib] = LoadLibrary(lateDllName[fnLib]); diff --git a/misc/win32/names.c b/misc/win32/names.c index 81587cf9c40..baa20236a11 100644 --- a/misc/win32/names.c +++ b/misc/win32/names.c @@ -82,7 +82,7 @@ static BOOL OnlyDots(char *pString) * is present on the existing path. This routine also * converts alias names to long names. */ -APR_EXPORT(char *) ap_os_systemcase_filename(apr_pool_t *pCont, +APR_EXPORT(char *) apr_os_systemcase_filename(apr_pool_t *pCont, const char *szFile) { char buf[HUGE_STRING_LEN]; @@ -271,10 +271,10 @@ char * canonical_filename(apr_pool_t *pCont, const char *szFile) char *pConvertedName, *pQstr, *pPstr; char buf[HUGE_STRING_LEN]; /* We potentially have a short name. Call - * ap_os_systemcase_filename to examine the filesystem + * apr_os_systemcase_filename to examine the filesystem * and possibly extract the long name. */ - pConvertedName = ap_os_systemcase_filename(pCont, pNewStr); + pConvertedName = apr_os_systemcase_filename(pCont, pNewStr); /* Since we want to preserve the incoming case as much * as we can, compare for differences in the string and diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index 354de61ceb7..b6089bee894 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -112,8 +112,8 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, tvptr = NULL; } else { - tv.tv_sec = timeout / AP_USEC_PER_SEC; - tv.tv_usec = timeout % AP_USEC_PER_SEC; + tv.tv_sec = timeout / APR_USEC_PER_SEC; + tv.tv_usec = timeout % APR_USEC_PER_SEC; tvptr = &tv; } diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 601881286c7..46b489e195d 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -71,8 +71,8 @@ static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) tvptr = NULL; } else { - tv.tv_sec = sock->timeout / AP_USEC_PER_SEC; - tv.tv_usec = sock->timeout % AP_USEC_PER_SEC; + tv.tv_sec = sock->timeout / APR_USEC_PER_SEC; + tv.tv_usec = sock->timeout % APR_USEC_PER_SEC; tvptr = &tv; } srv = select(sock->socketdes + 1, diff --git a/network_io/beos/sockets.c b/network_io/beos/sockets.c index 446d8a7d205..5a1347b6421 100644 --- a/network_io/beos/sockets.c +++ b/network_io/beos/sockets.c @@ -104,7 +104,7 @@ apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how) +apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { return shutdown(thesocket->socketdes, how); } diff --git a/network_io/os2/poll.c b/network_io/os2/poll.c index f1bd5826aad..3dcf184d0f2 100644 --- a/network_io/os2/poll.c +++ b/network_io/os2/poll.c @@ -134,7 +134,7 @@ apr_status_t apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, time_t starttime; struct timeval tv; - timeout /= AP_USEC_PER_SEC; /* TODO: rework for microseconds and axe this */ + timeout /= APR_USEC_PER_SEC; /* TODO: rework for microseconds and axe this */ tv.tv_sec = timeout; tv.tv_usec = 0; diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index b6e417840c7..12371da487e 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -112,7 +112,7 @@ apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how) +apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { if (shutdown(thesocket->socketdes, how) == 0) { return APR_SUCCESS; diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index 76679791b87..b797ccf378d 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -267,8 +267,8 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, tvptr = NULL; } else { - tv.tv_sec = timeout / AP_USEC_PER_SEC; - tv.tv_usec = timeout % AP_USEC_PER_SEC; + tv.tv_sec = timeout / APR_USEC_PER_SEC; + tv.tv_usec = timeout % APR_USEC_PER_SEC; tvptr = &tv; } diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 2ba230a5c4b..ad22eb53f75 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -91,8 +91,8 @@ static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) tvptr = NULL; } else { - tv.tv_sec = sock->timeout / AP_USEC_PER_SEC; - tv.tv_usec = sock->timeout % AP_USEC_PER_SEC; + tv.tv_sec = sock->timeout / APR_USEC_PER_SEC; + tv.tv_usec = sock->timeout % APR_USEC_PER_SEC; tvptr = &tv; } srv = select(sock->socketdes + 1, diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 377612f3fe1..2399c80c634 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -100,7 +100,7 @@ apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how) +apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { return (shutdown(thesocket->socketdes, how) == -1) ? errno : APR_SUCCESS; } diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 843a4c5b261..9558f4746bf 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -125,8 +125,8 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, tvptr = NULL; } else { - tv.tv_sec = (long)(timeout / AP_USEC_PER_SEC); - tv.tv_usec = (long)(timeout % AP_USEC_PER_SEC); + tv.tv_sec = (long)(timeout / APR_USEC_PER_SEC); + tv.tv_usec = (long)(timeout % APR_USEC_PER_SEC); tvptr = &tv; } rv = select(500, /* ignored on Windows */ diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index dc6d5f72d29..1db68366645 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -113,7 +113,7 @@ apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how) +apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { int winhow; diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index edea993d431..838b633a23d 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -186,7 +186,7 @@ static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_MD5Encode() */ /* MD5 initialization. Begins an MD5 operation, writing a new context. */ -APR_EXPORT(apr_status_t) apr_MD5Init(ap_md5_ctx_t *context) +APR_EXPORT(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context) { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ @@ -205,14 +205,15 @@ APR_EXPORT(apr_status_t) apr_MD5Init(ap_md5_ctx_t *context) * to be used for translating the content before calculating the * digest. */ -APR_EXPORT(apr_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, apr_xlate_t *xlate) +APR_EXPORT(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, + apr_xlate_t *xlate) { apr_status_t rv; int is_sb; /* TODO: remove the single-byte-only restriction from this code */ - rv = ap_xlate_get_sb(xlate, &is_sb); + rv = apr_xlate_get_sb(xlate, &is_sb); if (rv != APR_SUCCESS) { return rv; } @@ -228,7 +229,7 @@ APR_EXPORT(apr_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, apr_xlate_t *xlat operation, processing another message block, and updating the context. */ -APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, +APR_EXPORT(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) { @@ -241,7 +242,8 @@ APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, idx = (unsigned int) ((context->count[0] >> 3) & 0x3F); /* Update number of bits */ - if ((context->count[0] += ((UINT4) inputLen << 3)) < ((UINT4) inputLen << 3)) + if ((context->count[0] += ((UINT4) inputLen << 3)) + < ((UINT4) inputLen << 3)) context->count[1]++; context->count[1] += (UINT4) inputLen >> 29; @@ -267,7 +269,7 @@ APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, if (inputLen >= partLen) { if (context->xlate) { inbytes_left = outbytes_left = partLen; - ap_xlate_conv_buffer(context->xlate, input, &inbytes_left, + apr_xlate_conv_buffer(context->xlate, input, &inbytes_left, &context->buffer[idx],&outbytes_left); } else { @@ -279,7 +281,7 @@ APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, if (context->xlate) { unsigned char inp_tmp[64]; inbytes_left = outbytes_left = 64; - ap_xlate_conv_buffer(context->xlate, &input[i], &inbytes_left, + apr_xlate_conv_buffer(context->xlate, &input[i], &inbytes_left, inp_tmp, &outbytes_left); MD5Transform(context->state, inp_tmp); } @@ -296,7 +298,7 @@ APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, /* Buffer remaining input */ if (context->xlate) { inbytes_left = outbytes_left = inputLen - i; - ap_xlate_conv_buffer(context->xlate, &input[i], &inbytes_left, + apr_xlate_conv_buffer(context->xlate, &input[i], &inbytes_left, &context->buffer[idx], &outbytes_left); } else { @@ -310,7 +312,7 @@ APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, the message digest and zeroizing the context. */ APR_EXPORT(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], - ap_md5_ctx_t *context) + apr_md5_ctx_t *context) { unsigned char bits[8]; unsigned int idx, padLen; @@ -459,7 +461,7 @@ static void Decode(UINT4 *output, const unsigned char *input, unsigned int len) } #ifdef CHARSET_EBCDIC -APR_EXPORT(apr_status_t) ap_MD5InitEBCDIC(apr_xlate_t *xlate) +APR_EXPORT(apr_status_t) apr_MD5InitEBCDIC(apr_xlate_t *xlate) { xlate_ebcdic_to_ascii = xlate; return APR_SUCCESS; @@ -502,7 +504,7 @@ APR_EXPORT(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, const char *sp, *ep; unsigned char final[MD5_DIGESTSIZE]; int sl, pl, i; - ap_md5_ctx_t ctx, ctx1; + apr_md5_ctx_t ctx, ctx1; unsigned long l; /* @@ -536,7 +538,7 @@ APR_EXPORT(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, */ apr_MD5Init(&ctx); #ifdef CHARSET_EBCDIC - ap_MD5SetXlate(&ctx, xlate_ebcdic_to_ascii); + apr_MD5SetXlate(&ctx, xlate_ebcdic_to_ascii); #endif /* @@ -563,7 +565,8 @@ APR_EXPORT(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); apr_MD5Final(final, &ctx1); for (pl = strlen(pw); pl > 0; pl -= MD5_DIGESTSIZE) { - apr_MD5Update(&ctx, final, (pl > MD5_DIGESTSIZE) ? MD5_DIGESTSIZE : pl); + apr_MD5Update(&ctx, final, + (pl > MD5_DIGESTSIZE) ? MD5_DIGESTSIZE : pl); } /* @@ -649,7 +652,8 @@ APR_EXPORT(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, * APR_EMISMATCH if they don't. */ -APR_EXPORT(apr_status_t) apr_validate_password(const char *passwd, const char *hash) +APR_EXPORT(apr_status_t) apr_validate_password(const char *passwd, + const char *hash) { char sample[120]; #if !defined(WIN32) && !defined(BEOS) diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index 7c12cc8788f..53433c6563d 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -108,7 +108,7 @@ APR_EXPORT(char *) apr_cpystrn(char *dst, const char *src, size_t dst_size) * This function provides a way to parse a generic argument string * into a standard argv[] form of argument list. It respects the * usual "whitespace" and quoteing rules. In the future this could - * be expanded to include support for the ap_call_exec command line + * be expanded to include support for the apr_call_exec command line * string processing (including converting '+' to ' ' and doing the * url processing. It does not currently support this function. * @@ -237,7 +237,7 @@ APR_EXPORT(const char *) apr_filename_of_pathname(const char *pathname) APR_EXPORT(char *) apr_collapse_spaces(char *dest, const char *src) { while (*src) { - if (!ap_isspace(*src)) + if (!apr_isspace(*src)) *dest++ = *src; ++src; } @@ -254,8 +254,8 @@ char *strdup(const char *str) if (!(sdup = (char *) malloc(len))) { /* ### whoops! we can't call Apache logging routines here... */ #if 0 - ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, - "Ouch! Out of memory in our strdup()!"); + apr_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, + "Ouch! Out of memory in our strdup()!"); #endif return NULL; } @@ -272,7 +272,7 @@ int strcasecmp(const char *a, const char *b) const char *p = a; const char *q = b; for (p = a, q = b; *p && *q; p++, q++) { - int diff = ap_tolower(*p) - ap_tolower(*q); + int diff = apr_tolower(*p) - apr_tolower(*q); if (diff) return diff; } @@ -297,7 +297,7 @@ int strncasecmp(const char *a, const char *b, size_t n) return 0; /* Match up to n characters */ if (!(*p && *q)) return *p - *q; - diff = ap_tolower(*p) - ap_tolower(*q); + diff = apr_tolower(*p) - apr_tolower(*q); if (diff) return diff; } diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index f1c86fca303..131379eca7e 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -146,7 +146,7 @@ APR_EXPORT(apr_status_t) apr_fnmatch(const char *pattern, const char *string, in /* FALLTHROUGH */ default: if (flags & FNM_CASE_BLIND) { - if (ap_tolower(c) != ap_tolower(*string)) { + if (apr_tolower(c) != apr_tolower(*string)) { return (FNM_NOMATCH); } } @@ -193,14 +193,14 @@ static const char *rangematch(const char *pattern, int test, int flags) } if ((c <= test && test <= c2) || ((flags & FNM_CASE_BLIND) - && ((ap_tolower(c) <= ap_tolower(test)) - && (ap_tolower(test) <= ap_tolower(c2))))) { + && ((apr_tolower(c) <= apr_tolower(test)) + && (apr_tolower(test) <= apr_tolower(c2))))) { ok = 1; } } else if ((c == test) || ((flags & FNM_CASE_BLIND) - && (ap_tolower(c) == ap_tolower(test)))) { + && (apr_tolower(c) == apr_tolower(test)))) { ok = 1; } } diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 3427baa6937..9e826938dbf 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -90,12 +90,12 @@ typedef enum { #ifndef TRUE #define TRUE 1 #endif -#ifndef AP_LONGEST_LONG -#define AP_LONGEST_LONG long +#ifndef APR_LONGEST_LONG +#define APR_LONGEST_LONG long #endif #define NUL '\0' #define WIDE_INT long -#define WIDEST_INT AP_LONGEST_LONG +#define WIDEST_INT APR_LONGEST_LONG typedef WIDE_INT wide_int; typedef unsigned WIDE_INT u_wide_int; @@ -127,7 +127,7 @@ typedef int bool_int; */ /* - * ap_ecvt converts to decimal + * apr_ecvt converts to decimal * the number of digits is specified by ndigit * decpt is set to the position of the decimal point * sign is set to 0 for positive, 1 for negative @@ -136,7 +136,8 @@ typedef int bool_int; #define NDIG 80 /* buf must have at least NDIG bytes */ -static char *ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag, char *buf) +static char *apr_cvt(double arg, int ndigits, int *decpt, int *sign, + int eflag, char *buf) { register int r2; double fi, fj; @@ -209,29 +210,29 @@ static char *ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag, c return (buf); } -static char *ap_ecvt(double arg, int ndigits, int *decpt, int *sign, char *buf) +static char *apr_ecvt(double arg, int ndigits, int *decpt, int *sign, char *buf) { - return (ap_cvt(arg, ndigits, decpt, sign, 1, buf)); + return (apr_cvt(arg, ndigits, decpt, sign, 1, buf)); } -static char *ap_fcvt(double arg, int ndigits, int *decpt, int *sign, char *buf) +static char *apr_fcvt(double arg, int ndigits, int *decpt, int *sign, char *buf) { - return (ap_cvt(arg, ndigits, decpt, sign, 0, buf)); + return (apr_cvt(arg, ndigits, decpt, sign, 0, buf)); } /* - * ap_gcvt - Floating output conversion to + * apr_gcvt - Floating output conversion to * minimal length string */ -static char *ap_gcvt(double number, int ndigit, char *buf, boolean_e altform) +static char *apr_gcvt(double number, int ndigit, char *buf, boolean_e altform) { int sign, decpt; register char *p1, *p2; register int i; char buf1[NDIG]; - p1 = ap_ecvt(number, ndigit, &decpt, &sign, buf1); + p1 = apr_ecvt(number, ndigit, &decpt, &sign, buf1); p2 = buf; if (sign) *p2++ = '-'; @@ -310,7 +311,7 @@ static char *ap_gcvt(double number, int ndigit, char *buf, boolean_e altform) #define STR_TO_DEC( str, num ) \ num = NUM( *str++ ) ; \ - while ( ap_isdigit( *str ) ) \ + while ( apr_isdigit( *str ) ) \ { \ num *= 10 ; \ num += NUM( *str++ ) ; \ @@ -523,14 +524,14 @@ static char *conv_fp(register char format, register double num, char buf1[NDIG]; if (format == 'f') - p = ap_fcvt(num, precision, &decimal_point, is_negative, buf1); + p = apr_fcvt(num, precision, &decimal_point, is_negative, buf1); else /* either e or E format */ - p = ap_ecvt(num, precision + 1, &decimal_point, is_negative, buf1); + p = apr_ecvt(num, precision + 1, &decimal_point, is_negative, buf1); /* * Check for Infinity and NaN */ - if (ap_isalpha(*p)) { + if (apr_isalpha(*p)) { *len = strlen(strcpy(buf, p)); *is_negative = FALSE; return (buf); @@ -721,7 +722,7 @@ APR_EXPORT(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * Try to avoid checking for flags, width or precision */ - if (!ap_islower(*fmt)) { + if (!apr_islower(*fmt)) { /* * Recognize flags: -, #, BLANK, + */ @@ -743,7 +744,7 @@ APR_EXPORT(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * Check if a width was specified */ - if (ap_isdigit(*fmt)) { + if (apr_isdigit(*fmt)) { STR_TO_DEC(fmt, min_width); adjust_width = YES; } @@ -769,7 +770,7 @@ APR_EXPORT(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), if (*fmt == '.') { adjust_precision = YES; fmt++; - if (ap_isdigit(*fmt)) { + if (apr_isdigit(*fmt)) { STR_TO_DEC(fmt, precision); } else if (*fmt == '*') { @@ -958,7 +959,7 @@ APR_EXPORT(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * * We use &num_buf[ 1 ], so that we have room for the sign */ - s = ap_gcvt(va_arg(ap, double), precision, &num_buf[1], + s = apr_gcvt(va_arg(ap, double), precision, &num_buf[1], alternate_form); if (*s == '-') prefix_char = *s++; @@ -1018,7 +1019,7 @@ APR_EXPORT(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), * don't handle "%p". */ case 'p': -#ifdef AP_VOID_P_IS_QUAD +#ifdef APR_VOID_P_IS_QUAD if (sizeof(void *) <= sizeof(u_widest_int)) { ui_quad = (u_widest_int) va_arg(ap, void *); s = conv_p2_quad(ui_quad, 4, 'x', diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 2cff888ba08..31ccc12aa00 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -80,10 +80,10 @@ * isn't too bad given that pools have a low allocation overhead. */ -typedef struct ap_hash_entry_t ap_hash_entry_t; +typedef struct apr_hash_entry_t apr_hash_entry_t; -struct ap_hash_entry_t { - ap_hash_entry_t *next; +struct apr_hash_entry_t { + apr_hash_entry_t *next; int hash; const void *key; size_t klen; @@ -98,9 +98,9 @@ struct ap_hash_entry_t { * collision rate. */ struct apr_hash_t { - apr_pool_t *pool; - ap_hash_entry_t **array; - size_t count, max; + apr_pool_t *pool; + apr_hash_entry_t **array; + size_t count, max; }; #define INITIAL_MAX 15 /* tunable == 2^n - 1 */ @@ -112,9 +112,9 @@ struct apr_hash_t { * apr_hash_next(). */ struct apr_hash_index_t { - apr_hash_t *ht; - ap_hash_entry_t *this, *next; - int index; + apr_hash_t *ht; + apr_hash_entry_t *this, *next; + size_t index; }; @@ -122,7 +122,7 @@ struct apr_hash_index_t { * Hash creation functions. */ -static ap_hash_entry_t **alloc_array(apr_hash_t *ht) +static apr_hash_entry_t **alloc_array(apr_hash_t *ht) { return apr_pcalloc(ht->pool, sizeof(*ht->array) * (ht->max + 1)); } @@ -167,9 +167,9 @@ APR_EXPORT(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht) } APR_EXPORT(void) apr_hash_this(apr_hash_index_t *hi, - const void **key, - size_t *klen, - void **val) + const void **key, + size_t *klen, + void **val) { if (key) *key = hi->this->key; if (klen) *klen = hi->this->klen; @@ -184,7 +184,7 @@ APR_EXPORT(void) apr_hash_this(apr_hash_index_t *hi, static void resize_array(apr_hash_t *ht) { apr_hash_index_t *hi; - ap_hash_entry_t **new_array; + apr_hash_entry_t **new_array; int i; new_array = alloc_array(ht); @@ -205,12 +205,12 @@ static void resize_array(apr_hash_t *ht) * that hash entries can be removed. */ -static ap_hash_entry_t **find_entry(apr_hash_t *ht, +static apr_hash_entry_t **find_entry(apr_hash_t *ht, const void *key, size_t klen, const void *val) { - ap_hash_entry_t **hep, *he; + apr_hash_entry_t **hep, *he; const unsigned char *p; int hash; int i; @@ -284,7 +284,7 @@ APR_EXPORT(void *) apr_hash_get(apr_hash_t *ht, const void *key, size_t klen) { - ap_hash_entry_t *he; + apr_hash_entry_t *he; he = *find_entry(ht, key, klen, NULL); if (he) return (void *)he->val; @@ -297,7 +297,7 @@ APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, size_t klen, const void *val) { - ap_hash_entry_t **hep; + apr_hash_entry_t **hep; hep = find_entry(ht, key, klen, val); if (*hep) { if (!val) { diff --git a/tables/apr_tables.c b/tables/apr_tables.c index f7661c49cab..0ae34bbe1e2 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -313,7 +313,7 @@ APR_EXPORT(apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) /* we don't copy keys and values, so it's necessary that t->a.pool * have a life span at least as long as p */ - if (!ap_pool_is_ancestor(t->a.cont, p)) { + if (!apr_pool_is_ancestor(t->a.cont, p)) { fprintf(stderr, "copy_table: t's pool is not an ancestor of p\n"); abort(); } @@ -390,11 +390,11 @@ APR_EXPORT(void) apr_table_setn(apr_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!ap_pool_is_ancestor(ap_find_pool(key), t->a.cont)) { + if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!ap_pool_is_ancestor(ap_find_pool(val), t->a.cont)) { + if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.cont)) { fprintf(stderr, "table_set: val not in ancestor pool of t\n"); abort(); } @@ -479,11 +479,11 @@ APR_EXPORT(void) apr_table_mergen(apr_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!ap_pool_is_ancestor(ap_find_pool(key), t->a.cont)) { + if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!ap_pool_is_ancestor(ap_find_pool(val), t->a.cont)) { + if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } @@ -519,11 +519,11 @@ APR_EXPORT(void) apr_table_addn(apr_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!ap_pool_is_ancestor(ap_find_pool(key), t->a.cont)) { + if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!ap_pool_is_ancestor(ap_find_pool(val), t->a.cont)) { + if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.cont)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } @@ -546,12 +546,12 @@ APR_EXPORT(apr_table_t *) apr_overlay_tables(apr_pool_t *p, * overlay->a.pool and base->a.pool have a life span at least * as long as p */ - if (!ap_pool_is_ancestor(overlay->a.cont, p)) { + if (!apr_pool_is_ancestor(overlay->a.cont, p)) { fprintf(stderr, "overlay_tables: overlay's pool is not an ancestor of p\n"); abort(); } - if (!ap_pool_is_ancestor(base->a.cont, p)) { + if (!apr_pool_is_ancestor(base->a.cont, p)) { fprintf(stderr, "overlay_tables: base's pool is not an ancestor of p\n"); abort(); @@ -593,19 +593,19 @@ APR_EXPORT(apr_table_t *) apr_overlay_tables(apr_pool_t *p, * * The caching api will allow a user to walk the header values: * - * apr_status_t ap_cache_el_header_walk(ap_cache_el *el, + * apr_status_t apr_cache_el_header_walk(apr_cache_el *el, * int (*comp)(void *, const char *, const char *), void *rec, ...); * * So it can be ..., however from there I use a callback that use a va_list: * - * apr_status_t (*cache_el_header_walk)(ap_cache_el *el, + * apr_status_t (*cache_el_header_walk)(apr_cache_el *el, * int (*comp)(void *, const char *, const char *), void *rec, va_list); * * To pass those ...'s on down to the actual module that will handle walking - * their headers, in the file case this is actually just an ap_table - and + * their headers, in the file case this is actually just an apr_table - and * rather than reimplementing apr_table_do (which IMHO would be bad) I just * called it with the va_list. For mod_shmem_cache I don't need it since I - * can't use ap_table's, but mod_file_cache should (though a good hash would + * can't use apr_table's, but mod_file_cache should (though a good hash would * be better, but that's a different issue :). * * So to make mod_file_cache easier to maintain, it's a good thing @@ -662,14 +662,14 @@ static int sort_overlap(const void *va, const void *vb) } /* prefer to use the stack for temp storage for overlaps smaller than this */ -#ifndef ap_OVERLAP_TABLES_ON_STACK -#define ap_OVERLAP_TABLES_ON_STACK (512) +#ifndef APR_OVERLAP_TABLES_ON_STACK +#define APR_OVERLAP_TABLES_ON_STACK (512) #endif APR_EXPORT(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, unsigned flags) { - overlap_key cat_keys_buf[ap_OVERLAP_TABLES_ON_STACK]; + overlap_key cat_keys_buf[APR_OVERLAP_TABLES_ON_STACK]; overlap_key *cat_keys; int nkeys; apr_table_entry_t *e; @@ -679,7 +679,7 @@ APR_EXPORT(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, overlap_key *last; nkeys = a->a.nelts + b->a.nelts; - if (nkeys < ap_OVERLAP_TABLES_ON_STACK) { + if (nkeys < APR_OVERLAP_TABLES_ON_STACK) { cat_keys = cat_keys_buf; } else { @@ -736,7 +736,7 @@ APR_EXPORT(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, * appropriate. */ - if (flags & AP_OVERLAP_TABLES_MERGE) { + if (flags & APR_OVERLAP_TABLES_MERGE) { left = cat_keys; last = left + nkeys; while (left < last) { diff --git a/test/client.c b/test/client.c index 845e643b3a5..64ca1f6121f 100644 --- a/test/client.c +++ b/test/client.c @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) } if (argc > 2) { - read_timeout = AP_USEC_PER_SEC * atoi(argv[2]); + read_timeout = APR_USEC_PER_SEC * atoi(argv[2]); } fprintf(stdout, "Initializing........."); diff --git a/test/testargs.c b/test/testargs.c index 448bf5cb80a..9ab990679d7 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -79,12 +79,12 @@ int main(int argc, char * const argv[]) printf("option %c\n", data); break; case 'c': - printf("option %c with %s\n", data, ap_optarg); + printf("option %c with %s\n", data, apr_optarg); break; case 'd': printf("option %c", data); - if (ap_optarg) { - printf(" with %s\n", ap_optarg); + if (apr_optarg) { + printf(" with %s\n", apr_optarg); } else { printf("\n"); diff --git a/test/testfile.c b/test/testfile.c index 347cc53ad89..efbe5fb9e0d 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -278,7 +278,7 @@ int testdirs(apr_pool_t *context) apr_dir_t *temp; apr_file_t *file = NULL; apr_ssize_t bytes; - ap_filetype_e type; + apr_filetype_e type; char *fname; fprintf(stdout, "Testing Directory functions.\n"); diff --git a/test/testmd5.c b/test/testmd5.c index b05c1c87fa4..ca6614f7092 100644 --- a/test/testmd5.c +++ b/test/testmd5.c @@ -86,7 +86,7 @@ static void try(const void *buf, size_t bufLen, apr_xlate_t *xlate, { int i; apr_status_t rv; - ap_md5_ctx_t context; + apr_md5_ctx_t context; unsigned char hash[MD5_DIGESTSIZE]; rv = apr_MD5Init(&context); @@ -94,7 +94,7 @@ static void try(const void *buf, size_t bufLen, apr_xlate_t *xlate, if (xlate) { #if APR_HAS_XLATE - ap_MD5SetXlate(&context, xlate); + apr_MD5SetXlate(&context, xlate); #else fprintf(stderr, "A translation handle was unexpected.\n"); @@ -156,11 +156,11 @@ int main(int argc, char **argv) if (src) { #if APR_HAS_XLATE - rv = ap_xlate_open(&xlate, dst, src, pool); + rv = apr_xlate_open(&xlate, dst, src, pool); if (rv) { char buf[80]; - fprintf(stderr, "ap_xlate_open()->%s (%d)\n", + fprintf(stderr, "apr_xlate_open()->%s (%d)\n", apr_strerror(rv, buf, sizeof(buf)), rv); exit(1); } diff --git a/test/testpipe.c b/test/testpipe.c index 9075c056e0a..4f1bdb1490b 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -95,7 +95,7 @@ int main(void) } fprintf(stdout, "\tSetting pipe timeout......."); - if ((rv = apr_set_pipe_timeout(readp, 1 * AP_USEC_PER_SEC)) != APR_SUCCESS) { + if ((rv = apr_set_pipe_timeout(readp, 1 * APR_USEC_PER_SEC)) != APR_SUCCESS) { fprintf(stderr, "apr_set_pipe_timeout()->%d/%s\n", rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); exit(-1); diff --git a/test/testsf.c b/test/testsf.c index 8d2f8a5d3b3..cde32bf8344 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -239,7 +239,7 @@ static int client(client_socket_mode_t socket_mode) case TIMEOUT: /* set a timeout */ rv = apr_setsocketopt(sock, APR_SO_TIMEOUT, - 100 * AP_USEC_PER_SEC); + 100 * APR_USEC_PER_SEC); if (rv != APR_SUCCESS) { fprintf(stderr, "apr_setsocketopt(APR_SO_NONBLOCK)->%d/%s\n", rv, diff --git a/test/testtime.c b/test/testtime.c index 1a5633fdb23..816cb70dda6 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -64,7 +64,7 @@ int main() { apr_time_t now; - ap_exploded_time_t xt; + apr_exploded_time_t xt; apr_time_t imp; fprintf(stdout, "Testing Time functions.\n"); diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 4092455f587..bf09188c54a 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -277,7 +277,7 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, return APR_SUCCESS; } -apr_status_t apr_wait_all_procs(apr_proc_t *proc, ap_wait_t *status, +apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) { int waitpid_options = WUNTRACED; diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index ea5e73fe32c..c389148c120 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -491,7 +491,7 @@ apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, -apr_status_t apr_wait_all_procs(apr_proc_t *proc, ap_wait_t *status, +apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) { RESULTCODES codes; @@ -542,7 +542,7 @@ apr_status_t apr_wait_proc(apr_proc_t *proc, -apr_status_t ap_get_os_proc(apr_os_proc_t *theproc, apr_proc_t *proc) +apr_status_t apr_get_os_proc(apr_os_proc_t *theproc, apr_proc_t *proc) { if (proc == NULL) { return APR_ENOPROC; diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index e44106be018..3879f6d8012 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -92,7 +92,7 @@ apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) -static void ap_thread_begin(void *arg) +static void apr_thread_begin(void *arg) { apr_thread_t *thread = (apr_thread_t *)arg; thread->rv = thread->func(thread->data); @@ -133,9 +133,11 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, } if (thread->attr->attr & APR_THREADATTR_DETACHED) - thread->tid = _beginthread((os2_thread_start_t)func, NULL, APR_THREAD_STACKSIZE, data); + thread->tid = _beginthread((os2_thread_start_t)func, NULL, + APR_THREAD_STACKSIZE, data); else - thread->tid = _beginthread(ap_thread_begin, NULL, APR_THREAD_STACKSIZE, thread); + thread->tid = _beginthread(apr_thread_begin, NULL, + APR_THREAD_STACKSIZE, thread); if (thread->tid < 0) { return errno; diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 25a4b45c6ca..62ea3d770d2 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -358,7 +358,7 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, return APR_SUCCESS; } -apr_status_t apr_wait_all_procs(apr_proc_t *proc, ap_wait_t *status, +apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) { int waitpid_options = WUNTRACED; diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 1741b87d798..c362d07bae6 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -110,9 +110,9 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, bAsyncRead = TRUE; bAsyncWrite = TRUE; } - if ((stat = ap_create_nt_pipe(&attr->child_in, &attr->parent_in, - bAsyncRead, bAsyncWrite, - attr->cntxt)) != APR_SUCCESS) { + if ((stat = apr_create_nt_pipe(&attr->child_in, &attr->parent_in, + bAsyncRead, bAsyncWrite, + attr->cntxt)) != APR_SUCCESS) { return stat; } } @@ -133,9 +133,9 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, bAsyncRead = TRUE; bAsyncWrite = TRUE; } - if ((stat = ap_create_nt_pipe(&attr->parent_out, &attr->child_out, - bAsyncRead, bAsyncWrite, - attr->cntxt)) != APR_SUCCESS) { + if ((stat = apr_create_nt_pipe(&attr->parent_out, &attr->child_out, + bAsyncRead, bAsyncWrite, + attr->cntxt)) != APR_SUCCESS) { return stat; } } @@ -156,9 +156,9 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, bAsyncRead = TRUE; bAsyncWrite = TRUE; } - if ((stat = ap_create_nt_pipe(&attr->parent_err, &attr->child_err, - bAsyncRead, bAsyncWrite, - attr->cntxt)) != APR_SUCCESS) { + if ((stat = apr_create_nt_pipe(&attr->parent_err, &attr->child_err, + bAsyncRead, bAsyncWrite, + attr->cntxt)) != APR_SUCCESS) { return stat; } } @@ -432,7 +432,8 @@ apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e wait) if (!proc) return APR_ENOPROC; if (wait == APR_WAIT) { - if ((stat = WaitForSingleObject(proc->pid, INFINITE)) == WAIT_OBJECT_0) { + if ((stat = WaitForSingleObject((HANDLE)proc->pid, + INFINITE)) == WAIT_OBJECT_0) { return APR_CHILD_DONE; } else if (stat == WAIT_TIMEOUT) { @@ -440,7 +441,7 @@ apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e wait) } return GetLastError(); } - if ((stat = WaitForSingleObject(proc->pid, 0)) == WAIT_OBJECT_0) { + if ((stat = WaitForSingleObject((HANDLE)proc->pid, 0)) == WAIT_OBJECT_0) { return APR_CHILD_DONE; } else if (stat == WAIT_TIMEOUT) { diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index a75cd530956..8346c40f53b 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -66,7 +66,7 @@ /* Windows only really support killing process, but that will do for now. */ apr_status_t apr_kill(apr_proc_t *proc, int signal) { - if (TerminateProcess(proc->pid, signal) == 0) { + if (TerminateProcess((HANDLE)proc->pid, signal) == 0) { return GetLastError(); } return APR_SUCCESS; diff --git a/time/unix/time.c b/time/unix/time.c index 60a29c18973..96b5d664464 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -76,9 +76,9 @@ /* End System Headers */ -apr_status_t apr_ansi_time_to_ap_time(apr_time_t *result, time_t input) +apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input) { - *result = (apr_time_t)input * AP_USEC_PER_SEC; + *result = (apr_time_t)input * APR_USEC_PER_SEC; return APR_SUCCESS; } @@ -87,11 +87,11 @@ apr_time_t apr_now(void) { struct timeval tv; gettimeofday(&tv, NULL); - return tv.tv_sec * AP_USEC_PER_SEC + tv.tv_usec; + return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec; } -static void tm_to_exp(ap_exploded_time_t *xt, struct tm *tm) +static void tm_to_exp(apr_exploded_time_t *xt, struct tm *tm) { xt->tm_sec = tm->tm_sec; xt->tm_min = tm->tm_min; @@ -105,14 +105,14 @@ static void tm_to_exp(ap_exploded_time_t *xt, struct tm *tm) } -apr_status_t apr_explode_gmt(ap_exploded_time_t *result, apr_time_t input) +apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input) { - time_t t = input / AP_USEC_PER_SEC; + time_t t = input / APR_USEC_PER_SEC; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) struct tm banana; #endif - result->tm_usec = input % AP_USEC_PER_SEC; + result->tm_usec = input % APR_USEC_PER_SEC; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) gmtime_r(&t, &banana); @@ -124,13 +124,13 @@ apr_status_t apr_explode_gmt(ap_exploded_time_t *result, apr_time_t input) return APR_SUCCESS; } -apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input) +apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) { #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) - time_t t = input / AP_USEC_PER_SEC; + time_t t = input / APR_USEC_PER_SEC; struct tm apricot; - result->tm_usec = input % AP_USEC_PER_SEC; + result->tm_usec = input % APR_USEC_PER_SEC; localtime_r(&t, &apricot); tm_to_exp(result, &apricot); @@ -152,10 +152,10 @@ apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input) } #endif #else - time_t t = input / AP_USEC_PER_SEC; + time_t t = input / APR_USEC_PER_SEC; struct tm *tmx; - result->tm_usec = input % AP_USEC_PER_SEC; + result->tm_usec = input % APR_USEC_PER_SEC; tmx = localtime(&t); tm_to_exp(result, tmx); @@ -181,7 +181,7 @@ apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input) } -apr_status_t apr_implode_time(apr_time_t *t, ap_exploded_time_t *xt) +apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) { int year; time_t days; @@ -211,18 +211,19 @@ apr_status_t apr_implode_time(apr_time_t *t, ap_exploded_time_t *xt) return APR_EBADDATE; } days -= xt->tm_gmtoff; - *t = days * AP_USEC_PER_SEC + xt->tm_usec; + *t = days * APR_USEC_PER_SEC + xt->tm_usec; return APR_SUCCESS; } apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime) { - (*ostime)->tv_usec = *aprtime % AP_USEC_PER_SEC; - (*ostime)->tv_sec = *aprtime / AP_USEC_PER_SEC; + (*ostime)->tv_usec = *aprtime % APR_USEC_PER_SEC; + (*ostime)->tv_sec = *aprtime / APR_USEC_PER_SEC; return APR_SUCCESS; } -apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, ap_exploded_time_t *aprtime) +apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, + apr_exploded_time_t *aprtime) { (*ostime)->tm_sec = aprtime->tm_sec; (*ostime)->tm_min = aprtime->tm_min; @@ -239,12 +240,12 @@ apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, ap_exploded_time_t apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont) { - *aprtime = (*ostime)->tv_sec * AP_USEC_PER_SEC + (*ostime)->tv_usec; + *aprtime = (*ostime)->tv_sec * APR_USEC_PER_SEC + (*ostime)->tv_usec; return APR_SUCCESS; } -apr_status_t apr_put_os_exp_time(ap_exploded_time_t *aprtime, - apr_os_exp_time_t **ostime, apr_pool_t *cont) +apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime, + apr_os_exp_time_t **ostime, apr_pool_t *cont) { aprtime->tm_sec = (*ostime)->tm_sec; aprtime->tm_min = (*ostime)->tm_min; @@ -264,14 +265,15 @@ void apr_sleep(apr_interval_time_t t) DosSleep(t/1000); #else struct timeval tv; - tv.tv_usec = t % AP_USEC_PER_SEC; - tv.tv_sec = t / AP_USEC_PER_SEC; + tv.tv_usec = t % APR_USEC_PER_SEC; + tv.tv_sec = t / APR_USEC_PER_SEC; select(0, NULL, NULL, NULL, &tv); #endif } #ifdef OS2 -apr_status_t ap_os2_time_to_ap_time(apr_time_t *result, FDATE os2date, FTIME os2time) +apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, + FTIME os2time) { struct tm tmpdate; @@ -285,7 +287,7 @@ apr_status_t ap_os2_time_to_ap_time(apr_time_t *result, FDATE os2date, FTIME os2 tmpdate.tm_year = os2date.year + 80; tmpdate.tm_isdst = -1; - *result = mktime(&tmpdate) * AP_USEC_PER_SEC; + *result = mktime(&tmpdate) * APR_USEC_PER_SEC; return APR_SUCCESS; } #endif diff --git a/time/unix/timestr.c b/time/unix/timestr.c index 22b342dcf09..52aa1f148a5 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -68,18 +68,18 @@ #endif /* End System Headers */ -APR_VAR_EXPORT const char ap_month_snames[12][4] = +APR_VAR_EXPORT const char apr_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -APR_VAR_EXPORT const char ap_day_snames[7][4] = +APR_VAR_EXPORT const char apr_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) { - ap_exploded_time_t xt; + apr_exploded_time_t xt; const char *s; int real_year; @@ -88,7 +88,7 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) /* example: "Sat, 08 Jan 2000 18:31:41 GMT" */ /* 12345678901234567890123456789 */ - s = &ap_day_snames[xt.tm_wday][0]; + s = &apr_day_snames[xt.tm_wday][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; @@ -97,7 +97,7 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) *date_str++ = xt.tm_mday / 10 + '0'; *date_str++ = xt.tm_mday % 10 + '0'; *date_str++ = ' '; - s = &ap_month_snames[xt.tm_mon][0]; + s = &apr_month_snames[xt.tm_mon][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; @@ -127,7 +127,7 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) apr_status_t apr_ctime(char *date_str, apr_time_t t) { - ap_exploded_time_t xt; + apr_exploded_time_t xt; const char *s; int real_year; @@ -135,12 +135,12 @@ apr_status_t apr_ctime(char *date_str, apr_time_t t) /* 123456789012345678901234 */ apr_explode_localtime(&xt, t); - s = &ap_day_snames[xt.tm_wday][0]; + s = &apr_day_snames[xt.tm_wday][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = ' '; - s = &ap_month_snames[xt.tm_mon][0]; + s = &apr_month_snames[xt.tm_mon][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; @@ -168,7 +168,7 @@ apr_status_t apr_ctime(char *date_str, apr_time_t t) } apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, - const char *format, ap_exploded_time_t *xt) + const char *format, apr_exploded_time_t *xt) { struct tm tm; diff --git a/time/win32/access.c b/time/win32/access.c index e38d7d575ce..0bc5f871908 100644 --- a/time/win32/access.c +++ b/time/win32/access.c @@ -57,7 +57,7 @@ #include "apr_general.h" #include "apr_lib.h" -apr_status_t ap_get_curtime(struct atime_t *time, apr_time_t *rv) +apr_status_t apr_get_curtime(struct atime_t *time, apr_time_t *rv) { if (time) { (*rv) = time->currtime; @@ -66,7 +66,7 @@ apr_status_t ap_get_curtime(struct atime_t *time, apr_time_t *rv) return APR_ENOTIME; } -apr_status_t ap_get_sec(struct atime_t *time, apr_int32_t *rv) +apr_status_t apr_get_sec(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wSecond; @@ -75,7 +75,7 @@ apr_status_t ap_get_sec(struct atime_t *time, apr_int32_t *rv) return APR_ENOTIME; } -apr_status_t ap_get_min(struct atime_t *time, apr_int32_t *rv) +apr_status_t apr_get_min(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wMinute; @@ -84,7 +84,7 @@ apr_status_t ap_get_min(struct atime_t *time, apr_int32_t *rv) return APR_ENOTIME; } -apr_status_t ap_get_hour(struct atime_t *time, apr_int32_t *rv) +apr_status_t apr_get_hour(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wHour; @@ -93,7 +93,7 @@ apr_status_t ap_get_hour(struct atime_t *time, apr_int32_t *rv) return APR_ENOTIME; } -apr_status_t ap_get_mday(struct atime_t *time, apr_int32_t *rv) +apr_status_t apr_get_mday(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wDay; @@ -102,7 +102,7 @@ apr_status_t ap_get_mday(struct atime_t *time, apr_int32_t *rv) return APR_ENOTIME; } -apr_status_t ap_get_mon(struct atime_t *time, apr_int32_t *rv) +apr_status_t apr_get_mon(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wMonth; @@ -111,7 +111,7 @@ apr_status_t ap_get_mon(struct atime_t *time, apr_int32_t *rv) return APR_ENOTIME; } -apr_status_t ap_get_year(struct atime_t *time, apr_int32_t *rv) +apr_status_t apr_get_year(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wYear; @@ -120,7 +120,7 @@ apr_status_t ap_get_year(struct atime_t *time, apr_int32_t *rv) return APR_ENOTIME; } -apr_status_t ap_get_wday(struct atime_t *time, apr_int32_t *rv) +apr_status_t apr_get_wday(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wDayOfWeek; @@ -129,7 +129,7 @@ apr_status_t ap_get_wday(struct atime_t *time, apr_int32_t *rv) return APR_ENOTIME; } -apr_status_t ap_set_sec(struct atime_t *time, apr_int32_t value) +apr_status_t apr_set_sec(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; @@ -145,7 +145,7 @@ apr_status_t ap_set_sec(struct atime_t *time, apr_int32_t value) return APR_SUCCESS; } -apr_status_t ap_set_min(struct atime_t *time, apr_int32_t value) +apr_status_t apr_set_min(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; @@ -161,7 +161,7 @@ apr_status_t ap_set_min(struct atime_t *time, apr_int32_t value) return APR_SUCCESS; } -apr_status_t ap_set_hour(struct atime_t *time, apr_int32_t value) +apr_status_t apr_set_hour(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; @@ -177,7 +177,7 @@ apr_status_t ap_set_hour(struct atime_t *time, apr_int32_t value) return APR_SUCCESS; } -apr_status_t ap_set_mday(struct atime_t *time, apr_int32_t value) +apr_status_t apr_set_mday(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; @@ -193,7 +193,7 @@ apr_status_t ap_set_mday(struct atime_t *time, apr_int32_t value) return APR_SUCCESS; } -apr_status_t ap_set_mon(struct atime_t *time, apr_int32_t value) +apr_status_t apr_set_mon(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; @@ -209,7 +209,7 @@ apr_status_t ap_set_mon(struct atime_t *time, apr_int32_t value) return APR_SUCCESS; } -apr_status_t ap_set_year(struct atime_t *time, apr_int32_t value) +apr_status_t apr_set_year(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; @@ -225,7 +225,7 @@ apr_status_t ap_set_year(struct atime_t *time, apr_int32_t value) return APR_SUCCESS; } -apr_status_t ap_set_wday(struct atime_t *time, apr_int32_t value) +apr_status_t apr_set_wday(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; diff --git a/time/win32/time.c b/time/win32/time.c index 899a57a55e1..f45f7485035 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -65,7 +65,7 @@ /* Number of micro-seconds between the beginning of the Windows epoch * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970) */ -#define AP_DELTA_EPOCH_IN_USEC 11644473600000000; +#define APR_DELTA_EPOCH_IN_USEC 11644473600000000; void FileTimeToAprTime(apr_time_t *result, FILETIME *input) { @@ -74,20 +74,20 @@ void FileTimeToAprTime(apr_time_t *result, FILETIME *input) *result = (*result) << 32; *result |= input->dwLowDateTime; *result /= 10; /* Convert from 100 nano-sec periods to micro-seconds. */ - *result -= AP_DELTA_EPOCH_IN_USEC; /* Convert from Windows epoch to Unix epoch */ + *result -= APR_DELTA_EPOCH_IN_USEC; /* Convert from Windows epoch to Unix epoch */ return; } void AprTimeToFileTime(LPFILETIME pft, apr_time_t t) { LONGLONG ll; - t += AP_DELTA_EPOCH_IN_USEC; + t += APR_DELTA_EPOCH_IN_USEC; ll = t * 10; pft->dwLowDateTime = (DWORD)ll; pft->dwHighDateTime = (DWORD) (ll >> 32); return; } -void SystemTimeToAprExpTime(ap_exploded_time_t *xt, SYSTEMTIME *tm) +void SystemTimeToAprExpTime(apr_exploded_time_t *xt, SYSTEMTIME *tm) { TIME_ZONE_INFORMATION tz; DWORD rc; @@ -123,9 +123,9 @@ void SystemTimeToAprExpTime(ap_exploded_time_t *xt, SYSTEMTIME *tm) return; } -apr_status_t apr_ansi_time_to_ap_time(apr_time_t *result, time_t input) +apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input) { - *result = (apr_time_t) input * AP_USEC_PER_SEC; + *result = (apr_time_t) input * APR_USEC_PER_SEC; return APR_SUCCESS; } @@ -139,7 +139,7 @@ apr_time_t apr_now(void) return aprtime; } -apr_status_t apr_explode_gmt(ap_exploded_time_t *result, apr_time_t input) +apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input) { FILETIME ft; SYSTEMTIME st; @@ -149,7 +149,7 @@ apr_status_t apr_explode_gmt(ap_exploded_time_t *result, apr_time_t input) return APR_SUCCESS; } -apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input) +apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) { SYSTEMTIME st; FILETIME ft, localft; @@ -161,7 +161,7 @@ apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input) return APR_SUCCESS; } -apr_status_t apr_implode_time(apr_time_t *t, ap_exploded_time_t *xt) +apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) { int year; time_t days; @@ -191,7 +191,7 @@ apr_status_t apr_implode_time(apr_time_t *t, ap_exploded_time_t *xt) return APR_EBADDATE; } days -= xt->tm_gmtoff; - *t = days * AP_USEC_PER_SEC + xt->tm_usec; + *t = days * APR_USEC_PER_SEC + xt->tm_usec; return APR_SUCCESS; } @@ -202,7 +202,8 @@ apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime return APR_SUCCESS; } -apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, ap_exploded_time_t *aprexptime) +apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, + apr_exploded_time_t *aprexptime) { (*ostime)->wYear = aprexptime->tm_year + 1900; (*ostime)->wMonth = aprexptime->tm_mon + 1; @@ -222,8 +223,8 @@ apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime return APR_SUCCESS; } -apr_status_t apr_put_os_exp_time(ap_exploded_time_t *aprtime, - apr_os_exp_time_t **ostime, apr_pool_t *cont) +apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime, + apr_os_exp_time_t **ostime, apr_pool_t *cont) { SystemTimeToAprExpTime(aprtime, *ostime); return APR_SUCCESS; diff --git a/time/win32/timestr.c b/time/win32/timestr.c index df8254c551f..4f397cdd3b1 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -55,18 +55,18 @@ #include "atime.h" #include "apr_portable.h" -APR_VAR_EXPORT const char ap_month_snames[12][4] = +APR_VAR_EXPORT const char apr_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -APR_VAR_EXPORT const char ap_day_snames[7][4] = +APR_VAR_EXPORT const char apr_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) { - ap_exploded_time_t xt; + apr_exploded_time_t xt; const char *s; int real_year; @@ -75,7 +75,7 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) /* example: "Sat, 08 Jan 2000 18:31:41 GMT" */ /* 12345678901234567890123456789 */ - s = &ap_day_snames[xt.tm_wday][0]; + s = &apr_day_snames[xt.tm_wday][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; @@ -84,7 +84,7 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) *date_str++ = xt.tm_mday / 10 + '0'; *date_str++ = xt.tm_mday % 10 + '0'; *date_str++ = ' '; - s = &ap_month_snames[xt.tm_mon][0]; + s = &apr_month_snames[xt.tm_mon][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; @@ -114,7 +114,7 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) apr_status_t apr_ctime(char *date_str, apr_time_t t) { - ap_exploded_time_t xt; + apr_exploded_time_t xt; const char *s; int real_year; @@ -122,12 +122,12 @@ apr_status_t apr_ctime(char *date_str, apr_time_t t) /* 123456789012345678901234 */ apr_explode_localtime(&xt, t); - s = &ap_day_snames[xt.tm_wday][0]; + s = &apr_day_snames[xt.tm_wday][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = ' '; - s = &ap_month_snames[xt.tm_mon][0]; + s = &apr_month_snames[xt.tm_mon][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; @@ -155,7 +155,7 @@ apr_status_t apr_ctime(char *date_str, apr_time_t t) } apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, - const char *format, ap_exploded_time_t *xt) + const char *format, apr_exploded_time_t *xt) { struct tm tm; memset(&tm, 0, sizeof tm); From 068785b3761f78606c2d983462eec023cf29662e Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 6 Aug 2000 14:20:25 +0000 Subject: [PATCH 0506/7878] Make this script recognizable as executable on a non-unix file system. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60482 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildconf b/buildconf index 06ef374b04a..a84acf3540c 100755 --- a/buildconf +++ b/buildconf @@ -1,3 +1,5 @@ +#!/bin/sh + autoconf;autoheader (cd shmem/unix/mm && autoconf) From a5b87ab531460154b836a8cc01622ee33410e1e2 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 6 Aug 2000 14:44:56 +0000 Subject: [PATCH 0507/7878] Add an OS/2 apr_signal(), pretty much copied from unix/signals.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60483 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/signals.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/threadproc/os2/signals.c b/threadproc/os2/signals.c index 5d7e7aee006..6efd71d1822 100644 --- a/threadproc/os2/signals.c +++ b/threadproc/os2/signals.c @@ -52,6 +52,7 @@ * . */ +#define INCL_DOSEXCEPTIONS #include "threadproc.h" #include "fileio.h" #include "apr_thread_proc.h" @@ -79,3 +80,21 @@ apr_status_t apr_kill(apr_proc_t *proc, int signal) return rc; } + + +/* + * Replace standard signal() with the more reliable sigaction equivalent + * from W. Richard Stevens' "Advanced Programming in the UNIX Environment" + * (the version that does not automatically restart system calls). + */ +Sigfunc *apr_signal(int signo, Sigfunc * func) +{ + struct sigaction act, oact; + + act.sa_handler = func; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; + if (sigaction(signo, &act, &oact) < 0) + return SIG_ERR; + return oact.sa_handler; +} From a8e42f03cc8372e527d35393e7474223aa053be8 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 6 Aug 2000 14:55:54 +0000 Subject: [PATCH 0508/7878] OS/2: Avoid unnecessary calls to set pipe blocking state. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60484 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/fileio.h | 1 + file_io/os2/open.c | 1 + file_io/os2/pipe.c | 13 +++++++++++-- include/arch/os2/fileio.h | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/file_io/os2/fileio.h b/file_io/os2/fileio.h index 5051cacc9ab..d2a44fd18bf 100644 --- a/file_io/os2/fileio.h +++ b/file_io/os2/fileio.h @@ -78,6 +78,7 @@ struct apr_file_t { int timeout; int pipe; HEV pipeSem; + enum { BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; /* Stuff for buffered mode */ char *buffer; diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 14c28617d9c..b952a774bd4 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -80,6 +80,7 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, ap dafile->eof_hit = FALSE; dafile->buffer = NULL; dafile->flags = flag; + dafile->blocking = BLK_ON; if ((flag & APR_READ) && (flag & APR_WRITE)) { mflags |= OPEN_ACCESS_READWRITE; diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index c3b01aa8e74..77ef2293eeb 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -120,6 +120,7 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont (*in)->flags = 0; (*in)->pipe = 1; (*in)->timeout = -1; + (*in)->blocking = BLK_ON; apr_register_cleanup(cont, *in, apr_file_cleanup, apr_null_cleanup); (*out) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); @@ -131,6 +132,7 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont (*out)->flags = 0; (*out)->pipe = 1; (*out)->timeout = -1; + (*out)->blocking = BLK_ON; apr_register_cleanup(cont, *out, apr_file_cleanup, apr_null_cleanup); return APR_SUCCESS; @@ -150,11 +152,18 @@ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeo { if (thepipe->pipe == 1) { thepipe->timeout = timeout; + if (thepipe->timeout >= 0) { - return APR_OS2_STATUS(DosSetNPHState (thepipe->filedes, NP_NOWAIT)); + if (thepipe->blocking != BLK_OFF) { + thepipe->blocking = BLK_OFF; + return APR_OS2_STATUS(DosSetNPHState(thepipe->filedes, NP_NOWAIT)); + } } else if (thepipe->timeout == -1) { - return APR_OS2_STATUS(DosSetNPHState (thepipe->filedes, NP_WAIT)); + if (thepipe->blocking != BLK_ON) { + thepipe->blocking = BLK_ON; + return APR_OS2_STATUS(DosSetNPHState(thepipe->filedes, NP_WAIT)); + } } } return APR_EINVAL; diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index 5051cacc9ab..d2a44fd18bf 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -78,6 +78,7 @@ struct apr_file_t { int timeout; int pipe; HEV pipeSem; + enum { BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; /* Stuff for buffered mode */ char *buffer; From 3f06501aa427ab11c5e342e89472d5bdeb2f3fea Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 6 Aug 2000 15:48:40 +0000 Subject: [PATCH 0509/7878] Use apr_is*() character test macros to avoid warnings about signed characters. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60485 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strnatcmp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/strings/apr_strnatcmp.c b/strings/apr_strnatcmp.c index f1057fde69a..1070ffdaba2 100644 --- a/strings/apr_strnatcmp.c +++ b/strings/apr_strnatcmp.c @@ -45,11 +45,11 @@ compare_right(char const *a, char const *b) both numbers to know that they have the same magnitude, so we remember it in BIAS. */ for (;; a++, b++) { - if (!isdigit(*a) && !isdigit(*b)) + if (!apr_isdigit(*a) && !apr_isdigit(*b)) return bias; - else if (!isdigit(*a)) + else if (!apr_isdigit(*a)) return -1; - else if (!isdigit(*b)) + else if (!apr_isdigit(*b)) return +1; else if (*a < *b) { if (!bias) @@ -71,11 +71,11 @@ compare_left(char const *a, char const *b) /* Compare two left-aligned numbers: the first to have a different value wins. */ for (;; a++, b++) { - if (!isdigit(*a) && !isdigit(*b)) + if (!apr_isdigit(*a) && !apr_isdigit(*b)) return 0; - else if (!isdigit(*a)) + else if (!apr_isdigit(*a)) return -1; - else if (!isdigit(*b)) + else if (!apr_isdigit(*b)) return +1; else if (*a < *b) return -1; @@ -99,14 +99,14 @@ static int strnatcmp0(char const *a, char const *b, int fold_case) ca = a[ai]; cb = b[bi]; /* skip over leading spaces or zeros */ - while (isspace(ca)) + while (apr_isspace(ca)) ca = a[++ai]; - while (isspace(cb)) + while (apr_isspace(cb)) cb = b[++bi]; /* process run of digits */ - if (isdigit(ca) && isdigit(cb)) { + if (apr_isdigit(ca) && apr_isdigit(cb)) { fractional = (ca == '0' || cb == '0'); if (fractional) { From 1b537db90c8ae006c3949248c70ea198687c6ba7 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 6 Aug 2000 16:35:56 +0000 Subject: [PATCH 0510/7878] Include apr_strings.h in a bunch more places that need it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60486 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/dir.c | 1 + file_io/os2/filedup.c | 1 + file_io/os2/open.c | 1 + file_io/os2/pipe.c | 1 + locks/os2/locks.c | 1 + network_io/os2/sockopt.c | 1 + shmem/os2/shmem.c | 1 + threadproc/os2/proc.c | 1 + 8 files changed, 8 insertions(+) diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 84529ba9eab..ee4d5e2a8d9 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -55,6 +55,7 @@ #include "fileio.h" #include "apr_file_io.h" #include "apr_lib.h" +#include "apr_strings.h" #include #define INCL_DOS diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index a921d096bbd..ee52fcddb7d 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -55,6 +55,7 @@ #include "fileio.h" #include "apr_file_io.h" #include "apr_lib.h" +#include "apr_strings.h" #include #define INCL_DOS diff --git a/file_io/os2/open.c b/file_io/os2/open.c index b952a774bd4..53c772e0a05 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -56,6 +56,7 @@ #include "apr_file_io.h" #include "apr_lib.h" #include "apr_portable.h" +#include "apr_strings.h" #include apr_status_t apr_file_cleanup(void *thefile) diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 77ef2293eeb..87421bd8a89 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -57,6 +57,7 @@ #include "apr_file_io.h" #include "apr_general.h" #include "apr_lib.h" +#include "apr_strings.h" #include #include diff --git a/locks/os2/locks.c b/locks/os2/locks.c index 60184795aa0..d5a4a2add6e 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -54,6 +54,7 @@ #include "apr_general.h" #include "apr_lib.h" +#include "apr_strings.h" #include "locks.h" #include "fileio.h" #include diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index a3c917f5595..c81ecd75e29 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -56,6 +56,7 @@ #include "apr_network_io.h" #include "apr_general.h" #include "apr_lib.h" +#include "apr_strings.h" #include #include #include diff --git a/shmem/os2/shmem.c b/shmem/os2/shmem.c index 7c8ade24e44..970062998d8 100644 --- a/shmem/os2/shmem.c +++ b/shmem/os2/shmem.c @@ -56,6 +56,7 @@ #include "apr_shmem.h" #include "apr_errno.h" #include "apr_lib.h" +#include "apr_strings.h" #include #include #define INCL_DOS diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index c389148c120..0005ee21ee6 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -63,6 +63,7 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_portable.h" +#include "apr_strings.h" #include #include #include From a6e1d34f74fbeb4d23c13fa7a5890aa6b43b0ab4 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 9 Aug 2000 14:37:07 +0000 Subject: [PATCH 0511/7878] Clean up aprlib.def. Add the hash functions to the export list. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60487 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 205 ++++++++++++++++++++++++++++------------------------- libapr.def | 205 ++++++++++++++++++++++++++++------------------------- 2 files changed, 216 insertions(+), 194 deletions(-) diff --git a/aprlib.def b/aprlib.def index 118cd997d83..888755d68e1 100644 --- a/aprlib.def +++ b/aprlib.def @@ -4,55 +4,53 @@ LIBRARY aprlib DESCRIPTION '' EXPORTS - ; Add new API calls to the end of this list. - apr_opendir @1 - apr_closedir @2 - apr_readdir @3 - apr_rewinddir @4 - apr_make_dir @5 - apr_remove_dir @6 - apr_dir_entry_size @7 - apr_dir_entry_mtime @8 - apr_dir_entry_ftype @9 - apr_get_dir_filename @10 -; apr_get_filename @11 - apr_stat @11 -; apr_get_filesize @12 -; apr_get_fileatime @13 -; apr_get_filectime @14 -; apr_make_iov @15 - apr_dupfile @16 - apr_getfileinfo @17 - apr_open @18 - apr_close @19 - apr_remove_file @20 - apr_create_pipe @21 - apr_read @22 - apr_write @23 - apr_seek @24 - apr_get_filedata @25 - apr_set_filedata @26 - apr_get_os_file @27 - apr_put_os_file @28 - apr_get_os_dir @29 - apr_putc @30 - apr_getc @31 - apr_puts @32 - apr_fgets @33 - apr_flush @34 - apr_fprintf @35 - apr_eof @36 -; apr_get_filetype @37 - apr_writev @38 - ; locks - apr_create_lock @39 - apr_lock @40 - apr_unlock @41 - apr_destroy_lock @42 - apr_child_init_lock @43 - apr_get_lockdata @44 - apr_set_lockdata @45 - apr_get_os_lock @46 +; Add new API calls to the end of this list. +; apr_file_io.h + apr_open @1 + apr_close @2 + apr_remove_file @3 +; apr_rename_file @4 + apr_eof @5 + apr_read @6 + apr_write @7 + apr_writev @8 +; apr_full_read @9 +; apr_full_write @10 + apr_putc @11 + apr_getc @12 + apr_ungetc @13 + apr_fgets @14 + apr_puts @15 + apr_flush @16 + apr_dupfile @17 + apr_getfileinfo @18 +; apr_setfileperms @19 + apr_stat @20 +; apr_lstat @21 + apr_seek @22 + apr_opendir @23 + apr_closedir @24 + apr_readdir @25 + apr_rewinddir @26 + apr_make_dir @27 + apr_remove_dir @28 + apr_dir_entry_size @29 + apr_dir_entry_mtime @30 + apr_dir_entry_ftype @31 + apr_get_dir_filename @32 +; apr_get_filename @33 + apr_create_pipe @34 +; apr_create_namedpipe @35 +; apr_set_pipe_timeout @36 + apr_get_filedata @37 + apr_set_filedata @38 + apr_get_os_file @39 + apr_put_os_file @40 + apr_get_os_dir @41 + apr_fprintf @42 + +; +; apr_network_io.h apr_create_tcp_socket @47 apr_shutdown @48 apr_close_socket @49 @@ -80,21 +78,22 @@ EXPORTS apr_remove_poll_socket @71 apr_clear_poll_sockets @72 apr_getsocketopt @73 -; apr_getipaddr @74 -; apr_create_signal @75 -; apr_setup_signal @76 -; SignalHandling @77 -; apr_send_signal @78 -; thread_ready @79 +; +; +; +; +; +; +; apr_thread_proc.h apr_createprocattr_init @80 apr_setprocattr_io @81 apr_setprocattr_dir @82 apr_setprocattr_cmdtype @83 apr_setprocattr_detach @84 apr_create_process @85 -; apr_get_childin @86 -; apr_get_childout @87 -; apr_get_childerr @88 +; +; +; apr_wait_proc @89 apr_kill @90 apr_create_threadattr @91 @@ -104,7 +103,7 @@ EXPORTS apr_thread_exit @95 apr_thread_join @96 apr_thread_detach @97 -; apr_cancel_thread @98 +; apr_create_thread_private @99 apr_get_thread_private @100 apr_set_thread_private @101 @@ -113,17 +112,17 @@ EXPORTS apr_set_threaddata @104 apr_get_threadkeydata @105 apr_set_threadkeydata @106 -; apr_get_procdata @107 -; apr_set_procdata @108 -; apr_get_os_proc @109 +; +; +; apr_get_os_thread @110 apr_get_os_threadkey @111 apr_os_systemcase_filename @112 canonical_filename @113 apr_create_pool @114 - apr_clear_pool @115 - apr_destroy_pool @116 -; apr_get_oslevel @117 +; +; +; apr_get_userdata @118 apr_set_userdata @119 apr_initialize @120 @@ -133,41 +132,28 @@ EXPORTS apr_optopt @124 DATA apr_optreset @125 DATA apr_optarg @126 DATA -; apr_make_time @127 apr_ansi_time_to_apr_time @127 -; apr_current_time @128 apr_now @128 -; apr_explode_time @129 apr_explode_gmt @129 -; apr_implode_time @130 apr_explode_localtime @130 -; apr_get_curtime @131 apr_implode_time @131 -; apr_get_sec @132 apr_get_os_imp_time @132 -; apr_get_min @133 apr_get_os_exp_time @133 -; apr_get_hour @134 apr_put_os_imp_time @134 -; apr_get_mday @135 apr_put_os_exp_time @135 -; apr_get_mon @136 apr_ctime @136 -; apr_get_year @137 apr_rfc822_date @137 -; apr_get_wday @138 apr_strftime @138 -; apr_set_sec @139 -; apr_set_min @140 -; apr_set_hour @141 -; apr_set_mday @142 -; apr_set_mon @143 -; apr_set_year @144 -; apr_set_wday @145 -; apr_get_timedata @146 -; apr_set_timedata @147 -; apr_get_os_time @148 -; apr_timediff @149 +; +; +; +; +; +; +; +; +; +; apr_MD5Final @150 apr_MD5Init @151 apr_MD5Update @152 @@ -178,10 +164,12 @@ EXPORTS apr_is_fnmatch @157 apr_MD5Encode @158 apr_validate_password @159 +; +; apr_pools.h apr_make_sub_pool @160 apr_init_alloc @161 -; apr_clear_pool @162 -; apr_destroy_pool @163 + apr_clear_pool @162 + apr_destroy_pool @163 apr_bytes_in_pool @164 apr_bytes_in_free_blocks @165 apr_palloc @166 @@ -191,9 +179,11 @@ EXPORTS apr_pstrcat @170 apr_pvsprintf @171 apr_psprintf @172 +; +; apr_tables.h apr_make_array @173 apr_push_array @174 - apr_array_cat @175 + apr_array_cat @175 apr_copy_array @176 apr_copy_array_hdr @177 apr_append_arrays @178 @@ -211,17 +201,20 @@ EXPORTS apr_table_addn @190 apr_overlay_tables @191 apr_table_do @192 - apr_overlap_tables @193 - apr_run_cleanup @194 - apr_cleanup_for_exec @195 - apr_null_cleanup @196 - apr_note_subprocess @197 + apr_table_vdo @193 + apr_overlap_tables @194 +; +; + apr_run_cleanup @195 + apr_cleanup_for_exec @196 + apr_null_cleanup @197 + apr_note_subprocess @198 ; apr_vformatter @199 apr_snprintf @200 apr_vsnprintf @201 apr_getpass @202 - apr_ungetc @203 + apr_tokenize_to_argv @204 apr_filename_of_pathname @205 apr_get_remote_name @206 @@ -250,3 +243,21 @@ EXPORTS apr_strnatcmp @229 apr_strnatcasecmp @230 apr_dso_error @231 +; +; apr_hash.h + apr_make_hash @232 + apr_hash_set @233 + apr_hash_get @234 + apr_hash_first @235 + apr_hash_next @236 + apr_hash_this @237 +; +; apr_lock.h + apr_create_lock @240 + apr_lock @241 + apr_unlock @242 + apr_destroy_lock @243 + apr_child_init_lock @244 + apr_get_lockdata @245 + apr_set_lockdata @246 + apr_get_os_lock @247 diff --git a/libapr.def b/libapr.def index 118cd997d83..888755d68e1 100644 --- a/libapr.def +++ b/libapr.def @@ -4,55 +4,53 @@ LIBRARY aprlib DESCRIPTION '' EXPORTS - ; Add new API calls to the end of this list. - apr_opendir @1 - apr_closedir @2 - apr_readdir @3 - apr_rewinddir @4 - apr_make_dir @5 - apr_remove_dir @6 - apr_dir_entry_size @7 - apr_dir_entry_mtime @8 - apr_dir_entry_ftype @9 - apr_get_dir_filename @10 -; apr_get_filename @11 - apr_stat @11 -; apr_get_filesize @12 -; apr_get_fileatime @13 -; apr_get_filectime @14 -; apr_make_iov @15 - apr_dupfile @16 - apr_getfileinfo @17 - apr_open @18 - apr_close @19 - apr_remove_file @20 - apr_create_pipe @21 - apr_read @22 - apr_write @23 - apr_seek @24 - apr_get_filedata @25 - apr_set_filedata @26 - apr_get_os_file @27 - apr_put_os_file @28 - apr_get_os_dir @29 - apr_putc @30 - apr_getc @31 - apr_puts @32 - apr_fgets @33 - apr_flush @34 - apr_fprintf @35 - apr_eof @36 -; apr_get_filetype @37 - apr_writev @38 - ; locks - apr_create_lock @39 - apr_lock @40 - apr_unlock @41 - apr_destroy_lock @42 - apr_child_init_lock @43 - apr_get_lockdata @44 - apr_set_lockdata @45 - apr_get_os_lock @46 +; Add new API calls to the end of this list. +; apr_file_io.h + apr_open @1 + apr_close @2 + apr_remove_file @3 +; apr_rename_file @4 + apr_eof @5 + apr_read @6 + apr_write @7 + apr_writev @8 +; apr_full_read @9 +; apr_full_write @10 + apr_putc @11 + apr_getc @12 + apr_ungetc @13 + apr_fgets @14 + apr_puts @15 + apr_flush @16 + apr_dupfile @17 + apr_getfileinfo @18 +; apr_setfileperms @19 + apr_stat @20 +; apr_lstat @21 + apr_seek @22 + apr_opendir @23 + apr_closedir @24 + apr_readdir @25 + apr_rewinddir @26 + apr_make_dir @27 + apr_remove_dir @28 + apr_dir_entry_size @29 + apr_dir_entry_mtime @30 + apr_dir_entry_ftype @31 + apr_get_dir_filename @32 +; apr_get_filename @33 + apr_create_pipe @34 +; apr_create_namedpipe @35 +; apr_set_pipe_timeout @36 + apr_get_filedata @37 + apr_set_filedata @38 + apr_get_os_file @39 + apr_put_os_file @40 + apr_get_os_dir @41 + apr_fprintf @42 + +; +; apr_network_io.h apr_create_tcp_socket @47 apr_shutdown @48 apr_close_socket @49 @@ -80,21 +78,22 @@ EXPORTS apr_remove_poll_socket @71 apr_clear_poll_sockets @72 apr_getsocketopt @73 -; apr_getipaddr @74 -; apr_create_signal @75 -; apr_setup_signal @76 -; SignalHandling @77 -; apr_send_signal @78 -; thread_ready @79 +; +; +; +; +; +; +; apr_thread_proc.h apr_createprocattr_init @80 apr_setprocattr_io @81 apr_setprocattr_dir @82 apr_setprocattr_cmdtype @83 apr_setprocattr_detach @84 apr_create_process @85 -; apr_get_childin @86 -; apr_get_childout @87 -; apr_get_childerr @88 +; +; +; apr_wait_proc @89 apr_kill @90 apr_create_threadattr @91 @@ -104,7 +103,7 @@ EXPORTS apr_thread_exit @95 apr_thread_join @96 apr_thread_detach @97 -; apr_cancel_thread @98 +; apr_create_thread_private @99 apr_get_thread_private @100 apr_set_thread_private @101 @@ -113,17 +112,17 @@ EXPORTS apr_set_threaddata @104 apr_get_threadkeydata @105 apr_set_threadkeydata @106 -; apr_get_procdata @107 -; apr_set_procdata @108 -; apr_get_os_proc @109 +; +; +; apr_get_os_thread @110 apr_get_os_threadkey @111 apr_os_systemcase_filename @112 canonical_filename @113 apr_create_pool @114 - apr_clear_pool @115 - apr_destroy_pool @116 -; apr_get_oslevel @117 +; +; +; apr_get_userdata @118 apr_set_userdata @119 apr_initialize @120 @@ -133,41 +132,28 @@ EXPORTS apr_optopt @124 DATA apr_optreset @125 DATA apr_optarg @126 DATA -; apr_make_time @127 apr_ansi_time_to_apr_time @127 -; apr_current_time @128 apr_now @128 -; apr_explode_time @129 apr_explode_gmt @129 -; apr_implode_time @130 apr_explode_localtime @130 -; apr_get_curtime @131 apr_implode_time @131 -; apr_get_sec @132 apr_get_os_imp_time @132 -; apr_get_min @133 apr_get_os_exp_time @133 -; apr_get_hour @134 apr_put_os_imp_time @134 -; apr_get_mday @135 apr_put_os_exp_time @135 -; apr_get_mon @136 apr_ctime @136 -; apr_get_year @137 apr_rfc822_date @137 -; apr_get_wday @138 apr_strftime @138 -; apr_set_sec @139 -; apr_set_min @140 -; apr_set_hour @141 -; apr_set_mday @142 -; apr_set_mon @143 -; apr_set_year @144 -; apr_set_wday @145 -; apr_get_timedata @146 -; apr_set_timedata @147 -; apr_get_os_time @148 -; apr_timediff @149 +; +; +; +; +; +; +; +; +; +; apr_MD5Final @150 apr_MD5Init @151 apr_MD5Update @152 @@ -178,10 +164,12 @@ EXPORTS apr_is_fnmatch @157 apr_MD5Encode @158 apr_validate_password @159 +; +; apr_pools.h apr_make_sub_pool @160 apr_init_alloc @161 -; apr_clear_pool @162 -; apr_destroy_pool @163 + apr_clear_pool @162 + apr_destroy_pool @163 apr_bytes_in_pool @164 apr_bytes_in_free_blocks @165 apr_palloc @166 @@ -191,9 +179,11 @@ EXPORTS apr_pstrcat @170 apr_pvsprintf @171 apr_psprintf @172 +; +; apr_tables.h apr_make_array @173 apr_push_array @174 - apr_array_cat @175 + apr_array_cat @175 apr_copy_array @176 apr_copy_array_hdr @177 apr_append_arrays @178 @@ -211,17 +201,20 @@ EXPORTS apr_table_addn @190 apr_overlay_tables @191 apr_table_do @192 - apr_overlap_tables @193 - apr_run_cleanup @194 - apr_cleanup_for_exec @195 - apr_null_cleanup @196 - apr_note_subprocess @197 + apr_table_vdo @193 + apr_overlap_tables @194 +; +; + apr_run_cleanup @195 + apr_cleanup_for_exec @196 + apr_null_cleanup @197 + apr_note_subprocess @198 ; apr_vformatter @199 apr_snprintf @200 apr_vsnprintf @201 apr_getpass @202 - apr_ungetc @203 + apr_tokenize_to_argv @204 apr_filename_of_pathname @205 apr_get_remote_name @206 @@ -250,3 +243,21 @@ EXPORTS apr_strnatcmp @229 apr_strnatcasecmp @230 apr_dso_error @231 +; +; apr_hash.h + apr_make_hash @232 + apr_hash_set @233 + apr_hash_get @234 + apr_hash_first @235 + apr_hash_next @236 + apr_hash_this @237 +; +; apr_lock.h + apr_create_lock @240 + apr_lock @241 + apr_unlock @242 + apr_destroy_lock @243 + apr_child_init_lock @244 + apr_get_lockdata @245 + apr_set_lockdata @246 + apr_get_os_lock @247 From 09c54206ce2d2dba9300f081879960d1d159b893 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Aug 2000 14:46:34 +0000 Subject: [PATCH 0512/7878] Force CancelIo() to be late-bound for Win9x folks (who don't have it.) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60488 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/fileio.h | 1 + include/arch/win32/fileio.h | 1 + 2 files changed, 2 insertions(+) diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 661154ead16..178d576383c 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -62,6 +62,7 @@ #include "apr_lock.h" #include "apr_file_io.h" #include "apr_errno.h" +#include "misc.h" #if APR_HAVE_SYS_STAT_H #include diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 661154ead16..178d576383c 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -62,6 +62,7 @@ #include "apr_lock.h" #include "apr_file_io.h" #include "apr_errno.h" +#include "misc.h" #if APR_HAVE_SYS_STAT_H #include From d473c5bb039448893171b0a3bd6b26a447fa86f3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Aug 2000 14:47:30 +0000 Subject: [PATCH 0513/7878] Add apr_full_read/write to the Win32 apr build. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60489 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++++ aprlib.dsp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apr.dsp b/apr.dsp index a566768973e..2df9fbe8e62 100644 --- a/apr.dsp +++ b/apr.dsp @@ -165,6 +165,10 @@ SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File +SOURCE=.\file_io\unix\fullrw.c +# End Source File +# Begin Source File + SOURCE=.\misc\unix\getopt.c # End Source File # Begin Source File diff --git a/aprlib.dsp b/aprlib.dsp index a566768973e..2df9fbe8e62 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -165,6 +165,10 @@ SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File +SOURCE=.\file_io\unix\fullrw.c +# End Source File +# Begin Source File + SOURCE=.\misc\unix\getopt.c # End Source File # Begin Source File From ac1d326c0508758fe38ece9cb1c6df8d92dff3ba Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Aug 2000 14:49:14 +0000 Subject: [PATCH 0514/7878] PLEASE REVIEW: Add an apr_lstat placeholder for Win32. Shouldn't do much right now, since we haven't written the hardlink resolver, but this will do. sysinternals.com has some good technotes and samples on this subject. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60490 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 2477cf94de0..3684ed7d615 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -282,3 +282,10 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) return APR_SUCCESS; } +apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) +{ + /* TODO: determine if apr_lstat is a true NT symlink what the stats of the + * link are, rather than the target. + */ + return apr_stat(finfo, fname, cont); +} From 1bf5924f92902da6d8a479a8ab8cce9433207c43 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Aug 2000 14:54:03 +0000 Subject: [PATCH 0515/7878] Eliminate apr_opt*** symbols from the namespace, and allow parallel or multiple argument parsers to play with the argument list. This change forces the user to call apr_initopt followed by the usual calls to apr_getopt, with one exception. The argument to a switch (-x) option is passed to apr_getopt as the &((const char *) arg). Also, the old int rv status/switch value is now simply the switch value, and the status is returned as the ap_status_t result. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60491 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 62 +++++++++++++++---------- misc/unix/getopt.c | 107 ++++++++++++++++++++++--------------------- 2 files changed, 92 insertions(+), 77 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 0abb5786566..a0698069805 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -55,36 +55,48 @@ #ifndef APR_GETOPT_H #define APR_GETOPT_H -APR_VAR_IMPORT int - apr_opterr, /* if error message should be printed */ - apr_optind, /* index into parent argv vector */ - apr_optopt, /* character checked for validity */ - apr_optreset; /* reset getopt */ -APR_VAR_IMPORT char * - apr_optarg; /* argument associated with option */ +typedef struct apr_getopt_t { + apr_pool_t cont; /* context for processing */ + int err; /* if error message should be printed */ + int ind; /* index into parent argv vector */ + int opt; /* character checked for validity */ + int reset; /* reset getopt */ + int argc; /* count of arguments */ + char const* const* argv; /* array of pointers to arguments */ + char const* place; /* argument associated with option */ +} apr_getopt_t; /** - * Parse the command line options passed to the program. - * @param nargc The number of arguments passed to apr_getopt to parse - * @param nargv The array of command line options to parse - * @param ostr A string of characters that are acceptable options to the - * program. Characters followed by ":" are required to have an - * option associated - * @param rv The next option found. There are four potential values for - * this variable on exit. They are: + * Initialize the arguments for parsing by apr_getopt(). + * @param cont The pool to operate on + * @param os The options structure created for apr_getopt() + * @param argc The number of arguments to parse + * @param argv The array of arguments to parse + * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) + * @deffunc apr_status_t apr_initopt(apr_getopt_t **os, apr_pool_t *cont, int argc, char const* const* argv) + */ +APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, + int argc, char const* const* argv); + +/** + * Parse the options initialized by apr_initopt(). + * @param os The apr_opt_t structure returned by apr_initopt() + * @param opts A string of characters that are acceptable options to the + * program. Characters followed by ":" are required to have an + * option associated + * @param optch The next option character parsed + * @param optarg The argument following the option character: + * @tip There are four potential status values on exit. They are: *
    - *             APR_EOF    --  No more options to parse
    - *             APR_BADCH  --  Found a bad option character
    - *             APR_BADARG --  Missing @parameter for the found option
    - *             Other      --  The next option found.
    + *             APR_EOF      --  No more options to parse
    + *             APR_BADCH    --  Found a bad option character
    + *             APR_BADARG   --  No argument followed @parameter:
    + *             APR_SUCCESS  --  The next option was found.
      * 
    - * @param cont The pool to operate on. - * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) - * @deffunc apr_status_t apr_getopt(apr_int32_t nargc, char *const *nargv, const char *ostr, apr_int32_t *rv, apr_pool_t *cont) + * @deffunc apr_status_t apr_getopt(apr_getopt_t *os, const char *opts, char *optch, char **optarg) */ -APR_EXPORT(apr_status_t) apr_getopt(apr_int32_t nargc, char *const *nargv, - const char *ostr, apr_int32_t *rv, - apr_pool_t *cont); +APR_EXPORT(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, + char *optch, char const** optarg); #endif /* ! APR_GETOPT_H */ diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index b28b9e67729..c8863e9c5eb 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -33,92 +33,95 @@ #include "misc.h" -APR_VAR_EXPORT int - apr_opterr = 1, /* if error message should be printed */ - apr_optind = 1, /* index into parent argv vector */ - apr_optopt, /* character checked for validity */ - apr_optreset; /* reset getopt */ -APR_VAR_EXPORT char *apr_optarg = ""; /* argument associated with option */ - #define EMSG "" -APR_EXPORT(apr_status_t) apr_getopt(apr_int32_t nargc, char *const *nargv, - const char *ostr, apr_int32_t *rv, - apr_pool_t *cont) +APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, + int argc, char const* const* argv) +{ + *os = apr_palloc(cont, sizeof(apr_getopt_t)); + (*os)->err = 1; + (*os)->ind = 1; + (*os)->place = EMSG; + (*os)->argc = argc; + (*os)->argv = argv; + return APR_SUCCESS; +} + +APR_EXPORT(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, + char *optch, char const** optarg) { - char *p; - static char *place = EMSG; /* option letter processing */ - char *oli; /* option letter list index */ + const char *p; + const char *oli; /* option letter list index */ - if (apr_optreset || !*place) { /* update scanning pointer */ - apr_optreset = 0; - if (apr_optind >= nargc || *(place = nargv[apr_optind]) != '-') { - place = EMSG; - *rv = apr_optopt; + if (os->reset || !*os->place) { /* update scanning pointer */ + os->reset = 0; + if (os->ind >= os->argc || *(os->place = os->argv[os->ind]) != '-') { + os->place = EMSG; + *optch = os->opt; return (APR_EOF); } - if (place[1] && *++place == '-') { /* found "--" */ - ++apr_optind; - place = EMSG; - *rv = apr_optopt; + if (os->place[1] && *++os->place == '-') { /* found "--" */ + ++os->ind; + os->place = EMSG; + *optch = os->opt; return (APR_EOF); } } /* option letter okay? */ - if ((apr_optopt = (int) *place++) == (int) ':' || - !(oli = strchr(ostr, apr_optopt))) { + if ((os->opt = (int) *os->place++) == (int) ':' || + !(oli = strchr(opts, os->opt))) { /* * if the user didn't specify '-' as an option, * assume it means -1. */ - if (apr_optopt == (int) '-') { - *rv = apr_optopt; + if (os->opt == (int) '-') { + *optch = os->opt; return (APR_EOF); } - if (!*place) - ++apr_optind; - if (apr_opterr && *ostr != ':') { - if (!(p = strrchr(*nargv, '/'))) - p = *nargv; + if (!*os->place) + ++os->ind; + if (os->err && *opts != ':') { + if (!(p = strrchr(*os->argv, '/'))) + p = *os->argv; else ++p; (void) fprintf(stderr, - "%s: illegal option -- %c\n", p, apr_optopt); + "%s: illegal option -- %c\n", p, os->opt); } - *rv = apr_optopt; - return APR_BADCH; + *optch = os->opt; + return (APR_BADCH); } if (*++oli != ':') { /* don't need argument */ - apr_optarg = NULL; - if (!*place) - ++apr_optind; + *optarg = NULL; + if (!*os->place) + ++os->ind; } else { /* need an argument */ - if (*place) /* no white space */ - apr_optarg = place; - else if (nargc <= ++apr_optind) { /* no arg */ - place = EMSG; - if (*ostr == ':') { - *rv = apr_optopt; + if (*os->place) /* no white space */ + *optarg = os->place; + else if (os->argc <= ++os->ind) { /* no arg */ + os->place = EMSG; + if (*opts == ':') { + *optch = os->opt; return (APR_BADARG); } - if (apr_opterr) { - if (!(p = strrchr(*nargv, '/'))) - p = *nargv; + if (os->err) { + if (!(p = strrchr(*os->argv, '/'))) + p = *os->argv; else ++p; (void) fprintf(stderr, "%s: option requires an argument -- %c\n", - p, apr_optopt); + p, os->opt); } - *rv = apr_optopt; + *optch = os->opt; return (APR_BADCH); } else /* white space */ - apr_optarg = nargv[apr_optind]; - place = EMSG; - ++apr_optind; + *optarg = os->argv[os->ind]; + os->place = EMSG; + ++os->ind; } - *rv = apr_optopt; + *optch = os->opt; return APR_SUCCESS; } From 164fcbc90d7176cd5b29e343ee282c30917ed3d0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Aug 2000 14:55:44 +0000 Subject: [PATCH 0516/7878] Fix the Win32 linker .def for APR (for my last several commits), and provide the first real 'test' of the new apr_initopt/apr_getopt. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60492 13f79535-47bb-0310-9956-ffa450edef68 --- test/testargs.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/test/testargs.c b/test/testargs.c index 9ab990679d7..0596131c497 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -66,25 +66,32 @@ int main(int argc, char * const argv[]) { apr_pool_t *context; - apr_int32_t data; + apr_getopt_t *opt; + char data; + const char *optarg; apr_initialize(); atexit(apr_terminate); apr_create_pool(&context, NULL); - while (apr_getopt(argc, argv, "abc:d::", &data, context) == APR_SUCCESS) { + if (apr_initopt(&opt, context, argc, argv)) + { + printf("failed to initialize opts"); + exit(1); + } + while (apr_getopt(opt, "abc:d::", &data, &optarg) == APR_SUCCESS) { switch(data) { case 'a': case 'b': printf("option %c\n", data); break; case 'c': - printf("option %c with %s\n", data, apr_optarg); + printf("option %c with %s\n", data, optarg); break; case 'd': printf("option %c", data); - if (apr_optarg) { - printf(" with %s\n", apr_optarg); + if (optarg) { + printf(" with %s\n", optarg); } else { printf("\n"); From f478eafd1c3f3fae9ef99085d579395f04fbf1f1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Aug 2000 15:59:48 +0000 Subject: [PATCH 0517/7878] Fix the Win32 linker .def for APR (for my last several commits)... hope I don't crash into FirstBill again :) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60493 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 28 +++++++++++++++++----------- libapr.def | 28 +++++++++++++++++----------- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/aprlib.def b/aprlib.def index 888755d68e1..b1dec108b91 100644 --- a/aprlib.def +++ b/aprlib.def @@ -9,13 +9,13 @@ EXPORTS apr_open @1 apr_close @2 apr_remove_file @3 -; apr_rename_file @4 + apr_rename_file @4 apr_eof @5 apr_read @6 apr_write @7 apr_writev @8 -; apr_full_read @9 -; apr_full_write @10 + apr_full_read @9 + apr_full_write @10 apr_putc @11 apr_getc @12 apr_ungetc @13 @@ -24,9 +24,9 @@ EXPORTS apr_flush @16 apr_dupfile @17 apr_getfileinfo @18 -; apr_setfileperms @19 + apr_setfileperms @19 apr_stat @20 -; apr_lstat @21 + apr_lstat @21 apr_seek @22 apr_opendir @23 apr_closedir @24 @@ -126,12 +126,7 @@ EXPORTS apr_get_userdata @118 apr_set_userdata @119 apr_initialize @120 - apr_getopt @121 - apr_opterr @122 DATA - apr_optind @123 DATA - apr_optopt @124 DATA - apr_optreset @125 DATA - apr_optarg @126 DATA +; apr_make_time @127 apr_ansi_time_to_apr_time @127 apr_now @128 apr_explode_gmt @129 @@ -261,3 +256,14 @@ EXPORTS apr_get_lockdata @245 apr_set_lockdata @246 apr_get_os_lock @247 + +; Moved out of the way for Bill Stoddard's reorg +; +; apr_getopt.h + apr_getopt @298 + apr_initopt @299 +; apr_opterr @122 DATA +; apr_optind @123 DATA +; apr_optopt @124 DATA +; apr_optreset @125 DATA +; apr_optarg @126 DATA diff --git a/libapr.def b/libapr.def index 888755d68e1..b1dec108b91 100644 --- a/libapr.def +++ b/libapr.def @@ -9,13 +9,13 @@ EXPORTS apr_open @1 apr_close @2 apr_remove_file @3 -; apr_rename_file @4 + apr_rename_file @4 apr_eof @5 apr_read @6 apr_write @7 apr_writev @8 -; apr_full_read @9 -; apr_full_write @10 + apr_full_read @9 + apr_full_write @10 apr_putc @11 apr_getc @12 apr_ungetc @13 @@ -24,9 +24,9 @@ EXPORTS apr_flush @16 apr_dupfile @17 apr_getfileinfo @18 -; apr_setfileperms @19 + apr_setfileperms @19 apr_stat @20 -; apr_lstat @21 + apr_lstat @21 apr_seek @22 apr_opendir @23 apr_closedir @24 @@ -126,12 +126,7 @@ EXPORTS apr_get_userdata @118 apr_set_userdata @119 apr_initialize @120 - apr_getopt @121 - apr_opterr @122 DATA - apr_optind @123 DATA - apr_optopt @124 DATA - apr_optreset @125 DATA - apr_optarg @126 DATA +; apr_make_time @127 apr_ansi_time_to_apr_time @127 apr_now @128 apr_explode_gmt @129 @@ -261,3 +256,14 @@ EXPORTS apr_get_lockdata @245 apr_set_lockdata @246 apr_get_os_lock @247 + +; Moved out of the way for Bill Stoddard's reorg +; +; apr_getopt.h + apr_getopt @298 + apr_initopt @299 +; apr_opterr @122 DATA +; apr_optind @123 DATA +; apr_optopt @124 DATA +; apr_optreset @125 DATA +; apr_optarg @126 DATA From 29c939864b8833a7070eb5543cc22282b3fabd4c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Aug 2000 17:46:22 +0000 Subject: [PATCH 0518/7878] Commit two fixes while I'm considering Jeff's comments. apr_getopt_t->cont is not really necessary, but I don't yet see a reason to kill it outright. Might come in handy later. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60494 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 4 ++-- misc/unix/getopt.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index a0698069805..ad86ef37e38 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -56,7 +56,7 @@ #define APR_GETOPT_H typedef struct apr_getopt_t { - apr_pool_t cont; /* context for processing */ + apr_pool_t *cont; /* context for processing */ int err; /* if error message should be printed */ int ind; /* index into parent argv vector */ int opt; /* character checked for validity */ @@ -73,7 +73,7 @@ typedef struct apr_getopt_t { * @param argc The number of arguments to parse * @param argv The array of arguments to parse * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) - * @deffunc apr_status_t apr_initopt(apr_getopt_t **os, apr_pool_t *cont, int argc, char const* const* argv) + * @deffunc apr_status_t apr_initopt(apr_pool_t *cont, apr_getopt_t **os, int argc, char const* const* argv) */ APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, int argc, char const* const* argv); diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index c8863e9c5eb..78061326ebb 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -39,6 +39,7 @@ APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, int argc, char const* const* argv) { *os = apr_palloc(cont, sizeof(apr_getopt_t)); + (*os)->cont = cont; (*os)->err = 1; (*os)->ind = 1; (*os)->place = EMSG; From 74707fc06f1ab2dae61db9cc1125aaead98a8c6c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Aug 2000 18:00:15 +0000 Subject: [PATCH 0519/7878] Doc it correctly, even if the const'ness is wrong. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60495 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index ad86ef37e38..94fcfab11a9 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -73,7 +73,7 @@ typedef struct apr_getopt_t { * @param argc The number of arguments to parse * @param argv The array of arguments to parse * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) - * @deffunc apr_status_t apr_initopt(apr_pool_t *cont, apr_getopt_t **os, int argc, char const* const* argv) + * @deffunc apr_status_t apr_initopt( apr_getopt_t **os, apr_pool_t *cont,int argc, char const* const* argv) */ APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, int argc, char const* const* argv); @@ -93,7 +93,7 @@ APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, * APR_BADARG -- No argument followed @parameter: * APR_SUCCESS -- The next option was found. * - * @deffunc apr_status_t apr_getopt(apr_getopt_t *os, const char *opts, char *optch, char **optarg) + * @deffunc apr_status_t apr_getopt(apr_getopt_t *os, const char *opts, char *optch, char const** optarg) */ APR_EXPORT(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, char *optch, char const** optarg); From eb804f7591f1d2f1dec335684d8ce7263d469245 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 10 Aug 2000 12:52:29 +0000 Subject: [PATCH 0520/7878] Tweak apr_getopt() and its use in ab to avoid compiler warnings. (Note: apr_initopt() and/or its callers still need tweaking.) Submitted by: Bill Rowe Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60496 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 6 +++--- misc/unix/getopt.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 94fcfab11a9..7953f6e573f 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -73,7 +73,7 @@ typedef struct apr_getopt_t { * @param argc The number of arguments to parse * @param argv The array of arguments to parse * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) - * @deffunc apr_status_t apr_initopt( apr_getopt_t **os, apr_pool_t *cont,int argc, char const* const* argv) + * @deffunc apr_status_t apr_initopt(apr_getopt_t **os, apr_pool_t *cont,int argc, char const* const* argv) */ APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, int argc, char const* const* argv); @@ -93,10 +93,10 @@ APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, * APR_BADARG -- No argument followed @parameter: * APR_SUCCESS -- The next option was found. * - * @deffunc apr_status_t apr_getopt(apr_getopt_t *os, const char *opts, char *optch, char const** optarg) + * @deffunc apr_status_t apr_getopt(apr_getopt_t *os, const char *opts, char *optch, const char **optarg) */ APR_EXPORT(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, - char *optch, char const** optarg); + char *optch, const char **optarg); #endif /* ! APR_GETOPT_H */ diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 78061326ebb..32544cbf092 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -49,7 +49,7 @@ APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, } APR_EXPORT(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, - char *optch, char const** optarg) + char *optch, const char **optarg) { const char *p; const char *oli; /* option letter list index */ From 7362ac399025812f1822aa07f18e30a9ffb34c4d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 11 Aug 2000 16:38:32 +0000 Subject: [PATCH 0521/7878] APR locks on Unix: Let APR_LOCKALL locks work when APR isn't built with thread support. The code needed to realize that with APR_LOCKALL the intra-thread lock is a no-op. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60497 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/locks.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 44feb31fa7b..7a8e37c2622 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -83,7 +83,9 @@ apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, return stat; } #else - return APR_ENOTIMPL; + if (scope != APR_LOCKALL) { + return APR_ENOTIMPL; + } #endif } if (scope != APR_INTRAPROCESS) { @@ -104,7 +106,7 @@ apr_status_t apr_lock(apr_lock_t *lock) return stat; } #else - return APR_ENOTIMPL; + /* must be APR_LOCKALL */ #endif } if (lock->scope != APR_INTRAPROCESS) { @@ -125,7 +127,7 @@ apr_status_t apr_unlock(apr_lock_t *lock) return stat; } #else - return APR_ENOTIMPL; + /* must be APR_LOCKALL */ #endif } if (lock->scope != APR_INTRAPROCESS) { @@ -145,7 +147,9 @@ apr_status_t apr_destroy_lock(apr_lock_t *lock) return stat; } #else - return APR_ENOTIMPL; + if (lock->scope != APR_LOCKALL) { + return APR_ENOTIMPL; + } #endif } if (lock->scope != APR_INTRAPROCESS) { From 5e2f5757d829f5b503f354117fe3a696d9d4c032 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 12 Aug 2000 17:22:34 +0000 Subject: [PATCH 0522/7878] Remove all files from the buckets directory. This is in preparation for committing a patch that actually implements filtering. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60498 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/README.txt | 44 -- buckets/ap_buf.c | 292 ------- buckets/ap_eos_buf.c | 88 --- buckets/ap_mmap_buf.c | 131 --- buckets/ap_rmem_buf.c | 151 ---- buckets/ap_rwmem_buf.c | 171 ---- buckets/apr_buf.h | 397 ---------- buckets/doc_SFmtg.txt | 172 ---- buckets/doc_bucket_brigades.txt | 381 --------- buckets/doc_dean_iol.txt | 496 ------------ buckets/doc_greg_filters.txt | 102 --- buckets/doc_page_io.txt | 166 ---- buckets/doc_stacked_io.txt | 1312 ------------------------------- buckets/doc_wishes.txt | 269 ------- buckets/greg_patch.txt | 631 --------------- buckets/ryan.patch | 651 --------------- 16 files changed, 5454 deletions(-) delete mode 100644 buckets/README.txt delete mode 100644 buckets/ap_buf.c delete mode 100644 buckets/ap_eos_buf.c delete mode 100644 buckets/ap_mmap_buf.c delete mode 100644 buckets/ap_rmem_buf.c delete mode 100644 buckets/ap_rwmem_buf.c delete mode 100644 buckets/apr_buf.h delete mode 100644 buckets/doc_SFmtg.txt delete mode 100644 buckets/doc_bucket_brigades.txt delete mode 100644 buckets/doc_dean_iol.txt delete mode 100644 buckets/doc_greg_filters.txt delete mode 100644 buckets/doc_page_io.txt delete mode 100644 buckets/doc_stacked_io.txt delete mode 100644 buckets/doc_wishes.txt delete mode 100644 buckets/greg_patch.txt delete mode 100644 buckets/ryan.patch diff --git a/buckets/README.txt b/buckets/README.txt deleted file mode 100644 index 393798775c9..00000000000 --- a/buckets/README.txt +++ /dev/null @@ -1,44 +0,0 @@ - -This directory contains several prototype implementations of -layered IO with filtering. None of these will be distributed -as part of the server until we agree on a solution. - -Design Rationale ----------------- - - doc_SFmtg.txt - -- notes from the 1998 design meeting in SF - - doc_stacked_io.txt - -- Ed and Alexei's vision of stacked-io with layer caching - - doc_page_io.txt - -- Dean's comments on performance considerations - - doc_dean_iol.txt - -- Rationale behind the IOL stuff that is now in APR - - doc_bucket_brigades.txt - -- Roy's ramblings about the bucket brigades design - - doc_wishes.txt - -- Everyone's requirements for layered-IO and filters - - doc_greg_filters.txt - -- Greg's initial filter design rationale - -Bachelor #1 ------------ - - apr_buf.h - ap_buf.c - ap_mmap_buf.c - ap_rwmem_buf.c - ap_rmem_buf.c - ap_eos_buf.c - ryan.patch - -Bachelor #2 ------------ - - greg_patch.txt diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c deleted file mode 100644 index 9b3e2b2cddf..00000000000 --- a/buckets/ap_buf.c +++ /dev/null @@ -1,292 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1996-1999 The Apache Group. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * 4. The names "Apache Server" and "Apache Group" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Group. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Group and was originally based - * on public domain software written at the National Center for - * Supercomputing Applications, University of Illinois, Urbana-Champaign. - * For more information on the Apache Group and the Apache HTTP server - * project, please see . - * - */ - -#include "apr_private.h" -#include "apr_pools.h" -#include "apr_lib.h" -#include "apr_errno.h" -#include -#include -#include "apr_buf.h" - -APR_EXPORT(apr_status_t) ap_bucket_destroy(ap_bucket *e) -{ - if (e->free) { - e->free(e); - } - free(e); - return APR_SUCCESS; -} - -static apr_status_t ap_bucket_list_destroy(ap_bucket *e) -{ - ap_bucket *cur = e; - ap_bucket *next; - - while (cur) { - next = cur->next; - ap_bucket_destroy(cur); - cur = next; - } - return APR_SUCCESS; -} - -APR_EXPORT(apr_status_t) ap_brigade_destroy(void *data) -{ - apr_bucket_brigade *b = data; - - ap_bucket_list_destroy(b->head); - /* The brigade itself is allocated out of a pool, so we don't actually - * want to free it. If we did, we would do that free() here. - */ - - return APR_SUCCESS; -} - -APR_EXPORT(apr_bucket_brigade *) ap_brigade_create(apr_pool_t *p) -{ - apr_bucket_brigade *b; - - b = apr_palloc(p, sizeof(*b)); - b->p = p; - b->head = b->tail = NULL; - - apr_register_cleanup(b->p, b, ap_brigade_destroy, - ap_brigade_destroy); - return b; -} - -APR_EXPORT(void) ap_brigade_append_buckets(apr_bucket_brigade *b, - ap_bucket *e) -{ - ap_bucket *cur = e; - - if (b->tail) { - b->tail->next = e; - e->prev = b->tail; - while (cur->next) { - cur = cur->next; - } - b->tail = cur; - } - else { - b->head = b->tail = e; - } -} - -APR_EXPORT(int) ap_brigade_to_iovec(apr_bucket_brigade *b, - struct iovec *vec, int nvec) -{ - ap_bucket *e; - struct iovec *orig; - - orig = vec; - e = b->head; - while (e && nvec) { - vec->iov_len = ap_get_bucket_len(e); - vec->iov_base = (void *)e->read(e); - e = e->next; - --nvec; - ++vec; - } - return vec - orig; -} - -APR_EXPORT(void) ap_brigade_catenate(apr_bucket_brigade *a, - apr_bucket_brigade *b) -{ - if (b->head) { - if (a->tail) { - a->tail->next = b->head; - } - b->head->prev = a->tail; - a->tail = b->tail; - if (!a->head) { - a->head = b->head; - } - b->head = NULL; - b->tail = b->head; - } -} - -APR_EXPORT(void) ap_consume_buckets(apr_bucket_brigade *b, int nvec) -{ - int i; - - for (i=0; i < nvec; i++) { - if (b->head == b->tail) { - ap_bucket_destroy(b->head); - b->head = b->tail = NULL; - break; - } - b->head = b->head->next; - ap_bucket_destroy(b->head->prev); - b->head->prev = NULL; - } -} - -APR_EXPORT(apr_status_t) ap_brigade_to_iol(apr_ssize_t *total_bytes, - apr_bucket_brigade *b, - ap_iol *iol) -{ - apr_status_t status; - int iov_used; - struct iovec vec[16]; /* seems like a reasonable number to me */ - apr_ssize_t bytes = 0; - - *total_bytes = 0; - do { - iov_used = ap_brigade_to_iovec(b, vec, 16); - status = iol_writev(iol, vec, iov_used, &bytes); - - ap_consume_buckets(b, 16); - - if (status != APR_SUCCESS) { - return status; - } - *total_bytes += bytes; - } while (iov_used == 16); - return APR_SUCCESS; -} - -APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b) -{ - if (b) { - return b->getlen(b); - } - return 0; -} - -APR_EXPORT(int) ap_brigade_vputstrs(apr_bucket_brigade *b, va_list va) -{ - ap_bucket *r; - const char *x; - int j, k, rv; - apr_ssize_t i; - - if (b->tail && b->tail->color == AP_BUCKET_rwmem) { - ap_bucket *rw; - rw = b->tail; - /* I have no idea if this is a good idea or not. Probably not. - * Basically, if the last bucket in the list is a rwmem bucket, - * then we just add to it instead of allocating a new read only - * bucket. This is incredibly easy to take out if it is a bad - * idea. RBB - */ - for (k = 0;;) { - x = va_arg(va, const char *); - if (x == NULL) - break; - j = strlen(x); - - rv = rw->write(rw, x, j, &i); - if (i != j) { - /* Do we need better error reporting? */ - return -1; - } - k += i; - - ap_brigade_append_buckets(b, rw); - } - } - - for (k = 0;;) { - x = va_arg(va, const char *); - if (x == NULL) - break; - j = strlen(x); - - r = ap_bucket_rwmem_create(x, j, &i); - if (i != j) { - /* Do we need better error reporting? */ - return -1; - } - k += i; - - ap_brigade_append_buckets(b, r); - } - - return k; -} - -APR_EXPORT(int) ap_brigade_printf(apr_bucket_brigade *b, const char *fmt, ...) -{ - va_list ap; - int res; - - va_start(ap, fmt); - res = ap_brigade_vprintf(b, fmt, ap); - va_end(ap); - return res; -} - -APR_EXPORT(int) ap_brigade_vprintf(apr_bucket_brigade *b, const char *fmt, va_list va) -{ - /* THIS IS A HACK. This needs to be replaced with a function to printf - * directly into a bucket. I'm being lazy right now. RBB - */ - char buf[4096]; - ap_bucket *r; - int res, i; - - res = apr_vsnprintf(buf, 4096, fmt, va); - - r = ap_bucket_rwmem_create(buf, strlen(buf), &i); - ap_brigade_append_buckets(b, r); - - return res; -} diff --git a/buckets/ap_eos_buf.c b/buckets/ap_eos_buf.c deleted file mode 100644 index 44a4e6551c5..00000000000 --- a/buckets/ap_eos_buf.c +++ /dev/null @@ -1,88 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1996-1999 The Apache Group. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * 4. The names "Apache Server" and "Apache Group" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Group. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Group and was originally based - * on public domain software written at the National Center for - * Supercomputing Applications, University of Illinois, Urbana-Champaign. - * For more information on the Apache Group and the Apache HTTP server - * project, please see . - * - */ - -#include "apr_private.h" -#include "apr_buf.h" -#include - -static const char * eos_get_str(ap_bucket *e) -{ - return NULL; -} - -static int eos_get_len(ap_bucket *e) -{ - return 0; -} - -APR_EXPORT(ap_bucket *) ap_bucket_eos_create(void) -{ - ap_bucket *newbuf; - - newbuf = calloc(1, sizeof(*newbuf)); - - newbuf->color = AP_BUCKET_eos; - newbuf->read = eos_get_str; - newbuf->getlen = eos_get_len; - newbuf->write = NULL; - newbuf->split = NULL; - newbuf->free = NULL; - newbuf->data = NULL; - - return newbuf; -} - diff --git a/buckets/ap_mmap_buf.c b/buckets/ap_mmap_buf.c deleted file mode 100644 index c98a4988178..00000000000 --- a/buckets/ap_mmap_buf.c +++ /dev/null @@ -1,131 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1996-1999 The Apache Group. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * 4. The names "Apache Server" and "Apache Group" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Group. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Group and was originally based - * on public domain software written at the National Center for - * Supercomputing Applications, University of Illinois, Urbana-Champaign. - * For more information on the Apache Group and the Apache HTTP server - * project, please see . - * - */ - -#include "apr_private.h" -#include "apr_buf.h" -#include - -static const char * mmap_get_str(ap_bucket *e) -{ - apr_bucket_mmap *b = (apr_bucket_mmap *)e->data; - return b->alloc_addr; -} - -static int mmap_get_len(ap_bucket *e) -{ - apr_bucket_mmap *b = (apr_bucket_mmap *)e->data; - return b->len; -} - -static apr_status_t mmap_bucket_insert(ap_bucket *e, const void *buf, - apr_size_t nbytes, apr_ssize_t *w) -{ - apr_bucket_mmap *b = (apr_bucket_mmap *)e->data; - apr_mmap_t *mm = (apr_mmap_t *)buf; - - b->alloc_addr = mm->mm; - b->len = nbytes; - *w = nbytes; - return APR_SUCCESS; -} - -static apr_status_t mmap_split(ap_bucket *e, apr_size_t nbyte) -{ - ap_bucket *newbuck; - apr_bucket_mmap *a = (apr_bucket_mmap *)e->data; - apr_bucket_mmap *b; - apr_ssize_t dump; - - newbuck = ap_bucket_mmap_create(a->alloc_addr, a->len, &dump); - b = (apr_bucket_mmap *)newbuck->data; - a->alloc_addr = a->alloc_addr + nbyte; - a->len = b->len - nbyte; - - a->len = nbyte; - - newbuck->prev = e; - newbuck->next = e->next; - e->next = newbuck; - - return APR_SUCCESS; -} - -APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(const void *buf, - apr_size_t nbytes, apr_ssize_t *w) -{ - ap_bucket *newbuf; - apr_bucket_mmap *b; - - newbuf = calloc(1, sizeof(*newbuf)); - b = malloc(sizeof(*b)); - - b->alloc_addr = NULL; - b->len = 0; - - newbuf->data = b; - mmap_bucket_insert(newbuf, buf, nbytes, w); - - newbuf->color = AP_BUCKET_mmap; - newbuf->read = mmap_get_str; - newbuf->getlen = mmap_get_len; - newbuf->write = mmap_bucket_insert; - newbuf->split = mmap_split; - newbuf->free = NULL; - - return newbuf; -} - diff --git a/buckets/ap_rmem_buf.c b/buckets/ap_rmem_buf.c deleted file mode 100644 index 30886063fe9..00000000000 --- a/buckets/ap_rmem_buf.c +++ /dev/null @@ -1,151 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1996-1999 The Apache Group. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * 4. The names "Apache Server" and "Apache Group" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Group. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Group and was originally based - * on public domain software written at the National Center for - * Supercomputing Applications, University of Illinois, Urbana-Champaign. - * For more information on the Apache Group and the Apache HTTP server - * project, please see . - * - */ - -#include "apr_private.h" -#include "apr_buf.h" -#include - -#ifndef DEFAULT_RWBUF_SIZE -#define DEFAULT_RWBUF_SIZE (4096) -#endif - -static const char * rmem_get_str(ap_bucket *e) -{ - apr_bucket_rmem *b = (apr_bucket_rmem *)e->data; - return b->start; -} - -static int rmem_get_len(ap_bucket *e) -{ - apr_bucket_rmem *b = (apr_bucket_rmem *)e->data; - return (char *)b->end - (char *)b->start; -} - -static apr_status_t rmem_split(ap_bucket *e, apr_size_t nbyte) -{ - ap_bucket *newbuck; - apr_bucket_rmem *a = (apr_bucket_rmem *)e->data; - apr_bucket_rmem *b; - apr_ssize_t dump; - - newbuck = ap_bucket_rmem_create(a->start, a->alloc_len, &dump); - b = (apr_bucket_rmem *)newbuck->data; - - b->alloc_len = a->alloc_len - nbyte; - a->alloc_len = nbyte; - b->end = a->end; - a->end = a->start + nbyte; - b->start = a->end + 1; - - newbuck->prev = e; - newbuck->next = e->next; - e->next = newbuck; - - - return APR_SUCCESS; -} - -/* - * save nbyte bytes to the bucket. - * Only returns fewer than nbyte if an error ocurred. - * Returns -1 if no bytes were written before the error ocurred. - * It is worth noting that if an error occurs, the buffer is in an unknown - * state. - */ -static apr_status_t rmem_insert(ap_bucket *e, const void *buf, - apr_size_t nbyte, apr_ssize_t *w) -{ - apr_bucket_rmem *b = (apr_bucket_rmem *)e->data; - - if (nbyte == 0) { - *w = 0; - return APR_SUCCESS; - } - - /* We should probably do some checking to make sure we don't allocate too - * much memory, but that can wait for the second pass. - */ - b->start = buf; - b->end = (char *)b->start + nbyte; - *w = nbyte; - return APR_SUCCESS; -} - -APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(const void *buf, - apr_size_t nbyte, apr_ssize_t *w) -{ - ap_bucket *newbuf; - apr_bucket_rmem *b; - - newbuf = calloc(1, sizeof(*newbuf)); - b = malloc(sizeof(*b)); - - b->alloc_len = 0; - b->start = b->end = NULL; - - newbuf->data = b; - rmem_insert(newbuf, buf, nbyte, w); - - newbuf->color = AP_BUCKET_rmem; - newbuf->read = rmem_get_str; - newbuf->getlen = rmem_get_len; - newbuf->write = rmem_insert; - newbuf->split = rmem_split; - newbuf->free = NULL; - return newbuf; -} - diff --git a/buckets/ap_rwmem_buf.c b/buckets/ap_rwmem_buf.c deleted file mode 100644 index 4ee983776d5..00000000000 --- a/buckets/ap_rwmem_buf.c +++ /dev/null @@ -1,171 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1996-1999 The Apache Group. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * 4. The names "Apache Server" and "Apache Group" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Group. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Group and was originally based - * on public domain software written at the National Center for - * Supercomputing Applications, University of Illinois, Urbana-Champaign. - * For more information on the Apache Group and the Apache HTTP server - * project, please see . - * - */ - -#include "apr_private.h" -#include "apr_buf.h" -#include - -#ifndef DEFAULT_RWBUF_SIZE -#define DEFAULT_RWBUF_SIZE (4096) -#endif - -static const char * rwmem_get_str(ap_bucket *e) -{ - apr_bucket_rwmem *b = (apr_bucket_rwmem *)e->data; - return b->start; -} - -static int rwmem_get_len(ap_bucket *e) -{ - apr_bucket_rwmem *b = (apr_bucket_rwmem *)e->data; - return (char *)b->end - (char *)b->start; -} - -static void rwmem_destroy(void *e) -{ - apr_bucket_rwmem *d = (apr_bucket_rwmem *)e; - free(d->alloc_addr); -} - -static apr_status_t rwmem_split(ap_bucket *e, apr_size_t nbyte) -{ - ap_bucket *newbuck; - apr_bucket_rwmem *a = (apr_bucket_rwmem *)e; - apr_bucket_rwmem *b; - apr_ssize_t dump; - - newbuck = ap_bucket_rwmem_create(a->alloc_addr, a->alloc_len, &dump); - b = (apr_bucket_rwmem *)newbuck->data; - - b->alloc_addr = a->alloc_addr; - b->alloc_len = a->alloc_len; - b->end = a->end; - a->end = a->start + nbyte; - b->start = a->end + 1; - - newbuck->prev = e; - newbuck->next = e->next; - e->next = newbuck; - - return APR_SUCCESS; -} - -/* - * save nbyte bytes to the bucket. - * Only returns fewer than nbyte if an error occurred. - * Returns -1 if no bytes were written before the error occurred. - * It is worth noting that if an error occurs, the buffer is in an unknown - * state. - */ -static apr_status_t rwmem_insert(ap_bucket *e, const void *buf, - apr_size_t nbyte, apr_ssize_t *w) -{ - int amt; - int total; - apr_bucket_rwmem *b = (apr_bucket_rwmem *)e->data; - - if (nbyte == 0) { - *w = 0; - return APR_SUCCESS; - } - -/* - * At this point, we need to make sure we aren't trying to write too much - * data to the bucket. We will need to write to the dist here, but I am - * leaving that for a later pass. The basics are presented below, but this - * is horribly broken. - */ - amt = b->alloc_len - ((char *)b->end - (char *)b->start); - total = 0; - if (nbyte > amt) { - /* loop through and write to the disk */ - /* Replace the rwmem buckets with file buckets */ - } - /* now we know that nbyte < b->alloc_len */ - memcpy(b->end, buf, nbyte); - b->end = (char *)b->end + nbyte; - *w = total + nbyte; - return APR_SUCCESS; -} - -APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(const void *buf, - apr_size_t nbyte, apr_ssize_t *w) -{ - ap_bucket *newbuf; - apr_bucket_rwmem *b; - - newbuf = calloc(1, sizeof(*newbuf)); - b = malloc(sizeof(*b)); - - b->alloc_addr = calloc(DEFAULT_RWBUF_SIZE, 1); - b->alloc_len = DEFAULT_RWBUF_SIZE; - b->start = b->alloc_addr; - b->end = b->alloc_addr; - - newbuf->data = b; - rwmem_insert(newbuf, buf, nbyte, w); - - newbuf->color = AP_BUCKET_rwmem; - newbuf->read = rwmem_get_str; - newbuf->getlen = rwmem_get_len; - newbuf->write = rwmem_insert; - newbuf->split = rwmem_split; - newbuf->free = rwmem_destroy; - - return newbuf; -} - diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h deleted file mode 100644 index 13d1c973fd3..00000000000 --- a/buckets/apr_buf.h +++ /dev/null @@ -1,397 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef AP_BUF_H -#define AP_BUF_H - -#include "apr_mmap.h" -#include "apr_errno.h" -#include "apr_private.h" -/* Currently we need this, but when the filtering is done, the iol's should - * just go away all together, and so will this. :-) */ -#include "../../../include/ap_iol.h" -#ifdef HAVE_SYS_UIO_H -#include /* for struct iovec */ -#endif -#ifdef HAVE_STDARG_H -#include -#endif - - -/* The basic concept behind bucket_brigades..... - * - * A bucket brigade is simply a Queue of buckets, where we aren't limited - * to inserting at the front and removing at the end. - * - * Buckets are just data stores. They can be files, mmap areas, or just - * pre-allocated memory. The point of buckets is to store data. Along with - * that data, come some functions to access it. The functions are relatively - * simple, read, write, getlen, split, and free. - * - * read reads a string of data. Currently, it assumes we read all of the - * data in the bucket. This should be changed to only read the specified - * amount. - * - * getlen gets the number of bytes stored in the bucket. - * - * write writes the specified data to the bucket. Depending on the type of - * bucket, this may append to the end of previous data, or wipe out the data - * currently in the bucket. rwmem buckets append currently, all others - * erase the current bucket. - * - * split just makes one bucket into two at the spefied location. To implement - * this correctly, we really need to implement reference counting. - * - * free just destroys the data associated with the bucket. - * - * We may add more functions later. There has been talk of needing a stat, - * which would probably replace the getlen. And, we definately need a convert - * function. Convert would make one bucket type into another bucket type. - * - * To write a bucket brigade, they are first made into an iovec, so that we - * don't write too little data at one time. Currently we ignore compacting the - * buckets into as few buckets as possible, but if we really want to be - * performant, then we need to compact the buckets before we convert to an - * iovec, or possibly while we are converting to an iovec. - * - * I'm not really sure what else to say about the buckets. They are relatively - * simple and straight forward IMO. It is just a way to organize data in - * memory that allows us to modify that data and move it around quickly and - * easily. - */ - -/* The types of bucket brigades the code knows about. We really don't need - * this enum. All access to the bucket brigades can be done through function - * pointers in the bucket type. However, when we start to do conversion - * routines, this enum will be a huge performance benefit, so we leave it - * alone. As of this moment, only rwmem, rmem, mmap, and eos buckets have - * been implemented. The rest will wait until the filtering design is - * decided upon, or until somebody gets around to them. - */ -typedef enum { - AP_BUCKET_rwmem, - AP_BUCKET_rmem, - AP_BUCKET_file, - AP_BUCKET_mmap, - AP_BUCKET_filename, - AP_BUCKET_cached_entity, - AP_BUCKET_URI, - AP_BUCKET_eos /* End-of-stream bucket. Special case to say this is - * the end of the bucket so all data should be sent - * immediately. */ -} ap_bucket_color_e; - -typedef struct ap_bucket ap_bucket; -/* - * The basic bucket type. This is an abstraction on top of all other bucket - * types. This contains the type of bucket, a pointer to the bucket, and - * a couple of function pointers. Doing it this way, lets us morph buckets - * from one type to another relatively easily. Just change the data pointer - * to point to the new bucket, and replace all of the function pointers. - * - * This also allows for a very simple interface for all features of buckets - * for all bucket types. (does that make any sense at all?) - * - * The current functions are: - * getlen -- get the length of the data in the bucket - * (likely to be replaced soon) - * read -- read the data in the bucket (not garaunteed to read it all) - * write -- insert data into the bucket - * split -- split one bucket into two buckets - * free -- destroy the bucket, freeing it's memory - * - * funtions to be added: - * stat -- get all of the metadata about the bucket (lifetime, type, etc.) - * convert -- change one bucket type into another bucket type. - * - * There are also pointer to the next and previus buckets in the list. - */ -struct ap_bucket { - ap_bucket_color_e color; /* what type of bucket is it */ - void *data; /* for use by free() */ - - /* All of the function pointers that can act on a bucket. */ - void (*free)(void *e); /* can be NULL */ - int (*getlen)(ap_bucket *e); /* Get the length of the string */ - - /* Read the data from the bucket. */ - const char *(*read)(ap_bucket *e); /* Get the string */ - - /* Write into a bucket. The buf is a different type based on the - * bucket type used. For example, with AP_BUCKET_mmap it is an ap_mmap_t - * for AP_BUCKET_file it is an ap_file_t, and for AP_BUCKET_rwmem it is - * a char *. The nbytes is the amount of actual data in buf. This is - * not the sizeof(buf), it is the actual number of bytes in the char * - * that buf resolves to. written is how much of that data was inserted - * into the bucket. - */ - int (*write)(ap_bucket *e, const void *buf, apr_size_t nbytes, apr_ssize_t *w); - - /* Split one bucket into to at the specified position */ - apr_status_t (*split)(ap_bucket *e, apr_size_t nbytes); - - ap_bucket *next; /* The next node in the bucket list */ - ap_bucket *prev; /* The prev node in the bucket list */ -}; - -typedef struct ap_bucket_brigade ap_bucket_brigade; -/* - * This is the basic bucket brigade. That means it is a list of buckets. - * It has a pool out of which the buckets and the bucket brigade are allocated. - * That may change though, because I am leaning towards make the buckets have - * the same lifetime as the data they store in most cases. It also has a - * pointer to the head and tail of the bucket list. This allows us to - * easily remove data from the bucket list, and to easily append data at - * the end. By walking the list, it is also possible to insert in the middle - * of the list. - */ -struct ap_bucket_brigade { - apr_pool_t *p; /* The pool to associate this with. - I do not allocate out of the pool, - but this lets me register a cleanup - to put a limit on the brigade's - lifetime. */ - ap_bucket *head; /* The start of the brigade */ - ap_bucket *tail; /* The end of the brigade */ -}; - -/* ****** Different bucket types *****/ - -typedef struct ap_bucket_rmem ap_bucket_rmem; -/* - * The Read only bucket type. This is basically for memory allocated off the - * stack or literal strings. It cannot be modified, and the lifetime is - * defined by when it was allocated. Most likely these should be split into - * two different types. This contains a pointer to the front and end of the - * string so that it is possible to remove characters at either end. - */ -struct ap_bucket_rmem { - size_t alloc_len; /* how much was allocated */ - const void *start; /* Where does the actual data start - in the alloc'ed block */ - const void *end; /* where does the data actually end? */ -}; - -typedef struct ap_bucket_rwmem ap_bucket_rwmem; -/* - * The read/write memory bucket type. This is for data that has been - * allocated out of the heap. This bucket actually starts by allocating - * 4K of memory. We do this so that the bucket has room to grow. At the - * bottom of the filter stack, we are likely to have to condense the buckets - * to as few as possible. By allocating a big space at the beginning, we - * don't have to make as many allocations at the bottom. If the top level - * handlers are written correctly, we won't have to do much copying either. - * Of course, for legacy handlers, we will have to condense. - * - * This bucket type has a pointer to the start of the allocation. This will - * never be modified. This is used a a reference for the free call. It also - * has the length of the amount allocated. The length could probably go - * away. - * - * Finally, we have a pointer to the start and end of the string currently - * referenced by the bucket. The end cannot be past the original allocation - * pointer + the allocation length. The start cannot be before the original - * allocation pointer. We keep a pointer to the start and end so that we can - * easily add and remove characters at either end. Oh, the start cannot be - * after the end either. - */ -struct ap_bucket_rwmem { - void *alloc_addr; /* Where does the data start */ - size_t alloc_len; /* how much was allocated */ - void *start; /* Where does the actual data start - in the alloc'ed block */ - void *end; /* where does the data actually end? */ -}; - -typedef struct ap_bucket_mmap ap_bucket_mmap; - -/* - * The mmap bucket type. This is basically just an allocation address and a - * length. This needs to be changed to a pointer to an mmap structure that - * has a reference count in it, and a pointer to the beginning and end of - * the data the bucket is referencing. - */ -struct ap_bucket_mmap { - void *alloc_addr; /* Where does the mmap start? */ - int len; /* The amount of data in the mmap that we are - * referencing with this bucket. This may be - * smaller than the length in the data object, - * but it may not be bigger. - */ -}; - -/* ****** Bucket Brigade Functions ***** */ - -/* Create a new bucket brigade. The bucket brigade is originally empty. */ -APR_EXPORT(ap_bucket_brigade *) ap_brigade_create(apr_pool_t *p); - -/* destroy an enitre bucket brigade. This includes destroying all of the - * buckets within the bucket brigade's bucket list. */ -APR_EXPORT(apr_status_t) ap_brigade_destroy(void *b); - -/* append bucket(s) to a bucket_brigade. This is the correct way to add - * buckets to the end of a bucket briagdes bucket list. This will accept - * a list of buckets of any length. - */ -APR_EXPORT(void) ap_brigade_append_buckets(ap_bucket_brigade *b, - ap_bucket *e); - -/* consume nbytes from beginning of b -- call ap_bucket_destroy as - appropriate, and/or modify start on last element */ -APR_EXPORT(void) ap_brigade_consume(ap_bucket_brigade *, int nbytes); - -/* create an iovec of the elements in a bucket_brigade... return number - * of elements used. This is useful for writing to a file or to the - * network efficiently. - */ -APR_EXPORT(int) ap_brigade_to_iovec(ap_bucket_brigade *, - struct iovec *vec, int nvec); - -/* catenate bucket_brigade b onto bucket_brigade a, bucket_brigade b is - * empty after this. Neither bucket brigade can be NULL, but either one of - * them can be emtpy when calling this function. - */ -APR_EXPORT(void) ap_brigade_catenate(ap_bucket_brigade *a, - ap_bucket_brigade *b); - -/* Destroy the first nvec buckets. This is very much like ap_brigade_consume - * except instead of specifying the number of bytes to consume, it consumes - * a specified number of buckets. The original purpose for this function - * was in ap_brigade_to_iovec. After converting the first 16 buckets to - * vectors, we would destroy those 16 buckets. My gut is that this is the - * wrong approach. I plan to change this soon-ish. - */ -APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec); - -/* save the buf out to the specified iol. This can be used to flush the - * data to the disk, or to send it out to the network. This is a poor - * function. It never should have been implemented. Unfortunately, it is - * also required. Once filters have been finished, the whole concept of - * iol's can just go away, and this function can go away with it. The - * correct solution, is to have the functions that are currently calling - * this just call either ap_sendv or ap_writev directly. - */ -APR_EXPORT(apr_status_t) ap_brigade_to_iol(apr_ssize_t *total_bytes, - ap_bucket_brigade *a, - ap_iol *iol); - -/* - * This function writes a bunch of strings into a bucket brigade. How this - * works is a bit strange. If there is already a rwmem bucket at the end of - * the list, we just add the next string to the end. This requires a memcpy, - * but it is assumed that we will have to condense buckets at the bottom of - * the stack anyway, so we would have to do the memcpy anyway. If there is no - * rwmem bucket, then we just allocate a new rmem bucket for each string. - * this avoids the memory allocation, and we hope that one of the intervening - * filters will be removing some of the data. This may be a dubios - * optimization, I just don't know. - */ -APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va); - -/* - * Both of these functions evaluate the printf and put the resulting string - * into a bucket at the end of the bucket brigade. The only reason there are - * two of them, is that the ap_r* functions needed both. I would love to be - * able to remove one, but I don't think it's feasible. - */ -APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...); -APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_list va); - -/* ****** Bucket Functions ***** */ - -/* destroy a bucket, and remove it's memory. This does not necessarily - * free the actual data. For example, an mmap may have multiple buckets - * referenceing it (not currently implemented). Those would only get freed - * when the bucket with the last reference is destroyed. Rwmem buckets - * always have their data destroyed currently. - */ -APR_EXPORT(apr_status_t) ap_bucket_destroy(ap_bucket *e); - -/* get the length of the data in the bucket that is currently being - * referenced. The bucket may contain more data, but if the start or end - * has been moved, we really don't care about it. - */ -APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b); - -/****** Functions to Create Buckets of varying type ******/ - -/* - * All of these functions are responsibly for creating a bucket and filling - * it out with an initial value. Some buckets can be over-written, others - * can't. What should happen, is that buckets that can't be over-written, - * will have NULL write functions. That is currently broken, although it is - * easy to fix. The creation routines may not allocate the space for the - * buckets, because we may be using a free list. Regardless, creation - * routines are responsible for getting space for a bucket from someplace - * and inserting the initial data. - */ - -/* Create a read/write memory bucket */ -APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(const void *buf, - apr_size_t nbyte, apr_ssize_t *w); - - -/* Create a mmap memory bucket */ -APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(const void *buf, - apr_size_t nbytes, apr_ssize_t *w); - -/* Create a read only memory bucket. */ -APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(const void *buf, - apr_size_t nbyte, apr_ssize_t *w); - -/* Create an End of Stream bucket */ -APR_EXPORT(ap_bucket *) ap_bucket_eos_create(void); - -#endif - diff --git a/buckets/doc_SFmtg.txt b/buckets/doc_SFmtg.txt deleted file mode 100644 index bf2fed23cc6..00000000000 --- a/buckets/doc_SFmtg.txt +++ /dev/null @@ -1,172 +0,0 @@ - -From akosut@leland.Stanford.EDU Thu Jul 23 09:38:40 1998 -Date: Sun, 19 Jul 1998 00:12:37 -0700 (PDT) -From: Alexei Kosut -To: new-httpd@apache.org -Subject: Apache 2.0 - an overview - -For those not at the Apache meeting in SF, and even for those who were, -here's a quick overview of (my understanding of) the Apache 2.0 -architecture that we came up with. I present this to make sure that I have -it right, and to get opinions from the rest of the group. Enjoy. - - -1. "Well, if we haven't released 2.0 by Christmas of 1999, it won't - matter anyway." - -A couple of notes about this plan: I'm looking at this right now from a -design standpoint, not an implementation one. If the plan herein were -actually coded as-is, you'd get a very inefficient web server. But as -Donald Knuth (Professor emeritus at Stanford, btw... :) points out, -"premature optimization is the root of all evil." Rest assured there are -plenty of ways to make sure Apache 2.0 is much faster than Apache 1.3. -Taking out all the "slowness" code, for example... :) - -Also, the main ideas in this document mainly come from Dean Gaudet, Simon -Spero, Cliff Skolnick and a bunch of other people, from the Apache Group's -meeting in San Francisco, July 2 and 3, 1998. The other ideas come from -other people. I'm being vague because I can't quite remember. We should -have videotaped it. I've titled the sections of this document with quotes -from our meeting, but they are paraphrased from memory, so don't take them -too seriously. - -2. "But Simon, how can you have a *middle* end?" - -One of the main goals of Apache 2.0 is protocol independence (i.e., -serving HTTP/1.1, HTTP-NG, and maybe FTP or gopher or something). Another -is to rid the server of the belief that everything is a file. Towards this -end, we divide the server up into three parts, the front end, the middle -end, and the back end. - -The front end is essentially a combination of http_main and http_protocol -today. It takes care of all network and protocol matters, interpreting the -request, putting it into a protocol-neutral form, and (possibly) passing -it off to the rest of the server. This is approximately equivalent to the -part of Apache contained in Dean's flow stuff, and it also works very well -in certain non-Unix-like architectures such as clustered mainframes. In -addition, part of this front-end might be optionally run in kernel space, -giving a very fast server indeed... - -The back end is what generates the content. At the back of the back end we -have backing stores (Cliff's term), which contain actual data. These might -represent files on a disk, entries in a database, CGI scripts, etc... The -back end also consists of other modules, which can alter the request in -various fashions. The objects the server acts on can be thought of (Cliff -again) as a filehandle and a set of key/value pairs (metainformation). -The modules are set up as filters that can alter either one of those, -stacking I/O routines onto the stream of data, or altering the -metainformation. - -The middle end is what comes between the front and back ends. Think of -http_request. This section takes care of arranging the modules, backing -stores, etc... into a manner so that the path of the request will result -in the correct entity being delivered to the front end and sent to the -client. - -3. "I won't embarrass you guys with the numbers for how well Apache - performs compared to IIS." (on NT) - -For a server that was designed to handle flat files, Apache does it -surprisingly poorly, compared with other servers that have been optimized -for it. And the performance for non-static files is, of course, worse. -While Apache is still more than fast enough for 95% of Web servers, we'd -be remiss to dismiss those other 5% (they're the fun ones anyway). Another -problem Apache has is its lack of a good, caching, proxy module. - -Put these together, along with the work Dean has done with the flow and -mod_mmap_static stuff, and we realize the most important part of Apache -2.0: a built-in, all-pervasive, cache. Every part of the request process -will involve caching. In the path outlined above, between each layer of -the request, between each module, sits the cache, which can (when it is -useful), cache the response and its metainformation - including its -variance, so it knows when it is safe to give out the cached copy. This -gives every opportunity to increase the speed of the server by making sure -it never has to dynamically create content more than it needs to, and -renders accelerators such as Squid unnecessary. - -This also allows what I alluded to earlier: a kernel (or near-to-kernel) -based web server component, which could read the request, consult the -cache to find the requested object, and spit it back out, without so much -as an interrupt in the way. Of course, the rest of Apache (with all its -modules - it's generally a bad idea to let unknown, untrusted code, insert -itself into the kernel) sits up in user-space, ready to handle any request -the micro-Apache can't. - -A built-in cache also makes a real working HTTP/1.1 proxy server trivially -easy to write. - -4. "Stop asking about backwards compatibility with the API. We'll write a - compatibility module... later." - -If modules are as described above, then obviously they are very much -distinct from how Apache's current modules function. The only module -function that is similar to the current model is the handler, or backing -store, that actually provides the basic stream of data that the server -alters to product a response entity. - -The basic module's approach to its job is to stack a filter onto the -output. But it's better to think of the modules not as a stack that the -request flows through (a layer cake with cache icing between the layers), -but more of a mosaic (pretend I didn't use that word. I wrote collage. You -can't prove anything), with modules stuck onto various sides of the -request at different points, altering the request/response. - -Today's Apache modules take an all-or-nothing approach to request -handlers. They tell Apache what they can do, overestimating, and then are -supposed to DECLINE if they don't pass a number of checks they are -supposed to make. Most modules don't do this correctly. The better -approach is to allow the modules to inform Apache exactly of what they can -do, and have Apache (the middle-end) take care of invoking them when -appropriate. - -The final goal of all of this, of course, is simply to allow CGI output to -be parsed for server-side includes. But don't tell Dean that. - -5. "Will Apache run without any of the normal Unix binaries installed, - only the BSD/POSIX libraries?" - -Another major issue is, of course, configuration of the server. There are -a number of distinct opinions on this, both as to what should be -configured and how it should be done. We talked mainly about the latter, -but the did touch on the former. Obviously, with a radically distinct -module API, the configuration is radically different. We need a good way -to specify how the modules are supposed to interact, and of controlling -what they can do, when and how, balancing what the user asks the server to -do, and what the module (author) wants the server to do. We didn't really -come up with a good answer to this. - -However, we did make some progress on the other side of the issue: We -agreed that the current configuration system is definitely taking the -right approach. Having a well-defined repository of the configuration -scheme, containing the possible directives, when they are applicable, what -their parameters are, etc... is the right way to go. We agreed that more -information and stronger-typing (no RAW_ARGS!) would be good, and may -enable on-the-fly generated configuration managers. - -We agreed that such a program, probably external to Apache, would generate -a configuration and pass it to Apache, either via a standard config file, -or by calling Apache API functions. It is desirable to be able to go the -other way, pulling current configuration from Apache to look at, and -perhaps change it on the fly, but unfortunately is unlikely this -information would always be available; modules may perform optimizations -on their configuration that makes the original configuration unavailable. - -For the language and specification of the configuration, we thought -perhaps XML might be a good approach, and agreed it should be looked -into. Other issues, such as SNMP, were brought up and laughed at. - -6. "So you're saying that the OS that controls half the banks, and 90% of - the airlines, doesn't even have memory protection for seperate - processes?" - -Obviously, there are a lot more items that have to be part of Apache 2.0, -and we talked about a number of them. However, the four points above, I -think, represent the core of the architecture we agreed on as a starting -point. - --- Alexei Kosut - Stanford University, Class of 2001 * Apache * - - - - diff --git a/buckets/doc_bucket_brigades.txt b/buckets/doc_bucket_brigades.txt deleted file mode 100644 index 9fc3c7a0397..00000000000 --- a/buckets/doc_bucket_brigades.txt +++ /dev/null @@ -1,381 +0,0 @@ -To: new-httpd@apache.org -Subject: bucket brigades and IOL -Date: Fri, 12 Nov 1999 23:57:43 -0800 -From: "Roy T. Fielding" -Message-ID: <199911122357.aa18914@gremlin-relay.ics.uci.edu> - -About two years ago I wasted a lot of time writing an Ada95 library -called Onions that provides a stackable stream abstraction for files, -sockets, etc. It is at -if you want to take a look at it, but I don't recommend looking at the -code since it is almost all just working around Ada95's lack of a -system interface. I'll describe the worthwhile bits here. - -The heart of Onions is the input and output stream object -classes and classwide types for building a data stream via a -stack of stream objects (Input_Pipe and Output_Pipe). Reading -from the head of an input pipe causes the head stream object -to read from the next outbound stream object, and on down the line. -Likewise for writing to the head of an output pipe. One of the -main features of streams is that they can filter the data as it -passes, converting, adding to, and/or removing from the data -before giving it to the next object. Since multiple streams can be -cascaded, the complete data conversion is the sum of the individual -data conversions performed by the stream objects. - -So far, no big deal -- this can be manually created by stacking ap_iol -types in a meaningful way. But, the one unique thing I did in Onions was -abstract the memory handling into something called Buckets and moved them -around in Bucket_Brigades. A bucket is an allocated segment of memory -with pointers to its allocation address and current size. If I were doing -this in C, I'd also add a pointer to current start address and allocated -size, so that a single bucket could be shrunk from both ends without -copying, and a function pointer for freeing it at the stream end. -Note that this is the same type of memory structure that IO-Lite uses, -though developed independently and for different reasons. - -A bucket brigade is a list-queue of buckets. Each of the stream read/write -calls would pass a bucket brigade instead of single bucket, since this -made insertion by filters more efficient, with the general idea being that -the outbound end of the sream would be writing them out using writev -or reading them in using readv, which is about as efficient as I could -get with Ada95. [I call it a list-queue instead of just queue because you -have the choice of removing buckets from (or adding to) the queue one -bucket at a time or an entire linked list of buckets.] - -But we could go one step further. A bucket is an ADT, and as such can -be used as a general handle for read-only memory, read-write memory, -cache object, file handle, mmap handle, file name, URL, whatever. -What if, instead of just a stream of memory, it could pass around a -stream of memory interspersed with file handles or references to -remote objects? A filter could then add stuff around the stream without -causing too much parsing overhead, and if it needed to look at all the -bytes in the stream it would just replace the bucket handle with a stream -of memory sucked from that handle. Something like this was talked about -last year (see threads on "Stacking up Response Handling" on 23 Sep 1998 -and "I/O filters & reference counts" in late December 1998 and January 1999). -And Dean started something with ap_buf.h, but I don't know how he meant -to finish it. - -What I was thinking of was - - typedef enum { - AP_BUCKET_rwmem, - AP_BUCKET_rmem, - AP_BUCKET_file_t, - AP_BUCKET_mmap_t, - AP_BUCKET_filename, - AP_BUCKET_cached_entity, - AP_BUCKET_URI, - } ap_bucket_color_t; - - typedef struct ap_bucket_t ap_bucket_t; - struct ap_bucket_t { - ap_bucket_color_t color; - void *content; - ap_status_t (*free)(ap_bucket_t *bucket); - unsigned int refcount; - }; - - typedef struct ap_bucket_rwmem_t ap_bucket_rwmem_t; - struct ap_bucket_rwmem_t { - void *alloc_addr; - size_t alloc_len; - void *addr; - size_t len; - }; - - typedef struct ap_bucket_rmem_t ap_bucket_rmem_t; - struct ap_bucket_rmem_t { - void *addr; - size_t len; - }; - - typedef struct ap_bucket_filename ap_bucket_filename; - struct ap_bucket_filename { - ap_context_t *ctx; - char *name; - ap_stat_t *stat; /* useful if already stat'ed */ - ap_aa_t *conf; /* access control structure for this file */ - }; - - ... - -and then - - typedef struct ap_bucket_list_t ap_bucket_list_t; - struct ap_bucket_list_t { - ap_bucket_t *bucket; - ap_bucket_list_t *prev; - ap_bucket_list_t *next; - }; - - typedef struct ap_brigade_t ap_brigade_t; - struct ap_brigade_t { - ap_context_t *ctx; - ap_bucket_list_t *first; - ap_bucket_list_t *last; - unsigned int count; - }; - -and then construct the input and output streams as pushing these -bucket brigades to or from the client. The streams would have to -be a little more complicated than Onions, since I learned later that -you also need a parallel stream of header fields (in tokenized form) -in order for it to work with anything HTTP-like. - -Why use an enum instead of a bunch of file pointers for each type -of bucket, kind of like ap_iol? Because it allows adjacent memory -buckets (the most frequent kind after a filter operation) to be -gathered into a single writev. Also, we need a way to be able to -set up an operation and figure out what it will produce without -actually performing the operation -- this is for OPTIONS and HEAD. - -Note that this would completely change the way we handle internal -redirects, subrequests, server-side include, mod_proxy, access control, etc. -And then most of the API hooks would need to change. I think that is why -Dean was putting it off until 2.1. The annoying thing is that this is the -most useful rearchitecting of the server -- the MPM, APR, and hook changes -make 2.0 easier/cleaner/faster to port to other platforms, but layering -enables in one fell swoop almost every significant non-config feature -that our users have requested. A cache would just be a hash table or -btree of file buckets, complete with AA info. - -Anyway, that was stuck in the back of my head and had to get out. -I won't be able to work on it until after the dissertation is done, -which every day seems to be further away. Maybe 3.0, with rHTTP/2.0. - -....Roy - -================================================= -To: new-httpd@apache.org -Subject: Re: bucket brigades and IOL -In-reply-to: Your message of "Sat, 13 Nov 1999 20:43:58 GMT." - <382DCD8E.881B8468@algroup.co.uk> -Date: Sun, 14 Nov 1999 22:24:03 -0800 -From: "Roy T. Fielding" -Message-ID: <199911142224.aa22545@gremlin-relay.ics.uci.edu> - -BenL wrote: ->I've got to say that this is the most coherent suggestion along these ->lines that I've seen yet. I rather like it. One thing I'd add is that if ->you are going to have a movable "start of block" pointer, and changeable ->length, it can be nice to allocate extra around the edges under some ->circumstances, so that lower layers can expand the block without having ->to add extra chunks. - -Or, alternatively, allocate equal size blocks and just pass around -a reference pair within the buckets that, when the bucket is freed, -access a more complicated reference-counting pool. I think that is -closer to what IO-Lite does. - ->Also, the usual objections still apply - i.e. it is awkward to do things ->like searching for particular strings, since they may cross boundaries. ->I'm beginning to think that the right answer to this is to provide nice ->matching functions that know about the chunked structures, and last ->resort functions that'll glue it all back into one chunk... - -Yep, that's what I ended up doing for Ada95, though in that case there -were no easier alternatives. - -....Roy - -================================================= -To: new-httpd@apache.org -Subject: Re: layered I/O (was: cvs commit: ...) -In-reply-to: Your message of "Wed, 29 Mar 2000 01:21:09 PST." - -Date: Wed, 29 Mar 2000 02:05:08 -0800 -From: "Roy T. Fielding" -Message-ID: <200003290205.aa19557@gremlin-relay.ics.uci.edu> - ->Selection of IO Layers -> ->The core selects a source module and IO layers based on the urlspace ->configuration. Content might be generated by mod_perl, and the result is ->piped through mod_chunk, mod_ssl, and mod_net, in turn. When the content ->generator runs, the core enforces that the module set the content type ->before the first call to ap_bput. The content type is set by a function ->call. The function (ap_set_content_type(request_rec *, char *)) examines ->the content type and adds IO layers as neccessary. For server parsed ->html, the core might insert mod_include immediately after mod_perl. - -The problem of thinking of it that way is that, like Dean mentioned, -the output of one module may be filtered and the filter indicate that -content should be embedded from another URL, which turns out to be a -CGI script that outputs further parseable content. In this instance, -the goal of layered-IO is to abstract away such behavior so that the -instance is processed recursively and thus doesn't result in some tangled -mess of processing code for subrequests. Doing it requires that each -layer be able to pass both data and metadata, and have both data and -metadata be processed at each layer (if desired), rather than call a -single function that would set the metadata for the entire response. - -My "solution" to that is to pass three interlaced streams -- data, -metadata, and meta-metadata -- through each layer. The metadata -streams would point to a table of tokenized name-value pairs. -There are lots of ways to do that, going back to my description of -bucket brigades long ago. Basically, each block of memory would -indicate what type of data, with metadata occurring in a block before -the data block(s) that it describes (just like chunk-size describes -the subsequent chunk-data) and the layers could be dynamically -rearranged based on the metadata that passed through them, in -accordance with the purpose of the filter. - ->(Can anyone produce a use case where the IO chain could change after ->output begins?) - -Output is a little easier, but that is the normal case for input. -We don't know what filters to apply to the request body until after -we have passed through the HTTP headers, and the HTTP message processor -is itself a filter in this model. - -....Roy - - -================================================= -To: new-httpd@apache.org -Subject: Re: filtering patches -In-reply-to: Your message of "Mon, 10 Jul 2000 15:33:25 PDT." - -Date: Mon, 10 Jul 2000 16:58:00 -0700 -From: "Roy T. Fielding" -Message-ID: <200007101657.aa21782@gremlin-relay.ics.uci.edu> - -[...] -I meant that the filters, when written to as part of the output stream, -are treated as a stack (write to the top-most filter without any knowledge -of what may lie underneath it). So the process of arranging filters -for a particular response is like dropping them onto a stack. When a -filter is done or the stream is closed, each instantiated filter cleans -up according to its local state and then destroys itself (as it is popped -off the stack). - -This is completely separate from the registration of filters by -name and purpose, which could be done by hooks. The difference is that -filters are registered at config time but only instantiated (given local -storage) and arranged on a per stream basis. - -Bucket brigades is simply a way to encapsulate and pass data down the stream -such that it can be as efficient as the sender desires, while retaining -a simple interface. The purpose of the bucket is to make handling of the -data uniform regardless of its type, or make type-specific conversions -via a single ADT call if and only if they are needed by some filter. -The purpose of the brigade is to reduce the number of calling arguments -and linearize the calling sequence for insertion filters. Each filter -definition is separate from its instantiation on the stream because -there may be many streams operating at once within a single program. -Each bucket is independent of the brigade so that the filters can rearrange -and insert buckets at will. Each data item is isolated by the bucket -structure, which allows them to be split across child buckets or shared -with multiple streams (e.g., cached objects). We don't need to implement -all of this on the first pass -- we just need to implement the ADT external -interfaces such that they don't have to change as we make the overall -stream more efficient. - -BTW, in case I didn't make this clear in past messages, this design is -an amalgam of the best aspects of the designs from Henrik's Streams -(see w3c-libwww), sfio (AT&T Research), IO-Lite (Rice Univ.), and -libwww-ada95 (UCI). The MIME stuff in MSIE is based on Henrik's streams. -Henrik's stuff is very fast, but is spaghetti code because it relies on -callbacks and legacy stuff in libwww. sfio is great but is intended to -be a complete replacement for stdio and hence does way too much and is -subject to a few patents that I don't appreciate. IO-Lite is cool but -is probably only worth it when the entire OS is based on IO-Lite memory -management, but regardless the code isn't available for commercial use. -As Dean has mentioned many times, we already get most of the performance -benefit of IO-Lite simply by avoiding memory copies on large writes. -libwww-ada95 was an attempt to make Ada95 suck less for systems programming, -which was only a partial success (it is very fast compared to other Ada95 -libraries, but memory management became a problem with complex filters). - -Writing our own streams library isn't NIH syndrome -- both Dean and I -have independently investigated the other available alternatives and they -just aren't suitable for our purpose. Even with all that, my own design -only truly pays off (versus plain old BUFF) when you make good use of -sendfile and shared object caching. - -[...] - - -================================================= -Other stuff Roy wrote on new-httpd: - -My buckets are passed around in list-queues (really just lists with front -and back pointers). My buckets carry data and metadata and meta-metadata. -My buckets are used to indicate stream-end, and the filter configuration -itself is determined by the stream content. It probably sounds weird, but -the effects of this interface are completely different than mere content -filters. They simplify everything. I'm not saying that we have to -simplify everything right away, but I am saying that it is just as easy -to implement a fully-general filter using bucket brigades as it is -to implement string interface filters -- all of the complex parts -are handled by the ADTs. - -... - -The real psychedelic stuff happens when you can pass metadata (tokenized -header fields) as buckets and the filters know how to pass that down the -chain without treating them as data. - -... - -The purpose of passing a list of buckets around is to linearize -the call stack for the frequent case of filtered content -splitting one large bucket into separate buckets with filtered results -interspersed in between. The effect is that a filter chain can frequently -process an entire message in one pass down the chain, which enables the -stream end to send the entire response in one go, which also allows it -to do interesting things like provide a content length by summing the -data length of all the buckets' data, and set a last-modified time -by picking the most recent time from a set of static file buckets. - -I think it would help if we stopped using artificial examples. Let's -try something simple: - - socket <-- http <-- add_footer <-- add_header <-- send_file - -send_file calls its filter with an ap_file_t bucket and End-of-Stream (EOS) -in the bucket list. add_header sets a flag, prepends another ap_file_t -bucket to the list and sends the list to its filter. add_footer looks -at the list, finds the EOS, inserts another ap_file_t bucket in -front of the EOS, and sends the list on to its filter. http walks through -the list picking up the (cached) stat values, notes the EOS and seeing -that its own flag for headers_sent is false, sets the cumulative metadata -and sends the header fields, followed by three calls to the kernel to -send out the three files using whatever mechanism is most efficient. - -The point here isn't that this is the only way to implement filters. -The point is that no other interface can implement them as efficiently. -Not even close. Yes, there are cases where string filters are just as -efficient as any other design, but there is no case in which they are -more efficient than bucket brigades. The reason is that being able -to process a list of strings in one call more than offsets the extra -cost of list processing, regardless of the filter type, and allows -for additional features that have benefits for http processing. -Like, for example, being able to determine the entire set of resources -that make up the source of this dynamic resource without teaching every -filter about WebDAV. - -... - -Making many small calls down the filter chain is something best -avoided, which is why the bucket brigades interface consists of -a linked list of buckets, such that all of the currently available -data can be passed-on in a single call. - -Being able to handle sendfile, cached objects and subrequests is very -effective at improving efficiency, which is why the buckets are typed. -A filter that needs to do byte-level processing will have to call a -routine to convert the typed bucket into a data stream, but that decision -is delayed until no other choice is available and adds no overhead to -the common cases of non-filtered or pre-/post-filtered objects. - -Being able to process header fields (metadata) through the same filter -set as the data is necessary for correctness and simplicity in the -proper ordering of independently developed filter modules, which is -why the buckets can carry metadata on the same stream. Every filter -has to be knowledgeable about metadata because only the filter knows -whether or not its actions will change the nature of the data. - - diff --git a/buckets/doc_dean_iol.txt b/buckets/doc_dean_iol.txt deleted file mode 100644 index 95c0c34c025..00000000000 --- a/buckets/doc_dean_iol.txt +++ /dev/null @@ -1,496 +0,0 @@ -goals? we need an i/o abstraction which has these properties: - -- buffered and non-buffered modes - - The buffered mode should look like FILE *. - - The non-buffered mode should look more like read(2)/write(2). - -- blocking and non-blocking modes - - The blocking mode is the "easy" mode -- it's what most module writers - will see. The non-blocking mode is the "hard" mode, this is where - module writers wanting to squeeze out some speed will have to play. - In order to build async/sync hybrid models we need the - non-blocking i/o abstraction. - -- timed reads and writes (for blocking cases) - - This is part of my jihad against asynchronous notification. - -- i/o filtering or layering - - Yet another Holy Grail of computing. But I digress. These are - hard when you take into consideration non-blocking i/o -- you have - to keep lots of state. I expect our core filters will all support - non-blocking i/o, well at least the ones I need to make sure we kick - ass on benchmarks. A filter can deny a switch to non-blocking mode, - the server will have to recover gracefully (ha). - -- copy-avoidance - - Hey what about zero copy a la IO-Lite? After having experienced it - in a production setting I'm no longer convinced of its benefits. - There is an enormous amount of overhead keeping lists of buffers, - and reference counts, and cleanup functions, and such which requires - a lot of tuning to get right. I think there may be something here, - but it's not a cakewalk. - - What I do know is that the heuristics I put into apache-1.3 to choose - writev() at times are almost as good as what you can get from doing - full zero-copy in the cases we *currently* care about. To put it - another way, let's wait another generation to deal with zero copy. - - But sendfile/transmitfile/etc. those are still interesting. - - So instead of listing "zero copy" as a property, I'll list - "copy-avoidance". - -So far? - -- ap_bungetc added -- ap_blookc changed to return the character, rather than take a char *buff -- in theory, errno is always useful on return from a BUFF routine -- ap_bhalfduplex, B_SAFEREAD will be re-implemented using a layer I think -- chunking gone for now, will return as a layer -- ebcdic gone for now... it should be a layer - -- ap_iol.h defined, first crack at the layers... - - Step back a second to think on it. Much like we have fread(3) - and read(2), I've got a BUFF and an ap_iol abstraction. An ap_iol - could use a BUFF if it requires some form of buffering, but many - won't require buffering... or can do a better job themselves. - - Consider filters such as: - - ebcdic -> ascii - - encryption - - compression - These all share the property that no matter what, they're going to make - an extra copy of the data. In some cases they can do it in place (read) - or into a fixed buffer... in most cases their buffering requirements - are different than what BUFF offers. - - Consider a filter such as chunking. This could actually use the writev - method to get its job done... depends on the chunks being used. This - is where zero-copy would be really nice, but we can get by with a few - heuristics. - - At any rate -- the NSPR folks didn't see any reason to included a - buffered i/o abstraction on top of their layered i/o abstraction... so - I feel like I'm not the only one who's thinking this way. - -- iol_unix.c implemented... should hold us for a bit - - -============================== -Date: Mon, 10 Apr 2000 14:39:48 -0700 (PDT) -From: dean gaudet -To: new-httpd@apache.org -Subject: Re: Buff should be an I/O layer -In-Reply-To: <20000410123109.C3931@manojk.users.mindspring.com> -Message-ID: - -[hope you don't mind me taking this back to new-httpd so that it's -archived this time :)] - -On Mon, 10 Apr 2000, Manoj Kasichainula wrote: - -> On Mon, Mar 27, 2000 at 04:48:23PM -0800, Dean Gaudet wrote: -> > On Sat, 25 Mar 2000, Manoj Kasichainula wrote: -> > > (aside: Though my unschooled brain still sees no -> > > problem if our chunking layer maintains a pile of 6-byte blocks that -> > > get used in an iol_writev. I'll read the archived discussions.) -> > -> > there's little in the way of archived discussions, there's just me admitting -> > that i couldn't find a solution which was not complex. -> -> OK, there's got to be something wrong with this: -> -> chunk_iol->iol_write(char *buffer) { -> pull a 10-byte (or whatever) piece out of our local stash -> construct a chunk header in it -> set the iovec = chunk header + buffer -> writev(iovec) -> } -> -> But what is it? - -when i was doing the new apache-2.0 buffering i was focusing a lot on -supporting non-blocking sockets so we could do the async i/o stuff -- and -to support a partial write you need to keep more state than what your -suggestion has. - -also, the real complexity comes when you consider handling a pipelined -HTTP/1.1 connection -- consider what happens when you get 5 requests -for /cgi-bin/printenv smack after the other. - -if you do that against apache-1.3 and the current apache-2.0 you get -back maximally packed packets. but if you make chunking a layer then -every time you add/remove the layer you'll cause a packet boundary -- -unless you add another buffering layer... or otherwise shift around -the buffering. - -as a reminder, visit - for a -description of how much we win on the wire from such an effort. - -also, at some point i worry that passing the kernel dozens of tiny -iovecs is more expensive than an extra byte copy into a staging buffer, -and passing it one large buffer. but i haven't done any benchmarks to -prove this. (my suscipions have to do with the way that at least the -linux kernel's copying routine is written regarding aligned copies) - -oh it's totally worth pointing out that at least Solaris allows at -most 16 iovecs in a single writev()... which probably means every sysv -derived system is similarly limited. linux sets the limit at 1024. -freebsd has an optimisation for up to 8, but otherwise handles 1024. - -i'm still doing work in this area though -- after all my ranting about -zero-copy a few weeks back i set out to prove myself wrong by writing -a zero-copy buffering library using every trick in my book. i've no -results to share yet though. - --dean - - -============================== -Date: Tue, 2 May 2000 15:51:30 +0200 -From: Martin Kraemer -To: new-httpd@apache.org -Subject: BUFF, IOL, Chunking, and Unicode in 2.0 (long) -Message-ID: <20000502155129.A10548@pgtm0035.mch.sni.de> - -Sorry for a long silence in the past weeks, I've been busy with other -stuff. - -Putting the catch-words "Chunking, Unicode and 2.0" into the subject -was on purpose: I didn't want to scare off anyone because of the word -EBCDIC: the problems I describe here, and the proposed new buff.c -layering, are mostly independent from the EBCDIC port. - - -In the past weeks, I've been thinking about today's buff.c (and -studied its applicability for automatic conversion stuff like in the -russian apache, see apache.lexa.ru). I think it would be neat to be -able to do automatic character set conversion in the server, for -example by negotiation (when the client sends an Accept-Charset and -the server doesn't have a document with exactly the right Charset, but -knows how to generate it from an existing representation). - -IMO it is a reoccurring problem, - -* not only in today's russian internet environment (de facto browsers - support 5 different cyrillic character sets, but the server doesn't - want to hold every document in 5 copies, so an automatic translation - is performed by the russian apache, depending on information supplied - by the client, or by explicit configuration). One of the supported - character sets is Unicode (UTF-7 or UTF-8) - -* in japanese/chinese environments, support for 16 bit character sets - is an absolute requirement. (Other oriental scripts like Thai get - along with 8 bit: they only have 44 consonants and 16 vowels). - Having success on the eastern markets depends to a great deal on - having support for these character sets. The japanese Apache - community hasn't had much contact with new-httpd in the past, but - I'm absolutely sure that there is a "standard japanese patch" for - Apache which would well be worth integrating into the standard - distribution. (Anyone on the list to provide a pointer?) - -* In the future, more and more browsers will support unicode, and so - will the demand grow for servers supporting unicode. Why not - integrate ONE solution for the MANY problems worldwide? - -* The EBCDIC port of 1997 has been a simple solution for a rather - simple problem. If we would "do it right" for 2.0 and provide a - generic translation layer, we would solve many problems in a single - blow. The EBCDIC translation would be only one of them. - -Jeff has been digging through the EBCDIC stuff and apparently -succeeded in porting a lot of the 1.3 stuff to 2.0 already. Jeff, I'd -sure be interested in having a look at it. However, when I looked at -buff.c and the new iol_* functionality, I found out that iol's are not -the way to go: they give us no solution for any of the conversion -problems: - -* iol's sit below BUFF. Therefore, they don't have enough information - to know which part of the written byte stream is net client data, - and which part is protocol information (chunks, MIME headers for - multipart/*). - -* iol's don't allow simplification of today's chunking code. It is - spread thruout buff.c and there's a very hairy balance between - efficiency and code correctness. Re-adding (EBCDIC/UTF) conversion, - possibly with sup[port for multi byte character sets (MBCS), would - make a code nightmare out of it. (buff.c in 1.3 was "almost" a - nightmare because we had onlu single byte translations. - -* Putting conversion to a hierarchy level any higher than buff.c is no - solution either: for chunks, as well as for multipart headers and - buffering boundaries, we need character set translation. Pulling it - to a higher level means that a lot of redundant information has to - be passed down and up. - -In my understanding, we need a layered buff.c (which I number from 0 -upwards): - -0) at the lowest layer, there's a "block mode" which basically - supports bread/bwrite/bwritev by calling the equivalent iol_* - routines. It doesn't know about chunking, conversion, buffering and - the like. All it does is read/write with error handling. - -1) the next layer handles chunking. It knows about the current - chunking state and adds chunking information into the written - byte stream at appropriate places. It does not need to know about - buffering, or what the current (ebcdic?) conversion setting is. - -2) this layer handles conversion. I was thinking about a concept - where a generic character set conversion would be possible based on - Unicode-to-any translation tables. This would also deal with - multibyte character sets, because at this layer, it would - be easy to convert SBCS to MBCS. - Note that conversion *MUST* be positioned above the chunking layer - and below the buffering layer. The former guarantees that chunking - information is not converted twice (or not at all), and the latter - guarantees that ap_bgets() is looking at the converted data - (-- otherwise it would fail to find the '\n' which indicates end- - of-line). - Using (loadable?) translation tables based on unicode definitions - is a very similar approach to what libiconv offers you (see - http://clisp.cons.org/~haible/packages-libiconv.html -- though my - inspiration came from the russian apache, and I only heard about - libiconv recently). Every character set can be defined as a list - of pairs, and translations between - several SBCS's can be collapsed into a single 256 char table. - Efficiently building them once only, and finding them fast is an - optimization task. - -3) This last layer adds buffering to the byte stream of the lower - layers. Because chunking and translation have already been dealt - with, it only needs to implement efficient buffering. Code - complexity is reduced to simple stdio-like buffering. - - -Creating a BUFF stream involves creation of the basic (layer 0) BUFF, -and then pushing zero or more filters (in the right order) on top of -it. Usually, this will always add the chunking layer, optionally add -the conversion layer, and usually add the buffering layer (look for -ap_bcreate() in the code: it almost always uses B_RD/B_WR). - -Here's code from a conceptual prototype I wrote: - BUFF *buf = ap_bcreate(NULL, B_RDWR), *chunked, *buffered; - chunked = ap_bpush_filter(buf, chunked_filter, 0); - buffered = ap_bpush_filter(chunked, buffered_filter, B_RDWR); - ap_bputs("Data for buffered ap_bputs\n", buffered); - - -Using a BUFF stream doesn't change: simply invoke the well known API -and call ap_bputs() or ap_bwrite() as you would today. Only, these -would be wrapper macros - - #define ap_bputs(data, buf) buf->bf_puts(data, buf) - #define ap_write(buf, data, max, lenp) buf->bf_write(buf, data, max, lenp) - -where a BUFF struct would hold function pointers and flags for the -various levels' input/output functions, in addition to today's BUFF -layout. - -For performance improvement, the following can be added to taste: - -* fewer buffering (zero copy where possible) by putting the buffers - for buffered reading/writing down as far as possible (for SBCS: from - layer 3 to layer 0). By doing this, the buffer can also hold a - chunking prefix (used by layer 1) in front of the buffering buffer - to reduce the number of vectors in a writev, or the number of copies - between buffers. Each layer could indicate whether it needs a - private buffer or not. - -* intra-module calls can be hardcoded to call the appropriate lower - layer directly, instead of using the ap_bwrite() etc macros. That - means we don't use the function pointers all the time, but instead - call the lower levels directly. OTOH we have iol_* stuff which uses - function pointers anyway. We decided in 1.3 that we wanted to avoid - the C++ type stuff (esp. function pointers) for performance reasons. - But it would sure reduces the code complexity a lot. - -The resulting layering would look like this: - - | Caller: using ap_bputs() | or ap_bgets/apbwrite etc. - +--------------------------+ - | Layer 3: Buffered I/O | gets/puts/getchar functionality - +--------------------------+ - | Layer 2: Code Conversion | (optional conversions) - +--------------------------+ - | Layer 1: Chunking Layer | Adding chunks on writes - +--------------------------+ - | Layer 0: Binary Output | bwrite/bwritev, error handling - +--------------------------+ - | iol_* functionality | basic i/o - +--------------------------+ - | apr_* functionality | - .... - --- - | Fujitsu Siemens -Fon: +49-89-636-46021, FAX: +49-89-636-41143 | 81730 Munich, Germany - - -============================== -Date: Tue, 2 May 2000 09:09:28 -0700 (PDT) -From: dean gaudet -To: new-httpd@apache.org -Subject: Re: BUFF, IOL, Chunking, and Unicode in 2.0 (long) -In-Reply-To: <20000502155129.A10548@pgtm0035.mch.sni.de> -Message-ID: - -On Tue, 2 May 2000, Martin Kraemer wrote: - -> * iol's sit below BUFF. Therefore, they don't have enough information -> to know which part of the written byte stream is net client data, -> and which part is protocol information (chunks, MIME headers for -> multipart/*). - -there's not much stopping you from writing an iol which takes a BUFF * in -its initialiser, and then bcreating a second BUFF, and bpushing your iol. -like: - - /* this is in r->pool rather than r->connection->pool because - * we expect to create & destroy this inside request boundaries - * and if we stuck it in r->connection->pool the storage wouldn't - * be reclaimed earlier enough on pipelined connections. - * - * also, no need for buffering in new_buff because the translation - * layer can easily assume lower level BUFF is doing the buffering. - */ - new_buff = ap_bcreate(r->pool, B_WR); - ap_bpush_iol(new_buff, - ap_utf8_to_ebcdic(r->pool, r->connection->client)); - r->connection->client = new_buff; - -main problem is that the new_buff only works for writing, and you -potentially need a separate conversion layer for reading from the -client. - -shouldn't be too hard to split up r->connection->client into a read and -write half. - -think of iol as the equivalent of the low level read/write, and BUFF -as the equivalent of FILE *. there's a reason for both layers in -the interface. - -> * iol's don't allow simplification of today's chunking code. It is -> spread thruout buff.c and there's a very hairy balance between -> efficiency and code correctness. Re-adding (EBCDIC/UTF) conversion, -> possibly with sup[port for multi byte character sets (MBCS), would -> make a code nightmare out of it. (buff.c in 1.3 was "almost" a -> nightmare because we had onlu single byte translations. - -as i've said before, i welcome anyone to do it otherwise without adding -network packets, without adding unnecessary byte copies, and without -making it even more complex. until you've tried it, it's pretty easy -to just say "this is a mess". once you've tried it i suspect you'll -discover why it is a mess. - -that said, i'm still trying to prove to myself that the zero-copy -crud necessary to clean this up can be done in a less complex manner. - -> * Putting conversion to a hierarchy level any higher than buff.c is no -> solution either: for chunks, as well as for multipart headers and -> buffering boundaries, we need character set translation. Pulling it -> to a higher level means that a lot of redundant information has to -> be passed down and up. - -huh? HTTP is in ASCII -- you don't need any conversion -- if a chunking -BUFF below a converting BUFF/iol is writing those things in ascii -it works. no? at least that's my understanding of the code in 1.3. - -you wouldn't do the extra BUFF layer above until after you've written -the headers into the plain-text BUFF. - -i would expect you'd: - - write headers through plain text BUFF - push conversion BUFF - run method - pop conversion BUFF - pump multipart header - push conversion BUFF - ... - pop conversion BUFF - -> In my understanding, we need a layered buff.c (which I number from 0 -> upwards): - -you've already got it :) - -> | Caller: using ap_bputs() | or ap_bgets/apbwrite etc. -> +--------------------------+ -> | Layer 3: Buffered I/O | gets/puts/getchar functionality -> +--------------------------+ -> | Layer 2: Code Conversion | (optional conversions) -> +--------------------------+ -> | Layer 1: Chunking Layer | Adding chunks on writes -> +--------------------------+ -> | Layer 0: Binary Output | bwrite/bwritev, error handling -> +--------------------------+ -> | iol_* functionality | basic i/o -> +--------------------------+ -> | apr_* functionality | - -there are two cases you need to consider: - -chunking and a partial write occurs -- you need to keep track of how much -of the chunk header/trailer was written so that on the next loop around -(which happens in the application at the top) you continue where you -left off. - -and more importantly at the moment, and easier to grasp -- consider what -happens when you've got a pipelined connection. a dozen requests come -in from the client, and apache-1.3 will send back the minimal number -of packets. 2.0-current still needs fixing in this area (specifically -saferead needs to be implemented). - -for example, suppose the client sends one packet: - - GET /images/a.gif HTTP/1.1 - Host: foo - - GET /images/b.gif HTTP/1.1 - Host: foo - -suppose that a.gif and b.gif are small 200 byte files. - -apache-1.3 sends back one response packet: - - HTTP/1.1 OK - headers - - a.gif body - HTTP/1.1 OK - headers - - b.gif body - -consider what happens with your proposal. in between each of those -requests you remove the buffering -- which means you have to flush a -packet boundary. so your proposal generates two network packets. - -like i've said before on this topic -- if all unixes had TCP_CORK, -it'd be a breeze. but only linux has TCP_CORK. - -you pretty much require a layer of buffering right above the iol which -talks to the network. - -and once you put that layer of buffering there, you might as well merge -chunking into it, because chunking needs buffering as well (specifically -for the async i/o case). - -and then you either have to double-buffer, or you can only stack -non-buffered layers above it. fortunately, character-set conversion -should be doable without any buffering. - -*or* you implement a zero-copy library, and hope it all works out in -the end. - --dean - diff --git a/buckets/doc_greg_filters.txt b/buckets/doc_greg_filters.txt deleted file mode 100644 index 346e877f4ed..00000000000 --- a/buckets/doc_greg_filters.txt +++ /dev/null @@ -1,102 +0,0 @@ -Date: Fri, 14 Apr 2000 13:46:50 -0700 (PDT) -From: Greg Stein -To: new-httpd@apache.org -Subject: Re: I/O filtering in 2.0 -In-Reply-To: -Message-ID: - -On Fri, 14 Apr 2000 rbb@covalent.net wrote: -> I am not calling this I/O Layering, because this is really output -> filtering. The patch I am submitting allows modules to edit data after a -> handler has finished with it. This is basically Greg's approach. - -I'll detail my approach here, as your patch has some pieces, but it is -quite different. - -All of this is obviously IMO... - - -*) we definitely want multiple output filters. each filter is recorded in - a linked list in the request_rec. - -*) a filter has a name and is implemented by a module. this mapping is set - up similarly to handler maps in the 'module' structure. - -*) output from normal modules is identical to today. they use ap_rputs, - ap_rwrite, etc. Filtering occurs under the covers. - -*) Apache defines ap_lwrite(ap_layer *next_layer, - const void *buf, size_t len, - request_rec *r) - and possibly some similar ones for printf, puts, etc - -*) struct ap_layer_s { - const char *layer_name; - layer_func_t *func; - struct ap_layer_s *next; - } - - /* filters implement function with this type: */ - typedef ap_status_t (*layer_func_t)(ap_layer *next_layer, - const void *buf, size_t len, - request_rec *r); - /* ### dunno about that return type */ - /* looks remarkably similar to ap_lwrite(), eh? */ - -*) ap_status_t ap_lwrite(ap_layer *layer, const void *buf, - size_t len, request_rec *r) - { - if (layer == NULL) { - ap_bwrite(r->connection->client, buf, len, &amt); - return OK; - } - return (*layer->func)(layer->next, buf, len, r); - } - -*) a new Apache directive can detail the sequence of filters and install - them into the request_rec. - -*) ap_rwrite() and friends calls ap_lwrite(r->first_layer, ...). this will - perform actual output filtering, or go off to the BUFF stuff. - -*) a new hook is added: install_filters. it is called right before - invoke_handlers and is responsible for setting r->first_layer and/or - elements along the list. - -*) a new, small module can implement a directive which responds to - install_filters and sets up a sequence of filters based on their names. - for example: - SetFilters PHP SSI - -*) content handlers (e.g. during invoke_handler processing) have a new - function to call: ap_set_content_type(r, const char *type). when the - type is changed, such as during CGI processing, this function is called - and an opportunity (somehow? haven't thought on this part) is provided - for new output layers to be inserted. - [ this provides for a CGI output'ing application/x-httpd-php3 ] - - ap_set_content_type() should probably know where it is during the - request processing so that it can be used any time. maybe it should be - allowed to set up layers at any time? - - -That's it. :-) - -Helper functions to set up a pipe and a sub-thread would be handy. That -would allow some modules to keep their "read from an fd" approach, rather -than switching to a stateful parser approach. As Dean stated before, -output filtering is necessarily asynchronous: a sub thread or a state -machine thingy is required. - -[ flipping things around, you could say that the initial content can be - generated asynchronously (where the first filter demands the next chunk - of output). this would be incredibly difficult for things like - mod_autoindex. at some point, somebody is pulling content and shoving it - down the BUFF. the above form is "everybody shoves content" ] - -Cheers, --g - --- -Greg Stein, http://www.lyra.org/ - diff --git a/buckets/doc_page_io.txt b/buckets/doc_page_io.txt deleted file mode 100644 index 7e8d885f181..00000000000 --- a/buckets/doc_page_io.txt +++ /dev/null @@ -1,166 +0,0 @@ - -From dgaudet@arctic.org Fri Feb 20 00:36:52 1998 -Date: Fri, 20 Feb 1998 00:35:37 -0800 (PST) -From: Dean Gaudet -To: new-httpd@apache.org -Subject: page-based i/o -X-Comment: Visit http://www.arctic.org/~dgaudet/legal for information regarding copyright and disclaimer. -Reply-To: new-httpd@apache.org - -Ed asked me for more details on what I mean when I talk about "paged based -zero copy i/o". - -While writing mod_mmap_static I was thinking about the primitives that the -core requires of the filesystem. What exactly is it that ties us into the -filesystem? and how would we abstract it? The metadata (last modified -time, file length) is actually pretty easy to abstract. It's also easy to -define an "index" function so that MultiViews and such can be implemented. -And with layered I/O we can hide the actual details of how you access -these "virtual" files. - -But therein lies an inefficiency. If we had only bread() for reading -virtual files, then we would enforce at least one copy of the data. -bread() supplies the place that the caller wants to see the data, and so -the bread() code has to copy it. But there's very little reason that -bread() callers have to supply the buffer... bread() itself could supply -the buffer. Call this new interface page_read(). It looks something like -this: - - typedef struct { - const void *data; - size_t data_len; /* amt of data on page which is valid */ - ... other stuff necessary for managing the page pool ... - } a_page_head; - - /* returns NULL if an error or EOF occurs, on EOF errno will be - * set to 0 - */ - a_page_head *page_read(BUFF *fb); - - /* queues entire page for writing, returns 0 on success, -1 on - * error - */ - int page_write(BUFF *fb, a_page_head *); - -It's very important that a_page_head structures point to the data page -rather than be part of the data page. This way we can build a_page_head -structures which refer to parts of mmap()d memory. - -This stuff is a little more tricky to do, but is a big win for performance. -With this integrated into our layered I/O it means that we can have -zero-copy performance while still getting the advantages of layering. - -But note I'm glossing over a bunch of details... like the fact that we -have to decide if a_page_heads are shared data, and hence need reference -counting (i.e. I said "queues for writing" up there, which means some -bit of the a_page_head data has to be kept until its actually written). -Similarly for the page data. - -There are other tricks in this area that we can take advantage of -- -like interprocess communication on architectures that do page flipping. -On these boxes if you write() something that's page-aligned and page-sized -to a pipe or unix socket, and the other end read()s into a page-aligned -page-sized buffer then the kernel can get away without copying any data. -It just marks the two pages as shared copy-on-write, and only when -they're written to will the copy be made. So to make this work, your -writer uses a ring of 2+ page-aligned/sized buffers so that it's not -writing on something the reader is still reading. - -Dean - ----- - -For details on HPUX and avoiding extra data copies, see -. - -(note that if you get the postscript version instead, you have to -manually edit it to remove the front page before any version of -ghostscript that I have used will read it) - ----- - -I've been told by an engineer in Sun's TCP/IP group that zero-copy TCP -in Solaris 2.6 occurs when: - - - you've got the right interface card (OC-12 ATM card I think) - - you use write() - - your write buffer is 16k aligned and a multiple of 16k in size - -We currently get the 16k stuff for free by using mmap(). But sun's -current code isn't smart enough to deal with our initial writev() -of the headers and first part of the response. - ----- - -Systems that have a system call to efficiently send the contents of a -descriptor across the network. This is probably the single best way -to do static content on systems that support it. - -HPUX: (10.30 and on) - - ssize_t sendfile(int s, int fd, off_t offset, size_t nbytes, - const struct iovec *hdtrl, int flags); - - (allows you to add headers and trailers in the form of iovec - structs) Marc has a man page; ask if you want a copy. Not included - due to copyright issues. man page also available from - http://docs.hp.com/ (in particular, - http://docs.hp.com:80/dynaweb/hpux11/hpuxen1a/rvl3en1a/@Generic__BookTextView/59894;td=3 ) - -Windows NT: - - BOOL TransmitFile( SOCKET hSocket, - HANDLE hFile, - DWORD nNumberOfBytesToWrite, - DWORD nNumberOfBytesPerSend, - LPOVERLAPPED lpOverlapped, - LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers, - DWORD dwFlags - ); - - (does it start from the current position in the handle? I would - hope so, or else it is pretty dumb.) - - lpTransmitBuffers allows for headers and trailers. - - Documentation at: - - http://premium.microsoft.com/msdn/library/sdkdoc/wsapiref_3pwy.htm - http://premium.microsoft.com/msdn/library/conf/html/sa8ff.htm - - Even less related to page based IO: just context switching: - AcceptEx does an accept(), and returns the start of the - input data. see: - - http://premium.microsoft.com/msdn/library/sdkdoc/pdnds/sock2/wsapiref_17jm.htm - - What this means is you require one less syscall to do a - typical request, especially if you have a cache of handles - so you don't have to do an open or close. Hmm. Interesting - question: then, if TransmitFile starts from the current - position, you need a mutex around the seek and the - TransmitFile. If not, you are just limited (eg. byte - ranges) in what you can use it for. - - Also note that TransmitFile can specify TF_REUSE_SOCKET, so that - after use the same socket handle can be passed to AcceptEx. - Obviously only good where we don't have a persistent connection - to worry about. - ----- - -Note that all this is shot to bloody hell by HTTP-NG's multiplexing. -If fragment sizes are big enough, it could still be worthwhile to -do copy avoidence. It also causes performance issues because of -its credit system that limits how much you can write in a single -chunk. - -Don't tell me that if HTTP-NG becomes popular we will seen vendors -embedding SMUX (or whatever multiplexing is used) in the kernel to -get around this stuff. There we go, Apache with a loadable kernel -module. - ----- - -Larry McVoy's document for SGI regarding sendfile/TransmitFile: -ftp://ftp.bitmover.com/pub/splice.ps.gz diff --git a/buckets/doc_stacked_io.txt b/buckets/doc_stacked_io.txt deleted file mode 100644 index 9d2ac9ee84e..00000000000 --- a/buckets/doc_stacked_io.txt +++ /dev/null @@ -1,1312 +0,0 @@ -[djg: comments like this are from dean] - -This past summer, Alexei and I wrote a spec for an I/O Filters API... -this proposal addresses one part of that -- 'stacked' I/O with buff.c. - -We have a couple of options for stacked I/O: we can either use existing -code, such as sfio, or we can rewrite buff.c to do it. We've gone over -the first possibility at length, though, and there were problems with each -implemenation which was mentioned (licensing and compatibility, -specifically); so far as I know, those remain issues. - -Btw -- sfio will be supported w/in this model... it just wouldn't be the -basis for the model's implementation. - - -- Ed Korthof | Web Server Engineer -- - -- ed@organic.com | Organic Online, Inc -- - -- (415) 278-5676 | Fax: (415) 284-6891 -- - ---------------------------------------------------------------------------- -Stacked I/O With BUFFs - Sections: - - 1.) Overview - 2.) The API - User-supplied structures - API functions - 3.) Detailed Description - The bfilter structure - The bbottomfilter structure - The BUFF structure - Public functions in buff.c - 4.) Efficiency Considerations - Buffering - Memory copies - Function chaining - writev - 5.) Code in buff.c - Default Functions - Heuristics for writev - Writing - Reading - Flushing data - Closing stacks and filters - Flags and Options - -************************************************************************* - Overview - -The intention of this API is to make Apache's BUFF structure modular -while retaining high efficiency. Basically, it involves rewriting -buff.c to provide 'stacked' I/O -- where the data passed through a -series of 'filters', which may modify it. - -There are two parts to this, the core code for BUFF structures, and the -"filters" used to implement new behavior. "filter" is used to refer to -both the sets of 5 functions, as shown in the bfilter structure in the -next section, and to BUFFs which are created using a specific bfliter. -These will also be occasionally refered to as "user-supplied", though -the Apache core will need to use these as well for basic functions. - -The user-supplied functions should use only the public BUFF API, rather -than any internal details or functions. One thing which may not be -clear is that in the core BUFF functions, the BUFF pointer passed in -refers to the BUFF on which the operation will happen. OTOH, in the -user-supplied code, the BUFF passed in is the next buffer down the -chain, not the current one. - -************************************************************************* - The API - - User-supplied structures - -First, the bfilter structure is used in all filters: - typedef struct { - int (*writev)(BUFF *, void *, struct iovect *, int); - int (*read)(BUFF *, void *, char *, int); - int (*write)(BUFF *, void *, const char *, int); - int (*flush)(BUFF *, void *, const char *, int, bfilter *); - int (*transmitfile)(BUFF *, void *, file_info_ptr *); - void (*close)(BUFF *, void *); - } bfilter; - -bfilters are placed into a BUFF structure along with a -user-supplied void * pointer. - -Second, the following structure is for use with a filter which can -sit at the bottom of the stack: - - typedef struct { - void *(*bgetfileinfo)(BUFF *, void *); - void (*bpushfileinfo)(BUFF *, void *, void *); - } bbottomfilter; - - - BUFF API functions - -The following functions are new BUFF API functions: - -For filters: - -BUFF * bcreatestack(pool *p, int flags, struct bfilter *, - struct bbottomfilter *, void *); -BUFF * bpushfilter (BUFF *, struct bfilter *, void *); -BUFF * bpushbuffer (BUFF *, BUFF *); -BUFF * bpopfilter(BUFF *); -BUFF * bpopbuffer(BUFF *); -void bclosestack(BUFF *); - -For BUFFs in general: - -int btransmitfile(BUFF *, file_info_ptr *); -int bsetstackopts(BUFF *, int, const void *); -int bsetstackflags(BUFF *, int, int); - -Note that a new flag is needed for bsetstackflags: -B_MAXBUFFERING - -The current bcreate should become - -BUFF * bcreatebuffer (pool *p, int flags, struct bfilter *, void *); - -************************************************************************* - Detailed Explanation - - bfilter structure - -The void * pointer used in all these functions, as well as those in the -bbottomfilter structure and the filter API functions, is always the same -pointer w/in an individual BUFF. - -The first function in a bfilter structure is 'writev'; this is only -needed for high efficiency writing, generally at the level of the system -interface. In it's absence, multiple writes will be done w/ 'write'. -Note that defining 'writev' means you must define 'write'. - -The second is 'write'; this is the generic writing function, taking a BUFF -* to which to write, a block of text, and the length of that block of -text. The expected return is the number of characters (out of that block -of text) which were successfully processed (rather than the number of -characters actually written). - -The third is 'read'; this is the generic reading function, taking a BUFF * -from which to read data, and a void * buffer in which to put text, and the -number of characters to put in that buffer. The expected return is the -number of characters placed in the buffer. - -The fourth is 'flush'; this is intended to force the buffer to spit out -any data it may have been saving, as well as to clear any data the -BUFF code was storing. If the third argument is non-null, then it -contains more text to be printed; that text need not be null terminated, -but the fourth argument contains the length of text to be processed. The -expected return value should be the number of characters handled out -from the third argument (0 if there are none), or -1 on error. Finally, -the fifth argument is a pointer to the bfilter struct containing this -function, so that it may use the write or writev functions in it. Note -that general buffering is handled by BUFF's internal code, and module -writers should not store data for performance reasons. - -The fifth is 'transmitfile', which takes as its arguments a buffer to -which to write (if non-null), the void * pointer containing configuration -(or other) information for this filter, and a system-dependent pointer -(the file_info_ptr structure will be defined on a per-system basis) -containing information required to print the 'file' in question. -This is intended to allow zero-copy TCP in Win32. - -The sixth is 'close'; this is what is called when the connection is being -closed. The 'close' should not be passed on to the next filter in the -stack. Most filters will not need to use this, but if database handles -or some other object is created, this is the point at which to remove it. -Note that flush is called automatically before this. - - bbottomfilter Structure - -The first function, bgetfileinfo, is designed to allow Apache to get -information from a BUFF struct regarding the input and output sources. -This is currently used to get the input file number to select on a -socket to see if there's data waiting to be read. The information -returned is platform specific; the void * pointer passed in holds -the void * pointer passed to all user-supplied functions. - -The second function, bpushfileinfo, is used to push file information -onto a buffer, so that the buffer can be fully constructed and ready -to handle data as soon as possible after a client has connected. -The first void * pointer holds platform specific information (in -Unix, it would be a pair of file descriptors); the second holds the -void * pointer passed to all user-supplied functions. - -[djg: I don't think I really agree with the distinction here between -the bottom and the other filters. Take the select() example, it's -valid for any layer to define a fd that can be used for select... -in fact it's the topmost layer that should really get to make this -definition. Or maybe I just have your top and bottom flipped. In -any event I think this should be part of the filter structure and -not separate.] - - The BUFF structure - -A couple of changes are needed for this structure: remove fd and -fd_in; add a bfilter structure; add a pointer to a bbottomfilter; -add three pointers to the next BUFFs: one for the next BUFF in the -stack, one for the next BUFF which implements write, and one -for the next BUFF which implements read. - - - Public functions in buff.c - -BUFF * bpushfilter (BUFF *, struct bfilter *, void *); - -This function adds the filter functions from bfilter, stacking them on -top of the BUFF. It returns the new top BUFF, or NULL on error. - -BUFF * bpushbuffer (BUFF *, BUFF *); - -This function places the second buffer on the top of the stack that -the first one is on. It returns the new top BUFF, or NULL on error. - -BUFF * bpopfilter(BUFF *); -BUFF * bpopbuffer(BUFF *); - -Unattaches the top-most filter from the stack, and returns the new -top-level BUFF, or NULL on error or when there are no BUFFs -remaining. The two are synonymous. - -void bclosestack(BUFF *); - -Closes the I/O stack, removing all the filters in it. - -BUFF * bcreatestack(pool *p, int flags, struct bfilter *, - struct bbottomfilter *, void *); - -This creates an I/O stack. It returns NULL on error. - -BUFF * bcreatebuffer(pool *p, int flags, struct bfilter *, void *); - -This creates a BUFF for later use with bpushbuffer. The BUFF is -not set up to be used as an I/O stack, however. It returns NULL -on error. - -int bsetstackopts(BUFF *, int, const void *); -int bsetstackflags(BUFF *, int, int); - -These functions, respectively, set options on all the BUFFs in a -stack. The new flag, B_MAXBUFFERING is used to disable a feature -described in the next section, whereby only the first and last -BUFFs will buffer data. - -************************************************************************* - Efficiency Considerations - - Buffering - -All input and output is buffered by the standard buffering code. -People writing code to use buff.c should not concern themselves with -buffering for efficiency, and should not buffer except when necessary. - -The write function will typically be called with large blocks of text; -the read function will attempt to place the specified number of bytes -into the buffer. - -Dean noted that there are possible problems w/ multiple buffers; -further, some applications must not be buffered. This can be -partially dealt with by turning off buffering, or by flushing the -data when appropriate. - -However, some potential problems arise anyway. The simplest example -involves shrinking transformations; suppose that you have a set -of filters, A, B, and C, such that A outputs less text than it -recieves, as does B (say A strips comments, and B gzips the result). -Then after a write to A which fills the buffer, A writes to B. -However, A won't write enough to fill B's buffer, so a memory copy -will be needed. This continues till B's buffer fills up, then -B will write to C's buffer -- with the same effect. - -[djg: I don't think this is the issue I was really worried about -- -in the case of shrinking transformations you are already doing -non-trivial amounts of CPU activity with the data, and there's -no copying of data that you can eliminate anyway. I do recognize -that there are non-CPU intensive filters -- such as DMA-capable -hardware crypto cards. I don't think they're hard to support in -a zero-copy manner though.] - -The maximum additional number of bytes which will be copied in this -scenario is on the order of nk, where n is the total number of bytes, -and k is the number of filters doing shrinking transformations. - -There are several possible solutions to this issue. The first -is to turn off buffering in all but the first filter and the -last filter. This reduces the number of unnecessary byte copies -to at most one per byte, however it means that the functions in -the stack will get called more frequently; but it is the default -behavior, overridable by setting the B_MAXBUFFERING with -bsetstackflags. Most filters won't involve a net shrinking -transformation, so even this will rarely be an issue; however, -if the filters do involve a net shrinking transformation, for -the sake of network-efficiency (sending reasonably sized blocks), -it may be more efficient anyway. - -A second solution is more general use of writev for communication -between different buffers. This complicates the programing work, -however. - - - Memory copies - -Each write function is passed a pointer to constant text; if any changes -are being made to the text, it must be copied. However, if no changes -are made to the text (or to some smaller part of it), then it may be -sent to the next filter without any additional copying. This should -provide the minimal necessary memory copies. - -[djg: Unfortunately this makes it hard to support page-flipping and -async i/o because you don't have any reference counts on the data. -But I go into a little detail that already in docs/page_io.] - - Function chaining - -In order to avoid unnecessary function chaining for reads and writes, -when a filter is pushed onto the stack, the buff.c code will determine -which is the next BUFF which contains a read or write function, and -reads and writes, respectively, will go directly to that BUFF. - - writev - -writev is a function for efficient writing to the system; in terms of -this API, however, it also works for dealing with multiple blocks of -text without doing unnecessary byte copies. It is not required. - -Currently, the system level writev is used in two contexts: for -chunking and when a block of text is writen which, combined with -the text already in the buffer, would make the buffer overflow. - -writev would be implemented both by the default bottom level filter -and by the chunking filter for these operations. In addition, writev -may, be used, as noted above, to pass multiple blocks of text w/o -copying them into a single buffer. Note that if the next filter does -not implement writev, however, this will be equivalent to repeated -calls to write, which may or may not be more efficient. Up to -IOV_MAX-2 blocks of text may be passed along in this manner. Unlike -the system writev call, the writev in this API should be called only -once, with a array with iovec's and a count as to the number of -iovecs in it. - -If a bfilter defines writev, writev will be called whether or not -NO_WRITEV is set; hence, it should deal with that case in a reasonable -manner. - -[djg: We can't guarantee atomicity of writev() when we emulate it. -Probably not a problem, just an observation.] - -************************************************************************* - Code in buff.c - - Default Functions - -The default actions are generally those currently performed by Apache, -save that they they'll only attempt to write to a buffer, and they'll -return an error if there are no more buffers. That is, you must implement -read, write, and flush in the bottom-most filter. - -Except for close(), the default code will simply pass the function call -on to the next filter in the stack. Some samples follow. - - Heuristics for writev - -Currently, we call writev for chunking, and when we get a enough so that -the total overflows the buffer. Since chunking is going to become a -filter, the chunking filter will use writev; in addition, bwrite will -trigger bwritev as shown (note that system specific information should -be kept at the filter level): - -in bwrite: - - if (fb->outcnt > 0 && nbyte + fb->outcnt >= fb->bufsiz) { - /* build iovec structs */ - struct iovec vec[2]; - vec[0].iov_base = (void *) fb->outbase; - vec[0].iov_len = fb->outcnt; - fb->outcnt = 0; - vec[1].iov_base = (void *)buff; - vec[1].iov_length = nbyte; - return bwritev (fb, vec, 2); - } else if (nbye >= fb->bufsiz) { - return write_with_errors(fb,buff,nbyte); - } - -Note that the code above takes the place of large_write (as well -as taking code from it). - -So, bwritev would look something like this (copying and pasting freely -from the current source for writev_it_all, which could be replaced): - ------ -int bwritev (BUFF * fb, struct iovec * vec, int nvecs) { - if (!fb) - return -1; /* the bottom level filter implemented neither write nor - * writev. */ - if (fb->bfilter.bwritev) { - return bf->bfilter.writev(fb->next, vec, nvecs); - } else if (fb->bfilter.write) { - /* while it's nice an easy to build the vector and crud, it's painful - * to deal with partial writes (esp. w/ the vector) - */ - int i = 0,rv; - while (i < nvecs) { - do { - rv = fb->bfilter.write(fb, vec[i].iov_base, vec[i].iov_len); - } while (rv == -1 && (errno == EINTR || errno == EAGAIN) - && !(fb->flags & B_EOUT)); - if (rv == -1) { - if (errno != EINTR && errno != EAGAIN) { - doerror (fb, B_WR); - } - return -1; - } - fb->bytes_sent += rv; - /* recalculate vec to deal with partial writes */ - while (rv > 0) { - if (rv < vec[i].iov_len) { - vec[i].iov_base = (char *)vec[i].iov_base + rv; - vec[i].iov_len -= rv; - rv = 0; - if (vec[i].iov_len == 0) { - ++i; - } - } else { - rv -= vec[i].iov_len; - ++i; - } - } - if (fb->flags & B_EOUT) - return -1; - } - /* if we got here, we wrote it all */ - return 0; - } else { - return bwritev(fb->next,vec,nvecs); - } -} ------ -The default filter's writev function will pretty much like -writev_it_all. - - - Writing - -The general case for writing data is significantly simpler with this -model. Because special cases are not dealt with in the BUFF core, -a single internal interface to writing data is possible; I'm going -to assume it's reasonable to standardize on write_with_errors, but -some other function may be more appropriate. - -In the revised bwrite (which I'll ommit for brievity), the following -must be done: - check for error conditions - check to see if any buffering is done; if not, send the data - directly to the write_with_errors function - check to see if we should use writev or write_with_errors - as above - copy the data to the buffer (we know it fits since we didn't - need writev or write_with_errors) - -The other work the current bwrite is doing is - ifdef'ing around NO_WRITEV - numerous decisions regarding whether or not to send chunks - -Generally, buff.c has a number of functions whose entire purpose is -to handle particular special cases wrt chunking, all of which could -be simplified with a chunking filter. - -write_with_errors would not need to change; buff_write would. Here -is a new version of it: - ------ -/* the lowest level writing primitive */ -static ap_inline int buff_write(BUFF *fb, const void *buf, int nbyte) -{ - if (fb->bfilter.write) - return fb->bfilter.write(fb->next_writer,buff,nbyte); - else - return bwrite(fb->next_writer,buff,nbyte); -} ------ - -If the btransmitfile function is called on a buffer which doesn't implement -it, the system will attempt to read data from the file identified -by the file_info_ptr structure and use other methods to write to it. - - Reading - -One of the basic reading functions in Apache 1.3b3 is buff_read; -here is how it would look within this spec: - ------ -/* the lowest level reading primitive */ -static ap_inline int buff_read(BUFF *fb, void *buf, int nbyte) -{ - int rv; - - if (!fb) - return -1; /* the bottom level filter is not set up properly */ - - if (fb->bfilter.read) - return fb->bfilter.read(fb->next_reader,buf,nbyte,fb->bfilter_info); - else - return bread(fb->next_reader,buff,nbyte); -} ------ -The code currently in buff_read would become part of the default -filter. - - - Flushing data - -flush will get passed on down the stack automatically, with recursive -calls to bflush. The user-supplied flush function will be called then, -and also before close is called. The user-supplied flush should not -call flush on the next buffer. - -[djg: Poorly written "expanding" filters can cause some nastiness -here. In order to flush a layer you have to write out your current -buffer, and that may cause the layer below to overflow a buffer and -flush it. If the filter is expanding then it may have to add more to -the buffer before flushing it to the layer below. It's possible that -the layer below will end up having to flush twice. It's a case where -writev-like capabilities are useful.] - - Closing Stacks and Filters - -When a filter is removed from the stack, flush will be called then close -will be called. When the entire stack is being closed, this operation -will be done automatically on each filter within the stack; generally, -filters should not operate on other filters further down the stack, -except to pass data along when flush is called. - - Flags and Options - -Changes to flags and options using the current functions only affect -one buffer. To affect all the buffers on down the chain, use -bsetstackopts or bsetstackflags. - -bgetopt is currently only used to grab a count of the bytes sent; -it will continue to provide that functionality. bgetflags is -used to provide information on whether or not the connection is -still open; it'll continue to provide that functionality as well. - -The core BUFF operations will remain, though some operations which -are done via flags and options will be done by attaching appropriate -filters instead (eg. chunking). - -[djg: I'd like to consider filesystem metadata as well -- we only need -a few bits of metadata to do HTTP: file size and last modified. We -need an etag generation function, it is specific to the filters in -use. You see, I'm envisioning a bottom layer which pulls data out of -a database rather than reading from a file.] - - -************************************************************** -************************************************************** -Date: Wed, 9 Sep 1998 18:55:40 -0700 (PDT) -From: Alexei Kosut -To: new-httpd@apache.org -Subject: A Magic Cache example -Message-ID: - -During the drive home, I came up with a good example of how I envision the -new module/cache/layer model thingy working. Comments please: - -The middle end of the server is responsible for taking the request the -front end gives it and somehow telling the back end how to fulfill it. I -look at it like this: The request is a URI (Uniform Resource Identifier) -and a set of request dimensions (the request headers, the remote IP -address, the time of day, etc...). The middle end, via its configuration, -translates this into a request for content from a backing store module, -plus possibly some filter modules. Since the term "filename" is too -flat-file specific, let's call the parameter we pass to the backing store -a SRI (Specific Resource Identifier), in a format specific to that module. - -Our example is similar to the one I was using earlier, with some -additions: The request is for a URI, say "/skzb/teckla.html". The response -is a lookup from a (slow) database. The URI maps to the mod_database SRI -of "BOOK:0-441-7997-9" (I made that format up). We want to take that -output and convert it from whatever charset it's in into Unicode. We then -have a PHP script that works on a Unicode document and does things based -on whether the browser is Netscape or not. Then we translate the document -to the best charset that matches the characters used and the client's -capabilities and send it. - -So upon request for /skzb/teckla.html, the middle end translates the -request into the following "equation": - - SRI: mod_database("BOOK:0-441-7997-9") - + filter: mod_charset("Unicode") - + filter: mod_php() - + fllter: mod_charset("best_fit") - ------------------------------------------------- - URI: /skzb/teckla.html - -It then constructs a stack of IO (NSPR) filters like this: - -mod_database -> cache-write -> mod_charset -> cache-write -> mod_php -> -cache_write -> mod_charset -> cache-write -> client - -And sets it to running. Each of the cache filters is a write-through -filter that copies its data into the cache with a tag based on what -equation the middle end uses to get to it, plus the request dimensions it -uses (info it gets from the modules). - -The database access is stored under "SRI: mod_database(BOOK:0-441-79977-9" -with no dimensions (because it's the same for all requests). The first -charset manipulation is stored under "SRI: mod_database(BOOK...) + filter: -mod_charset(Unicode)", again with no dimensions. The PHP output is stored -under "SRI: mod_database(BOOK...) + filter: mod_charset(Unicode) + filter: -mod_php()" with dimesions of (User-Agent). The final output is stored both -as "SRI: mod_database(BOOK...) + filter: mod_charset(Unicode) + filter: -mod_php() + filter: mod_charset(best_fit)" and "URI: /skzb/teckla.html" -(they're the same thing), both with dimensions of (User-Agent, -Accept-Charset). - -So far so good. Now, when another request for /skzb/teckla.html comes in, -the cache is consulted to see how much we can use. First, the URI is -looked up. This can be done by a kernel or other streamlined part of the -server. So "URI: /skzb/teckla.html" is looked up, and one entry pops out -with dimensions of (User-Agent, Accept-Charset). The user-agent and -accept-charset of the request are compared against the ones of the stored -entiry(ies). If one matches, it can be sent directly. - -If not, the server proceeds to look up "SRI: mod_database(BOOK...) + -filter: mod_charset(Unicode) + filter: mod_php()". If the request has a -different accept-charset, but the same user-agent, then this can be -reprocessed by mod_charset and used. Otherwise, the server proceeds back -to "SRI: mod_database(BOOK...) + filter: mod_charset(Unicode)", which will -match any request. There's probably some sort of cache invalidation -(expires, etc...) that happens eventually to result in a new database -lookup, but mostly, that very costly operation is avoided. - -I think I've made it out to be a bit more complicated than it is, with the -long equation strings mixed in there. But the above reflects my -understanding of how the new Apache 2.0 system should work. - -Note 1: The cache is smarter than I make it out here when it comes to -adding new entries. It should realize that, since the translation to -Unicode doesn't change or restrict the dimensions of the request, it -really is pointless to cache the original database lookup, since it will -always be translated in exactly the same manner. Knowing this, it will -only cache the Unicode version. - -Note 2: PHP probably doesn't work with Unicode. And there may not be a way -to identify a script as only acting on the User-Agent dimension. That's -not the point. - -Note 3: Ten bonus points to anyone who's read this far, and is the first -person to answer today's trivia question: What does the skzb referred to -in the example URI stand for? There's enough information in this mail to -figure it out (with some help from the Net), even if you don't know -offhand (though if you do, I'd be happier). - --- Alexei Kosut - Stanford University, Class of 2001 * Apache * - - -************************************************************** -Message-ID: <19980922224326.A16219@aisa.fi.muni.cz> -Date: Tue, 22 Sep 1998 22:43:26 +0200 -From: Honza Pazdziora -To: new-httpd@apache.org -Subject: Re: I/O Layering in next version of Apache. -References: <19980922111627.19784.qmail@hyperreal.org> <3607D53A.1FF6D93@algroup.co.uk> <13831.55021.929560.977122@zap.ml.org> -In-Reply-To: <13831.55021.929560.977122@zap.ml.org>; from Ben Hyde on Tue, Sep 22, 1998 at 01:04:12PM -0400 - -> >Does anyone have a starting point for layered I/O? I know we kicked it - -Hello, - -there has been a thread on modperl mailing list recently about -problems we have with the current architecture. Some of the points -were: what requerements will be put on modules to be new I/O -compliant. I believe it's the Apache::SSI vs. Apache::SSIChain -difference between 1.3.* and 2.*. The first fetches the file _and_ -does the SSI, the second takes input from a different module that -either gets the HTML or runs the CGI or so, and processes its output. -Should all modules be capable of working on some other module's -output? Probably except those that actually go to disk or database for -the primary data. - -Randal's point was that output of any module could be processed, so -that no module should make any assumption whether it's sending data -directly to the browser or to some other module. This can be used both -for caching, but it also one of the things to get the filtering -transparent. - -Also, as Apache::GzipChain module shows, once you process the output, -you may need to modify the headers as well. I was hit by this when I -tried to convert between charsets, to send out those that the browsers -would understand. The Apache::Mason module shows that you can build -a page from pieces. Each of the pieces might have different -characteristics (charset, for example), so with each piece of code we -might need to have its own headers that describe it, or at least the -difference between the final (global) header-outs and its local. - -Sorry for bringing so much Perl module names in, but modperl is -currently a way to get some layered I/O done in 1.3.*, so I only have -practical experiance with it. - -Yours, - ------------------------------------------------------------------------- - Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/ - I can take or leave it if I please ------------------------------------------------------------------------- - -************************************************************** -Date: Wed, 23 Sep 1998 10:46:47 -0700 (PDT) -From: Dean Gaudet -To: new-httpd@apache.org -Subject: Re: I/O Layering in next version of Apache. -In-Reply-To: <36092F2D.BCC4E5C1@algroup.co.uk> -Message-ID: - -On Wed, 23 Sep 1998, Ben Laurie wrote: - -> Dean Gaudet wrote: -> > -> > On Wed, 23 Sep 1998, Ben Laurie wrote: -> > -> > > Is the simplest model that accomodates this actually just a stack -> > > (tree?) of webservers? Naturally, we wouldn't talk HTTP between the -> > > layers, but pass (header,content) pairs around (effectively). -> > > Interesting. -> > -> > We could just talk "compiled" HTTP -- using a parsed representation of -> > everything essentially. -> -> That's pretty much what I had in mind - but does it make sense? I have -> to admit, it makes a certain amount of sense to me, but I still have -> this nagging suspicion that there's a catch. - -We talked about this during the developers meeting earlier this summer... -while we were hiking, so I don't think there were any notes. - -I think it'd be a useful exercise to specify a few example applications we -want to be able to support, and then consider methods of implementing -those applications. Make the set as diverse and small as possible. I'll -take the easiest one :) - -- serve static content from arbitrary backing store (e.g. file, database) - -Once we flesh such a list out it may be easier to consider implementation -variations... - -I think it was Cliff who said it this way: in a multiple layer setup he -wants to be able to partition the layers across servers in an arbtrary -manner. For example, a proxy cache on one box which the world talks to, -and which backends to various other boxes for dynamic and static content. -Or maybe the static content is on the same server as the proxy. If this is -something we want to support then talking (a restricted form of) HTTP -between layers is interesting. - -Now we can all start worrying about performance ;) - -Dean - - -************************************************************** -Date: Wed, 23 Sep 1998 11:23:30 -0700 (PDT) -From: Alexei Kosut -To: new-httpd@apache.org -Subject: Re: I/O Layering in next version of Apache. -In-Reply-To: <36092F2D.BCC4E5C1@algroup.co.uk> -Message-ID: - -On Wed, 23 Sep 1998, Ben Laurie wrote: - -> > We could just talk "compiled" HTTP -- using a parsed representation of -> > everything essentially. -> -> That's pretty much what I had in mind - but does it make sense? I have -> to admit, it makes a certain amount of sense to me, but I still have -> this nagging suspicion that there's a catch. - -One important thing to note is that we want this server to be able to -handle non-HTTP requests. So using HTTP as the internal language (as we do -now) is not the way to go. What we talked about in SF was using a basic -set of key/value pairs to represent the metadata of the response. Which -would of course bear an uncanny resemblance to HTTP-style MIME headers... - -Certainly, and this is the point I think the originator of this thread -raised, each module layer (see the emails I sent a few weeks ago for more -details on how I see *that*) needs to provide both a content filter and a -metadata filter. Certainly a module that does encoding has to be able to -alter the headers to add a Content-Encoding, Transfer-Encoding, TE, or -what have you. Many module that does anything to the content will -want to add headers, and many others will need to alter the dimensions on -which the request is served, or what the parameters to those dimensions -are for the current request. The latter is absolutely vital for cacheing. - -The problem, as I see it, is this: Often, I suspect it will be the case -that the module does not know what metadata it will be altering (and how) -until after it has processed the request. i.e., a PHP script may not -discover what dimensions it uses (as we discussed earlier) until after it -has parsed the entire script. But if the module is functioning as an -in-place filter, that can cause massive headaches if we need the metadata -in a complete form *before* we sent the entity, as we do for HTTP. - -I'm not quite sure how to solve that problem. Anyone have any brilliant -ideas? - -(Note that for internal caching, we don't actually need the dimension data -until after the request, because we can alter the state of the cache at -any time, but if we want to place nice with HTTP and send Vary: headers -and such, we do need that information. I guess we could send Vary: -footers...) - --- Alexei Kosut - Stanford University, Class of 2001 * Apache * - - -************************************************************** -Date: 23 Sep 1998 20:26:58 -0000 -Message-ID: <19980923202658.25736.qmail@zap.ml.org> -From: Ben Hyde -To: new-httpd@apache.org -Subject: Stacking up Response Handling -In-Reply-To: -References: <36092F2D.BCC4E5C1@algroup.co.uk> - - -Alexei Kosut writes: ->The problem, as I see it, is this: Often, I suspect it will be the case ->that the module does not know what metadata it will be altering (and how) ->until after it has processed the request. i.e., a PHP script may not ->discover what dimensions it uses (as we discussed earlier) until after it ->has parsed the entire script. But if the module is functioning as an ->in-place filter, that can cause massive headaches if we need the metadata ->in a complete form *before* we sent the entity, as we do for HTTP. -> ->I'm not quite sure how to solve that problem. Anyone have any brilliant ->ideas? - -This is the same as building a layout engine that incremental layout -but simpler since I doubt we'd want to allow for reflow. - -Sometimes you can send output right along, sometimes you have to wait. -I visualize the output as a tree/outline and as it is swept out a -stack holds the path to the leave. Handlers for the individual nodes -wait or proceed depending on if they can. - -It's pretty design with the pipeline consisting of this stack of -output transformers/generators. Each pipeline stage accepts a stream -of output_chunks. I think of these output_chunks as coming in plenty -of flavors, for example transmit_file, transmit_memory, etc. Some -pipeline stages might handle very symbolic chunks. For example -transmit_xml_tree might be handed to transform_xml_to_html stage in -the pipeline. - -I'm assuming the core server would have only a few kinds of pipeline -nodes, generate_response, generate_content_from_url_via_file_system, -generate_via_classic_module_api. Things like convert_char_set or -do_cool_transfer_encoding, could easily be loaded at runtime and -authored outside the core. That would be nice. - -For typical fast responses we wouldn't push much on this stack at -all. It might go something like this: Push generate_response node, -it selects an appropriate content generator by consulting the -module community and pushes that. Often this is -generate_content_from_url_via_file_system which in turn does -all that ugly mapping to a file name and then passes -transmit_file down the pipeline and pops it's self off the stack. -generate_response once back on top again does the transmit and -pops off. - -For rich complex output generation we might push all kinds of things -(charset converters, transfer encoders, XML -> HTML rewriters, cache -builders, old style apache module API simulators, what ever). - -The intra-stack element protocol get's interesting around issues -like error handling, blocking, etc. - -I particularly like how this allows simulation of the old module API, -as well as the API of other servers, and experimenting with other -module API which cross process or machine boundaries. - -In many ways this isn't that much different from what was proposed -a year ago. - - - ben - -************************************************************** -From: Ben Hyde -Date: Wed, 23 Sep 1998 21:58:54 -0400 (EDT) -To: new-httpd@apache.org -Subject: Re: Core server caching -In-Reply-To: -References: <19980923210119.25763.qmail@zap.ml.org> - -Message-ID: <13833.39467.942203.885143@zap.ml.org> - -Alexei Kosut writes: ->On 23 Sep 1998, Ben Hyde wrote: -> ->> The core problem of caching seems to me to get confused by the ->> complexity of designing a caching proxy. If one ignores that then the ->> core problem of caching seems quite simple. -> ->Actually, for an HTTP server, they're the same problem, if you want to be ->able to cache any sort of dynamic request. And caching static requests is ->kind of silly (Dean's flow stuff notwithstanding, making copies of static ->files in either memory or on disk is silly, since the OS can do it better ->than we can). - -I don't disagree with any of the things you said, so I guess I'm -failing to get across where in this structure the functions your -pointing out as necessary would reside as versus where the "chunk -cache" mechanism I'm yearning for would fit. - -Well, that's not entirely true I do feel it's helpful to make this -point. - -The HTTP spec's definition of proper caching is terribly constrained -by the poverty of information available to the proxy server. He is -trapped in the middle between an opinionated content provider and an -opinionated content consumer. It was written in an attempt to keep -people like AOL from making their opinions dominate either of those -other two. Proper caching by a server that is right next to the -content generation can and ought to include both more or less -heuristics that are tunable by the opinions of the content provider -who presumably we are right next to. - -Imagine the server that has a loop that goes like so: - - loop - r<-swallow_incomming_request - h<-select_response_handler(r) - initialize_response_pipeline() - push_pipeline_element(h) - tend_pipeline_until_done() - end loop - -In most of the web based applications I've seen the -select_response_handler step evolves into something that looks like an -AI expert system. That said, what I'd like to see is in Apache2 is a -simple dispatch along with a way to plug-in more complex dispatching -mechanisms. I'd very much like to avoid having that get confused with -the suite of response_handlers. - -I ignored the complexity of when to you can safely select -a cached value because I think it's in the select_response_handler -step. And possibly, I'll admit, not part of what I called the -"core server" - -Clearly I'm a fool for using this term 'core server' since it -doesn't mean anything. I wanted it to mean that loop above -and the most minimal implementations for the pipeline and -the select_response_handler one could imagine before starting -to pile on. The server as shipped would have a lot more -stuff in it! - -What I'm focused on is what has to be in that core versus -what has to be, but can be outside of it. - -So. as i thought about the state of the pipeline just after -the call on initialize_response_pipeline I at first thought -it would have something much like the current buffer abstraction -in the pipeline. Then i got to wondering if transfer encoding, -charset conversion, or caching ought to be in there. - -I think there is an argument for putting some caching functionality -in there. Possibly because that entire knot is what you'd move -into the OS if you could. Possibly because this is the bit -that must fly. - -Recall that I think the pipeline takes a stream of response -chunks with things like memory_chunk, transfer_file_chunk, etc. -in that stream. The question is what flavors of chunks does -that bottom element in the pipeline take. It's the chunks -that fly (and nothing more?). So I got to thinking about -what does it mean to have a cached_chunk. - -A cached_chunk needs only the small operation set along -the lines of what I mentioned. A full caching scheme -can build on it. As an added benefit the caching scheme -can be dumb, standard, extremely witty without effecting -this portion of the design. - -A quick point about why I wanted the cache to handle things -smaller than entire responses. This isn't central I guess. - -I want a protocol with content generators that encourages -them to use dynamic programming tricks to quickly generate -portions of pages that are static over long periods. Such -a scheme has worked well in systems we've built. - - - ben hyde - -************************************************************** -From: Ben Hyde -Date: Thu, 29 Oct 1998 23:16:37 -0500 (EST) -To: new-httpd@apache.org -Subject: Re: Core server caching -In-Reply-To: -References: - -Message-ID: <13881.12903.661334.819447@zap.ml.org> - -Dean Gaudet writes: ->On Thu, 29 Oct 1998, Rasmus Lerdorf wrote: -> ->> There are also weird and wacky things you would be able to do if you could ->> stack mod_php on top of mod_perl. -> ->You people scare me. -> ->Isn't that redundant though? -> ->Dean - -Yes it's scary, but oddly erotic, when these behemoths with their -gigantic interpreters try to mate. - -It's interesting syndrome, systems as soon as they get an interpreter -they tend to loose their bearings and grow into vast behemoths that -lumber about slowly crushing little problems with their vast mass. -Turing syndrome? - -I've heard people say modules can help avoid this, but I've rarely -seen it. Olde Unix kinda manages it remember being frightened by -awk. - -Can we nudge alloc.c/buff.c toward a bit of connective glue that -continues to let individual modules evolve their own gigantism while -avoiding vile effects on the core performance of the server? Stuff -like this: - - memory chunk alignment for optimal I/O - memory hand off along the pipeline - memory hand off crossing pool boundaries - memory hand off in zero copy cases - transmit file - transmit cache elements - insert/remove cache elements - leverage unique hardware and instructions - -That memcpy in ap_bread really bugs me. - -I'd be rather have routines that let me handoff chunks. Presumably -these would need to be able to move chunks across pool and buffer -boundaries. But zero copy if I don't touch the content and never a -memcpy just to let my lex the input. - -I've built systems like this with the buffers exposing a emacs -buffer style of abstraction, but with special kinds of marks -to denote what's released for sending, and what's been accepted -and lex'd on the input side. It does create mean all your -lexical and printf stuff has to be able to smoothly slide -over chunk boundaries. - - - ben - -************************************************************************* -Date: Sun, 27 Dec 1998 13:08:22 -0800 (PST) -From: Ed Korthof -To: new-httpd@apache.org -Subject: I/O filters & reference counts -Message-ID: - -Hi -- - -A while back, I indicated I'd propose a way to do reference counts w/ the -layered I/O I want to implement for 2.0 (assuming we don't use nspr)... -for single-threaded Apache, this seems unnecessary (assuming you don't use -shared memory in your filters to share data amoung the processes), but in -other situations it does have advantages. - -Anyway, what I'd propose involves using a special syntax when you want to -use reference counts. This allows Apache to continue using the -'pool'-based memory system (it may not be perfect, but imo it's reasonably -good), without creating difficult when you wish to free memory. - -If you're creating memory which you'll want to share amoung multiple -threads, you'll create it using a function more or less like: - - ap_palloc_share(pool *p, size_t size); - -you get back a void * pointer for use as normal. When you want to give -someone else a reference to it, you do the following: - - ap_pshare_data(pool *p1, pool *p2, void * data); - -where data is the return from above (and it must be the same). Then both -pools have a reference to the data & to a counter; when each pool is -cleaned up, it will automatically decrement the counter, and free the data -if the counter is down to zero. - -In addition, a pool can decrement the counter with the following: - - ap_pshare_free(pool * p1, void * data); - -after which the data may be freed. There would also be a function, - - ap_pshare_countrefs(pool * p1, void * data); - -which would return the number of pools holding a ref to 'data', or 1 if -it's not a shared block. - -Internally, the pool might either keep a list of the shared blocks, or a -balanced b-tree; if those are too slow, I'd look into passing back and -forth a (pointer to an) int, and simply use an array. The filter -declaring the shared memory would need to keep track of such an int, but -no one else would. - -In the context of I/O filters, this would mean that each read function -returns a const char *, which should not be cast to a non-const char * (at -least, not without calling ap_pshare_countrefs()). If a filter screwed -this up, you'd have a problem -- but that's more or less unavoidable with -sharing data amoung threads using reference counts. - -It might make sense to build a more general reference counting system; if -that's what people want, I'm also up for working on that. But one of the -advantages the pool system has is its simplicity, some of which would be -lost. - -Anyway, how does this sound? Reasonable or absurd? - -Thanks -- - -Ed - ---------------------------------------- -History repeats itself, first as tragedy, second as farce. - Karl Marx - -************************************************************************* -From: Ben Hyde -Date: Tue, 29 Dec 1998 11:50:01 -0500 (EST) -To: new-httpd@apache.org -Subject: Re: I/O filters & reference counts -In-Reply-To: -References: - -Message-ID: <13960.60942.186393.799490@zap.ml.org> - - -There are two problems that reference counts address that we have, -but I still don't like them. - -These two are: pipeline memory management, and response paste up. A -good pipeline ought not _require_ memory proportional to the size of -the response but only proportional to the diameter of the pipe. -Response paste up is interesting because the library of clip art is -longer lived than the response or connection pool. There is a lot to -be said for leveraging the configuration pool life cycle for this kind -of thing. - -The pipeline design, and the handling of the memory it uses become -very entangled after a while - I can't think about one without the -other. This is the right place to look at this problem. I.e. this -is a problem to be lead by buff.c rework, not alloc.c rework. - -Many pipeline operations require tight coupling to primitive -operations that happen to be efficient. Neat instructions, memory -mapping, etc. Extreme efficiency in this pipeline makes it desirable -that the chunks in the pipeline be large. I like the phrase "chunks -and pumps" to summarize that there are two elements to design to get -modularity right here. - -The pasteup problem - one yearns for a library of fragments (call it a -cache, clip art, or templates if you like) which then readers in that -library can assemble these into responses. Some librarians like to -discard stale bits and they need a scheme to know that the readers -have all finished. The library resides in a pool that lives longer -than a single response connection. If the librarian can be convinced -that the server restart cycles are useful we get to a fall back to -there. - -I can't smell yet where the paste up problem belong in the 2.0 design -problem. (a) in the core, (b) in a module, (c) as a subpart of the -pipeline design, or (d) ostracized outside 2.0 to await a gift (XML?) -we then fold into Apache. I could probably argue any one of these. A -good coupling between this mechanism and the pipeline is good, limits -on the pipeline design space are very good. - - - ben - - -************************************************************************* -Date: Mon, 4 Jan 1999 18:26:36 -0800 (PST) -From: Ed Korthof -To: new-httpd@apache.org -Subject: Re: I/O filters & reference counts -In-Reply-To: <13960.60942.186393.799490@zap.ml.org> -Message-ID: - -On Tue, 29 Dec 1998, Ben Hyde wrote: - -> There are two problems that reference counts address that we have, -> but I still don't like them. - -They certainly add some clutter. But they offer a solution to the -problems listed below... and specifically to an issue which you brought up -a while back: avoiding a memcpy in each read layer which has a read -function other than the default one. Sometimes a memcpy is required, -sometimes not; with "reference counts", you can go either way. - -> These two are: pipeline memory management, and response paste up. A -> good pipeline ought not _require_ memory proportional to the size of -> the response but only proportional to the diameter of the pipe. -> Response paste up is interesting because the library of clip art is -> longer lived than the response or connection pool. There is a lot to -> be said for leveraging the configuration pool life cycle for this kind -> of thing. - -I was indeed assuming that we would use pools which would last from one -restart (and a run through of the configuration functions) to the next. - -So far as limiting the memory requirements of the pipeline -- this is -primarily a function of the module programming. Because the pipeline will -generally live in a single thread (with the possible exception of the data -source, which could be another processes), the thread will only be -operating on a single filter at a time (unless you added custom code to -create a new thread to handle one part of the pipeline -- ugg). - -For writing, the idea would be to print one or more blocks of text with -each call; wait for the write function to return; and then recycle the -buffers used. - -Reading has no writev equivalent, so you only be able to do it one block -at a time, but this seems alright to me (reading data is actually a much -less complicated procedure in practice -- at least, with the applications -which I've seen). - -Recycling read buffers (so as to limit the size of the memory pipeline) -is the hardest part, when we add in this 'reference count' scheme -- but -it can be done, if the modules recieving the data are polite and indicate -when they're done with the buffer. Ie.: - - module 1 module 2 -1.) reads from module 2: - char * ap_bread(BUFF *, pool *, int); - -2.) returns a block of text w/ ref counts: - str= char* ap_pshare_alloc(size_t); - ... - return str; - keeps a ref to str. - -3.) handles the block of data - returned, and indicates it's - finished with: - void ap_pshare_free(char * block); - reads more data via - char * ap_bread(BUFF *, pool *, int); - -4.) tries to recycle the buffer used: - if (ap_pshare_count_refs(str)==1) - reuse str - else - str = ap_pshare_alloc(...) - ... - return str; - -5.) handles the block of data - returned... -... - -One disadvantage is that if module 1 doesn't release its hold on a memory -block it got from step 2 until step 5, then the memory block wouldn't be -reused -- you'd pay w/ a free & a malloc (or with a significant increase -in complexity -- I'd probably choose the free & malloc). And if the module -failed to release the memory (via ap_pshare_free), then the memory -requirements would be as large as the response (or request). - -I believe this is only relevant for clients PUTting large files onto their -servers; but w/ files which are potentially many gigabytes, it is -important that filters handling reading do this correctly. Of course, -that's currently the situation anyhow. - -> The pipeline design, and the handling of the memory it uses become -> very entangled after a while - I can't think about one without the -> other. This is the right place to look at this problem. I.e. this -> is a problem to be lead by buff.c rework, not alloc.c rework. - -Yeah, after thinking about it a little bit I realized that no (or very -little) alloc.c work would be needed to implement the system which I -described. Basically, you'd have an Apache API function which does malloc -on its own, and other functions (also in the API) which register a cleanup -function (for the malloc'ed memory) in appropriate pools. - -IMO, the 'pipeline' is likely to be the easiest place to work with this, -at least in terms of getting the most efficient & clean design which we -can. - -[snip good comments] -> I can't smell yet where the paste up problem belong in the 2.0 design -> problem. (a) in the core, (b) in a module, (c) as a subpart of the -> pipeline design, or (d) ostracized outside 2.0 to await a gift (XML?) -> we then fold into Apache. I could probably argue any one of these. A -> good coupling between this mechanism and the pipeline is good, limits -> on the pipeline design space are very good. - -An overdesigned pipeline system (or an overly large one) would definitely -not be helpful. If it would be useful, I'm happy to work on this (even if -y'all aren't sure if you'd want to use it); if not, I'm sure I can find -things to do with my time. - -Anyway, I went to CPAN and got a copy of sfio... the latest version I -found is from Oct, 1997. I'd guess that using it (assuming this is -possible) might give us slightly less efficency (simply because sfio -wasn't built specifically for Apache, and customizing it is a much more -involved processes), but possibly fewer bugs to work out & lots of -interesting features. - -thanks -- - -Ed, slowly reading through the sfio source code - diff --git a/buckets/doc_wishes.txt b/buckets/doc_wishes.txt deleted file mode 100644 index c85d01ae045..00000000000 --- a/buckets/doc_wishes.txt +++ /dev/null @@ -1,269 +0,0 @@ -Wishes -- use cases for layered IO -================================== - -[Feel free to add your own] - -Dirk's original list: ---------------------- - - This file is there so that I do not have to remind myself - about the reasons for Layered IO, apart from the obvious one. - - 0. To get away from a 1 to 1 mapping - - i.e. a single URI can cause multiple backend requests, - in arbitrary configurations, such as in paralel, tunnel/piped, - or in some sort of funnel mode. Such multiple backend - requests, with fully layered IO can be treated exactly - like any URI request; and recursion is born :-) - - 1. To do on the fly charset conversion - - Be, theoretically, be able to send out your content using - latin1, latin2 or any other charset; generated from static - _and_ dynamic content in other charsets (typically unicode - encoded as UTF7 or UTF8). Such conversion is prompted by - things like the user-agent string, a cookie, or other hints - about the capabilities of the OS, language preferences and - other (in)capabilities of the final receipient. - - 2. To be able to do fancy templates - - Have your application/cgi sending out an XML structure of - field/value pair-ed contents; which is substituted into a - template by the web server; possibly based on information - accessible/known to the webserver which you do not want to - be known to the backend script. Ideally that template would - be just as easy to generate by a backend as well (see 0). - - 3. On the fly translation - - And other general text and output mungling, such as translating - an english page in spanish whilst it goes through your Proxy, - or JPEG-ing a GIF generated by mod_perl+gd. - - Dw. - - -Dean's canonical list of use cases ----------------------------------- - -Date: Mon, 27 Mar 2000 17:37:25 -0800 (PST) -From: Dean Gaudet -To: new-httpd@apache.org -Subject: canonical list of i/o layering use cases -Message-ID: - -i really hope this helps this discussion move forward. - -the following is the list of all applications i know of which have been -proposed to benefit from i/o layering. - -- data sink abstractions: - - memory destination (for ipc; for caching; or even for abstracting - things such as strings, which can be treated as an i/o - object) - - pipe/socket destination - - portability variations on the above - -- data source abstraction, such as: - - file source (includes proxy caching) - - memory source (includes most dynamic content generation) - - network source (TCP-to-TCP proxying) - - database source (which is probably, under the covers, something like - a memory source mapped from the db process on the same box, - or from a network source on another box) - - portability variations in the above sources - -- filters: - - encryption - - translation (ebcdic, unicode) - - compression - - chunking - - MUX - - mod_include et al - -and here are some of my thoughts on trying to further quantify filters: - -a filter separates two layers and is both a sink and a source. a -filter takes an input stream of bytes OOOO... and generates an -output stream of bytes which can be broken into blocks such -as: - - OOO NNN O NNNNN ... - - where O = an old or original byte copied from the input - and N = a new byte generated by the filter - -for each filter we can calculate a quantity i'll call the copied-content -ratio, or CCR: - - nbytes_old / nbytes_new - -where: - nbytes_old = number of bytes in the output of the - filter which are copied from the input - (in zero-copy this would mean "copy by - reference counting an input buffer") - nbytes_new = number of bytes which are generated - by the filter which weren't present in the - input - -examples: - -CCR = infinity: who cares -- straight through with no - transformation. the filter shouldn't even be there. - -CCR = 0: encryption, translation (ebcdic, unicode), compression. - these get zero benefit from zero-copy. - -CCR > 0: chunking, MUX, mod_include - -from the point of view of evaluating the benefit of zero-copy we only -care about filters with CCR > 0 -- because CCR = 0 cases degenerate into -a single-copy scheme anyhow. - -it is worth noting that the large_write heuristic in BUFF fairly -clearly handles zero-copy at very little overhead for CCRs larger than -DEFAULT_BUFSIZE. - -what needs further quantification is what the CCR of mod_include would -be. - -for a particular zero-copy implementation we can find some threshold k -where filters with CCRs >= k are faster with the zero-copy implementation -and CCRs < k are slower... faster/slower as compared to a baseline -implementation such as the existing BUFF. - -it's my opinion that when you consider the data sources listed above, and -the filters listed above that *in general* the existing BUFF heuristics -are faster than a complete zero-copy implementation. - -you might ask how does this jive with published research such as the -IO-Lite stuff? well, when it comes right down to it, the research in -the IO-Lite papers deal with very large CCRs and contrast them against -a naive buffering implementation such as stdio -- they don't consider -what a few heuristics such as apache's BUFF can do. - -Dean - - -Jim's summary of a discussion ------------------------------ - - OK, so the main points we wish to address are (in no particular order): - - 1. zero-copy - 2. prevent modules/filters from having to glob the entire - data stream in order to start processing/filtering - 3. the ability to layer and "multiplex" data and meta-data - in the stream - 4. the ability to perform all HTTP processing at the - filter level (including proxy), even if not implemented in - this phase - 5. Room for optimization and recursion - - Jim Jagielski - - -Roy's ramblings ---------------- - - Data flow networks are a very well-defined and understood software - architecture. They have a single, very important constraint: no filter - is allowed to know anything about the nature of its upstream or downstream - neighbors beyond what is defined by the filter's own interface. - That constraint is what makes data flow networks highly configurable and - reusable. Those are properties that we want from our filters. - - ... - - One of the goals of the filter concept was to fix the bird's nest of - interconnected side-effect conditions that allow buff to perform well - without losing the performance. That's why there is so much trepidation - about anyone messin with 1.3.x buff. - - ... - - Content filtering is my least important goal. Completely replacing HTTP - parsing with a filter is my primary goal, followed by a better proxy, - then internal memory caches, and finally zero-copy sendfile (in order of - importance, but in reverse order of likely implementation). Content - filtering is something we get for free using the bucket brigade interface, - but we don't get anything for free if we start with an interface that only - supports content filtering. - - ... - - I don't think it is safe to implement filters in Apache without either - a smart allocation system or a strict limiting mechanism that prevents - filters from buffering more than 8KB [or user-definable amount] of memory - at a time (for the entire non-flushed stream). It isn't possible to - create a robust server implementation using filters that allocate memory - from a pool (or the heap, or a stack, or whatever) without somehow - reclaiming and reusing the memory that gets written out to the network. - There is a certain level of "optimization" that must be present before - any filtering mechanism can be in Apache, and that means meeting the - requirement that the server not keel over and die the first time a user - requests a large filtered file. XML tree manipulation is an example - where that can happen. - - ... - - Disabling content-length just because there are filters in the stream - is a blatant cop-out. If you have to do that then the design is wrong. - At the very least the HTTP filter/buff should be capable of discovering - whether it knows the content length by examing whether it has the whole - response in buffer (or fd) before it sends out the headers. - - ... - - No layered-IO solution will work with the existing memory allocation - mechanisms of Apache. The reason is simply that some filters can - incrementally process data and some filters cannot, and they often - won't know the answer until they have processed the data they are given. - This means the buffering mechanism needs some form of overflow mechanism - that diverts parts of the stream into a slower-but-larger buffer (file), - and the only clean way to do that is to have the memory allocator for the - stream also do paging to disk. You can't do this within the request pool - because each layer may need to allocate more total memory than is available - on the machine, and you can't depend on some parts of the response being - written before later parts are generated because some filtering - decisions require knowledge of the end of the stream before they - can process the beginning. - - ... - - The purpose of the filtering mechanism is to provide a useful - and easy to understand means for extending the functionality of - independent modules (filters) by rearranging them in stacks - via a uniform interface. - - -Paul J. Reder's use cases for filters -------------------------------------- - - 1) Containing only text. - 2) Containing 10 .gif or .jpg references (perhaps filtering - from one format to the other). - 3) Containing an exec of a cgi that generates a text only file - 4) Containing an exec of a cgi that generates an SSI of a text only file. - 5) Containing an exec of a cgi that generates an SSI that execs a cgi - that generates a text only file (that swallows a fly, I don't know why). - 6) Containing an SSI that execs a cgi that generates an SSI that - includes a text only file. - NOTE: Solutions must be able to handle *both* 5 and 6. Order - shouldn't matter. - 7) Containing text that must be altered via a regular expression - filter to change all occurrences of "rederpj" to "misguided" - 8) Containing text that must be altered via a regular expression - filter to change all occurrences of "rederpj" to "lost" - 9) Containing perl or php that must be handed off for processing. - 10) A page in ascii that needs to be converted to ebcdic, or from - one code page to another. - 11) Use the babelfish translation filter to translate text on a - page from Spanish to Martian-Swahili. - 12) Translate to Esperanto, compress, and encrypt the output from - a php program generated by a perl script called from a cgi exec - embedded in a file included by an SSI :) - diff --git a/buckets/greg_patch.txt b/buckets/greg_patch.txt deleted file mode 100644 index 48eb739039b..00000000000 --- a/buckets/greg_patch.txt +++ /dev/null @@ -1,631 +0,0 @@ -Index: include/util_filter.h -=================================================================== -RCS file: /home/cvs/apache-2.0/src/include/util_filter.h,v -retrieving revision 1.3 -diff -u -r1.3 util_filter.h ---- include/util_filter.h 2000/08/05 04:38:57 1.3 -+++ include/util_filter.h 2000/08/05 09:48:20 -@@ -91,8 +91,40 @@ - * unterminated SSI directive). - */ - --/* forward declare the filter type */ -+/* -+ * BUCKETS -+ * -+ * Filtering uses a "bucket" metaphor for holding content to be processed. -+ * These buckets may contain arbitrary types of data. The selection of the -+ * type is dependent upon how the "upstream" filter/generator places content -+ * into the filter chain stream. -+ * -+ * For example, if a content generator uses ap_rwrite(), then the data will -+ * be placed into an AP_BUCKET_PTRLEN bucket. This bucket type contains a -+ * single pointer/length pair which will refer to the data. -+ * -+ * Buckets types are defined around the need to avoid copying the data if -+ * at all possible. Whatever the "natural" input form is for a piece of -+ * content, this is modelled within the bucket types. For example, when a -+ * content generator uses ap_rprintf() or a filter uses ap_fc_printf(), -+ * the format string and arguments are fed into/down the filter chain as -+ * just theat: a format string and its arguments. The filter mechanism avoids -+ * reducing the format/args to a final string for as long as possible. At -+ * some point, a filter or the output of the chain will combine these to -+ * produce actual bytes, but it is most optimal to defer this until it is -+ * truly needed. -+ * -+ * See the ap_bucket_type enumeration for the different bucket types which -+ * are currently defined. -+ * -+ * Buckets may also be linked into a list so that they may be passed as -+ * entire groups of content. The filter may insert/remove/replace the buckets -+ * within this list before passing the list to the next filter. -+ */ -+ -+/* forward declare some types */ - typedef struct ap_filter_t ap_filter_t; -+typedef struct ap_bucket_t ap_bucket_t; - - /* - * ap_filter_func: -@@ -114,7 +146,7 @@ - * next/prev to insert/remove/replace elements in the bucket list, but - * the types and values of the individual buckets should not be altered. - */ --typedef apr_status_t (*ap_filter_func)(); -+typedef void (*ap_filter_func)(ap_filter_t *filter, ap_bucket_t *bucket); - - /* - * ap_filter_type: -@@ -161,12 +193,155 @@ - */ - struct ap_filter_t { - ap_filter_func filter_func; -+ request_rec *r; - - void *ctx; - - ap_filter_type ftype; - ap_filter_t *next; - }; -+ -+/* -+ * ap_bucket_type: -+ * -+ * This enumeration is used to specify what type of bucket is present when -+ * an ap_bucket_t is provided. -+ * -+ * AP_BUCKET_PTRLEN: -+ * This bucket type defines a simple pointer/length pair for the content. -+ * The content is NOT necessarily null-terminated. -+ * -+ * This type occurs when ap_rwrite(), ap_fc_write(), ap_rputs(), -+ * ap_fc_puts(), ap_rputc(), or ap_fc_putc() is used by the upstream -+ * filter/generator. -+ * -+ * AP_BUCKET_STRINGS: -+ * This bucket type defines a set of null-terminated strings. The actual -+ * representation is through varargs' va_list type. A filter can sequence -+ * through the arguments using the va_arg() macro (and the "const char *" -+ * type). The filter should NOT use va_start() or va_end(). When va_arg() -+ * returns a NULL pointer, the list of strings is complete. -+ * -+ * Note that you can only sequence through the strings once, due to the -+ * definition of va_list. Thus, the first filter to do this sequencing -+ * must pass the resulting content to the next filter in a new form (the -+ * bucket cannot simply be passed because ->va is useless). -+ * -+ * This type occurs when ap_rvputs(), ap_fc_putstrs, or ap_fc_vputstrs() -+ * is used by the upstream filter/generator. -+ * -+ * AP_BUCKET_PRINTF: -+ * This bucket type defines a printf-style format and arguments. Similar -+ * to AP_BUCKET_STRINGS, this type also uses the ->va field to refer to -+ * the arguments. The format for the printf is stored in ->fmt. -+ * -+ * Also similar to AP_BUCKET_STRINGS, the va_start/va_end macros should -+ * not be used, and ->va should be processed only once. The bucket may -+ * not be passed after this processing. -+ * -+ * This type occurs when ap_rprintf(), ap_vrprintf(), ap_fc_printf(), or -+ * ap_fc_vprintf() is used by the upstream filter/generator. -+ * -+ * AP_BUCKET_FILE: -+ * This bucket type refers to an open file, from the current position -+ * and extending for ->flen bytes. Since there are some ap_file_t -+ * implementations/types that are not seekable, it may be impossible to -+ * "rewind" the file's current position after reading the contenxt. -+ * Therefore, it is important to note that once the content has been -+ * read, it must be passed to the next filter in a different form. -+ * -+ * Note: if there is a way to determine whether a file is seekable, then -+ * it would be legal to fetch the current position, read the contents, -+ * rewind to the original position, and then pass this bucket/file down -+ * to the next filter in the output chain. -+ * -+ * This type occurs when ap_send_fd(), ap_send_fd_length(), or -+ * ap_fc_sendfile() are used by the upstream filter/generator. -+ * -+ * AP_BUCKET_EOS: -+ * This bucket signals the end of the content stream. The filter should -+ * flush any internal state and issue errors if the state specifies that -+ * and end of stream cannot occur now (e.g. a command directive is -+ * incomplete). -+ * -+ * This type occurs when Apache finalizes a (sub)request, or when an -+ * upstream filter passes this bucket along. -+ */ -+typedef enum { -+ AP_BUCKET_PTRLEN, -+ AP_BUCKET_STRINGS, -+ AP_BUCKET_PRINTF, -+ AP_BUCKET_FILE, -+ AP_BUCKET_EOS -+} ap_bucket_type; -+ -+/* -+ * ap_bucket_t: -+ * -+ * The actual bucket definition. The type is determined by the ->type field. -+ * Which fields are valid/useful in the bucket is determined by the type, -+ * as noted below and in the comments above for each type. -+ * -+ * Buckets are arranged in a doubly-linked list so that a filter may insert, -+ * remove, or replace elements in a list of buckets. Generally, a filter -+ * should not change any bucket values other than these link pointers. -+ */ -+struct ap_bucket_t { -+ ap_bucket_type type; -+ -+ const char *buf; /* AP_BUCKET_PTRLEN */ -+ apr_size_t len; /* AP_BUCKET_PTRLEN */ -+ -+ const char *fmt; /* AP_BUCKET_PRINTF */ -+ va_list va; /* AP_BUCKET_STRINGS, _PRINTF */ -+ -+ apr_file_t *file; /* AP_BUCKET_FILE */ -+ apr_ssize_t flen; /* AP_BUCKET_FILE */ -+ -+ ap_bucket_t *next; /* next bucket in list */ -+ ap_bucket_t *prev; /* previous bucket in list */ -+}; -+ -+/* -+ * FILTER CHAIN OUTPUT FUNCTIONS -+ * -+ * These functions are used to deliver output/content down to the next -+ * filter in the chain. -+ * -+ * ap_fc_write(): write a block of bytes -+ * ap_fc_putc(): write a single character -+ * ap_fc_puts(): write a null-terminated string -+ * ap_fc_putstrs(): write a set of null-termianted strings; the end is -+ * signaled by a NULL parameter -+ * ap_fc_vputstrs(): same as ap_fc_putstrs(), but where the set of strings -+ * is defined by a va_list -+ * ap_fc_printf(): use printf-like semantics for writing a string -+ * ap_fc_vprintf(): use printf-like semantics, but with a va_list for the args -+ * ap_fc_sendfile(): send the file contents, from the current file position, -+ * and extending for "len" bytes; AP_FC_SENDFILE_ALL is -+ * used to send from current-position to the end-of-file. -+ * ap_fc_putbucket(): write a bucket into the filter chain -+ */ -+API_EXPORT(void) ap_fc_write(ap_filter_t *filter, const char *buf, -+ apr_size_t len); -+API_EXPORT(void) ap_fc_putc(ap_filter_t *filter, int c); -+API_EXPORT(void) ap_fc_puts(ap_filter_t *filter, const char *str); -+ -+API_EXPORT_NONSTD(void) ap_fc_putstrs(ap_filter_t *filter, ...); -+API_EXPORT(void) ap_fc_vputstrs(ap_filter_t *filter, va_list va); -+ -+API_EXPORT_NONSTD(void) ap_fc_printf(ap_filter_t *filter, -+ const char *fmt, ...); -+API_EXPORT(void) ap_fc_vprintf(ap_filter_t *filter, -+ const char *fmt, va_list va); -+ -+API_EXPORT(void) ap_fc_sendfile(ap_filter_t *filter, apr_file_t *file, -+ apr_ssize_t flen); -+#define AP_FC_SENDFILE_ALL ((apr_ssize_t) -1) -+ -+/* note: bucket->next and ->prev may be changed upon return from this */ -+API_EXPORT(void) ap_fc_putbucket(ap_filter_t *filter, ap_bucket_t *bucket); -+ - - /* - * ap_register_filter(): -Index: main/http_protocol.c -=================================================================== -RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v -retrieving revision 1.100 -diff -u -r1.100 http_protocol.c ---- main/http_protocol.c 2000/08/02 05:26:48 1.100 -+++ main/http_protocol.c 2000/08/05 09:48:23 -@@ -77,6 +77,7 @@ - * support code... */ - #include "util_date.h" /* For parseHTTPdate and BAD_DATE */ - #include "util_charset.h" -+#include "util_filter.h" - #include "mpm_status.h" - #ifdef APR_HAVE_STDARG_H - #include -@@ -100,7 +101,10 @@ - ap_bgetopt (r->connection->client, BO_BYTECT, &r->bytes_sent); \ - } while (0) - -+#define DECL_FILTER_HEAD(r, f) \ -+ ap_filter_t f = { NULL, (r), NULL, 0, (r)->filters } - -+ - /* if this is the first error, then log an INFO message and shut down the - * connection. - */ -@@ -407,6 +411,9 @@ - - API_EXPORT(int) ap_set_content_length(request_rec *r, long clength) - { -+ if (r->filters != NULL) -+ return 0; -+ - r->clength = clength; - apr_table_setn(r->headers_out, "Content-Length", apr_psprintf(r->pool, "%ld", clength)); - return 0; -@@ -1280,10 +1287,10 @@ - - static void end_output_stream(request_rec *r) - { -- /* -- ** ### place holder to tell filters that no more content will be -- ** ### arriving. typically, they will flush any pending content -- */ -+ DECL_FILTER_HEAD(r, filter); -+ ap_bucket_t bucket = { AP_BUCKET_EOS }; -+ -+ ap_fc_putbucket(&filter, &bucket); - } - - void ap_finalize_sub_req_protocol(request_rec *sub) -@@ -2501,107 +2508,88 @@ - - API_EXPORT(int) ap_rputc(int c, request_rec *r) - { -+ DECL_FILTER_HEAD(r, filter); -+ - if (r->connection->aborted) - return EOF; - -- if (ap_bputc(c, r->connection->client) < 0) { -- check_first_conn_error(r, "rputc", 0); -- return EOF; -- } -+ ap_fc_putc(&filter, c); -+ - SET_BYTES_SENT(r); -- return c; -+ return 1; - } - - API_EXPORT(int) ap_rputs(const char *str, request_rec *r) - { -- int rcode; -+ DECL_FILTER_HEAD(r, filter); - - if (r->connection->aborted) - return EOF; - -- rcode = ap_bputs(str, r->connection->client); -- if (rcode < 0) { -- check_first_conn_error(r, "rputs", 0); -- return EOF; -- } -+ ap_fc_puts(&filter, str); -+ - SET_BYTES_SENT(r); -- return rcode; -+ return 1; - } - - API_EXPORT(int) ap_rwrite(const void *buf, int nbyte, request_rec *r) - { -- apr_ssize_t n; -- apr_status_t rv; -+ DECL_FILTER_HEAD(r, filter); - - if (r->connection->aborted) - return EOF; - -- /* ### should loop to avoid partial writes */ -- rv = ap_bwrite(r->connection->client, buf, nbyte, &n); -- if (rv != APR_SUCCESS) { -- check_first_conn_error(r, "rwrite", rv); -- return EOF; -- } -+ ap_fc_write(&filter, buf, nbyte); -+ - SET_BYTES_SENT(r); -- return n; -+ return nbyte; - } - - API_EXPORT(int) ap_vrprintf(request_rec *r, const char *fmt, va_list va) - { -- int n; -+ DECL_FILTER_HEAD(r, filter); - - if (r->connection->aborted) - return EOF; - -- n = ap_vbprintf(r->connection->client, fmt, va); -+ ap_fc_vprintf(&filter, fmt, va); - -- if (n < 0) { -- check_first_conn_error(r, "vrprintf", 0); -- return EOF; -- } - SET_BYTES_SENT(r); -- return n; -+ return 1; - } - - API_EXPORT_NONSTD(int) ap_rprintf(request_rec *r, const char *fmt, ...) - { - va_list va; -- int n; - -+ DECL_FILTER_HEAD(r, filter); -+ - if (r->connection->aborted) - return EOF; - - va_start(va, fmt); -- n = ap_vbprintf(r->connection->client, fmt, va); -+ ap_fc_vprintf(&filter, fmt, va); - va_end(va); - -- if (n < 0) { -- check_first_conn_error(r, "rprintf", 0); -- return EOF; -- } - SET_BYTES_SENT(r); -- return n; -+ return 1; - } - - API_EXPORT_NONSTD(int) ap_rvputs(request_rec *r, ...) - { - va_list va; -- int n; -+ -+ DECL_FILTER_HEAD(r, filter); - - if (r->connection->aborted) - return EOF; - - va_start(va, r); -- n = ap_vbputstrs(r->connection->client, va); -+ ap_fc_vputstrs(&filter, va); - va_end(va); - -- if (n < 0) { -- check_first_conn_error(r, "rvputs", 0); -- return EOF; -- } -- - SET_BYTES_SENT(r); -- return n; -+ return 1; - } - - API_EXPORT(int) ap_rflush(request_rec *r) -@@ -2615,6 +2603,210 @@ - return 0; - } - -+static void BUFF_filter_callback(ap_filter_t *filter, ap_bucket_t *bucket) -+{ -+ ap_bucket_t *bscan = bucket; -+ -+ for (bscan = bucket; bscan != NULL; bscan = bscan->next) { -+ int n = 0; -+ -+ switch (bscan->type) { -+ case AP_BUCKET_PTRLEN: -+ if (bscan->len == 1) { -+ n = ap_bputc(*bscan->buf, filter->r->connection->client); -+ } -+ else { -+ apr_status_t rv; -+ apr_ssize_t written; -+ -+ /* ### should loop to ensure everything is written */ -+ rv = ap_bwrite(filter->r->connection->client, bscan->buf, -+ bscan->len, &written); -+ if (rv != APR_SUCCESS) { -+ check_first_conn_error(filter->r, "BUFF_filter_callback", -+ rv); -+ } -+ /* fallthru; n == 0 */ -+ } -+ break; -+ -+ case AP_BUCKET_STRINGS: -+ n = ap_vbputstrs(filter->r->connection->client, bscan->va); -+ break; -+ -+ case AP_BUCKET_PRINTF: -+ n = ap_vbprintf(filter->r->connection->client, bscan->fmt, -+ bscan->va); -+ break; -+ -+ case AP_BUCKET_FILE: -+ /* ### fill in file case */ -+ /* ### fallthru; n == 0 */ -+ break; -+ -+ case AP_BUCKET_EOS: -+ /* there is nothing to do here */ -+ /* fallthru; n == 0 */ -+ break; -+ -+ default: -+ /* ### set some kind of error */ -+ break; -+ } -+ -+ if (n < 0) -+ check_first_conn_error(filter->r, "BUFF_filter_callback", 0); -+ } -+} -+ -+API_EXPORT(void) ap_fc_write(ap_filter_t *filter, const char *buf, -+ apr_size_t len) -+{ -+ ap_filter_t *next; -+ ap_bucket_t bucket = { AP_BUCKET_PTRLEN, buf, len }; -+ -+ if (filter->r->connection->aborted || len == 0) -+ return; -+ -+ if ((next = filter->next) == NULL) { -+ /* ### until we really put it into place */ -+ BUFF_filter_callback(filter, &bucket); -+ } -+ else { -+ (*next->filter_func)(next, &bucket); -+ } -+} -+ -+API_EXPORT(void) ap_fc_putc(ap_filter_t *filter, int c) -+{ -+ ap_filter_t *next; -+ char c2 = (char)c; -+ ap_bucket_t bucket = { AP_BUCKET_PTRLEN, &c2, 1 }; -+ -+ if (filter->r->connection->aborted) -+ return; -+ -+ if ((next = filter->next) == NULL) { -+ /* ### until we really put it into place */ -+ BUFF_filter_callback(filter, &bucket); -+ } -+ else { -+ (*next->filter_func)(next, &bucket); -+ } -+} -+ -+API_EXPORT(void) ap_fc_puts(ap_filter_t *filter, const char *str) -+{ -+ ap_filter_t *next; -+ ap_bucket_t bucket = { AP_BUCKET_PTRLEN, str, strlen(str) }; -+ -+ if (filter->r->connection->aborted || *str == '\0') -+ return; -+ -+ if ((next = filter->next) == NULL) { -+ /* ### until we really put it into place */ -+ BUFF_filter_callback(filter, &bucket); -+ } -+ else { -+ (*next->filter_func)(next, &bucket); -+ } -+} -+ -+API_EXPORT_NONSTD(void) ap_fc_putstrs(ap_filter_t *filter, ...) -+{ -+ va_list va; -+ -+ if (filter->r->connection->aborted) -+ return; -+ -+ va_start(va, filter); -+ ap_fc_vputstrs(filter, va); -+ va_end(va); -+} -+ -+API_EXPORT(void) ap_fc_vputstrs(ap_filter_t *filter, va_list va) -+{ -+ ap_filter_t *next; -+ ap_bucket_t bucket = { AP_BUCKET_STRINGS, NULL, 0, NULL, va }; -+ -+ if (filter->r->connection->aborted) -+ return; -+ -+ if ((next = filter->next) == NULL) { -+ /* ### until we really put it into place */ -+ BUFF_filter_callback(filter, &bucket); -+ } -+ else { -+ (*next->filter_func)(next, &bucket); -+ } -+} -+ -+API_EXPORT_NONSTD(void) ap_fc_printf(ap_filter_t *filter, const char *fmt, ...) -+{ -+ va_list va; -+ -+ if (filter->r->connection->aborted) -+ return; -+ -+ va_start(va, fmt); -+ ap_fc_vprintf(filter, fmt, va); -+ va_end(va); -+} -+ -+API_EXPORT(void) ap_fc_vprintf(ap_filter_t *filter, -+ const char *fmt, va_list va) -+{ -+ ap_filter_t *next; -+ ap_bucket_t bucket = { AP_BUCKET_PRINTF, NULL, 0, fmt, va }; -+ -+ if (filter->r->connection->aborted) -+ return; -+ -+ if ((next = filter->next) == NULL) { -+ /* ### until we really put it into place */ -+ BUFF_filter_callback(filter, &bucket); -+ } -+ else { -+ (*next->filter_func)(next, &bucket); -+ } -+} -+ -+API_EXPORT(void) ap_fc_sendfile(ap_filter_t *filter, apr_file_t *file, -+ apr_ssize_t flen) -+{ -+ ap_filter_t *next; -+ ap_bucket_t bucket = { -+ AP_BUCKET_FILE, NULL, 0, NULL, NULL, file, flen -+ }; -+ -+ if (filter->r->connection->aborted || flen == 0) -+ return; -+ -+ if ((next = filter->next) == NULL) { -+ /* ### until we really put it into place */ -+ BUFF_filter_callback(filter, &bucket); -+ } -+ else { -+ (*next->filter_func)(next, &bucket); -+ } -+} -+ -+API_EXPORT(void) ap_fc_putbucket(ap_filter_t *filter, ap_bucket_t *bucket) -+{ -+ ap_filter_t *next; -+ -+ if (filter->r->connection->aborted) -+ return; -+ -+ if ((next = filter->next) == NULL) { -+ /* ### until we really put it into place */ -+ BUFF_filter_callback(filter, bucket); -+ } -+ else { -+ (*next->filter_func)(next, bucket); -+ } -+} -+ - /* We should have named this send_canned_response, since it is used for any - * response that can be generated by the server from the request record. - * This includes all 204 (no content), 3xx (redirect), 4xx (client error), -@@ -3003,6 +3195,7 @@ - ap_finalize_request_protocol(r); - ap_rflush(r); - } -+ - - AP_IMPLEMENT_HOOK_RUN_ALL(int,post_read_request, - (request_rec *r),(r),OK,DECLINED) -Index: main/util_filter.c -=================================================================== -RCS file: /home/cvs/apache-2.0/src/main/util_filter.c,v -retrieving revision 1.3 -diff -u -r1.3 util_filter.c ---- main/util_filter.c 2000/08/05 04:38:58 1.3 -+++ main/util_filter.c 2000/08/05 09:48:23 -@@ -126,6 +126,7 @@ - f->filter_func = frec->filter_func; - f->ctx = ctx; - f->ftype = frec->ftype; -+ f->r = r; - - if (INSERT_BEFORE(f, r->filters)) { - f->next = r->filters; diff --git a/buckets/ryan.patch b/buckets/ryan.patch deleted file mode 100644 index 6e41d0a913b..00000000000 --- a/buckets/ryan.patch +++ /dev/null @@ -1,651 +0,0 @@ -? build.log -? build.err -? src/build.log -? src/build.err -? src/lib/apr/buckets/Makefile.in -? src/lib/apr/include/apr_buf.h -Index: src/ap/Makefile.in -=================================================================== -RCS file: /home/cvs/apache-2.0/src/ap/Makefile.in,v -retrieving revision 1.4 -diff -u -d -b -w -u -r1.4 Makefile.in ---- src/ap/Makefile.in 2000/06/12 20:41:13 1.4 -+++ src/ap/Makefile.in 2000/08/05 05:01:14 -@@ -1,5 +1,5 @@ - - LTLIBRARY_NAME = libap.la --LTLIBRARY_SOURCES = ap_cache.c ap_base64.c ap_sha1.c ap_buf.c ap_hooks.c -+LTLIBRARY_SOURCES = ap_cache.c ap_base64.c ap_sha1.c ap_hooks.c - - include $(top_srcdir)/build/ltlib.mk -Index: src/include/ap_iol.h -=================================================================== -RCS file: /home/cvs/apache-2.0/src/include/ap_iol.h,v -retrieving revision 1.23 -diff -u -d -b -w -u -r1.23 ap_iol.h ---- src/include/ap_iol.h 2000/08/02 17:51:36 1.23 -+++ src/include/ap_iol.h 2000/08/05 05:01:14 -@@ -58,7 +58,9 @@ - #define AP_IOL_H - - #include "apr_general.h" /* For ap_s?size_t */ --#include "apr_errno.h" /* For apr_status_t and the APR_errnos */ -+#include "apr_network_io.h" /* For ap_hdtr_t */ -+#include "apr_errno.h" /* For ap_status_t and the APR_errnos */ -+#include "ap_config.h" /* For ap_status_t and the APR_errnos */ - - typedef struct ap_iol ap_iol; - typedef struct ap_iol_methods ap_iol_methods; -Index: src/include/http_protocol.h -=================================================================== -RCS file: /home/cvs/apache-2.0/src/include/http_protocol.h,v -retrieving revision 1.20 -diff -u -d -b -w -u -r1.20 http_protocol.h ---- src/include/http_protocol.h 2000/08/02 05:25:28 1.20 -+++ src/include/http_protocol.h 2000/08/05 05:01:14 -@@ -88,8 +88,19 @@ - */ - API_EXPORT(void) ap_basic_http_header(request_rec *r); - --/* Send the Status-Line and header fields for HTTP response */ -- -+/* Send the Status-Line and header fields for HTTP response. Two functions -+ * are needed here because we are doing two very different things. 1) We -+ * setup the response based on the header values. For example, se setup -+ * chunking based on the values in the headers. This is done in -+ * ap_send_http_header. A slightly incorrect name, but it is the name from -+ * 1.3, so this means modules don't need to change as much. 2) Actually -+ * send the headers over the wire. Currently this is done in -+ * ap_send_http_header_real. This should most likely be changed to just -+ * create a bucket that contains the headers. In this way, the headers are -+ * treated just like regular data, and we avoid BUFF all together. That however -+ * is an enhancement that can be made after the core filtering is in place. -+ */ -+API_EXPORT(void) ap_send_http_header_real(request_rec *l); - API_EXPORT(void) ap_send_http_header(request_rec *l); - - /* Send the response to special method requests */ -Index: src/include/httpd.h -=================================================================== -RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v -retrieving revision 1.69 -diff -u -d -b -w -u -r1.69 httpd.h ---- src/include/httpd.h 2000/08/04 17:40:02 1.69 -+++ src/include/httpd.h 2000/08/05 05:01:15 -@@ -589,6 +589,10 @@ - * pointer back to the main request. - */ - -+ int headers_sent; /* Have we sent the headers for this request -+ * yet. -+ */ -+ - /* Info about the request itself... we begin with stuff that only - * protocol.c should ever touch... - */ -Index: src/include/util_filter.h -=================================================================== -RCS file: /home/cvs/apache-2.0/src/include/util_filter.h,v -retrieving revision 1.3 -diff -u -d -b -w -u -r1.3 util_filter.h ---- src/include/util_filter.h 2000/08/05 04:38:57 1.3 -+++ src/include/util_filter.h 2000/08/05 05:01:15 -@@ -65,6 +65,7 @@ - - #include "httpd.h" - #include "apr.h" -+#include "apr_buf.h" - - /* - * FILTER CHAIN -@@ -114,7 +115,7 @@ - * next/prev to insert/remove/replace elements in the bucket list, but - * the types and values of the individual buckets should not be altered. - */ --typedef apr_status_t (*ap_filter_func)(); -+typedef apr_status_t (*ap_filter_func)(request_rec *r, ap_filter_t *f, ap_bucket_brigade *b); - - /* - * ap_filter_type: -@@ -168,6 +169,19 @@ - ap_filter_t *next; - }; - -+/* This function just passes the current bucket brigade down to the next -+ * filter on the filter stack. When a filter actually writes to the network -+ * (usually either core or SSL), that filter should return the number of bytes -+ * actually written and it will get propogated back up to the handler. If -+ * nobody writes the data to the network, then this function will most likely -+ * seg fault. I haven't come up with a good way to detect that case yet, and -+ * it should never happen. Regardless, it's an unrecoverable error for the -+ * current request. I would just rather it didn't take out the whole child -+ * process. -+ */ -+API_EXPORT(int) ap_pass_brigade(request_rec *r, ap_filter_t *filter, -+ ap_bucket_brigade *bucket); -+ - /* - * ap_register_filter(): - * -@@ -192,9 +206,28 @@ - * calls to ap_add_filter). If the current filter chain contains filters - * from another request, then this filter will be added before those other - * filters. -+ * -+ * To re-iterate that last comment. This function is building a FIFO -+ * list of filters. Take note of that when adding your filter to the chain. - */ - API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r); - -+/* The next two filters are for abstraction purposes only. They could be -+ * done away with, but that would require that we break modules if we ever -+ * want to change our filter registration method. The basic idea, is that -+ * all filters have a place to store data, the ctx pointer. These functions -+ * fill out that pointer with a bucket brigade, and retrieve that data on -+ * the next call. The nice thing about these functions, is that they -+ * automatically concatenate the bucket brigades together for you. This means -+ * that if you have already stored a brigade in the filters ctx pointer, then -+ * when you add more it will be tacked onto the end of that brigade. When -+ * you retrieve data, if you pass in a bucket brigade to the get function, -+ * it will append the current brigade onto the one that you are retrieving. -+ */ -+API_EXPORT(ap_bucket_brigade *) ap_get_saved_data(request_rec *r, -+ ap_filter_t *f, ap_bucket_brigade **b); -+API_EXPORT(void) ap_save_data_to_filter(request_rec *r, ap_filter_t *f, -+ ap_bucket_brigade **b); - - /* - * Things to do later: -@@ -206,12 +239,6 @@ - * bucket_brigade, but I am trying to keep this patch neutral. (If this - * comment breaks that, well sorry, but the information must be there - * somewhere. :-) -- * -- * Add a function like ap_pass_data. This function will basically just -- * call the next filter in the chain, until the current filter is NULL. If the -- * current filter is NULL, that means that nobody wrote to the network, and -- * we have a HUGE bug, so we need to return an error and log it to the -- * log file. - */ - #ifdef __cplusplus - } -Index: src/lib/apr/configure.in -=================================================================== -RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v -retrieving revision 1.143 -diff -u -d -b -w -u -r1.143 configure.in ---- src/lib/apr/configure.in 2000/08/02 05:51:39 1.143 -+++ src/lib/apr/configure.in 2000/08/05 05:01:15 -@@ -688,8 +688,8 @@ - AC_SUBST(EXEEXT) - - echo "Construct Makefiles and header files." --MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile" --SUBDIRS="lib strings passwd tables " -+MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile buckets/Makefile" -+SUBDIRS="lib strings passwd tables buckets " - for dir in $MODULES - do - test -d $dir || $MKDIR -p $dir -Index: src/main/http_core.c -=================================================================== -RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v -retrieving revision 1.94 -diff -u -d -b -w -u -r1.94 http_core.c ---- src/main/http_core.c 2000/08/02 05:26:47 1.94 -+++ src/main/http_core.c 2000/08/05 05:01:22 -@@ -72,6 +72,8 @@ - #include "util_md5.h" - #include "apr_fnmatch.h" - #include "http_connection.h" -+#include "apr_buf.h" -+#include "util_filter.h" - #include "util_ebcdic.h" - #include "mpm.h" - #ifdef HAVE_NETDB_H -@@ -87,6 +89,10 @@ - #include - #endif - -+/* Make sure we don't write less than 4096 bytes at any one time. -+ */ -+#define MIN_SIZE_TO_WRITE 4096 -+ - /* Allow Apache to use ap_mmap */ - #ifdef USE_MMAP_FILES - #include "apr_mmap.h" -@@ -2880,6 +2886,52 @@ - return OK; - } - -+/* Default filter. This filter should almost always be used. It's only job -+ * is to send the headers if they haven't already been sent, and then send -+ * the actual data. To send the data, we create an iovec out of the bucket -+ * brigade and then call the iol's writev function. On platforms that don't -+ * have writev, we have the problem of creating a lot of potentially small -+ * packets that we are sending to the network. -+ * -+ * This can be solved later by making the buckets buffer everything into a -+ * single memory block that can be written using write (on those systems -+ * without writev only !) -+ */ -+static int core_filter(request_rec *r, ap_filter_t *f, ap_bucket_brigade *b) -+{ -+ ap_bucket *dptr = b->head; -+ apr_ssize_t bytes_sent; -+ int len = 0; -+ -+ if (!r->headers_sent) { -+ ap_send_http_header_real(r); -+ ap_bflush(r->connection->client); -+ r->headers_sent = 1; -+ } -+ -+ /* At this point we need to discover if there was any data saved from -+ * the last call to core_filter. -+ */ -+ b = ap_get_saved_data(r, f, &b); -+ -+ /* It is very obvious that we need to make sure it makes sense to send data -+ * out at this point. -+ */ -+ dptr = b->head; -+ while (dptr) { -+ len += ap_get_bucket_len(dptr); -+ dptr = dptr->next; -+ } -+ if (len < MIN_SIZE_TO_WRITE && b->tail->color != AP_BUCKET_eos) { -+ ap_save_data_to_filter(r, f, &b); -+ return 0; -+ } -+ else { -+ ap_brigade_to_iol(&bytes_sent, b, r->connection->client->iol); -+ return bytes_sent; -+ } -+} -+ - static const handler_rec core_handlers[] = { - { "*/*", default_handler }, - { "default-handler", default_handler }, -@@ -2902,6 +2954,11 @@ - static unsigned short core_port(const request_rec *r) - { return DEFAULT_HTTP_PORT; } - -+static void core_register_filter(request_rec *r) -+{ -+ ap_add_filter("CORE", NULL, r); -+} -+ - static void register_hooks(void) - { - ap_hook_post_config(core_post_config,NULL,NULL,AP_HOOK_REALLY_FIRST); -@@ -2914,6 +2971,14 @@ - /* FIXME: I suspect we can eliminate the need for these - Ben */ - ap_hook_type_checker(do_nothing,NULL,NULL,AP_HOOK_REALLY_LAST); - ap_hook_access_checker(do_nothing,NULL,NULL,AP_HOOK_REALLY_LAST); -+ -+ /* This is kind of odd, and it would be cool to clean it up a bit. -+ * The first function just registers the core's register_filter hook. -+ * The other associates a global name with the filter defined -+ * by the core module. -+ */ -+ ap_hook_insert_filter(core_register_filter, NULL, NULL, AP_HOOK_MIDDLE); -+ ap_register_filter("CORE", core_filter, AP_FTYPE_CONNECTION); - } - - API_VAR_EXPORT module core_module = { -Index: src/main/http_protocol.c -=================================================================== -RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v -retrieving revision 1.100 -diff -u -d -b -w -u -r1.100 http_protocol.c ---- src/main/http_protocol.c 2000/08/02 05:26:48 1.100 -+++ src/main/http_protocol.c 2000/08/05 05:01:22 -@@ -64,6 +64,8 @@ - */ - - #define CORE_PRIVATE -+#include "apr_buf.h" -+#include "util_filter.h" - #include "ap_config.h" - #include "apr_strings.h" - #include "httpd.h" -@@ -1824,8 +1826,12 @@ - apr_rfc822_date(date, r->request_time); - apr_table_addn(r->headers_out, "Expires", date); - } -+} - -- /* Send the entire apr_table_t of header fields, terminated by an empty line. */ -+API_EXPORT(void) ap_send_http_header_real(request_rec *r) -+{ -+ const long int zero = 0L; -+ /* Send the entire ap_table_t of header fields, terminated by an empty line. */ - - apr_table_do((int (*) (void *, const char *, const char *)) ap_send_header_field, - (void *) r, r->headers_out, NULL); -@@ -2468,101 +2474,84 @@ - API_EXPORT(size_t) ap_send_mmap(apr_mmap_t *mm, request_rec *r, size_t offset, - size_t length) - { -- size_t total_bytes_sent = 0; -- int n; -- apr_ssize_t w; -- char *addr; -- -- if (length == 0) -- return 0; -- -- -- length += offset; -- while (!r->connection->aborted && offset < length) { -- if (length - offset > MMAP_SEGMENT_SIZE) { -- n = MMAP_SEGMENT_SIZE; -- } -- else { -- n = length - offset; -- } -+ size_t bytes_sent = 0; -+ ap_bucket_brigade *bb = NULL; - -- apr_mmap_offset((void**)&addr, mm, offset); -- w = ap_rwrite(addr, n, r); -- if (w < 0) -- break; -- total_bytes_sent += w; -- offset += w; -- } -+ /* WE probably need to do something to make sure we are respecting the -+ * offset and length. I think I know how to do this, but I will wait -+ * until after the commit to actually write the code. -+ */ -+ bb = ap_brigade_create(r->pool); -+ ap_brigade_append_buckets(bb, -+ ap_bucket_mmap_create(mm, mm->size, &bytes_sent)); -+ bytes_sent = ap_pass_brigade(r, NULL, bb); - -- SET_BYTES_SENT(r); -- return total_bytes_sent; -+ return bytes_sent; - } - #endif /* USE_MMAP_FILES */ - - API_EXPORT(int) ap_rputc(int c, request_rec *r) - { -+ ap_bucket_brigade *bb = NULL; -+ apr_ssize_t written; -+ - if (r->connection->aborted) - return EOF; - -- if (ap_bputc(c, r->connection->client) < 0) { -- check_first_conn_error(r, "rputc", 0); -- return EOF; -- } -- SET_BYTES_SENT(r); -+ bb = ap_brigade_create(r->pool); -+ ap_brigade_append_buckets(bb, ap_bucket_rwmem_create(&c, 1, &written)); -+ ap_pass_brigade(r, NULL, bb); -+ - return c; - } - - API_EXPORT(int) ap_rputs(const char *str, request_rec *r) - { -- int rcode; -+ ap_bucket_brigade *bb = NULL; -+ apr_ssize_t written; - - if (r->connection->aborted) - return EOF; - -- rcode = ap_bputs(str, r->connection->client); -- if (rcode < 0) { -- check_first_conn_error(r, "rputs", 0); -- return EOF; -- } -- SET_BYTES_SENT(r); -- return rcode; -+ bb = ap_brigade_create(r->pool); -+ ap_brigade_append_buckets(bb, -+ ap_bucket_rwmem_create(str, strlen(str), &written)); -+ ap_pass_brigade(r, NULL, bb); -+ -+ return written; - } - - API_EXPORT(int) ap_rwrite(const void *buf, int nbyte, request_rec *r) - { -- apr_ssize_t n; -- apr_status_t rv; -+ ap_bucket_brigade *bb = NULL; -+ apr_ssize_t written; - - if (r->connection->aborted) - return EOF; - -- /* ### should loop to avoid partial writes */ -- rv = ap_bwrite(r->connection->client, buf, nbyte, &n); -- if (rv != APR_SUCCESS) { -- check_first_conn_error(r, "rwrite", rv); -- return EOF; -- } -- SET_BYTES_SENT(r); -- return n; -+ bb = ap_brigade_create(r->pool); -+ ap_brigade_append_buckets(bb, ap_bucket_rwmem_create(buf, nbyte, &written)); -+ ap_pass_brigade(r, NULL, bb); -+ return written; - } - - API_EXPORT(int) ap_vrprintf(request_rec *r, const char *fmt, va_list va) - { -- int n; -+ ap_bucket_brigade *bb = NULL; -+ apr_ssize_t written; - - if (r->connection->aborted) - return EOF; - -- n = ap_vbprintf(r->connection->client, fmt, va); -- -- if (n < 0) { -- check_first_conn_error(r, "vrprintf", 0); -- return EOF; -- } -- SET_BYTES_SENT(r); -- return n; -+ bb = ap_brigade_create(r->pool); -+ written = ap_brigade_vprintf(bb, fmt, va); -+ ap_pass_brigade(r, NULL, bb); -+ return written; - } - -+/* TODO: Make ap pa_bucket_vprintf that printfs directly into a -+ * bucket. -+ */ - API_EXPORT_NONSTD(int) ap_rprintf(request_rec *r, const char *fmt, ...) - { - va_list va; -@@ -2572,46 +2561,35 @@ - return EOF; - - va_start(va, fmt); -- n = ap_vbprintf(r->connection->client, fmt, va); -+ n = ap_vrprintf(r, fmt, va); - va_end(va); - -- if (n < 0) { -- check_first_conn_error(r, "rprintf", 0); -- return EOF; -- } -- SET_BYTES_SENT(r); - return n; - } - - API_EXPORT_NONSTD(int) ap_rvputs(request_rec *r, ...) - { -+ ap_bucket_brigade *bb = NULL; -+ apr_ssize_t written; - va_list va; -- int n; - - if (r->connection->aborted) - return EOF; -- -+ bb = ap_brigade_create(r->pool); - va_start(va, r); -- n = ap_vbputstrs(r->connection->client, va); -+ written = ap_brigade_vputstrs(bb, va); - va_end(va); -- -- if (n < 0) { -- check_first_conn_error(r, "rvputs", 0); -- return EOF; -- } -- -- SET_BYTES_SENT(r); -- return n; -+ ap_pass_brigade(r, NULL, bb); -+ return written; - } - - API_EXPORT(int) ap_rflush(request_rec *r) - { -- apr_status_t rv; -+ ap_bucket_brigade *bb; - -- if ((rv = ap_bflush(r->connection->client)) != APR_SUCCESS) { -- check_first_conn_error(r, "rflush", rv); -- return EOF; -- } -+ bb = ap_brigade_create(r->pool); -+ ap_brigade_append_buckets(bb, ap_bucket_eos_create()); -+ ap_pass_brigade(r, NULL, bb); - return 0; - } - -Index: src/main/http_request.c -=================================================================== -RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v -retrieving revision 1.38 -diff -u -d -b -w -u -r1.38 http_request.c ---- src/main/http_request.c 2000/08/02 05:26:48 1.38 -+++ src/main/http_request.c 2000/08/05 05:01:22 -@@ -1276,6 +1276,12 @@ - return; - } - -+ /* We need to flush the data out at this point. We probably only want to -+ * do this on the main request, but this is fine for an initial patch. -+ * Once we look into this more, we won't flush sub-requests. -+ */ -+ ap_rflush(r); -+ - /* Take care of little things that need to happen when we're done */ - ap_finalize_request_protocol(r); - } -Index: src/main/util_filter.c -=================================================================== -RCS file: /home/cvs/apache-2.0/src/main/util_filter.c,v -retrieving revision 1.3 -diff -u -d -b -w -u -r1.3 util_filter.c ---- src/main/util_filter.c 2000/08/05 04:38:58 1.3 -+++ src/main/util_filter.c 2000/08/05 05:01:22 -@@ -52,6 +52,7 @@ - * . - */ - -+#include "httpd.h" - #include "util_filter.h" - - /* -@@ -73,7 +74,7 @@ - } ap_filter_rec_t; - - /* ### make this visible for direct manipulation? -- ### use a hash table -+ * ### use a hash table - */ - static ap_filter_rec_t *registered_filters = NULL; - -@@ -144,3 +145,63 @@ - } - } - -+/* Pass the buckets to the next filter in the filter stack. If the -+ * current filter is a handler, we should get NULL passed in instead of -+ * the current filter. At that point, we can just call the first filter in -+ * the stack, or r->filters. -+ */ -+API_EXPORT(int) ap_pass_brigade(request_rec *r, ap_filter_t *filter, -+ ap_bucket_brigade *bb) -+{ -+ if (filter) { -+ return (*filter->next->filter_func)(r, filter->next, bb); -+ } -+ else { -+ return (*r->filters->filter_func)(r, r->filters, bb); -+ } -+} -+ -+API_EXPORT(ap_bucket_brigade *) ap_get_saved_data(request_rec *r, -+ ap_filter_t *f, ap_bucket_brigade **b) -+{ -+ ap_bucket_brigade *bb = (ap_bucket_brigade *)f->ctx; -+ -+ /* If we have never stored any data in the filter, then we had better -+ * create an empty bucket brigade so that we can concat. -+ */ -+ if (!bb) { -+ bb = ap_brigade_create(r->pool); -+ } -+ -+ /* join the two brigades together. *b is now empty so we can -+ * safely destroy it. -+ */ -+ ap_brigade_catenate(bb, *b); -+ ap_brigade_destroy(*b); -+ /* clear out the filter's context pointer. If we don't do this, then -+ * when we save more data to the filter, we will be appended to what is -+ * currently there. This will mean repeating data.... BAD! :-) -+ */ -+ f->ctx = NULL; -+ -+ return bb; -+} -+ -+API_EXPORT(void) ap_save_data_to_filter(request_rec *r, ap_filter_t *f, -+ ap_bucket_brigade **b) -+{ -+ ap_bucket_brigade *bb = (ap_bucket_brigade *)f->ctx; -+ -+ /* If have never stored any data in the filter, then we had better -+ * create an empty bucket brigade so that we can concat. -+ */ -+ if (!bb) { -+ bb = ap_brigade_create(r->pool); -+ } -+ -+ /* Apend b to bb. This means b is now empty, and we can destory it safely. -+ */ -+ ap_brigade_catenate(bb, *b); -+ ap_brigade_destroy(*b); -+ f->ctx = bb; -+} -Index: src/os/unix/os.h -=================================================================== -RCS file: /home/cvs/apache-2.0/src/os/unix/os.h,v -retrieving revision 1.10 -diff -u -d -b -w -u -r1.10 os.h ---- src/os/unix/os.h 2000/05/15 23:02:57 1.10 -+++ src/os/unix/os.h 2000/08/05 05:01:25 -@@ -59,8 +59,6 @@ - #ifndef APACHE_OS_H - #define APACHE_OS_H - --#include "ap_config.h" -- - #ifndef PLATFORM - #define PLATFORM "Unix" - #endif From bc17f94f915a3750f16159c84a0c0f9bb7d5f661 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 14 Aug 2000 04:32:01 +0000 Subject: [PATCH 0523/7878] Fix a minor bug in the default template file. The template used to not escape the spaces in file names. It does now. This also adds the default template for Apache to use. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60499 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/default.pl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/helpers/default.pl b/helpers/default.pl index cdacd8d4613..6a45159c400 100644 --- a/helpers/default.pl +++ b/helpers/default.pl @@ -65,15 +65,21 @@ ## For each package, generate an index entry. foreach $p (packages()) { - >>$(p.name)
    + $_ = $p->url; + s/\s/%20/g; + >>$(p.name)
    << foreach $e ($p->classes()) { - >>
  • $(e.fullname) + $_ = $e->url; + s/\s/%20/g; + >>
  • $(e.fullname) << } foreach $e ($p->globals()) { - >>
  • $(e.fullname) + $_ = $e->url; + s/\s/%20/g; + >>
  • $(e.fullname) << } >>
  • << @@ -108,7 +114,9 @@ ## For each package, generate an index entry. foreach $p (packages()) { - >>$(p.name)
    + $_ = $p->url; + s/\s/%20/g; + >>$(p.name)
    << } From 4bd99d5771d959ee9859fdb3cd3a1bd26e6d37bb Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 17 Aug 2000 00:29:39 +0000 Subject: [PATCH 0524/7878] Fix some warnings from initopt and getopt. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60500 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 6 +++--- misc/unix/getopt.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 7953f6e573f..c7c9a064b02 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -62,7 +62,7 @@ typedef struct apr_getopt_t { int opt; /* character checked for validity */ int reset; /* reset getopt */ int argc; /* count of arguments */ - char const* const* argv; /* array of pointers to arguments */ + char *const *argv; /* array of pointers to arguments */ char const* place; /* argument associated with option */ } apr_getopt_t; @@ -73,10 +73,10 @@ typedef struct apr_getopt_t { * @param argc The number of arguments to parse * @param argv The array of arguments to parse * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) - * @deffunc apr_status_t apr_initopt(apr_getopt_t **os, apr_pool_t *cont,int argc, char const* const* argv) + * @deffunc apr_status_t apr_initopt(apr_getopt_t **os, apr_pool_t *cont,int argc, char *const *argv) */ APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, - int argc, char const* const* argv); + int argc, char *const *argv); /** * Parse the options initialized by apr_initopt(). diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 32544cbf092..03c64ccd5d3 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -36,7 +36,7 @@ #define EMSG "" APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, - int argc, char const* const* argv) + int argc, char *const *argv) { *os = apr_palloc(cont, sizeof(apr_getopt_t)); (*os)->cont = cont; From 1a5017900f50840329d675193c188295ddd84ce9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 17 Aug 2000 14:20:13 +0000 Subject: [PATCH 0525/7878] Add support to APR for dsos on OS/390. Submitted by: Greg Ames Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60501 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os390/.cvsignore | 1 + dso/os390/Makefile.in | 60 ++++++++++++++++++ dso/os390/dso.c | 129 +++++++++++++++++++++++++++++++++++++++ dso/os390/dso.h | 76 +++++++++++++++++++++++ include/arch/os390/dso.h | 76 +++++++++++++++++++++++ 5 files changed, 342 insertions(+) create mode 100644 dso/os390/.cvsignore create mode 100644 dso/os390/Makefile.in create mode 100644 dso/os390/dso.c create mode 100644 dso/os390/dso.h create mode 100644 include/arch/os390/dso.h diff --git a/dso/os390/.cvsignore b/dso/os390/.cvsignore new file mode 100644 index 00000000000..f3c7a7c5da6 --- /dev/null +++ b/dso/os390/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/dso/os390/Makefile.in b/dso/os390/Makefile.in new file mode 100644 index 00000000000..f755b93e69d --- /dev/null +++ b/dso/os390/Makefile.in @@ -0,0 +1,60 @@ +#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) +#LIBS=$(EXTRA_LIBS) $(LIBS1) +#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) +#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) + +RM=@RM@ +CC=@CC@ +RANLIB=@RANLIB@ +CFLAGS=@CFLAGS@ @OPTIM@ +LIBS=@LIBS@ +LDFLAGS=@LDFLAGS@ $(LIBS) +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. + +LIB=libdso.a + +OBJS=dso.o + +.c.o: + $(CC) $(CFLAGS) -c $(INCLUDES) $< + +all: $(LIB) + +clean: + $(RM) -f *.o *.a *.so + +distclean: clean + -$(RM) -f Makefile + + +$(LIB): $(OBJS) + $(RM) -f $@ + $(AR) cr $@ $(OBJS) + $(RANLIB) $@ + +# +# We really don't expect end users to use this rule. It works only with +# gcc, and rebuilds Makefile.in. You have to re-run configure after +# using it. +# +depend: + cp Makefile.in Makefile.in.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ + && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ + && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ + -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + > Makefile.in \ + && rm Makefile.new + +# DO NOT REMOVE +getopt.o: getopt.c misc.h ../../include/apr_private.h \ + ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_errno.h ../../include/apr_pools.h \ + ../../include/apr_lib.h ../../include/apr_file_io.h \ + ../../include/apr_getopt.h +start.o: start.c misc.h ../../include/apr_private.h \ + ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_errno.h ../../include/apr_pools.h \ + ../../include/apr_lib.h ../../include/apr_file_io.h \ + ../../include/apr_getopt.h diff --git a/dso/os390/dso.c b/dso/os390/dso.c new file mode 100644 index 00000000000..6b491a75a62 --- /dev/null +++ b/dso/os390/dso.c @@ -0,0 +1,129 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_strings.h" +#include "dso.h" +#include +#include + +#if APR_HAS_DSO + +static apr_status_t dso_cleanup(void *thedso) +{ + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); +} + +apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, + apr_pool_t *ctx) +{ + dllhandle *handle; + int rc; + + *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); + + if ((handle = dllload(path)) != NULL) { + (*res_handle)->handle = handle; + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + return APR_SUCCESS; + } + + (*res_handle)->failing_errno = errno; + return errno; +} + +apr_status_t apr_dso_unload(apr_dso_handle_t *handle) +{ + int rc; + + if (handle->handle == 0) + return APR_SUCCESS; + + rc = dllfree(handle->handle); + + if (rc == 0) { + handle->handle = 0; + return APR_SUCCESS; + } + handle->failing_errno = errno; + return errno; +} + +apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, + apr_dso_handle_t *handle, + const char *symname) +{ + void *func_ptr; + void *var_ptr; + + if ((func_ptr = (void *)dllqueryfn(handle->handle, symname)) != NULL) { + *ressym = func_ptr; + return APR_SUCCESS; + } + if ((var_ptr = dllqueryvar(handle->handle, symname)) != NULL) { + *ressym = var_ptr; + return APR_SUCCESS; + } + handle->failing_errno = errno; + return errno; +} + +const char *apr_dso_error(apr_dso_handle_t *handle, char *buffer, + apr_size_t buflen) +{ + apr_cpystrn(buffer, strerror(handle->failing_errno), buflen); + return buffer; +} + +#endif diff --git a/dso/os390/dso.h b/dso/os390/dso.h new file mode 100644 index 00000000000..0ee06e7f911 --- /dev/null +++ b/dso/os390/dso.h @@ -0,0 +1,76 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef DSO_H +#define DSO_H + +#include "apr_private.h" +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO + +#include + +struct apr_dso_handle_t { + dllhandle *handle; /* Handle to the DSO loaded */ + int failing_errno; /* Don't save the buffer returned by + strerror(); it gets reused */ +}; + +#endif + +#endif diff --git a/include/arch/os390/dso.h b/include/arch/os390/dso.h new file mode 100644 index 00000000000..0ee06e7f911 --- /dev/null +++ b/include/arch/os390/dso.h @@ -0,0 +1,76 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef DSO_H +#define DSO_H + +#include "apr_private.h" +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_dso.h" +#include "apr.h" + +#if APR_HAS_DSO + +#include + +struct apr_dso_handle_t { + dllhandle *handle; /* Handle to the DSO loaded */ + int failing_errno; /* Don't save the buffer returned by + strerror(); it gets reused */ +}; + +#endif + +#endif From e2139addb5ca9dbf102147b5370233edefa8ead1 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Thu, 17 Aug 2000 20:26:29 +0000 Subject: [PATCH 0526/7878] Win32: Simplify the code a bit by eliminating a variable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60502 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockopt.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 99d7fd093e5..417674d1210 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -88,34 +88,30 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o switch (opt) { case APR_SO_TIMEOUT: { - int new_timeout; - if (on <= 0) - new_timeout = on; - else - /* Convert from APR units (microseconds) to windows units - * (milliseconds) */ - new_timeout = on/1000; - - if (new_timeout == 0) { + if (on > 0) { + on = on/1000; /* Convert from APR units (uS) to windows units (mS) */ + } + + if (on == 0) { /* Set the socket non-blocking if it was previously blocking */ if (sock->timeout != 0) { if ((stat = sononblock(sock->sock)) != APR_SUCCESS) return stat; } } - else if (new_timeout > 0) { + else if (on > 0) { /* Set the socket to blocking if it was previously non-blocking */ if (sock->timeout == 0) { if ((stat = soblock(sock->sock)) != APR_SUCCESS) return stat; } /* Reset socket timeouts if the new timeout differs from the old timeout */ - if (sock->timeout != new_timeout) { - setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, (char *) &new_timeout, sizeof(new_timeout)); - setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, (char *) &new_timeout, sizeof(new_timeout)); + if (sock->timeout != on) { + setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, (char *) &on, sizeof(on)); + setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, (char *) &on, sizeof(on)); } } - else if (new_timeout < 0) { + else if (on < 0) { int zero = 0; /* Set the socket to blocking with infinite timeouts */ if ((stat = soblock(sock->sock)) != APR_SUCCESS) @@ -123,7 +119,7 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, (char *) &zero, sizeof(zero)); setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, (char *) &zero, sizeof(zero)); } - sock->timeout = new_timeout; + sock->timeout = on; break; } case APR_SO_KEEPALIVE: From e7e68cebe9996732b1d3f06639d7376aab95ded2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 18 Aug 2000 04:49:13 +0000 Subject: [PATCH 0527/7878] This fixes readwrite on Win9x. Misc.h needed to be included Submitted by: Bill Wrote git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60503 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 1 + 1 file changed, 1 insertion(+) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index e9bd3340568..b5c6002df17 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -59,6 +59,7 @@ #include "apr_errno.h" #include #include "atime.h" +#include "misc.h" /* * read_with_timeout() From f10710e597045cd410d98502749ffc6913dcdcef Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Aug 2000 15:33:08 +0000 Subject: [PATCH 0528/7878] Tweak apache/apr builds to support dsos on OS/390. The OS/390 compile options are hard-coded because we need the special DLL,EXPORTALL on *all* object files that are part of the core so that dsos can reference symbols in the core. (Of course, we use the option on more object files than that, but it doesn't seem to hurt anything.) We hard-code the enablement of DSOs on OS/390 because the library functions on OS/390 to manage explicit loading are not portable, so there seems to be no use in probing for them. Submitted by: Greg Ames git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60504 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/configure.in b/configure.in index 4661d192992..3843016cacc 100644 --- a/configure.in +++ b/configure.in @@ -105,6 +105,12 @@ case "$OS" in AC_CHECK_DEFINE(BONE_VERSION, sys/socket.h) eolstr="\\n" ;; + *os390) + OSDIR="os390" + config_subdirs="shmem/unix/mm" + USE_MM=yes + eolstr="\\n" + ;; *) OSDIR="unix" config_subdirs="shmem/unix/mm" @@ -437,6 +443,13 @@ AC_ARG_ENABLE(dso, if test "$tempdso" = "no"; then AC_CHECK_LIB(root, load_image, tempdso="yes", tempdso="no") fi + if test "$tempdso" = "no"; then + case $OS in + *os390) + tempdso="yes" + ;; + esac + fi ] ) if test "$tempdso" = "no"; then From 9cefcd4cfc90d40e9ebdf4544c219ee703cb1375 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 18 Aug 2000 18:29:39 +0000 Subject: [PATCH 0529/7878] Win32: After much experimentation, I've decided to continue to use setsockopt(SO_SNDRCVTIMEO). Applications will need to segment apr_sends or set timeouts appropriately to accomodate slow clients. Apache should be fine as it does not typically attempt to apr_send more than 8192 bytes at once with default timeouts of 15 seconds. apr_sendfile() is another matter... On Windows, TransmitFile will block (or not trigger a completion event) until the entire file content is sent. It is easy for a slow client to request a file than cannot be served before the timeout expires. To accomodate these cases, I introduced the MAX_SEGMENT_SIZE #define to define the maximum amount of data TransmitFile will be asked to send at once. The default setting of 65536 should accomodate most clients dialed in at 28K (or more) if i/o timeouts are configured to be 30 seconds or more. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60506 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 233 ++++++++++++++++++++++-------------- 1 file changed, 142 insertions(+), 91 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index b7be1ad9f80..ed6b9a13618 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -60,6 +60,16 @@ #include "fileio.h" #include +/* MAX_SEGMENT_SIZE is the maximum amount of data that will be sent to a client + * in one call of TransmitFile. This number must be small enough to give the + * slowest client time to receive the data before the socket timeout triggers. + * The same problem can exist with apr_send(). In that case, we rely on the + * application to adjust socket timeouts and max send segment sizes appropriately. + * For example, Apache will in most cases call apr_send() with less than 8193 + * bytes + * of data. + */ +#define MAX_SEGMENT_SIZE 65536 apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) { apr_ssize_t rv; @@ -134,7 +144,39 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, *nbytes = dwBytes; return APR_SUCCESS; } +static void collapse_iovec(char **buf, int *len, struct iovec *iovec, int numvec, apr_pool_t *p) +{ + int ptr = 0; + + if (numvec == 1) { + *buf = iovec[0].iov_base; + *len = iovec[0].iov_len; + } + else { + int i; + for (i = 0; i < numvec; i++) { + *len += iovec[i].iov_len; + } + + *buf = apr_palloc(p, *len); /* Should this be a malloc? */ + + for (i = 0; i < numvec; i++) { + memcpy((char*)*buf + ptr, iovec[i].iov_base, iovec[i].iov_len); + ptr += iovec[i].iov_len; + } + } +} #if APR_HAS_SENDFILE +/* + *#define WAIT_FOR_EVENT + * Note: Waiting for the socket directly is much faster than creating a seperate + * wait event. There are a couple of dangerous aspects to waiting directly + * for the socket. First, we should not wait on the socket if concurrent threads + * can wait-on/signal the same socket. This shouldn't be happening with Apache since + * a socket is uniquely tied to a thread. This will change when we begin using + * async I/O with completion ports on the socket. + */ + /* * apr_status_t apr_sendfile(apr_socket_t *, apr_file_t *, apr_hdtr_t *, * apr_off_t *, apr_size_t *, apr_int32_t flags) @@ -144,129 +186,138 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, * arg 2) The open file from which to read * arg 3) A structure containing the headers and trailers to send * arg 4) Offset into the file where we should begin writing - * arg 5) Number of bytes to send + * arg 5) Number of bytes to send out of the file * arg 6) APR flags that are mapped to OS specific flags */ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, - apr_int32_t flags) + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_int32_t flags) { -/* - *#define WAIT_FOR_EVENT - * Note: Waiting for the socket directly is much faster than creating a seperate - * wait event. There are a couple of dangerous aspects to waiting directly - * for the socket. First, we should not wait on the socket if concurrent threads - * can wait-on/signal the same socket. This shouldn't be happening with Apache since - * a socket is uniquely tied to a thread. This will change when we begin using - * async I/O with completion ports on the socket. Second, I am not sure how the - * socket timeout code will work. I am hoping the socket will be signaled if the - * setsockopt timeout expires. Need to verify this... - */ + apr_status_t status = APR_SUCCESS; apr_ssize_t rv; + DWORD dwFlags = 0; + DWORD nbytes; OVERLAPPED overlapped; TRANSMIT_FILE_BUFFERS tfb, *ptfb = NULL; - int i, ptr = 0; - int lasterror = APR_SUCCESS; - DWORD dwFlags = 0; + int bytes_to_send; + int ptr = 0; - /* Map APR flags to OS specific flags */ - if (flags & APR_SENDFILE_DISCONNECT_SOCKET) { - dwFlags |= TF_REUSE_SOCKET; - dwFlags |= TF_DISCONNECT; + /* Must pass in a valid length */ + if (len == 0) { + return APR_EINVAL; } + bytes_to_send = *len; + *len = 0; + + /* Initialize the overlapped structure */ + memset(&overlapped,'\0', sizeof(overlapped)); + if (offset && *offset) { + overlapped.Offset = *offset; + } +#ifdef WAIT_FOR_EVENT + overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); +#endif /* TransmitFile can only send one header and one footer */ memset(&tfb, '\0', sizeof (tfb)); if (hdtr && hdtr->numheaders) { ptfb = &tfb; - if (hdtr->numheaders == 1) { - ptfb->Head = hdtr->headers[0].iov_base; - ptfb->HeadLength = hdtr->headers[0].iov_len; - } - else { - /* Need to collapse all the header fragments into one buffer */ - for (i = 0; i < hdtr->numheaders; i++) { - ptfb->HeadLength += hdtr->headers[i].iov_len; - } - ptfb->Head = apr_palloc(sock->cntxt, ptfb->HeadLength); /* Should this be a malloc? */ + collapse_iovec((char **)&ptfb->Head, &ptfb->HeadLength, hdtr->headers, hdtr->numheaders, sock->cntxt); + } - for (i = 0; i < hdtr->numheaders; i++) { - memcpy((char*)ptfb->Head + ptr, hdtr->headers[i].iov_base, - hdtr->headers[i].iov_len); - ptr += hdtr->headers[i].iov_len; - } + /* If we have more than MAX_SEGMENT_SIZE headers to send, send them + * in segments. + */ + if (ptfb && ptfb->HeadLength) { + while (ptfb->HeadLength >= MAX_SEGMENT_SIZE) { + nbytes = MAX_SEGMENT_SIZE; + rv = apr_send(sock, ptfb->Head, &nbytes); + if (rv != APR_SUCCESS) + return rv; + (char*) ptfb->Head += nbytes; + ptfb->HeadLength -= nbytes; + *len += nbytes; } } - if (hdtr && hdtr->numtrailers) { - ptfb = &tfb; - if (hdtr->numtrailers == 1) { - ptfb->Tail = hdtr->trailers[0].iov_base; - ptfb->TailLength = hdtr->trailers[0].iov_len; + + while (bytes_to_send) { + if (bytes_to_send > MAX_SEGMENT_SIZE) { + nbytes = MAX_SEGMENT_SIZE; } else { - /* Need to collapse all the trailer fragments into one buffer */ - for (i = 0; i < hdtr->numtrailers; i++) { - ptfb->TailLength += hdtr->headers[i].iov_len; + /* Last call to TransmitFile() */ + nbytes = bytes_to_send; + /* Send trailers on the last packet, even if the total size + * exceeds MAX_SEGMENT_SIZE... + */ + if (hdtr && hdtr->numtrailers) { + ptfb = &tfb; + collapse_iovec((char**) &ptfb->Tail, &ptfb->TailLength, + hdtr->trailers, hdtr->numtrailers, sock->cntxt); } - - ptfb->Tail = apr_palloc(sock->cntxt, ptfb->TailLength); /* Should this be a malloc? */ - - for (i = 0; i < hdtr->numtrailers; i++) { - memcpy((char*)ptfb->Tail + ptr, hdtr->trailers[i].iov_base, - hdtr->trailers[i].iov_len); - ptr += hdtr->trailers[i].iov_len; + /* Disconnect the socket after last send */ + if (flags & APR_SENDFILE_DISCONNECT_SOCKET) { + dwFlags |= TF_REUSE_SOCKET; + dwFlags |= TF_DISCONNECT; } } - } - /* Initialize the overlapped structure */ - memset(&overlapped,'\0', sizeof(overlapped)); - if (offset && *offset) { - overlapped.Offset = *offset; - } -#ifdef WAIT_FOR_EVENT - overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); -#endif - - rv = TransmitFile(sock->sock, /* socket */ - file->filehand, /* open file descriptor of the file to be sent */ - *len, /* number of bytes to send. 0=send all */ - 0, /* Number of bytes per send. 0=use default */ - &overlapped, /* OVERLAPPED structure */ - ptfb, /* header and trailer buffers */ - dwFlags); /* flags to control various aspects of TransmitFile */ - if (!rv) { - lasterror = WSAGetLastError(); - if (lasterror == ERROR_IO_PENDING) { + + rv = TransmitFile(sock->sock, /* socket */ + file->filehand, /* open file descriptor of the file to be sent */ + nbytes, /* number of bytes to send. 0=send all */ + 0, /* Number of bytes per send. 0=use default */ + &overlapped, /* OVERLAPPED structure */ + ptfb, /* header and trailer buffers */ + dwFlags); /* flags to control various aspects of TransmitFile */ + if (!rv) { + status = WSAGetLastError(); + if (status == ERROR_IO_PENDING) { #ifdef WAIT_FOR_EVENT - rv = WaitForSingleObject(overlapped.hEvent, - sock->timeout >= 0 ? sock->timeout : INFINITE); + rv = WaitForSingleObject(overlapped.hEvent, + sock->timeout >= 0 ? sock->timeout : INFINITE); #else - rv = WaitForSingleObject((HANDLE) sock->sock, - sock->timeout >= 0 ? sock->timeout : INFINITE); + rv = WaitForSingleObject((HANDLE) sock->sock, + sock->timeout >= 0 ? sock->timeout : INFINITE); #endif - if (rv == WAIT_OBJECT_0) - lasterror = APR_SUCCESS; - else if (rv == WAIT_TIMEOUT) - lasterror = WAIT_TIMEOUT; - else if (rv == WAIT_ABANDONED) - lasterror = WAIT_ABANDONED; - else - lasterror = GetLastError(); + if (rv == WAIT_OBJECT_0) + status = APR_SUCCESS; + else if (rv == WAIT_TIMEOUT) + status = WAIT_TIMEOUT; + else if (rv == WAIT_ABANDONED) + status = WAIT_ABANDONED; + else + status = GetLastError(); + } } + if (status != APR_SUCCESS) + break; + + /* Assume the headers have been sent */ + ptfb->HeadLength = 0; + ptfb->Head = NULL; + bytes_to_send -= nbytes; + *len += nbytes; + overlapped.Offset += nbytes; } - /* Mark the socket as disconnected, but do not close it. - * Note: The application must have stored the socket prior to making - * the call to apr_sendfile in order to either reuse it or close it. - */ - if ((lasterror == APR_SUCCESS) && (flags & APR_SENDFILE_DISCONNECT_SOCKET)) { - sock->disconnected = 1; - sock->sock = INVALID_SOCKET; + + if (status == APR_SUCCESS) { + if (ptfb && ptfb->TailLength) + *len += ptfb->TailLength; + + /* Mark the socket as disconnected, but do not close it. + * Note: The application must have stored the socket prior to making + * the call to apr_sendfile in order to either reuse it or close it. + */ + if (flags & APR_SENDFILE_DISCONNECT_SOCKET) { + sock->disconnected = 1; + sock->sock = INVALID_SOCKET; + } } #ifdef WAIT_FOR_EVENT CloseHandle(overlapped.hEvent); #endif - return lasterror; + return status; } #endif From e2a761c21b30d14708d5751b25889bf17283b613 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 20 Aug 2000 04:14:49 +0000 Subject: [PATCH 0530/7878] Remove some casts in calls to iconv(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60507 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/xlate.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index acd2e58c1a7..6ff40c6798a 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -174,7 +174,8 @@ static apr_status_t apr_xlate_cleanup(void *convset) static void check_sbcs(apr_xlate_t *convset) { char inbuf[256], outbuf[256]; - char *inbufptr = inbuf, *outbufptr = outbuf; + const char *inbufptr = inbuf; + char *outbufptr = outbuf; size_t inbytes_left, outbytes_left; int i; size_t translated; @@ -184,7 +185,7 @@ static void check_sbcs(apr_xlate_t *convset) } inbytes_left = outbytes_left = sizeof(inbuf); - translated = iconv(convset->ich, (const char **)&inbufptr, + translated = iconv(convset->ich, &inbufptr, &inbytes_left, &outbufptr, &outbytes_left); if (translated != (size_t) -1 && inbytes_left == 0 && @@ -275,10 +276,10 @@ apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, size_t translated; if (convset->ich != (iconv_t)-1) { - char *inbufptr = (char *)inbuf; + const char *inbufptr = inbuf; char *outbufptr = outbuf; - translated = iconv(convset->ich, (const char **)&inbufptr, + translated = iconv(convset->ich, &inbufptr, inbytes_left, &outbufptr, outbytes_left); /* If everything went fine but we ran out of buffer, don't * report it as an error. Caller needs to look at the two From aabc77fadab5e53b001500d403fcc19211179fd0 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 22 Aug 2000 15:09:24 +0000 Subject: [PATCH 0531/7878] APRize disabling nagle (setting TCP_NODELAY). Note that several areas have not been tested as they apply to MPMs or APR code that I can't test. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60508 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 1 + network_io/beos/sockopt.c | 7 ++++++- network_io/os2/sockopt.c | 5 +++++ network_io/unix/sockopt.c | 5 +++++ network_io/win32/sockopt.c | 5 +++++ 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 3055eb712e7..6bff5cb482b 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -92,6 +92,7 @@ extern "C" { #define APR_SO_SNDBUF 64 #define APR_SO_RCVBUF 128 #define APR_SO_DISCONNECTED 256 +#define APR_TCP_NODELAY 512 #define APR_POLLIN 0x001 #define APR_POLLPRI 0x002 diff --git a/network_io/beos/sockopt.c b/network_io/beos/sockopt.c index c5921dfbc8c..5b09dcac078 100644 --- a/network_io/beos/sockopt.c +++ b/network_io/beos/sockopt.c @@ -107,6 +107,11 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o sock->timeout = on; } + if (opt & APR_TCP_NODELAY) { + if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { + return errno; + } + } return APR_SUCCESS; } @@ -149,4 +154,4 @@ apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) /* on BeOS h_errno is a global... */ return h_errno; } -#endif \ No newline at end of file +#endif diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index c81ecd75e29..1bba7003065 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -114,6 +114,11 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o if (opt & APR_SO_TIMEOUT) { sock->timeout = on; } + if (opt & APR_TCP_NODELAY) { + if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { + return APR_OS2_STATUS(sock_errno()); + } + } return APR_SUCCESS; } diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 8cee5e30ad2..d030888a921 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -170,6 +170,11 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o } sock->timeout = on; } + if (opt & APR_TCP_NODELAY) { + if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { + return errno; + } + } return APR_SUCCESS; } diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 417674d1210..811dc6e7697 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -157,6 +157,11 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o } break; } + case APR_TCP_NODELAY: + if (setsockopt(sock->sock, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { + return WSAGetLastError(); + } + break; default: return APR_EINVAL; break; From 76653498bc42dbe8787599c8eb3bab3c1f90e852 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 22 Aug 2000 21:20:11 +0000 Subject: [PATCH 0532/7878] Don't fail to compile unix/sockopt.c if TCP_NODELAY isn't defined. Define TCP_NODELAY on OS/390. libc doesn't define it in a header file we'd want to include. TCP_NODELAY was busted all along on OS/390; we just didn't realize it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60509 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 1 + network_io/unix/sockopt.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/hints.m4 b/hints.m4 index f93bbf8d887..dff78c41718 100644 --- a/hints.m4 +++ b/hints.m4 @@ -397,6 +397,7 @@ dnl ;; APR_ADDTO(CFLAGS, [-DPTHREAD_SETS_ERRNO]) APR_ADDTO(CFLAGS, [-DPTHREAD_DETACH_ARG1_ADDR]) APR_ADDTO(CFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK]) + APR_ADDTO(CFLAGS, [-DTCP_NODELAY=1]) ;; esac APR_DOEXTRA diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index d030888a921..0997b67a3c6 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -171,9 +171,13 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o sock->timeout = on; } if (opt & APR_TCP_NODELAY) { +#if defined(TCP_NODELAY) if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { return errno; } +#else + return APR_ENOTIMPL; +#endif } return APR_SUCCESS; } From 6978828effbefea032bb2cf7640d2e2aea0e2b57 Mon Sep 17 00:00:00 2001 From: Ken Coar Date: Tue, 22 Aug 2000 21:55:34 +0000 Subject: [PATCH 0533/7878] Add UNTESTED routines and structures to APR's table implementation to allow for tables with string keys and non-string values. Instead of a char * value field, these tables have an apr_item_t * value field, which in turn is a structure containing a size and a void * pointer to the data themselves. I've kept the types distinct to keep type-checking useful, so they can't be accidentally intermixed in function calls. I've used 'btable' in place of 'table' in all cases, so the structures are apr_btable_t and apr_btable_entry_t. I've prototyped and cloned all of the relevant routines except apr_table_to() and apr_overlap_tables(), which were both too complex for me to want to tackle to-night. Some of the routines don't make sense to clone, like apr_table_merge*(). So maybe this all sucks and someone can rip it out, but I'm sick of waiting for this functionality so I hope someone takes this and improves it instead. We *could* reimplement the string-value tables as a special case of btables, which would conceivably save on strlen() cycles, but I'm not sure it would be worth it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60510 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 129 +++++++++++++++++----- tables/apr_tables.c | 247 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 348 insertions(+), 28 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index a1c02c64193..4969ce7d8d1 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -84,6 +84,7 @@ extern "C" { * published. */ typedef struct apr_table_t apr_table_t; +typedef struct apr_btable_t apr_btable_t; typedef struct apr_array_header_t apr_array_header_t; /** An opaque array type */ @@ -100,7 +101,7 @@ struct apr_array_header_t { char *elts; }; -/** The opaque table type */ +/** The opaque string-content table type */ struct apr_table_t { /* This has to be first to promote backwards compatibility with * older modules which cast a apr_table_t * to an apr_array_header_t *... @@ -115,9 +116,27 @@ struct apr_table_t { #endif }; +/** The opaque binary-content table type */ +struct apr_btable_t { + /* This has to be first to promote backwards compatibility with + * older modules which cast a apr_table_t * to an apr_array_header_t *... + * they should use the table_elts() function for most of the + * cases they do this for. + */ + /** The underlying array for the table */ + apr_array_header_t a; +#ifdef MAKE_TABLE_PROFILE + /** Who created the array. */ + void *creator; +#endif +}; + +/** + * The (opaque) structure for string-content tables. + */ typedef struct apr_table_entry_t apr_table_entry_t; -/** The type for each entry in a table */ +/** The type for each entry in a string-content table */ struct apr_table_entry_t { /** The key for the current table entry */ char *key; /* maybe NULL in future; @@ -127,16 +146,51 @@ struct apr_table_entry_t { char *val; }; +/** + * The (opaque) structure for binary-content tables. + */ +typedef struct apr_btable_entry_t apr_btable_entry_t; + +/** + * A transparent type for items stored in binary-content tables, and + * possibly elsewhere. + */ +typedef struct apr_item_t { + /** The key for the current table entry */ + char *key; /* maybe NULL in future; + * check when iterating thru table_elts + */ + /** Size of the opaque block comprising the item's content. */ + size_t size; + /** A pointer to the content itself. */ + void *data; +} apr_item_t; + +/** The type for each entry in a binary-content table */ +struct apr_btable_entry_t { + /** The key for the current table entry */ + char *key; /* maybe NULL in future; + * check when iterating thru table_elts + */ + /** The value for the current table entry */ + apr_item_t *val; +}; + /* XXX: these know about the definition of struct apr_table_t in alloc.c. That * definition is not here because it is supposed to be private, and by not * placing it here we are able to get compile-time diagnostics from modules - * written which assume that a apr_table_t is the same as an apr_array_header_t. -djg + * written which assume that a apr_table_t is the same as an + * apr_array_header_t. -djg */ #define apr_table_elts(t) ((apr_array_header_t *)(t)) -#define apr_is_empty_table(t) (((t) == NULL)||(((apr_array_header_t *)(t))->nelts == 0)) +#define apr_btable_elts(t) apr_table_elts(t) + +#define apr_is_empty_table(t) (((t) == NULL) \ + || (((apr_array_header_t *)(t))->nelts == 0)) +#define apr_is_empty_btable(t) apr_is_empty_table(t) -APR_EXPORT(apr_array_header_t *) apr_make_array(struct apr_pool_t *p, int nelts, - int elt_size); +APR_EXPORT(apr_array_header_t *) apr_make_array(struct apr_pool_t *p, + int nelts, int elt_size); APR_EXPORT(void *) apr_push_array(apr_array_header_t *arr); APR_EXPORT(void) apr_array_cat(apr_array_header_t *dst, const apr_array_header_t *src); @@ -165,25 +219,44 @@ APR_EXPORT(char *) apr_array_pstrcat(struct apr_pool_t *p, const apr_array_header_t *arr, const char sep); APR_EXPORT(apr_table_t *) apr_make_table(struct apr_pool_t *p, int nelts); -APR_EXPORT(apr_table_t *) apr_copy_table(struct apr_pool_t *p, const apr_table_t *t); +APR_EXPORT(apr_btable_t *) apr_make_btable(struct apr_pool_t *p, int nelts); +APR_EXPORT(apr_table_t *) apr_copy_table(struct apr_pool_t *p, + const apr_table_t *t); +APR_EXPORT(apr_btable_t *) apr_copy_btable(struct apr_pool_t *p, + const apr_btable_t *t); APR_EXPORT(void) apr_clear_table(apr_table_t *t); +APR_EXPORT(void) apr_clear_btable(apr_btable_t *t); APR_EXPORT(const char *) apr_table_get(const apr_table_t *t, const char *key); +APR_EXPORT(const apr_item_t *) apr_btable_get(const apr_btable_t *t, + const char *key); APR_EXPORT(void) apr_table_set(apr_table_t *t, const char *key, const char *val); +APR_EXPORT(void) apr_btable_set(apr_btable_t *t, const char *key, + size_t size, const void *val); APR_EXPORT(void) apr_table_setn(apr_table_t *t, const char *key, const char *val); +APR_EXPORT(void) apr_btable_setn(apr_btable_t *t, const char *key, + size_t size, const void *val); APR_EXPORT(void) apr_table_unset(apr_table_t *t, const char *key); +APR_EXPORT(void) apr_btable_unset(apr_btable_t *t, const char *key); APR_EXPORT(void) apr_table_merge(apr_table_t *t, const char *key, const char *val); APR_EXPORT(void) apr_table_mergen(apr_table_t *t, const char *key, const char *val); APR_EXPORT(void) apr_table_add(apr_table_t *t, const char *key, const char *val); +APR_EXPORT(void) apr_btable_add(apr_btable_t *t, const char *key, + size_t size, const void *val); APR_EXPORT(void) apr_table_addn(apr_table_t *t, const char *key, const char *val); +APR_EXPORT(void) apr_btable_addn(apr_btable_t *t, const char *key, + size_t size, const void *val); APR_EXPORT(apr_table_t *) apr_overlay_tables(struct apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); +APR_EXPORT(apr_btable_t *) apr_overlay_btables(struct apr_pool_t *p, + const apr_btable_t *overlay, + const apr_btable_t *base); APR_EXPORT(void) apr_table_do(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, ...); @@ -192,27 +265,27 @@ APR_EXPORT(void) void *rec, const apr_table_t *t, va_list); /* Conceptually, apr_overlap_tables does this: - - apr_array_header_t *barr = apr_table_elts(b); - apr_table_entry_t *belt = (apr_table_entry_t *)barr->elts; - int i; - - for (i = 0; i < barr->nelts; ++i) { - if (flags & apr_OVERLAP_TABLES_MERGE) { - apr_table_mergen(a, belt[i].key, belt[i].val); - } - else { - apr_table_setn(a, belt[i].key, belt[i].val); - } - } - - Except that it is more efficient (less space and cpu-time) especially - when b has many elements. - - Notice the assumptions on the keys and values in b -- they must be - in an ancestor of a's pool. In practice b and a are usually from - the same pool. -*/ + * + * apr_array_header_t *barr = apr_table_elts(b); + * apr_table_entry_t *belt = (apr_table_entry_t *)barr->elts; + * int i; + * + * for (i = 0; i < barr->nelts; ++i) { + * if (flags & apr_OVERLAP_TABLES_MERGE) { + * apr_table_mergen(a, belt[i].key, belt[i].val); + * } + * else { + * apr_table_setn(a, belt[i].key, belt[i].val); + * } + * } + * + * Except that it is more efficient (less space and cpu-time) especially + * when b has many elements. + * + * Notice the assumptions on the keys and values in b -- they must be + * in an ancestor of a's pool. In practice b and a are usually from + * the same pool. + */ #define APR_OVERLAP_TABLES_SET (0) #define APR_OVERLAP_TABLES_MERGE (1) APR_EXPORT(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 0ae34bbe1e2..a5dbdd6f4ef 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -305,6 +305,17 @@ APR_EXPORT(apr_table_t *) apr_make_table(apr_pool_t *p, int nelts) return t; } +APR_EXPORT(apr_btable_t *) apr_make_btable(apr_pool_t *p, int nelts) +{ + apr_btable_t *t = apr_palloc(p, sizeof(apr_btable_t)); + + make_array_core(&t->a, p, nelts, sizeof(apr_btable_entry_t)); +#ifdef MAKE_TABLE_PROFILE + t->creator = __builtin_return_address(0); +#endif + return t; +} + APR_EXPORT(apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) { apr_table_t *new = apr_palloc(p, sizeof(apr_table_t)); @@ -324,11 +335,36 @@ APR_EXPORT(apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) return new; } +APR_EXPORT(apr_btable_t *) apr_copy_btable(apr_pool_t *p, + const apr_btable_t *t) +{ + apr_btable_t *new = apr_palloc(p, sizeof(apr_btable_entry_t)); + +#ifdef POOL_DEBUG + /* we don't copy keys and values, so it's necessary that t->a.pool + * have a life span at least as long as p + */ + if (!apr_pool_is_ancestor(t->a.cont, p)) { + fprintf(stderr, "copy_btable: t's pool is not an ancestor of p\n"); + abort(); + } +#endif + make_array_core(&new->a, p, t->a.nalloc, sizeof(apr_btable_entry_t)); + memcpy(new->a.elts, t->a.elts, t->a.nelts * sizeof(apr_btable_entry_t)); + new->a.nelts = t->a.nelts; + return new; +} + APR_EXPORT(void) apr_clear_table(apr_table_t *t) { t->a.nelts = 0; } +APR_EXPORT(void) apr_clear_btable(apr_btable_t *t) +{ + t->a.nelts = 0; +} + APR_EXPORT(const char *) apr_table_get(const apr_table_t *t, const char *key) { apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; @@ -347,6 +383,25 @@ APR_EXPORT(const char *) apr_table_get(const apr_table_t *t, const char *key) return NULL; } +APR_EXPORT(const apr_item_t *) apr_btable_get(const apr_btable_t *t, + const char *key) +{ + apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; + int i; + + if (key == NULL) { + return NULL; + } + + for (i = 0; i < t->a.nelts; ++i) { + if (!strcasecmp(elts[i].key, key)) { + return elts[i].val; + } + } + + return NULL; +} + APR_EXPORT(void) apr_table_set(apr_table_t *t, const char *key, const char *val) { @@ -381,6 +436,46 @@ APR_EXPORT(void) apr_table_set(apr_table_t *t, const char *key, } } +APR_EXPORT(void) apr_btable_set(apr_btable_t *t, const char *key, + size_t size, const void *val) +{ + register int i, j, k; + apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; + apr_item_t *item; + int done = 0; + + item = apr_pcalloc(t->a.cont, sizeof(apr_item_t)); + item->size = size; + item->data = apr_pcalloc(t->a.cont, size); + memcpy(item->data, val, size); + + for (i = 0; i < t->a.nelts; ) { + if (!strcasecmp(elts[i].key, key)) { + if (!done) { + elts[i].val = item; + done = 1; + ++i; + } + else { /* delete an extraneous element */ + for (j = i, k = i + 1; k < t->a.nelts; ++j, ++k) { + elts[j].key = elts[k].key; + elts[j].val = elts[k].val; + } + --t->a.nelts; + } + } + else { + ++i; + } + } + + if (!done) { + elts = (apr_btable_entry_t *) table_push((apr_btable_t *) t); + elts->key = apr_pstrdup(t->a.cont, key); + elts->val = item; + } +} + APR_EXPORT(void) apr_table_setn(apr_table_t *t, const char *key, const char *val) { @@ -428,6 +523,58 @@ APR_EXPORT(void) apr_table_setn(apr_table_t *t, const char *key, } } +APR_EXPORT(void) apr_btable_setn(apr_btable_t *t, const char *key, + size_t size, const void *val) +{ + register int i, j, k; + apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; + int done = 0; + apr_item_t *item; + +#ifdef POOL_DEBUG + { + if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.cont)) { + fprintf(stderr, "table_set: key not in ancestor pool of t\n"); + abort(); + } + if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.cont)) { + fprintf(stderr, "table_set: val not in ancestor pool of t\n"); + abort(); + } + } +#endif + + item = (apr_item_t *) apr_pcalloc(t->a.cont, size); + item->size = size; + item->data = (void *)val; + + for (i = 0; i < t->a.nelts; ) { + if (!strcasecmp(elts[i].key, key)) { + if (!done) { + elts[i].val = item; + done = 1; + ++i; + } + else { /* delete an extraneous element */ + for (j = i, k = i + 1; k < t->a.nelts; ++j, ++k) { + elts[j].key = elts[k].key; + elts[j].val = elts[k].val; + } + --t->a.nelts; + } + } + else { + ++i; + } + } + + if (!done) { + elts = (apr_btable_entry_t *) table_push((apr_table_t *)t); + elts->key = (char *)key; + elts->val = item; + } +} + APR_EXPORT(void) apr_table_unset(apr_table_t *t, const char *key) { register int i, j, k; @@ -453,6 +600,31 @@ APR_EXPORT(void) apr_table_unset(apr_table_t *t, const char *key) } } +APR_EXPORT(void) apr_btable_unset(apr_btable_t *t, const char *key) +{ + register int i, j, k; + apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; + + for (i = 0; i < t->a.nelts; ) { + if (!strcasecmp(elts[i].key, key)) { + + /* found an element to skip over + * there are any number of ways to remove an element from + * a contiguous block of memory. I've chosen one that + * doesn't do a memcpy/bcopy/array_delete, *shrug*... + */ + for (j = i, k = i + 1; k < t->a.nelts; ++j, ++k) { + elts[j].key = elts[k].key; + elts[j].val = elts[k].val; + } + --t->a.nelts; + } + else { + ++i; + } + } +} + APR_EXPORT(void) apr_table_merge(apr_table_t *t, const char *key, const char *val) { @@ -512,6 +684,21 @@ APR_EXPORT(void) apr_table_add(apr_table_t *t, const char *key, elts->val = apr_pstrdup(t->a.cont, val); } +APR_EXPORT(void) apr_btable_add(apr_btable_t *t, const char *key, + size_t size, const void *val) +{ + apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; + apr_item_t *item; + + item = (apr_item_t *) apr_pcalloc(t->a.cont, sizeof(apr_item_t)); + item->size = size; + item->data = apr_pcalloc(t->a.cont, size); + memcpy(item->data, val, size); + elts = (apr_btable_entry_t *) table_push((apr_btable_t *)t); + elts->key = apr_pstrdup(t->a.cont, key); + elts->val = item; +} + APR_EXPORT(void) apr_table_addn(apr_table_t *t, const char *key, const char *val) { @@ -535,6 +722,34 @@ APR_EXPORT(void) apr_table_addn(apr_table_t *t, const char *key, elts->val = (char *)val; } +APR_EXPORT(void) apr_btable_addn(apr_btable_t *t, const char *key, + size_t size, const void *val) +{ + apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; + apr_item_t *item; + +#ifdef POOL_DEBUG + { + if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.cont)) { + fprintf(stderr, "table_set: key not in ancestor pool of t\n"); + abort(); + } + if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.cont)) { + fprintf(stderr, "table_set: key not in ancestor pool of t\n"); + abort(); + } + } +#endif + + item = (apr_item_t *) apr_pcalloc(t->a.cont, sizeof(apr_item_t)); + item->size = size; + item->data = apr_pcalloc(t->a.cont, size); + memcpy(item->data, val, size); + elts = (apr_btable_entry_t *) table_push((apr_btable_t *)t); + elts->key = (char *)key; + elts->val = item; +} + APR_EXPORT(apr_table_t *) apr_overlay_tables(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base) @@ -567,6 +782,38 @@ APR_EXPORT(apr_table_t *) apr_overlay_tables(apr_pool_t *p, return res; } +APR_EXPORT(apr_btable_t *) apr_overlay_btables(apr_pool_t *p, + const apr_btable_t *overlay, + const apr_btable_t *base) +{ + apr_btable_t *res; + +#ifdef POOL_DEBUG + /* we don't copy keys and values, so it's necessary that + * overlay->a.pool and base->a.pool have a life span at least + * as long as p + */ + if (!apr_pool_is_ancestor(overlay->a.cont, p)) { + fprintf(stderr, + "overlay_tables: overlay's pool is not an ancestor of p\n"); + abort(); + } + if (!apr_pool_is_ancestor(base->a.cont, p)) { + fprintf(stderr, + "overlay_tables: base's pool is not an ancestor of p\n"); + abort(); + } +#endif + + res = apr_palloc(p, sizeof(apr_btable_t)); + /* behave like append_arrays */ + res->a.cont = p; + copy_array_hdr_core(&res->a, &overlay->a); + apr_array_cat(&res->a, &base->a); + + return res; +} + /* And now for something completely abstract ... * For each key value given as a vararg: From 418510a8f491845454415881b0e140192ecf71e7 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 23 Aug 2000 20:16:27 +0000 Subject: [PATCH 0534/7878] Try to organize the MPM pre-selection to the hints.m4 file. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60511 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hints.m4 b/hints.m4 index dff78c41718..da8b3642e1c 100644 --- a/hints.m4 +++ b/hints.m4 @@ -41,6 +41,15 @@ AC_DEFUN(APR_SETIFNULL,[ fi ]) +dnl +dnl APR_SETVAR(variable, value) +dnl +dnl Set variable no matter what +dnl +AC_DEFUN(APR_SETVAR,[ + $1="$2"; export $1 +]) + dnl dnl APR_ADDTO(variable, value) dnl @@ -76,6 +85,7 @@ case "$PLAT" in APR_SETIFNULL(CFLAGS, [-DAUX3 -D_POSIX_SOURCE]) APR_SETIFNULL(LIBS, [-lposix -lbsd]) APR_SETIFNULL(LDFLAGS, [-s]) + APR_SETVAR(APACHE_MPM, [prefork]) ;; *-ibm-aix*) case $PLAT in @@ -131,6 +141,7 @@ case "$PLAT" in *os2_emx*) APR_SETIFNULL(SHELL, [sh]) APR_SETIFNULL(file_as_socket, [0]) + APR_SETVAR(APACHE_MPM, [spmt_os2]) ;; *-hi-hiux) APR_SETIFNULL(CFLAGS, [-DHIUX]) @@ -365,6 +376,7 @@ dnl ;; *beos*) APR_SETIFNULL(CFLAGS, [-DBEOS]) APR_SETIFNULL(file_as_socket, [0]) + APR_SETVAR(APACHE_MPM, [mpmt_beos]) PLATOSVERS=`uname -r` case $PLATOSVERS in 5.1) From 7620f1819dd10f1384bd3757bdc03b1d16a0540c Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 23 Aug 2000 23:28:49 +0000 Subject: [PATCH 0535/7878] We need to test specifically for setrlimit/getrlimit instead of just the structure or the RLIMIT_* defines. Also, we should make the API function unixd_set_rlimit() ``available'' even if it doesn't do anything. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60512 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++++ include/apr.h.in | 2 ++ threadproc/unix/proc.c | 13 +++++++------ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 3843016cacc..19d6b8a4863 100644 --- a/configure.in +++ b/configure.in @@ -215,6 +215,8 @@ dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) AC_CHECK_FUNCS(strcasecmp stricmp setsid nl_langinfo) AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) +AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) +AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) AC_CHECK_FUNCS(writev) sendfile="0" AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ]) @@ -238,6 +240,8 @@ AC_SUBST(fork) AC_SUBST(inet_addr) AC_SUBST(inet_network) AC_SUBST(have_sigaction) +AC_SUBST(have_setrlimit) +AC_SUBST(have_getrlimit) AC_SUBST(iconv) AC_SUBST(mmap) AC_SUBST(have_memmove) diff --git a/include/apr.h.in b/include/apr.h.in index 42e853b9d79..d73b376d787 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -63,6 +63,8 @@ #define APR_HAVE_INET_NETWORK @inet_network@ #define APR_HAVE_UNION_SEMUN @have_union_semun@ #define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@ +#define APR_HAVE_SETRLIMIT @have_setrlimit@ +#define APR_HAVE_GETRLIMIT @have_getrlimit@ #define APR_HAVE_STRICMP @have_stricmp@ #define APR_HAVE_STRNICMP @have_strnicmp@ #define APR_HAVE_STRCASECMP @have_strcasecmp@ diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 62ea3d770d2..6d7d0f5b0db 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -225,10 +225,9 @@ apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) return APR_INPARENT; } -#if APR_HAVE_STRUCT_RLIMIT -#if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) static apr_status_t limit_proc(apr_procattr_t *attr) { +#if APR_HAVE_STRUCT_RLIMIT && APR_HAVE_SETRLIMIT #ifdef RLIMIT_CPU if (attr->limit_cpu != NULL) { if ((setrlimit(RLIMIT_CPU, attr->limit_cpu)) != 0) { @@ -261,11 +260,15 @@ static apr_status_t limit_proc(apr_procattr_t *attr) return errno; } } +#endif +#else + /* + * Maybe make a note in error_log that setrlimit isn't supported?? + */ + #endif return APR_SUCCESS; } -#endif -#endif apr_status_t apr_create_process(apr_proc_t *new, const char *progname, char *const args[], char **env, @@ -310,11 +313,9 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, apr_cleanup_for_exec(); -#if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) if ((status = limit_proc(attr)) != APR_SUCCESS) { return status; } -#endif if (attr->cmdtype == APR_SHELLCMD) { i = 0; From 1ac8dda920e32f7c21839a3cbf93bbb08a77d570 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 26 Aug 2000 09:57:41 +0000 Subject: [PATCH 0536/7878] Adjust the TCP_NODELAY code for the older BeOS stack... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60513 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/sockopt.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/network_io/beos/sockopt.c b/network_io/beos/sockopt.c index 5b09dcac078..d6d3656e622 100644 --- a/network_io/beos/sockopt.c +++ b/network_io/beos/sockopt.c @@ -108,9 +108,17 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o sock->timeout = on; } if (opt & APR_TCP_NODELAY) { - if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { - return errno; - } + /* BeOS pre-BONE has TCP_NODELAY set to ON by default. + * This is a hang over from a long time ago and until BONE there + * is no way to turn it off. Use this information as follows... + * + * on == 0 - return APR_ENOTIMPL + * on == 1 - allow it to return APR_SUCCESS + * + * based on information from Howard Berkey (howard@be.com) + */ + if (! on) + return APR_ENOTIMPL; } return APR_SUCCESS; } From fe16c376118867e6fddaaf864453a322743a8795 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 29 Aug 2000 18:48:45 +0000 Subject: [PATCH 0537/7878] Add apr-sendv using the "I don't have writev" workaround. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60514 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/sendrecv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 46b489e195d..600df667871 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -147,4 +147,14 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) (*len) = rv; return APR_SUCCESS; } + +/* BeOS doesn't have writev for sockets so we use the following instead... + */ +apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, + apr_int32_t nvec, apr_ssize_t *len) +{ + *len = vec[0].iov_len; + return apr_send(sock, vec[0].iov_base, len); +} + #endif From b01c3cbd544da558b9cbb8e7053c387b0b8746b5 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Wed, 30 Aug 2000 01:32:50 +0000 Subject: [PATCH 0538/7878] fix the cache mgmt when configuring a sub-package: this saves work up to the sub-config point, runs the sub-config, then loads whatever the sub-config added to the cached config values. also: allow additional command-line arguments to be pass to the sub-config (this speeds up the ./configure process) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60515 13f79535-47bb-0310-9956-ffa450edef68 --- apr_common.m4 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apr_common.m4 b/apr_common.m4 index ab3fbfbf7f3..dc825d031f4 100644 --- a/apr_common.m4 +++ b/apr_common.m4 @@ -1,4 +1,10 @@ +dnl +dnl RUN_SUBDIR_CONFIG_NOW(dir [, sub-package-cmdline-args]) +dnl AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [ + # save our work to this point; this allows the sub-package to use it + AC_CACHE_SAVE + echo "configuring package in $1 now" ac_popdir=`pwd` ac_abs_srcdir=`(cd $srcdir/$1 && pwd)` @@ -19,8 +25,7 @@ changequote([, ])dnl esac # The eval makes quoting arguments work. - - if eval $ac_abs_srcdir/configure $ac_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir + if eval $ac_abs_srcdir/configure $ac_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $2 then : echo "$1 configured properly" else @@ -28,6 +33,9 @@ changequote([, ])dnl fi cd $ac_popdir + + # grab any updates from the sub-package + AC_CACHE_LOAD ]) dnl dnl REENTRANCY_FLAGS From e852dc8aba1f5a5b8e1963c9107c7bb8755ba2a7 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 31 Aug 2000 20:23:08 +0000 Subject: [PATCH 0539/7878] Switch the order of the dllqueryxxx calls. dllqueryvar is the only one used today (to locate an Apache dso module's module structure), so put it first. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60516 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os390/dso.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dso/os390/dso.c b/dso/os390/dso.c index 6b491a75a62..c9806dcb928 100644 --- a/dso/os390/dso.c +++ b/dso/os390/dso.c @@ -107,14 +107,14 @@ apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, void *func_ptr; void *var_ptr; - if ((func_ptr = (void *)dllqueryfn(handle->handle, symname)) != NULL) { - *ressym = func_ptr; - return APR_SUCCESS; - } if ((var_ptr = dllqueryvar(handle->handle, symname)) != NULL) { *ressym = var_ptr; return APR_SUCCESS; } + if ((func_ptr = (void *)dllqueryfn(handle->handle, symname)) != NULL) { + *ressym = func_ptr; + return APR_SUCCESS; + } handle->failing_errno = errno; return errno; } From 79618baa3921e42a12ed658de46194857e64486d Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 31 Aug 2000 20:38:59 +0000 Subject: [PATCH 0540/7878] Allow dso builds with pthreads enabled to work on platforms which don't have pthread_key_delete (e.g. OS/390). apr_delete_thread_private is currently unused. If/when somebody tries to use apr_delete_thread_private on such a platform, the build will fail and we can deal with the missing OS function then. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60517 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + threadproc/unix/threadpriv.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/configure.in b/configure.in index 19d6b8a4863..b1803f30de2 100644 --- a/configure.in +++ b/configure.in @@ -509,6 +509,7 @@ fi if test "$pthreadh" = "1"; then APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG + AC_CHECK_FUNCS(pthread_key_delete); fi ac_cv_define_READDIR_IS_THREAD_SAFE=no diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 6c02dd13020..72e7dbc01c0 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -99,6 +99,7 @@ apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) } } +#ifdef HAVE_PTHREAD_KEY_DELETE apr_status_t apr_delete_thread_private(apr_threadkey_t *key) { apr_status_t stat; @@ -107,6 +108,7 @@ apr_status_t apr_delete_thread_private(apr_threadkey_t *key) } return stat; } +#endif apr_status_t apr_get_threadkeydata(void **data, const char *key, apr_threadkey_t *threadkey) From 6ffd09023a6c83bb28940ae1d547259577d66df1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 1 Sep 2000 00:13:33 +0000 Subject: [PATCH 0541/7878] Get rid of dangling semicolon in check for pthread_key_delete(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60518 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index b1803f30de2..765a59fe56b 100644 --- a/configure.in +++ b/configure.in @@ -509,7 +509,7 @@ fi if test "$pthreadh" = "1"; then APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG - AC_CHECK_FUNCS(pthread_key_delete); + AC_CHECK_FUNCS(pthread_key_delete) fi ac_cv_define_READDIR_IS_THREAD_SAFE=no From 1600951decb8761314fd1930a5083cf7b92fb257 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 1 Sep 2000 14:17:39 +0000 Subject: [PATCH 0542/7878] Current implementation of lib/apr/Makefile.in causes rebuilding libapr.a at "make install" stage even if libapr.a is up to date after "make all" stage. It seems this patch is required to fix that behavior. Submitted by: Jun Kuriyama Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60519 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index b8f8f271a72..9703bb9c657 100644 --- a/Makefile.in +++ b/Makefile.in @@ -42,7 +42,9 @@ LIBAPR = @LIBPREFIX@apr.a # all: Makefile $(LIBAPR) -$(LIBAPR): $(MODULES) subdirs +$(MODULES): subdirs + +$(LIBAPR): $(MODULES) @rm -rf objs @mkdir objs @rm -f $@ From 48d10ceccf07fdc4ca381538c817a8df7a546d9b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 1 Sep 2000 14:46:23 +0000 Subject: [PATCH 0543/7878] Add support for OS/390 to APR's config.sub and config.guess. TPF and VM/CMS came along for the ride. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60520 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/config.guess | 3 +++ helpers/config.sub | 26 ++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/helpers/config.guess b/helpers/config.guess index 19b0a0a7182..a58889d62b6 100755 --- a/helpers/config.guess +++ b/helpers/config.guess @@ -354,6 +354,9 @@ EOF *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; + *:OS390:*:* | *:OS/390:*:*) + echo s390-ibm-os390 + exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' diff --git a/helpers/config.sub b/helpers/config.sub index 8e7cdd62ce4..19c7337e472 100755 --- a/helpers/config.sub +++ b/helpers/config.sub @@ -72,6 +72,14 @@ case $maybe_os in os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + tpf | os390 | vmcms) + os=-$maybe_os + basic_machine=s390; + ;; + mvs) + os=-mvs + basic_machine=i370; + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -654,6 +662,9 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; + s390*) + basic_machine=s390-ibm + ;; sequent) basic_machine=i386-sequent ;; @@ -910,7 +921,8 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*) + | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit* \ + | -tpf* | -os390* | -vmcms* ) # Remember, each alternative MUST END IN *, to match a version number. ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ @@ -1058,7 +1070,17 @@ case $basic_machine in os=-beos ;; *-ibm) - os=-aix + case $basic_machine in + s390*) + os=-os390; + ;; + i370*) + os=-mvs; + ;; + *) + os=-aix + ;; + esac ;; *-wec) os=-proelf From e4fb2a943ec5fd5e24ec8e1bc34ceb0cc1ce26ef Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 6 Sep 2000 14:02:32 +0000 Subject: [PATCH 0544/7878] Fix the ScanDoc output on IE. I don't have IE, so I can't test this, but it looks correct, and this problem has been submitted to me multiple times PR: 6501 Submitted by: Shuichi Kitaguchi Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60521 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/default.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/default.pl b/helpers/default.pl index 6a45159c400..e11aee7d046 100644 --- a/helpers/default.pl +++ b/helpers/default.pl @@ -31,7 +31,7 @@ $project_name - + From 9c197c52ca9ad7c2fd83ffbb061736ab65f0e1e1 Mon Sep 17 00:00:00 2001 From: Tony Finch <fanf@apache.org> Date: Sat, 9 Sep 2000 01:11:14 +0000 Subject: [PATCH 0545/7878] Fix inserting elements at the head and tail of a ring when the ring is empty. Avoiding referring to the element type in the macros resulted in some double dereferences that did the wrong thing. Reported by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60522 13f79535-47bb-0310-9956-ffa450edef68 --- lib/Makefile.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Makefile.in b/lib/Makefile.in index ba267968b16..a9e96d5b020 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -58,3 +58,8 @@ apr_pools.o: apr_pools.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_dso.h $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h ../misc/unix/misc.h \ $(INCDIR)/apr_getopt.h +apr_signal.o: apr_signal.c $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h From 0acc8e90591b6606f1a85174322d4761f8b36f91 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sat, 9 Sep 2000 02:19:15 +0000 Subject: [PATCH 0546/7878] this was deleted on April 14th, but got resuscitated somehow git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60523 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/threadcancel.c | 114 --------------------------------- 1 file changed, 114 deletions(-) delete mode 100644 threadproc/unix/threadcancel.c diff --git a/threadproc/unix/threadcancel.c b/threadproc/unix/threadcancel.c deleted file mode 100644 index 81e3d3e7cd5..00000000000 --- a/threadproc/unix/threadcancel.c +++ /dev/null @@ -1,114 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "threadproc.h" -#if APR_HAS_THREADS - -#ifdef HAVE_PTHREAD_H - -#if 0 /* some platforms, e.g. FreeBSD 2.2.8, do not have pthread_cancel (they do have an undocumented pthread_kill, though) */ -/* ***APRDOC******************************************************** - * ap_status_t ap_cancel_thread(ap_thread_t *thd) - * Asynchronously kill a thread - * arg 1) The thread to kill. - */ -ap_status_t ap_cancel_thread(ap_thread_t *thd) -{ - ap_status_t stat; - if ((stat = pthread_cancel(*thd->td)) == 0) { - return APR_SUCCESS; - } - else { - return stat; - } -} -#endif - -/* ***APRDOC******************************************************** - * ap_status_t ap_setcanceltype(ap_int32_t type, ap_pool_t *cont) - * Determine how threads are cancelable. - * arg 1) how are threads cancelable. One of: - * APR_CANCEL_ASYNCH -- cancel it no matter where it is - * APR_CANCEL_DEFER -- only cancel the thread if it is safe. - * arg 2) The context to operate on - */ -ap_status_t ap_setcanceltype(ap_int32_t type, ap_pool_t *cont) -{ - ap_status_t stat; - if ((stat = pthread_setcanceltype(type, NULL)) == 0) { - return APR_SUCCESS; - } - else { - return stat; - } -} - -/* ***APRDOC******************************************************** - * ap_status_t ap_setcancelstate(ap_int32_t type, ap_pool_t *cont) - * Determine if threads will be cancelable. - * arg 1) Are threads cancelable. - * arg 2) The context to operate on - */ -ap_status_t ap_setcancelstate(ap_int32_t type, ap_pool_t *cont) -{ - ap_status_t stat; - if ((stat = pthread_setcanceltype(type, NULL)) == 0) { - return APR_SUCCESS; - } - else { - return stat; - } -} -#endif -#endif From 665bd37bf1651e53f1579e7f6636d67213278a60 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 10 Sep 2000 22:07:15 +0000 Subject: [PATCH 0547/7878] APRVARS.in was overwriting EXTRA_LIBS. This stops that behavior. PR: 6463 Submitted by: Mike Abbott <mja@sgi.com> Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60524 13f79535-47bb-0310-9956-ffa450edef68 --- APRVARS.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APRVARS.in b/APRVARS.in index 039ac16854b..8f4f53ca5b5 100644 --- a/APRVARS.in +++ b/APRVARS.in @@ -1 +1 @@ -EXTRA_LIBS="@LIBS@" +EXTRA_LIBS="$EXTRA_LIBS @LIBS@" From b736bd665a399d2d6896ef81a0cb18dbb4a38706 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 11 Sep 2000 18:27:58 +0000 Subject: [PATCH 0548/7878] apr_put_os_file() now sets up the unget byte appropriately on Unix and Win32. Previously, the first read from an apr_file_t set up via apr_put_os_file() would return a '\0'. The recent mod_cgid updates exposed this problem with the use of apr_fgets() on a "file" created via apr_put_os_file(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60525 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 3 ++- file_io/win32/open.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 199c2ae7592..5060b77fcbc 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -216,7 +216,7 @@ apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) } apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, - apr_pool_t *cont) + apr_pool_t *cont) { int *dafile = thefile; @@ -228,6 +228,7 @@ apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, (*file)->buffered = 0; (*file)->blocking = BLK_UNKNOWN; /* in case it is a pipe */ (*file)->timeout = -1; + (*file)->ungetchar = -1; /* no char avail */ (*file)->filedes = *dafile; /* buffer already NULL; * don't get a lock (only for buffered files) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index b303465b56d..01d6eee5c5b 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -245,7 +245,7 @@ apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) } apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, - apr_pool_t *cont) + apr_pool_t *cont) { if ((*file) == NULL) { if (cont == NULL) { @@ -255,6 +255,7 @@ apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, (*file)->cntxt = cont; } (*file)->filehand = *thefile; + (*file)->ungetchar = -1; /* no char avail */ return APR_SUCCESS; } From c450e5510bcf88cb32cdf184ea1e6c903804d672 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 12 Sep 2000 23:15:36 +0000 Subject: [PATCH 0549/7878] apr_putc(), apr_puts() for Unix: handle buffered files and interrupted writes. apr_flush() for Unix: handle interrupted writes. A test program was modified to drive apr_putc() and apr_puts() on buffered files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60526 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 33 +++++++++++++-------------------- test/testsf.c | 24 +++++++++++++++++------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index f013f0f89e1..e5addd0e444 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -298,10 +298,9 @@ apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_status_t apr_putc(char ch, apr_file_t *thefile) { - if (write(thefile->filedes, &ch, 1) != 1) { - return errno; - } - return APR_SUCCESS; + apr_ssize_t nbytes = 1; + + return apr_write(thefile, &ch, &nbytes); } apr_status_t apr_ungetc(char ch, apr_file_t *thefile) @@ -319,32 +318,26 @@ apr_status_t apr_getc(char *ch, apr_file_t *thefile) apr_status_t apr_puts(const char *str, apr_file_t *thefile) { - ssize_t rv; - int len; + apr_ssize_t nbytes = strlen(str); - len = strlen(str); - rv = write(thefile->filedes, str, len); - if (rv != len) { - return errno; - } - return APR_SUCCESS; + return apr_write(thefile, str, &nbytes); } apr_status_t apr_flush(apr_file_t *thefile) { if (thefile->buffered) { apr_int64_t written = 0; - int rc = 0; if (thefile->direction == 1 && thefile->bufpos) { - written= write(thefile->filedes, thefile->buffer, thefile->bufpos); + do { + written = write(thefile->filedes, thefile->buffer, thefile->bufpos); + } while (written == (apr_int64_t)-1 && errno == EINTR); + if (written == (apr_int64_t)-1) { + return errno; + } thefile->filePtr += written; - - if (rc == 0) - thefile->bufpos = 0; + thefile->bufpos = 0; } - - return rc; } /* There isn't anything to do if we aren't buffering the output * so just return success. @@ -385,7 +378,7 @@ apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) { - int cc; + apr_status_t cc; va_list ap; char *buf; int len; diff --git a/test/testsf.c b/test/testsf.c index cde32bf8344..6f7d5f26a63 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -129,7 +129,6 @@ static void create_testfile(apr_pool_t *p, const char *fname) apr_status_t rv; char buf[120]; int i; - apr_ssize_t nbytes; apr_finfo_t finfo; printf("Creating a test file...\n"); @@ -143,13 +142,24 @@ static void create_testfile(apr_pool_t *p, const char *fname) } buf[0] = FILE_DATA_CHAR; + buf[1] = '\0'; for (i = 0; i < FILE_LENGTH; i++) { - nbytes = 1; - rv = apr_write(f, buf, &nbytes); - if (rv) { - fprintf(stderr, "apr_write()->%d/%s\n", - rv, apr_strerror(rv, buf, sizeof buf)); - exit(1); + /* exercise apr_putc() and apr_puts() on buffered files */ + if ((i % 2) == 0) { + rv = apr_putc(buf[0], f); + if (rv) { + fprintf(stderr, "apr_putc()->%d/%s\n", + rv, apr_strerror(rv, buf, sizeof buf)); + exit(1); + } + } + else { + rv = apr_puts(buf, f); + if (rv) { + fprintf(stderr, "apr_puts()->%d/%s\n", + rv, apr_strerror(rv, buf, sizeof buf)); + exit(1); + } } } From aa718d105a99257107d1937a029b404dbfb4a93b Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Wed, 13 Sep 2000 04:35:22 +0000 Subject: [PATCH 0550/7878] Fix some docs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60527 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_dso.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_dso.h b/include/apr_dso.h index 07cf2c71676..f85964cb037 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -95,9 +95,9 @@ apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, /** * Report more information when a DSO function fails. - * @param dso Location to store the loaded symbol - * @param buf handle to load from. - * @param bufsize Name of the symbol to load. + * @param dso The dso handle that has been opened + * @param buf Location to store the dso error + * @param bufsize The size of the provided buffer */ const char *apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize); From 0cfe6f831bd0419280019446a1cb62a2d5d12a79 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 13 Sep 2000 20:13:26 +0000 Subject: [PATCH 0551/7878] Back out previous change, which attempted to minimize rebuilding libapr.a. Unfortunately, libapr.a didn't get built at all times when it needed to be built (e.g., normal APR source file modification). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60528 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 9703bb9c657..b8f8f271a72 100644 --- a/Makefile.in +++ b/Makefile.in @@ -42,9 +42,7 @@ LIBAPR = @LIBPREFIX@apr.a # all: Makefile $(LIBAPR) -$(MODULES): subdirs - -$(LIBAPR): $(MODULES) +$(LIBAPR): $(MODULES) subdirs @rm -rf objs @mkdir objs @rm -f $@ From 831dbf9a8534287c411dfab990f33c881062650a Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 13 Sep 2000 20:20:17 +0000 Subject: [PATCH 0552/7878] apr_snprintf(): Get quad format strings working on OS/390 (and perhaps some other platforms). The wrong type (long) was used when grabbing a %q(x|d) argument. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60529 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 9e826938dbf..30648e7daa2 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -90,21 +90,17 @@ typedef enum { #ifndef TRUE #define TRUE 1 #endif -#ifndef APR_LONGEST_LONG -#define APR_LONGEST_LONG long -#endif #define NUL '\0' #define WIDE_INT long -#define WIDEST_INT APR_LONGEST_LONG typedef WIDE_INT wide_int; typedef unsigned WIDE_INT u_wide_int; -typedef WIDEST_INT widest_int; +typedef apr_int64_t widest_int; #ifdef __TANDEM /* Although Tandem supports "long long" there is no unsigned variant. */ typedef unsigned long u_widest_int; #else -typedef unsigned WIDEST_INT u_widest_int; +typedef apr_uint64_t u_widest_int; #endif typedef int bool_int; From ad3f01ba73a855f4d590e1f2bc1306d1e6fb5f73 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Fri, 15 Sep 2000 14:52:51 +0000 Subject: [PATCH 0553/7878] Update the hints.m4 file for which MPM to use. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60530 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hints.m4 b/hints.m4 index da8b3642e1c..301498b8aa3 100644 --- a/hints.m4 +++ b/hints.m4 @@ -379,11 +379,12 @@ dnl ;; APR_SETVAR(APACHE_MPM, [mpmt_beos]) PLATOSVERS=`uname -r` case $PLATOSVERS in - 5.1) - APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) - APR_ADDTO(LDFLAGS, [-nodefaultlibs -L/boot/develop/lib/x86 -L/boot/beos/system/lib]) - APR_SETIFNULL(EXTRA_LIBS, [-lbind -lsocket -lbe -lroot]) - ;; + 5.1) + APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) + APR_ADDTO(LDFLAGS, [-nodefaultlibs -L/boot/develop/lib/x86 -L/boot/beos/system/lib]) + APR_SETIFNULL(EXTRA_LIBS, [-lbind -lsocket -lbe -lroot]) + APR_SETVAR(APACHE_MPM, [beos]) + ;; esac ;; 4850-*.*) From bc53a87baa389957b5cb12b1e420ad7b5d5202e2 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Fri, 15 Sep 2000 16:28:17 +0000 Subject: [PATCH 0554/7878] Namespace protection for this allows the in_addr and gethostbyname tests to work for BONE BeOS. Strange but true! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60531 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 765a59fe56b..e13accb3dde 100644 --- a/configure.in +++ b/configure.in @@ -599,7 +599,7 @@ if test "$threads" = "1"; then AC_DEFINE(USE_PTHREAD_SERIALIZE) pthreadser="1" ]) fi -AC_BEGIN_DECISION([lock implementation method]) +AC_BEGIN_DECISION([ap_lock implementation method]) AC_IFALLYES(custom:union_semun, AC_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) AC_IFALLYES(header:sys/file.h define:LOCK_EX, From 9272b8a10318153f77ff0ba6d4d2a4035e195a8d Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 15 Sep 2000 21:07:34 +0000 Subject: [PATCH 0555/7878] Fix a bug in apr_create_process() for Unix. The NULL signifying the end of the parameters to execve() was stored in the wrong location, overlaying the storage beyond the newargs[] array and also passing uninitialized storage to execve(), which would sometimes fail with EFAULT. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60532 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 6d7d0f5b0db..5d21eeb02a7 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -331,7 +331,7 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, newargs[i + 2] = args[i]; i++; } - newargs[i + 3] = NULL; + newargs[i + 2] = NULL; if (attr->detached) { apr_detach(); } From fefa2f89fa34f55dad0d2c4eacb0d1f39dd75e89 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 16 Sep 2000 09:45:06 +0000 Subject: [PATCH 0556/7878] More changes to BeOS hints. Tidy up and set files as sockets correctly... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60533 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hints.m4 b/hints.m4 index 301498b8aa3..085f91bcbb6 100644 --- a/hints.m4 +++ b/hints.m4 @@ -374,16 +374,19 @@ dnl ;; APR_SETIFNULL(MAKE, [make]) ;; *beos*) - APR_SETIFNULL(CFLAGS, [-DBEOS]) - APR_SETIFNULL(file_as_socket, [0]) - APR_SETVAR(APACHE_MPM, [mpmt_beos]) - PLATOSVERS=`uname -r` - case $PLATOSVERS in + APR_SETIFNULL(CFLAGS, [-DBEOS]) + PLATOSVERS=`uname -r` + case $PLATOSVERS in 5.1) APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) APR_ADDTO(LDFLAGS, [-nodefaultlibs -L/boot/develop/lib/x86 -L/boot/beos/system/lib]) APR_SETIFNULL(EXTRA_LIBS, [-lbind -lsocket -lbe -lroot]) APR_SETVAR(APACHE_MPM, [beos]) + APR_SETIFNULL(file_as_socket, [1]) + ;; + default) + APR_SETIFNULL(file_as_socket, [0]) + APR_SETVAR(APACHE_MPM, [mpmt_beos]) ;; esac ;; From 184b18600eb7ea3a5fdc73e0937dfef8a4c1bb43 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 16 Sep 2000 10:19:19 +0000 Subject: [PATCH 0557/7878] Add some .cvsignore goodness... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60534 13f79535-47bb-0310-9956-ffa450edef68 --- dso/beos/.cvsignore | 2 ++ locks/beos/.cvsignore | 1 + network_io/beos/.cvsignore | 1 + threadproc/beos/.cvsignore | 2 ++ 4 files changed, 6 insertions(+) create mode 100644 dso/beos/.cvsignore create mode 100644 locks/beos/.cvsignore create mode 100644 network_io/beos/.cvsignore create mode 100644 threadproc/beos/.cvsignore diff --git a/dso/beos/.cvsignore b/dso/beos/.cvsignore new file mode 100644 index 00000000000..550bd25cdba --- /dev/null +++ b/dso/beos/.cvsignore @@ -0,0 +1,2 @@ +Makefile + diff --git a/locks/beos/.cvsignore b/locks/beos/.cvsignore new file mode 100644 index 00000000000..f3c7a7c5da6 --- /dev/null +++ b/locks/beos/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/network_io/beos/.cvsignore b/network_io/beos/.cvsignore new file mode 100644 index 00000000000..f3c7a7c5da6 --- /dev/null +++ b/network_io/beos/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/threadproc/beos/.cvsignore b/threadproc/beos/.cvsignore new file mode 100644 index 00000000000..caadabea819 --- /dev/null +++ b/threadproc/beos/.cvsignore @@ -0,0 +1,2 @@ +Makefile +apr_proc_stub From b2df96786e0a0ce0bf63236481ed0d3f96230b4b Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sun, 17 Sep 2000 21:42:10 +0000 Subject: [PATCH 0558/7878] This changes the way we check for inet_addr and inet_network. The new tests allow BeOS BONE to work and shouldn't create any problems on other platforms. Also a little bit of a consistency improvements with the variable names we use. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60535 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 8 ++++---- include/apr.h.in | 4 ++-- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 23db8b20dfd..204ae3b9585 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -273,5 +273,55 @@ if test -n "$USE_MM" && test -n "$USE_VPATH"; then fi ]) +AC_DEFUN(APR_CHECK_INET_ADDR,[ +AC_CACHE_CHECK(for inet_addr, ac_cv_func_inet_addr,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif +],[ +inet_addr("127.0.0.1"); +],[ + ac_cv_func_inet_addr=yes +],[ + ac_cv_func_inet_addr=no +]) +]) + +if test "$ac_cv_func_inet_addr" = "yes"; then + have_inet_addr=1 +else + have_inet_addr=0 +fi +]) + +AC_DEFUN(APR_CHECK_INET_NETWORK,[ +AC_CACHE_CHECK(for inet_network, ac_cv_func_inet_network,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif +],[ +inet_network("127.0.0.1"); +],[ + ac_cv_func_inet_network=yes +],[ + ac_cv_func_inet_network=no +]) +]) + +if test "$ac_cv_func_inet_network" = "yes"; then + have_inet_network=1 +else + have_inet_network=0 +fi +]) + sinclude(apr_common.m4) sinclude(hints.m4) diff --git a/configure.in b/configure.in index e13accb3dde..335c7b8460d 100644 --- a/configure.in +++ b/configure.in @@ -222,8 +222,8 @@ sendfile="0" AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ]) AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ]) AC_CHECK_FUNCS(getpass) -AC_CHECK_FUNC(inet_addr, [ inet_addr="1" ], [ inet_addr="0" ]) -AC_CHECK_FUNC(inet_network, [ inet_network="1" ], [ inet_network="0" ]) +APR_CHECK_INET_ADDR +APR_CHECK_INET_NETWORK AC_CHECK_FUNC(_getch) AC_CHECK_FUNCS(gmtime_r localtime_r) AC_CHECK_FUNCS(iconv, [ iconv="1" ], [ iconv="0" ]) @@ -237,8 +237,8 @@ AC_CHECK_FUNCS(bzero, [ have_bzero="1" ], [ have_bzero="0"] ) AC_SUBST(sendfile) AC_SUBST(fork) -AC_SUBST(inet_addr) -AC_SUBST(inet_network) +AC_SUBST(have_inet_addr) +AC_SUBST(have_inet_network) AC_SUBST(have_sigaction) AC_SUBST(have_setrlimit) AC_SUBST(have_getrlimit) diff --git a/include/apr.h.in b/include/apr.h.in index d73b376d787..a8416933f64 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -59,8 +59,8 @@ #define APR_MEM_BASED_SHM @mem_based@ #define APR_HAVE_IN_ADDR @have_in_addr@ -#define APR_HAVE_INET_ADDR @inet_addr@ -#define APR_HAVE_INET_NETWORK @inet_network@ +#define APR_HAVE_INET_ADDR @have_inet_addr@ +#define APR_HAVE_INET_NETWORK @have_inet_network@ #define APR_HAVE_UNION_SEMUN @have_union_semun@ #define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@ #define APR_HAVE_SETRLIMIT @have_setrlimit@ From 88ebed41cf055d7dfe2bd047f0b2c11914d677f2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 20 Sep 2000 14:55:54 +0000 Subject: [PATCH 0559/7878] Clean up a potential leak. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60536 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/rand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 2462b997353..aad32327efc 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -64,7 +64,9 @@ apr_status_t apr_generate_random_bytes(unsigned char * buf, int length) return GetLastError(); } if (!CryptGenRandom(hProv,length,buf)) { - return GetLastError(); + CryptReleaseContext(hProv, 0); + return GetLastError(); } + CryptReleaseContext(hProv, 0); return APR_SUCCESS; } From 78c7f820ca1eeb88e84377803ba9c3709fd9d98b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 20 Sep 2000 15:37:52 +0000 Subject: [PATCH 0560/7878] Thanks Jeff. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60537 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/rand.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/win32/rand.c b/misc/win32/rand.c index aad32327efc..0f124fdfc61 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -59,14 +59,14 @@ apr_status_t apr_generate_random_bytes(unsigned char * buf, int length) { HCRYPTPROV hProv; + apr_status_t res = APR_SUCCESS; if (!CryptAcquireContext(&hProv,NULL,NULL,PROV_RSA_FULL,0)) { return GetLastError(); } if (!CryptGenRandom(hProv,length,buf)) { - CryptReleaseContext(hProv, 0); - return GetLastError(); + res = GetLastError(); } CryptReleaseContext(hProv, 0); - return APR_SUCCESS; + return res; } From 0a963b70096f413f68ab74c2f14caca771d63798 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 22 Sep 2000 11:37:07 +0000 Subject: [PATCH 0561/7878] Provide a socklen_t to the user of APR as a portability aid. Some systems have unsigned sockaddr len parameters; others have signed. When passing the length by address (as to accept()) a warning is generated if the sign is not correct. This patch assumes that, if no native socklen_t is provided, apr_socklen_t is always signed; that can be easily tweaked for certain platforms later. Inside APR, apr_socklen_t is only used currently in the Unix implementation. Submitted by: Victor J. Orlikowski <v.j.orlikowski@gte.net> Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60538 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 4 ---- configure.in | 9 ++++++++- include/apr.h.in | 6 ++++++ include/apr.hw | 1 + include/arch/unix/networkio.h | 2 +- network_io/unix/networkio.h | 2 +- network_io/unix/sendrecv.c | 2 +- network_io/unix/sockaddr.c | 2 +- 8 files changed, 19 insertions(+), 9 deletions(-) diff --git a/acconfig.h b/acconfig.h index 8c840451414..e0d77f038c5 100644 --- a/acconfig.h +++ b/acconfig.h @@ -41,10 +41,6 @@ /* Make sure we have ssize_t defined to be something */ #undef ssize_t -#if !defined(HAVE_SOCKLEN_T) -typedef int socklen_t; -#endif - /* switch this on if we have a BeOS version below BONE */ #if BEOS && !HAVE_BONE_VERSION #define BEOS_R5 1 diff --git a/configure.in b/configure.in index 335c7b8460d..35c1d44d1c5 100644 --- a/configure.in +++ b/configure.in @@ -296,7 +296,7 @@ AC_CHECK_HEADERS(sys/resource.h) AC_CHECK_HEADERS(sys/select.h) AC_CHECK_HEADERS(sys/sendfile.h) AC_CHECK_HEADERS(sys/signal.h) -AC_CHECK_HEADERS(sys/socket.h) +AC_CHECK_HEADERS(sys/socket.h, sys_socketh="1", sys_socketh="0") AC_CHECK_HEADERS(sys/stat.h) AC_CHECK_HEADERS(sys/types.h, sys_typesh="1", sys_typesh="0") AC_CHECK_HEADERS(sys/wait.h, sys_waith="1", sys_waith="0") @@ -312,6 +312,7 @@ AC_SUBST(fcntlh) AC_SUBST(netinet_inh) AC_SUBST(stdargh) AC_SUBST(stdioh) +AC_SUBST(sys_socketh) AC_SUBST(sys_typesh) AC_SUBST(sys_uioh) AC_SUBST(signalh) @@ -377,6 +378,11 @@ if test "$ac_cv_type_ssize_t" = "yes"; then else ssize_t_value="apr_int32_t" fi +if test "$ac_cv_socklen_t" = "yes"; then + socklen_t_value="socklen_t" +else + socklen_t_value="int" +fi AC_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8) @@ -415,6 +421,7 @@ AC_SUBST(long_value) AC_SUBST(off_t_value) AC_SUBST(size_t_value) AC_SUBST(ssize_t_value) +AC_SUBST(socklen_t_value) AC_SUBST(ssize_t_fmt) AC_SUBST(off_t_fmt) diff --git a/include/apr.h.in b/include/apr.h.in index a8416933f64..9b55fac8986 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -32,6 +32,7 @@ #define APR_HAVE_PTHREAD_H @pthreadh@ #define APR_HAVE_STDARG_H @stdargh@ #define APR_HAVE_STDIO_H @stdioh@ +#define APR_HAVE_SYS_SOCKET_H @sys_socketh@ #define APR_HAVE_SYS_TYPES_H @sys_typesh@ #define APR_HAVE_SYS_UIO_H @sys_uioh@ #define APR_HAVE_SIGNAL_H @signalh@ @@ -78,6 +79,10 @@ #include <sys/types.h> #endif +#if APR_HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif + /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY @sharedmem@ #define APR_HAS_THREADS @threads@ @@ -113,6 +118,7 @@ typedef unsigned @long_value@ apr_uint64_t; typedef @size_t_value@ apr_size_t; typedef @ssize_t_value@ apr_ssize_t; typedef @off_t_value@ apr_off_t; +typedef @socklen_t_value@ apr_socklen_t; /* Definitions that APR programs need to work properly. */ diff --git a/include/apr.hw b/include/apr.hw index 2e151108bea..974a56a6b20 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -166,6 +166,7 @@ typedef unsigned __int64 apr_uint64_t; typedef int apr_size_t; typedef int apr_ssize_t; typedef _off_t apr_off_t; +typedef size_t apr_socklen_t; typedef int pid_t; typedef int uid_t; typedef int gid_t; diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 90868b06da0..84c8b4a81ea 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -121,7 +121,7 @@ struct apr_socket_t { int socketdes; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; - socklen_t addr_len; + apr_socklen_t addr_len; apr_interval_time_t timeout; #ifndef HAVE_POLL int connected; diff --git a/network_io/unix/networkio.h b/network_io/unix/networkio.h index 90868b06da0..84c8b4a81ea 100644 --- a/network_io/unix/networkio.h +++ b/network_io/unix/networkio.h @@ -121,7 +121,7 @@ struct apr_socket_t { int socketdes; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; - socklen_t addr_len; + apr_socklen_t addr_len; apr_interval_time_t timeout; #ifndef HAVE_POLL int connected; diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index ad22eb53f75..9c145dce936 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -224,7 +224,7 @@ static int os_cork(apr_socket_t *sock) /* Linux only for now */ int nodelay_off = 0, corkflag = 1, rv, delayflag; - socklen_t delaylen = sizeof(delayflag); + apr_socklen_t delaylen = sizeof(delayflag); /* XXX it would be cheaper to use an apr_socket_t flag here */ rv = getsockopt(sock->socketdes, SOL_TCP, TCP_NODELAY, diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index bce1053ff0f..08489a567c0 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -73,7 +73,7 @@ apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_uint32_t port) static apr_status_t get_local_addr(apr_socket_t *sock) { - socklen_t namelen = sizeof(*sock->local_addr); + apr_socklen_t namelen = sizeof(*sock->local_addr); if (getsockname(sock->socketdes, (struct sockaddr *)sock->local_addr, &namelen) < 0) { From ceeb3de4399261d00d0a44cc4b7861da7b87726a Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 28 Sep 2000 14:59:33 +0000 Subject: [PATCH 0562/7878] Fix a few misspellings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60539 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 57f847c8eaf..c35055078f3 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -276,7 +276,7 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, * @param parent_in apr_file_t value to use as parent_in. Must be a valid file. * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) - * that you wish to use, perhaps persistently across mutiple + * that you wish to use, perhaps persistently across multiple * process invocations - such as a log file. You can save some * extra function calls by not creating your own pipe since this * creates one in the process space for you. @@ -291,7 +291,7 @@ apr_status_t apr_setprocattr_childin(struct apr_procattr_t *attr, apr_file_t *ch * @param parent_out apr_file_t value to use as parent_out. Must be a valid file. * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) - * that you wish to use, perhaps persistently across mutiple + * that you wish to use, perhaps persistently across multiple * process invocations - such as a log file. */ apr_status_t apr_setprocattr_childout(struct apr_procattr_t *attr, @@ -305,7 +305,7 @@ apr_status_t apr_setprocattr_childout(struct apr_procattr_t *attr, * @param parent_err apr_file_t value to use as parent_err. Must be a valid file. * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) - * that you wish to use, perhaps persistently across mutiple + * that you wish to use, perhaps persistently across multiple * process invocations - such as a log file. */ apr_status_t apr_setprocattr_childerr(struct apr_procattr_t *attr, From b970b929d164f7f1087c1b7efccf0ce6f28495e2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 29 Sep 2000 04:03:20 +0000 Subject: [PATCH 0563/7878] Some systems have poll.h in include/sys, not include. I found this problem on non-glibc linux machines. This patch solves the problem. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60540 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + include/arch/unix/networkio.h | 3 +++ network_io/unix/networkio.h | 3 +++ 3 files changed, 7 insertions(+) diff --git a/configure.in b/configure.in index 35c1d44d1c5..e3ec8179fec 100644 --- a/configure.in +++ b/configure.in @@ -283,6 +283,7 @@ AC_CHECK_HEADERS(tpfio.h) AC_CHECK_HEADERS(sys/uio.h, sys_uioh="1", sys_uioh="0") AC_CHECK_HEADERS(unistd.h) AC_CHECK_HEADERS(poll.h) +AC_CHECK_HEADERS(sys/poll.h) AC_CHECK_HEADERS(unix.h) AC_CHECK_HEADERS(arpa/inet.h) AC_CHECK_HEADERS(netinet/in.h, netinet_inh="1", netinet_inh="0") diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 84c8b4a81ea..3fdc52e2ac3 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -69,6 +69,9 @@ #if APR_HAVE_SYS_UIO_H #include <sys/uio.h> #endif +#if HAVE_SYS_POLL_H +#include <sys/poll.h> +#endif #if HAVE_POLL_H #include <poll.h> #endif diff --git a/network_io/unix/networkio.h b/network_io/unix/networkio.h index 84c8b4a81ea..3fdc52e2ac3 100644 --- a/network_io/unix/networkio.h +++ b/network_io/unix/networkio.h @@ -69,6 +69,9 @@ #if APR_HAVE_SYS_UIO_H #include <sys/uio.h> #endif +#if HAVE_SYS_POLL_H +#include <sys/poll.h> +#endif #if HAVE_POLL_H #include <poll.h> #endif From 5fa9139fd9827fb3e3afa98fb4ca6667b2d3135f Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 29 Sep 2000 04:26:24 +0000 Subject: [PATCH 0564/7878] Add to the check for POLLIN. If poll.h is found in include/sys not include, then we need to check for POLLIN in include/sys/poll.h. Rather than modify an existing test, I have created a new test to look for a definition in multiple header files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60541 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 16 ++++++++++++++++ configure.in | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index 204ae3b9585..906218447a0 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -10,6 +10,22 @@ fi dnl ## dnl ## dnl ## +AC_DEFUN(AC_CHECK_DEFINE_FILES,[ + AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ + AC_EGREP_CPP(YES_IS_DEFINED, [ + $2 + #ifdef $1 + YES_IS_DEFINED + #endif + ], ac_cv_define_$1=yes, ac_cv_define_$1=no) + ]) + if test "$ac_cv_define_$1" = "yes"; then + AC_DEFINE(HAVE_$1) + fi +]) +dnl ## +dnl ## +dnl ## AC_DEFUN(AC_CHECK_DEFINE,[ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ AC_EGREP_CPP(YES_IS_DEFINED, [ diff --git a/configure.in b/configure.in index e3ec8179fec..b5f3633d1f1 100644 --- a/configure.in +++ b/configure.in @@ -598,7 +598,9 @@ AC_CHECK_DEFINE(CODESET, langinfo.h) AC_CHECK_DEFINE(isascii, ctype.h) # We are assuming that if the platform doesn't have POLLIN, it doesn't have # any POLL definitions. -AC_CHECK_DEFINE(POLLIN, poll.h) +AC_CHECK_DEFINE_FILES(POLLIN, [ +#include <poll.h> +#include <sys/poll.h> ] ) pthreadser="0" if test "$threads" = "1"; then From 0c80b9c2439ca4054262052c495f562031200046 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 29 Sep 2000 19:32:20 +0000 Subject: [PATCH 0565/7878] Avoid a bad shell command in the expansion of AC_CHECK_DEFINE_FILES. This change to AC_CHECK_DEFINE_FILES allows lib/apr/configure to work at all on FreeBSD 3.4 and stops creating silly files AC_FD_MSG and AC_FD_CC when /bin/sh is bash 1.14 on Linux. (Certainly other systems and/or other versions of bash are expected to have one of the bad symptoms.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60542 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 16 ++++++++++------ configure.in | 4 +--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 906218447a0..104638d8397 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -12,12 +12,16 @@ dnl ## dnl ## AC_DEFUN(AC_CHECK_DEFINE_FILES,[ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ - AC_EGREP_CPP(YES_IS_DEFINED, [ - $2 - #ifdef $1 - YES_IS_DEFINED - #endif - ], ac_cv_define_$1=yes, ac_cv_define_$1=no) + ac_cv_define_$1=no + for curhdr in $2 + do + AC_EGREP_CPP(YES_IS_DEFINED, [ + #include <$curhdr> + #ifdef $1 + YES_IS_DEFINED + #endif + ], ac_cv_define_$1=yes) + done ]) if test "$ac_cv_define_$1" = "yes"; then AC_DEFINE(HAVE_$1) diff --git a/configure.in b/configure.in index b5f3633d1f1..7afd17b88f2 100644 --- a/configure.in +++ b/configure.in @@ -598,9 +598,7 @@ AC_CHECK_DEFINE(CODESET, langinfo.h) AC_CHECK_DEFINE(isascii, ctype.h) # We are assuming that if the platform doesn't have POLLIN, it doesn't have # any POLL definitions. -AC_CHECK_DEFINE_FILES(POLLIN, [ -#include <poll.h> -#include <sys/poll.h> ] ) +AC_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h) pthreadser="0" if test "$threads" = "1"; then From e655ab0c64a19a89673894252e93ece04a6d8504 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 5 Oct 2000 01:06:33 +0000 Subject: [PATCH 0566/7878] In RUN_SUBDIR_CONFIG_NOW, exit the overall configure script if configuration of a subdir (e.g., apr, mm) fails. Otherwise, stuff blows up later anyway but is harder to find out why. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60543 13f79535-47bb-0310-9956-ffa450edef68 --- apr_common.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/apr_common.m4 b/apr_common.m4 index dc825d031f4..68b06354a20 100644 --- a/apr_common.m4 +++ b/apr_common.m4 @@ -30,6 +30,7 @@ changequote([, ])dnl echo "$1 configured properly" else echo "configure failed for $1" + exit 1 fi cd $ac_popdir From 043eeb252ef1325c80f07ff53b487217fbec8942 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 5 Oct 2000 04:41:46 +0000 Subject: [PATCH 0567/7878] =?UTF-8?q?Prepare=20our=20autoconf=20setup=20fo?= =?UTF-8?q?r=20autoconf=202.14a=20and=20for=20cross-compiling=20PR:=096379?= =?UTF-8?q?=20Submitted=20by:=09"R=EF=BF=BDdiger"=20Kuhlmann=20<Tadu@gmx.d?= =?UTF-8?q?e>=20Reviewed=20by:=09Ryan=20Bloom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60544 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 8 ++++---- hints.m4 | 6 ++---- shmem/unix/mm/aclocal.m4 | 35 ++++++++++++++++++----------------- shmem/unix/mm/configure.in | 26 +++++++++++++++----------- 4 files changed, 39 insertions(+), 36 deletions(-) diff --git a/configure.in b/configure.in index 7afd17b88f2..220aff87756 100644 --- a/configure.in +++ b/configure.in @@ -7,10 +7,10 @@ AC_INIT(apr_common.m4) AC_CONFIG_HEADER(include/apr_private.h) AC_CONFIG_AUX_DIR(helpers) +AC_CANONICAL_SYSTEM echo "Configuring APR library" -OS=`$ac_config_guess` -OS=`$ac_config_sub $OS` -echo "Platform: ${OS}" +OS=$host +echo "Platform: $OS" dnl # Some initial steps for configuration. We setup the default directory dnl # and which files are to be configured. @@ -45,7 +45,7 @@ AC_PROG_CC AC_PROG_RANLIB_NC AC_PROG_MAKE_SET AC_CHECK_PROG(RM, rm, rm) -AC_CHECK_PROG(AR, ar, ar) +AC_CHECK_TOOL(AR, ar, ar) # This macro needs to be here in case we are on an AIX box. AC_AIX diff --git a/hints.m4 b/hints.m4 index 085f91bcbb6..28eff94d7b7 100644 --- a/hints.m4 +++ b/hints.m4 @@ -66,11 +66,9 @@ dnl Preload various ENV/makefile paramsm such as CC, CFLAGS, etc dnl based on outside knowledge dnl AC_DEFUN(APR_PRELOAD, [ -PLAT=`$ac_config_guess` -PLAT=`$ac_config_sub $PLAT` -echo "Applying hints file rules for $PLAT" +echo "Applying hints file rules for $host" -case "$PLAT" in +case "$host" in *mint) APR_SETIFNULL(CFLAGS, [-DMINT]) APR_SETIFNULL(LIBS, [-lportlib -lsocket]) diff --git a/shmem/unix/mm/aclocal.m4 b/shmem/unix/mm/aclocal.m4 index f436b7b8698..08357b66346 100644 --- a/shmem/unix/mm/aclocal.m4 +++ b/shmem/unix/mm/aclocal.m4 @@ -43,13 +43,14 @@ AC_ARG_ENABLE(static,dnl [ --enable-static build static libraries (default=yes)], enable_static="$enableval", enable_static=yes -)dnl +) AC_ARG_ENABLE(shared,dnl [ --enable-shared build shared libraries (default=yes)], enable_shared="$enableval", enable_shared=yes -)dnl +) libtool_flags='' +echo "Calling ltconfig with PLATFORM=$PLATFORM" test ".$silent" = .yes && libtool_flags="$libtool_flags --silent" test ".$enable_static" = .no && libtool_flags="$libtool_flags --disable-static" test ".$enable_shared" = .no && libtool_flags="$libtool_flags --disable-shared" @@ -61,7 +62,7 @@ $libtool_flags --no-verify ltmain.sh $PLATFORM ||\ AC_MSG_ERROR([libtool configuration failed]) LIBTOOL="\$(TOP)/libtool" AC_SUBST(LIBTOOL) -])dnl +]) define(AC_CHECK_DEBUGGING,[dnl AC_MSG_CHECKING(for compilation debug mode) @@ -94,7 +95,7 @@ case "$CFLAGS" in sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;; esac msg=disabled -])dnl +]) AC_MSG_RESULT([$msg]) ]) @@ -242,12 +243,13 @@ AC_SUBST(NM) define(AC_CHECK_MAXSEGSIZE,[dnl AC_MSG_CHECKING(for shared memory maximum segment size) +AC_CACHE_VAL(ac_cv_maxsegsize, +[ OCFLAGS="$CFLAGS" case "$1" in MM_SHMT_MM* ) CFLAGS="-DTEST_MMAP $CFLAGS" ;; MM_SHMT_IPCSHM ) CFLAGS="-DTEST_SHMGET $CFLAGS" ;; esac -cross_compile=no AC_TRY_RUN( changequote(<<, >>)dnl << @@ -371,9 +373,15 @@ int main(int argc, char *argv[]) } >> changequote([, ])dnl -,[ -MM_SHM_MAXSEGSIZE="`cat conftestval`" -msg="$MM_SHM_MAXSEGSIZE" +,[ac_cv_maxsegsize="`cat conftestval`" +], +ac_cv_maxsegsize=0 +, +ac_cv_maxsegsize=0 +) +CFLAGS="$OCFLAGS" +]) +msg="$ac_cv_maxsegsize" if test $msg -eq 67108864; then msg="64MB (soft limit)" elif test $msg -gt 1048576; then @@ -384,17 +392,10 @@ elif test $msg -gt 1024; then msg="`expr $msg / 1024`" msg="${msg}KB" else - MM_SHM_MAXSEGSIZE=0 + ac_cv_maxsegsize=0 msg=unknown fi -], -MM_SHM_MAXSEGSIZE=0 -msg=unknown -, -MM_SHM_MAXSEGSIZE=0 -msg=unknown -)dnl -CFLAGS="$OCFLAGS" +MM_SHM_SEGSIZE=$ac_cv_maxsegsize test ".$msg" = .unknown && AC_MSG_ERROR([Unable to determine maximum shared memory segment size]) AC_MSG_RESULT([$msg]) AC_DEFINE_UNQUOTED(MM_SHM_MAXSEGSIZE, $MM_SHM_MAXSEGSIZE) diff --git a/shmem/unix/mm/configure.in b/shmem/unix/mm/configure.in index 3f2bb7b9501..4891bab4c83 100644 --- a/shmem/unix/mm/configure.in +++ b/shmem/unix/mm/configure.in @@ -9,14 +9,23 @@ dnl # AC_PREREQ(2.12)dnl AC_REVISION($1.0$)dnl +dnl # autoconf initialization +AC_INIT(README) +AC_CONFIG_HEADER(mm_conf.h) +AC_PREFIX_DEFAULT(/usr/local) + dnl # shtool bootstrap SHTOOL="\$(TOP)/shtool" AC_SUBST(SHTOOL) ac_shtool="./shtool" T_MD=`$ac_shtool echo -n -e %B` T_ME=`$ac_shtool echo -n -e %b` -PLATFORM=`${CONFIG_SHELL-/bin/sh} ./config.guess` -PLATFORM=`${CONFIG_SHELL-/bin/sh} ./config.sub $PLATFORM` + +AC_CANONICAL_SYSTEM + +PLATFORM=$host +echo "Platform = $host" + MM_VERSION_STR="`$ac_shtool version -l c -d long mm_vers.c`" AC_SUBST(MM_VERSION_STR) @@ -25,11 +34,6 @@ echo "Configuring ${T_MD}MM${T_ME} (Shared Memory Library), Version ${T_MD}${MM_ echo "Copyright (c) 1999-2000 Ralf S. Engelschall, All Rights Reserved." echo "Platform: ${T_MD}${PLATFORM}${T_ME}" -dnl # autoconf initialization -AC_INIT(README) -AC_CONFIG_HEADER(mm_conf.h) -AC_PREFIX_DEFAULT(/usr/local) - dnl # determine build mode AC_ARG_ENABLE(batch,dnl [ --enable-batch build in batch mode (default=no)], @@ -37,7 +41,7 @@ enable_batch="$enableval", if test ".$enable_batch" = .; then enable_batch=no fi -)dnl +) dnl # dnl # determine build tools and parameters @@ -145,7 +149,7 @@ esac AC_ARG_WITH(shm,dnl [ --with-shm=TYPE force shared memory type: MMFILE MMZERO MMPOSX MMANON IPCSHM BEOS], AC_DECISION_FORCE(MM_SHMT_$withval) -)dnl +) AC_END_DECISION AC_DEFINE_UNQUOTED($ac_decision) @@ -193,7 +197,7 @@ AC_IFALLYES(header:kernel/OS.h func:create_sem, AC_ARG_WITH(sem,dnl [ --with-sem=TYPE force semaphore type: FLOCK FCNTL IPCSEM BEOS], AC_DECISION_FORCE(MM_SEMT_$withval) -)dnl +) AC_END_DECISION AC_DEFINE_UNQUOTED($ac_decision) @@ -208,7 +212,7 @@ Makefile dnl mm-config dnl ,dnl chmod a+x mm-config -)dnl +) if test ".$enable_batch" != .yes; then echo "" From c2133ad9d99d257a38991674d6be6943c7a62c45 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 5 Oct 2000 05:42:06 +0000 Subject: [PATCH 0568/7878] Multiple build and configuration fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build process: -add datadir and localstatedir substitutions -fix layout name -fix logfilename misspelling -fix evaluation of installation dir variables and -replace $foobar by $(foobar) to be usefull in the makefile Cross compile: -add rules for cross-compiling in rules.mk. Okay, rule to check for $CC_FOR_BUILD is still missing -use CHECK_TOOL instead of CHECK_PROG for ranlib -add missing "AR=@AR@" to severaly Makefile.in's -cache result for "struct rlimit" -compile all helper programs with native and cross compiler and use the native version to generate header file PR: 6384 Submitted by: "R�diger" Kuhlmann <Tadu@gmx.de> Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60545 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 1 + aclocal.m4 | 2 +- configure.in | 14 ++++++-------- dso/unix/Makefile.in | 1 + shmem/unix/Makefile.in | 1 + shmem/unix/mm/configure.in | 2 ++ 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index b8f8f271a72..096d07beb71 100644 --- a/Makefile.in +++ b/Makefile.in @@ -13,6 +13,7 @@ CC=@CC@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) +AR=@AR@ RANLIB=@RANLIB@ # # Macros for supporting directories diff --git a/aclocal.m4 b/aclocal.m4 index 104638d8397..2e72fc32b3d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -261,7 +261,7 @@ dnl OS/390 doesn't have ranlib and the make utility doesn't parse "RANLIB=:" dnl the way we might want it to. AC_DEFUN(AC_PROG_RANLIB_NC, -[AC_CHECK_PROG(RANLIB, ranlib, ranlib, true)]) +[AC_CHECK_TOOL(RANLIB, ranlib, true)]) AC_DEFUN(APR_EBCDIC,[ AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ diff --git a/configure.in b/configure.in index 220aff87756..0ed9a8ec104 100644 --- a/configure.in +++ b/configure.in @@ -551,7 +551,7 @@ AC_ARG_ENABLE(other-child, AC_SUBST(oc) -AC_MSG_CHECKING(struct rlimit) +AC_CACHE_CHECK(struct rlimit,ac_cv_struct_rlimit,[ AC_TRY_RUN([ #include <sys/types.h> #include <sys/time.h> @@ -563,13 +563,11 @@ main() limit.rlim_max = 0; exit(0); }], [ - struct_rlimit="1" - AC_MSG_RESULT(yes) ], [ - struct_rlimit="0" - AC_MSG_RESULT(no) ], [ - struct_rlimit="0" - AC_MSG_RESULT(no) ] ) - + ac_cv_struct_rlimit=yes ], [ + ac_cv_struct_rlimit=no ], [ + ac_cv_struct_rlimit=no ] ) ] ) +struct_rlimit=0 +test "x$ac_cv_struct_rlimit" = xyes && struct_rlimit=1 AC_SUBST(struct_rlimit) dnl #----------------------------- Checking for Locking Characteristics diff --git a/dso/unix/Makefile.in b/dso/unix/Makefile.in index 1435d0d53ba..c08355c59f9 100644 --- a/dso/unix/Makefile.in +++ b/dso/unix/Makefile.in @@ -5,6 +5,7 @@ RM=@RM@ CC=@CC@ +AR=@AR@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ diff --git a/shmem/unix/Makefile.in b/shmem/unix/Makefile.in index b2156bde22a..aed93d98b1f 100644 --- a/shmem/unix/Makefile.in +++ b/shmem/unix/Makefile.in @@ -5,6 +5,7 @@ RM=@RM@ CC=@CC@ +AR=@AR@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ diff --git a/shmem/unix/mm/configure.in b/shmem/unix/mm/configure.in index 4891bab4c83..eff9016f79b 100644 --- a/shmem/unix/mm/configure.in +++ b/shmem/unix/mm/configure.in @@ -10,6 +10,7 @@ AC_PREREQ(2.12)dnl AC_REVISION($1.0$)dnl dnl # autoconf initialization +AC_CONFIG_AUX_DIR(../../../helpers) AC_INIT(README) AC_CONFIG_HEADER(mm_conf.h) AC_PREFIX_DEFAULT(/usr/local) @@ -50,6 +51,7 @@ dnl # AC_CONFIGURE_PART(Build Tools) AC_PROG_CC AC_PROG_CPP +#AC_CHECK_TOOL(RANLIB, ranlib, true) AC_CHECK_DEBUGGING AC_SET_MAKE AC_PROG_LIBTOOL From 8f883bd826192eb078c6e44489a3e8855a806dad Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 5 Oct 2000 17:28:22 +0000 Subject: [PATCH 0569/7878] The big one... APR_IS_STATUS_condition(rv) conditional macros. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60546 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 220 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 210 insertions(+), 10 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index e777adc6a25..64340e63cb4 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -109,7 +109,7 @@ int apr_canonical_error(apr_status_t err); * APR_ENOLOCK APR was not given a lock structure * APR_ENOPOLL APR was not given a poll structure * APR_ENOSOCKET APR was not given a socket - * APR_ENOTHREAD APR was nto given a thread structure + * APR_ENOTHREAD APR was not given a thread structure * APR_ENOTHDKEY APR was not given a thread key structure * APR_ENOSHMAVAIL There is no more shared memory available * APR_EDSOOPEN APR was unable to open the dso object. For more @@ -166,6 +166,29 @@ int apr_canonical_error(apr_status_t err); /* empty slot: +18 */ #define APR_EDSOOPEN (APR_OS_START_ERROR + 19) + +/* APR ERROR VALUE TESTS */ +#define APR_STATUS_IS_ENOSTAT(s) ((s) == APR_ENOSTAT) +#define APR_STATUS_IS_ENOPOOL(s) ((s) == APR_ENOPOOL) +#define APR_STATUS_IS_ENOFILE(s) ((s) == APR_ENOFILE) +#define APR_STATUS_IS_EBADDATE(s) ((s) == APR_EBADDATE) +#define APR_STATUS_IS_EINVALSOCK(s) ((s) == APR_EINVALSOCK) +#define APR_STATUS_IS_ENOPROC(s) ((s) == APR_ENOPROC) +#define APR_STATUS_IS_ENOTIME(s) ((s) == APR_ENOTIME) +#define APR_STATUS_IS_ENODIR(s) ((s) == APR_ENODIR) +#define APR_STATUS_IS_ENOLOCK(s) ((s) == APR_ENOLOCK) +#define APR_STATUS_IS_ENOPOLL(s) ((s) == APR_ENOPOLL) +#define APR_STATUS_IS_ENOSOCKET(s) ((s) == APR_ENOSOCKET) +#define APR_STATUS_IS_ENOTHREAD(s) ((s) == APR_ENOTHREAD) +#define APR_STATUS_IS_ENOTHDKEY(s) ((s) == APR_ENOTHDKEY) +/* empty slot: +14 */ +#define APR_STATUS_IS_ENOSHMAVAIL(s) ((s) == APR_ENOSHMAVAIL) +/* empty slot: +16 */ +/* empty slot: +17 */ +/* empty slot: +18 */ +#define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN) + + /* APR STATUS VALUES */ #define APR_INCHILD (APR_OS_START_STATUS + 1) #define APR_INPARENT (APR_OS_START_STATUS + 2) @@ -188,20 +211,38 @@ int apr_canonical_error(apr_status_t err); #define APR_ANONYMOUS (APR_OS_START_STATUS + 19) #define APR_FILEBASED (APR_OS_START_STATUS + 20) #define APR_KEYBASED (APR_OS_START_STATUS + 21) - -/* A simple value to be used to initialize a status variable. */ #define APR_EINIT (APR_OS_START_STATUS + 22) - -/* Not implemented either because we haven't gotten to it yet, or - * because it is not possible to do correctly. - */ #define APR_ENOTIMPL (APR_OS_START_STATUS + 23) - -/* Passwords do not match. - */ #define APR_EMISMATCH (APR_OS_START_STATUS + 24) +/* APR STATUS VALUE TESTS */ +#define APR_STATUS_IS_INCHILD(s) ((s) == APR_INCHILD) +#define APR_STATUS_IS_INPARENT(s) ((s) == APR_INPARENT) +#define APR_STATUS_IS_DETACH(s) ((s) == APR_DETACH) +#define APR_STATUS_IS_NOTDETACH(s) ((s) == APR_NOTDETACH) +#define APR_STATUS_IS_CHILD_DONE(s) ((s) == APR_CHILD_DONE) +#define APR_STATUS_IS_CHILD_NOTDONE(s) ((s) == APR_CHILD_NOTDONE) +#define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP) +#define APR_STATUS_IS_INCOMPLETE(s) ((s) == APR_INCOMPLETE) +/* empty slot: +9 */ +/* empty slot: +10 */ +/* empty slot: +11 */ +#define APR_STATUS_IS_BADCH(s) ((s) == APR_BADCH) +#define APR_STATUS_IS_BADARG(s) ((s) == APR_BADARG) +#define APR_STATUS_IS_EOF(s) ((s) == APR_EOF) +#define APR_STATUS_IS_NOTFOUND(s) ((s) == APR_NOTFOUND) +/* empty slot: +16 */ +/* empty slot: +17 */ +/* empty slot: +18 */ +#define APR_STATUS_IS_ANONYMOUS(s) ((s) == APR_ANONYMOUS) +#define APR_STATUS_IS_FILEBASED(s) ((s) == APR_FILEBASED) +#define APR_STATUS_IS_KEYBASED(s) ((s) == APR_KEYBASED) +#define APR_STATUS_IS_EINIT(s) ((s) == APR_EINIT) +#define APR_STATUS_IS_ENOTIMPL(s) ((s) == APR_ENOTIMPL) +#define APR_STATUS_IS_EMISMATCH(s) ((s) == APR_EMISMATCH) + + /* APR CANONICAL ERROR VALUES */ #ifdef EACCES #define APR_EACCES EACCES @@ -277,6 +318,8 @@ int apr_canonical_error(apr_status_t err); #ifdef EAGAIN #define APR_EAGAIN EAGAIN +#elif defined(EWOULDBLOCK) +#define APR_EAGAIN EWOULDBLOCK #else #define APR_EAGAIN (APR_OS_START_CANONERR + 13) #endif @@ -305,6 +348,163 @@ int apr_canonical_error(apr_status_t err); #define APR_EINPROGRESS (APR_OS_START_CANONERR + 17) #endif + +#if !defined(OS2) && !defined(WIN32) + + +#define APR_STATUS_IS_SUCCESS ((s) == APR_SUCCESS) + +/* APR CANONICAL ERROR TESTS */ +#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) +#define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) +#define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG) +#define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT) +#define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) +#define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC) +#define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) +#define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE) +#define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) +#define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF) +#define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL) +#define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE) +#if !defined(EWOULDBLOCK) || !defined(EAGAIN) +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) +#elif (EWOULDBLOCK == EAGAIN) +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) +#else +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN || (s) == EWOULDBLOCK) +#endif +#define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR) +#define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK) +#define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED) +#define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS) + + +#elif defined(OS2) /* endif !defined(WIN32) && !defined(OS2) */ + + +#define APR_STATUS_IS_SUCCESS ((s) == APR_SUCCESS \ + || (s) - APR_OS_START_SYSERR == NO_ERROR) + +/* APR CANONICAL ERROR TESTS */ +#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ + || (s) - APR_OS_START_SYSERR == ERROR_ACCESS_DENIED \ + || (s) - APR_OS_START_SYSERR == ERROR_SHARING_VIOLATION) +#define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) +#define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \ + || (s) - APR_OS_START_SYSERR == ERROR_FILENAME_EXCED_RANGE \ + || (s) - APR_OS_START_SYSERR == SOCENAMETOOLONG) +#define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ + || (s) - APR_OS_START_SYSERR == ERROR_FILE_NOT_FOUND \ + || (s) - APR_OS_START_SYSERR == ERROR_PATH_NOT_FOUND \ + || (s) - APR_OS_START_SYSERR == ERROR_OPEN_FAILED) +#define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) +#define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ + || (s) - APR_OS_START_SYSERR == ERROR_DISK_FULL) +#define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) +#define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \ + || (s) - APR_OS_START_SYSERR == ERROR_TOO_MANY_OPEN_FILES) +#define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) +#define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \ + || (s) - APR_OS_START_SYSERR == ERROR_INVALID_HANDLE) +#define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \ + || (s) - APR_OS_START_SYSERR == ERROR_INVALID_PARAMETER \ + || (s) - APR_OS_START_SYSERR == ERROR_INVALID_FUNCTION) +#define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ + || (s) - APR_OS_START_SYSERR == ERROR_NEGATIVE_SEEK) +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ + || (s) - APR_OS_START_SYSERR == ERROR_NO_DATA \ + || (s) - APR_OS_START_SYSERR == SOCEWOULDBLOCK) +#define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ + || (s) - APR_OS_START_SYSERR == SOCEINTR) +#define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ + || (s) - APR_OS_START_SYSERR == SOCENOTSOCK) +#define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ + || (s) - APR_OS_START_SYSERR == SOCECONNREFUSED) +#define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ + || (s) - APR_OS_START_SYSERR == SOCEINPROGRESS) + +/* + Sorry, too tired to wrap this up for OS2... feel free to + fit the following into their best matches. + + { ERROR_NO_SIGNAL_SENT, ESRCH }, + { SOCEALREADY, EALREADY }, + { SOCEDESTADDRREQ, EDESTADDRREQ }, + { SOCEMSGSIZE, EMSGSIZE }, + { SOCEPROTOTYPE, EPROTOTYPE }, + { SOCENOPROTOOPT, ENOPROTOOPT }, + { SOCEPROTONOSUPPORT, EPROTONOSUPPORT }, + { SOCESOCKTNOSUPPORT, ESOCKTNOSUPPORT }, + { SOCEOPNOTSUPP, EOPNOTSUPP }, + { SOCEPFNOSUPPORT, EPFNOSUPPORT }, + { SOCEAFNOSUPPORT, EAFNOSUPPORT }, + { SOCEADDRINUSE, EADDRINUSE }, + { SOCEADDRNOTAVAIL, EADDRNOTAVAIL }, + { SOCENETDOWN, ENETDOWN }, + { SOCENETUNREACH, ENETUNREACH }, + { SOCENETRESET, ENETRESET }, + { SOCECONNABORTED, ECONNABORTED }, + { SOCECONNRESET, ECONNRESET }, + { SOCENOBUFS, ENOBUFS }, + { SOCEISCONN, EISCONN }, + { SOCENOTCONN, ENOTCONN }, + { SOCESHUTDOWN, ESHUTDOWN }, + { SOCETOOMANYREFS, ETOOMANYREFS }, + { SOCETIMEDOUT, ETIMEDOUT }, + { SOCELOOP, ELOOP }, + { SOCEHOSTDOWN, EHOSTDOWN }, + { SOCEHOSTUNREACH, EHOSTUNREACH }, + { SOCENOTEMPTY, ENOTEMPTY }, + { SOCEPIPE, EPIPE } +*/ + +#elif defined(WIN32) /* endif defined(OS2) */ + + +#define APR_STATUS_IS_SUCCESS ((s) == APR_SUCCESS) + +/* APR CANONICAL ERROR TESTS */ +#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ + || (s) == ERROR_ACCESS_DENIED \ + || (s) == ERROR_SHARING_VIOLATION) +#define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) +#define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \ + || (s) == ERROR_FILENAME_EXCED_RANGE \ + || (s) == WSAENAMETOOLONG) +#define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ + || (s) == ERROR_FILE_NOT_FOUND \ + || (s) == ERROR_PATH_NOT_FOUND \ + || (s) == ERROR_OPEN_FAILED) +#define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) +#define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ + || (s) == ERROR_DISK_FULL) +#define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) +#define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \ + || (s) == ERROR_TOO_MANY_OPEN_FILES) +#define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) +#define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \ + || (s) == ERROR_INVALID_HANDLE) +#define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \ + || (s) == ERROR_INVALID_PARAMETER \ + || (s) == ERROR_INVALID_FUNCTION) +#define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ + || (s) == ERROR_NEGATIVE_SEEK) +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ + || (s) == ERROR_NO_DATA \ + || (s) == WSAEWOULDBLOCK) +#define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ + || (s) == WSAEINTR) +#define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ + || (s) == WSAENOTSOCK) +#define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ + || (s) == WSAECONNREFUSED) +#define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ + || (s) == WSAEINPROGRESS) + +#endif /* endif defined(WIN32) */ + + #ifdef __cplusplus } #endif From 808fa2bebcbbdd0281e29094a69dd0e44a7ef0f3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 5 Oct 2000 17:32:44 +0000 Subject: [PATCH 0570/7878] The lots of little ones... APR_IS_STATUS_condition(rv) conditional macros replacing the majority of fallible rv == APR_condition tests. But there are lots more to fix, these are the obvious ones that already did proper canonical error conversion. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60547 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsf.c | 4 ++-- threadproc/os2/proc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testsf.c b/test/testsf.c index 6f7d5f26a63..990dceefade 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -350,7 +350,7 @@ static int client(client_socket_mode_t socket_mode) rv = apr_sendfile(sock, f, &hdtr, &current_file_offset, &tmplen, 0); printf("apr_sendfile()->%d, sent %ld bytes\n", rv, (long)tmplen); if (rv) { - if (apr_canonical_error(rv) == APR_EAGAIN) { + if (APR_STATUS_IS_EAGAIN(rv)) { nsocks = 1; tmprv = apr_poll(pfd, &nsocks, -1); assert(!tmprv); @@ -417,7 +417,7 @@ static int client(client_socket_mode_t socket_mode) } while (total_bytes_sent < expected_len && (rv == APR_SUCCESS || - apr_canonical_error(rv) == APR_EAGAIN)); + APR_STATUS_IS_EAGAIN(rv))); if (total_bytes_sent != expected_len) { fprintf(stderr, "client problem: sent %ld of %ld bytes\n", diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 0005ee21ee6..4a88675ccfb 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -350,7 +350,7 @@ apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, } else if (stricmp(extension, ".exe") != 0) { status = apr_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, cont); - if (status != APR_SUCCESS && apr_canonical_error(status) == APR_ENOENT) { + if (status != APR_SUCCESS && APR_STATUS_IS_ENOENT(status)) { progname = apr_pstrcat(cont, progname, ".exe", NULL); } From 22ae80bec119856e04f5e1b3dd1e1713bc26e9ef Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Thu, 5 Oct 2000 22:20:37 +0000 Subject: [PATCH 0571/7878] size_t should be an apr_size_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60548 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 15 ++++++++------- tables/apr_hash.c | 14 +++++++------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index 5bb50c0f2fa..3473ea5164b 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -95,10 +95,10 @@ APR_EXPORT(apr_hash_t *) apr_make_hash(apr_pool_t *pool); * If the length is 0 it is assumed to be strlen(key)+1 * @param val Value to associate with the key * @tip If the value is NULL the hash entry is deleted. - * @deffunc void apr_hash_set(apr_hash_t *ht, const void *key, size_t klen, const void *val) + * @deffunc void apr_hash_set(apr_hash_t *ht, const void *key, apr_size_t klen, const void *val) */ -APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, size_t klen, - const void *val); +APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, + apr_size_t klen, const void *val); /** * Look up the value associated with a key in a hash table. @@ -107,9 +107,10 @@ APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, size_t klen, * @param klen Length of the key * If the length is 0 it is assumed to be strlen(key)+1 * @return Returns NULL if the key is not present. - * @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, size_t klen) + * @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, apr_size_t klen) */ -APR_EXPORT(void) *apr_hash_get(apr_hash_t *ht, const void *key, size_t klen); +APR_EXPORT(void) *apr_hash_get(apr_hash_t *ht, const void *key, + apr_size_t klen); /** * Start iterating over the entries in a hash table. @@ -155,10 +156,10 @@ APR_EXPORT(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); * @param val Return pointer for the associated value. * @tip The return pointers should point to a variable that will be set to the * corresponding data, or they may be NULL if the data isn't interesting. - * @deffunc void apr_hash_this(apr_hash_index_t *hi, const void **key, size_t *klen, void **val); + * @deffunc void apr_hash_this(apr_hash_index_t *hi, const void **key, apr_size_t *klen, void **val); */ APR_EXPORT(void) apr_hash_this(apr_hash_index_t *hi, const void **key, - size_t *klen, void **val); + apr_size_t *klen, void **val); #ifdef __cplusplus } diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 31ccc12aa00..123d18fb2d8 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -86,7 +86,7 @@ struct apr_hash_entry_t { apr_hash_entry_t *next; int hash; const void *key; - size_t klen; + apr_size_t klen; const void *val; }; @@ -100,7 +100,7 @@ struct apr_hash_entry_t { struct apr_hash_t { apr_pool_t *pool; apr_hash_entry_t **array; - size_t count, max; + apr_size_t count, max; }; #define INITIAL_MAX 15 /* tunable == 2^n - 1 */ @@ -114,7 +114,7 @@ struct apr_hash_t { struct apr_hash_index_t { apr_hash_t *ht; apr_hash_entry_t *this, *next; - size_t index; + apr_size_t index; }; @@ -168,7 +168,7 @@ APR_EXPORT(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht) APR_EXPORT(void) apr_hash_this(apr_hash_index_t *hi, const void **key, - size_t *klen, + apr_size_t *klen, void **val) { if (key) *key = hi->this->key; @@ -207,7 +207,7 @@ static void resize_array(apr_hash_t *ht) static apr_hash_entry_t **find_entry(apr_hash_t *ht, const void *key, - size_t klen, + apr_size_t klen, const void *val) { apr_hash_entry_t **hep, *he; @@ -282,7 +282,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, APR_EXPORT(void *) apr_hash_get(apr_hash_t *ht, const void *key, - size_t klen) + apr_size_t klen) { apr_hash_entry_t *he; he = *find_entry(ht, key, klen, NULL); @@ -294,7 +294,7 @@ APR_EXPORT(void *) apr_hash_get(apr_hash_t *ht, APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, - size_t klen, + apr_size_t klen, const void *val) { apr_hash_entry_t **hep; From de18ebe3265e2991d744bbe79a0a0dedd62a359a Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Fri, 6 Oct 2000 12:19:43 +0000 Subject: [PATCH 0572/7878] add UUID generation/formatting/parsing to APR git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60549 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_uuid.h | 99 ++++++++++++++++++++ misc/unix/Makefile.in | 3 +- misc/unix/getuuid.c | 209 ++++++++++++++++++++++++++++++++++++++++++ misc/unix/uuid.c | 133 +++++++++++++++++++++++++++ misc/win32/getuuid.c | 72 +++++++++++++++ test/.cvsignore | 1 + test/Makefile.in | 5 + test/testuuid.c | 91 ++++++++++++++++++ 8 files changed, 612 insertions(+), 1 deletion(-) create mode 100644 include/apr_uuid.h create mode 100644 misc/unix/getuuid.c create mode 100644 misc/unix/uuid.c create mode 100644 misc/win32/getuuid.c create mode 100644 test/testuuid.c diff --git a/include/apr_uuid.h b/include/apr_uuid.h new file mode 100644 index 00000000000..2076f9e5aaf --- /dev/null +++ b/include/apr_uuid.h @@ -0,0 +1,99 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#ifndef APR_UUID_H +#define APR_UUID_H + +#include "apr.h" +#include "apr_errno.h" + +/** + * @package APR UUID Handling + */ + +/* we represent a UUID as a block of 16 bytes. */ +typedef struct { + unsigned char data[16]; +} apr_uuid_t; + +/* UUIDs are formatted as: 00112233-4455-6677-8899-AABBCCDDEEFF */ +#define APR_UUID_FORMATTED_LENGTH 36 + + +/** + * Generate and return a (new) UUID + * @param uuid The resulting UUID + * @deffunc int apr_get_uuid(apr_uuid_t *uuid) + */ +void apr_get_uuid(apr_uuid_t *uuid); + +/** + * Format a UUID into a string, following the standard format + * @param buffer The buffer to place the formatted UUID string into. It must + * be at least APR_UUID_FORMATTED_LENGTH + 1bytes long to hold + * the formatted UUID and a null terminator + * @param uuid The UUID to format + * @deffunc int apr_format_uuid(apr_pool_t *p, const apr_uuid_t *uuid) + */ +void apr_format_uuid(char *buffer, const apr_uuid_t *uuid); + +/** + * Parse a standard-format string into a UUID + * @param uuid The resulting UUID + * @param uuid_str The formatted UUID + * @deffunc int apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str) + */ +apr_status_t apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str); + +#endif /* APR_UUID_H */ diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index 7db1ea6b650..8cf7c3f26e8 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -17,7 +17,8 @@ INCLUDES=-I$(INCDIR1) -I$(INCDIR2) -I$(INCDIR3) -I$(INCDIR4) -I. #LIB=libmisc.a -OBJS=start.o getopt.o otherchild.o errorcodes.o rand.o canonerr.o +OBJS=start.o getopt.o otherchild.o errorcodes.o rand.o canonerr.o \ + uuid.c getuuid.c .c.o: $(CC) $(CFLAGS) -c $(INCLUDES) $< diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c new file mode 100644 index 00000000000..3af2f02a475 --- /dev/null +++ b/misc/unix/getuuid.c @@ -0,0 +1,209 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +/* + * This attempts to generate V1 UUIDs according to the Internet Draft + * located at http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt + */ + +#include <unistd.h> /* for getpid, gethostname */ +#include <stdlib.h> /* for rand, srand */ + +#include "apr.h" +#include "apr_uuid.h" +#include "apr_md5.h" +#include "apr_general.h" + +#define NODE_LENGTH 6 + +static int uuid_state_seqnum; +static char uuid_state_node[NODE_LENGTH] = { 0 }; + + +static void get_random_info(unsigned char node[NODE_LENGTH]) +{ +#if APR_HAS_RANDOM + + (void) apr_generate_random_bytes(node, NODE_LENGTH); + +#else + + unsigned char seed[MD5_DIGESTSIZE]; + apr_md5_ctx_t c; + + /* ### probably should revise some of this to be a bit more portable */ + + /* Leach & Salz use Linux-specific struct sysinfo; + * replace with pid/tid for portability (in the spirit of mod_unique_id) */ + struct { + /* Add thread id here, if applicable, when we get to pthread or apr */ + pid_t pid; + struct timeval t; + char hostname[257]; + + } r; + + apr_MD5Init(&c); + r.pid = getpid(); + gettimeofday(&r.t, (struct timezone *)0); + gethostname(r.hostname, 256); + apr_MD5Update(&c, (const unsigned char *)&r, sizeof(r)); + apr_MD5Final(seed, &c); + + memcpy(node, seed, NODE_LENGTH); /* use a subset of the seed bytes */ +#endif +} + +/* This implementation generates a random node ID instead of a + system-dependent call to get IEEE node ID. This is also more secure: + we aren't passing out our MAC address. +*/ +static void get_pseudo_node_identifier(char *node) +{ + get_random_info(node); + node[0] |= 0x80; /* this designates a random node ID */ +} + +static void get_system_time(apr_uint64_t *uuid_time) +{ + struct timeval tp; + + /* ### fix this call to be more portable? */ + gettimeofday(&tp, (struct timezone *)0); + + /* Offset between UUID formatted times and Unix formatted times. + UUID UTC base time is October 15, 1582. + Unix base time is January 1, 1970. */ + *uuid_time = (tp.tv_sec * 10000000) + (tp.tv_usec * 10) + + 0x01B21DD213814000LL; +} + +/* true_random -- generate a crypto-quality random number. */ +static int true_random(void) +{ + apr_uint64_t time_now; + +#if APR_HAS_RANDOM + unsigned char buf[2]; + + if (apr_generate_random_bytes(buf, 2) == APR_SUCCESS) { + return (buf[0] << 8) | buf[1]; + } +#endif + + /* crap. this isn't crypto quality, but it will be Good Enough */ + + get_system_time(&time_now); + srand((unsigned int)(((time_now >> 32) ^ time_now) & 0xffffffff)); + + return rand() & 0x0FFFF; +} + +static void init_state(void) +{ + uuid_state_seqnum = true_random(); + get_pseudo_node_identifier(uuid_state_node); +} + +static void get_current_time(apr_uint64_t *timestamp) +{ + apr_uint64_t time_now; + static apr_uint64_t time_last = 0; + static int fudge = 0; + + get_system_time(&time_now); + + /* if clock reading changed since last UUID generated... */ + if (time_last != time_now) { + /* The clock reading has changed since the last UUID was generated. + Reset the fudge factor. if we are generating them too fast, then + the fudge may need to be reset to something greater than zero. */ + if (time_last + fudge > time_now) + fudge = time_last + fudge - time_now + 1; + else + fudge = 0; + time_last = time_now; + } + else { + /* We generated two really fast. Bump the fudge factor. */ + ++fudge; + } + + *timestamp = time_now + fudge; +} + +void apr_get_uuid(apr_uuid_t *uuid) +{ + apr_uint64_t timestamp; + unsigned char *d = uuid->data; + + if (!uuid_state_node[0]) + init_state(); + + get_current_time(&timestamp); + + d[0] = (unsigned char)timestamp; + d[1] = (unsigned char)(timestamp >> 8); + d[2] = (unsigned char)(timestamp >> 16); + d[3] = (unsigned char)(timestamp >> 24); + d[4] = (unsigned char)(timestamp >> 32); + d[5] = (unsigned char)(timestamp >> 40); + d[6] = (unsigned char)(timestamp >> 48); + d[7] = (unsigned char)(((timestamp >> 56) & 0x0F) | 0x10); + + d[8] = (unsigned char)(((uuid_state_seqnum >> 8) & 0x3F) | 0x80); + d[9] = (unsigned char)uuid_state_seqnum; + + memcpy(&d[10], uuid_state_node, NODE_LENGTH); +} diff --git a/misc/unix/uuid.c b/misc/unix/uuid.c new file mode 100644 index 00000000000..1a3401b50f3 --- /dev/null +++ b/misc/unix/uuid.c @@ -0,0 +1,133 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include <stdio.h> /* for sprintf */ + +#include "apr.h" +#include "apr_uuid.h" +#include "apr_errno.h" +#include "apr_lib.h" + + +void apr_format_uuid(char *buffer, const apr_uuid_t *uuid) +{ + const unsigned char *d = uuid->data; + + sprintf(buffer, + "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], + d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); +} + +/* convert a pair of hex digits to an integer value [0,255] */ +static unsigned char parse_hexpair(const char *s) +{ + int result; + int temp; + + result = s[0] - '0'; + if (result > 48) + result = (result - 39) << 4; + else if (result > 16) + result = (result - 7) << 4; + else + result = result << 4; + + temp = s[1] - '0'; + if (temp > 48) + result |= temp - 39; + else if (temp > 16) + result |= temp - 7; + else + result |= temp; + + return (unsigned char)result; +} + +apr_status_t apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str) +{ + int i; + unsigned char *d = uuid->data; + + for (i = 0; i < 36; ++i) { + char c = uuid_str[i]; + if (!apr_isxdigit(c) && + !(c == '-' && (i == 8 || i == 13 || i == 18 || i == 23))) + /* ### need a better value */ + return APR_BADARG; + } + if (uuid_str[36] != '\0') { + /* ### need a better value */ + return APR_BADARG; + } + + d[0] = parse_hexpair(&uuid_str[0]); + d[1] = parse_hexpair(&uuid_str[2]); + d[2] = parse_hexpair(&uuid_str[4]); + d[3] = parse_hexpair(&uuid_str[6]); + + d[4] = parse_hexpair(&uuid_str[9]); + d[5] = parse_hexpair(&uuid_str[11]); + + d[6] = parse_hexpair(&uuid_str[14]); + d[7] = parse_hexpair(&uuid_str[16]); + + d[8] = parse_hexpair(&uuid_str[19]); + d[9] = parse_hexpair(&uuid_str[21]); + + for (i = 6; i--;) + d[10 + i] = parse_hexpair(&uuid_str[i*2+24]); + + return APR_SUCCESS; +} diff --git a/misc/win32/getuuid.c b/misc/win32/getuuid.c new file mode 100644 index 00000000000..5af3636e796 --- /dev/null +++ b/misc/win32/getuuid.c @@ -0,0 +1,72 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +/* + * This attempts to generate V1 UUIDs according to the Internet Draft + * located at http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt + */ + +#include <objbase.h> + +#include "apr.h" +#include "apr_uuid.h" + +void apr_get_uuid(apr_uuid_t *uuid) +{ + GUID guid; + + /* Note: this call doesn't actually require CoInitialize() first */ + (void) CoCreateGuid(&guid); + memcpy(uuid->data, &guid, sizeof(uuid->data)); +} diff --git a/test/.cvsignore b/test/.cvsignore index 56becea1ab9..ee2faacb664 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -19,3 +19,4 @@ testproc testfile occhild testsf +testuuid diff --git a/test/Makefile.in b/test/Makefile.in index 55820a8ed05..cd75cd83de0 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -27,6 +27,7 @@ TARGETS= testmd5@EXEEXT@ \ testpipe@EXEEXT@ \ testdso@EXEEXT@ \ testoc@EXEEXT@ \ + testuuid@EXEEXT@ \ occhild@EXEEXT@ \ mod_test.so @@ -42,6 +43,7 @@ OBJS= testmd5.o \ testmmap.o \ testdso.o \ testoc.o \ + testuuid.o \ occhild.o \ mod_test.o @@ -100,6 +102,9 @@ testshmem@EXEEXT@: testshmem.o testpipe@EXEEXT@: testpipe.o $(CC) $(CFLAGS) -o testpipe@EXEEXT@ testpipe.o $(LDFLAGS) +testuuid@EXEEXT@: testuuid.o + $(CC) $(CFLAGS) -o testuuid@EXEEXT@ testuuid.o $(LDFLAGS) + clean: $(RM) -f *.o *.a *.so $(TARGETS) diff --git a/test/testuuid.c b/test/testuuid.c new file mode 100644 index 00000000000..6330f6c418f --- /dev/null +++ b/test/testuuid.c @@ -0,0 +1,91 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include <stdio.h> + +#include "apr_uuid.h" + + +int main(int argc, char **argv) +{ + apr_uuid_t uuid; + apr_uuid_t uuid2; + char buf[APR_UUID_FORMATTED_LENGTH + 1]; + int retcode = 0; + + apr_get_uuid(&uuid); + apr_format_uuid(buf, &uuid); + printf("UUID: %s\n", buf); + + apr_parse_uuid(&uuid2, buf); + if (memcmp(&uuid, &uuid2, sizeof(uuid)) == 0) + printf("Parse appears to work.\n"); + else { + printf("ERROR: parse produced a different UUID.\n"); + retcode = 1; + } + + apr_format_uuid(buf, &uuid2); + printf("parsed/reformatted UUID: %s\n", buf); + + /* generate two of them quickly */ + apr_get_uuid(&uuid); + apr_get_uuid(&uuid2); + apr_format_uuid(buf, &uuid); + printf("UUID 1: %s\n", buf); + apr_format_uuid(buf, &uuid2); + printf("UUID 2: %s\n", buf); + + return retcode; +} From c7a77a79b26267b1a230030014e60781390382fc Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Fri, 6 Oct 2000 14:08:39 +0000 Subject: [PATCH 0573/7878] some nits that I forgot first time around. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60550 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_uuid.h | 2 +- misc/unix/getuuid.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/apr_uuid.h b/include/apr_uuid.h index 2076f9e5aaf..73a726a22e6 100644 --- a/include/apr_uuid.h +++ b/include/apr_uuid.h @@ -81,7 +81,7 @@ void apr_get_uuid(apr_uuid_t *uuid); /** * Format a UUID into a string, following the standard format * @param buffer The buffer to place the formatted UUID string into. It must - * be at least APR_UUID_FORMATTED_LENGTH + 1bytes long to hold + * be at least APR_UUID_FORMATTED_LENGTH + 1 bytes long to hold * the formatted UUID and a null terminator * @param uuid The UUID to format * @deffunc int apr_format_uuid(apr_pool_t *p, const apr_uuid_t *uuid) diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index 3af2f02a475..b3efd645aae 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -158,6 +158,8 @@ static void init_state(void) static void get_current_time(apr_uint64_t *timestamp) { + /* ### this needs to be made thread-safe! */ + apr_uint64_t time_now; static apr_uint64_t time_last = 0; static int fudge = 0; From 4bf74098c2c7e174dbf69a335b528f4534fabd67 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 6 Oct 2000 17:08:27 +0000 Subject: [PATCH 0574/7878] The precursor to the win32 cannonical errors patch Moved the unix APR_IS_STATUS... block to the end (a fallthrough, rather than a nasty condition list.) Added some GetLastError/WSAGetLastError/SetLastError helpers, they are just macro wrappers. Changed for the optimizer, the SYSERR value was flipped to the other side of the equation (creating a constant and killing potential run time math). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60551 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 176 ++++++++++++++++++++++++++------------------ 1 file changed, 103 insertions(+), 73 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 64340e63cb4..3991cebede8 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -91,8 +91,6 @@ int apr_canonical_error(apr_status_t err); #define APR_OS_START_CANONERR (APR_OS_START_USEERR + 500) #define APR_OS_START_SYSERR (APR_OS_START_CANONERR + 500) -#define APR_OS2_STATUS(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) - #define APR_SUCCESS 0 /** @@ -349,80 +347,60 @@ int apr_canonical_error(apr_status_t err); #endif -#if !defined(OS2) && !defined(WIN32) - - -#define APR_STATUS_IS_SUCCESS ((s) == APR_SUCCESS) - -/* APR CANONICAL ERROR TESTS */ -#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) -#define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) -#define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG) -#define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT) -#define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) -#define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC) -#define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) -#define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE) -#define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) -#define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF) -#define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL) -#define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE) -#if !defined(EWOULDBLOCK) || !defined(EAGAIN) -#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) -#elif (EWOULDBLOCK == EAGAIN) -#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) -#else -#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN || (s) == EWOULDBLOCK) -#endif -#define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR) -#define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK) -#define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED) -#define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS) +#if defined(OS2) /* endif !defined(WIN32) && !defined(OS2) */ +/* uhhh... I dunno + */ +#define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) +#define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) -#elif defined(OS2) /* endif !defined(WIN32) && !defined(OS2) */ +#define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) +#define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) +/* And this needs to be greped away for good: + */ +#define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e)) #define APR_STATUS_IS_SUCCESS ((s) == APR_SUCCESS \ - || (s) - APR_OS_START_SYSERR == NO_ERROR) + || (s) == APR_OS_START_SYSERR + NO_ERROR) /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ - || (s) - APR_OS_START_SYSERR == ERROR_ACCESS_DENIED \ - || (s) - APR_OS_START_SYSERR == ERROR_SHARING_VIOLATION) + || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \ + || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION) #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \ - || (s) - APR_OS_START_SYSERR == ERROR_FILENAME_EXCED_RANGE \ - || (s) - APR_OS_START_SYSERR == SOCENAMETOOLONG) + || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \ + || (s) == APR_OS_START_SYSERR + SOCENAMETOOLONG) #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ - || (s) - APR_OS_START_SYSERR == ERROR_FILE_NOT_FOUND \ - || (s) - APR_OS_START_SYSERR == ERROR_PATH_NOT_FOUND \ - || (s) - APR_OS_START_SYSERR == ERROR_OPEN_FAILED) + || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \ + || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ + || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED) #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ - || (s) - APR_OS_START_SYSERR == ERROR_DISK_FULL) + || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL) #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \ - || (s) - APR_OS_START_SYSERR == ERROR_TOO_MANY_OPEN_FILES) + || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES) #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \ - || (s) - APR_OS_START_SYSERR == ERROR_INVALID_HANDLE) + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE) #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \ - || (s) - APR_OS_START_SYSERR == ERROR_INVALID_PARAMETER \ - || (s) - APR_OS_START_SYSERR == ERROR_INVALID_FUNCTION) + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \ + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION) #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ - || (s) - APR_OS_START_SYSERR == ERROR_NEGATIVE_SEEK) + || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ - || (s) - APR_OS_START_SYSERR == ERROR_NO_DATA \ - || (s) - APR_OS_START_SYSERR == SOCEWOULDBLOCK) + || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \ + || (s) == APR_OS_START_SYSERR + SOCEWOULDBLOCK) #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ - || (s) - APR_OS_START_SYSERR == SOCEINTR) + || (s) == APR_OS_START_SYSERR + SOCEINTR) #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ - || (s) - APR_OS_START_SYSERR == SOCENOTSOCK) + || (s) == APR_OS_START_SYSERR + SOCENOTSOCK) #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ - || (s) - APR_OS_START_SYSERR == SOCECONNREFUSED) + || (s) == APR_OS_START_SYSERR + SOCECONNREFUSED) #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ - || (s) - APR_OS_START_SYSERR == SOCEINPROGRESS) + || (s) == APR_OS_START_SYSERR + SOCEINPROGRESS) /* Sorry, too tired to wrap this up for OS2... feel free to @@ -461,46 +439,98 @@ int apr_canonical_error(apr_status_t err); #elif defined(WIN32) /* endif defined(OS2) */ +#define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) +#define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) -#define APR_STATUS_IS_SUCCESS ((s) == APR_SUCCESS) +#define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) +#define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) + +/* A special case, only Win32 winsock calls require this: + */ +#define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) + +#define APR_STATUS_IS_SUCCESS ((s) == APR_SUCCESS \ + || (s) == APR_OS_START_SYSERR + ERROR_SUCCESS) /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ - || (s) == ERROR_ACCESS_DENIED \ - || (s) == ERROR_SHARING_VIOLATION) -#define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) + || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \ + || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION) +#define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \ + || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \ + || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS) #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \ - || (s) == ERROR_FILENAME_EXCED_RANGE \ - || (s) == WSAENAMETOOLONG) + || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \ + || (s) == APR_OS_START_SYSERR + WSAENAMETOOLONG) #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ - || (s) == ERROR_FILE_NOT_FOUND \ - || (s) == ERROR_PATH_NOT_FOUND \ - || (s) == ERROR_OPEN_FAILED) + || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \ + || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ + || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED) #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ - || (s) == ERROR_DISK_FULL) + || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL) #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \ - || (s) == ERROR_TOO_MANY_OPEN_FILES) + || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES) #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \ - || (s) == ERROR_INVALID_HANDLE) + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE) #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \ - || (s) == ERROR_INVALID_PARAMETER \ - || (s) == ERROR_INVALID_FUNCTION) + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \ + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION) #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ - || (s) == ERROR_NEGATIVE_SEEK) + || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ - || (s) == ERROR_NO_DATA \ - || (s) == WSAEWOULDBLOCK) + || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \ + || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK) #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ - || (s) == WSAEINTR) + || (s) == APR_OS_START_SYSERR + WSAEINTR) #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ - || (s) == WSAENOTSOCK) + || (s) == APR_OS_START_SYSERR + WSAENOTSOCK) #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ - || (s) == WSAECONNREFUSED) + || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED) #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ - || (s) == WSAEINPROGRESS) + || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS) + + +#else /* !def OS2 || WIN32 */ + + +/* + * os error codes are clib error codes + */ +#define APR_FROM_OS_ERROR(e) (e) +#define APR_TO_OS_ERROR(e) (e) + +#define apr_get_os_error() (errno) +#define apr_set_os_error(e) (errno = (e)) + +#define APR_STATUS_IS_SUCCESS ((s) == APR_SUCCESS) + +/* APR CANONICAL ERROR TESTS */ +#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) +#define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) +#define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG) +#define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT) +#define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) +#define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC) +#define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) +#define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE) +#define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) +#define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF) +#define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL) +#define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE) +#if !defined(EWOULDBLOCK) || !defined(EAGAIN) +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) +#elif (EWOULDBLOCK == EAGAIN) +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) +#else +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN || (s) == EWOULDBLOCK) +#endif +#define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR) +#define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK) +#define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED) +#define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS) #endif /* endif defined(WIN32) */ From 6557d36ee818da70f3bdcbd869b5e30a17700b63 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 6 Oct 2000 17:21:49 +0000 Subject: [PATCH 0575/7878] One more underlying change to highlight of the Win32 canonical errors. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60552 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 9699cb5c8c2..7938fc325ae 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -211,6 +211,7 @@ static char *apr_os_strerror(char *buf, apr_size_t bufsize, apr_status_t errcode DWORD len; DWORD i; + len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, errcode, @@ -280,17 +281,7 @@ static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize) { if (statcode < APR_OS_START_ERROR) { -#ifdef WIN32 - /* XXX This is just plain wrong. We started discussing this one - * day, and then it dropped, but doing this here is a symptom of a - * problem with the design that will keep us from safely sharing - * Windows code with any other platform. This needs to be changed, - * Windows is NOT a special platform when it comes to APR. rbb - */ - return apr_os_strerror(buf, bufsize, statcode); -#else return stuffbuffer(buf, bufsize, strerror(statcode)); -#endif } else if (statcode < APR_OS_START_USEERR) { return stuffbuffer(buf, bufsize, apr_error_string(statcode)); From 7a142cd20e96954ae7bfb2b116afbf53d36559ea Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 6 Oct 2000 17:24:41 +0000 Subject: [PATCH 0576/7878] Here it is, the Win32 part of the big canonical errors patch. The reason is really, really simple. If we ever choose to mix clib and dos error codes, they criss-cross and don't line up, but they share the same number space. As I wrote the new APR_IS_ERROR macros, I realized we were about to shoot ourselves in the foot. These changes nearly entirely affect Win32 only. The next big patch will affect all of the rv == APR_ENOENT type problems throughout the system. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60553 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 12 ++++++---- file_io/win32/dir.c | 12 +++++----- file_io/win32/filedup.c | 8 +++---- file_io/win32/filestat.c | 44 ++++++++++++++++++----------------- file_io/win32/open.c | 22 +++++++++--------- file_io/win32/pipe.c | 4 ++-- file_io/win32/readwrite.c | 17 +++++++------- file_io/win32/seek.c | 4 ++-- locks/win32/locks.c | 8 +++---- misc/win32/rand.c | 4 ++-- network_io/win32/poll.c | 2 +- network_io/win32/sendrecv.c | 12 +++++----- network_io/win32/sockaddr.c | 2 +- network_io/win32/sockets.c | 22 +++++++++--------- network_io/win32/sockopt.c | 18 +++++++------- threadproc/win32/proc.c | 4 ++-- threadproc/win32/signals.c | 2 +- threadproc/win32/thread.c | 6 ++--- threadproc/win32/threadpriv.c | 8 +++---- 19 files changed, 108 insertions(+), 103 deletions(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 732e86fc924..98277815f9e 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -59,11 +59,13 @@ apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { + /* XXX: Must convert path from / to \ notation + */ HINSTANCE os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); if(os_handle == NULL) { - (*res_handle)->load_error = GetLastError(); + (*res_handle)->load_error = apr_get_os_error(); return (*res_handle)->load_error; } @@ -76,18 +78,18 @@ apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path apr_status_t apr_dso_unload(struct apr_dso_handle_t *handle) { if (!FreeLibrary(handle->handle)) { - return GetLastError(); + return apr_get_os_error(); } return APR_SUCCESS; } apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, - struct apr_dso_handle_t *handle, - const char *symname) + struct apr_dso_handle_t *handle, + const char *symname) { FARPROC retval = GetProcAddress(handle->handle, symname); if (!retval) { - return GetLastError(); + return apr_get_os_error(); } *ressym = retval; diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 2d0d6accb4f..9f864c0824c 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -76,7 +76,7 @@ apr_status_t dir_cleanup(void *thedir) { apr_dir_t *dir = thedir; if (!CloseHandle(dir->dirhand)) { - return GetLastError(); + return apr_get_os_error(); } return APR_SUCCESS; } @@ -103,7 +103,7 @@ apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) apr_status_t apr_closedir(apr_dir_t *thedir) { if (!FindClose(thedir->dirhand)) { - return GetLastError(); + return apr_get_os_error(); } apr_kill_cleanup(thedir->cntxt, thedir, dir_cleanup); return APR_SUCCESS; @@ -115,12 +115,12 @@ apr_status_t apr_readdir(apr_dir_t *thedir) thedir->entry = apr_pcalloc(thedir->cntxt, sizeof(WIN32_FIND_DATA)); thedir->dirhand = FindFirstFile(thedir->dirname, thedir->entry); if (thedir->dirhand == INVALID_HANDLE_VALUE) { - return GetLastError(); + return apr_get_os_error(); } return APR_SUCCESS; } if (!FindNextFile(thedir->dirhand, thedir->entry)) { - return GetLastError(); + return apr_get_os_error(); } return APR_SUCCESS; } @@ -146,7 +146,7 @@ apr_status_t apr_rewinddir(apr_dir_t *thedir) apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { if (!CreateDirectory(path, NULL)) { - return GetLastError(); + return apr_get_os_error(); } return APR_SUCCESS; } @@ -155,7 +155,7 @@ apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) { char *temp = canonical_filename(cont, path); if (!RemoveDirectory(temp)) { - return GetLastError(); + return apr_get_os_error(); } return APR_SUCCESS; } diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 67eae006e4d..535ca6f0456 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -77,7 +77,7 @@ apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t hCurrentProcess, &(*new_file)->filehand, 0, FALSE, DUPLICATE_SAME_ACCESS)) { - return GetLastError(); + return apr_get_os_error(); } } else { HANDLE hFile = (*new_file)->filehand; @@ -87,17 +87,17 @@ apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t if (hFile == GetStdHandle(STD_ERROR_HANDLE)) { isStdHandle = TRUE; if (!SetStdHandle(STD_ERROR_HANDLE, old_file->filehand)) - return GetLastError(); + return apr_get_os_error(); } else if (hFile == GetStdHandle(STD_OUTPUT_HANDLE)) { isStdHandle = TRUE; if (!SetStdHandle(STD_OUTPUT_HANDLE, old_file->filehand)) - return GetLastError(); + return apr_get_os_error(); } else if (hFile == GetStdHandle(STD_INPUT_HANDLE)) { isStdHandle = TRUE; if (!SetStdHandle(STD_INPUT_HANDLE, old_file->filehand)) - return GetLastError(); + return apr_get_os_error(); } else return APR_ENOTIMPL; diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 3684ed7d615..0b241aa4704 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -79,7 +79,11 @@ static apr_filetype_e filetype_from_mode(int mode) return type; } + BOOLEAN is_exe(const char* fname, apr_pool_t *cont) { + /* + * Sleeping code, see notes under apr_stat() + */ const char* exename; const char* ext; exename = strrchr(fname, '/'); @@ -107,12 +111,12 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) DWORD FileType; if (!GetFileInformationByHandle(thefile->filehand, &FileInformation)) { - return GetLastError(); + return apr_get_os_error(); } FileType = GetFileType(thefile->filehand); if (!FileType) { - return GetLastError(); + return apr_get_os_error(); } /* If my rudimentary knowledge of posix serves... inode is the absolute @@ -195,8 +199,7 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) WIN32_FIND_DATA FileInformation; HANDLE hFind; apr_oslevel_e os_level; - apr_status_t rv = APR_SUCCESS; - + memset(finfo,'\0', sizeof(*finfo)); /* We need to catch the case where fname length == MAX_PATH since for @@ -206,38 +209,30 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) * and this is not such a case. */ if (strlen(fname) >= MAX_PATH) { - rv = ERROR_FILENAME_EXCED_RANGE; + return APR_ENAMETOOLONG; } else if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_98) { if (!GetFileAttributesEx(fname, GetFileExInfoStandard, (WIN32_FILE_ATTRIBUTE_DATA*) &FileInformation)) { - rv = GetLastError(); + return apr_get_os_error(); } } else { - /* The question remains, can we assume fname is not a wildcard? - * Must we test it? + /* XXX: The question remains, can we assume fname is not a wildcard? + * Must we test it? Absolutely YES. */ hFind = FindFirstFile(fname, &FileInformation); if (hFind == INVALID_HANDLE_VALUE) { - rv = GetLastError(); + return apr_get_os_error(); } else { FindClose(hFind); } } - if (rv != APR_SUCCESS) { - /* a little ad-hoc canonicalization to the most common - * error conditions - */ - if (rv == ERROR_FILE_NOT_FOUND || rv == ERROR_PATH_NOT_FOUND) - return APR_ENOENT; - return rv; - } - /* Filetype - Directory or file? * Short of opening the handle to the file, the 'FileType' appears - * to be unknowable (in any trustworthy or consistent sense.) + * to be unknowable (in any trustworthy or consistent sense), that + * is, as far as PIPE, CHR, etc. */ if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { finfo->protection = S_IFDIR; @@ -264,6 +259,11 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) * This is a rather silly test, IMHO... we are looking to test * if the user 'may' execute a file (permissions), * not if the filetype is executable. + * XXX: We need to find a solution, for real. Or provide some + * new mechanism for control. Note that the PATHEXT env var, + * in the format .ext[;.ext]... actually lists the 'executable' + * types (invoking without an extension.) Perhaps a registry + * key test is even appropriate here. */ /* if (is_exe(fname, cont)) { * finfo->protection |= S_IEXEC; @@ -276,7 +276,9 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) FileTimeToAprTime(&finfo->mtime, &FileInformation.ftLastWriteTime); /* File size - * Note: This cannot handle files greater than can be held by an int */ + * Note: This cannot handle files greater than can be held by an int + * XXX: Do we want to tag if nFileSizeHigh as -1 (or 0x7fffffff?) + */ finfo->size = FileInformation.nFileSizeLow; return APR_SUCCESS; @@ -285,7 +287,7 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) { /* TODO: determine if apr_lstat is a true NT symlink what the stats of the - * link are, rather than the target. + * link are, rather than the target. NT5 (W2K) only. */ return apr_stat(finfo, fname, cont); } diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 01d6eee5c5b..afc5f4f8feb 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -161,7 +161,7 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, NULL, createflags, attributes, 0); if ((*new)->filehand == INVALID_HANDLE_VALUE) { - return GetLastError(); + return apr_get_os_error(); } if (flag & APR_APPEND) { SetFilePointer((*new)->filehand, 0, NULL, FILE_END); @@ -205,7 +205,7 @@ apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) return APR_SUCCESS; } else { - return GetLastError(); + return apr_get_os_error(); } } @@ -216,21 +216,21 @@ apr_status_t apr_rename_file(const char *from_path, const char *to_path, const char *to_canon = canonical_filename(p, to_path); DWORD err; - /* ### would be nice to use MoveFileEx() here, but it isn't available - ### on Win95/98. MoveFileEx could theoretically help prevent the - ### case where we delete the target but don't move the file(!). - ### it can also copy across devices... - */ + /* TODO: would be nice to use MoveFileEx() here, but it isn't available + * on Win95/98. MoveFileEx could theoretically help prevent the + * case where we delete the target but don't move the file(!). + * it can also copy across devices... + */ if (MoveFile(from_canon, to_canon)) { return APR_SUCCESS; } - err = GetLastError(); - if (err == ERROR_FILE_EXISTS || err == ERROR_ALREADY_EXISTS) { + err = apr_get_os_error(); + if (APR_STATUS_IS_EEXIST(err)) { (void) DeleteFile(to_canon); if (MoveFile(from_canon, to_canon)) return APR_SUCCESS; - err = GetLastError(); + err = apr_get_os_error(); } return err; } @@ -275,7 +275,7 @@ apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) } (*thefile)->filehand = GetStdHandle(STD_ERROR_HANDLE); if ((*thefile)->filehand == INVALID_HANDLE_VALUE) - return GetLastError(); + return apr_get_os_error(); (*thefile)->cntxt = cont; (*thefile)->fname = "STD_ERROR_HANDLE"; (*thefile)->eof_hit = 0; diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 19c9e557b05..b1ddc62dd8e 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -102,7 +102,7 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p) (*out)->direction = 0; if (!CreatePipe(&(*in)->filehand, &(*out)->filehand, &sa, 0)) { - return GetLastError(); + return apr_get_os_error(); } return APR_SUCCESS; @@ -211,7 +211,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, else { /* Pipes on Win9* are blocking. Live with it. */ if (!CreatePipe(&(*in)->filehand, &(*out)->filehand, &sa, 0)) { - return GetLastError(); + return apr_get_os_error(); } } diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index b5c6002df17..72ac0bbf0f4 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -86,8 +86,8 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_ssize_t l &dwBytesRead, // pointer to number of bytes read &dwBytesAvail, // pointer to total number of bytes available &dwBytesLeftThisMsg)) { // pointer to unread bytes in this message - rv = GetLastError(); - if (rv = ERROR_BROKEN_PIPE) + rv = apr_get_os_error(); + if (rv = APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) return APR_SUCCESS; } else { @@ -107,8 +107,8 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_ssize_t l rv = ReadFile(file->filehand, buf, len, nbytes, file->pOverlapped); if (!rv) { - rv = GetLastError(); - if (rv == ERROR_IO_PENDING) { + rv = apr_get_os_error(); + if (rv == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) { /* Wait for the pending i/o */ if (file->timeout > 0) { rv = WaitForSingleObject(file->pOverlapped->hEvent, file->timeout/1000); // timeout in milliseconds... @@ -125,7 +125,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_ssize_t l rv = APR_TIMEUP; break; case WAIT_FAILED: - rv = GetLastError(); + rv = apr_get_os_error(); break; default: break; @@ -134,7 +134,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_ssize_t l CancelIo(file->filehand); } } - else if (rv == ERROR_BROKEN_PIPE) { + else if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) { /* Assume ERROR_BROKEN_PIPE signals an EOF reading from a pipe */ rv = APR_SUCCESS; /* APR_EOF? */ } @@ -263,7 +263,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes } else { (*nbytes) = 0; - rv = GetLastError(); + rv = apr_get_os_error(); } } @@ -365,7 +365,8 @@ apr_status_t apr_flush(apr_file_t *thefile) apr_status_t rc = 0; if (thefile->direction == 1 && thefile->bufpos) { - rc = WriteFile(thefile->filehand, thefile->buffer, thefile->bufpos, &written, NULL ) ? 0 : GetLastError(); + if (!WriteFile(thefile->filehand, thefile->buffer, thefile->bufpos, &written, NULL)) + rc = apr_get_os_error(); thefile->filePtr += written; if (rc == 0) diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index b2aaa5cbf94..3c768ba6b3a 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -76,7 +76,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) rc = SetFilePointer(thefile->filehand, pos, NULL, FILE_BEGIN); if ( rc == 0xFFFFFFFF ) - rc = GetLastError(); + rc = apr_get_os_error(); else rc = thefile->bufpos = thefile->dataRead = 0; } @@ -132,7 +132,7 @@ apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *of rv = SetFilePointer(thefile->filehand, *offset, NULL, howmove); if (rv == -1) { *offset = -1; - return GetLastError(); + return apr_get_os_error(); } else { *offset = rv; diff --git a/locks/win32/locks.c b/locks/win32/locks.c index f499be5cf8a..e4d951cd167 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -107,7 +107,7 @@ apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, (*lock)->mutex = OpenMutex(MUTEX_ALL_ACCESS, TRUE, fname); if ((*lock)->mutex == NULL) { - return GetLastError(); + return apr_get_os_error(); } return APR_SUCCESS; } @@ -125,7 +125,7 @@ apr_status_t apr_lock(apr_lock_t *lock) return APR_SUCCESS; } } - return GetLastError(); + return apr_get_os_error(); } apr_status_t apr_unlock(apr_lock_t *lock) @@ -135,7 +135,7 @@ apr_status_t apr_unlock(apr_lock_t *lock) return APR_SUCCESS; } else { if (ReleaseMutex(lock->mutex) == 0) { - return GetLastError(); + return apr_get_os_error(); } } return APR_SUCCESS; @@ -148,7 +148,7 @@ apr_status_t apr_destroy_lock(apr_lock_t *lock) return APR_SUCCESS; } else { if (CloseHandle(lock->mutex) == 0) { - return GetLastError(); + return apr_get_os_error(); } } return APR_SUCCESS; diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 0f124fdfc61..deeacff7311 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -62,10 +62,10 @@ apr_status_t apr_generate_random_bytes(unsigned char * buf, int length) apr_status_t res = APR_SUCCESS; if (!CryptAcquireContext(&hProv,NULL,NULL,PROV_RSA_FULL,0)) { - return GetLastError(); + return apr_get_os_error(); } if (!CryptGenRandom(hProv,length,buf)) { - res = GetLastError(); + res = apr_get_os_error(); } CryptReleaseContext(hProv, 0); return res; diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 9558f4746bf..87b7d786e30 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -135,7 +135,7 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, (*nsds) = rv; if ((*nsds) < 0) { - return WSAGetLastError(); + return apr_get_netos_error(); } return APR_SUCCESS; } diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index ed6b9a13618..b2380e50190 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -82,7 +82,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) rv = WSASend(sock->sock, &wsaData, 1, &dwBytes, 0, NULL, NULL); if (rv == SOCKET_ERROR) { - lasterror = WSAGetLastError(); + lasterror = apr_get_netos_error(); return lasterror; } @@ -104,7 +104,7 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) rv = WSARecv(sock->sock, &wsaData, 1, &dwBytes, &flags, NULL, NULL); if (rv == SOCKET_ERROR) { - lasterror = WSAGetLastError(); + lasterror = apr_get_netos_error(); *len = 0; return lasterror; } @@ -134,7 +134,7 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, rv = WSASend(sock->sock, pWsaData, nvec, &dwBytes, 0, NULL, NULL); if (rv == SOCKET_ERROR) { - lasterror = WSAGetLastError(); + lasterror = apr_get_netos_error(); free(pWsaData); return lasterror; } @@ -270,8 +270,8 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, ptfb, /* header and trailer buffers */ dwFlags); /* flags to control various aspects of TransmitFile */ if (!rv) { - status = WSAGetLastError(); - if (status == ERROR_IO_PENDING) { + status = apr_get_netos_error(); + if (status == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) { #ifdef WAIT_FOR_EVENT rv = WaitForSingleObject(overlapped.hEvent, sock->timeout >= 0 ? sock->timeout : INFINITE); @@ -286,7 +286,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, else if (rv == WAIT_ABANDONED) status = WAIT_ABANDONED; else - status = GetLastError(); + status = apr_get_os_error(); } } if (status != APR_SUCCESS) diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index a80c8f5eac0..e72140ffc8f 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -64,7 +64,7 @@ static apr_status_t get_local_addr(apr_socket_t *sock) if (getsockname(sock->sock, (struct sockaddr *)sock->local_addr, &namelen) < 0) { - return WSAGetLastError(); + return apr_get_netos_error(); } else { sock->local_port_unknown = sock->local_interface_unknown = 0; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 1db68366645..e0d62d33a32 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -66,7 +66,7 @@ static apr_status_t socket_cleanup(void *sock) if (thesocket->sock != INVALID_SOCKET) { if (closesocket(thesocket->sock) == SOCKET_ERROR) { - return WSAGetLastError(); + return apr_get_netos_error(); } thesocket->sock = INVALID_SOCKET; } @@ -94,7 +94,7 @@ apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) */ (*new)->sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if ((*new)->sock == INVALID_SOCKET) { - return WSAGetLastError(); + return apr_get_netos_error(); } (*new)->local_addr->sin_family = AF_INET; @@ -135,7 +135,7 @@ apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) return APR_SUCCESS; } else { - return WSAGetLastError(); + return apr_get_netos_error(); } } @@ -148,7 +148,7 @@ apr_status_t apr_close_socket(apr_socket_t *thesocket) apr_status_t apr_bind(apr_socket_t *sock) { if (bind(sock->sock, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) { - return WSAGetLastError(); + return apr_get_netos_error(); } else { if (sock->local_addr->sin_port == 0) { @@ -161,7 +161,7 @@ apr_status_t apr_bind(apr_socket_t *sock) apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->sock, backlog) == SOCKET_ERROR) - return WSAGetLastError(); + return apr_get_netos_error(); else return APR_SUCCESS; } @@ -186,7 +186,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn &(*new)->addr_len); if ((*new)->sock == INVALID_SOCKET) { - return WSAGetLastError(); + return apr_get_netos_error(); } *(*new)->local_addr = *sock->local_addr; @@ -215,7 +215,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn apr_status_t apr_connect(apr_socket_t *sock, char *hostname) { struct hostent *hp; - int lasterror; + apr_status_t lasterror; fd_set temp; if ((sock->sock == INVALID_SOCKET) || (!sock->local_addr)) { @@ -230,7 +230,7 @@ apr_status_t apr_connect(apr_socket_t *sock, char *hostname) else { hp = gethostbyname(hostname); if (!hp) { - return WSAGetLastError(); + return apr_get_netos_error(); } memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr_list[0], hp->h_length); sock->addr_len = sizeof(*sock->remote_addr); @@ -241,15 +241,15 @@ apr_status_t apr_connect(apr_socket_t *sock, char *hostname) if (connect(sock->sock, (const struct sockaddr *)sock->remote_addr, sock->addr_len) == SOCKET_ERROR) { - lasterror = WSAGetLastError(); - if (lasterror != WSAEWOULDBLOCK) { + lasterror = apr_get_netos_error(); + if (lasterror != APR_FROM_OS_ERROR(WSAEWOULDBLOCK)) { return lasterror; } /* wait for the connect to complete */ FD_ZERO(&temp); FD_SET(sock->sock, &temp); if (select(sock->sock+1, NULL, &temp, NULL, NULL) == SOCKET_ERROR) { - return WSAGetLastError(); + return apr_get_netos_error(); } } /* connect was OK .. amazing */ diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 811dc6e7697..e40034296f2 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -63,7 +63,7 @@ apr_status_t soblock(SOCKET sd) int zero = 0; if (ioctlsocket(sd, FIONBIO, &zero) == SOCKET_ERROR) { - return WSAGetLastError(); + return apr_get_netos_error(); } return APR_SUCCESS; } @@ -73,7 +73,7 @@ apr_status_t sononblock(SOCKET sd) int one = 1; if (ioctlsocket(sd, FIONBIO, &one) == SOCKET_ERROR) { - return WSAGetLastError(); + return apr_get_netos_error(); } return APR_SUCCESS; } @@ -124,17 +124,17 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o } case APR_SO_KEEPALIVE: if (setsockopt(sock->sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { - return WSAGetLastError(); + return apr_get_netos_error(); } break; case APR_SO_DEBUG: if (setsockopt(sock->sock, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { - return WSAGetLastError(); + return apr_get_netos_error(); } break; case APR_SO_REUSEADDR: if (setsockopt(sock->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { - return WSAGetLastError(); + return apr_get_netos_error(); } break; case APR_SO_NONBLOCK: @@ -153,13 +153,13 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o li.l_onoff = on; li.l_linger = MAX_SECS_TO_LINGER; if (setsockopt(sock->sock, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { - return WSAGetLastError(); + return apr_get_netos_error(); } break; } case APR_TCP_NODELAY: if (setsockopt(sock->sock, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { - return WSAGetLastError(); + return apr_get_netos_error(); } break; default: @@ -196,7 +196,7 @@ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t * apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont) { if (gethostname(buf, len) == -1) - return WSAGetLastError(); + return apr_get_netos_error(); else return APR_SUCCESS; } @@ -216,7 +216,7 @@ apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) return APR_ENOMEM; } - return WSAGetLastError(); + return apr_get_netos_error(); } diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index c362d07bae6..04f88ab0fc7 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -333,7 +333,7 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, || (attr->child_err && !DuplicateHandle(hCurrentProcess, attr->parent_err->filehand, hCurrentProcess, &hParenterrdup, 0, FALSE, DUPLICATE_SAME_ACCESS))) { - rv = GetLastError(); + rv = apr_get_os_error(); if (attr->child_in) { apr_close(attr->child_in); apr_close(attr->parent_in); @@ -423,7 +423,7 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, return APR_SUCCESS; } - return GetLastError(); + return apr_get_os_error(); } apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e wait) diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 8346c40f53b..f19e36e7bb8 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -67,7 +67,7 @@ apr_status_t apr_kill(apr_proc_t *proc, int signal) { if (TerminateProcess((HANDLE)proc->pid, signal) == 0) { - return GetLastError(); + return apr_get_os_error(); } return APR_SUCCESS; } diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 1d10d27d228..37e7146a10f 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -113,7 +113,7 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, */ if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, (unsigned int (APR_THREAD_FUNC *)(void *))func, data, 0, &temp)) == 0) { - lasterror = GetLastError(); + lasterror = apr_get_os_error(); return APR_EEXIST; /* MSVC++ doc doesn't mention any additional error info */ } @@ -139,7 +139,7 @@ apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) if (GetExitCodeThread(thd->td, retval) == 0) { return APR_SUCCESS; } - return GetLastError(); + return apr_get_os_error(); } else { return stat; @@ -152,7 +152,7 @@ apr_status_t apr_thread_detach(apr_thread_t *thd) return APR_SUCCESS; } else { - return GetLastError(); + return apr_get_os_error(); } } diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index f7fca12f0a8..59da3d4ea89 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -65,7 +65,7 @@ apr_status_t apr_create_thread_private(apr_threadkey_t **key, if (((*key)->key = TlsAlloc()) != 0xFFFFFFFF) { return APR_SUCCESS; } - return GetLastError(); + return apr_get_os_error(); } apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) @@ -73,7 +73,7 @@ apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) if ((*new) = TlsGetValue(key->key)) { return APR_SUCCESS; } - return GetLastError(); + return apr_get_os_error(); } apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) @@ -81,7 +81,7 @@ apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) if (TlsSetValue(key->key, priv)) { return APR_SUCCESS; } - return GetLastError(); + return apr_get_os_error(); } apr_status_t apr_delete_thread_private(apr_threadkey_t *key) @@ -89,7 +89,7 @@ apr_status_t apr_delete_thread_private(apr_threadkey_t *key) if (TlsFree(key->key)) { return APR_SUCCESS; } - return GetLastError(); + return apr_get_os_error(); } apr_status_t apr_get_threadkeydata(void **data, const char *key, From dc816c52fe7f6770edf42e9a6b61387d560b7aab Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 6 Oct 2000 17:52:44 +0000 Subject: [PATCH 0577/7878] Completed review for new tests: APR_STATUS_IS_EACCES(s) APR_STATUS_IS_EEXIST(s) APR_STATUS_IS_ENAMETOOLONG(s) APR_STATUS_IS_ENOENT(s) Where the old EACCES et. al. still exist, we have a problem (not yet using APR at all) More to come... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60554 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/mm/mm_core.c | 4 ++-- threadproc/win32/thread.c | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/shmem/unix/mm/mm_core.c b/shmem/unix/mm/mm_core.c index 4b9a62bd90b..a0535bf06fa 100644 --- a/shmem/unix/mm/mm_core.c +++ b/shmem/unix/mm/mm_core.c @@ -315,14 +315,14 @@ void *mm_core_create(size_t usersize, const char *file) #if defined(MM_SEMT_IPCSEM) fdsem = semget(IPC_PRIVATE, 1, IPC_CREAT|IPC_EXCL|S_IRUSR|S_IWUSR); - if (fdsem == -1 && errno == EEXIST) + if (fdsem == -1 && APR_STATUS_IS_EEXIST(errno)) fdsem = semget(IPC_PRIVATE, 1, IPC_EXCL|S_IRUSR|S_IWUSR); if (fdsem == -1) FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to acquire semaphore"); mm_core_semctlarg.val = 0; semctl(fdsem, 0, SETVAL, mm_core_semctlarg); fdsem_rd = semget(IPC_PRIVATE, 1, IPC_CREAT|IPC_EXCL|S_IRUSR|S_IWUSR); - if (fdsem_rd == -1 && errno == EEXIST) + if (fdsem_rd == -1 && APR_STATUS_IS_EEXIST(errno)) fdsem_rd = semget(IPC_PRIVATE, 1, IPC_EXCL|S_IRUSR|S_IWUSR); if (fdsem_rd == -1) FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to acquire semaphore"); diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 37e7146a10f..eb94fec8b93 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -114,7 +114,10 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, (unsigned int (APR_THREAD_FUNC *)(void *))func, data, 0, &temp)) == 0) { lasterror = apr_get_os_error(); - return APR_EEXIST; /* MSVC++ doc doesn't mention any additional error info */ + return APR_EEXIST; + /* MSVC++ doc doesn't mention any additional error info + * XXX: need to check the sources + */ } if (attr && attr->detach) { From f5b1d33f936f8ab7b9e711c677f38a6bfded4cc5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 6 Oct 2000 18:15:14 +0000 Subject: [PATCH 0578/7878] back this out, should have never been touched. Submitted by: rbb git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60555 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/mm/mm_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shmem/unix/mm/mm_core.c b/shmem/unix/mm/mm_core.c index a0535bf06fa..4b9a62bd90b 100644 --- a/shmem/unix/mm/mm_core.c +++ b/shmem/unix/mm/mm_core.c @@ -315,14 +315,14 @@ void *mm_core_create(size_t usersize, const char *file) #if defined(MM_SEMT_IPCSEM) fdsem = semget(IPC_PRIVATE, 1, IPC_CREAT|IPC_EXCL|S_IRUSR|S_IWUSR); - if (fdsem == -1 && APR_STATUS_IS_EEXIST(errno)) + if (fdsem == -1 && errno == EEXIST) fdsem = semget(IPC_PRIVATE, 1, IPC_EXCL|S_IRUSR|S_IWUSR); if (fdsem == -1) FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to acquire semaphore"); mm_core_semctlarg.val = 0; semctl(fdsem, 0, SETVAL, mm_core_semctlarg); fdsem_rd = semget(IPC_PRIVATE, 1, IPC_CREAT|IPC_EXCL|S_IRUSR|S_IWUSR); - if (fdsem_rd == -1 && APR_STATUS_IS_EEXIST(errno)) + if (fdsem_rd == -1 && errno == EEXIST) fdsem_rd = semget(IPC_PRIVATE, 1, IPC_EXCL|S_IRUSR|S_IWUSR); if (fdsem_rd == -1) FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to acquire semaphore"); From dda4739d82de9c15b78494624db09f505d5299e5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 6 Oct 2000 22:02:04 +0000 Subject: [PATCH 0579/7878] Knock off some XXX's prior to a7. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60556 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 17 +++++++++++++++-- file_io/win32/filestat.c | 7 +++++-- network_io/win32/poll.c | 1 + 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 98277815f9e..e4dbad23e90 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -53,15 +53,28 @@ */ #include "dso.h" +#include "apr_strings.h" #if APR_HAS_DSO apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { - /* XXX: Must convert path from / to \ notation + HINSTANCE os_handle; + char fspec[MAX_PATH], *p; + + /* Must convert path from / to \ notation. + * Per PR2555, the LoadLibraryEx function is very picky about slashes. + * Debugging on NT 4 SP 6a reveals First Chance Exception within NTDLL. + * LoadLibrary in the MS PSDK also reveals that it -explicitly- states + * that backslashes must be used for the LoadLibrary family of calls. */ - HINSTANCE os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + apr_cpystrn(fspec, path, MAX_PATH); + for (p = fspec; *p; ++p) + if (*p == '/') + *p = '\\'; + + os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); if(os_handle == NULL) { diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 0b241aa4704..67cb0161c3a 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -218,9 +218,10 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) } } else { - /* XXX: The question remains, can we assume fname is not a wildcard? - * Must we test it? Absolutely YES. + /* What a waste of cpu cycles... but what else can we do? */ + if (strchr(fname, '*') || strchr(fname, '?')) + return APR_ENOENT; hFind = FindFirstFile(fname, &FileInformation); if (hFind == INVALID_HANDLE_VALUE) { return apr_get_os_error(); @@ -280,6 +281,8 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) * XXX: Do we want to tag if nFileSizeHigh as -1 (or 0x7fffffff?) */ finfo->size = FileInformation.nFileSizeLow; + if (finfo->size < 0 || FileInformation.nFileSizeLow) + finfo->size = 0x7fffffff; return APR_SUCCESS; } diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 87b7d786e30..925fd7da746 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -157,6 +157,7 @@ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_ revents |= APR_POLLIN; if (WSARecv(sock->sock, &data, 1, &dummy, &flags, NULL, NULL) == SOCKET_ERROR) { + /* This is only legit since we don't return the error */ dummy = WSAGetLastError(); switch (dummy) { case WSAECONNRESET: From 3dd6e5ba2546637437fb7a08e18ff01c810a9140 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 6 Oct 2000 22:37:52 +0000 Subject: [PATCH 0580/7878] Oh, duh. Typo. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60557 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 67cb0161c3a..c2d7345c003 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -276,12 +276,10 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) FileTimeToAprTime(&finfo->ctime, &FileInformation.ftCreationTime); FileTimeToAprTime(&finfo->mtime, &FileInformation.ftLastWriteTime); - /* File size - * Note: This cannot handle files greater than can be held by an int - * XXX: Do we want to tag if nFileSizeHigh as -1 (or 0x7fffffff?) + /* Note: This cannot handle files greater than can be held by an int */ finfo->size = FileInformation.nFileSizeLow; - if (finfo->size < 0 || FileInformation.nFileSizeLow) + if (finfo->size < 0 || FileInformation.nFileSizeHigh) finfo->size = 0x7fffffff; return APR_SUCCESS; From 66cab2b6f28342ce19f8e9c7d94cd0927b124f30 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Fri, 6 Oct 2000 22:50:54 +0000 Subject: [PATCH 0581/7878] apr_open() always allocates storage for the apr_file_t now. The caller is no longer responsible for initializing their apr_file_t* to NULL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60558 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 5 +---- file_io/win32/open.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 5060b77fcbc..dab768f4df4 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -85,10 +85,7 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, ap apr_status_t rv; #endif - if ((*new) == NULL) { - (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); - } - + (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); (*new)->cntxt = cont; (*new)->oflags = oflags; (*new)->filedes = -1; diff --git a/file_io/win32/open.c b/file_io/win32/open.c index afc5f4f8feb..21c577d2c9c 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -85,10 +85,7 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, apr_oslevel_e level; apr_status_t rv; - if ((*new) == NULL) { - (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); - } - + (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); (*new)->cntxt = cont; if (flag & APR_READ) { From 1ffa4e586a944146913da09246d0475ba90cc739 Mon Sep 17 00:00:00 2001 From: Jim Jagielski <jim@apache.org> Date: Sat, 7 Oct 2000 00:37:17 +0000 Subject: [PATCH 0582/7878] This is ugly, but at least we compile again on platforms that lack sendfile(). PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60559 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 6bff5cb482b..8a7cab6ac96 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -145,6 +145,15 @@ struct apr_hdtr_t { /** number of trailers in the iovec */ int numtrailers; }; +#else +/* + * we need to define something for non-sendfile systems, since + * we don't abtract out function calls (eg: send_the_file in http_core.c)) + * depending on sendfile existance + */ +struct apr_hdtr_t { + int dummy; +}; #endif /* function definitions */ From 0b35eca2fd00a3cfc6000d8bc503d05ab257a27c Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sat, 7 Oct 2000 08:21:15 +0000 Subject: [PATCH 0583/7878] doc nit and I missed a change to Makefile.in. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60560 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_uuid.h | 6 +++--- misc/unix/Makefile.in | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr_uuid.h b/include/apr_uuid.h index 73a726a22e6..a401a62563a 100644 --- a/include/apr_uuid.h +++ b/include/apr_uuid.h @@ -74,7 +74,7 @@ typedef struct { /** * Generate and return a (new) UUID * @param uuid The resulting UUID - * @deffunc int apr_get_uuid(apr_uuid_t *uuid) + * @deffunc void apr_get_uuid(apr_uuid_t *uuid) */ void apr_get_uuid(apr_uuid_t *uuid); @@ -84,7 +84,7 @@ void apr_get_uuid(apr_uuid_t *uuid); * be at least APR_UUID_FORMATTED_LENGTH + 1 bytes long to hold * the formatted UUID and a null terminator * @param uuid The UUID to format - * @deffunc int apr_format_uuid(apr_pool_t *p, const apr_uuid_t *uuid) + * @deffunc void apr_format_uuid(apr_pool_t *p, const apr_uuid_t *uuid) */ void apr_format_uuid(char *buffer, const apr_uuid_t *uuid); @@ -92,7 +92,7 @@ void apr_format_uuid(char *buffer, const apr_uuid_t *uuid); * Parse a standard-format string into a UUID * @param uuid The resulting UUID * @param uuid_str The formatted UUID - * @deffunc int apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str) + * @deffunc apr_status_t apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str) */ apr_status_t apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str); diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index 8cf7c3f26e8..0cea0439d74 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -18,7 +18,7 @@ INCLUDES=-I$(INCDIR1) -I$(INCDIR2) -I$(INCDIR3) -I$(INCDIR4) -I. #LIB=libmisc.a OBJS=start.o getopt.o otherchild.o errorcodes.o rand.o canonerr.o \ - uuid.c getuuid.c + uuid.o getuuid.o .c.o: $(CC) $(CFLAGS) -c $(INCLUDES) $< From 6faebb1e89ea52857c3cd12fdc6e12fb91c49f25 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 7 Oct 2000 21:54:15 +0000 Subject: [PATCH 0584/7878] Update send_the_file to fall back to a read/write loop on platforms without sendfile. This also makes the apr_hdtr_t type available on all platforms, regardless of whether apr_sendfile is defined or not. Submitted by: Brian Havard and Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60561 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 8a7cab6ac96..f71e6bc39d3 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -131,6 +131,7 @@ typedef struct in_addr apr_in_addr; #if APR_HAS_SENDFILE /* Define flags passed in on apr_sendfile() */ #define APR_SENDFILE_DISCONNECT_SOCKET 1 +#endif /** A structure to encapsulate headers and trailers for apr_sendfile */ struct apr_hdtr_t { @@ -145,16 +146,6 @@ struct apr_hdtr_t { /** number of trailers in the iovec */ int numtrailers; }; -#else -/* - * we need to define something for non-sendfile systems, since - * we don't abtract out function calls (eg: send_the_file in http_core.c)) - * depending on sendfile existance - */ -struct apr_hdtr_t { - int dummy; -}; -#endif /* function definitions */ From 2a8db10941ae3b5ead33581f4c52de02b6ea8b26 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Sun, 8 Oct 2000 02:13:58 +0000 Subject: [PATCH 0585/7878] Add some headers needed for a clean compile on OS/2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60562 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getuuid.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index b3efd645aae..cd17a553dd0 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -59,11 +59,16 @@ #include <unistd.h> /* for getpid, gethostname */ #include <stdlib.h> /* for rand, srand */ +#include <sys/time.h> /* for gettimeofday */ #include "apr.h" +#include "apr_private.h" #include "apr_uuid.h" #include "apr_md5.h" #include "apr_general.h" +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif #define NODE_LENGTH 6 From 75f57f1ae32b5e52c4d99b9afc38e734ec8987fe Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 8 Oct 2000 04:00:36 +0000 Subject: [PATCH 0586/7878] If we determine that a platform does not have DSO support, then it makes no sense to try to build DSO support. This changes stops us from doing that. PR: 6436 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60563 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 0ed9a8ec104..9e69dbd5c7a 100644 --- a/configure.in +++ b/configure.in @@ -35,7 +35,7 @@ fi # These added to allow default directories to be used... DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" -MODULES="file_io network_io threadproc misc locks time mmap shmem dso i18n" +MODULES="file_io network_io threadproc misc locks time mmap shmem i18n" # Most platforms use a prefix of 'lib' on their library files. LIBPREFIX='lib' @@ -468,6 +468,7 @@ if test "$tempdso" = "no"; then aprdso="0" else aprdso="1" + MODULES="$MODULES dso" fi AC_SUBST(aprdso) From 44cf0b983c8057546626c92a112effd53e1218cc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 8 Oct 2000 06:00:27 +0000 Subject: [PATCH 0587/7878] Movin on over from 1.3.13-dev : this patch fixes the problem of nasty popup windows alerting an Admin that the isapi isn't working, and simplifies mod_isapi by relying on dso. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60564 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index e4dbad23e90..be80510d5ed 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -61,7 +61,8 @@ apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path apr_pool_t *ctx) { HINSTANCE os_handle; - char fspec[MAX_PATH], *p; + char fspec[MAX_PATH], *p = fspec; + UINT em; /* Must convert path from / to \ notation. * Per PR2555, the LoadLibraryEx function is very picky about slashes. @@ -70,11 +71,15 @@ apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path * that backslashes must be used for the LoadLibrary family of calls. */ apr_cpystrn(fspec, path, MAX_PATH); - for (p = fspec; *p; ++p) - if (*p == '/') - *p = '\\'; + while (p = strchr(p, '/')) + *p = '\\'; + /* Prevent ugly popups from killing our app */ + em = SetErrorMode(SEM_FAILCRITICALERRORS); os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + if (!os_handle) + os_handle = LoadLibraryEx(path, NULL, 0); + SetErrorMode(em); *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); if(os_handle == NULL) { From 0e3714d188ae0d11c374b2c47365f1f677fd67c6 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Sun, 8 Oct 2000 07:19:14 +0000 Subject: [PATCH 0588/7878] OS/2: Pass apr_lstat through to apr_stat as we don't have symlinks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60565 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filestat.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 544f95ad41f..1410cdb91bb 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -167,3 +167,10 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) return APR_OS2_STATUS(rc); } + + + +apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) +{ + return apr_stat(finfo, fname, cont); +} From da49ede8a1019c3017206e46a1b01afc8f9bbdce Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Mon, 9 Oct 2000 06:46:49 +0000 Subject: [PATCH 0589/7878] Sort out OS/2 APR error handling with new canonical test macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60567 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 11 ++++---- include/arch/os2/os2calls.h | 49 +--------------------------------- include/arch/os2/os2nerrno.h | 51 ++++++++++++++++++++++++++++++++++++ network_io/os2/os2calls.h | 49 +--------------------------------- network_io/os2/os2nerrno.h | 51 ++++++++++++++++++++++++++++++++++++ 5 files changed, 109 insertions(+), 102 deletions(-) create mode 100644 include/arch/os2/os2nerrno.h create mode 100644 network_io/os2/os2nerrno.h diff --git a/include/apr_errno.h b/include/apr_errno.h index 3991cebede8..57767780d0e 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -347,16 +347,15 @@ int apr_canonical_error(apr_status_t err); #endif -#if defined(OS2) /* endif !defined(WIN32) && !defined(OS2) */ +#if defined(OS2) -/* uhhh... I dunno - */ #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) -#define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) -#define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) - +#define INCL_DOSERRORS +#define INCL_DOS +#include <os2.h> +#include "../network_io/os2/os2nerrno.h" /* And this needs to be greped away for good: */ #define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e)) diff --git a/include/arch/os2/os2calls.h b/include/arch/os2/os2calls.h index 40d54ee6e68..8a8b83bd0db 100644 --- a/include/arch/os2/os2calls.h +++ b/include/arch/os2/os2calls.h @@ -54,6 +54,7 @@ #include <sys/types.h> #include <sys/socket.h> +#include "os2nerrno.h" extern int (*apr_os2_socket)(int, int, int); extern int (*apr_os2_select)(int *, int, int, int, long); @@ -90,51 +91,3 @@ extern int (*apr_os2_writev)(int, struct iovec *, int); #define shutdown apr_os2_shutdown #define soclose apr_os2_soclose #define writev apr_os2_writev - - -/* Error codes returned by above calls */ -#define SOCBASEERR 10000 - -#define SOCEPERM (SOCBASEERR+1) /* Not owner */ -#define SOCESRCH (SOCBASEERR+3) /* No such process */ -#define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */ -#define SOCENXIO (SOCBASEERR+6) /* No such device or address */ -#define SOCEBADF (SOCBASEERR+9) /* Bad file number */ -#define SOCEACCES (SOCBASEERR+13) /* Permission denied */ -#define SOCEFAULT (SOCBASEERR+14) /* Bad address */ -#define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */ -#define SOCEMFILE (SOCBASEERR+24) /* Too many open files */ -#define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ -#define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ -#define SOCEWOULDBLOCK (SOCBASEERR+35) /* Operation would block */ -#define SOCEINPROGRESS (SOCBASEERR+36) /* Operation now in progress */ -#define SOCEALREADY (SOCBASEERR+37) /* Operation already in progress */ -#define SOCENOTSOCK (SOCBASEERR+38) /* Socket operation on non-socket */ -#define SOCEDESTADDRREQ (SOCBASEERR+39) /* Destination address required */ -#define SOCEMSGSIZE (SOCBASEERR+40) /* Message too long */ -#define SOCEPROTOTYPE (SOCBASEERR+41) /* Protocol wrong type for socket */ -#define SOCENOPROTOOPT (SOCBASEERR+42) /* Protocol not available */ -#define SOCEPROTONOSUPPORT (SOCBASEERR+43) /* Protocol not supported */ -#define SOCESOCKTNOSUPPORT (SOCBASEERR+44) /* Socket type not supported */ -#define SOCEOPNOTSUPP (SOCBASEERR+45) /* Operation not supported on socket */ -#define SOCEPFNOSUPPORT (SOCBASEERR+46) /* Protocol family not supported */ -#define SOCEAFNOSUPPORT (SOCBASEERR+47) /* Address family not supported by protocol family */ -#define SOCEADDRINUSE (SOCBASEERR+48) /* Address already in use */ -#define SOCEADDRNOTAVAIL (SOCBASEERR+49) /* Can't assign requested address */ -#define SOCENETDOWN (SOCBASEERR+50) /* Network is down */ -#define SOCENETUNREACH (SOCBASEERR+51) /* Network is unreachable */ -#define SOCENETRESET (SOCBASEERR+52) /* Network dropped connection on reset */ -#define SOCECONNABORTED (SOCBASEERR+53) /* Software caused connection abort */ -#define SOCECONNRESET (SOCBASEERR+54) /* Connection reset by peer */ -#define SOCENOBUFS (SOCBASEERR+55) /* No buffer space available */ -#define SOCEISCONN (SOCBASEERR+56) /* Socket is already connected */ -#define SOCENOTCONN (SOCBASEERR+57) /* Socket is not connected */ -#define SOCESHUTDOWN (SOCBASEERR+58) /* Can't send after socket shutdown */ -#define SOCETOOMANYREFS (SOCBASEERR+59) /* Too many references: can't splice */ -#define SOCETIMEDOUT (SOCBASEERR+60) /* Connection timed out */ -#define SOCECONNREFUSED (SOCBASEERR+61) /* Connection refused */ -#define SOCELOOP (SOCBASEERR+62) /* Too many levels of symbolic links */ -#define SOCENAMETOOLONG (SOCBASEERR+63) /* File name too long */ -#define SOCEHOSTDOWN (SOCBASEERR+64) /* Host is down */ -#define SOCEHOSTUNREACH (SOCBASEERR+65) /* No route to host */ -#define SOCENOTEMPTY (SOCBASEERR+66) /* Directory not empty */ diff --git a/include/arch/os2/os2nerrno.h b/include/arch/os2/os2nerrno.h new file mode 100644 index 00000000000..0d6b444e206 --- /dev/null +++ b/include/arch/os2/os2nerrno.h @@ -0,0 +1,51 @@ +#ifndef __OS2NERRNO_H +#define __OS2NERRNO_H + +/* Error codes returned by above calls */ +#define SOCBASEERR 10000 + +#define SOCEPERM (SOCBASEERR+1) /* Not owner */ +#define SOCESRCH (SOCBASEERR+3) /* No such process */ +#define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */ +#define SOCENXIO (SOCBASEERR+6) /* No such device or address */ +#define SOCEBADF (SOCBASEERR+9) /* Bad file number */ +#define SOCEACCES (SOCBASEERR+13) /* Permission denied */ +#define SOCEFAULT (SOCBASEERR+14) /* Bad address */ +#define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */ +#define SOCEMFILE (SOCBASEERR+24) /* Too many open files */ +#define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ +#define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ +#define SOCEWOULDBLOCK (SOCBASEERR+35) /* Operation would block */ +#define SOCEINPROGRESS (SOCBASEERR+36) /* Operation now in progress */ +#define SOCEALREADY (SOCBASEERR+37) /* Operation already in progress */ +#define SOCENOTSOCK (SOCBASEERR+38) /* Socket operation on non-socket */ +#define SOCEDESTADDRREQ (SOCBASEERR+39) /* Destination address required */ +#define SOCEMSGSIZE (SOCBASEERR+40) /* Message too long */ +#define SOCEPROTOTYPE (SOCBASEERR+41) /* Protocol wrong type for socket */ +#define SOCENOPROTOOPT (SOCBASEERR+42) /* Protocol not available */ +#define SOCEPROTONOSUPPORT (SOCBASEERR+43) /* Protocol not supported */ +#define SOCESOCKTNOSUPPORT (SOCBASEERR+44) /* Socket type not supported */ +#define SOCEOPNOTSUPP (SOCBASEERR+45) /* Operation not supported on socket */ +#define SOCEPFNOSUPPORT (SOCBASEERR+46) /* Protocol family not supported */ +#define SOCEAFNOSUPPORT (SOCBASEERR+47) /* Address family not supported by protocol family */ +#define SOCEADDRINUSE (SOCBASEERR+48) /* Address already in use */ +#define SOCEADDRNOTAVAIL (SOCBASEERR+49) /* Can't assign requested address */ +#define SOCENETDOWN (SOCBASEERR+50) /* Network is down */ +#define SOCENETUNREACH (SOCBASEERR+51) /* Network is unreachable */ +#define SOCENETRESET (SOCBASEERR+52) /* Network dropped connection on reset */ +#define SOCECONNABORTED (SOCBASEERR+53) /* Software caused connection abort */ +#define SOCECONNRESET (SOCBASEERR+54) /* Connection reset by peer */ +#define SOCENOBUFS (SOCBASEERR+55) /* No buffer space available */ +#define SOCEISCONN (SOCBASEERR+56) /* Socket is already connected */ +#define SOCENOTCONN (SOCBASEERR+57) /* Socket is not connected */ +#define SOCESHUTDOWN (SOCBASEERR+58) /* Can't send after socket shutdown */ +#define SOCETOOMANYREFS (SOCBASEERR+59) /* Too many references: can't splice */ +#define SOCETIMEDOUT (SOCBASEERR+60) /* Connection timed out */ +#define SOCECONNREFUSED (SOCBASEERR+61) /* Connection refused */ +#define SOCELOOP (SOCBASEERR+62) /* Too many levels of symbolic links */ +#define SOCENAMETOOLONG (SOCBASEERR+63) /* File name too long */ +#define SOCEHOSTDOWN (SOCBASEERR+64) /* Host is down */ +#define SOCEHOSTUNREACH (SOCBASEERR+65) /* No route to host */ +#define SOCENOTEMPTY (SOCBASEERR+66) /* Directory not empty */ + +#endif diff --git a/network_io/os2/os2calls.h b/network_io/os2/os2calls.h index 40d54ee6e68..8a8b83bd0db 100644 --- a/network_io/os2/os2calls.h +++ b/network_io/os2/os2calls.h @@ -54,6 +54,7 @@ #include <sys/types.h> #include <sys/socket.h> +#include "os2nerrno.h" extern int (*apr_os2_socket)(int, int, int); extern int (*apr_os2_select)(int *, int, int, int, long); @@ -90,51 +91,3 @@ extern int (*apr_os2_writev)(int, struct iovec *, int); #define shutdown apr_os2_shutdown #define soclose apr_os2_soclose #define writev apr_os2_writev - - -/* Error codes returned by above calls */ -#define SOCBASEERR 10000 - -#define SOCEPERM (SOCBASEERR+1) /* Not owner */ -#define SOCESRCH (SOCBASEERR+3) /* No such process */ -#define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */ -#define SOCENXIO (SOCBASEERR+6) /* No such device or address */ -#define SOCEBADF (SOCBASEERR+9) /* Bad file number */ -#define SOCEACCES (SOCBASEERR+13) /* Permission denied */ -#define SOCEFAULT (SOCBASEERR+14) /* Bad address */ -#define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */ -#define SOCEMFILE (SOCBASEERR+24) /* Too many open files */ -#define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ -#define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ -#define SOCEWOULDBLOCK (SOCBASEERR+35) /* Operation would block */ -#define SOCEINPROGRESS (SOCBASEERR+36) /* Operation now in progress */ -#define SOCEALREADY (SOCBASEERR+37) /* Operation already in progress */ -#define SOCENOTSOCK (SOCBASEERR+38) /* Socket operation on non-socket */ -#define SOCEDESTADDRREQ (SOCBASEERR+39) /* Destination address required */ -#define SOCEMSGSIZE (SOCBASEERR+40) /* Message too long */ -#define SOCEPROTOTYPE (SOCBASEERR+41) /* Protocol wrong type for socket */ -#define SOCENOPROTOOPT (SOCBASEERR+42) /* Protocol not available */ -#define SOCEPROTONOSUPPORT (SOCBASEERR+43) /* Protocol not supported */ -#define SOCESOCKTNOSUPPORT (SOCBASEERR+44) /* Socket type not supported */ -#define SOCEOPNOTSUPP (SOCBASEERR+45) /* Operation not supported on socket */ -#define SOCEPFNOSUPPORT (SOCBASEERR+46) /* Protocol family not supported */ -#define SOCEAFNOSUPPORT (SOCBASEERR+47) /* Address family not supported by protocol family */ -#define SOCEADDRINUSE (SOCBASEERR+48) /* Address already in use */ -#define SOCEADDRNOTAVAIL (SOCBASEERR+49) /* Can't assign requested address */ -#define SOCENETDOWN (SOCBASEERR+50) /* Network is down */ -#define SOCENETUNREACH (SOCBASEERR+51) /* Network is unreachable */ -#define SOCENETRESET (SOCBASEERR+52) /* Network dropped connection on reset */ -#define SOCECONNABORTED (SOCBASEERR+53) /* Software caused connection abort */ -#define SOCECONNRESET (SOCBASEERR+54) /* Connection reset by peer */ -#define SOCENOBUFS (SOCBASEERR+55) /* No buffer space available */ -#define SOCEISCONN (SOCBASEERR+56) /* Socket is already connected */ -#define SOCENOTCONN (SOCBASEERR+57) /* Socket is not connected */ -#define SOCESHUTDOWN (SOCBASEERR+58) /* Can't send after socket shutdown */ -#define SOCETOOMANYREFS (SOCBASEERR+59) /* Too many references: can't splice */ -#define SOCETIMEDOUT (SOCBASEERR+60) /* Connection timed out */ -#define SOCECONNREFUSED (SOCBASEERR+61) /* Connection refused */ -#define SOCELOOP (SOCBASEERR+62) /* Too many levels of symbolic links */ -#define SOCENAMETOOLONG (SOCBASEERR+63) /* File name too long */ -#define SOCEHOSTDOWN (SOCBASEERR+64) /* Host is down */ -#define SOCEHOSTUNREACH (SOCBASEERR+65) /* No route to host */ -#define SOCENOTEMPTY (SOCBASEERR+66) /* Directory not empty */ diff --git a/network_io/os2/os2nerrno.h b/network_io/os2/os2nerrno.h new file mode 100644 index 00000000000..0d6b444e206 --- /dev/null +++ b/network_io/os2/os2nerrno.h @@ -0,0 +1,51 @@ +#ifndef __OS2NERRNO_H +#define __OS2NERRNO_H + +/* Error codes returned by above calls */ +#define SOCBASEERR 10000 + +#define SOCEPERM (SOCBASEERR+1) /* Not owner */ +#define SOCESRCH (SOCBASEERR+3) /* No such process */ +#define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */ +#define SOCENXIO (SOCBASEERR+6) /* No such device or address */ +#define SOCEBADF (SOCBASEERR+9) /* Bad file number */ +#define SOCEACCES (SOCBASEERR+13) /* Permission denied */ +#define SOCEFAULT (SOCBASEERR+14) /* Bad address */ +#define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */ +#define SOCEMFILE (SOCBASEERR+24) /* Too many open files */ +#define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ +#define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ +#define SOCEWOULDBLOCK (SOCBASEERR+35) /* Operation would block */ +#define SOCEINPROGRESS (SOCBASEERR+36) /* Operation now in progress */ +#define SOCEALREADY (SOCBASEERR+37) /* Operation already in progress */ +#define SOCENOTSOCK (SOCBASEERR+38) /* Socket operation on non-socket */ +#define SOCEDESTADDRREQ (SOCBASEERR+39) /* Destination address required */ +#define SOCEMSGSIZE (SOCBASEERR+40) /* Message too long */ +#define SOCEPROTOTYPE (SOCBASEERR+41) /* Protocol wrong type for socket */ +#define SOCENOPROTOOPT (SOCBASEERR+42) /* Protocol not available */ +#define SOCEPROTONOSUPPORT (SOCBASEERR+43) /* Protocol not supported */ +#define SOCESOCKTNOSUPPORT (SOCBASEERR+44) /* Socket type not supported */ +#define SOCEOPNOTSUPP (SOCBASEERR+45) /* Operation not supported on socket */ +#define SOCEPFNOSUPPORT (SOCBASEERR+46) /* Protocol family not supported */ +#define SOCEAFNOSUPPORT (SOCBASEERR+47) /* Address family not supported by protocol family */ +#define SOCEADDRINUSE (SOCBASEERR+48) /* Address already in use */ +#define SOCEADDRNOTAVAIL (SOCBASEERR+49) /* Can't assign requested address */ +#define SOCENETDOWN (SOCBASEERR+50) /* Network is down */ +#define SOCENETUNREACH (SOCBASEERR+51) /* Network is unreachable */ +#define SOCENETRESET (SOCBASEERR+52) /* Network dropped connection on reset */ +#define SOCECONNABORTED (SOCBASEERR+53) /* Software caused connection abort */ +#define SOCECONNRESET (SOCBASEERR+54) /* Connection reset by peer */ +#define SOCENOBUFS (SOCBASEERR+55) /* No buffer space available */ +#define SOCEISCONN (SOCBASEERR+56) /* Socket is already connected */ +#define SOCENOTCONN (SOCBASEERR+57) /* Socket is not connected */ +#define SOCESHUTDOWN (SOCBASEERR+58) /* Can't send after socket shutdown */ +#define SOCETOOMANYREFS (SOCBASEERR+59) /* Too many references: can't splice */ +#define SOCETIMEDOUT (SOCBASEERR+60) /* Connection timed out */ +#define SOCECONNREFUSED (SOCBASEERR+61) /* Connection refused */ +#define SOCELOOP (SOCBASEERR+62) /* Too many levels of symbolic links */ +#define SOCENAMETOOLONG (SOCBASEERR+63) /* File name too long */ +#define SOCEHOSTDOWN (SOCBASEERR+64) /* Host is down */ +#define SOCEHOSTUNREACH (SOCBASEERR+65) /* No route to host */ +#define SOCENOTEMPTY (SOCBASEERR+66) /* Directory not empty */ + +#endif From e4a5f266bbd14131b2d4e7b2007b300314ef5745 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Mon, 9 Oct 2000 07:39:08 +0000 Subject: [PATCH 0590/7878] These don't belong in CVS, they get installed here by buildconf. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60568 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/.cvsignore | 2 + helpers/config.guess | 1094 ------------------------------------- helpers/config.sub | 1240 ------------------------------------------ 3 files changed, 2 insertions(+), 2334 deletions(-) create mode 100644 helpers/.cvsignore delete mode 100755 helpers/config.guess delete mode 100755 helpers/config.sub diff --git a/helpers/.cvsignore b/helpers/.cvsignore new file mode 100644 index 00000000000..3b93b747dfe --- /dev/null +++ b/helpers/.cvsignore @@ -0,0 +1,2 @@ +config.guess +config.sub diff --git a/helpers/config.guess b/helpers/config.guess deleted file mode 100755 index a58889d62b6..00000000000 --- a/helpers/config.guess +++ /dev/null @@ -1,1094 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 -# Free Software Foundation, Inc. -# -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Written by Per Bothner <bothner@cygnus.com>. -# The master version of this file is at the FSF in /home/gd/gnu/lib. -# Please send patches to the Autoconf mailing list <autoconf@gnu.org>. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit system type (host/target name). -# -# Only a few systems have been added to this list; please add others -# (but try to keep the structure clean). -# - -# Use $HOST_CC if defined. $CC may point to a cross-compiler -if test x"$CC_FOR_BUILD" = x; then - if test x"$HOST_CC" != x; then - CC_FOR_BUILD="$HOST_CC" - else - if test x"$CC" != x; then - CC_FOR_BUILD="$CC" - else - CC_FOR_BUILD=cc - fi - fi -fi - - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - cat <<EOF >$dummy.s - .globl main - .ent main -main: - .frame \$30,0,\$26,0 - .prologue 0 - .long 0x47e03d80 # implver $0 - lda \$2,259 - .long 0x47e20c21 # amask $2,$1 - srl \$1,8,\$2 - sll \$2,2,\$2 - sll \$0,3,\$0 - addl \$1,\$0,\$0 - addl \$2,\$0,\$0 - ret \$31,(\$26),1 - .end main -EOF - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy - case "$?" in - 7) - UNAME_MACHINE="alpha" - ;; - 15) - UNAME_MACHINE="alphaev5" - ;; - 14) - UNAME_MACHINE="alphaev56" - ;; - 10) - UNAME_MACHINE="alphapca56" - ;; - 16) - UNAME_MACHINE="alphaev6" - ;; - esac - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-cbm-sysv4 - exit 0;; - amiga:NetBSD:*:*) - echo m68k-cbm-netbsd${UNAME_RELEASE} - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - arc64:OpenBSD:*:*) - echo mips64el-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hkmips:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - arm32:NetBSD:*:*) - echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - SR2?01:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - atari*:NetBSD:*:*) - echo m68k-atari-netbsd${UNAME_RELEASE} - exit 0 ;; - atari*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - sun3*:NetBSD:*:*) - echo m68k-sun-netbsd${UNAME_RELEASE} - exit 0 ;; - sun3*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:NetBSD:*:*) - echo m68k-apple-netbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - macppc:NetBSD:*:*) - echo powerpc-apple-netbsd${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy \ - && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ - -o ${TARGET_BINARY_INTERFACE}x = x ] ; then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - *:OS390:*:* | *:OS/390:*:*) - echo s390-ibm-os390 - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i?86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - sed 's/^ //' << EOF >$dummy.c - #include <sys/systemcfg.h> - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:4) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` - if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=4.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - sed 's/^ //' << EOF >$dummy.c - #include <stdlib.h> - #include <unistd.h> - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` - rm -f $dummy.c $dummy - esac - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - sed 's/^ //' << EOF >$dummy.c - #include <unistd.h> - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i?86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - hppa*:OpenBSD:*:*) - echo hppa-unknown-openbsd - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*X-MP:*:*:*) - echo xmp-cray-unicos - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} - exit 0 ;; - CRAY*T3E:*:*:*) - echo t3e-cray-unicosmk${UNAME_RELEASE} - exit 0 ;; - CRAY-2:*:*:*) - echo cray2-cray-unicos - exit 0 ;; - F300:UNIX_System_V:*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - F301:UNIX_System_V:*:*) - echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` - exit 0 ;; - hp3[0-9][05]:NetBSD:*:*) - echo m68k-hp-netbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*) - if test -x /usr/bin/objformat; then - if test "elf" = "`/usr/bin/objformat`"; then - echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` - exit 0 - fi - fi - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; - *:NetBSD:*:*) - echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i386-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - *:Linux:*:*) -# # uname on the ARM produces all sorts of strangeness, and we need to -# # filter it out. -# case "$UNAME_MACHINE" in -# armv*) UNAME_MACHINE=$UNAME_MACHINE ;; -# arm* | sa110*) UNAME_MACHINE="arm" ;; -# esac - - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - ld_help_string=`cd /; ld --help 2>&1` - ld_supported_emulations=`echo $ld_help_string \ - | sed -ne '/supported emulations:/!d - s/[ ][ ]*/ /g - s/.*supported emulations: *// - s/ .*// - p'` - case "$ld_supported_emulations" in - i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; - i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; - sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - elf32arm) echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 ;; - elf32ppc) - # Determine Lib Version - cat >$dummy.c <<EOF -#include <features.h> -#if defined(__GLIBC__) -extern char __libc_version[]; -extern char __libc_release[]; -#endif -main(argc, argv) - int argc; - char *argv[]; -{ -#if defined(__GLIBC__) - printf("%s %s\n", __libc_version, __libc_release); -#else - printf("unkown\n"); -#endif - return 0; -} -EOF - LIBC="" - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy | grep 1\.99 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.c $dummy - echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;; - esac - - if test "${UNAME_MACHINE}" = "alpha" ; then - sed 's/^ //' <<EOF >$dummy.s - .globl main - .ent main - main: - .frame \$30,0,\$26,0 - .prologue 0 - .long 0x47e03d80 # implver $0 - lda \$2,259 - .long 0x47e20c21 # amask $2,$1 - srl \$1,8,\$2 - sll \$2,2,\$2 - sll \$0,3,\$0 - addl \$1,\$0,\$0 - addl \$2,\$0,\$0 - ret \$31,(\$26),1 - .end main -EOF - LIBC="" - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy - case "$?" in - 7) - UNAME_MACHINE="alpha" - ;; - 15) - UNAME_MACHINE="alphaev5" - ;; - 14) - UNAME_MACHINE="alphaev56" - ;; - 10) - UNAME_MACHINE="alphapca56" - ;; - 16) - UNAME_MACHINE="alphaev6" - ;; - esac - - objdump --private-headers $dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 - elif test "${UNAME_MACHINE}" = "mips" ; then - cat >$dummy.c <<EOF -#ifdef __cplusplus - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __MIPSEB__ - printf ("%s-unknown-linux-gnu\n", argv[1]); -#endif -#ifdef __MIPSEL__ - printf ("%sel-unknown-linux-gnu\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - else - # Either a pre-BFD a.out linker (linux-gnuoldld) - # or one that does not give us useful --help. - # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. - # If ld does not provide *any* "supported emulations:" - # that means it is gnuoldld. - echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" - test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 - - case "${UNAME_MACHINE}" in - i?86) - VENDOR=pc; - ;; - *) - VENDOR=unknown; - ;; - esac - # Determine whether the default compiler is a.out or elf - cat >$dummy.c <<EOF -#include <features.h> -#ifdef __cplusplus - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __ELF__ -# ifdef __GLIBC__ -# if __GLIBC__ >= 2 - printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -#else - printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - fi ;; -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions -# are messed up and put the nodename in both sysname and nodename. - i?86:DYNIX/ptx:4*:*) - echo i386-sequent-sysv4 - exit 0 ;; - i?86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} - fi - exit 0 ;; - i?86:*:5:7*) - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585 - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE} - exit 0 ;; - i?86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL - elif /bin/uname -X 2>/dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - pc:*:*:*) - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes <hewes@openmarket.com>. - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:*:6*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:OS/2:*:*) - echo "i386-pc-os2_emx" - exit 0;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -cat >$dummy.c <<EOF -#ifdef _SEQUENT_ -# include <sys/types.h> -# include <sys/utsname.h> -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include <sys/param.h> - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -#if !defined (ultrix) - printf ("vax-dec-bsd\n"); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 -rm -f $dummy.c $dummy - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -#echo '(Unable to guess system type)' 1>&2 - -exit 1 diff --git a/helpers/config.sub b/helpers/config.sub deleted file mode 100755 index 19c7337e472..00000000000 --- a/helpers/config.sub +++ /dev/null @@ -1,1240 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -if [ x$1 = x ] -then - echo Configuration name missing. 1>&2 - echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 - echo "or $0 ALIAS" 1>&2 - echo where ALIAS is a recognized configuration type. 1>&2 - exit 1 -fi - -# First pass through any local machine types. -case $1 in - *local*) - echo $1 - exit 0 - ;; - *) - ;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - linux-gnu*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - tpf | os390 | vmcms) - os=-$maybe_os - basic_machine=s390; - ;; - mvs) - os=-mvs - basic_machine=i370; - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=vxworks - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ - | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ - | 580 | i960 | h8300 \ - | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \ - | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ - | mips64orion | mips64orionel | mipstx39 | mipstx39el \ - | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ - | mips64vr5000 | miprs64vr5000el \ - | armv[34][lb] | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v) - basic_machine=$basic_machine-unknown - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i[34567]86) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ - | xmp-* | ymp-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ - | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \ - | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ - | clipper-* | orion-* \ - | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ - | mipstx39-* | mipstx39el-* \ - | armv[34][lb]-* \ - | f301-* | armv*-* | t3e-* \ - | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* ) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-cbm - ;; - amigaos | amigados) - basic_machine=m68k-cbm - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-cbm - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | ymp) - basic_machine=ymp-cray - os=-unicos - ;; - cray2) - basic_machine=cray2-cray - os=-unicos - ;; - [ctj]90-cray) - basic_machine=c90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - os=-mvs - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[34567]86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i[34567]86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i[34567]86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i[34567]86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - i386-go32 | go32) - basic_machine=i386-unknown - os=-go32 - ;; - i386-mingw32 | mingw32) - basic_machine=i386-unknown - os=-mingw32 - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | *MiNT) - basic_machine=m68k-atari - os=-mint - ;; - mipsel*-linux*) - basic_machine=mipsel-unknown - os=-linux-gnu - ;; - mips*-linux*) - basic_machine=mips-unknown - os=-linux-gnu - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - msdos) - basic_machine=i386-unknown - os=-msdos - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-corel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - np1) - basic_machine=np1-gould - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexen) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86) - basic_machine=i686-pc - ;; - pentiumii | pentium2) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexen-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=rs6000-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - s390*) - basic_machine=s390-ibm - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sparclite-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=t3e-cray - os=-unicos - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xmp) - basic_machine=xmp-cray - os=-unicos - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - mips) - if [ x$os = x-linux-gnu ]; then - basic_machine=mips-unknown - else - basic_machine=mips-mips - fi - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sparc | sparcv9) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - c4x*) - basic_machine=c4x-none - os=-coff - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - -os2_emx) - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit* \ - | -tpf* | -os390* | -vmcms* ) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -ns2 ) - os=-nextstep2 - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -*MiNT) - os=-mint - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-corel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - case $basic_machine in - s390*) - os=-os390; - ;; - i370*) - os=-mvs; - ;; - *) - os=-aix - ;; - esac - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f301-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -*MiNT) - vendor=atari - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os From 8d2fdecbfb163d1709dde1fe00ef0c4ba8af1f71 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 9 Oct 2000 14:07:54 +0000 Subject: [PATCH 0591/7878] Add some docs to APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60569 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_dso.h | 2 +- include/apr_general.h | 5 ++++- include/apr_getopt.h | 36 ++++++++++++++++++++++++++---------- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/include/apr_dso.h b/include/apr_dso.h index f85964cb037..402b58a96ca 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -86,7 +86,7 @@ apr_status_t apr_dso_unload(apr_dso_handle_t *handle); /** * Load a symbol from a DSO handle. - * @param dso Location to store the loaded symbol + * @param ressym Location to store the loaded symbol * @param handle handle to load from. * @param symname Name of the symbol to load. */ diff --git a/include/apr_general.h b/include/apr_general.h index 1671ef16e99..271b04d810f 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -243,7 +243,7 @@ int strncasecmp(const char *a, const char *b, size_t n); #endif /** - * package APR Random Functions + * @package APR Random Functions */ #if APR_HAS_RANDOM @@ -272,6 +272,9 @@ apr_status_t apr_generate_random_bytes(unsigned char * buf, int length); #define ALLOC_STATS */ +/** + * @package APR memory allocation + */ typedef struct apr_pool_t apr_pool_t; /** The memory allocation structure diff --git a/include/apr_getopt.h b/include/apr_getopt.h index c7c9a064b02..57721f3a590 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -55,16 +55,32 @@ #ifndef APR_GETOPT_H #define APR_GETOPT_H -typedef struct apr_getopt_t { - apr_pool_t *cont; /* context for processing */ - int err; /* if error message should be printed */ - int ind; /* index into parent argv vector */ - int opt; /* character checked for validity */ - int reset; /* reset getopt */ - int argc; /* count of arguments */ - char *const *argv; /* array of pointers to arguments */ - char const* place; /* argument associated with option */ -} apr_getopt_t; +/** + * @package APR command arguments + */ + +typedef struct apr_getopt_t apr_getopt_t; +/** + * Structure to store command line argument information. + */ +struct apr_getopt_t { + /** context for processing */ + apr_pool_t *cont; + /** if error message should be printed */ + int err; + /** index into parent argv vector */ + int ind; + /** character checked for validity */ + int opt; + /** reset getopt */ + int reset; + /** count of arguments */ + int argc; + /** array of pointers to arguments */ + char *const *argv; + /** argument associated with option */ + char const* place; +}; /** * Initialize the arguments for parsing by apr_getopt(). From 15405012a09a5830ccacdbee0fa04e913ebab165 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Mon, 9 Oct 2000 14:07:57 +0000 Subject: [PATCH 0592/7878] Put these back. It looks like only the OS/2 autoconf port was overwriting them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60570 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/.cvsignore | 2 - helpers/config.guess | 1094 +++++++++++++++++++++++++++++++++++++ helpers/config.sub | 1240 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2334 insertions(+), 2 deletions(-) delete mode 100644 helpers/.cvsignore create mode 100755 helpers/config.guess create mode 100755 helpers/config.sub diff --git a/helpers/.cvsignore b/helpers/.cvsignore deleted file mode 100644 index 3b93b747dfe..00000000000 --- a/helpers/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -config.guess -config.sub diff --git a/helpers/config.guess b/helpers/config.guess new file mode 100755 index 00000000000..a58889d62b6 --- /dev/null +++ b/helpers/config.guess @@ -0,0 +1,1094 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 +# Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner <bothner@cygnus.com>. +# The master version of this file is at the FSF in /home/gd/gnu/lib. +# Please send patches to the Autoconf mailing list <autoconf@gnu.org>. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit system type (host/target name). +# +# Only a few systems have been added to this list; please add others +# (but try to keep the structure clean). +# + +# Use $HOST_CC if defined. $CC may point to a cross-compiler +if test x"$CC_FOR_BUILD" = x; then + if test x"$HOST_CC" != x; then + CC_FOR_BUILD="$HOST_CC" + else + if test x"$CC" != x; then + CC_FOR_BUILD="$CC" + else + CC_FOR_BUILD=cc + fi + fi +fi + + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 8/24/94.) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <<EOF >$dummy.s + .globl main + .ent main +main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-cbm-sysv4 + exit 0;; + amiga:NetBSD:*:*) + echo m68k-cbm-netbsd${UNAME_RELEASE} + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + arm32:NetBSD:*:*) + echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + SR2?01:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + atari*:NetBSD:*:*) + echo m68k-atari-netbsd${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + sun3*:NetBSD:*:*) + echo m68k-sun-netbsd${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:NetBSD:*:*) + echo m68k-apple-netbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + macppc:NetBSD:*:*) + echo powerpc-apple-netbsd${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ + -o ${TARGET_BINARY_INTERFACE}x = x ] ; then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + *:OS390:*:* | *:OS/390:*:*) + echo s390-ibm-os390 + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i?86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:4) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=4.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + sed 's/^ //' << EOF >$dummy.c + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + rm -f $dummy.c $dummy + esac + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i?86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + hppa*:OpenBSD:*:*) + echo hppa-unknown-openbsd + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*T3E:*:*:*) + echo t3e-cray-unicosmk${UNAME_RELEASE} + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F300:UNIX_System_V:*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + F301:UNIX_System_V:*:*) + echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` + exit 0 ;; + hp3[0-9][05]:NetBSD:*:*) + echo m68k-hp-netbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + i?86:BSD/386:*:* | i?86:BSD/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + if test -x /usr/bin/objformat; then + if test "elf" = "`/usr/bin/objformat`"; then + echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` + exit 0 + fi + fi + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:NetBSD:*:*) + echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + *:Linux:*:*) +# # uname on the ARM produces all sorts of strangeness, and we need to +# # filter it out. +# case "$UNAME_MACHINE" in +# armv*) UNAME_MACHINE=$UNAME_MACHINE ;; +# arm* | sa110*) UNAME_MACHINE="arm" ;; +# esac + + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_help_string=`cd /; ld --help 2>&1` + ld_supported_emulations=`echo $ld_help_string \ + | sed -ne '/supported emulations:/!d + s/[ ][ ]*/ /g + s/.*supported emulations: *// + s/ .*// + p'` + case "$ld_supported_emulations" in + i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; + i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; + sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + elf32arm) echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 ;; + elf32ppc) + # Determine Lib Version + cat >$dummy.c <<EOF +#include <features.h> +#if defined(__GLIBC__) +extern char __libc_version[]; +extern char __libc_release[]; +#endif +main(argc, argv) + int argc; + char *argv[]; +{ +#if defined(__GLIBC__) + printf("%s %s\n", __libc_version, __libc_release); +#else + printf("unkown\n"); +#endif + return 0; +} +EOF + LIBC="" + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy | grep 1\.99 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.c $dummy + echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;; + esac + + if test "${UNAME_MACHINE}" = "alpha" ; then + sed 's/^ //' <<EOF >$dummy.s + .globl main + .ent main + main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + LIBC="" + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + + objdump --private-headers $dummy | \ + grep ld.so.1 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 + elif test "${UNAME_MACHINE}" = "mips" ; then + cat >$dummy.c <<EOF +#ifdef __cplusplus + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __MIPSEB__ + printf ("%s-unknown-linux-gnu\n", argv[1]); +#endif +#ifdef __MIPSEL__ + printf ("%sel-unknown-linux-gnu\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + else + # Either a pre-BFD a.out linker (linux-gnuoldld) + # or one that does not give us useful --help. + # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. + # If ld does not provide *any* "supported emulations:" + # that means it is gnuoldld. + echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" + test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + + case "${UNAME_MACHINE}" in + i?86) + VENDOR=pc; + ;; + *) + VENDOR=unknown; + ;; + esac + # Determine whether the default compiler is a.out or elf + cat >$dummy.c <<EOF +#include <features.h> +#ifdef __cplusplus + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + fi ;; +# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions +# are messed up and put the nodename in both sysname and nodename. + i?86:DYNIX/ptx:4*:*) + echo i386-sequent-sysv4 + exit 0 ;; + i?86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + fi + exit 0 ;; + i?86:*:5:7*) + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585 + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE} + exit 0 ;; + i?86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + pc:*:*:*) + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:*:6*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:OS/2:*:*) + echo "i386-pc-os2_emx" + exit 0;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +cat >$dummy.c <<EOF +#ifdef _SEQUENT_ +# include <sys/types.h> +# include <sys/utsname.h> +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +#if !defined (ultrix) + printf ("vax-dec-bsd\n"); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +#echo '(Unable to guess system type)' 1>&2 + +exit 1 diff --git a/helpers/config.sub b/helpers/config.sub new file mode 100755 index 00000000000..19c7337e472 --- /dev/null +++ b/helpers/config.sub @@ -0,0 +1,1240 @@ +#! /bin/sh +# Configuration validation subroutine script, version 1.1. +# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +if [ x$1 = x ] +then + echo Configuration name missing. 1>&2 + echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 + echo "or $0 ALIAS" 1>&2 + echo where ALIAS is a recognized configuration type. 1>&2 + exit 1 +fi + +# First pass through any local machine types. +case $1 in + *local*) + echo $1 + exit 0 + ;; + *) + ;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + linux-gnu*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + tpf | os390 | vmcms) + os=-$maybe_os + basic_machine=s390; + ;; + mvs) + os=-mvs + basic_machine=i370; + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=vxworks + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + | 580 | i960 | h8300 \ + | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \ + | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ + | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ + | mips64orion | mips64orionel | mipstx39 | mipstx39el \ + | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ + | mips64vr5000 | miprs64vr5000el \ + | armv[34][lb] | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ + | thumb | d10v) + basic_machine=$basic_machine-unknown + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i[34567]86) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ + | xmp-* | ymp-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ + | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \ + | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ + | clipper-* | orion-* \ + | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ + | mipstx39-* | mipstx39el-* \ + | armv[34][lb]-* \ + | f301-* | armv*-* | t3e-* \ + | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ + | thumb-* | v850-* | d30v-* | tic30-* | c30-* ) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-cbm + ;; + amigaos | amigados) + basic_machine=m68k-cbm + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-cbm + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [ctj]90-cray) + basic_machine=c90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + os=-mvs + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i[34567]86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i[34567]86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i[34567]86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i[34567]86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + i386-go32 | go32) + basic_machine=i386-unknown + os=-go32 + ;; + i386-mingw32 | mingw32) + basic_machine=i386-unknown + os=-mingw32 + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | *MiNT) + basic_machine=m68k-atari + os=-mint + ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + msdos) + basic_machine=i386-unknown + os=-msdos + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-corel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + np1) + basic_machine=np1-gould + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexen-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=rs6000-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + s390*) + basic_machine=s390-ibm + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=t3e-cray + os=-unicos + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + mips) + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sparc | sparcv9) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + -os2_emx) + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit* \ + | -tpf* | -os390* | -vmcms* ) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -*MiNT) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-corel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + case $basic_machine in + s390*) + os=-os390; + ;; + i370*) + os=-mvs; + ;; + *) + os=-aix + ;; + esac + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f301-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -*MiNT) + vendor=atari + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os From 0d4f1abddbe1866bbdb444c3c14af8d14faf1bae Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 9 Oct 2000 18:21:43 +0000 Subject: [PATCH 0593/7878] hints.m4 needs to use $host instead of $PLAT now. Submitted by: Victor J. Orlikowski <v.j.orlikowski@gte.net> Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60571 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hints.m4 b/hints.m4 index 28eff94d7b7..1a18f5f995b 100644 --- a/hints.m4 +++ b/hints.m4 @@ -86,7 +86,7 @@ case "$host" in APR_SETVAR(APACHE_MPM, [prefork]) ;; *-ibm-aix*) - case $PLAT in + case $host in i386-ibm-aix*) APR_SETIFNULL(CFLAGS, [-U__STR__ -DUSEBCOPY]) ;; @@ -150,7 +150,7 @@ case "$host" in ;; *-hp-hpux10.*) APR_SETIFNULL(CFLAGS, [-DHPUX10]) - case $PLAT in + case $host in *-hp-hpux10.01) dnl # We know this is a problem in 10.01. dnl # Not a problem in 10.20. Otherwise, who knows? @@ -185,7 +185,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(LIBS, [-lcrypt]) ;; *-freebsd*) - case $PLAT in + case $host in *freebsd[2345]*) APR_SETIFNULL(CFLAGS, [-funsigned-char]) ;; @@ -239,7 +239,7 @@ dnl ;; APR_SETIFNULL(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) ;; *-solaris2*) - PLATOSVERS=`echo $PLAT | sed 's/^.*solaris2.//'` + PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` APR_SETIFNULL(CFLAGS, [-DSOLARIS2=$PLATOSVERS]) APR_SETIFNULL(LIBS, [-lsocket -lnsl]) ;; @@ -311,7 +311,7 @@ dnl ;; APR_SETIFNULL(LIBS, [-lPW]) ;; *-uts*) - PLATOSVERS=`echo $PLAT | sed 's/^.*,//'` + PLATOSVERS=`echo $host | sed 's/^.*,//'` case $PLATOSVERS in 2*) APR_SETIFNULL(CFLAGS, [-Xa -eft -DUTS21 -DUSEBCOPY]) APR_SETIFNULL(LIBS, [-lsocket -lbsd -la]) From e48fa17abd03a652064720a6e4129b3f69a22b4a Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 9 Oct 2000 19:03:20 +0000 Subject: [PATCH 0594/7878] Fix some types in the latest tree, so that AIX builds cleanly again. Submitted by: Victor J. Orlikowski <v.j.orlikowski@gte.net> Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60572 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getuuid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index cd17a553dd0..13a54a90d71 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -73,7 +73,7 @@ #define NODE_LENGTH 6 static int uuid_state_seqnum; -static char uuid_state_node[NODE_LENGTH] = { 0 }; +static unsigned char uuid_state_node[NODE_LENGTH] = { 0 }; static void get_random_info(unsigned char node[NODE_LENGTH]) @@ -114,7 +114,7 @@ static void get_random_info(unsigned char node[NODE_LENGTH]) system-dependent call to get IEEE node ID. This is also more secure: we aren't passing out our MAC address. */ -static void get_pseudo_node_identifier(char *node) +static void get_pseudo_node_identifier(unsigned char *node) { get_random_info(node); node[0] |= 0x80; /* this designates a random node ID */ From 63d085ec8c865eb55032015160d9c2c2e57c3b25 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 11 Oct 2000 07:54:39 +0000 Subject: [PATCH 0595/7878] Thanks for the goodies, Greg :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60573 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 12 ++++++++++++ aprlib.def | 6 ++++++ aprlib.dsp | 12 ++++++++++++ libapr.def | 6 ++++++ 4 files changed, 36 insertions(+) diff --git a/apr.dsp b/apr.dsp index 2df9fbe8e62..0bcb6681fe3 100644 --- a/apr.dsp +++ b/apr.dsp @@ -173,6 +173,10 @@ SOURCE=.\misc\unix\getopt.c # End Source File # Begin Source File +SOURCE=.\misc\win32\getuuid.c +# End Source File +# Begin Source File + SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File @@ -256,6 +260,10 @@ SOURCE=.\time\win32\time.c SOURCE=.\time\win32\timestr.c # End Source File +# Begin Source File + +SOURCE=.\misc\unix\uuid.c +# End Source File # End Group # Begin Group "Generated Header Files" @@ -448,6 +456,10 @@ SOURCE=.\include\apr_time.h # End Source File # Begin Source File +SOURCE=.\include\apr_uuid.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_xlate.h # End Source File # End Group diff --git a/aprlib.def b/aprlib.def index b1dec108b91..b9bc4e443c5 100644 --- a/aprlib.def +++ b/aprlib.def @@ -256,6 +256,11 @@ EXPORTS apr_get_lockdata @245 apr_set_lockdata @246 apr_get_os_lock @247 +; +; apr_uuid.h + apr_format_uuid @248 + apr_parse_uuid @249 + apr_get_uuid @250 ; Moved out of the way for Bill Stoddard's reorg ; @@ -267,3 +272,4 @@ EXPORTS ; apr_optopt @124 DATA ; apr_optreset @125 DATA ; apr_optarg @126 DATA + diff --git a/aprlib.dsp b/aprlib.dsp index 2df9fbe8e62..0bcb6681fe3 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -173,6 +173,10 @@ SOURCE=.\misc\unix\getopt.c # End Source File # Begin Source File +SOURCE=.\misc\win32\getuuid.c +# End Source File +# Begin Source File + SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File @@ -256,6 +260,10 @@ SOURCE=.\time\win32\time.c SOURCE=.\time\win32\timestr.c # End Source File +# Begin Source File + +SOURCE=.\misc\unix\uuid.c +# End Source File # End Group # Begin Group "Generated Header Files" @@ -448,6 +456,10 @@ SOURCE=.\include\apr_time.h # End Source File # Begin Source File +SOURCE=.\include\apr_uuid.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_xlate.h # End Source File # End Group diff --git a/libapr.def b/libapr.def index b1dec108b91..b9bc4e443c5 100644 --- a/libapr.def +++ b/libapr.def @@ -256,6 +256,11 @@ EXPORTS apr_get_lockdata @245 apr_set_lockdata @246 apr_get_os_lock @247 +; +; apr_uuid.h + apr_format_uuid @248 + apr_parse_uuid @249 + apr_get_uuid @250 ; Moved out of the way for Bill Stoddard's reorg ; @@ -267,3 +272,4 @@ EXPORTS ; apr_optopt @124 DATA ; apr_optreset @125 DATA ; apr_optarg @126 DATA + From 6f334000bad7d82aed1766e4a154f2f06c482bbd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 11 Oct 2000 07:55:52 +0000 Subject: [PATCH 0596/7878] Goodies need a new lib. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60574 13f79535-47bb-0310-9956-ffa450edef68 --- aprlibdll.dsp | 4 ++-- libapr.dsp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aprlibdll.dsp b/aprlibdll.dsp index 9fadaf51d9a..135d9481b87 100644 --- a/aprlibdll.dsp +++ b/aprlibdll.dsp @@ -54,7 +54,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib !ELSEIF "$(CFG)" == "aprlibdll - Win32 Debug" @@ -81,7 +81,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib # SUBTRACT LINK32 /incremental:no /map !ENDIF diff --git a/libapr.dsp b/libapr.dsp index 9fadaf51d9a..135d9481b87 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -54,7 +54,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib !ELSEIF "$(CFG)" == "aprlibdll - Win32 Debug" @@ -81,7 +81,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib # SUBTRACT LINK32 /incremental:no /map !ENDIF From c51b1a6867af18f92dff04e7ae2a0c891775e978 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Wed, 11 Oct 2000 17:01:59 +0000 Subject: [PATCH 0597/7878] Tidy up some network code. The only BeOS version that sees this code is BONE and that uses read/write so remove the defines as they're not needed and this makes the code easier to read. Also replace some tabs with spaces and move some line breaks to hopefully make it easier to read. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60575 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 61 +++++++++++++++----------------------- 1 file changed, 24 insertions(+), 37 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 9c145dce936..0fe67f19ab7 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -54,17 +54,6 @@ #include "networkio.h" -/* BeOS needs to use send/recv for socket I/O, this allows us to do that - * with minimal changes in the code. - */ -#ifdef BEOS -#define WRITE(x,y,z) send(x,y,z,0) -#define READ(x,y,z) recv(x,y,z,0) -#else -#define WRITE(x,y,z) write(x,y,z) -#define READ(x,y,z) read(x,y,z) -#endif - #if APR_HAS_SENDFILE /* This file is needed to allow us access to the apr_file_t internals. */ #include "../../file_io/unix/fileio.h" @@ -117,11 +106,11 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) ssize_t rv; do { - rv = WRITE(sock->socketdes, buf, (*len)); + rv = write(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) - && sock->timeout != 0) { + && sock->timeout != 0) { apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -129,13 +118,13 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) } else { do { - rv = WRITE(sock->socketdes, buf, (*len)); + rv = write(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR); } } if (rv == -1) { - *len = 0; - return errno; + *len = 0; + return errno; } (*len) = rv; return APR_SUCCESS; @@ -146,20 +135,19 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) ssize_t rv; do { - rv = READ(sock->socketdes, buf, (*len)); + rv = read(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR); - if (rv == -1 && - (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout != 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 1); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } + if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && + sock->timeout != 0) { + apr_status_t arv = wait_for_io_or_timeout(sock, 1); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } else { do { - rv = READ(sock->socketdes, buf, (*len)); + rv = read(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR); } } @@ -181,23 +169,22 @@ apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, rv = writev(sock->socketdes, vec, nvec); } while (rv == -1 && errno == EINTR); - if (rv == -1 && - (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout != 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 0); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } + if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && + sock->timeout != 0) { + apr_status_t arv = wait_for_io_or_timeout(sock, 0); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } else { do { - rv = writev(sock->socketdes, vec, nvec); + rv = writev(sock->socketdes, vec, nvec); } while (rv == -1 && errno == EINTR); } } if (rv == -1) { - *len = 0; - return errno; + *len = 0; + return errno; } (*len) = rv; return APR_SUCCESS; From dfd94867b02615f00751be78ed4fb24bac82d663 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 11 Oct 2000 17:05:06 +0000 Subject: [PATCH 0598/7878] Take Greg's criticism very literally. EXPORT (when it's really IMPORT) is a true Lewis Carrollism. This patch replaces the following: APR_EXPORT() -> APR_DECLARE() This is a public fn APR_EXPORT_NONSTD() -> APR_DECLARE_NONSTD() This is a varargs fn APR_VAR_EXPORT -> APR_DECLARE_DATA These are public vars APR_VAR_IMPORT -> APR_DECLARE_DATA ditto APR_EXPORT_SYMBOLS -> APR_DECLARE_EXPORT Compile the lib to export APR_STATIC -> APR_DECLARE_STATIC Compile:linked to the .lib no define Compile:linked to the .dll The old symbols are retained in-place. I will wait for the firestorm of controversy to die before we actually use these symbols in the APR, or will back out the new names under CtR Submitted by: Greg Stein Reviewed by: William Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60576 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 19 +++++++++++++++---- include/apr.hw | 42 ++++++++++++++++++++++++++---------------- 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 9b55fac8986..6cb66fc3283 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -123,10 +123,21 @@ typedef @socklen_t_value@ apr_socklen_t; /* Definitions that APR programs need to work properly. */ #define APR_THREAD_FUNC -#define APR_EXPORT(type) type -#define APR_EXPORT_NONSTD(type) type -#define APR_VAR_IMPORT extern -#define APR_VAR_EXPORT + +/* Create a set of APR_DECLARE(type), APR_DECLARE_NONSTD(type) and + * APR_DECLARE_DATA with appropriate export and import tags for the platform. + * Simple case - see apr.hw for the complex example + */ +#define APR_DECLARE(type) type +#define APR_DECLARE_NONSTD(type) type +#define APR_DECLARE_DATA + +/* These need to move into apr_compat.h when the symbol rename is complete + */ +#define APR_EXPORT(t) APR_DECLARE(t) +#define APR_EXPORT_NONSTD(t) APR_DECLARE_NONSTD(t) +#define APR_VAR_EXPORT APR_DECLARE_DATA +#define APR_VAR_IMPORT APR_DECLARE_DATA /* Define APR_SSIZE_T_FMT. * If ssize_t is an integer we define it to be "d", diff --git a/include/apr.hw b/include/apr.hw index 974a56a6b20..2c8f8961248 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -179,25 +179,35 @@ typedef int gid_t; /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" -#if !defined(WIN32) || defined(APR_STATIC) -/* Default Non-WIN32 behavior removes all MSVCisms */ -#define APR_EXPORT(type) type -#define APR_EXPORT_NONSTD(type) type -#define APR_VAR_EXPORT -#define APR_VAR_IMPORT extern -#elif defined(APR_EXPORT_SYMBOLS) -#define APR_EXPORT(type) __declspec(dllexport) type -#define APR_EXPORT_NONSTD(type) __declspec(dllexport) type -#define APR_VAR_EXPORT __declspec(dllexport) -#define APR_VAR_IMPORT extern __declspec(dllexport) +/* Create a set of APR_DECLARE(type), APR_DECLARE_NONSTD(type) and + * APR_DECLARE_DATA with appropriate export and import tags for the platform + */ +#if !defined(WIN32) +#define APR_DECLARE(type) type +#define APR_DECLARE_NONSTD(type) type +#define APR_DECLARE_DATA +#elif defined(APR_DECLARE_STATIC) +#define APR_DECLARE(type) type __stdcall +#define APR_DECLARE_NONSTD(type) type +#define APR_DECLARE_DATA +#elif defined(APR_DECLARE_EXPORT) +#define APR_DECLARE(type) __declspec(dllexport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type +#define APR_DECLARE_DATA __declspec(dllexport) #else -/* Default WIN32 behavior is to import the shared .dll */ -#define APR_EXPORT(type) __declspec(dllimport) type -#define APR_EXPORT_NONSTD(type) __declspec(dllimport) type -#define APR_VAR_EXPORT __declspec(dllimport) -#define APR_VAR_IMPORT extern __declspec(dllimport) +#define APR_DECLARE(type) __declspec(dllimport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type +#define APR_DECLARE_DATA __declspec(dllimport) #endif +/* These need to move into apr_compat.h when the symbol rename is complete + */ +#define APR_EXPORT(t) APR_DECLARE(t) +#define APR_EXPORT_NONSTD(t) APR_DECLARE_NONSTD(t) +#define APR_VAR_EXPORT APR_DECLARE_DATA +#define APR_VAR_IMPORT APR_DECLARE_DATA + + #define apr_signal(a,b) signal(a,b) typedef int apr_wait_t; From 906931b74c7184761371ee04ebb1440397680230 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 11 Oct 2000 17:13:15 +0000 Subject: [PATCH 0599/7878] Squishing bugs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60577 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 2 +- lib/apr_pools.c | 2 +- memory/unix/apr_pools.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index 3473ea5164b..172b353ef6d 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -109,7 +109,7 @@ APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, * @return Returns NULL if the key is not present. * @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, apr_size_t klen) */ -APR_EXPORT(void) *apr_hash_get(apr_hash_t *ht, const void *key, +APR_EXPORT(void*) apr_hash_get(apr_hash_t *ht, const void *key, apr_size_t klen); /** diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 77352797c14..f53ebd8df87 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -857,7 +857,7 @@ APR_EXPORT(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) * Allocating stuff... */ -void * apr_palloc(apr_pool_t *a, apr_size_t reqsize) +APR_EXPORT(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) { #ifdef ALLOC_USE_MALLOC apr_size_t size = reqsize + CLICK_SZ; diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 77352797c14..f53ebd8df87 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -857,7 +857,7 @@ APR_EXPORT(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) * Allocating stuff... */ -void * apr_palloc(apr_pool_t *a, apr_size_t reqsize) +APR_EXPORT(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) { #ifdef ALLOC_USE_MALLOC apr_size_t size = reqsize + CLICK_SZ; From 5c01fd36335af122694560f4d6bff4afebc3bc0b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 11 Oct 2000 17:19:31 +0000 Subject: [PATCH 0600/7878] Regardless of reaction to a symbol rename -within- the sources, these external symbols change for clarity. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60578 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++-- aprlib.dsp | 4 ++-- aprlibdll.dsp | 4 ++-- libapr.dsp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apr.dsp b/apr.dsp index 0bcb6681fe3..0bd97b7f2d8 100644 --- a/apr.dsp +++ b/apr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -69,7 +69,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo diff --git a/aprlib.dsp b/aprlib.dsp index 0bcb6681fe3..0bd97b7f2d8 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -69,7 +69,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo diff --git a/aprlibdll.dsp b/aprlibdll.dsp index 135d9481b87..443fb18426d 100644 --- a/aprlibdll.dsp +++ b/aprlibdll.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" @@ -70,7 +70,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" diff --git a/libapr.dsp b/libapr.dsp index 135d9481b87..443fb18426d 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" @@ -70,7 +70,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" From 0a4d9e23c14c91170f400c90001eeeeeffb5617e Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Wed, 11 Oct 2000 23:23:28 +0000 Subject: [PATCH 0601/7878] If the socket is disconnected, we can't return APR_SUCCESS. This changes the unix version to return APR_EOF for apr_recv. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60579 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 0fe67f19ab7..077d3bce649 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -155,6 +155,9 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) (*len) = 0; return errno; } + if (rv == 0) { + return APR_EOF; + } (*len) = rv; return APR_SUCCESS; } From f8d234837011302fe81a2e76ff495e3e18cee218 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 12 Oct 2000 01:32:23 +0000 Subject: [PATCH 0602/7878] If we're returning APR_EOF to signal a socket which the other side closed, we need to tell the caller we read zero bytes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60580 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 077d3bce649..827cac5e244 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -155,10 +155,10 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) (*len) = 0; return errno; } + (*len) = rv; if (rv == 0) { return APR_EOF; } - (*len) = rv; return APR_SUCCESS; } From a4099b57d986557d13fca4ff7791a26cc804b12f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 12 Oct 2000 06:14:31 +0000 Subject: [PATCH 0603/7878] I hope this clarifies. Greg is absolutely correct, there is no need for any modules symbol other than AP_MODULE_DECLARE_DATA, since module .h files containing imports and exports imply something more sophisticated, as the early mod_dav.c example illustrated. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60581 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 34 +++++++++++++++++++++++++++++++--- include/apr.hw | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 5 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 6cb66fc3283..495e165a73e 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -124,12 +124,40 @@ typedef @socklen_t_value@ apr_socklen_t; #define APR_THREAD_FUNC -/* Create a set of APR_DECLARE(type), APR_DECLARE_NONSTD(type) and - * APR_DECLARE_DATA with appropriate export and import tags for the platform. - * Simple case - see apr.hw for the complex example +/** + * APR_DECLARE_EXPORT is defined when building the APR dynamic library, + * so that all public symbols are exported. + * + * APR_DECLARE_STATIC is defined when including the APR public headers, + * to provide static linkage when the dynamic library may be unavailable. + * + * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when + * including the APR public headers, to import and link the symbols from the + * dynamic APR library and assure appropriate indirection and calling + * conventions at compile time. + */ + +/** + * The public APR functions are declared with APR_DECLARE(), so they may + * use the most appropriate calling convention. Public APR functions with + * variable arguments must use APR_DECLARE_NONSTD(). + * + * @deffunc APR_DECLARE(rettype) apr_func(args); */ #define APR_DECLARE(type) type +/** + * The public APR functions using variable arguments are declared with + * AP_DECLARE(), as they must use the C language calling convention. + * + * @deffunc APR_DECLARE_NONSTD(rettype) apr_func(args, ...); + */ #define APR_DECLARE_NONSTD(type) type +/** + * The public APR variables are declared with AP_MODULE_DECLARE_DATA. + * This assures the appropriate indirection is invoked at compile time. + * + * @deffunc type APR_DECLARE_DATA apr_variable; + */ #define APR_DECLARE_DATA /* These need to move into apr_compat.h when the symbol rename is complete diff --git a/include/apr.hw b/include/apr.hw index 2c8f8961248..77a4065e9dc 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -179,12 +179,41 @@ typedef int gid_t; /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" -/* Create a set of APR_DECLARE(type), APR_DECLARE_NONSTD(type) and - * APR_DECLARE_DATA with appropriate export and import tags for the platform +/** + * APR_DECLARE_EXPORT is defined when building the APR dynamic library, + * so that all public symbols are exported. + * + * APR_DECLARE_STATIC is defined when including the APR public headers, + * to provide static linkage when the dynamic library may be unavailable. + * + * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when + * including the APR public headers, to import and link the symbols from the + * dynamic APR library and assure appropriate indirection and calling + * conventions at compile time. */ + #if !defined(WIN32) +/** + * The public APR functions are declared with APR_DECLARE(), so they may + * use the most appropriate calling convention. Public APR functions with + * variable arguments must use APR_DECLARE_NONSTD(). + * + * @deffunc APR_DECLARE(rettype) apr_func(args); + */ #define APR_DECLARE(type) type +/** + * The public APR functions using variable arguments are declared with + * AP_DECLARE(), as they must use the C language calling convention. + * + * @deffunc APR_DECLARE_NONSTD(rettype) apr_func(args, ...); + */ #define APR_DECLARE_NONSTD(type) type +/** + * The public APR variables are declared with AP_MODULE_DECLARE_DATA. + * This assures the appropriate indirection is invoked at compile time. + * + * @deffunc type APR_DECLARE_DATA apr_variable; + */ #define APR_DECLARE_DATA #elif defined(APR_DECLARE_STATIC) #define APR_DECLARE(type) type __stdcall From de3f6d94486ab7411d2666b5bc0d04788ce822f3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 15 Oct 2000 20:12:15 +0000 Subject: [PATCH 0604/7878] before anyone raises a ruckus - here are the symbols I'm moving from os2 and the other platform os.h files (where applicable), plus a few cleanups from my apr_getopt overhaul where we have no symbol remaining. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60582 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_compat.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/include/apr_compat.h b/include/apr_compat.h index e291a325fd3..7e8a82a1b96 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -16,6 +16,8 @@ #define ap_array_pstrcat apr_array_pstrcat #define ap_bytes_in_free_blocks apr_bytes_in_free_blocks #define ap_bytes_in_pool apr_bytes_in_pool +#define ap_check_file_time apr_check_file_time +#define ap_filetype_e apr_filetype_e #define ap_cleanup_for_exec apr_cleanup_for_exec #define ap_clear_pool apr_clear_pool #define ap_clear_table apr_clear_table @@ -27,6 +29,7 @@ #define ap_destroy_pool apr_destroy_pool #define ap_exploded_time_t apr_exploded_time_t #define ap_fnmatch apr_fnmatch +#define ap_getopt apr_getopt #define ap_inet_addr apr_inet_addr #define ap_init_alloc apr_init_alloc #define ap_is_empty_table apr_is_empty_table @@ -38,11 +41,12 @@ #define ap_month_snames apr_month_snames #define ap_note_subprocess apr_note_subprocess #define ap_null_cleanup apr_null_cleanup -#define ap_optarg apr_optarg -#define ap_opterr apr_opterr -#define ap_optind apr_optind -#define ap_optopt apr_optopt -#define ap_optreset apr_optreset +#define ap_os_dso_load apr_dso_load +#define ap_os_dso_unload apr_dso_unload +#define ap_os_dso_sym apr_dso_sym +#define ap_os_dso_error apr_dso_error +#define ap_os_error_message apr_canonical_error +#define ap_os_kill apr_kill #define ap_overlap_tables apr_overlap_tables #define ap_overlay_tables apr_overlay_tables #define ap_palloc apr_palloc From 7de5dec24b910321344f2ef818784a2d30503a24 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Mon, 16 Oct 2000 02:58:14 +0000 Subject: [PATCH 0605/7878] the zero-length hash key is valid. use (-1) as the discrimnator for auto-computed string-length hash keys git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60583 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 20 ++++++++++++++------ tables/apr_hash.c | 8 ++++---- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index 172b353ef6d..9cf66ff8334 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -69,6 +69,16 @@ extern "C" { #include "apr_pools.h" +/* + * When passing a key to apr_hash_set or apr_hash_get, this value can be + * passed to indicate a string-valued key, and have apr_hash compute the + * length automatically. + * + * Note: apr_hash will use strlen(key)+1 for the length. This allows + * apr_hash_this() to return a null-terminated string as the key. + */ +#define APR_HASH_KEY_STRING (-1) + /* * Abstract type for hash tables. */ @@ -91,26 +101,24 @@ APR_EXPORT(apr_hash_t *) apr_make_hash(apr_pool_t *pool); * Associate a value with a key in a hash table. * @param ht The hash table * @param key Pointer to the key - * @param klen Length of the key - * If the length is 0 it is assumed to be strlen(key)+1 + * @param klen Length of the key. Can be APR_HASH_KEY_STRING. * @param val Value to associate with the key * @tip If the value is NULL the hash entry is deleted. * @deffunc void apr_hash_set(apr_hash_t *ht, const void *key, apr_size_t klen, const void *val) */ APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, - apr_size_t klen, const void *val); + apr_ssize_t klen, const void *val); /** * Look up the value associated with a key in a hash table. * @param ht The hash table * @param key Pointer to the key - * @param klen Length of the key - * If the length is 0 it is assumed to be strlen(key)+1 + * @param klen Length of the key. Can be APR_HASH_KEY_STRING. * @return Returns NULL if the key is not present. * @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, apr_size_t klen) */ APR_EXPORT(void*) apr_hash_get(apr_hash_t *ht, const void *key, - apr_size_t klen); + apr_ssize_t klen); /** * Start iterating over the entries in a hash table. diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 123d18fb2d8..6ec6db055f4 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -207,7 +207,7 @@ static void resize_array(apr_hash_t *ht) static apr_hash_entry_t **find_entry(apr_hash_t *ht, const void *key, - apr_size_t klen, + apr_ssize_t klen, const void *val) { apr_hash_entry_t **hep, *he; @@ -215,7 +215,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, int hash; int i; - if (klen == 0) + if (klen == APR_HASH_KEY_STRING) klen = strlen(key) + 1; /* @@ -282,7 +282,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, APR_EXPORT(void *) apr_hash_get(apr_hash_t *ht, const void *key, - apr_size_t klen) + apr_ssize_t klen) { apr_hash_entry_t *he; he = *find_entry(ht, key, klen, NULL); @@ -294,7 +294,7 @@ APR_EXPORT(void *) apr_hash_get(apr_hash_t *ht, APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, - apr_size_t klen, + apr_ssize_t klen, const void *val) { apr_hash_entry_t **hep; From 2d0f641ed55a51cd95aa9e4c53ef09ca1268ff75 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 16 Oct 2000 03:32:25 +0000 Subject: [PATCH 0606/7878] Adds quick access to the must-haves (STATUS/CHANGES) and group the apr library in to functional units git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60584 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 174 ++++++++++++++++++++++++++++++++++------------------- aprlib.dsp | 174 ++++++++++++++++++++++++++++++++++------------------- 2 files changed, 226 insertions(+), 122 deletions(-) diff --git a/apr.dsp b/apr.dsp index 0bd97b7f2d8..ebbc8a55108 100644 --- a/apr.dsp +++ b/apr.dsp @@ -68,8 +68,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c +# ADD CPP /nologo /MDd /W3 /GX /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -87,125 +87,152 @@ LIB32=link.exe -lib # Begin Group "Source Files" # PROP Default_Filter ".c" +# Begin Group "time" + +# PROP Default_Filter "" # Begin Source File SOURCE=.\time\win32\access.c # End Source File # Begin Source File -SOURCE=.\strings\apr_cpystrn.c +SOURCE=.\time\win32\atime.h # End Source File # Begin Source File -SOURCE=.\strings\apr_fnmatch.c +SOURCE=.\time\win32\time.c # End Source File # Begin Source File -SOURCE=.\passwd\apr_getpass.c +SOURCE=.\time\win32\timestr.c # End Source File +# End Group +# Begin Group "strings" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\tables\apr_hash.c +SOURCE=.\strings\apr_cpystrn.c # End Source File # Begin Source File -SOURCE=.\passwd\apr_md5.c +SOURCE=.\strings\apr_fnmatch.c # End Source File # Begin Source File -SOURCE=.\lib\apr_pools.c +SOURCE=.\strings\apr_snprintf.c # End Source File # Begin Source File -SOURCE=.\lib\apr_signal.c +SOURCE=.\strings\apr_strings.c # End Source File # Begin Source File -SOURCE=.\strings\apr_snprintf.c +SOURCE=.\strings\apr_strnatcmp.c # End Source File +# End Group +# Begin Group "passwd" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\strings\apr_strings.c +SOURCE=.\passwd\apr_getpass.c # End Source File # Begin Source File -SOURCE=.\strings\apr_strnatcmp.c +SOURCE=.\passwd\apr_md5.c +# End Source File +# End Group +# Begin Group "tables" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\tables\apr_hash.c # End Source File # Begin Source File SOURCE=.\tables\apr_tables.c # End Source File +# End Group +# Begin Group "misc" + +# PROP Default_Filter "" # Begin Source File SOURCE=.\misc\unix\canonerr.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\dir.c +SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File -SOURCE=.\dso\win32\dso.c +SOURCE=.\misc\unix\getopt.c # End Source File # Begin Source File -SOURCE=.\misc\unix\errorcodes.c +SOURCE=.\misc\win32\getuuid.c # End Source File # Begin Source File -SOURCE=.\file_io\unix\fileacc.c +SOURCE=.\misc\win32\misc.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\filedup.c +SOURCE=.\misc\unix\misc.h # End Source File # Begin Source File -SOURCE=.\file_io\win32\filestat.c +SOURCE=.\misc\win32\names.c # End Source File # Begin Source File -SOURCE=.\file_io\unix\fullrw.c +SOURCE=.\misc\win32\rand.c # End Source File # Begin Source File -SOURCE=.\misc\unix\getopt.c +SOURCE=.\misc\unix\start.c # End Source File # Begin Source File -SOURCE=.\misc\win32\getuuid.c +SOURCE=.\misc\unix\uuid.c # End Source File +# End Group +# Begin Group "file_io" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\locks\win32\locks.c +SOURCE=.\file_io\win32\dir.c # End Source File # Begin Source File -SOURCE=.\misc\win32\misc.c +SOURCE=.\file_io\unix\fileacc.c # End Source File # Begin Source File -SOURCE=.\misc\win32\names.c +SOURCE=.\file_io\win32\filedup.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\open.c +SOURCE=.\file_io\win32\fileio.h # End Source File # Begin Source File -SOURCE=.\file_io\win32\pipe.c +SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File -SOURCE=.\network_io\win32\poll.c +SOURCE=.\file_io\unix\fullrw.c # End Source File # Begin Source File -SOURCE=.\threadproc\win32\proc.c +SOURCE=.\file_io\win32\open.c # End Source File # Begin Source File -SOURCE=.\misc\win32\rand.c +SOURCE=.\file_io\win32\pipe.c # End Source File # Begin Source File @@ -215,18 +242,33 @@ SOURCE=.\file_io\win32\readwrite.c SOURCE=.\file_io\win32\seek.c # End Source File +# End Group +# Begin Group "locks" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\network_io\win32\sendrecv.c +SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File -SOURCE=.\shmem\win32\shmem.c -# PROP Exclude_From_Build 1 +SOURCE=.\locks\win32\locks.h # End Source File +# End Group +# Begin Group "network_io" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\threadproc\win32\signals.c +SOURCE=.\network_io\win32\networkio.h +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\poll.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File @@ -240,9 +282,17 @@ SOURCE=.\network_io\win32\sockets.c SOURCE=.\network_io\win32\sockopt.c # End Source File +# End Group +# Begin Group "threadproc" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\misc\unix\start.c +SOURCE=.\threadproc\win32\proc.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\signals.c # End Source File # Begin Source File @@ -252,19 +302,45 @@ SOURCE=.\threadproc\win32\thread.c SOURCE=.\threadproc\win32\threadpriv.c # End Source File +# End Group +# Begin Group "dso" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\time\win32\time.c +SOURCE=.\dso\win32\dso.c # End Source File # Begin Source File -SOURCE=.\time\win32\timestr.c +SOURCE=.\dso\win32\dso.h # End Source File +# End Group +# Begin Group "lib" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\misc\unix\uuid.c +SOURCE=.\lib\apr_pools.c +# End Source File +# Begin Source File + +SOURCE=.\lib\apr_signal.c +# End Source File +# End Group +# Begin Group "i18n" + +# PROP Default_Filter "" +# End Group +# Begin Group "shmem" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\shmem\win32\shmem.c +# PROP Exclude_From_Build 1 # End Source File # End Group +# End Group # Begin Group "Generated Header Files" # PROP Default_Filter "" @@ -311,30 +387,6 @@ InputPath=.\include\apr_private.hw # End Source File # Begin Source File -SOURCE=.\time\win32\atime.h -# End Source File -# Begin Source File - -SOURCE=.\dso\win32\dso.h -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\fileio.h -# End Source File -# Begin Source File - -SOURCE=.\locks\win32\locks.h -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\misc.h -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\networkio.h -# End Source File -# Begin Source File - SOURCE=.\threadproc\win32\threadproc.h # End Source File # End Group diff --git a/aprlib.dsp b/aprlib.dsp index 0bd97b7f2d8..ebbc8a55108 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -68,8 +68,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c +# ADD CPP /nologo /MDd /W3 /GX /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -87,125 +87,152 @@ LIB32=link.exe -lib # Begin Group "Source Files" # PROP Default_Filter ".c" +# Begin Group "time" + +# PROP Default_Filter "" # Begin Source File SOURCE=.\time\win32\access.c # End Source File # Begin Source File -SOURCE=.\strings\apr_cpystrn.c +SOURCE=.\time\win32\atime.h # End Source File # Begin Source File -SOURCE=.\strings\apr_fnmatch.c +SOURCE=.\time\win32\time.c # End Source File # Begin Source File -SOURCE=.\passwd\apr_getpass.c +SOURCE=.\time\win32\timestr.c # End Source File +# End Group +# Begin Group "strings" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\tables\apr_hash.c +SOURCE=.\strings\apr_cpystrn.c # End Source File # Begin Source File -SOURCE=.\passwd\apr_md5.c +SOURCE=.\strings\apr_fnmatch.c # End Source File # Begin Source File -SOURCE=.\lib\apr_pools.c +SOURCE=.\strings\apr_snprintf.c # End Source File # Begin Source File -SOURCE=.\lib\apr_signal.c +SOURCE=.\strings\apr_strings.c # End Source File # Begin Source File -SOURCE=.\strings\apr_snprintf.c +SOURCE=.\strings\apr_strnatcmp.c # End Source File +# End Group +# Begin Group "passwd" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\strings\apr_strings.c +SOURCE=.\passwd\apr_getpass.c # End Source File # Begin Source File -SOURCE=.\strings\apr_strnatcmp.c +SOURCE=.\passwd\apr_md5.c +# End Source File +# End Group +# Begin Group "tables" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\tables\apr_hash.c # End Source File # Begin Source File SOURCE=.\tables\apr_tables.c # End Source File +# End Group +# Begin Group "misc" + +# PROP Default_Filter "" # Begin Source File SOURCE=.\misc\unix\canonerr.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\dir.c +SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File -SOURCE=.\dso\win32\dso.c +SOURCE=.\misc\unix\getopt.c # End Source File # Begin Source File -SOURCE=.\misc\unix\errorcodes.c +SOURCE=.\misc\win32\getuuid.c # End Source File # Begin Source File -SOURCE=.\file_io\unix\fileacc.c +SOURCE=.\misc\win32\misc.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\filedup.c +SOURCE=.\misc\unix\misc.h # End Source File # Begin Source File -SOURCE=.\file_io\win32\filestat.c +SOURCE=.\misc\win32\names.c # End Source File # Begin Source File -SOURCE=.\file_io\unix\fullrw.c +SOURCE=.\misc\win32\rand.c # End Source File # Begin Source File -SOURCE=.\misc\unix\getopt.c +SOURCE=.\misc\unix\start.c # End Source File # Begin Source File -SOURCE=.\misc\win32\getuuid.c +SOURCE=.\misc\unix\uuid.c # End Source File +# End Group +# Begin Group "file_io" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\locks\win32\locks.c +SOURCE=.\file_io\win32\dir.c # End Source File # Begin Source File -SOURCE=.\misc\win32\misc.c +SOURCE=.\file_io\unix\fileacc.c # End Source File # Begin Source File -SOURCE=.\misc\win32\names.c +SOURCE=.\file_io\win32\filedup.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\open.c +SOURCE=.\file_io\win32\fileio.h # End Source File # Begin Source File -SOURCE=.\file_io\win32\pipe.c +SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File -SOURCE=.\network_io\win32\poll.c +SOURCE=.\file_io\unix\fullrw.c # End Source File # Begin Source File -SOURCE=.\threadproc\win32\proc.c +SOURCE=.\file_io\win32\open.c # End Source File # Begin Source File -SOURCE=.\misc\win32\rand.c +SOURCE=.\file_io\win32\pipe.c # End Source File # Begin Source File @@ -215,18 +242,33 @@ SOURCE=.\file_io\win32\readwrite.c SOURCE=.\file_io\win32\seek.c # End Source File +# End Group +# Begin Group "locks" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\network_io\win32\sendrecv.c +SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File -SOURCE=.\shmem\win32\shmem.c -# PROP Exclude_From_Build 1 +SOURCE=.\locks\win32\locks.h # End Source File +# End Group +# Begin Group "network_io" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\threadproc\win32\signals.c +SOURCE=.\network_io\win32\networkio.h +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\poll.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File @@ -240,9 +282,17 @@ SOURCE=.\network_io\win32\sockets.c SOURCE=.\network_io\win32\sockopt.c # End Source File +# End Group +# Begin Group "threadproc" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\misc\unix\start.c +SOURCE=.\threadproc\win32\proc.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\signals.c # End Source File # Begin Source File @@ -252,19 +302,45 @@ SOURCE=.\threadproc\win32\thread.c SOURCE=.\threadproc\win32\threadpriv.c # End Source File +# End Group +# Begin Group "dso" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\time\win32\time.c +SOURCE=.\dso\win32\dso.c # End Source File # Begin Source File -SOURCE=.\time\win32\timestr.c +SOURCE=.\dso\win32\dso.h # End Source File +# End Group +# Begin Group "lib" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\misc\unix\uuid.c +SOURCE=.\lib\apr_pools.c +# End Source File +# Begin Source File + +SOURCE=.\lib\apr_signal.c +# End Source File +# End Group +# Begin Group "i18n" + +# PROP Default_Filter "" +# End Group +# Begin Group "shmem" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\shmem\win32\shmem.c +# PROP Exclude_From_Build 1 # End Source File # End Group +# End Group # Begin Group "Generated Header Files" # PROP Default_Filter "" @@ -311,30 +387,6 @@ InputPath=.\include\apr_private.hw # End Source File # Begin Source File -SOURCE=.\time\win32\atime.h -# End Source File -# Begin Source File - -SOURCE=.\dso\win32\dso.h -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\fileio.h -# End Source File -# Begin Source File - -SOURCE=.\locks\win32\locks.h -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\misc.h -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\networkio.h -# End Source File -# Begin Source File - SOURCE=.\threadproc\win32\threadproc.h # End Source File # End Group From a04441427edd89220c11826a89378d3bdff3affa Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 16 Oct 2000 03:34:20 +0000 Subject: [PATCH 0607/7878] This 'descended' from apachecore - I have no idea if it is still appropriate or required. FirstBill? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60585 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr.hw b/include/apr.hw index 77a4065e9dc..aca77acb8b9 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -139,6 +139,8 @@ #define APR_USE_PROC_PTHREAD_SERIALIZE 0 #define APR_USE_PTHREAD_SERIALIZE 0 +#define NO_USE_SIGACTION + #if APR_HAVE_SYS_TYPES_H #include <sys/types.h> #endif From 80df3363f7ce35d175c0500f5315cd1a3db5b272 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 16 Oct 2000 03:35:02 +0000 Subject: [PATCH 0608/7878] Note a discrepancy, W2K supports hard symlinks git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60586 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index c2d7345c003..a8e7048365e 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -62,6 +62,7 @@ #include "atime.h" #include "misc.h" +/* XXX: this is wrong for W2K */ #define S_ISLNK(m) (0) #define S_ISREG(m) (((m) & (S_IFMT)) == S_IFREG) #define S_ISDIR(m) (((m) & (S_IFDIR)) == S_IFDIR) From 5333dde92c3379d979422ba1d2fa4676cc98564f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 16 Oct 2000 06:04:50 +0000 Subject: [PATCH 0609/7878] Renamed all MODULE_EXPORT symbols to AP_MODULE_DECLARE and all symbols for CORE_EXPORT to AP_CORE_DECLARE (namespace protecting the wrapper) and retitled API_EXPORT as AP_DECLARE and APR_EXPORT as APR_DECLARE. All _VAR_ flavors changes to _DATA to be absolutely clear. Thank you Greg, for the most obvious suggestion. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60587 13f79535-47bb-0310-9956-ffa450edef68 --- APRDesign | 2 +- file_io/os2/readwrite.c | 2 +- file_io/unix/readwrite.c | 2 +- file_io/win32/fileio.h | 2 +- file_io/win32/readwrite.c | 2 +- helpers/MakeEtags | 2 +- include/apr.h.in | 7 ---- include/apr.hw | 8 ----- include/apr_file_io.h | 2 +- include/apr_fnmatch.h | 4 +-- include/apr_getopt.h | 4 +-- include/apr_hash.h | 12 +++---- include/apr_lib.h | 14 ++++---- include/apr_md5.h | 10 +++--- include/apr_pools.h | 32 +++++++++---------- include/apr_strings.h | 16 +++++----- include/apr_tables.h | 64 ++++++++++++++++++------------------- include/arch/win32/fileio.h | 2 +- lib/apr_pools.c | 36 ++++++++++----------- memory/unix/apr_pools.c | 36 ++++++++++----------- misc/unix/getopt.c | 4 +-- misc/unix/otherchild.c | 8 ++--- misc/win32/names.c | 2 +- passwd/apr_getpass.c | 2 +- passwd/apr_md5.c | 14 ++++---- strings/apr_cpystrn.c | 8 ++--- strings/apr_fnmatch.c | 4 +-- strings/apr_snprintf.c | 6 ++-- strings/apr_strings.c | 6 ++-- tables/apr_hash.c | 12 +++---- tables/apr_tables.c | 64 ++++++++++++++++++------------------- time/unix/timestr.c | 4 +-- time/win32/timestr.c | 4 +-- 33 files changed, 191 insertions(+), 206 deletions(-) diff --git a/APRDesign b/APRDesign index 1fb06ac6d7c..8334732f56d 100644 --- a/APRDesign +++ b/APRDesign @@ -179,7 +179,7 @@ The last line is not strictly needed. The parser in ScanDoc is not perfect yet, and it can not parse prototypes that are in any form other than return_type program_name(type1 param1, type2 param2, ...) This means that any function prototype that resembles: - APR_EXPORT(ap_status_t) ap_foo(int f1, char *f2) + APR_DECLARE(ap_status_t) ap_foo(int f1, char *f2) will need the deffunc. For an actual example, look at any file in the include directory (ap_tables.h diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 310e2df9aa4..4794232c767 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -325,7 +325,7 @@ apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) -APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) { int cc; va_list ap; diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index e5addd0e444..a9da3b07153 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -376,7 +376,7 @@ apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) return rv; } -APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) { apr_status_t cc; va_list ap; diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 178d576383c..83bad40de45 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -144,7 +144,7 @@ struct apr_dir_t { apr_status_t file_cleanup(void *); /*mode_t get_fileperms(apr_fileperms_t); */ -APR_EXPORT(char *) apr_os_systemcase_filename(struct apr_pool_t *pCont, +APR_DECLARE(char *) apr_os_systemcase_filename(struct apr_pool_t *pCont, const char *szFile); char * canonical_filename(struct apr_pool_t *pCont, const char *szFile); diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 72ac0bbf0f4..e07b4f2ba16 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -388,7 +388,7 @@ static int printf_flush(apr_vformatter_buff_t *vbuff) return -1; } -APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) { int cc; va_list ap; diff --git a/helpers/MakeEtags b/helpers/MakeEtags index 25f6bdab176..1b030a3fc03 100755 --- a/helpers/MakeEtags +++ b/helpers/MakeEtags @@ -27,7 +27,7 @@ etags=~/local/bin/etags # Exuberant etags is necessary since it can ignore some defined symbols # that obscure the function signatures. -ignore=API_EXPORT,API_EXPORT_NONSTD,__declspec +ignore=AP_DECLARE,AP_DECLARE_NONSTD,__declspec # Create an etags file at the root of the source # tree, then create symbol links to it from each diff --git a/include/apr.h.in b/include/apr.h.in index 495e165a73e..d251c02cfe8 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -160,13 +160,6 @@ typedef @socklen_t_value@ apr_socklen_t; */ #define APR_DECLARE_DATA -/* These need to move into apr_compat.h when the symbol rename is complete - */ -#define APR_EXPORT(t) APR_DECLARE(t) -#define APR_EXPORT_NONSTD(t) APR_DECLARE_NONSTD(t) -#define APR_VAR_EXPORT APR_DECLARE_DATA -#define APR_VAR_IMPORT APR_DECLARE_DATA - /* Define APR_SSIZE_T_FMT. * If ssize_t is an integer we define it to be "d", * if ssize_t is a long int we define it to be "ld", diff --git a/include/apr.hw b/include/apr.hw index aca77acb8b9..9404b4d0486 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -231,14 +231,6 @@ typedef int gid_t; #define APR_DECLARE_DATA __declspec(dllimport) #endif -/* These need to move into apr_compat.h when the symbol rename is complete - */ -#define APR_EXPORT(t) APR_DECLARE(t) -#define APR_EXPORT_NONSTD(t) APR_DECLARE_NONSTD(t) -#define APR_VAR_EXPORT APR_DECLARE_DATA -#define APR_VAR_IMPORT APR_DECLARE_DATA - - #define apr_signal(a,b) signal(a,b) typedef int apr_wait_t; diff --git a/include/apr_file_io.h b/include/apr_file_io.h index eb31de3a0aa..302557c4d1e 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -546,7 +546,7 @@ apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir); * @return The number of bytes written * @deffunc int apr_fprintf(apr_file_t *fptr, const char *format, ...) */ -APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) __attribute__((format(printf,2,3))); #ifdef __cplusplus diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index e15663337a7..0eb3614639b 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -69,7 +69,7 @@ extern "C" { * @deffunc apr_status_t apr_fnmatch(const char *pattern, const char *strings, int flags) */ -APR_EXPORT(apr_status_t) apr_fnmatch(const char *pattern, const char *strings, +APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, const char *strings, int flags); /** @@ -78,7 +78,7 @@ APR_EXPORT(apr_status_t) apr_fnmatch(const char *pattern, const char *strings, * @return non-zero if pattern has any glob characters in it * @deffunc int apr_is_fnmatch(const char *pattern) */ -APR_EXPORT(int) apr_is_fnmatch(const char *pattern); +APR_DECLARE(int) apr_is_fnmatch(const char *pattern); #ifdef __cplusplus } diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 57721f3a590..91be72c28dd 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -91,7 +91,7 @@ struct apr_getopt_t { * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) * @deffunc apr_status_t apr_initopt(apr_getopt_t **os, apr_pool_t *cont,int argc, char *const *argv) */ -APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, +APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, int argc, char *const *argv); /** @@ -111,7 +111,7 @@ APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, * </PRE> * @deffunc apr_status_t apr_getopt(apr_getopt_t *os, const char *opts, char *optch, const char **optarg) */ -APR_EXPORT(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, +APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, char *optch, const char **optarg); #endif /* ! APR_GETOPT_H */ diff --git a/include/apr_hash.h b/include/apr_hash.h index 9cf66ff8334..b1b7afeab3f 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -95,7 +95,7 @@ typedef struct apr_hash_index_t apr_hash_index_t; * @return The hash table just created * @deffunc apr_hash_t *apr_make_hash(apr_pool_t *pool) */ -APR_EXPORT(apr_hash_t *) apr_make_hash(apr_pool_t *pool); +APR_DECLARE(apr_hash_t *) apr_make_hash(apr_pool_t *pool); /** * Associate a value with a key in a hash table. @@ -106,7 +106,7 @@ APR_EXPORT(apr_hash_t *) apr_make_hash(apr_pool_t *pool); * @tip If the value is NULL the hash entry is deleted. * @deffunc void apr_hash_set(apr_hash_t *ht, const void *key, apr_size_t klen, const void *val) */ -APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, +APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key, apr_ssize_t klen, const void *val); /** @@ -117,7 +117,7 @@ APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, * @return Returns NULL if the key is not present. * @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, apr_size_t klen) */ -APR_EXPORT(void*) apr_hash_get(apr_hash_t *ht, const void *key, +APR_DECLARE(void*) apr_hash_get(apr_hash_t *ht, const void *key, apr_ssize_t klen); /** @@ -146,7 +146,7 @@ APR_EXPORT(void*) apr_hash_get(apr_hash_t *ht, const void *key, * </PRE> * @deffunc apr_hash_index_t * apr_hash_first(apr_hash_t *ht) */ -APR_EXPORT(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht); +APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht); /** * Continue iterating over the entries in a hash table. @@ -154,7 +154,7 @@ APR_EXPORT(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht); * @return a pointer to the updated iteration state. NULL if there are no more * entries. * @deffunc apr_hash_index_t * apr_hash_next(apr_hash_index_t *hi) */ -APR_EXPORT(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); +APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); /** * Get the current entry's details from the iteration state. @@ -166,7 +166,7 @@ APR_EXPORT(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); * corresponding data, or they may be NULL if the data isn't interesting. * @deffunc void apr_hash_this(apr_hash_index_t *hi, const void **key, apr_size_t *klen, void **val); */ -APR_EXPORT(void) apr_hash_this(apr_hash_index_t *hi, const void **key, +APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, apr_size_t *klen, void **val); #ifdef __cplusplus diff --git a/include/apr_lib.h b/include/apr_lib.h index 7b5f362145c..550e35a0fac 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -107,7 +107,7 @@ typedef struct apr_vformatter_buff_t { * </PRE> * @deffunc const char * apr_filename_of_pathname(const char *pathname) */ -APR_EXPORT(const char *) apr_filename_of_pathname(const char *pathname); +APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname); /* These macros allow correct support of 8-bit characters on systems which * support 8-bit characters. Pretty dumb how the cast is required, but @@ -202,7 +202,7 @@ APR_EXPORT(const char *) apr_filename_of_pathname(const char *pathname); * </PRE> * @deffunc int apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), apr_vformatter_buff_t *c, const char *fmt, va_list ap) */ -APR_EXPORT(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), +APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), apr_vformatter_buff_t *c, const char *fmt, va_list ap); @@ -212,7 +212,7 @@ APR_EXPORT(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), * @param hash The password to validate against * @deffunc apr_status_t apr_validate_password(const char *passwd, const char *hash) */ -APR_EXPORT(apr_status_t) apr_validate_password(const char *passwd, const char *hash); +APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, const char *hash); /* @@ -241,7 +241,7 @@ APR_EXPORT(apr_status_t) apr_validate_password(const char *passwd, const char *h * @param ... The arguments to use to fill out the format string. * @deffunc int apr_snprintf(char *buf, size_t len, const char *format, ...) */ -APR_EXPORT_NONSTD(int) apr_snprintf(char *buf, size_t len, +APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, size_t len, const char *format, ...) __attribute__((format(printf,3,4))); @@ -254,7 +254,7 @@ APR_EXPORT_NONSTD(int) apr_snprintf(char *buf, size_t len, * @param ap The arguments to use to fill out the format string. * @deffunc int apr_vsnprintf(char *buf, size_t len, const char *format, va_list ap) */ -APR_EXPORT(int) apr_vsnprintf(char *buf, size_t len, const char *format, +APR_DECLARE(int) apr_vsnprintf(char *buf, size_t len, const char *format, va_list ap); /** @@ -264,7 +264,7 @@ APR_EXPORT(int) apr_vsnprintf(char *buf, size_t len, const char *format, * @param bufsize The length of the password string. * @deffunc apr_status_t apr_getpass(const char *prompt, char *pwbuf, size_t *bufsize) */ -APR_EXPORT(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, size_t *bufsize); +APR_DECLARE(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, size_t *bufsize); /** * Register a process to be killed when a pool dies. @@ -280,7 +280,7 @@ APR_EXPORT(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, size_t *bu * </PRE> * @deffunc void apr_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) */ -APR_EXPORT(void) apr_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, +APR_DECLARE(void) apr_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how); #ifdef __cplusplus diff --git a/include/apr_md5.h b/include/apr_md5.h index 54b48438df9..41048cfceb0 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -121,7 +121,7 @@ struct apr_md5_ctx_t { * @param context The MD5 context to initialize. * @deffunc apr_status_t apr_MD5Init(apr_md5_ctx_t *context) */ -APR_EXPORT(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context); +APR_DECLARE(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context); /** * MD5 translation setup. Provides the APR translation handle to be used @@ -131,7 +131,7 @@ APR_EXPORT(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context); * @deffunc apr_status_t apr_MD5SetXlate(apr_md5_ctx_t *context, apr_xlate_t *xlate) */ #if APR_HAS_XLATE -APR_EXPORT(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, +APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, apr_xlate_t *xlate); #else #define apr_MD5SetXlate(context, xlate) APR_ENOTIMPL @@ -145,7 +145,7 @@ APR_EXPORT(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, * @param inputLen The length of the next message block * @deffunc apr_status_t apr_MD5Update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) */ -APR_EXPORT(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, +APR_DECLARE(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen); @@ -156,7 +156,7 @@ APR_EXPORT(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, * @param context The MD5 content we are finalizing. * @deffunc apr_status_t apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context) */ -APR_EXPORT(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], +APR_DECLARE(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context); /** @@ -167,7 +167,7 @@ APR_EXPORT(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], * @param nbytes The length of the string * @deffunc apr_status_t apr_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes) */ -APR_EXPORT(apr_status_t) apr_MD5Encode(const char *password, const char *salt, +APR_DECLARE(apr_status_t) apr_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes); #ifdef __cplusplus diff --git a/include/apr_pools.h b/include/apr_pools.h index b368debcbb6..790f04580b8 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -162,9 +162,9 @@ struct process_chain { #endif #define apr_pool_join(a,b) #else -APR_EXPORT(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub); -APR_EXPORT(apr_pool_t *) apr_find_pool(const void *ts); -APR_EXPORT(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); +APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub); +APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts); +APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); #endif #ifdef ULTRIX_BRAIN_DEATH @@ -201,7 +201,7 @@ void apr_term_alloc(void); /* Tear down everything */ * error. * @deffunc apr_pool_t *apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) */ -APR_EXPORT(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)); +APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)); /** * clear all memory in the pool @@ -210,7 +210,7 @@ APR_EXPORT(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int r * to re-use this memory for the next allocation. * @deffunc void apr_clear_pool(apr_pool_t *p) */ -APR_EXPORT(void) apr_clear_pool(apr_pool_t *p); +APR_DECLARE(void) apr_clear_pool(apr_pool_t *p); /** * destroy the pool @@ -218,7 +218,7 @@ APR_EXPORT(void) apr_clear_pool(apr_pool_t *p); * @tip This will actually free the memory * @deffunc void apr_destroy_pool(apr_pool_t *p) */ -APR_EXPORT(void) apr_destroy_pool(apr_pool_t *p); +APR_DECLARE(void) apr_destroy_pool(apr_pool_t *p); /** * report the number of bytes currently in the pool @@ -226,14 +226,14 @@ APR_EXPORT(void) apr_destroy_pool(apr_pool_t *p); * @return The number of bytes * @deffunc apr_size_t apr_bytes_in_pool(apr_pool_t *p) */ -APR_EXPORT(apr_size_t) apr_bytes_in_pool(apr_pool_t *p); +APR_DECLARE(apr_size_t) apr_bytes_in_pool(apr_pool_t *p); /** * report the number of bytes currently in the list of free blocks * @return The number of bytes * @deffunc apr_size_t apr_bytes_in_free_blocks(void) */ -APR_EXPORT(apr_size_t) apr_bytes_in_free_blocks(void); +APR_DECLARE(apr_size_t) apr_bytes_in_free_blocks(void); /** * Determine if pool a is an ancestor of pool b @@ -243,7 +243,7 @@ APR_EXPORT(apr_size_t) apr_bytes_in_free_blocks(void); * of all pools. * @deffunc int apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) */ -APR_EXPORT(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); +APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); /** * Allocate a block of memory from a pool @@ -252,7 +252,7 @@ APR_EXPORT(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); * @return The allocated memory * @deffunc void *apr_palloc(apr_pool_t *c, apr_size_t reqsize) */ -APR_EXPORT(void *) apr_palloc(apr_pool_t *c, apr_size_t reqsize); +APR_DECLARE(void *) apr_palloc(apr_pool_t *c, apr_size_t reqsize); /** * Allocate a block of memory from a pool and set all of the memory to 0 @@ -261,7 +261,7 @@ APR_EXPORT(void *) apr_palloc(apr_pool_t *c, apr_size_t reqsize); * @return The allocated memory * @deffunc void *apr_pcalloc(apr_pool_t *p, apr_size_t size) */ -APR_EXPORT(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); +APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); /** * Register a function to be called when a pool is cleared or destroyed @@ -272,7 +272,7 @@ APR_EXPORT(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); * @param child_cleanup The function to call when a child process is created * @deffunc void apr_register_cleanup(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup) (void *), apr_status_t (*child_cleanup) (void *)) */ -APR_EXPORT(void) apr_register_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup) (void *), apr_status_t (*child_cleanup) (void *)); @@ -283,7 +283,7 @@ APR_EXPORT(void) apr_register_cleanup(apr_pool_t *p, const void *data, * @param cleanup The function to remove from cleanup * @deffunc void apr_kill_cleanup(apr_pool_t *p, const void *data, apr_status_t (*cleanup) (void *)) */ -APR_EXPORT(void) apr_kill_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, apr_status_t (*cleanup) (void *)); /** @@ -293,7 +293,7 @@ APR_EXPORT(void) apr_kill_cleanup(apr_pool_t *p, const void *data, * @param cleanup The function to remove from cleanup * @deffunc apr_status_t apr_run_cleanup(apr_pool_t *p, void *data, apr_status_t (*cleanup) (void *)) */ -APR_EXPORT(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, +APR_DECLARE(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, apr_status_t (*cleanup) (void *)); /* Preparing for exec() --- close files, etc., but *don't* flush I/O @@ -304,14 +304,14 @@ APR_EXPORT(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, * closed because we are about to exec a new program * @deffunc void apr_cleanup_for_exec(void) */ -APR_EXPORT(void) apr_cleanup_for_exec(void); +APR_DECLARE(void) apr_cleanup_for_exec(void); /** * An empty cleanup function * @param data The data to cleanup * @deffunc apr_status_t apr_null_cleanup(void *data) */ -APR_EXPORT_NONSTD(apr_status_t) apr_null_cleanup(void *data); +APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data); /* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t will not be diff --git a/include/apr_strings.h b/include/apr_strings.h index fa16c4295fe..a84137eaf27 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -118,7 +118,7 @@ int apr_strnatcasecmp(char const *a, char const *b); * @return The new string * @deffunc char *apr_pstrdup(apr_pool_t *p, const char *s) */ -APR_EXPORT(char *) apr_pstrdup(apr_pool_t *p, const char *s); +APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); /** * duplicate the first n characters ofa string into memory allocated @@ -129,7 +129,7 @@ APR_EXPORT(char *) apr_pstrdup(apr_pool_t *p, const char *s); * @return The new string * @deffunc char *apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n) */ -APR_EXPORT(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); +APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); /** * Concatenate multiple strings, allocating memory out a pool @@ -138,7 +138,7 @@ APR_EXPORT(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); * @return The new string * @deffunc char *apr_pstrcat(apr_pool_t *p, ...) */ -APR_EXPORT_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...); +APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...); /** * printf-style style printing routine. The data is output to a string @@ -149,7 +149,7 @@ APR_EXPORT_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...); * @return The new string * @deffunc char *apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) */ -APR_EXPORT(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap); +APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap); /** * printf-style style printing routine. The data is output to a string @@ -160,7 +160,7 @@ APR_EXPORT(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap); * @return The new string * @deffunc char *apr_psprintf(apr_pool_t *p, const char *fmt, ...) */ -APR_EXPORT_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...); +APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...); /** * copy n characters from src to des> @@ -179,7 +179,7 @@ APR_EXPORT_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...); * </PRE> * @deffunc char *apr_cpystrn(char *dst, const char *src, size_t dst_size) */ -APR_EXPORT(char *) apr_cpystrn(char *dst, const char *src, size_t dst_size); +APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, size_t dst_size); /** * Strip spaces from a string @@ -188,7 +188,7 @@ APR_EXPORT(char *) apr_cpystrn(char *dst, const char *src, size_t dst_size); * @param src The string to rid the spaces from. * @deffunc char *apr_collapse_spaces(char *dest, const char *src) */ -APR_EXPORT(char *) apr_collapse_spaces(char *dest, const char *src); +APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src); /** * Convert the arguments to a program from one string to an array of @@ -198,7 +198,7 @@ APR_EXPORT(char *) apr_collapse_spaces(char *dest, const char *src); * @param token_context Pool to use. * @deffunc apr_status_t apr_tokenize_to_argv(const char *arg_str, char ***argv_out, apr_pool_t *token_context); */ -APR_EXPORT(apr_status_t) apr_tokenize_to_argv(const char *arg_str, +APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, char ***argv_out, apr_pool_t *token_context); diff --git a/include/apr_tables.h b/include/apr_tables.h index 4969ce7d8d1..09a9f2e4bdc 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -189,22 +189,22 @@ struct apr_btable_entry_t { || (((apr_array_header_t *)(t))->nelts == 0)) #define apr_is_empty_btable(t) apr_is_empty_table(t) -APR_EXPORT(apr_array_header_t *) apr_make_array(struct apr_pool_t *p, +APR_DECLARE(apr_array_header_t *) apr_make_array(struct apr_pool_t *p, int nelts, int elt_size); -APR_EXPORT(void *) apr_push_array(apr_array_header_t *arr); -APR_EXPORT(void) apr_array_cat(apr_array_header_t *dst, +APR_DECLARE(void *) apr_push_array(apr_array_header_t *arr); +APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, const apr_array_header_t *src); /* copy_array copies the *entire* array. copy_array_hdr just copies * the header, and arranges for the elements to be copied if (and only * if) the code subsequently does a push or arraycat. */ -APR_EXPORT(apr_array_header_t *) apr_copy_array(struct apr_pool_t *p, +APR_DECLARE(apr_array_header_t *) apr_copy_array(struct apr_pool_t *p, const apr_array_header_t *arr); -APR_EXPORT(apr_array_header_t *) +APR_DECLARE(apr_array_header_t *) apr_copy_array_hdr(struct apr_pool_t *p, const apr_array_header_t *arr); -APR_EXPORT(apr_array_header_t *) +APR_DECLARE(apr_array_header_t *) apr_append_arrays(struct apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second); @@ -215,52 +215,52 @@ APR_EXPORT(apr_array_header_t *) * or if there are no elements in the array. * If sep is non-NUL, it will be inserted between elements as a separator. */ -APR_EXPORT(char *) apr_array_pstrcat(struct apr_pool_t *p, +APR_DECLARE(char *) apr_array_pstrcat(struct apr_pool_t *p, const apr_array_header_t *arr, const char sep); -APR_EXPORT(apr_table_t *) apr_make_table(struct apr_pool_t *p, int nelts); -APR_EXPORT(apr_btable_t *) apr_make_btable(struct apr_pool_t *p, int nelts); -APR_EXPORT(apr_table_t *) apr_copy_table(struct apr_pool_t *p, +APR_DECLARE(apr_table_t *) apr_make_table(struct apr_pool_t *p, int nelts); +APR_DECLARE(apr_btable_t *) apr_make_btable(struct apr_pool_t *p, int nelts); +APR_DECLARE(apr_table_t *) apr_copy_table(struct apr_pool_t *p, const apr_table_t *t); -APR_EXPORT(apr_btable_t *) apr_copy_btable(struct apr_pool_t *p, +APR_DECLARE(apr_btable_t *) apr_copy_btable(struct apr_pool_t *p, const apr_btable_t *t); -APR_EXPORT(void) apr_clear_table(apr_table_t *t); -APR_EXPORT(void) apr_clear_btable(apr_btable_t *t); -APR_EXPORT(const char *) apr_table_get(const apr_table_t *t, const char *key); -APR_EXPORT(const apr_item_t *) apr_btable_get(const apr_btable_t *t, +APR_DECLARE(void) apr_clear_table(apr_table_t *t); +APR_DECLARE(void) apr_clear_btable(apr_btable_t *t); +APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); +APR_DECLARE(const apr_item_t *) apr_btable_get(const apr_btable_t *t, const char *key); -APR_EXPORT(void) apr_table_set(apr_table_t *t, const char *key, +APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) apr_btable_set(apr_btable_t *t, const char *key, +APR_DECLARE(void) apr_btable_set(apr_btable_t *t, const char *key, size_t size, const void *val); -APR_EXPORT(void) apr_table_setn(apr_table_t *t, const char *key, +APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) apr_btable_setn(apr_btable_t *t, const char *key, +APR_DECLARE(void) apr_btable_setn(apr_btable_t *t, const char *key, size_t size, const void *val); -APR_EXPORT(void) apr_table_unset(apr_table_t *t, const char *key); -APR_EXPORT(void) apr_btable_unset(apr_btable_t *t, const char *key); -APR_EXPORT(void) apr_table_merge(apr_table_t *t, const char *key, +APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key); +APR_DECLARE(void) apr_btable_unset(apr_btable_t *t, const char *key); +APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) apr_table_mergen(apr_table_t *t, const char *key, +APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) apr_table_add(apr_table_t *t, const char *key, +APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) apr_btable_add(apr_btable_t *t, const char *key, +APR_DECLARE(void) apr_btable_add(apr_btable_t *t, const char *key, size_t size, const void *val); -APR_EXPORT(void) apr_table_addn(apr_table_t *t, const char *key, +APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) apr_btable_addn(apr_btable_t *t, const char *key, +APR_DECLARE(void) apr_btable_addn(apr_btable_t *t, const char *key, size_t size, const void *val); -APR_EXPORT(apr_table_t *) apr_overlay_tables(struct apr_pool_t *p, +APR_DECLARE(apr_table_t *) apr_overlay_tables(struct apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); -APR_EXPORT(apr_btable_t *) apr_overlay_btables(struct apr_pool_t *p, +APR_DECLARE(apr_btable_t *) apr_overlay_btables(struct apr_pool_t *p, const apr_btable_t *overlay, const apr_btable_t *base); -APR_EXPORT(void) +APR_DECLARE(void) apr_table_do(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, ...); -APR_EXPORT(void) +APR_DECLARE(void) apr_table_vdo(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, va_list); @@ -288,7 +288,7 @@ APR_EXPORT(void) */ #define APR_OVERLAP_TABLES_SET (0) #define APR_OVERLAP_TABLES_MERGE (1) -APR_EXPORT(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, +APR_DECLARE(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, unsigned flags); #ifdef __cplusplus diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 178d576383c..83bad40de45 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -144,7 +144,7 @@ struct apr_dir_t { apr_status_t file_cleanup(void *); /*mode_t get_fileperms(apr_fileperms_t); */ -APR_EXPORT(char *) apr_os_systemcase_filename(struct apr_pool_t *pCont, +APR_DECLARE(char *) apr_os_systemcase_filename(struct apr_pool_t *pCont, const char *szFile); char * canonical_filename(struct apr_pool_t *pCont, const char *szFile); diff --git a/lib/apr_pools.c b/lib/apr_pools.c index f53ebd8df87..c2d76476325 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -456,7 +456,7 @@ static apr_pool_t *permanent_pool; #define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -APR_EXPORT(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) +APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) { union block_hdr *blok; apr_pool_t *new_pool; @@ -537,7 +537,7 @@ struct cleanup { struct cleanup *next; }; -APR_EXPORT(void) apr_register_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup) (void *), apr_status_t (*child_cleanup) (void *)) { @@ -553,7 +553,7 @@ APR_EXPORT(void) apr_register_cleanup(apr_pool_t *p, const void *data, } } -APR_EXPORT(void) apr_kill_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, apr_status_t (*cleanup) (void *)) { struct cleanup *c; @@ -574,7 +574,7 @@ APR_EXPORT(void) apr_kill_cleanup(apr_pool_t *p, const void *data, } } -APR_EXPORT(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, +APR_DECLARE(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, apr_status_t (*cleanup) (void *)) { apr_kill_cleanup(p, data, cleanup); @@ -607,7 +607,7 @@ static void cleanup_pool_for_exec(apr_pool_t *p) } } -APR_EXPORT(void) apr_cleanup_for_exec(void) +APR_DECLARE(void) apr_cleanup_for_exec(void) { #if !defined(WIN32) && !defined(OS2) /* @@ -623,7 +623,7 @@ APR_EXPORT(void) apr_cleanup_for_exec(void) #endif /* ndef WIN32 */ } -APR_EXPORT_NONSTD(apr_status_t) apr_null_cleanup(void *data) +APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data) { /* do nothing cleanup routine */ return APR_SUCCESS; @@ -676,7 +676,7 @@ void apr_term_alloc(void) * This way, we are garaunteed that we only lock this mutex once when calling * either one of these functions. */ -APR_EXPORT(void) apr_clear_pool(apr_pool_t *a) +APR_DECLARE(void) apr_clear_pool(apr_pool_t *a) { while (a->sub_pools) { apr_destroy_pool(a->sub_pools); @@ -711,7 +711,7 @@ APR_EXPORT(void) apr_clear_pool(apr_pool_t *a) #endif } -APR_EXPORT(void) apr_destroy_pool(apr_pool_t *a) +APR_DECLARE(void) apr_destroy_pool(apr_pool_t *a) { apr_clear_pool(a); #if APR_HAS_THREADS @@ -735,11 +735,11 @@ APR_EXPORT(void) apr_destroy_pool(apr_pool_t *a) free_blocks(a->first); } -APR_EXPORT(apr_size_t) apr_bytes_in_pool(apr_pool_t *p) +APR_DECLARE(apr_size_t) apr_bytes_in_pool(apr_pool_t *p) { return bytes_in_block_list(p->first); } -APR_EXPORT(apr_size_t) apr_bytes_in_free_blocks(void) +APR_DECLARE(apr_size_t) apr_bytes_in_free_blocks(void) { return bytes_in_block_list(block_freelist); } @@ -762,7 +762,7 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -APR_EXPORT(apr_pool_t *) apr_find_pool(const void *ts) +APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts) { const char *s = ts; union block_hdr **pb; @@ -808,7 +808,7 @@ APR_EXPORT(apr_pool_t *) apr_find_pool(const void *ts) /* return TRUE iff a is an ancestor of b * NULL is considered an ancestor of all pools */ -APR_EXPORT(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) +APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) { if (a == NULL) { return 1; @@ -830,7 +830,7 @@ APR_EXPORT(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -APR_EXPORT(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) +APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) { union block_hdr *b; @@ -857,7 +857,7 @@ APR_EXPORT(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) * Allocating stuff... */ -APR_EXPORT(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) +APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) { #ifdef ALLOC_USE_MALLOC apr_size_t size = reqsize + CLICK_SZ; @@ -949,7 +949,7 @@ APR_EXPORT(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) #endif } -APR_EXPORT(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) +APR_DECLARE(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) { void *res = apr_palloc(a, size); memset(res, '\0', size); @@ -1042,7 +1042,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) #endif } -APR_EXPORT(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) +APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) { #ifdef ALLOC_USE_MALLOC struct psprintf_data ps; @@ -1101,7 +1101,7 @@ APR_EXPORT(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) #endif } -APR_EXPORT_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) +APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) { va_list ap; char *res; @@ -1124,7 +1124,7 @@ APR_EXPORT_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -APR_EXPORT(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, +APR_DECLARE(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) { struct process_chain *new = diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index f53ebd8df87..c2d76476325 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -456,7 +456,7 @@ static apr_pool_t *permanent_pool; #define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -APR_EXPORT(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) +APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) { union block_hdr *blok; apr_pool_t *new_pool; @@ -537,7 +537,7 @@ struct cleanup { struct cleanup *next; }; -APR_EXPORT(void) apr_register_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup) (void *), apr_status_t (*child_cleanup) (void *)) { @@ -553,7 +553,7 @@ APR_EXPORT(void) apr_register_cleanup(apr_pool_t *p, const void *data, } } -APR_EXPORT(void) apr_kill_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, apr_status_t (*cleanup) (void *)) { struct cleanup *c; @@ -574,7 +574,7 @@ APR_EXPORT(void) apr_kill_cleanup(apr_pool_t *p, const void *data, } } -APR_EXPORT(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, +APR_DECLARE(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, apr_status_t (*cleanup) (void *)) { apr_kill_cleanup(p, data, cleanup); @@ -607,7 +607,7 @@ static void cleanup_pool_for_exec(apr_pool_t *p) } } -APR_EXPORT(void) apr_cleanup_for_exec(void) +APR_DECLARE(void) apr_cleanup_for_exec(void) { #if !defined(WIN32) && !defined(OS2) /* @@ -623,7 +623,7 @@ APR_EXPORT(void) apr_cleanup_for_exec(void) #endif /* ndef WIN32 */ } -APR_EXPORT_NONSTD(apr_status_t) apr_null_cleanup(void *data) +APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data) { /* do nothing cleanup routine */ return APR_SUCCESS; @@ -676,7 +676,7 @@ void apr_term_alloc(void) * This way, we are garaunteed that we only lock this mutex once when calling * either one of these functions. */ -APR_EXPORT(void) apr_clear_pool(apr_pool_t *a) +APR_DECLARE(void) apr_clear_pool(apr_pool_t *a) { while (a->sub_pools) { apr_destroy_pool(a->sub_pools); @@ -711,7 +711,7 @@ APR_EXPORT(void) apr_clear_pool(apr_pool_t *a) #endif } -APR_EXPORT(void) apr_destroy_pool(apr_pool_t *a) +APR_DECLARE(void) apr_destroy_pool(apr_pool_t *a) { apr_clear_pool(a); #if APR_HAS_THREADS @@ -735,11 +735,11 @@ APR_EXPORT(void) apr_destroy_pool(apr_pool_t *a) free_blocks(a->first); } -APR_EXPORT(apr_size_t) apr_bytes_in_pool(apr_pool_t *p) +APR_DECLARE(apr_size_t) apr_bytes_in_pool(apr_pool_t *p) { return bytes_in_block_list(p->first); } -APR_EXPORT(apr_size_t) apr_bytes_in_free_blocks(void) +APR_DECLARE(apr_size_t) apr_bytes_in_free_blocks(void) { return bytes_in_block_list(block_freelist); } @@ -762,7 +762,7 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -APR_EXPORT(apr_pool_t *) apr_find_pool(const void *ts) +APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts) { const char *s = ts; union block_hdr **pb; @@ -808,7 +808,7 @@ APR_EXPORT(apr_pool_t *) apr_find_pool(const void *ts) /* return TRUE iff a is an ancestor of b * NULL is considered an ancestor of all pools */ -APR_EXPORT(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) +APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) { if (a == NULL) { return 1; @@ -830,7 +830,7 @@ APR_EXPORT(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -APR_EXPORT(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) +APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) { union block_hdr *b; @@ -857,7 +857,7 @@ APR_EXPORT(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) * Allocating stuff... */ -APR_EXPORT(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) +APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) { #ifdef ALLOC_USE_MALLOC apr_size_t size = reqsize + CLICK_SZ; @@ -949,7 +949,7 @@ APR_EXPORT(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) #endif } -APR_EXPORT(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) +APR_DECLARE(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) { void *res = apr_palloc(a, size); memset(res, '\0', size); @@ -1042,7 +1042,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) #endif } -APR_EXPORT(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) +APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) { #ifdef ALLOC_USE_MALLOC struct psprintf_data ps; @@ -1101,7 +1101,7 @@ APR_EXPORT(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) #endif } -APR_EXPORT_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) +APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) { va_list ap; char *res; @@ -1124,7 +1124,7 @@ APR_EXPORT_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -APR_EXPORT(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, +APR_DECLARE(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) { struct process_chain *new = diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 03c64ccd5d3..f3a561f6c92 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -35,7 +35,7 @@ #define EMSG "" -APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, +APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, int argc, char *const *argv) { *os = apr_palloc(cont, sizeof(apr_getopt_t)); @@ -48,7 +48,7 @@ APR_EXPORT(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, return APR_SUCCESS; } -APR_EXPORT(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, +APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, char *optch, const char **optarg) { const char *p; diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 61312da705b..fb77b36b11c 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -71,7 +71,7 @@ static apr_other_child_rec_t *other_children = NULL; -APR_EXPORT(void) apr_register_other_child(apr_proc_t *pid, +APR_DECLARE(void) apr_register_other_child(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), void *data, apr_file_t *write_fd, apr_pool_t *p) { @@ -91,7 +91,7 @@ APR_EXPORT(void) apr_register_other_child(apr_proc_t *pid, other_children = ocr; } -APR_EXPORT(void) apr_unregister_other_child(void *data) +APR_DECLARE(void) apr_unregister_other_child(void *data) { apr_other_child_rec_t **pocr, *nocr; @@ -156,7 +156,7 @@ void apr_probe_writable_fds(void) } } -APR_EXPORT(apr_status_t) apr_reap_other_child(apr_proc_t *pid, int status) +APR_DECLARE(apr_status_t) apr_reap_other_child(apr_proc_t *pid, int status) { apr_other_child_rec_t *ocr, *nocr; @@ -172,7 +172,7 @@ APR_EXPORT(apr_status_t) apr_reap_other_child(apr_proc_t *pid, int status) return APR_CHILD_NOTDONE; } -APR_EXPORT(void) apr_check_other_child(void) +APR_DECLARE(void) apr_check_other_child(void) { apr_other_child_rec_t *ocr, *nocr; pid_t waitret; diff --git a/misc/win32/names.c b/misc/win32/names.c index baa20236a11..9e3fc71346b 100644 --- a/misc/win32/names.c +++ b/misc/win32/names.c @@ -82,7 +82,7 @@ static BOOL OnlyDots(char *pString) * is present on the existing path. This routine also * converts alias names to long names. */ -APR_EXPORT(char *) apr_os_systemcase_filename(apr_pool_t *pCont, +APR_DECLARE(char *) apr_os_systemcase_filename(apr_pool_t *pCont, const char *szFile) { char buf[HUGE_STRING_LEN]; diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index e714aa7794c..9231cca94a2 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -204,7 +204,7 @@ static char *getpass(const char *prompt) * but the caller is *not* made aware of it. */ -APR_EXPORT(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, size_t *bufsiz) +APR_DECLARE(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, size_t *bufsiz) { char *pw_got = NULL; int result = 0; diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index 838b633a23d..30ca92183c3 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -186,7 +186,7 @@ static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_MD5Encode() */ /* MD5 initialization. Begins an MD5 operation, writing a new context. */ -APR_EXPORT(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context) +APR_DECLARE(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context) { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ @@ -205,7 +205,7 @@ APR_EXPORT(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context) * to be used for translating the content before calculating the * digest. */ -APR_EXPORT(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, +APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, apr_xlate_t *xlate) { apr_status_t rv; @@ -229,7 +229,7 @@ APR_EXPORT(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, operation, processing another message block, and updating the context. */ -APR_EXPORT(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, +APR_DECLARE(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) { @@ -311,7 +311,7 @@ APR_EXPORT(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ -APR_EXPORT(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], +APR_DECLARE(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context) { unsigned char bits[8]; @@ -461,7 +461,7 @@ static void Decode(UINT4 *output, const unsigned char *input, unsigned int len) } #ifdef CHARSET_EBCDIC -APR_EXPORT(apr_status_t) apr_MD5InitEBCDIC(apr_xlate_t *xlate) +APR_DECLARE(apr_status_t) apr_MD5InitEBCDIC(apr_xlate_t *xlate) { xlate_ebcdic_to_ascii = xlate; return APR_SUCCESS; @@ -491,7 +491,7 @@ static void to64(char *s, unsigned long v, int n) } } -APR_EXPORT(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, +APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, char *result, size_t nbytes) { /* @@ -652,7 +652,7 @@ APR_EXPORT(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, * APR_EMISMATCH if they don't. */ -APR_EXPORT(apr_status_t) apr_validate_password(const char *passwd, +APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, const char *hash) { char sample[120]; diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index 53433c6563d..5f01ea2e9bc 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -80,7 +80,7 @@ * apr_cpystrn() follows the same call structure as strncpy(). */ -APR_EXPORT(char *) apr_cpystrn(char *dst, const char *src, size_t dst_size) +APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, size_t dst_size) { char *d, *end; @@ -120,7 +120,7 @@ APR_EXPORT(char *) apr_cpystrn(char *dst, const char *src, size_t dst_size) * pool and filled in with copies of the tokens * found during parsing of the arg_str. */ -APR_EXPORT(apr_status_t) apr_tokenize_to_argv(const char *arg_str, +APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, char ***argv_out, apr_pool_t *token_context) { @@ -212,7 +212,7 @@ APR_EXPORT(apr_status_t) apr_tokenize_to_argv(const char *arg_str, * Corrected Win32 to accept "a/b\\stuff", "a:stuff" */ -APR_EXPORT(const char *) apr_filename_of_pathname(const char *pathname) +APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname) { const char path_separator = '/'; const char *s = strrchr(pathname, path_separator); @@ -234,7 +234,7 @@ APR_EXPORT(const char *) apr_filename_of_pathname(const char *pathname) * collapse in place (src == dest) is legal. * returns terminating null ptr to dest string. */ -APR_EXPORT(char *) apr_collapse_spaces(char *dest, const char *src) +APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src) { while (*src) { if (!apr_isspace(*src)) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index 131379eca7e..63e8e9dce53 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -56,7 +56,7 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; static const char *rangematch(const char *, int, int); -APR_EXPORT(apr_status_t) apr_fnmatch(const char *pattern, const char *string, int flags) +APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, const char *string, int flags) { const char *stringstart; char c, test; @@ -210,7 +210,7 @@ static const char *rangematch(const char *pattern, int test, int flags) /* This function is an Apache addition */ /* return non-zero if pattern has any glob chars in it */ -APR_EXPORT(int) apr_is_fnmatch(const char *pattern) +APR_DECLARE(int) apr_is_fnmatch(const char *pattern) { int nesting; diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 30648e7daa2..8b577dad384 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -653,7 +653,7 @@ static char *conv_p2_quad(u_widest_int num, register int nbits, /* * Do format conversion placing the output in buffer */ -APR_EXPORT(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), +APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), apr_vformatter_buff_t *vbuff, const char *fmt, va_list ap) { register char *sp; @@ -1155,7 +1155,7 @@ static int snprintf_flush(apr_vformatter_buff_t *vbuff) } -APR_EXPORT_NONSTD(int) apr_snprintf(char *buf, size_t len, +APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, size_t len, const char *format, ...) { int cc; @@ -1176,7 +1176,7 @@ APR_EXPORT_NONSTD(int) apr_snprintf(char *buf, size_t len, } -APR_EXPORT(int) apr_vsnprintf(char *buf, size_t len, const char *format, +APR_DECLARE(int) apr_vsnprintf(char *buf, size_t len, const char *format, va_list ap) { int cc; diff --git a/strings/apr_strings.c b/strings/apr_strings.c index f072f260d43..200f18b64c7 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -57,7 +57,7 @@ #include "apr_private.h" #include "apr_lib.h" -APR_EXPORT(char *) apr_pstrdup(apr_pool_t *a, const char *s) +APR_DECLARE(char *) apr_pstrdup(apr_pool_t *a, const char *s) { char *res; size_t len; @@ -71,7 +71,7 @@ APR_EXPORT(char *) apr_pstrdup(apr_pool_t *a, const char *s) return res; } -APR_EXPORT(char *) apr_pstrndup(apr_pool_t *a, const char *s, apr_size_t n) +APR_DECLARE(char *) apr_pstrndup(apr_pool_t *a, const char *s, apr_size_t n) { char *res; @@ -84,7 +84,7 @@ APR_EXPORT(char *) apr_pstrndup(apr_pool_t *a, const char *s, apr_size_t n) return res; } -APR_EXPORT_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) +APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) { char *cp, *argp, *res; diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 6ec6db055f4..f6b6fad3180 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -127,7 +127,7 @@ static apr_hash_entry_t **alloc_array(apr_hash_t *ht) return apr_pcalloc(ht->pool, sizeof(*ht->array) * (ht->max + 1)); } -APR_EXPORT(apr_hash_t *) apr_make_hash(apr_pool_t *pool) +APR_DECLARE(apr_hash_t *) apr_make_hash(apr_pool_t *pool) { apr_hash_t *ht; ht = apr_palloc(pool, sizeof(apr_hash_t)); @@ -143,7 +143,7 @@ APR_EXPORT(apr_hash_t *) apr_make_hash(apr_pool_t *pool) * Hash iteration functions. */ -APR_EXPORT(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi) +APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi) { hi->this = hi->next; while (!hi->this) { @@ -155,7 +155,7 @@ APR_EXPORT(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi) return hi; } -APR_EXPORT(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht) +APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht) { apr_hash_index_t *hi; hi = apr_palloc(ht->pool, sizeof(*hi)); @@ -166,7 +166,7 @@ APR_EXPORT(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht) return apr_hash_next(hi); } -APR_EXPORT(void) apr_hash_this(apr_hash_index_t *hi, +APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, apr_size_t *klen, void **val) @@ -280,7 +280,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, return hep; } -APR_EXPORT(void *) apr_hash_get(apr_hash_t *ht, +APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, apr_ssize_t klen) { @@ -292,7 +292,7 @@ APR_EXPORT(void *) apr_hash_get(apr_hash_t *ht, return NULL; } -APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, +APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key, apr_ssize_t klen, const void *val) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index a5dbdd6f4ef..abfd4b395f5 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -108,7 +108,7 @@ static void make_array_core(apr_array_header_t *res, apr_pool_t *c, res->nalloc = nelts; /* ...but this many allocated */ } -APR_EXPORT(apr_array_header_t *) apr_make_array(apr_pool_t *p, +APR_DECLARE(apr_array_header_t *) apr_make_array(apr_pool_t *p, int nelts, int elt_size) { apr_array_header_t *res; @@ -118,7 +118,7 @@ APR_EXPORT(apr_array_header_t *) apr_make_array(apr_pool_t *p, return res; } -APR_EXPORT(void *) apr_push_array(apr_array_header_t *arr) +APR_DECLARE(void *) apr_push_array(apr_array_header_t *arr) { if (arr->nelts == arr->nalloc) { int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2; @@ -135,7 +135,7 @@ APR_EXPORT(void *) apr_push_array(apr_array_header_t *arr) return arr->elts + (arr->elt_size * (arr->nelts - 1)); } -APR_EXPORT(void) apr_array_cat(apr_array_header_t *dst, +APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, const apr_array_header_t *src) { int elt_size = dst->elt_size; @@ -160,7 +160,7 @@ APR_EXPORT(void) apr_array_cat(apr_array_header_t *dst, dst->nelts += src->nelts; } -APR_EXPORT(apr_array_header_t *) apr_copy_array(apr_pool_t *p, +APR_DECLARE(apr_array_header_t *) apr_copy_array(apr_pool_t *p, const apr_array_header_t *arr) { apr_array_header_t *res = apr_make_array(p, arr->nalloc, arr->elt_size); @@ -186,7 +186,7 @@ static APR_INLINE void copy_array_hdr_core(apr_array_header_t *res, res->nalloc = arr->nelts; /* Force overflow on push */ } -APR_EXPORT(apr_array_header_t *) +APR_DECLARE(apr_array_header_t *) apr_copy_array_hdr(apr_pool_t *p, const apr_array_header_t *arr) { @@ -200,7 +200,7 @@ APR_EXPORT(apr_array_header_t *) /* The above is used here to avoid consing multiple new array bodies... */ -APR_EXPORT(apr_array_header_t *) +APR_DECLARE(apr_array_header_t *) apr_append_arrays(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second) @@ -217,7 +217,7 @@ APR_EXPORT(apr_array_header_t *) * or if there are no elements in the array. * If sep is non-NUL, it will be inserted between elements as a separator. */ -APR_EXPORT(char *) apr_array_pstrcat(apr_pool_t *p, +APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, const apr_array_header_t *arr, const char sep) { @@ -294,7 +294,7 @@ static apr_table_entry_t *table_push(apr_table_t *t) #endif /* MAKE_TABLE_PROFILE */ -APR_EXPORT(apr_table_t *) apr_make_table(apr_pool_t *p, int nelts) +APR_DECLARE(apr_table_t *) apr_make_table(apr_pool_t *p, int nelts) { apr_table_t *t = apr_palloc(p, sizeof(apr_table_t)); @@ -305,7 +305,7 @@ APR_EXPORT(apr_table_t *) apr_make_table(apr_pool_t *p, int nelts) return t; } -APR_EXPORT(apr_btable_t *) apr_make_btable(apr_pool_t *p, int nelts) +APR_DECLARE(apr_btable_t *) apr_make_btable(apr_pool_t *p, int nelts) { apr_btable_t *t = apr_palloc(p, sizeof(apr_btable_t)); @@ -316,7 +316,7 @@ APR_EXPORT(apr_btable_t *) apr_make_btable(apr_pool_t *p, int nelts) return t; } -APR_EXPORT(apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) +APR_DECLARE(apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) { apr_table_t *new = apr_palloc(p, sizeof(apr_table_t)); @@ -335,7 +335,7 @@ APR_EXPORT(apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) return new; } -APR_EXPORT(apr_btable_t *) apr_copy_btable(apr_pool_t *p, +APR_DECLARE(apr_btable_t *) apr_copy_btable(apr_pool_t *p, const apr_btable_t *t) { apr_btable_t *new = apr_palloc(p, sizeof(apr_btable_entry_t)); @@ -355,17 +355,17 @@ APR_EXPORT(apr_btable_t *) apr_copy_btable(apr_pool_t *p, return new; } -APR_EXPORT(void) apr_clear_table(apr_table_t *t) +APR_DECLARE(void) apr_clear_table(apr_table_t *t) { t->a.nelts = 0; } -APR_EXPORT(void) apr_clear_btable(apr_btable_t *t) +APR_DECLARE(void) apr_clear_btable(apr_btable_t *t) { t->a.nelts = 0; } -APR_EXPORT(const char *) apr_table_get(const apr_table_t *t, const char *key) +APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key) { apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int i; @@ -383,7 +383,7 @@ APR_EXPORT(const char *) apr_table_get(const apr_table_t *t, const char *key) return NULL; } -APR_EXPORT(const apr_item_t *) apr_btable_get(const apr_btable_t *t, +APR_DECLARE(const apr_item_t *) apr_btable_get(const apr_btable_t *t, const char *key) { apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; @@ -402,7 +402,7 @@ APR_EXPORT(const apr_item_t *) apr_btable_get(const apr_btable_t *t, return NULL; } -APR_EXPORT(void) apr_table_set(apr_table_t *t, const char *key, +APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, const char *val) { register int i, j, k; @@ -436,7 +436,7 @@ APR_EXPORT(void) apr_table_set(apr_table_t *t, const char *key, } } -APR_EXPORT(void) apr_btable_set(apr_btable_t *t, const char *key, +APR_DECLARE(void) apr_btable_set(apr_btable_t *t, const char *key, size_t size, const void *val) { register int i, j, k; @@ -476,7 +476,7 @@ APR_EXPORT(void) apr_btable_set(apr_btable_t *t, const char *key, } } -APR_EXPORT(void) apr_table_setn(apr_table_t *t, const char *key, +APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, const char *val) { register int i, j, k; @@ -523,7 +523,7 @@ APR_EXPORT(void) apr_table_setn(apr_table_t *t, const char *key, } } -APR_EXPORT(void) apr_btable_setn(apr_btable_t *t, const char *key, +APR_DECLARE(void) apr_btable_setn(apr_btable_t *t, const char *key, size_t size, const void *val) { register int i, j, k; @@ -575,7 +575,7 @@ APR_EXPORT(void) apr_btable_setn(apr_btable_t *t, const char *key, } } -APR_EXPORT(void) apr_table_unset(apr_table_t *t, const char *key) +APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) { register int i, j, k; apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; @@ -600,7 +600,7 @@ APR_EXPORT(void) apr_table_unset(apr_table_t *t, const char *key) } } -APR_EXPORT(void) apr_btable_unset(apr_btable_t *t, const char *key) +APR_DECLARE(void) apr_btable_unset(apr_btable_t *t, const char *key) { register int i, j, k; apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; @@ -625,7 +625,7 @@ APR_EXPORT(void) apr_btable_unset(apr_btable_t *t, const char *key) } } -APR_EXPORT(void) apr_table_merge(apr_table_t *t, const char *key, +APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, const char *val) { apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; @@ -643,7 +643,7 @@ APR_EXPORT(void) apr_table_merge(apr_table_t *t, const char *key, elts->val = apr_pstrdup(t->a.cont, val); } -APR_EXPORT(void) apr_table_mergen(apr_table_t *t, const char *key, +APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, const char *val) { apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; @@ -674,7 +674,7 @@ APR_EXPORT(void) apr_table_mergen(apr_table_t *t, const char *key, elts->val = (char *)val; } -APR_EXPORT(void) apr_table_add(apr_table_t *t, const char *key, +APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, const char *val) { apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; @@ -684,7 +684,7 @@ APR_EXPORT(void) apr_table_add(apr_table_t *t, const char *key, elts->val = apr_pstrdup(t->a.cont, val); } -APR_EXPORT(void) apr_btable_add(apr_btable_t *t, const char *key, +APR_DECLARE(void) apr_btable_add(apr_btable_t *t, const char *key, size_t size, const void *val) { apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; @@ -699,7 +699,7 @@ APR_EXPORT(void) apr_btable_add(apr_btable_t *t, const char *key, elts->val = item; } -APR_EXPORT(void) apr_table_addn(apr_table_t *t, const char *key, +APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, const char *val) { apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; @@ -722,7 +722,7 @@ APR_EXPORT(void) apr_table_addn(apr_table_t *t, const char *key, elts->val = (char *)val; } -APR_EXPORT(void) apr_btable_addn(apr_btable_t *t, const char *key, +APR_DECLARE(void) apr_btable_addn(apr_btable_t *t, const char *key, size_t size, const void *val) { apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; @@ -750,7 +750,7 @@ APR_EXPORT(void) apr_btable_addn(apr_btable_t *t, const char *key, elts->val = item; } -APR_EXPORT(apr_table_t *) apr_overlay_tables(apr_pool_t *p, +APR_DECLARE(apr_table_t *) apr_overlay_tables(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base) { @@ -782,7 +782,7 @@ APR_EXPORT(apr_table_t *) apr_overlay_tables(apr_pool_t *p, return res; } -APR_EXPORT(apr_btable_t *) apr_overlay_btables(apr_pool_t *p, +APR_DECLARE(apr_btable_t *) apr_overlay_btables(apr_pool_t *p, const apr_btable_t *overlay, const apr_btable_t *base) { @@ -857,7 +857,7 @@ APR_EXPORT(apr_btable_t *) apr_overlay_btables(apr_pool_t *p, * * So to make mod_file_cache easier to maintain, it's a good thing */ -APR_EXPORT(void) apr_table_do(int (*comp) (void *, const char *, const char *), +APR_DECLARE(void) apr_table_do(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, ...) { va_list vp; @@ -865,7 +865,7 @@ APR_EXPORT(void) apr_table_do(int (*comp) (void *, const char *, const char *), apr_table_vdo(comp, rec, t, vp); va_end(vp); } -APR_EXPORT(void) apr_table_vdo(int (*comp) (void *, const char *, const char *), +APR_DECLARE(void) apr_table_vdo(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, va_list vp) { char *argp; @@ -913,7 +913,7 @@ static int sort_overlap(const void *va, const void *vb) #define APR_OVERLAP_TABLES_ON_STACK (512) #endif -APR_EXPORT(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, +APR_DECLARE(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, unsigned flags) { overlap_key cat_keys_buf[APR_OVERLAP_TABLES_ON_STACK]; diff --git a/time/unix/timestr.c b/time/unix/timestr.c index 52aa1f148a5..9926e23a274 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -68,11 +68,11 @@ #endif /* End System Headers */ -APR_VAR_EXPORT const char apr_month_snames[12][4] = +APR_DECLARE_DATA const char apr_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -APR_VAR_EXPORT const char apr_day_snames[7][4] = +APR_DECLARE_DATA const char apr_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 4f397cdd3b1..6df9dcc39bf 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -55,11 +55,11 @@ #include "atime.h" #include "apr_portable.h" -APR_VAR_EXPORT const char apr_month_snames[12][4] = +APR_DECLARE_DATA const char apr_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -APR_VAR_EXPORT const char apr_day_snames[7][4] = +APR_DECLARE_DATA const char apr_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; From 4b53ae36d40704603a5c3ae3d1a7ef0d3c8a2307 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 16 Oct 2000 06:18:19 +0000 Subject: [PATCH 0610/7878] Pesky straggler git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60588 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_time.h b/include/apr_time.h index 5983c54eff1..0c182b3c0a2 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -66,8 +66,8 @@ extern "C" { * @package APR Time library */ -APR_VAR_IMPORT const char apr_month_snames[12][4]; -APR_VAR_IMPORT const char apr_day_snames[7][4]; +APR_DECLARE_DATA const char apr_month_snames[12][4]; +APR_DECLARE_DATA const char apr_day_snames[7][4]; /* number of microseconds since 00:00:00 january 1, 1970 UTC */ typedef apr_int64_t apr_time_t; From 7d74776bf6b9452eac2909ab1c1c93e81ae66233 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 16 Oct 2000 06:22:24 +0000 Subject: [PATCH 0611/7878] Sorry. This new module will be going into apr, but I'm not finished yet. First, it will be internal. Second, it will be syntacticly similar to the apr_xlate functions, which may someday call it. For now, it's a placeholder (like the win32 mmap stuff.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60589 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 80 +++++++++++++++++++++++++++++++----------------------- aprlib.dsp | 80 +++++++++++++++++++++++++++++++----------------------- 2 files changed, 92 insertions(+), 68 deletions(-) diff --git a/apr.dsp b/apr.dsp index ebbc8a55108..1403dd800bc 100644 --- a/apr.dsp +++ b/apr.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="aprlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 @@ -22,7 +22,6 @@ CFG=aprlib - Win32 Debug !MESSAGE # Begin Project -# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -302,6 +301,10 @@ SOURCE=.\threadproc\win32\thread.c SOURCE=.\threadproc\win32\threadpriv.c # End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\threadproc.h +# End Source File # End Group # Begin Group "dso" @@ -330,6 +333,23 @@ SOURCE=.\lib\apr_signal.c # Begin Group "i18n" # PROP Default_Filter "" +# Begin Source File + +SOURCE=.\i18n\unix\i18n.h +# End Source File +# Begin Source File + +SOURCE=.\i18n\unix\utf8_ucs2.c + +!IF "$(CFG)" == "aprlib - Win32 Release" + +!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" + +# PROP Exclude_From_Build 1 + +!ENDIF + +# End Source File # End Group # Begin Group "shmem" @@ -350,35 +370,31 @@ SOURCE=.\include\apr.h # End Source File # Begin Source File -SOURCE=.\include\apr_private.h +SOURCE=.\include\apr.h.in # End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr_private.hw +SOURCE=.\include\apr.hw !IF "$(CFG)" == "aprlib - Win32 Release" # Begin Custom Build -InputPath=.\include\apr_private.hw +InputPath=.\include\apr.hw -".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr_private.hw .\include\apr_private.h > nul - echo Created apr_private.h from apr_private.hw +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw # End Custom Build !ELSEIF "$(CFG)" == "aprlib - Win32 Debug" # Begin Custom Build -InputPath=.\include\apr_private.hw +InputPath=.\include\apr.hw -".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr_private.hw .\include\apr_private.h > nul - echo Created apr_private.h from apr_private.hw +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw # End Custom Build @@ -387,45 +403,41 @@ InputPath=.\include\apr_private.hw # End Source File # Begin Source File -SOURCE=.\threadproc\win32\threadproc.h -# End Source File -# End Group -# Begin Group "External Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr.h.in +SOURCE=.\include\apr_private.h # End Source File # Begin Source File -SOURCE=.\include\apr.hw +SOURCE=.\include\apr_private.hw !IF "$(CFG)" == "aprlib - Win32 Release" # Begin Custom Build -InputPath=.\include\apr.hw +InputPath=.\include\apr_private.hw -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw +".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr_private.hw .\include\apr_private.h > nul + echo Created apr_private.h from apr_private.hw # End Custom Build !ELSEIF "$(CFG)" == "aprlib - Win32 Debug" # Begin Custom Build -InputPath=.\include\apr.hw +InputPath=.\include\apr_private.hw -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw +".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr_private.hw .\include\apr_private.h > nul + echo Created apr_private.h from apr_private.hw # End Custom Build !ENDIF # End Source File +# End Group +# Begin Group "External Header Files" + +# PROP Default_Filter "" # Begin Source File SOURCE=.\include\apr_compat.h diff --git a/aprlib.dsp b/aprlib.dsp index ebbc8a55108..1403dd800bc 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="aprlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 @@ -22,7 +22,6 @@ CFG=aprlib - Win32 Debug !MESSAGE # Begin Project -# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -302,6 +301,10 @@ SOURCE=.\threadproc\win32\thread.c SOURCE=.\threadproc\win32\threadpriv.c # End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\threadproc.h +# End Source File # End Group # Begin Group "dso" @@ -330,6 +333,23 @@ SOURCE=.\lib\apr_signal.c # Begin Group "i18n" # PROP Default_Filter "" +# Begin Source File + +SOURCE=.\i18n\unix\i18n.h +# End Source File +# Begin Source File + +SOURCE=.\i18n\unix\utf8_ucs2.c + +!IF "$(CFG)" == "aprlib - Win32 Release" + +!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" + +# PROP Exclude_From_Build 1 + +!ENDIF + +# End Source File # End Group # Begin Group "shmem" @@ -350,35 +370,31 @@ SOURCE=.\include\apr.h # End Source File # Begin Source File -SOURCE=.\include\apr_private.h +SOURCE=.\include\apr.h.in # End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr_private.hw +SOURCE=.\include\apr.hw !IF "$(CFG)" == "aprlib - Win32 Release" # Begin Custom Build -InputPath=.\include\apr_private.hw +InputPath=.\include\apr.hw -".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr_private.hw .\include\apr_private.h > nul - echo Created apr_private.h from apr_private.hw +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw # End Custom Build !ELSEIF "$(CFG)" == "aprlib - Win32 Debug" # Begin Custom Build -InputPath=.\include\apr_private.hw +InputPath=.\include\apr.hw -".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr_private.hw .\include\apr_private.h > nul - echo Created apr_private.h from apr_private.hw +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw # End Custom Build @@ -387,45 +403,41 @@ InputPath=.\include\apr_private.hw # End Source File # Begin Source File -SOURCE=.\threadproc\win32\threadproc.h -# End Source File -# End Group -# Begin Group "External Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr.h.in +SOURCE=.\include\apr_private.h # End Source File # Begin Source File -SOURCE=.\include\apr.hw +SOURCE=.\include\apr_private.hw !IF "$(CFG)" == "aprlib - Win32 Release" # Begin Custom Build -InputPath=.\include\apr.hw +InputPath=.\include\apr_private.hw -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw +".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr_private.hw .\include\apr_private.h > nul + echo Created apr_private.h from apr_private.hw # End Custom Build !ELSEIF "$(CFG)" == "aprlib - Win32 Debug" # Begin Custom Build -InputPath=.\include\apr.hw +InputPath=.\include\apr_private.hw -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw +".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr_private.hw .\include\apr_private.h > nul + echo Created apr_private.h from apr_private.hw # End Custom Build !ENDIF # End Source File +# End Group +# Begin Group "External Header Files" + +# PROP Default_Filter "" # Begin Source File SOURCE=.\include\apr_compat.h From e2413e0efbae1f0fb296d260fc13f14f2d12d353 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Mon, 16 Oct 2000 12:32:42 +0000 Subject: [PATCH 0612/7878] Make sure that passing (s, APR_HASH_KEY_STRING) and (s, strlen(s)) are equivalent. The +1 would lead to subtle errors when people forgot t include the null-term in the hash value. (and it is possible that the caller is extracting a substring for the key and does not *have* a null term when doing a lookup) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60590 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 6 ++++-- tables/apr_hash.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index b1b7afeab3f..dde1f10c9ff 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -74,8 +74,10 @@ extern "C" { * passed to indicate a string-valued key, and have apr_hash compute the * length automatically. * - * Note: apr_hash will use strlen(key)+1 for the length. This allows - * apr_hash_this() to return a null-terminated string as the key. + * Note: apr_hash will use strlen(key) for the length. The null-terminator + * is not included in the hash value (why throw a constant in?). + * Since the hash table merely references the provided key (rather + * than copying it), apr_hash_this() will return the null-term'd key. */ #define APR_HASH_KEY_STRING (-1) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index f6b6fad3180..b0385fb187f 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -216,7 +216,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, int i; if (klen == APR_HASH_KEY_STRING) - klen = strlen(key) + 1; + klen = strlen(key); /* * This is Daniel J. Bernstein's popular `times 33' hash function From 7ac01147173e3033cef021dfc14a151d9dad8d73 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 16 Oct 2000 13:50:34 +0000 Subject: [PATCH 0613/7878] Fix compile break in Win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60591 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 3 ++- aprlib.dsp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apr.dsp b/apr.dsp index 1403dd800bc..e1e10a36126 100644 --- a/apr.dsp +++ b/apr.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="aprlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 @@ -22,6 +22,7 @@ CFG=aprlib - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe diff --git a/aprlib.dsp b/aprlib.dsp index 1403dd800bc..e1e10a36126 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="aprlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 @@ -22,6 +22,7 @@ CFG=aprlib - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe From 50a8265780befb60a169e630d273e7347e4b689e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 17 Oct 2000 03:54:43 +0000 Subject: [PATCH 0614/7878] Ugh... had different meaning between apr and ap. Not good, all fixed. Submitted by: Karl Fogel <kfogel@collab.net> Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60592 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_time.h b/include/apr_time.h index 0c182b3c0a2..540c12c40fc 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -66,8 +66,8 @@ extern "C" { * @package APR Time library */ -APR_DECLARE_DATA const char apr_month_snames[12][4]; -APR_DECLARE_DATA const char apr_day_snames[7][4]; +extern APR_DECLARE_DATA const char apr_month_snames[12][4]; +extern APR_DECLARE_DATA const char apr_day_snames[7][4]; /* number of microseconds since 00:00:00 january 1, 1970 UTC */ typedef apr_int64_t apr_time_t; From e5dc9ffad3ea08a71333ed29076eede3608788c3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 17 Oct 2000 13:26:54 +0000 Subject: [PATCH 0615/7878] Make things a little clearer in reaction to the _snames snafus. Submitted by: Greg Stein Reviewed by: William Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60593 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 4 +++- include/apr.hw | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index d251c02cfe8..b843bd22554 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -156,7 +156,9 @@ typedef @socklen_t_value@ apr_socklen_t; * The public APR variables are declared with AP_MODULE_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * - * @deffunc type APR_DECLARE_DATA apr_variable; + * @deffunc APR_DECLARE_DATA type apr_variable; + * @tip extern APR_DECLARE_DATA type apr_variable; syntax is required for + * declarations within headers to properly import the variable. */ #define APR_DECLARE_DATA diff --git a/include/apr.hw b/include/apr.hw index 9404b4d0486..f4519996316 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -214,7 +214,9 @@ typedef int gid_t; * The public APR variables are declared with AP_MODULE_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * - * @deffunc type APR_DECLARE_DATA apr_variable; + * @deffunc APR_DECLARE_DATA type apr_variable; + * @tip extern APR_DECLARE_DATA type apr_variable; syntax is required for + * declarations within headers to properly import the variable. */ #define APR_DECLARE_DATA #elif defined(APR_DECLARE_STATIC) From d061e9f0096ef125ca087f6ddbeeda4d4866ad39 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 17 Oct 2000 17:06:56 +0000 Subject: [PATCH 0616/7878] Clearing more things off my plate. Here is the -internal- utf8/ucs2 conversion. It's not exported, nor should it be. Jeff suggests wrapping into apr_xlate, which is fine if someone would like to do so. This pair is for handling utf8 resource identifiers (filenames) on any Unicode aware platform, so that the Unicode values are invisible to the application (apache server). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60594 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/i18n.h | 89 +++++++++++++ i18n/unix/utf8_ucs2.c | 280 +++++++++++++++++++++++++++++++++++++++ include/arch/unix/i18n.h | 89 +++++++++++++ 3 files changed, 458 insertions(+) create mode 100644 i18n/unix/i18n.h create mode 100644 i18n/unix/utf8_ucs2.c create mode 100644 include/arch/unix/i18n.h diff --git a/i18n/unix/i18n.h b/i18n/unix/i18n.h new file mode 100644 index 00000000000..da5f58f2cf6 --- /dev/null +++ b/i18n/unix/i18n.h @@ -0,0 +1,89 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#ifndef I18N_H +#define I18N_H + +#include "apr.h" +#include "apr_xlate.h" + +/* If we ever support anything more exciting than char... this could move. + */ +typedef apr_int16_t apr_wchar_t; + +/** + * An APR internal function for fast utf-8 octet-encoded Unicode conversion + * to the ucs-2 wide Unicode format. This function is used for filename and + * other resource conversions for platforms providing native Unicode support. + * + * @tip Only the errors APR_EINVAL and APR_INCOMPLETE may occur, the former + * when the character code is invalid (in or out of context) and the later + * when more characters were expected, but insufficient characters remain. + */ +apr_status_t conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, + apr_wchar_t *out, apr_size_t *outwords); + +/** + * An APR internal function for fast ucs-2 wide Unicode format conversion to + * the utf-8 octet-encoded Unicode. This function is used for filename and + * other resource conversions for platforms providing native Unicode support. + * + * @tip Only the errors APR_EINVAL and APR_INCOMPLETE may occur, the former + * when the character code is invalid (in or out of context) and the later + * when more words were expected, but insufficient words remain. + */ +apr_status_t conv_ucs2_to_utf8(const apr_wchar_t *in, apr_size_t *inwords, + char *out, apr_size_t *outbytes); + +#endif /* def I18N_H */ diff --git a/i18n/unix/utf8_ucs2.c b/i18n/unix/utf8_ucs2.c new file mode 100644 index 00000000000..a3dddf46764 --- /dev/null +++ b/i18n/unix/utf8_ucs2.c @@ -0,0 +1,280 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include "i18n.h" + +/* Implement the design principal specified by RFC 2718 2.2.5 + * Guidelines for new URL Schemes - within the APR. + * + * Since many architectures support unicode, and UCS2 is the most + * efficient storage used by those archictures, these functions + * exist to validate a UCS string. It is up to the operating system + * to determine the validitity of the string in the context of it's + * native language support. File systems that support filename + * characters of 0x80-0xff but have no support of Unicode will find + * this function useful only for validating the character sequences + * and rejecting poorly encoded strings, if RFC 2718 2.2.5 naming is + * desired. + * + * from RFC 2279 UTF-8, a transformation format of ISO 10646 + * + * UCS-4 range (hex.) UTF-8 octet sequence (binary) + * 1:2 0000 0000-0000 007F 0xxxxxxx + * 2:2 0000 0080-0000 07FF 110XXXXx 10xxxxxx + * 3:2 0000 0800-0000 FFFF 1110XXXX 10Xxxxxx 10xxxxxx + * 4:4 0001 0000-001F FFFF 11110zXX 10XXxxxx 10xxxxxx 10xxxxxx + * inv 0020 0000-03FF FFFF 111110XX 10XXXxxx 10xxxxxx 10xxxxxx 10xxxxxx + * inv 0400 0000-7FFF FFFF 1111110X 10XXXXxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx + * + * One of the X values must be one for the encoding length to be legit. + * Neither the z bit, nor the final two forms, are used for ucs-2 + * + * "Pairs of UCS-2 values between D800 and DFFF (surrogate pairs in + * Unicode parlance), being actually UCS-4 characters transformed + * through UTF-16, need special treatment: the UTF-16 transformation + * must be undone, yielding a UCS-4 character that is then transformed + * as above." + * + * from RFC2781 UTF-16: the compressed ISO 10646 encoding bitmask + * + * U' = U - 0x10000 + * U' = 000000000000yyyyyyyyyyxxxxxxxxxx + * W1 = 110110yyyyyyyyyy + * W2 = 110111xxxxxxxxxx + * + * conv_utf8_to_ucs2 out bytes: sizeof(in) * 1 <= Req <= sizeof(in) * 2 + * + * conv_ucs2_to_utf8 out words: sizeof(in) / 2 <= Req <= sizeof(in) * 3 / 2 + */ + +apr_status_t conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, + apr_wchar_t *out, apr_size_t *outwords) +{ + apr_int64_t newch, mask; + int ch, expect, eating; + + while (*inbytes && *outwords) + { + ch = (unsigned char)(*in++); + if (!(ch & 0200)) { + /* US-ASCII-7 plain text + */ + --*inbytes; + --*outwords; + *(out++) = ch; + } + else + { + if ((ch & 0300) != 0300) { + /* Multibyte Continuation is out of place + */ + return APR_EINVAL; + } + else + { + /* Multibyte Sequence Lead Character + * + * Compute the expected bytes while adjusting + * or lead byte and leading zeros mask. + */ + mask = 0340; + expect = 1; + while ((ch & mask) == mask) { + mask |= mask >> 1; + if (++expect > 3) /* (truly 5 for ucs-4) */ + return APR_EINVAL; + } + newch = ch & ~mask; + eating = expect + 1; + if (*inbytes <= expect) + return APR_INCOMPLETE; + /* Reject values of excessive leading 0 bits + * utf-8 _demands_ the shortest possible byte length + */ + if (expect == 1) { + if (!(newch & 0036)) + return APR_EINVAL; + } + else { + /* Reject values of excessive leading 0 bits + */ + if (!newch && !((unsigned char)*in & 0077 & (mask << 1))) + return APR_EINVAL; + if (expect == 2) { + /* Reject values D800-DFFF when not utf16 encoded + * (may not be an appropriate restriction for ucs-4) + */ + if (newch == 0015 && ((unsigned char)*in & 0040)) + return APR_EINVAL; + } + else if (expect == 3) { + /* Short circuit values > 110000 + */ + if (newch > 4) + return APR_EINVAL; + if (newch == 4 && ((unsigned char)*in & 0060)) + return APR_EINVAL; + } + } + if (*outwords < (expect > 2) + 1) + break; /* buffer full */ + while (expect--) + { + /* Multibyte Continuation must be legal */ + if (((ch = (unsigned char)*(in++)) & 0300) != 0200) + return APR_EINVAL; + newch <<= 6; + newch |= (ch & 0077); + } + *inbytes -= eating; + /* newch is now a true ucs-4 character + * + * now we need to fold to ucs-2 + */ + if (newch < 0x10000) + { + --*outwords; + *(out++) = (apr_wchar_t) newch; + } + else + { + *outwords -= 2; + newch -= 0x10000; + *(out++) = (apr_wchar_t) (0xD800 | (newch >> 10)); + *(out++) = (apr_wchar_t) (0xDC00 | (newch & 0x03FF)); + } + } + } + } + /* Buffer full 'errors' aren't errors, the client must inspect both + * the inbytes and outwords values + */ + return APR_SUCCESS; +} + +apr_status_t conv_ucs2_to_utf8(const apr_wchar_t *in, apr_size_t *inwords, + char *out, apr_size_t *outbytes) +{ + apr_int64_t newch, require; + char *invout; + int ch, need; + + while (*inwords && *outbytes) + { + ch = (unsigned short)(*in++); + if (ch < 0x80) + { + --*inwords; + --*outbytes; + *(out++) = (unsigned char) ch; + } + else + { + if ((ch & 0xFC00) == 0xDC00) { + /* Invalid Leading ucs-2 Multiword Continuation Character + */ + return APR_EINVAL; + } + if ((ch & 0xFC00) == 0xD800) { + /* Leading ucs-2 Multiword Character + */ + if (*inwords < 2) { + /* Missing ucs-2 Multiword Continuation Character + */ + return APR_INCOMPLETE; + } + if (((unsigned short)(*in) & 0xFC00) != 0xDC00) { + /* Invalid ucs-2 Multiword Continuation Character + */ + return APR_EINVAL; + } + newch = (ch & 0x03FF) << 10 | ((unsigned short)(*in++) & 0x03FF); + newch += 0x10000; + } + else { + /* ucs-2 Single Word Character + */ + newch = ch; + } + /* Determine the absolute minimum utf-8 bytes required + */ + require = newch >> 11; + need = 1; + while (require) + require >>= 5, ++need; + if (need >= *outbytes) + break; /* Insufficient buffer */ + *inwords -= (need > 2) + 1; + *outbytes -= need + 1; + /* Compute the utf-8 characters in last to first order, + * calculating the lead character length bits along the way. + */ + ch = 0200; + out += need + 1; + invout = out; + while (need--) { + ch |= ch >> 1; + *(--invout) = (unsigned char)(0200 | (newch & 0077)); + newch >>= 6; + } + /* Compute the lead utf-8 character and move the dest offset + */ + *(--invout) = (unsigned char)(ch | newch); + } + } + /* Buffer full 'errors' aren't errors, the client must inspect both + * the inwords and outbytes values + */ + return APR_SUCCESS; +} diff --git a/include/arch/unix/i18n.h b/include/arch/unix/i18n.h new file mode 100644 index 00000000000..da5f58f2cf6 --- /dev/null +++ b/include/arch/unix/i18n.h @@ -0,0 +1,89 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#ifndef I18N_H +#define I18N_H + +#include "apr.h" +#include "apr_xlate.h" + +/* If we ever support anything more exciting than char... this could move. + */ +typedef apr_int16_t apr_wchar_t; + +/** + * An APR internal function for fast utf-8 octet-encoded Unicode conversion + * to the ucs-2 wide Unicode format. This function is used for filename and + * other resource conversions for platforms providing native Unicode support. + * + * @tip Only the errors APR_EINVAL and APR_INCOMPLETE may occur, the former + * when the character code is invalid (in or out of context) and the later + * when more characters were expected, but insufficient characters remain. + */ +apr_status_t conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, + apr_wchar_t *out, apr_size_t *outwords); + +/** + * An APR internal function for fast ucs-2 wide Unicode format conversion to + * the utf-8 octet-encoded Unicode. This function is used for filename and + * other resource conversions for platforms providing native Unicode support. + * + * @tip Only the errors APR_EINVAL and APR_INCOMPLETE may occur, the former + * when the character code is invalid (in or out of context) and the later + * when more words were expected, but insufficient words remain. + */ +apr_status_t conv_ucs2_to_utf8(const apr_wchar_t *in, apr_size_t *inwords, + char *out, apr_size_t *outbytes); + +#endif /* def I18N_H */ From 5360fb6e67b0881a3b5065a1242c449b588eb5a3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 17 Oct 2000 17:09:11 +0000 Subject: [PATCH 0617/7878] Test for utf8/ucs2 conversion, plus a cool little workspace for APR testing from Win32. Load src/lib/apr/test/testsuite.dsw to get at any of the APR tests. Note I didn't clean them up at all (except for testucs), so your mileage may vary. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60595 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsuite.dsw | 149 +++++++++++++++++++++++++++++++++++++++++ test/testucs.c | 160 +++++++++++++++++++++++++++++++++++++++++++++ test/testucs.dsp | 93 ++++++++++++++++++++++++++ 3 files changed, 402 insertions(+) create mode 100644 test/testsuite.dsw create mode 100644 test/testucs.c create mode 100644 test/testucs.dsp diff --git a/test/testsuite.dsw b/test/testsuite.dsw new file mode 100644 index 00000000000..fb5557c8698 --- /dev/null +++ b/test/testsuite.dsw @@ -0,0 +1,149 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "aprlib"="..\aprlib.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "testarg"=".\testarg.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name aprlib + End Project Dependency +}}} + +############################################################################### + +Project: "testfile"=".\testfile.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name aprlib + End Project Dependency +}}} + +############################################################################### + +Project: "testproc"=".\testproc.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name aprlib + End Project Dependency +}}} + +############################################################################### + +Project: "testsig"=".\testsig.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name aprlib + End Project Dependency +}}} + +############################################################################### + +Project: "testsock"=".\testsock.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name aprlib + End Project Dependency +}}} + +############################################################################### + +Project: "testthread"=".\testthread.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name aprlib + End Project Dependency +}}} + +############################################################################### + +Project: "testucs"=".\testucs.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name aprlib + End Project Dependency +}}} + +############################################################################### + +Project: "timetest"=".\timetest.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name aprlib + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/test/testucs.c b/test/testucs.c new file mode 100644 index 00000000000..bbd264f4d5d --- /dev/null +++ b/test/testucs.c @@ -0,0 +1,160 @@ +#include "apr_xlate.h" +#include "../i18n/unix/i18n.h" +#include <wchar.h> +#include <string.h> + +struct testval { + unsigned char n[8]; + wchar_t w[4]; + int nl; + int wl; +}; + +void displaynw(struct testval *f, struct testval *l) +{ + char x[80], *t = x; + int i; + for (i = 0; i < f->nl; ++i) + t += sprintf(t, "%02X ", f->n[i]); + *(t++) = '-'; + for (i = 0; i < l->nl; ++i) + t += sprintf(t, " %02X", l->n[i]); + *(t++) = ' '; + *(t++) = '='; + *(t++) = ' '; + for (i = 0; i < f->wl; ++i) + t += sprintf(t, "%04X ", f->w[i]); + *(t++) = '-'; + for (i = 0; i < l->wl; ++i) + t += sprintf(t, " %04X", l->w[i]); + puts(x); +} + +/* + * Test every possible byte value. + * If the test passes or fails at this byte value we are done. + * Otherwise iterate test_nrange again, appending another byte. + */ +void test_nrange(struct testval *p) +{ + struct testval f, l, s; + apr_status_t rc; + int success = 0; + + memcpy (&s, p, sizeof(s)); + ++s.nl; + + do { + apr_size_t nl = s.nl, wl = sizeof(s.w) / 2; + rc = conv_utf8_to_ucs2(s.n, &nl, s.w, &wl); + s.wl = (sizeof(s.w) / 2) - wl; + if (!nl && rc == APR_SUCCESS) { + if (!success) { + memcpy(&f, &s, sizeof(s)); + success = -1; + } + else { + if (s.wl != l.wl + || memcmp(s.w, l.w, (s.wl - 1) * 2) != 0 + || s.w[s.wl - 1] != l.w[l.wl - 1] + 1) { + displaynw(&f, &l); + memcpy(&f, &s, sizeof(s)); + } + } + memcpy(&l, &s, sizeof(s)); + } + else { + if (success) { + displaynw(&f, &l); + success = 0; + } + if (rc == APR_INCOMPLETE) { + test_nrange(&s); + } + } + } while (++s.n[s.nl - 1]); + + if (success) { + displaynw(&f, &l); + success = 0; + } +} + +/* + * Test every possible word value. + * Once we are finished, retest every possible word value. + * if the test fails on the following null word, iterate test_nrange + * again, appending another word. + * This assures the output order of the two tests are in sync. + */ +void test_wrange(struct testval *p) +{ + struct testval f, l, s; + apr_status_t rc; + int success = 0; + + memcpy (&s, p, sizeof(s)); + ++s.wl; + + do { + apr_size_t nl = sizeof(s.n), wl = s.wl; + rc = conv_ucs2_to_utf8(s.w, &wl, s.n, &nl); + s.nl = sizeof(s.n) - nl; + if (!wl && rc == APR_SUCCESS) { + if (!success) { + memcpy(&f, &s, sizeof(s)); + success = -1; + } + else { + if (s.nl != l.nl + || memcmp(s.n, l.n, s.nl - 1) != 0 + || s.n[s.nl - 1] != l.n[l.nl - 1] + 1) { + displaynw(&f, &l); + memcpy(&f, &s, sizeof(s)); + } + } + memcpy(&l, &s, sizeof(s)); + } + else { + if (success) { + displaynw(&f, &l); + success = 0; + } + } + } while (++s.w[s.wl - 1]); + + if (success) { + displaynw(&f, &l); + success = 0; + } + + do { + int wl = s.wl, nl = sizeof(s.n); + rc = conv_ucs2_to_utf8(s.w, &wl, s.n, &nl); + s.nl = sizeof(s.n) - s.nl; + if (rc == APR_INCOMPLETE) { + test_wrange(&s); + } + } while (++s.w[s.wl - 1]); +} + +/* + * Syntax: testucs [w|n] + * + * If arg is not recognized, run both tests. + */ +int main(int argc, char **argv) +{ + struct testval s; + memset (&s, 0, sizeof(s)); + + if (argc < 2 || tolower(*argv[1]) != 'w') { + printf ("\n\nTesting Narrow Char Ranges\n"); + test_nrange(&s); + } + if (argc < 2 || tolower(*argv[1]) != 'n') { + printf ("\n\nTesting Wide Char Ranges\n"); + test_wrange(&s); + } + return 0; +} diff --git a/test/testucs.dsp b/test/testucs.dsp new file mode 100644 index 00000000000..e5b8dcab169 --- /dev/null +++ b/test/testucs.dsp @@ -0,0 +1,93 @@ +# Microsoft Developer Studio Project File - Name="testucs" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=testucs - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "testucs.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "testucs.mak" CFG="testucs - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "testucs - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "testucs - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "testucs - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\include" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "APR_DECLARE_SYMBOLS" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:".\testucs.exe" +# SUBTRACT LINK32 /debug + +!ELSEIF "$(CFG)" == "testucs - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "testucs_" +# PROP BASE Intermediate_Dir "testucs_" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "testucs" +# PROP Intermediate_Dir "testucs" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /ZI /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "APR_DECLARE_SYMBOLS" /D "_CONSOLE" /D "_MBCS" /FD /ZI /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:".\testucs.exe" /pdbtype:sept +# SUBTRACT LINK32 /incremental:no + +!ENDIF + +# Begin Target + +# Name "testucs - Win32 Release" +# Name "testucs - Win32 Debug" +# Begin Source File + +SOURCE=.\testucs.c +# End Source File +# End Target +# End Project From 0c3178df3b5f13639c506b7336f83636ceb34fc2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 17 Oct 2000 17:47:47 +0000 Subject: [PATCH 0618/7878] This slipped by. Note xlate.c isn't actually built, as we are missing the underlying i18nlib and must deal with the license issues, or play some pretty mean tricks in Win32 (assuming Win32 gets it right.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60596 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 11 +++++++---- aprlib.dsp | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/apr.dsp b/apr.dsp index e1e10a36126..dd74e7a04bd 100644 --- a/apr.dsp +++ b/apr.dsp @@ -68,8 +68,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c -# ADD CPP /nologo /MDd /W3 /GX /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c +# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -346,10 +346,13 @@ SOURCE=.\i18n\unix\utf8_ucs2.c !ELSEIF "$(CFG)" == "aprlib - Win32 Debug" -# PROP Exclude_From_Build 1 - !ENDIF +# End Source File +# Begin Source File + +SOURCE=.\i18n\unix\xlate.c +# PROP Exclude_From_Build 1 # End Source File # End Group # Begin Group "shmem" diff --git a/aprlib.dsp b/aprlib.dsp index e1e10a36126..dd74e7a04bd 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -68,8 +68,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c -# ADD CPP /nologo /MDd /W3 /GX /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c +# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -346,10 +346,13 @@ SOURCE=.\i18n\unix\utf8_ucs2.c !ELSEIF "$(CFG)" == "aprlib - Win32 Debug" -# PROP Exclude_From_Build 1 - !ENDIF +# End Source File +# Begin Source File + +SOURCE=.\i18n\unix\xlate.c +# PROP Exclude_From_Build 1 # End Source File # End Group # Begin Group "shmem" From 2969424a8b579b3783c8058b636002deb2090835 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 18 Oct 2000 02:44:50 +0000 Subject: [PATCH 0619/7878] document the file types git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60597 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 302557c4d1e..2d8cf0eb28a 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -70,8 +70,16 @@ extern "C" { * @package APR File handling */ -typedef enum {APR_NOFILE, APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, APR_LNK, - APR_SOCK} apr_filetype_e; +typedef enum { + APR_NOFILE, /* the file exists, but APR doesn't know its type */ + APR_REG, /* a regular file */ + APR_DIR, /* a directory */ + APR_CHR, /* a character device */ + APR_BLK, /* a block device */ + APR_PIPE, /* a FIFO / pipe */ + APR_LNK, /* a symbolic link */ + APR_SOCK /* a [unix domain] socket */ +} apr_filetype_e; /* Flags for apr_open */ #define APR_READ 1 /* Open the file for reading */ From 8845f46c39c05a49372130656f65bd34ef6475e1 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Wed, 18 Oct 2000 03:21:14 +0000 Subject: [PATCH 0620/7878] Cleanup apr_tokenize_to_argv a bit, and fix a problem where we weren't allocating enough memory for the argv array. This brings us closer to getting piped logs working again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60598 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_cpystrn.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index 5f01ea2e9bc..e8aa7ed00cf 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -172,7 +172,7 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, SKIP_WHITESPACE(tmpCnt); } - *argv_out = apr_palloc(token_context, numargs*sizeof(char*)); + *argv_out = apr_palloc(token_context, (numargs + 1)*sizeof(char*)); if (*argv_out == NULL) { return (APR_ENOMEM); } @@ -183,18 +183,15 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, CHECK_QUOTATION(cp, isquoted); tmpCnt = cp; DETERMINE_NEXTSTRING(cp, isquoted); - if (*cp == '\0') { - (*argv_out)[numargs] = apr_pstrdup(token_context, tmpCnt); - numargs++; + cp++; + (*argv_out)[numargs] = apr_palloc(token_context, cp - tmpCnt); + apr_cpystrn((*argv_out)[numargs], tmpCnt, cp - tmpCnt); + numargs++; + /* This needs to be -1 because we move past the end above. */ + if (*(cp - 1) == '\0') { (*argv_out)[numargs] = '\0'; break; } - else { - cp++; - (*argv_out)[numargs] = apr_palloc(token_context, cp - tmpCnt); - apr_cpystrn((*argv_out)[numargs], tmpCnt, cp - tmpCnt); - numargs++; - } SKIP_WHITESPACE(cp); } From 0a848a3a0e4a9694535f8552bace10ae2c1d71c8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Wed, 18 Oct 2000 06:09:09 +0000 Subject: [PATCH 0621/7878] Fix piped logs in 2.0. This basically: 1) cleans up an annoying type that was getting in my way while I was trying to fix things. 2) Makes some of the allocations pcalloc instead of palloc 3) The arg array passed to create_process is a const *char *, not const *char []. PR: 6642 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60599 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- threadproc/unix/proc.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index c35055078f3..d40cfb117e0 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -378,7 +378,7 @@ apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont); * @param cont The pool to use. */ apr_status_t apr_create_process(apr_proc_t *new_proc, const char *progname, - char *const args[], char **env, + char *const *args, char **env, apr_procattr_t *attr, apr_pool_t *cont); /** diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 5d21eeb02a7..b97abc80a57 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -271,12 +271,11 @@ static apr_status_t limit_proc(apr_procattr_t *attr) } apr_status_t apr_create_process(apr_proc_t *new, const char *progname, - char *const args[], char **env, + char *const *args, char **env, apr_procattr_t *attr, apr_pool_t *cont) { int i; - typedef const char *my_stupid_string; - my_stupid_string *newargs; + const char **newargs; new->in = attr->parent_in; new->err = attr->parent_err; @@ -323,7 +322,7 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, i++; } newargs = - (my_stupid_string *) apr_palloc(cont, sizeof (char *) * (i + 3)); + (const char **) apr_palloc(cont, sizeof (char *) * (i + 3)); newargs[0] = SHELL_PATH; newargs[1] = "-c"; i = 0; From c69200a509084486ecbc8bc9b84df24623b088ab Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 18 Oct 2000 16:59:57 +0000 Subject: [PATCH 0622/7878] APR pipes on Unix and Win32 are now cleaned up automatically when the associated pool goes away. (APR pipes on OS/2 were already had this logic.) This resolvs a fatal file descriptor leak with CGIs. (I'm also thinking at closing a pipe sooner in pipe_read() once we've reached the end of the pipe. Speak up if you think that is stupid. socket_read() has the same issue.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60600 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/pipe.c | 4 ++++ file_io/win32/pipe.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index aa23bcc3eae..20b251e4677 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -178,6 +178,10 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont (*in)->thlock = NULL; #endif + apr_register_cleanup((*in)->cntxt, (void *)(*in), apr_unix_file_cleanup, + apr_null_cleanup); + apr_register_cleanup((*out)->cntxt, (void *)(*out), apr_unix_file_cleanup, + apr_null_cleanup); return APR_SUCCESS; } diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index b1ddc62dd8e..884f5df1b82 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -105,6 +105,10 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p) return apr_get_os_error(); } + apr_register_cleanup((*in)->cntxt, (void *)(*in), file_cleanup, + apr_null_cleanup); + apr_register_cleanup((*out)->cntxt, (void *)(*out), file_cleanup, + apr_null_cleanup); return APR_SUCCESS; } From 33f0e25b03e9b91161285c8c88d810078a8040b5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 21 Oct 2000 11:07:02 +0000 Subject: [PATCH 0623/7878] The things you discovered with clean sources. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60601 13f79535-47bb-0310-9956-ffa450edef68 --- test/testucs.dsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testucs.dsp b/test/testucs.dsp index e5b8dcab169..be96410e9ce 100644 --- a/test/testucs.dsp +++ b/test/testucs.dsp @@ -67,7 +67,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /ZI /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "APR_DECLARE_SYMBOLS" /D "_CONSOLE" /D "_MBCS" /FD /ZI /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "APR_DECLARE_SYMBOLS" /D "_CONSOLE" /D "_MBCS" /FD /ZI /c # SUBTRACT CPP /YX /Yc /Yu # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" From 879a2b4da2cdeb7774f0562c3f880473b9fd6331 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sat, 21 Oct 2000 12:57:45 +0000 Subject: [PATCH 0624/7878] If iconv is chosen, then we need to tell others to load the iconv library. We should probably have the option to disable iconv (and xlate) on the top-level configure. Submitted by: Ryan Bloom Reviewed by: Roy Fielding git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60602 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 9e69dbd5c7a..2bdffeda379 100644 --- a/configure.in +++ b/configure.in @@ -226,7 +226,7 @@ APR_CHECK_INET_ADDR APR_CHECK_INET_NETWORK AC_CHECK_FUNC(_getch) AC_CHECK_FUNCS(gmtime_r localtime_r) -AC_CHECK_FUNCS(iconv, [ iconv="1" ], [ iconv="0" ]) +AC_CHECK_FUNCS(iconv, [ iconv="1" LIBS="$LIBS -liconv" ], [ iconv="0" ]) AC_CHECK_FUNCS(mmap, [ mmap="1" ], [ mmap="0" ]) if test "$native_mmap_emul" = "1"; then mmap="1" From 3b634f0432892c5a5480c632970515a97f464638 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 21 Oct 2000 13:16:04 +0000 Subject: [PATCH 0625/7878] If we have pthreads then we should assume we have pthread locks. Submitted by: Manoj Kasichainula Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60603 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index 2bdffeda379..4cacdab404c 100644 --- a/configure.in +++ b/configure.in @@ -495,12 +495,15 @@ else CHECK_PTHREADS_H([ threads="1" pthreadh="1" + pthreadser="0" AC_DEFINE(USE_THREADS) ], [ threads="0" - pthreadh="0" ] ) + pthreadh="0" + pthreadser="0" ] ) elif test "$enable_apr_threads" = "system_threads"; then threads="1" pthreadh="0" + pthreadser="0" else # We basically specified that we wanted threads, but not how to implement # them. In this case, just look for pthreads. In the future, we can check @@ -509,8 +512,10 @@ else CHECK_PTHREADS_H([ threads="1" pthreadh="1" + pthreadser="1" AC_DEFINE(USE_THREADS) ], [ threads="0" + pthreadser="0" pthreadh="0" ] ) fi fi @@ -599,13 +604,6 @@ AC_CHECK_DEFINE(isascii, ctype.h) # any POLL definitions. AC_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h) -pthreadser="0" -if test "$threads" = "1"; then - AC_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h) - AC_CHECK_FUNC(pthread_mutex_init, [ - AC_DEFINE(USE_PTHREAD_SERIALIZE) - pthreadser="1" ]) -fi AC_BEGIN_DECISION([ap_lock implementation method]) AC_IFALLYES(custom:union_semun, AC_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) From 633a33926fc2ccc6dbcbc2a92c987f0e3944d97a Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sat, 21 Oct 2000 15:07:42 +0000 Subject: [PATCH 0626/7878] Set APR_USE_PTHREAD_SERIALIZE to the proper value ("0", not "") when we haven't enabled strings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60604 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index 4cacdab404c..77ffbed275e 100644 --- a/configure.in +++ b/configure.in @@ -486,6 +486,7 @@ if test "$ac_cv_enable_threads" = "no"; then echo "Don't enable threads" threads="0" pthreadh="0" + pthreadser="0" else REENTRANCY_FLAGS if test "$ac_cv_enable_threads" = "pthread"; then From 9be35bc03b63877676c147c3a7d9b3fde622689b Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sat, 21 Oct 2000 15:43:48 +0000 Subject: [PATCH 0627/7878] We can't assume that iconv is in -liconv if we have it. Check for the library iconv in the normal way before we check for the function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60605 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 77ffbed275e..e33b53d9be7 100644 --- a/configure.in +++ b/configure.in @@ -210,6 +210,7 @@ AC_CHECK_LIB(socket,socket) AC_CHECK_LIB(crypt,crypt) AC_CHECK_LIB(ufc,crypt) AC_CHECK_LIB(truerand,main) +AC_CHECK_LIB(iconv,iconv) dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) @@ -226,7 +227,7 @@ APR_CHECK_INET_ADDR APR_CHECK_INET_NETWORK AC_CHECK_FUNC(_getch) AC_CHECK_FUNCS(gmtime_r localtime_r) -AC_CHECK_FUNCS(iconv, [ iconv="1" LIBS="$LIBS -liconv" ], [ iconv="0" ]) +AC_CHECK_FUNCS(iconv, [ iconv="1" ], [ iconv="0" ]) AC_CHECK_FUNCS(mmap, [ mmap="1" ], [ mmap="0" ]) if test "$native_mmap_emul" = "1"; then mmap="1" From 618604368f1ec325a61fe988b6762a1f3f98e2da Mon Sep 17 00:00:00 2001 From: Sascha Schumann <sascha@apache.org> Date: Sun, 22 Oct 2000 15:43:24 +0000 Subject: [PATCH 0628/7878] AC_INIT sets up the env for AC_CONFIG_AUX_DIR, so fix the order git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60606 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/mm/configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shmem/unix/mm/configure.in b/shmem/unix/mm/configure.in index eff9016f79b..d5be81ab9a6 100644 --- a/shmem/unix/mm/configure.in +++ b/shmem/unix/mm/configure.in @@ -10,8 +10,8 @@ AC_PREREQ(2.12)dnl AC_REVISION($1.0$)dnl dnl # autoconf initialization -AC_CONFIG_AUX_DIR(../../../helpers) AC_INIT(README) +AC_CONFIG_AUX_DIR(../../../helpers) AC_CONFIG_HEADER(mm_conf.h) AC_PREFIX_DEFAULT(/usr/local) From 7e3e3d2a11cb3d92a7616bc752e881e4142a2ee5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 23 Oct 2000 17:21:14 +0000 Subject: [PATCH 0629/7878] The start of the canonical name stuff. * removed cruft that did nothing (yet) * add prototypes for the apr_canon... fn's * Consider: apr_compare_canonical (need to count matching elements) * Consider: Manoj's suggestion to handle symlinks within here. * Consider: fanf's concept to use dev/inode for comparison w/o strs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60607 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 4 +- file_io/unix/fileio.h | 17 ++++++ file_io/win32/dir.c | 7 +-- file_io/win32/filedup.c | 12 ++-- file_io/win32/fileio.h | 42 ++++++++++--- file_io/win32/open.c | 35 ++--------- include/apr_file_io.h | 115 +++++++++++++++++++++++++++++++++++- include/arch/unix/fileio.h | 17 ++++++ include/arch/win32/fileio.h | 42 ++++++++++--- libapr.def | 4 +- misc/win32/names.c | 4 +- 11 files changed, 237 insertions(+), 62 deletions(-) diff --git a/aprlib.def b/aprlib.def index b9bc4e443c5..11abe3c5374 100644 --- a/aprlib.def +++ b/aprlib.def @@ -117,8 +117,8 @@ EXPORTS ; apr_get_os_thread @110 apr_get_os_threadkey @111 - apr_os_systemcase_filename @112 - canonical_filename @113 + + apr_create_pool @114 ; ; diff --git a/file_io/unix/fileio.h b/file_io/unix/fileio.h index 2f202d90e0d..24ca8e1d94a 100644 --- a/file_io/unix/fileio.h +++ b/file_io/unix/fileio.h @@ -58,6 +58,7 @@ #include "apr.h" #include "apr_private.h" #include "apr_general.h" +#include "apr_tables.h" #include "apr_file_io.h" #include "apr_errno.h" #include "apr_lib.h" @@ -112,6 +113,22 @@ #define APR_FILE_BUFSIZE 4096 +typedef struct apr_canon_elem_t { +/* A possible comparison mechanism to play with once we start + * implementing case insensitive mount poinbt semantices + * int dev; + * int inode; + * apr_time_t cached; --for timeout? + */ + int pathlen; + char *element; +} apr_canon_elem_t; + +struct apr_canon_t { + apr_pool_t *cntxt; + apr_array_header_t *elems; +}; + struct apr_file_t { apr_pool_t *cntxt; int filedes; diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 9f864c0824c..9f01b8daf18 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -83,12 +83,10 @@ apr_status_t dir_cleanup(void *thedir) apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) { - char * temp; (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); (*new)->cntxt = cont; (*new)->entry = NULL; - temp = canonical_filename((*new)->cntxt, dirname); - if (temp[strlen(temp)] == '/') { + if (dirname[strlen(dirname)] == '/') { (*new)->dirname = apr_pstrcat(cont, dirname, "*", NULL); } else { @@ -153,8 +151,7 @@ apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *co apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) { - char *temp = canonical_filename(cont, path); - if (!RemoveDirectory(temp)) { + if (!RemoveDirectory(path)) { return apr_get_os_error(); } return APR_SUCCESS; diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 535ca6f0456..ec632b772aa 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -105,12 +105,14 @@ apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t (*new_file)->cntxt = old_file->cntxt; (*new_file)->fname = apr_pstrdup(old_file->cntxt, old_file->fname); - (*new_file)->demonfname = apr_pstrdup(old_file->cntxt, old_file->demonfname); - (*new_file)->lowerdemonfname = apr_pstrdup(old_file->cntxt, old_file->lowerdemonfname); +/* (*new_file)->demonfname = apr_pstrdup(old_file->cntxt, old_file->demonfname); + * (*new_file)->lowerdemonfname = apr_pstrdup(old_file->cntxt, old_file->lowerdemonfname); + */ (*new_file)->append = old_file->append; -/* (*new_file)->protection = old_file->protection; - (*new_file)->user = old_file->user; - (*new_file)->group = old_file->group;*/ +/* (*new_file)->protection = old_file->protection; + * (*new_file)->user = old_file->user; + * (*new_file)->group = old_file->group; + */ (*new_file)->size = old_file->size; (*new_file)->atime = old_file->atime; (*new_file)->mtime = old_file->mtime; diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 83bad40de45..705e177e4ad 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -59,6 +59,7 @@ #include "apr_private.h" #include "apr_pools.h" #include "apr_general.h" +#include "apr_tables.h" #include "apr_lock.h" #include "apr_file_io.h" #include "apr_errno.h" @@ -88,6 +89,34 @@ #define APR_FILE_BUFSIZE 4096 +typedef enum apr_canon_case_e { + APR_CANON_CASE_GIVEN, + APR_CANON_CASE_LOWER, + APR_CANON_CASE_TRUE +} apr_canon_case_e; + +/* + * Internal canonical filename elements for the apr_canon_t elems + * ccase tracks the mechanism used to resolve this element + * pathlen is the full path length to the end of this element + * name slash is prefix, as appropriate + + */ +typedef struct apr_canon_elem_t { + apr_canon_case_e ccase; + int pathlen; + char *name; +} apr_canon_elem_t; + +/* warning: win32 canonical path "/" resolves to a + * zero'th element of the empty string for testing the + * psudo-root for the system + */ +struct apr_canon_t { + apr_pool_t *cntxt; + apr_array_header_t *elems; +}; + /* quick run-down of fields in windows' apr_file_t structure that may have * obvious uses. * fname -- the filename as passed to the open call. @@ -110,8 +139,8 @@ struct apr_file_t { /* File specific info */ char *fname; - char *demonfname; - char *lowerdemonfname; + apr_canon_t *canonname; + DWORD dwFileAttributes; int eof_hit; BOOLEAN buffered; // Use buffered I/O? @@ -142,12 +171,11 @@ struct apr_dir_t { }; apr_status_t file_cleanup(void *); -/*mode_t get_fileperms(apr_fileperms_t); -*/ -APR_DECLARE(char *) apr_os_systemcase_filename(struct apr_pool_t *pCont, - const char *szFile); -char * canonical_filename(struct apr_pool_t *pCont, const char *szFile); +/** + * Internal function to create a Win32/NT pipe that respects some async + * timeout options. + */ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, apr_pool_t *p); diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 21c577d2c9c..9bf90e7a1d6 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -111,9 +111,6 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, (*new)->fname = apr_pstrdup(cont, fname); - (*new)->demonfname = canonical_filename((*new)->cntxt, fname); - (*new)->lowerdemonfname = strlwr((*new)->demonfname); - if (apr_get_oslevel(cont, &level) == APR_SUCCESS && level >= APR_WIN_NT) { sharemode |= FILE_SHARE_DELETE; } @@ -196,40 +193,18 @@ apr_status_t apr_close(apr_file_t *file) apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) { - char *temp = canonical_filename(cont, path); - - if (DeleteFile(temp)) { + if (DeleteFile(path)) return APR_SUCCESS; - } - else { - return apr_get_os_error(); - } + return apr_get_os_error(); } apr_status_t apr_rename_file(const char *from_path, const char *to_path, apr_pool_t *p) { - const char *from_canon = canonical_filename(p, from_path); - const char *to_canon = canonical_filename(p, to_path); - DWORD err; - - /* TODO: would be nice to use MoveFileEx() here, but it isn't available - * on Win95/98. MoveFileEx could theoretically help prevent the - * case where we delete the target but don't move the file(!). - * it can also copy across devices... - */ - - if (MoveFile(from_canon, to_canon)) { + if (MoveFileEx(from_path, to_path, MOVEFILE_REPLACE_EXISTING | + MOVEFILE_COPY_ALLOWED)) return APR_SUCCESS; - } - err = apr_get_os_error(); - if (APR_STATUS_IS_EEXIST(err)) { - (void) DeleteFile(to_canon); - if (MoveFile(from_canon, to_canon)) - return APR_SUCCESS; - err = apr_get_os_error(); - } - return err; + return apr_get_os_error(); } apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 2d8cf0eb28a..4dcc30e54ad 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -119,6 +119,7 @@ typedef apr_int32_t apr_seek_where_t; typedef struct apr_file_t apr_file_t; typedef struct apr_finfo_t apr_finfo_t; typedef struct apr_dir_t apr_dir_t; +typedef struct apr_canon_t apr_canon_t; typedef apr_int32_t apr_fileperms_t; typedef uid_t apr_uid_t; typedef gid_t apr_gid_t; @@ -156,7 +157,117 @@ struct apr_finfo_t { apr_time_t ctime; }; -/* Function definitions */ +/* Make and Merge Canonical Name Options */ + +/** + * Require the trusted_name+child_name result is an absolute product + * or fail with error for the make and merge canonical name functions. + */ +#define APR_CANON_ONLY_ABSOLUTE 0 +/** + * Allow that the trusted_name+child_name result may be a relative result + * for the make and merge canonical name functions. + */ +#define APR_CANON_ALLOW_RELATIVE 2 + +/** + * Require the trusted_name+child_name result is not an absolute path + * or fail with error for the make and merge canonical name functions. + */ +#define APR_CANON_ONLY_RELATIVE 3 + +/** + * Require the trusted_name+child_name result is a child of trusted_name + * or fail with error for the make and merge canonical name functions. + */ +#define APR_CANON_CHILD_OF_TRUSTED 4 + +/** + * If file path elements exist (can stat) then fold the element's name + * to lowercase for the make and merge canonical name functions. + */ +#define APR_CANON_LOWERCASE + +/** + * If file path elements exist (can readdir) then fold the element's name + * to the true case lowercase for the make and merge canonical name functions. + */ +#define APR_CANON_TRUECASE + +/** + * Canonicalize the path and name. + * + * @param new_name The newly allocated canonicalized trusted+child name + * @param trusted_name Already canonical parent path; may be NULL. + * @param child_name An absolute path or path relative to trusted_name. + * @param options See the APR_CANON_ bit flags documentation for options + * @param pool The context in which to allocate the new_name apr_canon_t + * + * @tip A canonical name is a name stipped of embedded backrefs "../", + * thisrefs "./", successive slashes (//), or any other ambigious file + * name element. Absolute canonical names referencing the same file must + * strcmp() identically, excluding symlinks or inconsistent use of the + * APR_CANON_LOWERCASE or APR_CANON_TRUECASE options. + * + * If the name does not exist, or resolves to a relative name the given case + * is preserved. Insignificant elements are eliminated. For example, on Win32 this + * function removes trailing dots (which are allowed, but not stored in + * the file system), and "/../" under Unix is resolved to "/". The relative + * canonical name may contain leading backrefs "../", but will never contain + * any other prohibited element. + */ + +/* + * @param trusted_name May be null + * @param child_name May be absolute, in which case trusted_name is ignored + * unless APR_CHILD_RELATIVE is tested. + */ + +apr_status_t apr_make_canonical_name(apr_canon_t **new_name, + const apr_canon_t *trusted_name, + const char *child_name, + int options, + apr_pool_t *pool); + +apr_status_t apr_merge_canonical_name(apr_canon_t **new_name, + const apr_canon_t *trusted_name, + const apr_canon_t *child_name, + int options, + apr_pool_t *pool); + +apr_status_t apr_get_canonical_name(char **path, + const apr_canon_t *trusted_name, + apr_pool_t *pool); + +int apr_count_canonical_elements(const apr_canon_t *trusted_name); + +int apr_get_canonical_elements_length(const apr_canon_t *trusted_name, + int firstelement, int lastelement); + +apr_status_t apr_get_canonical_elements(char **path_elements, + const apr_canon_t *trusted_name, + int firstelement, int lastelement, + apr_pool_t *pool); + +/** + * Returns APR_SUCCESS if canon_name is absolute. Do not trust + * !apr_is_absolute to determine if the path is relative. Also, + * test apr_is_virtualroot to avoid non-filesystem pseudo roots. + */ +apr_status_t apr_is_absolute(apr_canon_t **path); + +/** + * Returns APR_SUCCESS if canon_name is absolute. Do not trust + * !apr_is_relative to determine if the path is absolute. + */ +apr_status_t apr_is_relative(apr_canon_t **path); + +/** + * Returns APR_SUCCESS if the elements 0..elements resolves to a + * platform's non-physical root, e.g. the //machine/ name that + * isn't an adaquately complete root for UNC paths. + */ +apr_status_t apr_is_virtualroot(apr_canon_t **path, int elements); /** * Open the specified file. @@ -207,7 +318,7 @@ apr_status_t apr_remove_file(const char *path, apr_pool_t *cont); * Moving files or directories across devices may not be possible. */ apr_status_t apr_rename_file(const char *from_path, const char *to_path, - apr_pool_t *pool); + apr_pool_t *pool); /** * Are we at the end of the file diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 2f202d90e0d..24ca8e1d94a 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -58,6 +58,7 @@ #include "apr.h" #include "apr_private.h" #include "apr_general.h" +#include "apr_tables.h" #include "apr_file_io.h" #include "apr_errno.h" #include "apr_lib.h" @@ -112,6 +113,22 @@ #define APR_FILE_BUFSIZE 4096 +typedef struct apr_canon_elem_t { +/* A possible comparison mechanism to play with once we start + * implementing case insensitive mount poinbt semantices + * int dev; + * int inode; + * apr_time_t cached; --for timeout? + */ + int pathlen; + char *element; +} apr_canon_elem_t; + +struct apr_canon_t { + apr_pool_t *cntxt; + apr_array_header_t *elems; +}; + struct apr_file_t { apr_pool_t *cntxt; int filedes; diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 83bad40de45..705e177e4ad 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -59,6 +59,7 @@ #include "apr_private.h" #include "apr_pools.h" #include "apr_general.h" +#include "apr_tables.h" #include "apr_lock.h" #include "apr_file_io.h" #include "apr_errno.h" @@ -88,6 +89,34 @@ #define APR_FILE_BUFSIZE 4096 +typedef enum apr_canon_case_e { + APR_CANON_CASE_GIVEN, + APR_CANON_CASE_LOWER, + APR_CANON_CASE_TRUE +} apr_canon_case_e; + +/* + * Internal canonical filename elements for the apr_canon_t elems + * ccase tracks the mechanism used to resolve this element + * pathlen is the full path length to the end of this element + * name slash is prefix, as appropriate + + */ +typedef struct apr_canon_elem_t { + apr_canon_case_e ccase; + int pathlen; + char *name; +} apr_canon_elem_t; + +/* warning: win32 canonical path "/" resolves to a + * zero'th element of the empty string for testing the + * psudo-root for the system + */ +struct apr_canon_t { + apr_pool_t *cntxt; + apr_array_header_t *elems; +}; + /* quick run-down of fields in windows' apr_file_t structure that may have * obvious uses. * fname -- the filename as passed to the open call. @@ -110,8 +139,8 @@ struct apr_file_t { /* File specific info */ char *fname; - char *demonfname; - char *lowerdemonfname; + apr_canon_t *canonname; + DWORD dwFileAttributes; int eof_hit; BOOLEAN buffered; // Use buffered I/O? @@ -142,12 +171,11 @@ struct apr_dir_t { }; apr_status_t file_cleanup(void *); -/*mode_t get_fileperms(apr_fileperms_t); -*/ -APR_DECLARE(char *) apr_os_systemcase_filename(struct apr_pool_t *pCont, - const char *szFile); -char * canonical_filename(struct apr_pool_t *pCont, const char *szFile); +/** + * Internal function to create a Win32/NT pipe that respects some async + * timeout options. + */ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, apr_pool_t *p); diff --git a/libapr.def b/libapr.def index b9bc4e443c5..11abe3c5374 100644 --- a/libapr.def +++ b/libapr.def @@ -117,8 +117,8 @@ EXPORTS ; apr_get_os_thread @110 apr_get_os_threadkey @111 - apr_os_systemcase_filename @112 - canonical_filename @113 + + apr_create_pool @114 ; ; diff --git a/misc/win32/names.c b/misc/win32/names.c index 9e3fc71346b..7f1fbec637e 100644 --- a/misc/win32/names.c +++ b/misc/win32/names.c @@ -82,8 +82,8 @@ static BOOL OnlyDots(char *pString) * is present on the existing path. This routine also * converts alias names to long names. */ -APR_DECLARE(char *) apr_os_systemcase_filename(apr_pool_t *pCont, - const char *szFile) +static char * apr_os_systemcase_filename(apr_pool_t *pCont, + const char *szFile) { char buf[HUGE_STRING_LEN]; char *pInputName; From d923715d75ed40bc40904b6039a5d97bb446bc5e Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Mon, 23 Oct 2000 21:26:56 +0000 Subject: [PATCH 0630/7878] BONE allows fork() so we might as well make use of it! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60608 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/procsup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index c2f0fc6ec8b..e29954cda7e 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -60,7 +60,7 @@ apr_status_t apr_detach(void) pid_t pgrp; chdir("/"); -#if !defined(MPE) && !defined(OS2) && !defined(TPF) && !defined(BEOS) +#if !defined(MPE) && !defined(OS2) && !defined(TPF) && !defined(BEOS_R5) /* Don't detach for MPE because child processes can't survive the death of the parent. */ if ((x = fork()) > 0) From 3a768ab027a0805c11d523310c3ef5653337fc28 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 24 Oct 2000 10:25:23 +0000 Subject: [PATCH 0631/7878] Fix pthread serialize. We need to set the variable properly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60609 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index e33b53d9be7..1cb10e5d7bc 100644 --- a/configure.in +++ b/configure.in @@ -497,7 +497,7 @@ else CHECK_PTHREADS_H([ threads="1" pthreadh="1" - pthreadser="0" + pthreadser="1" AC_DEFINE(USE_THREADS) ], [ threads="0" pthreadh="0" @@ -606,6 +606,10 @@ AC_CHECK_DEFINE(isascii, ctype.h) # any POLL definitions. AC_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h) +if test "$threads" = "1"; then + AC_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h) +fi + AC_BEGIN_DECISION([ap_lock implementation method]) AC_IFALLYES(custom:union_semun, AC_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) From a729840228d35ed4f58b80764366748cc7cb9f37 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 25 Oct 2000 02:46:43 +0000 Subject: [PATCH 0632/7878] Ok here it is: Win32 utf-8 native unicode filename support. There are just too many folks to credit... so this goes out from the entire ApacheCon hacking team :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60610 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 13 ++--- aprlib.dsp | 13 ++--- file_io/unix/fileacc.c | 16 +++++++ file_io/win32/dir.c | 95 +++++++++++++++++++++++++------------ file_io/win32/filedup.c | 15 +++++- file_io/win32/fileio.h | 13 ++++- file_io/win32/filestat.c | 56 ++++++++++++++++++---- file_io/win32/open.c | 66 +++++++++++++++++++++++--- include/apr.h.in | 1 + include/apr.hw | 4 +- include/arch/win32/fileio.h | 13 ++++- 11 files changed, 235 insertions(+), 70 deletions(-) diff --git a/apr.dsp b/apr.dsp index dd74e7a04bd..d8e11578452 100644 --- a/apr.dsp +++ b/apr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "NDEBUG" /D "APR_UNICODE" /D "APR_IMPLEMENT_UNICODE" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -68,8 +68,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c +# ADD CPP /nologo /MDd /W3 /GX /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "_DEBUG" /D "APR_UNICODE" /D "APR_IMPLEMENT_UNICODE" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -341,13 +341,6 @@ SOURCE=.\i18n\unix\i18n.h # Begin Source File SOURCE=.\i18n\unix\utf8_ucs2.c - -!IF "$(CFG)" == "aprlib - Win32 Release" - -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File diff --git a/aprlib.dsp b/aprlib.dsp index dd74e7a04bd..d8e11578452 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "NDEBUG" /D "APR_UNICODE" /D "APR_IMPLEMENT_UNICODE" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -68,8 +68,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c +# ADD CPP /nologo /MDd /W3 /GX /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "_DEBUG" /D "APR_UNICODE" /D "APR_IMPLEMENT_UNICODE" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -341,13 +341,6 @@ SOURCE=.\i18n\unix\i18n.h # Begin Source File SOURCE=.\i18n\unix\utf8_ucs2.c - -!IF "$(CFG)" == "aprlib - Win32 Release" - -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index f9ba9cd2131..1ad701e679a 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -68,11 +68,27 @@ #else #include "fileio.h" #endif +#if APR_HAS_UNICODE_FS +#include "i18n.h" +#endif + /* A file to put ALL of the accessor functions for apr_file_t types. */ apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) { +#if APR_HAS_UNICODE_FS + apr_status_t rv; + int len = wcslen(thefile->fname) + 1; + int dremains = MAX_PATH; + *fname = apr_palloc(thefile->cntxt, len * 2); + if ((rv = conv_ucs2_to_utf8(thefile->fname, &len, + *fname, &dremains))) + return rv; + if (len) + return APR_ENAMETOOLONG; +#else *fname = apr_pstrdup(thefile->cntxt, thefile->fname); +#endif return APR_SUCCESS; } diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 9f01b8daf18..a3f43858195 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -57,6 +57,9 @@ #include "apr_file_io.h" #include "apr_strings.h" #include "apr_portable.h" +#if APR_HAS_UNICODE_FS +#include "i18n.h" +#endif #include "atime.h" #if APR_HAVE_ERRNO_H @@ -75,70 +78,90 @@ apr_status_t dir_cleanup(void *thedir) { apr_dir_t *dir = thedir; - if (!CloseHandle(dir->dirhand)) { + if (dir->dirhand != INVALID_HANDLE_VALUE && !FindClose(dir->dirhand)) { return apr_get_os_error(); } + dir->dirhand = INVALID_HANDLE_VALUE; return APR_SUCCESS; } apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) { + int len = strlen(dirname); +#if APR_HAS_UNICODE_FS + apr_status_t rv; + int lremains = len; + int dremains = (len + 3) * 2; (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); - (*new)->cntxt = cont; - (*new)->entry = NULL; - if (dirname[strlen(dirname)] == '/') { - (*new)->dirname = apr_pstrcat(cont, dirname, "*", NULL); - } - else { - (*new)->dirname = apr_pstrcat(cont, dirname, "/*", NULL); + (*new)->entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); + (*new)->dirname = apr_palloc(cont, dremains); + if ((rv = conv_utf8_to_ucs2(dirname, &lremains, + (*new)->dirname, &dremains))) + return rv; + if (lremains) + return APR_ENAMETOOLONG; + len = (len + 3) * 2 - dremains; +#else + (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); + (*new)->entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATA)); + (*new)->dirname = apr_palloc(cont, len + 3); + memcpy((*new)->dirname, dirname, len); +#endif + if (len && dirname[len - 1] != '/') { + (*new)->dirname[len++] = '/'; } + (*new)->dirname[len++] = '*'; + (*new)->dirname[len] = '\0'; + (*new)->cntxt = cont; (*new)->dirhand = INVALID_HANDLE_VALUE; apr_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, apr_null_cleanup); return APR_SUCCESS; } -apr_status_t apr_closedir(apr_dir_t *thedir) +apr_status_t apr_closedir(apr_dir_t *dir) { - if (!FindClose(thedir->dirhand)) { - return apr_get_os_error(); + if (dir->dirhand != INVALID_HANDLE_VALUE && !FindClose(dir->dirhand)) { + return apr_get_os_error(); } - apr_kill_cleanup(thedir->cntxt, thedir, dir_cleanup); + dir->dirhand = INVALID_HANDLE_VALUE; return APR_SUCCESS; } apr_status_t apr_readdir(apr_dir_t *thedir) { +#if APR_HAS_UNICODE_FS + if (thedir->dirhand == INVALID_HANDLE_VALUE) { + thedir->dirhand = FindFirstFileW(thedir->dirname, thedir->entry); + if (thedir->dirhand == INVALID_HANDLE_VALUE) { + return apr_get_os_error(); + } + } + else if (!FindNextFileW(thedir->dirhand, thedir->entry)) { + return apr_get_os_error(); + } +#else if (thedir->dirhand == INVALID_HANDLE_VALUE) { - thedir->entry = apr_pcalloc(thedir->cntxt, sizeof(WIN32_FIND_DATA)); thedir->dirhand = FindFirstFile(thedir->dirname, thedir->entry); if (thedir->dirhand == INVALID_HANDLE_VALUE) { return apr_get_os_error(); } - return APR_SUCCESS; } - if (!FindNextFile(thedir->dirhand, thedir->entry)) { + else if (!FindNextFile(thedir->dirhand, thedir->entry)) { return apr_get_os_error(); } +#endif return APR_SUCCESS; } -apr_status_t apr_rewinddir(apr_dir_t *thedir) +apr_status_t apr_rewinddir(apr_dir_t *dir) { - apr_status_t stat; - apr_pool_t *cont = thedir->cntxt; - char *temp = apr_pstrdup(cont, thedir->dirname); - temp[strlen(temp) - 2] = '\0'; /*remove the \* at the end */ - if (thedir->dirhand == INVALID_HANDLE_VALUE) { - return APR_SUCCESS; - } - if ((stat = apr_closedir(thedir)) == APR_SUCCESS) { - if ((stat = apr_opendir(&thedir, temp, cont)) == APR_SUCCESS) { - apr_readdir(thedir); - return APR_SUCCESS; - } - } - return stat; + dir_cleanup(dir); + if (!FindClose(dir->dirhand)) { + return apr_get_os_error(); + } + dir->dirhand = INVALID_HANDLE_VALUE; + return APR_SUCCESS; } apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) @@ -196,7 +219,19 @@ apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) { +#if APR_HAS_UNICODE_FS + apr_status_t rv; + int len = wcslen(thedir->entry->cFileName) + 1; + int dremains = MAX_PATH; + (*new) = apr_palloc(thedir->cntxt, len * 2); + if ((rv = conv_ucs2_to_utf8(thedir->entry->cFileName, &len, + *new, &dremains))) + return rv; + if (len) + return APR_ENAMETOOLONG; +#else (*new) = apr_pstrdup(thedir->cntxt, thedir->entry->cFileName); +#endif return APR_SUCCESS; } diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index ec632b772aa..6e14473adc5 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -57,19 +57,25 @@ #include "apr_general.h" #include "apr_strings.h" #include <string.h> +#if APR_HAS_UNICODE_FS +#include "i18n.h" +#include <wchar.h> +#endif apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { BOOLEAN isStdHandle = FALSE; HANDLE hCurrentProcess = GetCurrentProcess(); +#if APR_HAS_UNICODE_FS + int len = wcslen(old_file->fname) + 1; +#endif if ((*new_file) == NULL) { if (p == NULL) { p = old_file->cntxt; } - (*new_file) = (apr_file_t *) apr_pcalloc(p, - sizeof(apr_file_t)); + (*new_file) = (apr_file_t *) apr_pcalloc(p, sizeof(apr_file_t)); if ((*new_file) == NULL) { return APR_ENOMEM; } @@ -104,7 +110,12 @@ apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t } (*new_file)->cntxt = old_file->cntxt; +#if APR_HAS_UNICODE_FS + (*new_file)->fname = apr_palloc(old_file->cntxt, len * 2); + wcscpy((*new_file)->fname, old_file->fname); +#else (*new_file)->fname = apr_pstrdup(old_file->cntxt, old_file->fname); +#endif /* (*new_file)->demonfname = apr_pstrdup(old_file->cntxt, old_file->demonfname); * (*new_file)->lowerdemonfname = apr_pstrdup(old_file->cntxt, old_file->lowerdemonfname); */ diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 705e177e4ad..d9d510e3379 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -89,6 +89,8 @@ #define APR_FILE_BUFSIZE 4096 +typedef apr_int16_t apr_wchar_t; + typedef enum apr_canon_case_e { APR_CANON_CASE_GIVEN, APR_CANON_CASE_LOWER, @@ -138,7 +140,11 @@ struct apr_file_t { apr_interval_time_t timeout; /* File specific info */ +#if APR_HAS_UNICODE_FS + apr_wchar_t *fname; +#else char *fname; +#endif apr_canon_t *canonname; DWORD dwFileAttributes; @@ -165,9 +171,14 @@ struct apr_file_t { struct apr_dir_t { apr_pool_t *cntxt; - char *dirname; HANDLE dirhand; +#if APR_HAS_UNICODE_FS + apr_wchar_t *dirname; + WIN32_FIND_DATAW *entry; +#else + char *dirname; WIN32_FIND_DATA *entry; +#endif }; apr_status_t file_cleanup(void *); diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index a8e7048365e..b245f9f747c 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -58,6 +58,9 @@ #include "apr_general.h" #include "apr_errno.h" #include "apr_time.h" +#if APR_HAS_UNICODE_FS +#include "i18n.h" +#endif #include <sys/stat.h> #include "atime.h" #include "misc.h" @@ -196,20 +199,53 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) { /* WIN32_FILE_ATTRIBUTE_DATA is an exact subset of the first * entries of WIN32_FIND_DATA + * We need to catch the case where fname length == MAX_PATH since for + * some strange reason GetFileAttributesEx fails with PATH_NOT_FOUND. + * We would rather indicate length error than 'not found' + * since in many cases the apr user is testing for 'not found' + * and this is not such a case. */ +#if APR_HAS_UNICODE_FS + WIN32_FIND_DATAW FileInformation; + apr_wchar_t wname[MAX_PATH]; + int len = MAX_PATH; + int lremains = strlen(fname) + 1; + apr_oslevel_e os_level; + apr_status_t rv; + HANDLE hFind; + if ((rv = conv_utf8_to_ucs2(fname, &lremains, wname, &len))) + return rv; + if (lremains) + return APR_ENAMETOOLONG; + if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_98) { + if (!GetFileAttributesExW(wname, GetFileExInfoStandard, + (WIN32_FILE_ATTRIBUTE_DATA*) &FileInformation)) { + return apr_get_os_error(); + } + } + else { + /* What a waste of cpu cycles... but what else can we do? + */ + if (strchr(fname, '*') || strchr(fname, '?')) + return APR_ENOENT; + hFind = FindFirstFileW(wname, &FileInformation); + if (hFind == INVALID_HANDLE_VALUE) { + return apr_get_os_error(); + } else { + FindClose(hFind); + } + } +#else + int len = strlen(fname); WIN32_FIND_DATA FileInformation; HANDLE hFind; apr_oslevel_e os_level; - - memset(finfo,'\0', sizeof(*finfo)); + (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); + (*new)->entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATA)); + (*new)->dirname = apr_palloc(cont, len + 3); + memcpy((*new)->dirname, dirname, len); - /* We need to catch the case where fname length == MAX_PATH since for - * some strange reason GetFileAttributesEx fails with PATH_NOT_FOUND. - * We would rather indicate length error than 'not found' - * since in many cases the apr user is testing for 'not found' - * and this is not such a case. - */ - if (strlen(fname) >= MAX_PATH) { + if (len >= MAX_PATH) { return APR_ENAMETOOLONG; } else if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_98) { @@ -230,7 +266,9 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) FindClose(hFind); } } +#endif + memset(finfo,'\0', sizeof(*finfo)); /* Filetype - Directory or file? * Short of opening the handle to the file, the 'FileType' appears * to be unknowable (in any trustworthy or consistent sense), that diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 9bf90e7a1d6..043f494cdee 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -63,6 +63,9 @@ #include <string.h> #include <sys/stat.h> #include "misc.h" +#if APR_HAS_UNICODE_FS +#include "i18n.h" +#endif apr_status_t file_cleanup(void *thefile) { @@ -76,7 +79,7 @@ apr_status_t file_cleanup(void *thefile) } apr_status_t apr_open(apr_file_t **new, const char *fname, - apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) + apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) { DWORD oflags = 0; DWORD createflags = 0; @@ -84,6 +87,10 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE; apr_oslevel_e level; apr_status_t rv; +#if APR_HAS_UNICODE_FS + int lremains = strlen(fname) + 1; + int dremains = (lremains) * 2; +#endif (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); (*new)->cntxt = cont; @@ -108,8 +115,16 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, if (rv) return rv; } - +#if APR_HAS_UNICODE_FS + (*new)->fname = apr_palloc(cont, dremains); + if ((rv = conv_utf8_to_ucs2(fname, &lremains, + (*new)->fname, &dremains))) + return rv; + if (lremains) + return APR_ENAMETOOLONG; +#else (*new)->fname = apr_pstrdup(cont, fname); +#endif if (apr_get_oslevel(cont, &level) == APR_SUCCESS && level >= APR_WIN_NT) { sharemode |= FILE_SHARE_DELETE; @@ -151,9 +166,13 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, attributes |= FILE_FLAG_DELETE_ON_CLOSE; } - (*new)->filehand = CreateFile(fname, oflags, sharemode, - NULL, createflags, attributes, 0); - +#if APR_HAS_UNICODE_FS + (*new)->filehand = CreateFileW((*new)->fname, oflags, sharemode, + NULL, createflags, attributes, 0); +#else + (*new)->filehand = CreateFile((*new)->fname, oflags, sharemode, + NULL, createflags, attributes, 0); +#endif if ((*new)->filehand == INVALID_HANDLE_VALUE) { return apr_get_os_error(); } @@ -193,7 +212,20 @@ apr_status_t apr_close(apr_file_t *file) apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) { +#if APR_HAS_UNICODE_FS + apr_wchar_t wpath[MAX_PATH]; + int lremains = strlen(path) + 1; + int dremains = MAX_PATH; + apr_status_t rv; + if ((rv = conv_utf8_to_ucs2(path, &lremains, + wpath, &dremains))) + return rv; + if (lremains) + return APR_ENAMETOOLONG; + if (DeleteFileW(wpath)) +#else if (DeleteFile(path)) +#endif return APR_SUCCESS; return apr_get_os_error(); } @@ -201,8 +233,30 @@ apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) apr_status_t apr_rename_file(const char *from_path, const char *to_path, apr_pool_t *p) { +#if APR_HAS_UNICODE_FS + apr_wchar_t wfrompath[MAX_PATH]; + apr_wchar_t wtopath[MAX_PATH]; + int lremains = strlen(from_path) + 1; + int dremains = MAX_PATH; + apr_status_t rv; + if ((rv = conv_utf8_to_ucs2(from_path, &lremains, + wfrompath, &dremains))) + return rv; + if (lremains) + return APR_ENAMETOOLONG; + lremains = strlen(to_path) + 1; + dremains = MAX_PATH; + if ((rv = conv_utf8_to_ucs2(to_path, &lremains, + wtopath, &dremains))) + return rv; + if (lremains) + return APR_ENAMETOOLONG; + if (MoveFileExW(wfrompath, wtopath, MOVEFILE_REPLACE_EXISTING | + MOVEFILE_COPY_ALLOWED)) +#else if (MoveFileEx(from_path, to_path, MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED)) +#endif return APR_SUCCESS; return apr_get_os_error(); } @@ -249,7 +303,7 @@ apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) if ((*thefile)->filehand == INVALID_HANDLE_VALUE) return apr_get_os_error(); (*thefile)->cntxt = cont; - (*thefile)->fname = "STD_ERROR_HANDLE"; + (*thefile)->fname = "\0\0"; // What was this: "STD_ERROR_HANDLE"; (*thefile)->eof_hit = 0; return APR_SUCCESS; diff --git a/include/apr.h.in b/include/apr.h.in index b843bd22554..57ff271c0ba 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -93,6 +93,7 @@ #define APR_HAS_XLATE @iconv@ #define APR_HAS_OTHER_CHILD @oc@ #define APR_HAS_DSO @aprdso@ +#define APR_HAS_UNICODE_FS 0 /* This macro tells APR that it is safe to make a file masquerade as a * socket. This is necessary, because some platforms support poll'ing diff --git a/include/apr.hw b/include/apr.hw index f4519996316..f107f5c8847 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -147,13 +147,15 @@ /* APR Feature Macros */ #define APR_HAS_THREADS 1 -#define APR_HAS_SENDFILE 1 +#define APR_HAS_SENDFILE 1 #define APR_HAS_RANDOM 1 #define APR_HAS_DSO 1 #define APR_HAS_MMAP 0 #define APR_HAS_XLATE 0 +#define APR_HAS_UNICODE_FS 1 + /* Typedefs that APR needs. */ typedef short apr_int16_t; diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 705e177e4ad..d9d510e3379 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -89,6 +89,8 @@ #define APR_FILE_BUFSIZE 4096 +typedef apr_int16_t apr_wchar_t; + typedef enum apr_canon_case_e { APR_CANON_CASE_GIVEN, APR_CANON_CASE_LOWER, @@ -138,7 +140,11 @@ struct apr_file_t { apr_interval_time_t timeout; /* File specific info */ +#if APR_HAS_UNICODE_FS + apr_wchar_t *fname; +#else char *fname; +#endif apr_canon_t *canonname; DWORD dwFileAttributes; @@ -165,9 +171,14 @@ struct apr_file_t { struct apr_dir_t { apr_pool_t *cntxt; - char *dirname; HANDLE dirhand; +#if APR_HAS_UNICODE_FS + apr_wchar_t *dirname; + WIN32_FIND_DATAW *entry; +#else + char *dirname; WIN32_FIND_DATA *entry; +#endif }; apr_status_t file_cleanup(void *); From 8e1f3881b039c4c2c76062ee198b7a9ee278e3ee Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 25 Oct 2000 09:03:48 +0000 Subject: [PATCH 0633/7878] Errr... was a goof. The HAS_UNICODE_FS shouldn't be toggled yet across the board - will clobber 9x. Need to add run time checks. [actually, can treat file names as utf-8 on 9x, but must not call wide char functions!] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60611 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++-- aprlib.dsp | 4 ++-- include/apr.hw | 8 +++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/apr.dsp b/apr.dsp index d8e11578452..d51807f1e63 100644 --- a/apr.dsp +++ b/apr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "NDEBUG" /D "APR_UNICODE" /D "APR_IMPLEMENT_UNICODE" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -69,7 +69,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c -# ADD CPP /nologo /MDd /W3 /GX /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "_DEBUG" /D "APR_UNICODE" /D "APR_IMPLEMENT_UNICODE" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c +# ADD CPP /nologo /MDd /W3 /GX /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo diff --git a/aprlib.dsp b/aprlib.dsp index d8e11578452..d51807f1e63 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "NDEBUG" /D "APR_UNICODE" /D "APR_IMPLEMENT_UNICODE" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -69,7 +69,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c -# ADD CPP /nologo /MDd /W3 /GX /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "_DEBUG" /D "APR_UNICODE" /D "APR_IMPLEMENT_UNICODE" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c +# ADD CPP /nologo /MDd /W3 /GX /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo diff --git a/include/apr.hw b/include/apr.hw index f107f5c8847..15493af0d7c 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -154,7 +154,13 @@ #define APR_HAS_MMAP 0 #define APR_HAS_XLATE 0 -#define APR_HAS_UNICODE_FS 1 +/* + * XXX: Problem - while this may be an NT build - if we share binaries, + * this is actually a run time decision + * Until tested and validated - back to 'future' status (feel free to toggle + * to 1 and experiment. + */ +#define APR_HAS_UNICODE_FS 0 /* Typedefs that APR needs. */ From 57c606912b28e143eefd5c70f52e942f2ac4f6f9 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 25 Oct 2000 12:56:00 +0000 Subject: [PATCH 0634/7878] export threading flags so that apps using APR know how to compile their own files. (and link properly against APR) Submitted by: Branko Cibej <brane@xbc.nu> Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60612 13f79535-47bb-0310-9956-ffa450edef68 --- APRVARS.in | 2 ++ apr_common.m4 | 2 ++ configure.in | 2 ++ 3 files changed, 6 insertions(+) diff --git a/APRVARS.in b/APRVARS.in index 8f4f53ca5b5..223328b8876 100644 --- a/APRVARS.in +++ b/APRVARS.in @@ -1 +1,3 @@ +EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS @THREAD_CPPFLAGS@" +EXTRA_CFLAGS="$EXTRA_CFLAGS @THREAD_CFLAGS@" EXTRA_LIBS="$EXTRA_LIBS @LIBS@" diff --git a/apr_common.m4 b/apr_common.m4 index 68b06354a20..4c299ec4361 100644 --- a/apr_common.m4 +++ b/apr_common.m4 @@ -70,6 +70,7 @@ dnl PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 if test -n "$PTHREAD_FLAGS"; then CPPFLAGS="$CPPFLAGS $PTHREAD_FLAGS" + THREAD_CPPFLAGS="$THREAD_CPPFLAGS $PTHREAD_FLAGS" fi ])dnl @@ -165,6 +166,7 @@ fi if test -n "$ac_cv_pthreads_cflags"; then CFLAGS="$CFLAGS $ac_cv_pthreads_cflags" + THREAD_CFLAGS="$THREAD_CFLAGS $ac_cv_pthreads_cflags" fi PTHREADS_CHECK_COMPILE diff --git a/configure.in b/configure.in index 1cb10e5d7bc..e8d93a6fedd 100644 --- a/configure.in +++ b/configure.in @@ -715,6 +715,8 @@ AC_SUBST(OSDIR) AC_SUBST(DEFAULT_OSDIR) AC_SUBST(LIBPREFIX) AC_SUBST(EXEEXT) +AC_SUBST(THREAD_CPPFLAGS) +AC_SUBST(THREAD_CFLAGS) echo "Construct Makefiles and header files." MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile" From 5c55a3a817b7ab28ffa56286a43d8be23acda502 Mon Sep 17 00:00:00 2001 From: Tony Finch <fanf@apache.org> Date: Wed, 25 Oct 2000 15:02:51 +0000 Subject: [PATCH 0635/7878] ensure that all cpp directives start with a # in column one PR: 6742 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60613 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/pipe.c | 32 ++++++++++++++++---------------- i18n/unix/xlate.c | 6 +++--- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 20b251e4677..24cc5f5f26b 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -61,29 +61,29 @@ static apr_status_t pipeblock(apr_file_t *thepipe) int fd_flags; fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); - #if defined(O_NONBLOCK) +# if defined(O_NONBLOCK) fd_flags &= ~O_NONBLOCK; - #elif defined(~O_NDELAY) +# elif defined(~O_NDELAY) fd_flags &= ~O_NDELAY; - #elif defined(FNDELAY) +# elif defined(FNDELAY) fd_flags &= ~O_FNDELAY; - #else +# else /* XXXX: this breaks things, but an alternative isn't obvious...*/ return APR_ENOTIMPL; - #endif +# endif if (fcntl(thepipe->filedes, F_SETFL, fd_flags) == -1) { return errno; } #else -#if BEOS_BONE /* This only works on BONE or beyond */ +# if BEOS_BONE /* This only works on BONE or beyond */ int on = 0; if (ioctl(thepipe->filedes, FIONBIO, &on, sizeof(on)) < 0) return errno; -#else /* BEOS_BONE */ +# else /* BEOS_BONE */ return APR_ENOTIMPL; -#endif /* BEOS_BONE */ +# endif /* BEOS_BONE */ #endif /* !BEOS_R5 */ @@ -96,29 +96,29 @@ static apr_status_t pipenonblock(apr_file_t *thepipe) #if !BEOS /* this code won't work on BeOS */ int fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); - #if defined(O_NONBLOCK) +# if defined(O_NONBLOCK) fd_flags |= O_NONBLOCK; - #elif defined(O_NDELAY) +# elif defined(O_NDELAY) fd_flags |= O_NDELAY; - #elif defined(FNDELAY) +# elif defined(FNDELAY) fd_flags |= O_FNDELAY; - #else +# else /* XXXX: this breaks things, but an alternative isn't obvious...*/ return APR_ENOTIMPL; - #endif +# endif if (fcntl(thepipe->filedes, F_SETFL, fd_flags) == -1) { return errno; } #else /* !BEOS */ -#if BEOS_BONE /* This only works on BONE and later...*/ +# if BEOS_BONE /* This only works on BONE and later...*/ int on = 1; if (ioctl(thepipe->filedes, FIONBIO, &on, sizeof(on)) < 0) return errno; -#else /* BEOS_BONE */ +# else /* BEOS_BONE */ return APR_ENOTIMPL; -#endif /* BEOS_BONE */ +# endif /* BEOS_BONE */ #endif /* !BEOS */ diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 6ff40c6798a..5f04132fb47 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -99,11 +99,11 @@ struct apr_xlate_t { static const char *get_default_charset(void) { #ifdef __MVS__ - #ifdef __CODESET__ +# ifdef __CODESET__ return __CODESET__; - #else +# else return "IBM-1047"; - #endif +# endif #endif if ('}' == 0xD0) { From 37c3cff46d412d8ce27f4850a10dade4b2e9c58c Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 25 Oct 2000 18:21:13 +0000 Subject: [PATCH 0636/7878] Fix some typos in the comments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60614 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index f71e6bc39d3..7386ae81762 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -177,7 +177,7 @@ apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how); apr_status_t apr_close_socket(apr_socket_t *thesocket); /** - * Bind the socket to it's assocaited port + * Bind the socket to its associated port * @param sock The socket to bind * @tip This is where we will find out if there is any other process * using the selected port. @@ -185,7 +185,7 @@ apr_status_t apr_close_socket(apr_socket_t *thesocket); apr_status_t apr_bind(apr_socket_t *sock); /** - * Listen to a bound socketi for connections. + * Listen to a bound socket for connections. * @param sock The socket to listen on * @param backlog The number of outstanding connections allowed in the sockets * listen queue. If this value is less than zero, the listen From e3f6019042445b93493406bf348f46449bfc2820 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sat, 28 Oct 2000 15:01:34 +0000 Subject: [PATCH 0637/7878] fix a typo and add a little more info in the doc for apr_pstrndup() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60615 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index a84137eaf27..b45f29c7d3c 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -121,8 +121,8 @@ int apr_strnatcasecmp(char const *a, char const *b); APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); /** - * duplicate the first n characters ofa string into memory allocated - * out of a pool + * duplicate the first n characters of a string into memory allocated + * out of a pool; the new string will be '\0'-terminated * @param p The pool to allocate out of * @param s The string to allocate * @param n The number of characters to duplicate From 7dca4919e9b6951c63140d120e0e516e7530bbfb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 30 Oct 2000 15:01:50 +0000 Subject: [PATCH 0638/7878] Good files to have (on Win32), but obnoxious to keep reporting. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60616 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/.cvsignore b/test/.cvsignore index ee2faacb664..cdf3b8a0dde 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -20,3 +20,6 @@ testfile occhild testsf testuuid +testsuite +testsuite.opt +testsuite.ncb From 3794e4a805638f71176d02e6bece3f63f3d6f2ea Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Mon, 30 Oct 2000 19:39:33 +0000 Subject: [PATCH 0639/7878] I'm pretty sure we only need to include this once... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60617 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/threadproc.h | 1 - threadproc/beos/threadproc.h | 1 - 2 files changed, 2 deletions(-) diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h index 58c4fb67b33..fcff52c151d 100644 --- a/include/arch/beos/threadproc.h +++ b/include/arch/beos/threadproc.h @@ -56,7 +56,6 @@ #include "../../file_io/unix/fileio.h" #include "apr_file_io.h" #include "apr_thread_proc.h" -#include "apr_file_io.h" #include "apr_general.h" #include "apr_portable.h" #include <kernel/OS.h> diff --git a/threadproc/beos/threadproc.h b/threadproc/beos/threadproc.h index 58c4fb67b33..fcff52c151d 100644 --- a/threadproc/beos/threadproc.h +++ b/threadproc/beos/threadproc.h @@ -56,7 +56,6 @@ #include "../../file_io/unix/fileio.h" #include "apr_file_io.h" #include "apr_thread_proc.h" -#include "apr_file_io.h" #include "apr_general.h" #include "apr_portable.h" #include <kernel/OS.h> From 9d713f6a02f5e27d29f96a3fa57f8df5432570bb Mon Sep 17 00:00:00 2001 From: Tony Finch <fanf@apache.org> Date: Mon, 30 Oct 2000 19:56:37 +0000 Subject: [PATCH 0640/7878] Fix hash resizing: the hash table size was updated before the array was, so when iterating through the old array in order to move the elements to the new array we'd go strolling off the end and into outer space. Submitted by: Karl Fogel <kfogel@galois.collab.net> Message-ID: <200010272139.e9RLdoi28113@galois.collab.net> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60618 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index b0385fb187f..d0c9f01dec6 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -122,9 +122,9 @@ struct apr_hash_index_t { * Hash creation functions. */ -static apr_hash_entry_t **alloc_array(apr_hash_t *ht) +static apr_hash_entry_t **alloc_array(apr_hash_t *ht, apr_size_t max) { - return apr_pcalloc(ht->pool, sizeof(*ht->array) * (ht->max + 1)); + return apr_pcalloc(ht->pool, sizeof(*ht->array) * (max + 1)); } APR_DECLARE(apr_hash_t *) apr_make_hash(apr_pool_t *pool) @@ -134,7 +134,7 @@ APR_DECLARE(apr_hash_t *) apr_make_hash(apr_pool_t *pool) ht->pool = pool; ht->count = 0; ht->max = INITIAL_MAX; - ht->array = alloc_array(ht); + ht->array = alloc_array(ht, ht->max); return ht; } @@ -178,22 +178,25 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, /* - * Resizing a hash table + * Expanding a hash table */ -static void resize_array(apr_hash_t *ht) +static void expand_array(apr_hash_t *ht) { apr_hash_index_t *hi; apr_hash_entry_t **new_array; + apr_size_t new_max; int i; - new_array = alloc_array(ht); + new_max = ht->max * 2 + 1; + new_array = alloc_array(ht, new_max); for (hi = apr_hash_first(ht); hi; hi = apr_hash_next(hi)) { i = hi->this->hash & ht->max; hi->this->next = new_array[i]; new_array[i] = hi->this; } ht->array = new_array; + ht->max = new_max; } /* @@ -274,8 +277,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, *hep = he; /* check that the collision rate isn't too high */ if (++ht->count > ht->max) { - ht->max = ht->max * 2 + 1; - resize_array(ht); + expand_array(ht); } return hep; } From 9657a25ed7219b539533a80b02ce9cdc72da0e07 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Thu, 2 Nov 2000 00:14:34 +0000 Subject: [PATCH 0641/7878] don't print anything for "%n" Submitted by: Karl Fogel <kfogel@collab.net< Message-ID: <200010302044.e9UKiuj09461@galois.collab.net> Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60619 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 8b577dad384..f525a79a033 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -708,6 +708,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * Default variable settings */ + boolean_e print_something = YES; adjust = RIGHT; alternate_form = print_sign = print_blank = NO; pad_char = ' '; @@ -1000,6 +1001,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), *(va_arg(ap, short *)) = cc; else *(va_arg(ap, int *)) = cc; + print_something = NO; break; /* @@ -1131,10 +1133,12 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * Print the string s. */ - for (i = s_len; i != 0; i--) { - INS_CHAR(*s, sp, bep, cc); - s++; - } + if (print_something == YES) { + for (i = s_len; i != 0; i--) { + INS_CHAR(*s, sp, bep, cc); + s++; + } + } if (adjust_width && adjust == LEFT && min_width > s_len) PAD(min_width, s_len, pad_char); From a8c54b6260e4923bc33bad32553522bb008e8bbc Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 2 Nov 2000 03:02:50 +0000 Subject: [PATCH 0642/7878] Make 2nd parm of apr_connect() const char * instead of char *. Note to BeOS fans: apr_connect() is missing a check for hostname != NULL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60620 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 2 +- network_io/beos/sockets.c | 2 +- network_io/os2/sockets.c | 2 +- network_io/unix/sockets.c | 2 +- network_io/win32/sockets.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 7386ae81762..3c499448737 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -212,7 +212,7 @@ apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, * APR assumes that the sockaddr_in in the apr_socket is * completely filled out. */ -apr_status_t apr_connect(apr_socket_t *sock, char *hostname); +apr_status_t apr_connect(apr_socket_t *sock, const char *hostname); /** * Get name of the machine we are currently connected to. diff --git a/network_io/beos/sockets.c b/network_io/beos/sockets.c index 5a1347b6421..ab9a6014b18 100644 --- a/network_io/beos/sockets.c +++ b/network_io/beos/sockets.c @@ -161,7 +161,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return APR_SUCCESS; } -apr_status_t apr_connect(apr_socket_t *sock, char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) { struct hostent *hp; diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 12371da487e..b5054e5c93e 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -172,7 +172,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return APR_SUCCESS; } -apr_status_t apr_connect(apr_socket_t *sock, char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) { struct hostent *hp; diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 2399c80c634..4e5c37e0c7c 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -178,7 +178,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return APR_SUCCESS; } -apr_status_t apr_connect(apr_socket_t *sock, char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) { struct hostent *hp; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index e0d62d33a32..e65d908cb64 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -212,7 +212,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return APR_SUCCESS; } -apr_status_t apr_connect(apr_socket_t *sock, char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) { struct hostent *hp; apr_status_t lasterror; From 7213c120f96360237380a662aa9f059e7273b82b Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Thu, 2 Nov 2000 03:30:26 +0000 Subject: [PATCH 0643/7878] Simplify the configuration mechanisms for threading in APR. Revise how Apache configs APR and allow MPMs (or other config scripts) to pass cmd line params down to APR. For the MPMs that specifically require or disallow threads, have them force APR threads on/off. Submitted by: Joe Orton <joe@light.plus.com> Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60621 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/configure.in b/configure.in index e8d93a6fedd..e0faeca02da 100644 --- a/configure.in +++ b/configure.in @@ -92,13 +92,13 @@ case "$OS" in CFLAGS="$CFLAGS -DOS2 -Zmt" OSDIR="os2" LIBPREFIX="" - enable_apr_threads="system_threads" + enable_threads="system_threads" eolstr="\\r\\n" ;; *beos*) OSDIR="beos" CFLAGS="$CFLAGS -DBEOS" - enable_apr_threads="system_threads" + enable_threads="system_threads" config_subdirs="shmem/unix/mm" native_mmap_emul="1" USE_MM=yes @@ -121,10 +121,6 @@ esac AC_SUBST(eolstr) -if test "$enable_apr_threads" = "system_threads"; then - ac_cv_enable_threads="yes" -fi - dnl #----------------------------- Checking for Shared Memory Support echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" @@ -476,21 +472,23 @@ AC_SUBST(aprdso) dnl #----------------------------- Checking for Threads echo $ac_n "${nl}Checking for Threads...${nl}" -AC_CACHE_CHECK([for threads], ac_cv_enable_threads, - [ AC_ARG_ENABLE(threads, - [ --enable-threads Enable threading support in APR.], - [ ac_cv_enable_threads=$enableval] , - [ CHECK_PTHREADS_H([ ac_cv_enable_threads="pthread" ] , - [ ac_cv_enable_threads="no" ] ) ] ) ] ) - -if test "$ac_cv_enable_threads" = "no"; then + +if test -z "$enable_threads"; then + AC_ARG_ENABLE(threads, + [ --enable-threads Enable threading support in APR.], + [ enable_threads=$enableval] , + [ CHECK_PTHREADS_H([ enable_threads="pthread" ] , + [ enable_threads="no" ] ) ] ) +fi + +if test "$enable_threads" = "no"; then echo "Don't enable threads" threads="0" pthreadh="0" pthreadser="0" else REENTRANCY_FLAGS - if test "$ac_cv_enable_threads" = "pthread"; then + if test "$enable_threads" = "pthread"; then # We have specified pthreads for our threading library, just make sure # that we have everything we need PTHREADS_CHECK @@ -502,7 +500,7 @@ else threads="0" pthreadh="0" pthreadser="0" ] ) - elif test "$enable_apr_threads" = "system_threads"; then + elif test "$enable_threads" = "system_threads"; then threads="1" pthreadh="0" pthreadser="0" From 685324b439a10edd06cdfe48277925bdb72b8e54 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Thu, 2 Nov 2000 05:01:08 +0000 Subject: [PATCH 0644/7878] the thread-specific CFLAGS were not getting propagated into THREAD_CFLAGS properly (on the first-time config). on the second config, it would pull it from the cache. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60622 13f79535-47bb-0310-9956-ffa450edef68 --- apr_common.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apr_common.m4 b/apr_common.m4 index 4c299ec4361..7c15451778b 100644 --- a/apr_common.m4 +++ b/apr_common.m4 @@ -180,6 +180,8 @@ if test "$pthreads_working" != "yes"; then PTHREADS_CHECK_COMPILE if test "$pthreads_working" = "yes"; then ac_cv_pthreads_cflags="$flag" + dnl this was already added to CFLAGS; add to THREAD_CFLAGS, too + THREAD_CFLAGS="$THREAD_CFLAGS $ac_cv_pthreads_cflags" break fi CFLAGS="$ac_save" From 9bf8b504f3993489ae49c691ab33f8a6fd24061a Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Thu, 2 Nov 2000 05:10:28 +0000 Subject: [PATCH 0645/7878] look for gethostname in an existing -lnsl rather than bringing it in a second time. simplify the search for crypt() a bit. Submitted by: Joe Orton <joe@light.plus.com> Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60623 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index e0faeca02da..4b2913ca027 100644 --- a/configure.in +++ b/configure.in @@ -201,10 +201,9 @@ fi dnl #----------------------------- Checks for Any required Libraries AC_CHECK_LIB(nsl,gethostbyname) -AC_CHECK_LIB(nsl,gethostname) +AC_SEARCH_LIBS(gethostname, nsl) AC_CHECK_LIB(socket,socket) -AC_CHECK_LIB(crypt,crypt) -AC_CHECK_LIB(ufc,crypt) +AC_SEARCH_LIBS(crypt, crypt ufc) AC_CHECK_LIB(truerand,main) AC_CHECK_LIB(iconv,iconv) From f7d17aac18fc1e3311ead452b492aeb1f8470a6d Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Thu, 2 Nov 2000 14:15:00 +0000 Subject: [PATCH 0646/7878] Add error checking for apr_connect. Submitted by: Jeff Trawick <trawick@locus.apache.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60624 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/sockets.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/network_io/beos/sockets.c b/network_io/beos/sockets.c index ab9a6014b18..a168e7a3926 100644 --- a/network_io/beos/sockets.c +++ b/network_io/beos/sockets.c @@ -165,12 +165,17 @@ apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) { struct hostent *hp; - hp = gethostbyname(hostname); - if ((sock->socketdes < 0) || (!sock->remote_addr)) { - return APR_ENOTSOCK; - } + if ((sock->socketdes < 0) || (!sock->remote_addr)) { + return APR_ENOTSOCK; + } + + if (hostname != NULL){ + hp = gethostbyname(hostname); + if (!hp) + return (h_errno + APR_OS_START_SYSERR); memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr , hp->h_length); + } sock->remote_addr->sin_family = AF_INET; From d29936731be1f120ad77e356f2a5eccb69e8aec3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 2 Nov 2000 15:24:08 +0000 Subject: [PATCH 0647/7878] The Unicode/WinNT APR patch. Note that this may even be faster than MS's internal atow translation that always occurs. Enabled now by default. Warning; it's probable that extended characters in existing URL's are broken by the patch, since the URL semantic changes. Also, launching cgi's, loading modules, etc that use extended characters are also broken. Step 2 is to address the cgi/CreateProcess (spawn) aspects of the patch, fix dso/LoadModule handling, and accept a Unicode'd httpd.conf file, as utf-8 is already legal in httpd.conf path specs, but difficult to use. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60625 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileacc.c | 28 ++++--- file_io/win32/dir.c | 145 +++++++++++++++++++++--------------- file_io/win32/filedup.c | 17 +++-- file_io/win32/fileio.h | 26 +++++-- file_io/win32/filestat.c | 104 ++++++++++++-------------- file_io/win32/open.c | 12 +-- file_io/win32/pipe.c | 8 +- include/apr.hw | 8 +- include/arch/win32/fileio.h | 26 +++++-- 9 files changed, 204 insertions(+), 170 deletions(-) diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 1ad701e679a..bf9f1e31173 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -76,19 +76,23 @@ apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) { -#if APR_HAS_UNICODE_FS - apr_status_t rv; - int len = wcslen(thefile->fname) + 1; - int dremains = MAX_PATH; - *fname = apr_palloc(thefile->cntxt, len * 2); - if ((rv = conv_ucs2_to_utf8(thefile->fname, &len, - *fname, &dremains))) - return rv; - if (len) - return APR_ENAMETOOLONG; -#else - *fname = apr_pstrdup(thefile->cntxt, thefile->fname); +#if defined(WIN32) && APR_HAS_UNICODE_FS + apr_oslevel_e os_level; + if (!apr_get_oslevel(thefile->cntxt, &os_level) && os_level >= APR_WIN_NT) + { + apr_status_t rv; + int len = wcslen(thefile->w.fname) + 1; + int dremains = MAX_PATH; + *fname = apr_palloc(thefile->cntxt, len * 2); + if ((rv = conv_ucs2_to_utf8(thefile->w.fname, &len, + *fname, &dremains))) + return rv; + if (len) + return APR_ENAMETOOLONG; + } + else #endif + *fname = apr_pstrdup(thefile->cntxt, thefile->n.fname); return APR_SUCCESS; } diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index a3f43858195..382719f3112 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -89,29 +89,40 @@ apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) { int len = strlen(dirname); #if APR_HAS_UNICODE_FS - apr_status_t rv; - int lremains = len; - int dremains = (len + 3) * 2; - (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); - (*new)->entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); - (*new)->dirname = apr_palloc(cont, dremains); - if ((rv = conv_utf8_to_ucs2(dirname, &lremains, - (*new)->dirname, &dremains))) - return rv; - if (lremains) - return APR_ENAMETOOLONG; - len = (len + 3) * 2 - dremains; -#else - (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); - (*new)->entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATA)); - (*new)->dirname = apr_palloc(cont, len + 3); - memcpy((*new)->dirname, dirname, len); + apr_oslevel_e os_level; + if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) + { + apr_status_t rv; + int lremains = len; + int dremains = (len + 3) * 2; + (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); + (*new)->w.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); + (*new)->w.dirname = apr_palloc(cont, dremains); + if ((rv = conv_utf8_to_ucs2(dirname, &lremains, + (*new)->w.dirname, &dremains))) + return rv; + if (lremains) + return APR_ENAMETOOLONG; + len = (len + 3) * 2 - dremains; + if (len && (*new)->w.dirname[len - 1] != '/') { + (*new)->w.dirname[len++] = '/'; + } + (*new)->w.dirname[len++] = '*'; + (*new)->w.dirname[len] = '\0'; + } + else #endif - if (len && dirname[len - 1] != '/') { - (*new)->dirname[len++] = '/'; + { + (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); + (*new)->n.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATA)); + (*new)->n.dirname = apr_palloc(cont, len + 3); + memcpy((*new)->n.dirname, dirname, len); + if (len && (*new)->n.dirname[len - 1] != '/') { + (*new)->n.dirname[len++] = '/'; + } + (*new)->n.dirname[len++] = '*'; + (*new)->n.dirname[len] = '\0'; } - (*new)->dirname[len++] = '*'; - (*new)->dirname[len] = '\0'; (*new)->cntxt = cont; (*new)->dirhand = INVALID_HANDLE_VALUE; apr_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, @@ -131,26 +142,32 @@ apr_status_t apr_closedir(apr_dir_t *dir) apr_status_t apr_readdir(apr_dir_t *thedir) { #if APR_HAS_UNICODE_FS - if (thedir->dirhand == INVALID_HANDLE_VALUE) { - thedir->dirhand = FindFirstFileW(thedir->dirname, thedir->entry); + apr_oslevel_e os_level; + if (!apr_get_oslevel(thedir->cntxt, &os_level) && os_level >= APR_WIN_NT) + { if (thedir->dirhand == INVALID_HANDLE_VALUE) { + thedir->dirhand = FindFirstFileW(thedir->w.dirname, thedir->w.entry); + if (thedir->dirhand == INVALID_HANDLE_VALUE) { + return apr_get_os_error(); + } + } + else if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) { return apr_get_os_error(); } } - else if (!FindNextFileW(thedir->dirhand, thedir->entry)) { - return apr_get_os_error(); - } -#else - if (thedir->dirhand == INVALID_HANDLE_VALUE) { - thedir->dirhand = FindFirstFile(thedir->dirname, thedir->entry); + else +#endif + { if (thedir->dirhand == INVALID_HANDLE_VALUE) { + thedir->dirhand = FindFirstFile(thedir->n.dirname, thedir->n.entry); + if (thedir->dirhand == INVALID_HANDLE_VALUE) { + return apr_get_os_error(); + } + } + else if (!FindNextFile(thedir->dirhand, thedir->n.entry)) { return apr_get_os_error(); } } - else if (!FindNextFile(thedir->dirhand, thedir->entry)) { - return apr_get_os_error(); - } -#endif return APR_SUCCESS; } @@ -182,56 +199,60 @@ apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir) { - if (thedir == NULL || thedir->entry == NULL) { + if (thedir == NULL || thedir->n.entry == NULL) { return APR_ENODIR; } - (*size) = (thedir->entry->nFileSizeHigh * MAXDWORD) + - thedir->entry->nFileSizeLow; + (*size) = (thedir->n.entry->nFileSizeHigh * MAXDWORD) + + thedir->n.entry->nFileSizeLow; return APR_SUCCESS; } apr_status_t apr_dir_entry_mtime(apr_time_t *time, apr_dir_t *thedir) { - if (thedir == NULL || thedir->entry == NULL) { + if (thedir == NULL || thedir->n.entry == NULL) { return APR_ENODIR; } - FileTimeToAprTime(time, &thedir->entry->ftLastWriteTime); + FileTimeToAprTime(time, &thedir->n.entry->ftLastWriteTime); return APR_SUCCESS; } apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) { - switch(thedir->entry->dwFileAttributes) { - case FILE_ATTRIBUTE_DIRECTORY: { - (*type) = APR_DIR; - return APR_SUCCESS; - } - case FILE_ATTRIBUTE_NORMAL: { - (*type) = APR_REG; - return APR_SUCCESS; - } - default: { - (*type) = APR_REG; /* As valid as anything else.*/ - return APR_SUCCESS; - } + switch(thedir->n.entry->dwFileAttributes) { + case FILE_ATTRIBUTE_DIRECTORY: { + (*type) = APR_DIR; + return APR_SUCCESS; + } + case FILE_ATTRIBUTE_NORMAL: { + (*type) = APR_REG; + return APR_SUCCESS; + } + default: { + (*type) = APR_REG; /* As valid as anything else.*/ + return APR_SUCCESS; + } } } apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) { #if APR_HAS_UNICODE_FS - apr_status_t rv; - int len = wcslen(thedir->entry->cFileName) + 1; - int dremains = MAX_PATH; - (*new) = apr_palloc(thedir->cntxt, len * 2); - if ((rv = conv_ucs2_to_utf8(thedir->entry->cFileName, &len, - *new, &dremains))) - return rv; - if (len) - return APR_ENAMETOOLONG; -#else - (*new) = apr_pstrdup(thedir->cntxt, thedir->entry->cFileName); + apr_oslevel_e os_level; + if (!apr_get_oslevel(thedir->cntxt, &os_level) && os_level >= APR_WIN_NT) + { + apr_status_t rv; + int len = wcslen(thedir->w.entry->cFileName) + 1; + int dremains = MAX_PATH; + (*new) = apr_palloc(thedir->cntxt, len * 2); + if ((rv = conv_ucs2_to_utf8(thedir->w.entry->cFileName, &len, + *new, &dremains))) + return rv; + if (len) + return APR_ENAMETOOLONG; + } + else #endif + (*new) = apr_pstrdup(thedir->cntxt, thedir->n.entry->cFileName); return APR_SUCCESS; } diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 6e14473adc5..fea11f248c2 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -66,9 +66,7 @@ apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t { BOOLEAN isStdHandle = FALSE; HANDLE hCurrentProcess = GetCurrentProcess(); -#if APR_HAS_UNICODE_FS - int len = wcslen(old_file->fname) + 1; -#endif + apr_oslevel_e os_level; if ((*new_file) == NULL) { if (p == NULL) { @@ -111,11 +109,16 @@ apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t (*new_file)->cntxt = old_file->cntxt; #if APR_HAS_UNICODE_FS - (*new_file)->fname = apr_palloc(old_file->cntxt, len * 2); - wcscpy((*new_file)->fname, old_file->fname); -#else - (*new_file)->fname = apr_pstrdup(old_file->cntxt, old_file->fname); + if (!apr_get_oslevel(old_file->cntxt, &os_level) && os_level >= APR_WIN_NT) + { + int len = wcslen(old_file->w.fname) + 1; + (*new_file)->w.fname = apr_palloc(old_file->cntxt, len * 2); + wcscpy((*new_file)->w.fname, old_file->w.fname); + } + else #endif + (*new_file)->n.fname = apr_pstrdup(old_file->cntxt, old_file->n.fname); + /* (*new_file)->demonfname = apr_pstrdup(old_file->cntxt, old_file->demonfname); * (*new_file)->lowerdemonfname = apr_pstrdup(old_file->cntxt, old_file->lowerdemonfname); */ diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index d9d510e3379..5852720ef8c 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -140,11 +140,16 @@ struct apr_file_t { apr_interval_time_t timeout; /* File specific info */ + union { #if APR_HAS_UNICODE_FS - apr_wchar_t *fname; -#else - char *fname; + struct { + apr_wchar_t *fname; + } w; #endif + struct { + char *fname; + } n; + }; apr_canon_t *canonname; DWORD dwFileAttributes; @@ -172,13 +177,18 @@ struct apr_file_t { struct apr_dir_t { apr_pool_t *cntxt; HANDLE dirhand; + union { #if APR_HAS_UNICODE_FS - apr_wchar_t *dirname; - WIN32_FIND_DATAW *entry; -#else - char *dirname; - WIN32_FIND_DATA *entry; + struct { + apr_wchar_t *dirname; + WIN32_FIND_DATAW *entry; + } w; #endif + struct { + char *dirname; + WIN32_FIND_DATA *entry; + } n; + }; }; apr_status_t file_cleanup(void *); diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index b245f9f747c..8b9f8141a42 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -197,78 +197,66 @@ apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) { - /* WIN32_FILE_ATTRIBUTE_DATA is an exact subset of the first - * entries of WIN32_FIND_DATA - * We need to catch the case where fname length == MAX_PATH since for + /* Big enough for the Win9x FindFile, but actually the same + * initial fields as the GetFileAttributes return structure + */ + WIN32_FIND_DATA FileInformation; + apr_oslevel_e os_level; + + /* We need to catch the case where fname length == MAX_PATH since for * some strange reason GetFileAttributesEx fails with PATH_NOT_FOUND. * We would rather indicate length error than 'not found' * since in many cases the apr user is testing for 'not found' * and this is not such a case. - */ + */ #if APR_HAS_UNICODE_FS - WIN32_FIND_DATAW FileInformation; - apr_wchar_t wname[MAX_PATH]; - int len = MAX_PATH; - int lremains = strlen(fname) + 1; - apr_oslevel_e os_level; - apr_status_t rv; - HANDLE hFind; - if ((rv = conv_utf8_to_ucs2(fname, &lremains, wname, &len))) - return rv; - if (lremains) - return APR_ENAMETOOLONG; - if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_98) { + if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t wname[MAX_PATH]; + int len = MAX_PATH; + int lremains = strlen(fname) + 1; + apr_status_t rv; + if ((rv = conv_utf8_to_ucs2(fname, &lremains, wname, &len))) + return rv; + if (lremains) + return APR_ENAMETOOLONG; if (!GetFileAttributesExW(wname, GetFileExInfoStandard, - (WIN32_FILE_ATTRIBUTE_DATA*) &FileInformation)) { + &FileInformation)) { return apr_get_os_error(); } } - else { - /* What a waste of cpu cycles... but what else can we do? - */ - if (strchr(fname, '*') || strchr(fname, '?')) - return APR_ENOENT; - hFind = FindFirstFileW(wname, &FileInformation); - if (hFind == INVALID_HANDLE_VALUE) { - return apr_get_os_error(); - } else { - FindClose(hFind); - } - } + else #else - int len = strlen(fname); - WIN32_FIND_DATA FileInformation; - HANDLE hFind; - apr_oslevel_e os_level; - (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); - (*new)->entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATA)); - (*new)->dirname = apr_palloc(cont, len + 3); - memcpy((*new)->dirname, dirname, len); - - if (len >= MAX_PATH) { - return APR_ENAMETOOLONG; - } - else if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_98) { - if (!GetFileAttributesEx(fname, GetFileExInfoStandard, - (WIN32_FILE_ATTRIBUTE_DATA*) &FileInformation)) { - return apr_get_os_error(); + apr_get_oslevel(cont, &os_level); +#endif + { + if (strlen(fname) >= MAX_PATH) { + return APR_ENAMETOOLONG; } - } - else { - /* What a waste of cpu cycles... but what else can we do? - */ - if (strchr(fname, '*') || strchr(fname, '?')) - return APR_ENOENT; - hFind = FindFirstFile(fname, &FileInformation); - if (hFind == INVALID_HANDLE_VALUE) { - return apr_get_os_error(); - } else { - FindClose(hFind); + else if (os_level >= APR_WIN_98) + { + if (!GetFileAttributesEx(fname, GetFileExInfoStandard, + &FileInformation)) { + return apr_get_os_error(); + } + } + else + { + /* What a waste of cpu cycles... but what else can we do? + */ + HANDLE hFind; + if (strchr(fname, '*') || strchr(fname, '?')) + return APR_ENOENT; + hFind = FindFirstFile(fname, &FileInformation); + if (hFind == INVALID_HANDLE_VALUE) { + return apr_get_os_error(); + } else { + FindClose(hFind); + } } } -#endif - memset(finfo,'\0', sizeof(*finfo)); + memset(finfo, '\0', sizeof(*finfo)); /* Filetype - Directory or file? * Short of opening the handle to the file, the 'FileType' appears * to be unknowable (in any trustworthy or consistent sense), that diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 043f494cdee..818f2728cb0 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -116,14 +116,14 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, return rv; } #if APR_HAS_UNICODE_FS - (*new)->fname = apr_palloc(cont, dremains); + (*new)->w.fname = apr_palloc(cont, dremains); if ((rv = conv_utf8_to_ucs2(fname, &lremains, - (*new)->fname, &dremains))) + (*new)->w.fname, &dremains))) return rv; if (lremains) return APR_ENAMETOOLONG; #else - (*new)->fname = apr_pstrdup(cont, fname); + (*new)->n.fname = apr_pstrdup(cont, fname); #endif if (apr_get_oslevel(cont, &level) == APR_SUCCESS && level >= APR_WIN_NT) { @@ -167,10 +167,10 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, } #if APR_HAS_UNICODE_FS - (*new)->filehand = CreateFileW((*new)->fname, oflags, sharemode, + (*new)->filehand = CreateFileW((*new)->w.fname, oflags, sharemode, NULL, createflags, attributes, 0); #else - (*new)->filehand = CreateFile((*new)->fname, oflags, sharemode, + (*new)->filehand = CreateFile((*new)->n.fname, oflags, sharemode, NULL, createflags, attributes, 0); #endif if ((*new)->filehand == INVALID_HANDLE_VALUE) { @@ -303,7 +303,7 @@ apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) if ((*thefile)->filehand == INVALID_HANDLE_VALUE) return apr_get_os_error(); (*thefile)->cntxt = cont; - (*thefile)->fname = "\0\0"; // What was this: "STD_ERROR_HANDLE"; + (*thefile)->n.fname = "\0\0"; // What was this??? : "STD_ERROR_HANDLE"; */ (*thefile)->eof_hit = 0; return APR_SUCCESS; diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 884f5df1b82..2836f893df6 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -79,7 +79,7 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p) (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*in)->cntxt = p; - (*in)->fname = apr_pstrdup(p, "PIPE"); + (*in)->n.fname = "\0\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */ (*in)->pipe = 1; (*in)->timeout = -1; (*in)->ungetchar = -1; @@ -91,7 +91,7 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p) (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*out)->cntxt = p; - (*out)->fname = apr_pstrdup(p, "PIPE"); + (*in)->n.fname = "\0\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */ (*out)->pipe = 1; (*out)->timeout = -1; (*out)->ungetchar = -1; @@ -149,7 +149,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*in)->cntxt = p; - (*in)->fname = apr_pstrdup(p, "PIPE"); + (*in)->n.fname = "\0\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */ (*in)->pipe = 1; (*in)->timeout = -1; (*in)->ungetchar = -1; @@ -162,7 +162,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*out)->cntxt = p; - (*out)->fname = apr_pstrdup(p, "PIPE"); + (*in)->n.fname = "\0\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */ (*out)->pipe = 1; (*out)->timeout = -1; (*out)->ungetchar = -1; diff --git a/include/apr.hw b/include/apr.hw index 15493af0d7c..c006b88ce15 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -155,12 +155,10 @@ #define APR_HAS_XLATE 0 /* - * XXX: Problem - while this may be an NT build - if we share binaries, - * this is actually a run time decision - * Until tested and validated - back to 'future' status (feel free to toggle - * to 1 and experiment. + * XXX: Problem - while this may be an NT build - so we are experimenting + * but if we have problems, please feel free to revert to 0. */ -#define APR_HAS_UNICODE_FS 0 +#define APR_HAS_UNICODE_FS 1 /* Typedefs that APR needs. */ diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index d9d510e3379..5852720ef8c 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -140,11 +140,16 @@ struct apr_file_t { apr_interval_time_t timeout; /* File specific info */ + union { #if APR_HAS_UNICODE_FS - apr_wchar_t *fname; -#else - char *fname; + struct { + apr_wchar_t *fname; + } w; #endif + struct { + char *fname; + } n; + }; apr_canon_t *canonname; DWORD dwFileAttributes; @@ -172,13 +177,18 @@ struct apr_file_t { struct apr_dir_t { apr_pool_t *cntxt; HANDLE dirhand; + union { #if APR_HAS_UNICODE_FS - apr_wchar_t *dirname; - WIN32_FIND_DATAW *entry; -#else - char *dirname; - WIN32_FIND_DATA *entry; + struct { + apr_wchar_t *dirname; + WIN32_FIND_DATAW *entry; + } w; #endif + struct { + char *dirname; + WIN32_FIND_DATA *entry; + } n; + }; }; apr_status_t file_cleanup(void *); From 23de4608a6c414c5bcfefbcb5ac62e81adcc024a Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 2 Nov 2000 16:13:41 +0000 Subject: [PATCH 0648/7878] Get APR building on Unix again. Only Windows has the union in the apr_file_t structure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60626 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileacc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index bf9f1e31173..9de68be175a 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -91,8 +91,10 @@ apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) return APR_ENAMETOOLONG; } else -#endif *fname = apr_pstrdup(thefile->cntxt, thefile->n.fname); +#else + *fname = apr_pstrdup(thefile->cntxt, thefile->fname); +#endif return APR_SUCCESS; } From 69df64a2aef2631d31400398946ea5b9cf319f01 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 2 Nov 2000 17:38:22 +0000 Subject: [PATCH 0649/7878] Restore backwards compatibility for WIN32/!APR_HAS_UNICODE_FS, now all should play happily together. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60627 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileacc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 9de68be175a..71d796a2065 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -76,7 +76,8 @@ apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) { -#if defined(WIN32) && APR_HAS_UNICODE_FS +#ifdef WIN32 /* this test is only good until some other platform trys wchar* */ +#if APR_HAS_UNICODE_FS apr_oslevel_e os_level; if (!apr_get_oslevel(thefile->cntxt, &os_level) && os_level >= APR_WIN_NT) { @@ -91,10 +92,12 @@ apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) return APR_ENAMETOOLONG; } else +#else /* !APR_HAS_UNICODE_FS */ *fname = apr_pstrdup(thefile->cntxt, thefile->n.fname); -#else - *fname = apr_pstrdup(thefile->cntxt, thefile->fname); #endif +#else /* !def Win32 */ + *fname = apr_pstrdup(thefile->cntxt, thefile->fname); +#endif return APR_SUCCESS; } From 19917bc58e07ca7f5d3dcc98b7c860a671d8d4ed Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Fri, 3 Nov 2000 08:49:00 +0000 Subject: [PATCH 0650/7878] add missing function Submitted by: Branko Cibej <brane@xbc.nu> Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60628 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/time.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/time/win32/time.c b/time/win32/time.c index f45f7485035..71d91396b6e 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -230,3 +230,7 @@ apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime, return APR_SUCCESS; } +void apr_sleep(apr_interval_time_t t) +{ + Sleep(t/1000); +} From 59cb59e4da3be81ae18d496f69c702689777c066 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 3 Nov 2000 15:36:17 +0000 Subject: [PATCH 0651/7878] Fix a coupl of misspellings; make some doc more consistent. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60629 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 3c499448737..4edae70dfb2 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -372,7 +372,7 @@ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t* /** * Associate a local port with a socket. - * @param sock The socket to set + * @param sock The socket to set. * @param port The local port this socket will be dealing with. * @tip This does not bind the two together, it is just telling apr * that this socket is going to use this port if possible. If @@ -381,8 +381,8 @@ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t* apr_status_t apr_set_local_port(apr_socket_t *sock, apr_uint32_t port); /** - * Assocaite a remote port with a socket. - * @param sock The socket to enquire about. + * Associate a remote port with a socket. + * @param sock The socket to set. * @param port The local port this socket will be dealing with. * @tip This does not make a connection to the remote port, it is just * telling apr which port apr_connect() should attempt to connect to. @@ -404,7 +404,7 @@ apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock); apr_status_t apr_get_remote_port(apr_uint32_t *port, apr_socket_t *sock); /** - * Assocaite a local socket addr with an apr socket. + * Associate a local socket addr with an apr socket. * @param sock The socket to use * @param addr The IP address to attach to the socket. * Use APR_ANYADDR to use any IP addr on the machine. @@ -414,7 +414,7 @@ apr_status_t apr_get_remote_port(apr_uint32_t *port, apr_socket_t *sock); apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr); /** - * Assocaite a remote socket addr with an apr socket. + * Associate a remote socket addr with an apr socket. * @param sock The socket to use * @param addr The IP address to attach to the socket. * @tip This does not make a connection to the remote address, it is just From 75dbe9002aee97c67be7ca1e1472f0f6b82cb306 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 3 Nov 2000 18:05:09 +0000 Subject: [PATCH 0652/7878] Make the len parm to apr_sendfile() apr_ssize_t * instead of apr_size_t * for consistency with other APR network send/recv calls. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60630 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 2 +- network_io/unix/sendrecv.c | 10 +++++----- network_io/win32/sendrecv.c | 4 ++-- test/testsf.c | 5 +++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 4edae70dfb2..f427633cb26 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -301,7 +301,7 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, * The number of bytes actually sent is stored in argument 5. */ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, - apr_off_t *offset, apr_size_t *len, apr_int32_t flags); + apr_off_t *offset, apr_ssize_t *len, apr_int32_t flags); #endif /** diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 827cac5e244..d6ed913d094 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -251,7 +251,7 @@ static int os_uncork(apr_socket_t *sock, int delayflag) } apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, - apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, + apr_hdtr_t *hdtr, apr_off_t *offset, apr_ssize_t *len, apr_int32_t flags) { off_t off = *offset; @@ -382,7 +382,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, /* Release 3.1 or greater */ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_ssize_t * len, apr_int32_t flags) { off_t nbytes; @@ -475,7 +475,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, /* HP-UX Version 10.30 or greater */ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_ssize_t * len, apr_int32_t flags) { int i, ptr = 0; @@ -582,7 +582,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, * OS/390 - V2R7 and above */ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_ssize_t * len, apr_int32_t flags) { int i, ptr, rv = 0; @@ -711,7 +711,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, * all cases of the headers and trailers seems to be a good idea. */ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_ssize_t * len, apr_int32_t flags) { off_t nbytes = 0; diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index b2380e50190..f8e32e55cf1 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -179,7 +179,7 @@ static void collapse_iovec(char **buf, int *len, struct iovec *iovec, int numvec /* * apr_status_t apr_sendfile(apr_socket_t *, apr_file_t *, apr_hdtr_t *, - * apr_off_t *, apr_size_t *, apr_int32_t flags) + * apr_off_t *, apr_ssize_t *, apr_int32_t flags) * Send a file from an open file descriptor to a socket, along with * optional headers and trailers * arg 1) The socket to which we're writing @@ -190,7 +190,7 @@ static void collapse_iovec(char **buf, int *len, struct iovec *iovec, int numvec * arg 6) APR flags that are mapped to OS specific flags */ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_ssize_t * len, apr_int32_t flags) { apr_status_t status = APR_SUCCESS; diff --git a/test/testsf.c b/test/testsf.c index 990dceefade..b8766541333 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -195,7 +195,8 @@ static int client(client_socket_mode_t socket_mode) apr_pool_t *p; char buf[120]; apr_file_t *f = NULL; - apr_size_t len, expected_len; + apr_ssize_t len; + apr_size_t expected_len; apr_off_t current_file_offset; apr_hdtr_t hdtr; struct iovec headers[3]; @@ -330,7 +331,7 @@ static int client(client_socket_mode_t socket_mode) current_file_offset = 0; len = FILE_LENGTH; do { - apr_size_t tmplen; + apr_ssize_t tmplen; tmplen = len; /* bytes remaining to send from the file */ printf("Calling apr_sendfile()...\n"); From e26024c3e22999f008f08e65e3d7fc97114c425e Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 3 Nov 2000 18:10:52 +0000 Subject: [PATCH 0653/7878] Update the apr_sendfile() test program to expect APR_EOF/0 bytes instead of APR_SUCCESS/0 bytes at EOF. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60631 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsf.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/testsf.c b/test/testsf.c index b8766541333..36a29a4cad7 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -455,15 +455,15 @@ static int client(client_socket_mode_t socket_mode) bytes_read = 1; rv = apr_recv(sock, buf, &bytes_read); - if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_recv()->%d/%s\n", + if (rv != APR_EOF) { + fprintf(stderr, "apr_recv()->%d/%s (expected APR_EOF)\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 0) { - fprintf(stderr, "We expected the EOF condition on the connected\n" - "socket but instead we read %ld bytes.\n", + fprintf(stderr, "We expected to get 0 bytes read with APR_EOF\n" + "but instead we read %ld bytes.\n", (long int)bytes_read); exit(1); } @@ -694,15 +694,15 @@ static int server(void) bytes_read = 1; rv = apr_recv(newsock, buf, &bytes_read); - if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_recv()->%d/%s\n", + if (rv != APR_EOF) { + fprintf(stderr, "apr_recv()->%d/%s (expected APR_EOF)\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 0) { - fprintf(stderr, "We expected the EOF condition on the connected\n" - "socket but instead we read %ld bytes (%c).\n", + fprintf(stderr, "We expected to get 0 bytes read with APR_EOF\n" + "but instead we read %ld bytes (%c).\n", (long int)bytes_read, buf[0]); exit(1); } From 0f88591f1a5eb36922861a95d76cf1a30c435521 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Fri, 3 Nov 2000 19:24:16 +0000 Subject: [PATCH 0654/7878] I'm not sure I really like this as it smacks of code duplication with apr_get_remote_hostname, so maybe they should be combined? Anyway, I haven't added the function to Win32/OS2 as I can't test there, but it shouldn't be hard! Once all platforms have this we can remove another of the raw sockaddr references in http_core. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60632 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 7 +++++++ network_io/beos/sockopt.c | 19 +++++++++++++++++++ network_io/unix/sockopt.c | 18 ++++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index f427633cb26..3fc1858c0da 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -221,6 +221,13 @@ apr_status_t apr_connect(apr_socket_t *sock, const char *hostname); */ apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock); +/** + * Get name of the local machine via it's ip address. + * @param name A buffer to store the hostname in. + * @param sock The socket to examine. + */ +apr_status_t apr_get_local_hostname(char **name, apr_socket_t *sock); + /** * Get name of the current machine * @param buf A buffer to store the hostname in. diff --git a/network_io/beos/sockopt.c b/network_io/beos/sockopt.c index d6d3656e622..fe3086fd2e3 100644 --- a/network_io/beos/sockopt.c +++ b/network_io/beos/sockopt.c @@ -144,6 +144,25 @@ apr_status_t apr_gethostname(char * buf, int len, apr_pool_t *cont) } } +apr_status_t apr_get_local_hostname(char **name, apr_socket_t *sock) +{ + struct hostent *hptr; + + hptr = gethostbyaddr((char *)&(sock->local_addr->sin_addr), + sizeof(struct in_addr), AF_INET); + if (hptr != NULL) { + *name = apr_pstrdup(sock->cntxt, hptr->h_name); + if (*name) { + return APR_SUCCESS; + } + return APR_ENOMEM; + } + + /* XXX - Is this threadsafe? - manoj */ + /* on BeOS h_errno is a global... */ + return h_errno; +} + apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) { struct hostent *hptr; diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 0997b67a3c6..a8ed8bbfe1b 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -220,3 +220,21 @@ apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) return (h_errno + APR_OS_START_SYSERR); } +apr_status_t apr_get_local_hostname(char **name, apr_socket_t *sock) +{ + struct hostent *hptr; + + hptr = gethostbyaddr((char *)&(sock->local_addr->sin_addr), + sizeof(struct in_addr), AF_INET); + if (hptr != NULL) { + *name = apr_pstrdup(sock->cntxt, hptr->h_name); + if (*name) { + return APR_SUCCESS; + } + return APR_ENOMEM; + } + + /* XXX - Is referencing h_errno threadsafe? */ + return (h_errno + APR_OS_START_SYSERR); +} + From 4d02cdd06e4aeea6b8bda898ac4cd697b8d65f31 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Fri, 3 Nov 2000 19:55:27 +0000 Subject: [PATCH 0655/7878] Change the always use the beos MPM. In a couple of days I'll remove mpmt_beos. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60633 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hints.m4 b/hints.m4 index 1a18f5f995b..fa459ca6375 100644 --- a/hints.m4 +++ b/hints.m4 @@ -373,18 +373,17 @@ dnl ;; ;; *beos*) APR_SETIFNULL(CFLAGS, [-DBEOS]) + APR_SETVAR(APACHE_MPM, [beos]) PLATOSVERS=`uname -r` case $PLATOSVERS in 5.1) APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) APR_ADDTO(LDFLAGS, [-nodefaultlibs -L/boot/develop/lib/x86 -L/boot/beos/system/lib]) APR_SETIFNULL(EXTRA_LIBS, [-lbind -lsocket -lbe -lroot]) - APR_SETVAR(APACHE_MPM, [beos]) APR_SETIFNULL(file_as_socket, [1]) ;; default) APR_SETIFNULL(file_as_socket, [0]) - APR_SETVAR(APACHE_MPM, [mpmt_beos]) ;; esac ;; From a100ffce35dba1901dc98d66742bfa079133cf3e Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 4 Nov 2000 16:34:50 +0000 Subject: [PATCH 0656/7878] Make non-blocking reads from pipes work through the bucket interface. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60634 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/pipe.c | 7 +++++++ include/apr_file_io.h | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 24cc5f5f26b..a6697f3989d 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -145,6 +145,13 @@ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeo return APR_EINVAL; } +apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) +{ + if (thepipe->pipe == 1) { + *timeout = thepipe->timeout; + } +} + apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) { int filedes[2]; diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 4dcc30e54ad..29ede201f7b 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -594,6 +594,14 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, apr_pool_t *cont); +/** + * Get the timeout value for a pipe or manipulate the blocking state. + * @param thepipe The pipe we are getting a timeout for. + * @param timeoutThe timeout value in microseconds. Values < 0 mean wait + * forever, 0 means do not wait at all. + */ +apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout); + /** * Set the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are setting a timeout on. From 6a552239ccf478fa693d85df7a1b434023b673a3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 5 Nov 2000 06:09:09 +0000 Subject: [PATCH 0657/7878] Fix a bit of docs with the new pipe timeout code. Submitted by: Chris Pepper <pepper@mail.reppep.com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60635 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 29ede201f7b..2d827e1e592 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -597,15 +597,14 @@ apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, /** * Get the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are getting a timeout for. - * @param timeoutThe timeout value in microseconds. Values < 0 mean wait - * forever, 0 means do not wait at all. + * @param timeout The current timeout value in microseconds. */ apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout); /** * Set the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are setting a timeout on. - * @param timeoutThe timeout value in microseconds. Values < 0 mean wait + * @param timeout The timeout value in microseconds. Values < 0 mean wait * forever, 0 means do not wait at all. */ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout); From a63cd3c8639a4a10bf15ac689463889f5d0e3465 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Mon, 6 Nov 2000 14:19:00 +0000 Subject: [PATCH 0658/7878] This commit adds the start of IPv6 support. Before we all get too excited, please note that it doesn't do anything at present. All this adds is the configure checks and a few variables that will be used by the code. Can anyone on an IPv6 system please see how these work and report any problems so we can refine our plans before we submit the next patch? Thanks. Systems tested so far are FreeBSD 4, Mandrake 7 and Solaris 8. Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60636 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 15 +++++++++++++- include/apr.h.in | 2 ++ 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index 2e72fc32b3d..a9a910a64c1 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -343,5 +343,59 @@ else fi ]) +AC_DEFUN(APR_CHECK_SOCKADDR_IN6,[ +AC_CACHE_CHECK(for sockaddr_in6, ac_cv_define_sockaddr_in6,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +],[ +struct sockaddr_in6 sa; +],[ + ac_cv_define_sockaddr_in6=yes +],[ + ac_cv_define_sockaddr_in6=no +]) +]) + +if test "$ac_cv_define_sockaddr_in6" = "yes"; then + have_sockaddr_in6=1 +else + have_sockaddr_in6=0 +fi +]) + +# +# Check to see if this platform includes sa_len in it's +# struct sockaddr. If it does it changes the length of sa_family +# which could cause us problems +# +AC_DEFUN(APR_CHECK_SOCKADDR_SA_LEN,[ +AC_CACHE_CHECK(for sockaddr sa_len, ac_cv_define_sockaddr_sa_len,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +],[ +struct sockaddr_in sai; +int i = sai.sin_len; +],[ + ac_cv_define_sockaddr_sa_len=yes +],[ + ac_cv_define_sockaddr_sa_len=no +]) +]) + +if test "$ac_cv_define_sockaddr_sa_len" = "yes"; then + AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1 ,[Define if we have length field in sockaddr_in]) +fi +]) + sinclude(apr_common.m4) sinclude(hints.m4) diff --git a/configure.in b/configure.in index 4b2913ca027..5bb7b2a043e 100644 --- a/configure.in +++ b/configure.in @@ -699,8 +699,21 @@ fi AC_SUBST(have_in_addr) AC_SUBST(file_as_socket) +AC_CHECK_FUNCS(inet_pton) +AC_CHECK_FUNCS(inet_ntop) +APR_CHECK_SOCKADDR_SA_LEN + APR_CHECK_GETHOSTBYNAME_NAS +echo "${nl}IPv6 Networking support??" +dnl # Start of checking for IPv6 support... +AC_SEARCH_LIBS(getaddrinfo, inet6) +AC_CHECK_FUNCS(getaddrinfo) +AC_CHECK_FUNCS(getipnodebyname) +AC_CHECK_FUNCS(getipnodebyaddr) +APR_CHECK_SOCKADDR_IN6 +AC_SUBST(have_sockaddr_in6) + dnl #----------------------------- Construct the files AC_SUBST(LDLIBS) @@ -715,7 +728,7 @@ AC_SUBST(EXEEXT) AC_SUBST(THREAD_CPPFLAGS) AC_SUBST(THREAD_CFLAGS) -echo "Construct Makefiles and header files." +echo "${nl}${nl}Construct Makefiles and header files." MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile" SUBDIRS="lib strings passwd tables " for dir in $MODULES diff --git a/include/apr.h.in b/include/apr.h.in index 57ff271c0ba..229d2c796d7 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -74,6 +74,8 @@ #define APR_HAVE_STRSTR @have_strstr@ #define APR_HAVE_MEMMOVE @have_memmove@ #define APR_HAVE_BZERO @have_bzero@ +#define APR_HAVE_V6 @have_sockaddr_in6@ + #if APR_HAVE_SYS_TYPES_H #include <sys/types.h> From 7a54d1c8ed43cd6efd1f76f20e403064eb9d7cba Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 6 Nov 2000 16:29:54 +0000 Subject: [PATCH 0659/7878] apr_get_pipe_timeout() needs to specify a return code git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60637 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/pipe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index a6697f3989d..f5bf550fd2f 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -149,7 +149,9 @@ apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *time { if (thepipe->pipe == 1) { *timeout = thepipe->timeout; + return APR_SUCCESS; } + return APR_EINVAL; } apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) From 811bdaf113f817003869e943d2ce5f66ba7aa877 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 6 Nov 2000 18:04:24 +0000 Subject: [PATCH 0660/7878] I've committed this document so that others (esp. Mac OS X, NetWare, OS2, etc) can refine the observations about their platforms' path processing behavior. Why html? Next revision from me will define the Win32/OS2 pseudo-code in an alternate style, to highlight differences and discrepancies. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60638 13f79535-47bb-0310-9956-ffa450edef68 --- docs/canonical_filenames.html | 151 ++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 docs/canonical_filenames.html diff --git a/docs/canonical_filenames.html b/docs/canonical_filenames.html new file mode 100644 index 00000000000..39515198679 --- /dev/null +++ b/docs/canonical_filenames.html @@ -0,0 +1,151 @@ +<h1>Canonical Filename</h1> + +<h2>Requirements</h2> + +<p>APR porters need to address the underlying discrepancies between +file systems. To achieve a reasonable degree of security, the +program depending upon APR needs to know that two paths may be +compared, and that a mismatch is guarenteed to reflect that the +two paths do not return the same resource</p>. + +<p>The first discrepancy is in volume roots. Unix and pure deriviates +have only one root path, "/". Win32 and OS2 share root paths of +the form "D:/", D: is the volume designation. However, this can +be specified as "//./D:/" as well, indicating D: volume of the +'this' machine. Win32 and OS2 also may employ a UNC root path, +of the form "//server/share/" where share is a share-point of the +specified network server. Finally, NetWare root paths are of the +form "server/volume:/", or the simpler "volume:/" syntax for 'this' +machine. All these non-Unix file systems accept volume:path, +without a slash following the colon, as a path relative to the +current working directory, which APR will treat as ambigious, that +is, neither an absolute nor a relative path per se.</p> + +<p>The second discrepancy is in the meaning of the 'this' directory. +In general, 'this' must be eliminated from the path where it occurs. +The syntax "path/./" and "path/" are both aliases to path. However, +this isn't file system independent, since the double slash "//" has +a special meaning on OS2 and Win32 at the start of the path name, +and is invalid on those platforms before the "//server/share/" UNC +root path is completed. Finally, as noted above, "//./volume/" is +legal root syntax on WinNT, and perhaps others.</p> + +<p>The third discrepancy is in the context of the 'parent' directory. +When "parent/path/.." occurs, the path must be unwound to "parent". +It's also critical to simply truncate leading "/../" paths to "/", +since the parent of the root is root. This gets tricky on the +Win32 and OS2 platforms, since the ".." element is invalid before +the "//server/share/" is complete, and the "//server/share/../" +seqence is the complete UNC root "//server/share/". In relative +paths, leading ".." elements are significant, until they are merged +with an absolute path. The relative form must only retain the ".." +segments as leading segments, to be resolved once merged to another +relative or an absolute path.</p> + +<p>The fourth discrepancy occurs with acceptance of alternate character +codes for the same element. Path seperators are not retained within +the APR canonical forms. The OS filesystem and APR (slashed) forms +can both be returned as strings, to be used in the proper context. +Unix, Win32 and Netware all accept slashes and backslashes as the +same path seperator symbol, although unix strictly accepts slashes. +While the APR form of the name strictly uses slashes, always consider +that there could be a platform that actually accepts slashes as a +character within a segment name.</p> + +<p>The fifth and worst discrepancy plauges Win32, OS2, Netware, and some +filesystems mounted in Unix. Case insensitivity can permit the same +file to slip through in both it's proper case and alternate cases. +Simply changing the case is insufficient for any character set beyond +ASCII, since various dilectic forms of characters suffer from one to +many or many to one translations. An example would be u-umlaut, which +might be accepted as a single character u-umlaut, a two character +sequence u and the zero-width umlaut, the upper case form of the same, +or perhaps even a captial U alone. This can be handled in different +ways depending on the purposes of the APR based program, but the one +requirement is that the path must be absolute in order to resolve these +ambiguities. Methods employed include comparison of device and inode +file uniqifiers, which is a fairly fast operation, or quering the OS +for the true form of the name, which can be much slower. Only the +acknowledgement of the file names by the OS can validate the equality +of two different cases of the same filename.</p> + +<p>The sixth discrepancy, illegal or insignificant characters, is especially +significant in non-unix file systems. Trailing periods are accepted +but never stored, therefore trailing periods must be ignored for any +form of comparison. And all OS's have certain expectations of what +characters are illegal (or undesireable due to confusion.)</p> + +<p>A final warning, canonical functions don't transform or resolve case +or character ambiguity issues until they are resolved into an absolute +path. The relative canonical path, while useful, while useful for URL +or similar identifiers, cannot be used for testing or comparison of file +system objects.</p> + +<hr> + +<h2>Canonical API</h2> + +Functions to manipulate the apr_canon_file_t (an opaque type) include: + +<ul> +<li>Create canon_file_t (from char* path and canon_file_t parent path) +<li>Merged canon_file_t (from path and parent, both canon_file_t) +<li>Get char* path of all or some segments +<li>Get path flags of IsRelative, IsVirtualRoot, and IsAbsolute +<li>Compare two canon_file_t structures for file equality +</ul> + +<p>The path is corrected to the file system case only if is in absolute +form. The apr_canon_file_t should be preserved as long as possible and +used as the parent to create child entries to reduce the number of expensive +stat and case canonicalization calls to the OS.</p> + +<p>The comparison operation provides that the APR can postpone correction +of case by simply relying upon the device and inode for equivilance. The +stat implementation provides that two files are the same, while their +strings are not equivilant, and eliminates the need for the operating +system to return the proper form of the name.</p> + +<p>In any case, returning the char* path, with a flag to request the proper +case, forces the OS calls to resolve the true names of each segment. Where +there is a penality for this operation and the stat device and inode test +is faster, case correction is postponed until the char* result is requested. +On platforms that identify the inode, device, or proper name interchangably +with no penalities, this may occur when the name is initially processed.</p> + +<hr> + +<h2>Unix Example</h2> + +<p>First the simplest case:</p> + +<pre> +Parse Canonical Name +accepts parent path as canonical_t + this path as string + +Split this path Segments on '/' + +For each of this path Segments + If first Segment + If this Segment is Empty ([nothing]/) + Append this Root Segment (don't merge) + Continue to next Segment + Else is relative + Append parent Segments (to merge) + Continue with this Segment + If Segment is '.' or empty (2 slashes) + Discard this Segment + Continue with next Segment + If Segment is '..' + If no previous Segment or previous Segment is '..' + Append this Segment + Continue with next Segment + If previous Segment and previous is not Root Segment + Discard previous Segment + Discard this Segment + Continue with next Segment + Append this Relative Segment + Continue with next Segment +</pre> + From ac874c65502a7f77cc4f3f794e8e7fc4ad12212e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 6 Nov 2000 20:58:50 +0000 Subject: [PATCH 0661/7878] Make this respectable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60639 13f79535-47bb-0310-9956-ffa450edef68 --- docs/canonical_filenames.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/canonical_filenames.html b/docs/canonical_filenames.html index 39515198679..10867d3796e 100644 --- a/docs/canonical_filenames.html +++ b/docs/canonical_filenames.html @@ -1,4 +1,7 @@ -<h1>Canonical Filename</h1> +<HTML> +<HEAD><TITLE>APR Canonical Filenames</TITLE></HEAD> +<BODY> +<h1>APR Canonical Filename</h1> <h2>Requirements</h2> @@ -149,3 +152,5 @@ <h2>Unix Example</h2> Continue with next Segment </pre> +</BODY> +</HTML> \ No newline at end of file From 87f6f7ae92171e9e226661aa43d7bc12ed94ed45 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Tue, 7 Nov 2000 01:27:14 +0000 Subject: [PATCH 0662/7878] *) A successful call to ReadFile() with 0 bytes read indicates EOF. Return APR_EOF as appropriate. This fixes the unbuffered branch of apr_read() to ensure that apr_read() will eventually return APR_EOF. Compensate in the buffered branch since read_with_timeout() now handles the APR_EOF return. *) Initialize 'rv' before use in apr_write() Submitted by: Branko Cibej <brane@xbc.nu> Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60640 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index e07b4f2ba16..0d5a6ad5a52 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -139,7 +139,11 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_ssize_t l rv = APR_SUCCESS; /* APR_EOF? */ } } else { - rv = APR_SUCCESS; + /* OK and 0 bytes read ==> end of file */ + if (*nbytes == 0) + rv = APR_EOF; + else + rv = APR_SUCCESS; } return rv; } @@ -186,10 +190,8 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *len) rv = read_with_timeout(thefile, thefile->buffer, APR_FILE_BUFSIZE, &thefile->dataRead); if (thefile->dataRead == 0) { - if (rv == APR_SUCCESS) { + if (rv == APR_EOF) thefile->eof_hit = TRUE; - rv = APR_EOF; - } break; } @@ -240,6 +242,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes thefile->direction = 1; } + rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full rv = apr_flush(thefile); From 3177e1826136c67305f9d293b61f259c479e7035 Mon Sep 17 00:00:00 2001 From: Bill Stoddard <stoddard@apache.org> Date: Tue, 7 Nov 2000 14:56:03 +0000 Subject: [PATCH 0663/7878] Add apr_get_pipe_timeout to win32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60641 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 12 ++++++------ file_io/win32/pipe.c | 16 ++++++++++++++-- libapr.def | 12 ++++++------ 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/aprlib.def b/aprlib.def index 11abe3c5374..d552cdcdeac 100644 --- a/aprlib.def +++ b/aprlib.def @@ -223,12 +223,12 @@ EXPORTS apr_get_remote_port @214 apr_set_remote_port @215 apr_open_stderr @216 - apr_set_pipe_timeout @217 - apr_terminate @218 - apr_dso_load @219 - apr_dso_unload @220 - apr_dso_sym @221 -; apr_dso_init @222 + apr_get_pipe_timeout @217 + apr_set_pipe_timeout @218 + apr_terminate @219 + apr_dso_load @220 + apr_dso_unload @221 + apr_dso_sym @222 apr_collapse_spaces @223 apr_month_snames @224 apr_day_snames @225 diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 2836f893df6..5e37916b08b 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -65,8 +65,20 @@ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) { - thepipe->timeout = timeout; - return APR_SUCCESS; + if (thepipe->pipe == 1) { + thepipe->timeout = timeout; + return APR_SUCCESS; + } + return APR_EINVAL; +} + +apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) +{ + if (thepipe->pipe == 1) { + *timeout = thepipe->timeout; + return APR_SUCCESS; + } + return APR_EINVAL; } apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p) diff --git a/libapr.def b/libapr.def index 11abe3c5374..d552cdcdeac 100644 --- a/libapr.def +++ b/libapr.def @@ -223,12 +223,12 @@ EXPORTS apr_get_remote_port @214 apr_set_remote_port @215 apr_open_stderr @216 - apr_set_pipe_timeout @217 - apr_terminate @218 - apr_dso_load @219 - apr_dso_unload @220 - apr_dso_sym @221 -; apr_dso_init @222 + apr_get_pipe_timeout @217 + apr_set_pipe_timeout @218 + apr_terminate @219 + apr_dso_load @220 + apr_dso_unload @221 + apr_dso_sym @222 apr_collapse_spaces @223 apr_month_snames @224 apr_day_snames @225 From d5cbec73c5640f05c59fff9789b67bce8959443e Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 7 Nov 2000 20:21:48 +0000 Subject: [PATCH 0664/7878] Convert a lot of apr_ssize_t to apr_size_t. We don't ever accept or return signed values in these integers, and we return the error codes directly, so we should always report the number of bytes read/written correctly. If we have an error, that is 0 bytes. If that is true, then using signed values doesn't make any sense. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60642 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 10 +++++----- file_io/unix/dir.c | 4 ++-- file_io/unix/readwrite.c | 16 ++++++++-------- file_io/win32/readwrite.c | 20 ++++++++++---------- include/apr_file_io.h | 8 ++++---- include/apr_network_io.h | 8 ++++---- network_io/beos/sendrecv.c | 6 +++--- network_io/os2/sendrecv.c | 4 ++-- network_io/unix/sendrecv.c | 20 ++++++++++---------- network_io/win32/sendrecv.c | 8 ++++---- 10 files changed, 52 insertions(+), 52 deletions(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 4794232c767..d4816c50ad4 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -62,7 +62,7 @@ #include <os2.h> #include <malloc.h> -apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *nbytes) +apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) { ULONG rc = 0; ULONG bytesread; @@ -138,7 +138,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *nbytes) -apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes) +apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { ULONG rc = 0; ULONG byteswritten; @@ -194,7 +194,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes #ifdef HAVE_WRITEV -apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_ssize_t *nbytes) +apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { int bytes; if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { @@ -266,7 +266,7 @@ apr_status_t apr_getc(char *ch, apr_file_t *thefile) apr_status_t apr_puts(const char *str, apr_file_t *thefile) { - apr_ssize_t len; + apr_size_t len; len = strlen(str); return apr_write(thefile, str, &len); @@ -301,7 +301,7 @@ apr_status_t apr_flush(apr_file_t *thefile) apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) { - ssize_t readlen; + size_t readlen; apr_status_t rv = APR_SUCCESS; int i; diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index bfbf85ab384..419c2f88112 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -163,7 +163,7 @@ apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) } } -apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir) +apr_status_t apr_dir_entry_size(apr_size_t *size, apr_dir_t *thedir) { struct stat filestat; char *fname = NULL; @@ -175,7 +175,7 @@ apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir) fname = apr_pstrcat(thedir->cntxt, thedir->dirname, "/", thedir->entry->d_name, NULL); if (stat(fname, &filestat) == -1) { - *size = -1; + *size = 0; return errno; } diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index a9da3b07153..57a950d2513 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -101,10 +101,10 @@ static apr_status_t wait_for_io_or_timeout(apr_file_t *file, int for_read) /* problems: * 1) ungetchar not used for buffered files */ -apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *nbytes) +apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) { apr_ssize_t rv; - apr_ssize_t bytes_read; + apr_size_t bytes_read; if (*nbytes <= 0) { *nbytes = 0; @@ -205,7 +205,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *nbytes) } } -apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes) +apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { apr_size_t rv; @@ -277,7 +277,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes } apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, - apr_size_t nvec, apr_ssize_t *nbytes) + apr_size_t nvec, apr_size_t *nbytes) { #ifdef HAVE_WRITEV int bytes; @@ -298,7 +298,7 @@ apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_status_t apr_putc(char ch, apr_file_t *thefile) { - apr_ssize_t nbytes = 1; + apr_size_t nbytes = 1; return apr_write(thefile, &ch, &nbytes); } @@ -311,14 +311,14 @@ apr_status_t apr_ungetc(char ch, apr_file_t *thefile) apr_status_t apr_getc(char *ch, apr_file_t *thefile) { - apr_ssize_t nbytes = 1; + apr_size_t nbytes = 1; return apr_read(thefile, ch, &nbytes); } apr_status_t apr_puts(const char *str, apr_file_t *thefile) { - apr_ssize_t nbytes = strlen(str); + apr_size_t nbytes = strlen(str); return apr_write(thefile, str, &nbytes); } @@ -348,7 +348,7 @@ apr_status_t apr_flush(apr_file_t *thefile) apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) { apr_status_t rv = APR_SUCCESS; /* get rid of gcc warning */ - apr_ssize_t nbytes; + apr_size_t nbytes; char *final = str + len - 1; if (len <= 1) { diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 0d5a6ad5a52..02c1e4a8c42 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -65,7 +65,7 @@ * read_with_timeout() * Uses async i/o to emulate unix non-blocking i/o with timeouts. */ -static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_ssize_t len, apr_ssize_t *nbytes) +static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t len, apr_size_t *nbytes) { apr_status_t rv; *nbytes = 0; @@ -148,9 +148,9 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_ssize_t l return rv; } -apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *len) +apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *len) { - apr_ssize_t rv; + apr_size_t rv; DWORD bytes_read = 0; if (*len <= 0) { @@ -172,8 +172,8 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *len) } if (thefile->buffered) { char *pos = (char *)buf; - apr_ssize_t blocksize; - apr_ssize_t size = *len; + apr_size_t blocksize; + apr_size_t size = *len; apr_lock(thefile->mutex); @@ -213,7 +213,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *len) apr_unlock(thefile->mutex); } else { /* Unbuffered i/o */ - apr_ssize_t nbytes; + apr_size_t nbytes; rv = read_with_timeout(thefile, buf, *len, &nbytes); *len = nbytes; } @@ -221,7 +221,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *len) return rv; } -apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes) +apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { apr_status_t rv; DWORD bwrote; @@ -235,7 +235,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes if (thefile->direction == 0) { // Position file pointer for writing at the offset we are logically reading from - apr_ssize_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + apr_size_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; if (offset != thefile->filePtr) SetFilePointer(thefile->filehand, offset, NULL, FILE_BEGIN); thefile->bufpos = thefile->dataRead = 0; @@ -276,7 +276,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes * Too bad WriteFileGather() is not supported on 95&98 (or NT prior to SP2) */ apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, - apr_ssize_t *nbytes) + apr_size_t *nbytes) { apr_status_t rv = APR_SUCCESS; int i; @@ -337,7 +337,7 @@ apr_status_t apr_puts(const char *str, apr_file_t *thefile) apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) { - apr_ssize_t readlen; + apr_size_t readlen; apr_status_t rv = APR_SUCCESS; int i; diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 2d827e1e592..999138a550d 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -357,7 +357,7 @@ apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont); * * APR_EINTR is never returned. */ -apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *nbytes); +apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes); /** * Write data to the specified file. @@ -373,7 +373,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *nbytes); * * APR_EINTR is never returned. */ -apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes); +apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes); /** * Write data from iovec array to the specified file. @@ -391,7 +391,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes * doesn't provide writev(). */ apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, - apr_size_t nvec, apr_ssize_t *nbytes); + apr_size_t nvec, apr_size_t *nbytes); /** * Read data from the specified file. @@ -648,7 +648,7 @@ apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key, * @param size the size of the directory entry. * @param thedir the currently open directory. */ -apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir); +apr_status_t apr_dir_entry_size(apr_size_t *size, apr_dir_t *thedir); /** * Get the last modified time of the current directory entry. diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 3fc1858c0da..559908d9db7 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -271,7 +271,7 @@ apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, * APR_EINTR is never returned. * </PRE> */ -apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len); +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len); /** * Send multiple packets of data over a network. @@ -291,7 +291,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len); * </PRE> */ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, - apr_int32_t nvec, apr_ssize_t *len); + apr_int32_t nvec, apr_size_t *len); #if APR_HAS_SENDFILE /** @@ -308,7 +308,7 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, * The number of bytes actually sent is stored in argument 5. */ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, - apr_off_t *offset, apr_ssize_t *len, apr_int32_t flags); + apr_off_t *offset, apr_size_t *len, apr_int32_t flags); #endif /** @@ -329,7 +329,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr * APR_EINTR is never returned. * </PRE> */ -apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len); +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len); /** * Setup socket options for the specified socket diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 600df667871..ec96869fd02 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -92,7 +92,7 @@ static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) return APR_SUCCESS; } -apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { ssize_t rv; @@ -120,7 +120,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) return APR_SUCCESS; } -apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) { apr_ssize_t rv; @@ -151,7 +151,7 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) /* BeOS doesn't have writev for sockets so we use the following instead... */ apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, - apr_int32_t nvec, apr_ssize_t *len) + apr_int32_t nvec, apr_size_t *len) { *len = vec[0].iov_len; return apr_send(sock, vec[0].iov_base, len); diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index 81a281e4dc8..6e2a66a4262 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -59,7 +59,7 @@ #include "apr_lib.h" #include <sys/time.h> -apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { ssize_t rv; int fds, err = 0; @@ -98,7 +98,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) -apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) { ssize_t rv; int fds, err = 0; diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index d6ed913d094..6276bee23d3 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -101,7 +101,7 @@ static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) return APR_SUCCESS; } -apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { ssize_t rv; @@ -130,7 +130,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) return APR_SUCCESS; } -apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) { ssize_t rv; @@ -164,7 +164,7 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) #ifdef HAVE_WRITEV apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, - apr_int32_t nvec, apr_ssize_t *len) + apr_int32_t nvec, apr_size_t *len) { apr_ssize_t rv; @@ -251,7 +251,7 @@ static int os_uncork(apr_socket_t *sock, int delayflag) } apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, - apr_hdtr_t *hdtr, apr_off_t *offset, apr_ssize_t *len, + apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags) { off_t off = *offset; @@ -382,7 +382,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, /* Release 3.1 or greater */ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_ssize_t * len, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, apr_int32_t flags) { off_t nbytes; @@ -475,7 +475,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, /* HP-UX Version 10.30 or greater */ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_ssize_t * len, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, apr_int32_t flags) { int i, ptr = 0; @@ -582,7 +582,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, * OS/390 - V2R7 and above */ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_ssize_t * len, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, apr_int32_t flags) { int i, ptr, rv = 0; @@ -711,7 +711,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, * all cases of the headers and trailers seems to be a good idea. */ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_ssize_t * len, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, apr_int32_t flags) { off_t nbytes = 0; @@ -728,7 +728,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, flags = 0; if (hdtr->numheaders > 0) { - apr_ssize_t hdrbytes = 0; + apr_size_t hdrbytes = 0; arv = apr_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); if (arv != APR_SUCCESS) { @@ -796,7 +796,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, nbytes += rv; if (hdtr->numtrailers > 0) { - apr_ssize_t trlbytes = 0; + apr_size_t trlbytes = 0; /* send the trailers now */ arv = apr_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trlbytes); diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index f8e32e55cf1..8677d653a1a 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -70,7 +70,7 @@ * of data. */ #define MAX_SEGMENT_SIZE 65536 -apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { apr_ssize_t rv; WSABUF wsaData; @@ -91,7 +91,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) return APR_SUCCESS; } -apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) { apr_ssize_t rv; WSABUF wsaData; @@ -179,7 +179,7 @@ static void collapse_iovec(char **buf, int *len, struct iovec *iovec, int numvec /* * apr_status_t apr_sendfile(apr_socket_t *, apr_file_t *, apr_hdtr_t *, - * apr_off_t *, apr_ssize_t *, apr_int32_t flags) + * apr_off_t *, apr_size_t *, apr_int32_t flags) * Send a file from an open file descriptor to a socket, along with * optional headers and trailers * arg 1) The socket to which we're writing @@ -190,7 +190,7 @@ static void collapse_iovec(char **buf, int *len, struct iovec *iovec, int numvec * arg 6) APR flags that are mapped to OS specific flags */ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_ssize_t * len, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, apr_int32_t flags) { apr_status_t status = APR_SUCCESS; From 864db237ac605ab245a6c66cf86f053955888ecb Mon Sep 17 00:00:00 2001 From: Tony Finch <fanf@apache.org> Date: Wed, 8 Nov 2000 00:54:23 +0000 Subject: [PATCH 0665/7878] Use the right index into the new array whan resizing the hash table. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60643 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index d0c9f01dec6..f8ab43fa27a 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -191,7 +191,7 @@ static void expand_array(apr_hash_t *ht) new_max = ht->max * 2 + 1; new_array = alloc_array(ht, new_max); for (hi = apr_hash_first(ht); hi; hi = apr_hash_next(hi)) { - i = hi->this->hash & ht->max; + i = hi->this->hash & new_max; hi->this->next = new_array[i]; new_array[i] = hi->this; } From b6d37d00a0455ab9f6f56cba14dc684c39f2df1d Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Wed, 8 Nov 2000 11:00:04 +0000 Subject: [PATCH 0666/7878] This adds the apr_port_t type to APR and should change all references in the APR code that use it. Next up is the apache code and the test programs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60644 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 14 +++++++++----- network_io/beos/sockaddr.c | 12 ++++++------ network_io/unix/sockaddr.c | 12 ++++++------ network_io/win32/sockaddr.c | 12 ++++++------ 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 559908d9db7..4023fe06532 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -126,7 +126,11 @@ struct in_addr { typedef struct apr_socket_t apr_socket_t; typedef struct apr_pollfd_t apr_pollfd_t; typedef struct apr_hdtr_t apr_hdtr_t; -typedef struct in_addr apr_in_addr; +typedef struct in_addr apr_in_addr; + +/* use apr_uint16_t just in case some system has a short that isn't 16 bits... */ +typedef apr_uint16_t apr_port_t; + #if APR_HAS_SENDFILE /* Define flags passed in on apr_sendfile() */ @@ -385,7 +389,7 @@ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t* * that this socket is going to use this port if possible. If * the port is already used, we won't find out about it here. */ -apr_status_t apr_set_local_port(apr_socket_t *sock, apr_uint32_t port); +apr_status_t apr_set_local_port(apr_socket_t *sock, apr_port_t port); /** * Associate a remote port with a socket. @@ -394,21 +398,21 @@ apr_status_t apr_set_local_port(apr_socket_t *sock, apr_uint32_t port); * @tip This does not make a connection to the remote port, it is just * telling apr which port apr_connect() should attempt to connect to. */ -apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_uint32_t port); +apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_port_t port); /** * Return the local port with a socket. * @param port The local port this socket is associated with. * @param sock The socket to enquire about. */ -apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock); +apr_status_t apr_get_local_port(apr_port_t *port, apr_socket_t *sock); /** * Return the remote port associated with a socket. * @param port The remote port this socket is associated with. * @param sock The socket to enquire about. */ -apr_status_t apr_get_remote_port(apr_uint32_t *port, apr_socket_t *sock); +apr_status_t apr_get_remote_port(apr_port_t *port, apr_socket_t *sock); /** * Associate a local socket addr with an apr socket. diff --git a/network_io/beos/sockaddr.c b/network_io/beos/sockaddr.c index 699b95ad8be..75c2e5ee270 100644 --- a/network_io/beos/sockaddr.c +++ b/network_io/beos/sockaddr.c @@ -58,25 +58,25 @@ #else #include "networkio.h" -apr_status_t apr_set_local_port(apr_socket_t *sock, apr_uint32_t port) +apr_status_t apr_set_local_port(apr_socket_t *sock, apr_port_t port) { if (!sock) { return APR_EBADF; } - sock->local_addr->sin_port = htons((short)port); + sock->local_addr->sin_port = htons(port); return APR_SUCCESS; } -apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_uint32_t port) +apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_port_t port) { if (!sock) { return APR_EBADF; } - sock->remote_addr->sin_port = htons((short)port); + sock->remote_addr->sin_port = htons(port); return APR_SUCCESS; } -apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock) +apr_status_t apr_get_local_port(apr_port_t *port, apr_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -85,7 +85,7 @@ apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock) return APR_SUCCESS; } -apr_status_t apr_get_remote_port(apr_uint32_t *port, apr_socket_t *sock) +apr_status_t apr_get_remote_port(apr_port_t *port, apr_socket_t *sock) { if (!sock) { return APR_EBADF; diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 08489a567c0..70c81c390cc 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -55,17 +55,17 @@ #include "networkio.h" #include "apr_strings.h" -apr_status_t apr_set_local_port(apr_socket_t *sock, apr_uint32_t port) +apr_status_t apr_set_local_port(apr_socket_t *sock, apr_port_t port) { - sock->local_addr->sin_port = htons((short)port); + sock->local_addr->sin_port = htons(port); return APR_SUCCESS; } -apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_uint32_t port) +apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_port_t port) { - sock->remote_addr->sin_port = htons((short)port); + sock->remote_addr->sin_port = htons(port); return APR_SUCCESS; } @@ -87,7 +87,7 @@ static apr_status_t get_local_addr(apr_socket_t *sock) -apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock) +apr_status_t apr_get_local_port(apr_port_t *port, apr_socket_t *sock) { if (sock->local_port_unknown) { apr_status_t rv = get_local_addr(sock); @@ -103,7 +103,7 @@ apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock) -apr_status_t apr_get_remote_port(apr_uint32_t *port, apr_socket_t *sock) +apr_status_t apr_get_remote_port(apr_port_t *port, apr_socket_t *sock) { *port = ntohs(sock->remote_addr->sin_port); return APR_SUCCESS; diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index e72140ffc8f..82915f44dc5 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -74,23 +74,23 @@ static apr_status_t get_local_addr(apr_socket_t *sock) -apr_status_t apr_set_local_port(apr_socket_t *sock, apr_uint32_t port) +apr_status_t apr_set_local_port(apr_socket_t *sock, apr_port_t port) { - sock->local_addr->sin_port = htons((short)port); + sock->local_addr->sin_port = htons(port); return APR_SUCCESS; } -apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_uint32_t port) +apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_port_t port) { - sock->remote_addr->sin_port = htons((short)port); + sock->remote_addr->sin_port = htons(port); return APR_SUCCESS; } -apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock) +apr_status_t apr_get_local_port(apr_port_t *port, apr_socket_t *sock) { if (sock->local_port_unknown) { apr_status_t rv = get_local_addr(sock); @@ -106,7 +106,7 @@ apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock) -apr_status_t apr_get_remote_port(apr_uint32_t *port, apr_socket_t *sock) +apr_status_t apr_get_remote_port(apr_port_t *port, apr_socket_t *sock) { *port = ntohs(sock->remote_addr->sin_port); return APR_SUCCESS; From 664b4e6f13d4a70d280fb9cfda8c3fe363ca8467 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Wed, 8 Nov 2000 11:02:13 +0000 Subject: [PATCH 0667/7878] Change to apr_port_t to remove compiler warnings and bring us up to date. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60645 13f79535-47bb-0310-9956-ffa450edef68 --- test/client.c | 2 +- test/server.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/client.c b/test/client.c index 64ca1f6121f..5949deddd98 100644 --- a/test/client.c +++ b/test/client.c @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) char msgbuf[80]; char *local_ipaddr, *remote_ipaddr; char *dest = "127.0.0.1"; - apr_uint32_t local_port, remote_port; + apr_port_t local_port, remote_port; apr_interval_time_t read_timeout = -1; setbuf(stdout, NULL); diff --git a/test/server.c b/test/server.c index 77637db5db1..566dd4fa297 100644 --- a/test/server.c +++ b/test/server.c @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) char datasend[STRLEN]; char datarecv[STRLEN] = "Recv data test"; char *local_ipaddr, *remote_ipaddr; - apr_uint32_t local_port, remote_port; + apr_port_t local_port, remote_port; fprintf(stdout, "Initializing........."); if (apr_initialize() != APR_SUCCESS) { From 44efcc2e5cba3d734257e9f38e1066c2fc3956c3 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Wed, 8 Nov 2000 11:53:28 +0000 Subject: [PATCH 0668/7878] Chnage the define for IPv6 to APR_HAVE_IPV6. Submitted by: Greg Stein. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60646 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.h.in b/include/apr.h.in index 229d2c796d7..524edcf1035 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -74,7 +74,7 @@ #define APR_HAVE_STRSTR @have_strstr@ #define APR_HAVE_MEMMOVE @have_memmove@ #define APR_HAVE_BZERO @have_bzero@ -#define APR_HAVE_V6 @have_sockaddr_in6@ +#define APR_HAVE_IPV6 @have_sockaddr_in6@ #if APR_HAVE_SYS_TYPES_H From 9f97414b71ac0aedf35df33d7ae1c9c7cf318f25 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Wed, 8 Nov 2000 14:47:05 +0000 Subject: [PATCH 0669/7878] This adds the APR_LOCAL/APR_REMOTE to APR and changes the apr_get/set_port functions to use it. This is onyl the start and I'll pause a while before I continue in case people really hate this. The patch can be backed out and all evidence will be removed, but I think this makes maintaining/developing the code easier in the long term. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60647 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 32 ++++++++++--------------- network_io/beos/sockaddr.c | 42 +++++++++++++-------------------- network_io/unix/sockaddr.c | 47 ++++++++++++++++--------------------- network_io/win32/sockaddr.c | 47 +++++++++++++++---------------------- test/client.c | 6 ++--- test/server.c | 6 ++--- 6 files changed, 73 insertions(+), 107 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 4023fe06532..6a24f8470bc 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -113,6 +113,12 @@ struct in_addr { } #endif +/* Enum to tell us if we're interested in remote or local socket */ +typedef enum { + APR_LOCAL, + APR_REMOTE +} apr_interface_e; + /* I guess not everybody uses inet_addr. This defines apr_inet_addr * appropriately. */ @@ -382,37 +388,23 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t* on); /** - * Associate a local port with a socket. + * Associate a port with a socket. * @param sock The socket to set. + * @param which Which socket do we want to set the port for? * @param port The local port this socket will be dealing with. * @tip This does not bind the two together, it is just telling apr * that this socket is going to use this port if possible. If * the port is already used, we won't find out about it here. */ -apr_status_t apr_set_local_port(apr_socket_t *sock, apr_port_t port); - -/** - * Associate a remote port with a socket. - * @param sock The socket to set. - * @param port The local port this socket will be dealing with. - * @tip This does not make a connection to the remote port, it is just - * telling apr which port apr_connect() should attempt to connect to. - */ -apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_port_t port); +apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, apr_port_t port); /** - * Return the local port with a socket. + * Return the port associated with a socket. * @param port The local port this socket is associated with. + * @param which Which interface are we getting the port for? * @param sock The socket to enquire about. */ -apr_status_t apr_get_local_port(apr_port_t *port, apr_socket_t *sock); - -/** - * Return the remote port associated with a socket. - * @param port The remote port this socket is associated with. - * @param sock The socket to enquire about. - */ -apr_status_t apr_get_remote_port(apr_port_t *port, apr_socket_t *sock); +apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t *sock); /** * Associate a local socket addr with an apr socket. diff --git a/network_io/beos/sockaddr.c b/network_io/beos/sockaddr.c index 75c2e5ee270..c3d727d42ff 100644 --- a/network_io/beos/sockaddr.c +++ b/network_io/beos/sockaddr.c @@ -58,39 +58,29 @@ #else #include "networkio.h" -apr_status_t apr_set_local_port(apr_socket_t *sock, apr_port_t port) +apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, apr_port_t port) { - if (!sock) { - return APR_EBADF; - } - sock->local_addr->sin_port = htons(port); - return APR_SUCCESS; -} - -apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_port_t port) -{ - if (!sock) { - return APR_EBADF; - } - sock->remote_addr->sin_port = htons(port); - return APR_SUCCESS; -} - -apr_status_t apr_get_local_port(apr_port_t *port, apr_socket_t *sock) -{ - if (!sock) { + if (!sock) return APR_EBADF; - } - *port = ntohs(sock->local_addr->sin_port); + if (which == APR_LOCAL) + sock->local_addr->sin_port = htons(port); + else if (APR == APR_REMOTE) + sock->remote_addr->sin_port = htons(port); + else + return APR_EINVAL; return APR_SUCCESS; } -apr_status_t apr_get_remote_port(apr_port_t *port, apr_socket_t *sock) +apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t *sock) { - if (!sock) { + if (!sock) return APR_EBADF; - } - *port = ntohs(sock->remote_addr->sin_port); + if (which == APR_LOCAL) + *port = ntohs(sock->local_addr->sin_port); + else if (which == APR_REMOTE) + *port = ntohs(sock->remote_addr->sin_port); + else + return APR_EINVAL; return APR_SUCCESS; } diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 70c81c390cc..1b42757169b 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -55,22 +55,18 @@ #include "networkio.h" #include "apr_strings.h" -apr_status_t apr_set_local_port(apr_socket_t *sock, apr_port_t port) +apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, + apr_port_t port) { - sock->local_addr->sin_port = htons(port); + if (which == APR_LOCAL) + sock->local_addr->sin_port = htons(port); + else if (which == APR_REMOTE) + sock->remote_addr->sin_port = htons(port); + else + return APR_EINVAL; return APR_SUCCESS; } - - -apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_port_t port) -{ - sock->remote_addr->sin_port = htons(port); - return APR_SUCCESS; -} - - - static apr_status_t get_local_addr(apr_socket_t *sock) { apr_socklen_t namelen = sizeof(*sock->local_addr); @@ -87,25 +83,22 @@ static apr_status_t get_local_addr(apr_socket_t *sock) -apr_status_t apr_get_local_port(apr_port_t *port, apr_socket_t *sock) +apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t *sock) { - if (sock->local_port_unknown) { - apr_status_t rv = get_local_addr(sock); + if (which == APR_LOCAL){ + if (sock->local_port_unknown) { + apr_status_t rv = get_local_addr(sock); - if (rv != APR_SUCCESS) { - return rv; + if (rv != APR_SUCCESS) { + return rv; + } } - } - *port = ntohs(sock->local_addr->sin_port); - return APR_SUCCESS; -} - - - -apr_status_t apr_get_remote_port(apr_port_t *port, apr_socket_t *sock) -{ - *port = ntohs(sock->remote_addr->sin_port); + *port = ntohs(sock->local_addr->sin_port); + } else if (which == APR_REMOTE) + *port = ntohs(sock->remote_addr->sin_port); + else + return APR_EINVAL; return APR_SUCCESS; } diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index 82915f44dc5..dafdc1ca425 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -74,46 +74,37 @@ static apr_status_t get_local_addr(apr_socket_t *sock) -apr_status_t apr_set_local_port(apr_socket_t *sock, apr_port_t port) +apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, apr_port_t port) { - sock->local_addr->sin_port = htons(port); + if (which == APR_LOCAL) + sock->local_addr->sin_port = htons(port); + else if (which == APR_REMOTE) + sock->remote_addr->sin_port = htons(port); + else + return APR_EINVAL; return APR_SUCCESS; } - - -apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_port_t port) -{ - sock->remote_addr->sin_port = htons(port); - return APR_SUCCESS; -} - - - -apr_status_t apr_get_local_port(apr_port_t *port, apr_socket_t *sock) +apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t *sock) { - if (sock->local_port_unknown) { - apr_status_t rv = get_local_addr(sock); + if (which == APR_LOCAL) + if (sock->local_port_unknown) { + apr_status_t rv = get_local_addr(sock); - if (rv != APR_SUCCESS) { - return rv; + if (rv != APR_SUCCESS) { + return rv; + } } - } + *port = ntohs(sock->local_addr->sin_port); + } else if (which == APR_REMOTE) + *port = ntohs(sock->remote_addr->sin_port); + else + return APR_EINVAL; - *port = ntohs(sock->local_addr->sin_port); return APR_SUCCESS; } - -apr_status_t apr_get_remote_port(apr_port_t *port, apr_socket_t *sock) -{ - *port = ntohs(sock->remote_addr->sin_port); - return APR_SUCCESS; -} - - - apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr) { u_long ipaddr; diff --git a/test/client.c b/test/client.c index 5949deddd98..6931f50e825 100644 --- a/test/client.c +++ b/test/client.c @@ -116,7 +116,7 @@ int main(int argc, char *argv[]) } fprintf(stdout, "\tClient: Setting port for socket......."); - if (apr_set_remote_port(sock, 8021) != APR_SUCCESS) { + if (apr_set_port(sock, APR_REMOTE, 8021) != APR_SUCCESS) { apr_close_socket(sock); fprintf(stderr, "Couldn't set the port correctly\n"); exit(-1); @@ -137,9 +137,9 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK\n"); apr_get_remote_ipaddr(&remote_ipaddr, sock); - apr_get_remote_port(&remote_port, sock); + apr_get_port(&remote_port, APR_REMOTE, sock); apr_get_local_ipaddr(&local_ipaddr, sock); - apr_get_local_port(&local_port, sock); + apr_get_port(&local_port, APR_LOCAL, sock); fprintf(stdout, "\tClient socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); fprintf(stdout, "\tClient: Trying to send data over socket......."); diff --git a/test/server.c b/test/server.c index 566dd4fa297..9b0dcfd940f 100644 --- a/test/server.c +++ b/test/server.c @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Setting port for socket......."); - if (apr_set_local_port(sock, 8021) != APR_SUCCESS) { + if (apr_set_port(sock, APR_LOCAL, 8021) != APR_SUCCESS) { apr_close_socket(sock); fprintf(stderr, "Couldn't set the port correctly\n"); exit(-1); @@ -162,9 +162,9 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK\n"); apr_get_remote_ipaddr(&remote_ipaddr, sock2); - apr_get_remote_port(&remote_port, sock2); + apr_get_port(&remote_port, APR_REMOTE, sock2); apr_get_local_ipaddr(&local_ipaddr, sock2); - apr_get_local_port(&local_port, sock2); + apr_get_port(&local_port, APR_LOCAL, sock2); fprintf(stdout, "\tServer socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); length = STRLEN; From 5edc1f9b44ea52a64b251b32f4820b8bb7c9dce4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 8 Nov 2000 16:10:44 +0000 Subject: [PATCH 0670/7878] tiny cleanup to APR configure output, standardizing a message and getting rid of a stray newline git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60648 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 5bb7b2a043e..6ddfc001a17 100644 --- a/configure.in +++ b/configure.in @@ -705,7 +705,7 @@ APR_CHECK_SOCKADDR_SA_LEN APR_CHECK_GETHOSTBYNAME_NAS -echo "${nl}IPv6 Networking support??" +echo $ac_n "${nl}Checking for IPv6 Networking support...${nl}" dnl # Start of checking for IPv6 support... AC_SEARCH_LIBS(getaddrinfo, inet6) AC_CHECK_FUNCS(getaddrinfo) @@ -728,7 +728,7 @@ AC_SUBST(EXEEXT) AC_SUBST(THREAD_CPPFLAGS) AC_SUBST(THREAD_CFLAGS) -echo "${nl}${nl}Construct Makefiles and header files." +echo "${nl}Construct Makefiles and header files." MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile" SUBDIRS="lib strings passwd tables " for dir in $MODULES From b0895f40a2e5f52f15c919b40b920cd73497011a Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 8 Nov 2000 18:32:49 +0000 Subject: [PATCH 0671/7878] Clean up APR configuration messages a bit by tweaking some wording, adding a newline where needed, and removing a debug message. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60649 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 6ddfc001a17..f9409bac8b0 100644 --- a/configure.in +++ b/configure.in @@ -134,7 +134,7 @@ if test "$USE_MM" = "yes"; then RUN_SUBDIR_CONFIG_NOW($config_subdirs) fi -AC_MSG_CHECKING(Checking for Shared memory support) +AC_MSG_CHECKING(for Shared memory support) AC_ARG_ENABLE(shmem, [ --enable-shmem Enable shared memory support in APR. ], [ ], @@ -164,7 +164,6 @@ AC_SUBST(anonymous_shm) AC_SUBST(filebased_shm) AC_SUBST(keybased_shm) -echo "$srcdir" AC_CHECK_DEFINE(MM_SHMT_MMFILE, $srcdir/shmem/unix/mm/mm_conf.h) if test "ac_cv_define_MM_SHMT_MMFILE" = "yes"; then @@ -576,10 +575,10 @@ test "x$ac_cv_struct_rlimit" = xyes && struct_rlimit=1 AC_SUBST(struct_rlimit) dnl #----------------------------- Checking for Locking Characteristics -echo $ac_n "${nl}Checking for Locking..." +echo $ac_n "${nl}Checking for Locking...${nl}" # It's stupid, but not all platforms have union semun, even those that need it. -AC_MSG_CHECKING(looking for union semun in sys/sem.h) +AC_MSG_CHECKING(for union semun in sys/sem.h) AC_TRY_COMPILE([ #include <sys/types.h> #include <sys/ipc.h> From 0bb9a15508a4c3fa07eeccea1a0c3390804816f2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 8 Nov 2000 22:22:55 +0000 Subject: [PATCH 0672/7878] Fix a typo, fix a def. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60650 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 8 ++++---- libapr.def | 8 ++++---- network_io/win32/sockaddr.c | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/aprlib.def b/aprlib.def index d552cdcdeac..ae8739fb667 100644 --- a/aprlib.def +++ b/aprlib.def @@ -218,10 +218,10 @@ EXPORTS apr_set_local_ipaddr @209 apr_get_remote_ipaddr @210 apr_set_remote_ipaddr @211 - apr_get_local_port @212 - apr_set_local_port @213 - apr_get_remote_port @214 - apr_set_remote_port @215 + apr_get_port @212 + apr_set_port @213 + + apr_open_stderr @216 apr_get_pipe_timeout @217 apr_set_pipe_timeout @218 diff --git a/libapr.def b/libapr.def index d552cdcdeac..ae8739fb667 100644 --- a/libapr.def +++ b/libapr.def @@ -218,10 +218,10 @@ EXPORTS apr_set_local_ipaddr @209 apr_get_remote_ipaddr @210 apr_set_remote_ipaddr @211 - apr_get_local_port @212 - apr_set_local_port @213 - apr_get_remote_port @214 - apr_set_remote_port @215 + apr_get_port @212 + apr_set_port @213 + + apr_open_stderr @216 apr_get_pipe_timeout @217 apr_set_pipe_timeout @218 diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index dafdc1ca425..724878925fb 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -88,6 +88,7 @@ apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, apr_port_t apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t *sock) { if (which == APR_LOCAL) + { if (sock->local_port_unknown) { apr_status_t rv = get_local_addr(sock); From 6022fea0efb0c6fcf315ebb7ea4d428f7a8c55c9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 8 Nov 2000 22:26:41 +0000 Subject: [PATCH 0673/7878] Catch up on some Unicode stuff that I've discovered while yanking around with canon names. Mostly cleanups and NT vs. 9x fixups, plus some more useful canon types I'm playing with. Hope to close this tommorow. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60651 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileacc.c | 7 +- file_io/win32/dir.c | 12 ++-- file_io/win32/filedup.c | 4 -- file_io/win32/fileio.h | 14 ++++ file_io/win32/filestat.c | 39 ++++------- file_io/win32/open.c | 127 +++++++++++++++++++----------------- include/apr_file_io.h | 5 ++ include/arch/win32/fileio.h | 14 ++++ 8 files changed, 117 insertions(+), 105 deletions(-) diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 71d796a2065..9a18584dca2 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -68,9 +68,6 @@ #else #include "fileio.h" #endif -#if APR_HAS_UNICODE_FS -#include "i18n.h" -#endif /* A file to put ALL of the accessor functions for apr_file_t types. */ @@ -92,9 +89,9 @@ apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) return APR_ENAMETOOLONG; } else -#else /* !APR_HAS_UNICODE_FS */ +#endif /* !APR_HAS_UNICODE_FS */ *fname = apr_pstrdup(thefile->cntxt, thefile->n.fname); -#endif + #else /* !def Win32 */ *fname = apr_pstrdup(thefile->cntxt, thefile->fname); #endif diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 382719f3112..ef3857ced8f 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -57,9 +57,6 @@ #include "apr_file_io.h" #include "apr_strings.h" #include "apr_portable.h" -#if APR_HAS_UNICODE_FS -#include "i18n.h" -#endif #include "atime.h" #if APR_HAVE_ERRNO_H @@ -94,16 +91,17 @@ apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) { apr_status_t rv; int lremains = len; - int dremains = (len + 3) * 2; + int dremains = len; (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); (*new)->w.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); - (*new)->w.dirname = apr_palloc(cont, dremains); + (*new)->w.dirname = apr_palloc(cont, dremains + 7); + wcscpy((*new)->w.dirname, L"//?/"); if ((rv = conv_utf8_to_ucs2(dirname, &lremains, - (*new)->w.dirname, &dremains))) + (*new)->w.dirname + 4, &dremains))) return rv; if (lremains) return APR_ENAMETOOLONG; - len = (len + 3) * 2 - dremains; + len = len + 4 - dremains; if (len && (*new)->w.dirname[len - 1] != '/') { (*new)->w.dirname[len++] = '/'; } diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index fea11f248c2..1520bf8ce6d 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -57,10 +57,6 @@ #include "apr_general.h" #include "apr_strings.h" #include <string.h> -#if APR_HAS_UNICODE_FS -#include "i18n.h" -#include <wchar.h> -#endif apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 5852720ef8c..da380d0868f 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -89,14 +89,27 @@ #define APR_FILE_BUFSIZE 4096 +#if APR_HAS_UNICODE_FS +#include "i18n.h" +#include <wchar.h> + typedef apr_int16_t apr_wchar_t; +apr_wchar_t *utf8_to_unicode_path(const char* srcstr, apr_pool_t *p); +#endif + typedef enum apr_canon_case_e { APR_CANON_CASE_GIVEN, APR_CANON_CASE_LOWER, APR_CANON_CASE_TRUE } apr_canon_case_e; +typedef enum apr_canon_path_e { + APR_CANON_PATH_VIRUTAL, + APR_CANON_PATH_ABSOLUTE, + APR_CANON_PATH_RELATIVE +} apr_canon_path_e; + /* * Internal canonical filename elements for the apr_canon_t elems * ccase tracks the mechanism used to resolve this element @@ -117,6 +130,7 @@ typedef struct apr_canon_elem_t { struct apr_canon_t { apr_pool_t *cntxt; apr_array_header_t *elems; + apr_canon_path_e type; }; /* quick run-down of fields in windows' apr_file_t structure that may have diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 8b9f8141a42..1ec9216335f 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -58,31 +58,10 @@ #include "apr_general.h" #include "apr_errno.h" #include "apr_time.h" -#if APR_HAS_UNICODE_FS -#include "i18n.h" -#endif #include <sys/stat.h> #include "atime.h" #include "misc.h" -/* XXX: this is wrong for W2K */ -#define S_ISLNK(m) (0) -#define S_ISREG(m) (((m) & (S_IFMT)) == S_IFREG) -#define S_ISDIR(m) (((m) & (S_IFDIR)) == S_IFDIR) - -static apr_filetype_e filetype_from_mode(int mode) -{ - apr_filetype_e type = APR_NOFILE; - - if (S_ISREG(mode)) - type = APR_REG; - if (S_ISDIR(mode)) - type = APR_DIR; - if (S_ISLNK(mode)) - type = APR_LNK; - - return type; -} BOOLEAN is_exe(const char* fname, apr_pool_t *cont) { /* @@ -125,20 +104,22 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) /* If my rudimentary knowledge of posix serves... inode is the absolute * id of the file (uniquifier) that is returned by NT as follows: - * user and group could be related as SID's, although this would ensure - * it's own unique set of issues. All three fields are significantly - * longer than the posix compatible kernals would ever require. - * TODO: Someday solve this, and fix the executable flag below the - * right way with a security permission test (as well as r/w flags.) * * dwVolumeSerialNumber * nFileIndexHigh * nFileIndexLow + * + * user and group could be returned as SID's, although this creates + * it's own unique set of issues. All three fields are significantly + * longer than the posix compatible kernals would ever require. + * TODO: Someday solve this, and fix the executable flag below the + * right way with a security permission test (as well as r/w flags.) */ finfo->user = 0; finfo->group = 0; - finfo->inode = 0; - finfo->device = 0; /* ### use drive letter - 'A' ? */ + finfo->inode = (apr_ino_t) FileInformation.nFileIndexHigh << 16 + | FileInformation.nFileIndexLow; + finfo->device = FileInformation.dwVolumeSerialNumber; /* Filetype - Directory or file: this case _will_ never happen */ if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { @@ -160,6 +141,7 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) #else finfo->protection = S_IFIFO; #endif + finfo->filetype = APR_PIPE; } else { finfo->protection = 0; @@ -212,6 +194,7 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) #if APR_HAS_UNICODE_FS if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { + apr_wchar_t wname[MAX_PATH]; int len = MAX_PATH; int lremains = strlen(fname) + 1; diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 818f2728cb0..c4a22a17339 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -63,9 +63,23 @@ #include <string.h> #include <sys/stat.h> #include "misc.h" -#if APR_HAS_UNICODE_FS -#include "i18n.h" -#endif + +apr_wchar_t *utf8_to_unicode_path(const char* srcstr, apr_pool_t *p) +{ + /* TODO: The computations could preconvert the string to determine + * the true size of the retstr, but that's a memory over speed + * tradeoff that isn't appropriate this early in development. + */ + int srcremains = strlen(srcstr) + 1; + int retremains = srcremains + 4; + apr_wchar_t *retstr = apr_palloc(p, retremains * 2); + wcscpy (retstr, L"//?/"); + if (conv_utf8_to_ucs2(srcstr, &srcremains, + retstr + 4, &retremains) || srcremains) + return NULL; + else + return retstr; +} apr_status_t file_cleanup(void *thefile) { @@ -85,12 +99,8 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, DWORD createflags = 0; DWORD attributes = 0; DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE; - apr_oslevel_e level; + apr_oslevel_e os_level; apr_status_t rv; -#if APR_HAS_UNICODE_FS - int lremains = strlen(fname) + 1; - int dremains = (lremains) * 2; -#endif (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); (*new)->cntxt = cont; @@ -115,20 +125,23 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, if (rv) return rv; } -#if APR_HAS_UNICODE_FS - (*new)->w.fname = apr_palloc(cont, dremains); - if ((rv = conv_utf8_to_ucs2(fname, &lremains, - (*new)->w.fname, &dremains))) - return rv; - if (lremains) - return APR_ENAMETOOLONG; -#else - (*new)->n.fname = apr_pstrdup(cont, fname); -#endif - if (apr_get_oslevel(cont, &level) == APR_SUCCESS && level >= APR_WIN_NT) { + if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) sharemode |= FILE_SHARE_DELETE; + else + os_level = 0; + +#if APR_HAS_UNICODE_FS + if (os_level >= APR_WIN_NT) + { + (*new)->w.fname = utf8_to_unicode_path(fname, cont); + if (!(*new)->w.fname) + /* XXX: really bad file name */ + return APR_ENAMETOOLONG; } + else +#endif + (*new)->n.fname = apr_pstrdup(cont, fname); if (flag & APR_CREATE) { if (flag & APR_EXCL) { @@ -167,12 +180,13 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, } #if APR_HAS_UNICODE_FS - (*new)->filehand = CreateFileW((*new)->w.fname, oflags, sharemode, - NULL, createflags, attributes, 0); -#else - (*new)->filehand = CreateFile((*new)->n.fname, oflags, sharemode, - NULL, createflags, attributes, 0); + if (os_level >= APR_WIN_NT) + (*new)->filehand = CreateFileW((*new)->w.fname, oflags, sharemode, + NULL, createflags, attributes, 0); + else #endif + (*new)->filehand = CreateFile((*new)->n.fname, oflags, sharemode, + NULL, createflags, attributes, 0); if ((*new)->filehand == INVALID_HANDLE_VALUE) { return apr_get_os_error(); } @@ -213,51 +227,42 @@ apr_status_t apr_close(apr_file_t *file) apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS - apr_wchar_t wpath[MAX_PATH]; - int lremains = strlen(path) + 1; - int dremains = MAX_PATH; - apr_status_t rv; - if ((rv = conv_utf8_to_ucs2(path, &lremains, - wpath, &dremains))) - return rv; - if (lremains) - return APR_ENAMETOOLONG; - if (DeleteFileW(wpath)) -#else - if (DeleteFile(path)) + apr_oslevel_e os_level; + if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t *wpath = utf8_to_unicode_path(path, cont); + if (!wpath) + return APR_ENAMETOOLONG; + if (DeleteFileW(wpath)) + return APR_SUCCESS; + } + else #endif - return APR_SUCCESS; + if (DeleteFile(path)) + return APR_SUCCESS; return apr_get_os_error(); } apr_status_t apr_rename_file(const char *from_path, const char *to_path, - apr_pool_t *p) + apr_pool_t *cont) { #if APR_HAS_UNICODE_FS - apr_wchar_t wfrompath[MAX_PATH]; - apr_wchar_t wtopath[MAX_PATH]; - int lremains = strlen(from_path) + 1; - int dremains = MAX_PATH; - apr_status_t rv; - if ((rv = conv_utf8_to_ucs2(from_path, &lremains, - wfrompath, &dremains))) - return rv; - if (lremains) - return APR_ENAMETOOLONG; - lremains = strlen(to_path) + 1; - dremains = MAX_PATH; - if ((rv = conv_utf8_to_ucs2(to_path, &lremains, - wtopath, &dremains))) - return rv; - if (lremains) - return APR_ENAMETOOLONG; - if (MoveFileExW(wfrompath, wtopath, MOVEFILE_REPLACE_EXISTING | - MOVEFILE_COPY_ALLOWED)) -#else - if (MoveFileEx(from_path, to_path, MOVEFILE_REPLACE_EXISTING | - MOVEFILE_COPY_ALLOWED)) + apr_oslevel_e os_level; + if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t *wfrompath = utf8_to_unicode_path(from_path, cont); + apr_wchar_t *wtopath = utf8_to_unicode_path(to_path, cont); + if (!wfrompath || !wtopath) + return APR_ENAMETOOLONG; + if (MoveFileExW(wfrompath, wtopath, MOVEFILE_REPLACE_EXISTING | + MOVEFILE_COPY_ALLOWED)) + return APR_SUCCESS; + } + else #endif - return APR_SUCCESS; + if (MoveFileEx(from_path, to_path, MOVEFILE_REPLACE_EXISTING | + MOVEFILE_COPY_ALLOWED)) + return APR_SUCCESS; return apr_get_os_error(); } diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 999138a550d..491d9b19fd1 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -123,8 +123,13 @@ typedef struct apr_canon_t apr_canon_t; typedef apr_int32_t apr_fileperms_t; typedef uid_t apr_uid_t; typedef gid_t apr_gid_t; +#ifdef WIN32 +typedef apr_uint64_t apr_ino_t; +typedef apr_uint32_t apr_dev_t; +#else typedef ino_t apr_ino_t; typedef dev_t apr_dev_t; +#endif /** * The file information structure. This is analogous to the POSIX diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 5852720ef8c..da380d0868f 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -89,14 +89,27 @@ #define APR_FILE_BUFSIZE 4096 +#if APR_HAS_UNICODE_FS +#include "i18n.h" +#include <wchar.h> + typedef apr_int16_t apr_wchar_t; +apr_wchar_t *utf8_to_unicode_path(const char* srcstr, apr_pool_t *p); +#endif + typedef enum apr_canon_case_e { APR_CANON_CASE_GIVEN, APR_CANON_CASE_LOWER, APR_CANON_CASE_TRUE } apr_canon_case_e; +typedef enum apr_canon_path_e { + APR_CANON_PATH_VIRUTAL, + APR_CANON_PATH_ABSOLUTE, + APR_CANON_PATH_RELATIVE +} apr_canon_path_e; + /* * Internal canonical filename elements for the apr_canon_t elems * ccase tracks the mechanism used to resolve this element @@ -117,6 +130,7 @@ typedef struct apr_canon_elem_t { struct apr_canon_t { apr_pool_t *cntxt; apr_array_header_t *elems; + apr_canon_path_e type; }; /* quick run-down of fields in windows' apr_file_t structure that may have From e8ab3ec684feb1d022aa6679badbabbd69fc7b93 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 9 Nov 2000 06:08:37 +0000 Subject: [PATCH 0674/7878] Move all of the dso private header files to an arch directory under the include directory. All private header files for APR are being moved. This allows platforms that only implement some of the APR types to compile cleanly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60652 13f79535-47bb-0310-9956-ffa450edef68 --- dso/aix/Makefile.in | 2 +- dso/aix/dso.c | 2 +- dso/aix/dso.h | 78 ----------------------------------- dso/beos/Makefile.in | 2 +- dso/beos/dso.c | 2 +- dso/beos/dso.h | 76 ---------------------------------- dso/os2/Makefile.in | 2 +- dso/os2/dso.c | 2 +- dso/os2/dso.h | 78 ----------------------------------- dso/os390/Makefile.in | 2 +- dso/os390/dso.c | 2 +- dso/os390/dso.h | 76 ---------------------------------- dso/unix/Makefile.in | 4 +- dso/unix/dso.c | 2 +- dso/unix/dso.h | 96 ------------------------------------------- dso/win32/dso.h | 74 --------------------------------- 16 files changed, 11 insertions(+), 489 deletions(-) delete mode 100644 dso/aix/dso.h delete mode 100644 dso/beos/dso.h delete mode 100644 dso/os2/dso.h delete mode 100644 dso/os390/dso.h delete mode 100644 dso/unix/dso.h delete mode 100644 dso/win32/dso.h diff --git a/dso/aix/Makefile.in b/dso/aix/Makefile.in index f755b93e69d..c5df58c36a9 100644 --- a/dso/aix/Makefile.in +++ b/dso/aix/Makefile.in @@ -10,7 +10,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch LIB=libdso.a diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 5e10b4ce276..4b10f1fe351 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -85,7 +85,7 @@ #include <sys/types.h> #include <sys/ldr.h> #include <a.out.h> -#include "dso.h" +#include "aix/dso.h" #if APR_HAS_DSO diff --git a/dso/aix/dso.h b/dso/aix/dso.h deleted file mode 100644 index 6b7ca8ea74e..00000000000 --- a/dso/aix/dso.h +++ /dev/null @@ -1,78 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef DSO_H -#define DSO_H - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" -#include "apr.h" - -#if APR_HAS_DSO - -void *dlopen(const char *path, int mode); -void *dlsym(void *handle, const char *symbol); -const char *dlerror(void); -int dlclose(void *handle); - -struct apr_dso_handle_t { - apr_pool_t *cont; - void *handle; -}; - -#endif - -#endif diff --git a/dso/beos/Makefile.in b/dso/beos/Makefile.in index 2ff8a52b5a1..61c195b8a42 100644 --- a/dso/beos/Makefile.in +++ b/dso/beos/Makefile.in @@ -9,7 +9,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch LIB=libdso.a diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 6a29f1efcbe..f049c28a4ab 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "dso.h" +#include "beos/dso.h" #if APR_HAS_DSO diff --git a/dso/beos/dso.h b/dso/beos/dso.h deleted file mode 100644 index 476e71c8fa4..00000000000 --- a/dso/beos/dso.h +++ /dev/null @@ -1,76 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef DSO_H -#define DSO_H - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_errno.h" -#include "apr_dso.h" -#include "apr.h" -#include <kernel/image.h> -#include <string.h> - -#if APR_HAS_DSO - -struct apr_dso_handle_t { - image_id handle; /* Handle to the DSO loaded */ - apr_pool_t *cont; -}; - -#endif - -#endif diff --git a/dso/os2/Makefile.in b/dso/os2/Makefile.in index c9526a90bae..374453368e6 100644 --- a/dso/os2/Makefile.in +++ b/dso/os2/Makefile.in @@ -10,7 +10,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch LIB=libdso.a diff --git a/dso/os2/dso.c b/dso/os2/dso.c index d7706f13882..d5bfc4cc6ff 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "dso.h" +#include "os2/dso.h" #define INCL_DOS #include <os2.h> #include <stdio.h> diff --git a/dso/os2/dso.h b/dso/os2/dso.h deleted file mode 100644 index 1597c81d112..00000000000 --- a/dso/os2/dso.h +++ /dev/null @@ -1,78 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef DSO_H -#define DSO_H - -#define INCL_DOS -#include <os2.h> - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" -#include "apr.h" - -#if APR_HAS_DSO - -struct apr_dso_handle_t { - apr_pool_t *cont; /* Context for returning error strings */ - HMODULE handle; /* Handle to the DSO loaded */ - apr_status_t load_error; - char *failed_module; -}; - -#endif - -#endif diff --git a/dso/os390/Makefile.in b/dso/os390/Makefile.in index f755b93e69d..c5df58c36a9 100644 --- a/dso/os390/Makefile.in +++ b/dso/os390/Makefile.in @@ -10,7 +10,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch LIB=libdso.a diff --git a/dso/os390/dso.c b/dso/os390/dso.c index c9806dcb928..2adff3e8d75 100644 --- a/dso/os390/dso.c +++ b/dso/os390/dso.c @@ -53,7 +53,7 @@ */ #include "apr_strings.h" -#include "dso.h" +#include "os390/dso.h" #include <errno.h> #include <string.h> diff --git a/dso/os390/dso.h b/dso/os390/dso.h deleted file mode 100644 index 0ee06e7f911..00000000000 --- a/dso/os390/dso.h +++ /dev/null @@ -1,76 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef DSO_H -#define DSO_H - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" -#include "apr.h" - -#if APR_HAS_DSO - -#include <dll.h> - -struct apr_dso_handle_t { - dllhandle *handle; /* Handle to the DSO loaded */ - int failing_errno; /* Don't save the buffer returned by - strerror(); it gets reused */ -}; - -#endif - -#endif diff --git a/dso/unix/Makefile.in b/dso/unix/Makefile.in index c08355c59f9..51ba228157f 100644 --- a/dso/unix/Makefile.in +++ b/dso/unix/Makefile.in @@ -11,7 +11,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I. +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch LIB=libdso.a @@ -49,7 +49,7 @@ depend: && rm Makefile.new # DO NOT REMOVE -dso.o: dso.c dso.h $(INCDIR)/apr_private.h \ +dso.o: dso.c $(INCDIR)/arch/unix/dso.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 9a6a0e0fbd0..710e68729a6 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "dso.h" +#include "unix/dso.h" #if APR_HAS_DSO diff --git a/dso/unix/dso.h b/dso/unix/dso.h deleted file mode 100644 index fc9b8325e17..00000000000 --- a/dso/unix/dso.h +++ /dev/null @@ -1,96 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef DSO_H -#define DSO_H - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" -#include "apr.h" - -#if APR_HAS_DSO - -#ifdef HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#ifdef HAVE_DL_H -#include <dl.h> -#endif - -#ifndef RTLD_NOW -#define RTLD_NOW 1 -#endif - -#ifndef RTLD_GLOBAL -#define RTLD_GLOBAL 0 -#endif - -#if (defined(__FreeBSD__) ||\ - defined(__OpenBSD__) ||\ - defined(__NetBSD__) ) && !defined(__ELF__) -#define DLSYM_NEEDS_UNDERSCORE -#endif - -struct apr_dso_handle_t { - apr_pool_t *cont; - void *handle; - const char *errormsg; -}; - -#endif - -#endif diff --git a/dso/win32/dso.h b/dso/win32/dso.h deleted file mode 100644 index 32bf6b7be74..00000000000 --- a/dso/win32/dso.h +++ /dev/null @@ -1,74 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef DSO_H -#define DSO_H - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" -#include "apr.h" - -#if APR_HAS_DSO - -struct apr_dso_handle_t { - apr_pool_t *cont; - void *handle; - apr_status_t load_error; -}; - -#endif - -#endif From 98009ce0c6a7c021f09368d67a02865e54c144ee Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 9 Nov 2000 06:15:54 +0000 Subject: [PATCH 0675/7878] Move all of the file private header files to an arch directory under the include directory. All private header files for APR are being moved. This allows platforms that only implement some of the APR types to compile cleanly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60653 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/Makefile.in | 5 +- file_io/os2/dir.c | 2 +- file_io/os2/filedup.c | 2 +- file_io/os2/fileio.h | 105 ------------------ file_io/os2/filestat.c | 2 +- file_io/os2/maperrorcode.c | 2 +- file_io/os2/open.c | 2 +- file_io/os2/pipe.c | 2 +- file_io/os2/readwrite.c | 4 +- file_io/os2/seek.c | 2 +- file_io/unix/Makefile.in | 90 +++++++-------- file_io/unix/dir.c | 2 +- file_io/unix/fileacc.c | 6 +- file_io/unix/filedup.c | 2 +- file_io/unix/fileio.h | 168 ---------------------------- file_io/unix/filestat.c | 2 +- file_io/unix/open.c | 2 +- file_io/unix/pipe.c | 2 +- file_io/unix/readwrite.c | 2 +- file_io/unix/seek.c | 2 +- file_io/win32/dir.c | 2 +- file_io/win32/filedup.c | 2 +- file_io/win32/fileio.h | 218 ------------------------------------- file_io/win32/filestat.c | 2 +- file_io/win32/open.c | 2 +- file_io/win32/pipe.c | 2 +- file_io/win32/readwrite.c | 2 +- file_io/win32/seek.c | 2 +- 28 files changed, 74 insertions(+), 564 deletions(-) delete mode 100644 file_io/os2/fileio.h delete mode 100644 file_io/unix/fileio.h delete mode 100644 file_io/win32/fileio.h diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index 72bc9fe4025..2d43b5b8a79 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -8,9 +8,8 @@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../inc -INCDIR1=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch LIB=file.a diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index ee4d5e2a8d9..ce249eebf5e 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "os2/fileio.h" #include "apr_file_io.h" #include "apr_lib.h" #include "apr_strings.h" diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index ee52fcddb7d..4ceed46c08c 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "os2/fileio.h" #include "apr_file_io.h" #include "apr_lib.h" #include "apr_strings.h" diff --git a/file_io/os2/fileio.h b/file_io/os2/fileio.h deleted file mode 100644 index d2a44fd18bf..00000000000 --- a/file_io/os2/fileio.h +++ /dev/null @@ -1,105 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef FILE_IO_H -#define FILE_IO_H - -#define INCL_DOS -#define INCL_DOSERRORS -#include <os2.h> - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_lock.h" -#include "apr_file_io.h" -#include "apr_errno.h" - -#define APR_FILE_BUFSIZE 4096 - -struct apr_file_t { - apr_pool_t *cntxt; - HFILE filedes; - char * fname; - int isopen; - int buffered; - int eof_hit; - apr_int32_t flags; - int timeout; - int pipe; - HEV pipeSem; - enum { BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; - - /* Stuff for buffered mode */ - char *buffer; - int bufpos; // Read/Write position in buffer - unsigned long dataRead; // amount of valid data read into buffer - int direction; // buffer being used for 0 = read, 1 = write - unsigned long filePtr; // position in file of handle - apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields -}; - -struct apr_dir_t { - apr_pool_t *cntxt; - char *dirname; - ULONG handle; - FILEFINDBUF3 entry; - int validentry; -}; - -apr_status_t apr_file_cleanup(void *); -apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, - FTIME os2time); - -#endif /* ! FILE_IO_H */ - diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 1410cdb91bb..908a24d1c9b 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -54,7 +54,7 @@ #define INCL_DOS #define INCL_DOSERRORS -#include "fileio.h" +#include "os2/fileio.h" #include "apr_file_io.h" #include "apr_lib.h" #include <sys/time.h> diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c index 5fa39815113..fd32052ac6a 100644 --- a/file_io/os2/maperrorcode.c +++ b/file_io/os2/maperrorcode.c @@ -53,7 +53,7 @@ */ #define INCL_DOSERRORS -#include "fileio.h" +#include "os2/fileio.h" #include "apr_file_io.h" #include <errno.h> #include <string.h> diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 53c772e0a05..b36b8b9bf11 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "os2/fileio.h" #include "apr_file_io.h" #include "apr_lib.h" #include "apr_portable.h" diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 87421bd8a89..161d5ef38f2 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -53,7 +53,7 @@ */ #define INCL_DOSERRORS -#include "fileio.h" +#include "os2/fileio.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_lib.h" diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index d4816c50ad4..9d5b2ff56e3 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -1,4 +1,4 @@ -/* ==================================================================== +os2//* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights @@ -55,7 +55,7 @@ #define INCL_DOS #define INCL_DOSERRORS -#include "fileio.h" +#include "os2/fileio.h" #include "apr_file_io.h" #include "apr_lib.h" diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index 948f423f63c..521649c496e 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "os2/fileio.h" #include "apr_file_io.h" #include "apr_lib.h" #include <string.h> diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index 379e62b286a..34472f81ad1 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -10,7 +10,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I. +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch #LIB=libfile.a @@ -56,60 +56,62 @@ depend: && rm Makefile.new # DO NOT REMOVE -dir.o: dir.c fileio.h $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ +dir.o: dir.c $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_strings.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h +fileacc.o: fileacc.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr_private.h +filedup.o: filedup.c $(INCDIR)/arch/unix/fileio.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ $(INCDIR)/apr_strings.h $(INCDIR)/apr_portable.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ $(INCDIR)/apr_dso.h -fileacc.o: fileacc.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ +filestat.o: filestat.c $(INCDIR)/arch/unix/fileio.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h fileio.h \ - $(INCDIR)/apr_private.h -filedup.o: filedup.c fileio.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h -filestat.o: filestat.c fileio.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h fullrw.o: fullrw.c $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h -open.o: open.c fileio.h $(INCDIR)/apr.h \ +open.o: open.c $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_strings.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h -pipe.o: pipe.c fileio.h $(INCDIR)/apr.h \ +pipe.o: pipe.c $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h -readwrite.o: readwrite.c fileio.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_lock.h -seek.o: seek.c fileio.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_strings.h +readwrite.o: readwrite.c $(INCDIR)/arch/unix/fileio.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_lock.h +seek.o: seek.c $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h + $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 419c2f88112..12b0d620921 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "unix/fileio.h" #include "apr_strings.h" #include "apr_portable.h" diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 9a18584dca2..d1007b1f784 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -54,9 +54,9 @@ #include "apr_strings.h" #ifdef OS2 -#include "../os2/fileio.h" +#include "os2/fileio.h" #elif defined(WIN32) -#include "../win32/fileio.h" +#include "win32/fileio.h" #endif #if defined(OS2) || defined(WIN32) #include "apr_file_io.h" @@ -66,7 +66,7 @@ #include <string.h> #include <sys/types.h> #else -#include "fileio.h" +#include "unix/fileio.h" #endif /* A file to put ALL of the accessor functions for apr_file_t types. */ diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 06956fac5c6..27aad60f029 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "unix/fileio.h" #include "apr_strings.h" #include "apr_portable.h" diff --git a/file_io/unix/fileio.h b/file_io/unix/fileio.h deleted file mode 100644 index 24ca8e1d94a..00000000000 --- a/file_io/unix/fileio.h +++ /dev/null @@ -1,168 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef FILE_IO_H -#define FILE_IO_H - -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_tables.h" -#include "apr_file_io.h" -#include "apr_errno.h" -#include "apr_lib.h" - -/* System headers the file I/O library needs */ -#if APR_HAVE_FCNTL_H -#include <fcntl.h> -#endif -#if APR_HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if APR_HAVE_ERRNO_H -#include <errno.h> -#endif -#if HAVE_STRING_H -#include <string.h> -#endif -#if HAVE_STRINGS_H -#include <strings.h> -#endif -#if APR_HAVE_DIRENT_H -#include <dirent.h> -#endif -#if HAVE_SYS_STAT_H -#include <sys/stat.h> -#endif -#if HAVE_UNISTD_H -#include <unistd.h> -#endif -#if APR_HAVE_STDIO_H -#include <stdio.h> -#endif -#if HAVE_STDLIB_H -#include <stdlib.h> -#endif -#if APR_HAVE_SYS_UIO_H -#include <sys/uio.h> -#endif -#if HAVE_SYS_TIME_H -#include <sys/time.h> -#endif -#ifdef BEOS -#include <kernel/OS.h> -#endif -/* BeOS still defines fd_set in sys/socket.h so include it here. - * I'm not just including it as most platforms won't need it... - */ -#if BEOS_BONE -#include <sys/socket.h> /* for fd_set definitions */ -#endif -/* End System headers */ - -#define APR_FILE_BUFSIZE 4096 - -typedef struct apr_canon_elem_t { -/* A possible comparison mechanism to play with once we start - * implementing case insensitive mount poinbt semantices - * int dev; - * int inode; - * apr_time_t cached; --for timeout? - */ - int pathlen; - char *element; -} apr_canon_elem_t; - -struct apr_canon_t { - apr_pool_t *cntxt; - apr_array_header_t *elems; -}; - -struct apr_file_t { - apr_pool_t *cntxt; - int filedes; - char * fname; - int oflags; - int eof_hit; - int pipe; - apr_interval_time_t timeout; - int buffered; - enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; - int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ - - /* Stuff for buffered mode */ - char *buffer; - int bufpos; /* Read/Write position in buffer */ - unsigned long dataRead; /* amount of valid data read into buffer */ - int direction; /* buffer being used for 0 = read, 1 = write */ - unsigned long filePtr; /* position in file of handle */ -#if APR_HAS_THREADS - struct apr_lock_t *thlock; -#endif -}; - -struct apr_dir_t { - apr_pool_t *cntxt; - char *dirname; - DIR *dirstruct; - struct dirent *entry; -}; - -apr_status_t apr_unix_file_cleanup(void *); - -mode_t apr_unix_perms2mode(apr_fileperms_t perms); -apr_fileperms_t apr_unix_mode2perms(mode_t mode); - -#endif /* ! FILE_IO_H */ - diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 0e14fdafd25..8c8287ab62e 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "unix/fileio.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_errno.h" diff --git a/file_io/unix/open.c b/file_io/unix/open.c index dab768f4df4..5a6201b5b79 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "unix/fileio.h" #include "apr_strings.h" #include "apr_portable.h" diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index f5bf550fd2f..e7e6d4e1058 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "unix/fileio.h" #include "apr_strings.h" static apr_status_t pipeblock(apr_file_t *thepipe) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 57a950d2513..1ef08319808 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "unix/fileio.h" #include "apr_lock.h" /* The only case where we don't use wait_for_io_or_timeout is on diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 3ab2aca93a7..c30811bd608 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "unix/fileio.h" static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) { diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index ef3857ced8f..2522fb3b7e8 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -53,7 +53,7 @@ */ #include "apr.h" -#include "fileio.h" +#include "win32/fileio.h" #include "apr_file_io.h" #include "apr_strings.h" #include "apr_portable.h" diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 1520bf8ce6d..a7ed9fa2bd3 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "win32/fileio.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_strings.h" diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h deleted file mode 100644 index da380d0868f..00000000000 --- a/file_io/win32/fileio.h +++ /dev/null @@ -1,218 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef FILE_IO_H -#define FILE_IO_H - -#include "apr.h" -#include "apr_private.h" -#include "apr_pools.h" -#include "apr_general.h" -#include "apr_tables.h" -#include "apr_lock.h" -#include "apr_file_io.h" -#include "apr_errno.h" -#include "misc.h" - -#if APR_HAVE_SYS_STAT_H -#include <sys/stat.h> -#endif -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_SYS_FCNTL_H -#include <fcntl.h> -#endif -#ifdef HAVE_TIME_H -#include <time.h> -#endif -#if APR_HAVE_DIRENT_H -#include <dirent.h> -#endif -#ifdef HAVE_MALLOC_H -#include <malloc.h> -#endif -#ifdef HAVE_UIO_H -#include <sys/uio.h> -#endif - -#define APR_FILE_BUFSIZE 4096 - -#if APR_HAS_UNICODE_FS -#include "i18n.h" -#include <wchar.h> - -typedef apr_int16_t apr_wchar_t; - -apr_wchar_t *utf8_to_unicode_path(const char* srcstr, apr_pool_t *p); -#endif - -typedef enum apr_canon_case_e { - APR_CANON_CASE_GIVEN, - APR_CANON_CASE_LOWER, - APR_CANON_CASE_TRUE -} apr_canon_case_e; - -typedef enum apr_canon_path_e { - APR_CANON_PATH_VIRUTAL, - APR_CANON_PATH_ABSOLUTE, - APR_CANON_PATH_RELATIVE -} apr_canon_path_e; - -/* - * Internal canonical filename elements for the apr_canon_t elems - * ccase tracks the mechanism used to resolve this element - * pathlen is the full path length to the end of this element - * name slash is prefix, as appropriate - - */ -typedef struct apr_canon_elem_t { - apr_canon_case_e ccase; - int pathlen; - char *name; -} apr_canon_elem_t; - -/* warning: win32 canonical path "/" resolves to a - * zero'th element of the empty string for testing the - * psudo-root for the system - */ -struct apr_canon_t { - apr_pool_t *cntxt; - apr_array_header_t *elems; - apr_canon_path_e type; -}; - -/* quick run-down of fields in windows' apr_file_t structure that may have - * obvious uses. - * fname -- the filename as passed to the open call. - * dwFileAttricutes -- Attributes used to open the file. - * demonfname -- the canonicalized filename. Used to store the result from - * apr_os_canonicalize_filename. - * lowerdemonfname -- inserted at Ken Parzygnat's request, because of the - * ugly way windows deals with case in the filesystem. - * append -- Windows doesn't support the append concept when opening files. - * APR needs to keep track of this, and always make sure we append - * correctly when writing to a file with this flag set TRUE. - */ - -struct apr_file_t { - apr_pool_t *cntxt; - HANDLE filehand; - BOOLEAN pipe; // Is this a pipe of a file? - OVERLAPPED *pOverlapped; - apr_interval_time_t timeout; - - /* File specific info */ - union { -#if APR_HAS_UNICODE_FS - struct { - apr_wchar_t *fname; - } w; -#endif - struct { - char *fname; - } n; - }; - apr_canon_t *canonname; - - DWORD dwFileAttributes; - int eof_hit; - BOOLEAN buffered; // Use buffered I/O? - int ungetchar; // Last char provided by an unget op. (-1 = no char) - int append; - off_t size; - apr_time_t atime; - apr_time_t mtime; - apr_time_t ctime; - - /* Stuff for buffered mode */ - char *buffer; - apr_ssize_t bufpos; // Read/Write position in buffer - apr_ssize_t dataRead; // amount of valid data read into buffer - int direction; // buffer being used for 0 = read, 1 = write - apr_ssize_t filePtr; // position in file of handle - apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields - - /* Pipe specific info */ - -}; - -struct apr_dir_t { - apr_pool_t *cntxt; - HANDLE dirhand; - union { -#if APR_HAS_UNICODE_FS - struct { - apr_wchar_t *dirname; - WIN32_FIND_DATAW *entry; - } w; -#endif - struct { - char *dirname; - WIN32_FIND_DATA *entry; - } n; - }; -}; - -apr_status_t file_cleanup(void *); - -/** - * Internal function to create a Win32/NT pipe that respects some async - * timeout options. - */ -apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, - BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, - apr_pool_t *p); -#endif /* ! FILE_IO_H */ - diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 1ec9216335f..18b0ede4fa6 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -53,7 +53,7 @@ */ #include "apr_private.h" -#include "fileio.h" +#include "win32/fileio.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_errno.h" diff --git a/file_io/win32/open.c b/file_io/win32/open.c index c4a22a17339..222bc5e85f9 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -53,7 +53,7 @@ */ #include "apr_private.h" -#include "fileio.h" +#include "win32/fileio.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_strings.h" diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 5e37916b08b..1c9189a2c12 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "win32/fileio.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_strings.h" diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 02c1e4a8c42..db5fccffa82 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "win32/fileio.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_lib.h" diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 3c768ba6b3a..55482613388 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "fileio.h" +#include "win32/fileio.h" #include "apr_file_io.h" #include <errno.h> #include <string.h> From 4738f752c69c5481671243729a6c5c18727d0a88 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 9 Nov 2000 06:19:12 +0000 Subject: [PATCH 0676/7878] Move all of the i18n private header files to an arch directory under the include directory. All private header files for APR are being moved. This allows platforms that only implement some of the APR types to compile cleanly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60654 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/Makefile.in | 6 ++- i18n/unix/i18n.h | 89 ------------------------------------------- i18n/unix/utf8_ucs2.c | 2 +- 3 files changed, 6 insertions(+), 91 deletions(-) delete mode 100644 i18n/unix/i18n.h diff --git a/i18n/unix/Makefile.in b/i18n/unix/Makefile.in index 82cee3e0e51..121691e8ccb 100644 --- a/i18n/unix/Makefile.in +++ b/i18n/unix/Makefile.in @@ -6,7 +6,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I. +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch OBJS=xlate.o @@ -37,6 +37,10 @@ depend: && rm Makefile.new # DO NOT REMOVE +utf8_ucs2.o: utf8_ucs2.c $(INCDIR)/arch/unix/i18n.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_xlate.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_time.h xlate.o: xlate.c $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ diff --git a/i18n/unix/i18n.h b/i18n/unix/i18n.h deleted file mode 100644 index da5f58f2cf6..00000000000 --- a/i18n/unix/i18n.h +++ /dev/null @@ -1,89 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef I18N_H -#define I18N_H - -#include "apr.h" -#include "apr_xlate.h" - -/* If we ever support anything more exciting than char... this could move. - */ -typedef apr_int16_t apr_wchar_t; - -/** - * An APR internal function for fast utf-8 octet-encoded Unicode conversion - * to the ucs-2 wide Unicode format. This function is used for filename and - * other resource conversions for platforms providing native Unicode support. - * - * @tip Only the errors APR_EINVAL and APR_INCOMPLETE may occur, the former - * when the character code is invalid (in or out of context) and the later - * when more characters were expected, but insufficient characters remain. - */ -apr_status_t conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, - apr_wchar_t *out, apr_size_t *outwords); - -/** - * An APR internal function for fast ucs-2 wide Unicode format conversion to - * the utf-8 octet-encoded Unicode. This function is used for filename and - * other resource conversions for platforms providing native Unicode support. - * - * @tip Only the errors APR_EINVAL and APR_INCOMPLETE may occur, the former - * when the character code is invalid (in or out of context) and the later - * when more words were expected, but insufficient words remain. - */ -apr_status_t conv_ucs2_to_utf8(const apr_wchar_t *in, apr_size_t *inwords, - char *out, apr_size_t *outbytes); - -#endif /* def I18N_H */ diff --git a/i18n/unix/utf8_ucs2.c b/i18n/unix/utf8_ucs2.c index a3dddf46764..85f4ab9f9df 100644 --- a/i18n/unix/utf8_ucs2.c +++ b/i18n/unix/utf8_ucs2.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "i18n.h" +#include "unix/i18n.h" /* Implement the design principal specified by RFC 2718 2.2.5 * Guidelines for new URL Schemes - within the APR. From 0fe224031b33f0780ccf3a2f77bed6068f8c5e4e Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 9 Nov 2000 06:25:30 +0000 Subject: [PATCH 0677/7878] Move all of the lock private header files to an arch directory under the include directory. All private header files for APR are being moved. This allows platforms that only implement some of the APR types to compile cleanly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60655 13f79535-47bb-0310-9956-ffa450edef68 --- locks/beos/Makefile.in | 3 +- locks/beos/crossproc.c | 2 +- locks/beos/intraproc.c | 2 +- locks/beos/locks.c | 2 +- locks/beos/locks.h | 93 ------------------------ locks/os2/Makefile.in | 6 +- locks/os2/locks.c | 4 +- locks/os2/locks.h | 77 -------------------- locks/unix/Makefile.in | 48 ++++++------ locks/unix/crossproc.c | 2 +- locks/unix/intraproc.c | 2 +- locks/unix/locks.c | 2 +- locks/unix/locks.h | 161 ----------------------------------------- locks/win32/locks.c | 2 +- locks/win32/locks.h | 70 ------------------ 15 files changed, 36 insertions(+), 440 deletions(-) delete mode 100644 locks/beos/locks.h delete mode 100644 locks/os2/locks.h delete mode 100644 locks/unix/locks.h delete mode 100644 locks/win32/locks.h diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in index b12efecf594..7f0905e761c 100644 --- a/locks/beos/Makefile.in +++ b/locks/beos/Makefile.in @@ -9,8 +9,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCDIR1=../../file_io/unix -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch LIB=liblock.a diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c index 06998e4abb8..02e9bd76e5c 100644 --- a/locks/beos/crossproc.c +++ b/locks/beos/crossproc.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "locks.h" +#include "beos/locks.h" apr_status_t lock_inter_cleanup(void * data) { diff --git a/locks/beos/intraproc.c b/locks/beos/intraproc.c index 0c582a44914..10537de08e8 100644 --- a/locks/beos/intraproc.c +++ b/locks/beos/intraproc.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "locks.h" +#include "beos/locks.h" apr_status_t lock_intra_cleanup(void *data) { diff --git a/locks/beos/locks.c b/locks/beos/locks.c index 37dbd236e9f..e9ed5a078b4 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "locks.h" +#include "beos/locks.h" apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, diff --git a/locks/beos/locks.h b/locks/beos/locks.h deleted file mode 100644 index 685f8a89b83..00000000000 --- a/locks/beos/locks.h +++ /dev/null @@ -1,93 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef LOCKS_H -#define LOCKS_H - -#include <kernel/OS.h> -#include "apr_lock.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_lib.h" - -struct apr_lock_t { - apr_pool_t *cntxt; - apr_locktype_e type; - apr_lockscope_e scope; - int curr_locked; - char *fname; - /* Inter proc */ - sem_id sem_interproc; - int32 ben_interproc; - /* Intra Proc */ - sem_id sem_intraproc; - int32 ben_intraproc; -}; - -apr_status_t create_intra_lock(struct apr_lock_t *new); -apr_status_t lock_intra(struct apr_lock_t *lock); -apr_status_t unlock_intra(struct apr_lock_t *lock); -apr_status_t destroy_intra_lock(struct apr_lock_t *lock); - -apr_status_t create_inter_lock(struct apr_lock_t *new); -apr_status_t lock_inter(struct apr_lock_t *lock); -apr_status_t unlock_inter(struct apr_lock_t *lock); -apr_status_t destroy_inter_lock(struct apr_lock_t *lock); - -apr_status_t child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, - const char *fname); - - -#endif /* LOCKS_H */ - diff --git a/locks/os2/Makefile.in b/locks/os2/Makefile.in index 8ed2eb817b2..eb0fffafb4a 100644 --- a/locks/os2/Makefile.in +++ b/locks/os2/Makefile.in @@ -8,10 +8,8 @@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../inc -INCDIR1=../../include -INCDIR2=../../file_io/os2 -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I$(INCDIR2) -I. +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch LIB=lock.a diff --git a/locks/os2/locks.c b/locks/os2/locks.c index d5a4a2add6e..9dd2e589dbc 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -55,8 +55,8 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" -#include "locks.h" -#include "fileio.h" +#include "os2/locks.h" +#include "os2/fileio.h" #include <string.h> #define INCL_DOS #include <os2.h> diff --git a/locks/os2/locks.h b/locks/os2/locks.h deleted file mode 100644 index 50ffdc65216..00000000000 --- a/locks/os2/locks.h +++ /dev/null @@ -1,77 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef LOCKS_H -#define LOCKS_H - -#include "apr_lock.h" -#include "apr_file_io.h" -#define INCL_DOS -#include <os2.h> - -struct apr_lock_t { - apr_pool_t *cntxt; - apr_locktype_e type; - apr_lockscope_e scope; - char *fname; - HMTX hMutex; - TID owner; - int lock_count; - TIB *tib; -}; - -void setup_lock(); - -#endif /* LOCKS_H */ - diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index f77ee653d99..d1c31b25349 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -9,9 +9,8 @@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR1=../../include -INCDIR2=../../file_io/unix -INCLUDES=-I$(INCDIR1) -I$(INCDIR2) -I. +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch #LIB=liblock.a @@ -51,24 +50,25 @@ depend: && rm Makefile.new # DO NOT REMOVE -crossproc.o: crossproc.c ../../include/apr.h \ - ../../include/apr_strings.h ../../include/apr_lib.h \ - ../../include/apr_pools.h ../../include/apr_thread_proc.h \ - ../../include/apr_file_io.h ../../include/apr_general.h \ - ../../include/apr_errno.h ../../include/apr_time.h \ - ../../include/apr_tables.h locks.h ../../include/apr_private.h \ - ../../include/apr_lock.h -intraproc.o: intraproc.c locks.h ../../include/apr.h \ - ../../include/apr_private.h ../../include/apr_general.h \ - ../../include/apr_errno.h ../../include/apr_lib.h \ - ../../include/apr_pools.h ../../include/apr_thread_proc.h \ - ../../include/apr_file_io.h ../../include/apr_time.h \ - ../../include/apr_tables.h ../../include/apr_lock.h -locks.o: locks.c locks.h ../../include/apr.h \ - ../../include/apr_private.h ../../include/apr_general.h \ - ../../include/apr_errno.h ../../include/apr_lib.h \ - ../../include/apr_pools.h ../../include/apr_thread_proc.h \ - ../../include/apr_file_io.h ../../include/apr_time.h \ - ../../include/apr_tables.h ../../include/apr_lock.h \ - ../../include/apr_strings.h ../../include/apr_portable.h \ - ../../include/apr_network_io.h ../../include/apr_dso.h +crossproc.o: crossproc.c $(INCDIR)/apr.h \ + $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/arch/unix/locks.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_lock.h +intraproc.o: intraproc.c $(INCDIR)/arch/unix/locks.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_lock.h +locks.o: locks.c $(INCDIR)/arch/unix/locks.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_strings.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_dso.h diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index f140183e156..e9cccc2f88c 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -54,7 +54,7 @@ #include "apr.h" #include "apr_strings.h" -#include "locks.h" +#include "unix/locks.h" #if APR_USE_SYSVSEM_SERIALIZE diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index 3b5b9a97ed9..e132bb93918 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "locks.h" +#include "unix/locks.h" #if APR_HAS_THREADS diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 7a8e37c2622..2580c77d002 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "locks.h" +#include "unix/locks.h" #include "apr_strings.h" #include "apr_portable.h" diff --git a/locks/unix/locks.h b/locks/unix/locks.h deleted file mode 100644 index 321cdd18a78..00000000000 --- a/locks/unix/locks.h +++ /dev/null @@ -1,161 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef LOCKS_H -#define LOCKS_H - -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_lock.h" - -/* System headers required by Locks library */ -#if HAVE_UNISTD_H -#include <unistd.h> -#endif -#if HAVE_STRING_H -#include <string.h> -#endif -#if HAVE_USLOCKS_H -#include <uslocks.h> -#endif -#if APR_HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if HAVE_SYS_IPC_H -#include <sys/ipc.h> -#endif -#if HAVE_SYS_SEM_H -#include <sys/sem.h> -#endif -#if HAVE_SYS_FILE_H -#include <sys/file.h> -#endif -#if APR_HAVE_STDIO_H -#include <stdio.h> -#endif -#if HAVE_STDLIB_H -#include <stdlib.h> -#endif -#if APR_HAVE_FCNTL_H -#include <fcntl.h> -#endif -#if HAVE_SYS_MMAN_H -#include <sys/mman.h> -#endif - -#if APR_HAS_THREADS -#if APR_HAVE_PTHREAD_H -#include <pthread.h> -#endif -#endif -/* End System Headers */ - -#if !APR_HAVE_UNION_SEMUN && APR_USE_SYSVSEM_SERIALIZE -/* it makes no sense, but this isn't defined on solaris */ -union semun { - long val; - struct semid_ds *buf; - ushort *array; -}; -#endif - -struct apr_lock_t { - apr_pool_t *cntxt; - apr_locktype_e type; - apr_lockscope_e scope; - int curr_locked; - char *fname; -#if APR_USE_SYSVSEM_SERIALIZE - int interproc; -#elif APR_USE_FCNTL_SERIALIZE - int interproc; -#elif APR_USE_PROC_PTHREAD_SERIALIZE - pthread_mutex_t *interproc; -#elif APR_USE_FLOCK_SERIALIZE - int interproc; -#else - /* No Interprocess serialization. Too bad. */ -#endif -#if APR_HAS_THREADS - /* APR doesn't have threads, no sense in having an thread lock mechanism. - */ -#if APR_USE_PTHREAD_SERIALIZE - pthread_mutex_t *intraproc; -#endif -#endif - /* At some point, we should do a scope for both inter and intra process - * locking here. Something like pthread_mutex with PTHREAD_PROCESS_SHARED - */ -}; - -#if APR_HAS_THREADS -apr_status_t apr_unix_create_intra_lock(struct apr_lock_t *new); -apr_status_t apr_unix_lock_intra(struct apr_lock_t *lock); -apr_status_t apr_unix_unlock_intra(struct apr_lock_t *lock); -apr_status_t apr_unix_destroy_intra_lock(struct apr_lock_t *lock); -#endif - -void apr_unix_setup_lock(void); -apr_status_t apr_unix_create_inter_lock(struct apr_lock_t *new); -apr_status_t apr_unix_lock_inter(struct apr_lock_t *lock); -apr_status_t apr_unix_unlock_inter(struct apr_lock_t *lock); -apr_status_t apr_unix_destroy_inter_lock(struct apr_lock_t *lock); - -apr_status_t apr_unix_child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, - const char *fname); - -#endif /* LOCKS_H */ - diff --git a/locks/win32/locks.c b/locks/win32/locks.c index e4d951cd167..67940bb5e71 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -54,7 +54,7 @@ #include "apr_general.h" #include "apr_strings.h" -#include "locks.h" +#include "win32/locks.h" #include "apr_portable.h" apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, diff --git a/locks/win32/locks.h b/locks/win32/locks.h deleted file mode 100644 index a7515f2382d..00000000000 --- a/locks/win32/locks.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef LOCKS_H -#define LOCKS_H - -#include "apr_lock.h" - -struct apr_lock_t { - apr_pool_t *cntxt; - apr_locktype_e type; - apr_lockscope_e scope; - HANDLE mutex; - CRITICAL_SECTION section; - char *fname; -}; - -#endif /* LOCKS_H */ - From 52003306b6a5c511aca67b9b385174832abbc33e Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 9 Nov 2000 06:30:11 +0000 Subject: [PATCH 0678/7878] Move all of the misc private header files to an arch directory under the include directory. All private header files for APR are being moved. This allows platforms that only implement some of the APR types to compile cleanly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60656 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/Makefile.in | 96 ++++++++++++---------- misc/unix/misc.h | 178 ----------------------------------------- misc/unix/otherchild.c | 2 +- 3 files changed, 55 insertions(+), 221 deletions(-) delete mode 100644 misc/unix/misc.h diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index 0cea0439d74..8c8b5ca5ef4 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -9,11 +9,8 @@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR1=../../include -INCDIR2=../../file_io/@OSDIR@ -INCDIR3=../../locks/@OSDIR@ -INCDIR4=../../threadproc/@OSDIR@ -INCLUDES=-I$(INCDIR1) -I$(INCDIR2) -I$(INCDIR3) -I$(INCDIR4) -I. +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch/@OSDIR@ #LIB=libmisc.a @@ -52,40 +49,55 @@ depend: && rm Makefile.new # DO NOT REMOVE -canonerr.o: canonerr.c misc.h ../../include/apr.h \ - ../../include/apr_private.h ../../include/apr_general.h \ - ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_thread_proc.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_getopt.h -errorcodes.o: errorcodes.c misc.h ../../include/apr.h \ - ../../include/apr_private.h ../../include/apr_general.h \ - ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_thread_proc.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_getopt.h \ - ../../include/apr_strings.h ../../include/apr_lib.h \ - ../../include/apr_tables.h ../../include/apr_dso.h -getopt.o: getopt.c misc.h ../../include/apr.h \ - ../../include/apr_private.h ../../include/apr_general.h \ - ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_thread_proc.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_getopt.h -otherchild.o: otherchild.c ../../include/apr.h misc.h \ - ../../include/apr_private.h ../../include/apr_general.h \ - ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_thread_proc.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_getopt.h \ - ../../threadproc/unix/threadproc.h ../../file_io/unix/fileio.h \ - ../../include/apr_lib.h ../../include/apr_tables.h -rand.o: rand.c misc.h ../../include/apr.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr_errno.h \ - ../../include/apr_pools.h ../../include/apr_thread_proc.h \ - ../../include/apr_file_io.h ../../include/apr_time.h \ - ../../include/apr_getopt.h -start.o: start.c misc.h ../../include/apr.h \ - ../../include/apr_private.h ../../include/apr_general.h \ - ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_thread_proc.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_getopt.h \ - ../../locks/unix/locks.h ../../include/apr_lib.h \ - ../../include/apr_tables.h ../../include/apr_lock.h \ - ../../include/apr_strings.h +canonerr.o: canonerr.c $(INCDIR)/arch/unix/misc.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_getopt.h +errorcodes.o: errorcodes.c $(INCDIR)/arch/unix/misc.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_getopt.h $(INCDIR)/apr_strings.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_dso.h +getopt.o: getopt.c $(INCDIR)/arch/unix/misc.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_getopt.h +getuuid.o: getuuid.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_uuid.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_md5.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_xlate.h +otherchild.o: otherchild.c $(INCDIR)/apr.h \ + $(INCDIR)/arch/unix/misc.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_getopt.h $(INCDIR)/arch/unix/threadproc.h \ + $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_lib.h +rand.o: rand.c $(INCDIR)/arch/unix/misc.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_getopt.h +start.o: start.c $(INCDIR)/arch/unix/misc.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_getopt.h \ + $(INCDIR)/arch/unix/locks.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_strings.h +uuid.o: uuid.c $(INCDIR)/apr.h $(INCDIR)/apr_uuid.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h diff --git a/misc/unix/misc.h b/misc/unix/misc.h deleted file mode 100644 index e0ce1d050ab..00000000000 --- a/misc/unix/misc.h +++ /dev/null @@ -1,178 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef MISC_H -#define MISC_H - -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_getopt.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "apr_errno.h" -#include "apr_getopt.h" -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#if APR_HAVE_STDIO_H -#include <stdio.h> -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif -#if APR_HAVE_SIGNAL_H -#include <signal.h> -#endif -#if APR_HAVE_PTHREAD_H -#include <pthread.h> -#endif -#ifdef BEOS -#include <kernel/OS.h> -#endif - -typedef struct datastruct { - const void *data; - const char *key; - struct datastruct *next; - struct datastruct *prev; -} datastruct; - -struct apr_other_child_rec_t { - struct apr_other_child_rec_t *next; - int id; /* This is either a pid or tid depending on the platform */ - void (*maintenance) (int, void *, int); - void *data; - int write_fd; -}; - -#ifdef WIN32 -#define WSAHighByte 2 -#define WSALowByte 0 -/* Platform specific designation of run time os version. - * Gaps allow for specific service pack levels that - * export new kernel or winsock functions or behavior. - */ -typedef enum { - APR_WIN_95 = 0, - APR_WIN_98 = 4, - APR_WIN_NT = 8, - APR_WIN_NT_4 = 12, - APR_WIN_NT_4_SP2 = 14, - APR_WIN_NT_4_SP3 = 15, - APR_WIN_NT_4_SP4 = 16, - APR_WIN_NT_4_SP6 = 18, - APR_WIN_2000 = 24 -} apr_oslevel_e; - - -typedef enum { - DLL_WINBASEAPI = 0, // kernel32 From WinBase.h - DLL_WINADVAPI = 1, // advapi32 From WinBase.h - DLL_WINSOCKAPI = 2, // mswsock From WinSock.h - DLL_WINSOCK2API = 3, // ws2_32 From WinSock2.h - DLL_defined = 4 // must define as last idx_ + 1 -} apr_dlltoken_e; - -FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); - -/* The apr_load_dll_func call WILL fault if the function cannot be loaded */ - -#define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ - typedef rettype (calltype *apr_winapi_fpt_##fn) args; \ - static apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \ - __inline rettype apr_winapi_##fn args \ - { if (!apr_winapi_pfn_##fn) \ - apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \ - apr_load_dll_func(lib, #fn, ord); \ - return (*(apr_winapi_pfn_##fn)) names; }; \ - -/* Provide late bound declarations of every API function missing from - * one or more supported releases of the Win32 API - * - * lib is the enumerated token from apr_dlltoken_e, and must correspond - * to the string table entry in start.c used by the apr_load_dll_func(). - * Token names (attempt to) follow Windows.h declarations prefixed by DLL_ - * in order to facilitate comparison. Use the exact declaration syntax - * and names from Windows.h to prevent ambigutity and bugs. - * - * rettype and calltype follow the original declaration in Windows.h - * fn is the true function name - beware Ansi/Unicode #defined macros - * ord is the ordinal within the library, use 0 if it varies between versions - * args is the parameter list following the original declaration, in parens - * names is the parameter list sans data types, enclosed in parens - * - * #undef/re#define the Ansi/Unicode generic name to abate confusion - * In the case of non-text functions, simply #define the original name - */ - -APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( - IN LPCSTR lpFileName, - IN GET_FILEEX_INFO_LEVELS fInfoLevelId, - OUT LPVOID lpFileInformation), - (lpFileName, fInfoLevelId, lpFileInformation)); -#undef GetFileAttributesEx -#define GetFileAttributesEx apr_winapi_GetFileAttributesExA - -APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( - IN HANDLE hFile), - (hFile)); -#define CancelIo apr_winapi_CancelIo - -apr_status_t apr_get_oslevel(struct apr_pool_t *, apr_oslevel_e *); -#endif /* WIN32 */ - -#endif /* ! MISC_H */ - diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index fb77b36b11c..e12729b2bfc 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -55,7 +55,7 @@ #include "apr.h" #include "misc.h" #include "threadproc.h" -#include "../../file_io/unix/fileio.h" +#include "fileio.h" #ifdef HAVE_TIME_H #include <sys/time.h> #endif From 8bd80b9b84e0e5edd3ae67d724e71ef5bbf75b2a Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 9 Nov 2000 06:36:04 +0000 Subject: [PATCH 0679/7878] Move all of the shmem private header files to an arch directory under the include directory. All private header files for APR are being moved. This allows platforms that only implement some of the APR types to compile cleanly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60657 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/os2/Makefile.in | 6 ++---- shmem/unix/Makefile.in | 14 ++++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/shmem/os2/Makefile.in b/shmem/os2/Makefile.in index f2dd8bce2a8..8e597864a78 100644 --- a/shmem/os2/Makefile.in +++ b/shmem/os2/Makefile.in @@ -8,10 +8,8 @@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../inc -INCDIR1=../../include -INCDIR2=../../file_io/os2 -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I$(INCDIR2) -I. +INCDIR=../../include +INCLUDES=-I$(INCDIR) LIB=shmem.a diff --git a/shmem/unix/Makefile.in b/shmem/unix/Makefile.in index aed93d98b1f..ab16d973687 100644 --- a/shmem/unix/Makefile.in +++ b/shmem/unix/Makefile.in @@ -10,11 +10,9 @@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../inc -INCDIR1=../../include -INCDIR2=../../misc/@OSDIR@ -INCDIR3=mm -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I$(INCDIR2) -I$(INCDIR3) -I. +INCDIR=../../include +INCDIR1=mm +INCLUDES=-I$(INCDIR) -I$(INCDIR1) LIB=libshmem.a @@ -56,6 +54,6 @@ depend: && rm Makefile.new # DO NOT REMOVE -shmem.o: shmem.c mm/mm.h ../../include/apr_general.h \ - ../../include/apr.h ../../include/apr_errno.h \ - ../../include/apr_shmem.h +shmem.o: shmem.c mm/mm.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_shmem.h From fe1a3376975613daaca66d7cb6a6fbf27c1703c9 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 9 Nov 2000 06:38:15 +0000 Subject: [PATCH 0680/7878] Clean up a Makefile git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60658 13f79535-47bb-0310-9956-ffa450edef68 --- strings/Makefile.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/strings/Makefile.in b/strings/Makefile.in index 7b531e7ef1e..43049e6006b 100644 --- a/strings/Makefile.in +++ b/strings/Makefile.in @@ -11,8 +11,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include -INCDIR1=../misc/@OSDIR@ -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix +INCLUDES=-I$(INCDIR) #LIB=@LIBPREFIX@apr.a From 11becf443008e11e5c96e8e768f9c1dc6d744466 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 9 Nov 2000 06:40:17 +0000 Subject: [PATCH 0681/7878] Cleanup the tables Makefiles. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60659 13f79535-47bb-0310-9956-ffa450edef68 --- tables/Makefile.in | 5 ++--- tables/apr_tables.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tables/Makefile.in b/tables/Makefile.in index 53d47af9f89..bf6cb862b0d 100644 --- a/tables/Makefile.in +++ b/tables/Makefile.in @@ -11,8 +11,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include -INCDIR1=../misc/@OSDIR@ -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch OBJS=apr_tables.o \ apr_hash.o @@ -58,4 +57,4 @@ apr_tables.o: apr_tables.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ - ../misc/unix/misc.h $(INCDIR)/apr_getopt.h + $(INCDIR)/arch/unix/misc.h $(INCDIR)/apr_getopt.h diff --git a/tables/apr_tables.c b/tables/apr_tables.c index abfd4b395f5..d9613d4fceb 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -66,7 +66,7 @@ #include "apr_tables.h" #include "apr_strings.h" #include "apr_lib.h" -#include "misc.h" +#include "unix/misc.h" #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif From 1d0beb2efe270e8748c40a797a32ccca5f0463ca Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 9 Nov 2000 06:47:54 +0000 Subject: [PATCH 0682/7878] Move all of the threadproc private header files to an arch directory under the include directory. All private header files for APR are being moved. This allows platforms that only implement some of the APR types to compile cleanly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60660 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/Makefile.in | 3 +- threadproc/beos/proc.c | 2 +- threadproc/beos/thread.c | 2 +- threadproc/beos/threadpriv.c | 2 +- threadproc/beos/threadproc.h | 125 --------------------------------- threadproc/os2/Makefile.in | 4 +- threadproc/os2/proc.c | 4 +- threadproc/os2/signals.c | 4 +- threadproc/os2/thread.c | 2 +- threadproc/os2/threadpriv.c | 4 +- threadproc/os2/threadproc.h | 101 --------------------------- threadproc/unix/Makefile.in | 62 ++++++++-------- threadproc/unix/proc.c | 2 +- threadproc/unix/procsup.c | 2 +- threadproc/unix/signals.c | 4 +- threadproc/unix/thread.c | 2 +- threadproc/unix/threadpriv.c | 2 +- threadproc/unix/threadproc.h | 128 ---------------------------------- threadproc/win32/proc.c | 4 +- threadproc/win32/signals.c | 4 +- threadproc/win32/thread.c | 2 +- threadproc/win32/threadpriv.c | 2 +- threadproc/win32/threadproc.h | 96 ------------------------- 23 files changed, 56 insertions(+), 507 deletions(-) delete mode 100644 threadproc/beos/threadproc.h delete mode 100644 threadproc/os2/threadproc.h delete mode 100644 threadproc/unix/threadproc.h delete mode 100644 threadproc/win32/threadproc.h diff --git a/threadproc/beos/Makefile.in b/threadproc/beos/Makefile.in index 04f8fd3a611..6d5539818e2 100644 --- a/threadproc/beos/Makefile.in +++ b/threadproc/beos/Makefile.in @@ -9,8 +9,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCDIR1=../../file_io/unix -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch LIB=libthreadproc.a diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index bf09188c54a..9135178b788 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "threadproc.h" +#include "beos/threadproc.h" struct send_pipe { int in; diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index c646b0ae577..48500269d6c 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "threadproc.h" +#include "beos/threadproc.h" apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) { diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index 0044944f629..524a04af26e 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "threadproc.h" +#include "beos/threadproc.h" static struct beos_key key_table[BEOS_MAX_DATAKEYS]; static struct beos_private_data *beos_data[BEOS_MAX_DATAKEYS]; diff --git a/threadproc/beos/threadproc.h b/threadproc/beos/threadproc.h deleted file mode 100644 index fcff52c151d..00000000000 --- a/threadproc/beos/threadproc.h +++ /dev/null @@ -1,125 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "apr_thread_proc.h" -#include "../../file_io/unix/fileio.h" -#include "apr_file_io.h" -#include "apr_thread_proc.h" -#include "apr_general.h" -#include "apr_portable.h" -#include <kernel/OS.h> -#include <signal.h> -#include <string.h> -#include <sys/wait.h> -#include <image.h> - -#ifndef THREAD_PROC_H -#define THREAD_PROC_H - -#define SHELL_PATH "/bin/sh" - -#define PTHREAD_CANCEL_AYNCHRONOUS CANCEL_ASYNCH; -#define PTHREAD_CANCEL_DEFERRED CANCEL_DEFER; - -#define PTHREAD_CANCEL_ENABLE CANCEL_ENABLE; -#define PTHREAD_CANCEL_DISABLE CANCEL_DISABLE; - -#define BEOS_MAX_DATAKEYS 128 - -struct apr_thread_t { - apr_pool_t *cntxt; - thread_id td; -}; - -struct apr_threadattr_t { - apr_pool_t *cntxt; - int32 attr; - int detached; - int joinable; -}; - -struct apr_threadkey_t { - apr_pool_t *cntxt; - int32 key; -}; - -struct beos_private_data { - const void ** data; - int count; - volatile thread_id td; -}; - -struct beos_key { - int assigned; - int count; - sem_id lock; - int32 ben_lock; - void (* destructor) (void *); -}; - -struct apr_procattr_t { - apr_pool_t *cntxt; - apr_file_t *parent_in; - apr_file_t *child_in; - apr_file_t *parent_out; - apr_file_t *child_out; - apr_file_t *parent_err; - apr_file_t *child_err; - char *currdir; - apr_int32_t cmdtype; - apr_int32_t detached; -}; - -#endif /* ! THREAD_PROC_H */ - diff --git a/threadproc/os2/Makefile.in b/threadproc/os2/Makefile.in index 24b36196fd8..70c04dcce83 100644 --- a/threadproc/os2/Makefile.in +++ b/threadproc/os2/Makefile.in @@ -8,10 +8,8 @@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../inc INCDIR1=../../include -INCDIR2=../../file_io/os2 -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I$(INCDIR2) -I. +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch LIB=threadproc.a diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 4a88675ccfb..68e29fab7dd 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -55,8 +55,8 @@ #define INCL_DOS #define INCL_DOSERRORS -#include "threadproc.h" -#include "fileio.h" +#include "os2/threadproc.h" +#include "os2/fileio.h" #include "apr_private.h" #include "apr_thread_proc.h" #include "apr_file_io.h" diff --git a/threadproc/os2/signals.c b/threadproc/os2/signals.c index 6efd71d1822..732bd73e842 100644 --- a/threadproc/os2/signals.c +++ b/threadproc/os2/signals.c @@ -53,8 +53,8 @@ */ #define INCL_DOSEXCEPTIONS -#include "threadproc.h" -#include "fileio.h" +#include "os2/threadproc.h" +#include "os2/fileio.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_general.h" diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 3879f6d8012..5e60b817d7d 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -54,7 +54,7 @@ #define INCL_DOSERRORS #define INCL_DOS -#include "threadproc.h" +#include "os2/threadproc.h" #include "apr_thread_proc.h" #include "apr_general.h" #include "apr_lib.h" diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index 15143e512a4..f038af494e1 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -52,12 +52,12 @@ * <http://www.apache.org/>. */ -#include "threadproc.h" +#include "os2/threadproc.h" #include "apr_thread_proc.h" #include "apr_general.h" #include "apr_errno.h" #include "apr_lib.h" -#include "fileio.h" +#include "os2/fileio.h" apr_status_t apr_create_thread_private(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) diff --git a/threadproc/os2/threadproc.h b/threadproc/os2/threadproc.h deleted file mode 100644 index c14c54aa00c..00000000000 --- a/threadproc/os2/threadproc.h +++ /dev/null @@ -1,101 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "apr_thread_proc.h" -#include "apr_file_io.h" - -#ifndef THREAD_PROC_H -#define THREAD_PROC_H - -#define APR_THREADATTR_DETACHED 1 - -#define SHELL_PATH "cmd.exe" -#define APR_THREAD_STACKSIZE 65536 - -struct apr_threadattr_t { - apr_pool_t *cntxt; - unsigned long attr; -}; - -struct apr_thread_t { - apr_pool_t *cntxt; - struct apr_threadattr_t *attr; - unsigned long tid; - apr_thread_start_t func; - void *data; - void *rv; -}; - -struct apr_threadkey_t { - apr_pool_t *cntxt; - unsigned long *key; -}; - -struct apr_procattr_t { - apr_pool_t *cntxt; - apr_file_t *parent_in; - apr_file_t *child_in; - apr_file_t *parent_out; - apr_file_t *child_out; - apr_file_t *parent_err; - apr_file_t *child_err; - char *currdir; - apr_int32_t cmdtype; - apr_int32_t detached; -}; - -typedef void (*os2_thread_start_t)(void *); - -#endif /* ! THREAD_PROC_H */ - diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index 81ff6fedc1d..a369ec65391 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -10,8 +10,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCDIR1=../../file_io/unix -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch LIB=libthreadproc.a @@ -53,40 +52,43 @@ depend: && rm Makefile.new # DO NOT REMOVE -proc.o: proc.c threadproc.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_strings.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_dso.h -procsup.o: procsup.c threadproc.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h -signals.o: signals.c threadproc.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h +proc.o: proc.c $(INCDIR)/arch/unix/threadproc.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_time.h $(INCDIR)/arch/unix/fileio.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_strings.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h +procsup.o: procsup.c $(INCDIR)/arch/unix/threadproc.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_time.h $(INCDIR)/arch/unix/fileio.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h +signals.o: signals.c $(INCDIR)/arch/unix/threadproc.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_time.h $(INCDIR)/arch/unix/fileio.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h thread.o: thread.c $(INCDIR)/apr.h $(INCDIR)/apr_portable.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h threadproc.h \ - $(INCDIR)/apr_private.h ../../file_io/unix/fileio.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_tables.h + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ + $(INCDIR)/arch/unix/threadproc.h $(INCDIR)/apr_private.h \ + $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h threadpriv.o: threadpriv.c $(INCDIR)/apr.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_dso.h threadproc.h $(INCDIR)/apr_private.h \ - ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h + $(INCDIR)/apr_dso.h $(INCDIR)/arch/unix/threadproc.h \ + $(INCDIR)/apr_private.h $(INCDIR)/arch/unix/fileio.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index b97abc80a57..c826a755bd2 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "threadproc.h" +#include "unix/threadproc.h" #include "apr_strings.h" #include "apr_portable.h" diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index e29954cda7e..73215e4d789 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "threadproc.h" +#include "unix/threadproc.h" apr_status_t apr_detach(void) { diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 61184423fd2..e0ce0cf2abf 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -53,9 +53,9 @@ */ #ifndef BEOS -#include "threadproc.h" +#include "unix/threadproc.h" #else -#include "../beos/threadproc.h" +#include "beos/threadproc.h" #endif #include "apr_private.h" #include "apr_lib.h" diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 482ef124db9..5f47c5f3938 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -54,7 +54,7 @@ #include "apr.h" #include "apr_portable.h" -#include "threadproc.h" +#include "unix/threadproc.h" #if APR_HAS_THREADS diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 72e7dbc01c0..9fc5588c566 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -54,7 +54,7 @@ #include "apr.h" #include "apr_portable.h" -#include "threadproc.h" +#include "unix/threadproc.h" #if APR_HAS_THREADS diff --git a/threadproc/unix/threadproc.h b/threadproc/unix/threadproc.h deleted file mode 100644 index d5f0a679f4b..00000000000 --- a/threadproc/unix/threadproc.h +++ /dev/null @@ -1,128 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "apr.h" -#include "apr_private.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "fileio.h" - -/* System headers required for thread/process library */ -#if APR_HAVE_PTHREAD_H -#include <pthread.h> -#endif -#if HAVE_SYS_RESOURCE_H -#include <sys/resource.h> -#endif -#if APR_HAVE_SIGNAL_H -#include <signal.h> -#endif -#if HAVE_STRING_H -#include <string.h> -#endif -#if APR_HAVE_SYS_WAIT_H -#include <sys/wait.h> -#endif -#if HAVE_STRING_H -#include <string.h> -#endif -/* End System Headers */ - - -#ifndef THREAD_PROC_H -#define THREAD_PROC_H - -#define SHELL_PATH "/bin/sh" - -#if APR_HAS_THREADS -struct apr_thread_t { - apr_pool_t *cntxt; - pthread_t *td; -}; - -struct apr_threadattr_t { - apr_pool_t *cntxt; - pthread_attr_t *attr; -}; - -struct apr_threadkey_t { - apr_pool_t *cntxt; - pthread_key_t key; -}; -#endif - -struct apr_procattr_t { - apr_pool_t *cntxt; - apr_file_t *parent_in; - apr_file_t *child_in; - apr_file_t *parent_out; - apr_file_t *child_out; - apr_file_t *parent_err; - apr_file_t *child_err; - char *currdir; - apr_int32_t cmdtype; - apr_int32_t detached; -#ifdef RLIMIT_CPU - struct rlimit *limit_cpu; -#endif -#if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS) - struct rlimit *limit_mem; -#endif -#ifdef RLIMIT_NPROC - struct rlimit *limit_nproc; -#endif -}; - -#endif /* ! THREAD_PROC_H */ - diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 04f88ab0fc7..e230b5a9783 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -52,8 +52,8 @@ * <http://www.apache.org/>. */ -#include "threadproc.h" -#include "fileio.h" +#include "win32/threadproc.h" +#include "win32/fileio.h" #include "apr_thread_proc.h" #include "apr_file_io.h" diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index f19e36e7bb8..9c283bf3036 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -52,8 +52,8 @@ * <http://www.apache.org/>. */ -#include "threadproc.h" -#include "fileio.h" +#include "win32/threadproc.h" +#include "win32/fileio.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_general.h" diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index eb94fec8b93..75fc18db9d1 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -53,7 +53,7 @@ */ #include "apr_private.h" -#include "threadproc.h" +#include "win32/threadproc.h" #include "apr_thread_proc.h" #include "apr_general.h" #include "apr_lib.h" diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 59da3d4ea89..940750f6461 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "threadproc.h" +#include "win32/threadproc.h" #include "apr_thread_proc.h" #include "apr_general.h" #include "apr_lib.h" diff --git a/threadproc/win32/threadproc.h b/threadproc/win32/threadproc.h deleted file mode 100644 index 24a140bb1e1..00000000000 --- a/threadproc/win32/threadproc.h +++ /dev/null @@ -1,96 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "apr_private.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" - -#ifndef THREAD_PROC_H -#define THREAD_PROC_H - -#define SHELL_PATH "cmd.exe" - -struct apr_thread_t { - apr_pool_t *cntxt; - HANDLE td; - apr_int32_t cancel; - apr_int32_t cancel_how; -}; - -struct apr_threadattr_t { - apr_pool_t *cntxt; - apr_int32_t detach; -}; - -struct apr_threadkey_t { - apr_pool_t *cntxt; - DWORD key; -}; - -struct apr_procattr_t { - apr_pool_t *cntxt; - STARTUPINFO si; - apr_file_t *parent_in; - apr_file_t *child_in; - apr_file_t *parent_out; - apr_file_t *child_out; - apr_file_t *parent_err; - apr_file_t *child_err; - char *currdir; - apr_int32_t cmdtype; - apr_int32_t detached; -}; - -#endif /* ! THREAD_PROC_H */ - From b7f5e14ad304a79d4254a18d0488c858963e1bdd Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 9 Nov 2000 06:50:16 +0000 Subject: [PATCH 0683/7878] Move all of the time private header files to an arch directory under the include directory. All private header files for APR are being moved. This allows platforms that only implement some of the APR types to compile cleanly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60661 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/Makefile.in | 2 +- time/win32/access.c | 2 +- time/win32/atime.h | 72 ------------------------------------------- time/win32/time.c | 2 +- time/win32/timestr.c | 2 +- 5 files changed, 4 insertions(+), 76 deletions(-) delete mode 100644 time/win32/atime.h diff --git a/time/unix/Makefile.in b/time/unix/Makefile.in index de9b04326e8..1427daa6752 100644 --- a/time/unix/Makefile.in +++ b/time/unix/Makefile.in @@ -10,7 +10,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I. +INCLUDES=-I$(INCDIR) #LIB=libtime.a diff --git a/time/win32/access.c b/time/win32/access.c index 0bc5f871908..2df67fb4206 100644 --- a/time/win32/access.c +++ b/time/win32/access.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "atime.h" +#include "win32/atime.h" #include "apr_time.h" #include "apr_general.h" #include "apr_lib.h" diff --git a/time/win32/atime.h b/time/win32/atime.h deleted file mode 100644 index d4a25731589..00000000000 --- a/time/win32/atime.h +++ /dev/null @@ -1,72 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef ATIME_H -#define ATIME_H - -#include "apr_private.h" -#include "apr_time.h" -#include <time.h> - -struct atime_t { - apr_pool_t *cntxt; - apr_time_t currtime; - SYSTEMTIME *explodedtime; -}; - -void FileTimeToAprTime(apr_time_t *atime, FILETIME *ft); -void AprTimeToFileTime(LPFILETIME pft, apr_time_t t); - -#endif /* ! ATIME_H */ - diff --git a/time/win32/time.c b/time/win32/time.c index 71d91396b6e..3bbeadfd1be 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "atime.h" +#include "win32/atime.h" #include "apr_time.h" #include "apr_general.h" #include "apr_lib.h" diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 6df9dcc39bf..69db6fcd3a3 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "atime.h" +#include "win32/atime.h" #include "apr_portable.h" APR_DECLARE_DATA const char apr_month_snames[12][4] = From 72315f3a8beb403523fabf39572b8745e81344e9 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 9 Nov 2000 06:57:35 +0000 Subject: [PATCH 0684/7878] Allow lib directory to compile after the header file move. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60662 13f79535-47bb-0310-9956-ffa450edef68 --- lib/Makefile.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Makefile.in b/lib/Makefile.in index a9e96d5b020..7bf30dec51e 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -11,8 +11,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include -INCDIR1=../misc/@OSDIR@ -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch/@OSDIR@ #LIB=@LIBPREFIX@apr.a @@ -56,8 +55,8 @@ apr_pools.o: apr_pools.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ $(INCDIR)/apr_dso.h $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h ../misc/unix/misc.h \ - $(INCDIR)/apr_getopt.h + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/arch/unix/misc.h $(INCDIR)/apr_getopt.h apr_signal.o: apr_signal.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ From 9bae4c4fa85531a10b31835863c984d62250978f Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 9 Nov 2000 07:12:39 +0000 Subject: [PATCH 0685/7878] unix/misc.h isn't actually used, so it shouldn't be included anymore. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60663 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index d9613d4fceb..7e91e952d39 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -66,7 +66,6 @@ #include "apr_tables.h" #include "apr_strings.h" #include "apr_lib.h" -#include "unix/misc.h" #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif From 64b67b2a87c89bd918c55e1e4d90389be901ecc6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 9 Nov 2000 07:13:42 +0000 Subject: [PATCH 0686/7878] Tie up some loose ends that fell through the cracks while I was fixing things the first time. The server compiles again after this change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60664 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/unix/Makefile.in | 7 +++---- network_io/unix/Makefile.in | 6 +++--- network_io/unix/poll.c | 2 +- network_io/unix/sendrecv.c | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/mmap/unix/Makefile.in b/mmap/unix/Makefile.in index 2677f3e77ea..577d5da3627 100644 --- a/mmap/unix/Makefile.in +++ b/mmap/unix/Makefile.in @@ -10,8 +10,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCDIR1=../../file_io/@OSDIR@ -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch LIB=libmmap.a @@ -61,5 +60,5 @@ mmap.o: mmap.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ - ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h + $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h diff --git a/network_io/unix/Makefile.in b/network_io/unix/Makefile.in index d509193e518..e0d89a3f05d 100644 --- a/network_io/unix/Makefile.in +++ b/network_io/unix/Makefile.in @@ -10,7 +10,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I. +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch LIB=libnetwork.a @@ -59,14 +59,14 @@ poll.o: poll.c networkio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ - ../../file_io/unix/fileio.h + $(INCDIR)/arch/unix/fileio.h sendrecv.o: sendrecv.c networkio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ - ../../file_io/unix/fileio.h + $(INCDIR)/arch/unix/fileio.h sockaddr.o: sockaddr.c networkio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index b797ccf378d..72ea622e1ff 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -53,7 +53,7 @@ */ #include "networkio.h" -#include "../../file_io/unix/fileio.h" +#include "unix/fileio.h" #ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 6276bee23d3..56e6dbfb071 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -56,7 +56,7 @@ #if APR_HAS_SENDFILE /* This file is needed to allow us access to the apr_file_t internals. */ -#include "../../file_io/unix/fileio.h" +#include "unix/fileio.h" /* Glibc2.1.1 fails to define TCP_CORK. This is a bug that will be *fixed in the next release. It should be 3 From 41b8cdae5a92a5234c1d37ca7193418e98dcc995 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 9 Nov 2000 14:06:42 +0000 Subject: [PATCH 0687/7878] Fixes most of the Unicode problems for Win9x, and expands the effective path lengths for NT volumes beyond MAX_PATH. More patches to come, this one doesn't work in my canonical-overhaul tree, your results may vary. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60665 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileacc.c | 12 +-- file_io/win32/dir.c | 41 ++++---- file_io/win32/filedup.c | 2 +- file_io/win32/fileio.h | 219 +++++++++++++++++++++++++++++++++++++++ file_io/win32/filestat.c | 15 +-- file_io/win32/open.c | 54 +++++++++- 6 files changed, 300 insertions(+), 43 deletions(-) create mode 100644 file_io/win32/fileio.h diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index d1007b1f784..ef0676e7d6f 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -78,14 +78,8 @@ apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) apr_oslevel_e os_level; if (!apr_get_oslevel(thefile->cntxt, &os_level) && os_level >= APR_WIN_NT) { - apr_status_t rv; - int len = wcslen(thefile->w.fname) + 1; - int dremains = MAX_PATH; - *fname = apr_palloc(thefile->cntxt, len * 2); - if ((rv = conv_ucs2_to_utf8(thefile->w.fname, &len, - *fname, &dremains))) - return rv; - if (len) + *fname = unicode_to_utf8_path(thefile->w.fname, thefile->cntxt); + if (!*fname) return APR_ENAMETOOLONG; } else @@ -93,7 +87,7 @@ apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) *fname = apr_pstrdup(thefile->cntxt, thefile->n.fname); #else /* !def Win32 */ - *fname = apr_pstrdup(thefile->cntxt, thefile->fname); + *fname = apr_pstrdup(thefile->cntxt, thefile->fname); #endif return APR_SUCCESS; } diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 2522fb3b7e8..ffd66c917d8 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -89,24 +89,29 @@ apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) apr_oslevel_e os_level; if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { - apr_status_t rv; - int lremains = len; - int dremains = len; + /* While there is now a generic accessor to convert to Unicode, + * we do something special here to provide a few extra wchars + * for the /* (really \*) suffix + */ + int srcremains = len; + int dirremains = len; + apr_wchar_t *wch; (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); (*new)->w.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); - (*new)->w.dirname = apr_palloc(cont, dremains + 7); - wcscpy((*new)->w.dirname, L"//?/"); - if ((rv = conv_utf8_to_ucs2(dirname, &lremains, - (*new)->w.dirname + 4, &dremains))) - return rv; - if (lremains) + (*new)->w.dirname = apr_palloc(cont, dirremains + 7); + wcscpy((*new)->w.dirname, L"\\\\?\\"); + if (conv_utf8_to_ucs2(dirname, &srcremains, + (*new)->w.dirname + 4, &dirremains) || srcremains) return APR_ENAMETOOLONG; - len = len + 4 - dremains; + len = 4 + len - dirremains; if (len && (*new)->w.dirname[len - 1] != '/') { (*new)->w.dirname[len++] = '/'; } (*new)->w.dirname[len++] = '*'; (*new)->w.dirname[len] = '\0'; + for (wch = (*new)->w.dirname + 4; *wch; ++wch); + if (*wch == L'/') + *wch = L'\\'; } else #endif @@ -238,14 +243,14 @@ apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) apr_oslevel_e os_level; if (!apr_get_oslevel(thedir->cntxt, &os_level) && os_level >= APR_WIN_NT) { - apr_status_t rv; - int len = wcslen(thedir->w.entry->cFileName) + 1; - int dremains = MAX_PATH; - (*new) = apr_palloc(thedir->cntxt, len * 2); - if ((rv = conv_ucs2_to_utf8(thedir->w.entry->cFileName, &len, - *new, &dremains))) - return rv; - if (len) + /* The usual Unicode to char* accessor doesn't work here. Since we don't + * have a full path, and don't need to transpose slashes, we don't need it + */ + int entremains = wcslen(thedir->w.entry->cFileName) + 1; + int retremains = (entremains - 1) * 3 + 1; + (*new) = apr_palloc(thedir->cntxt, retremains); + if (conv_ucs2_to_utf8(thedir->w.entry->cFileName, &entremains, + *new, &retremains) || entremains) return APR_ENAMETOOLONG; } else diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index a7ed9fa2bd3..b14e34fdd50 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -109,7 +109,7 @@ apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t { int len = wcslen(old_file->w.fname) + 1; (*new_file)->w.fname = apr_palloc(old_file->cntxt, len * 2); - wcscpy((*new_file)->w.fname, old_file->w.fname); + memcpy((*new_file)->w.fname, old_file->w.fname, len * 2); } else #endif diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h new file mode 100644 index 00000000000..d379535636d --- /dev/null +++ b/file_io/win32/fileio.h @@ -0,0 +1,219 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#ifndef FILE_IO_H +#define FILE_IO_H + +#include "apr.h" +#include "apr_private.h" +#include "apr_pools.h" +#include "apr_general.h" +#include "apr_tables.h" +#include "apr_lock.h" +#include "apr_file_io.h" +#include "apr_errno.h" +#include "misc.h" + +#if APR_HAVE_SYS_STAT_H +#include <sys/stat.h> +#endif +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_FCNTL_H +#include <fcntl.h> +#endif +#ifdef HAVE_TIME_H +#include <time.h> +#endif +#if APR_HAVE_DIRENT_H +#include <dirent.h> +#endif +#ifdef HAVE_MALLOC_H +#include <malloc.h> +#endif +#ifdef HAVE_UIO_H +#include <sys/uio.h> +#endif + +#define APR_FILE_BUFSIZE 4096 + +#if APR_HAS_UNICODE_FS +#include "i18n.h" +#include <wchar.h> + +typedef apr_int16_t apr_wchar_t; + +apr_wchar_t *utf8_to_unicode_path(const char* srcstr, apr_pool_t *p); +char *unicode_to_utf8_path(const apr_wchar_t* srcstr, apr_pool_t *p); +#endif + +typedef enum apr_canon_case_e { + APR_CANON_CASE_GIVEN, + APR_CANON_CASE_LOWER, + APR_CANON_CASE_TRUE +} apr_canon_case_e; + +typedef enum apr_canon_path_e { + APR_CANON_PATH_VIRUTAL, + APR_CANON_PATH_ABSOLUTE, + APR_CANON_PATH_RELATIVE +} apr_canon_path_e; + +/* + * Internal canonical filename elements for the apr_canon_t elems + * ccase tracks the mechanism used to resolve this element + * pathlen is the full path length to the end of this element + * name slash is prefix, as appropriate + + */ +typedef struct apr_canon_elem_t { + apr_canon_case_e ccase; + int pathlen; + char *name; +} apr_canon_elem_t; + +/* warning: win32 canonical path "/" resolves to a + * zero'th element of the empty string for testing the + * psudo-root for the system + */ +struct apr_canon_t { + apr_pool_t *cntxt; + apr_array_header_t *elems; + apr_canon_path_e type; +}; + +/* quick run-down of fields in windows' apr_file_t structure that may have + * obvious uses. + * fname -- the filename as passed to the open call. + * dwFileAttricutes -- Attributes used to open the file. + * demonfname -- the canonicalized filename. Used to store the result from + * apr_os_canonicalize_filename. + * lowerdemonfname -- inserted at Ken Parzygnat's request, because of the + * ugly way windows deals with case in the filesystem. + * append -- Windows doesn't support the append concept when opening files. + * APR needs to keep track of this, and always make sure we append + * correctly when writing to a file with this flag set TRUE. + */ + +struct apr_file_t { + apr_pool_t *cntxt; + HANDLE filehand; + BOOLEAN pipe; // Is this a pipe of a file? + OVERLAPPED *pOverlapped; + apr_interval_time_t timeout; + + /* File specific info */ + union { +#if APR_HAS_UNICODE_FS + struct { + apr_wchar_t *fname; + } w; +#endif + struct { + char *fname; + } n; + }; + apr_canon_t *canonname; + + DWORD dwFileAttributes; + int eof_hit; + BOOLEAN buffered; // Use buffered I/O? + int ungetchar; // Last char provided by an unget op. (-1 = no char) + int append; + off_t size; + apr_time_t atime; + apr_time_t mtime; + apr_time_t ctime; + + /* Stuff for buffered mode */ + char *buffer; + apr_ssize_t bufpos; // Read/Write position in buffer + apr_ssize_t dataRead; // amount of valid data read into buffer + int direction; // buffer being used for 0 = read, 1 = write + apr_ssize_t filePtr; // position in file of handle + apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields + + /* Pipe specific info */ + +}; + +struct apr_dir_t { + apr_pool_t *cntxt; + HANDLE dirhand; + union { +#if APR_HAS_UNICODE_FS + struct { + apr_wchar_t *dirname; + WIN32_FIND_DATAW *entry; + } w; +#endif + struct { + char *dirname; + WIN32_FIND_DATA *entry; + } n; + }; +}; + +apr_status_t file_cleanup(void *); + +/** + * Internal function to create a Win32/NT pipe that respects some async + * timeout options. + */ +apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, + BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, + apr_pool_t *p); +#endif /* ! FILE_IO_H */ + diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 18b0ede4fa6..c003943fd90 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -194,16 +194,11 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) #if APR_HAS_UNICODE_FS if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { - - apr_wchar_t wname[MAX_PATH]; - int len = MAX_PATH; - int lremains = strlen(fname) + 1; - apr_status_t rv; - if ((rv = conv_utf8_to_ucs2(fname, &lremains, wname, &len))) - return rv; - if (lremains) - return APR_ENAMETOOLONG; - if (!GetFileAttributesExW(wname, GetFileExInfoStandard, + apr_wchar_t *wfname; + wfname = utf8_to_unicode_path(fname, cont); + if (!wfname) + return APR_ENAMETOOLONG; + if (!GetFileAttributesExW(wfname, GetFileExInfoStandard, &FileInformation)) { return apr_get_os_error(); } diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 222bc5e85f9..1c989639ad8 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -64,23 +64,67 @@ #include <sys/stat.h> #include "misc.h" +#if APR_HAS_UNICODE_FS apr_wchar_t *utf8_to_unicode_path(const char* srcstr, apr_pool_t *p) { /* TODO: The computations could preconvert the string to determine * the true size of the retstr, but that's a memory over speed * tradeoff that isn't appropriate this early in development. + * + * Allocate the maximum string length based on leading 4 + * characters of \\?\ (allowing nearly unlimited path lengths) + * plus the trailing null, then transform /'s into \\'s since + * the \\?\ form doesn't allow '/' path seperators. + * + * Note that the \\?\ form only works for local drive paths, and + * not for UNC paths. */ int srcremains = strlen(srcstr) + 1; int retremains = srcremains + 4; - apr_wchar_t *retstr = apr_palloc(p, retremains * 2); - wcscpy (retstr, L"//?/"); + apr_wchar_t *retstr = apr_palloc(p, retremains * 2), *t = retstr; + if (srcstr[1] == ':' && srcstr[2] == '/') { + wcscpy (retstr, L"\\\\?\\"); + t += 4; + } if (conv_utf8_to_ucs2(srcstr, &srcremains, - retstr + 4, &retremains) || srcremains) + t, &retremains) || srcremains) return NULL; - else - return retstr; + for (; *t; ++t) + if (*t == L'/') + *t = L'\\'; + return retstr; } +char *unicode_to_utf8_path(const apr_wchar_t* srcstr, apr_pool_t *p) +{ + /* TODO: The computations could preconvert the string to determine + * the true size of the retstr, but that's a memory over speed + * tradeoff that isn't appropriate this early in development. + * + * Skip the leading 4 characters, allocate the maximum string + * length based on the remaining string, plus the trailing null. + * then transform \\'s back into /'s since the \\?\ form didn't + * allow '/' path seperators, but APR always uses '/'s. + */ + int srcremains = wcslen(srcstr) + 1; + int retremains = (srcremains - 5) * 3 + 1; + char *t, *retstr = apr_palloc(p, retremains); + if (srcstr[0] == L'\\' && srcstr[1] == L'\\' && + srcstr[2] == L'?' && srcstr[3] == L'\\') { + srcremains -= 4; + retremains -= 12; + srcstr += 4; + } + if (conv_ucs2_to_utf8(srcstr, &srcremains, + retstr, &retremains) || srcremains) + return NULL; + for (t = retstr; *t; ++t) + if (*t == L'/') + *t = L'\\'; + return retstr; +} +#endif + apr_status_t file_cleanup(void *thefile) { apr_file_t *file = thefile; From 6ba1530c9786fa2ceb5bbd2d6358b821c606e062 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 9 Nov 2000 14:19:29 +0000 Subject: [PATCH 0688/7878] Move these changes in their new home git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60666 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/fileio.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index da380d0868f..d379535636d 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -96,6 +96,7 @@ typedef apr_int16_t apr_wchar_t; apr_wchar_t *utf8_to_unicode_path(const char* srcstr, apr_pool_t *p); +char *unicode_to_utf8_path(const apr_wchar_t* srcstr, apr_pool_t *p); #endif typedef enum apr_canon_case_e { From d21717c624cb5834bd2a08911527c7057f7c6d52 Mon Sep 17 00:00:00 2001 From: Martin Kraemer <martin@apache.org> Date: Thu, 9 Nov 2000 14:59:20 +0000 Subject: [PATCH 0689/7878] Fix dependency on vanished misc.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60667 13f79535-47bb-0310-9956-ffa450edef68 --- lib/Makefile.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Makefile.in b/lib/Makefile.in index 7bf30dec51e..b98d7497aeb 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -55,8 +55,7 @@ apr_pools.o: apr_pools.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ $(INCDIR)/apr_dso.h $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/arch/unix/misc.h $(INCDIR)/apr_getopt.h + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h apr_signal.o: apr_signal.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ From a592dac4beb9ae39950facc53d4ae7f3b58f0154 Mon Sep 17 00:00:00 2001 From: Martin Kraemer <martin@apache.org> Date: Thu, 9 Nov 2000 15:01:23 +0000 Subject: [PATCH 0690/7878] Fix dependency on misc.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60668 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_pools.c | 1 - memory/unix/apr_pools.c | 1 - tables/Makefile.in | 3 +-- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/apr_pools.c b/lib/apr_pools.c index c2d76476325..2edff5c859a 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -68,7 +68,6 @@ #include "apr_pools.h" #include "apr_lib.h" #include "apr_lock.h" -#include "misc.h" #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index c2d76476325..2edff5c859a 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -68,7 +68,6 @@ #include "apr_pools.h" #include "apr_lib.h" #include "apr_lock.h" -#include "misc.h" #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> diff --git a/tables/Makefile.in b/tables/Makefile.in index bf6cb862b0d..a865a8ded13 100644 --- a/tables/Makefile.in +++ b/tables/Makefile.in @@ -56,5 +56,4 @@ apr_tables.o: apr_tables.c $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/arch/unix/misc.h $(INCDIR)/apr_getopt.h + $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h From eb20ad7df3f075c31853e6388e513d410b15fd6e Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Thu, 9 Nov 2000 15:01:35 +0000 Subject: [PATCH 0691/7878] This is the next step in the conversion of socket address functions to take APR_LOCAL/APR_REMOTE and also the addition of a new function to get the apr_inaddr_t for a socket. the new function is needed to help tidy up http_vhost.c Changes to apache code to reflect these follow directly... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60669 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 32 +++++-------- network_io/beos/sockaddr.c | 93 +++++++++--------------------------- network_io/unix/sockaddr.c | 95 +++++-------------------------------- network_io/win32/sockaddr.c | 87 +++++---------------------------- test/client.c | 4 +- test/server.c | 4 +- 6 files changed, 61 insertions(+), 254 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 6a24f8470bc..1dd68184e61 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -407,37 +407,22 @@ apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, apr_port_t apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t *sock); /** - * Associate a local socket addr with an apr socket. + * Associate a socket addr with an apr socket. * @param sock The socket to use + * @param which Which interface should we set? * @param addr The IP address to attach to the socket. * Use APR_ANYADDR to use any IP addr on the machine. * @tip This does not bind the two together, it is just telling apr * that this socket is going to use this address if possible. */ -apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr); +apr_status_t apr_set_ipaddr(apr_socket_t *sock, apr_interface_e which, const char *addr); /** - * Associate a remote socket addr with an apr socket. - * @param sock The socket to use - * @param addr The IP address to attach to the socket. - * @tip This does not make a connection to the remote address, it is just - * telling apr which address apr_connect() should attempt to connect to. - */ -apr_status_t apr_set_remote_ipaddr(apr_socket_t *sock, const char *addr); - -/** - * Return the local IP address associated with an apr socket. + * Return the IP address associated with an apr socket. * @param addr The local IP address associated with the socket. * @param sock The socket to use */ -apr_status_t apr_get_local_ipaddr(char **addr, apr_socket_t *sock); - -/** - * Return the remote IP address associated with an apr socket. - * @param addr The remote IP address associated with the socket. - * @param sock The socket to use - */ -apr_status_t apr_get_remote_ipaddr(char **addr, apr_socket_t *sock); +apr_status_t apr_get_ipaddr(char **addr, apr_interface_e which, apr_socket_t *sock); /** * Return the local socket name as a BSD style struct sockaddr_in. @@ -572,6 +557,13 @@ apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, */ apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file); +/** + * Given a hostname and a port, create an apr_in_addr for it... + * @param addr The apr_in_addr structure to return. + * @param hostname The hostname to lookup. + */ +apr_status_t apr_get_inaddr(apr_in_addr *addr, char* hostname); + #ifdef __cplusplus } #endif diff --git a/network_io/beos/sockaddr.c b/network_io/beos/sockaddr.c index c3d727d42ff..4b369ff9f95 100644 --- a/network_io/beos/sockaddr.c +++ b/network_io/beos/sockaddr.c @@ -58,100 +58,51 @@ #else #include "networkio.h" -apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, apr_port_t port) +static apr_status_t get_local_addr(apr_socket_t *sock) { - if (!sock) - return APR_EBADF; - if (which == APR_LOCAL) - sock->local_addr->sin_port = htons(port); - else if (APR == APR_REMOTE) - sock->remote_addr->sin_port = htons(port); - else - return APR_EINVAL; - return APR_SUCCESS; -} - -apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t *sock) -{ - if (!sock) - return APR_EBADF; - if (which == APR_LOCAL) - *port = ntohs(sock->local_addr->sin_port); - else if (which == APR_REMOTE) - *port = ntohs(sock->remote_addr->sin_port); - else - return APR_EINVAL; - return APR_SUCCESS; -} + apr_socklen_t namelen = sizeof(*sock->local_addr); -apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr) -{ - u_long ipaddr; - - if (!sock) { - return APR_EBADF; + if (getsockname(sock->socketdes, (struct sockaddr *)sock->local_addr, + &namelen) < 0) { + return errno; } - - if (!strcmp(addr, APR_ANYADDR)) { - sock->local_addr->sin_addr.s_addr = htonl(INADDR_ANY); + else { + sock->local_port_unknown = sock->local_interface_unknown = 0; return APR_SUCCESS; } - - ipaddr = inet_addr(addr); - - if (ipaddr == -1) { - return errno; - } - - sock->local_addr->sin_addr.s_addr = ipaddr; - return APR_SUCCESS; } -apr_status_t apr_set_remote_ipaddr(apr_socket_t *sock, const char *addr) +/* Include this here so we already have get_local_addr... */ +#include "../unix/sa_common.c" + +apr_status_t apr_set_ipaddr(apr_socket_t *sock, apr_interface_e which, const char *addr) { u_long ipaddr; + struct sockaddr_in *ptr; - if (!sock) { - return APR_EBADF; - } + if (which == APR_LOCAL) + ptr = sock->local_addr; + else if (which == APR_REMOTE) + ptr = sock->remote_addr; + else + return APR_EINVAL; if (!strcmp(addr, APR_ANYADDR)) { - sock->remote_addr->sin_addr.s_addr = htonl(INADDR_ANY); + ptr->sin_addr.s_addr = htonl(INADDR_ANY); return APR_SUCCESS; } ipaddr = inet_addr(addr); - if (ipaddr == (u_long)-1) { + if (ipaddr == -1) { return errno; } - sock->remote_addr->sin_addr.s_addr = ipaddr; - return APR_SUCCESS; -} - -apr_status_t apr_get_local_ipaddr(char **addr, apr_socket_t *sock) -{ - if (!sock) { - return APR_EBADF; - } - - *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); + ptr->sin_addr.s_addr = ipaddr; return APR_SUCCESS; } -apr_status_t apr_get_remote_ipaddr(char **addr, apr_socket_t *sock) -{ - if (!sock) { - return APR_EBADF; - } - - *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); - return APR_SUCCESS; -} - - -apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) +apr_status_t get_local_name(struct sockaddr_in **name, apr_socket_t *sock) { if (!sock) { return APR_EBADF; diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 1b42757169b..99738f02794 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -55,18 +55,6 @@ #include "networkio.h" #include "apr_strings.h" -apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, - apr_port_t port) -{ - if (which == APR_LOCAL) - sock->local_addr->sin_port = htons(port); - else if (which == APR_REMOTE) - sock->remote_addr->sin_port = htons(port); - else - return APR_EINVAL; - return APR_SUCCESS; -} - static apr_status_t get_local_addr(apr_socket_t *sock) { apr_socklen_t namelen = sizeof(*sock->local_addr); @@ -81,35 +69,23 @@ static apr_status_t get_local_addr(apr_socket_t *sock) } } +/* included here to allow us to use local_addr */ +#include "sa_common.c" - -apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t *sock) +apr_status_t apr_set_ipaddr(apr_socket_t *sock, apr_interface_e which, const char *addr) { - if (which == APR_LOCAL){ - if (sock->local_port_unknown) { - apr_status_t rv = get_local_addr(sock); - - if (rv != APR_SUCCESS) { - return rv; - } - } - - *port = ntohs(sock->local_addr->sin_port); - } else if (which == APR_REMOTE) - *port = ntohs(sock->remote_addr->sin_port); + u_long ipaddr; + struct sockaddr_in* sa_ptr; + + if (which == APR_LOCAL) + sa_ptr = sock->local_addr; + else if (which == APR_REMOTE) + sa_ptr = sock->remote_addr; else return APR_EINVAL; - return APR_SUCCESS; -} - - - -apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr) -{ - u_long ipaddr; if (!strcmp(addr, APR_ANYADDR)) { - sock->local_addr->sin_addr.s_addr = htonl(INADDR_ANY); + sa_ptr->sin_addr.s_addr = htonl(INADDR_ANY); return APR_SUCCESS; } @@ -119,57 +95,10 @@ apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr) return errno; } - sock->local_addr->sin_addr.s_addr = ipaddr; + sa_ptr->sin_addr.s_addr = ipaddr; return APR_SUCCESS; } - - -apr_status_t apr_set_remote_ipaddr(apr_socket_t *sock, const char *addr) -{ - u_long ipaddr; - - if (!strcmp(addr, APR_ANYADDR)) { - sock->remote_addr->sin_addr.s_addr = htonl(INADDR_ANY); - return APR_SUCCESS; - } - - ipaddr = inet_addr(addr); - - if (ipaddr == (u_long)-1) { - return errno; - } - - sock->remote_addr->sin_addr.s_addr = ipaddr; - return APR_SUCCESS; -} - - - -apr_status_t apr_get_local_ipaddr(char **addr, apr_socket_t *sock) -{ - if (sock->local_interface_unknown) { - apr_status_t rv = get_local_addr(sock); - - if (rv != APR_SUCCESS) { - return rv; - } - } - - *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); - return APR_SUCCESS; -} - - - -apr_status_t apr_get_remote_ipaddr(char **addr, apr_socket_t *sock) -{ - *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); - return APR_SUCCESS; -} - - - #if APR_HAVE_NETINET_IN_H apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) { diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index 724878925fb..1ef1a98311d 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -72,65 +72,23 @@ static apr_status_t get_local_addr(apr_socket_t *sock) } } +/* Include this here so we have get_local_addr defined... */ +#include "../unix/sa_common.c" - -apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, apr_port_t port) +apr_status_t apr_set_ipaddr(apr_socket_t *sock, apr_interface_e which, const char *addr) { - if (which == APR_LOCAL) - sock->local_addr->sin_port = htons(port); - else if (which == APR_REMOTE) - sock->remote_addr->sin_port = htons(port); - else - return APR_EINVAL; - return APR_SUCCESS; -} + u_long ipaddr; + sockaddr_in *ptr; -apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t *sock) -{ if (which == APR_LOCAL) - { - if (sock->local_port_unknown) { - apr_status_t rv = get_local_addr(sock); - - if (rv != APR_SUCCESS) { - return rv; - } - } - *port = ntohs(sock->local_addr->sin_port); - } else if (which == APR_REMOTE) - *port = ntohs(sock->remote_addr->sin_port); + ptr = sock->local_addr; + else if (which == APR_REMOTE) + ptr = sock->remote_addr; else return APR_EINVAL; - - return APR_SUCCESS; -} - - -apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr) -{ - u_long ipaddr; - - if (!strcmp(addr, APR_ANYADDR)) { - sock->local_addr->sin_addr.s_addr = htonl(INADDR_ANY); - return APR_SUCCESS; - } - - ipaddr = inet_addr(addr); - - if (ipaddr == INADDR_NONE) { - return WSAEADDRNOTAVAIL; - } - - sock->local_addr->sin_addr.s_addr = ipaddr; - return APR_SUCCESS; -} - -apr_status_t apr_set_remote_ipaddr(apr_socket_t *sock, const char *addr) -{ - u_long ipaddr; - + if (!strcmp(addr, APR_ANYADDR)) { - sock->remote_addr->sin_addr.s_addr = htonl(INADDR_ANY); + ptr->sin_addr.s_addr = htonl(INADDR_ANY); return APR_SUCCESS; } @@ -140,33 +98,10 @@ apr_status_t apr_set_remote_ipaddr(apr_socket_t *sock, const char *addr) return WSAEADDRNOTAVAIL; } - sock->remote_addr->sin_addr.s_addr = ipaddr; + ptr->sin_addr.s_addr = ipaddr; return APR_SUCCESS; } -apr_status_t apr_get_local_ipaddr(char **addr, apr_socket_t *sock) -{ - if (sock->local_interface_unknown) { - apr_status_t rv = get_local_addr(sock); - - if (rv != APR_SUCCESS) { - return rv; - } - } - - *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); - return APR_SUCCESS; -} - - - -apr_status_t apr_get_remote_ipaddr(char **addr, apr_socket_t *sock) -{ - *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); - return APR_SUCCESS; -} - - apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) { if (sock->local_port_unknown || sock->local_interface_unknown) { diff --git a/test/client.c b/test/client.c index 6931f50e825..beb78ebdb10 100644 --- a/test/client.c +++ b/test/client.c @@ -136,9 +136,9 @@ int main(int argc, char *argv[]) } fprintf(stdout, "OK\n"); - apr_get_remote_ipaddr(&remote_ipaddr, sock); + apr_get_ipaddr(&remote_ipaddr, APR_REMOTE, sock); apr_get_port(&remote_port, APR_REMOTE, sock); - apr_get_local_ipaddr(&local_ipaddr, sock); + apr_get_ipaddr(&local_ipaddr, APR_LOCAL, sock); apr_get_port(&local_port, APR_LOCAL, sock); fprintf(stdout, "\tClient socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); diff --git a/test/server.c b/test/server.c index 9b0dcfd940f..c385aecc2cd 100644 --- a/test/server.c +++ b/test/server.c @@ -161,9 +161,9 @@ int main(int argc, char *argv[]) } fprintf(stdout, "OK\n"); - apr_get_remote_ipaddr(&remote_ipaddr, sock2); + apr_get_ipaddr(&remote_ipaddr, APR_REMOTE, sock2); apr_get_port(&remote_port, APR_REMOTE, sock2); - apr_get_local_ipaddr(&local_ipaddr, sock2); + apr_get_ipaddr(&local_ipaddr, APR_LOCAL, sock2); apr_get_port(&local_port, APR_LOCAL, sock2); fprintf(stdout, "\tServer socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); From 1176b8eb53211ddce1789085d5861827a381eb4b Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Thu, 9 Nov 2000 16:05:25 +0000 Subject: [PATCH 0692/7878] Ah yes, less speed more haste! Thanks to Jeff for pointing out that I omitted to add sa_common.c, so here it is!!! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60670 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 137 ++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 network_io/unix/sa_common.c diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c new file mode 100644 index 00000000000..bac731d5ca6 --- /dev/null +++ b/network_io/unix/sa_common.c @@ -0,0 +1,137 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +/* sa_common.c + * + * this file has common code that manipulates socket information + * + * It's intended to be included in sockaddr.c for every platform and + * so should NOT have any headers included in it. + * + * Feature defines are OK, but there should not be any code in this file + * that differs between platforms. + */ + +apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, + apr_port_t port) +{ + if (which == APR_LOCAL) + sock->local_addr->sin_port = htons(port); + else if (which == APR_REMOTE) + sock->remote_addr->sin_port = htons(port); + else + return APR_EINVAL; + return APR_SUCCESS; +} + +apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t *sock) +{ + if (which == APR_LOCAL) + { + if (sock->local_port_unknown) { + apr_status_t rv = get_local_addr(sock); + + if (rv != APR_SUCCESS) { + return rv; + } + } + + *port = ntohs(sock->local_addr->sin_port); + } else if (which == APR_REMOTE) + *port = ntohs(sock->remote_addr->sin_port); + else + return APR_EINVAL; + return APR_SUCCESS; +} + +apr_status_t apr_get_ipaddr(char **addr, apr_interface_e which, apr_socket_t *sock) +{ + if (which == APR_LOCAL){ + if (sock->local_interface_unknown) { + apr_status_t rv = get_local_addr(sock); + + if (rv != APR_SUCCESS) { + return rv; + } + } + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); + } else if (which == APR_REMOTE) + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); + else + return APR_EINVAL; + + return APR_SUCCESS; +} + +apr_status_t apr_get_inaddr(apr_in_addr *addr, char *hostname) +{ + struct hostent *he; + + if (strcmp(hostname,"*") == 0){ + addr->s_addr = htonl(INADDR_ANY); + return APR_SUCCESS; + } + if ((addr->s_addr = apr_inet_addr(hostname)) != INADDR_NONE) + return APR_SUCCESS; + + /* hmmm, it's not a numeric IP address so we need to look it up :( */ + he = gethostbyname(hostname); + if (!he || he->h_addrtype != AF_INET || !he->h_addr_list[0]) + return (h_errno + APR_OS_START_SYSERR); + + addr = (struct in_addr*)he->h_addr_list[0]; + + return APR_SUCCESS; +} + From f8e1476b44db98a46244569b6c2f4de828d449b1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 9 Nov 2000 17:59:17 +0000 Subject: [PATCH 0693/7878] Fast fix to get Win32 APR building (on to Apache itself) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60671 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 9 +++++++-- aprlib.def | 8 ++++---- aprlib.dsp | 9 +++++++-- aprlibdll.dsp | 6 +++--- libapr.def | 8 ++++---- libapr.dsp | 6 +++--- network_io/win32/sockaddr.c | 2 +- 7 files changed, 29 insertions(+), 19 deletions(-) diff --git a/apr.dsp b/apr.dsp index d51807f1e63..d537d1d1ebf 100644 --- a/apr.dsp +++ b/apr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -69,7 +69,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c -# ADD CPP /nologo /MDd /W3 /GX /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c +# ADD CPP /nologo /MDd /W3 /GX /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -204,6 +204,11 @@ SOURCE=.\misc\unix\uuid.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\file_io\win32\canonfile.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + SOURCE=.\file_io\win32\dir.c # End Source File # Begin Source File diff --git a/aprlib.def b/aprlib.def index ae8739fb667..dc47d7b3fa4 100644 --- a/aprlib.def +++ b/aprlib.def @@ -214,10 +214,10 @@ EXPORTS apr_filename_of_pathname @205 apr_get_remote_name @206 apr_get_local_name @207 - apr_get_local_ipaddr @208 - apr_set_local_ipaddr @209 - apr_get_remote_ipaddr @210 - apr_set_remote_ipaddr @211 + apr_get_ipaddr @208 + apr_set_ipaddr @209 + + apr_get_port @212 apr_set_port @213 diff --git a/aprlib.dsp b/aprlib.dsp index d51807f1e63..d537d1d1ebf 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -69,7 +69,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c -# ADD CPP /nologo /MDd /W3 /GX /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "misc/unix" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /I "i18n/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c +# ADD CPP /nologo /MDd /W3 /GX /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -204,6 +204,11 @@ SOURCE=.\misc\unix\uuid.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\file_io\win32\canonfile.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + SOURCE=.\file_io\win32\dir.c # End Source File # Begin Source File diff --git a/aprlibdll.dsp b/aprlibdll.dsp index 443fb18426d..2a5f314504c 100644 --- a/aprlibdll.dsp +++ b/aprlibdll.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" @@ -69,8 +69,8 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c +# ADD CPP /nologo /MDd /W3 /GX /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" diff --git a/libapr.def b/libapr.def index ae8739fb667..dc47d7b3fa4 100644 --- a/libapr.def +++ b/libapr.def @@ -214,10 +214,10 @@ EXPORTS apr_filename_of_pathname @205 apr_get_remote_name @206 apr_get_local_name @207 - apr_get_local_ipaddr @208 - apr_set_local_ipaddr @209 - apr_get_remote_ipaddr @210 - apr_set_remote_ipaddr @211 + apr_get_ipaddr @208 + apr_set_ipaddr @209 + + apr_get_port @212 apr_set_port @213 diff --git a/libapr.dsp b/libapr.dsp index 443fb18426d..2a5f314504c 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" @@ -69,8 +69,8 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I "dso/win32" /I "file_io/win32" /I "locks/win32" /I "misc/win32" /I "network_io/win32" /I "threadproc/win32" /I "time/win32" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c +# ADD CPP /nologo /MDd /W3 /GX /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index 1ef1a98311d..14015adac30 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -78,7 +78,7 @@ static apr_status_t get_local_addr(apr_socket_t *sock) apr_status_t apr_set_ipaddr(apr_socket_t *sock, apr_interface_e which, const char *addr) { u_long ipaddr; - sockaddr_in *ptr; + struct sockaddr_in *ptr; if (which == APR_LOCAL) ptr = sock->local_addr; From 317ea54214d5528ea183a22779ea8c96949d70f5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 9 Nov 2000 18:17:29 +0000 Subject: [PATCH 0694/7878] #include <string.h>, for memset(). Submitted by: Karl Fogel <kfogel@collab.net> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60672 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_pools.c | 3 +++ memory/unix/apr_pools.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 2edff5c859a..736a0efd1fe 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -91,6 +91,9 @@ #include <fcntl.h> #endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 2edff5c859a..736a0efd1fe 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -91,6 +91,9 @@ #include <fcntl.h> #endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif From 8537370aaef4b5cfda32fb9aaff8ee78d1955a67 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 9 Nov 2000 18:57:38 +0000 Subject: [PATCH 0695/7878] Use pthread_mutex_destroy() in the lock cleanup routine to clean up a pthread mutex. PR: 6824 Submitted by: ki@hh.iij4u.or.jp Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60673 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/intraproc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index e132bb93918..64b0c5f5fb2 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -63,7 +63,8 @@ static apr_status_t lock_intra_cleanup(void *data) apr_lock_t *lock = (apr_lock_t *) data; apr_status_t stat; - stat = pthread_mutex_unlock(lock->intraproc); + pthread_mutex_unlock(lock->intraproc); + stat = pthread_mutex_destroy(lock->intraproc); #ifdef PTHREAD_SETS_ERRNO if (stat) { stat = errno; From ebbc09b6bc6df246ceb37bc3119e31db21c750fa Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 9 Nov 2000 19:22:41 +0000 Subject: [PATCH 0696/7878] APR works (maybe), Apache works (sort of), so at least FirstBill and I can hack for a while. Very drippy day in the midwest. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60674 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 9 +++++++-- aprlib.def | 21 ++++++++------------- aprlib.dsp | 9 +++++++-- libapr.def | 21 ++++++++------------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/apr.dsp b/apr.dsp index d537d1d1ebf..ff37c0e5e3f 100644 --- a/apr.dsp +++ b/apr.dsp @@ -68,8 +68,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c -# ADD CPP /nologo /MDd /W3 /GX /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c +# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -273,6 +273,11 @@ SOURCE=.\network_io\win32\poll.c # End Source File # Begin Source File +SOURCE=.\network_io\unix\sa_common.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File diff --git a/aprlib.def b/aprlib.def index dc47d7b3fa4..e43cd4fe267 100644 --- a/aprlib.def +++ b/aprlib.def @@ -78,10 +78,12 @@ EXPORTS apr_remove_poll_socket @71 apr_clear_poll_sockets @72 apr_getsocketopt @73 -; -; -; -; + apr_get_ipaddr @74 + apr_set_ipaddr @75 + apr_get_port @76 + apr_set_port @77 + apr_get_inaddr @78 + ; ; ; apr_thread_proc.h @@ -211,17 +213,10 @@ EXPORTS apr_getpass @202 apr_tokenize_to_argv @204 - apr_filename_of_pathname @205 + apr_filename_of_pathname @205 apr_get_remote_name @206 apr_get_local_name @207 - apr_get_ipaddr @208 - apr_set_ipaddr @209 - - - apr_get_port @212 - apr_set_port @213 - - + apr_open_stderr @216 apr_get_pipe_timeout @217 apr_set_pipe_timeout @218 diff --git a/aprlib.dsp b/aprlib.dsp index d537d1d1ebf..ff37c0e5e3f 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -68,8 +68,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c -# ADD CPP /nologo /MDd /W3 /GX /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c +# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -273,6 +273,11 @@ SOURCE=.\network_io\win32\poll.c # End Source File # Begin Source File +SOURCE=.\network_io\unix\sa_common.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File diff --git a/libapr.def b/libapr.def index dc47d7b3fa4..e43cd4fe267 100644 --- a/libapr.def +++ b/libapr.def @@ -78,10 +78,12 @@ EXPORTS apr_remove_poll_socket @71 apr_clear_poll_sockets @72 apr_getsocketopt @73 -; -; -; -; + apr_get_ipaddr @74 + apr_set_ipaddr @75 + apr_get_port @76 + apr_set_port @77 + apr_get_inaddr @78 + ; ; ; apr_thread_proc.h @@ -211,17 +213,10 @@ EXPORTS apr_getpass @202 apr_tokenize_to_argv @204 - apr_filename_of_pathname @205 + apr_filename_of_pathname @205 apr_get_remote_name @206 apr_get_local_name @207 - apr_get_ipaddr @208 - apr_set_ipaddr @209 - - - apr_get_port @212 - apr_set_port @213 - - + apr_open_stderr @216 apr_get_pipe_timeout @217 apr_set_pipe_timeout @218 From 723b65aa3c42d5b93ed33f33aedf489cd34b50c7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 9 Nov 2000 19:55:29 +0000 Subject: [PATCH 0697/7878] I knew the first typo would be obvious ... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60675 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index ffd66c917d8..68b20ff134c 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -109,7 +109,7 @@ apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) } (*new)->w.dirname[len++] = '*'; (*new)->w.dirname[len] = '\0'; - for (wch = (*new)->w.dirname + 4; *wch; ++wch); + for (wch = (*new)->w.dirname + 4; *wch; ++wch) if (*wch == L'/') *wch = L'\\'; } From 95be2650ff3da7ab5c60256b3ae265278013b011 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 9 Nov 2000 20:06:47 +0000 Subject: [PATCH 0698/7878] Fixing an oddly fractured .dsp (once to often through the dsp converter?) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60676 13f79535-47bb-0310-9956-ffa450edef68 --- test/testucs.dsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testucs.dsp b/test/testucs.dsp index be96410e9ce..b5421cc0a10 100644 --- a/test/testucs.dsp +++ b/test/testucs.dsp @@ -66,8 +66,8 @@ LINK32=link.exe # PROP Intermediate_Dir "testucs" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /ZI /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "APR_DECLARE_SYMBOLS" /D "_CONSOLE" /D "_MBCS" /FD /ZI /c +# ADD BASE CPP /nologo /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "APR_DECLARE_SYMBOLS" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /YX /Yc /Yu # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" From a9abe6c7e84f815baddbb346051eceb26900f360 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 9 Nov 2000 21:04:20 +0000 Subject: [PATCH 0699/7878] Guess math isn't my strongest subject at midnight. Fortunately, I just tuned this down to 4 places to make this mistake, checked 'em all, and it looks like we are good from here on out. Now, why doesn't autoindex actually output anything ??? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60677 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 68b20ff134c..470fcea65c3 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -98,7 +98,7 @@ apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) apr_wchar_t *wch; (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); (*new)->w.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); - (*new)->w.dirname = apr_palloc(cont, dirremains + 7); + (*new)->w.dirname = apr_palloc(cont, (dirremains + 7) * 2); wcscpy((*new)->w.dirname, L"\\\\?\\"); if (conv_utf8_to_ucs2(dirname, &srcremains, (*new)->w.dirname + 4, &dirremains) || srcremains) From bdcc423103b12943beda8438a2c1e7cdc9d4e3e6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 9 Nov 2000 21:05:15 +0000 Subject: [PATCH 0700/7878] A small ommision which (should) never occur. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60678 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 1 + 1 file changed, 1 insertion(+) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 1c989639ad8..a3af8900ecb 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -84,6 +84,7 @@ apr_wchar_t *utf8_to_unicode_path(const char* srcstr, apr_pool_t *p) apr_wchar_t *retstr = apr_palloc(p, retremains * 2), *t = retstr; if (srcstr[1] == ':' && srcstr[2] == '/') { wcscpy (retstr, L"\\\\?\\"); + retremains -= 4; t += 4; } if (conv_utf8_to_ucs2(srcstr, &srcremains, From e8a4371ffbbb415c33b89cd4f8cc63815813278c Mon Sep 17 00:00:00 2001 From: Martin Kraemer <martin@apache.org> Date: Thu, 9 Nov 2000 21:11:37 +0000 Subject: [PATCH 0701/7878] Typo in comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60679 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_shmem.h | 2 +- include/apr_thread_proc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_shmem.h b/include/apr_shmem.h index 1b0ef860c70..60e552832a3 100644 --- a/include/apr_shmem.h +++ b/include/apr_shmem.h @@ -158,5 +158,5 @@ apr_status_t apr_shm_avail(apr_shmem_t *c, apr_size_t *avail); } #endif -#endif /* ! APR_FILE_IO_H */ +#endif /* ! APR_SHMEM_H */ diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index d40cfb117e0..fa1012a3dff 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -483,5 +483,5 @@ apr_status_t apr_kill(apr_proc_t *proc, int sig); } #endif -#endif /* ! APR_FILE_IO_H */ +#endif /* ! APR_THREAD_PROC_H */ From 3525939d26d7e08f8c84b729a616251b77cfa278 Mon Sep 17 00:00:00 2001 From: Martin Kraemer <martin@apache.org> Date: Thu, 9 Nov 2000 21:12:48 +0000 Subject: [PATCH 0702/7878] Fix dependencies git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60680 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/Makefile.in | 72 +++++++++++++++------------------------- 1 file changed, 27 insertions(+), 45 deletions(-) diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index 34472f81ad1..f4e91328b5e 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -56,62 +56,44 @@ depend: && rm Makefile.new # DO NOT REMOVE -dir.o: dir.c $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_strings.h \ +dir.o: dir.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h fileacc.o: fileacc.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr_private.h -filedup.o: filedup.c $(INCDIR)/arch/unix/fileio.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h +filedup.o: filedup.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_strings.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_dso.h -filestat.o: filestat.c $(INCDIR)/arch/unix/fileio.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h + $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h +filestat.o: filestat.c $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h fullrw.o: fullrw.c $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h -open.o: open.c $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_strings.h \ +open.o: open.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h -pipe.o: pipe.c $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_strings.h -readwrite.o: readwrite.c $(INCDIR)/arch/unix/fileio.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_thread_proc.h \ +pipe.o: pipe.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_lock.h -seek.o: seek.c $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h +readwrite.o: readwrite.c $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h +seek.o: seek.c From db0ac1bc643926e28a78384a6e9da1861fca9e10 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Thu, 9 Nov 2000 21:26:50 +0000 Subject: [PATCH 0703/7878] tweak the includes for the recent header reorg. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60681 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/unix/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 199b6fc74ed..33d1cfff2b8 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -57,7 +57,7 @@ #include "apr_general.h" #include "apr_mmap.h" #include "apr_errno.h" -#include "../../file_io/unix/fileio.h" +#include "unix/fileio.h" #include "apr_portable.h" /* System headers required for the mmap library */ From b43d9d76f69f0e26da1c1831dd1bfb0f3f633f26 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Fri, 10 Nov 2000 00:58:25 +0000 Subject: [PATCH 0704/7878] Bring the apr_in_addr type into line with naming conventions and make changes where appropriate. At least on my system virtual hosts seem to still work :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60682 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 5 ++--- network_io/unix/sa_common.c | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 1dd68184e61..5f5c8bfbb40 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -132,12 +132,11 @@ typedef enum { typedef struct apr_socket_t apr_socket_t; typedef struct apr_pollfd_t apr_pollfd_t; typedef struct apr_hdtr_t apr_hdtr_t; -typedef struct in_addr apr_in_addr; +typedef struct in_addr apr_in_addr_t; /* use apr_uint16_t just in case some system has a short that isn't 16 bits... */ typedef apr_uint16_t apr_port_t; - #if APR_HAS_SENDFILE /* Define flags passed in on apr_sendfile() */ #define APR_SENDFILE_DISCONNECT_SOCKET 1 @@ -562,7 +561,7 @@ apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file); * @param addr The apr_in_addr structure to return. * @param hostname The hostname to lookup. */ -apr_status_t apr_get_inaddr(apr_in_addr *addr, char* hostname); +apr_status_t apr_get_inaddr(apr_in_addr_t *addr, char *hostname); #ifdef __cplusplus } diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index bac731d5ca6..d1e4a201451 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -114,10 +114,10 @@ apr_status_t apr_get_ipaddr(char **addr, apr_interface_e which, apr_socket_t *so return APR_SUCCESS; } -apr_status_t apr_get_inaddr(apr_in_addr *addr, char *hostname) +apr_status_t apr_get_inaddr(apr_in_addr_t *addr, char *hostname) { struct hostent *he; - + if (strcmp(hostname,"*") == 0){ addr->s_addr = htonl(INADDR_ANY); return APR_SUCCESS; @@ -130,7 +130,7 @@ apr_status_t apr_get_inaddr(apr_in_addr *addr, char *hostname) if (!he || he->h_addrtype != AF_INET || !he->h_addr_list[0]) return (h_errno + APR_OS_START_SYSERR); - addr = (struct in_addr*)he->h_addr_list[0]; + *addr = *(struct in_addr*)he->h_addr_list[0]; return APR_SUCCESS; } From 46cc80154c89a1fa7f3c1f8c5fe8d5fe8c4cfa93 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 10 Nov 2000 15:19:53 +0000 Subject: [PATCH 0705/7878] Teaching new dogs old tricks... apr_stat must behave and never change its finfo* argument if it fails... apr_stat/Unix must check the ENOENT and ENOTDIR errno defines [Please- check my work carefully!] and we start unwinding the ap_os_is_filename_valid() funtion (which is gone for good, win32 apr_stat() will learn these tricks.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60683 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 30 ++++++++++++++++++++++++++++++ include/apr_file_io.h | 6 ++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 8c8287ab62e..ed860fb7536 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -129,7 +129,37 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) return APR_SUCCESS; } else { +#if !defined(ENOENT) || !defined(ENOTDIR) +#error ENOENT || ENOTDIR not defined; please see the +#error comments at this line in the source for a workaround. + /* + * If ENOENT || ENOTDIR is not defined in one of the your OS's + * include files, APR cannot report a good reason why the stat() + * of the file failed; there are cases where it can fail even though + * the file exists. This opens holes in Apache, for example, because + * it becomes possible for someone to get a directory listing of a + * directory even though there is an index (eg. index.html) file in + * it. If you do not have a problem with this, delete the above + * #error lines and start the compile again. If you need to do this, + * please submit a bug report to http://www.apache.org/bug_report.html + * letting us know that you needed to do this. Please be sure to + * include the operating system you are using. + */ + /* WARNING: All errors will be handled as not found + */ +#if !defined(ENOENT) + return APR_ENOENT; +#else + /* WARNING: All errors but not found will be handled as not directory + */ + if (errno != ENOENT) + return APR_ENOENT; + else + return errno; +#endif +#else /* All was defined well, report the usual: */ return errno; +#endif } } diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 491d9b19fd1..ce2055b4f7b 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -509,7 +509,8 @@ apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms); /** * get the specified file's stats. The file is specified by filename, * instead of using a pre-opened file. - * @param finfo Where to store the information about the file. + * @param finfo Where to store the information about the file, which is + * never touched if the call fails. * @param fname The name of the file to stat. * @param cont the pool to use to allocate the new file. */ @@ -519,7 +520,8 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont); * get the specified file's stats. The file is specified by filename, * instead of using a pre-opened file. If the file is a symlink, this function * will get the stats for the symlink not the file the symlink refers to. - * @param finfo Where to store the information about the file. + * @param finfo Where to store the information about the file, which is + * never touched if the call fails. * @param fname The name of the file to stat. * @param cont the pool to use to allocate the new file. */ From 531fc2dc9061184639fb58cec993680dd02f5e89 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Fri, 10 Nov 2000 16:11:13 +0000 Subject: [PATCH 0706/7878] More local/remote changes and tidy up http_vhost a bit. Also add a new function to get an ap_ina_addr_t from a socket. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60684 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 23 +++++++++++++---------- network_io/unix/sa_common.c | 21 +++++++++++++++++++++ network_io/unix/sockopt.c | 30 ++++++++++-------------------- network_io/win32/sockopt.c | 13 ++++++++++--- 4 files changed, 54 insertions(+), 33 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 5f5c8bfbb40..167b026c302 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -224,18 +224,12 @@ apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, apr_status_t apr_connect(apr_socket_t *sock, const char *hostname); /** - * Get name of the machine we are currently connected to. + * Get name of a machine we are currently connected to. * @param name A buffer to store the hostname in. + * @param which Which interface do we wnt the hostname for? * @param sock The socket to examine. */ -apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock); - -/** - * Get name of the local machine via it's ip address. - * @param name A buffer to store the hostname in. - * @param sock The socket to examine. - */ -apr_status_t apr_get_local_hostname(char **name, apr_socket_t *sock); +apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t *sock); /** * Get name of the current machine @@ -558,11 +552,20 @@ apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file); /** * Given a hostname and a port, create an apr_in_addr for it... - * @param addr The apr_in_addr structure to return. + * @param addr The apr_in_addr_t structure to return. * @param hostname The hostname to lookup. */ apr_status_t apr_get_inaddr(apr_in_addr_t *addr, char *hostname); +/** + * Given an apr_socket_t get the apr_in_addr_t for the requested interface + * @param addr The apr_in_addr_t structure to return + * @param which The interface to return for + * @param sock The apr_socket_t to use + */ +apr_status_t apr_get_socket_inaddr(apr_in_addr_t *addr, apr_interface_e which, + apr_socket_t *sock); + #ifdef __cplusplus } #endif diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index d1e4a201451..747b550d016 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -135,3 +135,24 @@ apr_status_t apr_get_inaddr(apr_in_addr_t *addr, char *hostname) return APR_SUCCESS; } +apr_status_t apr_get_socket_inaddr(apr_in_addr_t *addr, apr_interface_e which, + apr_socket_t *sock) +{ + if (which == APR_LOCAL){ + if (sock->local_interface_unknown) { + apr_status_t rv = get_local_addr(sock); + + if (rv != APR_SUCCESS){ + return rv; + } + } + + *addr = *(apr_in_addr_t*)&sock->local_addr->sin_addr; + } else if (which == APR_REMOTE) { + *addr = *(apr_in_addr_t*)&sock->remote_addr->sin_addr; + } else { + return APR_EINVAL; + } + return APR_SUCCESS; +} + diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index a8ed8bbfe1b..dd4e2c4c3e7 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -202,30 +202,20 @@ apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) +apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t *sock) { struct hostent *hptr; - - hptr = gethostbyaddr((char *)&(sock->remote_addr->sin_addr), - sizeof(struct in_addr), AF_INET); - if (hptr != NULL) { - *name = apr_pstrdup(sock->cntxt, hptr->h_name); - if (*name) { - return APR_SUCCESS; - } - return APR_ENOMEM; - } + apr_in_addr_t sa_ptr; - /* XXX - Is referencing h_errno threadsafe? */ - return (h_errno + APR_OS_START_SYSERR); -} + if (which == APR_LOCAL) + sa_ptr = sock->local_addr->sin_addr; + else if (which == APR_REMOTE) + sa_ptr = sock->remote_addr->sin_addr; + else + return APR_EINVAL; + + hptr = gethostbyaddr((char *)&sa_ptr, sizeof(struct in_addr), AF_INET); -apr_status_t apr_get_local_hostname(char **name, apr_socket_t *sock) -{ - struct hostent *hptr; - - hptr = gethostbyaddr((char *)&(sock->local_addr->sin_addr), - sizeof(struct in_addr), AF_INET); if (hptr != NULL) { *name = apr_pstrdup(sock->cntxt, hptr->h_name); if (*name) { diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index e40034296f2..07be26deb67 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -201,12 +201,19 @@ apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) +apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t *sock) { struct hostent *hptr; + apr_in_addr_t sa_ptr; - hptr = gethostbyaddr((char *)&(sock->local_addr->sin_addr), - sizeof(struct in_addr), AF_INET); + if (which == APR_LOCAL) + sa_ptr = sock->local_addr->sin_addr; + else if (which == APR_REMOTE) + sa_ptr = sock->remote_addr->sin_addr; + else + return APR_EINVAL; + + hptr = gethostbyaddr((char *)&sa_ptr), sizeof(struct in_addr), AF_INET); if (hptr != NULL) { *name = apr_pstrdup(sock->cntxt, hptr->h_name); From bbddc9987841086056729bf1c074146443dc0eb4 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Fri, 10 Nov 2000 16:16:06 +0000 Subject: [PATCH 0707/7878] Add the apr_sockaddr_t type. I've added a single pointer that should be used to point at the address structure. The port and family are in the same place in either a v4 or v6 sockaddr so we don't need to worry about those, but in a v6 sockaddr they start at different points. I'll wait a while before starting to move this into the code as it's going to break a good few things :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60685 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 167b026c302..e4722b7b7ea 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -137,6 +137,35 @@ typedef struct in_addr apr_in_addr_t; /* use apr_uint16_t just in case some system has a short that isn't 16 bits... */ typedef apr_uint16_t apr_port_t; +/* we're going to roll our own sockaddr type as we want to make sure + * we have protocol independance for APR... + * + * It's defined here as I think it should all be platform safe... + */ +typedef struct { + apr_pool_t *pool; /* The pool to use... */ + char *hostname; /* The hostname */ + char *servname; /* This is either a string of the port number or + * the service name for the port + */ + apr_port_t port; /* The numeric port */ + union { + struct sockaddr_in sin; /* IPv4 sockaddr structure */ +#if APR_HAVE_IPV6 + struct sockaddr_in6 sin6; /* IPv6 sockaddr structure */ +#endif + } sa; + apr_socklen_t sa_len; /* How big is the sockaddr we're using? */ + int addr_str_len; /* How big should the address buffer be? + * 16 for v4 or 46 for v6 + * used in inet_ntop... + */ + void *addr_ptr; /* This should be set to point to the + * sockaddr structure address we're using... + * i.e. sa.sin.sin_addr or sa.sin6.sin6_addr + */ +} apr_sockaddr_t; + #if APR_HAS_SENDFILE /* Define flags passed in on apr_sendfile() */ #define APR_SENDFILE_DISCONNECT_SOCKET 1 From ca3e3e4d50ee875554b6caf442243f1769636778 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 10 Nov 2000 19:01:30 +0000 Subject: [PATCH 0708/7878] Fix a lot of the fallback from the apr_ssize_t to apr_size_t change Submitted by: Victor J. Orlikowski <v.j.orlikowski@gte.net> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60686 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fullrw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index 9e5e3158954..b6d719ff69d 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -62,7 +62,7 @@ apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t total_read = 0; do { - apr_ssize_t amt = (apr_ssize_t)nbytes; + apr_size_t amt = nbytes; status = apr_read(thefile, buf, &amt); buf = (char *)buf + amt; @@ -83,7 +83,7 @@ apr_status_t apr_full_write(apr_file_t *thefile, const void *buf, apr_size_t total_written = 0; do { - apr_ssize_t amt = (apr_ssize_t)nbytes; + apr_size_t amt = nbytes; status = apr_write(thefile, buf, &amt); buf = (char *)buf + amt; From 87db76abd8270be6c9ca3f32af30dd56ebefeace Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Fri, 10 Nov 2000 19:21:31 +0000 Subject: [PATCH 0709/7878] A few minor tweaks and some clarification of the purpose of a field. Submitted by: Jeff Trawick <trawick@apache.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60687 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index e4722b7b7ea..4d0ede11679 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -142,7 +142,7 @@ typedef apr_uint16_t apr_port_t; * * It's defined here as I think it should all be platform safe... */ -typedef struct { +typedef struct apr_sockaddr_t { apr_pool_t *pool; /* The pool to use... */ char *hostname; /* The hostname */ char *servname; /* This is either a string of the port number or @@ -160,9 +160,9 @@ typedef struct { * 16 for v4 or 46 for v6 * used in inet_ntop... */ - void *addr_ptr; /* This should be set to point to the - * sockaddr structure address we're using... - * i.e. sa.sin.sin_addr or sa.sin6.sin6_addr + void *ipaddr_ptr; /* This points to the IP address + * structure within the appropriate + * sockaddr structure. */ } apr_sockaddr_t; From e2a3d1719f9482e157c830e65d572b77b2cef0e1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 10 Nov 2000 19:54:34 +0000 Subject: [PATCH 0710/7878] Hard to make progress when editing headers which aren't the included headers :-0 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60688 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 16 ++++++++-------- aprlib.dsp | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apr.dsp b/apr.dsp index ff37c0e5e3f..1a5c7e016e3 100644 --- a/apr.dsp +++ b/apr.dsp @@ -96,7 +96,7 @@ SOURCE=.\time\win32\access.c # End Source File # Begin Source File -SOURCE=.\time\win32\atime.h +SOURCE=.\include\arch\win32\atime.h # End Source File # Begin Source File @@ -180,7 +180,7 @@ SOURCE=.\misc\win32\misc.c # End Source File # Begin Source File -SOURCE=.\misc\unix\misc.h +SOURCE=.\include\arch\unix\misc.h # End Source File # Begin Source File @@ -221,7 +221,7 @@ SOURCE=.\file_io\win32\filedup.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\fileio.h +SOURCE=.\include\arch\win32\fileio.h # End Source File # Begin Source File @@ -257,7 +257,7 @@ SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File -SOURCE=.\locks\win32\locks.h +SOURCE=.\include\arch\win32\locks.h # End Source File # End Group # Begin Group "network_io" @@ -265,7 +265,7 @@ SOURCE=.\locks\win32\locks.h # PROP Default_Filter "" # Begin Source File -SOURCE=.\network_io\win32\networkio.h +SOURCE=.\include\arch\win32\networkio.h # End Source File # Begin Source File @@ -314,7 +314,7 @@ SOURCE=.\threadproc\win32\threadpriv.c # End Source File # Begin Source File -SOURCE=.\threadproc\win32\threadproc.h +SOURCE=.\include\arch\win32\threadproc.h # End Source File # End Group # Begin Group "dso" @@ -326,7 +326,7 @@ SOURCE=.\dso\win32\dso.c # End Source File # Begin Source File -SOURCE=.\dso\win32\dso.h +SOURCE=.\include\arch\win32\dso.h # End Source File # End Group # Begin Group "lib" @@ -346,7 +346,7 @@ SOURCE=.\lib\apr_signal.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\i18n\unix\i18n.h +SOURCE=.\include\arch\unix\i18n.h # End Source File # Begin Source File diff --git a/aprlib.dsp b/aprlib.dsp index ff37c0e5e3f..1a5c7e016e3 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -96,7 +96,7 @@ SOURCE=.\time\win32\access.c # End Source File # Begin Source File -SOURCE=.\time\win32\atime.h +SOURCE=.\include\arch\win32\atime.h # End Source File # Begin Source File @@ -180,7 +180,7 @@ SOURCE=.\misc\win32\misc.c # End Source File # Begin Source File -SOURCE=.\misc\unix\misc.h +SOURCE=.\include\arch\unix\misc.h # End Source File # Begin Source File @@ -221,7 +221,7 @@ SOURCE=.\file_io\win32\filedup.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\fileio.h +SOURCE=.\include\arch\win32\fileio.h # End Source File # Begin Source File @@ -257,7 +257,7 @@ SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File -SOURCE=.\locks\win32\locks.h +SOURCE=.\include\arch\win32\locks.h # End Source File # End Group # Begin Group "network_io" @@ -265,7 +265,7 @@ SOURCE=.\locks\win32\locks.h # PROP Default_Filter "" # Begin Source File -SOURCE=.\network_io\win32\networkio.h +SOURCE=.\include\arch\win32\networkio.h # End Source File # Begin Source File @@ -314,7 +314,7 @@ SOURCE=.\threadproc\win32\threadpriv.c # End Source File # Begin Source File -SOURCE=.\threadproc\win32\threadproc.h +SOURCE=.\include\arch\win32\threadproc.h # End Source File # End Group # Begin Group "dso" @@ -326,7 +326,7 @@ SOURCE=.\dso\win32\dso.c # End Source File # Begin Source File -SOURCE=.\dso\win32\dso.h +SOURCE=.\include\arch\win32\dso.h # End Source File # End Group # Begin Group "lib" @@ -346,7 +346,7 @@ SOURCE=.\lib\apr_signal.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\i18n\unix\i18n.h +SOURCE=.\include\arch\unix\i18n.h # End Source File # Begin Source File From f170e71966be6568d0747def4f6a1c528600bc22 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 10 Nov 2000 19:56:51 +0000 Subject: [PATCH 0711/7878] Start killing off the historical files git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60689 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/fileio.h | 219 ----------------------------------------- 1 file changed, 219 deletions(-) delete mode 100644 file_io/win32/fileio.h diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h deleted file mode 100644 index d379535636d..00000000000 --- a/file_io/win32/fileio.h +++ /dev/null @@ -1,219 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef FILE_IO_H -#define FILE_IO_H - -#include "apr.h" -#include "apr_private.h" -#include "apr_pools.h" -#include "apr_general.h" -#include "apr_tables.h" -#include "apr_lock.h" -#include "apr_file_io.h" -#include "apr_errno.h" -#include "misc.h" - -#if APR_HAVE_SYS_STAT_H -#include <sys/stat.h> -#endif -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_SYS_FCNTL_H -#include <fcntl.h> -#endif -#ifdef HAVE_TIME_H -#include <time.h> -#endif -#if APR_HAVE_DIRENT_H -#include <dirent.h> -#endif -#ifdef HAVE_MALLOC_H -#include <malloc.h> -#endif -#ifdef HAVE_UIO_H -#include <sys/uio.h> -#endif - -#define APR_FILE_BUFSIZE 4096 - -#if APR_HAS_UNICODE_FS -#include "i18n.h" -#include <wchar.h> - -typedef apr_int16_t apr_wchar_t; - -apr_wchar_t *utf8_to_unicode_path(const char* srcstr, apr_pool_t *p); -char *unicode_to_utf8_path(const apr_wchar_t* srcstr, apr_pool_t *p); -#endif - -typedef enum apr_canon_case_e { - APR_CANON_CASE_GIVEN, - APR_CANON_CASE_LOWER, - APR_CANON_CASE_TRUE -} apr_canon_case_e; - -typedef enum apr_canon_path_e { - APR_CANON_PATH_VIRUTAL, - APR_CANON_PATH_ABSOLUTE, - APR_CANON_PATH_RELATIVE -} apr_canon_path_e; - -/* - * Internal canonical filename elements for the apr_canon_t elems - * ccase tracks the mechanism used to resolve this element - * pathlen is the full path length to the end of this element - * name slash is prefix, as appropriate - - */ -typedef struct apr_canon_elem_t { - apr_canon_case_e ccase; - int pathlen; - char *name; -} apr_canon_elem_t; - -/* warning: win32 canonical path "/" resolves to a - * zero'th element of the empty string for testing the - * psudo-root for the system - */ -struct apr_canon_t { - apr_pool_t *cntxt; - apr_array_header_t *elems; - apr_canon_path_e type; -}; - -/* quick run-down of fields in windows' apr_file_t structure that may have - * obvious uses. - * fname -- the filename as passed to the open call. - * dwFileAttricutes -- Attributes used to open the file. - * demonfname -- the canonicalized filename. Used to store the result from - * apr_os_canonicalize_filename. - * lowerdemonfname -- inserted at Ken Parzygnat's request, because of the - * ugly way windows deals with case in the filesystem. - * append -- Windows doesn't support the append concept when opening files. - * APR needs to keep track of this, and always make sure we append - * correctly when writing to a file with this flag set TRUE. - */ - -struct apr_file_t { - apr_pool_t *cntxt; - HANDLE filehand; - BOOLEAN pipe; // Is this a pipe of a file? - OVERLAPPED *pOverlapped; - apr_interval_time_t timeout; - - /* File specific info */ - union { -#if APR_HAS_UNICODE_FS - struct { - apr_wchar_t *fname; - } w; -#endif - struct { - char *fname; - } n; - }; - apr_canon_t *canonname; - - DWORD dwFileAttributes; - int eof_hit; - BOOLEAN buffered; // Use buffered I/O? - int ungetchar; // Last char provided by an unget op. (-1 = no char) - int append; - off_t size; - apr_time_t atime; - apr_time_t mtime; - apr_time_t ctime; - - /* Stuff for buffered mode */ - char *buffer; - apr_ssize_t bufpos; // Read/Write position in buffer - apr_ssize_t dataRead; // amount of valid data read into buffer - int direction; // buffer being used for 0 = read, 1 = write - apr_ssize_t filePtr; // position in file of handle - apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields - - /* Pipe specific info */ - -}; - -struct apr_dir_t { - apr_pool_t *cntxt; - HANDLE dirhand; - union { -#if APR_HAS_UNICODE_FS - struct { - apr_wchar_t *dirname; - WIN32_FIND_DATAW *entry; - } w; -#endif - struct { - char *dirname; - WIN32_FIND_DATA *entry; - } n; - }; -}; - -apr_status_t file_cleanup(void *); - -/** - * Internal function to create a Win32/NT pipe that respects some async - * timeout options. - */ -apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, - BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, - apr_pool_t *p); -#endif /* ! FILE_IO_H */ - From 9d8f9cfb0826528ed34e5c95c0e1cc5829250a61 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 10 Nov 2000 19:58:45 +0000 Subject: [PATCH 0712/7878] Observing MAX_PATH once again in win32's opendir/readdir. Skip over entries who's absolute path would exceed MAX_PATH. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60690 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 64 +++++++++++++++++++++++++++++++------ include/arch/win32/fileio.h | 1 + 2 files changed, 56 insertions(+), 9 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 470fcea65c3..198e449c3fd 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -84,6 +84,12 @@ apr_status_t dir_cleanup(void *thedir) apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) { + /* Note that we won't open a directory that is greater than MAX_PATH, + * including the trailing /* wildcard suffix. If a * won't fit, then + * neither will any other file name within the directory. + * The length not including the trailing '*' is stored as rootlen, to + * skip over all paths which are too long. + */ int len = strlen(dirname); #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; @@ -92,24 +98,42 @@ apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) /* While there is now a generic accessor to convert to Unicode, * we do something special here to provide a few extra wchars * for the /* (really \*) suffix + * + * Note that the \\?\ form only works for local drive paths, and + * not for UNC paths. */ int srcremains = len; int dirremains = len; apr_wchar_t *wch; (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); (*new)->w.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); - (*new)->w.dirname = apr_palloc(cont, (dirremains + 7) * 2); - wcscpy((*new)->w.dirname, L"\\\\?\\"); + wch = (*new)->w.dirname = apr_palloc(cont, (dirremains + 7) * 2); + if (dirname[1] == ':' && dirname[2] == '/') { + wcscpy((*new)->w.dirname, L"\\\\?\\"); + wch += 4; + } if (conv_utf8_to_ucs2(dirname, &srcremains, - (*new)->w.dirname + 4, &dirremains) || srcremains) + wch, &dirremains) || srcremains) { + (*new) = NULL; return APR_ENAMETOOLONG; - len = 4 + len - dirremains; - if (len && (*new)->w.dirname[len - 1] != '/') { - (*new)->w.dirname[len++] = '/'; } - (*new)->w.dirname[len++] = '*'; - (*new)->w.dirname[len] = '\0'; - for (wch = (*new)->w.dirname + 4; *wch; ++wch) + len -= dirremains; + if (len && wch[len - 1] != '/') { + wch[len++] = L'/'; + } + wch[len++] = L'*'; + wch[len] = L'\0'; + if (wch != (*new)->w.dirname) + { + if (len >= MAX_PATH ) { + (*new) = NULL; + return APR_ENAMETOOLONG; + } + (*new)->rootlen = len - 1; + } + else /* we don't care, since the path isn't limited in length */ + (*new)->rootlen = 0; + for (; *wch; ++wch) if (*wch == L'/') *wch = L'\\'; } @@ -125,6 +149,11 @@ apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) } (*new)->n.dirname[len++] = '*'; (*new)->n.dirname[len] = '\0'; + (*new)->rootlen = len - 1; + if (len >= MAX_PATH ){ + (*new) = NULL; + return APR_ENAMETOOLONG; + } } (*new)->cntxt = cont; (*new)->dirhand = INVALID_HANDLE_VALUE; @@ -144,6 +173,9 @@ apr_status_t apr_closedir(apr_dir_t *dir) apr_status_t apr_readdir(apr_dir_t *thedir) { + /* The while loops below allow us to skip all invalid file names, so that + * we aren't reporting any files where their absolute paths are too long. + */ #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; if (!apr_get_oslevel(thedir->cntxt, &os_level) && os_level >= APR_WIN_NT) @@ -157,6 +189,13 @@ apr_status_t apr_readdir(apr_dir_t *thedir) else if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) { return apr_get_os_error(); } + while (thedir->rootlen && + thedir->rootlen + wcslen(thedir->w.entry->cFileName) >= MAX_PATH) + { + if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) { + return apr_get_os_error(); + } + } } else #endif @@ -170,6 +209,13 @@ apr_status_t apr_readdir(apr_dir_t *thedir) else if (!FindNextFile(thedir->dirhand, thedir->n.entry)) { return apr_get_os_error(); } + while (thedir->rootlen && + thedir->rootlen + strlen(thedir->n.entry->cFileName) >= MAX_PATH) + { + if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) { + return apr_get_os_error(); + } + } } return APR_SUCCESS; } diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index d379535636d..7af0132c343 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -192,6 +192,7 @@ struct apr_file_t { struct apr_dir_t { apr_pool_t *cntxt; HANDLE dirhand; + apr_size_t rootlen; union { #if APR_HAS_UNICODE_FS struct { From 0239d7570daa16df07fa20888df91b59423a3421 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 10 Nov 2000 20:03:51 +0000 Subject: [PATCH 0713/7878] Cleaning up from the include/arch reorg git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60691 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/networkio.h | 86 ------------------------------------ 1 file changed, 86 deletions(-) delete mode 100644 network_io/win32/networkio.h diff --git a/network_io/win32/networkio.h b/network_io/win32/networkio.h deleted file mode 100644 index 3d5897a6249..00000000000 --- a/network_io/win32/networkio.h +++ /dev/null @@ -1,86 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef NETWORK_IO_H -#define NETWORK_IO_H - -#include "apr_network_io.h" -#include "apr_general.h" - -struct apr_socket_t { - apr_pool_t *cntxt; - SOCKET sock; - struct sockaddr_in *local_addr; - struct sockaddr_in *remote_addr; - size_t addr_len; - apr_interval_time_t timeout; - apr_int32_t disconnected; - int local_port_unknown; - int local_interface_unknown; -}; - -struct apr_pollfd_t { - apr_pool_t *cntxt; - fd_set *read; - int numread; - fd_set *write; - int numwrite; - fd_set *except; - int numexcept; -}; - -apr_status_t status_from_res_error(int); - -#endif /* ! NETWORK_IO_H */ - From d03d7bf90ca068fd159ecdd09908ebe736829755 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 10 Nov 2000 20:17:24 +0000 Subject: [PATCH 0714/7878] =?UTF-8?q?Fix=20a=20windows=20compile=20break.?= =?UTF-8?q?=20Submitted=20by:=09Branko=20=EF=BF=BDibej"=20<brane@xbc.nu>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60692 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockopt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 07be26deb67..5a763836557 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -213,7 +213,7 @@ apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t * else return APR_EINVAL; - hptr = gethostbyaddr((char *)&sa_ptr), sizeof(struct in_addr), AF_INET); + hptr = gethostbyaddr((char *)&sa_ptr, sizeof(struct in_addr), AF_INET); if (hptr != NULL) { *name = apr_pstrdup(sock->cntxt, hptr->h_name); From a936303ac061ad32f70525499fd65a2759e5301b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 10 Nov 2000 20:26:39 +0000 Subject: [PATCH 0715/7878] Fix symbol breaks on win32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60693 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 3 ++- libapr.def | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/aprlib.def b/aprlib.def index e43cd4fe267..048309f5dd4 100644 --- a/aprlib.def +++ b/aprlib.def @@ -58,7 +58,7 @@ EXPORTS apr_listen @51 apr_accept @52 apr_connect @53 - apr_get_remote_hostname @54 + apr_get_hostname @54 apr_gethostname @55 apr_send @56 apr_recv @57 @@ -83,6 +83,7 @@ EXPORTS apr_get_port @76 apr_set_port @77 apr_get_inaddr @78 + apr_get_socket_inaddr @79 ; ; diff --git a/libapr.def b/libapr.def index e43cd4fe267..048309f5dd4 100644 --- a/libapr.def +++ b/libapr.def @@ -58,7 +58,7 @@ EXPORTS apr_listen @51 apr_accept @52 apr_connect @53 - apr_get_remote_hostname @54 + apr_get_hostname @54 apr_gethostname @55 apr_send @56 apr_recv @57 @@ -83,6 +83,7 @@ EXPORTS apr_get_port @76 apr_set_port @77 apr_get_inaddr @78 + apr_get_socket_inaddr @79 ; ; From 76735196425730e068008ab2e444f64c01e1a996 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 10 Nov 2000 21:49:19 +0000 Subject: [PATCH 0716/7878] Reintroduce MAX_PATH into win32 Unicode path processing, except on the local drives using //?/d:/ semantics. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60694 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index a3af8900ecb..0bbfe686878 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -81,11 +81,18 @@ apr_wchar_t *utf8_to_unicode_path(const char* srcstr, apr_pool_t *p) */ int srcremains = strlen(srcstr) + 1; int retremains = srcremains + 4; - apr_wchar_t *retstr = apr_palloc(p, retremains * 2), *t = retstr; + apr_wchar_t *retstr, *t; if (srcstr[1] == ':' && srcstr[2] == '/') { + retstr = apr_palloc(p, retremains * 2); wcscpy (retstr, L"\\\\?\\"); retremains -= 4; - t += 4; + t = retstr + 4; + } + else /* Short path: count the trailing NULL */ + { + if (retremains > MAX_PATH) + retremains = MAX_PATH; + t = retstr = apr_palloc(p, retremains * 2); } if (conv_utf8_to_ucs2(srcstr, &srcremains, t, &retremains) || srcremains) From f7c92e24267761258087d49d46258b613f543aa0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 10 Nov 2000 21:51:49 +0000 Subject: [PATCH 0717/7878] Attacking the problem from another front... borland users might want something similar, if they have win32 ommisions from sys/stat.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60695 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/fileio.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 7af0132c343..66ffd3bea29 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -89,6 +89,15 @@ #define APR_FILE_BUFSIZE 4096 +/* obscure ommissions from msvc's sys/stat.h */ +#ifdef _MSC_VER +#define S_IFIFO _S_IFIFO /* pipe */ +#define S_IFBLK 0060000 /* Block Special */ +#define S_IFLNK 0120000 /* Symbolic Link */ +#define S_IFSOCK 0140000 /* Socket */ +#define S_IFWHT 0160000 /* Whiteout */ +#endif + #if APR_HAS_UNICODE_FS #include "i18n.h" #include <wchar.h> From 803393430eebdbbdaab7eb003e519e25c04fbfa6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 10 Nov 2000 22:11:36 +0000 Subject: [PATCH 0718/7878] Cleanup the sendfile checks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60696 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure.in b/configure.in index f9409bac8b0..2dd4b2411e9 100644 --- a/configure.in +++ b/configure.in @@ -213,8 +213,7 @@ AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) AC_CHECK_FUNCS(writev) -sendfile="0" -AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ]) +AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ], [ sendfile="0" ]) AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ]) AC_CHECK_FUNCS(getpass) APR_CHECK_INET_ADDR From 6f9d3bb6b0845ff6a2e94ed9dc09a396602961fb Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 11 Nov 2000 00:08:03 +0000 Subject: [PATCH 0719/7878] Add a missing variable is APR_IS_SUCCESS macro Submitted by: Karl Fogel <kfogel@galois.collab.net> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60697 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 57767780d0e..9a8306eef49 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -360,7 +360,7 @@ int apr_canonical_error(apr_status_t err); */ #define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e)) -#define APR_STATUS_IS_SUCCESS ((s) == APR_SUCCESS \ +#define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS \ || (s) == APR_OS_START_SYSERR + NO_ERROR) /* APR CANONICAL ERROR TESTS */ From b0f06bfe2612b7616ade253767111dd699db1228 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 11 Nov 2000 00:09:46 +0000 Subject: [PATCH 0720/7878] Tru64's sendfile implementation is completely broken, so we can't use it. The problem is that autoconf finds it in libc, so we have to hack our configuration. If sendfile is used, then the machine hangs, and that's really bad, so we should remove that code as well. Submitted by: David Hill <David.D.Hill@compaq.com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60698 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +- network_io/unix/sendrecv.c | 117 +------------------------------------ 2 files changed, 8 insertions(+), 115 deletions(-) diff --git a/configure.in b/configure.in index 2dd4b2411e9..02a1e692e73 100644 --- a/configure.in +++ b/configure.in @@ -213,7 +213,11 @@ AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) AC_CHECK_FUNCS(writev) -AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ], [ sendfile="0" ]) +sendfile="0" +AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ]) +#if test "$OS" = "*osf" -o "$OS" = "*alpha*" ; then +# sendfile="0" +#fi AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ]) AC_CHECK_FUNCS(getpass) APR_CHECK_INET_ADDR diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 56e6dbfb071..cb8cbb0f778 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -699,121 +699,10 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, return APR_SUCCESS; } #elif defined(__osf__) && defined (__alpha) -/* - * apr_sendfile for Tru64 Unix. - * - * Note: while the sendfile implementation on Tru64 can send - * a one header/trailer with the file, it will send only one - * each and not an array as is passed into this function. In - * addition, there is a limitation on the size of the header/trailer - * that can be referenced ( > 4096 seems to cause an ENOMEM) - * Rather than code these special cases in, using apr_sendv for - * all cases of the headers and trailers seems to be a good idea. +/* Tru64's sendfile implementation doesn't work, and we need to make sure that + * we don't use it until it is fixed. If it is used as it is now, it will + * hang the machine and the only way to fix it is a reboot. */ -apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, - apr_int32_t flags) -{ - off_t nbytes = 0; - int rv, i; - apr_status_t arv; - struct iovec headerstruct[2] = {(0, 0), (0, 0)}; - size_t bytes_to_send = *len; - - if (!hdtr) { - hdtr = &no_hdtr; - } - - /* Ignore flags for now. */ - flags = 0; - - if (hdtr->numheaders > 0) { - apr_size_t hdrbytes = 0; - - arv = apr_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); - if (arv != APR_SUCCESS) { - *len = 0; - return errno; - } - - nbytes += hdrbytes; - - /* If this was a partial write and we aren't doing timeouts, - * return now with the partial byte count; this is a non-blocking - * socket. - */ - if (sock->timeout <= 0) { - apr_size_t total_hdrbytes = 0; - for (i = 0; i < hdtr->numheaders; i++) { - total_hdrbytes += hdtr->headers[i].iov_len; - } - if (hdrbytes < total_hdrbytes) { - *len = hdrbytes; - return APR_SUCCESS; - } - } - } - - if (bytes_to_send) { - /* We won't dare call sendfile() if we don't have - * header or file bytes to send because bytes_to_send == 0 - * means send the whole file. - */ - do { - rv = sendfile(sock->socketdes, /* socket */ - file->filedes, /* file to be sent */ - *offset, /* where in the file to start */ - bytes_to_send, /* number of bytes to send */ - headerstruct, /* Headers/footers */ - flags); /* currently unused */ - } while (rv == -1 && errno == EINTR); - } - else - rv = 0; - - if (rv == -1 && - (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout > 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 0); - - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } - else { - do { - rv = sendfile(sock->socketdes, /* socket */ - file->filedes, /* file to be sent */ - *offset, /* where in the file to start */ - bytes_to_send, /* number of bytes to send */ - headerstruct, /* Headers/footers */ - flags); /* undefined, set to 0 */ - } while (rv == -1 && errno == EINTR); - } - } - - if (rv != -1) { - nbytes += rv; - - if (hdtr->numtrailers > 0) { - apr_size_t trlbytes = 0; - - /* send the trailers now */ - arv = apr_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trlbytes); - if (arv != APR_SUCCESS) { - *len = 0; - return errno; - } - - nbytes += trlbytes; - } - } - - (*len) = nbytes; - - return (rv < 0) ? errno : APR_SUCCESS; -} - #else #error APR has detected sendfile on your system, but nobody has written a #error version of it for APR yet. To get past this, either write apr_sendfile From 7845e35ae35904942df5637f875f82ab137b311e Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 11 Nov 2000 00:12:39 +0000 Subject: [PATCH 0721/7878] Fix the rest of the APR_STATUS_IS_SUCCESS definitions. Submitted by: Karl Fogel <kfogel@collab.net> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60699 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 9a8306eef49..de0a76c18e5 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -448,7 +448,7 @@ int apr_canonical_error(apr_status_t err); */ #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) -#define APR_STATUS_IS_SUCCESS ((s) == APR_SUCCESS \ +#define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS \ || (s) == APR_OS_START_SYSERR + ERROR_SUCCESS) /* APR CANONICAL ERROR TESTS */ @@ -504,7 +504,7 @@ int apr_canonical_error(apr_status_t err); #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) -#define APR_STATUS_IS_SUCCESS ((s) == APR_SUCCESS) +#define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) From eecbae376b6ed813b93428705d1ac223124ec717 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 11 Nov 2000 01:19:24 +0000 Subject: [PATCH 0722/7878] Brand new goodies. Win9x reports inode/device of 0 always, but WinNT will report useful numbers, as well as properly determining when the device is not a file from the apr_stat call. Win2000 now really does perform an apr_lstat, and with the patch to http_request.c, the FollowSymLinks option will work properly. Still need user/group ids... wip. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60700 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 233 ++++++++++++++++++++++++--------------- 1 file changed, 145 insertions(+), 88 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index c003943fd90..1cd34db4f56 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -92,6 +92,7 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) { BY_HANDLE_FILE_INFORMATION FileInformation; DWORD FileType; + apr_oslevel_e os_level; if (!GetFileInformationByHandle(thefile->filehand, &FileInformation)) { return apr_get_os_error(); @@ -103,13 +104,24 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) } /* If my rudimentary knowledge of posix serves... inode is the absolute - * id of the file (uniquifier) that is returned by NT as follows: - * - * dwVolumeSerialNumber - * nFileIndexHigh - * nFileIndexLow - * - * user and group could be returned as SID's, although this creates + * id of the file (uniquifier) that is returned by NT (not 9x) as follows: + */ + if (apr_get_oslevel(thefile->cntxt, &os_level) || os_level >= APR_WIN_NT) + { + finfo->inode = (apr_ino_t) FileInformation.nFileIndexHigh << 16 + | FileInformation.nFileIndexLow; + finfo->device = FileInformation.dwVolumeSerialNumber; + } + else + { + /* Since the apr_stat is not implemented with CreateFile(), + * (directories can't be opened with CreateFile() at all) + * the apr_stat always returns 0 - so must apr_getfileinfo(). + */ + finfo->inode = 0; + finfo->device = 0; + } + /* user and group could be returned as SID's, although this creates * it's own unique set of issues. All three fields are significantly * longer than the posix compatible kernals would ever require. * TODO: Someday solve this, and fix the executable flag below the @@ -117,12 +129,13 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) */ finfo->user = 0; finfo->group = 0; - finfo->inode = (apr_ino_t) FileInformation.nFileIndexHigh << 16 - | FileInformation.nFileIndexLow; - finfo->device = FileInformation.dwVolumeSerialNumber; - + /* Filetype - Directory or file: this case _will_ never happen */ - if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { + finfo->protection = S_IFLNK; + finfo->filetype = APR_LNK; + } + else if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { finfo->protection = S_IFDIR; finfo->filetype = APR_DIR; } @@ -135,12 +148,7 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) finfo->filetype = APR_CHR; } else if (FileType == FILE_TYPE_PIPE) { - /* obscure ommission in msvc... missing declaration sans underscore */ -#ifdef _MSC_VER - finfo->protection = _S_IFIFO; -#else finfo->protection = S_IFIFO; -#endif finfo->filetype = APR_PIPE; } else { @@ -179,35 +187,51 @@ apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) { - /* Big enough for the Win9x FindFile, but actually the same - * initial fields as the GetFileAttributes return structure - */ - WIN32_FIND_DATA FileInformation; apr_oslevel_e os_level; - - /* We need to catch the case where fname length == MAX_PATH since for + /* + * We need to catch the case where fname length == MAX_PATH since for * some strange reason GetFileAttributesEx fails with PATH_NOT_FOUND. * We would rather indicate length error than 'not found' * since in many cases the apr user is testing for 'not found' * and this is not such a case. */ -#if APR_HAS_UNICODE_FS if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { - apr_wchar_t *wfname; - wfname = utf8_to_unicode_path(fname, cont); - if (!wfname) - return APR_ENAMETOOLONG; - if (!GetFileAttributesExW(wfname, GetFileExInfoStandard, - &FileInformation)) { + apr_file_t thefile; + apr_status_t rv; + /* + * NT5 (W2K) only supports symlinks in the same manner as mount points. + * This code should eventually take that into account, for now treat + * every reparse point as a symlink... + * + * We must open the file with READ_CONTROL if we plan to retrieve the + * user, group or permissions. + */ + thefile.cntxt = cont; + thefile.w.fname = utf8_to_unicode_path(fname, cont); + if (!thefile.w.fname) + return APR_ENAMETOOLONG; + thefile.filehand = CreateFileW(thefile.w.fname, + 0 /* READ_CONTROL */, + FILE_SHARE_READ | FILE_SHARE_WRITE + | FILE_SHARE_DELETE, NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS + | FILE_FLAG_OPEN_NO_RECALL, NULL); + if (thefile.filehand == INVALID_HANDLE_VALUE) return apr_get_os_error(); - } + rv = apr_getfileinfo(finfo, &thefile); + CloseHandle(thefile.filehand); + return rv; } else -#else - apr_get_oslevel(cont, &os_level); -#endif { + WIN32_FIND_DATA FileInformation; + /* + * Big enough for the Win95 FindFile, but actually the same + * initial fields as the GetFileAttributesEx return structure + * used for Win98 + */ if (strlen(fname) >= MAX_PATH) { return APR_ENAMETOOLONG; } @@ -220,7 +244,7 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) } else { - /* What a waste of cpu cycles... but what else can we do? + /* What a waste of cpu cycles... but we don't have a choice */ HANDLE hFind; if (strchr(fname, '*') || strchr(fname, '?')) @@ -232,68 +256,101 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) FindClose(hFind); } } - } - memset(finfo, '\0', sizeof(*finfo)); - /* Filetype - Directory or file? - * Short of opening the handle to the file, the 'FileType' appears - * to be unknowable (in any trustworthy or consistent sense), that - * is, as far as PIPE, CHR, etc. - */ - if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - finfo->protection = S_IFDIR; - finfo->filetype = APR_DIR; - } - else { - finfo->protection = S_IFREG; - finfo->filetype = APR_REG; - } + memset(finfo, '\0', sizeof(*finfo)); + /* Filetype - Directory or file? + * Short of opening the handle to the file, the 'FileType' appears + * to be unknowable (in any trustworthy or consistent sense), that + * is, as far as PIPE, CHR, etc. + */ + if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + finfo->protection = S_IFDIR; + finfo->filetype = APR_DIR; + } + else { + finfo->protection = S_IFREG; + finfo->filetype = APR_REG; + } - /* Read, write execute for owner - * In the Win32 environment, anything readable is executable - * (well, not entirely 100% true, but I'm looking for a way - * to get at the acl permissions in simplified fashion.) - */ - if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { - finfo->protection |= S_IREAD | S_IEXEC; - } - else { - finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; - } + /* Read, write execute for owner + * In the Win32 environment, anything readable is executable + * (well, not entirely 100% true, but I'm looking for a way + * to get at the acl permissions in simplified fashion.) + */ + if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { + finfo->protection |= S_IREAD | S_IEXEC; + } + else { + finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; + } - /* Is this an executable? Guess based on the file extension. - * This is a rather silly test, IMHO... we are looking to test - * if the user 'may' execute a file (permissions), - * not if the filetype is executable. - * XXX: We need to find a solution, for real. Or provide some - * new mechanism for control. Note that the PATHEXT env var, - * in the format .ext[;.ext]... actually lists the 'executable' - * types (invoking without an extension.) Perhaps a registry - * key test is even appropriate here. + /* Is this an executable? Guess based on the file extension. + * This is a rather silly test, IMHO... we are looking to test + * if the user 'may' execute a file (permissions), + * not if the filetype is executable. + * XXX: We need to find a solution, for real. Or provide some + * new mechanism for control. Note that the PATHEXT env var, + * in the format .ext[;.ext]... actually lists the 'executable' + * types (invoking without an extension.) Perhaps a registry + * key test is even appropriate here. + */ + /* if (is_exe(fname, cont)) { + * finfo->protection |= S_IEXEC; + * } */ -/* if (is_exe(fname, cont)) { - * finfo->protection |= S_IEXEC; - * } - */ - /* File times */ - FileTimeToAprTime(&finfo->atime, &FileInformation.ftLastAccessTime); - FileTimeToAprTime(&finfo->ctime, &FileInformation.ftCreationTime); - FileTimeToAprTime(&finfo->mtime, &FileInformation.ftLastWriteTime); - - /* Note: This cannot handle files greater than can be held by an int - */ - finfo->size = FileInformation.nFileSizeLow; - if (finfo->size < 0 || FileInformation.nFileSizeHigh) - finfo->size = 0x7fffffff; + /* File times */ + FileTimeToAprTime(&finfo->atime, &FileInformation.ftLastAccessTime); + FileTimeToAprTime(&finfo->ctime, &FileInformation.ftCreationTime); + FileTimeToAprTime(&finfo->mtime, &FileInformation.ftLastWriteTime); + /* Note: This cannot handle files greater than can be held by an int + */ + finfo->size = FileInformation.nFileSizeLow; + if (finfo->size < 0 || FileInformation.nFileSizeHigh) + finfo->size = 0x7fffffff; + } return APR_SUCCESS; } apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) { - /* TODO: determine if apr_lstat is a true NT symlink what the stats of the - * link are, rather than the target. NT5 (W2K) only. - */ - return apr_stat(finfo, fname, cont); + apr_oslevel_e os_level; + if (apr_get_oslevel(cont, &os_level) || os_level < APR_WIN_2000) + { + /* Windows 9x doesn't support links whatsoever, and NT 4.0 + * only supports hard links. Just fall through + */ + return apr_stat(finfo, fname, cont); + } + else + { + apr_file_t thefile; + apr_status_t rv; + /* + * NT5 (W2K) only supports symlinks in the same manner as mount points. + * This code should eventually take that into account, for now treat + * every reparse point as a symlink... + * + * We must open the file with READ_CONTROL if we plan to retrieve the + * user, group or permissions. + */ + thefile.cntxt = cont; + thefile.w.fname = utf8_to_unicode_path(fname, cont); + if (!thefile.w.fname) + return APR_ENAMETOOLONG; + thefile.filehand = CreateFileW(thefile.w.fname, + 0 /* READ_CONTROL */, + FILE_SHARE_READ | FILE_SHARE_WRITE + | FILE_SHARE_DELETE, NULL, + OPEN_EXISTING, + FILE_FLAG_OPEN_REPARSE_POINT + | FILE_FLAG_BACKUP_SEMANTICS + | FILE_FLAG_OPEN_NO_RECALL, NULL); + if (thefile.filehand == INVALID_HANDLE_VALUE) + return apr_get_os_error(); + rv = apr_getfileinfo(finfo, &thefile); + CloseHandle(thefile.filehand); + return rv; + } } From 823d3837e783205df9aea2816335c9815d5bb8cc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 11 Nov 2000 02:20:29 +0000 Subject: [PATCH 0723/7878] Add unlimited path length support for //server/share/ format UNC names. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60701 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 26 +++++++++++++-------- file_io/win32/open.c | 55 +++++++++++++++++++++++++++++--------------- 2 files changed, 53 insertions(+), 28 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 198e449c3fd..dece0eccadf 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -107,11 +107,22 @@ apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) apr_wchar_t *wch; (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); (*new)->w.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); - wch = (*new)->w.dirname = apr_palloc(cont, (dirremains + 7) * 2); if (dirname[1] == ':' && dirname[2] == '/') { + (*new)->w.dirname = apr_palloc(cont, (dirremains + 7) * 2); wcscpy((*new)->w.dirname, L"\\\\?\\"); - wch += 4; + wch = (*new)->w.dirname + 4; } + else if (dirname[0] == '/' && dirname[1] == '/') { + /* Skip the leading slashes */ + dirname += 2; + srcremains = dirremains = (len -= 2); + (*new)->w.dirname = apr_palloc(cont, (dirremains + 11) * 2); + wcscpy ((*new)->w.dirname, L"\\\\?\\UNC\\"); + wch = (*new)->w.dirname + 8; + } + else + wch = (*new)->w.dirname = apr_palloc(cont, (dirremains + 3) * 2); + if (conv_utf8_to_ucs2(dirname, &srcremains, wch, &dirremains) || srcremains) { (*new) = NULL; @@ -289,14 +300,9 @@ apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) apr_oslevel_e os_level; if (!apr_get_oslevel(thedir->cntxt, &os_level) && os_level >= APR_WIN_NT) { - /* The usual Unicode to char* accessor doesn't work here. Since we don't - * have a full path, and don't need to transpose slashes, we don't need it - */ - int entremains = wcslen(thedir->w.entry->cFileName) + 1; - int retremains = (entremains - 1) * 3 + 1; - (*new) = apr_palloc(thedir->cntxt, retremains); - if (conv_ucs2_to_utf8(thedir->w.entry->cFileName, &entremains, - *new, &retremains) || entremains) + (*new) = unicode_to_utf8_path(thedir->w.entry->cFileName, + thedir->cntxt); + if (!*new) return APR_ENAMETOOLONG; } else diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 0bbfe686878..69552aef0a9 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -77,23 +77,26 @@ apr_wchar_t *utf8_to_unicode_path(const char* srcstr, apr_pool_t *p) * the \\?\ form doesn't allow '/' path seperators. * * Note that the \\?\ form only works for local drive paths, and - * not for UNC paths. + * \\?\UNC\ is needed UNC paths. */ int srcremains = strlen(srcstr) + 1; - int retremains = srcremains + 4; + int retremains = srcremains; apr_wchar_t *retstr, *t; if (srcstr[1] == ':' && srcstr[2] == '/') { - retstr = apr_palloc(p, retremains * 2); + retstr = apr_palloc(p, (retremains + 4) * 2); wcscpy (retstr, L"\\\\?\\"); - retremains -= 4; t = retstr + 4; } - else /* Short path: count the trailing NULL */ - { - if (retremains > MAX_PATH) - retremains = MAX_PATH; - t = retstr = apr_palloc(p, retremains * 2); + else if (srcstr[0] == '/' && srcstr[1] == '/') { + /* Skip the slashes */ + srcstr += 2; + retremains = (srcremains -= 2); + retstr = apr_palloc(p, (retremains + 8) * 2); + wcscpy (retstr, L"\\\\?\\UNC\\"); + t = retstr + 8; } + else + t = retstr = apr_palloc(p, retremains * 2); if (conv_utf8_to_ucs2(srcstr, &srcremains, t, &retremains) || srcremains) return NULL; @@ -109,24 +112,40 @@ char *unicode_to_utf8_path(const apr_wchar_t* srcstr, apr_pool_t *p) * the true size of the retstr, but that's a memory over speed * tradeoff that isn't appropriate this early in development. * - * Skip the leading 4 characters, allocate the maximum string + * Skip the leading 4 characters if the path begins \\?\, or substitute + * // for the \\?\UNC\ path prefix, allocating the maximum string * length based on the remaining string, plus the trailing null. - * then transform \\'s back into /'s since the \\?\ form didn't - * allow '/' path seperators, but APR always uses '/'s. + * then transform \\'s back into /'s since the \\?\ form never + * allows '/' path seperators, and APR always uses '/'s. */ int srcremains = wcslen(srcstr) + 1; int retremains = (srcremains - 5) * 3 + 1; - char *t, *retstr = apr_palloc(p, retremains); + char *t, *retstr; if (srcstr[0] == L'\\' && srcstr[1] == L'\\' && srcstr[2] == L'?' && srcstr[3] == L'\\') { - srcremains -= 4; - retremains -= 12; - srcstr += 4; + if (srcstr[4] == L'U' && srcstr[5] == L'N' && + srcstr[6] == L'C' && srcstr[7] == L'\\') { + srcremains -= 8; + retremains -= 24; + srcstr += 8; + retstr = apr_palloc(p, retremains + 2); + strcpy(retstr, "//"); + t = retstr + 2; + } + else { + srcremains -= 4; + retremains -= 12; + srcstr += 4; + t = retstr = apr_palloc(p, retremains); + } } + else + t = retstr = apr_palloc(p, retremains); + if (conv_ucs2_to_utf8(srcstr, &srcremains, - retstr, &retremains) || srcremains) + t, &retremains) || srcremains) return NULL; - for (t = retstr; *t; ++t) + for (; *t; ++t) if (*t == L'/') *t = L'\\'; return retstr; From f930f96e3b0b5d43934513deb5de0814f9553d14 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 11 Nov 2000 02:27:06 +0000 Subject: [PATCH 0724/7878] Roll everything into a single unicode -> utf8 path converter, and what happens? I break it (big surprize.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60702 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 69552aef0a9..3a90d9d26c4 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -119,7 +119,7 @@ char *unicode_to_utf8_path(const apr_wchar_t* srcstr, apr_pool_t *p) * allows '/' path seperators, and APR always uses '/'s. */ int srcremains = wcslen(srcstr) + 1; - int retremains = (srcremains - 5) * 3 + 1; + int retremains = (srcremains - 1) * 3 + 1; char *t, *retstr; if (srcstr[0] == L'\\' && srcstr[1] == L'\\' && srcstr[2] == L'?' && srcstr[3] == L'\\') { From 0b1c0965b88716d4b225317fc25ac5a6bd9022f2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 11 Nov 2000 03:23:11 +0000 Subject: [PATCH 0725/7878] More files affected by APR_HAS_UNICODE_FS on Win32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60703 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 53 +++++++++++++++++++++++++++++++-------------- file_io/win32/dir.c | 42 +++++++++++++++++++++++++++++++---- 2 files changed, 75 insertions(+), 20 deletions(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index be80510d5ed..a6e3dfe5e5a 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -54,6 +54,8 @@ #include "dso.h" #include "apr_strings.h" +#include "apr_private.h" +#include "fileio.h" #if APR_HAS_DSO @@ -61,25 +63,44 @@ apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path apr_pool_t *ctx) { HINSTANCE os_handle; - char fspec[MAX_PATH], *p = fspec; UINT em; - /* Must convert path from / to \ notation. - * Per PR2555, the LoadLibraryEx function is very picky about slashes. - * Debugging on NT 4 SP 6a reveals First Chance Exception within NTDLL. - * LoadLibrary in the MS PSDK also reveals that it -explicitly- states - * that backslashes must be used for the LoadLibrary family of calls. - */ - apr_cpystrn(fspec, path, MAX_PATH); - while (p = strchr(p, '/')) - *p = '\\'; +#if APR_HAS_UNICODE_FS + apr_oslevel_e os_level; + if (!apr_get_oslevel(ctx, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t *wpath = utf8_to_unicode_path(path, ctx); + if (!wpath) + return APR_ENAMETOOLONG; + + /* Prevent ugly popups from killing our app */ + em = SetErrorMode(SEM_FAILCRITICALERRORS); + os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + if (!os_handle) + os_handle = LoadLibraryExW(wpath, NULL, 0); + SetErrorMode(em); + } + else +#endif + { + char fspec[MAX_PATH], *p = fspec; + /* Must convert path from / to \ notation. + * Per PR2555, the LoadLibraryEx function is very picky about slashes. + * Debugging on NT 4 SP 6a reveals First Chance Exception within NTDLL. + * LoadLibrary in the MS PSDK also reveals that it -explicitly- states + * that backslashes must be used for the LoadLibrary family of calls. + */ + apr_cpystrn(fspec, path, MAX_PATH); + while (p = strchr(p, '/')) + *p = '\\'; - /* Prevent ugly popups from killing our app */ - em = SetErrorMode(SEM_FAILCRITICALERRORS); - os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); - if (!os_handle) - os_handle = LoadLibraryEx(path, NULL, 0); - SetErrorMode(em); + /* Prevent ugly popups from killing our app */ + em = SetErrorMode(SEM_FAILCRITICALERRORS); + os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + if (!os_handle) + os_handle = LoadLibraryEx(path, NULL, 0); + SetErrorMode(em); + } *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); if(os_handle == NULL) { diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index dece0eccadf..71ba0dd8c5c 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -243,17 +243,43 @@ apr_status_t apr_rewinddir(apr_dir_t *dir) apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { - if (!CreateDirectory(path, NULL)) { - return apr_get_os_error(); +#if APR_HAS_UNICODE_FS + apr_oslevel_e os_level; + if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t *wpath = utf8_to_unicode_path(path, cont); + if (!wpath) + return APR_ENAMETOOLONG; + if (!CreateDirectoryW(wpath, NULL)) { + return apr_get_os_error(); + } } + else +#endif + if (!CreateDirectory(path, NULL)) { + return apr_get_os_error(); + } return APR_SUCCESS; } apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) { - if (!RemoveDirectory(path)) { - return apr_get_os_error(); +#if APR_HAS_UNICODE_FS + apr_oslevel_e os_level; + if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t *wpath = utf8_to_unicode_path(path, cont); + if (!wpath) + return APR_ENAMETOOLONG; + if (!RemoveDirectoryW(wpath)) { + return apr_get_os_error(); + } } + else +#endif + if (!RemoveDirectory(path)) { + return apr_get_os_error(); + } return APR_SUCCESS; } @@ -320,6 +346,13 @@ apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) return APR_SUCCESS; } +/* XXX: This is sort of blinkin stupid on win32... consider, + * our open doesn't open the dir, it sets up the apr_dir_t, + * and on the first apr_readdir it actually does a FindFirstFile + * if the handle is closed, or else a FindNextFile that is based + * on cached info that we simply don't have our hands on when + * we use this function. Maybe APR_ENOTIMPL would be better? + */ apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) { if (cont == NULL) { @@ -330,5 +363,6 @@ apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *c (*dir)->cntxt = cont; } (*dir)->dirhand = thedir; + (*dir)->dirhand = thedir; return APR_SUCCESS; } From d4e3b117a8f6501373079f5c858629f6e3489198 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 11 Nov 2000 04:18:16 +0000 Subject: [PATCH 0726/7878] Yes - I was going somewhere with that redundant thought. Made for a successful evening, but I cracked a few eggs that need to be put back in their shells (includes aren't working right, nor is the root multiview.) Back on it when I'm alert tommorow, but if you see anything odd in Win32, I already know about it :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60704 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 71ba0dd8c5c..99dbd51b29b 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -362,7 +362,8 @@ apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *c (*dir) = (apr_dir_t *)apr_pcalloc(cont, sizeof(apr_dir_t)); (*dir)->cntxt = cont; } - (*dir)->dirhand = thedir; + else + (*dir)->rootlen = 0; /* We don't know, don't care */ (*dir)->dirhand = thedir; return APR_SUCCESS; } From 128e23d0078a497806752beba20ef6bc190451bf Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 11 Nov 2000 06:05:59 +0000 Subject: [PATCH 0727/7878] =?UTF-8?q?Not=20all=20platforms=20have=20INADDR?= =?UTF-8?q?=5FNONE=20defined=20by=20default.=20=20Apache=20used=20to=20che?= =?UTF-8?q?ck=20for=20this=20and=20the=20define=20it=20if=20needed.=20=20S?= =?UTF-8?q?ince=20APR=20also=20needs=20this=20check=20it=20makes=20more=20?= =?UTF-8?q?sense=20for=20APR=20to=20just=20check=20and=20export=20a=20symo?= =?UTF-8?q?bl=20that=20is=20always=20available.=20Submitted=20by:=09Branko?= =?UTF-8?q?=20=EF=BF=BDibej=20<brane@xbc.nu>=20Reviewed=20by:=09Ryan=20Blo?= =?UTF-8?q?om?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60705 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 34 ++++++++++++++++++++++++++++++++++ configure.in | 3 +++ include/apr.h.in | 5 +++++ network_io/unix/sa_common.c | 4 +++- network_io/win32/sockaddr.c | 2 +- 5 files changed, 46 insertions(+), 2 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index a9a910a64c1..922badc0cfc 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -397,5 +397,39 @@ if test "$ac_cv_define_sockaddr_sa_len" = "yes"; then fi ]) +dnl +dnl APR_INADDR_NONE +dnl +dnl checks for missing INADDR_NONE macro +dnl +AC_DEFUN(APR_INADDR_NONE,[ + AC_CACHE_CHECK(whether system defines INADDR_NONE, ac_cv_inaddr_none,[ + AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif +],[ +unsigned long foo = INADDR_NONE; +],[ + ac_cv_inaddr_none=yes +],[ + ac_cv_inaddr_none=no +])]) + if test "$ac_cv_inaddr_none" = "no"; then + apr_inaddr_none="((unsigned int) 0xffffffff)" + else + apr_inaddr_none="INADDR_NONE" + fi +]) + sinclude(apr_common.m4) sinclude(hints.m4) diff --git a/configure.in b/configure.in index 02a1e692e73..67fe60cd9d0 100644 --- a/configure.in +++ b/configure.in @@ -222,6 +222,7 @@ AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ]) AC_CHECK_FUNCS(getpass) APR_CHECK_INET_ADDR APR_CHECK_INET_NETWORK +AC_SUBST(apr_inaddr_none) AC_CHECK_FUNC(_getch) AC_CHECK_FUNCS(gmtime_r localtime_r) AC_CHECK_FUNCS(iconv, [ iconv="1" ], [ iconv="0" ]) @@ -331,6 +332,8 @@ AC_FUNC_SETPGRP APR_CHECK_SOCKLEN_T +APR_INADDR_NONE + dnl # Checks for integer size AC_CHECK_SIZEOF(char, 1) AC_CHECK_SIZEOF(int, 4) diff --git a/include/apr.h.in b/include/apr.h.in index 524edcf1035..1ade789dd5e 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -107,6 +107,11 @@ */ #define APR_FILES_AS_SOCKETS @file_as_socket@ +/* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE + * on all platforms. + */ +#define APR_INADDR_NONE @apr_inaddr_none@ + /* Typedefs that APR needs. */ typedef @short_value@ apr_int16_t; diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 747b550d016..fec3eb8cc1e 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -63,6 +63,8 @@ * that differs between platforms. */ +#include "apr.h" + apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, apr_port_t port) { @@ -122,7 +124,7 @@ apr_status_t apr_get_inaddr(apr_in_addr_t *addr, char *hostname) addr->s_addr = htonl(INADDR_ANY); return APR_SUCCESS; } - if ((addr->s_addr = apr_inet_addr(hostname)) != INADDR_NONE) + if ((addr->s_addr = apr_inet_addr(hostname)) != APR_INADDR_NONE) return APR_SUCCESS; /* hmmm, it's not a numeric IP address so we need to look it up :( */ diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index 14015adac30..336b6edb363 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -94,7 +94,7 @@ apr_status_t apr_set_ipaddr(apr_socket_t *sock, apr_interface_e which, const cha ipaddr = inet_addr(addr); - if (ipaddr == INADDR_NONE) { + if (ipaddr == APR_INADDR_NONE) { return WSAEADDRNOTAVAIL; } From 145c3fddf60ef9834ec0ada0b83d53d8946c0241 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sun, 12 Nov 2000 14:46:11 +0000 Subject: [PATCH 0728/7878] Get the sendfile-avoidance for Tru64 working. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60706 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 67fe60cd9d0..67b8d96a751 100644 --- a/configure.in +++ b/configure.in @@ -215,9 +215,12 @@ AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) AC_CHECK_FUNCS(writev) sendfile="0" AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ]) -#if test "$OS" = "*osf" -o "$OS" = "*alpha*" ; then -# sendfile="0" -#fi +case "$OS" in + *alpha*-dec-osf* ) + sendfile="0" + echo "sendfile support disabled to avoid system problem" + ;; +esac AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ]) AC_CHECK_FUNCS(getpass) APR_CHECK_INET_ADDR From 55bf1c80d7166ed6fd1c84b430c832c835390610 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sun, 12 Nov 2000 21:58:15 +0000 Subject: [PATCH 0729/7878] Use apr_set_port() instead of apr_set_{remote|local}_port(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60707 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testsf.c b/test/testsf.c index 36a29a4cad7..0458a59a345 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -217,7 +217,7 @@ static int client(client_socket_mode_t socket_mode) exit(1); } - rv = apr_set_remote_port(sock, TESTSF_PORT); + rv = apr_set_port(sock, APR_REMOTE, TESTSF_PORT); if (rv != APR_SUCCESS) { fprintf(stderr, "apr_set_remote_port()->%d/%s\n", rv, @@ -493,7 +493,7 @@ static int server(void) apr_setup(&p, &sock); - rv = apr_set_local_port(sock, TESTSF_PORT); + rv = apr_set_port(sock, APR_LOCAL, TESTSF_PORT); if (rv != APR_SUCCESS) { fprintf(stderr, "apr_set_local_port()->%d/%s\n", rv, From ebfcdd62b7f62bd9e82acb6e0237ab68d46acafa Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 13 Nov 2000 02:57:25 +0000 Subject: [PATCH 0730/7878] =?UTF-8?q?Make=20Win32=20compile=20again=20by?= =?UTF-8?q?=20defining=20APR=5FINADDR=5FNONE=20in=20apr.hw.=20Submitted=20?= =?UTF-8?q?by:=09Branko=20=EF=BF=BDibej"=20<brane@xbc.nu>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60708 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/apr.hw b/include/apr.hw index c006b88ce15..1578901594a 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -160,6 +160,11 @@ */ #define APR_HAS_UNICODE_FS 1 +/* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE + * on all platforms. + */ +#define APR_INADDR_NONE INADDR_NONE + /* Typedefs that APR needs. */ typedef short apr_int16_t; From 479c26bfebb91ebee7bbbee14a9eee1fad526c48 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 13 Nov 2000 03:18:19 +0000 Subject: [PATCH 0731/7878] add apr_get_home_directory(), teach mod_userdir to use that instead of calling getpwnam[_r] directly, back out mod_userdir's config check for getpwnam_r git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60709 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +- include/apr.h.in | 1 + include/apr.hw | 2 + include/apr_user.h | 86 +++++++++++++++++++++++++++++++++++++++++++ user/unix/.cvsignore | 1 + user/unix/Makefile.in | 47 +++++++++++++++++++++++ user/unix/homedir.c | 86 +++++++++++++++++++++++++++++++++++++++++++ user/unix/userinfo.c | 86 +++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 311 insertions(+), 1 deletion(-) create mode 100644 include/apr_user.h create mode 100644 user/unix/.cvsignore create mode 100644 user/unix/Makefile.in create mode 100644 user/unix/homedir.c create mode 100644 user/unix/userinfo.c diff --git a/configure.in b/configure.in index 67b8d96a751..e7a1b1a881e 100644 --- a/configure.in +++ b/configure.in @@ -35,7 +35,7 @@ fi # These added to allow default directories to be used... DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" -MODULES="file_io network_io threadproc misc locks time mmap shmem i18n" +MODULES="file_io network_io threadproc misc locks time mmap shmem i18n user" # Most platforms use a prefix of 'lib' on their library files. LIBPREFIX='lib' @@ -268,6 +268,7 @@ AC_CHECK_HEADERS(memory.h) AC_CHECK_HEADERS(netdb.h) AC_CHECK_HEADERS(osreldate.h) AC_CHECK_HEADERS(process.h) +AC_CHECK_HEADERS(pwd.h) AC_CHECK_HEADERS(sys/sem.h) AC_CHECK_HEADERS(signal.h, signalh="1", signalh="0") AC_CHECK_HEADERS(stdarg.h, stdargh="1", stdargh="0") diff --git a/include/apr.h.in b/include/apr.h.in index 1ade789dd5e..5dcf8076e28 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -96,6 +96,7 @@ #define APR_HAS_OTHER_CHILD @oc@ #define APR_HAS_DSO @aprdso@ #define APR_HAS_UNICODE_FS 0 +#define APR_HAS_USER 1 /* This macro tells APR that it is safe to make a file masquerade as a * socket. This is necessary, because some platforms support poll'ing diff --git a/include/apr.hw b/include/apr.hw index 1578901594a..785b007e6ba 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -160,6 +160,8 @@ */ #define APR_HAS_UNICODE_FS 1 +#define APR_HAS_USER 0 + /* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE * on all platforms. */ diff --git a/include/apr_user.h b/include/apr_user.h new file mode 100644 index 00000000000..a00308077d0 --- /dev/null +++ b/include/apr_user.h @@ -0,0 +1,86 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#ifndef APR_USER_H +#define APR_USER_H + +#include "apr.h" + +#if APR_HAS_USER + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @package APR user id services + */ + +/*** + * Get the home directory for a specified userid. + * @param dirname Pointer to new string containing directory name (on output) + * @param userid The userid + * @param p The pool from which to allocate the string + * @deffunc apr_status_t apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p) + * @tip This function is available only if APR_HAS_USER is defined. + */ +apr_status_t apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p); + +#ifdef __cplusplus +} +#endif + +#endif /* ! APR_HAS_USER */ + +#endif /* ! APR_USER_H */ diff --git a/user/unix/.cvsignore b/user/unix/.cvsignore new file mode 100644 index 00000000000..f3c7a7c5da6 --- /dev/null +++ b/user/unix/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/user/unix/Makefile.in b/user/unix/Makefile.in new file mode 100644 index 00000000000..93e223b8d5b --- /dev/null +++ b/user/unix/Makefile.in @@ -0,0 +1,47 @@ + +RM=@RM@ +CC=@CC@ +RANLIB=@RANLIB@ +CFLAGS=@CFLAGS@ @OPTIM@ +LIBS=@LIBS@ +LDFLAGS=@LDFLAGS@ $(LIBS) +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch + +OBJS=homedir.o + +.c.o: + $(CC) $(CFLAGS) -c $(INCLUDES) $< + +all: $(OBJS) + +clean: + $(RM) -f *.o *.a *.so + +distclean: clean + -$(RM) -f Makefile + + +# +# We really don't expect end users to use this rule. It works only with +# gcc, and rebuilds Makefile.in. You have to re-run configure after +# using it. +# +depend: + cp Makefile.in Makefile.in.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ + && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ + && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ + -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + > Makefile.in \ + && rm Makefile.new + +# DO NOT REMOVE +homedir.o: homedir.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ + $(INCDIR)/apr_user.h $(INCDIR)/apr_private.h diff --git a/user/unix/homedir.c b/user/unix/homedir.c new file mode 100644 index 00000000000..ae02406b4b7 --- /dev/null +++ b/user/unix/homedir.c @@ -0,0 +1,86 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include "apr_strings.h" +#include "apr_portable.h" +#include "apr_user.h" +#include "apr_private.h" +#ifdef HAVE_PWD_H +#include <pwd.h> +#endif +#if APR_HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif + +apr_status_t apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p) +{ + struct passwd *pw; +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) + struct passwd pwd; + char pwbuf[512]; +#endif + +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) + if (!getpwnam_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw)) { +#else + if ((pw = getpwnam(userid)) != NULL) { +#endif + *dirname = apr_pstrdup(p, pw->pw_dir); + } + else { + return errno; + } + return APR_SUCCESS; +} + diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c new file mode 100644 index 00000000000..ae02406b4b7 --- /dev/null +++ b/user/unix/userinfo.c @@ -0,0 +1,86 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include "apr_strings.h" +#include "apr_portable.h" +#include "apr_user.h" +#include "apr_private.h" +#ifdef HAVE_PWD_H +#include <pwd.h> +#endif +#if APR_HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif + +apr_status_t apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p) +{ + struct passwd *pw; +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) + struct passwd pwd; + char pwbuf[512]; +#endif + +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) + if (!getpwnam_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw)) { +#else + if ((pw = getpwnam(userid)) != NULL) { +#endif + *dirname = apr_pstrdup(p, pw->pw_dir); + } + else { + return errno; + } + return APR_SUCCESS; +} + From 450c7b34b4d439b0ebdd799b2d14fd1516b5674b Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 13 Nov 2000 03:42:03 +0000 Subject: [PATCH 0732/7878] Get SINGLE_LISTEN_UNSERIALIZED_ACCEPT working again. This defines that macro on those platforms that have it defined in 1.3. The only platform that doesn't work yet is Linux 2.2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60710 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hints.m4 b/hints.m4 index fa459ca6375..59c0d1f40b2 100644 --- a/hints.m4 +++ b/hints.m4 @@ -84,6 +84,7 @@ case "$host" in APR_SETIFNULL(LIBS, [-lposix -lbsd]) APR_SETIFNULL(LDFLAGS, [-s]) APR_SETVAR(APACHE_MPM, [prefork]) + APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-ibm-aix*) case $host in @@ -140,6 +141,7 @@ case "$host" in APR_SETIFNULL(SHELL, [sh]) APR_SETIFNULL(file_as_socket, [0]) APR_SETVAR(APACHE_MPM, [spmt_os2]) + APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-hi-hiux) APR_SETIFNULL(CFLAGS, [-DHIUX]) @@ -163,6 +165,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(LIBS, [-lm]) ;; *-linux2) + ver=`uname -r` APR_SETIFNULL(CFLAGS, [-DLINUX=2]) APR_SETIFNULL(LIBS, [-lm]) ;; @@ -179,10 +182,12 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *486-*-bsdi*) APR_SETIFNULL(CFLAGS, [-m486]) + APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-netbsd*) APR_SETIFNULL(CFLAGS, [-DNETBSD]) APR_SETIFNULL(LIBS, [-lcrypt]) + APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-freebsd*) case $host in @@ -191,6 +196,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; esac APR_SETIFNULL(LIBS, [-lcrypt]) + APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-next-nextstep*) APR_SETIFNULL(OPTIM, [-O]) @@ -203,17 +209,21 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; dnl *-apple-rhapsody*) dnl APR_SETIFNULL(CFLAGS, [-DDARWIN -DMAC_OS_X_SERVER]) +dnl APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) dnl ;; *-apple-darwin*) APR_SETIFNULL(CFLAGS, [-DDARWIN]) + APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-dec-osf*) APR_SETIFNULL(CFLAGS, [-DOSF1]) APR_SETIFNULL(LIBS, [-lm]) + APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-qnx) APR_SETIFNULL(CFLAGS, [-DQNX]) APR_SETIFNULL(LIBS, [-N128k -lsocket -lunix]) + APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-qnx32) APR_SETIFNULL(CC, [cc -F]) From 02b01b865def6271065282292ca2b1d1bf65145f Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Mon, 13 Nov 2000 04:04:57 +0000 Subject: [PATCH 0733/7878] Fix arg type for apr_dir_entry_size to match prototype. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60711 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index ce249eebf5e..16a23c2deb1 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -158,7 +158,7 @@ apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) -apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir) +apr_status_t apr_dir_entry_size(apr_size_t *size, apr_dir_t *thedir) { if (thedir->validentry) { *size = thedir->entry.cbFile; From dd136fe9a1aa7200a2dad9e6446b1e17d36ed5f5 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Mon, 13 Nov 2000 04:27:50 +0000 Subject: [PATCH 0734/7878] Rework apr_poll to use APR time types, fixing bug where an indefinite timeout (-1) was becoming 0 due to the divide by APR_USEC_PER_SEC. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60712 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/poll.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/network_io/os2/poll.c b/network_io/os2/poll.c index 3dcf184d0f2..ad96e1aa09c 100644 --- a/network_io/os2/poll.c +++ b/network_io/os2/poll.c @@ -131,14 +131,7 @@ apr_status_t apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, { int i; int rv = 0; - time_t starttime; - struct timeval tv; - - timeout /= APR_USEC_PER_SEC; /* TODO: rework for microseconds and axe this */ - - tv.tv_sec = timeout; - tv.tv_usec = 0; - time(&starttime); + apr_time_t starttime = apr_now(); do { for (i=0; i<pollfdset->num_total; i++) { @@ -149,10 +142,10 @@ apr_status_t apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, pollfdset->num_read, pollfdset->num_write, pollfdset->num_except, - timeout >= 0 ? timeout * 1000 : -1); + timeout >= 0 ? timeout / 1000 : -1); if (rv < 0 && sock_errno() == SOCEINTR && timeout >= 0 ) { - time_t elapsed = time(NULL) - starttime; + apr_interval_time_t elapsed = apr_now() - starttime; if (timeout <= elapsed) break; From 30cca9e78b3e5fa7282b5a1c156ed3dc600ed631 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 13 Nov 2000 04:50:35 +0000 Subject: [PATCH 0735/7878] Get the hints file working on Linux. This also gets SINGLE_LISTEN.... working on linux 2.2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60713 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/hints.m4 b/hints.m4 index 59c0d1f40b2..94fb80bf0df 100644 --- a/hints.m4 +++ b/hints.m4 @@ -164,18 +164,25 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(CFLAGS, [-DHPUX]) APR_SETIFNULL(LIBS, [-lm]) ;; - *-linux2) - ver=`uname -r` - APR_SETIFNULL(CFLAGS, [-DLINUX=2]) - APR_SETIFNULL(LIBS, [-lm]) + *-linux-*) + case `uname -r` in + 2.2* ) APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) + APR_SETIFNULL(CFLAGS, [-DLINUX=2]) + APR_SETIFNULL(LIBS, [-lm]) + ;; + 2.0* ) APR_SETIFNULL(CFLAGS, [-DLINUX=2]) + APR_SETIFNULL(LIBS, [-lm]) + ;; + 1.* ) APR_SETIFNULL(CFLAGS, [-DLINUX=1]) + ;; + * ) + ;; + esac ;; *-GNU*) APR_SETIFNULL(CFLAGS, [-DHURD]) APR_SETIFNULL(LIBS, [-lm -lcrypt]) ;; - *-linux1) - APR_SETIFNULL(CFLAGS, [-DLINUX=1]) - ;; *-lynx-lynxos) APR_SETIFNULL(CFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) APR_SETIFNULL(LIBS, [-lbsd -lcrypt]) From 7a59d314345476ca2c3c625b54a69a169d040371 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Mon, 13 Nov 2000 07:39:47 +0000 Subject: [PATCH 0736/7878] Remove some accidentally (I assume :) committed junk. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60714 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 9d5b2ff56e3..d7dddefb68c 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -1,4 +1,4 @@ -os2//* ==================================================================== +/* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights From 4d62d4a9ea08cad4d3987a9f7f65755f24597c2d Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Mon, 13 Nov 2000 07:47:44 +0000 Subject: [PATCH 0737/7878] Fix an incompatible pointer type warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60715 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index d7dddefb68c..f5bcbb75c61 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -241,7 +241,7 @@ apr_status_t apr_ungetc(char ch, apr_file_t *thefile) apr_status_t apr_getc(char *ch, apr_file_t *thefile) { ULONG rc; - int bytesread; + apr_size_t bytesread; if (!thefile->isopen) { return APR_EBADF; From d6fbd552cdeee564669cdde91b4e3e202b1fd2e0 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Mon, 13 Nov 2000 10:31:35 +0000 Subject: [PATCH 0738/7878] Fix arg type to match prototype. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60716 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sendrecv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index 6e2a66a4262..1d5ac7c3b2a 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -137,7 +137,7 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) -apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_int32_t *len) +apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len) { apr_status_t rv; struct iovec *tmpvec; From 3af1c9aeacade1b732365bbe5f2e5cc471d67aec Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 13 Nov 2000 14:39:19 +0000 Subject: [PATCH 0739/7878] APR on FreeBSD: Fix a bug in apr_sendfile() which caused us to report a bogus bytes-sent value when the only thing being sent was trailers and writev() returned an error (or EAGAIN). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60717 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index cb8cbb0f778..4c51f98e677 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -437,6 +437,9 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, nbytes = rv; rv = 0; } + else { + nbytes = 0; + } } } while (rv == -1 && errno == EINTR); From 858cb9842bfdc258913015cb881cef55dc9cdd88 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 13 Nov 2000 18:32:29 +0000 Subject: [PATCH 0740/7878] Get rid of some out-of-date include directives. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60718 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/Makefile.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/passwd/Makefile.in b/passwd/Makefile.in index 025f5ca2baa..a6b7bcbcd6b 100644 --- a/passwd/Makefile.in +++ b/passwd/Makefile.in @@ -11,8 +11,7 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include -INCDIR1=../misc/@OSDIR@ -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I../misc/unix +INCLUDES=-I$(INCDIR) #LIB=@LIBPREFIX@apr.a From ff849c093abef51d49cd2fdcca5abaa84d3153bc Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Tue, 14 Nov 2000 03:14:51 +0000 Subject: [PATCH 0741/7878] Now lives in arch/os2/ PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60719 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/networkio.h | 97 -------------------------------------- 1 file changed, 97 deletions(-) delete mode 100644 network_io/os2/networkio.h diff --git a/network_io/os2/networkio.h b/network_io/os2/networkio.h deleted file mode 100644 index a87823ae9ed..00000000000 --- a/network_io/os2/networkio.h +++ /dev/null @@ -1,97 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef NETWORK_IO_H -#define NETWORK_IO_H - -#include "apr_network_io.h" -#include "apr_general.h" -#include "os2calls.h" - -struct apr_socket_t { - apr_pool_t *cntxt; - int socketdes; - struct sockaddr_in *local_addr; - struct sockaddr_in *remote_addr; - int addr_len; - apr_interval_time_t timeout; - int nonblock; -}; - -struct apr_pollfd_t { - apr_pool_t *cntxt; - int *socket_list; - int *r_socket_list; - int num_read; - int num_write; - int num_except; - int num_total; -}; - -/* Error codes returned from sock_errno() */ -#define SOCBASEERR 10000 -#define SOCEPERM (SOCBASEERR+1) /* Not owner */ -#define SOCESRCH (SOCBASEERR+3) /* No such process */ -#define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */ -#define SOCENXIO (SOCBASEERR+6) /* No such device or address */ -#define SOCEBADF (SOCBASEERR+9) /* Bad file number */ -#define SOCEACCES (SOCBASEERR+13) /* Permission denied */ -#define SOCEFAULT (SOCBASEERR+14) /* Bad address */ -#define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */ -#define SOCEMFILE (SOCBASEERR+24) /* Too many open files */ -#define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ -#define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ - -#endif /* ! NETWORK_IO_H */ - From 84d2583465fec54075cb8e969bed1718ee4e02a6 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Tue, 14 Nov 2000 06:40:07 +0000 Subject: [PATCH 0742/7878] Fix OS/2 build after the move of private APR headers to the include/arch/ area. This also messes with some unix stuff where it's shared with OS/2. The strategy used to get the right platform specific include files is: - Every Makefile.in contains something like OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) - all APR private includes look like #include "fileio.h", ie no leading arch directory so no #ifdef'ing needed in shared .c files. This ensures that the include file for the target platform is always used if it exists, otherwise the default is used. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60720 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os2/Makefile.in | 17 ++-- dso/os2/dso.c | 2 +- file_io/os2/Makefile.in | 122 ++++++++++++++++----------- file_io/os2/dir.c | 2 +- file_io/os2/filedup.c | 2 +- file_io/os2/filestat.c | 2 +- file_io/os2/maperrorcode.c | 2 +- file_io/os2/open.c | 2 +- file_io/os2/pipe.c | 2 +- file_io/os2/readwrite.c | 2 +- file_io/os2/seek.c | 2 +- file_io/unix/Makefile.in | 4 +- file_io/unix/dir.c | 2 +- file_io/unix/fileacc.c | 16 +--- file_io/unix/filedup.c | 2 +- file_io/unix/filestat.c | 2 +- file_io/unix/open.c | 2 +- file_io/unix/pipe.c | 2 +- file_io/unix/readwrite.c | 2 +- file_io/unix/seek.c | 2 +- include/arch/os2/networkio.h | 6 ++ locks/os2/Makefile.in | 24 +++--- locks/os2/locks.c | 4 +- misc/unix/Makefile.in | 32 ++++---- network_io/os2/Makefile.in | 104 ++++++++++++++--------- network_io/unix/Makefile.in | 72 ++++++++-------- network_io/unix/networkio.h | 154 ----------------------------------- network_io/unix/poll.c | 2 +- network_io/unix/sendrecv.c | 2 +- shmem/os2/Makefile.in | 21 +++-- threadproc/os2/Makefile.in | 74 ++++++++++------- threadproc/os2/proc.c | 4 +- threadproc/os2/signals.c | 4 +- threadproc/os2/thread.c | 2 +- threadproc/os2/threadpriv.c | 4 +- 35 files changed, 310 insertions(+), 390 deletions(-) delete mode 100644 network_io/unix/networkio.h diff --git a/dso/os2/Makefile.in b/dso/os2/Makefile.in index 374453368e6..7f2c9ae8a81 100644 --- a/dso/os2/Makefile.in +++ b/dso/os2/Makefile.in @@ -10,7 +10,9 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) LIB=libdso.a @@ -42,15 +44,16 @@ depend: cp Makefile.in Makefile.in.bak \ && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ && gcc -MM $(INCLUDES) $(CFLAGS) *.c | sed -e "s%\\\\\(.\)%/\\1%g" >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ + -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ + -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ > Makefile.in \ && rm Makefile.new # DO NOT REMOVE -dso.o: dso.c dso.h $(INCDIR)/apr_private.h \ +dso.o: dso.c $(OSDIR)/dso.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_dso.h diff --git a/dso/os2/dso.c b/dso/os2/dso.c index d5bfc4cc6ff..d7706f13882 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "os2/dso.h" +#include "dso.h" #define INCL_DOS #include <os2.h> #include <stdio.h> diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index 2d43b5b8a79..2b19e3a6697 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -9,7 +9,9 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) LIB=file.a @@ -49,55 +51,77 @@ depend: cp Makefile.in Makefile.in.bak \ && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ && gcc -MM $(INCLUDES) $(CFLAGS) *.c | sed -e "s%\\\\\(.\)%/\\1%g" >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(INCDIR1)/: $$(INCDIR1)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ + -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ + -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ > Makefile.in \ && rm Makefile.new # DO NOT REMOVE -dir.o: dir.c fileio.h $(INCDIR1)/apr_private.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h $(INCDIR1)/apr_lib.h \ - $(INCDIR1)/apr_thread_proc.h -fileacc.o: fileacc.c fileio.h $(INCDIR1)/apr_private.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h $(INCDIR1)/apr_lib.h \ - $(INCDIR1)/apr_thread_proc.h -filedup.o: filedup.c fileio.h $(INCDIR1)/apr_private.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h $(INCDIR1)/apr_lib.h \ - $(INCDIR1)/apr_thread_proc.h -filestat.o: filestat.c fileio.h $(INCDIR1)/apr_private.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h $(INCDIR1)/apr_lib.h \ - $(INCDIR1)/apr_thread_proc.h -maperrorcode.o: maperrorcode.c fileio.h $(INCDIR1)/apr_private.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h ../../network_io/os2/os2calls.h -open.o: open.c fileio.h $(INCDIR1)/apr_private.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h $(INCDIR1)/apr_lib.h \ - $(INCDIR1)/apr_thread_proc.h $(INCDIR1)/apr_portable.h \ - $(INCDIR1)/apr_network_io.h $(INCDIR1)/apr_lock.h -pipe.o: pipe.c fileio.h $(INCDIR1)/apr_private.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h $(INCDIR1)/apr_lib.h \ - $(INCDIR1)/apr_thread_proc.h -readwrite.o: readwrite.c fileio.h $(INCDIR1)/apr_private.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h $(INCDIR1)/apr_lib.h \ - $(INCDIR1)/apr_thread_proc.h -seek.o: seek.c fileio.h $(INCDIR1)/apr_private.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h $(INCDIR1)/apr_lib.h \ - $(INCDIR1)/apr_thread_proc.h +common.o: common.c ../unix/fileacc.c $(INCDIR)/apr_strings.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h $(OSDIR)/fileio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_lock.h +dir.o: dir.c $(OSDIR)/fileio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_strings.h +filedup.o: filedup.c $(OSDIR)/fileio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_strings.h +filestat.o: filestat.c $(OSDIR)/fileio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h +maperrorcode.o: maperrorcode.c $(OSDIR)/fileio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + ../../network_io/os2/os2calls.h ../../network_io/os2/os2nerrno.h +open.o: open.c $(OSDIR)/fileio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_dso.h $(INCDIR)/apr_strings.h +pipe.o: pipe.c $(OSDIR)/fileio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_strings.h +readwrite.o: readwrite.c $(OSDIR)/fileio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h +seek.o: seek.c $(OSDIR)/fileio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 16a23c2deb1..299a70c1eca 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "os2/fileio.h" +#include "fileio.h" #include "apr_file_io.h" #include "apr_lib.h" #include "apr_strings.h" diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 4ceed46c08c..ee52fcddb7d 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "os2/fileio.h" +#include "fileio.h" #include "apr_file_io.h" #include "apr_lib.h" #include "apr_strings.h" diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 908a24d1c9b..1410cdb91bb 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -54,7 +54,7 @@ #define INCL_DOS #define INCL_DOSERRORS -#include "os2/fileio.h" +#include "fileio.h" #include "apr_file_io.h" #include "apr_lib.h" #include <sys/time.h> diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c index fd32052ac6a..5fa39815113 100644 --- a/file_io/os2/maperrorcode.c +++ b/file_io/os2/maperrorcode.c @@ -53,7 +53,7 @@ */ #define INCL_DOSERRORS -#include "os2/fileio.h" +#include "fileio.h" #include "apr_file_io.h" #include <errno.h> #include <string.h> diff --git a/file_io/os2/open.c b/file_io/os2/open.c index b36b8b9bf11..53c772e0a05 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "os2/fileio.h" +#include "fileio.h" #include "apr_file_io.h" #include "apr_lib.h" #include "apr_portable.h" diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 161d5ef38f2..87421bd8a89 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -53,7 +53,7 @@ */ #define INCL_DOSERRORS -#include "os2/fileio.h" +#include "fileio.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_lib.h" diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index f5bcbb75c61..282766a4368 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -55,7 +55,7 @@ #define INCL_DOS #define INCL_DOSERRORS -#include "os2/fileio.h" +#include "fileio.h" #include "apr_file_io.h" #include "apr_lib.h" diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index 521649c496e..948f423f63c 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "os2/fileio.h" +#include "fileio.h" #include "apr_file_io.h" #include "apr_lib.h" #include <string.h> diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index f4e91328b5e..282ff7e4f77 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -10,7 +10,9 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) #LIB=libfile.a diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 12b0d620921..419c2f88112 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "unix/fileio.h" +#include "fileio.h" #include "apr_strings.h" #include "apr_portable.h" diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index ef0676e7d6f..6bb9241c987 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -53,21 +53,7 @@ */ #include "apr_strings.h" -#ifdef OS2 -#include "os2/fileio.h" -#elif defined(WIN32) -#include "win32/fileio.h" -#endif -#if defined(OS2) || defined(WIN32) -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_lib.h" -#include <errno.h> -#include <string.h> -#include <sys/types.h> -#else -#include "unix/fileio.h" -#endif +#include "fileio.h" /* A file to put ALL of the accessor functions for apr_file_t types. */ diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 27aad60f029..06956fac5c6 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "unix/fileio.h" +#include "fileio.h" #include "apr_strings.h" #include "apr_portable.h" diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index ed860fb7536..96f8b68c83d 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "unix/fileio.h" +#include "fileio.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_errno.h" diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 5a6201b5b79..dab768f4df4 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "unix/fileio.h" +#include "fileio.h" #include "apr_strings.h" #include "apr_portable.h" diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index e7e6d4e1058..f5bf550fd2f 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "unix/fileio.h" +#include "fileio.h" #include "apr_strings.h" static apr_status_t pipeblock(apr_file_t *thepipe) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 1ef08319808..57a950d2513 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "unix/fileio.h" +#include "fileio.h" #include "apr_lock.h" /* The only case where we don't use wait_for_io_or_timeout is on diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index c30811bd608..3ab2aca93a7 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "unix/fileio.h" +#include "fileio.h" static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) { diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index a87823ae9ed..e5c4f54fa47 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -55,9 +55,13 @@ #ifndef NETWORK_IO_H #define NETWORK_IO_H +#include "apr_private.h" #include "apr_network_io.h" #include "apr_general.h" #include "os2calls.h" +#if HAVE_NETDB_H +#include <netdb.h> +#endif struct apr_socket_t { apr_pool_t *cntxt; @@ -67,6 +71,8 @@ struct apr_socket_t { int addr_len; apr_interval_time_t timeout; int nonblock; + int local_port_unknown; + int local_interface_unknown; }; struct apr_pollfd_t { diff --git a/locks/os2/Makefile.in b/locks/os2/Makefile.in index eb0fffafb4a..df319b7494d 100644 --- a/locks/os2/Makefile.in +++ b/locks/os2/Makefile.in @@ -9,7 +9,9 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) LIB=lock.a @@ -41,16 +43,18 @@ depend: cp Makefile.in Makefile.in.bak \ && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ && gcc -MM $(INCLUDES) $(CFLAGS) *.c | sed -e "s%\\\\\(.\)%/\\1%g" >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(INCDIR1)/: $$(INCDIR1)/:g' \ - -e '1,$$s: $(INCDIR2)/: $$(INCDIR2)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ + -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ + -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ > Makefile.in \ && rm Makefile.new # DO NOT REMOVE -locks.o: locks.c $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_lib.h \ - $(INCDIR1)/apr_file_io.h $(INCDIR1)/apr_time.h \ - $(INCDIR1)/apr_thread_proc.h locks.h $(INCDIR1)/apr_lock.h \ - $(INCDIR2)/fileio.h $(INCDIR1)/apr_private.h +locks.o: locks.c $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_strings.h $(OSDIR)/locks.h \ + $(INCDIR)/apr_lock.h $(OSDIR)/fileio.h \ + $(INCDIR)/apr_private.h diff --git a/locks/os2/locks.c b/locks/os2/locks.c index 9dd2e589dbc..d5a4a2add6e 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -55,8 +55,8 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" -#include "os2/locks.h" -#include "os2/fileio.h" +#include "locks.h" +#include "fileio.h" #include <string.h> #define INCL_DOS #include <os2.h> diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index 8c8b5ca5ef4..47be670f590 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -10,7 +10,9 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch/@OSDIR@ +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) #LIB=libmisc.a @@ -43,19 +45,20 @@ depend: cp Makefile.in Makefile.in.bak \ && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ + -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ + -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ > Makefile.in \ && rm Makefile.new # DO NOT REMOVE -canonerr.o: canonerr.c $(INCDIR)/arch/unix/misc.h \ +canonerr.o: canonerr.c $(DEFOSDIR)/misc.h \ $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_getopt.h -errorcodes.o: errorcodes.c $(INCDIR)/arch/unix/misc.h \ +errorcodes.o: errorcodes.c $(DEFOSDIR)/misc.h \ $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ @@ -63,7 +66,7 @@ errorcodes.o: errorcodes.c $(INCDIR)/arch/unix/misc.h \ $(INCDIR)/apr_getopt.h $(INCDIR)/apr_strings.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ $(INCDIR)/apr_dso.h -getopt.o: getopt.c $(INCDIR)/arch/unix/misc.h $(INCDIR)/apr.h \ +getopt.o: getopt.c $(DEFOSDIR)/misc.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ @@ -76,26 +79,25 @@ getuuid.o: getuuid.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ $(INCDIR)/apr_xlate.h otherchild.o: otherchild.c $(INCDIR)/apr.h \ - $(INCDIR)/arch/unix/misc.h $(INCDIR)/apr_private.h \ + $(DEFOSDIR)/misc.h $(INCDIR)/apr_private.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_getopt.h $(INCDIR)/arch/unix/threadproc.h \ - $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_lib.h -rand.o: rand.c $(INCDIR)/arch/unix/misc.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_getopt.h $(OSDIR)/threadproc.h \ + $(OSDIR)/fileio.h $(INCDIR)/apr_lock.h +rand.o: rand.c $(DEFOSDIR)/misc.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_getopt.h -start.o: start.c $(INCDIR)/arch/unix/misc.h $(INCDIR)/apr.h \ +start.o: start.c $(DEFOSDIR)/misc.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ $(INCDIR)/apr_time.h $(INCDIR)/apr_getopt.h \ - $(INCDIR)/arch/unix/locks.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_strings.h + $(OSDIR)/locks.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_tables.h uuid.o: uuid.c $(INCDIR)/apr.h $(INCDIR)/apr_uuid.h \ $(INCDIR)/apr_errno.h $(INCDIR)/apr_lib.h \ $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ diff --git a/network_io/os2/Makefile.in b/network_io/os2/Makefile.in index 63514b0eb22..25db3a305e4 100644 --- a/network_io/os2/Makefile.in +++ b/network_io/os2/Makefile.in @@ -8,9 +8,10 @@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../inc -INCDIR1=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. +INCDIR=../../include +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) LIB=network.a @@ -47,44 +48,67 @@ depend: cp Makefile.in Makefile.in.bak \ && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ && gcc -MM $(INCLUDES) $(CFLAGS) *.c | sed -e "s%\\\\\(.\)%/\\1%g" >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(INCDIR1)/: $$(INCDIR1)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ + -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ + -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ > Makefile.in \ && rm Makefile.new # DO NOT REMOVE -os2calls.o: os2calls.c networkio.h $(INCDIR1)/apr_network_io.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h os2calls.h $(INCDIR1)/apr_portable.h \ - $(INCDIR1)/apr_thread_proc.h $(INCDIR1)/apr_lock.h \ - $(INCDIR1)/apr_lib.h -poll.o: poll.c networkio.h $(INCDIR1)/apr_network_io.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h os2calls.h $(INCDIR1)/apr_portable.h \ - $(INCDIR1)/apr_thread_proc.h $(INCDIR1)/apr_lock.h \ - $(INCDIR1)/apr_lib.h -sendrecv.o: sendrecv.c networkio.h $(INCDIR1)/apr_network_io.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h os2calls.h $(INCDIR1)/apr_lib.h \ - $(INCDIR1)/apr_thread_proc.h -sockaddr.o: sockaddr.c ../unix/sockaddr.c ../unix/networkio.h \ - $(INCDIR1)/apr_private.h $(INCDIR1)/apr_network_io.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h $(INCDIR1)/apr_lib.h \ - $(INCDIR1)/apr_thread_proc.h -sockets.o: sockets.c networkio.h $(INCDIR1)/apr_network_io.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h os2calls.h $(INCDIR1)/apr_portable.h \ - $(INCDIR1)/apr_thread_proc.h $(INCDIR1)/apr_lock.h \ - $(INCDIR1)/apr_lib.h -sockopt.o: sockopt.c networkio.h $(INCDIR1)/apr_network_io.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h os2calls.h $(INCDIR1)/apr_lib.h \ - $(INCDIR1)/apr_thread_proc.h +os2calls.o: os2calls.c $(OSDIR)/networkio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(OSDIR)/os2calls.h $(OSDIR)/os2nerrno.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_tables.h +poll.o: poll.c $(OSDIR)/networkio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(OSDIR)/os2calls.h $(OSDIR)/os2nerrno.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_tables.h +sendrecv.o: sendrecv.c $(OSDIR)/networkio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(OSDIR)/os2calls.h $(OSDIR)/os2nerrno.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h +sockaddr.o: sockaddr.c ../unix/sockaddr.c \ + $(OSDIR)/networkio.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/../network_io/os2/os2nerrno.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(OSDIR)/os2calls.h $(OSDIR)/os2nerrno.h \ + $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_tables.h ../unix/sa_common.c +sockets.o: sockets.c $(OSDIR)/networkio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(OSDIR)/os2calls.h $(OSDIR)/os2nerrno.h \ + $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_tables.h os2calls.h os2nerrno.h +sockopt.o: sockopt.c $(OSDIR)/networkio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(OSDIR)/os2calls.h $(OSDIR)/os2nerrno.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ + $(INCDIR)/apr_strings.h diff --git a/network_io/unix/Makefile.in b/network_io/unix/Makefile.in index e0d89a3f05d..b2f1b7d4010 100644 --- a/network_io/unix/Makefile.in +++ b/network_io/unix/Makefile.in @@ -10,7 +10,9 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) LIB=libnetwork.a @@ -46,46 +48,48 @@ depend: cp Makefile.in Makefile.in.bak \ && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ + -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ + -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ > Makefile.in \ && rm Makefile.new # DO NOT REMOVE inet_aton.o: inet_aton.c $(INCDIR)/apr_private.h -poll.o: poll.c networkio.h $(INCDIR)/apr.h \ +poll.o: poll.c $(OSDIR)/networkio.h $(INCDIR)/apr.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/arch/unix/fileio.h -sendrecv.o: sendrecv.c networkio.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/arch/unix/fileio.h -sockaddr.o: sockaddr.c networkio.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_strings.h -sockets.o: sockets.c networkio.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_dso.h -sockopt.o: sockopt.c networkio.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_strings.h + $(OSDIR)/fileio.h +sa_common.o: sa_common.c $(INCDIR)/apr.h +sendrecv.o: sendrecv.c $(OSDIR)/networkio.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_tables.h +sockaddr.o: sockaddr.c $(OSDIR)/networkio.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h sa_common.c +sockets.o: sockets.c $(OSDIR)/networkio.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h +sockopt.o: sockopt.c $(OSDIR)/networkio.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h diff --git a/network_io/unix/networkio.h b/network_io/unix/networkio.h deleted file mode 100644 index 3fdc52e2ac3..00000000000 --- a/network_io/unix/networkio.h +++ /dev/null @@ -1,154 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#ifndef NETWORK_IO_H -#define NETWORK_IO_H - -#include "apr.h" -#include "apr_private.h" -#include "apr_network_io.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" - -/* System headers the network I/O library needs */ -#if APR_HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if APR_HAVE_SYS_UIO_H -#include <sys/uio.h> -#endif -#if HAVE_SYS_POLL_H -#include <sys/poll.h> -#endif -#if HAVE_POLL_H -#include <poll.h> -#endif -#if APR_HAVE_ERRNO_H -#include <errno.h> -#endif -#if HAVE_SYS_TIME_H -#include <sys/time.h> -#endif -#if HAVE_UNISTD_H -#include <unistd.h> -#endif -#if HAVE_STRING_H -#include <string.h> -#endif -#if HAVE_NETINET_TCP_H -#include <netinet/tcp.h> -#endif -#if HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#if HAVE_ARPA_INET_H -#include <arpa/inet.h> -#endif -#if HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -#if HAVE_NETDB_H -#include <netdb.h> -#endif -#if APR_HAVE_FCNTL_H -#include <fcntl.h> -#endif -#if HAVE_SYS_SENDFILE_H -#include <sys/sendfile.h> -#endif -/* End System Headers */ - -#ifndef HAVE_POLLIN -#define POLLIN 1 -#define POLLPRI 2 -#define POLLOUT 4 -#define POLLERR 8 -#define POLLHUP 16 -#define POLLNVAL 32 -#endif - -struct apr_socket_t { - apr_pool_t *cntxt; - int socketdes; - struct sockaddr_in *local_addr; - struct sockaddr_in *remote_addr; - apr_socklen_t addr_len; - apr_interval_time_t timeout; -#ifndef HAVE_POLL - int connected; -#endif - int local_port_unknown; - int local_interface_unknown; -}; - -struct apr_pollfd_t { - apr_pool_t *cntxt; -#ifdef HAVE_POLL - struct pollfd *pollset; - int num; - int curpos; -#else - fd_set *read; - fd_set *write; - fd_set *except; - int highsock; -#endif - apr_int16_t *events; - apr_int16_t *revents; - -}; - -#endif /* ! NETWORK_IO_H */ - diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index 72ea622e1ff..6436cc1e265 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -53,7 +53,7 @@ */ #include "networkio.h" -#include "unix/fileio.h" +#include "fileio.h" #ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 4c51f98e677..0297018bdf5 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -56,7 +56,7 @@ #if APR_HAS_SENDFILE /* This file is needed to allow us access to the apr_file_t internals. */ -#include "unix/fileio.h" +#include "fileio.h" /* Glibc2.1.1 fails to define TCP_CORK. This is a bug that will be *fixed in the next release. It should be 3 diff --git a/shmem/os2/Makefile.in b/shmem/os2/Makefile.in index 8e597864a78..159f5a5bb88 100644 --- a/shmem/os2/Makefile.in +++ b/shmem/os2/Makefile.in @@ -9,7 +9,9 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) LIB=shmem.a @@ -41,15 +43,16 @@ depend: cp Makefile.in Makefile.in.bak \ && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ && gcc -MM $(INCLUDES) $(CFLAGS) *.c | sed -e "s%\\\\\(.\)%/\\1%g" >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(INCDIR1)/: $$(INCDIR1)/:g' \ - -e '1,$$s: $(INCDIR2)/: $$(INCDIR2)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ + -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ + -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ > Makefile.in \ && rm Makefile.new # DO NOT REMOVE -shmem.o: shmem.c $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_shmem.h \ - $(INCDIR1)/apr_lib.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_time.h $(INCDIR1)/apr_thread_proc.h +shmem.o: shmem.c $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ + $(INCDIR)/apr_shmem.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h diff --git a/threadproc/os2/Makefile.in b/threadproc/os2/Makefile.in index 70c04dcce83..cff74deb899 100644 --- a/threadproc/os2/Makefile.in +++ b/threadproc/os2/Makefile.in @@ -8,8 +8,10 @@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR1=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +INCDIR=../../include +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) LIB=threadproc.a @@ -44,34 +46,48 @@ depend: cp Makefile.in Makefile.in.bak \ && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ && gcc -MM $(INCLUDES) $(CFLAGS) *.c | sed -e "s%\\\\\(.\)%/\\1%g" >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(INCDIR1)/: $$(INCDIR1)/:g' \ - -e '1,$$s: $(INCDIR2)/: $$(INCDIR2)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ + -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ + -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ > Makefile.in \ && rm Makefile.new # DO NOT REMOVE -proc.o: proc.c threadproc.h $(INCDIR1)/apr_thread_proc.h \ - $(INCDIR1)/apr_file_io.h $(INCDIR1)/apr_general.h \ - $(INCDIR1)/apr.h $(INCDIR1)/apr_errno.h \ - $(INCDIR1)/apr_time.h $(INCDIR2)/fileio.h \ - $(INCDIR1)/apr_private.h $(INCDIR1)/apr_lib.h \ - $(INCDIR1)/apr_portable.h $(INCDIR1)/apr_network_io.h \ - $(INCDIR1)/apr_lock.h -signals.o: signals.c threadproc.h $(INCDIR1)/apr_thread_proc.h \ - $(INCDIR1)/apr_file_io.h $(INCDIR1)/apr_general.h \ - $(INCDIR1)/apr.h $(INCDIR1)/apr_errno.h \ - $(INCDIR1)/apr_time.h $(INCDIR2)/fileio.h \ - $(INCDIR1)/apr_private.h -thread.o: thread.c threadproc.h $(INCDIR1)/apr_thread_proc.h \ - $(INCDIR1)/apr_file_io.h $(INCDIR1)/apr_general.h \ - $(INCDIR1)/apr.h $(INCDIR1)/apr_errno.h \ - $(INCDIR1)/apr_time.h $(INCDIR1)/apr_lib.h \ - $(INCDIR2)/fileio.h $(INCDIR1)/apr_private.h -threadpriv.o: threadpriv.c threadproc.h \ - $(INCDIR1)/apr_thread_proc.h $(INCDIR1)/apr_file_io.h \ - $(INCDIR1)/apr_general.h $(INCDIR1)/apr.h \ - $(INCDIR1)/apr_errno.h $(INCDIR1)/apr_time.h \ - $(INCDIR1)/apr_lib.h $(INCDIR2)/fileio.h \ - $(INCDIR1)/apr_private.h +proc.o: proc.c $(OSDIR)/threadproc.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ + $(INCDIR)/apr_time.h $(OSDIR)/fileio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_lock.h \ + $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_tables.h $(INCDIR)/apr_portable.h \ + $(INCDIR)/apr_network_io.h $(INCDIR)/apr_dso.h \ + $(INCDIR)/apr_strings.h +signals.o: signals.c $(OSDIR)/threadproc.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ + $(INCDIR)/apr_time.h $(OSDIR)/fileio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_lock.h +thread.o: thread.c $(OSDIR)/threadproc.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h \ + $(OSDIR)/fileio.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_lock.h +threadcancel.o: threadcancel.c $(OSDIR)/threadproc.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ + $(INCDIR)/apr_time.h $(OSDIR)/fileio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_lock.h +threadpriv.o: threadpriv.c $(OSDIR)/threadproc.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ + $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ + $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h \ + $(OSDIR)/fileio.h $(INCDIR)/apr_private.h \ + $(INCDIR)/apr_lock.h diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 68e29fab7dd..4a88675ccfb 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -55,8 +55,8 @@ #define INCL_DOS #define INCL_DOSERRORS -#include "os2/threadproc.h" -#include "os2/fileio.h" +#include "threadproc.h" +#include "fileio.h" #include "apr_private.h" #include "apr_thread_proc.h" #include "apr_file_io.h" diff --git a/threadproc/os2/signals.c b/threadproc/os2/signals.c index 732bd73e842..6efd71d1822 100644 --- a/threadproc/os2/signals.c +++ b/threadproc/os2/signals.c @@ -53,8 +53,8 @@ */ #define INCL_DOSEXCEPTIONS -#include "os2/threadproc.h" -#include "os2/fileio.h" +#include "threadproc.h" +#include "fileio.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_general.h" diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 5e60b817d7d..3879f6d8012 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -54,7 +54,7 @@ #define INCL_DOSERRORS #define INCL_DOS -#include "os2/threadproc.h" +#include "threadproc.h" #include "apr_thread_proc.h" #include "apr_general.h" #include "apr_lib.h" diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index f038af494e1..15143e512a4 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -52,12 +52,12 @@ * <http://www.apache.org/>. */ -#include "os2/threadproc.h" +#include "threadproc.h" #include "apr_thread_proc.h" #include "apr_general.h" #include "apr_errno.h" #include "apr_lib.h" -#include "os2/fileio.h" +#include "fileio.h" apr_status_t apr_create_thread_private(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) From 4bc56c0a5c45277ec4a56b64f15e472c654555a6 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Tue, 14 Nov 2000 13:33:03 +0000 Subject: [PATCH 0743/7878] Rename common.c, there can only be one or they collide when copied into the objs directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60721 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/Makefile.in | 16 ++++++++-------- file_io/os2/{common.c => fileacc.c} | 0 2 files changed, 8 insertions(+), 8 deletions(-) rename file_io/os2/{common.c => fileacc.c} (100%) diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index 2b19e3a6697..d1bb47d5c55 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -16,7 +16,7 @@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) LIB=file.a OBJS=dir.o \ - common.o \ + fileacc.o \ filedup.o \ filestat.o \ open.o \ @@ -58,13 +58,6 @@ depend: && rm Makefile.new # DO NOT REMOVE -common.o: common.c ../unix/fileacc.c $(INCDIR)/apr_strings.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(OSDIR)/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_lock.h dir.o: dir.c $(OSDIR)/fileio.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ @@ -73,6 +66,13 @@ dir.o: dir.c $(OSDIR)/fileio.h \ $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ $(INCDIR)/apr_strings.h +fileacc.o: fileacc.c ../unix/fileacc.c $(INCDIR)/apr_strings.h \ + $(INCDIR)/apr.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ + $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ + $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_time.h \ + $(INCDIR)/apr_tables.h $(OSDIR)/fileio.h \ + $(INCDIR)/apr_private.h $(INCDIR)/apr_lock.h filedup.o: filedup.c $(OSDIR)/fileio.h \ $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ diff --git a/file_io/os2/common.c b/file_io/os2/fileacc.c similarity index 100% rename from file_io/os2/common.c rename to file_io/os2/fileacc.c From f4029f3d4d679690afa6938b2999cca786c15edd Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Tue, 14 Nov 2000 13:41:23 +0000 Subject: [PATCH 0744/7878] Add apr_get_pipe_timeout() for OS/2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60722 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/pipe.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 87421bd8a89..2098519cca1 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -169,3 +169,14 @@ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeo } return APR_EINVAL; } + + + +apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) +{ + if (thepipe->pipe == 1) { + *timeout = thepipe->timeout; + return APR_SUCCESS; + } + return APR_EINVAL; +} From 569c952eaed24eccb38d8a0b40f66c34adf4f0d4 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Tue, 14 Nov 2000 13:52:33 +0000 Subject: [PATCH 0745/7878] OS/2: return APR_EOF from apr_read() when there's no more data. This matches the unix implementation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60723 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sendrecv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index 1d5ac7c3b2a..e21c7c2536c 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -132,7 +132,7 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) } (*len) = rv; - return APR_SUCCESS; + return rv == 0 ? APR_EOF : APR_SUCCESS; } From a1e35d5020205ed7366deab402221e710973cbea Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Tue, 14 Nov 2000 14:08:38 +0000 Subject: [PATCH 0746/7878] OS/2: soclose() segfaults if passed -1 so prevent this from happening if a closed socket is closed (was happening before BUFF was removed). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60724 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index b5054e5c93e..58eb7d9ead1 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -69,6 +69,11 @@ static apr_status_t socket_cleanup(void *sock) { apr_socket_t *thesocket = sock; + + if (thesocket->socketdes < 0) { + return APR_EINVALSOCK; + } + if (soclose(thesocket->socketdes) == 0) { thesocket->socketdes = -1; return APR_SUCCESS; From c1f5e0a57f652430cfa3e9152a5243fceb520559 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Tue, 14 Nov 2000 14:31:40 +0000 Subject: [PATCH 0747/7878] OS/2: Convert apr_get_remote_hostname() to apr_get_hostname(), supporting both remote & local query. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60725 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockopt.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 1bba7003065..6743aea75cd 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -148,12 +148,20 @@ apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) -apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) +apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t *sock) { struct hostent *hptr; + apr_in_addr_t sa_ptr; + + if (which == APR_LOCAL) + sa_ptr = sock->local_addr->sin_addr; + else if (which == APR_REMOTE) + sa_ptr = sock->remote_addr->sin_addr; + else + return APR_EINVAL; + + hptr = gethostbyaddr((char *)&sa_ptr, sizeof(struct in_addr), AF_INET); - hptr = gethostbyaddr((char *)&(sock->remote_addr->sin_addr), - sizeof(struct in_addr), AF_INET); if (hptr != NULL) { *name = apr_pstrdup(sock->cntxt, hptr->h_name); if (*name) { @@ -165,5 +173,3 @@ apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) /* XXX - Is this threadsafe? */ return h_errno; } - - From b388a463cf804d077c73f4a4f3799cc8f3d72848 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 14 Nov 2000 19:32:26 +0000 Subject: [PATCH 0748/7878] Give up after certain errors. Otherwise, there is conflicting information about whether or not the test succeeded. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60726 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/testsf.c b/test/testsf.c index 0458a59a345..77fb8020abd 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -423,12 +423,14 @@ static int client(client_socket_mode_t socket_mode) fprintf(stderr, "client problem: sent %ld of %ld bytes\n", (long)total_bytes_sent, (long)expected_len); + exit(1); } if (rv) { fprintf(stderr, "client problem: rv %d\n", rv); + exit(1); } } From b00efc68fcf1c5afe6a17813ac172f5066b01d6c Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 15 Nov 2000 11:50:11 +0000 Subject: [PATCH 0749/7878] This patch removes the dependencies from Makefile.in. Dependencies will not be checked into CVS, as they are added to Makefile when the user runs "make depend." The exact mechanism for building dependencies is moved to a script called mkdep.sh in the APR helpers directory. Folks are free to make the mechanism more general (i.e., work on systems without gcc -MM), but for now it still requires gcc -MM. The patch also removes some commented out variable definitions and rules. BeOS- and OS/2-specific makefiles have not been updated. I'll post a patch to those or go ahead and commit them later, but David and Brian will get to test them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60727 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os390/Makefile.in | 36 +++-------------- dso/unix/Makefile.in | 24 +---------- file_io/unix/Makefile.in | 68 +------------------------------ i18n/unix/Makefile.in | 26 +----------- lib/Makefile.in | 39 +----------------- locks/unix/Makefile.in | 49 +---------------------- misc/unix/Makefile.in | 79 +------------------------------------ mmap/unix/Makefile.in | 39 +----------------- network_io/unix/Makefile.in | 64 +----------------------------- passwd/Makefile.in | 37 +---------------- shmem/unix/Makefile.in | 22 +---------- strings/Makefile.in | 53 +------------------------ tables/Makefile.in | 34 +--------------- test/Makefile.in | 73 +--------------------------------- threadproc/unix/Makefile.in | 60 +--------------------------- time/unix/Makefile.in | 43 +------------------- user/unix/Makefile.in | 24 +---------- 17 files changed, 37 insertions(+), 733 deletions(-) diff --git a/dso/os390/Makefile.in b/dso/os390/Makefile.in index c5df58c36a9..134195b6847 100644 --- a/dso/os390/Makefile.in +++ b/dso/os390/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - RM=@RM@ CC=@CC@ RANLIB=@RANLIB@ @@ -11,6 +6,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +MKDEP=../../helpers/mkdep.sh LIB=libdso.a @@ -24,37 +20,15 @@ all: $(LIB) clean: $(RM) -f *.o *.a *.so -distclean: clean - -$(RM) -f Makefile - - $(LIB): $(OBJS) $(RM) -f $@ $(AR) cr $@ $(OBJS) $(RANLIB) $@ -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# +distclean: clean + -$(RM) -f Makefile + depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -getopt.o: getopt.c misc.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_file_io.h \ - ../../include/apr_getopt.h -start.o: start.c misc.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_file_io.h \ - ../../include/apr_getopt.h diff --git a/dso/unix/Makefile.in b/dso/unix/Makefile.in index 51ba228157f..e4f0e1a9078 100644 --- a/dso/unix/Makefile.in +++ b/dso/unix/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - RM=@RM@ CC=@CC@ AR=@AR@ @@ -12,6 +7,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +MKDEP=../../helpers/mkdep.sh LIB=libdso.a @@ -34,23 +30,7 @@ $(LIB): $(OBJS) $(AR) cr $@ $(OBJS) $(RANLIB) $@ -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -dso.o: dso.c $(INCDIR)/arch/unix/dso.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_dso.h diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index 282ff7e4f77..05254e3501e 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - RM=@RM@ CC=@CC@ RANLIB=@RANLIB@ @@ -13,8 +8,7 @@ INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) - -#LIB=libfile.a +MKDEP=../../helpers/mkdep.sh OBJS=dir.o \ fileacc.o \ @@ -37,65 +31,7 @@ clean: distclean: clean -$(RM) -f Makefile - -#$(LIB): $(OBJS) -# $(RM) -f $@ -# $(AR) cr $@ $(OBJS) -# $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -dir.o: dir.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h -fileacc.o: fileacc.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h -filedup.o: filedup.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h -filestat.o: filestat.c $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h -fullrw.o: fullrw.c $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h -open.o: open.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h -pipe.o: pipe.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h -readwrite.o: readwrite.c $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h -seek.o: seek.c diff --git a/i18n/unix/Makefile.in b/i18n/unix/Makefile.in index 121691e8ccb..9d99037c8eb 100644 --- a/i18n/unix/Makefile.in +++ b/i18n/unix/Makefile.in @@ -1,4 +1,3 @@ - RM=@RM@ CC=@CC@ RANLIB=@RANLIB@ @@ -7,6 +6,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +MKDEP=../../helpers/mkdep.sh OBJS=xlate.o @@ -21,29 +21,7 @@ clean: distclean: clean -$(RM) -f Makefile - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -utf8_ucs2.o: utf8_ucs2.c $(INCDIR)/arch/unix/i18n.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_xlate.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h -xlate.o: xlate.c $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_strings.h $(INCDIR)/apr_xlate.h diff --git a/lib/Makefile.in b/lib/Makefile.in index b98d7497aeb..182d8f699da 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - CC=@CC@ RANLIB=@RANLIB@ AR=@AR@ @@ -12,8 +7,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch/@OSDIR@ - -#LIB=@LIBPREFIX@apr.a +MKDEP=../helpers/mkdep.sh OBJS=apr_pools.o @@ -28,36 +22,7 @@ clean: distclean: clean -$(RM) -f Makefile - -#$(LIB): $(OBJS) -# $(RM) -f $@ -# $(AR) cr $@ $(OBJS) -# $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -apr_pools.o: apr_pools.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_dso.h $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h -apr_signal.o: apr_signal.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index d1c31b25349..fb0c6d9c79f 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - RM=@RM@ CC=@CC@ RANLIB=@RANLIB@ @@ -11,8 +6,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch - -#LIB=liblock.a +MKDEP=../../helpers/mkdep.sh OBJS=locks.o \ crossproc.o \ @@ -29,46 +23,7 @@ clean: distclean: clean -$(RM) -f Makefile - -#$(LIB): $(OBJS) -# $(RM) -f $@ -# $(AR) cr $@ $(OBJS) -# $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -crossproc.o: crossproc.c $(INCDIR)/apr.h \ - $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/arch/unix/locks.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_lock.h -intraproc.o: intraproc.c $(INCDIR)/arch/unix/locks.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_lock.h -locks.o: locks.c $(INCDIR)/arch/unix/locks.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_strings.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_dso.h diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index 47be670f590..edcccfdf69c 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - RM=@RM@ CC=@CC@ RANLIB=@RANLIB@ @@ -13,8 +8,7 @@ INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) - -#LIB=libmisc.a +MKDEP=../../helpers/mkdep.sh OBJS=start.o getopt.o otherchild.o errorcodes.o rand.o canonerr.o \ uuid.o getuuid.o @@ -30,76 +24,7 @@ clean: distclean: clean -$(RM) -f Makefile - -#$(LIB): $(OBJS) -# $(RM) -f $@ -# $(AR) cr $@ $(OBJS) -# $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ - -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ - -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -canonerr.o: canonerr.c $(DEFOSDIR)/misc.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_getopt.h -errorcodes.o: errorcodes.c $(DEFOSDIR)/misc.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_getopt.h $(INCDIR)/apr_strings.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_dso.h -getopt.o: getopt.c $(DEFOSDIR)/misc.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_getopt.h -getuuid.o: getuuid.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_uuid.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_md5.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_xlate.h -otherchild.o: otherchild.c $(INCDIR)/apr.h \ - $(DEFOSDIR)/misc.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_getopt.h $(OSDIR)/threadproc.h \ - $(OSDIR)/fileio.h $(INCDIR)/apr_lock.h -rand.o: rand.c $(DEFOSDIR)/misc.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_getopt.h -start.o: start.c $(DEFOSDIR)/misc.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_getopt.h \ - $(OSDIR)/locks.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_tables.h -uuid.o: uuid.c $(INCDIR)/apr.h $(INCDIR)/apr_uuid.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h diff --git a/mmap/unix/Makefile.in b/mmap/unix/Makefile.in index 577d5da3627..5ac7b6b27eb 100644 --- a/mmap/unix/Makefile.in +++ b/mmap/unix/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - RM=@RM@ CC=@CC@ RANLIB=@RANLIB@ @@ -11,6 +6,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +MKDEP=../../helpers/mkdep.sh LIB=libmmap.a @@ -27,38 +23,7 @@ clean: distclean: clean -$(RM) -f Makefile - -#$(LIB): $(OBJS) -# $(RM) -f $@ -# $(AR) cr $@ $(OBJS) -# $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -common.o: common.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_mmap.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h -mmap.o: mmap.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_mmap.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ - $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h diff --git a/network_io/unix/Makefile.in b/network_io/unix/Makefile.in index b2f1b7d4010..3e0a4b21ca2 100644 --- a/network_io/unix/Makefile.in +++ b/network_io/unix/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - RM=@RM@ CC=@CC@ RANLIB=@RANLIB@ @@ -13,6 +8,7 @@ INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) +MKDEP=../../helpers/mkdep.sh LIB=libnetwork.a @@ -33,63 +29,7 @@ clean: distclean: clean -$(RM) -f Makefile - -#$(LIB): $(OBJS) -# $(RM) -f $@ -# $(AR) cr $@ $(OBJS) -# $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ - -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ - -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -inet_aton.o: inet_aton.c $(INCDIR)/apr_private.h -poll.o: poll.c $(OSDIR)/networkio.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ - $(OSDIR)/fileio.h -sa_common.o: sa_common.c $(INCDIR)/apr.h -sendrecv.o: sendrecv.c $(OSDIR)/networkio.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h -sockaddr.o: sockaddr.c $(OSDIR)/networkio.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h sa_common.c -sockets.o: sockets.c $(OSDIR)/networkio.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h -sockopt.o: sockopt.c $(OSDIR)/networkio.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h diff --git a/passwd/Makefile.in b/passwd/Makefile.in index a6b7bcbcd6b..fccf3f31604 100644 --- a/passwd/Makefile.in +++ b/passwd/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - CC=@CC@ RANLIB=@RANLIB@ AR=@AR@ @@ -12,8 +7,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include INCLUDES=-I$(INCDIR) - -#LIB=@LIBPREFIX@apr.a +MKDEP=../helpers/mkdep.sh OBJS=apr_md5.o \ apr_getpass.o @@ -29,34 +23,7 @@ clean: distclean: clean -$(RM) -f Makefile - -#$(LIB): $(OBJS) -# $(RM) -f $@ -# $(AR) cr $@ $(OBJS) -# $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -apr_getpass.o: apr_getpass.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_strings.h $(INCDIR)/apr.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h -apr_md5.o: apr_md5.c $(INCDIR)/apr_private.h $(INCDIR)/apr_strings.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_md5.h $(INCDIR)/apr_xlate.h diff --git a/shmem/unix/Makefile.in b/shmem/unix/Makefile.in index ab16d973687..18c95cd9668 100644 --- a/shmem/unix/Makefile.in +++ b/shmem/unix/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - RM=@RM@ CC=@CC@ AR=@AR@ @@ -13,6 +8,7 @@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include INCDIR1=mm INCLUDES=-I$(INCDIR) -I$(INCDIR1) +MKDEP=../../helpers/mkdep.sh LIB=libshmem.a @@ -39,21 +35,7 @@ $(LIB): $(OBJS) $(AR) cr $@ $(OBJS) $(RANLIB) $@ -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -shmem.o: shmem.c mm/mm.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_shmem.h diff --git a/strings/Makefile.in b/strings/Makefile.in index 43049e6006b..1871bb83f79 100644 --- a/strings/Makefile.in +++ b/strings/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - CC=@CC@ RANLIB=@RANLIB@ AR=@AR@ @@ -12,8 +7,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include INCLUDES=-I$(INCDIR) - -#LIB=@LIBPREFIX@apr.a +MKDEP=../helpers/mkdep.sh OBJS=apr_cpystrn.o \ apr_snprintf.o \ @@ -32,50 +26,7 @@ clean: distclean: clean -$(RM) -f Makefile - -#$(LIB): $(OBJS) -# $(RM) -f $@ -# $(AR) cr $@ $(OBJS) -# $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -apr_cpystrn.o: apr_cpystrn.c $(INCDIR)/apr.h $(INCDIR)/apr_strings.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_private.h -apr_fnmatch.o: apr_fnmatch.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_fnmatch.h $(INCDIR)/apr_errno.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h -apr_snprintf.o: apr_snprintf.c $(INCDIR)/apr.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h -apr_strings.o: apr_strings.c $(INCDIR)/apr.h $(INCDIR)/apr_strings.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_private.h -apr_strnatcmp.o: apr_strnatcmp.c $(INCDIR)/apr_strings.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h diff --git a/tables/Makefile.in b/tables/Makefile.in index a865a8ded13..f09cf74f0e0 100644 --- a/tables/Makefile.in +++ b/tables/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - CC=@CC@ RANLIB=@RANLIB@ AR=@AR@ @@ -12,6 +7,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +MKDEP=../helpers/mkdep.sh OBJS=apr_tables.o \ apr_hash.o @@ -27,33 +23,7 @@ clean: distclean: clean -$(RM) -f Makefile - -#$(LIB): $(OBJS) -# $(RM) -f $@ -# $(AR) cr $@ $(OBJS) -# $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -apr_hash.o: apr_hash.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h $(INCDIR)/apr_hash.h -apr_tables.o: apr_tables.c $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h diff --git a/test/Makefile.in b/test/Makefile.in index cd75cd83de0..0211b71cd58 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,9 +1,3 @@ -# Generated automatically from Makefile.in by configure. -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - RM=@RM@ CC=@CC@ RANLIB=@RANLIB@ @@ -12,6 +6,7 @@ LIBS=../libapr.a @LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include INCLUDES=-I$(INCDIR) +MKDEP=../helpers/mkdep.sh TARGETS= testmd5@EXEEXT@ \ testfile@EXEEXT@ \ @@ -111,71 +106,7 @@ clean: distclean: clean -$(RM) -f Makefile - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -abc.o: abc.c $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h -client.o: client.c $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h -mod_test.o: mod_test.c -server.o: server.c $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h -testargs.o: testargs.c $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_getopt.h -testcontext.o: testcontext.c $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_thread_proc.h -testdso.o: testdso.c $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_pools.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_dso.h -testfile.o: testfile.c $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_thread_proc.h -testmmap.o: testmmap.c $(INCDIR)/apr_mmap.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_lib.h -testoc.o: testoc.c $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h -testpipe.o: testpipe.c $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_thread_proc.h -testproc.o: testproc.c $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h -testshmem.o: testshmem.c $(INCDIR)/apr_shmem.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_thread_proc.h -testsock.o: testsock.c $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h -testthread.o: testthread.c $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h $(INCDIR)/apr_lock.h -testtime.o: testtime.c $(INCDIR)/apr_time.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index a369ec65391..35c89a8d04d 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - RM=@RM@ CC=@CC@ RANLIB=@RANLIB@ @@ -11,6 +6,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +MKDEP=../../helpers/mkdep.sh LIB=libthreadproc.a @@ -31,64 +27,12 @@ clean: distclean: clean -$(RM) -f Makefile - -#$(LIB): $(OBJS) -# $(RM) -f $@ -# $(AR) cr $@ $(OBJS) -# $(RANLIB) $@ - # # We really don't expect end users to use this rule. It works only with # gcc, and rebuilds Makefile.in. You have to re-run configure after # using it. # depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -proc.o: proc.c $(INCDIR)/arch/unix/threadproc.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/arch/unix/fileio.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_strings.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h -procsup.o: procsup.c $(INCDIR)/arch/unix/threadproc.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/arch/unix/fileio.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h -signals.o: signals.c $(INCDIR)/arch/unix/threadproc.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/arch/unix/fileio.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h -thread.o: thread.c $(INCDIR)/apr.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ - $(INCDIR)/arch/unix/threadproc.h $(INCDIR)/apr_private.h \ - $(INCDIR)/arch/unix/fileio.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h -threadpriv.o: threadpriv.c $(INCDIR)/apr.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_dso.h $(INCDIR)/arch/unix/threadproc.h \ - $(INCDIR)/apr_private.h $(INCDIR)/arch/unix/fileio.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h diff --git a/time/unix/Makefile.in b/time/unix/Makefile.in index 1427daa6752..925a62840d0 100644 --- a/time/unix/Makefile.in +++ b/time/unix/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - RM=@RM@ CC=@CC@ RANLIB=@RANLIB@ @@ -11,8 +6,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include INCLUDES=-I$(INCDIR) - -#LIB=libtime.a +MKDEP=../../helpers/mkdep.sh OBJS=time.o \ timestr.o @@ -28,40 +22,7 @@ clean: distclean: clean -$(RM) -f Makefile - -#$(LIB): $(OBJS) -# $(RM) -f $@ -# $(AR) cr $@ $(OBJS) -# $(RANLIB) $@ - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -time.o: time.c $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_dso.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_private.h -timestr.o: timestr.c $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_dso.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_private.h diff --git a/user/unix/Makefile.in b/user/unix/Makefile.in index 93e223b8d5b..ebfdad4961b 100644 --- a/user/unix/Makefile.in +++ b/user/unix/Makefile.in @@ -1,4 +1,3 @@ - RM=@RM@ CC=@CC@ RANLIB=@RANLIB@ @@ -7,6 +6,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +MKDEP=../../helpers/mkdep.sh OBJS=homedir.o @@ -21,27 +21,7 @@ clean: distclean: clean -$(RM) -f Makefile - -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -homedir.o: homedir.c $(INCDIR)/apr_strings.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ - $(INCDIR)/apr_user.h $(INCDIR)/apr_private.h From b5052202e5eefbd18a2badec09753eb5f45088ae Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 15 Nov 2000 11:52:36 +0000 Subject: [PATCH 0750/7878] Fix an include path so that make depend works in this directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60728 13f79535-47bb-0310-9956-ffa450edef68 --- test/testucs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testucs.c b/test/testucs.c index bbd264f4d5d..f9c4fc6469f 100644 --- a/test/testucs.c +++ b/test/testucs.c @@ -1,5 +1,5 @@ #include "apr_xlate.h" -#include "../i18n/unix/i18n.h" +#include "../include/arch/unix/i18n.h" #include <wchar.h> #include <string.h> From b361f684c65c79b6a9c7a36b6df598ffe6b8979a Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 15 Nov 2000 12:01:18 +0000 Subject: [PATCH 0751/7878] This is the initial, gcc-only, script to build makefile dependencies. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60729 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/mkdep.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 helpers/mkdep.sh diff --git a/helpers/mkdep.sh b/helpers/mkdep.sh new file mode 100755 index 00000000000..d2a586797a9 --- /dev/null +++ b/helpers/mkdep.sh @@ -0,0 +1,5 @@ +#!/bin/sh +cp Makefile Makefile.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile > Makefile.new \ + && gcc -MM $* >> Makefile.new \ + && mv Makefile.new Makefile From 713dcee85619007c6dae17d25575c9651e57b793 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 15 Nov 2000 12:19:56 +0000 Subject: [PATCH 0752/7878] axe some old comments git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60730 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/Makefile.in | 5 ----- 1 file changed, 5 deletions(-) diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index 35c89a8d04d..7b157771dc7 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -27,11 +27,6 @@ clean: distclean: clean -$(RM) -f Makefile -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: $(MKDEP) $(INCLUDES) $(CFLAGS) *.c From afb0ea16d3ebf51d21363752da6c7d853106a987 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 15 Nov 2000 12:22:14 +0000 Subject: [PATCH 0753/7878] BeOS changes to the way dependencies are built in APR makefiles git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60731 13f79535-47bb-0310-9956-ffa450edef68 --- dso/beos/Makefile.in | 29 ++---------------- locks/beos/Makefile.in | 30 ++---------------- network_io/beos/Makefile.in | 61 ++----------------------------------- threadproc/beos/Makefile.in | 55 ++------------------------------- 4 files changed, 8 insertions(+), 167 deletions(-) diff --git a/dso/beos/Makefile.in b/dso/beos/Makefile.in index 61c195b8a42..f9a9b293e48 100644 --- a/dso/beos/Makefile.in +++ b/dso/beos/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - CC=@CC@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ @@ -10,6 +5,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +MKDEP=../../helpers/mkdep.sh LIB=libdso.a @@ -32,28 +28,7 @@ $(LIB): $(OBJS) $(AR) cr $@ $(OBJS) $(RANLIB) $@ -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -getopt.o: getopt.c misc.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_file_io.h \ - ../../include/apr_getopt.h -start.o: start.c misc.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_file_io.h \ - ../../include/apr_getopt.h diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in index 7f0905e761c..40afc8c6910 100644 --- a/locks/beos/Makefile.in +++ b/locks/beos/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - CC=@CC@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ @@ -10,6 +5,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +MKDEP=../../helpers/mkdep.sh LIB=liblock.a @@ -34,29 +30,7 @@ $(LIB): $(OBJS) $(AR) cr $@ $(OBJS) $(RANLIB) $@ -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -crossproc.o: crossproc.c ../../include/apr_lock.h \ - ../../include/apr_general.h ../../include/apr_private.h \ - ../../include/apr_errno.h ../../include/apr_lib.h \ - ../../include/apr_file_io.h locks.h -intraproc.o: intraproc.c ../../include/apr_lock.h \ - ../../include/apr_general.h ../../include/apr_private.h \ - ../../include/apr_errno.h locks.h ../../include/apr_file_io.h \ - ../../include/apr_lib.h -locks.o: locks.c ../../include/apr_lock.h ../../include/apr_general.h \ - ../../include/apr_private.h ../../include/apr_errno.h locks.h \ - ../../include/apr_file_io.h diff --git a/network_io/beos/Makefile.in b/network_io/beos/Makefile.in index 68a440a654a..164dbc3907d 100644 --- a/network_io/beos/Makefile.in +++ b/network_io/beos/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - CC=@CC@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ @@ -10,6 +5,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -I../../file_io/unix INCLUDES=-I$(INCDIR) -I. +MKDEP=../../helpers/mkdep.sh LIB=libnetwork.a @@ -37,60 +33,7 @@ $(LIB): $(OBJS) $(AR) cr $@ $(OBJS) $(RANLIB) $@ -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -inet_aton.o: inet_aton.c networkio.h ../../include/apr_network_io.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../include/apr_lib.h ../../file_io/unix/fileio.h \ - ../../include/apr_private.h -poll.o: poll.c networkio.h ../../include/apr_network_io.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../include/apr_lib.h ../../file_io/unix/fileio.h \ - ../../include/apr_private.h -sendrecv.o: sendrecv.c networkio.h ../../include/apr_network_io.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../include/apr_lib.h ../../file_io/unix/fileio.h \ - ../../include/apr_private.h -sockaddr.o: sockaddr.c networkio.h ../../include/apr_network_io.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../include/apr_lib.h ../../file_io/unix/fileio.h \ - ../../include/apr_private.h -sockets.o: sockets.c networkio.h ../../include/apr_network_io.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../include/apr_lib.h ../../file_io/unix/fileio.h \ - ../../include/apr_private.h -sockopt.o: sockopt.c networkio.h ../../include/apr_network_io.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_file_io.h \ - ../../include/apr_time.h ../../include/apr_portable.h \ - ../../include/apr_thread_proc.h ../../include/apr_lock.h \ - ../../include/apr_lib.h ../../file_io/unix/fileio.h \ - ../../include/apr_private.h diff --git a/threadproc/beos/Makefile.in b/threadproc/beos/Makefile.in index 6d5539818e2..5297c1337df 100644 --- a/threadproc/beos/Makefile.in +++ b/threadproc/beos/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - CC=@CC@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ @@ -10,6 +5,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +MKDEP=../../helpers/mkdep.sh LIB=libthreadproc.a @@ -40,54 +36,7 @@ $(LIB): $(OBJS) $(AR) cr $@ $(OBJS) $(RANLIB) $@ -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -apr_proc_stub.o: apr_proc_stub.c -proc.o: proc.c threadproc.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h ../../file_io/unix/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h -procsup.o: procsup.c threadproc.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h ../../file_io/unix/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h -signals.o: signals.c threadproc.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h ../../file_io/unix/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h -thread.o: thread.c threadproc.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/apr_time.h ../../file_io/unix/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_lock.h -threadpriv.o: threadpriv.c threadproc.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/apr_time.h \ - ../../file_io/unix/fileio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_lock.h From fa1ead5df9dfdb8a26bea740535734c1a8868524 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 15 Nov 2000 16:06:08 +0000 Subject: [PATCH 0754/7878] OS/2 changes to the way dependencies are built in APR makefiles git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60732 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os2/Makefile.in | 26 +----------- file_io/os2/Makefile.in | 87 +------------------------------------- locks/os2/Makefile.in | 28 +----------- network_io/os2/Makefile.in | 77 +-------------------------------- shmem/os2/Makefile.in | 26 +----------- threadproc/os2/Makefile.in | 58 +------------------------ 6 files changed, 12 insertions(+), 290 deletions(-) diff --git a/dso/os2/Makefile.in b/dso/os2/Makefile.in index 7f2c9ae8a81..ba2385b0ada 100644 --- a/dso/os2/Makefile.in +++ b/dso/os2/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - SHELL=@SH@ CC=@CC@ RANLIB=@RANLIB@ @@ -13,6 +8,7 @@ INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) +MKDEP=../../helpers/mkdep.sh LIB=libdso.a @@ -35,25 +31,7 @@ $(LIB): $(OBJS) $(AR) cr $@ $(OBJS) $(RANLIB) $@ -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c | sed -e "s%\\\\\(.\)%/\\1%g" >> Makefile.new \ - && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ - -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ - -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -dso.o: dso.c $(OSDIR)/dso.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_dso.h diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index d1bb47d5c55..0335a9cb5a5 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - CC=@CC@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ @@ -12,6 +7,7 @@ INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) +MKDEP=../../helpers/mkdep.sh LIB=file.a @@ -42,86 +38,7 @@ $(LIB): $(OBJS) $(AR) cr $@ $(OBJS) $(RANLIB) $@ -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c | sed -e "s%\\\\\(.\)%/\\1%g" >> Makefile.new \ - && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ - -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ - -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -dir.o: dir.c $(OSDIR)/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_strings.h -fileacc.o: fileacc.c ../unix/fileacc.c $(INCDIR)/apr_strings.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(OSDIR)/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_lock.h -filedup.o: filedup.c $(OSDIR)/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_strings.h -filestat.o: filestat.c $(OSDIR)/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h -maperrorcode.o: maperrorcode.c $(OSDIR)/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - ../../network_io/os2/os2calls.h ../../network_io/os2/os2nerrno.h -open.o: open.c $(OSDIR)/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_dso.h $(INCDIR)/apr_strings.h -pipe.o: pipe.c $(OSDIR)/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_strings.h -readwrite.o: readwrite.c $(OSDIR)/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h -seek.o: seek.c $(OSDIR)/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/../network_io/os2/os2nerrno.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h diff --git a/locks/os2/Makefile.in b/locks/os2/Makefile.in index df319b7494d..7ecd8cf8788 100644 --- a/locks/os2/Makefile.in +++ b/locks/os2/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - CC=@CC@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ @@ -12,6 +7,7 @@ INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) +MKDEP=../../helpers/mkdep.sh LIB=lock.a @@ -34,27 +30,7 @@ $(LIB): $(OBJS) $(AR) cr $@ $(OBJS) $(RANLIB) $@ -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c | sed -e "s%\\\\\(.\)%/\\1%g" >> Makefile.new \ - && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ - -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ - -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -locks.o: locks.c $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_strings.h $(OSDIR)/locks.h \ - $(INCDIR)/apr_lock.h $(OSDIR)/fileio.h \ - $(INCDIR)/apr_private.h diff --git a/network_io/os2/Makefile.in b/network_io/os2/Makefile.in index 25db3a305e4..48bace2b956 100644 --- a/network_io/os2/Makefile.in +++ b/network_io/os2/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - CC=@CC@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ @@ -12,6 +7,7 @@ INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) +MKDEP=../../helpers/mkdep.sh LIB=network.a @@ -39,76 +35,7 @@ $(LIB): $(OBJS) $(AR) cr $@ $(OBJS) $(RANLIB) $@ -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c | sed -e "s%\\\\\(.\)%/\\1%g" >> Makefile.new \ - && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ - -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ - -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -os2calls.o: os2calls.c $(OSDIR)/networkio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(OSDIR)/os2calls.h $(OSDIR)/os2nerrno.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_tables.h -poll.o: poll.c $(OSDIR)/networkio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(OSDIR)/os2calls.h $(OSDIR)/os2nerrno.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_tables.h -sendrecv.o: sendrecv.c $(OSDIR)/networkio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(OSDIR)/os2calls.h $(OSDIR)/os2nerrno.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h -sockaddr.o: sockaddr.c ../unix/sockaddr.c \ - $(OSDIR)/networkio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_general.h \ - $(INCDIR)/apr.h $(INCDIR)/apr_errno.h \ - $(INCDIR)/../network_io/os2/os2nerrno.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(OSDIR)/os2calls.h $(OSDIR)/os2nerrno.h \ - $(INCDIR)/apr_strings.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_tables.h ../unix/sa_common.c -sockets.o: sockets.c $(OSDIR)/networkio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(OSDIR)/os2calls.h $(OSDIR)/os2nerrno.h \ - $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_tables.h os2calls.h os2nerrno.h -sockopt.o: sockopt.c $(OSDIR)/networkio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_network_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(OSDIR)/os2calls.h $(OSDIR)/os2nerrno.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_tables.h \ - $(INCDIR)/apr_strings.h diff --git a/shmem/os2/Makefile.in b/shmem/os2/Makefile.in index 159f5a5bb88..06e2dfdeea6 100644 --- a/shmem/os2/Makefile.in +++ b/shmem/os2/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - CC=@CC@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ @@ -12,6 +7,7 @@ INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) +MKDEP=../../helpers/mkdep.sh LIB=shmem.a @@ -34,25 +30,7 @@ $(LIB): $(OBJS) $(AR) cr $@ $(OBJS) $(RANLIB) $@ -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c | sed -e "s%\\\\\(.\)%/\\1%g" >> Makefile.new \ - && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ - -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ - -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -shmem.o: shmem.c $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ - $(INCDIR)/apr_shmem.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_thread_proc.h \ - $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_strings.h diff --git a/threadproc/os2/Makefile.in b/threadproc/os2/Makefile.in index cff74deb899..fc07cacd4a8 100644 --- a/threadproc/os2/Makefile.in +++ b/threadproc/os2/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - CC=@CC@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ @@ -12,6 +7,7 @@ INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) +MKDEP=../../helpers/mkdep.sh LIB=threadproc.a @@ -37,57 +33,7 @@ $(LIB): $(OBJS) $(AR) cr $@ $(OBJS) $(RANLIB) $@ -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c | sed -e "s%\\\\\(.\)%/\\1%g" >> Makefile.new \ - && sed -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' \ - -e '1,$$s: $(DEFOSDIR)/: $$(DEFOSDIR)/:g' \ - -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -proc.o: proc.c $(OSDIR)/threadproc.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ - $(INCDIR)/apr_time.h $(OSDIR)/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_lock.h \ - $(INCDIR)/apr_lib.h $(INCDIR)/apr_pools.h \ - $(INCDIR)/apr_tables.h $(INCDIR)/apr_portable.h \ - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_dso.h \ - $(INCDIR)/apr_strings.h -signals.o: signals.c $(OSDIR)/threadproc.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ - $(INCDIR)/apr_time.h $(OSDIR)/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_lock.h -thread.o: thread.c $(OSDIR)/threadproc.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h \ - $(OSDIR)/fileio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_lock.h -threadcancel.o: threadcancel.c $(OSDIR)/threadproc.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ - $(INCDIR)/apr_time.h $(OSDIR)/fileio.h \ - $(INCDIR)/apr_private.h $(INCDIR)/apr_lock.h -threadpriv.o: threadpriv.c $(OSDIR)/threadproc.h \ - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_file_io.h \ - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \ - $(INCDIR)/apr_errno.h $(INCDIR)/../network_io/os2/os2nerrno.h \ - $(INCDIR)/apr_time.h $(INCDIR)/apr_lib.h \ - $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h \ - $(OSDIR)/fileio.h $(INCDIR)/apr_private.h \ - $(INCDIR)/apr_lock.h From 07db39a167f072351745050ee1d9463cdd897301 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 15 Nov 2000 17:47:37 +0000 Subject: [PATCH 0755/7878] AIX changes to the way dependencies are built in APR makefiles (this makefile isn't currently used; I suspect that this AIX-specific DSO code is needed only for old levels of AIX) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60733 13f79535-47bb-0310-9956-ffa450edef68 --- dso/aix/Makefile.in | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/dso/aix/Makefile.in b/dso/aix/Makefile.in index c5df58c36a9..22ac4f1f8c9 100644 --- a/dso/aix/Makefile.in +++ b/dso/aix/Makefile.in @@ -1,8 +1,3 @@ -#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -#LIBS=$(EXTRA_LIBS) $(LIBS1) -#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) -#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) - RM=@RM@ CC=@CC@ RANLIB=@RANLIB@ @@ -11,6 +6,7 @@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +MKDEP=../../helpers/mkdep.sh LIB=libdso.a @@ -33,28 +29,7 @@ $(LIB): $(OBJS) $(AR) cr $@ $(OBJS) $(RANLIB) $@ -# -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.in. You have to re-run configure after -# using it. -# depend: - cp Makefile.in Makefile.in.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ - -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ - > Makefile.in \ - && rm Makefile.new + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE -getopt.o: getopt.c misc.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_file_io.h \ - ../../include/apr_getopt.h -start.o: start.c misc.h ../../include/apr_private.h \ - ../../include/apr_general.h ../../include/apr.h \ - ../../include/apr_errno.h ../../include/apr_pools.h \ - ../../include/apr_lib.h ../../include/apr_file_io.h \ - ../../include/apr_getopt.h From 7738adb80f58c105cdd146d9242ce369c8ce5fdf Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 15 Nov 2000 18:11:34 +0000 Subject: [PATCH 0756/7878] add a warning about the use of inet_network() when inet_addr() isn't available; fix a typo (I don't think that spelling is valid even in the UK :) ) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60734 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 4d0ede11679..ea9d14a8e80 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -126,6 +126,8 @@ typedef enum { #if APR_HAVE_INET_ADDR #define apr_inet_addr inet_addr #elif APR_HAVE_INET_NETWORK /* only DGUX, as far as I know */ +/* not generally safe... inet_network() and inet_addr() perform + * different functions */ #define apr_inet_addr inet_network #endif @@ -138,7 +140,7 @@ typedef struct in_addr apr_in_addr_t; typedef apr_uint16_t apr_port_t; /* we're going to roll our own sockaddr type as we want to make sure - * we have protocol independance for APR... + * we have protocol independence for APR... * * It's defined here as I think it should all be platform safe... */ From 3aaaf432e52e145e64b00b2393daee7324f8645e Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 15 Nov 2000 20:00:37 +0000 Subject: [PATCH 0757/7878] *) no reason to leave Makefile.bak turds since Makefile is a generated file (from Makefile.in) *) add some comments about what is happening git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60735 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/mkdep.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/helpers/mkdep.sh b/helpers/mkdep.sh index d2a586797a9..1e18518a447 100755 --- a/helpers/mkdep.sh +++ b/helpers/mkdep.sh @@ -1,5 +1,12 @@ #!/bin/sh -cp Makefile Makefile.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile > Makefile.new \ +# +# 1) remove everything after the DO NOT REMOVE +# 2) generate the dependencies, adding them to the end of Makefile.new +# 3) move the Makefile.new back into place +# +# Note that we use && to ensure that Makefile is not changed if an error +# occurs during the process +# +sed -ne '1,/^# DO NOT REMOVE/p' Makefile > Makefile.new \ && gcc -MM $* >> Makefile.new \ && mv Makefile.new Makefile From 8dfa63c5220c948644bae826352d64fb82a9ccc3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Wed, 15 Nov 2000 21:46:38 +0000 Subject: [PATCH 0758/7878] Clean up a lot of warnings in the test directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60736 13f79535-47bb-0310-9956-ffa450edef68 --- test/mod_test.c | 4 ++-- test/occhild.c | 2 +- test/testcontext.c | 4 ++-- test/testdso.c | 1 + test/testfile.c | 2 +- test/testmmap.c | 2 +- test/testoc.c | 6 +++--- test/testshmem.c | 14 ++++++-------- test/testthread.c | 5 +++-- test/testtime.c | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/test/mod_test.c b/test/mod_test.c index d9d9f6b4d84..20f6e71d7e9 100644 --- a/test/mod_test.c +++ b/test/mod_test.c @@ -2,12 +2,12 @@ int goodbyes = 0; -void print_hello(void) +static void print_hello(void) { fprintf(stdout,"Hello - I'm a DSO!\n"); } -int print_goodbye(int reps) +static int print_goodbye(int reps) { int i = 0; for (i = 0;i < reps; i++) { diff --git a/test/occhild.c b/test/occhild.c index d5171ec6ef9..3807b537a0d 100644 --- a/test/occhild.c +++ b/test/occhild.c @@ -2,7 +2,7 @@ #include <unistd.h> #include <stdlib.h> -int main() +int main(void) { int rc=1; char buf[256]; diff --git a/test/testcontext.c b/test/testcontext.c index 55efb11f351..122382e25b6 100644 --- a/test/testcontext.c +++ b/test/testcontext.c @@ -63,12 +63,12 @@ #include <unistd.h> #endif -apr_status_t string_cleanup(void *data) +static apr_status_t string_cleanup(void *data) { return APR_SUCCESS; } -int main() +int main(void) { apr_pool_t *context; char *testdata; diff --git a/test/testdso.c b/test/testdso.c index a050c8fde97..3245bfb9ded 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -4,6 +4,7 @@ #include "apr_dso.h" #include <string.h> #include <stdlib.h> +#include <unistd.h> #define LIB_NAME "mod_test.so" diff --git a/test/testfile.c b/test/testfile.c index efbe5fb9e0d..3504718a5f6 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -68,7 +68,7 @@ int test_filedel(apr_pool_t *); int testdirs(apr_pool_t *); static void test_read(apr_pool_t *); -int main() +int main(void) { apr_pool_t *context; apr_pool_t *cont2; diff --git a/test/testmmap.c b/test/testmmap.c index da13fd86b1d..779391c09c5 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -67,7 +67,7 @@ */ #define PATH_LEN 255 -int main() +int main(void) { apr_pool_t *context; apr_mmap_t *themmap = NULL; diff --git a/test/testoc.c b/test/testoc.c index 084b851871e..dfa515dd3c8 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -64,7 +64,7 @@ #include <unistd.h> #endif -void ocmaint(int reason, void *data, int status) +static void ocmaint(int reason, void *data, int status) { fprintf(stdout,"[CHILD] Maintenance routine called...."); fflush(stdout); @@ -135,7 +135,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "[PARENT] Sending SIGKILL to child......"); fflush(stdout); - sleep(1); + apr_sleep(1 * APR_USEC_PER_SEC); if (apr_kill(&newproc, SIGKILL) != APR_SUCCESS) { fprintf(stderr,"couldn't send the signal!\n"); exit(-1); @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) fprintf(stdout,"OK\n"); /* allow time for things to settle... */ - sleep(3); + apr_sleep(3 * APR_USEC_PER_SEC); apr_probe_writable_fds(); fprintf(stdout, "[PARENT] Checking on children..........\n"); diff --git a/test/testshmem.c b/test/testshmem.c index c579b869913..7ba4eacca54 100644 --- a/test/testshmem.c +++ b/test/testshmem.c @@ -62,9 +62,7 @@ #include <stdio.h> #include <stdlib.h> /*#include <process.h>*/ -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif typedef struct mbox { char msg[1024]; @@ -73,25 +71,25 @@ typedef struct mbox { apr_pool_t *context; mbox *boxes; -void msgwait(int boxnum) +static void msgwait(int boxnum) { volatile int test = 0; while (test == 0) { - sleep(0); + apr_sleep(0); test = boxes[boxnum].msgavail; } fprintf(stdout, "\nreceived a message in box %d, message was: %s\n", boxnum, boxes[boxnum].msg); } -void msgput(int boxnum, char *msg) +static void msgput(int boxnum, char *msg) { fprintf(stdout, "Sending message to box %d\n", boxnum); apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg)); boxes[boxnum].msgavail = 1; } -int main() +int main(void) { apr_shmem_t *shm; pid_t pid; @@ -125,7 +123,7 @@ int main() fprintf(stdout, "Creating a child process\n"); pid = fork(); if (pid == 0) { -sleep(1); + apr_sleep(1); if (apr_open_shmem(shm) == APR_SUCCESS) { msgwait(1); msgput(0, "Msg received\n"); @@ -136,7 +134,7 @@ sleep(1); } else if (pid > 0) { msgput(1, "Sending a message\n"); -sleep(1); + apr_sleep(1); msgwait(0); exit(1); } diff --git a/test/testthread.c b/test/testthread.c index 79ccfb698c2..3e572433db0 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -117,8 +117,9 @@ void * APR_THREAD_FUNC thread_func4(void *data) return NULL; } -int main() +int main(void) { +#if APR_HAS_THREADS apr_thread_t *t1; apr_thread_t *t2; apr_thread_t *t3; @@ -171,6 +172,6 @@ int main() else { fprintf(stdout, "Everything is working!\n"); } - +#endif return 1; } diff --git a/test/testtime.c b/test/testtime.c index 816cb70dda6..a246ac3b57a 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -61,7 +61,7 @@ #include <unistd.h> #endif -int main() +int main(void) { apr_time_t now; apr_exploded_time_t xt; From a79578117f73f79f420bc450a0a2d7ad4a9743b4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 16 Nov 2000 01:51:36 +0000 Subject: [PATCH 0759/7878] This is a small step toward's David Reid's IPv6 patch. I started with the part of David's patch which uses apr_sockaddr_t instead of sockaddr_in inside apr_socket_t, got everything to compile (and seem to run properly on Unix), and simplified some of the code which allocates storage for apr_socket_t and fills out fields in apr_sockaddr_t. I didn't add all the code from the patch that supports IPv6 throughout. I didn't add any of the API enhancements. This includes a port of the code to Win32. I'll later commit the required changes for OS/2. Submitted by: David Reid Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60737 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 5 +- include/arch/unix/networkio.h | 5 +- include/arch/win32/networkio.h | 5 +- network_io/unix/sa_common.c | 22 +++--- network_io/unix/sockaddr.c | 16 +++-- network_io/unix/sockets.c | 125 +++++++++++++++++++-------------- network_io/unix/sockopt.c | 4 +- network_io/win32/sockaddr.c | 12 ++-- network_io/win32/sockets.c | 118 ++++++++++++++++--------------- network_io/win32/sockopt.c | 4 +- 10 files changed, 178 insertions(+), 138 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index ea9d14a8e80..dd9080db0eb 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -158,11 +158,14 @@ typedef struct apr_sockaddr_t { #endif } sa; apr_socklen_t sa_len; /* How big is the sockaddr we're using? */ + int ipaddr_len; /* How big is the ip address structure + * we're using? + */ int addr_str_len; /* How big should the address buffer be? * 16 for v4 or 46 for v6 * used in inet_ntop... */ - void *ipaddr_ptr; /* This points to the IP address + void *ipaddr_ptr; /* This points to the IP address * structure within the appropriate * sockaddr structure. */ diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 3fdc52e2ac3..45a768e6427 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -122,9 +122,8 @@ struct apr_socket_t { apr_pool_t *cntxt; int socketdes; - struct sockaddr_in *local_addr; - struct sockaddr_in *remote_addr; - apr_socklen_t addr_len; + apr_sockaddr_t *local_addr; + apr_sockaddr_t *remote_addr; apr_interval_time_t timeout; #ifndef HAVE_POLL int connected; diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 3d5897a6249..e7657d1262e 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -61,9 +61,8 @@ struct apr_socket_t { apr_pool_t *cntxt; SOCKET sock; - struct sockaddr_in *local_addr; - struct sockaddr_in *remote_addr; - size_t addr_len; + apr_sockaddr_t *local_addr; + apr_sockaddr_t *remote_addr; apr_interval_time_t timeout; apr_int32_t disconnected; int local_port_unknown; diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index fec3eb8cc1e..fbf25473d44 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -68,10 +68,11 @@ apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, apr_port_t port) { + /* XXX IPv6 */ if (which == APR_LOCAL) - sock->local_addr->sin_port = htons(port); + sock->local_addr->sa.sin.sin_port = htons(port); else if (which == APR_REMOTE) - sock->remote_addr->sin_port = htons(port); + sock->remote_addr->sa.sin.sin_port = htons(port); else return APR_EINVAL; return APR_SUCCESS; @@ -89,9 +90,10 @@ apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t } } - *port = ntohs(sock->local_addr->sin_port); + /* XXX IPv6 */ + *port = ntohs(sock->local_addr->sa.sin.sin_port); } else if (which == APR_REMOTE) - *port = ntohs(sock->remote_addr->sin_port); + *port = ntohs(sock->remote_addr->sa.sin.sin_port); else return APR_EINVAL; return APR_SUCCESS; @@ -107,9 +109,11 @@ apr_status_t apr_get_ipaddr(char **addr, apr_interface_e which, apr_socket_t *so return rv; } } - *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); + /* XXX IPv6 */ + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sa.sin.sin_addr)); } else if (which == APR_REMOTE) - *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); + /* XXX IPv6 */ + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sa.sin.sin_addr)); else return APR_EINVAL; @@ -149,9 +153,11 @@ apr_status_t apr_get_socket_inaddr(apr_in_addr_t *addr, apr_interface_e which, } } - *addr = *(apr_in_addr_t*)&sock->local_addr->sin_addr; + /* XXX IPv6 */ + *addr = *(apr_in_addr_t *)&sock->local_addr->sa.sin.sin_addr; } else if (which == APR_REMOTE) { - *addr = *(apr_in_addr_t*)&sock->remote_addr->sin_addr; + /* XXX IPv6 */ + *addr = *(apr_in_addr_t *)&sock->remote_addr->sa.sin.sin_addr; } else { return APR_EINVAL; } diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 99738f02794..14b93d62913 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -75,12 +75,13 @@ static apr_status_t get_local_addr(apr_socket_t *sock) apr_status_t apr_set_ipaddr(apr_socket_t *sock, apr_interface_e which, const char *addr) { u_long ipaddr; - struct sockaddr_in* sa_ptr; - + struct sockaddr_in *sa_ptr; + + /* XXX IPv6 */ if (which == APR_LOCAL) - sa_ptr = sock->local_addr; + sa_ptr = &sock->local_addr->sa.sin; else if (which == APR_REMOTE) - sa_ptr = sock->remote_addr; + sa_ptr = &sock->remote_addr->sa.sin; else return APR_EINVAL; @@ -100,6 +101,7 @@ apr_status_t apr_set_ipaddr(apr_socket_t *sock, apr_interface_e which, const cha } #if APR_HAVE_NETINET_IN_H +/* XXX IPv6 */ apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) { if (sock->local_port_unknown || sock->local_interface_unknown) { @@ -110,15 +112,15 @@ apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) } } - *name = sock->local_addr; + *name = &sock->local_addr->sa.sin; return APR_SUCCESS; } - +/* XXX IPv6 */ apr_status_t apr_get_remote_name(struct sockaddr_in **name, apr_socket_t *sock) { - *name = sock->remote_addr; + *name = &sock->remote_addr->sa.sin; return APR_SUCCESS; } #endif diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 4e5c37e0c7c..ed2ba781473 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -67,33 +67,65 @@ static apr_status_t socket_cleanup(void *sock) } } -apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) +static void set_socket_vars(apr_socket_t *sock, int family) { - (*new) = (apr_socket_t *)apr_pcalloc(cont, sizeof(apr_socket_t)); + sock->local_addr->sa.sin.sin_family = family; + sock->remote_addr->sa.sin.sin_family = family; - if ((*new) == NULL) { - return APR_ENOMEM; + if (family == AF_INET) { + sock->local_addr->sa_len = sizeof(struct sockaddr_in); + sock->local_addr->addr_str_len = 16; + sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin.sin_addr); + sock->local_addr->ipaddr_len = sizeof(struct in_addr); + + sock->remote_addr->sa_len = sizeof(struct sockaddr_in); + sock->remote_addr->addr_str_len = 16; + sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin.sin_addr); + sock->remote_addr->ipaddr_len = sizeof(struct in_addr); + } +#if APR_HAVE_IPV6 + else if (family == AF_INET6) { + sock->local_addr->sa_len = sizeof(struct sockaddr_in6); + sock->local_addr->addr_str_len = 46; + sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin6.sin6_addr); + sock->local_addr->ipaddr_len = sizeof(struct in6_addr); + + sock->remote_addr->sa_len = sizeof(struct sockaddr_in6); + sock->remote_addr->addr_str_len = 46; + sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin6.sin6_addr); + sock->remote_addr->ipaddr_len = sizeof(struct in6_addr); } - (*new)->cntxt = cont; - (*new)->local_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, - sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, - sizeof(struct sockaddr_in)); +#endif +} +static void alloc_socket(apr_socket_t **new, apr_pool_t *p) +{ + *new = (apr_socket_t *)apr_pcalloc(p, sizeof(apr_socket_t)); + (*new)->cntxt = p; + (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, + sizeof(apr_sockaddr_t)); + (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, + sizeof(apr_sockaddr_t)); +} + +apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) +{ + int family = AF_INET; + int proto = IPPROTO_TCP; + int type = SOCK_STREAM; + + alloc_socket(new, cont); if ((*new)->local_addr == NULL || (*new)->remote_addr == NULL) { return APR_ENOMEM; } - - (*new)->socketdes = socket(AF_INET ,SOCK_STREAM, IPPROTO_TCP); - (*new)->local_addr->sin_family = AF_INET; - (*new)->remote_addr->sin_family = AF_INET; + (*new)->socketdes = socket(family, type, proto); - (*new)->addr_len = sizeof(*(*new)->local_addr); - if ((*new)->socketdes < 0) { return errno; } + set_socket_vars(*new, family); + (*new)->timeout = -1; apr_register_cleanup((*new)->cntxt, (void *)(*new), socket_cleanup, apr_null_cleanup); @@ -113,10 +145,12 @@ apr_status_t apr_close_socket(apr_socket_t *thesocket) apr_status_t apr_bind(apr_socket_t *sock) { - if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) + if (bind(sock->socketdes, + (struct sockaddr *)&sock->local_addr->sa, sock->local_addr->sa_len) == -1) return errno; else { - if (sock->local_addr->sin_port == 0) { /* no need for ntohs() when comparing w/ 0 */ + /* XXX fix me for IPv6 */ + if (sock->local_addr->sa.sin.sin_port == 0) { /* no need for ntohs() when comparing w/ 0 */ sock->local_port_unknown = 1; /* kernel got us an ephemeral port */ } return APR_SUCCESS; @@ -133,28 +167,22 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { - (*new) = (apr_socket_t *)apr_pcalloc(connection_context, - sizeof(apr_socket_t)); - - (*new)->cntxt = connection_context; - (*new)->local_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, - sizeof(struct sockaddr_in)); + alloc_socket(new, connection_context); + set_socket_vars(*new, sock->local_addr->sa.sin.sin_family); - (*new)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, - sizeof(struct sockaddr_in)); - (*new)->addr_len = sizeof(struct sockaddr_in); #ifndef HAVE_POLL (*new)->connected = 1; #endif (*new)->timeout = -1; - (*new)->socketdes = accept(sock->socketdes, (struct sockaddr *)(*new)->remote_addr, - &(*new)->addr_len); + (*new)->remote_addr->sa_len = sizeof((*new)->remote_addr->sa); + (*new)->socketdes = accept(sock->socketdes, + (struct sockaddr *)&(*new)->remote_addr->sa, + &(*new)->remote_addr->sa_len); if ((*new)->socketdes < 0) { return errno; } - *(*new)->local_addr = *sock->local_addr; if (sock->local_port_unknown) { @@ -163,7 +191,8 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn } if (sock->local_interface_unknown || - sock->local_addr->sin_addr.s_addr == 0) { + /* XXX IPv6 issue */ + sock->local_addr->sa.sin.sin_addr.s_addr == 0) { /* If the interface address inside the listening socket's local_addr wasn't * up-to-date, we don't know local interface of the connected socket either. * @@ -189,8 +218,7 @@ apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) #ifndef GETHOSTBYNAME_HANDLES_NAS if (*hostname >= '0' && *hostname <= '9' && strspn(hostname, "0123456789.") == strlen(hostname)) { - sock->remote_addr->sin_addr.s_addr = inet_addr(hostname); - sock->addr_len = sizeof(*sock->remote_addr); + sock->remote_addr->sa.sin.sin_addr.s_addr = inet_addr(hostname); } else { #endif @@ -199,26 +227,30 @@ apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) if (!hp) { return (h_errno + APR_OS_START_SYSERR); } - - memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr_list[0], + + /* XXX IPv6: move name resolution out of this function */ + memcpy((char *)&sock->remote_addr->sa.sin.sin_addr, hp->h_addr_list[0], hp->h_length); - sock->addr_len = sizeof(*sock->remote_addr); #ifndef GETHOSTBYNAME_HANDLES_NAS } #endif } - if ((connect(sock->socketdes, (const struct sockaddr *)sock->remote_addr, - sock->addr_len) < 0) && (errno != EINPROGRESS)) { + if ((connect(sock->socketdes, + (const struct sockaddr *)&sock->remote_addr->sa.sin, + sock->remote_addr->sa_len) < 0) && + (errno != EINPROGRESS)) { return errno; } else { - if (sock->local_addr->sin_port == 0) { + /* XXX IPv6 */ + if (sock->local_addr->sa.sin.sin_port == 0) { /* connect() got us an ephemeral port */ sock->local_port_unknown = 1; } - if (sock->local_addr->sin_addr.s_addr == 0) { + /* XXX IPv6 */ + if (sock->local_addr->sa.sin.sin_addr.s_addr == 0) { /* not bound to specific local interface; connect() had to assign * one for the socket */ @@ -252,18 +284,9 @@ apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { if ((*sock) == NULL) { - (*sock) = (apr_socket_t *)apr_pcalloc(cont, sizeof(apr_socket_t)); - (*sock)->cntxt = cont; - (*sock)->local_addr = (struct sockaddr_in *)apr_pcalloc((*sock)->cntxt, - sizeof(struct sockaddr_in)); - (*sock)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*sock)->cntxt, - sizeof(struct sockaddr_in)); - - if ((*sock)->local_addr == NULL || (*sock)->remote_addr == NULL) { - return APR_ENOMEM; - } - - (*sock)->addr_len = sizeof(*(*sock)->local_addr); + alloc_socket(sock, cont); + /* XXX IPv6 figure out the family here! */ + set_socket_vars(*sock, AF_INET); (*sock)->timeout = -1; } (*sock)->local_port_unknown = (*sock)->local_interface_unknown = 1; diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index dd4e2c4c3e7..3829efae9ec 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -208,9 +208,9 @@ apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t * apr_in_addr_t sa_ptr; if (which == APR_LOCAL) - sa_ptr = sock->local_addr->sin_addr; + sa_ptr = sock->local_addr->sa.sin.sin_addr; else if (which == APR_REMOTE) - sa_ptr = sock->remote_addr->sin_addr; + sa_ptr = sock->remote_addr->sa.sin.sin_addr; else return APR_EINVAL; diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index 336b6edb363..8257752bde9 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -60,9 +60,9 @@ static apr_status_t get_local_addr(apr_socket_t *sock) { - size_t namelen = sizeof(*sock->local_addr); + size_t namelen = sizeof(sock->local_addr->sa); - if (getsockname(sock->sock, (struct sockaddr *)sock->local_addr, + if (getsockname(sock->sock, (struct sockaddr *)&sock->local_addr->sa, &namelen) < 0) { return apr_get_netos_error(); } @@ -81,9 +81,9 @@ apr_status_t apr_set_ipaddr(apr_socket_t *sock, apr_interface_e which, const cha struct sockaddr_in *ptr; if (which == APR_LOCAL) - ptr = sock->local_addr; + ptr = &sock->local_addr->sa.sin; else if (which == APR_REMOTE) - ptr = sock->remote_addr; + ptr = &sock->remote_addr->sa.sin; else return APR_EINVAL; @@ -112,7 +112,7 @@ apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) } } - *name = sock->local_addr; + *name = &sock->local_addr->sa.sin; return APR_SUCCESS; } @@ -120,6 +120,6 @@ apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) apr_status_t apr_get_remote_name(struct sockaddr_in **name, apr_socket_t *sock) { - *name = sock->remote_addr; + *name = &sock->remote_addr->sa.sin; return APR_SUCCESS; } diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index e65d908cb64..405985e5b02 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -59,7 +59,6 @@ #include "apr_portable.h" #include <string.h> - static apr_status_t socket_cleanup(void *sock) { apr_socket_t *thesocket = sock; @@ -73,22 +72,57 @@ static apr_status_t socket_cleanup(void *sock) return APR_SUCCESS; } +static void set_socket_vars(apr_socket_t *sock, int family) +{ + sock->local_addr->sa.sin.sin_family = family; + sock->remote_addr->sa.sin.sin_family = family; + + if (family == AF_INET) { + sock->local_addr->sa_len = sizeof(struct sockaddr_in); + sock->local_addr->addr_str_len = 16; + sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin.sin_addr); + sock->local_addr->ipaddr_len = sizeof(struct in_addr); + + sock->remote_addr->sa_len = sizeof(struct sockaddr_in); + sock->remote_addr->addr_str_len = 16; + sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin.sin_addr); + sock->remote_addr->ipaddr_len = sizeof(struct in_addr); + } +#if APR_HAVE_IPV6 + else if (family == AF_INET6) { + sock->local_addr->sa_len = sizeof(struct sockaddr_in6); + sock->local_addr->addr_str_len = 46; + sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin6.sin6_addr); + sock->local_addr->ipaddr_len = sizeof(struct in6_addr); + + sock->remote_addr->sa_len = sizeof(struct sockaddr_in6); + sock->remote_addr->addr_str_len = 46; + sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin6.sin6_addr); + sock->remote_addr->ipaddr_len = sizeof(struct in6_addr); + } +#endif +} +static void alloc_socket(apr_socket_t **new, apr_pool_t *p) +{ + *new = (apr_socket_t *)apr_pcalloc(p, sizeof(apr_socket_t)); + (*new)->cntxt = p; + (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, + sizeof(apr_sockaddr_t)); + (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, + sizeof(apr_sockaddr_t)); +} + apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) { - (*new) = (apr_socket_t *)apr_pcalloc(cont, sizeof(apr_socket_t)); + alloc_socket(new, cont); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; - (*new)->local_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, - sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, - sizeof(struct sockaddr_in)); - if (((*new)->local_addr == NULL) || ((*new)->remote_addr == NULL)) { return APR_ENOMEM; } + /* For right now, we are not using socket groups. We may later. * No flags to use when creating a socket, so use 0 for that parameter as well. */ @@ -96,13 +130,7 @@ apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) if ((*new)->sock == INVALID_SOCKET) { return apr_get_netos_error(); } - - (*new)->local_addr->sin_family = AF_INET; - (*new)->remote_addr->sin_family = AF_INET; - - (*new)->addr_len = sizeof(*(*new)->local_addr); - - (*new)->local_addr->sin_port = 0; + set_socket_vars(*new, AF_INET); (*new)->timeout = -1; (*new)->disconnected = 0; @@ -147,11 +175,13 @@ apr_status_t apr_close_socket(apr_socket_t *thesocket) apr_status_t apr_bind(apr_socket_t *sock) { - if (bind(sock->sock, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) { + if (bind(sock->sock, + (struct sockaddr *)&sock->local_addr->sa, + sock->local_addr->sa_len) == -1) { return apr_get_netos_error(); } else { - if (sock->local_addr->sin_port == 0) { + if (sock->local_addr->sa.sin.sin_port == 0) { sock->local_port_unknown = 1; /* ephemeral port */ } return APR_SUCCESS; @@ -168,27 +198,20 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { - (*new) = (apr_socket_t *)apr_pcalloc(connection_context, - sizeof(apr_socket_t)); - - (*new)->cntxt = connection_context; - (*new)->local_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, - sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, - sizeof(struct sockaddr_in)); - memcpy((*new)->local_addr, sock->local_addr, sizeof(struct sockaddr_in)); + alloc_socket(new, connection_context); + set_socket_vars(*new, sock->local_addr->sa.sin.sin_family); - (*new)->addr_len = sizeof(struct sockaddr_in); (*new)->timeout = -1; (*new)->disconnected = 0; - (*new)->sock = accept(sock->sock, (struct sockaddr *)(*new)->local_addr, - &(*new)->addr_len); + (*new)->remote_addr->sa_len = sizeof((*new)->remote_addr->sa); + (*new)->sock = accept(sock->sock, + (struct sockaddr *)&(*new)->remote_addr->sa, + &(*new)->remote_addr->sa_len); if ((*new)->sock == INVALID_SOCKET) { return apr_get_netos_error(); } - *(*new)->local_addr = *sock->local_addr; if (sock->local_port_unknown) { @@ -197,7 +220,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn } if (sock->local_interface_unknown || - sock->local_addr->sin_addr.s_addr == 0) { + sock->local_addr->sa.sin.sin_addr.s_addr == 0) { /* If the interface address inside the listening socket's local_addr wasn't * up-to-date, we don't know local interface of the connected socket either. * @@ -225,22 +248,20 @@ apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) if (hostname != NULL) { if (*hostname >= '0' && *hostname <= '9' && strspn(hostname, "0123456789.") == strlen(hostname)) { - sock->remote_addr->sin_addr.s_addr = inet_addr(hostname); + sock->remote_addr->sa.sin.sin_addr.s_addr = inet_addr(hostname); } else { hp = gethostbyname(hostname); if (!hp) { return apr_get_netos_error(); } - memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr_list[0], hp->h_length); - sock->addr_len = sizeof(*sock->remote_addr); + memcpy((char *)&sock->remote_addr->sa.sin.sin_addr, hp->h_addr_list[0], + hp->h_length); } } - sock->remote_addr->sin_family = AF_INET; - - if (connect(sock->sock, (const struct sockaddr *)sock->remote_addr, - sock->addr_len) == SOCKET_ERROR) { + if (connect(sock->sock, (const struct sockaddr *)&sock->remote_addr->sa.sin, + sock->remote_addr->sa_len) == SOCKET_ERROR) { lasterror = apr_get_netos_error(); if (lasterror != APR_FROM_OS_ERROR(WSAEWOULDBLOCK)) { return lasterror; @@ -253,10 +274,10 @@ apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) } } /* connect was OK .. amazing */ - if (sock->local_addr->sin_port == 0) { + if (sock->local_addr->sa.sin.sin_port == 0) { sock->local_port_unknown = 1; } - if (sock->local_addr->sin_addr.s_addr == 0) { + if (sock->local_addr->sa.sin.sin_addr.s_addr == 0) { /* must be using free-range port */ sock->local_interface_unknown = 1; } @@ -283,22 +304,9 @@ apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { - if (cont == NULL) { - return APR_ENOPOOL; - } if ((*sock) == NULL) { - (*sock) = (apr_socket_t *)apr_pcalloc(cont, sizeof(apr_socket_t)); - (*sock)->cntxt = cont; - (*sock)->local_addr = (struct sockaddr_in *)apr_pcalloc((*sock)->cntxt, - sizeof(struct sockaddr_in)); - (*sock)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*sock)->cntxt, - sizeof(struct sockaddr_in)); - - if ((*sock)->local_addr == NULL || (*sock)->remote_addr == NULL) { - return APR_ENOMEM; - } - - (*sock)->addr_len = sizeof(*(*sock)->local_addr); + alloc_socket(sock, cont); + set_socket_vars(*sock, AF_INET); (*sock)->timeout = -1; (*sock)->disconnected = 0; } diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 5a763836557..0926d20e007 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -207,9 +207,9 @@ apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t * apr_in_addr_t sa_ptr; if (which == APR_LOCAL) - sa_ptr = sock->local_addr->sin_addr; + sa_ptr = sock->local_addr->sa.sin.sin_addr; else if (which == APR_REMOTE) - sa_ptr = sock->remote_addr->sin_addr; + sa_ptr = sock->remote_addr->sa.sin.sin_addr; else return APR_EINVAL; From 70d104e0379ca61ff4bca848af2182612572c833 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 16 Nov 2000 02:17:29 +0000 Subject: [PATCH 0760/7878] port initial set of David Reid's IPv6 support to OS/2 (not compiled, not tested) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60738 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/networkio.h | 5 +- network_io/os2/sockets.c | 92 ++++++++++++++++++++++++------------ network_io/os2/sockopt.c | 4 +- 3 files changed, 65 insertions(+), 36 deletions(-) diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index e5c4f54fa47..a34edfbfbc8 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -66,9 +66,8 @@ struct apr_socket_t { apr_pool_t *cntxt; int socketdes; - struct sockaddr_in *local_addr; - struct sockaddr_in *remote_addr; - int addr_len; + apr_sockaddr_t *local_addr; + apr_sockaddr_t *remote_addr; apr_interval_time_t timeout; int nonblock; int local_port_unknown; diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 58eb7d9ead1..fa1361827cc 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -83,33 +83,63 @@ static apr_status_t socket_cleanup(void *sock) } } +static void set_socket_vars(apr_socket_t *sock, int family) +{ + sock->local_addr->sa.sin.sin_family = family; + sock->remote_addr->sa.sin.sin_family = family; + + if (family == AF_INET) { + sock->local_addr->sa_len = sizeof(struct sockaddr_in); + sock->local_addr->addr_str_len = 16; + sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin.sin_addr); + sock->local_addr->ipaddr_len = sizeof(struct in_addr); + + sock->remote_addr->sa_len = sizeof(struct sockaddr_in); + sock->remote_addr->addr_str_len = 16; + sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin.sin_addr); + sock->remote_addr->ipaddr_len = sizeof(struct in_addr); + } +#if APR_HAVE_IPV6 + else if (family == AF_INET6) { + sock->local_addr->sa_len = sizeof(struct sockaddr_in6); + sock->local_addr->addr_str_len = 46; + sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin6.sin6_addr); + sock->local_addr->ipaddr_len = sizeof(struct in6_addr); + + sock->remote_addr->sa_len = sizeof(struct sockaddr_in6); + sock->remote_addr->addr_str_len = 46; + sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin6.sin6_addr); + sock->remote_addr->ipaddr_len = sizeof(struct in6_addr); + } +#endif +} +static void alloc_socket(apr_socket_t **new, apr_pool_t *p) +{ + *new = (apr_socket_t *)apr_pcalloc(p, sizeof(apr_socket_t)); + (*new)->cntxt = p; + (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, + sizeof(apr_sockaddr_t)); + (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, + sizeof(apr_sockaddr_t)); +} + apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) { - (*new) = (apr_socket_t *)apr_palloc(cont, sizeof(apr_socket_t)); + alloc_socket(new, cont); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; - (*new)->local_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, - sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, - sizeof(struct sockaddr_in)); - if ((*new)->local_addr == NULL || (*new)->remote_addr == NULL) { return APR_ENOMEM; } (*new)->socketdes = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - - (*new)->local_addr->sin_family = AF_INET; - (*new)->remote_addr->sin_family = AF_INET; - - (*new)->addr_len = sizeof(*(*new)->local_addr); - if ((*new)->socketdes < 0) { return APR_OS2_STATUS(sock_errno()); } + set_socket_vars(*new, AF_INET); + (*new)->timeout = -1; (*new)->nonblock = FALSE; apr_register_cleanup((*new)->cntxt, (void *)(*new), @@ -138,7 +168,9 @@ apr_status_t apr_close_socket(apr_socket_t *thesocket) apr_status_t apr_bind(apr_socket_t *sock) { - if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) + if (bind(sock->socketdes, + (struct sockaddr *)sock->local_addr->sa, + sock->local_addr->sa_len) == -1) return APR_OS2_STATUS(sock_errno()); else return APR_SUCCESS; @@ -154,19 +186,15 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { - (*new) = (apr_socket_t *)apr_palloc(connection_context, - sizeof(apr_socket_t)); - - (*new)->cntxt = connection_context; - (*new)->remote_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, - sizeof(struct sockaddr_in)); - (*new)->local_addr = sock->local_addr; - (*new)->addr_len = sizeof(struct sockaddr_in); + alloc_socket(new, connection_context); + set_socket_vars(*new, sock->local_addr->sa.sin.sin_family); + (*new)->timeout = -1; (*new)->nonblock = FALSE; - (*new)->socketdes = accept(sock->socketdes, (struct sockaddr *)(*new)->remote_addr, - &(*new)->addr_len); + (*new)->socketdes = accept(sock->socketdes, + (struct sockaddr *)&(*new)->remote_addr->sa, + &(*new)->remote_addr->sa_len); if ((*new)->socketdes < 0) { return APR_OS2_STATUS(sock_errno()); @@ -194,17 +222,19 @@ apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) return h_errno; } - memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr_list[0], hp->h_length); - sock->addr_len = sizeof(*sock->remote_addr); + memcpy((char *)&sock->remote_addr->sa.sin.sin_addr, hp->h_addr_list[0], + hp->h_length); } - if ((connect(sock->socketdes, (struct sockaddr *)sock->remote_addr, sock->addr_len) < 0) && + if ((connect(sock->socketdes, (struct sockaddr *)&sock->remote_addr->sa.sin, + sock->remote_addr->sa_len) < 0) && (sock_errno() != SOCEINPROGRESS)) { return APR_OS2_STATUS(sock_errno()); } else { - int namelen = sizeof(*sock->local_addr); - getsockname(sock->socketdes, (struct sockaddr *)sock->local_addr, &namelen); + int namelen = sizeof(sock->local_addr->sa.sin); + getsockname(sock->socketdes, (struct sockaddr *)&sock->local_addr->sa.sin, + &namelen); return APR_SUCCESS; } } @@ -239,8 +269,8 @@ apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_po return APR_ENOPOOL; } if ((*sock) == NULL) { - (*sock) = (apr_socket_t *)apr_palloc(cont, sizeof(apr_socket_t)); - (*sock)->cntxt = cont; + alloc_socket(sock, cont); + set_socket_vars(*sock, AF_INET); } (*sock)->socketdes = *thesock; return APR_SUCCESS; diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 6743aea75cd..ffc5a7d51ba 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -154,9 +154,9 @@ apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t * apr_in_addr_t sa_ptr; if (which == APR_LOCAL) - sa_ptr = sock->local_addr->sin_addr; + sa_ptr = sock->local_addr->sa.sin.sin_addr; else if (which == APR_REMOTE) - sa_ptr = sock->remote_addr->sin_addr; + sa_ptr = sock->remote_addr->sa.sin.sin_addr; else return APR_EINVAL; From 2e626b8bc53ecf32210d39e074730654fb3538a1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 16 Nov 2000 03:04:54 +0000 Subject: [PATCH 0761/7878] fix bug in get_local_addr(): wrong address passed to getsockname() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60739 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 14b93d62913..8ded1ead365 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -59,7 +59,7 @@ static apr_status_t get_local_addr(apr_socket_t *sock) { apr_socklen_t namelen = sizeof(*sock->local_addr); - if (getsockname(sock->socketdes, (struct sockaddr *)sock->local_addr, + if (getsockname(sock->socketdes, (struct sockaddr *)&sock->local_addr->sa, &namelen) < 0) { return errno; } From c1365284d8857819f9553916ef71054474ce0070 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Thu, 16 Nov 2000 13:36:17 +0000 Subject: [PATCH 0762/7878] Fix a spelling error... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60740 13f79535-47bb-0310-9956-ffa450edef68 --- test/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/server.c b/test/server.c index c385aecc2cd..78758378e68 100644 --- a/test/server.c +++ b/test/server.c @@ -193,7 +193,7 @@ int main(int argc, char *argv[]) } fprintf(stdout, "OK\n"); - fprintf(stdout, "\tServer: Shutting down accepte socket......."); + fprintf(stdout, "\tServer: Shutting down accepted socket......."); if (apr_shutdown(sock2, APR_SHUTDOWN_READ) != APR_SUCCESS) { apr_close_socket(sock); apr_close_socket(sock2); From 47142f5b6fc90515c040ea96492ba743ceab1d1c Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 16 Nov 2000 14:48:50 +0000 Subject: [PATCH 0763/7878] Add apr_inet_ntop(), apr_inet_pton(), apr_create_socket(), and fix apr_get_ipaddr() to be thread-safe and to support IPv6. apr_create_socket() supports the special AF_UNSPEC family which means get AF_INET6 if you can but fall back to AF_INET because the app doesn't really care. The inclusion of apr_inet_ntop() and apr_inet_pton() still needs to be rolled into Win32, OS/2, and BeOS networkio.h and build scripts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60741 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 10 ++ include/arch/unix/networkio.h | 3 + network_io/unix/Makefile.in | 4 +- network_io/unix/inet_ntop.c | 205 +++++++++++++++++++++++++++++ network_io/unix/inet_pton.c | 234 ++++++++++++++++++++++++++++++++++ network_io/unix/sa_common.c | 25 ++-- network_io/unix/sockets.c | 29 ++++- test/server.c | 4 +- 8 files changed, 497 insertions(+), 17 deletions(-) create mode 100644 network_io/unix/inet_ntop.c create mode 100644 network_io/unix/inet_pton.c diff --git a/include/apr_network_io.h b/include/apr_network_io.h index dd9080db0eb..548974f41f5 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -199,6 +199,16 @@ struct apr_hdtr_t { */ apr_status_t apr_create_tcp_socket(apr_socket_t **new_sock, apr_pool_t *cont); +/** + * Create a socket. + * @param new_sock The new socket that has been set up. + * @param family The address family of the socket (e.g., AF_INET). + * @param type The type of the socket (e.g., SOCK_STREAM). + * @param cont The pool to use + */ +apr_status_t apr_create_socket(apr_socket_t **new_sock, int family, + int type, apr_pool_t *cont); + /** * Shutdown either reading, writing, or both sides of a tcp socket. * @param thesocket The socket to close diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 45a768e6427..7fe3538a740 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -149,5 +149,8 @@ struct apr_pollfd_t { }; +const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); +int apr_inet_pton(int af, const char *src, void *dst); + #endif /* ! NETWORK_IO_H */ diff --git a/network_io/unix/Makefile.in b/network_io/unix/Makefile.in index 3e0a4b21ca2..219f25bf7b1 100644 --- a/network_io/unix/Makefile.in +++ b/network_io/unix/Makefile.in @@ -16,7 +16,9 @@ OBJS=poll.o \ sendrecv.o \ sockets.o \ sockopt.o \ - sockaddr.o + sockaddr.o \ + inet_ntop.o \ + inet_pton.o .c.o: $(CC) $(CFLAGS) -c $(INCLUDES) $< diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c new file mode 100644 index 00000000000..a28db0979a2 --- /dev/null +++ b/network_io/unix/inet_ntop.c @@ -0,0 +1,205 @@ +/* Copyright (c) 1996 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#include "apr_private.h" +#include "networkio.h" + +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif +#include <string.h> +#include <errno.h> +#include <stdio.h> + +#ifndef IN6ADDRSZ +#define IN6ADDRSZ 16 +#endif + +#ifndef INT16SZ +#define INT16SZ sizeof(apr_int16_t) +#endif + +#define SPRINTF(x) ((size_t)sprintf x) + +/* + * WARNING: Don't even consider trying to compile this on a system where + * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. + */ + +static const char *inet_ntop4 __P((const unsigned char *src, char *dst, apr_size_t size)); +#if APR_HAVE_IPV6 +static const char *inet_ntop6 __P((const unsigned char *src, char *dst, apr_size_t size)); +#endif + +/* char * + * inet_ntop(af, src, dst, size) + * convert a network format address to presentation format. + * return: + * pointer to presentation format address (`dst'), or NULL (see errno). + * author: + * Paul Vixie, 1996. + */ +const char * +apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size) +{ + switch (af) { + case AF_INET: + return (inet_ntop4(src, dst, size)); +#if APR_HAVE_IPV6 + case AF_INET6: + return (inet_ntop6(src, dst, size)); +#endif + default: + errno = EAFNOSUPPORT; + return (NULL); + } + /* NOTREACHED */ +} + +/* const char * + * inet_ntop4(src, dst, size) + * format an IPv4 address, more or less like inet_ntoa() + * return: + * `dst' (as a const) + * notes: + * (1) uses no statics + * (2) takes a u_char* not an in_addr as input + * author: + * Paul Vixie, 1996. + */ +static const char * +inet_ntop4(src, dst, size) + const unsigned char *src; + char *dst; + apr_size_t size; +{ + static const char fmt[] = "%u.%u.%u.%u"; + char tmp[sizeof "255.255.255.255"]; + + if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) { + errno = ENOSPC; + return (NULL); + } + strcpy(dst, tmp); + return (dst); +} + +#if APR_HAVE_IPV6 +/* const char * + * inet_ntop6(src, dst, size) + * convert IPv6 binary address into presentation (printable) format + * author: + * Paul Vixie, 1996. + */ +static const char * +inet_ntop6(src, dst, size) + const unsigned char *src; + char *dst; + apr_size_t size; +{ + /* + * Note that int32_t and int16_t need only be "at least" large enough + * to contain a value of the specified size. On some systems, like + * Crays, there is no such thing as an integer variable with 16 bits. + * Keep this in mind if you think this function should have been coded + * to use pointer overlays. All the world's not a VAX. + */ + char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp; + struct { int base, len; } best, cur; + unsigned int words[IN6ADDRSZ / INT16SZ]; + int i; + + /* + * Preprocess: + * Copy the input (bytewise) array into a wordwise array. + * Find the longest run of 0x00's in src[] for :: shorthanding. + */ + memset(words, '\0', sizeof words); + for (i = 0; i < IN6ADDRSZ; i++) + words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); + best.base = -1; + cur.base = -1; + for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { + if (words[i] == 0) { + if (cur.base == -1) + cur.base = i, cur.len = 1; + else + cur.len++; + } else { + if (cur.base != -1) { + if (best.base == -1 || cur.len > best.len) + best = cur; + cur.base = -1; + } + } + } + if (cur.base != -1) { + if (best.base == -1 || cur.len > best.len) + best = cur; + } + if (best.base != -1 && best.len < 2) + best.base = -1; + + /* + * Format the result. + */ + tp = tmp; + for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { + /* Are we inside the best run of 0x00's? */ + if (best.base != -1 && i >= best.base && + i < (best.base + best.len)) { + if (i == best.base) + *tp++ = ':'; + continue; + } + /* Are we following an initial run of 0x00s or any real hex? */ + if (i != 0) + *tp++ = ':'; + /* Is this address an encapsulated IPv4? */ + if (i == 6 && best.base == 0 && + (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { + if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) + return (NULL); + tp += strlen(tp); + break; + } + tp += SPRINTF((tp, "%x", words[i])); + } + /* Was it a trailing run of 0x00's? */ + if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) + *tp++ = ':'; + *tp++ = '\0'; + + /* + * Check for overflow, copy, and we're done. + */ + if ((size_t)(tp - tmp) > size) { + errno = ENOSPC; + return (NULL); + } + strcpy(dst, tmp); + return (dst); +} +#endif diff --git a/network_io/unix/inet_pton.c b/network_io/unix/inet_pton.c new file mode 100644 index 00000000000..1920a70c214 --- /dev/null +++ b/network_io/unix/inet_pton.c @@ -0,0 +1,234 @@ +/* Copyright (c) 1996 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#include "apr_private.h" +#include "networkio.h" + +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif +#include <string.h> +#include <errno.h> + +#ifndef IN6ADDRSZ +#define IN6ADDRSZ 16 +#endif + +#ifndef INT16SZ +#define INT16SZ sizeof(apr_int16_t) +#endif + +#ifndef INADDRSZ +#define INADDRSZ 4 +#endif + +/* + * WARNING: Don't even consider trying to compile this on a system where + * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. + */ + +static int inet_pton4 __P((const char *src, unsigned char *dst)); +#if APR_HAVE_IPV6 +static int inet_pton6 __P((const char *src, unsigned char *dst)); +#endif + +/* int + * inet_pton(af, src, dst) + * convert from presentation format (which usually means ASCII printable) + * to network format (which is usually some kind of binary format). + * return: + * 1 if the address was valid for the specified address family + * 0 if the address wasn't valid (`dst' is untouched in this case) + * -1 if some other error occurred (`dst' is untouched in this case, too) + * author: + * Paul Vixie, 1996. + */ +int +apr_inet_pton(int af, const char *src, void *dst) +{ + switch (af) { + case AF_INET: + return (inet_pton4(src, dst)); +#if APR_HAVE_IPV6 + case AF_INET6: + return (inet_pton6(src, dst)); +#endif + default: + errno = EAFNOSUPPORT; + return (-1); + } + /* NOTREACHED */ +} + +/* int + * inet_pton4(src, dst) + * like inet_aton() but without all the hexadecimal and shorthand. + * return: + * 1 if `src' is a valid dotted quad, else 0. + * notice: + * does not touch `dst' unless it's returning 1. + * author: + * Paul Vixie, 1996. + */ +static int +inet_pton4(src, dst) + const char *src; + unsigned char *dst; +{ + static const char digits[] = "0123456789"; + int saw_digit, octets, ch; + unsigned char tmp[INADDRSZ], *tp; + + saw_digit = 0; + octets = 0; + *(tp = tmp) = 0; + while ((ch = *src++) != '\0') { + const char *pch; + + if ((pch = strchr(digits, ch)) != NULL) { + unsigned int new = *tp * 10 + (pch - digits); + + if (new > 255) + return (0); + *tp = new; + if (! saw_digit) { + if (++octets > 4) + return (0); + saw_digit = 1; + } + } else if (ch == '.' && saw_digit) { + if (octets == 4) + return (0); + *++tp = 0; + saw_digit = 0; + } else + return (0); + } + if (octets < 4) + return (0); + + memcpy(dst, tmp, INADDRSZ); + return (1); +} + +#if APR_HAVE_IPV6 +/* int + * inet_pton6(src, dst) + * convert presentation level address to network order binary form. + * return: + * 1 if `src' is a valid [RFC1884 2.2] address, else 0. + * notice: + * (1) does not touch `dst' unless it's returning 1. + * (2) :: in a full address is silently ignored. + * credit: + * inspired by Mark Andrews. + * author: + * Paul Vixie, 1996. + */ +static int +inet_pton6(src, dst) + const char *src; + unsigned char *dst; +{ + static const char xdigits_l[] = "0123456789abcdef", + xdigits_u[] = "0123456789ABCDEF"; + unsigned char tmp[IN6ADDRSZ], *tp, *endp, *colonp; + const char *xdigits, *curtok; + int ch, saw_xdigit; + unsigned int val; + + memset((tp = tmp), '\0', IN6ADDRSZ); + endp = tp + IN6ADDRSZ; + colonp = NULL; + /* Leading :: requires some special handling. */ + if (*src == ':') + if (*++src != ':') + return (0); + curtok = src; + saw_xdigit = 0; + val = 0; + while ((ch = *src++) != '\0') { + const char *pch; + + if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) + pch = strchr((xdigits = xdigits_u), ch); + if (pch != NULL) { + val <<= 4; + val |= (pch - xdigits); + if (val > 0xffff) + return (0); + saw_xdigit = 1; + continue; + } + if (ch == ':') { + curtok = src; + if (!saw_xdigit) { + if (colonp) + return (0); + colonp = tp; + continue; + } + if (tp + INT16SZ > endp) + return (0); + *tp++ = (unsigned char) (val >> 8) & 0xff; + *tp++ = (unsigned char) val & 0xff; + saw_xdigit = 0; + val = 0; + continue; + } + if (ch == '.' && ((tp + INADDRSZ) <= endp) && + inet_pton4(curtok, tp) > 0) { + tp += INADDRSZ; + saw_xdigit = 0; + break; /* '\0' was seen by inet_pton4(). */ + } + return (0); + } + if (saw_xdigit) { + if (tp + INT16SZ > endp) + return (0); + *tp++ = (unsigned char) (val >> 8) & 0xff; + *tp++ = (unsigned char) val & 0xff; + } + if (colonp != NULL) { + /* + * Since some memmove()'s erroneously fail to handle + * overlapping regions, we'll do the shift by hand. + */ + const int n = tp - colonp; + int i; + + for (i = 1; i <= n; i++) { + endp[- i] = colonp[n - i]; + colonp[n - i] = 0; + } + tp = endp; + } + if (tp != endp) + return (0); + memcpy(dst, tmp, IN6ADDRSZ); + return (1); +} +#endif diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index fbf25473d44..f1ebc8dfeca 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -68,7 +68,7 @@ apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, apr_port_t port) { - /* XXX IPv6 */ + /* XXX IPv6: assumes sin_port and sin6_port at same offset */ if (which == APR_LOCAL) sock->local_addr->sa.sin.sin_port = htons(port); else if (which == APR_REMOTE) @@ -80,6 +80,7 @@ apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t *sock) { + /* XXX IPv6: assumes sin_port and sin6_port at same offset */ if (which == APR_LOCAL) { if (sock->local_port_unknown) { @@ -89,8 +90,6 @@ apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t return rv; } } - - /* XXX IPv6 */ *port = ntohs(sock->local_addr->sa.sin.sin_port); } else if (which == APR_REMOTE) *port = ntohs(sock->remote_addr->sa.sin.sin_port); @@ -101,7 +100,7 @@ apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t apr_status_t apr_get_ipaddr(char **addr, apr_interface_e which, apr_socket_t *sock) { - if (which == APR_LOCAL){ + if (which == APR_LOCAL) { if (sock->local_interface_unknown) { apr_status_t rv = get_local_addr(sock); @@ -109,11 +108,19 @@ apr_status_t apr_get_ipaddr(char **addr, apr_interface_e which, apr_socket_t *so return rv; } } - /* XXX IPv6 */ - *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sa.sin.sin_addr)); - } else if (which == APR_REMOTE) - /* XXX IPv6 */ - *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sa.sin.sin_addr)); + *addr = apr_palloc(sock->cntxt, sock->local_addr->addr_str_len); + apr_inet_ntop(sock->local_addr->sa.sin.sin_family, + sock->local_addr->ipaddr_ptr, + *addr, + sock->local_addr->addr_str_len); + } + else if (which == APR_REMOTE) { + *addr = apr_palloc(sock->cntxt, sock->remote_addr->addr_str_len); + apr_inet_ntop(sock->remote_addr->sa.sin.sin_family, + sock->remote_addr->ipaddr_ptr, + *addr, + sock->remote_addr->addr_str_len); + } else return APR_EINVAL; diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index ed2ba781473..5e9e4c5a875 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -107,11 +107,18 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) sizeof(apr_sockaddr_t)); } -apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) +apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, + apr_pool_t *cont) { - int family = AF_INET; - int proto = IPPROTO_TCP; - int type = SOCK_STREAM; + int family = ofamily; + + if (family == AF_UNSPEC) { +#if APR_HAVE_IPV6 + family = AF_INET6; +#else + family = AF_INET; +#endif + } alloc_socket(new, cont); @@ -119,7 +126,14 @@ apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) return APR_ENOMEM; } - (*new)->socketdes = socket(family, type, proto); + (*new)->socketdes = socket(family, type, 0); + +#if APR_HAVE_IPV6 + if ((*new)->socketdes < 0 && ofamily == AF_UNSPEC) { + family = AF_INET; + (*new)->socketdes = socket(family, type, 0); + } +#endif if ((*new)->socketdes < 0) { return errno; @@ -132,6 +146,11 @@ apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) return APR_SUCCESS; } +apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) +{ + return apr_create_socket(new, AF_INET, SOCK_STREAM, cont); +} + apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { return (shutdown(thesocket->socketdes, how) == -1) ? errno : APR_SUCCESS; diff --git a/test/server.c b/test/server.c index 78758378e68..9c690a2c7d9 100644 --- a/test/server.c +++ b/test/server.c @@ -88,7 +88,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Creating new socket......."); - if (apr_create_tcp_socket(&sock, context) != APR_SUCCESS) { + if (apr_create_socket(&sock, AF_UNSPEC, SOCK_STREAM, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); } @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Listening to socket......."); - if (apr_listen(sock, 8021) != APR_SUCCESS) { + if (apr_listen(sock, 5) != APR_SUCCESS) { apr_close_socket(sock); fprintf(stderr, "Could not listen\n"); exit(-1); From 45f09eca0c0e0cde9f694d4e24c7d2bbd6f71a96 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 16 Nov 2000 15:28:55 +0000 Subject: [PATCH 0764/7878] Get inet_ntop() and inet_pton() to compile on Tru64 (and probably a lot more systems). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60742 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_ntop.c | 4 ++++ network_io/unix/inet_pton.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index a28db0979a2..845380375ce 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -41,6 +41,10 @@ #define INT16SZ sizeof(apr_int16_t) #endif +#ifndef __P +#define __P(x) x +#endif + #define SPRINTF(x) ((size_t)sprintf x) /* diff --git a/network_io/unix/inet_pton.c b/network_io/unix/inet_pton.c index 1920a70c214..915884bc12f 100644 --- a/network_io/unix/inet_pton.c +++ b/network_io/unix/inet_pton.c @@ -44,6 +44,10 @@ #define INADDRSZ 4 #endif +#ifndef __P +#define __P(x) x +#endif + /* * WARNING: Don't even consider trying to compile this on a system where * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. From e46d199124a57752dc166f1b04c501ee659bc510 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 16 Nov 2000 16:04:33 +0000 Subject: [PATCH 0765/7878] tweak get_local_addr() to reference the apr_sockaddr_t len field directly so we are sure to have the right length there git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60743 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 5 ++--- network_io/win32/sockaddr.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 8ded1ead365..196879ec12d 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -57,10 +57,9 @@ static apr_status_t get_local_addr(apr_socket_t *sock) { - apr_socklen_t namelen = sizeof(*sock->local_addr); - + sock->local_addr->sa_len = sizeof(sock->local_addr->sa); if (getsockname(sock->socketdes, (struct sockaddr *)&sock->local_addr->sa, - &namelen) < 0) { + &sock->local_addr->sa_len) < 0) { return errno; } else { diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index 8257752bde9..d3176b7461b 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -60,10 +60,9 @@ static apr_status_t get_local_addr(apr_socket_t *sock) { - size_t namelen = sizeof(sock->local_addr->sa); - + sock->local_addr->sa_len = sizeof(sock->local_addr->sa); if (getsockname(sock->sock, (struct sockaddr *)&sock->local_addr->sa, - &namelen) < 0) { + &sock->local_addr->sa_len) < 0) { return apr_get_netos_error(); } else { From 537b0f1001c99fad94774dc9cc4f62175b728f8a Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 16 Nov 2000 17:31:25 +0000 Subject: [PATCH 0766/7878] Get Win32 closer to building with updated network_io API. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60744 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/networkio.h | 3 +++ network_io/unix/inet_ntop.c | 4 ++++ network_io/win32/sockets.c | 25 ++++++++++++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index e7657d1262e..e9e1b9bff68 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -81,5 +81,8 @@ struct apr_pollfd_t { apr_status_t status_from_res_error(int); +const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); +int apr_inet_pton(int af, const char *src, void *dst); + #endif /* ! NETWORK_IO_H */ diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index 845380375ce..5bc90bcd279 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -45,6 +45,10 @@ #define __P(x) x #endif +#if !defined(EAFNOSUPPORT) && defined(WSAEAFNOSUPPORT) +#define EAFNOSUPPORT WSAEAFNOSUPPORT +#endif + #define SPRINTF(x) ((size_t)sprintf x) /* diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 405985e5b02..25ba7a0c299 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -112,8 +112,19 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) sizeof(apr_sockaddr_t)); } -apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) +apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, + apr_pool_t *cont) { + int family = ofamily; + + if (family == AF_UNSPEC) { +#if APR_HAVE_IPV6 + family = AF_INET6; +#else + family = AF_INET; +#endif + } + alloc_socket(new, cont); if ((*new) == NULL) { @@ -127,6 +138,13 @@ apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) * No flags to use when creating a socket, so use 0 for that parameter as well. */ (*new)->sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); +#if APR_HAVE_IPV6 + if ((*new)->sock == INVALID_SOCKET && ofamily == AF_UNSPEC) { + family = AF_INET; + (*new)->sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + } +#endif + if ((*new)->sock == INVALID_SOCKET) { return apr_get_netos_error(); } @@ -141,6 +159,11 @@ apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) return APR_SUCCESS; } +apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) +{ + return apr_create_socket(new, AF_INET, SOCK_STREAM, cont); +} + apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { int winhow; From 1efc3f30823c0abc7e21042d5ba91de9a341484f Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 16 Nov 2000 18:43:18 +0000 Subject: [PATCH 0767/7878] Get OS/2 closer to building with updated network_io API. Still to be done: build in ../unix/inet_ntop.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60745 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/networkio.h | 3 +++ network_io/os2/sockets.c | 26 ++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index a34edfbfbc8..facde795d9b 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -98,5 +98,8 @@ struct apr_pollfd_t { #define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ #define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ +const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); +int apr_inet_pton(int af, const char *src, void *dst); + #endif /* ! NETWORK_IO_H */ diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index fa1361827cc..a8082bdc952 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -123,8 +123,18 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) sizeof(apr_sockaddr_t)); } -apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) +apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, + apr_pool_t *cont) { + int family = ofamily; + +#if APR_HAVE_IPV6 + family = AF_INET6; +#else + family = AF_INET; +#endif + } + alloc_socket(new, cont); if ((*new) == NULL) { @@ -135,10 +145,17 @@ apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) } (*new)->socketdes = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); +#if APR_HAVE_IPV6 + if ((*new)->socketdes < 0 && ofamily == AF_UNSPEC) { + family = AF_INET; + (*new)->socketdes = socket(family, type, 0); + } +#endif + if ((*new)->socketdes < 0) { return APR_OS2_STATUS(sock_errno()); } - set_socket_vars(*new, AF_INET); + set_socket_vars(*new, family); (*new)->timeout = -1; (*new)->nonblock = FALSE; @@ -147,6 +164,11 @@ apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) return APR_SUCCESS; } +apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) +{ + return apr_create_socket(new, AF_INET, SOCK_STREAM, cont); +} + apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { if (shutdown(thesocket->socketdes, how) == 0) { From c45bc7f10ffa24394a072a5ce6cae93feae5c3c0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 16 Nov 2000 19:21:37 +0000 Subject: [PATCH 0768/7878] no need to check for inet_pton/inet_ntop as provided by the platform; we provide them ourselves git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60746 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure.in b/configure.in index e7a1b1a881e..a34021f394d 100644 --- a/configure.in +++ b/configure.in @@ -708,8 +708,6 @@ fi AC_SUBST(have_in_addr) AC_SUBST(file_as_socket) -AC_CHECK_FUNCS(inet_pton) -AC_CHECK_FUNCS(inet_ntop) APR_CHECK_SOCKADDR_SA_LEN APR_CHECK_GETHOSTBYNAME_NAS From adc9ab2bffdacb5330c5f25841c8a89cbce3a907 Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" <ake@apache.org> Date: Thu, 16 Nov 2000 20:43:40 +0000 Subject: [PATCH 0769/7878] add inet_ntop.c to WIN32 aprlib project to fix build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60747 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 15 +++++++++------ aprlib.dsp | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/apr.dsp b/apr.dsp index 1a5c7e016e3..c3cc6bf117f 100644 --- a/apr.dsp +++ b/apr.dsp @@ -26,6 +26,7 @@ CFG=aprlib - Win32 Debug # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe +RSC=rc.exe !IF "$(CFG)" == "aprlib - Win32 Release" @@ -39,12 +40,11 @@ CPP=cl.exe # PROP Output_Dir "LibR" # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -65,12 +65,11 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 # ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -265,6 +264,10 @@ SOURCE=.\include\arch\win32\locks.h # PROP Default_Filter "" # Begin Source File +SOURCE=.\network_io\unix\inet_ntop.c +# End Source File +# Begin Source File + SOURCE=.\include\arch\win32\networkio.h # End Source File # Begin Source File diff --git a/aprlib.dsp b/aprlib.dsp index 1a5c7e016e3..c3cc6bf117f 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -26,6 +26,7 @@ CFG=aprlib - Win32 Debug # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe +RSC=rc.exe !IF "$(CFG)" == "aprlib - Win32 Release" @@ -39,12 +40,11 @@ CPP=cl.exe # PROP Output_Dir "LibR" # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -65,12 +65,11 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 # ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -265,6 +264,10 @@ SOURCE=.\include\arch\win32\locks.h # PROP Default_Filter "" # Begin Source File +SOURCE=.\network_io\unix\inet_ntop.c +# End Source File +# Begin Source File + SOURCE=.\include\arch\win32\networkio.h # End Source File # Begin Source File From ef49d18b7dc9faaf92077724400f670afa9fa278 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 17 Nov 2000 02:33:00 +0000 Subject: [PATCH 0770/7878] Get exports.c symbols to compile even if the declaration is hidden in APR include file. Implement all exports.c symbols even if the package or function isn't available in the current configuration. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60748 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 13 +++++ threadproc/unix/thread.c | 93 ++++++++++++++++++++++++++++++++++++ threadproc/unix/threadpriv.c | 9 ++++ 3 files changed, 115 insertions(+) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 0297018bdf5..e862157d081 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -712,3 +712,16 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, #error or change APR_HAS_SENDFILE in apr.h to 0. #endif /* __linux__, __FreeBSD__, __HPUX__, _AIX, __MVS__, Tru64/OSF1 */ #endif /* APR_HAS_SENDFILE */ + +#if !APR_HAS_SENDFILE +/* currently, exports.c includes a reference to apr_sendfile() even if + * apr_sendfile() doesn't work on the platform; + * this dummy version is just to get exports.c to compile/link + */ +apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, + apr_int32_t flags) +{ + return APR_ENOTIMPL; +} +#endif diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 5f47c5f3938..896df25437a 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -233,3 +233,96 @@ apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, #endif /* HAVE_PTHREAD_H */ #endif /* APR_HAS_THREADS */ +#if !APR_HAS_THREADS + +apr_status_t apr_create_thread(apr_thread_t **new_thread, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_create_thread_private(apr_threadkey_t **key, void (*dest)(void *), + apr_pool_t *cont) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_delete_thread_private(apr_threadkey_t *key) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_get_os_thread(void); /* avoid warning for no prototype */ + +apr_status_t apr_get_os_thread(void) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_get_threadkeydata(void **data, const char *key, + apr_threadkey_t *threadkey) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_get_thread_private(void **new_mem, apr_threadkey_t *key) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_set_threaddata(void *data, const char *key, + apr_status_t (*cleanup)(void *), + apr_thread_t *thread) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_set_threadkeydata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_thread_detach(apr_thread_t *thd) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) +{ + return APR_ENOTIMPL; +} + +#endif diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 9fc5588c566..cb7a995fb86 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -144,3 +144,12 @@ apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, } #endif /* APR_HAVE_PTHREAD_H */ #endif /* APR_HAS_THREADS */ + +#if !APR_HAS_THREADS +apr_status_t apr_get_os_threadkey(void); /* avoid warning for no prototype */ + +apr_status_t apr_get_os_threadkey(void) +{ + return APR_ENOTIMPL; +} +#endif From 6874fc791d619b36541ad65b7dc21129c768d7f1 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Fri, 17 Nov 2000 02:52:34 +0000 Subject: [PATCH 0771/7878] OS/2: fix some minor breakage after latest changes to addresses. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60749 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index a8082bdc952..314f3f4b19f 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -128,6 +128,7 @@ apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, { int family = ofamily; + if (family == AF_UNSPEC) { #if APR_HAVE_IPV6 family = AF_INET6; #else @@ -191,7 +192,7 @@ apr_status_t apr_close_socket(apr_socket_t *thesocket) apr_status_t apr_bind(apr_socket_t *sock) { if (bind(sock->socketdes, - (struct sockaddr *)sock->local_addr->sa, + (struct sockaddr *)&sock->local_addr->sa, sock->local_addr->sa_len) == -1) return APR_OS2_STATUS(sock_errno()); else From ca37b600fff982c628b011ea369727926bc15e74 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 17 Nov 2000 03:45:03 +0000 Subject: [PATCH 0772/7878] APR: Change apr_connect() to take apr_sockaddr_t instead of hostname. Add generic apr_create_socket(). Add apr_getaddrinfo() for doing hostname resolution/address string parsing and building apr_sockaddr_t. Submitted by: David Reid Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60750 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 2 ++ include/apr_network_io.h | 19 +++++++++++- libapr.def | 2 ++ network_io/os2/sockets.c | 26 +++------------- network_io/unix/sa_common.c | 61 +++++++++++++++++++++++++++++++++++++ network_io/unix/sockets.c | 44 +++++++------------------- network_io/win32/sockets.c | 23 +++----------- test/client.c | 12 +++++--- test/testsf.c | 7 +++-- 9 files changed, 113 insertions(+), 83 deletions(-) diff --git a/aprlib.def b/aprlib.def index 048309f5dd4..62986718718 100644 --- a/aprlib.def +++ b/aprlib.def @@ -51,6 +51,8 @@ EXPORTS ; ; apr_network_io.h + apr_getaddrinfo @45 + apr_create_socket @46 apr_create_tcp_socket @47 apr_shutdown @48 apr_close_socket @49 diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 548974f41f5..2b2aae37595 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -265,7 +265,7 @@ apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, * APR assumes that the sockaddr_in in the apr_socket is * completely filled out. */ -apr_status_t apr_connect(apr_socket_t *sock, const char *hostname); +apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa); /** * Get name of a machine we are currently connected to. @@ -275,6 +275,23 @@ apr_status_t apr_connect(apr_socket_t *sock, const char *hostname); */ apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t *sock); +/** + * Create apr_sockaddr_t from hostname, address family, and port. + * @param sa The new apr_sockaddr_t. + * @param hostname The hostname or numeric address string to resolve/parse. + * @param family The address family to use, or AF_UNSPEC if the system should + * decide. + * @param port The port number. + * @param flags Special processing flags. + * @param p The pool for the apr_sockaddr_t and associated storage. + */ +apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, + const char *hostname, + apr_int32_t family, + apr_port_t port, + apr_int32_t flags, + apr_pool_t *p); + /** * Get name of the current machine * @param buf A buffer to store the hostname in. diff --git a/libapr.def b/libapr.def index 048309f5dd4..62986718718 100644 --- a/libapr.def +++ b/libapr.def @@ -51,6 +51,8 @@ EXPORTS ; ; apr_network_io.h + apr_getaddrinfo @45 + apr_create_socket @46 apr_create_tcp_socket @47 apr_shutdown @48 apr_close_socket @49 diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 314f3f4b19f..4323745b4f3 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -228,29 +228,10 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return APR_SUCCESS; } -apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { - struct hostent *hp; - - if (hostname != NULL) { - hp = gethostbyname(hostname); - - if ((sock->socketdes < 0) || (!sock->remote_addr)) { - return APR_ENOTSOCK; - } - if (!hp) { - if (h_errno == TRY_AGAIN) { - return EAGAIN; - } - return h_errno; - } - - memcpy((char *)&sock->remote_addr->sa.sin.sin_addr, hp->h_addr_list[0], - hp->h_length); - } - - if ((connect(sock->socketdes, (struct sockaddr *)&sock->remote_addr->sa.sin, - sock->remote_addr->sa_len) < 0) && + if ((connect(sock->socketdes, (struct sockaddr *)&sa->sa.sin, + sa->sa_len) < 0) && (sock_errno() != SOCEINPROGRESS)) { return APR_OS2_STATUS(sock_errno()); } @@ -258,6 +239,7 @@ apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) int namelen = sizeof(sock->local_addr->sa.sin); getsockname(sock->socketdes, (struct sockaddr *)&sock->local_addr->sa.sin, &namelen); + sock->remote_addr = sa; return APR_SUCCESS; } } diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index f1ebc8dfeca..7f2ab9612b0 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -171,3 +171,64 @@ apr_status_t apr_get_socket_inaddr(apr_in_addr_t *addr, apr_interface_e which, return APR_SUCCESS; } +static void set_sockaddr_vars(apr_sockaddr_t *addr, int family) +{ + addr->sa.sin.sin_family = family; + + if (family == AF_INET) { + addr->sa_len = sizeof(struct sockaddr_in); + addr->addr_str_len = 16; + addr->ipaddr_ptr = &(addr->sa.sin.sin_addr); + addr->ipaddr_len = sizeof(struct in_addr); + } +#if APR_HAVE_IPV6 + else if (family == AF_INET6) { + addr->sa_len = sizeof(struct sockaddr_in6); + addr->addr_str_len = 46; + addr->ipaddr_ptr = &(addr->sa.sin6.sin6_addr); + addr->ipaddr_len = sizeof(struct in6_addr); + } +#endif +} + +apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, + apr_int32_t family, apr_port_t port, + apr_int32_t flags, apr_pool_t *p) +{ + struct hostent *hp; + + (*sa) = (apr_sockaddr_t *)apr_pcalloc(p, sizeof(apr_sockaddr_t)); + if ((*sa) == NULL) + return APR_ENOMEM; + (*sa)->pool = p; + (*sa)->sa.sin.sin_family = AF_INET; /* we don't yet support IPv6 */ + (*sa)->sa.sin.sin_port = htons(port); + set_sockaddr_vars(*sa, (*sa)->sa.sin.sin_family); + + if (hostname != NULL) { +#ifndef GETHOSTBYNAME_HANDLES_NAS + if (*hostname >= '0' && *hostname <= '9' && + strspn(hostname, "0123456789.") == strlen(hostname)) { + (*sa)->sa.sin.sin_addr.s_addr = inet_addr(hostname); + (*sa)->sa_len = sizeof(struct sockaddr_in); + } + else { +#endif + hp = gethostbyname(hostname); + + if (!hp) { + return (h_errno + APR_OS_START_SYSERR); + } + + memcpy((char *)&(*sa)->sa.sin.sin_addr, hp->h_addr_list[0], + hp->h_length); + (*sa)->sa_len = sizeof(struct sockaddr_in); + (*sa)->ipaddr_len = hp->h_length; + +#ifndef GETHOSTBYNAME_HANDLES_NAS + } +#endif + } + (*sa)->hostname = apr_pstrdup(p, hostname); + return APR_SUCCESS; +} diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 5e9e4c5a875..f68863b5d6b 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -168,7 +168,7 @@ apr_status_t apr_bind(apr_socket_t *sock) (struct sockaddr *)&sock->local_addr->sa, sock->local_addr->sa_len) == -1) return errno; else { - /* XXX fix me for IPv6 */ + /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ if (sock->local_addr->sa.sin.sin_port == 0) { /* no need for ntohs() when comparing w/ 0 */ sock->local_port_unknown = 1; /* kernel got us an ephemeral port */ } @@ -226,57 +226,35 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return APR_SUCCESS; } -apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { - struct hostent *hp; - if ((sock->socketdes < 0) || (!sock->remote_addr)) { return APR_ENOTSOCK; } - if (hostname != NULL) { -#ifndef GETHOSTBYNAME_HANDLES_NAS - if (*hostname >= '0' && *hostname <= '9' && - strspn(hostname, "0123456789.") == strlen(hostname)) { - sock->remote_addr->sa.sin.sin_addr.s_addr = inet_addr(hostname); - } - else { -#endif - hp = gethostbyname(hostname); - - if (!hp) { - return (h_errno + APR_OS_START_SYSERR); - } - - /* XXX IPv6: move name resolution out of this function */ - memcpy((char *)&sock->remote_addr->sa.sin.sin_addr, hp->h_addr_list[0], - hp->h_length); - -#ifndef GETHOSTBYNAME_HANDLES_NAS - } -#endif - } - if ((connect(sock->socketdes, - (const struct sockaddr *)&sock->remote_addr->sa.sin, - sock->remote_addr->sa_len) < 0) && + if ((connect(sock->socketdes, + (const struct sockaddr *)&sa->sa.sin, + sa->sa_len) < 0) && (errno != EINPROGRESS)) { return errno; } else { - /* XXX IPv6 */ + sock->remote_addr = sa; + /* XXX IPv6 assumes sin_port and sin6_port at same offset */ if (sock->local_addr->sa.sin.sin_port == 0) { /* connect() got us an ephemeral port */ sock->local_port_unknown = 1; } - /* XXX IPv6 */ - if (sock->local_addr->sa.sin.sin_addr.s_addr == 0) { + /* XXX IPv6 to be handled better later... */ + if (sock->local_addr->sa.sin.sin_family == AF_INET6 || + sock->local_addr->sa.sin.sin_addr.s_addr == 0) { /* not bound to specific local interface; connect() had to assign * one for the socket */ sock->local_interface_unknown = 1; } #ifndef HAVE_POLL - sock->connected=1; + sock->connected=1; #endif return APR_SUCCESS; } diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 25ba7a0c299..e9cf5449a97 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -258,9 +258,8 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return APR_SUCCESS; } -apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { - struct hostent *hp; apr_status_t lasterror; fd_set temp; @@ -268,23 +267,8 @@ apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) return APR_ENOTSOCK; } - if (hostname != NULL) { - if (*hostname >= '0' && *hostname <= '9' && - strspn(hostname, "0123456789.") == strlen(hostname)) { - sock->remote_addr->sa.sin.sin_addr.s_addr = inet_addr(hostname); - } - else { - hp = gethostbyname(hostname); - if (!hp) { - return apr_get_netos_error(); - } - memcpy((char *)&sock->remote_addr->sa.sin.sin_addr, hp->h_addr_list[0], - hp->h_length); - } - } - - if (connect(sock->sock, (const struct sockaddr *)&sock->remote_addr->sa.sin, - sock->remote_addr->sa_len) == SOCKET_ERROR) { + if (connect(sock->sock, (const struct sockaddr *)&sa->sa.sin, + sa->sa_len) == SOCKET_ERROR) { lasterror = apr_get_netos_error(); if (lasterror != APR_FROM_OS_ERROR(WSAEWOULDBLOCK)) { return lasterror; @@ -297,6 +281,7 @@ apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) } } /* connect was OK .. amazing */ + sock->remote_addr = sa; if (sock->local_addr->sa.sin.sin_port == 0) { sock->local_port_unknown = 1; } diff --git a/test/client.c b/test/client.c index beb78ebdb10..9828f08a760 100644 --- a/test/client.c +++ b/test/client.c @@ -73,6 +73,7 @@ int main(int argc, char *argv[]) char *dest = "127.0.0.1"; apr_port_t local_port, remote_port; apr_interval_time_t read_timeout = -1; + apr_sockaddr_t *destsa; setbuf(stdout, NULL); if (argc > 1) { @@ -115,17 +116,18 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK\n"); } - fprintf(stdout, "\tClient: Setting port for socket......."); - if (apr_set_port(sock, APR_REMOTE, 8021) != APR_SUCCESS) { + fprintf(stdout,"\tClient: Making socket address..............."); + if (apr_getaddrinfo(&destsa, dest, AF_INET, 8021, 0, context) != APR_SUCCESS) { apr_close_socket(sock); - fprintf(stderr, "Couldn't set the port correctly\n"); + fprintf(stdout, "Failed!\n"); + fprintf(stdout, "Couldn't create a socket address structure for %s\n", dest); exit(-1); } - fprintf(stdout, "OK\n"); + fprintf(stdout,"OK\n"); fprintf(stdout, "\tClient: Connecting to socket......."); - stat = apr_connect(sock, dest); + stat = apr_connect(sock, destsa); if (stat != APR_SUCCESS) { apr_close_socket(sock); diff --git a/test/testsf.c b/test/testsf.c index 77fb8020abd..37b211803c7 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -205,6 +205,7 @@ static int client(client_socket_mode_t socket_mode) apr_pollfd_t *pfd; apr_int32_t nsocks; int i; + apr_sockaddr_t *destsa; apr_setup(&p, &sock); create_testfile(p, TESTFILE); @@ -217,15 +218,15 @@ static int client(client_socket_mode_t socket_mode) exit(1); } - rv = apr_set_port(sock, APR_REMOTE, TESTSF_PORT); + rv = apr_getaddrinfo(&destsa, "127.0.0.1", AF_INET, TESTSF_PORT, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_set_remote_port()->%d/%s\n", + fprintf(stderr, "apr_getaddrinfo()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = apr_connect(sock, "127.0.0.1"); + rv = apr_connect(sock, destsa); if (rv != APR_SUCCESS) { fprintf(stderr, "apr_connect()->%d/%s\n", rv, From 02b6c8cb63b45ce02ba8fa9a089173b895c3e2df Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 17 Nov 2000 04:19:18 +0000 Subject: [PATCH 0773/7878] Add a prototype for the dummy version of APR_SENDFILE, since the real prototype is hidden in apr_network_io.h when !APR_HAS_SENDFILE. This avoids a warning with gcc/--with-maintainer-mode. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60751 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index e862157d081..914d34cb931 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -718,6 +718,10 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, * apr_sendfile() doesn't work on the platform; * this dummy version is just to get exports.c to compile/link */ +apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, + apr_int32_t flags); /* avoid warning for no proto */ + apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags) From 63d8fe6aa1fcd3944b9b11aaccd9615a09bb3c74 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Fri, 17 Nov 2000 07:56:52 +0000 Subject: [PATCH 0774/7878] include/apr_getopt.h: *) Added new struct and typedef for apr_getopt_long_t. *) Added prototype and inline documentation for new apr_getopt_long function. misc/unix/getopt.c: *) Added new apr_getopt_long function to handle long option processing. *) Added static method pretty_path() to avoid duplicating code *) modified apr_getopt to use pretty_path. Removed cut-and-paste code as well as char *p. Submitted by: B. W. Fitzpatrick <fitz@red-bean.com> Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60752 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 57 ++++++++++++++++++++-- misc/unix/getopt.c | 112 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 154 insertions(+), 15 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 91be72c28dd..76d13e2aa38 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -82,6 +82,20 @@ struct apr_getopt_t { char const* place; }; +typedef struct apr_getopt_long_t apr_getopt_long_t; + +/* structure representing a single longopt */ +struct apr_getopt_long_t { + /** the name of the long argument (sans "--") */ + const char *name; + /** 0 for no arg, 1 for arg */ + int has_arg; + /** Either the short option char that this option corresponds to + * or a unique integer > 255 + */ + int val; +}; + /** * Initialize the arguments for parsing by apr_getopt(). * @param cont The pool to operate on @@ -92,7 +106,7 @@ struct apr_getopt_t { * @deffunc apr_status_t apr_initopt(apr_getopt_t **os, apr_pool_t *cont,int argc, char *const *argv) */ APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, - int argc, char *const *argv); + int argc, char *const *argv); /** * Parse the options initialized by apr_initopt(). @@ -112,8 +126,43 @@ APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, * @deffunc apr_status_t apr_getopt(apr_getopt_t *os, const char *opts, char *optch, const char **optarg) */ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, - char *optch, const char **optarg); - -#endif /* ! APR_GETOPT_H */ + char *optch, const char **optarg); +/** + * Parse the options initialized by apr_initopt(), accepting long + * options beginning with "--" in addition to single-character + * options beginning with "-" (which are passed along to apr_getopt). + * + * Long options are accepted in both "--foo bar" and well as + * "--foo=bar" format + * + * End of argument processing if we encounter "--" or any option that + * doesn't start with "-" or "--". + * + * @param os The apr_opt_t structure returned by apr_initopt() + * @param opts A string of acceptable single-character options to the + * program. Characters followed by ":" are required to have + * an argument associated + * @param longopts A pointer to an array of apr_long_option_t structures, which + * can be initialized with { "name", has_args, val }. has_args + * is nonzero if the option requires an argument. A structure + * with a NULL name terminates the list + * @param optval The next option character parsed, or the value of "optval" + * from the appropriate apr_long_option_t structure if + * the next option is a long option. + * @param optarg The argument following the option, if any + * @tip There are four potential status values on exit. They are: + * <PRE> + * APR_EOF -- No more options to parse + * APR_BADCH -- Found a bad option character + * APR_BADARG -- No argument followed @parameter: + * APR_SUCCESS -- The next option was found. + * </PRE> + * @deffunc apr_status_t apr_getopt_long(apr_getopt_t *os, const char *opts, const apr_getopt_long_t *longopts, int *optval, const char **optarg) */ +APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, + const char *opts, + const apr_getopt_long_t *long_opts, + int *optval, + const char **optarg); +#endif /* ! APR_GETOPT_H */ diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index f3a561f6c92..2f553852462 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -32,9 +32,21 @@ */ #include "misc.h" +#include "apr_strings.h" #define EMSG "" +/* Regardless of what we're invoked as, just print out the last part + * of the path */ +static const char *pretty_path (const char *name) +{ + const char *p; + if (!(p = strrchr(name, '/'))) + return p; + else + return ++p; +} + APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, int argc, char *const *argv) { @@ -51,7 +63,6 @@ APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, char *optch, const char **optarg) { - const char *p; const char *oli; /* option letter list index */ if (os->reset || !*os->place) { /* update scanning pointer */ @@ -81,12 +92,9 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, if (!*os->place) ++os->ind; if (os->err && *opts != ':') { - if (!(p = strrchr(*os->argv, '/'))) - p = *os->argv; - else - ++p; (void) fprintf(stderr, - "%s: illegal option -- %c\n", p, os->opt); + "%s: illegal option -- %c\n", + pretty_path(*os->argv), os->opt); } *optch = os->opt; return (APR_BADCH); @@ -106,13 +114,9 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, return (APR_BADARG); } if (os->err) { - if (!(p = strrchr(*os->argv, '/'))) - p = *os->argv; - else - ++p; (void) fprintf(stderr, "%s: option requires an argument -- %c\n", - p, os->opt); + pretty_path(*os->argv), os->opt); } *optch = os->opt; return (APR_BADCH); @@ -126,4 +130,90 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, + const char *opts, + const apr_getopt_long_t *long_opts, + int *optval, + const char **optarg) + +{ + const apr_getopt_long_t *ptr; + const char *opt = os->argv[os->ind]; + const char *arg = os->argv[os->ind +1]; + int arg_index_incr = 1; + + /* Finished processing opts */ + if (os->ind >= os->argc) + return APR_EOF; + + /* End of options processing if we encounter "--" */ + if (strcmp(opt, "--") == 0) + return APR_EOF; + + /* + * End of options processing if we encounter something that + * doesn't start with "-" or "--" (it's not an option if we hit it + * here, it's an argument) + */ + if (*opt != '-') + return APR_EOF; + + if ((os->ind + 1) >= os->argc) + arg = NULL; + + /* Handle --foo=bar style opts */ + if (strchr(opt, '=')) { + const char *index = strchr(opt, '=') + 1; + opt = apr_pstrndup(os->cont, opt, ((index - opt) - 1)); + if (*index != '\0') /* account for "--foo=" */ + arg = apr_pstrdup(os->cont, index); + arg_index_incr = 0; + } + + /* If it's a longopt */ + if (opt[1] == '-') { + /* see if it's in our array of long opts */ + for (ptr = long_opts; ptr->name; ptr++) { + if (strcmp((opt + 2), ptr->name) == 0) { /* it's in the array */ + if (ptr->has_arg) { + if (((os->ind + 1) >= os->argc) + && (arg == NULL)) { + fprintf(stderr, + "%s: option requires an argument: %s\n", + pretty_path(*os->argv), opt); + return APR_BADARG; + } + + /* If we make it here, then we should be ok. */ + *optarg = arg; + os->ind += arg_index_incr; + } + else { /* has no arg */ + *optarg = NULL; + } + *optval = ptr->val; + ++os->ind; + return APR_SUCCESS; + } + } + + /* If we get here, then we don't have the longopt in our + * longopts array + */ + fprintf(stderr, "%s: illegal option: %s\n", + pretty_path(*os->argv), opt); + return APR_BADCH; + } + + { /* otherwise, apr_getopt gets it. */ + char optch; + apr_status_t status; + status = apr_getopt (os, opts, &optch, optarg); + *optval = optch; + return status; + } +} + + + From 832e71b39d5f84f8a8184e06c3ca2ba463b400ba Mon Sep 17 00:00:00 2001 From: Greg Ames <gregames@apache.org> Date: Fri, 17 Nov 2000 16:16:03 +0000 Subject: [PATCH 0775/7878] Make it clear that the len parm on apr_sendfile only applies to data from the file, not header/trailer bytes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60753 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 2b2aae37595..8768d314ba9 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -365,7 +365,7 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, * @param file The open file from which to read * @param hdtr A structure containing the headers and trailers to send * @param offset Offset into the file where we should begin writing - * @param len Number of bytes to send + * @param len Number of bytes to send from the file * @param flags APR flags that are mapped to OS specific flags * @tip This functions acts like a blocking write by default. To change * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. From e2c2d7dcbbffe89a6f3b19533d1d49a7513613fd Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 17 Nov 2000 21:15:14 +0000 Subject: [PATCH 0776/7878] Remove the auto-generated image tag from the top of the index files, since we don't have an image to use there. Also change all spaces in the file names to '_'. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60754 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/default.pl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/helpers/default.pl b/helpers/default.pl index e11aee7d046..204c9c1e71b 100644 --- a/helpers/default.pl +++ b/helpers/default.pl @@ -13,7 +13,7 @@ ## simply change these variables $project_name = '[Apache Portable RunTime]'; -$company_logo = '<img src="../images/ScanDocBig.jpg">'; # change this to an image tag. +#$company_logo = '<img src="../images/ScanDocBig.jpg">'; # change this to an image tag. $copyright = '&copy 2000 [Apache Software Foundation]'; $image_directory = "../images/"; $bullet1_image = $image_directory . "ball1.gif"; @@ -66,19 +66,19 @@ foreach $p (packages()) { $_ = $p->url; - s/\s/%20/g; + s/\s/_/g; >><a href="$_" target="Documentation"><b>$(p.name)</b></a><br> <dir> << foreach $e ($p->classes()) { $_ = $e->url; - s/\s/%20/g; + s/\s/_/g; >><li><a href="$_" target="Documentation">$(e.fullname)</a> << } foreach $e ($p->globals()) { $_ = $e->url; - s/\s/%20/g; + s/\s/_/g; >><li><a href="$_" target="Documentation">$(e.fullname)</a> << } @@ -115,7 +115,7 @@ foreach $p (packages()) { $_ = $p->url; - s/\s/%20/g; + s/\s/_/g; >><a href = "$_">$(p.name)</a><br> << } @@ -180,7 +180,9 @@ my $p; foreach $p (packages()) { - file $p->name() . ".html"; + $_ = $p->name; + s/\s/_/g; + file $_ . ".html"; >><html> <head> <title>$project_name -- $(p.name)</title> From 2200ff4d4622360e56b7f8c856e79e59cd1a3726 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 18 Nov 2000 03:42:25 +0000 Subject: [PATCH 0777/7878] Commit the template that removes all spaces from the file names. The files are created with _ instead of spaces now. This also fixes all references to the files in the html. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60755 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/default.pl | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/helpers/default.pl b/helpers/default.pl index 204c9c1e71b..01dfa64edb9 100644 --- a/helpers/default.pl +++ b/helpers/default.pl @@ -200,12 +200,16 @@ ## Generate class and member index at the top of the file. foreach $c ($p->classes()) { + $_ = $c->url; + s/\s/_/g; >><h3><img src="$bullet1_image" width=18 height=17 align=texttop> - <a href="$(c.url)">$(c.fullname)</h3></a> + <a href="$_">$(c.fullname)</h3></a> <ul> << foreach $m ($c->members()) { - >><li><a href="$(m.url)">$(m.longname)</a> + $_ = $m->url; + s/\s/_/g; + >><li><a href="$_">$(m.longname)</a> << } >></ul> @@ -259,7 +263,9 @@ foreach $b ($c->baseclasses()) { my $name = $b->name(); if ($url = $b->url()) { - push @t, "<a href=\"$url\">$name</a>"; + $_ = $url; + s/\s/_/g; + push @t, "<a href=\"$_\">$name</a>"; } else { push @t, $name; } } @@ -276,7 +282,9 @@ foreach $s ($c->subclasses()) { my $name = $s->name(); if ($url = $s->url()) { - push @t, "<a href=\"$url\">$name</a>"; + $_ = $url; + s/\s/_/g; + push @t, "<a href=\"$_\">$name</a>"; } else { push @t, $name; } } @@ -299,7 +307,9 @@ foreach $a ($c->seealso()) { my $name = $a->name(); if ($url = $a->url()) { - push @r, "<a href=\"$url\">$name</a>"; + $_ = $url; + s/\s/_/g; + push @r, "<a href=\"$_\">$name</a>"; } else { push @r, $name; } } @@ -313,7 +323,9 @@ print "<h2>Member Index</h2>\n"; print "<ul>"; foreach $m ($c->members()) { - >><li><a href="$(m.url)">$(m.fullname)</a> + $_ = $m->url; + s/\s/_/g; + >><li><a href="$_">$(m.fullname)</a> << } >></ul><< @@ -431,7 +443,9 @@ sub function { foreach $a ($f->seealso()) { my $name = $a->name(); if ($url = $a->url()) { - push @r, "<a href=\"$url\">$name</a>"; + $_ = $url; + s/\s/_/g; + push @r, "<a href=\"$_\">$name</a>"; } else { push @r, $name; } } @@ -466,9 +480,11 @@ sub variable { << $comma = 0; foreach $a ($v->seealso()) { + $_ = $a->url; + s/\s/_/g; if ($comma) { print ","; } $comma = 1; - >><a href="$(a.url)">$(a.name)</a> + >><a href="$_">$(a.name)</a> << } >><p> From e667916e077601ea0575b2f9c91bd59626da197e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 18 Nov 2000 13:28:12 +0000 Subject: [PATCH 0778/7878] Fix a small cast that is ment to surpress warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60756 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_ntop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index 5bc90bcd279..cb3f418ab25 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -49,7 +49,7 @@ #define EAFNOSUPPORT WSAEAFNOSUPPORT #endif -#define SPRINTF(x) ((size_t)sprintf x) +#define SPRINTF(x) ((apr_size_t)sprintf x) /* * WARNING: Don't even consider trying to compile this on a system where From bbf8b20d922cb9583796fc5cd29444bb2987cc10 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 18 Nov 2000 14:58:21 +0000 Subject: [PATCH 0779/7878] As promised, and discussed on new-httpd, goodbye ordinals. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60757 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 452 ++++++++++++++++++++++++++--------------------------- libapr.def | 452 ++++++++++++++++++++++++++--------------------------- 2 files changed, 452 insertions(+), 452 deletions(-) diff --git a/aprlib.def b/aprlib.def index 62986718718..36c0c8cb82c 100644 --- a/aprlib.def +++ b/aprlib.def @@ -6,144 +6,144 @@ DESCRIPTION '' EXPORTS ; Add new API calls to the end of this list. ; apr_file_io.h - apr_open @1 - apr_close @2 - apr_remove_file @3 - apr_rename_file @4 - apr_eof @5 - apr_read @6 - apr_write @7 - apr_writev @8 - apr_full_read @9 - apr_full_write @10 - apr_putc @11 - apr_getc @12 - apr_ungetc @13 - apr_fgets @14 - apr_puts @15 - apr_flush @16 - apr_dupfile @17 - apr_getfileinfo @18 - apr_setfileperms @19 - apr_stat @20 - apr_lstat @21 - apr_seek @22 - apr_opendir @23 - apr_closedir @24 - apr_readdir @25 - apr_rewinddir @26 - apr_make_dir @27 - apr_remove_dir @28 - apr_dir_entry_size @29 - apr_dir_entry_mtime @30 - apr_dir_entry_ftype @31 - apr_get_dir_filename @32 -; apr_get_filename @33 - apr_create_pipe @34 -; apr_create_namedpipe @35 -; apr_set_pipe_timeout @36 - apr_get_filedata @37 - apr_set_filedata @38 - apr_get_os_file @39 - apr_put_os_file @40 - apr_get_os_dir @41 - apr_fprintf @42 + apr_open + apr_close + apr_remove_file + apr_rename_file + apr_eof + apr_read + apr_write + apr_writev + apr_full_read + apr_full_write + apr_putc + apr_getc + apr_ungetc + apr_fgets + apr_puts + apr_flush + apr_dupfile + apr_getfileinfo + apr_setfileperms + apr_stat + apr_lstat + apr_seek + apr_opendir + apr_closedir + apr_readdir + apr_rewinddir + apr_make_dir + apr_remove_dir + apr_dir_entry_size + apr_dir_entry_mtime + apr_dir_entry_ftype + apr_get_dir_filename +; apr_get_filename + apr_create_pipe +; apr_create_namedpipe +; apr_set_pipe_timeout + apr_get_filedata + apr_set_filedata + apr_get_os_file + apr_put_os_file + apr_get_os_dir + apr_fprintf ; ; apr_network_io.h - apr_getaddrinfo @45 - apr_create_socket @46 - apr_create_tcp_socket @47 - apr_shutdown @48 - apr_close_socket @49 - apr_bind @50 - apr_listen @51 - apr_accept @52 - apr_connect @53 - apr_get_hostname @54 - apr_gethostname @55 - apr_send @56 - apr_recv @57 - apr_setsocketopt @58 - apr_sendv @59 - apr_sendfile @60 - apr_setup_poll @61 - apr_poll @62 - apr_add_poll_socket @63 - apr_get_revents @64 - apr_get_socketdata @65 - apr_set_socketdata @66 - apr_get_polldata @67 - apr_set_polldata @68 - apr_put_os_sock @69 - apr_get_os_sock @70 - apr_remove_poll_socket @71 - apr_clear_poll_sockets @72 - apr_getsocketopt @73 - apr_get_ipaddr @74 - apr_set_ipaddr @75 - apr_get_port @76 - apr_set_port @77 - apr_get_inaddr @78 - apr_get_socket_inaddr @79 + apr_getaddrinfo + apr_create_socket + apr_create_tcp_socket + apr_shutdown + apr_close_socket + apr_bind + apr_listen + apr_accept + apr_connect + apr_get_hostname + apr_gethostname + apr_send + apr_recv + apr_setsocketopt + apr_sendv + apr_sendfile + apr_setup_poll + apr_poll + apr_add_poll_socket + apr_get_revents + apr_get_socketdata + apr_set_socketdata + apr_get_polldata + apr_set_polldata + apr_put_os_sock + apr_get_os_sock + apr_remove_poll_socket + apr_clear_poll_sockets + apr_getsocketopt + apr_get_ipaddr + apr_set_ipaddr + apr_get_port + apr_set_port + apr_get_inaddr + apr_get_socket_inaddr ; ; ; apr_thread_proc.h - apr_createprocattr_init @80 - apr_setprocattr_io @81 - apr_setprocattr_dir @82 - apr_setprocattr_cmdtype @83 - apr_setprocattr_detach @84 - apr_create_process @85 -; -; -; - apr_wait_proc @89 - apr_kill @90 - apr_create_threadattr @91 - apr_setthreadattr_detach @92 - apr_getthreadattr_detach @93 - apr_create_thread @94 - apr_thread_exit @95 - apr_thread_join @96 - apr_thread_detach @97 -; - apr_create_thread_private @99 - apr_get_thread_private @100 - apr_set_thread_private @101 - apr_delete_thread_private @102 - apr_get_threaddata @103 - apr_set_threaddata @104 - apr_get_threadkeydata @105 - apr_set_threadkeydata @106 -; -; -; - apr_get_os_thread @110 - apr_get_os_threadkey @111 + apr_createprocattr_init + apr_setprocattr_io + apr_setprocattr_dir + apr_setprocattr_cmdtype + apr_setprocattr_detach + apr_create_process +; +; +; + apr_wait_proc + apr_kill + apr_create_threadattr + apr_setthreadattr_detach + apr_getthreadattr_detach + apr_create_thread + apr_thread_exit + apr_thread_join + apr_thread_detach +; + apr_create_thread_private + apr_get_thread_private + apr_set_thread_private + apr_delete_thread_private + apr_get_threaddata + apr_set_threaddata + apr_get_threadkeydata + apr_set_threadkeydata +; +; +; + apr_get_os_thread + apr_get_os_threadkey - apr_create_pool @114 + apr_create_pool ; ; ; - apr_get_userdata @118 - apr_set_userdata @119 - apr_initialize @120 -; apr_make_time @127 - apr_ansi_time_to_apr_time @127 - apr_now @128 - apr_explode_gmt @129 - apr_explode_localtime @130 - apr_implode_time @131 - apr_get_os_imp_time @132 - apr_get_os_exp_time @133 - apr_put_os_imp_time @134 - apr_put_os_exp_time @135 - apr_ctime @136 - apr_rfc822_date @137 - apr_strftime @138 + apr_get_userdata + apr_set_userdata + apr_initialize +; apr_make_time + apr_ansi_time_to_apr_time + apr_now + apr_explode_gmt + apr_explode_localtime + apr_implode_time + apr_get_os_imp_time + apr_get_os_exp_time + apr_put_os_imp_time + apr_put_os_exp_time + apr_ctime + apr_rfc822_date + apr_strftime ; ; ; @@ -154,120 +154,120 @@ EXPORTS ; ; ; - apr_MD5Final @150 - apr_MD5Init @151 - apr_MD5Update @152 - apr_cpystrn @153 - apr_register_cleanup @154 - apr_kill_cleanup @155 - apr_fnmatch @156 - apr_is_fnmatch @157 - apr_MD5Encode @158 - apr_validate_password @159 + apr_MD5Final + apr_MD5Init + apr_MD5Update + apr_cpystrn + apr_register_cleanup + apr_kill_cleanup + apr_fnmatch + apr_is_fnmatch + apr_MD5Encode + apr_validate_password ; ; apr_pools.h - apr_make_sub_pool @160 - apr_init_alloc @161 - apr_clear_pool @162 - apr_destroy_pool @163 - apr_bytes_in_pool @164 - apr_bytes_in_free_blocks @165 - apr_palloc @166 - apr_pcalloc @167 - apr_pstrdup @168 - apr_pstrndup @169 - apr_pstrcat @170 - apr_pvsprintf @171 - apr_psprintf @172 + apr_make_sub_pool + apr_init_alloc + apr_clear_pool + apr_destroy_pool + apr_bytes_in_pool + apr_bytes_in_free_blocks + apr_palloc + apr_pcalloc + apr_pstrdup + apr_pstrndup + apr_pstrcat + apr_pvsprintf + apr_psprintf ; ; apr_tables.h - apr_make_array @173 - apr_push_array @174 - apr_array_cat @175 - apr_copy_array @176 - apr_copy_array_hdr @177 - apr_append_arrays @178 - apr_array_pstrcat @179 - apr_make_table @180 - apr_copy_table @181 - apr_clear_table @182 - apr_table_get @183 - apr_table_set @184 - apr_table_setn @185 - apr_table_unset @186 - apr_table_merge @187 - apr_table_mergen @188 - apr_table_add @189 - apr_table_addn @190 - apr_overlay_tables @191 - apr_table_do @192 - apr_table_vdo @193 - apr_overlap_tables @194 -; -; - apr_run_cleanup @195 - apr_cleanup_for_exec @196 - apr_null_cleanup @197 - apr_note_subprocess @198 -; - apr_vformatter @199 - apr_snprintf @200 - apr_vsnprintf @201 - apr_getpass @202 + apr_make_array + apr_push_array + apr_array_cat + apr_copy_array + apr_copy_array_hdr + apr_append_arrays + apr_array_pstrcat + apr_make_table + apr_copy_table + apr_clear_table + apr_table_get + apr_table_set + apr_table_setn + apr_table_unset + apr_table_merge + apr_table_mergen + apr_table_add + apr_table_addn + apr_overlay_tables + apr_table_do + apr_table_vdo + apr_overlap_tables +; +; + apr_run_cleanup + apr_cleanup_for_exec + apr_null_cleanup + apr_note_subprocess +; + apr_vformatter + apr_snprintf + apr_vsnprintf + apr_getpass - apr_tokenize_to_argv @204 - apr_filename_of_pathname @205 - apr_get_remote_name @206 - apr_get_local_name @207 + apr_tokenize_to_argv + apr_filename_of_pathname + apr_get_remote_name + apr_get_local_name - apr_open_stderr @216 - apr_get_pipe_timeout @217 - apr_set_pipe_timeout @218 - apr_terminate @219 - apr_dso_load @220 - apr_dso_unload @221 - apr_dso_sym @222 - apr_collapse_spaces @223 - apr_month_snames @224 - apr_day_snames @225 - apr_canonical_error @226 - apr_strerror @227 - apr_generate_random_bytes @228 - apr_strnatcmp @229 - apr_strnatcasecmp @230 - apr_dso_error @231 + apr_open_stderr + apr_get_pipe_timeout + apr_set_pipe_timeout + apr_terminate + apr_dso_load + apr_dso_unload + apr_dso_sym + apr_collapse_spaces + apr_month_snames + apr_day_snames + apr_canonical_error + apr_strerror + apr_generate_random_bytes + apr_strnatcmp + apr_strnatcasecmp + apr_dso_error ; ; apr_hash.h - apr_make_hash @232 - apr_hash_set @233 - apr_hash_get @234 - apr_hash_first @235 - apr_hash_next @236 - apr_hash_this @237 + apr_make_hash + apr_hash_set + apr_hash_get + apr_hash_first + apr_hash_next + apr_hash_this ; ; apr_lock.h - apr_create_lock @240 - apr_lock @241 - apr_unlock @242 - apr_destroy_lock @243 - apr_child_init_lock @244 - apr_get_lockdata @245 - apr_set_lockdata @246 - apr_get_os_lock @247 + apr_create_lock + apr_lock + apr_unlock + apr_destroy_lock + apr_child_init_lock + apr_get_lockdata + apr_set_lockdata + apr_get_os_lock ; ; apr_uuid.h - apr_format_uuid @248 - apr_parse_uuid @249 - apr_get_uuid @250 + apr_format_uuid + apr_parse_uuid + apr_get_uuid ; Moved out of the way for Bill Stoddard's reorg ; ; apr_getopt.h - apr_getopt @298 - apr_initopt @299 -; apr_opterr @122 DATA -; apr_optind @123 DATA -; apr_optopt @124 DATA -; apr_optreset @125 DATA -; apr_optarg @126 DATA + apr_getopt + apr_initopt +; apr_opterr +; apr_optind +; apr_optopt +; apr_optreset +; apr_optarg diff --git a/libapr.def b/libapr.def index 62986718718..36c0c8cb82c 100644 --- a/libapr.def +++ b/libapr.def @@ -6,144 +6,144 @@ DESCRIPTION '' EXPORTS ; Add new API calls to the end of this list. ; apr_file_io.h - apr_open @1 - apr_close @2 - apr_remove_file @3 - apr_rename_file @4 - apr_eof @5 - apr_read @6 - apr_write @7 - apr_writev @8 - apr_full_read @9 - apr_full_write @10 - apr_putc @11 - apr_getc @12 - apr_ungetc @13 - apr_fgets @14 - apr_puts @15 - apr_flush @16 - apr_dupfile @17 - apr_getfileinfo @18 - apr_setfileperms @19 - apr_stat @20 - apr_lstat @21 - apr_seek @22 - apr_opendir @23 - apr_closedir @24 - apr_readdir @25 - apr_rewinddir @26 - apr_make_dir @27 - apr_remove_dir @28 - apr_dir_entry_size @29 - apr_dir_entry_mtime @30 - apr_dir_entry_ftype @31 - apr_get_dir_filename @32 -; apr_get_filename @33 - apr_create_pipe @34 -; apr_create_namedpipe @35 -; apr_set_pipe_timeout @36 - apr_get_filedata @37 - apr_set_filedata @38 - apr_get_os_file @39 - apr_put_os_file @40 - apr_get_os_dir @41 - apr_fprintf @42 + apr_open + apr_close + apr_remove_file + apr_rename_file + apr_eof + apr_read + apr_write + apr_writev + apr_full_read + apr_full_write + apr_putc + apr_getc + apr_ungetc + apr_fgets + apr_puts + apr_flush + apr_dupfile + apr_getfileinfo + apr_setfileperms + apr_stat + apr_lstat + apr_seek + apr_opendir + apr_closedir + apr_readdir + apr_rewinddir + apr_make_dir + apr_remove_dir + apr_dir_entry_size + apr_dir_entry_mtime + apr_dir_entry_ftype + apr_get_dir_filename +; apr_get_filename + apr_create_pipe +; apr_create_namedpipe +; apr_set_pipe_timeout + apr_get_filedata + apr_set_filedata + apr_get_os_file + apr_put_os_file + apr_get_os_dir + apr_fprintf ; ; apr_network_io.h - apr_getaddrinfo @45 - apr_create_socket @46 - apr_create_tcp_socket @47 - apr_shutdown @48 - apr_close_socket @49 - apr_bind @50 - apr_listen @51 - apr_accept @52 - apr_connect @53 - apr_get_hostname @54 - apr_gethostname @55 - apr_send @56 - apr_recv @57 - apr_setsocketopt @58 - apr_sendv @59 - apr_sendfile @60 - apr_setup_poll @61 - apr_poll @62 - apr_add_poll_socket @63 - apr_get_revents @64 - apr_get_socketdata @65 - apr_set_socketdata @66 - apr_get_polldata @67 - apr_set_polldata @68 - apr_put_os_sock @69 - apr_get_os_sock @70 - apr_remove_poll_socket @71 - apr_clear_poll_sockets @72 - apr_getsocketopt @73 - apr_get_ipaddr @74 - apr_set_ipaddr @75 - apr_get_port @76 - apr_set_port @77 - apr_get_inaddr @78 - apr_get_socket_inaddr @79 + apr_getaddrinfo + apr_create_socket + apr_create_tcp_socket + apr_shutdown + apr_close_socket + apr_bind + apr_listen + apr_accept + apr_connect + apr_get_hostname + apr_gethostname + apr_send + apr_recv + apr_setsocketopt + apr_sendv + apr_sendfile + apr_setup_poll + apr_poll + apr_add_poll_socket + apr_get_revents + apr_get_socketdata + apr_set_socketdata + apr_get_polldata + apr_set_polldata + apr_put_os_sock + apr_get_os_sock + apr_remove_poll_socket + apr_clear_poll_sockets + apr_getsocketopt + apr_get_ipaddr + apr_set_ipaddr + apr_get_port + apr_set_port + apr_get_inaddr + apr_get_socket_inaddr ; ; ; apr_thread_proc.h - apr_createprocattr_init @80 - apr_setprocattr_io @81 - apr_setprocattr_dir @82 - apr_setprocattr_cmdtype @83 - apr_setprocattr_detach @84 - apr_create_process @85 -; -; -; - apr_wait_proc @89 - apr_kill @90 - apr_create_threadattr @91 - apr_setthreadattr_detach @92 - apr_getthreadattr_detach @93 - apr_create_thread @94 - apr_thread_exit @95 - apr_thread_join @96 - apr_thread_detach @97 -; - apr_create_thread_private @99 - apr_get_thread_private @100 - apr_set_thread_private @101 - apr_delete_thread_private @102 - apr_get_threaddata @103 - apr_set_threaddata @104 - apr_get_threadkeydata @105 - apr_set_threadkeydata @106 -; -; -; - apr_get_os_thread @110 - apr_get_os_threadkey @111 + apr_createprocattr_init + apr_setprocattr_io + apr_setprocattr_dir + apr_setprocattr_cmdtype + apr_setprocattr_detach + apr_create_process +; +; +; + apr_wait_proc + apr_kill + apr_create_threadattr + apr_setthreadattr_detach + apr_getthreadattr_detach + apr_create_thread + apr_thread_exit + apr_thread_join + apr_thread_detach +; + apr_create_thread_private + apr_get_thread_private + apr_set_thread_private + apr_delete_thread_private + apr_get_threaddata + apr_set_threaddata + apr_get_threadkeydata + apr_set_threadkeydata +; +; +; + apr_get_os_thread + apr_get_os_threadkey - apr_create_pool @114 + apr_create_pool ; ; ; - apr_get_userdata @118 - apr_set_userdata @119 - apr_initialize @120 -; apr_make_time @127 - apr_ansi_time_to_apr_time @127 - apr_now @128 - apr_explode_gmt @129 - apr_explode_localtime @130 - apr_implode_time @131 - apr_get_os_imp_time @132 - apr_get_os_exp_time @133 - apr_put_os_imp_time @134 - apr_put_os_exp_time @135 - apr_ctime @136 - apr_rfc822_date @137 - apr_strftime @138 + apr_get_userdata + apr_set_userdata + apr_initialize +; apr_make_time + apr_ansi_time_to_apr_time + apr_now + apr_explode_gmt + apr_explode_localtime + apr_implode_time + apr_get_os_imp_time + apr_get_os_exp_time + apr_put_os_imp_time + apr_put_os_exp_time + apr_ctime + apr_rfc822_date + apr_strftime ; ; ; @@ -154,120 +154,120 @@ EXPORTS ; ; ; - apr_MD5Final @150 - apr_MD5Init @151 - apr_MD5Update @152 - apr_cpystrn @153 - apr_register_cleanup @154 - apr_kill_cleanup @155 - apr_fnmatch @156 - apr_is_fnmatch @157 - apr_MD5Encode @158 - apr_validate_password @159 + apr_MD5Final + apr_MD5Init + apr_MD5Update + apr_cpystrn + apr_register_cleanup + apr_kill_cleanup + apr_fnmatch + apr_is_fnmatch + apr_MD5Encode + apr_validate_password ; ; apr_pools.h - apr_make_sub_pool @160 - apr_init_alloc @161 - apr_clear_pool @162 - apr_destroy_pool @163 - apr_bytes_in_pool @164 - apr_bytes_in_free_blocks @165 - apr_palloc @166 - apr_pcalloc @167 - apr_pstrdup @168 - apr_pstrndup @169 - apr_pstrcat @170 - apr_pvsprintf @171 - apr_psprintf @172 + apr_make_sub_pool + apr_init_alloc + apr_clear_pool + apr_destroy_pool + apr_bytes_in_pool + apr_bytes_in_free_blocks + apr_palloc + apr_pcalloc + apr_pstrdup + apr_pstrndup + apr_pstrcat + apr_pvsprintf + apr_psprintf ; ; apr_tables.h - apr_make_array @173 - apr_push_array @174 - apr_array_cat @175 - apr_copy_array @176 - apr_copy_array_hdr @177 - apr_append_arrays @178 - apr_array_pstrcat @179 - apr_make_table @180 - apr_copy_table @181 - apr_clear_table @182 - apr_table_get @183 - apr_table_set @184 - apr_table_setn @185 - apr_table_unset @186 - apr_table_merge @187 - apr_table_mergen @188 - apr_table_add @189 - apr_table_addn @190 - apr_overlay_tables @191 - apr_table_do @192 - apr_table_vdo @193 - apr_overlap_tables @194 -; -; - apr_run_cleanup @195 - apr_cleanup_for_exec @196 - apr_null_cleanup @197 - apr_note_subprocess @198 -; - apr_vformatter @199 - apr_snprintf @200 - apr_vsnprintf @201 - apr_getpass @202 + apr_make_array + apr_push_array + apr_array_cat + apr_copy_array + apr_copy_array_hdr + apr_append_arrays + apr_array_pstrcat + apr_make_table + apr_copy_table + apr_clear_table + apr_table_get + apr_table_set + apr_table_setn + apr_table_unset + apr_table_merge + apr_table_mergen + apr_table_add + apr_table_addn + apr_overlay_tables + apr_table_do + apr_table_vdo + apr_overlap_tables +; +; + apr_run_cleanup + apr_cleanup_for_exec + apr_null_cleanup + apr_note_subprocess +; + apr_vformatter + apr_snprintf + apr_vsnprintf + apr_getpass - apr_tokenize_to_argv @204 - apr_filename_of_pathname @205 - apr_get_remote_name @206 - apr_get_local_name @207 + apr_tokenize_to_argv + apr_filename_of_pathname + apr_get_remote_name + apr_get_local_name - apr_open_stderr @216 - apr_get_pipe_timeout @217 - apr_set_pipe_timeout @218 - apr_terminate @219 - apr_dso_load @220 - apr_dso_unload @221 - apr_dso_sym @222 - apr_collapse_spaces @223 - apr_month_snames @224 - apr_day_snames @225 - apr_canonical_error @226 - apr_strerror @227 - apr_generate_random_bytes @228 - apr_strnatcmp @229 - apr_strnatcasecmp @230 - apr_dso_error @231 + apr_open_stderr + apr_get_pipe_timeout + apr_set_pipe_timeout + apr_terminate + apr_dso_load + apr_dso_unload + apr_dso_sym + apr_collapse_spaces + apr_month_snames + apr_day_snames + apr_canonical_error + apr_strerror + apr_generate_random_bytes + apr_strnatcmp + apr_strnatcasecmp + apr_dso_error ; ; apr_hash.h - apr_make_hash @232 - apr_hash_set @233 - apr_hash_get @234 - apr_hash_first @235 - apr_hash_next @236 - apr_hash_this @237 + apr_make_hash + apr_hash_set + apr_hash_get + apr_hash_first + apr_hash_next + apr_hash_this ; ; apr_lock.h - apr_create_lock @240 - apr_lock @241 - apr_unlock @242 - apr_destroy_lock @243 - apr_child_init_lock @244 - apr_get_lockdata @245 - apr_set_lockdata @246 - apr_get_os_lock @247 + apr_create_lock + apr_lock + apr_unlock + apr_destroy_lock + apr_child_init_lock + apr_get_lockdata + apr_set_lockdata + apr_get_os_lock ; ; apr_uuid.h - apr_format_uuid @248 - apr_parse_uuid @249 - apr_get_uuid @250 + apr_format_uuid + apr_parse_uuid + apr_get_uuid ; Moved out of the way for Bill Stoddard's reorg ; ; apr_getopt.h - apr_getopt @298 - apr_initopt @299 -; apr_opterr @122 DATA -; apr_optind @123 DATA -; apr_optopt @124 DATA -; apr_optreset @125 DATA -; apr_optarg @126 DATA + apr_getopt + apr_initopt +; apr_opterr +; apr_optind +; apr_optopt +; apr_optreset +; apr_optarg From 89e3021afdcae08622ca5e6cfb5407f79131b41b Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 18 Nov 2000 15:32:16 +0000 Subject: [PATCH 0780/7878] Hide an instance of AF_INET6 if we don't have IPv6 and start adding code to allow BeOS to use this file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60758 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index f68863b5d6b..6cf11607094 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -58,7 +58,11 @@ static apr_status_t socket_cleanup(void *sock) { apr_socket_t *thesocket = sock; +#ifndef BEOS if (close(thesocket->socketdes) == 0) { +#else + if (closesocket(thesocket->socketdes) == 0) { +#endif thesocket->socketdes = -1; return APR_SUCCESS; } @@ -246,6 +250,7 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) sock->local_port_unknown = 1; } /* XXX IPv6 to be handled better later... */ +#if APR_HAVE_IPV6 if (sock->local_addr->sa.sin.sin_family == AF_INET6 || sock->local_addr->sa.sin.sin_addr.s_addr == 0) { /* not bound to specific local interface; connect() had to assign @@ -253,6 +258,7 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) */ sock->local_interface_unknown = 1; } +#endif #ifndef HAVE_POLL sock->connected=1; #endif From f0823b6902f7c617143ce471f6fa49db24a15ccf Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 18 Nov 2000 15:46:45 +0000 Subject: [PATCH 0781/7878] This changes AF_ to APR_. The reason is that if we're on a platform (pre-BONE BeOS for example) that doesn't have AF_UNSPEC then we need to define it and any program using our code needs to use the value we've defined. I'm not in favour of mixing AF_INET and APR_UNSPEC so we now have APR_INET, APR_INET6 and APR_UNSPEC. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60759 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 13 +++++++++++++ network_io/unix/sa_common.c | 8 ++++---- network_io/unix/sockets.c | 20 ++++++++++---------- network_io/unix/sockopt.c | 2 +- test/client.c | 2 +- test/server.c | 2 +- test/testsf.c | 2 +- 7 files changed, 31 insertions(+), 18 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 8768d314ba9..795fc51d5b2 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -113,6 +113,19 @@ struct in_addr { } #endif +/* Not all platforms have these defined, so we'll define them here + * The default values come from FreeBSD 4.1.1 + */ +#define APR_INET AF_INET +#ifdef AF_UNSPEC +#define APR_UNSPEC AF_UNSPEC +#else +#define APR_UNSPEC 0 +#endif +#if APR_HAVE_IPV6 +#define APR_INET6 AF_INET6 +#endif + /* Enum to tell us if we're interested in remote or local socket */ typedef enum { APR_LOCAL, diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 7f2ab9612b0..29ffc43bae7 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -140,7 +140,7 @@ apr_status_t apr_get_inaddr(apr_in_addr_t *addr, char *hostname) /* hmmm, it's not a numeric IP address so we need to look it up :( */ he = gethostbyname(hostname); - if (!he || he->h_addrtype != AF_INET || !he->h_addr_list[0]) + if (!he || he->h_addrtype != APR_INET || !he->h_addr_list[0]) return (h_errno + APR_OS_START_SYSERR); *addr = *(struct in_addr*)he->h_addr_list[0]; @@ -175,14 +175,14 @@ static void set_sockaddr_vars(apr_sockaddr_t *addr, int family) { addr->sa.sin.sin_family = family; - if (family == AF_INET) { + if (family == APR_INET) { addr->sa_len = sizeof(struct sockaddr_in); addr->addr_str_len = 16; addr->ipaddr_ptr = &(addr->sa.sin.sin_addr); addr->ipaddr_len = sizeof(struct in_addr); } #if APR_HAVE_IPV6 - else if (family == AF_INET6) { + else if (family == APR_INET6) { addr->sa_len = sizeof(struct sockaddr_in6); addr->addr_str_len = 46; addr->ipaddr_ptr = &(addr->sa.sin6.sin6_addr); @@ -201,7 +201,7 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, if ((*sa) == NULL) return APR_ENOMEM; (*sa)->pool = p; - (*sa)->sa.sin.sin_family = AF_INET; /* we don't yet support IPv6 */ + (*sa)->sa.sin.sin_family = APR_INET; /* we don't yet support IPv6 */ (*sa)->sa.sin.sin_port = htons(port); set_sockaddr_vars(*sa, (*sa)->sa.sin.sin_family); diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 6cf11607094..a727895d6ca 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -76,7 +76,7 @@ static void set_socket_vars(apr_socket_t *sock, int family) sock->local_addr->sa.sin.sin_family = family; sock->remote_addr->sa.sin.sin_family = family; - if (family == AF_INET) { + if (family == APR_INET) { sock->local_addr->sa_len = sizeof(struct sockaddr_in); sock->local_addr->addr_str_len = 16; sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin.sin_addr); @@ -88,7 +88,7 @@ static void set_socket_vars(apr_socket_t *sock, int family) sock->remote_addr->ipaddr_len = sizeof(struct in_addr); } #if APR_HAVE_IPV6 - else if (family == AF_INET6) { + else if (family == APR_INET6) { sock->local_addr->sa_len = sizeof(struct sockaddr_in6); sock->local_addr->addr_str_len = 46; sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin6.sin6_addr); @@ -116,11 +116,11 @@ apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, { int family = ofamily; - if (family == AF_UNSPEC) { + if (family == APR_UNSPEC) { #if APR_HAVE_IPV6 - family = AF_INET6; + family = APR_INET6; #else - family = AF_INET; + family = APR_INET; #endif } @@ -133,8 +133,8 @@ apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, (*new)->socketdes = socket(family, type, 0); #if APR_HAVE_IPV6 - if ((*new)->socketdes < 0 && ofamily == AF_UNSPEC) { - family = AF_INET; + if ((*new)->socketdes < 0 && ofamily == APR_UNSPEC) { + family = APR_INET; (*new)->socketdes = socket(family, type, 0); } #endif @@ -152,7 +152,7 @@ apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) { - return apr_create_socket(new, AF_INET, SOCK_STREAM, cont); + return apr_create_socket(new, APR_INET, SOCK_STREAM, cont); } apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) @@ -251,7 +251,7 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) } /* XXX IPv6 to be handled better later... */ #if APR_HAVE_IPV6 - if (sock->local_addr->sa.sin.sin_family == AF_INET6 || + if (sock->local_addr->sa.sin.sin_family == APR_INET6 || sock->local_addr->sa.sin.sin_addr.s_addr == 0) { /* not bound to specific local interface; connect() had to assign * one for the socket @@ -289,7 +289,7 @@ apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, if ((*sock) == NULL) { alloc_socket(sock, cont); /* XXX IPv6 figure out the family here! */ - set_socket_vars(*sock, AF_INET); + set_socket_vars(*sock, APR_INET); (*sock)->timeout = -1; } (*sock)->local_port_unknown = (*sock)->local_interface_unknown = 1; diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 3829efae9ec..8436ad44592 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -214,7 +214,7 @@ apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t * else return APR_EINVAL; - hptr = gethostbyaddr((char *)&sa_ptr, sizeof(struct in_addr), AF_INET); + hptr = gethostbyaddr((char *)&sa_ptr, sizeof(struct in_addr), APR_INET); if (hptr != NULL) { *name = apr_pstrdup(sock->cntxt, hptr->h_name); diff --git a/test/client.c b/test/client.c index 9828f08a760..65a40970bbd 100644 --- a/test/client.c +++ b/test/client.c @@ -117,7 +117,7 @@ int main(int argc, char *argv[]) } fprintf(stdout,"\tClient: Making socket address..............."); - if (apr_getaddrinfo(&destsa, dest, AF_INET, 8021, 0, context) != APR_SUCCESS) { + if (apr_getaddrinfo(&destsa, dest, APR_INET, 8021, 0, context) != APR_SUCCESS) { apr_close_socket(sock); fprintf(stdout, "Failed!\n"); fprintf(stdout, "Couldn't create a socket address structure for %s\n", dest); diff --git a/test/server.c b/test/server.c index 9c690a2c7d9..f22bd23b0f0 100644 --- a/test/server.c +++ b/test/server.c @@ -88,7 +88,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Creating new socket......."); - if (apr_create_socket(&sock, AF_UNSPEC, SOCK_STREAM, context) != APR_SUCCESS) { + if (apr_create_socket(&sock, APR_UNSPEC, SOCK_STREAM, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); } diff --git a/test/testsf.c b/test/testsf.c index 37b211803c7..e749518a627 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -218,7 +218,7 @@ static int client(client_socket_mode_t socket_mode) exit(1); } - rv = apr_getaddrinfo(&destsa, "127.0.0.1", AF_INET, TESTSF_PORT, 0, p); + rv = apr_getaddrinfo(&destsa, "127.0.0.1", APR_INET, TESTSF_PORT, 0, p); if (rv != APR_SUCCESS) { fprintf(stderr, "apr_getaddrinfo()->%d/%s\n", rv, From 93e1ea90c28afd7a25783402e4c96427357bff47 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 18 Nov 2000 16:31:52 +0000 Subject: [PATCH 0782/7878] Some more small cahnges that allow BeOS to use the Unix code for most of the networking. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60760 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 4 ++++ network_io/unix/sockopt.c | 24 ++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index a727895d6ca..69ab5116c6f 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -61,7 +61,11 @@ static apr_status_t socket_cleanup(void *sock) #ifndef BEOS if (close(thesocket->socketdes) == 0) { #else +#ifndef BEOS_BONE if (closesocket(thesocket->socketdes) == 0) { +#else + if (close(thesocket->socketdes) == 0) { +#endif #endif thesocket->socketdes = -1; return APR_SUCCESS; diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 8436ad44592..6384eaa960d 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -113,18 +113,20 @@ static apr_status_t sononblock(int sd) apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { int one; - struct linger li; apr_status_t stat; if (on) one = 1; else one = 0; - if (opt & APR_SO_KEEPALIVE) { +#ifdef SO_KEEPALIVE if (setsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { return errno; } +#else + return APR_ENOTIMPL; +#endif } if (opt & APR_SO_DEBUG) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { @@ -137,9 +139,13 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o } } if (opt & APR_SO_SNDBUF) { +#ifdef SO_SNDBUF if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { return errno; } +#else + return APR_ENOTIMPL; +#endif } if (opt & APR_SO_NONBLOCK) { if (on) { @@ -152,11 +158,16 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o } } if (opt & APR_SO_LINGER) { +#ifdef SO_LINGER + struct linger li; li.l_onoff = on; li.l_linger = MAX_SECS_TO_LINGER; if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { return errno; } +#else + return APR_ENOTIMPL; +#endif } if (opt & APR_SO_TIMEOUT) { /* don't do the fcntl foo more than needed */ @@ -176,6 +187,15 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o return errno; } #else + /* BeOS pre-BONE has TCP_NODELAY set by default. + * As it can't be turned off we might as well check if they're asking + * for it to be turned on! + */ +#ifdef BEOS + if (on == 1) + return APR_SUCCESS; + else +#endif return APR_ENOTIMPL; #endif } From f95a50919770afcc7d934e2db56b1bf745ac56a6 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 18 Nov 2000 16:53:18 +0000 Subject: [PATCH 0783/7878] This changes BeOS to use the majority of the Unix socket code. Once this has been in a day or 2 I'll remove the old files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60761 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/Makefile.in | 11 +++--- network_io/beos/poll.c | 63 +++++++++++++++++----------------- network_io/beos/sendrecv.c | 3 ++ network_io/beos/socketcommon.c | 5 +++ 4 files changed, 44 insertions(+), 38 deletions(-) create mode 100644 network_io/beos/socketcommon.c diff --git a/network_io/beos/Makefile.in b/network_io/beos/Makefile.in index 164dbc3907d..f7477ef662e 100644 --- a/network_io/beos/Makefile.in +++ b/network_io/beos/Makefile.in @@ -3,18 +3,17 @@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../include -I../../file_io/unix -INCLUDES=-I$(INCDIR) -I. +INCDIR=../../include +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) MKDEP=../../helpers/mkdep.sh LIB=libnetwork.a OBJS=poll.o \ sendrecv.o \ - sockets.o \ - sockopt.o \ - inet_aton.o \ - sockaddr.o + socketcommon.o .c.o: $(CC) $(CFLAGS) -c $(INCLUDES) $< diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index b6089bee894..a95738185bd 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -58,25 +58,25 @@ #else #include "networkio.h" -/* BeOS R4 doesn't have a poll function, but R5 will have */ -/* so for the time being we try our best with an implementaion that */ -/* uses select. However, select on beos isn't that hot either, so */ -/* until R5 we have to live with a less than perfect implementation */ - -/* Apparently those sneaky people at Be included support for write in */ -/* select for R4.5 of BeOS. So here we use code that uses the write */ -/* bits. */ - +/* BeOS R4 doesn't have a poll function, but R5 will have + * so for the time being we try our best with an implementaion that + * uses select. However, select on beos isn't that hot either, so + * until R5 we have to live with a less than perfect implementation + * + * Apparently those sneaky people at Be included support for write in + * select for R4.5 of BeOS. So here we use code that uses the write + * bits. + */ apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { - (*new) = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t) * num); + (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->read = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->except = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->read = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); + (*new)->write = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); + (*new)->except = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); FD_ZERO((*new)->read); FD_ZERO((*new)->write); FD_ZERO((*new)->except); @@ -114,12 +114,12 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, else { tv.tv_sec = timeout / APR_USEC_PER_SEC; tv.tv_usec = timeout % APR_USEC_PER_SEC; - tvptr = &tv; + tvptr = &tv; } rv = select(aprset->highsock + 1, aprset->read, aprset->write, - NULL, tvptr); - + aprset->except, tvptr); + (*nsds) = rv; if ((*nsds) == 0) { return APR_TIMEUP; @@ -133,43 +133,42 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { apr_int16_t revents = 0; - char data[256]; - int dummy = 256; + char data[1]; + int flags = 0; if (FD_ISSET(sock->socketdes, aprset->read)) { revents |= APR_POLLIN; - if (recv(sock->socketdes, &data, 0, 0) == -1) { + if (sock->connected + && recv(sock->socketdes, data, 0 /*sizeof data*/, flags) == -1) { switch (errno) { case ECONNRESET: case ECONNABORTED: case ESHUTDOWN: - case ENETRESET: { + case ENETRESET: revents ^= APR_POLLIN; revents |= APR_POLLHUP; break; - } - case ENOTSOCK: { + case ENOTSOCK: revents ^= APR_POLLIN; revents |= APR_POLLNVAL; - } - default: { + break; + default: revents ^= APR_POLLIN; revents |= APR_POLLERR; - } + break; } } } if (FD_ISSET(sock->socketdes, aprset->write)) { revents |= APR_POLLOUT; } - - /* Still no support for execpt bits in BeOS R4.5 so for the time being */ - /* we can't check this. Hopefully the error checking above will allow */ - /* sufficient errors to be recognised to cover this. */ - - /*if (FD_ISSET(sock->socketdes, aprset->except)) { + /* I am assuming that the except is for out of band data, not a failed + * connection on a non-blocking socket. Might be a bad assumption, but + * it works for now. rbb. + */ + if (FD_ISSET(sock->socketdes, aprset->except)) { revents |= APR_POLLPRI; - }*/ + } (*event) = revents; return APR_SUCCESS; diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index ec96869fd02..a140844b65c 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -117,6 +117,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) return errno; } (*len) = rv; + return APR_SUCCESS; } @@ -145,6 +146,8 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) return errno; } (*len) = rv; + if (rv == 0) + return APR_EOF; return APR_SUCCESS; } diff --git a/network_io/beos/socketcommon.c b/network_io/beos/socketcommon.c new file mode 100644 index 00000000000..cdadc8561ae --- /dev/null +++ b/network_io/beos/socketcommon.c @@ -0,0 +1,5 @@ +#include "../unix/inet_ntop.c" +#include "../unix/inet_pton.c" +#include "../unix/sockets.c" +#include "../unix/sockaddr.c" +#include "../unix/sockopt.c" From e25a7f9687c239d1f7d9518e45738f02927ba17c Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 18 Nov 2000 16:54:16 +0000 Subject: [PATCH 0784/7878] Get this working on BeOS again after the arch changes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60762 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/Makefile.in | 4 +++- threadproc/beos/proc.c | 2 +- threadproc/beos/thread.c | 2 +- threadproc/beos/threadpriv.c | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/threadproc/beos/Makefile.in b/threadproc/beos/Makefile.in index 5297c1337df..6e451a1efca 100644 --- a/threadproc/beos/Makefile.in +++ b/threadproc/beos/Makefile.in @@ -4,7 +4,9 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) MKDEP=../../helpers/mkdep.sh LIB=libthreadproc.a diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 9135178b788..bf09188c54a 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "beos/threadproc.h" +#include "threadproc.h" struct send_pipe { int in; diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 48500269d6c..c646b0ae577 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "beos/threadproc.h" +#include "threadproc.h" apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) { diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index 524a04af26e..0044944f629 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "beos/threadproc.h" +#include "threadproc.h" static struct beos_key key_table[BEOS_MAX_DATAKEYS]; static struct beos_private_data *beos_data[BEOS_MAX_DATAKEYS]; From dd4865b69eb27f30cf8bea6fb8d642b169d58796 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sat, 18 Nov 2000 20:52:28 +0000 Subject: [PATCH 0785/7878] Add apr_get_sockaddr() for getting the address of one of the apr_sockaddr_t structures for a socket. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60763 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 1 + include/apr_network_io.h | 12 ++++++++++-- libapr.def | 1 + network_io/unix/sa_common.c | 16 ++++++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/aprlib.def b/aprlib.def index 36c0c8cb82c..eae7b8662ce 100644 --- a/aprlib.def +++ b/aprlib.def @@ -51,6 +51,7 @@ EXPORTS ; ; apr_network_io.h + apr_get_sockaddr apr_getaddrinfo apr_create_socket apr_create_tcp_socket diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 795fc51d5b2..d7c120164a7 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -215,7 +215,7 @@ apr_status_t apr_create_tcp_socket(apr_socket_t **new_sock, apr_pool_t *cont); /** * Create a socket. * @param new_sock The new socket that has been set up. - * @param family The address family of the socket (e.g., AF_INET). + * @param family The address family of the socket (e.g., APR_INET). * @param type The type of the socket (e.g., SOCK_STREAM). * @param cont The pool to use */ @@ -292,7 +292,7 @@ apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t * * Create apr_sockaddr_t from hostname, address family, and port. * @param sa The new apr_sockaddr_t. * @param hostname The hostname or numeric address string to resolve/parse. - * @param family The address family to use, or AF_UNSPEC if the system should + * @param family The address family to use, or APR_UNSPEC if the system should * decide. * @param port The port number. * @param flags Special processing flags. @@ -454,6 +454,14 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o */ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t* on); +/** + * Return an apr_sockaddr_t from an apr_socket_t + * @param sa The returned apr_sockaddr_t. + * @param which Which interface do we want the apr_sockaddr_t for? + * @param sock The socket to use + */ +apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock); + /** * Associate a port with a socket. * @param sock The socket to set. diff --git a/libapr.def b/libapr.def index 36c0c8cb82c..eae7b8662ce 100644 --- a/libapr.def +++ b/libapr.def @@ -51,6 +51,7 @@ EXPORTS ; ; apr_network_io.h + apr_get_sockaddr apr_getaddrinfo apr_create_socket apr_create_tcp_socket diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 29ffc43bae7..dd4971e3965 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -191,6 +191,22 @@ static void set_sockaddr_vars(apr_sockaddr_t *addr, int family) #endif } +apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock) +{ + if (which == APR_LOCAL) { + *sa = sock->local_addr; + } + else if (which == APR_REMOTE) { + *sa = sock->remote_addr; + } + else { + *sa = NULL; + return APR_EINVAL; + } + return APR_SUCCESS; + +} + apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p) From 46d4786450d5b2adfb8d075c00e55c5f8bb25824 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 18 Nov 2000 21:10:41 +0000 Subject: [PATCH 0786/7878] Small change to get BeOS building again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60764 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/threadproc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h index fcff52c151d..c53d32e4db0 100644 --- a/include/arch/beos/threadproc.h +++ b/include/arch/beos/threadproc.h @@ -53,7 +53,7 @@ */ #include "apr_thread_proc.h" -#include "../../file_io/unix/fileio.h" +#include "fileio.h" #include "apr_file_io.h" #include "apr_thread_proc.h" #include "apr_general.h" From 16c04c4c2c7c27baf020cc58333006881d68985f Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 18 Nov 2000 21:26:13 +0000 Subject: [PATCH 0787/7878] Small change to stop a warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60765 13f79535-47bb-0310-9956-ffa450edef68 --- locks/beos/locks.c | 1 + 1 file changed, 1 insertion(+) diff --git a/locks/beos/locks.c b/locks/beos/locks.c index e9ed5a078b4..07dcf07bca8 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -53,6 +53,7 @@ */ #include "beos/locks.h" +#include "apr_strings.h" apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, From 4cef2f858ce93276fca8cd19a7395a8d26fa8d4e Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sun, 19 Nov 2000 01:05:16 +0000 Subject: [PATCH 0788/7878] More fixes to get BeOS building and a few missing functions to try and keep exports.c happy :) With these changes we're now back building again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60766 13f79535-47bb-0310-9956-ffa450edef68 --- locks/beos/locks.c | 28 ++++++++++++++++++++++++++++ threadproc/beos/Makefile.in | 2 +- threadproc/beos/proc.c | 6 ++++++ threadproc/beos/thread.c | 32 ++++++++++++++++++++++++++++++++ threadproc/beos/threadpriv.c | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 100 insertions(+), 1 deletion(-) diff --git a/locks/beos/locks.c b/locks/beos/locks.c index 07dcf07bca8..81820113626 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -54,6 +54,7 @@ #include "beos/locks.h" #include "apr_strings.h" +#include "apr_portable.h" apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, @@ -158,3 +159,30 @@ apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, return apr_set_userdata(data, key, cleanup, lock->cntxt); } +apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) +{ + oslock->sem_interproc = lock->sem_interproc; + oslock->sem_intraproc = lock->sem_intraproc; + oslock->ben_interproc = lock->ben_interproc; + oslock->ben_intraproc = lock->ben_intraproc; + return APR_SUCCESS; +} + +apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, + apr_pool_t *cont) +{ + if (cont == NULL) { + return APR_ENOPOOL; + } + if ((*lock) == NULL) { + (*lock) = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t)); + (*lock)->cntxt = cont; + } + (*lock)->sem_interproc = thelock->sem_interproc; + (*lock)->ben_interproc = thelock->ben_interproc; + + (*lock)->sem_intraproc = thelock->sem_intraproc; + (*lock)->ben_intraproc = thelock->ben_intraproc; + return APR_SUCCESS; +} + diff --git a/threadproc/beos/Makefile.in b/threadproc/beos/Makefile.in index 6e451a1efca..7f3e4153af8 100644 --- a/threadproc/beos/Makefile.in +++ b/threadproc/beos/Makefile.in @@ -6,7 +6,7 @@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch $(OSDIR) $(DEFOSDIR) MKDEP=../../helpers/mkdep.sh LIB=libthreadproc.a diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index bf09188c54a..51a2e5eb72a 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -53,6 +53,7 @@ */ #include "threadproc.h" +#include "apr_strings.h" struct send_pipe { int in; @@ -365,3 +366,8 @@ apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_er return APR_SUCCESS; } +apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, + struct rlimit *limit) +{ + return APR_ENOTIMPL; +} diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index c646b0ae577..1dc7210f2ab 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -155,3 +155,35 @@ apr_status_t apr_thread_detach(apr_thread_t *thd) return errno; } } + +apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) +{ + return apr_get_userdata(data, key, thread->cntxt); +} + +apr_status_t apr_set_threaddata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread) +{ + return apr_set_userdata(data, key, cleanup, thread->cntxt); +} + +apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd) +{ + *thethd = &thd->td; + return APR_SUCCESS; +} + +apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, + apr_pool_t *cont) +{ + if (cont == NULL) { + return APR_ENOPOOL; + } + if ((*thd) == NULL) { + (*thd) = (apr_thread_t *)apr_pcalloc(cont, sizeof(apr_thread_t)); + (*thd)->cntxt = cont; + } + (*thd)->td = *thethd; + return APR_SUCCESS; +} diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index 0044944f629..037ce46a1f5 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -183,3 +183,36 @@ apr_status_t apr_delete_thread_private(apr_threadkey_t *key) } return APR_SUCCESS; } + +apr_status_t apr_get_threadkeydata(void **data, const char *key, + apr_threadkey_t *threadkey) +{ + return apr_get_userdata(data, key, threadkey->cntxt); +} + +apr_status_t apr_set_threadkeydata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey) +{ + return apr_set_userdata(data, key, cleanup, threadkey->cntxt); +} + +apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +{ + *thekey = key->key; + return APR_SUCCESS; +} + +apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, apr_pool_t *cont) +{ + if (cont == NULL) { + return APR_ENOPOOL; + } + if ((*key) == NULL) { + (*key) = (apr_threadkey_t *)apr_pcalloc(cont, sizeof(apr_threadkey_t)); + (*key)->cntxt = cont; + } + (*key)->key = *thekey; + return APR_SUCCESS; +} From f2b6849ac783b714c3d347513e05dda785a0922c Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sun, 19 Nov 2000 01:21:11 +0000 Subject: [PATCH 0789/7878] apr_getaddrinfo() changes: 1) fix a Win32 bug in the gethostbyname logic; we need to have a WIN32 check to see if we return apr_get_netos_error() instead of h_errno + APR_OS_START_SYSERR; this bug was introduced a recently when I moved hostname resolution from apr_connect() to this function 2) when the system has getaddrinfo() and we support IPv6, use getaddrinfo() instead git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60767 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 65 +++++++++++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 7 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index dd4971e3965..0435e39e888 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -204,24 +204,69 @@ apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_so return APR_EINVAL; } return APR_SUCCESS; - } apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p) { - struct hostent *hp; - (*sa) = (apr_sockaddr_t *)apr_pcalloc(p, sizeof(apr_sockaddr_t)); if ((*sa) == NULL) return APR_ENOMEM; (*sa)->pool = p; - (*sa)->sa.sin.sin_family = APR_INET; /* we don't yet support IPv6 */ - (*sa)->sa.sin.sin_port = htons(port); - set_sockaddr_vars(*sa, (*sa)->sa.sin.sin_family); + (*sa)->hostname = apr_pstrdup(p, hostname); +#if defined(HAVE_GETADDRINFO) && APR_HAVE_IPV6 if (hostname != NULL) { + struct addrinfo hints, *ai; + int error; + char num[8]; + + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_CANONNAME; + hints.ai_family = family; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = 0; + apr_snprintf(num, sizeof(num), "%d", port); + error = getaddrinfo(hostname, num, &hints, &ai); + if (error) { + if (error == EAI_SYSTEM) { + return errno; + } + else { + /* XXX fixme! + * no current way to represent this with APR's error + * scheme... note that glibc uses negative values for these + * numbers, perhaps so they don't conflict with h_errno + * values... Tru64 uses positive values which conflict + * with h_errno values + */ + return error + APR_OS_START_SYSERR; + } + } + (*sa)->sa.sin.sin_family = ai->ai_family; + memcpy(&(*sa)->sa, ai->ai_addr, ai->ai_addrlen); + } + else { + if (family == APR_UNSPEC) { + (*sa)->sa.sin.sin_family = APR_INET; + } + else { + (*sa)->sa.sin.sin_family = family; + } + } + set_sockaddr_vars(*sa, (*sa)->sa.sin.sin_family); +#else + if (family == APR_UNSPEC) { + (*sa)->sa.sin.sin_family = APR_INET; /* we don't yet support IPv6 here */ + } + else { + (*sa)->sa.sin.sin_family = family; + } + set_sockaddr_vars(*sa, (*sa)->sa.sin.sin_family); + if (hostname != NULL) { + struct hostent *hp; + #ifndef GETHOSTBYNAME_HANDLES_NAS if (*hostname >= '0' && *hostname <= '9' && strspn(hostname, "0123456789.") == strlen(hostname)) { @@ -233,7 +278,11 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, hp = gethostbyname(hostname); if (!hp) { +#ifdef WIN32 + apr_get_netos_error(); +#else return (h_errno + APR_OS_START_SYSERR); +#endif } memcpy((char *)&(*sa)->sa.sin.sin_addr, hp->h_addr_list[0], @@ -245,6 +294,8 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, } #endif } - (*sa)->hostname = apr_pstrdup(p, hostname); +#endif + /* XXX IPv6: assumes sin_port and sin6_port at same offset */ + (*sa)->sa.sin.sin_port = htons(port); return APR_SUCCESS; } From 23bebae1fd6dfabd4168d5b63ac054bcf97b47f1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sun, 19 Nov 2000 01:54:12 +0000 Subject: [PATCH 0790/7878] The client test program now makes better use of apr_getaddrinfo(), calling it before apr_create_socket(), then getting the type of socket appropriate for the destination. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60768 13f79535-47bb-0310-9956-ffa450edef68 --- test/client.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/test/client.c b/test/client.c index 65a40970bbd..f73f146062e 100644 --- a/test/client.c +++ b/test/client.c @@ -99,32 +99,24 @@ int main(int argc, char *argv[]) } fprintf(stdout, "OK\n"); - fprintf(stdout, "\tClient: Creating new socket......."); - if (apr_create_tcp_socket(&sock, context) != APR_SUCCESS) { - fprintf(stderr, "Couldn't create socket\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - - if (read_timeout == -1) { - fprintf(stdout, "\tClient: Setting socket option NONBLOCK......."); - if (apr_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { - apr_close_socket(sock); - fprintf(stderr, "Couldn't set socket option\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - } - fprintf(stdout,"\tClient: Making socket address..............."); - if (apr_getaddrinfo(&destsa, dest, APR_INET, 8021, 0, context) != APR_SUCCESS) { - apr_close_socket(sock); + if ((stat = apr_getaddrinfo(&destsa, dest, APR_UNSPEC, 8021, 0, context)) + != APR_SUCCESS) { fprintf(stdout, "Failed!\n"); - fprintf(stdout, "Couldn't create a socket address structure for %s\n", dest); + fprintf(stdout, "Address resolution failed for %s: %s\n", + dest, apr_strerror(stat, msgbuf, sizeof(msgbuf))); exit(-1); } fprintf(stdout,"OK\n"); + fprintf(stdout, "\tClient: Creating new socket......."); + if (apr_create_socket(&sock, destsa->sa.sin.sin_family, SOCK_STREAM, + context) != APR_SUCCESS) { + fprintf(stderr, "Couldn't create socket\n"); + exit(-1); + } + fprintf(stdout, "OK\n"); + fprintf(stdout, "\tClient: Connecting to socket......."); stat = apr_connect(sock, destsa); @@ -138,6 +130,16 @@ int main(int argc, char *argv[]) } fprintf(stdout, "OK\n"); + if (read_timeout == -1) { + fprintf(stdout, "\tClient: Setting socket option NONBLOCK......."); + if (apr_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { + apr_close_socket(sock); + fprintf(stderr, "Couldn't set socket option\n"); + exit(-1); + } + fprintf(stdout, "OK\n"); + } + apr_get_ipaddr(&remote_ipaddr, APR_REMOTE, sock); apr_get_port(&remote_port, APR_REMOTE, sock); apr_get_ipaddr(&local_ipaddr, APR_LOCAL, sock); From 8a1b4b48bf6913a3dda9af190d245313eec077cd Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sun, 19 Nov 2000 02:59:16 +0000 Subject: [PATCH 0791/7878] simplify BeOS preprocessor logic in socket_cleanup() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60769 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 69ab5116c6f..c18632b3272 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -58,14 +58,11 @@ static apr_status_t socket_cleanup(void *sock) { apr_socket_t *thesocket = sock; -#ifndef BEOS - if (close(thesocket->socketdes) == 0) { -#else -#ifndef BEOS_BONE + +#if defined(BEOS) && !defined(BEOS_BONE) if (closesocket(thesocket->socketdes) == 0) { #else if (close(thesocket->socketdes) == 0) { -#endif #endif thesocket->socketdes = -1; return APR_SUCCESS; From 0369e998770fd310723a81b7fb63b397222e391e Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sun, 19 Nov 2000 03:02:37 +0000 Subject: [PATCH 0792/7878] Restore some AF_INET logic which shouldn't be dependent on IPv6 support. Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60770 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index c18632b3272..2c9bb232bd5 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -251,15 +251,16 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) sock->local_port_unknown = 1; } /* XXX IPv6 to be handled better later... */ + if ( #if APR_HAVE_IPV6 - if (sock->local_addr->sa.sin.sin_family == APR_INET6 || + sock->local_addr->sa.sin.sin_family == APR_INET6 || +#endif sock->local_addr->sa.sin.sin_addr.s_addr == 0) { /* not bound to specific local interface; connect() had to assign * one for the socket */ sock->local_interface_unknown = 1; } -#endif #ifndef HAVE_POLL sock->connected=1; #endif From d3fd72c2ffc842fb57258beaec0ea1ca5607a41e Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sun, 19 Nov 2000 14:24:19 +0000 Subject: [PATCH 0793/7878] Change apr_bind() to take apr_sockaddr_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60771 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 5 +-- network_io/os2/sockets.c | 10 +++--- network_io/unix/sockets.c | 6 ++-- network_io/win32/sockets.c | 7 +++-- test/server.c | 62 ++++++++++++++++++++++++++++++++------ test/testsf.c | 40 +++++++++++++++++------- 6 files changed, 98 insertions(+), 32 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index d7c120164a7..2aef5dfa17c 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -245,10 +245,11 @@ apr_status_t apr_close_socket(apr_socket_t *thesocket); /** * Bind the socket to its associated port * @param sock The socket to bind - * @tip This is where we will find out if there is any other process + * @param sa The socket address to bind to + * @tip This may be where we will find out if there is any other process * using the selected port. */ -apr_status_t apr_bind(apr_socket_t *sock); +apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa); /** * Listen to a bound socket for connections. diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 4323745b4f3..df2fa26a4f6 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -189,14 +189,16 @@ apr_status_t apr_close_socket(apr_socket_t *thesocket) -apr_status_t apr_bind(apr_socket_t *sock) +apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) { if (bind(sock->socketdes, - (struct sockaddr *)&sock->local_addr->sa, - sock->local_addr->sa_len) == -1) + (struct sockaddr *)&sa->sa, + sa->sa_len) == -1) return APR_OS2_STATUS(sock_errno()); - else + else { + sock->local_sa = sa; return APR_SUCCESS; + } } apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 2c9bb232bd5..6662aa36a7e 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -167,12 +167,14 @@ apr_status_t apr_close_socket(apr_socket_t *thesocket) return socket_cleanup(thesocket); } -apr_status_t apr_bind(apr_socket_t *sock) +apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) { if (bind(sock->socketdes, - (struct sockaddr *)&sock->local_addr->sa, sock->local_addr->sa_len) == -1) + (struct sockaddr *)&sa->sa, sa->sa_len) == -1) { return errno; + } else { + sock->local_addr = sa; /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ if (sock->local_addr->sa.sin.sin_port == 0) { /* no need for ntohs() when comparing w/ 0 */ sock->local_port_unknown = 1; /* kernel got us an ephemeral port */ diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index e9cf5449a97..a0104e31c3b 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -196,14 +196,15 @@ apr_status_t apr_close_socket(apr_socket_t *thesocket) return socket_cleanup(thesocket); } -apr_status_t apr_bind(apr_socket_t *sock) +apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) { if (bind(sock->sock, - (struct sockaddr *)&sock->local_addr->sa, - sock->local_addr->sa_len) == -1) { + (struct sockaddr *)&sa->sa, + sa->sa_len) == -1) { return apr_get_netos_error(); } else { + sock->local_addr = sa; if (sock->local_addr->sa.sin.sin_port == 0) { sock->local_port_unknown = 1; /* ephemeral port */ } diff --git a/test/server.c b/test/server.c index f22bd23b0f0..e0146b4381e 100644 --- a/test/server.c +++ b/test/server.c @@ -56,10 +56,11 @@ #include "apr_network_io.h" #include "apr_errno.h" #include "apr_general.h" +#include "apr_getopt.h" #define STRLEN 15 -int main(int argc, char *argv[]) +int main(int argc, char * const argv[]) { apr_pool_t *context; apr_socket_t *sock; @@ -69,8 +70,16 @@ int main(int argc, char *argv[]) apr_pollfd_t *sdset; char datasend[STRLEN]; char datarecv[STRLEN] = "Recv data test"; + const char *bind_to_ipaddr = NULL; char *local_ipaddr, *remote_ipaddr; apr_port_t local_port, remote_port; + apr_sockaddr_t *localsa = NULL; + apr_status_t stat; + int family = APR_UNSPEC; + char buf[128]; + apr_getopt_t *opt; + const char *optarg; + char optchar; fprintf(stdout, "Initializing........."); if (apr_initialize() != APR_SUCCESS) { @@ -87,8 +96,43 @@ int main(int argc, char *argv[]) } fprintf(stdout, "OK\n"); + if (apr_initopt(&opt, context, argc, argv)) { + fprintf(stderr, "failed to initialize opts\n"); + exit(-1); + } + + while ((stat = apr_getopt(opt, "i:", &optchar, &optarg)) == APR_SUCCESS) { + switch(optchar) { + case 'i': + bind_to_ipaddr = optarg; + break; + } + } + if (stat != APR_EOF) { + fprintf(stderr, + "usage: %s [-i local-interface-address]\n", + argv[0]); + exit(-1); + } + + if (bind_to_ipaddr) { + /* First, parse/resolve ipaddr so we know what address family of + * socket we need. We'll use the returned sockaddr later when + * we bind. + */ + stat = apr_getaddrinfo(&localsa, bind_to_ipaddr, APR_UNSPEC, 8021, 0, + context); + if (stat != APR_SUCCESS) { + fprintf(stderr, + "Couldn't build the socket address correctly: %s\n", + apr_strerror(stat, buf, sizeof buf)); + exit(-1); + } + family = localsa->sa.sin.sin_family; + } + fprintf(stdout, "\tServer: Creating new socket......."); - if (apr_create_socket(&sock, APR_UNSPEC, SOCK_STREAM, context) != APR_SUCCESS) { + if (apr_create_socket(&sock, family, SOCK_STREAM, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); } @@ -110,18 +154,16 @@ int main(int argc, char *argv[]) } fprintf(stdout, "OK\n"); - fprintf(stdout, "\tServer: Setting port for socket......."); - if (apr_set_port(sock, APR_LOCAL, 8021) != APR_SUCCESS) { - apr_close_socket(sock); - fprintf(stderr, "Couldn't set the port correctly\n"); - exit(-1); + if (!localsa) { + apr_set_port(sock, APR_LOCAL, 8021); + apr_get_sockaddr(&localsa, APR_LOCAL, sock); } - fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Binding socket to port......."); - if (apr_bind(sock) != APR_SUCCESS) { + if ((stat = apr_bind(sock, localsa)) != APR_SUCCESS) { apr_close_socket(sock); - fprintf(stderr, "Could not bind\n"); + fprintf(stderr, "Could not bind: %s\n", + apr_strerror(stat, buf, sizeof buf)); exit(-1); } fprintf(stdout, "OK\n"); diff --git a/test/testsf.c b/test/testsf.c index e749518a627..cbd3a4c1e27 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -90,7 +90,7 @@ int main(void) typedef enum {BLK, NONBLK, TIMEOUT} client_socket_mode_t; -static void apr_setup(apr_pool_t **p, apr_socket_t **sock) +static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family) { char buf[120]; apr_status_t rv; @@ -114,13 +114,26 @@ static void apr_setup(apr_pool_t **p, apr_socket_t **sock) } *sock = NULL; - rv = apr_create_tcp_socket(sock, *p); + rv = apr_create_socket(sock, *family, SOCK_STREAM, *p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_create_tcp_socket()->%d/%s\n", + fprintf(stderr, "apr_create_socket()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } + + if (*family == APR_UNSPEC) { + apr_sockaddr_t *localsa; + + rv = apr_get_sockaddr(&localsa, APR_LOCAL, *sock); + if (rv != APR_SUCCESS) { + fprintf(stderr, "apr_get_sockaddr()->%d/%s\n", + rv, + apr_strerror(rv, buf, sizeof buf)); + exit(1); + } + *family = localsa->sa.sin.sin_family; + } } static void create_testfile(apr_pool_t *p, const char *fname) @@ -205,9 +218,11 @@ static int client(client_socket_mode_t socket_mode) apr_pollfd_t *pfd; apr_int32_t nsocks; int i; + int family; apr_sockaddr_t *destsa; - apr_setup(&p, &sock); + family = APR_INET; + apr_setup(&p, &sock, &family); create_testfile(p, TESTFILE); rv = apr_open(&f, TESTFILE, APR_READ, 0, p); @@ -218,7 +233,7 @@ static int client(client_socket_mode_t socket_mode) exit(1); } - rv = apr_getaddrinfo(&destsa, "127.0.0.1", APR_INET, TESTSF_PORT, 0, p); + rv = apr_getaddrinfo(&destsa, "127.0.0.1", family, TESTSF_PORT, 0, p); if (rv != APR_SUCCESS) { fprintf(stderr, "apr_getaddrinfo()->%d/%s\n", rv, @@ -493,26 +508,29 @@ static int server(void) int i; apr_socket_t *newsock = NULL; apr_ssize_t bytes_read; + apr_sockaddr_t *localsa; + int family; - apr_setup(&p, &sock); + family = APR_UNSPEC; + apr_setup(&p, &sock, &family); - rv = apr_set_port(sock, APR_LOCAL, TESTSF_PORT); + rv = apr_setsocketopt(sock, APR_SO_REUSEADDR, 1); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_set_local_port()->%d/%s\n", + fprintf(stderr, "apr_setsocketopt()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = apr_setsocketopt(sock, APR_SO_REUSEADDR, 1); + rv = apr_getaddrinfo(&localsa, NULL, family, TESTSF_PORT, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_setsocketopt()->%d/%s\n", + fprintf(stderr, "apr_getaddrinfo()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = apr_bind(sock); + rv = apr_bind(sock, localsa); if (rv != APR_SUCCESS) { fprintf(stderr, "apr_bind()->%d/%s\n", rv, From fd41ad5bd76af8c998e8a6c2e5d9181802a0039f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 19 Nov 2000 18:11:17 +0000 Subject: [PATCH 0794/7878] Take care of some newer Win32 SDK symbols Submitted by: Jeff Trawick Reviewed by: Will Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60772 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 1cd34db4f56..cf5a8008703 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -62,6 +62,17 @@ #include "atime.h" #include "misc.h" +/* Entries missing from the MSVC 5.0 Win32 SDK: + */ +#ifndef FILE_ATTRIBUTE_REPARSE_POINT +#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 +#endif +#ifndef FILE_FLAG_OPEN_NO_RECALL +#define FILE_FLAG_OPEN_NO_RECALL 0x00100000 +#endif +#ifndef FILE_FLAG_OPEN_REPARSE_POINT +#define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000 +#endif BOOLEAN is_exe(const char* fname, apr_pool_t *cont) { /* From 5f13db659bd29c00e3f8efc6dbd0579dac14db7d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 20 Nov 2000 19:57:41 +0000 Subject: [PATCH 0795/7878] As reported by Jeff Trawick, winsock errors simply don't run through FormatMessage on all Win32 platforms. This patch addresses the problem, and leaves room for other obsure errors to be added. Obviously, the apr_os_strerror doesn't belong in a single source file, but I'm not fixing that before the a8 release. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60773 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 68 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 7938fc325ae..fe7316b0f70 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -206,12 +206,68 @@ static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) #elif defined(WIN32) +static struct { + apr_status_t code; + char *msg; +} gaErrorList[] = { + WSAEINTR, "Interrupted system call", + WSAEBADF, "Bad file number", + WSAEACCES, "Permission denied", + WSAEFAULT, "Bad address", + WSAEINVAL, "Invalid argument", + WSAEMFILE, "Too many open sockets", + WSAEWOULDBLOCK, "Operation would block", + WSAEINPROGRESS, "Operation now in progress", + WSAEALREADY, "Operation already in progress", + WSAENOTSOCK, "Socket operation on non-socket", + WSAEDESTADDRREQ, "Destination address required", + WSAEMSGSIZE, "Message too long", + WSAEPROTOTYPE, "Protocol wrong type for socket", + WSAENOPROTOOPT, "Bad protocol option", + WSAEPROTONOSUPPORT, "Protocol not supported", + WSAESOCKTNOSUPPORT, "Socket type not supported", + WSAEOPNOTSUPP, "Operation not supported on socket", + WSAEPFNOSUPPORT, "Protocol family not supported", + WSAEAFNOSUPPORT, "Address family not supported", + WSAEADDRINUSE, "Address already in use", + WSAEADDRNOTAVAIL, "Can't assign requested address", + WSAENETDOWN, "Network is down", + WSAENETUNREACH, "Network is unreachable", + WSAENETRESET, "Net connection reset", + WSAECONNABORTED, "Software caused connection abort", + WSAECONNRESET, "Connection reset by peer", + WSAENOBUFS, "No buffer space available", + WSAEISCONN, "Socket is already connected", + WSAENOTCONN, "Socket is not connected", + WSAESHUTDOWN, "Can't send after socket shutdown", + WSAETOOMANYREFS, "Too many references, can't splice", + WSAETIMEDOUT, "Connection timed out", + WSAECONNREFUSED, "Connection refused", + WSAELOOP, "Too many levels of symbolic links", + WSAENAMETOOLONG, "File name too long", + WSAEHOSTDOWN, "Host is down", + WSAEHOSTUNREACH, "No route to host", + WSAENOTEMPTY, "Directory not empty", + WSAEPROCLIM, "Too many processes", + WSAEUSERS, "Too many users", + WSAEDQUOT, "Disc quota exceeded", + WSAESTALE, "Stale NFS file handle", + WSAEREMOTE, "Too many levels of remote in path", + WSASYSNOTREADY, "Network system is unavailable", + WSAVERNOTSUPPORTED, "Winsock version out of range", + WSANOTINITIALISED, "WSAStartup not yet called", + WSAEDISCON, "Graceful shutdown in progress", + WSAHOST_NOT_FOUND, "Host not found", + WSANO_DATA, "No host data of that type was found", + 0, NULL +}; + + static char *apr_os_strerror(char *buf, apr_size_t bufsize, apr_status_t errcode) { DWORD len; DWORD i; - len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, errcode, @@ -220,6 +276,16 @@ static char *apr_os_strerror(char *buf, apr_size_t bufsize, apr_status_t errcode bufsize, NULL); + if (!len) { + for (i = 0; gaErrorList[i].msg; ++i) { + if (gaErrorList[i].code == errcode) { + apr_cpystrn(buf, gaErrorList[i].msg, bufsize); + len = strlen(buf); + break; + } + } + } + if (len) { /* FormatMessage put the message in the buffer, but it may * have embedded a newline (\r\n), and possible more than one. From f7416b75cdd0bbae3a8371349a70467f28c8928a Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 20 Nov 2000 22:51:40 +0000 Subject: [PATCH 0796/7878] Add a CHANGES file for APR. I am calling this the 8th alpha of APR, but I am perfectly will to change it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60776 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 CHANGES diff --git a/CHANGES b/CHANGES new file mode 100644 index 00000000000..332acb07ab0 --- /dev/null +++ b/CHANGES @@ -0,0 +1,3 @@ +Changes with APR a8 + *) Source was moved from the apache-2.0 repository. For all CHANGES + prior to this time, please see the apache-2.0 repository From 563fa63a5d86266d419d333acfe5580bc6f3c04b Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 20 Nov 2000 22:59:32 +0000 Subject: [PATCH 0797/7878] Add a STATUS file for APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60777 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 STATUS diff --git a/STATUS b/STATUS new file mode 100644 index 00000000000..0062e7209c0 --- /dev/null +++ b/STATUS @@ -0,0 +1,46 @@ +Apache 2.0 STATUS: +Last modified at [$Date: 2000/11/20 22:59:32 $] + +Release: + + 2.0a8 : released November 20, 2000 + 2.0a7 : released October 8, 2000 + 2.0a6 : released August 18, 2000 + 2.0a5 : released August 4, 2000 + 2.0a4 : released June 7, 2000 + 2.0a3 : released April 28, 2000 + 2.0a2 : released March 31, 2000 + 2.0a1 : released March 10, 2000 + +RELEASE SHOWSTOPPERS: + + +RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + + * Build scripts do not recognise AIX 4.2.1 pthreads + + * Win32: Implement ap_shm_ functions + + * Bill says we need a new procattr, APR_CREATE_SUSPENDED (or + something similar) to direct ap_create_process to create the + process suspended. We also need a call to wake up the suspended + process This may not be able to be implemented everywhere though. + + * Replace tables with a proper opaque ADT that has pluggable + implementations (including something like the existing data type, + plus hash tables for speed, with options for more later). + Status: fanf is working on this. + + * add a version number to apr_initialize() as an extra failsafe against + (APR) library version skew. + MsgID: <Pine.LNX.4.10.10005231712380.31927-100000@nebula.lyra.org> + Status: Greg +1 (volunteers), Jeff +1, Ryan +1, Tony -0(?) + + * The MM library is built as static and shared library. This should + be set up to build only the required version. + +Documentation that needs writing: + + * API documentation + Status: Ben Laurie has written some hooks documentation + (apache-2.0/htdocs/hooks.html) From bd09121c5da84c398102157dbbf3f6919457ea26 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 21 Nov 2000 00:30:44 +0000 Subject: [PATCH 0798/7878] apr_create_tcp_socket() has been removed. Use apr_create_socket() instead. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60778 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ aprlib.def | 1 - include/apr_network_io.h | 7 ------- libapr.def | 1 - network_io/os2/sockets.c | 5 ----- network_io/unix/sockets.c | 5 ----- network_io/win32/sockets.c | 5 ----- 7 files changed, 3 insertions(+), 24 deletions(-) diff --git a/CHANGES b/CHANGES index 332acb07ab0..8dba69821f1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ Changes with APR a8 + *) apr_create_tcp_socket() has been removed. Use apr_create_socket() + instead. [Jeff Trawick] + *) Source was moved from the apache-2.0 repository. For all CHANGES prior to this time, please see the apache-2.0 repository diff --git a/aprlib.def b/aprlib.def index eae7b8662ce..039a064fe06 100644 --- a/aprlib.def +++ b/aprlib.def @@ -54,7 +54,6 @@ EXPORTS apr_get_sockaddr apr_getaddrinfo apr_create_socket - apr_create_tcp_socket apr_shutdown apr_close_socket apr_bind diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 2aef5dfa17c..35d742e0f2b 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -205,13 +205,6 @@ struct apr_hdtr_t { /* function definitions */ -/** - * Create a socket for tcp communication. - * @param new_sock The new socket that has been setup. - * @param cont The pool to use - */ -apr_status_t apr_create_tcp_socket(apr_socket_t **new_sock, apr_pool_t *cont); - /** * Create a socket. * @param new_sock The new socket that has been set up. diff --git a/libapr.def b/libapr.def index eae7b8662ce..039a064fe06 100644 --- a/libapr.def +++ b/libapr.def @@ -54,7 +54,6 @@ EXPORTS apr_get_sockaddr apr_getaddrinfo apr_create_socket - apr_create_tcp_socket apr_shutdown apr_close_socket apr_bind diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index df2fa26a4f6..d2e7293dd85 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -165,11 +165,6 @@ apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, return APR_SUCCESS; } -apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) -{ - return apr_create_socket(new, AF_INET, SOCK_STREAM, cont); -} - apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { if (shutdown(thesocket->socketdes, how) == 0) { diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 6662aa36a7e..4da29f84a3f 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -151,11 +151,6 @@ apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, return APR_SUCCESS; } -apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) -{ - return apr_create_socket(new, APR_INET, SOCK_STREAM, cont); -} - apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { return (shutdown(thesocket->socketdes, how) == -1) ? errno : APR_SUCCESS; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index a0104e31c3b..7425ca70cb5 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -159,11 +159,6 @@ apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, return APR_SUCCESS; } -apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) -{ - return apr_create_socket(new, AF_INET, SOCK_STREAM, cont); -} - apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { int winhow; From b73a195e8726b95232f1c70603d969e520cd6483 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Tue, 21 Nov 2000 07:56:00 +0000 Subject: [PATCH 0799/7878] Add "const" to keep the working set smaller. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60779 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index fe7316b0f70..4edeb27e3ea 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -206,9 +206,9 @@ static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) #elif defined(WIN32) -static struct { +static const struct { apr_status_t code; - char *msg; + const char *msg; } gaErrorList[] = { WSAEINTR, "Interrupted system call", WSAEBADF, "Bad file number", From fc7a796b8fccbc61c895748c966f0ce5faf4bdef Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 21 Nov 2000 19:08:29 +0000 Subject: [PATCH 0800/7878] Some of the forewarned APR network_io interface changes: apr_set_port(), apr_get_port(), apr_set_ipaddr(), and apr_get_ipaddr() now take apr_sockaddr_t as a parameter instead of apr_socket_t + apr_interface_e. This will allow the same routines to be used with datagram APIs to be added later. Note that code which calls apr_set_ipaddr() should probably be changed to call apr_getaddrinfo() for protocol independence. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60780 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++ include/apr_network_io.h | 39 +++++++--------- network_io/beos/sockaddr.c | 27 ----------- network_io/unix/sa_common.c | 92 ++++++++++++++++++------------------- network_io/unix/sockaddr.c | 28 ----------- network_io/win32/sockaddr.c | 27 ----------- 6 files changed, 67 insertions(+), 153 deletions(-) diff --git a/CHANGES b/CHANGES index 8dba69821f1..be5e75ac493 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,11 @@ Changes with APR a8 + *) apr_set_port(), apr_get_port(), apr_set_ipaddr(), and apr_get_ipaddr() + now take apr_sockaddr_t as a parameter instead of apr_socket_t + + apr_interface_e. This will allow the same routines to be used with + datagram APIs to be added later. Note that code which calls + apr_set_ipaddr() should probably be changed to call apr_getaddrinfo() + for protocol independence. [Jeff Trawick] + *) apr_create_tcp_socket() has been removed. Use apr_create_socket() instead. [Jeff Trawick] diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 35d742e0f2b..e5cf1d74ebc 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -457,41 +457,34 @@ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t* apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock); /** - * Associate a port with a socket. - * @param sock The socket to set. - * @param which Which socket do we want to set the port for? - * @param port The local port this socket will be dealing with. - * @tip This does not bind the two together, it is just telling apr - * that this socket is going to use this port if possible. If - * the port is already used, we won't find out about it here. + * Set the port in an APR socket address. + * @param sockaddr The socket address to set. + * @param port The port to be stored in the socket address. */ -apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, apr_port_t port); +apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port); /** - * Return the port associated with a socket. - * @param port The local port this socket is associated with. - * @param which Which interface are we getting the port for? - * @param sock The socket to enquire about. + * Return the port in an APR socket address. + * @param port The port from the socket address. + * @param sock The socket address to reference. */ -apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t *sock); +apr_status_t apr_get_port(apr_port_t *port, apr_sockaddr_t *sockaddr); /** - * Associate a socket addr with an apr socket. - * @param sock The socket to use - * @param which Which interface should we set? + * Set the IP address in an APR socket address. + * @param sockaddr The socket address to use * @param addr The IP address to attach to the socket. * Use APR_ANYADDR to use any IP addr on the machine. - * @tip This does not bind the two together, it is just telling apr - * that this socket is going to use this address if possible. */ -apr_status_t apr_set_ipaddr(apr_socket_t *sock, apr_interface_e which, const char *addr); +apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr); /** - * Return the IP address associated with an apr socket. - * @param addr The local IP address associated with the socket. - * @param sock The socket to use + * Return the IP address (in numeric address string format) in + * an APR socket address. + * @param addr The IP address. + * @param sock The socket address to reference. */ -apr_status_t apr_get_ipaddr(char **addr, apr_interface_e which, apr_socket_t *sock); +apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr); /** * Return the local socket name as a BSD style struct sockaddr_in. diff --git a/network_io/beos/sockaddr.c b/network_io/beos/sockaddr.c index 4b369ff9f95..8c3b67a60fa 100644 --- a/network_io/beos/sockaddr.c +++ b/network_io/beos/sockaddr.c @@ -75,33 +75,6 @@ static apr_status_t get_local_addr(apr_socket_t *sock) /* Include this here so we already have get_local_addr... */ #include "../unix/sa_common.c" -apr_status_t apr_set_ipaddr(apr_socket_t *sock, apr_interface_e which, const char *addr) -{ - u_long ipaddr; - struct sockaddr_in *ptr; - - if (which == APR_LOCAL) - ptr = sock->local_addr; - else if (which == APR_REMOTE) - ptr = sock->remote_addr; - else - return APR_EINVAL; - - if (!strcmp(addr, APR_ANYADDR)) { - ptr->sin_addr.s_addr = htonl(INADDR_ANY); - return APR_SUCCESS; - } - - ipaddr = inet_addr(addr); - - if (ipaddr == -1) { - return errno; - } - - ptr->sin_addr.s_addr = ipaddr; - return APR_SUCCESS; -} - apr_status_t get_local_name(struct sockaddr_in **name, apr_socket_t *sock) { if (!sock) { diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 0435e39e888..4d9e9629ad3 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -65,65 +65,54 @@ #include "apr.h" -apr_status_t apr_set_port(apr_socket_t *sock, apr_interface_e which, - apr_port_t port) +apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port) { /* XXX IPv6: assumes sin_port and sin6_port at same offset */ - if (which == APR_LOCAL) - sock->local_addr->sa.sin.sin_port = htons(port); - else if (which == APR_REMOTE) - sock->remote_addr->sa.sin.sin_port = htons(port); - else - return APR_EINVAL; + sockaddr->sa.sin.sin_port = htons(port); + sockaddr->sa.sin.sin_port = htons(port); return APR_SUCCESS; } -apr_status_t apr_get_port(apr_port_t *port, apr_interface_e which, apr_socket_t *sock) +/* XXX assumes IPv4... I don't think this function is needed anyway + * since we have apr_getaddrinfo(), but we need to clean up Apache's + * listen.c a bit more first. + */ +apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr) { - /* XXX IPv6: assumes sin_port and sin6_port at same offset */ - if (which == APR_LOCAL) - { - if (sock->local_port_unknown) { - apr_status_t rv = get_local_addr(sock); - - if (rv != APR_SUCCESS) { - return rv; - } - } - *port = ntohs(sock->local_addr->sa.sin.sin_port); - } else if (which == APR_REMOTE) - *port = ntohs(sock->remote_addr->sa.sin.sin_port); - else - return APR_EINVAL; + u_long ipaddr; + + if (!strcmp(addr, APR_ANYADDR)) { + sockaddr->sa.sin.sin_addr.s_addr = htonl(INADDR_ANY); + return APR_SUCCESS; + } + + ipaddr = inet_addr(addr); + if (ipaddr == (u_long)-1) { +#ifdef WIN32 + return WSAEADDRNOTAVAIL; +#else + return errno; +#endif + } + + sockaddr->sa.sin.sin_addr.s_addr = ipaddr; return APR_SUCCESS; } -apr_status_t apr_get_ipaddr(char **addr, apr_interface_e which, apr_socket_t *sock) +apr_status_t apr_get_port(apr_port_t *port, apr_sockaddr_t *sockaddr) { - if (which == APR_LOCAL) { - if (sock->local_interface_unknown) { - apr_status_t rv = get_local_addr(sock); - - if (rv != APR_SUCCESS) { - return rv; - } - } - *addr = apr_palloc(sock->cntxt, sock->local_addr->addr_str_len); - apr_inet_ntop(sock->local_addr->sa.sin.sin_family, - sock->local_addr->ipaddr_ptr, - *addr, - sock->local_addr->addr_str_len); - } - else if (which == APR_REMOTE) { - *addr = apr_palloc(sock->cntxt, sock->remote_addr->addr_str_len); - apr_inet_ntop(sock->remote_addr->sa.sin.sin_family, - sock->remote_addr->ipaddr_ptr, - *addr, - sock->remote_addr->addr_str_len); - } - else - return APR_EINVAL; + /* XXX IPv6 - assumes sin_port and sin6_port at same offset */ + *port = ntohs(sockaddr->sa.sin.sin_port); + return APR_SUCCESS; +} +apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr) +{ + *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len); + apr_inet_ntop(sockaddr->sa.sin.sin_family, + sockaddr->ipaddr_ptr, + *addr, + sockaddr->addr_str_len); return APR_SUCCESS; } @@ -194,6 +183,13 @@ static void set_sockaddr_vars(apr_sockaddr_t *addr, int family) apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock) { if (which == APR_LOCAL) { + if (sock->local_interface_unknown || sock->local_port_unknown) { + apr_status_t rv = get_local_addr(sock); + + if (rv != APR_SUCCESS) { + return rv; + } + } *sa = sock->local_addr; } else if (which == APR_REMOTE) { diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 196879ec12d..f29d01edd64 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -71,34 +71,6 @@ static apr_status_t get_local_addr(apr_socket_t *sock) /* included here to allow us to use local_addr */ #include "sa_common.c" -apr_status_t apr_set_ipaddr(apr_socket_t *sock, apr_interface_e which, const char *addr) -{ - u_long ipaddr; - struct sockaddr_in *sa_ptr; - - /* XXX IPv6 */ - if (which == APR_LOCAL) - sa_ptr = &sock->local_addr->sa.sin; - else if (which == APR_REMOTE) - sa_ptr = &sock->remote_addr->sa.sin; - else - return APR_EINVAL; - - if (!strcmp(addr, APR_ANYADDR)) { - sa_ptr->sin_addr.s_addr = htonl(INADDR_ANY); - return APR_SUCCESS; - } - - ipaddr = inet_addr(addr); - - if (ipaddr == -1) { - return errno; - } - - sa_ptr->sin_addr.s_addr = ipaddr; - return APR_SUCCESS; -} - #if APR_HAVE_NETINET_IN_H /* XXX IPv6 */ apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index d3176b7461b..53a335123d1 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -74,33 +74,6 @@ static apr_status_t get_local_addr(apr_socket_t *sock) /* Include this here so we have get_local_addr defined... */ #include "../unix/sa_common.c" -apr_status_t apr_set_ipaddr(apr_socket_t *sock, apr_interface_e which, const char *addr) -{ - u_long ipaddr; - struct sockaddr_in *ptr; - - if (which == APR_LOCAL) - ptr = &sock->local_addr->sa.sin; - else if (which == APR_REMOTE) - ptr = &sock->remote_addr->sa.sin; - else - return APR_EINVAL; - - if (!strcmp(addr, APR_ANYADDR)) { - ptr->sin_addr.s_addr = htonl(INADDR_ANY); - return APR_SUCCESS; - } - - ipaddr = inet_addr(addr); - - if (ipaddr == APR_INADDR_NONE) { - return WSAEADDRNOTAVAIL; - } - - ptr->sin_addr.s_addr = ipaddr; - return APR_SUCCESS; -} - apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) { if (sock->local_port_unknown || sock->local_interface_unknown) { From eca1d1921046c203b4277823096f661f8edeaa07 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 21 Nov 2000 19:15:27 +0000 Subject: [PATCH 0801/7878] updates to changed interfaces to apr_set_port(), apr_get_port(), apr_set_ipaddr(), and apr_get_ipaddr() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60781 13f79535-47bb-0310-9956-ffa450edef68 --- test/client.c | 18 ++++++++++-------- test/server.c | 14 ++++++++------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/test/client.c b/test/client.c index f73f146062e..1d52f2548e9 100644 --- a/test/client.c +++ b/test/client.c @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) char *dest = "127.0.0.1"; apr_port_t local_port, remote_port; apr_interval_time_t read_timeout = -1; - apr_sockaddr_t *destsa; + apr_sockaddr_t *local_sa, *remote_sa; setbuf(stdout, NULL); if (argc > 1) { @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK\n"); fprintf(stdout,"\tClient: Making socket address..............."); - if ((stat = apr_getaddrinfo(&destsa, dest, APR_UNSPEC, 8021, 0, context)) + if ((stat = apr_getaddrinfo(&remote_sa, dest, APR_UNSPEC, 8021, 0, context)) != APR_SUCCESS) { fprintf(stdout, "Failed!\n"); fprintf(stdout, "Address resolution failed for %s: %s\n", @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) fprintf(stdout,"OK\n"); fprintf(stdout, "\tClient: Creating new socket......."); - if (apr_create_socket(&sock, destsa->sa.sin.sin_family, SOCK_STREAM, + if (apr_create_socket(&sock, remote_sa->sa.sin.sin_family, SOCK_STREAM, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); @@ -119,7 +119,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "\tClient: Connecting to socket......."); - stat = apr_connect(sock, destsa); + stat = apr_connect(sock, remote_sa); if (stat != APR_SUCCESS) { apr_close_socket(sock); @@ -140,10 +140,12 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK\n"); } - apr_get_ipaddr(&remote_ipaddr, APR_REMOTE, sock); - apr_get_port(&remote_port, APR_REMOTE, sock); - apr_get_ipaddr(&local_ipaddr, APR_LOCAL, sock); - apr_get_port(&local_port, APR_LOCAL, sock); + apr_get_sockaddr(&remote_sa, APR_REMOTE, sock); + apr_get_ipaddr(&remote_ipaddr, remote_sa); + apr_get_port(&remote_port, remote_sa); + apr_get_sockaddr(&local_sa, APR_LOCAL, sock); + apr_get_ipaddr(&local_ipaddr, local_sa); + apr_get_port(&local_port, local_sa); fprintf(stdout, "\tClient socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); fprintf(stdout, "\tClient: Trying to send data over socket......."); diff --git a/test/server.c b/test/server.c index e0146b4381e..e8adef8deba 100644 --- a/test/server.c +++ b/test/server.c @@ -73,7 +73,7 @@ int main(int argc, char * const argv[]) const char *bind_to_ipaddr = NULL; char *local_ipaddr, *remote_ipaddr; apr_port_t local_port, remote_port; - apr_sockaddr_t *localsa = NULL; + apr_sockaddr_t *localsa = NULL, *remotesa; apr_status_t stat; int family = APR_UNSPEC; char buf[128]; @@ -155,8 +155,8 @@ int main(int argc, char * const argv[]) fprintf(stdout, "OK\n"); if (!localsa) { - apr_set_port(sock, APR_LOCAL, 8021); apr_get_sockaddr(&localsa, APR_LOCAL, sock); + apr_set_port(localsa, 8021); } fprintf(stdout, "\tServer: Binding socket to port......."); @@ -203,10 +203,12 @@ int main(int argc, char * const argv[]) } fprintf(stdout, "OK\n"); - apr_get_ipaddr(&remote_ipaddr, APR_REMOTE, sock2); - apr_get_port(&remote_port, APR_REMOTE, sock2); - apr_get_ipaddr(&local_ipaddr, APR_LOCAL, sock2); - apr_get_port(&local_port, APR_LOCAL, sock2); + apr_get_sockaddr(&remotesa, APR_REMOTE, sock2); + apr_get_ipaddr(&remote_ipaddr, remotesa); + apr_get_port(&remote_port, remotesa); + apr_get_sockaddr(&localsa, APR_LOCAL, sock2); + apr_get_ipaddr(&local_ipaddr, localsa); + apr_get_port(&local_port, localsa); fprintf(stdout, "\tServer socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); length = STRLEN; From cccb8f0eeab4263eb6bc9febf279f1803a360c19 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 21 Nov 2000 19:34:41 +0000 Subject: [PATCH 0802/7878] restore the pre-split .cvsignore git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60782 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .cvsignore diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 00000000000..385143cc4a8 --- /dev/null +++ b/.cvsignore @@ -0,0 +1,15 @@ +Makefile +config.cache +config.log +config.status +configure +APRVARS +objs +.deps +LibD +LibR +Debug +Release +*.mak +*.opt +*.plg From b347092f2d18486a9f710da4fafd82de76f27a12 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 21 Nov 2000 21:17:27 +0000 Subject: [PATCH 0803/7878] Remove a duplicate line in apr_set_port() and fix some comments. Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60783 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 4 ++-- network_io/unix/sa_common.c | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index e5cf1d74ebc..c0206fbb783 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -466,7 +466,7 @@ apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port); /** * Return the port in an APR socket address. * @param port The port from the socket address. - * @param sock The socket address to reference. + * @param sockaddr The socket address to reference. */ apr_status_t apr_get_port(apr_port_t *port, apr_sockaddr_t *sockaddr); @@ -482,7 +482,7 @@ apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr); * Return the IP address (in numeric address string format) in * an APR socket address. * @param addr The IP address. - * @param sock The socket address to reference. + * @param sockaddr The socket address to reference. */ apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr); diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 4d9e9629ad3..5cdeba22033 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -69,7 +69,6 @@ apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port) { /* XXX IPv6: assumes sin_port and sin6_port at same offset */ sockaddr->sa.sin.sin_port = htons(port); - sockaddr->sa.sin.sin_port = htons(port); return APR_SUCCESS; } From 7d5f3daab9e56d2447da7a27e49dc89e37b541ff Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 21 Nov 2000 21:33:08 +0000 Subject: [PATCH 0804/7878] Rename sa_len to salen in apr_sockaddr_t. Some platforms have a macro named sa_len, and this was confusing them PR: 6874 Submitted by: Tony Finch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60784 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_network_io.h | 2 +- network_io/os2/sockets.c | 14 +++++++------- network_io/unix/sa_common.c | 8 ++++---- network_io/unix/sockaddr.c | 4 ++-- network_io/unix/sockets.c | 16 ++++++++-------- network_io/win32/sockaddr.c | 4 ++-- network_io/win32/sockets.c | 16 ++++++++-------- 8 files changed, 36 insertions(+), 32 deletions(-) diff --git a/CHANGES b/CHANGES index be5e75ac493..5e3d300bb9c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR a8 + *) Change the name of the sa_len field in apr_sockaddr_t to salen. + Some platforms have a macro named sa_len. + [Tony Finch] + *) apr_set_port(), apr_get_port(), apr_set_ipaddr(), and apr_get_ipaddr() now take apr_sockaddr_t as a parameter instead of apr_socket_t + apr_interface_e. This will allow the same routines to be used with diff --git a/include/apr_network_io.h b/include/apr_network_io.h index c0206fbb783..73813194c4b 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -170,7 +170,7 @@ typedef struct apr_sockaddr_t { struct sockaddr_in6 sin6; /* IPv6 sockaddr structure */ #endif } sa; - apr_socklen_t sa_len; /* How big is the sockaddr we're using? */ + apr_socklen_t salen; /* How big is the sockaddr we're using? */ int ipaddr_len; /* How big is the ip address structure * we're using? */ diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index d2e7293dd85..4c507174203 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -89,24 +89,24 @@ static void set_socket_vars(apr_socket_t *sock, int family) sock->remote_addr->sa.sin.sin_family = family; if (family == AF_INET) { - sock->local_addr->sa_len = sizeof(struct sockaddr_in); + sock->local_addr->salen = sizeof(struct sockaddr_in); sock->local_addr->addr_str_len = 16; sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin.sin_addr); sock->local_addr->ipaddr_len = sizeof(struct in_addr); - sock->remote_addr->sa_len = sizeof(struct sockaddr_in); + sock->remote_addr->salen = sizeof(struct sockaddr_in); sock->remote_addr->addr_str_len = 16; sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin.sin_addr); sock->remote_addr->ipaddr_len = sizeof(struct in_addr); } #if APR_HAVE_IPV6 else if (family == AF_INET6) { - sock->local_addr->sa_len = sizeof(struct sockaddr_in6); + sock->local_addr->salen = sizeof(struct sockaddr_in6); sock->local_addr->addr_str_len = 46; sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin6.sin6_addr); sock->local_addr->ipaddr_len = sizeof(struct in6_addr); - sock->remote_addr->sa_len = sizeof(struct sockaddr_in6); + sock->remote_addr->salen = sizeof(struct sockaddr_in6); sock->remote_addr->addr_str_len = 46; sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin6.sin6_addr); sock->remote_addr->ipaddr_len = sizeof(struct in6_addr); @@ -188,7 +188,7 @@ apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) { if (bind(sock->socketdes, (struct sockaddr *)&sa->sa, - sa->sa_len) == -1) + sa->salen) == -1) return APR_OS2_STATUS(sock_errno()); else { sock->local_sa = sa; @@ -214,7 +214,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn (*new)->socketdes = accept(sock->socketdes, (struct sockaddr *)&(*new)->remote_addr->sa, - &(*new)->remote_addr->sa_len); + &(*new)->remote_addr->salen); if ((*new)->socketdes < 0) { return APR_OS2_STATUS(sock_errno()); @@ -228,7 +228,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { if ((connect(sock->socketdes, (struct sockaddr *)&sa->sa.sin, - sa->sa_len) < 0) && + sa->salen) < 0) && (sock_errno() != SOCEINPROGRESS)) { return APR_OS2_STATUS(sock_errno()); } diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 5cdeba22033..44daea9c29f 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -164,14 +164,14 @@ static void set_sockaddr_vars(apr_sockaddr_t *addr, int family) addr->sa.sin.sin_family = family; if (family == APR_INET) { - addr->sa_len = sizeof(struct sockaddr_in); + addr->salen = sizeof(struct sockaddr_in); addr->addr_str_len = 16; addr->ipaddr_ptr = &(addr->sa.sin.sin_addr); addr->ipaddr_len = sizeof(struct in_addr); } #if APR_HAVE_IPV6 else if (family == APR_INET6) { - addr->sa_len = sizeof(struct sockaddr_in6); + addr->salen = sizeof(struct sockaddr_in6); addr->addr_str_len = 46; addr->ipaddr_ptr = &(addr->sa.sin6.sin6_addr); addr->ipaddr_len = sizeof(struct in6_addr); @@ -266,7 +266,7 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, if (*hostname >= '0' && *hostname <= '9' && strspn(hostname, "0123456789.") == strlen(hostname)) { (*sa)->sa.sin.sin_addr.s_addr = inet_addr(hostname); - (*sa)->sa_len = sizeof(struct sockaddr_in); + (*sa)->salen = sizeof(struct sockaddr_in); } else { #endif @@ -282,7 +282,7 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, memcpy((char *)&(*sa)->sa.sin.sin_addr, hp->h_addr_list[0], hp->h_length); - (*sa)->sa_len = sizeof(struct sockaddr_in); + (*sa)->salen = sizeof(struct sockaddr_in); (*sa)->ipaddr_len = hp->h_length; #ifndef GETHOSTBYNAME_HANDLES_NAS diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index f29d01edd64..4be3a73ae49 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -57,9 +57,9 @@ static apr_status_t get_local_addr(apr_socket_t *sock) { - sock->local_addr->sa_len = sizeof(sock->local_addr->sa); + sock->local_addr->salen = sizeof(sock->local_addr->sa); if (getsockname(sock->socketdes, (struct sockaddr *)&sock->local_addr->sa, - &sock->local_addr->sa_len) < 0) { + &sock->local_addr->salen) < 0) { return errno; } else { diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 4da29f84a3f..3e055e62ee2 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -78,24 +78,24 @@ static void set_socket_vars(apr_socket_t *sock, int family) sock->remote_addr->sa.sin.sin_family = family; if (family == APR_INET) { - sock->local_addr->sa_len = sizeof(struct sockaddr_in); + sock->local_addr->salen = sizeof(struct sockaddr_in); sock->local_addr->addr_str_len = 16; sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin.sin_addr); sock->local_addr->ipaddr_len = sizeof(struct in_addr); - sock->remote_addr->sa_len = sizeof(struct sockaddr_in); + sock->remote_addr->salen = sizeof(struct sockaddr_in); sock->remote_addr->addr_str_len = 16; sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin.sin_addr); sock->remote_addr->ipaddr_len = sizeof(struct in_addr); } #if APR_HAVE_IPV6 else if (family == APR_INET6) { - sock->local_addr->sa_len = sizeof(struct sockaddr_in6); + sock->local_addr->salen = sizeof(struct sockaddr_in6); sock->local_addr->addr_str_len = 46; sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin6.sin6_addr); sock->local_addr->ipaddr_len = sizeof(struct in6_addr); - sock->remote_addr->sa_len = sizeof(struct sockaddr_in6); + sock->remote_addr->salen = sizeof(struct sockaddr_in6); sock->remote_addr->addr_str_len = 46; sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin6.sin6_addr); sock->remote_addr->ipaddr_len = sizeof(struct in6_addr); @@ -165,7 +165,7 @@ apr_status_t apr_close_socket(apr_socket_t *thesocket) apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) { if (bind(sock->socketdes, - (struct sockaddr *)&sa->sa, sa->sa_len) == -1) { + (struct sockaddr *)&sa->sa, sa->salen) == -1) { return errno; } else { @@ -196,10 +196,10 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn #endif (*new)->timeout = -1; - (*new)->remote_addr->sa_len = sizeof((*new)->remote_addr->sa); + (*new)->remote_addr->salen = sizeof((*new)->remote_addr->sa); (*new)->socketdes = accept(sock->socketdes, (struct sockaddr *)&(*new)->remote_addr->sa, - &(*new)->remote_addr->sa_len); + &(*new)->remote_addr->salen); if ((*new)->socketdes < 0) { return errno; @@ -236,7 +236,7 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) if ((connect(sock->socketdes, (const struct sockaddr *)&sa->sa.sin, - sa->sa_len) < 0) && + sa->salen) < 0) && (errno != EINPROGRESS)) { return errno; } diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index 53a335123d1..96d40c3482c 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -60,9 +60,9 @@ static apr_status_t get_local_addr(apr_socket_t *sock) { - sock->local_addr->sa_len = sizeof(sock->local_addr->sa); + sock->local_addr->salen = sizeof(sock->local_addr->sa); if (getsockname(sock->sock, (struct sockaddr *)&sock->local_addr->sa, - &sock->local_addr->sa_len) < 0) { + &sock->local_addr->salen) < 0) { return apr_get_netos_error(); } else { diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 7425ca70cb5..13df55c11c1 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -78,24 +78,24 @@ static void set_socket_vars(apr_socket_t *sock, int family) sock->remote_addr->sa.sin.sin_family = family; if (family == AF_INET) { - sock->local_addr->sa_len = sizeof(struct sockaddr_in); + sock->local_addr->salen = sizeof(struct sockaddr_in); sock->local_addr->addr_str_len = 16; sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin.sin_addr); sock->local_addr->ipaddr_len = sizeof(struct in_addr); - sock->remote_addr->sa_len = sizeof(struct sockaddr_in); + sock->remote_addr->salen = sizeof(struct sockaddr_in); sock->remote_addr->addr_str_len = 16; sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin.sin_addr); sock->remote_addr->ipaddr_len = sizeof(struct in_addr); } #if APR_HAVE_IPV6 else if (family == AF_INET6) { - sock->local_addr->sa_len = sizeof(struct sockaddr_in6); + sock->local_addr->salen = sizeof(struct sockaddr_in6); sock->local_addr->addr_str_len = 46; sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin6.sin6_addr); sock->local_addr->ipaddr_len = sizeof(struct in6_addr); - sock->remote_addr->sa_len = sizeof(struct sockaddr_in6); + sock->remote_addr->salen = sizeof(struct sockaddr_in6); sock->remote_addr->addr_str_len = 46; sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin6.sin6_addr); sock->remote_addr->ipaddr_len = sizeof(struct in6_addr); @@ -195,7 +195,7 @@ apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) { if (bind(sock->sock, (struct sockaddr *)&sa->sa, - sa->sa_len) == -1) { + sa->salen) == -1) { return apr_get_netos_error(); } else { @@ -223,10 +223,10 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn (*new)->timeout = -1; (*new)->disconnected = 0; - (*new)->remote_addr->sa_len = sizeof((*new)->remote_addr->sa); + (*new)->remote_addr->salen = sizeof((*new)->remote_addr->sa); (*new)->sock = accept(sock->sock, (struct sockaddr *)&(*new)->remote_addr->sa, - &(*new)->remote_addr->sa_len); + &(*new)->remote_addr->salen); if ((*new)->sock == INVALID_SOCKET) { return apr_get_netos_error(); @@ -264,7 +264,7 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) } if (connect(sock->sock, (const struct sockaddr *)&sa->sa.sin, - sa->sa_len) == SOCKET_ERROR) { + sa->salen) == SOCKET_ERROR) { lasterror = apr_get_netos_error(); if (lasterror != APR_FROM_OS_ERROR(WSAEWOULDBLOCK)) { return lasterror; From 087f45a1608694a37ab5cd5c1590f421d21fbcd8 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Wed, 22 Nov 2000 11:29:18 +0000 Subject: [PATCH 0805/7878] OS/2: fix return type of apr_dso_error() & squash warnings about string functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60785 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os2/dso.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dso/os2/dso.c b/dso/os2/dso.c index d7706f13882..9bd9ccc8adc 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -53,6 +53,7 @@ */ #include "dso.h" +#include "apr_strings.h" #define INCL_DOS #include <os2.h> #include <stdio.h> @@ -127,7 +128,7 @@ apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, -char *apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) +const char *apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) { char message[200]; apr_strerror(dso->load_error, message, sizeof(message)); From 79def33d783f3bf54b9206aa248990b91116eaaf Mon Sep 17 00:00:00 2001 From: Greg Ames <gregames@apache.org> Date: Wed, 22 Nov 2000 17:43:54 +0000 Subject: [PATCH 0806/7878] Further clarification of apr_sendfile()'s "len" parm git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60786 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 73813194c4b..a3f3a7cdfe8 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -372,7 +372,9 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, * @param file The open file from which to read * @param hdtr A structure containing the headers and trailers to send * @param offset Offset into the file where we should begin writing - * @param len Number of bytes to send from the file + * @param len (input) - Number of bytes to send from the file + * (output) - Number of bytes actually sent, + * including headers, file, and trailers * @param flags APR flags that are mapped to OS specific flags * @tip This functions acts like a blocking write by default. To change * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. From e2e8baa102c81476af7fccd486df2b455e291574 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Fri, 24 Nov 2000 00:21:35 +0000 Subject: [PATCH 0807/7878] This adds a simple apr_getservbyname to APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60787 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 8 ++++++++ network_io/unix/sa_common.c | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index a3f3a7cdfe8..4fbdc2b16b3 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -637,6 +637,14 @@ apr_status_t apr_get_inaddr(apr_in_addr_t *addr, char *hostname); apr_status_t apr_get_socket_inaddr(apr_in_addr_t *addr, apr_interface_e which, apr_socket_t *sock); +/** + * Given an apr_sockaddr_t and a service name, set the port for the service + * @param sockaddr The apr_sockaddr_t that will have it's port set + * @param servname The name of the service you wish to use + */ + +apr_status_t apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname); + #ifdef __cplusplus } #endif diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 44daea9c29f..b3e738f1559 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -294,3 +294,20 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, (*sa)->sa.sin.sin_port = htons(port); return APR_SUCCESS; } + +apr_status_t apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname) +{ + struct servent *se; + + if (servname == NULL) + return APR_EINVAL; + + if ((se = getservbyname(servname, NULL)) != NULL){ + sockaddr->port = htons(se->s_port); + sockaddr->servname = apr_pstrdup(sockaddr->pool, servname); + sockaddr->sa.sin.sin_port = se->s_port; + return APR_SUCCESS; + } + return errno; +} + From 094e2a302922d27878cdbb7dce3f68fa4af56fc0 Mon Sep 17 00:00:00 2001 From: Karl Fogel <kfogel@apache.org> Date: Sat, 25 Nov 2000 02:19:43 +0000 Subject: [PATCH 0808/7878] Changes from Greg Hudson <ghudson@mit.edu> (with minor meddling from Greg Stein <gstein@lyra.org> and Karl Fogel <kfogel@collab.net>): Simplify apr_getopt_long interface and add support for interleaving options with arguments. (apr_getopt_t, apr_initopt): Add "interleave" settable flag and "skip_start" and "skip_end" fields to keep track of skipped non-option arguments. Change argv to a char ** so that we can permute it. (apr_long_option_t): Renamed to apr_longopt_t. (apr_longopt_t): Rename "val" to "optch" and use for the short option name as well as the result. "name" can now be NULL, and a structure with an "optch" of 0 now terminates the list. (reverse, permute, serr, cerr): New helper functions. (apr_getopt_long): Rewrite for simplified interface and for interleaved option support. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60788 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 70 ++++++------- misc/unix/getopt.c | 234 ++++++++++++++++++++++++++++--------------- 2 files changed, 185 insertions(+), 119 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 76d13e2aa38..60bd114b528 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -77,23 +77,25 @@ struct apr_getopt_t { /** count of arguments */ int argc; /** array of pointers to arguments */ - char *const *argv; + char **argv; /** argument associated with option */ char const* place; + /** set to nonzero to support interleaving */ + int interleave; + /** range of non-option arguments skipped for interleaving */ + int skip_start; + int skip_end; }; -typedef struct apr_getopt_long_t apr_getopt_long_t; +typedef struct apr_longopt_t apr_longopt_t; -/* structure representing a single longopt */ -struct apr_getopt_long_t { - /** the name of the long argument (sans "--") */ +struct apr_longopt_t { + /** long option name, or NULL if option has no long name */ const char *name; - /** 0 for no arg, 1 for arg */ + /** option letter, or a value greater than 255 if option has no letter */ + int optch; + /** nonzero if option takes an argument */ int has_arg; - /** Either the short option char that this option corresponds to - * or a unique integer > 255 - */ - int val; }; /** @@ -106,7 +108,7 @@ struct apr_getopt_long_t { * @deffunc apr_status_t apr_initopt(apr_getopt_t **os, apr_pool_t *cont,int argc, char *const *argv) */ APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, - int argc, char *const *argv); + int argc, char **argv); /** * Parse the options initialized by apr_initopt(). @@ -131,26 +133,15 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, /** * Parse the options initialized by apr_initopt(), accepting long * options beginning with "--" in addition to single-character - * options beginning with "-" (which are passed along to apr_getopt). - * - * Long options are accepted in both "--foo bar" and well as - * "--foo=bar" format - * - * End of argument processing if we encounter "--" or any option that - * doesn't start with "-" or "--". - * - * @param os The apr_opt_t structure returned by apr_initopt() - * @param opts A string of acceptable single-character options to the - * program. Characters followed by ":" are required to have - * an argument associated - * @param longopts A pointer to an array of apr_long_option_t structures, which - * can be initialized with { "name", has_args, val }. has_args - * is nonzero if the option requires an argument. A structure - * with a NULL name terminates the list - * @param optval The next option character parsed, or the value of "optval" - * from the appropriate apr_long_option_t structure if - * the next option is a long option. - * @param optarg The argument following the option, if any + * options beginning with "-". + * @param os The apr_getopt_t structure created by apr_initopt() + * @param opts A pointer to a list of apr_longopt_t structures, which can + * be initialized with { "name", optch, has_args }. has_args + * is nonzero if the option requires an argument. A structure + * with an optch value of 0 terminates the list. + * @param optch Receives the value of "optch" from the apr_longopt_t structure + * corresponding to the next option matched. + * @param optarg Receives the argument following the option, if any. * @tip There are four potential status values on exit. They are: * <PRE> * APR_EOF -- No more options to parse @@ -158,11 +149,14 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, * APR_BADARG -- No argument followed @parameter: * APR_SUCCESS -- The next option was found. * </PRE> - * @deffunc apr_status_t apr_getopt_long(apr_getopt_t *os, const char *opts, const apr_getopt_long_t *longopts, int *optval, const char **optarg) */ -APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, - const char *opts, - const apr_getopt_long_t *long_opts, - int *optval, - const char **optarg); - + * When APR_SUCCESS is returned, os->ind gives the index of the first + * non-option argument. On error, a message will be printed to stdout unless + * os->err is set to 0. If os->interleave is set to nonzero, options can come + * after arguments, and os->argv will be permuted to leave non-option arguments + * at the end. + * @deffunc apr_status_t apr_getopt_long(apr_getopt_t *os, const apr_longopt_t *opts, int *optch, const char **optarg) + */ +APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, + const apr_longopt_t *opts, + int *optch, const char **optarg); #endif /* ! APR_GETOPT_H */ diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 2f553852462..5353dd89f2f 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -41,22 +41,26 @@ static const char *pretty_path (const char *name) { const char *p; + if (!(p = strrchr(name, '/'))) - return p; + return name; else - return ++p; + return p + 1; } APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, - int argc, char *const *argv) + int argc, char **argv) { *os = apr_palloc(cont, sizeof(apr_getopt_t)); (*os)->cont = cont; (*os)->err = 1; - (*os)->ind = 1; (*os)->place = EMSG; (*os)->argc = argc; (*os)->argv = argv; + (*os)->interleave = 0; + (*os)->ind = 1; + (*os)->skip_start = 1; + (*os)->skip_end = 1; return APR_SUCCESS; } @@ -130,90 +134,158 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, - const char *opts, - const apr_getopt_long_t *long_opts, - int *optval, - const char **optarg) - +/* Reverse the sequence argv[start..start+len-1]. */ +static void reverse(char **argv, int start, int len) { - const apr_getopt_long_t *ptr; - const char *opt = os->argv[os->ind]; - const char *arg = os->argv[os->ind +1]; - int arg_index_incr = 1; - - /* Finished processing opts */ - if (os->ind >= os->argc) - return APR_EOF; - - /* End of options processing if we encounter "--" */ - if (strcmp(opt, "--") == 0) - return APR_EOF; - - /* - * End of options processing if we encounter something that - * doesn't start with "-" or "--" (it's not an option if we hit it - * here, it's an argument) - */ - if (*opt != '-') - return APR_EOF; - - if ((os->ind + 1) >= os->argc) - arg = NULL; - - /* Handle --foo=bar style opts */ - if (strchr(opt, '=')) { - const char *index = strchr(opt, '=') + 1; - opt = apr_pstrndup(os->cont, opt, ((index - opt) - 1)); - if (*index != '\0') /* account for "--foo=" */ - arg = apr_pstrdup(os->cont, index); - arg_index_incr = 0; - } - - /* If it's a longopt */ - if (opt[1] == '-') { - /* see if it's in our array of long opts */ - for (ptr = long_opts; ptr->name; ptr++) { - if (strcmp((opt + 2), ptr->name) == 0) { /* it's in the array */ - if (ptr->has_arg) { - if (((os->ind + 1) >= os->argc) - && (arg == NULL)) { - fprintf(stderr, - "%s: option requires an argument: %s\n", - pretty_path(*os->argv), opt); - return APR_BADARG; - } - - /* If we make it here, then we should be ok. */ - *optarg = arg; - os->ind += arg_index_incr; - } - else { /* has no arg */ - *optarg = NULL; - } - *optval = ptr->val; - ++os->ind; - return APR_SUCCESS; - } - } + char *temp; - /* If we get here, then we don't have the longopt in our - * longopts array - */ - fprintf(stderr, "%s: illegal option: %s\n", - pretty_path(*os->argv), opt); - return APR_BADCH; + for (; len >= 2; start++, len -= 2) { + temp = argv[start]; + argv[start] = argv[start + len - 1]; + argv[start + len - 1] = temp; } +} + +/* + * Permute os->argv with the goal that non-option arguments will all + * appear at the end. os->skip_start is where we started skipping + * non-option arguments, os->skip_end is where we stopped, and os->ind + * is where we are now. + */ +static void permute(apr_getopt_t *os) +{ + int len1 = os->skip_end - os->skip_start; + int len2 = os->ind - os->skip_end; - { /* otherwise, apr_getopt gets it. */ - char optch; - apr_status_t status; - status = apr_getopt (os, opts, &optch, optarg); - *optval = optch; - return status; + if (os->interleave) { + /* + * Exchange the sequences argv[os->skip_start..os->skip_end-1] and + * argv[os->skip_end..os->ind-1]. The easiest way to do that is + * to reverse the entire range and then reverse the two + * sub-ranges. + */ + reverse(os->argv, os->skip_start, len1 + len2); + reverse(os->argv, os->skip_start, len2); + reverse(os->argv, os->skip_start + len2, len1); } + + /* Reset skip range to the new location of the non-option sequence. */ + os->skip_start += len2; + os->skip_end += len2; } +/* Helper function to print out an error involving a long option */ +static apr_status_t serr(apr_getopt_t *os, const char *err, const char *str, + apr_status_t status) +{ + if (os->err) + fprintf(stderr, "%s: %s: %s\n", pretty_path(*os->argv), err, str); + return status; +} +/* Helper function to print out an error involving a short option */ +static apr_status_t cerr(apr_getopt_t *os, const char *err, int ch, + apr_status_t status) +{ + if (os->err) + fprintf(stderr, "%s: %s: %c\n", pretty_path(*os->argv), err, ch); + return status; +} +APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, + const apr_longopt_t *opts, + int *optch, const char **optarg) +{ + const char *p; + int i, len; + + /* Let the calling program reset option processing. */ + if (os->reset) { + os->place = EMSG; + os->ind = 1; + os->reset = 0; + } + + /* + * We can be in one of two states: in the middle of processing a + * run of short options, or about to process a new argument. + * Since the second case can lead to the first one, handle that + * one first. */ + p = os->place; + if (*p == '\0') { + /* If we are interleaving, skip non-option arguments. */ + if (os->interleave) { + while (os->ind < os->argc && *os->argv[os->ind] != '-') + os->ind++; + os->skip_end = os->ind; + } + if (os->ind >= os->argc || *os->argv[os->ind] != '-') { + os->ind = os->skip_start; + return APR_EOF; + } + + p = os->argv[os->ind++] + 1; + if (*p == '-' && p[1] != '\0') { /* Long option */ + /* Search for the long option name in the caller's table. */ + p++; + for (i = 0; opts[i].optch != 0; i++) { + len = strlen(opts[i].name); + if (strncmp(p, opts[i].name, len) == 0 + && (p[len] == '\0' || p[len] == '=')) + break; + } + if (opts[i].optch == 0) /* No match */ + return serr(os, "invalid option", p - 2, APR_BADCH); + *optch = opts[i].optch; + + if (opts[i].has_arg) { + if (p[len] == '=') /* Argument inline */ + *optarg = p + len + 1; + else if (os->ind >= os->argc) /* Argument missing */ + return serr(os, "missing argument", p - 2, APR_BADARG); + else /* Argument in next arg */ + *optarg = os->argv[os->ind++]; + } else { + *optarg = NULL; + if (p[len] == '=') + return serr(os, "erroneous argument", p - 2, APR_BADARG); + } + permute(os); + return APR_SUCCESS; + } else if (*p == '-') { /* Bare "--"; we're done */ + permute(os); + os->ind = os->skip_start; + return APR_EOF; + } + else if (*p == '\0') /* Bare "-" is illegal */ + return serr(os, "invalid option", p, APR_BADCH); + } + /* + * Now we're in a run of short options, and *p is the next one. + * Look for it in the caller's table. + */ + for (i = 0; opts[i].optch != 0; i++) { + if (*p == opts[i].optch) + break; + } + if (opts[i].optch == 0) /* No match */ + return cerr(os, "invalid option character", *p, APR_BADCH); + *optch = *p++; + + if (opts[i].has_arg) { + if (*p != '\0') /* Argument inline */ + *optarg = p; + else if (os->ind >= os->argc) /* Argument missing */ + return cerr(os, "missing argument", *optch, APR_BADARG); + else /* Argument in next arg */ + *optarg = os->argv[os->ind++]; + os->place = EMSG; + } else { + *optarg = NULL; + os->place = p; + } + + permute(os); + return APR_SUCCESS; +} From 6d7ae248c9f7ce93c44fe72db4fd14c70db70a9c Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Sat, 25 Nov 2000 03:36:01 +0000 Subject: [PATCH 0809/7878] OS/2: Add unix inet_ntop() to OS/2 build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60789 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/Makefile.in | 1 + network_io/os2/inet_ntop.c | 1 + 2 files changed, 2 insertions(+) create mode 100644 network_io/os2/inet_ntop.c diff --git a/network_io/os2/Makefile.in b/network_io/os2/Makefile.in index 48bace2b956..f23522533ff 100644 --- a/network_io/os2/Makefile.in +++ b/network_io/os2/Makefile.in @@ -16,6 +16,7 @@ OBJS=poll.o \ sockets.o \ sockopt.o \ sockaddr.o \ + inet_ntop.o \ os2calls.o .c.o: diff --git a/network_io/os2/inet_ntop.c b/network_io/os2/inet_ntop.c new file mode 100644 index 00000000000..f1f79d49489 --- /dev/null +++ b/network_io/os2/inet_ntop.c @@ -0,0 +1 @@ +#include "../unix/inet_ntop.c" From b2247e3577f66b1f19d44a19b47d426bd2055432 Mon Sep 17 00:00:00 2001 From: Karl Fogel <kfogel@apache.org> Date: Sat, 25 Nov 2000 05:14:59 +0000 Subject: [PATCH 0810/7878] More changes from Greg Hudson <ghudson@mit.edu>, w/ small doc tweaks from Karl Fogel <kfogel@collab.net>: (apr_getopt_option_t): rename from apr_longopt_t, because more accurate. (apr_initopt, apr_getopt_long, reverse): take "char *const *argv", act on a copy instead of the original, since we may permute the array. This is a compromise. The parameter must be compatible with the argv value passed to main, since that is the primary purpose of the function. But as has been pointed out, people might want to use the function with arrays other than argv, and we shouldn't touch the caller's data. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60790 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 22 +++++++++++----------- misc/unix/getopt.c | 20 +++++++++++++++----- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 60bd114b528..1de528350cd 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -77,7 +77,7 @@ struct apr_getopt_t { /** count of arguments */ int argc; /** array of pointers to arguments */ - char **argv; + const char **argv; /** argument associated with option */ char const* place; /** set to nonzero to support interleaving */ @@ -87,9 +87,9 @@ struct apr_getopt_t { int skip_end; }; -typedef struct apr_longopt_t apr_longopt_t; +typedef struct apr_getopt_option_t apr_getopt_option_t; -struct apr_longopt_t { +struct apr_getopt_option_t { /** long option name, or NULL if option has no long name */ const char *name; /** option letter, or a value greater than 255 if option has no letter */ @@ -108,7 +108,7 @@ struct apr_longopt_t { * @deffunc apr_status_t apr_initopt(apr_getopt_t **os, apr_pool_t *cont,int argc, char *const *argv) */ APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, - int argc, char **argv); + int argc, char *const *argv); /** * Parse the options initialized by apr_initopt(). @@ -135,12 +135,12 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, * options beginning with "--" in addition to single-character * options beginning with "-". * @param os The apr_getopt_t structure created by apr_initopt() - * @param opts A pointer to a list of apr_longopt_t structures, which can - * be initialized with { "name", optch, has_args }. has_args + * @param opts A pointer to a list of apr_getopt_option_t structures, which + * can be initialized with { "name", optch, has_args }. has_args * is nonzero if the option requires an argument. A structure * with an optch value of 0 terminates the list. - * @param optch Receives the value of "optch" from the apr_longopt_t structure - * corresponding to the next option matched. + * @param optch Receives the value of "optch" from the apr_getopt_option_t + * structure corresponding to the next option matched. * @param optarg Receives the argument following the option, if any. * @tip There are four potential status values on exit. They are: * <PRE> @@ -153,10 +153,10 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, * non-option argument. On error, a message will be printed to stdout unless * os->err is set to 0. If os->interleave is set to nonzero, options can come * after arguments, and os->argv will be permuted to leave non-option arguments - * at the end. - * @deffunc apr_status_t apr_getopt_long(apr_getopt_t *os, const apr_longopt_t *opts, int *optch, const char **optarg) + * at the end (the original argv is unaffected). + * @deffunc apr_status_t apr_getopt_long(apr_getopt_t *os, const apr_getopt_option_t *opts, int *optch, const char **optarg) */ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, - const apr_longopt_t *opts, + const apr_getopt_option_t *opts, int *optch, const char **optarg); #endif /* ! APR_GETOPT_H */ diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 5353dd89f2f..e31a62106f7 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -49,14 +49,24 @@ static const char *pretty_path (const char *name) } APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, - int argc, char **argv) + int argc, char *const *argv) { + int i; + *os = apr_palloc(cont, sizeof(apr_getopt_t)); (*os)->cont = cont; (*os)->err = 1; (*os)->place = EMSG; (*os)->argc = argc; - (*os)->argv = argv; + + /* The argv parameter must be compatible with main()'s argv, since + that's the primary purpose of this function. But people might + want to use this function with arrays other than the main argv, + and we shouldn't touch the caller's data. So we copy. */ + (*os)->argv = apr_palloc(cont, argc * sizeof(const char *)); + for (i = 0; i < argc; i++) + (*os)->argv[i] = argv[i]; + (*os)->interleave = 0; (*os)->ind = 1; (*os)->skip_start = 1; @@ -135,9 +145,9 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, } /* Reverse the sequence argv[start..start+len-1]. */ -static void reverse(char **argv, int start, int len) +static void reverse(const char **argv, int start, int len) { - char *temp; + const char *temp; for (; len >= 2; start++, len -= 2) { temp = argv[start]; @@ -193,7 +203,7 @@ static apr_status_t cerr(apr_getopt_t *os, const char *err, int ch, } APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, - const apr_longopt_t *opts, + const apr_getopt_option_t *opts, int *optch, const char **optarg) { const char *p; From 48352a5926c6109363218d44ba787e94ca5d0549 Mon Sep 17 00:00:00 2001 From: Karl Fogel <kfogel@apache.org> Date: Sat, 25 Nov 2000 05:27:39 +0000 Subject: [PATCH 0811/7878] (apr_getopt_t): doc clarification. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60791 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 1de528350cd..0fb15c1bc58 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -80,7 +80,7 @@ struct apr_getopt_t { const char **argv; /** argument associated with option */ char const* place; - /** set to nonzero to support interleaving */ + /** set to nonzero to support interleaving options with regular args */ int interleave; /** range of non-option arguments skipped for interleaving */ int skip_start; From f75a2b174b0ef4e4d382d747b5e5a1220f45bdcd Mon Sep 17 00:00:00 2001 From: Karl Fogel <kfogel@apache.org> Date: Sat, 25 Nov 2000 05:52:17 +0000 Subject: [PATCH 0812/7878] (apr_initopt): null-terminate the copy of argv. Again, from Greg Hudson <ghudson@mit.edu>. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60792 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getopt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index e31a62106f7..f74603aecde 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -63,9 +63,10 @@ APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, that's the primary purpose of this function. But people might want to use this function with arrays other than the main argv, and we shouldn't touch the caller's data. So we copy. */ - (*os)->argv = apr_palloc(cont, argc * sizeof(const char *)); + (*os)->argv = apr_palloc(cont, (argc + 1) * sizeof(const char *)); for (i = 0; i < argc; i++) (*os)->argv[i] = argv[i]; + (*os)->argv[argc] = NULL; (*os)->interleave = 0; (*os)->ind = 1; From 82d775d14be133873de67d9b5d381732794c5be0 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sat, 25 Nov 2000 22:34:04 +0000 Subject: [PATCH 0813/7878] add a "default:" case, just to be sure. print out any additional arguments. factor out the maybe_arg() functionality. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60793 13f79535-47bb-0310-9956-ffa450edef68 --- test/testargs.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/test/testargs.c b/test/testargs.c index 0596131c497..3a2bafbec45 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -63,6 +63,16 @@ #include <unistd.h> #endif +static void maybe_arg(const char *arg) +{ + if (arg) { + printf(" with %s\n", arg); + } + else { + printf("\n"); + } +} + int main(int argc, char * const argv[]) { apr_pool_t *context; @@ -80,7 +90,7 @@ int main(int argc, char * const argv[]) exit(1); } while (apr_getopt(opt, "abc:d::", &data, &optarg) == APR_SUCCESS) { - switch(data) { + switch (data) { case 'a': case 'b': printf("option %c\n", data); @@ -90,14 +100,17 @@ int main(int argc, char * const argv[]) break; case 'd': printf("option %c", data); - if (optarg) { - printf(" with %s\n", optarg); - } - else { - printf("\n"); - } + maybe_arg(optarg); + break; + default: + printf("unknown option: %c", data); + maybe_arg(optarg); break; } } + + while (opt->ind < opt->argc) + printf("extra arg: %s\n", opt->argv[opt->ind++]); + return 1; } From 8f8333a1286f45fcb5e50385041af5995dde0a11 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sun, 26 Nov 2000 00:04:49 +0000 Subject: [PATCH 0814/7878] *) "socket" arg -> "sock" to prevent name collision (shadowing) *) fix indentation and warpping of a number of prototypes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60794 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 42 ++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 4fbdc2b16b3..05ef4216fd0 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -262,7 +262,7 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog); * @param connection_pool The pool for the new socket. */ apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, - apr_pool_t *connection_pool); + apr_pool_t *connection_pool); /** * Issue a connection request to a socket either on the same machine @@ -280,7 +280,8 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa); * @param which Which interface do we wnt the hostname for? * @param sock The socket to examine. */ -apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t *sock); +apr_status_t apr_get_hostname(char **name, apr_interface_e which, + apr_socket_t *sock); /** * Create apr_sockaddr_t from hostname, address family, and port. @@ -314,7 +315,8 @@ apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont); * @param key The key to associate with the user data. * @param sock The currently open socket. */ -apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock); +apr_status_t apr_get_socketdata(void **data, const char *key, + apr_socket_t *sock); /** * Set the pool associated with the current socket. @@ -323,8 +325,9 @@ apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock * @param key The key to associate with the data. * @param cleanup The cleanup to call when the socket is destroyed. */ -apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, - apr_status_t (*cleanup) (void*)); +apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, + const char *key, + apr_status_t (*cleanup) (void*)); /** * Send data over a network. @@ -362,7 +365,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len); * </PRE> */ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, - apr_int32_t nvec, apr_size_t *len); + apr_int32_t nvec, apr_size_t *len); #if APR_HAS_SENDFILE /** @@ -380,8 +383,9 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. * The number of bytes actually sent is stored in argument 5. */ -apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, - apr_off_t *offset, apr_size_t *len, apr_int32_t flags); +apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, + apr_size_t *len, apr_int32_t flags); #endif /** @@ -424,7 +428,8 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len); * </PRE> * @param on Are we turning the option on or off. */ -apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on); +apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, + apr_int32_t on); /** * Query socket options for the specified socket @@ -448,7 +453,8 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o * </PRE> * @param on Socket option returned on the call. */ -apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t* on); +apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, + apr_int32_t* on); /** * Return an apr_sockaddr_t from an apr_socket_t @@ -456,7 +462,8 @@ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t* * @param which Which interface do we want the apr_sockaddr_t for? * @param sock The socket to use */ -apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock); +apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, + apr_socket_t *sock); /** * Set the port in an APR socket address. @@ -540,8 +547,8 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_interval_time * APR_POLLOUT -- signal if write will not block * </PRE> */ -apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, apr_socket_t *socket, - apr_int16_t event); +apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, + apr_int16_t event); /** * Modify a socket in the poll structure with mask. @@ -591,7 +598,7 @@ apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events); * @param aprset The poll structure we will be using. */ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, - apr_pollfd_t *aprset); + apr_pollfd_t *aprset); /** * Return the data associated with the current poll. @@ -608,8 +615,9 @@ apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) * @param key The user data to associate with the pollfd. * @param cleanup The cleanup function */ -apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, - apr_status_t (*cleanup) (void *)); +apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, + const char *key, + apr_status_t (*cleanup) (void *)); /** * Convert a File type to a socket so that it can be used in a poll operation. @@ -635,7 +643,7 @@ apr_status_t apr_get_inaddr(apr_in_addr_t *addr, char *hostname); * @param sock The apr_socket_t to use */ apr_status_t apr_get_socket_inaddr(apr_in_addr_t *addr, apr_interface_e which, - apr_socket_t *sock); + apr_socket_t *sock); /** * Given an apr_sockaddr_t and a service name, set the port for the service From 20f19ab6d36c25a52a717b7e4971ff7f18b17751 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sun, 26 Nov 2000 02:03:12 +0000 Subject: [PATCH 0815/7878] The arguments to apr_create_process() should be "const" since we aren't going to change them. It is also quite possible that args are constant strings (thus, we *definitely* better not change them). "env" got the same treatment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60795 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 5 +++-- threadproc/beos/proc.c | 9 +++++---- threadproc/os2/proc.c | 5 +++-- threadproc/unix/proc.c | 9 +++++---- threadproc/win32/proc.c | 5 +++-- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index fa1012a3dff..8fd6b773de2 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -378,8 +378,9 @@ apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont); * @param cont The pool to use. */ apr_status_t apr_create_process(apr_proc_t *new_proc, const char *progname, - char *const *args, char **env, - apr_procattr_t *attr, apr_pool_t *cont); + const char * const *args, + const char * const *env, + apr_procattr_t *attr, apr_pool_t *cont); /** * Wait for a child process to die diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 51a2e5eb72a..0a75d43cc76 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -202,16 +202,17 @@ apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) apr_status_t apr_create_process(apr_proc_t *new, const char *progname, - char *const args[], char **env, - apr_procattr_t *attr, apr_pool_t *cont) + const char * const *args, + const char * const *env, + apr_procattr_t *attr, apr_pool_t *cont) { int i=0,nargs=0; char **newargs = NULL; thread_id newproc, sender; struct send_pipe *sp; - char * dir = NULL; + char * dir = NULL; - sp = (struct send_pipe *)apr_palloc(cont, sizeof(struct send_pipe)); + sp = (struct send_pipe *)apr_palloc(cont, sizeof(struct send_pipe)); new->in = attr->parent_in; new->err = attr->parent_err; diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 4a88675ccfb..12d214d9348 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -279,8 +279,9 @@ static char *double_quotes(apr_pool_t *cntxt, char *str) apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, - char *const args[], char **env, - apr_procattr_t *attr, apr_pool_t *cont) + const char * const *args, + const char * const *env, + apr_procattr_t *attr, apr_pool_t *cont) { int i, arg, numargs, cmdlen; apr_status_t status; diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index c826a755bd2..311b7520b58 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -271,8 +271,9 @@ static apr_status_t limit_proc(apr_procattr_t *attr) } apr_status_t apr_create_process(apr_proc_t *new, const char *progname, - char *const *args, char **env, - apr_procattr_t *attr, apr_pool_t *cont) + const char * const *args, + const char * const *env, + apr_procattr_t *attr, apr_pool_t *cont) { int i; const char **newargs; @@ -334,13 +335,13 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, if (attr->detached) { apr_detach(); } - execve(SHELL_PATH, (char **) newargs, env); + execve(SHELL_PATH, (char * const *) newargs, (char * const *)env); } else { if (attr->detached) { apr_detach(); } - execve(progname, args, env); + execve(progname, (char * const *)args, (char * const *)env); } exit(-1); /* if we get here, there is a problem, so exit with an */ /* error code. */ diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index e230b5a9783..a45928f3091 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -235,8 +235,9 @@ apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t det) } apr_status_t apr_create_process(apr_proc_t *new, const char *progname, - char *const args[], char **env, - apr_procattr_t *attr, apr_pool_t *cont) + const char * const *args, + const char * const *env, + apr_procattr_t *attr, apr_pool_t *cont) { int i, iEnvBlockLen; char *cmdline; From 0c4497c1f36cf4d5d256f7c900691b1ebc10552b Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sun, 26 Nov 2000 03:00:05 +0000 Subject: [PATCH 0816/7878] Make the APR headers sane. *) Reduce the dependencies between APR headers. This assists APR clients who generate dependencies, and (used to) pick up "all" of the APR headers. Basically, this was trimming back the headers to just what was needed. Some unneeded system headers were removed, too. The most common headers to put back in were: apr.h, apr_pools.h, and apr_errno.h. *) move apr_pool_t declaration and a few pool functions from apr_general.h to apr_pools.h. *) move kill_conditions and process_chain from apr_pools.h to apr_thread_proc.h. *) move apr_note_subprocess() from apr_general.h to apr_thread_proc.h *) add stdio.h to apr_pools.c (compensate for removal from apr_general.h) *) add apr_lib.h to apr_strnatcmp.c (compensate for apr_strings.h no longer including apr_lib.h) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60796 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_dso.h | 3 +- include/apr_file_io.h | 6 +- include/apr_general.h | 107 +------------------------------- include/apr_getopt.h | 2 + include/apr_lib.h | 26 +------- include/apr_lock.h | 3 +- include/apr_md5.h | 2 +- include/apr_mmap.h | 6 +- include/apr_network_io.h | 4 +- include/apr_pools.h | 124 +++++++++++++++++++++++++++++--------- include/apr_portable.h | 11 ++-- include/apr_shmem.h | 2 +- include/apr_strings.h | 10 ++- include/apr_tables.h | 10 +-- include/apr_thread_proc.h | 47 ++++++++++++++- include/apr_time.h | 3 +- include/apr_user.h | 2 + include/apr_xlate.h | 3 +- lib/apr_pools.c | 3 + memory/unix/apr_pools.c | 3 + strings/apr_strnatcmp.c | 2 +- 21 files changed, 188 insertions(+), 191 deletions(-) diff --git a/include/apr_dso.h b/include/apr_dso.h index 402b58a96ca..b277ce40da8 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -55,7 +55,8 @@ #ifndef APR_DSO_DOT_H #define APR_DSO_DOT_H -#include "apr_general.h" +#include "apr.h" +#include "apr_pools.h" #include "apr_errno.h" /** diff --git a/include/apr_file_io.h b/include/apr_file_io.h index ce2055b4f7b..85ee3f0d6f6 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -55,12 +55,10 @@ #ifndef APR_FILE_IO_H #define APR_FILE_IO_H -#include "apr_general.h" +#include "apr.h" +#include "apr_pools.h" #include "apr_time.h" #include "apr_errno.h" -#if APR_HAVE_SYS_UIO_H -#include <sys/uio.h> -#endif #ifdef __cplusplus extern "C" { diff --git a/include/apr_general.h b/include/apr_general.h index 271b04d810f..f3252de508c 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -56,17 +56,12 @@ #define APR_GENERAL_H #include "apr.h" +#include "apr_pools.h" +#include "apr_errno.h" -#if APR_HAVE_STDIO_H -#include <stdio.h> -#endif -#if APR_HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif #if APR_HAVE_SIGNAL_H #include <signal.h> #endif -#include "apr_errno.h" #ifdef __cplusplus extern "C" { @@ -256,104 +251,6 @@ int strncasecmp(const char *a, const char *b, size_t n); apr_status_t apr_generate_random_bytes(unsigned char * buf, int length); #endif -/* Memory allocation/Pool debugging options... - * - * Look in the developer documentation for details of what these do. - * - * NB These should ALL normally be commented out unless you REALLY - * need them!! - */ - -/* -#define ALLOC_DEBUG -#define POOL_DEBUG -#define ALLOC_USE_MALLOC -#define MAKE_TABLE_PROFILE -#define ALLOC_STATS -*/ - -/** - * @package APR memory allocation - */ -typedef struct apr_pool_t apr_pool_t; - -/** The memory allocation structure - */ -struct apr_pool_t { - /** The first block in this pool. */ - union block_hdr *first; - /** The last block in this pool. */ - union block_hdr *last; - /** The list of cleanups to run on pool cleanup. */ - struct cleanup *cleanups; - /** A list of processes to kill when this pool is cleared */ - struct process_chain *subprocesses; - /** The first sub_pool of this pool */ - struct apr_pool_t *sub_pools; - /** The next sibling pool */ - struct apr_pool_t *sub_next; - /** The previous sibling pool */ - struct apr_pool_t *sub_prev; - /** The parent pool of this pool */ - struct apr_pool_t *parent; - /** The first free byte in this pool */ - char *free_first_avail; -#ifdef ALLOC_USE_MALLOC - /** The allocation list if using malloc */ - void *allocation_list; -#endif -#ifdef POOL_DEBUG - /** a list of joined pools - * @defvar apr_pool_t *joined */ - struct apr_pool_t *joined; -#endif - /** A function to control how pools behave when they receive ENOMEM - * @deffunc int apr_abort(int retcode) */ - int (*apr_abort)(int retcode); - /** A place to hand user data associated with this pool - * @defvar datastruct *prog_data */ - struct datastruct *prog_data; -}; - -/* pool functions */ - -/** - * Create a new pool. - * @param newcont The pool we have just created. - * @param cont The parent pool. If this is NULL, the new pool is a root - * pool. If it is non-NULL, the new pool will inherit all - * of it's parent pool's attributes, except the apr_pool_t will - * be a sub-pool. - */ -apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont); - -/** - * Set the data associated with the current pool - * @param data The user data associated with the pool. - * @param key The key to use for association - * @param cleanup The cleanup program to use to cleanup the data; - * @param cont The current pool. - * @tip The data to be attached to the pool should have the same - * life span as the pool it is being attached to. - * - * Users of APR must take EXTREME care when choosing a key to - * use for their data. It is possible to accidentally overwrite - * data by choosing a key that another part of the program is using - * It is advised that steps are taken to ensure that a unique - * key is used at all times. - */ -apr_status_t apr_set_userdata(const void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_pool_t *cont); - -/** - * Return the data associated with the current pool. - * @param data The key for the data to retrieve - * @param key The user data associated with the pool. - * @param cont The current pool. - */ -apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont); - /** * Setup any APR internal data structures. This MUST be the first function * called for any APR program. diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 0fb15c1bc58..cfa269667ce 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -55,6 +55,8 @@ #ifndef APR_GETOPT_H #define APR_GETOPT_H +#include "apr_pools.h" + /** * @package APR command arguments */ diff --git a/include/apr_lib.h b/include/apr_lib.h index 550e35a0fac..f28f79a884a 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -56,11 +56,7 @@ #define APR_LIB_H #include "apr.h" -#include "apr_pools.h" -#include "apr_general.h" -#include "apr_tables.h" -#include "apr_file_io.h" -#include "apr_thread_proc.h" +#include "apr_errno.h" #if APR_HAVE_CTYPE_H #include <ctype.h> @@ -68,9 +64,6 @@ #if APR_HAVE_STDARG_H #include <stdarg.h> #endif -#if APR_HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif /** * @package APR general-purpose library @@ -266,23 +259,6 @@ APR_DECLARE(int) apr_vsnprintf(char *buf, size_t len, const char *format, */ APR_DECLARE(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, size_t *bufsize); -/** - * Register a process to be killed when a pool dies. - * @param a The pool to use to define the processes lifetime - * @param pid The process to register - * @param how How to kill the process, one of: - * <PRE> - * kill_never -- process is never sent any signals - * kill_always -- process is sent SIGKILL on apr_pool_t cleanup - * kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL - * just_wait -- wait forever for the process to complete - * kill_only_once -- send SIGTERM and then wait - * </PRE> - * @deffunc void apr_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) - */ -APR_DECLARE(void) apr_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, - enum kill_conditions how); - #ifdef __cplusplus } #endif diff --git a/include/apr_lock.h b/include/apr_lock.h index 8557d10118f..c0bc72697a2 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -55,7 +55,8 @@ #ifndef APR_LOCKS_H #define APR_LOCKS_H -#include "apr_general.h" +#include "apr.h" +#include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus diff --git a/include/apr_md5.h b/include/apr_md5.h index 41048cfceb0..d3405c1eca9 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -85,7 +85,7 @@ #ifndef APR_MD5_H #define APR_MD5_H -#include "apr_lib.h" +#include "apr.h" #include "apr_xlate.h" #ifdef __cplusplus diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 5f47ebd5b63..194ba780043 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -55,10 +55,10 @@ #ifndef APR_MMAP_H #define APR_MMAP_H -#include "apr_general.h" +#include "apr.h" +#include "apr_pools.h" #include "apr_errno.h" -#include "apr_network_io.h" -#include "apr_portable.h" +#include "apr_file_io.h" /* for apr_file_t */ #ifdef __cplusplus extern "C" { diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 05ef4216fd0..f79b682a31d 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -59,9 +59,11 @@ * @package APR Network library */ -#include "apr_general.h" +#include "apr.h" +#include "apr_pools.h" #include "apr_file_io.h" #include "apr_errno.h" + #if APR_HAVE_NETINET_IN_H #include <netinet/in.h> #endif diff --git a/include/apr_pools.h b/include/apr_pools.h index 790f04580b8..c089770fd9c 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -85,38 +85,65 @@ extern "C" { */ #include "apr.h" -#include "apr_thread_proc.h" +#include "apr_errno.h" -#if APR_HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#if APR_HAVE_STDARG_H -#include <stdarg.h> -#endif +/* Memory allocation/Pool debugging options... + * + * Look in the developer documentation for details of what these do. + * + * NB These should ALL normally be commented out unless you REALLY + * need them!! + */ + +/* +#define ALLOC_DEBUG +#define POOL_DEBUG +#define ALLOC_USE_MALLOC +#define MAKE_TABLE_PROFILE +#define ALLOC_STATS +*/ -enum kill_conditions { - kill_never, /* process is never sent any signals */ - kill_always, /* process is sent SIGKILL on apr_pool_t cleanup */ - kill_after_timeout, /* SIGTERM, wait 3 seconds, SIGKILL */ - just_wait, /* wait forever for the process to complete */ - kill_only_once /* send SIGTERM and then wait */ -}; +/** + * @package APR memory allocation + */ +typedef struct apr_pool_t apr_pool_t; -/** A list of processes */ -struct process_chain { - /** The process ID */ - apr_proc_t *pid; - /** When the process should be sent a signal. <PRE> - * kill_never -- process is never sent any signals - * kill_always -- process is sent SIGKILL on apr_pool_t cleanup - * kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL - * just_wait -- wait forever for the process to complete - * kill_only_once -- send SIGTERM and then wait </PRE> - */ - enum kill_conditions kill_how; - /** The next process in the list - * @defvar process_chain *next */ - struct process_chain *next; +/** The memory allocation structure + */ +struct apr_pool_t { + /** The first block in this pool. */ + union block_hdr *first; + /** The last block in this pool. */ + union block_hdr *last; + /** The list of cleanups to run on pool cleanup. */ + struct cleanup *cleanups; + /** A list of processes to kill when this pool is cleared */ + struct process_chain *subprocesses; + /** The first sub_pool of this pool */ + struct apr_pool_t *sub_pools; + /** The next sibling pool */ + struct apr_pool_t *sub_next; + /** The previous sibling pool */ + struct apr_pool_t *sub_prev; + /** The parent pool of this pool */ + struct apr_pool_t *parent; + /** The first free byte in this pool */ + char *free_first_avail; +#ifdef ALLOC_USE_MALLOC + /** The allocation list if using malloc */ + void *allocation_list; +#endif +#ifdef POOL_DEBUG + /** a list of joined pools + * @defvar apr_pool_t *joined */ + struct apr_pool_t *joined; +#endif + /** A function to control how pools behave when they receive ENOMEM + * @deffunc int apr_abort(int retcode) */ + int (*apr_abort)(int retcode); + /** A place to hand user data associated with this pool + * @defvar datastruct *prog_data */ + struct datastruct *prog_data; }; /* pools have nested lifetimes -- sub_pools are destroyed when the @@ -190,6 +217,45 @@ apr_status_t apr_init_alloc(void); /* Set up everything */ * automatically from apr_terminate. */ void apr_term_alloc(void); /* Tear down everything */ + +/* pool functions */ + +/** + * Create a new pool. + * @param newcont The pool we have just created. + * @param cont The parent pool. If this is NULL, the new pool is a root + * pool. If it is non-NULL, the new pool will inherit all + * of it's parent pool's attributes, except the apr_pool_t will + * be a sub-pool. + */ +apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont); + +/** + * Set the data associated with the current pool + * @param data The user data associated with the pool. + * @param key The key to use for association + * @param cleanup The cleanup program to use to cleanup the data; + * @param cont The current pool. + * @tip The data to be attached to the pool should have the same + * life span as the pool it is being attached to. + * + * Users of APR must take EXTREME care when choosing a key to + * use for their data. It is possible to accidentally overwrite + * data by choosing a key that another part of the program is using + * It is advised that steps are taken to ensure that a unique + * key is used at all times. + */ +apr_status_t apr_set_userdata(const void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_pool_t *cont); + +/** + * Return the data associated with the current pool. + * @param data The key for the data to retrieve + * @param key The user data associated with the pool. + * @param cont The current pool. + */ +apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont); /** * make a sub pool from the current pool diff --git a/include/apr_portable.h b/include/apr_portable.h index bcdd6a0e635..6faf9144797 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -63,11 +63,8 @@ * @package APR portability Routines */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "apr_general.h" +#include "apr.h" +#include "apr_pools.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_network_io.h" @@ -89,6 +86,10 @@ extern "C" { #include <sys/sem.h> #endif +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + #ifdef WIN32 /* The primitives for Windows types */ typedef HANDLE apr_os_file_t; diff --git a/include/apr_shmem.h b/include/apr_shmem.h index 60e552832a3..787e889e9e4 100644 --- a/include/apr_shmem.h +++ b/include/apr_shmem.h @@ -60,7 +60,7 @@ */ #include "apr.h" -#include "apr_general.h" +#include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus diff --git a/include/apr_strings.h b/include/apr_strings.h index b45f29c7d3c..f189b7701cf 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -75,12 +75,16 @@ 3. This notice may not be removed or altered from any source distribution. */ +#ifndef APR_STRINGS_H +#define APR_STRINGS_H #include "apr.h" -#include "apr_lib.h" +#include "apr_errno.h" +#include "apr_pools.h" -#ifndef APR_STRINGS_H -#define APR_STRINGS_H +#if APR_HAVE_STDARG_H +#include <stdarg.h> +#endif #ifdef __cplusplus extern "C" { diff --git a/include/apr_tables.h b/include/apr_tables.h index 09a9f2e4bdc..e38bc5eaa19 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -55,15 +55,11 @@ #ifndef APR_TABLES_H #define APR_TABLES_H -#include "apr_general.h" -#include "apr_file_io.h" -#include "apr_thread_proc.h" +#include "apr.h" +#include "apr_pools.h" #if APR_HAVE_STDARG_H -#include <stdarg.h> -#endif -#if APR_HAVE_SYS_TYPES_H -#include <sys/types.h> +#include <stdarg.h> /* for va_list */ #endif #ifdef __cplusplus diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 8fd6b773de2..bb218d21273 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -55,9 +55,11 @@ #ifndef APR_THREAD_PROC_H #define APR_THREAD_PROC_H +#include "apr.h" #include "apr_file_io.h" -#include "apr_general.h" +#include "apr_pools.h" #include "apr_errno.h" + #if APR_HAVE_STRUCT_RLIMIT #include <sys/time.h> #include <sys/resource.h> @@ -124,6 +126,31 @@ typedef struct apr_other_child_rec_t apr_other_child_rec_t; typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(void *); +enum kill_conditions { + kill_never, /* process is never sent any signals */ + kill_always, /* process is sent SIGKILL on apr_pool_t cleanup */ + kill_after_timeout, /* SIGTERM, wait 3 seconds, SIGKILL */ + just_wait, /* wait forever for the process to complete */ + kill_only_once /* send SIGTERM and then wait */ +}; + +/** A list of processes */ +struct process_chain { + /** The process ID */ + apr_proc_t *pid; + /** When the process should be sent a signal. <PRE> + * kill_never -- process is never sent any signals + * kill_always -- process is sent SIGKILL on apr_pool_t cleanup + * kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL + * just_wait -- wait forever for the process to complete + * kill_only_once -- send SIGTERM and then wait </PRE> + */ + enum kill_conditions kill_how; + /** The next process in the list + * @defvar process_chain *next */ + struct process_chain *next; +}; + /* Thread Function definitions */ /** @@ -480,6 +507,24 @@ void apr_probe_writable_fds(void); * @param sig How to kill the process. */ apr_status_t apr_kill(apr_proc_t *proc, int sig); + +/** + * Register a process to be killed when a pool dies. + * @param a The pool to use to define the processes lifetime + * @param pid The process to register + * @param how How to kill the process, one of: + * <PRE> + * kill_never -- process is never sent any signals + * kill_always -- process is sent SIGKILL on apr_pool_t cleanup + * kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL + * just_wait -- wait forever for the process to complete + * kill_only_once -- send SIGTERM and then wait + * </PRE> + * @deffunc void apr_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) + */ +APR_DECLARE(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, + enum kill_conditions how); + #ifdef __cplusplus } #endif diff --git a/include/apr_time.h b/include/apr_time.h index 540c12c40fc..d0aff4d6e02 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -55,7 +55,8 @@ #ifndef APR_TIME_H #define APR_TIME_H -#include "apr_general.h" +#include "apr.h" +#include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus diff --git a/include/apr_user.h b/include/apr_user.h index a00308077d0..f45c0f53219 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -56,6 +56,8 @@ #define APR_USER_H #include "apr.h" +#include "apr_errno.h" +#include "apr_pools.h" #if APR_HAS_USER diff --git a/include/apr_xlate.h b/include/apr_xlate.h index fb5eb14a849..1d78d8799e3 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -56,8 +56,7 @@ #define APR_XLATE_H #include "apr.h" -#include "apr_general.h" -#include "apr_time.h" +#include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 736a0efd1fe..4368af4b272 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -69,6 +69,9 @@ #include "apr_lib.h" #include "apr_lock.h" +#ifdef HAVE_STDIO_H +#include <stdio.h> +#endif #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> #endif diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 736a0efd1fe..4368af4b272 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -69,6 +69,9 @@ #include "apr_lib.h" #include "apr_lock.h" +#ifdef HAVE_STDIO_H +#include <stdio.h> +#endif #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> #endif diff --git a/strings/apr_strnatcmp.c b/strings/apr_strnatcmp.c index 1070ffdaba2..32140e3b30c 100644 --- a/strings/apr_strnatcmp.c +++ b/strings/apr_strnatcmp.c @@ -23,9 +23,9 @@ #include <ctype.h> #include <string.h> #include <assert.h> -#include <stdio.h> #include "apr_strings.h" +#include "apr_lib.h" /* for apr_is*() */ #if defined(__GNUC__) # define UNUSED __attribute__((__unused__)) From da4ed229219eacc782cf4d7b1fbc87db17335034 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Sun, 26 Nov 2000 03:43:51 +0000 Subject: [PATCH 0817/7878] OS/2: const'ifying the args to apr_create_process() has a ripple effect.... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60797 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/proc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 12d214d9348..8bc3fec50c6 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -253,7 +253,7 @@ apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) /* quotes in the string are doubled up. * Used to escape quotes in args passed to OS/2's cmd.exe */ -static char *double_quotes(apr_pool_t *cntxt, char *str) +static char *double_quotes(apr_pool_t *cntxt, const char *str) { int num_quotes = 0; int len = 0; @@ -285,7 +285,7 @@ apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, { int i, arg, numargs, cmdlen; apr_status_t status; - char **newargs; + const char **newargs; char savedir[300]; HFILE save_in, save_out, save_err, dup; int criticalsection = FALSE; @@ -386,7 +386,7 @@ apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, i++; } - newargs = (char **)apr_palloc(cont, sizeof (char *) * (i + 4)); + newargs = (const char **)apr_palloc(cont, sizeof (char *) * (i + 4)); numargs = 0; if (interpreter[0]) @@ -416,7 +416,7 @@ apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, cmdline_pos = cmdline + strlen(cmdline); for (i=1; i<numargs; i++) { - char *a = newargs[i]; + const char *a = newargs[i]; if (strpbrk(a, "&|<>\" ")) a = apr_pstrcat(cont, "\"", double_quotes(cont, a), "\"", NULL); From fcf697f44800bd302f218eadaa2c895a24a7cb2d Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Sun, 26 Nov 2000 03:51:45 +0000 Subject: [PATCH 0818/7878] We define APR_SET/CUR/END using SEEK_SET/CUR/END from stdio so make sure stdio.h is included. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60798 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 85ee3f0d6f6..2241b3a1424 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -59,6 +59,9 @@ #include "apr_pools.h" #include "apr_time.h" #include "apr_errno.h" +#if APR_HAVE_STDIO_H +#include <stdio.h> +#endif #ifdef __cplusplus extern "C" { From 231d064eac6f3707fb24a10e3a8f867611dc6438 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sun, 26 Nov 2000 04:27:56 +0000 Subject: [PATCH 0819/7878] move apr_strerror() from apr_general.h to apr_errno.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60799 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 10 ++++++++++ include/apr_general.h | 8 -------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index de0a76c18e5..485198f3213 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -56,7 +56,10 @@ #define APR_ERRNO_H #include "apr.h" + +#if APR_HAVE_ERRNO_H #include <errno.h> +#endif #ifdef __cplusplus extern "C" { @@ -76,6 +79,13 @@ typedef int apr_status_t; */ int apr_canonical_error(apr_status_t err); +/** + * Return a human readable string describing the specified error. + * @param statcode The error code the get a string for. + * @param buf A buffer to hold the error string. + * @param bufsize Size of the buffer to hold the string. + */ +char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); /* * APR_OS_START_ERROR is where the APR specific error values should start. diff --git a/include/apr_general.h b/include/apr_general.h index f3252de508c..68a36aa4b14 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -276,14 +276,6 @@ void apr_terminate(void); */ apr_status_t apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont); -/** - * Return a human readable string describing the specified error. - * @param statcode The error code the get a string for. - * @param buf A buffer to hold the error string. - * @param bufsize Size of the buffer to hold the string. - */ -char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); - #ifdef __cplusplus } #endif From fb5f13c9f2b1702f1f046d3571f6357b48ea5133 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 27 Nov 2000 19:13:15 +0000 Subject: [PATCH 0820/7878] Get NULL defined on some systems (e.g., FreeBSD 3.4). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60800 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + dso/unix/dso.c | 4 ++++ strings/apr_strings.c | 3 +++ 3 files changed, 8 insertions(+) diff --git a/configure.in b/configure.in index a34021f394d..017988ad8a9 100644 --- a/configure.in +++ b/configure.in @@ -272,6 +272,7 @@ AC_CHECK_HEADERS(pwd.h) AC_CHECK_HEADERS(sys/sem.h) AC_CHECK_HEADERS(signal.h, signalh="1", signalh="0") AC_CHECK_HEADERS(stdarg.h, stdargh="1", stdargh="0") +AC_CHECK_HEADERS(stddef.h) AC_CHECK_HEADERS(stdio.h, stdioh="1", stdioh"0") AC_CHECK_HEADERS(stdlib.h) AC_CHECK_HEADERS(string.h) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 710e68729a6..d9c3f6295b6 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -56,6 +56,10 @@ #if APR_HAS_DSO +#ifdef HAVE_STDDEF_H +#include <stddef.h> +#endif + apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 200f18b64c7..a9e12db5a5b 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -56,6 +56,9 @@ #include "apr_strings.h" #include "apr_private.h" #include "apr_lib.h" +#ifdef HAVE_STDDEF_H +#include <stddef.h> /* NULL */ +#endif APR_DECLARE(char *) apr_pstrdup(apr_pool_t *a, const char *s) { From 0794a384b12e29d165bea8ff8c5c577d608dda80 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 27 Nov 2000 21:32:14 +0000 Subject: [PATCH 0821/7878] apr_initialize should only setup apr if this is the first call, and apr_terminate should only tear the locks down if this is the final call. This allows multiple stand-alone programs that all use APR to be combined cleanly without requiring a lot of if statements. Each program just calls apr_initialize and apr_terminate, but only the first and last calls respectively do anything. Submitted by: Doug MacEachern <dougm@covalent.net> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60801 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/misc/unix/start.c b/misc/unix/start.c index 3f0f03fda54..34b289f3b44 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -56,6 +56,8 @@ #include "locks.h" #include "apr_strings.h" +static int initialized=0; + apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) { apr_pool_t *newpool; @@ -138,13 +140,20 @@ apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) apr_status_t apr_initialize(void) { apr_status_t status; -#if !defined(BEOS) && !defined(OS2) && !defined(WIN32) - apr_unix_setup_lock(); -#elif defined WIN32 +#if defined WIN32 int iVersionRequested; WSADATA wsaData; int err; +#endif + if (initialized) { + return APR_SUCCESS; + } + initialized++; + +#if !defined(BEOS) && !defined(OS2) && !defined(WIN32) + apr_unix_setup_lock(); +#elif defined WIN32 iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); err = WSAStartup((WORD) iVersionRequested, &wsaData); if (err) { @@ -162,6 +171,10 @@ apr_status_t apr_initialize(void) void apr_terminate(void) { + initialized--; + if (initialized) { + return; + } apr_term_alloc(); } From b8bd3a10feb410b109dd2d3335e719696be10ee4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 28 Nov 2000 05:16:08 +0000 Subject: [PATCH 0822/7878] Fix some docs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60802 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index bb218d21273..f0cdbff0474 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -398,7 +398,7 @@ apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont); * @param progname The program to run * @param const_args the arguments to pass to the new program. The first * one should be the program name. - * @param env The new environment apr_table_t for the new process. This + * @param env The new environment table for the new process. This * should be a list of NULL-terminated strings. * @param attr the procattr we should use to determine how to create the new * process From 5a963a08785e4f42c6d57a8be6bf6932ede3d61b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 28 Nov 2000 20:49:32 +0000 Subject: [PATCH 0823/7878] As noted by GStein, refering to an Apache file from within APR is evil... ergo we now define a specific base address for the aprlib.dll file, below the 0x6f000000 address range used by Apache itself. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60803 13f79535-47bb-0310-9956-ffa450edef68 --- aprlibdll.dsp | 8 ++++---- libapr.dsp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/aprlibdll.dsp b/aprlibdll.dsp index 2a5f314504c..efe63d47650 100644 --- a/aprlibdll.dsp +++ b/aprlibdll.dsp @@ -53,8 +53,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:0x6EE0000 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:0x6EE0000 !ELSEIF "$(CFG)" == "aprlibdll - Win32 Debug" @@ -80,8 +80,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:0x6EE0000 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /base:0x6EE00000 # SUBTRACT LINK32 /incremental:no /map !ENDIF diff --git a/libapr.dsp b/libapr.dsp index 2a5f314504c..efe63d47650 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -53,8 +53,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:0x6EE0000 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:0x6EE0000 !ELSEIF "$(CFG)" == "aprlibdll - Win32 Debug" @@ -80,8 +80,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /base:@"..\..\os\win32\BaseAddr.ref",aprlib +# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:0x6EE0000 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /base:0x6EE00000 # SUBTRACT LINK32 /incremental:no /map !ENDIF From 686f784e475604087c5e353ba16081e6df62b950 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 28 Nov 2000 21:31:52 +0000 Subject: [PATCH 0824/7878] Split the hints file into two files, one in APR and one in Apache. The APR hints file just sets build variables, the Apache hints file just sets Apache variables. This is meant to clean up parts of APR, so that they don't include Apache information. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60804 13f79535-47bb-0310-9956-ffa450edef68 --- apr_common.m4 | 62 +++++++++++++++++++++++++++++++++++++++++ hints.m4 | 76 +-------------------------------------------------- 2 files changed, 63 insertions(+), 75 deletions(-) diff --git a/apr_common.m4 b/apr_common.m4 index 7c15451778b..ade5c1ac1de 100644 --- a/apr_common.m4 +++ b/apr_common.m4 @@ -211,3 +211,65 @@ else threads_result="POSIX Threads not found" fi ])dnl + +dnl +dnl Apache and APR "hints" file +dnl We preload various configure settings depending +dnl on previously obtained platform knowledge. +dnl We allow all settings to be overridden from +dnl the command-line. +dnl +dnl We maintain the "format" that we've used +dnl under 1.3.x, so we don't exactly follow +dnl what is "recommended" by autoconf. + +dnl +dnl APR_DOEXTRA +dnl +dnl Handle the use of EXTRA_* variables. +dnl Basically, EXTRA_* vars are added to the +dnl current settings of their "parents". We +dnl can expand as needed. This is ugly +dnl +AC_DEFUN(APR_DOEXTRA, [ + for i in CFLAGS LDFLAGS LIBS + do + eval APR_TMP=\$EXTRA_$i + if test -n "$APR_TMP"; then + eval $i=\"\$$i $APR_TMP\" + eval export $i + eval unset EXTRA_${i} + eval export EXTRA_${i} + fi + done +]) + +dnl +dnl APR_SETIFNULL(variable, value) +dnl +dnl Set variable iff it's currently null +dnl +AC_DEFUN(APR_SETIFNULL,[ + if test -z "$$1"; then + $1="$2"; export $1 + fi +]) + +dnl +dnl APR_SETVAR(variable, value) +dnl +dnl Set variable no matter what +dnl +AC_DEFUN(APR_SETVAR,[ + $1="$2"; export $1 +]) + +dnl +dnl APR_ADDTO(variable, value) +dnl +dnl Add value to variable +dnl +AC_DEFUN(APR_ADDTO,[ + $1="$$1 $2"; export $1 +]) + diff --git a/hints.m4 b/hints.m4 index 94fb80bf0df..ea4aca54432 100644 --- a/hints.m4 +++ b/hints.m4 @@ -1,64 +1,3 @@ -dnl -dnl Apache and APR "hints" file -dnl We preload various configure settings depending -dnl on previously obtained platform knowledge. -dnl We allow all settings to be overridden from -dnl the command-line. -dnl -dnl We maintain the "format" that we've used -dnl under 1.3.x, so we don't exactly follow -dnl what is "recommended" by autoconf. - -dnl -dnl APR_DOEXTRA -dnl -dnl Handle the use of EXTRA_* variables. -dnl Basically, EXTRA_* vars are added to the -dnl current settings of their "parents". We -dnl can expand as needed. This is ugly -dnl -AC_DEFUN(APR_DOEXTRA, [ - for i in CFLAGS LDFLAGS LIBS - do - eval APR_TMP=\$EXTRA_$i - if test -n "$APR_TMP"; then - eval $i=\"\$$i $APR_TMP\" - eval export $i - eval unset EXTRA_${i} - eval export EXTRA_${i} - fi - done -]) - -dnl -dnl APR_SETIFNULL(variable, value) -dnl -dnl Set variable iff it's currently null -dnl -AC_DEFUN(APR_SETIFNULL,[ - if test -z "$$1"; then - $1="$2"; export $1 - fi -]) - -dnl -dnl APR_SETVAR(variable, value) -dnl -dnl Set variable no matter what -dnl -AC_DEFUN(APR_SETVAR,[ - $1="$2"; export $1 -]) - -dnl -dnl APR_ADDTO(variable, value) -dnl -dnl Add value to variable -dnl -AC_DEFUN(APR_ADDTO,[ - $1="$$1 $2"; export $1 -]) - dnl dnl APR_PRELOAD dnl @@ -83,8 +22,6 @@ case "$host" in APR_SETIFNULL(CFLAGS, [-DAUX3 -D_POSIX_SOURCE]) APR_SETIFNULL(LIBS, [-lposix -lbsd]) APR_SETIFNULL(LDFLAGS, [-s]) - APR_SETVAR(APACHE_MPM, [prefork]) - APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-ibm-aix*) case $host in @@ -140,8 +77,6 @@ case "$host" in *os2_emx*) APR_SETIFNULL(SHELL, [sh]) APR_SETIFNULL(file_as_socket, [0]) - APR_SETVAR(APACHE_MPM, [spmt_os2]) - APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-hi-hiux) APR_SETIFNULL(CFLAGS, [-DHIUX]) @@ -166,8 +101,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-linux-*) case `uname -r` in - 2.2* ) APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) - APR_SETIFNULL(CFLAGS, [-DLINUX=2]) + 2.2* ) APR_SETIFNULL(CFLAGS, [-DLINUX=2]) APR_SETIFNULL(LIBS, [-lm]) ;; 2.0* ) APR_SETIFNULL(CFLAGS, [-DLINUX=2]) @@ -189,12 +123,10 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *486-*-bsdi*) APR_SETIFNULL(CFLAGS, [-m486]) - APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-netbsd*) APR_SETIFNULL(CFLAGS, [-DNETBSD]) APR_SETIFNULL(LIBS, [-lcrypt]) - APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-freebsd*) case $host in @@ -203,7 +135,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; esac APR_SETIFNULL(LIBS, [-lcrypt]) - APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-next-nextstep*) APR_SETIFNULL(OPTIM, [-O]) @@ -216,21 +147,17 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; dnl *-apple-rhapsody*) dnl APR_SETIFNULL(CFLAGS, [-DDARWIN -DMAC_OS_X_SERVER]) -dnl APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) dnl ;; *-apple-darwin*) APR_SETIFNULL(CFLAGS, [-DDARWIN]) - APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-dec-osf*) APR_SETIFNULL(CFLAGS, [-DOSF1]) APR_SETIFNULL(LIBS, [-lm]) - APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-qnx) APR_SETIFNULL(CFLAGS, [-DQNX]) APR_SETIFNULL(LIBS, [-N128k -lsocket -lunix]) - APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1]) ;; *-qnx32) APR_SETIFNULL(CC, [cc -F]) @@ -390,7 +317,6 @@ dnl ;; ;; *beos*) APR_SETIFNULL(CFLAGS, [-DBEOS]) - APR_SETVAR(APACHE_MPM, [beos]) PLATOSVERS=`uname -r` case $PLATOSVERS in 5.1) From 1e30acc6ed3197714a49a0c4268c093cb0e53c77 Mon Sep 17 00:00:00 2001 From: Branko Cibej <brane@apache.org> Date: Tue, 28 Nov 2000 22:43:00 +0000 Subject: [PATCH 0825/7878] HP-UX needs _XOPEN_SOURCE_EXTENDED to find hl_error in <netdb.h>. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60805 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hints.m4 b/hints.m4 index ea4aca54432..18dd329b2cd 100644 --- a/hints.m4 +++ b/hints.m4 @@ -82,11 +82,11 @@ case "$host" in APR_SETIFNULL(CFLAGS, [-DHIUX]) ;; *-hp-hpux11.*) - APR_SETIFNULL(CFLAGS, [-DHPUX11]) + APR_SETIFNULL(CFLAGS, [-DHPUX11 -D_XOPEN_SOURCE_EXTENDED]) APR_SETIFNULL(LIBS, [-lm -lpthread]) ;; *-hp-hpux10.*) - APR_SETIFNULL(CFLAGS, [-DHPUX10]) + APR_SETIFNULL(CFLAGS, [-DHPUX10 -D_XOPEN_SOURCE_EXTENDED]) case $host in *-hp-hpux10.01) dnl # We know this is a problem in 10.01. @@ -96,7 +96,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? esac ;; *-hp-hpux*) - APR_SETIFNULL(CFLAGS, [-DHPUX]) + APR_SETIFNULL(CFLAGS, [-DHPUX -D_XOPEN_SOURCE_EXTENDED]) APR_SETIFNULL(LIBS, [-lm]) ;; *-linux-*) From 60c2d76b790fcbdfc59b88e66d472e6479943db4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Wed, 29 Nov 2000 00:21:14 +0000 Subject: [PATCH 0826/7878] Make apr_pool_t's use hashes instead of the hacked up datastruct that it currently uses. Submitted by: Jon Travis <jtravis@covalent.net> Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60806 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 5 ---- include/apr_pools.h | 3 ++- misc/unix/start.c | 59 ++++++++++++--------------------------------- 3 files changed, 17 insertions(+), 50 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index dde1f10c9ff..39d8e075e0e 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -81,11 +81,6 @@ extern "C" { */ #define APR_HASH_KEY_STRING (-1) -/* - * Abstract type for hash tables. - */ -typedef struct apr_hash_t apr_hash_t; - /* * Abstract type for scanning hash tables. */ diff --git a/include/apr_pools.h b/include/apr_pools.h index c089770fd9c..76c1b4babf2 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -107,6 +107,7 @@ extern "C" { * @package APR memory allocation */ typedef struct apr_pool_t apr_pool_t; +typedef struct apr_hash_t apr_hash_t; /** The memory allocation structure */ @@ -143,7 +144,7 @@ struct apr_pool_t { int (*apr_abort)(int retcode); /** A place to hand user data associated with this pool * @defvar datastruct *prog_data */ - struct datastruct *prog_data; + apr_hash_t *prog_data; }; /* pools have nested lifetimes -- sub_pools are destroyed when the diff --git a/misc/unix/start.c b/misc/unix/start.c index 34b289f3b44..a52bb44a912 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -55,6 +55,7 @@ #include "misc.h" #include "locks.h" #include "apr_strings.h" +#include "apr_hash.h" static int initialized=0; @@ -81,59 +82,29 @@ apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) } apr_status_t apr_set_userdata(const void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_pool_t *cont) + apr_status_t (*cleanup) (void *), + apr_pool_t *cont) { - datastruct *dptr = NULL, *dptr2 = NULL; + int keylen = strlen(key); - /* ### replace with an apr_hash_t */ + if (!cont->prog_data) + cont->prog_data = apr_make_hash(cont); - dptr = cont->prog_data; - while (dptr) { - if (!strcmp(dptr->key, key)) - break; - dptr2 = dptr; - dptr = dptr->next; - } - if (dptr == NULL) { - dptr = apr_pcalloc(cont, sizeof(datastruct)); - dptr->next = dptr->prev = NULL; - dptr->key = apr_pstrdup(cont, key); - if (dptr2) { - dptr2->next = dptr; - dptr->prev = dptr2; - } - else { - cont->prog_data = dptr; - } + if (apr_hash_get(cont->prog_data, key, keylen) == NULL){ + char *new_key = apr_pstrdup(cont, key); + apr_hash_set(cont->prog_data, new_key, keylen, data); + } + else { + apr_hash_set(cont->prog_data, key, keylen, data); } - dptr->data = data; - apr_register_cleanup(cont, dptr->data, cleanup, cleanup); + + apr_register_cleanup(cont, data, cleanup, cleanup); return APR_SUCCESS; } apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) { - datastruct *dptr = NULL; - - /* ### replace with an apr_hash_t */ - - dptr = cont->prog_data; - while (dptr) { - if (!strcmp(dptr->key, key)) { - break; - } - dptr = dptr->next; - } - if (dptr) { - /* ->data is const because we never change it. however, we want to - cast because the caller may want to change the contents (and - it knows whether it can). */ - (*data) = (void *)dptr->data; - } - else { - (*data) = NULL; - } + (*data) = apr_hash_get(cont->prog_data, key, strlen(key)); return APR_SUCCESS; } From 6279e9e8887dc2a4c0ed6d5b5536861fa40f3731 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Wed, 29 Nov 2000 00:22:05 +0000 Subject: [PATCH 0827/7878] Get the test programs mostly working again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60807 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 1 + test/testmd5.c | 2 ++ test/testsf.c | 1 + 3 files changed, 4 insertions(+) diff --git a/test/testdso.c b/test/testdso.c index 3245bfb9ded..2ac0f002dd6 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -4,6 +4,7 @@ #include "apr_dso.h" #include <string.h> #include <stdlib.h> +#include <stdio.h> #include <unistd.h> #define LIB_NAME "mod_test.so" diff --git a/test/testmd5.c b/test/testmd5.c index ca6614f7092..cf187e4c634 100644 --- a/test/testmd5.c +++ b/test/testmd5.c @@ -54,9 +54,11 @@ #include <assert.h> #include <stdlib.h> +#include <stdio.h> #include "apr_md5.h" #include "apr_xlate.h" +#include "apr_general.h" struct testcase { const char *s; diff --git a/test/testsf.c b/test/testsf.c index cbd3a4c1e27..9c9acc4f568 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -57,6 +57,7 @@ #include <signal.h> #include <stdlib.h> #include <string.h> +#include <sys/uio.h> #include "apr_network_io.h" #include "apr_errno.h" #include "apr_general.h" From 90009f43ae83d8402917a0caeac01b5c45529dfe Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Wed, 29 Nov 2000 00:25:23 +0000 Subject: [PATCH 0828/7878] Get the test programs all building cleanly again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60808 13f79535-47bb-0310-9956-ffa450edef68 --- test/testoc.c | 2 +- test/testproc.c | 6 +++--- test/testsock.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/testoc.c b/test/testoc.c index dfa515dd3c8..5284e14e9f9 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -89,7 +89,7 @@ int main(int argc, char *argv[]) apr_proc_t newproc; apr_procattr_t *procattr = NULL; apr_file_t *std = NULL; - char *args[3]; + const char *args[3]; if (argc > 1) { while (1); diff --git a/test/testproc.c b/test/testproc.c index 793cb73aa82..ecb9fdef4bc 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) apr_file_t *testfile = NULL; apr_ssize_t length; char *buf; - char *args[3]; + const char *args[3]; char *teststr; if (apr_initialize() != APR_SUCCESS) { @@ -132,8 +132,8 @@ int main(int argc, char *argv[]) } fprintf(stdout, "OK.\n"); - args[0] = apr_pstrdup(context, "testproc"); - args[1] = apr_pstrdup(context, "-X"); + args[0] = "testproc"; + args[1] = "-X"; args[2] = NULL; fprintf(stdout, "Creating a new process......."); diff --git a/test/testsock.c b/test/testsock.c index 0321eb4b210..34c06df9d2d 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) apr_proc_t proc2; apr_status_t s1; apr_status_t s2; - char *args[2]; + const char *args[2]; fprintf(stdout, "Initializing........."); if (apr_initialize() != APR_SUCCESS) { From 6cae6cf413928ce1c914607b1e4e2df001970ed5 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 29 Nov 2000 01:09:15 +0000 Subject: [PATCH 0829/7878] The apr_hash_t typedef should stay in apr_hash.h. Use "struct apr_hash_t" in the apr_pools.h header. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60809 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 5 +++++ include/apr_pools.h | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index 39d8e075e0e..dde1f10c9ff 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -81,6 +81,11 @@ extern "C" { */ #define APR_HASH_KEY_STRING (-1) +/* + * Abstract type for hash tables. + */ +typedef struct apr_hash_t apr_hash_t; + /* * Abstract type for scanning hash tables. */ diff --git a/include/apr_pools.h b/include/apr_pools.h index 76c1b4babf2..98705202fcf 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -107,7 +107,6 @@ extern "C" { * @package APR memory allocation */ typedef struct apr_pool_t apr_pool_t; -typedef struct apr_hash_t apr_hash_t; /** The memory allocation structure */ @@ -142,9 +141,9 @@ struct apr_pool_t { /** A function to control how pools behave when they receive ENOMEM * @deffunc int apr_abort(int retcode) */ int (*apr_abort)(int retcode); - /** A place to hand user data associated with this pool - * @defvar datastruct *prog_data */ - apr_hash_t *prog_data; + /** A place to hold user data associated with this pool + * @defvar apr_hash_t *prog_data */ + struct apr_hash_t *prog_data; }; /* pools have nested lifetimes -- sub_pools are destroyed when the From cfd7deb5282df599dbb7c07b4a23c57217f8dbcf Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 29 Nov 2000 01:42:05 +0000 Subject: [PATCH 0830/7878] Fix recent header reorg break on win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60810 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/names.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/win32/names.c b/misc/win32/names.c index 7f1fbec637e..1e0bf3f5faa 100644 --- a/misc/win32/names.c +++ b/misc/win32/names.c @@ -56,6 +56,7 @@ #include "apr_file_io.h" #include "apr_general.h" #include "apr_strings.h" +#include "apr_lib.h" #include <errno.h> #include <string.h> #include <sys/stat.h> @@ -77,7 +78,9 @@ static BOOL OnlyDots(char *pString) return TRUE; } -/* Accepts as input a pathname, and tries to match it to an +/* XXX: Should allow path strings to 32000 chars + * + * Accepts as input a pathname, and tries to match it to an * existing path and return the pathname in the case that * is present on the existing path. This routine also * converts alias names to long names. From 5e8d66affca53e5dc480d0b5a49998c914ef1ab1 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 29 Nov 2000 07:37:41 +0000 Subject: [PATCH 0831/7878] *) Add functions for file-level locking/unlocking. *) Add test program for the new functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60811 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/Makefile.in | 1 + file_io/unix/flock.c | 150 +++++++++++++++++++++++++++++++++ include/apr_file_io.h | 39 ++++++++- test/.cvsignore | 1 + test/Makefile.in | 7 +- test/testflock.c | 173 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 369 insertions(+), 2 deletions(-) create mode 100644 file_io/unix/flock.c create mode 100644 test/testflock.c diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index 05254e3501e..d437f01579a 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -14,6 +14,7 @@ OBJS=dir.o \ fileacc.o \ filedup.o \ filestat.o \ + flock.o \ fullrw.o \ open.o \ pipe.o \ diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c new file mode 100644 index 00000000000..ecd7f7ae48a --- /dev/null +++ b/file_io/unix/flock.c @@ -0,0 +1,150 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include "fileio.h" + +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#endif +#ifdef HAVE_SYS_FILE_H +#include <sys/file.h> +#endif + +apr_status_t apr_lock_file(apr_file_t *thefile, int type) +{ + int rc; + +#if defined(HAVE_FCNTL_H) + { + struct flock l = { 0 }; + int fc; + + l.l_whence = SEEK_SET; /* lock from current point */ + l.l_start = 0; /* begin lock at this offset */ + l.l_len = 0; /* lock to end of file */ + if ((type & APR_FLOCK_TYPEMASK) == APR_FLOCK_SHARED) + l.l_type = F_RDLCK; + else + l.l_type = F_WRLCK; + + fc = (type & APR_FLOCK_NONBLOCK) ? F_SETLK : F_SETLKW; + + /* keep trying if fcntl() gets interrupted (by a signal) */ + while ((rc = fcntl(thefile->filedes, fc, &l)) < 0 && errno == EINTR) + continue; + + if (rc == -1) + return errno; + } +#elif defined(HAVE_SYS_FILE_H) + { + int ltype; + + if ((type & APR_FLOCK_TYPEMASK) == APR_FLOCK_SHARED) + ltype = LOCK_SH; + else + ltype = LOCK_EX; + if ((type & APR_FLOCK_NONBLOCK) != 0) + ltype |= LOCK_NB; + + /* keep trying if flock() gets interrupted (by a signal) */ + while ((rc = flock(thefile->filedes, ltype)) < 0 && errno == EINTR) + continue; + + if (rc == -1) + return errno; + } +#else +#error No file locking mechanism is available. +#endif + + return APR_SUCCESS; +} + +apr_status_t apr_unlock_file(apr_file_t *thefile) +{ + int rc; + +#if defined(HAVE_FCNTL_H) + { + struct flock l = { 0 }; + + l.l_whence = SEEK_SET; /* lock from current point */ + l.l_start = 0; /* begin lock at this offset */ + l.l_len = 0; /* lock to end of file */ + l.l_type = F_UNLCK; + + /* keep trying if fcntl() gets interrupted (by a signal) */ + while ((rc = fcntl(thefile->filedes, F_SETLKW, &l)) < 0 + && errno == EINTR) + continue; + + if (rc == -1) + return errno; + } +#elif defined(HAVE_SYS_FILE_H) + { + /* keep trying if flock() gets interrupted (by a signal) */ + while ((rc = flock(thefile->filedes, LOCK_UN)) < 0 && errno == EINTR) + continue; + + if (rc == -1) + return errno; + } +#else +#error No file locking mechanism is available. +#endif + + return APR_SUCCESS; +} diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 2241b3a1424..10506aea95b 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -59,8 +59,9 @@ #include "apr_pools.h" #include "apr_time.h" #include "apr_errno.h" + #if APR_HAVE_STDIO_H -#include <stdio.h> +#include <stdio.h> /* for SEEK_* */ #endif #ifdef __cplusplus @@ -163,6 +164,23 @@ struct apr_finfo_t { apr_time_t ctime; }; +/** File lock types/flags */ +#define APR_FLOCK_SHARED 1 /* Shared lock. More than one process + or thread can hold a shared lock + at any given time. Essentially, + this is a "read lock", preventing + writers from establishing an + exclusive lock. */ +#define APR_FLOCK_EXCLUSIVE 2 /* Exclusive lock. Only one process + may hold an exclusive lock at any + given time. This is analogous to + a "write lock". */ + +#define APR_FLOCK_TYPEMASK 0x000F /* mask to extract lock type */ +#define APR_FLOCK_NONBLOCK 0x0010 /* do not block while acquiring the + file lock */ + + /* Make and Merge Canonical Name Options */ /** @@ -617,6 +635,25 @@ apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *time */ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout); +/** file (un)locking functions. */ + +/** + * Establish a lock on the specified, open file. The lock may be advisory + * or mandatory, at the discretion of the platform. The lock applies to + * the file as a whole, rather than a specific range. Locks are established + * on a per-thread/process basis; a second lock by the same thread will not + * block. + * @param thefile The file to lock. + * @param type The type of lock to establish on the file. + */ +apr_status_t apr_lock_file(apr_file_t *thefile, int type); + +/** + * Remove any outstanding locks on the file. + * @param thefile The file to unlock. + */ +apr_status_t apr_unlock_file(apr_file_t *thefile); + /**accessor and general file_io functions. */ /** diff --git a/test/.cvsignore b/test/.cvsignore index cdf3b8a0dde..38a4f479ca9 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -23,3 +23,4 @@ testuuid testsuite testsuite.opt testsuite.ncb +testflock.tmp diff --git a/test/Makefile.in b/test/Makefile.in index 0211b71cd58..e46ca9853df 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -10,6 +10,7 @@ MKDEP=../helpers/mkdep.sh TARGETS= testmd5@EXEEXT@ \ testfile@EXEEXT@ \ + testflock@EXEEXT@ \ testproc@EXEEXT@ \ testsock@EXEEXT@ \ testsf@EXEEXT@ \ @@ -28,6 +29,7 @@ TARGETS= testmd5@EXEEXT@ \ OBJS= testmd5.o \ testfile.o \ + testflock.o \ testproc.o \ testsock.o \ testsf.o \ @@ -53,6 +55,9 @@ testmd5@EXEEXT@: testmd5.o testfile@EXEEXT@: testfile.o $(CC) $(CFLAGS) -o testfile@EXEEXT@ testfile.o $(LDFLAGS) +testflock@EXEEXT@: testflock.o + $(CC) $(CFLAGS) -o testflock@EXEEXT@ testflock.o $(LDFLAGS) + testdso@EXEEXT@: testdso.o $(CC) $(CFLAGS) --export-dynamic -fPIC testdso.o -o testdso@EXEEXT@ $(LDFLAGS) @@ -101,7 +106,7 @@ testuuid@EXEEXT@: testuuid.o $(CC) $(CFLAGS) -o testuuid@EXEEXT@ testuuid.o $(LDFLAGS) clean: - $(RM) -f *.o *.a *.so $(TARGETS) + $(RM) -f *.o *.a *.so $(TARGETS) testflock.tmp distclean: clean -$(RM) -f Makefile diff --git a/test/testflock.c b/test/testflock.c new file mode 100644 index 00000000000..635c43ccfcb --- /dev/null +++ b/test/testflock.c @@ -0,0 +1,173 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +/* + * USAGE + * + * Start one process, no args, and place it into the background. Start a + * second process with the "-r" switch to attempt a read on the file + * created by the first process. + * + * $ ./testflock & + * ...messages... + * $ ./testflock -r + * ...messages... + * + * The first process will sleep for 30 seconds while holding a lock. The + * second process will attempt to grab it (non-blocking) and fail. It + * will then grab it with a blocking scheme. When the first process' 30 + * seconds are up, it will exit (thus releasing its lock). The second + * process will acquire the lock, then exit. + */ + +#include "apr_pools.h" +#include "apr_file_io.h" +#include "apr_time.h" +#include "apr_general.h" +#include "apr_getopt.h" +#include "apr_strings.h" + +#include <stdlib.h> +#include <stdio.h> + +#define TESTFILE "testfile.tmp" + +static apr_pool_t *pool = NULL; + + +static void errmsg(const char *msg) +{ + if (pool != NULL) + apr_destroy_pool(pool); + fprintf(stderr, msg); + exit(1); +} + +static void do_read(void) +{ + apr_file_t *file; + apr_status_t status; + + if (apr_open(&file, TESTFILE, APR_WRITE, + APR_OS_DEFAULT, pool) != APR_SUCCESS) + errmsg("Could not open test file.\n"); + printf("Test file opened.\n"); + + status = apr_lock_file(file, APR_FLOCK_EXCLUSIVE | APR_FLOCK_NONBLOCK); + if (!APR_STATUS_IS_EAGAIN(status)) { + char msg[200]; + errmsg(apr_psprintf(pool, "Expected EAGAIN. Got %d: %s.\n", + status, apr_strerror(status, msg, sizeof(msg)))); + } + printf("First attempt: we were properly locked out.\nWaiting for lock..."); + fflush(stdout); + + if (apr_lock_file(file, APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) + errmsg("Could not establish lock on test file."); + printf(" got it.\n"); + + (void) apr_close(file); + printf("Exiting.\n"); +} + +static void do_write(void) +{ + apr_file_t *file; + + if (apr_open(&file, TESTFILE, APR_WRITE|APR_CREATE, APR_OS_DEFAULT, + pool) != APR_SUCCESS) + errmsg("Could not create file.\n"); + printf("Test file created.\n"); + + if (apr_lock_file(file, APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) + errmsg("Could not lock the file.\n"); + printf("Lock created.\nSleeping..."); + fflush(stdout); + + apr_sleep(30000000); /* 30 seconds */ + + (void) apr_close(file); + printf(" done.\nExiting.\n"); +} + +int main(int argc, const char * const *argv) +{ + int reader = 0; + apr_status_t status; + char optchar; + const char *optarg; + apr_getopt_t *opt; + + if (apr_initialize() != APR_SUCCESS) + errmsg("Could not initialize APR.\n"); + atexit(apr_terminate); + + if (apr_create_pool(&pool, NULL) != APR_SUCCESS) + errmsg("Could not create global pool.\n"); + + if (apr_initopt(&opt, pool, argc, argv) != APR_SUCCESS) + errmsg("Could not parse options.\n"); + + while ((status = apr_getopt(opt, "r", &optchar, &optarg)) == APR_SUCCESS) { + if (optchar == 'r') + ++reader; + } + + if (reader) + do_read(); + else + do_write(); + + return 0; +} From 0a06ad76ce8c5f1d5b3aed1eacc820519567587b Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 29 Nov 2000 07:41:27 +0000 Subject: [PATCH 0832/7878] Add an extra const into the getopt functions. We never attempt to modify any of the data, so the const is proper. This also allows clients to pass const data in. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60812 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 2 +- misc/unix/getopt.c | 10 ++++------ test/testargs.c | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index cfa269667ce..9d393238f54 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -110,7 +110,7 @@ struct apr_getopt_option_t { * @deffunc apr_status_t apr_initopt(apr_getopt_t **os, apr_pool_t *cont,int argc, char *const *argv) */ APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, - int argc, char *const *argv); + int argc, const char *const *argv); /** * Parse the options initialized by apr_initopt(). diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index f74603aecde..e27ff5ed26c 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -49,10 +49,8 @@ static const char *pretty_path (const char *name) } APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, - int argc, char *const *argv) + int argc, const char *const *argv) { - int i; - *os = apr_palloc(cont, sizeof(apr_getopt_t)); (*os)->cont = cont; (*os)->err = 1; @@ -64,19 +62,19 @@ APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, want to use this function with arrays other than the main argv, and we shouldn't touch the caller's data. So we copy. */ (*os)->argv = apr_palloc(cont, (argc + 1) * sizeof(const char *)); - for (i = 0; i < argc; i++) - (*os)->argv[i] = argv[i]; + memcpy((*os)->argv, argv, argc * sizeof(const char *)); (*os)->argv[argc] = NULL; (*os)->interleave = 0; (*os)->ind = 1; (*os)->skip_start = 1; (*os)->skip_end = 1; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, - char *optch, const char **optarg) + char *optch, const char **optarg) { const char *oli; /* option letter list index */ diff --git a/test/testargs.c b/test/testargs.c index 3a2bafbec45..e9a5ecc0246 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -73,7 +73,7 @@ static void maybe_arg(const char *arg) } } -int main(int argc, char * const argv[]) +int main(int argc, const char * const argv[]) { apr_pool_t *context; apr_getopt_t *opt; From 20c4ef308e4b0f17ecc69695cfe192c9f53ecb6b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 29 Nov 2000 18:15:12 +0000 Subject: [PATCH 0833/7878] Preparing to eliminate apr_canonical_error git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60813 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 83 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 75 insertions(+), 8 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 485198f3213..384ba49f4ef 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -356,6 +356,36 @@ char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); #define APR_EINPROGRESS (APR_OS_START_CANONERR + 17) #endif +#ifdef ECONNABORTED +#define APR_ECONNABORTED ECONNABORTED +#else +#define APR_ECONNABORTED (APR_OS_START_CANONERR + 18) +#endif + +#ifdef ECONNRESET +#define APR_ECONNRESET ECONNRESET +#else +#define APR_ECONNRESET (APR_OS_START_CANONERR + 19) +#endif + +#ifdef ETIMEDOUT +#define APR_ETIMEDOUT ETIMEDOUT +#else +#define APR_ETIMEDOUT (APR_OS_START_CANONERR + 20) +#endif + +#ifdef EHOSTUNREACH +#define APR_EHOSTUNREACH EHOSTUNREACH +#else +#define APR_EHOSTUNREACH (APR_OS_START_CANONERR + 21) +#endif + +#ifdef ENETUNREACH +#define APR_ENETUNREACH ENETUNREACH +#else +#define APR_ENETUNREACH (APR_OS_START_CANONERR + 22) +#endif + #if defined(OS2) @@ -410,6 +440,16 @@ char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); || (s) == APR_OS_START_SYSERR + SOCECONNREFUSED) #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ || (s) == APR_OS_START_SYSERR + SOCEINPROGRESS) +#define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ + || (s) == APR_OS_START_SYSERR + SOCECONNABORTED) +#define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ + || (s) == APR_OS_START_SYSERR + SOCECONNRESET) +#define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ + || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT) +#define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ + || (s) == APR_OS_START_SYSERR + SOCEHOSTUNREACH) +#define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ + || (s) == APR_OS_START_SYSERR + SOCENETUNREACH) /* Sorry, too tired to wrap this up for OS2... feel free to @@ -429,19 +469,14 @@ char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); { SOCEADDRINUSE, EADDRINUSE }, { SOCEADDRNOTAVAIL, EADDRNOTAVAIL }, { SOCENETDOWN, ENETDOWN }, - { SOCENETUNREACH, ENETUNREACH }, { SOCENETRESET, ENETRESET }, - { SOCECONNABORTED, ECONNABORTED }, - { SOCECONNRESET, ECONNRESET }, { SOCENOBUFS, ENOBUFS }, { SOCEISCONN, EISCONN }, { SOCENOTCONN, ENOTCONN }, { SOCESHUTDOWN, ESHUTDOWN }, { SOCETOOMANYREFS, ETOOMANYREFS }, - { SOCETIMEDOUT, ETIMEDOUT }, { SOCELOOP, ELOOP }, { SOCEHOSTDOWN, EHOSTDOWN }, - { SOCEHOSTUNREACH, EHOSTUNREACH }, { SOCENOTEMPTY, ENOTEMPTY }, { SOCEPIPE, EPIPE } */ @@ -500,7 +535,16 @@ char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED) #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS) - +#define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ + || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) +#define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ + || (s) == APR_OS_START_SYSERR + WSAECONNRESET) +#define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ + || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT) +#define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ + || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) +#define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ + || (s) == APR_OS_START_SYSERR + WSAENETUNREACH) #else /* !def OS2 || WIN32 */ @@ -529,19 +573,42 @@ char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF) #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL) #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE) + #if !defined(EWOULDBLOCK) || !defined(EAGAIN) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) #elif (EWOULDBLOCK == EAGAIN) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) #else -#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN || (s) == EWOULDBLOCK) +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ + || (s) == EWOULDBLOCK) #endif + #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR) #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK) #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED) #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS) -#endif /* endif defined(WIN32) */ +/* EPROTO on certain older kernels really means ECONNABORTED, so we need to + * ignore it for them. See discussion in new-httpd archives nh.9701 & nh.9603 + * + * There is potentially a bug in Solaris 2.x x<6, and other boxes that + * implement tcp sockets in userland (i.e. on top of STREAMS). On these + * systems, EPROTO can actually result in a fatal loop. See PR#981 for + * example. It's hard to handle both uses of EPROTO. + */ +#ifdef EPROTO +#define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ + || (s) == EPROTO) +#else +#define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED) +#endif + +#define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET) +#define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT) +#define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH) +#define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH) + +#endif /* !def OS2 || WIN32 */ #ifdef __cplusplus From e289f826be15fb76c27d15bc65ee81e4ec7c7a3d Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 29 Nov 2000 19:35:52 +0000 Subject: [PATCH 0834/7878] Tweak the APR_OFF_T_FMT logic so that we get the right value on Solaris Sparc too. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60814 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ configure.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 5e3d300bb9c..9d240f53dec 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +Changes with APR a9 + *) Get APR_OFF_T_FMT defined properly on Solaris Sparc. + [Jeff Trawick] + Changes with APR a8 *) Change the name of the sa_len field in apr_sockaddr_t to salen. Some platforms have a macro named sa_len. diff --git a/configure.in b/configure.in index 017988ad8a9..70c133f5e23 100644 --- a/configure.in +++ b/configure.in @@ -418,7 +418,7 @@ fi # don't get it right for your platform, you can override our decision # below. case "$OS" in - *linux* | *os2_emx | *-pc-solaris*) + *linux* | *os2_emx | *-solaris*) off_t_fmt='#define APR_OFF_T_FMT "ld"' esac From 85c65fbadc6a5374cd72074518e5d480e78d9964 Mon Sep 17 00:00:00 2001 From: Greg Ames <gregames@apache.org> Date: Wed, 29 Nov 2000 21:16:10 +0000 Subject: [PATCH 0835/7878] Increment "initialize" every time a new APR user starts, so locks aren't destroyed prematurely. What a great day - mod_info is really back! Thanks to two Ryans and a Jeff. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60815 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/misc/unix/start.c b/misc/unix/start.c index a52bb44a912..62db9a2bafd 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -117,10 +117,9 @@ apr_status_t apr_initialize(void) int err; #endif - if (initialized) { + if (initialized++) { return APR_SUCCESS; } - initialized++; #if !defined(BEOS) && !defined(OS2) && !defined(WIN32) apr_unix_setup_lock(); From 0b183aa7cafa59db6960d9267c440b38b575215a Mon Sep 17 00:00:00 2001 From: Jim Jagielski <jim@apache.org> Date: Wed, 29 Nov 2000 23:11:21 +0000 Subject: [PATCH 0836/7878] Explain the "magic". Might be moot if we hard-code the logic in anyway, but what the hell. :) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60816 13f79535-47bb-0310-9956-ffa450edef68 --- apr_common.m4 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apr_common.m4 b/apr_common.m4 index ade5c1ac1de..24276364cf1 100644 --- a/apr_common.m4 +++ b/apr_common.m4 @@ -229,7 +229,16 @@ dnl dnl Handle the use of EXTRA_* variables. dnl Basically, EXTRA_* vars are added to the dnl current settings of their "parents". We -dnl can expand as needed. This is ugly +dnl can expand as needed for additional +dnl EXTRA_* variables by adding them to the +dnl "for i in..." line. +dnl +dnl To handle recursive configures, the 1st time +dnl through we need to null out EXTRA_* and then +dnl export the lot of them, since we want/need +dnl them to exist in the sub-configures' environment. +dnl The nasty eval's allow us to use the 'for' +dnl construct and save some lines of code. dnl AC_DEFUN(APR_DOEXTRA, [ for i in CFLAGS LDFLAGS LIBS From ad152c088f81224f928e43b71265d602dfd72c53 Mon Sep 17 00:00:00 2001 From: Branko Cibej <brane@apache.org> Date: Thu, 30 Nov 2000 07:57:26 +0000 Subject: [PATCH 0837/7878] Don't put -D_XOPEN_SOURCE_EXTENDED into CFLAGS for HP-UX targets. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60817 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hints.m4 b/hints.m4 index 18dd329b2cd..ea4aca54432 100644 --- a/hints.m4 +++ b/hints.m4 @@ -82,11 +82,11 @@ case "$host" in APR_SETIFNULL(CFLAGS, [-DHIUX]) ;; *-hp-hpux11.*) - APR_SETIFNULL(CFLAGS, [-DHPUX11 -D_XOPEN_SOURCE_EXTENDED]) + APR_SETIFNULL(CFLAGS, [-DHPUX11]) APR_SETIFNULL(LIBS, [-lm -lpthread]) ;; *-hp-hpux10.*) - APR_SETIFNULL(CFLAGS, [-DHPUX10 -D_XOPEN_SOURCE_EXTENDED]) + APR_SETIFNULL(CFLAGS, [-DHPUX10]) case $host in *-hp-hpux10.01) dnl # We know this is a problem in 10.01. @@ -96,7 +96,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? esac ;; *-hp-hpux*) - APR_SETIFNULL(CFLAGS, [-DHPUX -D_XOPEN_SOURCE_EXTENDED]) + APR_SETIFNULL(CFLAGS, [-DHPUX]) APR_SETIFNULL(LIBS, [-lm]) ;; *-linux-*) From 463085298fce8d24dd907c25cfec7312612ec966 Mon Sep 17 00:00:00 2001 From: Branko Cibej <brane@apache.org> Date: Thu, 30 Nov 2000 08:04:03 +0000 Subject: [PATCH 0838/7878] Check if h_errno is declared in netdb.h and whether any flags are required to make it visible. For instance, HP-UX 10.20 requires _XOPEN_SOURCE_EXTENDED. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60818 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 10 +++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index 922badc0cfc..0505fe68349 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -431,5 +431,56 @@ unsigned long foo = INADDR_NONE; fi ]) +dnl +dnl APR_CHECK_H_ERRNO_FLAG +dnl +dnl checks which flags are necessary for <netdb.h> to define h_errno +dnl +AC_DEFUN(APR_H_ERRNO_COMPILE_CHECK,[ + if test x$1 != x; then + CFLAGS="-D$1 $CFLAGS" + fi + AC_TRY_COMPILE([ +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif +],[ +int h_e = h_errno; +],[ + if test x$1 != x; then + ac_cv_h_errno_cflags="$1" + else + ac_cv_h_errno_cflags=yes + fi +],[ + ac_cv_h_errno_cflags=no +])]) +AC_DEFUN(APR_CHECK_H_ERRNO_FLAG,[ + AC_MSG_CHECKING([for h_errno in netdb.h]) + AC_CACHE_VAL(ac_cv_h_errno_cflags,[ + APR_H_ERRNO_COMPILE_CHECK + if test "$ac_cv_h_errno_cflags" = "no"; then + ac_save="$CFLAGS" + for flag in _XOPEN_SOURCE_EXTENDED; do + APR_H_ERRNO_COMPILE_CHECK($flag) + if test "$ac_cv_h_errno_cflags" != "no"; then + break + fi + done + CFLAGS="$ac_save" + fi + ]) + if test "$ac_cv_h_errno_cflags" != "no"; then + if test "$ac_cv_h_errno_cflags" != "yes"; then + CFLAGS="-D$ac_cv_h_errno_cflags $CFLAGS" + AC_MSG_RESULT([yes, with -D$ac_cv_h_errno_cflags]) + else + AC_MSG_RESULT([$ac_cv_h_errno_cflags]) + fi + else + AC_MSG_RESULT([$ac_cv_h_errno_cflags]) + fi +]) + sinclude(apr_common.m4) sinclude(hints.m4) diff --git a/configure.in b/configure.in index 70c133f5e23..9dc9d9e7805 100644 --- a/configure.in +++ b/configure.in @@ -265,7 +265,7 @@ AC_CHECK_HEADERS(io.h) AC_CHECK_HEADERS(limits.h) AC_CHECK_HEADERS(malloc.h) AC_CHECK_HEADERS(memory.h) -AC_CHECK_HEADERS(netdb.h) +AC_CHECK_HEADERS(netdb.h, netdbh="1", netdbh="0") AC_CHECK_HEADERS(osreldate.h) AC_CHECK_HEADERS(process.h) AC_CHECK_HEADERS(pwd.h) @@ -324,6 +324,14 @@ AC_SUBST(signalh) AC_SUBST(sys_waith) AC_SUBST(pthreadh) +dnl #----------------------------- Checking for h_errno in <netdb.h> +if test "$netdbh" = "1"; then + APR_CHECK_H_ERRNO_FLAG + if test "$ac_cv_h_errno_cflags" = "no"; then + AC_MSG_ERROR([can not find h_errno in netdb.h]) + fi +fi + dnl #----------------------------- Checks for standard typedefs AC_TYPE_OFF_T AC_TYPE_PID_T From 28ed54655a60adad49639f8dba296db2d2c51978 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 30 Nov 2000 19:19:32 +0000 Subject: [PATCH 0839/7878] include stddef.h for NULL git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60819 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/xlate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 5f04132fb47..b3f308d404e 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -64,6 +64,9 @@ #if APR_HAS_XLATE +#ifdef HAVE_STDDEF_H +#include <stddef.h> /* for NULL */ +#endif #ifdef HAVE_LANGINFO_H #include <langinfo.h> #endif From 35b030f2ef0eb771f66b5330973d8e34204a3f98 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 30 Nov 2000 22:17:58 +0000 Subject: [PATCH 0840/7878] Lock config changes: 1) Detect SysV sem capability by the presence of sempaphore functions, not by the presence of union semun. (I don't think this changed anything in practice since systems tend to have flock and fcntl.) 2) New config variable apr_lock_method can override autodetection of the apr_lock implementation method. 3) Select SysV semaphores for OS/390 because they perform better than other supported locking mechanisms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60820 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ configure.in | 10 +++++++--- hints.m4 | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 9d240f53dec..c9e69545abb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,10 @@ Changes with APR a9 + *) Lock config changes: Detect SysV sem capability by the presence of + sempaphore functions, not by the presence of union semun. New + config variable apr_lock_method can override autodetection of the + apr_lock implementation method. For now, hints.m4 uses it to select + SysV semaphores for OS/390. [Jeff Trawick] + *) Get APR_OFF_T_FMT defined properly on Solaris Sparc. [Jeff Trawick] diff --git a/configure.in b/configure.in index 9dc9d9e7805..dda898c896b 100644 --- a/configure.in +++ b/configure.in @@ -596,6 +596,8 @@ AC_SUBST(struct_rlimit) dnl #----------------------------- Checking for Locking Characteristics echo $ac_n "${nl}Checking for Locking...${nl}" +AC_CHECK_FUNCS(semget semctl) + # It's stupid, but not all platforms have union semun, even those that need it. AC_MSG_CHECKING(for union semun in sys/sem.h) AC_TRY_COMPILE([ @@ -625,8 +627,8 @@ if test "$threads" = "1"; then AC_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h) fi -AC_BEGIN_DECISION([ap_lock implementation method]) -AC_IFALLYES(custom:union_semun, +AC_BEGIN_DECISION([apr_lock implementation method]) +AC_IFALLYES(func:semget func:semctl, AC_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) AC_IFALLYES(header:sys/file.h define:LOCK_EX, AC_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) @@ -635,7 +637,9 @@ AC_IFALLYES(header:fcntl.h define:F_SETLK, AC_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl custom:with_pthread_cross, AC_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) -dnl AC_DECISION_FORCE(USE_FCNTL_SERIALIZE) +if test "x$apr_lock_method" != "x"; then + AC_DECISION_FORCE($apr_lock_method) +fi AC_END_DECISION AC_DEFINE_UNQUOTED($ac_decision) diff --git a/hints.m4 b/hints.m4 index ea4aca54432..3d0f52ded6e 100644 --- a/hints.m4 +++ b/hints.m4 @@ -347,6 +347,7 @@ dnl ;; APR_SETIFNULL(CC, [c89]) ;; *-ibm-os390) + APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE]) APR_SETIFNULL(CC, [cc]) APR_ADDTO(CFLAGS, [-U_NO_PROTO]) APR_ADDTO(CFLAGS, [-DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR]) From fc92f6c8e5867fdd9c9e1c88b7775c49b03d6399 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 30 Nov 2000 23:41:03 +0000 Subject: [PATCH 0841/7878] begin a list of symbols to rename. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60821 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 0062e7209c0..2d32c8f0a22 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ Apache 2.0 STATUS: -Last modified at [$Date: 2000/11/20 22:59:32 $] +Last modified at [$Date: 2000/11/30 23:41:03 $] Release: @@ -14,6 +14,8 @@ Release: RELEASE SHOWSTOPPERS: + * Rename Symbols: + apr_opendir --> apr_dir_open RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From a07394b44c305d9e50c37ec37c8674719537e526 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 30 Nov 2000 23:46:32 +0000 Subject: [PATCH 0842/7878] Add a helper script to generate a list of all of the functions exported from APR. This script is probably not fully correct, but it seems to work for APR. It generates a file with the format: apr_create_process apr_wait_proc apr_wait_all_procs apr_detach APR_HAS_OTHER_CHILD apr_register_other_child apr_unregister_other_child apr_reap_other_child apr_check_other_child apr_probe_writable_fds \APR_HAS_OTHER_CHILD Anything that is indented is dependany on the macro defined above it. Anything that is not indented does not depend on any macros. This script is meant to generate a single .exports file for all platforms, that .exports file can then be used to generate the correct .def .exp, or exports.c file as appropriate. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60822 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/make_export.pl | 73 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100755 helpers/make_export.pl diff --git a/helpers/make_export.pl b/helpers/make_export.pl new file mode 100755 index 00000000000..d9ef5500d73 --- /dev/null +++ b/helpers/make_export.pl @@ -0,0 +1,73 @@ +#!/usr/bin/perl + +require "getopts.pl"; + +&Getopts( 'o:' ); + +if ($#ARGV < 0) { + die "Usage: -o <output_file> <input_files>"; +} + +if (!defined $opt_o) { + $opt_o = "apr.exports"; +} + +open (OUTFILE, ">$opt_o") || die "Can't open $opt_o $!\n"; + +while ($srcfile = shift(@ARGV)) { + my $line; + my $count; + my $found; + + open (FILE, $srcfile) || die "Can't open $srcfile\n"; + print STDERR "Reading \"$srcfile\"\n"; + + $count = 0; + $found = 0; + $line = ""; +# print OUTFILE "____$srcfile\n"; + while (<FILE>) { + chomp; + + s/^\s*//; + + if (/\#if (APR_HAS.*)/) { + $count++; + $found++; + $macro = $1; + $line = "$macro\n"; + next; + } + elsif (/^(APR_DECLARE[^\(]*\()?[a-z_]+\)?\s+([A-Za-z0-9_]+)\(/) { + # We only want to increase this if we are in the middle of a + # #if ... #endif block. + if ($found) { + $found++; + } + for (my $i=0; $i < $count; $i++) { + $line .= "\t"; + } + $line .= "$2\n"; + next; + } + elsif (/\#endif/) { + if ($count > 0) { + $count--; + $line .= "\\$macro\n"; + } + if ($found == 1) { + $found = 0; + $line = ""; + next; + } + elsif ($found > 1) { + $found = 0; + } + } + if ($line && !$found) { + print OUTFILE "$line"; + $line = ""; + } + } +} + From 4692cbf643b6014f97d77fc0b581ac49a44466e1 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 30 Nov 2000 23:56:03 +0000 Subject: [PATCH 0843/7878] Add a make target to let us easily build the exports file for APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60823 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile.in b/Makefile.in index 096d07beb71..eb8525c3a86 100644 --- a/Makefile.in +++ b/Makefile.in @@ -100,6 +100,9 @@ subdirs_distclean: install: all +exports: + ./helpers/make_export.pl -o ./apr.exports include/*.h + docs: ./helpers/scandoc -i./helpers/default.pl -p./docs/ ./include/*.h From 813dbf5a17afa06fd2da417834d4e0333fc7dfff Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 1 Dec 2000 05:50:22 +0000 Subject: [PATCH 0844/7878] Fix a couple of bugs with the script that generates the apr.exports file. This script is really not extensible as it is currently written, but at least it works for APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60824 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/make_export.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/helpers/make_export.pl b/helpers/make_export.pl index d9ef5500d73..659d549a04a 100755 --- a/helpers/make_export.pl +++ b/helpers/make_export.pl @@ -31,10 +31,10 @@ s/^\s*//; - if (/\#if (APR_HAS.*)/) { + if (/\#if(def)? (APR_.*)/) { $count++; $found++; - $macro = $1; + $macro = $2; $line = "$macro\n"; next; } @@ -53,14 +53,14 @@ elsif (/\#endif/) { if ($count > 0) { $count--; - $line .= "\\$macro\n"; + $line .= "\/$macro\n"; } - if ($found == 1) { - $found = 0; + if ($found == $count + 1) { + $found--; $line = ""; next; } - elsif ($found > 1) { + elsif ($found > $count + 1) { $found = 0; } } From 9abddeaeb6ce48e45fb82710092121e62e4f7355 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 1 Dec 2000 06:27:16 +0000 Subject: [PATCH 0845/7878] Change POOL_DEBUG into APR_POOL_DEBUG. This allows us to detect the macro when we scan the APR header files to generate the export list. If we use POOL_DEBUG, then we can't determine when the debug functions are available and when they aren't. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60825 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 43 ++++++++++++++++++++--------------------- lib/apr_pools.c | 42 ++++++++++++++++++++-------------------- memory/unix/apr_pools.c | 42 ++++++++++++++++++++-------------------- 3 files changed, 63 insertions(+), 64 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 98705202fcf..3f6cf40bf7b 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -97,7 +97,7 @@ extern "C" { /* #define ALLOC_DEBUG -#define POOL_DEBUG +#define APR_POOL_DEBUG #define ALLOC_USE_MALLOC #define MAKE_TABLE_PROFILE #define ALLOC_STATS @@ -133,7 +133,7 @@ struct apr_pool_t { /** The allocation list if using malloc */ void *allocation_list; #endif -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG /** a list of joined pools * @defvar apr_pool_t *joined */ struct apr_pool_t *joined; @@ -165,8 +165,8 @@ struct apr_pool_t { * * In general we say that it is safe to insert data into a table T * if the data is allocated in any ancestor of T's pool. This is the - * basis on which the POOL_DEBUG code works -- it tests these ancestor - * relationships for all data inserted into tables. POOL_DEBUG also + * basis on which the APR_POOL_DEBUG code works -- it tests these ancestor + * relationships for all data inserted into tables. APR_POOL_DEBUG also * provides tools (apr_find_pool, and apr_pool_is_ancestor) for other * folks to implement similar restrictions for their own data * structures. @@ -180,18 +180,27 @@ struct apr_pool_t { * parent pool. * * In this case the caller must call apr_pool_join() to indicate this - * guarantee to the POOL_DEBUG code. There are a few examples spread + * guarantee to the APR_POOL_DEBUG code. There are a few examples spread * through the standard modules. */ -#ifndef POOL_DEBUG +#ifdef APR_POOL_DEBUG +APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub); +APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts); + +/** + * Determine if pool a is an ancestor of pool b + * @param a The pool to search + * @param b The pool to search for + * @return True if a is an ancestor of b, NULL is considered an ancestor + * of all pools. + * @deffunc int apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) + */ +APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); +#else #ifdef apr_pool_join #undef apr_pool_join #endif #define apr_pool_join(a,b) -#else -APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub); -APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts); -APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); #endif #ifdef ULTRIX_BRAIN_DEATH @@ -301,16 +310,6 @@ APR_DECLARE(apr_size_t) apr_bytes_in_pool(apr_pool_t *p); */ APR_DECLARE(apr_size_t) apr_bytes_in_free_blocks(void); -/** - * Determine if pool a is an ancestor of pool b - * @param a The pool to search - * @param b The pool to search for - * @return True if a is an ancestor of b, NULL is considered an ancestor - * of all pools. - * @deffunc int apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) - */ -APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); - /** * Allocate a block of memory from a pool * @param c The pool to allocate out of @@ -383,12 +382,12 @@ APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data); /* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t will not be * destroyed before the parent pool */ -#ifndef POOL_DEBUG +#ifndef APR_POOL_DEBUG #ifdef apr_pool_join #undef apr_pool_join #endif /* apr_pool_join */ #define apr_pool_join(a,b) -#endif /* POOL_DEBUG */ +#endif /* APR_POOL_DEBUG */ #ifdef __cplusplus } diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 4368af4b272..2a736f31cdf 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -117,17 +117,17 @@ #define BLOCK_MINALLOC 8192 #endif -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG /* first do some option checking... */ #ifdef ALLOC_USE_MALLOC -#error "sorry, no support for ALLOC_USE_MALLOC and POOL_DEBUG at the same time" +#error "sorry, no support for ALLOC_USE_MALLOC and APR_POOL_DEBUG at the same time" #endif /* ALLOC_USE_MALLOC */ #ifdef MULTITHREAD -# error "sorry, no support for MULTITHREAD and POOL_DEBUG at the same time" +# error "sorry, no support for MULTITHREAD and APR_POOL_DEBUG at the same time" #endif /* MULTITHREAD */ -#endif /* POOL_DEBUG */ +#endif /* APR_POOL_DEBUG */ #ifdef ALLOC_USE_MALLOC #undef BLOCK_MINFREE @@ -169,10 +169,10 @@ union block_hdr { char *endp; union block_hdr *next; char *first_avail; -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG union block_hdr *global_next; apr_pool_t *owning_pool; -#endif /* POOL_DEBUG */ +#endif /* APR_POOL_DEBUG */ } h; }; @@ -197,12 +197,12 @@ static apr_lock_t *alloc_mutex; static apr_lock_t *spawn_mutex; #endif -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG static char *known_stack_point; static int stack_direction; static union block_hdr *global_block_list; #define FREE_POOL ((apr_pool_t *)(-1)) -#endif /* POOL_DEBUG */ +#endif /* APR_POOL_DEBUG */ #ifdef ALLOC_STATS static unsigned long long num_free_blocks_calls; @@ -267,11 +267,11 @@ static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) blok->h.endp -= CLICK_SZ; #endif /* ALLOC_DEBUG */ -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG blok->h.global_next = global_block_list; global_block_list = blok; blok->h.owning_pool = NULL; -#endif /* POOL_DEBUG */ +#endif /* APR_POOL_DEBUG */ return blok; } @@ -351,18 +351,18 @@ static void free_blocks(union block_hdr *blok) chk_on_blk_list(blok, old_free_list); blok->h.first_avail = (char *) (blok + 1); debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG blok->h.owning_pool = FREE_POOL; -#endif /* POOL_DEBUG */ +#endif /* APR_POOL_DEBUG */ blok = blok->h.next; } chk_on_blk_list(blok, old_free_list); blok->h.first_avail = (char *) (blok + 1); debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG blok->h.owning_pool = FREE_POOL; -#endif /* POOL_DEBUG */ +#endif /* APR_POOL_DEBUG */ /* Finally, reset next pointer to get the old free blocks back */ @@ -474,7 +474,7 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int blok = new_block(POOL_HDR_BYTES, apr_abort); new_pool = (apr_pool_t *) blok->h.first_avail; blok->h.first_avail += POOL_HDR_BYTES; -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG blok->h.owning_pool = new_pool; #endif @@ -501,7 +501,7 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int return new_pool; } -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG static void stack_var_init(char *s) { char t; @@ -639,7 +639,7 @@ apr_status_t apr_init_alloc(void) #if APR_HAS_THREADS apr_status_t status; #endif -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG char s; known_stack_point = &s; @@ -750,9 +750,9 @@ APR_DECLARE(apr_size_t) apr_bytes_in_free_blocks(void) } /***************************************************************** - * POOL_DEBUG support + * APR_POOL_DEBUG support */ -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG /* the unix linker defines this symbol as the last byte + 1 of * the executable... so it includes TEXT, BSS, and DATA @@ -939,7 +939,7 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) blok = new_block(size, a->apr_abort); a->last->h.next = blok; a->last = blok; -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG blok->h.owning_pool = a; #endif @@ -1097,7 +1097,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) if (ps.got_a_new_block) { p->last->h.next = ps.blok; p->last = ps.blok; -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG ps.blok->h.owning_pool = p; #endif } diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 4368af4b272..2a736f31cdf 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -117,17 +117,17 @@ #define BLOCK_MINALLOC 8192 #endif -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG /* first do some option checking... */ #ifdef ALLOC_USE_MALLOC -#error "sorry, no support for ALLOC_USE_MALLOC and POOL_DEBUG at the same time" +#error "sorry, no support for ALLOC_USE_MALLOC and APR_POOL_DEBUG at the same time" #endif /* ALLOC_USE_MALLOC */ #ifdef MULTITHREAD -# error "sorry, no support for MULTITHREAD and POOL_DEBUG at the same time" +# error "sorry, no support for MULTITHREAD and APR_POOL_DEBUG at the same time" #endif /* MULTITHREAD */ -#endif /* POOL_DEBUG */ +#endif /* APR_POOL_DEBUG */ #ifdef ALLOC_USE_MALLOC #undef BLOCK_MINFREE @@ -169,10 +169,10 @@ union block_hdr { char *endp; union block_hdr *next; char *first_avail; -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG union block_hdr *global_next; apr_pool_t *owning_pool; -#endif /* POOL_DEBUG */ +#endif /* APR_POOL_DEBUG */ } h; }; @@ -197,12 +197,12 @@ static apr_lock_t *alloc_mutex; static apr_lock_t *spawn_mutex; #endif -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG static char *known_stack_point; static int stack_direction; static union block_hdr *global_block_list; #define FREE_POOL ((apr_pool_t *)(-1)) -#endif /* POOL_DEBUG */ +#endif /* APR_POOL_DEBUG */ #ifdef ALLOC_STATS static unsigned long long num_free_blocks_calls; @@ -267,11 +267,11 @@ static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) blok->h.endp -= CLICK_SZ; #endif /* ALLOC_DEBUG */ -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG blok->h.global_next = global_block_list; global_block_list = blok; blok->h.owning_pool = NULL; -#endif /* POOL_DEBUG */ +#endif /* APR_POOL_DEBUG */ return blok; } @@ -351,18 +351,18 @@ static void free_blocks(union block_hdr *blok) chk_on_blk_list(blok, old_free_list); blok->h.first_avail = (char *) (blok + 1); debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG blok->h.owning_pool = FREE_POOL; -#endif /* POOL_DEBUG */ +#endif /* APR_POOL_DEBUG */ blok = blok->h.next; } chk_on_blk_list(blok, old_free_list); blok->h.first_avail = (char *) (blok + 1); debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG blok->h.owning_pool = FREE_POOL; -#endif /* POOL_DEBUG */ +#endif /* APR_POOL_DEBUG */ /* Finally, reset next pointer to get the old free blocks back */ @@ -474,7 +474,7 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int blok = new_block(POOL_HDR_BYTES, apr_abort); new_pool = (apr_pool_t *) blok->h.first_avail; blok->h.first_avail += POOL_HDR_BYTES; -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG blok->h.owning_pool = new_pool; #endif @@ -501,7 +501,7 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int return new_pool; } -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG static void stack_var_init(char *s) { char t; @@ -639,7 +639,7 @@ apr_status_t apr_init_alloc(void) #if APR_HAS_THREADS apr_status_t status; #endif -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG char s; known_stack_point = &s; @@ -750,9 +750,9 @@ APR_DECLARE(apr_size_t) apr_bytes_in_free_blocks(void) } /***************************************************************** - * POOL_DEBUG support + * APR_POOL_DEBUG support */ -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG /* the unix linker defines this symbol as the last byte + 1 of * the executable... so it includes TEXT, BSS, and DATA @@ -939,7 +939,7 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) blok = new_block(size, a->apr_abort); a->last->h.next = blok; a->last = blok; -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG blok->h.owning_pool = a; #endif @@ -1097,7 +1097,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) if (ps.got_a_new_block) { p->last->h.next = ps.blok; p->last = ps.blok; -#ifdef POOL_DEBUG +#ifdef APR_POOL_DEBUG ps.blok->h.owning_pool = p; #endif } From 9855a19d26718548fd28a2c9247b9fae7600e99d Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 1 Dec 2000 06:32:00 +0000 Subject: [PATCH 0846/7878] Fix a small bug in the export code. This allows us to nest multiple macros. There is a small bug in this code, because we report the wrong macro in the end tag. For example: APR_HAS_XLATE apr_xlate_conv_buffer APR_NOT_DONE_YET apr_xlate_conv_char /APR_NOT_DONE_YET /APR_NOT_DONE_YET This is minorly annoying, but not horrible. We generally use the amount of indentation and the number of macros found to match things up. Hopefully we can fix this later. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60826 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/make_export.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/make_export.pl b/helpers/make_export.pl index 659d549a04a..fa4a0505868 100755 --- a/helpers/make_export.pl +++ b/helpers/make_export.pl @@ -35,7 +35,7 @@ $count++; $found++; $macro = $2; - $line = "$macro\n"; + $line .= "$macro\n"; next; } elsif (/^(APR_DECLARE[^\(]*\()?[a-z_]+\)?\s+([A-Za-z0-9_]+)\(/) { From a6308facfc1731335f0d9d79b3f62316ee631377 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 1 Dec 2000 06:37:45 +0000 Subject: [PATCH 0847/7878] This is basically a small header re-org, it doesn't really change anything, just how we report it. There are two classes of changes, both of which are required by the script that generates the export list. 1) Always specify what we have instead of what we don't have. This just means that I changed a #if !APR_HAS_XLATE to #if APR_HAS_XLATE It is easier for the exports script if all of APR is specified the same way. 2) Wrap functions that aren't actually defined with APR_NOT_DONE_YET. This class of changes comes about because we have some functions that have prototypes in the headers, but no implementation. I just put #if APR_NOT_DONE_YET and #endif around those prototypes so that our exports script doesn't try to link against them. There is a comment explaining this in the code, and this can be removed once the functions actually exist. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60827 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 9 ++++++- include/apr_xlate.h | 56 ++++++++++++++++++++++--------------------- 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 10506aea95b..b38c50393b3 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -246,7 +246,13 @@ struct apr_finfo_t { * @param child_name May be absolute, in which case trusted_name is ignored * unless APR_CHILD_RELATIVE is tested. */ - +/* This is a hack, because none of these functions actually exist yet. The + * problem is that we generate our exports from the header files, so we are + * trying to export these functions, but they don't exist, so we can't link. + * This just makes sure that we don't try to link these functions until + * they actually exist. + */ +#ifdef APR_NOT_DONE_YET apr_status_t apr_make_canonical_name(apr_canon_t **new_name, const apr_canon_t *trusted_name, const char *child_name, @@ -292,6 +298,7 @@ apr_status_t apr_is_relative(apr_canon_t **path); * isn't an adaquately complete root for UNC paths. */ apr_status_t apr_is_virtualroot(apr_canon_t **path, int elements); +#endif /** * Open the specified file. diff --git a/include/apr_xlate.h b/include/apr_xlate.h index 1d78d8799e3..46186483c5a 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -74,33 +74,7 @@ extern "C" { * APR_ENOTIMPL at run-time. */ -#if ! APR_HAS_XLATE - -typedef void apr_xlate_t; - -/* For platforms where we don't bother with translating between charsets, - * these are macros which always return failure. - */ - -#define apr_xlate_open(convset, topage, frompage, pool) APR_ENOTIMPL - -#define apr_xlate_get_sb(convset, onoff) APR_ENOTIMPL - -#define apr_xlate_conv_buffer(convset, inbuf, inbytes_left, outbuf, \ - outbytes_left) APR_ENOTIMPL - -#define apr_xlate_conv_byte(convset, inchar) (-1) - -/* The purpose of apr_xlate_conv_char is to translate one character - * at a time. This needs to be written carefully so that it works - * with double-byte character sets. - */ -#define apr_xlate_conv_char(convset, inchar, outchar) APR_ENOTIMPL - -#define apr_xlate_close(convset) APR_ENOTIMPL - -#else /* ! APR_HAS_XLATE */ - +#if APR_HAS_XLATE typedef struct apr_xlate_t apr_xlate_t; /** @@ -154,6 +128,8 @@ apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, apr_size_t *inbytes_left, char *outbuf, apr_size_t *outbytes_left); +/* See the comment in apr_file_io.h about this hack */ +#ifdef APR_NOT_DONE_YET /** * The purpose of apr_xlate_conv_char is to translate one character * at a time. This needs to be written carefully so that it works @@ -164,6 +140,7 @@ apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, * @param outchar The converted character */ apr_status_t apr_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar); +#endif /** * Convert a single-byte character from one charset to another. @@ -181,6 +158,31 @@ apr_int32_t apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar); */ apr_status_t apr_xlate_close(apr_xlate_t *convset); +#else + +typedef void apr_xlate_t; + +/* For platforms where we don't bother with translating between charsets, + * these are macros which always return failure. + */ + +#define apr_xlate_open(convset, topage, frompage, pool) APR_ENOTIMPL + +#define apr_xlate_get_sb(convset, onoff) APR_ENOTIMPL + +#define apr_xlate_conv_buffer(convset, inbuf, inbytes_left, outbuf, \ + outbytes_left) APR_ENOTIMPL + +#define apr_xlate_conv_byte(convset, inchar) (-1) + +/* The purpose of apr_xlate_conv_char is to translate one character + * at a time. This needs to be written carefully so that it works + * with double-byte character sets. + */ +#define apr_xlate_conv_char(convset, inchar, outchar) APR_ENOTIMPL + +#define apr_xlate_close(convset) APR_ENOTIMPL + #endif /* ! APR_HAS_XLATE */ #ifdef __cplusplus From ef0045cfe9e26b6d66aa5a3b2ea4f8ab74ff79fe Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 1 Dec 2000 06:55:41 +0000 Subject: [PATCH 0848/7878] Add a CHANGES log and make sure that apr.exports is removed when make distclean is used. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60828 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++++++ Makefile.in | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c9e69545abb..14a7becebdb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,11 @@ Changes with APR a9 +<<<<<<< CHANGES + *) Add a build rule, exports, this creates a file at the top-level, + apr.exports, which lists every function exported by APR. The + file is generated by a script in helpers, that reads each header + file. + [Ryan Bloom] + *) Lock config changes: Detect SysV sem capability by the presence of sempaphore functions, not by the presence of union semun. New config variable apr_lock_method can override autodetection of the diff --git a/Makefile.in b/Makefile.in index eb8525c3a86..c9e436fd93e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -59,7 +59,7 @@ depend: subdirs_depend distclean: subdirs_distclean -$(RM) -f include/apr.h include/apr_private.h include/apr_private.h.in -$(RM) -f *.o *.a *.so - -$(RM) -f config.cache config.status config.log configure + -$(RM) -f config.cache config.status config.log configure apr.exports -$(RM) -f Makefile -$(RM) -f APRVARS -$(RM) -rf objs From 9f130233a747e39244d9fd5046330d9139804607 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 1 Dec 2000 07:01:28 +0000 Subject: [PATCH 0849/7878] Make the export generation a bit quieter. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60829 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/make_export.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/make_export.pl b/helpers/make_export.pl index fa4a0505868..8541bca2da3 100755 --- a/helpers/make_export.pl +++ b/helpers/make_export.pl @@ -20,7 +20,7 @@ my $found; open (FILE, $srcfile) || die "Can't open $srcfile\n"; - print STDERR "Reading \"$srcfile\"\n"; +# print STDERR "Reading \"$srcfile\"\n"; $count = 0; $found = 0; From 2f88f694866840dc490dc5adb38b7d0e978525f4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 1 Dec 2000 07:22:17 +0000 Subject: [PATCH 0850/7878] Stop generating the exports file with a make target, instead just do it at configure time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60830 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- buildconf | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 14a7becebdb..2bc03d175c2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,6 @@ Changes with APR a9 <<<<<<< CHANGES - *) Add a build rule, exports, this creates a file at the top-level, + *) Add a step at configure time to create a file at the top-level, apr.exports, which lists every function exported by APR. The file is generated by a script in helpers, that reads each header file. diff --git a/buildconf b/buildconf index a84acf3540c..52eb6297051 100755 --- a/buildconf +++ b/buildconf @@ -3,3 +3,6 @@ autoconf;autoheader (cd shmem/unix/mm && autoconf) + +./helpers/make_export.pl -o ./apr.exports include/*.h + From 78835469c7c8c072f874575df0a8bff58a72280d Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 1 Dec 2000 07:23:23 +0000 Subject: [PATCH 0851/7878] Remove some left overs from a merge. Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60831 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGES b/CHANGES index 2bc03d175c2..66887653efe 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,4 @@ Changes with APR a9 -<<<<<<< CHANGES *) Add a step at configure time to create a file at the top-level, apr.exports, which lists every function exported by APR. The file is generated by a script in helpers, that reads each header From 97017d38aad171e50bdd5c871968ae53252012a3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 1 Dec 2000 07:27:40 +0000 Subject: [PATCH 0852/7878] Ignore the apr.exports file git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60832 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.cvsignore b/.cvsignore index 385143cc4a8..6825bfc7b4c 100644 --- a/.cvsignore +++ b/.cvsignore @@ -13,3 +13,4 @@ Release *.mak *.opt *.plg +apr.exports From fe7f4ed0ccd5aef005c9dc0ca85fdc93c5254511 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 1 Dec 2000 14:00:55 +0000 Subject: [PATCH 0853/7878] New config variable apr_process_lock_is_global specifies that the selected inter-process lock method is sufficient for APR_LOCKALL (i.e., it blocks all threads and processes). For now, hints.m4 turns on this flag for OS/390. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60833 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 +++++- configure.in | 11 +++++++++++ hints.m4 | 1 + include/apr.h.in | 2 ++ include/apr.hw | 2 ++ locks/unix/locks.c | 16 ++++++++++++++++ 6 files changed, 37 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 66887653efe..267f547d3c0 100644 --- a/CHANGES +++ b/CHANGES @@ -9,7 +9,11 @@ Changes with APR a9 sempaphore functions, not by the presence of union semun. New config variable apr_lock_method can override autodetection of the apr_lock implementation method. For now, hints.m4 uses it to select - SysV semaphores for OS/390. [Jeff Trawick] + SysV semaphores for OS/390. New config variable + apr_process_lock_is_global specifies that the selected inter-process + lock method is sufficient for APR_LOCKALL (i.e., it blocks all + threads and processes). For now, hints.m4 turns on this flag for + OS/390. [Jeff Trawick] *) Get APR_OFF_T_FMT defined properly on Solaris Sparc. [Jeff Trawick] diff --git a/configure.in b/configure.in index dda898c896b..421f58d73ea 100644 --- a/configure.in +++ b/configure.in @@ -668,6 +668,17 @@ AC_SUBST(fcntlser) AC_SUBST(procpthreadser) AC_SUBST(pthreadser) +AC_MSG_CHECKING(if interprocess lock affects threads) +if test "x$apr_process_lock_is_global" = "xyes"; then + proclockglobal="1" + AC_MSG_RESULT(yes) +else + proclockglobal="0" + AC_MSG_RESULT(no) +fi + +AC_SUBST(proclockglobal) + dnl #----------------------------- Checking for /dev/random AC_MSG_CHECKING(for /dev/random) diff --git a/hints.m4 b/hints.m4 index 3d0f52ded6e..3784422db93 100644 --- a/hints.m4 +++ b/hints.m4 @@ -348,6 +348,7 @@ dnl ;; ;; *-ibm-os390) APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE]) + APR_SETIFNULL(apr_process_lock_is_global, [yes]) APR_SETIFNULL(CC, [cc]) APR_ADDTO(CFLAGS, [-U_NO_PROTO]) APR_ADDTO(CFLAGS, [-DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR]) diff --git a/include/apr.h.in b/include/apr.h.in index 5dcf8076e28..0fcebb2a8c5 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -44,6 +44,8 @@ #define APR_USE_PROC_PTHREAD_SERIALIZE @procpthreadser@ #define APR_USE_PTHREAD_SERIALIZE @pthreadser@ +#define APR_PROCESS_LOCK_IS_GLOBAL @proclockglobal@ + #define APR_USES_ANONYMOUS_SHM @anonymous_shm@ #define APR_USES_FILEBASED_SHM @filebased_shm@ #define APR_USES_KEYBASED_SHM @keybased_shm@ diff --git a/include/apr.hw b/include/apr.hw index 785b007e6ba..975ae168f0e 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -139,6 +139,8 @@ #define APR_USE_PROC_PTHREAD_SERIALIZE 0 #define APR_USE_PTHREAD_SERIALIZE 0 +#define APR_PROCESS_LOCK_IS_GLOBAL 0 + #define NO_USE_SIGACTION #if APR_HAVE_SYS_TYPES_H diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 2580c77d002..518af1a312f 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -77,7 +77,11 @@ apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, } #endif +#if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */ + if (scope == APR_INTRAPROCESS) { +#else if (scope != APR_CROSS_PROCESS) { +#endif #if APR_HAS_THREADS if ((stat = apr_unix_create_intra_lock(new)) != APR_SUCCESS) { return stat; @@ -100,7 +104,11 @@ apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, apr_status_t apr_lock(apr_lock_t *lock) { apr_status_t stat; +#if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */ + if (lock->scope == APR_INTRAPROCESS) { +#else if (lock->scope != APR_CROSS_PROCESS) { +#endif #if APR_HAS_THREADS if ((stat = apr_unix_lock_intra(lock)) != APR_SUCCESS) { return stat; @@ -121,7 +129,11 @@ apr_status_t apr_unlock(apr_lock_t *lock) { apr_status_t stat; +#if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */ + if (lock->scope == APR_INTRAPROCESS) { +#else if (lock->scope != APR_CROSS_PROCESS) { +#endif #if APR_HAS_THREADS if ((stat = apr_unix_unlock_intra(lock)) != APR_SUCCESS) { return stat; @@ -141,7 +153,11 @@ apr_status_t apr_unlock(apr_lock_t *lock) apr_status_t apr_destroy_lock(apr_lock_t *lock) { apr_status_t stat; +#if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */ + if (lock->scope == APR_INTRAPROCESS) { +#else if (lock->scope != APR_CROSS_PROCESS) { +#endif #if APR_HAS_THREADS if ((stat = apr_unix_destroy_intra_lock(lock)) != APR_SUCCESS) { return stat; From 660caceef04ef5cc8939244bd08bac6ed5ac87a4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 1 Dec 2000 15:45:24 +0000 Subject: [PATCH 0854/7878] When running make_export.pl from the build scripts, invoke the perl interpreter explicitly so that the path coded in make_export.pl doesn't have to be correct. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60834 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- buildconf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index c9e436fd93e..20a0c5a086b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -101,7 +101,7 @@ subdirs_distclean: install: all exports: - ./helpers/make_export.pl -o ./apr.exports include/*.h + perl ./helpers/make_export.pl -o ./apr.exports include/*.h docs: ./helpers/scandoc -i./helpers/default.pl -p./docs/ ./include/*.h diff --git a/buildconf b/buildconf index 52eb6297051..ae721a55f1e 100755 --- a/buildconf +++ b/buildconf @@ -4,5 +4,5 @@ autoconf;autoheader (cd shmem/unix/mm && autoconf) -./helpers/make_export.pl -o ./apr.exports include/*.h +perl ./helpers/make_export.pl -o ./apr.exports include/*.h From ab3476bdfe7f794ad14c050334360055bc23e455 Mon Sep 17 00:00:00 2001 From: Greg Ames <gregames@apache.org> Date: Fri, 1 Dec 2000 16:12:20 +0000 Subject: [PATCH 0855/7878] Document a mystery git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60835 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index 421f58d73ea..c27257d1980 100644 --- a/configure.in +++ b/configure.in @@ -627,6 +627,7 @@ if test "$threads" = "1"; then AC_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h) fi +# The last AC_DECIDE to execute sets the default AC_BEGIN_DECISION([apr_lock implementation method]) AC_IFALLYES(func:semget func:semctl, AC_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) From ea08e9a8889032f479a6bd633cf30767dc6ecc34 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 1 Dec 2000 17:48:24 +0000 Subject: [PATCH 0856/7878] mention some mutex breakage which I don't expect to get to in the next several days (try http://www.wral-tv.com if you really want to know the weather in Raleigh) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60836 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 2d32c8f0a22..6e05ec9877b 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ Apache 2.0 STATUS: -Last modified at [$Date: 2000/11/30 23:41:03 $] +Last modified at [$Date: 2000/12/01 17:48:24 $] Release: @@ -19,6 +19,12 @@ RELEASE SHOWSTOPPERS: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * SysV semaphore support isn't usable by Apache when started as + root because we don't have a way to allow the semaphore to be + used by the configured User and Group. Current work-around: + change the initial permissions to 0666. Needed code: See + 1.3's http_main.c, SysV sem flavor of accept_mutex_init(). + * Build scripts do not recognise AIX 4.2.1 pthreads * Win32: Implement ap_shm_ functions From 96f31994ddea2ba5ce64c422eb95be146aaabf98 Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" <ake@apache.org> Date: Fri, 1 Dec 2000 18:30:20 +0000 Subject: [PATCH 0857/7878] apr_sendfile should include header bytes in total bytes sent git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60837 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 8677d653a1a..39746d9b797 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -293,8 +293,11 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, break; /* Assume the headers have been sent */ - ptfb->HeadLength = 0; - ptfb->Head = NULL; + if (ptfb != NULL) { + *len += ptfb->HeadLength; + ptfb->HeadLength = 0; + ptfb->Head = NULL; + } bytes_to_send -= nbytes; *len += nbytes; overlapped.Offset += nbytes; From 5b3460616934ddf0e98cde8e410500ad332809e5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 1 Dec 2000 18:47:32 +0000 Subject: [PATCH 0858/7878] Get rid of apr_get_socket_inaddr(), apr_get_remote_name(), and apr_get_local_name(). Use apr_get_sockaddr() instead. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60838 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 23 ----------------------- network_io/beos/sockaddr.c | 19 ------------------- network_io/unix/sa_common.c | 23 ----------------------- network_io/unix/sockaddr.c | 25 ------------------------- network_io/win32/sockaddr.c | 21 --------------------- 5 files changed, 111 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index f79b682a31d..b19549026a0 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -497,20 +497,6 @@ apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr); */ apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr); -/** - * Return the local socket name as a BSD style struct sockaddr_in. - * @param name The local name associated with the socket. - * @param sock The socket to use - */ -apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock); - -/** - * Return the remote socket name as a BSD style struct sockaddr_in. - * @param name The remote name associated with the socket. - * @param sock The socket to use - */ -apr_status_t apr_get_remote_name(struct sockaddr_in **name, apr_socket_t *sock); - /** * Setup the memory required for poll to operate properly> * @param new_poll The poll structure to be used. @@ -638,15 +624,6 @@ apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file); */ apr_status_t apr_get_inaddr(apr_in_addr_t *addr, char *hostname); -/** - * Given an apr_socket_t get the apr_in_addr_t for the requested interface - * @param addr The apr_in_addr_t structure to return - * @param which The interface to return for - * @param sock The apr_socket_t to use - */ -apr_status_t apr_get_socket_inaddr(apr_in_addr_t *addr, apr_interface_e which, - apr_socket_t *sock); - /** * Given an apr_sockaddr_t and a service name, set the port for the service * @param sockaddr The apr_sockaddr_t that will have it's port set diff --git a/network_io/beos/sockaddr.c b/network_io/beos/sockaddr.c index 8c3b67a60fa..bd61f574aa3 100644 --- a/network_io/beos/sockaddr.c +++ b/network_io/beos/sockaddr.c @@ -75,23 +75,4 @@ static apr_status_t get_local_addr(apr_socket_t *sock) /* Include this here so we already have get_local_addr... */ #include "../unix/sa_common.c" -apr_status_t get_local_name(struct sockaddr_in **name, apr_socket_t *sock) -{ - if (!sock) { - return APR_EBADF; - } - - *name = sock->local_addr; - return APR_SUCCESS; -} - -apr_status_t apr_get_remote_name(struct sockaddr_in **name, apr_socket_t *sock) -{ - if (!sock) { - return APR_EBADF; - } - - *name = sock->remote_addr; - return APR_SUCCESS; -} #endif diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index b3e738f1559..f282df03fbb 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -136,29 +136,6 @@ apr_status_t apr_get_inaddr(apr_in_addr_t *addr, char *hostname) return APR_SUCCESS; } -apr_status_t apr_get_socket_inaddr(apr_in_addr_t *addr, apr_interface_e which, - apr_socket_t *sock) -{ - if (which == APR_LOCAL){ - if (sock->local_interface_unknown) { - apr_status_t rv = get_local_addr(sock); - - if (rv != APR_SUCCESS){ - return rv; - } - } - - /* XXX IPv6 */ - *addr = *(apr_in_addr_t *)&sock->local_addr->sa.sin.sin_addr; - } else if (which == APR_REMOTE) { - /* XXX IPv6 */ - *addr = *(apr_in_addr_t *)&sock->remote_addr->sa.sin.sin_addr; - } else { - return APR_EINVAL; - } - return APR_SUCCESS; -} - static void set_sockaddr_vars(apr_sockaddr_t *addr, int family) { addr->sa.sin.sin_family = family; diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 4be3a73ae49..bebc07825eb 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -70,28 +70,3 @@ static apr_status_t get_local_addr(apr_socket_t *sock) /* included here to allow us to use local_addr */ #include "sa_common.c" - -#if APR_HAVE_NETINET_IN_H -/* XXX IPv6 */ -apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) -{ - if (sock->local_port_unknown || sock->local_interface_unknown) { - apr_status_t rv = get_local_addr(sock); - - if (rv != APR_SUCCESS) { - return rv; - } - } - - *name = &sock->local_addr->sa.sin; - return APR_SUCCESS; -} - - -/* XXX IPv6 */ -apr_status_t apr_get_remote_name(struct sockaddr_in **name, apr_socket_t *sock) -{ - *name = &sock->remote_addr->sa.sin; - return APR_SUCCESS; -} -#endif diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index 96d40c3482c..dfc8428bf73 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -74,24 +74,3 @@ static apr_status_t get_local_addr(apr_socket_t *sock) /* Include this here so we have get_local_addr defined... */ #include "../unix/sa_common.c" -apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) -{ - if (sock->local_port_unknown || sock->local_interface_unknown) { - apr_status_t rv = get_local_addr(sock); - - if (rv != APR_SUCCESS) { - return rv; - } - } - - *name = &sock->local_addr->sa.sin; - return APR_SUCCESS; -} - - - -apr_status_t apr_get_remote_name(struct sockaddr_in **name, apr_socket_t *sock) -{ - *name = &sock->remote_addr->sa.sin; - return APR_SUCCESS; -} From de6b42080d10a33b04f7a6bc9a0321a6ce6e9225 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 1 Dec 2000 18:48:45 +0000 Subject: [PATCH 0859/7878] Get rid of apr_get_socket_inaddr(), apr_get_remote_name(), and apr_get_local_name(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60839 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ aprlib.def | 3 --- libapr.def | 3 --- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 267f547d3c0..7f642058487 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ Changes with APR a9 + *) network API changes: get rid of apr_get_socket_inaddr(), + apr_get_remote_name(), and apr_get_local_name() [Jeff Trawick] + *) Add a step at configure time to create a file at the top-level, apr.exports, which lists every function exported by APR. The file is generated by a script in helpers, that reads each header diff --git a/aprlib.def b/aprlib.def index 039a064fe06..485597e3e02 100644 --- a/aprlib.def +++ b/aprlib.def @@ -85,7 +85,6 @@ EXPORTS apr_get_port apr_set_port apr_get_inaddr - apr_get_socket_inaddr ; ; @@ -217,8 +216,6 @@ EXPORTS apr_tokenize_to_argv apr_filename_of_pathname - apr_get_remote_name - apr_get_local_name apr_open_stderr apr_get_pipe_timeout diff --git a/libapr.def b/libapr.def index 039a064fe06..485597e3e02 100644 --- a/libapr.def +++ b/libapr.def @@ -85,7 +85,6 @@ EXPORTS apr_get_port apr_set_port apr_get_inaddr - apr_get_socket_inaddr ; ; @@ -217,8 +216,6 @@ EXPORTS apr_tokenize_to_argv apr_filename_of_pathname - apr_get_remote_name - apr_get_local_name apr_open_stderr apr_get_pipe_timeout From 8beec5b2a279056e24a45a57acd1de22ab39d09f Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 1 Dec 2000 21:33:58 +0000 Subject: [PATCH 0860/7878] Add APR_SIZE_T_FMT to help work around the fact that apr_size_t/ apr_ssize_t is long on AIX. Get the other APR_xx_T_FMT variables defined properly on AIX. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60840 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ acconfig.h | 1 + configure.in | 25 +++++++++++++++++++++---- include/apr.h.in | 3 +++ 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 7f642058487..8c5aa47fd20 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ Changes with APR a9 + *) Add APR_SIZE_T_FMT. Get the other APR_xx_T_FMT variables + defined properly on AIX. [Jeff Trawick] + *) network API changes: get rid of apr_get_socket_inaddr(), apr_get_remote_name(), and apr_get_local_name() [Jeff Trawick] diff --git a/acconfig.h b/acconfig.h index e0d77f038c5..f3adb415773 100644 --- a/acconfig.h +++ b/acconfig.h @@ -29,6 +29,7 @@ #undef USE_THREADS #undef SIZEOF_SSIZE_T +#undef SIZEOF_SIZE_T #undef SIZEOF_OFF_T #undef HAVE_MM_SHMT_MMFILE diff --git a/configure.in b/configure.in index c27257d1980..bc77123bd85 100644 --- a/configure.in +++ b/configure.in @@ -409,6 +409,16 @@ else ssize_t_fmt='#error Can not determine the proper size for ssize_t' fi +AC_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8) + +if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then + size_t_fmt='#define APR_SIZE_T_FMT "d"' +elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then + size_t_fmt='#define APR_SIZE_T_FMT "ld"' +else + size_t_fmt='#error Can not determine the proper size for size_t' +fi + AC_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8) if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then @@ -421,13 +431,19 @@ else off_t_fmt='#error Can not determine the proper size for off_t' fi -# basically, we have tried to figure out the sizes of apr_ssize_t and -# apr_off_t, but we don't always get it right. If you find that we -# don't get it right for your platform, you can override our decision -# below. +# Basically, we have tried to figure out the correct format strings +# for APR types which vary between platforms, but we don't always get +# it right. If you find that we don't get it right for your platform, +# you can override our decision below. case "$OS" in *linux* | *os2_emx | *-solaris*) off_t_fmt='#define APR_OFF_T_FMT "ld"' + ;; + *aix4*) + ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' + size_t_fmt='#define APR_SIZE_T_FMT "ld"' + off_t_fmt='#define APR_OFF_T_FMT "ld"' + ;; esac AC_SUBST(short_value) @@ -438,6 +454,7 @@ AC_SUBST(size_t_value) AC_SUBST(ssize_t_value) AC_SUBST(socklen_t_value) AC_SUBST(ssize_t_fmt) +AC_SUBST(size_t_fmt) AC_SUBST(off_t_fmt) dnl #----------------------------- Checking for string functions diff --git a/include/apr.h.in b/include/apr.h.in index 0fcebb2a8c5..1106dbdc713 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -183,6 +183,9 @@ typedef @socklen_t_value@ apr_socklen_t; */ @ssize_t_fmt@ +/* And APR_SIZE_T_FMT */ +@size_t_fmt@ + /* And APR_OFF_T_FMT */ @off_t_fmt@ From e38ad38771ba34eb826537ad497100a59e9d59f8 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Sat, 2 Dec 2000 03:24:24 +0000 Subject: [PATCH 0861/7878] Some platforms need sys/types.h before netdb.h, make it so in the test for h_errno added recently. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60841 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aclocal.m4 b/aclocal.m4 index 0505fe68349..9c0951d2490 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -441,6 +441,9 @@ AC_DEFUN(APR_H_ERRNO_COMPILE_CHECK,[ CFLAGS="-D$1 $CFLAGS" fi AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif #ifdef HAVE_NETDB_H #include <netdb.h> #endif From 550060c29ec77f8219d00e20e9bdb5196e651689 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 2 Dec 2000 07:08:07 +0000 Subject: [PATCH 0862/7878] MPMs that require multiple segments of shared memory now just use two shared memory blocks to ensure that all of the memory is available. This removes the hack that added 80 bytes to each shared memory block. We end up needing two apr_shmem_t variables, because it is difficult to determine exactly how much memory will be needed. MM automatically tries to align the shared memory allocations, so we either need to pad the shared memory segments, or just use two different segments. This also changes APR and MM to take into account whatever memory those packages need to allocate when creating a shared memory segment. Any memory that APR and MM need is automatically added to the size requested by the program. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60842 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ shmem/unix/mm/mm.h | 5 ++++- shmem/unix/mm/mm_alloc.c | 6 +++++- shmem/unix/mm/mm_global.c | 2 +- shmem/unix/mm/mm_test.c | 2 +- shmem/unix/shmem.c | 2 +- 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 8c5aa47fd20..74121bd2425 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ Changes with APR a9 + *) Make APR's shared memory routines always allocate enough memory + for the requested segment, the MM internal types, and the APR + internal types. + [Ryan Bloom] + *) Add APR_SIZE_T_FMT. Get the other APR_xx_T_FMT variables defined properly on AIX. [Jeff Trawick] diff --git a/shmem/unix/mm/mm.h b/shmem/unix/mm/mm.h index bc14b1ac8b3..9d2542591f2 100644 --- a/shmem/unix/mm/mm.h +++ b/shmem/unix/mm/mm.h @@ -66,6 +66,9 @@ typedef enum { MM_LOCK_RD, MM_LOCK_RW } mm_lock_mode; +#define MM_ALLOCATE_ENOUGH 1 +#define MM_ALLOCATE_EXACT 2 + /* ** ____ Private Part of the API ___________________________ */ @@ -339,7 +342,7 @@ size_t MM_available(void); char *MM_error(void); /* Standard Malloc-Style API */ -MM *mm_create(size_t size, const char *file); +MM *mm_create(size_t size, const char *file, int flag); int mm_permission(MM *mm, mode_t mode, uid_t owner, gid_t group); void mm_destroy(MM *mm); int mm_lock(MM *mm, mm_lock_mode mode); diff --git a/shmem/unix/mm/mm_alloc.c b/shmem/unix/mm/mm_alloc.c index 00d59d295a9..6efcbfc21fe 100644 --- a/shmem/unix/mm/mm_alloc.c +++ b/shmem/unix/mm/mm_alloc.c @@ -50,7 +50,7 @@ /* * Create a memory pool */ -MM *mm_create(size_t usize, const char *file) +MM *mm_create(size_t usize, const char *file, int flag) { MM *mm = NULL; void *core; @@ -66,6 +66,10 @@ MM *mm_create(size_t usize, const char *file) if (usize < MM_ALLOC_MINSIZE) usize = MM_ALLOC_MINSIZE; + if (flag & MM_ALLOCATE_ENOUGH) { + usize += sizeof(*mm); + } + /* determine size */ size = usize+SIZEOF_mem_pool; diff --git a/shmem/unix/mm/mm_global.c b/shmem/unix/mm/mm_global.c index 33b04646370..6f9967fea10 100644 --- a/shmem/unix/mm/mm_global.c +++ b/shmem/unix/mm/mm_global.c @@ -53,7 +53,7 @@ int MM_create(size_t size, const char *file) { if (mm_global != NULL) return FALSE; - if ((mm_global = mm_create(size, file)) == NULL) + if ((mm_global = mm_create(size, file, MM_ALLOCATE_EXACT)) == NULL) return FALSE; return TRUE; } diff --git a/shmem/unix/mm/mm_test.c b/shmem/unix/mm/mm_test.c index 5c344d49a4e..922529bf0b6 100644 --- a/shmem/unix/mm/mm_test.c +++ b/shmem/unix/mm/mm_test.c @@ -197,7 +197,7 @@ int main(int argc, char *argv[]) size = mm_maxsize(); if (size > 1024*1024*1) size = 1024*1024*1; - mm = mm_create(size, NULL); + mm = mm_create(size, NULL, MM_ALLOCATE_EXACT); FAILED_IF(mm == NULL) mm_display_info(mm); s = mm_available(mm); diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 34bb94ff612..4970b19d8c2 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -63,7 +63,7 @@ struct shmem_t { apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) { - MM *newmm = mm_create(reqsize, file); + MM *newmm = mm_create(reqsize + sizeof(*newmm), file, MM_ALLOCATE_ENOUGH); if (newmm == NULL) { return errno; } From b09a3dae7a88d6159f4a86377a3dd5866ea8fb33 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 2 Dec 2000 12:06:03 +0000 Subject: [PATCH 0863/7878] If we're using the BeOS implementation of getpass we need stdio.h... This should get this part building on BeOS again. Submitted by: Sam TH <sam@uchicago.edu> Reviewed by: David Reid <dreid@apache.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60843 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_getpass.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 9231cca94a2..6019c771618 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -115,6 +115,8 @@ static char *getpass(const char *prompt) } #elif defined (HAVE_TERMIOS_H) +#include <stdio.h> + static char *getpass(const char *prompt) { struct termios attr; From cf8eea4f2dddf6bcd4c5dc2bac2101c8f18f9288 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 2 Dec 2000 12:07:44 +0000 Subject: [PATCH 0864/7878] A couple of header files that are needed by BeOS to build. Submitted by: Sam TH <sam@uchicago.edu> Reviewed by: David Reid <dreid@apache.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60844 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 4 ++++ include/apr_mmap.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index b38c50393b3..2f9e28fdcc1 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -64,6 +64,10 @@ #include <stdio.h> /* for SEEK_* */ #endif +#if APR_HAVE_SYS_UIO_H +#include <sys/uio.h> +#endif + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 194ba780043..dd884f43d0c 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -60,6 +60,10 @@ #include "apr_errno.h" #include "apr_file_io.h" /* for apr_file_t */ +#ifdef BEOS +#include <kernel/OS.h> +#endif + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ From cd2ce9a81a6bad9a6efc9340e2dcfdac0809d560 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 2 Dec 2000 12:10:55 +0000 Subject: [PATCH 0865/7878] BeOS should now be using the unix networkio.h, so the existance of this was causing build problems. Time to go bye bye... Submitted by: Sam TH <sam@uchicago.edu> Reviewed by: David Reid <dreid@apache.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60845 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/networkio.h | 119 ---------------------------------- 1 file changed, 119 deletions(-) delete mode 100644 include/arch/beos/networkio.h diff --git a/include/arch/beos/networkio.h b/include/arch/beos/networkio.h deleted file mode 100644 index 4a9ef6c14eb..00000000000 --- a/include/arch/beos/networkio.h +++ /dev/null @@ -1,119 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "apr_private.h" -#if BEOS_BONE /* woohoo - we can use the Unix code! */ -#include "../unix/networkio.h" -#else - -#ifndef NETWORK_IO_H -#define NETWORK_IO_H - - -#include <socket.h> -#include <netdb.h> -#include <errno.h> -#include <string.h> -#include <stdlib.h> -#include <sys/time.h> -#include "apr_network_io.h" -#include "apr_general.h" -#include "apr_portable.h" -#include "apr_lib.h" -#include "fileio.h" -#include "apr_errno.h" - -/* The definition of isascii was missed from the PowerPC ctype.h - * - * It will be included in the next release, but until then... - */ -#if !HAVE_isascii -#define isascii(c) (((c) & ~0x7f)==0) -#endif - -#include "apr_general.h" - -#define POLLIN 1 -#define POLLPRI 2 -#define POLLOUT 4 -#define POLLERR 8 -#define POLLHUP 16 -#define POLLNVAL 32 - -struct apr_socket_t { - apr_pool_t *cntxt; - int socketdes; - struct sockaddr_in *local_addr; - struct sockaddr_in *remote_addr; - int addr_len; - apr_interval_time_t timeout; - int connected; -}; - -struct apr_pollfd_t { - apr_pool_t *cntxt; - struct apr_socket_t *sock; - fd_set *read; - fd_set *write; - fd_set *except; - int highsock; -}; - -apr_int16_t get_event(apr_int16_t); - -int inet_aton(const char *cp, struct in_addr *addr); -#include <ByteOrder.h> /* for the ntohs definition */ - -#endif /* ! NETWORK_IO_H */ -#endif From d0679176069af863b799410c5e4f5336afb2a174 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 2 Dec 2000 13:01:40 +0000 Subject: [PATCH 0866/7878] Argh - correct my eariler attempt to get this building. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60846 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/beos/Makefile.in b/threadproc/beos/Makefile.in index 7f3e4153af8..0d63b77948d 100644 --- a/threadproc/beos/Makefile.in +++ b/threadproc/beos/Makefile.in @@ -6,7 +6,7 @@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch $(OSDIR) $(DEFOSDIR) +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch -I$(OSDIR) -I$(DEFOSDIR) MKDEP=../../helpers/mkdep.sh LIB=libthreadproc.a From c6a3814d040b90f84f3e8b2d32eb3e4b5a729ce8 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sat, 2 Dec 2000 14:45:28 +0000 Subject: [PATCH 0867/7878] quick readme for developers Submitted by: Sam TH <sam@uchicago.edu> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60847 13f79535-47bb-0310-9956-ffa450edef68 --- README.dev | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 README.dev diff --git a/README.dev b/README.dev new file mode 100644 index 00000000000..ba23429a486 --- /dev/null +++ b/README.dev @@ -0,0 +1,13 @@ +Apache Portable Runtime +======================= + +Right now, if you are building APR, it means that you are probably a +developer. If you are building it as a standalone package, however, +this means using a slightly non-standard build process. + +1) ./buildconf +2) ./configure +3) make + +Currently, there is no make install step, as APR is not yet +installable. \ No newline at end of file From ba1ce0e76a82cdcf746febe2557b8c1c41ff3b4e Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 2 Dec 2000 19:00:07 +0000 Subject: [PATCH 0868/7878] Get make_exports.pl to recognize functions that return a const value git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60848 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/make_export.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/make_export.pl b/helpers/make_export.pl index 8541bca2da3..461fab93e05 100755 --- a/helpers/make_export.pl +++ b/helpers/make_export.pl @@ -38,7 +38,7 @@ $line .= "$macro\n"; next; } - elsif (/^(APR_DECLARE[^\(]*\()?[a-z_]+\)?\s+([A-Za-z0-9_]+)\(/) { + elsif (/^(APR_DECLARE[^\(]*\()?(const\s)?[a-z_]+\)?\s+\*?([A-Za-z0-9_]+)\(/) { # We only want to increase this if we are in the middle of a # #if ... #endif block. if ($found) { @@ -47,7 +47,7 @@ for (my $i=0; $i < $count; $i++) { $line .= "\t"; } - $line .= "$2\n"; + $line .= "$3\n"; next; } elsif (/\#endif/) { From bece57431ac1aa118fafddf4f37b9237f63331e0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 2 Dec 2000 19:02:27 +0000 Subject: [PATCH 0869/7878] Protect a couple of functions with the appropriate #if's. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60849 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_dso.h | 4 ++++ include/apr_mmap.h | 4 ++++ include/apr_network_io.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/include/apr_dso.h b/include/apr_dso.h index b277ce40da8..f60591fb588 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -67,6 +67,8 @@ extern "C" { #endif +#if APR_HAS_DSO + typedef struct apr_dso_handle_t apr_dso_handle_t; typedef void * apr_dso_handle_sym_t; @@ -102,6 +104,8 @@ apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, */ const char *apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize); +#endif /* APR_HAS_DSO */ + #ifdef __cplusplus } #endif diff --git a/include/apr_mmap.h b/include/apr_mmap.h index dd884f43d0c..f3453185e20 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -93,6 +93,8 @@ struct apr_mmap_t { size_t size; }; +#if APR_HAS_MMAP + /* Function definitions */ /** @@ -120,6 +122,8 @@ apr_status_t apr_mmap_delete(apr_mmap_t *mmap); */ apr_status_t apr_mmap_offset(void **addr, apr_mmap_t *mmap, apr_off_t offset); +#endif /* APR_HAS_MMAP */ + #ifdef __cplusplus } #endif diff --git a/include/apr_network_io.h b/include/apr_network_io.h index b19549026a0..dd6df2e5945 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -607,6 +607,7 @@ apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup) (void *)); +#if APR_FILES_AS_SOCKETS /** * Convert a File type to a socket so that it can be used in a poll operation. * @param newsock the newly created socket which represents a file. @@ -616,6 +617,7 @@ apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, * have the APR_FILES_AS_SOCKETS macro defined as true. */ apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file); +#endif /** * Given a hostname and a port, create an apr_in_addr for it... From fc0c988ad3da59789b783960c6527f3bd1df6bad Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 2 Dec 2000 23:45:37 +0000 Subject: [PATCH 0870/7878] Fix a compile break on BeOS and FreeBSD. We don't want to add the size of the void *, we want to add the size of the apr_shmem_t * variable. Submitted by: Jeff Trawick and Sam TH <sam@uchicago.edu> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60850 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 4970b19d8c2..9e901bf677f 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -63,7 +63,7 @@ struct shmem_t { apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) { - MM *newmm = mm_create(reqsize + sizeof(*newmm), file, MM_ALLOCATE_ENOUGH); + MM *newmm = mm_create(reqsize + sizeof(**m), file, MM_ALLOCATE_ENOUGH); if (newmm == NULL) { return errno; } From 25b6fd974fc7f96a6d5b117fddc12513dcfcad56 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 3 Dec 2000 00:06:48 +0000 Subject: [PATCH 0871/7878] When creating a sub-pool, we should inherit the parent pool's apr_abort function git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60851 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/misc/unix/start.c b/misc/unix/start.c index 62db9a2bafd..e9eedb3d819 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -75,8 +75,12 @@ apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) } newpool->prog_data = NULL; - newpool->apr_abort = NULL; - + if (cont) { + newpool->apr_abort = cont->apr_abort; + } + else { + newpool->apr_abort = NULL; + } *newcont = newpool; return APR_SUCCESS; } From 5cce0e2fec35b8c21efb9cfac1dfb1d80586e3da Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 3 Dec 2000 01:52:34 +0000 Subject: [PATCH 0872/7878] Ensure that the server process has started before we try to run the client. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60852 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/testsock.c b/test/testsock.c index 34c06df9d2d..d0d62dd6dac 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -108,6 +108,8 @@ int main(int argc, char *argv[]) args[1] = NULL; s1 = apr_create_process(&proc1, "./server", args, NULL, attr1, context); + /* Sleep for 30 seconds to ensure the server is setup before we begin */ + apr_sleep(10000000); args[0] = apr_pstrdup(context, "client"); s2 = apr_create_process(&proc2, "./client", args, NULL, attr2, context); From 65b3406e9d8f213b87c04f44b0678d66b7122f3b Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 3 Dec 2000 03:31:11 +0000 Subject: [PATCH 0873/7878] This STATUS item doesn't belong in APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60853 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 6e05ec9877b..32d71ee7a63 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ Apache 2.0 STATUS: -Last modified at [$Date: 2000/12/01 17:48:24 $] +Last modified at [$Date: 2000/12/03 03:31:11 $] Release: @@ -50,5 +50,3 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Documentation that needs writing: * API documentation - Status: Ben Laurie has written some hooks documentation - (apache-2.0/htdocs/hooks.html) From cdbd7160a4f9b961cfefc9c0dbba131e45ea0f36 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 3 Dec 2000 03:54:01 +0000 Subject: [PATCH 0874/7878] Add a make target for test. This enters the test directory, does a make clean, and a make. Then it tries to run each test program. This doesn't work yet, because some of the test programs require user input. I will be working on this problem so that 'make test' can correctly tell somebody if APR is working properly on their platform. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60854 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Makefile.in b/Makefile.in index 20a0c5a086b..94f968a1fac 100644 --- a/Makefile.in +++ b/Makefile.in @@ -105,6 +105,17 @@ exports: docs: ./helpers/scandoc -i./helpers/default.pl -p./docs/ ./include/*.h + +test: $(LIBAPR) + (cd test; make clean; make; \ + cd test; \ + for prog in `find . -type f -perm +u+x -name "test*" -print`; do \ + ./$$prog; \ + if [ $$? -eq 255 ]; then \ + echo "$$prog failed"; \ + break; \ + fi \ + done ) # DO NOT REMOVE docs: $(INCDIR)/*.h From 4f80d89b546eb4d398d311e68c363c5327cb9597 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 3 Dec 2000 04:58:11 +0000 Subject: [PATCH 0875/7878] The test programs themselves should always be built with debug mode on. This way if a test fails, we can debug the test program, even if we can't dig into the actual APR code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60855 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index e46ca9853df..f614489ece7 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,7 +1,7 @@ RM=@RM@ CC=@CC@ RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ +CFLAGS=-g @CFLAGS@ @OPTIM@ LIBS=../libapr.a @LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include From 0dd675bf534a58767d3c77696678e56388c897d7 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 3 Dec 2000 05:07:57 +0000 Subject: [PATCH 0876/7878] Add a header to remove a warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60856 13f79535-47bb-0310-9956-ffa450edef68 --- test/testshmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testshmem.c b/test/testshmem.c index 7ba4eacca54..a936b5074b6 100644 --- a/test/testshmem.c +++ b/test/testshmem.c @@ -58,6 +58,7 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" +#include "apr_time.h" #include <errno.h> #include <stdio.h> #include <stdlib.h> From dd2b8d983c03067e53f9900de65516cd849d88ec Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 3 Dec 2000 05:29:50 +0000 Subject: [PATCH 0877/7878] Get apr_dso_error working properly on Unix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60857 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index d9c3f6295b6..14572dbfd25 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -53,6 +53,7 @@ */ #include "unix/dso.h" +#include "apr_strings.h" #if APR_HAS_DSO @@ -147,8 +148,10 @@ apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, const char *apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) { - if (dso->errormsg) + if (dso->errormsg) { + apr_cpystrn(buffer, dso->errormsg, buflen); return dso->errormsg; + } return "No Error"; } From ac4a7ef5a9f3785aa326b73a64a5707df09cb318 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 3 Dec 2000 06:42:04 +0000 Subject: [PATCH 0878/7878] Make occhild a bit cleaner. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60858 13f79535-47bb-0310-9956-ffa450edef68 --- test/occhild.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/occhild.c b/test/occhild.c index 3807b537a0d..fec8c49caaa 100644 --- a/test/occhild.c +++ b/test/occhild.c @@ -4,10 +4,9 @@ int main(void) { - int rc=1; char buf[256]; - while (rc == 1) { + while (1) { read(STDERR_FILENO, buf, 256); } return 0; /* just to keep the compiler happy */ From 6a3242e9f4bea382957cd971b89ac794b28977bd Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 3 Dec 2000 06:47:28 +0000 Subject: [PATCH 0879/7878] Get testdso working on Linux again. This should work on all platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60859 13f79535-47bb-0310-9956-ffa450edef68 --- test/mod_test.c | 7 +++++-- test/testdso.c | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/test/mod_test.c b/test/mod_test.c index 20f6e71d7e9..fe6974b11a9 100644 --- a/test/mod_test.c +++ b/test/mod_test.c @@ -2,12 +2,15 @@ int goodbyes = 0; -static void print_hello(void) +void print_hello(void); +int print_goodbye(int reps); + +void print_hello(void) { fprintf(stdout,"Hello - I'm a DSO!\n"); } -static int print_goodbye(int reps) +int print_goodbye(int reps) { int i = 0; for (i = 0;i < reps; i++) { diff --git a/test/testdso.c b/test/testdso.c index 2ac0f002dd6..d0e3b814c5f 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -45,8 +45,10 @@ int main (int argc, char ** argv) fprintf(stdout,"Trying to get the DSO's attention.........."); fflush(stdout); - if (apr_dso_sym(&func1, h, "print_hello") != APR_SUCCESS) { - fprintf(stderr, "Failed!\n"); + if ((status = apr_dso_sym(&func1, h, "print_hello")) != APR_SUCCESS) { + char my_error[256]; + apr_dso_error(h, my_error, sizeof(my_error)); + fprintf(stderr, "%s\n", my_error); exit (-1); } fprintf(stdout,"OK\n"); From d2caf42a93ffdc88e7d993d09ff6e1c043a02f56 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 3 Dec 2000 06:49:09 +0000 Subject: [PATCH 0880/7878] Update the .cvsignore file git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60860 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/.cvsignore b/test/.cvsignore index 38a4f479ca9..5a01aee06a2 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -24,3 +24,5 @@ testsuite testsuite.opt testsuite.ncb testflock.tmp +testfile.tmp +testflock From 7d089c4578c74b2037c9303441c81a16f087be84 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 3 Dec 2000 06:50:31 +0000 Subject: [PATCH 0881/7878] Remove a warning from server.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60861 13f79535-47bb-0310-9956-ffa450edef68 --- test/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/server.c b/test/server.c index e8adef8deba..58b496c3ceb 100644 --- a/test/server.c +++ b/test/server.c @@ -60,7 +60,7 @@ #define STRLEN 15 -int main(int argc, char * const argv[]) +int main(int argc, const char * const argv[]) { apr_pool_t *context; apr_socket_t *sock; From 91c4bb6c9a9fc3301cd2e41f80c7491ba47ce3c0 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sun, 3 Dec 2000 10:11:43 +0000 Subject: [PATCH 0882/7878] isascii() is not available on PowerPC versions of BeOS. Supply a definition. Submitted by: Sam TH <sam@uchicago.edu> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60862 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/apr_lib.h b/include/apr_lib.h index f28f79a884a..bdc3b5291e0 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -122,6 +122,10 @@ APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname); #define apr_tolower(c) (tolower(((unsigned char)(c)))) #define apr_toupper(c) (toupper(((unsigned char)(c)))) +#if BEOS && __POWER_PC__ +#define isascii(c) (((c) & ~0x7f)==0) +#endif + /* * Small utility macros to make things easier to read. Not usually a * goal, to be sure.. From aa764fbd7190303f13cedf42b8a87e0787e3ea3f Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sun, 3 Dec 2000 11:05:45 +0000 Subject: [PATCH 0883/7878] Fix how sa_common.c gets included. Leave a note explaining the magic. Submitted by: Sam TH <sam@uchicago.edu> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60863 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index bebc07825eb..e9713266170 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -68,5 +68,12 @@ static apr_status_t get_local_addr(apr_socket_t *sock) } } -/* included here to allow us to use local_addr */ -#include "sa_common.c" +/* included here to allow us to use get_local_addr(). + + NOTE: this file (sockaddr.c) can be included from other directories. If + we left the following include as just "sa_common.c", then it would be + relative to the directory where sockaddr.c was included (wrong!). To + fix that problem, this include specifically refers to the unix directory + to include sa_common.c + */ +#include "../unix/sa_common.c" From d37f57a4135050583e1d17530f0f3750c5b4134c Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sun, 3 Dec 2000 13:54:06 +0000 Subject: [PATCH 0884/7878] This file is no longer needed. I thought I'd already removed this but obviously I hadn't :( Submitted by: Sam TH <sam@uchicago.edu> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60864 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/networkio.h | 119 ------------------------------------ 1 file changed, 119 deletions(-) delete mode 100644 network_io/beos/networkio.h diff --git a/network_io/beos/networkio.h b/network_io/beos/networkio.h deleted file mode 100644 index 4a9ef6c14eb..00000000000 --- a/network_io/beos/networkio.h +++ /dev/null @@ -1,119 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "apr_private.h" -#if BEOS_BONE /* woohoo - we can use the Unix code! */ -#include "../unix/networkio.h" -#else - -#ifndef NETWORK_IO_H -#define NETWORK_IO_H - - -#include <socket.h> -#include <netdb.h> -#include <errno.h> -#include <string.h> -#include <stdlib.h> -#include <sys/time.h> -#include "apr_network_io.h" -#include "apr_general.h" -#include "apr_portable.h" -#include "apr_lib.h" -#include "fileio.h" -#include "apr_errno.h" - -/* The definition of isascii was missed from the PowerPC ctype.h - * - * It will be included in the next release, but until then... - */ -#if !HAVE_isascii -#define isascii(c) (((c) & ~0x7f)==0) -#endif - -#include "apr_general.h" - -#define POLLIN 1 -#define POLLPRI 2 -#define POLLOUT 4 -#define POLLERR 8 -#define POLLHUP 16 -#define POLLNVAL 32 - -struct apr_socket_t { - apr_pool_t *cntxt; - int socketdes; - struct sockaddr_in *local_addr; - struct sockaddr_in *remote_addr; - int addr_len; - apr_interval_time_t timeout; - int connected; -}; - -struct apr_pollfd_t { - apr_pool_t *cntxt; - struct apr_socket_t *sock; - fd_set *read; - fd_set *write; - fd_set *except; - int highsock; -}; - -apr_int16_t get_event(apr_int16_t); - -int inet_aton(const char *cp, struct in_addr *addr); -#include <ByteOrder.h> /* for the ntohs definition */ - -#endif /* ! NETWORK_IO_H */ -#endif From 1e06a4fb05c16ba116d810af86e4c42b1f81384a Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sun, 3 Dec 2000 15:48:41 +0000 Subject: [PATCH 0885/7878] Try to deal with isascii in a better manner. As we include ctype.h if it's available we can just check if it's been defined and so dispense with the check in configure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60865 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- include/apr_lib.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index bc77123bd85..c5905a42c1c 100644 --- a/configure.in +++ b/configure.in @@ -635,7 +635,7 @@ dnl Checks for libraries. AC_CHECK_DEFINE(LOCK_EX, sys/file.h) AC_CHECK_DEFINE(F_SETLK, fcntl.h) AC_CHECK_DEFINE(CODESET, langinfo.h) -AC_CHECK_DEFINE(isascii, ctype.h) + # We are assuming that if the platform doesn't have POLLIN, it doesn't have # any POLL definitions. AC_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h) diff --git a/include/apr_lib.h b/include/apr_lib.h index bdc3b5291e0..90b684d061d 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -113,7 +113,11 @@ APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname); #define apr_isdigit(c) (isdigit(((unsigned char)(c)))) #define apr_isgraph(c) (isgraph(((unsigned char)(c)))) #define apr_islower(c) (islower(((unsigned char)(c)))) +#ifdef isascii #define apr_isascii(c) (isascii(((unsigned char)(c)))) +#else +#define apr_isascii(c) (((c) & ~0x7f)==0) +#endif #define apr_isprint(c) (isprint(((unsigned char)(c)))) #define apr_ispunct(c) (ispunct(((unsigned char)(c)))) #define apr_isspace(c) (isspace(((unsigned char)(c)))) @@ -122,10 +126,6 @@ APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname); #define apr_tolower(c) (tolower(((unsigned char)(c)))) #define apr_toupper(c) (toupper(((unsigned char)(c)))) -#if BEOS && __POWER_PC__ -#define isascii(c) (((c) & ~0x7f)==0) -#endif - /* * Small utility macros to make things easier to read. Not usually a * goal, to be sure.. From 754c204ba58deb60fd883db3e5a84106da9f206e Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sun, 3 Dec 2000 17:42:03 +0000 Subject: [PATCH 0886/7878] fix a bad comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60866 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testsock.c b/test/testsock.c index d0d62dd6dac..8be62c52e9d 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) args[1] = NULL; s1 = apr_create_process(&proc1, "./server", args, NULL, attr1, context); - /* Sleep for 30 seconds to ensure the server is setup before we begin */ + /* Sleep for 10 seconds to ensure the server is setup before we begin */ apr_sleep(10000000); args[0] = apr_pstrdup(context, "client"); s2 = apr_create_process(&proc2, "./client", args, NULL, attr2, context); From 6280fd64fe489a590b7f568f66db3a177f0acb83 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 3 Dec 2000 17:47:40 +0000 Subject: [PATCH 0887/7878] Fix a bunch of type mis-matches in the test code. Submitted by: Sam TH <sam@uchicago.edu> Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60867 13f79535-47bb-0310-9956-ffa450edef68 --- test/client.c | 2 +- test/server.c | 2 +- test/testfile.c | 22 +++++++++++----------- test/testpipe.c | 2 +- test/testproc.c | 2 +- test/testsf.c | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/test/client.c b/test/client.c index 1d52f2548e9..c6bb336c946 100644 --- a/test/client.c +++ b/test/client.c @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) { apr_pool_t *context; apr_socket_t *sock; - apr_ssize_t length; + apr_size_t length; apr_status_t stat; char datasend[STRLEN] = "Send data test"; char datarecv[STRLEN]; diff --git a/test/server.c b/test/server.c index 58b496c3ceb..e16822d5237 100644 --- a/test/server.c +++ b/test/server.c @@ -65,7 +65,7 @@ int main(int argc, const char * const argv[]) apr_pool_t *context; apr_socket_t *sock; apr_socket_t *sock2; - apr_ssize_t length; + apr_size_t length; apr_int32_t rv; apr_pollfd_t *sdset; char datasend[STRLEN]; diff --git a/test/testfile.c b/test/testfile.c index 3504718a5f6..bf4331e805c 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -77,7 +77,7 @@ int main(void) apr_pollfd_t *sdset = NULL; apr_status_t status = 0; apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; - apr_ssize_t nbytes = 0; + apr_size_t nbytes = 0; apr_int32_t rv; apr_off_t zer = 0; char *buf; @@ -126,12 +126,12 @@ int main(void) fprintf(stdout, "\tWriting to file......."); - nbytes = (apr_ssize_t)strlen("this is a test"); + nbytes = strlen("this is a test"); if (apr_write(thefile, "this is a test", &nbytes) != APR_SUCCESS) { perror("something's wrong"); exit(-1); } - if (nbytes != (apr_ssize_t)strlen("this is a test")) { + if (nbytes != strlen("this is a test")) { fprintf(stderr, "didn't write properly.\n"); exit(-1); } @@ -175,13 +175,13 @@ int main(void) fprintf(stdout, "\tReading from the file......."); - nbytes = (apr_ssize_t)strlen("this is a test"); + nbytes = strlen("this is a test"); buf = (char *)apr_palloc(context, nbytes + 1); if (apr_read(thefile, buf, &nbytes) != APR_SUCCESS) { perror("something's wrong"); exit(-1); } - if (nbytes != (apr_ssize_t)strlen("this is a test")) { + if (nbytes != strlen("this is a test")) { fprintf(stderr, "didn't read properly.\n"); exit(-1); } @@ -277,7 +277,7 @@ int testdirs(apr_pool_t *context) { apr_dir_t *temp; apr_file_t *file = NULL; - apr_ssize_t bytes; + apr_size_t bytes; apr_filetype_e type; char *fname; @@ -346,7 +346,7 @@ int testdirs(apr_pool_t *context) fprintf(stdout, "\t\tFile size......."); apr_dir_entry_size(&bytes, temp); - if (bytes != (apr_ssize_t)strlen("Another test!!!")) { + if (bytes != strlen("Another test!!!")) { fprintf(stderr, "Got wrong file size %d\n", bytes); return -1; } @@ -394,7 +394,7 @@ static void create_testread(apr_pool_t *p, const char *fname) apr_file_t *f = NULL; apr_status_t rv; char buf[TESTREAD_BLKSIZE]; - apr_ssize_t nbytes; + apr_size_t nbytes; /* Create a test file with known content. */ @@ -423,7 +423,7 @@ static char read_one(apr_file_t *f, int expected) char bytes[3]; apr_status_t rv; static int counter = 0; - apr_ssize_t nbytes; + apr_size_t nbytes; counter += 1; @@ -448,7 +448,7 @@ static void test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_f { apr_file_t *f = NULL; apr_status_t rv; - apr_ssize_t nbytes; + apr_size_t nbytes; char buf[1024]; int i; @@ -533,7 +533,7 @@ static void test_bigread(apr_pool_t *p, const char *fname, apr_int32_t extra_fla apr_file_t *f = NULL; apr_status_t rv; char buf[APR_BUFFERSIZE * 2]; - apr_ssize_t nbytes; + apr_size_t nbytes; /* Create a test file with known content. */ diff --git a/test/testpipe.c b/test/testpipe.c index 4f1bdb1490b..a06dc1547f1 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -104,7 +104,7 @@ int main(void) } fprintf(stdout, "\tReading from the pipe......."); - nbytes = (apr_ssize_t)strlen("this is a test"); + nbytes = strlen("this is a test"); buf = (char *)apr_palloc(context, nbytes + 1); if (apr_read(readp, buf, &nbytes) == APR_TIMEUP) { fprintf(stdout, "OK\n"); diff --git a/test/testproc.c b/test/testproc.c index ecb9fdef4bc..25ff8ff8632 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -75,7 +75,7 @@ int main(int argc, char *argv[]) apr_proc_t newproc; apr_procattr_t *attr; apr_file_t *testfile = NULL; - apr_ssize_t length; + apr_size_t length; char *buf; const char *args[3]; char *teststr; diff --git a/test/testsf.c b/test/testsf.c index 9c9acc4f568..49eae599a37 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -209,13 +209,13 @@ static int client(client_socket_mode_t socket_mode) apr_pool_t *p; char buf[120]; apr_file_t *f = NULL; - apr_ssize_t len; + apr_size_t len; apr_size_t expected_len; apr_off_t current_file_offset; apr_hdtr_t hdtr; struct iovec headers[3]; struct iovec trailers[3]; - apr_ssize_t bytes_read; + apr_size_t bytes_read; apr_pollfd_t *pfd; apr_int32_t nsocks; int i; @@ -348,7 +348,7 @@ static int client(client_socket_mode_t socket_mode) current_file_offset = 0; len = FILE_LENGTH; do { - apr_ssize_t tmplen; + apr_size_t tmplen; tmplen = len; /* bytes remaining to send from the file */ printf("Calling apr_sendfile()...\n"); From 22567aa4deb1bb526e05ca1484dd9102f0a5e4e2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 3 Dec 2000 18:54:08 +0000 Subject: [PATCH 0888/7878] Add the sendfile test to the testsock program. This allows make test to get all the way through the test suite and report if everything is successful or not. In order to do this, I had to rename the testsf.c file to sendfile.c. We can't name the program testsf, because the find script would find it, and then we don't get through the test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60868 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 8 +-- test/{testsf.c => sendfile.c} | 0 test/testsock.c | 121 +++++++++++++++++++++++++++------- 3 files changed, 100 insertions(+), 29 deletions(-) rename test/{testsf.c => sendfile.c} (100%) diff --git a/test/Makefile.in b/test/Makefile.in index f614489ece7..84fb00d0f32 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -13,7 +13,6 @@ TARGETS= testmd5@EXEEXT@ \ testflock@EXEEXT@ \ testproc@EXEEXT@ \ testsock@EXEEXT@ \ - testsf@EXEEXT@ \ testthread@EXEEXT@ \ testtime@EXEEXT@ \ testargs@EXEEXT@ \ @@ -32,7 +31,6 @@ OBJS= testmd5.o \ testflock.o \ testproc.o \ testsock.o \ - testsf.o \ testthread.o \ testtime.o \ testargs.o \ @@ -82,13 +80,11 @@ testproc@EXEEXT@: testproc.o testthread@EXEEXT@: testthread.o $(CC) $(CFLAGS) -o testthread@EXEEXT@ testthread.o $(LDFLAGS) -testsock@EXEEXT@: testsock.o client.o server.o +testsock@EXEEXT@: testsock.o client.o server.o sendfile.o $(CC) $(CFLAGS) -o testsock@EXEEXT@ testsock.o $(LDFLAGS) $(CC) $(CFLAGS) -o server@EXEEXT@ server.o $(LDFLAGS) $(CC) $(CFLAGS) -o client@EXEEXT@ client.o $(LDFLAGS) - -testsf@EXEEXT@: testsf.o - $(CC) $(CFLAGS) -o testsf@EXEEXT@ testsf.o $(LDFLAGS) + $(CC) $(CFLAGS) -o sendfile@EXEEXT@ sendfile.o $(LDFLAGS) testtime@EXEEXT@: testtime.o $(CC) $(CFLAGS) -o testtime@EXEEXT@ testtime.o $(LDFLAGS) diff --git a/test/testsf.c b/test/sendfile.c similarity index 100% rename from test/testsf.c rename to test/sendfile.c diff --git a/test/testsock.c b/test/testsock.c index 8be62c52e9d..6731bb6133b 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -63,10 +63,8 @@ #define STRLEN 15 -int main(int argc, char *argv[]) +static int run_basic_test(apr_pool_t *context) { - apr_pool_t *context; - apr_procattr_t *attr1 = NULL; apr_procattr_t *attr2 = NULL; apr_proc_t proc1; @@ -75,25 +73,56 @@ int main(int argc, char *argv[]) apr_status_t s2; const char *args[2]; - fprintf(stdout, "Initializing........."); - if (apr_initialize() != APR_SUCCESS) { - fprintf(stderr, "Something went wrong\n"); + fprintf(stdout, "Creating children to run network tests.......\n"); + s1 = apr_createprocattr_init(&attr1, context); + s2 = apr_createprocattr_init(&attr2, context); + + if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { + fprintf(stderr, "Problem creating proc attrs\n"); exit(-1); } - fprintf(stdout, "OK\n"); - atexit(apr_terminate); - fprintf(stdout, "Creating context......."); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { - fprintf(stderr, "Could not create context\n"); + args[0] = apr_pstrdup(context, "server"); + args[1] = NULL; + s1 = apr_create_process(&proc1, "./server", args, NULL, attr1, context); + + /* Sleep for 5 seconds to ensure the server is setup before we begin */ + apr_sleep(5000000); + args[0] = apr_pstrdup(context, "client"); + s2 = apr_create_process(&proc2, "./client", args, NULL, attr2, context); + + if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { + fprintf(stderr, "Problem spawning new process\n"); exit(-1); } - fprintf(stdout, "OK\n"); - fprintf(stdout, "This test relies on the process test working. Please\n"); - fprintf(stdout, "run that test first, and only run this test when it\n"); - fprintf(stdout, "completes successfully. Alternatively, you could run\n"); - fprintf(stdout, "server and client by yourself.\n"); + while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) != APR_CHILD_DONE || + (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) != APR_CHILD_DONE) { + continue; + } + + if (s1 == APR_SUCCESS) { + apr_kill(&proc2, SIGTERM); + apr_wait_proc(&proc2, APR_WAIT); + } + else { + apr_kill(&proc1, SIGTERM); + apr_wait_proc(&proc1, APR_WAIT); + } + fprintf(stdout, "Network test completed.\n"); + + return 1; +} + +static int run_sendfile(apr_pool_t *context, int number) +{ + apr_procattr_t *attr1 = NULL; + apr_procattr_t *attr2 = NULL; + apr_proc_t proc1; + apr_proc_t proc2; + apr_status_t s1; + apr_status_t s2; + const char *args[3]; fprintf(stdout, "Creating children to run network tests.......\n"); s1 = apr_createprocattr_init(&attr1, context); @@ -104,14 +133,29 @@ int main(int argc, char *argv[]) exit(-1); } - args[0] = apr_pstrdup(context, "server"); - args[1] = NULL; - s1 = apr_create_process(&proc1, "./server", args, NULL, attr1, context); + args[0] = apr_pstrdup(context, "sendfile"); + args[1] = apr_pstrdup(context, "server"); + args[2] = NULL; + s1 = apr_create_process(&proc1, "./sendfile", args, NULL, attr1, context); - /* Sleep for 10 seconds to ensure the server is setup before we begin */ - apr_sleep(10000000); - args[0] = apr_pstrdup(context, "client"); - s2 = apr_create_process(&proc2, "./client", args, NULL, attr2, context); + /* Sleep for 5 seconds to ensure the server is setup before we begin */ + apr_sleep(5000000); + args[1] = apr_pstrdup(context, "client"); + switch (number) { + case 0: { + args[2] = apr_pstrdup(context, "blocking"); + break; + } + case 1: { + args[2] = apr_pstrdup(context, "nonblocking"); + break; + } + case 2: { + args[2] = apr_pstrdup(context, "timeout"); + break; + } + } + s2 = apr_create_process(&proc2, "./sendfile", args, NULL, attr2, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { fprintf(stderr, "Problem spawning new process\n"); @@ -135,3 +179,34 @@ int main(int argc, char *argv[]) return 1; } + +int main(int argc, char *argv[]) +{ + apr_pool_t *context = NULL; + + fprintf(stdout, "Initializing........."); + if (apr_initialize() != APR_SUCCESS) { + fprintf(stderr, "Something went wrong\n"); + exit(-1); + } + fprintf(stdout, "OK\n"); + atexit(apr_terminate); + + fprintf(stdout, "Creating context......."); + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + fprintf(stderr, "Could not create context\n"); + exit(-1); + } + fprintf(stdout, "OK\n"); + + fprintf(stdout, "This test relies on the process test working. Please\n"); + fprintf(stdout, "run that test first, and only run this test when it\n"); + fprintf(stdout, "completes successfully. Alternatively, you could run\n"); + fprintf(stdout, "server and client by yourself.\n"); + run_basic_test(context); + run_sendfile(context, 0); + run_sendfile(context, 1); + run_sendfile(context, 2); + + return 0; +} From 380aad9b96dca8dfad4b54d44992db90560622cd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 4 Dec 2000 04:10:47 +0000 Subject: [PATCH 0889/7878] Make apachebench happier on Win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60869 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr.hw b/include/apr.hw index 975ae168f0e..ac05e50905a 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -190,6 +190,7 @@ typedef int gid_t; /* Definitions that APR programs need to work properly. */ #define APR_SSIZE_T_FMT "d" +#define APR_SIZE_T_FMT "d" #define APR_THREAD_FUNC __stdcall #define APR_OFF_T_FMT "ld" From 90258b9d7707d530484502ba5d2fc1e73eefcfa8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 4 Dec 2000 04:21:43 +0000 Subject: [PATCH 0890/7878] Win32 flock arrives git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60870 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 15 +++++--- aprlib.dsp | 15 +++++--- file_io/win32/flock.c | 84 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+), 10 deletions(-) create mode 100644 file_io/win32/flock.c diff --git a/apr.dsp b/apr.dsp index c3cc6bf117f..55061af9a86 100644 --- a/apr.dsp +++ b/apr.dsp @@ -26,7 +26,6 @@ CFG=aprlib - Win32 Debug # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe -RSC=rc.exe !IF "$(CFG)" == "aprlib - Win32 Release" @@ -40,11 +39,12 @@ RSC=rc.exe # PROP Output_Dir "LibR" # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -65,11 +65,12 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 # ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -228,6 +229,10 @@ SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File +SOURCE=.\file_io\win32\flock.c +# End Source File +# Begin Source File + SOURCE=.\file_io\unix\fullrw.c # End Source File # Begin Source File diff --git a/aprlib.dsp b/aprlib.dsp index c3cc6bf117f..55061af9a86 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -26,7 +26,6 @@ CFG=aprlib - Win32 Debug # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe -RSC=rc.exe !IF "$(CFG)" == "aprlib - Win32 Release" @@ -40,11 +39,12 @@ RSC=rc.exe # PROP Output_Dir "LibR" # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -65,11 +65,12 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 # ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -228,6 +229,10 @@ SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File +SOURCE=.\file_io\win32\flock.c +# End Source File +# Begin Source File + SOURCE=.\file_io\unix\fullrw.c # End Source File # Begin Source File diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c new file mode 100644 index 00000000000..0d319c72865 --- /dev/null +++ b/file_io/win32/flock.c @@ -0,0 +1,84 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include "fileio.h" + +apr_status_t apr_lock_file(apr_file_t *thefile, int type) +{ + OVERLAPPED offset; + DWORD flags, len = 0xffffffff; + + flags = ((type & APR_FLOCK_NONBLOCK) ? LOCKFILE_FAIL_IMMEDIATELY : 0) + + (((type & APR_FLOCK_TYPEMASK) == APR_FLOCK_SHARED) + ? 0 : LOCKFILE_EXCLUSIVE_LOCK); + memset (&offset, 0, sizeof(offset)); + /* Syntax is correct, len is passed for LengthLow and LengthHigh*/ + if (!LockFileEx(thefile->filehand, flags, 0, len, len, &offset)) + return apr_get_os_error(); + + return APR_SUCCESS; +} + +apr_status_t apr_unlock_file(apr_file_t *thefile) +{ + OVERLAPPED offset; + DWORD len = 0xffffffff; + + memset (&offset, 0, sizeof(offset)); + /* Syntax is correct, len is passed for LengthLow and LengthHigh*/ + if (!UnlockFileEx(thefile->filehand, 0, len, len, &offset)) + return apr_get_os_error(); + + return APR_SUCCESS; +} From 79b3960e236521072c6b4198f962d6e31c68467e Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 4 Dec 2000 05:40:25 +0000 Subject: [PATCH 0891/7878] Cleanup some docs for APR. Also, add docs for all of the canonical names functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60871 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_dso.h | 15 +++- include/apr_errno.h | 7 ++ include/apr_file_io.h | 196 ++++++++++++++++++++++++++++-------------- 3 files changed, 150 insertions(+), 68 deletions(-) diff --git a/include/apr_dso.h b/include/apr_dso.h index f60591fb588..d2fb03e8afc 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -69,7 +69,16 @@ extern "C" { #if APR_HAS_DSO -typedef struct apr_dso_handle_t apr_dso_handle_t; +/** + * Structure for referencing dynamic objects + * @defvar apr_dso_handle_t + */ +typedef struct apr_dso_handle_t apr_dso_handle_t; + +/** + * Structure for referencing symbols from dynamic objects + * @defvar apr_dso_handle_sym_t + */ typedef void * apr_dso_handle_sym_t; /** @@ -90,10 +99,10 @@ apr_status_t apr_dso_unload(apr_dso_handle_t *handle); /** * Load a symbol from a DSO handle. * @param ressym Location to store the loaded symbol - * @param handle handle to load from. + * @param handle handle to load the symbol from. * @param symname Name of the symbol to load. */ -apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, +apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, const char *symname); /** diff --git a/include/apr_errno.h b/include/apr_errno.h index 384ba49f4ef..50cba76503b 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -69,6 +69,9 @@ extern "C" { * @package Error Codes */ +/** + * Type for specifying an error or status code. + */ typedef int apr_status_t; /** @@ -150,6 +153,10 @@ char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); * platform, either because nobody has gotten to it yet, * or the function is impossible on this platform. * APR_EMISMATCH Two passwords do not match. + * + * @tip Error codes can be checked with APR_STATUS_IS_FOO, where foo is the + * error code. For example, APR_EOF can be checked for with + * APR_STATUS_IS_EOF. * </PRE> */ diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 2f9e28fdcc1..18904b1906a 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -122,19 +122,51 @@ typedef enum { /* should be same as whence type in lseek, POSIX defines this as int */ typedef apr_int32_t apr_seek_where_t; +/** + * Structure for referencing files. + * @defvar apr_file_t + */ typedef struct apr_file_t apr_file_t; typedef struct apr_finfo_t apr_finfo_t; +/** + * Structure for referencing directories. + * @defvar apr_dir_t + */ typedef struct apr_dir_t apr_dir_t; +/** + * Structure for determining canonical filenames. + * @defvar apr_canon_t + */ typedef struct apr_canon_t apr_canon_t; +/** + * Structure for determining file permissions. + * @defvar apr_fileperms_t + */ typedef apr_int32_t apr_fileperms_t; -typedef uid_t apr_uid_t; -typedef gid_t apr_gid_t; +/** + * Structure for determining file owner. + * @defvar apr_uid_t + */ +typedef uid_t apr_uid_t; +/** + * Structure for determining the group that owns the file. + * @defvar apr_gid_t + */ +typedef gid_t apr_gid_t; #ifdef WIN32 -typedef apr_uint64_t apr_ino_t; -typedef apr_uint32_t apr_dev_t; +/** + * Structure for determining the inode of the file. + * @defvar apr_ino_t + */ +typedef apr_uint64_t apr_ino_t; +/** + * Structure for determining the device the file is on. + * @defvar apr_dev_t + */ +typedef apr_uint32_t apr_dev_t; #else -typedef ino_t apr_ino_t; -typedef dev_t apr_dev_t; +typedef ino_t apr_ino_t; +typedef dev_t apr_dev_t; #endif /** @@ -186,120 +218,151 @@ struct apr_finfo_t { /* Make and Merge Canonical Name Options */ - -/** - * Require the trusted_name+child_name result is an absolute product - * or fail with error for the make and merge canonical name functions. - */ #define APR_CANON_ONLY_ABSOLUTE 0 -/** - * Allow that the trusted_name+child_name result may be a relative result - * for the make and merge canonical name functions. - */ #define APR_CANON_ALLOW_RELATIVE 2 - -/** - * Require the trusted_name+child_name result is not an absolute path - * or fail with error for the make and merge canonical name functions. - */ #define APR_CANON_ONLY_RELATIVE 3 - -/** - * Require the trusted_name+child_name result is a child of trusted_name - * or fail with error for the make and merge canonical name functions. - */ #define APR_CANON_CHILD_OF_TRUSTED 4 - -/** - * If file path elements exist (can stat) then fold the element's name - * to lowercase for the make and merge canonical name functions. - */ #define APR_CANON_LOWERCASE - -/** - * If file path elements exist (can readdir) then fold the element's name - * to the true case lowercase for the make and merge canonical name functions. - */ #define APR_CANON_TRUECASE + +/* This is a hack, because none of these functions actually exist yet. The + * problem is that we generate our exports from the header files, so we are + * trying to export these functions, but they don't exist, so we can't link. + * This just makes sure that we don't try to link these functions until + * they actually exist. + */ +#ifdef APR_NOT_DONE_YET /** * Canonicalize the path and name. - * * @param new_name The newly allocated canonicalized trusted+child name * @param trusted_name Already canonical parent path; may be NULL. * @param child_name An absolute path or path relative to trusted_name. - * @param options See the APR_CANON_ bit flags documentation for options - * @param pool The context in which to allocate the new_name apr_canon_t + * @param options Bit-wise of: + * <PRE> + * APR_CANON_ONLY_ABSOLUTE Require the trusted_name+child_name result is + * an absolute product or fail with error for the + * make and merge canonical name functions. + * APR_CANON_ALLOW_RELATIVE Allow that the trusted_name+child_name result + * may be a relative result for the make and + * merge canonical name functions. + * APR_CANON_ONLY_RELATIVE Require the trusted_name+child_name result is + * not an absolute path or fail with error for + * the make and merge canonical name functions. + * APR_CANON_CHILD_OF_TRUSTED Require the trusted_name+child_name result is + * a child of trusted_name or fail with error for + * the make and merge canonical name functions. + * APR_CANON_LOWERCASE If file path elements exist (can stat) then + * fold the element's name to lowercase for the + * make and merge canonical name functions. + * APR_CANON_TRUECASE If file path elements exist (can readdir) then + * fold the element's name to the true case + * lowercase for the make and merge canonical + * name functions. + * </PRE> + * @param pool The pool in which to allocate the new_name apr_canon_t * - * @tip A canonical name is a name stipped of embedded backrefs "../", + * @tip A canonical name is a name stripped of embedded backrefs "../", * thisrefs "./", successive slashes (//), or any other ambigious file * name element. Absolute canonical names referencing the same file must * strcmp() identically, excluding symlinks or inconsistent use of the * APR_CANON_LOWERCASE or APR_CANON_TRUECASE options. * * If the name does not exist, or resolves to a relative name the given case - * is preserved. Insignificant elements are eliminated. For example, on Win32 this - * function removes trailing dots (which are allowed, but not stored in + * is preserved. Insignificant elements are eliminated. For example, on Win32 + * this function removes trailing dots (which are allowed, but not stored in * the file system), and "/../" under Unix is resolved to "/". The relative * canonical name may contain leading backrefs "../", but will never contain * any other prohibited element. */ - -/* - * @param trusted_name May be null - * @param child_name May be absolute, in which case trusted_name is ignored - * unless APR_CHILD_RELATIVE is tested. - */ -/* This is a hack, because none of these functions actually exist yet. The - * problem is that we generate our exports from the header files, so we are - * trying to export these functions, but they don't exist, so we can't link. - * This just makes sure that we don't try to link these functions until - * they actually exist. - */ -#ifdef APR_NOT_DONE_YET apr_status_t apr_make_canonical_name(apr_canon_t **new_name, const apr_canon_t *trusted_name, const char *child_name, int options, apr_pool_t *pool); +/** + * Merge two canonical names into a single canonical name. + * @param new_name The newly allocated canonicalized trusted+child name + * @param trusted_name Already canonical parent path; may be NULL. + * @param child_name An already canonical absolute path or path relative to + * trusted_name. + * @param options See apr_make_canonical_name for options + * @param pool The pool to allocate the new_name out of. + * @see apr_make_canonical_name + */ apr_status_t apr_merge_canonical_name(apr_canon_t **new_name, const apr_canon_t *trusted_name, const apr_canon_t *child_name, int options, apr_pool_t *pool); +/** + * Get the canonical path in a character string + * @param path A location to store the canocical name + * @param trusted_name An already canonicalized file path + * @param pool The pool to allocate the path out of. + */ apr_status_t apr_get_canonical_name(char **path, const apr_canon_t *trusted_name, apr_pool_t *pool); +/** + * Count the number of elements in a canonical name. + * @param trusted_name An already canonicalized file path + * @return The number of elements in the name + */ int apr_count_canonical_elements(const apr_canon_t *trusted_name); +/** + * Query the length of some elements of the canonical name + * @param trusted_name An already canonicalized file path + * @param firstelement The numerical position of the element to start the + * length at. + * @param lastelement The numerical position of the element to end the + * length at. + * @return The length of requested elements. + */ int apr_get_canonical_elements_length(const apr_canon_t *trusted_name, int firstelement, int lastelement); +/** + * Get the requested elements of a canonical name in a character string + * @param path_elements A location to store the path elements. + * @param trusted_name An already canonicalized file path + * @param firstelement The numerical position of the element to start the + * length at. + * @param lastelement The numerical position of the element to end the + * length at. + * @param pool The pool to allocate the path out of. + */ apr_status_t apr_get_canonical_elements(char **path_elements, const apr_canon_t *trusted_name, int firstelement, int lastelement, apr_pool_t *pool); /** - * Returns APR_SUCCESS if canon_name is absolute. Do not trust - * !apr_is_absolute to determine if the path is relative. Also, - * test apr_is_virtualroot to avoid non-filesystem pseudo roots. + * Determine if a canonical name is absolute. + * @param path The canonical name to check + * @warning Do not trust !apr_is_absolute to determine if the path is + * relative. Also, test apr_is_virtualroot to avoid non-filesystem + * pseudo roots. */ apr_status_t apr_is_absolute(apr_canon_t **path); /** - * Returns APR_SUCCESS if canon_name is absolute. Do not trust - * !apr_is_relative to determine if the path is absolute. + * Determine if a canonical name is relative + * @param path The canonical name to check + * @warning Do not trust !apr_is_relative to determine if the path is absolute */ apr_status_t apr_is_relative(apr_canon_t **path); /** - * Returns APR_SUCCESS if the elements 0..elements resolves to a - * platform's non-physical root, e.g. the //machine/ name that - * isn't an adaquately complete root for UNC paths. + * Determine if the elements 0..elements resolves to a platform's non-physical + * root, e.g. the //machine/ name that isn't an adaquately complete root for + * UNC paths. + * @param path The canonical name to check + * @param elements The number of elements to check. */ apr_status_t apr_is_virtualroot(apr_canon_t **path, int elements); #endif @@ -398,7 +461,8 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes); * Write data to the specified file. * @param thefile The file descriptor to write to. * @param buf The buffer which contains the data. - * @param nbytes On entry, the number of bytes to write; on exit, the number of bytes written. + * @param nbytes On entry, the number of bytes to write; on exit, the number + * of bytes written. * @tip apr_write will write up to the specified number of bytes, but never * more. If the OS cannot write that many bytes, it will write as many * as it can. The third argument is modified to reflect the * number @@ -429,7 +493,8 @@ apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes); /** - * Read data from the specified file. + * Read data from the specified file, ensuring that the buffer is filled + * before returning. * @param thefile The file descriptor to read from. * @param buf The buffer to store the data to. * @param nbytes The number of bytes to read. @@ -449,7 +514,8 @@ apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read); /** - * Write data to the specified file. + * Write data to the specified file, ensuring that all of the data is + * written before returning. * @param thefile The file descriptor to write to. * @param buf The buffer which contains the data. * @param nbytes The number of bytes to write. From 6f562ef03319cae920c11660f85b06494c7c28b4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 4 Dec 2000 05:41:16 +0000 Subject: [PATCH 0892/7878] Make the fnmatch docs look like the rest of APRs docs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60872 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_fnmatch.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index 0eb3614639b..70e9ec296d7 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -61,10 +61,10 @@ extern "C" { * @param strings The string we are trying to match * @param flags flags to use in the match. Bitwise OR of: * <PRE> - * FNM_NOESCAPE -- Disable backslash escaping - * FNM_PATHNAME -- Slash must be matched by slash - * FNM_PERIOD -- Period must be matched by period - * FNM_CASE_BLIND -- Compare characters case-insensitively. + * FNM_NOESCAPE Disable backslash escaping + * FNM_PATHNAME Slash must be matched by slash + * FNM_PERIOD Period must be matched by period + * FNM_CASE_BLIND Compare characters case-insensitively. * </PRE> * @deffunc apr_status_t apr_fnmatch(const char *pattern, const char *strings, int flags) */ From 1dc4ef8293d2bed1c40d4db4888eb4c35eab1213 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 4 Dec 2000 05:44:52 +0000 Subject: [PATCH 0893/7878] Add a tip about using atexit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60873 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_general.h b/include/apr_general.h index 68a36aa4b14..ca56a38defb 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -261,7 +261,8 @@ apr_status_t apr_initialize(void); * Tear down any APR internal data structures which aren't torn down * automatically. * @tip An APR program must call this function at termination once it - * has stopped using APR services. + * has stopped using APR services. The APR developers suggest using + * atexit to ensure this is called. */ void apr_terminate(void); From 2117d1cd820fbcc475b61aa63f8056b1de997b74 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 4 Dec 2000 05:50:44 +0000 Subject: [PATCH 0894/7878] Cleanup getopt's docs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60874 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 9d393238f54..63037bda5dd 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -84,13 +84,17 @@ struct apr_getopt_t { char const* place; /** set to nonzero to support interleaving options with regular args */ int interleave; - /** range of non-option arguments skipped for interleaving */ + /** start of non-option arguments skipped for interleaving */ int skip_start; + /** end of non-option arguments skipped for interleaving */ int skip_end; }; typedef struct apr_getopt_option_t apr_getopt_option_t; +/** + * Structure used to describe options that getopt should search for. + */ struct apr_getopt_option_t { /** long option name, or NULL if option has no long name */ const char *name; @@ -102,8 +106,8 @@ struct apr_getopt_option_t { /** * Initialize the arguments for parsing by apr_getopt(). - * @param cont The pool to operate on * @param os The options structure created for apr_getopt() + * @param cont The pool to operate on * @param argc The number of arguments to parse * @param argv The array of arguments to parse * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) @@ -120,7 +124,7 @@ APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, * option associated * @param optch The next option character parsed * @param optarg The argument following the option character: - * @tip There are four potential status values on exit. They are: + * @return There are four potential status values on exit. They are: * <PRE> * APR_EOF -- No more options to parse * APR_BADCH -- Found a bad option character @@ -144,7 +148,7 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, * @param optch Receives the value of "optch" from the apr_getopt_option_t * structure corresponding to the next option matched. * @param optarg Receives the argument following the option, if any. - * @tip There are four potential status values on exit. They are: + * @return There are four potential status values on exit. They are: * <PRE> * APR_EOF -- No more options to parse * APR_BADCH -- Found a bad option character From 4daaf95ac2570623c5375992c656438d2df68c65 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 4 Dec 2000 05:56:34 +0000 Subject: [PATCH 0895/7878] Cleanup the hash table docs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60875 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index dde1f10c9ff..fcfe1ea50e9 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -81,18 +81,20 @@ extern "C" { */ #define APR_HASH_KEY_STRING (-1) -/* +/** * Abstract type for hash tables. + * @defvar apr_hash_t */ typedef struct apr_hash_t apr_hash_t; -/* +/** * Abstract type for scanning hash tables. + * @defvar apr_hash_index_t */ typedef struct apr_hash_index_t apr_hash_index_t; /** - * Create a hash table within a pool. + * Create a hash table. * @param pool The pool to allocate the hash table out of * @return The hash table just created * @deffunc apr_hash_t *apr_make_hash(apr_pool_t *pool) @@ -103,7 +105,7 @@ APR_DECLARE(apr_hash_t *) apr_make_hash(apr_pool_t *pool); * Associate a value with a key in a hash table. * @param ht The hash table * @param key Pointer to the key - * @param klen Length of the key. Can be APR_HASH_KEY_STRING. + * @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string length. * @param val Value to associate with the key * @tip If the value is NULL the hash entry is deleted. * @deffunc void apr_hash_set(apr_hash_t *ht, const void *key, apr_size_t klen, const void *val) @@ -115,7 +117,7 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key, * Look up the value associated with a key in a hash table. * @param ht The hash table * @param key Pointer to the key - * @param klen Length of the key. Can be APR_HASH_KEY_STRING. + * @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string length. * @return Returns NULL if the key is not present. * @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, apr_size_t klen) */ @@ -146,7 +148,7 @@ APR_DECLARE(void*) apr_hash_get(apr_hash_t *ht, const void *key, * is delete the current entry) and multiple iterations can be in * progress at the same time. * </PRE> - * @deffunc apr_hash_index_t * apr_hash_first(apr_hash_t *ht) + * @deffunc apr_hash_index_t *apr_hash_first(apr_hash_t *ht) */ APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht); @@ -154,7 +156,7 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht); * Continue iterating over the entries in a hash table. * @param hi The iteration state * @return a pointer to the updated iteration state. NULL if there are no more * entries. - * @deffunc apr_hash_index_t * apr_hash_next(apr_hash_index_t *hi) + * @deffunc apr_hash_index_t *apr_hash_next(apr_hash_index_t *hi) */ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); From b49fe8c357429c0d4b6b98c885a34d6ea71d11f4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 4 Dec 2000 05:59:45 +0000 Subject: [PATCH 0896/7878] Cleanup apr_lib's docs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60876 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index 90b684d061d..9b216fdc85c 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -79,13 +79,17 @@ extern "C" { * Define the structures used by the APR general-purpose library. */ -/* +typedef struct apr_vformatter_buff_t apr_vformatter_buff_t; + +/** * Structure used by the variable-formatter routines. */ -typedef struct apr_vformatter_buff_t { +struct apr_vformatter_buff_t { + /** The current position */ char *curpos; + /** The end position of the format string */ char *endpos; -} apr_vformatter_buff_t; +}; /** * return the final element of the pathname @@ -211,7 +215,6 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), */ APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, const char *hash); - /* * These are snprintf implementations based on apr_vformatter(). * @@ -230,8 +233,8 @@ APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, const char * */ /** - *snprintf routine based on apr_vformatter. This means it understands the - *same extensions.> + * snprintf routine based on apr_vformatter. This means it understands the + * same extensions. * @param buf The buffer to write to * @param len The size of the buffer * @param format The format string From 730512ef2e24f15d766a79be116f98497f6a82fa Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Mon, 4 Dec 2000 06:00:36 +0000 Subject: [PATCH 0897/7878] Add file locking for OS/2 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60877 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/Makefile.in | 1 + file_io/os2/flock.c | 75 +++++++++++++++++++++++++++++++++++++++++ include/apr_errno.h | 3 +- 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 file_io/os2/flock.c diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index 0335a9cb5a5..f413b3dac39 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -19,6 +19,7 @@ OBJS=dir.o \ pipe.o \ readwrite.o \ seek.o \ + flock.o \ maperrorcode.o .c.o: diff --git a/file_io/os2/flock.c b/file_io/os2/flock.c new file mode 100644 index 00000000000..62e3714d524 --- /dev/null +++ b/file_io/os2/flock.c @@ -0,0 +1,75 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include "fileio.h" + +apr_status_t apr_lock_file(apr_file_t *thefile, int type) +{ + FILELOCK lockrange = { 0, 0x7fffffff }; + ULONG rc; + + rc = DosSetFileLocks(thefile->filedes, NULL, &lockrange, + (type & APR_FLOCK_NONBLOCK) ? 0 : (ULONG)-1, + (type & APR_FLOCK_TYPEMASK) == APR_FLOCK_SHARED); + return APR_FROM_OS_ERROR(rc); +} + +apr_status_t apr_unlock_file(apr_file_t *thefile) +{ + FILELOCK unlockrange = { 0, 0x7fffffff }; + ULONG rc; + + rc = DosSetFileLocks(thefile->filedes, &unlockrange, NULL, 0, 0); + return APR_FROM_OS_ERROR(rc); +} diff --git a/include/apr_errno.h b/include/apr_errno.h index 50cba76503b..6a5ebf084fa 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -438,7 +438,8 @@ char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \ - || (s) == APR_OS_START_SYSERR + SOCEWOULDBLOCK) + || (s) == APR_OS_START_SYSERR + SOCEWOULDBLOCK \ + || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION) #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ || (s) == APR_OS_START_SYSERR + SOCEINTR) #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ From fa711b7660352d0de6717ab94bb692f8a96935e9 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 4 Dec 2000 06:15:05 +0000 Subject: [PATCH 0898/7878] Cleanup some docs in the lock and network headers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60878 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lock.h | 6 +-- include/apr_network_io.h | 113 ++++++++++++++++++++------------------- 2 files changed, 61 insertions(+), 58 deletions(-) diff --git a/include/apr_lock.h b/include/apr_lock.h index c0bc72697a2..d385a14b2e5 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -85,9 +85,9 @@ typedef struct apr_lock_t apr_lock_t; * </PRE> * @param scope The scope of the lock to create, one of: * <PRE> - * APR_CROSS_PROCESS -- lock processes from the protected area. - * APR_INTRAPROCESS -- lock threads from the protected area. - * APR_LOCKALL -- lock processes and threads from the + * APR_CROSS_PROCESS lock processes from the protected area. + * APR_INTRAPROCESS lock threads from the protected area. + * APR_LOCKALL lock processes and threads from the * protected area. * </PRE> * @param fname A file name to use if the lock mechanism requires one. This diff --git a/include/apr_network_io.h b/include/apr_network_io.h index dd6df2e5945..6683f555d33 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -154,37 +154,40 @@ typedef struct in_addr apr_in_addr_t; /* use apr_uint16_t just in case some system has a short that isn't 16 bits... */ typedef apr_uint16_t apr_port_t; -/* we're going to roll our own sockaddr type as we want to make sure - * we have protocol independence for APR... - * - * It's defined here as I think it should all be platform safe... - */ -typedef struct apr_sockaddr_t { - apr_pool_t *pool; /* The pool to use... */ - char *hostname; /* The hostname */ - char *servname; /* This is either a string of the port number or - * the service name for the port - */ - apr_port_t port; /* The numeric port */ +/* It's defined here as I think it should all be platform safe... + */ +typedef struct apr_sockaddr_t apr_sockaddr_t; +/** + * APRs socket address type, used to ensure protocol independence + */ +struct apr_sockaddr_t { + /** The pool to use... */ + apr_pool_t *pool; + /** The hostname */ + char *hostname; + /** Either a string of the port number or the service name for the port */ + char *servname; + /** The numeric port */ + apr_port_t port; union { - struct sockaddr_in sin; /* IPv4 sockaddr structure */ + /** IPv4 sockaddr structure */ + struct sockaddr_in sin; #if APR_HAVE_IPV6 - struct sockaddr_in6 sin6; /* IPv6 sockaddr structure */ + /** IPv6 sockaddr structure */ + struct sockaddr_in6 sin6; #endif } sa; - apr_socklen_t salen; /* How big is the sockaddr we're using? */ - int ipaddr_len; /* How big is the ip address structure - * we're using? - */ - int addr_str_len; /* How big should the address buffer be? - * 16 for v4 or 46 for v6 - * used in inet_ntop... - */ - void *ipaddr_ptr; /* This points to the IP address - * structure within the appropriate - * sockaddr structure. - */ -} apr_sockaddr_t; + /** How big is the sockaddr we're using? */ + apr_socklen_t salen; + /** How big is the ip address structure we're using? */ + int ipaddr_len; + /** How big should the address buffer be? 16 for v4 or 46 for v6 + * used in inet_ntop... */ + int addr_str_len; + /** This points to the IP address structure within the appropriate + * sockaddr structure. */ + void *ipaddr_ptr; +}; #if APR_HAS_SENDFILE /* Define flags passed in on apr_sendfile() */ @@ -222,9 +225,9 @@ apr_status_t apr_create_socket(apr_socket_t **new_sock, int family, * @param thesocket The socket to close * @param how How to shutdown the socket. One of: * <PRE> - * APR_SHUTDOWN_READ -- no longer allow read requests - * APR_SHUTDOWN_WRITE -- no longer allow write requests - * APR_SHUTDOWN_READWRITE -- no longer allow read or write requests + * APR_SHUTDOWN_READ no longer allow read requests + * APR_SHUTDOWN_WRITE no longer allow write requests + * APR_SHUTDOWN_READWRITE no longer allow read or write requests * </PRE> * @tip This does not actually close the socket descriptor, it just * controls which calls are still valid on the socket. @@ -270,9 +273,9 @@ apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, * Issue a connection request to a socket either on the same machine * or a different one. * @param sock The socket we wish to use for our side of the connection - * @param hostname The hostname of the machine we wish to connect to. If NULL, - * APR assumes that the sockaddr_in in the apr_socket is - * completely filled out. + * @param sa The address of the machine we wish to connect to. If NULL, + * APR assumes that the sockaddr_in in the apr_socket is + * completely filled out. */ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa); @@ -290,7 +293,7 @@ apr_status_t apr_get_hostname(char **name, apr_interface_e which, * @param sa The new apr_sockaddr_t. * @param hostname The hostname or numeric address string to resolve/parse. * @param family The address family to use, or APR_UNSPEC if the system should - * decide. + * decide. * @param port The port number. * @param flags Special processing flags. * @param p The pool for the apr_sockaddr_t and associated storage. @@ -312,7 +315,7 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont); /** - * Return the pool associated with the current socket> + * Return the data associated with the current socket * @param data The user data associated with the socket. * @param key The key to associate with the user data. * @param sock The currently open socket. @@ -321,7 +324,7 @@ apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock); /** - * Set the pool associated with the current socket. + * Set the data associated with the current socket. * @param sock The currently open socket. * @param data The user data to associate with the socket. * @param key The key to associate with the data. @@ -379,7 +382,7 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, * @param offset Offset into the file where we should begin writing * @param len (input) - Number of bytes to send from the file * (output) - Number of bytes actually sent, - * including headers, file, and trailers + * including headers, file, and trailers * @param flags APR flags that are mapped to OS specific flags * @tip This functions acts like a blocking write by default. To change * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. @@ -428,7 +431,7 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len); * APR_SO_SNDBUF -- Set the SendBufferSize * APR_SO_RCVBUF -- Set the ReceiveBufferSize * </PRE> - * @param on Are we turning the option on or off. + * @param on Value for the option. */ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on); @@ -498,7 +501,7 @@ apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr); apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr); /** - * Setup the memory required for poll to operate properly> + * Setup the memory required for poll to operate properly * @param new_poll The poll structure to be used. * @param num The number of socket descriptors to be polled. * @param cont The pool to operate on. @@ -530,9 +533,9 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_interval_time * @param socket The socket to add to the current poll structure. * @param event The events to look for when we do the poll. One of: * <PRE> - * APR_POLLIN -- signal if read will not block - * APR_POLLPRI -- signal if prioirty data is availble to be read - * APR_POLLOUT -- signal if write will not block + * APR_POLLIN signal if read will not block + * APR_POLLPRI signal if prioirty data is availble to be read + * APR_POLLOUT signal if write will not block * </PRE> */ apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, @@ -544,9 +547,9 @@ apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, * @param sock The socket to modify in poll structure. * @param events The events to stop looking for during the poll. One of: * <PRE> - * APR_POLLIN -- signal if read will not block - * APR_POLLPRI -- signal if prioirty data is availble to be read - * APR_POLLOUT -- signal if write will not block + * APR_POLLIN signal if read will not block + * APR_POLLPRI signal if prioirty data is availble to be read + * APR_POLLOUT signal if write will not block * </PRE> */ apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, @@ -563,9 +566,9 @@ apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock); * @param aprset The poll structure we will be using. * @param events The events to clear from all sockets. One of: * <PRE> - * APR_POLLIN -- signal if read will not block - * APR_POLLPRI -- signal if prioirty data is availble to be read - * APR_POLLOUT -- signal if write will not block + * APR_POLLIN signal if read will not block + * APR_POLLPRI signal if prioirty data is availble to be read + * APR_POLLOUT signal if write will not block * </PRE> */ apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events); @@ -574,12 +577,12 @@ apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events); * Get the return events for the specified socket. * @param event The returned events for the socket. One of: * <PRE> - * APR_POLLIN -- Data is available to be read - * APR_POLLPRI -- Prioirty data is availble to be read - * APR_POLLOUT -- Write will succeed - * APR_POLLERR -- An error occurred on the socket - * APR_POLLHUP -- The connection has been terminated - * APR_POLLNVAL -- This is an invalid socket to poll on. + * APR_POLLIN Data is available to be read + * APR_POLLPRI Prioirty data is availble to be read + * APR_POLLOUT Write will succeed + * APR_POLLERR An error occurred on the socket + * APR_POLLHUP The connection has been terminated + * APR_POLLNVAL This is an invalid socket to poll on. * Socket not open. * </PRE> * @param sock The socket we wish to get information about. @@ -612,7 +615,7 @@ apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, * Convert a File type to a socket so that it can be used in a poll operation. * @param newsock the newly created socket which represents a file. * @param file the file to mask as a socket. - * @tip This is not available on all platforms. Platforms that have the + * @warning This is not available on all platforms. Platforms that have the * ability to poll files for data to be read/written/exceptions will * have the APR_FILES_AS_SOCKETS macro defined as true. */ From 8dcff5fd073d3193bf9f06a82efa1cdf34c8dee2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 4 Dec 2000 06:22:29 +0000 Subject: [PATCH 0899/7878] Cleanup some minor docs, and remove apr_fdopen. apr_fdopen is left over from Apache, and it is not used, and should not be provided. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60879 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 3f6cf40bf7b..09a3f2db47a 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -203,12 +203,6 @@ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); #define apr_pool_join(a,b) #endif -#ifdef ULTRIX_BRAIN_DEATH -#define apr_fdopen(d,m) fdopen((d), (char *)(m)) -#else -#define apr_fdopen(d,m) fdopen((d), (m)) -#endif - /* * APR memory structure manipulators (pools, tables, and arrays). */ @@ -272,8 +266,7 @@ apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont); * @param apr_abort A function to use if the pool cannot allocate more memory. * @return The new sub-pool * @tip The apr_abort function provides a way to quit the program if the - * machine is out of memory. By default, APR will return with an - * error. + * machine is out of memory. By default, APR will return on error. * @deffunc apr_pool_t *apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) */ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)); From 1b30b434f9d8f8e0a2df647e2c6ad8d867e4423b Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 4 Dec 2000 06:28:53 +0000 Subject: [PATCH 0900/7878] Cleanup the rest of the docs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60880 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 4 ++-- include/apr_thread_proc.h | 1 - include/apr_xlate.h | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index f189b7701cf..46d10df0295 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -96,8 +96,8 @@ extern "C" { /** * Do a natural order comparison of two strings. - * @param The first string to compare - * @param The second string to compare + * @param a The first string to compare + * @param b The second string to compare * @return Either <0, 0, or >0. If the first string is less than the second * this returns <0, if they are equivalent it returns 0, and if the * first string is greater than second string it retuns >0. diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index f0cdbff0474..18452d45154 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -443,7 +443,6 @@ apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e waithow); * </PRE> * @param p Pool to allocate child information out of. */ - apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p); diff --git a/include/apr_xlate.h b/include/apr_xlate.h index 46186483c5a..3b35e7997ea 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -148,8 +148,8 @@ apr_status_t apr_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar * parameters of conversion * @param inchar The single-byte character to convert. * @tip This only works when converting between single-byte character sets. - -1 will be returned if the conversion can't be performed. -*/ + * -1 will be returned if the conversion can't be performed. + */ apr_int32_t apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar); /** From ea149fe53cb6990d48390423c26a4d22a36e2e0e Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 4 Dec 2000 14:51:31 +0000 Subject: [PATCH 0901/7878] Add documentation to APR's tables interface git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60881 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 334 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 324 insertions(+), 10 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index e38bc5eaa19..fce17e3b354 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -172,22 +172,63 @@ struct apr_btable_entry_t { apr_item_t *val; }; -/* XXX: these know about the definition of struct apr_table_t in alloc.c. That - * definition is not here because it is supposed to be private, and by not - * placing it here we are able to get compile-time diagnostics from modules - * written which assume that a apr_table_t is the same as an - * apr_array_header_t. -djg +/** + * Get the elements from a table + * @param t The table + * @return An array containing the contents of the table + * @deffunc apr_array_header_t *apr_table_elts(apr_table_t *t) */ #define apr_table_elts(t) ((apr_array_header_t *)(t)) +/** + * Get the elements from a binary table + * @param t The table + * @return An array containing the contents of the table + * @deffunc apr_array_header_t *apr_table_elts(apr_table_t *t) + */ #define apr_btable_elts(t) apr_table_elts(t) +/** + * Determine if the table is empty + * @param t The table to check + * @return True if empty, Falso otherwise + */ #define apr_is_empty_table(t) (((t) == NULL) \ || (((apr_array_header_t *)(t))->nelts == 0)) +/** + * Determine if the binary table is empty + * @param t The table to check + * @return True if empty, Falso otherwise + */ #define apr_is_empty_btable(t) apr_is_empty_table(t) +/** + * Create an array + * @param p The pool to allocate the memory out of + * @param nelts the number of elements in the initial array + * @param elt_size The size of each element in the array. + * @return The new array + * #deffunc apr_array_header_t *apr_make_array(struct apr_pool_t *p, int nelts, int elt_size) + */ APR_DECLARE(apr_array_header_t *) apr_make_array(struct apr_pool_t *p, int nelts, int elt_size); + +/** + * Add a new element to an array + * @param arr The array to add an element to. + * @return Location for the new element in the array. + * @tip If there are no free spots in the array, then this function will + * allocate new space for the new element. + * @deffunc void *apr_push_array(apr_array_header_t *arr) + */ APR_DECLARE(void *) apr_push_array(apr_array_header_t *arr); + +/** + * Concatenate two arrays together + * @param dst The destination array, and the one to go first in the combined + * array + * @param src The source array to add to the destination array + * @deffunc void apr_array_cat(apr_array_header_t *dst, const apr_array_header_t *src) + */ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, const apr_array_header_t *src); @@ -195,67 +236,328 @@ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, * the header, and arranges for the elements to be copied if (and only * if) the code subsequently does a push or arraycat. */ +/** + * Copy the entire array + * @param p The pool to allocate the copy of the array out of + * @param arr The array to copy + * @return An exact copy of the array passed in + * @deffunc apr_array_header_t *apr_copy_array(apr_pool_t *p, const apr_array_header_t *arr) + */ APR_DECLARE(apr_array_header_t *) apr_copy_array(struct apr_pool_t *p, const apr_array_header_t *arr); +/** + * Copy the headers of the array, and arrange for the elements to be copied if + * and only if the code subsequently does a push or arraycat. + * @param p The pool to allocate the copy of the array out of + * @param arr The array to copy + * @return An exact copy of the array passed in + * @deffunc apr_array_header_t *apr_copy_array_hdr(apr_pool_t *p, const apr_array_header_t *arr) + */ APR_DECLARE(apr_array_header_t *) apr_copy_array_hdr(struct apr_pool_t *p, const apr_array_header_t *arr); + +/** + * Append one array to the end of another, creating a new array in the process. + * @param p The pool to allocate the new array out of + * @param first The array to put first in the new array. + * @param second The array to put second in the new array. + * @param return A new array containing the data from the two arrays passed in. + * @deffunc apr_array_header_t *apr_append_arrays(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second) +*/ APR_DECLARE(apr_array_header_t *) apr_append_arrays(struct apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second); -/* apr_array_pstrcat generates a new string from the apr_pool_t containing - * the concatenated sequence of substrings referenced as elements within - * the array. The string will be empty if all substrings are empty or null, - * or if there are no elements in the array. - * If sep is non-NUL, it will be inserted between elements as a separator. +/** + * Generates a new string from the apr_pool_t containing the concatenated + * sequence of substrings referenced as elements within the array. The string + * will be empty if all substrings are empty or null, or if there are no + * elements in the array. If sep is non-NUL, it will be inserted between + * elements as a separator. + * @param p The pool to allocate the string out of + * @param arr The array to generate the string from + * @param sep The separator to use + * @return A string containing all of the data in the array. + * @deffuncchar *apr_array_pstrcat(apr_pool_t *p, const apr_array_header_t *arr, const char sep) */ APR_DECLARE(char *) apr_array_pstrcat(struct apr_pool_t *p, const apr_array_header_t *arr, const char sep); + +/** + * Make a new table + * @param p The pool to allocate the pool out of + * @param nelts The number of elements in the initial table. + * @return The new table. + * @warning This table can only store text data + * @deffunc apr_table_t *apr_make_table(apr_pool_t *p, int nelts) + */ APR_DECLARE(apr_table_t *) apr_make_table(struct apr_pool_t *p, int nelts); + +/** + * Make a new table capable of storing binary data + * @param p The pool to allocate the pool out of + * @param nelts The number of elements in the initial table. + * @return The new table. + * @deffunc apr_table_t *apr_make_btable(apr_pool_t *p, int nelts) + */ APR_DECLARE(apr_btable_t *) apr_make_btable(struct apr_pool_t *p, int nelts); + +/** + * Create a new table and copy another table into it + * @param p The pool to allocate the new table out of + * @param t The table to copy + * @return A copy of the table passed in + * @deffunc apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) + */ APR_DECLARE(apr_table_t *) apr_copy_table(struct apr_pool_t *p, const apr_table_t *t); +/** + * Create a new binary table and copy another table into it + * @param p The pool to allocate the new table out of + * @param t The table to copy + * @return A copy of the table passed in + * @deffunc apr_table_t *) apr_copy_btable(apr_pool_t *p, const apr_btable_t *t) + */ APR_DECLARE(apr_btable_t *) apr_copy_btable(struct apr_pool_t *p, const apr_btable_t *t); + +/** + * Delete all of the elements from a table + * @param t The table to clear + * @deffunc void apr_clear_table(apr_table_t *t) + */ APR_DECLARE(void) apr_clear_table(apr_table_t *t); +/** + * Delete all of the elements from a binary table + * @param t The table to clear + * @deffunc void apr_clear_btable(apr_btable_t *t) + */ APR_DECLARE(void) apr_clear_btable(apr_btable_t *t); + +/** + * Get the value associated with a given key from the table. After this call, + * The data is still in the table + * @param t The table to search for the key + * @param key The key to search for + * @return The value associated with the key + * @deffunc const char *apr_table_get(const apr_table_t *t, const char *key) + */ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); +/** + * Get the value associated with a given key from a binary table. After this + * call, the data is still in the table. + * @param t The table to search for the key + * @param key The key to search for + * @return The value associated with the key + * @deffunc const apr_item_t *apr_btable_get(const apr_btable_t *t, const char *key) + */ APR_DECLARE(const apr_item_t *) apr_btable_get(const apr_btable_t *t, const char *key); + +/** + * Add a key/value pair to a table, if another element already exists with the + * same key, this will over-write the old data. + * @param t The table to add the data to. + * @param key The key fo use + * @param val The value to add + * @tip When adding data, this function makes a copy of both the key and the + * value. + * @deffunc void apr_table_set(apr_table_t *t, const char *key, const char *val) + */ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, const char *val); +/** + * Add a key/value pair to a binary table if another element already exists + * with the same key, this will over-write the old data. + * @param t The table to add the data to. + * @param key The key fo use + * @param size The size of the data to add + * @param val The value to add + * @tip When adding data, this function makes a copy of both the key and the + * value. + * @deffunc void apr_btable_set(apr_btable_t *t, const char *key, size_t size, const void *val) + */ APR_DECLARE(void) apr_btable_set(apr_btable_t *t, const char *key, size_t size, const void *val); + +/** + * Add a key/value pair to a table, if another element already exists with the + * same key, this will over-write the old data. + * @param t The table to add the data to. + * @param key The key fo use + * @param val The value to add + * @tip When adding data, this function does not make a copy of the key or the + * value, so care should be taken to ensure that the values will not + * change after they have been added.. + * @deffunc void apr_table_setn(apr_table_t *t, const char *key, const char *val) + */ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, const char *val); +/** + * Add a key/value pair to a binary table if another element already exists + * with the same key, this will over-write the old data. + * @param t The table to add the data to. + * @param key The key fo use + * @param size The size of the data to add + * @param val The value to add + * @tip When adding data, this function does not make a copy of the key or the + * value, so care should be taken to ensure that the values will not + * change after they have been added.. + * @deffunc void apr_btable_setn(apr_btable_t *t, const char *key, size_t size, const void *val) + */ APR_DECLARE(void) apr_btable_setn(apr_btable_t *t, const char *key, size_t size, const void *val); + +/** + * Remove data from the table + * @param t The table to remove data from + * @param key The key of the data being removed + * @deffunc void apr_table_unset(apr_table_t *t, const char *key) + */ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key); +/** + * Remove data from a binary table + * @param t The table to remove data from + * @param key The key of the data being removed + * @deffunc void apr_btable_unset(apr_btable_t *t, const char *key) + */ APR_DECLARE(void) apr_btable_unset(apr_btable_t *t, const char *key); + +/** + * Add data to a table by merging the value with data that has already been + * stored + * @param t The table to search for the data + * @param key The key to merge data for + * @param val The data to add + * @tip If the key is not found, then this function acts like apr_table_add + * @deffunc void apr_table_merge(apr_table_t *t, const char *key, const char *val) + */ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, const char *val); +/** + * Add data to a table by merging the value with data that has already been + * stored + * @param t The table to search for the data + * @param key The key to merge data for + * @param val The data to add + * @tip If the key is not found, then this function acts like apr_table_addn + * @deffunc void apr_table_mergen(apr_table_t *t, const char *key, const char *val) + */ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, const char *val); + +/** + * Add data to a table, regardless of whether there is another element with the + * same key. + * @param t The table to add to + * @param key The key to use + * @param val The value to add. + * @tip When adding data, this function makes a copy of both the key and the + * value. + * @deffunc void apr_table_add(apr_table_t *t, const char *key, const char *val) + */ APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, const char *val); +/** + * Add data to a binary table, regardless of whether there is another element + * with the same key. + * @param t The table to add to + * @param key The key to use + * @param size The size of the value to add + * @param val The value to add. + * @tip When adding data, this function makes a copy of both the key and the + * value. + * @deffunc void apr_btable_add(apr_btable_t *t, const char *key, size_t size, const char *val) + */ APR_DECLARE(void) apr_btable_add(apr_btable_t *t, const char *key, size_t size, const void *val); + +/** + * Add data to a table, regardless of whether there is another element with the + * same key. + * @param t The table to add to + * @param key The key to use + * @param val The value to add. + * @tip When adding data, this function does not make a copy of the key or the + * value, so care should be taken to ensure that the values will not + * change after they have been added.. + * @deffunc void apr_table_addn(apr_table_t *t, const char *key, const char *val) + */ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, const char *val); +/** + * Add data to a binary table, regardless of whether there is another element + * with the same key. + * @param t The table to add to + * @param key The key to use + * @param size The size of the value to add + * @param val The value to add. + * @tip When adding data, this function does not make a copy of the key or the + * value, so care should be taken to ensure that the values will not + * change after they have been added.. + * @deffunc void apr_btable_addn(apr_btable_t *t, const char *key, size_t size, const char *val) + */ APR_DECLARE(void) apr_btable_addn(apr_btable_t *t, const char *key, size_t size, const void *val); + +/** + * Merge two tables into one new table + * @param p The pool to use for the new table + * @param overlay The first table to put in the new table + * @param base The table to add at the end of the new table + * @return A new table containing all of the data from the two passed in + * @deffunc apr_table_t *apr_overlay_tables(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); + */ APR_DECLARE(apr_table_t *) apr_overlay_tables(struct apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); +/** + * Merge two binary tables into one new table + * @param p The pool to use for the new table + * @param overlay The first table to put in the new table + * @param base The table to add at the end of the new table + * @return A new table containing all of the data from the two passed in + * @deffunc apr_btable_t *apr_overlay_tables(apr_pool_t *p, const apr_btable_t *overlay, const apr_btable_t *base); + */ APR_DECLARE(apr_btable_t *) apr_overlay_btables(struct apr_pool_t *p, const apr_btable_t *overlay, const apr_btable_t *base); + +/** + * Iterate over a table running the provided function once for every + * element in the table. If there is data passed in as a vararg, then the + * function is only run on those element's whose key matches something in + * the vararg. If the vararg is NULL, then every element is run through the + * function. + * @param comp The function to run + * @param rec The data to pass as the first argument to the function + * @param t The table to iterate over + * @param ... The vararg. If this is NULL, then all elements in the table are + * run through the function, otherwise only those whose key matches + * are run. + * @deffunc void apr_table_do(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, ...) + */ APR_DECLARE(void) apr_table_do(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, ...); + +/** + * Iterate over a table running the provided function once for every + * element in the table. If there is data passed in as a vararg, then the + * function is only run on those element's whose key matches something in + * the vararg. If the vararg is NULL, then every element is run through the + * function. + * @param comp The function to run + * @param rec The data to pass as the first argument to the function + * @param t The table to iterate over + * @param vp The vararg table. If this is NULL, then all elements in the + * table are run through the function, otherwise only those + * whose key matches are run. + * @deffunc void apr_table_vdo(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, va_list vp) + */ APR_DECLARE(void) apr_table_vdo(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, va_list); @@ -284,6 +586,18 @@ APR_DECLARE(void) */ #define APR_OVERLAP_TABLES_SET (0) #define APR_OVERLAP_TABLES_MERGE (1) +/** + * For each element in table b, either use setn or mergen to add the data + * to table a. Wich method is used is determined by the flags passed in. + * @param a The table to add the data to. + * @param b The table to iterate over, adding it's data to table a + * @param flags How to add the table to table a. One of: + * APR_OVERLAP_TABLES_SET Use apr_table_setn + * APR_OVERLAP_TABLES_MERGE Use apr_table_mergen + * @tip This function is highly optimized, and uses less memory and CPU cycles + * than a function that just loops through table b calling other functions. + * @deffunc void apr_overlap_tables(apr_table_t *a, const apr_table_t *b, unsigned flags) + */ APR_DECLARE(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, unsigned flags); From f049eb75aee26c62683b566eab37a51e29029152 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 4 Dec 2000 16:09:32 +0000 Subject: [PATCH 0902/7878] Add apr_make_os_sock() for constructing a fully-capable APR socket. The BeOS sockets.c doesn't look up-to-date and I think David is(has) switching(switched) to using the Unix sockets.c. Thus, I have not messed with it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60882 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ aprlib.def | 1 + include/apr_portable.h | 28 ++++++++++++++++++++++++++++ libapr.def | 1 + network_io/os2/sockets.c | 26 ++++++++++++++++++++++++++ network_io/unix/sockets.c | 31 +++++++++++++++++++++++++++++++ network_io/win32/sockets.c | 29 +++++++++++++++++++++++++++++ 7 files changed, 119 insertions(+) diff --git a/CHANGES b/CHANGES index 74121bd2425..8cae6c51e9d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ Changes with APR a9 + *) Add apr_make_os_sock() for constructing a fully-capable APR + socket. [Jeff Trawick] + *) Make APR's shared memory routines always allocate enough memory for the requested segment, the MM internal types, and the APR internal types. diff --git a/aprlib.def b/aprlib.def index 485597e3e02..8c0c2b5397b 100644 --- a/aprlib.def +++ b/aprlib.def @@ -75,6 +75,7 @@ EXPORTS apr_set_socketdata apr_get_polldata apr_set_polldata + apr_make_os_sock apr_put_os_sock apr_get_os_sock apr_remove_poll_socket diff --git a/include/apr_portable.h b/include/apr_portable.h index 6faf9144797..ffa1246f989 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -184,6 +184,20 @@ typedef struct timeval apr_os_imp_time_t; typedef struct tm apr_os_exp_time_t; #endif +/** + * everything APR needs to know about an active socket to construct + * an APR socket from it; currently, this is platform-independent + */ +struct apr_os_sock_info_t { + apr_os_sock_t *os_sock; /* always required */ + struct sockaddr *local; /* NULL if not yet bound */ + struct sockaddr *remote; /* NULL if not connected */ + int family; /* always required (APR_INET, APR_INET6, etc. */ + int type; /* always required (SOCK_STREAM, SOCK_DGRAM, etc. */ +}; + +typedef struct apr_os_sock_info_t apr_os_sock_info_t; + /** * convert the file from apr type to os specific type. * @param thefile The os specific file we are converting to @@ -274,6 +288,20 @@ apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont); +/** + * Create a socket from an existing descriptor and local and remote + * socket addresses. + * @param apr_sock The new socket that has been set up + * @param os_sock_info The os representation of the socket handle and + * other characteristics of the socket + * @param cont The pool to use + * @tip If you only know the descriptor/handle or if it isn't really + * a true socket, use apr_put_os_sock() instead. + */ +apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, + apr_os_sock_info_t *os_sock_info, + apr_pool_t *cont); + /** * Convert the lock from os specific type to apr type * @param lock The apr lock we are converting to. diff --git a/libapr.def b/libapr.def index 485597e3e02..8c0c2b5397b 100644 --- a/libapr.def +++ b/libapr.def @@ -75,6 +75,7 @@ EXPORTS apr_set_socketdata apr_get_polldata apr_set_polldata + apr_make_os_sock apr_put_os_sock apr_get_os_sock apr_remove_poll_socket diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 4c507174203..f8f782ef4af 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -263,7 +263,33 @@ apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) return APR_SUCCESS; } +apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, + apr_os_sock_info_t *os_sock_info, + apr_pool_t *cont) +{ + alloc_socket(apr_sock, cont); + set_socket_vars(*apr_sock, os_sock_info->family); + (*apr_sock)->timeout = -1; + (*apr_sock)->socketdes = *os_sock_info->os_sock; + if (os_sock_info->local) { + memcpy(&(*apr_sock)->local_addr->sa.sin, + os_sock_info->local, + (*apr_sock)->local_addr->salen); + } + else { + (*apr_sock)->local_port_unknown = (*apr_sock)->local_interface_unknown = 1; + } + if (os_sock_info->remote) { + memcpy(&(*apr_sock)->remote_addr->sa.sin, + os_sock_info->remote, + (*apr_sock)->remote_addr->salen); + } + + apr_register_cleanup((*apr_sock)->cntxt, (void *)(*apr_sock), + socket_cleanup, apr_null_cleanup); + return APR_SUCCESS; +} apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 3e055e62ee2..9f4cd6b20ac 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -282,6 +282,37 @@ apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) return APR_SUCCESS; } +apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, + apr_os_sock_info_t *os_sock_info, + apr_pool_t *cont) +{ + alloc_socket(apr_sock, cont); + set_socket_vars(*apr_sock, os_sock_info->family); + (*apr_sock)->timeout = -1; + (*apr_sock)->socketdes = *os_sock_info->os_sock; + if (os_sock_info->local) { + memcpy(&(*apr_sock)->local_addr->sa.sin, + os_sock_info->local, + (*apr_sock)->local_addr->salen); + } + else { + (*apr_sock)->local_port_unknown = (*apr_sock)->local_interface_unknown = 1; + } + if (os_sock_info->remote) { +#ifndef HAVE_POLL + (*apr_sock)->connected = 1; +#endif + memcpy(&(*apr_sock)->remote_addr->sa.sin, + os_sock_info->remote, + (*apr_sock)->remote_addr->salen); + } + + apr_register_cleanup((*apr_sock)->cntxt, (void *)(*apr_sock), + socket_cleanup, apr_null_cleanup); + + return APR_SUCCESS; +} + apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 13df55c11c1..0aed50f27bc 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -305,6 +305,35 @@ apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) return APR_SUCCESS; } +apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, + apr_os_sock_info_t *os_sock_info, + apr_pool_t *cont) +{ + alloc_socket(apr_sock, cont); + set_socket_vars(*apr_sock, os_sock_info->family); + (*apr_sock)->timeout = -1; + (*apr_sock)->disconnected = 0; + (*apr_sock)->sock = *os_sock_info->os_sock; + if (os_sock_info->local) { + memcpy(&(*apr_sock)->local_addr->sa.sin, + os_sock_info->local, + (*apr_sock)->local_addr->salen); + } + else { + (*apr_sock)->local_port_unknown = (*apr_sock)->local_interface_unknown = 1; + } + if (os_sock_info->remote) { + memcpy(&(*apr_sock)->remote_addr->sa.sin, + os_sock_info->remote, + (*apr_sock)->remote_addr->salen); + } + + apr_register_cleanup((*apr_sock)->cntxt, (void *)(*apr_sock), + socket_cleanup, apr_null_cleanup); + + return APR_SUCCESS; +} + apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { From e226552ae5a6c855272bfb20793edc0f1507ddc7 Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" <ake@apache.org> Date: Mon, 4 Dec 2000 19:14:03 +0000 Subject: [PATCH 0903/7878] Get WIN32 building again git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60883 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 2 ++ libapr.def | 2 ++ 2 files changed, 4 insertions(+) diff --git a/aprlib.def b/aprlib.def index 8c0c2b5397b..0c96dc39074 100644 --- a/aprlib.def +++ b/aprlib.def @@ -48,6 +48,8 @@ EXPORTS apr_put_os_file apr_get_os_dir apr_fprintf + apr_lock_file + apr_unlock_file ; ; apr_network_io.h diff --git a/libapr.def b/libapr.def index 8c0c2b5397b..0c96dc39074 100644 --- a/libapr.def +++ b/libapr.def @@ -48,6 +48,8 @@ EXPORTS apr_put_os_file apr_get_os_dir apr_fprintf + apr_lock_file + apr_unlock_file ; ; apr_network_io.h From 3b5bb9a02af47ef9147c5490e44b84c9e40d67af Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 4 Dec 2000 20:39:58 +0000 Subject: [PATCH 0904/7878] Test Makefile.in -> Makefile converter for Win32 ... I'll wrap with a .dsp soonish. I have no issues with using a .pl for apr/test builders, since they are the exception, rather than the typical user. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60884 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.pl | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 test/MakeWin32Make.pl diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl new file mode 100644 index 00000000000..c7e01287861 --- /dev/null +++ b/test/MakeWin32Make.pl @@ -0,0 +1,41 @@ +use IO::File; + +$srcfl = new IO::File "Makefile.in", "r" || die "failed to open .in file"; +$dstfl = new IO::File "Makefile", "w" || die "failed to create Makefile"; + +print $dstfl "LINK=link.exe\n"; + +while ($t = <$srcfl>) { + + if ($t =~ s|\@CFLAGS\@|\/nologo \/MDd \/W3 \/Gm \/GX \/Zi \/Od \/D "_DEBUG" \/D "WIN32" \/D APR_DECLARE_STATIC \/FD|) { + $t =~ s|-g ||; + } + $t =~ s|\@LDFLAGS\@|\/nologo \/debug \/machine:I386|; + + $t =~ s|\@RM\@|del|; + $t =~ s|(\$\(RM\)) -f|$1|; + $t =~ s|\@CC\@|cl|; + $t =~ s|\@RANLIB\@||; + $t =~ s|\@OPTIM\@||; + $t =~ s|\@LIBS\@|kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib|; + $t =~ s|-I\$\(INCDIR\)|\/I "\$\(INCDIR\)"|; + $t =~ s|\.\.\/libapr\.a|\.\./LibD/apr\.lib|; + if ($t =~ s|\@EXEEXT\@|\.exe|) { + $t =~ s|\$\(CC\) \$\(CFLAGS\)|\$\(LINK\) \/subsystem:console|; + $t =~ s|-o (\S+)|\/out:\"$1\"|; + $t =~ s|--export-dynamic ||; + $t =~ s|-fPIC ||; + } + if ($t =~ s|\$\(CC\) -shared|\$\(LINK\) \/subsystem:windows \/dll|) { + $t =~ s|-o (\S+)|\/out:\"$1\"|; + } + while ($t =~ s|\.a\b|\.lib|) {} + while ($t =~ s|\.o\b|\.obj|) {} + while ($t =~ s|\.so\b|\.dll|) {} + + print $dstfl $t; + +} + +undef $srcfl; +undef $dstfl; From d5d3809b38f2a7ca4be0d51f97b9fcbed2472cc1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 4 Dec 2000 22:16:44 +0000 Subject: [PATCH 0905/7878] These should help if users are not building for httpd. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60885 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/cvstodsp5.pl | 43 +++++++++++++++++++++++++++++++++++++++++ helpers/dsp5tocvs.pl | 46 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 helpers/cvstodsp5.pl create mode 100644 helpers/dsp5tocvs.pl diff --git a/helpers/cvstodsp5.pl b/helpers/cvstodsp5.pl new file mode 100644 index 00000000000..d37442735f4 --- /dev/null +++ b/helpers/cvstodsp5.pl @@ -0,0 +1,43 @@ +use IO::File; +use File::Find; + +chdir '..'; +find(\&tovc5, '.'); + +sub tovc5 { + + if (m|.dsp$|) { + $oname = $_; + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $oname, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|Format Version 6\.00|Format Version 5\.00|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD CPP .*)/ZI (.*)|$1/Zi $2|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD BASE CPP .*)/ZI (.*)|$1/Zi $2|) { + $verchg = -1; + } + if ($src !~ m|^# PROP AllowPerConfigDependencies|) { + print $dstfl $src; } + else { + $verchg = -1; + + } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted VC6 project " . $oname . " to VC5 in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } + } +} \ No newline at end of file diff --git a/helpers/dsp5tocvs.pl b/helpers/dsp5tocvs.pl new file mode 100644 index 00000000000..9686b43634b --- /dev/null +++ b/helpers/dsp5tocvs.pl @@ -0,0 +1,46 @@ +use IO::File; +use File::Find; + +chdir '..'; +find(\&tovc6, '.'); + +sub tovc6 { + + if (m|.dsp$|) { + $oname = $_; + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $_, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|Format Version 5\.00|Format Version 6\.00|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD CPP .*)/Zi (.*)|$1/ZI $2|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD BASE CPP .*)/Zi (.*)|$1/ZI $2|) { + $verchg = -1; + } + if ($src =~ s|^(!MESSAGE .*)\\\n|$1|) { + $cont = <$srcfl>; + $src = $src . $cont; + $verchg = -1; + } + print $dstfl $src; + if ($verchg && $src =~ m|^# Begin Project|) { + print $dstfl "# PROP AllowPerConfigDependencies 0\n"; + } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted VC5 project " . $oname . " to VC6 in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } + } +} From cbf93678786e914547faaa7f33e50746dde62ecf Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 4 Dec 2000 22:26:54 +0000 Subject: [PATCH 0906/7878] A brand new (and -greatly- simplified) test build environment for Win32 nmake /f aprtest.win will build the project, it's wrapped by the studio workspace aprtest.dsw for the IDE folks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60886 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 9 +-- test/aprtest.dsp | 98 +++++++++++++++++++++++++++++ test/aprtest.dsw | 44 +++++++++++++ test/aprtest.win | 15 +++++ test/client.dsp | 91 --------------------------- test/htdigest.dsp | 90 -------------------------- test/sendfile.c | 1 - test/server.dsp | 91 --------------------------- test/test.dsw | 131 -------------------------------------- test/testarg.dsp | 92 --------------------------- test/testfile.dsp | 92 --------------------------- test/testmmap.c | 1 - test/testproc.dsp | 91 --------------------------- test/testsig.dsp | 91 --------------------------- test/testsock.dsp | 91 --------------------------- test/testsuite.dsw | 149 -------------------------------------------- test/testthread.dsp | 91 --------------------------- test/testucs.dsp | 93 --------------------------- test/timetest.dsp | 91 --------------------------- 19 files changed, 159 insertions(+), 1293 deletions(-) create mode 100644 test/aprtest.dsp create mode 100644 test/aprtest.dsw create mode 100644 test/aprtest.win delete mode 100644 test/client.dsp delete mode 100644 test/htdigest.dsp delete mode 100644 test/server.dsp delete mode 100644 test/test.dsw delete mode 100644 test/testarg.dsp delete mode 100644 test/testfile.dsp delete mode 100644 test/testproc.dsp delete mode 100644 test/testsig.dsp delete mode 100644 test/testsock.dsp delete mode 100644 test/testsuite.dsw delete mode 100644 test/testthread.dsp delete mode 100644 test/testucs.dsp delete mode 100644 test/timetest.dsp diff --git a/test/Makefile.in b/test/Makefile.in index 84fb00d0f32..2ca26cb346e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -8,8 +8,7 @@ INCDIR=../include INCLUDES=-I$(INCDIR) MKDEP=../helpers/mkdep.sh -TARGETS= testmd5@EXEEXT@ \ - testfile@EXEEXT@ \ +TARGETS= testfile@EXEEXT@ \ testflock@EXEEXT@ \ testproc@EXEEXT@ \ testsock@EXEEXT@ \ @@ -26,8 +25,7 @@ TARGETS= testmd5@EXEEXT@ \ occhild@EXEEXT@ \ mod_test.so -OBJS= testmd5.o \ - testfile.o \ +OBJS= testfile.o \ testflock.o \ testproc.o \ testsock.o \ @@ -47,9 +45,6 @@ OBJS= testmd5.o \ all: $(TARGETS) -testmd5@EXEEXT@: testmd5.o - $(CC) $(CFLAGS) -o testmd5@EXEEXT@ testmd5.o $(LDFLAGS) - testfile@EXEEXT@: testfile.o $(CC) $(CFLAGS) -o testfile@EXEEXT@ testfile.o $(LDFLAGS) diff --git a/test/aprtest.dsp b/test/aprtest.dsp new file mode 100644 index 00000000000..75f138c57e4 --- /dev/null +++ b/test/aprtest.dsp @@ -0,0 +1,98 @@ +# Microsoft Developer Studio Project File - Name="aprtest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) External Target" 0x0106 + +CFG=aprtest - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "aprtest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "aprtest.mak" CFG="aprtest - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "aprtest - Win32 Release" (based on "Win32 (x86) External Target") +!MESSAGE "aprtest - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "aprtest - Win32 Release" + +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Cmd_Line "NMAKE /f Makefile" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "aprtest.exe" +# PROP BASE Bsc_Name "aprtest.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Cmd_Line "NMAKE /f aprtest.win /a" +# PROP Rebuild_Opt "" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "aprtest - Win32 Debug" + +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Cmd_Line "NMAKE /f aprtest.mak" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "aprtest.exe" +# PROP BASE Bsc_Name "aprtest.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Cmd_Line "NMAKE /f aprtest.win /a" +# PROP Rebuild_Opt "" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "aprtest - Win32 Release" +# Name "aprtest - Win32 Debug" + +!IF "$(CFG)" == "aprtest - Win32 Release" + +!ELSEIF "$(CFG)" == "aprtest - Win32 Debug" + +!ENDIF + +# Begin Source File + +SOURCE=.\aprtest.win + +!IF "$(CFG)" == "aprtest - Win32 Release" + +!ELSEIF "$(CFG)" == "aprtest - Win32 Debug" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Makefile.in +# End Source File +# Begin Source File + +SOURCE=.\MakeWin32Make.pl +# End Source File +# End Target +# End Project diff --git a/test/aprtest.dsw b/test/aprtest.dsw new file mode 100644 index 00000000000..a0228e52a53 --- /dev/null +++ b/test/aprtest.dsw @@ -0,0 +1,44 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "aprlib"="..\aprlib.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "aprtest"=".\aprtest.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name aprlib + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/test/aprtest.win b/test/aprtest.win new file mode 100644 index 00000000000..fe343d4aeba --- /dev/null +++ b/test/aprtest.win @@ -0,0 +1,15 @@ +# Note: +# +# You may need to modify the configuration of Build - Options - Directories +# for the Executable path to include the perl interpreter within DevStudio. +# E.g. add c:\program files\perl\bin to the list of directories + +!IF "$(TARGET)" == "" +TARGET=all +!ENDIF + +all: Makefile + $(MAKE) /nologo /f Makefile $(TARGET) + +Makefile: Makefile.in + perl MakeWin32Make.pl diff --git a/test/client.dsp b/test/client.dsp deleted file mode 100644 index c2bed0fe45f..00000000000 --- a/test/client.dsp +++ /dev/null @@ -1,91 +0,0 @@ -# Microsoft Developer Studio Project File - Name="client" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=client - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "client.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "client.mak" CFG="client - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "client - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "client - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "client - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\Release\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\Release\client.exe" - -!ELSEIF "$(CFG)" == "client - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "client__" -# PROP BASE Intermediate_Dir "client__" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "client" -# PROP Intermediate_Dir "client" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_STDIO_H" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\Debug\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\Debug\client.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "client - Win32 Release" -# Name "client - Win32 Debug" -# Begin Source File - -SOURCE=.\client.c -# End Source File -# End Target -# End Project diff --git a/test/htdigest.dsp b/test/htdigest.dsp deleted file mode 100644 index cdb61fae172..00000000000 --- a/test/htdigest.dsp +++ /dev/null @@ -1,90 +0,0 @@ -# Microsoft Developer Studio Project File - Name="htdigest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=htdigest - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "htdigest.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "htdigest.mak" CFG="htdigest - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "htdigest - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "htdigest - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "htdigest - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib ..\locks\win32\Debug\locks.lib ..\network_io\win32\Debug\network_io.lib ..\signal\win32\Debug\signal.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "htdigest - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "htdigest" -# PROP BASE Intermediate_Dir "htdigest" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "htdigest" -# PROP Intermediate_Dir "htdigest" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib ..\locks\win32\Debug\locks.lib ..\network_io\win32\Debug\network_io.lib ..\signal\win32\Debug\signal.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "htdigest - Win32 Release" -# Name "htdigest - Win32 Debug" -# Begin Source File - -SOURCE=.\htdigest.c -# End Source File -# End Target -# End Project diff --git a/test/sendfile.c b/test/sendfile.c index 49eae599a37..81569e49324 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -57,7 +57,6 @@ #include <signal.h> #include <stdlib.h> #include <string.h> -#include <sys/uio.h> #include "apr_network_io.h" #include "apr_errno.h" #include "apr_general.h" diff --git a/test/server.dsp b/test/server.dsp deleted file mode 100644 index 105e92b77dc..00000000000 --- a/test/server.dsp +++ /dev/null @@ -1,91 +0,0 @@ -# Microsoft Developer Studio Project File - Name="server" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=server - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "server.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "server.mak" CFG="server - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "server - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "server - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "server - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\Release\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\Release\server.exe" - -!ELSEIF "$(CFG)" == "server - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "server__" -# PROP BASE Intermediate_Dir "server__" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "server" -# PROP Intermediate_Dir "server" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_STDIO_H" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\Debug\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\Debug\server.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "server - Win32 Release" -# Name "server - Win32 Debug" -# Begin Source File - -SOURCE=.\server.c -# End Source File -# End Target -# End Project diff --git a/test/test.dsw b/test/test.dsw deleted file mode 100644 index af6f6901c60..00000000000 --- a/test/test.dsw +++ /dev/null @@ -1,131 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "ab_apr"=.\ab_apr.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "client"=.\client.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "server"=.\server.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testarg"=.\testarg.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testfile"=.\testfile.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testproc"=.\testproc.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testsock"=.\testsock.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name client - End Project Dependency - Begin Project Dependency - Project_Dep_Name server - End Project Dependency -}}} - -############################################################################### - -Project: "testthread"=.\testthread.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "timetest"=.\timetest.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/test/testarg.dsp b/test/testarg.dsp deleted file mode 100644 index 9fccdc3774c..00000000000 --- a/test/testarg.dsp +++ /dev/null @@ -1,92 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testarg" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=testarg - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testarg.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testarg.mak" CFG="testarg - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testarg - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "testarg - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testarg - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\Release\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\Release\testarg.exe" -# SUBTRACT LINK32 /debug - -!ELSEIF "$(CFG)" == "testarg - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "testarg_" -# PROP BASE Intermediate_Dir "testarg_" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "testarg" -# PROP Intermediate_Dir "testarg" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\Debug\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\Debug\testarg.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testarg - Win32 Release" -# Name "testarg - Win32 Debug" -# Begin Source File - -SOURCE=.\testargs.c -# End Source File -# End Target -# End Project diff --git a/test/testfile.dsp b/test/testfile.dsp deleted file mode 100644 index 97958bbe430..00000000000 --- a/test/testfile.dsp +++ /dev/null @@ -1,92 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testfile" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=testfile - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testfile.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testfile.mak" CFG="testfile - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testfile - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "testfile - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testfile - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\Release\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\Release\testfile.exe" -# SUBTRACT LINK32 /debug - -!ELSEIF "$(CFG)" == "testfile - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\Debug\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\Debug\testfile.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testfile - Win32 Release" -# Name "testfile - Win32 Debug" -# Begin Source File - -SOURCE=.\testfile.c -# End Source File -# End Target -# End Project diff --git a/test/testmmap.c b/test/testmmap.c index 779391c09c5..5248a67ae3f 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -54,7 +54,6 @@ #include <stdio.h> #include <stdlib.h> -#include <unistd.h> #include <string.h> #include "apr_mmap.h" #include "apr_errno.h" diff --git a/test/testproc.dsp b/test/testproc.dsp deleted file mode 100644 index e867b563ff9..00000000000 --- a/test/testproc.dsp +++ /dev/null @@ -1,91 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testproc" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=testproc - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testproc.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testproc.mak" CFG="testproc - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testproc - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "testproc - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testproc - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\Release\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\Release\testproc.exe" - -!ELSEIF "$(CFG)" == "testproc - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "testproc" -# PROP BASE Intermediate_Dir "testproc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "testproc" -# PROP Intermediate_Dir "testproc" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\Debug\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\Debug\testproc.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testproc - Win32 Release" -# Name "testproc - Win32 Debug" -# Begin Source File - -SOURCE=.\testproc.c -# End Source File -# End Target -# End Project diff --git a/test/testsig.dsp b/test/testsig.dsp deleted file mode 100644 index c2ba064f517..00000000000 --- a/test/testsig.dsp +++ /dev/null @@ -1,91 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testsig" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=testsig - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testsig.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testsig.mak" CFG="testsig - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testsig - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "testsig - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testsig - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib ..\locks\win32\Debug\locks.lib ..\network_io\win32\Debug\network_io.lib ..\signal\win32\Debug\signal.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "testsig - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "testsig_" -# PROP BASE Intermediate_Dir "testsig_" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "testsig" -# PROP Intermediate_Dir "testsig" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\lib\Debug\lib.lib ..\misc\win32\Debug\misc.lib ..\threadproc\win32\Debug\threadproc.lib ..\file_io\win32\Debug\file_io.lib ..\time\win32\Debug\time.lib ..\locks\win32\Debug\locks.lib ..\network_io\win32\Debug\network_io.lib ..\signal\win32\Debug\signal.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"ab.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testsig - Win32 Release" -# Name "testsig - Win32 Debug" -# Begin Source File - -SOURCE=.\testsig.c -# End Source File -# End Target -# End Project diff --git a/test/testsock.dsp b/test/testsock.dsp deleted file mode 100644 index 74293b6e350..00000000000 --- a/test/testsock.dsp +++ /dev/null @@ -1,91 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testsock" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=testsock - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testsock.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testsock.mak" CFG="testsock - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testsock - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "testsock - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testsock - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\Release\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\Release\testsock.exe" - -!ELSEIF "$(CFG)" == "testsock - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "testsock" -# PROP BASE Intermediate_Dir "testsock" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "testsock" -# PROP Intermediate_Dir "testsock" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\Debug\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\Debug\testsock.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testsock - Win32 Release" -# Name "testsock - Win32 Debug" -# Begin Source File - -SOURCE=.\testsock.c -# End Source File -# End Target -# End Project diff --git a/test/testsuite.dsw b/test/testsuite.dsw deleted file mode 100644 index fb5557c8698..00000000000 --- a/test/testsuite.dsw +++ /dev/null @@ -1,149 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "aprlib"="..\aprlib.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testarg"=".\testarg.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name aprlib - End Project Dependency -}}} - -############################################################################### - -Project: "testfile"=".\testfile.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name aprlib - End Project Dependency -}}} - -############################################################################### - -Project: "testproc"=".\testproc.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name aprlib - End Project Dependency -}}} - -############################################################################### - -Project: "testsig"=".\testsig.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name aprlib - End Project Dependency -}}} - -############################################################################### - -Project: "testsock"=".\testsock.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name aprlib - End Project Dependency -}}} - -############################################################################### - -Project: "testthread"=".\testthread.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name aprlib - End Project Dependency -}}} - -############################################################################### - -Project: "testucs"=".\testucs.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name aprlib - End Project Dependency -}}} - -############################################################################### - -Project: "timetest"=".\timetest.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name aprlib - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/test/testthread.dsp b/test/testthread.dsp deleted file mode 100644 index b5d05db3db7..00000000000 --- a/test/testthread.dsp +++ /dev/null @@ -1,91 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testthread" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=testthread - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testthread.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testthread.mak" CFG="testthread - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testthread - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "testthread - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testthread - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\Release\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\Release\testthread.exe" - -!ELSEIF "$(CFG)" == "testthread - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\Debug\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\Debug\testthread.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testthread - Win32 Release" -# Name "testthread - Win32 Debug" -# Begin Source File - -SOURCE=.\testthread.c -# End Source File -# End Target -# End Project diff --git a/test/testucs.dsp b/test/testucs.dsp deleted file mode 100644 index b5421cc0a10..00000000000 --- a/test/testucs.dsp +++ /dev/null @@ -1,93 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testucs" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=testucs - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testucs.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testucs.mak" CFG="testucs - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testucs - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "testucs - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testucs - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\include" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "APR_DECLARE_SYMBOLS" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:".\testucs.exe" -# SUBTRACT LINK32 /debug - -!ELSEIF "$(CFG)" == "testucs - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "testucs_" -# PROP BASE Intermediate_Dir "testucs_" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "testucs" -# PROP Intermediate_Dir "testucs" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "APR_DECLARE_SYMBOLS" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:".\testucs.exe" /pdbtype:sept -# SUBTRACT LINK32 /incremental:no - -!ENDIF - -# Begin Target - -# Name "testucs - Win32 Release" -# Name "testucs - Win32 Debug" -# Begin Source File - -SOURCE=.\testucs.c -# End Source File -# End Target -# End Project diff --git a/test/timetest.dsp b/test/timetest.dsp deleted file mode 100644 index 367149d85ce..00000000000 --- a/test/timetest.dsp +++ /dev/null @@ -1,91 +0,0 @@ -# Microsoft Developer Studio Project File - Name="timetest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=timetest - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "timetest.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "timetest.mak" CFG="timetest - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "timetest - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "timetest - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "timetest - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\Release\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\Release\timetest.exe" - -!ELSEIF "$(CFG)" == "timetest - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "timetest" -# PROP BASE Intermediate_Dir "timetest" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "timetest" -# PROP Intermediate_Dir "timetest" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\Debug\aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\Debug\timetest.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "timetest - Win32 Release" -# Name "timetest - Win32 Debug" -# Begin Source File - -SOURCE=.\testtime.c -# End Source File -# End Target -# End Project From 392ad09c157bc48eafb8b6d0ee572d149fa4ccd0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 4 Dec 2000 22:59:58 +0000 Subject: [PATCH 0907/7878] Build even if the platform doesn't support mmap. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60887 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmmap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/testmmap.c b/test/testmmap.c index 5248a67ae3f..97eb641662d 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -68,6 +68,7 @@ int main(void) { +#if APR_HAS_MMAP apr_pool_t *context; apr_mmap_t *themmap = NULL; apr_file_t *thefile = NULL; @@ -131,4 +132,9 @@ int main(void) fprintf (stdout,"\nTest Complete\n"); return 1; +#else + fprintf(stdout,"APR MMAP Test\n*************\n\n"); + fprintf(stdout,"Failed! APR was not built with MMAP.\n"); + return -1; +#endif } From 4a845301efe92f0dba7bc897276775a2263b389a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 4 Dec 2000 23:42:09 +0000 Subject: [PATCH 0908/7878] Win32 apr.hw back in line with apr.h.in, and reordered for consistency between these files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60888 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- include/apr.h.in | 6 ++-- include/apr.hw | 86 ++++++++++++++++++++++++++++----------------- include/apr_shmem.h | 9 +++-- 4 files changed, 62 insertions(+), 41 deletions(-) diff --git a/configure.in b/configure.in index c5905a42c1c..b89f8479910 100644 --- a/configure.in +++ b/configure.in @@ -285,7 +285,7 @@ AC_CHECK_HEADERS(sys/time.h) AC_CHECK_HEADERS(tpfeq.h) AC_CHECK_HEADERS(tpfio.h) AC_CHECK_HEADERS(sys/uio.h, sys_uioh="1", sys_uioh="0") -AC_CHECK_HEADERS(unistd.h) +AC_CHECK_HEADERS(unistd.h, unistdh="1", unistdh="0") AC_CHECK_HEADERS(poll.h) AC_CHECK_HEADERS(sys/poll.h) AC_CHECK_HEADERS(unix.h) diff --git a/include/apr.h.in b/include/apr.h.in index 1106dbdc713..3d5b71249a1 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -25,8 +25,8 @@ #endif #define APR_HAVE_CTYPE_H @ctypeh@ -#define APR_HAVE_ERRNO_H @errnoh@ #define APR_HAVE_DIRENT_H @direnth@ +#define APR_HAVE_ERRNO_H @errnoh@ #define APR_HAVE_FCNTL_H @fcntlh@ #define APR_HAVE_NETINET_IN_H @netinet_inh@ #define APR_HAVE_PTHREAD_H @pthreadh@ @@ -37,6 +37,7 @@ #define APR_HAVE_SYS_UIO_H @sys_uioh@ #define APR_HAVE_SIGNAL_H @signalh@ #define APR_HAVE_SYS_WAIT_H @sys_waith@ +#define APR_HAVE_UNISTD_H @unistdh@ #define APR_USE_FLOCK_SERIALIZE @flockser@ #define APR_USE_SYSVSEM_SERIALIZE @sysvser@ @@ -216,9 +217,6 @@ Sigfunc *apr_signal(int signo, Sigfunc * func); #ifdef WEXITSTATUS #define apr_wait_t int #else -/* We don't have a POSIX wait interface. Assume we have the old-style. Is this - * a bad assumption? */ -/* Yessiree bob, it was... but will this work instead? */ #define apr_wait_t union wait #define WEXITSTATUS(status) (int)((status).w_retcode) #define WTERMSIG(status) (int)((status).w_termsig) diff --git a/include/apr.hw b/include/apr.hw index ac05e50905a..335438a2cec 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -113,25 +113,22 @@ #define __attribute__(__x) #define ENUM_BITFIELD(e,n,w) signed int n : w -#define APR_HAVE_ERRNO_H 1 +#define NO_USE_SIGACTION + +#define APR_HAVE_CTYPE_H 1 #define APR_HAVE_DIRENT_H 0 +#define APR_HAVE_ERRNO_H 1 #define APR_HAVE_FCNTL_H 0 #define APR_HAVE_NETINET_IN_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_STDARG_H 1 #define APR_HAVE_STDIO_H 1 +#define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 0 -#define APR_HAVE_IN_ADDR 1 -#define APR_HAVE_INET_ADDR 1 - -#define APR_HAVE_MEMMOVE 1 -#define APR_HAVE_STRCASECMP 0 -#define APR_HAVE_STRICMP 1 -#define APR_HAVE_STRNCASECMP 0 -#define APR_HAVE_STRNICMP 1 -#define APR_HAVE_STRDUP 1 -#define APR_HAVE_STRSTR 1 +#define APR_HAVE_SIGNAL_H 0 +#define APR_HAVE_SYS_WAIT_H 0 +#define APR_HAVE_UNISTD_H 0 #define APR_USE_FLOCK_SERIALIZE 0 #define APR_USE_SYSVSEM_SERIALIZE 0 @@ -141,28 +138,47 @@ #define APR_PROCESS_LOCK_IS_GLOBAL 0 -#define NO_USE_SIGACTION +#define APR_USES_ANONYMOUS_SHM 0 +#define APR_USES_FILEBASED_SHM 0 +#define APR_USES_KEYBASED_SHM 0 + +#define APR_FILE_BASED_SHM 0 +#define APR_MEM_BASED_SHM 0 + +#define APR_HAVE_IN_ADDR 1 +#define APR_HAVE_INET_ADDR 1 +#define APR_HAVE_INET_NETWORK 0 +#define APR_HAVE_UNION_SEMUN 0 +#define APR_HAVE_STRUCT_RLIMIT 0 +#define APR_HAVE_SETRLIMIT 0 +#define APR_HAVE_GETRLIMIT 0 +#define APR_HAVE_STRICMP 1 +#define APR_HAVE_STRNICMP 1 +#define APR_HAVE_STRCASECMP 0 +#define APR_HAVE_STRNCASECMP 0 +#define APR_HAVE_STRDUP 1 +#define APR_HAVE_STRSTR 1 +#define APR_HAVE_MEMMOVE 1 +#define APR_HAVE_BZERO 0 +#define APR_HAVE_IPV6 0 + #if APR_HAVE_SYS_TYPES_H #include <sys/types.h> #endif /* APR Feature Macros */ -#define APR_HAS_THREADS 1 -#define APR_HAS_SENDFILE 1 -#define APR_HAS_RANDOM 1 -#define APR_HAS_DSO 1 - -#define APR_HAS_MMAP 0 -#define APR_HAS_XLATE 0 - -/* - * XXX: Problem - while this may be an NT build - so we are experimenting - * but if we have problems, please feel free to revert to 0. - */ -#define APR_HAS_UNICODE_FS 1 - -#define APR_HAS_USER 0 +#define APR_HAS_SHARED_MEMORY 0 +#define APR_HAS_THREADS 1 +#define APR_HAS_SENDFILE 1 +#define APR_HAS_MMAP 0 +#define APR_HAS_FORK 0 +#define APR_HAS_RANDOM 1 +#define APR_HAS_XLATE 0 +#define APR_HAS_OTHER_CHILD 0 +#define APR_HAS_DSO 1 +#define APR_HAS_UNICODE_FS 1 +#define APR_HAS_USER 0 /* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE * on all platforms. @@ -189,13 +205,8 @@ typedef int uid_t; typedef int gid_t; /* Definitions that APR programs need to work properly. */ -#define APR_SSIZE_T_FMT "d" -#define APR_SIZE_T_FMT "d" -#define APR_THREAD_FUNC __stdcall -#define APR_OFF_T_FMT "ld" -/* Local machine definition for console and log output. */ -#define APR_EOL_STR "\r\n" +#define APR_THREAD_FUNC __stdcall /** * APR_DECLARE_EXPORT is defined when building the APR dynamic library, @@ -249,6 +260,15 @@ typedef int gid_t; #define APR_DECLARE_DATA __declspec(dllimport) #endif +#define APR_SSIZE_T_FMT "d" + +#define APR_SIZE_T_FMT "d" + +#define APR_OFF_T_FMT "ld" + +/* Local machine definition for console and log output. */ +#define APR_EOL_STR "\r\n" + #define apr_signal(a,b) signal(a,b) typedef int apr_wait_t; diff --git a/include/apr_shmem.h b/include/apr_shmem.h index 787e889e9e4..75023869e7c 100644 --- a/include/apr_shmem.h +++ b/include/apr_shmem.h @@ -67,12 +67,15 @@ extern "C" { #endif /* __cplusplus */ -#if APR_USES_ANONYMOUS_SHM -typedef void apr_shm_name_t; -#elif APR_USES_FILEBASED_SHM +#if APR_USES_FILEBASED_SHM typedef char * apr_shm_name_t; #elif APR_USES_KEYBASED_SHM typedef key_t apr_shm_name_t; +#else +/* If APR_USES_ANONYMOUS_SHM or any other case... + * we can't leave apr_shm_name_t entirely undefined. + */ +typedef void apr_shm_name_t; #endif typedef struct shmem_t apr_shmem_t; From 17b4a0684d1566704d0ae9c9e1d895eb8c4f24de Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 4 Dec 2000 23:50:40 +0000 Subject: [PATCH 0909/7878] Is it my imagination, or was this badness? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60889 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.h.in b/include/apr.h.in index 3d5b71249a1..5a3a20884c9 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -209,7 +209,7 @@ Sigfunc *apr_signal(int signo, Sigfunc * func); #define apr_signal(a,b) signal(a,b) #endif -#ifdef APR_HAVE_SYS_WAIT_H +#if APR_HAVE_SYS_WAIT_H /* We have a POSIX wait interface */ #include <sys/wait.h> From daa168fdf8221e535cff0c0cc18e138b6ceb23d1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 5 Dec 2000 00:11:24 +0000 Subject: [PATCH 0910/7878] Fix some build depends/targets for make clean. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60890 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 2ca26cb346e..7f6a6ceacac 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -8,7 +8,10 @@ INCDIR=../include INCLUDES=-I$(INCDIR) MKDEP=../helpers/mkdep.sh -TARGETS= testfile@EXEEXT@ \ +TARGETS= client@EXEEXT@ \ + sendfile@EXEEXT@ \ + server@EXEEXT@ \ + testfile@EXEEXT@ \ testflock@EXEEXT@ \ testproc@EXEEXT@ \ testsock@EXEEXT@ \ @@ -22,7 +25,7 @@ TARGETS= testfile@EXEEXT@ \ testdso@EXEEXT@ \ testoc@EXEEXT@ \ testuuid@EXEEXT@ \ - occhild@EXEEXT@ \ + occhild.so \ mod_test.so OBJS= testfile.o \ @@ -75,10 +78,16 @@ testproc@EXEEXT@: testproc.o testthread@EXEEXT@: testthread.o $(CC) $(CFLAGS) -o testthread@EXEEXT@ testthread.o $(LDFLAGS) -testsock@EXEEXT@: testsock.o client.o server.o sendfile.o +testsock@EXEEXT@: testsock.o client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ $(CC) $(CFLAGS) -o testsock@EXEEXT@ testsock.o $(LDFLAGS) + +client@EXEEXT@: client.o $(CC) $(CFLAGS) -o server@EXEEXT@ server.o $(LDFLAGS) + +server@EXEEXT@: server.o sendfile.o $(CC) $(CFLAGS) -o client@EXEEXT@ client.o $(LDFLAGS) + +sendfile@EXEEXT@: sendfile.o $(CC) $(CFLAGS) -o sendfile@EXEEXT@ sendfile.o $(LDFLAGS) testtime@EXEEXT@: testtime.o @@ -97,7 +106,7 @@ testuuid@EXEEXT@: testuuid.o $(CC) $(CFLAGS) -o testuuid@EXEEXT@ testuuid.o $(LDFLAGS) clean: - $(RM) -f *.o *.a *.so $(TARGETS) testflock.tmp + $(RM) -f *.o *.a $(TARGETS) testflock.tmp distclean: clean -$(RM) -f Makefile From 26869b317f4defaa298c5e3efc2be99a3501ff20 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 5 Dec 2000 00:12:33 +0000 Subject: [PATCH 0911/7878] Fixing up the test project git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60891 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.pl | 7 +++- test/aprtest.dsp | 89 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 90 insertions(+), 6 deletions(-) diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl index c7e01287861..4d95511ee8a 100644 --- a/test/MakeWin32Make.pl +++ b/test/MakeWin32Make.pl @@ -13,11 +13,14 @@ $t =~ s|\@LDFLAGS\@|\/nologo \/debug \/machine:I386|; $t =~ s|\@RM\@|del|; - $t =~ s|(\$\(RM\)) -f|$1|; + if ($t =~ s|(\$\(RM\)) -f|$1|) { + $t =~ s|\*\.a|\*\.lib \*\.exp \*\.idb \*\.ilk \*\.pdb|; + $t =~ s|(Makefile)|$1 \*\.ncb \*\.opt|; + } $t =~ s|\@CC\@|cl|; $t =~ s|\@RANLIB\@||; $t =~ s|\@OPTIM\@||; - $t =~ s|\@LIBS\@|kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib|; + $t =~ s|\@LIBS\@|kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib|; $t =~ s|-I\$\(INCDIR\)|\/I "\$\(INCDIR\)"|; $t =~ s|\.\.\/libapr\.a|\.\./LibD/apr\.lib|; if ($t =~ s|\@EXEEXT\@|\.exe|) { diff --git a/test/aprtest.dsp b/test/aprtest.dsp index 75f138c57e4..f562131f7b4 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -75,16 +75,97 @@ CFG=aprtest - Win32 Debug !ENDIF +# Begin Group "Sources" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\aprtest.win +SOURCE=.\abc.c +# End Source File +# Begin Source File -!IF "$(CFG)" == "aprtest - Win32 Release" +SOURCE=.\client.c +# End Source File +# Begin Source File -!ELSEIF "$(CFG)" == "aprtest - Win32 Debug" +SOURCE=.\mod_test.c +# End Source File +# Begin Source File -!ENDIF +SOURCE=.\occhild.c +# End Source File +# Begin Source File +SOURCE=.\sendfile.c +# End Source File +# Begin Source File + +SOURCE=.\server.c +# End Source File +# Begin Source File + +SOURCE=.\testargs.c +# End Source File +# Begin Source File + +SOURCE=.\testcontext.c +# End Source File +# Begin Source File + +SOURCE=.\testdso.c +# End Source File +# Begin Source File + +SOURCE=.\testfile.c +# End Source File +# Begin Source File + +SOURCE=.\testflock.c +# End Source File +# Begin Source File + +SOURCE=.\testmmap.c +# End Source File +# Begin Source File + +SOURCE=.\testoc.c +# End Source File +# Begin Source File + +SOURCE=.\testpipe.c +# End Source File +# Begin Source File + +SOURCE=.\testproc.c +# End Source File +# Begin Source File + +SOURCE=.\testshmem.c +# End Source File +# Begin Source File + +SOURCE=.\testsock.c +# End Source File +# Begin Source File + +SOURCE=.\testthread.c +# End Source File +# Begin Source File + +SOURCE=.\testtime.c +# End Source File +# Begin Source File + +SOURCE=.\testucs.c +# End Source File +# Begin Source File + +SOURCE=.\testuuid.c +# End Source File +# End Group +# Begin Source File + +SOURCE=.\aprtest.win # End Source File # Begin Source File From 7967852738806ad85dfb8b2cf2f92bbf3fa07379 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 5 Dec 2000 00:14:12 +0000 Subject: [PATCH 0912/7878] Make every test source build - regardless of missing apr features. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60892 13f79535-47bb-0310-9956-ffa450edef68 --- test/occhild.c | 3 +++ test/testdso.c | 2 ++ test/testoc.c | 7 +++++++ test/testshmem.c | 8 ++++++++ 4 files changed, 20 insertions(+) diff --git a/test/occhild.c b/test/occhild.c index fec8c49caaa..05df4ae7d22 100644 --- a/test/occhild.c +++ b/test/occhild.c @@ -1,5 +1,8 @@ +#include "apr.h" #include <stdio.h> +#if APR_HAVE_UNISTD_H #include <unistd.h> +#endif #include <stdlib.h> int main(void) diff --git a/test/testdso.c b/test/testdso.c index d0e3b814c5f..3376b5ac80c 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -5,7 +5,9 @@ #include <string.h> #include <stdlib.h> #include <stdio.h> +#if APR_HAVE_UNISTD_H #include <unistd.h> +#endif #define LIB_NAME "mod_test.so" diff --git a/test/testoc.c b/test/testoc.c index 5284e14e9f9..6c4ac6971bc 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -64,6 +64,7 @@ #include <unistd.h> #endif +#if APR_HAS_OTHER_CHILD static void ocmaint(int reason, void *data, int status) { fprintf(stdout,"[CHILD] Maintenance routine called...."); @@ -82,9 +83,11 @@ static void ocmaint(int reason, void *data, int status) break; } } +#endif int main(int argc, char *argv[]) { +#if APR_HAS_OTHER_CHILD apr_pool_t *context; apr_proc_t newproc; apr_procattr_t *procattr = NULL; @@ -150,5 +153,9 @@ int main(int argc, char *argv[]) apr_check_other_child(); return 1; +#else + fprintf(stdout, "OC failed!\n"); + fprintf(stdout, "Other_child is not supported on this platform\n"); +#endif } diff --git a/test/testshmem.c b/test/testshmem.c index a936b5074b6..f88062ad94a 100644 --- a/test/testshmem.c +++ b/test/testshmem.c @@ -63,7 +63,9 @@ #include <stdio.h> #include <stdlib.h> /*#include <process.h>*/ +#if APR_HAVE_UNISTD_H #include <unistd.h> +#endif typedef struct mbox { char msg[1024]; @@ -92,6 +94,7 @@ static void msgput(int boxnum, char *msg) int main(void) { +#if APR_HAS_SHARED_MEMORY apr_shmem_t *shm; pid_t pid; int size; @@ -143,4 +146,9 @@ int main(void) fprintf(stderr, "Error creating a child process\n"); exit(1); } +#else + fprintf(stdout, "APR SHMEM test failed!\n"); + fprintf(stdout, "shmem is not supported on this platform\n"); + return (-1); +#endif } From f6392119ac92e4f5122a5a2f6a9e70abfa951953 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 5 Dec 2000 00:14:59 +0000 Subject: [PATCH 0913/7878] More goodness for win32 to accomodate msvc badness git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60893 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/apr.hw b/include/apr.hw index 335438a2cec..1957894f6c5 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -278,5 +278,11 @@ struct iovec { char* iov_base; int iov_len; }; + +/* Nasty Win32 .h ommissions we really need */ +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 + #endif /* APR_H */ #endif /* WIN32 */ From 60d742d537cb207c1fc268f5e3974dfb7676901c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 5 Dec 2000 00:16:19 +0000 Subject: [PATCH 0914/7878] My imagination, or was this a bad thing? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60894 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/otherchild.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index e12729b2bfc..0bc8629a393 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -62,7 +62,7 @@ #ifdef HAVE_SYS_SELECT_H #include <sys/select.h> #endif -#ifdef APR_HAVE_SYS_WAIT_H +#if APR_HAVE_SYS_WAIT_H #include <sys/wait.h> #endif #ifdef BEOS From cff8872c5b733d85bf8f22410782d8f0a32ea0a1 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Tue, 5 Dec 2000 14:55:16 +0000 Subject: [PATCH 0915/7878] Handle nested macros properly when generating export list. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60895 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/make_export.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helpers/make_export.pl b/helpers/make_export.pl index 461fab93e05..7f2be693181 100755 --- a/helpers/make_export.pl +++ b/helpers/make_export.pl @@ -18,6 +18,7 @@ my $line; my $count; my $found; + my @macro_stack; open (FILE, $srcfile) || die "Can't open $srcfile\n"; # print STDERR "Reading \"$srcfile\"\n"; @@ -34,6 +35,7 @@ if (/\#if(def)? (APR_.*)/) { $count++; $found++; + push @macro_stack, $macro; $macro = $2; $line .= "$macro\n"; next; @@ -54,6 +56,7 @@ if ($count > 0) { $count--; $line .= "\/$macro\n"; + $macro = pop @macro_stack; } if ($found == $count + 1) { $found--; From 21a39625ae93eeead007725c2c9f4eb3922c3aa6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 5 Dec 2000 22:08:38 +0000 Subject: [PATCH 0916/7878] Eliminate apr_canonical_error as an apr symbol ... it still exists as the helper to apr_os_strerror for OS2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60896 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 1 - include/apr_compat.h | 1 - include/apr_errno.h | 8 ----- libapr.def | 1 - misc/unix/canonerr.c | 69 ------------------------------------------ misc/unix/errorcodes.c | 2 ++ 6 files changed, 2 insertions(+), 80 deletions(-) delete mode 100644 misc/unix/canonerr.c diff --git a/aprlib.def b/aprlib.def index 0c96dc39074..04efde19f04 100644 --- a/aprlib.def +++ b/aprlib.def @@ -230,7 +230,6 @@ EXPORTS apr_collapse_spaces apr_month_snames apr_day_snames - apr_canonical_error apr_strerror apr_generate_random_bytes apr_strnatcmp diff --git a/include/apr_compat.h b/include/apr_compat.h index 7e8a82a1b96..c9d1dd76b8e 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -45,7 +45,6 @@ #define ap_os_dso_unload apr_dso_unload #define ap_os_dso_sym apr_dso_sym #define ap_os_dso_error apr_dso_error -#define ap_os_error_message apr_canonical_error #define ap_os_kill apr_kill #define ap_overlap_tables apr_overlap_tables #define ap_overlay_tables apr_overlay_tables diff --git a/include/apr_errno.h b/include/apr_errno.h index 6a5ebf084fa..1b276f2e7f1 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -74,14 +74,6 @@ extern "C" { */ typedef int apr_status_t; -/** - * Convert an APR error to a canonical error - * @param err The APR error value - * @return The canonical error value - * @tip see apr/APRDesgin for an explanation of why this is necessary. - */ -int apr_canonical_error(apr_status_t err); - /** * Return a human readable string describing the specified error. * @param statcode The error code the get a string for. diff --git a/libapr.def b/libapr.def index 0c96dc39074..04efde19f04 100644 --- a/libapr.def +++ b/libapr.def @@ -230,7 +230,6 @@ EXPORTS apr_collapse_spaces apr_month_snames apr_day_snames - apr_canonical_error apr_strerror apr_generate_random_bytes apr_strnatcmp diff --git a/misc/unix/canonerr.c b/misc/unix/canonerr.c deleted file mode 100644 index 15f83fabbf3..00000000000 --- a/misc/unix/canonerr.c +++ /dev/null @@ -1,69 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "misc.h" - -#ifndef OS2 - -int apr_canonical_error(apr_status_t errcode) -{ -#if defined(EAGAIN) && defined(EWOULDBLOCK) && (EAGAIN != EWOULDBLOCK) && !defined(WIN32) - if (errcode == EWOULDBLOCK) { - errcode = EAGAIN; - } -#endif - return errcode; -} - -#endif diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 4edeb27e3ea..a454ada4fb6 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -164,6 +164,8 @@ static char *apr_error_string(apr_status_t statcode) #include <os2.h> #include <ctype.h> +int apr_canonical_error(apr_status_t err); + static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) { char result[200]; From 2caca8432044856666fed841c2f295c810933e09 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 5 Dec 2000 22:57:48 +0000 Subject: [PATCH 0917/7878] Remove canonerr.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60897 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index edcccfdf69c..ec50abb0ede 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -10,7 +10,7 @@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) MKDEP=../../helpers/mkdep.sh -OBJS=start.o getopt.o otherchild.o errorcodes.o rand.o canonerr.o \ +OBJS=start.o getopt.o otherchild.o errorcodes.o rand.o \ uuid.o getuuid.o .c.o: From f34c181d419b73501468cb19f1373a3064965225 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 5 Dec 2000 22:58:31 +0000 Subject: [PATCH 0918/7878] Cleaning up what I broke, and then a bit more. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60898 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ---- aprlib.dsp | 4 ---- 2 files changed, 8 deletions(-) diff --git a/apr.dsp b/apr.dsp index 55061af9a86..b55b4a6ac55 100644 --- a/apr.dsp +++ b/apr.dsp @@ -160,10 +160,6 @@ SOURCE=.\tables\apr_tables.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\misc\unix\canonerr.c -# End Source File -# Begin Source File - SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File diff --git a/aprlib.dsp b/aprlib.dsp index 55061af9a86..b55b4a6ac55 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -160,10 +160,6 @@ SOURCE=.\tables\apr_tables.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\misc\unix\canonerr.c -# End Source File -# Begin Source File - SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File From 5ae02f0f6a09b0278471a4d332d246f45a2afdca Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 5 Dec 2000 23:15:04 +0000 Subject: [PATCH 0919/7878] Check more carefully for getaddrinfo(). Accept those that require <netdb.h> to be included (e.g., Tru64). Reject those that fail a very basic operational test (e.g., AIX). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60899 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ aclocal.m4 | 44 ++++++++++++++++++++++++++++++++++++++++++++ configure.in | 2 +- 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8cae6c51e9d..c24e46d3d11 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR a9 + *) Check more carefully for getaddrinfo(). Accept those that + require <netdb.h> to be included (e.g., Tru64). Reject those that + fail a very basic operational test (e.g., AIX). [Jeff Trawick] + *) Add apr_make_os_sock() for constructing a fully-capable APR socket. [Jeff Trawick] diff --git a/aclocal.m4 b/aclocal.m4 index 9c0951d2490..624bf33398b 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -185,6 +185,50 @@ undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl ]) +dnl +dnl check for working getaddrinfo() +dnl + +AC_DEFUN(APR_CHECK_WORKING_GETADDRINFO,[ + AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[ + AC_TRY_RUN( [ +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif + +void main(void) { + struct addrinfo hints, *ai; + int error; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo("127.0.0.1", "8080", &hints, &ai); + if (error) { + exit(1); + } + else { + exit(0); + } +} +],[ + ac_cv_working_getaddrinfo="yes" +],[ + ac_cv_working_getaddrinfo="no" +],[ + ac_cv_working_getaddrinfo="yes" +])]) +if test "$ac_cv_working_getaddrinfo" = "yes"; then + AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works well enough for APR]) +fi +]) + dnl dnl check for gethostbyname() which handles numeric address strings dnl diff --git a/configure.in b/configure.in index b89f8479910..942e4ca1b6d 100644 --- a/configure.in +++ b/configure.in @@ -757,7 +757,7 @@ APR_CHECK_GETHOSTBYNAME_NAS echo $ac_n "${nl}Checking for IPv6 Networking support...${nl}" dnl # Start of checking for IPv6 support... AC_SEARCH_LIBS(getaddrinfo, inet6) -AC_CHECK_FUNCS(getaddrinfo) +APR_CHECK_WORKING_GETADDRINFO AC_CHECK_FUNCS(getipnodebyname) AC_CHECK_FUNCS(getipnodebyaddr) APR_CHECK_SOCKADDR_IN6 From 1ad174d7f6fda0ccd52e4d263440cbf7b7114487 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 6 Dec 2000 13:08:27 +0000 Subject: [PATCH 0920/7878] change #if HAVE_xyz_H to #ifdef_xyz_H for consistency git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60900 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 624bf33398b..a868e242cf4 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -236,19 +236,19 @@ dnl AC_DEFUN(APR_CHECK_GETHOSTBYNAME_NAS,[ AC_CACHE_CHECK(for gethostbyname() which handles numeric address strings, ac_cv_gethostbyname_nas,[ AC_TRY_RUN( [ -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif -#if HAVE_NETINET_IN_H +#ifdef HAVE_NETINET_IN_H #include <netinet/in.h> #endif -#if HAVE_ARPA_INET_H +#ifdef HAVE_ARPA_INET_H #include <arpa/inet.h> #endif -#if HAVE_NETDB_H +#ifdef HAVE_NETDB_H #include <netdb.h> #endif -#if HAVE_STDLIB_H +#ifdef HAVE_STDLIB_H #include <stdlib.h> #endif void main(void) { From d9be413a5767fdd274857ad09d375544a474b4ca Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 6 Dec 2000 19:09:45 +0000 Subject: [PATCH 0921/7878] Fix the APR_HAVE_UNISTD_H symbol. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60901 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index 942e4ca1b6d..9ddd4d3926e 100644 --- a/configure.in +++ b/configure.in @@ -320,6 +320,7 @@ AC_SUBST(stdioh) AC_SUBST(sys_socketh) AC_SUBST(sys_typesh) AC_SUBST(sys_uioh) +AC_SUBST(unistdh) AC_SUBST(signalh) AC_SUBST(sys_waith) AC_SUBST(pthreadh) From 92eed962c1556007e28e7ea3184b9a8bedc721d6 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 6 Dec 2000 19:40:41 +0000 Subject: [PATCH 0922/7878] fix apr_get_userdata(): return NULL if the userdata hash table isn't there git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60902 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/misc/unix/start.c b/misc/unix/start.c index e9eedb3d819..d589d2777ad 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -91,7 +91,7 @@ apr_status_t apr_set_userdata(const void *data, const char *key, { int keylen = strlen(key); - if (!cont->prog_data) + if (cont->prog_data == NULL) cont->prog_data = apr_make_hash(cont); if (apr_hash_get(cont->prog_data, key, keylen) == NULL){ @@ -108,7 +108,10 @@ apr_status_t apr_set_userdata(const void *data, const char *key, apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) { - (*data) = apr_hash_get(cont->prog_data, key, strlen(key)); + if (cont->prog_data == NULL) + *data = NULL; + else + *data = apr_hash_get(cont->prog_data, key, strlen(key)); return APR_SUCCESS; } From 97a90419595c57b4bd38bb97094df59087374ffa Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 6 Dec 2000 19:47:13 +0000 Subject: [PATCH 0923/7878] toss datastruct. no longer used. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60903 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/misc.h | 23 ++++++++++------------- include/arch/win32/misc.h | 23 ++++++++++------------- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index e0ce1d050ab..7ec92b124f9 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -64,31 +64,28 @@ #include "apr_file_io.h" #include "apr_errno.h" #include "apr_getopt.h" -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif + #if APR_HAVE_STDIO_H #include <stdio.h> #endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif #if APR_HAVE_SIGNAL_H #include <signal.h> #endif #if APR_HAVE_PTHREAD_H #include <pthread.h> #endif + +/* ### create APR_HAVE_* macros for these? */ +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif + #ifdef BEOS #include <kernel/OS.h> #endif - -typedef struct datastruct { - const void *data; - const char *key; - struct datastruct *next; - struct datastruct *prev; -} datastruct; struct apr_other_child_rec_t { struct apr_other_child_rec_t *next; diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index e0ce1d050ab..7ec92b124f9 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -64,31 +64,28 @@ #include "apr_file_io.h" #include "apr_errno.h" #include "apr_getopt.h" -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif + #if APR_HAVE_STDIO_H #include <stdio.h> #endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif #if APR_HAVE_SIGNAL_H #include <signal.h> #endif #if APR_HAVE_PTHREAD_H #include <pthread.h> #endif + +/* ### create APR_HAVE_* macros for these? */ +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif + #ifdef BEOS #include <kernel/OS.h> #endif - -typedef struct datastruct { - const void *data; - const char *key; - struct datastruct *next; - struct datastruct *prev; -} datastruct; struct apr_other_child_rec_t { struct apr_other_child_rec_t *next; From 21b68ae4a4aed1ba6497cadc98e42a344b827bb8 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 6 Dec 2000 19:53:42 +0000 Subject: [PATCH 0924/7878] *) remove include of sys/ipc.h and uslocks.h. the HAVE_ symbols were never declared anywhere, so these couldn't have been getting included anyway. *) reorg headers into two groups: those with corresponding APR_HAVE_ symbols, and those without. *) use the appropriate #if or #ifdef depending upon the symbol git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60904 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/locks.h | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index 321cdd18a78..019fe0c72e7 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -62,37 +62,33 @@ #include "apr_lock.h" /* System headers required by Locks library */ -#if HAVE_UNISTD_H -#include <unistd.h> -#endif -#if HAVE_STRING_H -#include <string.h> -#endif -#if HAVE_USLOCKS_H -#include <uslocks.h> -#endif #if APR_HAVE_SYS_TYPES_H #include <sys/types.h> #endif -#if HAVE_SYS_IPC_H -#include <sys/ipc.h> +#if APR_HAVE_STDIO_H +#include <stdio.h> +#endif +#if APR_HAVE_FCNTL_H +#include <fcntl.h> #endif -#if HAVE_SYS_SEM_H + +/* ### create APR_HAVE_* macros for these? */ +#ifdef HAVE_SYS_SEM_H #include <sys/sem.h> #endif -#if HAVE_SYS_FILE_H +#ifdef HAVE_SYS_FILE_H #include <sys/file.h> #endif -#if APR_HAVE_STDIO_H -#include <stdio.h> -#endif -#if HAVE_STDLIB_H +#ifdef HAVE_STDLIB_H #include <stdlib.h> #endif -#if APR_HAVE_FCNTL_H -#include <fcntl.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef HAVE_STRING_H +#include <string.h> #endif -#if HAVE_SYS_MMAN_H +#ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> #endif From 3318bd01690c7e966bfbcf9cd28c9fe211f02945 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 6 Dec 2000 20:02:35 +0000 Subject: [PATCH 0925/7878] put the pool functions in the pool code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60905 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_pools.c | 68 +++++++++++++++++++++++++++++++++++++++++ memory/unix/apr_pools.c | 68 +++++++++++++++++++++++++++++++++++++++++ misc/unix/start.c | 64 ++++---------------------------------- 3 files changed, 142 insertions(+), 58 deletions(-) diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 2a736f31cdf..5b2889fe786 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -68,6 +68,7 @@ #include "apr_pools.h" #include "apr_lib.h" #include "apr_lock.h" +#include "apr_hash.h" #ifdef HAVE_STDIO_H #include <stdio.h> @@ -530,6 +531,33 @@ static void dump_stats(void) } #endif +/* ### why do we have this, in addition to apr_make_sub_pool? */ +apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) +{ + apr_pool_t *newpool; + + if (cont) { + newpool = apr_make_sub_pool(cont, cont->apr_abort); + } + else { + newpool = apr_make_sub_pool(NULL, NULL); + } + + if (newpool == NULL) { + return APR_ENOPOOL; + } + + newpool->prog_data = NULL; + if (cont) { + newpool->apr_abort = cont->apr_abort; + } + else { + newpool->apr_abort = NULL; + } + *newcont = newpool; + return APR_SUCCESS; +} + /***************************************************************** * * Managing generic cleanups. @@ -961,6 +989,46 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) return res; } +/***************************************************************** + * + * User data management functions + */ + +apr_status_t apr_set_userdata(const void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_pool_t *cont) +{ + int keylen = strlen(key); + + if (cont->prog_data == NULL) + cont->prog_data = apr_make_hash(cont); + + if (apr_hash_get(cont->prog_data, key, keylen) == NULL){ + char *new_key = apr_pstrdup(cont, key); + apr_hash_set(cont->prog_data, new_key, keylen, data); + } + else { + apr_hash_set(cont->prog_data, key, keylen, data); + } + + apr_register_cleanup(cont, data, cleanup, cleanup); + return APR_SUCCESS; +} + +apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) +{ + if (cont->prog_data == NULL) + *data = NULL; + else + *data = apr_hash_get(cont->prog_data, key, strlen(key)); + return APR_SUCCESS; +} + +/***************************************************************** + * + * "Print" functions + */ + /* * apr_psprintf is implemented by writing directly into the current * block of the pool, starting right at first_avail. If there's diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 2a736f31cdf..5b2889fe786 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -68,6 +68,7 @@ #include "apr_pools.h" #include "apr_lib.h" #include "apr_lock.h" +#include "apr_hash.h" #ifdef HAVE_STDIO_H #include <stdio.h> @@ -530,6 +531,33 @@ static void dump_stats(void) } #endif +/* ### why do we have this, in addition to apr_make_sub_pool? */ +apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) +{ + apr_pool_t *newpool; + + if (cont) { + newpool = apr_make_sub_pool(cont, cont->apr_abort); + } + else { + newpool = apr_make_sub_pool(NULL, NULL); + } + + if (newpool == NULL) { + return APR_ENOPOOL; + } + + newpool->prog_data = NULL; + if (cont) { + newpool->apr_abort = cont->apr_abort; + } + else { + newpool->apr_abort = NULL; + } + *newcont = newpool; + return APR_SUCCESS; +} + /***************************************************************** * * Managing generic cleanups. @@ -961,6 +989,46 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) return res; } +/***************************************************************** + * + * User data management functions + */ + +apr_status_t apr_set_userdata(const void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_pool_t *cont) +{ + int keylen = strlen(key); + + if (cont->prog_data == NULL) + cont->prog_data = apr_make_hash(cont); + + if (apr_hash_get(cont->prog_data, key, keylen) == NULL){ + char *new_key = apr_pstrdup(cont, key); + apr_hash_set(cont->prog_data, new_key, keylen, data); + } + else { + apr_hash_set(cont->prog_data, key, keylen, data); + } + + apr_register_cleanup(cont, data, cleanup, cleanup); + return APR_SUCCESS; +} + +apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) +{ + if (cont->prog_data == NULL) + *data = NULL; + else + *data = apr_hash_get(cont->prog_data, key, strlen(key)); + return APR_SUCCESS; +} + +/***************************************************************** + * + * "Print" functions + */ + /* * apr_psprintf is implemented by writing directly into the current * block of the pool, starting right at first_avail. If there's diff --git a/misc/unix/start.c b/misc/unix/start.c index d589d2777ad..04371d6e1f1 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -52,68 +52,16 @@ * <http://www.apache.org/>. */ -#include "misc.h" -#include "locks.h" -#include "apr_strings.h" -#include "apr_hash.h" +#include "apr.h" +#include "apr_general.h" +#include "apr_pools.h" -static int initialized=0; +#include "misc.h" /* for WSAHighByte / WSALowByte */ +#include "locks.h" /* for apr_unix_setup_lock() */ -apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) -{ - apr_pool_t *newpool; - - if (cont) { - newpool = apr_make_sub_pool(cont, cont->apr_abort); - } - else { - newpool = apr_make_sub_pool(NULL, NULL); - } - - if (newpool == NULL) { - return APR_ENOPOOL; - } - - newpool->prog_data = NULL; - if (cont) { - newpool->apr_abort = cont->apr_abort; - } - else { - newpool->apr_abort = NULL; - } - *newcont = newpool; - return APR_SUCCESS; -} -apr_status_t apr_set_userdata(const void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_pool_t *cont) -{ - int keylen = strlen(key); +static int initialized = 0; - if (cont->prog_data == NULL) - cont->prog_data = apr_make_hash(cont); - - if (apr_hash_get(cont->prog_data, key, keylen) == NULL){ - char *new_key = apr_pstrdup(cont, key); - apr_hash_set(cont->prog_data, new_key, keylen, data); - } - else { - apr_hash_set(cont->prog_data, key, keylen, data); - } - - apr_register_cleanup(cont, data, cleanup, cleanup); - return APR_SUCCESS; -} - -apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) -{ - if (cont->prog_data == NULL) - *data = NULL; - else - *data = apr_hash_get(cont->prog_data, key, strlen(key)); - return APR_SUCCESS; -} apr_status_t apr_initialize(void) { From bceb8ca6d9056f830bc6ea0583dc71c488417503 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Thu, 7 Dec 2000 01:55:58 +0000 Subject: [PATCH 0926/7878] this shouldn't be here any more... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60906 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/.cvsignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 buckets/.cvsignore diff --git a/buckets/.cvsignore b/buckets/.cvsignore deleted file mode 100644 index f3c7a7c5da6..00000000000 --- a/buckets/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -Makefile From c835a992848301c42b81fe2815c3d2bfcceb297e Mon Sep 17 00:00:00 2001 From: Chuck Murcko <chuck@apache.org> Date: Thu, 7 Dec 2000 02:58:16 +0000 Subject: [PATCH 0927/7878] Fix a small build problem in the test directory git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60907 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 7f6a6ceacac..a2ab05614c2 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -82,10 +82,10 @@ testsock@EXEEXT@: testsock.o client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ $(CC) $(CFLAGS) -o testsock@EXEEXT@ testsock.o $(LDFLAGS) client@EXEEXT@: client.o - $(CC) $(CFLAGS) -o server@EXEEXT@ server.o $(LDFLAGS) + $(CC) $(CFLAGS) -o client@EXEEXT@ client.o $(LDFLAGS) server@EXEEXT@: server.o sendfile.o - $(CC) $(CFLAGS) -o client@EXEEXT@ client.o $(LDFLAGS) + $(CC) $(CFLAGS) -o server@EXEEXT@ server.o $(LDFLAGS) sendfile@EXEEXT@: sendfile.o $(CC) $(CFLAGS) -o sendfile@EXEEXT@ sendfile.o $(LDFLAGS) From b697f1b9fb389cb2c5e554d6642b4e3fc1ab2020 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 7 Dec 2000 05:00:28 +0000 Subject: [PATCH 0928/7878] Allow APR programmers to determine if an MMAP is read-only or if it should be write-able. Submitted by: Ryan Bloom and Will Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60908 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_mmap.h | 13 +++++++++++-- mmap/unix/mmap.c | 22 +++++++++++++++++++--- test/testmmap.c | 3 ++- 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index c24e46d3d11..cbe932f7d81 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR a9 + *) Allow the APR programmer to specify if the MMAP is read-only or + write-able. + [Ryan Bloom and Will Rowe] + *) Check more carefully for getaddrinfo(). Accept those that require <netdb.h> to be included (e.g., Tru64). Reject those that fail a very basic operational test (e.g., AIX). [Jeff Trawick] diff --git a/include/apr_mmap.h b/include/apr_mmap.h index f3453185e20..4cf4e58fe4a 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -68,6 +68,9 @@ extern "C" { #endif /* __cplusplus */ +#define APR_MMAP_READ 1 +#define APR_MMAP_WRITE 2 + /** * @package APR MMAP library */ @@ -103,10 +106,16 @@ struct apr_mmap_t { * @param file The file turn into an mmap. * @param offset The offset into the file to start the data pointer at. * @param size The size of the file + * @param flag bit-wise or of: + * <PRE> + * APR_MMAP_READ MMap opened for reading + * APR_MMAP_WRITE MMap opened for writing + * </PRE> * @param cntxt The pool to use when creating the mmap. */ -apr_status_t apr_mmap_create(apr_mmap_t ** newmmap, apr_file_t *file, apr_off_t offset, - apr_size_t size, apr_pool_t *cntxt); +apr_status_t apr_mmap_create(apr_mmap_t ** newmmap, apr_file_t *file, + apr_off_t offset, apr_size_t size, + apr_int32_t flag, apr_pool_t *cntxt); /** * Remove a mmap'ed. diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 33d1cfff2b8..8b8b5440d13 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -101,9 +101,11 @@ static apr_status_t mmap_cleanup(void *themmap) return errno; } -apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, apr_off_t offset, - apr_size_t size, apr_pool_t *cont) +apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, + apr_off_t offset, apr_size_t size, + apr_int32_t flag, apr_pool_t *cont) { + apr_int32_t native_flags = 0; #ifdef BEOS void *mm; area_id aid = -1; @@ -122,8 +124,15 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, apr_off_t offse apr_seek(file, APR_SET, &offset); pages = ((size -1) / B_PAGE_SIZE) + 1; + if (flag & APR_MMAP_WRITE) { + native_flags |= B_WRITE_AREA; + } + if (flag & APR_MMAP_READ) { + native_flags |= B_READ_AREA; + } + aid = create_area(areaname, &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, - B_FULL_LOCK, B_READ_AREA|B_WRITE_AREA); + B_FULL_LOCK, native_flags); if (aid < B_NO_ERROR) { /* we failed to get an mmap'd file... */ @@ -135,6 +144,13 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, apr_off_t offse (*new)->area = aid; #else + if (flag & APR_MMAP_WRITE) { + native_flags |= PROT_WRITE; + } + if (flag & APR_MMAP_READ) { + native_flags |= PROT_READ; + } + mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes, offset); if (mm == (caddr_t)-1) { diff --git a/test/testmmap.c b/test/testmmap.c index 97eb641662d..955d1276ce2 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -52,6 +52,7 @@ * <http://www.apache.org/>. */ +#include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -116,7 +117,7 @@ int main(void) } fprintf(stdout,"Trying to mmap the file............."); - if (apr_mmap_create(&themmap, thefile, 0, finfo.size, context) != APR_SUCCESS) { + if (apr_mmap_create(&themmap, thefile, 0, finfo.size, APR_MMAP_READ, context) != APR_SUCCESS) { fprintf(stderr,"Failed!\n"); exit(-1); } From 45b84a3b0c19f2ed96b7a56cf853c1ba58e79432 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 7 Dec 2000 06:52:59 +0000 Subject: [PATCH 0929/7878] Get ahead for win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60909 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/testmmap.c b/test/testmmap.c index 955d1276ce2..fbca4f3fe1f 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -52,7 +52,9 @@ * <http://www.apache.org/>. */ +#if APR_HAS_UNISTD_H #include <unistd.h> +#endif #include <stdio.h> #include <stdlib.h> #include <string.h> From 76ddb67c0f4bf5dd6c9dd8c4cf80de49bffd9b3a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 7 Dec 2000 06:53:46 +0000 Subject: [PATCH 0930/7878] Fix parsing for mult @EXEEXT@ tags git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60910 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl index 4d95511ee8a..d9c51b4a6b6 100644 --- a/test/MakeWin32Make.pl +++ b/test/MakeWin32Make.pl @@ -24,6 +24,7 @@ $t =~ s|-I\$\(INCDIR\)|\/I "\$\(INCDIR\)"|; $t =~ s|\.\.\/libapr\.a|\.\./LibD/apr\.lib|; if ($t =~ s|\@EXEEXT\@|\.exe|) { + while ($t =~ s|\@EXEEXT\@|\.exe|) {} $t =~ s|\$\(CC\) \$\(CFLAGS\)|\$\(LINK\) \/subsystem:console|; $t =~ s|-o (\S+)|\/out:\"$1\"|; $t =~ s|--export-dynamic ||; From d78163960b667c168d80e6400ccdcf4707b95efe Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 7 Dec 2000 06:56:33 +0000 Subject: [PATCH 0931/7878] Doesn't belong here... public symbols in apr.h (apr.hw) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60911 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_private.hw | 13 ------------- include/arch/win32/apr_private.h | 13 ------------- 2 files changed, 26 deletions(-) diff --git a/include/apr_private.hw b/include/apr_private.hw index 2dd9a0f0d6e..30632b44a10 100644 --- a/include/apr_private.hw +++ b/include/apr_private.hw @@ -168,19 +168,6 @@ typedef void (Sigfunc)(int); #define strcasecmp(s1, s2) stricmp(s1, s2) #define sleep(t) Sleep(t * 1000) - -/* APR FEATURE MACROS. - * This section should be used to define feature macros - * that the windows port needs. - */ -#define APR_HAS_THREADS 1 -#define APR_HAS_SENDFILE 1 -#define APR_HAS_RANDOM 1 -#define APR_HAS_DSO 1 - -#define APR_HAS_MMAP 0 -#define APR_HAS_XLATE 0 - #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 #define SIZEOF_LONGLONG 8 diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 2dd9a0f0d6e..30632b44a10 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -168,19 +168,6 @@ typedef void (Sigfunc)(int); #define strcasecmp(s1, s2) stricmp(s1, s2) #define sleep(t) Sleep(t * 1000) - -/* APR FEATURE MACROS. - * This section should be used to define feature macros - * that the windows port needs. - */ -#define APR_HAS_THREADS 1 -#define APR_HAS_SENDFILE 1 -#define APR_HAS_RANDOM 1 -#define APR_HAS_DSO 1 - -#define APR_HAS_MMAP 0 -#define APR_HAS_XLATE 0 - #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 #define SIZEOF_LONGLONG 8 From 463b7143fef98081c1869d2f2578e42e759f3dee Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 7 Dec 2000 06:58:59 +0000 Subject: [PATCH 0932/7878] Implement Win32 MMAP support. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60912 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + apr.dsp | 15 ++++- aprlib.dsp | 15 ++++- include/apr.hw | 2 +- include/apr_mmap.h | 10 +++ mmap/win32/mmap.c | 165 +++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 205 insertions(+), 5 deletions(-) create mode 100644 mmap/win32/mmap.c diff --git a/CHANGES b/CHANGES index cbe932f7d81..8afae6533f2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ Changes with APR a9 + + *) Add Win32 MMAP support [William Rowe] + *) Allow the APR programmer to specify if the MMAP is read-only or write-able. [Ryan Bloom and Will Rowe] diff --git a/apr.dsp b/apr.dsp index b55b4a6ac55..156dfdd91bb 100644 --- a/apr.dsp +++ b/apr.dsp @@ -68,9 +68,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c # ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -371,6 +370,18 @@ SOURCE=.\shmem\win32\shmem.c # PROP Exclude_From_Build 1 # End Source File # End Group +# Begin Group "mmap" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\mmap\unix\common.c +# End Source File +# Begin Source File + +SOURCE=.\mmap\win32\mmap.c +# End Source File +# End Group # End Group # Begin Group "Generated Header Files" diff --git a/aprlib.dsp b/aprlib.dsp index b55b4a6ac55..156dfdd91bb 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -68,9 +68,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c # ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -371,6 +370,18 @@ SOURCE=.\shmem\win32\shmem.c # PROP Exclude_From_Build 1 # End Source File # End Group +# Begin Group "mmap" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\mmap\unix\common.c +# End Source File +# Begin Source File + +SOURCE=.\mmap\win32\mmap.c +# End Source File +# End Group # End Group # Begin Group "Generated Header Files" diff --git a/include/apr.hw b/include/apr.hw index 1957894f6c5..eae8d18fead 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -171,7 +171,7 @@ #define APR_HAS_SHARED_MEMORY 0 #define APR_HAS_THREADS 1 #define APR_HAS_SENDFILE 1 -#define APR_HAS_MMAP 0 +#define APR_HAS_MMAP 1 #define APR_HAS_FORK 0 #define APR_HAS_RANDOM 1 #define APR_HAS_XLATE 0 diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 4cf4e58fe4a..a95cedaefde 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -89,6 +89,16 @@ struct apr_mmap_t { #ifdef BEOS /** An area ID. Only valid on BeOS */ area_id area; +#endif +#ifdef WIN32 + /** The handle of the file mapping */ + HANDLE mhandle; + /** The start of the real memory page area (mapped view) */ + void *mv; + /** The physical start, size and offset */ + size_t pstart; + size_t psize; + size_t poffset; #endif /** The start of the memory mapped area */ void *mm; diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c new file mode 100644 index 00000000000..6e66e880093 --- /dev/null +++ b/mmap/win32/mmap.c @@ -0,0 +1,165 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_mmap.h" +#include "apr_errno.h" +#include "fileio.h" +#include "apr_portable.h" + +#if APR_HAS_MMAP + +static apr_status_t mmap_cleanup(void *themmap) +{ + apr_mmap_t *mm = themmap; + apr_status_t rv = 0; + if (mm->mv) { + if (!UnmapViewOfFile(mm->mv)) + { + apr_status_t rv = apr_get_os_error(); + CloseHandle(mm->mhandle); + mm->mv = NULL; + mm->mhandle = NULL; + return rv; + } + mm->mv = NULL; + } + if (mm->mhandle) + { + if (!CloseHandle(mm->mhandle)) + { + apr_status_t rv = apr_get_os_error(); + CloseHandle(mm->mhandle); + mm->mhandle = NULL; + return rv; + } + mm->mhandle = NULL; + } + return APR_SUCCESS; +} + +apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, apr_off_t offset, + apr_size_t size, apr_int32_t flag, apr_pool_t *cont) +{ + static DWORD memblock = 0; + DWORD fmaccess = 0, mvaccess = 0; + + if (flag & APR_MMAP_WRITE) + fmaccess |= PAGE_READWRITE; + else if (flag & APR_MMAP_READ) + fmaccess |= PAGE_READONLY; + + if (flag & APR_MMAP_READ) + mvaccess |= FILE_MAP_READ; + if (flag & APR_MMAP_WRITE) + mvaccess |= FILE_MAP_WRITE; + + if (!file || !file->filehand || file->filehand == INVALID_HANDLE_VALUE + || file->buffered) + return APR_EBADF; + + if (!memblock) + { + SYSTEM_INFO si; + GetSystemInfo(&si); + memblock = si.dwAllocationGranularity; + } + + *new = apr_pcalloc(cont, sizeof(apr_mmap_t)); + (*new)->pstart = (offset / memblock) * memblock; + (*new)->psize = (offset % memblock) + size; + (*new)->poffset = offset - (*new)->pstart; + + (*new)->mhandle = CreateFileMapping(file->filehand, NULL, fmaccess, + 0, (*new)->psize, NULL); + if (!(*new)->mhandle || (*new)->mhandle == INVALID_HANDLE_VALUE) + { + *new = NULL; + return apr_get_os_error(); + } + + (*new)->mv = MapViewOfFile((*new)->mhandle, mvaccess, 0, + (*new)->poffset, (*new)->psize); + if (!(*new)->mv) + { + apr_status_t rv = apr_get_os_error(); + CloseHandle((*new)->mhandle); + *new = NULL; + return rv; + } + + (*new)->mm = (char*)((*new)->mv) + offset; + (*new)->size = size; + (*new)->cntxt = cont; + + /* register the cleanup... */ + apr_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, + apr_null_cleanup); + return APR_SUCCESS; +} + +apr_status_t apr_mmap_delete(apr_mmap_t *mmap) +{ + apr_status_t rv; + + if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { + apr_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); + return APR_SUCCESS; + } + return rv; +} + +#endif From 50dab33dd8d2d9d3df76367d792f0ab27eda2e2c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 7 Dec 2000 13:20:43 +0000 Subject: [PATCH 0933/7878] Fix typo (thanks, gstein, for pointing this out.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60913 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmmap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/testmmap.c b/test/testmmap.c index fbca4f3fe1f..5f5e888dc25 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -52,17 +52,17 @@ * <http://www.apache.org/>. */ +#include "apr_mmap.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_file_io.h" #if APR_HAS_UNISTD_H #include <unistd.h> #endif #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "apr_mmap.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_file_io.h" /* hmmm, what is a truly portable define for the max path * length on a platform? From c30a6c23373f96419621392d9c546f53683c8411 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Thu, 7 Dec 2000 13:40:11 +0000 Subject: [PATCH 0934/7878] "... talk about mudflaps, my girl's got 'em!" -- "Big Bottom", Spinal Tap git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60914 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 32d71ee7a63..d09e789e895 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ Apache 2.0 STATUS: -Last modified at [$Date: 2000/12/03 03:31:11 $] +Last modified at [$Date: 2000/12/07 13:40:11 $] Release: @@ -47,6 +47,12 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * The MM library is built as static and shared library. This should be set up to build only the required version. + * use libtool + Status: Greg +1 (volunteers) + + * snarf rules.mk(.in) from APRUTIL to simplify makefiles + Status: Greg +1 (volunteers) + Documentation that needs writing: * API documentation From 70847e339113815d4fbf0194d3db59a2a66512a2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 7 Dec 2000 15:55:01 +0000 Subject: [PATCH 0935/7878] fix some docs in the file i/o file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60915 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 18904b1906a..d5740cb9d3f 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -200,7 +200,7 @@ struct apr_finfo_t { apr_time_t ctime; }; -/** File lock types/flags */ +/* File lock types/flags */ #define APR_FLOCK_SHARED 1 /* Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, @@ -238,7 +238,7 @@ struct apr_finfo_t { * @param new_name The newly allocated canonicalized trusted+child name * @param trusted_name Already canonical parent path; may be NULL. * @param child_name An absolute path or path relative to trusted_name. - * @param options Bit-wise of: + * @param options Bit-wise OR of: * <PRE> * APR_CANON_ONLY_ABSOLUTE Require the trusted_name+child_name result is * an absolute product or fail with error for the From 8165d4c8779b50fc3636b7b487a0e1986eeab712 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 7 Dec 2000 18:10:27 +0000 Subject: [PATCH 0936/7878] Add apr_parse_addr_port() for parsing the hostname:port portion of URLs and similar strings. Somebody with VC++ 6.0 needs to update the .dsp file(s) to include inet_pton.c. The BeOS Makefile.in wasn't updated because I think BeOS uses the unix code now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60916 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + aprlib.def | 1 + include/apr_network_io.h | 33 ++++++++++++ libapr.def | 1 + network_io/os2/Makefile.in | 1 + network_io/unix/sa_common.c | 102 ++++++++++++++++++++++++++++++++++++ 6 files changed, 140 insertions(+) diff --git a/CHANGES b/CHANGES index 8afae6533f2..a27e309ff39 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ Changes with APR a9 + *) Add apr_parse_addr_port() for parsing the hostname:port portion + of URLs and similar strings. [Jeff Trawick] *) Add Win32 MMAP support [William Rowe] diff --git a/aprlib.def b/aprlib.def index 04efde19f04..3ed3b2e1e15 100644 --- a/aprlib.def +++ b/aprlib.def @@ -88,6 +88,7 @@ EXPORTS apr_get_port apr_set_port apr_get_inaddr + apr_parse_addr_port ; ; diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 6683f555d33..219fbfbde5b 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -305,6 +305,39 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, apr_int32_t flags, apr_pool_t *p); +/** + * Parse hostname/IP address with scope id and port. + * + * Any of the following strings are accepted: + * 8080 (just the port number) + * www.apache.org (just the hostname) + * www.apache.org:8080 (hostname and port number) + * [fe80::1]:80 (IPv6 numeric address string only) + * [fe80::1%eth0] (IPv6 numeric address string and scope id) + * + * Invalid strings: + * (empty string) + * [abc] (not valid IPv6 numeric address string) + * abc:65536 (invalid port number) + * + * @param addr The new buffer containing just the hostname. On output, *addr + * will be NULL if no hostname/IP address was specfied. + * @param scope_id The new buffer containing just the scope id. On output, + * *scope_id will be NULL if no scope id was specified. + * @param port The port number. On output, *port will be 0 if no port was + * specified. + * @param str The input string to be parsed. + * @param p The pool from which *addr and *scope_id are allocated. + * @tip If scope id shouldn't be allowed, check for scope_id != NULL in addition + * to checking the return code. If addr/hostname should be required, check + * for addr == NULL in addition to checking the return code. + */ +apr_status_t apr_parse_addr_port(char **addr, + char **scope_id, + apr_port_t *port, + const char *str, + apr_pool_t *p); + /** * Get name of the current machine * @param buf A buffer to store the hostname in. diff --git a/libapr.def b/libapr.def index 04efde19f04..3ed3b2e1e15 100644 --- a/libapr.def +++ b/libapr.def @@ -88,6 +88,7 @@ EXPORTS apr_get_port apr_set_port apr_get_inaddr + apr_parse_addr_port ; ; diff --git a/network_io/os2/Makefile.in b/network_io/os2/Makefile.in index f23522533ff..e5077ea8af3 100644 --- a/network_io/os2/Makefile.in +++ b/network_io/os2/Makefile.in @@ -17,6 +17,7 @@ OBJS=poll.o \ sockopt.o \ sockaddr.o \ inet_ntop.o \ + inet_pton.o \ os2calls.o .c.o: diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index f282df03fbb..3c0fa0c577f 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -65,6 +65,10 @@ #include "apr.h" +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port) { /* XXX IPv6: assumes sin_port and sin6_port at same offset */ @@ -178,6 +182,104 @@ apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_so return APR_SUCCESS; } +apr_status_t apr_parse_addr_port(char **addr, + char **scope_id, + apr_port_t *port, + const char *str, + apr_pool_t *p) +{ + const char *ch, *lastchar; + int big_port; + apr_size_t addrlen; + + *addr = NULL; /* assume not specified */ + *scope_id = NULL; /* assume not specified */ + *port = 0; /* assume not specified */ + + /* First handle the optional port number. That may be all that + * is specified in the string. + */ + ch = lastchar = str + strlen(str) - 1; + while (ch >= str && apr_isdigit(*ch)) { + --ch; + } + + if (ch < str) { /* Entire string is the port. */ + big_port = atoi(str); + if (big_port < 1 || big_port > 65535) { + return APR_EINVAL; + } + *port = big_port; + return APR_SUCCESS; + } + + if (*ch == ':' && ch < lastchar) { /* host and port number specified */ + if (ch == str) { /* string starts with ':' -- bad */ + return APR_EINVAL; + } + big_port = atoi(ch + 1); + if (big_port < 1 || big_port > 65535) { + return APR_EINVAL; + } + *port = big_port; + lastchar = ch - 1; + } + + /* now handle the hostname */ + addrlen = lastchar - str + 1; + +#if APR_HAVE_IPV6 /* XXX don't require this; would need to pass char[] for ipaddr and always define APR_INET6 */ + if (*str == '[') { + const char *end_bracket = memchr(str, ']', addrlen); + struct in6_addr ipaddr; + const char *scope_delim; + + if (!end_bracket || end_bracket != lastchar) { + *port = 0; + return APR_EINVAL; + } + + /* handle scope id; this is the only context where it is allowed */ + scope_delim = memchr(str, '%', addrlen); + if (scope_delim) { + if (scope_delim == end_bracket - 1) { /* '%' without scope identifier */ + *port = 0; + return APR_EINVAL; + } + addrlen = scope_delim - str - 1; + *scope_id = apr_palloc(p, end_bracket - scope_delim); + memcpy(*scope_id, scope_delim + 1, end_bracket - scope_delim - 1); + (*scope_id)[end_bracket - scope_delim - 1] = '\0'; + } + else { + addrlen = addrlen - 2; /* minus 2 for '[' and ']' */ + } + + *addr = apr_palloc(p, addrlen + 1); + memcpy(*addr, + str + 1, + addrlen); + (*addr)[addrlen] = '\0'; + if (apr_inet_pton(AF_INET6, *addr, &ipaddr) != 1) { + *addr = NULL; + *scope_id = NULL; + *port = 0; + return APR_EINVAL; + } + } + else +#endif + { + /* XXX If '%' is not a valid char in a DNS name, we *could* check + * for bogus scope ids first. + */ + *addr = apr_palloc(p, addrlen + 1); + memcpy(*addr, str, addrlen); + (*addr)[addrlen] = '\0'; + } + return APR_SUCCESS; +} + apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p) From 645b8ad4fee28b56bf65940da18ba3a1d89b976f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 7 Dec 2000 21:31:44 +0000 Subject: [PATCH 0937/7878] Fix a few nits, export symbols, etc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60917 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 3 +-- aprlib.def | 5 +++++ aprlib.dsp | 3 +-- libapr.def | 5 +++++ network_io/win32/sockaddr.c | 1 + 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/apr.dsp b/apr.dsp index 156dfdd91bb..605232c9a2f 100644 --- a/apr.dsp +++ b/apr.dsp @@ -68,7 +68,7 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c +# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -552,7 +552,6 @@ SOURCE=.\include\apr_xlate.h # Begin Source File SOURCE=.\aprlib.def -# PROP Exclude_From_Build 1 # End Source File # End Target # End Project diff --git a/aprlib.def b/aprlib.def index 3ed3b2e1e15..2d7813108fb 100644 --- a/aprlib.def +++ b/aprlib.def @@ -260,6 +260,11 @@ EXPORTS apr_parse_uuid apr_get_uuid +; apr_mmap.h + apr_mmap_create + apr_mmap_delete + apr_mmap_offset + ; Moved out of the way for Bill Stoddard's reorg ; ; apr_getopt.h diff --git a/aprlib.dsp b/aprlib.dsp index 156dfdd91bb..605232c9a2f 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -68,7 +68,7 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c +# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo @@ -552,7 +552,6 @@ SOURCE=.\include\apr_xlate.h # Begin Source File SOURCE=.\aprlib.def -# PROP Exclude_From_Build 1 # End Source File # End Target # End Project diff --git a/libapr.def b/libapr.def index 3ed3b2e1e15..2d7813108fb 100644 --- a/libapr.def +++ b/libapr.def @@ -260,6 +260,11 @@ EXPORTS apr_parse_uuid apr_get_uuid +; apr_mmap.h + apr_mmap_create + apr_mmap_delete + apr_mmap_offset + ; Moved out of the way for Bill Stoddard's reorg ; ; apr_getopt.h diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index dfc8428bf73..b29f418189a 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -56,6 +56,7 @@ #include "apr_network_io.h" #include "apr_general.h" #include "apr_strings.h" +#include "apr_lib.h" #include <string.h> static apr_status_t get_local_addr(apr_socket_t *sock) From 87d1c7ff5043fe9fa3ae83f565d21385eee5bccc Mon Sep 17 00:00:00 2001 From: Sascha Schumann <sascha@apache.org> Date: Fri, 8 Dec 2000 00:23:03 +0000 Subject: [PATCH 0938/7878] Cast my vote. As far as I recall there was only one (albeit loud) voice against eleminating the redundancy in all those Makefile templates. So I hope this goes forward quickly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60918 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index d09e789e895..565625f7e41 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ Apache 2.0 STATUS: -Last modified at [$Date: 2000/12/07 13:40:11 $] +Last modified at [$Date: 2000/12/08 00:23:03 $] Release: @@ -51,7 +51,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Status: Greg +1 (volunteers) * snarf rules.mk(.in) from APRUTIL to simplify makefiles - Status: Greg +1 (volunteers) + Status: Greg +1 (volunteers), Sascha +1 Documentation that needs writing: From d540c0e4d5094ce0afeeef5485fa91d6d0b0eb0e Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 8 Dec 2000 04:29:01 +0000 Subject: [PATCH 0939/7878] Move apr_private.h.in from the include directory to the arch/unix directory. This removes all temptation to include apr_private.h from outside of APR, because it just isn't available. This also highlighted a bunch of holes in our header file setup. Basically, just directories that were never migrated to the curret setup. Submitted by: Will Rowe and Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60919 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 +- i18n/unix/Makefile.in | 3 +- include/arch/unix/apr_private.h.in | 390 +++++++++++++++++++++++++++++ mmap/unix/Makefile.in | 3 +- mmap/unix/mmap.c | 2 +- passwd/Makefile.in | 3 +- strings/Makefile.in | 3 +- tables/Makefile.in | 3 +- threadproc/unix/Makefile.in | 3 +- threadproc/unix/proc.c | 2 +- threadproc/unix/procsup.c | 2 +- threadproc/unix/signals.c | 6 +- threadproc/unix/thread.c | 2 +- threadproc/unix/threadpriv.c | 2 +- time/unix/Makefile.in | 3 +- user/unix/Makefile.in | 3 +- 16 files changed, 414 insertions(+), 20 deletions(-) create mode 100644 include/arch/unix/apr_private.h.in diff --git a/configure.in b/configure.in index 9ddd4d3926e..4ff235d7fdf 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl ## dnl Process this file with autoconf to produce a configure script. AC_INIT(apr_common.m4) -AC_CONFIG_HEADER(include/apr_private.h) +AC_CONFIG_HEADER(include/arch/unix/apr_private.h) AC_CONFIG_AUX_DIR(helpers) AC_CANONICAL_SYSTEM @@ -801,7 +801,7 @@ if test -n "$CPPFLAGS"; then CFLAGS="$CFLAGS $CPPFLAGS" fi -SAVE_FILES="include/apr.h include/apr_private.h" +SAVE_FILES="include/apr.h include/arch/unix/apr_private.h" for i in $SAVE_FILES; do test -r $i && mv $i $i.save diff --git a/i18n/unix/Makefile.in b/i18n/unix/Makefile.in index 9d99037c8eb..0e35098c02d 100644 --- a/i18n/unix/Makefile.in +++ b/i18n/unix/Makefile.in @@ -4,8 +4,9 @@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) MKDEP=../../helpers/mkdep.sh OBJS=xlate.o diff --git a/include/arch/unix/apr_private.h.in b/include/arch/unix/apr_private.h.in new file mode 100644 index 00000000000..5a45825f899 --- /dev/null +++ b/include/arch/unix/apr_private.h.in @@ -0,0 +1,390 @@ +/* include/arch/unix/apr_private.h.in. Generated automatically from configure.in by autoheader. */ +#ifndef APR_PRIVATE_H +#define APR_PRIVATE_H + + +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +#undef _ALL_SOURCE +#endif + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef gid_t + +/* Define as __inline if that's what the C compiler calls it. */ +#undef inline + +/* Define to `long' if <sys/types.h> doesn't define. */ +#undef off_t + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef pid_t + +/* Define if the `setpgrp' function takes no argument. */ +#undef SETPGRP_VOID + +/* Define to `unsigned' if <sys/types.h> doesn't define. */ +#undef size_t + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef uid_t + +/* Various #defines we need to know about */ +#undef HAVE_LOCK_EX +#undef HAVE_F_SETLK +#undef HAVE_CODESET +#undef HAVE_PTHREAD_PROCESS_SHARED +#undef DEV_RANDOM +#undef HAVE_TRUERAND +#undef HAVE_POLLIN +#undef HAVE_isascii + +#undef READDIR_IS_THREAD_SAFE + +#undef NEED_RLIM_T +#undef USEBCOPY + +#undef HAVE_GMTOFF +#undef USE_THREADS + +#undef SIZEOF_SSIZE_T +#undef SIZEOF_SIZE_T +#undef SIZEOF_OFF_T + +#undef HAVE_MM_SHMT_MMFILE + +/* BeOS specific flag */ +#undef HAVE_BONE_VERSION + +/* The number of bytes in a char. */ +#undef SIZEOF_CHAR + +/* The number of bytes in a int. */ +#undef SIZEOF_INT + +/* The number of bytes in a long. */ +#undef SIZEOF_LONG + +/* The number of bytes in a long double. */ +#undef SIZEOF_LONG_DOUBLE + +/* The number of bytes in a long long. */ +#undef SIZEOF_LONG_LONG + +/* The number of bytes in a short. */ +#undef SIZEOF_SHORT + +/* Define if you have the bzero function. */ +#undef HAVE_BZERO + +/* Define if you have the dlopen function. */ +#undef HAVE_DLOPEN + +/* Define if you have the fork function. */ +#undef HAVE_FORK + +/* Define if you have the getipnodebyaddr function. */ +#undef HAVE_GETIPNODEBYADDR + +/* Define if you have the getipnodebyname function. */ +#undef HAVE_GETIPNODEBYNAME + +/* Define if you have the getpass function. */ +#undef HAVE_GETPASS + +/* Define if you have the getrlimit function. */ +#undef HAVE_GETRLIMIT + +/* Define if you have the gmtime_r function. */ +#undef HAVE_GMTIME_R + +/* Define if you have the hstrerror function. */ +#undef HAVE_HSTRERROR + +/* Define if you have the iconv function. */ +#undef HAVE_ICONV + +/* Define if you have the localtime_r function. */ +#undef HAVE_LOCALTIME_R + +/* Define if you have the memmove function. */ +#undef HAVE_MEMMOVE + +/* Define if you have the mmap function. */ +#undef HAVE_MMAP + +/* Define if you have the nl_langinfo function. */ +#undef HAVE_NL_LANGINFO + +/* Define if you have the poll function. */ +#undef HAVE_POLL + +/* Define if you have the pthread_key_delete function. */ +#undef HAVE_PTHREAD_KEY_DELETE + +/* Define if you have the semctl function. */ +#undef HAVE_SEMCTL + +/* Define if you have the semget function. */ +#undef HAVE_SEMGET + +/* Define if you have the send_file function. */ +#undef HAVE_SEND_FILE + +/* Define if you have the sendfile function. */ +#undef HAVE_SENDFILE + +/* Define if you have the setrlimit function. */ +#undef HAVE_SETRLIMIT + +/* Define if you have the setsid function. */ +#undef HAVE_SETSID + +/* Define if you have the sigaction function. */ +#undef HAVE_SIGACTION + +/* Define if you have the strcasecmp function. */ +#undef HAVE_STRCASECMP + +/* Define if you have the strdup function. */ +#undef HAVE_STRDUP + +/* Define if you have the stricmp function. */ +#undef HAVE_STRICMP + +/* Define if you have the strncasecmp function. */ +#undef HAVE_STRNCASECMP + +/* Define if you have the strnicmp function. */ +#undef HAVE_STRNICMP + +/* Define if you have the strstr function. */ +#undef HAVE_STRSTR + +/* Define if you have the waitpid function. */ +#undef HAVE_WAITPID + +/* Define if you have the writev function. */ +#undef HAVE_WRITEV + +/* Define if you have the <ByteOrder.h> header file. */ +#undef HAVE_BYTEORDER_H + +/* Define if you have the <arpa/inet.h> header file. */ +#undef HAVE_ARPA_INET_H + +/* Define if you have the <conio.h> header file. */ +#undef HAVE_CONIO_H + +/* Define if you have the <crypt.h> header file. */ +#undef HAVE_CRYPT_H + +/* Define if you have the <ctype.h> header file. */ +#undef HAVE_CTYPE_H + +/* Define if you have the <dir.h> header file. */ +#undef HAVE_DIR_H + +/* Define if you have the <dirent.h> header file. */ +#undef HAVE_DIRENT_H + +/* Define if you have the <dl.h> header file. */ +#undef HAVE_DL_H + +/* Define if you have the <dlfcn.h> header file. */ +#undef HAVE_DLFCN_H + +/* Define if you have the <errno.h> header file. */ +#undef HAVE_ERRNO_H + +/* Define if you have the <fcntl.h> header file. */ +#undef HAVE_FCNTL_H + +/* Define if you have the <iconv.h> header file. */ +#undef HAVE_ICONV_H + +/* Define if you have the <io.h> header file. */ +#undef HAVE_IO_H + +/* Define if you have the <kernel/OS.h> header file. */ +#undef HAVE_KERNEL_OS_H + +/* Define if you have the <langinfo.h> header file. */ +#undef HAVE_LANGINFO_H + +/* Define if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the <malloc.h> header file. */ +#undef HAVE_MALLOC_H + +/* Define if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have the <net/errno.h> header file. */ +#undef HAVE_NET_ERRNO_H + +/* Define if you have the <netdb.h> header file. */ +#undef HAVE_NETDB_H + +/* Define if you have the <netinet/in.h> header file. */ +#undef HAVE_NETINET_IN_H + +/* Define if you have the <netinet/tcp.h> header file. */ +#undef HAVE_NETINET_TCP_H + +/* Define if you have the <osreldate.h> header file. */ +#undef HAVE_OSRELDATE_H + +/* Define if you have the <poll.h> header file. */ +#undef HAVE_POLL_H + +/* Define if you have the <process.h> header file. */ +#undef HAVE_PROCESS_H + +/* Define if you have the <pthread.h> header file. */ +#undef HAVE_PTHREAD_H + +/* Define if you have the <pwd.h> header file. */ +#undef HAVE_PWD_H + +/* Define if you have the <signal.h> header file. */ +#undef HAVE_SIGNAL_H + +/* Define if you have the <stdarg.h> header file. */ +#undef HAVE_STDARG_H + +/* Define if you have the <stddef.h> header file. */ +#undef HAVE_STDDEF_H + +/* Define if you have the <stdio.h> header file. */ +#undef HAVE_STDIO_H + +/* Define if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define if you have the <sys/file.h> header file. */ +#undef HAVE_SYS_FILE_H + +/* Define if you have the <sys/mman.h> header file. */ +#undef HAVE_SYS_MMAN_H + +/* Define if you have the <sys/poll.h> header file. */ +#undef HAVE_SYS_POLL_H + +/* Define if you have the <sys/resource.h> header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define if you have the <sys/select.h> header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define if you have the <sys/sem.h> header file. */ +#undef HAVE_SYS_SEM_H + +/* Define if you have the <sys/sendfile.h> header file. */ +#undef HAVE_SYS_SENDFILE_H + +/* Define if you have the <sys/signal.h> header file. */ +#undef HAVE_SYS_SIGNAL_H + +/* Define if you have the <sys/socket.h> header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define if you have the <sys/uio.h> header file. */ +#undef HAVE_SYS_UIO_H + +/* Define if you have the <sys/wait.h> header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define if you have the <sysapi.h> header file. */ +#undef HAVE_SYSAPI_H + +/* Define if you have the <sysgtime.h> header file. */ +#undef HAVE_SYSGTIME_H + +/* Define if you have the <termios.h> header file. */ +#undef HAVE_TERMIOS_H + +/* Define if you have the <time.h> header file. */ +#undef HAVE_TIME_H + +/* Define if you have the <tpfeq.h> header file. */ +#undef HAVE_TPFEQ_H + +/* Define if you have the <tpfio.h> header file. */ +#undef HAVE_TPFIO_H + +/* Define if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the <unix.h> header file. */ +#undef HAVE_UNIX_H + +/* Define if you have the iconv library (-liconv). */ +#undef HAVE_LIBICONV + +/* Define if you have the nsl library (-lnsl). */ +#undef HAVE_LIBNSL + +/* Define if you have the socket library (-lsocket). */ +#undef HAVE_LIBSOCKET + +/* Define if you have the truerand library (-ltruerand). */ +#undef HAVE_LIBTRUERAND + +/* Define if system uses EBCDIC */ +#undef CHARSET_EBCDIC + +/* Whether you have socklen_t */ +#undef HAVE_SOCKLEN_T + +/* Define if pthread_getspecific() has two args */ +#undef PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS + +/* Define if pthread_attr_getdetachstate() has one arg */ +#undef PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG + +/* Define if we have length field in sockaddr_in */ +#undef HAVE_SOCKADDR_SA_LEN + +/* Define if gethostbyname() handles nnn.nnn.nnn.nnn */ +#undef GETHOSTBYNAME_HANDLES_NAS + +/* Define if getaddrinfo exists and works well enough for APR */ +#undef HAVE_GETADDRINFO + + +/* Make sure we have ssize_t defined to be something */ +#undef ssize_t + +/* switch this on if we have a BeOS version below BONE */ +#if BEOS && !HAVE_BONE_VERSION +#define BEOS_R5 1 +#else +#define BEOS_BONE 1 +#endif + +#endif /* APR_PRIVATE_H */ diff --git a/mmap/unix/Makefile.in b/mmap/unix/Makefile.in index 5ac7b6b27eb..9fc7221ba24 100644 --- a/mmap/unix/Makefile.in +++ b/mmap/unix/Makefile.in @@ -4,8 +4,9 @@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) MKDEP=../../helpers/mkdep.sh LIB=libmmap.a diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 8b8b5440d13..77c1d5ce8b9 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -57,7 +57,7 @@ #include "apr_general.h" #include "apr_mmap.h" #include "apr_errno.h" -#include "unix/fileio.h" +#include "fileio.h" #include "apr_portable.h" /* System headers required for the mmap library */ diff --git a/passwd/Makefile.in b/passwd/Makefile.in index fccf3f31604..b4c08ad4740 100644 --- a/passwd/Makefile.in +++ b/passwd/Makefile.in @@ -6,7 +6,8 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include -INCLUDES=-I$(INCDIR) +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) MKDEP=../helpers/mkdep.sh OBJS=apr_md5.o \ diff --git a/strings/Makefile.in b/strings/Makefile.in index 1871bb83f79..2c10f2c2357 100644 --- a/strings/Makefile.in +++ b/strings/Makefile.in @@ -5,8 +5,9 @@ RM=@RM@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCDIR=../include -INCLUDES=-I$(INCDIR) +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) MKDEP=../helpers/mkdep.sh OBJS=apr_cpystrn.o \ diff --git a/tables/Makefile.in b/tables/Makefile.in index f09cf74f0e0..05aa28c76c0 100644 --- a/tables/Makefile.in +++ b/tables/Makefile.in @@ -5,8 +5,9 @@ RM=@RM@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCDIR=../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) MKDEP=../helpers/mkdep.sh OBJS=apr_tables.o \ diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index 7b157771dc7..ea97d6c3c01 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -5,7 +5,8 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) MKDEP=../../helpers/mkdep.sh LIB=libthreadproc.a diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 311b7520b58..6f91f21e495 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "unix/threadproc.h" +#include "threadproc.h" #include "apr_strings.h" #include "apr_portable.h" diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index 73215e4d789..e29954cda7e 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "unix/threadproc.h" +#include "threadproc.h" apr_status_t apr_detach(void) { diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index e0ce0cf2abf..cd561fa82ce 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -52,11 +52,7 @@ * <http://www.apache.org/>. */ -#ifndef BEOS -#include "unix/threadproc.h" -#else -#include "beos/threadproc.h" -#endif +#include "threadproc.h" #include "apr_private.h" #include "apr_lib.h" #if APR_HAVE_SIGNAL_H diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 896df25437a..c083fb89ea8 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -54,7 +54,7 @@ #include "apr.h" #include "apr_portable.h" -#include "unix/threadproc.h" +#include "threadproc.h" #if APR_HAS_THREADS diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index cb7a995fb86..9843f2e91a6 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -54,7 +54,7 @@ #include "apr.h" #include "apr_portable.h" -#include "unix/threadproc.h" +#include "threadproc.h" #if APR_HAS_THREADS diff --git a/time/unix/Makefile.in b/time/unix/Makefile.in index 925a62840d0..b3134bc9fd2 100644 --- a/time/unix/Makefile.in +++ b/time/unix/Makefile.in @@ -4,8 +4,9 @@ RANLIB=@RANLIB@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCDIR=../../include -INCLUDES=-I$(INCDIR) +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) MKDEP=../../helpers/mkdep.sh OBJS=time.o \ diff --git a/user/unix/Makefile.in b/user/unix/Makefile.in index ebfdad4961b..22642134b2c 100644 --- a/user/unix/Makefile.in +++ b/user/unix/Makefile.in @@ -5,7 +5,8 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) MKDEP=../../helpers/mkdep.sh OBJS=homedir.o From fd898987417343826affd44186cb5723838036a0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 8 Dec 2000 14:30:41 +0000 Subject: [PATCH 0940/7878] As I recall, there were three or four people who thought the current Apache build system was too complex, and at least one who didn't like the current APR-Util build system. Since I am on both lists, I would prefer to not see APR's build system go that way. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60920 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 565625f7e41..20fa179ccd2 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ Apache 2.0 STATUS: -Last modified at [$Date: 2000/12/08 00:23:03 $] +Last modified at [$Date: 2000/12/08 14:30:41 $] Release: @@ -51,7 +51,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Status: Greg +1 (volunteers) * snarf rules.mk(.in) from APRUTIL to simplify makefiles - Status: Greg +1 (volunteers), Sascha +1 + Status: Greg +1 (volunteers), Sascha +1, rbb -0.5 Documentation that needs writing: From cabb4fd554a5af648a3bc9fae609b0f01b44fd45 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Fri, 8 Dec 2000 14:48:39 +0000 Subject: [PATCH 0941/7878] Fix lib directory build on non-unix platforms after moving apr_private.h into include/arch/unix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60921 13f79535-47bb-0310-9956-ffa450edef68 --- lib/Makefile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Makefile.in b/lib/Makefile.in index 182d8f699da..74761502dcb 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -6,7 +6,9 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch/@OSDIR@ +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) MKDEP=../helpers/mkdep.sh OBJS=apr_pools.o From 45a4df1d281c992d132be728da3e2c36b9a65a23 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Fri, 8 Dec 2000 14:49:44 +0000 Subject: [PATCH 0942/7878] Add unix inet_pton.c to OS/2 build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60922 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/inet_pton.c | 1 + 1 file changed, 1 insertion(+) create mode 100644 network_io/os2/inet_pton.c diff --git a/network_io/os2/inet_pton.c b/network_io/os2/inet_pton.c new file mode 100644 index 00000000000..dbd3ac454b0 --- /dev/null +++ b/network_io/os2/inet_pton.c @@ -0,0 +1 @@ +#include "../unix/inet_pton.c" From 3f20d852300f04d95e57a3ef9a42d218e6b8ac93 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Fri, 8 Dec 2000 14:52:33 +0000 Subject: [PATCH 0943/7878] Make sure apr_isdigit() macro is defined by including the appropriate header. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60923 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 3c0fa0c577f..2187ac4d379 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -64,6 +64,7 @@ */ #include "apr.h" +#include "apr_lib.h" #ifdef HAVE_STDLIB_H #include <stdlib.h> From fde947172440dc2643d09166502f945aa0d4b2d3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 8 Dec 2000 17:13:21 +0000 Subject: [PATCH 0944/7878] apr_private.hw goes away, apr_private.h is static in arch/win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60924 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 31 +------------------------------ aprlib.dsp | 31 +------------------------------ 2 files changed, 2 insertions(+), 60 deletions(-) diff --git a/apr.dsp b/apr.dsp index 605232c9a2f..bd9b1ec7d89 100644 --- a/apr.dsp +++ b/apr.dsp @@ -425,36 +425,7 @@ InputPath=.\include\apr.hw # End Source File # Begin Source File -SOURCE=.\include\apr_private.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_private.hw - -!IF "$(CFG)" == "aprlib - Win32 Release" - -# Begin Custom Build -InputPath=.\include\apr_private.hw - -".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr_private.hw .\include\apr_private.h > nul - echo Created apr_private.h from apr_private.hw - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" - -# Begin Custom Build -InputPath=.\include\apr_private.hw - -".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr_private.hw .\include\apr_private.h > nul - echo Created apr_private.h from apr_private.hw - -# End Custom Build - -!ENDIF - +SOURCE=.\include\arch\win32\apr_private.h # End Source File # End Group # Begin Group "External Header Files" diff --git a/aprlib.dsp b/aprlib.dsp index 605232c9a2f..bd9b1ec7d89 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -425,36 +425,7 @@ InputPath=.\include\apr.hw # End Source File # Begin Source File -SOURCE=.\include\apr_private.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_private.hw - -!IF "$(CFG)" == "aprlib - Win32 Release" - -# Begin Custom Build -InputPath=.\include\apr_private.hw - -".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr_private.hw .\include\apr_private.h > nul - echo Created apr_private.h from apr_private.hw - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" - -# Begin Custom Build -InputPath=.\include\apr_private.hw - -".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr_private.hw .\include\apr_private.h > nul - echo Created apr_private.h from apr_private.hw - -# End Custom Build - -!ENDIF - +SOURCE=.\include\arch\win32\apr_private.h # End Source File # End Group # Begin Group "External Header Files" From cc8260753a444ced50bafd4632a614d75fb8bcbb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 8 Dec 2000 17:14:49 +0000 Subject: [PATCH 0945/7878] Copied within cvs to arch/win32/apr_private.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60925 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_private.hw | 181 ----------------------------------------- 1 file changed, 181 deletions(-) delete mode 100644 include/apr_private.hw diff --git a/include/apr_private.hw b/include/apr_private.hw deleted file mode 100644 index 30632b44a10..00000000000 --- a/include/apr_private.hw +++ /dev/null @@ -1,181 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -/* - * Note: - * This is the windows specific autoconf like config file - * which is used to generate apr_private.h at build time. - * Do not put any code into this file which depends on - * APR include files. - */ - -#ifdef WIN32 - -#ifndef APR_CONFIG_H -#define APR_CONFIG_H - -/* Has windows.h already been included? If so, our preferences don't matter, - * but we will still need the winsock things no matter what was included. - * If not, include a restricted set of windows headers to our tastes. - */ -#ifndef _WINDOWS_ -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#ifndef _WIN32_WINNT - -/* Restrict the server to a subset of Windows NT 4.0 header files by default - */ -#define _WIN32_WINNT 0x0400 -#endif -#ifndef NOUSER -#define NOUSER -#endif -#ifndef NOGDI -#define NOGDI -#endif -#ifndef NONLS -#define NONLS -#endif -#ifndef NOMCX -#define NOMCX -#endif -#ifndef NOIME -#define NOIME -#endif -#include <windows.h> -/* - * Add a _very_few_ declarations missing from the restricted set of headers - * (If this list becomes extensive, re-enable the required headers above!) - * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now - */ -#define SW_HIDE 0 -#include <winsock2.h> -#include <mswsock.h> -#endif /* !_WINDOWS_ */ - -#include <sys/types.h> -#include <stddef.h> -#include <stdio.h> -#include <time.h> - -/* Use this section to define all of the HAVE_FOO_H - * that are required to build properly. - */ -#define HAVE_CONIO_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_SIGNAL_H 1 - -#define HAVE_STRICMP 1 -#define HAVE_STRNICMP 1 -#define HAVE_STRDUP 1 -#define HAVE_STRSTR 1 - -#define SIGHUP 1 -/* 2 is used for SIGINT on windows */ -#define SIGQUIT 3 -/* 4 is used for SIGILL on windows */ -#define SIGTRAP 5 -#define SIGIOT 6 -#define SIGBUS 7 -/* 8 is used for SIGFPE on windows */ -#define SIGKILL 9 -#define SIGUSR1 10 -/* 11 is used for SIGSEGV on windows */ -#define SIGUSR2 12 -#define SIGPIPE 13 -#define SIGALRM 14 -/* 15 is used for SIGTERM on windows */ -#define SIGSTKFLT 16 -#define SIGCHLD 17 -#define SIGCONT 18 -#define SIGSTOP 19 -#define SIGTSTP 20 -/* 21 is used for SIGBREAK on windows */ -/* 22 is used for SIGABRT on windows */ -#define SIGTTIN 23 -#define SIGTTOU 24 -#define SIGURG 25 -#define SIGXCPU 26 -#define SIGXFSZ 27 -#define SIGVTALRM 28 -#define SIGPROF 29 -#define SIGWINCH 30 -#define SIGIO 31 - -#define __attribute__(__x) - -/* APR COMPATABILITY FUNCTIONS - * This section should be used to define functions and - * macros which are need to make Windows features look - * like POSIX features. - */ -typedef void (Sigfunc)(int); - -#define strcasecmp(s1, s2) stricmp(s1, s2) -#define sleep(t) Sleep(t * 1000) - -#define SIZEOF_SHORT 2 -#define SIZEOF_INT 4 -#define SIZEOF_LONGLONG 8 -#define SIZEOF_CHAR 1 -#define SIZEOF_SSIZE_T SIZEOF_INT - -unsigned __stdcall SignalHandling(void *); -int thread_ready(void); - -#endif /*APR_CONFIG_H*/ -#endif /*WIN32*/ From 5849de9b127d894f20395f292553f6268ded0c57 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 9 Dec 2000 13:36:57 +0000 Subject: [PATCH 0946/7878] Get this building on BeOS again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60926 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/dso.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arch/beos/dso.h b/include/arch/beos/dso.h index 476e71c8fa4..07da1aeabec 100644 --- a/include/arch/beos/dso.h +++ b/include/arch/beos/dso.h @@ -55,7 +55,7 @@ #ifndef DSO_H #define DSO_H -#include "apr_private.h" +#include "unix/apr_private.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_errno.h" From fe573289c397221197d49681a0eb88da5eba58f8 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 9 Dec 2000 14:57:25 +0000 Subject: [PATCH 0947/7878] OK, so apparently BeOS doesn't yet support files as socket (despite being told it did) but they do say they're going to try and add it soon. This fix is needed for building, but hopefully it'll be reversed soon. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60927 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hints.m4 b/hints.m4 index 3784422db93..90651148e91 100644 --- a/hints.m4 +++ b/hints.m4 @@ -323,7 +323,7 @@ dnl ;; APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) APR_ADDTO(LDFLAGS, [-nodefaultlibs -L/boot/develop/lib/x86 -L/boot/beos/system/lib]) APR_SETIFNULL(EXTRA_LIBS, [-lbind -lsocket -lbe -lroot]) - APR_SETIFNULL(file_as_socket, [1]) + APR_SETIFNULL(file_as_socket, [0]) ;; default) APR_SETIFNULL(file_as_socket, [0]) From f3efcb035a7ff14aa9ee51e1b91909f76a022c99 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sun, 10 Dec 2000 12:16:49 +0000 Subject: [PATCH 0948/7878] Change the includes in the "correct" way to allow building on BeOS :) Submitted by: Ryan Bloom <rbb@covalent.net> Reviewed by: David Reid <dreid@apache.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60928 13f79535-47bb-0310-9956-ffa450edef68 --- dso/beos/Makefile.in | 3 ++- include/arch/beos/dso.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dso/beos/Makefile.in b/dso/beos/Makefile.in index f9a9b293e48..266554101de 100644 --- a/dso/beos/Makefile.in +++ b/dso/beos/Makefile.in @@ -4,7 +4,8 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch -I$(DEFOSDIR) MKDEP=../../helpers/mkdep.sh LIB=libdso.a diff --git a/include/arch/beos/dso.h b/include/arch/beos/dso.h index 07da1aeabec..476e71c8fa4 100644 --- a/include/arch/beos/dso.h +++ b/include/arch/beos/dso.h @@ -55,7 +55,7 @@ #ifndef DSO_H #define DSO_H -#include "unix/apr_private.h" +#include "apr_private.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_errno.h" From 942dd7ca5b6441104c7eb74f8bde339212536e5c Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sun, 10 Dec 2000 21:43:11 +0000 Subject: [PATCH 0949/7878] fix a feature test macro so that unistd.h actually gets included git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60929 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testmmap.c b/test/testmmap.c index 5f5e888dc25..24e924f35e3 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -57,7 +57,7 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_file_io.h" -#if APR_HAS_UNISTD_H +#if APR_HAVE_UNISTD_H #include <unistd.h> #endif #include <stdio.h> From 846c77d0cd9c6c84021a0946b65bfd062472cc84 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sun, 10 Dec 2000 21:44:39 +0000 Subject: [PATCH 0950/7878] include <string.h> for the memset() declaration git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60930 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testfile.c b/test/testfile.c index bf4331e805c..4a2868c905e 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -55,6 +55,7 @@ #include <assert.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> #include "apr_file_io.h" #include "apr_network_io.h" #include "apr_errno.h" From 241a5b2c225ed6d29db9a7daf327085eab2703d5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 11 Dec 2000 19:11:16 +0000 Subject: [PATCH 0951/7878] update the name of the apr_sendfile() test driver git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60931 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/.cvsignore b/test/.cvsignore index 5a01aee06a2..d2927e24117 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -18,7 +18,7 @@ testsock testproc testfile occhild -testsf +sendfile testuuid testsuite testsuite.opt From 602e30523ac476a39e904cc66fb823edc181c63d Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 11 Dec 2000 19:18:31 +0000 Subject: [PATCH 0952/7878] account for apr_private.h* moving around git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60932 13f79535-47bb-0310-9956-ffa450edef68 --- include/.cvsignore | 2 -- include/arch/unix/.cvsignore | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) create mode 100644 include/arch/unix/.cvsignore diff --git a/include/.cvsignore b/include/.cvsignore index e5db22b8d0b..4ac90077a00 100644 --- a/include/.cvsignore +++ b/include/.cvsignore @@ -1,3 +1 @@ apr.h -apr_private.h -apr_private.h.in diff --git a/include/arch/unix/.cvsignore b/include/arch/unix/.cvsignore new file mode 100644 index 00000000000..88320644cd8 --- /dev/null +++ b/include/arch/unix/.cvsignore @@ -0,0 +1 @@ +apr_private.h From 6c0d31d5833e0421b49934d148e0f9a675a67016 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 11 Dec 2000 19:39:15 +0000 Subject: [PATCH 0953/7878] provide a no-HAVE_POLL version of apr_mask_poll_socket() it looks like the Win32 version but no promises about whether or not it works :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60933 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/poll.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index 6436cc1e265..dce36448c80 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -257,6 +257,22 @@ apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, return APR_SUCCESS; } +apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, + apr_int16_t events) +{ + if (events & APR_POLLIN) { + FD_CLR(sock->socketdes, aprset->read); + } + if (events & APR_POLLPRI) { + FD_CLR(sock->socketdes, aprset->except); + } + if (events & APR_POLLOUT) { + FD_CLR(sock->socketdes, aprset->write); + } + return APR_SUCCESS; +} + apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_interval_time_t timeout) { From fc13bab6be13e141c23291e2c5e075eaa7f3661b Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Tue, 12 Dec 2000 11:35:23 +0000 Subject: [PATCH 0954/7878] apr_private.h.in is generated by autoheader, so it should not be in source control. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60934 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/.cvsignore | 1 + include/arch/unix/apr_private.h.in | 390 ----------------------------- 2 files changed, 1 insertion(+), 390 deletions(-) delete mode 100644 include/arch/unix/apr_private.h.in diff --git a/include/arch/unix/.cvsignore b/include/arch/unix/.cvsignore index 88320644cd8..c1e025e0f4c 100644 --- a/include/arch/unix/.cvsignore +++ b/include/arch/unix/.cvsignore @@ -1 +1,2 @@ apr_private.h +apr_private.h.in diff --git a/include/arch/unix/apr_private.h.in b/include/arch/unix/apr_private.h.in deleted file mode 100644 index 5a45825f899..00000000000 --- a/include/arch/unix/apr_private.h.in +++ /dev/null @@ -1,390 +0,0 @@ -/* include/arch/unix/apr_private.h.in. Generated automatically from configure.in by autoheader. */ -#ifndef APR_PRIVATE_H -#define APR_PRIVATE_H - - -/* Define if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -#undef _ALL_SOURCE -#endif - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define to `int' if <sys/types.h> doesn't define. */ -#undef gid_t - -/* Define as __inline if that's what the C compiler calls it. */ -#undef inline - -/* Define to `long' if <sys/types.h> doesn't define. */ -#undef off_t - -/* Define to `int' if <sys/types.h> doesn't define. */ -#undef pid_t - -/* Define if the `setpgrp' function takes no argument. */ -#undef SETPGRP_VOID - -/* Define to `unsigned' if <sys/types.h> doesn't define. */ -#undef size_t - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to `int' if <sys/types.h> doesn't define. */ -#undef uid_t - -/* Various #defines we need to know about */ -#undef HAVE_LOCK_EX -#undef HAVE_F_SETLK -#undef HAVE_CODESET -#undef HAVE_PTHREAD_PROCESS_SHARED -#undef DEV_RANDOM -#undef HAVE_TRUERAND -#undef HAVE_POLLIN -#undef HAVE_isascii - -#undef READDIR_IS_THREAD_SAFE - -#undef NEED_RLIM_T -#undef USEBCOPY - -#undef HAVE_GMTOFF -#undef USE_THREADS - -#undef SIZEOF_SSIZE_T -#undef SIZEOF_SIZE_T -#undef SIZEOF_OFF_T - -#undef HAVE_MM_SHMT_MMFILE - -/* BeOS specific flag */ -#undef HAVE_BONE_VERSION - -/* The number of bytes in a char. */ -#undef SIZEOF_CHAR - -/* The number of bytes in a int. */ -#undef SIZEOF_INT - -/* The number of bytes in a long. */ -#undef SIZEOF_LONG - -/* The number of bytes in a long double. */ -#undef SIZEOF_LONG_DOUBLE - -/* The number of bytes in a long long. */ -#undef SIZEOF_LONG_LONG - -/* The number of bytes in a short. */ -#undef SIZEOF_SHORT - -/* Define if you have the bzero function. */ -#undef HAVE_BZERO - -/* Define if you have the dlopen function. */ -#undef HAVE_DLOPEN - -/* Define if you have the fork function. */ -#undef HAVE_FORK - -/* Define if you have the getipnodebyaddr function. */ -#undef HAVE_GETIPNODEBYADDR - -/* Define if you have the getipnodebyname function. */ -#undef HAVE_GETIPNODEBYNAME - -/* Define if you have the getpass function. */ -#undef HAVE_GETPASS - -/* Define if you have the getrlimit function. */ -#undef HAVE_GETRLIMIT - -/* Define if you have the gmtime_r function. */ -#undef HAVE_GMTIME_R - -/* Define if you have the hstrerror function. */ -#undef HAVE_HSTRERROR - -/* Define if you have the iconv function. */ -#undef HAVE_ICONV - -/* Define if you have the localtime_r function. */ -#undef HAVE_LOCALTIME_R - -/* Define if you have the memmove function. */ -#undef HAVE_MEMMOVE - -/* Define if you have the mmap function. */ -#undef HAVE_MMAP - -/* Define if you have the nl_langinfo function. */ -#undef HAVE_NL_LANGINFO - -/* Define if you have the poll function. */ -#undef HAVE_POLL - -/* Define if you have the pthread_key_delete function. */ -#undef HAVE_PTHREAD_KEY_DELETE - -/* Define if you have the semctl function. */ -#undef HAVE_SEMCTL - -/* Define if you have the semget function. */ -#undef HAVE_SEMGET - -/* Define if you have the send_file function. */ -#undef HAVE_SEND_FILE - -/* Define if you have the sendfile function. */ -#undef HAVE_SENDFILE - -/* Define if you have the setrlimit function. */ -#undef HAVE_SETRLIMIT - -/* Define if you have the setsid function. */ -#undef HAVE_SETSID - -/* Define if you have the sigaction function. */ -#undef HAVE_SIGACTION - -/* Define if you have the strcasecmp function. */ -#undef HAVE_STRCASECMP - -/* Define if you have the strdup function. */ -#undef HAVE_STRDUP - -/* Define if you have the stricmp function. */ -#undef HAVE_STRICMP - -/* Define if you have the strncasecmp function. */ -#undef HAVE_STRNCASECMP - -/* Define if you have the strnicmp function. */ -#undef HAVE_STRNICMP - -/* Define if you have the strstr function. */ -#undef HAVE_STRSTR - -/* Define if you have the waitpid function. */ -#undef HAVE_WAITPID - -/* Define if you have the writev function. */ -#undef HAVE_WRITEV - -/* Define if you have the <ByteOrder.h> header file. */ -#undef HAVE_BYTEORDER_H - -/* Define if you have the <arpa/inet.h> header file. */ -#undef HAVE_ARPA_INET_H - -/* Define if you have the <conio.h> header file. */ -#undef HAVE_CONIO_H - -/* Define if you have the <crypt.h> header file. */ -#undef HAVE_CRYPT_H - -/* Define if you have the <ctype.h> header file. */ -#undef HAVE_CTYPE_H - -/* Define if you have the <dir.h> header file. */ -#undef HAVE_DIR_H - -/* Define if you have the <dirent.h> header file. */ -#undef HAVE_DIRENT_H - -/* Define if you have the <dl.h> header file. */ -#undef HAVE_DL_H - -/* Define if you have the <dlfcn.h> header file. */ -#undef HAVE_DLFCN_H - -/* Define if you have the <errno.h> header file. */ -#undef HAVE_ERRNO_H - -/* Define if you have the <fcntl.h> header file. */ -#undef HAVE_FCNTL_H - -/* Define if you have the <iconv.h> header file. */ -#undef HAVE_ICONV_H - -/* Define if you have the <io.h> header file. */ -#undef HAVE_IO_H - -/* Define if you have the <kernel/OS.h> header file. */ -#undef HAVE_KERNEL_OS_H - -/* Define if you have the <langinfo.h> header file. */ -#undef HAVE_LANGINFO_H - -/* Define if you have the <limits.h> header file. */ -#undef HAVE_LIMITS_H - -/* Define if you have the <malloc.h> header file. */ -#undef HAVE_MALLOC_H - -/* Define if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define if you have the <net/errno.h> header file. */ -#undef HAVE_NET_ERRNO_H - -/* Define if you have the <netdb.h> header file. */ -#undef HAVE_NETDB_H - -/* Define if you have the <netinet/in.h> header file. */ -#undef HAVE_NETINET_IN_H - -/* Define if you have the <netinet/tcp.h> header file. */ -#undef HAVE_NETINET_TCP_H - -/* Define if you have the <osreldate.h> header file. */ -#undef HAVE_OSRELDATE_H - -/* Define if you have the <poll.h> header file. */ -#undef HAVE_POLL_H - -/* Define if you have the <process.h> header file. */ -#undef HAVE_PROCESS_H - -/* Define if you have the <pthread.h> header file. */ -#undef HAVE_PTHREAD_H - -/* Define if you have the <pwd.h> header file. */ -#undef HAVE_PWD_H - -/* Define if you have the <signal.h> header file. */ -#undef HAVE_SIGNAL_H - -/* Define if you have the <stdarg.h> header file. */ -#undef HAVE_STDARG_H - -/* Define if you have the <stddef.h> header file. */ -#undef HAVE_STDDEF_H - -/* Define if you have the <stdio.h> header file. */ -#undef HAVE_STDIO_H - -/* Define if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the <sys/file.h> header file. */ -#undef HAVE_SYS_FILE_H - -/* Define if you have the <sys/mman.h> header file. */ -#undef HAVE_SYS_MMAN_H - -/* Define if you have the <sys/poll.h> header file. */ -#undef HAVE_SYS_POLL_H - -/* Define if you have the <sys/resource.h> header file. */ -#undef HAVE_SYS_RESOURCE_H - -/* Define if you have the <sys/select.h> header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define if you have the <sys/sem.h> header file. */ -#undef HAVE_SYS_SEM_H - -/* Define if you have the <sys/sendfile.h> header file. */ -#undef HAVE_SYS_SENDFILE_H - -/* Define if you have the <sys/signal.h> header file. */ -#undef HAVE_SYS_SIGNAL_H - -/* Define if you have the <sys/socket.h> header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define if you have the <sys/time.h> header file. */ -#undef HAVE_SYS_TIME_H - -/* Define if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define if you have the <sys/uio.h> header file. */ -#undef HAVE_SYS_UIO_H - -/* Define if you have the <sys/wait.h> header file. */ -#undef HAVE_SYS_WAIT_H - -/* Define if you have the <sysapi.h> header file. */ -#undef HAVE_SYSAPI_H - -/* Define if you have the <sysgtime.h> header file. */ -#undef HAVE_SYSGTIME_H - -/* Define if you have the <termios.h> header file. */ -#undef HAVE_TERMIOS_H - -/* Define if you have the <time.h> header file. */ -#undef HAVE_TIME_H - -/* Define if you have the <tpfeq.h> header file. */ -#undef HAVE_TPFEQ_H - -/* Define if you have the <tpfio.h> header file. */ -#undef HAVE_TPFIO_H - -/* Define if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Define if you have the <unix.h> header file. */ -#undef HAVE_UNIX_H - -/* Define if you have the iconv library (-liconv). */ -#undef HAVE_LIBICONV - -/* Define if you have the nsl library (-lnsl). */ -#undef HAVE_LIBNSL - -/* Define if you have the socket library (-lsocket). */ -#undef HAVE_LIBSOCKET - -/* Define if you have the truerand library (-ltruerand). */ -#undef HAVE_LIBTRUERAND - -/* Define if system uses EBCDIC */ -#undef CHARSET_EBCDIC - -/* Whether you have socklen_t */ -#undef HAVE_SOCKLEN_T - -/* Define if pthread_getspecific() has two args */ -#undef PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS - -/* Define if pthread_attr_getdetachstate() has one arg */ -#undef PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG - -/* Define if we have length field in sockaddr_in */ -#undef HAVE_SOCKADDR_SA_LEN - -/* Define if gethostbyname() handles nnn.nnn.nnn.nnn */ -#undef GETHOSTBYNAME_HANDLES_NAS - -/* Define if getaddrinfo exists and works well enough for APR */ -#undef HAVE_GETADDRINFO - - -/* Make sure we have ssize_t defined to be something */ -#undef ssize_t - -/* switch this on if we have a BeOS version below BONE */ -#if BEOS && !HAVE_BONE_VERSION -#define BEOS_R5 1 -#else -#define BEOS_BONE 1 -#endif - -#endif /* APR_PRIVATE_H */ From eaceae5deb8f08a48898e364bb174b7cb2e0fc9e Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Tue, 12 Dec 2000 12:01:12 +0000 Subject: [PATCH 0955/7878] "... but for the carrots, it's Armageddon!" -- Tool git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60935 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 20fa179ccd2..d0426324853 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ Apache 2.0 STATUS: -Last modified at [$Date: 2000/12/08 14:30:41 $] +Last modified at [$Date: 2000/12/12 12:01:12 $] Release: @@ -48,11 +48,18 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: be set up to build only the required version. * use libtool - Status: Greg +1 (volunteers) + Status: Greg +1 (volunteers), Ryan +1(?) + Waiting for commentary from jimjag * snarf rules.mk(.in) from APRUTIL to simplify makefiles Status: Greg +1 (volunteers), Sascha +1, rbb -0.5 + * add apr_crypt() and APR_HAS_CRYPT for apps to determine whether the + crypt() function is available, and a way to call it (whether it is + located in libc, libcrypt, or libufc) + Status: Greg +1 (volunteers) + + Documentation that needs writing: * API documentation From cf97280a1733ab740ba4dc3768c577b6ec98b041 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Tue, 12 Dec 2000 12:03:41 +0000 Subject: [PATCH 0956/7878] auto-rebuild the exports file when a header changes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60936 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 29 ++++++++++++++++++++++------- buildconf | 6 ++---- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Makefile.in b/Makefile.in index 94f968a1fac..7c226ada006 100644 --- a/Makefile.in +++ b/Makefile.in @@ -31,6 +31,8 @@ SUBDIRS=@SUBDIRS@ LIBAPR = @LIBPREFIX@apr.a +TARGET_EXPORTS = apr.exports + # # Rules for turning inputs into outputs # @@ -41,7 +43,7 @@ LIBAPR = @LIBPREFIX@apr.a # Rules for building specific targets, starting with 'all' for # building the entire package. # -all: Makefile $(LIBAPR) +all: Makefile $(LIBAPR) delete-exports $(TARGET_EXPORTS) $(LIBAPR): $(MODULES) subdirs @rm -rf objs @@ -52,19 +54,22 @@ $(LIBAPR): $(MODULES) subdirs $(RANLIB) $@ clean: subdirs_clean - $(RM) -f *.o *.a *.so objs/*.o + $(RM) -f *.o *.a *.so objs/*.o apr.exports depend: subdirs_depend distclean: subdirs_distclean - -$(RM) -f include/apr.h include/apr_private.h include/apr_private.h.in + -$(RM) -f include/apr.h include/arch/unix/apr_private.h -$(RM) -f *.o *.a *.so - -$(RM) -f config.cache config.status config.log configure apr.exports + -$(RM) -f config.cache config.status config.log -$(RM) -f Makefile -$(RM) -f APRVARS -$(RM) -rf objs cd test; $(MAKE) distclean; cd .. +extraclean: distclean + -$(RM) -f configure include/arch/unix/apr_private.h.in + subdirs: @for i in $(SUBDIRS); do \ echo "===> $(SDP)lib/apr/$$i"; \ @@ -100,8 +105,18 @@ subdirs_distclean: install: all -exports: - perl ./helpers/make_export.pl -o ./apr.exports include/*.h +delete-exports: + @if test -f $(TARGET_EXPORTS); then \ + headers="`find include/*.h -maxdepth 0 -newer $(TARGET_EXPORTS)`" ; \ + if test -n "$$headers"; then \ + echo Found newer headers. Will rebuild $(TARGET_EXPORTS). ; \ + echo $(RM) -f $(TARGET_EXPORTS) ; \ + $(RM) -f $(TARGET_EXPORTS) ; \ + fi \ + fi + +$(TARGET_EXPORTS): + perl ./helpers/make_export.pl -o $@ include/*.h docs: ./helpers/scandoc -i./helpers/default.pl -p./docs/ ./include/*.h @@ -116,6 +131,6 @@ test: $(LIBAPR) break; \ fi \ done ) - + # DO NOT REMOVE docs: $(INCDIR)/*.h diff --git a/buildconf b/buildconf index ae721a55f1e..e0cae5e0d2e 100755 --- a/buildconf +++ b/buildconf @@ -1,8 +1,6 @@ #!/bin/sh -autoconf;autoheader +autoheader +autoconf (cd shmem/unix/mm && autoconf) - -perl ./helpers/make_export.pl -o ./apr.exports include/*.h - From c75f8159ef7a118743c73cae0d49ffea0e72dd8a Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 12 Dec 2000 12:25:50 +0000 Subject: [PATCH 0957/7878] When using the AIX compiler, specify LANGLVL=extended so that the compiler isn't so ornery. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60937 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/hints.m4 b/hints.m4 index 90651148e91..edeef7adb29 100644 --- a/hints.m4 +++ b/hints.m4 @@ -66,6 +66,7 @@ case "$host" in AC_PROG_CC if test "$GCC" != "yes"; then APR_ADDTO(CFLAGS, [-qHALT=E]) + APR_ADDTO(CFLAGS, [-qLANGLVL=extended]) fi ;; *-apollo-*) From 5d112acf730f0d5fb922d734d3dc70d8ae4979ed Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 12 Dec 2000 12:30:26 +0000 Subject: [PATCH 0958/7878] Only support IPv6 if getaddrinfo() exists, because that is the only IPv6-capable resolver function we support. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60938 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 14 +++++++++++++- include/apr.h.in | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index a27e309ff39..435f76a99d7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ Changes with APR a9 + *) Only support IPv6 if we have sockaddr_in and a working + getaddrinfo(). [Jeff Trawick] + *) Add apr_parse_addr_port() for parsing the hostname:port portion of URLs and similar strings. [Jeff Trawick] diff --git a/configure.in b/configure.in index 4ff235d7fdf..687d3dbfe2b 100644 --- a/configure.in +++ b/configure.in @@ -762,7 +762,19 @@ APR_CHECK_WORKING_GETADDRINFO AC_CHECK_FUNCS(getipnodebyname) AC_CHECK_FUNCS(getipnodebyaddr) APR_CHECK_SOCKADDR_IN6 -AC_SUBST(have_sockaddr_in6) +AC_MSG_CHECKING(if APR supports IPv6) +have_ipv6="0" +if test "x$have_sockaddr_in6" = "x1"; then + if test "x$ac_cv_working_getaddrinfo" = "xyes"; then + have_ipv6="1" + AC_MSG_RESULT("yes") + else + AC_MSG_RESULT("no -- no working getaddrinfo") + fi +else + AC_MSG_RESULT("no -- no sockaddr_in6"); +fi +AC_SUBST(have_ipv6) dnl #----------------------------- Construct the files diff --git a/include/apr.h.in b/include/apr.h.in index 5a3a20884c9..5ef81146861 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -77,7 +77,7 @@ #define APR_HAVE_STRSTR @have_strstr@ #define APR_HAVE_MEMMOVE @have_memmove@ #define APR_HAVE_BZERO @have_bzero@ -#define APR_HAVE_IPV6 @have_sockaddr_in6@ +#define APR_HAVE_IPV6 @have_ipv6@ #if APR_HAVE_SYS_TYPES_H From e8c61e20f126824bb879a0b5db3409e69f342926 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Tue, 12 Dec 2000 12:42:03 +0000 Subject: [PATCH 0959/7878] Include DSO support on OS/2 by default as DLL loading is supported by the native API, no libdl needed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60939 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 687d3dbfe2b..3b7e91b8cdb 100644 --- a/configure.in +++ b/configure.in @@ -489,7 +489,7 @@ AC_ARG_ENABLE(dso, fi if test "$tempdso" = "no"; then case $OS in - *os390) + *os390|*-os2*) tempdso="yes" ;; esac From c1d58b61cf9367cc62deb6875a52ccb400ce7ac1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 12 Dec 2000 14:47:35 +0000 Subject: [PATCH 0960/7878] Just a forward pointer git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60940 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 435f76a99d7..683b9675cd7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ Changes with APR a9 + + *) Removed the iconv implementation from the i18n/unix/iconv branch. + This now resides in the apr-iconv repository, and will be ported + over time to use native apr types (e.g. apr_dso) for portability. + *) Only support IPv6 if we have sockaddr_in and a working getaddrinfo(). [Jeff Trawick] From 510547558b1546546e537a89aa337afb76e77a2c Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 12 Dec 2000 15:12:10 +0000 Subject: [PATCH 0961/7878] Get rid of "-maxdepth 0" on the find invocation. This breaks on Tru64 and FreeBSD, and I can't tell that it helps anyway. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60941 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 7c226ada006..c9b83118e0e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -107,7 +107,7 @@ install: all delete-exports: @if test -f $(TARGET_EXPORTS); then \ - headers="`find include/*.h -maxdepth 0 -newer $(TARGET_EXPORTS)`" ; \ + headers="`find include/*.h -newer $(TARGET_EXPORTS)`" ; \ if test -n "$$headers"; then \ echo Found newer headers. Will rebuild $(TARGET_EXPORTS). ; \ echo $(RM) -f $(TARGET_EXPORTS) ; \ From 27128cc61b8ef6543ad18a4bab6a1beafbb43f20 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 12 Dec 2000 16:56:19 +0000 Subject: [PATCH 0962/7878] Dusting before A9 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60942 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_private.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 30632b44a10..00765bb3a74 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -54,16 +54,14 @@ /* * Note: - * This is the windows specific autoconf like config file - * which is used to generate apr_private.h at build time. - * Do not put any code into this file which depends on - * APR include files. + * This is the windows specific autoconf-like config file + * which unix would create at build time. */ #ifdef WIN32 -#ifndef APR_CONFIG_H -#define APR_CONFIG_H +#ifndef APR_PRIVATE_H +#define APR_PRIVATE_H /* Has windows.h already been included? If so, our preferences don't matter, * but we will still need the winsock things no matter what was included. @@ -177,5 +175,5 @@ typedef void (Sigfunc)(int); unsigned __stdcall SignalHandling(void *); int thread_ready(void); -#endif /*APR_CONFIG_H*/ +#endif /*APR_PRIVATE_H*/ #endif /*WIN32*/ From 77859ed8114016e3a64f6c53ee2a39d2d3a34112 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 12 Dec 2000 17:42:04 +0000 Subject: [PATCH 0963/7878] Fix build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60943 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 9 ++++----- aprlib.dsp | 9 ++++----- aprlibdll.dsp | 14 ++++++-------- libapr.dsp | 14 ++++++-------- 4 files changed, 20 insertions(+), 26 deletions(-) diff --git a/apr.dsp b/apr.dsp index bd9b1ec7d89..dec6160d3a5 100644 --- a/apr.dsp +++ b/apr.dsp @@ -42,9 +42,8 @@ CPP=cl.exe RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibR\aprlib" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -68,8 +67,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibD\aprlib" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/aprlib.dsp b/aprlib.dsp index bd9b1ec7d89..dec6160d3a5 100644 --- a/aprlib.dsp +++ b/aprlib.dsp @@ -42,9 +42,8 @@ CPP=cl.exe RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibR\aprlib" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -68,8 +67,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibD\aprlib" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/aprlibdll.dsp b/aprlibdll.dsp index efe63d47650..06033f62d38 100644 --- a/aprlibdll.dsp +++ b/aprlibdll.dsp @@ -42,9 +42,8 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\aprlibdll" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -53,7 +52,7 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:0x6EE0000 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:0x6EE0000 # ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:0x6EE0000 !ELSEIF "$(CFG)" == "aprlibdll - Win32 Debug" @@ -69,9 +68,8 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c -# ADD CPP /nologo /MDd /W3 /GX /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c -# SUBTRACT CPP /YX +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\aprlibdll" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -80,7 +78,7 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:0x6EE0000 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /base:0x6EE0000 # ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /base:0x6EE00000 # SUBTRACT LINK32 /incremental:no /map diff --git a/libapr.dsp b/libapr.dsp index efe63d47650..06033f62d38 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -42,9 +42,8 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\aprlibdll" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -53,7 +52,7 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /libpath:"LibR" /base:0x6EE0000 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:0x6EE0000 # ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:0x6EE0000 !ELSEIF "$(CFG)" == "aprlibdll - Win32 Debug" @@ -69,9 +68,8 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /ZI /c -# ADD CPP /nologo /MDd /W3 /GX /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /FD /ZI /c -# SUBTRACT CPP /YX +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\aprlibdll" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -80,7 +78,7 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /libpath:"LibD" /base:0x6EE0000 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /base:0x6EE0000 # ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /base:0x6EE00000 # SUBTRACT LINK32 /incremental:no /map From f0a264bc70cc48257a0f26959c5a26b40c841bff Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Wed, 13 Dec 2000 11:09:46 +0000 Subject: [PATCH 0964/7878] We need to define this correctly or it's never set and we don't set the correct values. This caused the tests to fail on BeOS and maybe other systems as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60945 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/mm/aclocal.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shmem/unix/mm/aclocal.m4 b/shmem/unix/mm/aclocal.m4 index 08357b66346..74b4a5eef5f 100644 --- a/shmem/unix/mm/aclocal.m4 +++ b/shmem/unix/mm/aclocal.m4 @@ -395,7 +395,7 @@ else ac_cv_maxsegsize=0 msg=unknown fi -MM_SHM_SEGSIZE=$ac_cv_maxsegsize +MM_SHM_MAXSEGSIZE=$ac_cv_maxsegsize test ".$msg" = .unknown && AC_MSG_ERROR([Unable to determine maximum shared memory segment size]) AC_MSG_RESULT([$msg]) AC_DEFINE_UNQUOTED(MM_SHM_MAXSEGSIZE, $MM_SHM_MAXSEGSIZE) From a53f94d16ced20d0daa84b30a463cae9b9ca3475 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 13 Dec 2000 22:17:20 +0000 Subject: [PATCH 0965/7878] apr_get_ipaddr(): return IPv4-style strings for IPv4-mapped IPv6 addresses git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60946 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 2187ac4d379..50d9bc6f8ed 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -117,6 +117,16 @@ apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr) sockaddr->ipaddr_ptr, *addr, sockaddr->addr_str_len); +#if APR_HAVE_IPV6 + if (sockaddr->sa.sin.sin_family == AF_INET6 && + IN6_IS_ADDR_V4MAPPED(sockaddr->ipaddr_ptr)) { + /* This is an IPv4-mapped IPv6 address; drop the leading + * part of the address string so we're left with the familiar + * IPv4 format. + */ + *addr += strlen("::ffff:"); + } +#endif return APR_SUCCESS; } From 1063d3dad90d273e0f551a5908754b7e384593b6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 13 Dec 2000 22:30:22 +0000 Subject: [PATCH 0966/7878] Add apr_getnameinfo(), which uses getnameinfo() when APR_HAVE_IPV6 is defined. APR_HAVE_IPV6 will only be defined if getnameinfo() is present. Still to do: Switch to this in Apache and axe apr_get_hostname(). OS/2 and Win32 logic for reporting getaddrinfo() failures is from existing code. The OS/2 code doesn't look right to me (need to add APR_OS_START_xyz?) I'm not sure what is needed for pre-BONE BeOS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60947 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 +++++ configure.in | 10 ++++++-- include/apr_network_io.h | 10 ++++++++ network_io/unix/sa_common.c | 51 +++++++++++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 683b9675cd7..3447e5efb8b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +Changes with APR b1 + + *) Add apr_getnameinfo(), a replacement for apr_get_hostname() which + supports IPv6 and will be friendlier for use with eventual + SOCK_DGRAM support. [Jeff Trawick] + Changes with APR a9 *) Removed the iconv implementation from the i18n/unix/iconv branch. diff --git a/configure.in b/configure.in index 3b7e91b8cdb..a60bd8b43ee 100644 --- a/configure.in +++ b/configure.in @@ -758,7 +758,9 @@ APR_CHECK_GETHOSTBYNAME_NAS echo $ac_n "${nl}Checking for IPv6 Networking support...${nl}" dnl # Start of checking for IPv6 support... AC_SEARCH_LIBS(getaddrinfo, inet6) +AC_SEARCH_LIBS(getnameinfo, inet6) APR_CHECK_WORKING_GETADDRINFO +AC_CHECK_FUNCS(getnameinfo) AC_CHECK_FUNCS(getipnodebyname) AC_CHECK_FUNCS(getipnodebyaddr) APR_CHECK_SOCKADDR_IN6 @@ -766,8 +768,12 @@ AC_MSG_CHECKING(if APR supports IPv6) have_ipv6="0" if test "x$have_sockaddr_in6" = "x1"; then if test "x$ac_cv_working_getaddrinfo" = "xyes"; then - have_ipv6="1" - AC_MSG_RESULT("yes") + if test "x$ac_cv_func_getnameinfo" = "xyes"; then + have_ipv6="1" + AC_MSG_RESULT("yes") + else + AC_MSG_RESULT("no -- no getnameinfo") + fi else AC_MSG_RESULT("no -- no working getaddrinfo") fi diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 219fbfbde5b..4b37a61ed1e 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -305,6 +305,16 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, apr_int32_t flags, apr_pool_t *p); +/** + * Look up the host name from an apr_sockaddr_t. + * @param hostname The hostname. + * @param sa The apr_sockaddr_t. + * @param flags Special processing flags. + */ +apr_status_t apr_getnameinfo(char **hostname, + apr_sockaddr_t *sa, + apr_int32_t flags); + /** * Parse hostname/IP address with scope id and port. * diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 50d9bc6f8ed..a8fb032aec3 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -385,6 +385,57 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, return APR_SUCCESS; } +apr_status_t apr_getnameinfo(char **hostname, apr_sockaddr_t *sockaddr, + apr_int32_t flags) +{ +#if defined(HAVE_GETNAMEINFO) && APR_HAVE_IPV6 + int rc; +#if defined(NI_MAXHOST) + char tmphostname[NI_MAXHOST]; +#else + char tmphostname[256]; +#endif + + h_errno = 0; /* don't know if it is portable for getnameinfo() to set h_errno */ + rc = getnameinfo((const struct sockaddr *)&sockaddr->sa, sockaddr->salen, + tmphostname, sizeof(tmphostname), NULL, 0, + /* flags != 0 ? flags : */ NI_NAMEREQD); + if (rc != 0) { + *hostname = NULL; + /* XXX I have no idea if this is okay. I don't see any info + * about getnameinfo() returning anything other than good or bad. + */ + if (h_errno) { + return h_errno + APR_OS_START_SYSERR; + } + else { + return APR_NOTFOUND; + } + } + *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, + tmphostname); + return APR_SUCCESS; +#else + struct hostent *hptr; + + hptr = gethostbyaddr((char *)&sockaddr->sa.sin.sin_addr, + sizeof(struct in_addr), + AF_INET); + if (hptr) { + *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, hptr->h_name); + return APR_SUCCESS; + } + *hostname = NULL; +#if defined(WIN32) + return apr_get_netos_error(); +#elif defined(OS2) + return h_errno; +#else + return h_errno + APR_OS_START_SYSERR; +#endif +#endif +} + apr_status_t apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname) { struct servent *se; From 6f1e352e5bb98270f4e23daaf93d920c73ebdd5a Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 14 Dec 2000 10:28:31 +0000 Subject: [PATCH 0967/7878] Describe APR_OS_START_CANONERR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60948 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_errno.h b/include/apr_errno.h index 1b276f2e7f1..8c011b0e20d 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -87,6 +87,8 @@ char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); * APR_OS_START_STATUS is where the APR specific status codes should start. * APR_OS_START_USEERR are reserved for applications that use APR that * layer their own error codes along with APR's. + * APR_OS_START_CANONERR is where APR versions of errno values are defined + * on systems which don't have the corresponding errno. * APR_OS_START_SYSERR should be used for system error values on * each platform. */ From 547feaf7d1a9863d417beb3ede7c195d3e4a66bc Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Thu, 14 Dec 2000 11:10:05 +0000 Subject: [PATCH 0968/7878] one little kick from Gohan and the baby Cell was destroyed... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60949 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index d0426324853..271197371c2 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ -Apache 2.0 STATUS: -Last modified at [$Date: 2000/12/12 12:01:12 $] +APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- +Last modified at [$Date: 2000/12/14 11:10:05 $] Release: @@ -59,6 +59,15 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: located in libc, libcrypt, or libufc) Status: Greg +1 (volunteers) + * apr_dso_load() should (uniformly) add a cleanup to unload the DSO. + Currently, the per-platform DSO loading is inconsistent in this + regard. + + * apr_create_lock() changes: + - It ignores the "type" parameter, so toss it. + - The fname param is allowed to be NULL on the Unix platform. + Change it to always use the passed value, and check callers. + Documentation that needs writing: From 13439409189a73a8e05ebc98b3a442959f75599d Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 14 Dec 2000 15:57:08 +0000 Subject: [PATCH 0969/7878] add apr_getnameinfo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60950 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 1 + libapr.def | 1 + 2 files changed, 2 insertions(+) diff --git a/aprlib.def b/aprlib.def index 2d7813108fb..9b9d9f6cbe6 100644 --- a/aprlib.def +++ b/aprlib.def @@ -89,6 +89,7 @@ EXPORTS apr_set_port apr_get_inaddr apr_parse_addr_port + apr_getnameinfo ; ; diff --git a/libapr.def b/libapr.def index 2d7813108fb..9b9d9f6cbe6 100644 --- a/libapr.def +++ b/libapr.def @@ -89,6 +89,7 @@ EXPORTS apr_set_port apr_get_inaddr apr_parse_addr_port + apr_getnameinfo ; ; From 22725587028b73392c0f088a265c099ab60f88f3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 14 Dec 2000 16:04:08 +0000 Subject: [PATCH 0970/7878] tweak some comments, restore some commented-out logic in the call to getnameinfo(), free the storage returned by getaddrinfo() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60951 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index a8fb032aec3..14cd7241b5f 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -239,7 +239,11 @@ apr_status_t apr_parse_addr_port(char **addr, /* now handle the hostname */ addrlen = lastchar - str + 1; -#if APR_HAVE_IPV6 /* XXX don't require this; would need to pass char[] for ipaddr and always define APR_INET6 */ +/* XXX we don't really have to require APR_HAVE_IPV6 for this; + * just pass char[] for ipaddr (so we don't depend on struct in6_addr) + * and always define APR_INET6 + */ +#if APR_HAVE_IPV6 if (*str == '[') { const char *end_bracket = memchr(str, ']', addrlen); struct in6_addr ipaddr; @@ -253,7 +257,7 @@ apr_status_t apr_parse_addr_port(char **addr, /* handle scope id; this is the only context where it is allowed */ scope_delim = memchr(str, '%', addrlen); if (scope_delim) { - if (scope_delim == end_bracket - 1) { /* '%' without scope identifier */ + if (scope_delim == end_bracket - 1) { /* '%' without scope id */ *port = 0; return APR_EINVAL; } @@ -331,6 +335,7 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, } (*sa)->sa.sin.sin_family = ai->ai_family; memcpy(&(*sa)->sa, ai->ai_addr, ai->ai_addrlen); + freeaddrinfo(ai); } else { if (family == APR_UNSPEC) { @@ -343,7 +348,7 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, set_sockaddr_vars(*sa, (*sa)->sa.sin.sin_family); #else if (family == APR_UNSPEC) { - (*sa)->sa.sin.sin_family = APR_INET; /* we don't yet support IPv6 here */ + (*sa)->sa.sin.sin_family = APR_INET; /* we don't support IPv6 here */ } else { (*sa)->sa.sin.sin_family = family; @@ -397,9 +402,13 @@ apr_status_t apr_getnameinfo(char **hostname, apr_sockaddr_t *sockaddr, #endif h_errno = 0; /* don't know if it is portable for getnameinfo() to set h_errno */ + /* default flags are NI_NAMREQD; otherwise, getnameinfo() will return + * a numeric address string if it fails to resolve the host name; + * that is *not* what we want here + */ rc = getnameinfo((const struct sockaddr *)&sockaddr->sa, sockaddr->salen, tmphostname, sizeof(tmphostname), NULL, 0, - /* flags != 0 ? flags : */ NI_NAMEREQD); + flags != 0 ? flags : NI_NAMEREQD); if (rc != 0) { *hostname = NULL; /* XXX I have no idea if this is okay. I don't see any info From ad53403c53d426cdcde932f508f1866d6fa3e7f9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 14 Dec 2000 18:42:38 +0000 Subject: [PATCH 0971/7878] Fix a bug in apr_accept() for Win32 and Unix where the local apr_sockaddr_t in the new connected socket was not initialized properly. This could result in a bad string for apr_get_ipaddr(), among other things. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60952 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ network_io/unix/sockets.c | 9 +++++++++ network_io/win32/sockets.c | 9 +++++++++ 3 files changed, 23 insertions(+) diff --git a/CHANGES b/CHANGES index 3447e5efb8b..4696cc2250c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Fix a bug in apr_accept() for Win32 and Unix where the local + apr_sockaddr_t in the new connected socket was not initialized + properly. This could result in a bad string for apr_get_ipaddr(), + among other things. [Jeff Trawick] + *) Add apr_getnameinfo(), a replacement for apr_get_hostname() which supports IPv6 and will be friendlier for use with eventual SOCK_DGRAM support. [Jeff Trawick] diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 9f4cd6b20ac..13c721be8c4 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -205,6 +205,15 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return errno; } *(*new)->local_addr = *sock->local_addr; + /* fix up any pointers which are no longer valid */ + if (sock->local_addr->sa.sin.sin_family == AF_INET) { + (*new)->local_addr->ipaddr_ptr = &(*new)->local_addr->sa.sin.sin_addr; + } +#if APR_HAVE_IPV6 + else if (sock->local_addr->sa.sin.sin_family == AF_INET6) { + (*new)->local_addr->ipaddr_ptr = &(*new)->local_addr->sa.sin6.sin6_addr; + } +#endif if (sock->local_port_unknown) { /* not likely for a listening socket, but theoretically possible :) */ diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 0aed50f27bc..7cff92122bc 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -232,6 +232,15 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return apr_get_netos_error(); } *(*new)->local_addr = *sock->local_addr; + /* fix up any pointers which are no longer valid */ + if (sock->local_addr->sa.sin.sin_family == AF_INET) { + (*new)->local_addr->ipaddr_ptr = &(*new)->local_addr->sa.sin.sin_addr; + } +#if APR_HAVE_IPV6 + else if (sock->local_addr->sa.sin.sin_family == AF_INET6) { + (*new)->local_addr->ipaddr_ptr = &(*new)->local_addr->sa.sin6.sin6_addr; + } +#endif if (sock->local_port_unknown) { /* not likely for a listening socket, but theoretically possible :) */ From 8c687559443b3c9f5e569e4ed1cba0f1568bd031 Mon Sep 17 00:00:00 2001 From: Ben Collins-Sussman <sussman@apache.org> Date: Thu, 14 Dec 2000 18:59:03 +0000 Subject: [PATCH 0972/7878] * sa_common.c (apr_get_ipaddr): FreeBSD fix from Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60953 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 14cd7241b5f..e9677cb532f 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -119,7 +119,7 @@ apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr) sockaddr->addr_str_len); #if APR_HAVE_IPV6 if (sockaddr->sa.sin.sin_family == AF_INET6 && - IN6_IS_ADDR_V4MAPPED(sockaddr->ipaddr_ptr)) { + IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sockaddr->ipaddr_ptr)) { /* This is an IPv4-mapped IPv6 address; drop the leading * part of the address string so we're left with the familiar * IPv4 format. From 1cb720abaf15b9e4a5eee7fabab8364193bb8e46 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Fri, 15 Dec 2000 12:57:50 +0000 Subject: [PATCH 0973/7878] This allows BeOS shared memory to work across forks and thus the test program works! This was never an issue for Apache as we carefully avoid forking on BeOS but it's something other programs should not need to worry about. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60954 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shmem.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 9e901bf677f..0608add68cb 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -59,6 +59,9 @@ struct shmem_t { MM *mm; +#if BEOS + area_id id; +#endif }; apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) @@ -69,6 +72,9 @@ apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *fi } (*m) = mm_malloc(newmm, sizeof(struct shmem_t)); (*m)->mm = newmm; +#if BEOS + (*m)->id = area_for((*m)); +#endif return APR_SUCCESS; } @@ -132,6 +138,37 @@ apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) apr_status_t apr_open_shmem(struct shmem_t *c) { #if APR_USES_ANONYMOUS_SHM + +#if BEOS + /* If we've forked we need a clone of the original area or we + * will only have access to a one time copy of the data made when + * the fork occurred. This strange bit of code fixes that problem! + */ + thread_info ti; + area_info ai; + area_id deleteme = area_for(c); + + /* we need to check which team we're in, so we need to get + * the appropriate info structures for the current thread and + * the area we're using. + */ + get_area_info(c->id, &ai); + get_thread_info(find_thread(NULL), &ti); + + if (ti.team != ai.team){ + area_id nai; + /* if we are in a child then we need to delete the system + * created area as it's a one time copy and won't be a clone + * which is not good. + */ + delete_area(deleteme); + /* now we make our own clone and use that from now on! */ + nai = clone_area(ai.name, &(ai.address), B_CLONE_ADDRESS, + B_READ_AREA | B_WRITE_AREA, ai.area); + get_area_info(nai, &ai); + c = ai.address; + } +#endif /* When using MM, we don't need to open shared memory segments in child * segments, so just return immediately. */ From 131e64cf0f0432f755d4ffd01078abcc339789c8 Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" <ake@apache.org> Date: Fri, 15 Dec 2000 15:02:40 +0000 Subject: [PATCH 0974/7878] Get exe CGI's working again on Windows git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60955 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index a45928f3091..d9dae69a323 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -282,7 +282,7 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, ptr++; } - if (*ptr == '\\' || *++ptr == ':') { + if (*ptr == '\\' || *ptr == '/' || *++ptr == ':') { cmdline = apr_pstrdup(cont, progname); } else if (attr->currdir == NULL) { From 99c69307b62b9cb0671361272e7e958438fa49e2 Mon Sep 17 00:00:00 2001 From: Sascha Schumann <sascha@apache.org> Date: Fri, 15 Dec 2000 16:56:57 +0000 Subject: [PATCH 0975/7878] Fix VPATH support. APR builds now cleanly in a separate build directory. Submitted by: Mo DeJong <mdejong@cygnus.com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60956 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 12 ++++++++++-- aclocal.m4 | 2 +- configure.in | 11 +++++++++-- dso/unix/Makefile.in | 4 +++- dso/unix/dso.c | 2 +- locks/unix/Makefile.in | 4 +++- locks/unix/locks.c | 2 +- 7 files changed, 28 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index c9b83118e0e..85a0ddd4d44 100644 --- a/Makefile.in +++ b/Makefile.in @@ -116,10 +116,18 @@ delete-exports: fi $(TARGET_EXPORTS): - perl ./helpers/make_export.pl -o $@ include/*.h + if test -z "$(srcdir)"; then \ + perl $(srcdir)helpers/make_export.pl -o $@ include/*.h; \ + else \ + perl $(srcdir)helpers/make_export.pl -o $@ include/*.h $(srcdir)include/*.h; \ + fi docs: - ./helpers/scandoc -i./helpers/default.pl -p./docs/ ./include/*.h + if test -z "$(srcdir)"; then \ + $(srcdir)helpers/scandoc -i$(srcdir)helpers/default.pl -p./docs/ ./include/*.h; \ + else \ + $(srcdir)helpers/scandoc -i$(srcdir)helpers/default.pl -p./docs/ ./include/*.h $(srcdir)include/*.h; \ + fi test: $(LIBAPR) (cd test; make clean; make; \ diff --git a/aclocal.m4 b/aclocal.m4 index a868e242cf4..ee8a7e7b986 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -328,7 +328,7 @@ int main(void) { AC_DEFUN(APR_PREPARE_MM_DIR,[ dnl #----------------------------- Prepare mm directory for VPATH support if test -n "$USE_MM" && test -n "$USE_VPATH"; then - test -d $mm_dir || $MKDIR -p $mm_dir + test -d $mm_dir || $MKDIR $mm_dir for i in shtool config.guess config.sub fbtool ltconfig \ ltmain.sh mm_vers.c; do diff --git a/configure.in b/configure.in index a60bd8b43ee..eac9b474828 100644 --- a/configure.in +++ b/configure.in @@ -801,7 +801,7 @@ MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefil SUBDIRS="lib strings passwd tables " for dir in $MODULES do - test -d $dir || $MKDIR -p $dir + test -d $dir || $MKDIR $dir if test -f $srcdir/$dir/$OSDIR/Makefile.in; then MAKEFILE2="$MAKEFILE2 $dir/$OSDIR/Makefile " SUBDIRS="$SUBDIRS $dir/$OSDIR " @@ -825,6 +825,9 @@ for i in $SAVE_FILES; do test -r $i && mv $i $i.save done +dir=include/arch/unix +test -d $dir || $MKDIR $dir + AC_OUTPUT($MAKEFILE1 $MAKEFILE2 $MAKEFILE3 include/apr.h APRVARS,[ SAVE_FILES="include/apr.h include/apr_private.h" @@ -855,7 +858,11 @@ VPATH = $abs_srcdir/$dir EOF ) | cat - $makefile | \ - sed -e 's#-I\($(INCDIR[0-9]*)\)#-I\1 -I$(srcdir)/\1#g' > tmp + sed \ + -e 's#-I\($(INCDIR[0-9]*)\)#-I\1 -I$(srcdir)\1#g' \ + -e 's#-I\($(OSDIR[0-9]*)\)#-I\1 -I$(srcdir)\1#g' \ + -e 's#-I\($(DEFOSDIR[0-9]*)\)#-I\1 -I$(srcdir)\1#g' \ + > tmp cp tmp $makefile done if test -n "$USE_MM"; then diff --git a/dso/unix/Makefile.in b/dso/unix/Makefile.in index e4f0e1a9078..c3d9c2b42dc 100644 --- a/dso/unix/Makefile.in +++ b/dso/unix/Makefile.in @@ -6,7 +6,9 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +INCDIR2=$(INCDIR)/arch +INCDIR3=$(INCDIR)/arch/unix +INCLUDES=-I$(INCDIR) -I$(INCDIR2) -I$(INCDIR3) MKDEP=../../helpers/mkdep.sh LIB=libdso.a diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 14572dbfd25..6741449ab74 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "unix/dso.h" +#include "dso.h" #include "apr_strings.h" #if APR_HAS_DSO diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index fb0c6d9c79f..30530fedbfe 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -5,7 +5,9 @@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +INCDIR2=$(INCDIR)/arch +INCDIR3=$(INCDIR)/arch/unix +INCLUDES=-I$(INCDIR) -I$(INCDIR2) -I$(INCDIR3) MKDEP=../../helpers/mkdep.sh OBJS=locks.o \ diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 518af1a312f..8104e22fe6f 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "unix/locks.h" +#include "locks.h" #include "apr_strings.h" #include "apr_portable.h" From d2188546fa5669d782f9db591208a2802f5ef152 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 15 Dec 2000 20:56:55 +0000 Subject: [PATCH 0976/7878] axe apr_get_inaddr(); apr_getaddrinfo() does the equivalent function (and more) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60957 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 1 - include/apr_network_io.h | 7 ------- libapr.def | 1 - network_io/unix/sa_common.c | 21 --------------------- 4 files changed, 30 deletions(-) diff --git a/aprlib.def b/aprlib.def index 9b9d9f6cbe6..699425d9879 100644 --- a/aprlib.def +++ b/aprlib.def @@ -87,7 +87,6 @@ EXPORTS apr_set_ipaddr apr_get_port apr_set_port - apr_get_inaddr apr_parse_addr_port apr_getnameinfo diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 4b37a61ed1e..bd69e102bf0 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -665,13 +665,6 @@ apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file); #endif -/** - * Given a hostname and a port, create an apr_in_addr for it... - * @param addr The apr_in_addr_t structure to return. - * @param hostname The hostname to lookup. - */ -apr_status_t apr_get_inaddr(apr_in_addr_t *addr, char *hostname); - /** * Given an apr_sockaddr_t and a service name, set the port for the service * @param sockaddr The apr_sockaddr_t that will have it's port set diff --git a/libapr.def b/libapr.def index 9b9d9f6cbe6..699425d9879 100644 --- a/libapr.def +++ b/libapr.def @@ -87,7 +87,6 @@ EXPORTS apr_set_ipaddr apr_get_port apr_set_port - apr_get_inaddr apr_parse_addr_port apr_getnameinfo diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index e9677cb532f..6c87965d468 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -130,27 +130,6 @@ apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr) return APR_SUCCESS; } -apr_status_t apr_get_inaddr(apr_in_addr_t *addr, char *hostname) -{ - struct hostent *he; - - if (strcmp(hostname,"*") == 0){ - addr->s_addr = htonl(INADDR_ANY); - return APR_SUCCESS; - } - if ((addr->s_addr = apr_inet_addr(hostname)) != APR_INADDR_NONE) - return APR_SUCCESS; - - /* hmmm, it's not a numeric IP address so we need to look it up :( */ - he = gethostbyname(hostname); - if (!he || he->h_addrtype != APR_INET || !he->h_addr_list[0]) - return (h_errno + APR_OS_START_SYSERR); - - *addr = *(struct in_addr*)he->h_addr_list[0]; - - return APR_SUCCESS; -} - static void set_sockaddr_vars(apr_sockaddr_t *addr, int family) { addr->sa.sin.sin_family = family; From d89e864e0decb0b0dbd28a4720e631d589a0de8a Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sat, 16 Dec 2000 02:06:47 +0000 Subject: [PATCH 0977/7878] apr_snprintf()'s %pI format string now takes apr_sockaddr_t * instead of sockaddr_in *. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60958 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_lib.h | 3 ++- strings/apr_snprintf.c | 34 ++++++++++++++++++++++++++-------- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index 4696cc2250c..ab285e3acbb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) apr_snprintf()'s %pI format string now takes apr_sockaddr_t * + instead of sockaddr_in *. [Jeff Trawick] + *) Fix a bug in apr_accept() for Win32 and Unix where the local apr_sockaddr_t in the new connected socket was not initialized properly. This could result in a bad string for apr_get_ipaddr(), diff --git a/include/apr_lib.h b/include/apr_lib.h index 9b216fdc85c..dc35ac028c9 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -157,7 +157,8 @@ APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname); * The extensions are: * * %pA takes a struct in_addr *, and prints it as a.b.c.d - * %pI takes a struct sockaddr_in * and prints it as a.b.c.d:port + * %pI takes an apr_sockaddr_t * and prints it as a.b.c.d:port or + * [ipv6-address]:port * %pp takes a void * and outputs it in hex * * The %p hacks are to force gcc's printf warning code to skip diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index f525a79a033..0f21c6d6b31 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -60,6 +60,7 @@ #include "apr_private.h" #include "apr_lib.h" +#include "apr_network_io.h" #include <math.h> #ifdef HAVE_CTYPE_H #include <ctype.h> @@ -488,15 +489,32 @@ static char *conv_in_addr(struct in_addr *ia, char *buf_end, int *len) -static char *conv_sockaddr_in(struct sockaddr_in *si, char *buf_end, int *len) +static char *conv_apr_sockaddr(apr_sockaddr_t *sa, char *buf_end, int *len) { char *p = buf_end; bool_int is_negative; int sub_len; + char *ipaddr_str; - p = conv_10(ntohs(si->sin_port), TRUE, &is_negative, p, &sub_len); + /* XXX IPv6: this assumes sin_port and sin6_port are at same offset */ + p = conv_10(ntohs(sa->sa.sin.sin_port), TRUE, &is_negative, p, &sub_len); *--p = ':'; - p = conv_in_addr(&si->sin_addr, p, &sub_len); + apr_get_ipaddr(&ipaddr_str, sa); + sub_len = strlen(ipaddr_str); +#if APR_HAVE_IPV6 + if (sa->sa.sin.sin_family == APR_INET6 && + !IN6_IS_ADDR_V4MAPPED(&sa->sa.sin6.sin6_addr)) { + *(p - 1) = ']'; + p -= sub_len + 2; + *p = '['; + memcpy(p + 1, ipaddr_str, sub_len); + } + else +#endif + { + p -= sub_len; + memcpy(p, ipaddr_str, sub_len); + } *len = buf_end - p; return (p); @@ -1038,14 +1056,14 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), pad_char = ' '; break; - /* print a struct sockaddr_in as a.b.c.d:port */ + /* print an apr_sockaddr_t as a.b.c.d:port */ case 'I': { - struct sockaddr_in *si; + apr_sockaddr_t *sa; - si = va_arg(ap, struct sockaddr_in *); - if (si != NULL) { - s = conv_sockaddr_in(si, &num_buf[NUM_BUF_SIZE], &s_len); + sa = va_arg(ap, apr_sockaddr_t *); + if (sa != NULL) { + s = conv_apr_sockaddr(sa, &num_buf[NUM_BUF_SIZE], &s_len); if (adjust_precision && precision < s_len) s_len = precision; } From 2ad31625e42138b027e881442951df04b5bc1fca Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 17 Dec 2000 03:08:44 +0000 Subject: [PATCH 0978/7878] Update some STATUS files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60959 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 271197371c2..f4ce855b69d 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2000/12/14 11:10:05 $] +Last modified at [$Date: 2000/12/17 03:08:44 $] Release: @@ -14,6 +14,10 @@ Release: RELEASE SHOWSTOPPERS: + * Source code layout needs to be decided for apr and apr-util. There + has been some discussion about adding a src/ directory to apr or + removing it from apr-util/. Either way, this needs to be decided. + * Rename Symbols: apr_opendir --> apr_dir_open From a13833e7146440057dc7032b8fdaa348e2666581 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 17 Dec 2000 03:35:41 +0000 Subject: [PATCH 0979/7878] Rename the apr_opendir symbol to apr_dir_open. This makes more sense, and the rename was proposed a while ago inside of APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60960 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 1 + STATUS | 5 +---- file_io/os2/dir.c | 2 +- file_io/unix/dir.c | 2 +- file_io/win32/dir.c | 2 +- include/apr_file_io.h | 2 +- test/testfile.c | 2 +- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index ab285e3acbb..d2117670a08 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,5 @@ Changes with APR b1 + *) Rename apr_opendir to apr_dir_open. [Ryan Bloom] *) apr_snprintf()'s %pI format string now takes apr_sockaddr_t * instead of sockaddr_in *. [Jeff Trawick] diff --git a/STATUS b/STATUS index f4ce855b69d..886051c6848 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2000/12/17 03:08:44 $] +Last modified at [$Date: 2000/12/17 03:35:39 $] Release: @@ -18,9 +18,6 @@ RELEASE SHOWSTOPPERS: has been some discussion about adding a src/ directory to apr or removing it from apr-util/. Either way, this needs to be decided. - * Rename Symbols: - apr_opendir --> apr_dir_open - RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * SysV semaphore support isn't usable by Apache when started as diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 299a70c1eca..3d9a4768782 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -69,7 +69,7 @@ static apr_status_t dir_cleanup(void *thedir) -apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cntxt) +apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cntxt) { apr_dir_t *thedir = (apr_dir_t *)apr_palloc(cntxt, sizeof(apr_dir_t)); diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 419c2f88112..2b4d89c18b5 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -67,7 +67,7 @@ static apr_status_t dir_cleanup(void *thedir) } } -apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) +apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont) { /* On some platforms (e.g., Linux+GNU libc), d_name[] in struct * dirent is declared with enough storage for the name. On other diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 99dbd51b29b..5087818139c 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -82,7 +82,7 @@ apr_status_t dir_cleanup(void *thedir) return APR_SUCCESS; } -apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) +apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont) { /* Note that we won't open a directory that is greater than MAX_PATH, * including the trailing /* wildcard suffix. If a * won't fit, then diff --git a/include/apr_file_io.h b/include/apr_file_io.h index d5740cb9d3f..1c47e5b8ddd 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -643,7 +643,7 @@ apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where,apr_off_t *off * @param dirname The full path to the directory (use / on all systems) * @param cont The pool to use. */ -apr_status_t apr_opendir(apr_dir_t **new_dir, const char *dirname, apr_pool_t *cont); +apr_status_t apr_dir_open(apr_dir_t **new_dir, const char *dirname, apr_pool_t *cont); /** * close the specified directory. diff --git a/test/testfile.c b/test/testfile.c index 4a2868c905e..3998d262575 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -302,7 +302,7 @@ int testdirs(apr_pool_t *context) apr_close(file); fprintf(stdout, "\tOpening Directory......."); - if (apr_opendir(&temp, "testdir", context) != APR_SUCCESS) { + if (apr_dir_open(&temp, "testdir", context) != APR_SUCCESS) { fprintf(stderr, "Could not open directory\n"); return -1; } From 83cb089b819e3c7c9e05f4246a20c39a45e7da7b Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sun, 17 Dec 2000 13:12:11 +0000 Subject: [PATCH 0980/7878] Tighten up the check for getaddrinfo(). If it can't figure out the appropriate address family for 127.0.0.1, it fails. Unfortunately, Tru64 fails this test so we won't do IPv6 on Tru64. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60961 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ aclocal.m4 | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index d2117670a08..41778888205 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ Changes with APR b1 + *) Tighten up the check for getaddrinfo(). If it can't figure out + the appropriate address family for 127.0.0.1, it fails. + Unfortunately, Tru64 fails this test so we won't do IPv6 on + Tru64. [Jeff Trawick] + *) Rename apr_opendir to apr_dir_open. [Ryan Bloom] *) apr_snprintf()'s %pI format string now takes apr_sockaddr_t * diff --git a/aclocal.m4 b/aclocal.m4 index ee8a7e7b986..f9d3727a818 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -207,7 +207,7 @@ void main(void) { int error; memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_INET; + hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; error = getaddrinfo("127.0.0.1", "8080", &hints, &ai); if (error) { From 6455ca20e1c45682e408423dc5f08eb4f78db68b Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Mon, 18 Dec 2000 00:05:24 +0000 Subject: [PATCH 0981/7878] Jingle bells! Jingle bells! Batman smells! Robin laid an egg! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60962 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 886051c6848..70736e9ca2b 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2000/12/17 03:35:39 $] +Last modified at [$Date: 2000/12/18 00:05:24 $] Release: @@ -69,6 +69,11 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: - The fname param is allowed to be NULL on the Unix platform. Change it to always use the passed value, and check callers. + * configure.in does post-processing on the AC_OUTPUT files (for + VPATH support). This means that config.status doesn't do the + right thing when you re-run it. We ought to revamp the makefiles + to do the right AC_SUBST stuff rather than depend upon rewriting. + Documentation that needs writing: From 1a2de7a92542c2f96775543b1aadfc21ce4b0ed2 Mon Sep 17 00:00:00 2001 From: Sascha Schumann <sascha@apache.org> Date: Mon, 18 Dec 2000 00:17:18 +0000 Subject: [PATCH 0982/7878] Drop the Perl dependency and use an awk script for creating apr.exports. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60963 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 5 +++-- configure.in | 1 + helpers/make_export.awk | 50 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 helpers/make_export.awk diff --git a/Makefile.in b/Makefile.in index 85a0ddd4d44..c7df4215c67 100644 --- a/Makefile.in +++ b/Makefile.in @@ -10,6 +10,7 @@ SHELL=@SH@ MFLAGS_STATIC= RM=@RM@ CC=@CC@ +AWK=@AWK@ CFLAGS=@CFLAGS@ @OPTIM@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ $(LIBS) @@ -117,9 +118,9 @@ delete-exports: $(TARGET_EXPORTS): if test -z "$(srcdir)"; then \ - perl $(srcdir)helpers/make_export.pl -o $@ include/*.h; \ + $(AWK) -f $(srcdir)helpers/make_export.awk include/*.h > $@ ; \ else \ - perl $(srcdir)helpers/make_export.pl -o $@ include/*.h $(srcdir)include/*.h; \ + $(AWK) -f $(srcdir)helpers/make_export.awk include/*.h $(srcdir)include/*.h > $@ ; \ fi docs: diff --git a/configure.in b/configure.in index eac9b474828..58d7858a27b 100644 --- a/configure.in +++ b/configure.in @@ -44,6 +44,7 @@ dnl # Checks for programs. AC_PROG_CC AC_PROG_RANLIB_NC AC_PROG_MAKE_SET +AC_PROG_AWK AC_CHECK_PROG(RM, rm, rm) AC_CHECK_TOOL(AR, ar, ar) diff --git a/helpers/make_export.awk b/helpers/make_export.awk new file mode 100644 index 00000000000..b58b657b382 --- /dev/null +++ b/helpers/make_export.awk @@ -0,0 +1,50 @@ +# Based on Ryan Bloom's make_export.pl + +/^#[ \t]*if(def)? APR_.*/ { + if (old_filename != FILENAME) { + if (old_filename != "") printf("%s", line) + macro_no = 0 + found = 0 + count = 0 + old_filename = FILENAME + line = "" + } + macro_stack[macro_no++] = macro + macro = $2 + found++ + count++ + line = line macro "\n" + next +} + +/^#[ \t]*endif/ { + if (count > 0) { + count-- + line = line "/" macro "\n" + macro = macro_stack[--macro_no] + } + if (found == count + 1) { + found-- + line = "" + } else if (found > count + 1) { + found = 0 + } + next +} + +/^[ \t]*(APR_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[)]?[ \t]+[*]?([A-Za-z0-9_]+)\(/ { + if (found) { + found++ + } + for (i = 0; i < count; i++) { + line = line "\t" + } + sub("^[ \t]*(APR_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[)]?[ \t]+[*]?", ""); + sub("[(].*", ""); + line = line $0 "\n" + next +} + +END { + printf("%s", line) +} From 6624341562b5b41343d149cb0fcfd364946d1863 Mon Sep 17 00:00:00 2001 From: Sascha Schumann <sascha@apache.org> Date: Mon, 18 Dec 2000 00:30:21 +0000 Subject: [PATCH 0983/7878] Add some discussion background for new build system git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60964 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 70736e9ca2b..03f7401b186 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2000/12/18 00:05:24 $] +Last modified at [$Date: 2000/12/18 00:30:21 $] Release: @@ -74,6 +74,18 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: right thing when you re-run it. We ought to revamp the makefiles to do the right AC_SUBST stuff rather than depend upon rewriting. + Sascha: As the rewriter is a crude hack, I would not worry too + much about it. It is designed to go away once we have + a proper build system in place. + + One of the perceived deficiencies of automake is that it + uses AC_SUBST too often, thereby slowing down the task of + generating Makefiles significantly, because it applies + dozens of substitutions to each Makefile. And why? Make's + built-in macro processing is much more powerful, and + combined with the include facility, generating Makefiles + becomes simpler and faster. + Documentation that needs writing: From 6757200aa42006035e79f7381cd27940e66762fd Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 18 Dec 2000 17:00:43 +0000 Subject: [PATCH 0984/7878] Axe apr_get_hostname(). Use apr_getnameinfo() instead. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60965 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- aprlib.def | 1 - include/apr_network_io.h | 9 --------- libapr.def | 1 - network_io/os2/sockopt.c | 27 --------------------------- network_io/unix/sockopt.c | 26 -------------------------- network_io/win32/sockopt.c | 25 ------------------------- 7 files changed, 1 insertion(+), 90 deletions(-) diff --git a/CHANGES b/CHANGES index 41778888205..48086a04d2e 100644 --- a/CHANGES +++ b/CHANGES @@ -16,7 +16,7 @@ Changes with APR b1 *) Add apr_getnameinfo(), a replacement for apr_get_hostname() which supports IPv6 and will be friendlier for use with eventual - SOCK_DGRAM support. [Jeff Trawick] + SOCK_DGRAM support. apr_get_hostname() is gone. [Jeff Trawick] Changes with APR a9 diff --git a/aprlib.def b/aprlib.def index 699425d9879..ea16739bfc7 100644 --- a/aprlib.def +++ b/aprlib.def @@ -62,7 +62,6 @@ EXPORTS apr_listen apr_accept apr_connect - apr_get_hostname apr_gethostname apr_send apr_recv diff --git a/include/apr_network_io.h b/include/apr_network_io.h index bd69e102bf0..136857d25ec 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -279,15 +279,6 @@ apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, */ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa); -/** - * Get name of a machine we are currently connected to. - * @param name A buffer to store the hostname in. - * @param which Which interface do we wnt the hostname for? - * @param sock The socket to examine. - */ -apr_status_t apr_get_hostname(char **name, apr_interface_e which, - apr_socket_t *sock); - /** * Create apr_sockaddr_t from hostname, address family, and port. * @param sa The new apr_sockaddr_t. diff --git a/libapr.def b/libapr.def index 699425d9879..ea16739bfc7 100644 --- a/libapr.def +++ b/libapr.def @@ -62,7 +62,6 @@ EXPORTS apr_listen apr_accept apr_connect - apr_get_hostname apr_gethostname apr_send apr_recv diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index ffc5a7d51ba..c1348546cbc 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -146,30 +146,3 @@ apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) return APR_SUCCESS; } - - -apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t *sock) -{ - struct hostent *hptr; - apr_in_addr_t sa_ptr; - - if (which == APR_LOCAL) - sa_ptr = sock->local_addr->sa.sin.sin_addr; - else if (which == APR_REMOTE) - sa_ptr = sock->remote_addr->sa.sin.sin_addr; - else - return APR_EINVAL; - - hptr = gethostbyaddr((char *)&sa_ptr, sizeof(struct in_addr), AF_INET); - - if (hptr != NULL) { - *name = apr_pstrdup(sock->cntxt, hptr->h_name); - if (*name) { - return APR_SUCCESS; - } - return APR_ENOMEM; - } - - /* XXX - Is this threadsafe? */ - return h_errno; -} diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 6384eaa960d..400d6ea8bcb 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -222,29 +222,3 @@ apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t *sock) -{ - struct hostent *hptr; - apr_in_addr_t sa_ptr; - - if (which == APR_LOCAL) - sa_ptr = sock->local_addr->sa.sin.sin_addr; - else if (which == APR_REMOTE) - sa_ptr = sock->remote_addr->sa.sin.sin_addr; - else - return APR_EINVAL; - - hptr = gethostbyaddr((char *)&sa_ptr, sizeof(struct in_addr), APR_INET); - - if (hptr != NULL) { - *name = apr_pstrdup(sock->cntxt, hptr->h_name); - if (*name) { - return APR_SUCCESS; - } - return APR_ENOMEM; - } - - /* XXX - Is referencing h_errno threadsafe? */ - return (h_errno + APR_OS_START_SYSERR); -} - diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 0926d20e007..ecc990701c2 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -201,29 +201,4 @@ apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t *sock) -{ - struct hostent *hptr; - apr_in_addr_t sa_ptr; - - if (which == APR_LOCAL) - sa_ptr = sock->local_addr->sa.sin.sin_addr; - else if (which == APR_REMOTE) - sa_ptr = sock->remote_addr->sa.sin.sin_addr; - else - return APR_EINVAL; - - hptr = gethostbyaddr((char *)&sa_ptr, sizeof(struct in_addr), AF_INET); - - if (hptr != NULL) { - *name = apr_pstrdup(sock->cntxt, hptr->h_name); - if (*name) { - return APR_SUCCESS; - } - return APR_ENOMEM; - } - - return apr_get_netos_error(); -} - From 65381f1778de2e05b235400652c46bbede483e3d Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 18 Dec 2000 20:17:51 +0000 Subject: [PATCH 0985/7878] apr_getaddrinfo() can now return multiple addresses for a host via the next field in apr_sockaddr_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60966 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ include/apr_network_io.h | 3 ++ network_io/unix/sa_common.c | 90 ++++++++++++++++++++++++++++--------- 3 files changed, 75 insertions(+), 21 deletions(-) diff --git a/CHANGES b/CHANGES index 48086a04d2e..561f7970dda 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ Changes with APR b1 + *) apr_getaddrinfo() can now return multiple addresses for a host + via the next field in apr_sockaddr_t. [Jeff Trawick] + *) Tighten up the check for getaddrinfo(). If it can't figure out the appropriate address family for 127.0.0.1, it fails. Unfortunately, Tru64 fails this test so we won't do IPv6 on diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 136857d25ec..e5a48442f47 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -187,6 +187,9 @@ struct apr_sockaddr_t { /** This points to the IP address structure within the appropriate * sockaddr structure. */ void *ipaddr_ptr; + /** If multiple addresses were found by apr_getaddrinfo(), this + * points to a representation of the next address. */ + apr_sockaddr_t *next; }; #if APR_HAS_SENDFILE diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 6c87965d468..42e9fae9e0e 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -274,6 +274,29 @@ apr_status_t apr_parse_addr_port(char **addr, return APR_SUCCESS; } +#if defined(HAVE_GETADDRINFO) && APR_HAVE_IPV6 +static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa, + struct addrinfo *ai, apr_port_t port) +{ + sa->pool = p; + sa->sa.sin.sin_family = ai->ai_family; + memcpy(&sa->sa, ai->ai_addr, ai->ai_addrlen); + /* XXX IPv6: assumes sin_port and sin6_port at same offset */ + sa->sa.sin.sin_port = htons(port); + set_sockaddr_vars(sa, sa->sa.sin.sin_family); +} +#else +static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa, + struct in_addr ipaddr, apr_port_t port) +{ + sa->pool = p; + sa->sa.sin.sin_family = AF_INET; + sa->sa.sin.sin_addr = ipaddr; + sa->sa.sin.sin_port = htons(port); + set_sockaddr_vars(sa, sa->sa.sin.sin_family); +} +#endif + apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p) @@ -281,12 +304,12 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, (*sa) = (apr_sockaddr_t *)apr_pcalloc(p, sizeof(apr_sockaddr_t)); if ((*sa) == NULL) return APR_ENOMEM; - (*sa)->pool = p; (*sa)->hostname = apr_pstrdup(p, hostname); #if defined(HAVE_GETADDRINFO) && APR_HAVE_IPV6 if (hostname != NULL) { struct addrinfo hints, *ai; + apr_sockaddr_t *cursa; int error; char num[8]; @@ -312,8 +335,14 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, return error + APR_OS_START_SYSERR; } } - (*sa)->sa.sin.sin_family = ai->ai_family; - memcpy(&(*sa)->sa, ai->ai_addr, ai->ai_addrlen); + cursa = *sa; + save_addrinfo(p, cursa, ai, port); + while (ai->ai_next) { /* while more addresses to report */ + cursa->next = apr_pcalloc(p, sizeof(apr_sockaddr_t)); + ai = ai->ai_next; + cursa = cursa->next; + save_addrinfo(p, cursa, ai, port); + } freeaddrinfo(ai); } else { @@ -323,24 +352,28 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, else { (*sa)->sa.sin.sin_family = family; } + (*sa)->pool = p; + /* XXX IPv6: assumes sin_port and sin6_port at same offset */ + (*sa)->sa.sin.sin_port = htons(port); + set_sockaddr_vars(*sa, (*sa)->sa.sin.sin_family); } - set_sockaddr_vars(*sa, (*sa)->sa.sin.sin_family); #else - if (family == APR_UNSPEC) { - (*sa)->sa.sin.sin_family = APR_INET; /* we don't support IPv6 here */ - } - else { - (*sa)->sa.sin.sin_family = family; - } - set_sockaddr_vars(*sa, (*sa)->sa.sin.sin_family); if (hostname != NULL) { struct hostent *hp; + apr_sockaddr_t *cursa; + int curaddr; + + if (family == APR_UNSPEC) { + family = APR_INET; /* we don't support IPv6 here */ + } #ifndef GETHOSTBYNAME_HANDLES_NAS if (*hostname >= '0' && *hostname <= '9' && strspn(hostname, "0123456789.") == strlen(hostname)) { - (*sa)->sa.sin.sin_addr.s_addr = inet_addr(hostname); - (*sa)->salen = sizeof(struct sockaddr_in); + struct in_addr ipaddr; + + ipaddr.s_addr = inet_addr(hostname); + save_addrinfo(p, *sa, ipaddr, port); } else { #endif @@ -353,19 +386,34 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, return (h_errno + APR_OS_START_SYSERR); #endif } - - memcpy((char *)&(*sa)->sa.sin.sin_addr, hp->h_addr_list[0], - hp->h_length); - (*sa)->salen = sizeof(struct sockaddr_in); - (*sa)->ipaddr_len = hp->h_length; - + cursa = *sa; + curaddr = 0; + save_addrinfo(p, cursa, *(struct in_addr *)hp->h_addr_list[curaddr], + port); + ++curaddr; + while (hp->h_addr_list[curaddr]) { + cursa->next = apr_pcalloc(p, sizeof(apr_sockaddr_t)); + cursa = cursa->next; + save_addrinfo(p, cursa, *(struct in_addr *)hp->h_addr_list[curaddr], + port); + ++curaddr; + } #ifndef GETHOSTBYNAME_HANDLES_NAS } #endif } + else { + if (family == APR_UNSPEC) { + (*sa)->sa.sin.sin_family = APR_INET; + } + else { + (*sa)->sa.sin.sin_family = family; + } + (*sa)->pool = p; + (*sa)->sa.sin.sin_port = htons(port); + set_sockaddr_vars(*sa, (*sa)->sa.sin.sin_family); + } #endif - /* XXX IPv6: assumes sin_port and sin6_port at same offset */ - (*sa)->sa.sin.sin_port = htons(port); return APR_SUCCESS; } From a77c224e2a2cf7f531a2cabb7a32b9e538c31214 Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" <ake@apache.org> Date: Mon, 18 Dec 2000 21:52:05 +0000 Subject: [PATCH 0986/7878] apr_opendir to apr_dir_open git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60967 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 2 +- libapr.def | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aprlib.def b/aprlib.def index ea16739bfc7..267a302b8f4 100644 --- a/aprlib.def +++ b/aprlib.def @@ -28,7 +28,7 @@ EXPORTS apr_stat apr_lstat apr_seek - apr_opendir + apr_dir_open apr_closedir apr_readdir apr_rewinddir diff --git a/libapr.def b/libapr.def index ea16739bfc7..267a302b8f4 100644 --- a/libapr.def +++ b/libapr.def @@ -28,7 +28,7 @@ EXPORTS apr_stat apr_lstat apr_seek - apr_opendir + apr_dir_open apr_closedir apr_readdir apr_rewinddir From de47d82c51a8a8ffe3179b94e68ff54af6e44ca7 Mon Sep 17 00:00:00 2001 From: Branko Cibej <brane@apache.org> Date: Tue, 19 Dec 2000 11:59:16 +0000 Subject: [PATCH 0987/7878] Configure DSO support on HP-UX. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60968 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 58d7858a27b..e5e465a6d23 100644 --- a/configure.in +++ b/configure.in @@ -485,9 +485,12 @@ AC_ARG_ENABLE(dso, if test "$tempdso" = "no"; then AC_CHECK_FUNCS(dlopen, [ tempdso="yes" ], [ tempdso="no" ]) fi - if test "$tempdso" = "no"; then - AC_CHECK_LIB(root, load_image, tempdso="yes", tempdso="no") + if test "$tempdso" = "no"; then + AC_CHECK_LIB(root, load_image, tempdso="yes", tempdso="no") fi + if test "$tempdso" = "no"; then + AC_CHECK_LIB(dld, shl_load, [ tempdso="yes" LIBS="$LIBS -ldld" ], + tempdso="no") if test "$tempdso" = "no"; then case $OS in *os390|*-os2*) From dd1b48ae4dac2b647dea495b5034ce31a0996bee Mon Sep 17 00:00:00 2001 From: Branko Cibej <brane@apache.org> Date: Tue, 19 Dec 2000 12:07:27 +0000 Subject: [PATCH 0988/7878] Add missing `fi'. I must have misapplied the patch. My apologies. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60969 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index e5e465a6d23..c5d0941d47b 100644 --- a/configure.in +++ b/configure.in @@ -491,6 +491,7 @@ AC_ARG_ENABLE(dso, if test "$tempdso" = "no"; then AC_CHECK_LIB(dld, shl_load, [ tempdso="yes" LIBS="$LIBS -ldld" ], tempdso="no") + fi if test "$tempdso" = "no"; then case $OS in *os390|*-os2*) From 2dc8c75640602ab4e2d5d992d5e74935bad34cec Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 19 Dec 2000 17:05:36 +0000 Subject: [PATCH 0989/7878] Force all Apache functions to be linked into the executable, whether they are used or not. This uses the same mechanism that is used for APR and APR-util. This may not be the correct solution, but it works, and that is what I really care about. This also renames CHARSET_EBCDIC to AP_CHARSET_EBCDIC. This is for namespace correctness, but it also makes the exports script a bit easier. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60970 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 2 +- helpers/make_export.awk | 6 +++--- hints.m4 | 4 ++-- passwd/apr_getpass.c | 6 +++--- passwd/apr_md5.c | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index f9d3727a818..4b072d113fe 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -321,7 +321,7 @@ int main(void) { ac_cv_ebcdic="no" ])]) if test "$ac_cv_ebcdic" = "yes"; then - AC_DEFINE(CHARSET_EBCDIC,, [Define if system uses EBCDIC]) + AC_DEFINE(AP_CHARSET_EBCDIC,, [Define if system uses EBCDIC]) fi ]) diff --git a/helpers/make_export.awk b/helpers/make_export.awk index b58b657b382..5cffd1979d0 100644 --- a/helpers/make_export.awk +++ b/helpers/make_export.awk @@ -1,6 +1,6 @@ # Based on Ryan Bloom's make_export.pl -/^#[ \t]*if(def)? APR_.*/ { +/^#[ \t]*if(def)? (APR?_|defined).*/ { if (old_filename != FILENAME) { if (old_filename != "") printf("%s", line) macro_no = 0 @@ -32,14 +32,14 @@ next } -/^[ \t]*(APR_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[)]?[ \t]+[*]?([A-Za-z0-9_]+)\(/ { +/^[ \t]*(APR?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?([A-Za-z0-9_]+)\(/ { if (found) { found++ } for (i = 0; i < count; i++) { line = line "\t" } - sub("^[ \t]*(APR_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[)]?[ \t]+[*]?", ""); + sub("^[ \t]*(APR?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?", ""); sub("[(].*", ""); line = line $0 "\n" next diff --git a/hints.m4 b/hints.m4 index edeef7adb29..02ed080d714 100644 --- a/hints.m4 +++ b/hints.m4 @@ -221,11 +221,11 @@ dnl ;; ;; TPF) APR_SETIFNULL(CC, [c89]) - APR_SETIFNULL(CFLAGS, [-DTPF -DCHARSET_EBCDIC -D_POSIX_SOURCE]) + APR_SETIFNULL(CFLAGS, [-DTPF -DAP_CHARSET_EBCDIC -D_POSIX_SOURCE]) ;; BS2000*-siemens-sysv4*) APR_SETIFNULL(CC, [c89 -XLLML -XLLMK -XL -Kno_integer_overflow]) - APR_SETIFNULL(CFLAGS, [-DCHARSET_EBCDIC -DSVR4 -D_XPG_IV]) + APR_SETIFNULL(CFLAGS, [-DAP_CHARSET_EBCDIC -DSVR4 -D_XPG_IV]) ;; *-siemens-sysv4*) APR_SETIFNULL(CFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT -DNEED_UNION_SEMUN]) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 6019c771618..e9ecde9e5e5 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -78,13 +78,13 @@ #include <termios.h> #endif -#ifndef CHARSET_EBCDIC +#ifndef AP_CHARSET_EBCDIC #define LF 10 #define CR 13 -#else /* CHARSET_EBCDIC */ +#else /* AP_CHARSET_EBCDIC */ #define LF '\n' #define CR '\r' -#endif /* CHARSET_EBCDIC */ +#endif /* AP_CHARSET_EBCDIC */ #define MAX_STRING_LEN 256 diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index 30ca92183c3..a6cd62c9efd 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -145,7 +145,7 @@ static unsigned char PADDING[64] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -#ifdef CHARSET_EBCDIC +#ifdef AP_CHARSET_EBCDIC static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_MD5Encode() */ #endif @@ -460,7 +460,7 @@ static void Decode(UINT4 *output, const unsigned char *input, unsigned int len) (((UINT4) input[j + 2]) << 16) | (((UINT4) input[j + 3]) << 24); } -#ifdef CHARSET_EBCDIC +#ifdef AP_CHARSET_EBCDIC APR_DECLARE(apr_status_t) apr_MD5InitEBCDIC(apr_xlate_t *xlate) { xlate_ebcdic_to_ascii = xlate; @@ -537,7 +537,7 @@ APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, * 'Time to make the doughnuts..' */ apr_MD5Init(&ctx); -#ifdef CHARSET_EBCDIC +#ifdef AP_CHARSET_EBCDIC apr_MD5SetXlate(&ctx, xlate_ebcdic_to_ascii); #endif From 6a5cf4d663c2566dd6fcf50b7c4177beb731b3f9 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Wed, 20 Dec 2000 14:28:45 +0000 Subject: [PATCH 0990/7878] When building exports list, allow for multi-part and negative conditions in #if tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60971 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/make_export.awk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/make_export.awk b/helpers/make_export.awk index 5cffd1979d0..e2ec040fcd2 100644 --- a/helpers/make_export.awk +++ b/helpers/make_export.awk @@ -1,6 +1,6 @@ # Based on Ryan Bloom's make_export.pl -/^#[ \t]*if(def)? (APR?_|defined).*/ { +/^#[ \t]*if(def)? (APR?_|!?defined).*/ { if (old_filename != FILENAME) { if (old_filename != "") printf("%s", line) macro_no = 0 @@ -10,7 +10,7 @@ line = "" } macro_stack[macro_no++] = macro - macro = $2 + macro = substr($0, length($1)+2) found++ count++ line = line macro "\n" From 73719682266123118466f7f27a85e4967ab6c848 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 20 Dec 2000 16:20:18 +0000 Subject: [PATCH 0991/7878] Instead of a private AP_CHARSET_EBCDIC which is only defined on an EBCDIC machine, define APR_CHARSET_EBCDIC to 0 or 1 for all the world to see and use it as appropriate in APR. I removed the TPF and BS2000 stuff. If configure doesn't work there they need to provide a custom apr.h anyway. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60972 13f79535-47bb-0310-9956-ffa450edef68 --- aclocal.m4 | 5 ++++- hints.m4 | 4 ++-- include/apr.h.in | 4 ++++ include/apr.hw | 4 ++++ passwd/apr_getpass.c | 6 +++--- passwd/apr_md5.c | 6 +++--- 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 4b072d113fe..f8208317b7e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -321,8 +321,11 @@ int main(void) { ac_cv_ebcdic="no" ])]) if test "$ac_cv_ebcdic" = "yes"; then - AC_DEFINE(AP_CHARSET_EBCDIC,, [Define if system uses EBCDIC]) + apr_charset_ebcdic=1 + else + apr_charset_ebcdic=0 fi + AC_SUBST(apr_charset_ebcdic) ]) AC_DEFUN(APR_PREPARE_MM_DIR,[ diff --git a/hints.m4 b/hints.m4 index 02ed080d714..bb898022cbd 100644 --- a/hints.m4 +++ b/hints.m4 @@ -221,11 +221,11 @@ dnl ;; ;; TPF) APR_SETIFNULL(CC, [c89]) - APR_SETIFNULL(CFLAGS, [-DTPF -DAP_CHARSET_EBCDIC -D_POSIX_SOURCE]) + APR_SETIFNULL(CFLAGS, [-DTPF -D_POSIX_SOURCE]) ;; BS2000*-siemens-sysv4*) APR_SETIFNULL(CC, [c89 -XLLML -XLLMK -XL -Kno_integer_overflow]) - APR_SETIFNULL(CFLAGS, [-DAP_CHARSET_EBCDIC -DSVR4 -D_XPG_IV]) + APR_SETIFNULL(CFLAGS, [-DSVR4 -D_XPG_IV]) ;; *-siemens-sysv4*) APR_SETIFNULL(CFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT -DNEED_UNION_SEMUN]) diff --git a/include/apr.h.in b/include/apr.h.in index 5ef81146861..34a158dea1a 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -116,6 +116,10 @@ */ #define APR_INADDR_NONE @apr_inaddr_none@ +/* This macro indicates whether or not EBCDIC is the native character set. + */ +#define APR_CHARSET_EBCDIC @apr_charset_ebcdic@ + /* Typedefs that APR needs. */ typedef @short_value@ apr_int16_t; diff --git a/include/apr.hw b/include/apr.hw index eae8d18fead..aa10c070474 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -185,6 +185,10 @@ */ #define APR_INADDR_NONE INADDR_NONE +/* This macro indicates whether or not EBCDIC is the native character set. + */ +#define APR_CHARSET_EBCDIC 0 + /* Typedefs that APR needs. */ typedef short apr_int16_t; diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index e9ecde9e5e5..c0a716c5ff9 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -78,13 +78,13 @@ #include <termios.h> #endif -#ifndef AP_CHARSET_EBCDIC +#if !APR_CHARSET_EBCDIC #define LF 10 #define CR 13 -#else /* AP_CHARSET_EBCDIC */ +#else /* APR_CHARSET_EBCDIC */ #define LF '\n' #define CR '\r' -#endif /* AP_CHARSET_EBCDIC */ +#endif /* APR_CHARSET_EBCDIC */ #define MAX_STRING_LEN 256 diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index a6cd62c9efd..81d90e26c35 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -145,7 +145,7 @@ static unsigned char PADDING[64] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -#ifdef AP_CHARSET_EBCDIC +#if APR_CHARSET_EBCDIC static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_MD5Encode() */ #endif @@ -460,7 +460,7 @@ static void Decode(UINT4 *output, const unsigned char *input, unsigned int len) (((UINT4) input[j + 2]) << 16) | (((UINT4) input[j + 3]) << 24); } -#ifdef AP_CHARSET_EBCDIC +#if APR_CHARSET_EBCDIC APR_DECLARE(apr_status_t) apr_MD5InitEBCDIC(apr_xlate_t *xlate) { xlate_ebcdic_to_ascii = xlate; @@ -537,7 +537,7 @@ APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, * 'Time to make the doughnuts..' */ apr_MD5Init(&ctx); -#ifdef AP_CHARSET_EBCDIC +#if APR_CHARSET_EBCDIC apr_MD5SetXlate(&ctx, xlate_ebcdic_to_ascii); #endif From b3c86c57aa8831cea511132297413141136489bb Mon Sep 17 00:00:00 2001 From: Branko Cibej <brane@apache.org> Date: Thu, 21 Dec 2000 00:44:08 +0000 Subject: [PATCH 0992/7878] 2000-12-19 Bill Tutt <rassilon@lima.mudlib.org> 2000-12-21 Branko Cibej <brane@xbc.nu> * aprlib.def: Export apr_setprocattr_childin, apr_setprocattr_childout, and apr_setprocattr_childerr. * threadproc/win32/proc.c: Folded pipe creation out into helper function. Moved inheritable-ness mucking from apr_create_process into apr_setprocattr_* functions. Added apr_setprocattr_child{in,out,err}. Note that APR_SHELLCMD won't work (and has never worked) on Win9x. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60973 13f79535-47bb-0310-9956-ffa450edef68 --- aprlib.def | 3 + libapr.def | 3 + misc/unix/getopt.c | 7 +- threadproc/win32/proc.c | 305 +++++++++++++++++++++------------------- 4 files changed, 175 insertions(+), 143 deletions(-) diff --git a/aprlib.def b/aprlib.def index 267a302b8f4..fa899d36c06 100644 --- a/aprlib.def +++ b/aprlib.def @@ -97,6 +97,9 @@ EXPORTS apr_setprocattr_dir apr_setprocattr_cmdtype apr_setprocattr_detach + apr_setprocattr_childin + apr_setprocattr_childout + apr_setprocattr_childerr apr_create_process ; ; diff --git a/libapr.def b/libapr.def index 267a302b8f4..fa899d36c06 100644 --- a/libapr.def +++ b/libapr.def @@ -97,6 +97,9 @@ EXPORTS apr_setprocattr_dir apr_setprocattr_cmdtype apr_setprocattr_detach + apr_setprocattr_childin + apr_setprocattr_childout + apr_setprocattr_childerr apr_create_process ; ; diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index e27ff5ed26c..b3b065b9793 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -51,6 +51,8 @@ static const char *pretty_path (const char *name) APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, int argc, const char *const *argv) { + void *argv_buff; + *os = apr_palloc(cont, sizeof(apr_getopt_t)); (*os)->cont = cont; (*os)->err = 1; @@ -61,8 +63,9 @@ APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, that's the primary purpose of this function. But people might want to use this function with arrays other than the main argv, and we shouldn't touch the caller's data. So we copy. */ - (*os)->argv = apr_palloc(cont, (argc + 1) * sizeof(const char *)); - memcpy((*os)->argv, argv, argc * sizeof(const char *)); + argv_buff = apr_palloc(cont, (argc + 1) * sizeof(const char *)); + memcpy(argv_buff, argv, argc * sizeof(const char *)); + (*os)->argv = argv_buff; (*os)->argv[argc] = NULL; (*os)->interleave = 0; diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index d9dae69a323..664f4de3ace 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -65,6 +65,12 @@ #include <string.h> #include <process.h> +/* + * some of the ideas expressed herein are based off of Microsoft + * Knowledge Base article: Q190351 + * + */ + apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); @@ -88,115 +94,182 @@ apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, - apr_int32_t out, apr_int32_t err) +static apr_status_t open_nt_process_pipe(apr_file_t **read, apr_file_t **write, + apr_int32_t iBlockingMode, + apr_pool_t *cntxt) { apr_status_t stat; BOOLEAN bAsyncRead, bAsyncWrite; + + switch (iBlockingMode) { + case APR_FULL_BLOCK: + bAsyncRead = bAsyncWrite = FALSE; + break; + case APR_PARENT_BLOCK: + bAsyncRead = FALSE; + bAsyncWrite = TRUE; + break; + case APR_CHILD_BLOCK: + bAsyncRead = TRUE; + bAsyncWrite = FALSE; + break; + default: + bAsyncRead = TRUE; + bAsyncWrite = TRUE; + } + if ((stat = apr_create_nt_pipe(read, write, bAsyncRead, bAsyncWrite, + cntxt)) != APR_SUCCESS) + return stat; + + return APR_SUCCESS; +} + +static apr_status_t make_handle_private(apr_file_t *file) +{ + HANDLE pid = GetCurrentProcess(); + HANDLE filehand = file->filehand; + + /* Create new non-inheritable versions of handles that + * the child process doesn't care about. Otherwise, the child + * inherits these handles; resulting in non-closeable handles + * to the respective pipes. + */ + if (!DuplicateHandle(pid, filehand, + pid, &file->filehand, 0, + FALSE, DUPLICATE_SAME_ACCESS)) + return apr_get_os_error(); + /* + * Close the inerhitable handle we don't need anymore. + */ + CloseHandle(filehand); + return APR_SUCCESS; +} + +static apr_status_t make_inheritable_duplicate(apr_file_t *original, + apr_file_t *duplicate) +{ + if (original == NULL) + return APR_SUCCESS; + + /* Can't use apr_dupfile here because it creates a non-inhertible + * handle, and apr_open_file'd apr_file_t's are non-inheritable, + * so we must assume we need to make an inheritable handle. + */ + if (!CloseHandle(duplicate->filehand)) + return apr_get_os_error(); + else + { + HANDLE pid = GetCurrentProcess(); + if (!DuplicateHandle(pid, original->filehand, + pid, &duplicate->filehand, 0, + TRUE, DUPLICATE_SAME_ACCESS)) + return apr_get_os_error(); + } + + return APR_SUCCESS; +} + +apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) +{ + apr_status_t stat; + if (in) { - switch (in) { - case APR_FULL_BLOCK: - bAsyncRead = bAsyncWrite = FALSE; - break; - case APR_PARENT_BLOCK: - bAsyncRead = FALSE; - bAsyncWrite = TRUE; - break; - case APR_CHILD_BLOCK: - bAsyncRead = TRUE; - bAsyncWrite = FALSE; - break; - default: - bAsyncRead = TRUE; - bAsyncWrite = TRUE; - } - if ((stat = apr_create_nt_pipe(&attr->child_in, &attr->parent_in, - bAsyncRead, bAsyncWrite, - attr->cntxt)) != APR_SUCCESS) { + stat = open_nt_process_pipe(&attr->child_in, &attr->parent_in, in, + attr->cntxt); + if (stat == APR_SUCCESS) + stat = make_handle_private(attr->parent_in); + if (stat != APR_SUCCESS) return stat; - } } if (out) { - switch (out) { - case APR_FULL_BLOCK: - bAsyncRead = bAsyncWrite = FALSE; - break; - case APR_PARENT_BLOCK: - bAsyncRead = FALSE; - bAsyncWrite = TRUE; - break; - case APR_CHILD_BLOCK: - bAsyncRead = TRUE; - bAsyncWrite = FALSE; - break; - default: - bAsyncRead = TRUE; - bAsyncWrite = TRUE; - } - if ((stat = apr_create_nt_pipe(&attr->parent_out, &attr->child_out, - bAsyncRead, bAsyncWrite, - attr->cntxt)) != APR_SUCCESS) { + stat = open_nt_process_pipe(&attr->parent_out, &attr->child_out, out, + attr->cntxt); + if (stat == APR_SUCCESS) + stat = make_handle_private(attr->parent_out); + if (stat != APR_SUCCESS) return stat; - } } if (err) { - switch (err) { - case APR_FULL_BLOCK: - bAsyncRead = bAsyncWrite = FALSE; - break; - case APR_PARENT_BLOCK: - bAsyncRead = FALSE; - bAsyncWrite = TRUE; - break; - case APR_CHILD_BLOCK: - bAsyncRead = TRUE; - bAsyncWrite = FALSE; - break; - default: - bAsyncRead = TRUE; - bAsyncWrite = TRUE; - } - if ((stat = apr_create_nt_pipe(&attr->parent_err, &attr->child_err, - bAsyncRead, bAsyncWrite, - attr->cntxt)) != APR_SUCCESS) { + stat = open_nt_process_pipe(&attr->parent_err, &attr->child_err, err, + attr->cntxt); + if (stat == APR_SUCCESS) + stat = make_handle_private(attr->parent_err); + if (stat != APR_SUCCESS) return stat; - } - } + } return APR_SUCCESS; } -#if 0 -apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, - apr_file_t *parent_in) + +apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, + apr_file_t *child_in, + apr_file_t *parent_in) { + apr_status_t stat; + + if (attr->child_in == NULL && attr->parent_in == NULL) { + stat = open_nt_process_pipe(&attr->child_in, &attr->parent_in, + APR_FULL_BLOCK, + attr->cntxt); + if (stat == APR_SUCCESS) + stat = make_handle_private(attr->parent_in); + if (stat != APR_SUCCESS) + return stat; + } + + stat = make_inheritable_duplicate (child_in, attr->child_in); + if (stat == APR_SUCCESS) + stat = make_inheritable_duplicate (parent_in, attr->parent_in); + + return stat; } -apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, - apr_file_t *parent_out) -{ - if (attr->child_out == NULL && attr->parent_out == NULL) - apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); - if (child_out != NULL) - apr_dupfile(&attr->child_out, child_out, attr->cntxt); +apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, + apr_file_t *child_out, + apr_file_t *parent_out) +{ + apr_status_t stat; - if (parent_out != NULL) - apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); + if (attr->child_out == NULL && attr->parent_out == NULL) { + stat = open_nt_process_pipe(&attr->child_out, &attr->parent_out, + APR_FULL_BLOCK, + attr->cntxt); + if (stat == APR_SUCCESS) + stat = make_handle_private(attr->parent_out); + if (stat != APR_SUCCESS) + return stat; + } + + stat = make_inheritable_duplicate (child_out, attr->child_out); + if (stat == APR_SUCCESS) + stat = make_inheritable_duplicate (parent_out, attr->parent_out); - return APR_SUCCESS; + return stat; } -apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, - apr_file_t *parent_err) + +apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, + apr_file_t *child_err, + apr_file_t *parent_err) { - if (attr->child_err == NULL && attr->parent_err == NULL) - apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_status_t stat; - if (child_err != NULL) - apr_dupfile(&attr->child_err, child_err, attr->cntxt); + if (attr->child_err == NULL && attr->parent_err == NULL) { + stat = open_nt_process_pipe(&attr->child_err, &attr->parent_err, + APR_FULL_BLOCK, + attr->cntxt); + if (stat == APR_SUCCESS) + stat = make_handle_private(attr->parent_err); + if (stat != APR_SUCCESS) + return stat; + } + + stat = make_inheritable_duplicate (child_err, attr->child_err); + if (stat == APR_SUCCESS) + stat = make_inheritable_duplicate (parent_err, attr->parent_err); - if (parent_err != NULL) - apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); - return APR_SUCCESS; + return stat; } -#endif + apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) { @@ -234,6 +307,11 @@ apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t det) return APR_SUCCESS; } +/* TODO: + * apr_create_process with APR_SHELLCMD on Win9x won't work due to MS KB: + * Q150956 + */ + apr_status_t apr_create_process(apr_proc_t *new, const char *progname, const char * const *args, const char * const *env, @@ -241,12 +319,9 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, { int i, iEnvBlockLen; char *cmdline; - HANDLE hCurrentProcess; - HANDLE hParentindup, hParentoutdup,hParenterrdup; char ppid[20]; char *envstr; char *pEnvBlock, *pNext; - apr_status_t rv; PROCESS_INFORMATION pi; new->in = attr->parent_in; @@ -311,58 +386,6 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, cmdline = apr_pstrcat(cont, cmdline, " ", args[i], NULL); i++; } - /* - * When the pipe handles are created, the security descriptor - * indicates that the handle can be inherited. However, we do not - * want the server side handles to the pipe to be inherited by the - * child CGI process. If the child CGI does inherit the server - * side handles, then the child may be left around if the server - * closes its handles (e.g. if the http connection is aborted), - * because the child will have a valid copy of handles to both - * sides of the pipes, and no I/O error will occur. Microsoft - * recommends using DuplicateHandle to turn off the inherit bit - * under NT and Win95. - */ - hCurrentProcess = GetCurrentProcess(); - if ((attr->child_in && !DuplicateHandle(hCurrentProcess, attr->parent_in->filehand, - hCurrentProcess, - &hParentindup, 0, FALSE, - DUPLICATE_SAME_ACCESS)) - || (attr->child_out && !DuplicateHandle(hCurrentProcess, attr->parent_out->filehand, - hCurrentProcess, &hParentoutdup, - 0, FALSE, DUPLICATE_SAME_ACCESS)) - || (attr->child_err && !DuplicateHandle(hCurrentProcess, attr->parent_err->filehand, - hCurrentProcess, &hParenterrdup, - 0, FALSE, DUPLICATE_SAME_ACCESS))) { - rv = apr_get_os_error(); - if (attr->child_in) { - apr_close(attr->child_in); - apr_close(attr->parent_in); - } - if (attr->child_out) { - apr_close(attr->child_out); - apr_close(attr->parent_out); - } - if (attr->child_err) { - apr_close(attr->child_err); - apr_close(attr->parent_err); - } - return rv; - } - else { - if (attr->child_in) { - CloseHandle(attr->parent_in->filehand); - attr->parent_in->filehand = hParentindup; - } - if (attr->child_out) { - CloseHandle(attr->parent_out->filehand); - attr->parent_out->filehand = hParentoutdup; - } - if (attr->child_err) { - CloseHandle(attr->parent_err->filehand); - attr->parent_err->filehand = hParenterrdup; - } - } _itoa(_getpid(), ppid, 10); if (env) { From df2d6e1a65116cf33a41bd94a216de7f1fa447bf Mon Sep 17 00:00:00 2001 From: Branko Cibej <brane@apache.org> Date: Thu, 21 Dec 2000 00:48:54 +0000 Subject: [PATCH 0993/7878] (1.29) Remove argument mismatch warning on Win32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60974 13f79535-47bb-0310-9956-ffa450edef68 From 42cb81149be785edfb3d468bf25304a8fb667d55 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 21 Dec 2000 01:04:43 +0000 Subject: [PATCH 0994/7878] The Win32 overhaul, in summary; Modules are named mod_foo.so Dynamic Libraries are named libfoo.dll, and are stored in bin/ The former ApacheCoreDll is now libhttpd.dll Apache.exe moves to bin/ The make install now copies include, lib, and libexec All build options are normalized, filenames adjusted appropriately git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60975 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 35 ++- aprlib.def | 280 ----------------------- aprlib.dsp | 527 -------------------------------------------- aprlibdll.dsp | 100 --------- libapr.def | 4 +- libapr.dsp | 42 ++-- misc/win32/aprlib.c | 7 - test/aprtest.dsp | 3 +- 8 files changed, 40 insertions(+), 958 deletions(-) delete mode 100644 aprlib.def delete mode 100644 aprlib.dsp delete mode 100644 aprlibdll.dsp delete mode 100644 misc/win32/aprlib.c diff --git a/apr.dsp b/apr.dsp index dec6160d3a5..8e4fcd5c28e 100644 --- a/apr.dsp +++ b/apr.dsp @@ -1,33 +1,32 @@ -# Microsoft Developer Studio Project File - Name="aprlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Project File - Name="apr" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 -CFG=aprlib - Win32 Debug +CFG=apr - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE -!MESSAGE NMAKE /f "aprlib.mak". +!MESSAGE NMAKE /f "apr.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE -!MESSAGE NMAKE /f "aprlib.mak" CFG="aprlib - Win32 Debug" +!MESSAGE NMAKE /f "apr.mak" CFG="apr - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "aprlib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "aprlib - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "apr - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "apr - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project -# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe -!IF "$(CFG)" == "aprlib - Win32 Release" +!IF "$(CFG)" == "apr - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -43,7 +42,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibR\aprlib" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -51,7 +50,7 @@ LIB32=link.exe -lib # ADD BASE LIB32 /nologo /out:"LibR\apr.lib" # ADD LIB32 /nologo /out:"LibR\apr.lib" -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" +!ELSEIF "$(CFG)" == "apr - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 @@ -67,8 +66,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibD\aprlib" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -80,8 +79,8 @@ LIB32=link.exe -lib # Begin Target -# Name "aprlib - Win32 Release" -# Name "aprlib - Win32 Debug" +# Name "apr - Win32 Release" +# Name "apr - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" @@ -397,7 +396,7 @@ SOURCE=.\include\apr.h.in SOURCE=.\include\apr.hw -!IF "$(CFG)" == "aprlib - Win32 Release" +!IF "$(CFG)" == "apr - Win32 Release" # Begin Custom Build InputPath=.\include\apr.hw @@ -408,7 +407,7 @@ InputPath=.\include\apr.hw # End Custom Build -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" +!ELSEIF "$(CFG)" == "apr - Win32 Debug" # Begin Custom Build InputPath=.\include\apr.hw @@ -521,7 +520,7 @@ SOURCE=.\include\apr_xlate.h # End Group # Begin Source File -SOURCE=.\aprlib.def +SOURCE=.\libapr.def # End Source File # End Target # End Project diff --git a/aprlib.def b/aprlib.def deleted file mode 100644 index fa899d36c06..00000000000 --- a/aprlib.def +++ /dev/null @@ -1,280 +0,0 @@ -; aprlib.def : - -LIBRARY aprlib -DESCRIPTION '' - -EXPORTS -; Add new API calls to the end of this list. -; apr_file_io.h - apr_open - apr_close - apr_remove_file - apr_rename_file - apr_eof - apr_read - apr_write - apr_writev - apr_full_read - apr_full_write - apr_putc - apr_getc - apr_ungetc - apr_fgets - apr_puts - apr_flush - apr_dupfile - apr_getfileinfo - apr_setfileperms - apr_stat - apr_lstat - apr_seek - apr_dir_open - apr_closedir - apr_readdir - apr_rewinddir - apr_make_dir - apr_remove_dir - apr_dir_entry_size - apr_dir_entry_mtime - apr_dir_entry_ftype - apr_get_dir_filename -; apr_get_filename - apr_create_pipe -; apr_create_namedpipe -; apr_set_pipe_timeout - apr_get_filedata - apr_set_filedata - apr_get_os_file - apr_put_os_file - apr_get_os_dir - apr_fprintf - apr_lock_file - apr_unlock_file - -; -; apr_network_io.h - apr_get_sockaddr - apr_getaddrinfo - apr_create_socket - apr_shutdown - apr_close_socket - apr_bind - apr_listen - apr_accept - apr_connect - apr_gethostname - apr_send - apr_recv - apr_setsocketopt - apr_sendv - apr_sendfile - apr_setup_poll - apr_poll - apr_add_poll_socket - apr_get_revents - apr_get_socketdata - apr_set_socketdata - apr_get_polldata - apr_set_polldata - apr_make_os_sock - apr_put_os_sock - apr_get_os_sock - apr_remove_poll_socket - apr_clear_poll_sockets - apr_getsocketopt - apr_get_ipaddr - apr_set_ipaddr - apr_get_port - apr_set_port - apr_parse_addr_port - apr_getnameinfo - -; -; -; apr_thread_proc.h - apr_createprocattr_init - apr_setprocattr_io - apr_setprocattr_dir - apr_setprocattr_cmdtype - apr_setprocattr_detach - apr_setprocattr_childin - apr_setprocattr_childout - apr_setprocattr_childerr - apr_create_process -; -; -; - apr_wait_proc - apr_kill - apr_create_threadattr - apr_setthreadattr_detach - apr_getthreadattr_detach - apr_create_thread - apr_thread_exit - apr_thread_join - apr_thread_detach -; - apr_create_thread_private - apr_get_thread_private - apr_set_thread_private - apr_delete_thread_private - apr_get_threaddata - apr_set_threaddata - apr_get_threadkeydata - apr_set_threadkeydata -; -; -; - apr_get_os_thread - apr_get_os_threadkey - - - apr_create_pool -; -; -; - apr_get_userdata - apr_set_userdata - apr_initialize -; apr_make_time - apr_ansi_time_to_apr_time - apr_now - apr_explode_gmt - apr_explode_localtime - apr_implode_time - apr_get_os_imp_time - apr_get_os_exp_time - apr_put_os_imp_time - apr_put_os_exp_time - apr_ctime - apr_rfc822_date - apr_strftime -; -; -; -; -; -; -; -; -; -; - apr_MD5Final - apr_MD5Init - apr_MD5Update - apr_cpystrn - apr_register_cleanup - apr_kill_cleanup - apr_fnmatch - apr_is_fnmatch - apr_MD5Encode - apr_validate_password -; -; apr_pools.h - apr_make_sub_pool - apr_init_alloc - apr_clear_pool - apr_destroy_pool - apr_bytes_in_pool - apr_bytes_in_free_blocks - apr_palloc - apr_pcalloc - apr_pstrdup - apr_pstrndup - apr_pstrcat - apr_pvsprintf - apr_psprintf -; -; apr_tables.h - apr_make_array - apr_push_array - apr_array_cat - apr_copy_array - apr_copy_array_hdr - apr_append_arrays - apr_array_pstrcat - apr_make_table - apr_copy_table - apr_clear_table - apr_table_get - apr_table_set - apr_table_setn - apr_table_unset - apr_table_merge - apr_table_mergen - apr_table_add - apr_table_addn - apr_overlay_tables - apr_table_do - apr_table_vdo - apr_overlap_tables -; -; - apr_run_cleanup - apr_cleanup_for_exec - apr_null_cleanup - apr_note_subprocess -; - apr_vformatter - apr_snprintf - apr_vsnprintf - apr_getpass - - apr_tokenize_to_argv - apr_filename_of_pathname - - apr_open_stderr - apr_get_pipe_timeout - apr_set_pipe_timeout - apr_terminate - apr_dso_load - apr_dso_unload - apr_dso_sym - apr_collapse_spaces - apr_month_snames - apr_day_snames - apr_strerror - apr_generate_random_bytes - apr_strnatcmp - apr_strnatcasecmp - apr_dso_error -; -; apr_hash.h - apr_make_hash - apr_hash_set - apr_hash_get - apr_hash_first - apr_hash_next - apr_hash_this -; -; apr_lock.h - apr_create_lock - apr_lock - apr_unlock - apr_destroy_lock - apr_child_init_lock - apr_get_lockdata - apr_set_lockdata - apr_get_os_lock -; -; apr_uuid.h - apr_format_uuid - apr_parse_uuid - apr_get_uuid - -; apr_mmap.h - apr_mmap_create - apr_mmap_delete - apr_mmap_offset - -; Moved out of the way for Bill Stoddard's reorg -; -; apr_getopt.h - apr_getopt - apr_initopt -; apr_opterr -; apr_optind -; apr_optopt -; apr_optreset -; apr_optarg - diff --git a/aprlib.dsp b/aprlib.dsp deleted file mode 100644 index dec6160d3a5..00000000000 --- a/aprlib.dsp +++ /dev/null @@ -1,527 +0,0 @@ -# Microsoft Developer Studio Project File - Name="aprlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=aprlib - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "aprlib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "aprlib.mak" CFG="aprlib - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "aprlib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "aprlib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe - -!IF "$(CFG)" == "aprlib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "LibR" -# PROP BASE Intermediate_Dir "LibR" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "LibR" -# PROP Intermediate_Dir "LibR" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibR\aprlib" /FD /c -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"LibR\apr.lib" -# ADD LIB32 /nologo /out:"LibR\apr.lib" - -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "LibD" -# PROP BASE Intermediate_Dir "LibD" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "LibD" -# PROP Intermediate_Dir "LibD" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibD\aprlib" /FD /c -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"LibD\apr.lib" -# ADD LIB32 /nologo /out:"LibD\apr.lib" - -!ENDIF - -# Begin Target - -# Name "aprlib - Win32 Release" -# Name "aprlib - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter ".c" -# Begin Group "time" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\time\win32\access.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\atime.h -# End Source File -# Begin Source File - -SOURCE=.\time\win32\time.c -# End Source File -# Begin Source File - -SOURCE=.\time\win32\timestr.c -# End Source File -# End Group -# Begin Group "strings" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\strings\apr_cpystrn.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_fnmatch.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_snprintf.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_strings.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_strnatcmp.c -# End Source File -# End Group -# Begin Group "passwd" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\passwd\apr_getpass.c -# End Source File -# Begin Source File - -SOURCE=.\passwd\apr_md5.c -# End Source File -# End Group -# Begin Group "tables" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\tables\apr_hash.c -# End Source File -# Begin Source File - -SOURCE=.\tables\apr_tables.c -# End Source File -# End Group -# Begin Group "misc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\misc\unix\errorcodes.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\getopt.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\getuuid.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\misc.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\unix\misc.h -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\names.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\rand.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\start.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\uuid.c -# End Source File -# End Group -# Begin Group "file_io" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\file_io\win32\canonfile.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\dir.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\unix\fileacc.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\filedup.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\fileio.h -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\filestat.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\flock.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\unix\fullrw.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\open.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\pipe.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\readwrite.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\seek.c -# End Source File -# End Group -# Begin Group "locks" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\locks\win32\locks.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\locks.h -# End Source File -# End Group -# Begin Group "network_io" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\network_io\unix\inet_ntop.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\networkio.h -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\poll.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\unix\sa_common.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sendrecv.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockaddr.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockets.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockopt.c -# End Source File -# End Group -# Begin Group "threadproc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\threadproc\win32\proc.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\signals.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\thread.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\threadpriv.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\threadproc.h -# End Source File -# End Group -# Begin Group "dso" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\dso\win32\dso.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\dso.h -# End Source File -# End Group -# Begin Group "lib" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\lib\apr_pools.c -# End Source File -# Begin Source File - -SOURCE=.\lib\apr_signal.c -# End Source File -# End Group -# Begin Group "i18n" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\arch\unix\i18n.h -# End Source File -# Begin Source File - -SOURCE=.\i18n\unix\utf8_ucs2.c -# End Source File -# Begin Source File - -SOURCE=.\i18n\unix\xlate.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Group "shmem" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\shmem\win32\shmem.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Group "mmap" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\mmap\unix\common.c -# End Source File -# Begin Source File - -SOURCE=.\mmap\win32\mmap.c -# End Source File -# End Group -# End Group -# Begin Group "Generated Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apr.hw - -!IF "$(CFG)" == "aprlib - Win32 Release" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\apr_private.h -# End Source File -# End Group -# Begin Group "External Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr_compat.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_dso.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_errno.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_file_io.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_fnmatch.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_general.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_getopt.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_hash.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_lib.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_lock.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_md5.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_mmap.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_network_io.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_pools.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_portable.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_shmem.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_strings.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_tables.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_thread_proc.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_time.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_uuid.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_xlate.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\aprlib.def -# End Source File -# End Target -# End Project diff --git a/aprlibdll.dsp b/aprlibdll.dsp deleted file mode 100644 index 06033f62d38..00000000000 --- a/aprlibdll.dsp +++ /dev/null @@ -1,100 +0,0 @@ -# Microsoft Developer Studio Project File - Name="aprlibdll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=aprlibdll - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "aprlibdll.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "aprlibdll.mak" CFG="aprlibdll - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "aprlibdll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "aprlibdll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "aprlibdll - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\aprlibdll" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:0x6EE0000 -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:0x6EE0000 - -!ELSEIF "$(CFG)" == "aprlibdll - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\aprlibdll" /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /base:0x6EE0000 -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /base:0x6EE00000 -# SUBTRACT LINK32 /incremental:no /map - -!ENDIF - -# Begin Target - -# Name "aprlibdll - Win32 Release" -# Name "aprlibdll - Win32 Debug" -# Begin Source File - -SOURCE=.\misc\win32\aprlib.c -# End Source File -# Begin Source File - -SOURCE=.\aprlib.def -# End Source File -# End Target -# End Project diff --git a/libapr.def b/libapr.def index fa899d36c06..e776153cfc4 100644 --- a/libapr.def +++ b/libapr.def @@ -1,6 +1,6 @@ -; aprlib.def : +; libapr.def : -LIBRARY aprlib +LIBRARY libapr DESCRIPTION '' EXPORTS diff --git a/libapr.dsp b/libapr.dsp index 06033f62d38..8af736d2aab 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -1,35 +1,34 @@ -# Microsoft Developer Studio Project File - Name="aprlibdll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Project File - Name="libapr" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 -CFG=aprlibdll - Win32 Debug +CFG=libapr - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE -!MESSAGE NMAKE /f "aprlibdll.mak". +!MESSAGE NMAKE /f "libapr.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE -!MESSAGE NMAKE /f "aprlibdll.mak" CFG="aprlibdll - Win32 Debug" +!MESSAGE NMAKE /f "libapr.mak" CFG="libapr - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "aprlibdll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "aprlibdll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libapr - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libapr - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project -# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe -!IF "$(CFG)" == "aprlibdll - Win32 Release" +!IF "$(CFG)" == "libapr - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -43,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\aprlibdll" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libapr" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -52,10 +51,10 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:0x6EE0000 -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/aprlib.dll" /base:0x6EE0000 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /machine:I386 -!ELSEIF "$(CFG)" == "aprlibdll - Win32 Debug" +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 @@ -68,8 +67,8 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\aprlibdll" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -78,23 +77,22 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/aprlib.dll" /base:0x6EE0000 -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/aprlib.dll" /base:0x6EE00000 -# SUBTRACT LINK32 /incremental:no /map +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 !ENDIF # Begin Target -# Name "aprlibdll - Win32 Release" -# Name "aprlibdll - Win32 Debug" +# Name "libapr - Win32 Release" +# Name "libapr - Win32 Debug" # Begin Source File -SOURCE=.\misc\win32\aprlib.c +SOURCE=.\misc\win32\libapr.c # End Source File # Begin Source File -SOURCE=.\aprlib.def +SOURCE=.\libapr.def # End Source File # End Target # End Project diff --git a/misc/win32/aprlib.c b/misc/win32/aprlib.c deleted file mode 100644 index b54667430e0..00000000000 --- a/misc/win32/aprlib.c +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Placeholder to force aprlib.dll creation with no LNK4001 error - * - * However, this isn't a bad place to store dynamic-only functions - * that determine which version of apr the application has loaded. - * These functions are of (less?) importance to static-bound apps. - */ diff --git a/test/aprtest.dsp b/test/aprtest.dsp index f562131f7b4..8d40f8b2db7 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="aprtest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) External Target" 0x0106 @@ -22,7 +22,6 @@ CFG=aprtest - Win32 Debug !MESSAGE # Begin Project -# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" From 5c5d4c998ff657184e19f1d00afafe3a086a96c8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 21 Dec 2000 01:24:59 +0000 Subject: [PATCH 0995/7878] Correction, commited the vc5. Need vc6 in the tree. Humble appologies. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60976 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 7 ++++--- libapr.dsp | 7 ++++--- test/aprtest.dsp | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apr.dsp b/apr.dsp index 8e4fcd5c28e..041665fb89a 100644 --- a/apr.dsp +++ b/apr.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="apr" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 @@ -22,6 +22,7 @@ CFG=apr - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -66,8 +67,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/libapr.dsp b/libapr.dsp index 8af736d2aab..b33699aa5b9 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="libapr" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 @@ -22,6 +22,7 @@ CFG=libapr - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -67,8 +68,8 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" diff --git a/test/aprtest.dsp b/test/aprtest.dsp index 8d40f8b2db7..f562131f7b4 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="aprtest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) External Target" 0x0106 @@ -22,6 +22,7 @@ CFG=aprtest - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" From abcce77e6ffd57935d0fa490449cc3bbf76d9137 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 21 Dec 2000 01:46:20 +0000 Subject: [PATCH 0996/7878] Out of the sandbox and into prime time. Note... these should always and only be regenerated immediately prior to the tag and roll. Do not assume they are current with the sources in the development tree. They should be generated as vc5 make files, since only vc5 makefiles are readable by both vc5 and vc6. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60977 13f79535-47bb-0310-9956-ffa450edef68 --- apr.mak | 1389 ++++++++++++++++++++++++++++++++++++++++++++++++++++ libapr.mak | 258 ++++++++++ 2 files changed, 1647 insertions(+) create mode 100644 apr.mak create mode 100644 libapr.mak diff --git a/apr.mak b/apr.mak new file mode 100644 index 00000000000..08bd7245b53 --- /dev/null +++ b/apr.mak @@ -0,0 +1,1389 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on apr.dsp +!IF "$(CFG)" == "" +CFG=apr - Win32 Debug +!MESSAGE No configuration specified. Defaulting to apr - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "apr - Win32 Release" && "$(CFG)" != "apr - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr.mak" CFG="apr - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "apr - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +!IF "$(CFG)" == "apr - Win32 Release" + +OUTDIR=.\LibR +INTDIR=.\LibR +# Begin Custom Macros +OutDir=.\LibR +# End Custom Macros + +!IF "$(RECURSE)" == "0" + +ALL : "$(OUTDIR)\apr.lib" + +!ELSE + +ALL : "$(OUTDIR)\apr.lib" + +!ENDIF + +CLEAN : + -@erase "$(INTDIR)\access.obj" + -@erase "$(INTDIR)\apr.idb" + -@erase "$(INTDIR)\apr_cpystrn.obj" + -@erase "$(INTDIR)\apr_fnmatch.obj" + -@erase "$(INTDIR)\apr_getpass.obj" + -@erase "$(INTDIR)\apr_hash.obj" + -@erase "$(INTDIR)\apr_md5.obj" + -@erase "$(INTDIR)\apr_pools.obj" + -@erase "$(INTDIR)\apr_signal.obj" + -@erase "$(INTDIR)\apr_snprintf.obj" + -@erase "$(INTDIR)\apr_strings.obj" + -@erase "$(INTDIR)\apr_strnatcmp.obj" + -@erase "$(INTDIR)\apr_tables.obj" + -@erase "$(INTDIR)\common.obj" + -@erase "$(INTDIR)\dir.obj" + -@erase "$(INTDIR)\dso.obj" + -@erase "$(INTDIR)\errorcodes.obj" + -@erase "$(INTDIR)\fileacc.obj" + -@erase "$(INTDIR)\filedup.obj" + -@erase "$(INTDIR)\filestat.obj" + -@erase "$(INTDIR)\flock.obj" + -@erase "$(INTDIR)\fullrw.obj" + -@erase "$(INTDIR)\getopt.obj" + -@erase "$(INTDIR)\getuuid.obj" + -@erase "$(INTDIR)\inet_ntop.obj" + -@erase "$(INTDIR)\locks.obj" + -@erase "$(INTDIR)\misc.obj" + -@erase "$(INTDIR)\mmap.obj" + -@erase "$(INTDIR)\names.obj" + -@erase "$(INTDIR)\open.obj" + -@erase "$(INTDIR)\pipe.obj" + -@erase "$(INTDIR)\poll.obj" + -@erase "$(INTDIR)\proc.obj" + -@erase "$(INTDIR)\rand.obj" + -@erase "$(INTDIR)\readwrite.obj" + -@erase "$(INTDIR)\seek.obj" + -@erase "$(INTDIR)\sendrecv.obj" + -@erase "$(INTDIR)\signals.obj" + -@erase "$(INTDIR)\sockaddr.obj" + -@erase "$(INTDIR)\sockets.obj" + -@erase "$(INTDIR)\sockopt.obj" + -@erase "$(INTDIR)\start.obj" + -@erase "$(INTDIR)\thread.obj" + -@erase "$(INTDIR)\threadpriv.obj" + -@erase "$(INTDIR)\time.obj" + -@erase "$(INTDIR)\timestr.obj" + -@erase "$(INTDIR)\utf8_ucs2.obj" + -@erase "$(INTDIR)\uuid.obj" + -@erase "$(OUTDIR)\apr.lib" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +RSC=rc.exe +CPP=cl.exe +CPP_PROJ=/nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I\ + "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D\ + "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ + /Fd"$(INTDIR)\apr" /FD /c +CPP_OBJS=.\LibR/ +CPP_SBRS=. + +.c{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\apr.bsc" +BSC32_SBRS= \ + +LIB32=link.exe -lib +LIB32_FLAGS=/nologo /out:"$(OUTDIR)\apr.lib" +LIB32_OBJS= \ + "$(INTDIR)\access.obj" \ + "$(INTDIR)\apr_cpystrn.obj" \ + "$(INTDIR)\apr_fnmatch.obj" \ + "$(INTDIR)\apr_getpass.obj" \ + "$(INTDIR)\apr_hash.obj" \ + "$(INTDIR)\apr_md5.obj" \ + "$(INTDIR)\apr_pools.obj" \ + "$(INTDIR)\apr_signal.obj" \ + "$(INTDIR)\apr_snprintf.obj" \ + "$(INTDIR)\apr_strings.obj" \ + "$(INTDIR)\apr_strnatcmp.obj" \ + "$(INTDIR)\apr_tables.obj" \ + "$(INTDIR)\common.obj" \ + "$(INTDIR)\dir.obj" \ + "$(INTDIR)\dso.obj" \ + "$(INTDIR)\errorcodes.obj" \ + "$(INTDIR)\fileacc.obj" \ + "$(INTDIR)\filedup.obj" \ + "$(INTDIR)\filestat.obj" \ + "$(INTDIR)\flock.obj" \ + "$(INTDIR)\fullrw.obj" \ + "$(INTDIR)\getopt.obj" \ + "$(INTDIR)\getuuid.obj" \ + "$(INTDIR)\inet_ntop.obj" \ + "$(INTDIR)\locks.obj" \ + "$(INTDIR)\misc.obj" \ + "$(INTDIR)\mmap.obj" \ + "$(INTDIR)\names.obj" \ + "$(INTDIR)\open.obj" \ + "$(INTDIR)\pipe.obj" \ + "$(INTDIR)\poll.obj" \ + "$(INTDIR)\proc.obj" \ + "$(INTDIR)\rand.obj" \ + "$(INTDIR)\readwrite.obj" \ + "$(INTDIR)\seek.obj" \ + "$(INTDIR)\sendrecv.obj" \ + "$(INTDIR)\signals.obj" \ + "$(INTDIR)\sockaddr.obj" \ + "$(INTDIR)\sockets.obj" \ + "$(INTDIR)\sockopt.obj" \ + "$(INTDIR)\start.obj" \ + "$(INTDIR)\thread.obj" \ + "$(INTDIR)\threadpriv.obj" \ + "$(INTDIR)\time.obj" \ + "$(INTDIR)\timestr.obj" \ + "$(INTDIR)\utf8_ucs2.obj" \ + "$(INTDIR)\uuid.obj" + +"$(OUTDIR)\apr.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) + $(LIB32) @<< + $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) +<< + +!ELSEIF "$(CFG)" == "apr - Win32 Debug" + +OUTDIR=.\LibD +INTDIR=.\LibD +# Begin Custom Macros +OutDir=.\LibD +# End Custom Macros + +!IF "$(RECURSE)" == "0" + +ALL : "$(OUTDIR)\apr.lib" + +!ELSE + +ALL : "$(OUTDIR)\apr.lib" + +!ENDIF + +CLEAN : + -@erase "$(INTDIR)\access.obj" + -@erase "$(INTDIR)\apr.idb" + -@erase "$(INTDIR)\apr.pdb" + -@erase "$(INTDIR)\apr_cpystrn.obj" + -@erase "$(INTDIR)\apr_fnmatch.obj" + -@erase "$(INTDIR)\apr_getpass.obj" + -@erase "$(INTDIR)\apr_hash.obj" + -@erase "$(INTDIR)\apr_md5.obj" + -@erase "$(INTDIR)\apr_pools.obj" + -@erase "$(INTDIR)\apr_signal.obj" + -@erase "$(INTDIR)\apr_snprintf.obj" + -@erase "$(INTDIR)\apr_strings.obj" + -@erase "$(INTDIR)\apr_strnatcmp.obj" + -@erase "$(INTDIR)\apr_tables.obj" + -@erase "$(INTDIR)\common.obj" + -@erase "$(INTDIR)\dir.obj" + -@erase "$(INTDIR)\dso.obj" + -@erase "$(INTDIR)\errorcodes.obj" + -@erase "$(INTDIR)\fileacc.obj" + -@erase "$(INTDIR)\filedup.obj" + -@erase "$(INTDIR)\filestat.obj" + -@erase "$(INTDIR)\flock.obj" + -@erase "$(INTDIR)\fullrw.obj" + -@erase "$(INTDIR)\getopt.obj" + -@erase "$(INTDIR)\getuuid.obj" + -@erase "$(INTDIR)\inet_ntop.obj" + -@erase "$(INTDIR)\locks.obj" + -@erase "$(INTDIR)\misc.obj" + -@erase "$(INTDIR)\mmap.obj" + -@erase "$(INTDIR)\names.obj" + -@erase "$(INTDIR)\open.obj" + -@erase "$(INTDIR)\pipe.obj" + -@erase "$(INTDIR)\poll.obj" + -@erase "$(INTDIR)\proc.obj" + -@erase "$(INTDIR)\rand.obj" + -@erase "$(INTDIR)\readwrite.obj" + -@erase "$(INTDIR)\seek.obj" + -@erase "$(INTDIR)\sendrecv.obj" + -@erase "$(INTDIR)\signals.obj" + -@erase "$(INTDIR)\sockaddr.obj" + -@erase "$(INTDIR)\sockets.obj" + -@erase "$(INTDIR)\sockopt.obj" + -@erase "$(INTDIR)\start.obj" + -@erase "$(INTDIR)\thread.obj" + -@erase "$(INTDIR)\threadpriv.obj" + -@erase "$(INTDIR)\time.obj" + -@erase "$(INTDIR)\timestr.obj" + -@erase "$(INTDIR)\utf8_ucs2.obj" + -@erase "$(INTDIR)\uuid.obj" + -@erase "$(OUTDIR)\apr.lib" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +RSC=rc.exe +CPP=cl.exe +CPP_PROJ=/nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I\ + "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D\ + "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ + /Fd"$(INTDIR)\apr" /FD /c +CPP_OBJS=.\LibD/ +CPP_SBRS=. + +.c{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\apr.bsc" +BSC32_SBRS= \ + +LIB32=link.exe -lib +LIB32_FLAGS=/nologo /out:"$(OUTDIR)\apr.lib" +LIB32_OBJS= \ + "$(INTDIR)\access.obj" \ + "$(INTDIR)\apr_cpystrn.obj" \ + "$(INTDIR)\apr_fnmatch.obj" \ + "$(INTDIR)\apr_getpass.obj" \ + "$(INTDIR)\apr_hash.obj" \ + "$(INTDIR)\apr_md5.obj" \ + "$(INTDIR)\apr_pools.obj" \ + "$(INTDIR)\apr_signal.obj" \ + "$(INTDIR)\apr_snprintf.obj" \ + "$(INTDIR)\apr_strings.obj" \ + "$(INTDIR)\apr_strnatcmp.obj" \ + "$(INTDIR)\apr_tables.obj" \ + "$(INTDIR)\common.obj" \ + "$(INTDIR)\dir.obj" \ + "$(INTDIR)\dso.obj" \ + "$(INTDIR)\errorcodes.obj" \ + "$(INTDIR)\fileacc.obj" \ + "$(INTDIR)\filedup.obj" \ + "$(INTDIR)\filestat.obj" \ + "$(INTDIR)\flock.obj" \ + "$(INTDIR)\fullrw.obj" \ + "$(INTDIR)\getopt.obj" \ + "$(INTDIR)\getuuid.obj" \ + "$(INTDIR)\inet_ntop.obj" \ + "$(INTDIR)\locks.obj" \ + "$(INTDIR)\misc.obj" \ + "$(INTDIR)\mmap.obj" \ + "$(INTDIR)\names.obj" \ + "$(INTDIR)\open.obj" \ + "$(INTDIR)\pipe.obj" \ + "$(INTDIR)\poll.obj" \ + "$(INTDIR)\proc.obj" \ + "$(INTDIR)\rand.obj" \ + "$(INTDIR)\readwrite.obj" \ + "$(INTDIR)\seek.obj" \ + "$(INTDIR)\sendrecv.obj" \ + "$(INTDIR)\signals.obj" \ + "$(INTDIR)\sockaddr.obj" \ + "$(INTDIR)\sockets.obj" \ + "$(INTDIR)\sockopt.obj" \ + "$(INTDIR)\start.obj" \ + "$(INTDIR)\thread.obj" \ + "$(INTDIR)\threadpriv.obj" \ + "$(INTDIR)\time.obj" \ + "$(INTDIR)\timestr.obj" \ + "$(INTDIR)\utf8_ucs2.obj" \ + "$(INTDIR)\uuid.obj" + +"$(OUTDIR)\apr.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) + $(LIB32) @<< + $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) +<< + +!ENDIF + + +!IF "$(CFG)" == "apr - Win32 Release" || "$(CFG)" == "apr - Win32 Debug" +SOURCE=.\time\win32\access.c +DEP_CPP_ACCES=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\access.obj" : $(SOURCE) $(DEP_CPP_ACCES) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\time\win32\time.c +DEP_CPP_TIME_=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\time\win32\timestr.c +DEP_CPP_TIMES=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\strings\apr_cpystrn.c +DEP_CPP_APR_C=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_cpystrn.obj" : $(SOURCE) $(DEP_CPP_APR_C) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\strings\apr_fnmatch.c +DEP_CPP_APR_F=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_fnmatch.h"\ + ".\include\apr_lib.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_fnmatch.obj" : $(SOURCE) $(DEP_CPP_APR_F) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\strings\apr_snprintf.c +DEP_CPP_APR_S=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_S) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\strings\apr_strings.c +DEP_CPP_APR_ST=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_strings.obj" : $(SOURCE) $(DEP_CPP_APR_ST) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\strings\apr_strnatcmp.c +DEP_CPP_APR_STR=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_strnatcmp.obj" : $(SOURCE) $(DEP_CPP_APR_STR) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\passwd\apr_getpass.c +DEP_CPP_APR_G=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_getpass.obj" : $(SOURCE) $(DEP_CPP_APR_G) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\passwd\apr_md5.c +DEP_CPP_APR_M=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_md5.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_md5.obj" : $(SOURCE) $(DEP_CPP_APR_M) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\tables\apr_hash.c +DEP_CPP_APR_H=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ + ".\include\apr_hash.h"\ + ".\include\apr_pools.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_hash.obj" : $(SOURCE) $(DEP_CPP_APR_H) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\tables\apr_tables.c +DEP_CPP_APR_T=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_tables.obj" : $(SOURCE) $(DEP_CPP_APR_T) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\unix\errorcodes.c +DEP_CPP_ERROR=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\errorcodes.obj" : $(SOURCE) $(DEP_CPP_ERROR) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\unix\getopt.c +DEP_CPP_GETOP=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\win32\getuuid.c +DEP_CPP_GETUU=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_uuid.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\getuuid.obj" : $(SOURCE) $(DEP_CPP_GETUU) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\win32\misc.c +DEP_CPP_MISC_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\misc.obj" : $(SOURCE) $(DEP_CPP_MISC_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\win32\names.c +DEP_CPP_NAMES=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\win32\rand.c +DEP_CPP_RAND_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ + ".\include\apr_pools.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\rand.obj" : $(SOURCE) $(DEP_CPP_RAND_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\unix\start.c +DEP_CPP_START=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\locks.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\unix\uuid.c +DEP_CPP_UUID_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_uuid.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\uuid.obj" : $(SOURCE) $(DEP_CPP_UUID_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\canonfile.c +SOURCE=.\file_io\win32\dir.c +DEP_CPP_DIR_C=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\unix\fileacc.c +DEP_CPP_FILEA=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\filedup.c +DEP_CPP_FILED=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\filestat.c +DEP_CPP_FILES=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\flock.c +DEP_CPP_FLOCK=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\flock.obj" : $(SOURCE) $(DEP_CPP_FLOCK) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\unix\fullrw.c +DEP_CPP_FULLR=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_time.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\fullrw.obj" : $(SOURCE) $(DEP_CPP_FULLR) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\open.c +DEP_CPP_OPEN_=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\pipe.c +DEP_CPP_PIPE_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\readwrite.c +DEP_CPP_READW=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\seek.c +DEP_CPP_SEEK_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\locks\win32\locks.c +DEP_CPP_LOCKS=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\locks.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\network_io\unix\inet_ntop.c +DEP_CPP_INET_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\networkio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\inet_ntop.obj" : $(SOURCE) $(DEP_CPP_INET_) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\network_io\win32\poll.c +DEP_CPP_POLL_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\networkio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\poll.obj" : $(SOURCE) $(DEP_CPP_POLL_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\network_io\unix\sa_common.c +SOURCE=.\network_io\win32\sendrecv.c +DEP_CPP_SENDR=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\networkio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\sendrecv.obj" : $(SOURCE) $(DEP_CPP_SENDR) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\network_io\win32\sockaddr.c +DEP_CPP_SOCKA=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\networkio.h"\ + ".\network_io\os2\os2nerrno.h"\ + ".\network_io\unix\sa_common.c"\ + + +"$(INTDIR)\sockaddr.obj" : $(SOURCE) $(DEP_CPP_SOCKA) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\network_io\win32\sockets.c +DEP_CPP_SOCKE=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\networkio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\sockets.obj" : $(SOURCE) $(DEP_CPP_SOCKE) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\network_io\win32\sockopt.c +DEP_CPP_SOCKO=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\networkio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\threadproc\win32\proc.c +DEP_CPP_PROC_=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\threadproc.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\threadproc\win32\signals.c +DEP_CPP_SIGNA=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\threadproc.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\threadproc\win32\thread.c +DEP_CPP_THREA=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\threadproc.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\threadproc\win32\threadpriv.c +DEP_CPP_THREAD=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\threadproc.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\dso\win32\dso.c +DEP_CPP_DSO_C=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\dso.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\dso.obj" : $(SOURCE) $(DEP_CPP_DSO_C) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\lib\apr_pools.c +DEP_CPP_APR_P=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_hash.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\lib\apr_signal.c +DEP_CPP_APR_SI=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_signal.obj" : $(SOURCE) $(DEP_CPP_APR_SI) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\i18n\unix\utf8_ucs2.c +DEP_CPP_UTF8_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\utf8_ucs2.obj" : $(SOURCE) $(DEP_CPP_UTF8_) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\i18n\unix\xlate.c +SOURCE=.\shmem\win32\shmem.c +SOURCE=.\mmap\unix\common.c +DEP_CPP_COMMO=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_mmap.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\common.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\mmap\win32\mmap.c +DEP_CPP_MMAP_=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_mmap.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\mmap.obj" : $(SOURCE) $(DEP_CPP_MMAP_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\include\apr.hw + +!IF "$(CFG)" == "apr - Win32 Release" + +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + + +!ELSEIF "$(CFG)" == "apr - Win32 Debug" + +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + + +!ENDIF + + +!ENDIF + diff --git a/libapr.mak b/libapr.mak new file mode 100644 index 00000000000..d6f86ca8989 --- /dev/null +++ b/libapr.mak @@ -0,0 +1,258 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on libapr.dsp +!IF "$(CFG)" == "" +CFG=libapr - Win32 Debug +!MESSAGE No configuration specified. Defaulting to libapr - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "libapr - Win32 Release" && "$(CFG)" != "libapr - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libapr.mak" CFG="libapr - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libapr - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libapr - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +!IF "$(CFG)" == "libapr - Win32 Release" + +OUTDIR=.\Release +INTDIR=.\Release +# Begin Custom Macros +OutDir=.\Release +# End Custom Macros + +!IF "$(RECURSE)" == "0" + +ALL : "$(OUTDIR)\libapr.dll" + +!ELSE + +ALL : "apr - Win32 Release" "$(OUTDIR)\libapr.dll" + +!ENDIF + +!IF "$(RECURSE)" == "1" +CLEAN :"apr - Win32 ReleaseCLEAN" +!ELSE +CLEAN : +!ENDIF + -@erase "$(INTDIR)\libapr.idb" + -@erase "$(INTDIR)\libapr.obj" + -@erase "$(OUTDIR)\libapr.dll" + -@erase "$(OUTDIR)\libapr.exp" + -@erase "$(OUTDIR)\libapr.lib" + -@erase "$(OUTDIR)\libapr.map" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP=cl.exe +CPP_PROJ=/nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I\ + "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D\ + "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ + /Fd"$(INTDIR)\libapr" /FD /c +CPP_OBJS=.\Release/ +CPP_SBRS=. + +.c{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +MTL=midl.exe +MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +RSC=rc.exe +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapr.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo\ + /base:"0x6EE0000" /subsystem:windows /dll /incremental:no\ + /pdb:"$(OUTDIR)\libapr.pdb" /map:"$(INTDIR)\libapr.map" /machine:I386\ + /def:".\libapr.def" /out:"$(OUTDIR)\libapr.dll" /implib:"$(OUTDIR)\libapr.lib" +DEF_FILE= \ + ".\libapr.def" +LINK32_OBJS= \ + "$(INTDIR)\libapr.obj" \ + ".\LibR\apr.lib" + +"$(OUTDIR)\libapr.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +OUTDIR=.\Debug +INTDIR=.\Debug +# Begin Custom Macros +OutDir=.\Debug +# End Custom Macros + +!IF "$(RECURSE)" == "0" + +ALL : "$(OUTDIR)\libapr.dll" + +!ELSE + +ALL : "apr - Win32 Debug" "$(OUTDIR)\libapr.dll" + +!ENDIF + +!IF "$(RECURSE)" == "1" +CLEAN :"apr - Win32 DebugCLEAN" +!ELSE +CLEAN : +!ENDIF + -@erase "$(INTDIR)\libapr.idb" + -@erase "$(INTDIR)\libapr.obj" + -@erase "$(OUTDIR)\libapr.dll" + -@erase "$(OUTDIR)\libapr.exp" + -@erase "$(OUTDIR)\libapr.lib" + -@erase "$(OUTDIR)\libapr.map" + -@erase "$(OUTDIR)\libapr.pdb" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP=cl.exe +CPP_PROJ=/nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I\ + "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D\ + "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ + /Fd"$(INTDIR)\libapr" /FD /c +CPP_OBJS=.\Debug/ +CPP_SBRS=. + +.c{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +MTL=midl.exe +MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +RSC=rc.exe +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapr.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo\ + /base:"0x6EE0000" /subsystem:windows /dll /incremental:no\ + /pdb:"$(OUTDIR)\libapr.pdb" /map:"$(INTDIR)\libapr.map" /debug /machine:I386\ + /def:".\libapr.def" /out:"$(OUTDIR)\libapr.dll" /implib:"$(OUTDIR)\libapr.lib" +DEF_FILE= \ + ".\libapr.def" +LINK32_OBJS= \ + "$(INTDIR)\libapr.obj" \ + ".\LibD\apr.lib" + +"$(OUTDIR)\libapr.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + + +!IF "$(CFG)" == "libapr - Win32 Release" || "$(CFG)" == "libapr - Win32 Debug" + +!IF "$(CFG)" == "libapr - Win32 Release" + +"apr - Win32 Release" : + cd "." + $(MAKE) /$(MAKEFLAGS) /F ".\apr.mak" CFG="apr - Win32 Release" + cd "." + +"apr - Win32 ReleaseCLEAN" : + cd "." + $(MAKE) /$(MAKEFLAGS) CLEAN /F ".\apr.mak" CFG="apr - Win32 Release"\ + RECURSE=1 + cd "." + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +"apr - Win32 Debug" : + cd "." + $(MAKE) /$(MAKEFLAGS) /F ".\apr.mak" CFG="apr - Win32 Debug" + cd "." + +"apr - Win32 DebugCLEAN" : + cd "." + $(MAKE) /$(MAKEFLAGS) CLEAN /F ".\apr.mak" CFG="apr - Win32 Debug" RECURSE=1\ + + cd "." + +!ENDIF + +SOURCE=.\misc\win32\libapr.c + +"$(INTDIR)\libapr.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + + +!ENDIF + From f30f127c4fff48a0fcd8a8b82b3ede13cc2e0d39 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 21 Dec 2000 14:51:34 +0000 Subject: [PATCH 0997/7878] Cleanup a group of apr compil warnings on Solaris Submitted by: Dale Ghent <daleg@elemental.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60978 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ i18n/unix/xlate.c | 3 +++ misc/unix/getuuid.c | 3 +++ passwd/apr_getpass.c | 3 +++ strings/apr_strings.c | 3 +++ 5 files changed, 16 insertions(+) diff --git a/CHANGES b/CHANGES index 561f7970dda..cf0428f71d0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR b1 + + *) Cleanup some compiler warnings on Solaris + [Dale Ghent <daleg@elemental.org> + *) apr_getaddrinfo() can now return multiple addresses for a host via the next field in apr_sockaddr_t. [Jeff Trawick] diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index b3f308d404e..4b8eb5cadac 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -67,6 +67,9 @@ #ifdef HAVE_STDDEF_H #include <stddef.h> /* for NULL */ #endif +#ifdef HAVE_STRINGS_H +#include <strings.h> +#endif #ifdef HAVE_LANGINFO_H #include <langinfo.h> #endif diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index 13a54a90d71..34e51903670 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -66,6 +66,9 @@ #include "apr_uuid.h" #include "apr_md5.h" #include "apr_general.h" +#ifdef HAVE_STRINGS_H +#include <strings.h> +#endif #ifdef HAVE_NETDB_H #include <netdb.h> #endif diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index c0a716c5ff9..9a7c5d5b472 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -73,6 +73,9 @@ #if HAVE_STDLIB_H #include <stdlib.h> #endif +#ifdef HAVE_STRINGS_H +#include <strings.h> +#endif #if defined(HAVE_TERMIOS_H) && !defined(HAVE_GETPASS) #include <termios.h> diff --git a/strings/apr_strings.c b/strings/apr_strings.c index a9e12db5a5b..628c73ab157 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -59,6 +59,9 @@ #ifdef HAVE_STDDEF_H #include <stddef.h> /* NULL */ #endif +#ifdef HAVE_STRINGS_H +#include <strings.h> +#endif APR_DECLARE(char *) apr_pstrdup(apr_pool_t *a, const char *s) { From 9039b5bcc0a37dd625bd3ad83e42681c10eeca61 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 21 Dec 2000 16:44:12 +0000 Subject: [PATCH 0998/7878] Tighten up the testsock code a bit. This allows the testsock code to detect the dead child processes on FreeBSD. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60979 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/testsock.c b/test/testsock.c index 6731bb6133b..3bbae24fce7 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -96,18 +96,18 @@ static int run_basic_test(apr_pool_t *context) exit(-1); } - while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) != APR_CHILD_DONE || - (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) != APR_CHILD_DONE) { + while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) == APR_CHILD_NOTDONE && + (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) == APR_CHILD_NOTDONE) { continue; } if (s1 == APR_SUCCESS) { apr_kill(&proc2, SIGTERM); - apr_wait_proc(&proc2, APR_WAIT); + while (apr_wait_proc(&proc2, APR_WAIT) == APR_CHILD_NOTDONE); } else { apr_kill(&proc1, SIGTERM); - apr_wait_proc(&proc1, APR_WAIT); + while (apr_wait_proc(&proc1, APR_WAIT) == APR_CHILD_NOTDONE); } fprintf(stdout, "Network test completed.\n"); @@ -162,18 +162,18 @@ static int run_sendfile(apr_pool_t *context, int number) exit(-1); } - while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) != APR_CHILD_DONE || - (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) != APR_CHILD_DONE) { + while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) == APR_CHILD_NOTDONE && + (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) == APR_CHILD_NOTDONE) { continue; } if (s1 == APR_SUCCESS) { apr_kill(&proc2, SIGTERM); - apr_wait_proc(&proc2, APR_WAIT); + while (apr_wait_proc(&proc2, APR_WAIT) == APR_CHILD_NOTDONE); } else { apr_kill(&proc1, SIGTERM); - apr_wait_proc(&proc1, APR_WAIT); + while (apr_wait_proc(&proc1, APR_WAIT) == APR_CHILD_NOTDONE); } fprintf(stdout, "Network test completed.\n"); From 128b27e66836b063b02ba7f28c0b38b983bcc717 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 21 Dec 2000 20:08:35 +0000 Subject: [PATCH 0999/7878] The sendfile test needs to treat TIMEOUT clients as if they were NON-blocking. There is no reason to think that a TIMEOUT client will be able to send everything in one pass. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60980 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sendfile.c b/test/sendfile.c index 81569e49324..4ef8b3ec12b 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -307,7 +307,7 @@ static int client(client_socket_mode_t socket_mode) strlen(TRL1) + strlen(TRL2) + TRL3_LEN + FILE_LENGTH; - if (socket_mode == BLK || socket_mode == TIMEOUT) { + if (socket_mode == BLK) { current_file_offset = 0; len = FILE_LENGTH; rv = apr_sendfile(sock, f, &hdtr, &current_file_offset, &len, 0); From df6185b548656d0caeccb76fef6f9cad3b3edec0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 21 Dec 2000 20:59:26 +0000 Subject: [PATCH 1000/7878] Allow any support stuff we've authored to rely soley on apr (+aprutil) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60981 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 +++- include/apr.h.in | 2 ++ include/apr.hw | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index c5d0941d47b..24e42a9dbf1 100644 --- a/configure.in +++ b/configure.in @@ -262,7 +262,7 @@ AC_CHECK_HEADERS(dirent.h, direnth="1", dirent="0") AC_CHECK_HEADERS(errno.h, errnoh="1", errnoh="0") AC_CHECK_HEADERS(net/errno.h) AC_CHECK_HEADERS(fcntl.h, fcntlh="1", fcntl="0") -AC_CHECK_HEADERS(io.h) +AC_CHECK_HEADERS(io.h, ioh="1", ioh="0") AC_CHECK_HEADERS(limits.h) AC_CHECK_HEADERS(malloc.h) AC_CHECK_HEADERS(memory.h) @@ -312,9 +312,11 @@ AC_CHECK_HEADERS(dl.h) AC_CHECK_HEADERS(kernel/OS.h) AC_SUBST(ctypeh) +AC_SUBST(crypth) AC_SUBST(errnoh) AC_SUBST(direnth) AC_SUBST(fcntlh) +AC_SUBST(ioh) AC_SUBST(netinet_inh) AC_SUBST(stdargh) AC_SUBST(stdioh) diff --git a/include/apr.h.in b/include/apr.h.in index 34a158dea1a..f60e5f9e8c9 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -24,10 +24,12 @@ #define ENUM_BITFIELD(e,n,w) e n : w #endif +#define APR_HAVE_CRYPT_H @crypth@ #define APR_HAVE_CTYPE_H @ctypeh@ #define APR_HAVE_DIRENT_H @direnth@ #define APR_HAVE_ERRNO_H @errnoh@ #define APR_HAVE_FCNTL_H @fcntlh@ +#define APR_HAVE_IO_H @ioh@ #define APR_HAVE_NETINET_IN_H @netinet_inh@ #define APR_HAVE_PTHREAD_H @pthreadh@ #define APR_HAVE_STDARG_H @stdargh@ diff --git a/include/apr.hw b/include/apr.hw index aa10c070474..f41e63be1c6 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -115,10 +115,12 @@ #define NO_USE_SIGACTION +#define APR_HAVE_CRYPT_H 0 #define APR_HAVE_CTYPE_H 1 #define APR_HAVE_DIRENT_H 0 #define APR_HAVE_ERRNO_H 1 -#define APR_HAVE_FCNTL_H 0 +#define APR_HAVE_FCNTL_H 1 +#define APR_HAVE_IO_H 1 #define APR_HAVE_NETINET_IN_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_STDARG_H 1 From 441f24dd97b65cc4a3463849373e1430eb04772f Mon Sep 17 00:00:00 2001 From: Branko Cibej <brane@apache.org> Date: Thu, 21 Dec 2000 23:02:35 +0000 Subject: [PATCH 1001/7878] Don't export symbols from static library. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60982 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 8 ++------ apr.mak | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/apr.dsp b/apr.dsp index 041665fb89a..9e5c041770a 100644 --- a/apr.dsp +++ b/apr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -68,7 +68,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -519,9 +519,5 @@ SOURCE=.\include\apr_uuid.h SOURCE=.\include\apr_xlate.h # End Source File # End Group -# Begin Source File - -SOURCE=.\libapr.def -# End Source File # End Target # End Project diff --git a/apr.mak b/apr.mak index 08bd7245b53..84d3d88f980 100644 --- a/apr.mak +++ b/apr.mak @@ -101,7 +101,7 @@ RSC=rc.exe CPP=cl.exe CPP_PROJ=/nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I\ "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D\ - "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ + "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ /Fd"$(INTDIR)\apr" /FD /c CPP_OBJS=.\LibR/ CPP_SBRS=. @@ -273,7 +273,7 @@ RSC=rc.exe CPP=cl.exe CPP_PROJ=/nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I\ "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D\ - "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ + "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ /Fd"$(INTDIR)\apr" /FD /c CPP_OBJS=.\LibD/ CPP_SBRS=. From d7accae60356cddde50885528ec75ff40427062d Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 22 Dec 2000 00:02:51 +0000 Subject: [PATCH 1002/7878] Cleanups so that the support programs build cleanly. The Win32 values need to be sanity checked. Submitted by: Cliff Woolley <cliffwoolley@yahoo.com> Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60983 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++++- configure.in | 17 +++++++++++------ include/apr.h.in | 5 +++++ include/apr.hw | 5 +++++ 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index cf0428f71d0..3503e4e5836 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,10 @@ Changes with APR b1 + *) Cleanup to help Apache support programs build cleanly. + [Cliff Woolley <cliffwoolley@yahoo.com>] + *) Cleanup some compiler warnings on Solaris - [Dale Ghent <daleg@elemental.org> + [Dale Ghent <daleg@elemental.org>] *) apr_getaddrinfo() can now return multiple addresses for a host via the next field in apr_sockaddr_t. [Jeff Trawick] diff --git a/configure.in b/configure.in index 24e42a9dbf1..3d1e847071f 100644 --- a/configure.in +++ b/configure.in @@ -255,7 +255,7 @@ AC_HEADER_STDC AC_CHECK_HEADERS(ByteOrder.h) AC_CHECK_HEADERS(conio.h) -AC_CHECK_HEADERS(crypt.h) +AC_CHECK_HEADERS(crypt.h, crypth="1", crypth="0") AC_CHECK_HEADERS(ctype.h, ctypeh="1", ctypeh="0") AC_CHECK_HEADERS(dir.h) AC_CHECK_HEADERS(dirent.h, direnth="1", dirent="0") @@ -274,9 +274,9 @@ AC_CHECK_HEADERS(sys/sem.h) AC_CHECK_HEADERS(signal.h, signalh="1", signalh="0") AC_CHECK_HEADERS(stdarg.h, stdargh="1", stdargh="0") AC_CHECK_HEADERS(stddef.h) -AC_CHECK_HEADERS(stdio.h, stdioh="1", stdioh"0") -AC_CHECK_HEADERS(stdlib.h) -AC_CHECK_HEADERS(string.h) +AC_CHECK_HEADERS(stdio.h, stdioh="1", stdioh="0") +AC_CHECK_HEADERS(stdlib.h, stdlibh="1", stdlibh="0") +AC_CHECK_HEADERS(string.h, stringh="1", stringh="0") AC_CHECK_HEADERS(strings.h) AC_CHECK_HEADERS(sysapi.h) AC_CHECK_HEADERS(sysgtime.h) @@ -290,7 +290,7 @@ AC_CHECK_HEADERS(unistd.h, unistdh="1", unistdh="0") AC_CHECK_HEADERS(poll.h) AC_CHECK_HEADERS(sys/poll.h) AC_CHECK_HEADERS(unix.h) -AC_CHECK_HEADERS(arpa/inet.h) +AC_CHECK_HEADERS(arpa/inet.h, arpa_ineth="1", arpa_ineth="0") AC_CHECK_HEADERS(netinet/in.h, netinet_inh="1", netinet_inh="0") AC_CHECK_HEADERS(netinet/tcp.h) AC_CHECK_HEADERS(iconv.h) @@ -301,7 +301,7 @@ AC_CHECK_HEADERS(sys/mman.h) AC_CHECK_HEADERS(sys/resource.h) AC_CHECK_HEADERS(sys/select.h) AC_CHECK_HEADERS(sys/sendfile.h) -AC_CHECK_HEADERS(sys/signal.h) +AC_CHECK_HEADERS(sys/signal.h, sys_signalh="1", sys_signalh="0") AC_CHECK_HEADERS(sys/socket.h, sys_socketh="1", sys_socketh="0") AC_CHECK_HEADERS(sys/stat.h) AC_CHECK_HEADERS(sys/types.h, sys_typesh="1", sys_typesh="0") @@ -311,15 +311,20 @@ AC_CHECK_HEADERS(dl.h) AC_CHECK_HEADERS(kernel/OS.h) +AC_SUBST(arpa_ineth) AC_SUBST(ctypeh) AC_SUBST(crypth) AC_SUBST(errnoh) AC_SUBST(direnth) AC_SUBST(fcntlh) AC_SUBST(ioh) +AC_SUBST(netdbh) AC_SUBST(netinet_inh) AC_SUBST(stdargh) AC_SUBST(stdioh) +AC_SUBST(stdlibh) +AC_SUBST(stringh) +AC_SUBST(sys_signalh) AC_SUBST(sys_socketh) AC_SUBST(sys_typesh) AC_SUBST(sys_uioh) diff --git a/include/apr.h.in b/include/apr.h.in index f60e5f9e8c9..bedcc615114 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -24,16 +24,21 @@ #define ENUM_BITFIELD(e,n,w) e n : w #endif +#define APR_HAVE_ARPA_INET_H @arpa_ineth@ #define APR_HAVE_CRYPT_H @crypth@ #define APR_HAVE_CTYPE_H @ctypeh@ #define APR_HAVE_DIRENT_H @direnth@ #define APR_HAVE_ERRNO_H @errnoh@ #define APR_HAVE_FCNTL_H @fcntlh@ #define APR_HAVE_IO_H @ioh@ +#define APR_HAVE_NETDB_H @netdbh@ #define APR_HAVE_NETINET_IN_H @netinet_inh@ #define APR_HAVE_PTHREAD_H @pthreadh@ #define APR_HAVE_STDARG_H @stdargh@ #define APR_HAVE_STDIO_H @stdioh@ +#define APR_HAVE_STDLIB_H @stdlibh@ +#define APR_HAVE_STRING_H @stringh@ +#define APR_HAVE_SYS_SIGNAL_H @sys_signalh@ #define APR_HAVE_SYS_SOCKET_H @sys_socketh@ #define APR_HAVE_SYS_TYPES_H @sys_typesh@ #define APR_HAVE_SYS_UIO_H @sys_uioh@ diff --git a/include/apr.hw b/include/apr.hw index f41e63be1c6..99c19d633c3 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -115,16 +115,21 @@ #define NO_USE_SIGACTION +#define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_CRYPT_H 0 #define APR_HAVE_CTYPE_H 1 #define APR_HAVE_DIRENT_H 0 #define APR_HAVE_ERRNO_H 1 #define APR_HAVE_FCNTL_H 1 #define APR_HAVE_IO_H 1 +#define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_STDARG_H 1 #define APR_HAVE_STDIO_H 1 +#define APR_HAVE_STDLIB_H 1 +#define APR_HAVE_STRING_H 1 +#define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 0 From 1648f9e012017179d822b08f60e19b47b24b6f9c Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 22 Dec 2000 00:19:16 +0000 Subject: [PATCH 1003/7878] On FreeBSD, it is possible for the first call to sendfile to get EAGAIN, but still send some data. This means that we cannot call sendfile and then check for EAGAIN, and then wait and call sendfile again. If we do that, then we are likely to send the first chunk of data twice, once in the first call and once in the second. If we are using a timed write, then we check to make sure we can send data before trying to send it. This gets sendfile working on FreeBSD in Apache again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60984 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++++++ network_io/unix/sendrecv.c | 37 +++++++++++++++---------------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/CHANGES b/CHANGES index 3503e4e5836..3cf22a43605 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,13 @@ Changes with APR b1 + *) On FreeBSD, it is possible for the first call to sendfile to + get EAGAIN, but still send some data. This means that we cannot + call sendfile and then check for EAGAIN, and then wait and call + sendfile again. If we do that, then we are likely to send the + first chunk of data twice, once in the first call and once in the + second. If we are using a timed write, then we check to make sure + we can send data before trying to send it. [Ryan Bloom] + *) Cleanup to help Apache support programs build cleanly. [Cliff Woolley <cliffwoolley@yahoo.com>] diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 914d34cb931..7742c81cccc 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -412,6 +412,21 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, headerstruct.trl_cnt = hdtr->numtrailers; /* FreeBSD can send the headers/footers as part of the system call */ + if (sock->timeout > 0) { + /* On FreeBSD, it is possible for the first call to sendfile to + * get EAGAIN, but still send some data. This means that we cannot + * call sendfile and then check for EAGAIN, and then wait and call + * sendfile again. If we do that, then we are likely to send the + * first chunk of data twice, once in the first call and once in the + * second. If we are using a timed write, then we check to make sure + * we can send data before trying to send it. + */ + apr_status_t arv = wait_for_io_or_timeout(sock, 0); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } + } do { if (bytes_to_send) { @@ -443,28 +458,6 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, } } while (rv == -1 && errno == EINTR); - if (rv == -1 && - (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout > 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 0); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } - else { - do { - rv = sendfile(file->filedes, /* open file descriptor of the file to be sent */ - sock->socketdes, /* socket */ - *offset, /* where in the file to start */ - (size_t) * len, /* number of bytes to send */ - &headerstruct, /* Headers/footers */ - &nbytes, /* number of bytes written */ - flags /* undefined, set to 0 */ - ); - } while (rv == -1 && errno == EINTR); - } - } - (*len) = nbytes; if (rv == -1) { return errno; From 6452a490efeb93380c0613572b92d0e05777ea7d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 22 Dec 2000 08:32:42 +0000 Subject: [PATCH 1004/7878] The prior patch broke httpd. libapr.dsp relies on apr.dsp exporting all symbols, even if they are not used for anything more than a single binary (e.g. apache support apps). The answer is to duplicate and maintain the entire list of sources in both projects. Until we have a sane way to do this, the prior patch is reverted. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60985 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apr.dsp b/apr.dsp index 9e5c041770a..8e4fcd5c28e 100644 --- a/apr.dsp +++ b/apr.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="apr" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 @@ -22,7 +22,6 @@ CFG=apr - Win32 Debug !MESSAGE # Begin Project -# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -43,7 +42,7 @@ RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -67,8 +66,8 @@ LIB32=link.exe -lib RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -519,5 +518,9 @@ SOURCE=.\include\apr_uuid.h SOURCE=.\include\apr_xlate.h # End Source File # End Group +# Begin Source File + +SOURCE=.\libapr.def +# End Source File # End Target # End Project From 5804043b6a3204ec7ac81763e435903ff89a0426 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 22 Dec 2000 14:32:37 +0000 Subject: [PATCH 1005/7878] We need to search for AP_DECLARE APR_DECLARE and APU_DECLARE now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60986 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/make_export.awk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helpers/make_export.awk b/helpers/make_export.awk index e2ec040fcd2..c2b232154c5 100644 --- a/helpers/make_export.awk +++ b/helpers/make_export.awk @@ -1,6 +1,6 @@ # Based on Ryan Bloom's make_export.pl -/^#[ \t]*if(def)? (APR?_|!?defined).*/ { +/^#[ \t]*if(def)? (AP[RU]?_|!?defined).*/ { if (old_filename != FILENAME) { if (old_filename != "") printf("%s", line) macro_no = 0 @@ -32,14 +32,14 @@ next } -/^[ \t]*(APR?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?([A-Za-z0-9_]+)\(/ { +/^[ \t]*(AP[RU]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?([A-Za-z0-9_]+)\(/ { if (found) { found++ } for (i = 0; i < count; i++) { line = line "\t" } - sub("^[ \t]*(APR?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?", ""); + sub("^[ \t]*(AP[UR]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?", ""); sub("[(].*", ""); line = line $0 "\n" next From 28adb1ac5049c9fbfdb8db02c0d12a47a8f639e4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 22 Dec 2000 16:54:57 +0000 Subject: [PATCH 1006/7878] These two patches for apr and apr-util fix compile warnings on Solaris for str* and mem* functions. This fixes all of them. APR_HAVE_STRINGS_H is now defined in apr.h. Submitted by: Dale Ghent <daleg@elemental.org> Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60987 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 ++- i18n/unix/xlate.c | 2 +- include/apr.h.in | 1 + include/apr.hw | 1 + include/arch/unix/fileio.h | 2 +- misc/unix/getuuid.c | 2 +- passwd/apr_getpass.c | 2 +- strings/apr_strings.c | 2 +- tables/apr_tables.c | 2 +- 9 files changed, 10 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 3d1e847071f..6a324f0ce3b 100644 --- a/configure.in +++ b/configure.in @@ -277,7 +277,7 @@ AC_CHECK_HEADERS(stddef.h) AC_CHECK_HEADERS(stdio.h, stdioh="1", stdioh="0") AC_CHECK_HEADERS(stdlib.h, stdlibh="1", stdlibh="0") AC_CHECK_HEADERS(string.h, stringh="1", stringh="0") -AC_CHECK_HEADERS(strings.h) +AC_CHECK_HEADERS(strings.h, stringsh="1", stringsh="0") AC_CHECK_HEADERS(sysapi.h) AC_CHECK_HEADERS(sysgtime.h) AC_CHECK_HEADERS(termios.h) @@ -324,6 +324,7 @@ AC_SUBST(stdargh) AC_SUBST(stdioh) AC_SUBST(stdlibh) AC_SUBST(stringh) +AC_SUBST(stringsh) AC_SUBST(sys_signalh) AC_SUBST(sys_socketh) AC_SUBST(sys_typesh) diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 4b8eb5cadac..157f6c6b093 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -67,7 +67,7 @@ #ifdef HAVE_STDDEF_H #include <stddef.h> /* for NULL */ #endif -#ifdef HAVE_STRINGS_H +#if APR_HAVE_STRINGS_H #include <strings.h> #endif #ifdef HAVE_LANGINFO_H diff --git a/include/apr.h.in b/include/apr.h.in index bedcc615114..823fabfa905 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -38,6 +38,7 @@ #define APR_HAVE_STDIO_H @stdioh@ #define APR_HAVE_STDLIB_H @stdlibh@ #define APR_HAVE_STRING_H @stringh@ +#define APR_HAVE_STRINGS_H @stringsh@ #define APR_HAVE_SYS_SIGNAL_H @sys_signalh@ #define APR_HAVE_SYS_SOCKET_H @sys_socketh@ #define APR_HAVE_SYS_TYPES_H @sys_typesh@ diff --git a/include/apr.hw b/include/apr.hw index 99c19d633c3..b38cbd83009 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -129,6 +129,7 @@ #define APR_HAVE_STDIO_H 1 #define APR_HAVE_STDLIB_H 1 #define APR_HAVE_STRING_H 1 +#define APR_HAVE_STRINGS_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_TYPES_H 1 diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 24ca8e1d94a..f8f9d0f35ae 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -76,7 +76,7 @@ #if HAVE_STRING_H #include <string.h> #endif -#if HAVE_STRINGS_H +#if APR_HAVE_STRINGS_H #include <strings.h> #endif #if APR_HAVE_DIRENT_H diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index 34e51903670..28820f00f33 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -66,7 +66,7 @@ #include "apr_uuid.h" #include "apr_md5.h" #include "apr_general.h" -#ifdef HAVE_STRINGS_H +#if APR_HAVE_STRINGS_H #include <strings.h> #endif #ifdef HAVE_NETDB_H diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 9a7c5d5b472..bfb6457e4ae 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -73,7 +73,7 @@ #if HAVE_STDLIB_H #include <stdlib.h> #endif -#ifdef HAVE_STRINGS_H +#if APR_HAVE_STRINGS_H #include <strings.h> #endif diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 628c73ab157..15b3c408cb9 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -59,7 +59,7 @@ #ifdef HAVE_STDDEF_H #include <stddef.h> /* NULL */ #endif -#ifdef HAVE_STRINGS_H +#if APR_HAVE_STRINGS_H #include <strings.h> #endif diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 7e91e952d39..4fe35bfc252 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -75,7 +75,7 @@ #ifdef HAVE_STRING_H #include <string.h> #endif -#ifdef HAVE_STRINGS_H +#if APR_HAVE_STRINGS_H #include <strings.h> #endif From ace24e32e30eb7b3d3040e5a9fc875d433cdc66d Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Sat, 23 Dec 2000 03:07:10 +0000 Subject: [PATCH 1007/7878] OS/2: Allocate the right amount of space for an apr_dso_handle_t and provide a bit more space for the name of the failed module as it can be a full path. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60988 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os2/dso.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dso/os2/dso.c b/dso/os2/dso.c index 9bd9ccc8adc..d3eb678bbe0 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -70,11 +70,11 @@ static apr_status_t dso_cleanup(void *thedso) apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { - char failed_module[20]; + char failed_module[200]; HMODULE handle; int rc; - *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); + *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); (*res_handle)->cont = ctx; (*res_handle)->load_error = APR_SUCCESS; (*res_handle)->failed_module = NULL; From 122a6944151dc5c6d0e2f274847be0116bbcd951 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 28 Dec 2000 23:03:33 +0000 Subject: [PATCH 1008/7878] We do not want to return EAGAIN if there is a timeout set on the socket. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60989 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 6 +++--- test/sendfile.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 7742c81cccc..d4ba2a4dd28 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -385,7 +385,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, apr_int32_t flags) { - off_t nbytes; + off_t nbytes = 0; int rv, i; struct sf_hdtr headerstruct; size_t bytes_to_send = *len; @@ -412,7 +412,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, headerstruct.trl_cnt = hdtr->numtrailers; /* FreeBSD can send the headers/footers as part of the system call */ - if (sock->timeout > 0) { + if (sock->timeout >= 0) { /* On FreeBSD, it is possible for the first call to sendfile to * get EAGAIN, but still send some data. This means that we cannot * call sendfile and then check for EAGAIN, and then wait and call @@ -459,7 +459,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, } while (rv == -1 && errno == EINTR); (*len) = nbytes; - if (rv == -1) { + if (rv == -1 && (errno != EAGAIN || (errno == EAGAIN && sock->timeout < 0))) { return errno; } return APR_SUCCESS; diff --git a/test/sendfile.c b/test/sendfile.c index 4ef8b3ec12b..1da59d3b59d 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -434,7 +434,7 @@ static int client(client_socket_mode_t socket_mode) } while (total_bytes_sent < expected_len && (rv == APR_SUCCESS || - APR_STATUS_IS_EAGAIN(rv))); + (APR_STATUS_IS_EAGAIN(rv) && socket_mode != TIMEOUT))); if (total_bytes_sent != expected_len) { fprintf(stderr, "client problem: sent %ld of %ld bytes\n", From 627fd8c4f7198a394d76bc5dc4c342c02fe45cfd Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 28 Dec 2000 23:14:06 +0000 Subject: [PATCH 1009/7878] FreeBSD's sendfile does not work if the FreeBSD version is less than 4.2 and we are compiled for a threaded program. This change automatically detects that set of conditions, and sets the sendfile detection correctly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60990 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ configure.in | 27 +++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 3cf22a43605..ce6f3e6e2dd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) FreeBSD does not support sendfile() in combination with threads + before version 4.2. We no longer even try to support it. + [Ryan Bloom] + *) On FreeBSD, it is possible for the first call to sendfile to get EAGAIN, but still send some data. This means that we cannot call sendfile and then check for EAGAIN, and then wait and call diff --git a/configure.in b/configure.in index 6a324f0ce3b..a4e7c7967ab 100644 --- a/configure.in +++ b/configure.in @@ -216,12 +216,7 @@ AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) AC_CHECK_FUNCS(writev) sendfile="0" AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ]) -case "$OS" in - *alpha*-dec-osf* ) - sendfile="0" - echo "sendfile support disabled to avoid system problem" - ;; -esac + AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ]) AC_CHECK_FUNCS(getpass) APR_CHECK_INET_ADDR @@ -238,7 +233,6 @@ AC_CHECK_FUNCS(hstrerror) AC_CHECK_FUNCS(memmove, [ have_memmove="1" ], [have_memmove="0" ]) AC_CHECK_FUNCS(bzero, [ have_bzero="1" ], [ have_bzero="0"] ) -AC_SUBST(sendfile) AC_SUBST(fork) AC_SUBST(have_inet_addr) AC_SUBST(have_inet_network) @@ -585,7 +579,24 @@ fi AC_SUBST(threads) dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a -dnl threaded poll() +dnl threaded poll() and we don't want to use sendfile on early FreeBSD +dnl systems if we are also using threads. + +case "$OS" in + *freebsd*) + if test `echo "$OS" | sed -e 's/.*\(.\)\.\(.\)/\1\2/'` -le "41"; then + if test "$threads" = "1"; then + sendfile="0" + fi + fi + ;; + *alpha*-dec-osf* ) + sendfile="0" + echo "sendfile support disabled to avoid system problem" + ;; +esac +AC_SUBST(sendfile) + AC_CHECK_FUNCS(poll) From 169f212a4f365b50ce1bff29533cfd7cb2b083c4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 30 Dec 2000 18:31:36 +0000 Subject: [PATCH 1010/7878] Fix a couple of places where copied code wasn't modified correctly. This should get the apr_poll functions working better when it is implemented using select(). PR: 6977 Submitted by: Nick Caruso <ncaruso@gamesville.com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60991 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ network_io/unix/poll.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index ce6f3e6e2dd..f9ece7f3b14 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix a logic error in the poll code when implemented using select. + [Nick Caruso <ncaruso@gamesville.com>] + *) FreeBSD does not support sendfile() in combination with threads before version 4.2. We no longer even try to support it. [Ryan Bloom] diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index dce36448c80..c3305e8d80b 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -246,7 +246,7 @@ apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, FD_SET(sock->socketdes, aprset->read); } if (event & APR_POLLPRI) { - FD_SET(sock->socketdes, aprset->read); + FD_SET(sock->socketdes, aprset->except); } if (event & APR_POLLOUT) { FD_SET(sock->socketdes, aprset->write); @@ -351,7 +351,7 @@ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_ apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) { FD_CLR(sock->socketdes, aprset->read); - FD_CLR(sock->socketdes, aprset->read); + FD_CLR(sock->socketdes, aprset->except); FD_CLR(sock->socketdes, aprset->write); return APR_SUCCESS; } @@ -362,7 +362,7 @@ apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t event) FD_ZERO(aprset->read); } if (event & APR_POLLPRI) { - FD_ZERO(aprset->read); + FD_ZERO(aprset->except); } if (event & APR_POLLOUT) { FD_ZERO(aprset->write); From 93468c050ec6082daf98c7be4759b027770f3d0f Mon Sep 17 00:00:00 2001 From: Ben Laurie <ben@apache.org> Date: Sat, 30 Dec 2000 20:56:35 +0000 Subject: [PATCH 1011/7878] Compensate for missing getpwnam_r on FreeBSD 3.2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60992 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +++ user/unix/homedir.c | 2 +- user/unix/userinfo.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index a4e7c7967ab..71c8d26bda2 100644 --- a/configure.in +++ b/configure.in @@ -600,6 +600,9 @@ AC_SUBST(sendfile) AC_CHECK_FUNCS(poll) +dnl #----------------------------- Checking for missing POSIX thread functions +AC_CHECK_FUNCS(getpwnam_r) + dnl #----------------------------- Checking for Processes echo $ac_n "${nl}Checking for Processes...${nl}" diff --git a/user/unix/homedir.c b/user/unix/homedir.c index ae02406b4b7..56d10fa7f5f 100644 --- a/user/unix/homedir.c +++ b/user/unix/homedir.c @@ -71,7 +71,7 @@ apr_status_t apr_get_home_directory(char **dirname, const char *userid, apr_pool char pwbuf[512]; #endif -#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) if (!getpwnam_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw)) { #else if ((pw = getpwnam(userid)) != NULL) { diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index ae02406b4b7..56d10fa7f5f 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -71,7 +71,7 @@ apr_status_t apr_get_home_directory(char **dirname, const char *userid, apr_pool char pwbuf[512]; #endif -#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) if (!getpwnam_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw)) { #else if ((pw = getpwnam(userid)) != NULL) { From 5be1c185dbac75684ac6ba578b9d7ed5b6ee1300 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sun, 31 Dec 2000 12:26:41 +0000 Subject: [PATCH 1012/7878] I managed to miss these from a commit a while ago and so this hasn't been working on BeOS for a while. Oh well, here is the fix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60993 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/mm/aclocal.m4 | 15 ++++++++++++++- shmem/unix/mm/configure.in | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/shmem/unix/mm/aclocal.m4 b/shmem/unix/mm/aclocal.m4 index 74b4a5eef5f..235753a53cb 100644 --- a/shmem/unix/mm/aclocal.m4 +++ b/shmem/unix/mm/aclocal.m4 @@ -249,6 +249,7 @@ OCFLAGS="$CFLAGS" case "$1" in MM_SHMT_MM* ) CFLAGS="-DTEST_MMAP $CFLAGS" ;; MM_SHMT_IPCSHM ) CFLAGS="-DTEST_SHMGET $CFLAGS" ;; + MM_SHMT_BEOS ) CFLAGS="-DTEST_AREAS $CFLAGS" ;; esac AC_TRY_RUN( changequote(<<, >>)dnl @@ -288,6 +289,10 @@ changequote(<<, >>)dnl #if !defined(MAP_FAILED) #define MAP_FAILED ((void *)-1) #endif +#ifdef MM_OS_BEOS +#include <kernel/OS.h> +#endif + int testit(int size) { @@ -318,6 +323,14 @@ int testit(int size) } shmdt(segment); shmctl(fd, IPC_RMID, NULL); +#endif +#ifdef TEST_BEOS + area_id id; + id = create_area("mm_test", (void*)&segment, B_ANY_ADDRESS, size, + B_LAZY_LOCK, B_READ_AREA|B_WRITE_AREA); + if (id < 0) + return 0; + delete_area(id); #endif return 1; } @@ -343,7 +356,7 @@ int main(int argc, char *argv[]) m = 1024*1024*32; b = 0; for (;;) { - /* fprintf(stderr, "t=%d, m=%d, b=%d\n", t, m, b); */ + /* fprintf(stderr, "t=%d, m=%d, b=%d\n", t, m, b); */ rc = testit(m); if (rc) { d = ((t-m)/2); diff --git a/shmem/unix/mm/configure.in b/shmem/unix/mm/configure.in index d5be81ab9a6..432199bbcce 100644 --- a/shmem/unix/mm/configure.in +++ b/shmem/unix/mm/configure.in @@ -89,6 +89,7 @@ dnl # some special defines for brain dead platforms case $PLATFORM in *-*-sunos* ) AC_DEFINE(MM_OS_SUNOS) ;; BS2000-*-* ) AC_DEFINE(MM_OS_BS2000) ;; + *-*-beos* ) AC_DEFINE(MM_OS_BEOS) ;; esac dnl # From d83cc43b40a3bc3e15dc82157b2db5a38154206f Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sun, 31 Dec 2000 13:04:01 +0000 Subject: [PATCH 1013/7878] prevent duplicate exports. when srcdir is "." (or an absolute path to that same dir), then two copies of the include headers were processed. Instead, just process the true source dir, rather than those source headers *and* the headers created during the config/build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60994 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index c7df4215c67..d7b1be31051 100644 --- a/Makefile.in +++ b/Makefile.in @@ -118,16 +118,16 @@ delete-exports: $(TARGET_EXPORTS): if test -z "$(srcdir)"; then \ - $(AWK) -f $(srcdir)helpers/make_export.awk include/*.h > $@ ; \ + $(AWK) -f helpers/make_export.awk include/*.h > $@ ; \ else \ - $(AWK) -f $(srcdir)helpers/make_export.awk include/*.h $(srcdir)include/*.h > $@ ; \ + $(AWK) -f $(srcdir)helpers/make_export.awk $(srcdir)include/*.h > $@ ; \ fi docs: if test -z "$(srcdir)"; then \ - $(srcdir)helpers/scandoc -i$(srcdir)helpers/default.pl -p./docs/ ./include/*.h; \ + helpers/scandoc -ihelpers/default.pl -p./docs/ ./include/*.h; \ else \ - $(srcdir)helpers/scandoc -i$(srcdir)helpers/default.pl -p./docs/ ./include/*.h $(srcdir)include/*.h; \ + $(srcdir)helpers/scandoc -i$(srcdir)helpers/default.pl -p./docs/ $(srcdir)include/*.h; \ fi test: $(LIBAPR) From 5b6a1e7aa1e33839050f011021500518cbfc4320 Mon Sep 17 00:00:00 2001 From: Ben Laurie <ben@apache.org> Date: Sun, 31 Dec 2000 14:19:09 +0000 Subject: [PATCH 1014/7878] Fix a warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60995 13f79535-47bb-0310-9956-ffa450edef68 --- user/unix/homedir.c | 2 +- user/unix/userinfo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/user/unix/homedir.c b/user/unix/homedir.c index 56d10fa7f5f..c49e7b1871a 100644 --- a/user/unix/homedir.c +++ b/user/unix/homedir.c @@ -66,7 +66,7 @@ apr_status_t apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p) { struct passwd *pw; -#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) struct passwd pwd; char pwbuf[512]; #endif diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 56d10fa7f5f..c49e7b1871a 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -66,7 +66,7 @@ apr_status_t apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p) { struct passwd *pw; -#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) struct passwd pwd; char pwbuf[512]; #endif From 9284220d7e52729315deed4ed389f92c44879384 Mon Sep 17 00:00:00 2001 From: Ben Laurie <ben@apache.org> Date: Sun, 31 Dec 2000 17:45:28 +0000 Subject: [PATCH 1015/7878] Fix changed include paths. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60996 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/utf8_ucs2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/unix/utf8_ucs2.c b/i18n/unix/utf8_ucs2.c index 85f4ab9f9df..a3dddf46764 100644 --- a/i18n/unix/utf8_ucs2.c +++ b/i18n/unix/utf8_ucs2.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "unix/i18n.h" +#include "i18n.h" /* Implement the design principal specified by RFC 2718 2.2.5 * Guidelines for new URL Schemes - within the APR. From 70fe46fb5084b32bb857102f546f207c658d2617 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 31 Dec 2000 18:04:59 +0000 Subject: [PATCH 1016/7878] Begin to remove the ability to allocate out of NULL pools. The first problem to solve, is that we need an apr_lock in order to allocate pools, so that we can lock things out when allocating. So, how do we allocate locks without a pool to allocate from? The answer is to create a global_apr_pool, which is a bootstrapping pool. There should NEVER be a sub-pool off this pool, and it is static to an APR file. This is only used to allow us to allocate the locks cleanly, without using the NULL pool hack. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60997 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 9 +++++++++ include/apr_pools.h | 10 ++++++++-- lib/apr_pools.c | 39 ++++++++++++++++++++++++++------------- memory/unix/apr_pools.c | 39 ++++++++++++++++++++++++++------------- misc/unix/start.c | 10 +++++++--- 5 files changed, 76 insertions(+), 31 deletions(-) diff --git a/CHANGES b/CHANGES index f9ece7f3b14..c07a459babd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,14 @@ Changes with APR b1 + *) Begin to remove the ability to allocate out of NULL pools. The first + problem to solve, is that we need an apr_lock in order to allocate + pools, so that we can lock things out when allocating. So, how do we + allocate locks without a pool to allocate from? The answer is to create + a global_apr_pool, which is a bootstrapping pool. There should NEVER + be a sub-pool off this pool, and it is static to an APR file. This is + only used to allow us to allocate the locks cleanly, without using the + NULL pool hack. [Ryan Bloom] + *) Fix a logic error in the poll code when implemented using select. [Nick Caruso <ncaruso@gamesville.com>] diff --git a/include/apr_pools.h b/include/apr_pools.h index 09a3f2db47a..3553305d3b7 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -209,17 +209,23 @@ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); /** * Setup all of the internal structures required to use pools + * @parm globalp The apr global pool, used to allocate APR structures + * before any other pools are created. This pool should not + * ever be used outside of APR. * @tip Programs do NOT need to call this directly. APR will call this * automatically from apr_initialize. */ -apr_status_t apr_init_alloc(void); /* Set up everything */ +apr_status_t apr_init_alloc(apr_pool_t *globalp); /* Set up everything */ /** * Tear down all of the internal structures required to use pools + * @parm globalp The apr global pool, used to allocate APR structures + * before any other pools are created. This pool should not + * ever be used outside of APR. * @tip Programs do NOT need to call this directly. APR will call this * automatically from apr_terminate. */ -void apr_term_alloc(void); /* Tear down everything */ +void apr_term_alloc(apr_pool_t *globalp); /* Tear down everything */ /* pool functions */ diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 5b2889fe786..867842d6a69 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -469,7 +469,9 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int #if APR_HAS_THREADS - apr_lock(alloc_mutex); + if (alloc_mutex) { + apr_lock(alloc_mutex); + } #endif blok = new_block(POOL_HDR_BYTES, apr_abort); @@ -496,7 +498,9 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int } #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + if (alloc_mutex) { + apr_unlock(alloc_mutex); + } #endif return new_pool; @@ -662,7 +666,7 @@ APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data) return APR_SUCCESS; } -apr_status_t apr_init_alloc(void) +apr_status_t apr_init_alloc(apr_pool_t *globalp) { #if APR_HAS_THREADS apr_status_t status; @@ -675,13 +679,13 @@ apr_status_t apr_init_alloc(void) #endif #if APR_HAS_THREADS status = apr_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, - NULL, NULL); + NULL, globalp); if (status != APR_SUCCESS) { apr_destroy_lock(alloc_mutex); return status; } status = apr_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, - NULL, NULL); + NULL, globalp); if (status != APR_SUCCESS) { apr_destroy_lock(spawn_mutex); return status; @@ -695,12 +699,13 @@ apr_status_t apr_init_alloc(void) return APR_SUCCESS; } -void apr_term_alloc(void) +void apr_term_alloc(apr_pool_t *globalp) { #if APR_HAS_THREADS apr_destroy_lock(alloc_mutex); apr_destroy_lock(spawn_mutex); #endif + apr_destroy_pool(globalp); } /* We only want to lock the mutex if we are being called from apr_clear_pool. @@ -748,7 +753,9 @@ APR_DECLARE(void) apr_destroy_pool(apr_pool_t *a) { apr_clear_pool(a); #if APR_HAS_THREADS - apr_lock(alloc_mutex); + if (alloc_mutex) { + apr_lock(alloc_mutex); + } #endif if (a->parent) { @@ -763,7 +770,9 @@ APR_DECLARE(void) apr_destroy_pool(apr_pool_t *a) } } #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + if (alloc_mutex) { + apr_unlock(alloc_mutex); + } #endif free_blocks(a->first); } @@ -928,15 +937,15 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) char *first_avail; char *new_first_avail; + nclicks = 1 + ((reqsize - 1) / CLICK_SZ); + size = nclicks * CLICK_SZ; + if (a == NULL) { return malloc(reqsize); } - nclicks = 1 + ((reqsize - 1) / CLICK_SZ); - size = nclicks * CLICK_SZ; - /* First, see if we have space in the block most recently * allocated to this pool */ @@ -961,7 +970,9 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) /* Nope --- get a new one that's guaranteed to be big enough */ #if APR_HAS_THREADS - apr_lock(alloc_mutex); + if (alloc_mutex) { + apr_lock(alloc_mutex); + } #endif blok = new_block(size, a->apr_abort); @@ -972,7 +983,9 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) #endif #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + if (alloc_mutex) { + apr_unlock(alloc_mutex); + } #endif first_avail = blok->h.first_avail; diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 5b2889fe786..867842d6a69 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -469,7 +469,9 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int #if APR_HAS_THREADS - apr_lock(alloc_mutex); + if (alloc_mutex) { + apr_lock(alloc_mutex); + } #endif blok = new_block(POOL_HDR_BYTES, apr_abort); @@ -496,7 +498,9 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int } #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + if (alloc_mutex) { + apr_unlock(alloc_mutex); + } #endif return new_pool; @@ -662,7 +666,7 @@ APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data) return APR_SUCCESS; } -apr_status_t apr_init_alloc(void) +apr_status_t apr_init_alloc(apr_pool_t *globalp) { #if APR_HAS_THREADS apr_status_t status; @@ -675,13 +679,13 @@ apr_status_t apr_init_alloc(void) #endif #if APR_HAS_THREADS status = apr_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, - NULL, NULL); + NULL, globalp); if (status != APR_SUCCESS) { apr_destroy_lock(alloc_mutex); return status; } status = apr_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, - NULL, NULL); + NULL, globalp); if (status != APR_SUCCESS) { apr_destroy_lock(spawn_mutex); return status; @@ -695,12 +699,13 @@ apr_status_t apr_init_alloc(void) return APR_SUCCESS; } -void apr_term_alloc(void) +void apr_term_alloc(apr_pool_t *globalp) { #if APR_HAS_THREADS apr_destroy_lock(alloc_mutex); apr_destroy_lock(spawn_mutex); #endif + apr_destroy_pool(globalp); } /* We only want to lock the mutex if we are being called from apr_clear_pool. @@ -748,7 +753,9 @@ APR_DECLARE(void) apr_destroy_pool(apr_pool_t *a) { apr_clear_pool(a); #if APR_HAS_THREADS - apr_lock(alloc_mutex); + if (alloc_mutex) { + apr_lock(alloc_mutex); + } #endif if (a->parent) { @@ -763,7 +770,9 @@ APR_DECLARE(void) apr_destroy_pool(apr_pool_t *a) } } #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + if (alloc_mutex) { + apr_unlock(alloc_mutex); + } #endif free_blocks(a->first); } @@ -928,15 +937,15 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) char *first_avail; char *new_first_avail; + nclicks = 1 + ((reqsize - 1) / CLICK_SZ); + size = nclicks * CLICK_SZ; + if (a == NULL) { return malloc(reqsize); } - nclicks = 1 + ((reqsize - 1) / CLICK_SZ); - size = nclicks * CLICK_SZ; - /* First, see if we have space in the block most recently * allocated to this pool */ @@ -961,7 +970,9 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) /* Nope --- get a new one that's guaranteed to be big enough */ #if APR_HAS_THREADS - apr_lock(alloc_mutex); + if (alloc_mutex) { + apr_lock(alloc_mutex); + } #endif blok = new_block(size, a->apr_abort); @@ -972,7 +983,9 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) #endif #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + if (alloc_mutex) { + apr_unlock(alloc_mutex); + } #endif first_avail = blok->h.first_avail; diff --git a/misc/unix/start.c b/misc/unix/start.c index 04371d6e1f1..0cd81cd8743 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -61,7 +61,7 @@ static int initialized = 0; - +static apr_pool_t *global_apr_pool; apr_status_t apr_initialize(void) { @@ -76,6 +76,10 @@ apr_status_t apr_initialize(void) return APR_SUCCESS; } + if (apr_create_pool(&global_apr_pool, NULL) != APR_SUCCESS) { + return APR_ENOPOOL; + } + #if !defined(BEOS) && !defined(OS2) && !defined(WIN32) apr_unix_setup_lock(); #elif defined WIN32 @@ -90,7 +94,7 @@ apr_status_t apr_initialize(void) return APR_EEXIST; } #endif - status = apr_init_alloc(); + status = apr_init_alloc(global_apr_pool); return status; } @@ -100,7 +104,7 @@ void apr_terminate(void) if (initialized) { return; } - apr_term_alloc(); + apr_term_alloc(global_apr_pool); } apr_status_t apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont) From f9e83d931c5a376341c1f44f848c5fb05e56dc2f Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sun, 31 Dec 2000 18:48:03 +0000 Subject: [PATCH 1017/7878] Various bits of tidying up mainly for locking, but a few thread bits as well. Submitted by: Carlos Hasan <chasan@acm.org> Reviewed by: David Reid <dreid@apache.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60998 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/locks.h | 4 +--- locks/beos/crossproc.c | 19 +++++++++---------- locks/beos/intraproc.c | 18 +++++------------- locks/beos/locks.c | 1 - threadproc/beos/thread.c | 7 ------- 5 files changed, 15 insertions(+), 34 deletions(-) diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h index 685f8a89b83..fd8557f1396 100644 --- a/include/arch/beos/locks.h +++ b/include/arch/beos/locks.h @@ -65,9 +65,7 @@ struct apr_lock_t { apr_pool_t *cntxt; apr_locktype_e type; apr_lockscope_e scope; - int curr_locked; - char *fname; - /* Inter proc */ + /* Inter proc */ sem_id sem_interproc; int32 ben_interproc; /* Intra Proc */ diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c index 02e9bd76e5c..b17aa28f375 100644 --- a/locks/beos/crossproc.c +++ b/locks/beos/crossproc.c @@ -57,8 +57,13 @@ apr_status_t lock_inter_cleanup(void * data) { apr_lock_t *lock = (apr_lock_t*)data; - if (lock->curr_locked == 1) { - if (atomic_add(&lock->ben_interproc , -1) > 1){ + if (lock->ben_interproc != 0) { + /* we're still locked... */ + while (atomic_add(&lock->ben_interproc , -1) > 1){ + /* OK we had more than one person waiting on the lock so + * the sem is also locked. Release it until we have no more + * locks left. + */ release_sem (lock->sem_interproc); } } @@ -70,15 +75,11 @@ apr_status_t create_inter_lock(apr_lock_t *new) { int32 stat; - new->sem_interproc = (sem_id)apr_palloc(new->cntxt, sizeof(sem_id)); - new->ben_interproc = (int32)apr_palloc(new->cntxt, sizeof(int32)); - if ((stat = create_sem(0, "apr_interproc")) < B_NO_ERROR) { lock_inter_cleanup(new); return stat; } new->ben_interproc = 0; - new->curr_locked = 0; new->sem_interproc = stat; apr_register_cleanup(new->cntxt, (void *)new, lock_inter_cleanup, apr_null_cleanup); @@ -90,12 +91,11 @@ apr_status_t lock_inter(apr_lock_t *lock) int32 stat; if (atomic_add(&lock->ben_interproc, 1) > 0){ - if ((stat = acquire_sem(lock->sem_interproc)) != B_NO_ERROR){ + if ((stat = acquire_sem(lock->sem_interproc)) < B_NO_ERROR){ atomic_add(&lock->ben_interproc, -1); return stat; } } - lock->curr_locked = 1; return APR_SUCCESS; } @@ -104,12 +104,11 @@ apr_status_t unlock_inter(apr_lock_t *lock) int32 stat; if (atomic_add(&lock->ben_interproc, -1) > 1){ - if ((stat = release_sem(lock->sem_interproc)) != B_NO_ERROR) { + if ((stat = release_sem(lock->sem_interproc)) < B_NO_ERROR) { atomic_add(&lock->ben_interproc, 1); return stat; } } - lock->curr_locked = 0; return APR_SUCCESS; } diff --git a/locks/beos/intraproc.c b/locks/beos/intraproc.c index 10537de08e8..65cb5a3e57f 100644 --- a/locks/beos/intraproc.c +++ b/locks/beos/intraproc.c @@ -57,11 +57,9 @@ apr_status_t lock_intra_cleanup(void *data) { apr_lock_t *lock = (apr_lock_t *)data; - if (lock->curr_locked == 1) { - if (atomic_add(&lock->ben_intraproc , -1) > 1){ + if (lock->ben_intraproc != 0) { + while (atomic_add(&lock->ben_intraproc , -1) > 1){ release_sem (lock->sem_intraproc); - } else { - return errno; } } delete_sem(lock->sem_intraproc); @@ -70,10 +68,7 @@ apr_status_t lock_intra_cleanup(void *data) apr_status_t create_intra_lock(apr_lock_t *new) { - int32 stat; - new->sem_intraproc = (sem_id)apr_palloc(new->cntxt, sizeof(sem_id)); - new->ben_intraproc = (int32)apr_palloc(new->cntxt, sizeof(int32)); - + int32 stat; if ((stat = create_sem(0, "apr_intraproc")) < B_NO_ERROR){ lock_intra_cleanup(new); @@ -81,7 +76,6 @@ apr_status_t create_intra_lock(apr_lock_t *new) } new->ben_intraproc = 0; new->sem_intraproc = stat; - new->curr_locked = 0; apr_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, apr_null_cleanup); return APR_SUCCESS; @@ -92,12 +86,11 @@ apr_status_t lock_intra(apr_lock_t *lock) int32 stat; if (atomic_add (&lock->ben_intraproc, 1) > 0){ - if ((stat = acquire_sem(lock->sem_intraproc)) != B_NO_ERROR){ + if ((stat = acquire_sem(lock->sem_intraproc)) < B_NO_ERROR){ atomic_add(&lock->ben_intraproc,-1); return stat; } } - lock->curr_locked = 1; return APR_SUCCESS; } @@ -106,12 +99,11 @@ apr_status_t unlock_intra(apr_lock_t *lock) int32 stat; if (atomic_add(&lock->ben_intraproc, -1) > 1){ - if ((stat = release_sem(lock->sem_intraproc)) != B_NO_ERROR) { + if ((stat = release_sem(lock->sem_intraproc)) < B_NO_ERROR) { atomic_add(&lock->ben_intraproc, 1); return stat; } } - lock->curr_locked = 0; return APR_SUCCESS; } diff --git a/locks/beos/locks.c b/locks/beos/locks.c index 81820113626..5302a1b59d5 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -71,7 +71,6 @@ apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, new->cntxt = cont; new->type = type; new->scope = scope; - new->fname = apr_pstrdup(cont, fname); if (scope != APR_CROSS_PROCESS) { if ((stat = create_intra_lock(new)) != APR_SUCCESS) { diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 1dc7210f2ab..d141d835e57 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -58,8 +58,6 @@ apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) { (*new) = (apr_threadattr_t *)apr_palloc(cont, sizeof(apr_threadattr_t)); - (*new)->attr = (int32)apr_palloc(cont, - sizeof(int32)); if ((*new) == NULL) { return APR_ENOMEM; @@ -101,11 +99,6 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, return APR_ENOMEM; } - (*new)->td = (thread_id) apr_palloc(cont, sizeof(thread_id)); - if ((*new)->td == (thread_id)NULL) { - return APR_ENOMEM; - } - (*new)->cntxt = cont; /* First we create the new thread...*/ From 9ddb48e26a63dda42f0d36f695d41ccaf2fb7632 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 1 Jan 2001 00:09:18 +0000 Subject: [PATCH 1018/7878] Whenever we allocate a structure from a pool, we should set it's pool pointer. If we don't, then we take the chance of trying to allocate out of a NULL pool later. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60999 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 13c721be8c4..2073fa18ec2 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -108,8 +108,10 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->cntxt = p; (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, sizeof(apr_sockaddr_t)); + (*new)->local_addr->pool = p; (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, sizeof(apr_sockaddr_t)); + (*new)->remote_addr->pool = p; } apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, From 108f2ea5b645be49fd64c7361a7ec67c9c4545ed Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 2 Jan 2001 01:12:17 +0000 Subject: [PATCH 1019/7878] It is possible that we will not write everything from the headers in the first attempt when using Sendfile. It doesn't matter if we have a timeout or not, if we write some data, but not all, we have to return from apr_sendfile, and let the application figure out how to proceed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61000 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index d4ba2a4dd28..d1fc0dcb7e3 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -267,7 +267,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (hdtr->numheaders > 0) { apr_int32_t hdrbytes; - + /* cork before writing headers */ rv = os_cork(sock); if (rv < 0) { @@ -288,15 +288,13 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, * return now with the partial byte count; this is a non-blocking * socket. */ - if (sock->timeout <= 0) { - total_hdrbytes = 0; - for (i = 0; i < hdtr->numheaders; i++) { - total_hdrbytes += hdtr->headers[i].iov_len; - } - if (hdrbytes < total_hdrbytes) { - *len = hdrbytes; - return os_uncork(sock, delayflag); - } + total_hdrbytes = 0; + for (i = 0; i < hdtr->numheaders; i++) { + total_hdrbytes += hdtr->headers[i].iov_len; + } + if (hdrbytes < total_hdrbytes) { + *len = hdrbytes; + return os_uncork(sock, delayflag); } } From adbe1e9730768b182aea27f9519c7a373c9987fd Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 2 Jan 2001 01:19:07 +0000 Subject: [PATCH 1020/7878] Add an APR_GET_POOL macro to get a pool from any APR type that has a pool. This requires that ALL apr types put the pool as the first field in their structure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61001 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_general.h | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGES b/CHANGES index c07a459babd..2368bfe4f2f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Add an APR_GET_POOL macro to get a pool from any APR type that has + a pool. This requires that ALL apr types put the pool as the first + field in their structure. [Ryan Bloom] + *) Begin to remove the ability to allocate out of NULL pools. The first problem to solve, is that we need an apr_lock in order to allocate pools, so that we can lock things out when allocating. So, how do we diff --git a/include/apr_general.h b/include/apr_general.h index ca56a38defb..4eebdef613f 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -210,6 +210,17 @@ typedef int apr_signum_t; #define XtOffsetOf(s_type,field) XtOffset(s_type*,field) #endif +/* This is a general apr type that should only ever be used in the APR_GET_POOL + * macro. This is basically used to let us get the pool from any apr type + * that has one. + */ +struct apr_t { + apr_pool_t *pool; +}; + +#define APR_GET_POOL(foo) \ + ((struct apr_t *)foo)->pool + /* A couple of prototypes for functions in case some platform doesn't * have it */ From 3fbcbfcedaf3261fb2629bc8f58b369708aa9466 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 2 Jan 2001 01:33:05 +0000 Subject: [PATCH 1021/7878] Remove the ability to allocate out of a NULL pool. This was always a bad idea, because it opened up memory leaks. It is very likely that this will expose some seg faults and some memory leaks, but I have tried to find and fix most of the already. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61002 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ lib/apr_pools.c | 6 ------ memory/unix/apr_pools.c | 6 ------ 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 2368bfe4f2f..c28bcc21f73 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Remove the ability to allocate memory out of a NULL pool. + [Ryan Bloom] + *) Add an APR_GET_POOL macro to get a pool from any APR type that has a pool. This requires that ALL apr types put the pool as the first field in their structure. [Ryan Bloom] diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 867842d6a69..4bc5977b753 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -940,12 +940,6 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) nclicks = 1 + ((reqsize - 1) / CLICK_SZ); size = nclicks * CLICK_SZ; - - if (a == NULL) { - return malloc(reqsize); - } - - /* First, see if we have space in the block most recently * allocated to this pool */ diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 867842d6a69..4bc5977b753 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -940,12 +940,6 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) nclicks = 1 + ((reqsize - 1) / CLICK_SZ); size = nclicks * CLICK_SZ; - - if (a == NULL) { - return malloc(reqsize); - } - - /* First, see if we have space in the block most recently * allocated to this pool */ From 3d1c968e1524141d54572237a0b3c94cc60bf570 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Tue, 2 Jan 2001 01:38:23 +0000 Subject: [PATCH 1022/7878] Remove some old files that we no longer use. Should have been done a while back really. Spring cleaning time again! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61003 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/sockaddr.c | 78 ------------- network_io/beos/sockets.c | 228 ------------------------------------- network_io/beos/sockopt.c | 184 ------------------------------ 3 files changed, 490 deletions(-) delete mode 100644 network_io/beos/sockaddr.c delete mode 100644 network_io/beos/sockets.c delete mode 100644 network_io/beos/sockopt.c diff --git a/network_io/beos/sockaddr.c b/network_io/beos/sockaddr.c deleted file mode 100644 index bd61f574aa3..00000000000 --- a/network_io/beos/sockaddr.c +++ /dev/null @@ -1,78 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "apr_private.h" -#if BEOS_BONE /* BONE uses the unix code - woohoo */ -#include "../unix/sockaddr.c" -#else -#include "networkio.h" - -static apr_status_t get_local_addr(apr_socket_t *sock) -{ - apr_socklen_t namelen = sizeof(*sock->local_addr); - - if (getsockname(sock->socketdes, (struct sockaddr *)sock->local_addr, - &namelen) < 0) { - return errno; - } - else { - sock->local_port_unknown = sock->local_interface_unknown = 0; - return APR_SUCCESS; - } -} - -/* Include this here so we already have get_local_addr... */ -#include "../unix/sa_common.c" - -#endif diff --git a/network_io/beos/sockets.c b/network_io/beos/sockets.c deleted file mode 100644 index a168e7a3926..00000000000 --- a/network_io/beos/sockets.c +++ /dev/null @@ -1,228 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "apr_private.h" -#if BEOS_BONE /* BONE uses the unix code - woohoo */ -#include "../unix/sockets.c" -#else -#include "networkio.h" - -apr_status_t socket_cleanup(void *sock) -{ - apr_socket_t *thesocket = sock; - if (closesocket(thesocket->socketdes) == 0) { - thesocket->socketdes = -1; - return APR_SUCCESS; - } - else { - return errno; - } -} - -apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) -{ - (*new) = (apr_socket_t *)apr_palloc(cont,sizeof(apr_socket_t)); - - if ((*new) == NULL){ - return APR_ENOMEM; - } - - (*new)->cntxt = cont; - (*new)->local_addr = (struct sockaddr_in *) apr_palloc((*new)->cntxt, - sizeof (struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *) apr_palloc((*new)->cntxt, - sizeof (struct sockaddr_in)); - if ((*new)->local_addr == NULL || (*new)->remote_addr==NULL){ - return APR_ENOMEM; - } - - (*new)->socketdes = socket(AF_INET ,SOCK_STREAM, 0); - (*new)->local_addr->sin_family = AF_INET; - (*new)->remote_addr->sin_family = AF_INET; - (*new)->addr_len = sizeof(*(*new)->local_addr); - memset(&(*new)->local_addr->sin_zero, 0, sizeof((*new)->local_addr->sin_zero)); - memset(&(*new)->remote_addr->sin_zero, 0, sizeof((*new)->remote_addr->sin_zero)); - - if ((*new)->socketdes < 0) { - return errno; - } - - (*new)->timeout = -1; - apr_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_null_cleanup); - return APR_SUCCESS; -} - -apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) -{ - return shutdown(thesocket->socketdes, how); -} - -apr_status_t apr_close_socket(apr_socket_t *thesocket) -{ - apr_kill_cleanup(thesocket->cntxt,thesocket,socket_cleanup); - return socket_cleanup(thesocket); -} - -apr_status_t apr_bind(apr_socket_t *sock) -{ - if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) - return errno; - else - return APR_SUCCESS; -} - -apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) -{ - if (listen(sock->socketdes, backlog) == -1) - return errno; - else - return APR_SUCCESS; -} - -apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) -{ - (*new) = (apr_socket_t *)apr_palloc(connection_context, - sizeof(apr_socket_t)); - - (*new)->cntxt = connection_context; - (*new)->local_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, - sizeof(struct sockaddr_in)); - - (*new)->remote_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, - sizeof(struct sockaddr_in)); - (*new)->addr_len = sizeof(struct sockaddr_in); - (*new)->connected = 1; - - (*new)->socketdes = accept(sock->socketdes, (struct sockaddr *)(*new)->remote_addr, - &(*new)->addr_len); - - if (getsockname((*new)->socketdes, (struct sockaddr *)(*new)->local_addr, - &((*new)->addr_len)) < 0) { - return errno; - } - if ((*new)->socketdes <0){ - return errno; - } - - apr_register_cleanup((*new)->cntxt, (void *)new, - socket_cleanup, apr_null_cleanup); - return APR_SUCCESS; -} - -apr_status_t apr_connect(apr_socket_t *sock, const char *hostname) -{ - struct hostent *hp; - - if ((sock->socketdes < 0) || (!sock->remote_addr)) { - return APR_ENOTSOCK; - } - - if (hostname != NULL){ - hp = gethostbyname(hostname); - if (!hp) - return (h_errno + APR_OS_START_SYSERR); - - memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr , hp->h_length); - } - - sock->remote_addr->sin_family = AF_INET; - - memset(sock->remote_addr->sin_zero, 0, sizeof(sock->remote_addr->sin_zero)); - - sock->addr_len = sizeof(sock->remote_addr); - - if ((connect(sock->socketdes, (const struct sockaddr *)sock->remote_addr, sock->addr_len) < 0) - && (errno != EINPROGRESS)) { - return errno; - } else { - int namelen = sizeof(*sock->local_addr); - getsockname(sock->socketdes, (struct sockaddr *)sock->local_addr, &namelen); - sock->connected = 1; - } - - return APR_SUCCESS; -} - -apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock) -{ - return apr_get_userdata(data, key, sock->cntxt); -} - -apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, - apr_status_t (*cleanup) (void *)) -{ - return apr_set_userdata(data, key, cleanup, sock->cntxt); -} - -apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) -{ - *thesock = sock->socketdes; - return APR_SUCCESS; -} - -apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, - apr_pool_t *cont) -{ - if (cont == NULL) { - return APR_ENOPOOL; - } - if ((*sock) == NULL) { - (*sock) = (apr_socket_t *)apr_palloc(cont, sizeof(apr_socket_t)); - (*sock)->cntxt = cont; - } - (*sock)->socketdes = *thesock; - return APR_SUCCESS; -} -#endif /* BEOS_BONE */ diff --git a/network_io/beos/sockopt.c b/network_io/beos/sockopt.c deleted file mode 100644 index fe3086fd2e3..00000000000 --- a/network_io/beos/sockopt.c +++ /dev/null @@ -1,184 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "apr_private.h" -#if BEOS_BONE /* BONE uses the unix code - woohoo */ -#include "../unix/sockopt.c" -#else -#include "networkio.h" - -static int setnonblocking(int on, int sock) -{ - return setsockopt(sock, SOL_SOCKET, SO_NONBLOCK, - &on, sizeof(on)); -} - -apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) -{ - int one; - int rv; - if (on){ - one = 1; - }else { - one = 0; - } - if (opt & APR_SO_SNDBUF) - return APR_ENOTIMPL; - - if (opt & APR_SO_DEBUG) { - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, &one, sizeof(one)) == -1) { - return errno; - } - } - if (opt & APR_SO_REUSEADDR) { - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) == -1) { - return errno; - } - } - if (opt & APR_SO_NONBLOCK) { - if ((rv = setnonblocking (one, sock->socketdes)) < 0) { - return errno; - } - } - if (opt & APR_SO_TIMEOUT) { - if (on > 0 && sock->timeout < 0) - /* we should be in non-blocking mode right now... */ - one = 1; - else if (on < 0 && sock->timeout >= 0) - /* they've set a timeout so we should be blocking... */ - one = 0; - else if (on == 0) - /* we need to be in nonblocking or this will hang the server */ - one = 1; - - if ((rv = setnonblocking (one, sock->socketdes)) < 0) - return rv; - - sock->timeout = on; - } - if (opt & APR_TCP_NODELAY) { - /* BeOS pre-BONE has TCP_NODELAY set to ON by default. - * This is a hang over from a long time ago and until BONE there - * is no way to turn it off. Use this information as follows... - * - * on == 0 - return APR_ENOTIMPL - * on == 1 - allow it to return APR_SUCCESS - * - * based on information from Howard Berkey (howard@be.com) - */ - if (! on) - return APR_ENOTIMPL; - } - return APR_SUCCESS; -} - -apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) -{ - switch(opt) { - case APR_SO_TIMEOUT: - *on = sock->timeout; - break; - default: - return APR_EINVAL; - } - return APR_SUCCESS; -} - -apr_status_t apr_gethostname(char * buf, int len, apr_pool_t *cont) -{ - if (gethostname(buf, len) == -1){ - return errno; - } else { - return APR_SUCCESS; - } -} - -apr_status_t apr_get_local_hostname(char **name, apr_socket_t *sock) -{ - struct hostent *hptr; - - hptr = gethostbyaddr((char *)&(sock->local_addr->sin_addr), - sizeof(struct in_addr), AF_INET); - if (hptr != NULL) { - *name = apr_pstrdup(sock->cntxt, hptr->h_name); - if (*name) { - return APR_SUCCESS; - } - return APR_ENOMEM; - } - - /* XXX - Is this threadsafe? - manoj */ - /* on BeOS h_errno is a global... */ - return h_errno; -} - -apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) -{ - struct hostent *hptr; - - hptr = gethostbyaddr((char *)&(sock->remote_addr->sin_addr), - sizeof(struct in_addr), AF_INET); - if (hptr != NULL) { - *name = apr_pstrdup(sock->cntxt, hptr->h_name); - if (*name) { - return APR_SUCCESS; - } - return APR_ENOMEM; - } - - /* XXX - Is this threadsafe? - manoj */ - /* on BeOS h_errno is a global... */ - return h_errno; -} -#endif From d38d38945599accaa0436f798c7dbcb320cc9f94 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 2 Jan 2001 01:48:02 +0000 Subject: [PATCH 1023/7878] Begin to update APRDesign git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61004 13f79535-47bb-0310-9956-ffa450edef68 --- APRDesign | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/APRDesign b/APRDesign index 8334732f56d..70472d2f508 100644 --- a/APRDesign +++ b/APRDesign @@ -128,7 +128,7 @@ Those structures are then typedef'ed in an external header file. For example in file_io/unix/fileio.h: struct ap_file_t { - ap_context_t *cntxt; + apr_pool_t *cntxt; int filedes; FILE *filehand; ... @@ -145,8 +145,13 @@ The only exception to the incomplete type rule can be found in apr_portable.h. This file defines the native types for each platform. Using these types, it is possible to extract native types for any APR type. -You may notice the ap_context_t field. All APR types have this field. This -type is used to allocate memory within APR. +You may notice the apr_pool_t field. Most APR types have this field. This +type is used to allocate memory within APR. Any APR type that has this +field should place this field first. If it is important to retrieve the +pool from an APR variable, it is possible to use the macro APR_GET_POOL to +accomplish this. This macro will only work on types that actually have +a pool in them as the first field. On any other type, this Macro will cause +a seg fault as soon as the pool is used. New Function From 8511fe2f5d04d2ae87c0dbf9f78f748b54a18a62 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Tue, 2 Jan 2001 02:20:18 +0000 Subject: [PATCH 1024/7878] Allow the tests that use shared objects to run on BeOS. This is intended only as a stop gap until we libtool APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61005 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +++ test/Makefile.in | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 71c8d26bda2..8cae9c746c5 100644 --- a/configure.in +++ b/configure.in @@ -47,6 +47,7 @@ AC_PROG_MAKE_SET AC_PROG_AWK AC_CHECK_PROG(RM, rm, rm) AC_CHECK_TOOL(AR, ar, ar) +SO_LDFLAG="-shared" # This macro needs to be here in case we are on an AIX box. AC_AIX @@ -105,6 +106,7 @@ case "$OS" in USE_MM=yes AC_CHECK_DEFINE(BONE_VERSION, sys/socket.h) eolstr="\\n" + SO_LDFLAG="-nostart" ;; *os390) OSDIR="os390" @@ -121,6 +123,7 @@ case "$OS" in esac AC_SUBST(eolstr) +AC_SUBST(SO_LDFLAG) dnl #----------------------------- Checking for Shared Memory Support echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" diff --git a/test/Makefile.in b/test/Makefile.in index a2ab05614c2..7e4a52b3582 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -7,6 +7,7 @@ LDFLAGS=@LDFLAGS@ $(LIBS) INCDIR=../include INCLUDES=-I$(INCDIR) MKDEP=../helpers/mkdep.sh +SO_LDFLAG=@SO_LDFLAG@ TARGETS= client@EXEEXT@ \ sendfile@EXEEXT@ \ @@ -61,10 +62,10 @@ testoc@EXEEXT@: testoc.o $(CC) $(CFLAGS) -o testoc@EXEEXT@ testoc.o $(LDFLAGS) occhild.so: occhild.o - $(CC) -shared occhild.o -o occhild.so + $(CC) $(SO_LDFLAG) occhild.o -o occhild.so mod_test.so: mod_test.o - $(CC) -shared mod_test.o -o mod_test.so + $(CC) $(SO_LDFLAG) mod_test.o -o mod_test.so testargs@EXEEXT@: testargs.o $(CC) $(CFLAGS) -o testargs@EXEEXT@ testargs.o $(LDFLAGS) From 685d621154548144a932c7eb38eeb1bccba59e87 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Tue, 2 Jan 2001 07:13:54 +0000 Subject: [PATCH 1025/7878] "What's the difference between a jailer and a jeweller? One sells watches and one watches cells!" -- Goku to King Kai git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61006 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 03f7401b186..3cebb766c0c 100644 --- a/STATUS +++ b/STATUS @@ -1,8 +1,9 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2000/12/18 00:30:21 $] +Last modified at [$Date: 2001/01/02 07:13:54 $] Release: + 2.0a9 : released ... 2.0a8 : released November 20, 2000 2.0a7 : released October 8, 2000 2.0a6 : released August 18, 2000 @@ -18,6 +19,9 @@ RELEASE SHOWSTOPPERS: has been some discussion about adding a src/ directory to apr or removing it from apr-util/. Either way, this needs to be decided. + * Replace APR_GET_POOL macro with a typesafe mechanism to get the pool + from an APR (incomplete) type. + RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * SysV semaphore support isn't usable by Apache when started as From cd1ff28977fe74c2873ce34e7517bc90c406afdf Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Tue, 2 Jan 2001 11:08:04 +0000 Subject: [PATCH 1026/7878] what the hell? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61007 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/mmap.c | 170 --------------------------------------- 1 file changed, 170 deletions(-) delete mode 100644 include/arch/unix/mmap.c diff --git a/include/arch/unix/mmap.c b/include/arch/unix/mmap.c deleted file mode 100644 index 199b6fc74ed..00000000000 --- a/include/arch/unix/mmap.c +++ /dev/null @@ -1,170 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_mmap.h" -#include "apr_errno.h" -#include "../../file_io/unix/fileio.h" -#include "apr_portable.h" - -/* System headers required for the mmap library */ -#ifdef BEOS -#include <kernel/OS.h> -#endif -#if HAVE_STRING_H -#include <string.h> -#endif -#if APR_HAVE_STDIO_H -#include <stdio.h> -#endif -#if HAVE_SYS_STAT_H -#include <sys/stat.h> -#endif -#if HAVE_SYS_MMAN_H -#include <sys/mman.h> -#endif - -#if APR_HAS_MMAP || defined(BEOS) - -static apr_status_t mmap_cleanup(void *themmap) -{ - apr_mmap_t *mm = themmap; - int rv; -#ifdef BEOS - rv = delete_area(mm->area); - - if (rv == 0) { - mm->mm = (caddr_t)-1; - return APR_SUCCESS; - } -#else - rv = munmap(mm->mm, mm->size); - - if (rv == 0) { - mm->mm = (caddr_t)-1; - return APR_SUCCESS; - } -#endif - return errno; -} - -apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, apr_off_t offset, - apr_size_t size, apr_pool_t *cont) -{ -#ifdef BEOS - void *mm; - area_id aid = -1; - char *areaname = "apr_mmap\0"; - uint32 pages = 0; -#else - caddr_t mm; -#endif - - if (file == NULL || file->filedes == -1 || file->buffered) - return APR_EBADF; - (*new) = (apr_mmap_t *)apr_pcalloc(cont, sizeof(apr_mmap_t)); - -#ifdef BEOS - /* XXX: mmap shouldn't really change the seek offset */ - apr_seek(file, APR_SET, &offset); - pages = ((size -1) / B_PAGE_SIZE) + 1; - - aid = create_area(areaname, &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, - B_FULL_LOCK, B_READ_AREA|B_WRITE_AREA); - - if (aid < B_NO_ERROR) { - /* we failed to get an mmap'd file... */ - return APR_ENOMEM; - } - - if (aid >= B_NO_ERROR) - read(file->filedes, mm, size); - (*new)->area = aid; -#else - - mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes, offset); - - if (mm == (caddr_t)-1) { - /* we failed to get an mmap'd file... */ - return APR_ENOMEM; - } -#endif - - (*new)->mm = mm; - (*new)->size = size; - (*new)->cntxt = cont; - - /* register the cleanup... */ - apr_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, - apr_null_cleanup); - return APR_SUCCESS; -} - -apr_status_t apr_mmap_delete(apr_mmap_t *mmap) -{ - apr_status_t rv; - - if (mmap->mm == (caddr_t) -1) - return APR_ENOENT; - - if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { - apr_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); - return APR_SUCCESS; - } - return rv; -} - -#endif From 721300cc1715848ef4bddccfaf4818ca6e5eb01a Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Tue, 2 Jan 2001 11:37:53 +0000 Subject: [PATCH 1027/7878] fix a couple more whacked paths git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61008 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/crossproc.c | 2 +- locks/unix/intraproc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index e9cccc2f88c..f140183e156 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -54,7 +54,7 @@ #include "apr.h" #include "apr_strings.h" -#include "unix/locks.h" +#include "locks.h" #if APR_USE_SYSVSEM_SERIALIZE diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index 64b0c5f5fb2..514d6a83e10 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -#include "unix/locks.h" +#include "locks.h" #if APR_HAS_THREADS From 45df8648d73a9cbe34ba8dcd51ce29cb05277a41 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Wed, 3 Jan 2001 00:53:05 +0000 Subject: [PATCH 1028/7878] We should not be assigning permanent_pool inside of make_sub_pool. This runs the risk of overwriting permanent_pool, which would be VERY bad. By moving this back to apr_init_alloc, we know that it should only be called by apr_initialize. This does mean that we can NEVER call apr_initialize twice in the same program, but that should already be taken care of. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61009 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_pools.c | 4 +--- memory/unix/apr_pools.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 4bc5977b753..0e5bdaeb991 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -493,9 +493,6 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int } p->sub_pools = new_pool; } - else { - permanent_pool = new_pool; - } #if APR_HAS_THREADS if (alloc_mutex) { @@ -691,6 +688,7 @@ apr_status_t apr_init_alloc(apr_pool_t *globalp) return status; } #endif + permanent_pool = apr_make_sub_pool(pglobal); #ifdef ALLOC_STATS atexit(dump_stats); diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 4bc5977b753..0e5bdaeb991 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -493,9 +493,6 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int } p->sub_pools = new_pool; } - else { - permanent_pool = new_pool; - } #if APR_HAS_THREADS if (alloc_mutex) { @@ -691,6 +688,7 @@ apr_status_t apr_init_alloc(apr_pool_t *globalp) return status; } #endif + permanent_pool = apr_make_sub_pool(pglobal); #ifdef ALLOC_STATS atexit(dump_stats); From db1bbd9947cf042626a562f1c2fb6ee52dfcb4d9 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Wed, 3 Jan 2001 00:54:15 +0000 Subject: [PATCH 1029/7878] Remove some left overs from the NULL pool code. This was only in debug code, but it should go away. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61010 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_pools.c | 6 ------ memory/unix/apr_pools.c | 6 ------ 2 files changed, 12 deletions(-) diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 0e5bdaeb991..de3b1d61574 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -903,12 +903,6 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) apr_size_t size = reqsize + CLICK_SZ; void *ptr; - if (a == NULL) { - return malloc(reqsize); - } - if (c == NULL) { - return malloc(reqsize); - } ptr = malloc(size); if (ptr == NULL) { fputs("Ouch! Out of memory!\n", stderr); diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 0e5bdaeb991..de3b1d61574 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -903,12 +903,6 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) apr_size_t size = reqsize + CLICK_SZ; void *ptr; - if (a == NULL) { - return malloc(reqsize); - } - if (c == NULL) { - return malloc(reqsize); - } ptr = malloc(size); if (ptr == NULL) { fputs("Ouch! Out of memory!\n", stderr); From d54d8a2f35be4a9e14bef8c2b09b0770e42c8f95 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Wed, 3 Jan 2001 01:44:26 +0000 Subject: [PATCH 1030/7878] OS/2: Fix field name for local address. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61011 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index f8f782ef4af..f09abd15a5a 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -191,7 +191,7 @@ apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) sa->salen) == -1) return APR_OS2_STATUS(sock_errno()); else { - sock->local_sa = sa; + sock->local_addr = sa; return APR_SUCCESS; } } From d6f5228a7761b8c6481c1c8f49af083672fce3b7 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Wed, 3 Jan 2001 01:48:48 +0000 Subject: [PATCH 1031/7878] OS/2: Copy pool pointer into a socket's apr_sockaddr_t's git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61012 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index f09abd15a5a..7c264f6d3e3 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -112,15 +112,18 @@ static void set_socket_vars(apr_socket_t *sock, int family) sock->remote_addr->ipaddr_len = sizeof(struct in6_addr); } #endif -} +} + static void alloc_socket(apr_socket_t **new, apr_pool_t *p) { *new = (apr_socket_t *)apr_pcalloc(p, sizeof(apr_socket_t)); (*new)->cntxt = p; (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, sizeof(apr_sockaddr_t)); + (*new)->local_addr->pool = p; (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, sizeof(apr_sockaddr_t)); + (*new)->remote_addr->pool = p; } apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, From 78e7460fc02bf46f2de1e049c75be1ad24d3750a Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Wed, 3 Jan 2001 04:21:35 +0000 Subject: [PATCH 1032/7878] Fix the compile break in apr_pools.c Submitted by: Jeff Trawick <trawickj@bellsouth.net> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61013 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_pools.c | 2 +- memory/unix/apr_pools.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/apr_pools.c b/lib/apr_pools.c index de3b1d61574..2e890d9cd72 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -688,7 +688,7 @@ apr_status_t apr_init_alloc(apr_pool_t *globalp) return status; } #endif - permanent_pool = apr_make_sub_pool(pglobal); + permanent_pool = apr_make_sub_pool(globalp, NULL); #ifdef ALLOC_STATS atexit(dump_stats); diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index de3b1d61574..2e890d9cd72 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -688,7 +688,7 @@ apr_status_t apr_init_alloc(apr_pool_t *globalp) return status; } #endif - permanent_pool = apr_make_sub_pool(pglobal); + permanent_pool = apr_make_sub_pool(globalp, NULL); #ifdef ALLOC_STATS atexit(dump_stats); From 004b7ec86a392612e8db7e4400fab5c464bac109 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 3 Jan 2001 20:08:43 +0000 Subject: [PATCH 1033/7878] Issue the we-don't-like-your-sendfile message on all such systems, not just Tru64. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61014 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 8cae9c746c5..ccd8c835a97 100644 --- a/configure.in +++ b/configure.in @@ -585,6 +585,7 @@ dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a dnl threaded poll() and we don't want to use sendfile on early FreeBSD dnl systems if we are also using threads. +orig_sendfile=$sendfile case "$OS" in *freebsd*) if test `echo "$OS" | sed -e 's/.*\(.\)\.\(.\)/\1\2/'` -le "41"; then @@ -595,9 +596,11 @@ case "$OS" in ;; *alpha*-dec-osf* ) sendfile="0" - echo "sendfile support disabled to avoid system problem" ;; esac +if test "$orig_sendfile" != "$sendfile"; then + echo "sendfile support disabled to avoid system problem" +fi AC_SUBST(sendfile) From acae5efa2c9e13f07063bd2fe12a0396a15f8438 Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" <ake@apache.org> Date: Thu, 4 Jan 2001 21:41:35 +0000 Subject: [PATCH 1034/7878] commit the vc6 version git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61015 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/apr.dsp b/apr.dsp index 8e4fcd5c28e..c2195befaf4 100644 --- a/apr.dsp +++ b/apr.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="apr" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 @@ -22,9 +22,11 @@ CFG=apr - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe +RSC=rc.exe !IF "$(CFG)" == "apr - Win32 Release" @@ -38,17 +40,16 @@ CPP=cl.exe # PROP Output_Dir "LibR" # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c # ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"LibR\apr.lib" -# ADD LIB32 /nologo /out:"LibR\apr.lib" +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo !ELSEIF "$(CFG)" == "apr - Win32 Debug" @@ -63,17 +64,16 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -RSC=rc.exe +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"LibD\apr.lib" -# ADD LIB32 /nologo /out:"LibD\apr.lib" +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo !ENDIF From f5218d81a873ea7e45b152630ebdcf2bcb072c4c Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Thu, 4 Jan 2001 22:02:34 +0000 Subject: [PATCH 1035/7878] This patch adds support for TCP_NOPUSH to APR. Basically we look for TCP_CORK or TCP_NOPUSH and if we find them we define APR_HAVE_CORKABLE_TCP. Once defined we then make os_cork and os_uncork available. At present they're not used except in the apr_sendfile code, but there may be uses for the routines in other areas of our network code as well, hence the change. In addition I've changed SOL_TCP to IPPROTO_TCP as this is more portable. Also tiny change to the way we check the version number in configure.in to decide if we want to use sendfile on FreeBSD. Submitted by: Tony Finch <dot@dotat.at> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61016 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 4 ++++ configure.in | 17 ++++++++++++++- include/apr.h.in | 7 +++++- network_io/unix/sendrecv.c | 44 ++++++++++++++++++++++---------------- 4 files changed, 51 insertions(+), 21 deletions(-) diff --git a/acconfig.h b/acconfig.h index f3adb415773..25d28f6c87e 100644 --- a/acconfig.h +++ b/acconfig.h @@ -37,6 +37,10 @@ /* BeOS specific flag */ #undef HAVE_BONE_VERSION +/* Does this system have a corkable TCP? */ +#undef HAVE_TCP_CORK +#undef HAVE_TCP_NOPUSH + @BOTTOM@ /* Make sure we have ssize_t defined to be something */ diff --git a/configure.in b/configure.in index ccd8c835a97..b4cdbb66b5d 100644 --- a/configure.in +++ b/configure.in @@ -588,7 +588,7 @@ dnl systems if we are also using threads. orig_sendfile=$sendfile case "$OS" in *freebsd*) - if test `echo "$OS" | sed -e 's/.*\(.\)\.\(.\)/\1\2/'` -le "41"; then + if test `uname -r | sed -e 's/\(.\)\.\(.\)\..*/\1\2/'` -le "41"; then if test "$threads" = "1"; then sendfile="0" fi @@ -788,6 +788,21 @@ APR_CHECK_SOCKADDR_SA_LEN APR_CHECK_GETHOSTBYNAME_NAS +dnl # Look for a way of corking TCP... +AC_CHECK_DEFINE(TCP_CORK, netinet/tcp.h) +AC_CHECK_DEFINE(TCP_NOPUSH, netinet/tcp.h) +apr_tcp_nopush_flag="0" +if test "x$ac_cv_define_TCP_CORK" = "xyes"; then + apr_tcp_nopush_flag="TCP_CORK" + have_corkable_tcp="1" +fi +if test "x$ac_cv_define_TCP_NOPUSH" = "xyes"; then + apr_tcp_nopush_flag="TCP_NOPUSH" + have_corkable_tcp="1" +fi +AC_SUBST(apr_tcp_nopush_flag) +AC_SUBST(have_corkable_tcp) + echo $ac_n "${nl}Checking for IPv6 Networking support...${nl}" dnl # Start of checking for IPv6 support... AC_SEARCH_LIBS(getaddrinfo, inet6) diff --git a/include/apr.h.in b/include/apr.h.in index 823fabfa905..d047bbe814d 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -86,7 +86,7 @@ #define APR_HAVE_MEMMOVE @have_memmove@ #define APR_HAVE_BZERO @have_bzero@ #define APR_HAVE_IPV6 @have_ipv6@ - +#define APR_HAVE_CORKABLE_TCP @have_corkable_tcp@ #if APR_HAVE_SYS_TYPES_H #include <sys/types.h> @@ -128,6 +128,11 @@ */ #define APR_CHARSET_EBCDIC @apr_charset_ebcdic@ +/* If we have a TCP implementation that can be "corked", what flag + * do we use? + */ +#define APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@ + /* Typedefs that APR needs. */ typedef @short_value@ apr_int16_t; diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index d1fc0dcb7e3..b8e966abf0e 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -194,35 +194,28 @@ apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, } #endif -#if APR_HAS_SENDFILE - - /* TODO: Verify that all platforms handle the fd the same way - * (i.e. not moving current file pointer) - * - Should flags be an int_32 or what? - */ +/* XXX - if we start using these elsewhere in this file we'll + * need to move these to the top... + */ -static apr_hdtr_t no_hdtr; /* used below when caller passes NULL for apr_hdtr_t */ +#if APR_HAVE_CORKABLE_TCP -#if defined(__linux__) && defined(HAVE_WRITEV) - -/* TCP_CORK keeps us from sending partial frames when we shouldn't - * however, it is mutually exclusive w/TCP_NODELAY +/* TCP_CORK & TCP_NOPUSH keep us from sending partial frames when we + * shouldn't. They are however, mutually exclusive with TCP_NODELAY */ static int os_cork(apr_socket_t *sock) { - /* Linux only for now */ - int nodelay_off = 0, corkflag = 1, rv, delayflag; apr_socklen_t delaylen = sizeof(delayflag); /* XXX it would be cheaper to use an apr_socket_t flag here */ - rv = getsockopt(sock->socketdes, SOL_TCP, TCP_NODELAY, + rv = getsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *) &delayflag, &delaylen); if (rv == 0) { if (delayflag != 0) { /* turn off nodelay temporarily to allow cork */ - rv = setsockopt(sock->socketdes, SOL_TCP, TCP_NODELAY, + rv = setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (const void *) &nodelay_off, sizeof(nodelay_off)); /* XXX nuke the rv checking once this is proven solid */ if (rv < 0) { @@ -230,25 +223,38 @@ static int os_cork(apr_socket_t *sock) } } } - rv = setsockopt(sock->socketdes, SOL_TCP, TCP_CORK, + rv = setsockopt(sock->socketdes, IPPROTO_TCP, APR_TCP_NOPUSH_FLAG, (const void *) &corkflag, sizeof(corkflag)); return rv == 0 ? delayflag : rv; } static int os_uncork(apr_socket_t *sock, int delayflag) { - /* Uncork to send queued frames - Linux only for now */ + /* Uncork to send queued frames */ int corkflag = 0, rv; - rv = setsockopt(sock->socketdes, SOL_TCP, TCP_CORK, + rv = setsockopt(sock->socketdes, IPPROTO_TCP, APR_TCP_NOPUSH_FLAG, (const void *) &corkflag, sizeof(corkflag)); if (rv == 0) { /* restore TCP_NODELAY to its original setting */ - rv = setsockopt(sock->socketdes, SOL_TCP, TCP_NODELAY, + rv = setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (const void *) &delayflag, sizeof(delayflag)); } return rv; } +#endif /* APR_HAVE_CORKABLE_TCP */ + +#if APR_HAS_SENDFILE + +/* TODO: Verify that all platforms handle the fd the same way, + * i.e. that they don't move the file pointer. + */ +/* TODO: what should flags be? int_32? */ + +/* Define a structure to pass in when we have a NULL header value */ +static apr_hdtr_t no_hdtr; + +#if defined(__linux__) && defined(HAVE_WRITEV) apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, From b70090f6e19cc5bb6d21035ef297aee8b04e344c Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 5 Jan 2001 00:10:11 +0000 Subject: [PATCH 1036/7878] We need to initialize have_corkable_tcp to 0, otherwise on platforms that can't cork, we get a syntax error when we check #if HAVE_CORKABLE_TCP, because HAVE_CORKABLE_TCP is empty git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61017 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + file_io/unix/fileacc.c | 6 ++-- include/apr_file_io.h | 2 +- lib/apr_pools.c | 70 +++++++++++++++++++++++++++++++++++++++++ memory/unix/apr_pools.c | 70 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 145 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index b4cdbb66b5d..671d0c84db2 100644 --- a/configure.in +++ b/configure.in @@ -792,6 +792,7 @@ dnl # Look for a way of corking TCP... AC_CHECK_DEFINE(TCP_CORK, netinet/tcp.h) AC_CHECK_DEFINE(TCP_NOPUSH, netinet/tcp.h) apr_tcp_nopush_flag="0" +have_corkable_tcp="0" if test "x$ac_cv_define_TCP_CORK" = "xyes"; then apr_tcp_nopush_flag="TCP_CORK" have_corkable_tcp="1" diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 6bb9241c987..ecc78fc4dce 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -57,7 +57,7 @@ /* A file to put ALL of the accessor functions for apr_file_t types. */ -apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) +apr_status_t apr_get_filename(const char **fname, apr_file_t *thefile) { #ifdef WIN32 /* this test is only good until some other platform trys wchar* */ #if APR_HAS_UNICODE_FS @@ -70,10 +70,10 @@ apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) } else #endif /* !APR_HAS_UNICODE_FS */ - *fname = apr_pstrdup(thefile->cntxt, thefile->n.fname); + *fname = thefile->n.fname; #else /* !def Win32 */ - *fname = apr_pstrdup(thefile->cntxt, thefile->fname); + *fname = thefile->fname; #endif return APR_SUCCESS; } diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 1c47e5b8ddd..5648bd894f6 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -738,7 +738,7 @@ apr_status_t apr_unlock_file(apr_file_t *thefile); * @param new_path The path of the file. * @param thefile The currently open file. */ -apr_status_t apr_get_filename(char **new_path, apr_file_t *thefile); +apr_status_t apr_get_filename(const char **new_path, apr_file_t *thefile); /** * Get the file name of the current directory entry. diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 2e890d9cd72..c685b68ffa0 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -206,6 +206,14 @@ static union block_hdr *global_block_list; #endif /* APR_POOL_DEBUG */ #ifdef ALLOC_STATS + +typedef struct allocs { + char *ploc; + struct allocs *next; +} allocs; + +static allocs *top; + static unsigned long long num_free_blocks_calls; static unsigned long long num_blocks_freed; static unsigned max_blocks_in_one_free; @@ -234,6 +242,58 @@ static APR_INLINE void debug_verify_filled(const char *ptr, const char *endp, #define debug_verify_filled(a,b,c) #endif /* ALLOC_DEBUG */ +#ifdef ALLOC_STATS + +static void add_alloc_stats(union block_hdr *block) +{ + allocs *newadd = malloc(sizeof(*newadd)); + + newadd->ploc = block->h.first_avail; +fprintf(stderr, "adding: %p\n", newadd->ploc); + if (top) { + newadd->next = top; + } + top = newadd; +} + +static void remove_allocs(union block_hdr *block) +{ + allocs *remove = top; + allocs *rem2 = top; + + while (remove && (remove->ploc != block->h.first_avail)) { + remove = remove->next; + } + + if (!remove) { + fprintf(stderr, "Trying to remove memory that was never added, %p?\n", block->h.first_avail); + fflush(stderr); + } + else if (remove == top) { + top = top->next; + free(remove); + } + else { + while (rem2->next != remove) { + rem2 = rem2->next; + } + rem2->next = remove->next; + free(remove); + } +} + +static void dump_allocs(void) +{ + allocs *foo = top; + + while (foo) { + fprintf(stderr, "%p ", foo->ploc); + foo = foo->next; + } + fprintf(stderr, "\n"); +} +#endif + /* * Get a completely new block from the system pool. Note that we rely on * malloc() to provide aligned memory. @@ -274,6 +334,10 @@ static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) blok->h.owning_pool = NULL; #endif /* APR_POOL_DEBUG */ +#ifdef ALLOC_STATS + add_alloc_stats(blok); +#endif + return blok; } @@ -375,6 +439,7 @@ static void free_blocks(union block_hdr *blok) } ++num_free_blocks_calls; num_blocks_freed += num_blocks; + remove_allocs(blok); #endif /* ALLOC_STATS */ #if APR_HAS_THREADS @@ -404,6 +469,9 @@ static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) debug_verify_filled(blok->h.first_avail, blok->h.endp, "[new_block] Ouch! Someone trounced a block " "on the free list!\n"); +#ifdef ALLOC_STATS + add_alloc_stats(blok); +#endif return blok; } else { @@ -529,6 +597,7 @@ static void dump_stats(void) max_blocks_in_one_free, num_malloc_calls, num_malloc_bytes); + dump_allocs(); } #endif @@ -1291,3 +1360,4 @@ static void free_proc_chain(struct process_chain *procs) } } } + diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 2e890d9cd72..c685b68ffa0 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -206,6 +206,14 @@ static union block_hdr *global_block_list; #endif /* APR_POOL_DEBUG */ #ifdef ALLOC_STATS + +typedef struct allocs { + char *ploc; + struct allocs *next; +} allocs; + +static allocs *top; + static unsigned long long num_free_blocks_calls; static unsigned long long num_blocks_freed; static unsigned max_blocks_in_one_free; @@ -234,6 +242,58 @@ static APR_INLINE void debug_verify_filled(const char *ptr, const char *endp, #define debug_verify_filled(a,b,c) #endif /* ALLOC_DEBUG */ +#ifdef ALLOC_STATS + +static void add_alloc_stats(union block_hdr *block) +{ + allocs *newadd = malloc(sizeof(*newadd)); + + newadd->ploc = block->h.first_avail; +fprintf(stderr, "adding: %p\n", newadd->ploc); + if (top) { + newadd->next = top; + } + top = newadd; +} + +static void remove_allocs(union block_hdr *block) +{ + allocs *remove = top; + allocs *rem2 = top; + + while (remove && (remove->ploc != block->h.first_avail)) { + remove = remove->next; + } + + if (!remove) { + fprintf(stderr, "Trying to remove memory that was never added, %p?\n", block->h.first_avail); + fflush(stderr); + } + else if (remove == top) { + top = top->next; + free(remove); + } + else { + while (rem2->next != remove) { + rem2 = rem2->next; + } + rem2->next = remove->next; + free(remove); + } +} + +static void dump_allocs(void) +{ + allocs *foo = top; + + while (foo) { + fprintf(stderr, "%p ", foo->ploc); + foo = foo->next; + } + fprintf(stderr, "\n"); +} +#endif + /* * Get a completely new block from the system pool. Note that we rely on * malloc() to provide aligned memory. @@ -274,6 +334,10 @@ static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) blok->h.owning_pool = NULL; #endif /* APR_POOL_DEBUG */ +#ifdef ALLOC_STATS + add_alloc_stats(blok); +#endif + return blok; } @@ -375,6 +439,7 @@ static void free_blocks(union block_hdr *blok) } ++num_free_blocks_calls; num_blocks_freed += num_blocks; + remove_allocs(blok); #endif /* ALLOC_STATS */ #if APR_HAS_THREADS @@ -404,6 +469,9 @@ static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) debug_verify_filled(blok->h.first_avail, blok->h.endp, "[new_block] Ouch! Someone trounced a block " "on the free list!\n"); +#ifdef ALLOC_STATS + add_alloc_stats(blok); +#endif return blok; } else { @@ -529,6 +597,7 @@ static void dump_stats(void) max_blocks_in_one_free, num_malloc_calls, num_malloc_bytes); + dump_allocs(); } #endif @@ -1291,3 +1360,4 @@ static void free_proc_chain(struct process_chain *procs) } } } + From 9ed87828156c51a0e284ff76593a073cc16edfb4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 5 Jan 2001 00:13:21 +0000 Subject: [PATCH 1037/7878] Back out the changes to ALLOC_STATS that weren't ready yet. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61018 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_pools.c | 70 ----------------------------------------- memory/unix/apr_pools.c | 70 ----------------------------------------- 2 files changed, 140 deletions(-) diff --git a/lib/apr_pools.c b/lib/apr_pools.c index c685b68ffa0..2e890d9cd72 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -206,14 +206,6 @@ static union block_hdr *global_block_list; #endif /* APR_POOL_DEBUG */ #ifdef ALLOC_STATS - -typedef struct allocs { - char *ploc; - struct allocs *next; -} allocs; - -static allocs *top; - static unsigned long long num_free_blocks_calls; static unsigned long long num_blocks_freed; static unsigned max_blocks_in_one_free; @@ -242,58 +234,6 @@ static APR_INLINE void debug_verify_filled(const char *ptr, const char *endp, #define debug_verify_filled(a,b,c) #endif /* ALLOC_DEBUG */ -#ifdef ALLOC_STATS - -static void add_alloc_stats(union block_hdr *block) -{ - allocs *newadd = malloc(sizeof(*newadd)); - - newadd->ploc = block->h.first_avail; -fprintf(stderr, "adding: %p\n", newadd->ploc); - if (top) { - newadd->next = top; - } - top = newadd; -} - -static void remove_allocs(union block_hdr *block) -{ - allocs *remove = top; - allocs *rem2 = top; - - while (remove && (remove->ploc != block->h.first_avail)) { - remove = remove->next; - } - - if (!remove) { - fprintf(stderr, "Trying to remove memory that was never added, %p?\n", block->h.first_avail); - fflush(stderr); - } - else if (remove == top) { - top = top->next; - free(remove); - } - else { - while (rem2->next != remove) { - rem2 = rem2->next; - } - rem2->next = remove->next; - free(remove); - } -} - -static void dump_allocs(void) -{ - allocs *foo = top; - - while (foo) { - fprintf(stderr, "%p ", foo->ploc); - foo = foo->next; - } - fprintf(stderr, "\n"); -} -#endif - /* * Get a completely new block from the system pool. Note that we rely on * malloc() to provide aligned memory. @@ -334,10 +274,6 @@ static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) blok->h.owning_pool = NULL; #endif /* APR_POOL_DEBUG */ -#ifdef ALLOC_STATS - add_alloc_stats(blok); -#endif - return blok; } @@ -439,7 +375,6 @@ static void free_blocks(union block_hdr *blok) } ++num_free_blocks_calls; num_blocks_freed += num_blocks; - remove_allocs(blok); #endif /* ALLOC_STATS */ #if APR_HAS_THREADS @@ -469,9 +404,6 @@ static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) debug_verify_filled(blok->h.first_avail, blok->h.endp, "[new_block] Ouch! Someone trounced a block " "on the free list!\n"); -#ifdef ALLOC_STATS - add_alloc_stats(blok); -#endif return blok; } else { @@ -597,7 +529,6 @@ static void dump_stats(void) max_blocks_in_one_free, num_malloc_calls, num_malloc_bytes); - dump_allocs(); } #endif @@ -1360,4 +1291,3 @@ static void free_proc_chain(struct process_chain *procs) } } } - diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index c685b68ffa0..2e890d9cd72 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -206,14 +206,6 @@ static union block_hdr *global_block_list; #endif /* APR_POOL_DEBUG */ #ifdef ALLOC_STATS - -typedef struct allocs { - char *ploc; - struct allocs *next; -} allocs; - -static allocs *top; - static unsigned long long num_free_blocks_calls; static unsigned long long num_blocks_freed; static unsigned max_blocks_in_one_free; @@ -242,58 +234,6 @@ static APR_INLINE void debug_verify_filled(const char *ptr, const char *endp, #define debug_verify_filled(a,b,c) #endif /* ALLOC_DEBUG */ -#ifdef ALLOC_STATS - -static void add_alloc_stats(union block_hdr *block) -{ - allocs *newadd = malloc(sizeof(*newadd)); - - newadd->ploc = block->h.first_avail; -fprintf(stderr, "adding: %p\n", newadd->ploc); - if (top) { - newadd->next = top; - } - top = newadd; -} - -static void remove_allocs(union block_hdr *block) -{ - allocs *remove = top; - allocs *rem2 = top; - - while (remove && (remove->ploc != block->h.first_avail)) { - remove = remove->next; - } - - if (!remove) { - fprintf(stderr, "Trying to remove memory that was never added, %p?\n", block->h.first_avail); - fflush(stderr); - } - else if (remove == top) { - top = top->next; - free(remove); - } - else { - while (rem2->next != remove) { - rem2 = rem2->next; - } - rem2->next = remove->next; - free(remove); - } -} - -static void dump_allocs(void) -{ - allocs *foo = top; - - while (foo) { - fprintf(stderr, "%p ", foo->ploc); - foo = foo->next; - } - fprintf(stderr, "\n"); -} -#endif - /* * Get a completely new block from the system pool. Note that we rely on * malloc() to provide aligned memory. @@ -334,10 +274,6 @@ static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) blok->h.owning_pool = NULL; #endif /* APR_POOL_DEBUG */ -#ifdef ALLOC_STATS - add_alloc_stats(blok); -#endif - return blok; } @@ -439,7 +375,6 @@ static void free_blocks(union block_hdr *blok) } ++num_free_blocks_calls; num_blocks_freed += num_blocks; - remove_allocs(blok); #endif /* ALLOC_STATS */ #if APR_HAS_THREADS @@ -469,9 +404,6 @@ static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) debug_verify_filled(blok->h.first_avail, blok->h.endp, "[new_block] Ouch! Someone trounced a block " "on the free list!\n"); -#ifdef ALLOC_STATS - add_alloc_stats(blok); -#endif return blok; } else { @@ -597,7 +529,6 @@ static void dump_stats(void) max_blocks_in_one_free, num_malloc_calls, num_malloc_bytes); - dump_allocs(); } #endif @@ -1360,4 +1291,3 @@ static void free_proc_chain(struct process_chain *procs) } } } - From 6c9455a8b96b08c9f8da793874c7b48651af50f1 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 5 Jan 2001 00:15:47 +0000 Subject: [PATCH 1038/7878] Back out some changes to the file_io stuff that wasn't ready yet. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61019 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileacc.c | 6 +++--- include/apr_file_io.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index ecc78fc4dce..6bb9241c987 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -57,7 +57,7 @@ /* A file to put ALL of the accessor functions for apr_file_t types. */ -apr_status_t apr_get_filename(const char **fname, apr_file_t *thefile) +apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) { #ifdef WIN32 /* this test is only good until some other platform trys wchar* */ #if APR_HAS_UNICODE_FS @@ -70,10 +70,10 @@ apr_status_t apr_get_filename(const char **fname, apr_file_t *thefile) } else #endif /* !APR_HAS_UNICODE_FS */ - *fname = thefile->n.fname; + *fname = apr_pstrdup(thefile->cntxt, thefile->n.fname); #else /* !def Win32 */ - *fname = thefile->fname; + *fname = apr_pstrdup(thefile->cntxt, thefile->fname); #endif return APR_SUCCESS; } diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 5648bd894f6..1c47e5b8ddd 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -738,7 +738,7 @@ apr_status_t apr_unlock_file(apr_file_t *thefile); * @param new_path The path of the file. * @param thefile The currently open file. */ -apr_status_t apr_get_filename(const char **new_path, apr_file_t *thefile); +apr_status_t apr_get_filename(char **new_path, apr_file_t *thefile); /** * Get the file name of the current directory entry. From 2bc62c05f8a8c729fa5f41d88b3b96209bbfc303 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 5 Jan 2001 17:19:56 +0000 Subject: [PATCH 1039/7878] Some Linux's do not define TCP_CORK. This allows us to use sendfile on those platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61020 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure.in b/configure.in index 671d0c84db2..cdc8ad4157e 100644 --- a/configure.in +++ b/configure.in @@ -796,6 +796,15 @@ have_corkable_tcp="0" if test "x$ac_cv_define_TCP_CORK" = "xyes"; then apr_tcp_nopush_flag="TCP_CORK" have_corkable_tcp="1" +else + case $OS in + *linux*) + apr_tcp_nopush_flag="3" + have_corkable_tcp="1" + ;; + *) + ;; + esac fi if test "x$ac_cv_define_TCP_NOPUSH" = "xyes"; then apr_tcp_nopush_flag="TCP_NOPUSH" From 2d068551c420ccb3fa2dabf90cf9805f79d8fe2f Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 5 Jan 2001 18:45:26 +0000 Subject: [PATCH 1040/7878] There is no reason to duplicate the string, because we have already pstrdup'ed it when we created the file variable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61021 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fileacc.c | 6 +++--- include/apr_file_io.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 6bb9241c987..ecc78fc4dce 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -57,7 +57,7 @@ /* A file to put ALL of the accessor functions for apr_file_t types. */ -apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) +apr_status_t apr_get_filename(const char **fname, apr_file_t *thefile) { #ifdef WIN32 /* this test is only good until some other platform trys wchar* */ #if APR_HAS_UNICODE_FS @@ -70,10 +70,10 @@ apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) } else #endif /* !APR_HAS_UNICODE_FS */ - *fname = apr_pstrdup(thefile->cntxt, thefile->n.fname); + *fname = thefile->n.fname; #else /* !def Win32 */ - *fname = apr_pstrdup(thefile->cntxt, thefile->fname); + *fname = thefile->fname; #endif return APR_SUCCESS; } diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 1c47e5b8ddd..5648bd894f6 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -738,7 +738,7 @@ apr_status_t apr_unlock_file(apr_file_t *thefile); * @param new_path The path of the file. * @param thefile The currently open file. */ -apr_status_t apr_get_filename(char **new_path, apr_file_t *thefile); +apr_status_t apr_get_filename(const char **new_path, apr_file_t *thefile); /** * Get the file name of the current directory entry. From ff11c9c6278d133ab48dba79d80b701b554ee080 Mon Sep 17 00:00:00 2001 From: Sascha Schumann <sascha@apache.org> Date: Fri, 5 Jan 2001 19:11:11 +0000 Subject: [PATCH 1041/7878] Add simple check for TCP_CORK in kernel header files. This is not 100%, as the installed set of header files need not match the running kernel. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61022 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index cdc8ad4157e..3deefa37170 100644 --- a/configure.in +++ b/configure.in @@ -799,8 +799,10 @@ if test "x$ac_cv_define_TCP_CORK" = "xyes"; then else case $OS in *linux*) + AC_EGREP_HEADER(TCP_CORK, linux/socket.h, [ apr_tcp_nopush_flag="3" have_corkable_tcp="1" + ]) ;; *) ;; From 88d1be8514a66be64f1d53e6b4c72dc34cd0e54a Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 5 Jan 2001 19:40:06 +0000 Subject: [PATCH 1042/7878] Stop copying file names that we get from apr_file_t's and apr_dir_t's. We copy the data when we store it in the structures, we can just return a pointer from there, and use const data. This puts the onus back on Apache to copy the data if it needs to modify it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61023 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/dir.c | 2 +- file_io/unix/dir.c | 4 ++-- file_io/win32/dir.c | 4 ++-- include/apr_file_io.h | 2 +- test/testfile.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 3d9a4768782..cedc5f10c1a 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -218,7 +218,7 @@ apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) -apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) +apr_status_t apr_get_dir_filename(const char **new, apr_dir_t *thedir) { if (thedir->validentry) { *new = thedir->entry.achName; diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 2b4d89c18b5..6b794523020 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -240,14 +240,14 @@ apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) return APR_SUCCESS; } -apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) +apr_status_t apr_get_dir_filename(const char **new, apr_dir_t *thedir) { /* Detect End-Of-File */ if (thedir == NULL || thedir->entry == NULL) { *new = NULL; return APR_ENOENT; } - (*new) = apr_pstrdup(thedir->cntxt, thedir->entry->d_name); + (*new) = thedir->entry->d_name; return APR_SUCCESS; } diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 5087818139c..e1bf138aec9 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -320,7 +320,7 @@ apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) } } -apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) +apr_status_t apr_get_dir_filename(const char **new, apr_dir_t *thedir) { #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; @@ -333,7 +333,7 @@ apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) } else #endif - (*new) = apr_pstrdup(thedir->cntxt, thedir->n.entry->cFileName); + (*new) = thedir->n.entry->cFileName; return APR_SUCCESS; } diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 5648bd894f6..4a4e3919bf1 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -745,7 +745,7 @@ apr_status_t apr_get_filename(const char **new_path, apr_file_t *thefile); * @param new_path the file name of the directory entry. * @param thedir the currently open directory. */ -apr_status_t apr_get_dir_filename(char **new_path, apr_dir_t *thedir); +apr_status_t apr_get_dir_filename(const char **new_path, apr_dir_t *thedir); /** * Return the data associated with the current file. diff --git a/test/testfile.c b/test/testfile.c index 3998d262575..b3b45b8ab58 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -280,7 +280,7 @@ int testdirs(apr_pool_t *context) apr_file_t *file = NULL; apr_size_t bytes; apr_filetype_e type; - char *fname; + const char *fname; fprintf(stdout, "Testing Directory functions.\n"); From 969b9b869625521cc1832675256e6acee2411554 Mon Sep 17 00:00:00 2001 From: Sascha Schumann <sascha@apache.org> Date: Fri, 5 Jan 2001 19:57:46 +0000 Subject: [PATCH 1043/7878] Builds nicely without -DHPUX10, so remove the respective hint. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61024 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 1 - 1 file changed, 1 deletion(-) diff --git a/hints.m4 b/hints.m4 index bb898022cbd..8913005d38d 100644 --- a/hints.m4 +++ b/hints.m4 @@ -87,7 +87,6 @@ case "$host" in APR_SETIFNULL(LIBS, [-lm -lpthread]) ;; *-hp-hpux10.*) - APR_SETIFNULL(CFLAGS, [-DHPUX10]) case $host in *-hp-hpux10.01) dnl # We know this is a problem in 10.01. From 6c3e2c0b5d63d8925394493d016f478ad2da146e Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 5 Jan 2001 21:22:19 +0000 Subject: [PATCH 1044/7878] Simplify the logic for TCP cork on Linux. Basically, instead of grepping through the system header files, trying to find TCP_CORK, we just check if sendfile was found. If so, but we couldn't find TCP_CORK, we define it ourselves. This is the same logic that the C files used to use, so it should be much more stable. Submitted by: Jeff Trawick <trawickj@bellsouth.net> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61025 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 3deefa37170..4b7503ee3df 100644 --- a/configure.in +++ b/configure.in @@ -799,10 +799,10 @@ if test "x$ac_cv_define_TCP_CORK" = "xyes"; then else case $OS in *linux*) - AC_EGREP_HEADER(TCP_CORK, linux/socket.h, [ - apr_tcp_nopush_flag="3" - have_corkable_tcp="1" - ]) + if test "x$sendfile" = "x1"; then + apr_tcp_nopush_flag="3" + have_corkable_tcp="1" + fi ;; *) ;; From 5fc2d6f2b8faf4984d14ffeb97b9864ea59d9eb6 Mon Sep 17 00:00:00 2001 From: Sascha Schumann <sascha@apache.org> Date: Fri, 5 Jan 2001 22:33:08 +0000 Subject: [PATCH 1045/7878] Proper TCP_SOCK in <linux/socket.h> check. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61026 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 4b7503ee3df..eec40e72b5c 100644 --- a/configure.in +++ b/configure.in @@ -799,10 +799,15 @@ if test "x$ac_cv_define_TCP_CORK" = "xyes"; then else case $OS in *linux*) - if test "x$sendfile" = "x1"; then + AC_EGREP_CPP(yes,[ + #include <linux/socket.h> + #ifdef TCP_CORK + yes + #endif + ],[ apr_tcp_nopush_flag="3" have_corkable_tcp="1" - fi + ]) ;; *) ;; From 1c699b78a8d9f05ed7cb2d06fb5d7727f72ca073 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 6 Jan 2001 15:18:48 +0000 Subject: [PATCH 1046/7878] Keep apr_terminate from seg faulting on terminate. This is happening on systems that do not NULL out locks when they are destroyed. To keep this from happening, we set the locks to NULL after destroying them in apr_terminate, and we have to check for NULL in free_blocks. Submitted by: Allan Edwards and Gregory Nicholls <gnicholls@level8.com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61027 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++++++ lib/apr_pools.c | 10 ++++++++-- memory/unix/apr_pools.c | 10 ++++++++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index c28bcc21f73..d79bf279c5c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,12 @@ Changes with APR b1 + *) Keep apr_terminate from seg faulting on terminate. This is + happening on systems that do not NULL out locks when they are + destroyed. To keep this from happening, we set the locks to + NULL after destroying them in apr_terminate, and we have to + check for NULL in free_blocks. + [Allan Edwards and Gregory Nicholls <gnicholls@level8.com>] + *) Remove the ability to allocate memory out of a NULL pool. [Ryan Bloom] diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 2e890d9cd72..7d2da36b1c0 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -328,7 +328,9 @@ static void free_blocks(union block_hdr *blok) } #if APR_HAS_THREADS - apr_lock(alloc_mutex); + if (alloc_mutex) { + apr_lock(alloc_mutex); + } #endif old_free_list = block_freelist; block_freelist = blok; @@ -378,7 +380,9 @@ static void free_blocks(union block_hdr *blok) #endif /* ALLOC_STATS */ #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + if (alloc_mutex) { + apr_unlock(alloc_mutex); + } #endif /* APR_HAS_THREADS */ #endif /* ALLOC_USE_MALLOC */ } @@ -702,6 +706,8 @@ void apr_term_alloc(apr_pool_t *globalp) #if APR_HAS_THREADS apr_destroy_lock(alloc_mutex); apr_destroy_lock(spawn_mutex); + alloc_mutex = NULL; + spawn_mutex = NULL; #endif apr_destroy_pool(globalp); } diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 2e890d9cd72..7d2da36b1c0 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -328,7 +328,9 @@ static void free_blocks(union block_hdr *blok) } #if APR_HAS_THREADS - apr_lock(alloc_mutex); + if (alloc_mutex) { + apr_lock(alloc_mutex); + } #endif old_free_list = block_freelist; block_freelist = blok; @@ -378,7 +380,9 @@ static void free_blocks(union block_hdr *blok) #endif /* ALLOC_STATS */ #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + if (alloc_mutex) { + apr_unlock(alloc_mutex); + } #endif /* APR_HAS_THREADS */ #endif /* ALLOC_USE_MALLOC */ } @@ -702,6 +706,8 @@ void apr_term_alloc(apr_pool_t *globalp) #if APR_HAS_THREADS apr_destroy_lock(alloc_mutex); apr_destroy_lock(spawn_mutex); + alloc_mutex = NULL; + spawn_mutex = NULL; #endif apr_destroy_pool(globalp); } From 7c45ca9efe60b506ec3433d0b3ac7cee8686d720 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 6 Jan 2001 17:07:45 +0000 Subject: [PATCH 1047/7878] This header file is needed to allow the shared memory "fix" for BeOS to work. Submitted by: Justin Sherrill <justin@shiningsilence.com> Peter Moore <peter@cdws.com.au> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61028 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shmem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 0608add68cb..f7c5c99297f 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -57,6 +57,10 @@ #include "apr_shmem.h" #include "apr_errno.h" +#if BEOS +#include <kernel/OS.h> +#endif + struct shmem_t { MM *mm; #if BEOS From 46d15fdee245e6ec5a9ef46ff4cc1102b6f75bdb Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 7 Jan 2001 00:00:07 +0000 Subject: [PATCH 1048/7878] We don't actually use os_cork or os_uncork on FreeBSD, so we shouldn't define them. This removes some warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61029 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ network_io/unix/sendrecv.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index d79bf279c5c..136baf0ea7a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Remove a warning on FreeBSD. FreeBSD defines TCP_NO_PUSH, but we + don't actually use it. This causes os_cork to be defined but not + used. This patch keeps us from defining os_cork and os_uncork on + FreeBSD. [Ryan Bloom] + *) Keep apr_terminate from seg faulting on terminate. This is happening on systems that do not NULL out locks when they are destroyed. To keep this from happening, we set the locks to diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index b8e966abf0e..f9545f30de0 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -198,7 +198,7 @@ apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, * need to move these to the top... */ -#if APR_HAVE_CORKABLE_TCP +#if APR_HAVE_CORKABLE_TCP && !defined(__FreeBSD__) /* TCP_CORK & TCP_NOPUSH keep us from sending partial frames when we * shouldn't. They are however, mutually exclusive with TCP_NODELAY From 78a56da98d170c5593c3b37b76b740c5f6288920 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sun, 7 Jan 2001 00:35:37 +0000 Subject: [PATCH 1049/7878] add a reminder git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61030 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 3cebb766c0c..2286868b2b9 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/02 07:13:54 $] +Last modified at [$Date: 2001/01/07 00:35:37 $] Release: @@ -90,6 +90,9 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: combined with the include facility, generating Makefiles becomes simpler and faster. + * use os_(un)cork in network_io/unix/sendrecv.c for FreeBSD's + sendfile implementation. + Documentation that needs writing: From 51f6887f37560fc4933fe046cef3f3724777375f Mon Sep 17 00:00:00 2001 From: Sascha Schumann <sascha@apache.org> Date: Mon, 8 Jan 2001 23:02:56 +0000 Subject: [PATCH 1050/7878] Since this macro is used by other packages, which don't necessarily include the helpers directory in the same directory structure, we rely on the user of this macro to supply the correct path to the mkdir helpers script. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61031 13f79535-47bb-0310-9956-ffa450edef68 --- apr_common.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apr_common.m4 b/apr_common.m4 index 24276364cf1..cd0bcbbd2d8 100644 --- a/apr_common.m4 +++ b/apr_common.m4 @@ -9,7 +9,7 @@ AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [ ac_popdir=`pwd` ac_abs_srcdir=`(cd $srcdir/$1 && pwd)` apr_config_subdirs="$1" - test -d $1 || $srcdir/helpers/mkdir.sh $1 + test -d $1 || $MKDIR $1 cd $1 changequote(, )dnl From 6a8e23a87041c4476389741e53cd033f1509c3db Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 8 Jan 2001 23:48:45 +0000 Subject: [PATCH 1051/7878] get rid of bogus calls to perror() (I'll work through the remaining instances in the short term; thanks to Brian Havard for fixing another instance in log.c and cluing me in to the problem) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61032 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/test/testfile.c b/test/testfile.c index b3b45b8ab58..3b3777e739e 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -76,13 +76,14 @@ int main(void) apr_file_t *thefile = NULL; apr_socket_t *testsock = NULL; apr_pollfd_t *sdset = NULL; - apr_status_t status = 0; + apr_status_t status; apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; apr_size_t nbytes = 0; apr_int32_t rv; apr_off_t zer = 0; + char errmsg[120]; char *buf; - char *str; + const char *str; char *filename = "test.fil"; char *teststr; @@ -103,8 +104,10 @@ int main(void) fprintf(stdout, "Testing file functions.\n"); fprintf(stdout, "\tOpening file......."); - if (apr_open(&thefile, filename, flag, APR_UREAD | APR_UWRITE | APR_GREAD, context) != APR_SUCCESS) { - perror("Didn't open file"); + status = apr_open(&thefile, filename, flag, APR_UREAD | APR_UWRITE | APR_GREAD, context); + if (status != APR_SUCCESS) { + fprintf(stderr, "Didn't open file: %d/%s\n", status, + apr_strerror(status, errmsg, sizeof errmsg)); exit(-1); } else { @@ -128,8 +131,10 @@ int main(void) fprintf(stdout, "\tWriting to file......."); nbytes = strlen("this is a test"); - if (apr_write(thefile, "this is a test", &nbytes) != APR_SUCCESS) { - perror("something's wrong"); + status = apr_write(thefile, "this is a test", &nbytes); + if (status != APR_SUCCESS) { + fprintf(stderr, "something's wrong; apr_write->%d/%s\n", + status, apr_strerror(status, errmsg, sizeof errmsg)); exit(-1); } if (nbytes != strlen("this is a test")) { @@ -142,8 +147,10 @@ int main(void) fprintf(stdout, "\tMoving to start of file......."); zer = 0; - if (apr_seek(thefile, SEEK_SET, &zer) != 0) { - perror("couldn't seek to beginning of file."); + status = apr_seek(thefile, SEEK_SET, &zer); + if (status != APR_SUCCESS) { + fprintf(stderr, "couldn't seek to beginning of file: %d/%s", + status, apr_strerror(status, errmsg, sizeof errmsg)); exit(-1); } else { @@ -153,8 +160,10 @@ int main(void) #if APR_FILES_AS_SOCKETS fprintf(stdout, "\tThis platform supports files_like_sockets\n"); fprintf(stdout, "\t\tMaking file look like a socket......."); - if (apr_socket_from_file(&testsock, thefile) != APR_SUCCESS) { - perror("Something went wrong"); + status = apr_socket_from_file(&testsock, thefile); + if (status != APR_SUCCESS) { + fprintf(stderr, "apr_socket_from_file()->%d/%s\n", + status, apr_strerror(status, errmsg, sizeof errmsg)); exit(-1); } fprintf(stdout, "OK\n"); @@ -178,8 +187,10 @@ int main(void) fprintf(stdout, "\tReading from the file......."); nbytes = strlen("this is a test"); buf = (char *)apr_palloc(context, nbytes + 1); - if (apr_read(thefile, buf, &nbytes) != APR_SUCCESS) { - perror("something's wrong"); + status = apr_read(thefile, buf, &nbytes); + if (status != APR_SUCCESS) { + fprintf(stderr, "apr_read()->%d/%s\n", + status, apr_strerror(status, errmsg, sizeof errmsg)); exit(-1); } if (nbytes != strlen("this is a test")) { From 0f03163ea5bb83edd1d548cbe38f5b81b265ef93 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 8 Jan 2001 23:51:59 +0000 Subject: [PATCH 1052/7878] get rid of a bogus use of perror() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61033 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmmap.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/testmmap.c b/test/testmmap.c index 24e924f35e3..c1f9a85c9a3 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -77,7 +77,9 @@ int main(void) apr_file_t *thefile = NULL; apr_finfo_t finfo; apr_int32_t flag = APR_READ; + apr_status_t rv; char *file1; + char errmsg[120]; fprintf (stdout,"APR MMAP Test\n*************\n\n"); @@ -101,8 +103,11 @@ int main(void) strncat(file1,"/testmmap.c",11); fprintf(stdout, "Opening file........................"); - if (apr_open(&thefile, file1, flag, APR_UREAD | APR_GREAD, context) != APR_SUCCESS) { - perror("Didn't open file"); + rv = apr_open(&thefile, file1, flag, APR_UREAD | APR_GREAD, context); + if (rv != APR_SUCCESS) { + fprintf(stderr, + "couldn't open file `%s': %d/%s\n", + file1, rv, apr_strerror(rv, errmsg, sizeof errmsg)); exit(-1); } else { @@ -110,8 +115,11 @@ int main(void) } fprintf(stderr, "Getting file size..................."); - if (apr_getfileinfo(&finfo, thefile) != APR_SUCCESS) { - perror("Didn't get file information!"); + rv = apr_getfileinfo(&finfo, thefile); + if (rv != APR_SUCCESS) { + fprintf(stderr, + "Didn't get file information: %d/%s\n", + rv, apr_strerror(rv, errmsg, sizeof errmsg)); exit(-1); } else { From b54a4e78019405721b16d3271875e4b2605eeae2 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Tue, 9 Jan 2001 08:34:52 +0000 Subject: [PATCH 1053/7878] moved from apr/aclocal.m4 (1.38) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61034 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/apr-conf.m4 | 536 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 536 insertions(+) create mode 100644 helpers/apr-conf.m4 diff --git a/helpers/apr-conf.m4 b/helpers/apr-conf.m4 new file mode 100644 index 00000000000..f8208317b7e --- /dev/null +++ b/helpers/apr-conf.m4 @@ -0,0 +1,536 @@ +dnl ## +dnl ## +dnl ## +define(AC_USE_FUNCTION,[dnl +AC_CHECK_FUNCS($1) +if test ".$ac_func_$1" = .yes; then +AC_DEFINE(USE_$2) +fi +])dnl +dnl ## +dnl ## +dnl ## +AC_DEFUN(AC_CHECK_DEFINE_FILES,[ + AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ + ac_cv_define_$1=no + for curhdr in $2 + do + AC_EGREP_CPP(YES_IS_DEFINED, [ + #include <$curhdr> + #ifdef $1 + YES_IS_DEFINED + #endif + ], ac_cv_define_$1=yes) + done + ]) + if test "$ac_cv_define_$1" = "yes"; then + AC_DEFINE(HAVE_$1) + fi +]) +dnl ## +dnl ## +dnl ## +AC_DEFUN(AC_CHECK_DEFINE,[ + AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ + AC_EGREP_CPP(YES_IS_DEFINED, [ + #include <$2> + #ifdef $1 + YES_IS_DEFINED + #endif + ], ac_cv_define_$1=yes, ac_cv_define_$1=no) + ]) + if test "$ac_cv_define_$1" = "yes"; then + AC_DEFINE(HAVE_$1) + fi +]) +dnl ## +dnl ## +dnl ## +define(AC_IFALLYES,[dnl +ac_rc=yes +for ac_spec in $1; do + ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'` + ac_item=`echo "$ac_spec" | sed -e 's/^.*://'` + case $ac_type in + header ) + ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'` + ac_var="ac_cv_header_$ac_item" + ;; + file ) + ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'` + ac_var="ac_cv_file_$ac_item" + ;; + func ) ac_var="ac_cv_func_$ac_item" ;; + define ) ac_var="ac_cv_define_$ac_item" ;; + custom ) ac_var="$ac_item" ;; + esac + eval "ac_val=\$$ac_var" + if test ".$ac_val" != .yes; then + ac_rc=no + break + fi +done +if test ".$ac_rc" = .yes; then + : + $2 +else + : + $3 +fi +])dnl +dnl ## +dnl ## +dnl ## +define(AC_BEGIN_DECISION,[dnl +ac_decision_item='$1' +ac_decision_msg='FAILED' +ac_decision='' +])dnl +define(AC_DECIDE,[dnl +ac_decision='$1' +ac_decision_msg='$2' +ac_decision_$1=yes +ac_decision_$1_msg='$2' +])dnl +define(AC_DECISION_OVERRIDE,[dnl + ac_decision='' + for ac_item in $1; do + eval "ac_decision_this=\$ac_decision_${ac_item}" + if test ".$ac_decision_this" = .yes; then + ac_decision=$ac_item + eval "ac_decision_msg=\$ac_decision_${ac_item}_msg" + fi + done +])dnl +define(AC_DECISION_FORCE,[dnl +ac_decision="$1" +eval "ac_decision_msg=\"\$ac_decision_${ac_decision}_msg\"" +])dnl +define(AC_END_DECISION,[dnl +if test ".$ac_decision" = .; then + echo "[$]0:Error: decision on $ac_decision_item failed" 1>&2 + exit 1 +else + if test ".$ac_decision_msg" = .; then + ac_decision_msg="$ac_decision" + fi + AC_DEFINE_UNQUOTED(${ac_decision_item}) + AC_MSG_RESULT([decision on $ac_decision_item... $ac_decision_msg]) +fi +])dnl + +dnl ### AC_TRY_RUN had some problems actually using a programs return code, +dnl ### so I am re-working it here to be used in APR's configure script. +dnl MY_TRY_RUN(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE +dnl [, ACTION-IF-CROSS-COMPILING]]]) +AC_DEFUN(MY_TRY_RUN, +[if test "$cross_compiling" = yes; then + ifelse([$4], , + [errprint(__file__:__line__: warning: [AC_TRY_RUN] called without default to allow cross compiling +)dnl + AC_MSG_ERROR(can not run test program while cross compiling)], + [$4]) +else + MY_TRY_RUN_NATIVE([$1], [$2], [$3]) +fi +]) + +dnl Like AC_TRY_RUN but assumes a native-environment (non-cross) compiler. +dnl MY_TRY_RUN_NATIVE(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE]]) +AC_DEFUN(MY_TRY_RUN_NATIVE, +[cat > conftest.$ac_ext <<EOF +[#]line __oline__ "configure" +#include "confdefs.h" +ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus +extern "C" void exit(int); +#endif +])dnl +[$1] +EOF +if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then +dnl Don't remove the temporary files here, so they can be examined. + ifelse([$2], , :, [$2]) +else +ifelse([$3], , , [ $3 + rm -fr conftest* +])dnl +fi +rm -fr conftest*]) +dnl A variant of AC_CHECK_SIZEOF which allows the checking of +dnl sizes of non-builtin types +dnl AC_CHECK_SIZEOF_EXTENDED(INCLUDES, TYPE [, CROSS_SIZE]) +AC_DEFUN(AC_CHECK_SIZEOF_EXTENDED, +[changequote(<<,>>)dnl +dnl The name to #define +define(<<AC_TYPE_NAME>>, translit(sizeof_$2, [a-z *], [A-Z_P]))dnl +dnl The cache variable +define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$2, [ *],[<p>]))dnl +changequote([, ])dnl +AC_MSG_CHECKING(size of $2) +AC_CACHE_VAL(AC_CV_NAME, +[AC_TRY_RUN([#include <stdio.h> +$1 +main() +{ + FILE *f=fopen("conftestval","w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof($2)); + exit(0); +}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$3],,, +AC_CV_NAME=$3))])dnl +AC_MSG_RESULT($AC_CV_NAME) +AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) +undefine([AC_TYPE_NAME])dnl +undefine([AC_CV_NAME])dnl +]) + +dnl +dnl check for working getaddrinfo() +dnl + +AC_DEFUN(APR_CHECK_WORKING_GETADDRINFO,[ + AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[ + AC_TRY_RUN( [ +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif + +void main(void) { + struct addrinfo hints, *ai; + int error; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo("127.0.0.1", "8080", &hints, &ai); + if (error) { + exit(1); + } + else { + exit(0); + } +} +],[ + ac_cv_working_getaddrinfo="yes" +],[ + ac_cv_working_getaddrinfo="no" +],[ + ac_cv_working_getaddrinfo="yes" +])]) +if test "$ac_cv_working_getaddrinfo" = "yes"; then + AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works well enough for APR]) +fi +]) + +dnl +dnl check for gethostbyname() which handles numeric address strings +dnl + +AC_DEFUN(APR_CHECK_GETHOSTBYNAME_NAS,[ + AC_CACHE_CHECK(for gethostbyname() which handles numeric address strings, ac_cv_gethostbyname_nas,[ + AC_TRY_RUN( [ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +void main(void) { + struct hostent *he = gethostbyname("127.0.0.1"); + if (he == NULL) { + exit(1); + } + else { + exit(0); + } +} +],[ + ac_cv_gethostbyname_nas="yes" +],[ + ac_cv_gethostbyname_nas="no" +],[ + ac_cv_gethostbyname_nas="yes" +])]) +if test "$ac_cv_gethostbyname_nas" = "yes"; then + AC_DEFINE(GETHOSTBYNAME_HANDLES_NAS, 1, [Define if gethostbyname() handles nnn.nnn.nnn.nnn]) +fi +]) + +dnl +dnl check for socklen_t, fall back to unsigned int +dnl + +AC_DEFUN(APR_CHECK_SOCKLEN_T,[ +AC_CACHE_CHECK(for socklen_t, ac_cv_socklen_t,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +],[ +socklen_t foo = (socklen_t) 0; +],[ + ac_cv_socklen_t=yes +],[ + ac_cv_socklen_t=no +]) +]) + +if test "$ac_cv_socklen_t" = "yes"; then + AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t]) +fi +]) + +dnl Check for ranlib but, unlike the check provided with autoconf, set +dnl RANLIB to "true" if there is no ranlib instead of setting it to ":". +dnl OS/390 doesn't have ranlib and the make utility doesn't parse "RANLIB=:" +dnl the way we might want it to. + +AC_DEFUN(AC_PROG_RANLIB_NC, +[AC_CHECK_TOOL(RANLIB, ranlib, true)]) + +AC_DEFUN(APR_EBCDIC,[ + AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ + AC_TRY_RUN( [ +int main(void) { + return (unsigned char)'A' != (unsigned char)0xC1; +} +],[ + ac_cv_ebcdic="yes" +],[ + ac_cv_ebcdic="no" +],[ + ac_cv_ebcdic="no" +])]) + if test "$ac_cv_ebcdic" = "yes"; then + apr_charset_ebcdic=1 + else + apr_charset_ebcdic=0 + fi + AC_SUBST(apr_charset_ebcdic) +]) + +AC_DEFUN(APR_PREPARE_MM_DIR,[ +dnl #----------------------------- Prepare mm directory for VPATH support +if test -n "$USE_MM" && test -n "$USE_VPATH"; then + test -d $mm_dir || $MKDIR $mm_dir + + for i in shtool config.guess config.sub fbtool ltconfig \ + ltmain.sh mm_vers.c; do + test -r $mm_dir/$i || ln -s $abs_srcdir/$mm_dir/$i $mm_dir/$i + done +fi +]) + +AC_DEFUN(APR_CHECK_INET_ADDR,[ +AC_CACHE_CHECK(for inet_addr, ac_cv_func_inet_addr,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif +],[ +inet_addr("127.0.0.1"); +],[ + ac_cv_func_inet_addr=yes +],[ + ac_cv_func_inet_addr=no +]) +]) + +if test "$ac_cv_func_inet_addr" = "yes"; then + have_inet_addr=1 +else + have_inet_addr=0 +fi +]) + +AC_DEFUN(APR_CHECK_INET_NETWORK,[ +AC_CACHE_CHECK(for inet_network, ac_cv_func_inet_network,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif +],[ +inet_network("127.0.0.1"); +],[ + ac_cv_func_inet_network=yes +],[ + ac_cv_func_inet_network=no +]) +]) + +if test "$ac_cv_func_inet_network" = "yes"; then + have_inet_network=1 +else + have_inet_network=0 +fi +]) + +AC_DEFUN(APR_CHECK_SOCKADDR_IN6,[ +AC_CACHE_CHECK(for sockaddr_in6, ac_cv_define_sockaddr_in6,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +],[ +struct sockaddr_in6 sa; +],[ + ac_cv_define_sockaddr_in6=yes +],[ + ac_cv_define_sockaddr_in6=no +]) +]) + +if test "$ac_cv_define_sockaddr_in6" = "yes"; then + have_sockaddr_in6=1 +else + have_sockaddr_in6=0 +fi +]) + +# +# Check to see if this platform includes sa_len in it's +# struct sockaddr. If it does it changes the length of sa_family +# which could cause us problems +# +AC_DEFUN(APR_CHECK_SOCKADDR_SA_LEN,[ +AC_CACHE_CHECK(for sockaddr sa_len, ac_cv_define_sockaddr_sa_len,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +],[ +struct sockaddr_in sai; +int i = sai.sin_len; +],[ + ac_cv_define_sockaddr_sa_len=yes +],[ + ac_cv_define_sockaddr_sa_len=no +]) +]) + +if test "$ac_cv_define_sockaddr_sa_len" = "yes"; then + AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1 ,[Define if we have length field in sockaddr_in]) +fi +]) + +dnl +dnl APR_INADDR_NONE +dnl +dnl checks for missing INADDR_NONE macro +dnl +AC_DEFUN(APR_INADDR_NONE,[ + AC_CACHE_CHECK(whether system defines INADDR_NONE, ac_cv_inaddr_none,[ + AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif +],[ +unsigned long foo = INADDR_NONE; +],[ + ac_cv_inaddr_none=yes +],[ + ac_cv_inaddr_none=no +])]) + if test "$ac_cv_inaddr_none" = "no"; then + apr_inaddr_none="((unsigned int) 0xffffffff)" + else + apr_inaddr_none="INADDR_NONE" + fi +]) + +dnl +dnl APR_CHECK_H_ERRNO_FLAG +dnl +dnl checks which flags are necessary for <netdb.h> to define h_errno +dnl +AC_DEFUN(APR_H_ERRNO_COMPILE_CHECK,[ + if test x$1 != x; then + CFLAGS="-D$1 $CFLAGS" + fi + AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif +],[ +int h_e = h_errno; +],[ + if test x$1 != x; then + ac_cv_h_errno_cflags="$1" + else + ac_cv_h_errno_cflags=yes + fi +],[ + ac_cv_h_errno_cflags=no +])]) +AC_DEFUN(APR_CHECK_H_ERRNO_FLAG,[ + AC_MSG_CHECKING([for h_errno in netdb.h]) + AC_CACHE_VAL(ac_cv_h_errno_cflags,[ + APR_H_ERRNO_COMPILE_CHECK + if test "$ac_cv_h_errno_cflags" = "no"; then + ac_save="$CFLAGS" + for flag in _XOPEN_SOURCE_EXTENDED; do + APR_H_ERRNO_COMPILE_CHECK($flag) + if test "$ac_cv_h_errno_cflags" != "no"; then + break + fi + done + CFLAGS="$ac_save" + fi + ]) + if test "$ac_cv_h_errno_cflags" != "no"; then + if test "$ac_cv_h_errno_cflags" != "yes"; then + CFLAGS="-D$ac_cv_h_errno_cflags $CFLAGS" + AC_MSG_RESULT([yes, with -D$ac_cv_h_errno_cflags]) + else + AC_MSG_RESULT([$ac_cv_h_errno_cflags]) + fi + else + AC_MSG_RESULT([$ac_cv_h_errno_cflags]) + fi +]) + +sinclude(apr_common.m4) +sinclude(hints.m4) From 33f5806c7bf78e609a9f4ee6d58c4729c9dcf8d2 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Tue, 9 Jan 2001 08:39:13 +0000 Subject: [PATCH 1054/7878] toss some of the "dnl" crap lines. add whitespace for clarity. remove the sinclude() lines since we'll be doing that as part of constructing aclocal.m4 in buildconf. convert a comment to "dnl" to prevent inclusion in the output file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61035 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/apr-conf.m4 | 75 +++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 34 deletions(-) diff --git a/helpers/apr-conf.m4 b/helpers/apr-conf.m4 index f8208317b7e..ce041ca1cb1 100644 --- a/helpers/apr-conf.m4 +++ b/helpers/apr-conf.m4 @@ -1,15 +1,15 @@ -dnl ## -dnl ## -dnl ## +dnl +dnl apr-conf.m4: APR's autoconf support macros +dnl + define(AC_USE_FUNCTION,[dnl AC_CHECK_FUNCS($1) if test ".$ac_func_$1" = .yes; then AC_DEFINE(USE_$2) fi -])dnl -dnl ## -dnl ## -dnl ## +]) + + AC_DEFUN(AC_CHECK_DEFINE_FILES,[ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ ac_cv_define_$1=no @@ -27,9 +27,8 @@ AC_DEFUN(AC_CHECK_DEFINE_FILES,[ AC_DEFINE(HAVE_$1) fi ]) -dnl ## -dnl ## -dnl ## + + AC_DEFUN(AC_CHECK_DEFINE,[ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ AC_EGREP_CPP(YES_IS_DEFINED, [ @@ -43,9 +42,8 @@ AC_DEFUN(AC_CHECK_DEFINE,[ AC_DEFINE(HAVE_$1) fi ]) -dnl ## -dnl ## -dnl ## + + define(AC_IFALLYES,[dnl ac_rc=yes for ac_spec in $1; do @@ -77,21 +75,24 @@ else : $3 fi -])dnl -dnl ## -dnl ## -dnl ## +]) + + define(AC_BEGIN_DECISION,[dnl ac_decision_item='$1' ac_decision_msg='FAILED' ac_decision='' -])dnl +]) + + define(AC_DECIDE,[dnl ac_decision='$1' ac_decision_msg='$2' ac_decision_$1=yes ac_decision_$1_msg='$2' -])dnl +]) + + define(AC_DECISION_OVERRIDE,[dnl ac_decision='' for ac_item in $1; do @@ -101,11 +102,15 @@ define(AC_DECISION_OVERRIDE,[dnl eval "ac_decision_msg=\$ac_decision_${ac_item}_msg" fi done -])dnl +]) + + define(AC_DECISION_FORCE,[dnl ac_decision="$1" eval "ac_decision_msg=\"\$ac_decision_${ac_decision}_msg\"" -])dnl +]) + + define(AC_END_DECISION,[dnl if test ".$ac_decision" = .; then echo "[$]0:Error: decision on $ac_decision_item failed" 1>&2 @@ -117,7 +122,7 @@ else AC_DEFINE_UNQUOTED(${ac_decision_item}) AC_MSG_RESULT([decision on $ac_decision_item... $ac_decision_msg]) fi -])dnl +]) dnl ### AC_TRY_RUN had some problems actually using a programs return code, dnl ### so I am re-working it here to be used in APR's configure script. @@ -157,6 +162,8 @@ ifelse([$3], , , [ $3 ])dnl fi rm -fr conftest*]) + + dnl A variant of AC_CHECK_SIZEOF which allows the checking of dnl sizes of non-builtin types dnl AC_CHECK_SIZEOF_EXTENDED(INCLUDES, TYPE [, CROSS_SIZE]) @@ -188,7 +195,6 @@ undefine([AC_CV_NAME])dnl dnl dnl check for working getaddrinfo() dnl - AC_DEFUN(APR_CHECK_WORKING_GETADDRINFO,[ AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[ AC_TRY_RUN( [ @@ -232,7 +238,6 @@ fi dnl dnl check for gethostbyname() which handles numeric address strings dnl - AC_DEFUN(APR_CHECK_GETHOSTBYNAME_NAS,[ AC_CACHE_CHECK(for gethostbyname() which handles numeric address strings, ac_cv_gethostbyname_nas,[ AC_TRY_RUN( [ @@ -275,7 +280,6 @@ fi dnl dnl check for socklen_t, fall back to unsigned int dnl - AC_DEFUN(APR_CHECK_SOCKLEN_T,[ AC_CACHE_CHECK(for socklen_t, ac_cv_socklen_t,[ AC_TRY_COMPILE([ @@ -303,10 +307,10 @@ dnl Check for ranlib but, unlike the check provided with autoconf, set dnl RANLIB to "true" if there is no ranlib instead of setting it to ":". dnl OS/390 doesn't have ranlib and the make utility doesn't parse "RANLIB=:" dnl the way we might want it to. - AC_DEFUN(AC_PROG_RANLIB_NC, [AC_CHECK_TOOL(RANLIB, ranlib, true)]) + AC_DEFUN(APR_EBCDIC,[ AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ AC_TRY_RUN( [ @@ -328,6 +332,7 @@ int main(void) { AC_SUBST(apr_charset_ebcdic) ]) + AC_DEFUN(APR_PREPARE_MM_DIR,[ dnl #----------------------------- Prepare mm directory for VPATH support if test -n "$USE_MM" && test -n "$USE_VPATH"; then @@ -340,6 +345,7 @@ if test -n "$USE_MM" && test -n "$USE_VPATH"; then fi ]) + AC_DEFUN(APR_CHECK_INET_ADDR,[ AC_CACHE_CHECK(for inet_addr, ac_cv_func_inet_addr,[ AC_TRY_COMPILE([ @@ -365,6 +371,7 @@ else fi ]) + AC_DEFUN(APR_CHECK_INET_NETWORK,[ AC_CACHE_CHECK(for inet_network, ac_cv_func_inet_network,[ AC_TRY_COMPILE([ @@ -390,6 +397,7 @@ else fi ]) + AC_DEFUN(APR_CHECK_SOCKADDR_IN6,[ AC_CACHE_CHECK(for sockaddr_in6, ac_cv_define_sockaddr_in6,[ AC_TRY_COMPILE([ @@ -415,11 +423,11 @@ else fi ]) -# -# Check to see if this platform includes sa_len in it's -# struct sockaddr. If it does it changes the length of sa_family -# which could cause us problems -# +dnl +dnl Check to see if this platform includes sa_len in it's +dnl struct sockaddr. If it does it changes the length of sa_family +dnl which could cause us problems +dnl AC_DEFUN(APR_CHECK_SOCKADDR_SA_LEN,[ AC_CACHE_CHECK(for sockaddr sa_len, ac_cv_define_sockaddr_sa_len,[ AC_TRY_COMPILE([ @@ -444,6 +452,7 @@ if test "$ac_cv_define_sockaddr_sa_len" = "yes"; then fi ]) + dnl dnl APR_INADDR_NONE dnl @@ -478,6 +487,7 @@ unsigned long foo = INADDR_NONE; fi ]) + dnl dnl APR_CHECK_H_ERRNO_FLAG dnl @@ -531,6 +541,3 @@ AC_DEFUN(APR_CHECK_H_ERRNO_FLAG,[ AC_MSG_RESULT([$ac_cv_h_errno_cflags]) fi ]) - -sinclude(apr_common.m4) -sinclude(hints.m4) From 10f989b76eb9d65825b2cdb072e005f93746d3a0 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Tue, 9 Jan 2001 10:50:47 +0000 Subject: [PATCH 1055/7878] add missing newline git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61036 13f79535-47bb-0310-9956-ffa450edef68 --- README.dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.dev b/README.dev index ba23429a486..8819a7ce1f9 100644 --- a/README.dev +++ b/README.dev @@ -10,4 +10,4 @@ this means using a slightly non-standard build process. 3) make Currently, there is no make install step, as APR is not yet -installable. \ No newline at end of file +installable. From 8d3405b6c41010ab41ce8f756b7d6a34487670c1 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Tue, 9 Jan 2001 11:06:28 +0000 Subject: [PATCH 1056/7878] Libtool-ize APR. To simplify the task, I also shifted the Makefiles to include a rules.mk (based on APRUTIL's with a few tweaks). Still needs some work to remove the INCLUDES setup in all the Makefiles (these can be shared). buildconf now does more work (and generates some output) aclocal.m4 is based on a number of M4 files, rather than standalone apr/test/ has been updated but is probably broken in a few ways. objs/ is now gone. we link directly from the .lo files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61037 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 6 +- CHANGES | 3 + Makefile.in | 94 ++----- STATUS | 11 +- aclocal.m4 | 536 ------------------------------------ buildconf | 28 ++ configure.in | 39 ++- dso/aix/.cvsignore | 3 + dso/aix/Makefile.in | 35 +-- dso/beos/.cvsignore | 3 +- dso/beos/Makefile.in | 36 +-- dso/os2/.cvsignore | 2 + dso/os2/Makefile.in | 37 +-- dso/os390/.cvsignore | 2 + dso/os390/Makefile.in | 34 +-- dso/unix/.cvsignore | 2 + dso/unix/Makefile.in | 38 +-- file_io/os2/.cvsignore | 2 + file_io/os2/Makefile.in | 55 ++-- file_io/unix/.cvsignore | 2 + file_io/unix/Makefile.in | 48 ++-- helpers/.cvsignore | 3 + helpers/apr-conf.m4 | 7 - helpers/rules.mk.in | 162 +++++++++++ i18n/unix/.cvsignore | 2 + i18n/unix/Makefile.in | 29 +- lib/.cvsignore | 2 + lib/Makefile.in | 30 +- locks/beos/.cvsignore | 2 + locks/beos/Makefile.in | 39 +-- locks/os2/.cvsignore | 2 + locks/os2/Makefile.in | 36 +-- locks/unix/.cvsignore | 2 + locks/unix/Makefile.in | 34 +-- misc/unix/.cvsignore | 2 + misc/unix/Makefile.in | 32 +-- mmap/unix/.cvsignore | 2 + mmap/unix/Makefile.in | 31 +-- network_io/beos/.cvsignore | 2 + network_io/beos/Makefile.in | 38 +-- network_io/os2/.cvsignore | 2 + network_io/os2/Makefile.in | 51 +--- network_io/unix/.cvsignore | 2 + network_io/unix/Makefile.in | 44 +-- passwd/.cvsignore | 2 + passwd/Makefile.in | 31 +-- shmem/os2/.cvsignore | 2 + shmem/os2/Makefile.in | 36 +-- shmem/unix/.cvsignore | 2 + shmem/unix/Makefile.in | 44 +-- strings/.cvsignore | 2 + strings/Makefile.in | 39 +-- tables/.cvsignore | 2 + tables/Makefile.in | 31 +-- test/.cvsignore | 3 +- test/Makefile.in | 120 ++++---- threadproc/beos/.cvsignore | 2 + threadproc/beos/Makefile.in | 45 +-- threadproc/os2/.cvsignore | 2 + threadproc/os2/Makefile.in | 43 +-- threadproc/unix/.cvsignore | 2 + threadproc/unix/Makefile.in | 40 +-- time/unix/.cvsignore | 2 + time/unix/Makefile.in | 30 +- user/unix/.cvsignore | 2 + user/unix/Makefile.in | 29 +- 66 files changed, 584 insertions(+), 1499 deletions(-) delete mode 100644 aclocal.m4 create mode 100644 dso/aix/.cvsignore create mode 100644 helpers/.cvsignore create mode 100644 helpers/rules.mk.in diff --git a/.cvsignore b/.cvsignore index 6825bfc7b4c..3fe91f1e2a0 100644 --- a/.cvsignore +++ b/.cvsignore @@ -3,9 +3,8 @@ config.cache config.log config.status configure +libtool APRVARS -objs -.deps LibD LibR Debug @@ -14,3 +13,6 @@ Release *.opt *.plg apr.exports +aclocal.m4 +.libs +*.la diff --git a/CHANGES b/CHANGES index 136baf0ea7a..f62e8d7a0db 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Libtool'ized APR and converted all the makefiles to share rules + from helpers/rules.mk. [Greg Stein] + *) Remove a warning on FreeBSD. FreeBSD defines TCP_NO_PUSH, but we don't actually use it. This causes os_cork to be defined but not used. This patch keeps us from defining os_cork and os_uncork on diff --git a/Makefile.in b/Makefile.in index d7b1be31051..7b9738a5dd4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,21 +1,7 @@ # # APR (Apache Portable Runtime) library Makefile. # -SHELL=@SH@ -# -# Macros for compilation commands -# -@SET_MAKE@ -MFLAGS_STATIC= -RM=@RM@ -CC=@CC@ -AWK=@AWK@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -AR=@AR@ -RANLIB=@RANLIB@ # # Macros for supporting directories # @@ -30,81 +16,33 @@ MODULES=@MODULES@ SUBDIRS=@SUBDIRS@ #shmem/@OSDIR@ -LIBAPR = @LIBPREFIX@apr.a +LIBAPR = @LIBPREFIX@apr.la TARGET_EXPORTS = apr.exports -# -# Rules for turning inputs into outputs -# -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - # # Rules for building specific targets, starting with 'all' for # building the entire package. # -all: Makefile $(LIBAPR) delete-exports $(TARGET_EXPORTS) - -$(LIBAPR): $(MODULES) subdirs - @rm -rf objs - @mkdir objs - @rm -f $@ - for i in $(SUBDIRS); do cp $$i/*.o objs ; done; - $(AR) cr $@ objs/*.o - $(RANLIB) $@ - -clean: subdirs_clean - $(RM) -f *.o *.a *.so objs/*.o apr.exports - -depend: subdirs_depend - -distclean: subdirs_distclean - -$(RM) -f include/apr.h include/arch/unix/apr_private.h - -$(RM) -f *.o *.a *.so - -$(RM) -f config.cache config.status config.log - -$(RM) -f Makefile - -$(RM) -f APRVARS - -$(RM) -rf objs - cd test; $(MAKE) distclean; cd .. - -extraclean: distclean - -$(RM) -f configure include/arch/unix/apr_private.h.in - -subdirs: - @for i in $(SUBDIRS); do \ - echo "===> $(SDP)lib/apr/$$i"; \ - ( cd $$i && $(MAKE) $(MFLAGS_STATIC) SDP='$(SDP)' \ - CC='$(CC)' AUX_CFLAGS='$(AUX_CFLAGS)' RANLIB='$(RANLIB)' ) \ - || exit 1; \ - echo "<=== $(SDP)lib/apr/$$i"; \ - done; +TARGETS = $(LIBAPR) delete-exports $(TARGET_EXPORTS) -subdirs_depend: - @for i in $(SUBDIRS); do \ - echo "===> $(SDP)lib/apr/$$i"; \ - ( cd $$i && $(MAKE) $(MFLAGS_STATIC) SDP='$(SDP)' depend ) \ - || exit 1; \ - echo "<=== $(SDP)lib/apr/$$i"; \ - done; +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -subdirs_clean: - @for i in $(SUBDIRS); do \ - echo "===> $(SDP)lib/apr/$$i"; \ - ( cd $$i && $(MAKE) $(MFLAGS_STATIC) SDP='$(SDP)' clean ) \ - || exit 1; \ - echo "<=== $(SDP)lib/apr/$$i"; \ - done; +CLEAN_TARGETS = $(TARGET_EXPORTS) +DISTCLEAN_TARGETS = config.cache config.log config.status \ + include/apr.h include/arch/unix/apr_private.h \ + APRVARS +EXTRACLEAN_TARGETS = configure libtool aclocal.m4 \ + include/arch/unix/apr_private.h.in -subdirs_distclean: - @for i in $(SUBDIRS); do \ - echo "===> $(SDP)lib/apr/$$i"; \ - ( cd $$i && $(MAKE) $(MFLAGS_STATIC) SDP='$(SDP)' distclean ) \ - || exit 1; \ - echo "<=== $(SDP)lib/apr/$$i"; \ - done; +### fix this up at some point (install location) +libdir = /usr/local/lib -install: all +$(LIBAPR): $(MODULES) + @for i in $(SUBDIRS); do objects="$$objects $$i/*.lo"; done ; \ + echo $(LINK) -rpath $(libdir) $$objects ; \ + $(LINK) -rpath $(libdir) $$objects delete-exports: @if test -f $(TARGET_EXPORTS); then \ diff --git a/STATUS b/STATUS index 2286868b2b9..6c5c01e8137 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/07 00:35:37 $] +Last modified at [$Date: 2001/01/09 11:05:33 $] Release: @@ -52,13 +52,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * The MM library is built as static and shared library. This should be set up to build only the required version. - * use libtool - Status: Greg +1 (volunteers), Ryan +1(?) - Waiting for commentary from jimjag - - * snarf rules.mk(.in) from APRUTIL to simplify makefiles - Status: Greg +1 (volunteers), Sascha +1, rbb -0.5 - * add apr_crypt() and APR_HAS_CRYPT for apps to determine whether the crypt() function is available, and a way to call it (whether it is located in libc, libcrypt, or libufc) @@ -93,6 +86,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * use os_(un)cork in network_io/unix/sendrecv.c for FreeBSD's sendfile implementation. + * toss the per-Makefile setup of INCLUDES; shift to rules.mk.in + Documentation that needs writing: diff --git a/aclocal.m4 b/aclocal.m4 deleted file mode 100644 index f8208317b7e..00000000000 --- a/aclocal.m4 +++ /dev/null @@ -1,536 +0,0 @@ -dnl ## -dnl ## -dnl ## -define(AC_USE_FUNCTION,[dnl -AC_CHECK_FUNCS($1) -if test ".$ac_func_$1" = .yes; then -AC_DEFINE(USE_$2) -fi -])dnl -dnl ## -dnl ## -dnl ## -AC_DEFUN(AC_CHECK_DEFINE_FILES,[ - AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ - ac_cv_define_$1=no - for curhdr in $2 - do - AC_EGREP_CPP(YES_IS_DEFINED, [ - #include <$curhdr> - #ifdef $1 - YES_IS_DEFINED - #endif - ], ac_cv_define_$1=yes) - done - ]) - if test "$ac_cv_define_$1" = "yes"; then - AC_DEFINE(HAVE_$1) - fi -]) -dnl ## -dnl ## -dnl ## -AC_DEFUN(AC_CHECK_DEFINE,[ - AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ - AC_EGREP_CPP(YES_IS_DEFINED, [ - #include <$2> - #ifdef $1 - YES_IS_DEFINED - #endif - ], ac_cv_define_$1=yes, ac_cv_define_$1=no) - ]) - if test "$ac_cv_define_$1" = "yes"; then - AC_DEFINE(HAVE_$1) - fi -]) -dnl ## -dnl ## -dnl ## -define(AC_IFALLYES,[dnl -ac_rc=yes -for ac_spec in $1; do - ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'` - ac_item=`echo "$ac_spec" | sed -e 's/^.*://'` - case $ac_type in - header ) - ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'` - ac_var="ac_cv_header_$ac_item" - ;; - file ) - ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'` - ac_var="ac_cv_file_$ac_item" - ;; - func ) ac_var="ac_cv_func_$ac_item" ;; - define ) ac_var="ac_cv_define_$ac_item" ;; - custom ) ac_var="$ac_item" ;; - esac - eval "ac_val=\$$ac_var" - if test ".$ac_val" != .yes; then - ac_rc=no - break - fi -done -if test ".$ac_rc" = .yes; then - : - $2 -else - : - $3 -fi -])dnl -dnl ## -dnl ## -dnl ## -define(AC_BEGIN_DECISION,[dnl -ac_decision_item='$1' -ac_decision_msg='FAILED' -ac_decision='' -])dnl -define(AC_DECIDE,[dnl -ac_decision='$1' -ac_decision_msg='$2' -ac_decision_$1=yes -ac_decision_$1_msg='$2' -])dnl -define(AC_DECISION_OVERRIDE,[dnl - ac_decision='' - for ac_item in $1; do - eval "ac_decision_this=\$ac_decision_${ac_item}" - if test ".$ac_decision_this" = .yes; then - ac_decision=$ac_item - eval "ac_decision_msg=\$ac_decision_${ac_item}_msg" - fi - done -])dnl -define(AC_DECISION_FORCE,[dnl -ac_decision="$1" -eval "ac_decision_msg=\"\$ac_decision_${ac_decision}_msg\"" -])dnl -define(AC_END_DECISION,[dnl -if test ".$ac_decision" = .; then - echo "[$]0:Error: decision on $ac_decision_item failed" 1>&2 - exit 1 -else - if test ".$ac_decision_msg" = .; then - ac_decision_msg="$ac_decision" - fi - AC_DEFINE_UNQUOTED(${ac_decision_item}) - AC_MSG_RESULT([decision on $ac_decision_item... $ac_decision_msg]) -fi -])dnl - -dnl ### AC_TRY_RUN had some problems actually using a programs return code, -dnl ### so I am re-working it here to be used in APR's configure script. -dnl MY_TRY_RUN(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE -dnl [, ACTION-IF-CROSS-COMPILING]]]) -AC_DEFUN(MY_TRY_RUN, -[if test "$cross_compiling" = yes; then - ifelse([$4], , - [errprint(__file__:__line__: warning: [AC_TRY_RUN] called without default to allow cross compiling -)dnl - AC_MSG_ERROR(can not run test program while cross compiling)], - [$4]) -else - MY_TRY_RUN_NATIVE([$1], [$2], [$3]) -fi -]) - -dnl Like AC_TRY_RUN but assumes a native-environment (non-cross) compiler. -dnl MY_TRY_RUN_NATIVE(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE]]) -AC_DEFUN(MY_TRY_RUN_NATIVE, -[cat > conftest.$ac_ext <<EOF -[#]line __oline__ "configure" -#include "confdefs.h" -ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus -extern "C" void exit(int); -#endif -])dnl -[$1] -EOF -if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then -dnl Don't remove the temporary files here, so they can be examined. - ifelse([$2], , :, [$2]) -else -ifelse([$3], , , [ $3 - rm -fr conftest* -])dnl -fi -rm -fr conftest*]) -dnl A variant of AC_CHECK_SIZEOF which allows the checking of -dnl sizes of non-builtin types -dnl AC_CHECK_SIZEOF_EXTENDED(INCLUDES, TYPE [, CROSS_SIZE]) -AC_DEFUN(AC_CHECK_SIZEOF_EXTENDED, -[changequote(<<,>>)dnl -dnl The name to #define -define(<<AC_TYPE_NAME>>, translit(sizeof_$2, [a-z *], [A-Z_P]))dnl -dnl The cache variable -define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$2, [ *],[<p>]))dnl -changequote([, ])dnl -AC_MSG_CHECKING(size of $2) -AC_CACHE_VAL(AC_CV_NAME, -[AC_TRY_RUN([#include <stdio.h> -$1 -main() -{ - FILE *f=fopen("conftestval","w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof($2)); - exit(0); -}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$3],,, -AC_CV_NAME=$3))])dnl -AC_MSG_RESULT($AC_CV_NAME) -AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) -undefine([AC_TYPE_NAME])dnl -undefine([AC_CV_NAME])dnl -]) - -dnl -dnl check for working getaddrinfo() -dnl - -AC_DEFUN(APR_CHECK_WORKING_GETADDRINFO,[ - AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[ - AC_TRY_RUN( [ -#ifdef HAVE_NETDB_H -#include <netdb.h> -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif - -void main(void) { - struct addrinfo hints, *ai; - int error; - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - error = getaddrinfo("127.0.0.1", "8080", &hints, &ai); - if (error) { - exit(1); - } - else { - exit(0); - } -} -],[ - ac_cv_working_getaddrinfo="yes" -],[ - ac_cv_working_getaddrinfo="no" -],[ - ac_cv_working_getaddrinfo="yes" -])]) -if test "$ac_cv_working_getaddrinfo" = "yes"; then - AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works well enough for APR]) -fi -]) - -dnl -dnl check for gethostbyname() which handles numeric address strings -dnl - -AC_DEFUN(APR_CHECK_GETHOSTBYNAME_NAS,[ - AC_CACHE_CHECK(for gethostbyname() which handles numeric address strings, ac_cv_gethostbyname_nas,[ - AC_TRY_RUN( [ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#ifdef HAVE_ARPA_INET_H -#include <arpa/inet.h> -#endif -#ifdef HAVE_NETDB_H -#include <netdb.h> -#endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -void main(void) { - struct hostent *he = gethostbyname("127.0.0.1"); - if (he == NULL) { - exit(1); - } - else { - exit(0); - } -} -],[ - ac_cv_gethostbyname_nas="yes" -],[ - ac_cv_gethostbyname_nas="no" -],[ - ac_cv_gethostbyname_nas="yes" -])]) -if test "$ac_cv_gethostbyname_nas" = "yes"; then - AC_DEFINE(GETHOSTBYNAME_HANDLES_NAS, 1, [Define if gethostbyname() handles nnn.nnn.nnn.nnn]) -fi -]) - -dnl -dnl check for socklen_t, fall back to unsigned int -dnl - -AC_DEFUN(APR_CHECK_SOCKLEN_T,[ -AC_CACHE_CHECK(for socklen_t, ac_cv_socklen_t,[ -AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -],[ -socklen_t foo = (socklen_t) 0; -],[ - ac_cv_socklen_t=yes -],[ - ac_cv_socklen_t=no -]) -]) - -if test "$ac_cv_socklen_t" = "yes"; then - AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t]) -fi -]) - -dnl Check for ranlib but, unlike the check provided with autoconf, set -dnl RANLIB to "true" if there is no ranlib instead of setting it to ":". -dnl OS/390 doesn't have ranlib and the make utility doesn't parse "RANLIB=:" -dnl the way we might want it to. - -AC_DEFUN(AC_PROG_RANLIB_NC, -[AC_CHECK_TOOL(RANLIB, ranlib, true)]) - -AC_DEFUN(APR_EBCDIC,[ - AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ - AC_TRY_RUN( [ -int main(void) { - return (unsigned char)'A' != (unsigned char)0xC1; -} -],[ - ac_cv_ebcdic="yes" -],[ - ac_cv_ebcdic="no" -],[ - ac_cv_ebcdic="no" -])]) - if test "$ac_cv_ebcdic" = "yes"; then - apr_charset_ebcdic=1 - else - apr_charset_ebcdic=0 - fi - AC_SUBST(apr_charset_ebcdic) -]) - -AC_DEFUN(APR_PREPARE_MM_DIR,[ -dnl #----------------------------- Prepare mm directory for VPATH support -if test -n "$USE_MM" && test -n "$USE_VPATH"; then - test -d $mm_dir || $MKDIR $mm_dir - - for i in shtool config.guess config.sub fbtool ltconfig \ - ltmain.sh mm_vers.c; do - test -r $mm_dir/$i || ln -s $abs_srcdir/$mm_dir/$i $mm_dir/$i - done -fi -]) - -AC_DEFUN(APR_CHECK_INET_ADDR,[ -AC_CACHE_CHECK(for inet_addr, ac_cv_func_inet_addr,[ -AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_ARPA_INET_H -#include <arpa/inet.h> -#endif -],[ -inet_addr("127.0.0.1"); -],[ - ac_cv_func_inet_addr=yes -],[ - ac_cv_func_inet_addr=no -]) -]) - -if test "$ac_cv_func_inet_addr" = "yes"; then - have_inet_addr=1 -else - have_inet_addr=0 -fi -]) - -AC_DEFUN(APR_CHECK_INET_NETWORK,[ -AC_CACHE_CHECK(for inet_network, ac_cv_func_inet_network,[ -AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_ARPA_INET_H -#include <arpa/inet.h> -#endif -],[ -inet_network("127.0.0.1"); -],[ - ac_cv_func_inet_network=yes -],[ - ac_cv_func_inet_network=no -]) -]) - -if test "$ac_cv_func_inet_network" = "yes"; then - have_inet_network=1 -else - have_inet_network=0 -fi -]) - -AC_DEFUN(APR_CHECK_SOCKADDR_IN6,[ -AC_CACHE_CHECK(for sockaddr_in6, ac_cv_define_sockaddr_in6,[ -AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -],[ -struct sockaddr_in6 sa; -],[ - ac_cv_define_sockaddr_in6=yes -],[ - ac_cv_define_sockaddr_in6=no -]) -]) - -if test "$ac_cv_define_sockaddr_in6" = "yes"; then - have_sockaddr_in6=1 -else - have_sockaddr_in6=0 -fi -]) - -# -# Check to see if this platform includes sa_len in it's -# struct sockaddr. If it does it changes the length of sa_family -# which could cause us problems -# -AC_DEFUN(APR_CHECK_SOCKADDR_SA_LEN,[ -AC_CACHE_CHECK(for sockaddr sa_len, ac_cv_define_sockaddr_sa_len,[ -AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -],[ -struct sockaddr_in sai; -int i = sai.sin_len; -],[ - ac_cv_define_sockaddr_sa_len=yes -],[ - ac_cv_define_sockaddr_sa_len=no -]) -]) - -if test "$ac_cv_define_sockaddr_sa_len" = "yes"; then - AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1 ,[Define if we have length field in sockaddr_in]) -fi -]) - -dnl -dnl APR_INADDR_NONE -dnl -dnl checks for missing INADDR_NONE macro -dnl -AC_DEFUN(APR_INADDR_NONE,[ - AC_CACHE_CHECK(whether system defines INADDR_NONE, ac_cv_inaddr_none,[ - AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#ifdef HAVE_ARPA_INET_H -#include <arpa/inet.h> -#endif -],[ -unsigned long foo = INADDR_NONE; -],[ - ac_cv_inaddr_none=yes -],[ - ac_cv_inaddr_none=no -])]) - if test "$ac_cv_inaddr_none" = "no"; then - apr_inaddr_none="((unsigned int) 0xffffffff)" - else - apr_inaddr_none="INADDR_NONE" - fi -]) - -dnl -dnl APR_CHECK_H_ERRNO_FLAG -dnl -dnl checks which flags are necessary for <netdb.h> to define h_errno -dnl -AC_DEFUN(APR_H_ERRNO_COMPILE_CHECK,[ - if test x$1 != x; then - CFLAGS="-D$1 $CFLAGS" - fi - AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_NETDB_H -#include <netdb.h> -#endif -],[ -int h_e = h_errno; -],[ - if test x$1 != x; then - ac_cv_h_errno_cflags="$1" - else - ac_cv_h_errno_cflags=yes - fi -],[ - ac_cv_h_errno_cflags=no -])]) -AC_DEFUN(APR_CHECK_H_ERRNO_FLAG,[ - AC_MSG_CHECKING([for h_errno in netdb.h]) - AC_CACHE_VAL(ac_cv_h_errno_cflags,[ - APR_H_ERRNO_COMPILE_CHECK - if test "$ac_cv_h_errno_cflags" = "no"; then - ac_save="$CFLAGS" - for flag in _XOPEN_SOURCE_EXTENDED; do - APR_H_ERRNO_COMPILE_CHECK($flag) - if test "$ac_cv_h_errno_cflags" != "no"; then - break - fi - done - CFLAGS="$ac_save" - fi - ]) - if test "$ac_cv_h_errno_cflags" != "no"; then - if test "$ac_cv_h_errno_cflags" != "yes"; then - CFLAGS="-D$ac_cv_h_errno_cflags $CFLAGS" - AC_MSG_RESULT([yes, with -D$ac_cv_h_errno_cflags]) - else - AC_MSG_RESULT([$ac_cv_h_errno_cflags]) - fi - else - AC_MSG_RESULT([$ac_cv_h_errno_cflags]) - fi -]) - -sinclude(apr_common.m4) -sinclude(hints.m4) diff --git a/buildconf b/buildconf index e0cae5e0d2e..3b780217f56 100755 --- a/buildconf +++ b/buildconf @@ -1,6 +1,34 @@ #!/bin/sh +# +# Build aclocal.m4 from libtool's libtool.m4 and our own M4 files. +# +ltpath=`helpers/PrintPath libtoolize` +ltpath=`dirname $ltpath` +ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 +echo "Incorporating $ltfile into aclocal.m4 ..." +echo "dnl THIS FILE IS AUTOMATICALLY GENERATED BY buildconf" > aclocal.m4 +echo "dnl edits here will be lost" >> aclocal.m4 +cat helpers/apr-conf.m4 apr_common.m4 hints.m4 $ltfile >> aclocal.m4 + +# +# Create the libtool helper files +# +# Note: we copy (rather than link) them to simplify distribution. +# Note: APR supplies its own config.guess and config.sub -- we do not +# rely on libtool's versions +# +echo "Copying libtool helper files ..." +$ltpath/libtoolize --copy + +# +# Generate the autoconf header and ./configure +# +echo "Creating include/arch/unix/apr_private.h.in ..." autoheader + +echo "Creating configure ..." +### do some work to toss config.cache? autoconf (cd shmem/unix/mm && autoconf) diff --git a/configure.in b/configure.in index eec40e72b5c..f6dbeb00929 100644 --- a/configure.in +++ b/configure.in @@ -22,6 +22,10 @@ dnl Absolute source/build directory abs_srcdir=`(cd $srcdir && pwd)` abs_builddir=`pwd` +dnl Libtool needs this symbol +top_builddir="$abs_srcdir" +AC_SUBST(top_builddir) + dnl Get location of helpers directory dnl XXX This assumes that APR "lives" under Apache. dnl XXX We'll need to fix this when we pull it out. @@ -42,12 +46,10 @@ LIBPREFIX='lib' dnl # Checks for programs. AC_PROG_CC -AC_PROG_RANLIB_NC AC_PROG_MAKE_SET AC_PROG_AWK AC_CHECK_PROG(RM, rm, rm) AC_CHECK_TOOL(AR, ar, ar) -SO_LDFLAG="-shared" # This macro needs to be here in case we are on an AIX box. AC_AIX @@ -60,6 +62,12 @@ if test ".$SH" = . -a -f /bin/sh; then fi AC_CHECK_PROG(SH, sh, sh) +dnl +dnl prep libtool +dnl +echo "performing libtool configuration..." +AC_PROG_LIBTOOL + dnl #----------------------------- Checks for compiler flags nl=' ' @@ -106,7 +114,6 @@ case "$OS" in USE_MM=yes AC_CHECK_DEFINE(BONE_VERSION, sys/socket.h) eolstr="\\n" - SO_LDFLAG="-nostart" ;; *os390) OSDIR="os390" @@ -123,7 +130,6 @@ case "$OS" in esac AC_SUBST(eolstr) -AC_SUBST(SO_LDFLAG) dnl #----------------------------- Checking for Shared Memory Support echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" @@ -851,7 +857,6 @@ dnl #----------------------------- Construct the files AC_SUBST(LDLIBS) AC_SUBST(OPTIM) -AC_SUBST(RANLIB) AC_SUBST(AR) AC_SUBST(RM) AC_SUBST(OSDIR) @@ -884,6 +889,19 @@ if test -n "$CPPFLAGS"; then CFLAGS="$CFLAGS $CPPFLAGS" fi +dnl +dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles +dnl +case "$host_alias" in +*bsdi*) + INCLUDE_RULES=".include \"$top_builddir/helpers/rules.mk\"" + ;; +*) + INCLUDE_RULES="include $top_builddir/helpers/rules.mk" + ;; +esac +AC_SUBST(INCLUDE_RULES) + SAVE_FILES="include/apr.h include/arch/unix/apr_private.h" for i in $SAVE_FILES; do @@ -893,10 +911,12 @@ done dir=include/arch/unix test -d $dir || $MKDIR $dir -AC_OUTPUT($MAKEFILE1 $MAKEFILE2 $MAKEFILE3 include/apr.h APRVARS,[ - -SAVE_FILES="include/apr.h include/apr_private.h" - +AC_OUTPUT([ + $MAKEFILE1 $MAKEFILE2 $MAKEFILE3 + include/apr.h + APRVARS + helpers/rules.mk +],[ for i in $SAVE_FILES; do if cmp -s $i $i.save 2>/dev/null; then mv $i.save $i @@ -904,7 +924,6 @@ for i in $SAVE_FILES; do fi rm -f $i.save done - ]) dnl #----------------------------- Fixup Makefiles for VPATH support diff --git a/dso/aix/.cvsignore b/dso/aix/.cvsignore new file mode 100644 index 00000000000..06e18a7aafb --- /dev/null +++ b/dso/aix/.cvsignore @@ -0,0 +1,3 @@ +Makefile +*.lo +.libs diff --git a/dso/aix/Makefile.in b/dso/aix/Makefile.in index 22ac4f1f8c9..1fed5511423 100644 --- a/dso/aix/Makefile.in +++ b/dso/aix/Makefile.in @@ -1,35 +1,10 @@ -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch -MKDEP=../../helpers/mkdep.sh - -LIB=libdso.a - -OBJS=dso.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< -all: $(LIB) +TARGETS = dso.lo -clean: - $(RM) -f *.o *.a *.so +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch # DO NOT REMOVE diff --git a/dso/beos/.cvsignore b/dso/beos/.cvsignore index 550bd25cdba..06e18a7aafb 100644 --- a/dso/beos/.cvsignore +++ b/dso/beos/.cvsignore @@ -1,2 +1,3 @@ Makefile - +*.lo +.libs diff --git a/dso/beos/Makefile.in b/dso/beos/Makefile.in index 266554101de..7599158d22c 100644 --- a/dso/beos/Makefile.in +++ b/dso/beos/Makefile.in @@ -1,35 +1,11 @@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../include -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -LIB=libdso.a - -OBJS=dso.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< -all: $(LIB) +TARGETS = dso.lo -clean: - $(RM) -f *.o *.a *.so +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c +INCDIR=../../include +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch -I$(DEFOSDIR) # DO NOT REMOVE diff --git a/dso/os2/.cvsignore b/dso/os2/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/dso/os2/.cvsignore +++ b/dso/os2/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/dso/os2/Makefile.in b/dso/os2/Makefile.in index ba2385b0ada..fe018d7d403 100644 --- a/dso/os2/Makefile.in +++ b/dso/os2/Makefile.in @@ -1,37 +1,12 @@ -SHELL=@SH@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) + +TARGETS = dso.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -LIB=libdso.a - -OBJS=dso.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(LIB) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE diff --git a/dso/os390/.cvsignore b/dso/os390/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/dso/os390/.cvsignore +++ b/dso/os390/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/dso/os390/Makefile.in b/dso/os390/Makefile.in index 134195b6847..1fed5511423 100644 --- a/dso/os390/Makefile.in +++ b/dso/os390/Makefile.in @@ -1,34 +1,10 @@ -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch -MKDEP=../../helpers/mkdep.sh - -LIB=libdso.a - -OBJS=dso.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< -all: $(LIB) +TARGETS = dso.lo -clean: - $(RM) -f *.o *.a *.so +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -distclean: clean - -$(RM) -f Makefile - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch # DO NOT REMOVE diff --git a/dso/unix/.cvsignore b/dso/unix/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/dso/unix/.cvsignore +++ b/dso/unix/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/dso/unix/Makefile.in b/dso/unix/Makefile.in index c3d9c2b42dc..21cac34c21e 100644 --- a/dso/unix/Makefile.in +++ b/dso/unix/Makefile.in @@ -1,38 +1,12 @@ -RM=@RM@ -CC=@CC@ -AR=@AR@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) + +TARGETS = dso.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + INCDIR=../../include INCDIR2=$(INCDIR)/arch INCDIR3=$(INCDIR)/arch/unix INCLUDES=-I$(INCDIR) -I$(INCDIR2) -I$(INCDIR3) -MKDEP=../../helpers/mkdep.sh - -LIB=libdso.a - -OBJS=dso.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(LIB) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE diff --git a/file_io/os2/.cvsignore b/file_io/os2/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/file_io/os2/.cvsignore +++ b/file_io/os2/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index f413b3dac39..50c758437c0 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -1,45 +1,22 @@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) + +TARGETS = \ + dir.lo \ + fileacc.lo \ + filedup.lo \ + filestat.lo \ + open.lo \ + pipe.lo \ + readwrite.lo \ + seek.lo \ + flock.lo \ + maperrorcode.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -LIB=file.a - -OBJS=dir.o \ - fileacc.o \ - filedup.o \ - filestat.o \ - open.o \ - pipe.o \ - readwrite.o \ - seek.o \ - flock.o \ - maperrorcode.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(LIB) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE diff --git a/file_io/unix/.cvsignore b/file_io/unix/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/file_io/unix/.cvsignore +++ b/file_io/unix/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index d437f01579a..d612ce1987b 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -1,38 +1,22 @@ -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) + +TARGETS = \ + dir.lo \ + fileacc.lo \ + filedup.lo \ + filestat.lo \ + flock.lo \ + fullrw.lo \ + open.lo \ + pipe.lo \ + readwrite.lo \ + seek.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -OBJS=dir.o \ - fileacc.o \ - filedup.o \ - filestat.o \ - flock.o \ - fullrw.o \ - open.o \ - pipe.o \ - readwrite.o \ - seek.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(OBJS) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE diff --git a/helpers/.cvsignore b/helpers/.cvsignore new file mode 100644 index 00000000000..62437018a1f --- /dev/null +++ b/helpers/.cvsignore @@ -0,0 +1,3 @@ +ltconfig +ltmain.sh +rules.mk diff --git a/helpers/apr-conf.m4 b/helpers/apr-conf.m4 index ce041ca1cb1..cc01104399f 100644 --- a/helpers/apr-conf.m4 +++ b/helpers/apr-conf.m4 @@ -303,13 +303,6 @@ if test "$ac_cv_socklen_t" = "yes"; then fi ]) -dnl Check for ranlib but, unlike the check provided with autoconf, set -dnl RANLIB to "true" if there is no ranlib instead of setting it to ":". -dnl OS/390 doesn't have ranlib and the make utility doesn't parse "RANLIB=:" -dnl the way we might want it to. -AC_DEFUN(AC_PROG_RANLIB_NC, -[AC_CHECK_TOOL(RANLIB, ranlib, true)]) - AC_DEFUN(APR_EBCDIC,[ AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ diff --git a/helpers/rules.mk.in b/helpers/rules.mk.in new file mode 100644 index 00000000000..efc8696b65b --- /dev/null +++ b/helpers/rules.mk.in @@ -0,0 +1,162 @@ +# ==================================================================== +# The Apache Software License, Version 1.1 +# +# Copyright (c) 2000 The Apache Software Foundation. All rights +# reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3. The end-user documentation included with the redistribution, +# if any, must include the following acknowledgment: +# "This product includes software developed by the +# Apache Software Foundation (http://www.apache.org/)." +# Alternately, this acknowledgment may appear in the software itself, +# if and wherever such third-party acknowledgments normally appear. +# +# 4. The names "Apache" and "Apache Software Foundation" must +# not be used to endorse or promote products derived from this +# software without prior written permission. For written +# permission, please contact apache@apache.org. +# +# 5. Products derived from this software may not be called "Apache", +# nor may "Apache" appear in their name, without prior written +# permission of the Apache Software Foundation. +# +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR +# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# ==================================================================== +# +# This software consists of voluntary contributions made by many +# individuals on behalf of the Apache Software Foundation. For more +# information on the Apache Software Foundation, please see +# <http://www.apache.org/>. +# + +# +# rules.mk: standard rules for APR +# + +@SET_MAKE@ + +# +# Configuration variables +# +top_builddir=@top_builddir@ + +CC=@CC@ +AWK=@AWK@ +LIBTOOL=@LIBTOOL@ + +CFLAGS=@CFLAGS@ @OPTIM@ $(INCLUDES) +LIBS=@LIBS@ +LDFLAGS=@LDFLAGS@ + +RM=@RM@ +SHELL=@SHELL@ + +### make LTFLAGS somewhat variable? +LTFLAGS = --silent + +MKDEP=$(top_builddir)/helpers/mkdep.sh + +# +# Basic macro setup +# +COMPILE = $(CC) $(CFLAGS) +LT_COMPILE = $(LIBTOOL) --mode=compile $(LTFLAGS) $(COMPILE) -c $< && touch $@ + +LINK = $(LIBTOOL) --mode=link $(LTFLAGS) $(COMPILE) $(LDFLAGS) -o $@ + +# +# Standard build rules +# +all: all-recursive +depend: depend-recursive +clean: clean-recursive +distclean: distclean-recursive +extraclean: extraclean-recursive + +install: all-recursive + + +all-recursive depend-recursive clean-recursive distclean-recursive \ + extraclean-recursive: + @otarget=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; \ + for i in $$list; do \ + if test -d "$$i"; then \ + target="$$otarget"; \ + echo "Making $$target in $$i"; \ + if test "$$i" = "."; then \ + made_local=yes; \ + target="local-$$target"; \ + fi; \ + (cd $$i && $(MAKE) $$target) || exit 1; \ + fi; \ + done; \ + if test "$$otarget" = "all" && test -z "$(TARGETS)"; then \ + made_local=n/a; \ + fi; \ + if test -z "$$made_local"; then \ + $(MAKE) "local-$$otarget" || exit 1; \ + fi + +local-clean: x-local-clean + $(RM) -f *.o *.lo *.a *.la *.so $(CLEAN_TARGETS) $(PROGRAMS) + $(RM) -rf .libs + +local-distclean: local-clean x-local-distclean + $(RM) -f Makefile $(DISTCLEAN_TARGETS) + +local-extraclean: local-distclean + @if test -n "$(EXTRACLEAN_TARGETS)"; then \ + echo $(RM) -f $(EXTRACLEAN_TARGETS) ; \ + $(RM) -f $(EXTRACLEAN_TARGETS) ; \ + fi + +local-all: $(TARGETS) + +local-depend: + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c + +# to be filled in by the actual Makefile +x-local-clean x-local-distclean: + + +# +# Implicit rules for creating outputs from input files +# +.SUFFIXES: +.SUFFIXES: .c .lo .o + +.c.o: + $(COMPILE) -c $< + +.c.lo: + $(LT_COMPILE) + +.PHONY: all depend clean distclean extraclean install \ + all-recursive depend-recursive clean-recursive distclean-recursive \ + extraclean-recursive + local-all local-depend local-clean local-distclean local-extraclean \ + x-local-clean x-local-distclean diff --git a/i18n/unix/.cvsignore b/i18n/unix/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/i18n/unix/.cvsignore +++ b/i18n/unix/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/i18n/unix/Makefile.in b/i18n/unix/Makefile.in index 0e35098c02d..b04b1c301ed 100644 --- a/i18n/unix/Makefile.in +++ b/i18n/unix/Makefile.in @@ -1,28 +1,11 @@ -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -OBJS=xlate.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< -all: $(OBJS) +TARGETS = xlate.lo -clean: - $(RM) -f *.o *.a *.so +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -distclean: clean - -$(RM) -f Makefile - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) # DO NOT REMOVE diff --git a/lib/.cvsignore b/lib/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/lib/.cvsignore +++ b/lib/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/lib/Makefile.in b/lib/Makefile.in index 74761502dcb..1169f7418fc 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -1,30 +1,12 @@ -CC=@CC@ -RANLIB=@RANLIB@ -AR=@AR@ -RM=@RM@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) + +TARGETS = apr_pools.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + INCDIR=../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -MKDEP=../helpers/mkdep.sh - -OBJS=apr_pools.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(OBJS) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE diff --git a/locks/beos/.cvsignore b/locks/beos/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/locks/beos/.cvsignore +++ b/locks/beos/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in index 40afc8c6910..e0a13869c9a 100644 --- a/locks/beos/Makefile.in +++ b/locks/beos/Makefile.in @@ -1,36 +1,13 @@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch -MKDEP=../../helpers/mkdep.sh - -LIB=liblock.a - -OBJS=locks.o \ - crossproc.o \ - intraproc.o \ - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< -all: $(LIB) +TARGETS = + locks.lo \ + crossproc.lo \ + intraproc.lo \ -clean: - $(RM) -f *.o *.a *.so +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch # DO NOT REMOVE diff --git a/locks/os2/.cvsignore b/locks/os2/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/locks/os2/.cvsignore +++ b/locks/os2/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/locks/os2/Makefile.in b/locks/os2/Makefile.in index 7ecd8cf8788..93092897580 100644 --- a/locks/os2/Makefile.in +++ b/locks/os2/Makefile.in @@ -1,36 +1,12 @@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) + +TARGETS = locks.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -LIB=lock.a - -OBJS=locks.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(LIB) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE diff --git a/locks/unix/.cvsignore b/locks/unix/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/locks/unix/.cvsignore +++ b/locks/unix/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index 30530fedbfe..d375b3a74bb 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -1,31 +1,15 @@ -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) + +TARGETS = \ + locks.lo \ + crossproc.lo \ + intraproc.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + INCDIR=../../include INCDIR2=$(INCDIR)/arch INCDIR3=$(INCDIR)/arch/unix INCLUDES=-I$(INCDIR) -I$(INCDIR2) -I$(INCDIR3) -MKDEP=../../helpers/mkdep.sh - -OBJS=locks.o \ - crossproc.o \ - intraproc.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(OBJS) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE diff --git a/misc/unix/.cvsignore b/misc/unix/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/misc/unix/.cvsignore +++ b/misc/unix/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index ec50abb0ede..729af2a6f86 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -1,30 +1,14 @@ -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) + +TARGETS = \ + start.lo getopt.lo otherchild.lo errorcodes.lo rand.lo \ + uuid.lo getuuid.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -OBJS=start.o getopt.o otherchild.o errorcodes.o rand.o \ - uuid.o getuuid.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(OBJS) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE diff --git a/mmap/unix/.cvsignore b/mmap/unix/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/mmap/unix/.cvsignore +++ b/mmap/unix/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/mmap/unix/Makefile.in b/mmap/unix/Makefile.in index 9fc7221ba24..65e880addaa 100644 --- a/mmap/unix/Makefile.in +++ b/mmap/unix/Makefile.in @@ -1,30 +1,11 @@ -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -LIB=libmmap.a - -OBJS=mmap.o common.o -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< +TARGETS = mmap.lo common.lo -all: $(OBJS) +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) # DO NOT REMOVE diff --git a/network_io/beos/.cvsignore b/network_io/beos/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/network_io/beos/.cvsignore +++ b/network_io/beos/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/network_io/beos/Makefile.in b/network_io/beos/Makefile.in index f7477ef662e..1c767812fd4 100644 --- a/network_io/beos/Makefile.in +++ b/network_io/beos/Makefile.in @@ -1,38 +1,12 @@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) + +TARGETS = poll.lo sendrecv.lo socketcommon.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -LIB=libnetwork.a - -OBJS=poll.o \ - sendrecv.o \ - socketcommon.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(LIB) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE diff --git a/network_io/os2/.cvsignore b/network_io/os2/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/network_io/os2/.cvsignore +++ b/network_io/os2/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/network_io/os2/Makefile.in b/network_io/os2/Makefile.in index e5077ea8af3..543a36e158d 100644 --- a/network_io/os2/Makefile.in +++ b/network_io/os2/Makefile.in @@ -1,43 +1,20 @@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) + +TARGETS = \ + poll.lo \ + sendrecv.lo \ + sockets.lo \ + sockopt.lo \ + sockaddr.lo \ + inet_ntop.lo \ + inet_pton.lo \ + os2calls.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -LIB=network.a - -OBJS=poll.o \ - sendrecv.o \ - sockets.o \ - sockopt.o \ - sockaddr.o \ - inet_ntop.o \ - inet_pton.o \ - os2calls.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(LIB) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE diff --git a/network_io/unix/.cvsignore b/network_io/unix/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/network_io/unix/.cvsignore +++ b/network_io/unix/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/network_io/unix/Makefile.in b/network_io/unix/Makefile.in index 219f25bf7b1..07511f2702a 100644 --- a/network_io/unix/Makefile.in +++ b/network_io/unix/Makefile.in @@ -1,37 +1,19 @@ -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) + +TARGETS = \ + poll.lo \ + sendrecv.lo \ + sockets.lo \ + sockopt.lo \ + sockaddr.lo \ + inet_ntop.lo \ + inet_pton.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -LIB=libnetwork.a - -OBJS=poll.o \ - sendrecv.o \ - sockets.o \ - sockopt.o \ - sockaddr.o \ - inet_ntop.o \ - inet_pton.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(OBJS) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE diff --git a/passwd/.cvsignore b/passwd/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/passwd/.cvsignore +++ b/passwd/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/passwd/Makefile.in b/passwd/Makefile.in index b4c08ad4740..4104f39ab62 100644 --- a/passwd/Makefile.in +++ b/passwd/Makefile.in @@ -1,30 +1,11 @@ -CC=@CC@ -RANLIB=@RANLIB@ -AR=@AR@ -RM=@RM@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../include -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) -MKDEP=../helpers/mkdep.sh - -OBJS=apr_md5.o \ - apr_getpass.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< -all: $(OBJS) +TARGETS = apr_md5.lo apr_getpass.lo -clean: - $(RM) -f *.o *.a *.so +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -distclean: clean - -$(RM) -f Makefile - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c +INCDIR=../include +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) # DO NOT REMOVE diff --git a/shmem/os2/.cvsignore b/shmem/os2/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/shmem/os2/.cvsignore +++ b/shmem/os2/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/shmem/os2/Makefile.in b/shmem/os2/Makefile.in index 06e2dfdeea6..2c8d436407a 100644 --- a/shmem/os2/Makefile.in +++ b/shmem/os2/Makefile.in @@ -1,36 +1,12 @@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) + +TARGETS = shmem.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -LIB=shmem.a - -OBJS=shmem.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(LIB) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE diff --git a/shmem/unix/.cvsignore b/shmem/unix/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/shmem/unix/.cvsignore +++ b/shmem/unix/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/shmem/unix/Makefile.in b/shmem/unix/Makefile.in index 18c95cd9668..970591b2e58 100644 --- a/shmem/unix/Makefile.in +++ b/shmem/unix/Makefile.in @@ -1,41 +1,27 @@ -RM=@RM@ -CC=@CC@ -AR=@AR@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../include -INCDIR1=mm -INCLUDES=-I$(INCDIR) -I$(INCDIR1) -MKDEP=../../helpers/mkdep.sh - -LIB=libshmem.a -OBJS=shmem.o +TARGETS = shmem.lo build-mm -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -all: $(LIB) +INCDIR=../../include +INCDIR1=mm +INCLUDES=-I$(INCDIR) -I$(INCDIR1) -clean: - $(RM) -f *.o *.a *.so +x-local-clean: (cd mm && $(MAKE) clean) -distclean: clean - -$(RM) -f Makefile +x-local-distclean: (cd mm && $(MAKE) distclean) +# build the MM library, then copy the objects to this dir so our top-level +# will find them and copy them to the (top)/objs directory +MM_OBJS = \ + mm/mm_global.lo mm/mm_alloc.lo mm/mm_core.lo mm/mm_lib.lo \ + mm/mm_vers.lo -$(LIB): $(OBJS) - $(RM) -f $@ +build-mm: (cd mm && $(MAKE) libmm.la) - cp mm/mm_global.o mm/mm_alloc.o mm/mm_core.o mm/mm_lib.o mm/mm_vers.o . - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c + cp $(MM_OBJS) . # DO NOT REMOVE diff --git a/strings/.cvsignore b/strings/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/strings/.cvsignore +++ b/strings/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/strings/Makefile.in b/strings/Makefile.in index 2c10f2c2357..2c1425c5e21 100644 --- a/strings/Makefile.in +++ b/strings/Makefile.in @@ -1,33 +1,16 @@ -CC=@CC@ -RANLIB=@RANLIB@ -AR=@AR@ -RM=@RM@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCDIR=../include -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) -MKDEP=../helpers/mkdep.sh - -OBJS=apr_cpystrn.o \ - apr_snprintf.o \ - apr_strnatcmp.o \ - apr_strings.o \ - apr_fnmatch.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< -all: $(OBJS) +TARGETS = \ + apr_cpystrn.lo \ + apr_snprintf.lo \ + apr_strnatcmp.lo \ + apr_strings.lo \ + apr_fnmatch.lo -clean: - $(RM) -f *.o *.a *.so +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -distclean: clean - -$(RM) -f Makefile - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCDIR=../include +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) # DO NOT REMOVE diff --git a/tables/.cvsignore b/tables/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/tables/.cvsignore +++ b/tables/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/tables/Makefile.in b/tables/Makefile.in index 05aa28c76c0..3fd280bbff8 100644 --- a/tables/Makefile.in +++ b/tables/Makefile.in @@ -1,30 +1,11 @@ -CC=@CC@ -RANLIB=@RANLIB@ -AR=@AR@ -RM=@RM@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCDIR=../include -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) -MKDEP=../helpers/mkdep.sh - -OBJS=apr_tables.o \ - apr_hash.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< -all: $(OBJS) +TARGETS = apr_tables.lo apr_hash.lo -clean: - $(RM) -f *.o *.a *.so +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -distclean: clean - -$(RM) -f Makefile - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCDIR=../include +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) # DO NOT REMOVE diff --git a/test/.cvsignore b/test/.cvsignore index d2927e24117..ba64b9c0839 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -1,4 +1,6 @@ Makefile +*.lo +.libs testmd5 testmmap htdigest @@ -23,6 +25,5 @@ testuuid testsuite testsuite.opt testsuite.ncb -testflock.tmp testfile.tmp testflock diff --git a/test/Makefile.in b/test/Makefile.in index 7e4a52b3582..35953313c1e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,15 +1,6 @@ -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=-g @CFLAGS@ @OPTIM@ -LIBS=../libapr.a @LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../include -INCLUDES=-I$(INCDIR) -MKDEP=../helpers/mkdep.sh -SO_LDFLAG=@SO_LDFLAG@ -TARGETS= client@EXEEXT@ \ +TARGETS = \ + client@EXEEXT@ \ sendfile@EXEEXT@ \ server@EXEEXT@ \ testfile@EXEEXT@ \ @@ -29,90 +20,75 @@ TARGETS= client@EXEEXT@ \ occhild.so \ mod_test.so -OBJS= testfile.o \ - testflock.o \ - testproc.o \ - testsock.o \ - testthread.o \ - testtime.o \ - testargs.o \ - testcontext.o \ - testmmap.o \ - testdso.o \ - testoc.o \ - testuuid.o \ - occhild.o \ - mod_test.o +LIBS=../libapr.a @LIBS@ -.c.o: - $(CC) -c $(CFLAGS) $(INCLUDES) $< +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -all: $(TARGETS) +CLEAN_TARGETS = testfile.tmp -testfile@EXEEXT@: testfile.o - $(CC) $(CFLAGS) -o testfile@EXEEXT@ testfile.o $(LDFLAGS) +CFLAGS = -g @CFLAGS@ @OPTIM@ -testflock@EXEEXT@: testflock.o - $(CC) $(CFLAGS) -o testflock@EXEEXT@ testflock.o $(LDFLAGS) +INCDIR=../include +INCLUDES=-I$(INCDIR) -testdso@EXEEXT@: testdso.o - $(CC) $(CFLAGS) --export-dynamic -fPIC testdso.o -o testdso@EXEEXT@ $(LDFLAGS) -testoc@EXEEXT@: testoc.o - $(CC) $(CFLAGS) -o testoc@EXEEXT@ testoc.o $(LDFLAGS) +testfile@EXEEXT@: testfile.lo + $(LINK) testfile.lo -occhild.so: occhild.o - $(CC) $(SO_LDFLAG) occhild.o -o occhild.so +testflock@EXEEXT@: testflock.lo + $(LINK) testflock.lo -mod_test.so: mod_test.o - $(CC) $(SO_LDFLAG) mod_test.o -o mod_test.so +### why the export-dynamic? +testdso@EXEEXT@: testdso.lo + $(LINK) --export-dynamic testdso.lo -testargs@EXEEXT@: testargs.o - $(CC) $(CFLAGS) -o testargs@EXEEXT@ testargs.o $(LDFLAGS) +testoc@EXEEXT@: testoc.lo + $(LINK) testoc.lo -testcontext@EXEEXT@: testcontext.o - $(CC) $(CFLAGS) -o testcontext@EXEEXT@ testcontext.o $(LDFLAGS) +occhild.so: occhild.lo + $(LINK) --module occhild.lo -testproc@EXEEXT@: testproc.o - $(CC) $(CFLAGS) -o testproc@EXEEXT@ testproc.o $(LDFLAGS) +mod_test.so: mod_test.lo + $(LINK) --module mod_test.lo -testthread@EXEEXT@: testthread.o - $(CC) $(CFLAGS) -o testthread@EXEEXT@ testthread.o $(LDFLAGS) +testargs@EXEEXT@: testargs.lo + $(LINK) testargs.lo -testsock@EXEEXT@: testsock.o client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ - $(CC) $(CFLAGS) -o testsock@EXEEXT@ testsock.o $(LDFLAGS) +testcontext@EXEEXT@: testcontext.lo + $(LINK) testcontext.lo -client@EXEEXT@: client.o - $(CC) $(CFLAGS) -o client@EXEEXT@ client.o $(LDFLAGS) +testproc@EXEEXT@: testproc.lo + $(LINK) testproc.lo -server@EXEEXT@: server.o sendfile.o - $(CC) $(CFLAGS) -o server@EXEEXT@ server.o $(LDFLAGS) +testthread@EXEEXT@: testthread.lo + $(LINK) testthread.lo -sendfile@EXEEXT@: sendfile.o - $(CC) $(CFLAGS) -o sendfile@EXEEXT@ sendfile.o $(LDFLAGS) +testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ + $(LINK) testsock.lo -testtime@EXEEXT@: testtime.o - $(CC) $(CFLAGS) -o testtime@EXEEXT@ testtime.o $(LDFLAGS) +client@EXEEXT@: client.lo + $(LINK) client.lo -testmmap@EXEEXT@: testmmap.o - $(CC) $(CFLAGS) -o testmmap@EXEEXT@ testmmap.o $(LDFLAGS) +server@EXEEXT@: server.lo sendfile.lo + $(LINK) server.lo -testshmem@EXEEXT@: testshmem.o - $(CC) $(CFLAGS) -o testshmem@EXEEXT@ testshmem.o $(LDFLAGS) +sendfile@EXEEXT@: sendfile.lo + $(LINK) sendfile.lo -testpipe@EXEEXT@: testpipe.o - $(CC) $(CFLAGS) -o testpipe@EXEEXT@ testpipe.o $(LDFLAGS) +testtime@EXEEXT@: testtime.lo + $(LINK) testtime.lo -testuuid@EXEEXT@: testuuid.o - $(CC) $(CFLAGS) -o testuuid@EXEEXT@ testuuid.o $(LDFLAGS) +testmmap@EXEEXT@: testmmap.lo + $(LINK) testmmap.lo -clean: - $(RM) -f *.o *.a $(TARGETS) testflock.tmp +testshmem@EXEEXT@: testshmem.lo + $(LINK) testshmem.lo -distclean: clean - -$(RM) -f Makefile +testpipe@EXEEXT@: testpipe.lo + $(LINK) testpipe.lo -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c +testuuid@EXEEXT@: testuuid.lo + $(LINK) testuuid.lo # DO NOT REMOVE diff --git a/threadproc/beos/.cvsignore b/threadproc/beos/.cvsignore index caadabea819..3bc2847e3a3 100644 --- a/threadproc/beos/.cvsignore +++ b/threadproc/beos/.cvsignore @@ -1,2 +1,4 @@ Makefile apr_proc_stub +*.lo +.libs diff --git a/threadproc/beos/Makefile.in b/threadproc/beos/Makefile.in index 0d63b77948d..07b1c890423 100644 --- a/threadproc/beos/Makefile.in +++ b/threadproc/beos/Makefile.in @@ -1,44 +1,23 @@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) + +TARGETS = \ + proc.lo \ + thread.lo \ + threadpriv.lo \ + threadproc_common.lo \ + apr_proc_stub + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch -I$(OSDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -LIB=libthreadproc.a - -OBJS=proc.o \ - thread.o \ - threadpriv.o \ - threadproc_common.o \ - apr_proc_stub -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(LIB) +CLEAN_TARGETS = apr_proc_stub /boot/home/config/bin/apr_proc_stub apr_proc_stub: $(CC) apr_proc_stub.c \ && cp apr_proc_stub /boot/home/config/bin -clean: - $(RM) -f *.o *.a *.so /boot/home/config/bin/apr_proc_stub apr_proc_stub - -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c - # DO NOT REMOVE diff --git a/threadproc/os2/.cvsignore b/threadproc/os2/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/threadproc/os2/.cvsignore +++ b/threadproc/os2/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/threadproc/os2/Makefile.in b/threadproc/os2/Makefile.in index fc07cacd4a8..9a09fad8bc4 100644 --- a/threadproc/os2/Makefile.in +++ b/threadproc/os2/Makefile.in @@ -1,39 +1,16 @@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) + +TARGETS = \ + proc.lo \ + thread.lo \ + threadpriv.lo \ + signals.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + INCDIR=../../include OSDIR=$(INCDIR)/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -LIB=threadproc.a - -OBJS=proc.o \ - thread.o \ - threadpriv.o \ - signals.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< - -all: $(LIB) - -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - - -$(LIB): $(OBJS) - $(RM) -f $@ - $(AR) cr $@ $(OBJS) - $(RANLIB) $@ - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c # DO NOT REMOVE diff --git a/threadproc/unix/.cvsignore b/threadproc/unix/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/threadproc/unix/.cvsignore +++ b/threadproc/unix/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in index ea97d6c3c01..af1ab6ae5af 100644 --- a/threadproc/unix/Makefile.in +++ b/threadproc/unix/Makefile.in @@ -1,34 +1,16 @@ -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../include -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -LIB=libthreadproc.a - -OBJS=proc.o \ - procsup.o \ - thread.o \ - threadpriv.o \ - signals.o -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< +TARGETS = \ + proc.lo \ + procsup.lo \ + thread.lo \ + threadpriv.lo \ + signals.lo -all: $(OBJS) +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -clean: - $(RM) -f *.o *.a *.so - -distclean: clean - -$(RM) -f Makefile - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c +INCDIR=../../include +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) # DO NOT REMOVE diff --git a/time/unix/.cvsignore b/time/unix/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/time/unix/.cvsignore +++ b/time/unix/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/time/unix/Makefile.in b/time/unix/Makefile.in index b3134bc9fd2..18ee86e4a8e 100644 --- a/time/unix/Makefile.in +++ b/time/unix/Makefile.in @@ -1,29 +1,11 @@ -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -OBJS=time.o \ - timestr.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< -all: $(OBJS) +TARGETS = time.lo timestr.lo -clean: - $(RM) -f *.o *.a *.so +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -distclean: clean - -$(RM) -f Makefile - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) # DO NOT REMOVE diff --git a/user/unix/.cvsignore b/user/unix/.cvsignore index f3c7a7c5da6..06e18a7aafb 100644 --- a/user/unix/.cvsignore +++ b/user/unix/.cvsignore @@ -1 +1,3 @@ Makefile +*.lo +.libs diff --git a/user/unix/Makefile.in b/user/unix/Makefile.in index 22642134b2c..300adbdab84 100644 --- a/user/unix/Makefile.in +++ b/user/unix/Makefile.in @@ -1,28 +1,11 @@ -RM=@RM@ -CC=@CC@ -RANLIB=@RANLIB@ -CFLAGS=@CFLAGS@ @OPTIM@ -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ $(LIBS) -INCDIR=../../include -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) -MKDEP=../../helpers/mkdep.sh - -OBJS=homedir.o - -.c.o: - $(CC) $(CFLAGS) -c $(INCLUDES) $< -all: $(OBJS) +TARGETS = homedir.lo -clean: - $(RM) -f *.o *.a *.so +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ -distclean: clean - -$(RM) -f Makefile - -depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c +INCDIR=../../include +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) # DO NOT REMOVE From 0d6a7ea978b915ab6e2f7acf4ffff63c2b15094e Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 9 Jan 2001 19:28:36 +0000 Subject: [PATCH 1057/7878] Fix a compile break with the new APR libtool setup. Basically, we are using a libtool library from MM, but it isn't getting linked into the Apache executable, so we fail the link stage. This makes APR publicize the libtool libraries that it uses, so that Apache can link them in. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61038 13f79535-47bb-0310-9956-ffa450edef68 --- APRVARS.in | 1 + configure.in | 2 ++ 2 files changed, 3 insertions(+) diff --git a/APRVARS.in b/APRVARS.in index 223328b8876..dc207e42704 100644 --- a/APRVARS.in +++ b/APRVARS.in @@ -1,3 +1,4 @@ EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS @THREAD_CPPFLAGS@" EXTRA_CFLAGS="$EXTRA_CFLAGS @THREAD_CFLAGS@" EXTRA_LIBS="$EXTRA_LIBS @LIBS@" +LIBTOOL_LIBS="$LIBTOOL_LIBS @LIBTOOL_LIBS@" diff --git a/configure.in b/configure.in index f6dbeb00929..cae3e8b55a9 100644 --- a/configure.in +++ b/configure.in @@ -158,6 +158,7 @@ if test "$ac_cv_enable_shmem" = "mm"; then sharedmem="1" anonymous_shm="1" AC_MSG_RESULT(anonymous) + LIBTOOL_LIBS="$abs_srcdir/shmem/unix/mm/libmm.la" elif test "$ac_cv_enable_shmem" = "file"; then sharedmem="1" filebased_shm="1" @@ -865,6 +866,7 @@ AC_SUBST(LIBPREFIX) AC_SUBST(EXEEXT) AC_SUBST(THREAD_CPPFLAGS) AC_SUBST(THREAD_CFLAGS) +AC_SUBST(LIBTOOL_LIBS) echo "${nl}Construct Makefiles and header files." MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile" From 629b8148b1b0ce549aed6f3915d32a5fd713bc76 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Wed, 10 Jan 2001 01:01:33 +0000 Subject: [PATCH 1058/7878] Libtool takes care of the lib prefix so get rid of our own workaround. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61039 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- configure.in | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7b9738a5dd4..39b4d750f2a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -16,7 +16,7 @@ MODULES=@MODULES@ SUBDIRS=@SUBDIRS@ #shmem/@OSDIR@ -LIBAPR = @LIBPREFIX@apr.la +LIBAPR = libapr.la TARGET_EXPORTS = apr.exports diff --git a/configure.in b/configure.in index cae3e8b55a9..cd8c282f4c0 100644 --- a/configure.in +++ b/configure.in @@ -41,9 +41,6 @@ DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" MODULES="file_io network_io threadproc misc locks time mmap shmem i18n user" -# Most platforms use a prefix of 'lib' on their library files. -LIBPREFIX='lib' - dnl # Checks for programs. AC_PROG_CC AC_PROG_MAKE_SET @@ -101,7 +98,6 @@ case "$OS" in *-os2*) CFLAGS="$CFLAGS -DOS2 -Zmt" OSDIR="os2" - LIBPREFIX="" enable_threads="system_threads" eolstr="\\r\\n" ;; @@ -862,7 +858,6 @@ AC_SUBST(AR) AC_SUBST(RM) AC_SUBST(OSDIR) AC_SUBST(DEFAULT_OSDIR) -AC_SUBST(LIBPREFIX) AC_SUBST(EXEEXT) AC_SUBST(THREAD_CPPFLAGS) AC_SUBST(THREAD_CFLAGS) From 7fd01a38827b9ea07770ea205a0c9d8cb8137514 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Wed, 10 Jan 2001 13:48:29 +0000 Subject: [PATCH 1059/7878] Fix a makefile so this builds... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61040 13f79535-47bb-0310-9956-ffa450edef68 --- locks/beos/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in index e0a13869c9a..8d5687f9db5 100644 --- a/locks/beos/Makefile.in +++ b/locks/beos/Makefile.in @@ -1,8 +1,8 @@ -TARGETS = +TARGETS = \ locks.lo \ crossproc.lo \ - intraproc.lo \ + intraproc.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ From 3529905f37c791626328571beb544233b3b9fc96 Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" <ake@apache.org> Date: Wed, 10 Jan 2001 15:52:19 +0000 Subject: [PATCH 1060/7878] Eliminate trap in apr_palloc due to NULL pool pointer (Windows only) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61041 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 7cff92122bc..84ca396b014 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -327,6 +327,7 @@ apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, memcpy(&(*apr_sock)->local_addr->sa.sin, os_sock_info->local, (*apr_sock)->local_addr->salen); + (*apr_sock)->local_addr->pool = cont; } else { (*apr_sock)->local_port_unknown = (*apr_sock)->local_interface_unknown = 1; @@ -335,6 +336,7 @@ apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, memcpy(&(*apr_sock)->remote_addr->sa.sin, os_sock_info->remote, (*apr_sock)->remote_addr->salen); + (*apr_sock)->remote_addr->pool = cont; } apr_register_cleanup((*apr_sock)->cntxt, (void *)(*apr_sock), From cde68502fbc949b0d53065e55675ddd0f9e5aab7 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Wed, 10 Jan 2001 19:34:35 +0000 Subject: [PATCH 1061/7878] Adjust the way we look for dead threads after Carlos Hasan's suggestion and a few items of general tidy up. Submitted by: Carlos Hasan <chasan@acm.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61042 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/proc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 0a75d43cc76..b15f0eb8133 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -300,22 +300,21 @@ apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e wait) { - status_t exitval; - thread_info tinfo; - + status_t exitval, rv; + if (!proc) return APR_ENOPROC; /* when we run processes we are actually running threads, so here we'll wait on the thread dying... */ if (wait == APR_WAIT) { - if (wait_for_thread(proc->pid, &exitval) == B_OK) { + if ((rv = wait_for_thread(proc->pid, &exitval)) == B_OK) { return APR_CHILD_DONE; } - return errno; + return rv; } /* if the thread is still alive then it's not done... this won't hang or holdup the thread checking... */ - if (get_thread_info(proc->pid, &tinfo) == B_BAD_VALUE) { + if (resume_thread(proc->pid) == B_BAD_THREAD_ID) { return APR_CHILD_DONE; } /* if we get this far it's still going... */ @@ -368,7 +367,7 @@ apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_er } apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, - struct rlimit *limit) + void *limit) { return APR_ENOTIMPL; } From 9ab406206864ec5a041e39d475f303e99794c975 Mon Sep 17 00:00:00 2001 From: Bill Stoddard <stoddard@apache.org> Date: Wed, 10 Jan 2001 22:28:03 +0000 Subject: [PATCH 1062/7878] Win32: Fix loop in APR when attempting to send a 0 byte file. Yea, this is a goofy case but it works in Apache 1.3. Now it works in Apache 2.0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61043 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 51 +++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 39746d9b797..06eec498934 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -66,8 +66,7 @@ * The same problem can exist with apr_send(). In that case, we rely on the * application to adjust socket timeouts and max send segment sizes appropriately. * For example, Apache will in most cases call apr_send() with less than 8193 - * bytes - * of data. + * bytes. */ #define MAX_SEGMENT_SIZE 65536 apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) @@ -122,6 +121,7 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, int lasterror; DWORD dwBytes = 0; + /* Todo: Put the WSABUF array on the stack. */ LPWSABUF pWsaData = (LPWSABUF) malloc(sizeof(WSABUF) * nvec); if (!pWsaData) @@ -199,14 +199,10 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, DWORD nbytes; OVERLAPPED overlapped; TRANSMIT_FILE_BUFFERS tfb, *ptfb = NULL; - int bytes_to_send; int ptr = 0; + int bytes_to_send = *len; /* Bytes to send out of the file (not including headers) */ - /* Must pass in a valid length */ - if (len == 0) { - return APR_EINVAL; - } - bytes_to_send = *len; + /* Use len to keep track of number of total bytes sent (including headers) */ *len = 0; /* Initialize the overlapped structure */ @@ -218,26 +214,29 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); #endif - /* TransmitFile can only send one header and one footer */ - memset(&tfb, '\0', sizeof (tfb)); - if (hdtr && hdtr->numheaders) { - ptfb = &tfb; - collapse_iovec((char **)&ptfb->Head, &ptfb->HeadLength, hdtr->headers, hdtr->numheaders, sock->cntxt); - } - - /* If we have more than MAX_SEGMENT_SIZE headers to send, send them - * in segments. - */ - if (ptfb && ptfb->HeadLength) { - while (ptfb->HeadLength >= MAX_SEGMENT_SIZE) { - nbytes = MAX_SEGMENT_SIZE; - rv = apr_send(sock, ptfb->Head, &nbytes); + /* Handle the goofy case of sending headers/trailers and a zero byte file */ + if (!bytes_to_send && hdtr) { + if (hdtr->numheaders) { + rv = apr_sendv(sock, hdtr->headers, hdtr->numheaders, &nbytes); + if (rv != APR_SUCCESS) + return rv; + *len += nbytes; + } + if (hdtr->numtrailers) { + rv = apr_sendv(sock, hdtr->trailers, hdtr->numtrailers, &nbytes); if (rv != APR_SUCCESS) return rv; - (char*) ptfb->Head += nbytes; - ptfb->HeadLength -= nbytes; *len += nbytes; } + return APR_SUCCESS; + } + + /* Collapse the headers into a single buffer */ + memset(&tfb, '\0', sizeof (tfb)); + if (hdtr && hdtr->numheaders) { + ptfb = &tfb; + collapse_iovec((char **)&ptfb->Head, &ptfb->HeadLength, hdtr->headers, + hdtr->numheaders, sock->cntxt); } while (bytes_to_send) { @@ -247,9 +246,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, else { /* Last call to TransmitFile() */ nbytes = bytes_to_send; - /* Send trailers on the last packet, even if the total size - * exceeds MAX_SEGMENT_SIZE... - */ + /* Collapse the trailers into a single buffer */ if (hdtr && hdtr->numtrailers) { ptfb = &tfb; collapse_iovec((char**) &ptfb->Tail, &ptfb->TailLength, From 846c8d005884e1af87e04012a708966b4b656ceb Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 10 Jan 2001 23:50:32 +0000 Subject: [PATCH 1063/7878] stop monkeying around with MM's object files git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61044 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/Makefile.in | 7 ------- 1 file changed, 7 deletions(-) diff --git a/shmem/unix/Makefile.in b/shmem/unix/Makefile.in index 970591b2e58..dc4cdf0fb63 100644 --- a/shmem/unix/Makefile.in +++ b/shmem/unix/Makefile.in @@ -14,14 +14,7 @@ x-local-clean: x-local-distclean: (cd mm && $(MAKE) distclean) -# build the MM library, then copy the objects to this dir so our top-level -# will find them and copy them to the (top)/objs directory -MM_OBJS = \ - mm/mm_global.lo mm/mm_alloc.lo mm/mm_core.lo mm/mm_lib.lo \ - mm/mm_vers.lo - build-mm: (cd mm && $(MAKE) libmm.la) - cp $(MM_OBJS) . # DO NOT REMOVE From 3f198d6b87b1729aef8eeea19d21b5aa96b05acd Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Thu, 11 Jan 2001 00:13:23 +0000 Subject: [PATCH 1064/7878] add an accessor to the number of key/value pairs in the hash table. Submitted by: Bill Tutt <billtut@microsoft.com> Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61045 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 9 +++++++++ tables/apr_hash.c | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/include/apr_hash.h b/include/apr_hash.h index fcfe1ea50e9..2bc023b872e 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -173,6 +173,15 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, apr_size_t *klen, void **val); +/** + * Get the number of keys in the hash table. + * @param ht The hash table + * @param count Return pointer for the number of keys + * @deffunc void apr_hash_count(apr_hash_t *ht, apr_size_t *count); + */ +APR_DECLARE(void) apr_hash_count(apr_hash_t *ht, apr_size_t *count); + + #ifdef __cplusplus } #endif diff --git a/tables/apr_hash.c b/tables/apr_hash.c index f8ab43fa27a..b451c111142 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -314,3 +314,8 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, } /* else key not present and val==NULL */ } + +APR_DECLARE(void) apr_hash_count(apr_hash_t *ht, apr_size_t *count) +{ + *count = ht->count; +} From 05e1bc2f5ea89987309c961727243bc61150427f Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Thu, 11 Jan 2001 06:25:07 +0000 Subject: [PATCH 1065/7878] Add APR_DECLARE to some of APR's function declarations. This helps with linking on some platforms. Submitted by: Gregory Nicholls <gnicholls@level8.com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61046 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_pools.h | 15 ++++++++++----- lib/apr_pools.c | 10 +++++----- memory/unix/apr_pools.c | 10 +++++----- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index f62e8d7a0db..f98d83190df 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Specify APR_DECLARE to some of the APR functions. This helps linking + on some operating systems. [Gregory Nicholls <gnicholls@level8.com>] + *) Libtool'ized APR and converted all the makefiles to share rules from helpers/rules.mk. [Greg Stein] diff --git a/include/apr_pools.h b/include/apr_pools.h index 3553305d3b7..dddab520f03 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -214,8 +214,9 @@ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); * ever be used outside of APR. * @tip Programs do NOT need to call this directly. APR will call this * automatically from apr_initialize. + * @deffunc apr_status_t apr_init_alloc(apr_pool_t *globalp) */ -apr_status_t apr_init_alloc(apr_pool_t *globalp); /* Set up everything */ +APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp); /** * Tear down all of the internal structures required to use pools @@ -224,8 +225,9 @@ apr_status_t apr_init_alloc(apr_pool_t *globalp); /* Set up everything */ * ever be used outside of APR. * @tip Programs do NOT need to call this directly. APR will call this * automatically from apr_terminate. + * @deffunc void apr_term_alloc(apr_pool_t *globalp) */ -void apr_term_alloc(apr_pool_t *globalp); /* Tear down everything */ +APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp); /* pool functions */ @@ -236,8 +238,9 @@ void apr_term_alloc(apr_pool_t *globalp); /* Tear down everything */ * pool. If it is non-NULL, the new pool will inherit all * of it's parent pool's attributes, except the apr_pool_t will * be a sub-pool. + * @deffunc apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) */ -apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont); /** * Set the data associated with the current pool @@ -253,8 +256,9 @@ apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont); * data by choosing a key that another part of the program is using * It is advised that steps are taken to ensure that a unique * key is used at all times. + * @deffunc apr_status_t apr_set_userdata(const void *data, const char *key, apr_status_t (*cleanup) (void *), apr_pool_t *cont) */ -apr_status_t apr_set_userdata(const void *data, const char *key, +APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, apr_status_t (*cleanup) (void *), apr_pool_t *cont); @@ -263,8 +267,9 @@ apr_status_t apr_set_userdata(const void *data, const char *key, * @param data The key for the data to retrieve * @param key The user data associated with the pool. * @param cont The current pool. + * @deffunc apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) */ -apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, apr_pool_t *cont); /** * make a sub pool from the current pool diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 7d2da36b1c0..cbdc7f0545a 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -537,7 +537,7 @@ static void dump_stats(void) #endif /* ### why do we have this, in addition to apr_make_sub_pool? */ -apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) { apr_pool_t *newpool; @@ -667,7 +667,7 @@ APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data) return APR_SUCCESS; } -apr_status_t apr_init_alloc(apr_pool_t *globalp) +APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) { #if APR_HAS_THREADS apr_status_t status; @@ -701,7 +701,7 @@ apr_status_t apr_init_alloc(apr_pool_t *globalp) return APR_SUCCESS; } -void apr_term_alloc(apr_pool_t *globalp) +APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp) { #if APR_HAS_THREADS apr_destroy_lock(alloc_mutex); @@ -999,7 +999,7 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) * User data management functions */ -apr_status_t apr_set_userdata(const void *data, const char *key, +APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, apr_status_t (*cleanup) (void *), apr_pool_t *cont) { @@ -1020,7 +1020,7 @@ apr_status_t apr_set_userdata(const void *data, const char *key, return APR_SUCCESS; } -apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, apr_pool_t *cont) { if (cont->prog_data == NULL) *data = NULL; diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 7d2da36b1c0..cbdc7f0545a 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -537,7 +537,7 @@ static void dump_stats(void) #endif /* ### why do we have this, in addition to apr_make_sub_pool? */ -apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) { apr_pool_t *newpool; @@ -667,7 +667,7 @@ APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data) return APR_SUCCESS; } -apr_status_t apr_init_alloc(apr_pool_t *globalp) +APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) { #if APR_HAS_THREADS apr_status_t status; @@ -701,7 +701,7 @@ apr_status_t apr_init_alloc(apr_pool_t *globalp) return APR_SUCCESS; } -void apr_term_alloc(apr_pool_t *globalp) +APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp) { #if APR_HAS_THREADS apr_destroy_lock(alloc_mutex); @@ -999,7 +999,7 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) * User data management functions */ -apr_status_t apr_set_userdata(const void *data, const char *key, +APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, apr_status_t (*cleanup) (void *), apr_pool_t *cont) { @@ -1020,7 +1020,7 @@ apr_status_t apr_set_userdata(const void *data, const char *key, return APR_SUCCESS; } -apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, apr_pool_t *cont) { if (cont->prog_data == NULL) *data = NULL; From 7aca0edf2ba8823da27930f479911dcfdbd00143 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Thu, 11 Jan 2001 08:37:50 +0000 Subject: [PATCH 1066/7878] heh. there is a simpler way to do this... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61047 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 6 +++--- tables/apr_hash.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index 2bc023b872e..15cdab7b3cb 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -174,12 +174,12 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, apr_size_t *klen, void **val); /** - * Get the number of keys in the hash table. + * Get the number of key/value pairs in the hash table. * @param ht The hash table - * @param count Return pointer for the number of keys + * @return The number of key/value pairs in the hash table. * @deffunc void apr_hash_count(apr_hash_t *ht, apr_size_t *count); */ -APR_DECLARE(void) apr_hash_count(apr_hash_t *ht, apr_size_t *count); +APR_DECLARE(apr_size_t) apr_hash_count(apr_hash_t *ht); #ifdef __cplusplus diff --git a/tables/apr_hash.c b/tables/apr_hash.c index b451c111142..78a06c743d7 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -315,7 +315,7 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, /* else key not present and val==NULL */ } -APR_DECLARE(void) apr_hash_count(apr_hash_t *ht, apr_size_t *count) +APR_DECLARE(apr_size_t) apr_hash_count(apr_hash_t *ht) { - *count = ht->count; + return ht->count; } From 7c63419517ffdcf5183ab9665ac97a3fa2c24d8a Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Thu, 11 Jan 2001 08:40:09 +0000 Subject: [PATCH 1067/7878] missed this in the initial commit. Submitted by: Bill Tutt <billtut@microsoft.com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61048 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.def | 1 + 1 file changed, 1 insertion(+) diff --git a/libapr.def b/libapr.def index e776153cfc4..557f7fd2cb1 100644 --- a/libapr.def +++ b/libapr.def @@ -246,6 +246,7 @@ EXPORTS apr_hash_first apr_hash_next apr_hash_this + apr_hash_count ; ; apr_lock.h apr_create_lock From 65bc322ab674fbe4375fdcabe45ed571ec0854ce Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Thu, 11 Jan 2001 09:09:43 +0000 Subject: [PATCH 1068/7878] - get libapr.la relinking when something has changed - toss MODULES from the Makefile; it wasn't doing anything useful (SUBDIRS is the key) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61049 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 21 ++++++++++++++------- configure.in | 1 - 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Makefile.in b/Makefile.in index 39b4d750f2a..906367518a9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -12,19 +12,16 @@ INCLUDES=-I$(INCDIR) -I$(INCDIR1) # # Macros for target determination # -MODULES=@MODULES@ SUBDIRS=@SUBDIRS@ -#shmem/@OSDIR@ - -LIBAPR = libapr.la +TARGET_LIB = libapr.la TARGET_EXPORTS = apr.exports # # Rules for building specific targets, starting with 'all' for # building the entire package. # -TARGETS = $(LIBAPR) delete-exports $(TARGET_EXPORTS) +TARGETS = delete-lib $(TARGET_LIB) delete-exports $(TARGET_EXPORTS) # bring in rules.mk for standard functionality @INCLUDE_RULES@ @@ -39,7 +36,17 @@ EXTRACLEAN_TARGETS = configure libtool aclocal.m4 \ ### fix this up at some point (install location) libdir = /usr/local/lib -$(LIBAPR): $(MODULES) +delete-lib: + @if test -f $(TARGET_LIB); then \ + for i in $(SUBDIRS); do objects="$$objects $$i/*.lo"; done ; \ + if test -n "`find $$objects -newer $(TARGET_LIB)`"; then \ + echo Found newer objects. Will relink $(TARGET_LIB). ; \ + echo $(RM) -f $(TARGET_LIB) ; \ + $(RM) -f $(TARGET_LIB) ; \ + fi \ + fi + +$(TARGET_LIB): @for i in $(SUBDIRS); do objects="$$objects $$i/*.lo"; done ; \ echo $(LINK) -rpath $(libdir) $$objects ; \ $(LINK) -rpath $(libdir) $$objects @@ -68,7 +75,7 @@ docs: $(srcdir)helpers/scandoc -i$(srcdir)helpers/default.pl -p./docs/ $(srcdir)include/*.h; \ fi -test: $(LIBAPR) +test: $(TARGET_LIB) (cd test; make clean; make; \ cd test; \ for prog in `find . -type f -perm +u+x -name "test*" -print`; do \ diff --git a/configure.in b/configure.in index cd8c282f4c0..08483365199 100644 --- a/configure.in +++ b/configure.in @@ -880,7 +880,6 @@ done MAKEFILE3="test/Makefile" AC_SUBST(SUBDIRS) -AC_SUBST(MODULES) if test -n "$CPPFLAGS"; then CFLAGS="$CFLAGS $CPPFLAGS" From bb5147b96a80e3c880165e7b2004d45c74029767 Mon Sep 17 00:00:00 2001 From: Jim Jagielski <jim@apache.org> Date: Thu, 11 Jan 2001 13:49:00 +0000 Subject: [PATCH 1069/7878] Clean up of how hints.m4 adds hints to various compilation flags git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61050 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 281 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 143 insertions(+), 138 deletions(-) diff --git a/hints.m4 b/hints.m4 index 8913005d38d..2413cd8228f 100644 --- a/hints.m4 +++ b/hints.m4 @@ -4,61 +4,66 @@ dnl dnl Preload various ENV/makefile paramsm such as CC, CFLAGS, etc dnl based on outside knowledge dnl +dnl Generally, we force the setting of CC, and add flags +dnl to CFLAGS, LIBS and LDFLAGS. +dnl AC_DEFUN(APR_PRELOAD, [ echo "Applying hints file rules for $host" case "$host" in *mint) - APR_SETIFNULL(CFLAGS, [-DMINT]) - APR_SETIFNULL(LIBS, [-lportlib -lsocket]) + APR_ADDTO(CFLAGS, [-DMINT]) + APR_ADDTO(LIBS, [-lportlib -lsocket]) ;; *MPE/iX*) - APR_SETIFNULL(CFLAGS, [-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE]) - APR_SETIFNULL(LIBS, [-lsocket -lsvipc -lcurses]) - APR_SETIFNULL(LDFLAGS, [-Xlinker \"-WL,cap=ia,ba,ph;nmstack=1024000\"]) - APR_SETIFNULL(CAT, [/bin/cat]) + APR_ADDTO(CFLAGS, [-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE]) + APR_ADDTO(LIBS, [-lsocket -lsvipc -lcurses]) + APR_ADDTO(LDFLAGS, [-Xlinker \"-WL,cap=ia,ba,ph;nmstack=1024000\"]) + APR_SETVAR(CAT, [/bin/cat]) ;; *-apple-aux3*) - APR_SETIFNULL(CFLAGS, [-DAUX3 -D_POSIX_SOURCE]) - APR_SETIFNULL(LIBS, [-lposix -lbsd]) - APR_SETIFNULL(LDFLAGS, [-s]) + APR_SETVAR(CC, [gcc]) + APR_ADDTO(CFLAGS, [-DAUX3 -D_POSIX_SOURCE]) + APR_ADDTO(LIBS, [-lposix -lbsd]) + APR_ADDTO(LDFLAGS, [-s]) + APR_SETVAR(SHELL, [/bin/ksh]) ;; *-ibm-aix*) case $host in i386-ibm-aix*) - APR_SETIFNULL(CFLAGS, [-U__STR__ -DUSEBCOPY]) + APR_ADDTO(CFLAGS, [-U__STR__ -DUSEBCOPY]) ;; *-ibm-aix[1-2].*) - APR_SETIFNULL(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) ;; *-ibm-aix3.*) - APR_SETIFNULL(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) ;; *-ibm-aix4.1) - APR_SETIFNULL(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) ;; *-ibm-aix4.1.*) - APR_SETIFNULL(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) ;; *-ibm-aix4.2) - APR_SETIFNULL(CFLAGS, [-U__STR__]) - APR_SETIFNULL(LDFLAGS, [-lm]) + APR_ADDTO(CFLAGS, [-U__STR__]) + APR_ADDTO(LDFLAGS, [-lm]) ;; *-ibm-aix4.2.*) - APR_SETIFNULL(CFLAGS, [-U__STR__]) - APR_SETIFNULL(LDFLAGS, [-lm]) + APR_ADDTO(CFLAGS, [-U__STR__]) + APR_ADDTO(LDFLAGS, [-lm]) ;; *-ibm-aix4.3) - APR_SETIFNULL(CFLAGS, [-D_USE_IRS -U__STR__]) - APR_SETIFNULL(LDFLAGS, [-lm]) + APR_ADDTO(CFLAGS, [-D_USE_IRS -U__STR__]) + APR_ADDTO(LDFLAGS, [-lm]) ;; *-ibm-aix4.3.*) - APR_SETIFNULL(CFLAGS, [-D_USE_IRS -U__STR__]) - APR_SETIFNULL(LDFLAGS, [-lm]) + APR_ADDTO(CFLAGS, [-D_USE_IRS -U__STR__]) + APR_ADDTO(LDFLAGS, [-lm]) ;; *-ibm-aix*) - APR_SETIFNULL(CFLAGS, [-U__STR__]) - APR_SETIFNULL(LDFLAGS, [-lm]) + APR_ADDTO(CFLAGS, [-U__STR__]) + APR_ADDTO(LDFLAGS, [-lm]) ;; esac dnl Must do a check for gcc or egcs here, to get the right options @@ -70,21 +75,21 @@ case "$host" in fi ;; *-apollo-*) - APR_SETIFNULL(CFLAGS, [-DAPOLLO]) + APR_ADDTO(CFLAGS, [-DAPOLLO]) ;; *-dg-dgux*) - APR_SETIFNULL(CFLAGS, [-DDGUX]) + APR_ADDTO(CFLAGS, [-DDGUX]) ;; *os2_emx*) - APR_SETIFNULL(SHELL, [sh]) + APR_SETVAR(SHELL, [sh]) APR_SETIFNULL(file_as_socket, [0]) ;; *-hi-hiux) - APR_SETIFNULL(CFLAGS, [-DHIUX]) + APR_ADDTO(CFLAGS, [-DHIUX]) ;; *-hp-hpux11.*) - APR_SETIFNULL(CFLAGS, [-DHPUX11]) - APR_SETIFNULL(LIBS, [-lm -lpthread]) + APR_ADDTO(CFLAGS, [-DHPUX11]) + APR_ADDTO(LIBS, [-lm -lpthread]) ;; *-hp-hpux10.*) case $host in @@ -96,233 +101,233 @@ dnl # Not a problem in 10.20. Otherwise, who knows? esac ;; *-hp-hpux*) - APR_SETIFNULL(CFLAGS, [-DHPUX]) - APR_SETIFNULL(LIBS, [-lm]) + APR_ADDTO(CFLAGS, [-DHPUX]) + APR_ADDTO(LIBS, [-lm]) ;; *-linux-*) case `uname -r` in - 2.2* ) APR_SETIFNULL(CFLAGS, [-DLINUX=2]) - APR_SETIFNULL(LIBS, [-lm]) + 2.2* ) APR_ADDTO(CFLAGS, [-DLINUX=2]) + APR_ADDTO(LIBS, [-lm]) ;; - 2.0* ) APR_SETIFNULL(CFLAGS, [-DLINUX=2]) - APR_SETIFNULL(LIBS, [-lm]) + 2.0* ) APR_ADDTO(CFLAGS, [-DLINUX=2]) + APR_ADDTO(LIBS, [-lm]) ;; - 1.* ) APR_SETIFNULL(CFLAGS, [-DLINUX=1]) + 1.* ) APR_ADDTO(CFLAGS, [-DLINUX=1]) ;; * ) ;; esac ;; *-GNU*) - APR_SETIFNULL(CFLAGS, [-DHURD]) - APR_SETIFNULL(LIBS, [-lm -lcrypt]) + APR_ADDTO(CFLAGS, [-DHURD]) + APR_ADDTO(LIBS, [-lm -lcrypt]) ;; *-lynx-lynxos) - APR_SETIFNULL(CFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) - APR_SETIFNULL(LIBS, [-lbsd -lcrypt]) + APR_ADDTO(CFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) + APR_ADDTO(LIBS, [-lbsd -lcrypt]) ;; *486-*-bsdi*) - APR_SETIFNULL(CFLAGS, [-m486]) + APR_ADDTO(CFLAGS, [-m486]) ;; *-netbsd*) - APR_SETIFNULL(CFLAGS, [-DNETBSD]) - APR_SETIFNULL(LIBS, [-lcrypt]) + APR_ADDTO(CFLAGS, [-DNETBSD]) + APR_ADDTO(LIBS, [-lcrypt]) ;; *-freebsd*) case $host in *freebsd[2345]*) - APR_SETIFNULL(CFLAGS, [-funsigned-char]) + APR_ADDTO(CFLAGS, [-funsigned-char]) ;; esac - APR_SETIFNULL(LIBS, [-lcrypt]) + APR_ADDTO(LIBS, [-lcrypt]) ;; *-next-nextstep*) APR_SETIFNULL(OPTIM, [-O]) - APR_SETIFNULL(CFLAGS, [-DNEXT]) + APR_ADDTO(CFLAGS, [-DNEXT]) ;; *-next-openstep*) - APR_SETIFNULL(CC, [cc]) + APR_SETVAR(CC, [cc]) APR_SETIFNULL(OPTIM, [-O]) - APR_SETIFNULL(CFLAGS, [-DNEXT]) + APR_ADDTO(CFLAGS, [-DNEXT]) ;; dnl *-apple-rhapsody*) -dnl APR_SETIFNULL(CFLAGS, [-DDARWIN -DMAC_OS_X_SERVER]) +dnl APR_ADDTO(CFLAGS, [-DDARWIN -DMAC_OS_X_SERVER]) dnl ;; *-apple-darwin*) - APR_SETIFNULL(CFLAGS, [-DDARWIN]) + APR_ADDTO(CFLAGS, [-DDARWIN]) ;; *-dec-osf*) - APR_SETIFNULL(CFLAGS, [-DOSF1]) - APR_SETIFNULL(LIBS, [-lm]) + APR_ADDTO(CFLAGS, [-DOSF1]) + APR_ADDTO(LIBS, [-lm]) ;; *-qnx) - APR_SETIFNULL(CFLAGS, [-DQNX]) - APR_SETIFNULL(LIBS, [-N128k -lsocket -lunix]) + APR_ADDTO(CFLAGS, [-DQNX]) + APR_ADDTO(LIBS, [-N128k -lsocket -lunix]) ;; *-qnx32) - APR_SETIFNULL(CC, [cc -F]) - APR_SETIFNULL(CFLAGS, [-DQNX -mf -3]) - APR_SETIFNULL(LIBS, [-N128k -lsocket -lunix]) + APR_SETVAR(CC, [cc -F]) + APR_ADDTO(CFLAGS, [-DQNX -mf -3]) + APR_ADDTO(LIBS, [-N128k -lsocket -lunix]) ;; *-isc4*) - APR_SETIFNULL(CC, [gcc]) - APR_SETIFNULL(CFLAGS, [-posix -DISC]) - APR_SETIFNULL(LDFLAGS, [-posix]) - APR_SETIFNULL(LIBS, [-linet]) + APR_SETVAR(CC, [gcc]) + APR_ADDTO(CFLAGS, [-posix -DISC]) + APR_ADDTO(LDFLAGS, [-posix]) + APR_ADDTO(LIBS, [-linet]) ;; *-sco3*) - APR_SETIFNULL(CFLAGS, [-DSCO -Oacgiltz]) - APR_SETIFNULL(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) + APR_ADDTO(CFLAGS, [-DSCO -Oacgiltz]) + APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) ;; *-sco5*) - APR_SETIFNULL(CFLAGS, [-DSCO5]) - APR_SETIFNULL(LIBS, [-lsocket -lmalloc -lprot -ltinfo -lx -lm]) + APR_ADDTO(CFLAGS, [-DSCO5]) + APR_ADDTO(LIBS, [-lsocket -lmalloc -lprot -ltinfo -lx -lm]) ;; *-sco_sv*|*-SCO_SV*) - APR_SETIFNULL(CFLAGS, [-DSCO]) - APR_SETIFNULL(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) + APR_ADDTO(CFLAGS, [-DSCO]) + APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) ;; *-solaris2*) PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` - APR_SETIFNULL(CFLAGS, [-DSOLARIS2=$PLATOSVERS]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl]) + APR_ADDTO(CFLAGS, [-DSOLARIS2=$PLATOSVERS]) + APR_ADDTO(LIBS, [-lsocket -lnsl]) ;; *-sunos4*) - APR_SETIFNULL(CFLAGS, [-DSUNOS4 -DUSEBCOPY]) + APR_ADDTO(CFLAGS, [-DSUNOS4 -DUSEBCOPY]) ;; *-unixware1) - APR_SETIFNULL(CFLAGS, [-DUW=100]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lcrypt]) + APR_ADDTO(CFLAGS, [-DUW=100]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt]) ;; *-unixware2) - APR_SETIFNULL(CFLAGS, [-DUW=200]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lcrypt -lgen]) + APR_ADDTO(CFLAGS, [-DUW=200]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) ;; *-unixware211) - APR_SETIFNULL(CFLAGS, [-DUW=211]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lcrypt -lgen]) + APR_ADDTO(CFLAGS, [-DUW=211]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) ;; *-unixware212) - APR_SETIFNULL(CFLAGS, [-DUW=212]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lcrypt -lgen]) + APR_ADDTO(CFLAGS, [-DUW=212]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) ;; *-unixware7) - APR_SETIFNULL(CFLAGS, [-DUW=700]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lcrypt -lgen]) + APR_ADDTO(CFLAGS, [-DUW=700]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) ;; maxion-*-sysv4*) - APR_SETIFNULL(CFLAGS, [-DSVR4]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc -lgen]) + APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc -lgen]) ;; *-*-powermax*) - APR_SETIFNULL(CFLAGS, [-DSVR4]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lgen]) + APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lgen]) ;; TPF) - APR_SETIFNULL(CC, [c89]) - APR_SETIFNULL(CFLAGS, [-DTPF -D_POSIX_SOURCE]) + APR_SETVAR(CC, [c89]) + APR_ADDTO(CFLAGS, [-DTPF -D_POSIX_SOURCE]) ;; BS2000*-siemens-sysv4*) - APR_SETIFNULL(CC, [c89 -XLLML -XLLMK -XL -Kno_integer_overflow]) - APR_SETIFNULL(CFLAGS, [-DSVR4 -D_XPG_IV]) + APR_SETVAR(CC, [c89 -XLLML -XLLMK -XL -Kno_integer_overflow]) + APR_ADDTO(CFLAGS, [-DSVR4 -D_XPG_IV]) ;; *-siemens-sysv4*) - APR_SETIFNULL(CFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT -DNEED_UNION_SEMUN]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc]) + APR_ADDTO(CFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT -DNEED_UNION_SEMUN]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) ;; pyramid-pyramid-svr4) - APR_SETIFNULL(CFLAGS, [-DSVR4 -DNO_LONG_DOUBLE]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc]) + APR_ADDTO(CFLAGS, [-DSVR4 -DNO_LONG_DOUBLE]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) ;; DS/90\ 7000-*-sysv4*) - APR_SETIFNULL(CFLAGS, [-DUXPDS]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl]) + APR_ADDTO(CFLAGS, [-DUXPDS]) + APR_ADDTO(LIBS, [-lsocket -lnsl]) ;; *-tandem-sysv4*) - APR_SETIFNULL(CFLAGS, [-DSVR4]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl]) + APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(LIBS, [-lsocket -lnsl]) ;; *-ncr-sysv4) - APR_SETIFNULL(CFLAGS, [-DSVR4 -DMPRAS]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) + APR_ADDTO(CFLAGS, [-DSVR4 -DMPRAS]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) ;; *-sysv4*) - APR_SETIFNULL(CFLAGS, [-DSVR4]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc]) + APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) ;; 88k-encore-sysv4) - APR_SETIFNULL(CFLAGS, [-DSVR4 -DENCORE]) - APR_SETIFNULL(LIBS, [-lPW]) + APR_ADDTO(CFLAGS, [-DSVR4 -DENCORE]) + APR_ADDTO(LIBS, [-lPW]) ;; *-uts*) PLATOSVERS=`echo $host | sed 's/^.*,//'` case $PLATOSVERS in - 2*) APR_SETIFNULL(CFLAGS, [-Xa -eft -DUTS21 -DUSEBCOPY]) - APR_SETIFNULL(LIBS, [-lsocket -lbsd -la]) + 2*) APR_ADDTO(CFLAGS, [-Xa -eft -DUTS21 -DUSEBCOPY]) + APR_ADDTO(LIBS, [-lsocket -lbsd -la]) ;; - *) APR_SETIFNULL(CFLAGS, [-Xa -DSVR4]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl]) + *) APR_ADDTO(CFLAGS, [-Xa -DSVR4]) + APR_ADDTO(LIBS, [-lsocket -lnsl]) ;; esac ;; *-ultrix) - APR_SETIFNULL(CFLAGS, [-DULTRIX]) - APR_SETIFNULL(SHELL, [/bin/sh5]) + APR_ADDTO(CFLAGS, [-DULTRIX]) + APR_SETVAR(SHELL, [/bin/sh5]) ;; *powerpc-tenon-machten*) - APR_SETIFNULL(LDFLAGS, [-Xlstack=0x14000 -Xldelcsect]) + APR_ADDTO(LDFLAGS, [-Xlstack=0x14000 -Xldelcsect]) ;; *-machten*) - APR_SETIFNULL(LDFLAGS, [-stack 0x14000]) + APR_ADDTO(LDFLAGS, [-stack 0x14000]) ;; *convex-v11*) - APR_SETIFNULL(CFLAGS, [-ext -DCONVEXOS11]) + APR_ADDTO(CFLAGS, [-ext -DCONVEXOS11]) APR_SETIFNULL(OPTIM, [-O1]) - APR_SETIFNULL(CC, [cc]) + APR_SETVAR(CC, [cc]) ;; i860-intel-osf1) - APR_SETIFNULL(CFLAGS, [-DPARAGON]) + APR_ADDTO(CFLAGS, [-DPARAGON]) ;; *-sequent-ptx2.*.*) - APR_SETIFNULL(CFLAGS, [-DSEQUENT=20 -Wc,-pw]) - APR_SETIFNULL(LIBS, [-lsocket -linet -lnsl -lc -lseq]) + APR_ADDTO(CFLAGS, [-DSEQUENT=20 -Wc,-pw]) + APR_ADDTO(LIBS, [-lsocket -linet -lnsl -lc -lseq]) ;; *-sequent-ptx4.0.*) - APR_SETIFNULL(CFLAGS, [-DSEQUENT=40 -Wc,-pw]) - APR_SETIFNULL(LIBS, [-lsocket -linet -lnsl -lc]) + APR_ADDTO(CFLAGS, [-DSEQUENT=40 -Wc,-pw]) + APR_ADDTO(LIBS, [-lsocket -linet -lnsl -lc]) ;; *-sequent-ptx4.[123].*) - APR_SETIFNULL(CFLAGS, [-DSEQUENT=41 -Wc,-pw]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc]) + APR_ADDTO(CFLAGS, [-DSEQUENT=41 -Wc,-pw]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) ;; *-sequent-ptx4.4.*) - APR_SETIFNULL(CFLAGS, [-DSEQUENT=44 -Wc,-pw]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc]) + APR_ADDTO(CFLAGS, [-DSEQUENT=44 -Wc,-pw]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) ;; *-sequent-ptx4.5.*) - APR_SETIFNULL(CFLAGS, [-DSEQUENT=45 -Wc,-pw]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc]) + APR_ADDTO(CFLAGS, [-DSEQUENT=45 -Wc,-pw]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) ;; *-sequent-ptx5.0.*) - APR_SETIFNULL(CFLAGS, [-DSEQUENT=50 -Wc,-pw]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc]) + APR_ADDTO(CFLAGS, [-DSEQUENT=50 -Wc,-pw]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) ;; *NEWS-OS*) - APR_SETIFNULL(CFLAGS, [-DNEWSOS]) + APR_ADDTO(CFLAGS, [-DNEWSOS]) ;; *-riscix) - APR_SETIFNULL(CFLAGS, [-DRISCIX]) + APR_ADDTO(CFLAGS, [-DRISCIX]) APR_SETIFNULL(OPTIM, [-O]) APR_SETIFNULL(MAKE, [make]) ;; *beos*) - APR_SETIFNULL(CFLAGS, [-DBEOS]) + APR_ADDTO(CFLAGS, [-DBEOS]) PLATOSVERS=`uname -r` case $PLATOSVERS in 5.1) APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) APR_ADDTO(LDFLAGS, [-nodefaultlibs -L/boot/develop/lib/x86 -L/boot/beos/system/lib]) - APR_SETIFNULL(EXTRA_LIBS, [-lbind -lsocket -lbe -lroot]) + APR_ADDTO(EXTRA_LIBS, [-lbind -lsocket -lbe -lroot]) APR_SETIFNULL(file_as_socket, [0]) ;; default) @@ -331,20 +336,20 @@ dnl ;; esac ;; 4850-*.*) - APR_SETIFNULL(CFLAGS, [-DSVR4 -DMPRAS]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) + APR_ADDTO(CFLAGS, [-DSVR4 -DMPRAS]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) ;; drs6000*) - APR_SETIFNULL(CFLAGS, [-DSVR4]) - APR_SETIFNULL(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) + APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) ;; m88k-*-CX/SX|CYBER) - APR_SETIFNULL(CFLAGS, [-D_CX_SX -Xa]) - APR_SETIFNULL(CC, [cc]) + APR_ADDTO(CFLAGS, [-D_CX_SX -Xa]) + APR_SETVAR(CC, [cc]) ;; *-tandem-oss) - APR_SETIFNULL(CFLAGS, [-D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED=1]) - APR_SETIFNULL(CC, [c89]) + APR_ADDTO(CFLAGS, [-D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED=1]) + APR_SETVAR(CC, [c89]) ;; *-ibm-os390) APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE]) From 86b2853101f040f60ce751be75bf5d0a8e130f28 Mon Sep 17 00:00:00 2001 From: Jim Jagielski <jim@apache.org> Date: Thu, 11 Jan 2001 13:55:58 +0000 Subject: [PATCH 1070/7878] Add some verbosity to what we are doing. Doing apr_common.m4 things in the dark and without people's knowledge causes mucho pain git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61051 13f79535-47bb-0310-9956-ffa450edef68 --- apr_common.m4 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apr_common.m4 b/apr_common.m4 index cd0bcbbd2d8..8794bc2ca87 100644 --- a/apr_common.m4 +++ b/apr_common.m4 @@ -260,6 +260,7 @@ dnl Set variable iff it's currently null dnl AC_DEFUN(APR_SETIFNULL,[ if test -z "$$1"; then + echo " Setting $1 to \"$2\"" $1="$2"; export $1 fi ]) @@ -270,6 +271,7 @@ dnl dnl Set variable no matter what dnl AC_DEFUN(APR_SETVAR,[ + echo " Forcing $1 to \"$2\"" $1="$2"; export $1 ]) @@ -279,6 +281,7 @@ dnl dnl Add value to variable dnl AC_DEFUN(APR_ADDTO,[ - $1="$$1 $2"; export $1 + echo " Adding \"$2\" to $1" + $1="$$1 $2"; export $1 ]) From 281c5dac5ab0f4a0a6a9f00678d7e38c6d42cb74 Mon Sep 17 00:00:00 2001 From: Jim Jagielski <jim@apache.org> Date: Thu, 11 Jan 2001 19:24:27 +0000 Subject: [PATCH 1071/7878] Avoid re-adding values during each call. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61052 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hints.m4 b/hints.m4 index 2413cd8228f..183d36fb703 100644 --- a/hints.m4 +++ b/hints.m4 @@ -8,9 +8,12 @@ dnl Generally, we force the setting of CC, and add flags dnl to CFLAGS, LIBS and LDFLAGS. dnl AC_DEFUN(APR_PRELOAD, [ -echo "Applying hints file rules for $host" +if test "$DID_APR_PRELOAD" != "yes" ; then + DID_APR_PRELOAD="yes"; export DID_APR_PRELOAD -case "$host" in + echo "Applying APR hints file rules for $host" + + case "$host" in *mint) APR_ADDTO(CFLAGS, [-DMINT]) APR_ADDTO(LIBS, [-lportlib -lsocket]) @@ -362,6 +365,7 @@ dnl ;; APR_ADDTO(CFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK]) APR_ADDTO(CFLAGS, [-DTCP_NODELAY=1]) ;; -esac -APR_DOEXTRA + esac + APR_DOEXTRA +fi ]) From eb9f3fcdd33c6cc32d21f1403dd72e25e70a9a3f Mon Sep 17 00:00:00 2001 From: Jim Jagielski <jim@apache.org> Date: Fri, 12 Jan 2001 04:13:04 +0000 Subject: [PATCH 1072/7878] Tell the nice people git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61053 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hints.m4 b/hints.m4 index 183d36fb703..af4128e87dc 100644 --- a/hints.m4 +++ b/hints.m4 @@ -8,8 +8,13 @@ dnl Generally, we force the setting of CC, and add flags dnl to CFLAGS, LIBS and LDFLAGS. dnl AC_DEFUN(APR_PRELOAD, [ -if test "$DID_APR_PRELOAD" != "yes" ; then - DID_APR_PRELOAD="yes"; export DID_APR_PRELOAD +if test "$DID_APR_PRELOAD" = "yes" ; then + + echo "APR hints file rules for $host already applied" + +else + + DID_APR_PRELOAD="yes"; export DID_APR_PRELOAD echo "Applying APR hints file rules for $host" From 76d32aac28d73b6a31c168914b2565e4ec5019cc Mon Sep 17 00:00:00 2001 From: Jim Jagielski <jim@apache.org> Date: Fri, 12 Jan 2001 04:18:29 +0000 Subject: [PATCH 1073/7878] Document that we honor CFLAGS in the normal autoconf way git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61054 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index f98d83190df..bb074b562e6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Some adjustment of hints.m4 setting flags (used to check if null + first) and added some verbosity. [Jim Jagielski] + *) Specify APR_DECLARE to some of the APR functions. This helps linking on some operating systems. [Gregory Nicholls <gnicholls@level8.com>] From 3bbf5d4ed1ada417d4d47ceb02e6d88f31627f68 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 12 Jan 2001 04:50:31 +0000 Subject: [PATCH 1074/7878] Add linkage declarations to the DSO functions. Submitted by: Gregory Nicholls <gnicholls@level8.com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61055 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ dso/aix/dso.c | 12 ++++++------ dso/beos/dso.c | 8 ++++---- dso/os2/dso.c | 12 ++++++------ dso/os390/dso.c | 14 +++++++------- dso/unix/dso.c | 14 +++++++------- dso/win32/dso.c | 10 +++++----- include/apr_dso.h | 14 ++++++++------ 8 files changed, 46 insertions(+), 41 deletions(-) diff --git a/CHANGES b/CHANGES index bb074b562e6..04eb865931e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Add linkage declarations to the DSO code. + [Gregory Nicholls <gnicholls@level8.com>] + *) Some adjustment of hints.m4 setting flags (used to check if null first) and added some verbosity. [Jim Jagielski] diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 4b10f1fe351..cd63af0b1a2 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -132,8 +132,8 @@ struct dl_info { * add the basic "wrappers" here. */ -apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, - apr_pool_t *ctx) +APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, + const char *path, apr_pool_t *ctx) { void *os_handle = dlopen((char *)path, RTLD_NOW | RTLD_GLOBAL); @@ -146,7 +146,7 @@ apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, return APR_SUCCESS; } -apr_status_t apr_dso_unload(apr_dso_handle_t *handle) +APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { if (dlclose(handle->handle) != 0) return APR_EINIT; @@ -154,9 +154,9 @@ apr_status_t apr_dso_unload(apr_dso_handle_t *handle) return APR_SUCCESS; } -apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, - apr_dso_handle_t *handle, - const char *symname) +APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, + apr_dso_handle_t *handle, + const char *symname) { void *retval = dlsym(handle->handle, symname); diff --git a/dso/beos/dso.c b/dso/beos/dso.c index f049c28a4ab..bb01d858c77 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -56,7 +56,7 @@ #if APR_HAS_DSO -apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, +APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { image_id newid; @@ -70,7 +70,7 @@ apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, return APR_SUCCESS; } -apr_status_t apr_dso_unload(apr_dso_handle_t *handle) +APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { if(unload_add_on(handle->handle) < B_NO_ERROR) return APR_EINIT; @@ -78,7 +78,7 @@ apr_status_t apr_dso_unload(apr_dso_handle_t *handle) return APR_SUCCESS; } -apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, +APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, const char *symname) { int err; @@ -95,7 +95,7 @@ apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, return APR_SUCCESS; } -const char *apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) +APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) { strncpy(strerror(errno), buffer, buflen); return buffer; diff --git a/dso/os2/dso.c b/dso/os2/dso.c index d3eb678bbe0..03dcecae2e1 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -68,7 +68,7 @@ static apr_status_t dso_cleanup(void *thedso) } -apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) +APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { char failed_module[200]; HMODULE handle; @@ -92,7 +92,7 @@ apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_p -apr_status_t apr_dso_unload(apr_dso_handle_t *handle) +APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { int rc; @@ -109,9 +109,9 @@ apr_status_t apr_dso_unload(apr_dso_handle_t *handle) -apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, - apr_dso_handle_t *handle, - const char *symname) +APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, + apr_dso_handle_t *handle, + const char *symname) { PFN func; int rc; @@ -128,7 +128,7 @@ apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, -const char *apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) +APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) { char message[200]; apr_strerror(dso->load_error, message, sizeof(message)); diff --git a/dso/os390/dso.c b/dso/os390/dso.c index 2adff3e8d75..1f4fda65adc 100644 --- a/dso/os390/dso.c +++ b/dso/os390/dso.c @@ -65,8 +65,8 @@ static apr_status_t dso_cleanup(void *thedso) return apr_dso_unload(dso); } -apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, - apr_pool_t *ctx) +APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, + const char *path, apr_pool_t *ctx) { dllhandle *handle; int rc; @@ -83,7 +83,7 @@ apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, return errno; } -apr_status_t apr_dso_unload(apr_dso_handle_t *handle) +APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { int rc; @@ -100,9 +100,9 @@ apr_status_t apr_dso_unload(apr_dso_handle_t *handle) return errno; } -apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, - apr_dso_handle_t *handle, - const char *symname) +APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, + apr_dso_handle_t *handle, + const char *symname) { void *func_ptr; void *var_ptr; @@ -119,7 +119,7 @@ apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, return errno; } -const char *apr_dso_error(apr_dso_handle_t *handle, char *buffer, +APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *handle, char *buffer, apr_size_t buflen) { apr_cpystrn(buffer, strerror(handle->failing_errno), buflen); diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 6741449ab74..154a11fb0f5 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -61,8 +61,8 @@ #include <stddef.h> #endif -apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, - apr_pool_t *ctx) +APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, + const char *path, apr_pool_t *ctx) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) shl_t os_handle = shl_load(path, BIND_IMMEDIATE|BIND_VERBOSE|BIND_NOSTART, 0L); @@ -91,7 +91,7 @@ apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, return APR_SUCCESS; } -apr_status_t apr_dso_unload(apr_dso_handle_t *handle) +APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) shl_unload((shl_t)handle->handle); @@ -104,9 +104,9 @@ apr_status_t apr_dso_unload(apr_dso_handle_t *handle) return APR_SUCCESS; } -apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, - apr_dso_handle_t *handle, - const char *symname) +APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, + apr_dso_handle_t *handle, + const char *symname) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) void *symaddr = NULL; @@ -146,7 +146,7 @@ apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, #endif /* not HP-UX; use dlsym()/dlerror() */ } -const char *apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) +APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) { if (dso->errormsg) { apr_cpystrn(buffer, dso->errormsg, buflen); diff --git a/dso/win32/dso.c b/dso/win32/dso.c index a6e3dfe5e5a..3899fa223b3 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -59,8 +59,8 @@ #if APR_HAS_DSO -apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path, - apr_pool_t *ctx) +APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, + const char *path, apr_pool_t *ctx) { HINSTANCE os_handle; UINT em; @@ -114,7 +114,7 @@ apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path return APR_SUCCESS; } -apr_status_t apr_dso_unload(struct apr_dso_handle_t *handle) +APR_DECLARE(apr_status_t) apr_dso_unload(struct apr_dso_handle_t *handle) { if (!FreeLibrary(handle->handle)) { return apr_get_os_error(); @@ -122,7 +122,7 @@ apr_status_t apr_dso_unload(struct apr_dso_handle_t *handle) return APR_SUCCESS; } -apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, +APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, struct apr_dso_handle_t *handle, const char *symname) { @@ -136,7 +136,7 @@ apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, return APR_SUCCESS; } -const char *apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize) +APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize) { return apr_strerror(dso->load_error, buf, bufsize); } diff --git a/include/apr_dso.h b/include/apr_dso.h index d2fb03e8afc..3eed74422f2 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -87,14 +87,14 @@ typedef void * apr_dso_handle_sym_t; * @param path Path to the DSO library * @param ctx Pool to use. */ -apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, - apr_pool_t *ctx); +APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, + const char *path, apr_pool_t *ctx); /** * Close a DSO library. * @param handle handle to close. */ -apr_status_t apr_dso_unload(apr_dso_handle_t *handle); +APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle); /** * Load a symbol from a DSO handle. @@ -102,16 +102,18 @@ apr_status_t apr_dso_unload(apr_dso_handle_t *handle); * @param handle handle to load the symbol from. * @param symname Name of the symbol to load. */ -apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, - const char *symname); +APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, + apr_dso_handle_t *handle, + const char *symname); /** * Report more information when a DSO function fails. * @param dso The dso handle that has been opened * @param buf Location to store the dso error * @param bufsize The size of the provided buffer + * @deffunc const char *apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize) */ -const char *apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize); +APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize); #endif /* APR_HAS_DSO */ From 9745ee47f4aba1a1b896dd81b3744ad8e9035e76 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 12 Jan 2001 17:41:27 +0000 Subject: [PATCH 1075/7878] get the test programs to build on at least some systems consider using autoconfiguration to grab the proper list of APR libraries git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61056 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 35953313c1e..56d048892ad 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -20,31 +20,31 @@ TARGETS = \ occhild.so \ mod_test.so -LIBS=../libapr.a @LIBS@ - # bring in rules.mk for standard functionality @INCLUDE_RULES@ +ALL_LIBS=../libapr.la ../shmem/unix/mm/libmm.la $(LIBS) + CLEAN_TARGETS = testfile.tmp -CFLAGS = -g @CFLAGS@ @OPTIM@ +CFLAGS = -g @CFLAGS@ @OPTIM@ $(INCLUDES) INCDIR=../include INCLUDES=-I$(INCDIR) testfile@EXEEXT@: testfile.lo - $(LINK) testfile.lo + $(LINK) testfile.lo $(ALL_LIBS) testflock@EXEEXT@: testflock.lo - $(LINK) testflock.lo + $(LINK) testflock.lo $(ALL_LIBS) ### why the export-dynamic? testdso@EXEEXT@: testdso.lo $(LINK) --export-dynamic testdso.lo testoc@EXEEXT@: testoc.lo - $(LINK) testoc.lo + $(LINK) testoc.lo $(ALL_LIBS) occhild.so: occhild.lo $(LINK) --module occhild.lo @@ -53,42 +53,42 @@ mod_test.so: mod_test.lo $(LINK) --module mod_test.lo testargs@EXEEXT@: testargs.lo - $(LINK) testargs.lo + $(LINK) testargs.lo $(ALL_LIBS) testcontext@EXEEXT@: testcontext.lo - $(LINK) testcontext.lo + $(LINK) testcontext.lo $(ALL_LIBS) testproc@EXEEXT@: testproc.lo - $(LINK) testproc.lo + $(LINK) testproc.lo $(ALL_LIBS) testthread@EXEEXT@: testthread.lo - $(LINK) testthread.lo + $(LINK) testthread.lo $(ALL_LIBS) testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ - $(LINK) testsock.lo + $(LINK) testsock.lo $(ALL_LIBS) client@EXEEXT@: client.lo - $(LINK) client.lo + $(LINK) client.lo $(ALL_LIBS) server@EXEEXT@: server.lo sendfile.lo - $(LINK) server.lo + $(LINK) server.lo $(ALL_LIBS) sendfile@EXEEXT@: sendfile.lo - $(LINK) sendfile.lo + $(LINK) sendfile.lo $(ALL_LIBS) testtime@EXEEXT@: testtime.lo - $(LINK) testtime.lo + $(LINK) testtime.lo $(ALL_LIBS) testmmap@EXEEXT@: testmmap.lo - $(LINK) testmmap.lo + $(LINK) testmmap.lo $(ALL_LIBS) testshmem@EXEEXT@: testshmem.lo - $(LINK) testshmem.lo + $(LINK) testshmem.lo $(ALL_LIBS) testpipe@EXEEXT@: testpipe.lo - $(LINK) testpipe.lo + $(LINK) testpipe.lo $(ALL_LIBS) testuuid@EXEEXT@: testuuid.lo - $(LINK) testuuid.lo + $(LINK) testuuid.lo $(ALL_LIBS) # DO NOT REMOVE From 09dcbf697c4e27105517a06e57ff876c4aca9a3f Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Fri, 12 Jan 2001 17:49:30 +0000 Subject: [PATCH 1076/7878] Add a missing function to the beos poll... Thought I'd done this a while back but apparently I hadn't... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61057 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/poll.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index a95738185bd..561e83d6d4e 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -102,6 +102,22 @@ apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, return APR_SUCCESS; } +apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, + apr_int16_t events) +{ + if (events & APR_POLLIN) { + FD_CLR(sock->socketdes, aprset->read); + } + if (events & APR_POLLPRI) { + FD_CLR(sock->socketdes, aprset->except); + } + if (events & APR_POLLOUT) { + FD_CLR(sock->socketdes, aprset->write); + } + return APR_SUCCESS; +} + apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_interval_time_t timeout) { From 8e933db5be4e36da7e3b6ef568f3a1c8693ee768 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Fri, 12 Jan 2001 17:56:58 +0000 Subject: [PATCH 1077/7878] The file_as-socket check wasn't getting picked up correctly, so this corrects that for BeOS and OS/2. Untested for OS/2 so Brian? Submitted by: Justin Sherrill <justin@shiningsilence.com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61058 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 ++++++ hints.m4 | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 08483365199..143d86c0cc5 100644 --- a/configure.in +++ b/configure.in @@ -100,6 +100,7 @@ case "$OS" in OSDIR="os2" enable_threads="system_threads" eolstr="\\r\\n" + file_as_socket="0" ;; *beos*) OSDIR="beos" @@ -110,6 +111,7 @@ case "$OS" in USE_MM=yes AC_CHECK_DEFINE(BONE_VERSION, sys/socket.h) eolstr="\\n" + file_as_socket="0" ;; *os390) OSDIR="os390" @@ -780,8 +782,12 @@ msg=yes ] , [ have_in_addr="0" msg=no ]) AC_MSG_RESULT([$msg]) +echo $ac_n "checking if fd == socket on this platform... " if test "x$file_as_socket" = "x" ; then file_as_socket="1"; + echo "yes" +else + echo "no" fi AC_SUBST(have_in_addr) diff --git a/hints.m4 b/hints.m4 index af4128e87dc..3b59279fc2d 100644 --- a/hints.m4 +++ b/hints.m4 @@ -90,7 +90,6 @@ else ;; *os2_emx*) APR_SETVAR(SHELL, [sh]) - APR_SETIFNULL(file_as_socket, [0]) ;; *-hi-hiux) APR_ADDTO(CFLAGS, [-DHIUX]) @@ -336,10 +335,6 @@ dnl ;; APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) APR_ADDTO(LDFLAGS, [-nodefaultlibs -L/boot/develop/lib/x86 -L/boot/beos/system/lib]) APR_ADDTO(EXTRA_LIBS, [-lbind -lsocket -lbe -lroot]) - APR_SETIFNULL(file_as_socket, [0]) - ;; - default) - APR_SETIFNULL(file_as_socket, [0]) ;; esac ;; From dd3c9c3a85db517f072979f3d6841543b550425d Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 12 Jan 2001 18:21:20 +0000 Subject: [PATCH 1078/7878] Fix FreeBSD version check used when deciding whether or not to disable APR sendfile support, following David Reid's idea of a general purpose version string which can be used for easy comparison. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61059 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 143d86c0cc5..04ae848b1d6 100644 --- a/configure.in +++ b/configure.in @@ -129,6 +129,18 @@ esac AC_SUBST(eolstr) +dnl For some platforms we need a version string which allows easy numeric +dnl comparisons. +case "$OS" in + *freebsd*) + # 3.4-RELEASE: 340 4.1.1-RELEASE: 411 + os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/' | sed -e 's/\(.\)\.\(.\)\-.*/\1\20/'` + ;; + *) + os_version=OS_VERSION_IS_NOT_SET + ;; +esac + dnl #----------------------------- Checking for Shared Memory Support echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" @@ -593,7 +605,7 @@ dnl systems if we are also using threads. orig_sendfile=$sendfile case "$OS" in *freebsd*) - if test `uname -r | sed -e 's/\(.\)\.\(.\)\..*/\1\2/'` -le "41"; then + if test $os_version -le "410"; then if test "$threads" = "1"; then sendfile="0" fi From 836a4fcc4ec30c4313302bafae577885773aef67 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 13 Jan 2001 04:23:10 +0000 Subject: [PATCH 1079/7878] Vote on some things so this goes out the door! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61060 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 6c5c01e8137..7422530e5b4 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/09 11:05:33 $] +Last modified at [$Date: 2001/01/13 04:23:10 $] Release: @@ -15,9 +15,18 @@ Release: RELEASE SHOWSTOPPERS: - * Source code layout needs to be decided for apr and apr-util. There + * This vote ends on Wednesday! + Source code layout needs to be decided for apr and apr-util. There has been some discussion about adding a src/ directory to apr or removing it from apr-util/. Either way, this needs to be decided. + Those for adding apr/src/ : gstein + Those removing apr-util/src/ : wrowe, rbb + + * Many linkage errors are gpfaulting Apache/win32 in various configs + (load mod_dav, for example.) Must complete the APR_DECLARES + Gregory Nicholes is working on this, with quick response from rbb + Will Rowe will fold over the libapr.dsp into it's own library + and remove the exports from the simple apr.dsp once it's done. * Replace APR_GET_POOL macro with a typesafe mechanism to get the pool from an APR (incomplete) type. From a979519a8ec9d38f8f42520706030fcdd750516d Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sat, 13 Jan 2001 11:51:03 +0000 Subject: [PATCH 1080/7878] Add a vote and a section for patches/issues waiting for code thaw... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61061 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 7422530e5b4..c4a59022469 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/13 04:23:10 $] +Last modified at [$Date: 2001/01/13 11:51:03 $] Release: @@ -19,8 +19,8 @@ RELEASE SHOWSTOPPERS: Source code layout needs to be decided for apr and apr-util. There has been some discussion about adding a src/ directory to apr or removing it from apr-util/. Either way, this needs to be decided. - Those for adding apr/src/ : gstein - Those removing apr-util/src/ : wrowe, rbb + Those for adding apr/src/ : gstein + Those for removing apr-util/src/ : wrowe, rbb , dreid * Many linkage errors are gpfaulting Apache/win32 in various configs (load mod_dav, for example.) Must complete the APR_DECLARES @@ -101,3 +101,11 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Documentation that needs writing: * API documentation + +Stuff waiting for code thawing after Beta 1: + + * socket options patch - this is an attempt to track and cache + the various options we have set on a socket to avoid needless + systems calls to discover if an option is set or not... + http://www.apache.org/~dreid/sockopt_diff + From 0d188b938987ed92db75eaaed46f840fd57104cc Mon Sep 17 00:00:00 2001 From: Jim Jagielski <jim@apache.org> Date: Sat, 13 Jan 2001 13:27:16 +0000 Subject: [PATCH 1081/7878] A vote and a task git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61062 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index c4a59022469..0a4ba55d599 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/13 11:51:03 $] +Last modified at [$Date: 2001/01/13 13:27:16 $] Release: @@ -19,7 +19,7 @@ RELEASE SHOWSTOPPERS: Source code layout needs to be decided for apr and apr-util. There has been some discussion about adding a src/ directory to apr or removing it from apr-util/. Either way, this needs to be decided. - Those for adding apr/src/ : gstein + Those for adding apr/src/ : gstein, jim Those for removing apr-util/src/ : wrowe, rbb , dreid * Many linkage errors are gpfaulting Apache/win32 in various configs @@ -38,6 +38,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: used by the configured User and Group. Current work-around: change the initial permissions to 0666. Needed code: See 1.3's http_main.c, SysV sem flavor of accept_mutex_init(). + Status: Jim will look into this * Build scripts do not recognise AIX 4.2.1 pthreads From 578201e1de4fbffc755deabd4c9af52f3f51606a Mon Sep 17 00:00:00 2001 From: Branko Cibej <brane@apache.org> Date: Mon, 15 Jan 2001 00:28:05 +0000 Subject: [PATCH 1082/7878] This vote ends on Wednesday ... which wednesday? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61063 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 0a4ba55d599..7af7a191310 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/13 13:27:16 $] +Last modified at [$Date: 2001/01/15 00:28:05 $] Release: @@ -19,7 +19,7 @@ RELEASE SHOWSTOPPERS: Source code layout needs to be decided for apr and apr-util. There has been some discussion about adding a src/ directory to apr or removing it from apr-util/. Either way, this needs to be decided. - Those for adding apr/src/ : gstein, jim + Those for adding apr/src/ : gstein, jim, brane Those for removing apr-util/src/ : wrowe, rbb , dreid * Many linkage errors are gpfaulting Apache/win32 in various configs From fd59a05c202aeb8fb0ecc219449fc038aa886cd6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 15 Jan 2001 19:19:24 +0000 Subject: [PATCH 1083/7878] Use APR_SIZE_T_FMT instead of %d when formatting an apr_size_t. This avoids a warning on AIX and other platforms where apr_size_t is long int. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61064 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testfile.c b/test/testfile.c index 3b3777e739e..645e27a673f 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -359,7 +359,7 @@ int testdirs(apr_pool_t *context) fprintf(stdout, "\t\tFile size......."); apr_dir_entry_size(&bytes, temp); if (bytes != strlen("Another test!!!")) { - fprintf(stderr, "Got wrong file size %d\n", bytes); + fprintf(stderr, "Got wrong file size %" APR_SIZE_T_FMT "\n", bytes); return -1; } fprintf(stdout, "OK\n"); From 10ae01aeb2d1a14f8fedf0a1debdc8ec1b2aaf0b Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 15 Jan 2001 19:43:53 +0000 Subject: [PATCH 1084/7878] Avoid some warnings on platforms where apr_size_t and/or apr_ssize_t aren't int (e.g., AIX). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61065 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/sendfile.c b/test/sendfile.c index 1da59d3b59d..1d1fbddf39f 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -324,7 +324,7 @@ static int client(client_socket_mode_t socket_mode) printf("apr_sendfile() updated len with %ld\n", (long int)len); - printf("bytes really sent: %d\n", + printf("bytes really sent: %" APR_SIZE_T_FMT "\n", expected_len); if (len != expected_len) { @@ -574,7 +574,7 @@ static int server(void) if (memcmp(buf, HDR1, strlen(HDR1))) { fprintf(stderr, "wrong data read (2)\n"); fprintf(stderr, "received: `%.*s'\nexpected: `%s'\n", - bytes_read, buf, HDR1); + (int)bytes_read, buf, HDR1); exit(1); } @@ -594,7 +594,7 @@ static int server(void) if (memcmp(buf, HDR2, strlen(HDR2))) { fprintf(stderr, "wrong data read (4)\n"); fprintf(stderr, "received: `%.*s'\nexpected: `%s'\n", - bytes_read, buf, HDR2); + (int)bytes_read, buf, HDR2); exit(1); } @@ -664,7 +664,7 @@ static int server(void) if (memcmp(buf, TRL1, strlen(TRL1))) { fprintf(stderr, "wrong data read (6)\n"); fprintf(stderr, "received: `%.*s'\nexpected: `%s'\n", - bytes_read, buf, TRL1); + (int)bytes_read, buf, TRL1); exit(1); } @@ -684,7 +684,7 @@ static int server(void) if (memcmp(buf, TRL2, strlen(TRL2))) { fprintf(stderr, "wrong data read (8)\n"); fprintf(stderr, "received: `%.*s'\nexpected: `%s'\n", - bytes_read, buf, TRL2); + (int)bytes_read, buf, TRL2); exit(1); } From 90813524ba270623025bc9e0dbbbc190bb1fdded Mon Sep 17 00:00:00 2001 From: Bill Stoddard <stoddard@apache.org> Date: Wed, 17 Jan 2001 20:39:23 +0000 Subject: [PATCH 1085/7878] Vote git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61066 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 7af7a191310..b481f5d6bb3 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/15 00:28:05 $] +Last modified at [$Date: 2001/01/17 20:39:23 $] Release: @@ -20,7 +20,7 @@ RELEASE SHOWSTOPPERS: has been some discussion about adding a src/ directory to apr or removing it from apr-util/. Either way, this needs to be decided. Those for adding apr/src/ : gstein, jim, brane - Those for removing apr-util/src/ : wrowe, rbb , dreid + Those for removing apr-util/src/ : wrowe, rbb , dreid, stoddard * Many linkage errors are gpfaulting Apache/win32 in various configs (load mod_dav, for example.) Must complete the APR_DECLARES From 5f496717ac98e4b4acc631092513c8021498001b Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Thu, 18 Jan 2001 02:25:06 +0000 Subject: [PATCH 1086/7878] finally got my development system working again git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61067 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index b481f5d6bb3..1df0ae8e59f 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/17 20:39:23 $] +Last modified at [$Date: 2001/01/18 02:25:06 $] Release: @@ -20,7 +20,7 @@ RELEASE SHOWSTOPPERS: has been some discussion about adding a src/ directory to apr or removing it from apr-util/. Either way, this needs to be decided. Those for adding apr/src/ : gstein, jim, brane - Those for removing apr-util/src/ : wrowe, rbb , dreid, stoddard + Those for removing apr-util/src/ : wrowe, rbb , dreid, stoddard, fielding * Many linkage errors are gpfaulting Apache/win32 in various configs (load mod_dav, for example.) Must complete the APR_DECLARES From 638c039923d9aeb2c5d2672a96e43e7f57da7487 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 18 Jan 2001 04:34:43 +0000 Subject: [PATCH 1087/7878] Upon a vote of 5 to 3 for eliminating the src/ structure, and unanimous consent that apr and apr-util should share a common structure, the src/ branch of apr-util is orphaned. These files will be deleted at T+1200 from the time of this commit, so if you have changes out there, save them in the new structure or set them aside. cvs update will destroy them as of tommorow morning. Win32 build is corrected, unix may (?) be corrected (please review.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61068 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/STATUS b/STATUS index 1df0ae8e59f..2ed97ce8c8d 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/18 02:25:06 $] +Last modified at [$Date: 2001/01/18 04:34:43 $] Release: @@ -15,13 +15,6 @@ Release: RELEASE SHOWSTOPPERS: - * This vote ends on Wednesday! - Source code layout needs to be decided for apr and apr-util. There - has been some discussion about adding a src/ directory to apr or - removing it from apr-util/. Either way, this needs to be decided. - Those for adding apr/src/ : gstein, jim, brane - Those for removing apr-util/src/ : wrowe, rbb , dreid, stoddard, fielding - * Many linkage errors are gpfaulting Apache/win32 in various configs (load mod_dav, for example.) Must complete the APR_DECLARES Gregory Nicholes is working on this, with quick response from rbb From 02c39b0db1a55b7caa33fad3cee69074f49fd0d4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 18 Jan 2001 14:17:17 +0000 Subject: [PATCH 1088/7878] Missing a few @deffunc's git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61069 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_dso.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/apr_dso.h b/include/apr_dso.h index 3eed74422f2..9c74b6e9f2b 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -85,7 +85,8 @@ typedef void * apr_dso_handle_sym_t; * Load a DSO library. * @param res_handle Location to store new handle for the DSO. * @param path Path to the DSO library - * @param ctx Pool to use. + * @param ctx Pool to use. + * @deffunc apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) */ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx); @@ -93,6 +94,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, /** * Close a DSO library. * @param handle handle to close. + * @deffunc apr_status_t apr_dso_unload(apr_dso_handle_t *handle) */ APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle); @@ -101,6 +103,7 @@ APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle); * @param ressym Location to store the loaded symbol * @param handle handle to load the symbol from. * @param symname Name of the symbol to load. + * @deffunc apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, const char *symname) */ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, From cd97f86233c376749a1873082a2f87f57bdc45b0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 18 Jan 2001 14:57:16 +0000 Subject: [PATCH 1089/7878] Update the error documentation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61070 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 83 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 73 insertions(+), 10 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 8c011b0e20d..d2c13056dfe 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -79,18 +79,77 @@ typedef int apr_status_t; * @param statcode The error code the get a string for. * @param buf A buffer to hold the error string. * @param bufsize Size of the buffer to hold the string. + * @deffunc char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize) */ -char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); +APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, + apr_size_t bufsize); -/* - * APR_OS_START_ERROR is where the APR specific error values should start. - * APR_OS_START_STATUS is where the APR specific status codes should start. +/** + * Fold a platform specific error into an apr_status_t code. + * @param syserr The platform os error code. + * @deffunc apr_status_t APR_FROM_OS_ERROR(os_err_type syserr) + * @tip Warning: macro implementation; the syserr argument may be evaluated + * multiple times. + */ + +/** + * Fold an apr_status_t code back to the native platform defined error. + * @param syserr The apr_status_t folded platform os error code. + * @deffunc os_err_type APR_TO_OS_ERROR(apr_status_t statcode) + * @tip Warning: macro implementation; the statcode argument may be evaluated + * multiple times. If the statcode was not created by apr_get_os_error + * or APR_FROM_OS_ERROR, the results are undefined. + */ + +/** + * Return the last platform error, folded into apr_status_t, on some platforms + * @deffunc apr_status_t apr_get_os_error() + * @tip This retrieves errno, or calls a GetLastError() style function, and + * folds it with APR_FROM_OS_ERROR. Some platforms (such as OS2) have no + * such mechanism, so this call may be unsupported. Some platforms + * require the alternate apr_get_netos_error() to retrieve the last + * socket error. + */ + +/** + * Return the last socket error, folded into apr_status_t, on some platforms + * @deffunc apr_status_t apr_get_netos_error() + * @tip This retrieves errno, h_errno, or calls a GetLastSocketError() style + * function, and folds it with APR_FROM_OS_ERROR. Some platforms (such + * as OS2) have no such mechanism, so this call may be unsupported. + */ + +/** + * Reset the last platform error, unfolded from an apr_status_t, on some platforms + * @param statcode The OS error folded in a prior call to APR_FROM_OS_ERROR() + * @deffunc void apr_set_os_error(apr_status_t statcode) + * @tip Warning: macro implementation; the statcode argument may be evaluated + * multiple times. If the statcode was not created by apr_get_os_error + * or APR_FROM_OS_ERROR, the results are undefined. This macro sets + * errno, or calls a SetLastError() style function, unfolding statcode + * with APR_TO_OS_ERROR. Some platforms (such as OS2) have no such + * mechanism, so this call may be unsupported. + */ + +#define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) + +/** + * APR_OS_START_ERROR is where the APR specific error values start. + */ +/** + * APR_OS_START_STATUS is where the APR specific status codes start. + */ +/** * APR_OS_START_USEERR are reserved for applications that use APR that * layer their own error codes along with APR's. + */ +/** * APR_OS_START_CANONERR is where APR versions of errno values are defined * on systems which don't have the corresponding errno. - * APR_OS_START_SYSERR should be used for system error values on - * each platform. + */ +/** + * APR_OS_START_SYSERR folds platform-specific system error values into + * apr_status_t values. */ #define APR_OS_START_ERROR 20000 #define APR_OS_START_STATUS (APR_OS_START_ERROR + 500) @@ -147,11 +206,15 @@ char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); * platform, either because nobody has gotten to it yet, * or the function is impossible on this platform. * APR_EMISMATCH Two passwords do not match. - * - * @tip Error codes can be checked with APR_STATUS_IS_FOO, where foo is the - * error code. For example, APR_EOF can be checked for with - * APR_STATUS_IS_EOF. * </PRE> + * + * @param status The APR_status code to check. + * @param statcode The apr status code to test. + * @deffunc int APR_STATUS_IS_status(apr_status_t statcode) + * @tip Warning: macro implementations; the statcode argument may be + * evaluated multiple times. To test for APR_ENOFILE, always test + * APR_STATUS_IS_ENOFILE(statcode) because platform-specific codes are + * not necessarily translated into the corresponding APR_Estatus code. */ /* APR ERROR VALUES */ From a9626b4b5b8380dee45f58fd5fd154337c5e1461 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 18 Jan 2001 19:08:46 +0000 Subject: [PATCH 1090/7878] Back out the inadvertent inclusion of the Win32 apr_set_os_error() in the global section of apr_errno.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61071 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index d2c13056dfe..cde954414c0 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -131,8 +131,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * mechanism, so this call may be unsupported. */ -#define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) - /** * APR_OS_START_ERROR is where the APR specific error values start. */ From 3af617f98d8a0cb1d5ac0b2b12784afe94e94930 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 18 Jan 2001 20:07:38 +0000 Subject: [PATCH 1091/7878] Add remaining APR_DECLARE()s to all headers. Conditionally added APR_DECLARES() to the sources, based on compilation emits (there are many that should be changed eventually, but the compiler will emit errors if those sources are added for win32). This change also splits libapr from apr, so the two projects are compiled seperately. Both .dsp files must be kept up-to-date with source file revisions. Finally, libapr.def is no longer needed - so it is gone. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61072 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 10 +- file_io/unix/fileacc.c | 11 +- file_io/unix/fullrw.c | 10 +- file_io/win32/dir.c | 33 ++- file_io/win32/filedup.c | 3 +- file_io/win32/filestat.c | 12 +- file_io/win32/flock.c | 4 +- file_io/win32/open.c | 26 +- file_io/win32/pipe.c | 6 +- file_io/win32/readwrite.c | 22 +- file_io/win32/seek.c | 2 +- include/apr.hw | 2 +- include/apr_file_io.h | 330 ++++++++++--------------- include/apr_fnmatch.h | 4 +- include/apr_general.h | 18 +- include/apr_getopt.h | 9 + include/apr_hash.h | 6 +- include/apr_lib.h | 14 +- include/apr_lock.h | 34 ++- include/apr_md5.h | 12 +- include/apr_mmap.h | 15 +- include/apr_network_io.h | 191 ++++++++++----- include/apr_pools.h | 45 ++-- include/apr_portable.h | 99 +++++--- include/apr_shmem.h | 30 ++- include/apr_strings.h | 10 +- include/apr_tables.h | 94 +++---- include/apr_thread_proc.h | 170 ++++++++----- include/apr_time.h | 33 ++- include/apr_uuid.h | 16 +- include/apr_xlate.h | 30 ++- include/arch/win32/fileio.h | 2 - libapr.def | 281 --------------------- libapr.dsp | 445 +++++++++++++++++++++++++++++++++- locks/win32/locks.c | 35 +-- misc/unix/errorcodes.c | 3 +- misc/unix/start.c | 6 +- misc/unix/uuid.c | 5 +- misc/win32/getuuid.c | 2 +- misc/win32/rand.c | 3 +- mmap/unix/common.c | 3 +- mmap/win32/mmap.c | 7 +- network_io/unix/sa_common.c | 41 ++-- network_io/win32/poll.c | 35 ++- network_io/win32/sendrecv.c | 17 +- network_io/win32/sockets.c | 40 +-- network_io/win32/sockopt.c | 9 +- strings/apr_strnatcmp.c | 6 +- threadproc/win32/proc.c | 50 ++-- threadproc/win32/signals.c | 2 +- threadproc/win32/thread.c | 40 +-- threadproc/win32/threadpriv.c | 31 ++- time/win32/time.c | 33 ++- time/win32/timestr.c | 9 +- 54 files changed, 1407 insertions(+), 999 deletions(-) delete mode 100644 libapr.def diff --git a/apr.dsp b/apr.dsp index c2195befaf4..2388dc6c906 100644 --- a/apr.dsp +++ b/apr.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -64,8 +64,8 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -518,9 +518,5 @@ SOURCE=.\include\apr_uuid.h SOURCE=.\include\apr_xlate.h # End Source File # End Group -# Begin Source File - -SOURCE=.\libapr.def -# End Source File # End Target # End Project diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index ecc78fc4dce..60304c2ec23 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -57,7 +57,8 @@ /* A file to put ALL of the accessor functions for apr_file_t types. */ -apr_status_t apr_get_filename(const char **fname, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_get_filename(const char **fname, + apr_file_t *thefile) { #ifdef WIN32 /* this test is only good until some other platform trys wchar* */ #if APR_HAS_UNICODE_FS @@ -136,13 +137,15 @@ apr_fileperms_t apr_unix_mode2perms(mode_t mode) } #endif -apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file) +APR_DECLARE(apr_status_t) apr_get_filedata(void **data, const char *key, + apr_file_t *file) { return apr_get_userdata(data, key, file->cntxt); } -apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key, - apr_status_t (*cleanup) (void *)) +APR_DECLARE(apr_status_t) apr_set_filedata(apr_file_t *file, void *data, + const char *key, + apr_status_t (*cleanup)(void *)) { return apr_set_userdata(data, key, cleanup, file->cntxt); } diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index b6d719ff69d..3d749ee92b3 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -55,8 +55,9 @@ #include "apr_file_io.h" -apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, - apr_size_t *bytes_read) +APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, + apr_size_t nbytes, + apr_size_t *bytes_read) { apr_status_t status; apr_size_t total_read = 0; @@ -76,8 +77,9 @@ apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, return status; } -apr_status_t apr_full_write(apr_file_t *thefile, const void *buf, - apr_size_t nbytes, apr_size_t *bytes_written) +APR_DECLARE(apr_status_t) apr_full_write(apr_file_t *thefile, const void *buf, + apr_size_t nbytes, + apr_size_t *bytes_written) { apr_status_t status; apr_size_t total_written = 0; diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index e1bf138aec9..0188f6d87a8 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -82,7 +82,8 @@ apr_status_t dir_cleanup(void *thedir) return APR_SUCCESS; } -apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, + apr_pool_t *cont) { /* Note that we won't open a directory that is greater than MAX_PATH, * including the trailing /* wildcard suffix. If a * won't fit, then @@ -173,7 +174,7 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont return APR_SUCCESS; } -apr_status_t apr_closedir(apr_dir_t *dir) +APR_DECLARE(apr_status_t) apr_closedir(apr_dir_t *dir) { if (dir->dirhand != INVALID_HANDLE_VALUE && !FindClose(dir->dirhand)) { return apr_get_os_error(); @@ -182,7 +183,7 @@ apr_status_t apr_closedir(apr_dir_t *dir) return APR_SUCCESS; } -apr_status_t apr_readdir(apr_dir_t *thedir) +APR_DECLARE(apr_status_t) apr_readdir(apr_dir_t *thedir) { /* The while loops below allow us to skip all invalid file names, so that * we aren't reporting any files where their absolute paths are too long. @@ -231,7 +232,7 @@ apr_status_t apr_readdir(apr_dir_t *thedir) return APR_SUCCESS; } -apr_status_t apr_rewinddir(apr_dir_t *dir) +APR_DECLARE(apr_status_t) apr_rewinddir(apr_dir_t *dir) { dir_cleanup(dir); if (!FindClose(dir->dirhand)) { @@ -241,7 +242,8 @@ apr_status_t apr_rewinddir(apr_dir_t *dir) return APR_SUCCESS; } -apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm, + apr_pool_t *cont) { #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; @@ -262,7 +264,7 @@ apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *co return APR_SUCCESS; } -apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; @@ -283,7 +285,8 @@ apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir) +APR_DECLARE(apr_status_t) apr_dir_entry_size(apr_ssize_t *size, + apr_dir_t *thedir) { if (thedir == NULL || thedir->n.entry == NULL) { return APR_ENODIR; @@ -293,7 +296,8 @@ apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir) return APR_SUCCESS; } -apr_status_t apr_dir_entry_mtime(apr_time_t *time, apr_dir_t *thedir) +APR_DECLARE(apr_status_t) apr_dir_entry_mtime(apr_time_t *time, + apr_dir_t *thedir) { if (thedir == NULL || thedir->n.entry == NULL) { return APR_ENODIR; @@ -302,7 +306,8 @@ apr_status_t apr_dir_entry_mtime(apr_time_t *time, apr_dir_t *thedir) return APR_SUCCESS; } -apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) +APR_DECLARE(apr_status_t) apr_dir_entry_ftype(apr_filetype_e *type, + apr_dir_t *thedir) { switch(thedir->n.entry->dwFileAttributes) { case FILE_ATTRIBUTE_DIRECTORY: { @@ -320,7 +325,8 @@ apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) } } -apr_status_t apr_get_dir_filename(const char **new, apr_dir_t *thedir) +APR_DECLARE(apr_status_t) apr_get_dir_filename(const char **new, + apr_dir_t *thedir) { #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; @@ -337,7 +343,8 @@ apr_status_t apr_get_dir_filename(const char **new, apr_dir_t *thedir) return APR_SUCCESS; } -apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) +APR_DECLARE(apr_status_t) apr_get_os_dir(apr_os_dir_t **thedir, + apr_dir_t *dir) { if (dir == NULL) { return APR_ENODIR; @@ -353,7 +360,9 @@ apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) * on cached info that we simply don't have our hands on when * we use this function. Maybe APR_ENOTIMPL would be better? */ -apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_put_os_dir(apr_dir_t **dir, + apr_os_dir_t *thedir, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index b14e34fdd50..630300815fa 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -58,7 +58,8 @@ #include "apr_strings.h" #include <string.h> -apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file, + apr_file_t *old_file, apr_pool_t *p) { BOOLEAN isStdHandle = FALSE; HANDLE hCurrentProcess = GetCurrentProcess(); diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index cf5a8008703..859ed0d382d 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -99,7 +99,8 @@ BOOLEAN is_exe(const char* fname, apr_pool_t *cont) { return FALSE; } -apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, + apr_file_t *thefile) { BY_HANDLE_FILE_INFORMATION FileInformation; DWORD FileType; @@ -191,12 +192,14 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) return APR_SUCCESS; } -apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) +APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname, + apr_fileperms_t perms) { return APR_ENOTIMPL; } -apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, + apr_pool_t *cont) { apr_oslevel_e os_level; /* @@ -324,7 +327,8 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, + apr_pool_t *cont) { apr_oslevel_e os_level; if (apr_get_oslevel(cont, &os_level) || os_level < APR_WIN_2000) diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index 0d319c72865..18d00b32273 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -54,7 +54,7 @@ #include "fileio.h" -apr_status_t apr_lock_file(apr_file_t *thefile, int type) +APR_DECLARE(apr_status_t) apr_lock_file(apr_file_t *thefile, int type) { OVERLAPPED offset; DWORD flags, len = 0xffffffff; @@ -70,7 +70,7 @@ apr_status_t apr_lock_file(apr_file_t *thefile, int type) return APR_SUCCESS; } -apr_status_t apr_unlock_file(apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_unlock_file(apr_file_t *thefile) { OVERLAPPED offset; DWORD len = 0xffffffff; diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 3a90d9d26c4..e5fd64c37ae 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -163,8 +163,9 @@ apr_status_t file_cleanup(void *thefile) return APR_SUCCESS; } -apr_status_t apr_open(apr_file_t **new, const char *fname, - apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_open(apr_file_t **new, const char *fname, + apr_int32_t flag, apr_fileperms_t perm, + apr_pool_t *cont) { DWORD oflags = 0; DWORD createflags = 0; @@ -281,7 +282,7 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, return APR_SUCCESS; } -apr_status_t apr_close(apr_file_t *file) +APR_DECLARE(apr_status_t) apr_close(apr_file_t *file) { apr_status_t stat; if ((stat = file_cleanup(file)) == APR_SUCCESS) { @@ -295,7 +296,7 @@ apr_status_t apr_close(apr_file_t *file) return stat; } -apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; @@ -314,8 +315,9 @@ apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) return apr_get_os_error(); } -apr_status_t apr_rename_file(const char *from_path, const char *to_path, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_rename_file(const char *from_path, + const char *to_path, + apr_pool_t *cont) { #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; @@ -337,7 +339,8 @@ apr_status_t apr_rename_file(const char *from_path, const char *to_path, return apr_get_os_error(); } -apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) +APR_DECLARE(apr_status_t) apr_get_os_file(apr_os_file_t *thefile, + apr_file_t *file) { if (file == NULL) { return APR_ENOFILE; @@ -346,8 +349,9 @@ apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) return APR_SUCCESS; } -apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_put_os_file(apr_file_t **file, + apr_os_file_t *thefile, + apr_pool_t *cont) { if ((*file) == NULL) { if (cont == NULL) { @@ -361,7 +365,7 @@ apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, return APR_SUCCESS; } -apr_status_t apr_eof(apr_file_t *fptr) +APR_DECLARE(apr_status_t) apr_eof(apr_file_t *fptr) { if (fptr->eof_hit == 1) { return APR_EOF; @@ -369,7 +373,7 @@ apr_status_t apr_eof(apr_file_t *fptr) return APR_SUCCESS; } -apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { (*thefile) = apr_pcalloc(cont, sizeof(apr_file_t)); if ((*thefile) == NULL) { diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 1c9189a2c12..5226a14442a 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -63,7 +63,7 @@ #include <sys/stat.h> #include "misc.h" -apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) +APR_DECLARE(apr_status_t) apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; @@ -72,7 +72,7 @@ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeo return APR_EINVAL; } -apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) +APR_DECLARE(apr_status_t) apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) { if (thepipe->pipe == 1) { *timeout = thepipe->timeout; @@ -81,7 +81,7 @@ apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *time return APR_EINVAL; } -apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p) { SECURITY_ATTRIBUTES sa; diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index db5fccffa82..48429bd55c0 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -148,7 +148,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le return rv; } -apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, apr_size_t *len) { apr_size_t rv; DWORD bytes_read = 0; @@ -221,7 +221,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *len) return rv; } -apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) +APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { apr_status_t rv; DWORD bwrote; @@ -275,8 +275,10 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) /* * Too bad WriteFileGather() is not supported on 95&98 (or NT prior to SP2) */ -apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, - apr_size_t *nbytes) +APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, + const struct iovec *vec, + apr_size_t nvec, + apr_size_t *nbytes) { apr_status_t rv = APR_SUCCESS; int i; @@ -296,20 +298,20 @@ apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t return rv; } -apr_status_t apr_putc(char ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_putc(char ch, apr_file_t *thefile) { DWORD len = 1; return apr_write(thefile, &ch, &len); } -apr_status_t apr_ungetc(char ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_ungetc(char ch, apr_file_t *thefile) { thefile->ungetchar = (unsigned char) ch; return APR_SUCCESS; } -apr_status_t apr_getc(char *ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_getc(char *ch, apr_file_t *thefile) { apr_status_t rc; int bread; @@ -328,14 +330,14 @@ apr_status_t apr_getc(char *ch, apr_file_t *thefile) return APR_SUCCESS; } -apr_status_t apr_puts(const char *str, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_puts(const char *str, apr_file_t *thefile) { DWORD len = strlen(str); return apr_write(thefile, str, &len); } -apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_fgets(char *str, int len, apr_file_t *thefile) { apr_size_t readlen; apr_status_t rv = APR_SUCCESS; @@ -361,7 +363,7 @@ apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) return rv; } -apr_status_t apr_flush(apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_flush(apr_file_t *thefile) { if (thefile->buffered) { DWORD written = 0; diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 55482613388..adaede8d861 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -86,7 +86,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) -apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) +APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { DWORD howmove; DWORD rv; diff --git a/include/apr.hw b/include/apr.hw index b38cbd83009..111bbc90e0e 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -53,7 +53,7 @@ */ /* - * Note: This is a Windows specific version of apr.h. It is renamed to + * Note: This is a Windows specific version of apr.h. It is copied as * apr.h at the start of a Windows build. */ diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 4a4e3919bf1..06658c6ceb8 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -133,11 +133,6 @@ typedef struct apr_finfo_t apr_finfo_t; * @defvar apr_dir_t */ typedef struct apr_dir_t apr_dir_t; -/** - * Structure for determining canonical filenames. - * @defvar apr_canon_t - */ -typedef struct apr_canon_t apr_canon_t; /** * Structure for determining file permissions. * @defvar apr_fileperms_t @@ -216,157 +211,6 @@ struct apr_finfo_t { #define APR_FLOCK_NONBLOCK 0x0010 /* do not block while acquiring the file lock */ - -/* Make and Merge Canonical Name Options */ -#define APR_CANON_ONLY_ABSOLUTE 0 -#define APR_CANON_ALLOW_RELATIVE 2 -#define APR_CANON_ONLY_RELATIVE 3 -#define APR_CANON_CHILD_OF_TRUSTED 4 -#define APR_CANON_LOWERCASE -#define APR_CANON_TRUECASE - - -/* This is a hack, because none of these functions actually exist yet. The - * problem is that we generate our exports from the header files, so we are - * trying to export these functions, but they don't exist, so we can't link. - * This just makes sure that we don't try to link these functions until - * they actually exist. - */ -#ifdef APR_NOT_DONE_YET -/** - * Canonicalize the path and name. - * @param new_name The newly allocated canonicalized trusted+child name - * @param trusted_name Already canonical parent path; may be NULL. - * @param child_name An absolute path or path relative to trusted_name. - * @param options Bit-wise OR of: - * <PRE> - * APR_CANON_ONLY_ABSOLUTE Require the trusted_name+child_name result is - * an absolute product or fail with error for the - * make and merge canonical name functions. - * APR_CANON_ALLOW_RELATIVE Allow that the trusted_name+child_name result - * may be a relative result for the make and - * merge canonical name functions. - * APR_CANON_ONLY_RELATIVE Require the trusted_name+child_name result is - * not an absolute path or fail with error for - * the make and merge canonical name functions. - * APR_CANON_CHILD_OF_TRUSTED Require the trusted_name+child_name result is - * a child of trusted_name or fail with error for - * the make and merge canonical name functions. - * APR_CANON_LOWERCASE If file path elements exist (can stat) then - * fold the element's name to lowercase for the - * make and merge canonical name functions. - * APR_CANON_TRUECASE If file path elements exist (can readdir) then - * fold the element's name to the true case - * lowercase for the make and merge canonical - * name functions. - * </PRE> - * @param pool The pool in which to allocate the new_name apr_canon_t - * - * @tip A canonical name is a name stripped of embedded backrefs "../", - * thisrefs "./", successive slashes (//), or any other ambigious file - * name element. Absolute canonical names referencing the same file must - * strcmp() identically, excluding symlinks or inconsistent use of the - * APR_CANON_LOWERCASE or APR_CANON_TRUECASE options. - * - * If the name does not exist, or resolves to a relative name the given case - * is preserved. Insignificant elements are eliminated. For example, on Win32 - * this function removes trailing dots (which are allowed, but not stored in - * the file system), and "/../" under Unix is resolved to "/". The relative - * canonical name may contain leading backrefs "../", but will never contain - * any other prohibited element. - */ -apr_status_t apr_make_canonical_name(apr_canon_t **new_name, - const apr_canon_t *trusted_name, - const char *child_name, - int options, - apr_pool_t *pool); - -/** - * Merge two canonical names into a single canonical name. - * @param new_name The newly allocated canonicalized trusted+child name - * @param trusted_name Already canonical parent path; may be NULL. - * @param child_name An already canonical absolute path or path relative to - * trusted_name. - * @param options See apr_make_canonical_name for options - * @param pool The pool to allocate the new_name out of. - * @see apr_make_canonical_name - */ -apr_status_t apr_merge_canonical_name(apr_canon_t **new_name, - const apr_canon_t *trusted_name, - const apr_canon_t *child_name, - int options, - apr_pool_t *pool); - -/** - * Get the canonical path in a character string - * @param path A location to store the canocical name - * @param trusted_name An already canonicalized file path - * @param pool The pool to allocate the path out of. - */ -apr_status_t apr_get_canonical_name(char **path, - const apr_canon_t *trusted_name, - apr_pool_t *pool); - -/** - * Count the number of elements in a canonical name. - * @param trusted_name An already canonicalized file path - * @return The number of elements in the name - */ -int apr_count_canonical_elements(const apr_canon_t *trusted_name); - -/** - * Query the length of some elements of the canonical name - * @param trusted_name An already canonicalized file path - * @param firstelement The numerical position of the element to start the - * length at. - * @param lastelement The numerical position of the element to end the - * length at. - * @return The length of requested elements. - */ -int apr_get_canonical_elements_length(const apr_canon_t *trusted_name, - int firstelement, int lastelement); - -/** - * Get the requested elements of a canonical name in a character string - * @param path_elements A location to store the path elements. - * @param trusted_name An already canonicalized file path - * @param firstelement The numerical position of the element to start the - * length at. - * @param lastelement The numerical position of the element to end the - * length at. - * @param pool The pool to allocate the path out of. - */ -apr_status_t apr_get_canonical_elements(char **path_elements, - const apr_canon_t *trusted_name, - int firstelement, int lastelement, - apr_pool_t *pool); - -/** - * Determine if a canonical name is absolute. - * @param path The canonical name to check - * @warning Do not trust !apr_is_absolute to determine if the path is - * relative. Also, test apr_is_virtualroot to avoid non-filesystem - * pseudo roots. - */ -apr_status_t apr_is_absolute(apr_canon_t **path); - -/** - * Determine if a canonical name is relative - * @param path The canonical name to check - * @warning Do not trust !apr_is_relative to determine if the path is absolute - */ -apr_status_t apr_is_relative(apr_canon_t **path); - -/** - * Determine if the elements 0..elements resolves to a platform's non-physical - * root, e.g. the //machine/ name that isn't an adaquately complete root for - * UNC paths. - * @param path The canonical name to check - * @param elements The number of elements to check. - */ -apr_status_t apr_is_virtualroot(apr_canon_t **path, int elements); -#endif - /** * Open the specified file. * @param new_file The opened file descriptor. @@ -386,26 +230,30 @@ apr_status_t apr_is_virtualroot(apr_canon_t **path, int elements); * </PRE> * @param perm Access permissions for file. * @param cont The pool to use. + * @deffunc apr_status_t apr_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) * @tip If perm is APR_OS_DEFAULT and the file is being created, appropriate * default permissions will be used. *arg1 must point to a valid file_t, * or NULL (in which case it will be allocated) */ -apr_status_t apr_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, - apr_fileperms_t perm, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_open(apr_file_t **new_file, const char *fname, + apr_int32_t flag, apr_fileperms_t perm, + apr_pool_t *cont); /** * Close the specified file. * @param file The file descriptor to close. + * @deffunc apr_status_t apr_close(apr_file_t *file) */ -apr_status_t apr_close(apr_file_t *file); +APR_DECLARE(apr_status_t) apr_close(apr_file_t *file); /** * delete the specified file. * @param path The full path to the file (using / on all systems) * @param cont The pool to use. + * @deffunc apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) * @tip If the file is open, it won't be removed until all instances are closed. */ -apr_status_t apr_remove_file(const char *path, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont); /** * rename the specified file. @@ -414,30 +262,36 @@ apr_status_t apr_remove_file(const char *path, apr_pool_t *cont); * @param pool The pool to use. * @tip If a file exists at the new location, then it will be overwritten. * Moving files or directories across devices may not be possible. + * @deffunc apr_status_t apr_rename_file(const char *from_path, const char *to_path, apr_pool_t *pool) */ -apr_status_t apr_rename_file(const char *from_path, const char *to_path, - apr_pool_t *pool); +APR_DECLARE(apr_status_t) apr_rename_file(const char *from_path, + const char *to_path, + apr_pool_t *pool); /** * Are we at the end of the file * @param fptr The apr file we are testing. * @tip Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise. + * @deffunc apr_status_t apr_eof(apr_file_t *fptr) */ -apr_status_t apr_eof(apr_file_t *fptr); +APR_DECLARE(apr_status_t) apr_eof(apr_file_t *fptr); /** * Is there an error on the stream? * @param fptr The apr file we are testing. * @tip Returns -1 if the error indicator is set, APR_SUCCESS otherwise. + * @deffunc apr_status_t apr_ferror(apr_file_t *fptr) */ -apr_status_t apr_ferror(apr_file_t *fptr); +APR_DECLARE(apr_status_t) apr_ferror(apr_file_t *fptr); /** * open standard error as an apr file pointer. * @param thefile The apr file to use as stderr. * @param cont The pool to allocate the file out of. + * @deffunc apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) */ -apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, + apr_pool_t *cont); /** * Read data from the specified file. @@ -454,8 +308,10 @@ apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont); * error to be returned. * * APR_EINTR is never returned. + * @deffunc apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) */ -apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes); +APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, + apr_size_t *nbytes); /** * Write data to the specified file. @@ -471,8 +327,10 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes); * It is possible for both bytes to be written and an error to be returned. * * APR_EINTR is never returned. + * @deffunc apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) */ -apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes); +APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, + apr_size_t *nbytes); /** * Write data from iovec array to the specified file. @@ -488,9 +346,11 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) * apr_writev is available even if the underlying operating system * * doesn't provide writev(). + * @deffunc apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) */ -apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, - apr_size_t nvec, apr_size_t *nbytes); +APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, + const struct iovec *vec, + apr_size_t nvec, apr_size_t *nbytes); /** * Read data from the specified file, ensuring that the buffer is filled @@ -509,9 +369,11 @@ apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, * error to be returned. * * APR_EINTR is never returned. + * @deffunc apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read) */ -apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, - apr_size_t *bytes_read); +APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, + apr_size_t nbytes, + apr_size_t *bytes_read); /** * Write data to the specified file, ensuring that all of the data is @@ -528,51 +390,59 @@ apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, * It is possible for both bytes to be written and an error to be returned. * * APR_EINTR is never returned. + * @deffunc apr_status_t apr_full_write(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written) */ -apr_status_t apr_full_write(apr_file_t *thefile, const void *buf, - apr_size_t nbytes, apr_size_t *bytes_written); +APR_DECLARE(apr_status_t) apr_full_write(apr_file_t *thefile, const void *buf, + apr_size_t nbytes, + apr_size_t *bytes_written); /** * put a character into the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to + * @deffunc apr_status_t apr_putc(char ch, apr_file_t *thefile) */ -apr_status_t apr_putc(char ch, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_putc(char ch, apr_file_t *thefile); /** * get a character from the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to + * @deffunc apr_status_t apr_getc(char *ch, apr_file_t *thefile) */ -apr_status_t apr_getc(char *ch, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_getc(char *ch, apr_file_t *thefile); /** * put a character back onto a specified stream. * @param ch The character to write. * @param thefile The file descriptor to write to + * @deffunc apr_status_t apr_ungetc(char ch, apr_file_t *thefile) */ -apr_status_t apr_ungetc(char ch, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_ungetc(char ch, apr_file_t *thefile); /** * Get a string from a specified file. * @param str The buffer to store the string in. * @param len The length of the string * @param thefile The file descriptor to read from + * @deffunc apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) */ -apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_fgets(char *str, int len, apr_file_t *thefile); /** * Put the string into a specified file. * @param str The string to write. * @param thefile The file descriptor to write to + * @deffunc apr_status_t apr_puts(const char *str, apr_file_t *thefile) */ -apr_status_t apr_puts(const char *str, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_puts(const char *str, apr_file_t *thefile); /** * Flush the file's buffer. * @param thefile The file descriptor to flush + * @deffunc apr_status_t apr_flush(apr_file_t *thefile) */ -apr_status_t apr_flush(apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_flush(apr_file_t *thefile); /** * duplicate the specified file descriptor. @@ -580,15 +450,20 @@ apr_status_t apr_flush(apr_file_t *thefile); * @param old_file The file to duplicate. * @param p The pool to use for the new file. * @tip *arg1 must point to a valid apr_file_t, or point to NULL + * @deffunc apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) */ -apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file, + apr_file_t *old_file, + apr_pool_t *p); /** * get the specified file's stats. * @param finfo Where to store the information about the file. * @param thefile The file to get information about. + * @deffunc apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) */ -apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, + apr_file_t *thefile); /** * set the specified file's permission bits. @@ -599,8 +474,10 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile); * are specified which could not be set. * * Platforms which do not implement this feature will return APR_ENOTIMPL. + * @deffunc apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) */ -apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms); +APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname, + apr_fileperms_t perms); /** * get the specified file's stats. The file is specified by filename, @@ -609,8 +486,10 @@ apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms); * never touched if the call fails. * @param fname The name of the file to stat. * @param cont the pool to use to allocate the new file. + * @deffunc apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) */ -apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, + apr_pool_t *cont); /** * get the specified file's stats. The file is specified by filename, @@ -620,8 +499,10 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont); * never touched if the call fails. * @param fname The name of the file to stat. * @param cont the pool to use to allocate the new file. + * @deffunc apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) */ -apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, + apr_pool_t *cont); /** * Move the read/write file offset to a specified byte within a file. @@ -634,83 +515,102 @@ apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont); * @param offset The offset to move the pointer to. * @tip The third argument is modified to be the offset the pointer was actually moved to. + * @deffunc apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) */ -apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where,apr_off_t *offset); +APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile, + apr_seek_where_t where, + apr_off_t *offset); /** * Open the specified directory. * @param new_dir The opened directory descriptor. * @param dirname The full path to the directory (use / on all systems) * @param cont The pool to use. + * @deffunc apr_status_t apr_dir_open(apr_dir_t **new_dir, const char *dirname, apr_pool_t *cont) */ -apr_status_t apr_dir_open(apr_dir_t **new_dir, const char *dirname, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir, + const char *dirname, + apr_pool_t *cont); /** * close the specified directory. * @param thedir the directory descriptor to close. + * @deffunc apr_status_t apr_closedir(apr_dir_t *thedir) */ -apr_status_t apr_closedir(apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_closedir(apr_dir_t *thedir); /** * Read the next entry from the specified directory. * @param thedir the directory descriptor to read from, and fill out. * @tip All systems return . and .. as the first two files. + * @deffunc apr_status_t apr_readdir(apr_dir_t *thedir) */ -apr_status_t apr_readdir(apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_readdir(apr_dir_t *thedir); /** * Rewind the directory to the first entry. * @param thedir the directory descriptor to rewind. + * @deffunc apr_status_t apr_rewinddir(apr_dir_t *thedir) */ -apr_status_t apr_rewinddir(apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_rewinddir(apr_dir_t *thedir); /** * Create a new directory on the file system. * @param path the path for the directory to be created. (use / on all systems) * @param perm Permissions for the new direcoty. * @param cont the pool to use. + * @deffunc apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) */ -apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, +APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont); /** * Remove directory from the file system. * @param path the path for the directory to be removed. (use / on all systems) * @param cont the pool to use. + * @deffunc apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) */ -apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont); /** * Create an anonymous pipe. * @param in The file descriptor to use as input to the pipe. * @param out The file descriptor to use as output from the pipe. * @param cont The pool to operate on. + * @deffunc apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) */ -apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, + apr_pool_t *cont); /** * Create a named pipe. * @param filename The filename of the named pipe * @param perm The permissions for the newly created pipe. * @param cont The pool to operate on. + * @deffunc apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) */ -apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_create_namedpipe(const char *filename, + apr_fileperms_t perm, + apr_pool_t *cont); /** * Get the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are getting a timeout for. * @param timeout The current timeout value in microseconds. + * @deffunc apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) */ -apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout); +APR_DECLARE(apr_status_t) apr_get_pipe_timeout(apr_file_t *thepipe, + apr_interval_time_t *timeout); /** * Set the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are setting a timeout on. * @param timeout The timeout value in microseconds. Values < 0 mean wait * forever, 0 means do not wait at all. + * @deffunc apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) */ -apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout); +APR_DECLARE(apr_status_t) apr_set_pipe_timeout(apr_file_t *thepipe, + apr_interval_time_t timeout); /** file (un)locking functions. */ @@ -722,14 +622,16 @@ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeo * block. * @param thefile The file to lock. * @param type The type of lock to establish on the file. + * @deffunc apr_status_t apr_lock_file(apr_file_t *thefile, int type) */ -apr_status_t apr_lock_file(apr_file_t *thefile, int type); +APR_DECLARE(apr_status_t) apr_lock_file(apr_file_t *thefile, int type); /** * Remove any outstanding locks on the file. * @param thefile The file to unlock. + * @deffunc apr_status_t apr_unlock_file(apr_file_t *thefile) */ -apr_status_t apr_unlock_file(apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_unlock_file(apr_file_t *thefile); /**accessor and general file_io functions. */ @@ -737,23 +639,29 @@ apr_status_t apr_unlock_file(apr_file_t *thefile); * return the file name of the current file. * @param new_path The path of the file. * @param thefile The currently open file. + * @deffunc apr_status_t apr_get_filename(const char **new_path, apr_file_t *thefile) */ -apr_status_t apr_get_filename(const char **new_path, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_get_filename(const char **new_path, + apr_file_t *thefile); /** * Get the file name of the current directory entry. * @param new_path the file name of the directory entry. * @param thedir the currently open directory. + * @deffunc apr_status_t apr_get_dir_filename(const char **new_path, apr_dir_t *thedir) */ -apr_status_t apr_get_dir_filename(const char **new_path, apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_get_dir_filename(const char **new_path, + apr_dir_t *thedir); /** * Return the data associated with the current file. * @param data The user data associated with the file. * @param key The key to use for retreiving data associated with this file. * @param file The currently open file. + * @deffunc apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file) */ -apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file); +APR_DECLARE(apr_status_t) apr_get_filedata(void **data, const char *key, + apr_file_t *file); /** * Set the data associated with the current file. @@ -761,30 +669,38 @@ apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file); * @param data The user data to associate with the file. * @param key The key to use for assocaiteing data with the file. * @param cleanup The cleanup routine to use when the file is destroyed. + * @deffunc apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)) */ -apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key, - apr_status_t (*cleanup) (void *)); +APR_DECLARE(apr_status_t) apr_set_filedata(apr_file_t *file, void *data, + const char *key, + apr_status_t (*cleanup)(void *)); /** * Get the size of the current directory entry. * @param size the size of the directory entry. * @param thedir the currently open directory. + * @deffunc apr_status_t apr_dir_entry_size(apr_size_t *size, apr_dir_t *thedir) */ -apr_status_t apr_dir_entry_size(apr_size_t *size, apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_dir_entry_size(apr_size_t *size, + apr_dir_t *thedir); /** * Get the last modified time of the current directory entry. * @param mtime the last modified time of the directory entry. * @param thedir the currently open directory. + * @deffunc apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir) */ -apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_dir_entry_mtime(apr_time_t *mtime, + apr_dir_t *thedir); /** * Get the file type of the current directory entry. * @param type the file type of the directory entry. * @param thedir the currently open directory. + * @deffunc apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) */ -apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_dir_entry_ftype(apr_filetype_e *type, + apr_dir_t *thedir); /** * Write a string to a file using a printf format. @@ -794,7 +710,7 @@ apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir); * @return The number of bytes written * @deffunc int apr_fprintf(apr_file_t *fptr, const char *format, ...) */ -APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE_NONSTD(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) __attribute__((format(printf,2,3))); #ifdef __cplusplus diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index 70e9ec296d7..c43828ea948 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -69,8 +69,8 @@ extern "C" { * @deffunc apr_status_t apr_fnmatch(const char *pattern, const char *strings, int flags) */ -APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, const char *strings, - int flags); +APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, + const char *strings, int flags); /** * Determine if the given pattern is a regular expression. diff --git a/include/apr_general.h b/include/apr_general.h index 4eebdef613f..77ec5cf3ce1 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -253,20 +253,25 @@ int strncasecmp(const char *a, const char *b, size_t n); */ #if APR_HAS_RANDOM + +/* TODO: I'm not sure this is the best place to put this prototype...*/ /** * Generate a string of random bytes. * @param buf Random bytes go here * @param length size of the buffer + * @deffunc apr_status_t apr_generate_random_bytes(unsigned char * buf, int length) */ -/* TODO: I'm not sure this is the best place to put this prototype...*/ -apr_status_t apr_generate_random_bytes(unsigned char * buf, int length); +APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, + int length); + #endif /** * Setup any APR internal data structures. This MUST be the first function * called for any APR program. + * @deffunc apr_status_t apr_initialize(void) */ -apr_status_t apr_initialize(void); +APR_DECLARE(apr_status_t) apr_initialize(void); /** * Tear down any APR internal data structures which aren't torn down @@ -274,8 +279,9 @@ apr_status_t apr_initialize(void); * @tip An APR program must call this function at termination once it * has stopped using APR services. The APR developers suggest using * atexit to ensure this is called. + * @deffunc void apr_terminate(void) */ -void apr_terminate(void); +APR_DECLARE(void) apr_terminate(void); /** * Set the APR_ABORT function. @@ -285,8 +291,10 @@ void apr_terminate(void); * to actually exit the program. If this function is not called, * then APR will return an error and expect the calling program to * deal with the error accordingly. + * @deffunc apr_status_t apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont) */ -apr_status_t apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_set_abort(int (*apr_abort)(int retcode), + apr_pool_t *cont); #ifdef __cplusplus } diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 63037bda5dd..9feb6a7211e 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -57,6 +57,10 @@ #include "apr_pools.h" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + /** * @package APR command arguments */ @@ -165,4 +169,9 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, const apr_getopt_option_t *opts, int *optch, const char **optarg); + +#ifdef __cplusplus +} +#endif + #endif /* ! APR_GETOPT_H */ diff --git a/include/apr_hash.h b/include/apr_hash.h index 15cdab7b3cb..5f3f9ef43dc 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -111,7 +111,7 @@ APR_DECLARE(apr_hash_t *) apr_make_hash(apr_pool_t *pool); * @deffunc void apr_hash_set(apr_hash_t *ht, const void *key, apr_size_t klen, const void *val) */ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key, - apr_ssize_t klen, const void *val); + apr_ssize_t klen, const void *val); /** * Look up the value associated with a key in a hash table. @@ -122,7 +122,7 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key, * @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, apr_size_t klen) */ APR_DECLARE(void*) apr_hash_get(apr_hash_t *ht, const void *key, - apr_ssize_t klen); + apr_ssize_t klen); /** * Start iterating over the entries in a hash table. @@ -171,7 +171,7 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); * @deffunc void apr_hash_this(apr_hash_index_t *hi, const void **key, apr_size_t *klen, void **val); */ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, - apr_size_t *klen, void **val); + apr_size_t *klen, void **val); /** * Get the number of key/value pairs in the hash table. diff --git a/include/apr_lib.h b/include/apr_lib.h index dc35ac028c9..fbaeac5c311 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -205,8 +205,8 @@ APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname); * @deffunc int apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), apr_vformatter_buff_t *c, const char *fmt, va_list ap) */ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), - apr_vformatter_buff_t *c, const char *fmt, - va_list ap); + apr_vformatter_buff_t *c, const char *fmt, + va_list ap); /** * Validate any password encypted with any algorithm that APR understands @@ -214,7 +214,8 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), * @param hash The password to validate against * @deffunc apr_status_t apr_validate_password(const char *passwd, const char *hash) */ -APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, const char *hash); +APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, + const char *hash); /* * These are snprintf implementations based on apr_vformatter(). @@ -243,7 +244,7 @@ APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, const char * * @deffunc int apr_snprintf(char *buf, size_t len, const char *format, ...) */ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, size_t len, - const char *format, ...) + const char *format, ...) __attribute__((format(printf,3,4))); /** @@ -256,7 +257,7 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, size_t len, * @deffunc int apr_vsnprintf(char *buf, size_t len, const char *format, va_list ap) */ APR_DECLARE(int) apr_vsnprintf(char *buf, size_t len, const char *format, - va_list ap); + va_list ap); /** * Display a prompt and read in the password from stdin. @@ -265,7 +266,8 @@ APR_DECLARE(int) apr_vsnprintf(char *buf, size_t len, const char *format, * @param bufsize The length of the password string. * @deffunc apr_status_t apr_getpass(const char *prompt, char *pwbuf, size_t *bufsize) */ -APR_DECLARE(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, size_t *bufsize); +APR_DECLARE(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, + size_t *bufsize); #ifdef __cplusplus } diff --git a/include/apr_lock.h b/include/apr_lock.h index d385a14b2e5..eaeaff97712 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -96,30 +96,36 @@ typedef struct apr_lock_t apr_lock_t; * @param cont The pool to operate on. * @tip APR_CROSS_PROCESS may lock both processes and threads, but it is * only guaranteed to lock processes. + * @deffunc apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *cont) */ -apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, - apr_lockscope_e scope, const char *fname, - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_create_lock(apr_lock_t **lock, + apr_locktype_e type, + apr_lockscope_e scope, + const char *fname, + apr_pool_t *cont); /** * Lock a protected region. * @param lock The lock to set. + * @deffunc apr_status_t apr_lock(apr_lock_t *lock) */ -apr_status_t apr_lock(apr_lock_t *lock); +APR_DECLARE(apr_status_t) apr_lock(apr_lock_t *lock); /** * Unlock a protected region. * @param lock The lock to reset. + * @deffunc apr_status_t apr_unlock(apr_lock_t *lock) */ -apr_status_t apr_unlock(apr_lock_t *lock); +APR_DECLARE(apr_status_t) apr_unlock(apr_lock_t *lock); /** * Free the memory associated with a lock. * @param lock The lock to free. + * @deffunc apr_status_t apr_destroy_lock(apr_lock_t *lock) * @tip If the lock is currently active when it is destroyed, it * will be unlocked first. */ -apr_status_t apr_destroy_lock(apr_lock_t *lock); +APR_DECLARE(apr_status_t) apr_destroy_lock(apr_lock_t *lock); /** * Re-open a lock in a child process. @@ -133,17 +139,21 @@ apr_status_t apr_destroy_lock(apr_lock_t *lock); * locking mechanism chosen for the platform, but it is a good * idea to call it regardless, because it makes the code more * portable. + * @deffunc apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, apr_pool_t *cont) */ -apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_child_init_lock(apr_lock_t **lock, + const char *fname, + apr_pool_t *cont); /** * Return the pool associated with the current lock. * @param lock The currently open lock. * @param key The key to use when retreiving data associated with this lock * @param data The user data associated with the lock. + * @deffunc apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) */ -apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data); +APR_DECLARE(apr_status_t) apr_get_lockdata(apr_lock_t *lock, const char *key, + void *data); /** * Return the pool associated with the current lock. @@ -151,9 +161,11 @@ apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data); * @param data The user data to associate with the lock. * @param key The key to use when associating data with this lock * @param cleanup The cleanup to use when the lock is destroyed. + * @deffunc apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup)(void *)) */ -apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, - apr_status_t (*cleanup) (void *)); +APR_DECLARE(apr_status_t) apr_set_lockdata(apr_lock_t *lock, void *data, + const char *key, + apr_status_t (*cleanup)(void *)); #ifdef __cplusplus } diff --git a/include/apr_md5.h b/include/apr_md5.h index d3405c1eca9..b38fc25849a 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -131,8 +131,8 @@ APR_DECLARE(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context); * @deffunc apr_status_t apr_MD5SetXlate(apr_md5_ctx_t *context, apr_xlate_t *xlate) */ #if APR_HAS_XLATE -APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, - apr_xlate_t *xlate); +APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, + apr_xlate_t *xlate); #else #define apr_MD5SetXlate(context, xlate) APR_ENOTIMPL #endif @@ -146,8 +146,8 @@ APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, * @deffunc apr_status_t apr_MD5Update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) */ APR_DECLARE(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, - const unsigned char *input, - unsigned int inputLen); + const unsigned char *input, + unsigned int inputLen); /** * MD5 finalization. Ends an MD5 message-digest operation, writing the @@ -157,7 +157,7 @@ APR_DECLARE(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, * @deffunc apr_status_t apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context) */ APR_DECLARE(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], - apr_md5_ctx_t *context); + apr_md5_ctx_t *context); /** * Encode a password using an MD5 algorithm @@ -168,7 +168,7 @@ APR_DECLARE(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], * @deffunc apr_status_t apr_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes) */ APR_DECLARE(apr_status_t) apr_MD5Encode(const char *password, const char *salt, - char *result, size_t nbytes); + char *result, size_t nbytes); #ifdef __cplusplus } diff --git a/include/apr_mmap.h b/include/apr_mmap.h index a95cedaefde..67ea0cac0c6 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -122,24 +122,29 @@ struct apr_mmap_t { * APR_MMAP_WRITE MMap opened for writing * </PRE> * @param cntxt The pool to use when creating the mmap. + * @deffunc apr_status_t apr_mmap_create(apr_mmap_t **newmmap, apr_file_t *file, apr_off_t offset, apr_size_t size, apr_int32_t flag, apr_pool_t *cntxt) */ -apr_status_t apr_mmap_create(apr_mmap_t ** newmmap, apr_file_t *file, - apr_off_t offset, apr_size_t size, - apr_int32_t flag, apr_pool_t *cntxt); +APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap, + apr_file_t *file, apr_off_t offset, + apr_size_t size, apr_int32_t flag, + apr_pool_t *cntxt); /** * Remove a mmap'ed. * @param mmap The mmap'ed file. + * @deffunc apr_status_t apr_mmap_delete(apr_mmap_t *mmap) */ -apr_status_t apr_mmap_delete(apr_mmap_t *mmap); +APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap); /** * Move the pointer into the mmap'ed file to the specified offset. * @param addr The pointer to the offset specified. * @param mmap The mmap'ed file. * @param offset The offset to move to. + * @deffunc apr_status_t apr_mmap_offset(void **addr, apr_mmap_t *mmap, apr_off_t offset) */ -apr_status_t apr_mmap_offset(void **addr, apr_mmap_t *mmap, apr_off_t offset); +APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mmap, + apr_off_t offset); #endif /* APR_HAS_MMAP */ diff --git a/include/apr_network_io.h b/include/apr_network_io.h index e5a48442f47..a235ecd5628 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -219,9 +219,11 @@ struct apr_hdtr_t { * @param family The address family of the socket (e.g., APR_INET). * @param type The type of the socket (e.g., SOCK_STREAM). * @param cont The pool to use + * @deffunc apr_status_t apr_create_socket(apr_socket_t **new_sock, int family, int type, apr_pool_t *cont) */ -apr_status_t apr_create_socket(apr_socket_t **new_sock, int family, - int type, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_create_socket(apr_socket_t **new_sock, + int family, int type, + apr_pool_t *cont); /** * Shutdown either reading, writing, or both sides of a tcp socket. @@ -232,16 +234,19 @@ apr_status_t apr_create_socket(apr_socket_t **new_sock, int family, * APR_SHUTDOWN_WRITE no longer allow write requests * APR_SHUTDOWN_READWRITE no longer allow read or write requests * </PRE> + * @deffunc apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) * @tip This does not actually close the socket descriptor, it just * controls which calls are still valid on the socket. */ -apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how); +APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, + apr_shutdown_how_e how); /** * Close a tcp socket. * @param thesocket The socket to close + * @deffunc apr_status_t apr_close_socket(apr_socket_t *thesocket) */ -apr_status_t apr_close_socket(apr_socket_t *thesocket); +APR_DECLARE(apr_status_t) apr_close_socket(apr_socket_t *thesocket); /** * Bind the socket to its associated port @@ -249,8 +254,9 @@ apr_status_t apr_close_socket(apr_socket_t *thesocket); * @param sa The socket address to bind to * @tip This may be where we will find out if there is any other process * using the selected port. + * @deffunc apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) */ -apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa); +APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa); /** * Listen to a bound socket for connections. @@ -258,8 +264,9 @@ apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa); * @param backlog The number of outstanding connections allowed in the sockets * listen queue. If this value is less than zero, the listen * queue size is set to zero. + * @deffunc apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) */ -apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog); +APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog); /** * Accept a new connection request @@ -268,9 +275,11 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog); * be used for all future communication. * @param sock The socket we are listening on. * @param connection_pool The pool for the new socket. + * @deffunc apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, apr_pool_t *connection_pool) */ -apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, - apr_pool_t *connection_pool); +APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new_sock, + apr_socket_t *sock, + apr_pool_t *connection_pool); /** * Issue a connection request to a socket either on the same machine @@ -279,8 +288,9 @@ apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, * @param sa The address of the machine we wish to connect to. If NULL, * APR assumes that the sockaddr_in in the apr_socket is * completely filled out. + * @deffunc apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) */ -apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa); +APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa); /** * Create apr_sockaddr_t from hostname, address family, and port. @@ -291,23 +301,25 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa); * @param port The port number. * @param flags Special processing flags. * @param p The pool for the apr_sockaddr_t and associated storage. + * @deffunc apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p) */ -apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, - const char *hostname, - apr_int32_t family, - apr_port_t port, - apr_int32_t flags, - apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_getaddrinfo(apr_sockaddr_t **sa, + const char *hostname, + apr_int32_t family, + apr_port_t port, + apr_int32_t flags, + apr_pool_t *p); /** * Look up the host name from an apr_sockaddr_t. * @param hostname The hostname. * @param sa The apr_sockaddr_t. * @param flags Special processing flags. + * @deffunc apr_status_t apr_getnameinfo(char **hostname, apr_sockaddr_t *sa, apr_int32_t flags) */ -apr_status_t apr_getnameinfo(char **hostname, - apr_sockaddr_t *sa, - apr_int32_t flags); +APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, + apr_sockaddr_t *sa, + apr_int32_t flags); /** * Parse hostname/IP address with scope id and port. @@ -335,12 +347,13 @@ apr_status_t apr_getnameinfo(char **hostname, * @tip If scope id shouldn't be allowed, check for scope_id != NULL in addition * to checking the return code. If addr/hostname should be required, check * for addr == NULL in addition to checking the return code. + * @deffunc apr_status_t apr_parse_addr_port(char **addr, char **scope_id, apr_port_t *port, const char *str, apr_pool_t *p) */ -apr_status_t apr_parse_addr_port(char **addr, - char **scope_id, - apr_port_t *port, - const char *str, - apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, + char **scope_id, + apr_port_t *port, + const char *str, + apr_pool_t *p); /** * Get name of the current machine @@ -348,17 +361,19 @@ apr_status_t apr_parse_addr_port(char **addr, * @param len The maximum length of the hostname that can be stored in the * buffer provided. * @param cont The pool to use. + * @deffunc apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont) */ -apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont); /** * Return the data associated with the current socket * @param data The user data associated with the socket. * @param key The key to associate with the user data. * @param sock The currently open socket. + * @deffunc apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock) */ -apr_status_t apr_get_socketdata(void **data, const char *key, - apr_socket_t *sock); +APR_DECLARE(apr_status_t) apr_get_socketdata(void **data, const char *key, + apr_socket_t *sock); /** * Set the data associated with the current socket. @@ -366,10 +381,11 @@ apr_status_t apr_get_socketdata(void **data, const char *key, * @param data The user data to associate with the socket. * @param key The key to associate with the data. * @param cleanup The cleanup to call when the socket is destroyed. + * @deffunc apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup)(void*)) */ -apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, - const char *key, - apr_status_t (*cleanup) (void*)); +APR_DECLARE(apr_status_t) apr_set_socketdata(apr_socket_t *sock, void *data, + const char *key, + apr_status_t (*cleanup)(void*)); /** * Send data over a network. @@ -377,6 +393,7 @@ apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, * @param buf The buffer which contains the data to be sent. * @param len On entry, the number of bytes to send; on exit, the number * of bytes sent. + * @deffunc apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) * @tip * <PRE> * This functions acts like a blocking write by default. To change @@ -387,7 +404,8 @@ apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, * APR_EINTR is never returned. * </PRE> */ -apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len); +APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, + apr_size_t *len); /** * Send multiple packets of data over a network. @@ -395,6 +413,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len); * @param vec The array of iovec structs containing the data to send * @param nvec The number of iovec structs in the array * @param len Receives the number of bytes actually written + * @deffunc apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len) * @tip * <PRE> * This functions acts like a blocking write by default. To change @@ -406,10 +425,12 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len); * APR_EINTR is never returned. * </PRE> */ -apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, - apr_int32_t nvec, apr_size_t *len); +APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, + const struct iovec *vec, + apr_int32_t nvec, apr_size_t *len); #if APR_HAS_SENDFILE + /** * Send a file from an open file descriptor to a socket, along with * optional headers and trailers @@ -421,14 +442,16 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, * (output) - Number of bytes actually sent, * including headers, file, and trailers * @param flags APR flags that are mapped to OS specific flags + * @deffunc apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags) * @tip This functions acts like a blocking write by default. To change * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. * The number of bytes actually sent is stored in argument 5. */ -apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, - apr_hdtr_t *hdtr, apr_off_t *offset, - apr_size_t *len, apr_int32_t flags); -#endif +APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, + apr_size_t *len, apr_int32_t flags); + +#endif /* APR_HAS_SENDFILE */ /** * Read data from a network. @@ -436,6 +459,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, * @param buf The buffer to store the data in. * @param len On entry, the number of bytes to receive; on exit, the number * of bytes received. + * @deffunc apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) * @tip * <PRE> * This functions acts like a blocking read by default. To change @@ -448,7 +472,8 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, * APR_EINTR is never returned. * </PRE> */ -apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len); +APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, + char *buf, apr_size_t *len); /** * Setup socket options for the specified socket @@ -469,9 +494,10 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len); * APR_SO_RCVBUF -- Set the ReceiveBufferSize * </PRE> * @param on Value for the option. + * @deffunc apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) */ -apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, - apr_int32_t on); +APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t on); /** * Query socket options for the specified socket @@ -494,57 +520,70 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, * (Currently only used on Windows) * </PRE> * @param on Socket option returned on the call. + * @deffunc apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t* on) */ -apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, - apr_int32_t* on); +APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t* on); /** * Return an apr_sockaddr_t from an apr_socket_t * @param sa The returned apr_sockaddr_t. * @param which Which interface do we want the apr_sockaddr_t for? * @param sock The socket to use + * @deffunc apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock) */ -apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, - apr_socket_t *sock); +APR_DECLARE(apr_status_t) apr_get_sockaddr(apr_sockaddr_t **sa, + apr_interface_e which, + apr_socket_t *sock); /** * Set the port in an APR socket address. * @param sockaddr The socket address to set. * @param port The port to be stored in the socket address. + * @deffunc apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port) */ -apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port); +APR_DECLARE(apr_status_t) apr_set_port(apr_sockaddr_t *sockaddr, + apr_port_t port); /** * Return the port in an APR socket address. * @param port The port from the socket address. * @param sockaddr The socket address to reference. + * @deffunc apr_status_t apr_get_port(apr_port_t *port, apr_sockaddr_t *sockaddr) */ -apr_status_t apr_get_port(apr_port_t *port, apr_sockaddr_t *sockaddr); +APR_DECLARE(apr_status_t) apr_get_port(apr_port_t *port, + apr_sockaddr_t *sockaddr); /** * Set the IP address in an APR socket address. * @param sockaddr The socket address to use * @param addr The IP address to attach to the socket. * Use APR_ANYADDR to use any IP addr on the machine. + * @deffunc apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr) */ -apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr); +APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr, + const char *addr); /** * Return the IP address (in numeric address string format) in * an APR socket address. * @param addr The IP address. * @param sockaddr The socket address to reference. + * @deffunc apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr) */ -apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr); +APR_DECLARE(apr_status_t) apr_get_ipaddr(char **addr, + apr_sockaddr_t *sockaddr); /** * Setup the memory required for poll to operate properly * @param new_poll The poll structure to be used. * @param num The number of socket descriptors to be polled. * @param cont The pool to operate on. + * @deffunc apr_status_t apr_setup_poll(apr_pollfd_t **new_poll, apr_int32_t num, apr_pool_t *cont) */ -apr_status_t apr_setup_poll(apr_pollfd_t **new_poll, apr_int32_t num, - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_setup_poll(apr_pollfd_t **new_poll, + apr_int32_t num, + apr_pool_t *cont); /** * Poll the sockets in the poll structure @@ -561,8 +600,10 @@ apr_status_t apr_setup_poll(apr_pollfd_t **new_poll, apr_int32_t num, * This is a blocking call, and it will not return until either a * socket has been signalled, or the timeout has expired. * </PRE> + * @deffunc apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_interval_time_t timeout) */ -apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_interval_time_t timeout); +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, + apr_interval_time_t timeout); /** * Add a socket to the poll structure. @@ -574,9 +615,11 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_interval_time * APR_POLLPRI signal if prioirty data is availble to be read * APR_POLLOUT signal if write will not block * </PRE> + * @deffunc apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) */ -apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, - apr_int16_t event); +APR_DECLARE(apr_status_t) apr_add_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, + apr_int16_t event); /** * Modify a socket in the poll structure with mask. @@ -588,15 +631,19 @@ apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, * APR_POLLPRI signal if prioirty data is availble to be read * APR_POLLOUT signal if write will not block * </PRE> + * @deffunc apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) */ -apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, - apr_int16_t events); +APR_DECLARE(apr_status_t) apr_mask_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, + apr_int16_t events); /** * Remove a socket from the poll structure. * @param aprset The poll structure we will be using. * @param sock The socket to remove from the current poll structure. + * @deffunc apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) */ -apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock); +APR_DECLARE(apr_status_t) apr_remove_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock); /** * Remove all sockets from the poll structure. @@ -607,8 +654,10 @@ apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock); * APR_POLLPRI signal if prioirty data is availble to be read * APR_POLLOUT signal if write will not block * </PRE> + * @deffunc apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events) */ -apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events); +APR_DECLARE(apr_status_t) apr_clear_poll_sockets(apr_pollfd_t *aprset, + apr_int16_t events); /** * Get the return events for the specified socket. @@ -624,17 +673,21 @@ apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events); * </PRE> * @param sock The socket we wish to get information about. * @param aprset The poll structure we will be using. + * @deffunc apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) */ -apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, - apr_pollfd_t *aprset); +APR_DECLARE(apr_status_t) apr_get_revents(apr_int16_t *event, + apr_socket_t *sock, + apr_pollfd_t *aprset); /** * Return the data associated with the current poll. * @param pollfd The currently open pollfd. * @param key The key to use for retreiving data associated with a poll struct. * @param data The user data associated with the pollfd. + * @deffunc apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) */ -apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data); +APR_DECLARE(apr_status_t) apr_get_polldata(apr_pollfd_t *pollfd, + const char *key, void *data); /** * Set the data associated with the current poll. @@ -642,30 +695,36 @@ apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) * @param data The key to associate with the data. * @param key The user data to associate with the pollfd. * @param cleanup The cleanup function + * @deffunc apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup)(void *)) */ -apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, - const char *key, - apr_status_t (*cleanup) (void *)); +APR_DECLARE(apr_status_t) apr_set_polldata(apr_pollfd_t *pollfd, void *data, + const char *key, + apr_status_t (*cleanup)(void *)); #if APR_FILES_AS_SOCKETS + /** * Convert a File type to a socket so that it can be used in a poll operation. * @param newsock the newly created socket which represents a file. * @param file the file to mask as a socket. + * @deffunc apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file) * @warning This is not available on all platforms. Platforms that have the * ability to poll files for data to be read/written/exceptions will * have the APR_FILES_AS_SOCKETS macro defined as true. */ -apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file); -#endif +APR_DECLARE(apr_status_t) apr_socket_from_file(apr_socket_t **newsock, + apr_file_t *file); + +#endif /* APR_FILES_AS_SOCKETS */ /** * Given an apr_sockaddr_t and a service name, set the port for the service * @param sockaddr The apr_sockaddr_t that will have it's port set * @param servname The name of the service you wish to use + * @deffunc apr_status_t apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname) */ - -apr_status_t apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname); +APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, + const char *servname); #ifdef __cplusplus } diff --git a/include/apr_pools.h b/include/apr_pools.h index dddab520f03..a5c5f171594 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -73,8 +73,8 @@ extern "C" { * Instead, we maintain pools, and allocate items (both memory and I/O * handlers) from the pools --- currently there are two, one for per * transaction info, and one for config info. When a transaction is over, - * we can delete everything in the per-transaction apr_pool_t without fear, and - * without thinking too hard about it either. + * we can delete everything in the per-transaction apr_pool_t without fear, + * and without thinking too hard about it either. * * rst */ @@ -139,9 +139,10 @@ struct apr_pool_t { struct apr_pool_t *joined; #endif /** A function to control how pools behave when they receive ENOMEM - * @deffunc int apr_abort(int retcode) */ + * @deffunc int (*apr_abort)(int retcode) */ int (*apr_abort)(int retcode); - /** A place to hold user data associated with this pool + /** + * A place to hold user data associated with this pool * @defvar apr_hash_t *prog_data */ struct apr_hash_t *prog_data; }; @@ -240,7 +241,8 @@ APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp); * be a sub-pool. * @deffunc apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, + apr_pool_t *cont); /** * Set the data associated with the current pool @@ -256,11 +258,11 @@ APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont * data by choosing a key that another part of the program is using * It is advised that steps are taken to ensure that a unique * key is used at all times. - * @deffunc apr_status_t apr_set_userdata(const void *data, const char *key, apr_status_t (*cleanup) (void *), apr_pool_t *cont) + * @deffunc apr_status_t apr_set_userdata(const void *data, const char *key, apr_status_t (*cleanup)(void *), apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, + apr_status_t (*cleanup)(void *), + apr_pool_t *cont); /** * Return the data associated with the current pool. @@ -269,7 +271,8 @@ APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, * @param cont The current pool. * @deffunc apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, + apr_pool_t *cont); /** * make a sub pool from the current pool @@ -280,7 +283,8 @@ APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, apr_poo * machine is out of memory. By default, APR will return on error. * @deffunc apr_pool_t *apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) */ -APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)); +APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, + int (*apr_abort)(int retcode)); /** * clear all memory in the pool @@ -339,31 +343,31 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); * @param plain_cleanup The function to call when the pool is cleared * or destroyed * @param child_cleanup The function to call when a child process is created - * @deffunc void apr_register_cleanup(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup) (void *), apr_status_t (*child_cleanup) (void *)) + * @deffunc void apr_register_cleanup(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)) */ APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup) (void *), - apr_status_t (*child_cleanup) (void *)); + apr_status_t (*plain_cleanup)(void *), + apr_status_t (*child_cleanup)(void *)); /** * remove a previously registered cleanup function * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup - * @deffunc void apr_kill_cleanup(apr_pool_t *p, const void *data, apr_status_t (*cleanup) (void *)) + * @deffunc void apr_kill_cleanup(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *)) */ APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, - apr_status_t (*cleanup) (void *)); + apr_status_t (*cleanup)(void *)); /** * Run the specified cleanup function immediately and unregister it * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup - * @deffunc apr_status_t apr_run_cleanup(apr_pool_t *p, void *data, apr_status_t (*cleanup) (void *)) + * @deffunc apr_status_t apr_run_cleanup(apr_pool_t *p, void *data, apr_status_t (*cleanup)(void *)) */ APR_DECLARE(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, - apr_status_t (*cleanup) (void *)); + apr_status_t (*cleanup)(void *)); /* Preparing for exec() --- close files, etc., but *don't* flush I/O * buffers, *don't* wait for subprocesses, and *don't* free any memory. @@ -382,9 +386,8 @@ APR_DECLARE(void) apr_cleanup_for_exec(void); */ APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data); - -/* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t will not be - * destroyed before the parent pool +/* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t + * will not be destroyed before the parent pool */ #ifndef APR_POOL_DEBUG #ifdef apr_pool_join diff --git a/include/apr_portable.h b/include/apr_portable.h index ffa1246f989..24683fcd330 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -130,7 +130,7 @@ struct apr_os_lock_t { typedef int apr_os_file_t; typedef DIR apr_os_dir_t; typedef int apr_os_sock_t; -typedef struct apr_os_lock_t apr_os_lock_t; +typedef struct apr_os_lock_t apr_os_lock_t; typedef thread_id apr_os_thread_t; typedef thread_id apr_os_proc_t; typedef int apr_os_threadkey_t; @@ -174,7 +174,7 @@ struct apr_os_lock_t { typedef int apr_os_file_t; typedef DIR apr_os_dir_t; typedef int apr_os_sock_t; -typedef struct apr_os_lock_t apr_os_lock_t; +typedef struct apr_os_lock_t apr_os_lock_t; #if APR_HAS_THREADS && APR_HAVE_PTHREAD_H typedef pthread_t apr_os_thread_t; typedef pthread_key_t apr_os_threadkey_t; @@ -202,91 +202,114 @@ typedef struct apr_os_sock_info_t apr_os_sock_info_t; * convert the file from apr type to os specific type. * @param thefile The os specific file we are converting to * @param file The apr file to convert. + * @deffunc apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) * @tip On Unix, it is only possible to get a file descriptor from * an apr file type. */ -apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file); +APR_DECLARE(apr_status_t) apr_get_os_file(apr_os_file_t *thefile, + apr_file_t *file); /** * convert the dir from apr type to os specific type. * @param thedir The os specific dir we are converting to * @param dir The apr dir to convert. + * @deffunc apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) */ -apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir); +APR_DECLARE(apr_status_t) apr_get_os_dir(apr_os_dir_t **thedir, + apr_dir_t *dir); /** * Convert the socket from an apr type to an OS specific socket * @param thesock The socket to convert. * @param sock The os specifc equivelant of the apr socket.. + * @deffunc apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) */ -apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock); +APR_DECLARE(apr_status_t) apr_get_os_sock(apr_os_sock_t *thesock, + apr_socket_t *sock); /** * Convert the lock from os specific type to apr type * @param oslock The os specific lock we are converting to. * @param lock The apr lock to convert. + * @deffunc apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) */ -apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock); +APR_DECLARE(apr_status_t) apr_get_os_lock(apr_os_lock_t *oslock, + apr_lock_t *lock); /** * Get the exploded time in the platforms native format. * @param ostime the native time format * @param aprtime the time to convert + * @deffunc apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprtime) */ -apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, +APR_DECLARE(apr_status_t) apr_get_os_exp_time(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprtime); /** * Get the imploded time in the platforms native format. * @param ostime the native time format * @param aprtimethe time to convert + * @deffunc apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime) */ -apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime); +APR_DECLARE(apr_status_t) apr_get_os_imp_time(apr_os_imp_time_t **ostime, + apr_time_t *aprtime); #if APR_HAS_THREADS + /** * convert the thread to os specific type from apr type. * @param thethd The apr thread to convert * @param thd The os specific thread we are converting to + * @deffunc apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd) */ -apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd); +APR_DECLARE(apr_status_t) apr_get_os_thread(apr_os_thread_t **thethd, + apr_thread_t *thd); /** * convert the thread private memory key to os specific type from an apr type. * @param thekey The apr handle we are converting from. * @param key The os specific handle we are converting to. + * @deffunc apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key) */ -apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key); -#endif +APR_DECLARE(apr_status_t) apr_get_os_threadkey(apr_os_threadkey_t *thekey, + apr_threadkey_t *key); + +#endif /* APR_HAS_THREADS */ /** * convert the file from os specific type to apr type. * @param file The apr file we are converting to. * @param thefile The os specific file to convert * @param cont The pool to use if it is needed. + * @deffunc apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) * @tip On Unix, it is only possible to put a file descriptor into * an apr file type. */ -apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_put_os_file(apr_file_t **file, + apr_os_file_t *thefile, + apr_pool_t *cont); /** * convert the dir from os specific type to apr type. * @param dir The apr dir we are converting to. * @param thedir The os specific dir to convert * @param cont The pool to use when creating to apr directory. + * @deffunc apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) */ -apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_put_os_dir(apr_dir_t **dir, + apr_os_dir_t *thedir, + apr_pool_t *cont); /** * Convert a socket from the os specific type to the apr type * @param sock The pool to use. * @param thesock The socket to convert to. * @param cont The socket we are converting to an apr type. + * @deffunc apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) */ -apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_put_os_sock(apr_socket_t **sock, + apr_os_sock_t *thesock, + apr_pool_t *cont); /** * Create a socket from an existing descriptor and local and remote @@ -295,60 +318,72 @@ apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, * @param os_sock_info The os representation of the socket handle and * other characteristics of the socket * @param cont The pool to use + * @deffunc apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont) * @tip If you only know the descriptor/handle or if it isn't really * a true socket, use apr_put_os_sock() instead. */ -apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, - apr_os_sock_info_t *os_sock_info, - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_make_os_sock(apr_socket_t **apr_sock, + apr_os_sock_info_t *os_sock_info, + apr_pool_t *cont); /** * Convert the lock from os specific type to apr type * @param lock The apr lock we are converting to. * @param thelock The os specific lock to convert. * @param cont The pool to use if it is needed. + * @deffunc apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont) */ -apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_put_os_lock(apr_lock_t **lock, + apr_os_lock_t *thelock, + apr_pool_t *cont); /** * Put the imploded time in the APR format. * @param aprtime the APR time format * @param ostime the time to convert * @param cont the pool to use if necessary + * @deffunc apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont) */ -apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_put_os_imp_time(apr_time_t *aprtime, + apr_os_imp_time_t **ostime, + apr_pool_t *cont); /** * Put the exploded time in the APR format. * @param aprtime the APR time format * @param ostime the time to convert * @param cont the pool to use if necessary + * @deffunc apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) */ -apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime, - apr_os_exp_time_t **ostime, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_put_os_exp_time(apr_exploded_time_t *aprtime, + apr_os_exp_time_t **ostime, + apr_pool_t *cont); #if APR_HAS_THREADS + /** * convert the thread from os specific type to apr type. * @param thd The apr thread we are converting to. * @param thethd The os specific thread to convert * @param cont The pool to use if it is needed. + * @deffunc apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, */ -apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_put_os_thread(apr_thread_t **thd, + apr_os_thread_t *thethd, + apr_pool_t *cont); /** * convert the thread private memory key from os specific type to apr type. * @param key The apr handle we are converting to. * @param thekey The os specific handle to convert * @param cont The pool to use if it is needed. + * @deffunc apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont) */ -apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, - apr_pool_t *cont); -#endif +APR_DECLARE(apr_status_t) apr_put_os_threadkey(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, + apr_pool_t *cont); + +#endif /* APR_HAS_THREADS */ #ifdef __cplusplus } diff --git a/include/apr_shmem.h b/include/apr_shmem.h index 75023869e7c..908b10a2a70 100644 --- a/include/apr_shmem.h +++ b/include/apr_shmem.h @@ -87,35 +87,41 @@ typedef struct shmem_t apr_shmem_t; * @param file The file to use for the shared memory on platforms * that require it. * @param cont The pool to use + * @deffunc apr_status_t apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) */ -apr_status_t apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, + const char *file, apr_pool_t *cont); /** * Destroy the shared memory block. * @param m The shared memory block to destroy. + * @deffunc apr_status_t apr_shm_destroy(apr_shmem_t *m) */ -apr_status_t apr_shm_destroy(apr_shmem_t *m); +APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m); /** * allocate memory from the block of shared memory. * @param c The shared memory block to destroy. * @param reqsize How much memory to allocate + * @deffunc void *apr_shm_malloc(apr_shmem_t *c, apr_size_t reqsize) */ -void *apr_shm_malloc(apr_shmem_t *c, apr_size_t reqsize); +APR_DECLARE(void *) apr_shm_malloc(apr_shmem_t *c, apr_size_t reqsize); /** * allocate memory from the block of shared memory and initialize it to zero. * @param shared The shared memory block to destroy. * @param size How much memory to allocate + * @deffunc void *apr_shm_calloc(apr_shmem_t *shared, apr_size_t size) */ -void *apr_shm_calloc(apr_shmem_t *shared, apr_size_t size); +APR_DECLARE(void *) apr_shm_calloc(apr_shmem_t *shared, apr_size_t size); /** * free shared memory previously allocated. * @param shared The shared memory block to destroy. * @param entity The actual data to free. + * @deffunc apr_status_t apr_shm_free(apr_shmem_t *shared, void *entity) */ -apr_status_t apr_shm_free(apr_shmem_t *shared, void *entity); +APR_DECLARE(apr_status_t) apr_shm_free(apr_shmem_t *shared, void *entity); /** * Get the name of the shared memory segment if not using anonymous @@ -128,8 +134,10 @@ apr_status_t apr_shm_free(apr_shmem_t *shared, void *entity); * based on file access. APR_USES_KEYBASED_SHM if shared * memory is based on a key value such as shmctl. If the * shared memory is anonymous, the name is NULL. + * @deffunc apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) */ -apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name); +APR_DECLARE(apr_status_t) apr_get_shm_name(apr_shmem_t *c, + apr_shm_name_t **name); /** * Set the name of the shared memory segment if not using anonymous @@ -141,21 +149,25 @@ apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name); * @return APR_USES_ANONYMOUS_SHM if we are using anonymous shared * memory. APR_SUCCESS if we are using named shared memory * and we were able to assign the name correctly. + * @deffunc apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) */ -apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name); +APR_DECLARE(apr_status_t) apr_set_shm_name(apr_shmem_t *c, + apr_shm_name_t *name); /** * Open the shared memory block in a child process. * @param The shared memory block to open in the child. + * @deffunc apr_status_t apr_open_shmem(apr_shmem_t *c) */ -apr_status_t apr_open_shmem(apr_shmem_t *c); +APR_DECLARE(apr_status_t) apr_open_shmem(apr_shmem_t *c); /** * Determine how much memory is available in the specified shared memory block * @param c The shared memory block to open in the child. * @param avail The amount of space available in the shared memory block. + * @deffunc apr_status_t apr_shm_avail(apr_shmem_t *c, apr_size_t *avail) */ -apr_status_t apr_shm_avail(apr_shmem_t *c, apr_size_t *avail); +APR_DECLARE(apr_status_t) apr_shm_avail(apr_shmem_t *c, apr_size_t *avail); #ifdef __cplusplus } diff --git a/include/apr_strings.h b/include/apr_strings.h index 46d10df0295..8c87a57f4c0 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -101,8 +101,9 @@ extern "C" { * @return Either <0, 0, or >0. If the first string is less than the second * this returns <0, if they are equivalent it returns 0, and if the * first string is greater than second string it retuns >0. + * @deffunc int apr_strnatcmp(char const *a, char const *b) */ -int apr_strnatcmp(char const *a, char const *b); +APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b); /** * Do a natural order comparison of two strings ignoring the case of the @@ -112,8 +113,9 @@ int apr_strnatcmp(char const *a, char const *b); * @return Either <0, 0, or >0. If the first string is less than the second * this returns <0, if they are equivalent it returns 0, and if the * first string is greater than second string it retuns >0. + * @deffunc int apr_strnatcasecmp(char const *a, char const *b) */ -int apr_strnatcasecmp(char const *a, char const *b); +APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b); /** * duplicate a string into memory allocated out of a pool @@ -203,8 +205,8 @@ APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src); * @deffunc apr_status_t apr_tokenize_to_argv(const char *arg_str, char ***argv_out, apr_pool_t *token_context); */ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, - char ***argv_out, - apr_pool_t *token_context); + char ***argv_out, + apr_pool_t *token_context); #ifdef __cplusplus } diff --git a/include/apr_tables.h b/include/apr_tables.h index fce17e3b354..84de6e917ec 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -179,6 +179,7 @@ struct apr_btable_entry_t { * @deffunc apr_array_header_t *apr_table_elts(apr_table_t *t) */ #define apr_table_elts(t) ((apr_array_header_t *)(t)) + /** * Get the elements from a binary table * @param t The table @@ -191,6 +192,7 @@ struct apr_btable_entry_t { * Determine if the table is empty * @param t The table to check * @return True if empty, Falso otherwise + * @deffunc int apr_is_empty_table(apr_table_t *t) */ #define apr_is_empty_table(t) (((t) == NULL) \ || (((apr_array_header_t *)(t))->nelts == 0)) @@ -198,6 +200,7 @@ struct apr_btable_entry_t { * Determine if the binary table is empty * @param t The table to check * @return True if empty, Falso otherwise + * @deffunc int apr_is_empty_btable(apr_table_t *t) */ #define apr_is_empty_btable(t) apr_is_empty_table(t) @@ -207,10 +210,10 @@ struct apr_btable_entry_t { * @param nelts the number of elements in the initial array * @param elt_size The size of each element in the array. * @return The new array - * #deffunc apr_array_header_t *apr_make_array(struct apr_pool_t *p, int nelts, int elt_size) + * @deffunc apr_array_header_t *apr_make_array(struct apr_pool_t *p, int nelts, int elt_size) */ APR_DECLARE(apr_array_header_t *) apr_make_array(struct apr_pool_t *p, - int nelts, int elt_size); + int nelts, int elt_size); /** * Add a new element to an array @@ -230,21 +233,21 @@ APR_DECLARE(void *) apr_push_array(apr_array_header_t *arr); * @deffunc void apr_array_cat(apr_array_header_t *dst, const apr_array_header_t *src) */ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, - const apr_array_header_t *src); + const apr_array_header_t *src); -/* copy_array copies the *entire* array. copy_array_hdr just copies - * the header, and arranges for the elements to be copied if (and only - * if) the code subsequently does a push or arraycat. - */ /** * Copy the entire array * @param p The pool to allocate the copy of the array out of * @param arr The array to copy * @return An exact copy of the array passed in * @deffunc apr_array_header_t *apr_copy_array(apr_pool_t *p, const apr_array_header_t *arr) + * @tip The alternate apr_copy_array_hdr copies only the header, and arranges + * for the elements to be copied if (and only if) the code subsequently does + * a push or arraycat. */ -APR_DECLARE(apr_array_header_t *) apr_copy_array(struct apr_pool_t *p, - const apr_array_header_t *arr); +APR_DECLARE(apr_array_header_t *) + apr_copy_array(struct apr_pool_t *p, + const apr_array_header_t *arr); /** * Copy the headers of the array, and arrange for the elements to be copied if * and only if the code subsequently does a push or arraycat. @@ -252,10 +255,11 @@ APR_DECLARE(apr_array_header_t *) apr_copy_array(struct apr_pool_t *p, * @param arr The array to copy * @return An exact copy of the array passed in * @deffunc apr_array_header_t *apr_copy_array_hdr(apr_pool_t *p, const apr_array_header_t *arr) + * @tip The alternate apr_copy_array copies the *entire* array. */ APR_DECLARE(apr_array_header_t *) - apr_copy_array_hdr(struct apr_pool_t *p, - const apr_array_header_t *arr); + apr_copy_array_hdr(struct apr_pool_t *p, + const apr_array_header_t *arr); /** * Append one array to the end of another, creating a new array in the process. @@ -266,9 +270,9 @@ APR_DECLARE(apr_array_header_t *) * @deffunc apr_array_header_t *apr_append_arrays(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second) */ APR_DECLARE(apr_array_header_t *) - apr_append_arrays(struct apr_pool_t *p, - const apr_array_header_t *first, - const apr_array_header_t *second); + apr_append_arrays(struct apr_pool_t *p, + const apr_array_header_t *first, + const apr_array_header_t *second); /** * Generates a new string from the apr_pool_t containing the concatenated @@ -280,11 +284,11 @@ APR_DECLARE(apr_array_header_t *) * @param arr The array to generate the string from * @param sep The separator to use * @return A string containing all of the data in the array. - * @deffuncchar *apr_array_pstrcat(apr_pool_t *p, const apr_array_header_t *arr, const char sep) + * @deffunc char *apr_array_pstrcat(apr_pool_t *p, const apr_array_header_t *arr, const char sep) */ APR_DECLARE(char *) apr_array_pstrcat(struct apr_pool_t *p, - const apr_array_header_t *arr, - const char sep); + const apr_array_header_t *arr, + const char sep); /** * Make a new table @@ -310,19 +314,20 @@ APR_DECLARE(apr_btable_t *) apr_make_btable(struct apr_pool_t *p, int nelts); * @param p The pool to allocate the new table out of * @param t The table to copy * @return A copy of the table passed in - * @deffunc apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) + * @deffunc apr_table_t *apr_copy_table(apr_pool_t *p, const apr_table_t *t) */ APR_DECLARE(apr_table_t *) apr_copy_table(struct apr_pool_t *p, - const apr_table_t *t); + const apr_table_t *t); + /** * Create a new binary table and copy another table into it * @param p The pool to allocate the new table out of * @param t The table to copy * @return A copy of the table passed in - * @deffunc apr_table_t *) apr_copy_btable(apr_pool_t *p, const apr_btable_t *t) + * @deffunc apr_table_t *apr_copy_btable(apr_pool_t *p, const apr_btable_t *t) */ APR_DECLARE(apr_btable_t *) apr_copy_btable(struct apr_pool_t *p, - const apr_btable_t *t); + const apr_btable_t *t); /** * Delete all of the elements from a table @@ -330,6 +335,7 @@ APR_DECLARE(apr_btable_t *) apr_copy_btable(struct apr_pool_t *p, * @deffunc void apr_clear_table(apr_table_t *t) */ APR_DECLARE(void) apr_clear_table(apr_table_t *t); + /** * Delete all of the elements from a binary table * @param t The table to clear @@ -346,6 +352,7 @@ APR_DECLARE(void) apr_clear_btable(apr_btable_t *t); * @deffunc const char *apr_table_get(const apr_table_t *t, const char *key) */ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); + /** * Get the value associated with a given key from a binary table. After this * call, the data is still in the table. @@ -355,7 +362,7 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); * @deffunc const apr_item_t *apr_btable_get(const apr_btable_t *t, const char *key) */ APR_DECLARE(const apr_item_t *) apr_btable_get(const apr_btable_t *t, - const char *key); + const char *key); /** * Add a key/value pair to a table, if another element already exists with the @@ -368,7 +375,8 @@ APR_DECLARE(const apr_item_t *) apr_btable_get(const apr_btable_t *t, * @deffunc void apr_table_set(apr_table_t *t, const char *key, const char *val) */ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, - const char *val); + const char *val); + /** * Add a key/value pair to a binary table if another element already exists * with the same key, this will over-write the old data. @@ -381,7 +389,7 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, * @deffunc void apr_btable_set(apr_btable_t *t, const char *key, size_t size, const void *val) */ APR_DECLARE(void) apr_btable_set(apr_btable_t *t, const char *key, - size_t size, const void *val); + size_t size, const void *val); /** * Add a key/value pair to a table, if another element already exists with the @@ -395,7 +403,7 @@ APR_DECLARE(void) apr_btable_set(apr_btable_t *t, const char *key, * @deffunc void apr_table_setn(apr_table_t *t, const char *key, const char *val) */ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, - const char *val); + const char *val); /** * Add a key/value pair to a binary table if another element already exists * with the same key, this will over-write the old data. @@ -418,6 +426,7 @@ APR_DECLARE(void) apr_btable_setn(apr_btable_t *t, const char *key, * @deffunc void apr_table_unset(apr_table_t *t, const char *key) */ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key); + /** * Remove data from a binary table * @param t The table to remove data from @@ -436,7 +445,8 @@ APR_DECLARE(void) apr_btable_unset(apr_btable_t *t, const char *key); * @deffunc void apr_table_merge(apr_table_t *t, const char *key, const char *val) */ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, - const char *val); + const char *val); + /** * Add data to a table by merging the value with data that has already been * stored @@ -447,7 +457,7 @@ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, * @deffunc void apr_table_mergen(apr_table_t *t, const char *key, const char *val) */ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, - const char *val); + const char *val); /** * Add data to a table, regardless of whether there is another element with the @@ -460,7 +470,8 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, * @deffunc void apr_table_add(apr_table_t *t, const char *key, const char *val) */ APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, - const char *val); + const char *val); + /** * Add data to a binary table, regardless of whether there is another element * with the same key. @@ -473,7 +484,7 @@ APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, * @deffunc void apr_btable_add(apr_btable_t *t, const char *key, size_t size, const char *val) */ APR_DECLARE(void) apr_btable_add(apr_btable_t *t, const char *key, - size_t size, const void *val); + size_t size, const void *val); /** * Add data to a table, regardless of whether there is another element with the @@ -487,7 +498,8 @@ APR_DECLARE(void) apr_btable_add(apr_btable_t *t, const char *key, * @deffunc void apr_table_addn(apr_table_t *t, const char *key, const char *val) */ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, - const char *val); + const char *val); + /** * Add data to a binary table, regardless of whether there is another element * with the same key. @@ -501,7 +513,7 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, * @deffunc void apr_btable_addn(apr_btable_t *t, const char *key, size_t size, const char *val) */ APR_DECLARE(void) apr_btable_addn(apr_btable_t *t, const char *key, - size_t size, const void *val); + size_t size, const void *val); /** * Merge two tables into one new table @@ -512,8 +524,8 @@ APR_DECLARE(void) apr_btable_addn(apr_btable_t *t, const char *key, * @deffunc apr_table_t *apr_overlay_tables(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); */ APR_DECLARE(apr_table_t *) apr_overlay_tables(struct apr_pool_t *p, - const apr_table_t *overlay, - const apr_table_t *base); + const apr_table_t *overlay, + const apr_table_t *base); /** * Merge two binary tables into one new table * @param p The pool to use for the new table @@ -523,8 +535,8 @@ APR_DECLARE(apr_table_t *) apr_overlay_tables(struct apr_pool_t *p, * @deffunc apr_btable_t *apr_overlay_tables(apr_pool_t *p, const apr_btable_t *overlay, const apr_btable_t *base); */ APR_DECLARE(apr_btable_t *) apr_overlay_btables(struct apr_pool_t *p, - const apr_btable_t *overlay, - const apr_btable_t *base); + const apr_btable_t *overlay, + const apr_btable_t *base); /** * Iterate over a table running the provided function once for every @@ -540,9 +552,9 @@ APR_DECLARE(apr_btable_t *) apr_overlay_btables(struct apr_pool_t *p, * are run. * @deffunc void apr_table_do(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, ...) */ -APR_DECLARE(void) - apr_table_do(int (*comp) (void *, const char *, const char *), - void *rec, const apr_table_t *t, ...); +APR_DECLARE_NONSTD(void) + apr_table_do(int (*comp) (void *, const char *, const char *), + void *rec, const apr_table_t *t, ...); /** * Iterate over a table running the provided function once for every @@ -559,8 +571,8 @@ APR_DECLARE(void) * @deffunc void apr_table_vdo(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, va_list vp) */ APR_DECLARE(void) - apr_table_vdo(int (*comp) (void *, const char *, const char *), - void *rec, const apr_table_t *t, va_list); + apr_table_vdo(int (*comp) (void *, const char *, const char *), + void *rec, const apr_table_t *t, va_list); /* Conceptually, apr_overlap_tables does this: * @@ -599,7 +611,7 @@ APR_DECLARE(void) * @deffunc void apr_overlap_tables(apr_table_t *a, const apr_table_t *b, unsigned flags) */ APR_DECLARE(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, - unsigned flags); + unsigned flags); #ifdef __cplusplus } diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 18452d45154..f77bd22e66a 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -157,21 +157,26 @@ struct process_chain { * Create and initialize a new threadattr variable * @param new_attr The newly created threadattr. * @param cont The pool to use + * @deffunc apr_status_t apr_create_threadattr(apr_threadattr_t **new_attr, apr_pool_t *cont) */ -apr_status_t apr_create_threadattr(apr_threadattr_t **new_attr, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_create_threadattr(apr_threadattr_t **new_attr, + apr_pool_t *cont); /** * Set if newly created threads should be created in detach mode. * @param attr The threadattr to affect * @param on Thread detach state on or off + * @deffunc apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) */ -apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on); +APR_DECLARE(apr_status_t) apr_setthreadattr_detach(apr_threadattr_t *attr, + apr_int32_t on); /** * Get the detach mode for this threadattr. * @param attr The threadattr to reference + * @deffunc apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) */ -apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr); +APR_DECLARE(apr_status_t) apr_getthreadattr_detach(apr_threadattr_t *attr); /** * Create a new thread of execution @@ -180,38 +185,47 @@ apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr); * @param func The function to start the new thread in * @param data Any data to be passed to the starting function * @param cont The pool to use + * @deffunc apr_status_t apr_create_thread(apr_thread_t **new_thread, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) */ -apr_status_t apr_create_thread(apr_thread_t **new_thread, apr_threadattr_t *attr, - apr_thread_start_t func, void *data, - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_create_thread(apr_thread_t **new_thread, + apr_threadattr_t *attr, + apr_thread_start_t func, + void *data, apr_pool_t *cont); /** * stop the current thread * @param thd The thread to stop * @param retval The return value to pass back to any thread that cares + * @deffunc apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) */ -apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval); +APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, + apr_status_t *retval); /** * block until the desired thread stops executing. * @param retval The return value from the dead thread. * @param thd The thread to join + * @deffunc apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd); */ -apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd); +APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, + apr_thread_t *thd); /** * detach a thread * @param thd The thread to detach + * @deffunc apr_status_t apr_thread_detach(apr_thread_t *thd) */ -apr_status_t apr_thread_detach(apr_thread_t *thd); +APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd); /** * Return the pool associated with the current thread. * @param data The user data associated with the thread. * @param key The key to associate with the data * @param thread The currently open thread. + * @deffunc apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) */ -apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread); +APR_DECLARE(apr_status_t) apr_get_threaddata(void **data, const char *key, + apr_thread_t *thread); /** * Return the pool associated with the current thread. @@ -219,47 +233,57 @@ apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thre * @param key The key to use for associating the data with the tread * @param cleanup The cleanup routine to use when the thread is destroyed. * @param thread The currently open thread. + * @deffunc apr_status_t apr_set_threaddata(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) */ -apr_status_t apr_set_threaddata(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_thread_t *thread); +APR_DECLARE(apr_status_t) apr_set_threaddata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread); /** * Create and initialize a new thread private address space * @param key The thread private handle. * @param dest The destructor to use when freeing the private memory. * @param cont The pool to use + * @deffunc apr_status_t apr_create_thread_private(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) */ -apr_status_t apr_create_thread_private(apr_threadkey_t **key, void (*dest)(void *), - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_create_thread_private(apr_threadkey_t **key, + void (*dest)(void *), + apr_pool_t *cont); /** * Get a pointer to the thread private memory * @param new_mem The data stored in private memory * @param key The handle for the desired thread private memory + * @deffunc apr_status_t apr_get_thread_private(void **new_mem, apr_threadkey_t *key) */ -apr_status_t apr_get_thread_private(void **new_mem, apr_threadkey_t *key); +APR_DECLARE(apr_status_t) apr_get_thread_private(void **new_mem, + apr_threadkey_t *key); /** * Set the data to be stored in thread private memory * @param priv The data to be stored in private memory * @param key The handle for the desired thread private memory + * @deffunc apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) */ -apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key); +APR_DECLARE(apr_status_t) apr_set_thread_private(void *priv, + apr_threadkey_t *key); /** * Free the thread private memory * @param key The handle for the desired thread private memory + * @deffunc apr_status_t apr_delete_thread_private(apr_threadkey_t *key) */ -apr_status_t apr_delete_thread_private(apr_threadkey_t *key); +APR_DECLARE(apr_status_t) apr_delete_thread_private(apr_threadkey_t *key); /** * Return the pool associated with the current threadkey. * @param data The user data associated with the threadkey. * @param key The key associated with the data * @param threadkey The currently open threadkey. + * @deffunc apr_status_t apr_get_threadkeydata(void **data, const char *key, apr_threadkey_t *threadkey) */ -apr_status_t apr_get_threadkeydata(void **data, const char *key, apr_threadkey_t *threadkey); +APR_DECLARE(apr_status_t) apr_get_threadkeydata(void **data, const char *key, + apr_threadkey_t *threadkey); /** * Return the pool associated with the current threadkey. @@ -267,10 +291,11 @@ apr_status_t apr_get_threadkeydata(void **data, const char *key, apr_threadkey_t * @param key The key to associate with the data. * @param cleanup The cleanup routine to use when the file is destroyed. * @param threadkey The currently open threadkey. + * @deffunc apr_status_t apr_set_threadkeydata(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) */ -apr_status_t apr_set_threadkeydata(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_threadkey_t *threadkey); +APR_DECLARE(apr_status_t) apr_set_threadkeydata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey); /* Process Function definitions */ @@ -282,8 +307,10 @@ apr_status_t apr_set_threadkeydata(void *data, const char *key, * Create and initialize a new procattr variable * @param new_attr The newly created procattr. * @param cont The pool to use + * @deffunc apr_status_t apr_createprocattr_init(apr_procattr_t **new_attr, apr_pool_t *cont) */ -apr_status_t apr_createprocattr_init(apr_procattr_t **new_attr, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_createprocattr_init(apr_procattr_t **new_attr, + apr_pool_t *cont); /** * Determine if any of stdin, stdout, or stderr should be linked to pipes @@ -292,15 +319,18 @@ apr_status_t apr_createprocattr_init(apr_procattr_t **new_attr, apr_pool_t *cont * @param in Should stdin be a pipe back to the parent? * @param out Should stdout be a pipe back to the parent? * @param err Should stderr be a pipe back to the parent? + * @deffunc apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) */ -apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, - apr_int32_t out, apr_int32_t err); +APR_DECLARE(apr_status_t) apr_setprocattr_io(apr_procattr_t *attr, + apr_int32_t in, apr_int32_t out, + apr_int32_t err); /** * Set the child_in and/or parent_in values to existing apr_file_t values. * @param attr The procattr we care about. * @param child_in apr_file_t value to use as child_in. Must be a valid file. * @param parent_in apr_file_t value to use as parent_in. Must be a valid file. + * @deffunc apr_status_t apr_setprocattr_childin(struct apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across multiple @@ -308,36 +338,39 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, * extra function calls by not creating your own pipe since this * creates one in the process space for you. */ -apr_status_t apr_setprocattr_childin(struct apr_procattr_t *attr, apr_file_t *child_in, - apr_file_t *parent_in); +APR_DECLARE(apr_status_t) apr_setprocattr_childin(struct apr_procattr_t *attr, + apr_file_t *child_in, + apr_file_t *parent_in); /** * Set the child_out and parent_out values to existing apr_file_t values. * @param attr The procattr we care about. * @param child_out apr_file_t value to use as child_out. Must be a valid file. * @param parent_out apr_file_t value to use as parent_out. Must be a valid file. + * @deffunc apr_status_t apr_setprocattr_childout(struct apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across multiple * process invocations - such as a log file. */ -apr_status_t apr_setprocattr_childout(struct apr_procattr_t *attr, - apr_file_t *child_out, - apr_file_t *parent_out); +APR_DECLARE(apr_status_t) apr_setprocattr_childout(struct apr_procattr_t *attr, + apr_file_t *child_out, + apr_file_t *parent_out); /** * Set the child_err and parent_err values to existing apr_file_t values. * @param attr The procattr we care about. * @param child_err apr_file_t value to use as child_err. Must be a valid file. * @param parent_err apr_file_t value to use as parent_err. Must be a valid file. + * @deffunc apr_status_t apr_setprocattr_childerr(struct apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across multiple * process invocations - such as a log file. */ -apr_status_t apr_setprocattr_childerr(struct apr_procattr_t *attr, - apr_file_t *child_err, - apr_file_t *parent_err); +APR_DECLARE(apr_status_t) apr_setprocattr_childerr(struct apr_procattr_t *attr, + apr_file_t *child_err, + apr_file_t *parent_err); /** * Set which directory the child process should start executing in. @@ -345,8 +378,10 @@ apr_status_t apr_setprocattr_childerr(struct apr_procattr_t *attr, * @param dir Which dir to start in. By default, this is the same dir as * the parent currently resides in, when the createprocess call * is made. + * @deffunc apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) */ -apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir); +APR_DECLARE(apr_status_t) apr_setprocattr_dir(apr_procattr_t *attr, + const char *dir); /** * Set what type of command the child process will call. @@ -356,15 +391,19 @@ apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir); * APR_SHELLCMD -- Shell script * APR_PROGRAM -- Executable program (default) * </PRE> + * @deffunc apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, apr_cmdtype_e cmd) */ -apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, apr_cmdtype_e cmd); +APR_DECLARE(apr_status_t) apr_setprocattr_cmdtype(apr_procattr_t *attr, + apr_cmdtype_e cmd); /** * Determine if the chlid should start in detached state. * @param attr The procattr we care about. * @param detach Should the child start in detached state? Default is no. + * @deffunc apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) */ -apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach); +APR_DECLARE(apr_status_t) apr_setprocattr_detach(apr_procattr_t *attr, + apr_int32_t detach); #if APR_HAVE_STRUCT_RLIMIT /** @@ -377,9 +416,11 @@ apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach); * APR_LIMIT_NPROC * </PRE> * @param limit Value to set the limit to. + * @deffunc apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, apr_int32_t what, struct rlimit *limit) */ -apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, - struct rlimit *limit); +APR_DECLARE(apr_status_t) apr_setprocattr_limit(apr_procattr_t *attr, + apr_int32_t what, + struct rlimit *limit); #endif #if APR_HAS_FORK @@ -388,8 +429,9 @@ apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, * a standard unix fork. * @param proc The resulting process handle. * @param cont The pool to use. + * @deffunc apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) */ -apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_fork(apr_proc_t *proc, apr_pool_t *cont); #endif /** @@ -403,11 +445,14 @@ apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont); * @param attr the procattr we should use to determine how to create the new * process * @param cont The pool to use. + * @deffunc apr_status_t apr_create_process(apr_proc_t *new_proc, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *cont) */ -apr_status_t apr_create_process(apr_proc_t *new_proc, const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_create_process(apr_proc_t *new_proc, + const char *progname, + const char * const *args, + const char * const *env, + apr_procattr_t *attr, + apr_pool_t *cont); /** * Wait for a child process to die @@ -418,14 +463,15 @@ apr_status_t apr_create_process(apr_proc_t *new_proc, const char *progname, * APR_NOWAIT -- return immediately regardless of if the * child is dead or not. * </PRE> + * @deffunc apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e waithow) * @tip The childs status is in the return code to this process. It is one of: * <PRE> * APR_CHILD_DONE -- child is no longer running. * APR_CHILD_NOTDONE -- child is still running. * </PRE> */ -apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e waithow); - +APR_DECLARE(apr_status_t) apr_wait_proc(apr_proc_t *proc, + apr_wait_how_e waithow); /** * Wait for any current child process to die and return information @@ -442,9 +488,12 @@ apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e waithow); * child is dead or not. * </PRE> * @param p Pool to allocate child information out of. + * @deffunc apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) */ -apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, - apr_wait_how_e waithow, apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_wait_all_procs(apr_proc_t *proc, + apr_wait_t *status, + apr_wait_how_e waithow, + apr_pool_t *p); /** * Detach the process from the controlling terminal. @@ -452,6 +501,7 @@ apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_status_t apr_detach(void); #if APR_HAS_OTHER_CHILD + /** * Register an other_child -- a child which must be kept track of so * that the program knows when it has dies or disappeared. @@ -463,49 +513,59 @@ apr_status_t apr_detach(void); * then the maintenance is invoked with reason * OC_REASON_UNWRITABLE. * @param p The pool to use for allocating memory. + * @deffunc void apr_register_other_child(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), void *data, apr_file_t *write_fd, apr_pool_t *p) */ -void apr_register_other_child(apr_proc_t *pid, - void (*maintenance) (int reason, void *, int status), - void *data, apr_file_t *write_fd, apr_pool_t *p); +APR_DECLARE(void) apr_register_other_child(apr_proc_t *pid, + void (*maintenance) (int reason, + void *, + int status), + void *data, apr_file_t *write_fd, + apr_pool_t *p); /** * Stop watching the specified process. * @param data The data to pass to the maintenance function. This is * used to find the process to unregister. + * @deffunc void apr_unregister_other_child(void *data) * @tip Since this can be called by a maintenance function while we're * scanning the other_children list, all scanners should protect * themself by loading ocr->next before calling any maintenance * function. */ -void apr_unregister_other_child(void *data); +APR_DECLARE(void) apr_unregister_other_child(void *data); /** * Check on the specified process. If it is gone, call the maintenance * function. * @param pid The process to check. * @param status The status to pass to the maintenance function. + * @deffunc apr_status_t apr_reap_other_child(apr_proc_t *pid, int status); */ -apr_status_t apr_reap_other_child(apr_proc_t *pid, int status); +APR_DECLARE(apr_status_t) apr_reap_other_child(apr_proc_t *pid, int status); /** * Loop through all registered other_children and call the appropriate * maintenance function when necessary. + * @deffunc void apr_check_other_child(); */ -void apr_check_other_child(void); +APR_DECLARE(void) apr_check_other_child(void); /** * Ensure all the registered write_fds are still writable, otherwise * invoke the maintenance functions as appropriate. + * @deffunc void apr_probe_writable_fds() */ -void apr_probe_writable_fds(void); +APR_DECLARE(void) apr_probe_writable_fds(void); + #endif /* APR_HAS_OTHER_CHILD */ /** * Terminate a process. * @param proc The process to terminate. * @param sig How to kill the process. + * @deffunc apr_status_t apr_kill(apr_proc_t *proc, int sig) */ -apr_status_t apr_kill(apr_proc_t *proc, int sig); +APR_DECLARE(apr_status_t) apr_kill(apr_proc_t *proc, int sig); /** * Register a process to be killed when a pool dies. diff --git a/include/apr_time.h b/include/apr_time.h index d0aff4d6e02..0f520aa8ffe 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -90,8 +90,9 @@ typedef apr_int32_t apr_interval_time_t; /** * return the current time + * @deffunc apr_time_t apr_now(void) */ -apr_time_t apr_now(void); +APR_DECLARE(apr_time_t) apr_now(void); typedef struct apr_exploded_time_t apr_exploded_time_t; /** @@ -128,37 +129,46 @@ struct apr_exploded_time_t { * convert an ansi time_t to an apr_time_t * @param result the resulting apr_time_t * @param input the time_t to convert + * @deffunc apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input) */ -apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input); +APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, + time_t input); /** * convert a time to its human readable components in GMT timezone * @param result the exploded time * @param input the time to explode + * @deffunc apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input) */ -apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input); +APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, + apr_time_t input); /** * convert a time to its human readable components in local timezone * @param result the exploded time * @param input the time to explode + * @deffunc apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) */ -apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input); +APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, + apr_time_t input); /** * Convert time value from human readable format to number of seconds * since epoch * @param result the resulting imploded time * @param input the input exploded time + * @deffunc apr_status_t apr_implode_time(apr_time_t *result, apr_exploded_time_t *input) */ -apr_status_t apr_implode_time(apr_time_t *result, apr_exploded_time_t *input); +APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *result, + apr_exploded_time_t *input); /** * Sleep for the specified number of micro-seconds. * @param t desired amount of time to sleep. + * @deffunc void apr_sleep(apr_interval_time_t t) * @tip May sleep for longer than the specified time. */ -void apr_sleep(apr_interval_time_t t); +APR_DECLARE(void) apr_sleep(apr_interval_time_t t); #define APR_RFC822_DATE_LEN (30) /** @@ -168,8 +178,9 @@ void apr_sleep(apr_interval_time_t t); * including trailing \0 * @param date_str String to write to. * @param t the time to convert + * @deffunc apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) */ -apr_status_t apr_rfc822_date(char *date_str, apr_time_t t); +APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t); #define APR_CTIME_LEN (25) /** @@ -179,8 +190,9 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t); * including trailing \0 * @param date_str String to write to. * @param t the time to convert + * @deffunc apr_status_t apr_ctime(char *date_str, apr_time_t t) */ -apr_status_t apr_ctime(char *date_str, apr_time_t t); +APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t); /** * formats the exploded time according to the format specified @@ -189,8 +201,11 @@ apr_status_t apr_ctime(char *date_str, apr_time_t t); * @param max The maximum length of the string * @param format The format for the time string * @param tm The time to convert + * @deffunc apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, apr_exploded_time_t *tm) */ -apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, apr_exploded_time_t *tm); +APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, + apr_size_t max, const char *format, + apr_exploded_time_t *tm); #ifdef __cplusplus } diff --git a/include/apr_uuid.h b/include/apr_uuid.h index a401a62563a..c33b70351a3 100644 --- a/include/apr_uuid.h +++ b/include/apr_uuid.h @@ -58,6 +58,10 @@ #include "apr.h" #include "apr_errno.h" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + /** * @package APR UUID Handling */ @@ -76,7 +80,7 @@ typedef struct { * @param uuid The resulting UUID * @deffunc void apr_get_uuid(apr_uuid_t *uuid) */ -void apr_get_uuid(apr_uuid_t *uuid); +APR_DECLARE(void) apr_get_uuid(apr_uuid_t *uuid); /** * Format a UUID into a string, following the standard format @@ -84,9 +88,9 @@ void apr_get_uuid(apr_uuid_t *uuid); * be at least APR_UUID_FORMATTED_LENGTH + 1 bytes long to hold * the formatted UUID and a null terminator * @param uuid The UUID to format - * @deffunc void apr_format_uuid(apr_pool_t *p, const apr_uuid_t *uuid) + * @deffunc void apr_format_uuid(char *buffer, const apr_uuid_t *uuid) */ -void apr_format_uuid(char *buffer, const apr_uuid_t *uuid); +APR_DECLARE(void) apr_format_uuid(char *buffer, const apr_uuid_t *uuid); /** * Parse a standard-format string into a UUID @@ -94,6 +98,10 @@ void apr_format_uuid(char *buffer, const apr_uuid_t *uuid); * @param uuid_str The formatted UUID * @deffunc apr_status_t apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str) */ -apr_status_t apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str); +APR_DECLARE(apr_status_t) apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str); + +#ifdef __cplusplus +} +#endif #endif /* APR_UUID_H */ diff --git a/include/apr_xlate.h b/include/apr_xlate.h index 3b35e7997ea..dd8bd0bff91 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -83,6 +83,7 @@ typedef struct apr_xlate_t apr_xlate_t; * @param topage The name of the target charset * @param frompage The name of the source charset * @param pool The pool to use + * @deffunc apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, const char *frompage, apr_pool_t *pool) * @tip * <PRE> * Specify APR_DEFAULT_CHARSET for one of the charset @@ -98,8 +99,10 @@ typedef struct apr_xlate_t apr_xlate_t; * names to indicate the charset of the current locale. * </PRE> */ -apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, - const char *frompage, apr_pool_t *pool); +APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, + const char *topage, + const char *frompage, + apr_pool_t *pool); #define APR_DEFAULT_CHARSET (const char *)0 #define APR_LOCALE_CHARSET (const char *)1 @@ -109,9 +112,10 @@ apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, * @param convset The handle allocated by apr_xlate_open, specifying the * parameters of conversion * @param onoff Output: whether or not the conversion is single-byte-only + * @deffunc apr_status_t apr_xlate_get_sb(apr_xlate_t *convset, int *onoff) */ -apr_status_t apr_xlate_get_sb(apr_xlate_t *convset, int *onoff); +APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff) /** * Convert a buffer of text from one codepage to another. @@ -123,10 +127,13 @@ apr_status_t apr_xlate_get_sb(apr_xlate_t *convset, int *onoff); * @param outbuf The address of the destination buffer * @param outbytes_left Input: the size of the output buffer * Output: the amount of the output buffer not yet used + * @deffunc apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, apr_size_t *inbytes_left, char *outbuf, apr_size_t *outbytes_left) */ -apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, - apr_size_t *inbytes_left, char *outbuf, - apr_size_t *outbytes_left); +APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, + const char *inbuf, + apr_size_t *inbytes_left, + char *outbuf, + apr_size_t *outbytes_left); /* See the comment in apr_file_io.h about this hack */ #ifdef APR_NOT_DONE_YET @@ -138,8 +145,10 @@ apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, * parameters of conversion * @param inchar The character to convert * @param outchar The converted character + * @deffunc apr_status_t apr_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar) */ -apr_status_t apr_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar); +APR_DECLARE(apr_status_t) apr_xlate_conv_char(apr_xlate_t *convset, + char inchar, char outchar); #endif /** @@ -147,16 +156,19 @@ apr_status_t apr_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar * @param convset The handle allocated by apr_xlate_open, specifying the * parameters of conversion * @param inchar The single-byte character to convert. + * @deffunc apr_int32_t apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar) * @tip This only works when converting between single-byte character sets. * -1 will be returned if the conversion can't be performed. */ -apr_int32_t apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar); +APR_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, + unsigned char inchar); /** * Close a codepage translation handle. * @param convset The codepage translation handle to close + * @deffunc apr_status_t apr_xlate_close(apr_xlate_t *convset) */ -apr_status_t apr_xlate_close(apr_xlate_t *convset); +APR_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset); #else diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 66ffd3bea29..3fb7bd0cc70 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -174,8 +174,6 @@ struct apr_file_t { char *fname; } n; }; - apr_canon_t *canonname; - DWORD dwFileAttributes; int eof_hit; BOOLEAN buffered; // Use buffered I/O? diff --git a/libapr.def b/libapr.def deleted file mode 100644 index 557f7fd2cb1..00000000000 --- a/libapr.def +++ /dev/null @@ -1,281 +0,0 @@ -; libapr.def : - -LIBRARY libapr -DESCRIPTION '' - -EXPORTS -; Add new API calls to the end of this list. -; apr_file_io.h - apr_open - apr_close - apr_remove_file - apr_rename_file - apr_eof - apr_read - apr_write - apr_writev - apr_full_read - apr_full_write - apr_putc - apr_getc - apr_ungetc - apr_fgets - apr_puts - apr_flush - apr_dupfile - apr_getfileinfo - apr_setfileperms - apr_stat - apr_lstat - apr_seek - apr_dir_open - apr_closedir - apr_readdir - apr_rewinddir - apr_make_dir - apr_remove_dir - apr_dir_entry_size - apr_dir_entry_mtime - apr_dir_entry_ftype - apr_get_dir_filename -; apr_get_filename - apr_create_pipe -; apr_create_namedpipe -; apr_set_pipe_timeout - apr_get_filedata - apr_set_filedata - apr_get_os_file - apr_put_os_file - apr_get_os_dir - apr_fprintf - apr_lock_file - apr_unlock_file - -; -; apr_network_io.h - apr_get_sockaddr - apr_getaddrinfo - apr_create_socket - apr_shutdown - apr_close_socket - apr_bind - apr_listen - apr_accept - apr_connect - apr_gethostname - apr_send - apr_recv - apr_setsocketopt - apr_sendv - apr_sendfile - apr_setup_poll - apr_poll - apr_add_poll_socket - apr_get_revents - apr_get_socketdata - apr_set_socketdata - apr_get_polldata - apr_set_polldata - apr_make_os_sock - apr_put_os_sock - apr_get_os_sock - apr_remove_poll_socket - apr_clear_poll_sockets - apr_getsocketopt - apr_get_ipaddr - apr_set_ipaddr - apr_get_port - apr_set_port - apr_parse_addr_port - apr_getnameinfo - -; -; -; apr_thread_proc.h - apr_createprocattr_init - apr_setprocattr_io - apr_setprocattr_dir - apr_setprocattr_cmdtype - apr_setprocattr_detach - apr_setprocattr_childin - apr_setprocattr_childout - apr_setprocattr_childerr - apr_create_process -; -; -; - apr_wait_proc - apr_kill - apr_create_threadattr - apr_setthreadattr_detach - apr_getthreadattr_detach - apr_create_thread - apr_thread_exit - apr_thread_join - apr_thread_detach -; - apr_create_thread_private - apr_get_thread_private - apr_set_thread_private - apr_delete_thread_private - apr_get_threaddata - apr_set_threaddata - apr_get_threadkeydata - apr_set_threadkeydata -; -; -; - apr_get_os_thread - apr_get_os_threadkey - - - apr_create_pool -; -; -; - apr_get_userdata - apr_set_userdata - apr_initialize -; apr_make_time - apr_ansi_time_to_apr_time - apr_now - apr_explode_gmt - apr_explode_localtime - apr_implode_time - apr_get_os_imp_time - apr_get_os_exp_time - apr_put_os_imp_time - apr_put_os_exp_time - apr_ctime - apr_rfc822_date - apr_strftime -; -; -; -; -; -; -; -; -; -; - apr_MD5Final - apr_MD5Init - apr_MD5Update - apr_cpystrn - apr_register_cleanup - apr_kill_cleanup - apr_fnmatch - apr_is_fnmatch - apr_MD5Encode - apr_validate_password -; -; apr_pools.h - apr_make_sub_pool - apr_init_alloc - apr_clear_pool - apr_destroy_pool - apr_bytes_in_pool - apr_bytes_in_free_blocks - apr_palloc - apr_pcalloc - apr_pstrdup - apr_pstrndup - apr_pstrcat - apr_pvsprintf - apr_psprintf -; -; apr_tables.h - apr_make_array - apr_push_array - apr_array_cat - apr_copy_array - apr_copy_array_hdr - apr_append_arrays - apr_array_pstrcat - apr_make_table - apr_copy_table - apr_clear_table - apr_table_get - apr_table_set - apr_table_setn - apr_table_unset - apr_table_merge - apr_table_mergen - apr_table_add - apr_table_addn - apr_overlay_tables - apr_table_do - apr_table_vdo - apr_overlap_tables -; -; - apr_run_cleanup - apr_cleanup_for_exec - apr_null_cleanup - apr_note_subprocess -; - apr_vformatter - apr_snprintf - apr_vsnprintf - apr_getpass - - apr_tokenize_to_argv - apr_filename_of_pathname - - apr_open_stderr - apr_get_pipe_timeout - apr_set_pipe_timeout - apr_terminate - apr_dso_load - apr_dso_unload - apr_dso_sym - apr_collapse_spaces - apr_month_snames - apr_day_snames - apr_strerror - apr_generate_random_bytes - apr_strnatcmp - apr_strnatcasecmp - apr_dso_error -; -; apr_hash.h - apr_make_hash - apr_hash_set - apr_hash_get - apr_hash_first - apr_hash_next - apr_hash_this - apr_hash_count -; -; apr_lock.h - apr_create_lock - apr_lock - apr_unlock - apr_destroy_lock - apr_child_init_lock - apr_get_lockdata - apr_set_lockdata - apr_get_os_lock -; -; apr_uuid.h - apr_format_uuid - apr_parse_uuid - apr_get_uuid - -; apr_mmap.h - apr_mmap_create - apr_mmap_delete - apr_mmap_offset - -; Moved out of the way for Bill Stoddard's reorg -; -; apr_getopt.h - apr_getopt - apr_initopt -; apr_opterr -; apr_optind -; apr_optopt -; apr_optreset -; apr_optarg - diff --git a/libapr.dsp b/libapr.dsp index b33699aa5b9..87e3333bc41 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libapr" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\apr" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -52,8 +52,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /machine:I386 -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /machine:I386 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /machine:I386 /OPT:NOREF !ELSEIF "$(CFG)" == "libapr - Win32 Debug" @@ -69,7 +69,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\apr" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -78,8 +78,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF !ENDIF @@ -87,13 +87,442 @@ LINK32=link.exe # Name "libapr - Win32 Release" # Name "libapr - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter ".c" +# Begin Group "time" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\time\win32\access.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\atime.h +# End Source File +# Begin Source File + +SOURCE=.\time\win32\time.c +# End Source File +# Begin Source File + +SOURCE=.\time\win32\timestr.c +# End Source File +# End Group +# Begin Group "strings" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\strings\apr_cpystrn.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_fnmatch.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_snprintf.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_strings.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_strnatcmp.c +# End Source File +# End Group +# Begin Group "passwd" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\passwd\apr_getpass.c +# End Source File +# Begin Source File + +SOURCE=.\passwd\apr_md5.c +# End Source File +# End Group +# Begin Group "tables" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\tables\apr_hash.c +# End Source File +# Begin Source File + +SOURCE=.\tables\apr_tables.c +# End Source File +# End Group +# Begin Group "misc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\misc\unix\errorcodes.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\getopt.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\getuuid.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\misc.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\unix\misc.h +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\names.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\rand.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\start.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\uuid.c +# End Source File +# End Group +# Begin Group "file_io" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\file_io\win32\canonfile.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\dir.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\unix\fileacc.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\filedup.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\fileio.h +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\filestat.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\flock.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\unix\fullrw.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\open.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\pipe.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\readwrite.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\seek.c +# End Source File +# End Group +# Begin Group "locks" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\locks\win32\locks.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\locks.h +# End Source File +# End Group +# Begin Group "network_io" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\network_io\unix\inet_ntop.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\networkio.h +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\poll.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\unix\sa_common.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sendrecv.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockaddr.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockets.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockopt.c +# End Source File +# End Group +# Begin Group "threadproc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\threadproc\win32\proc.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\signals.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\thread.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\threadpriv.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\threadproc.h +# End Source File +# End Group +# Begin Group "dso" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\dso\win32\dso.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\dso.h +# End Source File +# End Group +# Begin Group "lib" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\lib\apr_pools.c +# End Source File +# Begin Source File + +SOURCE=.\lib\apr_signal.c +# End Source File +# End Group +# Begin Group "i18n" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\arch\unix\i18n.h +# End Source File +# Begin Source File + +SOURCE=.\i18n\unix\utf8_ucs2.c +# End Source File +# Begin Source File + +SOURCE=.\i18n\unix\xlate.c +# PROP Exclude_From_Build 1 +# End Source File +# End Group +# Begin Group "shmem" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\shmem\win32\shmem.c +# PROP Exclude_From_Build 1 +# End Source File +# End Group +# Begin Group "mmap" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\mmap\unix\common.c +# End Source File +# Begin Source File + +SOURCE=.\mmap\win32\mmap.c +# End Source File +# End Group +# End Group +# Begin Group "Generated Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\apr.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\apr.hw + +!IF "$(CFG)" == "libapr - Win32 Release" + +# Begin Custom Build +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +# Begin Custom Build +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\apr_private.h +# End Source File +# End Group +# Begin Group "External Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\apr_compat.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_dso.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_errno.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_file_io.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_fnmatch.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_general.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_getopt.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_hash.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_lib.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_lock.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_md5.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_mmap.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_network_io.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_pools.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_portable.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_shmem.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_strings.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_tables.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_thread_proc.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_time.h +# End Source File # Begin Source File -SOURCE=.\misc\win32\libapr.c +SOURCE=.\include\apr_uuid.h # End Source File # Begin Source File -SOURCE=.\libapr.def +SOURCE=.\include\apr_xlate.h # End Source File +# End Group # End Target # End Project diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 67940bb5e71..701e2c2810e 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -57,9 +57,11 @@ #include "win32/locks.h" #include "apr_portable.h" -apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, - apr_lockscope_e scope, const char *fname, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_create_lock(apr_lock_t **lock, + apr_locktype_e type, + apr_lockscope_e scope, + const char *fname, + apr_pool_t *cont) { apr_lock_t *newlock; SECURITY_ATTRIBUTES sec; @@ -92,8 +94,9 @@ apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, return APR_SUCCESS; } -apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_child_init_lock(apr_lock_t **lock, + const char *fname, + apr_pool_t *cont) { /* This routine should not be called (and OpenMutex will fail if called) * on a INTRAPROCESS lock @@ -112,7 +115,7 @@ apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, return APR_SUCCESS; } -apr_status_t apr_lock(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock(apr_lock_t *lock) { DWORD rv; if (lock->scope == APR_INTRAPROCESS) { @@ -128,7 +131,7 @@ apr_status_t apr_lock(apr_lock_t *lock) return apr_get_os_error(); } -apr_status_t apr_unlock(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_unlock(apr_lock_t *lock) { if (lock->scope == APR_INTRAPROCESS) { LeaveCriticalSection(&lock->section); @@ -141,7 +144,7 @@ apr_status_t apr_unlock(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_destroy_lock(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_destroy_lock(apr_lock_t *lock) { if (lock->scope == APR_INTRAPROCESS) { DeleteCriticalSection(&lock->section); @@ -154,25 +157,29 @@ apr_status_t apr_destroy_lock(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) +APR_DECLARE(apr_status_t) apr_get_lockdata(apr_lock_t *lock, const char *key, + void *data) { return apr_get_userdata(data, key, lock->cntxt); } -apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, - apr_status_t (*cleanup) (void *)) +APR_DECLARE(apr_status_t) apr_set_lockdata(apr_lock_t *lock, void *data, + const char *key, + apr_status_t (*cleanup) (void *)) { return apr_set_userdata(data, key, cleanup, lock->cntxt); } -apr_status_t apr_get_os_lock(apr_os_lock_t *thelock, apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_get_os_lock(apr_os_lock_t *thelock, + apr_lock_t *lock) { *thelock = lock->mutex; return APR_SUCCESS; } -apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_put_os_lock(apr_lock_t **lock, + apr_os_lock_t *thelock, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index a454ada4fb6..cfa879f432c 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -346,7 +346,8 @@ static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) } #endif -char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize) +APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, + apr_size_t bufsize) { if (statcode < APR_OS_START_ERROR) { return stuffbuffer(buf, bufsize, strerror(statcode)); diff --git a/misc/unix/start.c b/misc/unix/start.c index 0cd81cd8743..f208c20197f 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -63,7 +63,7 @@ static int initialized = 0; static apr_pool_t *global_apr_pool; -apr_status_t apr_initialize(void) +APR_DECLARE(apr_status_t) apr_initialize(void) { apr_status_t status; #if defined WIN32 @@ -98,7 +98,7 @@ apr_status_t apr_initialize(void) return status; } -void apr_terminate(void) +APR_DECLARE(void) apr_terminate(void) { initialized--; if (initialized) { @@ -107,7 +107,7 @@ void apr_terminate(void) apr_term_alloc(global_apr_pool); } -apr_status_t apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont) { cont->apr_abort = apr_abort; return APR_SUCCESS; diff --git a/misc/unix/uuid.c b/misc/unix/uuid.c index 1a3401b50f3..dc358081880 100644 --- a/misc/unix/uuid.c +++ b/misc/unix/uuid.c @@ -60,7 +60,7 @@ #include "apr_lib.h" -void apr_format_uuid(char *buffer, const apr_uuid_t *uuid) +APR_DECLARE(void) apr_format_uuid(char *buffer, const apr_uuid_t *uuid) { const unsigned char *d = uuid->data; @@ -95,7 +95,8 @@ static unsigned char parse_hexpair(const char *s) return (unsigned char)result; } -apr_status_t apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str) +APR_DECLARE(apr_status_t) apr_parse_uuid(apr_uuid_t *uuid, + const char *uuid_str) { int i; unsigned char *d = uuid->data; diff --git a/misc/win32/getuuid.c b/misc/win32/getuuid.c index 5af3636e796..465ef215c10 100644 --- a/misc/win32/getuuid.c +++ b/misc/win32/getuuid.c @@ -62,7 +62,7 @@ #include "apr.h" #include "apr_uuid.h" -void apr_get_uuid(apr_uuid_t *uuid) +APR_DECLARE(void) apr_get_uuid(apr_uuid_t *uuid) { GUID guid; diff --git a/misc/win32/rand.c b/misc/win32/rand.c index deeacff7311..e81b2deda77 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -56,7 +56,8 @@ #include "apr_general.h" #include <wincrypt.h> -apr_status_t apr_generate_random_bytes(unsigned char * buf, int length) +APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, + int length) { HCRYPTPROV hProv; apr_status_t res = APR_SUCCESS; diff --git a/mmap/unix/common.c b/mmap/unix/common.c index f2a84438f4e..cec98e225b9 100644 --- a/mmap/unix/common.c +++ b/mmap/unix/common.c @@ -68,7 +68,8 @@ #if APR_HAS_MMAP || defined(BEOS) -apr_status_t apr_mmap_offset(void **addr, apr_mmap_t *mmap, apr_off_t offset) +APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mmap, + apr_off_t offset) { if (offset < 0 || offset > mmap->size) return APR_EINVAL; diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index 6e66e880093..28c5224694d 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -91,8 +91,9 @@ static apr_status_t mmap_cleanup(void *themmap) return APR_SUCCESS; } -apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, apr_off_t offset, - apr_size_t size, apr_int32_t flag, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, + apr_off_t offset, apr_size_t size, + apr_int32_t flag, apr_pool_t *cont) { static DWORD memblock = 0; DWORD fmaccess = 0, mvaccess = 0; @@ -151,7 +152,7 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, apr_off_t offse return APR_SUCCESS; } -apr_status_t apr_mmap_delete(apr_mmap_t *mmap) +APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap) { apr_status_t rv; diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 42e9fae9e0e..d4444c381da 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -70,7 +70,8 @@ #include <stdlib.h> #endif -apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port) +APR_DECLARE(apr_status_t) apr_set_port(apr_sockaddr_t *sockaddr, + apr_port_t port) { /* XXX IPv6: assumes sin_port and sin6_port at same offset */ sockaddr->sa.sin.sin_port = htons(port); @@ -81,7 +82,8 @@ apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port) * since we have apr_getaddrinfo(), but we need to clean up Apache's * listen.c a bit more first. */ -apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr) +APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr, + const char *addr) { u_long ipaddr; @@ -103,14 +105,16 @@ apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr) return APR_SUCCESS; } -apr_status_t apr_get_port(apr_port_t *port, apr_sockaddr_t *sockaddr) +APR_DECLARE(apr_status_t) apr_get_port(apr_port_t *port, + apr_sockaddr_t *sockaddr) { /* XXX IPv6 - assumes sin_port and sin6_port at same offset */ *port = ntohs(sockaddr->sa.sin.sin_port); return APR_SUCCESS; } -apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr) +APR_DECLARE(apr_status_t) apr_get_ipaddr(char **addr, + apr_sockaddr_t *sockaddr) { *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len); apr_inet_ntop(sockaddr->sa.sin.sin_family, @@ -150,7 +154,9 @@ static void set_sockaddr_vars(apr_sockaddr_t *addr, int family) #endif } -apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock) +APR_DECLARE(apr_status_t) apr_get_sockaddr(apr_sockaddr_t **sa, + apr_interface_e which, + apr_socket_t *sock) { if (which == APR_LOCAL) { if (sock->local_interface_unknown || sock->local_port_unknown) { @@ -172,11 +178,11 @@ apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_so return APR_SUCCESS; } -apr_status_t apr_parse_addr_port(char **addr, - char **scope_id, - apr_port_t *port, - const char *str, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, + char **scope_id, + apr_port_t *port, + const char *str, + apr_pool_t *p) { const char *ch, *lastchar; int big_port; @@ -297,9 +303,10 @@ static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa, } #endif -apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, - apr_int32_t family, apr_port_t port, - apr_int32_t flags, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_getaddrinfo(apr_sockaddr_t **sa, + const char *hostname, + apr_int32_t family, apr_port_t port, + apr_int32_t flags, apr_pool_t *p) { (*sa) = (apr_sockaddr_t *)apr_pcalloc(p, sizeof(apr_sockaddr_t)); if ((*sa) == NULL) @@ -417,8 +424,9 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, return APR_SUCCESS; } -apr_status_t apr_getnameinfo(char **hostname, apr_sockaddr_t *sockaddr, - apr_int32_t flags) +APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, + apr_sockaddr_t *sockaddr, + apr_int32_t flags) { #if defined(HAVE_GETNAMEINFO) && APR_HAVE_IPV6 int rc; @@ -472,7 +480,8 @@ apr_status_t apr_getnameinfo(char **hostname, apr_sockaddr_t *sockaddr, #endif } -apr_status_t apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname) +APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, + const char *servname) { struct servent *se; diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 925fd7da746..5baa007680e 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -60,7 +60,8 @@ #include <time.h> -apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, + apr_pool_t *cont) { (*new) = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t) * num); if ((*new) == NULL) { @@ -79,8 +80,9 @@ apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con return APR_SUCCESS; } -apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t event) +APR_DECLARE(apr_status_t) apr_add_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, + apr_int16_t event) { if (event & APR_POLLIN) { FD_SET(sock->sock, aprset->read); @@ -97,8 +99,8 @@ apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, return APR_SUCCESS; } -apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, - apr_interval_time_t timeout) +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, + apr_interval_time_t timeout) { int rv; struct timeval tv, *tvptr; @@ -140,7 +142,9 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, return APR_SUCCESS; } -apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +APR_DECLARE(apr_status_t) apr_get_revents(apr_int16_t *event, + apr_socket_t *sock, + apr_pollfd_t *aprset) { apr_int16_t revents = 0; WSABUF data; @@ -194,19 +198,22 @@ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_ return APR_SUCCESS; } -apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) +APR_DECLARE(apr_status_t) apr_get_polldata(apr_pollfd_t *pollfd, + const char *key, void *data) { return apr_get_userdata(data, key, pollfd->cntxt); } -apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, - apr_status_t (*cleanup) (void *)) +APR_DECLARE(apr_status_t) apr_set_polldata(apr_pollfd_t *pollfd, void *data, + const char *key, + apr_status_t (*cleanup)(void *)) { return apr_set_userdata(data, key, cleanup, pollfd->cntxt); } -apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t events) +APR_DECLARE(apr_status_t) apr_mask_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, + apr_int16_t events) { if (events & APR_POLLIN) { FD_CLR(sock->sock, aprset->read); @@ -223,12 +230,14 @@ apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, return APR_SUCCESS; } -apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) +APR_DECLARE(apr_status_t) apr_remove_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock) { return apr_mask_poll_socket(aprset, sock, ~0); } -apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events) +APR_DECLARE(apr_status_t) apr_clear_poll_sockets(apr_pollfd_t *aprset, + apr_int16_t events) { if (events & APR_POLLIN) { FD_ZERO(aprset->read); diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 06eec498934..1aa12dca306 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -69,7 +69,8 @@ * bytes. */ #define MAX_SEGMENT_SIZE 65536 -apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, + apr_size_t *len) { apr_ssize_t rv; WSABUF wsaData; @@ -90,7 +91,8 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) return APR_SUCCESS; } -apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, + apr_size_t *len) { apr_ssize_t rv; WSABUF wsaData; @@ -113,8 +115,9 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) } -apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, - apr_int32_t nvec, apr_int32_t *nbytes) +APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, + const struct iovec *vec, + apr_int32_t nvec, apr_int32_t *nbytes) { apr_ssize_t rv; int i; @@ -189,9 +192,9 @@ static void collapse_iovec(char **buf, int *len, struct iovec *iovec, int numvec * arg 5) Number of bytes to send out of the file * arg 6) APR flags that are mapped to OS specific flags */ -apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, - apr_int32_t flags) +APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, + apr_size_t *len, apr_int32_t flags) { apr_status_t status = APR_SUCCESS; apr_ssize_t rv; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 84ca396b014..9d792332c93 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -112,8 +112,8 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) sizeof(apr_sockaddr_t)); } -apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_create_socket(apr_socket_t **new, int ofamily, + int type, apr_pool_t *cont) { int family = ofamily; @@ -159,7 +159,8 @@ apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, return APR_SUCCESS; } -apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) +APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, + apr_shutdown_how_e how) { int winhow; @@ -185,13 +186,13 @@ apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) } } -apr_status_t apr_close_socket(apr_socket_t *thesocket) +APR_DECLARE(apr_status_t) apr_close_socket(apr_socket_t *thesocket) { apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } -apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) +APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) { if (bind(sock->sock, (struct sockaddr *)&sa->sa, @@ -207,7 +208,7 @@ apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) } } -apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) +APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->sock, backlog) == SOCKET_ERROR) return apr_get_netos_error(); @@ -215,7 +216,8 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) return APR_SUCCESS; } -apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) +APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, + apr_pool_t *connection_context) { alloc_socket(new, connection_context); set_socket_vars(*new, sock->local_addr->sa.sin.sin_family); @@ -263,7 +265,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return APR_SUCCESS; } -apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) +APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { apr_status_t lasterror; fd_set temp; @@ -297,26 +299,29 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) return APR_SUCCESS; } -apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *socket) +APR_DECLARE(apr_status_t) apr_get_socketdata(void **data, const char *key, + apr_socket_t *socket) { return apr_get_userdata(data, key, socket->cntxt); } -apr_status_t apr_set_socketdata(apr_socket_t *socket, void *data, const char *key, - apr_status_t (*cleanup) (void *)) +APR_DECLARE(apr_status_t) apr_set_socketdata(apr_socket_t *socket, void *data, + const char *key, + apr_status_t (*cleanup)(void *)) { return apr_set_userdata(data, key, cleanup, socket->cntxt); } -apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) +APR_DECLARE(apr_status_t) apr_get_os_sock(apr_os_sock_t *thesock, + apr_socket_t *sock) { *thesock = sock->sock; return APR_SUCCESS; } -apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, - apr_os_sock_info_t *os_sock_info, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_make_os_sock(apr_socket_t **apr_sock, + apr_os_sock_info_t *os_sock_info, + apr_pool_t *cont) { alloc_socket(apr_sock, cont); set_socket_vars(*apr_sock, os_sock_info->family); @@ -345,8 +350,9 @@ apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, return APR_SUCCESS; } -apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_put_os_sock(apr_socket_t **sock, + apr_os_sock_t *thesock, + apr_pool_t *cont) { if ((*sock) == NULL) { alloc_socket(sock, cont); diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index ecc990701c2..29d5edae506 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -78,7 +78,8 @@ apr_status_t sononblock(SOCKET sd) return APR_SUCCESS; } -apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) +APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t on) { int one; apr_status_t stat; @@ -169,7 +170,8 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o return APR_SUCCESS; } -apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) +APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t *on) { switch (opt) { case APR_SO_TIMEOUT: @@ -193,7 +195,8 @@ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t * } -apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, + apr_pool_t *cont) { if (gethostname(buf, len) == -1) return apr_get_netos_error(); diff --git a/strings/apr_strnatcmp.c b/strings/apr_strnatcmp.c index 32140e3b30c..a69b0c7d6bd 100644 --- a/strings/apr_strnatcmp.c +++ b/strings/apr_strnatcmp.c @@ -140,12 +140,14 @@ static int strnatcmp0(char const *a, char const *b, int fold_case) -int apr_strnatcmp(char const *a, char const *b) { +APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b) +{ return strnatcmp0(a, b, 0); } /* Compare, recognizing numeric string and ignoring case. */ -int apr_strnatcasecmp(char const *a, char const *b) { +APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b) +{ return strnatcmp0(a, b, 1); } diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 664f4de3ace..c0fe0c8f02a 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -71,7 +71,8 @@ * */ -apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_createprocattr_init(apr_procattr_t **new, + apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); @@ -169,8 +170,10 @@ static apr_status_t make_inheritable_duplicate(apr_file_t *original, return APR_SUCCESS; } -apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, - apr_int32_t out, apr_int32_t err) +APR_DECLARE(apr_status_t) apr_setprocattr_io(apr_procattr_t *attr, + apr_int32_t in, + apr_int32_t out, + apr_int32_t err) { apr_status_t stat; @@ -201,9 +204,9 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, return APR_SUCCESS; } -apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, - apr_file_t *child_in, - apr_file_t *parent_in) +APR_DECLARE(apr_status_t) apr_setprocattr_childin(apr_procattr_t *attr, + apr_file_t *child_in, + apr_file_t *parent_in) { apr_status_t stat; @@ -224,9 +227,9 @@ apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, return stat; } -apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, - apr_file_t *child_out, - apr_file_t *parent_out) +APR_DECLARE(apr_status_t) apr_setprocattr_childout(apr_procattr_t *attr, + apr_file_t *child_out, + apr_file_t *parent_out) { apr_status_t stat; @@ -247,9 +250,9 @@ apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, return stat; } -apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, - apr_file_t *child_err, - apr_file_t *parent_err) +APR_DECLARE(apr_status_t) apr_setprocattr_childerr(apr_procattr_t *attr, + apr_file_t *child_err, + apr_file_t *parent_err) { apr_status_t stat; @@ -270,8 +273,8 @@ apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, return stat; } -apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, - const char *dir) +APR_DECLARE(apr_status_t) apr_setprocattr_dir(apr_procattr_t *attr, + const char *dir) { char path[MAX_PATH]; int length; @@ -294,14 +297,15 @@ apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, return APR_ENOMEM; } -apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, - apr_cmdtype_e cmd) +APR_DECLARE(apr_status_t) apr_setprocattr_cmdtype(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t det) +APR_DECLARE(apr_status_t) apr_setprocattr_detach(apr_procattr_t *attr, + apr_int32_t det) { attr->detached = det; return APR_SUCCESS; @@ -312,10 +316,12 @@ apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t det) * Q150956 */ -apr_status_t apr_create_process(apr_proc_t *new, const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_create_process(apr_proc_t *new, + const char *progname, + const char * const *args, + const char * const *env, + apr_procattr_t *attr, + apr_pool_t *cont) { int i, iEnvBlockLen; char *cmdline; @@ -450,7 +456,7 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, return apr_get_os_error(); } -apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e wait) +APR_DECLARE(apr_status_t) apr_wait_proc(apr_proc_t *proc, apr_wait_how_e wait) { DWORD stat; if (!proc) diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 9c283bf3036..056de8904ad 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -64,7 +64,7 @@ #endif /* Windows only really support killing process, but that will do for now. */ -apr_status_t apr_kill(apr_proc_t *proc, int signal) +APR_DECLARE(apr_status_t) apr_kill(apr_proc_t *proc, int signal) { if (TerminateProcess((HANDLE)proc->pid, signal) == 0) { return apr_get_os_error(); diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 75fc18db9d1..231d2e36621 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -61,7 +61,8 @@ #include <process.h> -apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_create_threadattr(apr_threadattr_t **new, + apr_pool_t *cont) { (*new) = (apr_threadattr_t *)apr_palloc(cont, sizeof(apr_threadattr_t)); @@ -74,22 +75,24 @@ apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) +APR_DECLARE(apr_status_t) apr_setthreadattr_detach(apr_threadattr_t *attr, + apr_int32_t on) { attr->detach = on; return APR_SUCCESS; } -apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) +APR_DECLARE(apr_status_t) apr_getthreadattr_detach(apr_threadattr_t *attr) { if (attr->detach == 1) return APR_DETACH; return APR_NOTDETACH; } -apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, - apr_thread_start_t func, void *data, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_create_thread(apr_thread_t **new, + apr_threadattr_t *attr, + apr_thread_start_t func, + void *data, apr_pool_t *cont) { apr_status_t stat; unsigned temp; @@ -127,14 +130,16 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, return APR_SUCCESS; } -apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) +APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, + apr_status_t *retval) { apr_destroy_pool(thd->cntxt); _endthreadex(*retval); return APR_SUCCESS; } -apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, + apr_thread_t *thd) { apr_status_t stat; @@ -149,7 +154,7 @@ apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) } } -apr_status_t apr_thread_detach(apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) { if (CloseHandle(thd->td)) { return APR_SUCCESS; @@ -159,19 +164,21 @@ apr_status_t apr_thread_detach(apr_thread_t *thd) } } -apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) +APR_DECLARE(apr_status_t) apr_get_threaddata(void **data, const char *key, + apr_thread_t *thread) { return apr_get_userdata(data, key, thread->cntxt); } -apr_status_t apr_set_threaddata(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_thread_t *thread) +APR_DECLARE(apr_status_t) apr_set_threaddata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread) { return apr_set_userdata(data, key, cleanup, thread->cntxt); } -apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_get_os_thread(apr_os_thread_t **thethd, + apr_thread_t *thd) { if (thd == NULL) { return APR_ENOTHREAD; @@ -180,8 +187,9 @@ apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd) return APR_SUCCESS; } -apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_put_os_thread(apr_thread_t **thd, + apr_os_thread_t *thethd, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 940750f6461..70128235604 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -59,8 +59,9 @@ #include "apr_errno.h" #include "apr_portable.h" -apr_status_t apr_create_thread_private(apr_threadkey_t **key, - void (*dest)(void *), apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_create_thread_private(apr_threadkey_t **key, + void (*dest)(void *), + apr_pool_t *cont) { if (((*key)->key = TlsAlloc()) != 0xFFFFFFFF) { return APR_SUCCESS; @@ -68,7 +69,8 @@ apr_status_t apr_create_thread_private(apr_threadkey_t **key, return apr_get_os_error(); } -apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_get_thread_private(void **new, + apr_threadkey_t *key) { if ((*new) = TlsGetValue(key->key)) { return APR_SUCCESS; @@ -76,7 +78,8 @@ apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) return apr_get_os_error(); } -apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_set_thread_private(void *priv, + apr_threadkey_t *key) { if (TlsSetValue(key->key, priv)) { return APR_SUCCESS; @@ -84,7 +87,7 @@ apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) return apr_get_os_error(); } -apr_status_t apr_delete_thread_private(apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_delete_thread_private(apr_threadkey_t *key) { if (TlsFree(key->key)) { return APR_SUCCESS; @@ -92,27 +95,29 @@ apr_status_t apr_delete_thread_private(apr_threadkey_t *key) return apr_get_os_error(); } -apr_status_t apr_get_threadkeydata(void **data, const char *key, - apr_threadkey_t *threadkey) +APR_DECLARE(apr_status_t) apr_get_threadkeydata(void **data, const char *key, + apr_threadkey_t *threadkey) { return apr_get_userdata(data, key, threadkey->cntxt); } -apr_status_t apr_set_threadkeydata(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_threadkey_t *threadkey) +APR_DECLARE(apr_status_t) apr_set_threadkeydata(void *data, const char *key, + apr_status_t (*cleanup)(void *), + apr_threadkey_t *threadkey) { return apr_set_userdata(data, key, cleanup, threadkey->cntxt); } -apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_get_os_threadkey(apr_os_threadkey_t *thekey, + apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_put_os_threadkey(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; diff --git a/time/win32/time.c b/time/win32/time.c index 3bbeadfd1be..894a5db3c24 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -123,14 +123,15 @@ void SystemTimeToAprExpTime(apr_exploded_time_t *xt, SYSTEMTIME *tm) return; } -apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input) +APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, + time_t input) { *result = (apr_time_t) input * APR_USEC_PER_SEC; return APR_SUCCESS; } /* Return micro-seconds since the Unix epoch (jan. 1, 1970) UTC */ -apr_time_t apr_now(void) +APR_DECLARE(apr_time_t) apr_now(void) { LONGLONG aprtime = 0; FILETIME time; @@ -139,7 +140,8 @@ apr_time_t apr_now(void) return aprtime; } -apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input) +APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, + apr_time_t input) { FILETIME ft; SYSTEMTIME st; @@ -149,7 +151,8 @@ apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input) return APR_SUCCESS; } -apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) +APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, + apr_time_t input) { SYSTEMTIME st; FILETIME ft, localft; @@ -161,7 +164,8 @@ apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input return APR_SUCCESS; } -apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) +APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, + apr_exploded_time_t *xt) { int year; time_t days; @@ -195,15 +199,16 @@ apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) return APR_SUCCESS; } -apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime) +APR_DECLARE(apr_status_t) apr_get_os_imp_time(apr_os_imp_time_t **ostime, + apr_time_t *aprtime) { /* TODO: Consider not passing in pointer to apr_time_t (e.g., call by value) */ AprTimeToFileTime(*ostime, *aprtime); return APR_SUCCESS; } -apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, - apr_exploded_time_t *aprexptime) +APR_DECLARE(apr_status_t) apr_get_os_exp_time(apr_os_exp_time_t **ostime, + apr_exploded_time_t *aprexptime) { (*ostime)->wYear = aprexptime->tm_year + 1900; (*ostime)->wMonth = aprexptime->tm_mon + 1; @@ -216,21 +221,23 @@ apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, return APR_SUCCESS; } -apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_put_os_imp_time(apr_time_t *aprtime, + apr_os_imp_time_t **ostime, + apr_pool_t *cont) { FileTimeToAprTime(aprtime, *ostime); return APR_SUCCESS; } -apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime, - apr_os_exp_time_t **ostime, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_put_os_exp_time(apr_exploded_time_t *aprtime, + apr_os_exp_time_t **ostime, + apr_pool_t *cont) { SystemTimeToAprExpTime(aprtime, *ostime); return APR_SUCCESS; } -void apr_sleep(apr_interval_time_t t) +APR_DECLARE(void) apr_sleep(apr_interval_time_t t) { Sleep(t/1000); } diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 69db6fcd3a3..9c7cfc1069f 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -64,7 +64,7 @@ APR_DECLARE_DATA const char apr_day_snames[7][4] = "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; -apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) +APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t) { apr_exploded_time_t xt; const char *s; @@ -112,7 +112,7 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) return APR_SUCCESS; } -apr_status_t apr_ctime(char *date_str, apr_time_t t) +APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t) { apr_exploded_time_t xt; const char *s; @@ -154,8 +154,9 @@ apr_status_t apr_ctime(char *date_str, apr_time_t t) return APR_SUCCESS; } -apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, - const char *format, apr_exploded_time_t *xt) +APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, + apr_size_t max, const char *format, + apr_exploded_time_t *xt) { struct tm tm; memset(&tm, 0, sizeof tm); From f83a21b9590770b77e3a041845df5197267c7840 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 18 Jan 2001 20:14:23 +0000 Subject: [PATCH 1092/7878] No longer needed, we don't build libapr.dll from apr.lib anymore git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61073 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/libapr.c | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 misc/win32/libapr.c diff --git a/misc/win32/libapr.c b/misc/win32/libapr.c deleted file mode 100644 index b54667430e0..00000000000 --- a/misc/win32/libapr.c +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Placeholder to force aprlib.dll creation with no LNK4001 error - * - * However, this isn't a bad place to store dynamic-only functions - * that determine which version of apr the application has loaded. - * These functions are of (less?) importance to static-bound apps. - */ From 7a0f8ec9f1a4fa25f5a4fe2f96869751222c9ef0 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Thu, 18 Jan 2001 23:15:20 +0000 Subject: [PATCH 1093/7878] fix typo in recent APR_DECLARE work git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61074 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_xlate.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/apr_xlate.h b/include/apr_xlate.h index dd8bd0bff91..caa2d93f472 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -114,8 +114,7 @@ APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, * @param onoff Output: whether or not the conversion is single-byte-only * @deffunc apr_status_t apr_xlate_get_sb(apr_xlate_t *convset, int *onoff) */ - -APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff) +APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff); /** * Convert a buffer of text from one codepage to another. From f567dadf86c50e016867680fd6ef336940ead311 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 19 Jan 2001 03:08:40 +0000 Subject: [PATCH 1094/7878] The more things change... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61075 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/STATUS b/STATUS index 2ed97ce8c8d..8f9d7879db0 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/18 04:34:43 $] +Last modified at [$Date: 2001/01/19 03:08:40 $] Release: @@ -16,10 +16,7 @@ Release: RELEASE SHOWSTOPPERS: * Many linkage errors are gpfaulting Apache/win32 in various configs - (load mod_dav, for example.) Must complete the APR_DECLARES - Gregory Nicholes is working on this, with quick response from rbb - Will Rowe will fold over the libapr.dsp into it's own library - and remove the exports from the simple apr.dsp once it's done. + (load mod_dav, for example.) * Replace APR_GET_POOL macro with a typesafe mechanism to get the pool from an APR (incomplete) type. From b0b32123f55d985e0bbc7cab820f36deedef8d05 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 19 Jan 2001 03:13:02 +0000 Subject: [PATCH 1095/7878] All platforms now register a cleanup when a DSO is loaded. This just makes a practice uniform across all platforms. In the past, this was done differently on different platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61076 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ STATUS | 6 +----- dso/aix/dso.c | 9 +++++++++ dso/beos/dso.c | 9 +++++++++ dso/unix/dso.c | 9 +++++++++ dso/win32/dso.c | 9 +++++++++ 6 files changed, 42 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 04eb865931e..bdadc67fc32 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) All dso implementations now register a cleanup to unload the DSO + when it is loaded. If the pool is removed, we really do need to + remove the DSO. In the past, different platforms behaved differently + it this respect. [Ryan Bloom] + *) Add linkage declarations to the DSO code. [Gregory Nicholls <gnicholls@level8.com>] diff --git a/STATUS b/STATUS index 8f9d7879db0..5a5f9b87ce9 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/19 03:08:40 $] +Last modified at [$Date: 2001/01/19 03:13:00 $] Release: @@ -57,10 +57,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: located in libc, libcrypt, or libufc) Status: Greg +1 (volunteers) - * apr_dso_load() should (uniformly) add a cleanup to unload the DSO. - Currently, the per-platform DSO loading is inconsistent in this - regard. - * apr_create_lock() changes: - It ignores the "type" parameter, so toss it. - The fname param is allowed to be NULL on the Unix platform. diff --git a/dso/aix/dso.c b/dso/aix/dso.c index cd63af0b1a2..98425c6c107 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -132,6 +132,12 @@ struct dl_info { * add the basic "wrappers" here. */ +static apr_status_t dso_cleanup(void *thedso) +{ + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); +} + APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { @@ -143,6 +149,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; + + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + return APR_SUCCESS; } diff --git a/dso/beos/dso.c b/dso/beos/dso.c index bb01d858c77..4306db765a6 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -56,6 +56,12 @@ #if APR_HAS_DSO +static apr_status_t dso_cleanup(void *thedso) +{ + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); +} + APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { @@ -67,6 +73,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = newid; (*res_handle)->cont = ctx; + + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + return APR_SUCCESS; } diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 154a11fb0f5..ada9c314fc0 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -61,6 +61,12 @@ #include <stddef.h> #endif +static apr_status_t dso_cleanup(void *thedso) +{ + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); +} + APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { @@ -88,6 +94,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; (*res_handle)->errormsg = NULL; + + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + return APR_SUCCESS; } diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 3899fa223b3..a2ba47ddb38 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -59,6 +59,12 @@ #if APR_HAS_DSO +static apr_status_t dso_cleanup(void *thedso) +{ + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); +} + APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { @@ -111,6 +117,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; (*res_handle)->load_error = APR_SUCCESS; + + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + return APR_SUCCESS; } From c06af230f68b08d7d66736d098f72873a8efbcfa Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 19 Jan 2001 07:04:35 +0000 Subject: [PATCH 1096/7878] The big change. This is part 3 of the apr-util symbols rename, please see the first commit of srclib/apr-util/include (cvs apr-util/include) for the quick glance at symbols changed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61077 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 2 ++ include/apr.hw | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index d047bbe814d..b2660d9ee6b 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -135,6 +135,8 @@ /* Typedefs that APR needs. */ +typedef unsigned char apr_byte_t; + typedef @short_value@ apr_int16_t; typedef unsigned @short_value@ apr_uint16_t; diff --git a/include/apr.hw b/include/apr.hw index 111bbc90e0e..21727efef9d 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -199,11 +199,13 @@ /* Typedefs that APR needs. */ -typedef short apr_int16_t; -typedef unsigned short apr_uint16_t; +typedef unsigned char apr_byte_t; + +typedef short apr_int16_t; +typedef unsigned short apr_uint16_t; -typedef int apr_int32_t; -typedef unsigned int apr_uint32_t; +typedef int apr_int32_t; +typedef unsigned int apr_uint32_t; typedef __int64 apr_int64_t; typedef unsigned __int64 apr_uint64_t; From dfef1bf7a30d7bb9f64d97e85e3f0eefe1912f4d Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Fri, 19 Jan 2001 09:56:32 +0000 Subject: [PATCH 1097/7878] watch out for a double-unload. one manually from apr_dso_unload(), followed by one through the pool cleanup. 1) protect the unload by setting/checking the handle to NULL 2) unload "runs" the cleanup to also remove it from the pool cleanup git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61078 13f79535-47bb-0310-9956-ffa450edef68 --- dso/aix/dso.c | 12 +++++++----- dso/beos/dso.c | 12 +++++++----- dso/os2/dso.c | 24 ++++++++++++------------ dso/os390/dso.c | 28 ++++++++++++++-------------- dso/unix/dso.c | 24 ++++++++++++++---------- dso/win32/dso.c | 13 ++++++++----- include/arch/os390/dso.h | 1 + 7 files changed, 63 insertions(+), 51 deletions(-) diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 98425c6c107..1926180bb7e 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -135,7 +135,12 @@ struct dl_info { static apr_status_t dso_cleanup(void *thedso) { apr_dso_handle_t *dso = thedso; - return apr_dso_unload(dso); + + if (dso->handle != NULL && dlclose(dso->handle) != 0) + return APR_EINIT; + dso->handle = NULL; + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, @@ -157,10 +162,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - if (dlclose(handle->handle) != 0) - return APR_EINIT; - - return APR_SUCCESS; + return apr_run_cleanup(handle->cont, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 4306db765a6..6fdc4cd750d 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -59,7 +59,12 @@ static apr_status_t dso_cleanup(void *thedso) { apr_dso_handle_t *dso = thedso; - return apr_dso_unload(dso); + + if (dso->handle != NULL && unload_add_on(dso->handle) < B_NO_ERROR) + return APR_EINIT; + dso->handle = NULL; + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, @@ -81,10 +86,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - if(unload_add_on(handle->handle) < B_NO_ERROR) - return APR_EINIT; - - return APR_SUCCESS; + return apr_run_cleanup(handle->cont, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, diff --git a/dso/os2/dso.c b/dso/os2/dso.c index 03dcecae2e1..d3d6a17e550 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -64,7 +64,17 @@ static apr_status_t dso_cleanup(void *thedso) { apr_dso_handle_t *dso = thedso; - return apr_dso_unload(dso); + int rc; + + if (dso->handle == 0) + return APR_SUCCESS; + + rc = DosFreeModule(dso->handle); + + if (rc == 0) + dso->handle = 0; + + return APR_OS2_STATUS(rc); } @@ -94,17 +104,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - int rc; - - if (handle->handle == 0) - return APR_SUCCESS; - - rc = DosFreeModule(handle->handle); - - if (rc == 0) - handle->handle = 0; - - return APR_OS2_STATUS(rc); + return apr_run_cleanup(handle->cont, handle, dso_cleanup); } diff --git a/dso/os390/dso.c b/dso/os390/dso.c index 1f4fda65adc..631d941bf24 100644 --- a/dso/os390/dso.c +++ b/dso/os390/dso.c @@ -62,7 +62,19 @@ static apr_status_t dso_cleanup(void *thedso) { apr_dso_handle_t *dso = thedso; - return apr_dso_unload(dso); + int rc; + + if (dso->handle == 0) + return APR_SUCCESS; + + rc = dllfree(dso->handle); + + if (rc == 0) { + dso->handle = 0; + return APR_SUCCESS; + } + dso->failing_errno = errno; + return errno; } APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, @@ -85,19 +97,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - int rc; - - if (handle->handle == 0) - return APR_SUCCESS; - - rc = dllfree(handle->handle); - - if (rc == 0) { - handle->handle = 0; - return APR_SUCCESS; - } - handle->failing_errno = errno; - return errno; + return apr_run_cleanup(handle->pool, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, diff --git a/dso/unix/dso.c b/dso/unix/dso.c index ada9c314fc0..25871f7ed47 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -64,7 +64,19 @@ static apr_status_t dso_cleanup(void *thedso) { apr_dso_handle_t *dso = thedso; - return apr_dso_unload(dso); + + if (dso->handle == NULL) + return APR_SUCCESS; + +#if defined(HPUX) || defined(HPUX10) || defined(HPUX11) + shl_unload((shl_t)dso->handle); +#else + if (dlclose(dso->handle) != 0) + return APR_EINIT; +#endif + dso->handle = NULL; + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, @@ -102,15 +114,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { -#if defined(HPUX) || defined(HPUX10) || defined(HPUX11) - shl_unload((shl_t)handle->handle); -#else - if (dlclose(handle->handle) != 0) - return APR_EINIT; -#endif - handle->handle = NULL; - - return APR_SUCCESS; + return apr_run_cleanup(handle->cont, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, diff --git a/dso/win32/dso.c b/dso/win32/dso.c index a2ba47ddb38..3b697901626 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -62,7 +62,13 @@ static apr_status_t dso_cleanup(void *thedso) { apr_dso_handle_t *dso = thedso; - return apr_dso_unload(dso); + + if (dso->handle != NULL && !FreeLibrary(dso->handle)) { + return apr_get_os_error(); + } + dso->handle = NULL; + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, @@ -125,10 +131,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, APR_DECLARE(apr_status_t) apr_dso_unload(struct apr_dso_handle_t *handle) { - if (!FreeLibrary(handle->handle)) { - return apr_get_os_error(); - } - return APR_SUCCESS; + return apr_run_cleanup(handle->cont, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, diff --git a/include/arch/os390/dso.h b/include/arch/os390/dso.h index 0ee06e7f911..5e112c13b60 100644 --- a/include/arch/os390/dso.h +++ b/include/arch/os390/dso.h @@ -69,6 +69,7 @@ struct apr_dso_handle_t { dllhandle *handle; /* Handle to the DSO loaded */ int failing_errno; /* Don't save the buffer returned by strerror(); it gets reused */ + apr_pool_t *pool; }; #endif From f2458b13ff924e73b5077443d623ebdb06fa1b8c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Fri, 19 Jan 2001 17:29:44 +0000 Subject: [PATCH 1098/7878] This have become to danged harry, time for a split. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61079 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 270 ++++++++++++++++++++++++++++++++++++++++ include/apr_file_io.h | 270 +++++++--------------------------------- 2 files changed, 312 insertions(+), 228 deletions(-) create mode 100644 include/apr_file_info.h diff --git a/include/apr_file_info.h b/include/apr_file_info.h new file mode 100644 index 00000000000..a180f7e6f6d --- /dev/null +++ b/include/apr_file_info.h @@ -0,0 +1,270 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#ifndef APR_FILE_INFO_H +#define APR_FILE_INFO_H + +#include "apr.h" +#include "apr_pools.h" +#include "apr_time.h" +#include "apr_errno.h" + +#if APR_HAVE_SYS_UIO_H +#include <sys/uio.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @package APR File handling + */ + +typedef enum { + APR_NOFILE, /* the file exists, but APR doesn't know its type */ + APR_REG, /* a regular file */ + APR_DIR, /* a directory */ + APR_CHR, /* a character device */ + APR_BLK, /* a block device */ + APR_PIPE, /* a FIFO / pipe */ + APR_LNK, /* a symbolic link */ + APR_SOCK /* a [unix domain] socket */ +} apr_filetype_e; + +/* Permissions flags */ +#define APR_UREAD 0x400 +#define APR_UWRITE 0x200 +#define APR_UEXECUTE 0x100 + +#define APR_GREAD 0x040 +#define APR_GWRITE 0x020 +#define APR_GEXECUTE 0x010 + +#define APR_WREAD 0x004 +#define APR_WWRITE 0x002 +#define APR_WEXECUTE 0x001 + +#define APR_OS_DEFAULT 0xFFF + +/** + * Structure for referencing directories. + * @defvar apr_dir_t + */ +typedef struct apr_dir_t apr_dir_t; +/** + * Structure for determining file permissions. + * @defvar apr_fileperms_t + */ +typedef apr_int32_t apr_fileperms_t; +/** + * Structure for determining file owner. + * @defvar apr_uid_t + */ +typedef uid_t apr_uid_t; +/** + * Structure for determining the group that owns the file. + * @defvar apr_gid_t + */ +typedef gid_t apr_gid_t; +#ifdef WIN32 +/** + * Structure for determining the inode of the file. + * @defvar apr_ino_t + */ +typedef apr_uint64_t apr_ino_t; +/** + * Structure for determining the device the file is on. + * @defvar apr_dev_t + */ +typedef apr_uint32_t apr_dev_t; +#else +typedef ino_t apr_ino_t; +typedef dev_t apr_dev_t; +#endif + +typedef struct apr_finfo_t apr_finfo_t; + +/** + * The file information structure. This is analogous to the POSIX + * stat structure. + */ +struct apr_finfo_t { + /** The access permissions of the file. Currently this mimics Unix + * access rights. + */ + apr_fileperms_t protection; + /** The type of file. One of APR_NOFILE, APR_REG, APR_DIR, APR_CHR, + * APR_BLK, APR_PIPE, APR_LNK, APR_SOCK + */ + apr_filetype_e filetype; + /** The user id that owns the file */ + apr_uid_t user; + /** The group id that owns the file */ + apr_gid_t group; + /** The inode of the file. (Not portable?) */ + apr_ino_t inode; + /** The id of the device the file is on. (Not portable?) */ + apr_dev_t device; + /** The size of the file */ + apr_off_t size; + /** The time the file was last accessed */ + apr_time_t atime; + /** The time the file was last modified */ + apr_time_t mtime; + /** The time the file was last changed */ + apr_time_t ctime; +}; + +/** + * get the specified file's stats. The file is specified by filename, + * instead of using a pre-opened file. + * @param finfo Where to store the information about the file, which is + * never touched if the call fails. + * @param fname The name of the file to stat. + * @param cont the pool to use to allocate the new file. + * @deffunc apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) + */ +APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, + apr_pool_t *cont); + +/** + * get the specified file's stats. The file is specified by filename, + * instead of using a pre-opened file. If the file is a symlink, this function + * will get the stats for the symlink not the file the symlink refers to. + * @param finfo Where to store the information about the file, which is + * never touched if the call fails. + * @param fname The name of the file to stat. + * @param cont the pool to use to allocate the new file. + * @deffunc apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) + */ +APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, + apr_pool_t *cont); + +/** + * Open the specified directory. + * @param new_dir The opened directory descriptor. + * @param dirname The full path to the directory (use / on all systems) + * @param cont The pool to use. + * @deffunc apr_status_t apr_dir_open(apr_dir_t **new_dir, const char *dirname, apr_pool_t *cont) + */ +APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir, + const char *dirname, + apr_pool_t *cont); + +/** + * close the specified directory. + * @param thedir the directory descriptor to close. + * @deffunc apr_status_t apr_closedir(apr_dir_t *thedir) + */ +APR_DECLARE(apr_status_t) apr_closedir(apr_dir_t *thedir); + +/** + * Read the next entry from the specified directory. + * @param thedir the directory descriptor to read from, and fill out. + * @tip All systems return . and .. as the first two files. + * @deffunc apr_status_t apr_readdir(apr_dir_t *thedir) + */ +APR_DECLARE(apr_status_t) apr_readdir(apr_dir_t *thedir); + +/** + * Rewind the directory to the first entry. + * @param thedir the directory descriptor to rewind. + * @deffunc apr_status_t apr_rewinddir(apr_dir_t *thedir) + */ +APR_DECLARE(apr_status_t) apr_rewinddir(apr_dir_t *thedir); + +/** + * Get the file name of the current directory entry. + * @param new_path the file name of the directory entry. + * @param thedir the currently open directory. + * @deffunc apr_status_t apr_get_dir_filename(const char **new_path, apr_dir_t *thedir) + */ +APR_DECLARE(apr_status_t) apr_get_dir_filename(const char **new_path, + apr_dir_t *thedir); + +/** + * Get the size of the current directory entry. + * @param size the size of the directory entry. + * @param thedir the currently open directory. + * @deffunc apr_status_t apr_dir_entry_size(apr_size_t *size, apr_dir_t *thedir) + */ +APR_DECLARE(apr_status_t) apr_dir_entry_size(apr_size_t *size, + apr_dir_t *thedir); + +/** + * Get the last modified time of the current directory entry. + * @param mtime the last modified time of the directory entry. + * @param thedir the currently open directory. + * @deffunc apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir) + */ +APR_DECLARE(apr_status_t) apr_dir_entry_mtime(apr_time_t *mtime, + apr_dir_t *thedir); + +/** + * Get the file type of the current directory entry. + * @param type the file type of the directory entry. + * @param thedir the currently open directory. + * @deffunc apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) + */ +APR_DECLARE(apr_status_t) apr_dir_entry_ftype(apr_filetype_e *type, + apr_dir_t *thedir); + +#ifdef __cplusplus +} +#endif + +#endif /* ! APR_FILE_INFO_H */ + + diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 06658c6ceb8..6418da3bb5b 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -59,6 +59,7 @@ #include "apr_pools.h" #include "apr_time.h" #include "apr_errno.h" +#include "apr_file_info.h" #if APR_HAVE_STDIO_H #include <stdio.h> /* for SEEK_* */ @@ -76,17 +77,6 @@ extern "C" { * @package APR File handling */ -typedef enum { - APR_NOFILE, /* the file exists, but APR doesn't know its type */ - APR_REG, /* a regular file */ - APR_DIR, /* a directory */ - APR_CHR, /* a character device */ - APR_BLK, /* a block device */ - APR_PIPE, /* a FIFO / pipe */ - APR_LNK, /* a symbolic link */ - APR_SOCK /* a [unix domain] socket */ -} apr_filetype_e; - /* Flags for apr_open */ #define APR_READ 1 /* Open the file for reading */ #define APR_WRITE 2 /* Open the file for writing */ @@ -104,21 +94,6 @@ typedef enum { #define APR_CUR SEEK_CUR #define APR_END SEEK_END -/* Permissions flags */ -#define APR_UREAD 0x400 -#define APR_UWRITE 0x200 -#define APR_UEXECUTE 0x100 - -#define APR_GREAD 0x040 -#define APR_GWRITE 0x020 -#define APR_GEXECUTE 0x010 - -#define APR_WREAD 0x004 -#define APR_WWRITE 0x002 -#define APR_WEXECUTE 0x001 - -#define APR_OS_DEFAULT 0xFFF - /* should be same as whence type in lseek, POSIX defines this as int */ typedef apr_int32_t apr_seek_where_t; @@ -127,73 +102,6 @@ typedef apr_int32_t apr_seek_where_t; * @defvar apr_file_t */ typedef struct apr_file_t apr_file_t; -typedef struct apr_finfo_t apr_finfo_t; -/** - * Structure for referencing directories. - * @defvar apr_dir_t - */ -typedef struct apr_dir_t apr_dir_t; -/** - * Structure for determining file permissions. - * @defvar apr_fileperms_t - */ -typedef apr_int32_t apr_fileperms_t; -/** - * Structure for determining file owner. - * @defvar apr_uid_t - */ -typedef uid_t apr_uid_t; -/** - * Structure for determining the group that owns the file. - * @defvar apr_gid_t - */ -typedef gid_t apr_gid_t; -#ifdef WIN32 -/** - * Structure for determining the inode of the file. - * @defvar apr_ino_t - */ -typedef apr_uint64_t apr_ino_t; -/** - * Structure for determining the device the file is on. - * @defvar apr_dev_t - */ -typedef apr_uint32_t apr_dev_t; -#else -typedef ino_t apr_ino_t; -typedef dev_t apr_dev_t; -#endif - -/** - * The file information structure. This is analogous to the POSIX - * stat structure. - */ -struct apr_finfo_t { - /** The access permissions of the file. Currently this mimics Unix - * access rights. - */ - apr_fileperms_t protection; - /** The type of file. One of APR_NOFILE, APR_REG, APR_DIR, APR_CHR, - * APR_BLK, APR_PIPE, APR_LNK, APR_SOCK - */ - apr_filetype_e filetype; - /** The user id that owns the file */ - apr_uid_t user; - /** The group id that owns the file */ - apr_gid_t group; - /** The inode of the file. (Not portable?) */ - apr_ino_t inode; - /** The id of the device the file is on. (Not portable?) */ - apr_dev_t device; - /** The size of the file */ - apr_off_t size; - /** The time the file was last accessed */ - apr_time_t atime; - /** The time the file was last modified */ - apr_time_t mtime; - /** The time the file was last changed */ - apr_time_t ctime; -}; /* File lock types/flags */ #define APR_FLOCK_SHARED 1 /* Shared lock. More than one process @@ -456,54 +364,6 @@ APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p); -/** - * get the specified file's stats. - * @param finfo Where to store the information about the file. - * @param thefile The file to get information about. - * @deffunc apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) - */ -APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, - apr_file_t *thefile); - -/** - * set the specified file's permission bits. - * @param fname The file (name) to apply the permissions to. - * @param perms The permission bits to apply to the file. - * @tip Some platforms may not be able to apply all of the available - * permission bits; APR_INCOMPLETE will be returned if some permissions - * are specified which could not be set. - * - * Platforms which do not implement this feature will return APR_ENOTIMPL. - * @deffunc apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) - */ -APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname, - apr_fileperms_t perms); - -/** - * get the specified file's stats. The file is specified by filename, - * instead of using a pre-opened file. - * @param finfo Where to store the information about the file, which is - * never touched if the call fails. - * @param fname The name of the file to stat. - * @param cont the pool to use to allocate the new file. - * @deffunc apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) - */ -APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, - apr_pool_t *cont); - -/** - * get the specified file's stats. The file is specified by filename, - * instead of using a pre-opened file. If the file is a symlink, this function - * will get the stats for the symlink not the file the symlink refers to. - * @param finfo Where to store the information about the file, which is - * never touched if the call fails. - * @param fname The name of the file to stat. - * @param cont the pool to use to allocate the new file. - * @deffunc apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) - */ -APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_pool_t *cont); - /** * Move the read/write file offset to a specified byte within a file. * @param thefile The file descriptor @@ -521,57 +381,6 @@ APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset); -/** - * Open the specified directory. - * @param new_dir The opened directory descriptor. - * @param dirname The full path to the directory (use / on all systems) - * @param cont The pool to use. - * @deffunc apr_status_t apr_dir_open(apr_dir_t **new_dir, const char *dirname, apr_pool_t *cont) - */ -APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir, - const char *dirname, - apr_pool_t *cont); - -/** - * close the specified directory. - * @param thedir the directory descriptor to close. - * @deffunc apr_status_t apr_closedir(apr_dir_t *thedir) - */ -APR_DECLARE(apr_status_t) apr_closedir(apr_dir_t *thedir); - -/** - * Read the next entry from the specified directory. - * @param thedir the directory descriptor to read from, and fill out. - * @tip All systems return . and .. as the first two files. - * @deffunc apr_status_t apr_readdir(apr_dir_t *thedir) - */ -APR_DECLARE(apr_status_t) apr_readdir(apr_dir_t *thedir); - -/** - * Rewind the directory to the first entry. - * @param thedir the directory descriptor to rewind. - * @deffunc apr_status_t apr_rewinddir(apr_dir_t *thedir) - */ -APR_DECLARE(apr_status_t) apr_rewinddir(apr_dir_t *thedir); - -/** - * Create a new directory on the file system. - * @param path the path for the directory to be created. (use / on all systems) - * @param perm Permissions for the new direcoty. - * @param cont the pool to use. - * @deffunc apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) - */ -APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm, - apr_pool_t *cont); - -/** - * Remove directory from the file system. - * @param path the path for the directory to be removed. (use / on all systems) - * @param cont the pool to use. - * @deffunc apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) - */ -APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont); - /** * Create an anonymous pipe. * @param in The file descriptor to use as input to the pipe. @@ -644,15 +453,6 @@ APR_DECLARE(apr_status_t) apr_unlock_file(apr_file_t *thefile); APR_DECLARE(apr_status_t) apr_get_filename(const char **new_path, apr_file_t *thefile); -/** - * Get the file name of the current directory entry. - * @param new_path the file name of the directory entry. - * @param thedir the currently open directory. - * @deffunc apr_status_t apr_get_dir_filename(const char **new_path, apr_dir_t *thedir) - */ -APR_DECLARE(apr_status_t) apr_get_dir_filename(const char **new_path, - apr_dir_t *thedir); - /** * Return the data associated with the current file. * @param data The user data associated with the file. @@ -675,33 +475,6 @@ APR_DECLARE(apr_status_t) apr_set_filedata(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)); -/** - * Get the size of the current directory entry. - * @param size the size of the directory entry. - * @param thedir the currently open directory. - * @deffunc apr_status_t apr_dir_entry_size(apr_size_t *size, apr_dir_t *thedir) - */ -APR_DECLARE(apr_status_t) apr_dir_entry_size(apr_size_t *size, - apr_dir_t *thedir); - -/** - * Get the last modified time of the current directory entry. - * @param mtime the last modified time of the directory entry. - * @param thedir the currently open directory. - * @deffunc apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir) - */ -APR_DECLARE(apr_status_t) apr_dir_entry_mtime(apr_time_t *mtime, - apr_dir_t *thedir); - -/** - * Get the file type of the current directory entry. - * @param type the file type of the directory entry. - * @param thedir the currently open directory. - * @deffunc apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) - */ -APR_DECLARE(apr_status_t) apr_dir_entry_ftype(apr_filetype_e *type, - apr_dir_t *thedir); - /** * Write a string to a file using a printf format. * @param fptr The file to write to. @@ -713,6 +486,47 @@ APR_DECLARE(apr_status_t) apr_dir_entry_ftype(apr_filetype_e *type, APR_DECLARE_NONSTD(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) __attribute__((format(printf,2,3))); +/** + * set the specified file's permission bits. + * @param fname The file (name) to apply the permissions to. + * @param perms The permission bits to apply to the file. + * @tip Some platforms may not be able to apply all of the available + * permission bits; APR_INCOMPLETE will be returned if some permissions + * are specified which could not be set. + * + * Platforms which do not implement this feature will return APR_ENOTIMPL. + * @deffunc apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) + */ +APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname, + apr_fileperms_t perms); + +/** + * Create a new directory on the file system. + * @param path the path for the directory to be created. (use / on all systems) + * @param perm Permissions for the new direcoty. + * @param cont the pool to use. + * @deffunc apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) + */ +APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm, + apr_pool_t *cont); + +/** + * Remove directory from the file system. + * @param path the path for the directory to be removed. (use / on all systems) + * @param cont the pool to use. + * @deffunc apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) + */ +APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont); + +/** + * get the specified file's stats. + * @param finfo Where to store the information about the file. + * @param thefile The file to get information about. + * @deffunc apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) + */ +APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, + apr_file_t *thefile); + #ifdef __cplusplus } #endif From 308550f84bc1ad644a19bf80805a7649771b0c95 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 19 Jan 2001 20:44:46 +0000 Subject: [PATCH 1099/7878] Fix make depend. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61080 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ helpers/rules.mk.in | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index bdadc67fc32..7b8318a724f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Fix make depend. [Ryan Bloom] + *) All dso implementations now register a cleanup to unload the DSO when it is loaded. If the pool is removed, we really do need to remove the DSO. In the past, different platforms behaved differently diff --git a/helpers/rules.mk.in b/helpers/rules.mk.in index efc8696b65b..0f230d3755e 100644 --- a/helpers/rules.mk.in +++ b/helpers/rules.mk.in @@ -118,7 +118,9 @@ all-recursive depend-recursive clean-recursive distclean-recursive \ made_local=n/a; \ fi; \ if test -z "$$made_local"; then \ - $(MAKE) "local-$$otarget" || exit 1; \ + if test "$$otarget" != "depend" || test `pwd` != "$(top_builddir)"; then \ + $(MAKE) "local-$$otarget" || exit 1; \ + fi; \ fi local-clean: x-local-clean From 47ac532f9878140c2202a46bc4da1bc7f1702f1f Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Fri, 19 Jan 2001 21:48:37 +0000 Subject: [PATCH 1100/7878] keep the recursive logic simple (it's quite hairy already), and deal with dependency logic within the local-depend rule. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61081 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/rules.mk.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/helpers/rules.mk.in b/helpers/rules.mk.in index 0f230d3755e..097c1c34d04 100644 --- a/helpers/rules.mk.in +++ b/helpers/rules.mk.in @@ -118,9 +118,7 @@ all-recursive depend-recursive clean-recursive distclean-recursive \ made_local=n/a; \ fi; \ if test -z "$$made_local"; then \ - if test "$$otarget" != "depend" || test `pwd` != "$(top_builddir)"; then \ - $(MAKE) "local-$$otarget" || exit 1; \ - fi; \ + $(MAKE) "local-$$otarget" || exit 1; \ fi local-clean: x-local-clean @@ -139,7 +137,10 @@ local-extraclean: local-distclean local-all: $(TARGETS) local-depend: - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c + @if test -n "`ls *.c 2> /dev/null`"; then \ + echo $(MKDEP) $(INCLUDES) $(CFLAGS) *.c ; \ + $(MKDEP) $(INCLUDES) $(CFLAGS) *.c ; \ + fi # to be filled in by the actual Makefile x-local-clean x-local-distclean: From 486b7d4bf14b6b3e49335f203a334fd81cdb9bcc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 20 Jan 2001 00:56:10 +0000 Subject: [PATCH 1101/7878] Two headers, now two entries for msvc users git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61082 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++++ libapr.dsp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apr.dsp b/apr.dsp index 2388dc6c906..9c7b8dccad8 100644 --- a/apr.dsp +++ b/apr.dsp @@ -443,6 +443,10 @@ SOURCE=.\include\apr_errno.h # End Source File # Begin Source File +SOURCE=.\include\apr_file_info.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_file_io.h # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index 87e3333bc41..6988d7db915 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -449,6 +449,10 @@ SOURCE=.\include\apr_errno.h # End Source File # Begin Source File +SOURCE=.\include\apr_file_info.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_file_io.h # End Source File # Begin Source File From bd048c6c5eb2308d44cc15e8ae08fec29b0bcf78 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sat, 20 Jan 2001 11:34:32 +0000 Subject: [PATCH 1102/7878] yes, you *will* use a hash instead. any questions can be directed to Bubba. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61083 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 159 ---------------------------- tables/apr_tables.c | 247 ------------------------------------------- 2 files changed, 406 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index 84de6e917ec..8529b2f3233 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -80,7 +80,6 @@ extern "C" { * published. */ typedef struct apr_table_t apr_table_t; -typedef struct apr_btable_t apr_btable_t; typedef struct apr_array_header_t apr_array_header_t; /** An opaque array type */ @@ -112,21 +111,6 @@ struct apr_table_t { #endif }; -/** The opaque binary-content table type */ -struct apr_btable_t { - /* This has to be first to promote backwards compatibility with - * older modules which cast a apr_table_t * to an apr_array_header_t *... - * they should use the table_elts() function for most of the - * cases they do this for. - */ - /** The underlying array for the table */ - apr_array_header_t a; -#ifdef MAKE_TABLE_PROFILE - /** Who created the array. */ - void *creator; -#endif -}; - /** * The (opaque) structure for string-content tables. */ @@ -142,11 +126,6 @@ struct apr_table_entry_t { char *val; }; -/** - * The (opaque) structure for binary-content tables. - */ -typedef struct apr_btable_entry_t apr_btable_entry_t; - /** * A transparent type for items stored in binary-content tables, and * possibly elsewhere. @@ -162,16 +141,6 @@ typedef struct apr_item_t { void *data; } apr_item_t; -/** The type for each entry in a binary-content table */ -struct apr_btable_entry_t { - /** The key for the current table entry */ - char *key; /* maybe NULL in future; - * check when iterating thru table_elts - */ - /** The value for the current table entry */ - apr_item_t *val; -}; - /** * Get the elements from a table * @param t The table @@ -180,14 +149,6 @@ struct apr_btable_entry_t { */ #define apr_table_elts(t) ((apr_array_header_t *)(t)) -/** - * Get the elements from a binary table - * @param t The table - * @return An array containing the contents of the table - * @deffunc apr_array_header_t *apr_table_elts(apr_table_t *t) - */ -#define apr_btable_elts(t) apr_table_elts(t) - /** * Determine if the table is empty * @param t The table to check @@ -196,13 +157,6 @@ struct apr_btable_entry_t { */ #define apr_is_empty_table(t) (((t) == NULL) \ || (((apr_array_header_t *)(t))->nelts == 0)) -/** - * Determine if the binary table is empty - * @param t The table to check - * @return True if empty, Falso otherwise - * @deffunc int apr_is_empty_btable(apr_table_t *t) - */ -#define apr_is_empty_btable(t) apr_is_empty_table(t) /** * Create an array @@ -300,15 +254,6 @@ APR_DECLARE(char *) apr_array_pstrcat(struct apr_pool_t *p, */ APR_DECLARE(apr_table_t *) apr_make_table(struct apr_pool_t *p, int nelts); -/** - * Make a new table capable of storing binary data - * @param p The pool to allocate the pool out of - * @param nelts The number of elements in the initial table. - * @return The new table. - * @deffunc apr_table_t *apr_make_btable(apr_pool_t *p, int nelts) - */ -APR_DECLARE(apr_btable_t *) apr_make_btable(struct apr_pool_t *p, int nelts); - /** * Create a new table and copy another table into it * @param p The pool to allocate the new table out of @@ -319,16 +264,6 @@ APR_DECLARE(apr_btable_t *) apr_make_btable(struct apr_pool_t *p, int nelts); APR_DECLARE(apr_table_t *) apr_copy_table(struct apr_pool_t *p, const apr_table_t *t); -/** - * Create a new binary table and copy another table into it - * @param p The pool to allocate the new table out of - * @param t The table to copy - * @return A copy of the table passed in - * @deffunc apr_table_t *apr_copy_btable(apr_pool_t *p, const apr_btable_t *t) - */ -APR_DECLARE(apr_btable_t *) apr_copy_btable(struct apr_pool_t *p, - const apr_btable_t *t); - /** * Delete all of the elements from a table * @param t The table to clear @@ -336,13 +271,6 @@ APR_DECLARE(apr_btable_t *) apr_copy_btable(struct apr_pool_t *p, */ APR_DECLARE(void) apr_clear_table(apr_table_t *t); -/** - * Delete all of the elements from a binary table - * @param t The table to clear - * @deffunc void apr_clear_btable(apr_btable_t *t) - */ -APR_DECLARE(void) apr_clear_btable(apr_btable_t *t); - /** * Get the value associated with a given key from the table. After this call, * The data is still in the table @@ -353,17 +281,6 @@ APR_DECLARE(void) apr_clear_btable(apr_btable_t *t); */ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); -/** - * Get the value associated with a given key from a binary table. After this - * call, the data is still in the table. - * @param t The table to search for the key - * @param key The key to search for - * @return The value associated with the key - * @deffunc const apr_item_t *apr_btable_get(const apr_btable_t *t, const char *key) - */ -APR_DECLARE(const apr_item_t *) apr_btable_get(const apr_btable_t *t, - const char *key); - /** * Add a key/value pair to a table, if another element already exists with the * same key, this will over-write the old data. @@ -377,20 +294,6 @@ APR_DECLARE(const apr_item_t *) apr_btable_get(const apr_btable_t *t, APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, const char *val); -/** - * Add a key/value pair to a binary table if another element already exists - * with the same key, this will over-write the old data. - * @param t The table to add the data to. - * @param key The key fo use - * @param size The size of the data to add - * @param val The value to add - * @tip When adding data, this function makes a copy of both the key and the - * value. - * @deffunc void apr_btable_set(apr_btable_t *t, const char *key, size_t size, const void *val) - */ -APR_DECLARE(void) apr_btable_set(apr_btable_t *t, const char *key, - size_t size, const void *val); - /** * Add a key/value pair to a table, if another element already exists with the * same key, this will over-write the old data. @@ -404,20 +307,6 @@ APR_DECLARE(void) apr_btable_set(apr_btable_t *t, const char *key, */ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, const char *val); -/** - * Add a key/value pair to a binary table if another element already exists - * with the same key, this will over-write the old data. - * @param t The table to add the data to. - * @param key The key fo use - * @param size The size of the data to add - * @param val The value to add - * @tip When adding data, this function does not make a copy of the key or the - * value, so care should be taken to ensure that the values will not - * change after they have been added.. - * @deffunc void apr_btable_setn(apr_btable_t *t, const char *key, size_t size, const void *val) - */ -APR_DECLARE(void) apr_btable_setn(apr_btable_t *t, const char *key, - size_t size, const void *val); /** * Remove data from the table @@ -427,14 +316,6 @@ APR_DECLARE(void) apr_btable_setn(apr_btable_t *t, const char *key, */ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key); -/** - * Remove data from a binary table - * @param t The table to remove data from - * @param key The key of the data being removed - * @deffunc void apr_btable_unset(apr_btable_t *t, const char *key) - */ -APR_DECLARE(void) apr_btable_unset(apr_btable_t *t, const char *key); - /** * Add data to a table by merging the value with data that has already been * stored @@ -472,20 +353,6 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, const char *val); -/** - * Add data to a binary table, regardless of whether there is another element - * with the same key. - * @param t The table to add to - * @param key The key to use - * @param size The size of the value to add - * @param val The value to add. - * @tip When adding data, this function makes a copy of both the key and the - * value. - * @deffunc void apr_btable_add(apr_btable_t *t, const char *key, size_t size, const char *val) - */ -APR_DECLARE(void) apr_btable_add(apr_btable_t *t, const char *key, - size_t size, const void *val); - /** * Add data to a table, regardless of whether there is another element with the * same key. @@ -500,21 +367,6 @@ APR_DECLARE(void) apr_btable_add(apr_btable_t *t, const char *key, APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, const char *val); -/** - * Add data to a binary table, regardless of whether there is another element - * with the same key. - * @param t The table to add to - * @param key The key to use - * @param size The size of the value to add - * @param val The value to add. - * @tip When adding data, this function does not make a copy of the key or the - * value, so care should be taken to ensure that the values will not - * change after they have been added.. - * @deffunc void apr_btable_addn(apr_btable_t *t, const char *key, size_t size, const char *val) - */ -APR_DECLARE(void) apr_btable_addn(apr_btable_t *t, const char *key, - size_t size, const void *val); - /** * Merge two tables into one new table * @param p The pool to use for the new table @@ -526,17 +378,6 @@ APR_DECLARE(void) apr_btable_addn(apr_btable_t *t, const char *key, APR_DECLARE(apr_table_t *) apr_overlay_tables(struct apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); -/** - * Merge two binary tables into one new table - * @param p The pool to use for the new table - * @param overlay The first table to put in the new table - * @param base The table to add at the end of the new table - * @return A new table containing all of the data from the two passed in - * @deffunc apr_btable_t *apr_overlay_tables(apr_pool_t *p, const apr_btable_t *overlay, const apr_btable_t *base); - */ -APR_DECLARE(apr_btable_t *) apr_overlay_btables(struct apr_pool_t *p, - const apr_btable_t *overlay, - const apr_btable_t *base); /** * Iterate over a table running the provided function once for every diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 4fe35bfc252..a3e5821f685 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -304,17 +304,6 @@ APR_DECLARE(apr_table_t *) apr_make_table(apr_pool_t *p, int nelts) return t; } -APR_DECLARE(apr_btable_t *) apr_make_btable(apr_pool_t *p, int nelts) -{ - apr_btable_t *t = apr_palloc(p, sizeof(apr_btable_t)); - - make_array_core(&t->a, p, nelts, sizeof(apr_btable_entry_t)); -#ifdef MAKE_TABLE_PROFILE - t->creator = __builtin_return_address(0); -#endif - return t; -} - APR_DECLARE(apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) { apr_table_t *new = apr_palloc(p, sizeof(apr_table_t)); @@ -334,36 +323,11 @@ APR_DECLARE(apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) return new; } -APR_DECLARE(apr_btable_t *) apr_copy_btable(apr_pool_t *p, - const apr_btable_t *t) -{ - apr_btable_t *new = apr_palloc(p, sizeof(apr_btable_entry_t)); - -#ifdef POOL_DEBUG - /* we don't copy keys and values, so it's necessary that t->a.pool - * have a life span at least as long as p - */ - if (!apr_pool_is_ancestor(t->a.cont, p)) { - fprintf(stderr, "copy_btable: t's pool is not an ancestor of p\n"); - abort(); - } -#endif - make_array_core(&new->a, p, t->a.nalloc, sizeof(apr_btable_entry_t)); - memcpy(new->a.elts, t->a.elts, t->a.nelts * sizeof(apr_btable_entry_t)); - new->a.nelts = t->a.nelts; - return new; -} - APR_DECLARE(void) apr_clear_table(apr_table_t *t) { t->a.nelts = 0; } -APR_DECLARE(void) apr_clear_btable(apr_btable_t *t) -{ - t->a.nelts = 0; -} - APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key) { apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; @@ -382,25 +346,6 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key) return NULL; } -APR_DECLARE(const apr_item_t *) apr_btable_get(const apr_btable_t *t, - const char *key) -{ - apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; - int i; - - if (key == NULL) { - return NULL; - } - - for (i = 0; i < t->a.nelts; ++i) { - if (!strcasecmp(elts[i].key, key)) { - return elts[i].val; - } - } - - return NULL; -} - APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, const char *val) { @@ -435,46 +380,6 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, } } -APR_DECLARE(void) apr_btable_set(apr_btable_t *t, const char *key, - size_t size, const void *val) -{ - register int i, j, k; - apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; - apr_item_t *item; - int done = 0; - - item = apr_pcalloc(t->a.cont, sizeof(apr_item_t)); - item->size = size; - item->data = apr_pcalloc(t->a.cont, size); - memcpy(item->data, val, size); - - for (i = 0; i < t->a.nelts; ) { - if (!strcasecmp(elts[i].key, key)) { - if (!done) { - elts[i].val = item; - done = 1; - ++i; - } - else { /* delete an extraneous element */ - for (j = i, k = i + 1; k < t->a.nelts; ++j, ++k) { - elts[j].key = elts[k].key; - elts[j].val = elts[k].val; - } - --t->a.nelts; - } - } - else { - ++i; - } - } - - if (!done) { - elts = (apr_btable_entry_t *) table_push((apr_btable_t *) t); - elts->key = apr_pstrdup(t->a.cont, key); - elts->val = item; - } -} - APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, const char *val) { @@ -522,58 +427,6 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, } } -APR_DECLARE(void) apr_btable_setn(apr_btable_t *t, const char *key, - size_t size, const void *val) -{ - register int i, j, k; - apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; - int done = 0; - apr_item_t *item; - -#ifdef POOL_DEBUG - { - if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.cont)) { - fprintf(stderr, "table_set: key not in ancestor pool of t\n"); - abort(); - } - if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.cont)) { - fprintf(stderr, "table_set: val not in ancestor pool of t\n"); - abort(); - } - } -#endif - - item = (apr_item_t *) apr_pcalloc(t->a.cont, size); - item->size = size; - item->data = (void *)val; - - for (i = 0; i < t->a.nelts; ) { - if (!strcasecmp(elts[i].key, key)) { - if (!done) { - elts[i].val = item; - done = 1; - ++i; - } - else { /* delete an extraneous element */ - for (j = i, k = i + 1; k < t->a.nelts; ++j, ++k) { - elts[j].key = elts[k].key; - elts[j].val = elts[k].val; - } - --t->a.nelts; - } - } - else { - ++i; - } - } - - if (!done) { - elts = (apr_btable_entry_t *) table_push((apr_table_t *)t); - elts->key = (char *)key; - elts->val = item; - } -} - APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) { register int i, j, k; @@ -599,31 +452,6 @@ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) } } -APR_DECLARE(void) apr_btable_unset(apr_btable_t *t, const char *key) -{ - register int i, j, k; - apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; - - for (i = 0; i < t->a.nelts; ) { - if (!strcasecmp(elts[i].key, key)) { - - /* found an element to skip over - * there are any number of ways to remove an element from - * a contiguous block of memory. I've chosen one that - * doesn't do a memcpy/bcopy/array_delete, *shrug*... - */ - for (j = i, k = i + 1; k < t->a.nelts; ++j, ++k) { - elts[j].key = elts[k].key; - elts[j].val = elts[k].val; - } - --t->a.nelts; - } - else { - ++i; - } - } -} - APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, const char *val) { @@ -683,21 +511,6 @@ APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, elts->val = apr_pstrdup(t->a.cont, val); } -APR_DECLARE(void) apr_btable_add(apr_btable_t *t, const char *key, - size_t size, const void *val) -{ - apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; - apr_item_t *item; - - item = (apr_item_t *) apr_pcalloc(t->a.cont, sizeof(apr_item_t)); - item->size = size; - item->data = apr_pcalloc(t->a.cont, size); - memcpy(item->data, val, size); - elts = (apr_btable_entry_t *) table_push((apr_btable_t *)t); - elts->key = apr_pstrdup(t->a.cont, key); - elts->val = item; -} - APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, const char *val) { @@ -721,34 +534,6 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, elts->val = (char *)val; } -APR_DECLARE(void) apr_btable_addn(apr_btable_t *t, const char *key, - size_t size, const void *val) -{ - apr_btable_entry_t *elts = (apr_btable_entry_t *) t->a.elts; - apr_item_t *item; - -#ifdef POOL_DEBUG - { - if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.cont)) { - fprintf(stderr, "table_set: key not in ancestor pool of t\n"); - abort(); - } - if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.cont)) { - fprintf(stderr, "table_set: key not in ancestor pool of t\n"); - abort(); - } - } -#endif - - item = (apr_item_t *) apr_pcalloc(t->a.cont, sizeof(apr_item_t)); - item->size = size; - item->data = apr_pcalloc(t->a.cont, size); - memcpy(item->data, val, size); - elts = (apr_btable_entry_t *) table_push((apr_btable_t *)t); - elts->key = (char *)key; - elts->val = item; -} - APR_DECLARE(apr_table_t *) apr_overlay_tables(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base) @@ -781,38 +566,6 @@ APR_DECLARE(apr_table_t *) apr_overlay_tables(apr_pool_t *p, return res; } -APR_DECLARE(apr_btable_t *) apr_overlay_btables(apr_pool_t *p, - const apr_btable_t *overlay, - const apr_btable_t *base) -{ - apr_btable_t *res; - -#ifdef POOL_DEBUG - /* we don't copy keys and values, so it's necessary that - * overlay->a.pool and base->a.pool have a life span at least - * as long as p - */ - if (!apr_pool_is_ancestor(overlay->a.cont, p)) { - fprintf(stderr, - "overlay_tables: overlay's pool is not an ancestor of p\n"); - abort(); - } - if (!apr_pool_is_ancestor(base->a.cont, p)) { - fprintf(stderr, - "overlay_tables: base's pool is not an ancestor of p\n"); - abort(); - } -#endif - - res = apr_palloc(p, sizeof(apr_btable_t)); - /* behave like append_arrays */ - res->a.cont = p; - copy_array_hdr_core(&res->a, &overlay->a); - apr_array_cat(&res->a, &base->a); - - return res; -} - /* And now for something completely abstract ... * For each key value given as a vararg: From 4b6a86640d414b6c8991ed443edaa232dc866077 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sat, 20 Jan 2001 11:58:21 +0000 Subject: [PATCH 1103/7878] initial cut at a feature-based include system (rather than file-based) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61084 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 10 ++-- include/apr_want.h | 116 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 7 deletions(-) create mode 100644 include/apr_want.h diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 6418da3bb5b..db94fa36467 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -61,13 +61,9 @@ #include "apr_errno.h" #include "apr_file_info.h" -#if APR_HAVE_STDIO_H -#include <stdio.h> /* for SEEK_* */ -#endif - -#if APR_HAVE_SYS_UIO_H -#include <sys/uio.h> -#endif +#define APR_WANT_STDIO /* for SEEK_* */ +#define APR_WANT_IOVEC +#include "apr_want.h" #ifdef __cplusplus extern "C" { diff --git a/include/apr_want.h b/include/apr_want.h new file mode 100644 index 00000000000..467e11653b0 --- /dev/null +++ b/include/apr_want.h @@ -0,0 +1,116 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include "apr.h" /* configuration data */ + +/* + * Features: + * + * APR_WANT_STRFUNC: strcmp, strcat, strcpy, etc + * APR_WANT_MEMFUNC: memcmp, memcpy, etc + * APR_WANT_STDIO: <stdio.h> and related bits + * APR_WANT_IOVEC: struct iovec + * + * Typical usage: + * + * #define APR_WANT_STRFUNC + * #define APR_WANT_MEMFUNC + * #include "apr_want.h" + * + * The appropriate headers will be included. + * + * Note: it is safe to use this in a header (it won't interfere with other + * headers' or source files' use of apr_want.h) + */ + +/* --------------------------------------------------------------------- */ + +#ifdef APR_WANT_STRFUNC +#if APR_HAVE_STRING_H +#include <string.h> +#endif +#if APR_HAVE_STRINGS_H +#include <strings.h> +#endif +#undef APR_WANT_STRFUND +#endif + +/* --------------------------------------------------------------------- */ + +#ifdef APR_WANT_MEMFUNC +#if APR_HAVE_STRING_H +#include <string.h> +#endif +#undef APR_WANT_MEMFUNC +#endif + +/* --------------------------------------------------------------------- */ + +#ifdef APR_WANT_STDIO +#if APR_HAVE_STDIO_H +#include <stdio.h> +#endif +#undef APR_WANT_STDIO +#endif + +/* --------------------------------------------------------------------- */ + +#ifdef APR_WANT_IOVEC +#if APR_HAVE_SYS_UIO_H +#include <sys/uio.h> +#endif +#undef APR_WANT_IOVEC +#endif + +/* --------------------------------------------------------------------- */ From 31523b23704e21b29b4869f080ee69b84c2fd426 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 20 Jan 2001 21:38:03 +0000 Subject: [PATCH 1104/7878] The APR_FINFO_wanted declaration changes for apr_stat/lstat/getfileinfo. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61085 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++++ STATUS | 7 ++++- include/apr_file_info.h | 61 +++++++++++++++++++++++++++++++++++------ include/apr_file_io.h | 8 ++++-- 4 files changed, 69 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 7b8318a724f..8f137b7c670 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Introduce the wanted flag argument to the apr_stat/lstat/getfileinfo + family of functions. This change allows the user to determine what + platform-specific file information is retrieved, to optimize both + portability and performance. [William Rowe] + *) Fix make depend. [Ryan Bloom] *) All dso implementations now register a cleanup to unload the DSO diff --git a/STATUS b/STATUS index 5a5f9b87ce9..cf9818f7e36 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/19 03:13:00 $] +Last modified at [$Date: 2001/01/20 21:38:03 $] Release: @@ -23,6 +23,9 @@ RELEASE SHOWSTOPPERS: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * Unix, OS2 apr_stat/lstat/getfileinfo were very fast hacks. These + need to be fleshed out. + * SysV semaphore support isn't usable by Apache when started as root because we don't have a way to allow the semaphore to be used by the configured User and Group. Current work-around: @@ -38,6 +41,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: something similar) to direct ap_create_process to create the process suspended. We also need a call to wake up the suspended process This may not be able to be implemented everywhere though. + Status: OtherBill asks, why? What is the benefit, how is it + portably implemented? * Replace tables with a proper opaque ADT that has pluggable implementations (including something like the existing data type, diff --git a/include/apr_file_info.h b/include/apr_file_info.h index a180f7e6f6d..21b16236c12 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -136,14 +136,43 @@ typedef dev_t apr_dev_t; typedef struct apr_finfo_t apr_finfo_t; +#define APR_FINFO_LINK 0x00000001 +#define APR_FINFO_MTIME 0x00000010 +#define APR_FINFO_CTIME 0x00000020 +#define APR_FINFO_ATIME 0x00000040 +#define APR_FINFO_SIZE 0x00000100 +#define APR_FINFO_ASIZE 0x00000200 +#define APR_FINFO_CSIZE 0x00000400 +#define APR_FINFO_DEV 0x00001000 +#define APR_FINFO_INODE 0x00002000 +#define APR_FINFO_TYPE 0x00008000 +#define APR_FINFO_USER 0x00010000 +#define APR_FINFO_GROUP 0x00020000 +#define APR_FINFO_UPROT 0x00100000 +#define APR_FINFO_GPROT 0x00200000 +#define APR_FINFO_WPROT 0x00400000 +#define APR_FINFO_ICASE 0x01000000 /* if dev is case insensitive */ +#define APR_FINFO_FCASE 0x02000000 /* filename in proper case */ + +#define APR_FINFO_MIN 0x00008170 /* minimal: type, dates and size */ +#define APR_FINFO_IDENT 0x00003000 /* dev and inode */ +#define APR_FINFO_OWNER 0x00030000 /* user and group */ +#define APR_FINFO_PROT 0x00700000 /* all protections */ +#define APR_FINFO_NORM 0x0073b170 /* the expected unix results */ + +typedef struct apr_file_t apr_file_t; + /** * The file information structure. This is analogous to the POSIX * stat structure. */ struct apr_finfo_t { - /** The access permissions of the file. Currently this mimics Unix - * access rights. - */ + /** Allocates memory and closes lingering handles in the specified pool */ + apr_pool_t *cntxt; + /** The bitmask describing valid fields of this apr_finfo_t structure + * including all available 'wanted' fields and potentially more */ + apr_int32_t valid; + /** The access permissions of the file. Mimics Unix access rights. */ apr_fileperms_t protection; /** The type of file. One of APR_NOFILE, APR_REG, APR_DIR, APR_CHR, * APR_BLK, APR_PIPE, APR_LNK, APR_SOCK @@ -153,18 +182,28 @@ struct apr_finfo_t { apr_uid_t user; /** The group id that owns the file */ apr_gid_t group; - /** The inode of the file. (Not portable?) */ + /** The inode of the file. */ apr_ino_t inode; - /** The id of the device the file is on. (Not portable?) */ + /** The id of the device the file is on. */ apr_dev_t device; /** The size of the file */ apr_off_t size; + /** The space allocated for the file */ + apr_off_t asize; + /** The storage size consumed by the file */ + apr_off_t csize; /** The time the file was last accessed */ apr_time_t atime; /** The time the file was last modified */ apr_time_t mtime; /** The time the file was last changed */ apr_time_t ctime; + /** The full pathname of the file */ + char *fname; + /** The file's name alone, in filesystem case */ + char *fcase; + /** The file's handle, if accessed (can be submitted to apr_duphandle) */ + apr_file_t *filehand; }; /** @@ -173,11 +212,12 @@ struct apr_finfo_t { * @param finfo Where to store the information about the file, which is * never touched if the call fails. * @param fname The name of the file to stat. + * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values * @param cont the pool to use to allocate the new file. - * @deffunc apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) + * @deffunc apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, - apr_pool_t *cont); + apr_int32_t wanted, apr_pool_t *cont); /** * get the specified file's stats. The file is specified by filename, @@ -186,11 +226,14 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * @param finfo Where to store the information about the file, which is * never touched if the call fails. * @param fname The name of the file to stat. + * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values * @param cont the pool to use to allocate the new file. - * @deffunc apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) + * @deffunc apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *cont) + * @tip This function is depreciated, it's equivilant to calling apr_stat with + * the wanted flag value APR_FINFO_LINK */ APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_pool_t *cont); + apr_int32_t wanted, apr_pool_t *cont); /** * Open the specified directory. diff --git a/include/apr_file_io.h b/include/apr_file_io.h index db94fa36467..d6aef2ef5df 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -84,6 +84,8 @@ extern "C" { exists. */ #define APR_BUFFERED 128 /* Open the file for buffered I/O */ #define APR_DELONCLOSE 256 /* Delete the file after close */ +#define APR_XTHREAD 512 /* Platform dependent tag to open the file + for use across multiple threads */ /* flags for apr_seek */ #define APR_SET SEEK_SET @@ -517,10 +519,12 @@ APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont); /** * get the specified file's stats. * @param finfo Where to store the information about the file. + * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values * @param thefile The file to get information about. - * @deffunc apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) + * @deffunc apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, +APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, + apr_int32_t wanted, apr_file_t *thefile); #ifdef __cplusplus From e7c77f5946db374ab4a4de7c61cada864403944b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 20 Jan 2001 21:39:05 +0000 Subject: [PATCH 1105/7878] The platform changes in apr to support the APR_FINFO_wanted declaration changes for apr_stat/lstat/getfileinfo. Much, much work to do here, but this gets us started. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61086 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 10 +- file_io/os2/filestat.c | 17 ++- file_io/os2/seek.c | 2 +- file_io/unix/fileacc.c | 15 --- file_io/unix/filestat.c | 73 ++++++++---- file_io/unix/seek.c | 2 +- file_io/win32/dir.c | 135 +++++++++-------------- file_io/win32/filedup.c | 24 +--- file_io/win32/filestat.c | 140 ++++++++++-------------- file_io/win32/open.c | 213 ++++++++++++++++++++---------------- file_io/win32/pipe.c | 8 +- file_io/win32/seek.c | 4 +- include/arch/unix/fileio.h | 18 +-- include/arch/win32/fileio.h | 88 ++++----------- test/testmmap.c | 2 +- 15 files changed, 333 insertions(+), 418 deletions(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 3b697901626..64b1818833a 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -81,10 +81,12 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, apr_oslevel_e os_level; if (!apr_get_oslevel(ctx, &os_level) && os_level >= APR_WIN_NT) { - apr_wchar_t *wpath = utf8_to_unicode_path(path, ctx); - if (!wpath) - return APR_ENAMETOOLONG; - + apr_wchar_t wpath[8192]; + apr_status_t rv; + if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) + / sizeof(apr_wchar_t), path)) { + return rv; + } /* Prevent ugly popups from killing our app */ em = SetErrorMode(SEM_FAILCRITICALERRORS); os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 1410cdb91bb..f789aa62fe3 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -113,7 +113,8 @@ static apr_status_t handle_type(apr_filetype_e *ftype, HFILE file) -apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) +apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, + apr_file_t *thefile) { ULONG rc; FILESTATUS3 fstatus; @@ -125,6 +126,8 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) if (rc == 0) { FS3_to_finfo(finfo, &fstatus); + /* XXX: This is wrong, but it will work for today */ + finfo->valid = APR_FINFO_NORM; if (finfo->filetype == APR_REG) { if (thefile->isopen) { @@ -146,7 +149,8 @@ apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) } -apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) +apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, + apr_int32_wanted, apr_pool_t *cont) { ULONG rc; FILESTATUS3 fstatus; @@ -156,9 +160,13 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) rc = DosQueryPathInfo(fname, FIL_STANDARD, &fstatus, sizeof(fstatus)); if (rc == 0) { + /* XXX: This is wrong, but it will work for today */ + finfo->valid = APR_FINFO_NORM; FS3_to_finfo(finfo, &fstatus); return APR_SUCCESS; } else if (rc == ERROR_INVALID_ACCESS) { + /* XXX: This is wrong, but it will work for today */ + finfo->valid = APR_FINFO_NORM; memset(finfo, 0, sizeof(apr_finfo_t)); finfo->protection = 0444; finfo->filetype = APR_CHR; @@ -170,7 +178,8 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) -apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) +apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, + apr_int32_wanted, apr_pool_t *cont) { - return apr_stat(finfo, fname, cont); + return apr_stat(finfo, fname, wanted, cont); } diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index 948f423f63c..fa1d6792b8d 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -109,7 +109,7 @@ apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *of break; case APR_END: - rc = apr_getfileinfo(&finfo, thefile); + rc = apr_getfileinfo(&finfo, APR_FINFO_NORM, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size - *offset); break; diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 60304c2ec23..50496c4250a 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -60,22 +60,7 @@ APR_DECLARE(apr_status_t) apr_get_filename(const char **fname, apr_file_t *thefile) { -#ifdef WIN32 /* this test is only good until some other platform trys wchar* */ -#if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(thefile->cntxt, &os_level) && os_level >= APR_WIN_NT) - { - *fname = unicode_to_utf8_path(thefile->w.fname, thefile->cntxt); - if (!*fname) - return APR_ENAMETOOLONG; - } - else -#endif /* !APR_HAS_UNICODE_FS */ - *fname = thefile->n.fname; - -#else /* !def Win32 */ *fname = thefile->fname; -#endif return APR_SUCCESS; } diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 96f8b68c83d..4731f78f539 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -55,6 +55,7 @@ #include "fileio.h" #include "apr_file_io.h" #include "apr_general.h" +#include "apr_strings.h" #include "apr_errno.h" static apr_filetype_e filetype_from_mode(int mode) @@ -80,11 +81,14 @@ static apr_filetype_e filetype_from_mode(int mode) return type; } -apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) +apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, + apr_file_t *thefile) { struct stat info; if (fstat(thefile->filedes, &info) == 0) { + finfo->cntxt = thefile->cntxt; + finfo->valid = APR_FINFO_MIN| APR_FINFO_IDENT | APR_FINFO_OWNER | APR_FINFO_PROT; finfo->protection = apr_unix_mode2perms(info.st_mode); finfo->filetype = filetype_from_mode(info.st_mode); finfo->user = info.st_uid; @@ -92,9 +96,18 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) finfo->size = info.st_size; finfo->inode = info.st_ino; finfo->device = info.st_dev; + finfo->nlinks = info.st_nlink; apr_ansi_time_to_apr_time(&finfo->atime, info.st_atime); apr_ansi_time_to_apr_time(&finfo->mtime, info.st_mtime); apr_ansi_time_to_apr_time(&finfo->ctime, info.st_ctime); + finfo->filepath = thefile->fname; + if (wanted & APR_FINFO_CSIZE) { + finfo->csize = info.st_blocks * 512; + finfo->valid |= APR_FINFO_CSIZE; + } + if (finfo->filetype = APR_LNK) + finfo->valid |= APR_FINFO_LINK + } return APR_SUCCESS; } else { @@ -111,11 +124,20 @@ apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) return APR_SUCCESS; } -apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) +apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, + apr_int32_t wanted, apr_pool_t *cont) { struct stat info; + int srv; - if (stat(fname, &info) == 0) { + if (wanted & APR_FINFO_LINK) + srv = lstat(fname, &info); + else + srv = stat(fname,info); + + if (srv == 0) { + finfo->cntxt = cont; + finfo->valid = APR_FINFO_MIN| APR_FINFO_IDENT | APR_FINFO_OWNER | APR_FINFO_PROT; finfo->protection = apr_unix_mode2perms(info.st_mode); finfo->filetype = filetype_from_mode(info.st_mode); finfo->user = info.st_uid; @@ -123,9 +145,18 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) finfo->size = info.st_size; finfo->inode = info.st_ino; finfo->device = info.st_dev; + finfo->nlinks = info.st_nlink; apr_ansi_time_to_apr_time(&finfo->atime, info.st_atime); apr_ansi_time_to_apr_time(&finfo->mtime, info.st_mtime); apr_ansi_time_to_apr_time(&finfo->ctime, info.st_ctime); + finfo->filepath = fname; + if (wanted & APR_FINFO_CSIZE) { + finfo->csize = info.st_blocks * 512; + finfo->valid |= APR_FINFO_CSIZE; + } + if (finfo->filetype = APR_LNK) + finfo->valid |= APR_FINFO_LINK + } return APR_SUCCESS; } else { @@ -163,24 +194,24 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) } } -apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) +/* Perhaps this becomes nothing but a macro? + */ +apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, + apr_int32_t wanted, apr_pool_t *cont) { - struct stat info; + return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, cont); +} - if (lstat(fname, &info) == 0) { - finfo->protection = apr_unix_mode2perms(info.st_mode); - finfo->filetype = filetype_from_mode(info.st_mode); - finfo->user = info.st_uid; - finfo->group = info.st_gid; - finfo->size = info.st_size; - finfo->inode = info.st_ino; - finfo->device = info.st_dev; - apr_ansi_time_to_apr_time(&finfo->atime, info.st_atime); - apr_ansi_time_to_apr_time(&finfo->mtime, info.st_mtime); - apr_ansi_time_to_apr_time(&finfo->ctime, info.st_ctime); - return APR_SUCCESS; - } - else { - return errno; - } +/* XXX: This is wrong for case-insensitive, case-preserving mount points. + * Unfortuantely, I don't have a clue about tweaking this code for unix, + * other than the basic stratagy of stat, then walk dirread for dev/inode. + */ +APR_DECLARE(apr_status_t) apr_get_filename_case(char **fname, + const char *fspec, + apr_pool_t *cont) +{ + *fname = strrchr(fspec, '/'); + if (!*fname) + *fname = fspec; + return APR_SUCCESS; } diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 3ab2aca93a7..f8928435801 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -104,7 +104,7 @@ apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *of break; case APR_END: - rc = apr_getfileinfo(&finfo, thefile); + rc = apr_getfileinfo(&finfo, APR_FINFO_SIZE, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size - *offset); break; diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 0188f6d87a8..5145bc414c1 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -72,7 +72,7 @@ #include <sys/stat.h> #endif -apr_status_t dir_cleanup(void *thedir) +static apr_status_t dir_cleanup(void *thedir) { apr_dir_t *dir = thedir; if (dir->dirhand != INVALID_HANDLE_VALUE && !FindClose(dir->dirhand)) { @@ -85,88 +85,43 @@ apr_status_t dir_cleanup(void *thedir) APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont) { - /* Note that we won't open a directory that is greater than MAX_PATH, - * including the trailing /* wildcard suffix. If a * won't fit, then - * neither will any other file name within the directory. - * The length not including the trailing '*' is stored as rootlen, to - * skip over all paths which are too long. - */ - int len = strlen(dirname); #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; +#endif + int len = strlen(dirname); + (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); + (*new)->dirname = apr_palloc(cont, len + 3); + memcpy((*new)->dirname, dirname, len); + if (len && (*new)->dirname[len - 1] != '/') { + (*new)->dirname[len++] = '/'; + } + (*new)->dirname[len++] = '*'; + (*new)->dirname[len] = '\0'; + +#if APR_HAS_UNICODE_FS if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { - /* While there is now a generic accessor to convert to Unicode, - * we do something special here to provide a few extra wchars - * for the /* (really \*) suffix - * - * Note that the \\?\ form only works for local drive paths, and - * not for UNC paths. + /* Create a buffer for the longest file name we will ever see */ - int srcremains = len; - int dirremains = len; - apr_wchar_t *wch; - (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); (*new)->w.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); - if (dirname[1] == ':' && dirname[2] == '/') { - (*new)->w.dirname = apr_palloc(cont, (dirremains + 7) * 2); - wcscpy((*new)->w.dirname, L"\\\\?\\"); - wch = (*new)->w.dirname + 4; - } - else if (dirname[0] == '/' && dirname[1] == '/') { - /* Skip the leading slashes */ - dirname += 2; - srcremains = dirremains = (len -= 2); - (*new)->w.dirname = apr_palloc(cont, (dirremains + 11) * 2); - wcscpy ((*new)->w.dirname, L"\\\\?\\UNC\\"); - wch = (*new)->w.dirname + 8; - } - else - wch = (*new)->w.dirname = apr_palloc(cont, (dirremains + 3) * 2); - - if (conv_utf8_to_ucs2(dirname, &srcremains, - wch, &dirremains) || srcremains) { - (*new) = NULL; - return APR_ENAMETOOLONG; - } - len -= dirremains; - if (len && wch[len - 1] != '/') { - wch[len++] = L'/'; - } - wch[len++] = L'*'; - wch[len] = L'\0'; - if (wch != (*new)->w.dirname) - { - if (len >= MAX_PATH ) { - (*new) = NULL; - return APR_ENAMETOOLONG; - } - (*new)->rootlen = len - 1; - } - else /* we don't care, since the path isn't limited in length */ - (*new)->rootlen = 0; - for (; *wch; ++wch) - if (*wch == L'/') - *wch = L'\\'; + (*new)->name = apr_pcalloc(cont, MAX_PATH * 3 + 1); } else #endif { - (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); - (*new)->n.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATA)); - (*new)->n.dirname = apr_palloc(cont, len + 3); - memcpy((*new)->n.dirname, dirname, len); - if (len && (*new)->n.dirname[len - 1] != '/') { - (*new)->n.dirname[len++] = '/'; - } - (*new)->n.dirname[len++] = '*'; - (*new)->n.dirname[len] = '\0'; - (*new)->rootlen = len - 1; - if (len >= MAX_PATH ){ + /* Note that we won't open a directory that is greater than MAX_PATH, + * including the trailing /* wildcard suffix. If a * won't fit, then + * neither will any other file name within the directory. + * The length not including the trailing '*' is stored as rootlen, to + * skip over all paths which are too long. + */ + if (len >= MAX_PATH) { (*new) = NULL; return APR_ENAMETOOLONG; } + (*new)->n.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); } + (*new)->rootlen = len - 1; (*new)->cntxt = cont; (*new)->dirhand = INVALID_HANDLE_VALUE; apr_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, @@ -192,8 +147,16 @@ APR_DECLARE(apr_status_t) apr_readdir(apr_dir_t *thedir) apr_oslevel_e os_level; if (!apr_get_oslevel(thedir->cntxt, &os_level) && os_level >= APR_WIN_NT) { - if (thedir->dirhand == INVALID_HANDLE_VALUE) { - thedir->dirhand = FindFirstFileW(thedir->w.dirname, thedir->w.entry); + if (thedir->dirhand == INVALID_HANDLE_VALUE) + { + apr_wchar_t wdirname[8192]; + apr_status_t rv; + if (rv = utf8_to_unicode_path(wdirname, sizeof(wdirname) + / sizeof(apr_wchar_t), + thedir->dirname)) { + return rv; + } + thedir->dirhand = FindFirstFileW(wdirname, thedir->w.entry); if (thedir->dirhand == INVALID_HANDLE_VALUE) { return apr_get_os_error(); } @@ -213,7 +176,8 @@ APR_DECLARE(apr_status_t) apr_readdir(apr_dir_t *thedir) #endif { if (thedir->dirhand == INVALID_HANDLE_VALUE) { - thedir->dirhand = FindFirstFile(thedir->n.dirname, thedir->n.entry); + thedir->dirhand = FindFirstFileA(thedir->dirname, + thedir->n.entry); if (thedir->dirhand == INVALID_HANDLE_VALUE) { return apr_get_os_error(); } @@ -249,9 +213,12 @@ APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm, apr_oslevel_e os_level; if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { - apr_wchar_t *wpath = utf8_to_unicode_path(path, cont); - if (!wpath) - return APR_ENAMETOOLONG; + apr_wchar_t wpath[8192]; + apr_status_t rv; + if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) + / sizeof(apr_wchar_t), path)) { + return rv; + } if (!CreateDirectoryW(wpath, NULL)) { return apr_get_os_error(); } @@ -270,9 +237,12 @@ APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont) apr_oslevel_e os_level; if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { - apr_wchar_t *wpath = utf8_to_unicode_path(path, cont); - if (!wpath) - return APR_ENAMETOOLONG; + apr_wchar_t wpath[8192]; + apr_status_t rv; + if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) + / sizeof(apr_wchar_t), path)) { + return rv; + } if (!RemoveDirectoryW(wpath)) { return apr_get_os_error(); } @@ -332,10 +302,11 @@ APR_DECLARE(apr_status_t) apr_get_dir_filename(const char **new, apr_oslevel_e os_level; if (!apr_get_oslevel(thedir->cntxt, &os_level) && os_level >= APR_WIN_NT) { - (*new) = unicode_to_utf8_path(thedir->w.entry->cFileName, - thedir->cntxt); - if (!*new) - return APR_ENAMETOOLONG; + apr_status_t rv; + if (rv = unicode_to_utf8_path(thedir->name, MAX_PATH * 3 + 1, + thedir->w.entry->cFileName)) + return rv; + (*new) = thedir->name; } else #endif diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 630300815fa..495b5854834 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -63,7 +63,6 @@ APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file, { BOOLEAN isStdHandle = FALSE; HANDLE hCurrentProcess = GetCurrentProcess(); - apr_oslevel_e os_level; if ((*new_file) == NULL) { if (p == NULL) { @@ -105,29 +104,8 @@ APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file, } (*new_file)->cntxt = old_file->cntxt; -#if APR_HAS_UNICODE_FS - if (!apr_get_oslevel(old_file->cntxt, &os_level) && os_level >= APR_WIN_NT) - { - int len = wcslen(old_file->w.fname) + 1; - (*new_file)->w.fname = apr_palloc(old_file->cntxt, len * 2); - memcpy((*new_file)->w.fname, old_file->w.fname, len * 2); - } - else -#endif - (*new_file)->n.fname = apr_pstrdup(old_file->cntxt, old_file->n.fname); - -/* (*new_file)->demonfname = apr_pstrdup(old_file->cntxt, old_file->demonfname); - * (*new_file)->lowerdemonfname = apr_pstrdup(old_file->cntxt, old_file->lowerdemonfname); - */ + (*new_file)->fname = apr_pstrdup(old_file->cntxt, old_file->fname); (*new_file)->append = old_file->append; -/* (*new_file)->protection = old_file->protection; - * (*new_file)->user = old_file->user; - * (*new_file)->group = old_file->group; - */ - (*new_file)->size = old_file->size; - (*new_file)->atime = old_file->atime; - (*new_file)->mtime = old_file->mtime; - (*new_file)->ctime = old_file->ctime; (*new_file)->buffered = FALSE; if (!isStdHandle) { diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 859ed0d382d..28e5cecd457 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -56,6 +56,7 @@ #include "win32/fileio.h" #include "apr_file_io.h" #include "apr_general.h" +#include "apr_strings.h" #include "apr_errno.h" #include "apr_time.h" #include <sys/stat.h> @@ -74,32 +75,8 @@ #define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000 #endif -BOOLEAN is_exe(const char* fname, apr_pool_t *cont) { - /* - * Sleeping code, see notes under apr_stat() - */ - const char* exename; - const char* ext; - exename = strrchr(fname, '/'); - if (!exename) { - exename = strrchr(fname, '\\'); - } - if (!exename) { - exename = fname; - } - else { - exename++; - } - ext = strrchr(exename, '.'); - if (ext && (!strcasecmp(ext,".exe") || !strcasecmp(ext,".com") || - !strcasecmp(ext,".bat") || !strcasecmp(ext,".cmd"))) { - return TRUE; - } - return FALSE; -} - -APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, +APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) { BY_HANDLE_FILE_INFORMATION FileInformation; @@ -199,7 +176,7 @@ APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname, } APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, - apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *cont) { apr_oslevel_e os_level; /* @@ -211,7 +188,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, */ if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { - apr_file_t thefile; + apr_file_t *thefile = NULL; apr_status_t rv; /* * NT5 (W2K) only supports symlinks in the same manner as mount points. @@ -221,22 +198,38 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * We must open the file with READ_CONTROL if we plan to retrieve the * user, group or permissions. */ - thefile.cntxt = cont; - thefile.w.fname = utf8_to_unicode_path(fname, cont); - if (!thefile.w.fname) - return APR_ENAMETOOLONG; - thefile.filehand = CreateFileW(thefile.w.fname, - 0 /* READ_CONTROL */, - FILE_SHARE_READ | FILE_SHARE_WRITE - | FILE_SHARE_DELETE, NULL, - OPEN_EXISTING, - FILE_FLAG_BACKUP_SEMANTICS - | FILE_FLAG_OPEN_NO_RECALL, NULL); - if (thefile.filehand == INVALID_HANDLE_VALUE) - return apr_get_os_error(); - rv = apr_getfileinfo(finfo, &thefile); - CloseHandle(thefile.filehand); - return rv; + + if (rv = apr_open(&thefile, fname, + ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0) + | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) + ? APR_READCONTROL : 0), APR_OS_DEFAULT, cont)) + { + /* We have a backup plan. Perhaps we couldn't grab READ_CONTROL? + * proceed with the alternate... + */ + if (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) { + rv = apr_open(&thefile, fname, + ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0), + APR_OS_DEFAULT, cont); + wanted &= ~(APR_FINFO_PROT | APR_FINFO_OWNER); + } + if (rv) + return rv; + } + + /* + * NT5 (W2K) only supports symlinks in the same manner as mount points. + * This code should eventually take that into account, for now treat + * every reparse point as a symlink... + * + * We must open the file with READ_CONTROL if we plan to retrieve the + * user, group or permissions. + */ + rv = apr_getfileinfo(finfo, wanted, thefile); + finfo->cntxt = thefile->cntxt; + finfo->fname = thefile->fname; + finfo->filehand = thefile; + return (rv); } else { @@ -298,7 +291,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; } - /* Is this an executable? Guess based on the file extension. + /* Is this an executable? Guess based on the file extension? * This is a rather silly test, IMHO... we are looking to test * if the user 'may' execute a file (permissions), * not if the filetype is executable. @@ -308,10 +301,6 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * types (invoking without an extension.) Perhaps a registry * key test is even appropriate here. */ - /* if (is_exe(fname, cont)) { - * finfo->protection |= S_IEXEC; - * } - */ /* File times */ FileTimeToAprTime(&finfo->atime, &FileInformation.ftLastAccessTime); @@ -328,44 +317,27 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, } APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *cont) { + return apr_stat(finfo, fname, wanted & APR_FINFO_LINK, cont); +} + +#if 0 apr_oslevel_e os_level; - if (apr_get_oslevel(cont, &os_level) || os_level < APR_WIN_2000) - { - /* Windows 9x doesn't support links whatsoever, and NT 4.0 - * only supports hard links. Just fall through - */ - return apr_stat(finfo, fname, cont); - } - else + if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { - apr_file_t thefile; - apr_status_t rv; - /* - * NT5 (W2K) only supports symlinks in the same manner as mount points. - * This code should eventually take that into account, for now treat - * every reparse point as a symlink... - * - * We must open the file with READ_CONTROL if we plan to retrieve the - * user, group or permissions. - */ - thefile.cntxt = cont; - thefile.w.fname = utf8_to_unicode_path(fname, cont); - if (!thefile.w.fname) + WIN32_FIND_DATAW FileInformation; + HANDLE hFind; + apr_wchar_t *wname; + if (strchr(fspec, '*') || strchr(fspec, '?')) + return APR_ENOENT; + wname = utf8_to_unicode_path(fspec, cont); + if (!wname) return APR_ENAMETOOLONG; - thefile.filehand = CreateFileW(thefile.w.fname, - 0 /* READ_CONTROL */, - FILE_SHARE_READ | FILE_SHARE_WRITE - | FILE_SHARE_DELETE, NULL, - OPEN_EXISTING, - FILE_FLAG_OPEN_REPARSE_POINT - | FILE_FLAG_BACKUP_SEMANTICS - | FILE_FLAG_OPEN_NO_RECALL, NULL); - if (thefile.filehand == INVALID_HANDLE_VALUE) + hFind = FindFirstFileW(wname, &FileInformation); + if (hFind == INVALID_HANDLE_VALUE) return apr_get_os_error(); - rv = apr_getfileinfo(finfo, &thefile); - CloseHandle(thefile.filehand); - return rv; - } -} + else + FindClose(hFind); + *fname = unicode_to_utf8_path(FileInformation.cFileName, cont); +#endif \ No newline at end of file diff --git a/file_io/win32/open.c b/file_io/win32/open.c index e5fd64c37ae..abbb711185b 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -65,7 +65,8 @@ #include "misc.h" #if APR_HAS_UNICODE_FS -apr_wchar_t *utf8_to_unicode_path(const char* srcstr, apr_pool_t *p) +apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, + const char* srcstr) { /* TODO: The computations could preconvert the string to determine * the true size of the retstr, but that's a memory over speed @@ -81,84 +82,84 @@ apr_wchar_t *utf8_to_unicode_path(const char* srcstr, apr_pool_t *p) */ int srcremains = strlen(srcstr) + 1; int retremains = srcremains; - apr_wchar_t *retstr, *t; + apr_wchar_t *t = retstr; + apr_status_t rv; if (srcstr[1] == ':' && srcstr[2] == '/') { - retstr = apr_palloc(p, (retremains + 4) * 2); wcscpy (retstr, L"\\\\?\\"); - t = retstr + 4; + retlen -= 4; + t += 4; } else if (srcstr[0] == '/' && srcstr[1] == '/') { /* Skip the slashes */ srcstr += 2; - retremains = (srcremains -= 2); - retstr = apr_palloc(p, (retremains + 8) * 2); wcscpy (retstr, L"\\\\?\\UNC\\"); - t = retstr + 8; + retlen -= 8; + t += 8; + } + + if (rv = conv_utf8_to_ucs2(srcstr, &srcremains, t, &retremains)) { + return rv; + } + if (srcremains) { + return APR_ENAMETOOLONG; } - else - t = retstr = apr_palloc(p, retremains * 2); - if (conv_utf8_to_ucs2(srcstr, &srcremains, - t, &retremains) || srcremains) - return NULL; for (; *t; ++t) if (*t == L'/') *t = L'\\'; - return retstr; + return APR_SUCCESS; } -char *unicode_to_utf8_path(const apr_wchar_t* srcstr, apr_pool_t *p) +apr_status_t unicode_to_utf8_path(char* retstr, apr_size_t retlen, + const apr_wchar_t* srcstr) { - /* TODO: The computations could preconvert the string to determine - * the true size of the retstr, but that's a memory over speed - * tradeoff that isn't appropriate this early in development. - * - * Skip the leading 4 characters if the path begins \\?\, or substitute + /* Skip the leading 4 characters if the path begins \\?\, or substitute * // for the \\?\UNC\ path prefix, allocating the maximum string * length based on the remaining string, plus the trailing null. * then transform \\'s back into /'s since the \\?\ form never * allows '/' path seperators, and APR always uses '/'s. */ int srcremains = wcslen(srcstr) + 1; - int retremains = (srcremains - 1) * 3 + 1; - char *t, *retstr; + apr_status_t rv; + char *t = retstr; if (srcstr[0] == L'\\' && srcstr[1] == L'\\' && srcstr[2] == L'?' && srcstr[3] == L'\\') { if (srcstr[4] == L'U' && srcstr[5] == L'N' && srcstr[6] == L'C' && srcstr[7] == L'\\') { srcremains -= 8; - retremains -= 24; srcstr += 8; - retstr = apr_palloc(p, retremains + 2); strcpy(retstr, "//"); - t = retstr + 2; + retlen -= 2; + t += 2; } else { srcremains -= 4; - retremains -= 12; srcstr += 4; - t = retstr = apr_palloc(p, retremains); } } - else - t = retstr = apr_palloc(p, retremains); - if (conv_ucs2_to_utf8(srcstr, &srcremains, - t, &retremains) || srcremains) - return NULL; + if (rv = conv_ucs2_to_utf8(srcstr, &srcremains, t, &retlen)) { + return rv; + } + if (srcremains) { + return APR_ENAMETOOLONG; + } for (; *t; ++t) if (*t == L'/') *t = L'\\'; - return retstr; + return APR_SUCCESS; } #endif apr_status_t file_cleanup(void *thefile) { apr_file_t *file = thefile; - CloseHandle(file->filehand); - file->filehand = INVALID_HANDLE_VALUE; + if (file->filehand != INVALID_HANDLE_VALUE) { + CloseHandle(file->filehand); + file->filehand = INVALID_HANDLE_VALUE; + } if (file->pOverlapped) { CloseHandle(file->pOverlapped->hEvent); + file->pOverlapped = NULL; } return APR_SUCCESS; } @@ -167,54 +168,30 @@ APR_DECLARE(apr_status_t) apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) { + /* XXX: The default FILE_FLAG_SEQUENTIAL_SCAN is _wrong_ for + * sdbm and any other random files! We _must_ rethink + * this approach. + */ + HANDLE handle = INVALID_HANDLE_VALUE; DWORD oflags = 0; DWORD createflags = 0; - DWORD attributes = 0; + DWORD attributes = FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN; DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE; apr_oslevel_e os_level; apr_status_t rv; - (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); - (*new)->cntxt = cont; - if (flag & APR_READ) { oflags |= GENERIC_READ; } if (flag & APR_WRITE) { oflags |= GENERIC_WRITE; } - if (!(flag & APR_READ) && !(flag & APR_WRITE)) { - (*new)->filehand = INVALID_HANDLE_VALUE; - return APR_EACCES; - } - - (*new)->buffered = (flag & APR_BUFFERED) > 0; - - if ((*new)->buffered) { - (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); - rv = apr_create_lock(&(*new)->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cont); - - if (rv) - return rv; - } - + if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) sharemode |= FILE_SHARE_DELETE; else os_level = 0; -#if APR_HAS_UNICODE_FS - if (os_level >= APR_WIN_NT) - { - (*new)->w.fname = utf8_to_unicode_path(fname, cont); - if (!(*new)->w.fname) - /* XXX: really bad file name */ - return APR_ENAMETOOLONG; - } - else -#endif - (*new)->n.fname = apr_pstrdup(cont, fname); - if (flag & APR_CREATE) { if (flag & APR_EXCL) { /* only create new if file does not already exist */ @@ -235,36 +212,77 @@ APR_DECLARE(apr_status_t) apr_open(apr_file_t **new, const char *fname, } if ((flag & APR_EXCL) && !(flag & APR_CREATE)) { - (*new)->filehand = INVALID_HANDLE_VALUE; return APR_EACCES; } - - if (flag & APR_APPEND) { - (*new)->append = 1; - } - else { - (*new)->append = 0; - } - - attributes = FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN; + if (flag & APR_DELONCLOSE) { attributes |= FILE_FLAG_DELETE_ON_CLOSE; } + if (flag & APR_OPENLINK) { + attributes |= FILE_FLAG_OPEN_REPARSE_POINT; + } + if (!(flag & (APR_READ | APR_WRITE)) && (os_level >= APR_WIN_NT)) { + /* We once failed here, but this is how one opens + * a directory as a file under winnt. Accelerate + * further by not hitting storage, we don't need to. + */ + attributes |= FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_NO_RECALL; + } + if (flag & APR_XTHREAD) { + /* This win32 specific feature is required + * to allow multiple threads to work with the file. + */ + attributes |= FILE_FLAG_OVERLAPPED; + } #if APR_HAS_UNICODE_FS - if (os_level >= APR_WIN_NT) - (*new)->filehand = CreateFileW((*new)->w.fname, oflags, sharemode, - NULL, createflags, attributes, 0); + if (os_level >= APR_WIN_NT) { + apr_wchar_t wfname[8192]; + if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) + / sizeof(apr_wchar_t), fname)) + return rv; + handle = CreateFileW(wfname, oflags, sharemode, + NULL, createflags, attributes, 0); + } else #endif - (*new)->filehand = CreateFile((*new)->n.fname, oflags, sharemode, - NULL, createflags, attributes, 0); - if ((*new)->filehand == INVALID_HANDLE_VALUE) { + handle = CreateFileA((*new)->fname, oflags, sharemode, + NULL, createflags, attributes, 0); + + if (handle == INVALID_HANDLE_VALUE) { return apr_get_os_error(); } + + (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); + (*new)->cntxt = cont; + (*new)->filehand = handle; + (*new)->fname = apr_pstrdup(cont, fname); + if (flag & APR_APPEND) { + (*new)->append = 1; SetFilePointer((*new)->filehand, 0, NULL, FILE_END); } + else { + (*new)->append = 0; + } + + if (flag & APR_BUFFERED) { + (*new)->buffered = 1; + (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); + rv = apr_create_lock(&(*new)->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cont); + + if (rv) { + if (file_cleanup(*new) == APR_SUCCESS) { + apr_kill_cleanup(cont, *new, file_cleanup); + } + return rv; + } + } + else { + (*new)->buffered = 0; + (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); + (*new)->mutex = NULL; + } (*new)->pipe = 0; (*new)->timeout = -1; @@ -302,9 +320,12 @@ APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont) apr_oslevel_e os_level; if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { - apr_wchar_t *wpath = utf8_to_unicode_path(path, cont); - if (!wpath) - return APR_ENAMETOOLONG; + apr_wchar_t wpath[8192]; + apr_status_t rv; + if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) + / sizeof(apr_wchar_t), path)) { + return rv; + } if (DeleteFileW(wpath)) return APR_SUCCESS; } @@ -315,26 +336,32 @@ APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont) return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_rename_file(const char *from_path, - const char *to_path, +APR_DECLARE(apr_status_t) apr_rename_file(const char *frompath, + const char *topath, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { - apr_wchar_t *wfrompath = utf8_to_unicode_path(from_path, cont); - apr_wchar_t *wtopath = utf8_to_unicode_path(to_path, cont); - if (!wfrompath || !wtopath) - return APR_ENAMETOOLONG; + apr_wchar_t wfrompath[8192], wtopath[8192]; + apr_status_t rv; + if (rv = utf8_to_unicode_path(wfrompath, sizeof(wfrompath) + / sizeof(apr_wchar_t), frompath)) { + return rv; + } + if (rv = utf8_to_unicode_path(wtopath, sizeof(wtopath) + / sizeof(apr_wchar_t), topath)) { + return rv; + } if (MoveFileExW(wfrompath, wtopath, MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED)) return APR_SUCCESS; } else #endif - if (MoveFileEx(from_path, to_path, MOVEFILE_REPLACE_EXISTING | - MOVEFILE_COPY_ALLOWED)) + if (MoveFileEx(frompath, topath, MOVEFILE_REPLACE_EXISTING | + MOVEFILE_COPY_ALLOWED)) return APR_SUCCESS; return apr_get_os_error(); } @@ -383,7 +410,7 @@ APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont if ((*thefile)->filehand == INVALID_HANDLE_VALUE) return apr_get_os_error(); (*thefile)->cntxt = cont; - (*thefile)->n.fname = "\0\0"; // What was this??? : "STD_ERROR_HANDLE"; */ + (*thefile)->fname = "\0"; // What was this??? : "STD_ERROR_HANDLE"; */ (*thefile)->eof_hit = 0; return APR_SUCCESS; diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 5226a14442a..40a8c6c3e0e 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -91,7 +91,7 @@ APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, apr (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*in)->cntxt = p; - (*in)->n.fname = "\0\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */ + (*in)->fname = "\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */ (*in)->pipe = 1; (*in)->timeout = -1; (*in)->ungetchar = -1; @@ -103,7 +103,7 @@ APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, apr (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*out)->cntxt = p; - (*in)->n.fname = "\0\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */ + (*in)->fname = "\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */ (*out)->pipe = 1; (*out)->timeout = -1; (*out)->ungetchar = -1; @@ -161,7 +161,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*in)->cntxt = p; - (*in)->n.fname = "\0\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */ + (*in)->fname = "\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */ (*in)->pipe = 1; (*in)->timeout = -1; (*in)->ungetchar = -1; @@ -174,7 +174,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*out)->cntxt = p; - (*in)->n.fname = "\0\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */ + (*in)->fname = "\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */ (*out)->pipe = 1; (*out)->timeout = -1; (*out)->ungetchar = -1; diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index adaede8d861..1e102739c06 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -105,8 +105,8 @@ APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile, apr_seek_where_t where, break; case APR_END: - rc = apr_getfileinfo(&finfo, thefile); - if (rc == APR_SUCCESS) + rc = apr_getfileinfo(&finfo, APR_FINFO_SIZE, thefile); + if (rc == APR_SUCCESS && (finfo.valid & APR_FINFO_SIZE)) rc = setptr(thefile, finfo.size - *offset); break; } diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index f8f9d0f35ae..b3c2d40d05b 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -113,26 +113,10 @@ #define APR_FILE_BUFSIZE 4096 -typedef struct apr_canon_elem_t { -/* A possible comparison mechanism to play with once we start - * implementing case insensitive mount poinbt semantices - * int dev; - * int inode; - * apr_time_t cached; --for timeout? - */ - int pathlen; - char *element; -} apr_canon_elem_t; - -struct apr_canon_t { - apr_pool_t *cntxt; - apr_array_header_t *elems; -}; - struct apr_file_t { apr_pool_t *cntxt; int filedes; - char * fname; + char *fname; int oflags; int eof_hit; int pipe; diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 3fb7bd0cc70..c85df35ec83 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -87,6 +87,18 @@ #include <sys/uio.h> #endif +#if APR_HAS_UNICODE_FS +#include "i18n.h" +#include <wchar.h> + +typedef apr_int16_t apr_wchar_t; + +apr_status_t utf8_to_unicode_path(apr_wchar_t* dststr, apr_size_t dstchars, + const char* srcstr); +apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, + const apr_wchar_t* srcstr); +#endif + #define APR_FILE_BUFSIZE 4096 /* obscure ommissions from msvc's sys/stat.h */ @@ -98,59 +110,17 @@ #define S_IFWHT 0160000 /* Whiteout */ #endif -#if APR_HAS_UNICODE_FS -#include "i18n.h" -#include <wchar.h> - -typedef apr_int16_t apr_wchar_t; - -apr_wchar_t *utf8_to_unicode_path(const char* srcstr, apr_pool_t *p); -char *unicode_to_utf8_path(const apr_wchar_t* srcstr, apr_pool_t *p); -#endif +/* Internal Flags for apr_open */ +#define APR_OPENLINK 8192 /* Open a link itself, if supported */ +#define APR_READCONTROL 4096 /* Read the file's owner/perms */ +#define APR_WRITECONTROL 2048 /* Modifythe file's owner/perms */ -typedef enum apr_canon_case_e { - APR_CANON_CASE_GIVEN, - APR_CANON_CASE_LOWER, - APR_CANON_CASE_TRUE -} apr_canon_case_e; - -typedef enum apr_canon_path_e { - APR_CANON_PATH_VIRUTAL, - APR_CANON_PATH_ABSOLUTE, - APR_CANON_PATH_RELATIVE -} apr_canon_path_e; - -/* - * Internal canonical filename elements for the apr_canon_t elems - * ccase tracks the mechanism used to resolve this element - * pathlen is the full path length to the end of this element - * name slash is prefix, as appropriate - - */ -typedef struct apr_canon_elem_t { - apr_canon_case_e ccase; - int pathlen; - char *name; -} apr_canon_elem_t; -/* warning: win32 canonical path "/" resolves to a - * zero'th element of the empty string for testing the - * psudo-root for the system - */ -struct apr_canon_t { - apr_pool_t *cntxt; - apr_array_header_t *elems; - apr_canon_path_e type; -}; /* quick run-down of fields in windows' apr_file_t structure that may have * obvious uses. * fname -- the filename as passed to the open call. * dwFileAttricutes -- Attributes used to open the file. - * demonfname -- the canonicalized filename. Used to store the result from - * apr_os_canonicalize_filename. - * lowerdemonfname -- inserted at Ken Parzygnat's request, because of the - * ugly way windows deals with case in the filesystem. * append -- Windows doesn't support the append concept when opening files. * APR needs to keep track of this, and always make sure we append * correctly when writing to a file with this flag set TRUE. @@ -164,25 +134,13 @@ struct apr_file_t { apr_interval_time_t timeout; /* File specific info */ - union { -#if APR_HAS_UNICODE_FS - struct { - apr_wchar_t *fname; - } w; -#endif - struct { - char *fname; - } n; - }; + apr_finfo_t *finfo; + char *fname; DWORD dwFileAttributes; int eof_hit; BOOLEAN buffered; // Use buffered I/O? int ungetchar; // Last char provided by an unget op. (-1 = no char) int append; - off_t size; - apr_time_t atime; - apr_time_t mtime; - apr_time_t ctime; /* Stuff for buffered mode */ char *buffer; @@ -192,24 +150,23 @@ struct apr_file_t { apr_ssize_t filePtr; // position in file of handle apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields - /* Pipe specific info */ - + /* Pipe specific info */ }; struct apr_dir_t { apr_pool_t *cntxt; HANDLE dirhand; apr_size_t rootlen; + char *dirname; + char *name; union { #if APR_HAS_UNICODE_FS struct { - apr_wchar_t *dirname; WIN32_FIND_DATAW *entry; } w; #endif struct { - char *dirname; - WIN32_FIND_DATA *entry; + WIN32_FIND_DATAA *entry; } n; }; }; @@ -224,4 +181,3 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, apr_pool_t *p); #endif /* ! FILE_IO_H */ - diff --git a/test/testmmap.c b/test/testmmap.c index c1f9a85c9a3..53e5a43d153 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -115,7 +115,7 @@ int main(void) } fprintf(stderr, "Getting file size..................."); - rv = apr_getfileinfo(&finfo, thefile); + rv = apr_getfileinfo(&finfo, APR_FINFO_NORM, thefile); if (rv != APR_SUCCESS) { fprintf(stderr, "Didn't get file information: %d/%s\n", From e6e86058aa1eda94eae07173424adffee2bf7330 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 20 Jan 2001 21:58:03 +0000 Subject: [PATCH 1106/7878] Fix a simple compile break. apr_file_t was being declared in two files, and we don't actually have the typedef in apr_file_info.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61087 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 21b16236c12..d7394138731 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -160,8 +160,6 @@ typedef struct apr_finfo_t apr_finfo_t; #define APR_FINFO_PROT 0x00700000 /* all protections */ #define APR_FINFO_NORM 0x0073b170 /* the expected unix results */ -typedef struct apr_file_t apr_file_t; - /** * The file information structure. This is analogous to the POSIX * stat structure. @@ -203,7 +201,7 @@ struct apr_finfo_t { /** The file's name alone, in filesystem case */ char *fcase; /** The file's handle, if accessed (can be submitted to apr_duphandle) */ - apr_file_t *filehand; + struct apr_file_t *filehand; }; /** From 812eccac5ce82d4ef60f260f36f46429d09d2348 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 20 Jan 2001 22:18:55 +0000 Subject: [PATCH 1107/7878] Get APR building on Unix again. This just updates APR for the new apr_stat API. Bill, could you please document get_filename_case? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61088 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 26 ++++++++++++++++---------- include/apr_file_info.h | 2 +- include/apr_file_io.h | 4 ++++ 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 4731f78f539..cbcba106e20 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -96,17 +96,20 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, finfo->size = info.st_size; finfo->inode = info.st_ino; finfo->device = info.st_dev; - finfo->nlinks = info.st_nlink; + +/* We don't have nlinks in the finfo structure. Are we going to add it? RBB*/ +/* finfo->nlinks = info.st_nlink; */ + apr_ansi_time_to_apr_time(&finfo->atime, info.st_atime); apr_ansi_time_to_apr_time(&finfo->mtime, info.st_mtime); apr_ansi_time_to_apr_time(&finfo->ctime, info.st_ctime); - finfo->filepath = thefile->fname; + finfo->fname = thefile->fname; if (wanted & APR_FINFO_CSIZE) { finfo->csize = info.st_blocks * 512; finfo->valid |= APR_FINFO_CSIZE; } - if (finfo->filetype = APR_LNK) - finfo->valid |= APR_FINFO_LINK + if (finfo->filetype == APR_LNK) { + finfo->valid |= APR_FINFO_LINK; } return APR_SUCCESS; } @@ -133,7 +136,7 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, if (wanted & APR_FINFO_LINK) srv = lstat(fname, &info); else - srv = stat(fname,info); + srv = stat(fname, &info); if (srv == 0) { finfo->cntxt = cont; @@ -145,17 +148,20 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, finfo->size = info.st_size; finfo->inode = info.st_ino; finfo->device = info.st_dev; - finfo->nlinks = info.st_nlink; + +/* We don't have nlinks in the finfo structure. Are we going to add it? RBB*/ +/* finfo->nlinks = info.st_nlink; */ + apr_ansi_time_to_apr_time(&finfo->atime, info.st_atime); apr_ansi_time_to_apr_time(&finfo->mtime, info.st_mtime); apr_ansi_time_to_apr_time(&finfo->ctime, info.st_ctime); - finfo->filepath = fname; + finfo->fname = fname; if (wanted & APR_FINFO_CSIZE) { finfo->csize = info.st_blocks * 512; finfo->valid |= APR_FINFO_CSIZE; } - if (finfo->filetype = APR_LNK) - finfo->valid |= APR_FINFO_LINK + if (finfo->filetype == APR_LNK) { + finfo->valid |= APR_FINFO_LINK; } return APR_SUCCESS; } @@ -206,7 +212,7 @@ apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, * Unfortuantely, I don't have a clue about tweaking this code for unix, * other than the basic stratagy of stat, then walk dirread for dev/inode. */ -APR_DECLARE(apr_status_t) apr_get_filename_case(char **fname, +APR_DECLARE(apr_status_t) apr_get_filename_case(const char **fname, const char *fspec, apr_pool_t *cont) { diff --git a/include/apr_file_info.h b/include/apr_file_info.h index d7394138731..baa11e731ce 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -197,7 +197,7 @@ struct apr_finfo_t { /** The time the file was last changed */ apr_time_t ctime; /** The full pathname of the file */ - char *fname; + const char *fname; /** The file's name alone, in filesystem case */ char *fcase; /** The file's handle, if accessed (can be submitted to apr_duphandle) */ diff --git a/include/apr_file_io.h b/include/apr_file_io.h index d6aef2ef5df..4202bc54962 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -527,6 +527,10 @@ APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_get_filename_case(const char **fname, + const char *fspec, + apr_pool_t *cont); + #ifdef __cplusplus } #endif From cf19181ad001fa0cd2c3f141d2be7f59f860932b Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Sun, 21 Jan 2001 15:11:40 +0000 Subject: [PATCH 1108/7878] Fix a couple of typos in wrowe's last commit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61089 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filestat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index f789aa62fe3..280716c0f49 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -150,7 +150,7 @@ apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, - apr_int32_wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *cont) { ULONG rc; FILESTATUS3 fstatus; @@ -179,7 +179,7 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_int32_wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *cont) { return apr_stat(finfo, fname, wanted, cont); } From 78ae1138a9f62e5c60327ce4814646185f6b2713 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Sun, 21 Jan 2001 16:08:05 +0000 Subject: [PATCH 1109/7878] I'll wait until after the real estate agent calls to look at the weather. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61090 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index cf9818f7e36..d0f3cb70590 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/20 21:38:03 $] +Last modified at [$Date: 2001/01/21 16:08:05 $] Release: @@ -89,6 +89,9 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * toss the per-Makefile setup of INCLUDES; shift to rules.mk.in + * Change the return type of apr_hash_count() to some counter type + (like "int") instead of a size type (apr_size_t). Jeff will + do this Real Soon Now (so he says on 20010121). Documentation that needs writing: From 78afe998a480a973276bc8b85d26aad2e3f8a1a0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 21 Jan 2001 16:27:07 +0000 Subject: [PATCH 1110/7878] Backout apr_get_filename_case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61091 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 13 ------------- include/apr_file_io.h | 4 ---- 2 files changed, 17 deletions(-) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index cbcba106e20..1c38f698795 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -208,16 +208,3 @@ apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, cont); } -/* XXX: This is wrong for case-insensitive, case-preserving mount points. - * Unfortuantely, I don't have a clue about tweaking this code for unix, - * other than the basic stratagy of stat, then walk dirread for dev/inode. - */ -APR_DECLARE(apr_status_t) apr_get_filename_case(const char **fname, - const char *fspec, - apr_pool_t *cont) -{ - *fname = strrchr(fspec, '/'); - if (!*fname) - *fname = fspec; - return APR_SUCCESS; -} diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 4202bc54962..d6aef2ef5df 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -527,10 +527,6 @@ APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile); -APR_DECLARE(apr_status_t) apr_get_filename_case(const char **fname, - const char *fspec, - apr_pool_t *cont); - #ifdef __cplusplus } #endif From 53142c25886df251f0ce6955f717e74db658a578 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 22 Jan 2001 00:59:26 +0000 Subject: [PATCH 1111/7878] Just combine some common code on Unix. This should make things a bit easier to maintain. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61092 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 77 +++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 46 deletions(-) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 1c38f698795..ffc1fa33c41 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -81,6 +81,35 @@ static apr_filetype_e filetype_from_mode(int mode) return type; } +static apr_status_t fill_out_finfo(apr_finfo_t *finfo, struct stat info, + apr_int32_t wanted) +{ + finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_OWNER | + APR_FINFO_PROT; + finfo->protection = apr_unix_mode2perms(info.st_mode); + finfo->filetype = filetype_from_mode(info.st_mode); + finfo->user = info.st_uid; + finfo->group = info.st_gid; + finfo->size = info.st_size; + finfo->inode = info.st_ino; + finfo->device = info.st_dev; + +/* We don't have nlinks in the finfo structure. Are we going to add it? RBB*/ +/* finfo->nlinks = info.st_nlink; */ + + apr_ansi_time_to_apr_time(&finfo->atime, info.st_atime); + apr_ansi_time_to_apr_time(&finfo->mtime, info.st_mtime); + apr_ansi_time_to_apr_time(&finfo->ctime, info.st_ctime); + if (wanted & APR_FINFO_CSIZE) { + finfo->csize = info.st_blocks * 512; + finfo->valid |= APR_FINFO_CSIZE; + } + if (finfo->filetype == APR_LNK) { + finfo->valid |= APR_FINFO_LINK; + } + return APR_SUCCESS; +} + apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) { @@ -88,30 +117,8 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, if (fstat(thefile->filedes, &info) == 0) { finfo->cntxt = thefile->cntxt; - finfo->valid = APR_FINFO_MIN| APR_FINFO_IDENT | APR_FINFO_OWNER | APR_FINFO_PROT; - finfo->protection = apr_unix_mode2perms(info.st_mode); - finfo->filetype = filetype_from_mode(info.st_mode); - finfo->user = info.st_uid; - finfo->group = info.st_gid; - finfo->size = info.st_size; - finfo->inode = info.st_ino; - finfo->device = info.st_dev; - -/* We don't have nlinks in the finfo structure. Are we going to add it? RBB*/ -/* finfo->nlinks = info.st_nlink; */ - - apr_ansi_time_to_apr_time(&finfo->atime, info.st_atime); - apr_ansi_time_to_apr_time(&finfo->mtime, info.st_mtime); - apr_ansi_time_to_apr_time(&finfo->ctime, info.st_ctime); finfo->fname = thefile->fname; - if (wanted & APR_FINFO_CSIZE) { - finfo->csize = info.st_blocks * 512; - finfo->valid |= APR_FINFO_CSIZE; - } - if (finfo->filetype == APR_LNK) { - finfo->valid |= APR_FINFO_LINK; - } - return APR_SUCCESS; + return fill_out_finfo(finfo, info, wanted); } else { return errno; @@ -140,30 +147,8 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, if (srv == 0) { finfo->cntxt = cont; - finfo->valid = APR_FINFO_MIN| APR_FINFO_IDENT | APR_FINFO_OWNER | APR_FINFO_PROT; - finfo->protection = apr_unix_mode2perms(info.st_mode); - finfo->filetype = filetype_from_mode(info.st_mode); - finfo->user = info.st_uid; - finfo->group = info.st_gid; - finfo->size = info.st_size; - finfo->inode = info.st_ino; - finfo->device = info.st_dev; - -/* We don't have nlinks in the finfo structure. Are we going to add it? RBB*/ -/* finfo->nlinks = info.st_nlink; */ - - apr_ansi_time_to_apr_time(&finfo->atime, info.st_atime); - apr_ansi_time_to_apr_time(&finfo->mtime, info.st_mtime); - apr_ansi_time_to_apr_time(&finfo->ctime, info.st_ctime); finfo->fname = fname; - if (wanted & APR_FINFO_CSIZE) { - finfo->csize = info.st_blocks * 512; - finfo->valid |= APR_FINFO_CSIZE; - } - if (finfo->filetype == APR_LNK) { - finfo->valid |= APR_FINFO_LINK; - } - return APR_SUCCESS; + return fill_out_finfo(finfo, info, wanted); } else { #if !defined(ENOENT) || !defined(ENOTDIR) From 3e16af473e530066c4bd68eb223ccea3f55bcec9 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 22 Jan 2001 02:55:03 +0000 Subject: [PATCH 1112/7878] Fix the stat call in sendfile.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61093 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sendfile.c b/test/sendfile.c index 1d1fbddf39f..5f22fdd22db 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -183,7 +183,7 @@ static void create_testfile(apr_pool_t *p, const char *fname) exit(1); } - rv = apr_stat(&finfo, fname, p); + rv = apr_stat(&finfo, fname, APR_FINFO_NORM, p); if (rv) { fprintf(stderr, "apr_close()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); From efd8a070ee16a1b324413fa18cbebadf6af3e28f Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 22 Jan 2001 03:25:37 +0000 Subject: [PATCH 1113/7878] Make testdso compile again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61094 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index 56d048892ad..b33703c6180 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -41,7 +41,7 @@ testflock@EXEEXT@: testflock.lo ### why the export-dynamic? testdso@EXEEXT@: testdso.lo - $(LINK) --export-dynamic testdso.lo + $(LINK) --export-dynamic testdso.lo $(ALL_LIBS) testoc@EXEEXT@: testoc.lo $(LINK) testoc.lo $(ALL_LIBS) From 7b5596bd49efd2a7db2d4aba3a6937ad007f3430 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Mon, 22 Jan 2001 03:56:00 +0000 Subject: [PATCH 1114/7878] occhild is not a shared object, it's an executable, make it look like one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61095 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index b33703c6180..c9029f1ca98 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -17,7 +17,7 @@ TARGETS = \ testdso@EXEEXT@ \ testoc@EXEEXT@ \ testuuid@EXEEXT@ \ - occhild.so \ + occhild@EXEEXT@ \ mod_test.so # bring in rules.mk for standard functionality @@ -46,7 +46,7 @@ testdso@EXEEXT@: testdso.lo testoc@EXEEXT@: testoc.lo $(LINK) testoc.lo $(ALL_LIBS) -occhild.so: occhild.lo +occhild@EXEEXT@: occhild.lo $(LINK) --module occhild.lo mod_test.so: mod_test.lo From 854e79eb75560179b0b5ce12993384d6a6e3ec32 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 23 Jan 2001 03:55:53 +0000 Subject: [PATCH 1115/7878] occhild is not a module, don't compile it as such. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61096 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index c9029f1ca98..eca16e43909 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -47,7 +47,7 @@ testoc@EXEEXT@: testoc.lo $(LINK) testoc.lo $(ALL_LIBS) occhild@EXEEXT@: occhild.lo - $(LINK) --module occhild.lo + $(LINK) occhild.lo $(ALL_LIBS) mod_test.so: mod_test.lo $(LINK) --module mod_test.lo From b68e14faca33a8b16a5d02ba3e6f7e8e3745ae48 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 23 Jan 2001 04:10:48 +0000 Subject: [PATCH 1116/7878] apr_dir_read now accepts a pointer to the user's apr_finfo_t to gather all known data discovered during the stat (using a wanted value of APR_FINFO_DIRENT), and reports it through the ->valid entry. Specific fields can be requested, and apr_dir_read -will- go out and get them (when possible), but asserting a wanted value other than APR_FINFO_DIRENT will be non-atomic on a subset of our supported platforms. Added APR_FINFO_NLINK and apr_finfo_t .nlink to apr_finfo_t. Changed apr_finfo_t .fcase to simply .name (as opposed to .fname, the full file path name.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61097 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/dir.c | 128 +++++++++++++------------------ file_io/unix/dir.c | 147 +++++++++++------------------------- file_io/unix/filestat.c | 5 +- file_io/win32/dir.c | 109 ++++++++------------------ file_io/win32/filestat.c | 12 --- include/apr_file_info.h | 60 ++++----------- include/arch/os2/fileio.h | 1 + include/arch/unix/fileio.h | 1 + include/arch/win32/fileio.h | 12 +++ test/testfile.c | 28 ++++--- 10 files changed, 173 insertions(+), 330 deletions(-) diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index cedc5f10c1a..c03e2863475 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -64,7 +64,7 @@ static apr_status_t dir_cleanup(void *thedir) { apr_dir_t *dir = thedir; - return apr_closedir(dir); + return apr_dir_close(dir); } @@ -91,7 +91,7 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cntx -apr_status_t apr_closedir(apr_dir_t *thedir) +apr_status_t apr_dir_close(apr_dir_t *thedir) { int rv = 0; @@ -108,7 +108,8 @@ apr_status_t apr_closedir(apr_dir_t *thedir) -apr_status_t apr_readdir(apr_dir_t *thedir) +apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, + apr_dir_t *thedir) { int rv; ULONG entries = 1; @@ -122,24 +123,66 @@ apr_status_t apr_readdir(apr_dir_t *thedir) rv = DosFindNext(thedir->handle, &thedir->entry, sizeof(thedir->entry), &entries); } - if (rv == 0 && entries == 1) { + /* No valid bit flag to test here - do we want one? */ + finfo->cntxt = thedir->cntxt; + finfo->fname = NULL; + + if (rv == 0 && entries == 1) + { + /* XXX: Optimize the heck out of this case - whatever we know, report, + * and then stat only if we must (e.g. wanted & APR_FINFO_TYPE) + */ thedir->validentry = TRUE; + + wanted &= ~(APR_FINFO_NAME | APR_FINFO_MTIME | APR_FINFO_SIZE); + + if (wanted == APR_FINFO_TYPE && thedir->entry.attrFile & FILE_DIRECTORY) + wanted = 0; + + if (wanted) + { + char fspec[_MAXPATH]; + int off; + apr_strcpyn(fspec, sizeof(fspec), thedir->dirname); + off = strlen(fspec); + if (fspec[off - 1] != '/') + fspec[off++] = '/'; + apr_strcpyn(fspec + off, sizeof(fspec) - off, thedir->entry->d_name); + /* ??? Or lstat below?, I know, OS2 doesn't do symlinks, yet */ + ret = apr_stat(finfo, wanted, fspec, thedir->cntxt); + } + if (!wanted || ret) { + finfo->cntxt = thedir->cntxt; + finfo->valid = 0; + } + /* We passed a name off the stack that has popped */ + finfo->fname = NULL; + finfo->valid |= APR_FINFO_NAME | APR_FINFO_MTIME | APR_FINFO_SIZE; + finfo->size = thedir->entry.cbFile; + apr_os2_time_to_apr_time(finfo->mtime, thedir->entry.fdateLastWrite, + thedir->entry.ftimeLastWrite); + finfo->name = thedir->entry.achName; + if (thedir->entry.attrFile & FILE_DIRECTORY) { + finfo->filetype = APR_DIR; + finfo->valid |= APR_FINFO_TYPE; + } + return APR_SUCCESS; } - + thedir->validentry = FALSE; - + if (rv) return APR_OS2_STATUS(rv); - + return APR_ENOENT; } -apr_status_t apr_rewinddir(apr_dir_t *thedir) +apr_status_t apr_dir_rewind(apr_dir_t *thedir) { - return apr_closedir(thedir); + return apr_dir_close(thedir); } @@ -158,72 +201,5 @@ apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) -apr_status_t apr_dir_entry_size(apr_size_t *size, apr_dir_t *thedir) -{ - if (thedir->validentry) { - *size = thedir->entry.cbFile; - return APR_SUCCESS; - } - - return APR_ENOFILE; -} - - - -apr_status_t apr_dir_entry_mtime(apr_time_t *time, apr_dir_t *thedir) -{ - if (thedir->validentry) { - apr_os2_time_to_apr_time(time, thedir->entry.fdateLastWrite, - thedir->entry.ftimeLastWrite); - return APR_SUCCESS; - } - - return APR_ENOFILE; -} - - -apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) -{ - int rc; - HFILE hFile; - ULONG action, Type, Attr; - apr_filetype_e typemap[8] = { APR_REG, APR_CHR, APR_PIPE }; - if (thedir->validentry) { - if (thedir->entry.attrFile & FILE_DIRECTORY) { - *type = APR_DIR; - return APR_SUCCESS; - } else { - rc = DosOpen(apr_pstrcat(thedir->cntxt, thedir->dirname, "/", thedir->entry.achName, NULL) , - &hFile, &action, 0, 0, - OPEN_ACTION_FAIL_IF_NEW|OPEN_ACTION_OPEN_IF_EXISTS, OPEN_SHARE_DENYNONE|OPEN_ACCESS_READONLY, - NULL); - - if ( rc == 0 ) { - rc = DosQueryHType( hFile, &Type, &Attr ); - - if ( rc == 0 ) { - *type = typemap[(Type & 0x0007)]; - } - DosClose( hFile ); - } - - return APR_OS2_STATUS(rc); - } - } - - return APR_ENOFILE; -} - - - -apr_status_t apr_get_dir_filename(const char **new, apr_dir_t *thedir) -{ - if (thedir->validentry) { - *new = thedir->entry.achName; - return APR_SUCCESS; - } - - return APR_ENOFILE; -} diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 6b794523020..fc6ef33b4dc 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -95,7 +95,7 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont } } -apr_status_t apr_closedir(apr_dir_t *thedir) +apr_status_t apr_dir_close(apr_dir_t *thedir) { apr_status_t rv; @@ -106,36 +106,69 @@ apr_status_t apr_closedir(apr_dir_t *thedir) return rv; } -apr_status_t apr_readdir(apr_dir_t *thedir) +apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, + apr_dir_t *thedir) { -#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ - && !defined(READDIR_IS_THREAD_SAFE) apr_status_t ret; -#endif - #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && !defined(READDIR_IS_THREAD_SAFE) + dirent *retent; + + ret = readdir_r(thedir->dirstruct, thedir->entry, &retent); - ret = readdir_r(thedir->dirstruct, thedir->entry, &thedir->entry); /* Avoid the Linux problem where at end-of-directory thedir->entry * is set to NULL, but ret = APR_SUCCESS. */ - return (ret == APR_SUCCESS && thedir->entry == NULL) ? APR_ENOENT : ret; + if(!ret || thedir->entry != retent) + ret = APR_ENOENT; #else - thedir->entry = readdir(thedir->dirstruct); if (thedir->entry == NULL) { /* If NULL was returned, this can NEVER be a success. Can it?! */ if (errno == APR_SUCCESS) { - return APR_ENOENT; + ret = APR_ENOENT; } - return errno; + else + ret = errno; } - return APR_SUCCESS; #endif + + /* No valid bit flag to test here - do we want one? */ + finfo->fname = NULL; + + if (ret) { + finfo->valid = 0; + return ret; + } + + /* What we already know */ + /* XXX: Optimize here with d_fileno, d_type etc by platform */ + wanted &= ~(APR_FINFO_NAME); + if (wanted) + { + char fspec[_MAXPATH]; + int off; + apr_strcpyn(fspec, sizeof(fspec), thedir->dirname); + off = strlen(fspec); + if (fspec[off - 1] != '/') + fspec[off++] = '/'; + apr_strcpyn(fspec + off, sizeof(fspec) - off, thedir->entry->d_name); + /* ??? Or lstat below? What is it we really want? */ + ret = apr_stat(finfo, wanted, fspec, thedir->cntxt); + } + if (!wanted || ret) { + finfo->cntxt = thedir->cntxt; + finfo->valid = 0; + } + /* We passed a stack name that is now gone */ + finfo->fname = NULL; + finfo->valid |= APR_FINFO_NAME; + /* XXX: Optimize here with d_fileno, d_type etc by platform */ + finfo->name = thedir->entry->d_name; + return APR_SUCCESS; } -apr_status_t apr_rewinddir(apr_dir_t *thedir) +apr_status_t apr_dir_rewind(apr_dir_t *thedir) { rewinddir(thedir->dirstruct); return APR_SUCCESS; @@ -163,94 +196,6 @@ apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) } } -apr_status_t apr_dir_entry_size(apr_size_t *size, apr_dir_t *thedir) -{ - struct stat filestat; - char *fname = NULL; - - if (thedir->entry == NULL) { - *size = -1; - return APR_ENOFILE; - } - fname = apr_pstrcat(thedir->cntxt, thedir->dirname, "/", - thedir->entry->d_name, NULL); - if (stat(fname, &filestat) == -1) { - *size = 0; - return errno; - } - - *size = filestat.st_size; - return APR_SUCCESS; -} - -apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir) -{ - struct stat filestat; - char *fname = NULL; - - if (thedir->entry == NULL) { - *mtime = -1; - return APR_ENOFILE; - } - - fname = apr_pstrcat(thedir->cntxt, thedir->dirname, "/", - thedir->entry->d_name, NULL); - if (stat(fname, &filestat) == -1) { - *mtime = -1; - return errno; - } - - apr_ansi_time_to_apr_time(mtime, filestat.st_mtime); - return APR_SUCCESS; -} - -apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) -{ - struct stat filestat; - char *fname = NULL; - - if (thedir->entry == NULL) { - *type = APR_REG; - return APR_ENOFILE; - } - - fname = apr_pstrcat(thedir->cntxt, thedir->dirname, "/", - thedir->entry->d_name, NULL); - if (stat(fname, &filestat) == -1) { - *type = APR_REG; - return errno; - } - - if (S_ISREG(filestat.st_mode)) - *type = APR_REG; - if (S_ISDIR(filestat.st_mode)) - *type = APR_DIR; - if (S_ISCHR(filestat.st_mode)) - *type = APR_CHR; - if (S_ISBLK(filestat.st_mode)) - *type = APR_BLK; - if (S_ISFIFO(filestat.st_mode)) - *type = APR_PIPE; - if (S_ISLNK(filestat.st_mode)) - *type = APR_LNK; -#ifndef BEOS - if (S_ISSOCK(filestat.st_mode)) - *type = APR_SOCK; -#endif - return APR_SUCCESS; -} - -apr_status_t apr_get_dir_filename(const char **new, apr_dir_t *thedir) -{ - /* Detect End-Of-File */ - if (thedir == NULL || thedir->entry == NULL) { - *new = NULL; - return APR_ENOENT; - } - (*new) = thedir->entry->d_name; - return APR_SUCCESS; -} - apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) { if (dir == NULL) { diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index ffc1fa33c41..d09f8a1e837 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -93,10 +93,7 @@ static apr_status_t fill_out_finfo(apr_finfo_t *finfo, struct stat info, finfo->size = info.st_size; finfo->inode = info.st_ino; finfo->device = info.st_dev; - -/* We don't have nlinks in the finfo structure. Are we going to add it? RBB*/ -/* finfo->nlinks = info.st_nlink; */ - + finfo->nlink = info.st_nlink; apr_ansi_time_to_apr_time(&finfo->atime, info.st_atime); apr_ansi_time_to_apr_time(&finfo->mtime, info.st_mtime); apr_ansi_time_to_apr_time(&finfo->ctime, info.st_ctime); diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 5145bc414c1..a56ec3fafd5 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -129,7 +129,7 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_closedir(apr_dir_t *dir) +APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *dir) { if (dir->dirhand != INVALID_HANDLE_VALUE && !FindClose(dir->dirhand)) { return apr_get_os_error(); @@ -138,7 +138,8 @@ APR_DECLARE(apr_status_t) apr_closedir(apr_dir_t *dir) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_readdir(apr_dir_t *thedir) +APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, + apr_dir_t *thedir) { /* The while loops below allow us to skip all invalid file names, so that * we aren't reporting any files where their absolute paths are too long. @@ -147,6 +148,7 @@ APR_DECLARE(apr_status_t) apr_readdir(apr_dir_t *thedir) apr_oslevel_e os_level; if (!apr_get_oslevel(thedir->cntxt, &os_level) && os_level >= APR_WIN_NT) { + apr_status_t rv; if (thedir->dirhand == INVALID_HANDLE_VALUE) { apr_wchar_t wdirname[8192]; @@ -171,6 +173,10 @@ APR_DECLARE(apr_status_t) apr_readdir(apr_dir_t *thedir) return apr_get_os_error(); } } + if (rv = unicode_to_utf8_path(thedir->name, MAX_PATH * 3 + 1, + thedir->w.entry->cFileName)) + return rv; + finfo->name = thedir->name; } else #endif @@ -192,11 +198,31 @@ APR_DECLARE(apr_status_t) apr_readdir(apr_dir_t *thedir) return apr_get_os_error(); } } + finfo->name = thedir->n.entry->cFileName; + } + + finfo->valid = APR_FINFO_NAME | APR_FINFO_SIZE | APR_FINFO_MTIME; + finfo->fname = NULL; + finfo->size = (thedir->n.entry->nFileSizeHigh * MAXDWORD) + + thedir->n.entry->nFileSizeLow; + FileTimeToAprTime(&finfo->mtime, &thedir->n.entry->ftLastWriteTime); + if (thedir->n.entry->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + finfo->filetype = APR_DIR; + finfo->valid |= APR_FINFO_TYPE; + } + else if (thedir->n.entry->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { + finfo->filetype = APR_LNK; + finfo->valid |= APR_FINFO_TYPE | APR_FINFO_LINK; + } + else { + /* XXX: Not good logic. No devices here, but what might we find? */ + finfo->filetype = APR_REG; + finfo->valid |= APR_FINFO_TYPE; } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_rewinddir(apr_dir_t *dir) +APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *dir) { dir_cleanup(dir); if (!FindClose(dir->dirhand)) { @@ -255,64 +281,10 @@ APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dir_entry_size(apr_ssize_t *size, - apr_dir_t *thedir) -{ - if (thedir == NULL || thedir->n.entry == NULL) { - return APR_ENODIR; - } - (*size) = (thedir->n.entry->nFileSizeHigh * MAXDWORD) + - thedir->n.entry->nFileSizeLow; - return APR_SUCCESS; -} -APR_DECLARE(apr_status_t) apr_dir_entry_mtime(apr_time_t *time, - apr_dir_t *thedir) -{ - if (thedir == NULL || thedir->n.entry == NULL) { - return APR_ENODIR; - } - FileTimeToAprTime(time, &thedir->n.entry->ftLastWriteTime); - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_dir_entry_ftype(apr_filetype_e *type, - apr_dir_t *thedir) -{ - switch(thedir->n.entry->dwFileAttributes) { - case FILE_ATTRIBUTE_DIRECTORY: { - (*type) = APR_DIR; - return APR_SUCCESS; - } - case FILE_ATTRIBUTE_NORMAL: { - (*type) = APR_REG; - return APR_SUCCESS; - } - default: { - (*type) = APR_REG; /* As valid as anything else.*/ - return APR_SUCCESS; - } - } -} -APR_DECLARE(apr_status_t) apr_get_dir_filename(const char **new, - apr_dir_t *thedir) -{ -#if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(thedir->cntxt, &os_level) && os_level >= APR_WIN_NT) - { - apr_status_t rv; - if (rv = unicode_to_utf8_path(thedir->name, MAX_PATH * 3 + 1, - thedir->w.entry->cFileName)) - return rv; - (*new) = thedir->name; - } - else -#endif - (*new) = thedir->n.entry->cFileName; - return APR_SUCCESS; -} + + APR_DECLARE(apr_status_t) apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) @@ -324,26 +296,9 @@ APR_DECLARE(apr_status_t) apr_get_os_dir(apr_os_dir_t **thedir, return APR_SUCCESS; } -/* XXX: This is sort of blinkin stupid on win32... consider, - * our open doesn't open the dir, it sets up the apr_dir_t, - * and on the first apr_readdir it actually does a FindFirstFile - * if the handle is closed, or else a FindNextFile that is based - * on cached info that we simply don't have our hands on when - * we use this function. Maybe APR_ENOTIMPL would be better? - */ APR_DECLARE(apr_status_t) apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) { - if (cont == NULL) { - return APR_ENOPOOL; - } - if ((*dir) == NULL) { - (*dir) = (apr_dir_t *)apr_pcalloc(cont, sizeof(apr_dir_t)); - (*dir)->cntxt = cont; - } - else - (*dir)->rootlen = 0; /* We don't know, don't care */ - (*dir)->dirhand = thedir; - return APR_SUCCESS; + return APR_ENOTIMPL; } diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 28e5cecd457..3403c946cfc 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -63,18 +63,6 @@ #include "atime.h" #include "misc.h" -/* Entries missing from the MSVC 5.0 Win32 SDK: - */ -#ifndef FILE_ATTRIBUTE_REPARSE_POINT -#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 -#endif -#ifndef FILE_FLAG_OPEN_NO_RECALL -#define FILE_FLAG_OPEN_NO_RECALL 0x00100000 -#endif -#ifndef FILE_FLAG_OPEN_REPARSE_POINT -#define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000 -#endif - APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index baa11e731ce..770f2d602c8 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -145,6 +145,7 @@ typedef struct apr_finfo_t apr_finfo_t; #define APR_FINFO_CSIZE 0x00000400 #define APR_FINFO_DEV 0x00001000 #define APR_FINFO_INODE 0x00002000 +#define APR_FINFO_NLINK 0x00004000 #define APR_FINFO_TYPE 0x00008000 #define APR_FINFO_USER 0x00010000 #define APR_FINFO_GROUP 0x00020000 @@ -152,13 +153,14 @@ typedef struct apr_finfo_t apr_finfo_t; #define APR_FINFO_GPROT 0x00200000 #define APR_FINFO_WPROT 0x00400000 #define APR_FINFO_ICASE 0x01000000 /* if dev is case insensitive */ -#define APR_FINFO_FCASE 0x02000000 /* filename in proper case */ +#define APR_FINFO_NAME 0x02000000 /* ->name in proper case */ #define APR_FINFO_MIN 0x00008170 /* minimal: type, dates and size */ #define APR_FINFO_IDENT 0x00003000 /* dev and inode */ #define APR_FINFO_OWNER 0x00030000 /* user and group */ #define APR_FINFO_PROT 0x00700000 /* all protections */ -#define APR_FINFO_NORM 0x0073b170 /* the expected unix results */ +#define APR_FINFO_NORM 0x0073b170 /* an atomic unix apr_stat() */ +#define APR_FINFO_DIRENT 0x01002000 /* an atomic unix apr_dir_read() */ /** * The file information structure. This is analogous to the POSIX @@ -184,6 +186,8 @@ struct apr_finfo_t { apr_ino_t inode; /** The id of the device the file is on. */ apr_dev_t device; + /** The number of hard links to the file. */ + apr_int16_t nlink; /** The size of the file */ apr_off_t size; /** The space allocated for the file */ @@ -198,8 +202,8 @@ struct apr_finfo_t { apr_time_t ctime; /** The full pathname of the file */ const char *fname; - /** The file's name alone, in filesystem case */ - char *fcase; + /** The file's name (no path) in filesystem case */ + const char *name; /** The file's handle, if accessed (can be submitted to apr_duphandle) */ struct apr_file_t *filehand; }; @@ -247,60 +251,26 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir, /** * close the specified directory. * @param thedir the directory descriptor to close. - * @deffunc apr_status_t apr_closedir(apr_dir_t *thedir) + * @deffunc apr_status_t apr_dir_close(apr_dir_t *thedir) */ -APR_DECLARE(apr_status_t) apr_closedir(apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir); /** * Read the next entry from the specified directory. * @param thedir the directory descriptor to read from, and fill out. * @tip All systems return . and .. as the first two files. - * @deffunc apr_status_t apr_readdir(apr_dir_t *thedir) + * @deffunc apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_dir_t *thedir) */ -APR_DECLARE(apr_status_t) apr_readdir(apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, + apr_dir_t *thedir); /** * Rewind the directory to the first entry. * @param thedir the directory descriptor to rewind. - * @deffunc apr_status_t apr_rewinddir(apr_dir_t *thedir) + * @deffunc apr_status_t apr_dir_rewind(apr_dir_t *thedir) */ -APR_DECLARE(apr_status_t) apr_rewinddir(apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); -/** - * Get the file name of the current directory entry. - * @param new_path the file name of the directory entry. - * @param thedir the currently open directory. - * @deffunc apr_status_t apr_get_dir_filename(const char **new_path, apr_dir_t *thedir) - */ -APR_DECLARE(apr_status_t) apr_get_dir_filename(const char **new_path, - apr_dir_t *thedir); - -/** - * Get the size of the current directory entry. - * @param size the size of the directory entry. - * @param thedir the currently open directory. - * @deffunc apr_status_t apr_dir_entry_size(apr_size_t *size, apr_dir_t *thedir) - */ -APR_DECLARE(apr_status_t) apr_dir_entry_size(apr_size_t *size, - apr_dir_t *thedir); - -/** - * Get the last modified time of the current directory entry. - * @param mtime the last modified time of the directory entry. - * @param thedir the currently open directory. - * @deffunc apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir) - */ -APR_DECLARE(apr_status_t) apr_dir_entry_mtime(apr_time_t *mtime, - apr_dir_t *thedir); - -/** - * Get the file type of the current directory entry. - * @param type the file type of the directory entry. - * @param thedir the currently open directory. - * @deffunc apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) - */ -APR_DECLARE(apr_status_t) apr_dir_entry_ftype(apr_filetype_e *type, - apr_dir_t *thedir); #ifdef __cplusplus } diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index d2a44fd18bf..d1abad34ae5 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -63,6 +63,7 @@ #include "apr_general.h" #include "apr_lock.h" #include "apr_file_io.h" +#include "apr_file_info.h" #include "apr_errno.h" #define APR_FILE_BUFSIZE 4096 diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index b3c2d40d05b..a230b3e037b 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -60,6 +60,7 @@ #include "apr_general.h" #include "apr_tables.h" #include "apr_file_io.h" +#include "apr_file_info.h" #include "apr_errno.h" #include "apr_lib.h" diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index c85df35ec83..c50cdc55fee 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -62,6 +62,7 @@ #include "apr_tables.h" #include "apr_lock.h" #include "apr_file_io.h" +#include "apr_file_info.h" #include "apr_errno.h" #include "misc.h" @@ -115,6 +116,17 @@ apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, #define APR_READCONTROL 4096 /* Read the file's owner/perms */ #define APR_WRITECONTROL 2048 /* Modifythe file's owner/perms */ +/* Entries missing from the MSVC 5.0 Win32 SDK: + */ +#ifndef FILE_ATTRIBUTE_REPARSE_POINT +#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 +#endif +#ifndef FILE_FLAG_OPEN_NO_RECALL +#define FILE_FLAG_OPEN_NO_RECALL 0x00100000 +#endif +#ifndef FILE_FLAG_OPEN_REPARSE_POINT +#define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000 +#endif /* quick run-down of fields in windows' apr_file_t structure that may have diff --git a/test/testfile.c b/test/testfile.c index 645e27a673f..673a0d7d811 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -290,8 +290,7 @@ int testdirs(apr_pool_t *context) apr_dir_t *temp; apr_file_t *file = NULL; apr_size_t bytes; - apr_filetype_e type; - const char *fname; + apr_finfo_t dirent; fprintf(stdout, "Testing Directory functions.\n"); @@ -322,7 +321,7 @@ int testdirs(apr_pool_t *context) } fprintf(stdout, "\tReading Directory......."); - if ((apr_readdir(temp)) != APR_SUCCESS) { + if ((apr_dir_read(&dirent, APR_FINFO_DIRENT, temp)) != APR_SUCCESS) { fprintf(stderr, "Could not read directory\n"); return -1; } @@ -336,40 +335,39 @@ int testdirs(apr_pool_t *context) /* Because I want the file I created, I am skipping the "." and ".." * files that are here. */ - if (apr_readdir(temp) != APR_SUCCESS) { + if (apr_dir_read(&dirent, APR_FINFO_DIRENT | APR_FINFO_TYPE + | APR_FINFO_SIZE | APR_FINFO_MTIME, temp) + != APR_SUCCESS) { fprintf(stderr, "Error reading directory testdir"); return -1; } - apr_get_dir_filename(&fname, temp); - } while (fname[0] == '.'); - if (strcmp(fname, "testfile")) { - fprintf(stderr, "Got wrong file name %s\n", fname); + } while (dirent.name[0] == '.'); + if (strcmp(dirent.name, "testfile")) { + fprintf(stderr, "Got wrong file name %s\n", dirent.name); return -1; } fprintf(stdout, "OK\n"); fprintf(stdout, "\t\tFile type......."); - apr_dir_entry_ftype(&type, temp); - if (type != APR_REG) { + if (dirent.filetype != APR_REG) { fprintf(stderr, "Got wrong file type\n"); return -1; } fprintf(stdout, "OK\n"); fprintf(stdout, "\t\tFile size......."); - apr_dir_entry_size(&bytes, temp); - if (bytes != strlen("Another test!!!")) { - fprintf(stderr, "Got wrong file size %" APR_SIZE_T_FMT "\n", bytes); + if (dirent.size != bytes)) { + fprintf(stderr, "Got wrong file size %" APR_SIZE_T_FMT "\n", dirent.size); return -1; } fprintf(stdout, "OK\n"); fprintf(stdout, "\tRewinding directory......."); - apr_rewinddir(temp); + apr_dir_rewind(temp); fprintf(stdout, "OK\n"); fprintf(stdout, "\tClosing Directory......."); - if (apr_closedir(temp) != APR_SUCCESS) { + if (apr_dir_close(temp) != APR_SUCCESS) { fprintf(stderr, "Could not close directory\n"); return -1; } From 799164dbe0bfe5f72adf28d1a8d9d6def7d67a2c Mon Sep 17 00:00:00 2001 From: Doug MacEachern <dougm@apache.org> Date: Tue, 23 Jan 2001 04:19:56 +0000 Subject: [PATCH 1117/7878] remove dead code now that btable is gone git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61098 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index 8529b2f3233..76970478518 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -126,21 +126,6 @@ struct apr_table_entry_t { char *val; }; -/** - * A transparent type for items stored in binary-content tables, and - * possibly elsewhere. - */ -typedef struct apr_item_t { - /** The key for the current table entry */ - char *key; /* maybe NULL in future; - * check when iterating thru table_elts - */ - /** Size of the opaque block comprising the item's content. */ - size_t size; - /** A pointer to the content itself. */ - void *data; -} apr_item_t; - /** * Get the elements from a table * @param t The table From dfbebc987b0f126fe331a4aebd5135eb4a48f95d Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 23 Jan 2001 04:40:40 +0000 Subject: [PATCH 1118/7878] Fix apr_dir_read on Unix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61099 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index fc6ef33b4dc..7f67a3790b6 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -109,7 +109,7 @@ apr_status_t apr_dir_close(apr_dir_t *thedir) apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_dir_t *thedir) { - apr_status_t ret; + apr_status_t ret = 0; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && !defined(READDIR_IS_THREAD_SAFE) dirent *retent; @@ -146,15 +146,15 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, wanted &= ~(APR_FINFO_NAME); if (wanted) { - char fspec[_MAXPATH]; + char fspec[PATH_MAX]; int off; - apr_strcpyn(fspec, sizeof(fspec), thedir->dirname); + apr_cpystrn(fspec, thedir->dirname, sizeof(fspec)); off = strlen(fspec); if (fspec[off - 1] != '/') fspec[off++] = '/'; - apr_strcpyn(fspec + off, sizeof(fspec) - off, thedir->entry->d_name); + apr_cpystrn(fspec + off, thedir->entry->d_name, sizeof(fspec) - off); /* ??? Or lstat below? What is it we really want? */ - ret = apr_stat(finfo, wanted, fspec, thedir->cntxt); + ret = apr_stat(finfo, fspec, wanted, thedir->cntxt); } if (!wanted || ret) { finfo->cntxt = thedir->cntxt; From dbe461f88de870abf0d3aee8c1d3640fac01783b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 23 Jan 2001 06:00:44 +0000 Subject: [PATCH 1119/7878] Commit a bunch of cleanups to get win32 going again. Note the apr.dsp built in debug mode is required to actually make these build. There are still todo's for win32 (need cl debug flags, for one). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61100 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.pl | 10 ++++++++-- test/client.c | 7 ++++++- test/sendfile.c | 7 ++++++- test/server.c | 7 ++++++- test/testargs.c | 7 ++++++- test/testcontext.c | 7 ++++++- test/testdso.c | 7 ++++++- test/testfile.c | 10 +++++++--- test/testflock.c | 7 ++++++- test/testmmap.c | 7 ++++++- test/testpipe.c | 7 ++++++- test/testproc.c | 7 ++++++- test/testsock.c | 7 ++++++- 13 files changed, 81 insertions(+), 16 deletions(-) diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl index d9c51b4a6b6..062a1d814a8 100644 --- a/test/MakeWin32Make.pl +++ b/test/MakeWin32Make.pl @@ -7,6 +7,12 @@ while ($t = <$srcfl>) { + if ($t =~ m|\@INCLUDE_RULES\@|) { + $t = "ALL: \$(TARGETS)\n"; + } + if ($t =~ m|^ALL_LIBS=|) { + $t = "ALL_LIBS=../LibD/apr.lib kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib"; + } if ($t =~ s|\@CFLAGS\@|\/nologo \/MDd \/W3 \/Gm \/GX \/Zi \/Od \/D "_DEBUG" \/D "WIN32" \/D APR_DECLARE_STATIC \/FD|) { $t =~ s|-g ||; } @@ -20,7 +26,6 @@ $t =~ s|\@CC\@|cl|; $t =~ s|\@RANLIB\@||; $t =~ s|\@OPTIM\@||; - $t =~ s|\@LIBS\@|kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib|; $t =~ s|-I\$\(INCDIR\)|\/I "\$\(INCDIR\)"|; $t =~ s|\.\.\/libapr\.a|\.\./LibD/apr\.lib|; if ($t =~ s|\@EXEEXT\@|\.exe|) { @@ -30,11 +35,12 @@ $t =~ s|--export-dynamic ||; $t =~ s|-fPIC ||; } - if ($t =~ s|\$\(CC\) -shared|\$\(LINK\) \/subsystem:windows \/dll|) { + if ($t =~ s|--module|\/subsystem:windows \/dll|) { $t =~ s|-o (\S+)|\/out:\"$1\"|; } while ($t =~ s|\.a\b|\.lib|) {} while ($t =~ s|\.o\b|\.obj|) {} + while ($t =~ s|\.lo\b|\.obj|) {} while ($t =~ s|\.so\b|\.dll|) {} print $dstfl $t; diff --git a/test/client.c b/test/client.c index c6bb336c946..518edccfae4 100644 --- a/test/client.c +++ b/test/client.c @@ -60,6 +60,11 @@ #define STRLEN 15 +void closeapr(void) +{ + apr_terminate(); +} + int main(int argc, char *argv[]) { apr_pool_t *context; @@ -90,7 +95,7 @@ int main(int argc, char *argv[]) exit(-1); } fprintf(stdout, "OK\n"); - atexit(apr_terminate); + atexit(closeapr); fprintf(stdout, "Creating context......."); if (apr_create_pool(&context, NULL) != APR_SUCCESS) { diff --git a/test/sendfile.c b/test/sendfile.c index 5f22fdd22db..3f4c1c30406 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -90,6 +90,11 @@ int main(void) typedef enum {BLK, NONBLK, TIMEOUT} client_socket_mode_t; +void closeapr(void) +{ + apr_terminate(); +} + static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family) { char buf[120]; @@ -103,7 +108,7 @@ static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family) exit(1); } - atexit(apr_terminate); + atexit(closeapr); rv = apr_create_pool(p, NULL); if (rv != APR_SUCCESS) { diff --git a/test/server.c b/test/server.c index e16822d5237..11956fb6687 100644 --- a/test/server.c +++ b/test/server.c @@ -60,6 +60,11 @@ #define STRLEN 15 +void closeapr(void) +{ + apr_terminate(); +} + int main(int argc, const char * const argv[]) { apr_pool_t *context; @@ -87,7 +92,7 @@ int main(int argc, const char * const argv[]) exit(-1); } fprintf(stdout, "OK\n"); - atexit(apr_terminate); + atexit(closeapr); fprintf(stdout, "Creating context......."); if (apr_create_pool(&context, NULL) != APR_SUCCESS) { diff --git a/test/testargs.c b/test/testargs.c index e9a5ecc0246..1a0b6b40a7d 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -73,6 +73,11 @@ static void maybe_arg(const char *arg) } } +void closeapr(void) +{ + apr_terminate(); +} + int main(int argc, const char * const argv[]) { apr_pool_t *context; @@ -81,7 +86,7 @@ int main(int argc, const char * const argv[]) const char *optarg; apr_initialize(); - atexit(apr_terminate); + atexit(closeapr); apr_create_pool(&context, NULL); if (apr_initopt(&opt, context, argc, argv)) diff --git a/test/testcontext.c b/test/testcontext.c index 122382e25b6..f5669f576dc 100644 --- a/test/testcontext.c +++ b/test/testcontext.c @@ -68,6 +68,11 @@ static apr_status_t string_cleanup(void *data) return APR_SUCCESS; } +void closeapr(void) +{ + apr_terminate(); +} + int main(void) { apr_pool_t *context; @@ -78,7 +83,7 @@ int main(void) fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(apr_terminate); + atexit(closeapr); if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); diff --git a/test/testdso.c b/test/testdso.c index 3376b5ac80c..3a0790f741a 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -11,6 +11,11 @@ #define LIB_NAME "mod_test.so" +void closeapr(void) +{ + apr_terminate(); +} + int main (int argc, char ** argv) { apr_dso_handle_t *h = NULL; @@ -28,7 +33,7 @@ int main (int argc, char ** argv) strcat(filename, LIB_NAME); apr_initialize(); - atexit(apr_terminate); + atexit(closeapr); if (apr_create_pool(&cont, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); diff --git a/test/testfile.c b/test/testfile.c index 673a0d7d811..9bd824dc3fc 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -69,6 +69,11 @@ int test_filedel(apr_pool_t *); int testdirs(apr_pool_t *); static void test_read(apr_pool_t *); +void closeapr(void) +{ + apr_terminate(); +} + int main(void) { apr_pool_t *context; @@ -79,7 +84,6 @@ int main(void) apr_status_t status; apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; apr_size_t nbytes = 0; - apr_int32_t rv; apr_off_t zer = 0; char errmsg[120]; char *buf; @@ -91,7 +95,7 @@ int main(void) fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(apr_terminate); + atexit(closeapr); if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); @@ -356,7 +360,7 @@ int testdirs(apr_pool_t *context) fprintf(stdout, "OK\n"); fprintf(stdout, "\t\tFile size......."); - if (dirent.size != bytes)) { + if (dirent.size != bytes) { fprintf(stderr, "Got wrong file size %" APR_SIZE_T_FMT "\n", dirent.size); return -1; } diff --git a/test/testflock.c b/test/testflock.c index 635c43ccfcb..bf6ff854476 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -141,6 +141,11 @@ static void do_write(void) printf(" done.\nExiting.\n"); } +void closeapr(void) +{ + apr_terminate(); +} + int main(int argc, const char * const *argv) { int reader = 0; @@ -151,7 +156,7 @@ int main(int argc, const char * const *argv) if (apr_initialize() != APR_SUCCESS) errmsg("Could not initialize APR.\n"); - atexit(apr_terminate); + atexit(closeapr); if (apr_create_pool(&pool, NULL) != APR_SUCCESS) errmsg("Could not create global pool.\n"); diff --git a/test/testmmap.c b/test/testmmap.c index 53e5a43d153..0845be47a27 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -69,6 +69,11 @@ */ #define PATH_LEN 255 +void closeapr(void) +{ + apr_terminate(); +} + int main(void) { #if APR_HAS_MMAP @@ -89,7 +94,7 @@ int main(void) exit(-1); } fprintf(stdout,"OK\n"); - atexit(apr_terminate); + atexit(closeapr); fprintf(stdout,"Creating context...................."); if (apr_create_pool(&context, NULL) != APR_SUCCESS) { diff --git a/test/testpipe.c b/test/testpipe.c index a06dc1547f1..e6b7d5e257c 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -62,6 +62,11 @@ #include <unistd.h> #endif +void closeapr(void) +{ + apr_terminate(); +} + int main(void) { apr_pool_t *context; @@ -76,7 +81,7 @@ int main(void) fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(apr_terminate); + atexit(closeapr); if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); diff --git a/test/testproc.c b/test/testproc.c index 25ff8ff8632..215fcc8a9d7 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -69,6 +69,11 @@ int test_filedel(void); int testdirs(void); +void closeapr(void) +{ + apr_terminate(); +} + int main(int argc, char *argv[]) { apr_pool_t *context; @@ -84,7 +89,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(apr_terminate); + atexit(closeapr); apr_create_pool(&context, NULL); diff --git a/test/testsock.c b/test/testsock.c index 3bbae24fce7..263b80a7e88 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -180,6 +180,11 @@ static int run_sendfile(apr_pool_t *context, int number) return 1; } +void closeapr(void) +{ + apr_terminate(); +} + int main(int argc, char *argv[]) { apr_pool_t *context = NULL; @@ -190,7 +195,7 @@ int main(int argc, char *argv[]) exit(-1); } fprintf(stdout, "OK\n"); - atexit(apr_terminate); + atexit(closeapr); fprintf(stdout, "Creating context......."); if (apr_create_pool(&context, NULL) != APR_SUCCESS) { From 7ff6dc88497fdaadfc1c38e3094710231de6b70c Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 23 Jan 2001 06:16:48 +0000 Subject: [PATCH 1120/7878] Get dir.c compiling on FreeBSD git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61101 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + file_io/unix/dir.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/configure.in b/configure.in index 04ae848b1d6..e8d300e7c04 100644 --- a/configure.in +++ b/configure.in @@ -284,6 +284,7 @@ AC_CHECK_HEADERS(netdb.h, netdbh="1", netdbh="0") AC_CHECK_HEADERS(osreldate.h) AC_CHECK_HEADERS(process.h) AC_CHECK_HEADERS(pwd.h) +AC_CHECK_HEADERS(sys/syslimits.h) AC_CHECK_HEADERS(sys/sem.h) AC_CHECK_HEADERS(signal.h, signalh="1", signalh="0") AC_CHECK_HEADERS(stdarg.h, stdargh="1", stdargh="0") diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 7f67a3790b6..121fecd2632 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -55,6 +55,9 @@ #include "fileio.h" #include "apr_strings.h" #include "apr_portable.h" +#ifdef HAVE_SYS_SYSLIMITS_H +#include <sys/syslimits.h> +#endif static apr_status_t dir_cleanup(void *thedir) { From c43ef11bbdc598aea92a75481aa65fef597d707e Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 23 Jan 2001 16:26:28 +0000 Subject: [PATCH 1121/7878] Allow APR to build from any directory. Submitted by: Kevin Pilch-Bisson <kevin@pilch-bisson.net> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61102 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index e8d300e7c04..03fe2b63743 100644 --- a/configure.in +++ b/configure.in @@ -23,7 +23,7 @@ abs_srcdir=`(cd $srcdir && pwd)` abs_builddir=`pwd` dnl Libtool needs this symbol -top_builddir="$abs_srcdir" +top_builddir="$abs_builddir" AC_SUBST(top_builddir) dnl Get location of helpers directory From 3f0c9dea24c5a1c7ab73cb0f99cd2e37078aa7c4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 23 Jan 2001 16:48:56 +0000 Subject: [PATCH 1122/7878] Fix a declaration of dirent to struct dirent in file_io/unix/dir.c Submitted by: Kevin Pilch-Bisson <kevin@pilch-bisson.net> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61103 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++++++ file_io/unix/dir.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8f137b7c670..937a77efe9a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,12 @@ Changes with APR b1 + *) Fix bug in file_io/unix/dir.c. There is no such thing as a dirent, + it must be a struct dirent. + [Kevin Pilch-Bisson <kevin@pilch-bisson.net>] + + *) Fix the configure script so that we can build from a different + directory. [Kevin Pilch-Bisson <kevin@pilch-bisson.net>] + *) Introduce the wanted flag argument to the apr_stat/lstat/getfileinfo family of functions. This change allows the user to determine what platform-specific file information is retrieved, to optimize both diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 121fecd2632..c9aef0f4577 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -115,7 +115,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_status_t ret = 0; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && !defined(READDIR_IS_THREAD_SAFE) - dirent *retent; + struct dirent *retent; ret = readdir_r(thedir->dirstruct, thedir->entry, &retent); From f541100b093ef2a1d76a3ae7ab74ea3ad2a8cc25 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 23 Jan 2001 17:50:58 +0000 Subject: [PATCH 1123/7878] Add a healthy bit of extra native info to win32's apr_dir_read() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61104 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index a56ec3fafd5..c4524d8199d 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -200,12 +200,15 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, } finfo->name = thedir->n.entry->cFileName; } - - finfo->valid = APR_FINFO_NAME | APR_FINFO_SIZE | APR_FINFO_MTIME; - finfo->fname = NULL; - finfo->size = (thedir->n.entry->nFileSizeHigh * MAXDWORD) + - thedir->n.entry->nFileSizeLow; - FileTimeToAprTime(&finfo->mtime, &thedir->n.entry->ftLastWriteTime); + finfo->cntxt = thedir->cntxt; + finfo->valid = APR_FINFO_NAME | APR_FINFO_TYPE | APR_FINFO_CTIME + | APR_FINFO_ATIME | APR_FINFO_MTIME | APR_FINFO_SIZE; + /* Do the best job we can determining the file type. + * Win32 only returns device names in a directory in response to a specific + * request (e.g. FindFirstFile("CON"), not to wildcards, so we will ignore + * the BLK, CHR, and other oddballs, since they should -not- occur in this + * context. + */. if (thedir->n.entry->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { finfo->filetype = APR_DIR; finfo->valid |= APR_FINFO_TYPE; @@ -215,10 +218,15 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, finfo->valid |= APR_FINFO_TYPE | APR_FINFO_LINK; } else { - /* XXX: Not good logic. No devices here, but what might we find? */ finfo->filetype = APR_REG; finfo->valid |= APR_FINFO_TYPE; } + FileTimeToAprTime(&finfo->ctime, &thedir->n.entry->ftCreationTime); + FileTimeToAprTime(&finfo->mtime, &thedir->n.entry->ftLastWriteTime); + FileTimeToAprTime(&finfo->atime, &thedir->n.entry->ftLastAccessTime); + finfo->size = (thedir->n.entry->nFileSizeHigh * MAXDWORD) + + thedir->n.entry->nFileSizeLow; + finfo->fname = NULL; return APR_SUCCESS; } From 0f3d828521cb76ba02c384ddbd719a3e0d225044 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 23 Jan 2001 19:51:46 +0000 Subject: [PATCH 1124/7878] A little more effort to make these tests compile on windows ... a long way yet to go to make this build cleanly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61105 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.pl | 10 ++++++---- test/aprtest.dsw | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl index 062a1d814a8..a0c6318f246 100644 --- a/test/MakeWin32Make.pl +++ b/test/MakeWin32Make.pl @@ -3,12 +3,14 @@ $srcfl = new IO::File "Makefile.in", "r" || die "failed to open .in file"; $dstfl = new IO::File "Makefile", "w" || die "failed to create Makefile"; -print $dstfl "LINK=link.exe\n"; - while ($t = <$srcfl>) { if ($t =~ m|\@INCLUDE_RULES\@|) { - $t = "ALL: \$(TARGETS)\n"; + $t = "ALL: \$(TARGETS)\n\n" + . "CL = cl.exe\n" + . "LINK = link.exe /nologo /debug /machine:I386\n\n" + . ".c.obj::\n" + . "\t\$(CL) -c \$*.c \$(CFLAGS)\n"; } if ($t =~ m|^ALL_LIBS=|) { $t = "ALL_LIBS=../LibD/apr.lib kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib"; @@ -16,7 +18,7 @@ if ($t =~ s|\@CFLAGS\@|\/nologo \/MDd \/W3 \/Gm \/GX \/Zi \/Od \/D "_DEBUG" \/D "WIN32" \/D APR_DECLARE_STATIC \/FD|) { $t =~ s|-g ||; } - $t =~ s|\@LDFLAGS\@|\/nologo \/debug \/machine:I386|; + $t =~ s|\@LDFLAGS\@||; $t =~ s|\@RM\@|del|; if ($t =~ s|(\$\(RM\)) -f|$1|) { diff --git a/test/aprtest.dsw b/test/aprtest.dsw index a0228e52a53..6d2d700a7d7 100644 --- a/test/aprtest.dsw +++ b/test/aprtest.dsw @@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 5.00 ############################################################################### -Project: "aprlib"="..\aprlib.dsp" - Package Owner=<4> +Project: "apr"="..\apr.dsp" - Package Owner=<4> Package=<5> {{{ @@ -26,6 +26,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name aprlib End Project Dependency + Begin Project Dependency + Project_Dep_Name apr + End Project Dependency }}} ############################################################################### From 9fcbf5ea77f9200f76451b94d239dac06f7b7b33 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 23 Jan 2001 19:53:40 +0000 Subject: [PATCH 1125/7878] Cleanups and implement a sub-stat for win32 apr_dir_read(), as on unix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61106 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 53 ++++++++++++++++++++++++++++++++++---------- file_io/win32/open.c | 6 ++--- 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index c4524d8199d..f27bb7520f7 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -53,7 +53,7 @@ */ #include "apr.h" -#include "win32/fileio.h" +#include "fileio.h" #include "apr_file_io.h" #include "apr_strings.h" #include "apr_portable.h" @@ -72,6 +72,7 @@ #include <sys/stat.h> #endif + static apr_status_t dir_cleanup(void *thedir) { apr_dir_t *dir = thedir; @@ -90,12 +91,15 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, #endif int len = strlen(dirname); (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); + /* Leave room here to add and pop the '*' wildcard for FindFirstFile + * and double-null terminate so we have one character to change. + */ (*new)->dirname = apr_palloc(cont, len + 3); memcpy((*new)->dirname, dirname, len); if (len && (*new)->dirname[len - 1] != '/') { (*new)->dirname[len++] = '/'; } - (*new)->dirname[len++] = '*'; + (*new)->dirname[len++] = '\0'; (*new)->dirname[len] = '\0'; #if APR_HAS_UNICODE_FS @@ -104,7 +108,7 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, /* Create a buffer for the longest file name we will ever see */ (*new)->w.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); - (*new)->name = apr_pcalloc(cont, MAX_PATH * 3 + 1); + (*new)->name = apr_pcalloc(cont, APR_FILE_MAX * 3 + 1); } else #endif @@ -115,7 +119,7 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, * The length not including the trailing '*' is stored as rootlen, to * skip over all paths which are too long. */ - if (len >= MAX_PATH) { + if (len >= APR_PATH_MAX) { (*new) = NULL; return APR_ENAMETOOLONG; } @@ -141,6 +145,7 @@ APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *dir) APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_dir_t *thedir) { + apr_status_t rv; /* The while loops below allow us to skip all invalid file names, so that * we aren't reporting any files where their absolute paths are too long. */ @@ -148,16 +153,18 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_oslevel_e os_level; if (!apr_get_oslevel(thedir->cntxt, &os_level) && os_level >= APR_WIN_NT) { - apr_status_t rv; if (thedir->dirhand == INVALID_HANDLE_VALUE) { - apr_wchar_t wdirname[8192]; + apr_wchar_t *eos, wdirname[APR_PATH_MAX]; apr_status_t rv; if (rv = utf8_to_unicode_path(wdirname, sizeof(wdirname) / sizeof(apr_wchar_t), thedir->dirname)) { return rv; } + eos = wcschr(wdirname, '\0'); + eos[0] = '*'; + eos[1] = '\0'; thedir->dirhand = FindFirstFileW(wdirname, thedir->w.entry); if (thedir->dirhand == INVALID_HANDLE_VALUE) { return apr_get_os_error(); @@ -167,13 +174,13 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, return apr_get_os_error(); } while (thedir->rootlen && - thedir->rootlen + wcslen(thedir->w.entry->cFileName) >= MAX_PATH) + thedir->rootlen + wcslen(thedir->w.entry->cFileName) >= APR_PATH_MAX) { if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) { return apr_get_os_error(); } } - if (rv = unicode_to_utf8_path(thedir->name, MAX_PATH * 3 + 1, + if (rv = unicode_to_utf8_path(thedir->name, APR_FILE_MAX * 3 + 1, thedir->w.entry->cFileName)) return rv; finfo->name = thedir->name; @@ -182,8 +189,11 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, #endif { if (thedir->dirhand == INVALID_HANDLE_VALUE) { + /* '/' terminated, so add the '*' and pop it when we finish */ + *strchr(thedir->dirname, '\0') = '*'; thedir->dirhand = FindFirstFileA(thedir->dirname, thedir->n.entry); + *(strchr(thedir->dirname, '\0') - 1) = '\0'; if (thedir->dirhand == INVALID_HANDLE_VALUE) { return apr_get_os_error(); } @@ -200,15 +210,34 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, } finfo->name = thedir->n.entry->cFileName; } - finfo->cntxt = thedir->cntxt; finfo->valid = APR_FINFO_NAME | APR_FINFO_TYPE | APR_FINFO_CTIME | APR_FINFO_ATIME | APR_FINFO_MTIME | APR_FINFO_SIZE; + wanted |= ~finfo->valid; + if (wanted) { + /* Win32 apr_stat() is about to open a handle to this file. + * we must create a full path that doesn't evaporate. + */ + const char *fname = finfo->name; + char *fspec = apr_pstrcat(thedir->cntxt, thedir->dirname, + finfo->name, NULL); + finfo->valid = 0; + rv = apr_stat(finfo, fspec, wanted, thedir->cntxt); + if (rv == APR_SUCCESS || rv == APR_INCOMPLETE) { + finfo->valid |= APR_FINFO_NAME; + finfo->name = fname; + finfo->fname = fspec; + } + return rv; + } + + finfo->cntxt = thedir->cntxt; + /* Do the best job we can determining the file type. * Win32 only returns device names in a directory in response to a specific * request (e.g. FindFirstFile("CON"), not to wildcards, so we will ignore * the BLK, CHR, and other oddballs, since they should -not- occur in this * context. - */. + */ if (thedir->n.entry->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { finfo->filetype = APR_DIR; finfo->valid |= APR_FINFO_TYPE; @@ -247,7 +276,7 @@ APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm, apr_oslevel_e os_level; if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { - apr_wchar_t wpath[8192]; + apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) / sizeof(apr_wchar_t), path)) { @@ -271,7 +300,7 @@ APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont) apr_oslevel_e os_level; if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { - apr_wchar_t wpath[8192]; + apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) / sizeof(apr_wchar_t), path)) { diff --git a/file_io/win32/open.c b/file_io/win32/open.c index abbb711185b..e5675a84f24 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -237,7 +237,7 @@ APR_DECLARE(apr_status_t) apr_open(apr_file_t **new, const char *fname, #if APR_HAS_UNICODE_FS if (os_level >= APR_WIN_NT) { - apr_wchar_t wfname[8192]; + apr_wchar_t wfname[APR_PATH_MAX]; if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) / sizeof(apr_wchar_t), fname)) return rv; @@ -320,7 +320,7 @@ APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont) apr_oslevel_e os_level; if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { - apr_wchar_t wpath[8192]; + apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) / sizeof(apr_wchar_t), path)) { @@ -344,7 +344,7 @@ APR_DECLARE(apr_status_t) apr_rename_file(const char *frompath, apr_oslevel_e os_level; if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { - apr_wchar_t wfrompath[8192], wtopath[8192]; + apr_wchar_t wfrompath[APR_PATH_MAX], wtopath[APR_PATH_MAX]; apr_status_t rv; if (rv = utf8_to_unicode_path(wfrompath, sizeof(wfrompath) / sizeof(apr_wchar_t), frompath)) { From 7e1f4463f944b37a6b62891e6e44edeeadc3f3ad Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Tue, 23 Jan 2001 19:54:42 +0000 Subject: [PATCH 1126/7878] New constants for win32 - perhaps these are better setup for all platforms? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61107 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/fileio.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index c50cdc55fee..f7f87c69297 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -98,6 +98,13 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* dststr, apr_size_t dstchars, const char* srcstr); apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, const apr_wchar_t* srcstr); + +/* An arbitrary size that is digestable. True max is a bit less than 32000 */ +#define APR_PATH_MAX 8192 +#define APR_FILE_MAX MAX_PATH +#else /* !APR_HAS_UNICODE_FS */ +#define APR_PATH_MAX MAX_PATH +#define APR_FILE_MAX MAX_PATH #endif #define APR_FILE_BUFSIZE 4096 From 0300c2497ebd6dd7c6d963f45ed0b6ee32ea4983 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 23 Jan 2001 19:56:35 +0000 Subject: [PATCH 1127/7878] Get testfile.c to compile when APR_FILES_AS_SOCKETS is defined. Clean up gcc warnings on the closeapr() atexit function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61108 13f79535-47bb-0310-9956-ffa450edef68 --- test/client.c | 2 +- test/sendfile.c | 2 +- test/server.c | 2 +- test/testargs.c | 2 +- test/testcontext.c | 2 +- test/testdso.c | 2 +- test/testfile.c | 16 +++++++++------- test/testflock.c | 2 +- test/testmmap.c | 2 +- test/testpipe.c | 2 +- test/testproc.c | 2 +- test/testsock.c | 2 +- 12 files changed, 20 insertions(+), 18 deletions(-) diff --git a/test/client.c b/test/client.c index 518edccfae4..8ccc555eae3 100644 --- a/test/client.c +++ b/test/client.c @@ -60,7 +60,7 @@ #define STRLEN 15 -void closeapr(void) +static void closeapr(void) { apr_terminate(); } diff --git a/test/sendfile.c b/test/sendfile.c index 3f4c1c30406..425b5598790 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -90,7 +90,7 @@ int main(void) typedef enum {BLK, NONBLK, TIMEOUT} client_socket_mode_t; -void closeapr(void) +static void closeapr(void) { apr_terminate(); } diff --git a/test/server.c b/test/server.c index 11956fb6687..32871da194d 100644 --- a/test/server.c +++ b/test/server.c @@ -60,7 +60,7 @@ #define STRLEN 15 -void closeapr(void) +static void closeapr(void) { apr_terminate(); } diff --git a/test/testargs.c b/test/testargs.c index 1a0b6b40a7d..aa088e98af4 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -73,7 +73,7 @@ static void maybe_arg(const char *arg) } } -void closeapr(void) +static void closeapr(void) { apr_terminate(); } diff --git a/test/testcontext.c b/test/testcontext.c index f5669f576dc..4755e183e39 100644 --- a/test/testcontext.c +++ b/test/testcontext.c @@ -68,7 +68,7 @@ static apr_status_t string_cleanup(void *data) return APR_SUCCESS; } -void closeapr(void) +static void closeapr(void) { apr_terminate(); } diff --git a/test/testdso.c b/test/testdso.c index 3a0790f741a..d07148a3534 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -11,7 +11,7 @@ #define LIB_NAME "mod_test.so" -void closeapr(void) +static void closeapr(void) { apr_terminate(); } diff --git a/test/testfile.c b/test/testfile.c index 9bd824dc3fc..0bafdd3464e 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -69,7 +69,7 @@ int test_filedel(apr_pool_t *); int testdirs(apr_pool_t *); static void test_read(apr_pool_t *); -void closeapr(void) +static void closeapr(void) { apr_terminate(); } @@ -90,6 +90,9 @@ int main(void) const char *str; char *filename = "test.fil"; char *teststr; +#if APR_FILES_AS_SOCKETS + apr_int32_t num; +#endif if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Couldn't initialize."); @@ -175,19 +178,18 @@ int main(void) fprintf(stdout, "\t\tChecking for incoming data......."); apr_setup_poll(&sdset, 1, context); apr_add_poll_socket(sdset, testsock, APR_POLLIN); - rv = 1; - if (apr_poll(sdset, &rv, -1) != APR_SUCCESS) { + num = 1; + if (apr_poll(sdset, &num, -1) != APR_SUCCESS) { fprintf(stderr, "Select caused an error\n"); exit(-1); } - else if (rv == 0) { - fprintf(stderr, "I should not return until rv == 1\n"); + else if (num == 0) { + fprintf(stderr, "I should not return until num == 1\n"); exit(-1); } fprintf(stdout, "OK\n"); #endif - fprintf(stdout, "\tReading from the file......."); nbytes = strlen("this is a test"); buf = (char *)apr_palloc(context, nbytes + 1); @@ -361,7 +363,7 @@ int testdirs(apr_pool_t *context) fprintf(stdout, "\t\tFile size......."); if (dirent.size != bytes) { - fprintf(stderr, "Got wrong file size %" APR_SIZE_T_FMT "\n", dirent.size); + fprintf(stderr, "Got wrong file size %" APR_OFF_T_FMT "\n", dirent.size); return -1; } fprintf(stdout, "OK\n"); diff --git a/test/testflock.c b/test/testflock.c index bf6ff854476..52a8b36df7e 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -141,7 +141,7 @@ static void do_write(void) printf(" done.\nExiting.\n"); } -void closeapr(void) +static void closeapr(void) { apr_terminate(); } diff --git a/test/testmmap.c b/test/testmmap.c index 0845be47a27..f89c3cd2200 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -69,7 +69,7 @@ */ #define PATH_LEN 255 -void closeapr(void) +static void closeapr(void) { apr_terminate(); } diff --git a/test/testpipe.c b/test/testpipe.c index e6b7d5e257c..c3657a10c81 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -62,7 +62,7 @@ #include <unistd.h> #endif -void closeapr(void) +static void closeapr(void) { apr_terminate(); } diff --git a/test/testproc.c b/test/testproc.c index 215fcc8a9d7..5b66edd821e 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -69,7 +69,7 @@ int test_filedel(void); int testdirs(void); -void closeapr(void) +static void closeapr(void) { apr_terminate(); } diff --git a/test/testsock.c b/test/testsock.c index 263b80a7e88..d672185e192 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -180,7 +180,7 @@ static int run_sendfile(apr_pool_t *context, int number) return 1; } -void closeapr(void) +static void closeapr(void) { apr_terminate(); } From e8e83408cb2a8000acb0b75cf5a21faff5818f73 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Tue, 23 Jan 2001 20:25:48 +0000 Subject: [PATCH 1128/7878] Changed the definition of LIBTOOL_LIBS to use the abs_builddir instead of abs_srcdir. Submitted by: Kevin Pilch-Bisson <kevin@pilch-bisson.net> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61109 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 03fe2b63743..7b397bede57 100644 --- a/configure.in +++ b/configure.in @@ -168,7 +168,7 @@ if test "$ac_cv_enable_shmem" = "mm"; then sharedmem="1" anonymous_shm="1" AC_MSG_RESULT(anonymous) - LIBTOOL_LIBS="$abs_srcdir/shmem/unix/mm/libmm.la" + LIBTOOL_LIBS="$abs_builddir/shmem/unix/mm/libmm.la" elif test "$ac_cv_enable_shmem" = "file"; then sharedmem="1" filebased_shm="1" From 71b5645ac2c0f68f326aa1a927127c73b423d076 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 23 Jan 2001 22:09:53 +0000 Subject: [PATCH 1129/7878] include <limits.h> for PATH_MAX (needed on Solaris) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61110 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index c9aef0f4577..7aa874e027d 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -58,6 +58,9 @@ #ifdef HAVE_SYS_SYSLIMITS_H #include <sys/syslimits.h> #endif +#ifdef HAVE_LIMITS_H +#include <limits.h> +#endif static apr_status_t dir_cleanup(void *thedir) { From 0a2552e0be1c5f89062606e14ad007717b2c0a52 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 24 Jan 2001 01:50:46 +0000 Subject: [PATCH 1130/7878] fix typo Submitted by: Brian Havard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61111 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_want.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_want.h b/include/apr_want.h index 467e11653b0..db5271a92a2 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -83,7 +83,7 @@ #if APR_HAVE_STRINGS_H #include <strings.h> #endif -#undef APR_WANT_STRFUND +#undef APR_WANT_STRFUNC #endif /* --------------------------------------------------------------------- */ From b45bb40208f0e7606010275c74c9a428f7c2675f Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 24 Jan 2001 02:24:43 +0000 Subject: [PATCH 1131/7878] dang. missed one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61112 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index d0f3cb70590..f492cffea4e 100644 --- a/STATUS +++ b/STATUS @@ -1,9 +1,9 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/21 16:08:05 $] +Last modified at [$Date: 2001/01/24 02:24:43 $] Release: - 2.0a9 : released ... + 2.0a9 : released December 12, 2000 2.0a8 : released November 20, 2000 2.0a7 : released October 8, 2000 2.0a6 : released August 18, 2000 From 274ebe77b69add26a787efa8ded39df89eed4d0c Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 24 Jan 2001 08:26:20 +0000 Subject: [PATCH 1132/7878] Use a typesafe function for access objects' pools. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61113 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 ++++---- file_io/os2/open.c | 2 ++ file_io/unix/open.c | 2 ++ file_io/win32/open.c | 1 + include/apr_file_io.h | 9 +++++++-- include/apr_general.h | 10 ---------- include/apr_pools.h | 34 ++++++++++++++++++++++++++++++++-- 7 files changed, 48 insertions(+), 18 deletions(-) diff --git a/STATUS b/STATUS index f492cffea4e..14cf4423170 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/24 02:24:43 $] +Last modified at [$Date: 2001/01/24 08:26:19 $] Release: @@ -18,9 +18,6 @@ RELEASE SHOWSTOPPERS: * Many linkage errors are gpfaulting Apache/win32 in various configs (load mod_dav, for example.) - * Replace APR_GET_POOL macro with a typesafe mechanism to get the pool - from an APR (incomplete) type. - RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Unix, OS2 apr_stat/lstat/getfileinfo were very fast hacks. These @@ -93,6 +90,9 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: (like "int") instead of a size type (apr_size_t). Jeff will do this Real Soon Now (so he says on 20010121). + * add the rest of the pool accessor declare/impl macros. + Status: Greg volunteers + Documentation that needs writing: * API documentation diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 53c772e0a05..8e07c6cd698 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -262,3 +262,5 @@ apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) return APR_SUCCESS; } + +APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/file_io/unix/open.c b/file_io/unix/open.c index dab768f4df4..187a64bda92 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -267,3 +267,5 @@ apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) return APR_SUCCESS; } + +APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/file_io/win32/open.c b/file_io/win32/open.c index e5675a84f24..277e74f113a 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -416,3 +416,4 @@ APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont return APR_SUCCESS; } +APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/include/apr_file_io.h b/include/apr_file_io.h index d6aef2ef5df..474092435c7 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -527,10 +527,15 @@ APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile); +/** + * Get the pool used by the file. + * @return apr_pool_t the pool + * @deffunc apr_pool_t apr_get_file_pool(apr_file_t *f) + */ +APR_POOL_DECLARE_ACCESSOR(file); + #ifdef __cplusplus } #endif #endif /* ! APR_FILE_IO_H */ - - diff --git a/include/apr_general.h b/include/apr_general.h index 77ec5cf3ce1..776bf986b62 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -210,16 +210,6 @@ typedef int apr_signum_t; #define XtOffsetOf(s_type,field) XtOffset(s_type*,field) #endif -/* This is a general apr type that should only ever be used in the APR_GET_POOL - * macro. This is basically used to let us get the pool from any apr type - * that has one. - */ -struct apr_t { - apr_pool_t *pool; -}; - -#define APR_GET_POOL(foo) \ - ((struct apr_t *)foo)->pool /* A couple of prototypes for functions in case some platform doesn't * have it diff --git a/include/apr_pools.h b/include/apr_pools.h index a5c5f171594..fe908a5ac27 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -386,9 +386,39 @@ APR_DECLARE(void) apr_cleanup_for_exec(void); */ APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data); -/* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t - * will not be destroyed before the parent pool +/* + * Pool accessor functions. + * + * These standardized function are used by opaque (APR) data types to return + * the apr_pool_t that is associated with the data type. + * + * APR_POOL_DECLARE_ACCESSOR() is used in a header file to declare the + * accessor function. A typical usage and result would be: + * + * APR_POOL_DECLARE_ACCESSOR(file); + * becomes: + * APR_DECLARE(apr_pool_t *) apr_get_file_pool(apr_file_t *ob); + * + * In the implementation, the APR_POOL_IMPLEMENT_ACCESSOR() is used to + * actually define the function. It assumes the field is named "pool". For + * data types with a different field name (e.g. "cont" or "cntxt") the + * APR_POOL_IMPLEMENT_ACCESSOR_X() macro should be used. + * + * Note: the linkage is specified for APR. It would be possible to expand + * the macros to support other linkages. */ +#define APR_POOL_DECLARE_ACCESSOR(typename) \ + APR_DECLARE(apr_pool_t *) apr_get_##typename##_pool \ + (apr_##typename##_t *ob); + +#define APR_POOL_IMPLEMENT_ACCESSOR(typename) \ + APR_POOL_IMPLEMENT_ACCESSOR_X(typename, pool) +#define APR_POOL_IMPLEMENT_ACCESSOR_X(typename, fieldname) \ + APR_DECLARE(apr_pool_t *) apr_get_##typename##_pool \ + (apr_##typename##_t *ob) { return ob->fieldname; } + +/* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t + * will not be destroyed before the parent pool */ #ifndef APR_POOL_DEBUG #ifdef apr_pool_join #undef apr_pool_join From d8fa81a621ef6a67ae2af5b12c205d785017e5cf Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Wed, 24 Jan 2001 09:44:49 +0000 Subject: [PATCH 1133/7878] add a general-failure error code, for when a more specific code doesn't apply or isn't defined. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61114 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index cde954414c0..8cab6a2b52e 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -176,6 +176,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * APR_ENOSHMAVAIL There is no more shared memory available * APR_EDSOOPEN APR was unable to open the dso object. For more * information call apr_dso_error(). + * APR_EGENERAL General failure (specific information not available) * </PRE> * * <PRE> @@ -229,7 +230,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_ENOSOCKET (APR_OS_START_ERROR + 11) #define APR_ENOTHREAD (APR_OS_START_ERROR + 12) #define APR_ENOTHDKEY (APR_OS_START_ERROR + 13) -/* empty slot: +14 */ +#define APR_EGENERAL (APR_OS_START_ERROR + 14) #define APR_ENOSHMAVAIL (APR_OS_START_ERROR + 15) /* empty slot: +16 */ /* empty slot: +17 */ @@ -251,7 +252,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ENOSOCKET(s) ((s) == APR_ENOSOCKET) #define APR_STATUS_IS_ENOTHREAD(s) ((s) == APR_ENOTHREAD) #define APR_STATUS_IS_ENOTHDKEY(s) ((s) == APR_ENOTHDKEY) -/* empty slot: +14 */ +#define APR_STATUS_IS_EGENERAL(s) ((s) == APR_EGENERAL) #define APR_STATUS_IS_ENOSHMAVAIL(s) ((s) == APR_ENOSHMAVAIL) /* empty slot: +16 */ /* empty slot: +17 */ From 2d6c532e6bff08321cf5f7249ccfab2df56544f0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 24 Jan 2001 12:49:06 +0000 Subject: [PATCH 1134/7878] get rid of the extra semicolon, as it leads to a bazillion warnings on tru64 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61115 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index fe908a5ac27..0315d29e50a 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -409,7 +409,7 @@ APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data); */ #define APR_POOL_DECLARE_ACCESSOR(typename) \ APR_DECLARE(apr_pool_t *) apr_get_##typename##_pool \ - (apr_##typename##_t *ob); + (apr_##typename##_t *ob) #define APR_POOL_IMPLEMENT_ACCESSOR(typename) \ APR_POOL_IMPLEMENT_ACCESSOR_X(typename, pool) From ce189d4775ba9aa269d5342b6daddf5ebbf12a63 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 24 Jan 2001 15:48:00 +0000 Subject: [PATCH 1135/7878] The csize solution does solve BeOS R4.5, so back that out of all unix paths until some better logic (al la libtool) is coded. The asize field is insufficiently defined, so it is removed. Submitted by: Sam TH <sam@uchicago.edu> Reviewed by: Greg Stein, Will Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61116 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 14 ++++++++++---- include/apr_file_info.h | 5 +---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index d09f8a1e837..821f3e9d651 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -97,13 +97,19 @@ static apr_status_t fill_out_finfo(apr_finfo_t *finfo, struct stat info, apr_ansi_time_to_apr_time(&finfo->atime, info.st_atime); apr_ansi_time_to_apr_time(&finfo->mtime, info.st_mtime); apr_ansi_time_to_apr_time(&finfo->ctime, info.st_ctime); - if (wanted & APR_FINFO_CSIZE) { - finfo->csize = info.st_blocks * 512; - finfo->valid |= APR_FINFO_CSIZE; - } + /* ### needs to be revisited + * if (wanted & APR_FINFO_CSIZE) { + * finfo->csize = info.st_blocks * 512; + * finfo->valid |= APR_FINFO_CSIZE; + * } + */ if (finfo->filetype == APR_LNK) { finfo->valid |= APR_FINFO_LINK; } + + if (wanted & ~finfo->valid) + return APR_INCOMPLETE; + return APR_SUCCESS; } diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 770f2d602c8..d6ad956155b 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -141,8 +141,7 @@ typedef struct apr_finfo_t apr_finfo_t; #define APR_FINFO_CTIME 0x00000020 #define APR_FINFO_ATIME 0x00000040 #define APR_FINFO_SIZE 0x00000100 -#define APR_FINFO_ASIZE 0x00000200 -#define APR_FINFO_CSIZE 0x00000400 +#define APR_FINFO_CSIZE 0x00000200 #define APR_FINFO_DEV 0x00001000 #define APR_FINFO_INODE 0x00002000 #define APR_FINFO_NLINK 0x00004000 @@ -190,8 +189,6 @@ struct apr_finfo_t { apr_int16_t nlink; /** The size of the file */ apr_off_t size; - /** The space allocated for the file */ - apr_off_t asize; /** The storage size consumed by the file */ apr_off_t csize; /** The time the file was last accessed */ From 8d508e50260c1e224a9ce5f0efbae3d68c3453dd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 24 Jan 2001 16:16:35 +0000 Subject: [PATCH 1136/7878] The last patch to unix/filestat.c added the APR_INCOMPLETE. This patch teaches apr_dir_read to respect that result and return it itself. Proposed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61117 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 7aa874e027d..82784e6bc3b 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -147,8 +147,10 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, return ret; } - /* What we already know */ - /* XXX: Optimize here with d_fileno, d_type etc by platform */ + /* What we already know - and restrict the wanted test below to stat + * only if stat will give us what this platform supports, and we can't + * get it from the platform. + * XXX: Optimize here with d_fileno, d_type etc by platform */ wanted &= ~(APR_FINFO_NAME); if (wanted) { @@ -162,15 +164,28 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, /* ??? Or lstat below? What is it we really want? */ ret = apr_stat(finfo, fspec, wanted, thedir->cntxt); } - if (!wanted || ret) { + + if (wanted && (ret == APR_SUCCESS || ret == APR_INCOMPLETE)) { + wanted &= ~finfo->valid; + ret = APR_SUCCESS; + } + else { + /* We don't bail because we fail to stat, when we are only -required- + * to readdir... but the result will be APR_INCOMPLETE + */ finfo->cntxt = thedir->cntxt; finfo->valid = 0; } + /* We passed a stack name that is now gone */ finfo->fname = NULL; finfo->valid |= APR_FINFO_NAME; /* XXX: Optimize here with d_fileno, d_type etc by platform */ finfo->name = thedir->entry->d_name; + + if (wanted) + return APR_INCOMPLETE; + return APR_SUCCESS; } From db4aacadd07d718902e687980d76df153e25a447 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 24 Jan 2001 18:24:06 +0000 Subject: [PATCH 1137/7878] Solve a break, now that we don't do anything with INODE from a readdir call on unix. Reported by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61118 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index d6ad956155b..923c47dd9eb 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -159,7 +159,7 @@ typedef struct apr_finfo_t apr_finfo_t; #define APR_FINFO_OWNER 0x00030000 /* user and group */ #define APR_FINFO_PROT 0x00700000 /* all protections */ #define APR_FINFO_NORM 0x0073b170 /* an atomic unix apr_stat() */ -#define APR_FINFO_DIRENT 0x01002000 /* an atomic unix apr_dir_read() */ +#define APR_FINFO_DIRENT 0x02000000 /* an atomic unix apr_dir_read() */ /** * The file information structure. This is analogous to the POSIX From c631ccc1293da2ae7150fe082a4e09aa35703b86 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 24 Jan 2001 19:48:11 +0000 Subject: [PATCH 1138/7878] Fix someone else's typo in Unix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61119 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 821f3e9d651..4db530d12df 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -81,11 +81,11 @@ static apr_filetype_e filetype_from_mode(int mode) return type; } -static apr_status_t fill_out_finfo(apr_finfo_t *finfo, struct stat info, +static apr_status_t fill_out_finfo(apr_finfo_t *finfo, struct stat *info, apr_int32_t wanted) { - finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_OWNER | - APR_FINFO_PROT; + finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK + | APR_FINFO_OWNER | APR_FINFO_PROT; finfo->protection = apr_unix_mode2perms(info.st_mode); finfo->filetype = filetype_from_mode(info.st_mode); finfo->user = info.st_uid; @@ -121,7 +121,7 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, if (fstat(thefile->filedes, &info) == 0) { finfo->cntxt = thefile->cntxt; finfo->fname = thefile->fname; - return fill_out_finfo(finfo, info, wanted); + return fill_out_finfo(finfo, &info, wanted); } else { return errno; @@ -151,7 +151,7 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, if (srv == 0) { finfo->cntxt = cont; finfo->fname = fname; - return fill_out_finfo(finfo, info, wanted); + return fill_out_finfo(finfo, &info, wanted); } else { #if !defined(ENOENT) || !defined(ENOTDIR) From 7eb26f1f8aa50da80602a414964672a167f3f754 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 24 Jan 2001 19:49:05 +0000 Subject: [PATCH 1139/7878] get the wording and formatting of a couple of messages more consistent with other configure messages git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61120 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 7b397bede57..db3f1442417 100644 --- a/configure.in +++ b/configure.in @@ -783,7 +783,7 @@ fi dnl #----------------------------- Checking for Networking Support echo $ac_n "${nl}Checking for Networking support...${nl}" -AC_MSG_CHECKING(looking for in_addr in netinet/in.h) +AC_MSG_CHECKING(for in_addr in netinet/in.h) AC_TRY_COMPILE([ #include <sys/types.h> #include <netinet/in.h> @@ -795,7 +795,7 @@ msg=yes ] , [ have_in_addr="0" msg=no ]) AC_MSG_RESULT([$msg]) -echo $ac_n "checking if fd == socket on this platform... " +AC_MSG_CHECKING("if fd == socket on this platform") if test "x$file_as_socket" = "x" ; then file_as_socket="1"; echo "yes" From f1f480d6489bf4cd032e454b33ca9fea39448dce Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 24 Jan 2001 21:11:52 +0000 Subject: [PATCH 1140/7878] get filestat.c to compile again git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61121 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 4db530d12df..a8ac57a1e10 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -86,20 +86,20 @@ static apr_status_t fill_out_finfo(apr_finfo_t *finfo, struct stat *info, { finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK | APR_FINFO_OWNER | APR_FINFO_PROT; - finfo->protection = apr_unix_mode2perms(info.st_mode); - finfo->filetype = filetype_from_mode(info.st_mode); - finfo->user = info.st_uid; - finfo->group = info.st_gid; - finfo->size = info.st_size; - finfo->inode = info.st_ino; - finfo->device = info.st_dev; - finfo->nlink = info.st_nlink; - apr_ansi_time_to_apr_time(&finfo->atime, info.st_atime); - apr_ansi_time_to_apr_time(&finfo->mtime, info.st_mtime); - apr_ansi_time_to_apr_time(&finfo->ctime, info.st_ctime); + finfo->protection = apr_unix_mode2perms(info->st_mode); + finfo->filetype = filetype_from_mode(info->st_mode); + finfo->user = info->st_uid; + finfo->group = info->st_gid; + finfo->size = info->st_size; + finfo->inode = info->st_ino; + finfo->device = info->st_dev; + finfo->nlink = info->st_nlink; + apr_ansi_time_to_apr_time(&finfo->atime, info->st_atime); + apr_ansi_time_to_apr_time(&finfo->mtime, info->st_mtime); + apr_ansi_time_to_apr_time(&finfo->ctime, info->st_ctime); /* ### needs to be revisited * if (wanted & APR_FINFO_CSIZE) { - * finfo->csize = info.st_blocks * 512; + * finfo->csize = info->st_blocks * 512; * finfo->valid |= APR_FINFO_CSIZE; * } */ From 54f0853ae4166c30b361bdee96db63d06730b52d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 24 Jan 2001 21:13:13 +0000 Subject: [PATCH 1141/7878] Transpose the order of evaluation for APR_LNK on win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61122 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index f27bb7520f7..9e0ecd5b4f8 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -238,13 +238,13 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, * the BLK, CHR, and other oddballs, since they should -not- occur in this * context. */ - if (thedir->n.entry->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - finfo->filetype = APR_DIR; + if (thedir->n.entry->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { + finfo->filetype = APR_LNK; finfo->valid |= APR_FINFO_TYPE; } - else if (thedir->n.entry->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { - finfo->filetype = APR_LNK; - finfo->valid |= APR_FINFO_TYPE | APR_FINFO_LINK; + else if (thedir->n.entry->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + finfo->filetype = APR_DIR; + finfo->valid |= APR_FINFO_TYPE; } else { finfo->filetype = APR_REG; From 76dba1e6f157e9eccc266ba34c1c934c9b481ae4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 24 Jan 2001 23:33:59 +0000 Subject: [PATCH 1142/7878] Fix an error check logic which was broken with 1.43. This caused apr_dir_read() to fail for builds which use readdir_r(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61123 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 82784e6bc3b..2e0f1501578 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -125,7 +125,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, /* Avoid the Linux problem where at end-of-directory thedir->entry * is set to NULL, but ret = APR_SUCCESS. */ - if(!ret || thedir->entry != retent) + if(!ret && thedir->entry != retent) ret = APR_ENOENT; #else thedir->entry = readdir(thedir->dirstruct); From b34d6ec4ea05f1205c646960b319c51e97349077 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Thu, 25 Jan 2001 09:17:32 +0000 Subject: [PATCH 1143/7878] Get dependencies working again after change to libtool. The targets need to be the .lo files now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61124 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/mkdep.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/mkdep.sh b/helpers/mkdep.sh index 1e18518a447..510bdc02fbf 100755 --- a/helpers/mkdep.sh +++ b/helpers/mkdep.sh @@ -8,5 +8,5 @@ # occurs during the process # sed -ne '1,/^# DO NOT REMOVE/p' Makefile > Makefile.new \ - && gcc -MM $* >> Makefile.new \ + && gcc -MM $* | sed -e "s/\.o:/\.lo:/" >> Makefile.new \ && mv Makefile.new Makefile From 89482012268c89b0a8e74422d2a8c231f40544b9 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Thu, 25 Jan 2001 11:34:55 +0000 Subject: [PATCH 1144/7878] Get OS/2 dir & stat code working with current API. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61125 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/dir.c | 51 ++++++++++++++---------------------------- file_io/os2/filestat.c | 10 ++++----- 2 files changed, 22 insertions(+), 39 deletions(-) diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index c03e2863475..fc7c43223a6 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -123,50 +123,33 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, rv = DosFindNext(thedir->handle, &thedir->entry, sizeof(thedir->entry), &entries); } - /* No valid bit flag to test here - do we want one? */ finfo->cntxt = thedir->cntxt; finfo->fname = NULL; + finfo->valid = 0; - if (rv == 0 && entries == 1) - { - /* XXX: Optimize the heck out of this case - whatever we know, report, - * and then stat only if we must (e.g. wanted & APR_FINFO_TYPE) - */ + if (rv == 0 && entries == 1) { thedir->validentry = TRUE; - wanted &= ~(APR_FINFO_NAME | APR_FINFO_MTIME | APR_FINFO_SIZE); - - if (wanted == APR_FINFO_TYPE && thedir->entry.attrFile & FILE_DIRECTORY) - wanted = 0; - - if (wanted) - { - char fspec[_MAXPATH]; - int off; - apr_strcpyn(fspec, sizeof(fspec), thedir->dirname); - off = strlen(fspec); - if (fspec[off - 1] != '/') - fspec[off++] = '/'; - apr_strcpyn(fspec + off, sizeof(fspec) - off, thedir->entry->d_name); - /* ??? Or lstat below?, I know, OS2 doesn't do symlinks, yet */ - ret = apr_stat(finfo, wanted, fspec, thedir->cntxt); - } - if (!wanted || ret) { - finfo->cntxt = thedir->cntxt; - finfo->valid = 0; - } /* We passed a name off the stack that has popped */ finfo->fname = NULL; - finfo->valid |= APR_FINFO_NAME | APR_FINFO_MTIME | APR_FINFO_SIZE; finfo->size = thedir->entry.cbFile; - apr_os2_time_to_apr_time(finfo->mtime, thedir->entry.fdateLastWrite, + finfo->csize = thedir->entry.cbFileAlloc; + + /* Only directories & regular files show up in directory listings */ + finfo->filetype = (thedir->entry.attrFile & FILE_DIRECTORY) ? APR_DIR : APR_REG; + + apr_os2_time_to_apr_time(&finfo->mtime, thedir->entry.fdateLastWrite, thedir->entry.ftimeLastWrite); + apr_os2_time_to_apr_time(&finfo->atime, thedir->entry.fdateLastAccess, + thedir->entry.ftimeLastAccess); + apr_os2_time_to_apr_time(&finfo->ctime, thedir->entry.fdateCreation, + thedir->entry.ftimeCreation); + finfo->name = thedir->entry.achName; - if (thedir->entry.attrFile & FILE_DIRECTORY) { - finfo->filetype = APR_DIR; - finfo->valid |= APR_FINFO_TYPE; - } - + finfo->valid = APR_FINFO_NAME | APR_FINFO_MTIME | APR_FINFO_ATIME | + APR_FINFO_CTIME | APR_FINFO_TYPE | APR_FINFO_SIZE | + APR_FINFO_CSIZE; + return APR_SUCCESS; } diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 280716c0f49..8a28e17690f 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -75,12 +75,15 @@ static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus) finfo->inode = 0; finfo->device = 0; finfo->size = fstatus->cbFile; + finfo->csize = fstatus->cbFileAlloc; apr_os2_time_to_apr_time(&finfo->atime, fstatus->fdateLastAccess, fstatus->ftimeLastAccess ); apr_os2_time_to_apr_time(&finfo->mtime, fstatus->fdateLastWrite, fstatus->ftimeLastWrite ); apr_os2_time_to_apr_time(&finfo->ctime, fstatus->fdateCreation, fstatus->ftimeCreation ); + finfo->valid |= APR_FINFO_TYPE | APR_FINFO_PROT | APR_FINFO_SIZE | + APR_FINFO_CSIZE | APR_FINFO_MTIME | APR_FINFO_CTIME | APR_FINFO_ATIME; } @@ -160,15 +163,12 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, rc = DosQueryPathInfo(fname, FIL_STANDARD, &fstatus, sizeof(fstatus)); if (rc == 0) { - /* XXX: This is wrong, but it will work for today */ - finfo->valid = APR_FINFO_NORM; FS3_to_finfo(finfo, &fstatus); return APR_SUCCESS; } else if (rc == ERROR_INVALID_ACCESS) { - /* XXX: This is wrong, but it will work for today */ - finfo->valid = APR_FINFO_NORM; memset(finfo, 0, sizeof(apr_finfo_t)); - finfo->protection = 0444; + finfo->valid = APR_FINFO_TYPE | APR_FINFO_PROT; + finfo->protection = 0666; finfo->filetype = APR_CHR; return APR_SUCCESS; } From a4a03e7de05a26ad0b6db6a4eea350f2f05e2d06 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Thu, 25 Jan 2001 12:13:34 +0000 Subject: [PATCH 1145/7878] Add code to allow APR to track the socket options it has set. This code aims to minimise the number of syscalls required to determine the state of a socket. The next step is to change the os_cork/os_uncork code to use basic apr calls and hence make use of this ability. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61126 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 7 ++ include/arch/os2/networkio.h | 1 + include/arch/unix/networkio.h | 1 + include/arch/win32/networkio.h | 1 + network_io/unix/sockets.c | 7 ++ network_io/unix/sockopt.c | 149 +++++++++++++++++++++++++-------- 6 files changed, 132 insertions(+), 34 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index a235ecd5628..6472c9cb721 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -95,6 +95,13 @@ extern "C" { #define APR_SO_RCVBUF 128 #define APR_SO_DISCONNECTED 256 #define APR_TCP_NODELAY 512 +#define APR_TCP_NOPUSH 1024 +#define APR_RESET_NODELAY 2048 /* This flag is ONLY set internally + * when we set APR_TCP_NOPUSH with + * APR_TCP_NODELAY set to tell us that + * APR_TCP_NODELAY should be truned on + * again when NOPUSH is turned off + */ #define APR_POLLIN 0x001 #define APR_POLLPRI 0x002 diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index facde795d9b..d4e855b0069 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -72,6 +72,7 @@ struct apr_socket_t { int nonblock; int local_port_unknown; int local_interface_unknown; + apr_int32_t netmask; }; struct apr_pollfd_t { diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 7fe3538a740..75791632cc8 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -130,6 +130,7 @@ struct apr_socket_t { #endif int local_port_unknown; int local_interface_unknown; + apr_int32_t netmask; }; struct apr_pollfd_t { diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index e9e1b9bff68..e3bfd49d4fa 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -67,6 +67,7 @@ struct apr_socket_t { apr_int32_t disconnected; int local_port_unknown; int local_interface_unknown; + apr_int32_t netmask; }; struct apr_pollfd_t { diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 2073fa18ec2..77a39501bef 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -100,6 +100,13 @@ static void set_socket_vars(apr_socket_t *sock, int family) sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin6.sin6_addr); sock->remote_addr->ipaddr_len = sizeof(struct in6_addr); } +#endif + sock->netmask = 0; +#if defined(BEOS) && !defined(BEOS_BONE) + /* BeOS pre-BONE has TCP_NODELAY on by default and it can't be + * switched off! + */ + sock->netmask |= APR_TCP_NODELAY; #endif } static void alloc_socket(apr_socket_t **new, apr_pool_t *p) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 400d6ea8bcb..e7fe8e931dc 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -55,6 +55,19 @@ #include "networkio.h" #include "apr_strings.h" +static int is_option_set(apr_int32_t mask, apr_int32_t option) +{ + return (mask & option) == option; +} + +static void set_option(apr_int32_t *mask, apr_int32_t option, int on) +{ + if (on) + *mask |= option; + else + *mask &= ~option; +} + static apr_status_t soblock(int sd) { /* BeOS uses setsockopt at present for non blocking... */ @@ -121,49 +134,67 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o one = 0; if (opt & APR_SO_KEEPALIVE) { #ifdef SO_KEEPALIVE - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { - return errno; + if (on != is_option_set(sock->netmask, APR_SO_KEEPALIVE)){ + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { + return errno; + } + set_option(&sock->netmask,APR_SO_KEEPALIVE, on); } #else return APR_ENOTIMPL; #endif } if (opt & APR_SO_DEBUG) { - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { - return errno; + if (on != is_option_set(sock->netmask, APR_SO_DEBUG)){ + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { + return errno; + } + set_option(&sock->netmask, APR_SO_DEBUG, on); } } if (opt & APR_SO_REUSEADDR) { - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { - return errno; + if (on != is_option_set(sock->netmask, APR_SO_REUSEADDR)){ + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { + return errno; + } + set_option(&sock->netmask, APR_SO_REUSEADDR, on); } } if (opt & APR_SO_SNDBUF) { #ifdef SO_SNDBUF - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { - return errno; + if (is_option_set(sock->netmask, APR_SO_SNDBUF) != on){ + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { + return errno; + } + set_option(&sock->netmask, APR_SO_SNDBUF, on); } #else return APR_ENOTIMPL; #endif } if (opt & APR_SO_NONBLOCK) { - if (on) { - if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) - return stat; - } - else { - if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) - return stat; + if (is_option_set(sock->netmask, APR_SO_NONBLOCK) != on){ + if (on) { + if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) + return stat; + } + else { + if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) + return stat; + } + set_option(&sock->netmask, APR_SO_NONBLOCK, on); } } if (opt & APR_SO_LINGER) { #ifdef SO_LINGER - struct linger li; - li.l_onoff = on; - li.l_linger = MAX_SECS_TO_LINGER; - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { - return errno; + if (is_option_set(sock->netmask, APR_SO_LINGER) != on){ + struct linger li; + li.l_onoff = on; + li.l_linger = MAX_SECS_TO_LINGER; + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { + return errno; + } + set_option(&sock->netmask, APR_SO_LINGER, on); } #else return APR_ENOTIMPL; @@ -171,20 +202,30 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o } if (opt & APR_SO_TIMEOUT) { /* don't do the fcntl foo more than needed */ - if (on >= 0 && sock->timeout < 0 - && (stat = sononblock(sock->socketdes)) != APR_SUCCESS) { - return stat; - } - else if (on < 0 && sock->timeout >= 0 - && (stat = soblock(sock->socketdes)) != APR_SUCCESS) { - return stat; + if (on >= 0 && sock->timeout < 0){ + if (is_option_set(sock->netmask, APR_SO_NONBLOCK) != 1){ + if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS){ + return stat; + } + } } + else if (on < 0 && sock->timeout >= 0){ + if (is_option_set(sock->netmask, APR_SO_NONBLOCK) != 0){ + if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) { + return stat; + } + } + } sock->timeout = on; + set_option(&sock->netmask, APR_SO_TIMEOUT, on); } if (opt & APR_TCP_NODELAY) { #if defined(TCP_NODELAY) - if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { - return errno; + if (is_option_set(sock->netmask, APR_TCP_NODELAY) != on){ + if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { + return errno; + } + set_option(&sock->netmask, APR_TCP_NODELAY, on); } #else /* BeOS pre-BONE has TCP_NODELAY set by default. @@ -199,17 +240,57 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o return APR_ENOTIMPL; #endif } + if (opt & APR_TCP_NOPUSH){ +#if APR_TCP_NOPUSH_FLAG + if (is_option_set(sock->netmask, APR_TCP_NOPUSH) != on){ + /* OK we're going to change some settings here... */ + /* TCP_NODELAY is mutually exclusive, so do we have it set? */ + if (is_option_set(sock->netmask, APR_TCP_NODELAY) == 1 && on){ + /* If we want to set NOPUSH then if we have the TCP_NODELAY + * flag set we need to switch it off... + */ + int tmpflag = 1; + if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, + (void*)&tmpflag, sizeof(int)) == -1){ + return errno; + } + set_option(&sock->netmask, APR_RESET_NODELAY, 1); + set_option(&sock->netmask, APR_TCP_NODELAY, 0); + } else if (on){ + set_option(&sock->netmask, APR_RESET_NODELAY, 0); + } + /* OK, now we can just set the TCP_NOPUSH flag accordingly...*/ + if (setsockopt(sock->socketdes, IPPROTO_TCP, APR_TCP_NOPUSH_FLAG, + (void*)&on, sizeof(int)) == -1){ + return errno; + } + set_option(&sock->netmask, APR_TCP_NOPUSH, on); + if (!on && is_option_set(sock->netmask, APR_RESET_NODELAY)){ + int tmpflag = 1; + if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, + (void*)&tmpflag, sizeof(int)) == -1){ + return errno; + } + set_option(&sock->netmask, APR_RESET_NODELAY,0); + set_option(&sock->netmask, APR_TCP_NODELAY, 1); + } + } +#else + return APR_ENOTIMPL; +#endif + } + return APR_SUCCESS; } apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch(opt) { - case APR_SO_TIMEOUT: - *on = sock->timeout; - break; - default: - return APR_EINVAL; + case APR_SO_TIMEOUT: + *on = sock->timeout; + break; + default: + *on = is_option_set(sock->netmask, opt); } return APR_SUCCESS; } From 692fbd63e6a6438f3deb72593de6fa8c36febd49 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Thu, 25 Jan 2001 12:19:38 +0000 Subject: [PATCH 1146/7878] Add a small test program for testing the new socket options code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61127 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 + test/testsockopt.c | 220 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 224 insertions(+) create mode 100644 test/testsockopt.c diff --git a/test/Makefile.in b/test/Makefile.in index eca16e43909..2f475a6d2a2 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -17,6 +17,7 @@ TARGETS = \ testdso@EXEEXT@ \ testoc@EXEEXT@ \ testuuid@EXEEXT@ \ + testsockopt@EXEEXT@ \ occhild@EXEEXT@ \ mod_test.so @@ -91,4 +92,7 @@ testpipe@EXEEXT@: testpipe.lo testuuid@EXEEXT@: testuuid.lo $(LINK) testuuid.lo $(ALL_LIBS) +testsockopt@EXEEXT@: testsockopt.lo + $(LINK) testsockopt.lo $(ALL_LIBS) + # DO NOT REMOVE diff --git a/test/testsockopt.c b/test/testsockopt.c new file mode 100644 index 00000000000..236820d927d --- /dev/null +++ b/test/testsockopt.c @@ -0,0 +1,220 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "apr_network_io.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_lib.h" +#ifdef BEOS +#include <unistd.h> +#endif + +static void failure(apr_socket_t *sock) +{ + apr_close_socket(sock); + printf("Failed!\n"); + exit(-1); +} + +static void failureno(apr_socket_t *sock) +{ + apr_close_socket(sock); + printf("No!\n"); + exit(-1); +} + +int main(void) +{ + apr_pool_t *context; + apr_pool_t *cont2; + apr_socket_t *sock = NULL; + apr_status_t stat = 0; + apr_int32_t ck; + + if (apr_initialize() != APR_SUCCESS) { + fprintf(stderr, "Couldn't initialize."); + exit(-1); + } + atexit(apr_terminate); + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + fprintf(stderr, "Couldn't allocate context."); + exit(-1); + } + if (apr_create_pool(&cont2, context) != APR_SUCCESS) { + fprintf(stderr, "Couldn't allocate context."); + exit(-1); + } + + printf("Testing socket option functions.\n"); + + printf("\tCreating socket.........................."); + if ((stat = apr_create_socket(&sock, APR_INET, SOCK_STREAM, context)) + != APR_SUCCESS){ + printf("Failed to create a socket!\n"); + exit(-1); + } + printf("OK\n"); + + printf ("\tTrying to set APR_SO_KEEPALIVE..........."); + if (apr_setsocketopt(sock, APR_SO_KEEPALIVE, 1) != APR_SUCCESS){ + apr_close_socket(sock); + printf("Failed!\n"); + exit (-1); + } + printf ("OK\n"); + + printf("\tChecking if we recorded it..............."); + if (apr_getsocketopt(sock, APR_SO_KEEPALIVE, &ck) != APR_SUCCESS){ + apr_close_socket(sock); + fprintf(stderr,"Failed\n"); + exit(-1); + } + if (ck != 1){ + apr_close_socket(sock); + printf("No (%d)\n", ck); + exit(-1); + } + printf("Yes\n"); + + printf("\tTrying to set APR_SO_DEBUG..............."); + if (apr_setsocketopt(sock, APR_SO_DEBUG, 1) != APR_SUCCESS){ + apr_close_socket(sock); + printf("Failed\n"); + exit (-1); + } + printf ("OK\n"); + + printf("\tChecking if we recorded it..............."); + if (apr_getsocketopt(sock, APR_SO_DEBUG, &ck) != APR_SUCCESS){ + apr_close_socket(sock); + printf("Failed!\n"); + exit (-1); + } + if (ck != 1){ + printf ("No (%d)\n", ck); + apr_close_socket(sock); + exit (-1); + } + printf ("Yes\n"); + + printf ("\tTrying to remove APR_SO_KEEPALIVE........"); + if (apr_setsocketopt(sock, APR_SO_KEEPALIVE, 0) != APR_SUCCESS){ + apr_close_socket(sock); + printf("Failed!\n"); + exit (-1); + } + printf ("OK\n"); + + printf ("\tDid we record the removal................"); + if (apr_getsocketopt(sock, APR_SO_KEEPALIVE, &ck) != APR_SUCCESS){ + apr_close_socket(sock); + printf("Didn't get value!\n"); + exit(-1); + } + if (ck != 0){ + failureno(sock); + } + printf ("Yes\n"); + +#if APR_HAVE_CORKABLE_TCP + printf ("\tTesting APR_TCP_NOPUSH!\n"); + printf("\t\tSetting APR_TCP_NODELAY.........."); + if (apr_setsocketopt(sock, APR_TCP_NODELAY, 1) != APR_SUCCESS){ + failure(sock); + } + printf("OK\n"); + printf("\t\tSetting APR_TCP_NOPUSH..........."); + if (apr_setsocketopt(sock, APR_TCP_NOPUSH, 1) != APR_SUCCESS){ + failure(sock); + } + printf("OK\n"); + printf("\t\tChecking on APR_TCP_NODELAY......"); + if (apr_getsocketopt(sock, APR_TCP_NODELAY, &ck) != APR_SUCCESS){ + failure(sock); + } + if (ck != 0){ + failureno(sock); + } + printf("Yes (not set)\n"); + printf("\t\tUnsetting APR_TCP_NOPUSH........."); + if (apr_setsocketopt(sock, APR_TCP_NOPUSH, 0) != APR_SUCCESS){ + failure(sock); + } + printf("OK\n"); + + printf("\t\tChecking on APR_TCP_NODELAY......"); + if (apr_getsocketopt(sock, APR_TCP_NODELAY, &ck) != APR_SUCCESS){ + failure(sock); + } + if (ck != 1){ + failureno(sock); + } + printf("Yes (set)\n"); + + printf ("\tSeems OK!\n"); +#endif + + printf("\tTrying to close the socket..............."); + if ((stat = apr_close_socket(sock)) != APR_SUCCESS){ + printf("Failed to close the socket!\n"); + exit(-1); + } + printf("OK\n"); + + return 1; +} From f1913df958e371797756304124955a88c44ab782 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Thu, 25 Jan 2001 12:20:29 +0000 Subject: [PATCH 1147/7878] Oh, and add it to cvsignore... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61128 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.cvsignore b/test/.cvsignore index ba64b9c0839..a2faf05d0ca 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -27,3 +27,4 @@ testsuite.opt testsuite.ncb testfile.tmp testflock +testsockopt From a143fc744d1aeafd08ee071d3d4c4b9314aa15f8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 25 Jan 2001 15:33:58 +0000 Subject: [PATCH 1148/7878] * open.c (apr_open): Fixed deferencing of potentially NULL pointer (and incorrect logic, at any rate) in call to CreateFileA( ). Submitted by: Mike Pilato <cmpilato@collab.net> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61129 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 277e74f113a..3d940e53252 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -246,7 +246,7 @@ APR_DECLARE(apr_status_t) apr_open(apr_file_t **new, const char *fname, } else #endif - handle = CreateFileA((*new)->fname, oflags, sharemode, + handle = CreateFileA(fname, oflags, sharemode, NULL, createflags, attributes, 0); if (handle == INVALID_HANDLE_VALUE) { From afce0276babf29dae22b2ebf258ee5fb05df8df3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 25 Jan 2001 20:29:39 +0000 Subject: [PATCH 1149/7878] Replaced use of unsupported function MoveFileEx() with MoveFile() for pre-Windows NT (Win95/98) OS levels. This may require a look-see in the future, but adds functionality where none was present. Submitted by: Mike Pilato <cmpilato@collab.net> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61130 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 3d940e53252..83b0e4c8a6a 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -340,10 +340,10 @@ APR_DECLARE(apr_status_t) apr_rename_file(const char *frompath, const char *topath, apr_pool_t *cont) { -#if APR_HAS_UNICODE_FS apr_oslevel_e os_level; if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { +#if APR_HAS_UNICODE_FS apr_wchar_t wfrompath[APR_PATH_MAX], wtopath[APR_PATH_MAX]; apr_status_t rv; if (rv = utf8_to_unicode_path(wfrompath, sizeof(wfrompath) @@ -357,12 +357,32 @@ APR_DECLARE(apr_status_t) apr_rename_file(const char *frompath, if (MoveFileExW(wfrompath, wtopath, MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED)) return APR_SUCCESS; - } - else -#endif +#else if (MoveFileEx(frompath, topath, MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED)) return APR_SUCCESS; +#endif + } + else + { + /* Windows 95 and 98 do not support MoveFileEx, so we'll use + * the old MoveFile function. However, MoveFile requires that + * the new file not already exist...so we have to delete that + * file if it does. Perhaps we should back up the to-be-deleted + * file in case something happens? + */ + HANDLE handle = INVALID_HANDLE_VALUE; + + if ((handle = CreateFile(topath, GENERIC_WRITE, 0, 0, + OPEN_EXISTING, 0, 0 )) != INVALID_HANDLE_VALUE ) + { + CloseHandle(handle); + if (!DeleteFile(topath)) + return apr_get_os_error(); + } + if (MoveFile(frompath, topath)) + return APR_SUCCESS; + } return apr_get_os_error(); } From d7a02fc441d444e2b5f8f1ef9fc4f3ffbccff302 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Fri, 26 Jan 2001 09:05:55 +0000 Subject: [PATCH 1150/7878] apr_put_os_file() expected the caller to have an existing file or init to NULL. using an existing file doesn't normally work: where would you get a blank file to shove an FD into? expecting the user to assign to NULL is error-prone (mod_isapi didn't). *) always create and return a new file from apr_put_os_file() *) reimplement apr_open_stderr() in terms of apr_put_os_file() [ except for win32... some issues there ] *) remove some (obsolete) inits to NULL git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61131 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 22 +++++----------------- file_io/unix/open.c | 22 ++++------------------ file_io/win32/open.c | 14 +++++++------- 3 files changed, 16 insertions(+), 42 deletions(-) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 8e07c6cd698..e2cfeba1d91 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -220,10 +220,9 @@ apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) { apr_os_file_t *dafile = thefile; - if ((*file) == NULL) { - (*file) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); - (*file)->cntxt = cont; - } + + (*file) = apr_palloc(cont, sizeof(apr_file_t)); + (*file)->cntxt = cont; (*file)->filedes = *dafile; (*file)->isopen = TRUE; (*file)->buffered = FALSE; @@ -247,20 +246,9 @@ apr_status_t apr_eof(apr_file_t *fptr) apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { - (*thefile) = apr_palloc(cont, sizeof(apr_file_t)); - if ((*thefile) == NULL) { - return APR_ENOMEM; - } - (*thefile)->cntxt = cont; - (*thefile)->filedes = 2; - (*thefile)->fname = NULL; - (*thefile)->isopen = TRUE; - (*thefile)->buffered = FALSE; - (*thefile)->eof_hit = FALSE; - (*thefile)->flags = 0; - (*thefile)->pipe = FALSE; + int fd = 2; - return APR_SUCCESS; + return apr_put_os_file(thefile, &fd, cont); } APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 187a64bda92..f766b9b973a 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -217,10 +217,8 @@ apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, { int *dafile = thefile; - if ((*file) == NULL) { - (*file) = apr_pcalloc(cont, sizeof(apr_file_t)); - (*file)->cntxt = cont; - } + (*file) = apr_pcalloc(cont, sizeof(apr_file_t)); + (*file)->cntxt = cont; (*file)->eof_hit = 0; (*file)->buffered = 0; (*file)->blocking = BLK_UNKNOWN; /* in case it is a pipe */ @@ -249,23 +247,11 @@ apr_status_t apr_ferror(apr_file_t *fptr) return APR_SUCCESS; } -/* apr_open_stderr() could just call apr_put_os_file() with - * STDERR_FILENO for the descriptor... - */ apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { - (*thefile) = apr_pcalloc(cont, sizeof(apr_file_t)); - if ((*thefile) == NULL) { - return APR_ENOMEM; - } - (*thefile)->filedes = STDERR_FILENO; - (*thefile)->cntxt = cont; - (*thefile)->buffered = 0; - (*thefile)->blocking = BLK_UNKNOWN; - (*thefile)->fname = NULL; - (*thefile)->eof_hit = 0; + int fd = STDERR_FILENO; - return APR_SUCCESS; + return apr_put_os_file(thefile, &fd, cont); } APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 83b0e4c8a6a..98bf71a7fff 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -400,13 +400,8 @@ APR_DECLARE(apr_status_t) apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) { - if ((*file) == NULL) { - if (cont == NULL) { - return APR_ENOPOOL; - } - (*file) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); - (*file)->cntxt = cont; - } + (*file) = apr_pcalloc(cont, sizeof(apr_file_t)); + (*file)->cntxt = cont; (*file)->filehand = *thefile; (*file)->ungetchar = -1; /* no char avail */ return APR_SUCCESS; @@ -422,6 +417,11 @@ APR_DECLARE(apr_status_t) apr_eof(apr_file_t *fptr) APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { + /* ### should this be rebuilt in terms of apr_put_os_file()?? their + ### initializations are slightly different (maybe one or both are + ### not init'ing properly?) + */ + (*thefile) = apr_pcalloc(cont, sizeof(apr_file_t)); if ((*thefile) == NULL) { return APR_ENOMEM; From 3cdc178468d5c6d5c9cde99f70f3d9d91d0273d1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 27 Jan 2001 06:39:14 +0000 Subject: [PATCH 1151/7878] And why these values, anyways... abstract them out git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61132 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 64b1818833a..068f7b7d36a 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -81,7 +81,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, apr_oslevel_e os_level; if (!apr_get_oslevel(ctx, &os_level) && os_level >= APR_WIN_NT) { - apr_wchar_t wpath[8192]; + apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) / sizeof(apr_wchar_t), path)) { @@ -97,14 +97,14 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, else #endif { - char fspec[MAX_PATH], *p = fspec; + char fspec[APR_PATH_MAX], *p = fspec; /* Must convert path from / to \ notation. * Per PR2555, the LoadLibraryEx function is very picky about slashes. * Debugging on NT 4 SP 6a reveals First Chance Exception within NTDLL. * LoadLibrary in the MS PSDK also reveals that it -explicitly- states * that backslashes must be used for the LoadLibrary family of calls. */ - apr_cpystrn(fspec, path, MAX_PATH); + apr_cpystrn(fspec, path, sizeof(fspec)); while (p = strchr(p, '/')) *p = '\\'; From 46dcde25d83b133ecd947e4396256f27fa30b1d9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 27 Jan 2001 06:41:07 +0000 Subject: [PATCH 1152/7878] Clean up some uglyness ... here's what the flags now mean: info->type & APR_FINFO_LINK - ok, we looked for a link info->filetype == APR_LNK - yup, we got a link This is likely why unix users were reporting 'unexpected' APR_INCOMPLETE return values. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61133 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index a8ac57a1e10..0642d22ee8d 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -81,8 +81,8 @@ static apr_filetype_e filetype_from_mode(int mode) return type; } -static apr_status_t fill_out_finfo(apr_finfo_t *finfo, struct stat *info, - apr_int32_t wanted) +static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, + apr_int32_t wanted) { finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK | APR_FINFO_OWNER | APR_FINFO_PROT; @@ -103,14 +103,6 @@ static apr_status_t fill_out_finfo(apr_finfo_t *finfo, struct stat *info, * finfo->valid |= APR_FINFO_CSIZE; * } */ - if (finfo->filetype == APR_LNK) { - finfo->valid |= APR_FINFO_LINK; - } - - if (wanted & ~finfo->valid) - return APR_INCOMPLETE; - - return APR_SUCCESS; } apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, @@ -121,7 +113,8 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, if (fstat(thefile->filedes, &info) == 0) { finfo->cntxt = thefile->cntxt; finfo->fname = thefile->fname; - return fill_out_finfo(finfo, &info, wanted); + fill_out_finfo(finfo, &info, wanted); + return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; } else { return errno; @@ -151,7 +144,10 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, if (srv == 0) { finfo->cntxt = cont; finfo->fname = fname; - return fill_out_finfo(finfo, &info, wanted); + fill_out_finfo(finfo, &info, wanted); + if (wanted & APR_FINFO_LINK) + wanted &= ~APR_FINFO_LINK; + return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; } else { #if !defined(ENOENT) || !defined(ENOTDIR) From 3b9a8c3f3c9c7d9447b0c36b25a3e0433b2e430c Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 27 Jan 2001 17:57:03 +0000 Subject: [PATCH 1153/7878] Add apr_open_stdout. This mirrors apr_open_stderr, except it works on stdout. Submitted by: cmpilato@collab.net git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61134 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/os2/open.c | 10 ++++++++++ file_io/unix/open.c | 7 +++++++ file_io/win32/open.c | 31 ++++++++++++++++--------------- include/apr_file_io.h | 9 +++++++++ 5 files changed, 45 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index 937a77efe9a..b17ee9a63bc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Add apr_open_stdout. This mirrors apr_open_stderr, except it works + on stdout. [cmpilato@collab.net] + *) Fix bug in file_io/unix/dir.c. There is no such thing as a dirent, it must be a struct dirent. [Kevin Pilch-Bisson <kevin@pilch-bisson.net>] diff --git a/file_io/os2/open.c b/file_io/os2/open.c index e2cfeba1d91..317969e89b1 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -251,4 +251,14 @@ apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) return apr_put_os_file(thefile, &fd, cont); } + + +apr_status_t apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont) +{ + int fd = 1; /* Is this correct? */ + + return apr_put_os_file(thefile, &fd, cont); +} + + APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/file_io/unix/open.c b/file_io/unix/open.c index f766b9b973a..99de8a3724d 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -254,4 +254,11 @@ apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) return apr_put_os_file(thefile, &fd, cont); } +apr_status_t apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont) +{ + int fd = STDOUT_FILENO; + + return apr_put_os_file(thefile, &fd, cont); +} + APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 98bf71a7fff..9953def08d4 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -417,23 +417,24 @@ APR_DECLARE(apr_status_t) apr_eof(apr_file_t *fptr) APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { - /* ### should this be rebuilt in terms of apr_put_os_file()?? their - ### initializations are slightly different (maybe one or both are - ### not init'ing properly?) - */ - - (*thefile) = apr_pcalloc(cont, sizeof(apr_file_t)); - if ((*thefile) == NULL) { - return APR_ENOMEM; - } - (*thefile)->filehand = GetStdHandle(STD_ERROR_HANDLE); - if ((*thefile)->filehand == INVALID_HANDLE_VALUE) + apr_os_file_t file_handle; + + file_handle = GetStdHandle(STD_ERROR_HANDLE); + if (file_handle == INVALID_HANDLE_VALUE) return apr_get_os_error(); - (*thefile)->cntxt = cont; - (*thefile)->fname = "\0"; // What was this??? : "STD_ERROR_HANDLE"; */ - (*thefile)->eof_hit = 0; - return APR_SUCCESS; + return apr_put_os_file(thefile, &file_handle, cont); +} + +APR_DECLARE(apr_status_t) apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont) +{ + apr_os_file_t file_handle; + + file_handle = GetStdHandle(STD_OUTPUT_HANDLE); + if (file_handle == INVALID_HANDLE_VALUE) + return apr_get_os_error(); + + return apr_put_os_file(thefile, &file_handle, cont); } APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 474092435c7..4cc02140dbd 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -199,6 +199,15 @@ APR_DECLARE(apr_status_t) apr_ferror(apr_file_t *fptr); APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont); +/** + * open standard output as an apr file pointer. + * @param thefile The apr file to use as stdout. + * @param cont The pool to allocate the file out of. + * @deffunc apr_status_t apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont) + */ +APR_DECLARE(apr_status_t) apr_open_stdout(apr_file_t **thefile, + apr_pool_t *cont); + /** * Read data from the specified file. * @param thefile The file descriptor to read from. From 5f22f23e12c9d7265df4414db1cf719567347f7e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 27 Jan 2001 22:25:11 +0000 Subject: [PATCH 1154/7878] This patch sets the server running once again, except in cases where it still expects APR_SUCCESS responses to an APR_FINFO_NORM apr_stat. Most of those are gone, those that remain are hiding in the modules. Radically refactored apr_stat/lstat/getfileinfo/dir_read for Win32 to assure we are retrieving what we expect to retrieve, and reporting the correct result (APR_SUCCESS or APR_INCOMPLETE). The potential for a bit more optimization still remains. While we have the future opportunity to cache the apr_stat'ed file handle for a very fast open (dup handle) on Win32, patched to close that file after a stat always. Needs a new semantic before we leave handles dangling when the user intends to rm. Correct Win32 apr_stat/lstat/getfileinfo/dir_read to all zero out the finfo buffer on success (or incomplete success). Fix Win32/Unix apr_lstat to throw the .valid bit APR_FINFO_LINK to indicate we attempted to open the link. Only the .filetype APR_LNK reflects if the file found was, in fact, a link. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61135 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 30 +++--- file_io/win32/filestat.c | 192 +++++++++++++++++------------------- file_io/win32/open.c | 13 +-- include/apr.h.in | 1 + include/apr.hw | 1 + include/arch/win32/fileio.h | 5 + 6 files changed, 118 insertions(+), 124 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 9e0ecd5b4f8..d5c34b18d31 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -146,6 +146,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_dir_t *thedir) { apr_status_t rv; + char *fname; /* The while loops below allow us to skip all invalid file names, so that * we aren't reporting any files where their absolute paths are too long. */ @@ -183,7 +184,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if (rv = unicode_to_utf8_path(thedir->name, APR_FILE_MAX * 3 + 1, thedir->w.entry->cFileName)) return rv; - finfo->name = thedir->name; + fname = thedir->name; } else #endif @@ -208,28 +209,28 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, return apr_get_os_error(); } } - finfo->name = thedir->n.entry->cFileName; + fname = thedir->n.entry->cFileName; } - finfo->valid = APR_FINFO_NAME | APR_FINFO_TYPE | APR_FINFO_CTIME - | APR_FINFO_ATIME | APR_FINFO_MTIME | APR_FINFO_SIZE; - wanted |= ~finfo->valid; - if (wanted) { - /* Win32 apr_stat() is about to open a handle to this file. - * we must create a full path that doesn't evaporate. - */ - const char *fname = finfo->name; - char *fspec = apr_pstrcat(thedir->cntxt, thedir->dirname, - finfo->name, NULL); - finfo->valid = 0; + if (wanted & ~APR_FINFO_WIN32_DIR) { + char fspec[APR_PATH_MAX]; + int dirlen = strlen(thedir->dirname); + if (dirlen >= sizeof(fspec)) + dirlen = sizeof(fspec) - 1; + apr_cpystrn(fspec, sizeof(fspec), thedir->dirname); + apr_cpystrn(fspec + dirlen, sizeof(fspec) - dirlen, fname); rv = apr_stat(finfo, fspec, wanted, thedir->cntxt); if (rv == APR_SUCCESS || rv == APR_INCOMPLETE) { finfo->valid |= APR_FINFO_NAME; finfo->name = fname; finfo->fname = fspec; + rv = (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; } return rv; } + memset(finfo, '\0', sizeof(*finfo)); + finfo->name = fname; + finfo->valid = APR_FINFO_WIN32_DIR; finfo->cntxt = thedir->cntxt; /* Do the best job we can determining the file type. @@ -255,8 +256,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, FileTimeToAprTime(&finfo->atime, &thedir->n.entry->ftLastAccessTime); finfo->size = (thedir->n.entry->nFileSizeHigh * MAXDWORD) + thedir->n.entry->nFileSizeLow; - finfo->fname = NULL; - return APR_SUCCESS; + return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *dir) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 3403c946cfc..946bf28c0b6 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -68,75 +68,33 @@ APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted apr_file_t *thefile) { BY_HANDLE_FILE_INFORMATION FileInformation; - DWORD FileType; - apr_oslevel_e os_level; if (!GetFileInformationByHandle(thefile->filehand, &FileInformation)) { return apr_get_os_error(); } - FileType = GetFileType(thefile->filehand); - if (!FileType) { - return apr_get_os_error(); - } + memset(finfo, '\0', sizeof(*finfo)); - /* If my rudimentary knowledge of posix serves... inode is the absolute - * id of the file (uniquifier) that is returned by NT (not 9x) as follows: - */ - if (apr_get_oslevel(thefile->cntxt, &os_level) || os_level >= APR_WIN_NT) - { - finfo->inode = (apr_ino_t) FileInformation.nFileIndexHigh << 16 - | FileInformation.nFileIndexLow; - finfo->device = FileInformation.dwVolumeSerialNumber; - } - else - { - /* Since the apr_stat is not implemented with CreateFile(), - * (directories can't be opened with CreateFile() at all) - * the apr_stat always returns 0 - so must apr_getfileinfo(). - */ - finfo->inode = 0; - finfo->device = 0; - } - /* user and group could be returned as SID's, although this creates - * it's own unique set of issues. All three fields are significantly - * longer than the posix compatible kernals would ever require. - * TODO: Someday solve this, and fix the executable flag below the - * right way with a security permission test (as well as r/w flags.) - */ - finfo->user = 0; - finfo->group = 0; - - /* Filetype - Directory or file: this case _will_ never happen */ - if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { - finfo->protection = S_IFLNK; - finfo->filetype = APR_LNK; - } - else if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - finfo->protection = S_IFDIR; - finfo->filetype = APR_DIR; - } - else if (FileType == FILE_TYPE_DISK) { - finfo->protection = S_IFREG; - finfo->filetype = APR_REG; - } - else if (FileType == FILE_TYPE_CHAR) { - finfo->protection = S_IFCHR; - finfo->filetype = APR_CHR; - } - else if (FileType == FILE_TYPE_PIPE) { - finfo->protection = S_IFIFO; - finfo->filetype = APR_PIPE; - } - else { - finfo->protection = 0; - finfo->filetype = APR_NOFILE; - } + FileTimeToAprTime(&finfo->atime, &FileInformation.ftLastAccessTime); + FileTimeToAprTime(&finfo->ctime, &FileInformation.ftCreationTime); + FileTimeToAprTime(&finfo->mtime, &FileInformation.ftLastWriteTime); - /* Read, write execute for owner - * In the Win32 environment, anything readable is executable - * (well, not entirely 100% true, but I'm looking for a way - * to get at the acl permissions in simplified fashion.) + finfo->inode = (apr_ino_t)FileInformation.nFileIndexLow + | ((apr_ino_t)FileInformation.nFileIndexHigh << 32); + finfo->device = FileInformation.dwVolumeSerialNumber; + finfo->nlink = FileInformation.nNumberOfLinks; + +#if APR_HAS_LARGE_FILES + finfo->size = (apr_off_t)FileInformation.nFileSizeLow + | ((apr_off_t)FileInformation.nFileSizeHigh << 32); +#else + finfo->size = FileInformation.nFileSizeLow; +#endif + + /* Read, write execute for owner. In the Win32 environment, + * anything readable is executable (well, not entirely 100% true, + * but I'm looking for some obvious logic that would help us here.) + * TODO: The real permissions come from the DACL */ if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { finfo->protection |= S_IREAD | S_IEXEC; @@ -145,14 +103,45 @@ APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; } - /* File times */ - FileTimeToAprTime(&finfo->atime, &FileInformation.ftLastAccessTime); - FileTimeToAprTime(&finfo->ctime, &FileInformation.ftCreationTime); - FileTimeToAprTime(&finfo->mtime, &FileInformation.ftLastWriteTime); + /* TODO: return user and group could as * SID's, allocated in the pool. + * [These are variable length objects that will require a 'comparitor' + * and a 'get readable string of' functions.] + */ + + finfo->valid = APR_FINFO_ATIME | APR_FINFO_CTIME | APR_FINFO_MTIME + | APR_FINFO_IDENT | APR_FINFO_NLINK | APR_FINFO_SIZE + | APR_FINFO_UPROT; - /* File size - * Note: This cannot handle files greater than can be held by an int */ - finfo->size = FileInformation.nFileSizeLow; + + if (wanted & APR_FINFO_TYPE) + { + DWORD FileType; + if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { + finfo->filetype = APR_LNK; + finfo->valid |= APR_FINFO_TYPE; + } + else if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + finfo->filetype = APR_DIR; + finfo->valid |= APR_FINFO_TYPE; + } + else if (FileType = GetFileType(thefile->filehand)) { + if (FileType == FILE_TYPE_DISK) { + finfo->filetype = APR_REG; + finfo->valid |= APR_FINFO_TYPE; + } + else if (FileType == FILE_TYPE_CHAR) { + finfo->filetype = APR_CHR; + finfo->valid |= APR_FINFO_TYPE; + } + else if (FileType == FILE_TYPE_PIPE) { + finfo->filetype = APR_PIPE; + finfo->valid |= APR_FINFO_TYPE; + } + } + } + + if (wanted & ~finfo->valid) + return APR_INCOMPLETE; return APR_SUCCESS; } @@ -174,7 +163,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * since in many cases the apr user is testing for 'not found' * and this is not such a case. */ - if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) + if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) { apr_file_t *thefile = NULL; apr_status_t rv; @@ -187,37 +176,36 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * user, group or permissions. */ - if (rv = apr_open(&thefile, fname, - ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0) - | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) - ? APR_READCONTROL : 0), APR_OS_DEFAULT, cont)) - { + if ((rv = apr_open(&thefile, fname, + ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0) + | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) + ? APR_READCONTROL : 0), + APR_OS_DEFAULT, cont)) == APR_SUCCESS) { + rv = apr_getfileinfo(finfo, wanted, thefile); + finfo->filehand = NULL; + apr_close(thefile); + } + else if (APR_STATUS_IS_EACCES(rv) && (wanted & (APR_FINFO_PROT + | APR_FINFO_OWNER))) { /* We have a backup plan. Perhaps we couldn't grab READ_CONTROL? - * proceed with the alternate... + * proceed without asking for that permission... */ - if (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) { - rv = apr_open(&thefile, fname, - ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0), - APR_OS_DEFAULT, cont); - wanted &= ~(APR_FINFO_PROT | APR_FINFO_OWNER); + if ((rv = apr_open(&thefile, fname, + ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0), + APR_OS_DEFAULT, cont)) == APR_SUCCESS) { + rv = apr_getfileinfo(finfo, wanted & ~(APR_FINFO_PROT + | APR_FINFO_OWNER), + thefile); + finfo->filehand = NULL; + apr_close(thefile); } - if (rv) - return rv; } - - /* - * NT5 (W2K) only supports symlinks in the same manner as mount points. - * This code should eventually take that into account, for now treat - * every reparse point as a symlink... - * - * We must open the file with READ_CONTROL if we plan to retrieve the - * user, group or permissions. - */ - rv = apr_getfileinfo(finfo, wanted, thefile); - finfo->cntxt = thefile->cntxt; + if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) + return (rv); + /* We picked up this case above and had opened the link's properties */ + if (wanted & APR_FINFO_LINK) + finfo->valid |= APR_FINFO_LINK; finfo->fname = thefile->fname; - finfo->filehand = thefile; - return (rv); } else { @@ -230,15 +218,13 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, if (strlen(fname) >= MAX_PATH) { return APR_ENAMETOOLONG; } - else if (os_level >= APR_WIN_98) - { + else if (os_level >= APR_WIN_98) { if (!GetFileAttributesEx(fname, GetFileExInfoStandard, &FileInformation)) { return apr_get_os_error(); } } - else - { + else { /* What a waste of cpu cycles... but we don't have a choice */ HANDLE hFind; @@ -247,7 +233,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, hFind = FindFirstFile(fname, &FileInformation); if (hFind == INVALID_HANDLE_VALUE) { return apr_get_os_error(); - } else { + } + else { FindClose(hFind); } } @@ -301,6 +288,9 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, if (finfo->size < 0 || FileInformation.nFileSizeHigh) finfo->size = 0x7fffffff; } + if (wanted & ~finfo->valid) + return APR_INCOMPLETE; + return APR_SUCCESS; } diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 9953def08d4..33a4873e2c8 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -175,7 +175,7 @@ APR_DECLARE(apr_status_t) apr_open(apr_file_t **new, const char *fname, HANDLE handle = INVALID_HANDLE_VALUE; DWORD oflags = 0; DWORD createflags = 0; - DWORD attributes = FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN; + DWORD attributes = 0 /* FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN*/; DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE; apr_oslevel_e os_level; apr_status_t rv; @@ -189,8 +189,6 @@ APR_DECLARE(apr_status_t) apr_open(apr_file_t **new, const char *fname, if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) sharemode |= FILE_SHARE_DELETE; - else - os_level = 0; if (flag & APR_CREATE) { if (flag & APR_EXCL) { @@ -218,15 +216,14 @@ APR_DECLARE(apr_status_t) apr_open(apr_file_t **new, const char *fname, if (flag & APR_DELONCLOSE) { attributes |= FILE_FLAG_DELETE_ON_CLOSE; } - if (flag & APR_OPENLINK) { - attributes |= FILE_FLAG_OPEN_REPARSE_POINT; + if (flag & APR_OPENLINK) { + attributes |= FILE_FLAG_OPEN_REPARSE_POINT; } if (!(flag & (APR_READ | APR_WRITE)) && (os_level >= APR_WIN_NT)) { /* We once failed here, but this is how one opens - * a directory as a file under winnt. Accelerate - * further by not hitting storage, we don't need to. + * a directory as a file under winnt */ - attributes |= FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_NO_RECALL; + attributes |= FILE_FLAG_BACKUP_SEMANTICS; } if (flag & APR_XTHREAD) { /* This win32 specific feature is required diff --git a/include/apr.h.in b/include/apr.h.in index b2660d9ee6b..bb128b1f2b5 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -108,6 +108,7 @@ #define APR_HAS_DSO @aprdso@ #define APR_HAS_UNICODE_FS 0 #define APR_HAS_USER 1 +#define APR_HAS_LARGE_FILES 0 /* This macro tells APR that it is safe to make a file masquerade as a * socket. This is necessary, because some platforms support poll'ing diff --git a/include/apr.hw b/include/apr.hw index 21727efef9d..5119a4c08b5 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -187,6 +187,7 @@ #define APR_HAS_DSO 1 #define APR_HAS_UNICODE_FS 1 #define APR_HAS_USER 0 +#define APR_HAS_LARGE_FILES 1 /* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE * on all platforms. diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index f7f87c69297..04b629982ee 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -135,6 +135,11 @@ apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, #define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000 #endif +/* Information bits available from the WIN32 FindFirstFile function */ +#define APR_FINFO_WIN32_DIR (APR_FINFO_NAME | APR_FINFO_TYPE \ + | APR_FINFO_CTIME | APR_FINFO_ATIME \ + | APR_FINFO_MTIME | APR_FINFO_SIZE) + /* quick run-down of fields in windows' apr_file_t structure that may have * obvious uses. From 1a4dc6284c1663a73ae58f5233b2d568f2f3ae06 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 00:04:03 +0000 Subject: [PATCH 1155/7878] Added apr_get_username to the former homedir.c (now userinfo.c). HAVE_GETPWNAM_R is likely the wrong test for HAVE_GETPWUID_R, but I have no clue if that featuretest is already compiled. Unix folk, please adjust accordingly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61136 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_user.h | 16 ++++++-- user/unix/Makefile.in | 2 +- user/unix/homedir.c | 86 ------------------------------------------- user/unix/userinfo.c | 25 ++++++++++--- 4 files changed, 33 insertions(+), 96 deletions(-) delete mode 100644 user/unix/homedir.c diff --git a/include/apr_user.h b/include/apr_user.h index f45c0f53219..0b69a914473 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -70,14 +70,24 @@ extern "C" { */ /*** - * Get the home directory for a specified userid. - * @param dirname Pointer to new string containing directory name (on output) + * Get the user name for a specified userid + * @param dirname Pointer to new string containing user name (on output) * @param userid The userid * @param p The pool from which to allocate the string + * @deffunc apr_status_t apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) + * @tip This function is available only if APR_HAS_USER is defined. + */ +APR_DECLARE(apr_status_t) apr_get_userid(char **username, apr_uid_t userid, apr_pool_t *p); + +/*** + * Get the home directory for the named user + * @param dirname Pointer to new string containing directory name (on output) + * @param userid The named user + * @param p The pool from which to allocate the string * @deffunc apr_status_t apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p) * @tip This function is available only if APR_HAS_USER is defined. */ -apr_status_t apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p); #ifdef __cplusplus } diff --git a/user/unix/Makefile.in b/user/unix/Makefile.in index 300adbdab84..a9423bdb39b 100644 --- a/user/unix/Makefile.in +++ b/user/unix/Makefile.in @@ -1,5 +1,5 @@ -TARGETS = homedir.lo +TARGETS = userinfo.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/user/unix/homedir.c b/user/unix/homedir.c deleted file mode 100644 index c49e7b1871a..00000000000 --- a/user/unix/homedir.c +++ /dev/null @@ -1,86 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_user.h" -#include "apr_private.h" -#ifdef HAVE_PWD_H -#include <pwd.h> -#endif -#if APR_HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif - -apr_status_t apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p) -{ - struct passwd *pw; -#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) - struct passwd pwd; - char pwbuf[512]; -#endif - -#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) - if (!getpwnam_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw)) { -#else - if ((pw = getpwnam(userid)) != NULL) { -#endif - *dirname = apr_pstrdup(p, pw->pw_dir); - } - else { - return errno; - } - return APR_SUCCESS; -} - diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index c49e7b1871a..97b6244d86e 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -63,24 +63,37 @@ #include <sys/types.h> #endif -apr_status_t apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p) { struct passwd *pw; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) struct passwd pwd; char pwbuf[512]; + + if (getpwnam_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw)) { +#else + if ((pw = getpwnam(userid)) == NULL) { #endif + return errno; + } + *dirname = apr_pstrdup(p, pw->pw_dir); + return APR_SUCCESS; +} +APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) +{ + struct passwd *pw; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) - if (!getpwnam_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw)) { + struct passwd pwd; + char pwbuf[512]; + + if (getpwuid_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw)) { #else - if ((pw = getpwnam(userid)) != NULL) { + if ((pw = getpwuid(userid)) == NULL) { #endif - *dirname = apr_pstrdup(p, pw->pw_dir); - } - else { return errno; } + *username = apr_pstrdup(p, pw->pw_name); return APR_SUCCESS; } From 3ca5962886353ce7f46a82e36306f2165b0c5c2f Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 28 Jan 2001 00:29:19 +0000 Subject: [PATCH 1156/7878] Get the new userinfo stuff to compile cleanly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61137 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + include/apr_file_info.h | 6 +----- include/apr_user.h | 8 +++++++- user/unix/userinfo.c | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index db3f1442417..90f0d974785 100644 --- a/configure.in +++ b/configure.in @@ -626,6 +626,7 @@ AC_CHECK_FUNCS(poll) dnl #----------------------------- Checking for missing POSIX thread functions AC_CHECK_FUNCS(getpwnam_r) +AC_CHECK_FUNCS(getpwuid_r) dnl #----------------------------- Checking for Processes echo $ac_n "${nl}Checking for Processes...${nl}" diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 923c47dd9eb..43f0c0ee542 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -56,6 +56,7 @@ #define APR_FILE_INFO_H #include "apr.h" +#include "apr_user.h" #include "apr_pools.h" #include "apr_time.h" #include "apr_errno.h" @@ -108,11 +109,6 @@ typedef struct apr_dir_t apr_dir_t; * @defvar apr_fileperms_t */ typedef apr_int32_t apr_fileperms_t; -/** - * Structure for determining file owner. - * @defvar apr_uid_t - */ -typedef uid_t apr_uid_t; /** * Structure for determining the group that owns the file. * @defvar apr_gid_t diff --git a/include/apr_user.h b/include/apr_user.h index 0b69a914473..c1606462b9f 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -69,6 +69,12 @@ extern "C" { * @package APR user id services */ +/** + * Structure for determining file owner. + * @defvar apr_uid_t + */ +typedef uid_t apr_uid_t; + /*** * Get the user name for a specified userid * @param dirname Pointer to new string containing user name (on output) @@ -77,7 +83,7 @@ extern "C" { * @deffunc apr_status_t apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) * @tip This function is available only if APR_HAS_USER is defined. */ -APR_DECLARE(apr_status_t) apr_get_userid(char **username, apr_uid_t userid, apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p); /*** * Get the home directory for the named user diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 97b6244d86e..b5b7ad39716 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -83,7 +83,7 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) { struct passwd *pw; -#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWUID_R) struct passwd pwd; char pwbuf[512]; From 3f3926901389903c5970a6d2a4e4dfa82fbcc98f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 01:18:04 +0000 Subject: [PATCH 1157/7878] Add groupinfo.c for apr_get_groupname... win32 commit to follow in a moment. Note: I have no clue if getgrgid_r is implemented by anyone anywhere, it was a best guess at a threadsafe flavor. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61138 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + include/apr_file_info.h | 5 --- include/apr_user.h | 34 ++++++++++++++--- user/unix/Makefile.in | 2 +- user/unix/groupinfo.c | 82 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 113 insertions(+), 11 deletions(-) create mode 100644 user/unix/groupinfo.c diff --git a/configure.in b/configure.in index 90f0d974785..d6e26173e8e 100644 --- a/configure.in +++ b/configure.in @@ -627,6 +627,7 @@ AC_CHECK_FUNCS(poll) dnl #----------------------------- Checking for missing POSIX thread functions AC_CHECK_FUNCS(getpwnam_r) AC_CHECK_FUNCS(getpwuid_r) +AC_CHECK_FUNCS(getgrgid_r) dnl #----------------------------- Checking for Processes echo $ac_n "${nl}Checking for Processes...${nl}" diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 43f0c0ee542..d2fe50128f5 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -109,11 +109,6 @@ typedef struct apr_dir_t apr_dir_t; * @defvar apr_fileperms_t */ typedef apr_int32_t apr_fileperms_t; -/** - * Structure for determining the group that owns the file. - * @defvar apr_gid_t - */ -typedef gid_t apr_gid_t; #ifdef WIN32 /** * Structure for determining the inode of the file. diff --git a/include/apr_user.h b/include/apr_user.h index c1606462b9f..a69719059d6 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -59,8 +59,6 @@ #include "apr_errno.h" #include "apr_pools.h" -#if APR_HAS_USER - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -70,10 +68,26 @@ extern "C" { */ /** - * Structure for determining file owner. + * Structure for determining user ownership. * @defvar apr_uid_t */ +#ifdef WIN32 +typedef PSID apr_uid_t; +#else typedef uid_t apr_uid_t; +#endif + +/** + * Structure for determining group ownership. + * @defvar apr_gid_t + */ +#ifdef WIN32 +typedef PSID apr_gid_t; +#else +typedef gid_t apr_gid_t; +#endif + +#if APR_HAS_USER /*** * Get the user name for a specified userid @@ -95,10 +109,20 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap */ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p); +/*** + * Get the group name for a specified groupid + * @param dirname Pointer to new string containing group name (on output) + * @param userid The groupid + * @param p The pool from which to allocate the string + * @deffunc apr_status_t apr_get_groupname(char **groupname, apr_gid_t userid, apr_pool_t *p) + * @tip This function is available only if APR_HAS_USER is defined. + */ +APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) + +#endif /* ! APR_HAS_USER */ + #ifdef __cplusplus } #endif -#endif /* ! APR_HAS_USER */ - #endif /* ! APR_USER_H */ diff --git a/user/unix/Makefile.in b/user/unix/Makefile.in index a9423bdb39b..91c25dd070c 100644 --- a/user/unix/Makefile.in +++ b/user/unix/Makefile.in @@ -1,5 +1,5 @@ -TARGETS = userinfo.lo +TARGETS = userinfo.lo groupinfo.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c new file mode 100644 index 00000000000..fdf8532c0a7 --- /dev/null +++ b/user/unix/groupinfo.c @@ -0,0 +1,82 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include "apr_strings.h" +#include "apr_portable.h" +#include "apr_user.h" +#include "apr_private.h" +#ifdef HAVE_GRP_H +#include <grp.h> +#endif +#if APR_HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif + +APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) +{ + struct group *gr; +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) + struct group grp; + char grbuf[512]; + + if (getgrgid_r(groupid, &grp, grbuf, sizeof(grbuf), &gr)) { +#else + if ((gr = getgrgid(userid)) == NULL) { +#endif + return errno; + } + *groupname = apr_pstrdup(p, gr->gr_name); + return APR_SUCCESS; +} + From 8b5951f6dddc929475ec0b5a15e05cc2dc7a108a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 01:26:19 +0000 Subject: [PATCH 1158/7878] Enable for user/group win32 (as PSIDs) and fix a small typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61139 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- include/apr_user.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 5119a4c08b5..0aa15c69780 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -186,7 +186,7 @@ #define APR_HAS_OTHER_CHILD 0 #define APR_HAS_DSO 1 #define APR_HAS_UNICODE_FS 1 -#define APR_HAS_USER 0 +#define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 1 /* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE diff --git a/include/apr_user.h b/include/apr_user.h index a69719059d6..5fea544411b 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -114,10 +114,10 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use * @param dirname Pointer to new string containing group name (on output) * @param userid The groupid * @param p The pool from which to allocate the string - * @deffunc apr_status_t apr_get_groupname(char **groupname, apr_gid_t userid, apr_pool_t *p) + * @deffunc apr_status_t apr_get_groupname(char **groupname, apr_gid_t userid, apr_pool_t *p); * @tip This function is available only if APR_HAS_USER is defined. */ -APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p); #endif /* ! APR_HAS_USER */ From 9beb061e4db755c680a394cdb2041e406aa68efe Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 01:34:27 +0000 Subject: [PATCH 1159/7878] Some win32 user and group handling functions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61140 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 26 +++++++++++++- apr.dsp | 12 +++++++ libapr.dsp | 12 +++++++ user/win32/groupinfo.c | 80 +++++++++++++++++++++++++++++++++++++++++ user/win32/userinfo.c | 82 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 211 insertions(+), 1 deletion(-) create mode 100644 user/win32/groupinfo.c create mode 100644 user/win32/userinfo.c diff --git a/CHANGES b/CHANGES index b17ee9a63bc..107bb94cc54 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,29 @@ -Changes with APR b1 +Changes with APR b1 + *) Abstracted apr_get_username and apr_get_groupname for unix and win32. + Modified Win32 apr_uid_t and apr_gid_t to use PSIDs, and elimintated + the uid_t and gid_t definitions. + + *) Radically refactored apr_stat/lstat/getfileinfo/dir_read for Win32 + to assure we are retrieving what we expect to retrieve, and reporting + the correct result (APR_SUCCESS or APR_INCOMPLETE). The potential + for a bit more optimization still remains. [William Rowe] + + *) While we have the future opportunity to cache the apr_stat'ed file + handle for a very fast open (dup handle) on Win32, patched to close + that file after a stat always. Needs a new semantic before we leave + handles dangling when the user intends to rm. [William Rowe] + + *) Correct Win32 apr_stat/lstat/getfileinfo/dir_read to all zero out + the finfo buffer on success (or incomplete success). [William Rowe] + + *) Fix Win32/Unix apr_lstat to throw the .valid bit APR_FINFO_LINK to + indicate we attempted to open the link. Only the .filetype APR_LNK + reflects if the file found was, in fact, a link. [William Rowe] + + *) Fixed apr_open and apr_rename to function on Win9x. + [Mike Pilato <cmpilato@collab.net>] + *) Add apr_open_stdout. This mirrors apr_open_stderr, except it works on stdout. [cmpilato@collab.net] diff --git a/apr.dsp b/apr.dsp index 9c7b8dccad8..4039aa632ba 100644 --- a/apr.dsp +++ b/apr.dsp @@ -380,6 +380,18 @@ SOURCE=.\mmap\unix\common.c SOURCE=.\mmap\win32\mmap.c # End Source File # End Group +# Begin Group "user" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\user\win32\userinfo.c +# End Source File +# Begin Source File + +SOURCE=.\user\win32\groupinfo.c +# End Source File +# End Group # End Group # Begin Group "Generated Header Files" diff --git a/libapr.dsp b/libapr.dsp index 6988d7db915..40ef2bec349 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -386,6 +386,18 @@ SOURCE=.\mmap\unix\common.c SOURCE=.\mmap\win32\mmap.c # End Source File # End Group +# Begin Group "user" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\user\win32\userinfo.c +# End Source File +# Begin Source File + +SOURCE=.\user\win32\groupinfo.c +# End Source File +# End Group # End Group # Begin Group "Generated Header Files" diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c new file mode 100644 index 00000000000..49e70bd0f23 --- /dev/null +++ b/user/win32/groupinfo.c @@ -0,0 +1,80 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include "apr_strings.h" +#include "apr_portable.h" +#include "apr_user.h" +#include "apr_private.h" +#ifdef HAVE_GRP_H +#include <grp.h> +#endif +#if APR_HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif + +APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) +{ + SID_NAME_USE type; + char name[MAX_PATH], domain[MAX_PATH]; + DWORD cbname = sizeof(name), cbdomain = sizeof(domain); + if (!groupid) + return APR_BADARG; + if (!LookupAccountSid(NULL, groupid, name, &cbname, domain, &cbdomain, &type)) + return apr_get_os_error(); + if (type != SidTypeGroup && type != SidTypeWellKnownGroup) + return APR_BADARG; + *groupname = apr_pstrdup(p, name); + return APR_SUCCESS; +} + diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c new file mode 100644 index 00000000000..365703320c7 --- /dev/null +++ b/user/win32/userinfo.c @@ -0,0 +1,82 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#include "apr_strings.h" +#include "apr_portable.h" +#include "apr_user.h" +#include "apr_private.h" +#if APR_HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif + +APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) +{ + SID_NAME_USE type; + char name[MAX_PATH], domain[MAX_PATH]; + DWORD cbname = sizeof(name), cbdomain = sizeof(domain); + if (!userid) + return APR_BADARG; + if (!LookupAccountSid(NULL, userid, name, &cbname, domain, &cbdomain, &type)) + return apr_get_os_error(); + if (type != SidTypeUser) + return APR_BADARG; + *username = apr_pstrdup(p, name); + return APR_SUCCESS; +} + From 4a8c81d8e3484307d54c37fcc3a0ef948db94e9d Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 28 Jan 2001 02:04:41 +0000 Subject: [PATCH 1160/7878] Get Unix building again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61141 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + user/unix/groupinfo.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index d6e26173e8e..e7749879970 100644 --- a/configure.in +++ b/configure.in @@ -276,6 +276,7 @@ AC_CHECK_HEADERS(dirent.h, direnth="1", dirent="0") AC_CHECK_HEADERS(errno.h, errnoh="1", errnoh="0") AC_CHECK_HEADERS(net/errno.h) AC_CHECK_HEADERS(fcntl.h, fcntlh="1", fcntl="0") +AC_CHECK_HEADERS(grp.h) AC_CHECK_HEADERS(io.h, ioh="1", ioh="0") AC_CHECK_HEADERS(limits.h) AC_CHECK_HEADERS(malloc.h) diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index fdf8532c0a7..47d16fe4d9f 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -72,7 +72,7 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, if (getgrgid_r(groupid, &grp, grbuf, sizeof(grbuf), &gr)) { #else - if ((gr = getgrgid(userid)) == NULL) { + if ((gr = getgrgid(groupid)) == NULL) { #endif return errno; } From a001ddfa359da16edae6b19bf6501b5903409278 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 02:13:18 +0000 Subject: [PATCH 1161/7878] One more down git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61142 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/STATUS b/STATUS index 14cf4423170..a5eb1c44970 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/24 08:26:19 $] +Last modified at [$Date: 2001/01/28 02:13:18 $] Release: @@ -15,8 +15,6 @@ Release: RELEASE SHOWSTOPPERS: - * Many linkage errors are gpfaulting Apache/win32 in various configs - (load mod_dav, for example.) RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: @@ -39,7 +37,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: process suspended. We also need a call to wake up the suspended process This may not be able to be implemented everywhere though. Status: OtherBill asks, why? What is the benefit, how is it - portably implemented? + portably implemented? Unless this creates some tangible that + mirrors another platform, then I'm -1. * Replace tables with a proper opaque ADT that has pluggable implementations (including something like the existing data type, From d8b4da4be0b5ba3dd64fe5d00d0756383c741be2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 04:03:11 +0000 Subject: [PATCH 1162/7878] Clean up drivel, and handle both int and huge apr_off_t sizes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61143 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index d5c34b18d31..ba73c8ac163 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -216,8 +216,8 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, int dirlen = strlen(thedir->dirname); if (dirlen >= sizeof(fspec)) dirlen = sizeof(fspec) - 1; - apr_cpystrn(fspec, sizeof(fspec), thedir->dirname); - apr_cpystrn(fspec + dirlen, sizeof(fspec) - dirlen, fname); + apr_cpystrn(fspec, thedir->dirname, sizeof(fspec)); + apr_cpystrn(fspec + dirlen, fname, sizeof(fspec) - dirlen); rv = apr_stat(finfo, fspec, wanted, thedir->cntxt); if (rv == APR_SUCCESS || rv == APR_INCOMPLETE) { finfo->valid |= APR_FINFO_NAME; @@ -254,8 +254,14 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, FileTimeToAprTime(&finfo->ctime, &thedir->n.entry->ftCreationTime); FileTimeToAprTime(&finfo->mtime, &thedir->n.entry->ftLastWriteTime); FileTimeToAprTime(&finfo->atime, &thedir->n.entry->ftLastAccessTime); - finfo->size = (thedir->n.entry->nFileSizeHigh * MAXDWORD) - + thedir->n.entry->nFileSizeLow; +#if APR_HAS_LARGE_FILES + finfo->size = ((apr_off_t)thedir->n.entry->nFileSizeHigh << 32) + | (apr_off_t)thedir->n.entry->nFileSizeLow; +#else + finfo->size = (apr_off_t)thedir->n.entry->nFileSizeLow; + if (finfo->size < 0 || FileInformation.nFileSizeHigh) + finfo->size = 0x7fffffff; +#endif return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; } From 6912601c09a9e93d3d1dca28e1ebb97751428764 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 05:14:17 +0000 Subject: [PATCH 1163/7878] Return to a GetFileAttributesEx() call for WinNT stat() calls. Next patch will reintroduce the stat()-by-open() - but only after we optimize it to do so when -required- (for inode, dev, or nlink). But not tonight. Adds User and Group results as PSID data. This is only meaningful through the apr/user package, which right now only returns names. apr/user still needs (minimally) a compare function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61144 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 339 +++++++++++++++++++++++++-------------- 1 file changed, 219 insertions(+), 120 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 946bf28c0b6..8ed40fa1535 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -62,12 +62,20 @@ #include <sys/stat.h> #include "atime.h" #include "misc.h" +#include <aclapi.h> +static apr_status_t free_localheap(void *heap) { + LocalFree(heap); + return APR_SUCCESS; +} APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) { BY_HANDLE_FILE_INFORMATION FileInformation; + apr_oslevel_e os_level; + PSID user = NULL, grp = NULL; + PACL dacl = NULL; if (!GetFileInformationByHandle(thefile->filehand, &FileInformation)) { return apr_get_os_error(); @@ -88,20 +96,11 @@ APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted finfo->size = (apr_off_t)FileInformation.nFileSizeLow | ((apr_off_t)FileInformation.nFileSizeHigh << 32); #else - finfo->size = FileInformation.nFileSizeLow; + finfo->size = (apr_off_t)FileInformation.nFileSizeLow; + if (finfo->size < 0 || FileInformation.nFileSizeHigh) + finfo->size = 0x7fffffff; #endif - /* Read, write execute for owner. In the Win32 environment, - * anything readable is executable (well, not entirely 100% true, - * but I'm looking for some obvious logic that would help us here.) - * TODO: The real permissions come from the DACL - */ - if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { - finfo->protection |= S_IREAD | S_IEXEC; - } - else { - finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; - } /* TODO: return user and group could as * SID's, allocated in the pool. * [These are variable length objects that will require a 'comparitor' @@ -140,6 +139,55 @@ APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted } } + if ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) + && apr_get_oslevel(thefile->cntxt, &os_level) + && os_level >= APR_WIN_NT) { + SECURITY_INFORMATION sinf = 0; + PSECURITY_DESCRIPTOR pdesc = NULL; + if (wanted & APR_FINFO_USER) + sinf != OWNER_SECURITY_INFORMATION; + if (wanted & APR_FINFO_GROUP) + sinf != GROUP_SECURITY_INFORMATION; + if (wanted & APR_FINFO_PROT) + sinf != SACL_SECURITY_INFORMATION; + if (!GetSecurityInfo(thefile->filehand, SE_FILE_OBJECT, sinf, + (wanted & APR_FINFO_USER) ? &user : NULL, + (wanted & APR_FINFO_GROUP) ? &grp : NULL, + (wanted & APR_FINFO_PROT) ? &dacl : NULL, + NULL, &pdesc)) { + apr_register_cleanup(thefile->cntxt, pdesc, free_localheap, + apr_null_cleanup); + } + } + + if (user) { + finfo->user = user; + finfo->valid |= APR_FINFO_USER; + } + + if (grp) { + finfo->group = grp; + finfo->valid |= APR_FINFO_GROUP; + } + + if (dacl) { + /* Retrieved the discresionary access list */ + + } + else { + /* Read, write execute for owner. In the Win32 environment, + * anything readable is executable (well, not entirely 100% true, + * but I'm looking for some obvious logic that would help us here.) + * TODO: The real permissions come from the DACL + */ + if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { + finfo->protection |= S_IREAD | S_IEXEC; + } + else { + finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; + } + } + if (wanted & ~finfo->valid) return APR_INCOMPLETE; @@ -152,112 +200,181 @@ APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname, return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) +static int stat_with_handle(apr_finfo_t *finfo, const char *fname, + apr_int32_t wanted, apr_pool_t *cont) { - apr_oslevel_e os_level; - /* - * We need to catch the case where fname length == MAX_PATH since for - * some strange reason GetFileAttributesEx fails with PATH_NOT_FOUND. - * We would rather indicate length error than 'not found' - * since in many cases the apr user is testing for 'not found' - * and this is not such a case. - */ - if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) - { - apr_file_t *thefile = NULL; - apr_status_t rv; - /* - * NT5 (W2K) only supports symlinks in the same manner as mount points. - * This code should eventually take that into account, for now treat - * every reparse point as a symlink... - * - * We must open the file with READ_CONTROL if we plan to retrieve the - * user, group or permissions. + apr_file_t *thefile = NULL; + apr_status_t rv; + /* + * NT5 (W2K) only supports symlinks in the same manner as mount points. + * This code should eventually take that into account, for now treat + * every reparse point as a symlink... + * + * We must open the file with READ_CONTROL if we plan to retrieve the + * user, group or permissions. + */ + + if ((rv = apr_open(&thefile, fname, + ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0) + | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) + ? APR_READCONTROL : 0), + APR_OS_DEFAULT, cont)) == APR_SUCCESS) { + rv = apr_getfileinfo(finfo, wanted, thefile); + finfo->filehand = NULL; + apr_close(thefile); + } + else if (APR_STATUS_IS_EACCES(rv) && (wanted & (APR_FINFO_PROT + | APR_FINFO_OWNER))) { + /* We have a backup plan. Perhaps we couldn't grab READ_CONTROL? + * proceed without asking for that permission... */ - if ((rv = apr_open(&thefile, fname, - ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0) - | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) - ? APR_READCONTROL : 0), + ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0), APR_OS_DEFAULT, cont)) == APR_SUCCESS) { - rv = apr_getfileinfo(finfo, wanted, thefile); + rv = apr_getfileinfo(finfo, wanted & ~(APR_FINFO_PROT + | APR_FINFO_OWNER), + thefile); finfo->filehand = NULL; apr_close(thefile); } - else if (APR_STATUS_IS_EACCES(rv) && (wanted & (APR_FINFO_PROT - | APR_FINFO_OWNER))) { - /* We have a backup plan. Perhaps we couldn't grab READ_CONTROL? - * proceed without asking for that permission... - */ - if ((rv = apr_open(&thefile, fname, - ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0), - APR_OS_DEFAULT, cont)) == APR_SUCCESS) { - rv = apr_getfileinfo(finfo, wanted & ~(APR_FINFO_PROT - | APR_FINFO_OWNER), - thefile); - finfo->filehand = NULL; - apr_close(thefile); - } - } - if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) - return (rv); - /* We picked up this case above and had opened the link's properties */ - if (wanted & APR_FINFO_LINK) - finfo->valid |= APR_FINFO_LINK; - finfo->fname = thefile->fname; } - else - { - WIN32_FIND_DATA FileInformation; - /* - * Big enough for the Win95 FindFile, but actually the same - * initial fields as the GetFileAttributesEx return structure - * used for Win98 - */ - if (strlen(fname) >= MAX_PATH) { - return APR_ENAMETOOLONG; + if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) + return (rv); + /* We picked up this case above and had opened the link's properties */ + if (wanted & APR_FINFO_LINK) + finfo->valid |= APR_FINFO_LINK; + finfo->fname = thefile->fname; + + return rv; +} + +APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, + apr_int32_t wanted, apr_pool_t *cont) +{ + /* The WIN32_FILE_ATTRIBUTE_DATA is a subset of this structure + */ + WIN32_FIND_DATA FileInformation; + apr_oslevel_e os_level; + PSID user = NULL, grp = NULL; + PACL dacl = NULL; + + if (apr_get_oslevel(cont, &os_level)) + os_level = APR_WIN_95; + + /* Catch fname length == MAX_PATH since GetFileAttributesEx fails + * with PATH_NOT_FOUND. We would rather indicate length error than + * 'not found' + */ + if (strlen(fname) >= APR_PATH_MAX) { + return APR_ENAMETOOLONG; + } +#ifdef APR_HAS_UNICODE_FS + else if (os_level >= APR_WIN_NT) { + apr_wchar_t wfname[APR_PATH_MAX]; + apr_status_t rv; + if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) + / sizeof(apr_wchar_t), fname)) + return rv; + if (!GetFileAttributesExW(wfname, GetFileExInfoStandard, + &FileInformation)) { + return apr_get_os_error(); } - else if (os_level >= APR_WIN_98) { - if (!GetFileAttributesEx(fname, GetFileExInfoStandard, - &FileInformation)) { - return apr_get_os_error(); + if (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) { + SECURITY_INFORMATION sinf = 0; + PSECURITY_DESCRIPTOR pdesc = NULL; + if (wanted & APR_FINFO_USER) + sinf != OWNER_SECURITY_INFORMATION; + if (wanted & APR_FINFO_GROUP) + sinf != GROUP_SECURITY_INFORMATION; + if (wanted & APR_FINFO_PROT) + sinf != SACL_SECURITY_INFORMATION; + if (!GetNamedSecurityInfoW(wfname, SE_FILE_OBJECT, sinf, + (wanted & APR_FINFO_USER) ? &user : NULL, + (wanted & APR_FINFO_GROUP) ? &grp : NULL, + (wanted & APR_FINFO_PROT) ? &dacl : NULL, + NULL, &pdesc)) { + apr_register_cleanup(cont, pdesc, free_localheap, + apr_null_cleanup); } } - else { - /* What a waste of cpu cycles... but we don't have a choice - */ - HANDLE hFind; - if (strchr(fname, '*') || strchr(fname, '?')) - return APR_ENOENT; - hFind = FindFirstFile(fname, &FileInformation); - if (hFind == INVALID_HANDLE_VALUE) { - return apr_get_os_error(); - } - else { - FindClose(hFind); - } + } +#endif + else if (os_level >= APR_WIN_98) { + if (!GetFileAttributesExA(fname, GetFileExInfoStandard, + &FileInformation)) { + return apr_get_os_error(); + } + } + else { + /* What a waste of cpu cycles... but we don't have a choice + * Be sure we insulate ourselves against bogus wildcards + */ + HANDLE hFind; + if (strchr(fname, '*') || strchr(fname, '?')) + return APR_ENOENT; + hFind = FindFirstFile(fname, &FileInformation); + if (hFind == INVALID_HANDLE_VALUE) { + return apr_get_os_error(); + } + else { + FindClose(hFind); } + } - memset(finfo, '\0', sizeof(*finfo)); - /* Filetype - Directory or file? + memset(finfo, '\0', sizeof(*finfo)); + finfo->cntxt = cont; + finfo->valid = APR_FINFO_ATIME | APR_FINFO_CTIME | APR_FINFO_MTIME + | APR_FINFO_SIZE | APR_FINFO_TYPE; + + /* File times */ + FileTimeToAprTime(&finfo->atime, &FileInformation.ftLastAccessTime); + FileTimeToAprTime(&finfo->ctime, &FileInformation.ftCreationTime); + FileTimeToAprTime(&finfo->mtime, &FileInformation.ftLastWriteTime); + +#if APR_HAS_LARGE_FILES + finfo->size = (apr_off_t)FileInformation.nFileSizeLow + | ((apr_off_t)FileInformation.nFileSizeHigh << 32); +#else + finfo->size = (apr_off_t)FileInformation.nFileSizeLow; + if (finfo->size < 0 || FileInformation.nFileSizeHigh) + finfo->size = 0x7fffffff; +#endif + + /* Filetype - Directory or file? + */ + if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { + finfo->filetype = APR_LNK; + } + else if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + finfo->filetype = APR_DIR; + } + else { + /* XXX: Solve this * Short of opening the handle to the file, the 'FileType' appears * to be unknowable (in any trustworthy or consistent sense), that * is, as far as PIPE, CHR, etc. */ - if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - finfo->protection = S_IFDIR; - finfo->filetype = APR_DIR; - } - else { - finfo->protection = S_IFREG; - finfo->filetype = APR_REG; - } - + finfo->filetype = APR_REG; + } + + if (user) { + finfo->user = user; + finfo->valid |= APR_FINFO_USER; + } + + if (grp) { + finfo->group = grp; + finfo->valid |= APR_FINFO_GROUP; + } + + if (dacl) { + /* Retrieved the discresionary access list */ + + } + else { /* Read, write execute for owner * In the Win32 environment, anything readable is executable - * (well, not entirely 100% true, but I'm looking for a way - * to get at the acl permissions in simplified fashion.) + * (not entirely 100% true, but the dacl is -expensive-!) */ if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { finfo->protection |= S_IREAD | S_IEXEC; @@ -265,29 +382,11 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, else { finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; } + /* Lying through our teeth */ + finfo->valid |= APR_FINFO_UPROT; - /* Is this an executable? Guess based on the file extension? - * This is a rather silly test, IMHO... we are looking to test - * if the user 'may' execute a file (permissions), - * not if the filetype is executable. - * XXX: We need to find a solution, for real. Or provide some - * new mechanism for control. Note that the PATHEXT env var, - * in the format .ext[;.ext]... actually lists the 'executable' - * types (invoking without an extension.) Perhaps a registry - * key test is even appropriate here. - */ - - /* File times */ - FileTimeToAprTime(&finfo->atime, &FileInformation.ftLastAccessTime); - FileTimeToAprTime(&finfo->ctime, &FileInformation.ftCreationTime); - FileTimeToAprTime(&finfo->mtime, &FileInformation.ftLastWriteTime); - - /* Note: This cannot handle files greater than can be held by an int - */ - finfo->size = FileInformation.nFileSizeLow; - if (finfo->size < 0 || FileInformation.nFileSizeHigh) - finfo->size = 0x7fffffff; } + if (wanted & ~finfo->valid) return APR_INCOMPLETE; From d7a232fe370bc4b364109a39f05464d8c117f03f Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sun, 28 Jan 2001 08:18:32 +0000 Subject: [PATCH 1164/7878] Eliminate some missing prototype warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61145 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_getpass.c | 3 +++ strings/apr_strings.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index bfb6457e4ae..92d849b17e8 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -73,6 +73,9 @@ #if HAVE_STDLIB_H #include <stdlib.h> #endif +#if APR_HAVE_STRING_H +#include <string.h> +#endif #if APR_HAVE_STRINGS_H #include <strings.h> #endif diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 15b3c408cb9..affe5126706 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -59,6 +59,9 @@ #ifdef HAVE_STDDEF_H #include <stddef.h> /* NULL */ #endif +#if APR_HAVE_STRING_H +#include <string.h> +#endif #if APR_HAVE_STRINGS_H #include <strings.h> #endif From 8d200db3d11f379c82a7c32d2e0ea463c1836c9a Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Sun, 28 Jan 2001 08:29:54 +0000 Subject: [PATCH 1165/7878] Yeah, it was right, but this gets rid of some compiler warnings too as OS/2's native fd type is an unsigned long. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61146 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 317969e89b1..c7c28e21f8f 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -246,7 +246,7 @@ apr_status_t apr_eof(apr_file_t *fptr) apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { - int fd = 2; + apr_os_file_t fd = 2; return apr_put_os_file(thefile, &fd, cont); } @@ -255,7 +255,7 @@ apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) apr_status_t apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont) { - int fd = 1; /* Is this correct? */ + apr_os_file_t fd = 1; return apr_put_os_file(thefile, &fd, cont); } From eb956413ea5857444a92dfae81fd0ba6ed79f1f2 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sun, 28 Jan 2001 08:59:15 +0000 Subject: [PATCH 1166/7878] Eliminate warning and redundant exit conditions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61147 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getopt.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index b3b065b9793..7d8e112750b 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -209,7 +209,7 @@ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, int *optch, const char **optarg) { const char *p; - int i, len; + int i; /* Let the calling program reset option processing. */ if (os->reset) { @@ -239,15 +239,17 @@ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, p = os->argv[os->ind++] + 1; if (*p == '-' && p[1] != '\0') { /* Long option */ /* Search for the long option name in the caller's table. */ + int len = 0; + p++; - for (i = 0; opts[i].optch != 0; i++) { + for (i = 0; ; i++) { + if (opts[i].optch == 0) /* No match */ + return serr(os, "invalid option", p - 2, APR_BADCH); len = strlen(opts[i].name); if (strncmp(p, opts[i].name, len) == 0 && (p[len] == '\0' || p[len] == '=')) break; } - if (opts[i].optch == 0) /* No match */ - return serr(os, "invalid option", p - 2, APR_BADCH); *optch = opts[i].optch; if (opts[i].has_arg) { @@ -277,12 +279,12 @@ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, * Now we're in a run of short options, and *p is the next one. * Look for it in the caller's table. */ - for (i = 0; opts[i].optch != 0; i++) { + for (i = 0; ; i++) { + if (opts[i].optch == 0) /* No match */ + return cerr(os, "invalid option character", *p, APR_BADCH); if (*p == opts[i].optch) break; } - if (opts[i].optch == 0) /* No match */ - return cerr(os, "invalid option character", *p, APR_BADCH); *optch = *p++; if (opts[i].has_arg) { From e265fd2c9dd771b023bd20b02e99f1f67620673d Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sun, 28 Jan 2001 09:06:04 +0000 Subject: [PATCH 1167/7878] Eliminate another warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61148 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getuuid.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index 28820f00f33..4cd0d36db46 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -66,6 +66,9 @@ #include "apr_uuid.h" #include "apr_md5.h" #include "apr_general.h" +#if APR_HAVE_STRING_H +#include <string.h> +#endif #if APR_HAVE_STRINGS_H #include <strings.h> #endif From 79e3a8b6c3af5d90d968c4f0dc24aca099c7f261 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sun, 28 Jan 2001 09:50:01 +0000 Subject: [PATCH 1168/7878] Remove compiler warnings due to lack of string.h and bad const on the second argument of iconv (the Linux man pages show an incorrect prototype -- the header files and single Unix spec say that there is no const). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61149 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/xlate.c | 9 ++++++--- include/apr_xlate.h | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 157f6c6b093..2fa1f9d5653 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -67,6 +67,9 @@ #ifdef HAVE_STDDEF_H #include <stddef.h> /* for NULL */ #endif +#if APR_HAVE_STRING_H +#include <string.h> +#endif #if APR_HAVE_STRINGS_H #include <strings.h> #endif @@ -180,7 +183,7 @@ static apr_status_t apr_xlate_cleanup(void *convset) static void check_sbcs(apr_xlate_t *convset) { char inbuf[256], outbuf[256]; - const char *inbufptr = inbuf; + char *inbufptr = inbuf; char *outbufptr = outbuf; size_t inbytes_left, outbytes_left; int i; @@ -273,7 +276,7 @@ apr_status_t apr_xlate_get_sb(apr_xlate_t *convset, int *onoff) return APR_SUCCESS; } -apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, +apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, char *inbuf, apr_size_t *inbytes_left, char *outbuf, apr_size_t *outbytes_left) { @@ -282,7 +285,7 @@ apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, size_t translated; if (convset->ich != (iconv_t)-1) { - const char *inbufptr = inbuf; + char *inbufptr = inbuf; char *outbufptr = outbuf; translated = iconv(convset->ich, &inbufptr, diff --git a/include/apr_xlate.h b/include/apr_xlate.h index caa2d93f472..0f5630451b4 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -126,10 +126,10 @@ APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff); * @param outbuf The address of the destination buffer * @param outbytes_left Input: the size of the output buffer * Output: the amount of the output buffer not yet used - * @deffunc apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, apr_size_t *inbytes_left, char *outbuf, apr_size_t *outbytes_left) + * @deffunc apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, char *inbuf, apr_size_t *inbytes_left, char *outbuf, apr_size_t *outbytes_left) */ APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, - const char *inbuf, + char *inbuf, apr_size_t *inbytes_left, char *outbuf, apr_size_t *outbytes_left); From 9a7c17d4e04235164e1c99da44836b0f5e836b7e Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sun, 28 Jan 2001 10:33:52 +0000 Subject: [PATCH 1169/7878] Eliminate the APR_SIG* aliases for standard signal names, since they serve no useful purpose. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61150 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ include/apr_general.h | 91 ----------------------------------------- lib/apr_pools.c | 6 +-- memory/unix/apr_pools.c | 6 +-- 4 files changed, 9 insertions(+), 97 deletions(-) diff --git a/CHANGES b/CHANGES index 107bb94cc54..793333c33fd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Eliminate the APR_SIG* aliases for standard signal names, + since they serve no useful purpose. [Roy Felding] + *) Abstracted apr_get_username and apr_get_groupname for unix and win32. Modified Win32 apr_uid_t and apr_gid_t to use PSIDs, and elimintated the uid_t and gid_t definitions. diff --git a/include/apr_general.h b/include/apr_general.h index 776bf986b62..3c9def4aadb 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -78,97 +78,6 @@ extern "C" { typedef int apr_signum_t; -#ifdef SIGHUP -#define APR_SIGHUP SIGHUP -#endif -#ifdef SIGINT -#define APR_SIGINT SIGINT -#endif -#ifdef SIGQUIT -#define APR_SIGQUIT SIGQUIT -#endif -#ifdef SIGILL -#define APR_SIGILL SIGILL -#endif -#ifdef SIGTRAP -#define APR_SIGTRAP SIGTRAP -#endif -#ifdef SIGABRT -#define APR_SIGABRT SIGABRT -#endif -#ifdef SIGIOT -#define APR_SIGIOT SIGIOT -#endif -#ifdef SIGBUS -#define APR_SIGBUS SIGBUS -#endif -#ifdef SIGFPE -#define APR_SIGFPE SIGFPE -#endif -#ifdef SIGKILL -#define APR_SIGKILL SIGKILL -#endif -#ifdef SIGUSR1 -#define APR_SIGUSR1 SIGUSR1 -#endif -#ifdef SIGSEGV -#define APR_SIGSEGV SIGSEGV -#endif -#ifdef SIGUSR2 -#define APR_SIGUSR2 SIGUSR2 -#endif -#ifdef SIGPIPE -#define APR_SIGPIPE SIGPIPE -#endif -#ifdef SIGALRM -#define APR_SIGALRM SIGALRM -#endif -#ifdef SIGTERM -#define APR_SIGTERM SIGTERM -#endif -#ifdef SIGSTKFLT -#define APR_SIGSTKFLT SIGSTKFLT -#endif -#ifdef SIGCHLD -#define APR_SIGCHLD SIGCHLD -#endif -#ifdef SIGCONT -#define APR_SIGCONT SIGCONT -#endif -#ifdef SIGSTOP -#define APR_SIGSTOP SIGSTOP -#endif -#ifdef SIGTSTP -#define APR_SIGTSTP SIGTSTP -#endif -#ifdef SIGTTIN -#define APR_SIGTTIN SIGTTIN -#endif -#ifdef SIGTTOU -#define APR_SIGTTOU SIGTTOU -#endif -#ifdef SIGURG -#define APR_SIGURG SIGURG -#endif -#ifdef SIGXCPU -#define APR_SIGXCPU SIGXCPU -#endif -#ifdef SIGXFSZ -#define APR_SIGXFSZ SIGXFSZ -#endif -#ifdef SIGVTALRM -#define APR_SIGVTALRM SIGVTALRM -#endif -#ifdef SIGPROF -#define APR_SIGPROF SIGPROF -#endif -#ifdef SIGWINCH -#define APR_SIGWINCH SIGWINCH -#endif -#ifdef SIGIO -#define APR_SIGIO SIGIO -#endif - #ifdef WIN32 #define APR_INLINE __inline #elif defined(__GNUC__) && defined(__GNUC__) && \ diff --git a/lib/apr_pools.c b/lib/apr_pools.c index cbdc7f0545a..b23620621d2 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -1255,13 +1255,13 @@ static void free_proc_chain(struct process_chain *procs) #ifdef WIN32 need_timeout = 1; #else - if (apr_kill(p->pid, APR_SIGTERM) == APR_SUCCESS) { + if (apr_kill(p->pid, SIGTERM) == APR_SUCCESS) { need_timeout = 1; } #endif } else if (p->kill_how == kill_always) { - apr_kill(p->pid, APR_SIGKILL); + apr_kill(p->pid, SIGKILL); } } @@ -1276,7 +1276,7 @@ static void free_proc_chain(struct process_chain *procs) */ for (p = procs; p; p = p->next) { if (p->kill_how == kill_after_timeout) { - apr_kill(p->pid, APR_SIGKILL); + apr_kill(p->pid, SIGKILL); } } #ifdef WIN32 diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index cbdc7f0545a..b23620621d2 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1255,13 +1255,13 @@ static void free_proc_chain(struct process_chain *procs) #ifdef WIN32 need_timeout = 1; #else - if (apr_kill(p->pid, APR_SIGTERM) == APR_SUCCESS) { + if (apr_kill(p->pid, SIGTERM) == APR_SUCCESS) { need_timeout = 1; } #endif } else if (p->kill_how == kill_always) { - apr_kill(p->pid, APR_SIGKILL); + apr_kill(p->pid, SIGKILL); } } @@ -1276,7 +1276,7 @@ static void free_proc_chain(struct process_chain *procs) */ for (p = procs; p; p = p->next) { if (p->kill_how == kill_after_timeout) { - apr_kill(p->pid, APR_SIGKILL); + apr_kill(p->pid, SIGKILL); } } #ifdef WIN32 From bf1bf169d4d2abf6b0cfde82b7cac9ad7171acf7 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sun, 28 Jan 2001 10:35:56 +0000 Subject: [PATCH 1170/7878] Time to clean my contacts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61151 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 793333c33fd..04dd9997b02 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,7 @@ Changes with APR b1 *) Eliminate the APR_SIG* aliases for standard signal names, - since they serve no useful purpose. [Roy Felding] + since they serve no useful purpose. [Roy Fielding] *) Abstracted apr_get_username and apr_get_groupname for unix and win32. Modified Win32 apr_uid_t and apr_gid_t to use PSIDs, and elimintated From 1397b5b747f12ca5aa6617f21a3166de4bc720fc Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sun, 28 Jan 2001 11:33:54 +0000 Subject: [PATCH 1171/7878] Revert last change and solve warning by explicit cast. The need would have been obvious if dependencies were in the Makefile. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61152 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/xlate.c | 4 ++-- include/apr_xlate.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 2fa1f9d5653..b358d5f6c81 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -276,7 +276,7 @@ apr_status_t apr_xlate_get_sb(apr_xlate_t *convset, int *onoff) return APR_SUCCESS; } -apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, char *inbuf, +apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, apr_size_t *inbytes_left, char *outbuf, apr_size_t *outbytes_left) { @@ -285,7 +285,7 @@ apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, char *inbuf, size_t translated; if (convset->ich != (iconv_t)-1) { - char *inbufptr = inbuf; + char *inbufptr = (char *)inbuf; char *outbufptr = outbuf; translated = iconv(convset->ich, &inbufptr, diff --git a/include/apr_xlate.h b/include/apr_xlate.h index 0f5630451b4..caa2d93f472 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -126,10 +126,10 @@ APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff); * @param outbuf The address of the destination buffer * @param outbytes_left Input: the size of the output buffer * Output: the amount of the output buffer not yet used - * @deffunc apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, char *inbuf, apr_size_t *inbytes_left, char *outbuf, apr_size_t *outbytes_left) + * @deffunc apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, apr_size_t *inbytes_left, char *outbuf, apr_size_t *outbytes_left) */ APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, - char *inbuf, + const char *inbuf, apr_size_t *inbytes_left, char *outbuf, apr_size_t *outbytes_left); From cdf53ef4d27dd5b1a2c1a85ddff27f911c7a00d5 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Sun, 28 Jan 2001 11:42:31 +0000 Subject: [PATCH 1172/7878] Don't add libmm.la to the list of libraries to link if it's not getting built. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61153 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index e7749879970..89b72387d8f 100644 --- a/configure.in +++ b/configure.in @@ -168,7 +168,9 @@ if test "$ac_cv_enable_shmem" = "mm"; then sharedmem="1" anonymous_shm="1" AC_MSG_RESULT(anonymous) - LIBTOOL_LIBS="$abs_builddir/shmem/unix/mm/libmm.la" + if test "$USE_MM" = "yes"; then + LIBTOOL_LIBS="$abs_builddir/shmem/unix/mm/libmm.la" + fi elif test "$ac_cv_enable_shmem" = "file"; then sharedmem="1" filebased_shm="1" From 23bf984da7ea22d1caf8f24e79e6b0a3dc2cd0c7 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Sun, 28 Jan 2001 12:09:31 +0000 Subject: [PATCH 1173/7878] Update the status file after that very subtle and oh so gentle reminder from OtherBill. Thanks :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61154 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/STATUS b/STATUS index a5eb1c44970..28680aad900 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/28 02:13:18 $] +Last modified at [$Date: 2001/01/28 12:09:31 $] Release: @@ -48,7 +48,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * add a version number to apr_initialize() as an extra failsafe against (APR) library version skew. MsgID: <Pine.LNX.4.10.10005231712380.31927-100000@nebula.lyra.org> - Status: Greg +1 (volunteers), Jeff +1, Ryan +1, Tony -0(?) + Status: Greg +1 (volunteers), Jeff +1, Ryan +1, Tony -0(?), david +1 * The MM library is built as static and shared library. This should be set up to build only the required version. @@ -62,6 +62,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: - It ignores the "type" parameter, so toss it. - The fname param is allowed to be NULL on the Unix platform. Change it to always use the passed value, and check callers. + Status: david +1 * configure.in does post-processing on the AC_OUTPUT files (for VPATH support). This means that config.status doesn't do the @@ -83,6 +84,12 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * use os_(un)cork in network_io/unix/sendrecv.c for FreeBSD's sendfile implementation. + david: The socket options stuff is now in and using it should + reduce the number of syscalls that are required for + os_cork and uncork, so the code should be reviewed to + make use of the new calls. If no-one beats me to it I'll + get around to it soonish... + * toss the per-Makefile setup of INCLUDES; shift to rules.mk.in * Change the return type of apr_hash_count() to some counter type @@ -98,8 +105,3 @@ Documentation that needs writing: Stuff waiting for code thawing after Beta 1: - * socket options patch - this is an attempt to track and cache - the various options we have set on a socket to avoid needless - systems calls to discover if an option is set or not... - http://www.apache.org/~dreid/sockopt_diff - From f998a0239aad26bb1876d6bb127be2faf48bba8b Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sun, 28 Jan 2001 12:18:38 +0000 Subject: [PATCH 1174/7878] Remove --with-optim option in favor of OPTIM env variable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61155 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ configure.in | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 04dd9997b02..f1ef8d60096 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Replace configure --with-optim option by using the environment + variable OPTIM instead. This is needed because configure options + do not support multiple flags separated by spaces. [Roy Fielding] + *) Eliminate the APR_SIG* aliases for standard signal names, since they serve no useful purpose. [Roy Fielding] diff --git a/configure.in b/configure.in index 89b72387d8f..c6b512e03cb 100644 --- a/configure.in +++ b/configure.in @@ -69,8 +69,6 @@ dnl #----------------------------- Checks for compiler flags nl=' ' echo $ac_n "${nl}Check for compiler flags..." -AC_ARG_WITH(optim,[ --with-optim="FLAGS" compiler optimisation flags], - [OPTIM="$withval"]) AC_ARG_WITH(debug,[ --with-debug Turn on debugging and compile time warnings], [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall"; else CFLAGS="$CFLAGS -g"; fi]) From a6cfa35f8710c855e8797eac4f1ce30f91dc5f19 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 15:30:32 +0000 Subject: [PATCH 1175/7878] OS2 was chasing os2errno.h which we hid in a private platform directory, but apr_errno.h is public. It also called in <os.h> with possibly inappropriate headers, and if os2.h follows any other header's usual conventions, calling it the second time for more declarations can be dicey. Relocated <os2.h> into apr.h.in (accessable to all, since it's later leveraged by most), which simplifies a bunch of code, and relocate all of the os2errno values into apr_errno.h for APR_STATUS_IS_FOO tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61156 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 7 +- apr.mak | 158 ++++ dso/os2/dso.c | 2 - file_io/os2/dir.c | 3 - file_io/os2/filedup.c | 3 - file_io/os2/filestat.c | 1 - file_io/os2/maperrorcode.c | 4 +- file_io/os2/readwrite.c | 1 - file_io/os2/seek.c | 4 - include/apr.h.in | 6 + include/apr_errno.h | 50 +- include/apr_portable.h | 2 - include/arch/os2/dso.h | 3 - include/arch/os2/fileio.h | 4 - include/arch/os2/locks.h | 2 - include/arch/os2/os2calls.h | 2 +- include/arch/os2/os2nerrno.h | 51 -- libapr.dsp | 7 +- libapr.mak | 1404 ++++++++++++++++++++++++++++++++-- locks/os2/locks.c | 2 - misc/unix/errorcodes.c | 2 - network_io/os2/os2calls.c | 2 - network_io/os2/os2calls.h | 93 --- network_io/os2/os2nerrno.h | 51 -- network_io/os2/poll.c | 2 - shmem/os2/shmem.c | 2 - test/aprtest.dsp | 3 +- threadproc/os2/proc.c | 1 - threadproc/os2/signals.c | 2 - threadproc/os2/thread.c | 1 - time/unix/time.c | 4 - 31 files changed, 1576 insertions(+), 303 deletions(-) delete mode 100644 include/arch/os2/os2nerrno.h delete mode 100644 network_io/os2/os2calls.h delete mode 100644 network_io/os2/os2nerrno.h diff --git a/apr.dsp b/apr.dsp index 4039aa632ba..e2e39b32059 100644 --- a/apr.dsp +++ b/apr.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="apr" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 @@ -22,7 +22,6 @@ CFG=apr - Win32 Debug !MESSAGE # Begin Project -# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -64,8 +63,8 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe diff --git a/apr.mak b/apr.mak index 84d3d88f980..ecf88f341bd 100644 --- a/apr.mak +++ b/apr.mak @@ -68,6 +68,7 @@ CLEAN : -@erase "$(INTDIR)\fullrw.obj" -@erase "$(INTDIR)\getopt.obj" -@erase "$(INTDIR)\getuuid.obj" + -@erase "$(INTDIR)\groupinfo.obj" -@erase "$(INTDIR)\inet_ntop.obj" -@erase "$(INTDIR)\locks.obj" -@erase "$(INTDIR)\misc.obj" @@ -90,6 +91,7 @@ CLEAN : -@erase "$(INTDIR)\threadpriv.obj" -@erase "$(INTDIR)\time.obj" -@erase "$(INTDIR)\timestr.obj" + -@erase "$(INTDIR)\userinfo.obj" -@erase "$(INTDIR)\utf8_ucs2.obj" -@erase "$(INTDIR)\uuid.obj" -@erase "$(OUTDIR)\apr.lib" @@ -166,6 +168,7 @@ LIB32_OBJS= \ "$(INTDIR)\fullrw.obj" \ "$(INTDIR)\getopt.obj" \ "$(INTDIR)\getuuid.obj" \ + "$(INTDIR)\groupinfo.obj" \ "$(INTDIR)\inet_ntop.obj" \ "$(INTDIR)\locks.obj" \ "$(INTDIR)\misc.obj" \ @@ -188,6 +191,7 @@ LIB32_OBJS= \ "$(INTDIR)\threadpriv.obj" \ "$(INTDIR)\time.obj" \ "$(INTDIR)\timestr.obj" \ + "$(INTDIR)\userinfo.obj" \ "$(INTDIR)\utf8_ucs2.obj" \ "$(INTDIR)\uuid.obj" @@ -240,6 +244,7 @@ CLEAN : -@erase "$(INTDIR)\fullrw.obj" -@erase "$(INTDIR)\getopt.obj" -@erase "$(INTDIR)\getuuid.obj" + -@erase "$(INTDIR)\groupinfo.obj" -@erase "$(INTDIR)\inet_ntop.obj" -@erase "$(INTDIR)\locks.obj" -@erase "$(INTDIR)\misc.obj" @@ -262,6 +267,7 @@ CLEAN : -@erase "$(INTDIR)\threadpriv.obj" -@erase "$(INTDIR)\time.obj" -@erase "$(INTDIR)\timestr.obj" + -@erase "$(INTDIR)\userinfo.obj" -@erase "$(INTDIR)\utf8_ucs2.obj" -@erase "$(INTDIR)\uuid.obj" -@erase "$(OUTDIR)\apr.lib" @@ -338,6 +344,7 @@ LIB32_OBJS= \ "$(INTDIR)\fullrw.obj" \ "$(INTDIR)\getopt.obj" \ "$(INTDIR)\getuuid.obj" \ + "$(INTDIR)\groupinfo.obj" \ "$(INTDIR)\inet_ntop.obj" \ "$(INTDIR)\locks.obj" \ "$(INTDIR)\misc.obj" \ @@ -360,6 +367,7 @@ LIB32_OBJS= \ "$(INTDIR)\threadpriv.obj" \ "$(INTDIR)\time.obj" \ "$(INTDIR)\timestr.obj" \ + "$(INTDIR)\userinfo.obj" \ "$(INTDIR)\utf8_ucs2.obj" \ "$(INTDIR)\uuid.obj" @@ -395,6 +403,7 @@ DEP_CPP_TIME_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_lib.h"\ @@ -404,6 +413,8 @@ DEP_CPP_TIME_=\ ".\include\apr_portable.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -418,6 +429,7 @@ DEP_CPP_TIMES=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -425,6 +437,8 @@ DEP_CPP_TIMES=\ ".\include\apr_portable.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -470,11 +484,14 @@ SOURCE=.\strings\apr_snprintf.c DEP_CPP_APR_S=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_lib.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -588,6 +605,7 @@ DEP_CPP_ERROR=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -596,6 +614,8 @@ DEP_CPP_ERROR=\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -610,6 +630,7 @@ SOURCE=.\misc\unix\getopt.c DEP_CPP_GETOP=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -617,6 +638,8 @@ DEP_CPP_GETOP=\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -644,12 +667,15 @@ SOURCE=.\misc\win32\misc.c DEP_CPP_MISC_=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_pools.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -663,12 +689,15 @@ SOURCE=.\misc\win32\names.c DEP_CPP_NAMES=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ ".\include\apr_strings.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -696,6 +725,7 @@ SOURCE=.\misc\unix\start.c DEP_CPP_START=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -703,6 +733,8 @@ DEP_CPP_START=\ ".\include\apr_pools.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\locks.h"\ @@ -733,6 +765,7 @@ DEP_CPP_DIR_C=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -744,6 +777,8 @@ DEP_CPP_DIR_C=\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ @@ -761,6 +796,7 @@ SOURCE=.\file_io\unix\fileacc.c DEP_CPP_FILEA=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -770,6 +806,8 @@ DEP_CPP_FILEA=\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ @@ -787,6 +825,7 @@ SOURCE=.\file_io\win32\filedup.c DEP_CPP_FILED=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -796,6 +835,8 @@ DEP_CPP_FILED=\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ @@ -813,14 +854,18 @@ SOURCE=.\file_io\win32\filestat.c DEP_CPP_FILES=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ @@ -839,6 +884,7 @@ SOURCE=.\file_io\win32\flock.c DEP_CPP_FLOCK=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -847,6 +893,8 @@ DEP_CPP_FLOCK=\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ @@ -864,9 +912,12 @@ SOURCE=.\file_io\unix\fullrw.c DEP_CPP_FULLR=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -880,6 +931,7 @@ DEP_CPP_OPEN_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -891,6 +943,8 @@ DEP_CPP_OPEN_=\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ @@ -907,6 +961,7 @@ SOURCE=.\file_io\win32\pipe.c DEP_CPP_PIPE_=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -916,6 +971,8 @@ DEP_CPP_PIPE_=\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ @@ -932,6 +989,7 @@ SOURCE=.\file_io\win32\readwrite.c DEP_CPP_READW=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -941,6 +999,8 @@ DEP_CPP_READW=\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ @@ -959,6 +1019,7 @@ SOURCE=.\file_io\win32\seek.c DEP_CPP_SEEK_=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -967,6 +1028,8 @@ DEP_CPP_SEEK_=\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ @@ -984,6 +1047,7 @@ DEP_CPP_LOCKS=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_lock.h"\ @@ -993,6 +1057,8 @@ DEP_CPP_LOCKS=\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\locks.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -1006,11 +1072,14 @@ SOURCE=.\network_io\unix\inet_ntop.c DEP_CPP_INET_=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\networkio.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -1025,12 +1094,15 @@ SOURCE=.\network_io\win32\poll.c DEP_CPP_POLL_=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_lib.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -1044,6 +1116,7 @@ SOURCE=.\network_io\win32\sendrecv.c DEP_CPP_SENDR=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -1054,6 +1127,8 @@ DEP_CPP_SENDR=\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ @@ -1072,6 +1147,7 @@ SOURCE=.\network_io\win32\sockaddr.c DEP_CPP_SOCKA=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_lib.h"\ @@ -1079,6 +1155,8 @@ DEP_CPP_SOCKA=\ ".\include\apr_pools.h"\ ".\include\apr_strings.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ ".\network_io\os2\os2nerrno.h"\ ".\network_io\unix\sa_common.c"\ @@ -1094,6 +1172,7 @@ DEP_CPP_SOCKE=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_lib.h"\ @@ -1103,6 +1182,8 @@ DEP_CPP_SOCKE=\ ".\include\apr_portable.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -1116,12 +1197,15 @@ SOURCE=.\network_io\win32\sockopt.c DEP_CPP_SOCKO=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_strings.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -1136,6 +1220,7 @@ DEP_CPP_PROC_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -1147,6 +1232,8 @@ DEP_CPP_PROC_=\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ @@ -1164,6 +1251,7 @@ SOURCE=.\threadproc\win32\signals.c DEP_CPP_SIGNA=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -1172,6 +1260,8 @@ DEP_CPP_SIGNA=\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ @@ -1191,6 +1281,7 @@ DEP_CPP_THREA=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_lib.h"\ @@ -1200,6 +1291,8 @@ DEP_CPP_THREA=\ ".\include\apr_portable.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\threadproc.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -1215,6 +1308,7 @@ DEP_CPP_THREAD=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_lib.h"\ @@ -1224,6 +1318,8 @@ DEP_CPP_THREAD=\ ".\include\apr_portable.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\threadproc.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -1239,6 +1335,7 @@ DEP_CPP_DSO_C=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -1248,6 +1345,8 @@ DEP_CPP_DSO_C=\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ @@ -1266,6 +1365,7 @@ DEP_CPP_APR_P=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_hash.h"\ @@ -1277,6 +1377,8 @@ DEP_CPP_APR_P=\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -1321,10 +1423,13 @@ SOURCE=.\mmap\unix\common.c DEP_CPP_COMMO=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_mmap.h"\ ".\include\apr_pools.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\network_io\os2\os2nerrno.h"\ @@ -1339,6 +1444,7 @@ DEP_CPP_MMAP_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ @@ -1350,6 +1456,8 @@ DEP_CPP_MMAP_=\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ @@ -1362,6 +1470,56 @@ DEP_CPP_MMAP_=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\user\win32\groupinfo.c +DEP_CPP_GROUP=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\groupinfo.obj" : $(SOURCE) $(DEP_CPP_GROUP) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\user\win32\userinfo.c +DEP_CPP_USERI=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\include\apr.hw !IF "$(CFG)" == "apr - Win32 Release" diff --git a/dso/os2/dso.c b/dso/os2/dso.c index d3d6a17e550..bceef2e06e3 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -54,8 +54,6 @@ #include "dso.h" #include "apr_strings.h" -#define INCL_DOS -#include <os2.h> #include <stdio.h> #include <string.h> diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index fc7c43223a6..61a21269cd5 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -58,9 +58,6 @@ #include "apr_strings.h" #include <string.h> -#define INCL_DOS -#include <os2.h> - static apr_status_t dir_cleanup(void *thedir) { apr_dir_t *dir = thedir; diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index ee52fcddb7d..8bece3dceae 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -58,9 +58,6 @@ #include "apr_strings.h" #include <string.h> -#define INCL_DOS -#include <os2.h> - apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { int rv; diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 8a28e17690f..ec055908ad1 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -58,7 +58,6 @@ #include "apr_file_io.h" #include "apr_lib.h" #include <sys/time.h> -#include <os2.h> static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus) diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c index 5fa39815113..36cba058d88 100644 --- a/file_io/os2/maperrorcode.c +++ b/file_io/os2/maperrorcode.c @@ -57,9 +57,7 @@ #include "apr_file_io.h" #include <errno.h> #include <string.h> -#include <os2.h> -#include "../../network_io/os2/os2calls.h" - +#include "apr_errno.h" static int errormap[][2] = { { NO_ERROR, APR_SUCCESS }, diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 282766a4368..f6dbd02551e 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -59,7 +59,6 @@ #include "apr_file_io.h" #include "apr_lib.h" -#include <os2.h> #include <malloc.h> apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index fa1d6792b8d..076fe93bc61 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -58,10 +58,6 @@ #include <string.h> #include <io.h> -#define INCL_DOS -#include <os2.h> - - static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) { diff --git a/include/apr.h.in b/include/apr.h.in index bb128b1f2b5..583e4bfddb9 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -243,4 +243,10 @@ Sigfunc *apr_signal(int signo, Sigfunc * func); #endif /* !WEXITSTATUS */ #endif /* HAVE_SYS_WAIT_H */ +#ifdef OS2 +#define INCL_DOS +#define INCL_DOSERRORS +#include <os2.h> +#endif + #endif /* APR_H */ diff --git a/include/apr_errno.h b/include/apr_errno.h index 8cab6a2b52e..de6e65809ac 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -457,8 +457,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define INCL_DOSERRORS #define INCL_DOS -#include <os2.h> -#include "../network_io/os2/os2nerrno.h" /* And this needs to be greped away for good: */ #define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e)) @@ -466,6 +464,54 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS \ || (s) == APR_OS_START_SYSERR + NO_ERROR) +/* These can't sit in a private header, so in spite of the extra size, + * they need to be made available here. + */ +#define SOCBASEERR 10000 +#define SOCEPERM (SOCBASEERR+1) /* Not owner */ +#define SOCESRCH (SOCBASEERR+3) /* No such process */ +#define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */ +#define SOCENXIO (SOCBASEERR+6) /* No such device or address */ +#define SOCEBADF (SOCBASEERR+9) /* Bad file number */ +#define SOCEACCES (SOCBASEERR+13) /* Permission denied */ +#define SOCEFAULT (SOCBASEERR+14) /* Bad address */ +#define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */ +#define SOCEMFILE (SOCBASEERR+24) /* Too many open files */ +#define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ +#define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ +#define SOCEWOULDBLOCK (SOCBASEERR+35) /* Operation would block */ +#define SOCEINPROGRESS (SOCBASEERR+36) /* Operation now in progress */ +#define SOCEALREADY (SOCBASEERR+37) /* Operation already in progress */ +#define SOCENOTSOCK (SOCBASEERR+38) /* Socket operation on non-socket */ +#define SOCEDESTADDRREQ (SOCBASEERR+39) /* Destination address required */ +#define SOCEMSGSIZE (SOCBASEERR+40) /* Message too long */ +#define SOCEPROTOTYPE (SOCBASEERR+41) /* Protocol wrong type for socket */ +#define SOCENOPROTOOPT (SOCBASEERR+42) /* Protocol not available */ +#define SOCEPROTONOSUPPORT (SOCBASEERR+43) /* Protocol not supported */ +#define SOCESOCKTNOSUPPORT (SOCBASEERR+44) /* Socket type not supported */ +#define SOCEOPNOTSUPP (SOCBASEERR+45) /* Operation not supported on socket */ +#define SOCEPFNOSUPPORT (SOCBASEERR+46) /* Protocol family not supported */ +#define SOCEAFNOSUPPORT (SOCBASEERR+47) /* Address family not supported by protocol family */ +#define SOCEADDRINUSE (SOCBASEERR+48) /* Address already in use */ +#define SOCEADDRNOTAVAIL (SOCBASEERR+49) /* Can't assign requested address */ +#define SOCENETDOWN (SOCBASEERR+50) /* Network is down */ +#define SOCENETUNREACH (SOCBASEERR+51) /* Network is unreachable */ +#define SOCENETRESET (SOCBASEERR+52) /* Network dropped connection on reset */ +#define SOCECONNABORTED (SOCBASEERR+53) /* Software caused connection abort */ +#define SOCECONNRESET (SOCBASEERR+54) /* Connection reset by peer */ +#define SOCENOBUFS (SOCBASEERR+55) /* No buffer space available */ +#define SOCEISCONN (SOCBASEERR+56) /* Socket is already connected */ +#define SOCENOTCONN (SOCBASEERR+57) /* Socket is not connected */ +#define SOCESHUTDOWN (SOCBASEERR+58) /* Can't send after socket shutdown */ +#define SOCETOOMANYREFS (SOCBASEERR+59) /* Too many references: can't splice */ +#define SOCETIMEDOUT (SOCBASEERR+60) /* Connection timed out */ +#define SOCECONNREFUSED (SOCBASEERR+61) /* Connection refused */ +#define SOCELOOP (SOCBASEERR+62) /* Too many levels of symbolic links */ +#define SOCENAMETOOLONG (SOCBASEERR+63) /* File name too long */ +#define SOCEHOSTDOWN (SOCBASEERR+64) /* Host is down */ +#define SOCEHOSTUNREACH (SOCBASEERR+65) /* No route to host */ +#define SOCENOTEMPTY (SOCBASEERR+66) /* Directory not empty */ + /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \ diff --git a/include/apr_portable.h b/include/apr_portable.h index 24683fcd330..5eec7971d7b 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -103,8 +103,6 @@ typedef FILETIME apr_os_imp_time_t; typedef SYSTEMTIME apr_os_exp_time_t; #elif defined(OS2) -#define INCL_DOS -#include <os2.h> typedef HFILE apr_os_file_t; typedef HDIR apr_os_dir_t; typedef int apr_os_sock_t; diff --git a/include/arch/os2/dso.h b/include/arch/os2/dso.h index 1597c81d112..dd3e9223de8 100644 --- a/include/arch/os2/dso.h +++ b/include/arch/os2/dso.h @@ -55,9 +55,6 @@ #ifndef DSO_H #define DSO_H -#define INCL_DOS -#include <os2.h> - #include "apr_private.h" #include "apr_general.h" #include "apr_pools.h" diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index d1abad34ae5..a34b05d857a 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -55,10 +55,6 @@ #ifndef FILE_IO_H #define FILE_IO_H -#define INCL_DOS -#define INCL_DOSERRORS -#include <os2.h> - #include "apr_private.h" #include "apr_general.h" #include "apr_lock.h" diff --git a/include/arch/os2/locks.h b/include/arch/os2/locks.h index 50ffdc65216..6864e49bec7 100644 --- a/include/arch/os2/locks.h +++ b/include/arch/os2/locks.h @@ -57,8 +57,6 @@ #include "apr_lock.h" #include "apr_file_io.h" -#define INCL_DOS -#include <os2.h> struct apr_lock_t { apr_pool_t *cntxt; diff --git a/include/arch/os2/os2calls.h b/include/arch/os2/os2calls.h index 8a8b83bd0db..2dcb86c6785 100644 --- a/include/arch/os2/os2calls.h +++ b/include/arch/os2/os2calls.h @@ -52,9 +52,9 @@ * <http://www.apache.org/>. */ +#include "apr_errno.h" #include <sys/types.h> #include <sys/socket.h> -#include "os2nerrno.h" extern int (*apr_os2_socket)(int, int, int); extern int (*apr_os2_select)(int *, int, int, int, long); diff --git a/include/arch/os2/os2nerrno.h b/include/arch/os2/os2nerrno.h deleted file mode 100644 index 0d6b444e206..00000000000 --- a/include/arch/os2/os2nerrno.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef __OS2NERRNO_H -#define __OS2NERRNO_H - -/* Error codes returned by above calls */ -#define SOCBASEERR 10000 - -#define SOCEPERM (SOCBASEERR+1) /* Not owner */ -#define SOCESRCH (SOCBASEERR+3) /* No such process */ -#define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */ -#define SOCENXIO (SOCBASEERR+6) /* No such device or address */ -#define SOCEBADF (SOCBASEERR+9) /* Bad file number */ -#define SOCEACCES (SOCBASEERR+13) /* Permission denied */ -#define SOCEFAULT (SOCBASEERR+14) /* Bad address */ -#define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */ -#define SOCEMFILE (SOCBASEERR+24) /* Too many open files */ -#define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ -#define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ -#define SOCEWOULDBLOCK (SOCBASEERR+35) /* Operation would block */ -#define SOCEINPROGRESS (SOCBASEERR+36) /* Operation now in progress */ -#define SOCEALREADY (SOCBASEERR+37) /* Operation already in progress */ -#define SOCENOTSOCK (SOCBASEERR+38) /* Socket operation on non-socket */ -#define SOCEDESTADDRREQ (SOCBASEERR+39) /* Destination address required */ -#define SOCEMSGSIZE (SOCBASEERR+40) /* Message too long */ -#define SOCEPROTOTYPE (SOCBASEERR+41) /* Protocol wrong type for socket */ -#define SOCENOPROTOOPT (SOCBASEERR+42) /* Protocol not available */ -#define SOCEPROTONOSUPPORT (SOCBASEERR+43) /* Protocol not supported */ -#define SOCESOCKTNOSUPPORT (SOCBASEERR+44) /* Socket type not supported */ -#define SOCEOPNOTSUPP (SOCBASEERR+45) /* Operation not supported on socket */ -#define SOCEPFNOSUPPORT (SOCBASEERR+46) /* Protocol family not supported */ -#define SOCEAFNOSUPPORT (SOCBASEERR+47) /* Address family not supported by protocol family */ -#define SOCEADDRINUSE (SOCBASEERR+48) /* Address already in use */ -#define SOCEADDRNOTAVAIL (SOCBASEERR+49) /* Can't assign requested address */ -#define SOCENETDOWN (SOCBASEERR+50) /* Network is down */ -#define SOCENETUNREACH (SOCBASEERR+51) /* Network is unreachable */ -#define SOCENETRESET (SOCBASEERR+52) /* Network dropped connection on reset */ -#define SOCECONNABORTED (SOCBASEERR+53) /* Software caused connection abort */ -#define SOCECONNRESET (SOCBASEERR+54) /* Connection reset by peer */ -#define SOCENOBUFS (SOCBASEERR+55) /* No buffer space available */ -#define SOCEISCONN (SOCBASEERR+56) /* Socket is already connected */ -#define SOCENOTCONN (SOCBASEERR+57) /* Socket is not connected */ -#define SOCESHUTDOWN (SOCBASEERR+58) /* Can't send after socket shutdown */ -#define SOCETOOMANYREFS (SOCBASEERR+59) /* Too many references: can't splice */ -#define SOCETIMEDOUT (SOCBASEERR+60) /* Connection timed out */ -#define SOCECONNREFUSED (SOCBASEERR+61) /* Connection refused */ -#define SOCELOOP (SOCBASEERR+62) /* Too many levels of symbolic links */ -#define SOCENAMETOOLONG (SOCBASEERR+63) /* File name too long */ -#define SOCEHOSTDOWN (SOCBASEERR+64) /* Host is down */ -#define SOCEHOSTUNREACH (SOCBASEERR+65) /* No route to host */ -#define SOCENOTEMPTY (SOCBASEERR+66) /* Directory not empty */ - -#endif diff --git a/libapr.dsp b/libapr.dsp index 40ef2bec349..fbb6f0083a1 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="libapr" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 @@ -22,7 +22,6 @@ CFG=libapr - Win32 Debug !MESSAGE # Begin Project -# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -68,8 +67,8 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\apr" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\apr" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" diff --git a/libapr.mak b/libapr.mak index d6f86ca8989..925d4f8c7f4 100644 --- a/libapr.mak +++ b/libapr.mak @@ -39,17 +39,61 @@ ALL : "$(OUTDIR)\libapr.dll" !ELSE -ALL : "apr - Win32 Release" "$(OUTDIR)\libapr.dll" +ALL : "$(OUTDIR)\libapr.dll" !ENDIF -!IF "$(RECURSE)" == "1" -CLEAN :"apr - Win32 ReleaseCLEAN" -!ELSE CLEAN : -!ENDIF - -@erase "$(INTDIR)\libapr.idb" - -@erase "$(INTDIR)\libapr.obj" + -@erase "$(INTDIR)\access.obj" + -@erase "$(INTDIR)\apr.idb" + -@erase "$(INTDIR)\apr_cpystrn.obj" + -@erase "$(INTDIR)\apr_fnmatch.obj" + -@erase "$(INTDIR)\apr_getpass.obj" + -@erase "$(INTDIR)\apr_hash.obj" + -@erase "$(INTDIR)\apr_md5.obj" + -@erase "$(INTDIR)\apr_pools.obj" + -@erase "$(INTDIR)\apr_signal.obj" + -@erase "$(INTDIR)\apr_snprintf.obj" + -@erase "$(INTDIR)\apr_strings.obj" + -@erase "$(INTDIR)\apr_strnatcmp.obj" + -@erase "$(INTDIR)\apr_tables.obj" + -@erase "$(INTDIR)\common.obj" + -@erase "$(INTDIR)\dir.obj" + -@erase "$(INTDIR)\dso.obj" + -@erase "$(INTDIR)\errorcodes.obj" + -@erase "$(INTDIR)\fileacc.obj" + -@erase "$(INTDIR)\filedup.obj" + -@erase "$(INTDIR)\filestat.obj" + -@erase "$(INTDIR)\flock.obj" + -@erase "$(INTDIR)\fullrw.obj" + -@erase "$(INTDIR)\getopt.obj" + -@erase "$(INTDIR)\getuuid.obj" + -@erase "$(INTDIR)\groupinfo.obj" + -@erase "$(INTDIR)\inet_ntop.obj" + -@erase "$(INTDIR)\locks.obj" + -@erase "$(INTDIR)\misc.obj" + -@erase "$(INTDIR)\mmap.obj" + -@erase "$(INTDIR)\names.obj" + -@erase "$(INTDIR)\open.obj" + -@erase "$(INTDIR)\pipe.obj" + -@erase "$(INTDIR)\poll.obj" + -@erase "$(INTDIR)\proc.obj" + -@erase "$(INTDIR)\rand.obj" + -@erase "$(INTDIR)\readwrite.obj" + -@erase "$(INTDIR)\seek.obj" + -@erase "$(INTDIR)\sendrecv.obj" + -@erase "$(INTDIR)\signals.obj" + -@erase "$(INTDIR)\sockaddr.obj" + -@erase "$(INTDIR)\sockets.obj" + -@erase "$(INTDIR)\sockopt.obj" + -@erase "$(INTDIR)\start.obj" + -@erase "$(INTDIR)\thread.obj" + -@erase "$(INTDIR)\threadpriv.obj" + -@erase "$(INTDIR)\time.obj" + -@erase "$(INTDIR)\timestr.obj" + -@erase "$(INTDIR)\userinfo.obj" + -@erase "$(INTDIR)\utf8_ucs2.obj" + -@erase "$(INTDIR)\uuid.obj" -@erase "$(OUTDIR)\libapr.dll" -@erase "$(OUTDIR)\libapr.exp" -@erase "$(OUTDIR)\libapr.lib" @@ -62,7 +106,7 @@ CPP=cl.exe CPP_PROJ=/nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I\ "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D\ "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ - /Fd"$(INTDIR)\libapr" /FD /c + /Fd"$(INTDIR)\apr" /FD /c CPP_OBJS=.\Release/ CPP_SBRS=. @@ -107,12 +151,57 @@ LINK32=link.exe LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo\ /base:"0x6EE0000" /subsystem:windows /dll /incremental:no\ /pdb:"$(OUTDIR)\libapr.pdb" /map:"$(INTDIR)\libapr.map" /machine:I386\ - /def:".\libapr.def" /out:"$(OUTDIR)\libapr.dll" /implib:"$(OUTDIR)\libapr.lib" -DEF_FILE= \ - ".\libapr.def" + /out:"$(OUTDIR)\libapr.dll" /implib:"$(OUTDIR)\libapr.lib" /OPT:NOREF LINK32_OBJS= \ - "$(INTDIR)\libapr.obj" \ - ".\LibR\apr.lib" + "$(INTDIR)\access.obj" \ + "$(INTDIR)\apr_cpystrn.obj" \ + "$(INTDIR)\apr_fnmatch.obj" \ + "$(INTDIR)\apr_getpass.obj" \ + "$(INTDIR)\apr_hash.obj" \ + "$(INTDIR)\apr_md5.obj" \ + "$(INTDIR)\apr_pools.obj" \ + "$(INTDIR)\apr_signal.obj" \ + "$(INTDIR)\apr_snprintf.obj" \ + "$(INTDIR)\apr_strings.obj" \ + "$(INTDIR)\apr_strnatcmp.obj" \ + "$(INTDIR)\apr_tables.obj" \ + "$(INTDIR)\common.obj" \ + "$(INTDIR)\dir.obj" \ + "$(INTDIR)\dso.obj" \ + "$(INTDIR)\errorcodes.obj" \ + "$(INTDIR)\fileacc.obj" \ + "$(INTDIR)\filedup.obj" \ + "$(INTDIR)\filestat.obj" \ + "$(INTDIR)\flock.obj" \ + "$(INTDIR)\fullrw.obj" \ + "$(INTDIR)\getopt.obj" \ + "$(INTDIR)\getuuid.obj" \ + "$(INTDIR)\groupinfo.obj" \ + "$(INTDIR)\inet_ntop.obj" \ + "$(INTDIR)\locks.obj" \ + "$(INTDIR)\misc.obj" \ + "$(INTDIR)\mmap.obj" \ + "$(INTDIR)\names.obj" \ + "$(INTDIR)\open.obj" \ + "$(INTDIR)\pipe.obj" \ + "$(INTDIR)\poll.obj" \ + "$(INTDIR)\proc.obj" \ + "$(INTDIR)\rand.obj" \ + "$(INTDIR)\readwrite.obj" \ + "$(INTDIR)\seek.obj" \ + "$(INTDIR)\sendrecv.obj" \ + "$(INTDIR)\signals.obj" \ + "$(INTDIR)\sockaddr.obj" \ + "$(INTDIR)\sockets.obj" \ + "$(INTDIR)\sockopt.obj" \ + "$(INTDIR)\start.obj" \ + "$(INTDIR)\thread.obj" \ + "$(INTDIR)\threadpriv.obj" \ + "$(INTDIR)\time.obj" \ + "$(INTDIR)\timestr.obj" \ + "$(INTDIR)\userinfo.obj" \ + "$(INTDIR)\utf8_ucs2.obj" \ + "$(INTDIR)\uuid.obj" "$(OUTDIR)\libapr.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< @@ -133,17 +222,62 @@ ALL : "$(OUTDIR)\libapr.dll" !ELSE -ALL : "apr - Win32 Debug" "$(OUTDIR)\libapr.dll" +ALL : "$(OUTDIR)\libapr.dll" !ENDIF -!IF "$(RECURSE)" == "1" -CLEAN :"apr - Win32 DebugCLEAN" -!ELSE CLEAN : -!ENDIF - -@erase "$(INTDIR)\libapr.idb" - -@erase "$(INTDIR)\libapr.obj" + -@erase "$(INTDIR)\access.obj" + -@erase "$(INTDIR)\apr.idb" + -@erase "$(INTDIR)\apr.pdb" + -@erase "$(INTDIR)\apr_cpystrn.obj" + -@erase "$(INTDIR)\apr_fnmatch.obj" + -@erase "$(INTDIR)\apr_getpass.obj" + -@erase "$(INTDIR)\apr_hash.obj" + -@erase "$(INTDIR)\apr_md5.obj" + -@erase "$(INTDIR)\apr_pools.obj" + -@erase "$(INTDIR)\apr_signal.obj" + -@erase "$(INTDIR)\apr_snprintf.obj" + -@erase "$(INTDIR)\apr_strings.obj" + -@erase "$(INTDIR)\apr_strnatcmp.obj" + -@erase "$(INTDIR)\apr_tables.obj" + -@erase "$(INTDIR)\common.obj" + -@erase "$(INTDIR)\dir.obj" + -@erase "$(INTDIR)\dso.obj" + -@erase "$(INTDIR)\errorcodes.obj" + -@erase "$(INTDIR)\fileacc.obj" + -@erase "$(INTDIR)\filedup.obj" + -@erase "$(INTDIR)\filestat.obj" + -@erase "$(INTDIR)\flock.obj" + -@erase "$(INTDIR)\fullrw.obj" + -@erase "$(INTDIR)\getopt.obj" + -@erase "$(INTDIR)\getuuid.obj" + -@erase "$(INTDIR)\groupinfo.obj" + -@erase "$(INTDIR)\inet_ntop.obj" + -@erase "$(INTDIR)\locks.obj" + -@erase "$(INTDIR)\misc.obj" + -@erase "$(INTDIR)\mmap.obj" + -@erase "$(INTDIR)\names.obj" + -@erase "$(INTDIR)\open.obj" + -@erase "$(INTDIR)\pipe.obj" + -@erase "$(INTDIR)\poll.obj" + -@erase "$(INTDIR)\proc.obj" + -@erase "$(INTDIR)\rand.obj" + -@erase "$(INTDIR)\readwrite.obj" + -@erase "$(INTDIR)\seek.obj" + -@erase "$(INTDIR)\sendrecv.obj" + -@erase "$(INTDIR)\signals.obj" + -@erase "$(INTDIR)\sockaddr.obj" + -@erase "$(INTDIR)\sockets.obj" + -@erase "$(INTDIR)\sockopt.obj" + -@erase "$(INTDIR)\start.obj" + -@erase "$(INTDIR)\thread.obj" + -@erase "$(INTDIR)\threadpriv.obj" + -@erase "$(INTDIR)\time.obj" + -@erase "$(INTDIR)\timestr.obj" + -@erase "$(INTDIR)\userinfo.obj" + -@erase "$(INTDIR)\utf8_ucs2.obj" + -@erase "$(INTDIR)\uuid.obj" -@erase "$(OUTDIR)\libapr.dll" -@erase "$(OUTDIR)\libapr.exp" -@erase "$(OUTDIR)\libapr.lib" @@ -157,7 +291,7 @@ CPP=cl.exe CPP_PROJ=/nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I\ "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D\ "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ - /Fd"$(INTDIR)\libapr" /FD /c + /Fd"$(INTDIR)\apr" /FD /c CPP_OBJS=.\Debug/ CPP_SBRS=. @@ -202,12 +336,57 @@ LINK32=link.exe LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo\ /base:"0x6EE0000" /subsystem:windows /dll /incremental:no\ /pdb:"$(OUTDIR)\libapr.pdb" /map:"$(INTDIR)\libapr.map" /debug /machine:I386\ - /def:".\libapr.def" /out:"$(OUTDIR)\libapr.dll" /implib:"$(OUTDIR)\libapr.lib" -DEF_FILE= \ - ".\libapr.def" + /out:"$(OUTDIR)\libapr.dll" /implib:"$(OUTDIR)\libapr.lib" /OPT:NOREF LINK32_OBJS= \ - "$(INTDIR)\libapr.obj" \ - ".\LibD\apr.lib" + "$(INTDIR)\access.obj" \ + "$(INTDIR)\apr_cpystrn.obj" \ + "$(INTDIR)\apr_fnmatch.obj" \ + "$(INTDIR)\apr_getpass.obj" \ + "$(INTDIR)\apr_hash.obj" \ + "$(INTDIR)\apr_md5.obj" \ + "$(INTDIR)\apr_pools.obj" \ + "$(INTDIR)\apr_signal.obj" \ + "$(INTDIR)\apr_snprintf.obj" \ + "$(INTDIR)\apr_strings.obj" \ + "$(INTDIR)\apr_strnatcmp.obj" \ + "$(INTDIR)\apr_tables.obj" \ + "$(INTDIR)\common.obj" \ + "$(INTDIR)\dir.obj" \ + "$(INTDIR)\dso.obj" \ + "$(INTDIR)\errorcodes.obj" \ + "$(INTDIR)\fileacc.obj" \ + "$(INTDIR)\filedup.obj" \ + "$(INTDIR)\filestat.obj" \ + "$(INTDIR)\flock.obj" \ + "$(INTDIR)\fullrw.obj" \ + "$(INTDIR)\getopt.obj" \ + "$(INTDIR)\getuuid.obj" \ + "$(INTDIR)\groupinfo.obj" \ + "$(INTDIR)\inet_ntop.obj" \ + "$(INTDIR)\locks.obj" \ + "$(INTDIR)\misc.obj" \ + "$(INTDIR)\mmap.obj" \ + "$(INTDIR)\names.obj" \ + "$(INTDIR)\open.obj" \ + "$(INTDIR)\pipe.obj" \ + "$(INTDIR)\poll.obj" \ + "$(INTDIR)\proc.obj" \ + "$(INTDIR)\rand.obj" \ + "$(INTDIR)\readwrite.obj" \ + "$(INTDIR)\seek.obj" \ + "$(INTDIR)\sendrecv.obj" \ + "$(INTDIR)\signals.obj" \ + "$(INTDIR)\sockaddr.obj" \ + "$(INTDIR)\sockets.obj" \ + "$(INTDIR)\sockopt.obj" \ + "$(INTDIR)\start.obj" \ + "$(INTDIR)\thread.obj" \ + "$(INTDIR)\threadpriv.obj" \ + "$(INTDIR)\time.obj" \ + "$(INTDIR)\timestr.obj" \ + "$(INTDIR)\userinfo.obj" \ + "$(INTDIR)\utf8_ucs2.obj" \ + "$(INTDIR)\uuid.obj" "$(OUTDIR)\libapr.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< @@ -218,41 +397,1168 @@ LINK32_OBJS= \ !IF "$(CFG)" == "libapr - Win32 Release" || "$(CFG)" == "libapr - Win32 Debug" +SOURCE=.\time\win32\access.c +DEP_CPP_ACCES=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_time.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\network_io\os2\os2nerrno.h"\ + -!IF "$(CFG)" == "libapr - Win32 Release" +"$(INTDIR)\access.obj" : $(SOURCE) $(DEP_CPP_ACCES) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) -"apr - Win32 Release" : - cd "." - $(MAKE) /$(MAKEFLAGS) /F ".\apr.mak" CFG="apr - Win32 Release" - cd "." -"apr - Win32 ReleaseCLEAN" : - cd "." - $(MAKE) /$(MAKEFLAGS) CLEAN /F ".\apr.mak" CFG="apr - Win32 Release"\ - RECURSE=1 - cd "." +SOURCE=.\time\win32\time.c +DEP_CPP_TIME_=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\network_io\os2\os2nerrno.h"\ + -!ELSEIF "$(CFG)" == "libapr - Win32 Debug" +"$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) -"apr - Win32 Debug" : - cd "." - $(MAKE) /$(MAKEFLAGS) /F ".\apr.mak" CFG="apr - Win32 Debug" - cd "." -"apr - Win32 DebugCLEAN" : - cd "." - $(MAKE) /$(MAKEFLAGS) CLEAN /F ".\apr.mak" CFG="apr - Win32 Debug" RECURSE=1\ - - cd "." +SOURCE=.\time\win32\timestr.c +DEP_CPP_TIMES=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\strings\apr_cpystrn.c +DEP_CPP_APR_C=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_cpystrn.obj" : $(SOURCE) $(DEP_CPP_APR_C) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\strings\apr_fnmatch.c +DEP_CPP_APR_F=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_fnmatch.h"\ + ".\include\apr_lib.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_fnmatch.obj" : $(SOURCE) $(DEP_CPP_APR_F) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\strings\apr_snprintf.c +DEP_CPP_APR_S=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_S) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\strings\apr_strings.c +DEP_CPP_APR_ST=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_strings.obj" : $(SOURCE) $(DEP_CPP_APR_ST) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\strings\apr_strnatcmp.c +DEP_CPP_APR_STR=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_strnatcmp.obj" : $(SOURCE) $(DEP_CPP_APR_STR) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\passwd\apr_getpass.c +DEP_CPP_APR_G=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_getpass.obj" : $(SOURCE) $(DEP_CPP_APR_G) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\passwd\apr_md5.c +DEP_CPP_APR_M=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_md5.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_md5.obj" : $(SOURCE) $(DEP_CPP_APR_M) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\tables\apr_hash.c +DEP_CPP_APR_H=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ + ".\include\apr_hash.h"\ + ".\include\apr_pools.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_hash.obj" : $(SOURCE) $(DEP_CPP_APR_H) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\tables\apr_tables.c +DEP_CPP_APR_T=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_tables.obj" : $(SOURCE) $(DEP_CPP_APR_T) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\unix\errorcodes.c +DEP_CPP_ERROR=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\errorcodes.obj" : $(SOURCE) $(DEP_CPP_ERROR) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\unix\getopt.c +DEP_CPP_GETOP=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\win32\getuuid.c +DEP_CPP_GETUU=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_uuid.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\getuuid.obj" : $(SOURCE) $(DEP_CPP_GETUU) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\win32\misc.c +DEP_CPP_MISC_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\misc.obj" : $(SOURCE) $(DEP_CPP_MISC_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\win32\names.c +DEP_CPP_NAMES=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\win32\rand.c +DEP_CPP_RAND_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ + ".\include\apr_pools.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\rand.obj" : $(SOURCE) $(DEP_CPP_RAND_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\unix\start.c +DEP_CPP_START=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\locks.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) -!ENDIF -SOURCE=.\misc\win32\libapr.c +SOURCE=.\misc\unix\uuid.c +DEP_CPP_UUID_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_uuid.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\uuid.obj" : $(SOURCE) $(DEP_CPP_UUID_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\canonfile.c +SOURCE=.\file_io\win32\dir.c +DEP_CPP_DIR_C=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\unix\fileacc.c +DEP_CPP_FILEA=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\filedup.c +DEP_CPP_FILED=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + -"$(INTDIR)\libapr.obj" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"\ + ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\file_io\win32\filestat.c +DEP_CPP_FILES=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\flock.c +DEP_CPP_FLOCK=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\flock.obj" : $(SOURCE) $(DEP_CPP_FLOCK) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\unix\fullrw.c +DEP_CPP_FULLR=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\fullrw.obj" : $(SOURCE) $(DEP_CPP_FULLR) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\open.c +DEP_CPP_OPEN_=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\pipe.c +DEP_CPP_PIPE_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\readwrite.c +DEP_CPP_READW=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\file_io\win32\seek.c +DEP_CPP_SEEK_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\locks\win32\locks.c +DEP_CPP_LOCKS=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\locks.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\network_io\unix\inet_ntop.c +DEP_CPP_INET_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\networkio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\inet_ntop.obj" : $(SOURCE) $(DEP_CPP_INET_) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\network_io\win32\poll.c +DEP_CPP_POLL_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\networkio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\poll.obj" : $(SOURCE) $(DEP_CPP_POLL_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\network_io\unix\sa_common.c +SOURCE=.\network_io\win32\sendrecv.c +DEP_CPP_SENDR=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\networkio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\sendrecv.obj" : $(SOURCE) $(DEP_CPP_SENDR) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\network_io\win32\sockaddr.c +DEP_CPP_SOCKA=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\networkio.h"\ + ".\network_io\os2\os2nerrno.h"\ + ".\network_io\unix\sa_common.c"\ + + +"$(INTDIR)\sockaddr.obj" : $(SOURCE) $(DEP_CPP_SOCKA) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\network_io\win32\sockets.c +DEP_CPP_SOCKE=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\networkio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\sockets.obj" : $(SOURCE) $(DEP_CPP_SOCKE) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\network_io\win32\sockopt.c +DEP_CPP_SOCKO=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\networkio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\threadproc\win32\proc.c +DEP_CPP_PROC_=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\threadproc.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\threadproc\win32\signals.c +DEP_CPP_SIGNA=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\threadproc.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\threadproc\win32\thread.c +DEP_CPP_THREA=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\threadproc.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\threadproc\win32\threadpriv.c +DEP_CPP_THREAD=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\threadproc.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\dso\win32\dso.c +DEP_CPP_DSO_C=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\dso.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\dso.obj" : $(SOURCE) $(DEP_CPP_DSO_C) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\lib\apr_pools.c +DEP_CPP_APR_P=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_hash.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\lib\apr_signal.c +DEP_CPP_APR_SI=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\apr_signal.obj" : $(SOURCE) $(DEP_CPP_APR_SI) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\i18n\unix\utf8_ucs2.c +DEP_CPP_UTF8_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\utf8_ucs2.obj" : $(SOURCE) $(DEP_CPP_UTF8_) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\i18n\unix\xlate.c +SOURCE=.\shmem\win32\shmem.c +SOURCE=.\mmap\unix\common.c +DEP_CPP_COMMO=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_mmap.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\common.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\mmap\win32\mmap.c +DEP_CPP_MMAP_=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_mmap.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\mmap.obj" : $(SOURCE) $(DEP_CPP_MMAP_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\user\win32\groupinfo.c +DEP_CPP_GROUP=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\groupinfo.obj" : $(SOURCE) $(DEP_CPP_GROUP) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\user\win32\userinfo.c +DEP_CPP_USERI=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\network_io\os2\os2nerrno.h"\ + + +"$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\include\apr.hw + +!IF "$(CFG)" == "libapr - Win32 Release" + +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + + +!ENDIF + !ENDIF diff --git a/locks/os2/locks.c b/locks/os2/locks.c index d5a4a2add6e..45f769db1b4 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -58,8 +58,6 @@ #include "locks.h" #include "fileio.h" #include <string.h> -#define INCL_DOS -#include <os2.h> #define CurrentTid (lock->tib->tib_ptib2->tib2_ultid) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index cfa879f432c..36bdcb5b137 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -160,8 +160,6 @@ static char *apr_error_string(apr_status_t statcode) #ifdef OS2 -#define INCL_DOS -#include <os2.h> #include <ctype.h> int apr_canonical_error(apr_status_t err); diff --git a/network_io/os2/os2calls.c b/network_io/os2/os2calls.c index 586ab0a8eaa..1acbfa06f33 100644 --- a/network_io/os2/os2calls.c +++ b/network_io/os2/os2calls.c @@ -57,8 +57,6 @@ #include "apr_portable.h" #include "apr_general.h" #include "apr_lib.h" -#define INCL_DOS -#include <os2.h> static int os2_socket_init(int, int ,int); diff --git a/network_io/os2/os2calls.h b/network_io/os2/os2calls.h deleted file mode 100644 index 8a8b83bd0db..00000000000 --- a/network_io/os2/os2calls.h +++ /dev/null @@ -1,93 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#include <sys/types.h> -#include <sys/socket.h> -#include "os2nerrno.h" - -extern int (*apr_os2_socket)(int, int, int); -extern int (*apr_os2_select)(int *, int, int, int, long); -extern int (*apr_os2_sock_errno)(); -extern int (*apr_os2_accept)(int, struct sockaddr *, int *); -extern int (*apr_os2_bind)(int, struct sockaddr *, int); -extern int (*apr_os2_connect)(int, struct sockaddr *, int); -extern int (*apr_os2_getpeername)(int, struct sockaddr *, int *); -extern int (*apr_os2_getsockname)(int, struct sockaddr *, int *); -extern int (*apr_os2_getsockopt)(int, int, int, char *, int *); -extern int (*apr_os2_ioctl)(int, int, caddr_t, int); -extern int (*apr_os2_listen)(int, int); -extern int (*apr_os2_recv)(int, char *, int, int); -extern int (*apr_os2_send)(int, const char *, int, int); -extern int (*apr_os2_setsockopt)(int, int, int, char *, int); -extern int (*apr_os2_shutdown)(int, int); -extern int (*apr_os2_soclose)(int); -extern int (*apr_os2_writev)(int, struct iovec *, int); - -#define socket apr_os2_socket -#define select apr_os2_select -#define sock_errno apr_os2_sock_errno -#define accept apr_os2_accept -#define bind apr_os2_bind -#define connect apr_os2_connect -#define getpeername apr_os2_getpeername -#define getsockname apr_os2_getsockname -#define getsockopt apr_os2_getsockopt -#define ioctl apr_os2_ioctl -#define listen apr_os2_listen -#define recv apr_os2_recv -#define send apr_os2_send -#define setsockopt apr_os2_setsockopt -#define shutdown apr_os2_shutdown -#define soclose apr_os2_soclose -#define writev apr_os2_writev diff --git a/network_io/os2/os2nerrno.h b/network_io/os2/os2nerrno.h deleted file mode 100644 index 0d6b444e206..00000000000 --- a/network_io/os2/os2nerrno.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef __OS2NERRNO_H -#define __OS2NERRNO_H - -/* Error codes returned by above calls */ -#define SOCBASEERR 10000 - -#define SOCEPERM (SOCBASEERR+1) /* Not owner */ -#define SOCESRCH (SOCBASEERR+3) /* No such process */ -#define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */ -#define SOCENXIO (SOCBASEERR+6) /* No such device or address */ -#define SOCEBADF (SOCBASEERR+9) /* Bad file number */ -#define SOCEACCES (SOCBASEERR+13) /* Permission denied */ -#define SOCEFAULT (SOCBASEERR+14) /* Bad address */ -#define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */ -#define SOCEMFILE (SOCBASEERR+24) /* Too many open files */ -#define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ -#define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ -#define SOCEWOULDBLOCK (SOCBASEERR+35) /* Operation would block */ -#define SOCEINPROGRESS (SOCBASEERR+36) /* Operation now in progress */ -#define SOCEALREADY (SOCBASEERR+37) /* Operation already in progress */ -#define SOCENOTSOCK (SOCBASEERR+38) /* Socket operation on non-socket */ -#define SOCEDESTADDRREQ (SOCBASEERR+39) /* Destination address required */ -#define SOCEMSGSIZE (SOCBASEERR+40) /* Message too long */ -#define SOCEPROTOTYPE (SOCBASEERR+41) /* Protocol wrong type for socket */ -#define SOCENOPROTOOPT (SOCBASEERR+42) /* Protocol not available */ -#define SOCEPROTONOSUPPORT (SOCBASEERR+43) /* Protocol not supported */ -#define SOCESOCKTNOSUPPORT (SOCBASEERR+44) /* Socket type not supported */ -#define SOCEOPNOTSUPP (SOCBASEERR+45) /* Operation not supported on socket */ -#define SOCEPFNOSUPPORT (SOCBASEERR+46) /* Protocol family not supported */ -#define SOCEAFNOSUPPORT (SOCBASEERR+47) /* Address family not supported by protocol family */ -#define SOCEADDRINUSE (SOCBASEERR+48) /* Address already in use */ -#define SOCEADDRNOTAVAIL (SOCBASEERR+49) /* Can't assign requested address */ -#define SOCENETDOWN (SOCBASEERR+50) /* Network is down */ -#define SOCENETUNREACH (SOCBASEERR+51) /* Network is unreachable */ -#define SOCENETRESET (SOCBASEERR+52) /* Network dropped connection on reset */ -#define SOCECONNABORTED (SOCBASEERR+53) /* Software caused connection abort */ -#define SOCECONNRESET (SOCBASEERR+54) /* Connection reset by peer */ -#define SOCENOBUFS (SOCBASEERR+55) /* No buffer space available */ -#define SOCEISCONN (SOCBASEERR+56) /* Socket is already connected */ -#define SOCENOTCONN (SOCBASEERR+57) /* Socket is not connected */ -#define SOCESHUTDOWN (SOCBASEERR+58) /* Can't send after socket shutdown */ -#define SOCETOOMANYREFS (SOCBASEERR+59) /* Too many references: can't splice */ -#define SOCETIMEDOUT (SOCBASEERR+60) /* Connection timed out */ -#define SOCECONNREFUSED (SOCBASEERR+61) /* Connection refused */ -#define SOCELOOP (SOCBASEERR+62) /* Too many levels of symbolic links */ -#define SOCENAMETOOLONG (SOCBASEERR+63) /* File name too long */ -#define SOCEHOSTDOWN (SOCBASEERR+64) /* Host is down */ -#define SOCEHOSTUNREACH (SOCBASEERR+65) /* No route to host */ -#define SOCENOTEMPTY (SOCBASEERR+66) /* Directory not empty */ - -#endif diff --git a/network_io/os2/poll.c b/network_io/os2/poll.c index ad96e1aa09c..9fe63222dd5 100644 --- a/network_io/os2/poll.c +++ b/network_io/os2/poll.c @@ -59,8 +59,6 @@ #include "apr_lib.h" #include <sys/time.h> #include <stdlib.h> -#define INCL_DOS -#include <os2.h> /* OS/2 doesn't have a poll function, implement using OS/2 style select */ diff --git a/shmem/os2/shmem.c b/shmem/os2/shmem.c index 970062998d8..6e4dcbebffa 100644 --- a/shmem/os2/shmem.c +++ b/shmem/os2/shmem.c @@ -59,8 +59,6 @@ #include "apr_strings.h" #include <umalloc.h> #include <stdlib.h> -#define INCL_DOS -#include <os2.h> struct shmem_t { void *memblock; diff --git a/test/aprtest.dsp b/test/aprtest.dsp index f562131f7b4..8d40f8b2db7 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="aprtest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) External Target" 0x0106 @@ -22,7 +22,6 @@ CFG=aprtest - Win32 Debug !MESSAGE # Begin Project -# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 8bc3fec50c6..9231c668612 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -70,7 +70,6 @@ #include <unistd.h> #include <process.h> #include <stdlib.h> -#include <os2.h> apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) { diff --git a/threadproc/os2/signals.c b/threadproc/os2/signals.c index 6efd71d1822..56170f4016e 100644 --- a/threadproc/os2/signals.c +++ b/threadproc/os2/signals.c @@ -61,8 +61,6 @@ #include <signal.h> #include <string.h> #include <sys/wait.h> -#define INCL_DOS -#include <os2.h> apr_status_t apr_kill(apr_proc_t *proc, int signal) { diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 3879f6d8012..a99eb5968c3 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -60,7 +60,6 @@ #include "apr_lib.h" #include "fileio.h" #include <stdlib.h> -#include <os2.h> apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) { diff --git a/time/unix/time.c b/time/unix/time.c index 96b5d664464..7eb421970b2 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -66,10 +66,6 @@ #if HAVE_TIME_H #include <time.h> #endif -#ifdef OS2 -#define INCL_DOS -#include <os2.h> -#endif #ifdef BEOS #include <sys/socket.h> /* for select */ #endif From ccb7dbfe6080547e6cb309c72cb1c209f5136bfa Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 15:33:06 +0000 Subject: [PATCH 1176/7878] Revert back to dsp6 format, and add several newer headers to these projects. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61157 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 26 ++++++++++++++++++-------- libapr.dsp | 23 ++++++++++++++++------- test/aprtest.dsp | 3 ++- 3 files changed, 36 insertions(+), 16 deletions(-) diff --git a/apr.dsp b/apr.dsp index e2e39b32059..2fb1ed25e6f 100644 --- a/apr.dsp +++ b/apr.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="apr" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 @@ -22,10 +22,10 @@ CFG=apr - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe -RSC=rc.exe !IF "$(CFG)" == "apr - Win32 Release" @@ -39,10 +39,11 @@ RSC=rc.exe # PROP Output_Dir "LibR" # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c +RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -63,10 +64,11 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c +RSC=rc.exe # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -384,11 +386,11 @@ SOURCE=.\mmap\win32\mmap.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\user\win32\userinfo.c +SOURCE=.\user\win32\groupinfo.c # End Source File # Begin Source File -SOURCE=.\user\win32\groupinfo.c +SOURCE=.\user\win32\userinfo.c # End Source File # End Group # End Group @@ -526,10 +528,18 @@ SOURCE=.\include\apr_time.h # End Source File # Begin Source File +SOURCE=.\include\apr_user.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_uuid.h # End Source File # Begin Source File +SOURCE=.\include\apr_want.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_xlate.h # End Source File # End Group diff --git a/libapr.dsp b/libapr.dsp index fbb6f0083a1..be61aca054e 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="libapr" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 @@ -22,6 +22,7 @@ CFG=libapr - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -51,8 +52,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /machine:I386 /OPT:NOREF +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF !ELSEIF "$(CFG)" == "libapr - Win32 Debug" @@ -67,8 +68,8 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\apr" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\apr" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -390,11 +391,11 @@ SOURCE=.\mmap\win32\mmap.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\user\win32\userinfo.c +SOURCE=.\user\win32\groupinfo.c # End Source File # Begin Source File -SOURCE=.\user\win32\groupinfo.c +SOURCE=.\user\win32\userinfo.c # End Source File # End Group # End Group @@ -532,10 +533,18 @@ SOURCE=.\include\apr_time.h # End Source File # Begin Source File +SOURCE=.\include\apr_user.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_uuid.h # End Source File # Begin Source File +SOURCE=.\include\apr_want.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_xlate.h # End Source File # End Group diff --git a/test/aprtest.dsp b/test/aprtest.dsp index 8d40f8b2db7..f562131f7b4 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="aprtest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) External Target" 0x0106 @@ -22,6 +22,7 @@ CFG=aprtest - Win32 Debug !MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" From bef389c1c9839d4ac36fec69a2ad429721f4e5ee Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 15:36:53 +0000 Subject: [PATCH 1177/7878] Clean up an alien out of the win32 make file dependencies git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61158 13f79535-47bb-0310-9956-ffa450edef68 --- apr.mak | 49 ------------------------------------------------- libapr.mak | 49 ------------------------------------------------- 2 files changed, 98 deletions(-) diff --git a/apr.mak b/apr.mak index ecf88f341bd..580ba9e11f9 100644 --- a/apr.mak +++ b/apr.mak @@ -390,7 +390,6 @@ DEP_CPP_ACCES=\ ".\include\apr_time.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\access.obj" : $(SOURCE) $(DEP_CPP_ACCES) "$(INTDIR)"\ @@ -417,7 +416,6 @@ DEP_CPP_TIME_=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)" ".\include\apr.h" @@ -441,7 +439,6 @@ DEP_CPP_TIMES=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"\ @@ -457,7 +454,6 @@ DEP_CPP_APR_C=\ ".\include\apr_pools.h"\ ".\include\apr_strings.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_cpystrn.obj" : $(SOURCE) $(DEP_CPP_APR_C) "$(INTDIR)"\ @@ -472,7 +468,6 @@ DEP_CPP_APR_F=\ ".\include\apr_fnmatch.h"\ ".\include\apr_lib.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_fnmatch.obj" : $(SOURCE) $(DEP_CPP_APR_F) "$(INTDIR)"\ @@ -493,7 +488,6 @@ DEP_CPP_APR_S=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_S) "$(INTDIR)"\ @@ -509,7 +503,6 @@ DEP_CPP_APR_ST=\ ".\include\apr_pools.h"\ ".\include\apr_strings.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_strings.obj" : $(SOURCE) $(DEP_CPP_APR_ST) "$(INTDIR)"\ @@ -524,7 +517,6 @@ DEP_CPP_APR_STR=\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ ".\include\apr_strings.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_strnatcmp.obj" : $(SOURCE) $(DEP_CPP_APR_STR) "$(INTDIR)"\ @@ -540,7 +532,6 @@ DEP_CPP_APR_G=\ ".\include\apr_pools.h"\ ".\include\apr_strings.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_getpass.obj" : $(SOURCE) $(DEP_CPP_APR_G) "$(INTDIR)"\ @@ -558,7 +549,6 @@ DEP_CPP_APR_M=\ ".\include\apr_strings.h"\ ".\include\apr_xlate.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_md5.obj" : $(SOURCE) $(DEP_CPP_APR_M) "$(INTDIR)"\ @@ -574,7 +564,6 @@ DEP_CPP_APR_H=\ ".\include\apr_hash.h"\ ".\include\apr_pools.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_hash.obj" : $(SOURCE) $(DEP_CPP_APR_H) "$(INTDIR)"\ @@ -592,7 +581,6 @@ DEP_CPP_APR_T=\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_tables.obj" : $(SOURCE) $(DEP_CPP_APR_T) "$(INTDIR)"\ @@ -618,7 +606,6 @@ DEP_CPP_ERROR=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\errorcodes.obj" : $(SOURCE) $(DEP_CPP_ERROR) "$(INTDIR)"\ @@ -642,7 +629,6 @@ DEP_CPP_GETOP=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"\ @@ -655,7 +641,6 @@ DEP_CPP_GETUU=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ ".\include\apr_uuid.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\getuuid.obj" : $(SOURCE) $(DEP_CPP_GETUU) "$(INTDIR)"\ @@ -678,7 +663,6 @@ DEP_CPP_MISC_=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\misc.obj" : $(SOURCE) $(DEP_CPP_MISC_) "$(INTDIR)" ".\include\apr.h" @@ -699,7 +683,6 @@ DEP_CPP_NAMES=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"\ @@ -714,7 +697,6 @@ DEP_CPP_RAND_=\ ".\include\apr_general.h"\ ".\include\apr_pools.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\rand.obj" : $(SOURCE) $(DEP_CPP_RAND_) "$(INTDIR)" ".\include\apr.h" @@ -738,7 +720,6 @@ DEP_CPP_START=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\locks.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"\ @@ -752,7 +733,6 @@ DEP_CPP_UUID_=\ ".\include\apr_errno.h"\ ".\include\apr_lib.h"\ ".\include\apr_uuid.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\uuid.obj" : $(SOURCE) $(DEP_CPP_UUID_) "$(INTDIR)" ".\include\apr.h" @@ -785,7 +765,6 @@ DEP_CPP_DIR_C=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)" ".\include\apr.h" @@ -813,7 +792,6 @@ DEP_CPP_FILEA=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"\ @@ -842,7 +820,6 @@ DEP_CPP_FILED=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"\ @@ -872,7 +849,6 @@ DEP_CPP_FILES=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"\ @@ -900,7 +876,6 @@ DEP_CPP_FLOCK=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\flock.obj" : $(SOURCE) $(DEP_CPP_FLOCK) "$(INTDIR)"\ @@ -918,7 +893,6 @@ DEP_CPP_FULLR=\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\fullrw.obj" : $(SOURCE) $(DEP_CPP_FULLR) "$(INTDIR)"\ @@ -950,7 +924,6 @@ DEP_CPP_OPEN_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)" ".\include\apr.h" @@ -978,7 +951,6 @@ DEP_CPP_PIPE_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)" ".\include\apr.h" @@ -1007,7 +979,6 @@ DEP_CPP_READW=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"\ @@ -1035,7 +1006,6 @@ DEP_CPP_SEEK_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)" ".\include\apr.h" @@ -1060,7 +1030,6 @@ DEP_CPP_LOCKS=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\locks.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"\ @@ -1082,7 +1051,6 @@ DEP_CPP_INET_=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\networkio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\inet_ntop.obj" : $(SOURCE) $(DEP_CPP_INET_) "$(INTDIR)"\ @@ -1104,7 +1072,6 @@ DEP_CPP_POLL_=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\poll.obj" : $(SOURCE) $(DEP_CPP_POLL_) "$(INTDIR)" ".\include\apr.h" @@ -1135,7 +1102,6 @@ DEP_CPP_SENDR=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\networkio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\sendrecv.obj" : $(SOURCE) $(DEP_CPP_SENDR) "$(INTDIR)"\ @@ -1158,7 +1124,6 @@ DEP_CPP_SOCKA=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ - ".\network_io\os2\os2nerrno.h"\ ".\network_io\unix\sa_common.c"\ @@ -1185,7 +1150,6 @@ DEP_CPP_SOCKE=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\sockets.obj" : $(SOURCE) $(DEP_CPP_SOCKE) "$(INTDIR)"\ @@ -1207,7 +1171,6 @@ DEP_CPP_SOCKO=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"\ @@ -1240,7 +1203,6 @@ DEP_CPP_PROC_=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\threadproc.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)" ".\include\apr.h" @@ -1268,7 +1230,6 @@ DEP_CPP_SIGNA=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\threadproc.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"\ @@ -1295,7 +1256,6 @@ DEP_CPP_THREA=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\threadproc.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"\ @@ -1322,7 +1282,6 @@ DEP_CPP_THREAD=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\threadproc.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"\ @@ -1353,7 +1312,6 @@ DEP_CPP_DSO_C=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\dso.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\dso.obj" : $(SOURCE) $(DEP_CPP_DSO_C) "$(INTDIR)" ".\include\apr.h" @@ -1380,7 +1338,6 @@ DEP_CPP_APR_P=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ @@ -1394,7 +1351,6 @@ DEP_CPP_APR_SI=\ ".\include\apr_errno.h"\ ".\include\apr_lib.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_signal.obj" : $(SOURCE) $(DEP_CPP_APR_SI) "$(INTDIR)"\ @@ -1409,7 +1365,6 @@ DEP_CPP_UTF8_=\ ".\include\apr_pools.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\utf8_ucs2.obj" : $(SOURCE) $(DEP_CPP_UTF8_) "$(INTDIR)"\ @@ -1431,7 +1386,6 @@ DEP_CPP_COMMO=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\common.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ @@ -1463,7 +1417,6 @@ DEP_CPP_MMAP_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\mmap.obj" : $(SOURCE) $(DEP_CPP_MMAP_) "$(INTDIR)" ".\include\apr.h" @@ -1487,7 +1440,6 @@ DEP_CPP_GROUP=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\groupinfo.obj" : $(SOURCE) $(DEP_CPP_GROUP) "$(INTDIR)"\ @@ -1512,7 +1464,6 @@ DEP_CPP_USERI=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\ diff --git a/libapr.mak b/libapr.mak index 925d4f8c7f4..6f02872a77a 100644 --- a/libapr.mak +++ b/libapr.mak @@ -407,7 +407,6 @@ DEP_CPP_ACCES=\ ".\include\apr_time.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\access.obj" : $(SOURCE) $(DEP_CPP_ACCES) "$(INTDIR)"\ @@ -434,7 +433,6 @@ DEP_CPP_TIME_=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)" ".\include\apr.h" @@ -458,7 +456,6 @@ DEP_CPP_TIMES=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"\ @@ -474,7 +471,6 @@ DEP_CPP_APR_C=\ ".\include\apr_pools.h"\ ".\include\apr_strings.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_cpystrn.obj" : $(SOURCE) $(DEP_CPP_APR_C) "$(INTDIR)"\ @@ -489,7 +485,6 @@ DEP_CPP_APR_F=\ ".\include\apr_fnmatch.h"\ ".\include\apr_lib.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_fnmatch.obj" : $(SOURCE) $(DEP_CPP_APR_F) "$(INTDIR)"\ @@ -510,7 +505,6 @@ DEP_CPP_APR_S=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_S) "$(INTDIR)"\ @@ -526,7 +520,6 @@ DEP_CPP_APR_ST=\ ".\include\apr_pools.h"\ ".\include\apr_strings.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_strings.obj" : $(SOURCE) $(DEP_CPP_APR_ST) "$(INTDIR)"\ @@ -541,7 +534,6 @@ DEP_CPP_APR_STR=\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ ".\include\apr_strings.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_strnatcmp.obj" : $(SOURCE) $(DEP_CPP_APR_STR) "$(INTDIR)"\ @@ -557,7 +549,6 @@ DEP_CPP_APR_G=\ ".\include\apr_pools.h"\ ".\include\apr_strings.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_getpass.obj" : $(SOURCE) $(DEP_CPP_APR_G) "$(INTDIR)"\ @@ -575,7 +566,6 @@ DEP_CPP_APR_M=\ ".\include\apr_strings.h"\ ".\include\apr_xlate.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_md5.obj" : $(SOURCE) $(DEP_CPP_APR_M) "$(INTDIR)"\ @@ -591,7 +581,6 @@ DEP_CPP_APR_H=\ ".\include\apr_hash.h"\ ".\include\apr_pools.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_hash.obj" : $(SOURCE) $(DEP_CPP_APR_H) "$(INTDIR)"\ @@ -609,7 +598,6 @@ DEP_CPP_APR_T=\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_tables.obj" : $(SOURCE) $(DEP_CPP_APR_T) "$(INTDIR)"\ @@ -635,7 +623,6 @@ DEP_CPP_ERROR=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\errorcodes.obj" : $(SOURCE) $(DEP_CPP_ERROR) "$(INTDIR)"\ @@ -659,7 +646,6 @@ DEP_CPP_GETOP=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"\ @@ -672,7 +658,6 @@ DEP_CPP_GETUU=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ ".\include\apr_uuid.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\getuuid.obj" : $(SOURCE) $(DEP_CPP_GETUU) "$(INTDIR)"\ @@ -695,7 +680,6 @@ DEP_CPP_MISC_=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\misc.obj" : $(SOURCE) $(DEP_CPP_MISC_) "$(INTDIR)" ".\include\apr.h" @@ -716,7 +700,6 @@ DEP_CPP_NAMES=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"\ @@ -731,7 +714,6 @@ DEP_CPP_RAND_=\ ".\include\apr_general.h"\ ".\include\apr_pools.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\rand.obj" : $(SOURCE) $(DEP_CPP_RAND_) "$(INTDIR)" ".\include\apr.h" @@ -755,7 +737,6 @@ DEP_CPP_START=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\locks.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"\ @@ -769,7 +750,6 @@ DEP_CPP_UUID_=\ ".\include\apr_errno.h"\ ".\include\apr_lib.h"\ ".\include\apr_uuid.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\uuid.obj" : $(SOURCE) $(DEP_CPP_UUID_) "$(INTDIR)" ".\include\apr.h" @@ -802,7 +782,6 @@ DEP_CPP_DIR_C=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)" ".\include\apr.h" @@ -830,7 +809,6 @@ DEP_CPP_FILEA=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"\ @@ -859,7 +837,6 @@ DEP_CPP_FILED=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"\ @@ -889,7 +866,6 @@ DEP_CPP_FILES=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"\ @@ -917,7 +893,6 @@ DEP_CPP_FLOCK=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\flock.obj" : $(SOURCE) $(DEP_CPP_FLOCK) "$(INTDIR)"\ @@ -935,7 +910,6 @@ DEP_CPP_FULLR=\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\fullrw.obj" : $(SOURCE) $(DEP_CPP_FULLR) "$(INTDIR)"\ @@ -967,7 +941,6 @@ DEP_CPP_OPEN_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)" ".\include\apr.h" @@ -995,7 +968,6 @@ DEP_CPP_PIPE_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)" ".\include\apr.h" @@ -1024,7 +996,6 @@ DEP_CPP_READW=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"\ @@ -1052,7 +1023,6 @@ DEP_CPP_SEEK_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)" ".\include\apr.h" @@ -1077,7 +1047,6 @@ DEP_CPP_LOCKS=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\locks.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"\ @@ -1099,7 +1068,6 @@ DEP_CPP_INET_=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\networkio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\inet_ntop.obj" : $(SOURCE) $(DEP_CPP_INET_) "$(INTDIR)"\ @@ -1121,7 +1089,6 @@ DEP_CPP_POLL_=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\poll.obj" : $(SOURCE) $(DEP_CPP_POLL_) "$(INTDIR)" ".\include\apr.h" @@ -1152,7 +1119,6 @@ DEP_CPP_SENDR=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\networkio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\sendrecv.obj" : $(SOURCE) $(DEP_CPP_SENDR) "$(INTDIR)"\ @@ -1175,7 +1141,6 @@ DEP_CPP_SOCKA=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ - ".\network_io\os2\os2nerrno.h"\ ".\network_io\unix\sa_common.c"\ @@ -1202,7 +1167,6 @@ DEP_CPP_SOCKE=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\sockets.obj" : $(SOURCE) $(DEP_CPP_SOCKE) "$(INTDIR)"\ @@ -1224,7 +1188,6 @@ DEP_CPP_SOCKO=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"\ @@ -1257,7 +1220,6 @@ DEP_CPP_PROC_=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\threadproc.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)" ".\include\apr.h" @@ -1285,7 +1247,6 @@ DEP_CPP_SIGNA=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\threadproc.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"\ @@ -1312,7 +1273,6 @@ DEP_CPP_THREA=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\threadproc.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"\ @@ -1339,7 +1299,6 @@ DEP_CPP_THREAD=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\threadproc.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"\ @@ -1370,7 +1329,6 @@ DEP_CPP_DSO_C=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\dso.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\dso.obj" : $(SOURCE) $(DEP_CPP_DSO_C) "$(INTDIR)" ".\include\apr.h" @@ -1397,7 +1355,6 @@ DEP_CPP_APR_P=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ @@ -1411,7 +1368,6 @@ DEP_CPP_APR_SI=\ ".\include\apr_errno.h"\ ".\include\apr_lib.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\apr_signal.obj" : $(SOURCE) $(DEP_CPP_APR_SI) "$(INTDIR)"\ @@ -1426,7 +1382,6 @@ DEP_CPP_UTF8_=\ ".\include\apr_pools.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\utf8_ucs2.obj" : $(SOURCE) $(DEP_CPP_UTF8_) "$(INTDIR)"\ @@ -1448,7 +1403,6 @@ DEP_CPP_COMMO=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\common.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ @@ -1480,7 +1434,6 @@ DEP_CPP_MMAP_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\mmap.obj" : $(SOURCE) $(DEP_CPP_MMAP_) "$(INTDIR)" ".\include\apr.h" @@ -1504,7 +1457,6 @@ DEP_CPP_GROUP=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\groupinfo.obj" : $(SOURCE) $(DEP_CPP_GROUP) "$(INTDIR)"\ @@ -1529,7 +1481,6 @@ DEP_CPP_USERI=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\network_io\os2\os2nerrno.h"\ "$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\ From c10ffdc17d7be7f7489446343a0f52cb2bac1b94 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 28 Jan 2001 17:23:22 +0000 Subject: [PATCH 1178/7878] Good looking wether out there. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61159 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 28680aad900..ce4043b11b6 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/28 12:09:31 $] +Last modified at [$Date: 2001/01/28 17:23:22 $] Release: @@ -62,7 +62,13 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: - It ignores the "type" parameter, so toss it. - The fname param is allowed to be NULL on the Unix platform. Change it to always use the passed value, and check callers. + rbb says: The type parameter is supposed to be used to determine + if we are working with a read/write lock or a mutex. + The fname parameter is essentially required if you + want to be portable, but I dislike wasting cycles to + outsmart the programmer. Status: david +1 + rbb -1 * configure.in does post-processing on the AC_OUTPUT files (for VPATH support). This means that config.status doesn't do the From 197b2a136f0c5dda5c40c2a6f3df5277c40db53d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 22:33:26 +0000 Subject: [PATCH 1179/7878] User and Group (which is nearly always 'None') now works. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61160 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 63 +++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 8ed40fa1535..a7ae9ed260c 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -76,12 +76,14 @@ APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted apr_oslevel_e os_level; PSID user = NULL, grp = NULL; PACL dacl = NULL; + apr_status_t rv; if (!GetFileInformationByHandle(thefile->filehand, &FileInformation)) { return apr_get_os_error(); } memset(finfo, '\0', sizeof(*finfo)); + finfo->cntxt = thefile->cntxt; FileTimeToAprTime(&finfo->atime, &FileInformation.ftLastAccessTime); FileTimeToAprTime(&finfo->ctime, &FileInformation.ftCreationTime); @@ -101,15 +103,8 @@ APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted finfo->size = 0x7fffffff; #endif - - /* TODO: return user and group could as * SID's, allocated in the pool. - * [These are variable length objects that will require a 'comparitor' - * and a 'get readable string of' functions.] - */ - finfo->valid = APR_FINFO_ATIME | APR_FINFO_CTIME | APR_FINFO_MTIME - | APR_FINFO_IDENT | APR_FINFO_NLINK | APR_FINFO_SIZE - | APR_FINFO_UPROT; + | APR_FINFO_IDENT | APR_FINFO_NLINK | APR_FINFO_SIZE; if (wanted & APR_FINFO_TYPE) @@ -138,26 +133,27 @@ APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted } } } + if ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) - && apr_get_oslevel(thefile->cntxt, &os_level) + && !apr_get_oslevel(thefile->cntxt, &os_level) && os_level >= APR_WIN_NT) { SECURITY_INFORMATION sinf = 0; PSECURITY_DESCRIPTOR pdesc = NULL; - if (wanted & APR_FINFO_USER) - sinf != OWNER_SECURITY_INFORMATION; - if (wanted & APR_FINFO_GROUP) - sinf != GROUP_SECURITY_INFORMATION; + if (wanted & (APR_FINFO_USER | APR_FINFO_UPROT)) + sinf |= OWNER_SECURITY_INFORMATION; + if (wanted & (APR_FINFO_GROUP | APR_FINFO_GPROT)) + sinf |= GROUP_SECURITY_INFORMATION; if (wanted & APR_FINFO_PROT) - sinf != SACL_SECURITY_INFORMATION; - if (!GetSecurityInfo(thefile->filehand, SE_FILE_OBJECT, sinf, - (wanted & APR_FINFO_USER) ? &user : NULL, - (wanted & APR_FINFO_GROUP) ? &grp : NULL, - (wanted & APR_FINFO_PROT) ? &dacl : NULL, - NULL, &pdesc)) { + sinf |= DACL_SECURITY_INFORMATION; + rv = GetSecurityInfo(thefile->filehand, SE_FILE_OBJECT, sinf, + ((wanted & APR_FINFO_USER) ? &user : NULL), + ((wanted & APR_FINFO_GROUP) ? &grp : NULL), + ((wanted & APR_FINFO_PROT) ? &dacl : NULL), + NULL, &pdesc); + if (rv == ERROR_SUCCESS) apr_register_cleanup(thefile->cntxt, pdesc, free_localheap, apr_null_cleanup); - } } if (user) { @@ -186,6 +182,7 @@ APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted else { finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; } + finfo->valid |= APR_FINFO_UPROT; } if (wanted & ~finfo->valid) @@ -282,20 +279,20 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, if (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) { SECURITY_INFORMATION sinf = 0; PSECURITY_DESCRIPTOR pdesc = NULL; - if (wanted & APR_FINFO_USER) - sinf != OWNER_SECURITY_INFORMATION; - if (wanted & APR_FINFO_GROUP) - sinf != GROUP_SECURITY_INFORMATION; + if (wanted & (APR_FINFO_USER | APR_FINFO_UPROT)) + sinf |= OWNER_SECURITY_INFORMATION; + if (wanted & (APR_FINFO_GROUP | APR_FINFO_GPROT)) + sinf |= GROUP_SECURITY_INFORMATION; if (wanted & APR_FINFO_PROT) - sinf != SACL_SECURITY_INFORMATION; - if (!GetNamedSecurityInfoW(wfname, SE_FILE_OBJECT, sinf, - (wanted & APR_FINFO_USER) ? &user : NULL, - (wanted & APR_FINFO_GROUP) ? &grp : NULL, - (wanted & APR_FINFO_PROT) ? &dacl : NULL, - NULL, &pdesc)) { + sinf |= DACL_SECURITY_INFORMATION; + rv = GetNamedSecurityInfoW(wfname, SE_FILE_OBJECT, sinf, + ((wanted & APR_FINFO_USER) ? &user : NULL), + ((wanted & APR_FINFO_GROUP) ? &grp : NULL), + ((wanted & APR_FINFO_PROT) ? &dacl : NULL), + NULL, &pdesc); + if (rv == ERROR_SUCCESS) apr_register_cleanup(cont, pdesc, free_localheap, apr_null_cleanup); - } } } #endif @@ -368,7 +365,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, } if (dacl) { - /* Retrieved the discresionary access list */ + /* Retrieved the discresionary access list, provide some real answers + */ } else { @@ -384,7 +382,6 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, } /* Lying through our teeth */ finfo->valid |= APR_FINFO_UPROT; - } if (wanted & ~finfo->valid) From 3abffd2954508761c541d2713c08921b009b74c7 Mon Sep 17 00:00:00 2001 From: Ben Laurie <ben@apache.org> Date: Sun, 28 Jan 2001 22:52:22 +0000 Subject: [PATCH 1180/7878] Ignore files saved by configure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61161 13f79535-47bb-0310-9956-ffa450edef68 --- include/.cvsignore | 1 + include/arch/unix/.cvsignore | 1 + 2 files changed, 2 insertions(+) diff --git a/include/.cvsignore b/include/.cvsignore index 4ac90077a00..110657831bc 100644 --- a/include/.cvsignore +++ b/include/.cvsignore @@ -1 +1,2 @@ apr.h +apr.h.save diff --git a/include/arch/unix/.cvsignore b/include/arch/unix/.cvsignore index c1e025e0f4c..5f4af30ab12 100644 --- a/include/arch/unix/.cvsignore +++ b/include/arch/unix/.cvsignore @@ -1,2 +1,3 @@ apr_private.h apr_private.h.in +apr_private.h.save From db7d7bfdd1202da39eb538db4231916aea3dc22f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 23:20:48 +0000 Subject: [PATCH 1181/7878] User and Group goodness. If anyone objects to the non-typesafe unix implementation of apr_compare_users/groups - feel free to add saftey. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61162 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 ++++++- include/apr_user.h | 28 ++++++++++++++++++++++++++++ user/win32/groupinfo.c | 13 ++++++++++++- user/win32/userinfo.c | 12 +++++++++++- 4 files changed, 57 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index f1ef8d60096..498f48b3df5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Added apr_compare_users() and apr_compare_groups() for more complex + apr_uid_t and apr_gid_t structures. Enabled both .user and .group + results from WinNT/2000 stat/getfileinfo, but expect to find that + .group is 'None' in most cases. [William Rowe] + *) Replace configure --with-optim option by using the environment variable OPTIM instead. This is needed because configure options do not support multiple flags separated by spaces. [Roy Fielding] @@ -9,7 +14,7 @@ Changes with APR b1 *) Abstracted apr_get_username and apr_get_groupname for unix and win32. Modified Win32 apr_uid_t and apr_gid_t to use PSIDs, and elimintated - the uid_t and gid_t definitions. + the uid_t and gid_t definitions. [William Rowe] *) Radically refactored apr_stat/lstat/getfileinfo/dir_read for Win32 to assure we are retrieving what we expect to retrieve, and reporting diff --git a/include/apr_user.h b/include/apr_user.h index 5fea544411b..c650fb818f8 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -109,6 +109,20 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap */ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p); +/*** + * Compare two user identifiers for equality. + * @param left One uid to test + * @param right Another uid to test + * @deffunc apr_status_t apr_compare_users(apr_uid_t left, apr_uid_t right) + * @tip Returns APR_SUCCESS if the apr_uid_t strutures identify the same user, + * APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid. + */ +#ifdef WIN32 +APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right); +#else +#define apr_compare_users(left,right) ((left == right) ? APR_SUCCESS : APR_EMISMATCH) +#endif + /*** * Get the group name for a specified groupid * @param dirname Pointer to new string containing group name (on output) @@ -119,6 +133,20 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use */ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p); +/*** + * Compare two group identifiers for equality. + * @param left One gid to test + * @param right Another gid to test + * @deffunc apr_status_t apr_compare_groups(apr_gid_t left, apr_gid_t right) + * @tip Returns APR_SUCCESS if the apr_gid_t strutures identify the same group, + * APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid. + */ +#ifdef WIN32 +APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right); +#else +#define apr_compare_groups(left,right) ((left == right) ? APR_SUCCESS : APR_EMISMATCH) +#endif + #endif /* ! APR_HAS_USER */ #ifdef __cplusplus diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index 49e70bd0f23..1fbbcf0f625 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -72,9 +72,20 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, return APR_BADARG; if (!LookupAccountSid(NULL, groupid, name, &cbname, domain, &cbdomain, &type)) return apr_get_os_error(); - if (type != SidTypeGroup && type != SidTypeWellKnownGroup) + if (type != SidTypeGroup && type != SidTypeWellKnownGroup + && type != SidTypeAlias) return APR_BADARG; *groupname = apr_pstrdup(p, name); return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right) +{ + if (!left || !right) + return APR_BADARG; + if (!IsValidSid(left) || !IsValidSid(right)) + return APR_BADARG; + if (!EqualSid(left, right)) + return APR_EMISMATCH; + return APR_SUCCESS; +} diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 365703320c7..5d423eb1a86 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -74,9 +74,19 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap return APR_BADARG; if (!LookupAccountSid(NULL, userid, name, &cbname, domain, &cbdomain, &type)) return apr_get_os_error(); - if (type != SidTypeUser) + if (type != SidTypeUser && type != SidTypeAlias) return APR_BADARG; *username = apr_pstrdup(p, name); return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right) +{ + if (!left || !right) + return APR_BADARG; + if (!IsValidSid(left) || !IsValidSid(right)) + return APR_BADARG; + if (!EqualSid(left, right)) + return APR_EMISMATCH; + return APR_SUCCESS; +} From ada5564e6740c7c538ff6ad0e82c1b38b9f29020 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 23:23:22 +0000 Subject: [PATCH 1182/7878] Get tests building, and actually checking for libapr.la revisions to save debugging agrivation. Shout if I broke it. Win32 users should find the aprtest.dsw DevStudio workspace a lovely little place to get work done. [No help from MS - notice the .pl Makefile.in rewriter :-] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61163 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.pl | 1 + test/Makefile.in | 42 +++++++++---------- test/testfile.c | 94 ++++++++++++++++++++++++++++++++++++++++++- test/testoc.c | 4 +- test/testsockopt.c | 7 +++- 5 files changed, 123 insertions(+), 25 deletions(-) diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl index a0c6318f246..cb2cce517ad 100644 --- a/test/MakeWin32Make.pl +++ b/test/MakeWin32Make.pl @@ -19,6 +19,7 @@ $t =~ s|-g ||; } $t =~ s|\@LDFLAGS\@||; + $t =~ s|\.\./libapr\.la|../LibD/apr.lib|; $t =~ s|\@RM\@|del|; if ($t =~ s|(\$\(RM\)) -f|$1|) { diff --git a/test/Makefile.in b/test/Makefile.in index 2f475a6d2a2..e1e1b67cc38 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -34,65 +34,65 @@ INCDIR=../include INCLUDES=-I$(INCDIR) -testfile@EXEEXT@: testfile.lo +testfile@EXEEXT@: testfile.lo ../libapr.la $(LINK) testfile.lo $(ALL_LIBS) -testflock@EXEEXT@: testflock.lo +testflock@EXEEXT@: testflock.lo ../libapr.la $(LINK) testflock.lo $(ALL_LIBS) ### why the export-dynamic? -testdso@EXEEXT@: testdso.lo +testdso@EXEEXT@: testdso.lo ../libapr.la $(LINK) --export-dynamic testdso.lo $(ALL_LIBS) -testoc@EXEEXT@: testoc.lo +testoc@EXEEXT@: testoc.lo ../libapr.la $(LINK) testoc.lo $(ALL_LIBS) -occhild@EXEEXT@: occhild.lo +occhild@EXEEXT@: occhild.lo ../libapr.la $(LINK) occhild.lo $(ALL_LIBS) -mod_test.so: mod_test.lo - $(LINK) --module mod_test.lo +mod_test.so: mod_test.lo ../libapr.la + $(LINK) --module mod_test.lo $(ALL_LIBS) -testargs@EXEEXT@: testargs.lo +testargs@EXEEXT@: testargs.lo ../libapr.la $(LINK) testargs.lo $(ALL_LIBS) -testcontext@EXEEXT@: testcontext.lo +testcontext@EXEEXT@: testcontext.lo ../libapr.la $(LINK) testcontext.lo $(ALL_LIBS) -testproc@EXEEXT@: testproc.lo +testproc@EXEEXT@: testproc.lo ../libapr.la $(LINK) testproc.lo $(ALL_LIBS) -testthread@EXEEXT@: testthread.lo +testthread@EXEEXT@: testthread.lo ../libapr.la $(LINK) testthread.lo $(ALL_LIBS) -testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ +testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ ../libapr.la $(LINK) testsock.lo $(ALL_LIBS) -client@EXEEXT@: client.lo +client@EXEEXT@: client.lo ../libapr.la $(LINK) client.lo $(ALL_LIBS) -server@EXEEXT@: server.lo sendfile.lo +server@EXEEXT@: server.lo sendfile.lo ../libapr.la $(LINK) server.lo $(ALL_LIBS) -sendfile@EXEEXT@: sendfile.lo +sendfile@EXEEXT@: sendfile.lo ../libapr.la $(LINK) sendfile.lo $(ALL_LIBS) -testtime@EXEEXT@: testtime.lo +testtime@EXEEXT@: testtime.lo ../libapr.la $(LINK) testtime.lo $(ALL_LIBS) -testmmap@EXEEXT@: testmmap.lo +testmmap@EXEEXT@: testmmap.lo ../libapr.la $(LINK) testmmap.lo $(ALL_LIBS) -testshmem@EXEEXT@: testshmem.lo +testshmem@EXEEXT@: testshmem.lo ../libapr.la $(LINK) testshmem.lo $(ALL_LIBS) -testpipe@EXEEXT@: testpipe.lo +testpipe@EXEEXT@: testpipe.lo ../libapr.la $(LINK) testpipe.lo $(ALL_LIBS) -testuuid@EXEEXT@: testuuid.lo +testuuid@EXEEXT@: testuuid.lo ../libapr.la $(LINK) testuuid.lo $(ALL_LIBS) -testsockopt@EXEEXT@: testsockopt.lo +testsockopt@EXEEXT@: testsockopt.lo ../libapr.la $(LINK) testsockopt.lo $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/testfile.c b/test/testfile.c index 0bafdd3464e..2b88682665c 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -57,6 +57,7 @@ #include <stdlib.h> #include <string.h> #include "apr_file_io.h" +#include "apr_file_info.h" #include "apr_network_io.h" #include "apr_errno.h" #include "apr_general.h" @@ -65,6 +66,27 @@ #include <unistd.h> #endif +struct view_fileinfo +{ + apr_int32_t bits; + char *description; +} vfi[] = { + APR_FINFO_MTIME, "MTIME", + APR_FINFO_CTIME, "CTIME", + APR_FINFO_ATIME, "ATIME", + APR_FINFO_SIZE, "SIZE", + APR_FINFO_DEV, "DEV", + APR_FINFO_INODE, "INODE", + APR_FINFO_NLINK, "NLINK", + APR_FINFO_TYPE, "TYPE", + APR_FINFO_USER, "USER", + APR_FINFO_GROUP, "GROUP", + APR_FINFO_UPROT, "UPROT", + APR_FINFO_GPROT, "GPROT", + APR_FINFO_WPROT, "WPROT", + 0, NULL +}; + int test_filedel(apr_pool_t *); int testdirs(apr_pool_t *); static void test_read(apr_pool_t *); @@ -79,6 +101,7 @@ int main(void) apr_pool_t *context; apr_pool_t *cont2; apr_file_t *thefile = NULL; + apr_finfo_t finfo; apr_socket_t *testsock = NULL; apr_pollfd_t *sdset = NULL; apr_status_t status; @@ -90,6 +113,8 @@ int main(void) const char *str; char *filename = "test.fil"; char *teststr; + apr_uid_t uid; + apr_gid_t gid; #if APR_FILES_AS_SOCKETS apr_int32_t num; #endif @@ -227,6 +252,25 @@ int main(void) fprintf(stdout, "OK\n"); } + fprintf(stdout, "\tGetting fileinfo......."); + status = apr_getfileinfo(&finfo, APR_FINFO_NORM, thefile); + if (status == APR_INCOMPLETE) { + int i; + fprintf(stdout, "INCOMPLETE\n"); + for (i = 0; vfi[i].bits; ++i) + if (vfi[i].bits & ~finfo.valid) + fprintf(stdout, "\t Missing %s\n", vfi[i].description); + } + else if (status != APR_SUCCESS) { + fprintf(stderr, "Couldn't get the fileinfo\n"); + exit(-1); + } + else { + fprintf(stdout, "OK\n"); + } + gid = finfo.group; + uid = finfo.user; + fprintf(stdout, "\tClosing File......."); status = apr_close(thefile); if (status != APR_SUCCESS) { @@ -236,7 +280,54 @@ int main(void) else { fprintf(stdout, "OK\n"); } - + + fprintf(stdout, "\tStat'ing file......."); + status = apr_stat(&finfo, filename, APR_FINFO_NORM, context); + if (status == APR_INCOMPLETE) { + int i; + fprintf(stdout, "INCOMPLETE\n"); + for (i = 0; vfi[i].bits; ++i) + if (vfi[i].bits & ~finfo.valid) + fprintf(stdout, "\t Missing %s\n", vfi[i].description); + } + else if (status != APR_SUCCESS) { + fprintf(stderr, "Couldn't stat the file\n"); + exit(-1); + } + else { + fprintf(stdout, "OK\n"); + } + + if (finfo.valid & APR_FINFO_GROUP) { + fprintf(stdout, "\tComparing group ids......."); + status = apr_get_groupname(&buf, finfo.group, context); + if (status != APR_SUCCESS) { + fprintf(stderr, "Couldn't retrieve the group name\n"); + exit(-1); + } + status = apr_compare_groups(finfo.group, gid); + if (status != APR_SUCCESS) { + fprintf(stderr, "gid's for %s don't match\n", buf); + exit(-1); + } + fprintf(stdout, "gid's for %s match\n", buf); + } + + if (finfo.valid & APR_FINFO_USER) { + fprintf(stdout, "\tComparing user ids......."); + status = apr_get_username(&buf, finfo.user, context); + if (status != APR_SUCCESS) { + fprintf(stderr, "Couldn't retrieve the user name\n"); + exit(-1); + } + status = apr_compare_users(finfo.user, uid); + if (status != APR_SUCCESS) { + fprintf(stderr, "uid's for %s don't match\n", buf); + exit(-1); + } + fprintf(stdout, "uid's for %s match\n", buf); + } + fprintf(stdout, "\tDeleting file......."); status = apr_remove_file(filename, context); if (status != APR_SUCCESS) { @@ -261,6 +352,7 @@ int main(void) test_filedel(context); test_read(context); + apr_destroy_pool(context); return 1; } diff --git a/test/testoc.c b/test/testoc.c index 6c4ac6971bc..bb641e330bd 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -151,11 +151,11 @@ int main(int argc, char *argv[]) fprintf(stdout, "[PARENT] Checking on children..........\n"); apr_check_other_child(); - - return 1; #else fprintf(stdout, "OC failed!\n"); fprintf(stdout, "Other_child is not supported on this platform\n"); #endif + + return 1; } diff --git a/test/testsockopt.c b/test/testsockopt.c index 236820d927d..6c9403d68e5 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -78,6 +78,11 @@ static void failureno(apr_socket_t *sock) exit(-1); } +static void closeapr(void) +{ + apr_terminate(); +} + int main(void) { apr_pool_t *context; @@ -90,7 +95,7 @@ int main(void) fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(apr_terminate); + atexit(closeapr); if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); From d1cf77b445ab66b2be2f9007266d80e4b70c2e19 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 23:45:57 +0000 Subject: [PATCH 1183/7878] Moving a small OS2'ism into APR, it's pw_dir excludes the username. Return the expected result. Also noted the headers/os2errno changes from early this morning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61164 13f79535-47bb-0310-9956-ffa450edef68 --- user/unix/userinfo.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index b5b7ad39716..38ed8d5c05a 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -76,7 +76,12 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use #endif return errno; } +#ifdef OS2 + /* Need to manually add user name for OS/2 */ + *dirname = apr_pstrcat(p, pw->pw_dir, pw->pw_name, NULL); +#else *dirname = apr_pstrdup(p, pw->pw_dir); +#endif return APR_SUCCESS; } From 895c4576f0c0c46dd0a60209ca330c922bf7ff4a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 28 Jan 2001 23:52:47 +0000 Subject: [PATCH 1184/7878] Document these here, where I should have put them in the first place &-/ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61165 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index 498f48b3df5..1be3939d3df 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,15 @@ Changes with APR b1 + *) Corrected an OS2'ism of apr_get_home_directory. OS2 now returns the + proper directory, including the user's name. + + *) Removed private os2errno.h and integrated the OS2 network error codes + into apr_errno.h for optimized error tests (APR_STATUS_IS_EFOO(rv)). + [William Rowe] + + *) Moved inclusion of <os2.h> header from multiple modules into apr.h + [William Rowe] + *) Added apr_compare_users() and apr_compare_groups() for more complex apr_uid_t and apr_gid_t structures. Enabled both .user and .group results from WinNT/2000 stat/getfileinfo, but expect to find that From 04a2b18015a5bd656e286f7e570a1e4bd1b34ee2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 29 Jan 2001 06:21:40 +0000 Subject: [PATCH 1185/7878] Refactor out the 'extras' [not returned by the atomic get info call] and implement protections. The only bit missing, according to testfile.c are the dir_read/stat inode/dev/nlink fields [these are in getfileinfo] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61166 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + STATUS | 27 ++- file_io/win32/dir.c | 59 ++++-- file_io/win32/filestat.c | 403 ++++++++++++++++++++---------------- include/arch/win32/fileio.h | 12 ++ 5 files changed, 298 insertions(+), 205 deletions(-) diff --git a/CHANGES b/CHANGES index 1be3939d3df..c7204497727 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Implement WinNT Unix'ish permissions. [William Rowe] + *) Corrected an OS2'ism of apr_get_home_directory. OS2 now returns the proper directory, including the user's name. diff --git a/STATUS b/STATUS index ce4043b11b6..411fdbe3fef 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/28 17:23:22 $] +Last modified at [$Date: 2001/01/29 06:21:36 $] Release: @@ -15,11 +15,18 @@ Release: RELEASE SHOWSTOPPERS: + * Unix apr_stat/lstat/getfileinfo were very fast hacks, needs review. + Will suggests: Unix is looking pretty good. Ignore APR_FINFO_NAME + issues for b1, I've noted that issue below. + + * OS2 apr_stat/lstat/getfileinfo/dir_read were very fast hacks, need + cleanup, toggle messy (APR_INCOMPLETE) result when appropriate. RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: - * Unix, OS2 apr_stat/lstat/getfileinfo were very fast hacks. These - need to be fleshed out. + * Solve Win32 APR_CHR, APR_BLK, etc for Win32 apr_stat without + GetFileType? How about inode/dev/nlink? + Status: Will's WIP * SysV semaphore support isn't usable by Apache when started as root because we don't have a way to allow the semaphore to be @@ -30,9 +37,9 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Build scripts do not recognise AIX 4.2.1 pthreads - * Win32: Implement ap_shm_ functions + * Win32: Implement apr_shm_ functions - * Bill says we need a new procattr, APR_CREATE_SUSPENDED (or + * FirstBill says we need a new procattr, APR_CREATE_SUSPENDED (or something similar) to direct ap_create_process to create the process suspended. We also need a call to wake up the suspended process This may not be able to be implemented everywhere though. @@ -111,3 +118,13 @@ Documentation that needs writing: Stuff waiting for code thawing after Beta 1: + * Implement APR_FINFO_ICASE/APR_FINFO_NAME for stat'ish calls. + Can wait till after b1, will be required to eliminate canonical + and add that functionallity in-line with directory_walk, which + is _not_ planned for 2.0b1, but immediately afterwards. It's + required to complete Apache/WinNT's Unicode schema as well. + Note: Will doesn't like his original APR_FINFO_ICASE definition. + + * Identify and implement those protection bits that have general + usefulness, perhaps hidden, generic read-only [immutable], + effective current user permissions, etc. diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index ba73c8ac163..b813134c578 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -152,11 +152,11 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, */ #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; + apr_wchar_t *eos, wdirname[APR_PATH_MAX]; if (!apr_get_oslevel(thedir->cntxt, &os_level) && os_level >= APR_WIN_NT) { if (thedir->dirhand == INVALID_HANDLE_VALUE) { - apr_wchar_t *eos, wdirname[APR_PATH_MAX]; apr_status_t rv; if (rv = utf8_to_unicode_path(wdirname, sizeof(wdirname) / sizeof(apr_wchar_t), @@ -170,6 +170,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if (thedir->dirhand == INVALID_HANDLE_VALUE) { return apr_get_os_error(); } + eos[0] = '\0'; } else if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) { return apr_get_os_error(); @@ -211,22 +212,6 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, } fname = thedir->n.entry->cFileName; } - if (wanted & ~APR_FINFO_WIN32_DIR) { - char fspec[APR_PATH_MAX]; - int dirlen = strlen(thedir->dirname); - if (dirlen >= sizeof(fspec)) - dirlen = sizeof(fspec) - 1; - apr_cpystrn(fspec, thedir->dirname, sizeof(fspec)); - apr_cpystrn(fspec + dirlen, fname, sizeof(fspec) - dirlen); - rv = apr_stat(finfo, fspec, wanted, thedir->cntxt); - if (rv == APR_SUCCESS || rv == APR_INCOMPLETE) { - finfo->valid |= APR_FINFO_NAME; - finfo->name = fname; - finfo->fname = fspec; - rv = (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; - } - return rv; - } memset(finfo, '\0', sizeof(*finfo)); finfo->name = fname; @@ -262,7 +247,40 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if (finfo->size < 0 || FileInformation.nFileSizeHigh) finfo->size = 0x7fffffff; #endif - return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; + + if (thedir->n.entry->dwFileAttributes & FILE_ATTRIBUTE_READONLY) + finfo->protection = APR_FREADONLY; + + if (wanted &= ~finfo->valid) { + /* Go back and get more_info if we can't answer the whole inquiry + */ +#if APR_HAS_UNICODE_FS + if (os_level >= APR_WIN_NT) { + /* Almost all our work is done. Tack on the wide file name + * to the end of the wdirname (already / delimited) + */ + wcscpy(eos, thedir->w.entry->cFileName); + return more_finfo(finfo, wdirname, wanted, MORE_OF_WFSPEC, os_level); + } + else { + /* Don't waste stack space on a second buffer, the one we set + * aside for the wide directory name is twice what we need. + */ + char *fspec = (char*)wdirname; +#else /* !APR_HAS_UNICODE_FS */ + { + char fspec[APR_PATH_MAX]; +#endif + int dirlen = strlen(thedir->dirname); + if (dirlen >= sizeof(fspec)) + dirlen = sizeof(fspec) - 1; + apr_cpystrn(fspec, thedir->dirname, sizeof(fspec)); + apr_cpystrn(fspec + dirlen, fname, sizeof(fspec) - dirlen); + return more_finfo(finfo, fspec, wanted, MORE_OF_FSPEC, os_level); + } + } + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *dir) @@ -324,11 +342,6 @@ APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont) return APR_SUCCESS; } - - - - - APR_DECLARE(apr_status_t) apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) { diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index a7ae9ed260c..bd1b6ad07d7 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -69,14 +69,216 @@ static apr_status_t free_localheap(void *heap) { return APR_SUCCESS; } +static apr_gid_t worldid = NULL; + +static void free_world(void) +{ + if (worldid) { + FreeSid(worldid); + worldid = NULL; + } +} + +/* Left bit shifts from World scope to given scope */ +typedef enum prot_scope_e { + prot_scope_world = 0, + prot_scope_group = 4, + prot_scope_user = 8 +} prot_scope_e; + +static apr_fileperms_t convert_prot(ACCESS_MASK acc, prot_scope_e scope) +{ + /* These choices are based on the single filesystem bit that controls + * the given behavior. They are -not- recommended for any set protection + * function, such a function should -set- use GENERIC_READ/WRITE/EXECUTE + */ + apr_fileperms_t prot; + if (acc & FILE_EXECUTE) + prot |= APR_WEXECUTE; + if (acc & FILE_WRITE_DATA) + prot |= APR_WWRITE; + if (acc & FILE_READ_DATA) + prot |= APR_WREAD; + return (prot << scope); +} + +static void resolve_prot(apr_finfo_t *finfo, apr_int32_t wanted, PACL dacl) +{ + TRUSTEE ident = {NULL, NO_MULTIPLE_TRUSTEE, TRUSTEE_IS_SID}; + ACCESS_MASK acc; + if ((wanted & APR_FINFO_WPROT) && !worldid) { + SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_WORLD_SID_AUTHORITY; + if (AllocateAndInitializeSid(&SIDAuth, 1, SECURITY_WORLD_RID, + 0, 0, 0, 0, 0, 0, 0, &worldid)) + atexit(free_world); + else + worldid = NULL; + } + if ((wanted & APR_FINFO_UPROT) && (finfo->valid & APR_FINFO_USER)) { + ident.TrusteeType = TRUSTEE_IS_USER; + ident.ptstrName = finfo->user; + if (GetEffectiveRightsFromAcl(dacl, &ident, &acc) == ERROR_SUCCESS) { + finfo->protection |= convert_prot(acc, prot_scope_user); + finfo->valid |= APR_FINFO_UPROT; + } + } + if ((wanted & APR_FINFO_GPROT) && (finfo->valid & APR_FINFO_GROUP)) { + ident.TrusteeType = TRUSTEE_IS_GROUP; + ident.ptstrName = finfo->group; + if (GetEffectiveRightsFromAcl(dacl, &ident, &acc) == ERROR_SUCCESS) { + finfo->protection |= convert_prot(acc, prot_scope_group); + finfo->valid |= APR_FINFO_GPROT; + } + } + if ((wanted & APR_FINFO_WPROT) && (worldid)) { + ident.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP; + ident.ptstrName = worldid; + if (GetEffectiveRightsFromAcl(dacl, &ident, &acc) == ERROR_SUCCESS) { + finfo->protection |= convert_prot(acc, prot_scope_world); + finfo->valid |= APR_FINFO_WPROT; + } + } +} + +static int resolve_ident(apr_finfo_t *finfo, const char *fname, + apr_int32_t wanted, apr_pool_t *cont) +{ + apr_file_t *thefile = NULL; + apr_status_t rv; + /* + * NT5 (W2K) only supports symlinks in the same manner as mount points. + * This code should eventually take that into account, for now treat + * every reparse point as a symlink... + * + * We must open the file with READ_CONTROL if we plan to retrieve the + * user, group or permissions. + */ + + if ((rv = apr_open(&thefile, fname, + ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0) + | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) + ? APR_READCONTROL : 0), + APR_OS_DEFAULT, cont)) == APR_SUCCESS) { + rv = apr_getfileinfo(finfo, wanted, thefile); + finfo->filehand = NULL; + apr_close(thefile); + } + else if (APR_STATUS_IS_EACCES(rv) && (wanted & (APR_FINFO_PROT + | APR_FINFO_OWNER))) { + /* We have a backup plan. Perhaps we couldn't grab READ_CONTROL? + * proceed without asking for that permission... + */ + if ((rv = apr_open(&thefile, fname, + ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0), + APR_OS_DEFAULT, cont)) == APR_SUCCESS) { + rv = apr_getfileinfo(finfo, wanted & ~(APR_FINFO_PROT + | APR_FINFO_OWNER), + thefile); + finfo->filehand = NULL; + apr_close(thefile); + } + } + if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) + return (rv); + /* We picked up this case above and had opened the link's properties */ + if (wanted & APR_FINFO_LINK) + finfo->valid |= APR_FINFO_LINK; + finfo->fname = thefile->fname; + + return rv; +} + +apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, apr_int32_t wanted, + int whatfile, apr_oslevel_e os_level) +{ + PSID user = NULL, grp = NULL; + PACL dacl = NULL; + apr_status_t rv; + + if (whatfile == MORE_OF_WFSPEC) + (apr_wchar_t*)ufile; + else if (whatfile == MORE_OF_FSPEC) + (char*)ufile; + else if (whatfile == MORE_OF_HANDLE) + (HANDLE)ufile; + + if ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) + && os_level >= APR_WIN_NT) + { + SECURITY_INFORMATION sinf = 0; + PSECURITY_DESCRIPTOR pdesc = NULL; + if (wanted & (APR_FINFO_USER | APR_FINFO_UPROT)) + sinf |= OWNER_SECURITY_INFORMATION; + if (wanted & (APR_FINFO_GROUP | APR_FINFO_GPROT)) + sinf |= GROUP_SECURITY_INFORMATION; + if (wanted & APR_FINFO_PROT) + sinf |= DACL_SECURITY_INFORMATION; + if (whatfile == MORE_OF_WFSPEC) + rv = GetNamedSecurityInfoW((apr_wchar_t*)ufile, + SE_FILE_OBJECT, sinf, + ((wanted & APR_FINFO_USER) ? &user : NULL), + ((wanted & APR_FINFO_GROUP) ? &grp : NULL), + ((wanted & APR_FINFO_PROT) ? &dacl : NULL), + NULL, &pdesc); + else if (whatfile == MORE_OF_FSPEC) + rv = GetNamedSecurityInfoA((char*)ufile, + SE_FILE_OBJECT, sinf, + ((wanted & APR_FINFO_USER) ? &user : NULL), + ((wanted & APR_FINFO_GROUP) ? &grp : NULL), + ((wanted & APR_FINFO_PROT) ? &dacl : NULL), + NULL, &pdesc); + else if (whatfile == MORE_OF_HANDLE) + rv = GetSecurityInfo((HANDLE)ufile, + SE_FILE_OBJECT, sinf, + ((wanted & APR_FINFO_USER) ? &user : NULL), + ((wanted & APR_FINFO_GROUP) ? &grp : NULL), + ((wanted & APR_FINFO_PROT) ? &dacl : NULL), + NULL, &pdesc); + if (rv == ERROR_SUCCESS) + apr_register_cleanup(finfo->cntxt, pdesc, free_localheap, + apr_null_cleanup); + else + user = grp = dacl = NULL; + + if (user) { + finfo->user = user; + finfo->valid |= APR_FINFO_USER; + } + + if (grp) { + finfo->group = grp; + finfo->valid |= APR_FINFO_GROUP; + } + + if (dacl) { + /* Retrieved the discresionary access list */ + resolve_prot(finfo, wanted, dacl); + } + } + + if (!(finfo->valid & APR_FINFO_UPROT)) { + /* Read, write execute for owner. In the Win32 environment, + * anything readable is executable (well, not entirely 100% true, + * but I'm looking for some obvious logic that would help us here.) + */ + if (finfo->protection & APR_FREADONLY) { + finfo->protection |= S_IREAD | S_IEXEC; + } + else { + finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; + } + finfo->valid |= APR_FINFO_UPROT; + } + + return ((wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS); +} + + APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) { BY_HANDLE_FILE_INFORMATION FileInformation; apr_oslevel_e os_level; - PSID user = NULL, grp = NULL; - PACL dacl = NULL; - apr_status_t rv; if (!GetFileInformationByHandle(thefile->filehand, &FileInformation)) { return apr_get_os_error(); @@ -134,59 +336,11 @@ APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted } } + if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) + finfo->protection = APR_FREADONLY; - if ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) - && !apr_get_oslevel(thefile->cntxt, &os_level) - && os_level >= APR_WIN_NT) { - SECURITY_INFORMATION sinf = 0; - PSECURITY_DESCRIPTOR pdesc = NULL; - if (wanted & (APR_FINFO_USER | APR_FINFO_UPROT)) - sinf |= OWNER_SECURITY_INFORMATION; - if (wanted & (APR_FINFO_GROUP | APR_FINFO_GPROT)) - sinf |= GROUP_SECURITY_INFORMATION; - if (wanted & APR_FINFO_PROT) - sinf |= DACL_SECURITY_INFORMATION; - rv = GetSecurityInfo(thefile->filehand, SE_FILE_OBJECT, sinf, - ((wanted & APR_FINFO_USER) ? &user : NULL), - ((wanted & APR_FINFO_GROUP) ? &grp : NULL), - ((wanted & APR_FINFO_PROT) ? &dacl : NULL), - NULL, &pdesc); - if (rv == ERROR_SUCCESS) - apr_register_cleanup(thefile->cntxt, pdesc, free_localheap, - apr_null_cleanup); - } - - if (user) { - finfo->user = user; - finfo->valid |= APR_FINFO_USER; - } - - if (grp) { - finfo->group = grp; - finfo->valid |= APR_FINFO_GROUP; - } - - if (dacl) { - /* Retrieved the discresionary access list */ - - } - else { - /* Read, write execute for owner. In the Win32 environment, - * anything readable is executable (well, not entirely 100% true, - * but I'm looking for some obvious logic that would help us here.) - * TODO: The real permissions come from the DACL - */ - if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { - finfo->protection |= S_IREAD | S_IEXEC; - } - else { - finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; - } - finfo->valid |= APR_FINFO_UPROT; - } - - if (wanted & ~finfo->valid) - return APR_INCOMPLETE; + if (wanted &= ~finfo->valid) + return more_finfo(finfo, thefile->filehand, wanted, MORE_OF_HANDLE, os_level); return APR_SUCCESS; } @@ -197,63 +351,17 @@ APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname, return APR_ENOTIMPL; } -static int stat_with_handle(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) -{ - apr_file_t *thefile = NULL; - apr_status_t rv; - /* - * NT5 (W2K) only supports symlinks in the same manner as mount points. - * This code should eventually take that into account, for now treat - * every reparse point as a symlink... - * - * We must open the file with READ_CONTROL if we plan to retrieve the - * user, group or permissions. - */ - - if ((rv = apr_open(&thefile, fname, - ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0) - | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) - ? APR_READCONTROL : 0), - APR_OS_DEFAULT, cont)) == APR_SUCCESS) { - rv = apr_getfileinfo(finfo, wanted, thefile); - finfo->filehand = NULL; - apr_close(thefile); - } - else if (APR_STATUS_IS_EACCES(rv) && (wanted & (APR_FINFO_PROT - | APR_FINFO_OWNER))) { - /* We have a backup plan. Perhaps we couldn't grab READ_CONTROL? - * proceed without asking for that permission... - */ - if ((rv = apr_open(&thefile, fname, - ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0), - APR_OS_DEFAULT, cont)) == APR_SUCCESS) { - rv = apr_getfileinfo(finfo, wanted & ~(APR_FINFO_PROT - | APR_FINFO_OWNER), - thefile); - finfo->filehand = NULL; - apr_close(thefile); - } - } - if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) - return (rv); - /* We picked up this case above and had opened the link's properties */ - if (wanted & APR_FINFO_LINK) - finfo->valid |= APR_FINFO_LINK; - finfo->fname = thefile->fname; - - return rv; -} - APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *cont) { - /* The WIN32_FILE_ATTRIBUTE_DATA is a subset of this structure +#ifdef APR_HAS_UNICODE_FS + apr_wchar_t wfname[APR_PATH_MAX]; +#endif + /* + * The WIN32_FILE_ATTRIBUTE_DATA is a subset of this structure */ WIN32_FIND_DATA FileInformation; apr_oslevel_e os_level; - PSID user = NULL, grp = NULL; - PACL dacl = NULL; if (apr_get_oslevel(cont, &os_level)) os_level = APR_WIN_95; @@ -265,9 +373,9 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, if (strlen(fname) >= APR_PATH_MAX) { return APR_ENAMETOOLONG; } + #ifdef APR_HAS_UNICODE_FS - else if (os_level >= APR_WIN_NT) { - apr_wchar_t wfname[APR_PATH_MAX]; + if (os_level >= APR_WIN_NT) { apr_status_t rv; if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) / sizeof(apr_wchar_t), fname)) @@ -276,27 +384,10 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, &FileInformation)) { return apr_get_os_error(); } - if (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) { - SECURITY_INFORMATION sinf = 0; - PSECURITY_DESCRIPTOR pdesc = NULL; - if (wanted & (APR_FINFO_USER | APR_FINFO_UPROT)) - sinf |= OWNER_SECURITY_INFORMATION; - if (wanted & (APR_FINFO_GROUP | APR_FINFO_GPROT)) - sinf |= GROUP_SECURITY_INFORMATION; - if (wanted & APR_FINFO_PROT) - sinf |= DACL_SECURITY_INFORMATION; - rv = GetNamedSecurityInfoW(wfname, SE_FILE_OBJECT, sinf, - ((wanted & APR_FINFO_USER) ? &user : NULL), - ((wanted & APR_FINFO_GROUP) ? &grp : NULL), - ((wanted & APR_FINFO_PROT) ? &dacl : NULL), - NULL, &pdesc); - if (rv == ERROR_SUCCESS) - apr_register_cleanup(cont, pdesc, free_localheap, - apr_null_cleanup); - } } + else #endif - else if (os_level >= APR_WIN_98) { + if (os_level >= APR_WIN_98) { if (!GetFileAttributesExA(fname, GetFileExInfoStandard, &FileInformation)) { return apr_get_os_error(); @@ -354,39 +445,17 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, finfo->filetype = APR_REG; } - if (user) { - finfo->user = user; - finfo->valid |= APR_FINFO_USER; - } + if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) + finfo->protection = APR_FREADONLY; - if (grp) { - finfo->group = grp; - finfo->valid |= APR_FINFO_GROUP; - } - - if (dacl) { - /* Retrieved the discresionary access list, provide some real answers - */ - - } - else { - /* Read, write execute for owner - * In the Win32 environment, anything readable is executable - * (not entirely 100% true, but the dacl is -expensive-!) - */ - if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { - finfo->protection |= S_IREAD | S_IEXEC; - } - else { - finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; - } - /* Lying through our teeth */ - finfo->valid |= APR_FINFO_UPROT; + if (wanted &= ~finfo->valid) { +#ifdef APR_HAS_UNICODE_FS + if (os_level >= APR_WIN_NT) + return more_finfo(finfo, wfname, wanted, MORE_OF_WFSPEC, os_level); +#endif + return more_finfo(finfo, fname, wanted, MORE_OF_FSPEC, os_level); } - if (wanted & ~finfo->valid) - return APR_INCOMPLETE; - return APR_SUCCESS; } @@ -395,23 +464,3 @@ APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, { return apr_stat(finfo, fname, wanted & APR_FINFO_LINK, cont); } - -#if 0 - apr_oslevel_e os_level; - if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) - { - WIN32_FIND_DATAW FileInformation; - HANDLE hFind; - apr_wchar_t *wname; - if (strchr(fspec, '*') || strchr(fspec, '?')) - return APR_ENOENT; - wname = utf8_to_unicode_path(fspec, cont); - if (!wname) - return APR_ENAMETOOLONG; - hFind = FindFirstFileW(wname, &FileInformation); - if (hFind == INVALID_HANDLE_VALUE) - return apr_get_os_error(); - else - FindClose(hFind); - *fname = unicode_to_utf8_path(FileInformation.cFileName, cont); -#endif \ No newline at end of file diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 04b629982ee..b9a2f6c00d3 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -140,6 +140,18 @@ apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, | APR_FINFO_CTIME | APR_FINFO_ATIME \ | APR_FINFO_MTIME | APR_FINFO_SIZE) +/* Sneak the Readonly bit through finfo->protection for internal use _only_ */ +#define APR_FREADONLY 0x10000000 + +/* Private function that extends apr_stat/lstat/getfileinfo/dir_read */ +apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, + apr_int32_t wanted, int whatfile, + apr_oslevel_e os_level); + +/* whatfile types for the ufile arg */ +#define MORE_OF_HANDLE 0 +#define MORE_OF_FSPEC 1 +#define MORE_OF_WFSPEC 2 /* quick run-down of fields in windows' apr_file_t structure that may have * obvious uses. From 22d45e874456a1a1024be993f007d6640eea4c5f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Mon, 29 Jan 2001 16:08:51 +0000 Subject: [PATCH 1186/7878] Larger volume structures can have more than 2^16 hardlinks to a single file [absurd? yes.] This patch eliminates emits for Win32, shouldn't harm other platforms, and optimizes structure alignment in any case. My first reaction was to simply call it an int, feel free to offer up that change if you agree. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61167 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index d2fe50128f5..cda1ad66c7d 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -85,6 +85,7 @@ typedef enum { } apr_filetype_e; /* Permissions flags */ + #define APR_UREAD 0x400 #define APR_UWRITE 0x200 #define APR_UEXECUTE 0x100 @@ -177,7 +178,7 @@ struct apr_finfo_t { /** The id of the device the file is on. */ apr_dev_t device; /** The number of hard links to the file. */ - apr_int16_t nlink; + apr_int32_t nlink; /** The size of the file */ apr_off_t size; /** The storage size consumed by the file */ From 9daa902d4e47f7daa761ad412c130af804f7b155 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 29 Jan 2001 16:16:08 +0000 Subject: [PATCH 1187/7878] use a form of preprocessing which buildexports.awk can handle; exports.c now compiles on Unix, as it no longer tries to reference the macros apr_compare_users() or apr_compare_groups() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61168 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_user.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_user.h b/include/apr_user.h index c650fb818f8..507abd0b7ff 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -117,7 +117,7 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use * @tip Returns APR_SUCCESS if the apr_uid_t strutures identify the same user, * APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid. */ -#ifdef WIN32 +#if defined(WIN32) APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right); #else #define apr_compare_users(left,right) ((left == right) ? APR_SUCCESS : APR_EMISMATCH) @@ -141,7 +141,7 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, * @tip Returns APR_SUCCESS if the apr_gid_t strutures identify the same group, * APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid. */ -#ifdef WIN32 +#if defined(WIN32) APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right); #else #define apr_compare_groups(left,right) ((left == right) ? APR_SUCCESS : APR_EMISMATCH) From 73854018d3364a822b2b2ec6bac2c9f4a3a09343 Mon Sep 17 00:00:00 2001 From: Bill Stoddard <stoddard@apache.org> Date: Mon, 29 Jan 2001 17:10:19 +0000 Subject: [PATCH 1188/7878] This fixes a funky compile problem for me. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61169 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index bd1b6ad07d7..e714f49acc3 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -52,6 +52,7 @@ * <http://www.apache.org/>. */ +#include <aclapi.h> #include "apr_private.h" #include "win32/fileio.h" #include "apr_file_io.h" @@ -62,7 +63,6 @@ #include <sys/stat.h> #include "atime.h" #include "misc.h" -#include <aclapi.h> static apr_status_t free_localheap(void *heap) { LocalFree(heap); From 3fd07566f7a44e79638c47d5bc34eac49a482721 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Mon, 29 Jan 2001 19:01:25 +0000 Subject: [PATCH 1189/7878] Get this working on beos again so we can serve pages! Some of the code improvements were suggested by Carlos Hasan <chasan@acm.org>. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61170 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/unix/mmap.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 77c1d5ce8b9..34f7c2bb697 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -109,7 +109,6 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, #ifdef BEOS void *mm; area_id aid = -1; - char *areaname = "apr_mmap\0"; uint32 pages = 0; #else caddr_t mm; @@ -122,8 +121,6 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, #ifdef BEOS /* XXX: mmap shouldn't really change the seek offset */ apr_seek(file, APR_SET, &offset); - pages = ((size -1) / B_PAGE_SIZE) + 1; - if (flag & APR_MMAP_WRITE) { native_flags |= B_WRITE_AREA; } @@ -131,16 +128,21 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, native_flags |= B_READ_AREA; } - aid = create_area(areaname, &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, - B_FULL_LOCK, native_flags); + /* There seems to be some strange interactions that mean our area must + * be set as READ & WRITE or writev will fail! Go figure... + */ + pages = (size + B_PAGE_SIZE -1) / B_PAGE_SIZE; + aid = create_area("apr_mmap", &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, + B_NO_LOCK, B_WRITE_AREA|B_READ_AREA); if (aid < B_NO_ERROR) { - /* we failed to get an mmap'd file... */ + /* we failed to get an area we can use... */ return APR_ENOMEM; } if (aid >= B_NO_ERROR) read(file->filedes, mm, size); + (*new)->area = aid; #else @@ -162,7 +164,7 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, (*new)->mm = mm; (*new)->size = size; (*new)->cntxt = cont; - + /* register the cleanup... */ apr_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, apr_null_cleanup); From cf02e52777e9db5c20cabd9c0ed0fa285c9aa5de Mon Sep 17 00:00:00 2001 From: Ben Laurie <ben@apache.org> Date: Mon, 29 Jan 2001 22:29:25 +0000 Subject: [PATCH 1190/7878] More doc improvements. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61171 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/default.pl | 6 +++++- helpers/scandoc | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/helpers/default.pl b/helpers/default.pl index 01dfa64edb9..f260cd5d38d 100644 --- a/helpers/default.pl +++ b/helpers/default.pl @@ -498,7 +498,11 @@ sub variable { sub processDescription { local ($_) = @_; - + + # handle HTML markup issues. + s/</&lt;/g; + s/>/&gt;/g; + s/^\s+//; # Remove whitespace from beginning s/\s+$/\n/; # Remove whitespace from end s/\n\n/<p>\n/g; # Replace multiple CR's with paragraph markers diff --git a/helpers/scandoc b/helpers/scandoc index 5d6804eb4c6..13043a30660 100755 --- a/helpers/scandoc +++ b/helpers/scandoc @@ -129,6 +129,8 @@ sub rdln { if ($debug) { print STDERR "(0:$srcfile) $linenumber.\n"; } } } + # Dispose of Apache specific macros + removeApacheMacros(); } # Don't skip "#" @@ -642,7 +644,7 @@ sub parseDeclaration { # Eliminate in-line comments &removeComment; - + # Check for multi-line declaration while ((($valid, $d) = &matchDecl) && $valid) { $decl .= $d; } @@ -1078,6 +1080,11 @@ sub seealsoList { return @r; } +sub removeApacheMacros { +# print "removing from $_"; + s|AP_DECLARE\((.*?)\)|$1|; +} + # Class for parsed package package PackageRecord; From bc096b0ba65ae7062ab7ca8d400c082f6b979400 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 31 Jan 2001 02:10:14 +0000 Subject: [PATCH 1191/7878] get rid of the bzero() macro which we spit out on platforms where we didn't think bzero() was implemented; it turns out that on SVR4 it is implemented but we spit out the macro anyway and clashed with a system header file As APR doesn't need to guarantee the existence of bzero(), the macro is gone. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61172 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index 3c9def4aadb..8db5f67b527 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -143,10 +143,6 @@ int strncasecmp(const char *a, const char *b, size_t n); #define memmove(a,b,c) bcopy(b,a,c) #endif -#if (!APR_HAVE_BZERO) -#define bzero(a,b) memset(a,0,b) -#endif - /** * @package APR Random Functions */ From 5035a4258ccf7661b2cd84ee8a49455da4f392e6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 31 Jan 2001 18:24:05 +0000 Subject: [PATCH 1192/7878] Fix the export list builder to understand more preprocessor constructs (like those in apr_user.h). Submitted by: Brian Havard Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61173 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/make_export.awk | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/helpers/make_export.awk b/helpers/make_export.awk index c2b232154c5..7d61a55fa56 100644 --- a/helpers/make_export.awk +++ b/helpers/make_export.awk @@ -11,7 +11,6 @@ } macro_stack[macro_no++] = macro macro = substr($0, length($1)+2) - found++ count++ line = line macro "\n" next @@ -23,17 +22,17 @@ line = line "/" macro "\n" macro = macro_stack[--macro_no] } - if (found == count + 1) { - found-- + if (count == 0) { + if (found != 0) { + printf("%s", line) + } line = "" - } else if (found > count + 1) { - found = 0 } next } /^[ \t]*(AP[RU]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?([A-Za-z0-9_]+)\(/ { - if (found) { + if (count) { found++ } for (i = 0; i < count; i++) { @@ -42,6 +41,11 @@ sub("^[ \t]*(AP[UR]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?", ""); sub("[(].*", ""); line = line $0 "\n" + + if (count == 0) { + printf("%s", line) + line = "" + } next } From c60dd07dc572d03133be410fb256d429a9e51777 Mon Sep 17 00:00:00 2001 From: Bill Stoddard <stoddard@apache.org> Date: Wed, 31 Jan 2001 20:01:16 +0000 Subject: [PATCH 1193/7878] apr_stat() in http_request.c only needs size, type, mtime, ctime & atime values from the file. Modify apr_stat() under windows to accomodate apr_stat( APR_FINFO_MIN) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61174 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 16 +++++++++++++--- include/apr_file_info.h | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index e714f49acc3..231cefda739 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -412,7 +412,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, memset(finfo, '\0', sizeof(*finfo)); finfo->cntxt = cont; finfo->valid = APR_FINFO_ATIME | APR_FINFO_CTIME | APR_FINFO_MTIME - | APR_FINFO_SIZE | APR_FINFO_TYPE; + | APR_FINFO_SIZE | APR_FINFO_TYPE; /* I.e., APR_FINFO_MIN */ /* File times */ FileTimeToAprTime(&finfo->atime, &FileInformation.ftLastAccessTime); @@ -445,10 +445,20 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, finfo->filetype = APR_REG; } - if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) - finfo->protection = APR_FREADONLY; + /* + * Hummm, should we assume the file is always executable? Is there a way + * to know other than guess based on the file extension or make an + * expensive system call? + */ + if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { + finfo->protection |= S_IREAD | S_IEXEC; + } + else { + finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; + } if (wanted &= ~finfo->valid) { + /* Caller wants more than APR_FINFO_MIN */ #ifdef APR_HAS_UNICODE_FS if (os_level >= APR_WIN_NT) return more_finfo(finfo, wfname, wanted, MORE_OF_WFSPEC, os_level); diff --git a/include/apr_file_info.h b/include/apr_file_info.h index cda1ad66c7d..181d3896909 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -146,7 +146,7 @@ typedef struct apr_finfo_t apr_finfo_t; #define APR_FINFO_ICASE 0x01000000 /* if dev is case insensitive */ #define APR_FINFO_NAME 0x02000000 /* ->name in proper case */ -#define APR_FINFO_MIN 0x00008170 /* minimal: type, dates and size */ +#define APR_FINFO_MIN 0x00008170 /* type, mtime, ctime, atime, size */ #define APR_FINFO_IDENT 0x00003000 /* dev and inode */ #define APR_FINFO_OWNER 0x00030000 /* user and group */ #define APR_FINFO_PROT 0x00700000 /* all protections */ From 0f4d352c2ba22cb83f18dd393d8eaf7924a89af7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Wed, 31 Jan 2001 22:41:17 +0000 Subject: [PATCH 1194/7878] Absolutely explicit that finfo.filetype APR_NOFILE is 0 (or false). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61175 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 181d3896909..44e37ee1935 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -74,7 +74,7 @@ extern "C" { */ typedef enum { - APR_NOFILE, /* the file exists, but APR doesn't know its type */ + APR_NOFILE = 0, /* the file exists, but APR doesn't know its type */ APR_REG, /* a regular file */ APR_DIR, /* a directory */ APR_CHR, /* a character device */ From c4521101679c3c3779d12b2a1cc8f680c08b028b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 1 Feb 2001 05:44:17 +0000 Subject: [PATCH 1195/7878] - refactored out the common APR_FINFO_MIN setup into a single fillin function for consistency [required a small, slightly ugly hack.] - reverted the protection change from earlier today. Apache no longer requests protections (unless they truly need it, say in mod_dav_fs), and no longer assumes that the protection member reflects existance. - Added the name member to apr_stat, such that if APR_FINFO_NAME is requested from apr_stat/lstat, the name in true case is returned. This patch prepares for canonical optmization of Apache. [The code chooses to FindFirstFile instead of GetFileAttributesEx iff that field is required.] - Remaining needs; return name from apr_getfileinfo if it is reasonable, return device/inode/nlink from stat/dir_read if reasonable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61176 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 38 +----- file_io/win32/filestat.c | 258 ++++++++++++++++++++------------------- 2 files changed, 138 insertions(+), 158 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index b813134c578..64124121ad2 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -213,43 +213,11 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, fname = thedir->n.entry->cFileName; } - memset(finfo, '\0', sizeof(*finfo)); - finfo->name = fname; - finfo->valid = APR_FINFO_WIN32_DIR; + fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) thedir->w.entry, 0); finfo->cntxt = thedir->cntxt; - /* Do the best job we can determining the file type. - * Win32 only returns device names in a directory in response to a specific - * request (e.g. FindFirstFile("CON"), not to wildcards, so we will ignore - * the BLK, CHR, and other oddballs, since they should -not- occur in this - * context. - */ - if (thedir->n.entry->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { - finfo->filetype = APR_LNK; - finfo->valid |= APR_FINFO_TYPE; - } - else if (thedir->n.entry->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - finfo->filetype = APR_DIR; - finfo->valid |= APR_FINFO_TYPE; - } - else { - finfo->filetype = APR_REG; - finfo->valid |= APR_FINFO_TYPE; - } - FileTimeToAprTime(&finfo->ctime, &thedir->n.entry->ftCreationTime); - FileTimeToAprTime(&finfo->mtime, &thedir->n.entry->ftLastWriteTime); - FileTimeToAprTime(&finfo->atime, &thedir->n.entry->ftLastAccessTime); -#if APR_HAS_LARGE_FILES - finfo->size = ((apr_off_t)thedir->n.entry->nFileSizeHigh << 32) - | (apr_off_t)thedir->n.entry->nFileSizeLow; -#else - finfo->size = (apr_off_t)thedir->n.entry->nFileSizeLow; - if (finfo->size < 0 || FileInformation.nFileSizeHigh) - finfo->size = 0x7fffffff; -#endif - - if (thedir->n.entry->dwFileAttributes & FILE_ATTRIBUTE_READONLY) - finfo->protection = APR_FREADONLY; + finfo->valid |= APR_FINFO_NAME; + finfo->name = fname; if (wanted &= ~finfo->valid) { /* Go back and get more_info if we can't answer the whole inquiry diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 231cefda739..335c56c5f89 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -195,16 +195,27 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, apr_int32_t wante PACL dacl = NULL; apr_status_t rv; - if (whatfile == MORE_OF_WFSPEC) - (apr_wchar_t*)ufile; - else if (whatfile == MORE_OF_FSPEC) - (char*)ufile; - else if (whatfile == MORE_OF_HANDLE) - (HANDLE)ufile; - - if ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) - && os_level >= APR_WIN_NT) + if (os_level < APR_WIN_NT) { + /* Read, write execute for owner. In the Win9x environment, any + * readable file is executable (well, not entirely 100% true, but + * still looking for some cheap logic that would help us here.) + */ + if (finfo->protection & APR_FREADONLY) { + finfo->protection |= APR_WREAD | APR_WEXECUTE; + } + else { + finfo->protection |= APR_WREAD | APR_WEXECUTE | APR_WWRITE; + } + finfo->protection |= (finfo->protection << prot_scope_group) + | (finfo->protection << prot_scope_user); + + finfo->valid |= APR_FINFO_UPROT | APR_FINFO_GPROT | APR_FINFO_WPROT; + } + else if (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) + { + /* On NT this request is incredibly expensive, but accurate. + */ SECURITY_INFORMATION sinf = 0; PSECURITY_DESCRIPTOR pdesc = NULL; if (wanted & (APR_FINFO_USER | APR_FINFO_UPROT)) @@ -256,91 +267,109 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, apr_int32_t wante } } - if (!(finfo->valid & APR_FINFO_UPROT)) { - /* Read, write execute for owner. In the Win32 environment, - * anything readable is executable (well, not entirely 100% true, - * but I'm looking for some obvious logic that would help us here.) - */ - if (finfo->protection & APR_FREADONLY) { - finfo->protection |= S_IREAD | S_IEXEC; - } - else { - finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; - } - finfo->valid |= APR_FINFO_UPROT; - } - return ((wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS); } -APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, - apr_file_t *thefile) +/* This generic fillin depends upon byhandle to be passed as 0 when + * a WIN32_FILE_ATTRIBUTE_DATA or either WIN32_FIND_DATA [A or W] is + * passed for wininfo. When the BY_HANDLE_FILE_INFORMATION structure + * is passed for wininfo, byhandle is passed as 1 to offset the one + * dword discrepancy in the High/Low size structure members. + */ +void fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, + int byhandle) { - BY_HANDLE_FILE_INFORMATION FileInformation; - apr_oslevel_e os_level; - - if (!GetFileInformationByHandle(thefile->filehand, &FileInformation)) { - return apr_get_os_error(); - } + DWORD *sizes = &wininfo->nFileSizeHigh + byhandle; memset(finfo, '\0', sizeof(*finfo)); - finfo->cntxt = thefile->cntxt; - - FileTimeToAprTime(&finfo->atime, &FileInformation.ftLastAccessTime); - FileTimeToAprTime(&finfo->ctime, &FileInformation.ftCreationTime); - FileTimeToAprTime(&finfo->mtime, &FileInformation.ftLastWriteTime); - finfo->inode = (apr_ino_t)FileInformation.nFileIndexLow - | ((apr_ino_t)FileInformation.nFileIndexHigh << 32); - finfo->device = FileInformation.dwVolumeSerialNumber; - finfo->nlink = FileInformation.nNumberOfLinks; + FileTimeToAprTime(&finfo->atime, &wininfo->ftLastAccessTime); + FileTimeToAprTime(&finfo->ctime, &wininfo->ftCreationTime); + FileTimeToAprTime(&finfo->mtime, &wininfo->ftLastWriteTime); #if APR_HAS_LARGE_FILES - finfo->size = (apr_off_t)FileInformation.nFileSizeLow - | ((apr_off_t)FileInformation.nFileSizeHigh << 32); + finfo->size = (apr_off_t)sizes[1] + | ((apr_off_t)sizes[0] << 32); #else - finfo->size = (apr_off_t)FileInformation.nFileSizeLow; - if (finfo->size < 0 || FileInformation.nFileSizeHigh) + finfo->size = (apr_off_t)sizes[1]; + if (finfo->size < 0 || sizes[0]) finfo->size = 0x7fffffff; #endif + + if (wininfo->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { + finfo->filetype = APR_LNK; + } + else if (wininfo->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + finfo->filetype = APR_DIR; + } + else { + /* XXX: Solve this: Short of opening the handle to the file, the + * 'FileType' appears to be unknowable (in any trustworthy or + * consistent sense), that is, as far as PIPE, CHR, etc are concerned. + */ + finfo->filetype = APR_REG; + } + + /* The following flags are [for this moment] private to Win32. + * That's the only excuse for not toggling valid bits to reflect them. + */ + if (wininfo->dwFileAttributes & FILE_ATTRIBUTE_READONLY) + finfo->protection = APR_FREADONLY; finfo->valid = APR_FINFO_ATIME | APR_FINFO_CTIME | APR_FINFO_MTIME - | APR_FINFO_IDENT | APR_FINFO_NLINK | APR_FINFO_SIZE; + | APR_FINFO_SIZE | APR_FINFO_TYPE; /* == APR_FINFO_MIN */ +} + + +APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, + apr_file_t *thefile) +{ + BY_HANDLE_FILE_INFORMATION FileInfo; + + if (!GetFileInformationByHandle(thefile->filehand, &FileInfo)) { + return apr_get_os_error(); + } + + fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 1); + finfo->cntxt = thefile->cntxt; + + /* Extra goodies known only by GetFileInformationByHandle() */ + finfo->inode = (apr_ino_t)FileInfo.nFileIndexLow + | ((apr_ino_t)FileInfo.nFileIndexHigh << 32); + finfo->device = FileInfo.dwVolumeSerialNumber; + finfo->nlink = FileInfo.nNumberOfLinks; + finfo->valid |= APR_FINFO_IDENT | APR_FINFO_NLINK; - if (wanted & APR_FINFO_TYPE) + if ((wanted & APR_FINFO_TYPE) && (APR_FINFO_TYPE == APR_REG)) { + /* Go the extra mile to be -certain- that we have a real, regular + * file, since the attribute bits aren't a certain thing. + */ DWORD FileType; - if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { - finfo->filetype = APR_LNK; - finfo->valid |= APR_FINFO_TYPE; - } - else if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - finfo->filetype = APR_DIR; - finfo->valid |= APR_FINFO_TYPE; - } - else if (FileType = GetFileType(thefile->filehand)) { + if (FileType = GetFileType(thefile->filehand)) { if (FileType == FILE_TYPE_DISK) { finfo->filetype = APR_REG; - finfo->valid |= APR_FINFO_TYPE; } else if (FileType == FILE_TYPE_CHAR) { finfo->filetype = APR_CHR; - finfo->valid |= APR_FINFO_TYPE; } else if (FileType == FILE_TYPE_PIPE) { finfo->filetype = APR_PIPE; - finfo->valid |= APR_FINFO_TYPE; + } + else { + finfo->filetype = APR_NOFILE; } } } - - if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) - finfo->protection = APR_FREADONLY; - if (wanted &= ~finfo->valid) + if (wanted &= ~finfo->valid) { + apr_oslevel_e os_level; + if (apr_get_oslevel(thefile->cntxt, &os_level)) + os_level = APR_WIN_95; return more_finfo(finfo, thefile->filehand, wanted, MORE_OF_HANDLE, os_level); + } return APR_SUCCESS; } @@ -357,12 +386,15 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, #ifdef APR_HAS_UNICODE_FS apr_wchar_t wfname[APR_PATH_MAX]; #endif - /* - * The WIN32_FILE_ATTRIBUTE_DATA is a subset of this structure - */ - WIN32_FIND_DATA FileInformation; apr_oslevel_e os_level; - + char *filename = NULL; + /* These all share a common subset of this structure */ + union { + WIN32_FIND_DATAW w; + WIN32_FIND_DATAA n; + WIN32_FILE_ATTRIBUTE_DATA i; + } FileInfo; + if (apr_get_oslevel(cont, &os_level)) os_level = APR_WIN_95; @@ -380,85 +412,65 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) / sizeof(apr_wchar_t), fname)) return rv; - if (!GetFileAttributesExW(wfname, GetFileExInfoStandard, - &FileInformation)) { - return apr_get_os_error(); + if (!(wanted & APR_FINFO_NAME)) { + if (!GetFileAttributesExW(wfname, GetFileExInfoStandard, + &FileInfo.i)) + return apr_get_os_error(); + } + else { + /* Guard against bogus wildcards and retrieve by name + * since we want the true name, and set aside a long + * enough string to handle the longest file name. + */ + char tmpname[APR_FILE_MAX * 3 + 1]; + HANDLE hFind; + if (strchr(fname, '*') || strchr(fname, '?')) + return APR_ENOENT; + hFind = FindFirstFileW(wfname, &FileInfo.w); + if (hFind == INVALID_HANDLE_VALUE) + return apr_get_os_error(); + FindClose(hFind); + if (unicode_to_utf8_path(tmpname, sizeof(tmpname), + FileInfo.w.cFileName)) { + return APR_ENAMETOOLONG; + } + filename = apr_pstrdup(cont, tmpname); } } else #endif - if (os_level >= APR_WIN_98) { + if ((os_level >= APR_WIN_98) && !(wanted & APR_FINFO_NAME)) + { if (!GetFileAttributesExA(fname, GetFileExInfoStandard, - &FileInformation)) { + &FileInfo.i)) { return apr_get_os_error(); } } else { - /* What a waste of cpu cycles... but we don't have a choice - * Be sure we insulate ourselves against bogus wildcards + /* Guard against bogus wildcards and retrieve by name + * since we want the true name, or are stuck in Win95 */ HANDLE hFind; if (strchr(fname, '*') || strchr(fname, '?')) return APR_ENOENT; - hFind = FindFirstFile(fname, &FileInformation); + hFind = FindFirstFileA(fname, &FileInfo.n); if (hFind == INVALID_HANDLE_VALUE) { return apr_get_os_error(); } - else { - FindClose(hFind); - } + FindClose(hFind); + filename = apr_pstrdup(cont, FileInfo.n.cFileName); } - memset(finfo, '\0', sizeof(*finfo)); + fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 0); finfo->cntxt = cont; - finfo->valid = APR_FINFO_ATIME | APR_FINFO_CTIME | APR_FINFO_MTIME - | APR_FINFO_SIZE | APR_FINFO_TYPE; /* I.e., APR_FINFO_MIN */ - - /* File times */ - FileTimeToAprTime(&finfo->atime, &FileInformation.ftLastAccessTime); - FileTimeToAprTime(&finfo->ctime, &FileInformation.ftCreationTime); - FileTimeToAprTime(&finfo->mtime, &FileInformation.ftLastWriteTime); - -#if APR_HAS_LARGE_FILES - finfo->size = (apr_off_t)FileInformation.nFileSizeLow - | ((apr_off_t)FileInformation.nFileSizeHigh << 32); -#else - finfo->size = (apr_off_t)FileInformation.nFileSizeLow; - if (finfo->size < 0 || FileInformation.nFileSizeHigh) - finfo->size = 0x7fffffff; -#endif - - /* Filetype - Directory or file? - */ - if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { - finfo->filetype = APR_LNK; - } - else if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - finfo->filetype = APR_DIR; - } - else { - /* XXX: Solve this - * Short of opening the handle to the file, the 'FileType' appears - * to be unknowable (in any trustworthy or consistent sense), that - * is, as far as PIPE, CHR, etc. - */ - finfo->filetype = APR_REG; - } - /* - * Hummm, should we assume the file is always executable? Is there a way - * to know other than guess based on the file extension or make an - * expensive system call? - */ - if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { - finfo->protection |= S_IREAD | S_IEXEC; - } - else { - finfo->protection |= S_IREAD | S_IWRITE | S_IEXEC; + if (filename) { + finfo->name = filename; + finfo->valid |= APR_FINFO_NAME; } if (wanted &= ~finfo->valid) { - /* Caller wants more than APR_FINFO_MIN */ + /* Caller wants more than APR_FINFO_MIN | APR_FINFO_NAME */ #ifdef APR_HAS_UNICODE_FS if (os_level >= APR_WIN_NT) return more_finfo(finfo, wfname, wanted, MORE_OF_WFSPEC, os_level); From ee814ec159ff71bf52f0dfe9532018bb565ef7d6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Thu, 1 Feb 2001 05:44:57 +0000 Subject: [PATCH 1196/7878] Keep expecting header updates to fly with the source branch :-/ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61177 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/fileio.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index b9a2f6c00d3..c351de97158 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -143,6 +143,10 @@ apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, /* Sneak the Readonly bit through finfo->protection for internal use _only_ */ #define APR_FREADONLY 0x10000000 +/* Private function for apr_stat/lstat/getfileinfo/dir_read */ +void fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, + int byhandle); + /* Private function that extends apr_stat/lstat/getfileinfo/dir_read */ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, apr_int32_t wanted, int whatfile, From ba7a1821a22daa26daa5254775ed973e0b5def39 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 1 Feb 2001 17:33:42 +0000 Subject: [PATCH 1197/7878] clean up gcc warning (testfile.c:74: warning: missing braces around initializer for `vfi[0]') git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61178 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/test/testfile.c b/test/testfile.c index 2b88682665c..2a7f4a04219 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -71,20 +71,20 @@ struct view_fileinfo apr_int32_t bits; char *description; } vfi[] = { - APR_FINFO_MTIME, "MTIME", - APR_FINFO_CTIME, "CTIME", - APR_FINFO_ATIME, "ATIME", - APR_FINFO_SIZE, "SIZE", - APR_FINFO_DEV, "DEV", - APR_FINFO_INODE, "INODE", - APR_FINFO_NLINK, "NLINK", - APR_FINFO_TYPE, "TYPE", - APR_FINFO_USER, "USER", - APR_FINFO_GROUP, "GROUP", - APR_FINFO_UPROT, "UPROT", - APR_FINFO_GPROT, "GPROT", - APR_FINFO_WPROT, "WPROT", - 0, NULL + {APR_FINFO_MTIME, "MTIME"}, + {APR_FINFO_CTIME, "CTIME"}, + {APR_FINFO_ATIME, "ATIME"}, + {APR_FINFO_SIZE, "SIZE"}, + {APR_FINFO_DEV, "DEV"}, + {APR_FINFO_INODE, "INODE"}, + {APR_FINFO_NLINK, "NLINK"}, + {APR_FINFO_TYPE, "TYPE"}, + {APR_FINFO_USER, "USER"}, + {APR_FINFO_GROUP, "GROUP"}, + {APR_FINFO_UPROT, "UPROT"}, + {APR_FINFO_GPROT, "GPROT"}, + {APR_FINFO_WPROT, "WPROT"}, + {0, NULL} }; int test_filedel(apr_pool_t *); From 333fedebe454395bc144ec7973adbe57d4f4bbe2 Mon Sep 17 00:00:00 2001 From: Doug MacEachern <dougm@apache.org> Date: Fri, 2 Feb 2001 05:56:12 +0000 Subject: [PATCH 1198/7878] be consistent with 'const char * const *' spacing (noticed when parsing the tree with C::Scan) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61179 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 2 +- include/apr_hash.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 9feb6a7211e..404b7e77a86 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -118,7 +118,7 @@ struct apr_getopt_option_t { * @deffunc apr_status_t apr_initopt(apr_getopt_t **os, apr_pool_t *cont,int argc, char *const *argv) */ APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, - int argc, const char *const *argv); + int argc, const char * const *argv); /** * Parse the options initialized by apr_initopt(). diff --git a/include/apr_hash.h b/include/apr_hash.h index 5f3f9ef43dc..77a2ce01e9c 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -121,8 +121,8 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key, * @return Returns NULL if the key is not present. * @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, apr_size_t klen) */ -APR_DECLARE(void*) apr_hash_get(apr_hash_t *ht, const void *key, - apr_ssize_t klen); +APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, + apr_ssize_t klen); /** * Start iterating over the entries in a hash table. From b3d5bc9b1826d4b9b1aeaf9a6b264aa795eb1246 Mon Sep 17 00:00:00 2001 From: Doug MacEachern <dougm@apache.org> Date: Fri, 2 Feb 2001 07:34:22 +0000 Subject: [PATCH 1199/7878] another style nit caught by C::Scan git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61180 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 6472c9cb721..ef3dad0318c 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -527,10 +527,10 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, * (Currently only used on Windows) * </PRE> * @param on Socket option returned on the call. - * @deffunc apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t* on) + * @deffunc apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) */ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t* on); + apr_int32_t opt, apr_int32_t *on); /** * Return an apr_sockaddr_t from an apr_socket_t From 75b5c1818551ea1ac47bf3f6a48e48b483230d8a Mon Sep 17 00:00:00 2001 From: Bill Stoddard <stoddard@apache.org> Date: Fri, 2 Feb 2001 14:43:53 +0000 Subject: [PATCH 1200/7878] Win32: (IsLeapYear): New macro for quickly figgerin' out if a given year is a leap year. (SystemTimeToAprExpTime): Perform the calculation of tm_yday. Also, negate the sign of the tm_gmtoff field to be consistent with Unix platforms and APR header file comments. ToDo: Perhaps the IsLeapYear macro is useful for other OSes. Submitted by: Mike Pilato Reviewed by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61181 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ time/win32/time.c | 20 +++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index c7204497727..3e4353839b8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,10 @@ Changes with APR b1 + *) Some fixes in the Win32 time support. + (IsLeapYear): New macro for quickly figgerin' out if a given year is a + leap year. (SystemTimeToAprExpTime): Perform the calculation of + tm_yday. Also, negate the sign of the tm_gmtoff field to be + consistent with Unix platforms and APR header file comments. + [Mike Pilato] *) Implement WinNT Unix'ish permissions. [William Rowe] diff --git a/time/win32/time.c b/time/win32/time.c index 894a5db3c24..6d46f69f631 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -77,6 +77,7 @@ void FileTimeToAprTime(apr_time_t *result, FILETIME *input) *result -= APR_DELTA_EPOCH_IN_USEC; /* Convert from Windows epoch to Unix epoch */ return; } + void AprTimeToFileTime(LPFILETIME pft, apr_time_t t) { LONGLONG ll; @@ -87,10 +88,17 @@ void AprTimeToFileTime(LPFILETIME pft, apr_time_t t) return; } +/* Leap year is any year divisible by four, but not by 100 unless also + * divisible by 400 + */ +#define IsLeapYear(y) ((!(y % 4)) ? (((!(y % 400)) && (y % 100)) ? 1 : 0) : 0) + void SystemTimeToAprExpTime(apr_exploded_time_t *xt, SYSTEMTIME *tm) { TIME_ZONE_INFORMATION tz; DWORD rc; + static const int dayoffset[12] = + {0, 31, 59, 90, 120, 151, 182, 212, 243, 273, 304, 334}; xt->tm_usec = tm->wMilliseconds * 1000; xt->tm_sec = tm->wSecond; @@ -100,7 +108,13 @@ void SystemTimeToAprExpTime(apr_exploded_time_t *xt, SYSTEMTIME *tm) xt->tm_mon = tm->wMonth - 1; xt->tm_year = tm->wYear - 1900; xt->tm_wday = tm->wDayOfWeek; - xt->tm_yday = 0; /* ToDo: need to compute this */ + xt->tm_yday = dayoffset[xt->tm_mon] + (tm->wDay - 1); + + /* If this is a leap year, and we're past the 28th of Feb. (the + * 58th day after Jan. 1), we'll increment our tm_yday by one. + */ + if (IsLeapYear(tm->wYear) && (xt->tm_yday > 58)) + xt->tm_yday++; rc = GetTimeZoneInformation(&tz); switch (rc) { @@ -110,11 +124,11 @@ void SystemTimeToAprExpTime(apr_exploded_time_t *xt, SYSTEMTIME *tm) /* Bias = UTC - local time in minutes * tm_gmtoff is seconds east of UTC */ - xt->tm_gmtoff = tz.Bias * 60; + xt->tm_gmtoff = tz.Bias * -60; break; case TIME_ZONE_ID_DAYLIGHT: xt->tm_isdst = 1; - xt->tm_gmtoff = tz.Bias * 60; + xt->tm_gmtoff = tz.Bias * -60; break; default: xt->tm_isdst = 0; From b9de637ba321110f991cf6f5baf6bf8691713847 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 2 Feb 2001 18:55:39 +0000 Subject: [PATCH 1201/7878] fix a typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61182 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index ef3dad0318c..a647bb28950 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -99,7 +99,7 @@ extern "C" { #define APR_RESET_NODELAY 2048 /* This flag is ONLY set internally * when we set APR_TCP_NOPUSH with * APR_TCP_NODELAY set to tell us that - * APR_TCP_NODELAY should be truned on + * APR_TCP_NODELAY should be turned on * again when NOPUSH is turned off */ From 12a91cc7801388b333d4f8a6eeb75b17e77f8343 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 3 Feb 2001 16:20:54 +0000 Subject: [PATCH 1202/7878] Clean up someone's cruft in the repository and back out this change git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61183 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 1094 ++++++++++++++++++++++----------------------- libapr.dsp | 1104 +++++++++++++++++++++++----------------------- test/aprtest.dsp | 358 +++++++-------- test/aprtest.dsw | 94 ++-- 4 files changed, 1325 insertions(+), 1325 deletions(-) diff --git a/apr.dsp b/apr.dsp index 2fb1ed25e6f..ebd16a0fc22 100644 --- a/apr.dsp +++ b/apr.dsp @@ -1,547 +1,547 @@ -# Microsoft Developer Studio Project File - Name="apr" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=apr - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr.mak" CFG="apr - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "apr - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe - -!IF "$(CFG)" == "apr - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "LibR" -# PROP BASE Intermediate_Dir "LibR" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "LibR" -# PROP Intermediate_Dir "LibR" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "apr - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "LibD" -# PROP BASE Intermediate_Dir "LibD" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "LibD" -# PROP Intermediate_Dir "LibD" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "apr - Win32 Release" -# Name "apr - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter ".c" -# Begin Group "time" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\time\win32\access.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\atime.h -# End Source File -# Begin Source File - -SOURCE=.\time\win32\time.c -# End Source File -# Begin Source File - -SOURCE=.\time\win32\timestr.c -# End Source File -# End Group -# Begin Group "strings" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\strings\apr_cpystrn.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_fnmatch.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_snprintf.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_strings.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_strnatcmp.c -# End Source File -# End Group -# Begin Group "passwd" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\passwd\apr_getpass.c -# End Source File -# Begin Source File - -SOURCE=.\passwd\apr_md5.c -# End Source File -# End Group -# Begin Group "tables" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\tables\apr_hash.c -# End Source File -# Begin Source File - -SOURCE=.\tables\apr_tables.c -# End Source File -# End Group -# Begin Group "misc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\misc\unix\errorcodes.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\getopt.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\getuuid.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\misc.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\unix\misc.h -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\names.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\rand.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\start.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\uuid.c -# End Source File -# End Group -# Begin Group "file_io" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\file_io\win32\canonfile.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\dir.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\unix\fileacc.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\filedup.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\fileio.h -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\filestat.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\flock.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\unix\fullrw.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\open.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\pipe.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\readwrite.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\seek.c -# End Source File -# End Group -# Begin Group "locks" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\locks\win32\locks.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\locks.h -# End Source File -# End Group -# Begin Group "network_io" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\network_io\unix\inet_ntop.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\networkio.h -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\poll.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\unix\sa_common.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sendrecv.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockaddr.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockets.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockopt.c -# End Source File -# End Group -# Begin Group "threadproc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\threadproc\win32\proc.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\signals.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\thread.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\threadpriv.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\threadproc.h -# End Source File -# End Group -# Begin Group "dso" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\dso\win32\dso.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\dso.h -# End Source File -# End Group -# Begin Group "lib" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\lib\apr_pools.c -# End Source File -# Begin Source File - -SOURCE=.\lib\apr_signal.c -# End Source File -# End Group -# Begin Group "i18n" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\arch\unix\i18n.h -# End Source File -# Begin Source File - -SOURCE=.\i18n\unix\utf8_ucs2.c -# End Source File -# Begin Source File - -SOURCE=.\i18n\unix\xlate.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Group "shmem" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\shmem\win32\shmem.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Group "mmap" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\mmap\unix\common.c -# End Source File -# Begin Source File - -SOURCE=.\mmap\win32\mmap.c -# End Source File -# End Group -# Begin Group "user" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\user\win32\groupinfo.c -# End Source File -# Begin Source File - -SOURCE=.\user\win32\userinfo.c -# End Source File -# End Group -# End Group -# Begin Group "Generated Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apr.hw - -!IF "$(CFG)" == "apr - Win32 Release" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - Win32 Debug" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\apr_private.h -# End Source File -# End Group -# Begin Group "External Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr_compat.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_dso.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_errno.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_file_info.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_file_io.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_fnmatch.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_general.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_getopt.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_hash.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_lib.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_lock.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_md5.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_mmap.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_network_io.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_pools.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_portable.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_shmem.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_strings.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_tables.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_thread_proc.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_time.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_user.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_uuid.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_want.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_xlate.h -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="apr" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=apr - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr.mak" CFG="apr - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "apr - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe + +!IF "$(CFG)" == "apr - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "LibR" +# PROP BASE Intermediate_Dir "LibR" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "LibR" +# PROP Intermediate_Dir "LibR" +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "apr - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "LibD" +# PROP BASE Intermediate_Dir "LibD" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "LibD" +# PROP Intermediate_Dir "LibD" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "apr - Win32 Release" +# Name "apr - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter ".c" +# Begin Group "time" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\time\win32\access.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\atime.h +# End Source File +# Begin Source File + +SOURCE=.\time\win32\time.c +# End Source File +# Begin Source File + +SOURCE=.\time\win32\timestr.c +# End Source File +# End Group +# Begin Group "strings" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\strings\apr_cpystrn.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_fnmatch.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_snprintf.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_strings.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_strnatcmp.c +# End Source File +# End Group +# Begin Group "passwd" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\passwd\apr_getpass.c +# End Source File +# Begin Source File + +SOURCE=.\passwd\apr_md5.c +# End Source File +# End Group +# Begin Group "tables" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\tables\apr_hash.c +# End Source File +# Begin Source File + +SOURCE=.\tables\apr_tables.c +# End Source File +# End Group +# Begin Group "misc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\misc\unix\errorcodes.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\getopt.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\getuuid.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\misc.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\unix\misc.h +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\names.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\rand.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\start.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\uuid.c +# End Source File +# End Group +# Begin Group "file_io" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\file_io\win32\canonfile.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\dir.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\unix\fileacc.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\filedup.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\fileio.h +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\filestat.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\flock.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\unix\fullrw.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\open.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\pipe.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\readwrite.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\seek.c +# End Source File +# End Group +# Begin Group "locks" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\locks\win32\locks.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\locks.h +# End Source File +# End Group +# Begin Group "network_io" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\network_io\unix\inet_ntop.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\networkio.h +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\poll.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\unix\sa_common.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sendrecv.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockaddr.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockets.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockopt.c +# End Source File +# End Group +# Begin Group "threadproc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\threadproc\win32\proc.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\signals.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\thread.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\threadpriv.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\threadproc.h +# End Source File +# End Group +# Begin Group "dso" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\dso\win32\dso.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\dso.h +# End Source File +# End Group +# Begin Group "lib" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\lib\apr_pools.c +# End Source File +# Begin Source File + +SOURCE=.\lib\apr_signal.c +# End Source File +# End Group +# Begin Group "i18n" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\arch\unix\i18n.h +# End Source File +# Begin Source File + +SOURCE=.\i18n\unix\utf8_ucs2.c +# End Source File +# Begin Source File + +SOURCE=.\i18n\unix\xlate.c +# PROP Exclude_From_Build 1 +# End Source File +# End Group +# Begin Group "shmem" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\shmem\win32\shmem.c +# PROP Exclude_From_Build 1 +# End Source File +# End Group +# Begin Group "mmap" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\mmap\unix\common.c +# End Source File +# Begin Source File + +SOURCE=.\mmap\win32\mmap.c +# End Source File +# End Group +# Begin Group "user" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\user\win32\groupinfo.c +# End Source File +# Begin Source File + +SOURCE=.\user\win32\userinfo.c +# End Source File +# End Group +# End Group +# Begin Group "Generated Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\apr.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\apr.hw + +!IF "$(CFG)" == "apr - Win32 Release" + +# Begin Custom Build +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - Win32 Debug" + +# Begin Custom Build +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\apr_private.h +# End Source File +# End Group +# Begin Group "External Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\apr_compat.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_dso.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_errno.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_file_info.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_file_io.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_fnmatch.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_general.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_getopt.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_hash.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_lib.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_lock.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_md5.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_mmap.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_network_io.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_pools.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_portable.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_shmem.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_strings.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_tables.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_thread_proc.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_time.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_user.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_uuid.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_want.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_xlate.h +# End Source File +# End Group +# End Target +# End Project diff --git a/libapr.dsp b/libapr.dsp index be61aca054e..705777288b2 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -1,552 +1,552 @@ -# Microsoft Developer Studio Project File - Name="libapr" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=libapr - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libapr.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libapr.mak" CFG="libapr - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libapr - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libapr - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libapr - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\apr" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF - -!ELSEIF "$(CFG)" == "libapr - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\apr" /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF - -!ENDIF - -# Begin Target - -# Name "libapr - Win32 Release" -# Name "libapr - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter ".c" -# Begin Group "time" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\time\win32\access.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\atime.h -# End Source File -# Begin Source File - -SOURCE=.\time\win32\time.c -# End Source File -# Begin Source File - -SOURCE=.\time\win32\timestr.c -# End Source File -# End Group -# Begin Group "strings" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\strings\apr_cpystrn.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_fnmatch.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_snprintf.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_strings.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_strnatcmp.c -# End Source File -# End Group -# Begin Group "passwd" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\passwd\apr_getpass.c -# End Source File -# Begin Source File - -SOURCE=.\passwd\apr_md5.c -# End Source File -# End Group -# Begin Group "tables" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\tables\apr_hash.c -# End Source File -# Begin Source File - -SOURCE=.\tables\apr_tables.c -# End Source File -# End Group -# Begin Group "misc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\misc\unix\errorcodes.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\getopt.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\getuuid.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\misc.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\unix\misc.h -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\names.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\rand.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\start.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\uuid.c -# End Source File -# End Group -# Begin Group "file_io" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\file_io\win32\canonfile.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\dir.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\unix\fileacc.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\filedup.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\fileio.h -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\filestat.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\flock.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\unix\fullrw.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\open.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\pipe.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\readwrite.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\seek.c -# End Source File -# End Group -# Begin Group "locks" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\locks\win32\locks.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\locks.h -# End Source File -# End Group -# Begin Group "network_io" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\network_io\unix\inet_ntop.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\networkio.h -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\poll.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\unix\sa_common.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sendrecv.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockaddr.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockets.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockopt.c -# End Source File -# End Group -# Begin Group "threadproc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\threadproc\win32\proc.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\signals.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\thread.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\threadpriv.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\threadproc.h -# End Source File -# End Group -# Begin Group "dso" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\dso\win32\dso.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\dso.h -# End Source File -# End Group -# Begin Group "lib" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\lib\apr_pools.c -# End Source File -# Begin Source File - -SOURCE=.\lib\apr_signal.c -# End Source File -# End Group -# Begin Group "i18n" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\arch\unix\i18n.h -# End Source File -# Begin Source File - -SOURCE=.\i18n\unix\utf8_ucs2.c -# End Source File -# Begin Source File - -SOURCE=.\i18n\unix\xlate.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Group "shmem" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\shmem\win32\shmem.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Group "mmap" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\mmap\unix\common.c -# End Source File -# Begin Source File - -SOURCE=.\mmap\win32\mmap.c -# End Source File -# End Group -# Begin Group "user" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\user\win32\groupinfo.c -# End Source File -# Begin Source File - -SOURCE=.\user\win32\userinfo.c -# End Source File -# End Group -# End Group -# Begin Group "Generated Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apr.hw - -!IF "$(CFG)" == "libapr - Win32 Release" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - Win32 Debug" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\apr_private.h -# End Source File -# End Group -# Begin Group "External Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr_compat.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_dso.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_errno.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_file_info.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_file_io.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_fnmatch.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_general.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_getopt.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_hash.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_lib.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_lock.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_md5.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_mmap.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_network_io.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_pools.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_portable.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_shmem.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_strings.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_tables.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_thread_proc.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_time.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_user.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_uuid.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_want.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_xlate.h -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="libapr" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=libapr - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libapr.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libapr.mak" CFG="libapr - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libapr - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libapr - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libapr - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\apr" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\apr" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF + +!ENDIF + +# Begin Target + +# Name "libapr - Win32 Release" +# Name "libapr - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter ".c" +# Begin Group "time" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\time\win32\access.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\atime.h +# End Source File +# Begin Source File + +SOURCE=.\time\win32\time.c +# End Source File +# Begin Source File + +SOURCE=.\time\win32\timestr.c +# End Source File +# End Group +# Begin Group "strings" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\strings\apr_cpystrn.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_fnmatch.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_snprintf.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_strings.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_strnatcmp.c +# End Source File +# End Group +# Begin Group "passwd" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\passwd\apr_getpass.c +# End Source File +# Begin Source File + +SOURCE=.\passwd\apr_md5.c +# End Source File +# End Group +# Begin Group "tables" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\tables\apr_hash.c +# End Source File +# Begin Source File + +SOURCE=.\tables\apr_tables.c +# End Source File +# End Group +# Begin Group "misc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\misc\unix\errorcodes.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\getopt.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\getuuid.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\misc.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\unix\misc.h +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\names.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\rand.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\start.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\uuid.c +# End Source File +# End Group +# Begin Group "file_io" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\file_io\win32\canonfile.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\dir.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\unix\fileacc.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\filedup.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\fileio.h +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\filestat.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\flock.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\unix\fullrw.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\open.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\pipe.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\readwrite.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\seek.c +# End Source File +# End Group +# Begin Group "locks" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\locks\win32\locks.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\locks.h +# End Source File +# End Group +# Begin Group "network_io" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\network_io\unix\inet_ntop.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\networkio.h +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\poll.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\unix\sa_common.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sendrecv.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockaddr.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockets.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockopt.c +# End Source File +# End Group +# Begin Group "threadproc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\threadproc\win32\proc.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\signals.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\thread.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\threadpriv.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\threadproc.h +# End Source File +# End Group +# Begin Group "dso" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\dso\win32\dso.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\dso.h +# End Source File +# End Group +# Begin Group "lib" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\lib\apr_pools.c +# End Source File +# Begin Source File + +SOURCE=.\lib\apr_signal.c +# End Source File +# End Group +# Begin Group "i18n" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\arch\unix\i18n.h +# End Source File +# Begin Source File + +SOURCE=.\i18n\unix\utf8_ucs2.c +# End Source File +# Begin Source File + +SOURCE=.\i18n\unix\xlate.c +# PROP Exclude_From_Build 1 +# End Source File +# End Group +# Begin Group "shmem" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\shmem\win32\shmem.c +# PROP Exclude_From_Build 1 +# End Source File +# End Group +# Begin Group "mmap" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\mmap\unix\common.c +# End Source File +# Begin Source File + +SOURCE=.\mmap\win32\mmap.c +# End Source File +# End Group +# Begin Group "user" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\user\win32\groupinfo.c +# End Source File +# Begin Source File + +SOURCE=.\user\win32\userinfo.c +# End Source File +# End Group +# End Group +# Begin Group "Generated Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\apr.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\apr.hw + +!IF "$(CFG)" == "libapr - Win32 Release" + +# Begin Custom Build +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +# Begin Custom Build +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\apr_private.h +# End Source File +# End Group +# Begin Group "External Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\apr_compat.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_dso.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_errno.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_file_info.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_file_io.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_fnmatch.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_general.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_getopt.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_hash.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_lib.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_lock.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_md5.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_mmap.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_network_io.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_pools.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_portable.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_shmem.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_strings.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_tables.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_thread_proc.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_time.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_user.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_uuid.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_want.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_xlate.h +# End Source File +# End Group +# End Target +# End Project diff --git a/test/aprtest.dsp b/test/aprtest.dsp index f562131f7b4..df146780449 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -1,179 +1,179 @@ -# Microsoft Developer Studio Project File - Name="aprtest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=aprtest - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "aprtest.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "aprtest.mak" CFG="aprtest - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "aprtest - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "aprtest - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "aprtest - Win32 Release" - -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Cmd_Line "NMAKE /f Makefile" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "aprtest.exe" -# PROP BASE Bsc_Name "aprtest.bsc" -# PROP BASE Target_Dir "" -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Cmd_Line "NMAKE /f aprtest.win /a" -# PROP Rebuild_Opt "" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "aprtest - Win32 Debug" - -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Cmd_Line "NMAKE /f aprtest.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "aprtest.exe" -# PROP BASE Bsc_Name "aprtest.bsc" -# PROP BASE Target_Dir "" -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Cmd_Line "NMAKE /f aprtest.win /a" -# PROP Rebuild_Opt "" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "aprtest - Win32 Release" -# Name "aprtest - Win32 Debug" - -!IF "$(CFG)" == "aprtest - Win32 Release" - -!ELSEIF "$(CFG)" == "aprtest - Win32 Debug" - -!ENDIF - -# Begin Group "Sources" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\abc.c -# End Source File -# Begin Source File - -SOURCE=.\client.c -# End Source File -# Begin Source File - -SOURCE=.\mod_test.c -# End Source File -# Begin Source File - -SOURCE=.\occhild.c -# End Source File -# Begin Source File - -SOURCE=.\sendfile.c -# End Source File -# Begin Source File - -SOURCE=.\server.c -# End Source File -# Begin Source File - -SOURCE=.\testargs.c -# End Source File -# Begin Source File - -SOURCE=.\testcontext.c -# End Source File -# Begin Source File - -SOURCE=.\testdso.c -# End Source File -# Begin Source File - -SOURCE=.\testfile.c -# End Source File -# Begin Source File - -SOURCE=.\testflock.c -# End Source File -# Begin Source File - -SOURCE=.\testmmap.c -# End Source File -# Begin Source File - -SOURCE=.\testoc.c -# End Source File -# Begin Source File - -SOURCE=.\testpipe.c -# End Source File -# Begin Source File - -SOURCE=.\testproc.c -# End Source File -# Begin Source File - -SOURCE=.\testshmem.c -# End Source File -# Begin Source File - -SOURCE=.\testsock.c -# End Source File -# Begin Source File - -SOURCE=.\testthread.c -# End Source File -# Begin Source File - -SOURCE=.\testtime.c -# End Source File -# Begin Source File - -SOURCE=.\testucs.c -# End Source File -# Begin Source File - -SOURCE=.\testuuid.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\aprtest.win -# End Source File -# Begin Source File - -SOURCE=.\Makefile.in -# End Source File -# Begin Source File - -SOURCE=.\MakeWin32Make.pl -# End Source File -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="aprtest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) External Target" 0x0106 + +CFG=aprtest - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "aprtest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "aprtest.mak" CFG="aprtest - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "aprtest - Win32 Release" (based on "Win32 (x86) External Target") +!MESSAGE "aprtest - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "aprtest - Win32 Release" + +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Cmd_Line "NMAKE /f Makefile" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "aprtest.exe" +# PROP BASE Bsc_Name "aprtest.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Cmd_Line "NMAKE /f aprtest.win /a" +# PROP Rebuild_Opt "" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "aprtest - Win32 Debug" + +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Cmd_Line "NMAKE /f aprtest.mak" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "aprtest.exe" +# PROP BASE Bsc_Name "aprtest.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Cmd_Line "NMAKE /f aprtest.win /a" +# PROP Rebuild_Opt "" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "aprtest - Win32 Release" +# Name "aprtest - Win32 Debug" + +!IF "$(CFG)" == "aprtest - Win32 Release" + +!ELSEIF "$(CFG)" == "aprtest - Win32 Debug" + +!ENDIF + +# Begin Group "Sources" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\abc.c +# End Source File +# Begin Source File + +SOURCE=.\client.c +# End Source File +# Begin Source File + +SOURCE=.\mod_test.c +# End Source File +# Begin Source File + +SOURCE=.\occhild.c +# End Source File +# Begin Source File + +SOURCE=.\sendfile.c +# End Source File +# Begin Source File + +SOURCE=.\server.c +# End Source File +# Begin Source File + +SOURCE=.\testargs.c +# End Source File +# Begin Source File + +SOURCE=.\testcontext.c +# End Source File +# Begin Source File + +SOURCE=.\testdso.c +# End Source File +# Begin Source File + +SOURCE=.\testfile.c +# End Source File +# Begin Source File + +SOURCE=.\testflock.c +# End Source File +# Begin Source File + +SOURCE=.\testmmap.c +# End Source File +# Begin Source File + +SOURCE=.\testoc.c +# End Source File +# Begin Source File + +SOURCE=.\testpipe.c +# End Source File +# Begin Source File + +SOURCE=.\testproc.c +# End Source File +# Begin Source File + +SOURCE=.\testshmem.c +# End Source File +# Begin Source File + +SOURCE=.\testsock.c +# End Source File +# Begin Source File + +SOURCE=.\testthread.c +# End Source File +# Begin Source File + +SOURCE=.\testtime.c +# End Source File +# Begin Source File + +SOURCE=.\testucs.c +# End Source File +# Begin Source File + +SOURCE=.\testuuid.c +# End Source File +# End Group +# Begin Source File + +SOURCE=.\aprtest.win +# End Source File +# Begin Source File + +SOURCE=.\Makefile.in +# End Source File +# Begin Source File + +SOURCE=.\MakeWin32Make.pl +# End Source File +# End Target +# End Project diff --git a/test/aprtest.dsw b/test/aprtest.dsw index 6d2d700a7d7..de81b5bea29 100644 --- a/test/aprtest.dsw +++ b/test/aprtest.dsw @@ -1,47 +1,47 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "apr"="..\apr.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "aprtest"=".\aprtest.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name aprlib - End Project Dependency - Begin Project Dependency - Project_Dep_Name apr - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "apr"="..\apr.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "aprtest"=".\aprtest.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name aprlib + End Project Dependency + Begin Project Dependency + Project_Dep_Name apr + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + From c4abb1286ac7818b50d2c45cf3aeab9e33e18cac Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sat, 3 Feb 2001 16:31:09 +0000 Subject: [PATCH 1203/7878] A binary file is a file that cannot be parsed in ascii and must not be transformed. A text file is a file that can be viewed and manipulated by any run of the mill text editor, can pass in and out of cvs with the appropriate modifications. Commit then review means that you propose code changes by demonstrating them to the tree. This does -not- apply to major cvs changes, mass symbol name changes or editing the repository. The -kb change is vetoed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61184 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 1094 ++++++++++++++++++++++----------------------- libapr.dsp | 1104 +++++++++++++++++++++++----------------------- test/aprtest.dsp | 358 +++++++-------- test/aprtest.dsw | 94 ++-- 4 files changed, 1325 insertions(+), 1325 deletions(-) diff --git a/apr.dsp b/apr.dsp index ebd16a0fc22..2fb1ed25e6f 100644 --- a/apr.dsp +++ b/apr.dsp @@ -1,547 +1,547 @@ -# Microsoft Developer Studio Project File - Name="apr" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=apr - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr.mak" CFG="apr - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "apr - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe - -!IF "$(CFG)" == "apr - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "LibR" -# PROP BASE Intermediate_Dir "LibR" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "LibR" -# PROP Intermediate_Dir "LibR" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "apr - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "LibD" -# PROP BASE Intermediate_Dir "LibD" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "LibD" -# PROP Intermediate_Dir "LibD" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "apr - Win32 Release" -# Name "apr - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter ".c" -# Begin Group "time" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\time\win32\access.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\atime.h -# End Source File -# Begin Source File - -SOURCE=.\time\win32\time.c -# End Source File -# Begin Source File - -SOURCE=.\time\win32\timestr.c -# End Source File -# End Group -# Begin Group "strings" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\strings\apr_cpystrn.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_fnmatch.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_snprintf.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_strings.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_strnatcmp.c -# End Source File -# End Group -# Begin Group "passwd" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\passwd\apr_getpass.c -# End Source File -# Begin Source File - -SOURCE=.\passwd\apr_md5.c -# End Source File -# End Group -# Begin Group "tables" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\tables\apr_hash.c -# End Source File -# Begin Source File - -SOURCE=.\tables\apr_tables.c -# End Source File -# End Group -# Begin Group "misc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\misc\unix\errorcodes.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\getopt.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\getuuid.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\misc.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\unix\misc.h -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\names.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\rand.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\start.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\uuid.c -# End Source File -# End Group -# Begin Group "file_io" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\file_io\win32\canonfile.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\dir.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\unix\fileacc.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\filedup.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\fileio.h -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\filestat.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\flock.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\unix\fullrw.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\open.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\pipe.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\readwrite.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\seek.c -# End Source File -# End Group -# Begin Group "locks" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\locks\win32\locks.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\locks.h -# End Source File -# End Group -# Begin Group "network_io" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\network_io\unix\inet_ntop.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\networkio.h -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\poll.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\unix\sa_common.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sendrecv.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockaddr.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockets.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockopt.c -# End Source File -# End Group -# Begin Group "threadproc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\threadproc\win32\proc.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\signals.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\thread.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\threadpriv.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\threadproc.h -# End Source File -# End Group -# Begin Group "dso" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\dso\win32\dso.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\dso.h -# End Source File -# End Group -# Begin Group "lib" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\lib\apr_pools.c -# End Source File -# Begin Source File - -SOURCE=.\lib\apr_signal.c -# End Source File -# End Group -# Begin Group "i18n" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\arch\unix\i18n.h -# End Source File -# Begin Source File - -SOURCE=.\i18n\unix\utf8_ucs2.c -# End Source File -# Begin Source File - -SOURCE=.\i18n\unix\xlate.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Group "shmem" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\shmem\win32\shmem.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Group "mmap" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\mmap\unix\common.c -# End Source File -# Begin Source File - -SOURCE=.\mmap\win32\mmap.c -# End Source File -# End Group -# Begin Group "user" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\user\win32\groupinfo.c -# End Source File -# Begin Source File - -SOURCE=.\user\win32\userinfo.c -# End Source File -# End Group -# End Group -# Begin Group "Generated Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apr.hw - -!IF "$(CFG)" == "apr - Win32 Release" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - Win32 Debug" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\apr_private.h -# End Source File -# End Group -# Begin Group "External Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr_compat.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_dso.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_errno.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_file_info.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_file_io.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_fnmatch.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_general.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_getopt.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_hash.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_lib.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_lock.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_md5.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_mmap.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_network_io.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_pools.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_portable.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_shmem.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_strings.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_tables.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_thread_proc.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_time.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_user.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_uuid.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_want.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_xlate.h -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="apr" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=apr - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr.mak" CFG="apr - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "apr - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe + +!IF "$(CFG)" == "apr - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "LibR" +# PROP BASE Intermediate_Dir "LibR" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "LibR" +# PROP Intermediate_Dir "LibR" +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "apr - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "LibD" +# PROP BASE Intermediate_Dir "LibD" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "LibD" +# PROP Intermediate_Dir "LibD" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +RSC=rc.exe +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "apr - Win32 Release" +# Name "apr - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter ".c" +# Begin Group "time" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\time\win32\access.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\atime.h +# End Source File +# Begin Source File + +SOURCE=.\time\win32\time.c +# End Source File +# Begin Source File + +SOURCE=.\time\win32\timestr.c +# End Source File +# End Group +# Begin Group "strings" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\strings\apr_cpystrn.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_fnmatch.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_snprintf.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_strings.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_strnatcmp.c +# End Source File +# End Group +# Begin Group "passwd" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\passwd\apr_getpass.c +# End Source File +# Begin Source File + +SOURCE=.\passwd\apr_md5.c +# End Source File +# End Group +# Begin Group "tables" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\tables\apr_hash.c +# End Source File +# Begin Source File + +SOURCE=.\tables\apr_tables.c +# End Source File +# End Group +# Begin Group "misc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\misc\unix\errorcodes.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\getopt.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\getuuid.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\misc.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\unix\misc.h +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\names.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\rand.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\start.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\uuid.c +# End Source File +# End Group +# Begin Group "file_io" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\file_io\win32\canonfile.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\dir.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\unix\fileacc.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\filedup.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\fileio.h +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\filestat.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\flock.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\unix\fullrw.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\open.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\pipe.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\readwrite.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\seek.c +# End Source File +# End Group +# Begin Group "locks" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\locks\win32\locks.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\locks.h +# End Source File +# End Group +# Begin Group "network_io" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\network_io\unix\inet_ntop.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\networkio.h +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\poll.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\unix\sa_common.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sendrecv.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockaddr.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockets.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockopt.c +# End Source File +# End Group +# Begin Group "threadproc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\threadproc\win32\proc.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\signals.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\thread.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\threadpriv.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\threadproc.h +# End Source File +# End Group +# Begin Group "dso" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\dso\win32\dso.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\dso.h +# End Source File +# End Group +# Begin Group "lib" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\lib\apr_pools.c +# End Source File +# Begin Source File + +SOURCE=.\lib\apr_signal.c +# End Source File +# End Group +# Begin Group "i18n" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\arch\unix\i18n.h +# End Source File +# Begin Source File + +SOURCE=.\i18n\unix\utf8_ucs2.c +# End Source File +# Begin Source File + +SOURCE=.\i18n\unix\xlate.c +# PROP Exclude_From_Build 1 +# End Source File +# End Group +# Begin Group "shmem" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\shmem\win32\shmem.c +# PROP Exclude_From_Build 1 +# End Source File +# End Group +# Begin Group "mmap" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\mmap\unix\common.c +# End Source File +# Begin Source File + +SOURCE=.\mmap\win32\mmap.c +# End Source File +# End Group +# Begin Group "user" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\user\win32\groupinfo.c +# End Source File +# Begin Source File + +SOURCE=.\user\win32\userinfo.c +# End Source File +# End Group +# End Group +# Begin Group "Generated Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\apr.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\apr.hw + +!IF "$(CFG)" == "apr - Win32 Release" + +# Begin Custom Build +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - Win32 Debug" + +# Begin Custom Build +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\apr_private.h +# End Source File +# End Group +# Begin Group "External Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\apr_compat.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_dso.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_errno.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_file_info.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_file_io.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_fnmatch.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_general.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_getopt.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_hash.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_lib.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_lock.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_md5.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_mmap.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_network_io.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_pools.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_portable.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_shmem.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_strings.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_tables.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_thread_proc.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_time.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_user.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_uuid.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_want.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_xlate.h +# End Source File +# End Group +# End Target +# End Project diff --git a/libapr.dsp b/libapr.dsp index 705777288b2..be61aca054e 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -1,552 +1,552 @@ -# Microsoft Developer Studio Project File - Name="libapr" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=libapr - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libapr.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libapr.mak" CFG="libapr - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libapr - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libapr - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libapr - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\apr" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF - -!ELSEIF "$(CFG)" == "libapr - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\apr" /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF - -!ENDIF - -# Begin Target - -# Name "libapr - Win32 Release" -# Name "libapr - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter ".c" -# Begin Group "time" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\time\win32\access.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\atime.h -# End Source File -# Begin Source File - -SOURCE=.\time\win32\time.c -# End Source File -# Begin Source File - -SOURCE=.\time\win32\timestr.c -# End Source File -# End Group -# Begin Group "strings" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\strings\apr_cpystrn.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_fnmatch.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_snprintf.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_strings.c -# End Source File -# Begin Source File - -SOURCE=.\strings\apr_strnatcmp.c -# End Source File -# End Group -# Begin Group "passwd" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\passwd\apr_getpass.c -# End Source File -# Begin Source File - -SOURCE=.\passwd\apr_md5.c -# End Source File -# End Group -# Begin Group "tables" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\tables\apr_hash.c -# End Source File -# Begin Source File - -SOURCE=.\tables\apr_tables.c -# End Source File -# End Group -# Begin Group "misc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\misc\unix\errorcodes.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\getopt.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\getuuid.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\misc.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\unix\misc.h -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\names.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\rand.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\start.c -# End Source File -# Begin Source File - -SOURCE=.\misc\unix\uuid.c -# End Source File -# End Group -# Begin Group "file_io" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\file_io\win32\canonfile.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\dir.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\unix\fileacc.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\filedup.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\fileio.h -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\filestat.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\flock.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\unix\fullrw.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\open.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\pipe.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\readwrite.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\seek.c -# End Source File -# End Group -# Begin Group "locks" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\locks\win32\locks.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\locks.h -# End Source File -# End Group -# Begin Group "network_io" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\network_io\unix\inet_ntop.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\networkio.h -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\poll.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\unix\sa_common.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sendrecv.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockaddr.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockets.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockopt.c -# End Source File -# End Group -# Begin Group "threadproc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\threadproc\win32\proc.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\signals.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\thread.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\threadpriv.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\threadproc.h -# End Source File -# End Group -# Begin Group "dso" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\dso\win32\dso.c -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\dso.h -# End Source File -# End Group -# Begin Group "lib" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\lib\apr_pools.c -# End Source File -# Begin Source File - -SOURCE=.\lib\apr_signal.c -# End Source File -# End Group -# Begin Group "i18n" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\arch\unix\i18n.h -# End Source File -# Begin Source File - -SOURCE=.\i18n\unix\utf8_ucs2.c -# End Source File -# Begin Source File - -SOURCE=.\i18n\unix\xlate.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Group "shmem" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\shmem\win32\shmem.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Group "mmap" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\mmap\unix\common.c -# End Source File -# Begin Source File - -SOURCE=.\mmap\win32\mmap.c -# End Source File -# End Group -# Begin Group "user" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\user\win32\groupinfo.c -# End Source File -# Begin Source File - -SOURCE=.\user\win32\userinfo.c -# End Source File -# End Group -# End Group -# Begin Group "Generated Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apr.hw - -!IF "$(CFG)" == "libapr - Win32 Release" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - Win32 Debug" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\apr_private.h -# End Source File -# End Group -# Begin Group "External Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr_compat.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_dso.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_errno.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_file_info.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_file_io.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_fnmatch.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_general.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_getopt.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_hash.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_lib.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_lock.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_md5.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_mmap.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_network_io.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_pools.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_portable.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_shmem.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_strings.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_tables.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_thread_proc.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_time.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_user.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_uuid.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_want.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_xlate.h -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="libapr" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=libapr - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libapr.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libapr.mak" CFG="libapr - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libapr - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libapr - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libapr - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\apr" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\apr" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF + +!ENDIF + +# Begin Target + +# Name "libapr - Win32 Release" +# Name "libapr - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter ".c" +# Begin Group "time" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\time\win32\access.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\atime.h +# End Source File +# Begin Source File + +SOURCE=.\time\win32\time.c +# End Source File +# Begin Source File + +SOURCE=.\time\win32\timestr.c +# End Source File +# End Group +# Begin Group "strings" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\strings\apr_cpystrn.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_fnmatch.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_snprintf.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_strings.c +# End Source File +# Begin Source File + +SOURCE=.\strings\apr_strnatcmp.c +# End Source File +# End Group +# Begin Group "passwd" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\passwd\apr_getpass.c +# End Source File +# Begin Source File + +SOURCE=.\passwd\apr_md5.c +# End Source File +# End Group +# Begin Group "tables" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\tables\apr_hash.c +# End Source File +# Begin Source File + +SOURCE=.\tables\apr_tables.c +# End Source File +# End Group +# Begin Group "misc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\misc\unix\errorcodes.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\getopt.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\getuuid.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\misc.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\unix\misc.h +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\names.c +# End Source File +# Begin Source File + +SOURCE=.\misc\win32\rand.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\start.c +# End Source File +# Begin Source File + +SOURCE=.\misc\unix\uuid.c +# End Source File +# End Group +# Begin Group "file_io" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\file_io\win32\canonfile.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\dir.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\unix\fileacc.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\filedup.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\fileio.h +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\filestat.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\flock.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\unix\fullrw.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\open.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\pipe.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\readwrite.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\seek.c +# End Source File +# End Group +# Begin Group "locks" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\locks\win32\locks.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\locks.h +# End Source File +# End Group +# Begin Group "network_io" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\network_io\unix\inet_ntop.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\networkio.h +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\poll.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\unix\sa_common.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sendrecv.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockaddr.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockets.c +# End Source File +# Begin Source File + +SOURCE=.\network_io\win32\sockopt.c +# End Source File +# End Group +# Begin Group "threadproc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\threadproc\win32\proc.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\signals.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\thread.c +# End Source File +# Begin Source File + +SOURCE=.\threadproc\win32\threadpriv.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\threadproc.h +# End Source File +# End Group +# Begin Group "dso" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\dso\win32\dso.c +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\dso.h +# End Source File +# End Group +# Begin Group "lib" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\lib\apr_pools.c +# End Source File +# Begin Source File + +SOURCE=.\lib\apr_signal.c +# End Source File +# End Group +# Begin Group "i18n" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\arch\unix\i18n.h +# End Source File +# Begin Source File + +SOURCE=.\i18n\unix\utf8_ucs2.c +# End Source File +# Begin Source File + +SOURCE=.\i18n\unix\xlate.c +# PROP Exclude_From_Build 1 +# End Source File +# End Group +# Begin Group "shmem" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\shmem\win32\shmem.c +# PROP Exclude_From_Build 1 +# End Source File +# End Group +# Begin Group "mmap" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\mmap\unix\common.c +# End Source File +# Begin Source File + +SOURCE=.\mmap\win32\mmap.c +# End Source File +# End Group +# Begin Group "user" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\user\win32\groupinfo.c +# End Source File +# Begin Source File + +SOURCE=.\user\win32\userinfo.c +# End Source File +# End Group +# End Group +# Begin Group "Generated Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\apr.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\apr.hw + +!IF "$(CFG)" == "libapr - Win32 Release" + +# Begin Custom Build +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +# Begin Custom Build +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy .\include\apr.hw .\include\apr.h > nul + echo Created apr.h from apr.hw + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\apr_private.h +# End Source File +# End Group +# Begin Group "External Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\include\apr_compat.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_dso.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_errno.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_file_info.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_file_io.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_fnmatch.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_general.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_getopt.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_hash.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_lib.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_lock.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_md5.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_mmap.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_network_io.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_pools.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_portable.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_shmem.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_strings.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_tables.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_thread_proc.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_time.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_user.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_uuid.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_want.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_xlate.h +# End Source File +# End Group +# End Target +# End Project diff --git a/test/aprtest.dsp b/test/aprtest.dsp index df146780449..f562131f7b4 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -1,179 +1,179 @@ -# Microsoft Developer Studio Project File - Name="aprtest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=aprtest - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "aprtest.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "aprtest.mak" CFG="aprtest - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "aprtest - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "aprtest - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "aprtest - Win32 Release" - -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Cmd_Line "NMAKE /f Makefile" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "aprtest.exe" -# PROP BASE Bsc_Name "aprtest.bsc" -# PROP BASE Target_Dir "" -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Cmd_Line "NMAKE /f aprtest.win /a" -# PROP Rebuild_Opt "" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "aprtest - Win32 Debug" - -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Cmd_Line "NMAKE /f aprtest.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "aprtest.exe" -# PROP BASE Bsc_Name "aprtest.bsc" -# PROP BASE Target_Dir "" -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Cmd_Line "NMAKE /f aprtest.win /a" -# PROP Rebuild_Opt "" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "aprtest - Win32 Release" -# Name "aprtest - Win32 Debug" - -!IF "$(CFG)" == "aprtest - Win32 Release" - -!ELSEIF "$(CFG)" == "aprtest - Win32 Debug" - -!ENDIF - -# Begin Group "Sources" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\abc.c -# End Source File -# Begin Source File - -SOURCE=.\client.c -# End Source File -# Begin Source File - -SOURCE=.\mod_test.c -# End Source File -# Begin Source File - -SOURCE=.\occhild.c -# End Source File -# Begin Source File - -SOURCE=.\sendfile.c -# End Source File -# Begin Source File - -SOURCE=.\server.c -# End Source File -# Begin Source File - -SOURCE=.\testargs.c -# End Source File -# Begin Source File - -SOURCE=.\testcontext.c -# End Source File -# Begin Source File - -SOURCE=.\testdso.c -# End Source File -# Begin Source File - -SOURCE=.\testfile.c -# End Source File -# Begin Source File - -SOURCE=.\testflock.c -# End Source File -# Begin Source File - -SOURCE=.\testmmap.c -# End Source File -# Begin Source File - -SOURCE=.\testoc.c -# End Source File -# Begin Source File - -SOURCE=.\testpipe.c -# End Source File -# Begin Source File - -SOURCE=.\testproc.c -# End Source File -# Begin Source File - -SOURCE=.\testshmem.c -# End Source File -# Begin Source File - -SOURCE=.\testsock.c -# End Source File -# Begin Source File - -SOURCE=.\testthread.c -# End Source File -# Begin Source File - -SOURCE=.\testtime.c -# End Source File -# Begin Source File - -SOURCE=.\testucs.c -# End Source File -# Begin Source File - -SOURCE=.\testuuid.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\aprtest.win -# End Source File -# Begin Source File - -SOURCE=.\Makefile.in -# End Source File -# Begin Source File - -SOURCE=.\MakeWin32Make.pl -# End Source File -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="aprtest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) External Target" 0x0106 + +CFG=aprtest - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "aprtest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "aprtest.mak" CFG="aprtest - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "aprtest - Win32 Release" (based on "Win32 (x86) External Target") +!MESSAGE "aprtest - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "aprtest - Win32 Release" + +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Cmd_Line "NMAKE /f Makefile" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "aprtest.exe" +# PROP BASE Bsc_Name "aprtest.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Cmd_Line "NMAKE /f aprtest.win /a" +# PROP Rebuild_Opt "" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "aprtest - Win32 Debug" + +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Cmd_Line "NMAKE /f aprtest.mak" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "aprtest.exe" +# PROP BASE Bsc_Name "aprtest.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Cmd_Line "NMAKE /f aprtest.win /a" +# PROP Rebuild_Opt "" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "aprtest - Win32 Release" +# Name "aprtest - Win32 Debug" + +!IF "$(CFG)" == "aprtest - Win32 Release" + +!ELSEIF "$(CFG)" == "aprtest - Win32 Debug" + +!ENDIF + +# Begin Group "Sources" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\abc.c +# End Source File +# Begin Source File + +SOURCE=.\client.c +# End Source File +# Begin Source File + +SOURCE=.\mod_test.c +# End Source File +# Begin Source File + +SOURCE=.\occhild.c +# End Source File +# Begin Source File + +SOURCE=.\sendfile.c +# End Source File +# Begin Source File + +SOURCE=.\server.c +# End Source File +# Begin Source File + +SOURCE=.\testargs.c +# End Source File +# Begin Source File + +SOURCE=.\testcontext.c +# End Source File +# Begin Source File + +SOURCE=.\testdso.c +# End Source File +# Begin Source File + +SOURCE=.\testfile.c +# End Source File +# Begin Source File + +SOURCE=.\testflock.c +# End Source File +# Begin Source File + +SOURCE=.\testmmap.c +# End Source File +# Begin Source File + +SOURCE=.\testoc.c +# End Source File +# Begin Source File + +SOURCE=.\testpipe.c +# End Source File +# Begin Source File + +SOURCE=.\testproc.c +# End Source File +# Begin Source File + +SOURCE=.\testshmem.c +# End Source File +# Begin Source File + +SOURCE=.\testsock.c +# End Source File +# Begin Source File + +SOURCE=.\testthread.c +# End Source File +# Begin Source File + +SOURCE=.\testtime.c +# End Source File +# Begin Source File + +SOURCE=.\testucs.c +# End Source File +# Begin Source File + +SOURCE=.\testuuid.c +# End Source File +# End Group +# Begin Source File + +SOURCE=.\aprtest.win +# End Source File +# Begin Source File + +SOURCE=.\Makefile.in +# End Source File +# Begin Source File + +SOURCE=.\MakeWin32Make.pl +# End Source File +# End Target +# End Project diff --git a/test/aprtest.dsw b/test/aprtest.dsw index de81b5bea29..5c02f9bdf51 100644 --- a/test/aprtest.dsw +++ b/test/aprtest.dsw @@ -1,47 +1,47 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "apr"="..\apr.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "aprtest"=".\aprtest.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name aprlib - End Project Dependency - Begin Project Dependency - Project_Dep_Name apr - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "apr"="..\apr.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "aprtest"=".\aprtest.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name aprlib + End Project Dependency + Begin Project Dependency + Project_Dep_Name apr + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + From 13fc5f6807a5d5ac886018a7c07bf6af9f250291 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sun, 4 Feb 2001 21:37:49 +0000 Subject: [PATCH 1204/7878] sun. lots. good. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61185 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 411fdbe3fef..b3de9291b7f 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/01/29 06:21:36 $] +Last modified at [$Date: 2001/02/04 21:37:49 $] Release: @@ -112,6 +112,10 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * add the rest of the pool accessor declare/impl macros. Status: Greg volunteers + * I think apr_open_stderr() and friends dup() the descriptor. That + would allow the new/returned file to be closed (via pool cleanup + or manually) without accidentally closing stderr/out. + Documentation that needs writing: * API documentation From cc557123a65eb4da882083f4dbed034145857793 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Mon, 5 Feb 2001 04:37:50 +0000 Subject: [PATCH 1205/7878] apr_mmap_t is defined as a void*. (caddr_t seems to be a BSDism rather than single unix) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61187 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/unix/mmap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 34f7c2bb697..948fc680a0c 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -87,14 +87,14 @@ static apr_status_t mmap_cleanup(void *themmap) rv = delete_area(mm->area); if (rv == 0) { - mm->mm = (caddr_t)-1; + mm->mm = (void *)-1; return APR_SUCCESS; } #else rv = munmap(mm->mm, mm->size); if (rv == 0) { - mm->mm = (caddr_t)-1; + mm->mm = (void *)-1; return APR_SUCCESS; } #endif @@ -111,7 +111,7 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, area_id aid = -1; uint32 pages = 0; #else - caddr_t mm; + void *mm; #endif if (file == NULL || file->filedes == -1 || file->buffered) @@ -155,7 +155,7 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes, offset); - if (mm == (caddr_t)-1) { + if (mm == (void *)-1) { /* we failed to get an mmap'd file... */ return APR_ENOMEM; } @@ -175,7 +175,7 @@ apr_status_t apr_mmap_delete(apr_mmap_t *mmap) { apr_status_t rv; - if (mmap->mm == (caddr_t) -1) + if (mmap->mm == (void *)-1) return APR_ENOENT; if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { From 13f5e0b4b1ad1ba9ac50cd7bf966073a3c074154 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Mon, 5 Feb 2001 05:19:22 +0000 Subject: [PATCH 1206/7878] for portability: use apr_uint32_t rather than u_long. the latter is a BSDism that may not be available on all platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61188 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index d4444c381da..5ebe4e9eec0 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -85,7 +85,7 @@ APR_DECLARE(apr_status_t) apr_set_port(apr_sockaddr_t *sockaddr, APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr) { - u_long ipaddr; + apr_uint32_t ipaddr; if (!strcmp(addr, APR_ANYADDR)) { sockaddr->sa.sin.sin_addr.s_addr = htonl(INADDR_ANY); @@ -93,7 +93,7 @@ APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr, } ipaddr = inet_addr(addr); - if (ipaddr == (u_long)-1) { + if (ipaddr == (apr_uint32_t)-1) { #ifdef WIN32 return WSAEADDRNOTAVAIL; #else From 7c3fbf72ddf21eb6b387727a659e295248df42c5 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Mon, 5 Feb 2001 05:22:30 +0000 Subject: [PATCH 1207/7878] some whitespace. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61189 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_want.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/apr_want.h b/include/apr_want.h index db5271a92a2..5f7d8fb3a3e 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -77,39 +77,47 @@ /* --------------------------------------------------------------------- */ #ifdef APR_WANT_STRFUNC + #if APR_HAVE_STRING_H #include <string.h> #endif #if APR_HAVE_STRINGS_H #include <strings.h> #endif + #undef APR_WANT_STRFUNC #endif /* --------------------------------------------------------------------- */ #ifdef APR_WANT_MEMFUNC + #if APR_HAVE_STRING_H #include <string.h> #endif + #undef APR_WANT_MEMFUNC #endif /* --------------------------------------------------------------------- */ #ifdef APR_WANT_STDIO + #if APR_HAVE_STDIO_H #include <stdio.h> #endif + #undef APR_WANT_STDIO #endif /* --------------------------------------------------------------------- */ #ifdef APR_WANT_IOVEC + #if APR_HAVE_SYS_UIO_H #include <sys/uio.h> #endif + #undef APR_WANT_IOVEC #endif From 20f024f5866d759aa6cb585b4d3f0700695e411a Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Wed, 7 Feb 2001 16:40:54 +0000 Subject: [PATCH 1208/7878] Fix a problem in configure with the getaddrinfo check. We need to include sys/types.h for some platforms. PR: 7065 Submitted by: jun-ichiro hagino <itojun@kame.net> Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61190 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ helpers/apr-conf.m4 | 3 +++ 2 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index 3e4353839b8..35d7e76322b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR b1 + + *) Fix a problem with configure on NetBSD. We must include sys/types.h + for some platforms. [jun-ichiro hagino <itojun@kame.net>] + *) Some fixes in the Win32 time support. (IsLeapYear): New macro for quickly figgerin' out if a given year is a leap year. (SystemTimeToAprExpTime): Perform the calculation of diff --git a/helpers/apr-conf.m4 b/helpers/apr-conf.m4 index cc01104399f..36ce38fc044 100644 --- a/helpers/apr-conf.m4 +++ b/helpers/apr-conf.m4 @@ -204,6 +204,9 @@ AC_DEFUN(APR_CHECK_WORKING_GETADDRINFO,[ #ifdef HAVE_STRING_H #include <string.h> #endif +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif From 59d0b58623e33aa2001c5d48fea112037f8cafbd Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez <wsanchez@apache.org> Date: Wed, 7 Feb 2001 20:42:16 +0000 Subject: [PATCH 1209/7878] Check for glibtoolize as well as libtoolize. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61191 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildconf b/buildconf index 3b780217f56..5e80c3cb7eb 100755 --- a/buildconf +++ b/buildconf @@ -3,8 +3,8 @@ # # Build aclocal.m4 from libtool's libtool.m4 and our own M4 files. # -ltpath=`helpers/PrintPath libtoolize` -ltpath=`dirname $ltpath` +libtoolize=`helpers/PrintPath glibtoolize libtoolize` +ltpath=`dirname $libtool` ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 echo "Incorporating $ltfile into aclocal.m4 ..." echo "dnl THIS FILE IS AUTOMATICALLY GENERATED BY buildconf" > aclocal.m4 @@ -19,7 +19,7 @@ cat helpers/apr-conf.m4 apr_common.m4 hints.m4 $ltfile >> aclocal.m4 # rely on libtool's versions # echo "Copying libtool helper files ..." -$ltpath/libtoolize --copy +$libtoolize --copy # # Generate the autoconf header and ./configure From 1521138a43e48a0ccfbef0306b460691aed11259 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Wed, 7 Feb 2001 22:58:54 +0000 Subject: [PATCH 1210/7878] fix a typo?? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61192 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildconf b/buildconf index 5e80c3cb7eb..a3bda267d7b 100755 --- a/buildconf +++ b/buildconf @@ -4,7 +4,7 @@ # Build aclocal.m4 from libtool's libtool.m4 and our own M4 files. # libtoolize=`helpers/PrintPath glibtoolize libtoolize` -ltpath=`dirname $libtool` +ltpath=`dirname $libtoolize` ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 echo "Incorporating $ltfile into aclocal.m4 ..." echo "dnl THIS FILE IS AUTOMATICALLY GENERATED BY buildconf" > aclocal.m4 From 9372156c4aa62997ad937f5bf6a8828882cc18ae Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 8 Feb 2001 02:37:29 +0000 Subject: [PATCH 1211/7878] Handle the second parameter to iconv() differently, respecting that some systems declare it "const char **" while other systems (and current Single UNIX Spec.) declare it "char **". We'll still have to add some hints for some platforms to avoid warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61193 13f79535-47bb-0310-9956-ffa450edef68 --- apr_common.m4 | 33 +++++++++++++++++++++++++++++++++ configure.in | 3 +++ i18n/unix/xlate.c | 12 +++++++++--- 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/apr_common.m4 b/apr_common.m4 index 8794bc2ca87..fa4f9825cc5 100644 --- a/apr_common.m4 +++ b/apr_common.m4 @@ -285,3 +285,36 @@ AC_DEFUN(APR_ADDTO,[ $1="$$1 $2"; export $1 ]) +dnl +dnl APR_CHECK_ICONV_INBUF +dnl +dnl Decide whether or not the inbuf parameter to iconv() is const. +dnl +dnl We try to compile something without const. If it fails to +dnl compile, we assume that the system's iconv() has const. +dnl Unfortunately, we won't realize when there was a compile +dnl warning, so we allow a variable -- apr_iconv_inbuf_const -- to +dnl be set in hints.m4 to specify whether or not iconv() has const +dnl on this parameter. +dnl +AC_DEFUN(APR_CHECK_ICONV_INBUF,[ +AC_MSG_CHECKING(for type of inbuf parameter to iconv) +if test "x$apr_iconv_inbuf_const" = "x"; then + AC_TRY_COMPILE([ + #include <stddef.h> + #include <iconv.h> + ],[ + #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR < 2 + #error We know this version of glibc has const char **, so fail this compile + #endif + iconv(0,(char **)0,(size_t *)0,(char **)0,(size_t *)0); + ], apr_iconv_inbuf_const="0", apr_iconv_inbuf_const="1") +fi +if test "$apr_iconv_inbuf_const" = "1"; then + AC_DEFINE(APR_ICONV_INBUF_CONST, 1, [Define if the inbuf parm to iconv() is const char **]) + msg="const char **" +else + msg="char **" +fi +AC_MSG_RESULT([$msg]) +]) diff --git a/configure.in b/configure.in index c6b512e03cb..2e54d15faab 100644 --- a/configure.in +++ b/configure.in @@ -245,6 +245,9 @@ AC_SUBST(apr_inaddr_none) AC_CHECK_FUNC(_getch) AC_CHECK_FUNCS(gmtime_r localtime_r) AC_CHECK_FUNCS(iconv, [ iconv="1" ], [ iconv="0" ]) +if test "$iconv" = "1"; then + APR_CHECK_ICONV_INBUF +fi AC_CHECK_FUNCS(mmap, [ mmap="1" ], [ mmap="0" ]) if test "$native_mmap_emul" = "1"; then mmap="1" diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index b358d5f6c81..3ae49c59ebc 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -80,6 +80,12 @@ #include <iconv.h> #endif +#ifdef APR_ICONV_INBUF_CONST +#define ICONV_INBUF_TYPE const char ** +#else +#define ICONV_INBUF_TYPE char ** +#endif + #ifndef min #define min(x,y) ((x) <= (y) ? (x) : (y)) #endif @@ -194,7 +200,7 @@ static void check_sbcs(apr_xlate_t *convset) } inbytes_left = outbytes_left = sizeof(inbuf); - translated = iconv(convset->ich, &inbufptr, + translated = iconv(convset->ich, (ICONV_INBUF_TYPE)&inbufptr, &inbytes_left, &outbufptr, &outbytes_left); if (translated != (size_t) -1 && inbytes_left == 0 && @@ -285,10 +291,10 @@ apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, size_t translated; if (convset->ich != (iconv_t)-1) { - char *inbufptr = (char *)inbuf; + const char *inbufptr = inbuf; char *outbufptr = outbuf; - translated = iconv(convset->ich, &inbufptr, + translated = iconv(convset->ich, (ICONV_INBUF_TYPE)&inbufptr, inbytes_left, &outbufptr, outbytes_left); /* If everything went fine but we ran out of buffer, don't * report it as an error. Caller needs to look at the two From 34abb222420b3b0001407a51cd27612b27c255fa Mon Sep 17 00:00:00 2001 From: Doug MacEachern <dougm@apache.org> Date: Thu, 8 Feb 2001 07:45:23 +0000 Subject: [PATCH 1212/7878] renaming various functions for consistency sake see: http://apr.apache.org/~dougm/apr_rename.pl PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61194 13f79535-47bb-0310-9956-ffa450edef68 --- dso/aix/dso.c | 4 +- dso/beos/dso.c | 4 +- dso/os2/dso.c | 4 +- dso/os390/dso.c | 4 +- dso/unix/dso.c | 4 +- dso/win32/dso.c | 4 +- file_io/os2/dir.c | 6 +- file_io/os2/filedup.c | 6 +- file_io/os2/filestat.c | 4 +- file_io/os2/flock.c | 4 +- file_io/os2/open.c | 32 +++---- file_io/os2/pipe.c | 12 +-- file_io/os2/readwrite.c | 42 ++++----- file_io/os2/seek.c | 6 +- file_io/unix/dir.c | 14 +-- file_io/unix/fileacc.c | 10 +-- file_io/unix/filedup.c | 8 +- file_io/unix/filestat.c | 4 +- file_io/unix/flock.c | 4 +- file_io/unix/fullrw.c | 8 +- file_io/unix/open.c | 36 ++++---- file_io/unix/pipe.c | 16 ++-- file_io/unix/readwrite.c | 44 +++++----- file_io/unix/seek.c | 6 +- file_io/win32/dir.c | 12 +-- file_io/win32/filedup.c | 6 +- file_io/win32/filestat.c | 20 ++--- file_io/win32/flock.c | 4 +- file_io/win32/open.c | 34 ++++---- file_io/win32/pipe.c | 18 ++-- file_io/win32/readwrite.c | 44 +++++----- file_io/win32/seek.c | 6 +- i18n/unix/xlate.c | 6 +- include/apr_compat.h | 58 ++++++------- include/apr_file_io.h | 156 +++++++++++++++++----------------- include/apr_getopt.h | 12 +-- include/apr_hash.h | 4 +- include/apr_lib.h | 8 +- include/apr_lock.h | 30 +++---- include/apr_md5.h | 22 ++--- include/apr_network_io.h | 74 ++++++++-------- include/apr_pools.h | 62 +++++++------- include/apr_portable.h | 70 +++++++-------- include/apr_shmem.h | 12 +-- include/apr_tables.h | 46 +++++----- include/apr_thread_proc.h | 130 ++++++++++++++-------------- include/apr_time.h | 4 +- include/apr_uuid.h | 12 +-- include/arch/win32/fileio.h | 2 +- lib/apr_pools.c | 96 ++++++++++----------- locks/beos/crossproc.c | 6 +- locks/beos/intraproc.c | 6 +- locks/beos/locks.c | 22 ++--- locks/os2/locks.c | 18 ++-- locks/unix/crossproc.c | 16 ++-- locks/unix/intraproc.c | 6 +- locks/unix/locks.c | 22 ++--- locks/win32/locks.c | 22 ++--- memory/unix/apr_pools.c | 96 ++++++++++----------- misc/unix/getopt.c | 2 +- misc/unix/getuuid.c | 8 +- misc/unix/otherchild.c | 10 +-- misc/unix/start.c | 6 +- misc/unix/uuid.c | 4 +- misc/win32/getuuid.c | 2 +- mmap/unix/mmap.c | 8 +- mmap/win32/mmap.c | 6 +- network_io/beos/poll.c | 20 ++--- network_io/os2/poll.c | 16 ++-- network_io/os2/sockets.c | 32 +++---- network_io/unix/poll.c | 32 +++---- network_io/unix/sa_common.c | 14 +-- network_io/unix/sockets.c | 32 +++---- network_io/win32/poll.c | 22 ++--- network_io/win32/sockets.c | 32 +++---- passwd/apr_getpass.c | 4 +- passwd/apr_md5.c | 70 +++++++-------- shmem/os2/shmem.c | 6 +- shmem/unix/shmem.c | 6 +- strings/apr_snprintf.c | 2 +- tables/apr_hash.c | 2 +- tables/apr_tables.c | 28 +++--- test/abc.c | 6 +- test/client.c | 32 +++---- test/sendfile.c | 56 ++++++------ test/server.c | 64 +++++++------- test/testargs.c | 4 +- test/testcontext.c | 6 +- test/testdso.c | 2 +- test/testfile.c | 122 +++++++++++++------------- test/testflock.c | 20 ++--- test/testmd5.c | 10 +-- test/testmmap.c | 6 +- test/testoc.c | 16 ++-- test/testpipe.c | 12 +-- test/testproc.c | 22 ++--- test/testshmem.c | 4 +- test/testsock.c | 42 ++++----- test/testsockopt.c | 28 +++--- test/testthread.c | 28 +++--- test/testtime.c | 4 +- test/testuuid.c | 16 ++-- threadproc/beos/proc.c | 80 ++++++++--------- threadproc/beos/thread.c | 24 +++--- threadproc/beos/threadpriv.c | 20 ++--- threadproc/os2/proc.c | 84 +++++++++--------- threadproc/os2/signals.c | 2 +- threadproc/os2/thread.c | 12 +-- threadproc/os2/threadpriv.c | 8 +- threadproc/unix/proc.c | 98 ++++++++++----------- threadproc/unix/procsup.c | 2 +- threadproc/unix/signals.c | 2 +- threadproc/unix/thread.c | 52 ++++++------ threadproc/unix/threadpriv.c | 24 +++--- threadproc/win32/proc.c | 30 +++---- threadproc/win32/signals.c | 2 +- threadproc/win32/thread.c | 24 +++--- threadproc/win32/threadpriv.c | 20 ++--- time/unix/time.c | 10 +-- time/win32/time.c | 10 +-- 120 files changed, 1408 insertions(+), 1408 deletions(-) diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 1926180bb7e..4863107df8a 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -155,14 +155,14 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; - apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - return apr_run_cleanup(handle->cont, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 6fdc4cd750d..b41d97b751f 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -79,14 +79,14 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char (*res_handle)->handle = newid; (*res_handle)->cont = ctx; - apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - return apr_run_cleanup(handle->cont, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, diff --git a/dso/os2/dso.c b/dso/os2/dso.c index bceef2e06e3..50ed0d28263 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -94,7 +94,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char } (*res_handle)->handle = handle; - apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -102,7 +102,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - return apr_run_cleanup(handle->cont, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); } diff --git a/dso/os390/dso.c b/dso/os390/dso.c index 631d941bf24..24d42844b4b 100644 --- a/dso/os390/dso.c +++ b/dso/os390/dso.c @@ -87,7 +87,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, if ((handle = dllload(path)) != NULL) { (*res_handle)->handle = handle; - apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -97,7 +97,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - return apr_run_cleanup(handle->pool, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->pool, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 25871f7ed47..9ee57d93986 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -107,14 +107,14 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, (*res_handle)->cont = ctx; (*res_handle)->errormsg = NULL; - apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - return apr_run_cleanup(handle->cont, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 068f7b7d36a..b77f0bfa467 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -126,14 +126,14 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, (*res_handle)->cont = ctx; (*res_handle)->load_error = APR_SUCCESS; - apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_unload(struct apr_dso_handle_t *handle) { - return apr_run_cleanup(handle->cont, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 61a21269cd5..425938cfd5d 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -82,7 +82,7 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cntx thedir->handle = 0; thedir->validentry = FALSE; *new = thedir; - apr_register_cleanup(cntxt, thedir, dir_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(cntxt, thedir, dir_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -167,14 +167,14 @@ apr_status_t apr_dir_rewind(apr_dir_t *thedir) -apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) +apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { return APR_OS2_STATUS(DosCreateDir(path, NULL)); } -apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) +apr_status_t apr_dir_remove(const char *path, apr_pool_t *cont) { return APR_OS2_STATUS(DosDeleteDir(path)); } diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 8bece3dceae..7e7f9181e70 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -58,7 +58,7 @@ #include "apr_strings.h" #include <string.h> -apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) +apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { int rv; apr_file_t *dup_file; @@ -90,8 +90,8 @@ apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t dup_file->pipe = old_file->pipe; if (*new_file == NULL) { - apr_register_cleanup(dup_file->cntxt, dup_file, apr_file_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register(dup_file->cntxt, dup_file, apr_file_cleanup, + apr_pool_cleanup_null); *new_file = dup_file; } diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index ec055908ad1..ff71b3c1e19 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -115,7 +115,7 @@ static apr_status_t handle_type(apr_filetype_e *ftype, HFILE file) -apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, +apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) { ULONG rc; @@ -145,7 +145,7 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, return APR_OS2_STATUS(rc); } -apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) +apr_status_t apr_file_perms_set(const char *fname, apr_fileperms_t perms) { return APR_ENOTIMPL; } diff --git a/file_io/os2/flock.c b/file_io/os2/flock.c index 62e3714d524..9fd7e182fdf 100644 --- a/file_io/os2/flock.c +++ b/file_io/os2/flock.c @@ -54,7 +54,7 @@ #include "fileio.h" -apr_status_t apr_lock_file(apr_file_t *thefile, int type) +apr_status_t apr_file_lock(apr_file_t *thefile, int type) { FILELOCK lockrange = { 0, 0x7fffffff }; ULONG rc; @@ -65,7 +65,7 @@ apr_status_t apr_lock_file(apr_file_t *thefile, int type) return APR_FROM_OS_ERROR(rc); } -apr_status_t apr_unlock_file(apr_file_t *thefile) +apr_status_t apr_file_unlock(apr_file_t *thefile) { FILELOCK unlockrange = { 0, 0x7fffffff }; ULONG rc; diff --git a/file_io/os2/open.c b/file_io/os2/open.c index c7c28e21f8f..16ccb00be77 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -62,12 +62,12 @@ apr_status_t apr_file_cleanup(void *thefile) { apr_file_t *file = thefile; - return apr_close(file); + return apr_file_close(file); } -apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cntxt) +apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cntxt) { int oflags = 0; int mflags = OPEN_FLAGS_FAIL_ON_ERROR|OPEN_SHARE_DENYNONE; @@ -98,7 +98,7 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, ap if (dafile->buffered) { dafile->buffer = apr_palloc(cntxt, APR_FILE_BUFSIZE); - rv = apr_create_lock(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cntxt); + rv = apr_lock_create(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cntxt); if (rv) return rv; @@ -144,19 +144,19 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, ap dafile->direction = 0; dafile->pipe = FALSE; - apr_register_cleanup(dafile->cntxt, dafile, apr_file_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(dafile->cntxt, dafile, apr_file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } -apr_status_t apr_close(apr_file_t *file) +apr_status_t apr_file_close(apr_file_t *file) { ULONG rc; apr_status_t status; if (file && file->isopen) { - apr_flush(file); + apr_file_flush(file); rc = DosClose(file->filedes); if (rc == 0) { @@ -172,14 +172,14 @@ apr_status_t apr_close(apr_file_t *file) } if (file->buffered) - apr_destroy_lock(file->mutex); + apr_lock_destroy(file->mutex); return APR_SUCCESS; } -apr_status_t apr_remove_file(const char *path, apr_pool_t *cntxt) +apr_status_t apr_file_remove(const char *path, apr_pool_t *cntxt) { ULONG rc = DosDelete(path); return APR_OS2_STATUS(rc); @@ -187,7 +187,7 @@ apr_status_t apr_remove_file(const char *path, apr_pool_t *cntxt) -apr_status_t apr_rename_file(const char *from_path, const char *to_path, +apr_status_t apr_file_rename(const char *from_path, const char *to_path, apr_pool_t *p) { ULONG rc = DosMove(from_path, to_path); @@ -205,7 +205,7 @@ apr_status_t apr_rename_file(const char *from_path, const char *to_path, -apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) +apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) { if (file == NULL) { return APR_ENOFILE; @@ -217,7 +217,7 @@ apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) -apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) +apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) { apr_os_file_t *dafile = thefile; @@ -234,7 +234,7 @@ apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, apr_pool -apr_status_t apr_eof(apr_file_t *fptr) +apr_status_t apr_file_eof(apr_file_t *fptr) { if (!fptr->isopen || fptr->eof_hit == 1) { return APR_EOF; @@ -244,20 +244,20 @@ apr_status_t apr_eof(apr_file_t *fptr) -apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) +apr_status_t apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { apr_os_file_t fd = 2; - return apr_put_os_file(thefile, &fd, cont); + return apr_os_file_put(thefile, &fd, cont); } -apr_status_t apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont) +apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) { apr_os_file_t fd = 1; - return apr_put_os_file(thefile, &fd, cont); + return apr_os_file_put(thefile, &fd, cont); } diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 2098519cca1..5dd8cab29d2 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -61,7 +61,7 @@ #include <string.h> #include <process.h> -apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) +apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) { ULONG filedes[2]; ULONG rc, action; @@ -122,7 +122,7 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont (*in)->pipe = 1; (*in)->timeout = -1; (*in)->blocking = BLK_ON; - apr_register_cleanup(cont, *in, apr_file_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(cont, *in, apr_file_cleanup, apr_pool_cleanup_null); (*out) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); (*out)->cntxt = cont; @@ -134,14 +134,14 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont (*out)->pipe = 1; (*out)->timeout = -1; (*out)->blocking = BLK_ON; - apr_register_cleanup(cont, *out, apr_file_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(cont, *out, apr_file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } -apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) +apr_status_t apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) { /* Not yet implemented, interface not suitable */ return APR_ENOTIMPL; @@ -149,7 +149,7 @@ apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, ap -apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) +apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; @@ -172,7 +172,7 @@ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeo -apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) +apr_status_t apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) { if (thepipe->pipe == 1) { *timeout = thepipe->timeout; diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index f6dbd02551e..37bc1da1995 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -61,7 +61,7 @@ #include <malloc.h> -apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) +apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) { ULONG rc = 0; ULONG bytesread; @@ -76,10 +76,10 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) ULONG blocksize; ULONG size = *nbytes; - apr_lock(thefile->mutex); + apr_lock_aquire(thefile->mutex); if (thefile->direction == 1) { - apr_flush(thefile); + apr_file_flush(thefile); thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -105,7 +105,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) } *nbytes = rc == 0 ? pos - (char *)buf : 0; - apr_unlock(thefile->mutex); + apr_lock_release(thefile->mutex); return APR_OS2_STATUS(rc); } else { if (thefile->pipe) @@ -137,7 +137,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) -apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) +apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { ULONG rc = 0; ULONG byteswritten; @@ -152,7 +152,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) int blocksize; int size = *nbytes; - apr_lock(thefile->mutex); + apr_lock_aquire(thefile->mutex); if ( thefile->direction == 0 ) { // Position file pointer for writing at the offset we are logically reading from @@ -165,7 +165,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) while (rc == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full - rc = apr_flush(thefile); + rc = apr_file_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); @@ -174,7 +174,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) size -= blocksize; } - apr_unlock(thefile->mutex); + apr_lock_release(thefile->mutex); return APR_OS2_STATUS(rc); } else { rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten); @@ -193,7 +193,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) #ifdef HAVE_WRITEV -apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) +apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { int bytes; if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { @@ -209,7 +209,7 @@ apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t -apr_status_t apr_putc(char ch, apr_file_t *thefile) +apr_status_t apr_file_putc(char ch, apr_file_t *thefile) { ULONG rc; ULONG byteswritten; @@ -229,15 +229,15 @@ apr_status_t apr_putc(char ch, apr_file_t *thefile) -apr_status_t apr_ungetc(char ch, apr_file_t *thefile) +apr_status_t apr_file_ungetc(char ch, apr_file_t *thefile) { apr_off_t offset = -1; - return apr_seek(thefile, APR_CUR, &offset); + return apr_file_seek(thefile, APR_CUR, &offset); } -apr_status_t apr_getc(char *ch, apr_file_t *thefile) +apr_status_t apr_file_getc(char *ch, apr_file_t *thefile) { ULONG rc; apr_size_t bytesread; @@ -247,7 +247,7 @@ apr_status_t apr_getc(char *ch, apr_file_t *thefile) } bytesread = 1; - rc = apr_read(thefile, ch, &bytesread); + rc = apr_file_read(thefile, ch, &bytesread); if (rc) { return rc; @@ -263,17 +263,17 @@ apr_status_t apr_getc(char *ch, apr_file_t *thefile) -apr_status_t apr_puts(const char *str, apr_file_t *thefile) +apr_status_t apr_file_puts(const char *str, apr_file_t *thefile) { apr_size_t len; len = strlen(str); - return apr_write(thefile, str, &len); + return apr_file_write(thefile, str, &len); } -apr_status_t apr_flush(apr_file_t *thefile) +apr_status_t apr_file_flush(apr_file_t *thefile) { if (thefile->buffered) { ULONG written = 0; @@ -298,7 +298,7 @@ apr_status_t apr_flush(apr_file_t *thefile) -apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) +apr_status_t apr_file_gets(char *str, int len, apr_file_t *thefile) { size_t readlen; apr_status_t rv = APR_SUCCESS; @@ -306,7 +306,7 @@ apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) for (i = 0; i < len-1; i++) { readlen = 1; - rv = apr_read(thefile, str+i, &readlen); + rv = apr_file_read(thefile, str+i, &readlen); if (readlen != 1) { rv = APR_EOF; @@ -324,7 +324,7 @@ apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) -APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) { int cc; va_list ap; @@ -337,7 +337,7 @@ APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) } va_start(ap, format); len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = apr_puts(buf, fptr); + cc = apr_file_puts(buf, fptr); va_end(ap); free(buf); return (cc == APR_SUCCESS) ? len : -1; diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index 076fe93bc61..f2027f20471 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -65,7 +65,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) ULONG rc; if (thefile->direction == 1) { - apr_flush(thefile); + apr_file_flush(thefile); thefile->bufpos = thefile->direction = thefile->dataRead = 0; } @@ -85,7 +85,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) -apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) +apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { if (!thefile->isopen) { return APR_EBADF; @@ -105,7 +105,7 @@ apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *of break; case APR_END: - rc = apr_getfileinfo(&finfo, APR_FINFO_NORM, thefile); + rc = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size - *offset); break; diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 2e0f1501578..93bcc6165a7 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -95,8 +95,8 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont return errno; } else { - apr_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), dir_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } } @@ -106,7 +106,7 @@ apr_status_t apr_dir_close(apr_dir_t *thedir) apr_status_t rv; if ((rv = dir_cleanup(thedir)) == APR_SUCCESS) { - apr_kill_cleanup(thedir->cntxt, thedir, dir_cleanup); + apr_pool_cleanup_kill(thedir->cntxt, thedir, dir_cleanup); return APR_SUCCESS; } return rv; @@ -195,7 +195,7 @@ apr_status_t apr_dir_rewind(apr_dir_t *thedir) return APR_SUCCESS; } -apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) +apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { mode_t mode = apr_unix_perms2mode(perm); @@ -207,7 +207,7 @@ apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *co } } -apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) +apr_status_t apr_dir_remove(const char *path, apr_pool_t *cont) { if (rmdir(path) == 0) { return APR_SUCCESS; @@ -217,7 +217,7 @@ apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) } } -apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) +apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) { if (dir == NULL) { return APR_ENODIR; @@ -226,7 +226,7 @@ apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) return APR_SUCCESS; } -apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, +apr_status_t apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) { if ((*dir) == NULL) { diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 50496c4250a..1303beb3d58 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -57,7 +57,7 @@ /* A file to put ALL of the accessor functions for apr_file_t types. */ -APR_DECLARE(apr_status_t) apr_get_filename(const char **fname, +APR_DECLARE(apr_status_t) apr_file_name_get(const char **fname, apr_file_t *thefile) { *fname = thefile->fname; @@ -122,15 +122,15 @@ apr_fileperms_t apr_unix_mode2perms(mode_t mode) } #endif -APR_DECLARE(apr_status_t) apr_get_filedata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, apr_file_t *file) { - return apr_get_userdata(data, key, file->cntxt); + return apr_pool_userdata_get(data, key, file->cntxt); } -APR_DECLARE(apr_status_t) apr_set_filedata(apr_file_t *file, void *data, +APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)) { - return apr_set_userdata(data, key, cleanup, file->cntxt); + return apr_pool_userdata_set(data, key, cleanup, file->cntxt); } diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 06956fac5c6..7f0e94f2646 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -56,7 +56,7 @@ #include "apr_strings.h" #include "apr_portable.h" -apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) +apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { int have_file = 0; @@ -80,14 +80,14 @@ apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t (*new_file)->buffered = old_file->buffered; if ((*new_file)->buffered) { #if APR_HAS_THREADS - apr_create_lock(&((*new_file)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, + apr_lock_create(&((*new_file)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, p); #endif (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); } (*new_file)->blocking = old_file->blocking; /* this is the way dup() works */ - apr_register_cleanup((*new_file)->cntxt, (void *)(*new_file), apr_unix_file_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), apr_unix_file_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 0642d22ee8d..5c376b50f12 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -105,7 +105,7 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, */ } -apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, +apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) { struct stat info; @@ -121,7 +121,7 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, } } -apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) +apr_status_t apr_file_perms_set(const char *fname, apr_fileperms_t perms) { mode_t mode = apr_unix_perms2mode(perms); diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c index ecd7f7ae48a..fe2892fa0c9 100644 --- a/file_io/unix/flock.c +++ b/file_io/unix/flock.c @@ -61,7 +61,7 @@ #include <sys/file.h> #endif -apr_status_t apr_lock_file(apr_file_t *thefile, int type) +apr_status_t apr_file_lock(apr_file_t *thefile, int type) { int rc; @@ -112,7 +112,7 @@ apr_status_t apr_lock_file(apr_file_t *thefile, int type) return APR_SUCCESS; } -apr_status_t apr_unlock_file(apr_file_t *thefile) +apr_status_t apr_file_unlock(apr_file_t *thefile) { int rc; diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index 3d749ee92b3..d15ea150ba1 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -55,7 +55,7 @@ #include "apr_file_io.h" -APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, +APR_DECLARE(apr_status_t) apr_file_read_file(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read) { @@ -65,7 +65,7 @@ APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, do { apr_size_t amt = nbytes; - status = apr_read(thefile, buf, &amt); + status = apr_file_read(thefile, buf, &amt); buf = (char *)buf + amt; nbytes -= amt; total_read += amt; @@ -77,7 +77,7 @@ APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, return status; } -APR_DECLARE(apr_status_t) apr_full_write(apr_file_t *thefile, const void *buf, +APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written) { @@ -87,7 +87,7 @@ APR_DECLARE(apr_status_t) apr_full_write(apr_file_t *thefile, const void *buf, do { apr_size_t amt = nbytes; - status = apr_write(thefile, buf, &amt); + status = apr_file_write(thefile, buf, &amt); buf = (char *)buf + amt; nbytes -= amt; total_written += amt; diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 99de8a3724d..4082e59d94b 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -67,7 +67,7 @@ apr_status_t apr_unix_file_cleanup(void *thefile) file->filedes = -1; #if APR_HAS_THREADS if (file->thlock) { - return apr_destroy_lock(file->thlock); + return apr_lock_destroy(file->thlock); } #endif return APR_SUCCESS; @@ -78,7 +78,7 @@ apr_status_t apr_unix_file_cleanup(void *thefile) } } -apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) +apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) { int oflags = 0; #if APR_HAS_THREADS @@ -111,7 +111,7 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, ap if ((*new)->buffered) { (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); #if APR_HAS_THREADS - rv = apr_create_lock(&((*new)->thlock), APR_MUTEX, APR_INTRAPROCESS, + rv = apr_lock_create(&((*new)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, cont); if (rv) { return rv; @@ -163,27 +163,27 @@ apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, ap (*new)->bufpos = 0; (*new)->dataRead = 0; (*new)->direction = 0; - apr_register_cleanup((*new)->cntxt, (void *)(*new), apr_unix_file_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), apr_unix_file_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } -apr_status_t apr_close(apr_file_t *file) +apr_status_t apr_file_close(apr_file_t *file) { apr_status_t flush_rv = APR_SUCCESS, rv; if (file->buffered) { - flush_rv = apr_flush(file); + flush_rv = apr_file_flush(file); } if ((rv = apr_unix_file_cleanup(file)) == APR_SUCCESS) { - apr_kill_cleanup(file->cntxt, file, apr_unix_file_cleanup); + apr_pool_cleanup_kill(file->cntxt, file, apr_unix_file_cleanup); return APR_SUCCESS; } return rv ? rv : flush_rv; } -apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) +apr_status_t apr_file_remove(const char *path, apr_pool_t *cont) { if (unlink(path) == 0) { return APR_SUCCESS; @@ -193,7 +193,7 @@ apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) } } -apr_status_t apr_rename_file(const char *from_path, const char *to_path, +apr_status_t apr_file_rename(const char *from_path, const char *to_path, apr_pool_t *p) { if (rename(from_path, to_path) != 0) { @@ -202,7 +202,7 @@ apr_status_t apr_rename_file(const char *from_path, const char *to_path, return APR_SUCCESS; } -apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) +apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) { if (file == NULL) { return APR_ENOFILE; @@ -212,7 +212,7 @@ apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) return APR_SUCCESS; } -apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, +apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) { int *dafile = thefile; @@ -231,7 +231,7 @@ apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, return APR_SUCCESS; } -apr_status_t apr_eof(apr_file_t *fptr) +apr_status_t apr_file_eof(apr_file_t *fptr) { if (fptr->eof_hit == 1) { return APR_EOF; @@ -239,7 +239,7 @@ apr_status_t apr_eof(apr_file_t *fptr) return APR_SUCCESS; } -apr_status_t apr_ferror(apr_file_t *fptr) +apr_status_t apr_file_error(apr_file_t *fptr) { /* This function should be removed ASAP. It is next on my list once * I am sure nobody is using it. @@ -247,18 +247,18 @@ apr_status_t apr_ferror(apr_file_t *fptr) return APR_SUCCESS; } -apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) +apr_status_t apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { int fd = STDERR_FILENO; - return apr_put_os_file(thefile, &fd, cont); + return apr_os_file_put(thefile, &fd, cont); } -apr_status_t apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont) +apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) { int fd = STDOUT_FILENO; - return apr_put_os_file(thefile, &fd, cont); + return apr_os_file_put(thefile, &fd, cont); } APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index f5bf550fd2f..c9405abea0b 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -126,7 +126,7 @@ static apr_status_t pipenonblock(apr_file_t *thepipe) return APR_SUCCESS; } -apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) +apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; @@ -145,7 +145,7 @@ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeo return APR_EINVAL; } -apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) +apr_status_t apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) { if (thepipe->pipe == 1) { *timeout = thepipe->timeout; @@ -154,7 +154,7 @@ apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *time return APR_EINVAL; } -apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) +apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) { int filedes[2]; @@ -187,14 +187,14 @@ apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont (*in)->thlock = NULL; #endif - apr_register_cleanup((*in)->cntxt, (void *)(*in), apr_unix_file_cleanup, - apr_null_cleanup); - apr_register_cleanup((*out)->cntxt, (void *)(*out), apr_unix_file_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), apr_unix_file_cleanup, + apr_pool_cleanup_null); + apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), apr_unix_file_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } -apr_status_t apr_create_namedpipe(const char *filename, +apr_status_t apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) { mode_t mode = apr_unix_perms2mode(perm); diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 57a950d2513..0f32e70441f 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -101,7 +101,7 @@ static apr_status_t wait_for_io_or_timeout(apr_file_t *file, int for_read) /* problems: * 1) ungetchar not used for buffered files */ -apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) +apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) { apr_ssize_t rv; apr_size_t bytes_read; @@ -117,11 +117,11 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) apr_uint64_t size = *nbytes; #if APR_HAS_THREADS - apr_lock(thefile->thlock); + apr_lock_aquire(thefile->thlock); #endif if (thefile->direction == 1) { - apr_flush(thefile); + apr_file_flush(thefile); thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -156,7 +156,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) rv = 0; } #if APR_HAS_THREADS - apr_unlock(thefile->thlock); + apr_lock_release(thefile->thlock); #endif return rv; } @@ -205,7 +205,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) } } -apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) +apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { apr_size_t rv; @@ -215,7 +215,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) int size = *nbytes; #if APR_HAS_THREADS - apr_lock(thefile->thlock); + apr_lock_aquire(thefile->thlock); #endif if ( thefile->direction == 0 ) { @@ -232,7 +232,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) /* write buffer is full*/ - apr_flush(thefile); + apr_file_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; @@ -243,7 +243,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) } #if APR_HAS_THREADS - apr_unlock(thefile->thlock); + apr_lock_release(thefile->thlock); #endif return rv; } @@ -276,7 +276,7 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) } } -apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, +apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { #ifdef HAVE_WRITEV @@ -292,38 +292,38 @@ apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, } #else *nbytes = vec[0].iov_len; - return apr_write(thefile, vec[0].iov_base, nbytes); + return apr_file_write(thefile, vec[0].iov_base, nbytes); #endif } -apr_status_t apr_putc(char ch, apr_file_t *thefile) +apr_status_t apr_file_putc(char ch, apr_file_t *thefile) { apr_size_t nbytes = 1; - return apr_write(thefile, &ch, &nbytes); + return apr_file_write(thefile, &ch, &nbytes); } -apr_status_t apr_ungetc(char ch, apr_file_t *thefile) +apr_status_t apr_file_ungetc(char ch, apr_file_t *thefile) { thefile->ungetchar = (unsigned char)ch; return APR_SUCCESS; } -apr_status_t apr_getc(char *ch, apr_file_t *thefile) +apr_status_t apr_file_getc(char *ch, apr_file_t *thefile) { apr_size_t nbytes = 1; - return apr_read(thefile, ch, &nbytes); + return apr_file_read(thefile, ch, &nbytes); } -apr_status_t apr_puts(const char *str, apr_file_t *thefile) +apr_status_t apr_file_puts(const char *str, apr_file_t *thefile) { apr_size_t nbytes = strlen(str); - return apr_write(thefile, str, &nbytes); + return apr_file_write(thefile, str, &nbytes); } -apr_status_t apr_flush(apr_file_t *thefile) +apr_status_t apr_file_flush(apr_file_t *thefile) { if (thefile->buffered) { apr_int64_t written = 0; @@ -345,7 +345,7 @@ apr_status_t apr_flush(apr_file_t *thefile) return APR_SUCCESS; } -apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) +apr_status_t apr_file_gets(char *str, int len, apr_file_t *thefile) { apr_status_t rv = APR_SUCCESS; /* get rid of gcc warning */ apr_size_t nbytes; @@ -359,7 +359,7 @@ apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) while (str < final) { /* leave room for trailing '\0' */ nbytes = 1; - rv = apr_read(thefile, str, &nbytes); + rv = apr_file_read(thefile, str, &nbytes); if (rv != APR_SUCCESS) { break; } @@ -376,7 +376,7 @@ apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) return rv; } -APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) { apr_status_t cc; va_list ap; @@ -389,7 +389,7 @@ APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) } va_start(ap, format); len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = apr_puts(buf, fptr); + cc = apr_file_puts(buf, fptr); va_end(ap); free(buf); return (cc == APR_SUCCESS) ? len : -1; diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index f8928435801..459704279e7 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -60,7 +60,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) int rc; if (thefile->direction == 1) { - apr_flush(thefile); + apr_file_flush(thefile); thefile->bufpos = thefile->direction = thefile->dataRead = 0; } @@ -85,7 +85,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) } -apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) +apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { apr_off_t rv; @@ -104,7 +104,7 @@ apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *of break; case APR_END: - rc = apr_getfileinfo(&finfo, APR_FINFO_SIZE, thefile); + rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size - *offset); break; diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 64124121ad2..902a2659e06 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -128,8 +128,8 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, (*new)->rootlen = len - 1; (*new)->cntxt = cont; (*new)->dirhand = INVALID_HANDLE_VALUE; - apr_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), dir_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } @@ -261,7 +261,7 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *dir) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm, +APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS @@ -286,7 +286,7 @@ APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; @@ -310,7 +310,7 @@ APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_os_dir(apr_os_dir_t **thedir, +APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) { if (dir == NULL) { @@ -320,7 +320,7 @@ APR_DECLARE(apr_status_t) apr_get_os_dir(apr_os_dir_t **thedir, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_dir(apr_dir_t **dir, +APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) { diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 495b5854834..b4a865dbf5a 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -58,7 +58,7 @@ #include "apr_strings.h" #include <string.h> -APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file, +APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { BOOLEAN isStdHandle = FALSE; @@ -109,8 +109,8 @@ APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file, (*new_file)->buffered = FALSE; if (!isStdHandle) { - apr_register_cleanup((*new_file)->cntxt, (void *)(*new_file), file_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), file_cleanup, + apr_pool_cleanup_null); } return APR_SUCCESS; diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 335c56c5f89..f784db65237 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -154,28 +154,28 @@ static int resolve_ident(apr_finfo_t *finfo, const char *fname, * user, group or permissions. */ - if ((rv = apr_open(&thefile, fname, + if ((rv = apr_file_open(&thefile, fname, ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0) | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) ? APR_READCONTROL : 0), APR_OS_DEFAULT, cont)) == APR_SUCCESS) { - rv = apr_getfileinfo(finfo, wanted, thefile); + rv = apr_file_info_get(finfo, wanted, thefile); finfo->filehand = NULL; - apr_close(thefile); + apr_file_close(thefile); } else if (APR_STATUS_IS_EACCES(rv) && (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER))) { /* We have a backup plan. Perhaps we couldn't grab READ_CONTROL? * proceed without asking for that permission... */ - if ((rv = apr_open(&thefile, fname, + if ((rv = apr_file_open(&thefile, fname, ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0), APR_OS_DEFAULT, cont)) == APR_SUCCESS) { - rv = apr_getfileinfo(finfo, wanted & ~(APR_FINFO_PROT + rv = apr_file_info_get(finfo, wanted & ~(APR_FINFO_PROT | APR_FINFO_OWNER), thefile); finfo->filehand = NULL; - apr_close(thefile); + apr_file_close(thefile); } } if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) @@ -246,8 +246,8 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, apr_int32_t wante ((wanted & APR_FINFO_PROT) ? &dacl : NULL), NULL, &pdesc); if (rv == ERROR_SUCCESS) - apr_register_cleanup(finfo->cntxt, pdesc, free_localheap, - apr_null_cleanup); + apr_pool_cleanup_register(finfo->cntxt, pdesc, free_localheap, + apr_pool_cleanup_null); else user = grp = dacl = NULL; @@ -322,7 +322,7 @@ void fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, } -APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, +APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) { BY_HANDLE_FILE_INFORMATION FileInfo; @@ -374,7 +374,7 @@ APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname, +APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, apr_fileperms_t perms) { return APR_ENOTIMPL; diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index 18d00b32273..6a54fcb07f1 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -54,7 +54,7 @@ #include "fileio.h" -APR_DECLARE(apr_status_t) apr_lock_file(apr_file_t *thefile, int type) +APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) { OVERLAPPED offset; DWORD flags, len = 0xffffffff; @@ -70,7 +70,7 @@ APR_DECLARE(apr_status_t) apr_lock_file(apr_file_t *thefile, int type) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_unlock_file(apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) { OVERLAPPED offset; DWORD len = 0xffffffff; diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 33a4873e2c8..03a9e01676b 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -164,7 +164,7 @@ apr_status_t file_cleanup(void *thefile) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_open(apr_file_t **new, const char *fname, +APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) { @@ -266,11 +266,11 @@ APR_DECLARE(apr_status_t) apr_open(apr_file_t **new, const char *fname, if (flag & APR_BUFFERED) { (*new)->buffered = 1; (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); - rv = apr_create_lock(&(*new)->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cont); + rv = apr_lock_create(&(*new)->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cont); if (rv) { if (file_cleanup(*new) == APR_SUCCESS) { - apr_kill_cleanup(cont, *new, file_cleanup); + apr_pool_cleanup_kill(cont, *new, file_cleanup); } return rv; } @@ -292,26 +292,26 @@ APR_DECLARE(apr_status_t) apr_open(apr_file_t **new, const char *fname, (*new)->direction = 0; (*new)->filePtr = 0; - apr_register_cleanup((*new)->cntxt, (void *)(*new), file_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), file_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_close(apr_file_t *file) +APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) { apr_status_t stat; if ((stat = file_cleanup(file)) == APR_SUCCESS) { - apr_kill_cleanup(file->cntxt, file, file_cleanup); + apr_pool_cleanup_kill(file->cntxt, file, file_cleanup); if (file->buffered) - apr_destroy_lock(file->mutex); + apr_lock_destroy(file->mutex); return APR_SUCCESS; } return stat; } -APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; @@ -333,7 +333,7 @@ APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont) return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_rename_file(const char *frompath, +APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, const char *topath, apr_pool_t *cont) { @@ -383,7 +383,7 @@ APR_DECLARE(apr_status_t) apr_rename_file(const char *frompath, return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_get_os_file(apr_os_file_t *thefile, +APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) { if (file == NULL) { @@ -393,7 +393,7 @@ APR_DECLARE(apr_status_t) apr_get_os_file(apr_os_file_t *thefile, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_file(apr_file_t **file, +APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) { @@ -404,7 +404,7 @@ APR_DECLARE(apr_status_t) apr_put_os_file(apr_file_t **file, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_eof(apr_file_t *fptr) +APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) { if (fptr->eof_hit == 1) { return APR_EOF; @@ -412,7 +412,7 @@ APR_DECLARE(apr_status_t) apr_eof(apr_file_t *fptr) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { apr_os_file_t file_handle; @@ -420,10 +420,10 @@ APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont if (file_handle == INVALID_HANDLE_VALUE) return apr_get_os_error(); - return apr_put_os_file(thefile, &file_handle, cont); + return apr_os_file_put(thefile, &file_handle, cont); } -APR_DECLARE(apr_status_t) apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) { apr_os_file_t file_handle; @@ -431,7 +431,7 @@ APR_DECLARE(apr_status_t) apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont if (file_handle == INVALID_HANDLE_VALUE) return apr_get_os_error(); - return apr_put_os_file(thefile, &file_handle, cont); + return apr_os_file_put(thefile, &file_handle, cont); } APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 40a8c6c3e0e..4f4732d62e7 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -63,7 +63,7 @@ #include <sys/stat.h> #include "misc.h" -APR_DECLARE(apr_status_t) apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; @@ -72,7 +72,7 @@ APR_DECLARE(apr_status_t) apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval return APR_EINVAL; } -APR_DECLARE(apr_status_t) apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) { if (thepipe->pipe == 1) { *timeout = thepipe->timeout; @@ -81,7 +81,7 @@ APR_DECLARE(apr_status_t) apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval return APR_EINVAL; } -APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *p) { SECURITY_ATTRIBUTES sa; @@ -117,15 +117,15 @@ APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, apr return apr_get_os_error(); } - apr_register_cleanup((*in)->cntxt, (void *)(*in), file_cleanup, - apr_null_cleanup); - apr_register_cleanup((*out)->cntxt, (void *)(*out), file_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), file_cleanup, + apr_pool_cleanup_null); + apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), file_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } /* apr_create_nt_pipe() - * An internal (for now) APR function created for use by apr_create_process() + * An internal (for now) APR function created for use by apr_proc_create() * when setting up pipes to communicate with the child process. * apr_create_nt_pipe() allows setting the blocking mode of each end of * the pipe when the pipe is created (rather than after the pipe is created). @@ -134,7 +134,7 @@ APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, apr * * In general, we don't want to enable child side pipe handles for async i/o. * This prevents us from enabling both ends of the pipe for async i/o in - * apr_create_pipe. + * apr_file_pipe_create. * * Why not use NamedPipes on NT which support setting pipe state to * non-blocking? On NT, even though you can set a pipe non-blocking, diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 48429bd55c0..bd8739b4942 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -148,7 +148,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le return rv; } -APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *len) { apr_size_t rv; DWORD bytes_read = 0; @@ -175,10 +175,10 @@ APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, apr_size_t *l apr_size_t blocksize; apr_size_t size = *len; - apr_lock(thefile->mutex); + apr_lock_aquire(thefile->mutex); if (thefile->direction == 1) { - apr_flush(thefile); + apr_file_flush(thefile); thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -210,7 +210,7 @@ APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, apr_size_t *l if (*len) { rv = 0; } - apr_unlock(thefile->mutex); + apr_lock_release(thefile->mutex); } else { /* Unbuffered i/o */ apr_size_t nbytes; @@ -221,7 +221,7 @@ APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, apr_size_t *l return rv; } -APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) +APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { apr_status_t rv; DWORD bwrote; @@ -231,7 +231,7 @@ APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, apr_si int blocksize; int size = *nbytes; - apr_lock(thefile->mutex); + apr_lock_aquire(thefile->mutex); if (thefile->direction == 0) { // Position file pointer for writing at the offset we are logically reading from @@ -245,7 +245,7 @@ APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, apr_si rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full - rv = apr_flush(thefile); + rv = apr_file_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); @@ -254,7 +254,7 @@ APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, apr_si size -= blocksize; } - apr_unlock(thefile->mutex); + apr_lock_release(thefile->mutex); return rv; } else { if (!thefile->pipe && thefile->append) { @@ -275,7 +275,7 @@ APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, apr_si /* * Too bad WriteFileGather() is not supported on 95&98 (or NT prior to SP2) */ -APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, +APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) @@ -289,7 +289,7 @@ APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, for (i = 0; i < nvec; i++) { buf = vec[i].iov_base; bwrote = vec[i].iov_len; - rv = apr_write(thefile, buf, &bwrote); + rv = apr_file_write(thefile, buf, &bwrote); *nbytes += bwrote; if (rv != APR_SUCCESS) { break; @@ -298,26 +298,26 @@ APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, return rv; } -APR_DECLARE(apr_status_t) apr_putc(char ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile) { DWORD len = 1; - return apr_write(thefile, &ch, &len); + return apr_file_write(thefile, &ch, &len); } -APR_DECLARE(apr_status_t) apr_ungetc(char ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile) { thefile->ungetchar = (unsigned char) ch; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_getc(char *ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile) { apr_status_t rc; int bread; bread = 1; - rc = apr_read(thefile, ch, &bread); + rc = apr_file_read(thefile, ch, &bread); if (rc) { return rc; @@ -330,14 +330,14 @@ APR_DECLARE(apr_status_t) apr_getc(char *ch, apr_file_t *thefile) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_puts(const char *str, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile) { DWORD len = strlen(str); - return apr_write(thefile, str, &len); + return apr_file_write(thefile, str, &len); } -APR_DECLARE(apr_status_t) apr_fgets(char *str, int len, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) { apr_size_t readlen; apr_status_t rv = APR_SUCCESS; @@ -345,7 +345,7 @@ APR_DECLARE(apr_status_t) apr_fgets(char *str, int len, apr_file_t *thefile) for (i = 0; i < len-1; i++) { readlen = 1; - rv = apr_read(thefile, str+i, &readlen); + rv = apr_file_read(thefile, str+i, &readlen); if (readlen != 1) { rv = APR_EOF; @@ -363,7 +363,7 @@ APR_DECLARE(apr_status_t) apr_fgets(char *str, int len, apr_file_t *thefile) return rv; } -APR_DECLARE(apr_status_t) apr_flush(apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) { if (thefile->buffered) { DWORD written = 0; @@ -393,7 +393,7 @@ static int printf_flush(apr_vformatter_buff_t *vbuff) return -1; } -APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) { int cc; va_list ap; @@ -406,7 +406,7 @@ APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) } va_start(ap, format); len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = apr_puts(buf, fptr); + cc = apr_file_puts(buf, fptr); va_end(ap); free(buf); return (cc == APR_SUCCESS) ? len : -1; diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 1e102739c06..69e0ff03140 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -63,7 +63,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) DWORD rc; if (thefile->direction == 1) { - apr_flush(thefile); + apr_file_flush(thefile); thefile->bufpos = thefile->direction = thefile->dataRead = 0; } @@ -86,7 +86,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) -APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) +APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { DWORD howmove; DWORD rv; @@ -105,7 +105,7 @@ APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile, apr_seek_where_t where, break; case APR_END: - rc = apr_getfileinfo(&finfo, APR_FINFO_SIZE, thefile); + rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); if (rc == APR_SUCCESS && (finfo.valid & APR_FINFO_SIZE)) rc = setptr(thefile, finfo.size - *offset); break; diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 3ae49c59ebc..f9c703430da 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -264,8 +264,8 @@ apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, if (found) { *convset = new; - apr_register_cleanup(pool, (void *)new, apr_xlate_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register(pool, (void *)new, apr_xlate_cleanup, + apr_pool_cleanup_null); status = APR_SUCCESS; } else { @@ -360,7 +360,7 @@ apr_status_t apr_xlate_close(apr_xlate_t *convset) apr_status_t status; if ((status = apr_xlate_cleanup(convset)) == APR_SUCCESS) { - apr_kill_cleanup(convset->pool, convset, apr_xlate_cleanup); + apr_pool_cleanup_kill(convset->pool, convset, apr_xlate_cleanup); } return status; diff --git a/include/apr_compat.h b/include/apr_compat.h index c9d1dd76b8e..d33d50a5351 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -6,48 +6,48 @@ #define ap_inline apr_inline #define ap_md5_ctx_t apr_md5_ctx_t -#define ap_MD5Encode apr_MD5Encode -#define ap_MD5Final apr_MD5Final -#define ap_MD5Init apr_MD5Init -#define ap_MD5Update apr_MD5Update -#define ap_append_arrays apr_append_arrays +#define ap_MD5Encode apr_md5_encode +#define ap_MD5Final apr_md5_final +#define ap_MD5Init apr_md5_init +#define ap_MD5Update apr_md5_update +#define ap_append_arrays apr_array_append #define ap_array_cat apr_array_cat #define ap_array_header_t apr_array_header_t #define ap_array_pstrcat apr_array_pstrcat -#define ap_bytes_in_free_blocks apr_bytes_in_free_blocks -#define ap_bytes_in_pool apr_bytes_in_pool +#define ap_bytes_in_free_blocks apr_pool_free_blocks_num_bytes +#define ap_bytes_in_pool apr_pool_num_bytes #define ap_check_file_time apr_check_file_time #define ap_filetype_e apr_filetype_e -#define ap_cleanup_for_exec apr_cleanup_for_exec +#define ap_cleanup_for_exec apr_pool_cleanup_for_exec #define ap_clear_pool apr_clear_pool -#define ap_clear_table apr_clear_table -#define ap_copy_array apr_copy_array -#define ap_copy_array_hdr apr_copy_array_hdr -#define ap_copy_table apr_copy_table +#define ap_clear_table apr_table_clear +#define ap_copy_array apr_array_copy +#define ap_copy_array_hdr apr_array_copy_hdr +#define ap_copy_table apr_table_copy #define ap_cpystrn apr_cpystrn #define ap_day_snames apr_day_snames -#define ap_destroy_pool apr_destroy_pool +#define ap_destroy_pool apr_pool_destroy #define ap_exploded_time_t apr_exploded_time_t #define ap_fnmatch apr_fnmatch #define ap_getopt apr_getopt #define ap_inet_addr apr_inet_addr -#define ap_init_alloc apr_init_alloc +#define ap_init_alloc apr_pool_alloc_init #define ap_is_empty_table apr_is_empty_table #define ap_is_fnmatch apr_is_fnmatch -#define ap_kill_cleanup apr_kill_cleanup -#define ap_make_array apr_make_array -#define ap_make_sub_pool apr_make_sub_pool -#define ap_make_table apr_make_table +#define ap_kill_cleanup apr_pool_cleanup_kill +#define ap_make_array apr_array_make +#define ap_make_sub_pool apr_pool_sub_make +#define ap_make_table apr_table_make #define ap_month_snames apr_month_snames -#define ap_note_subprocess apr_note_subprocess -#define ap_null_cleanup apr_null_cleanup +#define ap_note_subprocess apr_pool_note_subprocess +#define ap_null_cleanup apr_pool_cleanup_null #define ap_os_dso_load apr_dso_load #define ap_os_dso_unload apr_dso_unload #define ap_os_dso_sym apr_dso_sym #define ap_os_dso_error apr_dso_error -#define ap_os_kill apr_kill -#define ap_overlap_tables apr_overlap_tables -#define ap_overlay_tables apr_overlay_tables +#define ap_os_kill apr_proc_kill +#define ap_overlap_tables apr_table_overlap +#define ap_overlay_tables apr_table_overlay #define ap_palloc apr_palloc #define ap_pcalloc apr_pcalloc #define ap_pool_join apr_pool_join @@ -55,11 +55,11 @@ #define ap_pstrcat apr_pstrcat #define ap_pstrdup apr_pstrdup #define ap_pstrndup apr_pstrndup -#define ap_push_array apr_push_array +#define ap_push_array apr_array_push #define ap_pvsprintf apr_pvsprintf -#define ap_register_cleanup apr_register_cleanup -#define ap_register_other_child apr_register_other_child -#define ap_run_cleanup apr_run_cleanup +#define ap_register_cleanup apr_pool_cleanup_register +#define ap_register_other_child apr_proc_other_child_register +#define ap_run_cleanup apr_pool_cleanup_run #define ap_signal apr_signal #define ap_snprintf apr_snprintf #define ap_table_add apr_table_add @@ -72,8 +72,8 @@ #define ap_table_set apr_table_set #define ap_table_setn apr_table_setn #define ap_table_unset apr_table_unset -#define ap_unregister_other_child apr_unregister_other_child -#define ap_validate_password apr_validate_password +#define ap_unregister_other_child apr_proc_other_child_unregister +#define ap_validate_password apr_password_validate #define ap_vformatter apr_vformatter #define ap_vsnprintf apr_vsnprintf #define ap_wait_t apr_wait_t diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 4cc02140dbd..5d864ca9bf7 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -73,7 +73,7 @@ extern "C" { * @package APR File handling */ -/* Flags for apr_open */ +/* Flags for apr_file_open */ #define APR_READ 1 /* Open the file for reading */ #define APR_WRITE 2 /* Open the file for writing */ #define APR_CREATE 4 /* Create the file if not there */ @@ -87,7 +87,7 @@ extern "C" { #define APR_XTHREAD 512 /* Platform dependent tag to open the file for use across multiple threads */ -/* flags for apr_seek */ +/* flags for apr_file_seek */ #define APR_SET SEEK_SET #define APR_CUR SEEK_CUR #define APR_END SEEK_END @@ -136,30 +136,30 @@ typedef struct apr_file_t apr_file_t; * </PRE> * @param perm Access permissions for file. * @param cont The pool to use. - * @deffunc apr_status_t apr_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) + * @deffunc apr_status_t apr_file_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) * @tip If perm is APR_OS_DEFAULT and the file is being created, appropriate * default permissions will be used. *arg1 must point to a valid file_t, * or NULL (in which case it will be allocated) */ -APR_DECLARE(apr_status_t) apr_open(apr_file_t **new_file, const char *fname, +APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont); /** * Close the specified file. * @param file The file descriptor to close. - * @deffunc apr_status_t apr_close(apr_file_t *file) + * @deffunc apr_status_t apr_file_close(apr_file_t *file) */ -APR_DECLARE(apr_status_t) apr_close(apr_file_t *file); +APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file); /** * delete the specified file. * @param path The full path to the file (using / on all systems) * @param cont The pool to use. - * @deffunc apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) + * @deffunc apr_status_t apr_file_remove(const char *path, apr_pool_t *cont) * @tip If the file is open, it won't be removed until all instances are closed. */ -APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont); /** * rename the specified file. @@ -168,9 +168,9 @@ APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont); * @param pool The pool to use. * @tip If a file exists at the new location, then it will be overwritten. * Moving files or directories across devices may not be possible. - * @deffunc apr_status_t apr_rename_file(const char *from_path, const char *to_path, apr_pool_t *pool) + * @deffunc apr_status_t apr_file_rename(const char *from_path, const char *to_path, apr_pool_t *pool) */ -APR_DECLARE(apr_status_t) apr_rename_file(const char *from_path, +APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_path, apr_pool_t *pool); @@ -178,34 +178,34 @@ APR_DECLARE(apr_status_t) apr_rename_file(const char *from_path, * Are we at the end of the file * @param fptr The apr file we are testing. * @tip Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise. - * @deffunc apr_status_t apr_eof(apr_file_t *fptr) + * @deffunc apr_status_t apr_file_eof(apr_file_t *fptr) */ -APR_DECLARE(apr_status_t) apr_eof(apr_file_t *fptr); +APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); /** * Is there an error on the stream? * @param fptr The apr file we are testing. * @tip Returns -1 if the error indicator is set, APR_SUCCESS otherwise. - * @deffunc apr_status_t apr_ferror(apr_file_t *fptr) + * @deffunc apr_status_t apr_file_error(apr_file_t *fptr) */ -APR_DECLARE(apr_status_t) apr_ferror(apr_file_t *fptr); +APR_DECLARE(apr_status_t) apr_file_error(apr_file_t *fptr); /** * open standard error as an apr file pointer. * @param thefile The apr file to use as stderr. * @param cont The pool to allocate the file out of. - * @deffunc apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) + * @deffunc apr_status_t apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, +APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont); /** * open standard output as an apr file pointer. * @param thefile The apr file to use as stdout. * @param cont The pool to allocate the file out of. - * @deffunc apr_status_t apr_open_stdout(apr_file_t **thefile, apr_pool_t *cont) + * @deffunc apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_open_stdout(apr_file_t **thefile, +APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont); /** @@ -213,7 +213,7 @@ APR_DECLARE(apr_status_t) apr_open_stdout(apr_file_t **thefile, * @param thefile The file descriptor to read from. * @param buf The buffer to store the data to. * @param nbytes On entry, the number of bytes to read; on exit, the number of bytes read. - * @tip apr_read will read up to the specified number of bytes, but never + * @tip apr_file_read will read up to the specified number of bytes, but never * more. If there isn't enough data to fill that number of bytes, all * of the available data is read. The third argument is modified to * reflect the number of bytes read. If a char was put back into the @@ -223,9 +223,9 @@ APR_DECLARE(apr_status_t) apr_open_stdout(apr_file_t **thefile, * error to be returned. * * APR_EINTR is never returned. - * @deffunc apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) + * @deffunc apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) */ -APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, +APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes); /** @@ -234,7 +234,7 @@ APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, * @param buf The buffer which contains the data. * @param nbytes On entry, the number of bytes to write; on exit, the number * of bytes written. - * @tip apr_write will write up to the specified number of bytes, but never + * @tip apr_file_write will write up to the specified number of bytes, but never * more. If the OS cannot write that many bytes, it will write as many * as it can. The third argument is modified to reflect the * number * of bytes written. @@ -242,9 +242,9 @@ APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, * It is possible for both bytes to be written and an error to be returned. * * APR_EINTR is never returned. - * @deffunc apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) + * @deffunc apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) */ -APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, +APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes); /** @@ -258,12 +258,12 @@ APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, * @tip It is possible for both bytes to be written and an error to be returned. * APR_EINTR is never returned. * - * apr_writev is available even if the underlying operating system + * apr_file_writev is available even if the underlying operating system * * doesn't provide writev(). - * @deffunc apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) + * @deffunc apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) */ -APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, +APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes); @@ -274,7 +274,7 @@ APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, * @param buf The buffer to store the data to. * @param nbytes The number of bytes to read. * @param bytes_read If non-NULL, this will contain the number of bytes read. - * @tip apr_read will read up to the specified number of bytes, but never + * @tip apr_file_read will read up to the specified number of bytes, but never * more. If there isn't enough data to fill that number of bytes, * then the process/thread will block until it is available or EOF * is reached. If a char was put back into the stream via ungetc, @@ -284,9 +284,9 @@ APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, * error to be returned. * * APR_EINTR is never returned. - * @deffunc apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read) + * @deffunc apr_status_t apr_file_read_file(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read) */ -APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, +APR_DECLARE(apr_status_t) apr_file_read_file(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read); @@ -297,7 +297,7 @@ APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, * @param buf The buffer which contains the data. * @param nbytes The number of bytes to write. * @param bytes_written If non-NULL, this will contain the number of bytes written. - * @tip apr_write will write up to the specified number of bytes, but never + * @tip apr_file_write will write up to the specified number of bytes, but never * more. If the OS cannot write that many bytes, the process/thread * will block until they can be written. Exceptional error such as * "out of space" or "pipe closed" will terminate with an error. @@ -305,9 +305,9 @@ APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, * It is possible for both bytes to be written and an error to be returned. * * APR_EINTR is never returned. - * @deffunc apr_status_t apr_full_write(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written) + * @deffunc apr_status_t apr_file_write_full(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written) */ -APR_DECLARE(apr_status_t) apr_full_write(apr_file_t *thefile, const void *buf, +APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written); @@ -315,49 +315,49 @@ APR_DECLARE(apr_status_t) apr_full_write(apr_file_t *thefile, const void *buf, * put a character into the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to - * @deffunc apr_status_t apr_putc(char ch, apr_file_t *thefile) + * @deffunc apr_status_t apr_file_putc(char ch, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_putc(char ch, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile); /** * get a character from the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to - * @deffunc apr_status_t apr_getc(char *ch, apr_file_t *thefile) + * @deffunc apr_status_t apr_file_getc(char *ch, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_getc(char *ch, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile); /** * put a character back onto a specified stream. * @param ch The character to write. * @param thefile The file descriptor to write to - * @deffunc apr_status_t apr_ungetc(char ch, apr_file_t *thefile) + * @deffunc apr_status_t apr_file_ungetc(char ch, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_ungetc(char ch, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile); /** * Get a string from a specified file. * @param str The buffer to store the string in. * @param len The length of the string * @param thefile The file descriptor to read from - * @deffunc apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) + * @deffunc apr_status_t apr_file_gets(char *str, int len, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_fgets(char *str, int len, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile); /** * Put the string into a specified file. * @param str The string to write. * @param thefile The file descriptor to write to - * @deffunc apr_status_t apr_puts(const char *str, apr_file_t *thefile) + * @deffunc apr_status_t apr_file_puts(const char *str, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_puts(const char *str, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile); /** * Flush the file's buffer. * @param thefile The file descriptor to flush - * @deffunc apr_status_t apr_flush(apr_file_t *thefile) + * @deffunc apr_status_t apr_file_flush(apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_flush(apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile); /** * duplicate the specified file descriptor. @@ -365,9 +365,9 @@ APR_DECLARE(apr_status_t) apr_flush(apr_file_t *thefile); * @param old_file The file to duplicate. * @param p The pool to use for the new file. * @tip *arg1 must point to a valid apr_file_t, or point to NULL - * @deffunc apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) + * @deffunc apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) */ -APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file, +APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p); @@ -382,9 +382,9 @@ APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file, * @param offset The offset to move the pointer to. * @tip The third argument is modified to be the offset the pointer was actually moved to. - * @deffunc apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) + * @deffunc apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) */ -APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile, +APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset); @@ -393,9 +393,9 @@ APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile, * @param in The file descriptor to use as input to the pipe. * @param out The file descriptor to use as output from the pipe. * @param cont The pool to operate on. - * @deffunc apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) + * @deffunc apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont); /** @@ -403,9 +403,9 @@ APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, * @param filename The filename of the named pipe * @param perm The permissions for the newly created pipe. * @param cont The pool to operate on. - * @deffunc apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) + * @deffunc apr_status_t apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_namedpipe(const char *filename, +APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont); @@ -413,9 +413,9 @@ APR_DECLARE(apr_status_t) apr_create_namedpipe(const char *filename, * Get the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are getting a timeout for. * @param timeout The current timeout value in microseconds. - * @deffunc apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) + * @deffunc apr_status_t apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) */ -APR_DECLARE(apr_status_t) apr_get_pipe_timeout(apr_file_t *thepipe, +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout); /** @@ -423,9 +423,9 @@ APR_DECLARE(apr_status_t) apr_get_pipe_timeout(apr_file_t *thepipe, * @param thepipe The pipe we are setting a timeout on. * @param timeout The timeout value in microseconds. Values < 0 mean wait * forever, 0 means do not wait at all. - * @deffunc apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) + * @deffunc apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) */ -APR_DECLARE(apr_status_t) apr_set_pipe_timeout(apr_file_t *thepipe, +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout); /** file (un)locking functions. */ @@ -438,16 +438,16 @@ APR_DECLARE(apr_status_t) apr_set_pipe_timeout(apr_file_t *thepipe, * block. * @param thefile The file to lock. * @param type The type of lock to establish on the file. - * @deffunc apr_status_t apr_lock_file(apr_file_t *thefile, int type) + * @deffunc apr_status_t apr_file_lock(apr_file_t *thefile, int type) */ -APR_DECLARE(apr_status_t) apr_lock_file(apr_file_t *thefile, int type); +APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type); /** * Remove any outstanding locks on the file. * @param thefile The file to unlock. - * @deffunc apr_status_t apr_unlock_file(apr_file_t *thefile) + * @deffunc apr_status_t apr_file_unlock(apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_unlock_file(apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile); /**accessor and general file_io functions. */ @@ -455,9 +455,9 @@ APR_DECLARE(apr_status_t) apr_unlock_file(apr_file_t *thefile); * return the file name of the current file. * @param new_path The path of the file. * @param thefile The currently open file. - * @deffunc apr_status_t apr_get_filename(const char **new_path, apr_file_t *thefile) + * @deffunc apr_status_t apr_file_name_get(const char **new_path, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_get_filename(const char **new_path, +APR_DECLARE(apr_status_t) apr_file_name_get(const char **new_path, apr_file_t *thefile); /** @@ -465,9 +465,9 @@ APR_DECLARE(apr_status_t) apr_get_filename(const char **new_path, * @param data The user data associated with the file. * @param key The key to use for retreiving data associated with this file. * @param file The currently open file. - * @deffunc apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file) + * @deffunc apr_status_t apr_file_data_get(void **data, const char *key, apr_file_t *file) */ -APR_DECLARE(apr_status_t) apr_get_filedata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, apr_file_t *file); /** @@ -476,9 +476,9 @@ APR_DECLARE(apr_status_t) apr_get_filedata(void **data, const char *key, * @param data The user data to associate with the file. * @param key The key to use for assocaiteing data with the file. * @param cleanup The cleanup routine to use when the file is destroyed. - * @deffunc apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)) + * @deffunc apr_status_t apr_file_data_set(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)) */ -APR_DECLARE(apr_status_t) apr_set_filedata(apr_file_t *file, void *data, +APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)); @@ -488,9 +488,9 @@ APR_DECLARE(apr_status_t) apr_set_filedata(apr_file_t *file, void *data, * @param format The format string * @param ... The values to substitute in the format string * @return The number of bytes written - * @deffunc int apr_fprintf(apr_file_t *fptr, const char *format, ...) + * @deffunc int apr_file_printf(apr_file_t *fptr, const char *format, ...) */ -APR_DECLARE_NONSTD(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) __attribute__((format(printf,2,3))); /** @@ -502,9 +502,9 @@ APR_DECLARE_NONSTD(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) * are specified which could not be set. * * Platforms which do not implement this feature will return APR_ENOTIMPL. - * @deffunc apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) + * @deffunc apr_status_t apr_file_perms_set(const char *fname, apr_fileperms_t perms) */ -APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname, +APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, apr_fileperms_t perms); /** @@ -512,34 +512,34 @@ APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname, * @param path the path for the directory to be created. (use / on all systems) * @param perm Permissions for the new direcoty. * @param cont the pool to use. - * @deffunc apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) + * @deffunc apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm, +APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont); /** * Remove directory from the file system. * @param path the path for the directory to be removed. (use / on all systems) * @param cont the pool to use. - * @deffunc apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) + * @deffunc apr_status_t apr_dir_remove(const char *path, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont); /** * get the specified file's stats. * @param finfo Where to store the information about the file. * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values * @param thefile The file to get information about. - * @deffunc apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) + * @deffunc apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) */ -APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, +APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile); /** * Get the pool used by the file. * @return apr_pool_t the pool - * @deffunc apr_pool_t apr_get_file_pool(apr_file_t *f) + * @deffunc apr_pool_t apr_file_pool_get(apr_file_t *f) */ APR_POOL_DECLARE_ACCESSOR(file); diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 404b7e77a86..f05a1e1e647 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -115,14 +115,14 @@ struct apr_getopt_option_t { * @param argc The number of arguments to parse * @param argv The array of arguments to parse * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) - * @deffunc apr_status_t apr_initopt(apr_getopt_t **os, apr_pool_t *cont,int argc, char *const *argv) + * @deffunc apr_status_t apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont,int argc, char *const *argv) */ -APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, +APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, int argc, const char * const *argv); /** - * Parse the options initialized by apr_initopt(). - * @param os The apr_opt_t structure returned by apr_initopt() + * Parse the options initialized by apr_getopt_init(). + * @param os The apr_opt_t structure returned by apr_getopt_init() * @param opts A string of characters that are acceptable options to the * program. Characters followed by ":" are required to have an * option associated @@ -141,10 +141,10 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, char *optch, const char **optarg); /** - * Parse the options initialized by apr_initopt(), accepting long + * Parse the options initialized by apr_getopt_init(), accepting long * options beginning with "--" in addition to single-character * options beginning with "-". - * @param os The apr_getopt_t structure created by apr_initopt() + * @param os The apr_getopt_t structure created by apr_getopt_init() * @param opts A pointer to a list of apr_getopt_option_t structures, which * can be initialized with { "name", optch, has_args }. has_args * is nonzero if the option requires an argument. A structure diff --git a/include/apr_hash.h b/include/apr_hash.h index 77a2ce01e9c..8cb109606c4 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -97,9 +97,9 @@ typedef struct apr_hash_index_t apr_hash_index_t; * Create a hash table. * @param pool The pool to allocate the hash table out of * @return The hash table just created - * @deffunc apr_hash_t *apr_make_hash(apr_pool_t *pool) + * @deffunc apr_hash_t *apr_hash_make(apr_pool_t *pool) */ -APR_DECLARE(apr_hash_t *) apr_make_hash(apr_pool_t *pool); +APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool); /** * Associate a value with a key in a hash table. diff --git a/include/apr_lib.h b/include/apr_lib.h index fbaeac5c311..50bf956d973 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -212,9 +212,9 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), * Validate any password encypted with any algorithm that APR understands * @param passwd The password to validate * @param hash The password to validate against - * @deffunc apr_status_t apr_validate_password(const char *passwd, const char *hash) + * @deffunc apr_status_t apr_password_validate(const char *passwd, const char *hash) */ -APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, +APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, const char *hash); /* @@ -264,9 +264,9 @@ APR_DECLARE(int) apr_vsnprintf(char *buf, size_t len, const char *format, * @param prompt The prompt to display * @param pwbuf Where to store the password * @param bufsize The length of the password string. - * @deffunc apr_status_t apr_getpass(const char *prompt, char *pwbuf, size_t *bufsize) + * @deffunc apr_status_t apr_password_get(const char *prompt, char *pwbuf, size_t *bufsize) */ -APR_DECLARE(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, +APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, size_t *bufsize); #ifdef __cplusplus diff --git a/include/apr_lock.h b/include/apr_lock.h index eaeaff97712..aec0bce6e53 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -96,9 +96,9 @@ typedef struct apr_lock_t apr_lock_t; * @param cont The pool to operate on. * @tip APR_CROSS_PROCESS may lock both processes and threads, but it is * only guaranteed to lock processes. - * @deffunc apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *cont) + * @deffunc apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_lock(apr_lock_t **lock, +APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, @@ -107,25 +107,25 @@ APR_DECLARE(apr_status_t) apr_create_lock(apr_lock_t **lock, /** * Lock a protected region. * @param lock The lock to set. - * @deffunc apr_status_t apr_lock(apr_lock_t *lock) + * @deffunc apr_status_t apr_lock_aquire(apr_lock_t *lock) */ -APR_DECLARE(apr_status_t) apr_lock(apr_lock_t *lock); +APR_DECLARE(apr_status_t) apr_lock_aquire(apr_lock_t *lock); /** * Unlock a protected region. * @param lock The lock to reset. - * @deffunc apr_status_t apr_unlock(apr_lock_t *lock) + * @deffunc apr_status_t apr_lock_release(apr_lock_t *lock) */ -APR_DECLARE(apr_status_t) apr_unlock(apr_lock_t *lock); +APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock); /** * Free the memory associated with a lock. * @param lock The lock to free. - * @deffunc apr_status_t apr_destroy_lock(apr_lock_t *lock) + * @deffunc apr_status_t apr_lock_destroy(apr_lock_t *lock) * @tip If the lock is currently active when it is destroyed, it * will be unlocked first. */ -APR_DECLARE(apr_status_t) apr_destroy_lock(apr_lock_t *lock); +APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock); /** * Re-open a lock in a child process. @@ -133,15 +133,15 @@ APR_DECLARE(apr_status_t) apr_destroy_lock(apr_lock_t *lock); * @param fname A file name to use if the lock mechanism requires one. This * argument should always be provided. The lock code itself will * determine if it should be used. This filename should be the - * same one that was passed to apr_create_lock + * same one that was passed to apr_lock_create * @param cont The pool to operate on. * @tip This function doesn't always do something, it depends on the * locking mechanism chosen for the platform, but it is a good * idea to call it regardless, because it makes the code more * portable. - * @deffunc apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, apr_pool_t *cont) + * @deffunc apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_child_init_lock(apr_lock_t **lock, +APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *cont); @@ -150,9 +150,9 @@ APR_DECLARE(apr_status_t) apr_child_init_lock(apr_lock_t **lock, * @param lock The currently open lock. * @param key The key to use when retreiving data associated with this lock * @param data The user data associated with the lock. - * @deffunc apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) + * @deffunc apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) */ -APR_DECLARE(apr_status_t) apr_get_lockdata(apr_lock_t *lock, const char *key, +APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key, void *data); /** @@ -161,9 +161,9 @@ APR_DECLARE(apr_status_t) apr_get_lockdata(apr_lock_t *lock, const char *key, * @param data The user data to associate with the lock. * @param key The key to use when associating data with this lock * @param cleanup The cleanup to use when the lock is destroyed. - * @deffunc apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup)(void *)) + * @deffunc apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup)(void *)) */ -APR_DECLARE(apr_status_t) apr_set_lockdata(apr_lock_t *lock, void *data, +APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup)(void *)); diff --git a/include/apr_md5.h b/include/apr_md5.h index b38fc25849a..ebf013d45cf 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -119,22 +119,22 @@ struct apr_md5_ctx_t { /** * MD5 Initialize. Begins an MD5 operation, writing a new context. * @param context The MD5 context to initialize. - * @deffunc apr_status_t apr_MD5Init(apr_md5_ctx_t *context) + * @deffunc apr_status_t apr_md5_init(apr_md5_ctx_t *context) */ -APR_DECLARE(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context); +APR_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context); /** * MD5 translation setup. Provides the APR translation handle to be used * for translating the content before calculating the digest. * @param context The MD5 content to set the translation for. * @param xlate The translation handle to use for this MD5 context - * @deffunc apr_status_t apr_MD5SetXlate(apr_md5_ctx_t *context, apr_xlate_t *xlate) + * @deffunc apr_status_t apr_md5_set_xlate(apr_md5_ctx_t *context, apr_xlate_t *xlate) */ #if APR_HAS_XLATE -APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, +APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context, apr_xlate_t *xlate); #else -#define apr_MD5SetXlate(context, xlate) APR_ENOTIMPL +#define apr_md5_set_xlate(context, xlate) APR_ENOTIMPL #endif /** @@ -143,9 +143,9 @@ APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, * @param context The MD5 content to update. * @param input next message block to update * @param inputLen The length of the next message block - * @deffunc apr_status_t apr_MD5Update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) + * @deffunc apr_status_t apr_md5_update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) */ -APR_DECLARE(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, +APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen); @@ -154,9 +154,9 @@ APR_DECLARE(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, * message digest and zeroing the context * @param digest The final MD5 digest * @param context The MD5 content we are finalizing. - * @deffunc apr_status_t apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context) + * @deffunc apr_status_t apr_md5_final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context) */ -APR_DECLARE(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], +APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context); /** @@ -165,9 +165,9 @@ APR_DECLARE(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], * @param salt The salt to use for the encoding * @param result The string to store the encoded password in * @param nbytes The length of the string - * @deffunc apr_status_t apr_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes) + * @deffunc apr_status_t apr_md5_encode(const char *password, const char *salt, char *result, size_t nbytes) */ -APR_DECLARE(apr_status_t) apr_MD5Encode(const char *password, const char *salt, +APR_DECLARE(apr_status_t) apr_md5_encode(const char *password, const char *salt, char *result, size_t nbytes); #ifdef __cplusplus diff --git a/include/apr_network_io.h b/include/apr_network_io.h index a647bb28950..b267a287bde 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -194,7 +194,7 @@ struct apr_sockaddr_t { /** This points to the IP address structure within the appropriate * sockaddr structure. */ void *ipaddr_ptr; - /** If multiple addresses were found by apr_getaddrinfo(), this + /** If multiple addresses were found by apr_sockaddr_info_get(), this * points to a representation of the next address. */ apr_sockaddr_t *next; }; @@ -226,9 +226,9 @@ struct apr_hdtr_t { * @param family The address family of the socket (e.g., APR_INET). * @param type The type of the socket (e.g., SOCK_STREAM). * @param cont The pool to use - * @deffunc apr_status_t apr_create_socket(apr_socket_t **new_sock, int family, int type, apr_pool_t *cont) + * @deffunc apr_status_t apr_socket_create(apr_socket_t **new_sock, int family, int type, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_socket(apr_socket_t **new_sock, +APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, int family, int type, apr_pool_t *cont); @@ -251,9 +251,9 @@ APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, /** * Close a tcp socket. * @param thesocket The socket to close - * @deffunc apr_status_t apr_close_socket(apr_socket_t *thesocket) + * @deffunc apr_status_t apr_socket_close(apr_socket_t *thesocket) */ -APR_DECLARE(apr_status_t) apr_close_socket(apr_socket_t *thesocket); +APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket); /** * Bind the socket to its associated port @@ -308,9 +308,9 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa); * @param port The port number. * @param flags Special processing flags. * @param p The pool for the apr_sockaddr_t and associated storage. - * @deffunc apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p) + * @deffunc apr_status_t apr_sockaddr_info_get(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p) */ -APR_DECLARE(apr_status_t) apr_getaddrinfo(apr_sockaddr_t **sa, +APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, @@ -377,9 +377,9 @@ APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont); * @param data The user data associated with the socket. * @param key The key to associate with the user data. * @param sock The currently open socket. - * @deffunc apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock) + * @deffunc apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *sock) */ -APR_DECLARE(apr_status_t) apr_get_socketdata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, apr_socket_t *sock); /** @@ -388,9 +388,9 @@ APR_DECLARE(apr_status_t) apr_get_socketdata(void **data, const char *key, * @param data The user data to associate with the socket. * @param key The key to associate with the data. * @param cleanup The cleanup to call when the socket is destroyed. - * @deffunc apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup)(void*)) + * @deffunc apr_status_t apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup)(void*)) */ -APR_DECLARE(apr_status_t) apr_set_socketdata(apr_socket_t *sock, void *data, +APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup)(void*)); @@ -537,9 +537,9 @@ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, * @param sa The returned apr_sockaddr_t. * @param which Which interface do we want the apr_sockaddr_t for? * @param sock The socket to use - * @deffunc apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock) + * @deffunc apr_status_t apr_socket_addr_get(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock) */ -APR_DECLARE(apr_status_t) apr_get_sockaddr(apr_sockaddr_t **sa, +APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock); @@ -547,18 +547,18 @@ APR_DECLARE(apr_status_t) apr_get_sockaddr(apr_sockaddr_t **sa, * Set the port in an APR socket address. * @param sockaddr The socket address to set. * @param port The port to be stored in the socket address. - * @deffunc apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port) + * @deffunc apr_status_t apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, apr_port_t port) */ -APR_DECLARE(apr_status_t) apr_set_port(apr_sockaddr_t *sockaddr, +APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, apr_port_t port); /** * Return the port in an APR socket address. * @param port The port from the socket address. * @param sockaddr The socket address to reference. - * @deffunc apr_status_t apr_get_port(apr_port_t *port, apr_sockaddr_t *sockaddr) + * @deffunc apr_status_t apr_sockaddr_port_get(apr_port_t *port, apr_sockaddr_t *sockaddr) */ -APR_DECLARE(apr_status_t) apr_get_port(apr_port_t *port, +APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, apr_sockaddr_t *sockaddr); /** @@ -566,9 +566,9 @@ APR_DECLARE(apr_status_t) apr_get_port(apr_port_t *port, * @param sockaddr The socket address to use * @param addr The IP address to attach to the socket. * Use APR_ANYADDR to use any IP addr on the machine. - * @deffunc apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr) + * @deffunc apr_status_t apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, const char *addr) */ -APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr, +APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, const char *addr); /** @@ -576,9 +576,9 @@ APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr, * an APR socket address. * @param addr The IP address. * @param sockaddr The socket address to reference. - * @deffunc apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr) + * @deffunc apr_status_t apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr) */ -APR_DECLARE(apr_status_t) apr_get_ipaddr(char **addr, +APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr); /** @@ -586,9 +586,9 @@ APR_DECLARE(apr_status_t) apr_get_ipaddr(char **addr, * @param new_poll The poll structure to be used. * @param num The number of socket descriptors to be polled. * @param cont The pool to operate on. - * @deffunc apr_status_t apr_setup_poll(apr_pollfd_t **new_poll, apr_int32_t num, apr_pool_t *cont) + * @deffunc apr_status_t apr_poll_setup(apr_pollfd_t **new_poll, apr_int32_t num, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_setup_poll(apr_pollfd_t **new_poll, +APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new_poll, apr_int32_t num, apr_pool_t *cont); @@ -622,9 +622,9 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, * APR_POLLPRI signal if prioirty data is availble to be read * APR_POLLOUT signal if write will not block * </PRE> - * @deffunc apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) + * @deffunc apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) */ -APR_DECLARE(apr_status_t) apr_add_poll_socket(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event); @@ -638,18 +638,18 @@ APR_DECLARE(apr_status_t) apr_add_poll_socket(apr_pollfd_t *aprset, * APR_POLLPRI signal if prioirty data is availble to be read * APR_POLLOUT signal if write will not block * </PRE> - * @deffunc apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) + * @deffunc apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) */ -APR_DECLARE(apr_status_t) apr_mask_poll_socket(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events); /** * Remove a socket from the poll structure. * @param aprset The poll structure we will be using. * @param sock The socket to remove from the current poll structure. - * @deffunc apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) + * @deffunc apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) */ -APR_DECLARE(apr_status_t) apr_remove_poll_socket(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock); /** @@ -661,9 +661,9 @@ APR_DECLARE(apr_status_t) apr_remove_poll_socket(apr_pollfd_t *aprset, * APR_POLLPRI signal if prioirty data is availble to be read * APR_POLLOUT signal if write will not block * </PRE> - * @deffunc apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events) + * @deffunc apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) */ -APR_DECLARE(apr_status_t) apr_clear_poll_sockets(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events); /** @@ -680,9 +680,9 @@ APR_DECLARE(apr_status_t) apr_clear_poll_sockets(apr_pollfd_t *aprset, * </PRE> * @param sock The socket we wish to get information about. * @param aprset The poll structure we will be using. - * @deffunc apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) + * @deffunc apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) */ -APR_DECLARE(apr_status_t) apr_get_revents(apr_int16_t *event, +APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset); @@ -691,9 +691,9 @@ APR_DECLARE(apr_status_t) apr_get_revents(apr_int16_t *event, * @param pollfd The currently open pollfd. * @param key The key to use for retreiving data associated with a poll struct. * @param data The user data associated with the pollfd. - * @deffunc apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) + * @deffunc apr_status_t apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) */ -APR_DECLARE(apr_status_t) apr_get_polldata(apr_pollfd_t *pollfd, +APR_DECLARE(apr_status_t) apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data); /** @@ -702,9 +702,9 @@ APR_DECLARE(apr_status_t) apr_get_polldata(apr_pollfd_t *pollfd, * @param data The key to associate with the data. * @param key The user data to associate with the pollfd. * @param cleanup The cleanup function - * @deffunc apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup)(void *)) + * @deffunc apr_status_t apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup)(void *)) */ -APR_DECLARE(apr_status_t) apr_set_polldata(apr_pollfd_t *pollfd, void *data, +APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup)(void *)); diff --git a/include/apr_pools.h b/include/apr_pools.h index 0315d29e50a..10fc9935f6c 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -215,9 +215,9 @@ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); * ever be used outside of APR. * @tip Programs do NOT need to call this directly. APR will call this * automatically from apr_initialize. - * @deffunc apr_status_t apr_init_alloc(apr_pool_t *globalp) + * @deffunc apr_status_t apr_pool_alloc_init(apr_pool_t *globalp) */ -APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp); +APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *globalp); /** * Tear down all of the internal structures required to use pools @@ -226,9 +226,9 @@ APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp); * ever be used outside of APR. * @tip Programs do NOT need to call this directly. APR will call this * automatically from apr_terminate. - * @deffunc void apr_term_alloc(apr_pool_t *globalp) + * @deffunc void apr_pool_alloc_term(apr_pool_t *globalp) */ -APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp); +APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp); /* pool functions */ @@ -239,9 +239,9 @@ APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp); * pool. If it is non-NULL, the new pool will inherit all * of it's parent pool's attributes, except the apr_pool_t will * be a sub-pool. - * @deffunc apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) + * @deffunc apr_status_t apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, +APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont); /** @@ -258,9 +258,9 @@ APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, * data by choosing a key that another part of the program is using * It is advised that steps are taken to ensure that a unique * key is used at all times. - * @deffunc apr_status_t apr_set_userdata(const void *data, const char *key, apr_status_t (*cleanup)(void *), apr_pool_t *cont) + * @deffunc apr_status_t apr_pool_userdata_set(const void *data, const char *key, apr_status_t (*cleanup)(void *), apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, +APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *key, apr_status_t (*cleanup)(void *), apr_pool_t *cont); @@ -269,9 +269,9 @@ APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, * @param data The key for the data to retrieve * @param key The user data associated with the pool. * @param cont The current pool. - * @deffunc apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) + * @deffunc apr_status_t apr_pool_userdata_get(void **data, const char *key, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *cont); /** @@ -281,9 +281,9 @@ APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, * @return The new sub-pool * @tip The apr_abort function provides a way to quit the program if the * machine is out of memory. By default, APR will return on error. - * @deffunc apr_pool_t *apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) + * @deffunc apr_pool_t *apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int retcode)) */ -APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, +APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int retcode)); /** @@ -299,24 +299,24 @@ APR_DECLARE(void) apr_clear_pool(apr_pool_t *p); * destroy the pool * @param p The pool to destroy * @tip This will actually free the memory - * @deffunc void apr_destroy_pool(apr_pool_t *p) + * @deffunc void apr_pool_destroy(apr_pool_t *p) */ -APR_DECLARE(void) apr_destroy_pool(apr_pool_t *p); +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); /** * report the number of bytes currently in the pool * @param p The pool to inspect * @return The number of bytes - * @deffunc apr_size_t apr_bytes_in_pool(apr_pool_t *p) + * @deffunc apr_size_t apr_pool_num_bytes(apr_pool_t *p) */ -APR_DECLARE(apr_size_t) apr_bytes_in_pool(apr_pool_t *p); +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p); /** * report the number of bytes currently in the list of free blocks * @return The number of bytes - * @deffunc apr_size_t apr_bytes_in_free_blocks(void) + * @deffunc apr_size_t apr_pool_free_blocks_num_bytes(void) */ -APR_DECLARE(apr_size_t) apr_bytes_in_free_blocks(void); +APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void); /** * Allocate a block of memory from a pool @@ -343,9 +343,9 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); * @param plain_cleanup The function to call when the pool is cleared * or destroyed * @param child_cleanup The function to call when a child process is created - * @deffunc void apr_register_cleanup(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)) + * @deffunc void apr_pool_cleanup_register(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)) */ -APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)); @@ -354,9 +354,9 @@ APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup - * @deffunc void apr_kill_cleanup(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *)) + * @deffunc void apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *)) */ -APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *)); /** @@ -364,9 +364,9 @@ APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup - * @deffunc apr_status_t apr_run_cleanup(apr_pool_t *p, void *data, apr_status_t (*cleanup)(void *)) + * @deffunc apr_status_t apr_pool_cleanup_run(apr_pool_t *p, void *data, apr_status_t (*cleanup)(void *)) */ -APR_DECLARE(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, +APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, apr_status_t (*cleanup)(void *)); /* Preparing for exec() --- close files, etc., but *don't* flush I/O @@ -375,16 +375,16 @@ APR_DECLARE(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, /** * Run all of the child_cleanups, so that any unnecessary files are * closed because we are about to exec a new program - * @deffunc void apr_cleanup_for_exec(void) + * @deffunc void apr_pool_cleanup_for_exec(void) */ -APR_DECLARE(void) apr_cleanup_for_exec(void); +APR_DECLARE(void) apr_pool_cleanup_for_exec(void); /** * An empty cleanup function * @param data The data to cleanup - * @deffunc apr_status_t apr_null_cleanup(void *data) + * @deffunc apr_status_t apr_pool_cleanup_null(void *data) */ -APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data); +APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); /* * Pool accessor functions. @@ -397,7 +397,7 @@ APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data); * * APR_POOL_DECLARE_ACCESSOR(file); * becomes: - * APR_DECLARE(apr_pool_t *) apr_get_file_pool(apr_file_t *ob); + * APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob); * * In the implementation, the APR_POOL_IMPLEMENT_ACCESSOR() is used to * actually define the function. It assumes the field is named "pool". For @@ -408,13 +408,13 @@ APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data); * the macros to support other linkages. */ #define APR_POOL_DECLARE_ACCESSOR(typename) \ - APR_DECLARE(apr_pool_t *) apr_get_##typename##_pool \ + APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ (apr_##typename##_t *ob) #define APR_POOL_IMPLEMENT_ACCESSOR(typename) \ APR_POOL_IMPLEMENT_ACCESSOR_X(typename, pool) #define APR_POOL_IMPLEMENT_ACCESSOR_X(typename, fieldname) \ - APR_DECLARE(apr_pool_t *) apr_get_##typename##_pool \ + APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ (apr_##typename##_t *ob) { return ob->fieldname; } /* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t diff --git a/include/apr_portable.h b/include/apr_portable.h index 5eec7971d7b..00d30770765 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -200,56 +200,56 @@ typedef struct apr_os_sock_info_t apr_os_sock_info_t; * convert the file from apr type to os specific type. * @param thefile The os specific file we are converting to * @param file The apr file to convert. - * @deffunc apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) + * @deffunc apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) * @tip On Unix, it is only possible to get a file descriptor from * an apr file type. */ -APR_DECLARE(apr_status_t) apr_get_os_file(apr_os_file_t *thefile, +APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file); /** * convert the dir from apr type to os specific type. * @param thedir The os specific dir we are converting to * @param dir The apr dir to convert. - * @deffunc apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) + * @deffunc apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) */ -APR_DECLARE(apr_status_t) apr_get_os_dir(apr_os_dir_t **thedir, +APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir); /** * Convert the socket from an apr type to an OS specific socket * @param thesock The socket to convert. * @param sock The os specifc equivelant of the apr socket.. - * @deffunc apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) + * @deffunc apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) */ -APR_DECLARE(apr_status_t) apr_get_os_sock(apr_os_sock_t *thesock, +APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock); /** * Convert the lock from os specific type to apr type * @param oslock The os specific lock we are converting to. * @param lock The apr lock to convert. - * @deffunc apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) + * @deffunc apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) */ -APR_DECLARE(apr_status_t) apr_get_os_lock(apr_os_lock_t *oslock, +APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock); /** * Get the exploded time in the platforms native format. * @param ostime the native time format * @param aprtime the time to convert - * @deffunc apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprtime) + * @deffunc apr_status_t apr_os_exp_time_get(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprtime) */ -APR_DECLARE(apr_status_t) apr_get_os_exp_time(apr_os_exp_time_t **ostime, +APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprtime); /** * Get the imploded time in the platforms native format. * @param ostime the native time format * @param aprtimethe time to convert - * @deffunc apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime) + * @deffunc apr_status_t apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime) */ -APR_DECLARE(apr_status_t) apr_get_os_imp_time(apr_os_imp_time_t **ostime, +APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime); #if APR_HAS_THREADS @@ -258,18 +258,18 @@ APR_DECLARE(apr_status_t) apr_get_os_imp_time(apr_os_imp_time_t **ostime, * convert the thread to os specific type from apr type. * @param thethd The apr thread to convert * @param thd The os specific thread we are converting to - * @deffunc apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd) + * @deffunc apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) */ -APR_DECLARE(apr_status_t) apr_get_os_thread(apr_os_thread_t **thethd, +APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd); /** * convert the thread private memory key to os specific type from an apr type. * @param thekey The apr handle we are converting from. * @param key The os specific handle we are converting to. - * @deffunc apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key) + * @deffunc apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) */ -APR_DECLARE(apr_status_t) apr_get_os_threadkey(apr_os_threadkey_t *thekey, +APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key); #endif /* APR_HAS_THREADS */ @@ -279,11 +279,11 @@ APR_DECLARE(apr_status_t) apr_get_os_threadkey(apr_os_threadkey_t *thekey, * @param file The apr file we are converting to. * @param thefile The os specific file to convert * @param cont The pool to use if it is needed. - * @deffunc apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) * @tip On Unix, it is only possible to put a file descriptor into * an apr file type. */ -APR_DECLARE(apr_status_t) apr_put_os_file(apr_file_t **file, +APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont); @@ -292,9 +292,9 @@ APR_DECLARE(apr_status_t) apr_put_os_file(apr_file_t **file, * @param dir The apr dir we are converting to. * @param thedir The os specific dir to convert * @param cont The pool to use when creating to apr directory. - * @deffunc apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_put_os_dir(apr_dir_t **dir, +APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont); @@ -303,9 +303,9 @@ APR_DECLARE(apr_status_t) apr_put_os_dir(apr_dir_t **dir, * @param sock The pool to use. * @param thesock The socket to convert to. * @param cont The socket we are converting to an apr type. - * @deffunc apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_put_os_sock(apr_socket_t **sock, +APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont); @@ -316,11 +316,11 @@ APR_DECLARE(apr_status_t) apr_put_os_sock(apr_socket_t **sock, * @param os_sock_info The os representation of the socket handle and * other characteristics of the socket * @param cont The pool to use - * @deffunc apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont) * @tip If you only know the descriptor/handle or if it isn't really - * a true socket, use apr_put_os_sock() instead. + * a true socket, use apr_os_sock_put() instead. */ -APR_DECLARE(apr_status_t) apr_make_os_sock(apr_socket_t **apr_sock, +APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont); @@ -329,9 +329,9 @@ APR_DECLARE(apr_status_t) apr_make_os_sock(apr_socket_t **apr_sock, * @param lock The apr lock we are converting to. * @param thelock The os specific lock to convert. * @param cont The pool to use if it is needed. - * @deffunc apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_put_os_lock(apr_lock_t **lock, +APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont); @@ -340,9 +340,9 @@ APR_DECLARE(apr_status_t) apr_put_os_lock(apr_lock_t **lock, * @param aprtime the APR time format * @param ostime the time to convert * @param cont the pool to use if necessary - * @deffunc apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_put_os_imp_time(apr_time_t *aprtime, +APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont); @@ -351,9 +351,9 @@ APR_DECLARE(apr_status_t) apr_put_os_imp_time(apr_time_t *aprtime, * @param aprtime the APR time format * @param ostime the time to convert * @param cont the pool to use if necessary - * @deffunc apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_exp_time_pupt(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_put_os_exp_time(apr_exploded_time_t *aprtime, +APR_DECLARE(apr_status_t) apr_os_exp_time_pupt(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont); @@ -364,9 +364,9 @@ APR_DECLARE(apr_status_t) apr_put_os_exp_time(apr_exploded_time_t *aprtime, * @param thd The apr thread we are converting to. * @param thethd The os specific thread to convert * @param cont The pool to use if it is needed. - * @deffunc apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, + * @deffunc apr_status_t apr_os_thread_pupt(apr_thread_t **thd, apr_os_thread_t *thethd, */ -APR_DECLARE(apr_status_t) apr_put_os_thread(apr_thread_t **thd, +APR_DECLARE(apr_status_t) apr_os_thread_pupt(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont); @@ -375,9 +375,9 @@ APR_DECLARE(apr_status_t) apr_put_os_thread(apr_thread_t **thd, * @param key The apr handle we are converting to. * @param thekey The os specific handle to convert * @param cont The pool to use if it is needed. - * @deffunc apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_put_os_threadkey(apr_threadkey_t **key, +APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont); diff --git a/include/apr_shmem.h b/include/apr_shmem.h index 908b10a2a70..64e0604dbda 100644 --- a/include/apr_shmem.h +++ b/include/apr_shmem.h @@ -134,9 +134,9 @@ APR_DECLARE(apr_status_t) apr_shm_free(apr_shmem_t *shared, void *entity); * based on file access. APR_USES_KEYBASED_SHM if shared * memory is based on a key value such as shmctl. If the * shared memory is anonymous, the name is NULL. - * @deffunc apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) + * @deffunc apr_status_t apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) */ -APR_DECLARE(apr_status_t) apr_get_shm_name(apr_shmem_t *c, +APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name); /** @@ -149,17 +149,17 @@ APR_DECLARE(apr_status_t) apr_get_shm_name(apr_shmem_t *c, * @return APR_USES_ANONYMOUS_SHM if we are using anonymous shared * memory. APR_SUCCESS if we are using named shared memory * and we were able to assign the name correctly. - * @deffunc apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) + * @deffunc apr_status_t apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) */ -APR_DECLARE(apr_status_t) apr_set_shm_name(apr_shmem_t *c, +APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name); /** * Open the shared memory block in a child process. * @param The shared memory block to open in the child. - * @deffunc apr_status_t apr_open_shmem(apr_shmem_t *c) + * @deffunc apr_status_t apr_shm_open(apr_shmem_t *c) */ -APR_DECLARE(apr_status_t) apr_open_shmem(apr_shmem_t *c); +APR_DECLARE(apr_status_t) apr_shm_open(apr_shmem_t *c); /** * Determine how much memory is available in the specified shared memory block diff --git a/include/apr_tables.h b/include/apr_tables.h index 76970478518..00c441ba5f3 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -149,9 +149,9 @@ struct apr_table_entry_t { * @param nelts the number of elements in the initial array * @param elt_size The size of each element in the array. * @return The new array - * @deffunc apr_array_header_t *apr_make_array(struct apr_pool_t *p, int nelts, int elt_size) + * @deffunc apr_array_header_t *apr_array_make(struct apr_pool_t *p, int nelts, int elt_size) */ -APR_DECLARE(apr_array_header_t *) apr_make_array(struct apr_pool_t *p, +APR_DECLARE(apr_array_header_t *) apr_array_make(struct apr_pool_t *p, int nelts, int elt_size); /** @@ -160,9 +160,9 @@ APR_DECLARE(apr_array_header_t *) apr_make_array(struct apr_pool_t *p, * @return Location for the new element in the array. * @tip If there are no free spots in the array, then this function will * allocate new space for the new element. - * @deffunc void *apr_push_array(apr_array_header_t *arr) + * @deffunc void *apr_array_push(apr_array_header_t *arr) */ -APR_DECLARE(void *) apr_push_array(apr_array_header_t *arr); +APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr); /** * Concatenate two arrays together @@ -179,13 +179,13 @@ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, * @param p The pool to allocate the copy of the array out of * @param arr The array to copy * @return An exact copy of the array passed in - * @deffunc apr_array_header_t *apr_copy_array(apr_pool_t *p, const apr_array_header_t *arr) - * @tip The alternate apr_copy_array_hdr copies only the header, and arranges + * @deffunc apr_array_header_t *apr_array_copy(apr_pool_t *p, const apr_array_header_t *arr) + * @tip The alternate apr_array_copy_hdr copies only the header, and arranges * for the elements to be copied if (and only if) the code subsequently does * a push or arraycat. */ APR_DECLARE(apr_array_header_t *) - apr_copy_array(struct apr_pool_t *p, + apr_array_copy(struct apr_pool_t *p, const apr_array_header_t *arr); /** * Copy the headers of the array, and arrange for the elements to be copied if @@ -193,11 +193,11 @@ APR_DECLARE(apr_array_header_t *) * @param p The pool to allocate the copy of the array out of * @param arr The array to copy * @return An exact copy of the array passed in - * @deffunc apr_array_header_t *apr_copy_array_hdr(apr_pool_t *p, const apr_array_header_t *arr) - * @tip The alternate apr_copy_array copies the *entire* array. + * @deffunc apr_array_header_t *apr_array_copy_hdr(apr_pool_t *p, const apr_array_header_t *arr) + * @tip The alternate apr_array_copy copies the *entire* array. */ APR_DECLARE(apr_array_header_t *) - apr_copy_array_hdr(struct apr_pool_t *p, + apr_array_copy_hdr(struct apr_pool_t *p, const apr_array_header_t *arr); /** @@ -206,10 +206,10 @@ APR_DECLARE(apr_array_header_t *) * @param first The array to put first in the new array. * @param second The array to put second in the new array. * @param return A new array containing the data from the two arrays passed in. - * @deffunc apr_array_header_t *apr_append_arrays(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second) + * @deffunc apr_array_header_t *apr_array_append(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second) */ APR_DECLARE(apr_array_header_t *) - apr_append_arrays(struct apr_pool_t *p, + apr_array_append(struct apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second); @@ -235,26 +235,26 @@ APR_DECLARE(char *) apr_array_pstrcat(struct apr_pool_t *p, * @param nelts The number of elements in the initial table. * @return The new table. * @warning This table can only store text data - * @deffunc apr_table_t *apr_make_table(apr_pool_t *p, int nelts) + * @deffunc apr_table_t *apr_table_make(apr_pool_t *p, int nelts) */ -APR_DECLARE(apr_table_t *) apr_make_table(struct apr_pool_t *p, int nelts); +APR_DECLARE(apr_table_t *) apr_table_make(struct apr_pool_t *p, int nelts); /** * Create a new table and copy another table into it * @param p The pool to allocate the new table out of * @param t The table to copy * @return A copy of the table passed in - * @deffunc apr_table_t *apr_copy_table(apr_pool_t *p, const apr_table_t *t) + * @deffunc apr_table_t *apr_table_copy(apr_pool_t *p, const apr_table_t *t) */ -APR_DECLARE(apr_table_t *) apr_copy_table(struct apr_pool_t *p, +APR_DECLARE(apr_table_t *) apr_table_copy(struct apr_pool_t *p, const apr_table_t *t); /** * Delete all of the elements from a table * @param t The table to clear - * @deffunc void apr_clear_table(apr_table_t *t) + * @deffunc void apr_table_clear(apr_table_t *t) */ -APR_DECLARE(void) apr_clear_table(apr_table_t *t); +APR_DECLARE(void) apr_table_clear(apr_table_t *t); /** * Get the value associated with a given key from the table. After this call, @@ -358,9 +358,9 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, * @param overlay The first table to put in the new table * @param base The table to add at the end of the new table * @return A new table containing all of the data from the two passed in - * @deffunc apr_table_t *apr_overlay_tables(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); + * @deffunc apr_table_t *apr_table_overlay(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); */ -APR_DECLARE(apr_table_t *) apr_overlay_tables(struct apr_pool_t *p, +APR_DECLARE(apr_table_t *) apr_table_overlay(struct apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); @@ -400,7 +400,7 @@ APR_DECLARE(void) apr_table_vdo(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, va_list); -/* Conceptually, apr_overlap_tables does this: +/* Conceptually, apr_table_overlap does this: * * apr_array_header_t *barr = apr_table_elts(b); * apr_table_entry_t *belt = (apr_table_entry_t *)barr->elts; @@ -434,9 +434,9 @@ APR_DECLARE(void) * APR_OVERLAP_TABLES_MERGE Use apr_table_mergen * @tip This function is highly optimized, and uses less memory and CPU cycles * than a function that just loops through table b calling other functions. - * @deffunc void apr_overlap_tables(apr_table_t *a, const apr_table_t *b, unsigned flags) + * @deffunc void apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags) */ -APR_DECLARE(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, +APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags); #ifdef __cplusplus diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index f77bd22e66a..fc0a89d0896 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -157,26 +157,26 @@ struct process_chain { * Create and initialize a new threadattr variable * @param new_attr The newly created threadattr. * @param cont The pool to use - * @deffunc apr_status_t apr_create_threadattr(apr_threadattr_t **new_attr, apr_pool_t *cont) + * @deffunc apr_status_t apr_threadattr_create(apr_threadattr_t **new_attr, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_threadattr(apr_threadattr_t **new_attr, +APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new_attr, apr_pool_t *cont); /** * Set if newly created threads should be created in detach mode. * @param attr The threadattr to affect * @param on Thread detach state on or off - * @deffunc apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) + * @deffunc apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) */ -APR_DECLARE(apr_status_t) apr_setthreadattr_detach(apr_threadattr_t *attr, +APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on); /** * Get the detach mode for this threadattr. * @param attr The threadattr to reference - * @deffunc apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) + * @deffunc apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) */ -APR_DECLARE(apr_status_t) apr_getthreadattr_detach(apr_threadattr_t *attr); +APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr); /** * Create a new thread of execution @@ -185,9 +185,9 @@ APR_DECLARE(apr_status_t) apr_getthreadattr_detach(apr_threadattr_t *attr); * @param func The function to start the new thread in * @param data Any data to be passed to the starting function * @param cont The pool to use - * @deffunc apr_status_t apr_create_thread(apr_thread_t **new_thread, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) + * @deffunc apr_status_t apr_thread_create(apr_thread_t **new_thread, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_thread(apr_thread_t **new_thread, +APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new_thread, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont); @@ -222,9 +222,9 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd); * @param data The user data associated with the thread. * @param key The key to associate with the data * @param thread The currently open thread. - * @deffunc apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) + * @deffunc apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) */ -APR_DECLARE(apr_status_t) apr_get_threaddata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread); /** @@ -233,9 +233,9 @@ APR_DECLARE(apr_status_t) apr_get_threaddata(void **data, const char *key, * @param key The key to use for associating the data with the tread * @param cleanup The cleanup routine to use when the thread is destroyed. * @param thread The currently open thread. - * @deffunc apr_status_t apr_set_threaddata(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) + * @deffunc apr_status_t apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) */ -APR_DECLARE(apr_status_t) apr_set_threaddata(void *data, const char *key, +APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread); @@ -244,9 +244,9 @@ APR_DECLARE(apr_status_t) apr_set_threaddata(void *data, const char *key, * @param key The thread private handle. * @param dest The destructor to use when freeing the private memory. * @param cont The pool to use - * @deffunc apr_status_t apr_create_thread_private(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) + * @deffunc apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_thread_private(apr_threadkey_t **key, +APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont); @@ -254,35 +254,35 @@ APR_DECLARE(apr_status_t) apr_create_thread_private(apr_threadkey_t **key, * Get a pointer to the thread private memory * @param new_mem The data stored in private memory * @param key The handle for the desired thread private memory - * @deffunc apr_status_t apr_get_thread_private(void **new_mem, apr_threadkey_t *key) + * @deffunc apr_status_t apr_threadkey_private_get(void **new_mem, apr_threadkey_t *key) */ -APR_DECLARE(apr_status_t) apr_get_thread_private(void **new_mem, +APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new_mem, apr_threadkey_t *key); /** * Set the data to be stored in thread private memory * @param priv The data to be stored in private memory * @param key The handle for the desired thread private memory - * @deffunc apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) + * @deffunc apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) */ -APR_DECLARE(apr_status_t) apr_set_thread_private(void *priv, +APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key); /** * Free the thread private memory * @param key The handle for the desired thread private memory - * @deffunc apr_status_t apr_delete_thread_private(apr_threadkey_t *key) + * @deffunc apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) */ -APR_DECLARE(apr_status_t) apr_delete_thread_private(apr_threadkey_t *key); +APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key); /** * Return the pool associated with the current threadkey. * @param data The user data associated with the threadkey. * @param key The key associated with the data * @param threadkey The currently open threadkey. - * @deffunc apr_status_t apr_get_threadkeydata(void **data, const char *key, apr_threadkey_t *threadkey) + * @deffunc apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) */ -APR_DECLARE(apr_status_t) apr_get_threadkeydata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey); /** @@ -291,9 +291,9 @@ APR_DECLARE(apr_status_t) apr_get_threadkeydata(void **data, const char *key, * @param key The key to associate with the data. * @param cleanup The cleanup routine to use when the file is destroyed. * @param threadkey The currently open threadkey. - * @deffunc apr_status_t apr_set_threadkeydata(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) + * @deffunc apr_status_t apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) */ -APR_DECLARE(apr_status_t) apr_set_threadkeydata(void *data, const char *key, +APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey); @@ -307,9 +307,9 @@ APR_DECLARE(apr_status_t) apr_set_threadkeydata(void *data, const char *key, * Create and initialize a new procattr variable * @param new_attr The newly created procattr. * @param cont The pool to use - * @deffunc apr_status_t apr_createprocattr_init(apr_procattr_t **new_attr, apr_pool_t *cont) + * @deffunc apr_status_t apr_procattr_create(apr_procattr_t **new_attr, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_createprocattr_init(apr_procattr_t **new_attr, +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new_attr, apr_pool_t *cont); /** @@ -319,9 +319,9 @@ APR_DECLARE(apr_status_t) apr_createprocattr_init(apr_procattr_t **new_attr, * @param in Should stdin be a pipe back to the parent? * @param out Should stdout be a pipe back to the parent? * @param err Should stderr be a pipe back to the parent? - * @deffunc apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) + * @deffunc apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) */ -APR_DECLARE(apr_status_t) apr_setprocattr_io(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err); @@ -330,7 +330,7 @@ APR_DECLARE(apr_status_t) apr_setprocattr_io(apr_procattr_t *attr, * @param attr The procattr we care about. * @param child_in apr_file_t value to use as child_in. Must be a valid file. * @param parent_in apr_file_t value to use as parent_in. Must be a valid file. - * @deffunc apr_status_t apr_setprocattr_childin(struct apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) + * @deffunc apr_status_t apr_procattr_child_in_set(struct apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across multiple @@ -338,7 +338,7 @@ APR_DECLARE(apr_status_t) apr_setprocattr_io(apr_procattr_t *attr, * extra function calls by not creating your own pipe since this * creates one in the process space for you. */ -APR_DECLARE(apr_status_t) apr_setprocattr_childin(struct apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_child_in_set(struct apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in); @@ -347,13 +347,13 @@ APR_DECLARE(apr_status_t) apr_setprocattr_childin(struct apr_procattr_t *attr, * @param attr The procattr we care about. * @param child_out apr_file_t value to use as child_out. Must be a valid file. * @param parent_out apr_file_t value to use as parent_out. Must be a valid file. - * @deffunc apr_status_t apr_setprocattr_childout(struct apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) + * @deffunc apr_status_t apr_procattr_child_out_set(struct apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across multiple * process invocations - such as a log file. */ -APR_DECLARE(apr_status_t) apr_setprocattr_childout(struct apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_child_out_set(struct apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out); @@ -362,13 +362,13 @@ APR_DECLARE(apr_status_t) apr_setprocattr_childout(struct apr_procattr_t *attr, * @param attr The procattr we care about. * @param child_err apr_file_t value to use as child_err. Must be a valid file. * @param parent_err apr_file_t value to use as parent_err. Must be a valid file. - * @deffunc apr_status_t apr_setprocattr_childerr(struct apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) + * @deffunc apr_status_t apr_procattr_child_err_set(struct apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across multiple * process invocations - such as a log file. */ -APR_DECLARE(apr_status_t) apr_setprocattr_childerr(struct apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_child_err_set(struct apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err); @@ -378,9 +378,9 @@ APR_DECLARE(apr_status_t) apr_setprocattr_childerr(struct apr_procattr_t *attr, * @param dir Which dir to start in. By default, this is the same dir as * the parent currently resides in, when the createprocess call * is made. - * @deffunc apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) + * @deffunc apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) */ -APR_DECLARE(apr_status_t) apr_setprocattr_dir(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir); /** @@ -391,18 +391,18 @@ APR_DECLARE(apr_status_t) apr_setprocattr_dir(apr_procattr_t *attr, * APR_SHELLCMD -- Shell script * APR_PROGRAM -- Executable program (default) * </PRE> - * @deffunc apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, apr_cmdtype_e cmd) + * @deffunc apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) */ -APR_DECLARE(apr_status_t) apr_setprocattr_cmdtype(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd); /** * Determine if the chlid should start in detached state. * @param attr The procattr we care about. * @param detach Should the child start in detached state? Default is no. - * @deffunc apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) + * @deffunc apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) */ -APR_DECLARE(apr_status_t) apr_setprocattr_detach(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach); #if APR_HAVE_STRUCT_RLIMIT @@ -416,9 +416,9 @@ APR_DECLARE(apr_status_t) apr_setprocattr_detach(apr_procattr_t *attr, * APR_LIMIT_NPROC * </PRE> * @param limit Value to set the limit to. - * @deffunc apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, apr_int32_t what, struct rlimit *limit) + * @deffunc apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, apr_int32_t what, struct rlimit *limit) */ -APR_DECLARE(apr_status_t) apr_setprocattr_limit(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, struct rlimit *limit); #endif @@ -429,9 +429,9 @@ APR_DECLARE(apr_status_t) apr_setprocattr_limit(apr_procattr_t *attr, * a standard unix fork. * @param proc The resulting process handle. * @param cont The pool to use. - * @deffunc apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) + * @deffunc apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_fork(apr_proc_t *proc, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont); #endif /** @@ -445,9 +445,9 @@ APR_DECLARE(apr_status_t) apr_fork(apr_proc_t *proc, apr_pool_t *cont); * @param attr the procattr we should use to determine how to create the new * process * @param cont The pool to use. - * @deffunc apr_status_t apr_create_process(apr_proc_t *new_proc, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *cont) + * @deffunc apr_status_t apr_proc_create(apr_proc_t *new_proc, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_create_process(apr_proc_t *new_proc, +APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc, const char *progname, const char * const *args, const char * const *env, @@ -463,14 +463,14 @@ APR_DECLARE(apr_status_t) apr_create_process(apr_proc_t *new_proc, * APR_NOWAIT -- return immediately regardless of if the * child is dead or not. * </PRE> - * @deffunc apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e waithow) + * @deffunc apr_status_t apr_proc_wait(apr_proc_t *proc, apr_wait_how_e waithow) * @tip The childs status is in the return code to this process. It is one of: * <PRE> * APR_CHILD_DONE -- child is no longer running. * APR_CHILD_NOTDONE -- child is still running. * </PRE> */ -APR_DECLARE(apr_status_t) apr_wait_proc(apr_proc_t *proc, +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, apr_wait_how_e waithow); /** @@ -488,9 +488,9 @@ APR_DECLARE(apr_status_t) apr_wait_proc(apr_proc_t *proc, * child is dead or not. * </PRE> * @param p Pool to allocate child information out of. - * @deffunc apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) + * @deffunc apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) */ -APR_DECLARE(apr_status_t) apr_wait_all_procs(apr_proc_t *proc, +APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p); @@ -498,7 +498,7 @@ APR_DECLARE(apr_status_t) apr_wait_all_procs(apr_proc_t *proc, /** * Detach the process from the controlling terminal. */ -apr_status_t apr_detach(void); +apr_status_t apr_proc_detach(void); #if APR_HAS_OTHER_CHILD @@ -513,9 +513,9 @@ apr_status_t apr_detach(void); * then the maintenance is invoked with reason * OC_REASON_UNWRITABLE. * @param p The pool to use for allocating memory. - * @deffunc void apr_register_other_child(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), void *data, apr_file_t *write_fd, apr_pool_t *p) + * @deffunc void apr_proc_other_child_register(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), void *data, apr_file_t *write_fd, apr_pool_t *p) */ -APR_DECLARE(void) apr_register_other_child(apr_proc_t *pid, +APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), @@ -526,36 +526,36 @@ APR_DECLARE(void) apr_register_other_child(apr_proc_t *pid, * Stop watching the specified process. * @param data The data to pass to the maintenance function. This is * used to find the process to unregister. - * @deffunc void apr_unregister_other_child(void *data) + * @deffunc void apr_proc_other_child_unregister(void *data) * @tip Since this can be called by a maintenance function while we're * scanning the other_children list, all scanners should protect * themself by loading ocr->next before calling any maintenance * function. */ -APR_DECLARE(void) apr_unregister_other_child(void *data); +APR_DECLARE(void) apr_proc_other_child_unregister(void *data); /** * Check on the specified process. If it is gone, call the maintenance * function. * @param pid The process to check. * @param status The status to pass to the maintenance function. - * @deffunc apr_status_t apr_reap_other_child(apr_proc_t *pid, int status); + * @deffunc apr_status_t apr_proc_other_child_read(apr_proc_t *pid, int status); */ -APR_DECLARE(apr_status_t) apr_reap_other_child(apr_proc_t *pid, int status); +APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *pid, int status); /** * Loop through all registered other_children and call the appropriate * maintenance function when necessary. - * @deffunc void apr_check_other_child(); + * @deffunc void apr_proc_other_child_check(); */ -APR_DECLARE(void) apr_check_other_child(void); +APR_DECLARE(void) apr_proc_other_child_check(void); /** * Ensure all the registered write_fds are still writable, otherwise * invoke the maintenance functions as appropriate. - * @deffunc void apr_probe_writable_fds() + * @deffunc void apr_proc_probe_writable_fds() */ -APR_DECLARE(void) apr_probe_writable_fds(void); +APR_DECLARE(void) apr_proc_probe_writable_fds(void); #endif /* APR_HAS_OTHER_CHILD */ @@ -563,9 +563,9 @@ APR_DECLARE(void) apr_probe_writable_fds(void); * Terminate a process. * @param proc The process to terminate. * @param sig How to kill the process. - * @deffunc apr_status_t apr_kill(apr_proc_t *proc, int sig) + * @deffunc apr_status_t apr_proc_kill(apr_proc_t *proc, int sig) */ -APR_DECLARE(apr_status_t) apr_kill(apr_proc_t *proc, int sig); +APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); /** * Register a process to be killed when a pool dies. @@ -579,9 +579,9 @@ APR_DECLARE(apr_status_t) apr_kill(apr_proc_t *proc, int sig); * just_wait -- wait forever for the process to complete * kill_only_once -- send SIGTERM and then wait * </PRE> - * @deffunc void apr_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) + * @deffunc void apr_pool_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) */ -APR_DECLARE(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, +APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how); #ifdef __cplusplus diff --git a/include/apr_time.h b/include/apr_time.h index 0f520aa8ffe..2aeac26c5ef 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -90,9 +90,9 @@ typedef apr_int32_t apr_interval_time_t; /** * return the current time - * @deffunc apr_time_t apr_now(void) + * @deffunc apr_time_t apr_time_now(void) */ -APR_DECLARE(apr_time_t) apr_now(void); +APR_DECLARE(apr_time_t) apr_time_now(void); typedef struct apr_exploded_time_t apr_exploded_time_t; /** diff --git a/include/apr_uuid.h b/include/apr_uuid.h index c33b70351a3..3b3e2e156d8 100644 --- a/include/apr_uuid.h +++ b/include/apr_uuid.h @@ -78,9 +78,9 @@ typedef struct { /** * Generate and return a (new) UUID * @param uuid The resulting UUID - * @deffunc void apr_get_uuid(apr_uuid_t *uuid) + * @deffunc void apr_uuid_get(apr_uuid_t *uuid) */ -APR_DECLARE(void) apr_get_uuid(apr_uuid_t *uuid); +APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid); /** * Format a UUID into a string, following the standard format @@ -88,17 +88,17 @@ APR_DECLARE(void) apr_get_uuid(apr_uuid_t *uuid); * be at least APR_UUID_FORMATTED_LENGTH + 1 bytes long to hold * the formatted UUID and a null terminator * @param uuid The UUID to format - * @deffunc void apr_format_uuid(char *buffer, const apr_uuid_t *uuid) + * @deffunc void apr_uuid_format(char *buffer, const apr_uuid_t *uuid) */ -APR_DECLARE(void) apr_format_uuid(char *buffer, const apr_uuid_t *uuid); +APR_DECLARE(void) apr_uuid_format(char *buffer, const apr_uuid_t *uuid); /** * Parse a standard-format string into a UUID * @param uuid The resulting UUID * @param uuid_str The formatted UUID - * @deffunc apr_status_t apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str) + * @deffunc apr_status_t apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str) */ -APR_DECLARE(apr_status_t) apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str); +APR_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str); #ifdef __cplusplus } diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index c351de97158..d620efb01df 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -118,7 +118,7 @@ apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, #define S_IFWHT 0160000 /* Whiteout */ #endif -/* Internal Flags for apr_open */ +/* Internal Flags for apr_file_open */ #define APR_OPENLINK 8192 /* Open a link itself, if supported */ #define APR_READCONTROL 4096 /* Read the file's owner/perms */ #define APR_WRITECONTROL 2048 /* Modifythe file's owner/perms */ diff --git a/lib/apr_pools.c b/lib/apr_pools.c index b23620621d2..cbf92d0011b 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -329,7 +329,7 @@ static void free_blocks(union block_hdr *blok) #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif old_free_list = block_freelist; @@ -381,7 +381,7 @@ static void free_blocks(union block_hdr *blok) #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif /* APR_HAS_THREADS */ #endif /* ALLOC_USE_MALLOC */ @@ -466,7 +466,7 @@ static apr_pool_t *permanent_pool; #define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) +APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int retcode)) { union block_hdr *blok; apr_pool_t *new_pool; @@ -474,7 +474,7 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif @@ -500,7 +500,7 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif @@ -536,16 +536,16 @@ static void dump_stats(void) } #endif -/* ### why do we have this, in addition to apr_make_sub_pool? */ -APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) +/* ### why do we have this, in addition to apr_pool_sub_make? */ +APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont) { apr_pool_t *newpool; if (cont) { - newpool = apr_make_sub_pool(cont, cont->apr_abort); + newpool = apr_pool_sub_make(cont, cont->apr_abort); } else { - newpool = apr_make_sub_pool(NULL, NULL); + newpool = apr_pool_sub_make(NULL, NULL); } if (newpool == NULL) { @@ -575,7 +575,7 @@ struct cleanup { struct cleanup *next; }; -APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup) (void *), apr_status_t (*child_cleanup) (void *)) { @@ -591,7 +591,7 @@ APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, } } -APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup) (void *)) { struct cleanup *c; @@ -612,10 +612,10 @@ APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, } } -APR_DECLARE(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, +APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, apr_status_t (*cleanup) (void *)) { - apr_kill_cleanup(p, data, cleanup); + apr_pool_cleanup_kill(p, data, cleanup); return (*cleanup) (data); } @@ -645,7 +645,7 @@ static void cleanup_pool_for_exec(apr_pool_t *p) } } -APR_DECLARE(void) apr_cleanup_for_exec(void) +APR_DECLARE(void) apr_pool_cleanup_for_exec(void) { #if !defined(WIN32) && !defined(OS2) /* @@ -661,13 +661,13 @@ APR_DECLARE(void) apr_cleanup_for_exec(void) #endif /* ndef WIN32 */ } -APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data) +APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) { /* do nothing cleanup routine */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) +APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *globalp) { #if APR_HAS_THREADS apr_status_t status; @@ -679,20 +679,20 @@ APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) stack_var_init(&s); #endif #if APR_HAS_THREADS - status = apr_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_lock_create(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, globalp); if (status != APR_SUCCESS) { - apr_destroy_lock(alloc_mutex); + apr_lock_destroy(alloc_mutex); return status; } - status = apr_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_lock_create(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, globalp); if (status != APR_SUCCESS) { - apr_destroy_lock(spawn_mutex); + apr_lock_destroy(spawn_mutex); return status; } #endif - permanent_pool = apr_make_sub_pool(globalp, NULL); + permanent_pool = apr_pool_sub_make(globalp, NULL); #ifdef ALLOC_STATS atexit(dump_stats); @@ -701,15 +701,15 @@ APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) return APR_SUCCESS; } -APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp) +APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp) { #if APR_HAS_THREADS - apr_destroy_lock(alloc_mutex); - apr_destroy_lock(spawn_mutex); + apr_lock_destroy(alloc_mutex); + apr_lock_destroy(spawn_mutex); alloc_mutex = NULL; spawn_mutex = NULL; #endif - apr_destroy_pool(globalp); + apr_pool_destroy(globalp); } /* We only want to lock the mutex if we are being called from apr_clear_pool. @@ -721,7 +721,7 @@ APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp) APR_DECLARE(void) apr_clear_pool(apr_pool_t *a) { while (a->sub_pools) { - apr_destroy_pool(a->sub_pools); + apr_pool_destroy(a->sub_pools); } /* * Don't hold the mutex during cleanups. @@ -753,12 +753,12 @@ APR_DECLARE(void) apr_clear_pool(apr_pool_t *a) #endif } -APR_DECLARE(void) apr_destroy_pool(apr_pool_t *a) +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) { apr_clear_pool(a); #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif @@ -775,17 +775,17 @@ APR_DECLARE(void) apr_destroy_pool(apr_pool_t *a) } #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif free_blocks(a->first); } -APR_DECLARE(apr_size_t) apr_bytes_in_pool(apr_pool_t *p) +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p) { return bytes_in_block_list(p->first); } -APR_DECLARE(apr_size_t) apr_bytes_in_free_blocks(void) +APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void) { return bytes_in_block_list(block_freelist); } @@ -963,7 +963,7 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif @@ -976,7 +976,7 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif @@ -999,14 +999,14 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) * User data management functions */ -APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, +APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *key, apr_status_t (*cleanup) (void *), apr_pool_t *cont) { int keylen = strlen(key); if (cont->prog_data == NULL) - cont->prog_data = apr_make_hash(cont); + cont->prog_data = apr_hash_make(cont); if (apr_hash_get(cont->prog_data, key, keylen) == NULL){ char *new_key = apr_pstrdup(cont, key); @@ -1016,11 +1016,11 @@ APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, apr_hash_set(cont->prog_data, key, keylen, data); } - apr_register_cleanup(cont, data, cleanup, cleanup); + apr_pool_cleanup_register(cont, data, cleanup, cleanup); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *cont) { if (cont->prog_data == NULL) *data = NULL; @@ -1087,11 +1087,11 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) /* must try another blok */ #if APR_HAS_THREADS - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); #endif nblok = new_block(2 * cur_len, NULL); #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); #endif memcpy(nblok->h.first_avail, blok->h.first_avail, cur_len); ps->vbuff.curpos = nblok->h.first_avail + cur_len; @@ -1102,12 +1102,12 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) if (ps->got_a_new_block) { debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); #if APR_HAS_THREADS - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); #endif blok->h.next = block_freelist; block_freelist = blok; #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); #endif } ps->blok = nblok; @@ -1202,7 +1202,7 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -APR_DECLARE(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, +APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) { struct process_chain *new = @@ -1237,7 +1237,7 @@ static void free_proc_chain(struct process_chain *procs) #ifndef NEED_WAITPID /* Pick up all defunct processes */ for (p = procs; p; p = p->next) { - if (apr_wait_proc(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { + if (apr_proc_wait(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { p->kill_how = kill_never; } } @@ -1248,20 +1248,20 @@ static void free_proc_chain(struct process_chain *procs) || (p->kill_how == kill_only_once)) { /* * Subprocess may be dead already. Only need the timeout if not. - * Note: apr_kill on Windows is TerminateProcess(), which is + * Note: apr_proc_kill on Windows is TerminateProcess(), which is * similar to a SIGKILL, so always give the process a timeout * under Windows before killing it. */ #ifdef WIN32 need_timeout = 1; #else - if (apr_kill(p->pid, SIGTERM) == APR_SUCCESS) { + if (apr_proc_kill(p->pid, SIGTERM) == APR_SUCCESS) { need_timeout = 1; } #endif } else if (p->kill_how == kill_always) { - apr_kill(p->pid, SIGKILL); + apr_proc_kill(p->pid, SIGKILL); } } @@ -1276,7 +1276,7 @@ static void free_proc_chain(struct process_chain *procs) */ for (p = procs; p; p = p->next) { if (p->kill_how == kill_after_timeout) { - apr_kill(p->pid, SIGKILL); + apr_proc_kill(p->pid, SIGKILL); } } #ifdef WIN32 @@ -1293,7 +1293,7 @@ static void free_proc_chain(struct process_chain *procs) /* Now wait for all the signaled processes to die */ for (p = procs; p; p = p->next) { if (p->kill_how != kill_never) { - (void) apr_wait_proc(p->pid, APR_WAIT); + (void) apr_proc_wait(p->pid, APR_WAIT); } } } diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c index b17aa28f375..a2052891b75 100644 --- a/locks/beos/crossproc.c +++ b/locks/beos/crossproc.c @@ -81,8 +81,8 @@ apr_status_t create_inter_lock(apr_lock_t *new) } new->ben_interproc = 0; new->sem_interproc = stat; - apr_register_cleanup(new->cntxt, (void *)new, lock_inter_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register(new->cntxt, (void *)new, lock_inter_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } @@ -116,7 +116,7 @@ apr_status_t destroy_inter_lock(apr_lock_t *lock) { apr_status_t stat; if ((stat = lock_inter_cleanup(lock)) == APR_SUCCESS) { - apr_kill_cleanup(lock->cntxt, lock, lock_inter_cleanup); + apr_pool_cleanup_kill(lock->cntxt, lock, lock_inter_cleanup); return APR_SUCCESS; } return stat; diff --git a/locks/beos/intraproc.c b/locks/beos/intraproc.c index 65cb5a3e57f..57f1c9b6794 100644 --- a/locks/beos/intraproc.c +++ b/locks/beos/intraproc.c @@ -76,8 +76,8 @@ apr_status_t create_intra_lock(apr_lock_t *new) } new->ben_intraproc = 0; new->sem_intraproc = stat; - apr_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register(new->cntxt, (void *)new, lock_intra_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } @@ -111,7 +111,7 @@ apr_status_t destroy_intra_lock(apr_lock_t *lock) { apr_status_t stat; if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) { - apr_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); + apr_pool_cleanup_kill(lock->cntxt, lock, lock_intra_cleanup); return APR_SUCCESS; } return stat; diff --git a/locks/beos/locks.c b/locks/beos/locks.c index 5302a1b59d5..43d9214659f 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -56,7 +56,7 @@ #include "apr_strings.h" #include "apr_portable.h" -apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, +apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *cont) { @@ -86,7 +86,7 @@ apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, return APR_SUCCESS; } -apr_status_t apr_lock(apr_lock_t *lock) +apr_status_t apr_lock_aquire(apr_lock_t *lock) { apr_status_t stat; @@ -103,7 +103,7 @@ apr_status_t apr_lock(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_unlock(apr_lock_t *lock) +apr_status_t apr_lock_release(apr_lock_t *lock) { apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { @@ -119,7 +119,7 @@ apr_status_t apr_unlock(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_destroy_lock(apr_lock_t *lock) +apr_status_t apr_lock_destroy(apr_lock_t *lock) { apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { @@ -135,7 +135,7 @@ apr_status_t apr_destroy_lock(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, +apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *cont) { apr_status_t stat; @@ -147,18 +147,18 @@ apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, return APR_SUCCESS; } -apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) +apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) { - return apr_get_userdata(data, key, lock->cntxt); + return apr_pool_userdata_get(data, key, lock->cntxt); } -apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, +apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_set_userdata(data, key, cleanup, lock->cntxt); + return apr_pool_userdata_set(data, key, cleanup, lock->cntxt); } -apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) +apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) { oslock->sem_interproc = lock->sem_interproc; oslock->sem_intraproc = lock->sem_intraproc; @@ -167,7 +167,7 @@ apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, +apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont) { if (cont == NULL) { diff --git a/locks/os2/locks.c b/locks/os2/locks.c index 45f769db1b4..55e48edf248 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -71,12 +71,12 @@ void setup_lock() static apr_status_t lock_cleanup(void *thelock) { apr_lock_t *lock = thelock; - return apr_destroy_lock(lock); + return apr_lock_destroy(lock); } -apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, +apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *cont) { apr_lock_t *new; @@ -102,14 +102,14 @@ apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, apr_locksco *lock = new; if (!rc) - apr_register_cleanup(cont, new, lock_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(cont, new, lock_cleanup, apr_pool_cleanup_null); return APR_OS2_STATUS(rc); } -apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, +apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *cont) { int rc; @@ -126,14 +126,14 @@ apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, rc = DosOpenMutexSem( (char *)fname, &(*lock)->hMutex ); if (!rc) - apr_register_cleanup(cont, *lock, lock_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(cont, *lock, lock_cleanup, apr_pool_cleanup_null); return APR_OS2_STATUS(rc); } -apr_status_t apr_lock(apr_lock_t *lock) +apr_status_t apr_lock_aquire(apr_lock_t *lock) { ULONG rc; @@ -149,7 +149,7 @@ apr_status_t apr_lock(apr_lock_t *lock) -apr_status_t apr_unlock(apr_lock_t *lock) +apr_status_t apr_lock_release(apr_lock_t *lock) { ULONG rc; @@ -164,14 +164,14 @@ apr_status_t apr_unlock(apr_lock_t *lock) -apr_status_t apr_destroy_lock(apr_lock_t *lock) +apr_status_t apr_lock_destroy(apr_lock_t *lock) { ULONG rc; apr_status_t stat = APR_SUCCESS; if (lock->owner == CurrentTid) { while (lock->lock_count > 0 && stat == APR_SUCCESS) - stat = apr_unlock(lock); + stat = apr_lock_release(lock); } if (stat != APR_SUCCESS) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index f140183e156..050e9c4e5e1 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -99,7 +99,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) return errno; } new->curr_locked = 0; - apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(new->cntxt, (void *)new, lock_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -136,7 +136,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_pool_cleanup_kill(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; @@ -222,7 +222,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) } new->curr_locked = 0; - apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(new->cntxt, (void *)new, lock_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -258,7 +258,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_pool_cleanup_kill(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; @@ -315,7 +315,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) new->curr_locked=0; unlink(new->fname); - apr_register_cleanup(new->cntxt, new, lock_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(new->cntxt, new, lock_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -351,7 +351,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_pool_cleanup_kill(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; @@ -395,7 +395,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) return errno; } new->curr_locked = 0; - apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); + apr_pool_cleanup_register(new->cntxt, (void *)new, lock_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -431,7 +431,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_pool_cleanup_kill(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index 514d6a83e10..cd9c0f666dd 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -108,8 +108,8 @@ apr_status_t apr_unix_create_intra_lock(apr_lock_t *new) } new->curr_locked = 0; - apr_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register(new->cntxt, (void *)new, lock_intra_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } @@ -143,7 +143,7 @@ apr_status_t apr_unix_destroy_intra_lock(apr_lock_t *lock) { apr_status_t stat; if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) { - apr_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); + apr_pool_cleanup_kill(lock->cntxt, lock, lock_intra_cleanup); return APR_SUCCESS; } return stat; diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 8104e22fe6f..84143302256 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -56,7 +56,7 @@ #include "apr_strings.h" #include "apr_portable.h" -apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, +apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *cont) { @@ -101,7 +101,7 @@ apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, return APR_SUCCESS; } -apr_status_t apr_lock(apr_lock_t *lock) +apr_status_t apr_lock_aquire(apr_lock_t *lock) { apr_status_t stat; #if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */ @@ -125,7 +125,7 @@ apr_status_t apr_lock(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_unlock(apr_lock_t *lock) +apr_status_t apr_lock_release(apr_lock_t *lock) { apr_status_t stat; @@ -150,7 +150,7 @@ apr_status_t apr_unlock(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_destroy_lock(apr_lock_t *lock) +apr_status_t apr_lock_destroy(apr_lock_t *lock) { apr_status_t stat; #if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */ @@ -176,7 +176,7 @@ apr_status_t apr_destroy_lock(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, +apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *cont) { apr_status_t stat; @@ -188,18 +188,18 @@ apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, return APR_SUCCESS; } -apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) +apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) { - return apr_get_userdata(data, key, lock->cntxt); + return apr_pool_userdata_get(data, key, lock->cntxt); } -apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, +apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_set_userdata(data, key, cleanup, lock->cntxt); + return apr_pool_userdata_set(data, key, cleanup, lock->cntxt); } -apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) +apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) { oslock->crossproc = lock->interproc; #if APR_HAS_THREADS @@ -211,7 +211,7 @@ apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, +apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont) { if (cont == NULL) { diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 701e2c2810e..fa802ce66dd 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -57,7 +57,7 @@ #include "win32/locks.h" #include "apr_portable.h" -APR_DECLARE(apr_status_t) apr_create_lock(apr_lock_t **lock, +APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, @@ -94,7 +94,7 @@ APR_DECLARE(apr_status_t) apr_create_lock(apr_lock_t **lock, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_child_init_lock(apr_lock_t **lock, +APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *cont) { @@ -115,7 +115,7 @@ APR_DECLARE(apr_status_t) apr_child_init_lock(apr_lock_t **lock, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_lock(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_aquire(apr_lock_t *lock) { DWORD rv; if (lock->scope == APR_INTRAPROCESS) { @@ -131,7 +131,7 @@ APR_DECLARE(apr_status_t) apr_lock(apr_lock_t *lock) return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_unlock(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock) { if (lock->scope == APR_INTRAPROCESS) { LeaveCriticalSection(&lock->section); @@ -144,7 +144,7 @@ APR_DECLARE(apr_status_t) apr_unlock(apr_lock_t *lock) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_destroy_lock(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock) { if (lock->scope == APR_INTRAPROCESS) { DeleteCriticalSection(&lock->section); @@ -157,27 +157,27 @@ APR_DECLARE(apr_status_t) apr_destroy_lock(apr_lock_t *lock) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_lockdata(apr_lock_t *lock, const char *key, +APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) { - return apr_get_userdata(data, key, lock->cntxt); + return apr_pool_userdata_get(data, key, lock->cntxt); } -APR_DECLARE(apr_status_t) apr_set_lockdata(apr_lock_t *lock, void *data, +APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_set_userdata(data, key, cleanup, lock->cntxt); + return apr_pool_userdata_set(data, key, cleanup, lock->cntxt); } -APR_DECLARE(apr_status_t) apr_get_os_lock(apr_os_lock_t *thelock, +APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *thelock, apr_lock_t *lock) { *thelock = lock->mutex; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_lock(apr_lock_t **lock, +APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont) { diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index b23620621d2..cbf92d0011b 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -329,7 +329,7 @@ static void free_blocks(union block_hdr *blok) #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif old_free_list = block_freelist; @@ -381,7 +381,7 @@ static void free_blocks(union block_hdr *blok) #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif /* APR_HAS_THREADS */ #endif /* ALLOC_USE_MALLOC */ @@ -466,7 +466,7 @@ static apr_pool_t *permanent_pool; #define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) +APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int retcode)) { union block_hdr *blok; apr_pool_t *new_pool; @@ -474,7 +474,7 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif @@ -500,7 +500,7 @@ APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif @@ -536,16 +536,16 @@ static void dump_stats(void) } #endif -/* ### why do we have this, in addition to apr_make_sub_pool? */ -APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) +/* ### why do we have this, in addition to apr_pool_sub_make? */ +APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont) { apr_pool_t *newpool; if (cont) { - newpool = apr_make_sub_pool(cont, cont->apr_abort); + newpool = apr_pool_sub_make(cont, cont->apr_abort); } else { - newpool = apr_make_sub_pool(NULL, NULL); + newpool = apr_pool_sub_make(NULL, NULL); } if (newpool == NULL) { @@ -575,7 +575,7 @@ struct cleanup { struct cleanup *next; }; -APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup) (void *), apr_status_t (*child_cleanup) (void *)) { @@ -591,7 +591,7 @@ APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data, } } -APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, +APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup) (void *)) { struct cleanup *c; @@ -612,10 +612,10 @@ APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data, } } -APR_DECLARE(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, +APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, apr_status_t (*cleanup) (void *)) { - apr_kill_cleanup(p, data, cleanup); + apr_pool_cleanup_kill(p, data, cleanup); return (*cleanup) (data); } @@ -645,7 +645,7 @@ static void cleanup_pool_for_exec(apr_pool_t *p) } } -APR_DECLARE(void) apr_cleanup_for_exec(void) +APR_DECLARE(void) apr_pool_cleanup_for_exec(void) { #if !defined(WIN32) && !defined(OS2) /* @@ -661,13 +661,13 @@ APR_DECLARE(void) apr_cleanup_for_exec(void) #endif /* ndef WIN32 */ } -APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data) +APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) { /* do nothing cleanup routine */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) +APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *globalp) { #if APR_HAS_THREADS apr_status_t status; @@ -679,20 +679,20 @@ APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) stack_var_init(&s); #endif #if APR_HAS_THREADS - status = apr_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_lock_create(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, globalp); if (status != APR_SUCCESS) { - apr_destroy_lock(alloc_mutex); + apr_lock_destroy(alloc_mutex); return status; } - status = apr_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_lock_create(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, globalp); if (status != APR_SUCCESS) { - apr_destroy_lock(spawn_mutex); + apr_lock_destroy(spawn_mutex); return status; } #endif - permanent_pool = apr_make_sub_pool(globalp, NULL); + permanent_pool = apr_pool_sub_make(globalp, NULL); #ifdef ALLOC_STATS atexit(dump_stats); @@ -701,15 +701,15 @@ APR_DECLARE(apr_status_t) apr_init_alloc(apr_pool_t *globalp) return APR_SUCCESS; } -APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp) +APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp) { #if APR_HAS_THREADS - apr_destroy_lock(alloc_mutex); - apr_destroy_lock(spawn_mutex); + apr_lock_destroy(alloc_mutex); + apr_lock_destroy(spawn_mutex); alloc_mutex = NULL; spawn_mutex = NULL; #endif - apr_destroy_pool(globalp); + apr_pool_destroy(globalp); } /* We only want to lock the mutex if we are being called from apr_clear_pool. @@ -721,7 +721,7 @@ APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp) APR_DECLARE(void) apr_clear_pool(apr_pool_t *a) { while (a->sub_pools) { - apr_destroy_pool(a->sub_pools); + apr_pool_destroy(a->sub_pools); } /* * Don't hold the mutex during cleanups. @@ -753,12 +753,12 @@ APR_DECLARE(void) apr_clear_pool(apr_pool_t *a) #endif } -APR_DECLARE(void) apr_destroy_pool(apr_pool_t *a) +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) { apr_clear_pool(a); #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif @@ -775,17 +775,17 @@ APR_DECLARE(void) apr_destroy_pool(apr_pool_t *a) } #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif free_blocks(a->first); } -APR_DECLARE(apr_size_t) apr_bytes_in_pool(apr_pool_t *p) +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p) { return bytes_in_block_list(p->first); } -APR_DECLARE(apr_size_t) apr_bytes_in_free_blocks(void) +APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void) { return bytes_in_block_list(block_freelist); } @@ -963,7 +963,7 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); } #endif @@ -976,7 +976,7 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) #if APR_HAS_THREADS if (alloc_mutex) { - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); } #endif @@ -999,14 +999,14 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) * User data management functions */ -APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, +APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *key, apr_status_t (*cleanup) (void *), apr_pool_t *cont) { int keylen = strlen(key); if (cont->prog_data == NULL) - cont->prog_data = apr_make_hash(cont); + cont->prog_data = apr_hash_make(cont); if (apr_hash_get(cont->prog_data, key, keylen) == NULL){ char *new_key = apr_pstrdup(cont, key); @@ -1016,11 +1016,11 @@ APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key, apr_hash_set(cont->prog_data, key, keylen, data); } - apr_register_cleanup(cont, data, cleanup, cleanup); + apr_pool_cleanup_register(cont, data, cleanup, cleanup); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *cont) { if (cont->prog_data == NULL) *data = NULL; @@ -1087,11 +1087,11 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) /* must try another blok */ #if APR_HAS_THREADS - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); #endif nblok = new_block(2 * cur_len, NULL); #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); #endif memcpy(nblok->h.first_avail, blok->h.first_avail, cur_len); ps->vbuff.curpos = nblok->h.first_avail + cur_len; @@ -1102,12 +1102,12 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) if (ps->got_a_new_block) { debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); #if APR_HAS_THREADS - apr_lock(alloc_mutex); + apr_lock_aquire(alloc_mutex); #endif blok->h.next = block_freelist; block_freelist = blok; #if APR_HAS_THREADS - apr_unlock(alloc_mutex); + apr_lock_release(alloc_mutex); #endif } ps->blok = nblok; @@ -1202,7 +1202,7 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -APR_DECLARE(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, +APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) { struct process_chain *new = @@ -1237,7 +1237,7 @@ static void free_proc_chain(struct process_chain *procs) #ifndef NEED_WAITPID /* Pick up all defunct processes */ for (p = procs; p; p = p->next) { - if (apr_wait_proc(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { + if (apr_proc_wait(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { p->kill_how = kill_never; } } @@ -1248,20 +1248,20 @@ static void free_proc_chain(struct process_chain *procs) || (p->kill_how == kill_only_once)) { /* * Subprocess may be dead already. Only need the timeout if not. - * Note: apr_kill on Windows is TerminateProcess(), which is + * Note: apr_proc_kill on Windows is TerminateProcess(), which is * similar to a SIGKILL, so always give the process a timeout * under Windows before killing it. */ #ifdef WIN32 need_timeout = 1; #else - if (apr_kill(p->pid, SIGTERM) == APR_SUCCESS) { + if (apr_proc_kill(p->pid, SIGTERM) == APR_SUCCESS) { need_timeout = 1; } #endif } else if (p->kill_how == kill_always) { - apr_kill(p->pid, SIGKILL); + apr_proc_kill(p->pid, SIGKILL); } } @@ -1276,7 +1276,7 @@ static void free_proc_chain(struct process_chain *procs) */ for (p = procs; p; p = p->next) { if (p->kill_how == kill_after_timeout) { - apr_kill(p->pid, SIGKILL); + apr_proc_kill(p->pid, SIGKILL); } } #ifdef WIN32 @@ -1293,7 +1293,7 @@ static void free_proc_chain(struct process_chain *procs) /* Now wait for all the signaled processes to die */ for (p = procs; p; p = p->next) { if (p->kill_how != kill_never) { - (void) apr_wait_proc(p->pid, APR_WAIT); + (void) apr_proc_wait(p->pid, APR_WAIT); } } } diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 7d8e112750b..40378d20d03 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -48,7 +48,7 @@ static const char *pretty_path (const char *name) return p + 1; } -APR_DECLARE(apr_status_t) apr_initopt(apr_getopt_t **os, apr_pool_t *cont, +APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, int argc, const char *const *argv) { void *argv_buff; diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index 4cd0d36db46..547cc4e2aef 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -105,12 +105,12 @@ static void get_random_info(unsigned char node[NODE_LENGTH]) } r; - apr_MD5Init(&c); + apr_md5_init(&c); r.pid = getpid(); gettimeofday(&r.t, (struct timezone *)0); gethostname(r.hostname, 256); - apr_MD5Update(&c, (const unsigned char *)&r, sizeof(r)); - apr_MD5Final(seed, &c); + apr_md5_update(&c, (const unsigned char *)&r, sizeof(r)); + apr_md5_final(seed, &c); memcpy(node, seed, NODE_LENGTH); /* use a subset of the seed bytes */ #endif @@ -196,7 +196,7 @@ static void get_current_time(apr_uint64_t *timestamp) *timestamp = time_now + fudge; } -void apr_get_uuid(apr_uuid_t *uuid) +void apr_uuid_get(apr_uuid_t *uuid) { apr_uint64_t timestamp; unsigned char *d = uuid->data; diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 0bc8629a393..40b16b05f0b 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -71,7 +71,7 @@ static apr_other_child_rec_t *other_children = NULL; -APR_DECLARE(void) apr_register_other_child(apr_proc_t *pid, +APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), void *data, apr_file_t *write_fd, apr_pool_t *p) { @@ -91,7 +91,7 @@ APR_DECLARE(void) apr_register_other_child(apr_proc_t *pid, other_children = ocr; } -APR_DECLARE(void) apr_unregister_other_child(void *data) +APR_DECLARE(void) apr_proc_other_child_unregister(void *data) { apr_other_child_rec_t **pocr, *nocr; @@ -108,7 +108,7 @@ APR_DECLARE(void) apr_unregister_other_child(void *data) /* test to ensure that the write_fds are all still writable, otherwise * invoke the maintenance functions as appropriate */ -void apr_probe_writable_fds(void) +void apr_proc_probe_writable_fds(void) { fd_set writable_fds; int fd_max; @@ -156,7 +156,7 @@ void apr_probe_writable_fds(void) } } -APR_DECLARE(apr_status_t) apr_reap_other_child(apr_proc_t *pid, int status) +APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *pid, int status) { apr_other_child_rec_t *ocr, *nocr; @@ -172,7 +172,7 @@ APR_DECLARE(apr_status_t) apr_reap_other_child(apr_proc_t *pid, int status) return APR_CHILD_NOTDONE; } -APR_DECLARE(void) apr_check_other_child(void) +APR_DECLARE(void) apr_proc_other_child_check(void) { apr_other_child_rec_t *ocr, *nocr; pid_t waitret; diff --git a/misc/unix/start.c b/misc/unix/start.c index f208c20197f..41e9327b518 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -76,7 +76,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_SUCCESS; } - if (apr_create_pool(&global_apr_pool, NULL) != APR_SUCCESS) { + if (apr_pool_create(&global_apr_pool, NULL) != APR_SUCCESS) { return APR_ENOPOOL; } @@ -94,7 +94,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_EEXIST; } #endif - status = apr_init_alloc(global_apr_pool); + status = apr_pool_alloc_init(global_apr_pool); return status; } @@ -104,7 +104,7 @@ APR_DECLARE(void) apr_terminate(void) if (initialized) { return; } - apr_term_alloc(global_apr_pool); + apr_pool_alloc_term(global_apr_pool); } APR_DECLARE(apr_status_t) apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont) diff --git a/misc/unix/uuid.c b/misc/unix/uuid.c index dc358081880..00a533fc562 100644 --- a/misc/unix/uuid.c +++ b/misc/unix/uuid.c @@ -60,7 +60,7 @@ #include "apr_lib.h" -APR_DECLARE(void) apr_format_uuid(char *buffer, const apr_uuid_t *uuid) +APR_DECLARE(void) apr_uuid_format(char *buffer, const apr_uuid_t *uuid) { const unsigned char *d = uuid->data; @@ -95,7 +95,7 @@ static unsigned char parse_hexpair(const char *s) return (unsigned char)result; } -APR_DECLARE(apr_status_t) apr_parse_uuid(apr_uuid_t *uuid, +APR_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str) { int i; diff --git a/misc/win32/getuuid.c b/misc/win32/getuuid.c index 465ef215c10..e1b5b4b0e4f 100644 --- a/misc/win32/getuuid.c +++ b/misc/win32/getuuid.c @@ -62,7 +62,7 @@ #include "apr.h" #include "apr_uuid.h" -APR_DECLARE(void) apr_get_uuid(apr_uuid_t *uuid) +APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid) { GUID guid; diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 948fc680a0c..09ae1da0149 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -120,7 +120,7 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, #ifdef BEOS /* XXX: mmap shouldn't really change the seek offset */ - apr_seek(file, APR_SET, &offset); + apr_file_seek(file, APR_SET, &offset); if (flag & APR_MMAP_WRITE) { native_flags |= B_WRITE_AREA; } @@ -166,8 +166,8 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, (*new)->cntxt = cont; /* register the cleanup... */ - apr_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void*)(*new), mmap_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } @@ -179,7 +179,7 @@ apr_status_t apr_mmap_delete(apr_mmap_t *mmap) return APR_ENOENT; if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { - apr_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); + apr_pool_cleanup_kill(mmap->cntxt, mmap, mmap_cleanup); return APR_SUCCESS; } return rv; diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index 28c5224694d..b42ab98e886 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -147,8 +147,8 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, (*new)->cntxt = cont; /* register the cleanup... */ - apr_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, - apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void*)(*new), mmap_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } @@ -157,7 +157,7 @@ APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap) apr_status_t rv; if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { - apr_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); + apr_pool_cleanup_kill(mmap->cntxt, mmap, mmap_cleanup); return APR_SUCCESS; } return rv; diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index 561e83d6d4e..6282877cb57 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -67,7 +67,7 @@ * select for R4.5 of BeOS. So here we use code that uses the write * bits. */ -apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num); if ((*new) == NULL) { @@ -84,7 +84,7 @@ apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con return APR_SUCCESS; } -apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) { if (event & APR_POLLIN) { @@ -102,7 +102,7 @@ apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, return APR_SUCCESS; } -apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) { @@ -146,7 +146,7 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, return APR_SUCCESS; } -apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { apr_int16_t revents = 0; char data[1]; @@ -190,7 +190,7 @@ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_ return APR_SUCCESS; } -apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) +apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { FD_CLR(sock->socketdes, aprset->read); FD_CLR(sock->socketdes, aprset->read); @@ -198,7 +198,7 @@ apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) return APR_SUCCESS; } -apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t event) +apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t event) { if (event & APR_POLLIN) { FD_ZERO(aprset->read); @@ -213,15 +213,15 @@ apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t event) return APR_SUCCESS; } -apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) +apr_status_t apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) { - return apr_get_userdata(data, key, pollfd->cntxt); + return apr_pool_userdata_get(data, key, pollfd->cntxt); } -apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, +apr_status_t apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_set_userdata(data, key, cleanup, pollfd->cntxt); + return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt); } #endif /* BEOS_BONE */ diff --git a/network_io/os2/poll.c b/network_io/os2/poll.c index 9fe63222dd5..5b6850d3295 100644 --- a/network_io/os2/poll.c +++ b/network_io/os2/poll.c @@ -62,7 +62,7 @@ /* OS/2 doesn't have a poll function, implement using OS/2 style select */ -apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { *new = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t)); @@ -93,7 +93,7 @@ apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con -apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) { int i; @@ -129,7 +129,7 @@ apr_status_t apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, { int i; int rv = 0; - apr_time_t starttime = apr_now(); + apr_time_t starttime = apr_time_now(); do { for (i=0; i<pollfdset->num_total; i++) { @@ -143,7 +143,7 @@ apr_status_t apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, timeout >= 0 ? timeout / 1000 : -1); if (rv < 0 && sock_errno() == SOCEINTR && timeout >= 0 ) { - apr_interval_time_t elapsed = apr_now() - starttime; + apr_interval_time_t elapsed = apr_time_now() - starttime; if (timeout <= elapsed) break; @@ -158,7 +158,7 @@ apr_status_t apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, -apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { int i; @@ -180,7 +180,7 @@ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_ -apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) { int start, *count, pos; @@ -218,7 +218,7 @@ apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, -apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) +apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { - return apr_mask_poll_socket(aprset, sock, APR_POLLIN|APR_POLLOUT|APR_POLLPRI); + return apr_poll_socket_mask(aprset, sock, APR_POLLIN|APR_POLLOUT|APR_POLLPRI); } diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 7c264f6d3e3..e3833e418ff 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -126,7 +126,7 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr->pool = p; } -apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, +apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, apr_pool_t *cont) { int family = ofamily; @@ -163,8 +163,8 @@ apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, (*new)->timeout = -1; (*new)->nonblock = FALSE; - apr_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -178,9 +178,9 @@ apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) } } -apr_status_t apr_close_socket(apr_socket_t *thesocket) +apr_status_t apr_socket_close(apr_socket_t *thesocket) { - apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); + apr_pool_cleanup_kill(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } @@ -223,8 +223,8 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return APR_OS2_STATUS(sock_errno()); } - apr_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -246,27 +246,27 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) -apr_status_t apr_get_socketdata(void **data, const char *key, +apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *socket) { - return apr_get_userdata(data, key, socket->cntxt); + return apr_pool_userdata_get(data, key, socket->cntxt); } -apr_status_t apr_set_socketdata(apr_socket_t *socket, void *data, const char *key, +apr_status_t apr_socket_data_set(apr_socket_t *socket, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_set_userdata(data, key, cleanup, socket->cntxt); + return apr_pool_userdata_set(data, key, cleanup, socket->cntxt); } -apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) +apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->socketdes; return APR_SUCCESS; } -apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, +apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont) { @@ -288,13 +288,13 @@ apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, (*apr_sock)->remote_addr->salen); } - apr_register_cleanup((*apr_sock)->cntxt, (void *)(*apr_sock), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } -apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) +apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index c3305e8d80b..d6ef1fb0a3b 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -57,7 +57,7 @@ #ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ -apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t)); if ((*new) == NULL) { @@ -115,7 +115,7 @@ static apr_int16_t get_revent(apr_int16_t event) return rv; } -apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) { int i = 0; @@ -153,7 +153,7 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, return APR_SUCCESS; } -apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { int i = 0; @@ -167,7 +167,7 @@ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_ return APR_SUCCESS; } -apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) { apr_int16_t newevents; @@ -187,7 +187,7 @@ apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, return APR_SUCCESS; } -apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) +apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { int i = 0; while(i < aprset->curpos && aprset->pollset[i].fd != sock->socketdes) { @@ -204,7 +204,7 @@ apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) return APR_SUCCESS; } -apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events) +apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) { int i = 0; apr_int16_t newevents; @@ -222,7 +222,7 @@ apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events) #else /* Use select to mimic poll */ -apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num); if ((*new) == NULL) { @@ -239,7 +239,7 @@ apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con return APR_SUCCESS; } -apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) { if (event & APR_POLLIN) { @@ -257,7 +257,7 @@ apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, return APR_SUCCESS; } -apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, +apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) { @@ -301,7 +301,7 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, return APR_SUCCESS; } -apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { apr_int16_t revents = 0; char data[1]; @@ -348,7 +348,7 @@ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_ return APR_SUCCESS; } -apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) +apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { FD_CLR(sock->socketdes, aprset->read); FD_CLR(sock->socketdes, aprset->except); @@ -356,7 +356,7 @@ apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) return APR_SUCCESS; } -apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t event) +apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t event) { if (event & APR_POLLIN) { FD_ZERO(aprset->read); @@ -373,15 +373,15 @@ apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t event) #endif -apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) +apr_status_t apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) { - return apr_get_userdata(data, key, pollfd->cntxt); + return apr_pool_userdata_get(data, key, pollfd->cntxt); } -apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, +apr_status_t apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_set_userdata(data, key, cleanup, pollfd->cntxt); + return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt); } #if APR_FILES_AS_SOCKETS diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 5ebe4e9eec0..c50e5939224 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -70,7 +70,7 @@ #include <stdlib.h> #endif -APR_DECLARE(apr_status_t) apr_set_port(apr_sockaddr_t *sockaddr, +APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, apr_port_t port) { /* XXX IPv6: assumes sin_port and sin6_port at same offset */ @@ -79,10 +79,10 @@ APR_DECLARE(apr_status_t) apr_set_port(apr_sockaddr_t *sockaddr, } /* XXX assumes IPv4... I don't think this function is needed anyway - * since we have apr_getaddrinfo(), but we need to clean up Apache's + * since we have apr_sockaddr_info_get(), but we need to clean up Apache's * listen.c a bit more first. */ -APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr, +APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, const char *addr) { apr_uint32_t ipaddr; @@ -105,7 +105,7 @@ APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_port(apr_port_t *port, +APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, apr_sockaddr_t *sockaddr) { /* XXX IPv6 - assumes sin_port and sin6_port at same offset */ @@ -113,7 +113,7 @@ APR_DECLARE(apr_status_t) apr_get_port(apr_port_t *port, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_ipaddr(char **addr, +APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr) { *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len); @@ -154,7 +154,7 @@ static void set_sockaddr_vars(apr_sockaddr_t *addr, int family) #endif } -APR_DECLARE(apr_status_t) apr_get_sockaddr(apr_sockaddr_t **sa, +APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock) { @@ -303,7 +303,7 @@ static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa, } #endif -APR_DECLARE(apr_status_t) apr_getaddrinfo(apr_sockaddr_t **sa, +APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 77a39501bef..b29f6429412 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -121,7 +121,7 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr->pool = p; } -apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, +apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, apr_pool_t *cont) { int family = ofamily; @@ -155,8 +155,8 @@ apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type, set_socket_vars(*new, family); (*new)->timeout = -1; - apr_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -165,9 +165,9 @@ apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) return (shutdown(thesocket->socketdes, how) == -1) ? errno : APR_SUCCESS; } -apr_status_t apr_close_socket(apr_socket_t *thesocket) +apr_status_t apr_socket_close(apr_socket_t *thesocket) { - apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); + apr_pool_cleanup_kill(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } @@ -241,8 +241,8 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn (*new)->local_interface_unknown = 1; } - apr_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -283,24 +283,24 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) } } -apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock) +apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *sock) { - return apr_get_userdata(data, key, sock->cntxt); + return apr_pool_userdata_get(data, key, sock->cntxt); } -apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, +apr_status_t apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_set_userdata(data, key, cleanup, sock->cntxt); + return apr_pool_userdata_set(data, key, cleanup, sock->cntxt); } -apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) +apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->socketdes; return APR_SUCCESS; } -apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, +apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont) { @@ -325,13 +325,13 @@ apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, (*apr_sock)->remote_addr->salen); } - apr_register_cleanup((*apr_sock)->cntxt, (void *)(*apr_sock), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } -apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, +apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { if ((*sock) == NULL) { diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 5baa007680e..5d01f313aea 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -60,7 +60,7 @@ #include <time.h> -APR_DECLARE(apr_status_t) apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, +APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { (*new) = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t) * num); @@ -80,7 +80,7 @@ APR_DECLARE(apr_status_t) apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_add_poll_socket(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) { @@ -142,7 +142,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_revents(apr_int16_t *event, +APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { @@ -198,20 +198,20 @@ APR_DECLARE(apr_status_t) apr_get_revents(apr_int16_t *event, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_polldata(apr_pollfd_t *pollfd, +APR_DECLARE(apr_status_t) apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) { - return apr_get_userdata(data, key, pollfd->cntxt); + return apr_pool_userdata_get(data, key, pollfd->cntxt); } -APR_DECLARE(apr_status_t) apr_set_polldata(apr_pollfd_t *pollfd, void *data, +APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup)(void *)) { - return apr_set_userdata(data, key, cleanup, pollfd->cntxt); + return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt); } -APR_DECLARE(apr_status_t) apr_mask_poll_socket(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) { @@ -230,13 +230,13 @@ APR_DECLARE(apr_status_t) apr_mask_poll_socket(apr_pollfd_t *aprset, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_remove_poll_socket(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { - return apr_mask_poll_socket(aprset, sock, ~0); + return apr_poll_socket_mask(aprset, sock, ~0); } -APR_DECLARE(apr_status_t) apr_clear_poll_sockets(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) { if (events & APR_POLLIN) { diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 9d792332c93..21559692fef 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -112,7 +112,7 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) sizeof(apr_sockaddr_t)); } -APR_DECLARE(apr_status_t) apr_create_socket(apr_socket_t **new, int ofamily, +APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, int type, apr_pool_t *cont) { int family = ofamily; @@ -153,8 +153,8 @@ APR_DECLARE(apr_status_t) apr_create_socket(apr_socket_t **new, int ofamily, (*new)->timeout = -1; (*new)->disconnected = 0; - apr_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -186,9 +186,9 @@ APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, } } -APR_DECLARE(apr_status_t) apr_close_socket(apr_socket_t *thesocket) +APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket) { - apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); + apr_pool_cleanup_kill(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } @@ -260,8 +260,8 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, (*new)->local_interface_unknown = 1; } - apr_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -299,27 +299,27 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_socketdata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, apr_socket_t *socket) { - return apr_get_userdata(data, key, socket->cntxt); + return apr_pool_userdata_get(data, key, socket->cntxt); } -APR_DECLARE(apr_status_t) apr_set_socketdata(apr_socket_t *socket, void *data, +APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *socket, void *data, const char *key, apr_status_t (*cleanup)(void *)) { - return apr_set_userdata(data, key, cleanup, socket->cntxt); + return apr_pool_userdata_set(data, key, cleanup, socket->cntxt); } -APR_DECLARE(apr_status_t) apr_get_os_sock(apr_os_sock_t *thesock, +APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->sock; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_make_os_sock(apr_socket_t **apr_sock, +APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont) { @@ -344,13 +344,13 @@ APR_DECLARE(apr_status_t) apr_make_os_sock(apr_socket_t **apr_sock, (*apr_sock)->remote_addr->pool = cont; } - apr_register_cleanup((*apr_sock)->cntxt, (void *)(*apr_sock), - socket_cleanup, apr_null_cleanup); + apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), + socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_sock(apr_socket_t **sock, +APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 92d849b17e8..6a9be850f30 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -/* apr_getpass.c: abstraction to provide for obtaining a password from the +/* apr_password_get.c: abstraction to provide for obtaining a password from the * command line in whatever way the OS supports. In the best case, it's a * wrapper for the system library's getpass() routine; otherwise, we * use one we define ourselves. @@ -212,7 +212,7 @@ static char *getpass(const char *prompt) * but the caller is *not* made aware of it. */ -APR_DECLARE(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, size_t *bufsiz) +APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, size_t *bufsiz) { char *pw_got = NULL; int result = 0; diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index 81d90e26c35..8387ff2a644 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -86,7 +86,7 @@ */ /* - * The apr_MD5Encode() routine uses much code obtained from the FreeBSD 3.0 + * The apr_md5_encode() routine uses much code obtained from the FreeBSD 3.0 * MD5 crypt() function, which is licenced as follows: * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): @@ -146,7 +146,7 @@ static unsigned char PADDING[64] = }; #if APR_CHARSET_EBCDIC -static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_MD5Encode() */ +static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_md5_encode() */ #endif /* F, G, H and I are basic MD5 functions. @@ -186,7 +186,7 @@ static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_MD5Encode() */ /* MD5 initialization. Begins an MD5 operation, writing a new context. */ -APR_DECLARE(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context) +APR_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context) { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ @@ -205,7 +205,7 @@ APR_DECLARE(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context) * to be used for translating the content before calculating the * digest. */ -APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, +APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context, apr_xlate_t *xlate) { apr_status_t rv; @@ -229,7 +229,7 @@ APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, operation, processing another message block, and updating the context. */ -APR_DECLARE(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, +APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) { @@ -311,7 +311,7 @@ APR_DECLARE(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ -APR_DECLARE(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], +APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context) { unsigned char bits[8]; @@ -321,17 +321,17 @@ APR_DECLARE(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], Encode(bits, context->count, 8); #if APR_HAS_XLATE - /* apr_MD5Update() should not translate for this final round. */ + /* apr_md5_update() should not translate for this final round. */ context->xlate = NULL; #endif /*APR_HAS_XLATE*/ /* Pad out to 56 mod 64. */ idx = (unsigned int) ((context->count[0] >> 3) & 0x3f); padLen = (idx < 56) ? (56 - idx) : (120 - idx); - apr_MD5Update(context, PADDING, padLen); + apr_md5_update(context, PADDING, padLen); /* Append length (before padding) */ - apr_MD5Update(context, bits, 8); + apr_md5_update(context, bits, 8); /* Store state in digest */ Encode(digest, context->state, MD5_DIGESTSIZE); @@ -491,7 +491,7 @@ static void to64(char *s, unsigned long v, int n) } } -APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, +APR_DECLARE(apr_status_t) apr_md5_encode(const char *pw, const char *salt, char *result, size_t nbytes) { /* @@ -536,36 +536,36 @@ APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, /* * 'Time to make the doughnuts..' */ - apr_MD5Init(&ctx); + apr_md5_init(&ctx); #if APR_CHARSET_EBCDIC - apr_MD5SetXlate(&ctx, xlate_ebcdic_to_ascii); + apr_md5_set_xlate(&ctx, xlate_ebcdic_to_ascii); #endif /* * The password first, since that is what is most unknown */ - apr_MD5Update(&ctx, (unsigned char *)pw, strlen(pw)); + apr_md5_update(&ctx, (unsigned char *)pw, strlen(pw)); /* * Then our magic string */ - apr_MD5Update(&ctx, (unsigned char *)apr1_id, strlen(apr1_id)); + apr_md5_update(&ctx, (unsigned char *)apr1_id, strlen(apr1_id)); /* * Then the raw salt */ - apr_MD5Update(&ctx, (unsigned char *)sp, sl); + apr_md5_update(&ctx, (unsigned char *)sp, sl); /* * Then just as many characters of the MD5(pw, salt, pw) */ - apr_MD5Init(&ctx1); - apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); - apr_MD5Update(&ctx1, (unsigned char *)sp, sl); - apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); - apr_MD5Final(final, &ctx1); + apr_md5_init(&ctx1); + apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_md5_update(&ctx1, (unsigned char *)sp, sl); + apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_md5_final(final, &ctx1); for (pl = strlen(pw); pl > 0; pl -= MD5_DIGESTSIZE) { - apr_MD5Update(&ctx, final, + apr_md5_update(&ctx, final, (pl > MD5_DIGESTSIZE) ? MD5_DIGESTSIZE : pl); } @@ -579,10 +579,10 @@ APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, */ for (i = strlen(pw); i != 0; i >>= 1) { if (i & 1) { - apr_MD5Update(&ctx, final, 1); + apr_md5_update(&ctx, final, 1); } else { - apr_MD5Update(&ctx, (unsigned char *)pw, 1); + apr_md5_update(&ctx, (unsigned char *)pw, 1); } } @@ -594,7 +594,7 @@ APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, strncat(passwd, sp, sl); strcat(passwd, "$"); - apr_MD5Final(final, &ctx); + apr_md5_final(final, &ctx); /* * And now, just to make sure things don't run too fast.. @@ -602,28 +602,28 @@ APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, * need 30 seconds to build a 1000 entry dictionary... */ for (i = 0; i < 1000; i++) { - apr_MD5Init(&ctx1); + apr_md5_init(&ctx1); if (i & 1) { - apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); } else { - apr_MD5Update(&ctx1, final, MD5_DIGESTSIZE); + apr_md5_update(&ctx1, final, MD5_DIGESTSIZE); } if (i % 3) { - apr_MD5Update(&ctx1, (unsigned char *)sp, sl); + apr_md5_update(&ctx1, (unsigned char *)sp, sl); } if (i % 7) { - apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); } if (i & 1) { - apr_MD5Update(&ctx1, final, MD5_DIGESTSIZE); + apr_md5_update(&ctx1, final, MD5_DIGESTSIZE); } else { - apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); } - apr_MD5Final(final,&ctx1); + apr_md5_final(final,&ctx1); } p = passwd + strlen(passwd); @@ -647,12 +647,12 @@ APR_DECLARE(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, /* * Validate a plaintext password against a smashed one. Use either - * crypt() (if available) or apr_MD5Encode(), depending upon the format + * crypt() (if available) or apr_md5_encode(), depending upon the format * of the smashed input password. Return APR_SUCCESS if they match, or * APR_EMISMATCH if they don't. */ -APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, +APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, const char *hash) { char sample[120]; @@ -663,7 +663,7 @@ APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, /* * The hash was created using our custom algorithm. */ - apr_MD5Encode(passwd, hash, sample, sizeof(sample)); + apr_md5_encode(passwd, hash, sample, sizeof(sample)); } else { /* diff --git a/shmem/os2/shmem.c b/shmem/os2/shmem.c index 6e4dcbebffa..49713f40695 100644 --- a/shmem/os2/shmem.c +++ b/shmem/os2/shmem.c @@ -121,7 +121,7 @@ apr_status_t apr_shm_free(struct shmem_t *m, void *entity) -apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) +apr_status_t apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) { *name = NULL; return APR_ANONYMOUS; @@ -129,14 +129,14 @@ apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) -apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) +apr_status_t apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) { return APR_ANONYMOUS; } -apr_status_t apr_open_shmem(struct shmem_t *m) +apr_status_t apr_shm_open(struct shmem_t *m) { int rc; diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index f7c5c99297f..1abcd7f1fe9 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -110,7 +110,7 @@ apr_status_t apr_shm_free(struct shmem_t *shared, void *entity) return APR_SUCCESS; } -apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) +apr_status_t apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) { #if APR_USES_ANONYMOUS_SHM *name = NULL; @@ -125,7 +125,7 @@ apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) #endif } -apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) +apr_status_t apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) { #if APR_USES_ANONYMOUS_SHM return APR_ANONYMOUS; @@ -139,7 +139,7 @@ apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) #endif } -apr_status_t apr_open_shmem(struct shmem_t *c) +apr_status_t apr_shm_open(struct shmem_t *c) { #if APR_USES_ANONYMOUS_SHM diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 0f21c6d6b31..76dacc90c28 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -499,7 +499,7 @@ static char *conv_apr_sockaddr(apr_sockaddr_t *sa, char *buf_end, int *len) /* XXX IPv6: this assumes sin_port and sin6_port are at same offset */ p = conv_10(ntohs(sa->sa.sin.sin_port), TRUE, &is_negative, p, &sub_len); *--p = ':'; - apr_get_ipaddr(&ipaddr_str, sa); + apr_sockaddr_ip_get(&ipaddr_str, sa); sub_len = strlen(ipaddr_str); #if APR_HAVE_IPV6 if (sa->sa.sin.sin_family == APR_INET6 && diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 78a06c743d7..142e93dd127 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -127,7 +127,7 @@ static apr_hash_entry_t **alloc_array(apr_hash_t *ht, apr_size_t max) return apr_pcalloc(ht->pool, sizeof(*ht->array) * (max + 1)); } -APR_DECLARE(apr_hash_t *) apr_make_hash(apr_pool_t *pool) +APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) { apr_hash_t *ht; ht = apr_palloc(pool, sizeof(apr_hash_t)); diff --git a/tables/apr_tables.c b/tables/apr_tables.c index a3e5821f685..059f9363559 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -107,7 +107,7 @@ static void make_array_core(apr_array_header_t *res, apr_pool_t *c, res->nalloc = nelts; /* ...but this many allocated */ } -APR_DECLARE(apr_array_header_t *) apr_make_array(apr_pool_t *p, +APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, int nelts, int elt_size) { apr_array_header_t *res; @@ -117,7 +117,7 @@ APR_DECLARE(apr_array_header_t *) apr_make_array(apr_pool_t *p, return res; } -APR_DECLARE(void *) apr_push_array(apr_array_header_t *arr) +APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr) { if (arr->nelts == arr->nalloc) { int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2; @@ -159,10 +159,10 @@ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, dst->nelts += src->nelts; } -APR_DECLARE(apr_array_header_t *) apr_copy_array(apr_pool_t *p, +APR_DECLARE(apr_array_header_t *) apr_array_copy(apr_pool_t *p, const apr_array_header_t *arr) { - apr_array_header_t *res = apr_make_array(p, arr->nalloc, arr->elt_size); + apr_array_header_t *res = apr_array_make(p, arr->nalloc, arr->elt_size); memcpy(res->elts, arr->elts, arr->elt_size * arr->nelts); res->nelts = arr->nelts; @@ -186,7 +186,7 @@ static APR_INLINE void copy_array_hdr_core(apr_array_header_t *res, } APR_DECLARE(apr_array_header_t *) - apr_copy_array_hdr(apr_pool_t *p, + apr_array_copy_hdr(apr_pool_t *p, const apr_array_header_t *arr) { apr_array_header_t *res; @@ -200,11 +200,11 @@ APR_DECLARE(apr_array_header_t *) /* The above is used here to avoid consing multiple new array bodies... */ APR_DECLARE(apr_array_header_t *) - apr_append_arrays(apr_pool_t *p, + apr_array_append(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second) { - apr_array_header_t *res = apr_copy_array_hdr(p, first); + apr_array_header_t *res = apr_array_copy_hdr(p, first); apr_array_cat(res, second); return res; @@ -286,14 +286,14 @@ static apr_table_entry_t *table_push(apr_table_t *t) if (t->a.nelts == t->a.nalloc) { return NULL; } - return (apr_table_entry_t *) apr_push_array(&t->a); + return (apr_table_entry_t *) apr_array_push(&t->a); } #else /* MAKE_TABLE_PROFILE */ -#define table_push(t) ((apr_table_entry_t *) apr_push_array(&(t)->a)) +#define table_push(t) ((apr_table_entry_t *) apr_array_push(&(t)->a)) #endif /* MAKE_TABLE_PROFILE */ -APR_DECLARE(apr_table_t *) apr_make_table(apr_pool_t *p, int nelts) +APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts) { apr_table_t *t = apr_palloc(p, sizeof(apr_table_t)); @@ -304,7 +304,7 @@ APR_DECLARE(apr_table_t *) apr_make_table(apr_pool_t *p, int nelts) return t; } -APR_DECLARE(apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) +APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, const apr_table_t *t) { apr_table_t *new = apr_palloc(p, sizeof(apr_table_t)); @@ -323,7 +323,7 @@ APR_DECLARE(apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) return new; } -APR_DECLARE(void) apr_clear_table(apr_table_t *t) +APR_DECLARE(void) apr_table_clear(apr_table_t *t) { t->a.nelts = 0; } @@ -534,7 +534,7 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, elts->val = (char *)val; } -APR_DECLARE(apr_table_t *) apr_overlay_tables(apr_pool_t *p, +APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base) { @@ -665,7 +665,7 @@ static int sort_overlap(const void *va, const void *vb) #define APR_OVERLAP_TABLES_ON_STACK (512) #endif -APR_DECLARE(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, +APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags) { overlap_key cat_keys_buf[APR_OVERLAP_TABLES_ON_STACK]; diff --git a/test/abc.c b/test/abc.c index 894228d857b..d0cd82302a7 100644 --- a/test/abc.c +++ b/test/abc.c @@ -11,12 +11,12 @@ int main(int argc, char *argv[]) int status = 0; apr_pool_t *context; - apr_create_pool(&context, NULL); + apr_pool_create(&context, NULL); - apr_open(&fd, argv[1], APR_READ, -1, context); + apr_file_open(&fd, argv[1], APR_READ, -1, context); while (!status) { - status = apr_getc(&ch, fd); + status = apr_file_getc(&ch, fd); if (status == APR_EOF ) fprintf(stdout, "EOF, YEAH!!!!!!!!!\n"); else if (status == APR_SUCCESS) diff --git a/test/client.c b/test/client.c index 8ccc555eae3..70f269c5ec2 100644 --- a/test/client.c +++ b/test/client.c @@ -98,14 +98,14 @@ int main(int argc, char *argv[]) atexit(closeapr); fprintf(stdout, "Creating context......."); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Something went wrong\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout,"\tClient: Making socket address..............."); - if ((stat = apr_getaddrinfo(&remote_sa, dest, APR_UNSPEC, 8021, 0, context)) + if ((stat = apr_sockaddr_info_get(&remote_sa, dest, APR_UNSPEC, 8021, 0, context)) != APR_SUCCESS) { fprintf(stdout, "Failed!\n"); fprintf(stdout, "Address resolution failed for %s: %s\n", @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) fprintf(stdout,"OK\n"); fprintf(stdout, "\tClient: Creating new socket......."); - if (apr_create_socket(&sock, remote_sa->sa.sin.sin_family, SOCK_STREAM, + if (apr_socket_create(&sock, remote_sa->sa.sin.sin_family, SOCK_STREAM, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) stat = apr_connect(sock, remote_sa); if (stat != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Could not connect: %s (%d)\n", apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); fflush(stderr); @@ -138,25 +138,25 @@ int main(int argc, char *argv[]) if (read_timeout == -1) { fprintf(stdout, "\tClient: Setting socket option NONBLOCK......."); if (apr_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Couldn't set socket option\n"); exit(-1); } fprintf(stdout, "OK\n"); } - apr_get_sockaddr(&remote_sa, APR_REMOTE, sock); - apr_get_ipaddr(&remote_ipaddr, remote_sa); - apr_get_port(&remote_port, remote_sa); - apr_get_sockaddr(&local_sa, APR_LOCAL, sock); - apr_get_ipaddr(&local_ipaddr, local_sa); - apr_get_port(&local_port, local_sa); + apr_socket_addr_get(&remote_sa, APR_REMOTE, sock); + apr_sockaddr_ip_get(&remote_ipaddr, remote_sa); + apr_sockaddr_port_get(&remote_port, remote_sa); + apr_socket_addr_get(&local_sa, APR_LOCAL, sock); + apr_sockaddr_ip_get(&local_ipaddr, local_sa); + apr_sockaddr_port_get(&local_port, local_sa); fprintf(stdout, "\tClient socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); fprintf(stdout, "\tClient: Trying to send data over socket......."); length = STRLEN; if (apr_send(sock, datasend, &length) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Problem sending data\n"); exit(-1); } @@ -176,13 +176,13 @@ int main(int argc, char *argv[]) fprintf(stdout, "\tClient: Trying to receive data over socket......."); if ((stat = apr_recv(sock, datarecv, &length)) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Problem receiving data: %s (%d)\n", apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); exit(-1); } if (strcmp(datarecv, "Recv data test")) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "I did not receive the correct data %s\n", datarecv); exit(-1); } @@ -190,14 +190,14 @@ int main(int argc, char *argv[]) fprintf(stdout, "\tClient: Shutting down socket......."); if (apr_shutdown(sock, APR_SHUTDOWN_WRITE) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Could not shutdown socket\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Closing down socket......."); - if (apr_close_socket(sock) != APR_SUCCESS) { + if (apr_socket_close(sock) != APR_SUCCESS) { fprintf(stderr, "Could not shutdown socket\n"); exit(-1); } diff --git a/test/sendfile.c b/test/sendfile.c index 425b5598790..146a05b8261 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -110,18 +110,18 @@ static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family) atexit(closeapr); - rv = apr_create_pool(p, NULL); + rv = apr_pool_create(p, NULL); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_create_pool()->%d/%s\n", + fprintf(stderr, "apr_pool_create()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } *sock = NULL; - rv = apr_create_socket(sock, *family, SOCK_STREAM, *p); + rv = apr_socket_create(sock, *family, SOCK_STREAM, *p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_create_socket()->%d/%s\n", + fprintf(stderr, "apr_socket_create()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -130,9 +130,9 @@ static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family) if (*family == APR_UNSPEC) { apr_sockaddr_t *localsa; - rv = apr_get_sockaddr(&localsa, APR_LOCAL, *sock); + rv = apr_socket_addr_get(&localsa, APR_LOCAL, *sock); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_get_sockaddr()->%d/%s\n", + fprintf(stderr, "apr_socket_addr_get()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -150,11 +150,11 @@ static void create_testfile(apr_pool_t *p, const char *fname) apr_finfo_t finfo; printf("Creating a test file...\n"); - rv = apr_open(&f, fname, + rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE | APR_BUFFERED, APR_UREAD | APR_UWRITE, p); if (rv) { - fprintf(stderr, "apr_open()->%d/%s\n", + fprintf(stderr, "apr_file_open()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -162,35 +162,35 @@ static void create_testfile(apr_pool_t *p, const char *fname) buf[0] = FILE_DATA_CHAR; buf[1] = '\0'; for (i = 0; i < FILE_LENGTH; i++) { - /* exercise apr_putc() and apr_puts() on buffered files */ + /* exercise apr_file_putc() and apr_file_puts() on buffered files */ if ((i % 2) == 0) { - rv = apr_putc(buf[0], f); + rv = apr_file_putc(buf[0], f); if (rv) { - fprintf(stderr, "apr_putc()->%d/%s\n", + fprintf(stderr, "apr_file_putc()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } } else { - rv = apr_puts(buf, f); + rv = apr_file_puts(buf, f); if (rv) { - fprintf(stderr, "apr_puts()->%d/%s\n", + fprintf(stderr, "apr_file_puts()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } } } - rv = apr_close(f); + rv = apr_file_close(f); if (rv) { - fprintf(stderr, "apr_close()->%d/%s\n", + fprintf(stderr, "apr_file_close()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } rv = apr_stat(&finfo, fname, APR_FINFO_NORM, p); if (rv) { - fprintf(stderr, "apr_close()->%d/%s\n", + fprintf(stderr, "apr_file_close()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -230,17 +230,17 @@ static int client(client_socket_mode_t socket_mode) apr_setup(&p, &sock, &family); create_testfile(p, TESTFILE); - rv = apr_open(&f, TESTFILE, APR_READ, 0, p); + rv = apr_file_open(&f, TESTFILE, APR_READ, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_open()->%d/%s\n", + fprintf(stderr, "apr_file_open()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = apr_getaddrinfo(&destsa, "127.0.0.1", family, TESTSF_PORT, 0, p); + rv = apr_sockaddr_info_get(&destsa, "127.0.0.1", family, TESTSF_PORT, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_getaddrinfo()->%d/%s\n", + fprintf(stderr, "apr_sockaddr_info_get()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -343,9 +343,9 @@ static int client(client_socket_mode_t socket_mode) apr_size_t total_bytes_sent; pfd = NULL; - rv = apr_setup_poll(&pfd, 1, p); + rv = apr_poll_setup(&pfd, 1, p); assert(!rv); - rv = apr_add_poll_socket(pfd, sock, APR_POLLOUT); + rv = apr_poll_socket_add(pfd, sock, APR_POLLOUT); assert(!rv); total_bytes_sent = 0; @@ -456,9 +456,9 @@ static int client(client_socket_mode_t socket_mode) } current_file_offset = 0; - rv = apr_seek(f, APR_CUR, &current_file_offset); + rv = apr_file_seek(f, APR_CUR, &current_file_offset); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_seek()->%d/%s\n", + fprintf(stderr, "apr_file_seek()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -493,9 +493,9 @@ static int client(client_socket_mode_t socket_mode) printf("client: apr_sendfile() worked as expected!\n"); - rv = apr_remove_file(TESTFILE, p); + rv = apr_file_remove(TESTFILE, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_remove_file()->%d/%s\n", + fprintf(stderr, "apr_file_remove()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -527,9 +527,9 @@ static int server(void) exit(1); } - rv = apr_getaddrinfo(&localsa, NULL, family, TESTSF_PORT, 0, p); + rv = apr_sockaddr_info_get(&localsa, NULL, family, TESTSF_PORT, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_getaddrinfo()->%d/%s\n", + fprintf(stderr, "apr_sockaddr_info_get()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); diff --git a/test/server.c b/test/server.c index 32871da194d..c47366b2824 100644 --- a/test/server.c +++ b/test/server.c @@ -95,13 +95,13 @@ int main(int argc, const char * const argv[]) atexit(closeapr); fprintf(stdout, "Creating context......."); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Could not create a context\n"); exit(-1); } fprintf(stdout, "OK\n"); - if (apr_initopt(&opt, context, argc, argv)) { + if (apr_getopt_init(&opt, context, argc, argv)) { fprintf(stderr, "failed to initialize opts\n"); exit(-1); } @@ -125,7 +125,7 @@ int main(int argc, const char * const argv[]) * socket we need. We'll use the returned sockaddr later when * we bind. */ - stat = apr_getaddrinfo(&localsa, bind_to_ipaddr, APR_UNSPEC, 8021, 0, + stat = apr_sockaddr_info_get(&localsa, bind_to_ipaddr, APR_UNSPEC, 8021, 0, context); if (stat != APR_SUCCESS) { fprintf(stderr, @@ -137,7 +137,7 @@ int main(int argc, const char * const argv[]) } fprintf(stdout, "\tServer: Creating new socket......."); - if (apr_create_socket(&sock, family, SOCK_STREAM, context) != APR_SUCCESS) { + if (apr_socket_create(&sock, family, SOCK_STREAM, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); } @@ -145,7 +145,7 @@ int main(int argc, const char * const argv[]) fprintf(stdout, "\tServer: Setting socket option NONBLOCK......."); if (apr_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Couldn't set socket option\n"); exit(-1); } @@ -153,20 +153,20 @@ int main(int argc, const char * const argv[]) fprintf(stdout, "\tServer: Setting socket option REUSEADDR......."); if (apr_setsocketopt(sock, APR_SO_REUSEADDR, 1) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Couldn't set socket option\n"); exit(-1); } fprintf(stdout, "OK\n"); if (!localsa) { - apr_get_sockaddr(&localsa, APR_LOCAL, sock); - apr_set_port(localsa, 8021); + apr_socket_addr_get(&localsa, APR_LOCAL, sock); + apr_sockaddr_port_set(localsa, 8021); } fprintf(stdout, "\tServer: Binding socket to port......."); if ((stat = apr_bind(sock, localsa)) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Could not bind: %s\n", apr_strerror(stat, buf, sizeof buf)); exit(-1); @@ -175,26 +175,26 @@ int main(int argc, const char * const argv[]) fprintf(stdout, "\tServer: Listening to socket......."); if (apr_listen(sock, 5) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Could not listen\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Setting up socket for polling......."); - apr_setup_poll(&sdset, 1, context); - apr_add_poll_socket(sdset, sock, APR_POLLIN); + apr_poll_setup(&sdset, 1, context); + apr_poll_socket_add(sdset, sock, APR_POLLIN); fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Beginning to poll for socket......."); rv = 1; if (apr_poll(sdset, &rv, -1) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Select caused an error\n"); exit(-1); } else if (rv == 0) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "I should not return until rv == 1\n"); exit(-1); } @@ -202,31 +202,31 @@ int main(int argc, const char * const argv[]) fprintf(stdout, "\tServer: Accepting a connection......."); if (apr_accept(&sock2, sock, context) != APR_SUCCESS) { - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr, "Could not accept connection.\n"); exit(-1); } fprintf(stdout, "OK\n"); - apr_get_sockaddr(&remotesa, APR_REMOTE, sock2); - apr_get_ipaddr(&remote_ipaddr, remotesa); - apr_get_port(&remote_port, remotesa); - apr_get_sockaddr(&localsa, APR_LOCAL, sock2); - apr_get_ipaddr(&local_ipaddr, localsa); - apr_get_port(&local_port, localsa); + apr_socket_addr_get(&remotesa, APR_REMOTE, sock2); + apr_sockaddr_ip_get(&remote_ipaddr, remotesa); + apr_sockaddr_port_get(&remote_port, remotesa); + apr_socket_addr_get(&localsa, APR_LOCAL, sock2); + apr_sockaddr_ip_get(&local_ipaddr, localsa); + apr_sockaddr_port_get(&local_port, localsa); fprintf(stdout, "\tServer socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); length = STRLEN; fprintf(stdout, "\tServer: Trying to recv data from socket......."); if (apr_recv(sock2, datasend, &length) != APR_SUCCESS) { - apr_close_socket(sock); - apr_close_socket(sock2); + apr_socket_close(sock); + apr_socket_close(sock2); fprintf(stderr, "Problem recving data\n"); exit(-1); } if (strcmp(datasend, "Send data test")) { - apr_close_socket(sock); - apr_close_socket(sock2); + apr_socket_close(sock); + apr_socket_close(sock2); fprintf(stderr, "I did not receive the correct data %s\n", datarecv); exit(-1); } @@ -235,8 +235,8 @@ int main(int argc, const char * const argv[]) length = STRLEN; fprintf(stdout, "\tServer: Sending data over socket......."); if (apr_send(sock2, datarecv, &length) != APR_SUCCESS) { - apr_close_socket(sock); - apr_close_socket(sock2); + apr_socket_close(sock); + apr_socket_close(sock2); fprintf(stderr, "Problem sending data\n"); exit(-1); } @@ -244,23 +244,23 @@ int main(int argc, const char * const argv[]) fprintf(stdout, "\tServer: Shutting down accepted socket......."); if (apr_shutdown(sock2, APR_SHUTDOWN_READ) != APR_SUCCESS) { - apr_close_socket(sock); - apr_close_socket(sock2); + apr_socket_close(sock); + apr_socket_close(sock2); fprintf(stderr, "Problem shutting down\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: closing duplicate socket......."); - if (apr_close_socket(sock2) != APR_SUCCESS) { - apr_close_socket(sock); + if (apr_socket_close(sock2) != APR_SUCCESS) { + apr_socket_close(sock); fprintf(stderr, "Problem closing down\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: closing original socket......."); - if (apr_close_socket(sock) != APR_SUCCESS) { + if (apr_socket_close(sock) != APR_SUCCESS) { fprintf(stderr, "Problem closing down\n"); exit(-1); } diff --git a/test/testargs.c b/test/testargs.c index aa088e98af4..803f3eccabf 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -87,9 +87,9 @@ int main(int argc, const char * const argv[]) apr_initialize(); atexit(closeapr); - apr_create_pool(&context, NULL); + apr_pool_create(&context, NULL); - if (apr_initopt(&opt, context, argc, argv)) + if (apr_getopt_init(&opt, context, argc, argv)) { printf("failed to initialize opts"); exit(1); diff --git a/test/testcontext.c b/test/testcontext.c index 4755e183e39..7267aac0afb 100644 --- a/test/testcontext.c +++ b/test/testcontext.c @@ -85,16 +85,16 @@ int main(void) } atexit(closeapr); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } testdata = apr_pstrdup(context, "This is a test\n"); - apr_set_userdata(testdata, "TEST", string_cleanup, context); + apr_pool_userdata_set(testdata, "TEST", string_cleanup, context); - apr_get_userdata((void **)&retdata, "TEST", context); + apr_pool_userdata_get((void **)&retdata, "TEST", context); if (!strcmp(testdata, retdata)) { fprintf(stdout, "User data is working ok\n"); diff --git a/test/testdso.c b/test/testdso.c index d07148a3534..160fad15d7c 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -35,7 +35,7 @@ int main (int argc, char ** argv) apr_initialize(); atexit(closeapr); - if (apr_create_pool(&cont, NULL) != APR_SUCCESS) { + if (apr_pool_create(&cont, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } diff --git a/test/testfile.c b/test/testfile.c index 2a7f4a04219..af449742a4d 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -124,11 +124,11 @@ int main(void) exit(-1); } atexit(closeapr); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } - if (apr_create_pool(&cont2, context) != APR_SUCCESS) { + if (apr_pool_create(&cont2, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } @@ -136,7 +136,7 @@ int main(void) fprintf(stdout, "Testing file functions.\n"); fprintf(stdout, "\tOpening file......."); - status = apr_open(&thefile, filename, flag, APR_UREAD | APR_UWRITE | APR_GREAD, context); + status = apr_file_open(&thefile, filename, flag, APR_UREAD | APR_UWRITE | APR_GREAD, context); if (status != APR_SUCCESS) { fprintf(stderr, "Didn't open file: %d/%s\n", status, apr_strerror(status, errmsg, sizeof errmsg)); @@ -151,7 +151,7 @@ int main(void) fprintf(stderr, "Bad file des\n"); exit(-1); } - apr_get_filename(&str, thefile); + apr_file_name_get(&str, thefile); if (strcmp(str, filename) != 0) { fprintf(stderr, "wrong filename\n"); exit(-1); @@ -163,9 +163,9 @@ int main(void) fprintf(stdout, "\tWriting to file......."); nbytes = strlen("this is a test"); - status = apr_write(thefile, "this is a test", &nbytes); + status = apr_file_write(thefile, "this is a test", &nbytes); if (status != APR_SUCCESS) { - fprintf(stderr, "something's wrong; apr_write->%d/%s\n", + fprintf(stderr, "something's wrong; apr_file_write->%d/%s\n", status, apr_strerror(status, errmsg, sizeof errmsg)); exit(-1); } @@ -179,7 +179,7 @@ int main(void) fprintf(stdout, "\tMoving to start of file......."); zer = 0; - status = apr_seek(thefile, SEEK_SET, &zer); + status = apr_file_seek(thefile, SEEK_SET, &zer); if (status != APR_SUCCESS) { fprintf(stderr, "couldn't seek to beginning of file: %d/%s", status, apr_strerror(status, errmsg, sizeof errmsg)); @@ -201,8 +201,8 @@ int main(void) fprintf(stdout, "OK\n"); fprintf(stdout, "\t\tChecking for incoming data......."); - apr_setup_poll(&sdset, 1, context); - apr_add_poll_socket(sdset, testsock, APR_POLLIN); + apr_poll_setup(&sdset, 1, context); + apr_poll_socket_add(sdset, testsock, APR_POLLIN); num = 1; if (apr_poll(sdset, &num, -1) != APR_SUCCESS) { fprintf(stderr, "Select caused an error\n"); @@ -218,9 +218,9 @@ int main(void) fprintf(stdout, "\tReading from the file......."); nbytes = strlen("this is a test"); buf = (char *)apr_palloc(context, nbytes + 1); - status = apr_read(thefile, buf, &nbytes); + status = apr_file_read(thefile, buf, &nbytes); if (status != APR_SUCCESS) { - fprintf(stderr, "apr_read()->%d/%s\n", + fprintf(stderr, "apr_file_read()->%d/%s\n", status, apr_strerror(status, errmsg, sizeof errmsg)); exit(-1); } @@ -233,7 +233,7 @@ int main(void) } fprintf(stdout, "\tAdding user data to the file......."); - status = apr_set_filedata(thefile, "This is a test", "test", apr_null_cleanup); + status = apr_file_data_set(thefile, "This is a test", "test", apr_pool_cleanup_null); if (status != APR_SUCCESS) { fprintf(stderr, "Couldn't add the data\n"); exit(-1); @@ -243,7 +243,7 @@ int main(void) } fprintf(stdout, "\tGetting user data from the file......."); - status = apr_get_filedata((void **)&teststr, "test", thefile); + status = apr_file_data_get((void **)&teststr, "test", thefile); if (status != APR_SUCCESS || strcmp(teststr, "This is a test")) { fprintf(stderr, "Couldn't get the data\n"); exit(-1); @@ -253,7 +253,7 @@ int main(void) } fprintf(stdout, "\tGetting fileinfo......."); - status = apr_getfileinfo(&finfo, APR_FINFO_NORM, thefile); + status = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); if (status == APR_INCOMPLETE) { int i; fprintf(stdout, "INCOMPLETE\n"); @@ -272,7 +272,7 @@ int main(void) uid = finfo.user; fprintf(stdout, "\tClosing File......."); - status = apr_close(thefile); + status = apr_file_close(thefile); if (status != APR_SUCCESS) { fprintf(stderr, "Couldn't close the file\n"); exit(-1); @@ -329,7 +329,7 @@ int main(void) } fprintf(stdout, "\tDeleting file......."); - status = apr_remove_file(filename, context); + status = apr_file_remove(filename, context); if (status != APR_SUCCESS) { fprintf(stderr, "Couldn't delete the file\n"); exit(-1); @@ -339,7 +339,7 @@ int main(void) } fprintf(stdout, "\tMaking sure it's gone......."); - status = apr_open(&thefile, filename, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); + status = apr_file_open(&thefile, filename, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); if (status == APR_SUCCESS) { fprintf(stderr, "I could open the file for some reason?\n"); exit(-1); @@ -352,7 +352,7 @@ int main(void) test_filedel(context); test_read(context); - apr_destroy_pool(context); + apr_pool_destroy(context); return 1; } @@ -362,20 +362,20 @@ int test_filedel(apr_pool_t *context) apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; apr_status_t stat; - stat = apr_open(&thefile, "testdel", flag, APR_UREAD | APR_UWRITE | APR_GREAD, context); + stat = apr_file_open(&thefile, "testdel", flag, APR_UREAD | APR_UWRITE | APR_GREAD, context); if (stat != APR_SUCCESS) { return stat; } - if ((stat = apr_close(thefile)) != APR_SUCCESS) { + if ((stat = apr_file_close(thefile)) != APR_SUCCESS) { return stat; } - if ((stat = apr_remove_file("testdel", context)) != APR_SUCCESS) { + if ((stat = apr_file_remove("testdel", context)) != APR_SUCCESS) { return stat; } - stat = apr_open(&thefile, "testdel", APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); + stat = apr_file_open(&thefile, "testdel", APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); if (stat == APR_SUCCESS) { return stat; } @@ -393,7 +393,7 @@ int testdirs(apr_pool_t *context) fprintf(stdout, "Testing Directory functions.\n"); fprintf(stdout, "\tMakeing Directory......."); - if (apr_make_dir("testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE | APR_GREAD | APR_GWRITE | APR_GEXECUTE | APR_WREAD | APR_WWRITE | APR_WEXECUTE, context) != APR_SUCCESS) { + if (apr_dir_make("testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE | APR_GREAD | APR_GWRITE | APR_GEXECUTE | APR_WREAD | APR_WWRITE | APR_WEXECUTE, context) != APR_SUCCESS) { fprintf(stderr, "Could not create directory\n"); return -1; } @@ -401,13 +401,13 @@ int testdirs(apr_pool_t *context) fprintf(stdout, "OK\n"); } - if (apr_open(&file, "testdir/testfile", APR_READ | APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) {; + if (apr_file_open(&file, "testdir/testfile", APR_READ | APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) {; return -1; } bytes = strlen("Another test!!!"); - apr_write(file, "Another test!!", &bytes); - apr_close(file); + apr_file_write(file, "Another test!!", &bytes); + apr_file_close(file); fprintf(stdout, "\tOpening Directory......."); if (apr_dir_open(&temp, "testdir", context) != APR_SUCCESS) { @@ -474,7 +474,7 @@ int testdirs(apr_pool_t *context) } fprintf(stdout, "\tRemoving file from directory......."); - if (apr_remove_file("testdir/testfile", context) != APR_SUCCESS) { + if (apr_file_remove("testdir/testfile", context) != APR_SUCCESS) { fprintf(stderr, "Could not remove file\n"); return -1; } @@ -483,7 +483,7 @@ int testdirs(apr_pool_t *context) } fprintf(stdout, "\tRemoving Directory......."); - if (apr_remove_dir("testdir", context) != APR_SUCCESS) { + if (apr_dir_remove("testdir", context) != APR_SUCCESS) { fprintf(stderr, "Could not remove directory\n"); return -1; } @@ -506,23 +506,23 @@ static void create_testread(apr_pool_t *p, const char *fname) /* Create a test file with known content. */ - rv = apr_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); + rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); if (rv) { - fprintf(stderr, "apr_open()->%d/%s\n", + fprintf(stderr, "apr_file_open()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } nbytes = 4; - rv = apr_write(f, "abc\n", &nbytes); + rv = apr_file_write(f, "abc\n", &nbytes); assert(!rv && nbytes == 4); memset(buf, 'a', sizeof buf); nbytes = sizeof buf; - rv = apr_write(f, buf, &nbytes); + rv = apr_file_write(f, buf, &nbytes); assert(!rv && nbytes == sizeof buf); nbytes = 2; - rv = apr_write(f, "\n\n", &nbytes); + rv = apr_file_write(f, "\n\n", &nbytes); assert(!rv && nbytes == 2); - rv = apr_close(f); + rv = apr_file_close(f); assert(!rv); } @@ -537,11 +537,11 @@ static char read_one(apr_file_t *f, int expected) bytes[0] = bytes[2] = 0x01; if (counter % 2) { - rv = apr_getc(bytes + 1, f); + rv = apr_file_getc(bytes + 1, f); } else { nbytes = 1; - rv = apr_read(f, bytes + 1, &nbytes); + rv = apr_file_read(f, bytes + 1, &nbytes); assert(nbytes == 1); } assert(!rv); @@ -560,23 +560,23 @@ static void test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_f char buf[1024]; int i; - rv = apr_open(&f, fname, APR_READ | extra_flags, 0, p); + rv = apr_file_open(&f, fname, APR_READ | extra_flags, 0, p); assert(!rv); read_one(f, 'a'); read_one(f, 'b'); if (extra_flags & APR_BUFFERED) { fprintf(stdout, - "\n\t\tskipping apr_ungetc() for APR_BUFFERED... " + "\n\t\tskipping apr_file_ungetc() for APR_BUFFERED... " "doesn't work yet...\n\t\t\t\t "); } else { - rv = apr_ungetc('b', f); + rv = apr_file_ungetc('b', f); assert(!rv); /* Note: some implementations move the file ptr back; * others just save up to one char; it isn't * portable to unget more than once. */ - /* Don't do this: rv = apr_ungetc('a', f); */ + /* Don't do this: rv = apr_file_ungetc('a', f); */ read_one(f, 'b'); } read_one(f, 'c'); @@ -586,20 +586,20 @@ static void test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_f } read_one(f, '\n'); read_one(f, '\n'); - rv = apr_getc(buf, f); + rv = apr_file_getc(buf, f); assert(rv == APR_EOF); - rv = apr_close(f); + rv = apr_file_close(f); assert(!rv); f = NULL; - rv = apr_open(&f, fname, APR_READ | extra_flags, 0, p); + rv = apr_file_open(&f, fname, APR_READ | extra_flags, 0, p); assert(!rv); - rv = apr_fgets(buf, 10, f); + rv = apr_file_gets(buf, 10, f); assert(!rv); assert(!strcmp(buf, "abc\n")); /* read first 800 of TESTREAD_BLKSIZE 'a's */ - rv = apr_fgets(buf, 801, f); + rv = apr_file_gets(buf, 801, f); assert(!rv); assert(strlen(buf) == 800); for (i = 0; i < 800; i++) { @@ -607,7 +607,7 @@ static void test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_f } /* read rest of the 'a's and the first newline */ - rv = apr_fgets(buf, sizeof buf, f); + rv = apr_file_gets(buf, sizeof buf, f); assert(!rv); assert(strlen(buf) == TESTREAD_BLKSIZE - 800 + 1); for (i = 0; i < TESTREAD_BLKSIZE - 800; i++) { @@ -616,23 +616,23 @@ static void test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_f assert(buf[TESTREAD_BLKSIZE - 800] == '\n'); /* read the last newline */ - rv = apr_fgets(buf, sizeof buf, f); + rv = apr_file_gets(buf, sizeof buf, f); assert(!rv); assert(!strcmp(buf, "\n")); /* get APR_EOF */ - rv = apr_fgets(buf, sizeof buf, f); + rv = apr_file_gets(buf, sizeof buf, f); assert(rv == APR_EOF); - /* get APR_EOF with apr_getc + /* get APR_EOF with apr_file_getc */ - rv = apr_getc(buf, f); + rv = apr_file_getc(buf, f); assert(rv == APR_EOF); - /* get APR_EOF with apr_read + /* get APR_EOF with apr_file_read */ nbytes = sizeof buf; - rv = apr_read(f, buf, &nbytes); + rv = apr_file_read(f, buf, &nbytes); assert(rv == APR_EOF); - rv = apr_close(f); + rv = apr_file_close(f); assert(!rv); } @@ -645,27 +645,27 @@ static void test_bigread(apr_pool_t *p, const char *fname, apr_int32_t extra_fla /* Create a test file with known content. */ - rv = apr_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); + rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); if (rv) { - fprintf(stderr, "apr_open()->%d/%s\n", + fprintf(stderr, "apr_file_open()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } nbytes = APR_BUFFERSIZE; memset(buf, 0xFE, nbytes); - rv = apr_write(f, buf, &nbytes); + rv = apr_file_write(f, buf, &nbytes); assert(!rv && nbytes == APR_BUFFERSIZE); - rv = apr_close(f); + rv = apr_file_close(f); assert(!rv); f = NULL; - rv = apr_open(&f, fname, APR_READ | extra_flags, 0, p); + rv = apr_file_open(&f, fname, APR_READ | extra_flags, 0, p); assert(!rv); nbytes = sizeof buf; - rv = apr_read(f, buf, &nbytes); + rv = apr_file_read(f, buf, &nbytes); assert(!rv); assert(nbytes == APR_BUFFERSIZE); - rv = apr_close(f); + rv = apr_file_close(f); assert(!rv); } @@ -689,7 +689,7 @@ static void test_read(apr_pool_t *p) fprintf(stdout, "\tMore unbuffered file tests......"); test_bigread(p, fname, 0); fprintf(stdout, "OK\n"); - rv = apr_remove_file(fname, p); + rv = apr_file_remove(fname, p); assert(!rv); fprintf(stdout, "\tAll read tests...........OK\n"); } diff --git a/test/testflock.c b/test/testflock.c index 52a8b36df7e..5ada22ee283 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -89,7 +89,7 @@ static apr_pool_t *pool = NULL; static void errmsg(const char *msg) { if (pool != NULL) - apr_destroy_pool(pool); + apr_pool_destroy(pool); fprintf(stderr, msg); exit(1); } @@ -99,12 +99,12 @@ static void do_read(void) apr_file_t *file; apr_status_t status; - if (apr_open(&file, TESTFILE, APR_WRITE, + if (apr_file_open(&file, TESTFILE, APR_WRITE, APR_OS_DEFAULT, pool) != APR_SUCCESS) errmsg("Could not open test file.\n"); printf("Test file opened.\n"); - status = apr_lock_file(file, APR_FLOCK_EXCLUSIVE | APR_FLOCK_NONBLOCK); + status = apr_file_lock(file, APR_FLOCK_EXCLUSIVE | APR_FLOCK_NONBLOCK); if (!APR_STATUS_IS_EAGAIN(status)) { char msg[200]; errmsg(apr_psprintf(pool, "Expected EAGAIN. Got %d: %s.\n", @@ -113,11 +113,11 @@ static void do_read(void) printf("First attempt: we were properly locked out.\nWaiting for lock..."); fflush(stdout); - if (apr_lock_file(file, APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) + if (apr_file_lock(file, APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) errmsg("Could not establish lock on test file."); printf(" got it.\n"); - (void) apr_close(file); + (void) apr_file_close(file); printf("Exiting.\n"); } @@ -125,19 +125,19 @@ static void do_write(void) { apr_file_t *file; - if (apr_open(&file, TESTFILE, APR_WRITE|APR_CREATE, APR_OS_DEFAULT, + if (apr_file_open(&file, TESTFILE, APR_WRITE|APR_CREATE, APR_OS_DEFAULT, pool) != APR_SUCCESS) errmsg("Could not create file.\n"); printf("Test file created.\n"); - if (apr_lock_file(file, APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) + if (apr_file_lock(file, APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) errmsg("Could not lock the file.\n"); printf("Lock created.\nSleeping..."); fflush(stdout); apr_sleep(30000000); /* 30 seconds */ - (void) apr_close(file); + (void) apr_file_close(file); printf(" done.\nExiting.\n"); } @@ -158,10 +158,10 @@ int main(int argc, const char * const *argv) errmsg("Could not initialize APR.\n"); atexit(closeapr); - if (apr_create_pool(&pool, NULL) != APR_SUCCESS) + if (apr_pool_create(&pool, NULL) != APR_SUCCESS) errmsg("Could not create global pool.\n"); - if (apr_initopt(&opt, pool, argc, argv) != APR_SUCCESS) + if (apr_getopt_init(&opt, pool, argc, argv) != APR_SUCCESS) errmsg("Could not parse options.\n"); while ((status = apr_getopt(opt, "r", &optchar, &optarg)) == APR_SUCCESS) { diff --git a/test/testmd5.c b/test/testmd5.c index cf187e4c634..7dc02adf524 100644 --- a/test/testmd5.c +++ b/test/testmd5.c @@ -91,22 +91,22 @@ static void try(const void *buf, size_t bufLen, apr_xlate_t *xlate, apr_md5_ctx_t context; unsigned char hash[MD5_DIGESTSIZE]; - rv = apr_MD5Init(&context); + rv = apr_md5_init(&context); assert(!rv); if (xlate) { #if APR_HAS_XLATE - apr_MD5SetXlate(&context, xlate); + apr_md5_set_xlate(&context, xlate); #else fprintf(stderr, "A translation handle was unexpected.\n"); #endif } - rv = apr_MD5Update(&context, buf, bufLen); + rv = apr_md5_update(&context, buf, bufLen); assert(!rv); - rv = apr_MD5Final(hash, &context); + rv = apr_md5_final(hash, &context); assert(!rv); for (i = 0; i < MD5_DIGESTSIZE; i++) { @@ -154,7 +154,7 @@ int main(int argc, char **argv) assert(!rv); atexit(apr_terminate); - rv = apr_create_pool(&pool, NULL); + rv = apr_pool_create(&pool, NULL); if (src) { #if APR_HAS_XLATE diff --git a/test/testmmap.c b/test/testmmap.c index f89c3cd2200..d074a6992ab 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -97,7 +97,7 @@ int main(void) atexit(closeapr); fprintf(stdout,"Creating context...................."); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Failed.\n"); exit(-1); } @@ -108,7 +108,7 @@ int main(void) strncat(file1,"/testmmap.c",11); fprintf(stdout, "Opening file........................"); - rv = apr_open(&thefile, file1, flag, APR_UREAD | APR_GREAD, context); + rv = apr_file_open(&thefile, file1, flag, APR_UREAD | APR_GREAD, context); if (rv != APR_SUCCESS) { fprintf(stderr, "couldn't open file `%s': %d/%s\n", @@ -120,7 +120,7 @@ int main(void) } fprintf(stderr, "Getting file size..................."); - rv = apr_getfileinfo(&finfo, APR_FINFO_NORM, thefile); + rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); if (rv != APR_SUCCESS) { fprintf(stderr, "Didn't get file information: %d/%s\n", diff --git a/test/testoc.c b/test/testoc.c index bb641e330bd..813694df1c1 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) exit(-1); } atexit(apr_terminate); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } @@ -114,18 +114,18 @@ int main(int argc, char *argv[]) fprintf(stdout, "[PARENT] Creating procattr............."); fflush(stdout); - if (apr_createprocattr_init(&procattr, context) != APR_SUCCESS) { + if (apr_procattr_create(&procattr, context) != APR_SUCCESS) { fprintf(stderr, "Could not create attr\n"); exit(-1);; } else { - apr_setprocattr_io(procattr, APR_FULL_BLOCK, APR_NO_PIPE, APR_NO_PIPE); + apr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_NO_PIPE, APR_NO_PIPE); } fprintf(stdout, "OK\n"); fprintf(stdout, "[PARENT] Starting other child.........."); fflush(stdout); - if (apr_create_process(&newproc, "./occhild", args, NULL, procattr, context) + if (apr_proc_create(&newproc, "./occhild", args, NULL, procattr, context) != APR_SUCCESS) { fprintf(stderr, "error starting other child\n"); exit(-1); @@ -134,12 +134,12 @@ int main(int argc, char *argv[]) std = newproc.in; - apr_register_other_child(&newproc, ocmaint, NULL, std, context); + apr_proc_other_child_register(&newproc, ocmaint, NULL, std, context); fprintf(stdout, "[PARENT] Sending SIGKILL to child......"); fflush(stdout); apr_sleep(1 * APR_USEC_PER_SEC); - if (apr_kill(&newproc, SIGKILL) != APR_SUCCESS) { + if (apr_proc_kill(&newproc, SIGKILL) != APR_SUCCESS) { fprintf(stderr,"couldn't send the signal!\n"); exit(-1); } @@ -147,10 +147,10 @@ int main(int argc, char *argv[]) /* allow time for things to settle... */ apr_sleep(3 * APR_USEC_PER_SEC); - apr_probe_writable_fds(); + apr_proc_probe_writable_fds(); fprintf(stdout, "[PARENT] Checking on children..........\n"); - apr_check_other_child(); + apr_proc_other_child_check(); #else fprintf(stdout, "OC failed!\n"); fprintf(stdout, "Other_child is not supported on this platform\n"); diff --git a/test/testpipe.c b/test/testpipe.c index c3657a10c81..4a6a8cfc146 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -82,7 +82,7 @@ int main(void) exit(-1); } atexit(closeapr); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } @@ -90,8 +90,8 @@ int main(void) fprintf(stdout, "Testing pipe functions.\n"); fprintf(stdout, "\tCreating pipes......."); - if ((rv = apr_create_pipe(&readp, &writep, context)) != APR_SUCCESS) { - fprintf(stderr, "apr_create_pipe()->%d/%s\n", + if ((rv = apr_file_pipe_create(&readp, &writep, context)) != APR_SUCCESS) { + fprintf(stderr, "apr_file_pipe_create()->%d/%s\n", rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); exit(-1); } @@ -100,8 +100,8 @@ int main(void) } fprintf(stdout, "\tSetting pipe timeout......."); - if ((rv = apr_set_pipe_timeout(readp, 1 * APR_USEC_PER_SEC)) != APR_SUCCESS) { - fprintf(stderr, "apr_set_pipe_timeout()->%d/%s\n", + if ((rv = apr_file_pipe_timeout_set(readp, 1 * APR_USEC_PER_SEC)) != APR_SUCCESS) { + fprintf(stderr, "apr_file_pipe_timeout_set()->%d/%s\n", rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); exit(-1); } else { @@ -111,7 +111,7 @@ int main(void) fprintf(stdout, "\tReading from the pipe......."); nbytes = strlen("this is a test"); buf = (char *)apr_palloc(context, nbytes + 1); - if (apr_read(readp, buf, &nbytes) == APR_TIMEUP) { + if (apr_file_read(readp, buf, &nbytes) == APR_TIMEUP) { fprintf(stdout, "OK\n"); } else { diff --git a/test/testproc.c b/test/testproc.c index 5b66edd821e..f4e9e771bf6 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) exit(-1); } atexit(closeapr); - apr_create_pool(&context, NULL); + apr_pool_create(&context, NULL); if (argc > 1) { @@ -102,21 +102,21 @@ int main(int argc, char *argv[]) teststr = apr_pstrdup(context, "Whooo Hoooo\0"); fprintf(stdout, "Creating directory for later use......."); - if (apr_make_dir("proctest", APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) { + if (apr_dir_make("proctest", APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) { fprintf(stderr, "Could not create dir\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Creating procattr......."); - if (apr_createprocattr_init(&attr, context) != APR_SUCCESS) { + if (apr_procattr_create(&attr, context) != APR_SUCCESS) { fprintf(stderr, "Could not create attr\n"); exit(-1);; } fprintf(stdout, "OK.\n"); fprintf(stdout, "Setting attr pipes, all three......."); - if (apr_setprocattr_io(attr, APR_FULL_BLOCK, + if (apr_procattr_io_set(attr, APR_FULL_BLOCK, APR_CHILD_BLOCK, APR_NO_PIPE) != APR_SUCCESS) { fprintf(stderr, "Could not set pipes attr\n"); exit(-1); @@ -124,14 +124,14 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK.\n"); fprintf(stdout, "Setting attr dir......."); - if (apr_setprocattr_dir(attr, "proctest") != APR_SUCCESS) { + if (apr_procattr_dir_set(attr, "proctest") != APR_SUCCESS) { fprintf(stderr, "Could not set directory attr\n"); exit(-1); } fprintf(stdout, "OK.\n"); fprintf(stdout, "Setting attr cmd type......."); - if (apr_setprocattr_cmdtype(attr, APR_PROGRAM) != APR_SUCCESS) { + if (apr_procattr_cmdtype_set(attr, APR_PROGRAM) != APR_SUCCESS) { fprintf(stderr, "Could not set cmd type attr\n"); exit(-1); } @@ -142,7 +142,7 @@ int main(int argc, char *argv[]) args[2] = NULL; fprintf(stdout, "Creating a new process......."); - if (apr_create_process(&newproc, "../testproc", args, NULL, attr, context) != APR_SUCCESS) { + if (apr_proc_create(&newproc, "../testproc", args, NULL, attr, context) != APR_SUCCESS) { fprintf(stderr, "Could not create the new process\n"); exit(-1); } @@ -154,7 +154,7 @@ int main(int argc, char *argv[]) length = 256; fprintf(stdout, "Writing the data to child......."); - if (apr_write(testfile, teststr, &length) == APR_SUCCESS) { + if (apr_file_write(testfile, teststr, &length) == APR_SUCCESS) { fprintf(stdout,"OK\n"); } else fprintf(stderr, "Write failed.\n"); @@ -166,7 +166,7 @@ int main(int argc, char *argv[]) length = 256; fprintf(stdout, "Checking the data read from pipe to child......."); buf = apr_pcalloc(context, length); - if (apr_read(testfile, buf, &length) == APR_SUCCESS) { + if (apr_file_read(testfile, buf, &length) == APR_SUCCESS) { if (!strcmp(buf, teststr)) fprintf(stdout,"OK\n"); else fprintf(stderr, "Uh-Oh\n"); @@ -174,14 +174,14 @@ int main(int argc, char *argv[]) else fprintf(stderr, "Read failed.\n"); fprintf(stdout, "Waiting for child to die......."); - if (apr_wait_proc(&newproc, APR_WAIT) != APR_CHILD_DONE) { + if (apr_proc_wait(&newproc, APR_WAIT) != APR_CHILD_DONE) { fprintf(stderr, "Wait for child failed\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Removing directory......."); - if (apr_remove_dir("proctest", context) != APR_SUCCESS) { + if (apr_dir_remove("proctest", context) != APR_SUCCESS) { fprintf(stderr, "Could not remove directory.\n"); exit(-1); } diff --git a/test/testshmem.c b/test/testshmem.c index f88062ad94a..8e9bb37be35 100644 --- a/test/testshmem.c +++ b/test/testshmem.c @@ -102,7 +102,7 @@ int main(void) apr_initialize(); fprintf(stdout, "Initializing the context......."); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "could not initialize\n"); exit(-1); } @@ -128,7 +128,7 @@ int main(void) pid = fork(); if (pid == 0) { apr_sleep(1); - if (apr_open_shmem(shm) == APR_SUCCESS) { + if (apr_shm_open(shm) == APR_SUCCESS) { msgwait(1); msgput(0, "Msg received\n"); } else { diff --git a/test/testsock.c b/test/testsock.c index d672185e192..c9af113b05d 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -74,8 +74,8 @@ static int run_basic_test(apr_pool_t *context) const char *args[2]; fprintf(stdout, "Creating children to run network tests.......\n"); - s1 = apr_createprocattr_init(&attr1, context); - s2 = apr_createprocattr_init(&attr2, context); + s1 = apr_procattr_create(&attr1, context); + s2 = apr_procattr_create(&attr2, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { fprintf(stderr, "Problem creating proc attrs\n"); @@ -84,30 +84,30 @@ static int run_basic_test(apr_pool_t *context) args[0] = apr_pstrdup(context, "server"); args[1] = NULL; - s1 = apr_create_process(&proc1, "./server", args, NULL, attr1, context); + s1 = apr_proc_create(&proc1, "./server", args, NULL, attr1, context); /* Sleep for 5 seconds to ensure the server is setup before we begin */ apr_sleep(5000000); args[0] = apr_pstrdup(context, "client"); - s2 = apr_create_process(&proc2, "./client", args, NULL, attr2, context); + s2 = apr_proc_create(&proc2, "./client", args, NULL, attr2, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { fprintf(stderr, "Problem spawning new process\n"); exit(-1); } - while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) == APR_CHILD_NOTDONE && - (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) == APR_CHILD_NOTDONE) { + while ((s1 = apr_proc_wait(&proc1, APR_NOWAIT)) == APR_CHILD_NOTDONE && + (s2 = apr_proc_wait(&proc2, APR_NOWAIT)) == APR_CHILD_NOTDONE) { continue; } if (s1 == APR_SUCCESS) { - apr_kill(&proc2, SIGTERM); - while (apr_wait_proc(&proc2, APR_WAIT) == APR_CHILD_NOTDONE); + apr_proc_kill(&proc2, SIGTERM); + while (apr_proc_wait(&proc2, APR_WAIT) == APR_CHILD_NOTDONE); } else { - apr_kill(&proc1, SIGTERM); - while (apr_wait_proc(&proc1, APR_WAIT) == APR_CHILD_NOTDONE); + apr_proc_kill(&proc1, SIGTERM); + while (apr_proc_wait(&proc1, APR_WAIT) == APR_CHILD_NOTDONE); } fprintf(stdout, "Network test completed.\n"); @@ -125,8 +125,8 @@ static int run_sendfile(apr_pool_t *context, int number) const char *args[3]; fprintf(stdout, "Creating children to run network tests.......\n"); - s1 = apr_createprocattr_init(&attr1, context); - s2 = apr_createprocattr_init(&attr2, context); + s1 = apr_procattr_create(&attr1, context); + s2 = apr_procattr_create(&attr2, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { fprintf(stderr, "Problem creating proc attrs\n"); @@ -136,7 +136,7 @@ static int run_sendfile(apr_pool_t *context, int number) args[0] = apr_pstrdup(context, "sendfile"); args[1] = apr_pstrdup(context, "server"); args[2] = NULL; - s1 = apr_create_process(&proc1, "./sendfile", args, NULL, attr1, context); + s1 = apr_proc_create(&proc1, "./sendfile", args, NULL, attr1, context); /* Sleep for 5 seconds to ensure the server is setup before we begin */ apr_sleep(5000000); @@ -155,25 +155,25 @@ static int run_sendfile(apr_pool_t *context, int number) break; } } - s2 = apr_create_process(&proc2, "./sendfile", args, NULL, attr2, context); + s2 = apr_proc_create(&proc2, "./sendfile", args, NULL, attr2, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { fprintf(stderr, "Problem spawning new process\n"); exit(-1); } - while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) == APR_CHILD_NOTDONE && - (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) == APR_CHILD_NOTDONE) { + while ((s1 = apr_proc_wait(&proc1, APR_NOWAIT)) == APR_CHILD_NOTDONE && + (s2 = apr_proc_wait(&proc2, APR_NOWAIT)) == APR_CHILD_NOTDONE) { continue; } if (s1 == APR_SUCCESS) { - apr_kill(&proc2, SIGTERM); - while (apr_wait_proc(&proc2, APR_WAIT) == APR_CHILD_NOTDONE); + apr_proc_kill(&proc2, SIGTERM); + while (apr_proc_wait(&proc2, APR_WAIT) == APR_CHILD_NOTDONE); } else { - apr_kill(&proc1, SIGTERM); - while (apr_wait_proc(&proc1, APR_WAIT) == APR_CHILD_NOTDONE); + apr_proc_kill(&proc1, SIGTERM); + while (apr_proc_wait(&proc1, APR_WAIT) == APR_CHILD_NOTDONE); } fprintf(stdout, "Network test completed.\n"); @@ -198,7 +198,7 @@ int main(int argc, char *argv[]) atexit(closeapr); fprintf(stdout, "Creating context......."); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Could not create context\n"); exit(-1); } diff --git a/test/testsockopt.c b/test/testsockopt.c index 6c9403d68e5..3759f5e3fec 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -66,14 +66,14 @@ static void failure(apr_socket_t *sock) { - apr_close_socket(sock); + apr_socket_close(sock); printf("Failed!\n"); exit(-1); } static void failureno(apr_socket_t *sock) { - apr_close_socket(sock); + apr_socket_close(sock); printf("No!\n"); exit(-1); } @@ -96,11 +96,11 @@ int main(void) exit(-1); } atexit(closeapr); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } - if (apr_create_pool(&cont2, context) != APR_SUCCESS) { + if (apr_pool_create(&cont2, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } @@ -108,7 +108,7 @@ int main(void) printf("Testing socket option functions.\n"); printf("\tCreating socket.........................."); - if ((stat = apr_create_socket(&sock, APR_INET, SOCK_STREAM, context)) + if ((stat = apr_socket_create(&sock, APR_INET, SOCK_STREAM, context)) != APR_SUCCESS){ printf("Failed to create a socket!\n"); exit(-1); @@ -117,7 +117,7 @@ int main(void) printf ("\tTrying to set APR_SO_KEEPALIVE..........."); if (apr_setsocketopt(sock, APR_SO_KEEPALIVE, 1) != APR_SUCCESS){ - apr_close_socket(sock); + apr_socket_close(sock); printf("Failed!\n"); exit (-1); } @@ -125,12 +125,12 @@ int main(void) printf("\tChecking if we recorded it..............."); if (apr_getsocketopt(sock, APR_SO_KEEPALIVE, &ck) != APR_SUCCESS){ - apr_close_socket(sock); + apr_socket_close(sock); fprintf(stderr,"Failed\n"); exit(-1); } if (ck != 1){ - apr_close_socket(sock); + apr_socket_close(sock); printf("No (%d)\n", ck); exit(-1); } @@ -138,7 +138,7 @@ int main(void) printf("\tTrying to set APR_SO_DEBUG..............."); if (apr_setsocketopt(sock, APR_SO_DEBUG, 1) != APR_SUCCESS){ - apr_close_socket(sock); + apr_socket_close(sock); printf("Failed\n"); exit (-1); } @@ -146,20 +146,20 @@ int main(void) printf("\tChecking if we recorded it..............."); if (apr_getsocketopt(sock, APR_SO_DEBUG, &ck) != APR_SUCCESS){ - apr_close_socket(sock); + apr_socket_close(sock); printf("Failed!\n"); exit (-1); } if (ck != 1){ printf ("No (%d)\n", ck); - apr_close_socket(sock); + apr_socket_close(sock); exit (-1); } printf ("Yes\n"); printf ("\tTrying to remove APR_SO_KEEPALIVE........"); if (apr_setsocketopt(sock, APR_SO_KEEPALIVE, 0) != APR_SUCCESS){ - apr_close_socket(sock); + apr_socket_close(sock); printf("Failed!\n"); exit (-1); } @@ -167,7 +167,7 @@ int main(void) printf ("\tDid we record the removal................"); if (apr_getsocketopt(sock, APR_SO_KEEPALIVE, &ck) != APR_SUCCESS){ - apr_close_socket(sock); + apr_socket_close(sock); printf("Didn't get value!\n"); exit(-1); } @@ -215,7 +215,7 @@ int main(void) #endif printf("\tTrying to close the socket..............."); - if ((stat = apr_close_socket(sock)) != APR_SUCCESS){ + if ((stat = apr_socket_close(sock)) != APR_SUCCESS){ printf("Failed to close the socket!\n"); exit(-1); } diff --git a/test/testthread.c b/test/testthread.c index 3e572433db0..3ed5bcd21ec 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -77,9 +77,9 @@ void * APR_THREAD_FUNC thread_func1(void *data) { int i; for (i = 0; i < 10000; i++) { - apr_lock(thread_lock); + apr_lock_aquire(thread_lock); x++; - apr_unlock(thread_lock); + apr_lock_release(thread_lock); } return NULL; } @@ -88,9 +88,9 @@ void * APR_THREAD_FUNC thread_func2(void *data) { int i; for (i = 0; i < 10000; i++) { - apr_lock(thread_lock); + apr_lock_aquire(thread_lock); x++; - apr_unlock(thread_lock); + apr_lock_release(thread_lock); } return NULL; } @@ -99,9 +99,9 @@ void * APR_THREAD_FUNC thread_func3(void *data) { int i; for (i = 0; i < 10000; i++) { - apr_lock(thread_lock); + apr_lock_aquire(thread_lock); x++; - apr_unlock(thread_lock); + apr_lock_release(thread_lock); } return NULL; } @@ -110,9 +110,9 @@ void * APR_THREAD_FUNC thread_func4(void *data) { int i; for (i = 0; i < 10000; i++) { - apr_lock(thread_lock); + apr_lock_aquire(thread_lock); x++; - apr_unlock(thread_lock); + apr_lock_release(thread_lock); } return NULL; } @@ -132,14 +132,14 @@ int main(void) apr_initialize(); fprintf(stdout, "Initializing the context......."); - if (apr_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "could not initialize\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Initializing the lock......."); - s1 = apr_create_lock(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); + s1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); if (s1 != APR_SUCCESS) { fprintf(stderr, "Could not create lock\n"); exit(-1); @@ -147,10 +147,10 @@ int main(void) fprintf(stdout, "OK\n"); fprintf(stdout, "Starting all the threads......."); - s1 = apr_create_thread(&t1, NULL, thread_func1, NULL, context); - s2 = apr_create_thread(&t2, NULL, thread_func2, NULL, context); - s3 = apr_create_thread(&t3, NULL, thread_func3, NULL, context); - s4 = apr_create_thread(&t4, NULL, thread_func4, NULL, context); + s1 = apr_thread_create(&t1, NULL, thread_func1, NULL, context); + s2 = apr_thread_create(&t2, NULL, thread_func2, NULL, context); + s3 = apr_thread_create(&t3, NULL, thread_func3, NULL, context); + s4 = apr_thread_create(&t4, NULL, thread_func4, NULL, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || s3 != APR_SUCCESS || s4 != APR_SUCCESS) { fprintf(stderr, "Error starting thread\n"); diff --git a/test/testtime.c b/test/testtime.c index a246ac3b57a..20f315cf106 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -69,8 +69,8 @@ int main(void) fprintf(stdout, "Testing Time functions.\n"); - fprintf(stdout, "\tapr_now......."); - now = apr_now(); + fprintf(stdout, "\tapr_time_now......."); + now = apr_time_now(); fprintf(stdout, "OK\n"); fprintf(stdout, "\tapr_explode_localtime......."); diff --git a/test/testuuid.c b/test/testuuid.c index 6330f6c418f..1d4c7e9d41d 100644 --- a/test/testuuid.c +++ b/test/testuuid.c @@ -64,11 +64,11 @@ int main(int argc, char **argv) char buf[APR_UUID_FORMATTED_LENGTH + 1]; int retcode = 0; - apr_get_uuid(&uuid); - apr_format_uuid(buf, &uuid); + apr_uuid_get(&uuid); + apr_uuid_format(buf, &uuid); printf("UUID: %s\n", buf); - apr_parse_uuid(&uuid2, buf); + apr_uuid_parse(&uuid2, buf); if (memcmp(&uuid, &uuid2, sizeof(uuid)) == 0) printf("Parse appears to work.\n"); else { @@ -76,15 +76,15 @@ int main(int argc, char **argv) retcode = 1; } - apr_format_uuid(buf, &uuid2); + apr_uuid_format(buf, &uuid2); printf("parsed/reformatted UUID: %s\n", buf); /* generate two of them quickly */ - apr_get_uuid(&uuid); - apr_get_uuid(&uuid2); - apr_format_uuid(buf, &uuid); + apr_uuid_get(&uuid); + apr_uuid_get(&uuid2); + apr_uuid_format(buf, &uuid); printf("UUID 1: %s\n", buf); - apr_format_uuid(buf, &uuid2); + apr_uuid_format(buf, &uuid2); printf("UUID 2: %s\n", buf); return retcode; diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index b15f0eb8133..1b33ca06dbf 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -61,7 +61,7 @@ struct send_pipe { int err; }; -apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) +apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); @@ -82,12 +82,12 @@ apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, +apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) { apr_status_t status; if (in != 0) { - if ((status = apr_create_pipe(&attr->child_in, &attr->parent_in, + if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -95,18 +95,18 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->child_in, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, 0); break; default: - apr_set_pipe_timeout(attr->child_in, 0); - apr_set_pipe_timeout(attr->parent_in, 0); + apr_file_pipe_timeout_set(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, 0); } } if (out) { - if ((status = apr_create_pipe(&attr->parent_out, &attr->child_out, + if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -114,18 +114,18 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->child_out, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, 0); break; default: - apr_set_pipe_timeout(attr->child_out, 0); - apr_set_pipe_timeout(attr->parent_out, 0); + apr_file_pipe_timeout_set(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, 0); } } if (err) { - if ((status = apr_create_pipe(&attr->parent_err, &attr->child_err, + if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -133,20 +133,20 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->child_err, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, 0); break; default: - apr_set_pipe_timeout(attr->child_err, 0); - apr_set_pipe_timeout(attr->parent_err, 0); + apr_file_pipe_timeout_set(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, 0); } } return APR_SUCCESS; } -apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, +apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { char * cwd; @@ -166,20 +166,20 @@ apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, return APR_ENOMEM; } -apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, +apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) +apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) +apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -201,7 +201,7 @@ apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) } -apr_status_t apr_create_process(apr_proc_t *new, const char *progname, +apr_status_t apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *cont) @@ -259,13 +259,13 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, resume_thread(newproc); if (attr->child_in) { - apr_close(attr->child_in); + apr_file_close(attr->child_in); } if (attr->child_out) { - apr_close(attr->child_out); + apr_file_close(attr->child_out); } if (attr->child_err) { - apr_close(attr->child_err); + apr_file_close(attr->child_err); } send_data(newproc, 0, (void*)sp, sizeof(struct send_pipe)); @@ -279,7 +279,7 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, return APR_SUCCESS; } -apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, +apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) { int waitpid_options = WUNTRACED; @@ -297,7 +297,7 @@ apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, return errno; } -apr_status_t apr_wait_proc(apr_proc_t *proc, +apr_status_t apr_proc_wait(apr_proc_t *proc, apr_wait_how_e wait) { status_t exitval, rv; @@ -321,52 +321,52 @@ apr_status_t apr_wait_proc(apr_proc_t *proc, return APR_CHILD_NOTDONE; } -apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, +apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); if (child_in != NULL) - apr_dupfile(&attr->child_in, child_in, attr->cntxt); + apr_file_dup(&attr->child_in, child_in, attr->cntxt); if (parent_in != NULL) - apr_dupfile(&attr->parent_in, parent_in, attr->cntxt); + apr_file_dup(&attr->parent_in, parent_in, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, +apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - apr_dupfile(&attr->child_out, child_out, attr->cntxt); + apr_file_dup(&attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); + apr_file_dup(&attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, +apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - apr_dupfile(&attr->child_err, child_err, attr->cntxt); + apr_file_dup(&attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); + apr_file_dup(&attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, +apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, void *limit) { return APR_ENOTIMPL; diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index d141d835e57..58880ac810e 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -54,7 +54,7 @@ #include "threadproc.h" -apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) +apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { (*new) = (apr_threadattr_t *)apr_palloc(cont, sizeof(apr_threadattr_t)); @@ -69,7 +69,7 @@ apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) +apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) { if (on == 1){ attr->detached = 1; @@ -79,7 +79,7 @@ apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) return APR_SUCCESS; } -apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) +apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) { if (attr->detached == 1){ return APR_DETACH; @@ -87,7 +87,7 @@ apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) return APR_NOTDETACH; } -apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, +apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) { @@ -107,7 +107,7 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, else temp = B_NORMAL_PRIORITY; - stat = apr_create_pool(&(*new)->cntxt, cont); + stat = apr_pool_create(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } @@ -124,7 +124,7 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { - apr_destroy_pool(thd->cntxt); + apr_pool_destroy(thd->cntxt); exit_thread ((status_t)retval); return APR_SUCCESS; } @@ -149,25 +149,25 @@ apr_status_t apr_thread_detach(apr_thread_t *thd) } } -apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) +apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { - return apr_get_userdata(data, key, thread->cntxt); + return apr_pool_userdata_get(data, key, thread->cntxt); } -apr_status_t apr_set_threaddata(void *data, const char *key, +apr_status_t apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) { - return apr_set_userdata(data, key, cleanup, thread->cntxt); + return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); } -apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd) +apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { *thethd = &thd->td; return APR_SUCCESS; } -apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, +apr_status_t apr_os_thread_pupt(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont) { if (cont == NULL) { diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index 037ce46a1f5..f6d34f2227f 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -58,7 +58,7 @@ static struct beos_key key_table[BEOS_MAX_DATAKEYS]; static struct beos_private_data *beos_data[BEOS_MAX_DATAKEYS]; static sem_id lock; -apr_status_t apr_create_thread_private(apr_threadkey_t **key, +apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) { (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); @@ -82,7 +82,7 @@ apr_status_t apr_create_thread_private(apr_threadkey_t **key, return APR_ENOMEM; } -apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) { thread_id tid; int i, index=0; @@ -114,7 +114,7 @@ apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) return APR_SUCCESS; } -apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { thread_id tid; int i,index = 0, ret; @@ -169,7 +169,7 @@ apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) return APR_ENOMEM; } -apr_status_t apr_delete_thread_private(apr_threadkey_t *key) +apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) { if (key->key < BEOS_MAX_DATAKEYS){ acquire_sem(key_table[key->key].lock); @@ -184,26 +184,26 @@ apr_status_t apr_delete_thread_private(apr_threadkey_t *key) return APR_SUCCESS; } -apr_status_t apr_get_threadkeydata(void **data, const char *key, +apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { - return apr_get_userdata(data, key, threadkey->cntxt); + return apr_pool_userdata_get(data, key, threadkey->cntxt); } -apr_status_t apr_set_threadkeydata(void *data, const char *key, +apr_status_t apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) { - return apr_set_userdata(data, key, cleanup, threadkey->cntxt); + return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); } -apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, +apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont) { if (cont == NULL) { diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 9231c668612..4c0f2b66bdb 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -71,7 +71,7 @@ #include <process.h> #include <stdlib.h> -apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) +apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); @@ -92,12 +92,12 @@ apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, +apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) { apr_status_t stat; if (in) { - if ((stat = apr_create_pipe(&attr->child_in, &attr->parent_in, + if ((stat = apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt)) != APR_SUCCESS) { return stat; } @@ -105,18 +105,18 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->child_in, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, 0); break; default: - apr_set_pipe_timeout(attr->child_in, 0); - apr_set_pipe_timeout(attr->parent_in, 0); + apr_file_pipe_timeout_set(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, 0); } } if (out) { - if ((stat = apr_create_pipe(&attr->parent_out, &attr->child_out, + if ((stat = apr_file_pipe_create(&attr->parent_out, &attr->child_out, attr->cntxt)) != APR_SUCCESS) { return stat; } @@ -124,18 +124,18 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->child_out, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, 0); break; default: - apr_set_pipe_timeout(attr->child_out, 0); - apr_set_pipe_timeout(attr->parent_out, 0); + apr_file_pipe_timeout_set(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, 0); } } if (err) { - if ((stat = apr_create_pipe(&attr->parent_err, &attr->child_err, + if ((stat = apr_file_pipe_create(&attr->parent_err, &attr->child_err, attr->cntxt)) != APR_SUCCESS) { return stat; } @@ -143,68 +143,68 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->child_err, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, 0); break; default: - apr_set_pipe_timeout(attr->child_err, 0); - apr_set_pipe_timeout(attr->parent_err, 0); + apr_file_pipe_timeout_set(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, 0); } } return APR_SUCCESS; } -apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, +apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); if (child_in != NULL) - apr_dupfile(&attr->child_in, child_in, attr->cntxt); + apr_file_dup(&attr->child_in, child_in, attr->cntxt); if (parent_in != NULL) - apr_dupfile(&attr->parent_in, parent_in, attr->cntxt); + apr_file_dup(&attr->parent_in, parent_in, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, +apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - apr_dupfile(&attr->child_out, child_out, attr->cntxt); + apr_file_dup(&attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); + apr_file_dup(&attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, +apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - apr_dupfile(&attr->child_err, child_err, attr->cntxt); + apr_file_dup(&attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); + apr_file_dup(&attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) +apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { attr->currdir = apr_pstrdup(attr->cntxt, dir); if (attr->currdir) { @@ -213,20 +213,20 @@ apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) return APR_ENOMEM; } -apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, +apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) +apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) +apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -277,7 +277,7 @@ static char *double_quotes(apr_pool_t *cntxt, const char *str) -apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, +apr_status_t apr_proc_create(apr_proc_t *proc, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *cont) @@ -348,14 +348,14 @@ apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, strcpy(interpreter, "#!" SHELL_PATH); extra_arg = "/C"; } else if (stricmp(extension, ".exe") != 0) { - status = apr_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, cont); + status = apr_file_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, cont); if (status != APR_SUCCESS && APR_STATUS_IS_ENOENT(status)) { progname = apr_pstrcat(cont, progname, ".exe", NULL); } if (status == APR_SUCCESS) { - status = apr_fgets(interpreter, sizeof(interpreter), progfile); + status = apr_file_gets(interpreter, sizeof(interpreter), progfile); if (status == APR_SUCCESS) { if (interpreter[0] == '#' && interpreter[1] == '!') { @@ -376,7 +376,7 @@ apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, } } } - apr_close(progfile); + apr_file_close(progfile); } i = 0; @@ -461,21 +461,21 @@ apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, } if (attr->child_in) { - apr_close(attr->child_in); + apr_file_close(attr->child_in); dup = STDIN_FILENO; DosDupHandle(save_in, &dup); DosClose(save_in); } if (attr->child_out) { - apr_close(attr->child_out); + apr_file_close(attr->child_out); dup = STDOUT_FILENO; DosDupHandle(save_out, &dup); DosClose(save_out); } if (attr->child_err) { - apr_close(attr->child_err); + apr_file_close(attr->child_err); dup = STDERR_FILENO; DosDupHandle(save_err, &dup); DosClose(save_err); @@ -492,7 +492,7 @@ apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, -apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, +apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) { RESULTCODES codes; @@ -520,7 +520,7 @@ apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, -apr_status_t apr_wait_proc(apr_proc_t *proc, +apr_status_t apr_proc_wait(apr_proc_t *proc, apr_wait_how_e wait) { RESULTCODES codes; diff --git a/threadproc/os2/signals.c b/threadproc/os2/signals.c index 56170f4016e..e15697d5ad3 100644 --- a/threadproc/os2/signals.c +++ b/threadproc/os2/signals.c @@ -62,7 +62,7 @@ #include <string.h> #include <sys/wait.h> -apr_status_t apr_kill(apr_proc_t *proc, int signal) +apr_status_t apr_proc_kill(apr_proc_t *proc, int signal) { /* SIGTERM's don't work too well in OS/2 (only affects other EMX programs). CGIs may not be, esp. REXX scripts, so use a native call instead */ diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index a99eb5968c3..b0682e58a47 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -61,7 +61,7 @@ #include "fileio.h" #include <stdlib.h> -apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) +apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { (*new) = (apr_threadattr_t *)apr_palloc(cont, sizeof(apr_threadattr_t)); @@ -76,7 +76,7 @@ apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) -apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) +apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) { attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; @@ -84,7 +84,7 @@ apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) -apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) +apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) { return (attr->attr & APR_THREADATTR_DETACHED) ? APR_DETACH : APR_NOTDETACH; } @@ -99,7 +99,7 @@ static void apr_thread_begin(void *arg) -apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, +apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) { @@ -117,14 +117,14 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, thread->attr = attr; thread->func = func; thread->data = data; - stat = apr_create_pool(&thread->cntxt, cont); + stat = apr_pool_create(&thread->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } if (attr == NULL) { - stat = apr_create_threadattr(&thread->attr, thread->cntxt); + stat = apr_threadattr_create(&thread->attr, thread->cntxt); if (stat != APR_SUCCESS) { return stat; diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index 15143e512a4..24291b8f4cf 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -59,7 +59,7 @@ #include "apr_lib.h" #include "fileio.h" -apr_status_t apr_create_thread_private(apr_threadkey_t **key, +apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) { (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); @@ -72,19 +72,19 @@ apr_status_t apr_create_thread_private(apr_threadkey_t **key, return APR_OS2_STATUS(DosAllocThreadLocalMemory(1, &((*key)->key))); } -apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) { (*new) = (void *)*(key->key); return APR_SUCCESS; } -apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { *(key->key) = (ULONG)priv; return APR_SUCCESS; } -apr_status_t apr_delete_thread_private(apr_threadkey_t *key) +apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) { return APR_OS2_STATUS(DosFreeThreadLocalMemory(key->key)); } diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 6f91f21e495..58b49493a0e 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -56,7 +56,7 @@ #include "apr_strings.h" #include "apr_portable.h" -apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) +apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_pcalloc(cont, sizeof(apr_procattr_t)); @@ -68,12 +68,12 @@ apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, +apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) { apr_status_t status; if (in != 0) { - if ((status = apr_create_pipe(&attr->child_in, &attr->parent_in, + if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -81,18 +81,18 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->child_in, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, 0); break; default: - apr_set_pipe_timeout(attr->child_in, 0); - apr_set_pipe_timeout(attr->parent_in, 0); + apr_file_pipe_timeout_set(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, 0); } } if (out) { - if ((status = apr_create_pipe(&attr->parent_out, &attr->child_out, + if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -100,18 +100,18 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->child_out, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, 0); break; default: - apr_set_pipe_timeout(attr->child_out, 0); - apr_set_pipe_timeout(attr->parent_out, 0); + apr_file_pipe_timeout_set(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, 0); } } if (err) { - if ((status = apr_create_pipe(&attr->parent_err, &attr->child_err, + if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -119,69 +119,69 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_set_pipe_timeout(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->child_err, 0); break; case APR_CHILD_BLOCK: - apr_set_pipe_timeout(attr->parent_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, 0); break; default: - apr_set_pipe_timeout(attr->child_err, 0); - apr_set_pipe_timeout(attr->parent_err, 0); + apr_file_pipe_timeout_set(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, 0); } } return APR_SUCCESS; } -apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, +apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); if (child_in != NULL) - apr_dupfile(&attr->child_in, child_in, attr->cntxt); + apr_file_dup(&attr->child_in, child_in, attr->cntxt); if (parent_in != NULL) - apr_dupfile(&attr->parent_in, parent_in, attr->cntxt); + apr_file_dup(&attr->parent_in, parent_in, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, +apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - apr_dupfile(&attr->child_out, child_out, attr->cntxt); + apr_file_dup(&attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); + apr_file_dup(&attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, +apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - apr_dupfile(&attr->child_err, child_err, attr->cntxt); + apr_file_dup(&attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); + apr_file_dup(&attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } -apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, +apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { attr->currdir = apr_pstrdup(attr->cntxt, dir); @@ -191,20 +191,20 @@ apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, return APR_ENOMEM; } -apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, +apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) +apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) +apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -270,7 +270,7 @@ static apr_status_t limit_proc(apr_procattr_t *attr) return APR_SUCCESS; } -apr_status_t apr_create_process(apr_proc_t *new, const char *progname, +apr_status_t apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *cont) @@ -288,19 +288,19 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, int status; /* child process */ if (attr->child_in) { - apr_close(attr->parent_in); + apr_file_close(attr->parent_in); dup2(attr->child_in->filedes, STDIN_FILENO); - apr_close(attr->child_in); + apr_file_close(attr->child_in); } if (attr->child_out) { - apr_close(attr->parent_out); + apr_file_close(attr->parent_out); dup2(attr->child_out->filedes, STDOUT_FILENO); - apr_close(attr->child_out); + apr_file_close(attr->child_out); } if (attr->child_err) { - apr_close(attr->parent_err); + apr_file_close(attr->parent_err); dup2(attr->child_err->filedes, STDERR_FILENO); - apr_close(attr->child_err); + apr_file_close(attr->child_err); } apr_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ @@ -311,7 +311,7 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, } } - apr_cleanup_for_exec(); + apr_pool_cleanup_for_exec(); if ((status = limit_proc(attr)) != APR_SUCCESS) { return status; @@ -333,13 +333,13 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, } newargs[i + 2] = NULL; if (attr->detached) { - apr_detach(); + apr_proc_detach(); } execve(SHELL_PATH, (char * const *) newargs, (char * const *)env); } else { if (attr->detached) { - apr_detach(); + apr_proc_detach(); } execve(progname, (char * const *)args, (char * const *)env); } @@ -348,18 +348,18 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, } /* Parent process */ if (attr->child_in) { - apr_close(attr->child_in); + apr_file_close(attr->child_in); } if (attr->child_out) { - apr_close(attr->child_out); + apr_file_close(attr->child_out); } if (attr->child_err) { - apr_close(attr->child_err); + apr_file_close(attr->child_err); } return APR_SUCCESS; } -apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, +apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) { int waitpid_options = WUNTRACED; @@ -377,7 +377,7 @@ apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, return errno; } -apr_status_t apr_wait_proc(apr_proc_t *proc, +apr_status_t apr_proc_wait(apr_proc_t *proc, apr_wait_how_e waithow) { pid_t status; @@ -401,7 +401,7 @@ apr_status_t apr_wait_proc(apr_proc_t *proc, return errno; } -apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, +apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, struct rlimit *limit) { switch(what) { diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index e29954cda7e..dd2fffb1eda 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -54,7 +54,7 @@ #include "threadproc.h" -apr_status_t apr_detach(void) +apr_status_t apr_proc_detach(void) { int x; pid_t pgrp; diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index cd561fa82ce..c402fb44685 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -59,7 +59,7 @@ #include <signal.h> #endif -apr_status_t apr_kill(apr_proc_t *proc, int sig) +apr_status_t apr_proc_kill(apr_proc_t *proc, int sig) { if (kill(proc->pid, sig) == -1) { return errno; diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index c083fb89ea8..457bccdadc4 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -59,7 +59,7 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) +apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { apr_status_t stat; @@ -82,7 +82,7 @@ apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) return stat; } -apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) +apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) { apr_status_t stat; #ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR @@ -102,7 +102,7 @@ apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) } } -apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) +apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) { int state; @@ -116,7 +116,7 @@ apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) return APR_NOTDETACH; } -apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, +apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) { @@ -142,7 +142,7 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, else temp = NULL; - stat = apr_create_pool(&(*new)->cntxt, cont); + stat = apr_pool_create(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } @@ -160,7 +160,7 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { - apr_destroy_pool(thd->cntxt); + apr_pool_destroy(thd->cntxt); pthread_exit(retval); return APR_SUCCESS; } @@ -199,25 +199,25 @@ apr_status_t apr_thread_detach(apr_thread_t *thd) } } -apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) +apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { - return apr_get_userdata(data, key, thread->cntxt); + return apr_pool_userdata_get(data, key, thread->cntxt); } -apr_status_t apr_set_threaddata(void *data, const char *key, +apr_status_t apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) { - return apr_set_userdata(data, key, cleanup, thread->cntxt); + return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); } -apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd) +apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { *thethd = thd->td; return APR_SUCCESS; } -apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, +apr_status_t apr_os_thread_pupt(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont) { if (cont == NULL) { @@ -235,77 +235,77 @@ apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, #if !APR_HAS_THREADS -apr_status_t apr_create_thread(apr_thread_t **new_thread, apr_threadattr_t *attr, +apr_status_t apr_thread_create(apr_thread_t **new_thread, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) { return APR_ENOTIMPL; } -apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) +apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { return APR_ENOTIMPL; } -apr_status_t apr_create_thread_private(apr_threadkey_t **key, void (*dest)(void *), +apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) { return APR_ENOTIMPL; } -apr_status_t apr_delete_thread_private(apr_threadkey_t *key) +apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) { return APR_ENOTIMPL; } -apr_status_t apr_get_os_thread(void); /* avoid warning for no prototype */ +apr_status_t apr_os_thread_get(void); /* avoid warning for no prototype */ -apr_status_t apr_get_os_thread(void) +apr_status_t apr_os_thread_get(void) { return APR_ENOTIMPL; } -apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) +apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) { return APR_ENOTIMPL; } -apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) +apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { return APR_ENOTIMPL; } -apr_status_t apr_get_threadkeydata(void **data, const char *key, +apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { return APR_ENOTIMPL; } -apr_status_t apr_get_thread_private(void **new_mem, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_get(void **new_mem, apr_threadkey_t *key) { return APR_ENOTIMPL; } -apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) +apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) { return APR_ENOTIMPL; } -apr_status_t apr_set_threaddata(void *data, const char *key, +apr_status_t apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup)(void *), apr_thread_t *thread) { return APR_ENOTIMPL; } -apr_status_t apr_set_threadkeydata(void *data, const char *key, +apr_status_t apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) { return APR_ENOTIMPL; } -apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { return APR_ENOTIMPL; } diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 9843f2e91a6..0780335f8a9 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -59,7 +59,7 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -apr_status_t apr_create_thread_private(apr_threadkey_t **key, +apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) { apr_status_t stat; @@ -77,7 +77,7 @@ apr_status_t apr_create_thread_private(apr_threadkey_t **key, return stat; } -apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) { #ifdef PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS if (pthread_getspecific(key->key,new)) @@ -88,7 +88,7 @@ apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) return APR_SUCCESS; } -apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) +apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { apr_status_t stat; if ((stat = pthread_setspecific(key->key, priv)) == 0) { @@ -100,7 +100,7 @@ apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) } #ifdef HAVE_PTHREAD_KEY_DELETE -apr_status_t apr_delete_thread_private(apr_threadkey_t *key) +apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) { apr_status_t stat; if ((stat = pthread_key_delete(key->key)) == 0) { @@ -110,26 +110,26 @@ apr_status_t apr_delete_thread_private(apr_threadkey_t *key) } #endif -apr_status_t apr_get_threadkeydata(void **data, const char *key, +apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { - return apr_get_userdata(data, key, threadkey->cntxt); + return apr_pool_userdata_get(data, key, threadkey->cntxt); } -apr_status_t apr_set_threadkeydata(void *data, const char *key, +apr_status_t apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) { - return apr_set_userdata(data, key, cleanup, threadkey->cntxt); + return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); } -apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, +apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont) { if (cont == NULL) { @@ -146,9 +146,9 @@ apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, #endif /* APR_HAS_THREADS */ #if !APR_HAS_THREADS -apr_status_t apr_get_os_threadkey(void); /* avoid warning for no prototype */ +apr_status_t apr_os_threadkey_get(void); /* avoid warning for no prototype */ -apr_status_t apr_get_os_threadkey(void) +apr_status_t apr_os_threadkey_get(void) { return APR_ENOTIMPL; } diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index c0fe0c8f02a..9d2e3a42274 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -71,7 +71,7 @@ * */ -APR_DECLARE(apr_status_t) apr_createprocattr_init(apr_procattr_t **new, +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); @@ -152,7 +152,7 @@ static apr_status_t make_inheritable_duplicate(apr_file_t *original, if (original == NULL) return APR_SUCCESS; - /* Can't use apr_dupfile here because it creates a non-inhertible + /* Can't use apr_file_dup here because it creates a non-inhertible * handle, and apr_open_file'd apr_file_t's are non-inheritable, * so we must assume we need to make an inheritable handle. */ @@ -170,7 +170,7 @@ static apr_status_t make_inheritable_duplicate(apr_file_t *original, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_setprocattr_io(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) @@ -204,7 +204,7 @@ APR_DECLARE(apr_status_t) apr_setprocattr_io(apr_procattr_t *attr, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_setprocattr_childin(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { @@ -227,7 +227,7 @@ APR_DECLARE(apr_status_t) apr_setprocattr_childin(apr_procattr_t *attr, return stat; } -APR_DECLARE(apr_status_t) apr_setprocattr_childout(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) { @@ -250,7 +250,7 @@ APR_DECLARE(apr_status_t) apr_setprocattr_childout(apr_procattr_t *attr, return stat; } -APR_DECLARE(apr_status_t) apr_setprocattr_childerr(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) { @@ -273,7 +273,7 @@ APR_DECLARE(apr_status_t) apr_setprocattr_childerr(apr_procattr_t *attr, return stat; } -APR_DECLARE(apr_status_t) apr_setprocattr_dir(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { char path[MAX_PATH]; @@ -297,14 +297,14 @@ APR_DECLARE(apr_status_t) apr_setprocattr_dir(apr_procattr_t *attr, return APR_ENOMEM; } -APR_DECLARE(apr_status_t) apr_setprocattr_cmdtype(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_setprocattr_detach(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t det) { attr->detached = det; @@ -312,11 +312,11 @@ APR_DECLARE(apr_status_t) apr_setprocattr_detach(apr_procattr_t *attr, } /* TODO: - * apr_create_process with APR_SHELLCMD on Win9x won't work due to MS KB: + * apr_proc_create with APR_SHELLCMD on Win9x won't work due to MS KB: * Q150956 */ -APR_DECLARE(apr_status_t) apr_create_process(apr_proc_t *new, +APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, const char * const *env, @@ -440,13 +440,13 @@ APR_DECLARE(apr_status_t) apr_create_process(apr_proc_t *new, new->pid = (pid_t) pi.hProcess; if (attr->child_in) { - apr_close(attr->child_in); + apr_file_close(attr->child_in); } if (attr->child_out) { - apr_close(attr->child_out); + apr_file_close(attr->child_out); } if (attr->child_err) { - apr_close(attr->child_err); + apr_file_close(attr->child_err); } CloseHandle(pi.hThread); @@ -456,7 +456,7 @@ APR_DECLARE(apr_status_t) apr_create_process(apr_proc_t *new, return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_wait_proc(apr_proc_t *proc, apr_wait_how_e wait) +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, apr_wait_how_e wait) { DWORD stat; if (!proc) diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 056de8904ad..dc59c86907f 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -64,7 +64,7 @@ #endif /* Windows only really support killing process, but that will do for now. */ -APR_DECLARE(apr_status_t) apr_kill(apr_proc_t *proc, int signal) +APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signal) { if (TerminateProcess((HANDLE)proc->pid, signal) == 0) { return apr_get_os_error(); diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 231d2e36621..b243d83593f 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -61,7 +61,7 @@ #include <process.h> -APR_DECLARE(apr_status_t) apr_create_threadattr(apr_threadattr_t **new, +APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { (*new) = (apr_threadattr_t *)apr_palloc(cont, @@ -75,21 +75,21 @@ APR_DECLARE(apr_status_t) apr_create_threadattr(apr_threadattr_t **new, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_setthreadattr_detach(apr_threadattr_t *attr, +APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) { attr->detach = on; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_getthreadattr_detach(apr_threadattr_t *attr) +APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr) { if (attr->detach == 1) return APR_DETACH; return APR_NOTDETACH; } -APR_DECLARE(apr_status_t) apr_create_thread(apr_thread_t **new, +APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) @@ -106,7 +106,7 @@ APR_DECLARE(apr_status_t) apr_create_thread(apr_thread_t **new, (*new)->cntxt = cont; - stat = apr_create_pool(&(*new)->cntxt, cont); + stat = apr_pool_create(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } @@ -133,7 +133,7 @@ APR_DECLARE(apr_status_t) apr_create_thread(apr_thread_t **new, APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { - apr_destroy_pool(thd->cntxt); + apr_pool_destroy(thd->cntxt); _endthreadex(*retval); return APR_SUCCESS; } @@ -164,20 +164,20 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) } } -APR_DECLARE(apr_status_t) apr_get_threaddata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { - return apr_get_userdata(data, key, thread->cntxt); + return apr_pool_userdata_get(data, key, thread->cntxt); } -APR_DECLARE(apr_status_t) apr_set_threaddata(void *data, const char *key, +APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) { - return apr_set_userdata(data, key, cleanup, thread->cntxt); + return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); } -APR_DECLARE(apr_status_t) apr_get_os_thread(apr_os_thread_t **thethd, +APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { if (thd == NULL) { @@ -187,7 +187,7 @@ APR_DECLARE(apr_status_t) apr_get_os_thread(apr_os_thread_t **thethd, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_thread(apr_thread_t **thd, +APR_DECLARE(apr_status_t) apr_os_thread_pupt(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont) { diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 70128235604..da0baf216e5 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -59,7 +59,7 @@ #include "apr_errno.h" #include "apr_portable.h" -APR_DECLARE(apr_status_t) apr_create_thread_private(apr_threadkey_t **key, +APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) { @@ -69,7 +69,7 @@ APR_DECLARE(apr_status_t) apr_create_thread_private(apr_threadkey_t **key, return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_get_thread_private(void **new, +APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key) { if ((*new) = TlsGetValue(key->key)) { @@ -78,7 +78,7 @@ APR_DECLARE(apr_status_t) apr_get_thread_private(void **new, return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_set_thread_private(void *priv, +APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { if (TlsSetValue(key->key, priv)) { @@ -87,7 +87,7 @@ APR_DECLARE(apr_status_t) apr_set_thread_private(void *priv, return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_delete_thread_private(apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) { if (TlsFree(key->key)) { return APR_SUCCESS; @@ -95,27 +95,27 @@ APR_DECLARE(apr_status_t) apr_delete_thread_private(apr_threadkey_t *key) return apr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_get_threadkeydata(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { - return apr_get_userdata(data, key, threadkey->cntxt); + return apr_pool_userdata_get(data, key, threadkey->cntxt); } -APR_DECLARE(apr_status_t) apr_set_threadkeydata(void *data, const char *key, +APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup)(void *), apr_threadkey_t *threadkey) { - return apr_set_userdata(data, key, cleanup, threadkey->cntxt); + return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); } -APR_DECLARE(apr_status_t) apr_get_os_threadkey(apr_os_threadkey_t *thekey, +APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_threadkey(apr_threadkey_t **key, +APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont) { diff --git a/time/unix/time.c b/time/unix/time.c index 7eb421970b2..db468b0998a 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -79,7 +79,7 @@ apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input) } -apr_time_t apr_now(void) +apr_time_t apr_time_now(void) { struct timeval tv; gettimeofday(&tv, NULL); @@ -211,14 +211,14 @@ apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) return APR_SUCCESS; } -apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime) +apr_status_t apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime) { (*ostime)->tv_usec = *aprtime % APR_USEC_PER_SEC; (*ostime)->tv_sec = *aprtime / APR_USEC_PER_SEC; return APR_SUCCESS; } -apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, +apr_status_t apr_os_exp_time_get(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprtime) { (*ostime)->tm_sec = aprtime->tm_sec; @@ -233,14 +233,14 @@ apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, return APR_SUCCESS; } -apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, +apr_status_t apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont) { *aprtime = (*ostime)->tv_sec * APR_USEC_PER_SEC + (*ostime)->tv_usec; return APR_SUCCESS; } -apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime, +apr_status_t apr_os_exp_time_pupt(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) { aprtime->tm_sec = (*ostime)->tm_sec; diff --git a/time/win32/time.c b/time/win32/time.c index 6d46f69f631..b106d2dc43e 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -145,7 +145,7 @@ APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, } /* Return micro-seconds since the Unix epoch (jan. 1, 1970) UTC */ -APR_DECLARE(apr_time_t) apr_now(void) +APR_DECLARE(apr_time_t) apr_time_now(void) { LONGLONG aprtime = 0; FILETIME time; @@ -213,7 +213,7 @@ APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_os_imp_time(apr_os_imp_time_t **ostime, +APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime) { /* TODO: Consider not passing in pointer to apr_time_t (e.g., call by value) */ @@ -221,7 +221,7 @@ APR_DECLARE(apr_status_t) apr_get_os_imp_time(apr_os_imp_time_t **ostime, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_os_exp_time(apr_os_exp_time_t **ostime, +APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprexptime) { (*ostime)->wYear = aprexptime->tm_year + 1900; @@ -235,7 +235,7 @@ APR_DECLARE(apr_status_t) apr_get_os_exp_time(apr_os_exp_time_t **ostime, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_imp_time(apr_time_t *aprtime, +APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont) { @@ -243,7 +243,7 @@ APR_DECLARE(apr_status_t) apr_put_os_imp_time(apr_time_t *aprtime, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_put_os_exp_time(apr_exploded_time_t *aprtime, +APR_DECLARE(apr_status_t) apr_os_exp_time_pupt(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) { From e27bbaed56568fa5dd2a82e45e039eb409d84065 Mon Sep 17 00:00:00 2001 From: Doug MacEachern <dougm@apache.org> Date: Thu, 8 Feb 2001 17:06:11 +0000 Subject: [PATCH 1213/7878] s/pupt/put/g typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61195 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 8 ++++---- threadproc/beos/thread.c | 2 +- threadproc/unix/thread.c | 2 +- threadproc/win32/thread.c | 2 +- time/unix/time.c | 2 +- time/win32/time.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 00d30770765..ddbc64153b2 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -351,9 +351,9 @@ APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, * @param aprtime the APR time format * @param ostime the time to convert * @param cont the pool to use if necessary - * @deffunc apr_status_t apr_os_exp_time_pupt(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) + * @deffunc apr_status_t apr_os_exp_time_put(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) */ -APR_DECLARE(apr_status_t) apr_os_exp_time_pupt(apr_exploded_time_t *aprtime, +APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont); @@ -364,9 +364,9 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_pupt(apr_exploded_time_t *aprtime, * @param thd The apr thread we are converting to. * @param thethd The os specific thread to convert * @param cont The pool to use if it is needed. - * @deffunc apr_status_t apr_os_thread_pupt(apr_thread_t **thd, apr_os_thread_t *thethd, + * @deffunc apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, */ -APR_DECLARE(apr_status_t) apr_os_thread_pupt(apr_thread_t **thd, +APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont); diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 58880ac810e..779ec2b44e9 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -167,7 +167,7 @@ apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) return APR_SUCCESS; } -apr_status_t apr_os_thread_pupt(apr_thread_t **thd, apr_os_thread_t *thethd, +apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont) { if (cont == NULL) { diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 457bccdadc4..d69df3b5ad8 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -217,7 +217,7 @@ apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) return APR_SUCCESS; } -apr_status_t apr_os_thread_pupt(apr_thread_t **thd, apr_os_thread_t *thethd, +apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont) { if (cont == NULL) { diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index b243d83593f..98a63d30bc4 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -187,7 +187,7 @@ APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_thread_pupt(apr_thread_t **thd, +APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont) { diff --git a/time/unix/time.c b/time/unix/time.c index db468b0998a..73ad3b82555 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -240,7 +240,7 @@ apr_status_t apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime return APR_SUCCESS; } -apr_status_t apr_os_exp_time_pupt(apr_exploded_time_t *aprtime, +apr_status_t apr_os_exp_time_put(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) { aprtime->tm_sec = (*ostime)->tm_sec; diff --git a/time/win32/time.c b/time/win32/time.c index b106d2dc43e..35ae545e3df 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -243,7 +243,7 @@ APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_exp_time_pupt(apr_exploded_time_t *aprtime, +APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) { From 0ed1d8101f62a7c9776188939da3be692c67f898 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 8 Feb 2001 18:58:36 +0000 Subject: [PATCH 1214/7878] add iconv hints for AIX and Solaris (tested on AIX 4.3 and Solaris 8) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61196 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hints.m4 b/hints.m4 index 3b59279fc2d..d4dc125c5e8 100644 --- a/hints.m4 +++ b/hints.m4 @@ -81,6 +81,7 @@ else APR_ADDTO(CFLAGS, [-qHALT=E]) APR_ADDTO(CFLAGS, [-qLANGLVL=extended]) fi + APR_SETIFNULL(apr_iconv_inbuf_const, [1]) ;; *-apollo-*) APR_ADDTO(CFLAGS, [-DAPOLLO]) @@ -198,6 +199,7 @@ dnl ;; PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` APR_ADDTO(CFLAGS, [-DSOLARIS2=$PLATOSVERS]) APR_ADDTO(LIBS, [-lsocket -lnsl]) + APR_SETIFNULL(apr_iconv_inbuf_const, [1]) ;; *-sunos4*) APR_ADDTO(CFLAGS, [-DSUNOS4 -DUSEBCOPY]) From 550facd38f81a525dc416e95c9969ed088fa5e19 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez <wsanchez@apache.org> Date: Thu, 8 Feb 2001 21:33:26 +0000 Subject: [PATCH 1215/7878] Add Darwin/Mac OS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61197 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/config.guess | 3 +++ helpers/config.sub | 2 +- shmem/unix/mm/config.guess | 3 +++ shmem/unix/mm/config.sub | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/helpers/config.guess b/helpers/config.guess index a58889d62b6..a5d1bd6dce3 100755 --- a/helpers/config.guess +++ b/helpers/config.guess @@ -947,6 +947,9 @@ EOF *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; *:OS/2:*:*) echo "i386-pc-os2_emx" exit 0;; diff --git a/helpers/config.sub b/helpers/config.sub index 19c7337e472..df1ad1afc9b 100755 --- a/helpers/config.sub +++ b/helpers/config.sub @@ -921,7 +921,7 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -openstep* | -oskit* \ | -tpf* | -os390* | -vmcms* ) # Remember, each alternative MUST END IN *, to match a version number. ;; diff --git a/shmem/unix/mm/config.guess b/shmem/unix/mm/config.guess index 9c362ec93d8..fdeb6b1822d 100755 --- a/shmem/unix/mm/config.guess +++ b/shmem/unix/mm/config.guess @@ -839,6 +839,9 @@ EOF *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/shmem/unix/mm/config.sub b/shmem/unix/mm/config.sub index 416140415cf..89fbd90d367 100755 --- a/shmem/unix/mm/config.sub +++ b/shmem/unix/mm/config.sub @@ -913,7 +913,7 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*) + | -interix* | -uwin* | -rhapsody* | -darwin* | -openstep* | -oskit*) # Remember, each alternative MUST END IN *, to match a version number. ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ From 3503c37a4543dd35e6073108e796798af7a3b3da Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Thu, 8 Feb 2001 22:12:20 +0000 Subject: [PATCH 1216/7878] look in -lm for modf() This gets APR test programs linking on Tru64. It may result in a double -lm on some platforms, as we autodetect the need for -lm but also hard-code the need for it in hints.m4. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61198 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index 2e54d15faab..210923d6118 100644 --- a/configure.in +++ b/configure.in @@ -226,6 +226,7 @@ AC_CHECK_LIB(socket,socket) AC_SEARCH_LIBS(crypt, crypt ufc) AC_CHECK_LIB(truerand,main) AC_CHECK_LIB(iconv,iconv) +AC_CHECK_LIB(m,modf) dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) From 9727b4b5ca9c52c2eef6dec50640ae46738a5bf8 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Fri, 9 Feb 2001 00:56:04 +0000 Subject: [PATCH 1217/7878] Add APR_TRY_GCC_WARNING macro to dynamically test the iconv prototype if gcc is being used. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61199 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ apr_common.m4 | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 35d7e76322b..42e0ea2c1de 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Added the APR_TRY_GCC_WARNING configure macro for testing a + gcc-specific compile with -Werror) and the APR_CHECK_ICONV_INBUF + macro to test for annoying iconv prototype differences. + [Jeff Trawick, Roy Fielding] + *) Fix a problem with configure on NetBSD. We must include sys/types.h for some platforms. [jun-ichiro hagino <itojun@kame.net>] diff --git a/apr_common.m4 b/apr_common.m4 index fa4f9825cc5..0482b72cfa6 100644 --- a/apr_common.m4 +++ b/apr_common.m4 @@ -1,3 +1,32 @@ +dnl APR_TRY_GCC_WARNING(INCLUDES, FUNCTION-BODY, +dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +AC_DEFUN(APR_TRY_GCC_WARNING, +[if test "$GCC" = "yes"; then + changequote(', ') + cat > conftest.$ac_ext <<EOTEST +#include "confdefs.h" +'$1' +int main(int argc, const char * const argv[]) { +'$2' +; return 0; } +EOTEST + changequote([, ]) + if ${CC-cc} -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Werror $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC ; then + ifelse([$3], , :, [rm -rf conftest* + $3]) + else + echo "configure: warning on program:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC + ifelse([$4], , , [rm -rf conftest* + $4]) + fi +else + # Not using gcc -- assume everything is okay + ifelse([$3], , :, [rm -rf conftest* + $3]) +fi +rm -f conftest*]) + dnl dnl RUN_SUBDIR_CONFIG_NOW(dir [, sub-package-cmdline-args]) dnl @@ -300,13 +329,10 @@ dnl AC_DEFUN(APR_CHECK_ICONV_INBUF,[ AC_MSG_CHECKING(for type of inbuf parameter to iconv) if test "x$apr_iconv_inbuf_const" = "x"; then - AC_TRY_COMPILE([ + APR_TRY_GCC_WARNING([ #include <stddef.h> #include <iconv.h> ],[ - #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR < 2 - #error We know this version of glibc has const char **, so fail this compile - #endif iconv(0,(char **)0,(size_t *)0,(char **)0,(size_t *)0); ], apr_iconv_inbuf_const="0", apr_iconv_inbuf_const="1") fi From 46c520bd515aead4a187aaacaa4a54f720a74408 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 9 Feb 2001 17:49:44 +0000 Subject: [PATCH 1218/7878] Stop hardcoding the math library. APR autodetects the need for -lm for modf(). (Some platforms may require a different test to be added.) Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61201 13f79535-47bb-0310-9956-ffa450edef68 --- hints.m4 | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/hints.m4 b/hints.m4 index d4dc125c5e8..6a7b3d69236 100644 --- a/hints.m4 +++ b/hints.m4 @@ -55,23 +55,18 @@ else ;; *-ibm-aix4.2) APR_ADDTO(CFLAGS, [-U__STR__]) - APR_ADDTO(LDFLAGS, [-lm]) ;; *-ibm-aix4.2.*) APR_ADDTO(CFLAGS, [-U__STR__]) - APR_ADDTO(LDFLAGS, [-lm]) ;; *-ibm-aix4.3) APR_ADDTO(CFLAGS, [-D_USE_IRS -U__STR__]) - APR_ADDTO(LDFLAGS, [-lm]) ;; *-ibm-aix4.3.*) APR_ADDTO(CFLAGS, [-D_USE_IRS -U__STR__]) - APR_ADDTO(LDFLAGS, [-lm]) ;; *-ibm-aix*) APR_ADDTO(CFLAGS, [-U__STR__]) - APR_ADDTO(LDFLAGS, [-lm]) ;; esac dnl Must do a check for gcc or egcs here, to get the right options @@ -97,7 +92,7 @@ else ;; *-hp-hpux11.*) APR_ADDTO(CFLAGS, [-DHPUX11]) - APR_ADDTO(LIBS, [-lm -lpthread]) + APR_ADDTO(LIBS, [-lpthread]) ;; *-hp-hpux10.*) case $host in @@ -110,15 +105,12 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-hp-hpux*) APR_ADDTO(CFLAGS, [-DHPUX]) - APR_ADDTO(LIBS, [-lm]) ;; *-linux-*) case `uname -r` in 2.2* ) APR_ADDTO(CFLAGS, [-DLINUX=2]) - APR_ADDTO(LIBS, [-lm]) ;; 2.0* ) APR_ADDTO(CFLAGS, [-DLINUX=2]) - APR_ADDTO(LIBS, [-lm]) ;; 1.* ) APR_ADDTO(CFLAGS, [-DLINUX=1]) ;; @@ -128,7 +120,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-GNU*) APR_ADDTO(CFLAGS, [-DHURD]) - APR_ADDTO(LIBS, [-lm -lcrypt]) + APR_ADDTO(LIBS, [-lcrypt]) ;; *-lynx-lynxos) APR_ADDTO(CFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) @@ -166,7 +158,6 @@ dnl ;; ;; *-dec-osf*) APR_ADDTO(CFLAGS, [-DOSF1]) - APR_ADDTO(LIBS, [-lm]) ;; *-qnx) APR_ADDTO(CFLAGS, [-DQNX]) @@ -189,7 +180,7 @@ dnl ;; ;; *-sco5*) APR_ADDTO(CFLAGS, [-DSCO5]) - APR_ADDTO(LIBS, [-lsocket -lmalloc -lprot -ltinfo -lx -lm]) + APR_ADDTO(LIBS, [-lsocket -lmalloc -lprot -ltinfo -lx]) ;; *-sco_sv*|*-SCO_SV*) APR_ADDTO(CFLAGS, [-DSCO]) From d2ee2eea0d7e39db03f9983e2329ea8c5802eeee Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Fri, 9 Feb 2001 19:23:05 +0000 Subject: [PATCH 1219/7878] Change the macro name to APR_COMPILE_NO_WARNING and make it active for all compilers rather than just gcc. The environment variable CFLAGS_WARN can be used for extra warning flags. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61202 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 +++--- apr_common.m4 | 44 +++++++++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/CHANGES b/CHANGES index 42e0ea2c1de..0db47e10fd2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,8 @@ Changes with APR b1 - *) Added the APR_TRY_GCC_WARNING configure macro for testing a - gcc-specific compile with -Werror) and the APR_CHECK_ICONV_INBUF - macro to test for annoying iconv prototype differences. + *) Added the APR_TRY_COMPILE_NO_WARNING configure macro for testing a + compile with -Werror as well as the APR_CHECK_ICONV_INBUF macro to + test for annoying iconv prototype differences. [Jeff Trawick, Roy Fielding] *) Fix a problem with configure on NetBSD. We must include sys/types.h diff --git a/apr_common.m4 b/apr_common.m4 index 0482b72cfa6..b67c3140a61 100644 --- a/apr_common.m4 +++ b/apr_common.m4 @@ -1,29 +1,35 @@ -dnl APR_TRY_GCC_WARNING(INCLUDES, FUNCTION-BODY, +dnl APR_TRY_COMPILE_NO_WARNING(INCLUDES, FUNCTION-BODY, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -AC_DEFUN(APR_TRY_GCC_WARNING, -[if test "$GCC" = "yes"; then - changequote(', ') - cat > conftest.$ac_ext <<EOTEST +dnl +dnl Tries a compile test with warnings activated so that the result +dnl is false if the code doesn't compile cleanly. +dnl +AC_DEFUN(APR_TRY_COMPILE_NO_WARNING, +[if test "x$CFLAGS_WARN" = "x"; then + apr_tcnw_flags="" +else + apr_tcnw_flags=$CFLAGS_WARN +fi +if test "$GCC" = "yes"; then + apr_tcnw_flags="$apr_tcnw_flags -Werror" +fi +changequote(', ') +cat > conftest.$ac_ext <<EOTEST #include "confdefs.h" '$1' int main(int argc, const char * const argv[]) { '$2' ; return 0; } EOTEST - changequote([, ]) - if ${CC-cc} -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Werror $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC ; then - ifelse([$3], , :, [rm -rf conftest* - $3]) - else - echo "configure: warning on program:" >&AC_FD_CC - cat conftest.$ac_ext >&AC_FD_CC - ifelse([$4], , , [rm -rf conftest* - $4]) - fi +changequote([, ]) +if ${CC-cc} -c $CFLAGS $CPPFLAGS $apr_tcnw_flags conftest.$ac_ext 1>&AC_FD_CC ; then + ifelse([$3], , :, [rm -rf conftest* + $3]) else - # Not using gcc -- assume everything is okay - ifelse([$3], , :, [rm -rf conftest* - $3]) + echo "configure: failed or warning program:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC + ifelse([$4], , , [rm -rf conftest* + $4]) fi rm -f conftest*]) @@ -329,7 +335,7 @@ dnl AC_DEFUN(APR_CHECK_ICONV_INBUF,[ AC_MSG_CHECKING(for type of inbuf parameter to iconv) if test "x$apr_iconv_inbuf_const" = "x"; then - APR_TRY_GCC_WARNING([ + APR_TRY_COMPILE_NO_WARNING([ #include <stddef.h> #include <iconv.h> ],[ From de6c9188eca671830480358d9eb8820ff184af73 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez <wsanchez@apache.org> Date: Fri, 9 Feb 2001 20:09:23 +0000 Subject: [PATCH 1220/7878] Separate CFLAGS and CPPFLAGS. (Allows overriding CFLAGS without clobbering include paths abnd defines.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61203 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/rules.mk.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/helpers/rules.mk.in b/helpers/rules.mk.in index 097c1c34d04..56b54e63714 100644 --- a/helpers/rules.mk.in +++ b/helpers/rules.mk.in @@ -67,7 +67,8 @@ CC=@CC@ AWK=@AWK@ LIBTOOL=@LIBTOOL@ -CFLAGS=@CFLAGS@ @OPTIM@ $(INCLUDES) +CFLAGS=@CFLAGS@ @OPTIM@ +CPPFLAGS=@CPPFLAGS@ $(INCLUDES) LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ @@ -82,7 +83,7 @@ MKDEP=$(top_builddir)/helpers/mkdep.sh # # Basic macro setup # -COMPILE = $(CC) $(CFLAGS) +COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) LT_COMPILE = $(LIBTOOL) --mode=compile $(LTFLAGS) $(COMPILE) -c $< && touch $@ LINK = $(LIBTOOL) --mode=link $(LTFLAGS) $(COMPILE) $(LDFLAGS) -o $@ @@ -138,8 +139,8 @@ local-all: $(TARGETS) local-depend: @if test -n "`ls *.c 2> /dev/null`"; then \ - echo $(MKDEP) $(INCLUDES) $(CFLAGS) *.c ; \ - $(MKDEP) $(INCLUDES) $(CFLAGS) *.c ; \ + echo $(MKDEP) $(CFLAGS) $(CPPFLAGS) *.c ; \ + $(MKDEP) $(CFLAGS) $(CPPFLAGS) *.c ; \ fi # to be filled in by the actual Makefile From 2fc3ef3d36d7071cae0a1ce5c746558e5a12f3b8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sat, 10 Feb 2001 18:09:27 +0000 Subject: [PATCH 1221/7878] Fix the configure scripts, so that we don't try to substitute into test/Makefile unless we actually have a test directory. The problem is that we don't distribute test directories with our tarballs, so our configure script outputs error messages. This fixes that problem. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61204 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 210923d6118..e26e0cbfa4d 100644 --- a/configure.in +++ b/configure.in @@ -904,7 +904,9 @@ do fi done -MAKEFILE3="test/Makefile" +if test -d ./test; then + MAKEFILE3="test/Makefile" +fi AC_SUBST(SUBDIRS) if test -n "$CPPFLAGS"; then From 1717c705f886ca069001c809e369cab5469d2074 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 11 Feb 2001 00:12:11 +0000 Subject: [PATCH 1222/7878] Moved the prototypes for apr_snprintf and apr_vsnprintf to the apr_strings.h header, from apr_lib.h. This location makes more sense. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61205 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ file_io/unix/readwrite.c | 1 + include/apr_lib.h | 42 ------------------------------------- include/apr_strings.h | 42 +++++++++++++++++++++++++++++++++++++ network_io/unix/sa_common.c | 1 + strings/apr_snprintf.c | 1 + 6 files changed, 49 insertions(+), 42 deletions(-) diff --git a/CHANGES b/CHANGES index 0db47e10fd2..08f715e6669 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Moved the prototypes for apr_snprintf and apr_vsnprintf to the + apr_strings.h header, from apr_lib.h. This location makes more + sense. [Ryan Bloom] + *) Added the APR_TRY_COMPILE_NO_WARNING configure macro for testing a compile with -Werror as well as the APR_CHECK_ICONV_INBUF macro to test for annoying iconv prototype differences. diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 0f32e70441f..84c5a7c48ab 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -53,6 +53,7 @@ */ #include "fileio.h" +#include "apr_strings.h" #include "apr_lock.h" /* The only case where we don't use wait_for_io_or_timeout is on diff --git a/include/apr_lib.h b/include/apr_lib.h index 50bf956d973..266e11f8011 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -217,48 +217,6 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, const char *hash); -/* - * These are snprintf implementations based on apr_vformatter(). - * - * Note that various standards and implementations disagree on the return - * value of snprintf, and side-effects due to %n in the formatting string. - * apr_snprintf behaves as follows: - * - * Process the format string until the entire string is exhausted, or - * the buffer fills. If the buffer fills then stop processing immediately - * (so no further %n arguments are processed), and return the buffer - * length. In all cases the buffer is NUL terminated. - * - * In no event does apr_snprintf return a negative number. It's not possible - * to distinguish between an output which was truncated, and an output which - * exactly filled the buffer. - */ - -/** - * snprintf routine based on apr_vformatter. This means it understands the - * same extensions. - * @param buf The buffer to write to - * @param len The size of the buffer - * @param format The format string - * @param ... The arguments to use to fill out the format string. - * @deffunc int apr_snprintf(char *buf, size_t len, const char *format, ...) - */ -APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, size_t len, - const char *format, ...) - __attribute__((format(printf,3,4))); - -/** - * vsnprintf routine based on apr_vformatter. This means it understands the - * same extensions. - * @param buf The buffer to write to - * @param len The size of the buffer - * @param format The format string - * @param ap The arguments to use to fill out the format string. - * @deffunc int apr_vsnprintf(char *buf, size_t len, const char *format, va_list ap) - */ -APR_DECLARE(int) apr_vsnprintf(char *buf, size_t len, const char *format, - va_list ap); - /** * Display a prompt and read in the password from stdin. * @param prompt The prompt to display diff --git a/include/apr_strings.h b/include/apr_strings.h index 8c87a57f4c0..c7aa5bbd405 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -208,6 +208,48 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, char ***argv_out, apr_pool_t *token_context); +/* + * These are snprintf implementations based on apr_vformatter(). + * + * Note that various standards and implementations disagree on the return + * value of snprintf, and side-effects due to %n in the formatting string. + * apr_snprintf behaves as follows: + * + * Process the format string until the entire string is exhausted, or + * the buffer fills. If the buffer fills then stop processing immediately + * (so no further %n arguments are processed), and return the buffer + * length. In all cases the buffer is NUL terminated. + * + * In no event does apr_snprintf return a negative number. It's not possible + * to distinguish between an output which was truncated, and an output which + * exactly filled the buffer. + */ + +/** + * snprintf routine based on apr_vformatter. This means it understands the + * same extensions. + * @param buf The buffer to write to + * @param len The size of the buffer + * @param format The format string + * @param ... The arguments to use to fill out the format string. + * @deffunc int apr_snprintf(char *buf, size_t len, const char *format, ...) + */ +APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, size_t len, + const char *format, ...) + __attribute__((format(printf,3,4))); + +/** + * vsnprintf routine based on apr_vformatter. This means it understands the + * same extensions. + * @param buf The buffer to write to + * @param len The size of the buffer + * @param format The format string + * @param ap The arguments to use to fill out the format string. + * @deffunc int apr_vsnprintf(char *buf, size_t len, const char *format, va_list ap) + */ +APR_DECLARE(int) apr_vsnprintf(char *buf, size_t len, const char *format, + va_list ap); + #ifdef __cplusplus } #endif diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index c50e5939224..52bd9ed995f 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -65,6 +65,7 @@ #include "apr.h" #include "apr_lib.h" +#include "apr_strings.h" #ifdef HAVE_STDLIB_H #include <stdlib.h> diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 76dacc90c28..7dfb1384f23 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -60,6 +60,7 @@ #include "apr_private.h" #include "apr_lib.h" +#include "apr_strings.h" #include "apr_network_io.h" #include <math.h> #ifdef HAVE_CTYPE_H From b0d923b10bbac4f3f99bbbe0468c1d793b8b3419 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 11 Feb 2001 00:35:57 +0000 Subject: [PATCH 1223/7878] AYCB on win32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61206 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 1 + 1 file changed, 1 insertion(+) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index bd8739b4942..ee192717371 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -55,6 +55,7 @@ #include "win32/fileio.h" #include "apr_file_io.h" #include "apr_general.h" +#include "apr_strings.h" #include "apr_lib.h" #include "apr_errno.h" #include <malloc.h> From 3c4ef084149b52610adaa63c26bd0e4695c5f507 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sun, 11 Feb 2001 00:39:55 +0000 Subject: [PATCH 1224/7878] *) add apr_signal_get_description() to that platforms (which have signals) can portably get descriptions for them. *) move signal stuff from apr.h to (new) apr_signal.h *) os2/signals.c was collapsed into unix/signals.c *) APR initialization will init the signal names (if needed) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61207 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +- include/apr.h.in | 38 +++----- include/apr_signal.h | 104 +++++++++++++++++++++ include/apr_want.h | 13 +++ misc/unix/start.c | 10 +- threadproc/os2/signals.c | 99 +------------------- threadproc/unix/signals.c | 192 ++++++++++++++++++++++++++++++++++++-- 7 files changed, 324 insertions(+), 138 deletions(-) create mode 100644 include/apr_signal.h diff --git a/configure.in b/configure.in index e26e0cbfa4d..d064263bb03 100644 --- a/configure.in +++ b/configure.in @@ -231,13 +231,15 @@ AC_CHECK_LIB(m,modf) dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) AC_CHECK_FUNCS(strcasecmp stricmp setsid nl_langinfo) -AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) AC_CHECK_FUNCS(writev) sendfile="0" AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ]) +AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) +AC_DECL_SYS_SIGLIST + AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ]) AC_CHECK_FUNCS(getpass) APR_CHECK_INET_ADDR @@ -255,7 +257,6 @@ if test "$native_mmap_emul" = "1"; then fi AC_CHECK_FUNCS(hstrerror) AC_CHECK_FUNCS(memmove, [ have_memmove="1" ], [have_memmove="0" ]) -AC_CHECK_FUNCS(bzero, [ have_bzero="1" ], [ have_bzero="0"] ) AC_SUBST(fork) AC_SUBST(have_inet_addr) @@ -266,7 +267,6 @@ AC_SUBST(have_getrlimit) AC_SUBST(iconv) AC_SUBST(mmap) AC_SUBST(have_memmove) -AC_SUBST(have_bzero) dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC diff --git a/include/apr.h.in b/include/apr.h.in index 583e4bfddb9..a31e751fd8d 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -70,23 +70,23 @@ #define APR_FILE_BASED_SHM @file_based@ #define APR_MEM_BASED_SHM @mem_based@ +#define APR_HAVE_CORKABLE_TCP @have_corkable_tcp@ +#define APR_HAVE_GETRLIMIT @have_getrlimit@ #define APR_HAVE_IN_ADDR @have_in_addr@ #define APR_HAVE_INET_ADDR @have_inet_addr@ #define APR_HAVE_INET_NETWORK @have_inet_network@ -#define APR_HAVE_UNION_SEMUN @have_union_semun@ -#define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@ +#define APR_HAVE_IPV6 @have_ipv6@ +#define APR_HAVE_MEMMOVE @have_memmove@ #define APR_HAVE_SETRLIMIT @have_setrlimit@ -#define APR_HAVE_GETRLIMIT @have_getrlimit@ -#define APR_HAVE_STRICMP @have_stricmp@ -#define APR_HAVE_STRNICMP @have_strnicmp@ +#define APR_HAVE_SIGACTION @have_sigaction@ #define APR_HAVE_STRCASECMP @have_strcasecmp@ -#define APR_HAVE_STRNCASECMP @have_strncasecmp@ #define APR_HAVE_STRDUP @have_strdup@ +#define APR_HAVE_STRICMP @have_stricmp@ +#define APR_HAVE_STRNCASECMP @have_strncasecmp@ +#define APR_HAVE_STRNICMP @have_strnicmp@ #define APR_HAVE_STRSTR @have_strstr@ -#define APR_HAVE_MEMMOVE @have_memmove@ -#define APR_HAVE_BZERO @have_bzero@ -#define APR_HAVE_IPV6 @have_ipv6@ -#define APR_HAVE_CORKABLE_TCP @have_corkable_tcp@ +#define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@ +#define APR_HAVE_UNION_SEMUN @have_union_semun@ #if APR_HAVE_SYS_TYPES_H #include <sys/types.h> @@ -177,6 +177,7 @@ typedef @socklen_t_value@ apr_socklen_t; * @deffunc APR_DECLARE(rettype) apr_func(args); */ #define APR_DECLARE(type) type + /** * The public APR functions using variable arguments are declared with * AP_DECLARE(), as they must use the C language calling convention. @@ -184,6 +185,7 @@ typedef @socklen_t_value@ apr_socklen_t; * @deffunc APR_DECLARE_NONSTD(rettype) apr_func(args, ...); */ #define APR_DECLARE_NONSTD(type) type + /** * The public APR variables are declared with AP_MODULE_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. @@ -213,22 +215,6 @@ typedef @socklen_t_value@ apr_socklen_t; /* Local machine definition for console and log output. */ #define APR_EOL_STR "@eolstr@" -/* Define apr_signal and related necessary definitions. - */ -/* We are checking for HAVE_SIGACTION, but autoconf is filling this in - * for us automatically. - */ -#if @have_sigaction@ && !defined(NO_USE_SIGACTION) -typedef void Sigfunc(int); -Sigfunc *apr_signal(int signo, Sigfunc * func); - -#if defined(SIG_ING) && !defined(SIG_ERR) -#define SIG_ERR ((Sigfunc *)-1) -#endif -#else -#define apr_signal(a,b) signal(a,b) -#endif - #if APR_HAVE_SYS_WAIT_H /* We have a POSIX wait interface */ diff --git a/include/apr_signal.h b/include/apr_signal.h new file mode 100644 index 00000000000..b4237901eaf --- /dev/null +++ b/include/apr_signal.h @@ -0,0 +1,104 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +#ifndef APR_SIGNAL_H +#define APR_SIGNAL_H + +#include "apr.h" +#include "apr_pools.h" + +#define APR_WANT_SIGNAL +#include "apr_want.h" + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @package APR signal handling + */ + +#if APR_HAVE_SIGACTION + +typedef void apr_sigfunc_t(int); + +/* ### how to doc this? */ +apr_sigfunc_t *apr_signal(int signo, apr_sigfunc_t * func); + +#if defined(SIG_IGN) && !defined(SIG_ERR) +#define SIG_ERR ((apr_sigfunc_t *) -1) +#endif + +#else /* !APR_HAVE_SIGACTION */ +#define apr_signal(a, b) signal(a, b) +#endif + + +/** + * Get the description for a specific signal number + * @param signum The signal number + * @return The description of the signal + * @deffunc const char *apr_signal_get_description(int signum) + */ +const char *apr_signal_get_description(int signum); + +/** + * APR-private function for initializing the signal package + * @param pglobal The internal, global pool + * @deffunc apr_signal_init(apr_pool_t *pglobal) + */ +void apr_signal_init(apr_pool_t *pglobal); + +#endif /* APR_SIGNAL_H */ diff --git a/include/apr_want.h b/include/apr_want.h index 5f7d8fb3a3e..b49af82dd22 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -61,6 +61,7 @@ * APR_WANT_MEMFUNC: memcmp, memcpy, etc * APR_WANT_STDIO: <stdio.h> and related bits * APR_WANT_IOVEC: struct iovec + * APR_WANT_SIGNAL: signal numbers, functions, and types * * Typical usage: * @@ -122,3 +123,15 @@ #endif /* --------------------------------------------------------------------- */ + +#ifdef APR_WANT_SIGNAL + +#if APR_HAVE_SIGNAL_H +#include <signal.h> +#endif +/* ### some platforms may put this into unistd.h ?? */ + +#undef APR_WANT_SIGNAL +#endif + +/* --------------------------------------------------------------------- */ diff --git a/misc/unix/start.c b/misc/unix/start.c index 41e9327b518..61a94b105c8 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -55,6 +55,7 @@ #include "apr.h" #include "apr_general.h" #include "apr_pools.h" +#include "apr_signal.h" #include "misc.h" /* for WSAHighByte / WSALowByte */ #include "locks.h" /* for apr_unix_setup_lock() */ @@ -94,8 +95,13 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_EEXIST; } #endif - status = apr_pool_alloc_init(global_apr_pool); - return status; + + if ((status = apr_pool_alloc_init(global_apr_pool)) != APR_SUCCESS) + return status; + + apr_signal_init(global_apr_pool); + + return APR_SUCCESS; } APR_DECLARE(void) apr_terminate(void) diff --git a/threadproc/os2/signals.c b/threadproc/os2/signals.c index e15697d5ad3..e1727125ad9 100644 --- a/threadproc/os2/signals.c +++ b/threadproc/os2/signals.c @@ -1,98 +1 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ - -#define INCL_DOSEXCEPTIONS -#include "threadproc.h" -#include "fileio.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include <signal.h> -#include <string.h> -#include <sys/wait.h> - -apr_status_t apr_proc_kill(apr_proc_t *proc, int signal) -{ -/* SIGTERM's don't work too well in OS/2 (only affects other EMX programs). - CGIs may not be, esp. REXX scripts, so use a native call instead */ - - apr_status_t rc; - - if ( signal == SIGTERM ) { - rc = APR_OS2_STATUS(DosSendSignalException(proc->pid, XCPT_SIGNAL_BREAK)); - } else { - rc = kill(proc->pid, signal) < 0 ? errno : APR_SUCCESS; - } - - return rc; -} - - - -/* - * Replace standard signal() with the more reliable sigaction equivalent - * from W. Richard Stevens' "Advanced Programming in the UNIX Environment" - * (the version that does not automatically restart system calls). - */ -Sigfunc *apr_signal(int signo, Sigfunc * func) -{ - struct sigaction act, oact; - - act.sa_handler = func; - sigemptyset(&act.sa_mask); - act.sa_flags = 0; - if (sigaction(signo, &act, &oact) < 0) - return SIG_ERR; - return oact.sa_handler; -} +#include "../unix/signals.c" diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index c402fb44685..8a7b0242b48 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -52,40 +52,214 @@ * <http://www.apache.org/>. */ +#define INCL_DOSEXCEPTIONS /* for OS2 */ #include "threadproc.h" #include "apr_private.h" -#include "apr_lib.h" -#if APR_HAVE_SIGNAL_H -#include <signal.h> -#endif +#include "apr_pools.h" +#include "apr_signal.h" + +#define APR_WANT_SIGNAL +#include "apr_want.h" + +#include <assert.h> -apr_status_t apr_proc_kill(apr_proc_t *proc, int sig) + +apr_status_t apr_proc_kill(apr_proc_t *proc, int signum) { - if (kill(proc->pid, sig) == -1) { +#ifdef OS2 + /* SIGTERM's don't work too well in OS/2 (only affects other EMX + * programs). CGIs may not be, esp. REXX scripts, so use a native + * call instead + */ + if (signum == SIGTERM) { + return APR_OS2_STATUS(DosSendSignalException(proc->pid, + XCPT_SIGNAL_BREAK)); + } +#endif /* OS2 */ + + if (kill(proc->pid, signum) == -1) { return errno; } + return APR_SUCCESS; } -#if !defined(NO_USE_SIGACTION) && defined(HAVE_SIGACTION) + +#ifdef HAVE_SIGACTION + /* * Replace standard signal() with the more reliable sigaction equivalent * from W. Richard Stevens' "Advanced Programming in the UNIX Environment" * (the version that does not automatically restart system calls). */ -Sigfunc *apr_signal(int signo, Sigfunc * func) +apr_sigfunc_t *apr_signal(int signo, apr_sigfunc_t * func) { struct sigaction act, oact; act.sa_handler = func; sigemptyset(&act.sa_mask); act.sa_flags = 0; -#ifdef SA_INTERRUPT /* SunOS */ +#ifdef SA_INTERRUPT /* SunOS */ act.sa_flags |= SA_INTERRUPT; #endif if (sigaction(signo, &act, &oact) < 0) return SIG_ERR; return oact.sa_handler; } + +#endif /* HAVE_SIGACTION */ + + +#ifdef SYS_SIGLIST_DECLARED + +void apr_signal_init(apr_pool_t *pglobal) +{ +} +const char *apr_signal_get_description(int signum) +{ + return sys_siglist[signum]; +} + +#else /* !SYS_SIGLIST_DECLARED */ + +/* we need to roll our own signal description stuff */ + +#if defined(NSIG) +#define APR_NUMSIG NSIG +#elif defined(_NSIG) +#define APR_NUMSIG _NSIG +#elif defined(__NSIG) +#define APR_NUMSIG __NSIG +#else +#define APR_NUMSIG 33 /* breaks on OS/390 with < 33; 32 is o.k. for most */ +#endif + +static const char *signal_description[APR_NUMSIG]; + +#define store_desc(index, string) \ + (assert(index < APR_NUMSIG), \ + signal_description[index] = string) + +void apr_signal_init(apr_pool_t *pglobal) +{ + int sig; + + store_desc(0, "Signal 0"); + +#ifdef SIGHUP + store_desc(SIGHUP, "Hangup"); +#endif +#ifdef SIGINT + store_desc(SIGINT, "Interrupt"); +#endif +#ifdef SIGQUIT + store_desc(SIGQUIT, "Quit"); +#endif +#ifdef SIGILL + store_desc(SIGILL, "Illegal instruction"); +#endif +#ifdef SIGTRAP + store_desc(SIGTRAP, "Trace/BPT trap"); +#endif +#ifdef SIGIOT + store_desc(SIGIOT, "IOT instruction"); +#endif +#ifdef SIGABRT + store_desc(SIGABRT, "Abort"); #endif +#ifdef SIGEMT + store_desc(SIGEMT, "Emulator trap"); +#endif +#ifdef SIGFPE + store_desc(SIGFPE, "Arithmetic exception"); +#endif +#ifdef SIGKILL + store_desc(SIGKILL, "Killed"); +#endif +#ifdef SIGBUS + store_desc(SIGBUS, "Bus error"); +#endif +#ifdef SIGSEGV + store_desc(SIGSEGV, "Segmentation fault"); +#endif +#ifdef SIGSYS + store_desc(SIGSYS, "Bad system call"); +#endif +#ifdef SIGPIPE + store_desc(SIGPIPE, "Broken pipe"); +#endif +#ifdef SIGALRM + store_desc(SIGALRM, "Alarm clock"); +#endif +#ifdef SIGTERM + store_desc(SIGTERM, "Terminated"); +#endif +#ifdef SIGUSR1 + store_desc(SIGUSR1, "User defined signal 1"); +#endif +#ifdef SIGUSR2 + store_desc(SIGUSR2, "User defined signal 2"); +#endif +#ifdef SIGCLD + store_desc(SIGCLD, "Child status change"); +#endif +#ifdef SIGCHLD + store_desc(SIGCHLD, "Child status change"); +#endif +#ifdef SIGPWR + store_desc(SIGPWR, "Power-fail restart"); +#endif +#ifdef SIGWINCH + store_desc(SIGWINCH, "Window changed"); +#endif +#ifdef SIGURG + store_desc(SIGURG, "urgent socket condition"); +#endif +#ifdef SIGPOLL + store_desc(SIGPOLL, "Pollable event occurred"); +#endif +#ifdef SIGIO + store_desc(SIGIO, "socket I/O possible"); +#endif +#ifdef SIGSTOP + store_desc(SIGSTOP, "Stopped (signal)"); +#endif +#ifdef SIGTSTP + store_desc(SIGTSTP, "Stopped"); +#endif +#ifdef SIGCONT + store_desc(SIGCONT, "Continued"); +#endif +#ifdef SIGTTIN + store_desc(SIGTTIN, "Stopped (tty input)"); +#endif +#ifdef SIGTTOU + store_desc(SIGTTOU, "Stopped (tty output)"); +#endif +#ifdef SIGVTALRM + store_desc(SIGVTALRM, "virtual timer expired"); +#endif +#ifdef SIGPROF + store_desc(SIGPROF, "profiling timer expired"); +#endif +#ifdef SIGXCPU + store_desc(SIGXCPU, "exceeded cpu limit"); +#endif +#ifdef SIGXFSZ + store_desc(SIGXFSZ, "exceeded file size limit"); +#endif + + for (sig = 0; sig < APR_NUMSIG; ++sig) + if (signal_description[sig] == NULL) + signal_description[sig] = apr_psprintf(pglobal, "signal #%d", sig); +} + +const char *apr_signal_get_description(int signum) +{ + return + signum < APR_NUMSIG + ? signal_description[signum] + : "unknown signal (number)"; +} +#endif /* SYS_SIGLIST_DECLARED */ From aa8db0018b040429c7a7aad6f0a558c94da3dbe1 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sun, 11 Feb 2001 01:08:25 +0000 Subject: [PATCH 1225/7878] *) include "apr_signal.h" when needed *) some other minor include tweaks git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61208 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 58b49493a0e..37be60bc0e3 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -55,6 +55,7 @@ #include "threadproc.h" #include "apr_strings.h" #include "apr_portable.h" +#include "apr_signal.h" apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { From 7a990b5c3a6f0f4082f8da7e198e09ed6a7aab14 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sun, 11 Feb 2001 01:14:28 +0000 Subject: [PATCH 1226/7878] *) add missing APR_HAVE_CORKABLE_TCP *) add new APR_HAVE_SIGACTION *) sort the APR_HAVE_ feature list *) remove the apr_signal define; client should use apr_signal.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61209 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 0aa15c69780..01e727d14b0 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -106,7 +106,6 @@ #include <stdio.h> #include <time.h> #include <process.h> -#include <signal.h> #include <stdlib.h> #define apr_inline @@ -153,22 +152,23 @@ #define APR_FILE_BASED_SHM 0 #define APR_MEM_BASED_SHM 0 +#define APR_HAVE_CORKABLE_TCP 0 +#define APR_HAVE_GETRLIMIT 0 #define APR_HAVE_IN_ADDR 1 #define APR_HAVE_INET_ADDR 1 #define APR_HAVE_INET_NETWORK 0 -#define APR_HAVE_UNION_SEMUN 0 -#define APR_HAVE_STRUCT_RLIMIT 0 +#define APR_HAVE_IPV6 0 +#define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 -#define APR_HAVE_GETRLIMIT 0 -#define APR_HAVE_STRICMP 1 -#define APR_HAVE_STRNICMP 1 +#define APR_HAVE_SIGACTION 0 #define APR_HAVE_STRCASECMP 0 -#define APR_HAVE_STRNCASECMP 0 #define APR_HAVE_STRDUP 1 +#define APR_HAVE_STRICMP 1 +#define APR_HAVE_STRNCASECMP 0 +#define APR_HAVE_STRNICMP 1 #define APR_HAVE_STRSTR 1 -#define APR_HAVE_MEMMOVE 1 -#define APR_HAVE_BZERO 0 -#define APR_HAVE_IPV6 0 +#define APR_HAVE_STRUCT_RLIMIT 0 +#define APR_HAVE_UNION_SEMUN 0 #if APR_HAVE_SYS_TYPES_H @@ -284,8 +284,6 @@ typedef int gid_t; /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" -#define apr_signal(a,b) signal(a,b) - typedef int apr_wait_t; /* struct iovec is needed to emulate Unix writev */ From 3391d53c7fd5683b4f1f6ed43b506348ff50a7a0 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sun, 11 Feb 2001 01:17:55 +0000 Subject: [PATCH 1227/7878] add new signal init/query functions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61210 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/signals.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index dc59c86907f..069487eb5c7 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -72,3 +72,10 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signal) return APR_SUCCESS; } +void apr_signal_init(apr_pool_t *pglobal) +{ +} +const char *apr_signal_get_description(int signum) +{ + return "unknown signal (not supported)"; +} From 4d6a907c6b7c22f866d9058415e4fa71c11c4a67 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 11 Feb 2001 02:43:11 +0000 Subject: [PATCH 1228/7878] We need to close the brace, or 'make docs' won't work git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61211 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_signal.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/apr_signal.h b/include/apr_signal.h index b4237901eaf..6b8b5c17470 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -101,4 +101,8 @@ const char *apr_signal_get_description(int signum); */ void apr_signal_init(apr_pool_t *pglobal); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif /* APR_SIGNAL_H */ From 95b6febcd13ea0f6c7de2e04bf14fcbf225200d9 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 11 Feb 2001 02:49:17 +0000 Subject: [PATCH 1229/7878] Fix a simple typo. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61212 13f79535-47bb-0310-9956-ffa450edef68 --- docs/non_apr_programs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/non_apr_programs b/docs/non_apr_programs index 47b7d8ec60c..5003a8bd550 100644 --- a/docs/non_apr_programs +++ b/docs/non_apr_programs @@ -6,7 +6,7 @@ we don't expect them to migrate to using APR just because APR has been released. So, we have provided a way for non-APR'ized programs to interact very cleanly with APR. -There are a set of programs, all documented in apr_portable.h, which allow +There are a set of functions, all documented in apr_portable.h, which allow a programmer to either get a native type from an APR type, or to setup an APR type from a native type. From 924370dab3b72ac4c60dee3a6c4fb8ceb72f2055 Mon Sep 17 00:00:00 2001 From: Ben Laurie <ben@apache.org> Date: Sun, 11 Feb 2001 16:18:09 +0000 Subject: [PATCH 1230/7878] Add memdup function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61214 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 14 ++++++++++++-- strings/apr_strings.c | 11 +++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index c7aa5bbd405..e2be2078f00 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -120,7 +120,7 @@ APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b); /** * duplicate a string into memory allocated out of a pool * @param p The pool to allocate out of - * @param s The string to allocate + * @param s The string to duplicate * @return The new string * @deffunc char *apr_pstrdup(apr_pool_t *p, const char *s) */ @@ -130,13 +130,23 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); * duplicate the first n characters of a string into memory allocated * out of a pool; the new string will be '\0'-terminated * @param p The pool to allocate out of - * @param s The string to allocate + * @param s The string to duplicate * @param n The number of characters to duplicate * @return The new string * @deffunc char *apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n) */ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); +/** + * Duplicate a block of memory. + * + * @param p The pool to allocate from + * @param m The memory to duplicate + * @param n The number of bytes to duplicate + * @return The new block of memory + */ +APR_DECLARE(void *) apr_memdup(apr_pool_t *p, const void *m, apr_size_t n); + /** * Concatenate multiple strings, allocating memory out a pool * @param p The pool to allocate out of diff --git a/strings/apr_strings.c b/strings/apr_strings.c index affe5126706..a32f0c5d11a 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -93,6 +93,17 @@ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *a, const char *s, apr_size_t n) return res; } +APR_DECLARE(void *) apr_memdup(apr_pool_t *a, const void *m, apr_size_t n) +{ + void *res; + + if(m == NULL) + return NULL; + res = apr_palloc(a, n); + memcpy(res, m, n); + return res; +} + APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) { char *cp, *argp, *res; From 4c974cffac8dc19b99834e372d5d3d5d0252128d Mon Sep 17 00:00:00 2001 From: Ben Laurie <ben@apache.org> Date: Sun, 11 Feb 2001 16:25:07 +0000 Subject: [PATCH 1231/7878] ap_pstrndup could have caused out-of-bounds memory accesses (this is a theoretical problem that I happened to notice). Only lightly tested. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61215 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strings.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/strings/apr_strings.c b/strings/apr_strings.c index a32f0c5d11a..85ac9f7b801 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -83,13 +83,18 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *a, const char *s) APR_DECLARE(char *) apr_pstrndup(apr_pool_t *a, const char *s, apr_size_t n) { char *res; + size_t len; if (s == NULL) { return NULL; } res = apr_palloc(a, n + 1); - memcpy(res, s, n); - res[n] = '\0'; + len = strlen(s); + if(len > n) { + memcpy(res, s, n); + res[n] = '\0'; + } else + memcpy(res, s, len+1); return res; } From 0b606ce1eb86f1014bce8360b825b68ecb90a4a0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Sun, 11 Feb 2001 19:46:26 +0000 Subject: [PATCH 1232/7878] Change a call from setpgrp to setpgid(0, 0). According to man these are identical, but the latter is more portable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61216 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/procsup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index dd2fffb1eda..766d947b2f2 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -87,7 +87,7 @@ apr_status_t apr_proc_detach(void) /* MPE uses negative pid for process group */ pgrp = -getpid(); #else - if ((pgrp = setpgrp(getpid(), 0)) == -1) { + if ((pgrp = setpgid(0, 0)) == -1) { return errno; } #endif From 4c0893915aa63197d9f533e13411be9626d8b169 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 11 Feb 2001 20:34:53 +0000 Subject: [PATCH 1233/7878] Fix the broken support utilities (htdigest/htpasswd) on Win32. Won't strictly put this on [signals hacker] since we should have defined this HAVE_SIGNAL_H symbol, and not simply -included- the header in the first place. Note that win32 begs for a complete replacement of their clib signal support, I'll put that on my 'short' list and look at the old win32 signal code hiding in the attic. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61217 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index 01e727d14b0..2f4933f3509 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -133,7 +133,7 @@ #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 0 -#define APR_HAVE_SIGNAL_H 0 +#define APR_HAVE_SIGNAL_H 1 #define APR_HAVE_SYS_WAIT_H 0 #define APR_HAVE_UNISTD_H 0 From 437757f56dee1697ccb955c908f1a0ecca33f4d1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 11 Feb 2001 23:31:04 +0000 Subject: [PATCH 1234/7878] result(?) What result? Stop mauling the size_t arg and overwrite the system buffer before returning from apr_password_get, and clean up doc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61218 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_lib.h | 6 +++--- passwd/apr_getpass.c | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 08f715e6669..5f966dccfff 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Purge system password buffer before returning from apr_password_get. + No longer abuses bufsize argument on return. [William Rowe] + *) Moved the prototypes for apr_snprintf and apr_vsnprintf to the apr_strings.h header, from apr_lib.h. This location makes more sense. [Ryan Bloom] diff --git a/include/apr_lib.h b/include/apr_lib.h index 266e11f8011..78683d90824 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -220,12 +220,12 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, /** * Display a prompt and read in the password from stdin. * @param prompt The prompt to display - * @param pwbuf Where to store the password - * @param bufsize The length of the password string. + * @param pwbuf Buffer to store the password + * @param bufsize The length of the password buffer. * @deffunc apr_status_t apr_password_get(const char *prompt, char *pwbuf, size_t *bufsize) */ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, - size_t *bufsize); + size_t *bufsize); #ifdef __cplusplus } diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 6a9be850f30..9e161081162 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -220,9 +220,10 @@ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, size pw_got = getpass(prompt); if (strlen(pw_got) > (*bufsiz - 1)) { *bufsiz = ERR_OVERFLOW; + memset(pw_got, 0, strlen(pw_got)); return APR_ENAMETOOLONG; } apr_cpystrn(pwbuf, pw_got, *bufsiz); - *bufsiz = result; + memset(pw_got, 0, strlen(pw_got)); return APR_SUCCESS; } From 9cb2b83d7994bfd46b9ea898762e0b0853cd8675 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 11 Feb 2001 23:32:11 +0000 Subject: [PATCH 1235/7878] Make that even simpler. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61219 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_getpass.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 9e161081162..a5cbdea435d 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -214,10 +214,7 @@ static char *getpass(const char *prompt) APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, size_t *bufsiz) { - char *pw_got = NULL; - int result = 0; - - pw_got = getpass(prompt); + char *pw_got = getpass(prompt); if (strlen(pw_got) > (*bufsiz - 1)) { *bufsiz = ERR_OVERFLOW; memset(pw_got, 0, strlen(pw_got)); From 3524cb92dec3258443da3a6669890375706f5f21 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 11 Feb 2001 23:35:07 +0000 Subject: [PATCH 1236/7878] Still wasn't right. Always return the (partial/complete) password string, and use the apr_status_t as the -one and only- indicatator of success, partial success or failure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61220 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_getpass.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index a5cbdea435d..1004575af1e 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -215,12 +215,10 @@ static char *getpass(const char *prompt) APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, size_t *bufsiz) { char *pw_got = getpass(prompt); - if (strlen(pw_got) > (*bufsiz - 1)) { - *bufsiz = ERR_OVERFLOW; - memset(pw_got, 0, strlen(pw_got)); - return APR_ENAMETOOLONG; - } apr_cpystrn(pwbuf, pw_got, *bufsiz); memset(pw_got, 0, strlen(pw_got)); + if (strlen(pw_got) >= *bufsiz) { + return APR_ENAMETOOLONG; + } return APR_SUCCESS; } From 799e39c3354bbc18ece8e3ffdc6edbddb07715d1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" <wrowe@apache.org> Date: Sun, 11 Feb 2001 23:41:34 +0000 Subject: [PATCH 1237/7878] Finally, protect from pure bogosity git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61221 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_getpass.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 1004575af1e..836438488d0 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -133,10 +133,10 @@ static char *getpass(const char *prompt) if (tcgetattr(STDIN_FILENO, &attr) != 0) return NULL; - attr.c_lflag &= ~(ECHO); - - if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &attr) != 0) - return NULL; + attr.c_lflag &= ~(ECHO); + + if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &attr) != 0) + return NULL; while ((password[n] = getchar()) != '\n') { if (password[n] >= ' ' && password[n] <= '~') { n++; @@ -215,6 +215,8 @@ static char *getpass(const char *prompt) APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, size_t *bufsiz) { char *pw_got = getpass(prompt); + if (!pw_got) + return APR_EINVAL; apr_cpystrn(pwbuf, pw_got, *bufsiz); memset(pw_got, 0, strlen(pw_got)); if (strlen(pw_got) >= *bufsiz) { From f6c117cfa2c9a2dcd97c9cde820cfe7e50463efc Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Mon, 12 Feb 2001 02:55:52 +0000 Subject: [PATCH 1238/7878] *) rename apr_memdup() to apr_pmemdup() *) optimize the allocation size in apr_pstrndup() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61222 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 3 ++- strings/apr_strings.c | 15 +++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index e2be2078f00..41a8f9affab 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -144,8 +144,9 @@ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); * @param m The memory to duplicate * @param n The number of bytes to duplicate * @return The new block of memory + * @deffunc void *apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n) */ -APR_DECLARE(void *) apr_memdup(apr_pool_t *p, const void *m, apr_size_t n); +APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n); /** * Concatenate multiple strings, allocating memory out a pool diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 85ac9f7b801..1aefc81a2a5 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -88,21 +88,20 @@ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *a, const char *s, apr_size_t n) if (s == NULL) { return NULL; } - res = apr_palloc(a, n + 1); len = strlen(s); - if(len > n) { - memcpy(res, s, n); - res[n] = '\0'; - } else - memcpy(res, s, len+1); + if (len < n) + n = len; + res = apr_palloc(a, n + 1); + memcpy(res, s, n); + res[n] = '\0'; return res; } -APR_DECLARE(void *) apr_memdup(apr_pool_t *a, const void *m, apr_size_t n) +APR_DECLARE(void *) apr_pmemdup(apr_pool_t *a, const void *m, apr_size_t n) { void *res; - if(m == NULL) + if (m == NULL) return NULL; res = apr_palloc(a, n); memcpy(res, m, n); From 667f539d187671e6373f3bfea6dcde1fc432eb58 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Mon, 12 Feb 2001 04:37:02 +0000 Subject: [PATCH 1239/7878] Fix a bad rename: apr_file_read_file should be apr_file_read_full (was originally apr_full_read) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61223 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fullrw.c | 13 +++++++------ include/apr_file_io.h | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index d15ea150ba1..d432a1d6e71 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -55,9 +55,9 @@ #include "apr_file_io.h" -APR_DECLARE(apr_status_t) apr_file_read_file(apr_file_t *thefile, void *buf, - apr_size_t nbytes, - apr_size_t *bytes_read) +APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, + apr_size_t nbytes, + apr_size_t *bytes_read) { apr_status_t status; apr_size_t total_read = 0; @@ -77,9 +77,10 @@ APR_DECLARE(apr_status_t) apr_file_read_file(apr_file_t *thefile, void *buf, return status; } -APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, const void *buf, - apr_size_t nbytes, - apr_size_t *bytes_written) +APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, + const void *buf, + apr_size_t nbytes, + apr_size_t *bytes_written) { apr_status_t status; apr_size_t total_written = 0; diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 5d864ca9bf7..873029230bf 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -284,9 +284,9 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, * error to be returned. * * APR_EINTR is never returned. - * @deffunc apr_status_t apr_file_read_file(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read) + * @deffunc apr_status_t apr_file_read_full(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read) */ -APR_DECLARE(apr_status_t) apr_file_read_file(apr_file_t *thefile, void *buf, +APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read); From d11ec137618a6b47b6be5aa79b3aba017f326c7b Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 12 Feb 2001 15:08:37 +0000 Subject: [PATCH 1240/7878] get prototype for apr_psprintf() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61224 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 1 + 1 file changed, 1 insertion(+) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 8a7b0242b48..70dea25e315 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -57,6 +57,7 @@ #include "apr_private.h" #include "apr_pools.h" #include "apr_signal.h" +#include "apr_strings.h" #define APR_WANT_SIGNAL #include "apr_want.h" From a97465740b73572417c7ecaaa4e801d410f89017 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 12 Feb 2001 20:45:59 +0000 Subject: [PATCH 1241/7878] standardize the include path in the OS/390 dso directory to get rid of an annoying warning message git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61225 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os390/Makefile.in | 4 +++- dso/os390/dso.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dso/os390/Makefile.in b/dso/os390/Makefile.in index 1fed5511423..fe018d7d403 100644 --- a/dso/os390/Makefile.in +++ b/dso/os390/Makefile.in @@ -5,6 +5,8 @@ TARGETS = dso.lo @INCLUDE_RULES@ INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) # DO NOT REMOVE diff --git a/dso/os390/dso.c b/dso/os390/dso.c index 24d42844b4b..81fa7038967 100644 --- a/dso/os390/dso.c +++ b/dso/os390/dso.c @@ -53,7 +53,7 @@ */ #include "apr_strings.h" -#include "os390/dso.h" +#include "dso.h" #include <errno.h> #include <string.h> From 15127e8259f7a5311af6ae351563bdbbcbe21b3a Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Mon, 12 Feb 2001 20:55:32 +0000 Subject: [PATCH 1242/7878] OS/390 has _POSIX_PATH_MAX but not PATH_MAX (did I hear a little bird say "APR_PATH_MAX?") git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61226 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 93bcc6165a7..8e2ac510d72 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -154,7 +154,11 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, wanted &= ~(APR_FINFO_NAME); if (wanted) { +#if defined(PATH_MAX) char fspec[PATH_MAX]; +#elif defined(_POSIX_PATH_MAX) + char fspec[_POSIX_PATH_MAX]; +#endif int off; apr_cpystrn(fspec, thedir->dirname, sizeof(fspec)); off = strlen(fspec); From 7c82cec0e85caadaeb7e2ac37d7bc130c6bb0338 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 13 Feb 2001 12:10:54 +0000 Subject: [PATCH 1243/7878] Including the right header file(s) for ntohl et al is a little bit cumbersome, so teach apr_want.h how to do that on the app's behalf when it specifies APR_WANT_BYTEFUNC. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61227 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_want.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/apr_want.h b/include/apr_want.h index b49af82dd22..d68d1c6a67a 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -62,6 +62,7 @@ * APR_WANT_STDIO: <stdio.h> and related bits * APR_WANT_IOVEC: struct iovec * APR_WANT_SIGNAL: signal numbers, functions, and types + * APR_WANT_BYTEFUNC: htons, htonl, ntohl, ntohs * * Typical usage: * @@ -135,3 +136,22 @@ #endif /* --------------------------------------------------------------------- */ + +#ifdef APR_WANT_BYTEFUNC + +/* Single Unix says they are in arpa/inet.h. Linux has them in + * netinet/in.h. FreeBSD has them in arpa/inet.h but requires that + * netinet/in.h be included first. + */ +#if APR_HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#if APR_HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif + +#undef APR_WANT_BYTEFUNC +#endif + +/* --------------------------------------------------------------------- */ + From e59ebd26fe552c86d16a3741a449eba6eeb4b959 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Tue, 13 Feb 2001 14:56:09 +0000 Subject: [PATCH 1244/7878] Don't assume apr_pstrndup will return n bytes of storage. It was recently optimized to only allocate enough storage for the string if shorter than n which caused the args to get scrambled. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61228 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/proc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 4c0f2b66bdb..d1b340b6823 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -411,16 +411,18 @@ apr_status_t apr_proc_create(apr_proc_t *proc, const char *progname, for (i=0; i<numargs; i++) cmdlen += strlen(newargs[i]) + 3; - cmdline = apr_pstrndup(cont, newargs[0], cmdlen + 2); - cmdline_pos = cmdline + strlen(cmdline); + cmdline = apr_palloc(cont, cmdlen + 2); + cmdline_pos = cmdline; - for (i=1; i<numargs; i++) { + for (i=0; i<numargs; i++) { const char *a = newargs[i]; if (strpbrk(a, "&|<>\" ")) a = apr_pstrcat(cont, "\"", double_quotes(cont, a), "\"", NULL); - *(cmdline_pos++) = ' '; + if (i) + *(cmdline_pos++) = ' '; + strcpy(cmdline_pos, a); cmdline_pos += strlen(cmdline_pos); } From 448d8ff803e71ef0ae0de240fc046a416c19be56 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 13 Feb 2001 18:48:52 +0000 Subject: [PATCH 1245/7878] Define APR_PATH_MAX to solve a minor portability aggravation. Win32 APR already defined it privately for the Win32 implementation of APR. We now externalize it everywhere. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61229 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 ++++-- file_io/unix/dir.c | 6 +----- include/apr.h.in | 18 ++++++++++++++++++ include/apr.hw | 9 +++++++++ include/arch/win32/fileio.h | 3 --- 5 files changed, 32 insertions(+), 10 deletions(-) diff --git a/configure.in b/configure.in index d064263bb03..72a3c9d6775 100644 --- a/configure.in +++ b/configure.in @@ -282,14 +282,14 @@ AC_CHECK_HEADERS(net/errno.h) AC_CHECK_HEADERS(fcntl.h, fcntlh="1", fcntl="0") AC_CHECK_HEADERS(grp.h) AC_CHECK_HEADERS(io.h, ioh="1", ioh="0") -AC_CHECK_HEADERS(limits.h) +AC_CHECK_HEADERS(limits.h, limitsh="1", limitsh="0") AC_CHECK_HEADERS(malloc.h) AC_CHECK_HEADERS(memory.h) AC_CHECK_HEADERS(netdb.h, netdbh="1", netdbh="0") AC_CHECK_HEADERS(osreldate.h) AC_CHECK_HEADERS(process.h) AC_CHECK_HEADERS(pwd.h) -AC_CHECK_HEADERS(sys/syslimits.h) +AC_CHECK_HEADERS(sys/syslimits.h, sys_syslimitsh="1", sys_syslimitsh="0") AC_CHECK_HEADERS(sys/sem.h) AC_CHECK_HEADERS(signal.h, signalh="1", signalh="0") AC_CHECK_HEADERS(stdarg.h, stdargh="1", stdargh="0") @@ -338,7 +338,9 @@ AC_SUBST(errnoh) AC_SUBST(direnth) AC_SUBST(fcntlh) AC_SUBST(ioh) +AC_SUBST(limitsh) AC_SUBST(netdbh) +AC_SUBST(sys_syslimitsh) AC_SUBST(netinet_inh) AC_SUBST(stdargh) AC_SUBST(stdioh) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 8e2ac510d72..933427258a8 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -154,11 +154,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, wanted &= ~(APR_FINFO_NAME); if (wanted) { -#if defined(PATH_MAX) - char fspec[PATH_MAX]; -#elif defined(_POSIX_PATH_MAX) - char fspec[_POSIX_PATH_MAX]; -#endif + char fspec[APR_PATH_MAX]; int off; apr_cpystrn(fspec, thedir->dirname, sizeof(fspec)); off = strlen(fspec); diff --git a/include/apr.h.in b/include/apr.h.in index a31e751fd8d..24ad85126f8 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -31,6 +31,7 @@ #define APR_HAVE_ERRNO_H @errnoh@ #define APR_HAVE_FCNTL_H @fcntlh@ #define APR_HAVE_IO_H @ioh@ +#define APR_HAVE_LIMITS_H @limitsh@ #define APR_HAVE_NETDB_H @netdbh@ #define APR_HAVE_NETINET_IN_H @netinet_inh@ #define APR_HAVE_PTHREAD_H @pthreadh@ @@ -41,6 +42,7 @@ #define APR_HAVE_STRINGS_H @stringsh@ #define APR_HAVE_SYS_SIGNAL_H @sys_signalh@ #define APR_HAVE_SYS_SOCKET_H @sys_socketh@ +#define APR_HAVE_SYS_SYSLIMITS_H @sys_syslimitsh@ #define APR_HAVE_SYS_TYPES_H @sys_typesh@ #define APR_HAVE_SYS_UIO_H @sys_uioh@ #define APR_HAVE_SIGNAL_H @signalh@ @@ -235,4 +237,20 @@ typedef @socklen_t_value@ apr_socklen_t; #include <os2.h> #endif +/* header files for PATH_MAX, _POSIX_PATH_MAX */ +#if APR_HAVE_SYS_SYSLIMITS_H +#include <sys/syslimits.h> +#endif +#if APR_HAVE_LIMITS_H +#include <limits.h> +#endif + +#if defined(PATH_MAX) +#define APR_PATH_MAX PATH_MAX +#elif defined(_POSIX_PATH_MAX) +#define APR_PATH_MAX _POSIX_PATH_MAX +#else +#error no decision has been made on APR_PATH_MAX for your platform +#endif + #endif /* APR_H */ diff --git a/include/apr.hw b/include/apr.hw index 2f4933f3509..a1b00e13c38 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -121,6 +121,7 @@ #define APR_HAVE_ERRNO_H 1 #define APR_HAVE_FCNTL_H 1 #define APR_HAVE_IO_H 1 +#define APR_HAVE_LIMITS_H 0 #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 #define APR_HAVE_PTHREAD_H 0 @@ -131,6 +132,7 @@ #define APR_HAVE_STRINGS_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 +#define APR_HAVE_SYS_SYSLIMITS_H 0 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 0 #define APR_HAVE_SIGNAL_H 1 @@ -297,5 +299,12 @@ struct iovec { #define STDOUT_FILENO 1 #define STDERR_FILENO 2 +#if APR_HAS_UNICODE_FS +/* An arbitrary size that is digestable. True max is a bit less than 32000 */ +#define APR_PATH_MAX 8192 +#else /* !APR_HAS_UNICODE_FS */ +#define APR_PATH_MAX MAX_PATH +#endif + #endif /* APR_H */ #endif /* WIN32 */ diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index d620efb01df..3f095a9d34c 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -99,11 +99,8 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* dststr, apr_size_t dstchars, apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, const apr_wchar_t* srcstr); -/* An arbitrary size that is digestable. True max is a bit less than 32000 */ -#define APR_PATH_MAX 8192 #define APR_FILE_MAX MAX_PATH #else /* !APR_HAS_UNICODE_FS */ -#define APR_PATH_MAX MAX_PATH #define APR_FILE_MAX MAX_PATH #endif From b083b8b70c27d585ef464a30ad5d331e3e650659 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Tue, 13 Feb 2001 19:07:34 +0000 Subject: [PATCH 1246/7878] tweak APR_TRY_COMPILE_NO_WARNING so that stderr from the compiler is saved in config.log instead of polluting the configure output git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61230 13f79535-47bb-0310-9956-ffa450edef68 --- apr_common.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apr_common.m4 b/apr_common.m4 index b67c3140a61..96f9bb8cfab 100644 --- a/apr_common.m4 +++ b/apr_common.m4 @@ -22,7 +22,7 @@ int main(int argc, const char * const argv[]) { ; return 0; } EOTEST changequote([, ]) -if ${CC-cc} -c $CFLAGS $CPPFLAGS $apr_tcnw_flags conftest.$ac_ext 1>&AC_FD_CC ; then +if ${CC-cc} -c $CFLAGS $CPPFLAGS $apr_tcnw_flags conftest.$ac_ext 2>&AC_FD_CC ; then ifelse([$3], , :, [rm -rf conftest* $3]) else From 7392f6c0a2eb4a12ed241506c6af3cec7ba88c21 Mon Sep 17 00:00:00 2001 From: David Reid <dreid@apache.org> Date: Tue, 13 Feb 2001 21:01:14 +0000 Subject: [PATCH 1247/7878] Again, BeOS doesn't really have the notion of groups and users at the moment, so we'll just ignore this until it does. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61231 13f79535-47bb-0310-9956-ffa450edef68 --- user/unix/groupinfo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 47d16fe4d9f..d7719fa668b 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -66,6 +66,8 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) { struct group *gr; +#ifndef BEOS + #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) struct group grp; char grbuf[512]; @@ -77,6 +79,7 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, return errno; } *groupname = apr_pstrdup(p, gr->gr_name); +#endif return APR_SUCCESS; } From 6ae6f25337492fda6479440dbd7331fd2f641243 Mon Sep 17 00:00:00 2001 From: Doug MacEachern <dougm@apache.org> Date: Tue, 13 Feb 2001 23:32:41 +0000 Subject: [PATCH 1248/7878] doh. need a spellchekker for these rename scripts. s/apr_lock_aquire/apr_lock_acquire/g; git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61232 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 4 ++-- file_io/unix/readwrite.c | 4 ++-- file_io/win32/readwrite.c | 4 ++-- include/apr_lock.h | 4 ++-- lib/apr_pools.c | 12 ++++++------ locks/beos/locks.c | 2 +- locks/os2/locks.c | 2 +- locks/unix/locks.c | 2 +- locks/win32/locks.c | 2 +- memory/unix/apr_pools.c | 12 ++++++------ test/testthread.c | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 37bc1da1995..e21bb32b203 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -76,7 +76,7 @@ apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) ULONG blocksize; ULONG size = *nbytes; - apr_lock_aquire(thefile->mutex); + apr_lock_acquire(thefile->mutex); if (thefile->direction == 1) { apr_file_flush(thefile); @@ -152,7 +152,7 @@ apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nb int blocksize; int size = *nbytes; - apr_lock_aquire(thefile->mutex); + apr_lock_acquire(thefile->mutex); if ( thefile->direction == 0 ) { // Position file pointer for writing at the offset we are logically reading from diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 84c5a7c48ab..c36858dc885 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -118,7 +118,7 @@ apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) apr_uint64_t size = *nbytes; #if APR_HAS_THREADS - apr_lock_aquire(thefile->thlock); + apr_lock_acquire(thefile->thlock); #endif if (thefile->direction == 1) { @@ -216,7 +216,7 @@ apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nb int size = *nbytes; #if APR_HAS_THREADS - apr_lock_aquire(thefile->thlock); + apr_lock_acquire(thefile->thlock); #endif if ( thefile->direction == 0 ) { diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index ee192717371..f75669c7d40 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -176,7 +176,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size apr_size_t blocksize; apr_size_t size = *len; - apr_lock_aquire(thefile->mutex); + apr_lock_acquire(thefile->mutex); if (thefile->direction == 1) { apr_file_flush(thefile); @@ -232,7 +232,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a int blocksize; int size = *nbytes; - apr_lock_aquire(thefile->mutex); + apr_lock_acquire(thefile->mutex); if (thefile->direction == 0) { // Position file pointer for writing at the offset we are logically reading from diff --git a/include/apr_lock.h b/include/apr_lock.h index aec0bce6e53..1cd3cc68771 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -107,9 +107,9 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, /** * Lock a protected region. * @param lock The lock to set. - * @deffunc apr_status_t apr_lock_aquire(apr_lock_t *lock) + * @deffunc apr_status_t apr_lock_acquire(apr_lock_t *lock) */ -APR_DECLARE(apr_status_t) apr_lock_aquire(apr_lock_t *lock); +APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock); /** * Unlock a protected region. diff --git a/lib/apr_pools.c b/lib/apr_pools.c index cbf92d0011b..67ebe2db69c 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -329,7 +329,7 @@ static void free_blocks(union block_hdr *blok) #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock_aquire(alloc_mutex); + apr_lock_acquire(alloc_mutex); } #endif old_free_list = block_freelist; @@ -474,7 +474,7 @@ APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock_aquire(alloc_mutex); + apr_lock_acquire(alloc_mutex); } #endif @@ -758,7 +758,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) apr_clear_pool(a); #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock_aquire(alloc_mutex); + apr_lock_acquire(alloc_mutex); } #endif @@ -963,7 +963,7 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock_aquire(alloc_mutex); + apr_lock_acquire(alloc_mutex); } #endif @@ -1087,7 +1087,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) /* must try another blok */ #if APR_HAS_THREADS - apr_lock_aquire(alloc_mutex); + apr_lock_acquire(alloc_mutex); #endif nblok = new_block(2 * cur_len, NULL); #if APR_HAS_THREADS @@ -1102,7 +1102,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) if (ps->got_a_new_block) { debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); #if APR_HAS_THREADS - apr_lock_aquire(alloc_mutex); + apr_lock_acquire(alloc_mutex); #endif blok->h.next = block_freelist; block_freelist = blok; diff --git a/locks/beos/locks.c b/locks/beos/locks.c index 43d9214659f..da665d4a839 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -86,7 +86,7 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, return APR_SUCCESS; } -apr_status_t apr_lock_aquire(apr_lock_t *lock) +apr_status_t apr_lock_acquire(apr_lock_t *lock) { apr_status_t stat; diff --git a/locks/os2/locks.c b/locks/os2/locks.c index 55e48edf248..7694fd015f9 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -133,7 +133,7 @@ apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, -apr_status_t apr_lock_aquire(apr_lock_t *lock) +apr_status_t apr_lock_acquire(apr_lock_t *lock) { ULONG rc; diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 84143302256..94e2e280dc4 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -101,7 +101,7 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, return APR_SUCCESS; } -apr_status_t apr_lock_aquire(apr_lock_t *lock) +apr_status_t apr_lock_acquire(apr_lock_t *lock) { apr_status_t stat; #if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */ diff --git a/locks/win32/locks.c b/locks/win32/locks.c index fa802ce66dd..7de4b1217df 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -115,7 +115,7 @@ APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_lock_aquire(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock) { DWORD rv; if (lock->scope == APR_INTRAPROCESS) { diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index cbf92d0011b..67ebe2db69c 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -329,7 +329,7 @@ static void free_blocks(union block_hdr *blok) #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock_aquire(alloc_mutex); + apr_lock_acquire(alloc_mutex); } #endif old_free_list = block_freelist; @@ -474,7 +474,7 @@ APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock_aquire(alloc_mutex); + apr_lock_acquire(alloc_mutex); } #endif @@ -758,7 +758,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) apr_clear_pool(a); #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock_aquire(alloc_mutex); + apr_lock_acquire(alloc_mutex); } #endif @@ -963,7 +963,7 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) #if APR_HAS_THREADS if (alloc_mutex) { - apr_lock_aquire(alloc_mutex); + apr_lock_acquire(alloc_mutex); } #endif @@ -1087,7 +1087,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) /* must try another blok */ #if APR_HAS_THREADS - apr_lock_aquire(alloc_mutex); + apr_lock_acquire(alloc_mutex); #endif nblok = new_block(2 * cur_len, NULL); #if APR_HAS_THREADS @@ -1102,7 +1102,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) if (ps->got_a_new_block) { debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); #if APR_HAS_THREADS - apr_lock_aquire(alloc_mutex); + apr_lock_acquire(alloc_mutex); #endif blok->h.next = block_freelist; block_freelist = blok; diff --git a/test/testthread.c b/test/testthread.c index 3ed5bcd21ec..046e3eabe3c 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -77,7 +77,7 @@ void * APR_THREAD_FUNC thread_func1(void *data) { int i; for (i = 0; i < 10000; i++) { - apr_lock_aquire(thread_lock); + apr_lock_acquire(thread_lock); x++; apr_lock_release(thread_lock); } @@ -88,7 +88,7 @@ void * APR_THREAD_FUNC thread_func2(void *data) { int i; for (i = 0; i < 10000; i++) { - apr_lock_aquire(thread_lock); + apr_lock_acquire(thread_lock); x++; apr_lock_release(thread_lock); } @@ -99,7 +99,7 @@ void * APR_THREAD_FUNC thread_func3(void *data) { int i; for (i = 0; i < 10000; i++) { - apr_lock_aquire(thread_lock); + apr_lock_acquire(thread_lock); x++; apr_lock_release(thread_lock); } @@ -110,7 +110,7 @@ void * APR_THREAD_FUNC thread_func4(void *data) { int i; for (i = 0; i < 10000; i++) { - apr_lock_aquire(thread_lock); + apr_lock_acquire(thread_lock); x++; apr_lock_release(thread_lock); } From 5610c8401fbbd212fae09ad9af0879098d4f3b15 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 16 Feb 2001 00:40:01 +0000 Subject: [PATCH 1249/7878] Add an apr_short_interval_time. This allows us to use an apr_interval_time for apr_time_t - apr_time_t values. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61234 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_time.h b/include/apr_time.h index 2aeac26c5ef..5f01650c8b6 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -74,7 +74,8 @@ extern APR_DECLARE_DATA const char apr_day_snames[7][4]; typedef apr_int64_t apr_time_t; /* intervals for I/O timeouts, in microseconds */ -typedef apr_int32_t apr_interval_time_t; +typedef apr_int64_t apr_interval_time_t; +typedef apr_int32_t apr_short_interval_time_t; #ifdef WIN32 #define APR_USEC_PER_SEC ((LONGLONG) 1000000) From a110b8730a5e933c691b1efd665b0eb358c004eb Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Fri, 16 Feb 2001 04:16:24 +0000 Subject: [PATCH 1250/7878] Update copyright to 2001 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61235 13f79535-47bb-0310-9956-ffa450edef68 --- dso/aix/dso.c | 2 +- dso/beos/dso.c | 2 +- dso/os2/dso.c | 2 +- dso/os390/dso.c | 2 +- dso/unix/dso.c | 2 +- dso/win32/dso.c | 2 +- file_io/os2/dir.c | 2 +- file_io/os2/fileacc.c | 2 +- file_io/os2/filedup.c | 2 +- file_io/os2/filestat.c | 2 +- file_io/os2/flock.c | 2 +- file_io/os2/maperrorcode.c | 2 +- file_io/os2/open.c | 2 +- file_io/os2/pipe.c | 2 +- file_io/os2/readwrite.c | 2 +- file_io/os2/seek.c | 2 +- file_io/unix/dir.c | 2 +- file_io/unix/fileacc.c | 2 +- file_io/unix/filedup.c | 2 +- file_io/unix/filestat.c | 2 +- file_io/unix/flock.c | 2 +- file_io/unix/fullrw.c | 2 +- file_io/unix/open.c | 2 +- file_io/unix/pipe.c | 2 +- file_io/unix/readwrite.c | 2 +- file_io/unix/seek.c | 2 +- file_io/win32/dir.c | 2 +- file_io/win32/filedup.c | 2 +- file_io/win32/filestat.c | 2 +- file_io/win32/flock.c | 2 +- file_io/win32/open.c | 2 +- file_io/win32/pipe.c | 2 +- file_io/win32/readwrite.c | 2 +- file_io/win32/seek.c | 2 +- helpers/rules.mk.in | 2 +- i18n/unix/utf8_ucs2.c | 2 +- i18n/unix/xlate.c | 2 +- include/apr.hw | 2 +- include/apr_dso.h | 2 +- include/apr_errno.h | 2 +- include/apr_file_info.h | 2 +- include/apr_file_io.h | 2 +- include/apr_general.h | 2 +- include/apr_getopt.h | 2 +- include/apr_hash.h | 2 +- include/apr_lib.h | 2 +- include/apr_lock.h | 2 +- include/apr_md5.h | 2 +- include/apr_mmap.h | 2 +- include/apr_network_io.h | 2 +- include/apr_pools.h | 2 +- include/apr_portable.h | 2 +- include/apr_shmem.h | 2 +- include/apr_signal.h | 2 +- include/apr_strings.h | 2 +- include/apr_tables.h | 2 +- include/apr_thread_proc.h | 2 +- include/apr_time.h | 2 +- include/apr_user.h | 2 +- include/apr_uuid.h | 2 +- include/apr_want.h | 2 +- include/apr_xlate.h | 2 +- include/arch/aix/dso.h | 2 +- include/arch/beos/dso.h | 2 +- include/arch/beos/locks.h | 2 +- include/arch/beos/threadproc.h | 2 +- include/arch/os2/dso.h | 2 +- include/arch/os2/fileio.h | 2 +- include/arch/os2/locks.h | 2 +- include/arch/os2/networkio.h | 2 +- include/arch/os2/os2calls.h | 2 +- include/arch/os2/threadproc.h | 2 +- include/arch/os390/dso.h | 2 +- include/arch/unix/dso.h | 2 +- include/arch/unix/fileio.h | 2 +- include/arch/unix/i18n.h | 2 +- include/arch/unix/locks.h | 2 +- include/arch/unix/misc.h | 2 +- include/arch/unix/networkio.h | 2 +- include/arch/unix/threadproc.h | 2 +- include/arch/win32/apr_private.h | 2 +- include/arch/win32/atime.h | 2 +- include/arch/win32/dso.h | 2 +- include/arch/win32/fileio.h | 2 +- include/arch/win32/locks.h | 2 +- include/arch/win32/misc.h | 2 +- include/arch/win32/networkio.h | 2 +- include/arch/win32/threadproc.h | 2 +- lib/apr_pools.c | 2 +- lib/apr_signal.c | 2 +- locks/beos/crossproc.c | 2 +- locks/beos/intraproc.c | 2 +- locks/beos/locks.c | 2 +- locks/os2/locks.c | 2 +- locks/unix/crossproc.c | 2 +- locks/unix/intraproc.c | 2 +- locks/unix/locks.c | 2 +- locks/win32/locks.c | 2 +- memory/unix/apr_pools.c | 2 +- misc/unix/errorcodes.c | 2 +- misc/unix/getuuid.c | 2 +- misc/unix/otherchild.c | 2 +- misc/unix/rand.c | 2 +- misc/unix/start.c | 2 +- misc/unix/uuid.c | 2 +- misc/win32/getuuid.c | 2 +- misc/win32/misc.c | 2 +- misc/win32/names.c | 2 +- misc/win32/rand.c | 2 +- mmap/unix/common.c | 2 +- mmap/unix/mmap.c | 2 +- mmap/win32/mmap.c | 2 +- network_io/beos/poll.c | 2 +- network_io/beos/sendrecv.c | 2 +- network_io/os2/os2calls.c | 2 +- network_io/os2/poll.c | 2 +- network_io/os2/sendrecv.c | 2 +- network_io/os2/sockets.c | 2 +- network_io/os2/sockopt.c | 2 +- network_io/unix/poll.c | 2 +- network_io/unix/sa_common.c | 2 +- network_io/unix/sendrecv.c | 2 +- network_io/unix/sockaddr.c | 2 +- network_io/unix/sockets.c | 2 +- network_io/unix/sockopt.c | 2 +- network_io/win32/poll.c | 2 +- network_io/win32/sendrecv.c | 2 +- network_io/win32/sockaddr.c | 2 +- network_io/win32/sockets.c | 2 +- network_io/win32/sockopt.c | 2 +- passwd/apr_getpass.c | 2 +- passwd/apr_md5.c | 2 +- shmem/os2/shmem.c | 2 +- shmem/unix/shmem.c | 2 +- strings/apr_cpystrn.c | 2 +- strings/apr_snprintf.c | 2 +- strings/apr_strings.c | 2 +- tables/apr_hash.c | 2 +- tables/apr_tables.c | 2 +- test/client.c | 2 +- test/sendfile.c | 2 +- test/server.c | 2 +- test/testargs.c | 2 +- test/testcontext.c | 2 +- test/testfile.c | 2 +- test/testflock.c | 2 +- test/testmd5.c | 2 +- test/testmmap.c | 2 +- test/testoc.c | 2 +- test/testpipe.c | 2 +- test/testproc.c | 2 +- test/testproc.rbb | 2 +- test/testshmem.c | 2 +- test/testsock.c | 2 +- test/testsockopt.c | 2 +- test/testthread.c | 2 +- test/testtime.c | 2 +- test/testuuid.c | 2 +- threadproc/beos/apr_proc_stub.c | 2 +- threadproc/beos/proc.c | 2 +- threadproc/beos/thread.c | 2 +- threadproc/beos/threadpriv.c | 2 +- threadproc/beos/threadproc_common.c | 2 +- threadproc/os2/proc.c | 2 +- threadproc/os2/thread.c | 2 +- threadproc/os2/threadpriv.c | 2 +- threadproc/unix/proc.c | 2 +- threadproc/unix/procsup.c | 2 +- threadproc/unix/signals.c | 2 +- threadproc/unix/thread.c | 2 +- threadproc/unix/threadpriv.c | 2 +- threadproc/win32/proc.c | 2 +- threadproc/win32/signals.c | 2 +- threadproc/win32/thread.c | 2 +- threadproc/win32/threadpriv.c | 2 +- time/unix/time.c | 2 +- time/unix/timestr.c | 2 +- time/win32/access.c | 2 +- time/win32/time.c | 2 +- time/win32/timestr.c | 2 +- user/unix/groupinfo.c | 2 +- user/unix/userinfo.c | 2 +- user/win32/groupinfo.c | 2 +- user/win32/userinfo.c | 2 +- 184 files changed, 184 insertions(+), 184 deletions(-) diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 4863107df8a..4ceb9415cad 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/dso/beos/dso.c b/dso/beos/dso.c index b41d97b751f..a19366cfa7d 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/dso/os2/dso.c b/dso/os2/dso.c index 50ed0d28263..16ae6693fed 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/dso/os390/dso.c b/dso/os390/dso.c index 81fa7038967..02a2970bf9d 100644 --- a/dso/os390/dso.c +++ b/dso/os390/dso.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 9ee57d93986..f16467ae4a2 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/dso/win32/dso.c b/dso/win32/dso.c index b77f0bfa467..15ffed1a401 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 425938cfd5d..ae7c2c62630 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/fileacc.c b/file_io/os2/fileacc.c index 52aef93a520..9e9d05f782f 100644 --- a/file_io/os2/fileacc.c +++ b/file_io/os2/fileacc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 7e7f9181e70..5829f4f2932 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index ff71b3c1e19..71c59bba64d 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/flock.c b/file_io/os2/flock.c index 9fd7e182fdf..98e6c52d145 100644 --- a/file_io/os2/flock.c +++ b/file_io/os2/flock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c index 36cba058d88..eeaf8fccd4f 100644 --- a/file_io/os2/maperrorcode.c +++ b/file_io/os2/maperrorcode.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 16ccb00be77..42c798f821d 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 5dd8cab29d2..2e20caf125e 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index e21bb32b203..8f500bcc4bf 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index f2027f20471..4d4c4d06a43 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 933427258a8..0bb1cc8dd4c 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 1303beb3d58..6addcf9af69 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 7f0e94f2646..89742924864 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 5c376b50f12..03c4357bf2a 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c index fe2892fa0c9..7765a392a4f 100644 --- a/file_io/unix/flock.c +++ b/file_io/unix/flock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index d432a1d6e71..829dc10efa7 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 4082e59d94b..e13f6b05d8a 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index c9405abea0b..c9b543f55c8 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index c36858dc885..9f4795a7308 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 459704279e7..d50cfdc4db1 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 902a2659e06..b21f7cda759 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index b4a865dbf5a..e3e048ebe61 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index f784db65237..61dc7557138 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index 6a54fcb07f1..9308a6c41be 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 03a9e01676b..dc0355683d8 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 4f4732d62e7..bf321ce2184 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index f75669c7d40..075fddcd257 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 69e0ff03140..ffa309cc7a6 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/helpers/rules.mk.in b/helpers/rules.mk.in index 56b54e63714..c56e4a84691 100644 --- a/helpers/rules.mk.in +++ b/helpers/rules.mk.in @@ -1,7 +1,7 @@ # ==================================================================== # The Apache Software License, Version 1.1 # -# Copyright (c) 2000 The Apache Software Foundation. All rights +# Copyright (c) 2000-2001 The Apache Software Foundation. All rights # reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/i18n/unix/utf8_ucs2.c b/i18n/unix/utf8_ucs2.c index a3dddf46764..68336c6543d 100644 --- a/i18n/unix/utf8_ucs2.c +++ b/i18n/unix/utf8_ucs2.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index f9c703430da..07ea14650a7 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr.hw b/include/apr.hw index a1b00e13c38..aa69284b9c6 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_dso.h b/include/apr_dso.h index 9c74b6e9f2b..b34054c8d37 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_errno.h b/include/apr_errno.h index de6e65809ac..fa5184ddaf3 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 44e37ee1935..eade2a74c19 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 873029230bf..b9067f3defb 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_general.h b/include/apr_general.h index 8db5f67b527..33d0a806038 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_getopt.h b/include/apr_getopt.h index f05a1e1e647..579cf983675 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_hash.h b/include/apr_hash.h index 8cb109606c4..548c1934cb6 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_lib.h b/include/apr_lib.h index 78683d90824..d66d122e5d1 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_lock.h b/include/apr_lock.h index 1cd3cc68771..47a091337bd 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_md5.h b/include/apr_md5.h index ebf013d45cf..4b916ad73bb 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -31,7 +31,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 67ea0cac0c6..06288a26bfc 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_network_io.h b/include/apr_network_io.h index b267a287bde..c641458f50d 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_pools.h b/include/apr_pools.h index 10fc9935f6c..553a546865d 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_portable.h b/include/apr_portable.h index ddbc64153b2..c4428953d44 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_shmem.h b/include/apr_shmem.h index 64e0604dbda..a291e730b5d 100644 --- a/include/apr_shmem.h +++ b/include/apr_shmem.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_signal.h b/include/apr_signal.h index 6b8b5c17470..940ed7e0d44 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_strings.h b/include/apr_strings.h index 41a8f9affab..ecd1789de83 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_tables.h b/include/apr_tables.h index 00c441ba5f3..2ff8e0991d6 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index fc0a89d0896..a9d6fde344d 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_time.h b/include/apr_time.h index 5f01650c8b6..07b72670e39 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_user.h b/include/apr_user.h index 507abd0b7ff..a4e62e640b6 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_uuid.h b/include/apr_uuid.h index 3b3e2e156d8..988ac970087 100644 --- a/include/apr_uuid.h +++ b/include/apr_uuid.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_want.h b/include/apr_want.h index d68d1c6a67a..e8a1c10ce1b 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_xlate.h b/include/apr_xlate.h index caa2d93f472..3a1d0c1d422 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/aix/dso.h b/include/arch/aix/dso.h index 6b7ca8ea74e..2cf9a610ba2 100644 --- a/include/arch/aix/dso.h +++ b/include/arch/aix/dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/beos/dso.h b/include/arch/beos/dso.h index 476e71c8fa4..112f9aad2ce 100644 --- a/include/arch/beos/dso.h +++ b/include/arch/beos/dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h index fd8557f1396..ec3e7753803 100644 --- a/include/arch/beos/locks.h +++ b/include/arch/beos/locks.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h index c53d32e4db0..cb77839b17a 100644 --- a/include/arch/beos/threadproc.h +++ b/include/arch/beos/threadproc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/dso.h b/include/arch/os2/dso.h index dd3e9223de8..474cf8aefa0 100644 --- a/include/arch/os2/dso.h +++ b/include/arch/os2/dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index a34b05d857a..324f30595d7 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/locks.h b/include/arch/os2/locks.h index 6864e49bec7..256fe39b2ce 100644 --- a/include/arch/os2/locks.h +++ b/include/arch/os2/locks.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index d4e855b0069..79534d7c6ef 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/os2calls.h b/include/arch/os2/os2calls.h index 2dcb86c6785..6dd6ae0919c 100644 --- a/include/arch/os2/os2calls.h +++ b/include/arch/os2/os2calls.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/threadproc.h index c14c54aa00c..b9808102c6b 100644 --- a/include/arch/os2/threadproc.h +++ b/include/arch/os2/threadproc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os390/dso.h b/include/arch/os390/dso.h index 5e112c13b60..62defa84fcc 100644 --- a/include/arch/os390/dso.h +++ b/include/arch/os390/dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/dso.h b/include/arch/unix/dso.h index fc9b8325e17..c7472c02666 100644 --- a/include/arch/unix/dso.h +++ b/include/arch/unix/dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index a230b3e037b..5066909e1ae 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/i18n.h b/include/arch/unix/i18n.h index da5f58f2cf6..9b32746490f 100644 --- a/include/arch/unix/i18n.h +++ b/include/arch/unix/i18n.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index 019fe0c72e7..e1cfc3b7e85 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index 7ec92b124f9..0849b5ef371 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 75791632cc8..5890de68ea3 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index d5f0a679f4b..489bb011468 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 00765bb3a74..c993ed77181 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/atime.h b/include/arch/win32/atime.h index d4a25731589..58588418fa9 100644 --- a/include/arch/win32/atime.h +++ b/include/arch/win32/atime.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/dso.h b/include/arch/win32/dso.h index 32bf6b7be74..645e24547fc 100644 --- a/include/arch/win32/dso.h +++ b/include/arch/win32/dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 3f095a9d34c..6c56a4c156a 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/locks.h b/include/arch/win32/locks.h index a7515f2382d..38f8f105a9c 100644 --- a/include/arch/win32/locks.h +++ b/include/arch/win32/locks.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 7ec92b124f9..0849b5ef371 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index e3bfd49d4fa..3e0d950d0c9 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/threadproc.h index 24a140bb1e1..58a718e35b6 100644 --- a/include/arch/win32/threadproc.h +++ b/include/arch/win32/threadproc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 67ebe2db69c..312cf390d57 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/lib/apr_signal.c b/lib/apr_signal.c index adbc74d8811..2fcc77c66aa 100644 --- a/lib/apr_signal.c +++ b/lib/apr_signal.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c index a2052891b75..536fa140f1e 100644 --- a/locks/beos/crossproc.c +++ b/locks/beos/crossproc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/beos/intraproc.c b/locks/beos/intraproc.c index 57f1c9b6794..88cae84132b 100644 --- a/locks/beos/intraproc.c +++ b/locks/beos/intraproc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/beos/locks.c b/locks/beos/locks.c index da665d4a839..9a915212ddc 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/os2/locks.c b/locks/os2/locks.c index 7694fd015f9..15d72127332 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 050e9c4e5e1..8720fcca4dc 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index cd9c0f666dd..d0bad26ee70 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 94e2e280dc4..52ae5900f83 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 7de4b1217df..41856a4fcc2 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 67ebe2db69c..312cf390d57 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 36bdcb5b137..785bf94f878 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index 547cc4e2aef..f43c99c21e0 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 40b16b05f0b..3dc6f6ef2a5 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 2b5b3ffb8db..ceb8c8ea6ba 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/unix/start.c b/misc/unix/start.c index 61a94b105c8..9f90db08d01 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/unix/uuid.c b/misc/unix/uuid.c index 00a533fc562..afccc5e5b1b 100644 --- a/misc/unix/uuid.c +++ b/misc/unix/uuid.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/win32/getuuid.c b/misc/win32/getuuid.c index e1b5b4b0e4f..e833472ec98 100644 --- a/misc/win32/getuuid.c +++ b/misc/win32/getuuid.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/win32/misc.c b/misc/win32/misc.c index f4b00b07420..bb5535102c7 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/win32/names.c b/misc/win32/names.c index 1e0bf3f5faa..dab10984aae 100644 --- a/misc/win32/names.c +++ b/misc/win32/names.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/win32/rand.c b/misc/win32/rand.c index e81b2deda77..38b79499855 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/mmap/unix/common.c b/mmap/unix/common.c index cec98e225b9..df873c3a720 100644 --- a/mmap/unix/common.c +++ b/mmap/unix/common.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 09ae1da0149..32ae8a6d00a 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index b42ab98e886..6060e0c9d5e 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index 6282877cb57..cf1a61b7254 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index a140844b65c..a5380940cd3 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/os2/os2calls.c b/network_io/os2/os2calls.c index 1acbfa06f33..423b7ec22e8 100644 --- a/network_io/os2/os2calls.c +++ b/network_io/os2/os2calls.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/os2/poll.c b/network_io/os2/poll.c index 5b6850d3295..f8925359759 100644 --- a/network_io/os2/poll.c +++ b/network_io/os2/poll.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index e21c7c2536c..29b6190e271 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index e3833e418ff..6b6ba9328d1 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index c1348546cbc..b9827a50e53 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index d6ef1fb0a3b..f2ee4bfcdb8 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 52bd9ed995f..8d607c96208 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index f9545f30de0..f878f855c14 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index e9713266170..c3161c45ae2 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index b29f6429412..5ab6826ab51 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index e7fe8e931dc..3b3d6d2883a 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 5d01f313aea..f9a2632431b 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 1aa12dca306..59827bd50ee 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index b29f418189a..db4f18afbe8 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 21559692fef..465e2c6d397 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 29d5edae506..6606d10bc9e 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 836438488d0..1338b097730 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index 8387ff2a644..2264a4bcb7a 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -34,7 +34,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/shmem/os2/shmem.c b/shmem/os2/shmem.c index 49713f40695..4bb279062ba 100644 --- a/shmem/os2/shmem.c +++ b/shmem/os2/shmem.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 1abcd7f1fe9..9c57742da9d 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index e8aa7ed00cf..a51ddef1214 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 7dfb1384f23..5daedc9b60f 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 1aefc81a2a5..4e47fa00274 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 142e93dd127..c8505087d12 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 059f9363559..6c97da9bc1a 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/client.c b/test/client.c index 70f269c5ec2..cdb7495b354 100644 --- a/test/client.c +++ b/test/client.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/sendfile.c b/test/sendfile.c index 146a05b8261..4a52d9eb143 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/server.c b/test/server.c index c47366b2824..69de39867d4 100644 --- a/test/server.c +++ b/test/server.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testargs.c b/test/testargs.c index 803f3eccabf..8a7cc825df9 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testcontext.c b/test/testcontext.c index 7267aac0afb..dbaf880bb25 100644 --- a/test/testcontext.c +++ b/test/testcontext.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testfile.c b/test/testfile.c index af449742a4d..9985dd06e40 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testflock.c b/test/testflock.c index 5ada22ee283..3d37b609599 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testmd5.c b/test/testmd5.c index 7dc02adf524..113f8a5d80b 100644 --- a/test/testmd5.c +++ b/test/testmd5.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testmmap.c b/test/testmmap.c index d074a6992ab..8a4cc8bbdcf 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testoc.c b/test/testoc.c index 813694df1c1..f7ee02c3ed8 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testpipe.c b/test/testpipe.c index 4a6a8cfc146..991abe8302a 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testproc.c b/test/testproc.c index f4e9e771bf6..04c0d1ebd61 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testproc.rbb b/test/testproc.rbb index ac2c738bc44..1ebafee120f 100644 --- a/test/testproc.rbb +++ b/test/testproc.rbb @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 2000 The Apache Software Foundation. All rights reserved. + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/test/testshmem.c b/test/testshmem.c index 8e9bb37be35..9c0fb5c92d8 100644 --- a/test/testshmem.c +++ b/test/testshmem.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testsock.c b/test/testsock.c index c9af113b05d..360c021c5b2 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testsockopt.c b/test/testsockopt.c index 3759f5e3fec..b51da23fceb 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testthread.c b/test/testthread.c index 046e3eabe3c..852f2fa5de4 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testtime.c b/test/testtime.c index 20f315cf106..c92b9260d8f 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testuuid.c b/test/testuuid.c index 1d4c7e9d41d..43ae980ab7a 100644 --- a/test/testuuid.c +++ b/test/testuuid.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/beos/apr_proc_stub.c b/threadproc/beos/apr_proc_stub.c index ff2ea87cd1d..7a3726b379f 100644 --- a/threadproc/beos/apr_proc_stub.c +++ b/threadproc/beos/apr_proc_stub.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 1b33ca06dbf..063b993ec70 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 779ec2b44e9..041319d9c16 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index f6d34f2227f..949d67afa5b 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/beos/threadproc_common.c b/threadproc/beos/threadproc_common.c index 077f6818141..369bd03e739 100644 --- a/threadproc/beos/threadproc_common.c +++ b/threadproc/beos/threadproc_common.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index d1b340b6823..fa27c6efad4 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index b0682e58a47..4bc6d8c4fa7 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index 24291b8f4cf..da3989fddf0 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 37be60bc0e3..355e83b979a 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index 766d947b2f2..8081e2ed10c 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 70dea25e315..6e5f5115970 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index d69df3b5ad8..d6566c9dbd1 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 0780335f8a9..e5f520afa2e 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 9d2e3a42274..6ddeb626499 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 069487eb5c7..970ea70a768 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 98a63d30bc4..624da55fb07 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index da0baf216e5..5163914c87e 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/time/unix/time.c b/time/unix/time.c index 73ad3b82555..9076d77e3ec 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/time/unix/timestr.c b/time/unix/timestr.c index 9926e23a274..82d39df62d4 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/time/win32/access.c b/time/win32/access.c index 2df67fb4206..59ad20665f3 100644 --- a/time/win32/access.c +++ b/time/win32/access.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/time/win32/time.c b/time/win32/time.c index 35ae545e3df..9d8836da5dd 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 9c7cfc1069f..7c70dec1ce9 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index d7719fa668b..eac3aa843a5 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 38ed8d5c05a..30729692509 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index 1fbbcf0f625..1f582cf5b8e 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 5d423eb1a86..1771f90367f 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without From 6625563df039a125c52da80cb6b1416a05b2a010 Mon Sep 17 00:00:00 2001 From: Ryan Bloom <rbb@apache.org> Date: Fri, 16 Feb 2001 05:50:49 +0000 Subject: [PATCH 1251/7878] Force FreeBSD to compile without threads by default. To enable threads, use --enable-threads on the configure line. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61236 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ hints.m4 | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 5f966dccfff..92f41dc3654 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Force FreeBSD to compile without threads by default. To enable + threads, use --enable-threads on the configure line. + [Ryan Bloom] + *) Purge system password buffer before returning from apr_password_get. No longer abuses bufsize argument on return. [William Rowe] diff --git a/hints.m4 b/hints.m4 index 6a7b3d69236..e80f40e9b30 100644 --- a/hints.m4 +++ b/hints.m4 @@ -140,6 +140,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; esac APR_ADDTO(LIBS, [-lcrypt]) + APR_SETIFNULL(enable_threads, [no]) ;; *-next-nextstep*) APR_SETIFNULL(OPTIM, [-O]) From b0b60e447bd79516cba0f4b7249c914ae1d0f901 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Fri, 16 Feb 2001 10:17:11 +0000 Subject: [PATCH 1252/7878] Use symbols to reduce hard-coded pathnames. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61237 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 12 ++---------- configure.in | 15 +++++++++------ helpers/rules.mk.in | 6 ++++-- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/Makefile.in b/Makefile.in index 906367518a9..af860b2f81b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -62,18 +62,10 @@ delete-exports: fi $(TARGET_EXPORTS): - if test -z "$(srcdir)"; then \ - $(AWK) -f helpers/make_export.awk include/*.h > $@ ; \ - else \ - $(AWK) -f $(srcdir)helpers/make_export.awk $(srcdir)include/*.h > $@ ; \ - fi + $(MKEXPORT) include/*.h > $@ docs: - if test -z "$(srcdir)"; then \ - helpers/scandoc -ihelpers/default.pl -p./docs/ ./include/*.h; \ - else \ - $(srcdir)helpers/scandoc -i$(srcdir)helpers/default.pl -p./docs/ $(srcdir)include/*.h; \ - fi + $(SCANDOC) -ihelpers/default.pl -p./docs/ ./include/*.h test: $(TARGET_LIB) (cd test; make clean; make; \ diff --git a/configure.in b/configure.in index 72a3c9d6775..a66240a1f24 100644 --- a/configure.in +++ b/configure.in @@ -26,12 +26,6 @@ dnl Libtool needs this symbol top_builddir="$abs_builddir" AC_SUBST(top_builddir) -dnl Get location of helpers directory -dnl XXX This assumes that APR "lives" under Apache. -dnl XXX We'll need to fix this when we pull it out. -abs_helpersdir=$abs_srcdir/helpers -MKDIR=$abs_helpersdir/mkdir.sh - if test "$abs_builddir" != "$abs_srcdir"; then USE_VPATH=1 fi @@ -48,6 +42,15 @@ AC_PROG_AWK AC_CHECK_PROG(RM, rm, rm) AC_CHECK_TOOL(AR, ar, ar) +dnl Get locations of the build helper scripts +MKDIR=$abs_srcdir/helpers/mkdir.sh +APR_MKEXPORT="$AWK -f $abs_srcdir/helpers/make_export.awk" +AC_SUBST(APR_MKEXPORT) +APR_MKDEP=$abs_srcdir/helpers/mkdep.sh +AC_SUBST(APR_MKDEP) +APR_SCANDOC=$abs_srcdir/helpers/scandoc +AC_SUBST(APR_SCANDOC) + # This macro needs to be here in case we are on an AIX box. AC_AIX diff --git a/helpers/rules.mk.in b/helpers/rules.mk.in index c56e4a84691..7bc932ffc85 100644 --- a/helpers/rules.mk.in +++ b/helpers/rules.mk.in @@ -75,11 +75,13 @@ LDFLAGS=@LDFLAGS@ RM=@RM@ SHELL=@SHELL@ +MKEXPORT=@APR_MKEXPORT@ +MKDEP=@APR_MKDEP@ +SCANDOC=@APR_SCANDOC@ + ### make LTFLAGS somewhat variable? LTFLAGS = --silent -MKDEP=$(top_builddir)/helpers/mkdep.sh - # # Basic macro setup # From 9ef2d1afecedbec8bf6916eaa0ae9e7004b5c1a7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 16 Feb 2001 19:46:25 +0000 Subject: [PATCH 1253/7878] use the correct type for the len parameter to apr_recv(); this fixes a warning on HP-UX 11 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61238 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sendfile.c b/test/sendfile.c index 4a52d9eb143..59513fd5364 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -512,7 +512,7 @@ static int server(void) char buf[120]; int i; apr_socket_t *newsock = NULL; - apr_ssize_t bytes_read; + apr_size_t bytes_read; apr_sockaddr_t *localsa; int family; From 96dc0ab2399f04ca7ec1057e2d7a54afe055ba48 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 16 Feb 2001 21:04:17 +0000 Subject: [PATCH 1254/7878] include <string.h> for the strerror() prototype on HP-UX 11 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61239 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index f16467ae4a2..6ff0baf3fd9 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -60,6 +60,9 @@ #ifdef HAVE_STDDEF_H #include <stddef.h> #endif +#if APR_HAVE_STRING_H +#include <string.h> /* for strerror() on HP-UX */ +#endif static apr_status_t dso_cleanup(void *thedso) { From 255bc6059bac9bf92f9f5ed4fa2715eb853fbf06 Mon Sep 17 00:00:00 2001 From: Jeff Trawick <trawick@apache.org> Date: Fri, 16 Feb 2001 21:34:05 +0000 Subject: [PATCH 1255/7878] Get apr_sendfile() working on HP-UX. This gets APR to build on HP-UX without having to turn off APR_HAS_SENDFILE. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61240 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + network_io/unix/sendrecv.c | 152 +++++++++++++++++++++++-------------- 2 files changed, 96 insertions(+), 59 deletions(-) diff --git a/CHANGES b/CHANGES index 92f41dc3654..5408f8dd281 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Get apr_sendfile() working on HP-UX. This gets APR to build on + HP-UX without having to turn off APR_HAS_SENDFILE. [Jeff Trawick] + *) Force FreeBSD to compile without threads by default. To enable threads, use --enable-threads on the configure line. [Ryan Bloom] diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index f878f855c14..b9256e4f815 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -469,20 +469,30 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, return APR_SUCCESS; } -#elif defined(__HPUX__) +#elif defined(__hpux) || defined(__hpux__) -#error "there's no way this apr_sendfile implementation works -djg" +/* HP cc in ANSI mode defines __hpux; gcc defines __hpux__ */ -/* HP-UX Version 10.30 or greater */ -apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, - apr_int32_t flags) +/* HP-UX Version 10.30 or greater + * (no worries, because we only get here if autoconfiguration found sendfile) + */ + +/* ssize_t sendfile(int s, int fd, off_t offset, size_t nbytes, + * const struct iovec *hdtrl, int flags); + * + * nbytes is the number of bytes to send just from the file; as with FreeBSD, + * if nbytes == 0, the rest of the file (from offset) is sent + */ + +apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, + apr_int32_t flags) { - int i, ptr = 0; - size_t nbytes = 0, headerlen = 0, trailerlen = 0; - struct sf_hdtr headerstruct; + int i; + ssize_t rc; + size_t nbytes = *len, headerlen, trailerlen; struct iovec hdtrarray[2]; - void *headerbuf, *trailerbuf; + char *headerbuf, *trailerbuf; if (!hdtr) { hdtr = &no_hdtr; @@ -491,83 +501,107 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, /* Ignore flags for now. */ flags = 0; - /* HP-UX can only send one header iovec and one footer iovec */ + /* HP-UX can only send one header iovec and one footer iovec; try to + * only allocate storage to combine input iovecs when we really have to + */ - for (i = 0; i < hdtr->numheaders; i++) { - headerlen += hdtr->headers[i].iov_len; - } + switch(hdtr->numheaders) { + case 0: + hdtrarray[0].iov_base = NULL; + hdtrarray[0].iov_len = 0; + break; + case 1: + hdtrarray[0] = hdtr->headers[0]; + break; + default: + headerlen = 0; + for (i = 0; i < hdtr->numheaders; i++) { + headerlen += hdtr->headers[i].iov_len; + } - /* XXX: BUHHH? wow, what a memory leak! */ - headerbuf = apr_palloc(sock->cntxt, headerlen); + /* XXX: BUHHH? wow, what a memory leak! */ + headerbuf = hdtrarray[0].iov_base = apr_palloc(sock->cntxt, headerlen); + hdtrarray[0].iov_len = headerlen; - for (i = 0; i < hdtr->numheaders; i++) { - memcpy(headerbuf + ptr, hdtr->headers[i].iov_base, - hdtr->headers[i].iov_len); - ptr += hdtr->headers[i].iov_len; + for (i = 0; i < hdtr->numheaders; i++) { + memcpy(headerbuf, hdtr->headers[i].iov_base, + hdtr->headers[i].iov_len); + headerbuf += hdtr->headers[i].iov_len; + } } - for (i = 0; i < hdtr->numtrailers; i++) { - trailerlen += hdtr->headers[i].iov_len; - } + switch(hdtr->numtrailers) { + case 0: + hdtrarray[1].iov_base = NULL; + hdtrarray[1].iov_len = 0; + break; + case 1: + hdtrarray[1] = hdtr->trailers[0]; + break; + default: + trailerlen = 0; + for (i = 0; i < hdtr->numtrailers; i++) { + trailerlen += hdtr->trailers[i].iov_len; + } - /* XXX: BUHHH? wow, what a memory leak! */ - trailerbuf = apr_palloc(sock->cntxt, trailerlen); + /* XXX: BUHHH? wow, what a memory leak! */ + trailerbuf = hdtrarray[1].iov_base = apr_palloc(sock->cntxt, trailerlen); + hdtrarray[1].iov_len = trailerlen; - for (i = 0; i < hdtr->numtrailers; i++) { - memcpy(trailerbuf + ptr, hdtr->trailers[i].iov_base, - hdtr->trailers[i].iov_len); - ptr += hdtr->trailers[i].iov_len; + for (i = 0; i < hdtr->numtrailers; i++) { + memcpy(trailerbuf, hdtr->trailers[i].iov_base, + hdtr->trailers[i].iov_len); + trailerbuf += hdtr->trailers[i].iov_len; + } } - hdtrarray[0].iov_base = headerbuf; - hdtrarray[0].iov_len = headerlen; - hdtrarray[1].iov_base = trailerbuf; - hdtrarray[1].iov_len = trailerlen; - do { - rv = sendfile(sock->socketdes, /* socket */ - file->filedes, /* file descriptor to send */ - *offset, /* where in the file to start */ - /* XXX: as far as i can see, nbytes == 0 always here -djg */ - nbytes, /* number of bytes to send */ - hdtrarray, /* Headers/footers */ - flags /* undefined, set to 0 */ - ); - } while (rv == -1 && errno == EINTR); + if (nbytes) { /* any bytes to send from the file? */ + rc = sendfile(sock->socketdes, /* socket */ + file->filedes, /* file descriptor to send */ + *offset, /* where in the file to start */ + nbytes, /* number of bytes to send from file */ + hdtrarray, /* Headers/footers */ + flags); /* undefined, set to 0 */ + } + else { /* we can't call sendfile() for trailers only */ + rc = write(sock->socketdes, hdtrarray[1].iov_base, hdtrarray[1].iov_len); + } + } while (rc == -1 && errno == EINTR); - if (rv == -1 && + if (rc == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { - /* jlt: not tested, but this matches other sendfile logic */ - (*len) = 0; + *len = 0; return arv; } else { do { - rv = sendfile(sock->socketdes, /* socket */ - file->filedes, /* file descriptor to send */ - *offset, /* where in the file to start */ - /* XXX: as far as i can see, nbytes == 0 always here -djg */ - nbytes, /* number of bytes to send */ - hdtrarray, /* Headers/footers */ - flags /* undefined, set to 0 */ - ); - } while (rv == -1 && errno == EINTR); + if (nbytes) { + rc = sendfile(sock->socketdes, /* socket */ + file->filedes, /* file descriptor to send */ + *offset, /* where in the file to start */ + nbytes, /* number of bytes to send from file */ + hdtrarray, /* Headers/footers */ + flags); /* undefined, set to 0 */ + } + else { /* we can't call sendfile() for trailers only */ + rc = write(sock->socketdes, hdtrarray[1].iov_base, hdtrarray[1].iov_len); + } + } while (rc == -1 && errno == EINTR); } } - - if (rv == -1) { + if (rc == -1) { *len = 0; return errno; } - /* Set len to the number of bytes written */ - (*len) = rv; + *len = rc; return APR_SUCCESS; } #elif defined(_AIX) || defined(__MVS__) From 6758a462a86009a75c21a5793b983eaa9d39d282 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sat, 17 Feb 2001 11:15:46 +0000 Subject: [PATCH 1256/7878] Moved hints.m4, apr_common.m4, and helpers/apr-conf.m4 into the new build directory as apr_hints.m4, apr_common.m4, apr_network.m4, and apr_threads.m4. None of the macro code has changed for this pass -- only the location. More changes to come. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61241 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 + build/apr_common.m4 | 378 +++++++++++++++++++++++++++++++++++++++++++ build/apr_hints.m4 | 377 ++++++++++++++++++++++++++++++++++++++++++ build/apr_network.m4 | 337 ++++++++++++++++++++++++++++++++++++++ build/apr_threads.m4 | 178 ++++++++++++++++++++ buildconf | 14 +- configure.in | 2 +- 7 files changed, 1286 insertions(+), 4 deletions(-) create mode 100644 build/apr_common.m4 create mode 100644 build/apr_hints.m4 create mode 100644 build/apr_network.m4 create mode 100644 build/apr_threads.m4 diff --git a/CHANGES b/CHANGES index 5408f8dd281..ec074d926ce 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Moved hints.m4, apr_common.m4, and helpers/apr-conf.m4 into the + new build directory as apr_hints.m4, apr_common.m4, apr_network.m4, + and apr_threads.m4. [Roy Fielding] + *) Get apr_sendfile() working on HP-UX. This gets APR to build on HP-UX without having to turn off APR_HAS_SENDFILE. [Jeff Trawick] diff --git a/build/apr_common.m4 b/build/apr_common.m4 new file mode 100644 index 00000000000..12bb83c48a7 --- /dev/null +++ b/build/apr_common.m4 @@ -0,0 +1,378 @@ +dnl ----------------------------------------------------------------- +dnl apr_common.m4: APR's general-purpose autoconf macros +dnl + +dnl +dnl RUN_SUBDIR_CONFIG_NOW(dir [, sub-package-cmdline-args]) +dnl +AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [ + # save our work to this point; this allows the sub-package to use it + AC_CACHE_SAVE + + echo "configuring package in $1 now" + ac_popdir=`pwd` + ac_abs_srcdir=`(cd $srcdir/$1 && pwd)` + apr_config_subdirs="$1" + test -d $1 || $MKDIR $1 + cd $1 + +changequote(, )dnl + # A "../" for each directory in /$config_subdirs. + ac_dots=`echo $apr_config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` +changequote([, ])dnl + + # Make the cache file name correct relative to the subdirectory. + case "$cache_file" in + /*) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file="$ac_dots$cache_file" ;; + esac + + # The eval makes quoting arguments work. + if eval $ac_abs_srcdir/configure $ac_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $2 + then : + echo "$1 configured properly" + else + echo "configure failed for $1" + exit 1 + fi + + cd $ac_popdir + + # grab any updates from the sub-package + AC_CACHE_LOAD +]) + + +AC_DEFUN(APR_PREPARE_MM_DIR,[ +dnl #----------------------------- Prepare mm directory for VPATH support +if test -n "$USE_MM" && test -n "$USE_VPATH"; then + test -d $mm_dir || $MKDIR $mm_dir + + for i in shtool config.guess config.sub fbtool ltconfig \ + ltmain.sh mm_vers.c; do + test -r $mm_dir/$i || ln -s $abs_srcdir/$mm_dir/$i $mm_dir/$i + done +fi +]) + +dnl +dnl APR_DOEXTRA +dnl +dnl Handle the use of EXTRA_* variables. +dnl Basically, EXTRA_* vars are added to the +dnl current settings of their "parents". We +dnl can expand as needed for additional +dnl EXTRA_* variables by adding them to the +dnl "for i in..." line. +dnl +dnl To handle recursive configures, the 1st time +dnl through we need to null out EXTRA_* and then +dnl export the lot of them, since we want/need +dnl them to exist in the sub-configures' environment. +dnl The nasty eval's allow us to use the 'for' +dnl construct and save some lines of code. +dnl +AC_DEFUN(APR_DOEXTRA, [ + for i in CFLAGS LDFLAGS LIBS + do + eval APR_TMP=\$EXTRA_$i + if test -n "$APR_TMP"; then + eval $i=\"\$$i $APR_TMP\" + eval export $i + eval unset EXTRA_${i} + eval export EXTRA_${i} + fi + done +]) + +dnl +dnl APR_SETIFNULL(variable, value) +dnl +dnl Set variable iff it's currently null +dnl +AC_DEFUN(APR_SETIFNULL,[ + if test -z "$$1"; then + echo " Setting $1 to \"$2\"" + $1="$2"; export $1 + fi +]) + +dnl +dnl APR_SETVAR(variable, value) +dnl +dnl Set variable no matter what +dnl +AC_DEFUN(APR_SETVAR,[ + echo " Forcing $1 to \"$2\"" + $1="$2"; export $1 +]) + +dnl +dnl APR_ADDTO(variable, value) +dnl +dnl Add value to variable +dnl +AC_DEFUN(APR_ADDTO,[ + echo " Adding \"$2\" to $1" + $1="$$1 $2"; export $1 +]) + + +define(AC_USE_FUNCTION,[dnl +AC_CHECK_FUNCS($1) +if test ".$ac_func_$1" = .yes; then +AC_DEFINE(USE_$2) +fi +]) + + +AC_DEFUN(AC_CHECK_DEFINE_FILES,[ + AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ + ac_cv_define_$1=no + for curhdr in $2 + do + AC_EGREP_CPP(YES_IS_DEFINED, [ + #include <$curhdr> + #ifdef $1 + YES_IS_DEFINED + #endif + ], ac_cv_define_$1=yes) + done + ]) + if test "$ac_cv_define_$1" = "yes"; then + AC_DEFINE(HAVE_$1) + fi +]) + + +AC_DEFUN(AC_CHECK_DEFINE,[ + AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ + AC_EGREP_CPP(YES_IS_DEFINED, [ + #include <$2> + #ifdef $1 + YES_IS_DEFINED + #endif + ], ac_cv_define_$1=yes, ac_cv_define_$1=no) + ]) + if test "$ac_cv_define_$1" = "yes"; then + AC_DEFINE(HAVE_$1) + fi +]) + + +define(AC_IFALLYES,[dnl +ac_rc=yes +for ac_spec in $1; do + ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'` + ac_item=`echo "$ac_spec" | sed -e 's/^.*://'` + case $ac_type in + header ) + ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'` + ac_var="ac_cv_header_$ac_item" + ;; + file ) + ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'` + ac_var="ac_cv_file_$ac_item" + ;; + func ) ac_var="ac_cv_func_$ac_item" ;; + define ) ac_var="ac_cv_define_$ac_item" ;; + custom ) ac_var="$ac_item" ;; + esac + eval "ac_val=\$$ac_var" + if test ".$ac_val" != .yes; then + ac_rc=no + break + fi +done +if test ".$ac_rc" = .yes; then + : + $2 +else + : + $3 +fi +]) + + +define(AC_BEGIN_DECISION,[dnl +ac_decision_item='$1' +ac_decision_msg='FAILED' +ac_decision='' +]) + + +define(AC_DECIDE,[dnl +ac_decision='$1' +ac_decision_msg='$2' +ac_decision_$1=yes +ac_decision_$1_msg='$2' +]) + + +define(AC_DECISION_OVERRIDE,[dnl + ac_decision='' + for ac_item in $1; do + eval "ac_decision_this=\$ac_decision_${ac_item}" + if test ".$ac_decision_this" = .yes; then + ac_decision=$ac_item + eval "ac_decision_msg=\$ac_decision_${ac_item}_msg" + fi + done +]) + + +define(AC_DECISION_FORCE,[dnl +ac_decision="$1" +eval "ac_decision_msg=\"\$ac_decision_${ac_decision}_msg\"" +]) + + +define(AC_END_DECISION,[dnl +if test ".$ac_decision" = .; then + echo "[$]0:Error: decision on $ac_decision_item failed" 1>&2 + exit 1 +else + if test ".$ac_decision_msg" = .; then + ac_decision_msg="$ac_decision" + fi + AC_DEFINE_UNQUOTED(${ac_decision_item}) + AC_MSG_RESULT([decision on $ac_decision_item... $ac_decision_msg]) +fi +]) + +dnl ### AC_TRY_RUN had some problems actually using a programs return code, +dnl ### so I am re-working it here to be used in APR's configure script. +dnl MY_TRY_RUN(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE +dnl [, ACTION-IF-CROSS-COMPILING]]]) +AC_DEFUN(MY_TRY_RUN, +[if test "$cross_compiling" = yes; then + ifelse([$4], , + [errprint(__file__:__line__: warning: [AC_TRY_RUN] called without default to allow cross compiling +)dnl + AC_MSG_ERROR(can not run test program while cross compiling)], + [$4]) +else + MY_TRY_RUN_NATIVE([$1], [$2], [$3]) +fi +]) + +dnl Like AC_TRY_RUN but assumes a native-environment (non-cross) compiler. +dnl MY_TRY_RUN_NATIVE(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE]]) +AC_DEFUN(MY_TRY_RUN_NATIVE, +[cat > conftest.$ac_ext <<EOF +[#]line __oline__ "configure" +#include "confdefs.h" +ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus +extern "C" void exit(int); +#endif +])dnl +[$1] +EOF +if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then +dnl Don't remove the temporary files here, so they can be examined. + ifelse([$2], , :, [$2]) +else +ifelse([$3], , , [ $3 + rm -fr conftest* +])dnl +fi +rm -fr conftest*]) + + +dnl A variant of AC_CHECK_SIZEOF which allows the checking of +dnl sizes of non-builtin types +dnl AC_CHECK_SIZEOF_EXTENDED(INCLUDES, TYPE [, CROSS_SIZE]) +AC_DEFUN(AC_CHECK_SIZEOF_EXTENDED, +[changequote(<<,>>)dnl +dnl The name to #define +define(<<AC_TYPE_NAME>>, translit(sizeof_$2, [a-z *], [A-Z_P]))dnl +dnl The cache variable +define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$2, [ *],[<p>]))dnl +changequote([, ])dnl +AC_MSG_CHECKING(size of $2) +AC_CACHE_VAL(AC_CV_NAME, +[AC_TRY_RUN([#include <stdio.h> +$1 +main() +{ + FILE *f=fopen("conftestval","w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof($2)); + exit(0); +}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$3],,, +AC_CV_NAME=$3))])dnl +AC_MSG_RESULT($AC_CV_NAME) +AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) +undefine([AC_TYPE_NAME])dnl +undefine([AC_CV_NAME])dnl +]) + +dnl +dnl APR_TRY_COMPILE_NO_WARNING(INCLUDES, FUNCTION-BODY, +dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl +dnl Tries a compile test with warnings activated so that the result +dnl is false if the code doesn't compile cleanly. +dnl +AC_DEFUN(APR_TRY_COMPILE_NO_WARNING, +[if test "x$CFLAGS_WARN" = "x"; then + apr_tcnw_flags="" +else + apr_tcnw_flags=$CFLAGS_WARN +fi +if test "$GCC" = "yes"; then + apr_tcnw_flags="$apr_tcnw_flags -Werror" +fi +changequote(', ') +cat > conftest.$ac_ext <<EOTEST +#include "confdefs.h" +'$1' +int main(int argc, const char * const argv[]) { +'$2' +; return 0; } +EOTEST +changequote([, ]) +if ${CC-cc} -c $CFLAGS $CPPFLAGS $apr_tcnw_flags conftest.$ac_ext 2>&AC_FD_CC ; then + ifelse([$3], , :, [rm -rf conftest* + $3]) +else + echo "configure: failed or warning program:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC + ifelse([$4], , , [rm -rf conftest* + $4]) +fi +rm -f conftest*]) + +dnl +dnl APR_CHECK_ICONV_INBUF +dnl +dnl Decide whether or not the inbuf parameter to iconv() is const. +dnl +dnl We try to compile something without const. If it fails to +dnl compile, we assume that the system's iconv() has const. +dnl Unfortunately, we won't realize when there was a compile +dnl warning, so we allow a variable -- apr_iconv_inbuf_const -- to +dnl be set in hints.m4 to specify whether or not iconv() has const +dnl on this parameter. +dnl +AC_DEFUN(APR_CHECK_ICONV_INBUF,[ +AC_MSG_CHECKING(for type of inbuf parameter to iconv) +if test "x$apr_iconv_inbuf_const" = "x"; then + APR_TRY_COMPILE_NO_WARNING([ + #include <stddef.h> + #include <iconv.h> + ],[ + iconv(0,(char **)0,(size_t *)0,(char **)0,(size_t *)0); + ], apr_iconv_inbuf_const="0", apr_iconv_inbuf_const="1") +fi +if test "$apr_iconv_inbuf_const" = "1"; then + AC_DEFINE(APR_ICONV_INBUF_CONST, 1, [Define if the inbuf parm to iconv() is const char **]) + msg="const char **" +else + msg="char **" +fi +AC_MSG_RESULT([$msg]) +]) + diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 new file mode 100644 index 00000000000..89800fb6167 --- /dev/null +++ b/build/apr_hints.m4 @@ -0,0 +1,377 @@ +dnl ----------------------------------------------------------------- +dnl apr_hints.m4: APR's autoconf macros for platform-specific hints +dnl +dnl We preload various configure settings depending +dnl on previously obtained platform knowledge. +dnl We allow all settings to be overridden from +dnl the command-line. +dnl +dnl We maintain the "format" that we've used +dnl under 1.3.x, so we don't exactly follow +dnl what is "recommended" by autoconf. + +dnl +dnl APR_PRELOAD +dnl +dnl Preload various ENV/makefile paramsm such as CC, CFLAGS, etc +dnl based on outside knowledge +dnl +dnl Generally, we force the setting of CC, and add flags +dnl to CFLAGS, LIBS and LDFLAGS. +dnl +AC_DEFUN(APR_PRELOAD, [ +if test "$DID_APR_PRELOAD" = "yes" ; then + + echo "APR hints file rules for $host already applied" + +else + + DID_APR_PRELOAD="yes"; export DID_APR_PRELOAD + + echo "Applying APR hints file rules for $host" + + case "$host" in + *mint) + APR_ADDTO(CFLAGS, [-DMINT]) + APR_ADDTO(LIBS, [-lportlib -lsocket]) + ;; + *MPE/iX*) + APR_ADDTO(CFLAGS, [-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE]) + APR_ADDTO(LIBS, [-lsocket -lsvipc -lcurses]) + APR_ADDTO(LDFLAGS, [-Xlinker \"-WL,cap=ia,ba,ph;nmstack=1024000\"]) + APR_SETVAR(CAT, [/bin/cat]) + ;; + *-apple-aux3*) + APR_SETVAR(CC, [gcc]) + APR_ADDTO(CFLAGS, [-DAUX3 -D_POSIX_SOURCE]) + APR_ADDTO(LIBS, [-lposix -lbsd]) + APR_ADDTO(LDFLAGS, [-s]) + APR_SETVAR(SHELL, [/bin/ksh]) + ;; + *-ibm-aix*) + case $host in + i386-ibm-aix*) + APR_ADDTO(CFLAGS, [-U__STR__ -DUSEBCOPY]) + ;; + *-ibm-aix[1-2].*) + APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + ;; + *-ibm-aix3.*) + APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + ;; + *-ibm-aix4.1) + APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + ;; + *-ibm-aix4.1.*) + APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + ;; + *-ibm-aix4.2) + APR_ADDTO(CFLAGS, [-U__STR__]) + ;; + *-ibm-aix4.2.*) + APR_ADDTO(CFLAGS, [-U__STR__]) + ;; + *-ibm-aix4.3) + APR_ADDTO(CFLAGS, [-D_USE_IRS -U__STR__]) + ;; + *-ibm-aix4.3.*) + APR_ADDTO(CFLAGS, [-D_USE_IRS -U__STR__]) + ;; + *-ibm-aix*) + APR_ADDTO(CFLAGS, [-U__STR__]) + ;; + esac + dnl Must do a check for gcc or egcs here, to get the right options + dnl to the compiler. + AC_PROG_CC + if test "$GCC" != "yes"; then + APR_ADDTO(CFLAGS, [-qHALT=E]) + APR_ADDTO(CFLAGS, [-qLANGLVL=extended]) + fi + APR_SETIFNULL(apr_iconv_inbuf_const, [1]) + ;; + *-apollo-*) + APR_ADDTO(CFLAGS, [-DAPOLLO]) + ;; + *-dg-dgux*) + APR_ADDTO(CFLAGS, [-DDGUX]) + ;; + *os2_emx*) + APR_SETVAR(SHELL, [sh]) + ;; + *-hi-hiux) + APR_ADDTO(CFLAGS, [-DHIUX]) + ;; + *-hp-hpux11.*) + APR_ADDTO(CFLAGS, [-DHPUX11]) + APR_ADDTO(LIBS, [-lpthread]) + ;; + *-hp-hpux10.*) + case $host in + *-hp-hpux10.01) +dnl # We know this is a problem in 10.01. +dnl # Not a problem in 10.20. Otherwise, who knows? + APR_ADDTO(CFLAGS, [-DSELECT_NEEDS_CAST]) + ;; + esac + ;; + *-hp-hpux*) + APR_ADDTO(CFLAGS, [-DHPUX]) + ;; + *-linux-*) + case `uname -r` in + 2.2* ) APR_ADDTO(CFLAGS, [-DLINUX=2]) + ;; + 2.0* ) APR_ADDTO(CFLAGS, [-DLINUX=2]) + ;; + 1.* ) APR_ADDTO(CFLAGS, [-DLINUX=1]) + ;; + * ) + ;; + esac + ;; + *-GNU*) + APR_ADDTO(CFLAGS, [-DHURD]) + APR_ADDTO(LIBS, [-lcrypt]) + ;; + *-lynx-lynxos) + APR_ADDTO(CFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) + APR_ADDTO(LIBS, [-lbsd -lcrypt]) + ;; + *486-*-bsdi*) + APR_ADDTO(CFLAGS, [-m486]) + ;; + *-netbsd*) + APR_ADDTO(CFLAGS, [-DNETBSD]) + APR_ADDTO(LIBS, [-lcrypt]) + ;; + *-freebsd*) + case $host in + *freebsd[2345]*) + APR_ADDTO(CFLAGS, [-funsigned-char]) + ;; + esac + APR_ADDTO(LIBS, [-lcrypt]) + APR_SETIFNULL(enable_threads, [no]) + ;; + *-next-nextstep*) + APR_SETIFNULL(OPTIM, [-O]) + APR_ADDTO(CFLAGS, [-DNEXT]) + ;; + *-next-openstep*) + APR_SETVAR(CC, [cc]) + APR_SETIFNULL(OPTIM, [-O]) + APR_ADDTO(CFLAGS, [-DNEXT]) + ;; +dnl *-apple-rhapsody*) +dnl APR_ADDTO(CFLAGS, [-DDARWIN -DMAC_OS_X_SERVER]) +dnl ;; + *-apple-darwin*) + APR_ADDTO(CFLAGS, [-DDARWIN]) + ;; + *-dec-osf*) + APR_ADDTO(CFLAGS, [-DOSF1]) + ;; + *-qnx) + APR_ADDTO(CFLAGS, [-DQNX]) + APR_ADDTO(LIBS, [-N128k -lsocket -lunix]) + ;; + *-qnx32) + APR_SETVAR(CC, [cc -F]) + APR_ADDTO(CFLAGS, [-DQNX -mf -3]) + APR_ADDTO(LIBS, [-N128k -lsocket -lunix]) + ;; + *-isc4*) + APR_SETVAR(CC, [gcc]) + APR_ADDTO(CFLAGS, [-posix -DISC]) + APR_ADDTO(LDFLAGS, [-posix]) + APR_ADDTO(LIBS, [-linet]) + ;; + *-sco3*) + APR_ADDTO(CFLAGS, [-DSCO -Oacgiltz]) + APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) + ;; + *-sco5*) + APR_ADDTO(CFLAGS, [-DSCO5]) + APR_ADDTO(LIBS, [-lsocket -lmalloc -lprot -ltinfo -lx]) + ;; + *-sco_sv*|*-SCO_SV*) + APR_ADDTO(CFLAGS, [-DSCO]) + APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) + ;; + *-solaris2*) + PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` + APR_ADDTO(CFLAGS, [-DSOLARIS2=$PLATOSVERS]) + APR_ADDTO(LIBS, [-lsocket -lnsl]) + APR_SETIFNULL(apr_iconv_inbuf_const, [1]) + ;; + *-sunos4*) + APR_ADDTO(CFLAGS, [-DSUNOS4 -DUSEBCOPY]) + ;; + *-unixware1) + APR_ADDTO(CFLAGS, [-DUW=100]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt]) + ;; + *-unixware2) + APR_ADDTO(CFLAGS, [-DUW=200]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) + ;; + *-unixware211) + APR_ADDTO(CFLAGS, [-DUW=211]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) + ;; + *-unixware212) + APR_ADDTO(CFLAGS, [-DUW=212]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) + ;; + *-unixware7) + APR_ADDTO(CFLAGS, [-DUW=700]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) + ;; + maxion-*-sysv4*) + APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc -lgen]) + ;; + *-*-powermax*) + APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lgen]) + ;; + TPF) + APR_SETVAR(CC, [c89]) + APR_ADDTO(CFLAGS, [-DTPF -D_POSIX_SOURCE]) + ;; + BS2000*-siemens-sysv4*) + APR_SETVAR(CC, [c89 -XLLML -XLLMK -XL -Kno_integer_overflow]) + APR_ADDTO(CFLAGS, [-DSVR4 -D_XPG_IV]) + ;; + *-siemens-sysv4*) + APR_ADDTO(CFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT -DNEED_UNION_SEMUN]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) + ;; + pyramid-pyramid-svr4) + APR_ADDTO(CFLAGS, [-DSVR4 -DNO_LONG_DOUBLE]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) + ;; + DS/90\ 7000-*-sysv4*) + APR_ADDTO(CFLAGS, [-DUXPDS]) + APR_ADDTO(LIBS, [-lsocket -lnsl]) + ;; + *-tandem-sysv4*) + APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(LIBS, [-lsocket -lnsl]) + ;; + *-ncr-sysv4) + APR_ADDTO(CFLAGS, [-DSVR4 -DMPRAS]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) + ;; + *-sysv4*) + APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) + ;; + 88k-encore-sysv4) + APR_ADDTO(CFLAGS, [-DSVR4 -DENCORE]) + APR_ADDTO(LIBS, [-lPW]) + ;; + *-uts*) + PLATOSVERS=`echo $host | sed 's/^.*,//'` + case $PLATOSVERS in + 2*) APR_ADDTO(CFLAGS, [-Xa -eft -DUTS21 -DUSEBCOPY]) + APR_ADDTO(LIBS, [-lsocket -lbsd -la]) + ;; + *) APR_ADDTO(CFLAGS, [-Xa -DSVR4]) + APR_ADDTO(LIBS, [-lsocket -lnsl]) + ;; + esac + ;; + *-ultrix) + APR_ADDTO(CFLAGS, [-DULTRIX]) + APR_SETVAR(SHELL, [/bin/sh5]) + ;; + *powerpc-tenon-machten*) + APR_ADDTO(LDFLAGS, [-Xlstack=0x14000 -Xldelcsect]) + ;; + *-machten*) + APR_ADDTO(LDFLAGS, [-stack 0x14000]) + ;; + *convex-v11*) + APR_ADDTO(CFLAGS, [-ext -DCONVEXOS11]) + APR_SETIFNULL(OPTIM, [-O1]) + APR_SETVAR(CC, [cc]) + ;; + i860-intel-osf1) + APR_ADDTO(CFLAGS, [-DPARAGON]) + ;; + *-sequent-ptx2.*.*) + APR_ADDTO(CFLAGS, [-DSEQUENT=20 -Wc,-pw]) + APR_ADDTO(LIBS, [-lsocket -linet -lnsl -lc -lseq]) + ;; + *-sequent-ptx4.0.*) + APR_ADDTO(CFLAGS, [-DSEQUENT=40 -Wc,-pw]) + APR_ADDTO(LIBS, [-lsocket -linet -lnsl -lc]) + ;; + *-sequent-ptx4.[123].*) + APR_ADDTO(CFLAGS, [-DSEQUENT=41 -Wc,-pw]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) + ;; + *-sequent-ptx4.4.*) + APR_ADDTO(CFLAGS, [-DSEQUENT=44 -Wc,-pw]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) + ;; + *-sequent-ptx4.5.*) + APR_ADDTO(CFLAGS, [-DSEQUENT=45 -Wc,-pw]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) + ;; + *-sequent-ptx5.0.*) + APR_ADDTO(CFLAGS, [-DSEQUENT=50 -Wc,-pw]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) + ;; + *NEWS-OS*) + APR_ADDTO(CFLAGS, [-DNEWSOS]) + ;; + *-riscix) + APR_ADDTO(CFLAGS, [-DRISCIX]) + APR_SETIFNULL(OPTIM, [-O]) + APR_SETIFNULL(MAKE, [make]) + ;; + *beos*) + APR_ADDTO(CFLAGS, [-DBEOS]) + PLATOSVERS=`uname -r` + case $PLATOSVERS in + 5.1) + APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) + APR_ADDTO(LDFLAGS, [-nodefaultlibs -L/boot/develop/lib/x86 -L/boot/beos/system/lib]) + APR_ADDTO(EXTRA_LIBS, [-lbind -lsocket -lbe -lroot]) + ;; + esac + ;; + 4850-*.*) + APR_ADDTO(CFLAGS, [-DSVR4 -DMPRAS]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) + ;; + drs6000*) + APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) + ;; + m88k-*-CX/SX|CYBER) + APR_ADDTO(CFLAGS, [-D_CX_SX -Xa]) + APR_SETVAR(CC, [cc]) + ;; + *-tandem-oss) + APR_ADDTO(CFLAGS, [-D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED=1]) + APR_SETVAR(CC, [c89]) + ;; + *-ibm-os390) + APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE]) + APR_SETIFNULL(apr_process_lock_is_global, [yes]) + APR_SETIFNULL(CC, [cc]) + APR_ADDTO(CFLAGS, [-U_NO_PROTO]) + APR_ADDTO(CFLAGS, [-DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR]) + APR_ADDTO(CFLAGS, [-DPTHREAD_SETS_ERRNO]) + APR_ADDTO(CFLAGS, [-DPTHREAD_DETACH_ARG1_ADDR]) + APR_ADDTO(CFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK]) + APR_ADDTO(CFLAGS, [-DTCP_NODELAY=1]) + ;; + esac + APR_DOEXTRA +fi +]) diff --git a/build/apr_network.m4 b/build/apr_network.m4 new file mode 100644 index 00000000000..a1a3b6d2266 --- /dev/null +++ b/build/apr_network.m4 @@ -0,0 +1,337 @@ +dnl ----------------------------------------------------------------- +dnl apr_network.m4: APR's autoconf macros for testing network support +dnl + +dnl +dnl check for working getaddrinfo() +dnl +AC_DEFUN(APR_CHECK_WORKING_GETADDRINFO,[ + AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[ + AC_TRY_RUN( [ +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif + +void main(void) { + struct addrinfo hints, *ai; + int error; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo("127.0.0.1", "8080", &hints, &ai); + if (error) { + exit(1); + } + else { + exit(0); + } +} +],[ + ac_cv_working_getaddrinfo="yes" +],[ + ac_cv_working_getaddrinfo="no" +],[ + ac_cv_working_getaddrinfo="yes" +])]) +if test "$ac_cv_working_getaddrinfo" = "yes"; then + AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works well enough for APR]) +fi +]) + +dnl +dnl check for gethostbyname() which handles numeric address strings +dnl +AC_DEFUN(APR_CHECK_GETHOSTBYNAME_NAS,[ + AC_CACHE_CHECK(for gethostbyname() which handles numeric address strings, ac_cv_gethostbyname_nas,[ + AC_TRY_RUN( [ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +void main(void) { + struct hostent *he = gethostbyname("127.0.0.1"); + if (he == NULL) { + exit(1); + } + else { + exit(0); + } +} +],[ + ac_cv_gethostbyname_nas="yes" +],[ + ac_cv_gethostbyname_nas="no" +],[ + ac_cv_gethostbyname_nas="yes" +])]) +if test "$ac_cv_gethostbyname_nas" = "yes"; then + AC_DEFINE(GETHOSTBYNAME_HANDLES_NAS, 1, [Define if gethostbyname() handles nnn.nnn.nnn.nnn]) +fi +]) + +dnl +dnl check for socklen_t, fall back to unsigned int +dnl +AC_DEFUN(APR_CHECK_SOCKLEN_T,[ +AC_CACHE_CHECK(for socklen_t, ac_cv_socklen_t,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +],[ +socklen_t foo = (socklen_t) 0; +],[ + ac_cv_socklen_t=yes +],[ + ac_cv_socklen_t=no +]) +]) + +if test "$ac_cv_socklen_t" = "yes"; then + AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t]) +fi +]) + + + +AC_DEFUN(APR_CHECK_INET_ADDR,[ +AC_CACHE_CHECK(for inet_addr, ac_cv_func_inet_addr,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif +],[ +inet_addr("127.0.0.1"); +],[ + ac_cv_func_inet_addr=yes +],[ + ac_cv_func_inet_addr=no +]) +]) + +if test "$ac_cv_func_inet_addr" = "yes"; then + have_inet_addr=1 +else + have_inet_addr=0 +fi +]) + + +AC_DEFUN(APR_CHECK_INET_NETWORK,[ +AC_CACHE_CHECK(for inet_network, ac_cv_func_inet_network,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif +],[ +inet_network("127.0.0.1"); +],[ + ac_cv_func_inet_network=yes +],[ + ac_cv_func_inet_network=no +]) +]) + +if test "$ac_cv_func_inet_network" = "yes"; then + have_inet_network=1 +else + have_inet_network=0 +fi +]) + + +AC_DEFUN(APR_CHECK_SOCKADDR_IN6,[ +AC_CACHE_CHECK(for sockaddr_in6, ac_cv_define_sockaddr_in6,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +],[ +struct sockaddr_in6 sa; +],[ + ac_cv_define_sockaddr_in6=yes +],[ + ac_cv_define_sockaddr_in6=no +]) +]) + +if test "$ac_cv_define_sockaddr_in6" = "yes"; then + have_sockaddr_in6=1 +else + have_sockaddr_in6=0 +fi +]) + +dnl +dnl Check to see if this platform includes sa_len in it's +dnl struct sockaddr. If it does it changes the length of sa_family +dnl which could cause us problems +dnl +AC_DEFUN(APR_CHECK_SOCKADDR_SA_LEN,[ +AC_CACHE_CHECK(for sockaddr sa_len, ac_cv_define_sockaddr_sa_len,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +],[ +struct sockaddr_in sai; +int i = sai.sin_len; +],[ + ac_cv_define_sockaddr_sa_len=yes +],[ + ac_cv_define_sockaddr_sa_len=no +]) +]) + +if test "$ac_cv_define_sockaddr_sa_len" = "yes"; then + AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1 ,[Define if we have length field in sockaddr_in]) +fi +]) + + +dnl +dnl APR_INADDR_NONE +dnl +dnl checks for missing INADDR_NONE macro +dnl +AC_DEFUN(APR_INADDR_NONE,[ + AC_CACHE_CHECK(whether system defines INADDR_NONE, ac_cv_inaddr_none,[ + AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_ARPA_INET_H +#include <arpa/inet.h> +#endif +],[ +unsigned long foo = INADDR_NONE; +],[ + ac_cv_inaddr_none=yes +],[ + ac_cv_inaddr_none=no +])]) + if test "$ac_cv_inaddr_none" = "no"; then + apr_inaddr_none="((unsigned int) 0xffffffff)" + else + apr_inaddr_none="INADDR_NONE" + fi +]) + + +dnl +dnl APR_CHECK_H_ERRNO_FLAG +dnl +dnl checks which flags are necessary for <netdb.h> to define h_errno +dnl +AC_DEFUN(APR_H_ERRNO_COMPILE_CHECK,[ + if test x$1 != x; then + CFLAGS="-D$1 $CFLAGS" + fi + AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif +],[ +int h_e = h_errno; +],[ + if test x$1 != x; then + ac_cv_h_errno_cflags="$1" + else + ac_cv_h_errno_cflags=yes + fi +],[ + ac_cv_h_errno_cflags=no +])]) +AC_DEFUN(APR_CHECK_H_ERRNO_FLAG,[ + AC_MSG_CHECKING([for h_errno in netdb.h]) + AC_CACHE_VAL(ac_cv_h_errno_cflags,[ + APR_H_ERRNO_COMPILE_CHECK + if test "$ac_cv_h_errno_cflags" = "no"; then + ac_save="$CFLAGS" + for flag in _XOPEN_SOURCE_EXTENDED; do + APR_H_ERRNO_COMPILE_CHECK($flag) + if test "$ac_cv_h_errno_cflags" != "no"; then + break + fi + done + CFLAGS="$ac_save" + fi + ]) + if test "$ac_cv_h_errno_cflags" != "no"; then + if test "$ac_cv_h_errno_cflags" != "yes"; then + CFLAGS="-D$ac_cv_h_errno_cflags $CFLAGS" + AC_MSG_RESULT([yes, with -D$ac_cv_h_errno_cflags]) + else + AC_MSG_RESULT([$ac_cv_h_errno_cflags]) + fi + else + AC_MSG_RESULT([$ac_cv_h_errno_cflags]) + fi +]) + + +AC_DEFUN(APR_EBCDIC,[ + AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ + AC_TRY_RUN( [ +int main(void) { + return (unsigned char)'A' != (unsigned char)0xC1; +} +],[ + ac_cv_ebcdic="yes" +],[ + ac_cv_ebcdic="no" +],[ + ac_cv_ebcdic="no" +])]) + if test "$ac_cv_ebcdic" = "yes"; then + apr_charset_ebcdic=1 + else + apr_charset_ebcdic=0 + fi + AC_SUBST(apr_charset_ebcdic) +]) diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 new file mode 100644 index 00000000000..c1c6074bf9f --- /dev/null +++ b/build/apr_threads.m4 @@ -0,0 +1,178 @@ +dnl ----------------------------------------------------------------- +dnl apr_threads.m4: APR's autoconf macros for testing thread support +dnl + +dnl +dnl REENTRANCY_FLAGS +dnl +dnl Set some magic defines +dnl +AC_DEFUN(REENTRANCY_FLAGS,[ + if test -z "$host_alias"; then + host_alias=`$ac_config_guess` + fi + case "$host_alias" in + *solaris*) + PTHREAD_FLAGS="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";; + *freebsd*) + PTHREAD_FLAGS="-D_REENTRANT -D_THREAD_SAFE";; + *openbsd*) + PTHREAD_FLAGS="-D_POSIX_THREADS";; + *linux*) + PTHREAD_FLAGS="-D_REENTRANT";; + *aix*) + PTHREAD_FLAGS="-D_THREAD_SAFE";; + *irix*) + PTHREAD_FLAGS="-D_POSIX_THREAD_SAFE_FUNCTIONS";; + *hpux*) + PTHREAD_FLAGS="-D_REENTRANT";; + *sco*) + PTHREAD_FLAGS="-D_REENTRANT";; +dnl Solves sigwait() problem, creates problems with u_long etc. +dnl PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE_EXTENDED=1";; + esac + + if test -n "$PTHREAD_FLAGS"; then + CPPFLAGS="$CPPFLAGS $PTHREAD_FLAGS" + THREAD_CPPFLAGS="$THREAD_CPPFLAGS $PTHREAD_FLAGS" + fi +])dnl + +dnl gcc issues warnings when parsing AIX 4.3.3's pthread.h +dnl which causes autoconf to incorrectly conclude that +dnl pthreads is not available. +dnl Turn off warnings if we're using gcc. +AC_DEFUN(CHECK_PTHREADS_H, [ + if test "$GCC" = "yes"; then + SAVE_FL="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -w" + AC_CHECK_HEADERS(pthread.h, [ $1 ] , [ $2 ] ) + CPPFLAGS="$SAVE_FL" + else + AC_CHECK_HEADERS(pthread.h, [ $1 ] , [ $2 ] ) + fi +])dnl + +AC_DEFUN(APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS, [ +AC_CACHE_CHECK(whether pthread_getspecific takes two arguments, ac_cv_pthread_getspecific_two_args,[ +AC_TRY_COMPILE([ +#include <pthread.h> +],[ +pthread_key_t key; +void *tmp; +pthread_getspecific(key,&tmp); +],[ + ac_cv_pthread_getspecific_two_args=yes +],[ + ac_cv_pthread_getspecific_two_args=no +]) +]) + +if test "$ac_cv_pthread_getspecific_two_args" = "yes"; then + AC_DEFINE(PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS, 1, [Define if pthread_getspecific() has two args]) +fi + +])dnl + +AC_DEFUN(APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG, [ +AC_CACHE_CHECK(whether pthread_attr_getdetachstate takes one argument, ac_cv_pthread_attr_getdetachstate_one_arg,[ +AC_TRY_COMPILE([ +#include <pthread.h> +],[ +pthread_attr_t *attr; +pthread_attr_getdetachstate(attr); +],[ + ac_cv_pthread_attr_getdetachstate_one_arg=yes +],[ + ac_cv_pthread_attr_getdetachstate_one_arg=no +]) +]) + +if test "$ac_cv_pthread_attr_getdetachstate_one_arg" = "yes"; then + AC_DEFINE(PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG, 1, [Define if pthread_attr_getdetachstate() has one arg]) +fi + +])dnl +dnl +dnl PTHREADS_CHECK_COMPILE +dnl +dnl Check whether the current setup can use POSIX threads calls +dnl +AC_DEFUN(PTHREADS_CHECK_COMPILE, [ +AC_TRY_RUN( [ +#include <pthread.h> +#include <stddef.h> + +void *thread_routine(void *data) { + return data; +} + +int main() { + pthread_t thd; + pthread_mutexattr_t mattr; + int data = 1; + pthread_mutexattr_init(&mattr); + return pthread_create(&thd, NULL, thread_routine, &data); +} ], [ + pthreads_working="yes" + ], [ + pthreads_working="no" + ], pthreads_working="no" ) ] )dnl +dnl +dnl PTHREADS_CHECK() +dnl +dnl Try to find a way to enable POSIX threads +dnl +AC_DEFUN(PTHREADS_CHECK,[ +if test -n "$ac_cv_pthreads_lib"; then + LIBS="$LIBS -l$ac_cv_pthreads_lib" +fi + +if test -n "$ac_cv_pthreads_cflags"; then + CFLAGS="$CFLAGS $ac_cv_pthreads_cflags" + THREAD_CFLAGS="$THREAD_CFLAGS $ac_cv_pthreads_cflags" +fi + +PTHREADS_CHECK_COMPILE + +AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[ +ac_cv_pthreads_cflags="" +if test "$pthreads_working" != "yes"; then + for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt; do + ac_save="$CFLAGS" + CFLAGS="$CFLAGS $flag" + PTHREADS_CHECK_COMPILE + if test "$pthreads_working" = "yes"; then + ac_cv_pthreads_cflags="$flag" + dnl this was already added to CFLAGS; add to THREAD_CFLAGS, too + THREAD_CFLAGS="$THREAD_CFLAGS $ac_cv_pthreads_cflags" + break + fi + CFLAGS="$ac_save" + done +fi +]) + +AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[ +ac_cv_pthreads_lib="" +if test "$pthreads_working" != "yes"; then + for lib in pthread pthreads c_r; do + ac_save="$LIBS" + LIBS="$LIBS -l$lib" + PTHREADS_CHECK_COMPILE + if test "$pthreads_working" = "yes"; then + ac_cv_pthreads_lib="$lib" + break + fi + LIBS="$ac_save" + done +fi +]) + +if test "$pthreads_working" = "yes"; then + threads_result="POSIX Threads found" +else + threads_result="POSIX Threads not found" +fi +])dnl + diff --git a/buildconf b/buildconf index a3bda267d7b..5442a7f520b 100755 --- a/buildconf +++ b/buildconf @@ -7,9 +7,17 @@ libtoolize=`helpers/PrintPath glibtoolize libtoolize` ltpath=`dirname $libtoolize` ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 echo "Incorporating $ltfile into aclocal.m4 ..." -echo "dnl THIS FILE IS AUTOMATICALLY GENERATED BY buildconf" > aclocal.m4 -echo "dnl edits here will be lost" >> aclocal.m4 -cat helpers/apr-conf.m4 apr_common.m4 hints.m4 $ltfile >> aclocal.m4 +cat > aclocal.m4 <<EOF +dnl THIS FILE IS AUTOMATICALLY GENERATED BY buildconf +dnl Edits here will be lost + +sinclude(build/apr_common.m4) +sinclude(build/apr_network.m4) +sinclude(build/apr_threads.m4) +sinclude(build/apr_hints.m4) + +EOF +cat $ltfile >> aclocal.m4 # # Create the libtool helper files diff --git a/configure.in b/configure.in index a66240a1f24..84bf41b0e3a 100644 --- a/configure.in +++ b/configure.in @@ -3,7 +3,7 @@ dnl ## Autoconf configuration file for APR dnl ## dnl Process this file with autoconf to produce a configure script. -AC_INIT(apr_common.m4) +AC_INIT(build/apr_common.m4) AC_CONFIG_HEADER(include/arch/unix/apr_private.h) AC_CONFIG_AUX_DIR(helpers) From e728d69483b3230e0876a4c1ff707da2a0d5dc6b Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sat, 17 Feb 2001 12:31:49 +0000 Subject: [PATCH 1257/7878] Moved hints.m4, apr_common.m4, and helpers/apr-conf.m4 into the new apr/build directory as apr_hints.m4, apr_common.m4, apr_network.m4, and apr_threads.m4. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61242 13f79535-47bb-0310-9956-ffa450edef68 --- apr_common.m4 | 352 ----------------------------- helpers/apr-conf.m4 | 539 -------------------------------------------- hints.m4 | 365 ------------------------------ 3 files changed, 1256 deletions(-) delete mode 100644 apr_common.m4 delete mode 100644 helpers/apr-conf.m4 delete mode 100644 hints.m4 diff --git a/apr_common.m4 b/apr_common.m4 deleted file mode 100644 index 96f9bb8cfab..00000000000 --- a/apr_common.m4 +++ /dev/null @@ -1,352 +0,0 @@ -dnl APR_TRY_COMPILE_NO_WARNING(INCLUDES, FUNCTION-BODY, -dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -dnl -dnl Tries a compile test with warnings activated so that the result -dnl is false if the code doesn't compile cleanly. -dnl -AC_DEFUN(APR_TRY_COMPILE_NO_WARNING, -[if test "x$CFLAGS_WARN" = "x"; then - apr_tcnw_flags="" -else - apr_tcnw_flags=$CFLAGS_WARN -fi -if test "$GCC" = "yes"; then - apr_tcnw_flags="$apr_tcnw_flags -Werror" -fi -changequote(', ') -cat > conftest.$ac_ext <<EOTEST -#include "confdefs.h" -'$1' -int main(int argc, const char * const argv[]) { -'$2' -; return 0; } -EOTEST -changequote([, ]) -if ${CC-cc} -c $CFLAGS $CPPFLAGS $apr_tcnw_flags conftest.$ac_ext 2>&AC_FD_CC ; then - ifelse([$3], , :, [rm -rf conftest* - $3]) -else - echo "configure: failed or warning program:" >&AC_FD_CC - cat conftest.$ac_ext >&AC_FD_CC - ifelse([$4], , , [rm -rf conftest* - $4]) -fi -rm -f conftest*]) - -dnl -dnl RUN_SUBDIR_CONFIG_NOW(dir [, sub-package-cmdline-args]) -dnl -AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [ - # save our work to this point; this allows the sub-package to use it - AC_CACHE_SAVE - - echo "configuring package in $1 now" - ac_popdir=`pwd` - ac_abs_srcdir=`(cd $srcdir/$1 && pwd)` - apr_config_subdirs="$1" - test -d $1 || $MKDIR $1 - cd $1 - -changequote(, )dnl - # A "../" for each directory in /$config_subdirs. - ac_dots=`echo $apr_config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` -changequote([, ])dnl - - # Make the cache file name correct relative to the subdirectory. - case "$cache_file" in - /*) ac_sub_cache_file=$cache_file ;; - *) # Relative path. - ac_sub_cache_file="$ac_dots$cache_file" ;; - esac - - # The eval makes quoting arguments work. - if eval $ac_abs_srcdir/configure $ac_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $2 - then : - echo "$1 configured properly" - else - echo "configure failed for $1" - exit 1 - fi - - cd $ac_popdir - - # grab any updates from the sub-package - AC_CACHE_LOAD -]) -dnl -dnl REENTRANCY_FLAGS -dnl -dnl Set some magic defines -dnl -AC_DEFUN(REENTRANCY_FLAGS,[ - if test -z "$host_alias"; then - host_alias=`$ac_config_guess` - fi - case "$host_alias" in - *solaris*) - PTHREAD_FLAGS="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";; - *freebsd*) - PTHREAD_FLAGS="-D_REENTRANT -D_THREAD_SAFE";; - *openbsd*) - PTHREAD_FLAGS="-D_POSIX_THREADS";; - *linux*) - PTHREAD_FLAGS="-D_REENTRANT";; - *aix*) - PTHREAD_FLAGS="-D_THREAD_SAFE";; - *irix*) - PTHREAD_FLAGS="-D_POSIX_THREAD_SAFE_FUNCTIONS";; - *hpux*) - PTHREAD_FLAGS="-D_REENTRANT";; - *sco*) - PTHREAD_FLAGS="-D_REENTRANT";; -dnl Solves sigwait() problem, creates problems with u_long etc. -dnl PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE_EXTENDED=1";; - esac - - if test -n "$PTHREAD_FLAGS"; then - CPPFLAGS="$CPPFLAGS $PTHREAD_FLAGS" - THREAD_CPPFLAGS="$THREAD_CPPFLAGS $PTHREAD_FLAGS" - fi -])dnl - -dnl gcc issues warnings when parsing AIX 4.3.3's pthread.h -dnl which causes autoconf to incorrectly conclude that -dnl pthreads is not available. -dnl Turn off warnings if we're using gcc. -AC_DEFUN(CHECK_PTHREADS_H, [ - if test "$GCC" = "yes"; then - SAVE_FL="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -w" - AC_CHECK_HEADERS(pthread.h, [ $1 ] , [ $2 ] ) - CPPFLAGS="$SAVE_FL" - else - AC_CHECK_HEADERS(pthread.h, [ $1 ] , [ $2 ] ) - fi -])dnl - -AC_DEFUN(APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS, [ -AC_CACHE_CHECK(whether pthread_getspecific takes two arguments, ac_cv_pthread_getspecific_two_args,[ -AC_TRY_COMPILE([ -#include <pthread.h> -],[ -pthread_key_t key; -void *tmp; -pthread_getspecific(key,&tmp); -],[ - ac_cv_pthread_getspecific_two_args=yes -],[ - ac_cv_pthread_getspecific_two_args=no -]) -]) - -if test "$ac_cv_pthread_getspecific_two_args" = "yes"; then - AC_DEFINE(PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS, 1, [Define if pthread_getspecific() has two args]) -fi - -])dnl - -AC_DEFUN(APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG, [ -AC_CACHE_CHECK(whether pthread_attr_getdetachstate takes one argument, ac_cv_pthread_attr_getdetachstate_one_arg,[ -AC_TRY_COMPILE([ -#include <pthread.h> -],[ -pthread_attr_t *attr; -pthread_attr_getdetachstate(attr); -],[ - ac_cv_pthread_attr_getdetachstate_one_arg=yes -],[ - ac_cv_pthread_attr_getdetachstate_one_arg=no -]) -]) - -if test "$ac_cv_pthread_attr_getdetachstate_one_arg" = "yes"; then - AC_DEFINE(PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG, 1, [Define if pthread_attr_getdetachstate() has one arg]) -fi - -])dnl -dnl -dnl PTHREADS_CHECK_COMPILE -dnl -dnl Check whether the current setup can use POSIX threads calls -dnl -AC_DEFUN(PTHREADS_CHECK_COMPILE, [ -AC_TRY_RUN( [ -#include <pthread.h> -#include <stddef.h> - -void *thread_routine(void *data) { - return data; -} - -int main() { - pthread_t thd; - pthread_mutexattr_t mattr; - int data = 1; - pthread_mutexattr_init(&mattr); - return pthread_create(&thd, NULL, thread_routine, &data); -} ], [ - pthreads_working="yes" - ], [ - pthreads_working="no" - ], pthreads_working="no" ) ] )dnl -dnl -dnl PTHREADS_CHECK() -dnl -dnl Try to find a way to enable POSIX threads -dnl -AC_DEFUN(PTHREADS_CHECK,[ -if test -n "$ac_cv_pthreads_lib"; then - LIBS="$LIBS -l$ac_cv_pthreads_lib" -fi - -if test -n "$ac_cv_pthreads_cflags"; then - CFLAGS="$CFLAGS $ac_cv_pthreads_cflags" - THREAD_CFLAGS="$THREAD_CFLAGS $ac_cv_pthreads_cflags" -fi - -PTHREADS_CHECK_COMPILE - -AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[ -ac_cv_pthreads_cflags="" -if test "$pthreads_working" != "yes"; then - for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt; do - ac_save="$CFLAGS" - CFLAGS="$CFLAGS $flag" - PTHREADS_CHECK_COMPILE - if test "$pthreads_working" = "yes"; then - ac_cv_pthreads_cflags="$flag" - dnl this was already added to CFLAGS; add to THREAD_CFLAGS, too - THREAD_CFLAGS="$THREAD_CFLAGS $ac_cv_pthreads_cflags" - break - fi - CFLAGS="$ac_save" - done -fi -]) - -AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[ -ac_cv_pthreads_lib="" -if test "$pthreads_working" != "yes"; then - for lib in pthread pthreads c_r; do - ac_save="$LIBS" - LIBS="$LIBS -l$lib" - PTHREADS_CHECK_COMPILE - if test "$pthreads_working" = "yes"; then - ac_cv_pthreads_lib="$lib" - break - fi - LIBS="$ac_save" - done -fi -]) - -if test "$pthreads_working" = "yes"; then - threads_result="POSIX Threads found" -else - threads_result="POSIX Threads not found" -fi -])dnl - -dnl -dnl Apache and APR "hints" file -dnl We preload various configure settings depending -dnl on previously obtained platform knowledge. -dnl We allow all settings to be overridden from -dnl the command-line. -dnl -dnl We maintain the "format" that we've used -dnl under 1.3.x, so we don't exactly follow -dnl what is "recommended" by autoconf. - -dnl -dnl APR_DOEXTRA -dnl -dnl Handle the use of EXTRA_* variables. -dnl Basically, EXTRA_* vars are added to the -dnl current settings of their "parents". We -dnl can expand as needed for additional -dnl EXTRA_* variables by adding them to the -dnl "for i in..." line. -dnl -dnl To handle recursive configures, the 1st time -dnl through we need to null out EXTRA_* and then -dnl export the lot of them, since we want/need -dnl them to exist in the sub-configures' environment. -dnl The nasty eval's allow us to use the 'for' -dnl construct and save some lines of code. -dnl -AC_DEFUN(APR_DOEXTRA, [ - for i in CFLAGS LDFLAGS LIBS - do - eval APR_TMP=\$EXTRA_$i - if test -n "$APR_TMP"; then - eval $i=\"\$$i $APR_TMP\" - eval export $i - eval unset EXTRA_${i} - eval export EXTRA_${i} - fi - done -]) - -dnl -dnl APR_SETIFNULL(variable, value) -dnl -dnl Set variable iff it's currently null -dnl -AC_DEFUN(APR_SETIFNULL,[ - if test -z "$$1"; then - echo " Setting $1 to \"$2\"" - $1="$2"; export $1 - fi -]) - -dnl -dnl APR_SETVAR(variable, value) -dnl -dnl Set variable no matter what -dnl -AC_DEFUN(APR_SETVAR,[ - echo " Forcing $1 to \"$2\"" - $1="$2"; export $1 -]) - -dnl -dnl APR_ADDTO(variable, value) -dnl -dnl Add value to variable -dnl -AC_DEFUN(APR_ADDTO,[ - echo " Adding \"$2\" to $1" - $1="$$1 $2"; export $1 -]) - -dnl -dnl APR_CHECK_ICONV_INBUF -dnl -dnl Decide whether or not the inbuf parameter to iconv() is const. -dnl -dnl We try to compile something without const. If it fails to -dnl compile, we assume that the system's iconv() has const. -dnl Unfortunately, we won't realize when there was a compile -dnl warning, so we allow a variable -- apr_iconv_inbuf_const -- to -dnl be set in hints.m4 to specify whether or not iconv() has const -dnl on this parameter. -dnl -AC_DEFUN(APR_CHECK_ICONV_INBUF,[ -AC_MSG_CHECKING(for type of inbuf parameter to iconv) -if test "x$apr_iconv_inbuf_const" = "x"; then - APR_TRY_COMPILE_NO_WARNING([ - #include <stddef.h> - #include <iconv.h> - ],[ - iconv(0,(char **)0,(size_t *)0,(char **)0,(size_t *)0); - ], apr_iconv_inbuf_const="0", apr_iconv_inbuf_const="1") -fi -if test "$apr_iconv_inbuf_const" = "1"; then - AC_DEFINE(APR_ICONV_INBUF_CONST, 1, [Define if the inbuf parm to iconv() is const char **]) - msg="const char **" -else - msg="char **" -fi -AC_MSG_RESULT([$msg]) -]) diff --git a/helpers/apr-conf.m4 b/helpers/apr-conf.m4 deleted file mode 100644 index 36ce38fc044..00000000000 --- a/helpers/apr-conf.m4 +++ /dev/null @@ -1,539 +0,0 @@ -dnl -dnl apr-conf.m4: APR's autoconf support macros -dnl - -define(AC_USE_FUNCTION,[dnl -AC_CHECK_FUNCS($1) -if test ".$ac_func_$1" = .yes; then -AC_DEFINE(USE_$2) -fi -]) - - -AC_DEFUN(AC_CHECK_DEFINE_FILES,[ - AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ - ac_cv_define_$1=no - for curhdr in $2 - do - AC_EGREP_CPP(YES_IS_DEFINED, [ - #include <$curhdr> - #ifdef $1 - YES_IS_DEFINED - #endif - ], ac_cv_define_$1=yes) - done - ]) - if test "$ac_cv_define_$1" = "yes"; then - AC_DEFINE(HAVE_$1) - fi -]) - - -AC_DEFUN(AC_CHECK_DEFINE,[ - AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ - AC_EGREP_CPP(YES_IS_DEFINED, [ - #include <$2> - #ifdef $1 - YES_IS_DEFINED - #endif - ], ac_cv_define_$1=yes, ac_cv_define_$1=no) - ]) - if test "$ac_cv_define_$1" = "yes"; then - AC_DEFINE(HAVE_$1) - fi -]) - - -define(AC_IFALLYES,[dnl -ac_rc=yes -for ac_spec in $1; do - ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'` - ac_item=`echo "$ac_spec" | sed -e 's/^.*://'` - case $ac_type in - header ) - ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'` - ac_var="ac_cv_header_$ac_item" - ;; - file ) - ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'` - ac_var="ac_cv_file_$ac_item" - ;; - func ) ac_var="ac_cv_func_$ac_item" ;; - define ) ac_var="ac_cv_define_$ac_item" ;; - custom ) ac_var="$ac_item" ;; - esac - eval "ac_val=\$$ac_var" - if test ".$ac_val" != .yes; then - ac_rc=no - break - fi -done -if test ".$ac_rc" = .yes; then - : - $2 -else - : - $3 -fi -]) - - -define(AC_BEGIN_DECISION,[dnl -ac_decision_item='$1' -ac_decision_msg='FAILED' -ac_decision='' -]) - - -define(AC_DECIDE,[dnl -ac_decision='$1' -ac_decision_msg='$2' -ac_decision_$1=yes -ac_decision_$1_msg='$2' -]) - - -define(AC_DECISION_OVERRIDE,[dnl - ac_decision='' - for ac_item in $1; do - eval "ac_decision_this=\$ac_decision_${ac_item}" - if test ".$ac_decision_this" = .yes; then - ac_decision=$ac_item - eval "ac_decision_msg=\$ac_decision_${ac_item}_msg" - fi - done -]) - - -define(AC_DECISION_FORCE,[dnl -ac_decision="$1" -eval "ac_decision_msg=\"\$ac_decision_${ac_decision}_msg\"" -]) - - -define(AC_END_DECISION,[dnl -if test ".$ac_decision" = .; then - echo "[$]0:Error: decision on $ac_decision_item failed" 1>&2 - exit 1 -else - if test ".$ac_decision_msg" = .; then - ac_decision_msg="$ac_decision" - fi - AC_DEFINE_UNQUOTED(${ac_decision_item}) - AC_MSG_RESULT([decision on $ac_decision_item... $ac_decision_msg]) -fi -]) - -dnl ### AC_TRY_RUN had some problems actually using a programs return code, -dnl ### so I am re-working it here to be used in APR's configure script. -dnl MY_TRY_RUN(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE -dnl [, ACTION-IF-CROSS-COMPILING]]]) -AC_DEFUN(MY_TRY_RUN, -[if test "$cross_compiling" = yes; then - ifelse([$4], , - [errprint(__file__:__line__: warning: [AC_TRY_RUN] called without default to allow cross compiling -)dnl - AC_MSG_ERROR(can not run test program while cross compiling)], - [$4]) -else - MY_TRY_RUN_NATIVE([$1], [$2], [$3]) -fi -]) - -dnl Like AC_TRY_RUN but assumes a native-environment (non-cross) compiler. -dnl MY_TRY_RUN_NATIVE(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE]]) -AC_DEFUN(MY_TRY_RUN_NATIVE, -[cat > conftest.$ac_ext <<EOF -[#]line __oline__ "configure" -#include "confdefs.h" -ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus -extern "C" void exit(int); -#endif -])dnl -[$1] -EOF -if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then -dnl Don't remove the temporary files here, so they can be examined. - ifelse([$2], , :, [$2]) -else -ifelse([$3], , , [ $3 - rm -fr conftest* -])dnl -fi -rm -fr conftest*]) - - -dnl A variant of AC_CHECK_SIZEOF which allows the checking of -dnl sizes of non-builtin types -dnl AC_CHECK_SIZEOF_EXTENDED(INCLUDES, TYPE [, CROSS_SIZE]) -AC_DEFUN(AC_CHECK_SIZEOF_EXTENDED, -[changequote(<<,>>)dnl -dnl The name to #define -define(<<AC_TYPE_NAME>>, translit(sizeof_$2, [a-z *], [A-Z_P]))dnl -dnl The cache variable -define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$2, [ *],[<p>]))dnl -changequote([, ])dnl -AC_MSG_CHECKING(size of $2) -AC_CACHE_VAL(AC_CV_NAME, -[AC_TRY_RUN([#include <stdio.h> -$1 -main() -{ - FILE *f=fopen("conftestval","w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof($2)); - exit(0); -}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$3],,, -AC_CV_NAME=$3))])dnl -AC_MSG_RESULT($AC_CV_NAME) -AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) -undefine([AC_TYPE_NAME])dnl -undefine([AC_CV_NAME])dnl -]) - -dnl -dnl check for working getaddrinfo() -dnl -AC_DEFUN(APR_CHECK_WORKING_GETADDRINFO,[ - AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[ - AC_TRY_RUN( [ -#ifdef HAVE_NETDB_H -#include <netdb.h> -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif - -void main(void) { - struct addrinfo hints, *ai; - int error; - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - error = getaddrinfo("127.0.0.1", "8080", &hints, &ai); - if (error) { - exit(1); - } - else { - exit(0); - } -} -],[ - ac_cv_working_getaddrinfo="yes" -],[ - ac_cv_working_getaddrinfo="no" -],[ - ac_cv_working_getaddrinfo="yes" -])]) -if test "$ac_cv_working_getaddrinfo" = "yes"; then - AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works well enough for APR]) -fi -]) - -dnl -dnl check for gethostbyname() which handles numeric address strings -dnl -AC_DEFUN(APR_CHECK_GETHOSTBYNAME_NAS,[ - AC_CACHE_CHECK(for gethostbyname() which handles numeric address strings, ac_cv_gethostbyname_nas,[ - AC_TRY_RUN( [ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#ifdef HAVE_ARPA_INET_H -#include <arpa/inet.h> -#endif -#ifdef HAVE_NETDB_H -#include <netdb.h> -#endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -void main(void) { - struct hostent *he = gethostbyname("127.0.0.1"); - if (he == NULL) { - exit(1); - } - else { - exit(0); - } -} -],[ - ac_cv_gethostbyname_nas="yes" -],[ - ac_cv_gethostbyname_nas="no" -],[ - ac_cv_gethostbyname_nas="yes" -])]) -if test "$ac_cv_gethostbyname_nas" = "yes"; then - AC_DEFINE(GETHOSTBYNAME_HANDLES_NAS, 1, [Define if gethostbyname() handles nnn.nnn.nnn.nnn]) -fi -]) - -dnl -dnl check for socklen_t, fall back to unsigned int -dnl -AC_DEFUN(APR_CHECK_SOCKLEN_T,[ -AC_CACHE_CHECK(for socklen_t, ac_cv_socklen_t,[ -AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -],[ -socklen_t foo = (socklen_t) 0; -],[ - ac_cv_socklen_t=yes -],[ - ac_cv_socklen_t=no -]) -]) - -if test "$ac_cv_socklen_t" = "yes"; then - AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t]) -fi -]) - - -AC_DEFUN(APR_EBCDIC,[ - AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ - AC_TRY_RUN( [ -int main(void) { - return (unsigned char)'A' != (unsigned char)0xC1; -} -],[ - ac_cv_ebcdic="yes" -],[ - ac_cv_ebcdic="no" -],[ - ac_cv_ebcdic="no" -])]) - if test "$ac_cv_ebcdic" = "yes"; then - apr_charset_ebcdic=1 - else - apr_charset_ebcdic=0 - fi - AC_SUBST(apr_charset_ebcdic) -]) - - -AC_DEFUN(APR_PREPARE_MM_DIR,[ -dnl #----------------------------- Prepare mm directory for VPATH support -if test -n "$USE_MM" && test -n "$USE_VPATH"; then - test -d $mm_dir || $MKDIR $mm_dir - - for i in shtool config.guess config.sub fbtool ltconfig \ - ltmain.sh mm_vers.c; do - test -r $mm_dir/$i || ln -s $abs_srcdir/$mm_dir/$i $mm_dir/$i - done -fi -]) - - -AC_DEFUN(APR_CHECK_INET_ADDR,[ -AC_CACHE_CHECK(for inet_addr, ac_cv_func_inet_addr,[ -AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_ARPA_INET_H -#include <arpa/inet.h> -#endif -],[ -inet_addr("127.0.0.1"); -],[ - ac_cv_func_inet_addr=yes -],[ - ac_cv_func_inet_addr=no -]) -]) - -if test "$ac_cv_func_inet_addr" = "yes"; then - have_inet_addr=1 -else - have_inet_addr=0 -fi -]) - - -AC_DEFUN(APR_CHECK_INET_NETWORK,[ -AC_CACHE_CHECK(for inet_network, ac_cv_func_inet_network,[ -AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_ARPA_INET_H -#include <arpa/inet.h> -#endif -],[ -inet_network("127.0.0.1"); -],[ - ac_cv_func_inet_network=yes -],[ - ac_cv_func_inet_network=no -]) -]) - -if test "$ac_cv_func_inet_network" = "yes"; then - have_inet_network=1 -else - have_inet_network=0 -fi -]) - - -AC_DEFUN(APR_CHECK_SOCKADDR_IN6,[ -AC_CACHE_CHECK(for sockaddr_in6, ac_cv_define_sockaddr_in6,[ -AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -],[ -struct sockaddr_in6 sa; -],[ - ac_cv_define_sockaddr_in6=yes -],[ - ac_cv_define_sockaddr_in6=no -]) -]) - -if test "$ac_cv_define_sockaddr_in6" = "yes"; then - have_sockaddr_in6=1 -else - have_sockaddr_in6=0 -fi -]) - -dnl -dnl Check to see if this platform includes sa_len in it's -dnl struct sockaddr. If it does it changes the length of sa_family -dnl which could cause us problems -dnl -AC_DEFUN(APR_CHECK_SOCKADDR_SA_LEN,[ -AC_CACHE_CHECK(for sockaddr sa_len, ac_cv_define_sockaddr_sa_len,[ -AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -],[ -struct sockaddr_in sai; -int i = sai.sin_len; -],[ - ac_cv_define_sockaddr_sa_len=yes -],[ - ac_cv_define_sockaddr_sa_len=no -]) -]) - -if test "$ac_cv_define_sockaddr_sa_len" = "yes"; then - AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1 ,[Define if we have length field in sockaddr_in]) -fi -]) - - -dnl -dnl APR_INADDR_NONE -dnl -dnl checks for missing INADDR_NONE macro -dnl -AC_DEFUN(APR_INADDR_NONE,[ - AC_CACHE_CHECK(whether system defines INADDR_NONE, ac_cv_inaddr_none,[ - AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#ifdef HAVE_ARPA_INET_H -#include <arpa/inet.h> -#endif -],[ -unsigned long foo = INADDR_NONE; -],[ - ac_cv_inaddr_none=yes -],[ - ac_cv_inaddr_none=no -])]) - if test "$ac_cv_inaddr_none" = "no"; then - apr_inaddr_none="((unsigned int) 0xffffffff)" - else - apr_inaddr_none="INADDR_NONE" - fi -]) - - -dnl -dnl APR_CHECK_H_ERRNO_FLAG -dnl -dnl checks which flags are necessary for <netdb.h> to define h_errno -dnl -AC_DEFUN(APR_H_ERRNO_COMPILE_CHECK,[ - if test x$1 != x; then - CFLAGS="-D$1 $CFLAGS" - fi - AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_NETDB_H -#include <netdb.h> -#endif -],[ -int h_e = h_errno; -],[ - if test x$1 != x; then - ac_cv_h_errno_cflags="$1" - else - ac_cv_h_errno_cflags=yes - fi -],[ - ac_cv_h_errno_cflags=no -])]) -AC_DEFUN(APR_CHECK_H_ERRNO_FLAG,[ - AC_MSG_CHECKING([for h_errno in netdb.h]) - AC_CACHE_VAL(ac_cv_h_errno_cflags,[ - APR_H_ERRNO_COMPILE_CHECK - if test "$ac_cv_h_errno_cflags" = "no"; then - ac_save="$CFLAGS" - for flag in _XOPEN_SOURCE_EXTENDED; do - APR_H_ERRNO_COMPILE_CHECK($flag) - if test "$ac_cv_h_errno_cflags" != "no"; then - break - fi - done - CFLAGS="$ac_save" - fi - ]) - if test "$ac_cv_h_errno_cflags" != "no"; then - if test "$ac_cv_h_errno_cflags" != "yes"; then - CFLAGS="-D$ac_cv_h_errno_cflags $CFLAGS" - AC_MSG_RESULT([yes, with -D$ac_cv_h_errno_cflags]) - else - AC_MSG_RESULT([$ac_cv_h_errno_cflags]) - fi - else - AC_MSG_RESULT([$ac_cv_h_errno_cflags]) - fi -]) diff --git a/hints.m4 b/hints.m4 deleted file mode 100644 index e80f40e9b30..00000000000 --- a/hints.m4 +++ /dev/null @@ -1,365 +0,0 @@ -dnl -dnl APR_PRELOAD -dnl -dnl Preload various ENV/makefile paramsm such as CC, CFLAGS, etc -dnl based on outside knowledge -dnl -dnl Generally, we force the setting of CC, and add flags -dnl to CFLAGS, LIBS and LDFLAGS. -dnl -AC_DEFUN(APR_PRELOAD, [ -if test "$DID_APR_PRELOAD" = "yes" ; then - - echo "APR hints file rules for $host already applied" - -else - - DID_APR_PRELOAD="yes"; export DID_APR_PRELOAD - - echo "Applying APR hints file rules for $host" - - case "$host" in - *mint) - APR_ADDTO(CFLAGS, [-DMINT]) - APR_ADDTO(LIBS, [-lportlib -lsocket]) - ;; - *MPE/iX*) - APR_ADDTO(CFLAGS, [-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE]) - APR_ADDTO(LIBS, [-lsocket -lsvipc -lcurses]) - APR_ADDTO(LDFLAGS, [-Xlinker \"-WL,cap=ia,ba,ph;nmstack=1024000\"]) - APR_SETVAR(CAT, [/bin/cat]) - ;; - *-apple-aux3*) - APR_SETVAR(CC, [gcc]) - APR_ADDTO(CFLAGS, [-DAUX3 -D_POSIX_SOURCE]) - APR_ADDTO(LIBS, [-lposix -lbsd]) - APR_ADDTO(LDFLAGS, [-s]) - APR_SETVAR(SHELL, [/bin/ksh]) - ;; - *-ibm-aix*) - case $host in - i386-ibm-aix*) - APR_ADDTO(CFLAGS, [-U__STR__ -DUSEBCOPY]) - ;; - *-ibm-aix[1-2].*) - APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) - ;; - *-ibm-aix3.*) - APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) - ;; - *-ibm-aix4.1) - APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) - ;; - *-ibm-aix4.1.*) - APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) - ;; - *-ibm-aix4.2) - APR_ADDTO(CFLAGS, [-U__STR__]) - ;; - *-ibm-aix4.2.*) - APR_ADDTO(CFLAGS, [-U__STR__]) - ;; - *-ibm-aix4.3) - APR_ADDTO(CFLAGS, [-D_USE_IRS -U__STR__]) - ;; - *-ibm-aix4.3.*) - APR_ADDTO(CFLAGS, [-D_USE_IRS -U__STR__]) - ;; - *-ibm-aix*) - APR_ADDTO(CFLAGS, [-U__STR__]) - ;; - esac - dnl Must do a check for gcc or egcs here, to get the right options - dnl to the compiler. - AC_PROG_CC - if test "$GCC" != "yes"; then - APR_ADDTO(CFLAGS, [-qHALT=E]) - APR_ADDTO(CFLAGS, [-qLANGLVL=extended]) - fi - APR_SETIFNULL(apr_iconv_inbuf_const, [1]) - ;; - *-apollo-*) - APR_ADDTO(CFLAGS, [-DAPOLLO]) - ;; - *-dg-dgux*) - APR_ADDTO(CFLAGS, [-DDGUX]) - ;; - *os2_emx*) - APR_SETVAR(SHELL, [sh]) - ;; - *-hi-hiux) - APR_ADDTO(CFLAGS, [-DHIUX]) - ;; - *-hp-hpux11.*) - APR_ADDTO(CFLAGS, [-DHPUX11]) - APR_ADDTO(LIBS, [-lpthread]) - ;; - *-hp-hpux10.*) - case $host in - *-hp-hpux10.01) -dnl # We know this is a problem in 10.01. -dnl # Not a problem in 10.20. Otherwise, who knows? - APR_ADDTO(CFLAGS, [-DSELECT_NEEDS_CAST]) - ;; - esac - ;; - *-hp-hpux*) - APR_ADDTO(CFLAGS, [-DHPUX]) - ;; - *-linux-*) - case `uname -r` in - 2.2* ) APR_ADDTO(CFLAGS, [-DLINUX=2]) - ;; - 2.0* ) APR_ADDTO(CFLAGS, [-DLINUX=2]) - ;; - 1.* ) APR_ADDTO(CFLAGS, [-DLINUX=1]) - ;; - * ) - ;; - esac - ;; - *-GNU*) - APR_ADDTO(CFLAGS, [-DHURD]) - APR_ADDTO(LIBS, [-lcrypt]) - ;; - *-lynx-lynxos) - APR_ADDTO(CFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) - APR_ADDTO(LIBS, [-lbsd -lcrypt]) - ;; - *486-*-bsdi*) - APR_ADDTO(CFLAGS, [-m486]) - ;; - *-netbsd*) - APR_ADDTO(CFLAGS, [-DNETBSD]) - APR_ADDTO(LIBS, [-lcrypt]) - ;; - *-freebsd*) - case $host in - *freebsd[2345]*) - APR_ADDTO(CFLAGS, [-funsigned-char]) - ;; - esac - APR_ADDTO(LIBS, [-lcrypt]) - APR_SETIFNULL(enable_threads, [no]) - ;; - *-next-nextstep*) - APR_SETIFNULL(OPTIM, [-O]) - APR_ADDTO(CFLAGS, [-DNEXT]) - ;; - *-next-openstep*) - APR_SETVAR(CC, [cc]) - APR_SETIFNULL(OPTIM, [-O]) - APR_ADDTO(CFLAGS, [-DNEXT]) - ;; -dnl *-apple-rhapsody*) -dnl APR_ADDTO(CFLAGS, [-DDARWIN -DMAC_OS_X_SERVER]) -dnl ;; - *-apple-darwin*) - APR_ADDTO(CFLAGS, [-DDARWIN]) - ;; - *-dec-osf*) - APR_ADDTO(CFLAGS, [-DOSF1]) - ;; - *-qnx) - APR_ADDTO(CFLAGS, [-DQNX]) - APR_ADDTO(LIBS, [-N128k -lsocket -lunix]) - ;; - *-qnx32) - APR_SETVAR(CC, [cc -F]) - APR_ADDTO(CFLAGS, [-DQNX -mf -3]) - APR_ADDTO(LIBS, [-N128k -lsocket -lunix]) - ;; - *-isc4*) - APR_SETVAR(CC, [gcc]) - APR_ADDTO(CFLAGS, [-posix -DISC]) - APR_ADDTO(LDFLAGS, [-posix]) - APR_ADDTO(LIBS, [-linet]) - ;; - *-sco3*) - APR_ADDTO(CFLAGS, [-DSCO -Oacgiltz]) - APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) - ;; - *-sco5*) - APR_ADDTO(CFLAGS, [-DSCO5]) - APR_ADDTO(LIBS, [-lsocket -lmalloc -lprot -ltinfo -lx]) - ;; - *-sco_sv*|*-SCO_SV*) - APR_ADDTO(CFLAGS, [-DSCO]) - APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) - ;; - *-solaris2*) - PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` - APR_ADDTO(CFLAGS, [-DSOLARIS2=$PLATOSVERS]) - APR_ADDTO(LIBS, [-lsocket -lnsl]) - APR_SETIFNULL(apr_iconv_inbuf_const, [1]) - ;; - *-sunos4*) - APR_ADDTO(CFLAGS, [-DSUNOS4 -DUSEBCOPY]) - ;; - *-unixware1) - APR_ADDTO(CFLAGS, [-DUW=100]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt]) - ;; - *-unixware2) - APR_ADDTO(CFLAGS, [-DUW=200]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) - ;; - *-unixware211) - APR_ADDTO(CFLAGS, [-DUW=211]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) - ;; - *-unixware212) - APR_ADDTO(CFLAGS, [-DUW=212]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) - ;; - *-unixware7) - APR_ADDTO(CFLAGS, [-DUW=700]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) - ;; - maxion-*-sysv4*) - APR_ADDTO(CFLAGS, [-DSVR4]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc -lgen]) - ;; - *-*-powermax*) - APR_ADDTO(CFLAGS, [-DSVR4]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lgen]) - ;; - TPF) - APR_SETVAR(CC, [c89]) - APR_ADDTO(CFLAGS, [-DTPF -D_POSIX_SOURCE]) - ;; - BS2000*-siemens-sysv4*) - APR_SETVAR(CC, [c89 -XLLML -XLLMK -XL -Kno_integer_overflow]) - APR_ADDTO(CFLAGS, [-DSVR4 -D_XPG_IV]) - ;; - *-siemens-sysv4*) - APR_ADDTO(CFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT -DNEED_UNION_SEMUN]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) - ;; - pyramid-pyramid-svr4) - APR_ADDTO(CFLAGS, [-DSVR4 -DNO_LONG_DOUBLE]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) - ;; - DS/90\ 7000-*-sysv4*) - APR_ADDTO(CFLAGS, [-DUXPDS]) - APR_ADDTO(LIBS, [-lsocket -lnsl]) - ;; - *-tandem-sysv4*) - APR_ADDTO(CFLAGS, [-DSVR4]) - APR_ADDTO(LIBS, [-lsocket -lnsl]) - ;; - *-ncr-sysv4) - APR_ADDTO(CFLAGS, [-DSVR4 -DMPRAS]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) - ;; - *-sysv4*) - APR_ADDTO(CFLAGS, [-DSVR4]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) - ;; - 88k-encore-sysv4) - APR_ADDTO(CFLAGS, [-DSVR4 -DENCORE]) - APR_ADDTO(LIBS, [-lPW]) - ;; - *-uts*) - PLATOSVERS=`echo $host | sed 's/^.*,//'` - case $PLATOSVERS in - 2*) APR_ADDTO(CFLAGS, [-Xa -eft -DUTS21 -DUSEBCOPY]) - APR_ADDTO(LIBS, [-lsocket -lbsd -la]) - ;; - *) APR_ADDTO(CFLAGS, [-Xa -DSVR4]) - APR_ADDTO(LIBS, [-lsocket -lnsl]) - ;; - esac - ;; - *-ultrix) - APR_ADDTO(CFLAGS, [-DULTRIX]) - APR_SETVAR(SHELL, [/bin/sh5]) - ;; - *powerpc-tenon-machten*) - APR_ADDTO(LDFLAGS, [-Xlstack=0x14000 -Xldelcsect]) - ;; - *-machten*) - APR_ADDTO(LDFLAGS, [-stack 0x14000]) - ;; - *convex-v11*) - APR_ADDTO(CFLAGS, [-ext -DCONVEXOS11]) - APR_SETIFNULL(OPTIM, [-O1]) - APR_SETVAR(CC, [cc]) - ;; - i860-intel-osf1) - APR_ADDTO(CFLAGS, [-DPARAGON]) - ;; - *-sequent-ptx2.*.*) - APR_ADDTO(CFLAGS, [-DSEQUENT=20 -Wc,-pw]) - APR_ADDTO(LIBS, [-lsocket -linet -lnsl -lc -lseq]) - ;; - *-sequent-ptx4.0.*) - APR_ADDTO(CFLAGS, [-DSEQUENT=40 -Wc,-pw]) - APR_ADDTO(LIBS, [-lsocket -linet -lnsl -lc]) - ;; - *-sequent-ptx4.[123].*) - APR_ADDTO(CFLAGS, [-DSEQUENT=41 -Wc,-pw]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) - ;; - *-sequent-ptx4.4.*) - APR_ADDTO(CFLAGS, [-DSEQUENT=44 -Wc,-pw]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) - ;; - *-sequent-ptx4.5.*) - APR_ADDTO(CFLAGS, [-DSEQUENT=45 -Wc,-pw]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) - ;; - *-sequent-ptx5.0.*) - APR_ADDTO(CFLAGS, [-DSEQUENT=50 -Wc,-pw]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) - ;; - *NEWS-OS*) - APR_ADDTO(CFLAGS, [-DNEWSOS]) - ;; - *-riscix) - APR_ADDTO(CFLAGS, [-DRISCIX]) - APR_SETIFNULL(OPTIM, [-O]) - APR_SETIFNULL(MAKE, [make]) - ;; - *beos*) - APR_ADDTO(CFLAGS, [-DBEOS]) - PLATOSVERS=`uname -r` - case $PLATOSVERS in - 5.1) - APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) - APR_ADDTO(LDFLAGS, [-nodefaultlibs -L/boot/develop/lib/x86 -L/boot/beos/system/lib]) - APR_ADDTO(EXTRA_LIBS, [-lbind -lsocket -lbe -lroot]) - ;; - esac - ;; - 4850-*.*) - APR_ADDTO(CFLAGS, [-DSVR4 -DMPRAS]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) - ;; - drs6000*) - APR_ADDTO(CFLAGS, [-DSVR4]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) - ;; - m88k-*-CX/SX|CYBER) - APR_ADDTO(CFLAGS, [-D_CX_SX -Xa]) - APR_SETVAR(CC, [cc]) - ;; - *-tandem-oss) - APR_ADDTO(CFLAGS, [-D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED=1]) - APR_SETVAR(CC, [c89]) - ;; - *-ibm-os390) - APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE]) - APR_SETIFNULL(apr_process_lock_is_global, [yes]) - APR_SETIFNULL(CC, [cc]) - APR_ADDTO(CFLAGS, [-U_NO_PROTO]) - APR_ADDTO(CFLAGS, [-DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR]) - APR_ADDTO(CFLAGS, [-DPTHREAD_SETS_ERRNO]) - APR_ADDTO(CFLAGS, [-DPTHREAD_DETACH_ARG1_ADDR]) - APR_ADDTO(CFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK]) - APR_ADDTO(CFLAGS, [-DTCP_NODELAY=1]) - ;; - esac - APR_DOEXTRA -fi -]) From 87033a612706828c148a28149ea9f5bdf17eb2c8 Mon Sep 17 00:00:00 2001 From: Ben Laurie <ben@apache.org> Date: Sat, 17 Feb 2001 16:10:55 +0000 Subject: [PATCH 1258/7878] Make exports.lo rebuild when it should. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61243 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index af860b2f81b..9c96b90b982 100644 --- a/Makefile.in +++ b/Makefile.in @@ -61,7 +61,7 @@ delete-exports: fi \ fi -$(TARGET_EXPORTS): +$(TARGET_EXPORTS): include/*.h $(MKEXPORT) include/*.h > $@ docs: From a15f35f887cdadd2946d6ca16183a060181b5a0b Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sat, 17 Feb 2001 22:25:47 +0000 Subject: [PATCH 1259/7878] remove bogus dependencies The exports files are automatically rebuilt by a plain "make" at the top-level. "make foo.exports" won't do it, and we need to live with it until somebody finds a better way to do dynamic dependencies (portably). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61244 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 9c96b90b982..af860b2f81b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -61,7 +61,7 @@ delete-exports: fi \ fi -$(TARGET_EXPORTS): include/*.h +$(TARGET_EXPORTS): $(MKEXPORT) include/*.h > $@ docs: From bc5de9efe7a3517e2e3cb88c35878d169b30dfd6 Mon Sep 17 00:00:00 2001 From: Greg Stein <gstein@apache.org> Date: Sun, 18 Feb 2001 00:32:16 +0000 Subject: [PATCH 1260/7878] "Bring it on, Fly Boy!" git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61245 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index b3de9291b7f..02b14e65f7f 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/02/04 21:37:49 $] +Last modified at [$Date: 2001/02/18 00:32:16 $] Release: @@ -116,6 +116,11 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: would allow the new/returned file to be closed (via pool cleanup or manually) without accidentally closing stderr/out. + * need to export the shared library extension (e.g. ".so") for the + platform. clients need to use this to construct filenames to + pass to apr_dso_load() + + Documentation that needs writing: * API documentation From 5b27eab8f94c1ff236f43e47e8a318d762085a06 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sun, 18 Feb 2001 08:14:14 +0000 Subject: [PATCH 1261/7878] Import of platform guessing scripts from GNU libtool 1.3.5. These are in CVS because Apache runs on platforms that are not known by the GNU tools (yet). Obtained from: GNU libtool 1.3.5 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61246 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 1183 +++++++++++++++++++++++++++++++++++++++++ build/config.sub | 1268 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2451 insertions(+) create mode 100755 build/config.guess create mode 100755 build/config.sub diff --git a/build/config.guess b/build/config.guess new file mode 100755 index 00000000000..0ce538bb85c --- /dev/null +++ b/build/config.guess @@ -0,0 +1,1183 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner <bothner@cygnus.com>. +# Please send patches to <config-patches@gnu.org>. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit system type (host/target name). +# +# Only a few systems have been added to this list; please add others +# (but try to keep the structure clean). +# + +# Use $HOST_CC if defined. $CC may point to a cross-compiler +if test x"$CC_FOR_BUILD" = x; then + if test x"$HOST_CC" != x; then + CC_FOR_BUILD="$HOST_CC" + else + if test x"$CC" != x; then + CC_FOR_BUILD="$CC" + else + CC_FOR_BUILD=cc + fi + fi +fi + + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 8/24/94.) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # Netbsd (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # Determine the machine/vendor (is the vendor relevant). + case "${UNAME_MACHINE}" in + amiga) machine=m68k-cbm ;; + arm32) machine=arm-unknown ;; + atari*) machine=m68k-atari ;; + sun3*) machine=m68k-sun ;; + mac68k) machine=m68k-apple ;; + macppc) machine=powerpc-apple ;; + hp3[0-9][05]) machine=m68k-hp ;; + ibmrt|romp-ibm) machine=romp-ibm ;; + *) machine=${UNAME_MACHINE}-unknown ;; + esac + # The Operating System including object format. + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <<EOF >$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-cbm-sysv4 + exit 0;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i?86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:4) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=4.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + rm -f $dummy.c $dummy + esac + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i?86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + hppa*:OpenBSD:*:*) + echo hppa-unknown-openbsd + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F300:UNIX_System_V:*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + F301:UNIX_System_V:*:*) + echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + *:Linux:*:*) + + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_help_string=`cd /; ld --help 2>&1` + ld_supported_emulations=`echo $ld_help_string \ + | sed -ne '/supported emulations:/!d + s/[ ][ ]*/ /g + s/.*supported emulations: *// + s/ .*// + p'` + case "$ld_supported_emulations" in + *ia64) + echo "${UNAME_MACHINE}-unknown-linux" + exit 0 + ;; + i?86linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 + ;; + elf_i?86) + echo "${UNAME_MACHINE}-pc-linux" + exit 0 + ;; + i?86coff) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 + ;; + sparclinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + armlinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + elf32arm*) + echo "${UNAME_MACHINE}-unknown-linux-gnuoldld" + exit 0 + ;; + armelf_linux*) + echo "${UNAME_MACHINE}-unknown-linux-gnu" + exit 0 + ;; + m68klinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + elf32ppc | elf32ppclinux) + # Determine Lib Version + cat >$dummy.c <<EOF +#include <features.h> +#if defined(__GLIBC__) +extern char __libc_version[]; +extern char __libc_release[]; +#endif +main(argc, argv) + int argc; + char *argv[]; +{ +#if defined(__GLIBC__) + printf("%s %s\n", __libc_version, __libc_release); +#else + printf("unkown\n"); +#endif + return 0; +} +EOF + LIBC="" + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy | grep 1\.99 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.c $dummy + echo powerpc-unknown-linux-gnu${LIBC} + exit 0 + ;; + esac + + if test "${UNAME_MACHINE}" = "alpha" ; then + cat <<EOF >$dummy.s + .data + \$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main + main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + LIBC="" + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + esac + + objdump --private-headers $dummy | \ + grep ld.so.1 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 + elif test "${UNAME_MACHINE}" = "mips" ; then + cat >$dummy.c <<EOF +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __MIPSEB__ + printf ("%s-unknown-linux-gnu\n", argv[1]); +#endif +#ifdef __MIPSEL__ + printf ("%sel-unknown-linux-gnu\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + elif test "${UNAME_MACHINE}" = "s390"; then + echo s390-ibm-linux && exit 0 + else + # Either a pre-BFD a.out linker (linux-gnuoldld) + # or one that does not give us useful --help. + # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. + # If ld does not provide *any* "supported emulations:" + # that means it is gnuoldld. + echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" + test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + + case "${UNAME_MACHINE}" in + i?86) + VENDOR=pc; + ;; + *) + VENDOR=unknown; + ;; + esac + # Determine whether the default compiler is a.out or elf + cat >$dummy.c <<EOF +#include <features.h> +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + fi ;; +# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions +# are messed up and put the nodename in both sysname and nodename. + i?86:DYNIX/ptx:4*:*) + echo i386-sequent-sysv4 + exit 0 ;; + i?86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i?86:*:5:7*) + # Fixed at (any) Pentium or better + UNAME_MACHINE=i586 + if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then + echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + fi + exit 0 ;; + i?86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i?86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:*:6*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-W:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +cat >$dummy.c <<EOF +#ifdef _SEQUENT_ +# include <sys/types.h> +# include <sys/utsname.h> +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +#if !defined (ultrix) + printf ("vax-dec-bsd\n"); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +#echo '(Unable to guess system type)' 1>&2 + +exit 1 diff --git a/build/config.sub b/build/config.sub new file mode 100755 index 00000000000..c8e77851e69 --- /dev/null +++ b/build/config.sub @@ -0,0 +1,1268 @@ +#! /bin/sh +# Configuration validation subroutine script, version 1.1. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. +# +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner <bothner@cygnus.com>. +# Please send patches to <config-patches@gnu.org>. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +if [ x$1 = x ] +then + echo Configuration name missing. 1>&2 + echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 + echo "or $0 ALIAS" 1>&2 + echo where ALIAS is a recognized configuration type. 1>&2 + exit 1 +fi + +# First pass through any local machine types. +case $1 in + *local*) + echo $1 + exit 0 + ;; + *) + ;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + | 580 | i960 | h8300 \ + | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \ + | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | hppa64 \ + | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ + | alphaev6[78] \ + | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ + | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ + | mips64orion | mips64orionel | mipstx39 | mipstx39el \ + | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ + | mips64vr5000 | miprs64vr5000el | mcore \ + | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ + | thumb | d10v | fr30 | avr) + basic_machine=$basic_machine-unknown + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i[34567]86) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + # FIXME: clean up the formatting here. + vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ + | xmp-* | ymp-* \ + | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ + | hppa2.0n-* | hppa64-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ + | alphaev6[78]-* \ + | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ + | clipper-* | orion-* \ + | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ + | mipstx39-* | mipstx39el-* | mcore-* \ + | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ + | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ + | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ + | bs2000-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-cbm + ;; + amigaos | amigados) + basic_machine=m68k-cbm + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-cbm + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [ctj]90-cray) + basic_machine=c90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i[34567]86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i[34567]86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i[34567]86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i[34567]86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + i386-go32 | go32) + basic_machine=i386-unknown + os=-go32 + ;; + i386-mingw32 | mingw32) + basic_machine=i386-unknown + os=-mingw32 + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + msdos) + basic_machine=i386-unknown + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexen-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=rs6000-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=t3e-cray + os=-unicos + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + mips) + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sparc | sparcv9) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i[34567]86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -*MiNT) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f301-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -*MiNT) + vendor=atari + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os From 17616a9d19a4a6c75e4b0c3afc69f5e546dc2f84 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sun, 18 Feb 2001 08:23:41 +0000 Subject: [PATCH 1262/7878] Add support for OS/390 to APR's config.sub and config.guess. TPF and VM/CMS came along for the ride. Submitted by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61247 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 3 +++ build/config.sub | 25 +++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/build/config.guess b/build/config.guess index 0ce538bb85c..54c42df1361 100755 --- a/build/config.guess +++ b/build/config.guess @@ -389,6 +389,9 @@ EOF *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; + *:OS390:*:* | *:OS/390:*:*) + echo s390-ibm-os390 + exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' diff --git a/build/config.sub b/build/config.sub index c8e77851e69..e87e1dbf0ef 100755 --- a/build/config.sub +++ b/build/config.sub @@ -77,6 +77,14 @@ case $maybe_os in os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + tpf | os390 | vmcms) + os=-$maybe_os + basic_machine=s390; + ;; + mvs) + os=-mvs + basic_machine=i370; + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -680,6 +688,9 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; + s390*) + basic_machine=s390-ibm + ;; sequent) basic_machine=i386-sequent ;; @@ -939,7 +950,7 @@ case $os in | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit*) + | -openstep* | -oskit* | -tpf* | -os390* | -vmcms* ) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1108,7 +1119,17 @@ case $basic_machine in os=-beos ;; *-ibm) - os=-aix + case $basic_machine in + s390*) + os=-os390; + ;; + i370*) + os=-mvs; + ;; + *) + os=-aix + ;; + esac ;; *-wec) os=-proelf From 454cb31a85b919d3ecd5ef11a0b330c107fd3f37 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sun, 18 Feb 2001 09:38:09 +0000 Subject: [PATCH 1263/7878] Add support for OS/2 emx [originally from Brian Havard]. Isolate and clearly identify all changes for Apache. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61248 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 21 +++++++++++++++------ build/config.sub | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/build/config.guess b/build/config.guess index 54c42df1361..ec2f9716c21 100755 --- a/build/config.guess +++ b/build/config.guess @@ -199,9 +199,21 @@ EOF wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit 0 ;; +######################### +# Apache changes +# +# *:OS/390:*:*) +# echo i370-ibm-openedition +# exit 0 ;; + *:OS390:*:* | *:OS/390:*:*) + echo s390-ibm-os390 + exit 0 ;; + *:OS/2:*:*) + echo "i386-pc-os2_emx" + exit 0;; +# +# end Apache changes +######################### arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; @@ -389,9 +401,6 @@ EOF *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; - *:OS390:*:* | *:OS/390:*:*) - echo s390-ibm-os390 - exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' diff --git a/build/config.sub b/build/config.sub index e87e1dbf0ef..e3c08259ee2 100755 --- a/build/config.sub +++ b/build/config.sub @@ -77,6 +77,9 @@ case $maybe_os in os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; +######################## +# changes for Apache +# tpf | os390 | vmcms) os=-$maybe_os basic_machine=s390; @@ -85,6 +88,9 @@ case $maybe_os in os=-mvs basic_machine=i370; ;; +# +# end Apache changes +######################## *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -450,6 +456,8 @@ case $basic_machine in ;; i370-ibm* | ibm*) basic_machine=i370-ibm +# next line added by Apache (not sure why) + os=-mvs ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i[34567]86v32) @@ -688,9 +696,15 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; +######################## +# changes for Apache +# s390*) basic_machine=s390-ibm ;; +# +# end Apache changes +######################## sequent) basic_machine=i386-sequent ;; @@ -932,6 +946,14 @@ case $os in -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; +######################## +# changes for Apache +# + -os2_emx | -tpf* | -os390* | -vmcms* ) + ;; +# +# end Apache changes +######################## # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. @@ -950,7 +972,7 @@ case $os in | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -tpf* | -os390* | -vmcms* ) + | -openstep* | -oskit*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1118,6 +1140,13 @@ case $basic_machine in *-be) os=-beos ;; +######################## +# changes for Apache +# +# *-ibm) +# os=-aix +# ;; +# *-ibm) case $basic_machine in s390*) @@ -1131,6 +1160,9 @@ case $basic_machine in ;; esac ;; +# +# end Apache changes +######################## *-wec) os=-proelf ;; From baf4e026c37953318c9bed40231ff4e85a692e14 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sun, 18 Feb 2001 09:46:28 +0000 Subject: [PATCH 1264/7878] Just to belabor the point. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61249 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 5 +++++ build/config.sub | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/build/config.guess b/build/config.guess index ec2f9716c21..a4d743520c6 100755 --- a/build/config.guess +++ b/build/config.guess @@ -22,6 +22,11 @@ # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. +##################################################################### +# This file contains changes for Apache, clearly marked below. +# These changes are hereby donated to the public domain. +##################################################################### + # Written by Per Bothner <bothner@cygnus.com>. # Please send patches to <config-patches@gnu.org>. # diff --git a/build/config.sub b/build/config.sub index e3c08259ee2..aef156adfb7 100755 --- a/build/config.sub +++ b/build/config.sub @@ -27,6 +27,11 @@ # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. +##################################################################### +# This file contains changes for Apache, clearly marked below. +# These changes are hereby donated to the public domain. +##################################################################### + # Written by Per Bothner <bothner@cygnus.com>. # Please send patches to <config-patches@gnu.org>. # From dd5f244aebdd253011f74e89581b636b17b88b66 Mon Sep 17 00:00:00 2001 From: Brian Havard <bjh@apache.org> Date: Sun, 18 Feb 2001 12:02:31 +0000 Subject: [PATCH 1265/7878] Stop warning about apr_signal() being undeclared. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61250 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/proc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index fa27c6efad4..f5edca8cd39 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -64,6 +64,7 @@ #include "apr_lib.h" #include "apr_portable.h" #include "apr_strings.h" +#include "apr_signal.h" #include <signal.h> #include <string.h> #include <sys/wait.h> From 22c2098b98a0ee8d6037264b6d673c2e4f7d605f Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" <fielding@apache.org> Date: Sun, 18 Feb 2001 13:36:15 +0000 Subject: [PATCH 1266/7878] Moved from apr/helpers to apr/build (without changes). scandoc has been renamed to scandoc.pl default.pl has been renamed to scandoc_template.pl git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61251 13f79535-47bb-0310-9956-ffa450edef68 --- build/MakeEtags | 39 ++ build/PrintPath | 116 ++++ build/cvstodsp5.pl | 43 ++ build/dsp5tocvs.pl | 46 ++ build/make_export.awk | 54 ++ build/mkdep.sh | 12 + build/mkdir.sh | 35 + build/rules.mk.in | 168 +++++ build/scandoc.pl | 1339 +++++++++++++++++++++++++++++++++++++ build/scandoc_template.pl | 518 ++++++++++++++ 10 files changed, 2370 insertions(+) create mode 100755 build/MakeEtags create mode 100755 build/PrintPath create mode 100644 build/cvstodsp5.pl create mode 100644 build/dsp5tocvs.pl create mode 100644 build/make_export.awk create mode 100755 build/mkdep.sh create mode 100755 build/mkdir.sh create mode 100644 build/rules.mk.in create mode 100755 build/scandoc.pl create mode 100644 build/scandoc_template.pl diff --git a/build/MakeEtags b/build/MakeEtags new file mode 100755 index 00000000000..1b030a3fc03 --- /dev/null +++ b/build/MakeEtags @@ -0,0 +1,39 @@ +#!/bin/sh + +# This file illustrates how to generate a useful TAGS file via etags +# for emacs. This should be invoked from the src directory i.e.: +# > helpers/MakeEtags +# and will create a TAGS file in the src directory. + +# This script falls under the Apache License. +# See http://www.apache.org/docs/LICENSE + +# Once you have created src/TAGS in emacs you'll need to setup +# tag-table-alist with an entry to assure it finds the single src/TAGS +# file from the many source directories. Something along these lines: +# (setq tag-table-alist +# '(("/home/me/work/apache-1.3/src/" +# . "/home/me/work/apache-1.3/src/") +# )) + +# This requires a special version of etags, i.e. the +# one called "Exuberant ctags" available at: +# http://fly.hiwaay.net/~darren/ctags/ +# Once that is setup you'll need to point to the +# executable here: + +etags=~/local/bin/etags + +# Exuberant etags is necessary since it can ignore some defined symbols +# that obscure the function signatures. + +ignore=AP_DECLARE,AP_DECLARE_NONSTD,__declspec + +# Create an etags file at the root of the source +# tree, then create symbol links to it from each +# directory in the source tree. By passing etags +# absolute pathnames we get a tag file that is +# NOT portable when we move the directory tree. + +find . -name '*.[ch]' -print | $etags -I "$ignore" -L - + diff --git a/build/PrintPath b/build/PrintPath new file mode 100755 index 00000000000..68435f3744c --- /dev/null +++ b/build/PrintPath @@ -0,0 +1,116 @@ +#!/bin/sh +# Look for program[s] somewhere in $PATH. +# +# Options: +# -s +# Do not print out full pathname. (silent) +# -pPATHNAME +# Look in PATHNAME instead of $PATH +# +# Usage: +# PrintPath [-s] [-pPATHNAME] program [program ...] +# +# Initially written by Jim Jagielski for the Apache configuration mechanism +# (with kudos to Kernighan/Pike) +# +# This script falls under the Apache License. +# See http://www.apache.org/docs/LICENSE + +## +# Some "constants" +## +pathname=$PATH +echo="yes" + +## +# Find out what OS we are running for later on +## +os=`(uname) 2>/dev/null` + +## +# Parse command line +## +for args in $* +do + case $args in + -s ) echo="no" ;; + -p* ) pathname="`echo $args | sed 's/^..//'`" ;; + * ) programs="$programs $args" ;; + esac +done + +## +# Now we make the adjustments required for OS/2 and everyone +# else :) +# +# First of all, all OS/2 programs have the '.exe' extension. +# Next, we adjust PATH (or what was given to us as PATH) to +# be whitespace seperated directories. +# Finally, we try to determine the best flag to use for +# test/[] to look for an executable file. OS/2 just has '-r' +# but with other OSs, we do some funny stuff to check to see +# if test/[] knows about -x, which is the prefered flag. +## + +if [ "x$os" = "xOS/2" ] +then + ext=".exe" + pathname=`echo -E $pathname | + sed 's/^;/.;/ + s/;;/;.;/g + s/;$/;./ + s/;/ /g + s/\\\\/\\//g' ` + test_exec_flag="-r" +else + ext="" # No default extensions + pathname=`echo $pathname | + sed 's/^:/.:/ + s/::/:.:/g + s/:$/:./ + s/:/ /g' ` + # Here is how we test to see if test/[] can handle -x + testfile="pp.t.$$" + + cat > $testfile <<ENDTEST +#!/bin/sh +if [ -x / ] || [ -x /bin ] || [ -x /bin/ls ]; then + exit 0 +fi +exit 1 +ENDTEST + + if `/bin/sh $testfile 2>/dev/null`; then + test_exec_flag="-x" + else + test_exec_flag="-r" + fi + rm -f $testfile +fi + +for program in $programs +do + for path in $pathname + do + if [ $test_exec_flag $path/${program}${ext} ] && \ + [ ! -d $path/${program}${ext} ]; then + if [ "x$echo" = "xyes" ]; then + echo $path/${program}${ext} + fi + exit 0 + fi + +# Next try without extension (if one was used above) + if [ "x$ext" != "x" ]; then + if [ $test_exec_flag $path/${program} ] && \ + [ ! -d $path/${program} ]; then + if [ "x$echo" = "xyes" ]; then + echo $path/${program} + fi + exit 0 + fi + fi + done +done +exit 1 + diff --git a/build/cvstodsp5.pl b/build/cvstodsp5.pl new file mode 100644 index 00000000000..d37442735f4 --- /dev/null +++ b/build/cvstodsp5.pl @@ -0,0 +1,43 @@ +use IO::File; +use File::Find; + +chdir '..'; +find(\&tovc5, '.'); + +sub tovc5 { + + if (m|.dsp$|) { + $oname = $_; + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $oname, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|Format Version 6\.00|Format Version 5\.00|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD CPP .*)/ZI (.*)|$1/Zi $2|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD BASE CPP .*)/ZI (.*)|$1/Zi $2|) { + $verchg = -1; + } + if ($src !~ m|^# PROP AllowPerConfigDependencies|) { + print $dstfl $src; } + else { + $verchg = -1; + + } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted VC6 project " . $oname . " to VC5 in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } + } +} \ No newline at end of file diff --git a/build/dsp5tocvs.pl b/build/dsp5tocvs.pl new file mode 100644 index 00000000000..9686b43634b --- /dev/null +++ b/build/dsp5tocvs.pl @@ -0,0 +1,46 @@ +use IO::File; +use File::Find; + +chdir '..'; +find(\&tovc6, '.'); + +sub tovc6 { + + if (m|.dsp$|) { + $oname = $_; + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $_, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|Format Version 5\.00|Format Version 6\.00|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD CPP .*)/Zi (.*)|$1/ZI $2|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD BASE CPP .*)/Zi (.*)|$1/ZI $2|) { + $verchg = -1; + } + if ($src =~ s|^(!MESSAGE .*)\\\n|$1|) { + $cont = <$srcfl>; + $src = $src . $cont; + $verchg = -1; + } + print $dstfl $src; + if ($verchg && $src =~ m|^# Begin Project|) { + print $dstfl "# PROP AllowPerConfigDependencies 0\n"; + } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted VC5 project " . $oname . " to VC6 in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } + } +} diff --git a/build/make_export.awk b/build/make_export.awk new file mode 100644 index 00000000000..7d61a55fa56 --- /dev/null +++ b/build/make_export.awk @@ -0,0 +1,54 @@ +# Based on Ryan Bloom's make_export.pl + +/^#[ \t]*if(def)? (AP[RU]?_|!?defined).*/ { + if (old_filename != FILENAME) { + if (old_filename != "") printf("%s", line) + macro_no = 0 + found = 0 + count = 0 + old_filename = FILENAME + line = "" + } + macro_stack[macro_no++] = macro + macro = substr($0, length($1)+2) + count++ + line = line macro "\n" + next +} + +/^#[ \t]*endif/ { + if (count > 0) { + count-- + line = line "/" macro "\n" + macro = macro_stack[--macro_no] + } + if (count == 0) { + if (found != 0) { + printf("%s", line) + } + line = "" + } + next +} + +/^[ \t]*(AP[RU]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?([A-Za-z0-9_]+)\(/ { + if (count) { + found++ + } + for (i = 0; i < count; i++) { + line = line "\t" + } + sub("^[ \t]*(AP[UR]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?", ""); + sub("[(].*", ""); + line = line $0 "\n" + + if (count == 0) { + printf("%s", line) + line = "" + } + next +} + +END { + printf("%s", line) +} diff --git a/build/mkdep.sh b/build/mkdep.sh new file mode 100755 index 00000000000..510bdc02fbf --- /dev/null +++ b/build/mkdep.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# 1) remove everything after the DO NOT REMOVE +# 2) generate the dependencies, adding them to the end of Makefile.new +# 3) move the Makefile.new back into place +# +# Note that we use && to ensure that Makefile is not changed if an error +# occurs during the process +# +sed -ne '1,/^# DO NOT REMOVE/p' Makefile > Makefile.new \ + && gcc -MM $* | sed -e "s/\.o:/\.lo:/" >> Makefile.new \ + && mv Makefile.new Makefile diff --git a/build/mkdir.sh b/build/mkdir.sh new file mode 100755 index 00000000000..4cd33c5671c --- /dev/null +++ b/build/mkdir.sh @@ -0,0 +1,35 @@ +#!/bin/sh +## +## mkdir.sh -- make directory hierarchy +## +## Based on `mkinstalldirs' from Noah Friedman <friedman@prep.ai.mit.edu> +## as of 1994-03-25, which was placed in the Public Domain. +## Cleaned up for Apache's Autoconf-style Interface (APACI) +## by Ralf S. Engelschall <rse@apache.org> +## +# +# This script falls under the Apache License. +# See http://www.apache.org/docs/LICENSE + + +umask 022 +errstatus=0 +for file in ${1+"$@"} ; do + set fnord `echo ":$file" |\ + sed -e 's/^:\//%/' -e 's/^://' -e 's/\// /g' -e 's/^%/\//'` + shift + pathcomp= + for d in ${1+"$@"}; do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" 1>&2 + mkdir "$pathcomp" || errstatus=$? + fi + pathcomp="$pathcomp/" + done +done +exit $errstatus + diff --git a/build/rules.mk.in b/build/rules.mk.in new file mode 100644 index 00000000000..7bc932ffc85 --- /dev/null +++ b/build/rules.mk.in @@ -0,0 +1,168 @@ +# ==================================================================== +# The Apache Software License, Version 1.1 +# +# Copyright (c) 2000-2001 The Apache Software Foundation. All rights +# reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3. The end-user documentation included with the redistribution, +# if any, must include the following acknowledgment: +# "This product includes software developed by the +# Apache Software Foundation (http://www.apache.org/)." +# Alternately, this acknowledgment may appear in the software itself, +# if and wherever such third-party acknowledgments normally appear. +# +# 4. The names "Apache" and "Apache Software Foundation" must +# not be used to endorse or promote products derived from this +# software without prior written permission. For written +# permission, please contact apache@apache.org. +# +# 5. Products derived from this software may not be called "Apache", +# nor may "Apache" appear in their name, without prior written +# permission of the Apache Software Foundation. +# +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR +# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# ==================================================================== +# +# This software consists of voluntary contributions made by many +# individuals on behalf of the Apache Software Foundation. For more +# information on the Apache Software Foundation, please see +# <http://www.apache.org/>. +# + +# +# rules.mk: standard rules for APR +# + +@SET_MAKE@ + +# +# Configuration variables +# +top_builddir=@top_builddir@ + +CC=@CC@ +AWK=@AWK@ +LIBTOOL=@LIBTOOL@ + +CFLAGS=@CFLAGS@ @OPTIM@ +CPPFLAGS=@CPPFLAGS@ $(INCLUDES) +LIBS=@LIBS@ +LDFLAGS=@LDFLAGS@ + +RM=@RM@ +SHELL=@SHELL@ + +MKEXPORT=@APR_MKEXPORT@ +MKDEP=@APR_MKDEP@ +SCANDOC=@APR_SCANDOC@ + +### make LTFLAGS somewhat variable? +LTFLAGS = --silent + +# +# Basic macro setup +# +COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) +LT_COMPILE = $(LIBTOOL) --mode=compile $(LTFLAGS) $(COMPILE) -c $< && touch $@ + +LINK = $(LIBTOOL) --mode=link $(LTFLAGS) $(COMPILE) $(LDFLAGS) -o $@ + +# +# Standard build rules +# +all: all-recursive +depend: depend-recursive +clean: clean-recursive +distclean: distclean-recursive +extraclean: extraclean-recursive + +install: all-recursive + + +all-recursive depend-recursive clean-recursive distclean-recursive \ + extraclean-recursive: + @otarget=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; \ + for i in $$list; do \ + if test -d "$$i"; then \ + target="$$otarget"; \ + echo "Making $$target in $$i"; \ + if test "$$i" = "."; then \ + made_local=yes; \ + target="local-$$target"; \ + fi; \ + (cd $$i && $(MAKE) $$target) || exit 1; \ + fi; \ + done; \ + if test "$$otarget" = "all" && test -z "$(TARGETS)"; then \ + made_local=n/a; \ + fi; \ + if test -z "$$made_local"; then \ + $(MAKE) "local-$$otarget" || exit 1; \ + fi + +local-clean: x-local-clean + $(RM) -f *.o *.lo *.a *.la *.so $(CLEAN_TARGETS) $(PROGRAMS) + $(RM) -rf .libs + +local-distclean: local-clean x-local-distclean + $(RM) -f Makefile $(DISTCLEAN_TARGETS) + +local-extraclean: local-distclean + @if test -n "$(EXTRACLEAN_TARGETS)"; then \ + echo $(RM) -f $(EXTRACLEAN_TARGETS) ; \ + $(RM) -f $(EXTRACLEAN_TARGETS) ; \ + fi + +local-all: $(TARGETS) + +local-depend: + @if test -n "`ls *.c 2> /dev/null`"; then \ + echo $(MKDEP) $(CFLAGS) $(CPPFLAGS) *.c ; \ + $(MKDEP) $(CFLAGS) $(CPPFLAGS) *.c ; \ + fi + +# to be filled in by the actual Makefile +x-local-clean x-local-distclean: + + +# +# Implicit rules for creating outputs from input files +# +.SUFFIXES: +.SUFFIXES: .c .lo .o + +.c.o: + $(COMPILE) -c $< + +.c.lo: + $(LT_COMPILE) + +.PHONY: all depend clean distclean extraclean install \ + all-recursive depend-recursive clean-recursive distclean-recursive \ + extraclean-recursive + local-all local-depend local-clean local-distclean local-extraclean \ + x-local-clean x-local-distclean diff --git a/build/scandoc.pl b/build/scandoc.pl new file mode 100755 index 00000000000..13043a30660 --- /dev/null +++ b/build/scandoc.pl @@ -0,0 +1,1339 @@ +#!/usr/bin/perl +# +# ScanDoc - Version 0.12, A C/C++ Embedded Documentation Analyser +# ---------------------------------------------------------------- +# +# Distributed under the "Artistic License". See the file +# "COPYING" that accompanies the ScanDoc distribution. +# +# See http://scandoc.sourceforge.net/ for more information and +# complete documentation. +# +# (c) 1997 - 2000 Talin and others. + +require "ctime.pl"; +require "getopts.pl"; + +# 1 = on (verbose); 0 = off +$debug = 0; + +# Get the current date +$date = &ctime(time); + +# Set the default tab size +$tabSize = 4; + +$minorVersion = 12; +$majorVersion = 0; +$scandocURL = "http://scandoc.sourceforge.net/"; + +# Set up default templates +&Getopts( 'i:d:p:t:' ); + +if ($#ARGV < 0) { + die "Usage: -i <doc-template> -p <output-path> -t<tabsize> -d<sym>=<value> [ <input-files> ... ]\n"; +} + +# Read the template +if (!defined $opt_i) { + $opt_i = "default.pl"; +} +&readTemplate( $opt_i ); + +# Set the destination path. +$destPath = ""; +$destPath = $opt_p if (defined($opt_p)); + +# Set the tab size. +$tabSize = $opt_t if (defined($opt_t)); + +# Handle defines +if ($opt_d) { + foreach $def (split( /,/, $opt_d )) { + if ($def =~ /\s*(\w*)\=(.*)/) { + $${1} = $2; + } + else { + $${1} = 1; + } + } +} + +# For each input filename, parse it +while ($srcfile = shift(@ARGV)) { + + $linenumber = 0; + open( FILE, $srcfile ) || die "Can't open file $srcfile\n"; + print STDERR "Reading \"$srcfile\"\n"; + + $docTag = 'description'; + $docEmpty = 1; + $packageName = '.general'; + $author = ''; + $version = ''; + $class = 0; + $_ = ''; + + while (&parseDeclaration( '' )) {} +} + +# Collate subclasses and associate with class record. +foreach $className (keys %subclasses) { + my $class = &classRecord( $className ); + + if ($class) { + my @subs = (); + # print STDERR "$className ", join( ',', @{$subclasses{ $className }} ), "\n"; + foreach $subName ($subclasses{ $className }) { + if (&classRecord( $subName )) { + push @subs, $subName; + } + $class->{ 'subs' } = @subs; + } + } +} + +# Turn packages into objects. Special case for "default" package. +foreach $pkg (keys %packages) +{ + # print STDERR $pkg, "\n"; + bless $packages{ $pkg }, PackageRecord; + if ($pkg eq '.general') { + $packages{ $pkg }{ 'name' } = "General"; + } + else { + $packages{ $pkg }{ 'name' } = $pkg; + } + # print STDERR $packages{ $pkg }->Classes(), "\n"; +} + +# Execute template file +# print STDERR $docTemplate; # For debugging +eval $docTemplate; +print STDERR $@; + +exit; + +# ======================= Subroutines ================================ + +# Read a line of input, and remove blank lines and preprocessor directives. +sub rdln { + my ($skip_next_line) = 0; + if (defined ($_)) { + my ($previous_line) = $_; + while ( (/^(\s*|\#.*)$/ || $skip_next_line ) && ($_ = <FILE>)) { + if ($previous_line =~ m/\\\s*/) { $skip_next_line = 1; } + else { $skip_next_line = 0; } + $previous_line = $_; + $linenumber++; + if ($debug) { print STDERR "(0:$srcfile) $linenumber.\n"; } + } + } + # Dispose of Apache specific macros + removeApacheMacros(); +} + +# Don't skip "#" +sub rdln2 { + if (defined ($_)) { + while (/^(\s*)$/ && ($_ = <FILE>)) {$linenumber++; if ($debug) { print STDERR "(0:$srcfile) $linenumber.\n"; } } + } +} + +# Remove comments from current line +sub removeComment { + s|//.*||; +} + +# parsing functions +sub matchKW { &rdln; return (s/^\s*($_[0])//, $1) if defined ($_); return (0, 0); } +#sub matchStruct { &rdln; return (s/^\s*(struct|class)//, $1) if defined ($_); return (0, 0); } +#sub matchPermission { &rdln; return (s/^\s*(public|private|protected)// && $1) if defined ($_); return (0,0); } +sub matchID { &rdln; return (s/^\s*([A-Za-z_]\w*)//, $1) if defined ($_); return (0,0); } +sub matchColon { &rdln; return (s/^\s*\://) if defined ($_); return 0; } +sub matchComma { &rdln; return (s/^\s*\,//) if defined ($_); return 0; } +sub matchSemi { &rdln; return (s/^\s*\;//) if defined ($_); return 0; } +sub matchRBracket { &rdln; return (s/^\s*\{//) if defined ($_); return 0; } +sub matchLBracket { &rdln; return (s/^\s*\}//) if defined ($_); return 0; } +sub matchRParen { &rdln; return (s/^\s*\(//) if defined ($_); return 0; } +sub matchLParen { &rdln; return (s/^\s*\)//) if defined ($_); return 0; } +sub matchRAngle { &rdln; return (s/^\s*\<//) if defined ($_); return 0; } +sub matchLAngle { &rdln; return (s/^\s*\>//) if defined ($_); return 0; } +sub matchDecl { &rdln; return (s/^(\s*[\s\w\*\[\]\~\&\n\:]+)//, $1) if defined ($_); return (0, 0); } +sub matchOper { &rdln; return (s/^\s*([\~\&\^\>\<\=\!\%\*\+\-\/\|\w]*)// && $1) if defined ($_); return 0; } +sub matchFuncOper { &rdln; return (s/^\s*(\(\))// && $1) if defined ($_); return 0; } +sub matchAny { &rdln; return (s/^\s*(\S+)//, $1) if defined ($_); return (0, 0); } +sub matchChar { &rdln; return (s/^(.)//, $1) if defined ($_); return (0, 0); } +sub matchChar2 { &rdln2; return (s/^(.)//, $1) if defined ($_); return (0, 0); } +sub matchString { &rdln; return (s/^\"(([^\\\"]|(\\.)))*\"//, $1) if defined ($_); return (0, 0); } + +# Skip to next semicolon +sub skipToSemi { + + while (!&matchSemi) { + + &rdln; + s|//.*||; # Eat comments + if (&matchLBracket) { + &skipBody; + next; + } + last if !s/^\s*([^\s\{\;]+)//; + # print STDERR "$1 "; + } +} + +# Skip function body +sub skipBody { + local( $nest ); + + $nest = 1; + + for (;;) { + if (&matchRBracket) { $nest++; } + elsif (&matchLBracket) { + $nest--; + last if !$nest; + } + else { + last if ((($valid,) = &matchKW( "[^\{\}]")) && !$valid); + } + } +} + +# Skip a string. (multiline) +sub skipString { + local( $char, $lastchar); + $lastchar = "\""; + + for (;;) { + ($valid, $char) = &matchChar2; + if (($char eq "\"") && ($lastchar ne "\\")) { last; } + if ($lastchar eq "\\") { $lastchar = " "; } + else { $lastchar = $char; } + } +} + + +# Skip everything in parenthesis. +sub skipParenBody { + local( $nest ); + + $nest = 1; + + for (;;) { + if (&matchRParen) { $nest++; } + elsif (&matchLParen) { + $nest--; + last if !$nest; + } + else { + last if ((($valid,) = &matchKW( "[^\(\)]")) && !$valid); + } + } +} + +# Parse (*name) syntax +sub parseParenPointer { + if (s/^(\s*\(\s*\*)//) { + $decl .= $1; + $nest = 1; + + for (;;) { + # Preserve spaces, eliminate in-line comments + &removeComment; + while (s/^(\s+)//) { $decl .= $1; &rdln; } + + if (&matchRParen) { $nest++; $decl .= "("; } + elsif (&matchLParen) { + $decl .= ")"; + $nest--; + last if !$nest; + } + elsif ((($valid, $d) = &matchKW( "[^\(\)]*")) && $valid) { $decl .= $d; } + else { last; } + } + + # Just in case there are array braces afterwards. + while ((($valid, $d) = &matchDecl) && $valid) { $decl .= $d; } + } +} + +# Parse template arguments +sub matchAngleArgs { + + if (&matchRAngle) { + local ($args, $nest); + + $args = "&lt;"; + $nest = 1; + + for (;;) { + if (&matchRAngle) { $nest++; $args .= "&lt;"; } + elsif (&matchLAngle) { + $nest--; + $args .= "&gt;"; + last if !$nest; + } + elsif ((($valid, $d) = &matchChar) && $valid) { $args .= $d; } + else { last; } + } + return $args; + } + else { return ''; } +} + +# convert tabs to spaces +sub expandTabs { + local ($text) = @_; + local ($n); + + while (($n = index($text,"\t")) >= 0) { + substr($text, $n, 1) = " " x ($tabSize-($n % $tabSize)); + } + + return $text; +} + +# Process a line of text from a "special" comment +sub handleCommentLine { + local ($_) = @_; + + if ($docEmpty) { + # Eliminate blank lines at the head of the doc. + return if (/^\s*$/); + } + + # First, expand tabs. + $_ = &expandTabs( $_ ); + + # Remove gratuitous \s*\s (james) + s/(^|\n)\s*\*\s/$1/g; + + # If it's one of the standard tags + if (s/^\s*\@(see|package|version|author|param|return|result|exception|keywords|deffunc|defvar|heading|todo)\s*//) { + my $tag = $1; + $tag = 'return' if ($tag eq 'result'); + + # for param and exception, split the param name and the text + # seperate them with tabs. + if ($tag eq "param" || $tag eq "exception") { + s/^\s*(\w+)\s*(.*)/\t$1\t$2/; + } + elsif ($tag eq "heading") { + # 'heading' is processed by the template, if at all. + $_ = "\@heading\t$_"; + $tag = "description"; + } + elsif ($tag eq 'todo') { + if ($todolist{ $srcfile } ne '') { + $todolist{ $srcfile } .= "\n"; + } + } + + # If it's @deffunc or @defvar + if ($tag =~ /def(.*)/) { + + $type = $1; + + # @deffunc and @defvar force a comment to be written out as if there was a + # declaration. + # Designed for use with macros and other constructs I can't parse. + + if (/(\S+)\s+(.*)$/) { + $name = $1; + $decl = $2; + $dbname = &uniqueName( "$baseScope$name" ); + + my $entry = { 'type' => $type, + 'name' => $name, + 'longname'=> $name, + 'fullname'=> "$name $decl", + 'scopename'=>"$baseScope$name", + 'uname' => $dbname, + 'decl' => $decl, + 'package' => $packageName }; + + bless $entry, MemberRecord; + + if ($class) { + $entry->{ 'class' } = "$context"; + $class->{ 'members' }{ $dbname } = $entry; + } + else { + $packages{ $packageName }{ 'globals' }{ $dbname } = $entry; + } + $docTag = 'description'; + &dumpComments( $entry ); + return; + } + } + elsif ($tag eq 'package') { + s/^\s*//; + s/\s*$//; + $packageName = $_; + $docTag = 'description'; + return; + } + elsif ($tag eq 'author') { + $author = $_; + $docTag = 'description'; + return; + } + elsif ($tag eq 'version') { + $version = $_; + $docTag = 'description'; + return; + } + + $docTag = $tag; + } + elsif (/^\s*@\w+/) { + # any other line that begins with an @ should be inserted into the main + # description for later expansion. + $docTag = 'description'; + } + + # "To-do" lists are handled specially, and not associated with a class. + if ($docTag eq 'todo') { + $todolist{ $srcfile } .= $_; + return; + } + + # Append to current doc tag, regardless of whether it's a new line + # or a continuation. Also mark this doc as non-empty. + $docTags{ $docTag } .= $_; + $docEmpty = 0; + + # @see doesn't persist. + if ($docTag eq 'see') { $docTag = 'description'; } + + # print STDERR ":$_"; +} + +# Clear doc tag information at end of class or file +sub clearComments { + + $docTag = 'description'; + $docEmpty = 1; + %docTags = (); +} + +# Add doc tag information to current documented item +sub dumpComments { + local ($hashref) = @_; + + if ($docEmpty == 0) { + + if ($author ne '') { $hashref->{ 'author' } = $author; } + if ($version ne '') { $hashref->{ 'version' } = $version; } + $hashref->{ 'sourcefile' } = $srcfile; + + # Store the tags for this documentation into the global doc symbol table + foreach $key (keys %docTags) { + my $data = $docTags{ $key }; + + $data =~ s/\s*$//; + + $hashref->{ $key } = $data; + } + } + + &clearComments(); +} + +# Generate a unique name from the given name. +sub uniqueName { + local ($name) = @_; + + # Duplicate doc entries need to be distinguished, so give them a different label. + while ($docs{ $name }) { + if ($name =~ /-(\d+)$/) { + $name = $` . "-" . ($1 + 1); + } + else { $name .= "-2"; } + } + + $docs{ $name } = 1; + return $name; +} + +# Get the current class record. +sub classRecord { + local ($className) = @_; + local ($pkg) = $classToPackage{ $className }; + + if ($pkg) { + return $packages{ $pkg }{ 'classes' }{ $className }; + } + return 0; +} + +# Parse a declaration in the file +sub parseDeclaration { + + local ($context) = @_; + local ($baseScope) = ''; + local ($decl); + my ($token); + + if ($context) { $baseScope = $context . "::"; } + + &rdln; + + if (!defined ($_)) { return 0; } + + if (s|^\s*//\*\s+||) { + # Special C++ comment + &handleCommentLine( $' ); + $_ = ''; &rdln; + } + elsif (s|^\s*//||) { + # Ordinary C++ comment + $_ = ''; + &rdln; + } + elsif (s|^\s*\/\*\*\s+||) { + # Special C comments + + s/\={3,}|\-{3,}|\*{3,}//; # Eliminate banner strips + $text = ''; + $docTag = 'description'; + + # Special comment + while (!/\*\//) { &handleCommentLine( $_ ); $text .= $_; $_ = <FILE>; $linenumber++; if ($debug) { print STDERR "(1) $linenumber\n."; }} + s/\={3,}|\-{3,}|\*{3,}//; # Eliminate banner strips + /\*\//; + &handleCommentLine( $` ); + $text.= $`; $_ = $'; + } + elsif (s|^\s*\/\*||) { + # Ordinary C comment + $text = ""; + + while (!/\*\//) { $text .= $_; $_ = <FILE>; $linenumber++; if ($debug) { print STDERR "(2) $linenumber\n."; }} + /\*\//; + $text.= $`; $_ = $'; + } + elsif ((($valid, $tag) = &matchKW( "template")) && $valid) { + # Template definition + $args = &matchAngleArgs; + &rdln; + + ##$tmplParams = $args; JAMES + $result = &parseDeclaration( $context ); + ##$tmplParams = ''; JAMES + return $result; + } + elsif ((($valid, $tag) = &matchKW("class|struct")) && $valid) { + # Class or structure definition + local ($className,$class); + + if ((($valid, $className) = &matchID) && $valid) { + + return 1 if (&matchSemi); # Only a struct tag + + # A class instance + if ((($valid,)=&matchID) && $valid) { + &matchSemi; + return 1; + } + + my $fullName = "$baseScope$className"; ##$tmplParams"; JAMES + # print STDERR "CLASS $fullName\n"; + + my @bases = (); + + if (&matchColon) { + + for (;;) { + my $p; + &matchKW( "virtual" ); + $perm = "private"; + if ((($valid, $p) = &matchKW( "public|private|protected" )) && $valid) { $perm = $p; } + &matchKW( "virtual" ); + + last if !( (($valid, $base) = &matchID) && $valid ); + + push @bases, $base; + push @{ $subclasses{ $base } }, $fullName; + # print STDERR " : $perm $base\n"; + last if !&matchComma; + } + } + + # print STDERR "\n"; + # print STDERR "parsing class $fullName\n"; + + if ($docEmpty == 0) { + $class = { 'type' => $tag, + 'name' => $fullName, + 'longname'=> "$tag $className", + 'fullname'=> "$tag $className", + 'scopename'=> "$tag $fullName", + 'uname' => $fullName, + 'bases' => \@bases, + 'package' => $packageName, + 'members' => {} }; + + # print STDERR "$className: @bases\n"; + + bless $class, ClassRecord; + + print STDERR " parsing class $fullName\n"; + # $classToPackage{ $className } = $packageName; + $classToPackage{ $fullName } = $packageName; + # $classList{ $className } = $class; + $classList{ $fullName } = $class; + $packages{ $packageName }{ 'classes' }{ $fullName } = $class; + &dumpComments( $class ); + } + + if (&matchRBracket) { + local ($perm) = ("private"); + + while (!&matchLBracket) { + my $p; + if ((($valid, $p) = &matchKW( "public\:|private\:|protected\:" )) && $valid) { + $perm = $p; + } + else { + &parseDeclaration( $fullName ) + || die "Unmatched brace! line = $linenumber\n"; + } + } + + &matchSemi; + } + + &clearComments; + } + } + elsif ( ((($valid,)=&matchKW( "enum")) && $valid) || ((($valid,)=&matchKW( "typedef" )) && $valid)) { + &skipToSemi; + } + elsif ((($valid,)=&matchKW( "friend\s*class" )) && $valid) { + &skipToSemi; + } + elsif ((($valid, $token) = &matchKW("extern\\s*\\\"C\\\"")) && $valid) { + &matchRBracket; + while (!&matchLBracket) { + &parseDeclaration( '' ) || die "Unmatched brace! line = $linenumber\n"; + } + &matchSemi; + } + # elsif ($kw = &matchID) { + # $type = "$kw "; + # + # if ($kw =~/virtual|static|const|volatile/) { + # $type .= &typ; + # } + # } + elsif ((($valid, $decl) = &matchDecl) && $valid) { + my ($instanceClass) = ""; + + # print STDERR "DECLARATION=$decl, REST=$_, baseScope=$baseScope\n"; + + return 1 if ($decl =~ /^\s*$/); + + if (!($class)) { + if ($decl =~ s/(\S*\s*)(\S+)\:\:(\S+)\s*$/$1$3/) { + $instanceClass = $2; + } + } + + # Eliminate in-line comments + &removeComment; + + # Check for multi-line declaration + while ((($valid, $d) = &matchDecl) && $valid) { $decl .= $d; } + + # Handle template args, but don't let operator overloading confuse us! + $tempArgs = ''; + if (!($decl =~ /\boperator\b/) && ($tempArgs = &matchAngleArgs)) { + $tempArgs = $decl . $tempArgs; + $decl = ''; + while ((($valid, $d) = &matchDecl) && $valid) { $decl .= $d; } + } + + # Look for (*name) syntax + &parseParenPointer; + + # Special handling for operator... syntax + $oper = ""; + if ($decl =~ s/\boperator\b(.*)/operator/) { + $oper = $1; + $oper .= &matchOper; + # If, after all that there's no opers, then try a () operator + if (!($oper =~ /\S/)) { $oper .= &matchFuncOper; } + } + + ($type,$mod,$decl) = $decl =~ /([\s\w]*)([\s\*\&]+\s?)(\~?\w+(\[.*\])*)/; + + $type = $tempArgs . $type; + $decl .= $oper; + + if ($mod =~ /\s/) { $type .= $mod; $mod = ""; } + + for (;;) { + + # print STDERR "Looping: $type/$mod/$decl\n"; + + if (&matchRParen) { + $nest = 1; + $args = ""; + + for (;;) { + # print STDERR "Argloop $_\n"; + + # Process argument lists. + + # Preserve spaces, eliminate in-line comments + # REM: Change this to save inline comments and automatically + # generate @param clauses + s|//.*||; + while (s/^(\s+)//) { $args .= " "; &rdln; } + + if (&matchRParen) { $nest++; $args .= "("; } + elsif (&matchLParen) { + $nest--; + last if !$nest; + $args .= ")"; + } + elsif ((($valid, $d) = &matchKW( "[\,\=\.\:\-]" )) && $valid) { $args .= $d; } + elsif ((($valid, $d) = &matchDecl) && $valid) { $args .= $d; } + elsif ((($valid, $d) = &matchAngleArgs) && $valid) { $args .= $d; } + elsif ((($valid, $d) = &matchString) && $valid) { $args .= "\"$d\""; } + else { last; } + } + + # print STDERR "$type$mod$baseScope$decl($args);\n"; + + &matchKW( "const" ); + + # Search for any text within the name field + # if ($docTag && $decl =~ /\W*(~?\w*).*/) + if ($docEmpty == 0) { + $type =~ s/^\s+//; + $mod =~ s/\&/\&amp;/g; + $args =~ s/\&/\&amp;/g; + $args =~ s/\s+/ /g; + $dbname = &uniqueName( "$baseScope$decl" ); + + my $entry = { 'type' => 'func', + 'name' => $decl, + 'longname'=> "$decl()", + 'fullname'=> "$type$mod$decl($args)", + 'scopename'=>"$type$mod$baseScope$decl($args)", + 'uname' => $dbname, + 'decl' => "$type$mod$decl($args)", + 'package' => $packageName }; + + bless $entry, MemberRecord; + + if ($class) { + $entry->{ 'class' } = "$context"; + $class->{ 'members' }{ $dbname } = $entry; + } + elsif ($instanceClass) { + $class = &classRecord ($instanceClass); + if (!($class)) { + print STDERR "WARNING: Skipping \"$instanceClass\:\:$decl\". Class \"$instanceClass\" not declared ($linenumber).\n"; + } else { + $entry->{ 'class' } = "$instanceClass"; + $class->{ 'members' }{ $dbname } = $entry; + $class = 0; + } + } + else { + $packages{ $packageName }{ 'globals' }{ $dbname } = $entry; + } + &dumpComments( $entry ); + } + else { &clearComments; } + + s|//.*||; + + # Constructor super-call syntax + if (&matchColon) { + + # Skip over it. + for (;;) { + &rdln; + last if /^\s*(\{|\;)/; + last if !((($valid,)=&matchAny) && $valid); + } + } + + last if &matchSemi; + if (&matchRBracket) { &skipBody; last; } + last if !&matchComma; + last if !((($valid, $decl) = &matchDecl) && $valid); + + # Look for (*name) syntax + &parseParenPointer; + + $decl =~ s/^\s*//; + $oper = ""; + if ($decl =~ /\boperator\b/) { + $decl =~ s/\boperator\b(.*)/operator/; + $oper = $1 . &matchOper; + } + ($mod,$d) = $decl =~ /^\s*([\*\&]*)\s*(\~?\w+(\[.*\])*)/; + $decl .= $oper; + $decl = $d if $d ne ""; + } + else { + s|//.*||; + + $final = 0; + + if ((($valid,)=&matchKW( "\=" )) && $valid) { + for (;;) { + + if (&matchRBracket) { + &skipBody; + $final = 1; + last; + } + + if (&matchSemi) { + $final = 1; + last; + } + + # var = new ... (...) + if ((($valid,)=&matchKW("new")) && $valid) { + &matchKW("[A-Za-z_0-9 ]*"); + if (&matchRParen) { + &skipParenBody; + } + } + + # var = (.....) ... + if (&matchRParen) { + &skipParenBody; + } + + # var = ... * ... + &matchKW ("[\/\*\-\+]*"); + + # var = "..." + if ((($valid,) = &matchKW ("[\"]")) && $valid) { + &skipString; + } + #&matchString; + + last if /^\s*,/; + #last if !((($valid,)=&matchAny) && $valid); + last if !((($valid,)=&matchKW("[A-Za-z_0-9 \-]*")) && $valid); + if (&matchSemi) { + $final = 1; + last; + } + } + } + + s|//.*||; + + # void ~*&foo[]; + # void foo[]; + # void far*foo[]; + # print STDERR "Decl: $type$mod$baseScope$decl;\n"; + + # Search for any text within the name field + if ($docEmpty == 0 && ($decl =~ /\W*(~?\w*).*/)) + { + $mod =~ s/\&/\&amp;/g; + $name = $decl; + + $dbname = &uniqueName( "$baseScope$1" ); + + my $entry = { 'type' => 'var', + 'name' => $1, + 'longname' => "$name", + 'fullname' => "$type$mod$decl", + 'scopename'=> "$baseScope$type$mod$decl", + 'uname' => $dbname, + 'decl' => "$type$mod$decl", + 'package' => $packageName }; + + bless $entry, MemberRecord; + + if ($class) { + $entry->{ 'class' } = "$context"; + $class->{ 'members' }{ $dbname } = $entry; + } + else { + $packages{ $packageName }{ 'globals' }{ $dbname } = $entry; + } + &dumpComments( $entry ); + } + else { &clearComments; } + + last if $final; + last if &matchSemi; + last if !&matchComma; + last if !((($valid, $decl) = &matchDecl) && $valid); + + # Look for (*name) syntax + &parseParenPointer; + + $decl =~ s/^\s*//; + ($mod,$d) = $decl =~ /^\s*([\*\&]*)(\~?\w+(\[.*\])*)/; + $decl = $d if $d ne ""; + } + } + } + elsif ($context ne "" && /^\s*\}/) { + # print STDERR "Popping!\n"; + return 1; + } + elsif (&matchRBracket) { + &skipBody; + } + elsif ((($valid, $token) = &matchAny) && $valid) { + # Comment in for debugging + # print STDERR "token: $token \n"; + } + else { return 0; } + + return 1; +} + +# read a file into a string ( filename, default-value ) +sub readFile { + local ( $filename, $result ) = @_; + + if ($filename && open( FILE, $filename )) { + $result = ""; + while (<FILE>) { $result .= $_; } + close( FILE ); + } + return $result; +} + +# Read the entire document template and translate into PERL code. +sub readTemplate { + local ( $filename ) = @_; + $docTemplate = ''; + $indent = ''; + $literal = 1; # We're in literal mode. + + if (!-e $filename) { + if (-e "./templates/$filename") { $filename = "./templates/$filename"; } + elsif (-e "../templates/$filename") { $filename = "../templates/$filename"; } + else { die "Could not find template '$filename'.\n"; } + } + + open( FILE, $filename ) || die "Error opening '$filename'.\n"; + while (<FILE>) { + last if (/END/); + + # if we found a code entry. + for (;;) { + &expandTabs( $_ ); + if ($literal) { + # Check for beginning of code block. + if (s/^(.*)\<\<//) { + $line = $1; + if (substr( $line, 0, length( $indent ) ) eq $indent) { + substr( $line, 0, length( $indent ) ) = ''; + } + + if ($line ne '') { + $line =~ s/\"/\\\"/g; + $line =~ s/\$\((\w+)\.(\w+)\)/\" \. \$$1->$2() \. \"/g; + $docTemplate .= "${indent}print\"$line\";"; + } + # else { $docTemplate .= "\n"; } + $literal = 0; + } + else { + if (substr( $_, 0, length( $indent ) ) eq $indent) { + substr( $_, 0, length( $indent ) ) = ""; + } + chop; + s/\"/\\\"/g; + s/\$\((\w+)\.(\w+)\)/\" \. \$$1->$2() \. \"/g; + $_ = $indent . "print \"" . $_ . "\\n\";\n"; + last; + } + } + else { + # Check for beginning of literal block. + if (s/^(\s*)\>\>//) { + $indent = $1; + $literal = 1; + } + elsif (s/^(\s*)(.*)\>\>//) { + $docTemplate .= "$indent$2"; + $literal = 1; + } + else { + last; + } + } + } + + $docTemplate .= $_; + } + close( FILE ); + # print $docTemplate; +} + +# Functions intended to be called from doc template file. + +# Open a new output file +sub file { + my $mfile = $_[ 0 ]; + + open( STDOUT, ">$destPath$mfile" ) || die "Error writing to '$mfile'\n"; +} + +# return list of package objects +sub packages { + my ($p, @r); + @r = (); + + foreach $p (sort keys %packages) { + push @r, $packages{ $p }; + } + return @r; +} + +# return list of source files which have to-do lists +sub todolistFiles { + my ($p, @r); + @r = (); + + foreach $p (sort keys %todolist) { + push @r, $p; + } + return @r; +} + +# return list of tab-delimited to-do-list texts. +sub todolistEntries { + local $_ = $todolist{ $_[0] }; + s/^\s+//; # Remove whitespace from beginning + s/\s+$/\n/; # Remove whitespace from end + return split( /\n/, $_ ); +} + +# Convert package name to URL. +sub packageURL { + my $p = $_[0]; + + if ($p eq 'General') { $p = '.general'; } + if ($p eq '') { $p = '.general'; } + + if (ref $packages{ $p }) { + return $packages{ $p }->url(); + } + return 0; +} + +# Get the see-also list for an object +sub seealsoList { + my $self = shift; + my ($see, $name, $url, $p, @r); + @r = (); + + if (defined ($self->{ 'see' })) { + foreach $_ (split(/\n/,$self->{ 'see' })) { + + if (/^\<a\s+href/) { # if already an HREF. + $name = $_; + $url = 0; + } + elsif (/([^\#]*)\#(.*)/) { # If a package name is present + $url = &packageURL( $1 ) . '#' . $2; + $name = $2; + } + else { + $name = $_; + $url = "#$_"; + + # This doesn't appear to do anything - so I commented it. (james) + # Look up the package in the index and use it to construct the html filename. + #if (/^([^\:]*)\:\:(.*)/) { + # $className = ($1 eq '') ? '' : $classToPackage{ $1 }; + # $p = $packageToFile{ $className }; + # if ($p ne '') { + # $url = &packageURL( $1 ) . '#' . $_; + # } + #} + } + + $url =~ s/^\:*//; # Remove leading colons from name + $url =~ s/::/-/g; # Replace :: with dash + + my $entry = { 'name' => $name, + 'url' => $url }; + + bless $entry, DocReference; + + push @r, $entry; + } + } + return @r; +} + +sub removeApacheMacros { +# print "removing from $_"; + s|AP_DECLARE\((.*?)\)|$1|; +} + +# Class for parsed package +package PackageRecord; + +sub classes { + my $self = shift; + my $classes = $self->{ 'classes' }; + return map $classes->{ $_ }, (sort keys %$classes); +} + +sub globals { + my $self = shift; + my $globals = $self->{ 'globals' }; + return map $globals->{ $_ }, (sort keys %$globals); +} + +sub globalvars { + my $self = shift; + my $globals = $self->{ 'globals' }; + my ($p, @r); + @r = (); + + foreach $p (sort keys %$globals) { + my $m = $globals->{ $p }; + if ($m->{ 'type' } ne 'func') { push @r, $m; } + } + return @r; +} + +sub globalfuncs { + my $self = shift; + my $globals = $self->{ 'globals' }; + my ($p, @r); + @r = (); + + foreach $p (sort keys %$globals) { + my $m = $globals->{ $p }; + if ($m->{ 'type' } eq 'func') { push @r, $m; } + } + return @r; +} + +sub name { + my $self = shift; + return $self->{ 'name' }; +} + +sub url { + my $self = shift; + return "default-pkg.html" if ($self->{ 'name' } eq '.general'); + return $self->{ 'name' } . '.html'; +} + +sub anchor { + my $self = shift; + my $url = $self->{ 'name' }; + return $url; +} + +# Class for parsed class +package ClassRecord; + +sub keywords { return ${$_[0]}{ 'keywords' }; } +sub author { return ${$_[0]}{ 'author' }; } +sub version { return ${$_[0]}{ 'version' }; } +sub name { return ${$_[0]}{ 'name' }; } +sub longname { return ${$_[0]}{ 'longname' }; } +sub fullname { return ${$_[0]}{ 'fullname' }; } +sub scopename { return ${$_[0]}{ 'scopename' }; } +sub sourcefile { return ${$_[0]}{ 'sourcefile' }; } +#sub description { return &::processDescription( ${$_[0]}{ 'description' } ); } +sub description { return ${$_[0]}{ 'description' }; } +sub seealso { &::seealsoList( $_[0] ); } + +sub url { + my $self = shift; + return 0 unless $self->{ 'package' }; + my $pname = ::packageURL( $self->{ 'package' } ); + my $url = $self->{ 'uname' }; + $url =~ s/::/-/g; + return "$pname#$url"; +} + +sub anchor { + my $self = shift; + my $url = $self->{ 'uname' }; + $url =~ s/::/-/g; + return $url; +} + +sub members { + my $self = shift; + my $members = $self->{ 'members' }; + my ($p, @r); + @r = (); + + foreach $p (sort keys %$members) { + push @r, $members->{ $p }; + } + return @r; +} + +sub membervars { + my $self = shift; + my $members = $self->{ 'members' }; + my ($p, @r); + @r = (); + + foreach $p (sort keys %$members) { + my $m = $members->{ $p }; + if ($m->{ 'type' } ne 'func') { push @r, $m; } + } + return @r; +} + +sub memberfuncs { + my $self = shift; + my $members = $self->{ 'members' }; + my ($p, @r); + @r = (); + + foreach $p (sort keys %$members) { + my $m = $members->{ $p }; + if ($m->{ 'type' } eq 'func') { push @r, $m; } + } + return @r; +} + +sub baseclasses { + my $self = shift; + my $bases = $self->{ 'bases' }; + my ($p, $class, @r); + @r = (); + + foreach $p (@$bases) { + + unless ($class = $::classList{ $p }) { + # It's one we don't know about, so just make something up + $class = { 'name' => $p, + 'longname'=> "class $p", + 'fullname'=> "class $p", + 'scopename'=>"class $p", + 'uname' => $p, + 'members' => {} }; + + if ($::classToPackage{ $p }) { + $class->{ 'package' } = $::classToPackage{ $p }; + } + + bless $class, ClassRecord; + } + push @r, $class; + } + return @r; +} + +sub subclasses { + my $self = shift; + my $subs; + my ($p, $class, @r); + @r = (); + + if (defined ($self->{ 'subs' })) { + $subs = $self->{ 'subs' }; + foreach $p (sort @$subs) { + $class = $::classList{ $p }; + push @r, $class; + } + } + return @r; +} + +# Class for parsed class member or global +package MemberRecord; + +sub type { return ${$_[0]}{ 'type' }; } +sub keywords { return ${$_[0]}{ 'keywords' }; } +sub author { return ${$_[0]}{ 'author' }; } +sub version { return ${$_[0]}{ 'version' }; } +sub name { return ${$_[0]}{ 'name' }; } +sub longname { return ${$_[0]}{ 'longname' }; } +sub fullname { return ${$_[0]}{ 'fullname' }; } +sub scopename { return ${$_[0]}{ 'scopename' }; } +sub returnValue { return ${$_[0]}{ 'return' }; } +sub sourcefile { return ${$_[0]}{ 'sourcefile' }; } +sub description { return ${$_[0]}{ 'description' }; } +sub seealso { &::seealsoList( $_[0] ); } + +sub url { + my $self = shift; + return 0 unless $self->{ 'package' }; + my $pname = ::packageURL( $self->{ 'package' } ); + my $url = $self->{ 'uname' }; + $url =~ s/::/-/g; + return "$pname#$url"; +} + +sub anchor { + my $self = shift; + my $url = $self->{ 'uname' }; + $url =~ s/::/-/g; + $url; +} + +sub params { + my $self = shift; + my $params = $self->{ 'param' }; + my @r; + @r = (); + + return 0 unless ($params); + + my @paramList = split( /\t/, $params ); + + for ($i = 1; $i < $#paramList; $i += 2) { + my $entry = { 'name' => $paramList[ $i ], + 'description' => $paramList[ $i + 1 ] }; + + bless $entry, ArgRecord; + + push @r, $entry; + } + return @r; +} + +sub exceptions { + my $self = shift; + my $params = $self->{ 'exception' }; + my @r; + @r = (); + + return 0 unless ($params); + + my @paramList = split( /\t/, $params ); + + for ($i = 1; $i < $#paramList; $i += 2) { + my $entry = { 'name' => $paramList[ $i ], + 'description' => $paramList[ $i + 1 ] }; + + bless $entry, ArgRecord; + + push @r, $entry; + } + return @r; +} + +package ArgRecord; +sub name { return ${$_[0]}{ 'name' }; } +sub description { return ${$_[0]}{ 'description' }; } + +package DocReference; +sub name { return ${$_[0]}{ 'name' }; } +sub url { return ${$_[0]}{ 'url' }; } diff --git a/build/scandoc_template.pl b/build/scandoc_template.pl new file mode 100644 index 00000000000..f260cd5d38d --- /dev/null +++ b/build/scandoc_template.pl @@ -0,0 +1,518 @@ +<< +# Scandoc template file. +# +# This is an example set of templates that is designed to create several +# different kinds of index files. It generates a "master index" which intended +# for use with a frames browser; A "package index" which is the root page of +# the index, and then "package files" containing documentation for all of the +# classes within a single package. + +###################################################################### + +## For quick and superficial customization, +## simply change these variables + +$project_name = '[Apache Portable RunTime]'; +#$company_logo = '<img src="../images/ScanDocBig.jpg">'; # change this to an image tag. +$copyright = '&copy 2000 [Apache Software Foundation]'; +$image_directory = "../images/"; +$bullet1_image = $image_directory . "ball1.gif"; +$bullet2_image = $image_directory . "ball2.gif"; +$bgcolor1 = "#FFFFFF"; +$bgcolor2 = "#FFFFFF"; + +###################################################################### + +## Begin generating frame index file. + +file "index.html"; +>><html> + <head> + <meta http-equiv="Content-Type" content="text/html; iso-8859-1"> + <title>$project_name</title> + </head> + <frameset cols="190,*"> + <frame src="master.html" name="Master Index" noresize> + <frame src="packages.html" name="Documentation"> + <noframes> + <body bgcolor="$bgcolor2" stylesrc="index.html"> + <p>Some Documentation</p> + </body> + + + +<< + +###################################################################### + +## Begin generating master index file (left-hand frame). + +file "master.html"; +>> + + Master Index + + +
    +

    + Master Index +

    +

    + + +<< + +## For each package, generate an index entry. + +foreach $p (packages()) { + $_ = $p->url; + s/\s/_/g; + >>$(p.name)
    +

    + << + foreach $e ($p->classes()) { + $_ = $e->url; + s/\s/_/g; + >>
  • $(e.fullname) + << + } + foreach $e ($p->globals()) { + $_ = $e->url; + s/\s/_/g; + >>
  • $(e.fullname) + << + } + >>
  • << +} + +>> + To-Do List
    +
    +
    +

    + + +<< + +###################################################################### + +## Begin generating package index file + +file "packages.html"; +>> + + $project_name -- Packages + + + +
    $company_logo +

    Documentation for $project_name

    +
    +

    Package List

    +<< + +## For each package, generate an index entry. + +foreach $p (packages()) { + $_ = $p->url; + s/\s/_/g; + >>$(p.name)
    + << +} + +>> +

    +


    + $copyright
    + Generated by ScanDoc $majorVersion.$minorVersion
    + Last Updated: $date
    + + + +<< + +###################################################################### + +## Generate "To-do list" + +file "to-do.html"; +>> + + $project_name -- To-Do list + + + + $company_logo + +

    To-do list for $project_name

    +<< + +if (&todolistFiles()) { + >>

    + << + foreach $f (&todolistFiles()) { + my @m = &todolistEntries( $f ); + if ($f =~ /([^\/]+)$/) { $f = $1; } + >>$f:

      + << + foreach $text (@m) { + if ($text) { + print "
    • ", &processDescription( $text ), "\n"; + } + } + >>
    + << + } +} + +>> +
    + $copyright
    + Generated by ScanDoc $majorVersion.$minorVersion
    + Last Updated: $date
    + + +<< + +###################################################################### + +## Generate individual files for each package. + +my $p; +foreach $p (packages()) { + $_ = $p->name; + s/\s/_/g; + file $_ . ".html"; + >> + + $project_name -- $(p.name) + + +
    + $project_name +

    +

    + +

    Package Name: $(p.name)

    + +<< + +## Generate class and member index at the top of the file. + +foreach $c ($p->classes()) { + $_ = $c->url; + s/\s/_/g; + >>

    + $(c.fullname)

    +
      + << + foreach $m ($c->members()) { + $_ = $m->url; + s/\s/_/g; + >>
    • $(m.longname) + << + } + >>
    + << +} + +>> +
    +<< + +## Generate detailed class documentation +foreach $c ($p->classes()) { + ## Output searchable keyword list + if ($c->keywords()) { + print "\n"; + } + + >>
    + +

    $(c.fullname)

    + + + + + << + + # Output author tag + if ($c->author()) { + >><< + >><< + } + + # Output package version + if ($c->version()) { + >><< + >><< + } + + # Output Source file + if ($c->sourcefile()) { + >><< + >><< + } + + # Output base class list + if ($c->baseclasses()) { + >> + + << + } + + # Output subclasses list + if ($c->subclasses()) { + >> + << + } + + # Output main class description + >> +
    +
    Author:$(c.author)
    Version:$(c.version)
    Source:$(c.sourcefile)
    Base classes:<< + my @t = (); + foreach $b ($c->baseclasses()) { + my $name = $b->name(); + if ($url = $b->url()) { + $_ = $url; + s/\s/_/g; + push @t, "$name"; + } + else { push @t, $name; } + } + print join( ', ', @t ); + >>
    Subclasses:<< + my @t = (); + foreach $s ($c->subclasses()) { + my $name = $s->name(); + if ($url = $s->url()) { + $_ = $url; + s/\s/_/g; + push @t, "$name"; + } + else { push @t, $name; } + } + print join( ', ', @t ); + >>
    +

    + << + print &processDescription( $c->description() ); + + # Output "see also" information + if ($c->seealso()) { + >>

    See Also
    + << + my @r = (); + foreach $a ($c->seealso()) { + my $name = $a->name(); + if ($url = $a->url()) { + $_ = $url; + s/\s/_/g; + push @r, "$name"; + } + else { push @r, $name; } + } + print join( ',', @r ); + >>

    + << + } + + # Output class member index + if ($c->members()) { + print "

    Member Index

    \n"; + print "
      "; + foreach $m ($c->members()) { + $_ = $m->url; + s/\s/_/g; + >>
    • $(m.fullname) + << + } + >>
    << + } + + # Output class member variable documentation + if ($c->membervars()) { + print "

    Class Variables

    \n"; + print "
    \n"; + foreach $m ($c->membervars()) { &variable( $m ); } + print "
    \n"; + } + + # Output class member function documentation + if ($c->memberfuncs()) { + print "

    Class Methods

    \n"; + print "
    \n"; + foreach $m ($c->memberfuncs()) { &function( $m ); } + print "
    \n"; + } +} + +# Output global variables +if ($p->globalvars()) { + >>

    Global Variables

    +
    + << + foreach $m ($p->globalvars()) { &variable( $m ); } + print "
    \n"; +} + +# Output global functions +if ($p->globalfuncs()) { + >>

    Global Functions

    +
    + << + foreach $m ($p->globalfuncs()) { &function( $m ); } + print "
    \n"; +} + +>> +
    + $copyright
    + Generated by ScanDoc $majorVersion.$minorVersion
    + Last Updated: $date
    + + +<< +} # end of foreach (packages) loop + +###################################################################### + +## Subroutine to generate documentation for a member function or global function + +sub function { + local ($f) = @_; + + if ($f->keywords()) { + >> + << + } + >> + +
    +
    + $(f.fullname); +
    + << + print &processDescription( $f->description() ); + >> +

    + << + if ($f->params()) { + >> +
    Parameters
    + + << + foreach $a ($f->params()) { + >> + << + } + >>
    + $(a.name)<< + print &processDescription( $a->description() ); + >>
    + << + } + + if ($f->returnValue()) { + >>
    Return Value +
    << + print &processDescription( $f->returnValue() ); + >>

    << + } + + if ($f->exceptions()) { + >>

    Exceptions
    + + << + foreach $a ($f->exceptions()) { + >> + << + } + >>

    + $(a.name)<< + print &processDescription( $a->description() ); + >>

    + << + } + + if ($f->seealso()) { + >>
    See Also
    + << + my @r = (); + foreach $a ($f->seealso()) { + my $name = $a->name(); + if ($url = $a->url()) { + $_ = $url; + s/\s/_/g; + push @r, "$name"; + } + else { push @r, $name; } + } + print join( ',', @r ); + >>

    << + } + >>

    + << +} + +###################################################################### + +## Subroutine to generate documentation for a member variable or global variable. + +sub variable { + local ($v) = @_; + + if ($v->keywords()) { + print ""; + } + + >> + +
    + $(v.fullname); +
    + <description() );>> +

    + << + if ($v->seealso()) { + >>
    See Also
    + << + $comma = 0; + foreach $a ($v->seealso()) { + $_ = $a->url; + s/\s/_/g; + if ($comma) { print ","; } + $comma = 1; + >>$(a.name) + << + } + >>

    + << + } + >>

    + << +} + +###################################################################### + +sub processDescription { + local ($_) = @_; + + # handle HTML markup issues. + s//>/g; + + s/^\s+//; # Remove whitespace from beginning + s/\s+$/\n/; # Remove whitespace from end + s/\n\n/

    \n/g; # Replace multiple CR's with paragraph markers + s:\@heading(.*)\n:

    $1

    :; # Handle heading text + + # Handle embedded image tags + s:\@caution:

    :; + s:\@warning:

    :; + s:\@bug:

    :; + s:\@tip:

    :; + + return $_; +} From bb4ff6baafc597008fb53a19de6023ca948f6f6e Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sun, 18 Feb 2001 13:43:28 +0000 Subject: [PATCH 1267/7878] Fix some old comments. Why is this file here? It should be a make target. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61252 13f79535-47bb-0310-9956-ffa450edef68 --- build/MakeEtags | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build/MakeEtags b/build/MakeEtags index 1b030a3fc03..c4e957c97f2 100755 --- a/build/MakeEtags +++ b/build/MakeEtags @@ -1,19 +1,19 @@ #!/bin/sh # This file illustrates how to generate a useful TAGS file via etags -# for emacs. This should be invoked from the src directory i.e.: -# > helpers/MakeEtags -# and will create a TAGS file in the src directory. +# for emacs. This should be invoked from the top source directory i.e.: +# > build/MakeEtags +# and will create a TAGS file in the top source directory. # This script falls under the Apache License. # See http://www.apache.org/docs/LICENSE -# Once you have created src/TAGS in emacs you'll need to setup -# tag-table-alist with an entry to assure it finds the single src/TAGS +# Once you have created ./TAGS in emacs you'll need to setup +# tag-table-alist with an entry to assure it finds the single ./TAGS # file from the many source directories. Something along these lines: # (setq tag-table-alist -# '(("/home/me/work/apache-1.3/src/" -# . "/home/me/work/apache-1.3/src/") +# '(("/home/me/work/httpd-2.0/" +# . "/home/me/work/httpd-2.0/") # )) # This requires a special version of etags, i.e. the From 4964706705e4077897a0d171cfd2998222715e50 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sun, 18 Feb 2001 13:51:07 +0000 Subject: [PATCH 1268/7878] Moved from apr/helpers to apr/build (without changes). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61253 13f79535-47bb-0310-9956-ffa450edef68 --- build/.cvsignore | 3 ++ build/install.sh | 112 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 build/.cvsignore create mode 100755 build/install.sh diff --git a/build/.cvsignore b/build/.cvsignore new file mode 100644 index 00000000000..62437018a1f --- /dev/null +++ b/build/.cvsignore @@ -0,0 +1,3 @@ +ltconfig +ltmain.sh +rules.mk diff --git a/build/install.sh b/build/install.sh new file mode 100755 index 00000000000..9a8821fa290 --- /dev/null +++ b/build/install.sh @@ -0,0 +1,112 @@ +#!/bin/sh +## +## install.sh -- install a program, script or datafile +## +## Based on `install-sh' from the X Consortium's X11R5 distribution +## as of 89/12/18 which is freely available. +## Cleaned up for Apache's Autoconf-style Interface (APACI) +## by Ralf S. Engelschall +## +# +# This script falls under the Apache License. +# See http://www.apache.org/docs/LICENSE + + +# +# put in absolute paths if you don't have them in your path; +# or use env. vars. +# +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" + +# +# parse argument line +# +instcmd="$mvprog" +chmodcmd="" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +ext="" +src="" +dst="" +while [ "x$1" != "x" ]; do + case $1 in + -c) instcmd="$cpprog" + shift; continue + ;; + -m) chmodcmd="$chmodprog $2" + shift; shift; continue + ;; + -o) chowncmd="$chownprog $2" + shift; shift; continue + ;; + -g) chgrpcmd="$chgrpprog $2" + shift; shift; continue + ;; + -s) stripcmd="$stripprog" + shift; continue + ;; + -S) stripcmd="$stripprog $2" + shift; shift; continue + ;; + -e) ext="$2" + shift; shift; continue + ;; + *) if [ "x$src" = "x" ]; then + src=$1 + else + dst=$1 + fi + shift; continue + ;; + esac +done +if [ "x$src" = "x" ]; then + echo "install.sh: no input file specified" + exit 1 +fi +if [ "x$dst" = "x" ]; then + echo "install.sh: no destination specified" + exit 1 +fi + +# +# If destination is a directory, append the input filename; if +# your system does not like double slashes in filenames, you may +# need to add some logic +# +if [ -d $dst ]; then + dst="$dst/`basename $src`" +fi + +# Add a possible extension (such as ".exe") to src and dst +src="$src$ext" +dst="$dst$ext" + +# Make a temp file name in the proper directory. +dstdir=`dirname $dst` +dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name +$instcmd $src $dsttmp + +# And set any options; do chmod last to preserve setuid bits +if [ "x$chowncmd" != "x" ]; then $chowncmd $dsttmp; fi +if [ "x$chgrpcmd" != "x" ]; then $chgrpcmd $dsttmp; fi +if [ "x$stripcmd" != "x" ]; then $stripcmd $dsttmp; fi +if [ "x$chmodcmd" != "x" ]; then $chmodcmd $dsttmp; fi + +# Now rename the file to the real destination. +$rmcmd $dst +$mvcmd $dsttmp $dst + +exit 0 + From 6270c7b9365f82a2fa4c862d0e2ffbcaaf076a5b Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sun, 18 Feb 2001 15:52:12 +0000 Subject: [PATCH 1269/7878] Enable use of the new build directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61254 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 10 ++++++++++ Makefile.in | 4 +++- build/rules.mk.in | 9 +++++---- buildconf | 4 ++-- configure.in | 23 ++++++++++------------- shmem/unix/mm/configure.in | 2 +- 6 files changed, 31 insertions(+), 21 deletions(-) diff --git a/CHANGES b/CHANGES index ec074d926ce..d4a4433cc55 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,15 @@ Changes with APR b1 + *) Changed apr/helpers to apr/build to be consistent with other Apache + source trees. Added make variables to rules.mk.in that point to the + builders directory and its scripts. Updated buildconf, configure.in, + and Makefile.in files to create and use the new scripts. Moved scandoc + to scandoc.pl and its default.pl template to scandoc_template.pl. + [Roy Fielding] + + *) Updated config.guess and config.sub to GNU libtool 1.3.5 features, + with the Apache additions for OS/390 and OS/2 emx. [Roy Fielding] + *) Moved hints.m4, apr_common.m4, and helpers/apr-conf.m4 into the new build directory as apr_hints.m4, apr_common.m4, apr_network.m4, and apr_threads.m4. [Roy Fielding] diff --git a/Makefile.in b/Makefile.in index af860b2f81b..cd4ed34c215 100644 --- a/Makefile.in +++ b/Makefile.in @@ -33,6 +33,8 @@ DISTCLEAN_TARGETS = config.cache config.log config.status \ EXTRACLEAN_TARGETS = configure libtool aclocal.m4 \ include/arch/unix/apr_private.h.in +SCANDOC_TEMPLATE = -i$(apr_builders)/scandoc_template.pl + ### fix this up at some point (install location) libdir = /usr/local/lib @@ -65,7 +67,7 @@ $(TARGET_EXPORTS): $(MKEXPORT) include/*.h > $@ docs: - $(SCANDOC) -ihelpers/default.pl -p./docs/ ./include/*.h + $(SCANDOC) $(SCANDOC_TEMPLATE) -p./docs/ $(INCDIR)/*.h test: $(TARGET_LIB) (cd test; make clean; make; \ diff --git a/build/rules.mk.in b/build/rules.mk.in index 7bc932ffc85..802e1a84f03 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -62,6 +62,7 @@ # Configuration variables # top_builddir=@top_builddir@ +apr_builders=@apr_builders@ CC=@CC@ AWK=@AWK@ @@ -75,10 +76,6 @@ LDFLAGS=@LDFLAGS@ RM=@RM@ SHELL=@SHELL@ -MKEXPORT=@APR_MKEXPORT@ -MKDEP=@APR_MKDEP@ -SCANDOC=@APR_SCANDOC@ - ### make LTFLAGS somewhat variable? LTFLAGS = --silent @@ -90,6 +87,10 @@ LT_COMPILE = $(LIBTOOL) --mode=compile $(LTFLAGS) $(COMPILE) -c $< && touch $@ LINK = $(LIBTOOL) --mode=link $(LTFLAGS) $(COMPILE) $(LDFLAGS) -o $@ +MKEXPORT = $(AWK) -f $(apr_builders)/make_export.awk +MKDEP = $(apr_builders)/mkdep.sh +SCANDOC = $(apr_builders)/scandoc.pl + # # Standard build rules # diff --git a/buildconf b/buildconf index 5442a7f520b..0b173b325e5 100755 --- a/buildconf +++ b/buildconf @@ -3,7 +3,7 @@ # # Build aclocal.m4 from libtool's libtool.m4 and our own M4 files. # -libtoolize=`helpers/PrintPath glibtoolize libtoolize` +libtoolize=`build/PrintPath glibtoolize libtoolize` ltpath=`dirname $libtoolize` ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 echo "Incorporating $ltfile into aclocal.m4 ..." @@ -27,7 +27,7 @@ cat $ltfile >> aclocal.m4 # rely on libtool's versions # echo "Copying libtool helper files ..." -$libtoolize --copy +$libtoolize --copy --automake # # Generate the autoconf header and ./configure diff --git a/configure.in b/configure.in index 84bf41b0e3a..d464792b44b 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl ## dnl Process this file with autoconf to produce a configure script. AC_INIT(build/apr_common.m4) AC_CONFIG_HEADER(include/arch/unix/apr_private.h) -AC_CONFIG_AUX_DIR(helpers) +AC_CONFIG_AUX_DIR(build) AC_CANONICAL_SYSTEM echo "Configuring APR library" @@ -30,6 +30,12 @@ if test "$abs_builddir" != "$abs_srcdir"; then USE_VPATH=1 fi +dnl Directory containing apr build macros, helpers, and make rules +apr_builders=$abs_srcdir/build +AC_SUBST(apr_builders) + +MKDIR=$apr_builders/mkdir.sh + # These added to allow default directories to be used... DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" @@ -42,15 +48,6 @@ AC_PROG_AWK AC_CHECK_PROG(RM, rm, rm) AC_CHECK_TOOL(AR, ar, ar) -dnl Get locations of the build helper scripts -MKDIR=$abs_srcdir/helpers/mkdir.sh -APR_MKEXPORT="$AWK -f $abs_srcdir/helpers/make_export.awk" -AC_SUBST(APR_MKEXPORT) -APR_MKDEP=$abs_srcdir/helpers/mkdep.sh -AC_SUBST(APR_MKDEP) -APR_SCANDOC=$abs_srcdir/helpers/scandoc -AC_SUBST(APR_SCANDOC) - # This macro needs to be here in case we are on an AIX box. AC_AIX @@ -923,10 +920,10 @@ dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles dnl case "$host_alias" in *bsdi*) - INCLUDE_RULES=".include \"$top_builddir/helpers/rules.mk\"" + INCLUDE_RULES=".include \"$apr_builders/rules.mk\"" ;; *) - INCLUDE_RULES="include $top_builddir/helpers/rules.mk" + INCLUDE_RULES="include $apr_builders/rules.mk" ;; esac AC_SUBST(INCLUDE_RULES) @@ -944,7 +941,7 @@ AC_OUTPUT([ $MAKEFILE1 $MAKEFILE2 $MAKEFILE3 include/apr.h APRVARS - helpers/rules.mk + build/rules.mk ],[ for i in $SAVE_FILES; do if cmp -s $i $i.save 2>/dev/null; then diff --git a/shmem/unix/mm/configure.in b/shmem/unix/mm/configure.in index 432199bbcce..cf378e17567 100644 --- a/shmem/unix/mm/configure.in +++ b/shmem/unix/mm/configure.in @@ -11,7 +11,7 @@ AC_REVISION($1.0$)dnl dnl # autoconf initialization AC_INIT(README) -AC_CONFIG_AUX_DIR(../../../helpers) +AC_CONFIG_AUX_DIR(../../../build) AC_CONFIG_HEADER(mm_conf.h) AC_PREFIX_DEFAULT(/usr/local) From 0d4e148d07f5a28b554a1cc6e95dc65245472eb5 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sun, 18 Feb 2001 17:15:35 +0000 Subject: [PATCH 1270/7878] Moved to ../build/ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61255 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/.cvsignore | 3 - helpers/MakeEtags | 39 -- helpers/PrintPath | 116 ---- helpers/config.guess | 1097 -------------------------------- helpers/config.sub | 1240 ------------------------------------ helpers/cvstodsp5.pl | 43 -- helpers/default.pl | 518 --------------- helpers/dsp5tocvs.pl | 46 -- helpers/install.sh | 112 ---- helpers/make_export.awk | 54 -- helpers/mkdep.sh | 12 - helpers/mkdir.sh | 35 - helpers/rules.mk.in | 168 ----- helpers/scandoc | 1339 --------------------------------------- 14 files changed, 4822 deletions(-) delete mode 100644 helpers/.cvsignore delete mode 100755 helpers/MakeEtags delete mode 100755 helpers/PrintPath delete mode 100755 helpers/config.guess delete mode 100755 helpers/config.sub delete mode 100644 helpers/cvstodsp5.pl delete mode 100644 helpers/default.pl delete mode 100644 helpers/dsp5tocvs.pl delete mode 100755 helpers/install.sh delete mode 100644 helpers/make_export.awk delete mode 100755 helpers/mkdep.sh delete mode 100755 helpers/mkdir.sh delete mode 100644 helpers/rules.mk.in delete mode 100755 helpers/scandoc diff --git a/helpers/.cvsignore b/helpers/.cvsignore deleted file mode 100644 index 62437018a1f..00000000000 --- a/helpers/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -ltconfig -ltmain.sh -rules.mk diff --git a/helpers/MakeEtags b/helpers/MakeEtags deleted file mode 100755 index 1b030a3fc03..00000000000 --- a/helpers/MakeEtags +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -# This file illustrates how to generate a useful TAGS file via etags -# for emacs. This should be invoked from the src directory i.e.: -# > helpers/MakeEtags -# and will create a TAGS file in the src directory. - -# This script falls under the Apache License. -# See http://www.apache.org/docs/LICENSE - -# Once you have created src/TAGS in emacs you'll need to setup -# tag-table-alist with an entry to assure it finds the single src/TAGS -# file from the many source directories. Something along these lines: -# (setq tag-table-alist -# '(("/home/me/work/apache-1.3/src/" -# . "/home/me/work/apache-1.3/src/") -# )) - -# This requires a special version of etags, i.e. the -# one called "Exuberant ctags" available at: -# http://fly.hiwaay.net/~darren/ctags/ -# Once that is setup you'll need to point to the -# executable here: - -etags=~/local/bin/etags - -# Exuberant etags is necessary since it can ignore some defined symbols -# that obscure the function signatures. - -ignore=AP_DECLARE,AP_DECLARE_NONSTD,__declspec - -# Create an etags file at the root of the source -# tree, then create symbol links to it from each -# directory in the source tree. By passing etags -# absolute pathnames we get a tag file that is -# NOT portable when we move the directory tree. - -find . -name '*.[ch]' -print | $etags -I "$ignore" -L - - diff --git a/helpers/PrintPath b/helpers/PrintPath deleted file mode 100755 index 68435f3744c..00000000000 --- a/helpers/PrintPath +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -# Look for program[s] somewhere in $PATH. -# -# Options: -# -s -# Do not print out full pathname. (silent) -# -pPATHNAME -# Look in PATHNAME instead of $PATH -# -# Usage: -# PrintPath [-s] [-pPATHNAME] program [program ...] -# -# Initially written by Jim Jagielski for the Apache configuration mechanism -# (with kudos to Kernighan/Pike) -# -# This script falls under the Apache License. -# See http://www.apache.org/docs/LICENSE - -## -# Some "constants" -## -pathname=$PATH -echo="yes" - -## -# Find out what OS we are running for later on -## -os=`(uname) 2>/dev/null` - -## -# Parse command line -## -for args in $* -do - case $args in - -s ) echo="no" ;; - -p* ) pathname="`echo $args | sed 's/^..//'`" ;; - * ) programs="$programs $args" ;; - esac -done - -## -# Now we make the adjustments required for OS/2 and everyone -# else :) -# -# First of all, all OS/2 programs have the '.exe' extension. -# Next, we adjust PATH (or what was given to us as PATH) to -# be whitespace seperated directories. -# Finally, we try to determine the best flag to use for -# test/[] to look for an executable file. OS/2 just has '-r' -# but with other OSs, we do some funny stuff to check to see -# if test/[] knows about -x, which is the prefered flag. -## - -if [ "x$os" = "xOS/2" ] -then - ext=".exe" - pathname=`echo -E $pathname | - sed 's/^;/.;/ - s/;;/;.;/g - s/;$/;./ - s/;/ /g - s/\\\\/\\//g' ` - test_exec_flag="-r" -else - ext="" # No default extensions - pathname=`echo $pathname | - sed 's/^:/.:/ - s/::/:.:/g - s/:$/:./ - s/:/ /g' ` - # Here is how we test to see if test/[] can handle -x - testfile="pp.t.$$" - - cat > $testfile </dev/null`; then - test_exec_flag="-x" - else - test_exec_flag="-r" - fi - rm -f $testfile -fi - -for program in $programs -do - for path in $pathname - do - if [ $test_exec_flag $path/${program}${ext} ] && \ - [ ! -d $path/${program}${ext} ]; then - if [ "x$echo" = "xyes" ]; then - echo $path/${program}${ext} - fi - exit 0 - fi - -# Next try without extension (if one was used above) - if [ "x$ext" != "x" ]; then - if [ $test_exec_flag $path/${program} ] && \ - [ ! -d $path/${program} ]; then - if [ "x$echo" = "xyes" ]; then - echo $path/${program} - fi - exit 0 - fi - fi - done -done -exit 1 - diff --git a/helpers/config.guess b/helpers/config.guess deleted file mode 100755 index a5d1bd6dce3..00000000000 --- a/helpers/config.guess +++ /dev/null @@ -1,1097 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 -# Free Software Foundation, Inc. -# -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Written by Per Bothner . -# The master version of this file is at the FSF in /home/gd/gnu/lib. -# Please send patches to the Autoconf mailing list . -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit system type (host/target name). -# -# Only a few systems have been added to this list; please add others -# (but try to keep the structure clean). -# - -# Use $HOST_CC if defined. $CC may point to a cross-compiler -if test x"$CC_FOR_BUILD" = x; then - if test x"$HOST_CC" != x; then - CC_FOR_BUILD="$HOST_CC" - else - if test x"$CC" != x; then - CC_FOR_BUILD="$CC" - else - CC_FOR_BUILD=cc - fi - fi -fi - - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - cat <$dummy.s - .globl main - .ent main -main: - .frame \$30,0,\$26,0 - .prologue 0 - .long 0x47e03d80 # implver $0 - lda \$2,259 - .long 0x47e20c21 # amask $2,$1 - srl \$1,8,\$2 - sll \$2,2,\$2 - sll \$0,3,\$0 - addl \$1,\$0,\$0 - addl \$2,\$0,\$0 - ret \$31,(\$26),1 - .end main -EOF - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy - case "$?" in - 7) - UNAME_MACHINE="alpha" - ;; - 15) - UNAME_MACHINE="alphaev5" - ;; - 14) - UNAME_MACHINE="alphaev56" - ;; - 10) - UNAME_MACHINE="alphapca56" - ;; - 16) - UNAME_MACHINE="alphaev6" - ;; - esac - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-cbm-sysv4 - exit 0;; - amiga:NetBSD:*:*) - echo m68k-cbm-netbsd${UNAME_RELEASE} - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - arc64:OpenBSD:*:*) - echo mips64el-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hkmips:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - arm32:NetBSD:*:*) - echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - SR2?01:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - atari*:NetBSD:*:*) - echo m68k-atari-netbsd${UNAME_RELEASE} - exit 0 ;; - atari*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - sun3*:NetBSD:*:*) - echo m68k-sun-netbsd${UNAME_RELEASE} - exit 0 ;; - sun3*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:NetBSD:*:*) - echo m68k-apple-netbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - macppc:NetBSD:*:*) - echo powerpc-apple-netbsd${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy \ - && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ - -o ${TARGET_BINARY_INTERFACE}x = x ] ; then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - *:OS390:*:* | *:OS/390:*:*) - echo s390-ibm-os390 - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i?86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:4) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` - if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=4.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - sed 's/^ //' << EOF >$dummy.c - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` - rm -f $dummy.c $dummy - esac - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i?86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - hppa*:OpenBSD:*:*) - echo hppa-unknown-openbsd - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*X-MP:*:*:*) - echo xmp-cray-unicos - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} - exit 0 ;; - CRAY*T3E:*:*:*) - echo t3e-cray-unicosmk${UNAME_RELEASE} - exit 0 ;; - CRAY-2:*:*:*) - echo cray2-cray-unicos - exit 0 ;; - F300:UNIX_System_V:*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - F301:UNIX_System_V:*:*) - echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` - exit 0 ;; - hp3[0-9][05]:NetBSD:*:*) - echo m68k-hp-netbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*) - if test -x /usr/bin/objformat; then - if test "elf" = "`/usr/bin/objformat`"; then - echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` - exit 0 - fi - fi - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; - *:NetBSD:*:*) - echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i386-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - *:Linux:*:*) -# # uname on the ARM produces all sorts of strangeness, and we need to -# # filter it out. -# case "$UNAME_MACHINE" in -# armv*) UNAME_MACHINE=$UNAME_MACHINE ;; -# arm* | sa110*) UNAME_MACHINE="arm" ;; -# esac - - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - ld_help_string=`cd /; ld --help 2>&1` - ld_supported_emulations=`echo $ld_help_string \ - | sed -ne '/supported emulations:/!d - s/[ ][ ]*/ /g - s/.*supported emulations: *// - s/ .*// - p'` - case "$ld_supported_emulations" in - i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; - i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; - sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - elf32arm) echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 ;; - elf32ppc) - # Determine Lib Version - cat >$dummy.c < -#if defined(__GLIBC__) -extern char __libc_version[]; -extern char __libc_release[]; -#endif -main(argc, argv) - int argc; - char *argv[]; -{ -#if defined(__GLIBC__) - printf("%s %s\n", __libc_version, __libc_release); -#else - printf("unkown\n"); -#endif - return 0; -} -EOF - LIBC="" - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy | grep 1\.99 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.c $dummy - echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;; - esac - - if test "${UNAME_MACHINE}" = "alpha" ; then - sed 's/^ //' <$dummy.s - .globl main - .ent main - main: - .frame \$30,0,\$26,0 - .prologue 0 - .long 0x47e03d80 # implver $0 - lda \$2,259 - .long 0x47e20c21 # amask $2,$1 - srl \$1,8,\$2 - sll \$2,2,\$2 - sll \$0,3,\$0 - addl \$1,\$0,\$0 - addl \$2,\$0,\$0 - ret \$31,(\$26),1 - .end main -EOF - LIBC="" - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy - case "$?" in - 7) - UNAME_MACHINE="alpha" - ;; - 15) - UNAME_MACHINE="alphaev5" - ;; - 14) - UNAME_MACHINE="alphaev56" - ;; - 10) - UNAME_MACHINE="alphapca56" - ;; - 16) - UNAME_MACHINE="alphaev6" - ;; - esac - - objdump --private-headers $dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 - elif test "${UNAME_MACHINE}" = "mips" ; then - cat >$dummy.c </dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - else - # Either a pre-BFD a.out linker (linux-gnuoldld) - # or one that does not give us useful --help. - # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. - # If ld does not provide *any* "supported emulations:" - # that means it is gnuoldld. - echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" - test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 - - case "${UNAME_MACHINE}" in - i?86) - VENDOR=pc; - ;; - *) - VENDOR=unknown; - ;; - esac - # Determine whether the default compiler is a.out or elf - cat >$dummy.c < -#ifdef __cplusplus - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __ELF__ -# ifdef __GLIBC__ -# if __GLIBC__ >= 2 - printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -#else - printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - fi ;; -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions -# are messed up and put the nodename in both sysname and nodename. - i?86:DYNIX/ptx:4*:*) - echo i386-sequent-sysv4 - exit 0 ;; - i?86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} - fi - exit 0 ;; - i?86:*:5:7*) - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585 - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE} - exit 0 ;; - i?86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - pc:*:*:*) - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:*:6*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} - exit 0 ;; - *:OS/2:*:*) - echo "i386-pc-os2_emx" - exit 0;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -#if !defined (ultrix) - printf ("vax-dec-bsd\n"); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 -rm -f $dummy.c $dummy - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -#echo '(Unable to guess system type)' 1>&2 - -exit 1 diff --git a/helpers/config.sub b/helpers/config.sub deleted file mode 100755 index df1ad1afc9b..00000000000 --- a/helpers/config.sub +++ /dev/null @@ -1,1240 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -if [ x$1 = x ] -then - echo Configuration name missing. 1>&2 - echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 - echo "or $0 ALIAS" 1>&2 - echo where ALIAS is a recognized configuration type. 1>&2 - exit 1 -fi - -# First pass through any local machine types. -case $1 in - *local*) - echo $1 - exit 0 - ;; - *) - ;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - linux-gnu*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - tpf | os390 | vmcms) - os=-$maybe_os - basic_machine=s390; - ;; - mvs) - os=-mvs - basic_machine=i370; - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=vxworks - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ - | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ - | 580 | i960 | h8300 \ - | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \ - | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ - | mips64orion | mips64orionel | mipstx39 | mipstx39el \ - | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ - | mips64vr5000 | miprs64vr5000el \ - | armv[34][lb] | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v) - basic_machine=$basic_machine-unknown - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i[34567]86) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ - | xmp-* | ymp-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ - | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \ - | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ - | clipper-* | orion-* \ - | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ - | mipstx39-* | mipstx39el-* \ - | armv[34][lb]-* \ - | f301-* | armv*-* | t3e-* \ - | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* ) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-cbm - ;; - amigaos | amigados) - basic_machine=m68k-cbm - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-cbm - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | ymp) - basic_machine=ymp-cray - os=-unicos - ;; - cray2) - basic_machine=cray2-cray - os=-unicos - ;; - [ctj]90-cray) - basic_machine=c90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - os=-mvs - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[34567]86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i[34567]86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i[34567]86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i[34567]86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - i386-go32 | go32) - basic_machine=i386-unknown - os=-go32 - ;; - i386-mingw32 | mingw32) - basic_machine=i386-unknown - os=-mingw32 - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | *MiNT) - basic_machine=m68k-atari - os=-mint - ;; - mipsel*-linux*) - basic_machine=mipsel-unknown - os=-linux-gnu - ;; - mips*-linux*) - basic_machine=mips-unknown - os=-linux-gnu - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - msdos) - basic_machine=i386-unknown - os=-msdos - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-corel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - np1) - basic_machine=np1-gould - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexen) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86) - basic_machine=i686-pc - ;; - pentiumii | pentium2) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexen-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=rs6000-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - s390*) - basic_machine=s390-ibm - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sparclite-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=t3e-cray - os=-unicos - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xmp) - basic_machine=xmp-cray - os=-unicos - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - mips) - if [ x$os = x-linux-gnu ]; then - basic_machine=mips-unknown - else - basic_machine=mips-mips - fi - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sparc | sparcv9) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - c4x*) - basic_machine=c4x-none - os=-coff - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - -os2_emx) - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -darwin* | -openstep* | -oskit* \ - | -tpf* | -os390* | -vmcms* ) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -ns2 ) - os=-nextstep2 - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -*MiNT) - os=-mint - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-corel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - case $basic_machine in - s390*) - os=-os390; - ;; - i370*) - os=-mvs; - ;; - *) - os=-aix - ;; - esac - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f301-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -*MiNT) - vendor=atari - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os diff --git a/helpers/cvstodsp5.pl b/helpers/cvstodsp5.pl deleted file mode 100644 index d37442735f4..00000000000 --- a/helpers/cvstodsp5.pl +++ /dev/null @@ -1,43 +0,0 @@ -use IO::File; -use File::Find; - -chdir '..'; -find(\&tovc5, '.'); - -sub tovc5 { - - if (m|.dsp$|) { - $oname = $_; - $tname = '.#' . $_; - $verchg = 0; - $srcfl = new IO::File $oname, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - if ($src =~ s|Format Version 6\.00|Format Version 5\.00|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD CPP .*)/ZI (.*)|$1/Zi $2|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD BASE CPP .*)/ZI (.*)|$1/Zi $2|) { - $verchg = -1; - } - if ($src !~ m|^# PROP AllowPerConfigDependencies|) { - print $dstfl $src; } - else { - $verchg = -1; - - } - } - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Converted VC6 project " . $oname . " to VC5 in " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } - } -} \ No newline at end of file diff --git a/helpers/default.pl b/helpers/default.pl deleted file mode 100644 index f260cd5d38d..00000000000 --- a/helpers/default.pl +++ /dev/null @@ -1,518 +0,0 @@ -<< -# Scandoc template file. -# -# This is an example set of templates that is designed to create several -# different kinds of index files. It generates a "master index" which intended -# for use with a frames browser; A "package index" which is the root page of -# the index, and then "package files" containing documentation for all of the -# classes within a single package. - -###################################################################### - -## For quick and superficial customization, -## simply change these variables - -$project_name = '[Apache Portable RunTime]'; -#$company_logo = ''; # change this to an image tag. -$copyright = '© 2000 [Apache Software Foundation]'; -$image_directory = "../images/"; -$bullet1_image = $image_directory . "ball1.gif"; -$bullet2_image = $image_directory . "ball2.gif"; -$bgcolor1 = "#FFFFFF"; -$bgcolor2 = "#FFFFFF"; - -###################################################################### - -## Begin generating frame index file. - -file "index.html"; ->> - - - $project_name - - - - - - <body bgcolor="$bgcolor2" stylesrc="index.html"> - <p>Some Documentation</p> - </body> - - - -<< - -###################################################################### - -## Begin generating master index file (left-hand frame). - -file "master.html"; ->> - - Master Index - - -

    -

    - Master Index -

    -

    - - -<< - -## For each package, generate an index entry. - -foreach $p (packages()) { - $_ = $p->url; - s/\s/_/g; - >>$(p.name)
    -

    - << - foreach $e ($p->classes()) { - $_ = $e->url; - s/\s/_/g; - >>
  • $(e.fullname) - << - } - foreach $e ($p->globals()) { - $_ = $e->url; - s/\s/_/g; - >>
  • $(e.fullname) - << - } - >>
  • << -} - ->> - To-Do List
    -
    -
    -

    - - -<< - -###################################################################### - -## Begin generating package index file - -file "packages.html"; ->> - - $project_name -- Packages - - - -
    $company_logo -

    Documentation for $project_name

    -
    -

    Package List

    -<< - -## For each package, generate an index entry. - -foreach $p (packages()) { - $_ = $p->url; - s/\s/_/g; - >>$(p.name)
    - << -} - ->> -

    -


    - $copyright
    - Generated by ScanDoc $majorVersion.$minorVersion
    - Last Updated: $date
    - - - -<< - -###################################################################### - -## Generate "To-do list" - -file "to-do.html"; ->> - - $project_name -- To-Do list - - - - $company_logo - -

    To-do list for $project_name

    -<< - -if (&todolistFiles()) { - >>

    - << - foreach $f (&todolistFiles()) { - my @m = &todolistEntries( $f ); - if ($f =~ /([^\/]+)$/) { $f = $1; } - >>$f:

      - << - foreach $text (@m) { - if ($text) { - print "
    • ", &processDescription( $text ), "\n"; - } - } - >>
    - << - } -} - ->> -
    - $copyright
    - Generated by ScanDoc $majorVersion.$minorVersion
    - Last Updated: $date
    - - -<< - -###################################################################### - -## Generate individual files for each package. - -my $p; -foreach $p (packages()) { - $_ = $p->name; - s/\s/_/g; - file $_ . ".html"; - >> - - $project_name -- $(p.name) - - -
    - $project_name -

    -

    - -

    Package Name: $(p.name)

    - -<< - -## Generate class and member index at the top of the file. - -foreach $c ($p->classes()) { - $_ = $c->url; - s/\s/_/g; - >>

    - $(c.fullname)

    -
      - << - foreach $m ($c->members()) { - $_ = $m->url; - s/\s/_/g; - >>
    • $(m.longname) - << - } - >>
    - << -} - ->> -
    -<< - -## Generate detailed class documentation -foreach $c ($p->classes()) { - ## Output searchable keyword list - if ($c->keywords()) { - print "\n"; - } - - >>
    - -

    $(c.fullname)

    - - - - - << - - # Output author tag - if ($c->author()) { - >><< - >><< - } - - # Output package version - if ($c->version()) { - >><< - >><< - } - - # Output Source file - if ($c->sourcefile()) { - >><< - >><< - } - - # Output base class list - if ($c->baseclasses()) { - >> - - << - } - - # Output subclasses list - if ($c->subclasses()) { - >> - << - } - - # Output main class description - >> -
    -
    Author:$(c.author)
    Version:$(c.version)
    Source:$(c.sourcefile)
    Base classes:<< - my @t = (); - foreach $b ($c->baseclasses()) { - my $name = $b->name(); - if ($url = $b->url()) { - $_ = $url; - s/\s/_/g; - push @t, "$name"; - } - else { push @t, $name; } - } - print join( ', ', @t ); - >>
    Subclasses:<< - my @t = (); - foreach $s ($c->subclasses()) { - my $name = $s->name(); - if ($url = $s->url()) { - $_ = $url; - s/\s/_/g; - push @t, "$name"; - } - else { push @t, $name; } - } - print join( ', ', @t ); - >>
    -

    - << - print &processDescription( $c->description() ); - - # Output "see also" information - if ($c->seealso()) { - >>

    See Also
    - << - my @r = (); - foreach $a ($c->seealso()) { - my $name = $a->name(); - if ($url = $a->url()) { - $_ = $url; - s/\s/_/g; - push @r, "$name"; - } - else { push @r, $name; } - } - print join( ',', @r ); - >>

    - << - } - - # Output class member index - if ($c->members()) { - print "

    Member Index

    \n"; - print "
      "; - foreach $m ($c->members()) { - $_ = $m->url; - s/\s/_/g; - >>
    • $(m.fullname) - << - } - >>
    << - } - - # Output class member variable documentation - if ($c->membervars()) { - print "

    Class Variables

    \n"; - print "
    \n"; - foreach $m ($c->membervars()) { &variable( $m ); } - print "
    \n"; - } - - # Output class member function documentation - if ($c->memberfuncs()) { - print "

    Class Methods

    \n"; - print "
    \n"; - foreach $m ($c->memberfuncs()) { &function( $m ); } - print "
    \n"; - } -} - -# Output global variables -if ($p->globalvars()) { - >>

    Global Variables

    -
    - << - foreach $m ($p->globalvars()) { &variable( $m ); } - print "
    \n"; -} - -# Output global functions -if ($p->globalfuncs()) { - >>

    Global Functions

    -
    - << - foreach $m ($p->globalfuncs()) { &function( $m ); } - print "
    \n"; -} - ->> -
    - $copyright
    - Generated by ScanDoc $majorVersion.$minorVersion
    - Last Updated: $date
    - - -<< -} # end of foreach (packages) loop - -###################################################################### - -## Subroutine to generate documentation for a member function or global function - -sub function { - local ($f) = @_; - - if ($f->keywords()) { - >> - << - } - >> - -
    -
    - $(f.fullname); -
    - << - print &processDescription( $f->description() ); - >> -

    - << - if ($f->params()) { - >> -
    Parameters
    - - << - foreach $a ($f->params()) { - >> - << - } - >>
    - $(a.name)<< - print &processDescription( $a->description() ); - >>
    - << - } - - if ($f->returnValue()) { - >>
    Return Value -
    << - print &processDescription( $f->returnValue() ); - >>

    << - } - - if ($f->exceptions()) { - >>

    Exceptions
    - - << - foreach $a ($f->exceptions()) { - >> - << - } - >>

    - $(a.name)<< - print &processDescription( $a->description() ); - >>

    - << - } - - if ($f->seealso()) { - >>
    See Also
    - << - my @r = (); - foreach $a ($f->seealso()) { - my $name = $a->name(); - if ($url = $a->url()) { - $_ = $url; - s/\s/_/g; - push @r, "$name"; - } - else { push @r, $name; } - } - print join( ',', @r ); - >>

    << - } - >>

    - << -} - -###################################################################### - -## Subroutine to generate documentation for a member variable or global variable. - -sub variable { - local ($v) = @_; - - if ($v->keywords()) { - print ""; - } - - >> - -
    - $(v.fullname); -
    - <description() );>> -

    - << - if ($v->seealso()) { - >>
    See Also
    - << - $comma = 0; - foreach $a ($v->seealso()) { - $_ = $a->url; - s/\s/_/g; - if ($comma) { print ","; } - $comma = 1; - >>$(a.name) - << - } - >>

    - << - } - >>

    - << -} - -###################################################################### - -sub processDescription { - local ($_) = @_; - - # handle HTML markup issues. - s//>/g; - - s/^\s+//; # Remove whitespace from beginning - s/\s+$/\n/; # Remove whitespace from end - s/\n\n/

    \n/g; # Replace multiple CR's with paragraph markers - s:\@heading(.*)\n:

    $1

    :; # Handle heading text - - # Handle embedded image tags - s:\@caution:

    :; - s:\@warning:

    :; - s:\@bug:

    :; - s:\@tip:

    :; - - return $_; -} diff --git a/helpers/dsp5tocvs.pl b/helpers/dsp5tocvs.pl deleted file mode 100644 index 9686b43634b..00000000000 --- a/helpers/dsp5tocvs.pl +++ /dev/null @@ -1,46 +0,0 @@ -use IO::File; -use File::Find; - -chdir '..'; -find(\&tovc6, '.'); - -sub tovc6 { - - if (m|.dsp$|) { - $oname = $_; - $tname = '.#' . $_; - $verchg = 0; - $srcfl = new IO::File $_, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - if ($src =~ s|Format Version 5\.00|Format Version 6\.00|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD CPP .*)/Zi (.*)|$1/ZI $2|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD BASE CPP .*)/Zi (.*)|$1/ZI $2|) { - $verchg = -1; - } - if ($src =~ s|^(!MESSAGE .*)\\\n|$1|) { - $cont = <$srcfl>; - $src = $src . $cont; - $verchg = -1; - } - print $dstfl $src; - if ($verchg && $src =~ m|^# Begin Project|) { - print $dstfl "# PROP AllowPerConfigDependencies 0\n"; - } - } - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Converted VC5 project " . $oname . " to VC6 in " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } - } -} diff --git a/helpers/install.sh b/helpers/install.sh deleted file mode 100755 index 9a8821fa290..00000000000 --- a/helpers/install.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/sh -## -## install.sh -- install a program, script or datafile -## -## Based on `install-sh' from the X Consortium's X11R5 distribution -## as of 89/12/18 which is freely available. -## Cleaned up for Apache's Autoconf-style Interface (APACI) -## by Ralf S. Engelschall -## -# -# This script falls under the Apache License. -# See http://www.apache.org/docs/LICENSE - - -# -# put in absolute paths if you don't have them in your path; -# or use env. vars. -# -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" - -# -# parse argument line -# -instcmd="$mvprog" -chmodcmd="" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -ext="" -src="" -dst="" -while [ "x$1" != "x" ]; do - case $1 in - -c) instcmd="$cpprog" - shift; continue - ;; - -m) chmodcmd="$chmodprog $2" - shift; shift; continue - ;; - -o) chowncmd="$chownprog $2" - shift; shift; continue - ;; - -g) chgrpcmd="$chgrpprog $2" - shift; shift; continue - ;; - -s) stripcmd="$stripprog" - shift; continue - ;; - -S) stripcmd="$stripprog $2" - shift; shift; continue - ;; - -e) ext="$2" - shift; shift; continue - ;; - *) if [ "x$src" = "x" ]; then - src=$1 - else - dst=$1 - fi - shift; continue - ;; - esac -done -if [ "x$src" = "x" ]; then - echo "install.sh: no input file specified" - exit 1 -fi -if [ "x$dst" = "x" ]; then - echo "install.sh: no destination specified" - exit 1 -fi - -# -# If destination is a directory, append the input filename; if -# your system does not like double slashes in filenames, you may -# need to add some logic -# -if [ -d $dst ]; then - dst="$dst/`basename $src`" -fi - -# Add a possible extension (such as ".exe") to src and dst -src="$src$ext" -dst="$dst$ext" - -# Make a temp file name in the proper directory. -dstdir=`dirname $dst` -dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name -$instcmd $src $dsttmp - -# And set any options; do chmod last to preserve setuid bits -if [ "x$chowncmd" != "x" ]; then $chowncmd $dsttmp; fi -if [ "x$chgrpcmd" != "x" ]; then $chgrpcmd $dsttmp; fi -if [ "x$stripcmd" != "x" ]; then $stripcmd $dsttmp; fi -if [ "x$chmodcmd" != "x" ]; then $chmodcmd $dsttmp; fi - -# Now rename the file to the real destination. -$rmcmd $dst -$mvcmd $dsttmp $dst - -exit 0 - diff --git a/helpers/make_export.awk b/helpers/make_export.awk deleted file mode 100644 index 7d61a55fa56..00000000000 --- a/helpers/make_export.awk +++ /dev/null @@ -1,54 +0,0 @@ -# Based on Ryan Bloom's make_export.pl - -/^#[ \t]*if(def)? (AP[RU]?_|!?defined).*/ { - if (old_filename != FILENAME) { - if (old_filename != "") printf("%s", line) - macro_no = 0 - found = 0 - count = 0 - old_filename = FILENAME - line = "" - } - macro_stack[macro_no++] = macro - macro = substr($0, length($1)+2) - count++ - line = line macro "\n" - next -} - -/^#[ \t]*endif/ { - if (count > 0) { - count-- - line = line "/" macro "\n" - macro = macro_stack[--macro_no] - } - if (count == 0) { - if (found != 0) { - printf("%s", line) - } - line = "" - } - next -} - -/^[ \t]*(AP[RU]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?([A-Za-z0-9_]+)\(/ { - if (count) { - found++ - } - for (i = 0; i < count; i++) { - line = line "\t" - } - sub("^[ \t]*(AP[UR]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?", ""); - sub("[(].*", ""); - line = line $0 "\n" - - if (count == 0) { - printf("%s", line) - line = "" - } - next -} - -END { - printf("%s", line) -} diff --git a/helpers/mkdep.sh b/helpers/mkdep.sh deleted file mode 100755 index 510bdc02fbf..00000000000 --- a/helpers/mkdep.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# -# 1) remove everything after the DO NOT REMOVE -# 2) generate the dependencies, adding them to the end of Makefile.new -# 3) move the Makefile.new back into place -# -# Note that we use && to ensure that Makefile is not changed if an error -# occurs during the process -# -sed -ne '1,/^# DO NOT REMOVE/p' Makefile > Makefile.new \ - && gcc -MM $* | sed -e "s/\.o:/\.lo:/" >> Makefile.new \ - && mv Makefile.new Makefile diff --git a/helpers/mkdir.sh b/helpers/mkdir.sh deleted file mode 100755 index 4cd33c5671c..00000000000 --- a/helpers/mkdir.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -## -## mkdir.sh -- make directory hierarchy -## -## Based on `mkinstalldirs' from Noah Friedman -## as of 1994-03-25, which was placed in the Public Domain. -## Cleaned up for Apache's Autoconf-style Interface (APACI) -## by Ralf S. Engelschall -## -# -# This script falls under the Apache License. -# See http://www.apache.org/docs/LICENSE - - -umask 022 -errstatus=0 -for file in ${1+"$@"} ; do - set fnord `echo ":$file" |\ - sed -e 's/^:\//%/' -e 's/^://' -e 's/\// /g' -e 's/^%/\//'` - shift - pathcomp= - for d in ${1+"$@"}; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - mkdir "$pathcomp" || errstatus=$? - fi - pathcomp="$pathcomp/" - done -done -exit $errstatus - diff --git a/helpers/rules.mk.in b/helpers/rules.mk.in deleted file mode 100644 index 7bc932ffc85..00000000000 --- a/helpers/rules.mk.in +++ /dev/null @@ -1,168 +0,0 @@ -# ==================================================================== -# The Apache Software License, Version 1.1 -# -# Copyright (c) 2000-2001 The Apache Software Foundation. All rights -# reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# 3. The end-user documentation included with the redistribution, -# if any, must include the following acknowledgment: -# "This product includes software developed by the -# Apache Software Foundation (http://www.apache.org/)." -# Alternately, this acknowledgment may appear in the software itself, -# if and wherever such third-party acknowledgments normally appear. -# -# 4. The names "Apache" and "Apache Software Foundation" must -# not be used to endorse or promote products derived from this -# software without prior written permission. For written -# permission, please contact apache@apache.org. -# -# 5. Products derived from this software may not be called "Apache", -# nor may "Apache" appear in their name, without prior written -# permission of the Apache Software Foundation. -# -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR -# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# ==================================================================== -# -# This software consists of voluntary contributions made by many -# individuals on behalf of the Apache Software Foundation. For more -# information on the Apache Software Foundation, please see -# . -# - -# -# rules.mk: standard rules for APR -# - -@SET_MAKE@ - -# -# Configuration variables -# -top_builddir=@top_builddir@ - -CC=@CC@ -AWK=@AWK@ -LIBTOOL=@LIBTOOL@ - -CFLAGS=@CFLAGS@ @OPTIM@ -CPPFLAGS=@CPPFLAGS@ $(INCLUDES) -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ - -RM=@RM@ -SHELL=@SHELL@ - -MKEXPORT=@APR_MKEXPORT@ -MKDEP=@APR_MKDEP@ -SCANDOC=@APR_SCANDOC@ - -### make LTFLAGS somewhat variable? -LTFLAGS = --silent - -# -# Basic macro setup -# -COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) -LT_COMPILE = $(LIBTOOL) --mode=compile $(LTFLAGS) $(COMPILE) -c $< && touch $@ - -LINK = $(LIBTOOL) --mode=link $(LTFLAGS) $(COMPILE) $(LDFLAGS) -o $@ - -# -# Standard build rules -# -all: all-recursive -depend: depend-recursive -clean: clean-recursive -distclean: distclean-recursive -extraclean: extraclean-recursive - -install: all-recursive - - -all-recursive depend-recursive clean-recursive distclean-recursive \ - extraclean-recursive: - @otarget=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; \ - for i in $$list; do \ - if test -d "$$i"; then \ - target="$$otarget"; \ - echo "Making $$target in $$i"; \ - if test "$$i" = "."; then \ - made_local=yes; \ - target="local-$$target"; \ - fi; \ - (cd $$i && $(MAKE) $$target) || exit 1; \ - fi; \ - done; \ - if test "$$otarget" = "all" && test -z "$(TARGETS)"; then \ - made_local=n/a; \ - fi; \ - if test -z "$$made_local"; then \ - $(MAKE) "local-$$otarget" || exit 1; \ - fi - -local-clean: x-local-clean - $(RM) -f *.o *.lo *.a *.la *.so $(CLEAN_TARGETS) $(PROGRAMS) - $(RM) -rf .libs - -local-distclean: local-clean x-local-distclean - $(RM) -f Makefile $(DISTCLEAN_TARGETS) - -local-extraclean: local-distclean - @if test -n "$(EXTRACLEAN_TARGETS)"; then \ - echo $(RM) -f $(EXTRACLEAN_TARGETS) ; \ - $(RM) -f $(EXTRACLEAN_TARGETS) ; \ - fi - -local-all: $(TARGETS) - -local-depend: - @if test -n "`ls *.c 2> /dev/null`"; then \ - echo $(MKDEP) $(CFLAGS) $(CPPFLAGS) *.c ; \ - $(MKDEP) $(CFLAGS) $(CPPFLAGS) *.c ; \ - fi - -# to be filled in by the actual Makefile -x-local-clean x-local-distclean: - - -# -# Implicit rules for creating outputs from input files -# -.SUFFIXES: -.SUFFIXES: .c .lo .o - -.c.o: - $(COMPILE) -c $< - -.c.lo: - $(LT_COMPILE) - -.PHONY: all depend clean distclean extraclean install \ - all-recursive depend-recursive clean-recursive distclean-recursive \ - extraclean-recursive - local-all local-depend local-clean local-distclean local-extraclean \ - x-local-clean x-local-distclean diff --git a/helpers/scandoc b/helpers/scandoc deleted file mode 100755 index 13043a30660..00000000000 --- a/helpers/scandoc +++ /dev/null @@ -1,1339 +0,0 @@ -#!/usr/bin/perl -# -# ScanDoc - Version 0.12, A C/C++ Embedded Documentation Analyser -# ---------------------------------------------------------------- -# -# Distributed under the "Artistic License". See the file -# "COPYING" that accompanies the ScanDoc distribution. -# -# See http://scandoc.sourceforge.net/ for more information and -# complete documentation. -# -# (c) 1997 - 2000 Talin and others. - -require "ctime.pl"; -require "getopts.pl"; - -# 1 = on (verbose); 0 = off -$debug = 0; - -# Get the current date -$date = &ctime(time); - -# Set the default tab size -$tabSize = 4; - -$minorVersion = 12; -$majorVersion = 0; -$scandocURL = "http://scandoc.sourceforge.net/"; - -# Set up default templates -&Getopts( 'i:d:p:t:' ); - -if ($#ARGV < 0) { - die "Usage: -i -p -t -d= [ ... ]\n"; -} - -# Read the template -if (!defined $opt_i) { - $opt_i = "default.pl"; -} -&readTemplate( $opt_i ); - -# Set the destination path. -$destPath = ""; -$destPath = $opt_p if (defined($opt_p)); - -# Set the tab size. -$tabSize = $opt_t if (defined($opt_t)); - -# Handle defines -if ($opt_d) { - foreach $def (split( /,/, $opt_d )) { - if ($def =~ /\s*(\w*)\=(.*)/) { - $${1} = $2; - } - else { - $${1} = 1; - } - } -} - -# For each input filename, parse it -while ($srcfile = shift(@ARGV)) { - - $linenumber = 0; - open( FILE, $srcfile ) || die "Can't open file $srcfile\n"; - print STDERR "Reading \"$srcfile\"\n"; - - $docTag = 'description'; - $docEmpty = 1; - $packageName = '.general'; - $author = ''; - $version = ''; - $class = 0; - $_ = ''; - - while (&parseDeclaration( '' )) {} -} - -# Collate subclasses and associate with class record. -foreach $className (keys %subclasses) { - my $class = &classRecord( $className ); - - if ($class) { - my @subs = (); - # print STDERR "$className ", join( ',', @{$subclasses{ $className }} ), "\n"; - foreach $subName ($subclasses{ $className }) { - if (&classRecord( $subName )) { - push @subs, $subName; - } - $class->{ 'subs' } = @subs; - } - } -} - -# Turn packages into objects. Special case for "default" package. -foreach $pkg (keys %packages) -{ - # print STDERR $pkg, "\n"; - bless $packages{ $pkg }, PackageRecord; - if ($pkg eq '.general') { - $packages{ $pkg }{ 'name' } = "General"; - } - else { - $packages{ $pkg }{ 'name' } = $pkg; - } - # print STDERR $packages{ $pkg }->Classes(), "\n"; -} - -# Execute template file -# print STDERR $docTemplate; # For debugging -eval $docTemplate; -print STDERR $@; - -exit; - -# ======================= Subroutines ================================ - -# Read a line of input, and remove blank lines and preprocessor directives. -sub rdln { - my ($skip_next_line) = 0; - if (defined ($_)) { - my ($previous_line) = $_; - while ( (/^(\s*|\#.*)$/ || $skip_next_line ) && ($_ = )) { - if ($previous_line =~ m/\\\s*/) { $skip_next_line = 1; } - else { $skip_next_line = 0; } - $previous_line = $_; - $linenumber++; - if ($debug) { print STDERR "(0:$srcfile) $linenumber.\n"; } - } - } - # Dispose of Apache specific macros - removeApacheMacros(); -} - -# Don't skip "#" -sub rdln2 { - if (defined ($_)) { - while (/^(\s*)$/ && ($_ = )) {$linenumber++; if ($debug) { print STDERR "(0:$srcfile) $linenumber.\n"; } } - } -} - -# Remove comments from current line -sub removeComment { - s|//.*||; -} - -# parsing functions -sub matchKW { &rdln; return (s/^\s*($_[0])//, $1) if defined ($_); return (0, 0); } -#sub matchStruct { &rdln; return (s/^\s*(struct|class)//, $1) if defined ($_); return (0, 0); } -#sub matchPermission { &rdln; return (s/^\s*(public|private|protected)// && $1) if defined ($_); return (0,0); } -sub matchID { &rdln; return (s/^\s*([A-Za-z_]\w*)//, $1) if defined ($_); return (0,0); } -sub matchColon { &rdln; return (s/^\s*\://) if defined ($_); return 0; } -sub matchComma { &rdln; return (s/^\s*\,//) if defined ($_); return 0; } -sub matchSemi { &rdln; return (s/^\s*\;//) if defined ($_); return 0; } -sub matchRBracket { &rdln; return (s/^\s*\{//) if defined ($_); return 0; } -sub matchLBracket { &rdln; return (s/^\s*\}//) if defined ($_); return 0; } -sub matchRParen { &rdln; return (s/^\s*\(//) if defined ($_); return 0; } -sub matchLParen { &rdln; return (s/^\s*\)//) if defined ($_); return 0; } -sub matchRAngle { &rdln; return (s/^\s*\//) if defined ($_); return 0; } -sub matchDecl { &rdln; return (s/^(\s*[\s\w\*\[\]\~\&\n\:]+)//, $1) if defined ($_); return (0, 0); } -sub matchOper { &rdln; return (s/^\s*([\~\&\^\>\<\=\!\%\*\+\-\/\|\w]*)// && $1) if defined ($_); return 0; } -sub matchFuncOper { &rdln; return (s/^\s*(\(\))// && $1) if defined ($_); return 0; } -sub matchAny { &rdln; return (s/^\s*(\S+)//, $1) if defined ($_); return (0, 0); } -sub matchChar { &rdln; return (s/^(.)//, $1) if defined ($_); return (0, 0); } -sub matchChar2 { &rdln2; return (s/^(.)//, $1) if defined ($_); return (0, 0); } -sub matchString { &rdln; return (s/^\"(([^\\\"]|(\\.)))*\"//, $1) if defined ($_); return (0, 0); } - -# Skip to next semicolon -sub skipToSemi { - - while (!&matchSemi) { - - &rdln; - s|//.*||; # Eat comments - if (&matchLBracket) { - &skipBody; - next; - } - last if !s/^\s*([^\s\{\;]+)//; - # print STDERR "$1 "; - } -} - -# Skip function body -sub skipBody { - local( $nest ); - - $nest = 1; - - for (;;) { - if (&matchRBracket) { $nest++; } - elsif (&matchLBracket) { - $nest--; - last if !$nest; - } - else { - last if ((($valid,) = &matchKW( "[^\{\}]")) && !$valid); - } - } -} - -# Skip a string. (multiline) -sub skipString { - local( $char, $lastchar); - $lastchar = "\""; - - for (;;) { - ($valid, $char) = &matchChar2; - if (($char eq "\"") && ($lastchar ne "\\")) { last; } - if ($lastchar eq "\\") { $lastchar = " "; } - else { $lastchar = $char; } - } -} - - -# Skip everything in parenthesis. -sub skipParenBody { - local( $nest ); - - $nest = 1; - - for (;;) { - if (&matchRParen) { $nest++; } - elsif (&matchLParen) { - $nest--; - last if !$nest; - } - else { - last if ((($valid,) = &matchKW( "[^\(\)]")) && !$valid); - } - } -} - -# Parse (*name) syntax -sub parseParenPointer { - if (s/^(\s*\(\s*\*)//) { - $decl .= $1; - $nest = 1; - - for (;;) { - # Preserve spaces, eliminate in-line comments - &removeComment; - while (s/^(\s+)//) { $decl .= $1; &rdln; } - - if (&matchRParen) { $nest++; $decl .= "("; } - elsif (&matchLParen) { - $decl .= ")"; - $nest--; - last if !$nest; - } - elsif ((($valid, $d) = &matchKW( "[^\(\)]*")) && $valid) { $decl .= $d; } - else { last; } - } - - # Just in case there are array braces afterwards. - while ((($valid, $d) = &matchDecl) && $valid) { $decl .= $d; } - } -} - -# Parse template arguments -sub matchAngleArgs { - - if (&matchRAngle) { - local ($args, $nest); - - $args = "<"; - $nest = 1; - - for (;;) { - if (&matchRAngle) { $nest++; $args .= "<"; } - elsif (&matchLAngle) { - $nest--; - $args .= ">"; - last if !$nest; - } - elsif ((($valid, $d) = &matchChar) && $valid) { $args .= $d; } - else { last; } - } - return $args; - } - else { return ''; } -} - -# convert tabs to spaces -sub expandTabs { - local ($text) = @_; - local ($n); - - while (($n = index($text,"\t")) >= 0) { - substr($text, $n, 1) = " " x ($tabSize-($n % $tabSize)); - } - - return $text; -} - -# Process a line of text from a "special" comment -sub handleCommentLine { - local ($_) = @_; - - if ($docEmpty) { - # Eliminate blank lines at the head of the doc. - return if (/^\s*$/); - } - - # First, expand tabs. - $_ = &expandTabs( $_ ); - - # Remove gratuitous \s*\s (james) - s/(^|\n)\s*\*\s/$1/g; - - # If it's one of the standard tags - if (s/^\s*\@(see|package|version|author|param|return|result|exception|keywords|deffunc|defvar|heading|todo)\s*//) { - my $tag = $1; - $tag = 'return' if ($tag eq 'result'); - - # for param and exception, split the param name and the text - # seperate them with tabs. - if ($tag eq "param" || $tag eq "exception") { - s/^\s*(\w+)\s*(.*)/\t$1\t$2/; - } - elsif ($tag eq "heading") { - # 'heading' is processed by the template, if at all. - $_ = "\@heading\t$_"; - $tag = "description"; - } - elsif ($tag eq 'todo') { - if ($todolist{ $srcfile } ne '') { - $todolist{ $srcfile } .= "\n"; - } - } - - # If it's @deffunc or @defvar - if ($tag =~ /def(.*)/) { - - $type = $1; - - # @deffunc and @defvar force a comment to be written out as if there was a - # declaration. - # Designed for use with macros and other constructs I can't parse. - - if (/(\S+)\s+(.*)$/) { - $name = $1; - $decl = $2; - $dbname = &uniqueName( "$baseScope$name" ); - - my $entry = { 'type' => $type, - 'name' => $name, - 'longname'=> $name, - 'fullname'=> "$name $decl", - 'scopename'=>"$baseScope$name", - 'uname' => $dbname, - 'decl' => $decl, - 'package' => $packageName }; - - bless $entry, MemberRecord; - - if ($class) { - $entry->{ 'class' } = "$context"; - $class->{ 'members' }{ $dbname } = $entry; - } - else { - $packages{ $packageName }{ 'globals' }{ $dbname } = $entry; - } - $docTag = 'description'; - &dumpComments( $entry ); - return; - } - } - elsif ($tag eq 'package') { - s/^\s*//; - s/\s*$//; - $packageName = $_; - $docTag = 'description'; - return; - } - elsif ($tag eq 'author') { - $author = $_; - $docTag = 'description'; - return; - } - elsif ($tag eq 'version') { - $version = $_; - $docTag = 'description'; - return; - } - - $docTag = $tag; - } - elsif (/^\s*@\w+/) { - # any other line that begins with an @ should be inserted into the main - # description for later expansion. - $docTag = 'description'; - } - - # "To-do" lists are handled specially, and not associated with a class. - if ($docTag eq 'todo') { - $todolist{ $srcfile } .= $_; - return; - } - - # Append to current doc tag, regardless of whether it's a new line - # or a continuation. Also mark this doc as non-empty. - $docTags{ $docTag } .= $_; - $docEmpty = 0; - - # @see doesn't persist. - if ($docTag eq 'see') { $docTag = 'description'; } - - # print STDERR ":$_"; -} - -# Clear doc tag information at end of class or file -sub clearComments { - - $docTag = 'description'; - $docEmpty = 1; - %docTags = (); -} - -# Add doc tag information to current documented item -sub dumpComments { - local ($hashref) = @_; - - if ($docEmpty == 0) { - - if ($author ne '') { $hashref->{ 'author' } = $author; } - if ($version ne '') { $hashref->{ 'version' } = $version; } - $hashref->{ 'sourcefile' } = $srcfile; - - # Store the tags for this documentation into the global doc symbol table - foreach $key (keys %docTags) { - my $data = $docTags{ $key }; - - $data =~ s/\s*$//; - - $hashref->{ $key } = $data; - } - } - - &clearComments(); -} - -# Generate a unique name from the given name. -sub uniqueName { - local ($name) = @_; - - # Duplicate doc entries need to be distinguished, so give them a different label. - while ($docs{ $name }) { - if ($name =~ /-(\d+)$/) { - $name = $` . "-" . ($1 + 1); - } - else { $name .= "-2"; } - } - - $docs{ $name } = 1; - return $name; -} - -# Get the current class record. -sub classRecord { - local ($className) = @_; - local ($pkg) = $classToPackage{ $className }; - - if ($pkg) { - return $packages{ $pkg }{ 'classes' }{ $className }; - } - return 0; -} - -# Parse a declaration in the file -sub parseDeclaration { - - local ($context) = @_; - local ($baseScope) = ''; - local ($decl); - my ($token); - - if ($context) { $baseScope = $context . "::"; } - - &rdln; - - if (!defined ($_)) { return 0; } - - if (s|^\s*//\*\s+||) { - # Special C++ comment - &handleCommentLine( $' ); - $_ = ''; &rdln; - } - elsif (s|^\s*//||) { - # Ordinary C++ comment - $_ = ''; - &rdln; - } - elsif (s|^\s*\/\*\*\s+||) { - # Special C comments - - s/\={3,}|\-{3,}|\*{3,}//; # Eliminate banner strips - $text = ''; - $docTag = 'description'; - - # Special comment - while (!/\*\//) { &handleCommentLine( $_ ); $text .= $_; $_ = ; $linenumber++; if ($debug) { print STDERR "(1) $linenumber\n."; }} - s/\={3,}|\-{3,}|\*{3,}//; # Eliminate banner strips - /\*\//; - &handleCommentLine( $` ); - $text.= $`; $_ = $'; - } - elsif (s|^\s*\/\*||) { - # Ordinary C comment - $text = ""; - - while (!/\*\//) { $text .= $_; $_ = ; $linenumber++; if ($debug) { print STDERR "(2) $linenumber\n."; }} - /\*\//; - $text.= $`; $_ = $'; - } - elsif ((($valid, $tag) = &matchKW( "template")) && $valid) { - # Template definition - $args = &matchAngleArgs; - &rdln; - - ##$tmplParams = $args; JAMES - $result = &parseDeclaration( $context ); - ##$tmplParams = ''; JAMES - return $result; - } - elsif ((($valid, $tag) = &matchKW("class|struct")) && $valid) { - # Class or structure definition - local ($className,$class); - - if ((($valid, $className) = &matchID) && $valid) { - - return 1 if (&matchSemi); # Only a struct tag - - # A class instance - if ((($valid,)=&matchID) && $valid) { - &matchSemi; - return 1; - } - - my $fullName = "$baseScope$className"; ##$tmplParams"; JAMES - # print STDERR "CLASS $fullName\n"; - - my @bases = (); - - if (&matchColon) { - - for (;;) { - my $p; - &matchKW( "virtual" ); - $perm = "private"; - if ((($valid, $p) = &matchKW( "public|private|protected" )) && $valid) { $perm = $p; } - &matchKW( "virtual" ); - - last if !( (($valid, $base) = &matchID) && $valid ); - - push @bases, $base; - push @{ $subclasses{ $base } }, $fullName; - # print STDERR " : $perm $base\n"; - last if !&matchComma; - } - } - - # print STDERR "\n"; - # print STDERR "parsing class $fullName\n"; - - if ($docEmpty == 0) { - $class = { 'type' => $tag, - 'name' => $fullName, - 'longname'=> "$tag $className", - 'fullname'=> "$tag $className", - 'scopename'=> "$tag $fullName", - 'uname' => $fullName, - 'bases' => \@bases, - 'package' => $packageName, - 'members' => {} }; - - # print STDERR "$className: @bases\n"; - - bless $class, ClassRecord; - - print STDERR " parsing class $fullName\n"; - # $classToPackage{ $className } = $packageName; - $classToPackage{ $fullName } = $packageName; - # $classList{ $className } = $class; - $classList{ $fullName } = $class; - $packages{ $packageName }{ 'classes' }{ $fullName } = $class; - &dumpComments( $class ); - } - - if (&matchRBracket) { - local ($perm) = ("private"); - - while (!&matchLBracket) { - my $p; - if ((($valid, $p) = &matchKW( "public\:|private\:|protected\:" )) && $valid) { - $perm = $p; - } - else { - &parseDeclaration( $fullName ) - || die "Unmatched brace! line = $linenumber\n"; - } - } - - &matchSemi; - } - - &clearComments; - } - } - elsif ( ((($valid,)=&matchKW( "enum")) && $valid) || ((($valid,)=&matchKW( "typedef" )) && $valid)) { - &skipToSemi; - } - elsif ((($valid,)=&matchKW( "friend\s*class" )) && $valid) { - &skipToSemi; - } - elsif ((($valid, $token) = &matchKW("extern\\s*\\\"C\\\"")) && $valid) { - &matchRBracket; - while (!&matchLBracket) { - &parseDeclaration( '' ) || die "Unmatched brace! line = $linenumber\n"; - } - &matchSemi; - } - # elsif ($kw = &matchID) { - # $type = "$kw "; - # - # if ($kw =~/virtual|static|const|volatile/) { - # $type .= &typ; - # } - # } - elsif ((($valid, $decl) = &matchDecl) && $valid) { - my ($instanceClass) = ""; - - # print STDERR "DECLARATION=$decl, REST=$_, baseScope=$baseScope\n"; - - return 1 if ($decl =~ /^\s*$/); - - if (!($class)) { - if ($decl =~ s/(\S*\s*)(\S+)\:\:(\S+)\s*$/$1$3/) { - $instanceClass = $2; - } - } - - # Eliminate in-line comments - &removeComment; - - # Check for multi-line declaration - while ((($valid, $d) = &matchDecl) && $valid) { $decl .= $d; } - - # Handle template args, but don't let operator overloading confuse us! - $tempArgs = ''; - if (!($decl =~ /\boperator\b/) && ($tempArgs = &matchAngleArgs)) { - $tempArgs = $decl . $tempArgs; - $decl = ''; - while ((($valid, $d) = &matchDecl) && $valid) { $decl .= $d; } - } - - # Look for (*name) syntax - &parseParenPointer; - - # Special handling for operator... syntax - $oper = ""; - if ($decl =~ s/\boperator\b(.*)/operator/) { - $oper = $1; - $oper .= &matchOper; - # If, after all that there's no opers, then try a () operator - if (!($oper =~ /\S/)) { $oper .= &matchFuncOper; } - } - - ($type,$mod,$decl) = $decl =~ /([\s\w]*)([\s\*\&]+\s?)(\~?\w+(\[.*\])*)/; - - $type = $tempArgs . $type; - $decl .= $oper; - - if ($mod =~ /\s/) { $type .= $mod; $mod = ""; } - - for (;;) { - - # print STDERR "Looping: $type/$mod/$decl\n"; - - if (&matchRParen) { - $nest = 1; - $args = ""; - - for (;;) { - # print STDERR "Argloop $_\n"; - - # Process argument lists. - - # Preserve spaces, eliminate in-line comments - # REM: Change this to save inline comments and automatically - # generate @param clauses - s|//.*||; - while (s/^(\s+)//) { $args .= " "; &rdln; } - - if (&matchRParen) { $nest++; $args .= "("; } - elsif (&matchLParen) { - $nest--; - last if !$nest; - $args .= ")"; - } - elsif ((($valid, $d) = &matchKW( "[\,\=\.\:\-]" )) && $valid) { $args .= $d; } - elsif ((($valid, $d) = &matchDecl) && $valid) { $args .= $d; } - elsif ((($valid, $d) = &matchAngleArgs) && $valid) { $args .= $d; } - elsif ((($valid, $d) = &matchString) && $valid) { $args .= "\"$d\""; } - else { last; } - } - - # print STDERR "$type$mod$baseScope$decl($args);\n"; - - &matchKW( "const" ); - - # Search for any text within the name field - # if ($docTag && $decl =~ /\W*(~?\w*).*/) - if ($docEmpty == 0) { - $type =~ s/^\s+//; - $mod =~ s/\&/\&/g; - $args =~ s/\&/\&/g; - $args =~ s/\s+/ /g; - $dbname = &uniqueName( "$baseScope$decl" ); - - my $entry = { 'type' => 'func', - 'name' => $decl, - 'longname'=> "$decl()", - 'fullname'=> "$type$mod$decl($args)", - 'scopename'=>"$type$mod$baseScope$decl($args)", - 'uname' => $dbname, - 'decl' => "$type$mod$decl($args)", - 'package' => $packageName }; - - bless $entry, MemberRecord; - - if ($class) { - $entry->{ 'class' } = "$context"; - $class->{ 'members' }{ $dbname } = $entry; - } - elsif ($instanceClass) { - $class = &classRecord ($instanceClass); - if (!($class)) { - print STDERR "WARNING: Skipping \"$instanceClass\:\:$decl\". Class \"$instanceClass\" not declared ($linenumber).\n"; - } else { - $entry->{ 'class' } = "$instanceClass"; - $class->{ 'members' }{ $dbname } = $entry; - $class = 0; - } - } - else { - $packages{ $packageName }{ 'globals' }{ $dbname } = $entry; - } - &dumpComments( $entry ); - } - else { &clearComments; } - - s|//.*||; - - # Constructor super-call syntax - if (&matchColon) { - - # Skip over it. - for (;;) { - &rdln; - last if /^\s*(\{|\;)/; - last if !((($valid,)=&matchAny) && $valid); - } - } - - last if &matchSemi; - if (&matchRBracket) { &skipBody; last; } - last if !&matchComma; - last if !((($valid, $decl) = &matchDecl) && $valid); - - # Look for (*name) syntax - &parseParenPointer; - - $decl =~ s/^\s*//; - $oper = ""; - if ($decl =~ /\boperator\b/) { - $decl =~ s/\boperator\b(.*)/operator/; - $oper = $1 . &matchOper; - } - ($mod,$d) = $decl =~ /^\s*([\*\&]*)\s*(\~?\w+(\[.*\])*)/; - $decl .= $oper; - $decl = $d if $d ne ""; - } - else { - s|//.*||; - - $final = 0; - - if ((($valid,)=&matchKW( "\=" )) && $valid) { - for (;;) { - - if (&matchRBracket) { - &skipBody; - $final = 1; - last; - } - - if (&matchSemi) { - $final = 1; - last; - } - - # var = new ... (...) - if ((($valid,)=&matchKW("new")) && $valid) { - &matchKW("[A-Za-z_0-9 ]*"); - if (&matchRParen) { - &skipParenBody; - } - } - - # var = (.....) ... - if (&matchRParen) { - &skipParenBody; - } - - # var = ... * ... - &matchKW ("[\/\*\-\+]*"); - - # var = "..." - if ((($valid,) = &matchKW ("[\"]")) && $valid) { - &skipString; - } - #&matchString; - - last if /^\s*,/; - #last if !((($valid,)=&matchAny) && $valid); - last if !((($valid,)=&matchKW("[A-Za-z_0-9 \-]*")) && $valid); - if (&matchSemi) { - $final = 1; - last; - } - } - } - - s|//.*||; - - # void ~*&foo[]; - # void foo[]; - # void far*foo[]; - # print STDERR "Decl: $type$mod$baseScope$decl;\n"; - - # Search for any text within the name field - if ($docEmpty == 0 && ($decl =~ /\W*(~?\w*).*/)) - { - $mod =~ s/\&/\&/g; - $name = $decl; - - $dbname = &uniqueName( "$baseScope$1" ); - - my $entry = { 'type' => 'var', - 'name' => $1, - 'longname' => "$name", - 'fullname' => "$type$mod$decl", - 'scopename'=> "$baseScope$type$mod$decl", - 'uname' => $dbname, - 'decl' => "$type$mod$decl", - 'package' => $packageName }; - - bless $entry, MemberRecord; - - if ($class) { - $entry->{ 'class' } = "$context"; - $class->{ 'members' }{ $dbname } = $entry; - } - else { - $packages{ $packageName }{ 'globals' }{ $dbname } = $entry; - } - &dumpComments( $entry ); - } - else { &clearComments; } - - last if $final; - last if &matchSemi; - last if !&matchComma; - last if !((($valid, $decl) = &matchDecl) && $valid); - - # Look for (*name) syntax - &parseParenPointer; - - $decl =~ s/^\s*//; - ($mod,$d) = $decl =~ /^\s*([\*\&]*)(\~?\w+(\[.*\])*)/; - $decl = $d if $d ne ""; - } - } - } - elsif ($context ne "" && /^\s*\}/) { - # print STDERR "Popping!\n"; - return 1; - } - elsif (&matchRBracket) { - &skipBody; - } - elsif ((($valid, $token) = &matchAny) && $valid) { - # Comment in for debugging - # print STDERR "token: $token \n"; - } - else { return 0; } - - return 1; -} - -# read a file into a string ( filename, default-value ) -sub readFile { - local ( $filename, $result ) = @_; - - if ($filename && open( FILE, $filename )) { - $result = ""; - while () { $result .= $_; } - close( FILE ); - } - return $result; -} - -# Read the entire document template and translate into PERL code. -sub readTemplate { - local ( $filename ) = @_; - $docTemplate = ''; - $indent = ''; - $literal = 1; # We're in literal mode. - - if (!-e $filename) { - if (-e "./templates/$filename") { $filename = "./templates/$filename"; } - elsif (-e "../templates/$filename") { $filename = "../templates/$filename"; } - else { die "Could not find template '$filename'.\n"; } - } - - open( FILE, $filename ) || die "Error opening '$filename'.\n"; - while () { - last if (/END/); - - # if we found a code entry. - for (;;) { - &expandTabs( $_ ); - if ($literal) { - # Check for beginning of code block. - if (s/^(.*)\<\$2() \. \"/g; - $docTemplate .= "${indent}print\"$line\";"; - } - # else { $docTemplate .= "\n"; } - $literal = 0; - } - else { - if (substr( $_, 0, length( $indent ) ) eq $indent) { - substr( $_, 0, length( $indent ) ) = ""; - } - chop; - s/\"/\\\"/g; - s/\$\((\w+)\.(\w+)\)/\" \. \$$1->$2() \. \"/g; - $_ = $indent . "print \"" . $_ . "\\n\";\n"; - last; - } - } - else { - # Check for beginning of literal block. - if (s/^(\s*)\>\>//) { - $indent = $1; - $literal = 1; - } - elsif (s/^(\s*)(.*)\>\>//) { - $docTemplate .= "$indent$2"; - $literal = 1; - } - else { - last; - } - } - } - - $docTemplate .= $_; - } - close( FILE ); - # print $docTemplate; -} - -# Functions intended to be called from doc template file. - -# Open a new output file -sub file { - my $mfile = $_[ 0 ]; - - open( STDOUT, ">$destPath$mfile" ) || die "Error writing to '$mfile'\n"; -} - -# return list of package objects -sub packages { - my ($p, @r); - @r = (); - - foreach $p (sort keys %packages) { - push @r, $packages{ $p }; - } - return @r; -} - -# return list of source files which have to-do lists -sub todolistFiles { - my ($p, @r); - @r = (); - - foreach $p (sort keys %todolist) { - push @r, $p; - } - return @r; -} - -# return list of tab-delimited to-do-list texts. -sub todolistEntries { - local $_ = $todolist{ $_[0] }; - s/^\s+//; # Remove whitespace from beginning - s/\s+$/\n/; # Remove whitespace from end - return split( /\n/, $_ ); -} - -# Convert package name to URL. -sub packageURL { - my $p = $_[0]; - - if ($p eq 'General') { $p = '.general'; } - if ($p eq '') { $p = '.general'; } - - if (ref $packages{ $p }) { - return $packages{ $p }->url(); - } - return 0; -} - -# Get the see-also list for an object -sub seealsoList { - my $self = shift; - my ($see, $name, $url, $p, @r); - @r = (); - - if (defined ($self->{ 'see' })) { - foreach $_ (split(/\n/,$self->{ 'see' })) { - - if (/^\ $name, - 'url' => $url }; - - bless $entry, DocReference; - - push @r, $entry; - } - } - return @r; -} - -sub removeApacheMacros { -# print "removing from $_"; - s|AP_DECLARE\((.*?)\)|$1|; -} - -# Class for parsed package -package PackageRecord; - -sub classes { - my $self = shift; - my $classes = $self->{ 'classes' }; - return map $classes->{ $_ }, (sort keys %$classes); -} - -sub globals { - my $self = shift; - my $globals = $self->{ 'globals' }; - return map $globals->{ $_ }, (sort keys %$globals); -} - -sub globalvars { - my $self = shift; - my $globals = $self->{ 'globals' }; - my ($p, @r); - @r = (); - - foreach $p (sort keys %$globals) { - my $m = $globals->{ $p }; - if ($m->{ 'type' } ne 'func') { push @r, $m; } - } - return @r; -} - -sub globalfuncs { - my $self = shift; - my $globals = $self->{ 'globals' }; - my ($p, @r); - @r = (); - - foreach $p (sort keys %$globals) { - my $m = $globals->{ $p }; - if ($m->{ 'type' } eq 'func') { push @r, $m; } - } - return @r; -} - -sub name { - my $self = shift; - return $self->{ 'name' }; -} - -sub url { - my $self = shift; - return "default-pkg.html" if ($self->{ 'name' } eq '.general'); - return $self->{ 'name' } . '.html'; -} - -sub anchor { - my $self = shift; - my $url = $self->{ 'name' }; - return $url; -} - -# Class for parsed class -package ClassRecord; - -sub keywords { return ${$_[0]}{ 'keywords' }; } -sub author { return ${$_[0]}{ 'author' }; } -sub version { return ${$_[0]}{ 'version' }; } -sub name { return ${$_[0]}{ 'name' }; } -sub longname { return ${$_[0]}{ 'longname' }; } -sub fullname { return ${$_[0]}{ 'fullname' }; } -sub scopename { return ${$_[0]}{ 'scopename' }; } -sub sourcefile { return ${$_[0]}{ 'sourcefile' }; } -#sub description { return &::processDescription( ${$_[0]}{ 'description' } ); } -sub description { return ${$_[0]}{ 'description' }; } -sub seealso { &::seealsoList( $_[0] ); } - -sub url { - my $self = shift; - return 0 unless $self->{ 'package' }; - my $pname = ::packageURL( $self->{ 'package' } ); - my $url = $self->{ 'uname' }; - $url =~ s/::/-/g; - return "$pname#$url"; -} - -sub anchor { - my $self = shift; - my $url = $self->{ 'uname' }; - $url =~ s/::/-/g; - return $url; -} - -sub members { - my $self = shift; - my $members = $self->{ 'members' }; - my ($p, @r); - @r = (); - - foreach $p (sort keys %$members) { - push @r, $members->{ $p }; - } - return @r; -} - -sub membervars { - my $self = shift; - my $members = $self->{ 'members' }; - my ($p, @r); - @r = (); - - foreach $p (sort keys %$members) { - my $m = $members->{ $p }; - if ($m->{ 'type' } ne 'func') { push @r, $m; } - } - return @r; -} - -sub memberfuncs { - my $self = shift; - my $members = $self->{ 'members' }; - my ($p, @r); - @r = (); - - foreach $p (sort keys %$members) { - my $m = $members->{ $p }; - if ($m->{ 'type' } eq 'func') { push @r, $m; } - } - return @r; -} - -sub baseclasses { - my $self = shift; - my $bases = $self->{ 'bases' }; - my ($p, $class, @r); - @r = (); - - foreach $p (@$bases) { - - unless ($class = $::classList{ $p }) { - # It's one we don't know about, so just make something up - $class = { 'name' => $p, - 'longname'=> "class $p", - 'fullname'=> "class $p", - 'scopename'=>"class $p", - 'uname' => $p, - 'members' => {} }; - - if ($::classToPackage{ $p }) { - $class->{ 'package' } = $::classToPackage{ $p }; - } - - bless $class, ClassRecord; - } - push @r, $class; - } - return @r; -} - -sub subclasses { - my $self = shift; - my $subs; - my ($p, $class, @r); - @r = (); - - if (defined ($self->{ 'subs' })) { - $subs = $self->{ 'subs' }; - foreach $p (sort @$subs) { - $class = $::classList{ $p }; - push @r, $class; - } - } - return @r; -} - -# Class for parsed class member or global -package MemberRecord; - -sub type { return ${$_[0]}{ 'type' }; } -sub keywords { return ${$_[0]}{ 'keywords' }; } -sub author { return ${$_[0]}{ 'author' }; } -sub version { return ${$_[0]}{ 'version' }; } -sub name { return ${$_[0]}{ 'name' }; } -sub longname { return ${$_[0]}{ 'longname' }; } -sub fullname { return ${$_[0]}{ 'fullname' }; } -sub scopename { return ${$_[0]}{ 'scopename' }; } -sub returnValue { return ${$_[0]}{ 'return' }; } -sub sourcefile { return ${$_[0]}{ 'sourcefile' }; } -sub description { return ${$_[0]}{ 'description' }; } -sub seealso { &::seealsoList( $_[0] ); } - -sub url { - my $self = shift; - return 0 unless $self->{ 'package' }; - my $pname = ::packageURL( $self->{ 'package' } ); - my $url = $self->{ 'uname' }; - $url =~ s/::/-/g; - return "$pname#$url"; -} - -sub anchor { - my $self = shift; - my $url = $self->{ 'uname' }; - $url =~ s/::/-/g; - $url; -} - -sub params { - my $self = shift; - my $params = $self->{ 'param' }; - my @r; - @r = (); - - return 0 unless ($params); - - my @paramList = split( /\t/, $params ); - - for ($i = 1; $i < $#paramList; $i += 2) { - my $entry = { 'name' => $paramList[ $i ], - 'description' => $paramList[ $i + 1 ] }; - - bless $entry, ArgRecord; - - push @r, $entry; - } - return @r; -} - -sub exceptions { - my $self = shift; - my $params = $self->{ 'exception' }; - my @r; - @r = (); - - return 0 unless ($params); - - my @paramList = split( /\t/, $params ); - - for ($i = 1; $i < $#paramList; $i += 2) { - my $entry = { 'name' => $paramList[ $i ], - 'description' => $paramList[ $i + 1 ] }; - - bless $entry, ArgRecord; - - push @r, $entry; - } - return @r; -} - -package ArgRecord; -sub name { return ${$_[0]}{ 'name' }; } -sub description { return ${$_[0]}{ 'description' }; } - -package DocReference; -sub name { return ${$_[0]}{ 'name' }; } -sub url { return ${$_[0]}{ 'url' }; } From e32d8bc63e746b1f4ba51e4fff7d79a7ef51a43f Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sun, 18 Feb 2001 17:18:35 +0000 Subject: [PATCH 1271/7878] Removing obsolete files that aren't being used. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61256 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/build-modules-c.awk | 56 --------------------------- helpers/config-stubs | 8 ---- helpers/cvsclean | 3 -- helpers/make_export.pl | 76 ------------------------------------- helpers/snapshot | 5 --- 5 files changed, 148 deletions(-) delete mode 100644 helpers/build-modules-c.awk delete mode 100755 helpers/config-stubs delete mode 100755 helpers/cvsclean delete mode 100755 helpers/make_export.pl delete mode 100755 helpers/snapshot diff --git a/helpers/build-modules-c.awk b/helpers/build-modules-c.awk deleted file mode 100644 index 15ff82ccfb4..00000000000 --- a/helpers/build-modules-c.awk +++ /dev/null @@ -1,56 +0,0 @@ -BEGIN { - RS = " " - modules[n++] = "core" - pmodules[pn++] = "core" -} -{ - modules[n] = $1; - pmodules[pn] = $1; - gsub("\n","",modules[n]); - gsub("\n","",pmodules[pn]); - ++n; - ++pn; -} -END { - print "/*" - print " * modules.c --- automatically generated by Apache" - print " * configuration script. DO NOT HAND EDIT!!!!!" - print " */" - print "" - print "#include \"ap_config.h\"" - print "#include \"httpd.h\"" - print "#include \"http_config.h\"" - print "" - for (i = 0; i < pn; ++i) { - printf ("extern module %s_module;\n", pmodules[i]) - } - print "" - print "/*" - print " * Modules which implicitly form the" - print " * list of activated modules on startup," - print " * i.e. these are the modules which are" - print " * initially linked into the Apache processing" - print " * [extendable under run-time via AddModule]" - print " */" - print "module *ap_prelinked_modules[] = {" - for (i = 0; i < n; ++i) { - printf " &%s_module,\n", modules[i] - } - print " NULL" - print "};" - print "" - print "/*" - print " * Modules which initially form the" - print " * list of available modules on startup," - print " * i.e. these are the modules which are" - print " * initially loaded into the Apache process" - print " * [extendable under run-time via LoadModule]" - print " */" - print "module *ap_preloaded_modules[] = {" - for (i = 0; i < pn; ++i) { - printf " &%s_module,\n", pmodules[i] - } - print " NULL" - print "};" - print "" -} diff --git a/helpers/config-stubs b/helpers/config-stubs deleted file mode 100755 index aff00a57d48..00000000000 --- a/helpers/config-stubs +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -dir=$1 -for stubdir in `find $dir -type d`; do - if [ -r $stubdir/config.m4 ]; then - echo "sinclude($stubdir/config.m4)" - fi -done diff --git a/helpers/cvsclean b/helpers/cvsclean deleted file mode 100755 index e98ec49b768..00000000000 --- a/helpers/cvsclean +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh - -${MAKE:-make} -f build/build.mk cvsclean diff --git a/helpers/make_export.pl b/helpers/make_export.pl deleted file mode 100755 index 7f2be693181..00000000000 --- a/helpers/make_export.pl +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/perl - -require "getopts.pl"; - -&Getopts( 'o:' ); - -if ($#ARGV < 0) { - die "Usage: -o "; -} - -if (!defined $opt_o) { - $opt_o = "apr.exports"; -} - -open (OUTFILE, ">$opt_o") || die "Can't open $opt_o $!\n"; - -while ($srcfile = shift(@ARGV)) { - my $line; - my $count; - my $found; - my @macro_stack; - - open (FILE, $srcfile) || die "Can't open $srcfile\n"; -# print STDERR "Reading \"$srcfile\"\n"; - - $count = 0; - $found = 0; - $line = ""; -# print OUTFILE "____$srcfile\n"; - while () { - chomp; - - s/^\s*//; - - if (/\#if(def)? (APR_.*)/) { - $count++; - $found++; - push @macro_stack, $macro; - $macro = $2; - $line .= "$macro\n"; - next; - } - elsif (/^(APR_DECLARE[^\(]*\()?(const\s)?[a-z_]+\)?\s+\*?([A-Za-z0-9_]+)\(/) { - # We only want to increase this if we are in the middle of a - # #if ... #endif block. - if ($found) { - $found++; - } - for (my $i=0; $i < $count; $i++) { - $line .= "\t"; - } - $line .= "$3\n"; - next; - } - elsif (/\#endif/) { - if ($count > 0) { - $count--; - $line .= "\/$macro\n"; - $macro = pop @macro_stack; - } - if ($found == $count + 1) { - $found--; - $line = ""; - next; - } - elsif ($found > $count + 1) { - $found = 0; - } - } - if ($line && !$found) { - print OUTFILE "$line"; - $line = ""; - } - } -} - diff --git a/helpers/snapshot b/helpers/snapshot deleted file mode 100755 index 9553a753f9d..00000000000 --- a/helpers/snapshot +++ /dev/null @@ -1,5 +0,0 @@ -#! /bin/sh - -test -n "$1" && ARG="DISTNAME='$1'" - -${MAKE:-make} $ARG -f build/build.mk snapshot From cac80b10286265971fa404cf4a7cd05ffc170912 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 19 Feb 2001 02:06:59 +0000 Subject: [PATCH 1272/7878] rename miss: s/apr_clear_pool/apr_pool_clear/g git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61257 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_compat.h | 2 +- include/apr_pools.h | 4 ++-- lib/apr_pools.c | 6 +++--- memory/unix/apr_pools.c | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/apr_compat.h b/include/apr_compat.h index d33d50a5351..80c3f3fafd6 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -19,7 +19,7 @@ #define ap_check_file_time apr_check_file_time #define ap_filetype_e apr_filetype_e #define ap_cleanup_for_exec apr_pool_cleanup_for_exec -#define ap_clear_pool apr_clear_pool +#define ap_clear_pool apr_pool_clear #define ap_clear_table apr_table_clear #define ap_copy_array apr_array_copy #define ap_copy_array_hdr apr_array_copy_hdr diff --git a/include/apr_pools.h b/include/apr_pools.h index 553a546865d..df9c6e575be 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -291,9 +291,9 @@ APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, * @param p The pool to clear * @tip This does not actually free the memory, it just allows the pool * to re-use this memory for the next allocation. - * @deffunc void apr_clear_pool(apr_pool_t *p) + * @deffunc void apr_pool_clear(apr_pool_t *p) */ -APR_DECLARE(void) apr_clear_pool(apr_pool_t *p); +APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); /** * destroy the pool diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 312cf390d57..4f60d5c0a0b 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -712,13 +712,13 @@ APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp) apr_pool_destroy(globalp); } -/* We only want to lock the mutex if we are being called from apr_clear_pool. +/* We only want to lock the mutex if we are being called from apr_pool_clear. * This is because if we also call this function from apr_destroy_real_pool, * which also locks the same mutex, and recursive locks aren't portable. * This way, we are garaunteed that we only lock this mutex once when calling * either one of these functions. */ -APR_DECLARE(void) apr_clear_pool(apr_pool_t *a) +APR_DECLARE(void) apr_pool_clear(apr_pool_t *a) { while (a->sub_pools) { apr_pool_destroy(a->sub_pools); @@ -755,7 +755,7 @@ APR_DECLARE(void) apr_clear_pool(apr_pool_t *a) APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) { - apr_clear_pool(a); + apr_pool_clear(a); #if APR_HAS_THREADS if (alloc_mutex) { apr_lock_acquire(alloc_mutex); diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 312cf390d57..4f60d5c0a0b 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -712,13 +712,13 @@ APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp) apr_pool_destroy(globalp); } -/* We only want to lock the mutex if we are being called from apr_clear_pool. +/* We only want to lock the mutex if we are being called from apr_pool_clear. * This is because if we also call this function from apr_destroy_real_pool, * which also locks the same mutex, and recursive locks aren't portable. * This way, we are garaunteed that we only lock this mutex once when calling * either one of these functions. */ -APR_DECLARE(void) apr_clear_pool(apr_pool_t *a) +APR_DECLARE(void) apr_pool_clear(apr_pool_t *a) { while (a->sub_pools) { apr_pool_destroy(a->sub_pools); @@ -755,7 +755,7 @@ APR_DECLARE(void) apr_clear_pool(apr_pool_t *a) APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) { - apr_clear_pool(a); + apr_pool_clear(a); #if APR_HAS_THREADS if (alloc_mutex) { apr_lock_acquire(alloc_mutex); From 1845dfe91be2cfb53b540b8dd11a5c4339f637cf Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 19 Feb 2001 13:03:54 +0000 Subject: [PATCH 1273/7878] Stop warning about implicit declaration of apr_vsnprintf. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61258 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 1 + 1 file changed, 1 insertion(+) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 8f500bcc4bf..c3f4d7bb03b 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -58,6 +58,7 @@ #include "fileio.h" #include "apr_file_io.h" #include "apr_lib.h" +#include "apr_strings.h" #include From 21b59ac3411dd239b21d2f5d93e948ed97c15e20 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 19 Feb 2001 18:00:50 +0000 Subject: [PATCH 1274/7878] apr_sendfile() for HP-UX: handle the unexpected case where the caller gives us header bytes to send but no file bytes to send; better to just let it work than to fail the call Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61259 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index b9256e4f815..25d292b5922 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -564,8 +564,8 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, hdtrarray, /* Headers/footers */ flags); /* undefined, set to 0 */ } - else { /* we can't call sendfile() for trailers only */ - rc = write(sock->socketdes, hdtrarray[1].iov_base, hdtrarray[1].iov_len); + else { /* we can't call sendfile() with no bytes to send from the file */ + rc = writev(sock->socketdes, hdtrarray, 2); } } while (rc == -1 && errno == EINTR); @@ -588,8 +588,8 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, hdtrarray, /* Headers/footers */ flags); /* undefined, set to 0 */ } - else { /* we can't call sendfile() for trailers only */ - rc = write(sock->socketdes, hdtrarray[1].iov_base, hdtrarray[1].iov_len); + else { /* we can't call sendfile() with no bytes to send from the file */ + rc = writev(sock->socketdes, hdtrarray, 2); } } while (rc == -1 && errno == EINTR); } From 88ebaaa00eaca1d8899aa34a7df02348ee451f31 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 19 Feb 2001 18:42:18 +0000 Subject: [PATCH 1275/7878] get "make clean" to get rid of the programs in the test directory git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61260 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index e1e1b67cc38..1be7055ac12 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,5 +1,5 @@ -TARGETS = \ +PROGRAMS = \ client@EXEEXT@ \ sendfile@EXEEXT@ \ server@EXEEXT@ \ @@ -21,6 +21,8 @@ TARGETS = \ occhild@EXEEXT@ \ mod_test.so +TARGETS = $(PROGRAMS) + # bring in rules.mk for standard functionality @INCLUDE_RULES@ From 88f0b99c699e5bf9e5845b59ce2b849256da53ad Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 19 Feb 2001 20:55:36 +0000 Subject: [PATCH 1276/7878] Remove a useless test. This file still doesn't compile with Cygwin's pthread.h, but that seems to be Cygwin's fault. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61261 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/threadpriv.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index e5f520afa2e..1799b34f1dc 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -62,7 +62,6 @@ apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) { - apr_status_t stat; (*key) = (apr_threadkey_t *)apr_pcalloc(cont, sizeof(apr_threadkey_t)); if ((*key) == NULL) { @@ -71,10 +70,8 @@ apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, (*key)->cntxt = cont; - if ((stat = pthread_key_create(&(*key)->key, dest)) == 0) { - return stat; - } - return stat; + return pthread_key_create(&(*key)->key, dest); + } apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) From 6f4afe104e2b82123299d6f640671686e6f5da46 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 19 Feb 2001 23:00:39 +0000 Subject: [PATCH 1277/7878] Cope with BSDi installations where the default make has been replaced with GNU make. Submitted by: Joe Orton Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61262 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index d4a4433cc55..bae11f4df1a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Cope with BSDi installations where the default make has been + replaced with GNU make. [Joe Orton ] + *) Changed apr/helpers to apr/build to be consistent with other Apache source trees. Added make variables to rules.mk.in that point to the builders directory and its scripts. Updated buildconf, configure.in, diff --git a/configure.in b/configure.in index d464792b44b..797bb69f653 100644 --- a/configure.in +++ b/configure.in @@ -920,7 +920,13 @@ dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles dnl case "$host_alias" in *bsdi*) - INCLUDE_RULES=".include \"$apr_builders/rules.mk\"" + # Check whether they've installed GNU make + if make --version > /dev/null 2>&1; then + INCLUDE_RULES="include $apr_builders/rules.mk" + else + # BSDi make + INCLUDE_RULES=".include \"$apr_builders/rules.mk\"" + fi ;; *) INCLUDE_RULES="include $apr_builders/rules.mk" From 4c97ece2ff0a56d7497bf1e8419a24ff5430025b Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 20 Feb 2001 01:53:47 +0000 Subject: [PATCH 1278/7878] Name protected the autoconf macros defined by APR. Moved the REENTRANCY_FLAGS settings into apr_hints.m4. Inlined the APR_PREPARE_MM_DIR macro because it could only be used once. Removed the unused macros MY_TRY_RUN, MY_TRY_RUN_NATIVE, and AC_USE_FUNCTION. Added some macro comments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61263 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 +++ build/apr_common.m4 | 104 +++++++++++------------------------ build/apr_hints.m4 | 18 ++++++- build/apr_network.m4 | 16 ++++-- build/apr_threads.m4 | 70 +++++++++--------------- configure.in | 125 +++++++++++++++++++++++++------------------ 6 files changed, 164 insertions(+), 175 deletions(-) diff --git a/CHANGES b/CHANGES index bae11f4df1a..d1e55fc6c8b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) Name protected the autoconf macros defined by APR. Moved the + REENTRANCY_FLAGS settings into apr_hints.m4. Inlined the + APR_PREPARE_MM_DIR macro because it could only be used once. + Removed the unused macros MY_TRY_RUN, MY_TRY_RUN_NATIVE, and + AC_USE_FUNCTION. Added some macro comments. [Roy Fielding] + *) Cope with BSDi installations where the default make has been replaced with GNU make. [Joe Orton ] diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 12bb83c48a7..8cddd5d130d 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -3,9 +3,9 @@ dnl apr_common.m4: APR's general-purpose autoconf macros dnl dnl -dnl RUN_SUBDIR_CONFIG_NOW(dir [, sub-package-cmdline-args]) +dnl APR_SUBDIR_CONFIG(dir [, sub-package-cmdline-args]) dnl -AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [ +AC_DEFUN(APR_SUBDIR_CONFIG, [ # save our work to this point; this allows the sub-package to use it AC_CACHE_SAVE @@ -41,20 +41,8 @@ changequote([, ])dnl # grab any updates from the sub-package AC_CACHE_LOAD -]) - +])dnl -AC_DEFUN(APR_PREPARE_MM_DIR,[ -dnl #----------------------------- Prepare mm directory for VPATH support -if test -n "$USE_MM" && test -n "$USE_VPATH"; then - test -d $mm_dir || $MKDIR $mm_dir - - for i in shtool config.guess config.sub fbtool ltconfig \ - ltmain.sh mm_vers.c; do - test -r $mm_dir/$i || ln -s $abs_srcdir/$mm_dir/$i $mm_dir/$i - done -fi -]) dnl dnl APR_DOEXTRA @@ -86,6 +74,7 @@ AC_DEFUN(APR_DOEXTRA, [ done ]) + dnl dnl APR_SETIFNULL(variable, value) dnl @@ -98,6 +87,7 @@ AC_DEFUN(APR_SETIFNULL,[ fi ]) + dnl dnl APR_SETVAR(variable, value) dnl @@ -108,6 +98,7 @@ AC_DEFUN(APR_SETVAR,[ $1="$2"; export $1 ]) + dnl dnl APR_ADDTO(variable, value) dnl @@ -119,15 +110,10 @@ AC_DEFUN(APR_ADDTO,[ ]) -define(AC_USE_FUNCTION,[dnl -AC_CHECK_FUNCS($1) -if test ".$ac_func_$1" = .yes; then -AC_DEFINE(USE_$2) -fi -]) - - -AC_DEFUN(AC_CHECK_DEFINE_FILES,[ +dnl +dnl APR_CHECK_DEFINE_FILES( symbol, header_file [header_file ...] ) +dnl +AC_DEFUN(APR_CHECK_DEFINE_FILES,[ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ ac_cv_define_$1=no for curhdr in $2 @@ -146,7 +132,10 @@ AC_DEFUN(AC_CHECK_DEFINE_FILES,[ ]) -AC_DEFUN(AC_CHECK_DEFINE,[ +dnl +dnl APR_CHECK_DEFINE( symbol, header_file ) +dnl +AC_DEFUN(APR_CHECK_DEFINE,[ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ AC_EGREP_CPP(YES_IS_DEFINED, [ #include <$2> @@ -161,7 +150,7 @@ AC_DEFUN(AC_CHECK_DEFINE,[ ]) -define(AC_IFALLYES,[dnl +define(APR_IFALLYES,[dnl ac_rc=yes for ac_spec in $1; do ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'` @@ -195,14 +184,14 @@ fi ]) -define(AC_BEGIN_DECISION,[dnl +define(APR_BEGIN_DECISION,[dnl ac_decision_item='$1' ac_decision_msg='FAILED' ac_decision='' ]) -define(AC_DECIDE,[dnl +define(APR_DECIDE,[dnl ac_decision='$1' ac_decision_msg='$2' ac_decision_$1=yes @@ -210,7 +199,7 @@ ac_decision_$1_msg='$2' ]) -define(AC_DECISION_OVERRIDE,[dnl +define(APR_DECISION_OVERRIDE,[dnl ac_decision='' for ac_item in $1; do eval "ac_decision_this=\$ac_decision_${ac_item}" @@ -222,13 +211,13 @@ define(AC_DECISION_OVERRIDE,[dnl ]) -define(AC_DECISION_FORCE,[dnl +define(APR_DECISION_FORCE,[dnl ac_decision="$1" eval "ac_decision_msg=\"\$ac_decision_${ac_decision}_msg\"" ]) -define(AC_END_DECISION,[dnl +define(APR_END_DECISION,[dnl if test ".$ac_decision" = .; then echo "[$]0:Error: decision on $ac_decision_item failed" 1>&2 exit 1 @@ -241,50 +230,14 @@ else fi ]) -dnl ### AC_TRY_RUN had some problems actually using a programs return code, -dnl ### so I am re-working it here to be used in APR's configure script. -dnl MY_TRY_RUN(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE -dnl [, ACTION-IF-CROSS-COMPILING]]]) -AC_DEFUN(MY_TRY_RUN, -[if test "$cross_compiling" = yes; then - ifelse([$4], , - [errprint(__file__:__line__: warning: [AC_TRY_RUN] called without default to allow cross compiling -)dnl - AC_MSG_ERROR(can not run test program while cross compiling)], - [$4]) -else - MY_TRY_RUN_NATIVE([$1], [$2], [$3]) -fi -]) - -dnl Like AC_TRY_RUN but assumes a native-environment (non-cross) compiler. -dnl MY_TRY_RUN_NATIVE(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE]]) -AC_DEFUN(MY_TRY_RUN_NATIVE, -[cat > conftest.$ac_ext </dev/null -then -dnl Don't remove the temporary files here, so they can be examined. - ifelse([$2], , :, [$2]) -else -ifelse([$3], , , [ $3 - rm -fr conftest* -])dnl -fi -rm -fr conftest*]) - +dnl +dnl APR_CHECK_SIZEOF_EXTENDED(INCLUDES, TYPE [, CROSS_SIZE]) +dnl dnl A variant of AC_CHECK_SIZEOF which allows the checking of dnl sizes of non-builtin types -dnl AC_CHECK_SIZEOF_EXTENDED(INCLUDES, TYPE [, CROSS_SIZE]) -AC_DEFUN(AC_CHECK_SIZEOF_EXTENDED, +dnl +AC_DEFUN(APR_CHECK_SIZEOF_EXTENDED, [changequote(<<,>>)dnl dnl The name to #define define(<>, translit(sizeof_$2, [a-z *], [A-Z_P]))dnl @@ -309,6 +262,7 @@ undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl ]) + dnl dnl APR_TRY_COMPILE_NO_WARNING(INCLUDES, FUNCTION-BODY, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) @@ -343,7 +297,9 @@ else ifelse([$4], , , [rm -rf conftest* $4]) fi -rm -f conftest*]) +rm -f conftest* +])dnl + dnl dnl APR_CHECK_ICONV_INBUF @@ -374,5 +330,5 @@ else msg="char **" fi AC_MSG_RESULT([$msg]) -]) +])dnl diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 89800fb6167..6749a17d4bd 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -89,6 +89,7 @@ else APR_ADDTO(CFLAGS, [-qLANGLVL=extended]) fi APR_SETIFNULL(apr_iconv_inbuf_const, [1]) + APR_ADDTO(THREAD_CPPFLAGS, [-D_THREAD_SAFE]) ;; *-apollo-*) APR_ADDTO(CFLAGS, [-DAPOLLO]) @@ -105,6 +106,7 @@ else *-hp-hpux11.*) APR_ADDTO(CFLAGS, [-DHPUX11]) APR_ADDTO(LIBS, [-lpthread]) + APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-hp-hpux10.*) case $host in @@ -114,9 +116,11 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CFLAGS, [-DSELECT_NEEDS_CAST]) ;; esac + APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-hp-hpux*) APR_ADDTO(CFLAGS, [-DHPUX]) + APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-linux-*) case `uname -r` in @@ -129,6 +133,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? * ) ;; esac + APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-GNU*) APR_ADDTO(CFLAGS, [-DHURD]) @@ -141,6 +146,9 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *486-*-bsdi*) APR_ADDTO(CFLAGS, [-m486]) ;; + *-openbsd*) + APR_ADDTO(THREAD_CPPFLAGS, [-D_POSIX_THREADS]) + ;; *-netbsd*) APR_ADDTO(CFLAGS, [-DNETBSD]) APR_ADDTO(LIBS, [-lcrypt]) @@ -152,7 +160,8 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; esac APR_ADDTO(LIBS, [-lcrypt]) - APR_SETIFNULL(enable_threads, [no]) + APR_SETIFNULL(enable_threads, [no]) + APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT -D_THREAD_SAFE]) ;; *-next-nextstep*) APR_SETIFNULL(OPTIM, [-O]) @@ -190,20 +199,24 @@ dnl ;; *-sco3*) APR_ADDTO(CFLAGS, [-DSCO -Oacgiltz]) APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) + APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-sco5*) APR_ADDTO(CFLAGS, [-DSCO5]) APR_ADDTO(LIBS, [-lsocket -lmalloc -lprot -ltinfo -lx]) + APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-sco_sv*|*-SCO_SV*) APR_ADDTO(CFLAGS, [-DSCO]) APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) + APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-solaris2*) PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` APR_ADDTO(CFLAGS, [-DSOLARIS2=$PLATOSVERS]) APR_ADDTO(LIBS, [-lsocket -lnsl]) APR_SETIFNULL(apr_iconv_inbuf_const, [1]) + APR_ADDTO(THREAD_CPPFLAGS, [-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT]) ;; *-sunos4*) APR_ADDTO(CFLAGS, [-DSUNOS4 -DUSEBCOPY]) @@ -333,6 +346,9 @@ dnl ;; APR_SETIFNULL(OPTIM, [-O]) APR_SETIFNULL(MAKE, [make]) ;; + *-irix*) + APR_ADDTO(THREAD_CPPFLAGS, [-D_POSIX_THREAD_SAFE_FUNCTIONS]) + ;; *beos*) APR_ADDTO(CFLAGS, [-DBEOS]) PLATOSVERS=`uname -r` diff --git a/build/apr_network.m4 b/build/apr_network.m4 index a1a3b6d2266..ecf5404eb52 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -48,6 +48,7 @@ if test "$ac_cv_working_getaddrinfo" = "yes"; then fi ]) + dnl dnl check for gethostbyname() which handles numeric address strings dnl @@ -90,6 +91,7 @@ if test "$ac_cv_gethostbyname_nas" = "yes"; then fi ]) + dnl dnl check for socklen_t, fall back to unsigned int dnl @@ -117,7 +119,6 @@ fi ]) - AC_DEFUN(APR_CHECK_INET_ADDR,[ AC_CACHE_CHECK(for inet_addr, ac_cv_func_inet_addr,[ AC_TRY_COMPILE([ @@ -195,6 +196,7 @@ else fi ]) + dnl dnl Check to see if this platform includes sa_len in it's dnl struct sockaddr. If it does it changes the length of sa_family @@ -261,9 +263,7 @@ unsigned long foo = INADDR_NONE; dnl -dnl APR_CHECK_H_ERRNO_FLAG -dnl -dnl checks which flags are necessary for to define h_errno +dnl APR_H_ERRNO_COMPILE_CHECK dnl AC_DEFUN(APR_H_ERRNO_COMPILE_CHECK,[ if test x$1 != x; then @@ -287,6 +287,13 @@ int h_e = h_errno; ],[ ac_cv_h_errno_cflags=no ])]) + + +dnl +dnl APR_CHECK_H_ERRNO_FLAG +dnl +dnl checks which flags are necessary for to define h_errno +dnl AC_DEFUN(APR_CHECK_H_ERRNO_FLAG,[ AC_MSG_CHECKING([for h_errno in netdb.h]) AC_CACHE_VAL(ac_cv_h_errno_cflags,[ @@ -335,3 +342,4 @@ int main(void) { fi AC_SUBST(apr_charset_ebcdic) ]) + diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index c1c6074bf9f..9a9e2a013c1 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -3,46 +3,14 @@ dnl apr_threads.m4: APR's autoconf macros for testing thread support dnl dnl -dnl REENTRANCY_FLAGS +dnl APR_CHECK_PTHREADS_H([ ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl -dnl Set some magic defines -dnl -AC_DEFUN(REENTRANCY_FLAGS,[ - if test -z "$host_alias"; then - host_alias=`$ac_config_guess` - fi - case "$host_alias" in - *solaris*) - PTHREAD_FLAGS="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";; - *freebsd*) - PTHREAD_FLAGS="-D_REENTRANT -D_THREAD_SAFE";; - *openbsd*) - PTHREAD_FLAGS="-D_POSIX_THREADS";; - *linux*) - PTHREAD_FLAGS="-D_REENTRANT";; - *aix*) - PTHREAD_FLAGS="-D_THREAD_SAFE";; - *irix*) - PTHREAD_FLAGS="-D_POSIX_THREAD_SAFE_FUNCTIONS";; - *hpux*) - PTHREAD_FLAGS="-D_REENTRANT";; - *sco*) - PTHREAD_FLAGS="-D_REENTRANT";; -dnl Solves sigwait() problem, creates problems with u_long etc. -dnl PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE_EXTENDED=1";; - esac - - if test -n "$PTHREAD_FLAGS"; then - CPPFLAGS="$CPPFLAGS $PTHREAD_FLAGS" - THREAD_CPPFLAGS="$THREAD_CPPFLAGS $PTHREAD_FLAGS" - fi -])dnl - dnl gcc issues warnings when parsing AIX 4.3.3's pthread.h dnl which causes autoconf to incorrectly conclude that dnl pthreads is not available. dnl Turn off warnings if we're using gcc. -AC_DEFUN(CHECK_PTHREADS_H, [ +dnl +AC_DEFUN(APR_CHECK_PTHREADS_H, [ if test "$GCC" = "yes"; then SAVE_FL="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -w" @@ -53,6 +21,10 @@ AC_DEFUN(CHECK_PTHREADS_H, [ fi ])dnl + +dnl +dnl APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS +dnl AC_DEFUN(APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS, [ AC_CACHE_CHECK(whether pthread_getspecific takes two arguments, ac_cv_pthread_getspecific_two_args,[ AC_TRY_COMPILE([ @@ -71,9 +43,12 @@ pthread_getspecific(key,&tmp); if test "$ac_cv_pthread_getspecific_two_args" = "yes"; then AC_DEFINE(PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS, 1, [Define if pthread_getspecific() has two args]) fi - ])dnl + +dnl +dnl APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG +dnl AC_DEFUN(APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG, [ AC_CACHE_CHECK(whether pthread_attr_getdetachstate takes one argument, ac_cv_pthread_attr_getdetachstate_one_arg,[ AC_TRY_COMPILE([ @@ -91,14 +66,15 @@ pthread_attr_getdetachstate(attr); if test "$ac_cv_pthread_attr_getdetachstate_one_arg" = "yes"; then AC_DEFINE(PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG, 1, [Define if pthread_attr_getdetachstate() has one arg]) fi - ])dnl + + dnl -dnl PTHREADS_CHECK_COMPILE +dnl APR_PTHREADS_CHECK_COMPILE dnl dnl Check whether the current setup can use POSIX threads calls dnl -AC_DEFUN(PTHREADS_CHECK_COMPILE, [ +AC_DEFUN(APR_PTHREADS_CHECK_COMPILE, [ AC_TRY_RUN( [ #include #include @@ -117,13 +93,16 @@ int main() { pthreads_working="yes" ], [ pthreads_working="no" - ], pthreads_working="no" ) ] )dnl + ], pthreads_working="no" ) +])dnl + + dnl -dnl PTHREADS_CHECK() +dnl APR_PTHREADS_CHECK() dnl dnl Try to find a way to enable POSIX threads dnl -AC_DEFUN(PTHREADS_CHECK,[ +AC_DEFUN(APR_PTHREADS_CHECK,[ if test -n "$ac_cv_pthreads_lib"; then LIBS="$LIBS -l$ac_cv_pthreads_lib" fi @@ -133,7 +112,7 @@ if test -n "$ac_cv_pthreads_cflags"; then THREAD_CFLAGS="$THREAD_CFLAGS $ac_cv_pthreads_cflags" fi -PTHREADS_CHECK_COMPILE +APR_PTHREADS_CHECK_COMPILE AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[ ac_cv_pthreads_cflags="" @@ -141,7 +120,7 @@ if test "$pthreads_working" != "yes"; then for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt; do ac_save="$CFLAGS" CFLAGS="$CFLAGS $flag" - PTHREADS_CHECK_COMPILE + APR_PTHREADS_CHECK_COMPILE if test "$pthreads_working" = "yes"; then ac_cv_pthreads_cflags="$flag" dnl this was already added to CFLAGS; add to THREAD_CFLAGS, too @@ -153,13 +132,14 @@ if test "$pthreads_working" != "yes"; then fi ]) + AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[ ac_cv_pthreads_lib="" if test "$pthreads_working" != "yes"; then for lib in pthread pthreads c_r; do ac_save="$LIBS" LIBS="$LIBS -l$lib" - PTHREADS_CHECK_COMPILE + APR_PTHREADS_CHECK_COMPILE if test "$pthreads_working" = "yes"; then ac_cv_pthreads_lib="$lib" break diff --git a/configure.in b/configure.in index 797bb69f653..99ff153066a 100644 --- a/configure.in +++ b/configure.in @@ -22,14 +22,18 @@ dnl Absolute source/build directory abs_srcdir=`(cd $srcdir && pwd)` abs_builddir=`pwd` -dnl Libtool needs this symbol -top_builddir="$abs_builddir" -AC_SUBST(top_builddir) - if test "$abs_builddir" != "$abs_srcdir"; then USE_VPATH=1 fi +dnl Libtool needs this symbol +if test -n "$BUILD_BASE"; then + top_builddir="$BUILD_BASE" +else + top_builddir="$abs_builddir" +fi +AC_SUBST(top_builddir) + dnl Directory containing apr build macros, helpers, and make rules apr_builders=$abs_srcdir/build AC_SUBST(apr_builders) @@ -39,7 +43,8 @@ MKDIR=$apr_builders/mkdir.sh # These added to allow default directories to be used... DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" -MODULES="file_io network_io threadproc misc locks time mmap shmem i18n user" + +apr_modules="file_io network_io threadproc misc locks time mmap shmem i18n user" dnl # Checks for programs. AC_PROG_CC @@ -107,7 +112,7 @@ case "$OS" in config_subdirs="shmem/unix/mm" native_mmap_emul="1" USE_MM=yes - AC_CHECK_DEFINE(BONE_VERSION, sys/socket.h) + APR_CHECK_DEFINE(BONE_VERSION, sys/socket.h) eolstr="\\n" file_as_socket="0" ;; @@ -147,9 +152,17 @@ echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" # run this on a more conditional basis. mm_dir=shmem/unix/mm +dnl #----------------------------- Prepare mm directory for VPATH support if test "$USE_MM" = "yes"; then - APR_PREPARE_MM_DIR - RUN_SUBDIR_CONFIG_NOW($config_subdirs) + if test -n "$USE_VPATH"; then + test -d $mm_dir || $MKDIR $mm_dir + + for i in shtool config.guess config.sub fbtool ltconfig \ + ltmain.sh mm_vers.c; do + test -r $mm_dir/$i || ln -s $abs_srcdir/$mm_dir/$i $mm_dir/$i + done + fi + APR_SUBDIR_CONFIG($config_subdirs) fi AC_MSG_CHECKING(for Shared memory support) @@ -185,7 +198,7 @@ AC_SUBST(anonymous_shm) AC_SUBST(filebased_shm) AC_SUBST(keybased_shm) -AC_CHECK_DEFINE(MM_SHMT_MMFILE, $srcdir/shmem/unix/mm/mm_conf.h) +APR_CHECK_DEFINE(MM_SHMT_MMFILE, $srcdir/shmem/unix/mm/mm_conf.h) if test "ac_cv_define_MM_SHMT_MMFILE" = "yes"; then file_based="1" @@ -431,7 +444,7 @@ else socklen_t_value="int" fi -AC_CHECK_SIZEOF_EXTENDED([#include ], ssize_t, 8) +APR_CHECK_SIZEOF_EXTENDED([#include ], ssize_t, 8) if test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then ssize_t_fmt='#define APR_SSIZE_T_FMT "d"' @@ -441,7 +454,7 @@ else ssize_t_fmt='#error Can not determine the proper size for ssize_t' fi -AC_CHECK_SIZEOF_EXTENDED([#include ], size_t, 8) +APR_CHECK_SIZEOF_EXTENDED([#include ], size_t, 8) if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then size_t_fmt='#define APR_SIZE_T_FMT "d"' @@ -451,7 +464,7 @@ else size_t_fmt='#error Can not determine the proper size for size_t' fi -AC_CHECK_SIZEOF_EXTENDED([#include ], off_t, 8) +APR_CHECK_SIZEOF_EXTENDED([#include ], off_t, 8) if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then off_t_fmt='#define APR_OFF_T_FMT "d"' @@ -535,7 +548,7 @@ if test "$tempdso" = "no"; then aprdso="0" else aprdso="1" - MODULES="$MODULES dso" + apr_modules="$apr_modules dso" fi AC_SUBST(aprdso) @@ -545,10 +558,10 @@ echo $ac_n "${nl}Checking for Threads...${nl}" if test -z "$enable_threads"; then AC_ARG_ENABLE(threads, - [ --enable-threads Enable threading support in APR.], - [ enable_threads=$enableval] , - [ CHECK_PTHREADS_H([ enable_threads="pthread" ] , - [ enable_threads="no" ] ) ] ) + [ --enable-threads Enable threading support in APR.], + [ enable_threads=$enableval] , + [ APR_CHECK_PTHREADS_H([ enable_threads="pthread" ] , + [ enable_threads="no" ] ) ] ) fi if test "$enable_threads" = "no"; then @@ -557,12 +570,22 @@ echo "Don't enable threads" pthreadh="0" pthreadser="0" else - REENTRANCY_FLAGS +# +# Play with CPPFLAGS given what was learned from APR_PRELOAD. +# +# [Roy: I don't like this because it messes up an environment +# variable that should remain pristine. However, it is needed +# for compatibility until all flag handling can be rewritten.] +# + apr_save_cppflags="$CPPFLAGS" + if test -n "$THREAD_CPPFLAGS"; then + CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS" + fi if test "$enable_threads" = "pthread"; then # We have specified pthreads for our threading library, just make sure # that we have everything we need - PTHREADS_CHECK - CHECK_PTHREADS_H([ + APR_PTHREADS_CHECK + APR_CHECK_PTHREADS_H([ threads="1" pthreadh="1" pthreadser="1" @@ -578,22 +601,22 @@ else # We basically specified that we wanted threads, but not how to implement # them. In this case, just look for pthreads. In the future, we can check # for other threading libraries as well. - PTHREADS_CHECK - CHECK_PTHREADS_H([ + APR_PTHREADS_CHECK + APR_CHECK_PTHREADS_H([ threads="1" pthreadh="1" pthreadser="1" AC_DEFINE(USE_THREADS) ], [ threads="0" pthreadser="0" - pthreadh="0" ] ) + pthreadh="0" + CPPFLAGS="$apr_save_cppflags" ] ) + fi + if test "$pthreadh" = "1"; then + APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS + APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG + AC_CHECK_FUNCS(pthread_key_delete) fi -fi - -if test "$pthreadh" = "1"; then - APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS - APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG - AC_CHECK_FUNCS(pthread_key_delete) fi ac_cv_define_READDIR_IS_THREAD_SAFE=no @@ -693,33 +716,33 @@ AC_MSG_RESULT([$msg]) AC_SUBST(have_union_semun) dnl Checks for libraries. -AC_CHECK_DEFINE(LOCK_EX, sys/file.h) -AC_CHECK_DEFINE(F_SETLK, fcntl.h) -AC_CHECK_DEFINE(CODESET, langinfo.h) +APR_CHECK_DEFINE(LOCK_EX, sys/file.h) +APR_CHECK_DEFINE(F_SETLK, fcntl.h) +APR_CHECK_DEFINE(CODESET, langinfo.h) # We are assuming that if the platform doesn't have POLLIN, it doesn't have # any POLL definitions. -AC_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h) +APR_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h) if test "$threads" = "1"; then - AC_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h) -fi - -# The last AC_DECIDE to execute sets the default -AC_BEGIN_DECISION([apr_lock implementation method]) -AC_IFALLYES(func:semget func:semctl, - AC_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) -AC_IFALLYES(header:sys/file.h define:LOCK_EX, - AC_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) -AC_IFALLYES(header:fcntl.h define:F_SETLK, - AC_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) -AC_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl + APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h) +fi + +# The last APR_DECIDE to execute sets the default +APR_BEGIN_DECISION([apr_lock implementation method]) +APR_IFALLYES(func:semget func:semctl, + APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) +APR_IFALLYES(header:sys/file.h define:LOCK_EX, + APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) +APR_IFALLYES(header:fcntl.h define:F_SETLK, + APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) +APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl custom:with_pthread_cross, - AC_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) + APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) if test "x$apr_lock_method" != "x"; then - AC_DECISION_FORCE($apr_lock_method) + APR_DECISION_FORCE($apr_lock_method) fi -AC_END_DECISION +APR_END_DECISION AC_DEFINE_UNQUOTED($ac_decision) flockser="0" @@ -820,8 +843,8 @@ APR_CHECK_SOCKADDR_SA_LEN APR_CHECK_GETHOSTBYNAME_NAS dnl # Look for a way of corking TCP... -AC_CHECK_DEFINE(TCP_CORK, netinet/tcp.h) -AC_CHECK_DEFINE(TCP_NOPUSH, netinet/tcp.h) +APR_CHECK_DEFINE(TCP_CORK, netinet/tcp.h) +APR_CHECK_DEFINE(TCP_NOPUSH, netinet/tcp.h) apr_tcp_nopush_flag="0" have_corkable_tcp="0" if test "x$ac_cv_define_TCP_CORK" = "xyes"; then @@ -894,7 +917,7 @@ AC_SUBST(LIBTOOL_LIBS) echo "${nl}Construct Makefiles and header files." MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile" SUBDIRS="lib strings passwd tables " -for dir in $MODULES +for dir in $apr_modules do test -d $dir || $MKDIR $dir if test -f $srcdir/$dir/$OSDIR/Makefile.in; then From 008a0d457555f6d46131ea6c3b5183fb9c8e1780 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 20 Feb 2001 03:03:34 +0000 Subject: [PATCH 1279/7878] make rules (rules.mk) will be in the builddir for vpath, so including it from the srcdir won't work. Submitted by: Kevin Pilch-Bisson Reviewed by: Roy Fielding git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61264 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 99ff153066a..9fe82607683 100644 --- a/configure.in +++ b/configure.in @@ -35,6 +35,9 @@ fi AC_SUBST(top_builddir) dnl Directory containing apr build macros, helpers, and make rules +dnl NOTE: make rules (rules.mk) will be in the builddir for vpath +dnl +apr_buildout=$abs_builddir/build apr_builders=$abs_srcdir/build AC_SUBST(apr_builders) @@ -945,14 +948,14 @@ case "$host_alias" in *bsdi*) # Check whether they've installed GNU make if make --version > /dev/null 2>&1; then - INCLUDE_RULES="include $apr_builders/rules.mk" + INCLUDE_RULES="include $apr_buildout/rules.mk" else # BSDi make - INCLUDE_RULES=".include \"$apr_builders/rules.mk\"" + INCLUDE_RULES=".include \"$apr_buildout/rules.mk\"" fi ;; *) - INCLUDE_RULES="include $apr_builders/rules.mk" + INCLUDE_RULES="include $apr_buildout/rules.mk" ;; esac AC_SUBST(INCLUDE_RULES) From 59db3b9fac6d3541909f3ffeaa797e4c61cb4323 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 20 Feb 2001 20:08:17 +0000 Subject: [PATCH 1280/7878] In apr_shm_init(), check the retcode from mm_malloc(). Previously, we segfaulted here if mm_malloc() failed to get a lock. An example error scenario is when the lock file lives on a filesystem which doesn't support locking. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61265 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ shmem/unix/shmem.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGES b/CHANGES index d1e55fc6c8b..60609737119 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) In apr_shm_init(), check the retcode from mm_malloc(). Previously, + we segfaulted here if mm_malloc() failed to get a lock. An example + error scenario is when the lock file lives on a filesystem which + doesn't support locking. [Jeff Trawick] + *) Name protected the autoconf macros defined by APR. Moved the REENTRANCY_FLAGS settings into apr_hints.m4. Inlined the APR_PREPARE_MM_DIR macro because it could only be used once. diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 9c57742da9d..5647842861d 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -75,6 +75,12 @@ apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *fi return errno; } (*m) = mm_malloc(newmm, sizeof(struct shmem_t)); + /* important to check this; we may be locking a lock file for the first + * time, which won't work if the file is on NFS + */ + if (!*m) { + return errno; + } (*m)->mm = newmm; #if BEOS (*m)->id = area_for((*m)); From a757493df1d348cb34374cbd7138a6546e5f4e0e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 21 Feb 2001 01:15:48 +0000 Subject: [PATCH 1281/7878] Add some functions to APR's thread/processes support to allow a single thread to handle all signal processing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61266 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_threads.m4 | 24 ++++++++++++++++++++ include/apr_thread_proc.h | 22 ++++++++++++++++++ threadproc/unix/signals.c | 47 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+) diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index 9a9e2a013c1..05602eea6d5 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -156,3 +156,27 @@ else fi ])dnl +AC_DEFUN(APACHE_CHECK_SIGWAIT_ONE_ARG,[ + AC_CACHE_CHECK(whether sigwait takes one argument,ac_cv_sigwait_one_arg,[ + AC_TRY_COMPILE([ +#ifdef __NETBSD__ + /* When using the unproven-pthreads package, we need to pull in this + * header to get a prototype for sigwait(). Else things will fail later + * on. XXX Should probably be fixed in the unproven-pthreads package. + */ +#include +#endif +#include +],[ + sigset_t set; + + sigwait(&set); +],[ + ac_cv_sigwait_one_arg=yes +],[ + ac_cv_sigwait_one_arg=no +])]) + if test "$ac_cv_sigwait_one_arg" = "yes"; then + AC_DEFINE(SIGWAIT_TAKES_ONE_ARG,1,[ ]) + fi +]) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index a9d6fde344d..0b969498540 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -584,6 +584,28 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how); +/** + * Setup the process for a single thread to be used for all signal handling. + * @warn This must be called before any threads are created + * @deffunc apr_status_t apr_setup_signal_thread(void) + */ +APR_DECLARE(apr_status_t) apr_setup_signal_thread(void); + +/** + * Create a thread that will listen for signals. The thread will loop + * forever, calling a provided function whenever it receives a signal. That + * functions should return 1 if the signal has been handled, 0 otherwise. + * @param td The newly created thread + * @param tattr The threadattr to use when creating the thread + * @param signal_handler The function to call when a signal is received + * @param p The pool to use when creating the thread + * @deffunc apr_status_t apr_create_signal_thread(apr_thread_t **td, apr_threadattr_t *tattr, int (*signal_handler)(int signum), apr_pool_t *p) + */ +APR_DECLARE(apr_status_t) apr_create_signal_thread(apr_thread_t **td, + apr_threadattr_t *tattr, + int (*signal_handler)(int signum), + apr_pool_t *p); + #ifdef __cplusplus } #endif diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 6e5f5115970..ee9d9f2b622 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -63,6 +63,7 @@ #include "apr_want.h" #include +#include apr_status_t apr_proc_kill(apr_proc_t *proc, int signum) @@ -264,3 +265,49 @@ const char *apr_signal_get_description(int signum) } #endif /* SYS_SIGLIST_DECLARED */ + +static void *signal_thread_func(void *signal_handler) +{ + sigset_t sig_mask; + int (*sig_func)(int signum) = signal_handler; + + /* This thread will be the one responsible for handling signals */ + sigfillset(&sig_mask); + while (1) { + int signal_received; + + apr_sigwait(&sig_mask, &signal_received); + if (sig_func(signal_received) == 1) { + return NULL; + } + } +} + +APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) +{ + sigset_t sig_mask; + int rv; + + /* All threads should mask signals out, accoring to sigwait(2) man page */ + sigfillset(&sig_mask); + +#ifdef SIGPROCMASK_SETS_THREAD_MASK + rv = sigprocmask(SIG_SETMASK, &sig_mask, NULL); +#else + if ((rv = pthread_sigmask(SIG_SETMASK, &sig_mask, NULL)) != 0) { +#ifdef PTHREAD_SETS_ERRNO + rv = errno; +#endif + } +#endif + return rv; +} + +APR_DECLARE(apr_status_t) apr_create_signal_thread(apr_thread_t **td, + apr_threadattr_t *tattr, + int (*signal_handler)(int signum), + apr_pool_t *p) +{ + return apr_thread_create(td, tattr, signal_thread_func, signal_handler, p); +} + From 93551fad19296bf1b05aff3880b8ff0c0473ff1e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 21 Feb 2001 10:44:15 +0000 Subject: [PATCH 1282/7878] get APR apps to build again by fixing the unresolve reference to apr_sigwait() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61267 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index ee9d9f2b622..efeef08fdc4 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -65,7 +65,6 @@ #include #include - apr_status_t apr_proc_kill(apr_proc_t *proc, int signum) { #ifdef OS2 @@ -276,7 +275,16 @@ static void *signal_thread_func(void *signal_handler) while (1) { int signal_received; - apr_sigwait(&sig_mask, &signal_received); +#ifdef SIGWAIT_TAKES_ONE_ARG + signal_received = sigwait(&sig_mask); + if (signal_received == -1) +#else + if (sigwait(&sig_mask, &signal_received) == -1) +#endif + { + /* handle sigwait() error here */ + } + if (sig_func(signal_received) == 1) { return NULL; } From 219411c10f27c347d44dd26e8663e690ae274ced Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 21 Feb 2001 11:35:15 +0000 Subject: [PATCH 1283/7878] Fix the name of the foo_CHECK_SIGWAIT_ONE_ARG macro. It should be APR_CHECK_SIGWAIT_ONE_ARG instead of APACHE_CHECK_SIGWAIT_ONE_ARG. Apache fix will follow very shortly. Note that buildconf warnings were caused by APACHE_CHECK_SIGWAIT_ONE_ARG being defined twice. The duplicate definition (http-2.0/server/mpm/config.m4) will be removed with the Apache commit. Submitted by: Roy Fielding git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61268 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_threads.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index 05602eea6d5..95f744ce5e1 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -156,7 +156,7 @@ else fi ])dnl -AC_DEFUN(APACHE_CHECK_SIGWAIT_ONE_ARG,[ +AC_DEFUN(APR_CHECK_SIGWAIT_ONE_ARG,[ AC_CACHE_CHECK(whether sigwait takes one argument,ac_cv_sigwait_one_arg,[ AC_TRY_COMPILE([ #ifdef __NETBSD__ From 9bbaa7c5132c63a3c298fe6987161f2aa1d25bcb Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 21 Feb 2001 11:44:43 +0000 Subject: [PATCH 1284/7878] fix another glitch: It is APR which uses the result of APR_CHECK_SIGWAIT_ONE_ARG so APR must actually invoke the macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61269 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index 9fe82607683..d3bcc489f53 100644 --- a/configure.in +++ b/configure.in @@ -284,6 +284,8 @@ AC_SUBST(iconv) AC_SUBST(mmap) AC_SUBST(have_memmove) +APR_CHECK_SIGWAIT_ONE_ARG + dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC From 25c034d167125fd2bf0393156165656d5fe2a199 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 21 Feb 2001 13:21:47 +0000 Subject: [PATCH 1285/7878] Get APR apps building on FreeBSD when --enable-threads isn't specified. We had unresolved references for pthread_sigmask() and sigwait(). These thread support functions aren't appropriate anyway if !APR_HAS_THREADS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61270 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 ++ threadproc/unix/signals.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 0b969498540..dfe4829354b 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -584,6 +584,7 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how); +#if APR_HAS_THREADS /** * Setup the process for a single thread to be used for all signal handling. * @warn This must be called before any threads are created @@ -605,6 +606,7 @@ APR_DECLARE(apr_status_t) apr_create_signal_thread(apr_thread_t **td, apr_threadattr_t *tattr, int (*signal_handler)(int signum), apr_pool_t *p); +#endif /* APR_HAS_THREADS */ #ifdef __cplusplus } diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index efeef08fdc4..a96fded38a5 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -63,7 +63,9 @@ #include "apr_want.h" #include +#if APR_HAS_THREADS && APR_HAVE_PTHREAD_H #include +#endif apr_status_t apr_proc_kill(apr_proc_t *proc, int signum) { @@ -265,6 +267,7 @@ const char *apr_signal_get_description(int signum) #endif /* SYS_SIGLIST_DECLARED */ +#if APR_HAS_THREADS static void *signal_thread_func(void *signal_handler) { sigset_t sig_mask; @@ -299,7 +302,7 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) /* All threads should mask signals out, accoring to sigwait(2) man page */ sigfillset(&sig_mask); -#ifdef SIGPROCMASK_SETS_THREAD_MASK +#if !APR_HAS_THREADS || defined(SIGPROCMASK_SETS_THREAD_MASK) rv = sigprocmask(SIG_SETMASK, &sig_mask, NULL); #else if ((rv = pthread_sigmask(SIG_SETMASK, &sig_mask, NULL)) != 0) { @@ -319,3 +322,4 @@ APR_DECLARE(apr_status_t) apr_create_signal_thread(apr_thread_t **td, return apr_thread_create(td, tattr, signal_thread_func, signal_handler, p); } +#endif From d1c45f0822396c700244cdee3e1b85fba879c226 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 21 Feb 2001 14:35:01 +0000 Subject: [PATCH 1286/7878] disable sendfile() support on s390 linux due to a system problem. Submitted by: Martin Kraemer Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61271 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.in b/configure.in index d3bcc489f53..75a34bb3080 100644 --- a/configure.in +++ b/configure.in @@ -650,6 +650,9 @@ case "$OS" in *alpha*-dec-osf* ) sendfile="0" ;; + s390-*-linux-gnu) + sendfile="0" + ;; esac if test "$orig_sendfile" != "$sendfile"; then echo "sendfile support disabled to avoid system problem" From ea285a6560b6f601957ac52df6246b314a22cba2 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 21 Feb 2001 14:49:45 +0000 Subject: [PATCH 1287/7878] WIN32: Kill the dir cleanup on a directory close. Clean-up the code a bit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61272 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index b21f7cda759..514d25f627c 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -135,11 +135,8 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *dir) { - if (dir->dirhand != INVALID_HANDLE_VALUE && !FindClose(dir->dirhand)) { - return apr_get_os_error(); - } - dir->dirhand = INVALID_HANDLE_VALUE; - return APR_SUCCESS; + apr_pool_cleanup_kill(dir->cntxt, dir, dir_cleanup); + return dir_cleanup(dir); } APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, From 700084c91fb579cc5324a075377ba29eac69d777 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 21 Feb 2001 14:52:15 +0000 Subject: [PATCH 1288/7878] Unregister the cleanup, regardless of the success of failure of the call to dir_cleanup. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61273 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 0bb1cc8dd4c..57fbea0fd85 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -103,13 +103,8 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont apr_status_t apr_dir_close(apr_dir_t *thedir) { - apr_status_t rv; - - if ((rv = dir_cleanup(thedir)) == APR_SUCCESS) { - apr_pool_cleanup_kill(thedir->cntxt, thedir, dir_cleanup); - return APR_SUCCESS; - } - return rv; + apr_pool_cleanup_kill(thedir->cntxt, thedir, dir_cleanup); + return dir_cleanup(thedir); } apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, From 00858585912a36d5d4e981e16a016eb588e54316 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Wed, 21 Feb 2001 15:51:43 +0000 Subject: [PATCH 1289/7878] Add mktemp() and mkstemp() emulation for systems which don't have it. Jean-Frederic writes: I have tested Apache2.0 with a ReliantUNIX machine. This machine has a SVR4 Unix implementation. To compile correctly the -DXTI_SUPPORT should be added to CFLAGS (I have done it when calling configure), and I have added a mkstemp() because it is not in the default runtime library. I have reused and enhanced an mkstemp() routine from FreeBSD. Find enclosed the needed patch to test for mkstemp() and to use ap_mkstemp() when needed. Submitted by: Jean-Frederic Clere git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61274 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + file_io/unix/Makefile.in | 3 +- file_io/unix/mktemp.c | 217 +++++++++++++++++++++++++++++++++++++++ include/apr_general.h | 6 ++ 4 files changed, 226 insertions(+), 1 deletion(-) create mode 100644 file_io/unix/mktemp.c diff --git a/configure.in b/configure.in index 75a34bb3080..634144b0c73 100644 --- a/configure.in +++ b/configure.in @@ -273,6 +273,7 @@ if test "$native_mmap_emul" = "1"; then fi AC_CHECK_FUNCS(hstrerror) AC_CHECK_FUNCS(memmove, [ have_memmove="1" ], [have_memmove="0" ]) +AC_CHECK_FUNCS(have_mkstemp, [ have_mkstemp="1" ], [have_mkstemp="0" ]) AC_SUBST(fork) AC_SUBST(have_inet_addr) diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index d612ce1987b..ca1ac0c204b 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -9,7 +9,8 @@ TARGETS = \ open.lo \ pipe.lo \ readwrite.lo \ - seek.lo + seek.lo \ + mktemp.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c new file mode 100644 index 00000000000..e572d0f0c58 --- /dev/null +++ b/file_io/unix/mktemp.c @@ -0,0 +1,217 @@ +/* + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __warn_references +#define __warn_references(a,b) +#endif +#ifdef SVR4 +#include +#define arc4random() rand() +#define seedrandom(a) srand(a) +#else +#include +#define arc4random() random() +#define seedrandom(a) srandom(a) +#endif +#define _open(a,b,c) open(a,b,c) +#define mkdtemp ap_mkdtemp +#define mkstemp ap_mkstemp +#define mkstemps ap_mkstemps +#define mktemp ap_mktemp + +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93"; +#endif +static const char rcsid[] = + "$FreeBSD: src/lib/libc/stdio/mktemp.c,v 1.19.2.1 2001/01/20 09:35:24 kris Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef SVR4 +/* arrange to compile it on my machine */ +char *_mktemp(char *); +#else +char *_mktemp __P((char *)); +static int _gettemp (char *, int *, int, int); +#endif + + +static const unsigned char padchar[] = +"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; +static uint32_t randseed=0; + +int +mkstemps(path, slen) + char *path; + int slen; +{ + int fd; + + return (_gettemp(path, &fd, 0, slen) ? fd : -1); +} + +int +mkstemp(path) + char *path; +{ + int fd; + + return (_gettemp(path, &fd, 0, 0) ? fd : -1); +} + +char * +mkdtemp(path) + char *path; +{ + return(_gettemp(path, (int *)NULL, 1, 0) ? path : (char *)NULL); +} + +char * +_mktemp(path) + char *path; +{ + return(_gettemp(path, (int *)NULL, 0, 0) ? path : (char *)NULL); +} + +__warn_references(mktemp, + "warning: mktemp() possibly used unsafely; consider using mkstemp()"); + +char * +mktemp(path) + char *path; +{ + return(_mktemp(path)); +} + +static int +_gettemp(path, doopen, domkdir, slen) + char *path; + register int *doopen; + int domkdir; + int slen; +{ + register char *start, *trv, *suffp; + char *pad; + struct stat sbuf; + int rval; + uint32_t randnum; + + if (doopen && domkdir) { + errno = EINVAL; + return(0); + } + if (randseed==0) { + randseed = time(NULL); + seedrandom(randseed); + } + + for (trv = path; *trv; ++trv) + ; + trv -= slen; + suffp = trv; + --trv; + if (trv < path) { + errno = EINVAL; + return (0); + } + + /* Fill space with random characters */ + while (*trv == 'X') { + randnum = arc4random() % (sizeof(padchar) - 1); + *trv-- = padchar[randnum]; + } + start = trv + 1; + + /* + * check the target directory. + */ + if (doopen || domkdir) { + for (;; --trv) { + if (trv <= path) + break; + if (*trv == '/') { + *trv = '\0'; + rval = stat(path, &sbuf); + *trv = '/'; + if (rval != 0) + return(0); + if (!S_ISDIR(sbuf.st_mode)) { + errno = ENOTDIR; + return(0); + } + break; + } + } + } + + for (;;) { + errno = 0; + if (doopen) { + if ((*doopen = + _open(path, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0) + return(1); + if (errno != EEXIST) + return(0); + } else if (domkdir) { + if (mkdir(path, 0700) == 0) + return(1); + if (errno != EEXIST) + return(0); + } else if (lstat(path, &sbuf)) + return(errno == ENOENT ? 1 : 0); + + /* If we have a collision, cycle through the space of filenames */ + for (trv = start;;) { + if (*trv == '\0' || trv == suffp) + return(0); + pad = strchr((char *)padchar, *trv); + if (pad == NULL || !*++pad) + *trv++ = padchar[0]; + else { + *trv++ = *pad; + break; + } + } + } + /*NOTREACHED*/ +} diff --git a/include/apr_general.h b/include/apr_general.h index 33d0a806038..52ea7884470 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -143,6 +143,12 @@ int strncasecmp(const char *a, const char *b, size_t n); #define memmove(a,b,c) bcopy(b,a,c) #endif +#if (!HAVE_MKSTEMP) +#define mkstemp(a) ap_mkstemp(a) +#define mkstemps(a,b) ap_mkstemp(a,b) +#define mkdtemp(a) ap_mkdtemp(a) +#endif + /** * @package APR Random Functions */ From 99e9979b95e29dc6f473877711be7e4e6ace8b03 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 21 Feb 2001 18:41:29 +0000 Subject: [PATCH 1290/7878] Added apr_get_userid() as a companion to apr_get_username(). PR: Needed to fix Apache PR7271. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61275 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_user.h | 32 ++++++++++++++++++++++---------- user/unix/userinfo.c | 36 ++++++++++++++++++++++++++++++++---- user/win32/userinfo.c | 9 ++++++++- 3 files changed, 62 insertions(+), 15 deletions(-) diff --git a/include/apr_user.h b/include/apr_user.h index a4e62e640b6..314803de338 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -91,31 +91,42 @@ typedef gid_t apr_gid_t; /*** * Get the user name for a specified userid - * @param dirname Pointer to new string containing user name (on output) + * @param username Pointer to new string containing user name (on output) * @param userid The userid * @param p The pool from which to allocate the string - * @deffunc apr_status_t apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) * @tip This function is available only if APR_HAS_USER is defined. + * @deffunc apr_status_t apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) */ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p); +/*** + * Get the userid (and groupid) for the specified username + * @param userid Returns the user id + * @param groupid Returns the user's group id + * @param username The username to lookup + * @tip This function is available only if APR_HAS_USER is defined. + * @deffunc apr_status_t apr_get_userid(apr_uid_t *userid, apr_gid_t *groupid, const char *username) + */ +APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *userid, apr_gid_t *groupid, const char *username); + /*** * Get the home directory for the named user * @param dirname Pointer to new string containing directory name (on output) - * @param userid The named user + * @param username The named user * @param p The pool from which to allocate the string - * @deffunc apr_status_t apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p) * @tip This function is available only if APR_HAS_USER is defined. + * @deffunc apr_status_t apr_get_home_directory(char **dirname, const char *username, apr_pool_t *p) */ -APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *username, apr_pool_t *p); /*** * Compare two user identifiers for equality. * @param left One uid to test * @param right Another uid to test - * @deffunc apr_status_t apr_compare_users(apr_uid_t left, apr_uid_t right) - * @tip Returns APR_SUCCESS if the apr_uid_t strutures identify the same user, + * @return APR_SUCCESS if the apr_uid_t strutures identify the same user, * APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid. + * @tip This function is available only if APR_HAS_USER is defined. + * @deffunc apr_status_t apr_compare_users(apr_uid_t left, apr_uid_t right) */ #if defined(WIN32) APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right); @@ -128,8 +139,8 @@ APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right); * @param dirname Pointer to new string containing group name (on output) * @param userid The groupid * @param p The pool from which to allocate the string - * @deffunc apr_status_t apr_get_groupname(char **groupname, apr_gid_t userid, apr_pool_t *p); * @tip This function is available only if APR_HAS_USER is defined. + * @deffunc apr_status_t apr_get_groupname(char **groupname, apr_gid_t userid, apr_pool_t *p); */ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p); @@ -137,9 +148,10 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, * Compare two group identifiers for equality. * @param left One gid to test * @param right Another gid to test - * @deffunc apr_status_t apr_compare_groups(apr_gid_t left, apr_gid_t right) - * @tip Returns APR_SUCCESS if the apr_gid_t strutures identify the same group, + * @return APR_SUCCESS if the apr_gid_t strutures identify the same group, * APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid. + * @tip This function is available only if APR_HAS_USER is defined. + * @deffunc apr_status_t apr_compare_groups(apr_gid_t left, apr_gid_t right) */ #if defined(WIN32) APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right); diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 30729692509..cc2e98cfd9d 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -63,19 +63,32 @@ #include #endif -APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p) +static apr_status_t getpwnam_safe(const char *username, + struct passwd **pw) { - struct passwd *pw; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) struct passwd pwd; char pwbuf[512]; - if (getpwnam_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw)) { + if (getpwnam_r(username, &pwd, pwbuf, sizeof(pwbuf), pw)) { #else - if ((pw = getpwnam(userid)) == NULL) { + if ((*pw = getpwnam(username)) == NULL) { #endif return errno; } + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, + const char *username, + apr_pool_t *p) +{ + struct passwd *pw; + apr_status_t rv; + + if ((rv = getpwnam_safe(username, &pw)) != APR_SUCCESS) + return rv; + #ifdef OS2 /* Need to manually add user name for OS/2 */ *dirname = apr_pstrcat(p, pw->pw_dir, pw->pw_name, NULL); @@ -85,6 +98,21 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, + const char *username) +{ + struct passwd *pw; + apr_status_t rv; + + if ((rv = getpwnam_safe(username, &pw)) != APR_SUCCESS) + return rv; + + *uid = pw->pw_uid; + *gid = pw->pw_gid; + + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) { struct passwd *pw; diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 1771f90367f..de1794d197d 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -60,11 +60,18 @@ #include #endif -APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *username, apr_pool_t *p) { return APR_ENOTIMPL; } +APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, + const char *username) +{ + /* XXX: could someone please implement this for me? */ + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) { SID_NAME_USE type; From 75269b62c90489149427261aa5cfbfedbf02477b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 21 Feb 2001 18:51:17 +0000 Subject: [PATCH 1291/7878] don't compile mktemp.c unless we have to; it doesn't compile everywhere as it stands now (e.g., Tru64) Somebody with ReliantUNIX or some other box with no mkstemp() needs to try it out now. I wonder where the prototype for mkstemp() comes from on that platform. Regarding my configure.in changes: . The first parm to AC_CHECK_FUNCS() must be the name of the function. . We weren't using the have_mkstemp shell variable anywhere so I stopped setting it. If we need a symbol APR_HAVE_MKSTEMP later we will need to resurrect the have_mkstemp shell variable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61276 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- file_io/unix/mktemp.c | 6 ++++++ include/apr_general.h | 6 ------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 634144b0c73..78d8a7edd89 100644 --- a/configure.in +++ b/configure.in @@ -273,7 +273,7 @@ if test "$native_mmap_emul" = "1"; then fi AC_CHECK_FUNCS(hstrerror) AC_CHECK_FUNCS(memmove, [ have_memmove="1" ], [have_memmove="0" ]) -AC_CHECK_FUNCS(have_mkstemp, [ have_mkstemp="1" ], [have_mkstemp="0" ]) +AC_CHECK_FUNCS(mkstemp) AC_SUBST(fork) AC_SUBST(have_inet_addr) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index e572d0f0c58..ba5257393ac 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -31,6 +31,10 @@ * SUCH DAMAGE. */ +#include "apr_private.h" + +#if !defined(HAVE_MKSTEMP) + #ifndef __warn_references #define __warn_references(a,b) #endif @@ -215,3 +219,5 @@ _gettemp(path, doopen, domkdir, slen) } /*NOTREACHED*/ } + +#endif /* !defined(HAVE_MKSTEMP) */ diff --git a/include/apr_general.h b/include/apr_general.h index 52ea7884470..33d0a806038 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -143,12 +143,6 @@ int strncasecmp(const char *a, const char *b, size_t n); #define memmove(a,b,c) bcopy(b,a,c) #endif -#if (!HAVE_MKSTEMP) -#define mkstemp(a) ap_mkstemp(a) -#define mkstemps(a,b) ap_mkstemp(a,b) -#define mkdtemp(a) ap_mkdtemp(a) -#endif - /** * @package APR Random Functions */ From 731201126a41fefd7000c43848eb35006cff8d4b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 21 Feb 2001 20:49:28 +0000 Subject: [PATCH 1292/7878] Add apr_sigwait to the apr_private.h file. This allows us to remove a couple of #ifdefs, and standardize some code. This macro comes directly from the Apache code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61277 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 6 ++++++ threadproc/unix/signals.c | 7 +------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/acconfig.h b/acconfig.h index 25d28f6c87e..98e0154b3ba 100644 --- a/acconfig.h +++ b/acconfig.h @@ -53,4 +53,10 @@ #define BEOS_BONE 1 #endif +#ifdef SIGWAIT_TAKES_ONE_ARG +#define apr_sigwait(a,b) ((*(b)=sigwait((a)))<0?-1:0) +#else +#define apr_sigwait(a,b) sigwait((a),(b)) +#endif + #endif /* APR_PRIVATE_H */ diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index a96fded38a5..a192ebeeeae 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -278,12 +278,7 @@ static void *signal_thread_func(void *signal_handler) while (1) { int signal_received; -#ifdef SIGWAIT_TAKES_ONE_ARG - signal_received = sigwait(&sig_mask); - if (signal_received == -1) -#else - if (sigwait(&sig_mask, &signal_received) == -1) -#endif + if (apr_sigwait(&sig_mask, &signal_received) != 0) { /* handle sigwait() error here */ } From 608ca3854cfd26661ca4b9d35cf840513ed2ec3d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 21 Feb 2001 23:38:47 +0000 Subject: [PATCH 1293/7878] Missing the apr_pool_t arg required for more complex queries of uid/gid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61278 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_user.h | 6 ++++-- user/unix/userinfo.c | 2 +- user/win32/userinfo.c | 34 +++++++++++++++++++++++++++++++--- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 60609737119..7f29556c0f0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Introduce apr_get_userid to return a named user's apr_uid_t and + apr_gid_t across platforms [cliff Woolley, William Rowe] + *) In apr_shm_init(), check the retcode from mm_malloc(). Previously, we segfaulted here if mm_malloc() failed to get a lock. An example error scenario is when the lock file lives on a filesystem which diff --git a/include/apr_user.h b/include/apr_user.h index 314803de338..3c70da037ad 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -104,10 +104,12 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap * @param userid Returns the user id * @param groupid Returns the user's group id * @param username The username to lookup + * @param p The pool from which to allocate working space * @tip This function is available only if APR_HAS_USER is defined. - * @deffunc apr_status_t apr_get_userid(apr_uid_t *userid, apr_gid_t *groupid, const char *username) + * @deffunc apr_status_t apr_get_userid(apr_uid_t *userid, apr_gid_t *groupid, const char *username, apr_pool_t *p) */ -APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *userid, apr_gid_t *groupid, const char *username); +APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *userid, apr_gid_t *groupid, + const char *username, apr_pool_t *p); /*** * Get the home directory for the named user diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index cc2e98cfd9d..2987153f552 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -99,7 +99,7 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, } APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, - const char *username) + const char *username, apr_pool_t *p) { struct passwd *pw; apr_status_t rv; diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index de1794d197d..4ba7699dd22 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -66,10 +66,38 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use } APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, - const char *username) + const char *username, apr_pool_t *p) { - /* XXX: could someone please implement this for me? */ - return APR_ENOTIMPL; + SID_NAME_USE sidtype; + char *domain = NULL; + DWORD sidlen, rv; + + if (strchr(username, '/')) { + domain = apr_pstrndup(p, username, strchr(username, '/') - username); + username += strlen(domain) + 1; + } + else if (strchr(username, '\\')) { + domain = apr_pstrndup(p, username, strchr(username, '/') - username); + username += strlen(domain) + 1; + } + /* Get nothing on the first pass ... need to size the sid buffer + */ + sidlen = LookupAccountName(domain, username, NULL, NULL, + NULL, NULL, &sidtype); + if (sidlen) { + /* Give it back on the second pass + */ + *uid = apr_palloc(p, sidlen); + rv = LookupAccountName(domain, username, *uid, &sidlen, + NULL, NULL, &sidtype); + } + if (!sidlen || !rv) { + return apr_get_os_error(); + } + /* There doesn't seem to be a simple way to retrieve the primary group sid + */ + *gid = NULL; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) From bf4b2dce2b19024c59a5925649e19f3f589b7478 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 22 Feb 2001 01:24:58 +0000 Subject: [PATCH 1294/7878] OS/2: use unix implementation of apr_file_read_full/apr_file_write_full. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61279 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/Makefile.in | 3 ++- file_io/os2/fullrw.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 file_io/os2/fullrw.c diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index 50c758437c0..4926262f6d6 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -9,7 +9,8 @@ TARGETS = \ readwrite.lo \ seek.lo \ flock.lo \ - maperrorcode.lo + maperrorcode.lo \ + fullrw.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/file_io/os2/fullrw.c b/file_io/os2/fullrw.c new file mode 100644 index 00000000000..cf6294882b4 --- /dev/null +++ b/file_io/os2/fullrw.c @@ -0,0 +1 @@ +#include "../unix/fullrw.c" From 40e7e19142a3e8be1092d42068173445e27e67b9 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 22 Feb 2001 04:05:58 +0000 Subject: [PATCH 1295/7878] Add a couple of GCC attribute tags to printf style functions. This also fixes a couple of mismatched parameters highlighted revealed by the attribute. Submitted by: Jon Travis git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61280 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index ecd1789de83..85d070273cb 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -177,7 +177,8 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap); * @return The new string * @deffunc char *apr_psprintf(apr_pool_t *p, const char *fmt, ...) */ -APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...); +APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) + __attribute__((format(printf,2,3))); /** * copy n characters from src to des> From 8080124b06a5b7815e1128d86241cb4deb33ce85 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Thu, 22 Feb 2001 04:16:55 +0000 Subject: [PATCH 1296/7878] Remove some duplicate calls to strchr(), and remove a typo as a side-effect git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61281 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- user/win32/userinfo.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 7f29556c0f0..737177e97e2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,7 @@ Changes with APR b1 *) Introduce apr_get_userid to return a named user's apr_uid_t and - apr_gid_t across platforms [cliff Woolley, William Rowe] + apr_gid_t across platforms [Cliff Woolley, William Rowe] *) In apr_shm_init(), check the retcode from mm_malloc(). Previously, we segfaulted here if mm_malloc() failed to get a lock. An example diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 4ba7699dd22..d3334ff9121 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -71,14 +71,15 @@ APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, SID_NAME_USE sidtype; char *domain = NULL; DWORD sidlen, rv; + char *pos; - if (strchr(username, '/')) { - domain = apr_pstrndup(p, username, strchr(username, '/') - username); - username += strlen(domain) + 1; + if (pos = strchr(username, '/')) { + domain = apr_pstrndup(p, username, pos - username); + username = pos + 1; } - else if (strchr(username, '\\')) { - domain = apr_pstrndup(p, username, strchr(username, '/') - username); - username += strlen(domain) + 1; + else if (pos = strchr(username, '\\')) { + domain = apr_pstrndup(p, username, pos - username); + username = pos + 1; } /* Get nothing on the first pass ... need to size the sid buffer */ From 2bedbab5f57e44d600d15a926710307794b7eeb4 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Fri, 23 Feb 2001 02:06:14 +0000 Subject: [PATCH 1297/7878] These are a bit too unix specific for OS/2 (pthread/sigwait). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61282 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index a192ebeeeae..9cc3bfd7ede 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -267,7 +267,7 @@ const char *apr_signal_get_description(int signum) #endif /* SYS_SIGLIST_DECLARED */ -#if APR_HAS_THREADS +#if APR_HAS_THREADS && !defined(OS2) static void *signal_thread_func(void *signal_handler) { sigset_t sig_mask; From d25dbe8fd6a5bad0d3ea805e72d691528dbc144e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 23 Feb 2001 03:59:56 +0000 Subject: [PATCH 1298/7878] Clean up a warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61283 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 4e47fa00274..c2d9c1fb4cf 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -83,7 +83,7 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *a, const char *s) APR_DECLARE(char *) apr_pstrndup(apr_pool_t *a, const char *s, apr_size_t n) { char *res; - size_t len; + apr_size_t len; if (s == NULL) { return NULL; From 1201ed180c4b90e49f5a4455520a98c245d4c711 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Fri, 23 Feb 2001 09:09:46 +0000 Subject: [PATCH 1299/7878] apr_setup_signal_thread() & apr_create_signal_thread() aren't implemented on OS/2 (or needed AFAIK) so keep them out of exports list. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61284 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index dfe4829354b..1c1bac67569 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -584,7 +584,7 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how); -#if APR_HAS_THREADS +#if APR_HAS_THREADS && !defined(OS2) /** * Setup the process for a single thread to be used for all signal handling. * @warn This must be called before any threads are created From bf39d4efd0941584514b3ba71315dc7e8b51d7a0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 23 Feb 2001 16:08:05 +0000 Subject: [PATCH 1300/7878] Don't define the thread functions if threads haven't been included in the build. This allows Apache's threaded MPMs to die at compile time if we build APR without threads. This also makes more sense logically. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61285 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 1c1bac67569..1905b4c3eaf 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -153,6 +153,8 @@ struct process_chain { /* Thread Function definitions */ +#if APR_HAS_THREADS + /** * Create and initialize a new threadattr variable * @param new_attr The newly created threadattr. @@ -297,6 +299,8 @@ APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey); +#endif + /* Process Function definitions */ /** From 17f26295bf781207a02b14e92254959c66c859c0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 23 Feb 2001 18:35:42 +0000 Subject: [PATCH 1301/7878] fix for ReliantUNIX and other platforms with no mkstemp() routine: Don't rename mkstemp(); locks/unix/crossproc.c assumes that mkstemp() is the name of the function. Don't provide mkstemps(), mkdtemp(), or mktemp(). Submitted by: jean-frederic clere Mangled by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61286 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/mktemp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index ba5257393ac..0dd1ee229c0 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -48,10 +48,6 @@ #define seedrandom(a) srandom(a) #endif #define _open(a,b,c) open(a,b,c) -#define mkdtemp ap_mkdtemp -#define mkstemp ap_mkstemp -#define mkstemps ap_mkstemps -#define mktemp ap_mktemp #if defined(LIBC_SCCS) && !defined(lint) #if 0 @@ -84,6 +80,7 @@ static const unsigned char padchar[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; static uint32_t randseed=0; +#ifdef APR_STARTS_USING_IT int mkstemps(path, slen) char *path; @@ -93,6 +90,7 @@ mkstemps(path, slen) return (_gettemp(path, &fd, 0, slen) ? fd : -1); } +#endif /* APR_STARTS_USING_IT */ int mkstemp(path) @@ -103,6 +101,7 @@ mkstemp(path) return (_gettemp(path, &fd, 0, 0) ? fd : -1); } +#ifdef APR_STARTS_USING_IT char * mkdtemp(path) char *path; @@ -126,6 +125,7 @@ mktemp(path) { return(_mktemp(path)); } +#endif /* APR_STARTS_USING_IT */ static int _gettemp(path, doopen, domkdir, slen) From 2594f62572001b513049a6aa5900b5b88812f063 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 23 Feb 2001 20:29:07 +0000 Subject: [PATCH 1302/7878] change mkstemp() to apr_mkstemp() so we don't pollute somebody else's namespace apr_mkstemp() is only intended to be used within the Unix APR implementation; a similar function but with an appropriate APR interface would be nice to support cross-platform git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61287 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/mktemp.c | 19 ++++++++++++++++--- include/arch/unix/fileio.h | 2 ++ locks/unix/crossproc.c | 5 +++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 0dd1ee229c0..592d760c228 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -32,6 +32,7 @@ */ #include "apr_private.h" +#include "fileio.h" /* prototype of apr_mkstemp() */ #if !defined(HAVE_MKSTEMP) @@ -92,9 +93,7 @@ mkstemps(path, slen) } #endif /* APR_STARTS_USING_IT */ -int -mkstemp(path) - char *path; +int apr_mkstemp(char *path) { int fd; @@ -220,4 +219,18 @@ _gettemp(path, doopen, domkdir, slen) /*NOTREACHED*/ } +#else + +#if APR_HAVE_STDLIB_H +#include /* for mkstemp() - Single Unix */ +#endif +#if APR_HAVE_UNISTD_H +#include /* for mkstemp() - FreeBSD */ +#endif + +int apr_mkstemp(char *template) +{ + return mkstemp(template); +} + #endif /* !defined(HAVE_MKSTEMP) */ diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 5066909e1ae..3019db82558 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -149,5 +149,7 @@ apr_status_t apr_unix_file_cleanup(void *); mode_t apr_unix_perms2mode(apr_fileperms_t perms); apr_fileperms_t apr_unix_mode2perms(mode_t mode); +int apr_mkstemp(char *template); + #endif /* ! FILE_IO_H */ diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 8720fcca4dc..ae5b47e3080 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -55,6 +55,7 @@ #include "apr.h" #include "apr_strings.h" #include "locks.h" +#include "fileio.h" /* for apr_mkstemp() */ #if APR_USE_SYSVSEM_SERIALIZE @@ -305,7 +306,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) } else { new->fname = apr_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); - new->interproc = mkstemp(new->fname); + new->interproc = apr_mkstemp(new->fname); } if (new->interproc < 0) { @@ -387,7 +388,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) } else { new->fname = apr_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); - new->interproc = mkstemp(new->fname); + new->interproc = apr_mkstemp(new->fname); } if (new->interproc < 0) { From 4b60513cec603adf3048ee996db03cea3c5b930a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 23 Feb 2001 21:33:01 +0000 Subject: [PATCH 1303/7878] fix a typo which broke the check for whether share memory is file based or mem based git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61288 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 78d8a7edd89..9fd951c29b9 100644 --- a/configure.in +++ b/configure.in @@ -203,7 +203,7 @@ AC_SUBST(keybased_shm) APR_CHECK_DEFINE(MM_SHMT_MMFILE, $srcdir/shmem/unix/mm/mm_conf.h) -if test "ac_cv_define_MM_SHMT_MMFILE" = "yes"; then +if test "$ac_cv_define_MM_SHMT_MMFILE" = "yes"; then file_based="1" mem_based="0" else From 5d36295c4c932fbaffd08370531a4492999f31bf Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sat, 24 Feb 2001 01:38:48 +0000 Subject: [PATCH 1304/7878] toss ENUM_BITFIELD. used in one place (but didn't need to be used), and it certainly wasn't namespace protected. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61289 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 2 -- include/apr.hw | 1 - 2 files changed, 3 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 24ad85126f8..1cbddd72882 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -17,11 +17,9 @@ defined(NEXT) #define apr_inline #define __attribute__(__x) -#define ENUM_BITFIELD(e,n,w) signed int n : w #else #define apr_inline __inline__ #define USE_GNU_INLINE -#define ENUM_BITFIELD(e,n,w) e n : w #endif #define APR_HAVE_ARPA_INET_H @arpa_ineth@ diff --git a/include/apr.hw b/include/apr.hw index aa69284b9c6..ff22e3e0c7e 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -110,7 +110,6 @@ #define apr_inline #define __attribute__(__x) -#define ENUM_BITFIELD(e,n,w) signed int n : w #define NO_USE_SIGACTION From 888eb85ce87987c8a1865ff45aff12b4069f7957 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 24 Feb 2001 04:29:21 +0000 Subject: [PATCH 1305/7878] OS/2: Add a crypto strength randomness generator. Not highly sophisticated or efficient but passes every test I know of for unpredictability & generates mod_auth_digest's secret in negligible time. Critical comment from crypto experts is more than welcome. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61290 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 20 ++++-- misc/os2/randbyte.c | 161 ++++++++++++++++++++++++++++++++++++++++++++ misc/unix/rand.c | 12 ++++ 3 files changed, 188 insertions(+), 5 deletions(-) create mode 100644 misc/os2/randbyte.c diff --git a/configure.in b/configure.in index 9fd951c29b9..40a5c8a2622 100644 --- a/configure.in +++ b/configure.in @@ -803,11 +803,21 @@ elif test -r "/dev/urandom"; then rand="1" else AC_MSG_RESULT(not found); - if test "$ac_cv_lib_truerand_main" = "yes"; then - rand="1" - else - rand="0" - fi + + case "$OS" in + # we have built in support for OS/2 + *-os2*) + rand="1" + ;; + # no other choice, try for truerand + *) + if test "$ac_cv_lib_truerand_main" = "yes"; then + rand="1" + else + rand="0" + fi + ;; + esac fi AC_SUBST(rand) diff --git a/misc/os2/randbyte.c b/misc/os2/randbyte.c new file mode 100644 index 00000000000..58314028b9d --- /dev/null +++ b/misc/os2/randbyte.c @@ -0,0 +1,161 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/* The high resolution timer API provides access to the hardware timer + * running at around 1.1MHz. The amount this changes in a time slice is + * varies randomly due to system events, hardware interrupts etc + */ +static UCHAR randbyte_hrtimer() +{ + QWORD t1, t2; + UCHAR byte; + + DosTmrQueryTime(&t1); + DosSleep(5); + DosTmrQueryTime(&t2); + + byte = (t2.ulLo - t1.ulLo) & 0xFF; + byte ^= (t2.ulLo - t1.ulLo) >> 8; + return byte; +} + + + +/* A bunch of system information like memory & process stats. + * Not highly random but every bit helps.... + */ +static UCHAR randbyte_sysinfo() +{ + UCHAR byte = 0; + UCHAR SysVars[100]; + int b; + + DosQuerySysInfo(1, QSV_FOREGROUND_PROCESS, SysVars, sizeof(SysVars)); + + for (b = 0; b < 100; b++) { + byte ^= SysVars[b]; + } + + return byte; +} + + + +/* Similar in concept to randbyte_hrtimer() but accesses the CPU's internal + * counters which run at the CPU's MHz speed. We get separate + * idle / busy / interrupt cycle counts which should provide very good + * randomness due to interference of hardware events. + * This only works on newer CPUs (at least PPro or K6) and newer OS/2 versions + * which is why it's run-time linked. + */ + +static APIRET APIENTRY(*DosPerfSysCall) (ULONG ulCommand, ULONG ulParm1, + ULONG ulParm2, ULONG ulParm3) = NULL; +static HMODULE hDoscalls = 0; +#define CMD_KI_RDCNT (0x63) + +typedef struct _CPUUTIL { + ULONG ulTimeLow; /* Low 32 bits of time stamp */ + ULONG ulTimeHigh; /* High 32 bits of time stamp */ + ULONG ulIdleLow; /* Low 32 bits of idle time */ + ULONG ulIdleHigh; /* High 32 bits of idle time */ + ULONG ulBusyLow; /* Low 32 bits of busy time */ + ULONG ulBusyHigh; /* High 32 bits of busy time */ + ULONG ulIntrLow; /* Low 32 bits of interrupt time */ + ULONG ulIntrHigh; /* High 32 bits of interrupt time */ +} CPUUTIL; + + +static UCHAR randbyte_perf() +{ + UCHAR byte = 0; + CPUUTIL util; + int c; + + if (hDoscalls == 0) { + char failed_module[20]; + ULONG rc; + + rc = DosLoadModule(failed_module, sizeof(failed_module), "DOSCALLS", + &hDoscalls); + + if (rc == 0) { + rc = DosQueryProcAddr(hDoscalls, 976, NULL, (PFN *)&DosPerfSysCall); + + if (rc) { + DosPerfSysCall = NULL; + } + } + } + + if (DosPerfSysCall) { + if (DosPerfSysCall(CMD_KI_RDCNT, (ULONG)&util, 0, 0) == 0) { + for (c = 0; c < sizeof(util); c++) { + byte ^= ((UCHAR *)&util)[c]; + } + } + else { + DosPerfSysCall = NULL; + } + } + + return byte; +} + + + +static UCHAR randbyte() +{ + return randbyte_hrtimer() ^ randbyte_sysinfo() ^ randbyte_perf(); +} diff --git a/misc/unix/rand.c b/misc/unix/rand.c index ceb8c8ea6ba..71778c6fd1e 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -81,6 +81,13 @@ apr_status_t apr_generate_random_bytes(unsigned char * buf, int length) close(rnd); +#elif defined(OS2) + static UCHAR randbyte(); + unsigned int idx; + + for (idx=0; idx Date: Sat, 24 Feb 2001 11:23:19 +0000 Subject: [PATCH 1306/7878] *) fix inline handling. we had: apr_inline, APR_INLINE, USE_GNU_INLINE, and INLINE. Now, we just have APR_INLINE and APR_HAS_INLINE. - convert all usage - note that apr_general messed up the defn (compared to apr.h) - simplify the inline decision logic in os/*/os.h - simplify the code in os/*/os-inline.c *) toss ap_checkconv() [no longer used] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61291 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 7 ++++--- include/apr.hw | 3 ++- include/apr_general.h | 9 --------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 1cbddd72882..7720d35d039 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -15,11 +15,12 @@ #if !defined(__GNUC__) || __GNUC__ < 2 || \ (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\ defined(NEXT) -#define apr_inline +#define APR_INLINE #define __attribute__(__x) +#define APR_HAS_INLINE 0 #else -#define apr_inline __inline__ -#define USE_GNU_INLINE +#define APR_INLINE __inline__ +#define APR_HAS_INLINE 1 #endif #define APR_HAVE_ARPA_INET_H @arpa_ineth@ diff --git a/include/apr.hw b/include/apr.hw index ff22e3e0c7e..bdb105cc9a8 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -108,7 +108,8 @@ #include #include -#define apr_inline +#define APR_INLINE __inline +#define APR_HAS_INLINE 1 #define __attribute__(__x) #define NO_USE_SIGACTION diff --git a/include/apr_general.h b/include/apr_general.h index 33d0a806038..820ce5080cb 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -78,15 +78,6 @@ extern "C" { typedef int apr_signum_t; -#ifdef WIN32 -#define APR_INLINE __inline -#elif defined(__GNUC__) && defined(__GNUC__) && \ - __GNUC__ >= 2 && __GNUC_MINOR__ >= 7 -#define APR_INLINE __inline__ -#else -#define APR_INLINE /*nop*/ -#endif - /* Finding offsets of elements within structures. * Taken from the X code... they've sweated portability of this stuff * so we don't have to. Sigh... From 1dcee5adf049508f1d2704bc0f14bd08e14dca1d Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sat, 24 Feb 2001 11:56:01 +0000 Subject: [PATCH 1307/7878] compat tweak git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61292 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_compat.h b/include/apr_compat.h index 80c3f3fafd6..38982f34bef 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -3,7 +3,7 @@ /* redefine 1.3.x symbols to those that now live in libapr */ -#define ap_inline apr_inline +#define ap_inline APR_INLINE #define ap_md5_ctx_t apr_md5_ctx_t #define ap_MD5Encode apr_md5_encode From c6c5a1117f177aa579d3e43dce0e3f47916711d0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 25 Feb 2001 01:24:37 +0000 Subject: [PATCH 1308/7878] if we don't have the prototype, we shouldn't have the function either (haven't we been here before?) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61294 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/thread.c | 83 ---------------------------------------- 1 file changed, 83 deletions(-) diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index d6566c9dbd1..90f4d0c164a 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -235,29 +235,6 @@ apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, #if !APR_HAS_THREADS -apr_status_t apr_thread_create(apr_thread_t **new_thread, apr_threadattr_t *attr, - apr_thread_start_t func, void *data, - apr_pool_t *cont) -{ - return APR_ENOTIMPL; -} - -apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) -{ - return APR_ENOTIMPL; -} - -apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), - apr_pool_t *cont) -{ - return APR_ENOTIMPL; -} - -apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) -{ - return APR_ENOTIMPL; -} - apr_status_t apr_os_thread_get(void); /* avoid warning for no prototype */ apr_status_t apr_os_thread_get(void) @@ -265,64 +242,4 @@ apr_status_t apr_os_thread_get(void) return APR_ENOTIMPL; } -apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) -{ - return APR_ENOTIMPL; -} - -apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) -{ - return APR_ENOTIMPL; -} - -apr_status_t apr_threadkey_data_get(void **data, const char *key, - apr_threadkey_t *threadkey) -{ - return APR_ENOTIMPL; -} - -apr_status_t apr_threadkey_private_get(void **new_mem, apr_threadkey_t *key) -{ - return APR_ENOTIMPL; -} - -apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) -{ - return APR_ENOTIMPL; -} - -apr_status_t apr_thread_data_set(void *data, const char *key, - apr_status_t (*cleanup)(void *), - apr_thread_t *thread) -{ - return APR_ENOTIMPL; -} - -apr_status_t apr_threadkey_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_threadkey_t *threadkey) -{ - return APR_ENOTIMPL; -} - -apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) -{ - return APR_ENOTIMPL; -} - -apr_status_t apr_thread_detach(apr_thread_t *thd) -{ - return APR_ENOTIMPL; -} - -apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) -{ - return APR_ENOTIMPL; -} - -apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) -{ - return APR_ENOTIMPL; -} - #endif From e472e68056d11a36c12786c7ecb1ea4091a0202c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 25 Feb 2001 02:53:29 +0000 Subject: [PATCH 1309/7878] Refresh all .mak files should we choose to roll again shortly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61295 13f79535-47bb-0310-9956-ffa450edef68 --- apr.mak | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ libapr.mak | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) diff --git a/apr.mak b/apr.mak index 580ba9e11f9..c367adb758c 100644 --- a/apr.mak +++ b/apr.mak @@ -416,6 +416,8 @@ DEP_CPP_TIME_=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)" ".\include\apr.h" @@ -439,6 +441,8 @@ DEP_CPP_TIMES=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"\ @@ -484,10 +488,13 @@ DEP_CPP_APR_S=\ ".\include\apr_lib.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"sys\socket.h"\ "$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_S) "$(INTDIR)"\ @@ -606,6 +613,9 @@ DEP_CPP_ERROR=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"netdb.h"\ + {$(INCLUDE)}"sys\socket.h"\ "$(INTDIR)\errorcodes.obj" : $(SOURCE) $(DEP_CPP_ERROR) "$(INTDIR)"\ @@ -629,6 +639,7 @@ DEP_CPP_GETOP=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"\ @@ -663,6 +674,7 @@ DEP_CPP_MISC_=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\misc.obj" : $(SOURCE) $(DEP_CPP_MISC_) "$(INTDIR)" ".\include\apr.h" @@ -683,6 +695,7 @@ DEP_CPP_NAMES=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"\ @@ -713,6 +726,7 @@ DEP_CPP_START=\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ ".\include\apr_pools.h"\ + ".\include\apr_signal.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -720,6 +734,7 @@ DEP_CPP_START=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\locks.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"\ @@ -765,6 +780,8 @@ DEP_CPP_DIR_C=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)" ".\include\apr.h" @@ -792,6 +809,8 @@ DEP_CPP_FILEA=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"\ @@ -820,6 +839,8 @@ DEP_CPP_FILED=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"\ @@ -849,6 +870,8 @@ DEP_CPP_FILES=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"\ @@ -876,6 +899,8 @@ DEP_CPP_FLOCK=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\flock.obj" : $(SOURCE) $(DEP_CPP_FLOCK) "$(INTDIR)"\ @@ -893,6 +918,7 @@ DEP_CPP_FULLR=\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\fullrw.obj" : $(SOURCE) $(DEP_CPP_FULLR) "$(INTDIR)"\ @@ -924,6 +950,8 @@ DEP_CPP_OPEN_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)" ".\include\apr.h" @@ -951,6 +979,8 @@ DEP_CPP_PIPE_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)" ".\include\apr.h" @@ -968,6 +998,7 @@ DEP_CPP_READW=\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -979,6 +1010,8 @@ DEP_CPP_READW=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"\ @@ -1006,6 +1039,8 @@ DEP_CPP_SEEK_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)" ".\include\apr.h" @@ -1030,6 +1065,8 @@ DEP_CPP_LOCKS=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\locks.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"\ @@ -1051,6 +1088,8 @@ DEP_CPP_INET_=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\networkio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"sys\socket.h"\ "$(INTDIR)\inet_ntop.obj" : $(SOURCE) $(DEP_CPP_INET_) "$(INTDIR)"\ @@ -1072,6 +1111,7 @@ DEP_CPP_POLL_=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\poll.obj" : $(SOURCE) $(DEP_CPP_POLL_) "$(INTDIR)" ".\include\apr.h" @@ -1102,6 +1142,8 @@ DEP_CPP_SENDR=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\networkio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\sendrecv.obj" : $(SOURCE) $(DEP_CPP_SENDR) "$(INTDIR)"\ @@ -1125,6 +1167,7 @@ DEP_CPP_SOCKA=\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ ".\network_io\unix\sa_common.c"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\sockaddr.obj" : $(SOURCE) $(DEP_CPP_SOCKA) "$(INTDIR)"\ @@ -1150,6 +1193,8 @@ DEP_CPP_SOCKE=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\sockets.obj" : $(SOURCE) $(DEP_CPP_SOCKE) "$(INTDIR)"\ @@ -1171,6 +1216,7 @@ DEP_CPP_SOCKO=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"\ @@ -1203,6 +1249,8 @@ DEP_CPP_PROC_=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\threadproc.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)" ".\include\apr.h" @@ -1230,6 +1278,8 @@ DEP_CPP_SIGNA=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\threadproc.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"\ @@ -1256,6 +1306,8 @@ DEP_CPP_THREA=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\threadproc.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"\ @@ -1282,6 +1334,8 @@ DEP_CPP_THREAD=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\threadproc.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"\ @@ -1312,6 +1366,8 @@ DEP_CPP_DSO_C=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\dso.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\dso.obj" : $(SOURCE) $(DEP_CPP_DSO_C) "$(INTDIR)" ".\include\apr.h" @@ -1338,6 +1394,8 @@ DEP_CPP_APR_P=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ @@ -1386,6 +1444,7 @@ DEP_CPP_COMMO=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\common.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ @@ -1417,6 +1476,8 @@ DEP_CPP_MMAP_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\mmap.obj" : $(SOURCE) $(DEP_CPP_MMAP_) "$(INTDIR)" ".\include\apr.h" @@ -1440,6 +1501,8 @@ DEP_CPP_GROUP=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\groupinfo.obj" : $(SOURCE) $(DEP_CPP_GROUP) "$(INTDIR)"\ @@ -1464,6 +1527,8 @@ DEP_CPP_USERI=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\ diff --git a/libapr.mak b/libapr.mak index 6f02872a77a..62edaa906bd 100644 --- a/libapr.mak +++ b/libapr.mak @@ -433,6 +433,8 @@ DEP_CPP_TIME_=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)" ".\include\apr.h" @@ -456,6 +458,8 @@ DEP_CPP_TIMES=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"\ @@ -501,10 +505,13 @@ DEP_CPP_APR_S=\ ".\include\apr_lib.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"sys\socket.h"\ "$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_S) "$(INTDIR)"\ @@ -623,6 +630,9 @@ DEP_CPP_ERROR=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"netdb.h"\ + {$(INCLUDE)}"sys\socket.h"\ "$(INTDIR)\errorcodes.obj" : $(SOURCE) $(DEP_CPP_ERROR) "$(INTDIR)"\ @@ -646,6 +656,7 @@ DEP_CPP_GETOP=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"\ @@ -680,6 +691,7 @@ DEP_CPP_MISC_=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\misc.obj" : $(SOURCE) $(DEP_CPP_MISC_) "$(INTDIR)" ".\include\apr.h" @@ -700,6 +712,7 @@ DEP_CPP_NAMES=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"\ @@ -730,6 +743,7 @@ DEP_CPP_START=\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ ".\include\apr_pools.h"\ + ".\include\apr_signal.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -737,6 +751,7 @@ DEP_CPP_START=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\locks.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"\ @@ -782,6 +797,8 @@ DEP_CPP_DIR_C=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)" ".\include\apr.h" @@ -809,6 +826,8 @@ DEP_CPP_FILEA=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"\ @@ -837,6 +856,8 @@ DEP_CPP_FILED=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"\ @@ -866,6 +887,8 @@ DEP_CPP_FILES=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"\ @@ -893,6 +916,8 @@ DEP_CPP_FLOCK=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\flock.obj" : $(SOURCE) $(DEP_CPP_FLOCK) "$(INTDIR)"\ @@ -910,6 +935,7 @@ DEP_CPP_FULLR=\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\fullrw.obj" : $(SOURCE) $(DEP_CPP_FULLR) "$(INTDIR)"\ @@ -941,6 +967,8 @@ DEP_CPP_OPEN_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)" ".\include\apr.h" @@ -968,6 +996,8 @@ DEP_CPP_PIPE_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)" ".\include\apr.h" @@ -985,6 +1015,7 @@ DEP_CPP_READW=\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -996,6 +1027,8 @@ DEP_CPP_READW=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"\ @@ -1023,6 +1056,8 @@ DEP_CPP_SEEK_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)" ".\include\apr.h" @@ -1047,6 +1082,8 @@ DEP_CPP_LOCKS=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\locks.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"\ @@ -1068,6 +1105,8 @@ DEP_CPP_INET_=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\networkio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"sys\socket.h"\ "$(INTDIR)\inet_ntop.obj" : $(SOURCE) $(DEP_CPP_INET_) "$(INTDIR)"\ @@ -1089,6 +1128,7 @@ DEP_CPP_POLL_=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\poll.obj" : $(SOURCE) $(DEP_CPP_POLL_) "$(INTDIR)" ".\include\apr.h" @@ -1119,6 +1159,8 @@ DEP_CPP_SENDR=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\networkio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\sendrecv.obj" : $(SOURCE) $(DEP_CPP_SENDR) "$(INTDIR)"\ @@ -1142,6 +1184,7 @@ DEP_CPP_SOCKA=\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ ".\network_io\unix\sa_common.c"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\sockaddr.obj" : $(SOURCE) $(DEP_CPP_SOCKA) "$(INTDIR)"\ @@ -1167,6 +1210,8 @@ DEP_CPP_SOCKE=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\sockets.obj" : $(SOURCE) $(DEP_CPP_SOCKE) "$(INTDIR)"\ @@ -1188,6 +1233,7 @@ DEP_CPP_SOCKO=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"\ @@ -1220,6 +1266,8 @@ DEP_CPP_PROC_=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\threadproc.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)" ".\include\apr.h" @@ -1247,6 +1295,8 @@ DEP_CPP_SIGNA=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\threadproc.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"\ @@ -1273,6 +1323,8 @@ DEP_CPP_THREA=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\threadproc.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"\ @@ -1299,6 +1351,8 @@ DEP_CPP_THREAD=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\threadproc.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"\ @@ -1329,6 +1383,8 @@ DEP_CPP_DSO_C=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\dso.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\dso.obj" : $(SOURCE) $(DEP_CPP_DSO_C) "$(INTDIR)" ".\include\apr.h" @@ -1355,6 +1411,8 @@ DEP_CPP_APR_P=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ @@ -1403,6 +1461,7 @@ DEP_CPP_COMMO=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\common.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ @@ -1434,6 +1493,8 @@ DEP_CPP_MMAP_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\mmap.obj" : $(SOURCE) $(DEP_CPP_MMAP_) "$(INTDIR)" ".\include\apr.h" @@ -1457,6 +1518,8 @@ DEP_CPP_GROUP=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\groupinfo.obj" : $(SOURCE) $(DEP_CPP_GROUP) "$(INTDIR)"\ @@ -1481,6 +1544,8 @@ DEP_CPP_USERI=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + {$(INCLUDE)}"arpa\inet.h"\ + {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\ From c71879d3fc8578e18cfc3066d19a7408c8d0797f Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 25 Feb 2001 06:39:34 +0000 Subject: [PATCH 1310/7878] Don't define the signal thread logic is sigwait isn't defined. Hopefully any platform like this will be able to mimic the signal thread, but for now this fixes any machine without sigwait. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61296 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 ++ include/apr.h.in | 1 + include/apr_thread_proc.h | 2 +- threadproc/unix/signals.c | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 40a5c8a2622..557858852b8 100644 --- a/configure.in +++ b/configure.in @@ -635,6 +635,8 @@ fi AC_SUBST(threads) +AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ]) + dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a dnl threaded poll() and we don't want to use sendfile on early FreeBSD dnl systems if we are also using threads. diff --git a/include/apr.h.in b/include/apr.h.in index 7720d35d039..13a09a4ecc6 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -80,6 +80,7 @@ #define APR_HAVE_MEMMOVE @have_memmove@ #define APR_HAVE_SETRLIMIT @have_setrlimit@ #define APR_HAVE_SIGACTION @have_sigaction@ +#define APR_HAVE_SIGWAIT @have_sigwait@ #define APR_HAVE_STRCASECMP @have_strcasecmp@ #define APR_HAVE_STRDUP @have_strdup@ #define APR_HAVE_STRICMP @have_stricmp@ diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 1905b4c3eaf..4deed1f1e3c 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -588,7 +588,7 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how); -#if APR_HAS_THREADS && !defined(OS2) +#if APR_HAS_THREADS && !defined(OS2) && defined(APR_HAS_SIGWAIT) /** * Setup the process for a single thread to be used for all signal handling. * @warn This must be called before any threads are created diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 9cc3bfd7ede..0b14fb1c69f 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -267,7 +267,7 @@ const char *apr_signal_get_description(int signum) #endif /* SYS_SIGLIST_DECLARED */ -#if APR_HAS_THREADS && !defined(OS2) +#if APR_HAS_THREADS && !defined(OS2) && defined(HAVE_SIGWAIT) static void *signal_thread_func(void *signal_handler) { sigset_t sig_mask; From f60c6d01f3c886b707bd918c0f1f3467035b42a0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 25 Feb 2001 06:51:15 +0000 Subject: [PATCH 1311/7878] We have to substitute the have_sigwait variable, or nothing will work. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61297 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 557858852b8..364001e0f4c 100644 --- a/configure.in +++ b/configure.in @@ -633,10 +633,11 @@ else echo "APR will be non-threaded" fi -AC_SUBST(threads) - AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ]) +AC_SUBST(threads) +AC_SUBST(have_sigwait) + dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a dnl threaded poll() and we don't want to use sendfile on early FreeBSD dnl systems if we are also using threads. From fcbe6100fa1fe3a81bfec821f199ba53655380ab Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 25 Feb 2001 06:54:52 +0000 Subject: [PATCH 1312/7878] Need to use the correct macro for APR_HAVE_SIGWAIT git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61298 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 4deed1f1e3c..9ac29fb9346 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -588,7 +588,7 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how); -#if APR_HAS_THREADS && !defined(OS2) && defined(APR_HAS_SIGWAIT) +#if APR_HAS_THREADS && !defined(OS2) && defined(APR_HAVE_SIGWAIT) /** * Setup the process for a single thread to be used for all signal handling. * @warn This must be called before any threads are created From 0d83bdb7b33fd0d074d6b5d6ddbec81a118d880e Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 25 Feb 2001 14:46:21 +0000 Subject: [PATCH 1313/7878] APR_HAVE_SIGWAIT is now always defined, so the previous test failed on BeOS, so now we check the value and it passes the test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61299 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 9ac29fb9346..5e37b489247 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -588,7 +588,8 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how); -#if APR_HAS_THREADS && !defined(OS2) && defined(APR_HAVE_SIGWAIT) +#if APR_HAS_THREADS && !defined(OS2) && APR_HAVE_SIGWAIT + /** * Setup the process for a single thread to be used for all signal handling. * @warn This must be called before any threads are created From a381b2a840f5421586471535e3fd0bb40559c18a Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 25 Feb 2001 15:20:01 +0000 Subject: [PATCH 1314/7878] Correctly set the formats to use and hence reduce the number of warnings generated. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61300 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.in b/configure.in index 364001e0f4c..d8c00333143 100644 --- a/configure.in +++ b/configure.in @@ -495,6 +495,10 @@ case "$OS" in size_t_fmt='#define APR_SIZE_T_FMT "ld"' off_t_fmt='#define APR_OFF_T_FMT "ld"' ;; + *beos*) + ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' + size_t_fmt='#define APR_SIZE_T_FMT "ld"' + ;; esac AC_SUBST(short_value) From acab36ee6ed1b309234e85ada58e10e9abdb0550 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 25 Feb 2001 15:42:55 +0000 Subject: [PATCH 1315/7878] Move the check for threads to a point earlier in the configure phase so that if we adjust CPPFLAGS for threading support we'll use the same CPPFLAGS value for more of the tests. This fixes a build problem on Solaris. We tested for the sigwait() flavor before updating CPPFLAGS for thread support, but with the updated CPPFLAGS we got the other flavor of sigwait(). Submitted by: Justin Erenkrantz I've tested this on Solaris 8, FreeBSD 3.4, and RH 6.0 (glibc 2.11). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61301 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 224 +++++++++++++++++++++++++-------------------------- 1 file changed, 112 insertions(+), 112 deletions(-) diff --git a/configure.in b/configure.in index d8c00333143..5f3c92f1796 100644 --- a/configure.in +++ b/configure.in @@ -147,6 +147,118 @@ case "$OS" in ;; esac +dnl #----------------------------- Checking for Threads +echo $ac_n "${nl}Checking for Threads...${nl}" + +if test -z "$enable_threads"; then + AC_ARG_ENABLE(threads, + [ --enable-threads Enable threading support in APR.], + [ enable_threads=$enableval] , + [ APR_CHECK_PTHREADS_H([ enable_threads="pthread" ] , + [ enable_threads="no" ] ) ] ) +fi + +if test "$enable_threads" = "no"; then +echo "Don't enable threads" + threads="0" + pthreadh="0" + pthreadser="0" +else +# +# Play with CPPFLAGS given what was learned from APR_PRELOAD. +# +# [Roy: I don't like this because it messes up an environment +# variable that should remain pristine. However, it is needed +# for compatibility until all flag handling can be rewritten.] +# + apr_save_cppflags="$CPPFLAGS" + if test -n "$THREAD_CPPFLAGS"; then + CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS" + fi + if test "$enable_threads" = "pthread"; then +# We have specified pthreads for our threading library, just make sure +# that we have everything we need + APR_PTHREADS_CHECK + APR_CHECK_PTHREADS_H([ + threads="1" + pthreadh="1" + pthreadser="1" + AC_DEFINE(USE_THREADS) ], [ + threads="0" + pthreadh="0" + pthreadser="0" ] ) + elif test "$enable_threads" = "system_threads"; then + threads="1" + pthreadh="0" + pthreadser="0" + else +# We basically specified that we wanted threads, but not how to implement +# them. In this case, just look for pthreads. In the future, we can check +# for other threading libraries as well. + APR_PTHREADS_CHECK + APR_CHECK_PTHREADS_H([ + threads="1" + pthreadh="1" + pthreadser="1" + AC_DEFINE(USE_THREADS) ], [ + threads="0" + pthreadser="0" + pthreadh="0" + CPPFLAGS="$apr_save_cppflags" ] ) + fi + if test "$pthreadh" = "1"; then + APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS + APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG + AC_CHECK_FUNCS(pthread_key_delete) + fi +fi + +ac_cv_define_READDIR_IS_THREAD_SAFE=no +if test "$threads" = "1"; then + echo "APR will use threads" + AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE)) +else + echo "APR will be non-threaded" +fi + +AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ]) + +AC_SUBST(threads) +AC_SUBST(have_sigwait) + +dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a +dnl threaded poll() and we don't want to use sendfile on early FreeBSD +dnl systems if we are also using threads. + +orig_sendfile=$sendfile +case "$OS" in + *freebsd*) + if test $os_version -le "410"; then + if test "$threads" = "1"; then + sendfile="0" + fi + fi + ;; + *alpha*-dec-osf* ) + sendfile="0" + ;; + s390-*-linux-gnu) + sendfile="0" + ;; +esac +if test "$orig_sendfile" != "$sendfile"; then + echo "sendfile support disabled to avoid system problem" +fi +AC_SUBST(sendfile) + + +AC_CHECK_FUNCS(poll) + +dnl #----------------------------- Checking for missing POSIX thread functions +AC_CHECK_FUNCS(getpwnam_r) +AC_CHECK_FUNCS(getpwuid_r) +AC_CHECK_FUNCS(getgrgid_r) + dnl #----------------------------- Checking for Shared Memory Support echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" @@ -563,118 +675,6 @@ fi AC_SUBST(aprdso) -dnl #----------------------------- Checking for Threads -echo $ac_n "${nl}Checking for Threads...${nl}" - -if test -z "$enable_threads"; then - AC_ARG_ENABLE(threads, - [ --enable-threads Enable threading support in APR.], - [ enable_threads=$enableval] , - [ APR_CHECK_PTHREADS_H([ enable_threads="pthread" ] , - [ enable_threads="no" ] ) ] ) -fi - -if test "$enable_threads" = "no"; then -echo "Don't enable threads" - threads="0" - pthreadh="0" - pthreadser="0" -else -# -# Play with CPPFLAGS given what was learned from APR_PRELOAD. -# -# [Roy: I don't like this because it messes up an environment -# variable that should remain pristine. However, it is needed -# for compatibility until all flag handling can be rewritten.] -# - apr_save_cppflags="$CPPFLAGS" - if test -n "$THREAD_CPPFLAGS"; then - CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS" - fi - if test "$enable_threads" = "pthread"; then -# We have specified pthreads for our threading library, just make sure -# that we have everything we need - APR_PTHREADS_CHECK - APR_CHECK_PTHREADS_H([ - threads="1" - pthreadh="1" - pthreadser="1" - AC_DEFINE(USE_THREADS) ], [ - threads="0" - pthreadh="0" - pthreadser="0" ] ) - elif test "$enable_threads" = "system_threads"; then - threads="1" - pthreadh="0" - pthreadser="0" - else -# We basically specified that we wanted threads, but not how to implement -# them. In this case, just look for pthreads. In the future, we can check -# for other threading libraries as well. - APR_PTHREADS_CHECK - APR_CHECK_PTHREADS_H([ - threads="1" - pthreadh="1" - pthreadser="1" - AC_DEFINE(USE_THREADS) ], [ - threads="0" - pthreadser="0" - pthreadh="0" - CPPFLAGS="$apr_save_cppflags" ] ) - fi - if test "$pthreadh" = "1"; then - APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS - APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG - AC_CHECK_FUNCS(pthread_key_delete) - fi -fi - -ac_cv_define_READDIR_IS_THREAD_SAFE=no -if test "$threads" = "1"; then - echo "APR will use threads" - AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE)) -else - echo "APR will be non-threaded" -fi - -AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ]) - -AC_SUBST(threads) -AC_SUBST(have_sigwait) - -dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a -dnl threaded poll() and we don't want to use sendfile on early FreeBSD -dnl systems if we are also using threads. - -orig_sendfile=$sendfile -case "$OS" in - *freebsd*) - if test $os_version -le "410"; then - if test "$threads" = "1"; then - sendfile="0" - fi - fi - ;; - *alpha*-dec-osf* ) - sendfile="0" - ;; - s390-*-linux-gnu) - sendfile="0" - ;; -esac -if test "$orig_sendfile" != "$sendfile"; then - echo "sendfile support disabled to avoid system problem" -fi -AC_SUBST(sendfile) - - -AC_CHECK_FUNCS(poll) - -dnl #----------------------------- Checking for missing POSIX thread functions -AC_CHECK_FUNCS(getpwnam_r) -AC_CHECK_FUNCS(getpwuid_r) -AC_CHECK_FUNCS(getgrgid_r) - dnl #----------------------------- Checking for Processes echo $ac_n "${nl}Checking for Processes...${nl}" From 82cf018505dbc5d4a78d326f35c58f1f845db535 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 25 Feb 2001 20:39:41 +0000 Subject: [PATCH 1316/7878] Fix the hosed #ifdef APR_HAVE_FOO_H tests, the #if HAVE_ tests, and also cleanup s/#ifdef HAVE_FOO_H/#if APR_HAVE_FOO_H/ whrere appropriate. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61303 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 4 ++-- file_io/unix/flock.c | 2 +- file_io/unix/readwrite.c | 2 +- file_io/win32/dir.c | 2 +- i18n/unix/xlate.c | 10 +++++----- include/apr.h.in | 3 ++- include/apr.hw | 5 +++-- include/arch/os2/networkio.h | 2 +- include/arch/unix/fileio.h | 10 +++++----- include/arch/unix/locks.h | 7 +++---- include/arch/unix/misc.h | 4 ++-- include/arch/unix/networkio.h | 22 +++++++++++----------- include/arch/unix/threadproc.h | 6 +++--- include/arch/win32/apr_private.h | 6 +++--- include/arch/win32/fileio.h | 7 ++----- include/arch/win32/misc.h | 4 ++-- lib/apr_pools.c | 10 +++++----- memory/unix/apr_pools.c | 10 +++++----- misc/unix/errorcodes.c | 2 +- misc/unix/getuuid.c | 2 +- misc/unix/rand.c | 2 +- mmap/unix/mmap.c | 6 +++--- network_io/unix/inet_ntop.c | 8 ++++---- network_io/unix/inet_pton.c | 8 ++++---- network_io/unix/sa_common.c | 2 +- passwd/apr_getpass.c | 6 +++--- passwd/apr_md5.c | 6 +++--- strings/apr_cpystrn.c | 4 ++-- strings/apr_fnmatch.c | 2 +- strings/apr_snprintf.c | 10 +++++----- tables/apr_hash.c | 4 ++-- tables/apr_tables.c | 4 ++-- test/testoc.c | 2 +- threadproc/unix/procsup.c | 2 +- threadproc/unix/signals.c | 2 +- threadproc/win32/signals.c | 2 +- time/unix/time.c | 6 +++--- time/unix/timestr.c | 6 +++--- user/win32/groupinfo.c | 3 --- 39 files changed, 100 insertions(+), 105 deletions(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 57fbea0fd85..b4ee74f8b76 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -55,10 +55,10 @@ #include "fileio.h" #include "apr_strings.h" #include "apr_portable.h" -#ifdef HAVE_SYS_SYSLIMITS_H +#if APR_HAVE_SYS_SYSLIMITS_H #include #endif -#ifdef HAVE_LIMITS_H +#if APR_HAVE_LIMITS_H #include #endif diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c index 7765a392a4f..e656b1baf87 100644 --- a/file_io/unix/flock.c +++ b/file_io/unix/flock.c @@ -54,7 +54,7 @@ #include "fileio.h" -#ifdef HAVE_FCNTL_H +#if APR_HAVE_FCNTL_H #include #endif #ifdef HAVE_SYS_FILE_H diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 9f4795a7308..7de55434238 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -281,7 +281,7 @@ apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { #ifdef HAVE_WRITEV - int bytes; + int bytes; if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { *nbytes = 0; diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 514d25f627c..0e1e900ed5a 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -62,7 +62,7 @@ #if APR_HAVE_ERRNO_H #include #endif -#ifdef HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif #if APR_HAVE_DIRENT_H diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 07ea14650a7..c46c7a0c3c9 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -95,7 +95,7 @@ struct apr_xlate_t { char *frompage; char *topage; char *sbcs_table; -#ifdef HAVE_ICONV +#ifdev HAVE_ICONV iconv_t ich; #endif }; @@ -173,7 +173,7 @@ static const char *handle_special_names(const char *page) static apr_status_t apr_xlate_cleanup(void *convset) { -#ifdef HAVE_ICONV +#ifdev HAVE_ICONV apr_xlate_t *old = convset; if (old->ich != (iconv_t)-1) { @@ -185,7 +185,7 @@ static apr_status_t apr_xlate_cleanup(void *convset) return APR_SUCCESS; } -#ifdef HAVE_ICONV +#ifdev HAVE_ICONV static void check_sbcs(apr_xlate_t *convset) { char inbuf[256], outbuf[256]; @@ -251,7 +251,7 @@ apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, set found to non-zero if found in the cache #endif -#ifdef HAVE_ICONV +#ifdev HAVE_ICONV if (!found) { new->ich = iconv_open(topage, frompage); if (new->ich == (iconv_t)-1) { @@ -287,7 +287,7 @@ apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, apr_size_t *outbytes_left) { apr_status_t status = APR_SUCCESS; -#ifdef HAVE_ICONV +#ifdev HAVE_ICONV size_t translated; if (convset->ich != (iconv_t)-1) { diff --git a/include/apr.h.in b/include/apr.h.in index 13a09a4ecc6..8d8a802affb 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -24,6 +24,7 @@ #endif #define APR_HAVE_ARPA_INET_H @arpa_ineth@ +#define APR_HAVE_CONIO_H @conioh@ #define APR_HAVE_CRYPT_H @crypth@ #define APR_HAVE_CTYPE_H @ctypeh@ #define APR_HAVE_DIRENT_H @direnth@ @@ -37,6 +38,7 @@ #define APR_HAVE_STDARG_H @stdargh@ #define APR_HAVE_STDIO_H @stdioh@ #define APR_HAVE_STDLIB_H @stdlibh@ +#define APR_HAVE_SIGNAL_H @signalh@ #define APR_HAVE_STRING_H @stringh@ #define APR_HAVE_STRINGS_H @stringsh@ #define APR_HAVE_SYS_SIGNAL_H @sys_signalh@ @@ -44,7 +46,6 @@ #define APR_HAVE_SYS_SYSLIMITS_H @sys_syslimitsh@ #define APR_HAVE_SYS_TYPES_H @sys_typesh@ #define APR_HAVE_SYS_UIO_H @sys_uioh@ -#define APR_HAVE_SIGNAL_H @signalh@ #define APR_HAVE_SYS_WAIT_H @sys_waith@ #define APR_HAVE_UNISTD_H @unistdh@ diff --git a/include/apr.hw b/include/apr.hw index bdb105cc9a8..e5cc8589f10 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -115,16 +115,18 @@ #define NO_USE_SIGACTION #define APR_HAVE_ARPA_INET_H 0 +#define APR_HAVE_CONIO_H 1 #define APR_HAVE_CRYPT_H 0 #define APR_HAVE_CTYPE_H 1 #define APR_HAVE_DIRENT_H 0 #define APR_HAVE_ERRNO_H 1 #define APR_HAVE_FCNTL_H 1 #define APR_HAVE_IO_H 1 -#define APR_HAVE_LIMITS_H 0 +#define APR_HAVE_LIMITS_H 1 #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 #define APR_HAVE_PTHREAD_H 0 +#define APR_HAVE_SIGNAL_H 1 #define APR_HAVE_STDARG_H 1 #define APR_HAVE_STDIO_H 1 #define APR_HAVE_STDLIB_H 1 @@ -135,7 +137,6 @@ #define APR_HAVE_SYS_SYSLIMITS_H 0 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 0 -#define APR_HAVE_SIGNAL_H 1 #define APR_HAVE_SYS_WAIT_H 0 #define APR_HAVE_UNISTD_H 0 diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index 79534d7c6ef..64ed34a7e93 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -59,7 +59,7 @@ #include "apr_network_io.h" #include "apr_general.h" #include "os2calls.h" -#if HAVE_NETDB_H +#if APR_HAVE_NETDB_H #include #endif diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 3019db82558..3d71a43672a 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -74,7 +74,7 @@ #if APR_HAVE_ERRNO_H #include #endif -#if HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif #if APR_HAVE_STRINGS_H @@ -83,22 +83,22 @@ #if APR_HAVE_DIRENT_H #include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H #include #endif -#if HAVE_UNISTD_H +#if APR_HAVE_UNISTD_H #include #endif #if APR_HAVE_STDIO_H #include #endif -#if HAVE_STDLIB_H +#if APR_HAVE_STDLIB_H #include #endif #if APR_HAVE_SYS_UIO_H #include #endif -#if HAVE_SYS_TIME_H +#if APR_HAVE_SYS_TIME_H #include #endif #ifdef BEOS diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index e1cfc3b7e85..b71638a0bca 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -72,20 +72,19 @@ #include #endif -/* ### create APR_HAVE_* macros for these? */ #ifdef HAVE_SYS_SEM_H #include #endif #ifdef HAVE_SYS_FILE_H #include #endif -#ifdef HAVE_STDLIB_H +#if APR_HAVE_STDLIB_H #include #endif -#ifdef HAVE_UNISTD_H +#if APR_HAVE_UNISTD_H #include #endif -#ifdef HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif #ifdef HAVE_SYS_MMAN_H diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index 0849b5ef371..696943772ca 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -76,10 +76,10 @@ #endif /* ### create APR_HAVE_* macros for these? */ -#ifdef HAVE_STDLIB_H +#if APR_HAVE_STDLIB_H #include #endif -#ifdef HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 5890de68ea3..df1b5d12f6c 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -69,43 +69,43 @@ #if APR_HAVE_SYS_UIO_H #include #endif -#if HAVE_SYS_POLL_H +#if APR_HAVE_SYS_POLL_H #include #endif -#if HAVE_POLL_H +#ifdef HAVE_POLL_H #include #endif #if APR_HAVE_ERRNO_H #include #endif -#if HAVE_SYS_TIME_H +#if APR_HAVE_SYS_TIME_H #include #endif -#if HAVE_UNISTD_H +#if APR_HAVE_UNISTD_H #include #endif -#if HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif -#if HAVE_NETINET_TCP_H +#if APR_HAVE_NETINET_TCP_H #include #endif -#if HAVE_NETINET_IN_H +#if APR_HAVE_NETINET_IN_H #include #endif -#if HAVE_ARPA_INET_H +#if APR_HAVE_ARPA_INET_H #include #endif -#if HAVE_SYS_SOCKET_H +#if APR_HAVE_SYS_SOCKET_H #include #endif -#if HAVE_NETDB_H +#if APR_HAVE_NETDB_H #include #endif #if APR_HAVE_FCNTL_H #include #endif -#if HAVE_SYS_SENDFILE_H +#if APR_HAVE_SYS_SENDFILE_H #include #endif /* End System Headers */ diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index 489bb011468..c14270dd39b 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -62,19 +62,19 @@ #if APR_HAVE_PTHREAD_H #include #endif -#if HAVE_SYS_RESOURCE_H +#ifdef HAVE_SYS_RESOURCE_H #include #endif #if APR_HAVE_SIGNAL_H #include #endif -#if HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif #if APR_HAVE_SYS_WAIT_H #include #endif -#if HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif /* End System Headers */ diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index c993ed77181..d2cbc8ded56 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -111,11 +111,11 @@ /* Use this section to define all of the HAVE_FOO_H * that are required to build properly. */ -#define HAVE_CONIO_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_STDLIB_H 1 #define HAVE_LIMITS_H 1 +#define HAVE_MALLOC_H 1 #define HAVE_SIGNAL_H 1 +/* #define HAVE_STDDEF_H 1 why not? */ +#define HAVE_STDLIB_H 1 #define HAVE_STRICMP 1 #define HAVE_STRNICMP 1 diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 6c56a4c156a..71dd541afb4 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -66,10 +66,10 @@ #include "apr_errno.h" #include "misc.h" -#if APR_HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H #include #endif -#ifdef HAVE_SYS_TYPES_H +#if APR_HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_FCNTL_H @@ -84,9 +84,6 @@ #ifdef HAVE_MALLOC_H #include #endif -#ifdef HAVE_UIO_H -#include -#endif #if APR_HAS_UNICODE_FS #include "i18n.h" diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 0849b5ef371..696943772ca 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -76,10 +76,10 @@ #endif /* ### create APR_HAVE_* macros for these? */ -#ifdef HAVE_STDLIB_H +#if APR_HAVE_STDLIB_H #include #endif -#ifdef HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 4f60d5c0a0b..9a2f4dbf7d1 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -70,13 +70,13 @@ #include "apr_lock.h" #include "apr_hash.h" -#ifdef HAVE_STDIO_H +#if APR_HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif -#ifdef HAVE_SYS_SIGNAL_H +#if APR_HAVE_SYS_SIGNAL_H #include #endif #if APR_HAVE_SIGNAL_H @@ -88,17 +88,17 @@ #if APR_HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_UNISTD_H +#if APR_HAVE_UNISTD_H #include #endif #if APR_HAVE_FCNTL_H #include #endif -#ifdef HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif -#ifdef HAVE_STDLIB_H +#if APR_HAVE_STDLIB_H #include #endif #ifdef HAVE_MALLOC_H diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 4f60d5c0a0b..9a2f4dbf7d1 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -70,13 +70,13 @@ #include "apr_lock.h" #include "apr_hash.h" -#ifdef HAVE_STDIO_H +#if APR_HAVE_STDIO_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif -#ifdef HAVE_SYS_SIGNAL_H +#if APR_HAVE_SYS_SIGNAL_H #include #endif #if APR_HAVE_SIGNAL_H @@ -88,17 +88,17 @@ #if APR_HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_UNISTD_H +#if APR_HAVE_UNISTD_H #include #endif #if APR_HAVE_FCNTL_H #include #endif -#ifdef HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif -#ifdef HAVE_STDLIB_H +#if APR_HAVE_STDLIB_H #include #endif #ifdef HAVE_MALLOC_H diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 785bf94f878..5a7fcf6c657 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -57,7 +57,7 @@ #include "apr_lib.h" #include "apr_dso.h" -#ifdef HAVE_NETDB_H +#if APR_HAVE_NETDB_H #include #endif #ifdef HAVE_DLFCN_H diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index f43c99c21e0..3d8f72cdd8e 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -72,7 +72,7 @@ #if APR_HAVE_STRINGS_H #include #endif -#ifdef HAVE_NETDB_H +#if APR_HAVE_NETDB_H #include #endif diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 71778c6fd1e..6f1d773099c 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -56,7 +56,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H +#if APR_HAVE_UNISTD_H #include #endif diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 32ae8a6d00a..b5907772ba5 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -64,16 +64,16 @@ #ifdef BEOS #include #endif -#if HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif #if APR_HAVE_STDIO_H #include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H #include #endif -#if HAVE_SYS_MMAN_H +#ifdef HAVE_SYS_MMAN_H #include #endif diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index cb3f418ab25..6360b6abad5 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -17,16 +17,16 @@ #include "apr_private.h" #include "networkio.h" -#ifdef HAVE_SYS_TYPES_H +#if APR_HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_SYS_SOCKET_H +#if APR_HAVE_SYS_SOCKET_H #include #endif -#ifdef HAVE_NETINET_IN_H +#if APR_HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_ARPA_INET_H +#if APR_HAVE_ARPA_INET_H #include #endif #include diff --git a/network_io/unix/inet_pton.c b/network_io/unix/inet_pton.c index 915884bc12f..711384cb8ee 100644 --- a/network_io/unix/inet_pton.c +++ b/network_io/unix/inet_pton.c @@ -17,16 +17,16 @@ #include "apr_private.h" #include "networkio.h" -#ifdef HAVE_SYS_TYPES_H +#if APR_HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_SYS_SOCKET_H +#if APR_HAVE_SYS_SOCKET_H #include #endif -#ifdef HAVE_NETINET_IN_H +#if APR_HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_ARPA_INET_H +#if APR_HAVE_ARPA_INET_H #include #endif #include diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 8d607c96208..f84ce52ac28 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -67,7 +67,7 @@ #include "apr_lib.h" #include "apr_strings.h" -#ifdef HAVE_STDLIB_H +#if APR_HAVE_STDLIB_H #include #endif diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 1338b097730..dc1a44d6034 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -64,13 +64,13 @@ #include #include -#if HAVE_UNISTD_H +#if APR_HAVE_UNISTD_H #include #endif -#if HAVE_CONIO_H +#if APR_HAVE_CONIO_H #include #endif -#if HAVE_STDLIB_H +#if APR_HAVE_STDLIB_H #include #endif #if APR_HAVE_STRING_H diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index 2264a4bcb7a..48d1f1c4b45 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -102,13 +102,13 @@ #include "apr_md5.h" #include "apr_lib.h" -#ifdef HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif -#ifdef HAVE_CRYPT_H +#if APR_HAVE_CRYPT_H #include #endif -#ifdef HAVE_UNISTD_H +#if APR_HAVE_UNISTD_H #include #endif diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index a51ddef1214..0ece3ed17db 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -60,10 +60,10 @@ #if APR_HAVE_SYS_TYPES_H #include #endif -#if HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif -#if HAVE_CTYPE_H +#if APR_HAVE_CTYPE_H #include #endif diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index 63e8e9dce53..f9a20c262c0 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -48,7 +48,7 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; #include "apr_fnmatch.h" #include "apr_lib.h" #include -#ifdef HAVE_CTYPE_H +#if APR_HAVE_CTYPE_H # include #endif diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 5daedc9b60f..0499531e980 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -63,22 +63,22 @@ #include "apr_strings.h" #include "apr_network_io.h" #include -#ifdef HAVE_CTYPE_H +#if APR_HAVE_CTYPE_H #include #endif #if APR_HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_SYS_SOCKET_H +#if APR_HAVE_SYS_SOCKET_H #include #endif -#ifdef HAVE_ARPA_INET_H +#if APR_HAVE_ARPA_INET_H #include #endif -#ifdef HAVE_LIMITS_H +#if APR_HAVE_LIMITS_H #include #endif -#ifdef HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif diff --git a/tables/apr_hash.c b/tables/apr_hash.c index c8505087d12..2940d604339 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -63,10 +63,10 @@ #include "apr_hash.h" -#ifdef HAVE_STDLIB_H +#if APR_HAVE_STDLIB_H #include #endif -#ifdef HAVE_STDLIB_H +#if APR_HAVE_STDLIB_H #include #endif diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 6c97da9bc1a..ef6bc17e2e8 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -66,13 +66,13 @@ #include "apr_tables.h" #include "apr_strings.h" #include "apr_lib.h" -#ifdef HAVE_STDLIB_H +#if APR_HAVE_STDLIB_H #include #endif #ifdef HAVE_MALLOC_H #include #endif -#ifdef HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif #if APR_HAVE_STRINGS_H diff --git a/test/testoc.c b/test/testoc.c index f7ee02c3ed8..8d0896b630e 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -60,7 +60,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H +#if APR_HAVE_UNISTD_H #include #endif diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index 8081e2ed10c..c7f828bad7b 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -72,7 +72,7 @@ apr_status_t apr_proc_detach(void) } /* RAISE_SIGSTOP(DETACH);*/ #endif -#if HAVE_SETSID +#if APR_HAVE_SETSID if ((pgrp = setsid()) == -1) { return errno; } diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 0b14fb1c69f..335fe66242f 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -88,7 +88,7 @@ apr_status_t apr_proc_kill(apr_proc_t *proc, int signum) } -#ifdef HAVE_SIGACTION +#if APR_HAVE_SIGACTION /* * Replace standard signal() with the more reliable sigaction equivalent diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 970ea70a768..308a59c51ca 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -59,7 +59,7 @@ #include "apr_general.h" #include #include -#ifdef HAVE_SYS_WAIT +#if APR_HAVE_SYS_WAIT #include #endif diff --git a/time/unix/time.c b/time/unix/time.c index 9076d77e3ec..6427f29f4c0 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -57,13 +57,13 @@ #include "apr_lib.h" #include "apr_private.h" /* System Headers required for time library */ -#if HAVE_SYS_TIME_H +#if APR_HAVE_SYS_TIME_H #include #endif -#if HAVE_UNISTD_H +#if APR_HAVE_UNISTD_H #include #endif -#if HAVE_TIME_H +#ifdef HAVE_TIME_H #include #endif #ifdef BEOS diff --git a/time/unix/timestr.c b/time/unix/timestr.c index 82d39df62d4..dcf928a6207 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -57,13 +57,13 @@ #include "apr_lib.h" #include "apr_private.h" /* System Headers required for time library */ -#if HAVE_SYS_TIME_H +#if APR_HAVE_SYS_TIME_H #include #endif -#if HAVE_TIME_H +#ifdef HAVE_TIME_H #include #endif -#if HAVE_STRING_H +#if APR_HAVE_STRING_H #include #endif /* End System Headers */ diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index 1f582cf5b8e..b66853e15a8 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -56,9 +56,6 @@ #include "apr_portable.h" #include "apr_user.h" #include "apr_private.h" -#ifdef HAVE_GRP_H -#include -#endif #if APR_HAVE_SYS_TYPES_H #include #endif From e246b3dd223a1c508d8d0541981049933d5a8164 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 25 Feb 2001 20:46:49 +0000 Subject: [PATCH 1317/7878] Fix hand-patched typos (sorry guys) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61304 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 2 +- i18n/unix/xlate.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 7de55434238..9f4795a7308 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -281,7 +281,7 @@ apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { #ifdef HAVE_WRITEV - int bytes; + int bytes; if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { *nbytes = 0; diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index c46c7a0c3c9..07ea14650a7 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -95,7 +95,7 @@ struct apr_xlate_t { char *frompage; char *topage; char *sbcs_table; -#ifdev HAVE_ICONV +#ifdef HAVE_ICONV iconv_t ich; #endif }; @@ -173,7 +173,7 @@ static const char *handle_special_names(const char *page) static apr_status_t apr_xlate_cleanup(void *convset) { -#ifdev HAVE_ICONV +#ifdef HAVE_ICONV apr_xlate_t *old = convset; if (old->ich != (iconv_t)-1) { @@ -185,7 +185,7 @@ static apr_status_t apr_xlate_cleanup(void *convset) return APR_SUCCESS; } -#ifdev HAVE_ICONV +#ifdef HAVE_ICONV static void check_sbcs(apr_xlate_t *convset) { char inbuf[256], outbuf[256]; @@ -251,7 +251,7 @@ apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, set found to non-zero if found in the cache #endif -#ifdev HAVE_ICONV +#ifdef HAVE_ICONV if (!found) { new->ich = iconv_open(topage, frompage); if (new->ich == (iconv_t)-1) { @@ -287,7 +287,7 @@ apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, apr_size_t *outbytes_left) { apr_status_t status = APR_SUCCESS; -#ifdev HAVE_ICONV +#ifdef HAVE_ICONV size_t translated; if (convset->ich != (iconv_t)-1) { From 8c9ac91f9eaf221cede65346d798d3852bbd9107 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 25 Feb 2001 22:20:24 +0000 Subject: [PATCH 1318/7878] A patch to clean up much bogusity in Win32. Eliminates absolute cd "/..." references using build/fixwin32mak.pl, and the latest #if APR_HAVE_FOO_H fixes apparently worked, now that they no longer appear as dependencies [which had broken the build entirely.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61305 13f79535-47bb-0310-9956-ffa450edef68 --- apr.mak | 62 ------------------------------------------------------ libapr.mak | 62 ------------------------------------------------------ 2 files changed, 124 deletions(-) diff --git a/apr.mak b/apr.mak index c367adb758c..db8fe2fb7c3 100644 --- a/apr.mak +++ b/apr.mak @@ -416,8 +416,6 @@ DEP_CPP_TIME_=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)" ".\include\apr.h" @@ -441,8 +439,6 @@ DEP_CPP_TIMES=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"\ @@ -493,8 +489,6 @@ DEP_CPP_APR_S=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"sys\socket.h"\ "$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_S) "$(INTDIR)"\ @@ -613,9 +607,6 @@ DEP_CPP_ERROR=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"netdb.h"\ - {$(INCLUDE)}"sys\socket.h"\ "$(INTDIR)\errorcodes.obj" : $(SOURCE) $(DEP_CPP_ERROR) "$(INTDIR)"\ @@ -639,7 +630,6 @@ DEP_CPP_GETOP=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"\ @@ -674,7 +664,6 @@ DEP_CPP_MISC_=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\misc.obj" : $(SOURCE) $(DEP_CPP_MISC_) "$(INTDIR)" ".\include\apr.h" @@ -695,7 +684,6 @@ DEP_CPP_NAMES=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"\ @@ -734,7 +722,6 @@ DEP_CPP_START=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\locks.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"\ @@ -780,8 +767,6 @@ DEP_CPP_DIR_C=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)" ".\include\apr.h" @@ -809,8 +794,6 @@ DEP_CPP_FILEA=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"\ @@ -839,8 +822,6 @@ DEP_CPP_FILED=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"\ @@ -870,8 +851,6 @@ DEP_CPP_FILES=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"\ @@ -899,8 +878,6 @@ DEP_CPP_FLOCK=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\flock.obj" : $(SOURCE) $(DEP_CPP_FLOCK) "$(INTDIR)"\ @@ -918,7 +895,6 @@ DEP_CPP_FULLR=\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\fullrw.obj" : $(SOURCE) $(DEP_CPP_FULLR) "$(INTDIR)"\ @@ -950,8 +926,6 @@ DEP_CPP_OPEN_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)" ".\include\apr.h" @@ -979,8 +953,6 @@ DEP_CPP_PIPE_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)" ".\include\apr.h" @@ -1010,8 +982,6 @@ DEP_CPP_READW=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"\ @@ -1039,8 +1009,6 @@ DEP_CPP_SEEK_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)" ".\include\apr.h" @@ -1065,8 +1033,6 @@ DEP_CPP_LOCKS=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\locks.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"\ @@ -1088,8 +1054,6 @@ DEP_CPP_INET_=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\networkio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"sys\socket.h"\ "$(INTDIR)\inet_ntop.obj" : $(SOURCE) $(DEP_CPP_INET_) "$(INTDIR)"\ @@ -1111,7 +1075,6 @@ DEP_CPP_POLL_=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\poll.obj" : $(SOURCE) $(DEP_CPP_POLL_) "$(INTDIR)" ".\include\apr.h" @@ -1142,8 +1105,6 @@ DEP_CPP_SENDR=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\networkio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\sendrecv.obj" : $(SOURCE) $(DEP_CPP_SENDR) "$(INTDIR)"\ @@ -1167,7 +1128,6 @@ DEP_CPP_SOCKA=\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ ".\network_io\unix\sa_common.c"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\sockaddr.obj" : $(SOURCE) $(DEP_CPP_SOCKA) "$(INTDIR)"\ @@ -1193,8 +1153,6 @@ DEP_CPP_SOCKE=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\sockets.obj" : $(SOURCE) $(DEP_CPP_SOCKE) "$(INTDIR)"\ @@ -1216,7 +1174,6 @@ DEP_CPP_SOCKO=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"\ @@ -1249,8 +1206,6 @@ DEP_CPP_PROC_=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\threadproc.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)" ".\include\apr.h" @@ -1278,8 +1233,6 @@ DEP_CPP_SIGNA=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\threadproc.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"\ @@ -1306,8 +1259,6 @@ DEP_CPP_THREA=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\threadproc.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"\ @@ -1334,8 +1285,6 @@ DEP_CPP_THREAD=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\threadproc.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"\ @@ -1366,8 +1315,6 @@ DEP_CPP_DSO_C=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\dso.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\dso.obj" : $(SOURCE) $(DEP_CPP_DSO_C) "$(INTDIR)" ".\include\apr.h" @@ -1394,8 +1341,6 @@ DEP_CPP_APR_P=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ @@ -1444,7 +1389,6 @@ DEP_CPP_COMMO=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\common.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ @@ -1476,8 +1420,6 @@ DEP_CPP_MMAP_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\mmap.obj" : $(SOURCE) $(DEP_CPP_MMAP_) "$(INTDIR)" ".\include\apr.h" @@ -1501,8 +1443,6 @@ DEP_CPP_GROUP=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\groupinfo.obj" : $(SOURCE) $(DEP_CPP_GROUP) "$(INTDIR)"\ @@ -1527,8 +1467,6 @@ DEP_CPP_USERI=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\ diff --git a/libapr.mak b/libapr.mak index 62edaa906bd..b8de8247aeb 100644 --- a/libapr.mak +++ b/libapr.mak @@ -433,8 +433,6 @@ DEP_CPP_TIME_=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)" ".\include\apr.h" @@ -458,8 +456,6 @@ DEP_CPP_TIMES=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"\ @@ -510,8 +506,6 @@ DEP_CPP_APR_S=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"sys\socket.h"\ "$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_S) "$(INTDIR)"\ @@ -630,9 +624,6 @@ DEP_CPP_ERROR=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"netdb.h"\ - {$(INCLUDE)}"sys\socket.h"\ "$(INTDIR)\errorcodes.obj" : $(SOURCE) $(DEP_CPP_ERROR) "$(INTDIR)"\ @@ -656,7 +647,6 @@ DEP_CPP_GETOP=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"\ @@ -691,7 +681,6 @@ DEP_CPP_MISC_=\ ".\include\apr_want.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\misc.obj" : $(SOURCE) $(DEP_CPP_MISC_) "$(INTDIR)" ".\include\apr.h" @@ -712,7 +701,6 @@ DEP_CPP_NAMES=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"\ @@ -751,7 +739,6 @@ DEP_CPP_START=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\locks.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"\ @@ -797,8 +784,6 @@ DEP_CPP_DIR_C=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)" ".\include\apr.h" @@ -826,8 +811,6 @@ DEP_CPP_FILEA=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"\ @@ -856,8 +839,6 @@ DEP_CPP_FILED=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"\ @@ -887,8 +868,6 @@ DEP_CPP_FILES=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"\ @@ -916,8 +895,6 @@ DEP_CPP_FLOCK=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\flock.obj" : $(SOURCE) $(DEP_CPP_FLOCK) "$(INTDIR)"\ @@ -935,7 +912,6 @@ DEP_CPP_FULLR=\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\fullrw.obj" : $(SOURCE) $(DEP_CPP_FULLR) "$(INTDIR)"\ @@ -967,8 +943,6 @@ DEP_CPP_OPEN_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)" ".\include\apr.h" @@ -996,8 +970,6 @@ DEP_CPP_PIPE_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)" ".\include\apr.h" @@ -1027,8 +999,6 @@ DEP_CPP_READW=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"\ @@ -1056,8 +1026,6 @@ DEP_CPP_SEEK_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)" ".\include\apr.h" @@ -1082,8 +1050,6 @@ DEP_CPP_LOCKS=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\locks.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"\ @@ -1105,8 +1071,6 @@ DEP_CPP_INET_=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\networkio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"sys\socket.h"\ "$(INTDIR)\inet_ntop.obj" : $(SOURCE) $(DEP_CPP_INET_) "$(INTDIR)"\ @@ -1128,7 +1092,6 @@ DEP_CPP_POLL_=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\poll.obj" : $(SOURCE) $(DEP_CPP_POLL_) "$(INTDIR)" ".\include\apr.h" @@ -1159,8 +1122,6 @@ DEP_CPP_SENDR=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\networkio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\sendrecv.obj" : $(SOURCE) $(DEP_CPP_SENDR) "$(INTDIR)"\ @@ -1184,7 +1145,6 @@ DEP_CPP_SOCKA=\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ ".\network_io\unix\sa_common.c"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\sockaddr.obj" : $(SOURCE) $(DEP_CPP_SOCKA) "$(INTDIR)"\ @@ -1210,8 +1170,6 @@ DEP_CPP_SOCKE=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\sockets.obj" : $(SOURCE) $(DEP_CPP_SOCKE) "$(INTDIR)"\ @@ -1233,7 +1191,6 @@ DEP_CPP_SOCKO=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\networkio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"\ @@ -1266,8 +1223,6 @@ DEP_CPP_PROC_=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\threadproc.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)" ".\include\apr.h" @@ -1295,8 +1250,6 @@ DEP_CPP_SIGNA=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ ".\include\arch\win32\threadproc.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"\ @@ -1323,8 +1276,6 @@ DEP_CPP_THREA=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\threadproc.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"\ @@ -1351,8 +1302,6 @@ DEP_CPP_THREAD=\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\threadproc.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"\ @@ -1383,8 +1332,6 @@ DEP_CPP_DSO_C=\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\dso.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\dso.obj" : $(SOURCE) $(DEP_CPP_DSO_C) "$(INTDIR)" ".\include\apr.h" @@ -1411,8 +1358,6 @@ DEP_CPP_APR_P=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ @@ -1461,7 +1406,6 @@ DEP_CPP_COMMO=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ "$(INTDIR)\common.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ @@ -1493,8 +1437,6 @@ DEP_CPP_MMAP_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\mmap.obj" : $(SOURCE) $(DEP_CPP_MMAP_) "$(INTDIR)" ".\include\apr.h" @@ -1518,8 +1460,6 @@ DEP_CPP_GROUP=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\groupinfo.obj" : $(SOURCE) $(DEP_CPP_GROUP) "$(INTDIR)"\ @@ -1544,8 +1484,6 @@ DEP_CPP_USERI=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - {$(INCLUDE)}"arpa\inet.h"\ - {$(INCLUDE)}"dirent.h"\ "$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\ From 91bd8ea42589911ae4d65242013fa667ad6fa79a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 25 Feb 2001 23:21:40 +0000 Subject: [PATCH 1319/7878] fix conio check so at least some of the build works git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61306 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 5f3c92f1796..4c6fcc09770 100644 --- a/configure.in +++ b/configure.in @@ -403,7 +403,7 @@ dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC AC_CHECK_HEADERS(ByteOrder.h) -AC_CHECK_HEADERS(conio.h) +AC_CHECK_HEADERS(conio.h, conioh="1", conioh="0") AC_CHECK_HEADERS(crypt.h, crypth="1", crypth="0") AC_CHECK_HEADERS(ctype.h, ctypeh="1", ctypeh="0") AC_CHECK_HEADERS(dir.h) @@ -463,6 +463,7 @@ AC_CHECK_HEADERS(dl.h) AC_CHECK_HEADERS(kernel/OS.h) AC_SUBST(arpa_ineth) +AC_SUBST(conioh) AC_SUBST(ctypeh) AC_SUBST(crypth) AC_SUBST(errnoh) From 106854a1a2ae605061e64914af805ccd0ffd9f83 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 26 Feb 2001 00:21:10 +0000 Subject: [PATCH 1320/7878] Get some necessary APR_HAVE_xxx symbols actually defined. I haven't verified that all necessary ones introduced earlier today are defined. This just gets *me* building. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61307 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 ++++-- include/apr.h.in | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 4c6fcc09770..5323b237b56 100644 --- a/configure.in +++ b/configure.in @@ -433,7 +433,7 @@ AC_CHECK_HEADERS(sysapi.h) AC_CHECK_HEADERS(sysgtime.h) AC_CHECK_HEADERS(termios.h) AC_CHECK_HEADERS(time.h) -AC_CHECK_HEADERS(sys/time.h) +AC_CHECK_HEADERS(sys/time.h, sys_timeh="1", sys_timeh="0") AC_CHECK_HEADERS(tpfeq.h) AC_CHECK_HEADERS(tpfio.h) AC_CHECK_HEADERS(sys/uio.h, sys_uioh="1", sys_uioh="0") @@ -443,7 +443,7 @@ AC_CHECK_HEADERS(sys/poll.h) AC_CHECK_HEADERS(unix.h) AC_CHECK_HEADERS(arpa/inet.h, arpa_ineth="1", arpa_ineth="0") AC_CHECK_HEADERS(netinet/in.h, netinet_inh="1", netinet_inh="0") -AC_CHECK_HEADERS(netinet/tcp.h) +AC_CHECK_HEADERS(netinet/tcp.h, netinet_tcph="1", netinet_tcph="0") AC_CHECK_HEADERS(iconv.h) AC_CHECK_HEADERS(langinfo.h) @@ -474,6 +474,7 @@ AC_SUBST(limitsh) AC_SUBST(netdbh) AC_SUBST(sys_syslimitsh) AC_SUBST(netinet_inh) +AC_SUBST(netinet_tcph) AC_SUBST(stdargh) AC_SUBST(stdioh) AC_SUBST(stdlibh) @@ -482,6 +483,7 @@ AC_SUBST(stringsh) AC_SUBST(sys_signalh) AC_SUBST(sys_socketh) AC_SUBST(sys_typesh) +AC_SUBST(sys_timeh) AC_SUBST(sys_uioh) AC_SUBST(unistdh) AC_SUBST(signalh) diff --git a/include/apr.h.in b/include/apr.h.in index 8d8a802affb..961d914bc19 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -34,6 +34,7 @@ #define APR_HAVE_LIMITS_H @limitsh@ #define APR_HAVE_NETDB_H @netdbh@ #define APR_HAVE_NETINET_IN_H @netinet_inh@ +#define APR_HAVE_NETINET_TCP_H @netinet_tcph@ #define APR_HAVE_PTHREAD_H @pthreadh@ #define APR_HAVE_STDARG_H @stdargh@ #define APR_HAVE_STDIO_H @stdioh@ @@ -44,6 +45,7 @@ #define APR_HAVE_SYS_SIGNAL_H @sys_signalh@ #define APR_HAVE_SYS_SOCKET_H @sys_socketh@ #define APR_HAVE_SYS_SYSLIMITS_H @sys_syslimitsh@ +#define APR_HAVE_SYS_TIME_H @sys_timeh@ #define APR_HAVE_SYS_TYPES_H @sys_typesh@ #define APR_HAVE_SYS_UIO_H @sys_uioh@ #define APR_HAVE_SYS_WAIT_H @sys_waith@ From 716ae4f28be28061e4ac4b1344ebc852b0f84cf5 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 26 Feb 2001 04:19:58 +0000 Subject: [PATCH 1321/7878] Fix typo. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61308 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 2940d604339..ecaf13d673a 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -66,7 +66,7 @@ #if APR_HAVE_STDLIB_H #include #endif -#if APR_HAVE_STDLIB_H +#if APR_HAVE_STRING_H #include #endif From 52142c3a68f8e36806d4764ccd11fa5c5810926f Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 26 Feb 2001 04:38:22 +0000 Subject: [PATCH 1322/7878] Begin to move functions from the http module to the core. The goal is to have only functions that are HTTP specific in the http directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61309 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 5 +++++ network_io/unix/sendrecv.c | 1 + 2 files changed, 6 insertions(+) diff --git a/include/apr_general.h b/include/apr_general.h index 820ce5080cb..f49ba6c0cd7 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -76,6 +76,11 @@ extern "C" { #define MAXIMUM_WAIT_OBJECTS 64 +#define APR_ASCII_BLANK '\040' +#define APR_ASCII_CR '\015' +#define APR_ASCII_LF '\012' +#define APR_ASCII_TAB '\011' + typedef int apr_signum_t; /* Finding offsets of elements within structures. diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 25d292b5922..10fbc286d7d 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -53,6 +53,7 @@ */ #include "networkio.h" +#include #if APR_HAS_SENDFILE /* This file is needed to allow us access to the apr_file_t internals. */ From 8559a1efd71340284775de3c6f2d3b6cf0400ddd Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 26 Feb 2001 12:41:51 +0000 Subject: [PATCH 1323/7878] Get the various Unix flavors (other than Linux) building again by finishing up the APR_HAVE_SYS_SENDFILE_H symbol. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61310 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 1 + network_io/unix/sendrecv.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.h.in b/include/apr.h.in index 961d914bc19..a312b54c205 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -42,6 +42,7 @@ #define APR_HAVE_SIGNAL_H @signalh@ #define APR_HAVE_STRING_H @stringh@ #define APR_HAVE_STRINGS_H @stringsh@ +#define APR_HAVE_SYS_SENDFILE_H @sys_sendfileh@ #define APR_HAVE_SYS_SIGNAL_H @sys_signalh@ #define APR_HAVE_SYS_SOCKET_H @sys_socketh@ #define APR_HAVE_SYS_SYSLIMITS_H @sys_syslimitsh@ diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 10fbc286d7d..25d292b5922 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -53,7 +53,6 @@ */ #include "networkio.h" -#include #if APR_HAS_SENDFILE /* This file is needed to allow us access to the apr_file_t internals. */ From 2d9487121ff6d31cb36616475f5c827cd59e0fd8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 26 Feb 2001 16:44:38 +0000 Subject: [PATCH 1324/7878] Fix the sendfile handling in APR. We have to subst the sys_sendfileh variable into apr.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61311 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 5323b237b56..a194017697e 100644 --- a/configure.in +++ b/configure.in @@ -451,7 +451,7 @@ AC_CHECK_HEADERS(sys/file.h) AC_CHECK_HEADERS(sys/mman.h) AC_CHECK_HEADERS(sys/resource.h) AC_CHECK_HEADERS(sys/select.h) -AC_CHECK_HEADERS(sys/sendfile.h) +AC_CHECK_HEADERS(sys/sendfile.h, sys_sendfileh="1", sys_sendfile="0") AC_CHECK_HEADERS(sys/signal.h, sys_signalh="1", sys_signalh="0") AC_CHECK_HEADERS(sys/socket.h, sys_socketh="1", sys_socketh="0") AC_CHECK_HEADERS(sys/stat.h) @@ -480,6 +480,7 @@ AC_SUBST(stdioh) AC_SUBST(stdlibh) AC_SUBST(stringh) AC_SUBST(stringsh) +AC_SUBST(sys_sendfileh) AC_SUBST(sys_signalh) AC_SUBST(sys_socketh) AC_SUBST(sys_typesh) From ccdfa86d9ec0b641c9a408ba0dad366d525f0d3e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 26 Feb 2001 16:46:55 +0000 Subject: [PATCH 1325/7878] Line things up to make them easier to read git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61312 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 54 ++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index a312b54c205..46983f2393e 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -23,34 +23,34 @@ #define APR_HAS_INLINE 1 #endif -#define APR_HAVE_ARPA_INET_H @arpa_ineth@ -#define APR_HAVE_CONIO_H @conioh@ -#define APR_HAVE_CRYPT_H @crypth@ -#define APR_HAVE_CTYPE_H @ctypeh@ -#define APR_HAVE_DIRENT_H @direnth@ -#define APR_HAVE_ERRNO_H @errnoh@ -#define APR_HAVE_FCNTL_H @fcntlh@ -#define APR_HAVE_IO_H @ioh@ -#define APR_HAVE_LIMITS_H @limitsh@ -#define APR_HAVE_NETDB_H @netdbh@ -#define APR_HAVE_NETINET_IN_H @netinet_inh@ -#define APR_HAVE_NETINET_TCP_H @netinet_tcph@ -#define APR_HAVE_PTHREAD_H @pthreadh@ -#define APR_HAVE_STDARG_H @stdargh@ -#define APR_HAVE_STDIO_H @stdioh@ -#define APR_HAVE_STDLIB_H @stdlibh@ -#define APR_HAVE_SIGNAL_H @signalh@ -#define APR_HAVE_STRING_H @stringh@ -#define APR_HAVE_STRINGS_H @stringsh@ -#define APR_HAVE_SYS_SENDFILE_H @sys_sendfileh@ -#define APR_HAVE_SYS_SIGNAL_H @sys_signalh@ -#define APR_HAVE_SYS_SOCKET_H @sys_socketh@ +#define APR_HAVE_ARPA_INET_H @arpa_ineth@ +#define APR_HAVE_CONIO_H @conioh@ +#define APR_HAVE_CRYPT_H @crypth@ +#define APR_HAVE_CTYPE_H @ctypeh@ +#define APR_HAVE_DIRENT_H @direnth@ +#define APR_HAVE_ERRNO_H @errnoh@ +#define APR_HAVE_FCNTL_H @fcntlh@ +#define APR_HAVE_IO_H @ioh@ +#define APR_HAVE_LIMITS_H @limitsh@ +#define APR_HAVE_NETDB_H @netdbh@ +#define APR_HAVE_NETINET_IN_H @netinet_inh@ +#define APR_HAVE_NETINET_TCP_H @netinet_tcph@ +#define APR_HAVE_PTHREAD_H @pthreadh@ +#define APR_HAVE_STDARG_H @stdargh@ +#define APR_HAVE_STDIO_H @stdioh@ +#define APR_HAVE_STDLIB_H @stdlibh@ +#define APR_HAVE_SIGNAL_H @signalh@ +#define APR_HAVE_STRING_H @stringh@ +#define APR_HAVE_STRINGS_H @stringsh@ +#define APR_HAVE_SYS_SENDFILE_H @sys_sendfileh@ +#define APR_HAVE_SYS_SIGNAL_H @sys_signalh@ +#define APR_HAVE_SYS_SOCKET_H @sys_socketh@ #define APR_HAVE_SYS_SYSLIMITS_H @sys_syslimitsh@ -#define APR_HAVE_SYS_TIME_H @sys_timeh@ -#define APR_HAVE_SYS_TYPES_H @sys_typesh@ -#define APR_HAVE_SYS_UIO_H @sys_uioh@ -#define APR_HAVE_SYS_WAIT_H @sys_waith@ -#define APR_HAVE_UNISTD_H @unistdh@ +#define APR_HAVE_SYS_TIME_H @sys_timeh@ +#define APR_HAVE_SYS_TYPES_H @sys_typesh@ +#define APR_HAVE_SYS_UIO_H @sys_uioh@ +#define APR_HAVE_SYS_WAIT_H @sys_waith@ +#define APR_HAVE_UNISTD_H @unistdh@ #define APR_USE_FLOCK_SERIALIZE @flockser@ #define APR_USE_SYSVSEM_SERIALIZE @sysvser@ From 690273657dbec4c1a5d85637886843ac332d9a3d Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 26 Feb 2001 19:28:57 +0000 Subject: [PATCH 1326/7878] Cleaner re-implementation of what we actually use AC_CHECK_HEADERS for... For one, we never use the multi-header capability. So APR_CHECK_HEADER makes a bit more sense. We also set the flag always to 1 or 0. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61313 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 8cddd5d130d..2a6193b430d 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -332,3 +332,17 @@ fi AC_MSG_RESULT([$msg]) ])dnl +dnl APR_CHECK_HEADER(HEADER-FILE , FLAG-TO-SET) +dnl we set FLAG-TO-SET to 1 if we find HEADER-FILE, otherwise we set to 0 +AC_DEFUN(APR_CHECK_HEADER,[ +if test "x$2" != "x"; then + s1="$2=\"1\"" + s0="$2=\"0\"" +else + s1="" + s0="" +fi +AC_CHECK_HEADERS($1, eval $s1, eval $s0) +]) + + From eef17238dcba1583b30851679dd024569a5931d8 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Mon, 26 Feb 2001 19:32:49 +0000 Subject: [PATCH 1327/7878] Make FreeBSD (which does not have sendfile.h) compile again. This typo lead to a: ../../include/arch/unix/networkio.h:108: syntax error because a #define did not resolve to 0 or 1, but to an empty string. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61314 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index a194017697e..7ab7b0ba045 100644 --- a/configure.in +++ b/configure.in @@ -451,7 +451,7 @@ AC_CHECK_HEADERS(sys/file.h) AC_CHECK_HEADERS(sys/mman.h) AC_CHECK_HEADERS(sys/resource.h) AC_CHECK_HEADERS(sys/select.h) -AC_CHECK_HEADERS(sys/sendfile.h, sys_sendfileh="1", sys_sendfile="0") +AC_CHECK_HEADERS(sys/sendfile.h, sys_sendfileh="1", sys_sendfileh="0") AC_CHECK_HEADERS(sys/signal.h, sys_signalh="1", sys_signalh="0") AC_CHECK_HEADERS(sys/socket.h, sys_socketh="1", sys_socketh="0") AC_CHECK_HEADERS(sys/stat.h) From f20743f73995e1cdf502251bb873011a0e55d4e2 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 26 Feb 2001 19:50:15 +0000 Subject: [PATCH 1328/7878] Add complementary function. Note name change since we still accept multiple headers and funcs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61315 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 2a6193b430d..8cbfc544458 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -332,7 +332,7 @@ fi AC_MSG_RESULT([$msg]) ])dnl -dnl APR_CHECK_HEADER(HEADER-FILE , FLAG-TO-SET) +dnl APR_CHECK_HEADERS(HEADER-FILE ... , FLAG-TO-SET) dnl we set FLAG-TO-SET to 1 if we find HEADER-FILE, otherwise we set to 0 AC_DEFUN(APR_CHECK_HEADER,[ if test "x$2" != "x"; then @@ -345,4 +345,17 @@ fi AC_CHECK_HEADERS($1, eval $s1, eval $s0) ]) +dnl APR_CHECK_FUNCS(FUNC ... , FLAG-TO-SET) +dnl we set FLAG-TO-SET to 1 if we find FUNC, otherwise we set to 0 +AC_DEFUN(APR_CHECK_FUNC,[ +if test "x$2" != "x"; then + s1="$2=\"1\"" + s0="$2=\"0\"" +else + s1="" + s0="" +fi +AC_CHECK_FUNCS($1, eval $s1, eval $s0) +]) + From adb34e6d292a5be5b60d15e9202b7e2fb9f39460 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 26 Feb 2001 19:56:10 +0000 Subject: [PATCH 1329/7878] Use APR_CHECK_HEADERS instead git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61316 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 118 +++++++++++++++++++++++++-------------------------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/configure.in b/configure.in index 7ab7b0ba045..4e392309c8a 100644 --- a/configure.in +++ b/configure.in @@ -402,65 +402,65 @@ APR_CHECK_SIGWAIT_ONE_ARG dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC -AC_CHECK_HEADERS(ByteOrder.h) -AC_CHECK_HEADERS(conio.h, conioh="1", conioh="0") -AC_CHECK_HEADERS(crypt.h, crypth="1", crypth="0") -AC_CHECK_HEADERS(ctype.h, ctypeh="1", ctypeh="0") -AC_CHECK_HEADERS(dir.h) -AC_CHECK_HEADERS(dirent.h, direnth="1", dirent="0") -AC_CHECK_HEADERS(errno.h, errnoh="1", errnoh="0") -AC_CHECK_HEADERS(net/errno.h) -AC_CHECK_HEADERS(fcntl.h, fcntlh="1", fcntl="0") -AC_CHECK_HEADERS(grp.h) -AC_CHECK_HEADERS(io.h, ioh="1", ioh="0") -AC_CHECK_HEADERS(limits.h, limitsh="1", limitsh="0") -AC_CHECK_HEADERS(malloc.h) -AC_CHECK_HEADERS(memory.h) -AC_CHECK_HEADERS(netdb.h, netdbh="1", netdbh="0") -AC_CHECK_HEADERS(osreldate.h) -AC_CHECK_HEADERS(process.h) -AC_CHECK_HEADERS(pwd.h) -AC_CHECK_HEADERS(sys/syslimits.h, sys_syslimitsh="1", sys_syslimitsh="0") -AC_CHECK_HEADERS(sys/sem.h) -AC_CHECK_HEADERS(signal.h, signalh="1", signalh="0") -AC_CHECK_HEADERS(stdarg.h, stdargh="1", stdargh="0") -AC_CHECK_HEADERS(stddef.h) -AC_CHECK_HEADERS(stdio.h, stdioh="1", stdioh="0") -AC_CHECK_HEADERS(stdlib.h, stdlibh="1", stdlibh="0") -AC_CHECK_HEADERS(string.h, stringh="1", stringh="0") -AC_CHECK_HEADERS(strings.h, stringsh="1", stringsh="0") -AC_CHECK_HEADERS(sysapi.h) -AC_CHECK_HEADERS(sysgtime.h) -AC_CHECK_HEADERS(termios.h) -AC_CHECK_HEADERS(time.h) -AC_CHECK_HEADERS(sys/time.h, sys_timeh="1", sys_timeh="0") -AC_CHECK_HEADERS(tpfeq.h) -AC_CHECK_HEADERS(tpfio.h) -AC_CHECK_HEADERS(sys/uio.h, sys_uioh="1", sys_uioh="0") -AC_CHECK_HEADERS(unistd.h, unistdh="1", unistdh="0") -AC_CHECK_HEADERS(poll.h) -AC_CHECK_HEADERS(sys/poll.h) -AC_CHECK_HEADERS(unix.h) -AC_CHECK_HEADERS(arpa/inet.h, arpa_ineth="1", arpa_ineth="0") -AC_CHECK_HEADERS(netinet/in.h, netinet_inh="1", netinet_inh="0") -AC_CHECK_HEADERS(netinet/tcp.h, netinet_tcph="1", netinet_tcph="0") -AC_CHECK_HEADERS(iconv.h) -AC_CHECK_HEADERS(langinfo.h) - -AC_CHECK_HEADERS(sys/file.h) -AC_CHECK_HEADERS(sys/mman.h) -AC_CHECK_HEADERS(sys/resource.h) -AC_CHECK_HEADERS(sys/select.h) -AC_CHECK_HEADERS(sys/sendfile.h, sys_sendfileh="1", sys_sendfileh="0") -AC_CHECK_HEADERS(sys/signal.h, sys_signalh="1", sys_signalh="0") -AC_CHECK_HEADERS(sys/socket.h, sys_socketh="1", sys_socketh="0") -AC_CHECK_HEADERS(sys/stat.h) -AC_CHECK_HEADERS(sys/types.h, sys_typesh="1", sys_typesh="0") -AC_CHECK_HEADERS(sys/wait.h, sys_waith="1", sys_waith="0") -AC_CHECK_HEADERS(dlfcn.h) -AC_CHECK_HEADERS(dl.h) - -AC_CHECK_HEADERS(kernel/OS.h) +APR_CHECK_HEADERS(ByteOrder.h) +APR_CHECK_HEADERS(conio.h, conioh) +APR_CHECK_HEADERS(crypt.h, crypth) +APR_CHECK_HEADERS(ctype.h, ctypeh) +APR_CHECK_HEADERS(dir.h) +APR_CHECK_HEADERS(dirent.h, direnth) +APR_CHECK_HEADERS(errno.h, errnoh) +APR_CHECK_HEADERS(net/errno.h) +APR_CHECK_HEADERS(fcntl.h, fcntlh) +APR_CHECK_HEADERS(grp.h) +APR_CHECK_HEADERS(io.h, ioh) +APR_CHECK_HEADERS(limits.h, limitsh) +APR_CHECK_HEADERS(malloc.h) +APR_CHECK_HEADERS(memory.h) +APR_CHECK_HEADERS(netdb.h, netdbh) +APR_CHECK_HEADERS(osreldate.h) +APR_CHECK_HEADERS(process.h) +APR_CHECK_HEADERS(pwd.h) +APR_CHECK_HEADERS(sys/syslimits.h, sys_syslimitsh) +APR_CHECK_HEADERS(sys/sem.h) +APR_CHECK_HEADERS(signal.h, signalh) +APR_CHECK_HEADERS(stdarg.h, stdargh) +APR_CHECK_HEADERS(stddef.h) +APR_CHECK_HEADERS(stdio.h, stdioh) +APR_CHECK_HEADERS(stdlib.h, stdlibh) +APR_CHECK_HEADERS(string.h, stringh) +APR_CHECK_HEADERS(strings.h, stringsh) +APR_CHECK_HEADERS(sysapi.h) +APR_CHECK_HEADERS(sysgtime.h) +APR_CHECK_HEADERS(termios.h) +APR_CHECK_HEADERS(time.h) +APR_CHECK_HEADERS(sys/time.h, sys_timeh) +APR_CHECK_HEADERS(tpfeq.h) +APR_CHECK_HEADERS(tpfio.h) +APR_CHECK_HEADERS(sys/uio.h, sys_uioh) +APR_CHECK_HEADERS(unistd.h, unistdh) +APR_CHECK_HEADERS(poll.h) +APR_CHECK_HEADERS(sys/poll.h) +APR_CHECK_HEADERS(unix.h) +APR_CHECK_HEADERS(arpa/inet.h, arpa_ineth) +APR_CHECK_HEADERS(netinet/in.h, netinet_inh) +APR_CHECK_HEADERS(netinet/tcp.h, netinet_tcph) +APR_CHECK_HEADERS(iconv.h) +APR_CHECK_HEADERS(langinfo.h) + +APR_CHECK_HEADERS(sys/file.h) +APR_CHECK_HEADERS(sys/mman.h) +APR_CHECK_HEADERS(sys/resource.h) +APR_CHECK_HEADERS(sys/select.h) +APR_CHECK_HEADERS(sys/sendfile.h, sys_sendfileh) +APR_CHECK_HEADERS(sys/signal.h, sys_signalh) +APR_CHECK_HEADERS(sys/socket.h, sys_socketh) +APR_CHECK_HEADERS(sys/stat.h) +APR_CHECK_HEADERS(sys/types.h, sys_typesh) +APR_CHECK_HEADERS(sys/wait.h, sys_waith) +APR_CHECK_HEADERS(dlfcn.h) +APR_CHECK_HEADERS(dl.h) + +APR_CHECK_HEADERS(kernel/OS.h) AC_SUBST(arpa_ineth) AC_SUBST(conioh) From 03280b95094c9c1e5b38731034d2715a1cb10c97 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 26 Feb 2001 20:10:29 +0000 Subject: [PATCH 1330/7878] Implement name change... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61317 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 8 +-- configure.in | 118 ++++++++++++++++++++++---------------------- 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 8cbfc544458..00f4decdfe5 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -332,9 +332,9 @@ fi AC_MSG_RESULT([$msg]) ])dnl -dnl APR_CHECK_HEADERS(HEADER-FILE ... , FLAG-TO-SET) +dnl APR_FLAG_HEADERS(HEADER-FILE ... , FLAG-TO-SET) dnl we set FLAG-TO-SET to 1 if we find HEADER-FILE, otherwise we set to 0 -AC_DEFUN(APR_CHECK_HEADER,[ +AC_DEFUN(APR_FLAG_HEADERS,[ if test "x$2" != "x"; then s1="$2=\"1\"" s0="$2=\"0\"" @@ -345,9 +345,9 @@ fi AC_CHECK_HEADERS($1, eval $s1, eval $s0) ]) -dnl APR_CHECK_FUNCS(FUNC ... , FLAG-TO-SET) +dnl APR_FLAG_FUNCS(FUNC ... , FLAG-TO-SET) dnl we set FLAG-TO-SET to 1 if we find FUNC, otherwise we set to 0 -AC_DEFUN(APR_CHECK_FUNC,[ +AC_DEFUN(APR_FLAG_FUNCS,[ if test "x$2" != "x"; then s1="$2=\"1\"" s0="$2=\"0\"" diff --git a/configure.in b/configure.in index 4e392309c8a..bbee12031a2 100644 --- a/configure.in +++ b/configure.in @@ -402,65 +402,65 @@ APR_CHECK_SIGWAIT_ONE_ARG dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC -APR_CHECK_HEADERS(ByteOrder.h) -APR_CHECK_HEADERS(conio.h, conioh) -APR_CHECK_HEADERS(crypt.h, crypth) -APR_CHECK_HEADERS(ctype.h, ctypeh) -APR_CHECK_HEADERS(dir.h) -APR_CHECK_HEADERS(dirent.h, direnth) -APR_CHECK_HEADERS(errno.h, errnoh) -APR_CHECK_HEADERS(net/errno.h) -APR_CHECK_HEADERS(fcntl.h, fcntlh) -APR_CHECK_HEADERS(grp.h) -APR_CHECK_HEADERS(io.h, ioh) -APR_CHECK_HEADERS(limits.h, limitsh) -APR_CHECK_HEADERS(malloc.h) -APR_CHECK_HEADERS(memory.h) -APR_CHECK_HEADERS(netdb.h, netdbh) -APR_CHECK_HEADERS(osreldate.h) -APR_CHECK_HEADERS(process.h) -APR_CHECK_HEADERS(pwd.h) -APR_CHECK_HEADERS(sys/syslimits.h, sys_syslimitsh) -APR_CHECK_HEADERS(sys/sem.h) -APR_CHECK_HEADERS(signal.h, signalh) -APR_CHECK_HEADERS(stdarg.h, stdargh) -APR_CHECK_HEADERS(stddef.h) -APR_CHECK_HEADERS(stdio.h, stdioh) -APR_CHECK_HEADERS(stdlib.h, stdlibh) -APR_CHECK_HEADERS(string.h, stringh) -APR_CHECK_HEADERS(strings.h, stringsh) -APR_CHECK_HEADERS(sysapi.h) -APR_CHECK_HEADERS(sysgtime.h) -APR_CHECK_HEADERS(termios.h) -APR_CHECK_HEADERS(time.h) -APR_CHECK_HEADERS(sys/time.h, sys_timeh) -APR_CHECK_HEADERS(tpfeq.h) -APR_CHECK_HEADERS(tpfio.h) -APR_CHECK_HEADERS(sys/uio.h, sys_uioh) -APR_CHECK_HEADERS(unistd.h, unistdh) -APR_CHECK_HEADERS(poll.h) -APR_CHECK_HEADERS(sys/poll.h) -APR_CHECK_HEADERS(unix.h) -APR_CHECK_HEADERS(arpa/inet.h, arpa_ineth) -APR_CHECK_HEADERS(netinet/in.h, netinet_inh) -APR_CHECK_HEADERS(netinet/tcp.h, netinet_tcph) -APR_CHECK_HEADERS(iconv.h) -APR_CHECK_HEADERS(langinfo.h) - -APR_CHECK_HEADERS(sys/file.h) -APR_CHECK_HEADERS(sys/mman.h) -APR_CHECK_HEADERS(sys/resource.h) -APR_CHECK_HEADERS(sys/select.h) -APR_CHECK_HEADERS(sys/sendfile.h, sys_sendfileh) -APR_CHECK_HEADERS(sys/signal.h, sys_signalh) -APR_CHECK_HEADERS(sys/socket.h, sys_socketh) -APR_CHECK_HEADERS(sys/stat.h) -APR_CHECK_HEADERS(sys/types.h, sys_typesh) -APR_CHECK_HEADERS(sys/wait.h, sys_waith) -APR_CHECK_HEADERS(dlfcn.h) -APR_CHECK_HEADERS(dl.h) - -APR_CHECK_HEADERS(kernel/OS.h) +APR_FLAG_HEADERS(ByteOrder.h) +APR_FLAG_HEADERS(conio.h, conioh) +APR_FLAG_HEADERS(crypt.h, crypth) +APR_FLAG_HEADERS(ctype.h, ctypeh) +APR_FLAG_HEADERS(dir.h) +APR_FLAG_HEADERS(dirent.h, direnth) +APR_FLAG_HEADERS(errno.h, errnoh) +APR_FLAG_HEADERS(net/errno.h) +APR_FLAG_HEADERS(fcntl.h, fcntlh) +APR_FLAG_HEADERS(grp.h) +APR_FLAG_HEADERS(io.h, ioh) +APR_FLAG_HEADERS(limits.h, limitsh) +APR_FLAG_HEADERS(malloc.h) +APR_FLAG_HEADERS(memory.h) +APR_FLAG_HEADERS(netdb.h, netdbh) +APR_FLAG_HEADERS(osreldate.h) +APR_FLAG_HEADERS(process.h) +APR_FLAG_HEADERS(pwd.h) +APR_FLAG_HEADERS(sys/syslimits.h, sys_syslimitsh) +APR_FLAG_HEADERS(sys/sem.h) +APR_FLAG_HEADERS(signal.h, signalh) +APR_FLAG_HEADERS(stdarg.h, stdargh) +APR_FLAG_HEADERS(stddef.h) +APR_FLAG_HEADERS(stdio.h, stdioh) +APR_FLAG_HEADERS(stdlib.h, stdlibh) +APR_FLAG_HEADERS(string.h, stringh) +APR_FLAG_HEADERS(strings.h, stringsh) +APR_FLAG_HEADERS(sysapi.h) +APR_FLAG_HEADERS(sysgtime.h) +APR_FLAG_HEADERS(termios.h) +APR_FLAG_HEADERS(time.h) +APR_FLAG_HEADERS(sys/time.h, sys_timeh) +APR_FLAG_HEADERS(tpfeq.h) +APR_FLAG_HEADERS(tpfio.h) +APR_FLAG_HEADERS(sys/uio.h, sys_uioh) +APR_FLAG_HEADERS(unistd.h, unistdh) +APR_FLAG_HEADERS(poll.h) +APR_FLAG_HEADERS(sys/poll.h) +APR_FLAG_HEADERS(unix.h) +APR_FLAG_HEADERS(arpa/inet.h, arpa_ineth) +APR_FLAG_HEADERS(netinet/in.h, netinet_inh) +APR_FLAG_HEADERS(netinet/tcp.h, netinet_tcph) +APR_FLAG_HEADERS(iconv.h) +APR_FLAG_HEADERS(langinfo.h) + +APR_FLAG_HEADERS(sys/file.h) +APR_FLAG_HEADERS(sys/mman.h) +APR_FLAG_HEADERS(sys/resource.h) +APR_FLAG_HEADERS(sys/select.h) +APR_FLAG_HEADERS(sys/sendfile.h, sys_sendfileh) +APR_FLAG_HEADERS(sys/signal.h, sys_signalh) +APR_FLAG_HEADERS(sys/socket.h, sys_socketh) +APR_FLAG_HEADERS(sys/stat.h) +APR_FLAG_HEADERS(sys/types.h, sys_typesh) +APR_FLAG_HEADERS(sys/wait.h, sys_waith) +APR_FLAG_HEADERS(dlfcn.h) +APR_FLAG_HEADERS(dl.h) + +APR_FLAG_HEADERS(kernel/OS.h) AC_SUBST(arpa_ineth) AC_SUBST(conioh) From 7f1ab706b3fdb83ed1b1eb37d503d73e0c5a47c1 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 26 Feb 2001 23:31:11 +0000 Subject: [PATCH 1331/7878] Backwards compatible new version of APR_FLAG_* functions... Now will automagically determine flag names if required and can even set to yes/no in addition to 1/0 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61318 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 64 +++++++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 00f4decdfe5..545ab955277 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -332,30 +332,56 @@ fi AC_MSG_RESULT([$msg]) ])dnl -dnl APR_FLAG_HEADERS(HEADER-FILE ... , FLAG-TO-SET) +dnl APR_FLAG_HEADERS(HEADER-FILE ... [, FLAG-TO-SET ] [, "yes" ]) dnl we set FLAG-TO-SET to 1 if we find HEADER-FILE, otherwise we set to 0 +dnl if FLAG-TO-SET is null, we automagically determine it's name +dnl by changing all "/" to "_" in the HEADER-FILE and dropping +dnl all "." chars. If the 3rd parameter is "yes" then instead of +dnl setting to 1 or 0, we set FLAG-TO-SET to yes or no. +dnl AC_DEFUN(APR_FLAG_HEADERS,[ -if test "x$2" != "x"; then - s1="$2=\"1\"" - s0="$2=\"0\"" -else - s1="" - s0="" -fi -AC_CHECK_HEADERS($1, eval $s1, eval $s0) +for aprt_i in $1 +do + if test "x$2" = "x"; then + aprt_fts="`echo $aprt_i | sed -e 's%/%_%g' -e 's/\.//g'`" + else + aprt_fts="$2" + fi + if test "x$3" = "xyes"; then + s1="$aprt_fts=\"yes\"" + s0="$aprt_fts=\"no\"" + else + s1="$aprt_fts=\"1\"" + s0="$aprt_fts=\"0\"" + fi + AC_CHECK_HEADERS($aprt_i, eval $s1, eval $s0) +done ]) -dnl APR_FLAG_FUNCS(FUNC ... , FLAG-TO-SET) -dnl we set FLAG-TO-SET to 1 if we find FUNC, otherwise we set to 0 +dnl APR_FLAG_FUNCS(FUNC ... [, FLAG-TO-SET] [, "yes" ]) +dnl if FLAG-TO-SET is null, we automagically determine it's name +dnl prepending "have_" to the function name in FUNC, otherwise +dnl we use what's provided as FLAG-TO-SET. If the 3rd parameter +dnl is "yes" then instead of setting to 1 or 0, we set FLAG-TO-SET +dnl to yes or no. +dnl AC_DEFUN(APR_FLAG_FUNCS,[ -if test "x$2" != "x"; then - s1="$2=\"1\"" - s0="$2=\"0\"" -else - s1="" - s0="" -fi -AC_CHECK_FUNCS($1, eval $s1, eval $s0) +for aprt_i in $1 +do + if test "x$2" = "x"; then + aprt_fts="have_$aprt_i" + else + aprt_fts="$2" + fi + if test "x$3" = "xyes"; then + s1="$aprt_fts=\"yes\"" + s0="$aprt_fts=\"no\"" + else + s1="$aprt_fts=\"1\"" + s0="$aprt_fts=\"0\"" + fi + AC_CHECK_FUNCS($aprt_i, eval $s1, eval $s0) +done ]) From 7e3030dc37d3119d16df676c3f13e325219d1930 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 26 Feb 2001 23:34:44 +0000 Subject: [PATCH 1332/7878] No need to specify the flags, we use the standard naming git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61319 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 54 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/configure.in b/configure.in index bbee12031a2..2bcdcceff76 100644 --- a/configure.in +++ b/configure.in @@ -403,47 +403,47 @@ dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC APR_FLAG_HEADERS(ByteOrder.h) -APR_FLAG_HEADERS(conio.h, conioh) -APR_FLAG_HEADERS(crypt.h, crypth) -APR_FLAG_HEADERS(ctype.h, ctypeh) +APR_FLAG_HEADERS(conio.h) +APR_FLAG_HEADERS(crypt.h) +APR_FLAG_HEADERS(ctype.h) APR_FLAG_HEADERS(dir.h) -APR_FLAG_HEADERS(dirent.h, direnth) -APR_FLAG_HEADERS(errno.h, errnoh) +APR_FLAG_HEADERS(dirent.h) +APR_FLAG_HEADERS(errno.h) APR_FLAG_HEADERS(net/errno.h) -APR_FLAG_HEADERS(fcntl.h, fcntlh) +APR_FLAG_HEADERS(fcntl.h) APR_FLAG_HEADERS(grp.h) -APR_FLAG_HEADERS(io.h, ioh) -APR_FLAG_HEADERS(limits.h, limitsh) +APR_FLAG_HEADERS(io.h) +APR_FLAG_HEADERS(limits.h) APR_FLAG_HEADERS(malloc.h) APR_FLAG_HEADERS(memory.h) -APR_FLAG_HEADERS(netdb.h, netdbh) +APR_FLAG_HEADERS(netdb.h) APR_FLAG_HEADERS(osreldate.h) APR_FLAG_HEADERS(process.h) APR_FLAG_HEADERS(pwd.h) -APR_FLAG_HEADERS(sys/syslimits.h, sys_syslimitsh) +APR_FLAG_HEADERS(sys/syslimits.h) APR_FLAG_HEADERS(sys/sem.h) -APR_FLAG_HEADERS(signal.h, signalh) -APR_FLAG_HEADERS(stdarg.h, stdargh) +APR_FLAG_HEADERS(signal.h) +APR_FLAG_HEADERS(stdarg.h) APR_FLAG_HEADERS(stddef.h) -APR_FLAG_HEADERS(stdio.h, stdioh) -APR_FLAG_HEADERS(stdlib.h, stdlibh) -APR_FLAG_HEADERS(string.h, stringh) -APR_FLAG_HEADERS(strings.h, stringsh) +APR_FLAG_HEADERS(stdio.h) +APR_FLAG_HEADERS(stdlib.h) +APR_FLAG_HEADERS(string.h) +APR_FLAG_HEADERS(strings.h) APR_FLAG_HEADERS(sysapi.h) APR_FLAG_HEADERS(sysgtime.h) APR_FLAG_HEADERS(termios.h) APR_FLAG_HEADERS(time.h) -APR_FLAG_HEADERS(sys/time.h, sys_timeh) +APR_FLAG_HEADERS(sys/time.h) APR_FLAG_HEADERS(tpfeq.h) APR_FLAG_HEADERS(tpfio.h) -APR_FLAG_HEADERS(sys/uio.h, sys_uioh) -APR_FLAG_HEADERS(unistd.h, unistdh) +APR_FLAG_HEADERS(sys/uio.h) +APR_FLAG_HEADERS(unistd.h) APR_FLAG_HEADERS(poll.h) APR_FLAG_HEADERS(sys/poll.h) APR_FLAG_HEADERS(unix.h) -APR_FLAG_HEADERS(arpa/inet.h, arpa_ineth) -APR_FLAG_HEADERS(netinet/in.h, netinet_inh) -APR_FLAG_HEADERS(netinet/tcp.h, netinet_tcph) +APR_FLAG_HEADERS(arpa/inet.h) +APR_FLAG_HEADERS(netinet/in.h) +APR_FLAG_HEADERS(netinet/tcp.h) APR_FLAG_HEADERS(iconv.h) APR_FLAG_HEADERS(langinfo.h) @@ -451,12 +451,12 @@ APR_FLAG_HEADERS(sys/file.h) APR_FLAG_HEADERS(sys/mman.h) APR_FLAG_HEADERS(sys/resource.h) APR_FLAG_HEADERS(sys/select.h) -APR_FLAG_HEADERS(sys/sendfile.h, sys_sendfileh) -APR_FLAG_HEADERS(sys/signal.h, sys_signalh) -APR_FLAG_HEADERS(sys/socket.h, sys_socketh) +APR_FLAG_HEADERS(sys/sendfile.h) +APR_FLAG_HEADERS(sys/signal.h) +APR_FLAG_HEADERS(sys/socket.h) APR_FLAG_HEADERS(sys/stat.h) -APR_FLAG_HEADERS(sys/types.h, sys_typesh) -APR_FLAG_HEADERS(sys/wait.h, sys_waith) +APR_FLAG_HEADERS(sys/types.h) +APR_FLAG_HEADERS(sys/wait.h) APR_FLAG_HEADERS(dlfcn.h) APR_FLAG_HEADERS(dl.h) From 32f2b8722f9df695c91a3a6a6c5ed18e74b4c9b5 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Tue, 27 Feb 2001 03:51:02 +0000 Subject: [PATCH 1333/7878] AC_CHECK_HEADERS() must be used with M4 arguments, not shell arguments. Pass $1 (an M4 arg containing the names of the headers) to AC_CHECK_HEADERS. Then check the resulting cache variables to set the APR test result variables. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61320 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 545ab955277..962acb4bda2 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -340,6 +340,7 @@ dnl all "." chars. If the 3rd parameter is "yes" then instead of dnl setting to 1 or 0, we set FLAG-TO-SET to yes or no. dnl AC_DEFUN(APR_FLAG_HEADERS,[ +AC_CHECK_HEADERS($1) for aprt_i in $1 do if test "x$2" = "x"; then @@ -347,14 +348,13 @@ do else aprt_fts="$2" fi - if test "x$3" = "xyes"; then - s1="$aprt_fts=\"yes\"" - s0="$aprt_fts=\"no\"" + safe_name=`echo "$aprt_i" | sed 'y%./+-%__p_%'` + eval "cache_value=\$ac_cv_header_$safe_name" + if test "$cache_value" = "yes"; then + eval $aprt_fts=ifelse($3,yes,yes,1) else - s1="$aprt_fts=\"1\"" - s0="$aprt_fts=\"0\"" + eval $aprt_fts=ifelse($3,yes,no,0) fi - AC_CHECK_HEADERS($aprt_i, eval $s1, eval $s0) done ]) From f8bfa582b592f860035b730cf92b6261a51abff5 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Tue, 27 Feb 2001 11:09:43 +0000 Subject: [PATCH 1334/7878] Use some deep M4 magic to remove two "echo | sed" subshell operations per header file tested (plus a couple shell "eval" statements). We now use M4's translit() to create cache and APR variable names (rather than invoking sed). For the loop over the headers, we use a magical tail-recursive M4 macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61321 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 48 +++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 962acb4bda2..eb221e6462f 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -332,6 +332,30 @@ fi AC_MSG_RESULT([$msg]) ])dnl + +dnl the following is a newline, a space, and a tab. don't reindent! +define([newline_space_tab],[ + ]) + +dnl +dnl APR_COMMA_ARGS(ARG1 ...) +dnl convert the whitespace-separated arguments into comman-separated +dnl arguments. +dnl +dnl APR_FOREACH(CODE-BLOCK, ARG1, ARG2, ...) +dnl subsitute CODE-BLOCK for each ARG[i]. "eachval" will be set to ARG[i] +dnl within each iteration. +dnl +changequote({,}) +define({APR_COMMA_ARGS},{patsubst([$}{1],[[}newline_space_tab{]+],[,])}) +define({APR_FOREACH}, + {ifelse($}{2,,, + [define([eachval], + $}{2)$}{1[]APR_FOREACH([$}{1], + builtin([shift], + builtin([shift], $}{@)))])}) +changequote([,]) + dnl APR_FLAG_HEADERS(HEADER-FILE ... [, FLAG-TO-SET ] [, "yes" ]) dnl we set FLAG-TO-SET to 1 if we find HEADER-FILE, otherwise we set to 0 dnl if FLAG-TO-SET is null, we automagically determine it's name @@ -341,21 +365,15 @@ dnl setting to 1 or 0, we set FLAG-TO-SET to yes or no. dnl AC_DEFUN(APR_FLAG_HEADERS,[ AC_CHECK_HEADERS($1) -for aprt_i in $1 -do - if test "x$2" = "x"; then - aprt_fts="`echo $aprt_i | sed -e 's%/%_%g' -e 's/\.//g'`" - else - aprt_fts="$2" - fi - safe_name=`echo "$aprt_i" | sed 'y%./+-%__p_%'` - eval "cache_value=\$ac_cv_header_$safe_name" - if test "$cache_value" = "yes"; then - eval $aprt_fts=ifelse($3,yes,yes,1) - else - eval $aprt_fts=ifelse($3,yes,no,0) - fi -done +APR_FOREACH([ +[if test "$ac_cv_header_]translit(eachval,[./+-],[__p_])" = "yes"; then +dnl note: this translit() maps "/" to "_" and omits ".". the third arg +dnl really *is* intended to be one shorter than the second arg. + ifelse($2,,translit(eachval,[/.],[_]),$2)=ifelse($3,yes,yes,1) +else + ifelse($2,,translit(eachval,[/.],[_]),$2)=ifelse($3,yes,no,0) +fi +], APR_COMMA_ARGS($1)) ]) dnl APR_FLAG_FUNCS(FUNC ... [, FLAG-TO-SET] [, "yes" ]) From 75ebe2c6c8cab6871f1191b58d1ce2937de02324 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Tue, 27 Feb 2001 11:34:49 +0000 Subject: [PATCH 1335/7878] * configure.in: just call APR_FLAG_HEADERS once. This allows autoconf to loop over the values *once* rather than substituting N loops for header checking. This drops configure's size from 340k down to 255k. (!!!) * apr_common.m4: M4 sees the shell's backslash, so treat it as whitespace in APR_COMMA_ARGS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61322 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 11 ++-- configure.in | 122 +++++++++++++++++++++++--------------------- 2 files changed, 70 insertions(+), 63 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index eb221e6462f..f5d50e71a08 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -333,9 +333,12 @@ AC_MSG_RESULT([$msg]) ])dnl -dnl the following is a newline, a space, and a tab. don't reindent! -define([newline_space_tab],[ - ]) +dnl the following is a newline, a space, a tab, and a backslash (the +dnl backslash is used by the shell to skip newlines, but m4 sees it; +dnl treat it like whitespace). +dnl WARNING: don't reindent these lines, or the space/tab will be lost! +define([apr_whitespace],[ + \]) dnl dnl APR_COMMA_ARGS(ARG1 ...) @@ -347,7 +350,7 @@ dnl subsitute CODE-BLOCK for each ARG[i]. "eachval" will be set to ARG[i] dnl within each iteration. dnl changequote({,}) -define({APR_COMMA_ARGS},{patsubst([$}{1],[[}newline_space_tab{]+],[,])}) +define({APR_COMMA_ARGS},{patsubst([$}{1],[[}apr_whitespace{]+],[,])}) define({APR_FOREACH}, {ifelse($}{2,,, [define([eachval], diff --git a/configure.in b/configure.in index 2bcdcceff76..15243954f6b 100644 --- a/configure.in +++ b/configure.in @@ -402,65 +402,69 @@ APR_CHECK_SIGWAIT_ONE_ARG dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC -APR_FLAG_HEADERS(ByteOrder.h) -APR_FLAG_HEADERS(conio.h) -APR_FLAG_HEADERS(crypt.h) -APR_FLAG_HEADERS(ctype.h) -APR_FLAG_HEADERS(dir.h) -APR_FLAG_HEADERS(dirent.h) -APR_FLAG_HEADERS(errno.h) -APR_FLAG_HEADERS(net/errno.h) -APR_FLAG_HEADERS(fcntl.h) -APR_FLAG_HEADERS(grp.h) -APR_FLAG_HEADERS(io.h) -APR_FLAG_HEADERS(limits.h) -APR_FLAG_HEADERS(malloc.h) -APR_FLAG_HEADERS(memory.h) -APR_FLAG_HEADERS(netdb.h) -APR_FLAG_HEADERS(osreldate.h) -APR_FLAG_HEADERS(process.h) -APR_FLAG_HEADERS(pwd.h) -APR_FLAG_HEADERS(sys/syslimits.h) -APR_FLAG_HEADERS(sys/sem.h) -APR_FLAG_HEADERS(signal.h) -APR_FLAG_HEADERS(stdarg.h) -APR_FLAG_HEADERS(stddef.h) -APR_FLAG_HEADERS(stdio.h) -APR_FLAG_HEADERS(stdlib.h) -APR_FLAG_HEADERS(string.h) -APR_FLAG_HEADERS(strings.h) -APR_FLAG_HEADERS(sysapi.h) -APR_FLAG_HEADERS(sysgtime.h) -APR_FLAG_HEADERS(termios.h) -APR_FLAG_HEADERS(time.h) -APR_FLAG_HEADERS(sys/time.h) -APR_FLAG_HEADERS(tpfeq.h) -APR_FLAG_HEADERS(tpfio.h) -APR_FLAG_HEADERS(sys/uio.h) -APR_FLAG_HEADERS(unistd.h) -APR_FLAG_HEADERS(poll.h) -APR_FLAG_HEADERS(sys/poll.h) -APR_FLAG_HEADERS(unix.h) -APR_FLAG_HEADERS(arpa/inet.h) -APR_FLAG_HEADERS(netinet/in.h) -APR_FLAG_HEADERS(netinet/tcp.h) -APR_FLAG_HEADERS(iconv.h) -APR_FLAG_HEADERS(langinfo.h) - -APR_FLAG_HEADERS(sys/file.h) -APR_FLAG_HEADERS(sys/mman.h) -APR_FLAG_HEADERS(sys/resource.h) -APR_FLAG_HEADERS(sys/select.h) -APR_FLAG_HEADERS(sys/sendfile.h) -APR_FLAG_HEADERS(sys/signal.h) -APR_FLAG_HEADERS(sys/socket.h) -APR_FLAG_HEADERS(sys/stat.h) -APR_FLAG_HEADERS(sys/types.h) -APR_FLAG_HEADERS(sys/wait.h) -APR_FLAG_HEADERS(dlfcn.h) -APR_FLAG_HEADERS(dl.h) - -APR_FLAG_HEADERS(kernel/OS.h) +APR_FLAG_HEADERS( + ByteOrder.h \ + conio.h \ + crypt.h \ + ctype.h \ + dir.h \ + dirent.h \ + dl.h \ + dlfcn.h \ + errno.h \ + fcntl.h \ + grp.h \ + iconv.h \ + io.h \ + langinfo.h \ + limits.h \ + malloc.h \ + memory.h \ + netdb.h \ + osreldate.h \ + poll.h \ + process.h \ + pwd.h \ + signal.h \ + stdarg.h \ + stddef.h \ + stdio.h \ + stdlib.h \ + string.h \ + strings.h \ + sysapi.h \ + sysgtime.h \ + termios.h \ + time.h \ + tpfeq.h \ + tpfio.h \ + unistd.h \ + unix.h \ + \ + arpa/inet.h \ + \ + kernel/OS.h \ + \ + net/errno.h \ + \ + netinet/in.h \ + netinet/tcp.h \ + \ + sys/file.h \ + sys/mman.h \ + sys/poll.h \ + sys/resource.h \ + sys/select.h \ + sys/sem.h \ + sys/sendfile.h \ + sys/signal.h \ + sys/socket.h \ + sys/stat.h \ + sys/syslimits.h \ + sys/time.h \ + sys/types.h \ + sys/uio.h \ + sys/wait.h) AC_SUBST(arpa_ineth) AC_SUBST(conioh) From 7f6ec8de70ae22c2aa279fefa668a4ceb047b8a5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 27 Feb 2001 13:09:25 +0000 Subject: [PATCH 1336/7878] Get APR to build on Tru64 again. 1) Move sendfile-disable logic to a point after we set the sendfile shell variable. It was broken before, from Sunday when I moved the thread configuration to a point earlier in the APR configure procedure. 2) (!!!!!!!!!DEFINITELY FIXME!!!!!!!) Work around a problem with APR_FLAG_HEADERS on Tru64 by adding additional, separate invocations of APR_FLAG_HEADERS() for header files which were not handled properly. 3) (!!!!!!WOULD BE NICE TO AUTODETECT!!!!!!!) Work around a problem where the presence of sigwait() isn't detected. sigwait() is renamed in a system header file, but the normal autoconf way to detect functions has no provision for including header files. Also, some empty lines in the invocation of APR_FLAG_HEADERS were removed. They had to impact on processing, but they didn't look nice. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61323 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 71 ++++++++++++++++++++++----------------- threadproc/unix/signals.c | 2 +- 2 files changed, 42 insertions(+), 31 deletions(-) diff --git a/configure.in b/configure.in index 15243954f6b..fdb79b082b8 100644 --- a/configure.in +++ b/configure.in @@ -222,35 +222,16 @@ else fi AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ]) - -AC_SUBST(threads) -AC_SUBST(have_sigwait) - -dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a -dnl threaded poll() and we don't want to use sendfile on early FreeBSD -dnl systems if we are also using threads. - -orig_sendfile=$sendfile +dnl AC_CHECK_FUNCS doesn't work for this on Tru64 since the function +dnl is renamed in signal.h. Todo: Autodetect case "$OS" in - *freebsd*) - if test $os_version -le "410"; then - if test "$threads" = "1"; then - sendfile="0" - fi - fi - ;; *alpha*-dec-osf* ) - sendfile="0" + have_sigwait="1" ;; - s390-*-linux-gnu) - sendfile="0" - ;; -esac -if test "$orig_sendfile" != "$sendfile"; then - echo "sendfile support disabled to avoid system problem" -fi -AC_SUBST(sendfile) +esac +AC_SUBST(threads) +AC_SUBST(have_sigwait) AC_CHECK_FUNCS(poll) @@ -365,6 +346,31 @@ AC_CHECK_FUNCS(writev) sendfile="0" AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ]) +dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a +dnl threaded poll() and we don't want to use sendfile on early FreeBSD +dnl systems if we are also using threads. + +orig_sendfile=$sendfile +case "$OS" in + *freebsd*) + if test $os_version -le "410"; then + if test "$threads" = "1"; then + sendfile="0" + fi + fi + ;; + *alpha*-dec-osf* ) + sendfile="0" + ;; + s390-*-linux-gnu) + sendfile="0" + ;; +esac +if test "$orig_sendfile" != "$sendfile"; then + echo "sendfile support disabled to avoid system problem" +fi +AC_SUBST(sendfile) + AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) AC_DECL_SYS_SIGLIST @@ -440,16 +446,11 @@ APR_FLAG_HEADERS( tpfio.h \ unistd.h \ unix.h \ - \ arpa/inet.h \ - \ kernel/OS.h \ - \ net/errno.h \ - \ netinet/in.h \ netinet/tcp.h \ - \ sys/file.h \ sys/mman.h \ sys/poll.h \ @@ -466,6 +467,16 @@ APR_FLAG_HEADERS( sys/uio.h \ sys/wait.h) +dnl work around unexplained problem on Tru64 where +dnl the above invocation says it finds the header but +dnl APR_HAVE_foo_H is 0 +APR_FLAG_HEADERS(stdio.h) +APR_FLAG_HEADERS(errno.h) +APR_FLAG_HEADERS(crypt.h) +APR_FLAG_HEADERS(ctype.h) +APR_FLAG_HEADERS(fcntl.h) +APR_FLAG_HEADERS(netdb.h) + AC_SUBST(arpa_ineth) AC_SUBST(conioh) AC_SUBST(ctypeh) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 335fe66242f..2c27f4ace64 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -267,7 +267,7 @@ const char *apr_signal_get_description(int signum) #endif /* SYS_SIGLIST_DECLARED */ -#if APR_HAS_THREADS && !defined(OS2) && defined(HAVE_SIGWAIT) +#if APR_HAS_THREADS && !defined(OS2) && APR_HAVE_SIGWAIT static void *signal_thread_func(void *signal_handler) { sigset_t sig_mask; From cfbcdb30317fb7d38cc21d4da8758c803287f842 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 27 Feb 2001 15:24:26 +0000 Subject: [PATCH 1337/7878] revert back to old way until we figure out an autoheader work-around. Allow building again git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61324 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 127 ++++++++++++++++++++++++--------------------------- 1 file changed, 59 insertions(+), 68 deletions(-) diff --git a/configure.in b/configure.in index fdb79b082b8..978e7667845 100644 --- a/configure.in +++ b/configure.in @@ -408,74 +408,65 @@ APR_CHECK_SIGWAIT_ONE_ARG dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC -APR_FLAG_HEADERS( - ByteOrder.h \ - conio.h \ - crypt.h \ - ctype.h \ - dir.h \ - dirent.h \ - dl.h \ - dlfcn.h \ - errno.h \ - fcntl.h \ - grp.h \ - iconv.h \ - io.h \ - langinfo.h \ - limits.h \ - malloc.h \ - memory.h \ - netdb.h \ - osreldate.h \ - poll.h \ - process.h \ - pwd.h \ - signal.h \ - stdarg.h \ - stddef.h \ - stdio.h \ - stdlib.h \ - string.h \ - strings.h \ - sysapi.h \ - sysgtime.h \ - termios.h \ - time.h \ - tpfeq.h \ - tpfio.h \ - unistd.h \ - unix.h \ - arpa/inet.h \ - kernel/OS.h \ - net/errno.h \ - netinet/in.h \ - netinet/tcp.h \ - sys/file.h \ - sys/mman.h \ - sys/poll.h \ - sys/resource.h \ - sys/select.h \ - sys/sem.h \ - sys/sendfile.h \ - sys/signal.h \ - sys/socket.h \ - sys/stat.h \ - sys/syslimits.h \ - sys/time.h \ - sys/types.h \ - sys/uio.h \ - sys/wait.h) - -dnl work around unexplained problem on Tru64 where -dnl the above invocation says it finds the header but -dnl APR_HAVE_foo_H is 0 -APR_FLAG_HEADERS(stdio.h) -APR_FLAG_HEADERS(errno.h) -APR_FLAG_HEADERS(crypt.h) -APR_FLAG_HEADERS(ctype.h) -APR_FLAG_HEADERS(fcntl.h) -APR_FLAG_HEADERS(netdb.h) +AC_CHECK_HEADERS(ByteOrder.h) +AC_CHECK_HEADERS(conio.h, conioh="1", conioh="0") +AC_CHECK_HEADERS(crypt.h, crypth="1", crypth="0") +AC_CHECK_HEADERS(ctype.h, ctypeh="1", ctypeh="0") +AC_CHECK_HEADERS(dir.h) +AC_CHECK_HEADERS(dirent.h, direnth="1", dirent="0") +AC_CHECK_HEADERS(errno.h, errnoh="1", errnoh="0") +AC_CHECK_HEADERS(net/errno.h) +AC_CHECK_HEADERS(fcntl.h, fcntlh="1", fcntl="0") +AC_CHECK_HEADERS(grp.h) +AC_CHECK_HEADERS(io.h, ioh="1", ioh="0") +AC_CHECK_HEADERS(limits.h, limitsh="1", limitsh="0") +AC_CHECK_HEADERS(malloc.h) +AC_CHECK_HEADERS(memory.h) +AC_CHECK_HEADERS(netdb.h, netdbh="1", netdbh="0") +AC_CHECK_HEADERS(osreldate.h) +AC_CHECK_HEADERS(process.h) +AC_CHECK_HEADERS(pwd.h) +AC_CHECK_HEADERS(sys/syslimits.h, sys_syslimitsh="1", sys_syslimitsh="0") +AC_CHECK_HEADERS(sys/sem.h) +AC_CHECK_HEADERS(signal.h, signalh="1", signalh="0") +AC_CHECK_HEADERS(stdarg.h, stdargh="1", stdargh="0") +AC_CHECK_HEADERS(stddef.h) +AC_CHECK_HEADERS(stdio.h, stdioh="1", stdioh="0") +AC_CHECK_HEADERS(stdlib.h, stdlibh="1", stdlibh="0") +AC_CHECK_HEADERS(string.h, stringh="1", stringh="0") +AC_CHECK_HEADERS(strings.h, stringsh="1", stringsh="0") +AC_CHECK_HEADERS(sysapi.h) +AC_CHECK_HEADERS(sysgtime.h) +AC_CHECK_HEADERS(termios.h) +AC_CHECK_HEADERS(time.h) +AC_CHECK_HEADERS(sys/time.h, sys_timeh="1", sys_timeh="0") +AC_CHECK_HEADERS(tpfeq.h) +AC_CHECK_HEADERS(tpfio.h) +AC_CHECK_HEADERS(sys/uio.h, sys_uioh="1", sys_uioh="0") +AC_CHECK_HEADERS(unistd.h, unistdh="1", unistdh="0") +AC_CHECK_HEADERS(poll.h) +AC_CHECK_HEADERS(sys/poll.h) +AC_CHECK_HEADERS(unix.h) +AC_CHECK_HEADERS(arpa/inet.h, arpa_ineth="1", arpa_ineth="0") +AC_CHECK_HEADERS(netinet/in.h, netinet_inh="1", netinet_inh="0") +AC_CHECK_HEADERS(netinet/tcp.h, netinet_tcph="1", netinet_tcph="0") +AC_CHECK_HEADERS(iconv.h) +AC_CHECK_HEADERS(langinfo.h) + +AC_CHECK_HEADERS(sys/file.h) +AC_CHECK_HEADERS(sys/mman.h) +AC_CHECK_HEADERS(sys/resource.h) +AC_CHECK_HEADERS(sys/select.h) +AC_CHECK_HEADERS(sys/sendfile.h, sys_sendfileh="1", sys_sendfileh="0") +AC_CHECK_HEADERS(sys/signal.h, sys_signalh="1", sys_signalh="0") +AC_CHECK_HEADERS(sys/socket.h, sys_socketh="1", sys_socketh="0") +AC_CHECK_HEADERS(sys/stat.h) +AC_CHECK_HEADERS(sys/types.h, sys_typesh="1", sys_typesh="0") +AC_CHECK_HEADERS(sys/wait.h, sys_waith="1", sys_waith="0") +AC_CHECK_HEADERS(dlfcn.h) +AC_CHECK_HEADERS(dl.h) + +AC_CHECK_HEADERS(kernel/OS.h) AC_SUBST(arpa_ineth) AC_SUBST(conioh) From 61ab273fa271942d2f1aeb942b57a5d3f74c8390 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 27 Feb 2001 16:58:29 +0000 Subject: [PATCH 1338/7878] Back to using APR_FLAG_HEADERS... note that this may require GNUm4 on FreeBSD systems git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61325 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 127 +++++++++++++++++++++++++++------------------------ 1 file changed, 68 insertions(+), 59 deletions(-) diff --git a/configure.in b/configure.in index 978e7667845..fdb79b082b8 100644 --- a/configure.in +++ b/configure.in @@ -408,65 +408,74 @@ APR_CHECK_SIGWAIT_ONE_ARG dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC -AC_CHECK_HEADERS(ByteOrder.h) -AC_CHECK_HEADERS(conio.h, conioh="1", conioh="0") -AC_CHECK_HEADERS(crypt.h, crypth="1", crypth="0") -AC_CHECK_HEADERS(ctype.h, ctypeh="1", ctypeh="0") -AC_CHECK_HEADERS(dir.h) -AC_CHECK_HEADERS(dirent.h, direnth="1", dirent="0") -AC_CHECK_HEADERS(errno.h, errnoh="1", errnoh="0") -AC_CHECK_HEADERS(net/errno.h) -AC_CHECK_HEADERS(fcntl.h, fcntlh="1", fcntl="0") -AC_CHECK_HEADERS(grp.h) -AC_CHECK_HEADERS(io.h, ioh="1", ioh="0") -AC_CHECK_HEADERS(limits.h, limitsh="1", limitsh="0") -AC_CHECK_HEADERS(malloc.h) -AC_CHECK_HEADERS(memory.h) -AC_CHECK_HEADERS(netdb.h, netdbh="1", netdbh="0") -AC_CHECK_HEADERS(osreldate.h) -AC_CHECK_HEADERS(process.h) -AC_CHECK_HEADERS(pwd.h) -AC_CHECK_HEADERS(sys/syslimits.h, sys_syslimitsh="1", sys_syslimitsh="0") -AC_CHECK_HEADERS(sys/sem.h) -AC_CHECK_HEADERS(signal.h, signalh="1", signalh="0") -AC_CHECK_HEADERS(stdarg.h, stdargh="1", stdargh="0") -AC_CHECK_HEADERS(stddef.h) -AC_CHECK_HEADERS(stdio.h, stdioh="1", stdioh="0") -AC_CHECK_HEADERS(stdlib.h, stdlibh="1", stdlibh="0") -AC_CHECK_HEADERS(string.h, stringh="1", stringh="0") -AC_CHECK_HEADERS(strings.h, stringsh="1", stringsh="0") -AC_CHECK_HEADERS(sysapi.h) -AC_CHECK_HEADERS(sysgtime.h) -AC_CHECK_HEADERS(termios.h) -AC_CHECK_HEADERS(time.h) -AC_CHECK_HEADERS(sys/time.h, sys_timeh="1", sys_timeh="0") -AC_CHECK_HEADERS(tpfeq.h) -AC_CHECK_HEADERS(tpfio.h) -AC_CHECK_HEADERS(sys/uio.h, sys_uioh="1", sys_uioh="0") -AC_CHECK_HEADERS(unistd.h, unistdh="1", unistdh="0") -AC_CHECK_HEADERS(poll.h) -AC_CHECK_HEADERS(sys/poll.h) -AC_CHECK_HEADERS(unix.h) -AC_CHECK_HEADERS(arpa/inet.h, arpa_ineth="1", arpa_ineth="0") -AC_CHECK_HEADERS(netinet/in.h, netinet_inh="1", netinet_inh="0") -AC_CHECK_HEADERS(netinet/tcp.h, netinet_tcph="1", netinet_tcph="0") -AC_CHECK_HEADERS(iconv.h) -AC_CHECK_HEADERS(langinfo.h) - -AC_CHECK_HEADERS(sys/file.h) -AC_CHECK_HEADERS(sys/mman.h) -AC_CHECK_HEADERS(sys/resource.h) -AC_CHECK_HEADERS(sys/select.h) -AC_CHECK_HEADERS(sys/sendfile.h, sys_sendfileh="1", sys_sendfileh="0") -AC_CHECK_HEADERS(sys/signal.h, sys_signalh="1", sys_signalh="0") -AC_CHECK_HEADERS(sys/socket.h, sys_socketh="1", sys_socketh="0") -AC_CHECK_HEADERS(sys/stat.h) -AC_CHECK_HEADERS(sys/types.h, sys_typesh="1", sys_typesh="0") -AC_CHECK_HEADERS(sys/wait.h, sys_waith="1", sys_waith="0") -AC_CHECK_HEADERS(dlfcn.h) -AC_CHECK_HEADERS(dl.h) - -AC_CHECK_HEADERS(kernel/OS.h) +APR_FLAG_HEADERS( + ByteOrder.h \ + conio.h \ + crypt.h \ + ctype.h \ + dir.h \ + dirent.h \ + dl.h \ + dlfcn.h \ + errno.h \ + fcntl.h \ + grp.h \ + iconv.h \ + io.h \ + langinfo.h \ + limits.h \ + malloc.h \ + memory.h \ + netdb.h \ + osreldate.h \ + poll.h \ + process.h \ + pwd.h \ + signal.h \ + stdarg.h \ + stddef.h \ + stdio.h \ + stdlib.h \ + string.h \ + strings.h \ + sysapi.h \ + sysgtime.h \ + termios.h \ + time.h \ + tpfeq.h \ + tpfio.h \ + unistd.h \ + unix.h \ + arpa/inet.h \ + kernel/OS.h \ + net/errno.h \ + netinet/in.h \ + netinet/tcp.h \ + sys/file.h \ + sys/mman.h \ + sys/poll.h \ + sys/resource.h \ + sys/select.h \ + sys/sem.h \ + sys/sendfile.h \ + sys/signal.h \ + sys/socket.h \ + sys/stat.h \ + sys/syslimits.h \ + sys/time.h \ + sys/types.h \ + sys/uio.h \ + sys/wait.h) + +dnl work around unexplained problem on Tru64 where +dnl the above invocation says it finds the header but +dnl APR_HAVE_foo_H is 0 +APR_FLAG_HEADERS(stdio.h) +APR_FLAG_HEADERS(errno.h) +APR_FLAG_HEADERS(crypt.h) +APR_FLAG_HEADERS(ctype.h) +APR_FLAG_HEADERS(fcntl.h) +APR_FLAG_HEADERS(netdb.h) AC_SUBST(arpa_ineth) AC_SUBST(conioh) From a4376e006384b8d71c72e7e466fcb1104ea87203 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 27 Feb 2001 18:33:07 +0000 Subject: [PATCH 1339/7878] Get the signal thread (and thus Apache threaded MPMs) working properly on AIX and Tru64. On certain platforms, sigwait() returns EINVAL if any of various unblockable signals are included in the mask. This was first observed on AIX and Tru64. On AIX (4.3.3, at least), sigwait() won't wake up if the high-order bit of the second word of flags is turned on. sigdelset() returns an error when trying to turn this off, so we'll turn it off manually. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61326 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 2c27f4ace64..df69f7cc514 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -275,6 +275,33 @@ static void *signal_thread_func(void *signal_handler) /* This thread will be the one responsible for handling signals */ sigfillset(&sig_mask); + + /* On certain platforms, sigwait() returns EINVAL if any of various + * unblockable signals are included in the mask. This was first + * observed on AIX and Tru64. + */ +#ifdef SIGKILL + sigdelset(&sig_mask, SIGKILL); +#endif +#ifdef SIGSTOP + sigdelset(&sig_mask, SIGSTOP); +#endif +#ifdef SIGCONT + sigdelset(&sig_mask, SIGCONT); +#endif +#ifdef SIGWAITING + sigdelset(&sig_mask, SIGWAITING); +#endif + + /* On AIX (4.3.3, at least), sigwait() won't wake up if the high- + * order bit of the second word of flags is turned on. sigdelset() + * returns an error when trying to turn this off, so we'll turn it + * off manually. + */ +#ifdef _AIX + sig_mask.hisigs &= 0x7FFFFFFF; +#endif + while (1) { int signal_received; From e4e817e00295422c28960945849355f4f6983ef2 Mon Sep 17 00:00:00 2001 From: Karl Fogel Date: Tue, 27 Feb 2001 20:48:21 +0000 Subject: [PATCH 1340/7878] Use an inline shell loop to do "_" and "." translation with sed, instead of an APR_FOREACH loop with translit(). Fix from Jim Jagielski . Note that there is still discussion of this problem on the list; see the two threads "tested :) work around for m4 weirdness" and "FreeBSD and gnu m4" However, since the build was broken on at least BSD and Linux, and Jim's patch makes things work again, it seemed better to apply it and *then* figure out if it's the Right Thing. :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61327 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index f5d50e71a08..a220352eff7 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -368,15 +368,16 @@ dnl setting to 1 or 0, we set FLAG-TO-SET to yes or no. dnl AC_DEFUN(APR_FLAG_HEADERS,[ AC_CHECK_HEADERS($1) -APR_FOREACH([ -[if test "$ac_cv_header_]translit(eachval,[./+-],[__p_])" = "yes"; then -dnl note: this translit() maps "/" to "_" and omits ".". the third arg -dnl really *is* intended to be one shorter than the second arg. - ifelse($2,,translit(eachval,[/.],[_]),$2)=ifelse($3,yes,yes,1) -else - ifelse($2,,translit(eachval,[/.],[_]),$2)=ifelse($3,yes,no,0) -fi -], APR_COMMA_ARGS($1)) +for aprt_i in $1 +do + ac_safe=`echo "$aprt_i" | sed 'y%./+-%__p_%'` + aprt_2=`echo "$aprt_i" | sed -e 's%/%_%g' -e 's/\.//g'` + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + eval "ifelse($2,,$aprt_2,$2)=ifelse($3,yes,yes,1)" + else + eval "ifelse($2,,$aprt_2,$2)=ifelse($3,yes,no,0)" + fi +done ]) dnl APR_FLAG_FUNCS(FUNC ... [, FLAG-TO-SET] [, "yes" ]) From 814818aa615b63c099b6c4e2d9050bb9491fa9ab Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 27 Feb 2001 21:20:26 +0000 Subject: [PATCH 1341/7878] Make a note not to use this macro yet, while also putting it into better form git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61328 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index a220352eff7..6dc814667cc 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -387,22 +387,18 @@ dnl we use what's provided as FLAG-TO-SET. If the 3rd parameter dnl is "yes" then instead of setting to 1 or 0, we set FLAG-TO-SET dnl to yes or no. dnl +dnl DON'T USE YET !! +dnl AC_DEFUN(APR_FLAG_FUNCS,[ -for aprt_i in $1 +AC_CHECK_FUNCS($1) +for aprt_j in $1 do - if test "x$2" = "x"; then - aprt_fts="have_$aprt_i" - else - aprt_fts="$2" - fi - if test "x$3" = "xyes"; then - s1="$aprt_fts=\"yes\"" - s0="$aprt_fts=\"no\"" + aprt_3="have_$aprt_j" + if eval "test \"`echo '$ac_cv_func_'$aprt_j`\" = yes"; then + eval "ifelse($2,,$aprt_3,$2)=ifelse($3,yes,yes,1)" else - s1="$aprt_fts=\"1\"" - s0="$aprt_fts=\"0\"" + eval "ifelse($2,,$aprt_3,$2)=ifelse($3,yes,no,0)" fi - AC_CHECK_FUNCS($aprt_i, eval $s1, eval $s0) done ]) From a9841abe8ec9ead7fd9e6d4ff9c0e1b79c1f6e43 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 28 Feb 2001 02:16:07 +0000 Subject: [PATCH 1342/7878] Fix some warnings dealing with the fact that void * isn't compatible with a function pointer. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61329 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index df69f7cc514..f71f01e6469 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -271,7 +271,7 @@ const char *apr_signal_get_description(int signum) static void *signal_thread_func(void *signal_handler) { sigset_t sig_mask; - int (*sig_func)(int signum) = signal_handler; + int (*sig_func)(int signum) = (int (*)(int))signal_handler; /* This thread will be the one responsible for handling signals */ sigfillset(&sig_mask); @@ -341,7 +341,7 @@ APR_DECLARE(apr_status_t) apr_create_signal_thread(apr_thread_t **td, int (*signal_handler)(int signum), apr_pool_t *p) { - return apr_thread_create(td, tattr, signal_thread_func, signal_handler, p); + return apr_thread_create(td, tattr, signal_thread_func, (void *)signal_handler, p); } #endif From 2ab89f6933678ee0f71125c4cb1e2f2b9820d564 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 1 Mar 2001 12:23:22 +0000 Subject: [PATCH 1343/7878] The Tru64 kludge for APR_FLAG_HEADERS() is no longer needed (after changes to the macro). Zap it. This should get the build to work on Mandrake 7.2 again (the Tru64 kludge had to be commented out with that combination of m4/glibc/whatever to build on Mandrake 7.2). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61330 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/configure.in b/configure.in index fdb79b082b8..47f9fd3125f 100644 --- a/configure.in +++ b/configure.in @@ -467,16 +467,6 @@ APR_FLAG_HEADERS( sys/uio.h \ sys/wait.h) -dnl work around unexplained problem on Tru64 where -dnl the above invocation says it finds the header but -dnl APR_HAVE_foo_H is 0 -APR_FLAG_HEADERS(stdio.h) -APR_FLAG_HEADERS(errno.h) -APR_FLAG_HEADERS(crypt.h) -APR_FLAG_HEADERS(ctype.h) -APR_FLAG_HEADERS(fcntl.h) -APR_FLAG_HEADERS(netdb.h) - AC_SUBST(arpa_ineth) AC_SUBST(conioh) AC_SUBST(ctypeh) From d3e662805c890fa24cadad17a21ebf230f86ad91 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 1 Mar 2001 13:41:46 +0000 Subject: [PATCH 1344/7878] Add APR_OS_PROC_T_FMT. Hopefully this will be used to get rid of various unfortunate constructs in Apache (like using %ld for pid_t but then casting the arg to long). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61331 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 1 + configure.in | 13 +++++++++++++ include/apr.h.in | 3 +++ include/apr.hw | 4 +++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/acconfig.h b/acconfig.h index 98e0154b3ba..3ff72d90c6e 100644 --- a/acconfig.h +++ b/acconfig.h @@ -31,6 +31,7 @@ #undef SIZEOF_SSIZE_T #undef SIZEOF_SIZE_T #undef SIZEOF_OFF_T +#undef SIZEOF_PID_T #undef HAVE_MM_SHMT_MMFILE diff --git a/configure.in b/configure.in index 47f9fd3125f..2a58f1efa6e 100644 --- a/configure.in +++ b/configure.in @@ -603,6 +603,18 @@ else off_t_fmt='#error Can not determine the proper size for off_t' fi +APR_CHECK_SIZEOF_EXTENDED([#include ], pid_t, 8) + +if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_int"; then + os_proc_t_fmt='#define APR_OS_PROC_T_FMT "d"' +elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long"; then + os_proc_t_fmt='#define APR_OS_PROC_T_FMT "ld"' +elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long_long"; then + os_proc_t_fmt='#define APR_OS_PROC_T_FMT "qd"' +else + os_proc_t_fmt='#error Can not determine the proper size for pid_t' +fi + # Basically, we have tried to figure out the correct format strings # for APR types which vary between platforms, but we don't always get # it right. If you find that we don't get it right for your platform, @@ -632,6 +644,7 @@ AC_SUBST(socklen_t_value) AC_SUBST(ssize_t_fmt) AC_SUBST(size_t_fmt) AC_SUBST(off_t_fmt) +AC_SUBST(os_proc_t_fmt) dnl #----------------------------- Checking for string functions AC_CHECK_FUNCS(strnicmp, have_strnicmp="1", have_strnicmp="0") diff --git a/include/apr.h.in b/include/apr.h.in index 46983f2393e..cef1f4c6f88 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -218,6 +218,9 @@ typedef @socklen_t_value@ apr_socklen_t; /* And APR_OFF_T_FMT */ @off_t_fmt@ +/* And APR_OS_PROC_T_FMT */ +@os_proc_t_fmt@ + /* Local machine definition for console and log output. */ #define APR_EOL_STR "@eolstr@" diff --git a/include/apr.hw b/include/apr.hw index e5cc8589f10..31ec6d3a925 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -280,10 +280,12 @@ typedef int gid_t; #define APR_SSIZE_T_FMT "d" -#define APR_SIZE_T_FMT "d" +#define APR_SIZE_T_FMT "d" #define APR_OFF_T_FMT "ld" +#define APR_OS_PROC_T_FMT "d" + /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" From 3805139b5f859acc4454081cc243a276fd53e8bc Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 1 Mar 2001 22:50:24 +0000 Subject: [PATCH 1345/7878] apr_private.h is included from fileio.h so we don't need to specify it. This caused a build failure on FreeBSD 4-STABLE for some strange reason. Also, bring the #if !defined into line with the other #ifndef checks we make in the file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61332 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/mktemp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 592d760c228..36c2d23d571 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -31,10 +31,9 @@ * SUCH DAMAGE. */ -#include "apr_private.h" #include "fileio.h" /* prototype of apr_mkstemp() */ -#if !defined(HAVE_MKSTEMP) +#ifndef HAVE_MKSTEMP #ifndef __warn_references #define __warn_references(a,b) From b938685ec9e7e6a737a66a738f8d478198fc5dd0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 2 Mar 2001 11:38:45 +0000 Subject: [PATCH 1346/7878] use apr_snprintf() instead of sprintf()... glibc_r sprintf() makes extra syscalls grabbing/releasing a mutex for unknown reasons git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61333 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_ntop.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index 6360b6abad5..6f9d2fee3c1 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -49,8 +49,6 @@ #define EAFNOSUPPORT WSAEAFNOSUPPORT #endif -#define SPRINTF(x) ((apr_size_t)sprintf x) - /* * WARNING: Don't even consider trying to compile this on a system where * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. @@ -106,7 +104,7 @@ inet_ntop4(src, dst, size) static const char fmt[] = "%u.%u.%u.%u"; char tmp[sizeof "255.255.255.255"]; - if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) { + if (apr_snprintf(tmp, sizeof tmp, fmt, src[0], src[1], src[2], src[3]) > size) { errno = ENOSPC; return (NULL); } @@ -193,7 +191,7 @@ inet_ntop6(src, dst, size) tp += strlen(tp); break; } - tp += SPRINTF((tp, "%x", words[i])); + tp += apr_snprintf(tp, sizeof tp, "%x", words[i]); } /* Was it a trailing run of 0x00's? */ if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) From 9173a053d37832b29d1135695830727ef8059dd8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 2 Mar 2001 18:27:34 +0000 Subject: [PATCH 1347/7878] need apr_strings for apr_snprintf. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61334 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_ntop.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index 6f9d2fee3c1..575bebe2a14 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -16,6 +16,7 @@ #include "apr_private.h" #include "networkio.h" +#include "apr_strings.h" #if APR_HAVE_SYS_TYPES_H #include From 455dab8638bea948d4b6d7f9e57e48fe51a56959 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 2 Mar 2001 21:07:37 +0000 Subject: [PATCH 1348/7878] mode_t works better than int for the mode, since on SGI mode_t is wider PR: 6980 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61335 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 03c4357bf2a..070db8e291d 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -58,7 +58,7 @@ #include "apr_strings.h" #include "apr_errno.h" -static apr_filetype_e filetype_from_mode(int mode) +static apr_filetype_e filetype_from_mode(mode_t mode) { apr_filetype_e type = APR_NOFILE; From c7fbc8aa0149112f1c126a92b5bb73ad49d9df3c Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 5 Mar 2001 00:15:46 +0000 Subject: [PATCH 1349/7878] Not quite sure how this went unnoticed for so long... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61336 13f79535-47bb-0310-9956-ffa450edef68 --- dso/beos/dso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dso/beos/dso.c b/dso/beos/dso.c index a19366cfa7d..e6764944a16 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -108,7 +108,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_hand APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) { - strncpy(strerror(errno), buffer, buflen); + strncpy(buffer, strerror(errno), buflen); return buffer; } From 505421fdb46270e7a455e32063d11cc2ba1216cd Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 5 Mar 2001 14:51:59 +0000 Subject: [PATCH 1350/7878] OS/2: Limit data passed to writev() to 64k as that's all it can handle. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61337 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sendrecv.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index 29b6190e271..fdb1ce77bba 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -142,9 +142,15 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t apr_status_t rv; struct iovec *tmpvec; int fds, err = 0; + int nv_tosend, total = 0; - tmpvec = alloca(sizeof(struct iovec) * nvec); - memcpy(tmpvec, vec, sizeof(struct iovec) * nvec); + /* Make sure writev() only gets fed 64k at a time */ + for ( nv_tosend = 0; total + vec[nv_tosend].iov_len < 65536; nv_tosend++ ) { + total += vec[nv_tosend].iov_len; + } + + tmpvec = alloca(sizeof(struct iovec) * nv_tosend); + memcpy(tmpvec, vec, sizeof(struct iovec) * nv_tosend); do { if (!sock->nonblock || err == SOCEWOULDBLOCK) { @@ -165,7 +171,7 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t } } - rv = writev(sock->socketdes, tmpvec, nvec); + rv = writev(sock->socketdes, tmpvec, nv_tosend); err = rv < 0 ? sock_errno() : 0; } while (err == SOCEINTR || err == SOCEWOULDBLOCK); From 3cd36cc0034f9925444e751cdeaba06f7bf07b95 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 5 Mar 2001 14:56:04 +0000 Subject: [PATCH 1351/7878] Ooops, that wasn't quite right. Stop counting bytes at nvec. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61338 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sendrecv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index fdb1ce77bba..e4a8e747497 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -145,7 +145,7 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t int nv_tosend, total = 0; /* Make sure writev() only gets fed 64k at a time */ - for ( nv_tosend = 0; total + vec[nv_tosend].iov_len < 65536; nv_tosend++ ) { + for ( nv_tosend = 0; nv_tosend < nvec && total + vec[nv_tosend].iov_len < 65536; nv_tosend++ ) { total += vec[nv_tosend].iov_len; } From 77894b0e9acd2e2b57fe5bde75669b91b2ec552d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 5 Mar 2001 20:28:42 +0000 Subject: [PATCH 1352/7878] Change the check for netinet/tcp.h to work around an issue with that header file on IRIX 6.5 which prevented it from being detected. PR: 6459 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61339 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ configure.in | 17 ++++++++++++++++- network_io/unix/inet_aton.c | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 737177e97e2..d889196f6e5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Change the check for netinet/tcp.h to work around an issue with + that header file on IRIX 6.5 which prevented it from being + detected. PR #6459 [Jeff Trawick] + *) Introduce apr_get_userid to return a named user's apr_uid_t and apr_gid_t across platforms [Cliff Woolley, William Rowe] diff --git a/configure.in b/configure.in index 2a58f1efa6e..42e55777fb2 100644 --- a/configure.in +++ b/configure.in @@ -450,7 +450,6 @@ APR_FLAG_HEADERS( kernel/OS.h \ net/errno.h \ netinet/in.h \ - netinet/tcp.h \ sys/file.h \ sys/mman.h \ sys/poll.h \ @@ -467,6 +466,22 @@ APR_FLAG_HEADERS( sys/uio.h \ sys/wait.h) +dnl IRIX 6.5 has a problem in which prevents it from +dnl being included by itself. Check for manually, +dnl including another header file first. +AC_MSG_CHECKING(for netinet/tcp.h) +AC_TRY_CPP([ +#ifdef HAVE_NETINET_IN_H +#include +#endif +#include +], netinet_tcph="1", netinet_tcph="0") +if test $netinet_tcph = 1; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + AC_SUBST(arpa_ineth) AC_SUBST(conioh) AC_SUBST(ctypeh) diff --git a/network_io/unix/inet_aton.c b/network_io/unix/inet_aton.c index 1489487d8dc..60a73198004 100644 --- a/network_io/unix/inet_aton.c +++ b/network_io/unix/inet_aton.c @@ -69,7 +69,7 @@ */ #include "apr_private.h" -#ifndef HAVE_NETINET_TCP_H +#if !APR_HAVE_NETINET_TCP_H #include "networkio.h" From e1e12275ca23035f95599008ae845613d6331246 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 5 Mar 2001 20:45:32 +0000 Subject: [PATCH 1353/7878] nobody uses inet_aton() anymore; it isn't even in a Makefile.in git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61340 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/inet_aton.c | 178 ------------------------------------ network_io/unix/inet_aton.c | 177 ----------------------------------- 2 files changed, 355 deletions(-) delete mode 100644 network_io/beos/inet_aton.c delete mode 100644 network_io/unix/inet_aton.c diff --git a/network_io/beos/inet_aton.c b/network_io/beos/inet_aton.c deleted file mode 100644 index 2c955608c1c..00000000000 --- a/network_io/beos/inet_aton.c +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) 1983, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies, and that - * the name of Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the document or software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT - * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ - -/* - * Portions Copyright (c) 1996-1999 by Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS - * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE - * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ - -#include "apr_private.h" -#if BEOS_R5 /* this isn't needed for BONE */ - -#include "networkio.h" -#include - -/* BeOS doesn't yet have it's own inet_aton and Bind won't be ported - * until R5, so this is from a Bind 8 distribution. It's currently untested. - */ - -int inet_aton(const char *cp, struct in_addr *addr) { - u_long val; - int base, n; - char c; - short parts[4]; - short *pp = parts; - int digit; - - c = *cp; - for (;;) { - /* - * Collect number up to ``.''. - * Values are specified as for C: - * 0x=hex, 0=octal, isdigit=decimal. - */ - if (!isdigit(c)) - return (0); - val = 0; base = 10; digit = 0; - if (c == '0') { - c = *++cp; - if (c == 'x' || c == 'X') - base = 16, c = *++cp; - else { - base = 8; - digit = 1 ; - } - } - for (;;) { - if (isascii(c) && isdigit(c)) { - if (base == 8 && (c == '8' || c == '9')) - return (0); - val = (val * base) + (c - '0'); - c = *++cp; - digit = 1; - } else if (base == 16 && isascii(c) && isxdigit(c)) { - val = (val << 4) | - (c + 10 - (islower(c) ? 'a' : 'A')); - c = *++cp; - digit = 1; - } else - break; - } - if (c == '.') { - /* - * Internet format: - * a.b.c.d - * a.b.c (with c treated as 16 bits) - * a.b (with b treated as 24 bits) - */ - if (pp >= parts + 3 || val > 0xff) - return (0); - *pp++ = val; - c = *++cp; - } else - break; - } - /* - * Check for trailing characters. - */ - if (c != '\0' && (!isascii(c) || !isspace(c))) - return (0); - /* - * Did we get a valid digit? - */ - if (!digit) - return (0); - /* - * Concoct the address according to - * the number of parts specified. - */ - n = pp - parts + 1; - switch (n) { - case 1: /* a -- 32 bits */ - break; - - case 2: /* a.b -- 8.24 bits */ - if (val > 0xffffff) - return (0); - val |= parts[0] << 24; - break; - - case 3: /* a.b.c -- 8.8.16 bits */ - if (val > 0xffff) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16); - break; - - case 4: /* a.b.c.d -- 8.8.8.8 bits */ - if (val > 0xff) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); - break; - } - if (addr != NULL) - addr->s_addr = htonl(val); - return (1); -} -#endif diff --git a/network_io/unix/inet_aton.c b/network_io/unix/inet_aton.c deleted file mode 100644 index 60a73198004..00000000000 --- a/network_io/unix/inet_aton.c +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (c) 1983, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies, and that - * the name of Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the document or software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT - * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ - -/* - * Portions Copyright (c) 1996-1999 by Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS - * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE - * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ - -#include "apr_private.h" -#if !APR_HAVE_NETINET_TCP_H - -#include "networkio.h" - -/* BeOS doesn't yet have it's own inet_aton and Bind won't be ported - * until R5, so this is from a Bind 8 distribution. It's currently untested. - */ - -int inet_aton(const char *cp, struct in_addr *addr) { - u_long val; - int base, n; - char c; - short parts[4]; - short *pp = parts; - int digit; - - c = *cp; - for (;;) { - /* - * Collect number up to ``.''. - * Values are specified as for C: - * 0x=hex, 0=octal, isdigit=decimal. - */ - if (!isdigit(c)) - return (0); - val = 0; base = 10; digit = 0; - if (c == '0') { - c = *++cp; - if (c == 'x' || c == 'X') - base = 16, c = *++cp; - else { - base = 8; - digit = 1 ; - } - } - for (;;) { - if (isascii(c) && isdigit(c)) { - if (base == 8 && (c == '8' || c == '9')) - return (0); - val = (val * base) + (c - '0'); - c = *++cp; - digit = 1; - } else if (base == 16 && isascii(c) && isxdigit(c)) { - val = (val << 4) | - (c + 10 - (islower(c) ? 'a' : 'A')); - c = *++cp; - digit = 1; - } else - break; - } - if (c == '.') { - /* - * Internet format: - * a.b.c.d - * a.b.c (with c treated as 16 bits) - * a.b (with b treated as 24 bits) - */ - if (pp >= parts + 3 || val > 0xff) - return (0); - *pp++ = val; - c = *++cp; - } else - break; - } - /* - * Check for trailing characters. - */ - if (c != '\0' && (!isascii(c) || !isspace(c))) - return (0); - /* - * Did we get a valid digit? - */ - if (!digit) - return (0); - /* - * Concoct the address according to - * the number of parts specified. - */ - n = pp - parts + 1; - switch (n) { - case 1: /* a -- 32 bits */ - break; - - case 2: /* a.b -- 8.24 bits */ - if (val > 0xffffff) - return (0); - val |= parts[0] << 24; - break; - - case 3: /* a.b.c -- 8.8.16 bits */ - if (val > 0xffff) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16); - break; - - case 4: /* a.b.c.d -- 8.8.8.8 bits */ - if (val > 0xff) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); - break; - } - if (addr != NULL) - addr->s_addr = htonl(val); - return (1); -} -#endif From 56baccde6df7f84d1bfa378f5eb732c413f0bb02 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 6 Mar 2001 04:54:49 +0000 Subject: [PATCH 1354/7878] Add a --with-sendfile option, so that people without a sendfile implementation for APR can disable it from the configure command line. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61341 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ configure.in | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGES b/CHANGES index d889196f6e5..fdd41697a32 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Add a with-sendfile option, so that people on platforms without a + sendfile implementation for APR can easily disable it from the + configure line. [Ryan Bloom] + *) Change the check for netinet/tcp.h to work around an issue with that header file on IRIX 6.5 which prevented it from being detected. PR #6459 [Jeff Trawick] diff --git a/configure.in b/configure.in index 42e55777fb2..2cd8022185a 100644 --- a/configure.in +++ b/configure.in @@ -350,6 +350,13 @@ dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a dnl threaded poll() and we don't want to use sendfile on early FreeBSD dnl systems if we are also using threads. +AC_ARG_WITH(sendfile, [ --with-sendfile Force sendfile to be on or off], + [ if test "$withval" = "yes"; then + sendfile="1" + else + sendfile="0" + fi ] ) + orig_sendfile=$sendfile case "$OS" in *freebsd*) From b8a147c7fd0ca70dbdb962ac274170a8782f40a4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 6 Mar 2001 19:22:26 +0000 Subject: [PATCH 1355/7878] We have to use +Z on HPUX in order to get position independant code. I am assuming we will always want that, regardless of build type. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61342 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 2cd8022185a..155c4c19727 100644 --- a/configure.in +++ b/configure.in @@ -88,7 +88,7 @@ dnl # this is the place to put specific options for platform/compiler dnl # combinations case "$OS:$CC" in *-hp-hpux*:cc ) - CFLAGS="$CFLAGS -Ae +DAportable" + CFLAGS="$CFLAGS -Ae +DAportable +Z" ;; powerpc-*-beos:mwcc* ) CPP="mwcc -E" From a8a2afac13067bc61c66f21c7d68f9cfaf7e4044 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 7 Mar 2001 17:41:37 +0000 Subject: [PATCH 1356/7878] Use a consistent style in declarations for inet_pton4() and inet_pton6(). Previously, we had modern prototypes followed by K&R-style definitions. This leads to warnings on some compilers (e.g., SGI). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61343 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_pton.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/network_io/unix/inet_pton.c b/network_io/unix/inet_pton.c index 711384cb8ee..4a7613307e2 100644 --- a/network_io/unix/inet_pton.c +++ b/network_io/unix/inet_pton.c @@ -97,9 +97,7 @@ apr_inet_pton(int af, const char *src, void *dst) * Paul Vixie, 1996. */ static int -inet_pton4(src, dst) - const char *src; - unsigned char *dst; +inet_pton4(const char *src, unsigned char *dst) { static const char digits[] = "0123456789"; int saw_digit, octets, ch; @@ -152,9 +150,7 @@ inet_pton4(src, dst) * Paul Vixie, 1996. */ static int -inet_pton6(src, dst) - const char *src; - unsigned char *dst; +inet_pton6(const char *src, unsigned char *dst) { static const char xdigits_l[] = "0123456789abcdef", xdigits_u[] = "0123456789ABCDEF"; From f78953d889cc3e7a619d1eaf3153bc5ae1496993 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 7 Mar 2001 17:51:56 +0000 Subject: [PATCH 1357/7878] Use a consistent style in declarations for inet_ntop4() and inet_ntop6(). Previously, we had modern prototypes followed by K&R-style definitions. This leads to warnings on some compilers (e.g., SGI). (this should have been committed with inet_pton() a few minutes ago) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61344 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_ntop.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index 575bebe2a14..b5d712767b6 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -97,10 +97,7 @@ apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size) * Paul Vixie, 1996. */ static const char * -inet_ntop4(src, dst, size) - const unsigned char *src; - char *dst; - apr_size_t size; +inet_ntop4(const unsigned char *src, char *dst, apr_size_t size) { static const char fmt[] = "%u.%u.%u.%u"; char tmp[sizeof "255.255.255.255"]; @@ -121,10 +118,7 @@ inet_ntop4(src, dst, size) * Paul Vixie, 1996. */ static const char * -inet_ntop6(src, dst, size) - const unsigned char *src; - char *dst; - apr_size_t size; +inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) { /* * Note that int32_t and int16_t need only be "at least" large enough From 4f02d5bc6fb06537b26ebf1a2f10029ed75d7479 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 7 Mar 2001 17:57:19 +0000 Subject: [PATCH 1358/7878] Change the return type of apr_hash_count() to some counter type ("int") instead of a size type (apr_size_t). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61345 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +----- include/apr_hash.h | 4 ++-- tables/apr_hash.c | 10 +++++----- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/STATUS b/STATUS index 02b14e65f7f..e84f8985e5c 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/02/18 00:32:16 $] +Last modified at [$Date: 2001/03/07 17:57:11 $] Release: @@ -105,10 +105,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * toss the per-Makefile setup of INCLUDES; shift to rules.mk.in - * Change the return type of apr_hash_count() to some counter type - (like "int") instead of a size type (apr_size_t). Jeff will - do this Real Soon Now (so he says on 20010121). - * add the rest of the pool accessor declare/impl macros. Status: Greg volunteers diff --git a/include/apr_hash.h b/include/apr_hash.h index 548c1934cb6..c17a208515c 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -177,9 +177,9 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, * Get the number of key/value pairs in the hash table. * @param ht The hash table * @return The number of key/value pairs in the hash table. - * @deffunc void apr_hash_count(apr_hash_t *ht, apr_size_t *count); + * @deffunc int apr_hash_count(apr_hash_t *ht); */ -APR_DECLARE(apr_size_t) apr_hash_count(apr_hash_t *ht); +APR_DECLARE(int) apr_hash_count(apr_hash_t *ht); #ifdef __cplusplus diff --git a/tables/apr_hash.c b/tables/apr_hash.c index ecaf13d673a..7e7a59ba479 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -100,7 +100,7 @@ struct apr_hash_entry_t { struct apr_hash_t { apr_pool_t *pool; apr_hash_entry_t **array; - apr_size_t count, max; + int count, max; }; #define INITIAL_MAX 15 /* tunable == 2^n - 1 */ @@ -114,7 +114,7 @@ struct apr_hash_t { struct apr_hash_index_t { apr_hash_t *ht; apr_hash_entry_t *this, *next; - apr_size_t index; + int index; }; @@ -122,7 +122,7 @@ struct apr_hash_index_t { * Hash creation functions. */ -static apr_hash_entry_t **alloc_array(apr_hash_t *ht, apr_size_t max) +static apr_hash_entry_t **alloc_array(apr_hash_t *ht, int max) { return apr_pcalloc(ht->pool, sizeof(*ht->array) * (max + 1)); } @@ -185,7 +185,7 @@ static void expand_array(apr_hash_t *ht) { apr_hash_index_t *hi; apr_hash_entry_t **new_array; - apr_size_t new_max; + int new_max; int i; new_max = ht->max * 2 + 1; @@ -315,7 +315,7 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, /* else key not present and val==NULL */ } -APR_DECLARE(apr_size_t) apr_hash_count(apr_hash_t *ht) +APR_DECLARE(int) apr_hash_count(apr_hash_t *ht) { return ht->count; } From 2f190e0e47ac796556da00519135e7161f7c0716 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 7 Mar 2001 22:09:16 +0000 Subject: [PATCH 1359/7878] Make APR look for header files in the APR paths before looking in system include paths. Submitted by: jean-frederic clere git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61346 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ build/rules.mk.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index fdd41697a32..865f9eb816f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Change the include path order, so that we look for included files + in the APR paths first, and the system paths second. + [jean-frederic clere ] + *) Add a with-sendfile option, so that people on platforms without a sendfile implementation for APR can easily disable it from the configure line. [Ryan Bloom] diff --git a/build/rules.mk.in b/build/rules.mk.in index 802e1a84f03..f8e6e681cbe 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -82,7 +82,7 @@ LTFLAGS = --silent # # Basic macro setup # -COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) +COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) LT_COMPILE = $(LIBTOOL) --mode=compile $(LTFLAGS) $(COMPILE) -c $< && touch $@ LINK = $(LIBTOOL) --mode=link $(LTFLAGS) $(COMPILE) $(LDFLAGS) -o $@ From 7a1e7f95edc4f5bc032bdf1f25f74b0cc231fbfe Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 8 Mar 2001 00:35:37 +0000 Subject: [PATCH 1360/7878] Allow a way to get the password from the system password database. Non unix platforms will likely need a similar function. Submitted by: John Barbee git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61347 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_user.h | 10 ++++++++++ user/unix/userinfo.c | 14 ++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/CHANGES b/CHANGES index 865f9eb816f..aced7873446 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Add a method to get the password from the system for a given + user. [John Barbee ] + *) Change the include path order, so that we look for included files in the APR paths first, and the system paths second. [jean-frederic clere ] diff --git a/include/apr_user.h b/include/apr_user.h index 3c70da037ad..542f17625f5 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -161,6 +161,16 @@ APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right); #define apr_compare_groups(left,right) ((left == right) ? APR_SUCCESS : APR_EMISMATCH) #endif +/** + * Get a password from the system, given a username. + * @param passwd The returned password + * @param username The username to get the password for + * @param p The pool to allocate out of. + * @deffunc apr_status_t apr_get_user_passwd(char **passwd, const char *username, apr_pool_t *p); + */ +APR_DECLARE(apr_status_t) apr_get_user_passwd(char **passwd, + const char *username, apr_pool_t *p); + #endif /* ! APR_HAS_USER */ #ifdef __cplusplus diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 2987153f552..dca8e1cf917 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -129,4 +129,18 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap *username = apr_pstrdup(p, pw->pw_name); return APR_SUCCESS; } + +APR_DECLARE(apr_status_t) apr_get_user_passwd(char **passwd, + const char *username, apr_pool_t *p) +{ + struct passwd *pw; + apr_status_t rv; + + if ((rv = getpwnam_safe(username, &pw)) != APR_SUCCESS) + return rv; + + *passwd = apr_pstrdup(p, pw->pw_passwd); + + return APR_SUCCESS; +} From 8bba2acfeb10549d26117b53e39b8b2be340b617 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 8 Mar 2001 05:28:43 +0000 Subject: [PATCH 1361/7878] Refreshing the .mak files, bringing expat.dsp up to 6.0 with all the rest git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61348 13f79535-47bb-0310-9956-ffa450edef68 --- apr.mak | 1 + libapr.mak | 1 + 2 files changed, 2 insertions(+) diff --git a/apr.mak b/apr.mak index db8fe2fb7c3..9e5b6d249cc 100644 --- a/apr.mak +++ b/apr.mak @@ -1049,6 +1049,7 @@ DEP_CPP_INET_=\ ".\include\apr_general.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ diff --git a/libapr.mak b/libapr.mak index b8de8247aeb..5852d14c7c2 100644 --- a/libapr.mak +++ b/libapr.mak @@ -1066,6 +1066,7 @@ DEP_CPP_INET_=\ ".\include\apr_general.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ From c5594798d4f78621441976043cf09fbfabceedc7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 8 Mar 2001 15:22:31 +0000 Subject: [PATCH 1362/7878] Script to fix apr-util's path for apr in the win32 .mak files... always run whenever exporting the .mak files, and always _before_ the copy of this script in httpd-2.0/build, if this is a checkout for that project. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61350 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 build/fixwin32mak.pl diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl new file mode 100644 index 00000000000..d8131fb448b --- /dev/null +++ b/build/fixwin32mak.pl @@ -0,0 +1,53 @@ +# +# fixwin32mak.pl ::: Apache/Win32 maintanace program +# +# This program, launched from the build/ directory, replaces all nasty absoulute paths +# in the win32 .mak files with the appropriate relative root. +# +# Run this program prior to committing or packaging any newly exported make files. + +use Cwd; +use IO::File; +use File::Find; + +chdir '..'; +$root = cwd; +# ignore our own direcory (allowing us to move into any parallel tree) +$root =~ s|^.:(.*)/.*?$|cd "$1|; +$root =~ s|/|\\\\|g; +print "Testing " . $root . "\n"; +find(\&fixcwd, '.'); + +sub fixcwd { + if (m|.mak$|) { +# note repl is broken... isn't freindly to directories with periods. + $repl = $File::Find::dir; +# replace ./ with the parent (moving into any parallel tree) + $repl =~ s|^\./|../|; +# replace each directory in this path with .. to get back to our root + $repl =~ s|[^/]+|..|g; + $repl =~ s|/|\\|; + $oname = $_; + $tname = '.#' . $_; + $verchg = 0; +print "Processing " . $_ . "\n"; + $srcfl = new IO::File $_, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|^(\s*)$root|$1cd "$repl|) { + $verchg = -1; + } + print $dstfl $src; + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Corrected absolute paths within " . $oname . " in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } + } +} From c2ab20d3ffb7d3fd8cc31c7c90f2031bba0c1686 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 8 Mar 2001 16:05:12 +0000 Subject: [PATCH 1363/7878] Keep userinfo.c compiling on OS/390, where there is no pw_passwd field in struct passwd. The affected function is due to be replaced soon anyway. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61351 13f79535-47bb-0310-9956-ffa450edef68 --- user/unix/userinfo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index dca8e1cf917..ac0b386fb07 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -139,7 +139,11 @@ APR_DECLARE(apr_status_t) apr_get_user_passwd(char **passwd, if ((rv = getpwnam_safe(username, &pw)) != APR_SUCCESS) return rv; +#if defined(__MVS__) /* silly hack, but this function will be replaced soon anyway */ + *passwd = "x"; /* same as many Linux (and Solaris and more) boxes these days */ +#else *passwd = apr_pstrdup(p, pw->pw_passwd); +#endif return APR_SUCCESS; } From 6ad4cf6283560b78da8ca1709b21488c474dd6cb Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 8 Mar 2001 19:58:39 +0000 Subject: [PATCH 1364/7878] OK, so this commit adds basic UDP support for Unix. I've had this on my To Do list for a while now and I've been feeling guilty which is why I'm only posting the Unix code. I'm pretty sure the code is general enough that the other platforms will have no problem in using it, but I can't test on those platforms. I'll do BeOS when I get a spare 5 minutes. The network code could probably do with a review for common code anyways. Tested and working with both IPv4 and IPv6 on FreeBSD. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61352 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 21 +++++++++++ network_io/unix/sendrecv.c | 76 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index c641458f50d..585d642452c 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -436,6 +436,27 @@ APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len); +/** + * @param sock The socket to send from + * @param where The apr_sockaddr_t describing where to send the data + * @param data The data to send + * @param len The length of the data to send + */ +APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, + apr_size_t *len); + +/** + * @param from The apr_sockaddr_t to fill in the recipient info + * @param sock The socket to use + * @param buf The buffer to use + * @param len The length of the available buffer + */ + +APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, + apr_int32_t flags, char *buf, + apr_size_t *len); + #if APR_HAS_SENDFILE /** diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 25d292b5922..f452e4747c3 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -162,6 +162,82 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) return APR_SUCCESS; } +apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, apr_size_t *len) +{ + ssize_t rv; + + do { + rv = sendto(sock->socketdes, buf, (*len), flags, + (const struct sockaddr*)&where->sa, + where->salen); + } while (rv == -1 && errno == EINTR); + + if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) + && sock->timeout != 0) { + apr_status_t arv = wait_for_io_or_timeout(sock, 0); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } else { + do { + rv = sendto(sock->socketdes, buf, (*len), flags, + (const struct sockaddr*)&where->sa, + where->salen); + } while (rv == -1 && errno == EINTR); + } + } + if (rv == -1) { + *len = 0; + return errno; + } + *len = rv; + return APR_SUCCESS; +} + +apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, + apr_int32_t flags, char *buf, + apr_size_t *len) +{ + ssize_t rv; + + if (from == NULL){ + return APR_ENOMEM; + /* Not sure if this is correct. Maybe we should just allocate + the memory?? + */ + } + + do { + rv = recvfrom(sock->socketdes, buf, (*len), flags, + (struct sockaddr*)&from->sa, &from->salen); + } while (rv == -1 && errno == EINTR); + + if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && + sock->timeout != 0) { + apr_status_t arv = wait_for_io_or_timeout(sock, 1); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } else { + do { + rv = recvfrom(sock->socketdes, buf, (*len), flags, + (struct sockaddr*)&from->sa, &from->salen); + } while (rv == -1 && errno == EINTR); + } + } + if (rv == -1) { + (*len) = 0; + return errno; + } + + (*len) = rv; + if (rv == 0) + return APR_EOF; + + return APR_SUCCESS; +} + #ifdef HAVE_WRITEV apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len) From 0127b61da0fddc2a10577b27754a13b287a29de3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 8 Mar 2001 20:06:57 +0000 Subject: [PATCH 1365/7878] One day I'll remember to do this when I actually commit :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61353 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index aced7873446..c4c5ae0260a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Add apr_sendto and apr_recvfrom for Unix. Start of adding UDP + support. [David Reid] + *) Add a method to get the password from the system for a given user. [John Barbee ] From 5638ede2c5dc38d0a3177ff687a54712fbb6d5f9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 8 Mar 2001 20:13:51 +0000 Subject: [PATCH 1366/7878] Let apr_inet_ntop() (and thus apr_sockaddr_ip_get()) work again for IPv6 addresses. I broke it in the change from sprintf() to apr_snprintf() :( git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61354 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_ntop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index b5d712767b6..63752d615f8 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -186,7 +186,7 @@ inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) tp += strlen(tp); break; } - tp += apr_snprintf(tp, sizeof tp, "%x", words[i]); + tp += apr_snprintf(tp, sizeof tmp - (tp - tmp), "%x", words[i]); } /* Was it a trailing run of 0x00's? */ if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) From cdb98d2169be94277f8402a832968888f3b37839 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 9 Mar 2001 15:24:28 +0000 Subject: [PATCH 1367/7878] don't hard-code -lpthread for HP-UX 11; we'll autodetect whether or not we need it git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61355 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 1 - 1 file changed, 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 6749a17d4bd..dab5099130a 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -105,7 +105,6 @@ else ;; *-hp-hpux11.*) APR_ADDTO(CFLAGS, [-DHPUX11]) - APR_ADDTO(LIBS, [-lpthread]) APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-hp-hpux10.*) From 01ecbb1406aedc3256e2c071e85b80f5f70bc238 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 10 Mar 2001 00:07:09 +0000 Subject: [PATCH 1368/7878] Fix a subtle bug in the hash tables. We can't expand the array after finding the entry because if we do, we immediately overwrite the value. Intead, we have to expand the hash after setting the value. Submitted by: Jon Travis Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61356 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 7e7a59ba479..8085ee33fd2 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -275,10 +275,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, he->klen = klen; he->val = val; *hep = he; - /* check that the collision rate isn't too high */ - if (++ht->count > ht->max) { - expand_array(ht); - } + ht->count++; return hep; } @@ -310,6 +307,10 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, else { /* replace entry */ (*hep)->val = val; + /* check that the collision rate isn't too high */ + if (ht->count > ht->max) { + expand_array(ht); + } } } /* else key not present and val==NULL */ From 196f1f5a88fc685b17be7513c19636beb1ffa686 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Sun, 11 Mar 2001 23:24:56 +0000 Subject: [PATCH 1369/7878] More doxygenation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61357 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 5 ++ include/apr_pools.h | 124 +++++++++++++++++----------------------- lib/apr_pools.c | 2 +- memory/unix/apr_pools.c | 2 +- 4 files changed, 58 insertions(+), 75 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index cef1f4c6f88..e4e6b8cbd9a 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -1,6 +1,11 @@ #ifndef APR_H #define APR_H +/** + * @file apr.h + * @brief Basic APR header + */ + /* So that we can use inline on some critical functions, and use * GNUC attributes (such as to get -Wall warnings for printf-like * functions). Only do this in gcc 2.7 or later ... it may work diff --git a/include/apr_pools.h b/include/apr_pools.h index df9c6e575be..5cf5c5d3b41 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -60,10 +60,9 @@ extern "C" { #endif /** - * @package APR memory allocation - */ - -/* + * @file apr_pools.h + * @brief APR memory allocation + * * Resource allocation routines... * * designed so that we don't have to keep track of EVERYTHING so that @@ -75,13 +74,6 @@ extern "C" { * transaction info, and one for config info. When a transaction is over, * we can delete everything in the per-transaction apr_pool_t without fear, * and without thinking too hard about it either. - * - * rst - */ - -/* Arenas for configuration info and transaction info - * --- actual layout of the apr_pool_t structure is private to - * alloc.c. */ #include "apr.h" @@ -103,9 +95,7 @@ extern "C" { #define ALLOC_STATS */ -/** - * @package APR memory allocation - */ +/** The fundamental pool type */ typedef struct apr_pool_t apr_pool_t; /** The memory allocation structure @@ -134,16 +124,12 @@ struct apr_pool_t { void *allocation_list; #endif #ifdef APR_POOL_DEBUG - /** a list of joined pools - * @defvar apr_pool_t *joined */ + /** a list of joined pools */ struct apr_pool_t *joined; #endif - /** A function to control how pools behave when they receive ENOMEM - * @deffunc int (*apr_abort)(int retcode) */ + /** A function to control how pools behave when they receive ENOMEM */ int (*apr_abort)(int retcode); - /** - * A place to hold user data associated with this pool - * @defvar apr_hash_t *prog_data */ + /** A place to hold user data associated with this pool */ struct apr_hash_t *prog_data; }; @@ -194,14 +180,13 @@ APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts); * @param b The pool to search for * @return True if a is an ancestor of b, NULL is considered an ancestor * of all pools. - * @deffunc int apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) */ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); #else -#ifdef apr_pool_join -#undef apr_pool_join -#endif -#define apr_pool_join(a,b) +# ifdef apr_pool_join +# undef apr_pool_join +# endif +# define apr_pool_join(a,b) #endif /* @@ -210,23 +195,23 @@ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); /** * Setup all of the internal structures required to use pools - * @parm globalp The apr global pool, used to allocate APR structures + * @param globalp The APR global pool, used to allocate APR structures * before any other pools are created. This pool should not * ever be used outside of APR. - * @tip Programs do NOT need to call this directly. APR will call this + * @remark Programs do NOT need to call this directly. APR will call this * automatically from apr_initialize. - * @deffunc apr_status_t apr_pool_alloc_init(apr_pool_t *globalp) + * @internal */ APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *globalp); /** * Tear down all of the internal structures required to use pools - * @parm globalp The apr global pool, used to allocate APR structures + * @param globalp The APR global pool, used to allocate APR structures * before any other pools are created. This pool should not * ever be used outside of APR. - * @tip Programs do NOT need to call this directly. APR will call this + * @remark Programs do NOT need to call this directly. APR will call this * automatically from apr_terminate. - * @deffunc void apr_pool_alloc_term(apr_pool_t *globalp) + * @internal */ APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp); @@ -239,7 +224,6 @@ APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp); * pool. If it is non-NULL, the new pool will inherit all * of it's parent pool's attributes, except the apr_pool_t will * be a sub-pool. - * @deffunc apr_status_t apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont); @@ -248,91 +232,86 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, * Set the data associated with the current pool * @param data The user data associated with the pool. * @param key The key to use for association - * @param cleanup The cleanup program to use to cleanup the data; - * @param cont The current pool. - * @tip The data to be attached to the pool should have the same - * life span as the pool it is being attached to. + * @param cleanup The cleanup program to use to cleanup the data + * @param cont The current pool + * @warning The data to be attached to the pool should have a life span + * at least as long as the pool it is being attached to. * * Users of APR must take EXTREME care when choosing a key to * use for their data. It is possible to accidentally overwrite * data by choosing a key that another part of the program is using * It is advised that steps are taken to ensure that a unique * key is used at all times. - * @deffunc apr_status_t apr_pool_userdata_set(const void *data, const char *key, apr_status_t (*cleanup)(void *), apr_pool_t *cont) + * @bug Specify how to ensure this uniqueness! */ -APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *key, - apr_status_t (*cleanup)(void *), - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, + const char *key, + apr_status_t (*cleanup)(void *), + apr_pool_t *cont); /** * Return the data associated with the current pool. - * @param data The key for the data to retrieve - * @param key The user data associated with the pool. + * @param data The user data associated with the pool. + * @param key The key for the data to retrieve * @param cont The current pool. - * @deffunc apr_status_t apr_pool_userdata_get(void **data, const char *key, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *cont); /** - * make a sub pool from the current pool + * Make a sub pool from the current pool * @param p The pool to use as a parent pool * @param apr_abort A function to use if the pool cannot allocate more memory. * @return The new sub-pool - * @tip The apr_abort function provides a way to quit the program if the + * @remark The @a apr_abort function provides a way to quit the program if the * machine is out of memory. By default, APR will return on error. - * @deffunc apr_pool_t *apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int retcode)) */ APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int retcode)); /** - * clear all memory in the pool + * Clear all memory in the pool and run all the cleanups. This also clears all + * subpools. * @param p The pool to clear - * @tip This does not actually free the memory, it just allows the pool + * @remark This does not actually free the memory, it just allows the pool * to re-use this memory for the next allocation. - * @deffunc void apr_pool_clear(apr_pool_t *p) + * @see apr_pool_destroy() */ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); /** - * destroy the pool + * Destroy the pool. This runs apr_pool_clear() and then frees all the memory. * @param p The pool to destroy - * @tip This will actually free the memory - * @deffunc void apr_pool_destroy(apr_pool_t *p) + * @remark This will actually free the memory */ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); /** - * report the number of bytes currently in the pool + * Report the number of bytes currently in the pool * @param p The pool to inspect * @return The number of bytes - * @deffunc apr_size_t apr_pool_num_bytes(apr_pool_t *p) */ APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p); /** - * report the number of bytes currently in the list of free blocks + * Report the number of bytes currently in the list of free blocks * @return The number of bytes - * @deffunc apr_size_t apr_pool_free_blocks_num_bytes(void) */ APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void); /** * Allocate a block of memory from a pool - * @param c The pool to allocate out of + * @param c The pool to allocate from * @param reqsize The amount of memory to allocate * @return The allocated memory - * @deffunc void *apr_palloc(apr_pool_t *c, apr_size_t reqsize) */ APR_DECLARE(void *) apr_palloc(apr_pool_t *c, apr_size_t reqsize); /** * Allocate a block of memory from a pool and set all of the memory to 0 - * @param p The pool to allocate out of + * @param p The pool to allocate from * @param size The amount of memory to allocate * @return The allocated memory - * @deffunc void *apr_pcalloc(apr_pool_t *p, apr_size_t size) */ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); @@ -342,29 +321,30 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); * @param data The data to pass to the cleanup function. * @param plain_cleanup The function to call when the pool is cleared * or destroyed - * @param child_cleanup The function to call when a child process is created - * @deffunc void apr_pool_cleanup_register(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)) + * @param child_cleanup The function to call when a child process is created - + * this function is called in the child, obviously! */ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)); /** - * remove a previously registered cleanup function + * Remove a previously registered cleanup function * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup - * @deffunc void apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *)) + * @remarks For some strange reason only the plain_cleanup is handled by this + * function */ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *)); /** - * Run the specified cleanup function immediately and unregister it + * Run the specified cleanup function immediately and unregister it. Use + * @a data instead of the data that was registered with the cleanup. * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup - * @deffunc apr_status_t apr_pool_cleanup_run(apr_pool_t *p, void *data, apr_status_t (*cleanup)(void *)) */ APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, apr_status_t (*cleanup)(void *)); @@ -375,14 +355,12 @@ APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, /** * Run all of the child_cleanups, so that any unnecessary files are * closed because we are about to exec a new program - * @deffunc void apr_pool_cleanup_for_exec(void) */ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); /** * An empty cleanup function * @param data The data to cleanup - * @deffunc apr_status_t apr_pool_cleanup_null(void *data) */ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); @@ -420,10 +398,10 @@ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); /* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t * will not be destroyed before the parent pool */ #ifndef APR_POOL_DEBUG -#ifdef apr_pool_join -#undef apr_pool_join -#endif /* apr_pool_join */ -#define apr_pool_join(a,b) +# ifdef apr_pool_join +# undef apr_pool_join +# endif /* apr_pool_join */ +# define apr_pool_join(a,b) #endif /* APR_POOL_DEBUG */ #ifdef __cplusplus diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 9a2f4dbf7d1..577f864277e 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -592,7 +592,7 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, } APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup) (void *)) + apr_status_t (*cleanup) (void *)) { struct cleanup *c; struct cleanup **lastp; diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 9a2f4dbf7d1..577f864277e 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -592,7 +592,7 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, } APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup) (void *)) + apr_status_t (*cleanup) (void *)) { struct cleanup *c; struct cleanup **lastp; From 48c134f1c30082fb3a2b51d08797266c62cd6527 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 14 Mar 2001 03:36:59 +0000 Subject: [PATCH 1370/7878] Fix a typo which made apr_setsockopt(APR_TCP_NOPUSH) fail (on Linux, at least) if APR_TCP_NODELAY was enabled for the socket. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61358 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 3b3d6d2883a..1b1bf7ce5be 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -249,7 +249,7 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o /* If we want to set NOPUSH then if we have the TCP_NODELAY * flag set we need to switch it off... */ - int tmpflag = 1; + int tmpflag = 0; if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void*)&tmpflag, sizeof(int)) == -1){ return errno; From 0ae4241ba10e130f67bfb84fb7ef52ecec9e5649 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 14 Mar 2001 04:03:59 +0000 Subject: [PATCH 1371/7878] Use the APR_TCP_NOPUSH socket option support in the Linux apr_sendfile() implementation. The goal is to remove an unnecessary call to getsockopt() to find the TCP_NODELAY setting. Submitted by: David Reid Reviewed by: Jeff Trawick (who mangled it slightly, so any bugs are his) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61359 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 90 +++++--------------------------------- 1 file changed, 10 insertions(+), 80 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index f452e4747c3..9c5ba0f7a21 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -57,14 +57,6 @@ #if APR_HAS_SENDFILE /* This file is needed to allow us access to the apr_file_t internals. */ #include "fileio.h" - -/* Glibc2.1.1 fails to define TCP_CORK. This is a bug that will be - *fixed in the next release. It should be 3 - */ -#if !defined(TCP_CORK) && defined(__linux__) -#define TCP_CORK 3 -#endif - #endif /* APR_HAS_SENDFILE */ static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) @@ -270,56 +262,6 @@ apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, } #endif -/* XXX - if we start using these elsewhere in this file we'll - * need to move these to the top... - */ - -#if APR_HAVE_CORKABLE_TCP && !defined(__FreeBSD__) - -/* TCP_CORK & TCP_NOPUSH keep us from sending partial frames when we - * shouldn't. They are however, mutually exclusive with TCP_NODELAY - */ - -static int os_cork(apr_socket_t *sock) -{ - int nodelay_off = 0, corkflag = 1, rv, delayflag; - apr_socklen_t delaylen = sizeof(delayflag); - - /* XXX it would be cheaper to use an apr_socket_t flag here */ - rv = getsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, - (void *) &delayflag, &delaylen); - if (rv == 0) { - if (delayflag != 0) { - /* turn off nodelay temporarily to allow cork */ - rv = setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, - (const void *) &nodelay_off, sizeof(nodelay_off)); - /* XXX nuke the rv checking once this is proven solid */ - if (rv < 0) { - return rv; - } - } - } - rv = setsockopt(sock->socketdes, IPPROTO_TCP, APR_TCP_NOPUSH_FLAG, - (const void *) &corkflag, sizeof(corkflag)); - return rv == 0 ? delayflag : rv; -} - -static int os_uncork(apr_socket_t *sock, int delayflag) -{ - /* Uncork to send queued frames */ - - int corkflag = 0, rv; - rv = setsockopt(sock->socketdes, IPPROTO_TCP, APR_TCP_NOPUSH_FLAG, - (const void *) &corkflag, sizeof(corkflag)); - if (rv == 0) { - /* restore TCP_NODELAY to its original setting */ - rv = setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, - (const void *) &delayflag, sizeof(delayflag)); - } - return rv; -} -#endif /* APR_HAVE_CORKABLE_TCP */ - #if APR_HAS_SENDFILE /* TODO: Verify that all platforms handle the fd the same way, @@ -337,7 +279,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_int32_t flags) { off_t off = *offset; - int rv, nbytes = 0, total_hdrbytes, i, delayflag = APR_EINIT, corked = 0; + int rv, nbytes = 0, total_hdrbytes, i; apr_status_t arv; if (!hdtr) { @@ -351,12 +293,10 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_int32_t hdrbytes; /* cork before writing headers */ - rv = os_cork(sock); - if (rv < 0) { - return errno; + rv = apr_setsocketopt(sock, APR_TCP_NOPUSH, 1); + if (rv != APR_SUCCESS) { + return rv; } - delayflag = rv; - corked = 1; /* Now write the headers */ arv = apr_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); @@ -376,7 +316,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, } if (hdrbytes < total_hdrbytes) { *len = hdrbytes; - return os_uncork(sock, delayflag); + return apr_setsocketopt(sock, APR_TCP_NOPUSH, 0); } } @@ -409,9 +349,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (rv == -1) { *len = nbytes; rv = errno; - if (corked) { - os_uncork(sock, delayflag); - } + apr_setsocketopt(sock, APR_TCP_NOPUSH, 0); return rv; } @@ -423,10 +361,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (rv < *len) { *len = nbytes; - if (corked) { - os_uncork(sock, delayflag); - } - return APR_SUCCESS; + return apr_setsocketopt(sock, APR_TCP_NOPUSH, 0); } /* Now write the footers */ @@ -437,18 +372,13 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (arv != APR_SUCCESS) { *len = nbytes; rv = errno; - if (corked) { - os_uncork(sock, delayflag); - } + apr_setsocketopt(sock, APR_TCP_NOPUSH, 0); return rv; } } - if (corked) { - /* if we corked, uncork & restore TCP_NODELAY setting */ - rv = os_uncork(sock, delayflag); - } - + apr_setsocketopt(sock, APR_TCP_NOPUSH, 0); + (*len) = nbytes; return rv < 0 ? errno : APR_SUCCESS; } From 623a3434ebcecb7d86c3967692e64e29900b434d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 14 Mar 2001 15:56:44 +0000 Subject: [PATCH 1372/7878] Get testthread to build and run appropriately when APR has no thread support. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61360 13f79535-47bb-0310-9956-ffa450edef68 --- test/testthread.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/testthread.c b/test/testthread.c index 852f2fa5de4..a17dd5cf507 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -62,6 +62,15 @@ #include #endif +#if !APR_HAS_THREADS +int main(void) +{ + fprintf(stderr, + "This program won't work on this platform because there is no " + "support for threads.\n"); + return 0; +} +#else /* !APR_HAS_THREADS */ void * APR_THREAD_FUNC thread_func1(void *data); void * APR_THREAD_FUNC thread_func2(void *data); @@ -175,3 +184,5 @@ int main(void) #endif return 1; } + +#endif /* !APR_HAS_THREADS */ From 8820adf7d6ad679df9c0468e787d18750044b9c7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 15 Mar 2001 18:28:04 +0000 Subject: [PATCH 1373/7878] Add apr_ipsubnet_create() and apr_ipsubnet_test() for testing whether or not an address is within a subnet. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61361 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + include/apr_errno.h | 10 +- include/apr_network_io.h | 33 ++++++ misc/unix/errorcodes.c | 4 + network_io/unix/sa_common.c | 231 ++++++++++++++++++++++++++++++++++++ test/.cvsignore | 2 + test/Makefile.in | 4 + test/testipsub.c | 220 ++++++++++++++++++++++++++++++++++ 8 files changed, 503 insertions(+), 4 deletions(-) create mode 100644 test/testipsub.c diff --git a/CHANGES b/CHANGES index c4c5ae0260a..0e256569f6c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Add apr_ipsubnet_create() and apr_ipsubnet_test() for testing + whether or not an address is within a subnet. [Jeff Trawick] + *) Add apr_sendto and apr_recvfrom for Unix. Start of adding UDP support. [David Reid] diff --git a/include/apr_errno.h b/include/apr_errno.h index fa5184ddaf3..148817a5817 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -177,6 +177,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * APR_EDSOOPEN APR was unable to open the dso object. For more * information call apr_dso_error(). * APR_EGENERAL General failure (specific information not available) + * APR_EBADIP The specified IP address is invalid + * APR_EBADMASK The specified netmask is invalid * * *

    @@ -232,8 +234,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_ENOTHDKEY      (APR_OS_START_ERROR + 13)
     #define APR_EGENERAL       (APR_OS_START_ERROR + 14)
     #define APR_ENOSHMAVAIL    (APR_OS_START_ERROR + 15)
    -/* empty slot: +16 */
    -/* empty slot: +17 */
    +#define APR_EBADIP         (APR_OS_START_ERROR + 16)
    +#define APR_EBADMASK       (APR_OS_START_ERROR + 17)
     /* empty slot: +18 */
     #define APR_EDSOOPEN       (APR_OS_START_ERROR + 19)
     
    @@ -254,8 +256,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_ENOTHDKEY(s)      ((s) == APR_ENOTHDKEY)
     #define APR_STATUS_IS_EGENERAL(s)       ((s) == APR_EGENERAL)
     #define APR_STATUS_IS_ENOSHMAVAIL(s)    ((s) == APR_ENOSHMAVAIL)
    -/* empty slot: +16 */
    -/* empty slot: +17 */
    +#define APR_STATUS_IS_EBADIP(s)         ((s) == APR_EBADIP)
    +#define APR_STATUS_IS_EBADMASK(s)       ((s) == APR_EBADMASK)
     /* empty slot: +18 */
     #define APR_STATUS_IS_EDSOOPEN(s)       ((s) == APR_EDSOOPEN)
     
    diff --git a/include/apr_network_io.h b/include/apr_network_io.h
    index 585d642452c..aecd41c446d 100644
    --- a/include/apr_network_io.h
    +++ b/include/apr_network_io.h
    @@ -218,6 +218,19 @@ struct apr_hdtr_t {
         int numtrailers;
     };
     
    +/** A structure to represent an IP subnet */
    +typedef struct apr_ipsubnet_t apr_ipsubnet_t;
    +struct apr_ipsubnet_t {
    +    int family;
    +#if APR_HAVE_IPV6
    +    apr_uint32_t sub[4]; /* big enough for IPv4 and IPv6 addresses */
    +    apr_uint32_t mask[4];
    +#else
    +    apr_uint32_t sub[1];
    +    apr_uint32_t mask[1];
    +#endif
    +};
    +
     /* function definitions */
     
     /**
    @@ -754,6 +767,26 @@ APR_DECLARE(apr_status_t) apr_socket_from_file(apr_socket_t **newsock,
     APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, 
                                                 const char *servname);
     
    +/**
    + * Build an ip-subnet representation from an IP address and optional netmask or
    + * number-of-bits.
    + * @param ipsub The new ip-subnet representation
    + * @param ipstr The input IP address string
    + * @param mask_or_numbits The input netmask or number-of-bits string, or NULL
    + * @param p The pool to allocate from
    + */
    +APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char *ipstr, 
    +                                              const char *mask_or_numbits, apr_pool_t *p);
    +
    +/**
    + * Test the IP address in an apr_sockaddr_t against a pre-built ip-subnet
    + * representation.
    + * @param ipsub The ip-subnet representation
    + * @param sa The socket address to test
    + * @return non-zero if the socket address is within the subnet, 0 otherwise
    + */
    +APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa);
    +
     #ifdef __cplusplus
     }
     #endif
    diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c
    index 5a7fcf6c657..adc6395c7ea 100644
    --- a/misc/unix/errorcodes.c
    +++ b/misc/unix/errorcodes.c
    @@ -111,6 +111,10 @@ static char *apr_error_string(apr_status_t statcode)
             return "DSO load failed";
     #endif /* HAVE_LIBDL */
     #endif /* APR_HAS_DSO */
    +    case APR_EBADIP:
    +        return "The specified IP address is invalid.";
    +    case APR_EBADMASK:
    +        return "The specified network mask is invalid.";
         case APR_INCHILD:
             return
     	    "Your code just forked, and you are currently executing in the "
    diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c
    index f84ce52ac28..6d9389944f3 100644
    --- a/network_io/unix/sa_common.c
    +++ b/network_io/unix/sa_common.c
    @@ -498,3 +498,234 @@ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr,
         return errno;
     }
     
    +static apr_status_t parse_network(apr_ipsubnet_t *ipsub, const char *network)
    +{
    +    /* legacy syntax for ip addrs: a.b.c. ==> a.b.c.0/24 for example */
    +    int shift;
    +    char *s, *t;
    +    int octet;
    +    char buf[sizeof "255.255.255.255"];
    +
    +    if (strlen(network) < sizeof buf) {
    +        strcpy(buf, network);
    +    }
    +    else {
    +        return APR_EBADIP;
    +    }
    +
    +    /* parse components */
    +    s = buf;
    +    ipsub->sub[0] = 0;
    +    ipsub->mask[0] = 0;
    +    shift = 24;
    +    while (*s) {
    +        t = s;
    +        if (!apr_isdigit(*t)) {
    +            return APR_EBADIP;
    +        }
    +        while (apr_isdigit(*t)) {
    +            ++t;
    +        }
    +        if (*t == '.') {
    +            *t++ = 0;
    +        }
    +        else if (*t) {
    +            return APR_EBADIP;
    +        }
    +        if (shift < 0) {
    +            return APR_EBADIP;
    +        }
    +        octet = atoi(s);
    +        if (octet < 0 || octet > 255) {
    +            return APR_EBADIP;
    +        }
    +        ipsub->sub[0] |= octet << shift;
    +        ipsub->mask[0] |= 0xFFUL << shift;
    +        s = t;
    +        shift -= 8;
    +    }
    +    ipsub->sub[0] = ntohl(ipsub->sub[0]);
    +    ipsub->mask[0] = ntohl(ipsub->mask[0]);
    +    ipsub->family = AF_INET;
    +    return APR_SUCCESS;
    +}
    +
    +/* return values:
    + * APR_EINVAL     not an IP address; caller should see if it is something else
    + * APR_BADIP      IP address portion is is not valid
    + * APR_BADMASK    mask portion is not valid
    + */
    +
    +static apr_status_t parse_ip(apr_ipsubnet_t *ipsub, const char *ipstr, int network_allowed)
    +{
    +    /* supported flavors of IP:
    +     *
    +     * . IPv6 numeric address string (e.g., "fe80::1")
    +     *
    +     * . IPv4 numeric address string (e.g., "127.0.0.1")
    +     *
    +     * . IPv4 network string (e.g., "9.67")
    +     *
    +     *   IMPORTANT: This network form is only allowed if network_allowed is on.
    +     */
    +    int rc;
    +
    +#if APR_HAVE_IPV6
    +    rc = apr_inet_pton(AF_INET6, ipstr, ipsub->sub);
    +    if (rc == 1) {
    +        ipsub->family = AF_INET6;
    +    }
    +    else
    +#endif
    +    {
    +        rc = apr_inet_pton(AF_INET, ipstr, ipsub->sub);
    +        if (rc == 1) {
    +            if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)ipsub->sub)) {
    +                /* apr_ipsubnet_test() assumes that we don't create IPv4-mapped IPv6
    +                 * addresses; this of course forces the user to specify IPv4 addresses
    +                 * in a.b.c.d style instead of ::ffff:a.b.c.d style.
    +                 */
    +                return APR_EBADIP;
    +            }
    +            ipsub->family = AF_INET;
    +        }
    +    }
    +    if (rc != 1) {
    +        if (network_allowed) {
    +            return parse_network(ipsub, ipstr);
    +        }
    +        else {
    +            return APR_EBADIP;
    +        }
    +    }
    +    return APR_SUCCESS;
    +}
    +
    +static int looks_like_ip(const char *ipstr)
    +{
    +    if (strchr(ipstr, ':')) {
    +        /* definitely not a hostname; assume it is intended to be an IPv6 address */
    +        return 1;
    +    }
    +
    +    /* simple IPv4 address string check */
    +    while ((*ipstr == '.') || apr_isdigit(*ipstr))
    +        ipstr++;
    +    return (*ipstr == '\0');
    +}
    +
    +static void fix_subnet(apr_ipsubnet_t *ipsub)
    +{
    +    /* in case caller specified more bits in network address than are
    +     * valid according to the mask, turn off the extra bits
    +     */
    +    int i;
    +
    +    for (i = 0; i < sizeof ipsub->mask / sizeof(apr_int32_t); i++) {
    +        ipsub->sub[i] &= ipsub->mask[i];
    +    }
    +}
    +
    +/* be sure not to store any IPv4 address as a v4-mapped IPv6 address */
    +APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char *ipstr, 
    +                                              const char *mask_or_numbits, apr_pool_t *p)
    +{
    +    apr_status_t rv;
    +    char *endptr;
    +    long bits, maxbits;
    +
    +    /* filter out stuff which doesn't look remotely like an IP address; this helps 
    +     * callers like mod_access which have a syntax allowing hostname or IP address;
    +     * APR_EINVAL tells the caller that it was probably not intended to be an IP
    +     * address
    +     */
    +    if (!looks_like_ip(ipstr)) {
    +        return APR_EINVAL;
    +    }
    +
    +    *ipsub = apr_pcalloc(p, sizeof(apr_ipsubnet_t));
    +
    +    /* assume ipstr is an individual IP address, not a subnet */
    +    memset((*ipsub)->mask, 0xFF, sizeof (*ipsub)->mask);
    +
    +    rv = parse_ip(*ipsub, ipstr, mask_or_numbits == NULL);
    +    if (rv != APR_SUCCESS) {
    +        return rv;
    +    }
    +
    +    if (mask_or_numbits) {
    +        if ((*ipsub)->family == AF_INET) {
    +            maxbits = 32;
    +        }
    +#if APR_HAVE_IPV6
    +        else {
    +            maxbits = 128;
    +        }
    +#endif
    +        bits = strtol(mask_or_numbits, &endptr, 10);
    +        if (*endptr == '\0' && bits > 0 && bits <= maxbits) {
    +            /* valid num-bits string; fill in mask appropriately */
    +            int cur_entry = 0;
    +            apr_int32_t cur_bit_value;
    +
    +            memset((*ipsub)->mask, 0, sizeof (*ipsub)->mask);
    +            while (bits > 32) {
    +                (*ipsub)->mask[cur_entry] = 0xFFFFFFFF; /* all 32 bits */
    +                bits -= 32;
    +                ++cur_entry;
    +            }
    +            cur_bit_value = 0x80000000;
    +            while (bits) {
    +                (*ipsub)->mask[cur_entry] |= cur_bit_value;
    +                --bits;
    +                cur_bit_value /= 2;
    +            }
    +            (*ipsub)->mask[cur_entry] = htonl((*ipsub)->mask[cur_entry]);
    +        }
    +        else if (apr_inet_pton(AF_INET, mask_or_numbits, (*ipsub)->mask) == 1 &&
    +            (*ipsub)->family == AF_INET) {
    +            /* valid IPv4 netmask */
    +        }
    +        else {
    +            return APR_EBADMASK;
    +        }
    +    }
    +
    +    fix_subnet(*ipsub);
    +
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa)
    +{
    +#if APR_HAVE_IPV6
    +    if (sa->sa.sin.sin_family == AF_INET) {
    +        if (ipsub->family == AF_INET &&
    +            ((sa->sa.sin.sin_addr.s_addr & ipsub->mask[0]) == ipsub->sub[0])) {
    +            return 1;
    +        }
    +    }
    +    else if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sa->ipaddr_ptr)) {
    +        if (ipsub->family == AF_INET &&
    +            (((apr_uint32_t *)sa->ipaddr_ptr)[3] & ipsub->mask[0]) == ipsub->sub[0]) {
    +            return 1;
    +        }
    +    }
    +    else {
    +        apr_uint32_t *addr = (apr_uint32_t *)sa->ipaddr_ptr;
    +
    +        if ((addr[0] & ipsub->mask[0]) == ipsub->sub[0] &&
    +            (addr[1] & ipsub->mask[1]) == ipsub->sub[1] &&
    +            (addr[2] & ipsub->mask[2]) == ipsub->sub[2] &&
    +            (addr[3] & ipsub->mask[3]) == ipsub->sub[3]) {
    +            return 1;
    +        }
    +    }
    +#else
    +    if ((sa->sa.sin.sin_addr.s_addr & ipsub->mask[0]) == ipsub->sub[0]) {
    +        return 1;
    +    }
    +#endif /* APR_HAVE_IPV6 */
    +    return 0; /* no match */
    +}
    +
    diff --git a/test/.cvsignore b/test/.cvsignore
    index a2faf05d0ca..ba4cd740767 100644
    --- a/test/.cvsignore
    +++ b/test/.cvsignore
    @@ -28,3 +28,5 @@ testsuite.ncb
     testfile.tmp
     testflock
     testsockopt
    +testipsub
    +
    diff --git a/test/Makefile.in b/test/Makefile.in
    index 1be7055ac12..e4866e800d5 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -18,6 +18,7 @@ PROGRAMS = \
     	testoc@EXEEXT@ \
     	testuuid@EXEEXT@ \
             testsockopt@EXEEXT@ \
    +        testipsub@EXEEXT@ \
     	occhild@EXEEXT@ \
     	mod_test.so
     
    @@ -97,4 +98,7 @@ testuuid@EXEEXT@: testuuid.lo ../libapr.la
     testsockopt@EXEEXT@: testsockopt.lo ../libapr.la
     	$(LINK) testsockopt.lo $(ALL_LIBS)
     
    +testipsub@EXEEXT@: testipsub.lo ../libapr.la
    +	$(LINK) testipsub.lo $(ALL_LIBS)
    +
     # DO NOT REMOVE
    diff --git a/test/testipsub.c b/test/testipsub.c
    new file mode 100644
    index 00000000000..a8477f38309
    --- /dev/null
    +++ b/test/testipsub.c
    @@ -0,0 +1,220 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +#include 
    +#include 
    +
    +#include "apr_general.h"
    +#include "apr_network_io.h"
    +#include "apr_errno.h"
    +
    +static void closeapr(void)
    +{
    +    apr_terminate();
    +}
    +
    +static void test_bad_input(apr_pool_t *p)
    +{
    +    struct {
    +        const char *ipstr;
    +        const char *mask;
    +        apr_status_t expected_rv;
    +    } testcases[] =
    +    {
    +        /* so we have a few good inputs in here; sue me */
    +        {"my.host.name",       NULL,               APR_EINVAL}
    +        ,{"127.0.0.256",       NULL,               APR_EBADIP}
    +        ,{"127.0.0.1",         NULL,               APR_SUCCESS}
    +        ,{"127.0.0.1",         "32",               APR_SUCCESS}
    +        ,{"127.0.0.1",         "1",                APR_SUCCESS}
    +        ,{"127.0.0.1",         "15",               APR_SUCCESS}
    +        ,{"127.0.0.1",         "-1",               APR_EBADMASK}
    +        ,{"127.0.0.1",         "0",                APR_EBADMASK}
    +        ,{"127.0.0.1",         "33",               APR_EBADMASK}
    +        ,{"127.0.0.1",         "255.0.0.0",        APR_SUCCESS}
    +        ,{"127.0.0.1",         "255.0",            APR_EBADMASK}
    +        ,{"127.0.0.1",         "255.255.256.0",    APR_EBADMASK}
    +        ,{"127.0.0.1",         "abc",              APR_EBADMASK}
    +        ,{"127",               NULL,               APR_SUCCESS}
    +        ,{"127.0.0.1.2",       NULL,               APR_EBADIP}
    +        ,{"127.0.0.1.2",       "8",                APR_EBADIP}
    +        ,{"127",               "255.0.0.0",        APR_EBADIP} /* either EBADIP or EBADMASK seems fine */
    +#if APR_HAVE_IPV6
    +        ,{"::1",               NULL,               APR_SUCCESS}
    +        ,{"::1",               "20",               APR_SUCCESS}
    +        ,{"fe80::",            "16",               APR_SUCCESS}
    +        ,{"fe80::",            "255.0.0.0",        APR_EBADMASK}
    +        ,{"fe80::1",           "0",                APR_EBADMASK}
    +        ,{"fe80::1",           "-1",               APR_EBADMASK}
    +        ,{"fe80::1",           "1",                APR_SUCCESS}
    +        ,{"fe80::1",           "33",               APR_SUCCESS}
    +        ,{"fe80::1",           "128",              APR_SUCCESS}
    +        ,{"fe80::1",           "129",              APR_EBADMASK}
    +#else
    +        /* do some IPv6 stuff and verify that it fails with APR_EBADIP */
    +#endif
    +    };
    +    int i;
    +    apr_ipsubnet_t *ipsub;
    +    apr_status_t rv;
    +
    +    for (i = 0; i < (sizeof testcases / sizeof testcases[0]); i++) {
    +        rv = apr_ipsubnet_create(&ipsub, testcases[i].ipstr, testcases[i].mask, p);
    +        assert(rv == testcases[i].expected_rv);
    +    }
    +}
    +
    +static void test_singleton_subnets(apr_pool_t *p)
    +{
    +    const char *v4addrs[] = {
    +        "127.0.0.1", "129.42.18.99", "63.161.155.20", "207.46.230.229", "64.208.42.36",
    +        "198.144.203.195", "192.18.97.241", "198.137.240.91", "62.156.179.119", 
    +        "204.177.92.181"
    +    };
    +    apr_ipsubnet_t *ipsub;
    +    apr_sockaddr_t *sa;
    +    apr_status_t rv;
    +    int i, j, rc;
    +
    +    for (i = 0; i < sizeof v4addrs / sizeof v4addrs[0]; i++) {
    +        rv = apr_ipsubnet_create(&ipsub, v4addrs[i], NULL, p);
    +        assert(rv == APR_SUCCESS);
    +        for (j = 0; j < sizeof v4addrs / sizeof v4addrs[0]; j++) {
    +            rv = apr_sockaddr_info_get(&sa, v4addrs[j], APR_INET, 0, 0, p);
    +            assert(rv == APR_SUCCESS);
    +            rc = apr_ipsubnet_test(ipsub, sa);
    +            if (!strcmp(v4addrs[i], v4addrs[j])) {
    +                assert(rc != 0);
    +            }
    +            else {
    +                assert(rc == 0);
    +            }
    +        }
    +    }
    +
    +    /* same for v6? */
    +}
    +
    +static void test_interesting_subnets(apr_pool_t *p)
    +{
    +    struct {
    +        const char *ipstr, *mask;
    +        int family;
    +        char *in_subnet, *not_in_subnet;
    +    } testcases[] =
    +    {
    +        {"9.67",              NULL,            APR_INET,  "9.67.113.15",         "10.1.2.3"}
    +        ,{"9.67.0.0",         "16",            APR_INET,  "9.67.113.15",         "10.1.2.3"}
    +        ,{"9.67.0.0",         "255.255.0.0",   APR_INET,  "9.67.113.15",         "10.1.2.3"}
    +        ,{"9.67.113.99",      "16",            APR_INET,  "9.67.113.15",         "10.1.2.3"}
    +        ,{"9.67.113.99",      "255.255.255.0", APR_INET,  "9.67.113.15",         "10.1.2.3"}
    +#if APR_HAVE_IPV6
    +        ,{"fe80::",           "8",             APR_INET6, "fe80::1",             "ff01::1"}
    +        ,{"ff01::",           "8",             APR_INET6, "ff01::1",             "fe80::1"}
    +        ,{"3FFE:8160::",      "28",            APR_INET6, "3ffE:816e:abcd:1234::1", "3ffe:8170::1"}
    +#endif
    +    };
    +    apr_ipsubnet_t *ipsub;
    +    apr_sockaddr_t *sa;
    +    apr_status_t rv;
    +    int i, rc;
    +
    +    for (i = 0; i < sizeof testcases / sizeof testcases[0]; i++) {
    +        rv = apr_ipsubnet_create(&ipsub, testcases[i].ipstr, testcases[i].mask, p);
    +        assert(rv == APR_SUCCESS);
    +        rv = apr_sockaddr_info_get(&sa, testcases[i].in_subnet, testcases[i].family, 0, 0, p);
    +        assert(rv == APR_SUCCESS);
    +        rc = apr_ipsubnet_test(ipsub, sa);
    +        assert(rc != 0);
    +        rv = apr_sockaddr_info_get(&sa, testcases[i].not_in_subnet, testcases[i].family, 0, 0, p);
    +        assert(rv == APR_SUCCESS);
    +        rc = apr_ipsubnet_test(ipsub, sa);
    +        assert(rc == 0);
    +    }
    +}
    +
    +int main(void)
    +{
    +    apr_status_t rv;
    +    apr_pool_t *p;
    +    char buf[128];
    +
    +    rv = apr_initialize();
    +    if (rv != APR_SUCCESS) {
    +        fprintf(stderr, "apr_initialize()->%d/%s\n",
    +                rv,
    +                apr_strerror(rv, buf, sizeof buf));
    +        exit(1);
    +    }
    +
    +    atexit(closeapr);
    +
    +    rv = apr_pool_create(&p, NULL);
    +    if (rv != APR_SUCCESS) {
    +        fprintf(stderr, "apr_pool_create()->%d/%s\n",
    +                rv,
    +                apr_strerror(rv, buf, sizeof buf));
    +        exit(1);
    +    }
    +
    +    test_bad_input(p);
    +    test_singleton_subnets(p);
    +    test_interesting_subnets(p);
    +
    +    printf("error strings:\n");
    +    printf("\tAPR_EBADIP\t`%s'\n", apr_strerror(APR_EBADIP, buf, sizeof buf));
    +    printf("\tAPR_EBADMASK\t`%s'\n", apr_strerror(APR_EBADMASK, buf, sizeof buf));
    +
    +    return 0;
    +}
    
    From c47156a0932008478e330d6dcadd2bcbd68a1b60 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 15 Mar 2001 19:31:53 +0000
    Subject: [PATCH 1374/7878] mention a getaddrinfo() usage problem
    
    It is probably raining outside.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61362 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/STATUS b/STATUS
    index e84f8985e5c..5b619fb0c5b 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -1,5 +1,5 @@
     APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS:			-*-text-*-
    -Last modified at [$Date: 2001/03/07 17:57:11 $]
    +Last modified at [$Date: 2001/03/15 19:31:53 $]
     
     Release:
     
    @@ -24,6 +24,10 @@ RELEASE SHOWSTOPPERS:
     
     RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
     
    +    * Unconditionally setting AI_CANONNAME flag when apr_sockaddr_info_get()
    +      calls getaddrinfo() is bogus and causes undesired DNS requests.
    +        Status: Jeff will look into this
    +
         * Solve Win32 APR_CHR, APR_BLK, etc for Win32 apr_stat without 
             GetFileType?  How about inode/dev/nlink?
             Status: Will's WIP
    
    From c3106260688dcff912f66cd2a2f0973a1c42339c Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 15 Mar 2001 19:43:52 +0000
    Subject: [PATCH 1375/7878] fix some "issues" with IPv4-mapped IPv6 addresses
     in apr_ipsubnet_*()
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61363 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sa_common.c | 16 +++++++++-------
     test/testipsub.c            |  4 ++++
     2 files changed, 13 insertions(+), 7 deletions(-)
    
    diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c
    index 6d9389944f3..7720848eebd 100644
    --- a/network_io/unix/sa_common.c
    +++ b/network_io/unix/sa_common.c
    @@ -561,6 +561,8 @@ static apr_status_t parse_ip(apr_ipsubnet_t *ipsub, const char *ipstr, int netwo
         /* supported flavors of IP:
          *
          * . IPv6 numeric address string (e.g., "fe80::1")
    +     * 
    +     *   IMPORTANT: Don't store IPv4-mapped IPv6 address as an IPv6 address.
          *
          * . IPv4 numeric address string (e.g., "127.0.0.1")
          *
    @@ -573,6 +575,13 @@ static apr_status_t parse_ip(apr_ipsubnet_t *ipsub, const char *ipstr, int netwo
     #if APR_HAVE_IPV6
         rc = apr_inet_pton(AF_INET6, ipstr, ipsub->sub);
         if (rc == 1) {
    +        if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)ipsub->sub)) {
    +            /* apr_ipsubnet_test() assumes that we don't create IPv4-mapped IPv6
    +             * addresses; this of course forces the user to specify IPv4 addresses
    +             * in a.b.c.d style instead of ::ffff:a.b.c.d style.
    +             */
    +            return APR_EBADIP;
    +        }
             ipsub->family = AF_INET6;
         }
         else
    @@ -580,13 +589,6 @@ static apr_status_t parse_ip(apr_ipsubnet_t *ipsub, const char *ipstr, int netwo
         {
             rc = apr_inet_pton(AF_INET, ipstr, ipsub->sub);
             if (rc == 1) {
    -            if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)ipsub->sub)) {
    -                /* apr_ipsubnet_test() assumes that we don't create IPv4-mapped IPv6
    -                 * addresses; this of course forces the user to specify IPv4 addresses
    -                 * in a.b.c.d style instead of ::ffff:a.b.c.d style.
    -                 */
    -                return APR_EBADIP;
    -            }
                 ipsub->family = AF_INET;
             }
         }
    diff --git a/test/testipsub.c b/test/testipsub.c
    index a8477f38309..3390d9aabd3 100644
    --- a/test/testipsub.c
    +++ b/test/testipsub.c
    @@ -93,6 +93,7 @@ static void test_bad_input(apr_pool_t *p)
     #if APR_HAVE_IPV6
             ,{"::1",               NULL,               APR_SUCCESS}
             ,{"::1",               "20",               APR_SUCCESS}
    +        ,{"::ffff:9.67.113.15", NULL,              APR_EBADIP} /* yes, this is goodness */
             ,{"fe80::",            "16",               APR_SUCCESS}
             ,{"fe80::",            "255.0.0.0",        APR_EBADMASK}
             ,{"fe80::1",           "0",                APR_EBADMASK}
    @@ -103,6 +104,7 @@ static void test_bad_input(apr_pool_t *p)
             ,{"fe80::1",           "129",              APR_EBADMASK}
     #else
             /* do some IPv6 stuff and verify that it fails with APR_EBADIP */
    +        ,{"::ffff:9.67.113.15", NULL,              APR_EBADIP}
     #endif
         };
         int i;
    @@ -163,6 +165,8 @@ static void test_interesting_subnets(apr_pool_t *p)
             ,{"fe80::",           "8",             APR_INET6, "fe80::1",             "ff01::1"}
             ,{"ff01::",           "8",             APR_INET6, "ff01::1",             "fe80::1"}
             ,{"3FFE:8160::",      "28",            APR_INET6, "3ffE:816e:abcd:1234::1", "3ffe:8170::1"}
    +        ,{"127.0.0.1",        NULL,            APR_INET6, "::ffff:127.0.0.1",    "fe80::1"}
    +        ,{"127.0.0.1",        "8",             APR_INET6, "::ffff:127.0.0.1",    "fe80::1"}
     #endif
         };
         apr_ipsubnet_t *ipsub;
    
    From cc0d86fe1f0436ce71e5a6baf4e7af62eafcf440 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 15 Mar 2001 21:54:59 +0000
    Subject: [PATCH 1376/7878] Get rid of a warning about using maxbits
     uninitialized (the compiler didn't realize we'd already checked the family)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61364 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sa_common.c | 7 ++-----
     1 file changed, 2 insertions(+), 5 deletions(-)
    
    diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c
    index 7720848eebd..b823a91fb65 100644
    --- a/network_io/unix/sa_common.c
    +++ b/network_io/unix/sa_common.c
    @@ -634,7 +634,7 @@ APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char
     {
         apr_status_t rv;
         char *endptr;
    -    long bits, maxbits;
    +    long bits, maxbits = 32;
     
         /* filter out stuff which doesn't look remotely like an IP address; this helps 
          * callers like mod_access which have a syntax allowing hostname or IP address;
    @@ -656,11 +656,8 @@ APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char
         }
     
         if (mask_or_numbits) {
    -        if ((*ipsub)->family == AF_INET) {
    -            maxbits = 32;
    -        }
     #if APR_HAVE_IPV6
    -        else {
    +        if ((*ipsub)->family == AF_INET6) {
                 maxbits = 128;
             }
     #endif
    
    From a59a03c7d8d6216593cdd2c88a3d0cdf61700f47 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 16 Mar 2001 03:22:04 +0000
    Subject: [PATCH 1377/7878] build inet_pton.c on Win32
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61365 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr.dsp                     | 4 ++++
     libapr.dsp                  | 4 ++++
     network_io/unix/inet_pton.c | 4 ++++
     3 files changed, 12 insertions(+)
    
    diff --git a/apr.dsp b/apr.dsp
    index 2fb1ed25e6f..645e5adcb29 100644
    --- a/apr.dsp
    +++ b/apr.dsp
    @@ -267,6 +267,10 @@ SOURCE=.\network_io\unix\inet_ntop.c
     # End Source File
     # Begin Source File
     
    +SOURCE=.\network_io\unix\inet_pton.c
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\arch\win32\networkio.h
     # End Source File
     # Begin Source File
    diff --git a/libapr.dsp b/libapr.dsp
    index be61aca054e..2ddf3e73fd4 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -272,6 +272,10 @@ SOURCE=.\network_io\unix\inet_ntop.c
     # End Source File
     # Begin Source File
     
    +SOURCE=.\network_io\unix\inet_pton.c
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\arch\win32\networkio.h
     # End Source File
     # Begin Source File
    diff --git a/network_io/unix/inet_pton.c b/network_io/unix/inet_pton.c
    index 4a7613307e2..9524e87cd5b 100644
    --- a/network_io/unix/inet_pton.c
    +++ b/network_io/unix/inet_pton.c
    @@ -48,6 +48,10 @@
     #define __P(x) x
     #endif
     
    +#if !defined(EAFNOSUPPORT) && defined(WSAEAFNOSUPPORT)
    +#define EAFNOSUPPORT WSAEAFNOSUPPORT
    +#endif
    +
     /*
      * WARNING: Don't even consider trying to compile this on a system where
      * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
    
    From 475d7ca7dc3cb8ae6be79e24576554b5b33ad74d Mon Sep 17 00:00:00 2001
    From: Ben Laurie 
    Date: Sat, 17 Mar 2001 15:58:10 +0000
    Subject: [PATCH 1378/7878] More doxygenation.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61366 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h   | 3 ++-
     include/apr_file_io.h | 1 +
     2 files changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 148817a5817..9b6b8ef1bdd 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -66,7 +66,8 @@ extern "C" {
     #endif /* __cplusplus */
     
     /**
    - * @package Error Codes
    + * @file apr_errno.h
    + * @brief Error Codes
      */
     
     /**
    diff --git a/include/apr_file_io.h b/include/apr_file_io.h
    index b9067f3defb..5b8c8ddc22f 100644
    --- a/include/apr_file_io.h
    +++ b/include/apr_file_io.h
    @@ -379,6 +379,7 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file,
      *            APR_SET  --  set the offset to offset
      *            APR_CUR  --  add the offset to the current position 
      *            APR_END  --  add the offset to the current file size 
    + * 
    * @param offset The offset to move the pointer to. * @tip The third argument is modified to be the offset the pointer was actually moved to. From 79ef5c5098eba91d9bd250cfac697d9441fa26df Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 19 Mar 2001 12:35:16 +0000 Subject: [PATCH 1379/7878] OS/2: add an assortment of misc helper functions that were missing so exports.c can safely be linked in. There's also a few stub functions returning APR_ENOTIMPL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61367 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/dir.c | 20 ++++++++++ locks/os2/locks.c | 40 +++++++++++++++++++ network_io/os2/Makefile.in | 1 + network_io/os2/poll.c | 26 +++++++++++++ network_io/os2/sendrecv_udp.c | 73 +++++++++++++++++++++++++++++++++++ threadproc/os2/proc.c | 7 ++++ threadproc/os2/thread.c | 36 +++++++++++++++++ threadproc/os2/threadpriv.c | 33 ++++++++++++++++ 8 files changed, 236 insertions(+) create mode 100644 network_io/os2/sendrecv_udp.c diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index ae7c2c62630..12d5679e7af 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -56,6 +56,7 @@ #include "apr_file_io.h" #include "apr_lib.h" #include "apr_strings.h" +#include "apr_portable.h" #include static apr_status_t dir_cleanup(void *thedir) @@ -181,5 +182,24 @@ apr_status_t apr_dir_remove(const char *path, apr_pool_t *cont) +apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) +{ + if (dir == NULL) { + return APR_ENODIR; + } + *thedir = &dir->handle; + return APR_SUCCESS; +} + +apr_status_t apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, + apr_pool_t *cont) +{ + if ((*dir) == NULL) { + (*dir) = (apr_dir_t *)apr_pcalloc(cont, sizeof(apr_dir_t)); + (*dir)->cntxt = cont; + } + (*dir)->handle = *thedir; + return APR_SUCCESS; +} diff --git a/locks/os2/locks.c b/locks/os2/locks.c index 15d72127332..9e08a426c74 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -55,6 +55,7 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" +#include "apr_portable.h" #include "locks.h" #include "fileio.h" #include @@ -187,3 +188,42 @@ apr_status_t apr_lock_destroy(apr_lock_t *lock) return APR_OS2_STATUS(rc); } + + + +apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) +{ + *oslock = lock->hMutex; + return APR_SUCCESS; +} + + + +apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, + apr_pool_t *cont) +{ + if (cont == NULL) { + return APR_ENOPOOL; + } + if ((*lock) == NULL) { + (*lock) = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t)); + (*lock)->cntxt = cont; + } + (*lock)->hMutex = *thelock; + return APR_SUCCESS; +} + + + +apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) +{ + return apr_pool_userdata_get(data, key, lock->cntxt); +} + + + +apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) +{ + return apr_pool_userdata_set(data, key, cleanup, lock->cntxt); +} diff --git a/network_io/os2/Makefile.in b/network_io/os2/Makefile.in index 543a36e158d..5737cd7bfc6 100644 --- a/network_io/os2/Makefile.in +++ b/network_io/os2/Makefile.in @@ -2,6 +2,7 @@ TARGETS = \ poll.lo \ sendrecv.lo \ + sendrecv_udp.lo \ sockets.lo \ sockopt.lo \ sockaddr.lo \ diff --git a/network_io/os2/poll.c b/network_io/os2/poll.c index f8925359759..55e2f01753b 100644 --- a/network_io/os2/poll.c +++ b/network_io/os2/poll.c @@ -222,3 +222,29 @@ apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { return apr_poll_socket_mask(aprset, sock, APR_POLLIN|APR_POLLOUT|APR_POLLPRI); } + + + +apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) +{ + aprset->num_read = 0; + aprset->num_write = 0; + aprset->num_except = 0; + aprset->num_total = 0; + return APR_SUCCESS; +} + + + +apr_status_t apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) +{ + return apr_pool_userdata_get(data, key, pollfd->cntxt); +} + + + +apr_status_t apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, + apr_status_t (*cleanup) (void *)) +{ + return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt); +} diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c new file mode 100644 index 00000000000..a2b0b046b01 --- /dev/null +++ b/network_io/os2/sendrecv_udp.c @@ -0,0 +1,73 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "networkio.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_network_io.h" +#include "apr_lib.h" +#include + +apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, apr_size_t *len) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, + apr_int32_t flags, char *buf, + apr_size_t *len) +{ + return APR_ENOTIMPL; +} diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index f5edca8cd39..9b406164847 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -554,3 +554,10 @@ apr_status_t apr_get_os_proc(apr_os_proc_t *theproc, apr_proc_t *proc) *theproc = proc->pid; return APR_SUCCESS; } + + + +apr_status_t apr_proc_detach() +{ + return APR_ENOTIMPL; +} diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 4bc6d8c4fa7..aa85f43f16e 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -58,6 +58,7 @@ #include "apr_thread_proc.h" #include "apr_general.h" #include "apr_lib.h" +#include "apr_portable.h" #include "fileio.h" #include @@ -182,3 +183,38 @@ apr_status_t apr_thread_detach(apr_thread_t *thd) } + +apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) +{ + *thethd = &thd->tid; + return APR_SUCCESS; +} + + + +apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, + apr_pool_t *cont) +{ + if ((*thd) == NULL) { + (*thd) = (apr_thread_t *)apr_pcalloc(cont, sizeof(apr_thread_t)); + (*thd)->cntxt = cont; + } + (*thd)->tid = *thethd; + return APR_SUCCESS; +} + + + +apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) +{ + return apr_pool_userdata_get(data, key, thread->cntxt); +} + + + +apr_status_t apr_thread_data_set(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread) +{ + return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); +} diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index da3989fddf0..5a93765e4dd 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -54,6 +54,7 @@ #include "threadproc.h" #include "apr_thread_proc.h" +#include "apr_portable.h" #include "apr_general.h" #include "apr_errno.h" #include "apr_lib.h" @@ -89,3 +90,35 @@ apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) return APR_OS2_STATUS(DosFreeThreadLocalMemory(key->key)); } +apr_status_t apr_threadkey_data_get(void **data, const char *key, + apr_threadkey_t *threadkey) +{ + return apr_pool_userdata_get(data, key, threadkey->cntxt); +} + +apr_status_t apr_threadkey_data_set(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey) +{ + return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); +} + +apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +{ + *thekey = key->key; + return APR_SUCCESS; +} + +apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, apr_pool_t *cont) +{ + if (cont == NULL) { + return APR_ENOPOOL; + } + if ((*key) == NULL) { + (*key) = (apr_threadkey_t *)apr_pcalloc(cont, sizeof(apr_threadkey_t)); + (*key)->cntxt = cont; + } + (*key)->key = *thekey; + return APR_SUCCESS; +} From c5706170b75b55ab9f35ebad27c04f6fc45fae4e Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 19 Mar 2001 12:43:25 +0000 Subject: [PATCH 1380/7878] OS/2: Get rid of old setup_lock() cruft. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61368 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/locks.h | 2 -- locks/os2/locks.c | 6 ------ 2 files changed, 8 deletions(-) diff --git a/include/arch/os2/locks.h b/include/arch/os2/locks.h index 256fe39b2ce..7c0a8782579 100644 --- a/include/arch/os2/locks.h +++ b/include/arch/os2/locks.h @@ -69,7 +69,5 @@ struct apr_lock_t { TIB *tib; }; -void setup_lock(); - #endif /* LOCKS_H */ diff --git a/locks/os2/locks.c b/locks/os2/locks.c index 9e08a426c74..713e849b5d2 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -63,12 +63,6 @@ #define CurrentTid (lock->tib->tib_ptib2->tib2_ultid) -void setup_lock() -{ -} - - - static apr_status_t lock_cleanup(void *thelock) { apr_lock_t *lock = thelock; From 7b8e50d35b6c3884242e2286bd33c562e2efa409 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 20 Mar 2001 13:47:00 +0000 Subject: [PATCH 1381/7878] Add the UDP support to BeOS R5. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61369 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/sendrecv.c | 76 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index a5380940cd3..ec08949d273 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -160,4 +160,80 @@ apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, return apr_send(sock, vec[0].iov_base, len); } +apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, apr_size_t *len) +{ + ssize_t rv; + + do { + rv = sendto(sock->socketdes, buf, (*len), flags, + (const struct sockaddr*)&where->sa, + where->salen); + } while (rv == -1 && errno == EINTR); + + if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) + && sock->timeout != 0) { + apr_status_t arv = wait_for_io_or_timeout(sock, 0); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } else { + do { + rv = sendto(sock->socketdes, buf, (*len), flags, + (const struct sockaddr*)&where->sa, + where->salen); + } while (rv == -1 && errno == EINTR); + } + } + if (rv == -1) { + *len = 0; + return errno; + } + *len = rv; + return APR_SUCCESS; +} + +apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, + apr_int32_t flags, char *buf, + apr_size_t *len) +{ + ssize_t rv; + + if (from == NULL){ + return APR_ENOMEM; + /* Not sure if this is correct. Maybe we should just allocate + the memory?? + */ + } + + do { + rv = recvfrom(sock->socketdes, buf, (*len), flags, + (struct sockaddr*)&from->sa, &from->salen); + } while (rv == -1 && errno == EINTR); + + if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && + sock->timeout != 0) { + apr_status_t arv = wait_for_io_or_timeout(sock, 1); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } else { + do { + rv = recvfrom(sock->socketdes, buf, (*len), flags, + (struct sockaddr*)&from->sa, &from->salen); + } while (rv == -1 && errno == EINTR); + } + } + if (rv == -1) { + (*len) = 0; + return errno; + } + + (*len) = rv; + if (rv == 0) + return APR_EOF; + + return APR_SUCCESS; +} + #endif From 893c00467990ac010bc4461f24e5087af0cf8d57 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 21 Mar 2001 15:01:53 +0000 Subject: [PATCH 1382/7878] Ready for prime time actually. Tested under FreeBSD 3.x,4.x and YDL Linux and A/UX git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61370 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 2 -- 1 file changed, 2 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 6dc814667cc..bdb7c8e86ba 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -387,8 +387,6 @@ dnl we use what's provided as FLAG-TO-SET. If the 3rd parameter dnl is "yes" then instead of setting to 1 or 0, we set FLAG-TO-SET dnl to yes or no. dnl -dnl DON'T USE YET !! -dnl AC_DEFUN(APR_FLAG_FUNCS,[ AC_CHECK_FUNCS($1) for aprt_j in $1 From 559b810c3b9c7632b4a84454c51bd9a7196d9174 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 21 Mar 2001 22:33:42 +0000 Subject: [PATCH 1383/7878] When we install this file it shouldn't rely on the apache defined BEOS but should use the native __BEOS__. Thrown up when trying to build PHP for apache 2! :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61371 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index c4428953d44..0b33ef0e9b6 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -113,7 +113,7 @@ typedef PULONG apr_os_threadkey_t; typedef struct timeval apr_os_imp_time_t; typedef struct tm apr_os_exp_time_t; -#elif defined(BEOS) +#elif defined(__BEOS__) #include struct apr_os_lock_t { From 1cf4e24c221be41782f1389d261dd2c585df64e4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 22 Mar 2001 05:19:01 +0000 Subject: [PATCH 1384/7878] Conflicts are fun for noticing issues git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61372 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 5 ----- libapr.dsp | 5 ----- 2 files changed, 10 deletions(-) diff --git a/apr.dsp b/apr.dsp index 645e5adcb29..fae69ae34e7 100644 --- a/apr.dsp +++ b/apr.dsp @@ -198,11 +198,6 @@ SOURCE=.\misc\unix\uuid.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\file_io\win32\canonfile.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - SOURCE=.\file_io\win32\dir.c # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index 2ddf3e73fd4..c019deeedac 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -203,11 +203,6 @@ SOURCE=.\misc\unix\uuid.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\file_io\win32\canonfile.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - SOURCE=.\file_io\win32\dir.c # End Source File # Begin Source File From 1994afe4cc0ca50aacf1ddbe6aa9f816558094fb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 22 Mar 2001 05:29:00 +0000 Subject: [PATCH 1385/7878] Just freshening up git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61373 13f79535-47bb-0310-9956-ffa450edef68 --- apr.mak | 31 +++++++++++++++++++++++++++---- libapr.mak | 31 +++++++++++++++++++++++++++---- 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/apr.mak b/apr.mak index 9e5b6d249cc..f9f9e7e70a3 100644 --- a/apr.mak +++ b/apr.mak @@ -70,6 +70,7 @@ CLEAN : -@erase "$(INTDIR)\getuuid.obj" -@erase "$(INTDIR)\groupinfo.obj" -@erase "$(INTDIR)\inet_ntop.obj" + -@erase "$(INTDIR)\inet_pton.obj" -@erase "$(INTDIR)\locks.obj" -@erase "$(INTDIR)\misc.obj" -@erase "$(INTDIR)\mmap.obj" @@ -170,6 +171,7 @@ LIB32_OBJS= \ "$(INTDIR)\getuuid.obj" \ "$(INTDIR)\groupinfo.obj" \ "$(INTDIR)\inet_ntop.obj" \ + "$(INTDIR)\inet_pton.obj" \ "$(INTDIR)\locks.obj" \ "$(INTDIR)\misc.obj" \ "$(INTDIR)\mmap.obj" \ @@ -221,7 +223,6 @@ ALL : "$(OUTDIR)\apr.lib" CLEAN : -@erase "$(INTDIR)\access.obj" -@erase "$(INTDIR)\apr.idb" - -@erase "$(INTDIR)\apr.pdb" -@erase "$(INTDIR)\apr_cpystrn.obj" -@erase "$(INTDIR)\apr_fnmatch.obj" -@erase "$(INTDIR)\apr_getpass.obj" @@ -246,6 +247,7 @@ CLEAN : -@erase "$(INTDIR)\getuuid.obj" -@erase "$(INTDIR)\groupinfo.obj" -@erase "$(INTDIR)\inet_ntop.obj" + -@erase "$(INTDIR)\inet_pton.obj" -@erase "$(INTDIR)\locks.obj" -@erase "$(INTDIR)\misc.obj" -@erase "$(INTDIR)\mmap.obj" @@ -277,10 +279,10 @@ CLEAN : RSC=rc.exe CPP=cl.exe -CPP_PROJ=/nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I\ +CPP_PROJ=/nologo /MDd /W3 /GX /Od /I "./include" /I "./include/arch" /I\ "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D\ "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ - /Fd"$(INTDIR)\apr" /FD /c + /Fd"$(INTDIR)\apr" /FD /ZI /c CPP_OBJS=.\LibD/ CPP_SBRS=. @@ -346,6 +348,7 @@ LIB32_OBJS= \ "$(INTDIR)\getuuid.obj" \ "$(INTDIR)\groupinfo.obj" \ "$(INTDIR)\inet_ntop.obj" \ + "$(INTDIR)\inet_pton.obj" \ "$(INTDIR)\locks.obj" \ "$(INTDIR)\misc.obj" \ "$(INTDIR)\mmap.obj" \ @@ -741,7 +744,6 @@ DEP_CPP_UUID_=\ $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\canonfile.c SOURCE=.\file_io\win32\dir.c DEP_CPP_DIR_C=\ ".\include\apr.h"\ @@ -1062,6 +1064,27 @@ DEP_CPP_INET_=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\network_io\unix\inet_pton.c +DEP_CPP_INET_P=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\networkio.h"\ + + +"$(INTDIR)\inet_pton.obj" : $(SOURCE) $(DEP_CPP_INET_P) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\network_io\win32\poll.c DEP_CPP_POLL_=\ ".\include\apr.h"\ diff --git a/libapr.mak b/libapr.mak index 5852d14c7c2..e57ebef5dd4 100644 --- a/libapr.mak +++ b/libapr.mak @@ -70,6 +70,7 @@ CLEAN : -@erase "$(INTDIR)\getuuid.obj" -@erase "$(INTDIR)\groupinfo.obj" -@erase "$(INTDIR)\inet_ntop.obj" + -@erase "$(INTDIR)\inet_pton.obj" -@erase "$(INTDIR)\locks.obj" -@erase "$(INTDIR)\misc.obj" -@erase "$(INTDIR)\mmap.obj" @@ -178,6 +179,7 @@ LINK32_OBJS= \ "$(INTDIR)\getuuid.obj" \ "$(INTDIR)\groupinfo.obj" \ "$(INTDIR)\inet_ntop.obj" \ + "$(INTDIR)\inet_pton.obj" \ "$(INTDIR)\locks.obj" \ "$(INTDIR)\misc.obj" \ "$(INTDIR)\mmap.obj" \ @@ -229,7 +231,6 @@ ALL : "$(OUTDIR)\libapr.dll" CLEAN : -@erase "$(INTDIR)\access.obj" -@erase "$(INTDIR)\apr.idb" - -@erase "$(INTDIR)\apr.pdb" -@erase "$(INTDIR)\apr_cpystrn.obj" -@erase "$(INTDIR)\apr_fnmatch.obj" -@erase "$(INTDIR)\apr_getpass.obj" @@ -254,6 +255,7 @@ CLEAN : -@erase "$(INTDIR)\getuuid.obj" -@erase "$(INTDIR)\groupinfo.obj" -@erase "$(INTDIR)\inet_ntop.obj" + -@erase "$(INTDIR)\inet_pton.obj" -@erase "$(INTDIR)\locks.obj" -@erase "$(INTDIR)\misc.obj" -@erase "$(INTDIR)\mmap.obj" @@ -288,10 +290,10 @@ CLEAN : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe -CPP_PROJ=/nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I\ +CPP_PROJ=/nologo /MDd /W3 /GX /Od /I "./include" /I "./include/arch" /I\ "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D\ "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ - /Fd"$(INTDIR)\apr" /FD /c + /Fd"$(INTDIR)\apr" /FD /ZI /c CPP_OBJS=.\Debug/ CPP_SBRS=. @@ -363,6 +365,7 @@ LINK32_OBJS= \ "$(INTDIR)\getuuid.obj" \ "$(INTDIR)\groupinfo.obj" \ "$(INTDIR)\inet_ntop.obj" \ + "$(INTDIR)\inet_pton.obj" \ "$(INTDIR)\locks.obj" \ "$(INTDIR)\misc.obj" \ "$(INTDIR)\mmap.obj" \ @@ -758,7 +761,6 @@ DEP_CPP_UUID_=\ $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\canonfile.c SOURCE=.\file_io\win32\dir.c DEP_CPP_DIR_C=\ ".\include\apr.h"\ @@ -1079,6 +1081,27 @@ DEP_CPP_INET_=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\network_io\unix\inet_pton.c +DEP_CPP_INET_P=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\networkio.h"\ + + +"$(INTDIR)\inet_pton.obj" : $(SOURCE) $(DEP_CPP_INET_P) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\network_io\win32\poll.c DEP_CPP_POLL_=\ ".\include\apr.h"\ From 13025504eb3cf04de0e1836fbd362e02d77006b1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 22 Mar 2001 10:17:35 +0000 Subject: [PATCH 1386/7878] It's too dark to see the weather. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61374 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 5b619fb0c5b..bef9e0b5afe 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/03/15 19:31:53 $] +Last modified at [$Date: 2001/03/22 10:17:35 $] Release: @@ -120,6 +120,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: platform. clients need to use this to construct filenames to pass to apr_dso_load() + * may be good to have a --disable-ipv6 configure option Documentation that needs writing: From 166d23df7efe597b3ce00ccf65476468d1551559 Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Thu, 22 Mar 2001 17:35:08 +0000 Subject: [PATCH 1387/7878] better hash function citation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61375 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 8085ee33fd2..4da4020163e 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -222,11 +222,17 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, klen = strlen(key); /* - * This is Daniel J. Bernstein's popular `times 33' hash function - * as posted by him years ago on comp.lang.c and used by perl. - * This is one of the best known hash functions for strings - * because it is both computed very fast and distributes very - * well. + * This is the popular `times 33' hash algorithm which is used by + * perl and also appears in Berkeley DB. This is one of the best + * known hash functions for strings because it is both computed + * very fast and distributes very well. + * + * The originator may be Dan Bernstein but the code in Berkeley DB + * cites Chris Torek as the source. The best citation I have found + * is "Chris Torek, Hash function for text in C, Usenet message + * <27038@mimsy.umd.edu> in comp.lang.c , October, 1990." in Rich + * Salz's USENIX 1992 paper about INN which can be found at + * . * * The magic of number 33, i.e. why it works better than many other * constants, prime or not, has never been adequately explained by @@ -248,9 +254,8 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, * operation can be replaced by a faster operation based on just one * shift plus either a single addition or subtraction operation. And * because a hash function has to both distribute good _and_ has to - * be very fast to compute, those few numbers should be preferred - * and seems to be the reason why Daniel J. Bernstein also preferred - * it. + * be very fast to compute, those few numbers should be preferred. + * * -- Ralf S. Engelschall */ hash = 0; From 7a0c1a5d6696a5b7d5d4b117954d929fcb6ea45c Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 22 Mar 2001 21:50:12 +0000 Subject: [PATCH 1388/7878] Change the way select based poll works so it works as we'd expect it to, i.e. the same way as poll. Also add a test program specifically for poll. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61376 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/networkio.h | 3 + network_io/beos/poll.c | 34 ++++-- network_io/unix/poll.c | 36 ++++-- test/Makefile.in | 4 + test/testpoll.c | 224 ++++++++++++++++++++++++++++++++++ 5 files changed, 276 insertions(+), 25 deletions(-) create mode 100644 test/testpoll.c diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index df1b5d12f6c..9c6db4edccd 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -144,6 +144,9 @@ struct apr_pollfd_t { fd_set *write; fd_set *except; int highsock; + fd_set *read_set; + fd_set *write_set; + fd_set *except_set; #endif apr_int16_t *events; apr_int16_t *revents; diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index cf1a61b7254..d8cbfbc8a98 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -77,9 +77,15 @@ apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con (*new)->read = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); (*new)->write = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); (*new)->except = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); + (*new)->read_set = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); + (*new)->write_set = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); + (*new)->except_set = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); FD_ZERO((*new)->read); FD_ZERO((*new)->write); FD_ZERO((*new)->except); + FD_ZERO((*new)->read_set); + FD_ZERO((*new)->write_set); + FD_ZERO((*new)->except_set); (*new)->highsock = -1; return APR_SUCCESS; } @@ -88,13 +94,13 @@ apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) { if (event & APR_POLLIN) { - FD_SET(sock->socketdes, aprset->read); + FD_SET(sock->socketdes, aprset->read_set); } if (event & APR_POLLPRI) { - FD_SET(sock->socketdes, aprset->read); + FD_SET(sock->socketdes, aprset->read_set); } if (event & APR_POLLOUT) { - FD_SET(sock->socketdes, aprset->write); + FD_SET(sock->socketdes, aprset->write_set); } if (sock->socketdes > aprset->highsock) { aprset->highsock = sock->socketdes; @@ -107,13 +113,13 @@ apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, apr_int16_t events) { if (events & APR_POLLIN) { - FD_CLR(sock->socketdes, aprset->read); + FD_CLR(sock->socketdes, aprset->read_set); } if (events & APR_POLLPRI) { - FD_CLR(sock->socketdes, aprset->except); + FD_CLR(sock->socketdes, aprset->except_set); } if (events & APR_POLLOUT) { - FD_CLR(sock->socketdes, aprset->write); + FD_CLR(sock->socketdes, aprset->write_set); } return APR_SUCCESS; } @@ -133,6 +139,10 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, tvptr = &tv; } + memcpy(aprset->read, aprset->read_set, sizeof(fd_set)); + memcpy(aprset->write, aprset->write_set, sizeof(fd_set)); + memcpy(aprset->except, aprset->except_set, sizeof(fd_set)); + rv = select(aprset->highsock + 1, aprset->read, aprset->write, aprset->except, tvptr); @@ -192,22 +202,22 @@ apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_po apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { - FD_CLR(sock->socketdes, aprset->read); - FD_CLR(sock->socketdes, aprset->read); - FD_CLR(sock->socketdes, aprset->write); + FD_CLR(sock->socketdes, aprset->read_set); + FD_CLR(sock->socketdes, aprset->except_set); + FD_CLR(sock->socketdes, aprset->write_set); return APR_SUCCESS; } apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t event) { if (event & APR_POLLIN) { - FD_ZERO(aprset->read); + FD_ZERO(aprset->read_set); } if (event & APR_POLLPRI) { - FD_ZERO(aprset->read); + FD_ZERO(aprset->except_set); } if (event & APR_POLLOUT) { - FD_ZERO(aprset->write); + FD_ZERO(aprset->write_set); } aprset->highsock = 0; return APR_SUCCESS; diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index f2ee4bfcdb8..cfc5d44f751 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -232,9 +232,15 @@ apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con (*new)->read = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); (*new)->write = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); (*new)->except = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); + (*new)->read_set = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); + (*new)->write_set = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); + (*new)->except_set = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); FD_ZERO((*new)->read); FD_ZERO((*new)->write); FD_ZERO((*new)->except); + FD_ZERO((*new)->read_set); + FD_ZERO((*new)->write_set); + FD_ZERO((*new)->except_set); (*new)->highsock = -1; return APR_SUCCESS; } @@ -243,13 +249,13 @@ apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) { if (event & APR_POLLIN) { - FD_SET(sock->socketdes, aprset->read); + FD_SET(sock->socketdes, aprset->read_set); } if (event & APR_POLLPRI) { - FD_SET(sock->socketdes, aprset->except); + FD_SET(sock->socketdes, aprset->except_set); } if (event & APR_POLLOUT) { - FD_SET(sock->socketdes, aprset->write); + FD_SET(sock->socketdes, aprset->write_set); } if (sock->socketdes > aprset->highsock) { aprset->highsock = sock->socketdes; @@ -262,13 +268,13 @@ apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, apr_int16_t events) { if (events & APR_POLLIN) { - FD_CLR(sock->socketdes, aprset->read); + FD_CLR(sock->socketdes, aprset->read_set); } if (events & APR_POLLPRI) { - FD_CLR(sock->socketdes, aprset->except); + FD_CLR(sock->socketdes, aprset->except_set); } if (events & APR_POLLOUT) { - FD_CLR(sock->socketdes, aprset->write); + FD_CLR(sock->socketdes, aprset->write_set); } return APR_SUCCESS; } @@ -288,6 +294,10 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, tvptr = &tv; } + memcpy(aprset->read, aprset->read_set, sizeof(fd_set)); + memcpy(aprset->write, aprset->write_set, sizeof(fd_set)); + memcpy(aprset->except, aprset->except_set, sizeof(fd_set)); + rv = select(aprset->highsock + 1, aprset->read, aprset->write, aprset->except, tvptr); @@ -306,7 +316,7 @@ apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_po apr_int16_t revents = 0; char data[1]; int flags = MSG_PEEK; - + /* We just want to PEEK at the data, so I am setting up a dummy WSABUF * variable here. */ @@ -350,22 +360,22 @@ apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_po apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { - FD_CLR(sock->socketdes, aprset->read); - FD_CLR(sock->socketdes, aprset->except); - FD_CLR(sock->socketdes, aprset->write); + FD_CLR(sock->socketdes, aprset->read_set); + FD_CLR(sock->socketdes, aprset->except_set); + FD_CLR(sock->socketdes, aprset->write_set); return APR_SUCCESS; } apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t event) { if (event & APR_POLLIN) { - FD_ZERO(aprset->read); + FD_ZERO(aprset->read_set); } if (event & APR_POLLPRI) { - FD_ZERO(aprset->except); + FD_ZERO(aprset->except_set); } if (event & APR_POLLOUT) { - FD_ZERO(aprset->write); + FD_ZERO(aprset->write_set); } aprset->highsock = 0; return APR_SUCCESS; diff --git a/test/Makefile.in b/test/Makefile.in index e4866e800d5..7e603b37913 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -19,6 +19,7 @@ PROGRAMS = \ testuuid@EXEEXT@ \ testsockopt@EXEEXT@ \ testipsub@EXEEXT@ \ + testpoll@EXEEXT@ \ occhild@EXEEXT@ \ mod_test.so @@ -101,4 +102,7 @@ testsockopt@EXEEXT@: testsockopt.lo ../libapr.la testipsub@EXEEXT@: testipsub.lo ../libapr.la $(LINK) testipsub.lo $(ALL_LIBS) +testpoll@EXEEXT@: testpoll.lo ../libapr.la + $(LINK) testpoll.lo $(ALL_LIBS) + # DO NOT REMOVE diff --git a/test/testpoll.c b/test/testpoll.c new file mode 100644 index 00000000000..6e1ce3c8341 --- /dev/null +++ b/test/testpoll.c @@ -0,0 +1,224 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_mmap.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_network_io.h" +#if APR_HAVE_UNISTD_H +#include +#endif +#include +#include +#include + +static void closeapr(void) +{ + apr_terminate(); +} + +static int make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, apr_port_t port, + apr_pool_t *p) +{ + if (apr_sockaddr_info_get(sa, "127.0.0.1", APR_UNSPEC, port, 0, p) + != APR_SUCCESS){ + printf("couldn't create control socket information, shutting down"); + return 1; + } + if (apr_socket_create(sock, (*sa)->sa.sin.sin_family, SOCK_DGRAM, p) + != APR_SUCCESS){ + printf("couldn't create UDP socket, shutting down"); + return 1; + } + if (apr_bind((*sock), (*sa)) != APR_SUCCESS){ + printf("couldn't bind UDP socket!"); + return 1; + } + return 0; +} + +static int check_sockets(apr_pollfd_t *pollset, apr_socket_t **sockarray) +{ + int i = 0; + printf("\tSocket 0\tSocket 1\tSocket 2\n\t"); + for (i = 0;i < 3;i++){ + apr_int16_t event; + if (apr_poll_revents_get(&event, sockarray[i], pollset) != APR_SUCCESS){ + printf("Failed!\n"); + exit (-1); + } + if (event & APR_POLLIN){ + printf ("POLLIN!\t\t"); + } else { + printf ("No wait\t\t"); + } + } + printf("\n"); + return 0; +} + +static void send_msg(apr_socket_t **sockarray, apr_sockaddr_t **sas, int which) +{ + apr_size_t len = 5; + apr_status_t rv; + printf("\tSending message to socket %d............", which); + if ((rv = apr_sendto(sockarray[which], sas[which], 0, "hello", &len)) != APR_SUCCESS){ + printf("Failed! %s\n", strerror(rv)); + exit(-1); + } + printf("OK\n"); +} + +static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p) +{ + apr_size_t buflen = 5; + char *buffer = apr_pcalloc(p, sizeof(char) * buflen); + apr_sockaddr_t *recsa; + apr_status_t rv; + + apr_sockaddr_info_get(&recsa, "127.0.0.1", APR_UNSPEC, 7770, 0, p); + + printf("\tTrying to get message from socket %d....", which); + if ((rv = apr_recvfrom(recsa, sockarray[which], 0, buffer, &buflen)) + != APR_SUCCESS){ + printf("Failed! %s\n", strerror(rv)); + exit (-1); + } + printf("OK\n"); +} + +int main(void) +{ + apr_pool_t *context; + apr_socket_t *s[3]; + apr_sockaddr_t *sa[3]; + apr_pollfd_t *pollset; + int i = 0, srv = 0; + + fprintf (stdout,"APR Poll Test\n*************\n\n"); + + printf("Initializing..................................."); + if (apr_initialize() != APR_SUCCESS) { + printf("Failed.\n"); + exit(-1); + } + printf("OK\n"); + atexit(closeapr); + + printf("Creating context..............................."); + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { + printf("Failed.\n"); + exit(-1); + } + printf("OK\n"); + + printf("\tCreating the sockets I'll use.........."); + for (i = 0; i < 3; i++){ + if (make_socket(&s[i], &sa[i], 7770 + i, context) != 0){ + exit(-1); + } + } + printf("OK\n"); + + printf ("\tSetting up the pollset I'll use........"); + if (apr_poll_setup(&pollset, 3, context) != APR_SUCCESS){ + printf("Couldn't create a pollset!\n"); + exit (-1); + } + for (i = 0; i < 3;i++){ + if (apr_poll_socket_add(pollset, s[i], APR_POLLIN) != APR_SUCCESS){ + printf("Failed to add socket %d\n", i); + exit (-1); + } + } + printf("OK\n"); + printf("Starting Tests\n"); + + apr_poll(pollset, &srv, 10); + check_sockets(pollset, s); + + send_msg(s, sa, 2); + + apr_poll(pollset, &srv, 10); + check_sockets(pollset, s); + + recv_msg(s, 2, context); + send_msg(s, sa, 1); + + apr_poll(pollset, &srv, 10); + check_sockets(pollset, s); + + send_msg(s, sa, 2); + + apr_poll(pollset, &srv, 10); + check_sockets(pollset, s); + + recv_msg(s, 1, context); + send_msg(s, sa, 0); + + apr_poll(pollset, &srv, 10); + check_sockets(pollset, s); + + printf("Tests completed.\n"); + printf("\tClosing sockets........................"); + for (i = 0; i < 3; i++){ + if (apr_socket_close(s[i]) != APR_SUCCESS){ + printf("Failed!\n"); + exit(-1); + } + } + printf ("OK\n"); + return 1; +} From c43bc849c26d77f027d8e251b8c0e446e73eb268 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 23 Mar 2001 22:12:59 +0000 Subject: [PATCH 1389/7878] allow testmd5 to be easily built git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61377 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/Makefile.in b/test/Makefile.in index 7e603b37913..9cd53317c2b 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -19,6 +19,7 @@ PROGRAMS = \ testuuid@EXEEXT@ \ testsockopt@EXEEXT@ \ testipsub@EXEEXT@ \ + testmd5@EXEEXT@ \ testpoll@EXEEXT@ \ occhild@EXEEXT@ \ mod_test.so @@ -102,6 +103,9 @@ testsockopt@EXEEXT@: testsockopt.lo ../libapr.la testipsub@EXEEXT@: testipsub.lo ../libapr.la $(LINK) testipsub.lo $(ALL_LIBS) +testmd5@EXEEXT@: testmd5.lo ../libapr.la + $(LINK) testmd5.lo $(ALL_LIBS) + testpoll@EXEEXT@: testpoll.lo ../libapr.la $(LINK) testpoll.lo $(ALL_LIBS) From 8094815569e5b0e3737fc370a7d50d43ee7d6ce0 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 23 Mar 2001 22:52:30 +0000 Subject: [PATCH 1390/7878] Don't alloc the buffer if the file is opened for non-buffered i/o git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61378 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index dc0355683d8..b584ed2fd2a 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -277,7 +277,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, } else { (*new)->buffered = 0; - (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); + (*new)->buffer = NULL; (*new)->mutex = NULL; } From bf878e3a4a7ba25fb418d833ccd4fde84bb0228f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 24 Mar 2001 04:22:36 +0000 Subject: [PATCH 1391/7878] Declarations required for the new apr_filepath_merge implementation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61379 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 12 +++++++++++ include/apr_file_info.h | 47 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 9b6b8ef1bdd..702a93c1ddf 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -208,6 +208,10 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * platform, either because nobody has gotten to it yet, * or the function is impossible on this platform. * APR_EMISMATCH Two passwords do not match. + * APR_EABSOLUTE The given path was absolute. + * APR_ERELATIVE The given path was relative. + * APR_EINCOMPLETE The given path was neither relative nor absolute. + * APR_EABOVEROOT The given path was above the root path. * * * @param status The APR_status code to check. @@ -239,6 +243,10 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_EBADMASK (APR_OS_START_ERROR + 17) /* empty slot: +18 */ #define APR_EDSOOPEN (APR_OS_START_ERROR + 19) +#define APR_EABSOLUTE (APR_OS_START_ERROR + 20) +#define APR_ERELATIVE (APR_OS_START_ERROR + 21) +#define APR_EINCOMPLETE (APR_OS_START_ERROR + 22) +#define APR_EABOVEROOT (APR_OS_START_ERROR + 23) /* APR ERROR VALUE TESTS */ @@ -261,6 +269,10 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_EBADMASK(s) ((s) == APR_EBADMASK) /* empty slot: +18 */ #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN) +#define APR_STATUS_IS_EABSOLUTE(s) ((s) == APR_EABSOLUTE) +#define APR_STATUS_IS_ERELATIVE(s) ((s) == APR_ERELATIVE) +#define APR_STATUS_IS_EINCOMPLETE(s) ((s) == APR_EINCOMPLETE) +#define APR_STATUS_IS_EABOVEROOT(s) ((s) == APR_EABOVEROOT) /* APR STATUS VALUES */ diff --git a/include/apr_file_info.h b/include/apr_file_info.h index eade2a74c19..924ea09fbe3 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -246,7 +246,9 @@ APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir); /** * Read the next entry from the specified directory. - * @param thedir the directory descriptor to read from, and fill out. + * @param finfo the file info structure and filled in by apr_dir_read + * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values + * @param thedir the directory descriptor returned from apr_dir_open * @tip All systems return . and .. as the first two files. * @deffunc apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_dir_t *thedir) */ @@ -260,6 +262,49 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, */ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); +/* apr_filepath flags + */ + +/* Cause apr_filepath_merge to fail if addpath is above rootpath */ +#define APR_FILEPATH_NOTABOVEROOT 0x01 + +/* internal: Only meaningful with APR_FILEPATH_NOTABOVEROOT */ +#define APR_FILEPATH_SECUREROOTTEST 0x02 + +/* Cause apr_filepath_merge to fail if addpath is above rootpath, + * even given a rootpath /foo/bar and an addpath ../bar/bash + */ +#define APR_FILEPATH_SECUREROOT 0x03 + +/* Fail apr_filepath_merge if the merged path is relative */ +#define APR_FILEPATH_NOTRELATIVE 0x04 + +/* Fail apr_filepath_merge if the merged path is absolute */ +#define APR_FILEPATH_NOTABSOLUTE 0x08 + +/* Cleans all ambigious /./ or // segments + * if the target is a directory */ +#define APR_FILEPATH_CANONICAL 0x10 + +/* Resolve the true case of existing directories and file elements + * of addpath, and append a proper trailing slash if a directory + */ +#define APR_FILEPATH_TRUENAME 0x20 + + +/** + * Merge additional file path onto the previously processed rootpath + * @param newpath the merged paths returned + * @param rootpath the root file path (NULL uses the current working path) + * @param addpath the path to add to the root path + * @param flags the desired APR_FILEPATH_ rules to apply when merging + * @param p the pool to allocate the new path string from + * @deffunc apr_status_t apr_filepath_merge(char **newpath, const char *rootpath, const char *addpath, apr_int32_t flags, apr_pool_t *p) + */ +APR_DECLARE(apr_status_t) + apr_filepath_merge(char **newpath, const char *rootpath, + const char *addpath, apr_int32_t flags, + apr_pool_t *p); #ifdef __cplusplus } From e90fe5006f2978a17434d7b6786cbc4e56ac7850 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 24 Mar 2001 06:00:40 +0000 Subject: [PATCH 1392/7878] Remove the need for aclocal.m4 by copying libtool.m4 into build and directly including the macro files into configure.in. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61380 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 1 - build/.cvsignore | 1 + buildconf | 24 +++++------------------- configure.in | 6 ++++++ 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.cvsignore b/.cvsignore index 3fe91f1e2a0..50ed0dde63b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -13,6 +13,5 @@ Release *.opt *.plg apr.exports -aclocal.m4 .libs *.la diff --git a/build/.cvsignore b/build/.cvsignore index 62437018a1f..6226c1f67e2 100644 --- a/build/.cvsignore +++ b/build/.cvsignore @@ -1,3 +1,4 @@ +libtool.m4 ltconfig ltmain.sh rules.mk diff --git a/buildconf b/buildconf index 0b173b325e5..80f5366defe 100755 --- a/buildconf +++ b/buildconf @@ -1,24 +1,5 @@ #!/bin/sh -# -# Build aclocal.m4 from libtool's libtool.m4 and our own M4 files. -# -libtoolize=`build/PrintPath glibtoolize libtoolize` -ltpath=`dirname $libtoolize` -ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 -echo "Incorporating $ltfile into aclocal.m4 ..." -cat > aclocal.m4 <> aclocal.m4 - # # Create the libtool helper files # @@ -27,6 +8,11 @@ cat $ltfile >> aclocal.m4 # rely on libtool's versions # echo "Copying libtool helper files ..." +# +libtoolize=`build/PrintPath glibtoolize libtoolize` +ltpath=`dirname $libtoolize` +ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 +cp -f $ltfile build/ $libtoolize --copy --automake # diff --git a/configure.in b/configure.in index 155c4c19727..5174518a269 100644 --- a/configure.in +++ b/configure.in @@ -7,6 +7,12 @@ AC_INIT(build/apr_common.m4) AC_CONFIG_HEADER(include/arch/unix/apr_private.h) AC_CONFIG_AUX_DIR(build) +sinclude(build/apr_common.m4) +sinclude(build/apr_network.m4) +sinclude(build/apr_threads.m4) +sinclude(build/apr_hints.m4) +sinclude(build/libtool.m4) + AC_CANONICAL_SYSTEM echo "Configuring APR library" OS=$host From 07673b31d87f4ec0308a32b98536bc0d279e79f8 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 24 Mar 2001 06:48:04 +0000 Subject: [PATCH 1393/7878] This shell script checks the builder's setup for the right versions of the build tools (autoconf and libtool) needed to build APR on unix. Moved from httpd-2.0/build/buildcheck.sh Submitted by: Sascha Schumann git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61381 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 build/buildcheck.sh diff --git a/build/buildcheck.sh b/build/buildcheck.sh new file mode 100755 index 00000000000..091a17be335 --- /dev/null +++ b/build/buildcheck.sh @@ -0,0 +1,43 @@ +#! /bin/sh + +echo "buildconf: checking installation..." + +# autoconf 2.13 or newer +ac_version=`autoconf --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` +if test -z "$ac_version"; then +echo "buildconf: autoconf not found." +echo " You need autoconf version 2.13 or newer installed" +echo " to build Apache from CVS." +exit 1 +fi +IFS=.; set $ac_version; IFS=' ' +if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then +echo "buildconf: autoconf version $ac_version found." +echo " You need autoconf version 2.13 or newer installed" +echo " to build Apache from CVS." +exit 1 +else +echo "buildconf: autoconf version $ac_version (ok)" +fi + +# libtool 1.3.3 or newer +lt_pversion=`libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'` +if test "$lt_pversion" = ""; then +echo "buildconf: libtool not found." +echo " You need libtool version 1.3 or newer installed" +echo " to build Apache from CVS." +exit 1 +fi +lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` +IFS=.; set $lt_version; IFS=' ' +if test "$1" -gt "1" || test "$2" -gt "3" || test "$2" = "3" -a "$3" -ge "3" +then +echo "buildconf: libtool version $lt_pversion (ok)" +else +echo "buildconf: libtool version $lt_pversion found." +echo " You need libtool version 1.3.3 or newer installed" +echo " to build Apache from CVS." +exit 1 +fi + +exit 0 From 20cf4c821bfd9dd71885acf77474e1181195afc9 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 24 Mar 2001 06:50:34 +0000 Subject: [PATCH 1394/7878] Move the build tool check into APR and improve the comments. This is in preparation of APR being the center of all builds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61382 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 80 +++++++++++++++++++++++++++++++++++++++++++++++++--- configure.in | 12 +++++--- 2 files changed, 84 insertions(+), 8 deletions(-) diff --git a/buildconf b/buildconf index 80f5366defe..a6ca93191c6 100755 --- a/buildconf +++ b/buildconf @@ -1,6 +1,71 @@ #!/bin/sh +# ==================================================================== +# The Apache Software License, Version 1.1 +# +# Copyright (c) 2000-2001 The Apache Software Foundation. All rights +# reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3. The end-user documentation included with the redistribution, +# if any, must include the following acknowledgment: +# "This product includes software developed by the +# Apache Software Foundation (http://www.apache.org/)." +# Alternately, this acknowledgment may appear in the software itself, +# if and wherever such third-party acknowledgments normally appear. +# +# 4. The names "Apache" and "Apache Software Foundation" must +# not be used to endorse or promote products derived from this +# software without prior written permission. For written +# permission, please contact apache@apache.org. +# +# 5. Products derived from this software may not be called "Apache", +# nor may "Apache" appear in their name, without prior written +# permission of the Apache Software Foundation. +# +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR +# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# ==================================================================== +# +# This software consists of voluntary contributions made by many +# individuals on behalf of the Apache Software Foundation. For more +# information on the Apache Software Foundation, please see +# . +# + +# buildconf: Build the support scripts needed to compile from a +# checked-out version of the source code. +# Verify that the builder has the right config tools installed # +build/buildcheck.sh || exit 1 + +libtoolize=`build/PrintPath glibtoolize libtoolize` +if [ "x$libtoolize" = "x" ]; then + echo "libtoolize not found in path" + exit 1 +fi + # Create the libtool helper files # # Note: we copy (rather than link) them to simplify distribution. @@ -8,12 +73,17 @@ # rely on libtool's versions # echo "Copying libtool helper files ..." -# -libtoolize=`build/PrintPath glibtoolize libtoolize` + +$libtoolize --copy --automake + ltpath=`dirname $libtoolize` ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 -cp -f $ltfile build/ -$libtoolize --copy --automake + +if [ ! -f $ltfile ]; then + echo "$ltfile not found" + exit 1 +fi +cp -f $ltfile build/libtool.m4 # # Generate the autoconf header and ./configure @@ -26,3 +96,5 @@ echo "Creating configure ..." autoconf (cd shmem/unix/mm && autoconf) + +exit 0 diff --git a/configure.in b/configure.in index 5174518a269..738f22a65d8 100644 --- a/configure.in +++ b/configure.in @@ -1,12 +1,16 @@ -dnl ## -dnl ## Autoconf configuration file for APR -dnl ## +dnl # +dnl # Autoconf configuration file for APR +dnl # +dnl # Process this file with autoconf to produce a configure script. +dnl # Use ./buildconf to prepare build files and run autoconf for APR. -dnl Process this file with autoconf to produce a configure script. AC_INIT(build/apr_common.m4) AC_CONFIG_HEADER(include/arch/unix/apr_private.h) AC_CONFIG_AUX_DIR(build) +dnl # +dnl # Include our own M4 macros along with those for libtool +dnl # sinclude(build/apr_common.m4) sinclude(build/apr_network.m4) sinclude(build/apr_threads.m4) From 641c985a0cc28e086e3056016c4a38dd2c05b683 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 24 Mar 2001 08:45:50 +0000 Subject: [PATCH 1395/7878] I forgot that people might pick up an old aclocal.m4 by mistake, which would cause useless build errors. Remove it for a while. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61383 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/buildconf b/buildconf index a6ca93191c6..06e0f3f9f80 100755 --- a/buildconf +++ b/buildconf @@ -85,6 +85,10 @@ if [ ! -f $ltfile ]; then fi cp -f $ltfile build/libtool.m4 +# This is just temporary until people's workspaces are cleared -- remove +# any old aclocal.m4 left over from prior build so it doesn't cause errors. +rm -f aclocal.m4 + # # Generate the autoconf header and ./configure # From 1248b96190fc7a4c6988d27156ac008baf6db262 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 24 Mar 2001 09:18:33 +0000 Subject: [PATCH 1396/7878] Clear up some confusion about top_builddir. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61384 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 738f22a65d8..a668da1055b 100644 --- a/configure.in +++ b/configure.in @@ -36,12 +36,10 @@ if test "$abs_builddir" != "$abs_srcdir"; then USE_VPATH=1 fi -dnl Libtool needs this symbol -if test -n "$BUILD_BASE"; then - top_builddir="$BUILD_BASE" -else - top_builddir="$abs_builddir" -fi +dnl Libtool might need this symbol -- it must point to the location of +dnl the generated libtool script (not necessarily the "top" build dir). +dnl +top_builddir="$abs_builddir" AC_SUBST(top_builddir) dnl Directory containing apr build macros, helpers, and make rules From 6fef9b2ccae5742adc355383183c7e0e119f1500 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Sat, 24 Mar 2001 21:04:57 +0000 Subject: [PATCH 1397/7878] Fix a couple of typos in the comments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61385 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index 2ff8e0991d6..e172a93dccf 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -407,7 +407,7 @@ APR_DECLARE(void) * int i; * * for (i = 0; i < barr->nelts; ++i) { - * if (flags & apr_OVERLAP_TABLES_MERGE) { + * if (flags & APR_OVERLAP_TABLES_MERGE) { * apr_table_mergen(a, belt[i].key, belt[i].val); * } * else { @@ -426,7 +426,7 @@ APR_DECLARE(void) #define APR_OVERLAP_TABLES_MERGE (1) /** * For each element in table b, either use setn or mergen to add the data - * to table a. Wich method is used is determined by the flags passed in. + * to table a. Which method is used is determined by the flags passed in. * @param a The table to add the data to. * @param b The table to iterate over, adding it's data to table a * @param flags How to add the table to table a. One of: From fe8e0aba4a41827a1ecce47df19349915b0ba003 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 25 Mar 2001 02:13:11 +0000 Subject: [PATCH 1398/7878] Tweak formatting of declarations so make_exports.awk picks them up. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61386 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index e172a93dccf..d8114a50da5 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -184,9 +184,8 @@ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, * for the elements to be copied if (and only if) the code subsequently does * a push or arraycat. */ -APR_DECLARE(apr_array_header_t *) - apr_array_copy(struct apr_pool_t *p, - const apr_array_header_t *arr); +APR_DECLARE(apr_array_header_t *) apr_array_copy(struct apr_pool_t *p, + const apr_array_header_t *arr); /** * Copy the headers of the array, and arrange for the elements to be copied if * and only if the code subsequently does a push or arraycat. @@ -196,9 +195,8 @@ APR_DECLARE(apr_array_header_t *) * @deffunc apr_array_header_t *apr_array_copy_hdr(apr_pool_t *p, const apr_array_header_t *arr) * @tip The alternate apr_array_copy copies the *entire* array. */ -APR_DECLARE(apr_array_header_t *) - apr_array_copy_hdr(struct apr_pool_t *p, - const apr_array_header_t *arr); +APR_DECLARE(apr_array_header_t *) apr_array_copy_hdr(struct apr_pool_t *p, + const apr_array_header_t *arr); /** * Append one array to the end of another, creating a new array in the process. @@ -208,10 +206,9 @@ APR_DECLARE(apr_array_header_t *) * @param return A new array containing the data from the two arrays passed in. * @deffunc apr_array_header_t *apr_array_append(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second) */ -APR_DECLARE(apr_array_header_t *) - apr_array_append(struct apr_pool_t *p, - const apr_array_header_t *first, - const apr_array_header_t *second); +APR_DECLARE(apr_array_header_t *) apr_array_append(struct apr_pool_t *p, + const apr_array_header_t *first, + const apr_array_header_t *second); /** * Generates a new string from the apr_pool_t containing the concatenated @@ -378,8 +375,7 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(struct apr_pool_t *p, * are run. * @deffunc void apr_table_do(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, ...) */ -APR_DECLARE_NONSTD(void) - apr_table_do(int (*comp) (void *, const char *, const char *), +APR_DECLARE_NONSTD(void) apr_table_do(int (*comp)(void *, const char *, const char *), void *rec, const apr_table_t *t, ...); /** @@ -396,9 +392,8 @@ APR_DECLARE_NONSTD(void) * whose key matches are run. * @deffunc void apr_table_vdo(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, va_list vp) */ -APR_DECLARE(void) - apr_table_vdo(int (*comp) (void *, const char *, const char *), - void *rec, const apr_table_t *t, va_list); +APR_DECLARE(void) apr_table_vdo(int (*comp)(void *, const char *, const char *), + void *rec, const apr_table_t *t, va_list); /* Conceptually, apr_table_overlap does this: * From 9579d192c46a416df170865d5cefc34f7a567b43 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 26 Mar 2001 10:22:33 +0000 Subject: [PATCH 1399/7878] Add hooks declared with AP_DECLARE_HOOK to the list of exported symbols. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61388 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_export.awk | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/build/make_export.awk b/build/make_export.awk index 7d61a55fa56..cce47120481 100644 --- a/build/make_export.awk +++ b/build/make_export.awk @@ -31,24 +31,34 @@ next } -/^[ \t]*(AP[RU]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?([A-Za-z0-9_]+)\(/ { +function add_symbol (sym_name) { if (count) { found++ } for (i = 0; i < count; i++) { line = line "\t" } - sub("^[ \t]*(AP[UR]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?", ""); - sub("[(].*", ""); - line = line $0 "\n" + line = line sym_name "\n" if (count == 0) { printf("%s", line) line = "" } +} + +/^[ \t]*(AP[RU]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?([A-Za-z0-9_]+)\(/ { + sub("^[ \t]*(AP[UR]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?", ""); + sub("[(].*", ""); + add_symbol($0); next } +/^[ \t]*AP_DECLARE_HOOK[(][^,]+,[a-z_]+,.+[)]$/ { + split($0, args, ","); + add_symbol("ap_hook_" args[2]); + add_symbol("ap_run_" args[2]); +} + END { printf("%s", line) } From 9e115bd889a7117dfe3900829058c2d24a537daa Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 26 Mar 2001 16:26:49 +0000 Subject: [PATCH 1400/7878] Get APR_OS_PROC_T_FMT fixed up on Solaris, where pid_t is a long. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61389 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index a668da1055b..f01a411e1d1 100644 --- a/configure.in +++ b/configure.in @@ -650,9 +650,13 @@ fi # it right. If you find that we don't get it right for your platform, # you can override our decision below. case "$OS" in - *linux* | *os2_emx | *-solaris*) + *linux* | *os2_emx) off_t_fmt='#define APR_OFF_T_FMT "ld"' ;; + *-solaris*) + off_t_fmt='#define APR_OFF_T_FMT "ld"' + os_proc_t_fmt='#define APR_OS_PROC_T_FMT "ld"' + ;; *aix4*) ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' size_t_fmt='#define APR_SIZE_T_FMT "ld"' From 9a95aef1d951dfefffc7ffd7dfe83022d09311fb Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Tue, 27 Mar 2001 10:48:02 +0000 Subject: [PATCH 1401/7878] Use --enable-* rather than --with-* for the debug options. Submitted by: Mo DeJong git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61390 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index f01a411e1d1..812f407d9b6 100644 --- a/configure.in +++ b/configure.in @@ -86,10 +86,10 @@ nl=' ' echo $ac_n "${nl}Check for compiler flags..." -AC_ARG_WITH(debug,[ --with-debug Turn on debugging and compile time warnings], +AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile time warnings], [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall"; else CFLAGS="$CFLAGS -g"; fi]) -AC_ARG_WITH(maintainer-mode,[ --with-maintainer-mode Turn on debugging and compile time warnings], +AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and compile time warnings], [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"; else CFLAGS="$CFLAGS -g"; fi]) dnl # this is the place to put specific options for platform/compiler From 7805c2a9a71c4a137266223ef3eaff285dcfc9ea Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 28 Mar 2001 21:33:43 +0000 Subject: [PATCH 1402/7878] Fix building the mod_test.so file Submitted by: John Sterling git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61391 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index 9cd53317c2b..f791d766891 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -56,7 +56,7 @@ occhild@EXEEXT@: occhild.lo ../libapr.la $(LINK) occhild.lo $(ALL_LIBS) mod_test.so: mod_test.lo ../libapr.la - $(LINK) --module mod_test.lo $(ALL_LIBS) + $(LINK) -o mod_test.so ${LD_FLAGS} -shared mod_test.o $(ALL_LIBS) testargs@EXEEXT@: testargs.lo ../libapr.la $(LINK) testargs.lo $(ALL_LIBS) From 294840105ae273fa619fe5b4390757b5aa6493d9 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 29 Mar 2001 09:45:40 +0000 Subject: [PATCH 1403/7878] Remove long since defunct function apr_file_error() (marked for death nearly a year ago). It's only implemented on unix (as a stub) so causes linkage failure on other platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61392 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 8 -------- include/apr_file_io.h | 8 -------- 2 files changed, 16 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index e13f6b05d8a..4f5237213a3 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -239,14 +239,6 @@ apr_status_t apr_file_eof(apr_file_t *fptr) return APR_SUCCESS; } -apr_status_t apr_file_error(apr_file_t *fptr) -{ -/* This function should be removed ASAP. It is next on my list once - * I am sure nobody is using it. - */ - return APR_SUCCESS; -} - apr_status_t apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { int fd = STDERR_FILENO; diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 5b8c8ddc22f..6664763e428 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -182,14 +182,6 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, */ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); -/** - * Is there an error on the stream? - * @param fptr The apr file we are testing. - * @tip Returns -1 if the error indicator is set, APR_SUCCESS otherwise. - * @deffunc apr_status_t apr_file_error(apr_file_t *fptr) - */ -APR_DECLARE(apr_status_t) apr_file_error(apr_file_t *fptr); - /** * open standard error as an apr file pointer. * @param thefile The apr file to use as stderr. From c76e6affaa7c900efdae1781b4c2615465886378 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 29 Mar 2001 15:45:26 +0000 Subject: [PATCH 1404/7878] A simple libtool emulator which currently only supports OS/2 but it should be possible to add other platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61393 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 620 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 620 insertions(+) create mode 100644 build/aplibtool.c diff --git a/build/aplibtool.c b/build/aplibtool.c new file mode 100644 index 00000000000..53f7477037f --- /dev/null +++ b/build/aplibtool.c @@ -0,0 +1,620 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include +#include +#include +#include +#include +#include + +char silent = 0; +char shared = 0; +enum mode_t { mCompile, mLink }; +enum output_type_t { otGeneral, otObject, otProgram, otStaticLibrary, otDynamicLibrary }; + +typedef char bool; +#define false 0 +#define true (!false) + +#ifdef __EMX__ +# define SHELL_CMD "sh" +# define CC "gcc" +# define SHARE_SW "-Zdll -Zmtd" +# define USE_OMF true +# define TRUNCATE_DLL_NAME +# define DYNAMIC_LIB_EXT "dll" +# define EXE_EXT ".exe" + +# if USE_OMF + /* OMF is the native format under OS/2 */ +# define STATIC_LIB_EXT "lib" +# define OBJECT_EXT "obj" +# define LIBRARIAN "emxomfar" +# else + /* but the alternative, a.out, can fork() which is sometimes necessary */ +# define STATIC_LIB_EXT "a" +# define OBJECT_EXT "o" +# define LIBRARIAN "ar" +# endif +#endif + + +typedef struct { + char *arglist[1024]; + int num_args; + enum mode_t mode; + enum output_type_t output_type; + char *stub_name; + char *tmp_dirs[1024]; + int num_tmp_dirs; +} cmd_data_t; + +void parse_args(int argc, char *argv[], cmd_data_t *cmd_data); +bool parse_long_opt(char *arg, cmd_data_t *cmd_data); +bool parse_short_opt(char *arg, cmd_data_t *cmd_data); +bool parse_input_file_name(char *arg, cmd_data_t *cmd_data); +bool parse_output_file_name(char *arg, cmd_data_t *cmd_data); +void post_parse_fixup(cmd_data_t *cmd_data); +bool explode_static_lib(char *lib, cmd_data_t *cmd_data); +int execute_command(cmd_data_t *cmd_data); +char *shell_esc(const char *str); +void cleanup_tmp_dirs(cmd_data_t *cmd_data); + + +int main(int argc, char *argv[]) +{ + int rc; + cmd_data_t cmd_data; + + memset(&cmd_data, 0, sizeof(cmd_data)); + cmd_data.mode = mCompile; + cmd_data.output_type = otGeneral; + + parse_args(argc, argv, &cmd_data); + rc = execute_command(&cmd_data); + + if (rc == 0 && cmd_data.stub_name) { + fopen(cmd_data.stub_name, "w"); + } + + cleanup_tmp_dirs(&cmd_data); + return rc; +} + + + +void parse_args(int argc, char *argv[], cmd_data_t *cmd_data) +{ + int a; + char *arg; + bool argused; + + for (a=1; a < argc; a++) { + arg = argv[a]; + argused = false; + + if (arg[0] == '-') { + if (arg[1] == '-') { + argused = parse_long_opt(arg + 2, cmd_data); + } else if (arg[1] == 'o' && a+1 < argc) { + cmd_data->arglist[cmd_data->num_args++] = arg; + arg = argv[++a]; + argused = parse_output_file_name(arg, cmd_data); + } else { + argused = parse_short_opt(arg + 1, cmd_data); + } + } else { + argused = parse_input_file_name(arg, cmd_data); + } + + if (!argused) { + cmd_data->arglist[cmd_data->num_args++] = arg; + } + } + + post_parse_fixup(cmd_data); +} + + + +bool parse_long_opt(char *arg, cmd_data_t *cmd_data) +{ + char *equal_pos = strchr(arg, '='); + char var[50]; + char value[500]; + + if (equal_pos) { + strncpy(var, arg, equal_pos - arg); + var[equal_pos - arg] = 0; + strcpy(value, equal_pos + 1); + } else { + strcpy(var, arg); + } + + if (strcmp(var, "silent") == 0) { + silent = true; + } else if (strcmp(var, "mode") == 0) { + if (strcmp(value, "compile") == 0) { + cmd_data->mode = mCompile; + cmd_data->output_type = otObject; + } + if (strcmp(value, "link") == 0) { + cmd_data->mode = mLink; + } + } else if (strcmp(var, "shared") == 0) { + shared = true; + } else { + return false; + } + + return true; +} + + + +bool parse_short_opt(char *arg, cmd_data_t *cmd_data) +{ + if (strcmp(arg, "export-dynamic") == 0) { + return true; + } + + if (strcmp(arg, "module") == 0) { + return true; + } + + if (strcmp(arg, "Zexe") == 0) { + return true; + } + + if (strcmp(arg, "avoid-version") == 0) { + return true; + } + + return false; +} + + + +bool parse_input_file_name(char *arg, cmd_data_t *cmd_data) +{ + char *ext = strrchr(arg, '.'); + char *name = strrchr(arg, '/'); + int pathlen; + char *newarg; + + if (!ext) { + return false; + } + + ext++; + + if (name == NULL) { + name = strrchr(arg, '\\'); + + if (name == NULL) { + name = arg; + } else { + name++; + } + } else { + name++; + } + + pathlen = name - arg; + + if (strcmp(ext, "lo") == 0) { + newarg = (char *)malloc(strlen(arg) + 10); + strcpy(newarg, arg); + strcpy(newarg + (ext - arg), OBJECT_EXT); + cmd_data->arglist[cmd_data->num_args++] = newarg; + return true; + } + + if (strcmp(ext, "la") == 0) { + newarg = (char *)malloc(strlen(arg) + 10); + strcpy(newarg, arg); + newarg[pathlen] = 0; + strcat(newarg, ".libs/"); + + if (strncmp(name, "lib", 3) == 0) { + name += 3; + } + + strcat(newarg, name); + ext = strrchr(newarg, '.') + 1; + strcpy(ext, STATIC_LIB_EXT); + cmd_data->arglist[cmd_data->num_args++] = newarg; + return true; + } + + if (strcmp(ext, "c") == 0) { + if (cmd_data->stub_name == NULL) { + cmd_data->stub_name = (char *)malloc(strlen(arg) + 4); + strcpy(cmd_data->stub_name, arg); + strcpy(strrchr(cmd_data->stub_name, '.') + 1, shared ? "slo" : "lo"); + } + } + + if (strcmp(name, CC) == 0 || strcmp(name, CC EXE_EXT) == 0) { + if (cmd_data->output_type == otGeneral) { + cmd_data->output_type = otObject; + } + } + + return false; +} + + + +bool parse_output_file_name(char *arg, cmd_data_t *cmd_data) +{ + char *name = strrchr(arg, '/'); + char *ext = strrchr(arg, '.'); + char *newarg = NULL, *newext; + int pathlen; + + if (name == NULL) { + name = strrchr(arg, '\\'); + + if (name == NULL) { + name = arg; + } else { + name++; + } + } else { + name++; + } + + if (!ext) { + cmd_data->stub_name = arg; + cmd_data->output_type = otProgram; + newarg = (char *)malloc(strlen(arg) + 5); + strcpy(newarg, arg); + strcat(newarg, EXE_EXT); + cmd_data->arglist[cmd_data->num_args++] = newarg; + return true; + } + + ext++; + pathlen = name - arg; + + if (strcmp(ext, "la") == 0) { + cmd_data->stub_name = arg; + cmd_data->output_type = shared ? otDynamicLibrary : otStaticLibrary; + newarg = (char *)malloc(strlen(arg) + 10); + mkdir(".libs", 0); + strcpy(newarg, ".libs/"); + + if (strncmp(arg, "lib", 3) == 0) { + arg += 3; + } + + strcat(newarg, arg); + newext = strrchr(newarg, '.') + 1; + strcpy(newext, shared ? DYNAMIC_LIB_EXT : STATIC_LIB_EXT); + cmd_data->arglist[cmd_data->num_args++] = newarg; + +#ifdef TRUNCATE_DLL_NAME + if (shared) { + /* Cut DLL name down to 8 characters after removing any mod_ prefix */ + int len = ext - name - 1; + char *newname = strrchr(newarg, '/') + 1; + + if (strncmp(newname, "mod_", 4) == 0) { + strcpy(newname, newname + 4); + len -= 4; + } + + if (len > 8) { + strcpy(newname + 8, strchr(newname, '.')); + } + } +#endif + + return true; + } + + if (strcmp(ext, "lo") == 0) { + cmd_data->stub_name = arg; + cmd_data->output_type = otObject; + newarg = (char *)malloc(strlen(newarg) + 2); + strcpy(newarg, arg); + ext = strrchr(newarg, '.') + 1; + strcpy(ext, OBJECT_EXT); + cmd_data->arglist[cmd_data->num_args++] = newarg; + return true; + } + + return false; +} + + + +void post_parse_fixup(cmd_data_t *cmd_data) +{ + int a; + char *arg; + char *ext; + + if (cmd_data->output_type == otStaticLibrary && cmd_data->mode == mLink) { + /* We do a real hatchet job on the args when making a static library + * removing all compiler switches & any other cruft that ar won't like + * We also need to explode any libraries listed + */ + + for (a=0; a < cmd_data->num_args; a++) { + arg = cmd_data->arglist[a]; + + if (arg) { + ext = strrchr(arg, '.'); + + if (ext) { + ext++; + } + + if (arg[0] == '-') { + cmd_data->arglist[a] = NULL; + + if (strcmp(arg, "-rpath") == 0 && a+1 < cmd_data->num_args) { + cmd_data->arglist[a+1] = NULL; + } + + if (strcmp(arg, "-R") == 0 && a+1 < cmd_data->num_args) { + cmd_data->arglist[a+1] = NULL; + } + + if (strcmp(arg, "-version-info") == 0 && a+1 < cmd_data->num_args) { + cmd_data->arglist[a+1] = NULL; + } + + if (strcmp(arg, "-o") == 0) { + a++; + } + } + + if (strcmp(arg, CC) == 0 || strcmp(arg, CC EXE_EXT) == 0) { + cmd_data->arglist[a] = LIBRARIAN " cr"; + } + + if (ext) { + if (strcmp(ext, "h") == 0 || strcmp(ext, "c") == 0) { + /* ignore source files, they don't belong in a library */ + cmd_data->arglist[a] = NULL; + } + + if (strcmp(ext, STATIC_LIB_EXT) == 0) { + cmd_data->arglist[a] = NULL; + explode_static_lib(arg, cmd_data); + } + } + } + } + } + + if (cmd_data->output_type == otDynamicLibrary) { + for (a=0; a < cmd_data->num_args; a++) { + arg = cmd_data->arglist[a]; + + if (arg) { + if (strcmp(arg, "-rpath") == 0 && a+1 < cmd_data->num_args) { + cmd_data->arglist[a] = NULL; + cmd_data->arglist[a+1] = NULL; + } + } + } + } + +#if USE_OMF + if (cmd_data->output_type == otObject || + cmd_data->output_type == otProgram || + cmd_data->output_type == otDynamicLibrary) { + cmd_data->arglist[cmd_data->num_args++] = "-Zomf"; + } +#endif + + if (shared) { + cmd_data->arglist[cmd_data->num_args++] = SHARE_SW; + } +} + + + +int execute_command(cmd_data_t *cmd_data) +{ + int target = 0; + char *command; + int a, total_len = 0; + char *args[4]; + + for (a=0; a < cmd_data->num_args; a++) { + if (cmd_data->arglist[a]) { + total_len += strlen(cmd_data->arglist[a]) + 1; + } + } + + command = (char *)malloc( total_len ); + command[0] = 0; + + for (a=0; a < cmd_data->num_args; a++) { + if (cmd_data->arglist[a]) { + strcat(command, cmd_data->arglist[a]); + strcat(command, " "); + } + } + + command[strlen(command)-1] = 0; + + if (!silent) { + puts(command); + } + + cmd_data->num_args = target; + cmd_data->arglist[cmd_data->num_args] = NULL; + command = shell_esc(command); + + args[0] = SHELL_CMD; + args[1] = "-c"; + args[2] = command; + args[3] = NULL; + return spawnvp(P_WAIT, args[0], args); +} + + + +char *shell_esc(const char *str) +{ + char *cmd; + unsigned char *d; + const unsigned char *s; + + cmd = (char *)malloc(2 * strlen(str) + 1); + d = (unsigned char *)cmd; + s = (const unsigned char *)str; + + for (; *s; ++s) { + if (*s == '"' || *s == '\\') { + *d++ = '\\'; + } + *d++ = *s; + } + + *d = '\0'; + return cmd; +} + + + +bool explode_static_lib(char *lib, cmd_data_t *cmd_data) +{ + char tmpdir[1024]; + char savewd[1024]; + char cmd[1024]; + char *name; + DIR *dir; + struct dirent *entry; + + strcpy(tmpdir, lib); + strcat(tmpdir, ".exploded"); + + mkdir(tmpdir, 0); + cmd_data->tmp_dirs[cmd_data->num_tmp_dirs++] = strdup(tmpdir); + getcwd(savewd, sizeof(savewd)); + + if (chdir(tmpdir) != 0) + return false; + + strcpy(cmd, LIBRARIAN " x "); + name = strrchr(lib, '/'); + + if (name) { + name++; + } else { + name = lib; + } + + strcat(cmd, "../"); + strcat(cmd, name); + system(cmd); + chdir(savewd); + dir = opendir(tmpdir); + + while ((entry = readdir(dir)) != NULL) { + if (entry->d_name[0] != '.') { + strcpy(cmd, tmpdir); + strcat(cmd, "/"); + strcat(cmd, entry->d_name); + cmd_data->arglist[cmd_data->num_args++] = strdup(cmd); + } + } + + closedir(dir); + return true; +} + + + +void cleanup_tmp_dir(char *dirname) +{ + DIR *dir; + struct dirent *entry; + char fullname[1024]; + + dir = opendir(dirname); + + if (dir == NULL) + return; + + while ((entry = readdir(dir)) != NULL) { + if (entry->d_name[0] != '.') { + strcpy(fullname, dirname); + strcat(fullname, "/"); + strcat(fullname, entry->d_name); + remove(fullname); + } + } + + rmdir(dirname); +} + + + +void cleanup_tmp_dirs(cmd_data_t *cmd_data) +{ + int d; + + for (d=0; d < cmd_data->num_tmp_dirs; d++) { + cleanup_tmp_dir(cmd_data->tmp_dirs[d]); + } +} From 492099c633ef51e88e9584a7f8f1ad3e89728a96 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 29 Mar 2001 15:50:29 +0000 Subject: [PATCH 1405/7878] Build & use aplibtool on OS/2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61394 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 812f407d9b6..01136029c7a 100644 --- a/configure.in +++ b/configure.in @@ -79,7 +79,18 @@ dnl dnl prep libtool dnl echo "performing libtool configuration..." -AC_PROG_LIBTOOL + +case "$host_alias" in +*os2*) + # Use a custom made libtool replacement + echo "using aplibtool" + LIBTOOL="$srcdir/build/aplibtool" + gcc -o $LIBTOOL.exe $LIBTOOL.c + ;; +*) + AC_PROG_LIBTOOL + ;; +esac dnl #----------------------------- Checks for compiler flags nl=' From fad4fd5623728565a1478e627ef24e5ca908f572 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 30 Mar 2001 06:22:23 +0000 Subject: [PATCH 1406/7878] ignore a relatively new executable: testpoll git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61395 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.cvsignore b/test/.cvsignore index ba4cd740767..734127b59a4 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -11,6 +11,7 @@ testargs testdso testoc testpipe +testpoll testshmem testtime testthread From f1f947eb50b31cf27ce24655b13b2b0fd2f239d6 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 31 Mar 2001 05:23:37 +0000 Subject: [PATCH 1407/7878] Make it easier to replace libtool on OS/2 by copying libtool.m4 into aclocal.m4 rather than distributing it under its own name. This way we can copy a replacement for libtool.m4 on those platforms that don't work well with libtool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61396 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 1 + CHANGES | 3 +++ build/.cvsignore | 1 - buildconf | 59 ++++++++++++++++++++++++++---------------------- configure.in | 14 +----------- 5 files changed, 37 insertions(+), 41 deletions(-) diff --git a/.cvsignore b/.cvsignore index 50ed0dde63b..0cb30a052da 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,4 +1,5 @@ Makefile +aclocal.m4 config.cache config.log config.status diff --git a/CHANGES b/CHANGES index 0e256569f6c..958bb907d2b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Make it easier to replace libtool on OS/2 via aclocal.m4. + [Roy Fielding] + *) Add apr_ipsubnet_create() and apr_ipsubnet_test() for testing whether or not an address is within a subnet. [Jeff Trawick] diff --git a/build/.cvsignore b/build/.cvsignore index 6226c1f67e2..62437018a1f 100644 --- a/build/.cvsignore +++ b/build/.cvsignore @@ -1,4 +1,3 @@ -libtool.m4 ltconfig ltmain.sh rules.mk diff --git a/buildconf b/buildconf index 06e0f3f9f80..9f867997b1e 100755 --- a/buildconf +++ b/buildconf @@ -56,38 +56,43 @@ # buildconf: Build the support scripts needed to compile from a # checked-out version of the source code. -# Verify that the builder has the right config tools installed -# -build/buildcheck.sh || exit 1 - -libtoolize=`build/PrintPath glibtoolize libtoolize` -if [ "x$libtoolize" = "x" ]; then - echo "libtoolize not found in path" - exit 1 -fi +osname=`build/config.guess` +case "$osname" in + *os2_emx*) + echo "Using OS/2-specific aplibtool" + cp -f build/os2_libtool.m4 aclocal.m4 + ;; + *) + # Verify that the builder has the right config tools installed + # + build/buildcheck.sh || exit 1 -# Create the libtool helper files -# -# Note: we copy (rather than link) them to simplify distribution. -# Note: APR supplies its own config.guess and config.sub -- we do not -# rely on libtool's versions -# -echo "Copying libtool helper files ..." + libtoolize=`build/PrintPath glibtoolize libtoolize` + if [ "x$libtoolize" = "x" ]; then + echo "libtoolize not found in path" + exit 1 + fi -$libtoolize --copy --automake + # Create the libtool helper files + # + # Note: we copy (rather than link) them to simplify distribution. + # Note: APR supplies its own config.guess and config.sub -- we do not + # rely on libtool's versions + # + echo "Copying libtool helper files ..." -ltpath=`dirname $libtoolize` -ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 + $libtoolize --copy --automake -if [ ! -f $ltfile ]; then - echo "$ltfile not found" - exit 1 -fi -cp -f $ltfile build/libtool.m4 + ltpath=`dirname $libtoolize` + ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 -# This is just temporary until people's workspaces are cleared -- remove -# any old aclocal.m4 left over from prior build so it doesn't cause errors. -rm -f aclocal.m4 + if [ ! -f $ltfile ]; then + echo "$ltfile not found" + exit 1 + fi + cp -f $ltfile aclocal.m4 + ;; +esac # # Generate the autoconf header and ./configure diff --git a/configure.in b/configure.in index 01136029c7a..c475e17d98a 100644 --- a/configure.in +++ b/configure.in @@ -15,7 +15,6 @@ sinclude(build/apr_common.m4) sinclude(build/apr_network.m4) sinclude(build/apr_threads.m4) sinclude(build/apr_hints.m4) -sinclude(build/libtool.m4) AC_CANONICAL_SYSTEM echo "Configuring APR library" @@ -79,18 +78,7 @@ dnl dnl prep libtool dnl echo "performing libtool configuration..." - -case "$host_alias" in -*os2*) - # Use a custom made libtool replacement - echo "using aplibtool" - LIBTOOL="$srcdir/build/aplibtool" - gcc -o $LIBTOOL.exe $LIBTOOL.c - ;; -*) - AC_PROG_LIBTOOL - ;; -esac +AC_PROG_LIBTOOL dnl #----------------------------- Checks for compiler flags nl=' From 97050e3bc96c5480ab151a4973248dc5c718384d Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 31 Mar 2001 05:24:40 +0000 Subject: [PATCH 1408/7878] A cheap replacement for libtool.m4 on OS/2 -- copied to ../aclocal.m4 by the buildconf script. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61397 13f79535-47bb-0310-9956-ffa450edef68 --- build/os2_libtool.m4 | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 build/os2_libtool.m4 diff --git a/build/os2_libtool.m4 b/build/os2_libtool.m4 new file mode 100644 index 00000000000..aea8cddd50b --- /dev/null +++ b/build/os2_libtool.m4 @@ -0,0 +1,10 @@ +## os2_libtool.m4 - Replacement for libtool.m4 on OS/2 + +AC_DEFUN(AC_PROG_LIBTOOL, +echo "using OS/2-specific aplibtool" + +LIBTOOL="$srcdir/build/aplibtool" +AC_SUBST(LIBTOOL)dnl + +gcc -o $CPPFLAGS $CFLAGS $LIBTOOL.exe $LIBTOOL.c +])dnl From 7183bb0d454c0e5b8834d2adfeb89f2cbf86d053 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 31 Mar 2001 05:32:42 +0000 Subject: [PATCH 1409/7878] oops -- didn't notice the missing bracket until the commit message. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61398 13f79535-47bb-0310-9956-ffa450edef68 --- build/os2_libtool.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/os2_libtool.m4 b/build/os2_libtool.m4 index aea8cddd50b..f3880c72f56 100644 --- a/build/os2_libtool.m4 +++ b/build/os2_libtool.m4 @@ -1,7 +1,7 @@ ## os2_libtool.m4 - Replacement for libtool.m4 on OS/2 AC_DEFUN(AC_PROG_LIBTOOL, -echo "using OS/2-specific aplibtool" +[echo "using OS/2-specific aplibtool" LIBTOOL="$srcdir/build/aplibtool" AC_SUBST(LIBTOOL)dnl From d4a0d4996785b8556eac756788220559e51b1272 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 31 Mar 2001 05:52:42 +0000 Subject: [PATCH 1410/7878] Revert last change -- I forgot that buildconf is run before we create a release tarball, so it can't be OS-specific. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61399 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 1 - CHANGES | 3 --- build/.cvsignore | 1 + buildconf | 59 ++++++++++++++++++++++-------------------------- configure.in | 14 +++++++++++- 5 files changed, 41 insertions(+), 37 deletions(-) diff --git a/.cvsignore b/.cvsignore index 0cb30a052da..50ed0dde63b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,5 +1,4 @@ Makefile -aclocal.m4 config.cache config.log config.status diff --git a/CHANGES b/CHANGES index 958bb907d2b..0e256569f6c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,5 @@ Changes with APR b1 - *) Make it easier to replace libtool on OS/2 via aclocal.m4. - [Roy Fielding] - *) Add apr_ipsubnet_create() and apr_ipsubnet_test() for testing whether or not an address is within a subnet. [Jeff Trawick] diff --git a/build/.cvsignore b/build/.cvsignore index 62437018a1f..6226c1f67e2 100644 --- a/build/.cvsignore +++ b/build/.cvsignore @@ -1,3 +1,4 @@ +libtool.m4 ltconfig ltmain.sh rules.mk diff --git a/buildconf b/buildconf index 9f867997b1e..06e0f3f9f80 100755 --- a/buildconf +++ b/buildconf @@ -56,43 +56,38 @@ # buildconf: Build the support scripts needed to compile from a # checked-out version of the source code. -osname=`build/config.guess` -case "$osname" in - *os2_emx*) - echo "Using OS/2-specific aplibtool" - cp -f build/os2_libtool.m4 aclocal.m4 - ;; - *) - # Verify that the builder has the right config tools installed - # - build/buildcheck.sh || exit 1 +# Verify that the builder has the right config tools installed +# +build/buildcheck.sh || exit 1 + +libtoolize=`build/PrintPath glibtoolize libtoolize` +if [ "x$libtoolize" = "x" ]; then + echo "libtoolize not found in path" + exit 1 +fi - libtoolize=`build/PrintPath glibtoolize libtoolize` - if [ "x$libtoolize" = "x" ]; then - echo "libtoolize not found in path" - exit 1 - fi +# Create the libtool helper files +# +# Note: we copy (rather than link) them to simplify distribution. +# Note: APR supplies its own config.guess and config.sub -- we do not +# rely on libtool's versions +# +echo "Copying libtool helper files ..." - # Create the libtool helper files - # - # Note: we copy (rather than link) them to simplify distribution. - # Note: APR supplies its own config.guess and config.sub -- we do not - # rely on libtool's versions - # - echo "Copying libtool helper files ..." +$libtoolize --copy --automake - $libtoolize --copy --automake +ltpath=`dirname $libtoolize` +ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 - ltpath=`dirname $libtoolize` - ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 +if [ ! -f $ltfile ]; then + echo "$ltfile not found" + exit 1 +fi +cp -f $ltfile build/libtool.m4 - if [ ! -f $ltfile ]; then - echo "$ltfile not found" - exit 1 - fi - cp -f $ltfile aclocal.m4 - ;; -esac +# This is just temporary until people's workspaces are cleared -- remove +# any old aclocal.m4 left over from prior build so it doesn't cause errors. +rm -f aclocal.m4 # # Generate the autoconf header and ./configure diff --git a/configure.in b/configure.in index c475e17d98a..01136029c7a 100644 --- a/configure.in +++ b/configure.in @@ -15,6 +15,7 @@ sinclude(build/apr_common.m4) sinclude(build/apr_network.m4) sinclude(build/apr_threads.m4) sinclude(build/apr_hints.m4) +sinclude(build/libtool.m4) AC_CANONICAL_SYSTEM echo "Configuring APR library" @@ -78,7 +79,18 @@ dnl dnl prep libtool dnl echo "performing libtool configuration..." -AC_PROG_LIBTOOL + +case "$host_alias" in +*os2*) + # Use a custom made libtool replacement + echo "using aplibtool" + LIBTOOL="$srcdir/build/aplibtool" + gcc -o $LIBTOOL.exe $LIBTOOL.c + ;; +*) + AC_PROG_LIBTOOL + ;; +esac dnl #----------------------------- Checks for compiler flags nl=' From 7cf58edded5fc3a74a0194e8befe562757e57785 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 31 Mar 2001 06:05:40 +0000 Subject: [PATCH 1411/7878] We can't use this after all. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61400 13f79535-47bb-0310-9956-ffa450edef68 --- build/os2_libtool.m4 | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 build/os2_libtool.m4 diff --git a/build/os2_libtool.m4 b/build/os2_libtool.m4 deleted file mode 100644 index f3880c72f56..00000000000 --- a/build/os2_libtool.m4 +++ /dev/null @@ -1,10 +0,0 @@ -## os2_libtool.m4 - Replacement for libtool.m4 on OS/2 - -AC_DEFUN(AC_PROG_LIBTOOL, -[echo "using OS/2-specific aplibtool" - -LIBTOOL="$srcdir/build/aplibtool" -AC_SUBST(LIBTOOL)dnl - -gcc -o $CPPFLAGS $CFLAGS $LIBTOOL.exe $LIBTOOL.c -])dnl From b55bdb3987ea90001e9f2ad9b1ef860648f835a5 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 31 Mar 2001 06:07:07 +0000 Subject: [PATCH 1412/7878] Eliminate annoying warning from libtoolize and make sure that LIBTOOL is substituted on OS/2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61401 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 01136029c7a..02eac6a15ea 100644 --- a/configure.in +++ b/configure.in @@ -85,10 +85,11 @@ case "$host_alias" in # Use a custom made libtool replacement echo "using aplibtool" LIBTOOL="$srcdir/build/aplibtool" - gcc -o $LIBTOOL.exe $LIBTOOL.c + AC_SUBST(LIBTOOL)dnl + gcc $CPPFLAGS $CFLAGS -o $LIBTOOL.exe $LIBTOOL.c ;; -*) - AC_PROG_LIBTOOL +*) dnl libtool requires that the following not be indented +AC_PROG_LIBTOOL ;; esac From be676e7ec4e242e5e69526c302491386b733e7d2 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 31 Mar 2001 06:20:00 +0000 Subject: [PATCH 1413/7878] It's too easy to forget that the m4 pass is not affected by the shell conditionals. This just removes a redundancy and fixes typos. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61402 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 02eac6a15ea..75a31df929e 100644 --- a/configure.in +++ b/configure.in @@ -82,13 +82,12 @@ echo "performing libtool configuration..." case "$host_alias" in *os2*) - # Use a custom made libtool replacement + # Use a custom-made libtool replacement echo "using aplibtool" LIBTOOL="$srcdir/build/aplibtool" - AC_SUBST(LIBTOOL)dnl gcc $CPPFLAGS $CFLAGS -o $LIBTOOL.exe $LIBTOOL.c ;; -*) dnl libtool requires that the following not be indented +*) dnl libtoolize requires that the following not be indented AC_PROG_LIBTOOL ;; esac From 9513880ea7bb92afe5d05f06c8672f7e6263b67a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 31 Mar 2001 06:22:38 +0000 Subject: [PATCH 1414/7878] First draft implementation of unix apr_filepath_ get, set, merge, and parse_root. [William Rowe] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61403 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + file_io/unix/Makefile.in | 1 + file_io/unix/filepath.c | 317 +++++++++++++++++++++++++++++++++++++++ include/apr_file_info.h | 45 +++++- 4 files changed, 362 insertions(+), 4 deletions(-) create mode 100644 file_io/unix/filepath.c diff --git a/CHANGES b/CHANGES index 0e256569f6c..a23102eb8e7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) First draft implementation of apr_filepath (get/set/parse_root + and merge) for Unix. [William Rowe] + *) Add apr_ipsubnet_create() and apr_ipsubnet_test() for testing whether or not an address is within a subnet. [Jeff Trawick] diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index ca1ac0c204b..975864f8ef2 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -3,6 +3,7 @@ TARGETS = \ dir.lo \ fileacc.lo \ filedup.lo \ + filepath.lo \ filestat.lo \ flock.lo \ fullrw.lo \ diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c new file mode 100644 index 00000000000..66df3956536 --- /dev/null +++ b/file_io/unix/filepath.c @@ -0,0 +1,317 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "fileio.h" +#include "apr_file_io.h" +#include "apr_strings.h" +#if APR_HAVE_UNISTD_H +#include +#endif + +#include + + +/* Any OS that requires/refuses trailing slashes should be delt with here. + */ +APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_pool_t *p) +{ + char path[APR_PATH_MAX]; + if (!getcwd(path, sizeof(path))) { + if (errno == ERANGE) + return APR_ENAMETOOLONG; + else + return errno; + } + *defpath = apr_pstrdup(p, path); + return APR_SUCCESS; +} + + +/* Any OS that requires/refuses trailing slashes should be delt with here + */ +APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p) +{ + if (chdir(path) != 0) + return errno; + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_filepath_parse_root(const char **rootpath, + const char **inpath, + apr_pool_t *p) +{ + if (**inpath == '/') + { + *rootpath = apr_pstrdup(p, "/"); + ++*inpath; + return APR_EABSOLUTE; + } + + return APR_ERELATIVE; +} + + +APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, + const char *rootpath, + const char *addpath, + apr_int32_t flags, + apr_pool_t *p) +{ + char path[APR_PATH_MAX]; + apr_size_t rootlen; /* is the original rootpath len */ + apr_size_t newseg; /* is the path offset to the added path */ + apr_size_t addseg; /* is the path offset we are appending at */ + apr_size_t endseg; /* is the end of the current segment */ + apr_status_t rv; + + /* Treat null as an empty path. + */ + if (!addpath) + addpath = ""; + + if (addpath[0] == '/') + { + /* If addpath is rooted, then rootpath is unused. + * Ths violates any APR_FILEPATH_SECUREROOTTEST and + * APR_FILEPATH_NOTABSOLUTE flags specified. + */ + if (flags & APR_FILEPATH_SECUREROOTTEST) + return APR_EABOVEROOT; + if (flags & APR_FILEPATH_NOTABSOLUTE) + return APR_EABSOLUTE; + + /* If APR_FILEPATH_NOTABOVEROOT wasn't specified, + * we won't test the root again, it's ignored. + * Waste no CPU retrieving the working path. + */ + if (!rootpath && !(flags & APR_FILEPATH_NOTABOVEROOT)) + rootpath = ""; + } + else + { + /* If APR_FILEPATH_NOTABSOLUTE is specified, the caller + * requires a relative result. If the rootpath is + * ommitted, we do not retrieve the working path, + * if rootpath was supplied as absolute then fail. + */ + if (flags & APR_FILEPATH_NOTABSOLUTE) + { + if (!rootpath) + rootpath = ""; + else if (rootpath[0] == '/') + return APR_EABSOLUTE; + } + } + + if (!rootpath) + { + /* Start with the current working path. This is bass akwards, + * but required since the compiler (at least vc) doesn't like + * passing the address of a char const* for a char** arg. + */ + char *getpath; + rv = apr_filepath_get(&getpath, p); + rootpath = getpath; + if (rv != APR_SUCCESS) + return errno; + + /* XXX: Any kernel subject to goofy, uncanonical results + * must run the rootpath against the user's given flags. + * Simplest would be a recursive call to apr_filepath_merge + * with an empty (not null) rootpath and addpath of the cwd. + */ + } + + rootlen = strlen(rootpath); + + if (addpath[0] == '/') + { + /* Ignore the given root path, strip off leading + * '/'s to a single leading '/' from the addpath, + * and leave addpath at the first non-'/' character. + */ + newseg = 0; + while (addpath[0] == '/') + ++addpath; + strcpy (path, "/"); + addseg = 1; + } + else + { + /* If both paths are relative, fail early + */ + if (rootpath[0] != '/' && (flags & APR_FILEPATH_NOTRELATIVE)) + return APR_ERELATIVE; + + /* Base the result path on the rootpath + */ + newseg = rootlen; + if (rootlen >= sizeof(path)) + return APR_ENAMETOOLONG; + strcpy(path, rootpath); + + /* Always '/' terminate the given root path + */ + if (newseg && path[newseg - 1] != '/') { + if (newseg + 1 >= sizeof(path)) + return APR_ENAMETOOLONG; + path[newseg++] = '/'; + path[newseg] = '\0'; + } + addseg = newseg; + } + + while (*addpath) + { + /* Parse each segment, find the closing '/' + */ + endseg = 0; + while (addpath[endseg] && addpath[endseg] != '/') + ++endseg; + + if (endseg == 0 || (endseg == 1 && addpath[0] == '.')) + { + /* noop segment (/ or ./) so skip it + */ + } + else if (endseg == 2 && addpath[0] == '.' && addpath[1] == '.') + { + /* backpath (../) */ + if (addseg == 1 && path[0] == '/') + { + /* Attempt to move above root. Always die if the + * APR_FILEPATH_SECUREROOTTEST flag is specified. + */ + if (flags & APR_FILEPATH_SECUREROOTTEST) + return APR_EABOVEROOT; + + /* Otherwise this is simply a noop, above root is root. + * Flag that rootpath was entirely replaced. + */ + newseg = 0; + } + else if (addseg == 0 || (addseg >= 3 + && strcmp(path + addseg - 3, "../") == 0)) + { + /* Path is already backpathed or empty, if the + * APR_FILEPATH_SECUREROOTTEST.was given die now. + */ + if (flags & APR_FILEPATH_SECUREROOTTEST) + return APR_EABOVEROOT; + + /* Otherwise append another backpath. + */ + if (addseg + 3 >= sizeof(path)) + return APR_ENAMETOOLONG; + strcpy(path + addseg, "../"); + addseg += 3; + } + else + { + /* otherwise crop the prior segment + */ + do { + --addseg; + } while (addseg && path[addseg - 1] != '/'); + path[addseg] = '\0'; + } + + /* Now test if we are above where we started and back up + * the newseg offset to reflect the added/altered path. + */ + if (addseg < newseg) + { + if (flags & APR_FILEPATH_SECUREROOTTEST) + return APR_EABOVEROOT; + newseg = addseg; + } + } + else + { + /* An actual segment, append it to the destination path + */ + apr_size_t i = (addpath[endseg] != '\0'); + if (addseg + endseg + i >= sizeof(path)) + return APR_ENAMETOOLONG; + strncpy(path + addseg, addpath, endseg + i); + addseg += endseg + i; + } + + /* Skip over trailing slash to the next segment + */ + if (addpath[endseg]) + ++endseg; + + addpath += endseg; + } + + /* newseg will be the rootlen unless the addpath contained + * backpath elements. If so, and APR_FILEPATH_NOTABOVEROOT + * is specified (APR_FILEPATH_SECUREROOTTEST was caught above), + * compare the original root to assure the result path is + * still within given root path. + */ + if ((flags & APR_FILEPATH_NOTABOVEROOT) && newseg < rootlen) { + if (strncmp(rootpath, path, rootlen)) + return APR_EABOVEROOT; + if (rootpath[rootlen - 1] != '/' + && path[rootlen] && path[rootlen] != '/') + return APR_EABOVEROOT; + } + + *newpath = apr_pstrdup(p, path); + return (newpath ? APR_SUCCESS : APR_ENOMEM); +} \ No newline at end of file diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 924ea09fbe3..17ff8ef3b88 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -291,6 +291,25 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); */ #define APR_FILEPATH_TRUENAME 0x20 +/** + * Extract the rootpath from the given filepath + * @param rootpath the root file path returned with APR_SUCCESS or APR_EINCOMPLETE + * @param filepath the pathname to parse for it's root component + * @param p the pool to allocate the new path string from + * @deffunc apr_status_t apr_filepath_root(const char **rootpath, const char **inpath, apr_pool_t *p) + * @tip on return, filepath now points to the character following the root. + * In the simplest example, given a filepath of "/foo", returns the rootpath + * of "/" and filepath points at "foo". This is far more complex on other + * platforms, which even changes alternate format of rootpath to canonical + * form. The function returns APR_ERELATIVE if filepath isn't rooted (an + * error), APR_EINCOMPLETE if the root path is ambigious (but potentially + * legitimate, e.g. "/" on Windows is incomplete because it doesn't specify + * the drive letter), or APR_EBADPATH if the root is simply invalid. + * APR_SUCCESS is returned if filepath is an absolute path. + */ +APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, + const char **filepath, + apr_pool_t *p); /** * Merge additional file path onto the previously processed rootpath @@ -301,10 +320,28 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); * @param p the pool to allocate the new path string from * @deffunc apr_status_t apr_filepath_merge(char **newpath, const char *rootpath, const char *addpath, apr_int32_t flags, apr_pool_t *p) */ -APR_DECLARE(apr_status_t) - apr_filepath_merge(char **newpath, const char *rootpath, - const char *addpath, apr_int32_t flags, - apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, + const char *rootpath, + const char *addpath, + apr_int32_t flags, + apr_pool_t *p); + +/** + * Return the default file path (for relative file names) + * @param path the default path string returned + * @param p the pool to allocate the default path string from + * @deffunc apr_status_t apr_filepath_get(char **path, apr_pool_t *p) + */ +APR_DECLARE(apr_status_t) apr_filepath_get(char **path, apr_pool_t *p); + +/** + * Set the default file path (for relative file names) + * @param path the default path returned + * @param p the pool to allocate any working storage + * @deffunc apr_status_t apr_filepath_get(char **defpath, apr_pool_t *p) + */ +APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p); + #ifdef __cplusplus } From a30fd30e7ef15a791d38eb6a1f6c7322df1c8607 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 31 Mar 2001 07:29:06 +0000 Subject: [PATCH 1415/7878] This hurts on win32 at the moment, work around apr_terminate git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61404 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmd5.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/testmd5.c b/test/testmd5.c index 113f8a5d80b..4329cbbac6c 100644 --- a/test/testmd5.c +++ b/test/testmd5.c @@ -83,6 +83,11 @@ struct testcase testcases[] = "\xd1\xa1\xc0\x97\x8a\x60\xbb\xfb\x2a\x25\x46\x9d\xa5\xae\xd0\xb0"} }; +static void closeapr(void) +{ + apr_terminate(); +} + static void try(const void *buf, size_t bufLen, apr_xlate_t *xlate, const void *digest) { @@ -152,7 +157,7 @@ int main(int argc, char **argv) rv = apr_initialize(); assert(!rv); - atexit(apr_terminate); + atexit(closeapr); rv = apr_pool_create(&pool, NULL); From 864e222ee27628e3e5356c717ef8ad65cc316d14 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 31 Mar 2001 07:54:47 +0000 Subject: [PATCH 1416/7878] This gets us nmake'ing on win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61405 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl index cb2cce517ad..6d5f88697e4 100644 --- a/test/MakeWin32Make.pl +++ b/test/MakeWin32Make.pl @@ -9,8 +9,8 @@ $t = "ALL: \$(TARGETS)\n\n" . "CL = cl.exe\n" . "LINK = link.exe /nologo /debug /machine:I386\n\n" - . ".c.obj::\n" - . "\t\$(CL) -c \$*.c \$(CFLAGS)\n"; + . "#.c.obj::\n" + . "#\t\$(CL) -c \$*.c \$(CFLAGS)\n"; } if ($t =~ m|^ALL_LIBS=|) { $t = "ALL_LIBS=../LibD/apr.lib kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib"; @@ -18,7 +18,7 @@ if ($t =~ s|\@CFLAGS\@|\/nologo \/MDd \/W3 \/Gm \/GX \/Zi \/Od \/D "_DEBUG" \/D "WIN32" \/D APR_DECLARE_STATIC \/FD|) { $t =~ s|-g ||; } - $t =~ s|\@LDFLAGS\@||; + $t =~ s|\$\{LD_FLAGS\}||; $t =~ s|\.\./libapr\.la|../LibD/apr.lib|; $t =~ s|\@RM\@|del|; @@ -38,7 +38,7 @@ $t =~ s|--export-dynamic ||; $t =~ s|-fPIC ||; } - if ($t =~ s|--module|\/subsystem:windows \/dll|) { + if ($t =~ s|-shared|\/subsystem:windows \/dll|) { $t =~ s|-o (\S+)|\/out:\"$1\"|; } while ($t =~ s|\.a\b|\.lib|) {} From 715d454c538da16c3d0e6da93fc6409dfcd95191 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 31 Mar 2001 07:57:00 +0000 Subject: [PATCH 1417/7878] Hmmm... can't stand unimplemented features - needs review by the FirstBill though! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61406 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 59827bd50ee..8bd7c9d4cd9 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -69,6 +69,8 @@ * bytes. */ #define MAX_SEGMENT_SIZE 65536 + + APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { @@ -91,6 +93,7 @@ APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, return APR_SUCCESS; } + APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) { @@ -115,6 +118,7 @@ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, } + APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_int32_t *nbytes) @@ -147,6 +151,61 @@ APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, *nbytes = dwBytes; return APR_SUCCESS; } + + +APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, + apr_size_t *len) +{ + apr_ssize_t rv; + + rv = sendto(sock->sock, buf, (*len), flags, + (const struct sockaddr*)&where->sa, + where->salen); + if (rv == SOCKET_ERROR) { + *len = 0; + return apr_get_netos_error(); + } + + *len = rv; + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, + apr_socket_t *sock, + apr_int32_t flags, + char *buf, apr_size_t *len) +{ + apr_ssize_t rv; + apr_status_t err; + + if (from == NULL){ + return APR_ENOMEM; + /* Not sure if this is correct. Maybe we should just allocate + the memory?? + */ + } + + rv = recvfrom(sock->sock, buf, (*len), flags, + (struct sockaddr*)&from->sa, &from->salen); + if (rv == SOCKET_ERROR) { + (*len) = 0; + return apr_get_netos_error(); + } + + if (err) { + return errno; + } + + (*len) = rv; + if (rv == 0) + return APR_EOF; + + return APR_SUCCESS; +} + + static void collapse_iovec(char **buf, int *len, struct iovec *iovec, int numvec, apr_pool_t *p) { int ptr = 0; @@ -169,6 +228,8 @@ static void collapse_iovec(char **buf, int *len, struct iovec *iovec, int numvec } } } + + #if APR_HAS_SENDFILE /* *#define WAIT_FOR_EVENT From b1a3d52cd2c5f6e2808ec85d97e1f0a619649d4a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 31 Mar 2001 07:57:44 +0000 Subject: [PATCH 1418/7878] Hmmm... on this (rare) point the castless caste looses :-/ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61407 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/time.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/time/win32/time.c b/time/win32/time.c index 9d8836da5dd..2a6fcb5e1b5 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -253,5 +253,8 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_exploded_time_t *aprtime, APR_DECLARE(void) apr_sleep(apr_interval_time_t t) { - Sleep(t/1000); + /* One of the few sane situations for a cast, Sleep + * is in ms, not us, and passed as a DWORD value + */ + Sleep((DWORD)(t / 1000)); } From da8f4fd655e4ac8ce08f3663d3a885751de3df1b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 31 Mar 2001 08:08:03 +0000 Subject: [PATCH 1419/7878] Ignorable [some say most win32 files are] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61408 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/.cvsignore b/test/.cvsignore index 734127b59a4..cb7488d280a 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -23,11 +23,13 @@ testfile occhild sendfile testuuid -testsuite -testsuite.opt -testsuite.ncb +aprtest +aprtest.ncb +aprtest.opt +aprtest.plg testfile.tmp testflock testsockopt testipsub - +*.ilk +*.pdb From f3c83d0155b61f2b7d878f0789afbb0dd6af530c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 31 Mar 2001 08:09:22 +0000 Subject: [PATCH 1420/7878] Don't look here either git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61409 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/.cvsignore b/test/.cvsignore index cb7488d280a..270c8f1806b 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -33,3 +33,5 @@ testsockopt testipsub *.ilk *.pdb +*.idb +mod_test From 78c87beb3482ba8dd4cf57cd3756c41e2c6a22ed Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 31 Mar 2001 08:10:09 +0000 Subject: [PATCH 1421/7878] Um... more specific, I guess git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61410 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/.cvsignore b/test/.cvsignore index 270c8f1806b..2f432f49555 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -34,4 +34,4 @@ testipsub *.ilk *.pdb *.idb -mod_test +mod_test.dll From 13de29db8411294779102ffce9a86b9edf58f414 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 31 Mar 2001 11:17:13 +0000 Subject: [PATCH 1422/7878] get filepath.c to compile on Linux/FreeBSD/etc. by dropping the include of direct.h (a Windows thing as far as google can tell me) fix a warning by changing the name of apr_filepath_parse_root() to match the prototype in apr_file_info.h other trivial tweaks (spelling, adding '\n' to last line) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61411 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 66df3956536..9fdc77fa03f 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -60,10 +60,7 @@ #include #endif -#include - - -/* Any OS that requires/refuses trailing slashes should be delt with here. +/* Any OS that requires/refuses trailing slashes should be dealt with here. */ APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_pool_t *p) { @@ -79,7 +76,7 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_pool_t *p) } -/* Any OS that requires/refuses trailing slashes should be delt with here +/* Any OS that requires/refuses trailing slashes should be dealt with here */ APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p) { @@ -88,10 +85,9 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p) return APR_SUCCESS; } - -APR_DECLARE(apr_status_t) apr_filepath_parse_root(const char **rootpath, - const char **inpath, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, + const char **inpath, + apr_pool_t *p) { if (**inpath == '/') { @@ -103,7 +99,6 @@ APR_DECLARE(apr_status_t) apr_filepath_parse_root(const char **rootpath, return APR_ERELATIVE; } - APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, const char *rootpath, const char *addpath, @@ -314,4 +309,4 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, *newpath = apr_pstrdup(p, path); return (newpath ? APR_SUCCESS : APR_ENOMEM); -} \ No newline at end of file +} From b527eb341172400201a9c96bcf1100b62ac29b74 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 31 Mar 2001 12:23:39 +0000 Subject: [PATCH 1423/7878] Provide a fall-back definition of TRUSTEE_IS_WELL_KNOWN_GROUP so that APR compiles with MSVC 5.0. PR: 7489 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61412 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/arch/win32/fileio.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index a23102eb8e7..8fe019452ec 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Win32: Get APR to compile with MSVC 5.0 (a.k.a. VC97). + PR #7489 [Jeff Trawick] + *) First draft implementation of apr_filepath (get/set/parse_root and merge) for Unix. [William Rowe] diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 71dd541afb4..507fb3c8d5a 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -128,6 +128,9 @@ apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, #ifndef FILE_FLAG_OPEN_REPARSE_POINT #define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000 #endif +#ifndef TRUSTEE_IS_WELL_KNOWN_GROUP +#define TRUSTEE_IS_WELL_KNOWN_GROUP 5 +#endif /* Information bits available from the WIN32 FindFirstFile function */ #define APR_FINFO_WIN32_DIR (APR_FINFO_NAME | APR_FINFO_TYPE \ From 9e1c1d2d7175d2191877e62e95b57b92f7a1a3f7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 31 Mar 2001 12:42:46 +0000 Subject: [PATCH 1424/7878] Fix a compile warning and maybe a run-time error (see OtherBill's comment in time/win32/time.c on another call to Sleep) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61413 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/poll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index f9a2632431b..780039301ae 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -119,7 +119,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, } if (newread == NULL && newwrite == NULL && newexcept == NULL) { - Sleep(timeout / 1000); /* convert microseconds into milliseconds */ + Sleep((DWORD)(timeout / 1000)); /* convert microseconds into milliseconds */ return APR_TIMEUP; /* TODO - get everybody in synch with Win32 apr_status_t */ } else { From 83eed74b398ae0b193e3be28619aaf12222c156f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 31 Mar 2001 12:43:38 +0000 Subject: [PATCH 1425/7878] fix a warning/run-time error regarding the unnecessary local variable err git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61414 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 8bd7c9d4cd9..39bd993f864 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -178,7 +178,6 @@ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, char *buf, apr_size_t *len) { apr_ssize_t rv; - apr_status_t err; if (from == NULL){ return APR_ENOMEM; @@ -194,10 +193,6 @@ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, return apr_get_netos_error(); } - if (err) { - return errno; - } - (*len) = rv; if (rv == 0) return APR_EOF; From 0d6452f4cb9aa7c3163169fd118ee39389c70a84 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 31 Mar 2001 13:25:45 +0000 Subject: [PATCH 1426/7878] apr_recvfrom() should only return APR_EOF if recvfrom() returned zero *AND* this is a stream socket. rc zero from a datagram socket just means that somebody sent you a zero-byte datagram. Remove the minimal parm checking from recvfrom()... better to segfault as with most of the rest of APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61415 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/networkio.h | 1 + network_io/unix/sendrecv.c | 9 +-------- network_io/unix/sockets.c | 13 ++++++++----- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 9c6db4edccd..af12997f4e1 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -122,6 +122,7 @@ struct apr_socket_t { apr_pool_t *cntxt; int socketdes; + int type; apr_sockaddr_t *local_addr; apr_sockaddr_t *remote_addr; apr_interval_time_t timeout; diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 9c5ba0f7a21..467a7a7d86e 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -193,13 +193,6 @@ apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, { ssize_t rv; - if (from == NULL){ - return APR_ENOMEM; - /* Not sure if this is correct. Maybe we should just allocate - the memory?? - */ - } - do { rv = recvfrom(sock->socketdes, buf, (*len), flags, (struct sockaddr*)&from->sa, &from->salen); @@ -224,7 +217,7 @@ apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, } (*len) = rv; - if (rv == 0) + if (rv == 0 && sock->type == SOCK_STREAM) return APR_EOF; return APR_SUCCESS; diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 5ab6826ab51..1d40c3319ee 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -72,8 +72,9 @@ static apr_status_t socket_cleanup(void *sock) } } -static void set_socket_vars(apr_socket_t *sock, int family) +static void set_socket_vars(apr_socket_t *sock, int family, int type) { + sock->type = type; sock->local_addr->sa.sin.sin_family = family; sock->remote_addr->sa.sin.sin_family = family; @@ -152,7 +153,7 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, if ((*new)->socketdes < 0) { return errno; } - set_socket_vars(*new, family); + set_socket_vars(*new, family, type); (*new)->timeout = -1; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), @@ -198,7 +199,7 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { alloc_socket(new, connection_context); - set_socket_vars(*new, sock->local_addr->sa.sin.sin_family); + set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM); #ifndef HAVE_POLL (*new)->connected = 1; @@ -305,7 +306,7 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_pool_t *cont) { alloc_socket(apr_sock, cont); - set_socket_vars(*apr_sock, os_sock_info->family); + set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type); (*apr_sock)->timeout = -1; (*apr_sock)->socketdes = *os_sock_info->os_sock; if (os_sock_info->local) { @@ -337,7 +338,9 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, if ((*sock) == NULL) { alloc_socket(sock, cont); /* XXX IPv6 figure out the family here! */ - set_socket_vars(*sock, APR_INET); + /* XXX figure out the actual socket type here */ + /* *or* just decide that apr_os_sock_put() has to be told the family and type */ + set_socket_vars(*sock, APR_INET, SOCK_STREAM); (*sock)->timeout = -1; } (*sock)->local_port_unknown = (*sock)->local_interface_unknown = 1; From 91a87f3a22dce0f27cb35ef86aca46a355ad035e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 31 Mar 2001 18:56:50 +0000 Subject: [PATCH 1427/7878] We didn't have logic to retry an EAGAIN error from apr_recv(), which made no sense (but somehow never broke the program when I ran on *ix). It did break on Win98. The fix is to use APR timeouts always. We default to 2 seconds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61416 13f79535-47bb-0310-9956-ffa450edef68 --- test/client.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/test/client.c b/test/client.c index cdb7495b354..bb5d3db6378 100644 --- a/test/client.c +++ b/test/client.c @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) char *local_ipaddr, *remote_ipaddr; char *dest = "127.0.0.1"; apr_port_t local_port, remote_port; - apr_interval_time_t read_timeout = -1; + apr_interval_time_t read_timeout = 2 * APR_USEC_PER_SEC; apr_sockaddr_t *local_sa, *remote_sa; setbuf(stdout, NULL); @@ -135,16 +135,6 @@ int main(int argc, char *argv[]) } fprintf(stdout, "OK\n"); - if (read_timeout == -1) { - fprintf(stdout, "\tClient: Setting socket option NONBLOCK......."); - if (apr_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { - apr_socket_close(sock); - fprintf(stderr, "Couldn't set socket option\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - } - apr_socket_addr_get(&remote_sa, APR_REMOTE, sock); apr_sockaddr_ip_get(&remote_ipaddr, remote_sa); apr_sockaddr_port_get(&remote_port, remote_sa); @@ -162,15 +152,13 @@ int main(int argc, char *argv[]) } fprintf(stdout, "OK\n"); - if (read_timeout != -1) { - fprintf(stdout, "\tClient: Setting read timeout......."); - stat = apr_setsocketopt(sock, APR_SO_TIMEOUT, read_timeout); - if (stat) { - fprintf(stderr, "Problem setting timeout: %d\n", stat); - exit(-1); - } - fprintf(stdout, "OK\n"); + fprintf(stdout, "\tClient: Setting read timeout......."); + stat = apr_setsocketopt(sock, APR_SO_TIMEOUT, read_timeout); + if (stat) { + fprintf(stderr, "Problem setting timeout: %d\n", stat); + exit(-1); } + fprintf(stdout, "OK\n"); length = STRLEN; fprintf(stdout, "\tClient: Trying to receive data over socket......."); From 4e0e595d613f077b45d74cc6d7409f99908f0fca Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 31 Mar 2001 18:58:16 +0000 Subject: [PATCH 1428/7878] When allocating local and remote sockaddrs with a new socket, make sure to fill out the pool field in them. Otherwise, certain operations can segfault. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61417 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 465e2c6d397..496d0957299 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -108,8 +108,10 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->cntxt = p; (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, sizeof(apr_sockaddr_t)); + (*new)->local_addr->pool = p; (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, sizeof(apr_sockaddr_t)); + (*new)->remote_addr->pool = p; } APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, From f4b5057fccc30e4dffc362a97d117b7a763434ce Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 31 Mar 2001 22:32:46 +0000 Subject: [PATCH 1429/7878] Flush any data still unwritten when the file is closed. (Note: On Unix we need to move the flush from apr_file_close() to the cleanup routine.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61418 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ file_io/win32/open.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8fe019452ec..2ce509593aa 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Misc. Win32 fixes: Set the pool pointer in apr_sockaddr_t + structures created with the apr_socket_t to prevent segfault + in certain apps. Flush unwritten buffered data when the file + is closed. [Jeff Trawick] + *) Win32: Get APR to compile with MSVC 5.0 (a.k.a. VC97). PR #7489 [Jeff Trawick] diff --git a/file_io/win32/open.c b/file_io/win32/open.c index b584ed2fd2a..f5996f71fed 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -153,7 +153,12 @@ apr_status_t unicode_to_utf8_path(char* retstr, apr_size_t retlen, apr_status_t file_cleanup(void *thefile) { apr_file_t *file = thefile; + apr_status_t flush_rv = APR_SUCCESS; + if (file->filehand != INVALID_HANDLE_VALUE) { + if (file->buffered) { + flush_rv = apr_file_flush((apr_file_t *)thefile); + } CloseHandle(file->filehand); file->filehand = INVALID_HANDLE_VALUE; } @@ -161,7 +166,7 @@ apr_status_t file_cleanup(void *thefile) CloseHandle(file->pOverlapped->hEvent); file->pOverlapped = NULL; } - return APR_SUCCESS; + return flush_rv; } APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, From e93210e2d4d029b5d5de2d0ac38ffcdd24910f55 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 31 Mar 2001 22:35:04 +0000 Subject: [PATCH 1430/7878] use apr_strerror() instead of strerror() so that we display reasonable strings on non-Unix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61419 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/testpoll.c b/test/testpoll.c index 6e1ce3c8341..cd4d1612ba1 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -113,9 +113,12 @@ static void send_msg(apr_socket_t **sockarray, apr_sockaddr_t **sas, int which) { apr_size_t len = 5; apr_status_t rv; + char errmsg[120]; + printf("\tSending message to socket %d............", which); if ((rv = apr_sendto(sockarray[which], sas[which], 0, "hello", &len)) != APR_SUCCESS){ - printf("Failed! %s\n", strerror(rv)); + apr_strerror(rv, errmsg, sizeof errmsg); + printf("Failed! %s\n", errmsg); exit(-1); } printf("OK\n"); @@ -127,13 +130,15 @@ static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p) char *buffer = apr_pcalloc(p, sizeof(char) * buflen); apr_sockaddr_t *recsa; apr_status_t rv; + char errmsg[120]; apr_sockaddr_info_get(&recsa, "127.0.0.1", APR_UNSPEC, 7770, 0, p); printf("\tTrying to get message from socket %d....", which); if ((rv = apr_recvfrom(recsa, sockarray[which], 0, buffer, &buflen)) != APR_SUCCESS){ - printf("Failed! %s\n", strerror(rv)); + apr_strerror(rv, errmsg, sizeof errmsg); + printf("Failed! %s\n", errmsg); exit (-1); } printf("OK\n"); From 5cb700dd468dd99de38381bb25d92b118ff47d95 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 31 Mar 2001 22:37:13 +0000 Subject: [PATCH 1431/7878] fix bad return code checking and a bad error message after a call to apr_stat(); now it works on Win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61420 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sendfile.c b/test/sendfile.c index 59513fd5364..6be409116a1 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -189,8 +189,8 @@ static void create_testfile(apr_pool_t *p, const char *fname) } rv = apr_stat(&finfo, fname, APR_FINFO_NORM, p); - if (rv) { - fprintf(stderr, "apr_file_close()->%d/%s\n", + if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) { + fprintf(stderr, "apr_stat()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } From 28bf07aae4910f64c2dc071c61673bd749d722e4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 31 Mar 2001 22:38:28 +0000 Subject: [PATCH 1432/7878] minor improvements in error reporting so as to help somebody that wants to get this to work on non-Unix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61421 13f79535-47bb-0310-9956-ffa450edef68 --- test/testflock.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/test/testflock.c b/test/testflock.c index 3d37b609599..74d46c5f0c7 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -94,6 +94,18 @@ static void errmsg(const char *msg) exit(1); } +static void errmsg2(const char *msg, apr_status_t rv) +{ + char *newmsg; + char errstr[120]; + + apr_strerror(rv, errstr, sizeof errstr); + newmsg = apr_psprintf(pool, "%s: %s (%d)\n", + msg, errstr, rv); + errmsg(newmsg); + exit(1); +} + static void do_read(void) { apr_file_t *file; @@ -124,18 +136,19 @@ static void do_read(void) static void do_write(void) { apr_file_t *file; + apr_status_t rv; if (apr_file_open(&file, TESTFILE, APR_WRITE|APR_CREATE, APR_OS_DEFAULT, pool) != APR_SUCCESS) errmsg("Could not create file.\n"); printf("Test file created.\n"); - if (apr_file_lock(file, APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) - errmsg("Could not lock the file.\n"); + if ((rv = apr_file_lock(file, APR_FLOCK_EXCLUSIVE)) != APR_SUCCESS) + errmsg2("Could not lock the file", rv); printf("Lock created.\nSleeping..."); fflush(stdout); - apr_sleep(30000000); /* 30 seconds */ + apr_sleep(30 * APR_USEC_PER_SEC); (void) apr_file_close(file); printf(" done.\nExiting.\n"); From 4664c41e66b2023e12a4340244e5bbb453fe3aff Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 31 Mar 2001 22:58:45 +0000 Subject: [PATCH 1433/7878] flush unwritten buffered data in the file cleanup routine, not in apr_file_close() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61422 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 4f5237213a3..25484522287 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -59,23 +59,26 @@ apr_status_t apr_unix_file_cleanup(void *thefile) { apr_file_t *file = thefile; - int rv; + apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS; + int rc; - rv = close(file->filedes); - - if (rv == 0) { + if (file->buffered) { + flush_rv = apr_file_flush(file); + } + rc = close(file->filedes); + if (rc == 0) { file->filedes = -1; #if APR_HAS_THREADS if (file->thlock) { - return apr_lock_destroy(file->thlock); + rv = apr_lock_destroy(file->thlock); } #endif - return APR_SUCCESS; } else { - return errno; /* Are there any error conditions other than EINTR or EBADF? */ + rv = errno; } + return rv != APR_SUCCESS ? rv : flush_rv; } apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) @@ -170,17 +173,13 @@ apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag apr_status_t apr_file_close(apr_file_t *file) { - apr_status_t flush_rv = APR_SUCCESS, rv; - - if (file->buffered) { - flush_rv = apr_file_flush(file); - } + apr_status_t rv; if ((rv = apr_unix_file_cleanup(file)) == APR_SUCCESS) { apr_pool_cleanup_kill(file->cntxt, file, apr_unix_file_cleanup); return APR_SUCCESS; } - return rv ? rv : flush_rv; + return rv; } apr_status_t apr_file_remove(const char *path, apr_pool_t *cont) From 98bb84487d4a3f9608ac428f67cb0249a9d364a0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 1 Apr 2001 08:43:11 +0000 Subject: [PATCH 1434/7878] make sure that a program argument list is terminated with a NULL element git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61423 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/testsock.c b/test/testsock.c index 360c021c5b2..1fe21bc6633 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -122,7 +122,7 @@ static int run_sendfile(apr_pool_t *context, int number) apr_proc_t proc2; apr_status_t s1; apr_status_t s2; - const char *args[3]; + const char *args[4]; fprintf(stdout, "Creating children to run network tests.......\n"); s1 = apr_procattr_create(&attr1, context); @@ -155,6 +155,7 @@ static int run_sendfile(apr_pool_t *context, int number) break; } } + args[3] = NULL; s2 = apr_proc_create(&proc2, "./sendfile", args, NULL, attr2, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { From 0b69aed472d24c36c5fe68c74b280e0dd043c7f9 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 2 Apr 2001 15:00:51 +0000 Subject: [PATCH 1435/7878] Add ability to generate .def files on the fly for dlls that export all symbols available in the supplied object files using the --export-all option. It will NOT export symbols from linked in libraries though. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61424 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 98 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 91 insertions(+), 7 deletions(-) diff --git a/build/aplibtool.c b/build/aplibtool.c index 53f7477037f..c8f6bc3f631 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -59,18 +59,20 @@ #include #include -char silent = 0; -char shared = 0; -enum mode_t { mCompile, mLink }; -enum output_type_t { otGeneral, otObject, otProgram, otStaticLibrary, otDynamicLibrary }; - typedef char bool; #define false 0 #define true (!false) +bool silent = false; +bool shared = false; +bool export_all = false; +enum mode_t { mCompile, mLink }; +enum output_type_t { otGeneral, otObject, otProgram, otStaticLibrary, otDynamicLibrary }; + #ifdef __EMX__ # define SHELL_CMD "sh" # define CC "gcc" +# define GEN_EXPORTS "emxexp" # define SHARE_SW "-Zdll -Zmtd" # define USE_OMF true # define TRUNCATE_DLL_NAME @@ -96,9 +98,12 @@ typedef struct { int num_args; enum mode_t mode; enum output_type_t output_type; + char *output_name; char *stub_name; char *tmp_dirs[1024]; int num_tmp_dirs; + char *obj_files[1024]; + int num_obj_files; } cmd_data_t; void parse_args(int argc, char *argv[], cmd_data_t *cmd_data); @@ -111,6 +116,8 @@ bool explode_static_lib(char *lib, cmd_data_t *cmd_data); int execute_command(cmd_data_t *cmd_data); char *shell_esc(const char *str); void cleanup_tmp_dirs(cmd_data_t *cmd_data); +void generate_def_file(cmd_data_t *cmd_data); +char *nameof(char *fullpath); int main(int argc, char *argv[]) @@ -195,6 +202,8 @@ bool parse_long_opt(char *arg, cmd_data_t *cmd_data) } } else if (strcmp(var, "shared") == 0) { shared = true; + } else if (strcmp(var, "export-all") == 0) { + export_all = true; } else { return false; } @@ -259,6 +268,7 @@ bool parse_input_file_name(char *arg, cmd_data_t *cmd_data) strcpy(newarg, arg); strcpy(newarg + (ext - arg), OBJECT_EXT); cmd_data->arglist[cmd_data->num_args++] = newarg; + cmd_data->obj_files[cmd_data->num_obj_files++] = newarg; return true; } @@ -283,7 +293,7 @@ bool parse_input_file_name(char *arg, cmd_data_t *cmd_data) if (cmd_data->stub_name == NULL) { cmd_data->stub_name = (char *)malloc(strlen(arg) + 4); strcpy(cmd_data->stub_name, arg); - strcpy(strrchr(cmd_data->stub_name, '.') + 1, shared ? "slo" : "lo"); + strcpy(strrchr(cmd_data->stub_name, '.') + 1, "lo"); } } @@ -324,6 +334,7 @@ bool parse_output_file_name(char *arg, cmd_data_t *cmd_data) strcpy(newarg, arg); strcat(newarg, EXE_EXT); cmd_data->arglist[cmd_data->num_args++] = newarg; + cmd_data->output_name = newarg; return true; } @@ -363,6 +374,7 @@ bool parse_output_file_name(char *arg, cmd_data_t *cmd_data) } #endif + cmd_data->output_name = newarg; return true; } @@ -374,6 +386,7 @@ bool parse_output_file_name(char *arg, cmd_data_t *cmd_data) ext = strrchr(newarg, '.') + 1; strcpy(ext, OBJECT_EXT); cmd_data->arglist[cmd_data->num_args++] = newarg; + cmd_data->output_name = newarg; return true; } @@ -430,7 +443,7 @@ void post_parse_fixup(cmd_data_t *cmd_data) if (ext) { if (strcmp(ext, "h") == 0 || strcmp(ext, "c") == 0) { - /* ignore source files, they don't belong in a library */ + /* ignore source files, they don't belong in a library */ cmd_data->arglist[a] = NULL; } @@ -454,6 +467,10 @@ void post_parse_fixup(cmd_data_t *cmd_data) } } } + + if (export_all) { + generate_def_file(cmd_data); + } } #if USE_OMF @@ -618,3 +635,70 @@ void cleanup_tmp_dirs(cmd_data_t *cmd_data) cleanup_tmp_dir(cmd_data->tmp_dirs[d]); } } + + + +void generate_def_file(cmd_data_t *cmd_data) +{ + char def_file[1024]; + FILE *hDef; + char *export_args[1024]; + int num_export_args = 0; + char *cmd; + int cmd_size = 0; + int a; + + if (cmd_data->output_name) { + strcpy(def_file, cmd_data->output_name); + strcat(def_file, ".def"); + hDef = fopen(def_file, "w"); + + if (hDef != NULL) { + fprintf(hDef, "LIBRARY %s INITINSTANCE\n", nameof(cmd_data->output_name)); + fprintf(hDef, "EXPORTS\n"); + fclose(hDef); + + for (a=0; a < cmd_data->num_obj_files; a++) { + cmd_size += strlen(cmd_data->obj_files[a]) + 1; + } + + cmd_size += strlen(GEN_EXPORTS) + strlen(def_file) + 3; + cmd = (char *)malloc(cmd_size); + strcpy(cmd, GEN_EXPORTS); + + for (a=0; a < cmd_data->num_obj_files; a++) { + strcat(cmd, " "); + strcat(cmd, cmd_data->obj_files[a] ); + } + + strcat(cmd, ">>"); + strcat(cmd, def_file); + puts(cmd); + export_args[num_export_args++] = SHELL_CMD; + export_args[num_export_args++] = "-c"; + export_args[num_export_args++] = cmd; + export_args[num_export_args++] = NULL; + spawnvp(P_WAIT, export_args[0], export_args); + cmd_data->arglist[cmd_data->num_args++] = strdup(def_file); + } + } +} + + + +char *nameof(char *fullpath) +{ + char *name = strrchr(fullpath, '/'); + + if (name == NULL) { + name = strrchr(fullpath, '\\'); + } + + if (name == NULL) { + name = fullpath; + } else { + name++; + } + + return name; +} From 476f1623b86d08a892740f15879fcd3636c519ce Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 2 Apr 2001 16:03:25 +0000 Subject: [PATCH 1436/7878] OS/2: Use unix implementation of filepath stuff for now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61425 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/Makefile.in | 3 ++- file_io/os2/filepath.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 file_io/os2/filepath.c diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index 4926262f6d6..9cee45cbad6 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -10,7 +10,8 @@ TARGETS = \ seek.lo \ flock.lo \ maperrorcode.lo \ - fullrw.lo + fullrw.lo \ + filepath.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/file_io/os2/filepath.c b/file_io/os2/filepath.c new file mode 100644 index 00000000000..fc460e05e14 --- /dev/null +++ b/file_io/os2/filepath.c @@ -0,0 +1 @@ +#include "../unix/filepath.c" From 43a47a25c83daa9e63f7e1a8801b6ab583b80dbd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 2 Apr 2001 17:54:02 +0000 Subject: [PATCH 1437/7878] Catch Jeff :-) More warnings eliminated from usec to msec conversions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61426 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 6 ++++-- network_io/win32/sockopt.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 39bd993f864..bda92c44d21 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -330,10 +330,12 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (status == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) { #ifdef WAIT_FOR_EVENT rv = WaitForSingleObject(overlapped.hEvent, - sock->timeout >= 0 ? sock->timeout : INFINITE); + (DWORD)(sock->timeout >= 0 + ? sock->timeout : INFINITE)); #else rv = WaitForSingleObject((HANDLE) sock->sock, - sock->timeout >= 0 ? sock->timeout : INFINITE); + (DWORD)(sock->timeout >= 0 + ? sock->timeout : INFINITE)); #endif if (rv == WAIT_OBJECT_0) status = APR_SUCCESS; diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 6606d10bc9e..1534e584b87 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -177,7 +177,7 @@ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, case APR_SO_TIMEOUT: /* Convert from milliseconds (windows units) to microseconds * (APR units) */ - *on = sock->timeout * 1000; + *on = (apr_int32_t)(sock->timeout * 1000); break; case APR_SO_DISCONNECTED: *on = sock->disconnected; From 0f23b300456381a7091089dba2e319a7a7fc49b2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 2 Apr 2001 19:00:32 +0000 Subject: [PATCH 1438/7878] Anyone up for writing a bit of proper autoconf magic :-? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61427 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 12 ++++++++++++ include/apr.hw | 6 ++++++ include/apr_time.h | 23 ++++++++++------------- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index e4e6b8cbd9a..15d4cecec8d 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -163,6 +163,18 @@ typedef @ssize_t_value@ apr_ssize_t; typedef @off_t_value@ apr_off_t; typedef @socklen_t_value@ apr_socklen_t; + +/* Mechanisms to properly type numeric literals */ + +/* XXX: this is wrong -- the LL is only required if int64 is implemented as + * a long long, it could be just a long on some platforms. the C99 + * correct way of doing this is to use INT64_C(1000000) which comes + * from stdint.h. we'd probably be doing a Good Thing to check for + * INT64_C in autoconf... or otherwise define an APR_INT64_C(). -dean + */ +#define APR_INT64_C(val) (val##LL) + + /* Definitions that APR programs need to work properly. */ #define APR_THREAD_FUNC diff --git a/include/apr.hw b/include/apr.hw index 31ec6d3a925..be0e7eb0732 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -222,6 +222,12 @@ typedef int pid_t; typedef int uid_t; typedef int gid_t; + +/* Mechanisms to properly type numeric literals */ + +#define APR_INT64_C(val) (val##i64) + + /* Definitions that APR programs need to work properly. */ #define APR_THREAD_FUNC __stdcall diff --git a/include/apr_time.h b/include/apr_time.h index 07b72670e39..45ec564485c 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -70,24 +70,21 @@ extern "C" { extern APR_DECLARE_DATA const char apr_month_snames[12][4]; extern APR_DECLARE_DATA const char apr_day_snames[7][4]; + /* number of microseconds since 00:00:00 january 1, 1970 UTC */ typedef apr_int64_t apr_time_t; + +/* mechanism to properly type apr_time_t literals */ +#define APR_TIME_C(val) APR_INT64_C(val) + + /* intervals for I/O timeouts, in microseconds */ typedef apr_int64_t apr_interval_time_t; typedef apr_int32_t apr_short_interval_time_t; -#ifdef WIN32 -#define APR_USEC_PER_SEC ((LONGLONG) 1000000) -#else -/* XXX: this is wrong -- the LL is only required if int64 is implemented as - * a long long, it could be just a long on some platforms. the C99 - * correct way of doing this is to use INT64_C(1000000) which comes - * from stdint.h. we'd probably be doing a Good Thing to check for - * INT64_C in autoconf... or otherwise define an APR_INT64_C(). -dean - */ -#define APR_USEC_PER_SEC (1000000LL) -#endif +#define APR_USEC_PER_SEC APR_TIME_C(1000000) + /** * return the current time @@ -154,8 +151,8 @@ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input); /** - * Convert time value from human readable format to number of seconds - * since epoch + * Convert time value from human readable format to a numeric apr_time_t + * e.g. elapsed usec since epoch * @param result the resulting imploded time * @param input the input exploded time * @deffunc apr_status_t apr_implode_time(apr_time_t *result, apr_exploded_time_t *input) From ed496db349f0174ab131496950ff70eb958d379c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 2 Apr 2001 19:01:10 +0000 Subject: [PATCH 1439/7878] Libtool 1.3b, the current alpha release, is needed for creating DSOs on certain platforms, i.e. AIX. This patch simply allows us to use 1.3b and not complain. Submitted by: Victor Orlikowski git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61428 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ build/buildcheck.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 2ce509593aa..40629916ee6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Allow libtool 1.3b to be used. [Victor Orlikowski] + *) Misc. Win32 fixes: Set the pool pointer in apr_sockaddr_t structures created with the apr_socket_t to prevent segfault in certain apps. Flush unwritten buffered data when the file diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 091a17be335..5bd685b1653 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -30,7 +30,7 @@ exit 1 fi lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` IFS=.; set $lt_version; IFS=' ' -if test "$1" -gt "1" || test "$2" -gt "3" || test "$2" = "3" -a "$3" -ge "3" +if test "$1" -gt "1" || test "$2" -gt "3" || test "$2" = "3" -a "$3" -ge "3" || test "$2" = "3" -a "$3" -ge "b" then echo "buildconf: libtool version $lt_pversion (ok)" else From 0ebecab2b8d4566cd48574a12a7f469e9e9bab36 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 2 Apr 2001 19:33:12 +0000 Subject: [PATCH 1440/7878] This patch sets the dso/aix subdirectory to be used for older versions of AIX and fixes a number of bugs the dso code in that directory. Submitted by: Victor Orlikowski Reviewed by: Jeff Trawick (any build problems are my bad... I changed Victor's patch to avoid the 'include "../unix/apr_private.h"' kludge but am not able to easily test) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61429 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ configure.in | 6 ++++++ dso/aix/Makefile.in | 4 +++- dso/aix/dso.c | 23 ++++++++++++++++++----- include/arch/aix/dso.h | 1 + 5 files changed, 32 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 40629916ee6..5c421d301df 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Use the dso/aix subdirectory for older versions of AIX and fix + a number of bugs in the dso code in that directory. + [Victor Orlikowski] + *) Allow libtool 1.3b to be used. [Victor Orlikowski] *) Misc. Win32 fixes: Set the pool pointer in apr_sockaddr_t diff --git a/configure.in b/configure.in index 75a31df929e..a2c239f241c 100644 --- a/configure.in +++ b/configure.in @@ -120,6 +120,12 @@ case "$OS:$CC" in esac case "$OS" in + i386-ibm-aix* | *-ibm-aix[1-2].* | *-ibm-aix3.* | *-ibm-aix4.1 | *-ibm-aix4.1.* | *-ibm-aix4.2 | *-ibm-aix4.2.*) + OSDIR="aix" + config_subdirs="shmem/unix/mm" + USE_MM=yes + eolstr="\\n" + ;; *-os2*) CFLAGS="$CFLAGS -DOS2 -Zmt" OSDIR="os2" diff --git a/dso/aix/Makefile.in b/dso/aix/Makefile.in index 1fed5511423..fe018d7d403 100644 --- a/dso/aix/Makefile.in +++ b/dso/aix/Makefile.in @@ -5,6 +5,8 @@ TARGETS = dso.lo @INCLUDE_RULES@ INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) # DO NOT REMOVE diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 4ceb9415cad..1ddd42d0c0c 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -148,8 +148,10 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, { void *os_handle = dlopen((char *)path, RTLD_NOW | RTLD_GLOBAL); - if(os_handle == NULL) + if(os_handle == NULL) { + (*res_handle)->errormsg = dlerror(); return APR_EDSOOPEN; + } *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = (void*)os_handle; @@ -171,13 +173,24 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, { void *retval = dlsym(handle->handle, symname); - if (retval == NULL) + if (retval == NULL) { + handle->errormsg = dlerror(); return APR_EINIT; - - ressym = retval; + } + + *ressym = retval; return APR_SUCCESS; } +APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) +{ + if (dso->errormsg) { + apr_cpystrn(buffer, dso->errormsg, buflen); + return dso->errormsg; + } + return "No Error"; +} + /* @@ -282,7 +295,7 @@ void *dlopen(const char *path, int mode) * load should be declared load(const char *...). Thus we * cast the path to a normal char *. Ugly. */ - if ((mp->entry = (void *) load((char *) path, L_NOAUTODEFER, NULL)) == NULL) { + if ((mp->entry = (void *) loadAndInit((char *) path, L_NOAUTODEFER, NULL)) == NULL) { free(mp->name); free(mp); errvalid++; diff --git a/include/arch/aix/dso.h b/include/arch/aix/dso.h index 2cf9a610ba2..d0002600596 100644 --- a/include/arch/aix/dso.h +++ b/include/arch/aix/dso.h @@ -71,6 +71,7 @@ int dlclose(void *handle); struct apr_dso_handle_t { apr_pool_t *cont; void *handle; + const char *errormsg; }; #endif From 84eac7917bd65ec83aad9e34514261f66eb556db Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 2 Apr 2001 19:54:36 +0000 Subject: [PATCH 1441/7878] Little portability hack.. cp -f ain't portable git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61430 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/buildconf b/buildconf index 06e0f3f9f80..f5e0ab5fc4a 100755 --- a/buildconf +++ b/buildconf @@ -83,7 +83,12 @@ if [ ! -f $ltfile ]; then echo "$ltfile not found" exit 1 fi -cp -f $ltfile build/libtool.m4 + +# Ugly. 'cp -f' isn't portable, so we work around +if [ -f build/libtool.m4 ]; then + rm -f build/libtool.m4 +fi +cp $ltfile build/libtool.m4 # This is just temporary until people's workspaces are cleared -- remove # any old aclocal.m4 left over from prior build so it doesn't cause errors. From 64139f74db4f0fefd320921f697dacd6525d4bca Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 2 Apr 2001 21:54:01 +0000 Subject: [PATCH 1442/7878] REVIEW Req'd ... solve the implode/explode discrepancy, but I hacked this at 40,000 ft, and my brain was not altogether there. This merits discuss at the Hackathon git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61431 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/atime.h | 33 ++++++++++++++++++++++--- time/win32/time.c | 49 +++++++++++++++----------------------- 2 files changed, 49 insertions(+), 33 deletions(-) diff --git a/include/arch/win32/atime.h b/include/arch/win32/atime.h index 58588418fa9..b3b288a9163 100644 --- a/include/arch/win32/atime.h +++ b/include/arch/win32/atime.h @@ -64,9 +64,36 @@ struct atime_t { apr_time_t currtime; SYSTEMTIME *explodedtime; }; - -void FileTimeToAprTime(apr_time_t *atime, FILETIME *ft); -void AprTimeToFileTime(LPFILETIME pft, apr_time_t t); + + +/* Number of micro-seconds between the beginning of the Windows epoch + * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970) + */ +#define APR_DELTA_EPOCH_IN_USEC APR_TIME_C(11644473600000000); + + +__inline void FileTimeToAprTime(apr_time_t *result, FILETIME *input) +{ + /* Convert FILETIME one 64 bit number so we can work with it. */ + *result = input->dwHighDateTime; + *result = (*result) << 32; + *result |= input->dwLowDateTime; + *result /= 10; /* Convert from 100 nano-sec periods to micro-seconds. */ + *result -= APR_DELTA_EPOCH_IN_USEC; /* Convert from Windows epoch to Unix epoch */ + return; +} + + +__inline void AprTimeToFileTime(LPFILETIME pft, apr_time_t t) +{ + LONGLONG ll; + t += APR_DELTA_EPOCH_IN_USEC; + ll = t * 10; + pft->dwLowDateTime = (DWORD)ll; + pft->dwHighDateTime = (DWORD) (ll >> 32); + return; +} + #endif /* ! ATIME_H */ diff --git a/time/win32/time.c b/time/win32/time.c index 2a6fcb5e1b5..58a55f13449 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -62,44 +62,20 @@ #include #include -/* Number of micro-seconds between the beginning of the Windows epoch - * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970) - */ -#define APR_DELTA_EPOCH_IN_USEC 11644473600000000; - -void FileTimeToAprTime(apr_time_t *result, FILETIME *input) -{ - /* Convert FILETIME one 64 bit number so we can work with it. */ - *result = input->dwHighDateTime; - *result = (*result) << 32; - *result |= input->dwLowDateTime; - *result /= 10; /* Convert from 100 nano-sec periods to micro-seconds. */ - *result -= APR_DELTA_EPOCH_IN_USEC; /* Convert from Windows epoch to Unix epoch */ - return; -} - -void AprTimeToFileTime(LPFILETIME pft, apr_time_t t) -{ - LONGLONG ll; - t += APR_DELTA_EPOCH_IN_USEC; - ll = t * 10; - pft->dwLowDateTime = (DWORD)ll; - pft->dwHighDateTime = (DWORD) (ll >> 32); - return; -} - /* Leap year is any year divisible by four, but not by 100 unless also * divisible by 400 */ #define IsLeapYear(y) ((!(y % 4)) ? (((!(y % 400)) && (y % 100)) ? 1 : 0) : 0) -void SystemTimeToAprExpTime(apr_exploded_time_t *xt, SYSTEMTIME *tm) +static void SystemTimeToAprExpTime(apr_exploded_time_t *xt, SYSTEMTIME *tm, BOOL lt) { TIME_ZONE_INFORMATION tz; DWORD rc; static const int dayoffset[12] = {0, 31, 59, 90, 120, 151, 182, 212, 243, 273, 304, 334}; + /* XXX: this is a looser - can't forefit precision like this + */ xt->tm_usec = tm->wMilliseconds * 1000; xt->tm_sec = tm->wSecond; xt->tm_min = tm->wMinute; @@ -116,6 +92,12 @@ void SystemTimeToAprExpTime(apr_exploded_time_t *xt, SYSTEMTIME *tm) if (IsLeapYear(tm->wYear) && (xt->tm_yday > 58)) xt->tm_yday++; + if (!lt) { + xt->tm_isdst = 0; + xt->tm_gmtoff = 0; + return; + } + rc = GetTimeZoneInformation(&tz); switch (rc) { case TIME_ZONE_ID_UNKNOWN: @@ -161,7 +143,8 @@ APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, SYSTEMTIME st; AprTimeToFileTime(&ft, input); FileTimeToSystemTime(&ft, &st); - SystemTimeToAprExpTime(result, &st); + SystemTimeToAprExpTime(result, &st, 0); + result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC); return APR_SUCCESS; } @@ -174,7 +157,8 @@ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, AprTimeToFileTime(&ft, input); FileTimeToLocalFileTime(&ft, &localft); FileTimeToSystemTime(&localft, &st); - SystemTimeToAprExpTime(result, &st); + SystemTimeToAprExpTime(result, &st, 1); + result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC); return APR_SUCCESS; } @@ -239,6 +223,8 @@ APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont) { + /* XXX: sanity failure, what is file time, gmt or local ? + */ FileTimeToAprTime(aprtime, *ostime); return APR_SUCCESS; } @@ -247,7 +233,10 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) { - SystemTimeToAprExpTime(aprtime, *ostime); + /* XXX: sanity failure, what is system time, gmt or local ? + * Assume local for this moment. + */ + SystemTimeToAprExpTime(aprtime, *ostime, 1); return APR_SUCCESS; } From 370ad227ee5e79f99e69bb83fe802f8a0d0fec0c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 2 Apr 2001 21:54:42 +0000 Subject: [PATCH 1443/7878] A last pesky emit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61432 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 075fddcd257..124aea6aa17 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -112,7 +112,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le if (rv == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) { /* Wait for the pending i/o */ if (file->timeout > 0) { - rv = WaitForSingleObject(file->pOverlapped->hEvent, file->timeout/1000); // timeout in milliseconds... + rv = WaitForSingleObject(file->pOverlapped->hEvent, (DWORD)(file->timeout/1000)); // timeout in milliseconds... } else if (file->timeout == -1) { rv = WaitForSingleObject(file->pOverlapped->hEvent, INFINITE); From 34f1152fe6c8cc1a5774e5930304ba2f335f3504 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 2 Apr 2001 22:01:11 +0000 Subject: [PATCH 1444/7878] Per the suggestions of Greg Stein [thanks Greg] although I took some more liberties with the ideas. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61433 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 97 ++++++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 9fdc77fa03f..8d420926196 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -60,6 +60,13 @@ #include #endif +/* Win32 malpropism that can go away once everyone believes this + * code is golden, and I'm not testing it anymore :-) + */ +#if APR_HAVE_DIRENT_H +#include +#endif + /* Any OS that requires/refuses trailing slashes should be dealt with here. */ APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_pool_t *p) @@ -105,11 +112,11 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, apr_int32_t flags, apr_pool_t *p) { - char path[APR_PATH_MAX]; - apr_size_t rootlen; /* is the original rootpath len */ - apr_size_t newseg; /* is the path offset to the added path */ - apr_size_t addseg; /* is the path offset we are appending at */ - apr_size_t endseg; /* is the end of the current segment */ + char path[APR_PATH_MAX]; /* isn't null term */ + apr_size_t rootlen; /* is the length of the src rootpath */ + apr_size_t keptlen; /* is the length of the retained rootpath */ + apr_size_t pathlen; /* is the length of the result path */ + apr_size_t seglen; /* is the end of the current segment */ apr_status_t rv; /* Treat null as an empty path. @@ -178,11 +185,11 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * '/'s to a single leading '/' from the addpath, * and leave addpath at the first non-'/' character. */ - newseg = 0; + keptlen = 0; while (addpath[0] == '/') ++addpath; - strcpy (path, "/"); - addseg = 1; + path[0] = '/'; + pathlen = 1; } else { @@ -193,39 +200,38 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* Base the result path on the rootpath */ - newseg = rootlen; + keptlen = rootlen; if (rootlen >= sizeof(path)) return APR_ENAMETOOLONG; - strcpy(path, rootpath); + memcpy(path, rootpath, rootlen); /* Always '/' terminate the given root path */ - if (newseg && path[newseg - 1] != '/') { - if (newseg + 1 >= sizeof(path)) + if (keptlen && path[keptlen - 1] != '/') { + if (keptlen + 1 >= sizeof(path)) return APR_ENAMETOOLONG; - path[newseg++] = '/'; - path[newseg] = '\0'; + path[keptlen++] = '/'; } - addseg = newseg; + pathlen = keptlen; } while (*addpath) { /* Parse each segment, find the closing '/' */ - endseg = 0; - while (addpath[endseg] && addpath[endseg] != '/') - ++endseg; + seglen = 0; + while (addpath[seglen] && addpath[seglen] != '/') + ++seglen; - if (endseg == 0 || (endseg == 1 && addpath[0] == '.')) + if (seglen == 0 || (seglen == 1 && addpath[0] == '.')) { /* noop segment (/ or ./) so skip it */ } - else if (endseg == 2 && addpath[0] == '.' && addpath[1] == '.') + else if (seglen == 2 && addpath[0] == '.' && addpath[1] == '.') { /* backpath (../) */ - if (addseg == 1 && path[0] == '/') + if (pathlen == 1 && path[0] == '/') { /* Attempt to move above root. Always die if the * APR_FILEPATH_SECUREROOTTEST flag is specified. @@ -236,10 +242,11 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* Otherwise this is simply a noop, above root is root. * Flag that rootpath was entirely replaced. */ - newseg = 0; + keptlen = 0; } - else if (addseg == 0 || (addseg >= 3 - && strcmp(path + addseg - 3, "../") == 0)) + else if (pathlen == 0 + || (pathlen == 3 && !memcmp(path + pathlen - 3, "../", 3)) + || (pathlen > 3 && !memcmp(path + pathlen - 4, "/../", 4))) { /* Path is already backpathed or empty, if the * APR_FILEPATH_SECUREROOTTEST.was given die now. @@ -249,64 +256,64 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* Otherwise append another backpath. */ - if (addseg + 3 >= sizeof(path)) + if (pathlen + 3 >= sizeof(path)) return APR_ENAMETOOLONG; - strcpy(path + addseg, "../"); - addseg += 3; + memcpy(path + pathlen, "../", 3); + pathlen += 3; } else { /* otherwise crop the prior segment */ do { - --addseg; - } while (addseg && path[addseg - 1] != '/'); - path[addseg] = '\0'; + --pathlen; + } while (pathlen && path[pathlen - 1] != '/'); } /* Now test if we are above where we started and back up - * the newseg offset to reflect the added/altered path. + * the keptlen offset to reflect the added/altered path. */ - if (addseg < newseg) + if (pathlen < keptlen) { if (flags & APR_FILEPATH_SECUREROOTTEST) return APR_EABOVEROOT; - newseg = addseg; + keptlen = pathlen; } } else { /* An actual segment, append it to the destination path */ - apr_size_t i = (addpath[endseg] != '\0'); - if (addseg + endseg + i >= sizeof(path)) + apr_size_t i = (addpath[seglen] != '\0'); + if (pathlen + seglen + i >= sizeof(path)) return APR_ENAMETOOLONG; - strncpy(path + addseg, addpath, endseg + i); - addseg += endseg + i; + memcpy(path + pathlen, addpath, seglen + i); + pathlen += seglen + i; } /* Skip over trailing slash to the next segment */ - if (addpath[endseg]) - ++endseg; + if (addpath[seglen]) + ++seglen; - addpath += endseg; + addpath += seglen; } - - /* newseg will be the rootlen unless the addpath contained + path[pathlen] = '\0'; + + /* keptlen will be the rootlen unless the addpath contained * backpath elements. If so, and APR_FILEPATH_NOTABOVEROOT * is specified (APR_FILEPATH_SECUREROOTTEST was caught above), * compare the original root to assure the result path is * still within given root path. */ - if ((flags & APR_FILEPATH_NOTABOVEROOT) && newseg < rootlen) { + if ((flags & APR_FILEPATH_NOTABOVEROOT) && keptlen < rootlen) { if (strncmp(rootpath, path, rootlen)) return APR_EABOVEROOT; if (rootpath[rootlen - 1] != '/' && path[rootlen] && path[rootlen] != '/') return APR_EABOVEROOT; } - + *newpath = apr_pstrdup(p, path); - return (newpath ? APR_SUCCESS : APR_ENOMEM); + return APR_SUCCESS; } From 6398078b8fce53d1f33f1e52378055431fc12dce Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 2 Apr 2001 23:58:37 +0000 Subject: [PATCH 1445/7878] fix apr_recvfrom() on Win32 so that it returns APR_EOF only for a stream socket git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61434 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/networkio.h | 1 + network_io/win32/sendrecv.c | 10 +--------- network_io/win32/sockets.c | 13 ++++++++----- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 3e0d950d0c9..639b4be0242 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -61,6 +61,7 @@ struct apr_socket_t { apr_pool_t *cntxt; SOCKET sock; + int type; /* SOCK_STREAM, SOCK_DGRAM */ apr_sockaddr_t *local_addr; apr_sockaddr_t *remote_addr; apr_interval_time_t timeout; diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index bda92c44d21..8f26e07c440 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -179,22 +179,14 @@ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, { apr_ssize_t rv; - if (from == NULL){ - return APR_ENOMEM; - /* Not sure if this is correct. Maybe we should just allocate - the memory?? - */ - } - rv = recvfrom(sock->sock, buf, (*len), flags, (struct sockaddr*)&from->sa, &from->salen); if (rv == SOCKET_ERROR) { (*len) = 0; return apr_get_netos_error(); } - (*len) = rv; - if (rv == 0) + if (rv == 0 && sock->type == SOCK_STREAM) return APR_EOF; return APR_SUCCESS; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 496d0957299..679c57f5273 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -72,8 +72,9 @@ static apr_status_t socket_cleanup(void *sock) return APR_SUCCESS; } -static void set_socket_vars(apr_socket_t *sock, int family) +static void set_socket_vars(apr_socket_t *sock, int family, int type) { + sock->type = type; sock->local_addr->sa.sin.sin_family = family; sock->remote_addr->sa.sin.sin_family = family; @@ -150,7 +151,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, if ((*new)->sock == INVALID_SOCKET) { return apr_get_netos_error(); } - set_socket_vars(*new, AF_INET); + set_socket_vars(*new, AF_INET, type); (*new)->timeout = -1; (*new)->disconnected = 0; @@ -222,7 +223,7 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { alloc_socket(new, connection_context); - set_socket_vars(*new, sock->local_addr->sa.sin.sin_family); + set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM); (*new)->timeout = -1; (*new)->disconnected = 0; @@ -326,7 +327,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_pool_t *cont) { alloc_socket(apr_sock, cont); - set_socket_vars(*apr_sock, os_sock_info->family); + set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type); (*apr_sock)->timeout = -1; (*apr_sock)->disconnected = 0; (*apr_sock)->sock = *os_sock_info->os_sock; @@ -358,7 +359,9 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, { if ((*sock) == NULL) { alloc_socket(sock, cont); - set_socket_vars(*sock, AF_INET); + /* XXX figure out the actual socket type here */ + /* *or* just decide that apr_os_sock_put() has to be told the family and type */ + set_socket_vars(*sock, AF_INET, SOCK_STREAM); (*sock)->timeout = -1; (*sock)->disconnected = 0; } From 3714514408b26f218bc0a87b1b96c1d62680fdf0 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 3 Apr 2001 00:02:02 +0000 Subject: [PATCH 1446/7878] Define preprocessor options in CPPFLAGS instead of CFLAGS and avoid adding them over and over again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61435 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + build/apr_common.m4 | 2 +- build/apr_hints.m4 | 170 ++++++++++++++++++++++--------------------- build/apr_network.m4 | 30 ++++---- build/rules.mk.in | 7 +- configure.in | 15 ++-- 6 files changed, 117 insertions(+), 110 deletions(-) diff --git a/CHANGES b/CHANGES index 5c421d301df..b96850140a3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Define preprocessor flags in CPPFLAGS instead of CFLAGS and + bring some sanity to the compiler command-lines. [Roy Fielding] + *) Use the dso/aix subdirectory for older versions of AIX and fix a number of bugs in the dso code in that directory. [Victor Orlikowski] diff --git a/build/apr_common.m4 b/build/apr_common.m4 index bdb7c8e86ba..80c98fd62f3 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -62,7 +62,7 @@ dnl The nasty eval's allow us to use the 'for' dnl construct and save some lines of code. dnl AC_DEFUN(APR_DOEXTRA, [ - for i in CFLAGS LDFLAGS LIBS + for i in CFLAGS CPPFLAGS LDFLAGS LIBS do eval APR_TMP=\$EXTRA_$i if test -n "$APR_TMP"; then diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index dab5099130a..f46e24992d2 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -13,11 +13,11 @@ dnl what is "recommended" by autoconf. dnl dnl APR_PRELOAD dnl -dnl Preload various ENV/makefile paramsm such as CC, CFLAGS, etc +dnl Preload various ENV/makefile params such as CC, CFLAGS, etc dnl based on outside knowledge dnl dnl Generally, we force the setting of CC, and add flags -dnl to CFLAGS, LIBS and LDFLAGS. +dnl to CFLAGS, CPPFLAGS, LIBS and LDFLAGS. dnl AC_DEFUN(APR_PRELOAD, [ if test "$DID_APR_PRELOAD" = "yes" ; then @@ -32,18 +32,18 @@ else case "$host" in *mint) - APR_ADDTO(CFLAGS, [-DMINT]) + APR_ADDTO(CPPFLAGS, [-DMINT]) APR_ADDTO(LIBS, [-lportlib -lsocket]) ;; *MPE/iX*) - APR_ADDTO(CFLAGS, [-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE]) + APR_ADDTO(CPPFLAGS, [-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE]) APR_ADDTO(LIBS, [-lsocket -lsvipc -lcurses]) APR_ADDTO(LDFLAGS, [-Xlinker \"-WL,cap=ia,ba,ph;nmstack=1024000\"]) APR_SETVAR(CAT, [/bin/cat]) ;; *-apple-aux3*) APR_SETVAR(CC, [gcc]) - APR_ADDTO(CFLAGS, [-DAUX3 -D_POSIX_SOURCE]) + APR_ADDTO(CPPFLAGS, [-DAUX3 -D_POSIX_SOURCE]) APR_ADDTO(LIBS, [-lposix -lbsd]) APR_ADDTO(LDFLAGS, [-s]) APR_SETVAR(SHELL, [/bin/ksh]) @@ -51,60 +51,59 @@ else *-ibm-aix*) case $host in i386-ibm-aix*) - APR_ADDTO(CFLAGS, [-U__STR__ -DUSEBCOPY]) + APR_ADDTO(CPPFLAGS, [-U__STR__ -DUSEBCOPY]) ;; *-ibm-aix[1-2].*) - APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + APR_ADDTO(CPPFLAGS, [-DNEED_RLIM_T -U__STR__]) ;; *-ibm-aix3.*) - APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + APR_ADDTO(CPPFLAGS, [-DNEED_RLIM_T -U__STR__]) ;; *-ibm-aix4.1) - APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + APR_ADDTO(CPPFLAGS, [-DNEED_RLIM_T -U__STR__]) ;; *-ibm-aix4.1.*) - APR_ADDTO(CFLAGS, [-DNEED_RLIM_T -U__STR__]) + APR_ADDTO(CPPFLAGS, [-DNEED_RLIM_T -U__STR__]) ;; *-ibm-aix4.2) - APR_ADDTO(CFLAGS, [-U__STR__]) + APR_ADDTO(CPPFLAGS, [-U__STR__]) ;; *-ibm-aix4.2.*) - APR_ADDTO(CFLAGS, [-U__STR__]) + APR_ADDTO(CPPFLAGS, [-U__STR__]) ;; *-ibm-aix4.3) - APR_ADDTO(CFLAGS, [-D_USE_IRS -U__STR__]) + APR_ADDTO(CPPFLAGS, [-D_USE_IRS -U__STR__]) ;; *-ibm-aix4.3.*) - APR_ADDTO(CFLAGS, [-D_USE_IRS -U__STR__]) + APR_ADDTO(CPPFLAGS, [-D_USE_IRS -U__STR__]) ;; *-ibm-aix*) - APR_ADDTO(CFLAGS, [-U__STR__]) + APR_ADDTO(CPPFLAGS, [-U__STR__]) ;; esac dnl Must do a check for gcc or egcs here, to get the right options dnl to the compiler. AC_PROG_CC if test "$GCC" != "yes"; then - APR_ADDTO(CFLAGS, [-qHALT=E]) - APR_ADDTO(CFLAGS, [-qLANGLVL=extended]) + APR_ADDTO(CFLAGS, [-qHALT=E -qLANGLVL=extended]) fi APR_SETIFNULL(apr_iconv_inbuf_const, [1]) APR_ADDTO(THREAD_CPPFLAGS, [-D_THREAD_SAFE]) ;; *-apollo-*) - APR_ADDTO(CFLAGS, [-DAPOLLO]) + APR_ADDTO(CPPFLAGS, [-DAPOLLO]) ;; *-dg-dgux*) - APR_ADDTO(CFLAGS, [-DDGUX]) + APR_ADDTO(CPPFLAGS, [-DDGUX]) ;; *os2_emx*) APR_SETVAR(SHELL, [sh]) ;; *-hi-hiux) - APR_ADDTO(CFLAGS, [-DHIUX]) + APR_ADDTO(CPPFLAGS, [-DHIUX]) ;; *-hp-hpux11.*) - APR_ADDTO(CFLAGS, [-DHPUX11]) + APR_ADDTO(CPPFLAGS, [-DHPUX11]) APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-hp-hpux10.*) @@ -112,22 +111,22 @@ else *-hp-hpux10.01) dnl # We know this is a problem in 10.01. dnl # Not a problem in 10.20. Otherwise, who knows? - APR_ADDTO(CFLAGS, [-DSELECT_NEEDS_CAST]) + APR_ADDTO(CPPFLAGS, [-DSELECT_NEEDS_CAST]) ;; esac APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-hp-hpux*) - APR_ADDTO(CFLAGS, [-DHPUX]) + APR_ADDTO(CPPFLAGS, [-DHPUX]) APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-linux-*) case `uname -r` in - 2.2* ) APR_ADDTO(CFLAGS, [-DLINUX=2]) + 2.2* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2]) ;; - 2.0* ) APR_ADDTO(CFLAGS, [-DLINUX=2]) + 2.0* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2]) ;; - 1.* ) APR_ADDTO(CFLAGS, [-DLINUX=1]) + 1.* ) APR_ADDTO(CPPFLAGS, [-DLINUX=1]) ;; * ) ;; @@ -135,11 +134,11 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-GNU*) - APR_ADDTO(CFLAGS, [-DHURD]) + APR_ADDTO(CPPFLAGS, [-DHURD]) APR_ADDTO(LIBS, [-lcrypt]) ;; *-lynx-lynxos) - APR_ADDTO(CFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) + APR_ADDTO(CPPFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) APR_ADDTO(LIBS, [-lbsd -lcrypt]) ;; *486-*-bsdi*) @@ -149,7 +148,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(THREAD_CPPFLAGS, [-D_POSIX_THREADS]) ;; *-netbsd*) - APR_ADDTO(CFLAGS, [-DNETBSD]) + APR_ADDTO(CPPFLAGS, [-DNETBSD]) APR_ADDTO(LIBS, [-lcrypt]) ;; *-freebsd*) @@ -164,139 +163,143 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-next-nextstep*) APR_SETIFNULL(OPTIM, [-O]) - APR_ADDTO(CFLAGS, [-DNEXT]) + APR_ADDTO(CPPFLAGS, [-DNEXT]) ;; *-next-openstep*) APR_SETVAR(CC, [cc]) APR_SETIFNULL(OPTIM, [-O]) - APR_ADDTO(CFLAGS, [-DNEXT]) + APR_ADDTO(CPPFLAGS, [-DNEXT]) ;; dnl *-apple-rhapsody*) -dnl APR_ADDTO(CFLAGS, [-DDARWIN -DMAC_OS_X_SERVER]) +dnl APR_ADDTO(CPPFLAGS, [-DDARWIN -DMAC_OS_X_SERVER]) dnl ;; *-apple-darwin*) - APR_ADDTO(CFLAGS, [-DDARWIN]) + APR_ADDTO(CPPFLAGS, [-DDARWIN]) ;; *-dec-osf*) - APR_ADDTO(CFLAGS, [-DOSF1]) + APR_ADDTO(CPPFLAGS, [-DOSF1]) ;; *-qnx) - APR_ADDTO(CFLAGS, [-DQNX]) + APR_ADDTO(CPPFLAGS, [-DQNX]) APR_ADDTO(LIBS, [-N128k -lsocket -lunix]) ;; *-qnx32) APR_SETVAR(CC, [cc -F]) - APR_ADDTO(CFLAGS, [-DQNX -mf -3]) + APR_ADDTO(CPPFLAGS, [-DQNX]) + APR_ADDTO(CFLAGS, [-mf -3]) APR_ADDTO(LIBS, [-N128k -lsocket -lunix]) ;; *-isc4*) APR_SETVAR(CC, [gcc]) - APR_ADDTO(CFLAGS, [-posix -DISC]) + APR_ADDTO(CPPFLAGS, [-posix -DISC]) APR_ADDTO(LDFLAGS, [-posix]) APR_ADDTO(LIBS, [-linet]) ;; *-sco3*) - APR_ADDTO(CFLAGS, [-DSCO -Oacgiltz]) + APR_ADDTO(CPPFLAGS, [-DSCO]) + APR_ADDTO(CFLAGS, [-Oacgiltz]) APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-sco5*) - APR_ADDTO(CFLAGS, [-DSCO5]) + APR_ADDTO(CPPFLAGS, [-DSCO5]) APR_ADDTO(LIBS, [-lsocket -lmalloc -lprot -ltinfo -lx]) APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-sco_sv*|*-SCO_SV*) - APR_ADDTO(CFLAGS, [-DSCO]) + APR_ADDTO(CPPFLAGS, [-DSCO]) APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-solaris2*) PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` - APR_ADDTO(CFLAGS, [-DSOLARIS2=$PLATOSVERS]) + APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS]) APR_ADDTO(LIBS, [-lsocket -lnsl]) APR_SETIFNULL(apr_iconv_inbuf_const, [1]) APR_ADDTO(THREAD_CPPFLAGS, [-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT]) ;; *-sunos4*) - APR_ADDTO(CFLAGS, [-DSUNOS4 -DUSEBCOPY]) + APR_ADDTO(CPPFLAGS, [-DSUNOS4 -DUSEBCOPY]) ;; *-unixware1) - APR_ADDTO(CFLAGS, [-DUW=100]) + APR_ADDTO(CPPFLAGS, [-DUW=100]) APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt]) ;; *-unixware2) - APR_ADDTO(CFLAGS, [-DUW=200]) + APR_ADDTO(CPPFLAGS, [-DUW=200]) APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) ;; *-unixware211) - APR_ADDTO(CFLAGS, [-DUW=211]) + APR_ADDTO(CPPFLAGS, [-DUW=211]) APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) ;; *-unixware212) - APR_ADDTO(CFLAGS, [-DUW=212]) + APR_ADDTO(CPPFLAGS, [-DUW=212]) APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) ;; *-unixware7) - APR_ADDTO(CFLAGS, [-DUW=700]) + APR_ADDTO(CPPFLAGS, [-DUW=700]) APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) ;; maxion-*-sysv4*) - APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(CPPFLAGS, [-DSVR4]) APR_ADDTO(LIBS, [-lsocket -lnsl -lc -lgen]) ;; *-*-powermax*) - APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(CPPFLAGS, [-DSVR4]) APR_ADDTO(LIBS, [-lsocket -lnsl -lgen]) ;; TPF) APR_SETVAR(CC, [c89]) - APR_ADDTO(CFLAGS, [-DTPF -D_POSIX_SOURCE]) + APR_ADDTO(CPPFLAGS, [-DTPF -D_POSIX_SOURCE]) ;; BS2000*-siemens-sysv4*) APR_SETVAR(CC, [c89 -XLLML -XLLMK -XL -Kno_integer_overflow]) - APR_ADDTO(CFLAGS, [-DSVR4 -D_XPG_IV]) + APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV]) ;; *-siemens-sysv4*) - APR_ADDTO(CFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT -DNEED_UNION_SEMUN]) + APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT -DNEED_UNION_SEMUN]) APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) ;; pyramid-pyramid-svr4) - APR_ADDTO(CFLAGS, [-DSVR4 -DNO_LONG_DOUBLE]) + APR_ADDTO(CPPFLAGS, [-DSVR4 -DNO_LONG_DOUBLE]) APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) ;; DS/90\ 7000-*-sysv4*) - APR_ADDTO(CFLAGS, [-DUXPDS]) + APR_ADDTO(CPPFLAGS, [-DUXPDS]) APR_ADDTO(LIBS, [-lsocket -lnsl]) ;; *-tandem-sysv4*) - APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(CPPFLAGS, [-DSVR4]) APR_ADDTO(LIBS, [-lsocket -lnsl]) ;; *-ncr-sysv4) - APR_ADDTO(CFLAGS, [-DSVR4 -DMPRAS]) + APR_ADDTO(CPPFLAGS, [-DSVR4 -DMPRAS]) APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) ;; *-sysv4*) - APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(CPPFLAGS, [-DSVR4]) APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) ;; 88k-encore-sysv4) - APR_ADDTO(CFLAGS, [-DSVR4 -DENCORE]) + APR_ADDTO(CPPFLAGS, [-DSVR4 -DENCORE]) APR_ADDTO(LIBS, [-lPW]) ;; *-uts*) PLATOSVERS=`echo $host | sed 's/^.*,//'` case $PLATOSVERS in - 2*) APR_ADDTO(CFLAGS, [-Xa -eft -DUTS21 -DUSEBCOPY]) + 2*) APR_ADDTO(CPPFLAGS, [-DUTS21 -DUSEBCOPY]) + APR_ADDTO(CFLAGS, [-Xa -eft]) APR_ADDTO(LIBS, [-lsocket -lbsd -la]) ;; - *) APR_ADDTO(CFLAGS, [-Xa -DSVR4]) + *) APR_ADDTO(CPPFLAGS, [-DSVR4]) + APR_ADDTO(CFLAGS, [-Xa]) APR_ADDTO(LIBS, [-lsocket -lnsl]) ;; esac ;; *-ultrix) - APR_ADDTO(CFLAGS, [-DULTRIX]) + APR_ADDTO(CPPFLAGS, [-DULTRIX]) APR_SETVAR(SHELL, [/bin/sh5]) ;; *powerpc-tenon-machten*) @@ -306,42 +309,49 @@ dnl ;; APR_ADDTO(LDFLAGS, [-stack 0x14000]) ;; *convex-v11*) - APR_ADDTO(CFLAGS, [-ext -DCONVEXOS11]) + APR_ADDTO(CPPFLAGS, [-DCONVEXOS11]) + APR_ADDTO(CFLAGS, [-ext]) APR_SETIFNULL(OPTIM, [-O1]) APR_SETVAR(CC, [cc]) ;; i860-intel-osf1) - APR_ADDTO(CFLAGS, [-DPARAGON]) + APR_ADDTO(CPPFLAGS, [-DPARAGON]) ;; *-sequent-ptx2.*.*) - APR_ADDTO(CFLAGS, [-DSEQUENT=20 -Wc,-pw]) + APR_ADDTO(CPPFLAGS, [-DSEQUENT=20]) + APR_ADDTO(CFLAGS, [-Wc,-pw]) APR_ADDTO(LIBS, [-lsocket -linet -lnsl -lc -lseq]) ;; *-sequent-ptx4.0.*) - APR_ADDTO(CFLAGS, [-DSEQUENT=40 -Wc,-pw]) + APR_ADDTO(CPPFLAGS, [-DSEQUENT=40]) + APR_ADDTO(CFLAGS, [-Wc,-pw]) APR_ADDTO(LIBS, [-lsocket -linet -lnsl -lc]) ;; *-sequent-ptx4.[123].*) - APR_ADDTO(CFLAGS, [-DSEQUENT=41 -Wc,-pw]) + APR_ADDTO(CPPFLAGS, [-DSEQUENT=41]) + APR_ADDTO(CFLAGS, [-Wc,-pw]) APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) ;; *-sequent-ptx4.4.*) - APR_ADDTO(CFLAGS, [-DSEQUENT=44 -Wc,-pw]) + APR_ADDTO(CPPFLAGS, [-DSEQUENT=44]) + APR_ADDTO(CFLAGS, [-Wc,-pw]) APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) ;; *-sequent-ptx4.5.*) - APR_ADDTO(CFLAGS, [-DSEQUENT=45 -Wc,-pw]) + APR_ADDTO(CPPFLAGS, [-DSEQUENT=45]) + APR_ADDTO(CFLAGS, [-Wc,-pw]) APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) ;; *-sequent-ptx5.0.*) - APR_ADDTO(CFLAGS, [-DSEQUENT=50 -Wc,-pw]) + APR_ADDTO(CPPFLAGS, [-DSEQUENT=50]) + APR_ADDTO(CFLAGS, [-Wc,-pw]) APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) ;; *NEWS-OS*) - APR_ADDTO(CFLAGS, [-DNEWSOS]) + APR_ADDTO(CPPFLAGS, [-DNEWSOS]) ;; *-riscix) - APR_ADDTO(CFLAGS, [-DRISCIX]) + APR_ADDTO(CPPFLAGS, [-DRISCIX]) APR_SETIFNULL(OPTIM, [-O]) APR_SETIFNULL(MAKE, [make]) ;; @@ -349,7 +359,7 @@ dnl ;; APR_ADDTO(THREAD_CPPFLAGS, [-D_POSIX_THREAD_SAFE_FUNCTIONS]) ;; *beos*) - APR_ADDTO(CFLAGS, [-DBEOS]) + APR_ADDTO(CPPFLAGS, [-DBEOS]) PLATOSVERS=`uname -r` case $PLATOSVERS in 5.1) @@ -360,31 +370,27 @@ dnl ;; esac ;; 4850-*.*) - APR_ADDTO(CFLAGS, [-DSVR4 -DMPRAS]) + APR_ADDTO(CPPFLAGS, [-DSVR4 -DMPRAS]) APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) ;; drs6000*) - APR_ADDTO(CFLAGS, [-DSVR4]) + APR_ADDTO(CPPFLAGS, [-DSVR4]) APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) ;; m88k-*-CX/SX|CYBER) - APR_ADDTO(CFLAGS, [-D_CX_SX -Xa]) + APR_ADDTO(CPPFLAGS, [-D_CX_SX]) + APR_ADDTO(CFLAGS, [-Xa]) APR_SETVAR(CC, [cc]) ;; *-tandem-oss) - APR_ADDTO(CFLAGS, [-D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED=1]) + APR_ADDTO(CPPFLAGS, [-D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED=1]) APR_SETVAR(CC, [c89]) ;; *-ibm-os390) APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE]) APR_SETIFNULL(apr_process_lock_is_global, [yes]) APR_SETIFNULL(CC, [cc]) - APR_ADDTO(CFLAGS, [-U_NO_PROTO]) - APR_ADDTO(CFLAGS, [-DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR]) - APR_ADDTO(CFLAGS, [-DPTHREAD_SETS_ERRNO]) - APR_ADDTO(CFLAGS, [-DPTHREAD_DETACH_ARG1_ADDR]) - APR_ADDTO(CFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK]) - APR_ADDTO(CFLAGS, [-DTCP_NODELAY=1]) + APR_ADDTO(CPPFLAGS, [-U_NO_PROTO -DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR -DPTHREAD_SETS_ERRNO -DPTHREAD_DETACH_ARG1_ADDR -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1]) ;; esac APR_DOEXTRA diff --git a/build/apr_network.m4 b/build/apr_network.m4 index ecf5404eb52..ef5ded0c0df 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -267,7 +267,7 @@ dnl APR_H_ERRNO_COMPILE_CHECK dnl AC_DEFUN(APR_H_ERRNO_COMPILE_CHECK,[ if test x$1 != x; then - CFLAGS="-D$1 $CFLAGS" + CPPFLAGS="-D$1 $CPPFLAGS" fi AC_TRY_COMPILE([ #ifdef HAVE_SYS_TYPES_H @@ -280,12 +280,12 @@ AC_DEFUN(APR_H_ERRNO_COMPILE_CHECK,[ int h_e = h_errno; ],[ if test x$1 != x; then - ac_cv_h_errno_cflags="$1" + ac_cv_h_errno_cppflags="$1" else - ac_cv_h_errno_cflags=yes + ac_cv_h_errno_cppflags=yes fi ],[ - ac_cv_h_errno_cflags=no + ac_cv_h_errno_cppflags=no ])]) @@ -296,28 +296,28 @@ dnl checks which flags are necessary for to define h_errno dnl AC_DEFUN(APR_CHECK_H_ERRNO_FLAG,[ AC_MSG_CHECKING([for h_errno in netdb.h]) - AC_CACHE_VAL(ac_cv_h_errno_cflags,[ + AC_CACHE_VAL(ac_cv_h_errno_cppflags,[ APR_H_ERRNO_COMPILE_CHECK - if test "$ac_cv_h_errno_cflags" = "no"; then - ac_save="$CFLAGS" + if test "$ac_cv_h_errno_cppflags" = "no"; then + ac_save="$CPPFLAGS" for flag in _XOPEN_SOURCE_EXTENDED; do APR_H_ERRNO_COMPILE_CHECK($flag) - if test "$ac_cv_h_errno_cflags" != "no"; then + if test "$ac_cv_h_errno_cppflags" != "no"; then break fi done - CFLAGS="$ac_save" + CPPFLAGS="$ac_save" fi ]) - if test "$ac_cv_h_errno_cflags" != "no"; then - if test "$ac_cv_h_errno_cflags" != "yes"; then - CFLAGS="-D$ac_cv_h_errno_cflags $CFLAGS" - AC_MSG_RESULT([yes, with -D$ac_cv_h_errno_cflags]) + if test "$ac_cv_h_errno_cppflags" != "no"; then + if test "$ac_cv_h_errno_cppflags" != "yes"; then + CPPFLAGS="-D$ac_cv_h_errno_cppflags $CPPFLAGS" + AC_MSG_RESULT([yes, with -D$ac_cv_h_errno_cppflags]) else - AC_MSG_RESULT([$ac_cv_h_errno_cflags]) + AC_MSG_RESULT([$ac_cv_h_errno_cppflags]) fi else - AC_MSG_RESULT([$ac_cv_h_errno_cflags]) + AC_MSG_RESULT([$ac_cv_h_errno_cppflags]) fi ]) diff --git a/build/rules.mk.in b/build/rules.mk.in index f8e6e681cbe..98746385af9 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -68,8 +68,9 @@ CC=@CC@ AWK=@AWK@ LIBTOOL=@LIBTOOL@ -CFLAGS=@CFLAGS@ @OPTIM@ -CPPFLAGS=@CPPFLAGS@ $(INCLUDES) +CFLAGS=@CFLAGS@ +OPTIM=@OPTIM@ +CPPFLAGS=@CPPFLAGS@ LIBS=@LIBS@ LDFLAGS=@LDFLAGS@ @@ -82,7 +83,7 @@ LTFLAGS = --silent # # Basic macro setup # -COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) +COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) $(OPTIM) $(INCLUDES) LT_COMPILE = $(LIBTOOL) --mode=compile $(LTFLAGS) $(COMPILE) -c $< && touch $@ LINK = $(LIBTOOL) --mode=link $(LTFLAGS) $(COMPILE) $(LDFLAGS) -o $@ diff --git a/configure.in b/configure.in index a2c239f241c..2cebd3ca872 100644 --- a/configure.in +++ b/configure.in @@ -98,10 +98,10 @@ nl=' echo $ac_n "${nl}Check for compiler flags..." AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile time warnings], - [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall"; else CFLAGS="$CFLAGS -g"; fi]) + [if test "$GCC" = "yes"; then OPTIM="$OPTIM -g -Wall"; else OPTIM="$OPTIM -g"; fi]) AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and compile time warnings], - [if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"; else CFLAGS="$CFLAGS -g"; fi]) + [if test "$GCC" = "yes"; then OPTIM="$OPTIM -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"; else OPTIM="$OPTIM -g"; fi]) dnl # this is the place to put specific options for platform/compiler dnl # combinations @@ -127,7 +127,8 @@ case "$OS" in eolstr="\\n" ;; *-os2*) - CFLAGS="$CFLAGS -DOS2 -Zmt" + CPPFLAGS="$CPPFLAGS -DOS2" + CFLAGS="$CFLAGS -Zmt" OSDIR="os2" enable_threads="system_threads" eolstr="\\r\\n" @@ -135,7 +136,7 @@ case "$OS" in ;; *beos*) OSDIR="beos" - CFLAGS="$CFLAGS -DBEOS" + CPPFLAGS="$CPPFLAGS -DBEOS" enable_threads="system_threads" config_subdirs="shmem/unix/mm" native_mmap_emul="1" @@ -333,7 +334,7 @@ AC_SUBST(mem_based) AC_SUBST(file_based) if test ".$SYS_SW" = ".AIX"; then - CFLAGS="$CFLAGS -U__STR__" + CPPFLAGS="$CPPFLAGS -U__STR__" case "$SYS_KV" in [12]*) AC_DEFINE(USEBCOPY) @@ -1033,10 +1034,6 @@ if test -d ./test; then fi AC_SUBST(SUBDIRS) -if test -n "$CPPFLAGS"; then - CFLAGS="$CFLAGS $CPPFLAGS" -fi - dnl dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles dnl From d932c9ea44a801d293241b4aeb89dedd5b7dfbf4 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Tue, 3 Apr 2001 00:39:09 +0000 Subject: [PATCH 1447/7878] Find glibtool git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61436 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 5bd685b1653..c2538e9e8a4 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -21,7 +21,8 @@ echo "buildconf: autoconf version $ac_version (ok)" fi # libtool 1.3.3 or newer -lt_pversion=`libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'` +libtool=`build/PrintPath glibtool libtool` +lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'` if test "$lt_pversion" = ""; then echo "buildconf: libtool not found." echo " You need libtool version 1.3 or newer installed" From a49c0377a2b9d6d4031b082ec905c3bba33c2437 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 3 Apr 2001 00:41:04 +0000 Subject: [PATCH 1448/7878] Configure elements of FreeBSD's accept_filter for APR. Obtained from: Ryan Bloom Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61437 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 1 + configure.in | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/acconfig.h b/acconfig.h index 3ff72d90c6e..4cc307b51b4 100644 --- a/acconfig.h +++ b/acconfig.h @@ -12,6 +12,7 @@ #undef HAVE_TRUERAND #undef HAVE_POLLIN #undef HAVE_isascii +#undef HAVE_SO_ACCEPT_FILTER /* Cross process serialization techniques */ #undef USE_FLOCK_SERIALIZE diff --git a/configure.in b/configure.in index 2cebd3ca872..41694c90b1f 100644 --- a/configure.in +++ b/configure.in @@ -971,6 +971,14 @@ if test "x$ac_cv_define_TCP_NOPUSH" = "xyes"; then apr_tcp_nopush_flag="TCP_NOPUSH" have_corkable_tcp="1" fi + +APR_CHECK_DEFINE(SO_ACCEPT_FILTER, sys/socket.h) +if test "x$ac_cv_define_SO_ACCEPT_FILTER" = "xyes"; then + accept_filter="1" +else + accept_filter="0" +fi + AC_SUBST(apr_tcp_nopush_flag) AC_SUBST(have_corkable_tcp) From b83981376889b0eba7fbd6ccb8c3a534124dd961 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 3 Apr 2001 00:43:09 +0000 Subject: [PATCH 1449/7878] The actual code for accept_filters on FreeBSD for APR. This is NOT yet tested but does build :) Use at your own risk. Obtained from: Ryan Bloom Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61438 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 1b1bf7ce5be..5369478d699 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -303,3 +303,19 @@ apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) return APR_SUCCESS; } +#ifdef SO_ACCEPTFILTER +apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, + char *args) +{ + struct accept_filter_arg af; + strncpy(af.af_name, name, 16); + strncpy(af.af_arg, args, 256 - 16); + + if ((setsockopt(sock->socketdes, SOL_SOCKET, SO_ACCEPTFILTER, + &af, sizeof(af))) < 0) { + return errno; + } + return APR_SUCCESS; +} +#endif + From 0d6fa002383efa5f6a56390b73580c073324876b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 3 Apr 2001 01:09:51 +0000 Subject: [PATCH 1450/7878] Fix the compile on platforms without accept filters. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61439 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + include/apr.h.in | 1 + include/apr_network_io.h | 12 ++++++++++++ 3 files changed, 14 insertions(+) diff --git a/configure.in b/configure.in index 41694c90b1f..a3a10025b26 100644 --- a/configure.in +++ b/configure.in @@ -981,6 +981,7 @@ fi AC_SUBST(apr_tcp_nopush_flag) AC_SUBST(have_corkable_tcp) +AC_SUBST(accept_filter) echo $ac_n "${nl}Checking for IPv6 Networking support...${nl}" dnl # Start of checking for IPv6 support... diff --git a/include/apr.h.in b/include/apr.h.in index 15d4cecec8d..583d5225288 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -117,6 +117,7 @@ #define APR_HAS_XLATE @iconv@ #define APR_HAS_OTHER_CHILD @oc@ #define APR_HAS_DSO @aprdso@ +#define APR_HAS_SO_ACCEPT_FILTER @accept_filter@ #define APR_HAS_UNICODE_FS 0 #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 0 diff --git a/include/apr_network_io.h b/include/apr_network_io.h index aecd41c446d..316ac95f3a6 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -787,6 +787,18 @@ APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char */ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa); +#ifdef APR_OS_ACCEPT_FILTER +/** + * Set an OS level accept filter. + * @param sock The socket to put the accept filter on. + * @param name The accept filter + * @param args Any extra args to the accept filter. Passing NULL here removes + * the accept filter. + */ +apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char name[16], + char args[256 - 16]); +#endif + #ifdef __cplusplus } #endif From e1bdc1018a7718e483d03d10459fdf7cce86baa5 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 3 Apr 2001 01:19:46 +0000 Subject: [PATCH 1451/7878] Generate config.nice for easy re-run of configure, because Ryan wanted it. Obtained from: Apache httpd 2.0 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61440 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ build/apr_common.m4 | 19 +++++++++++++++++++ configure.in | 4 ++++ 3 files changed, 25 insertions(+) diff --git a/CHANGES b/CHANGES index b96850140a3..8d45800409b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Generate config.nice for easy re-run of configure. [Roy Fielding] + *) Define preprocessor flags in CPPFLAGS instead of CFLAGS and bring some sanity to the compiler command-lines. [Roy Fielding] diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 80c98fd62f3..850cb8566ba 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -2,6 +2,25 @@ dnl ----------------------------------------------------------------- dnl apr_common.m4: APR's general-purpose autoconf macros dnl +AC_DEFUN(APR_CONFIG_NICE,[ + rm -f $1 + cat >$1<> $1 + fi + + for arg in [$]0 "[$]@"; do + echo "\"[$]arg\" \\" >> $1 + done + echo '"[$]@"' >> $1 + chmod +x $1 +]) + dnl dnl APR_SUBDIR_CONFIG(dir [, sub-package-cmdline-args]) dnl diff --git a/configure.in b/configure.in index a3a10025b26..927e4c901cc 100644 --- a/configure.in +++ b/configure.in @@ -17,6 +17,10 @@ sinclude(build/apr_threads.m4) sinclude(build/apr_hints.m4) sinclude(build/libtool.m4) +dnl Generate ./config.nice for reproducing runs of configure +dnl +APR_CONFIG_NICE(config.nice) + AC_CANONICAL_SYSTEM echo "Configuring APR library" OS=$host From 9606a52818ff5cb062e1b8f249eacf5aab42a46f Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 3 Apr 2001 01:20:40 +0000 Subject: [PATCH 1452/7878] ignore config.nice git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61441 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.cvsignore b/.cvsignore index 50ed0dde63b..a43b6e101f7 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,6 +1,7 @@ Makefile config.cache config.log +config.nice config.status configure libtool From df4b8c1ae9cc18b2795de8c97e8a53829d6307ba Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 3 Apr 2001 01:45:51 +0000 Subject: [PATCH 1453/7878] If somebody requests sendfile, then we should compile for it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61442 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/configure.in b/configure.in index 927e4c901cc..ed47ec7a949 100644 --- a/configure.in +++ b/configure.in @@ -385,27 +385,26 @@ AC_ARG_WITH(sendfile, [ --with-sendfile Force sendfile to be on or off], sendfile="1" else sendfile="0" - fi ] ) - -orig_sendfile=$sendfile -case "$OS" in - *freebsd*) - if test $os_version -le "410"; then - if test "$threads" = "1"; then - sendfile="0" + fi ], [ + orig_sendfile=$sendfile + case "$OS" in + *freebsd*) + if test $os_version -le "410"; then + if test "$threads" = "1"; then + sendfile="0" + fi fi - fi - ;; - *alpha*-dec-osf* ) - sendfile="0" - ;; - s390-*-linux-gnu) - sendfile="0" - ;; -esac -if test "$orig_sendfile" != "$sendfile"; then - echo "sendfile support disabled to avoid system problem" -fi + ;; + *alpha*-dec-osf* ) + sendfile="0" + ;; + s390-*-linux-gnu) + sendfile="0" + ;; + esac + if test "$orig_sendfile" != "$sendfile"; then + echo "sendfile support disabled to avoid system problem" + fi ] ) AC_SUBST(sendfile) AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) From 6160a3761ae23f8e996e4992f645c19bc4dc56f1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 3 Apr 2001 05:55:50 +0000 Subject: [PATCH 1454/7878] Here's food for thought ... how big is a mmap, the size of the mapped memory, or the size of the file that can be mapped? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61443 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_mmap.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 06288a26bfc..c6060e14035 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -96,14 +96,14 @@ struct apr_mmap_t { /** The start of the real memory page area (mapped view) */ void *mv; /** The physical start, size and offset */ - size_t pstart; - size_t psize; - size_t poffset; + apr_off_t pstart; + apr_off_t psize; + apr_off_t poffset; #endif /** The start of the memory mapped area */ void *mm; /** The amount of data in the mmap */ - size_t size; + apr_off_t size; }; #if APR_HAS_MMAP From 19b8af3ee4e03a4740b2c45f3beb085bda14b07b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 3 Apr 2001 06:00:54 +0000 Subject: [PATCH 1455/7878] Hmmm... this ought to be a defvar, but ITMT, here is a fix to get a little further with mod_test.so git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61444 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.pl | 1 - 1 file changed, 1 deletion(-) diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl index 6d5f88697e4..4fb80b6f37c 100644 --- a/test/MakeWin32Make.pl +++ b/test/MakeWin32Make.pl @@ -44,7 +44,6 @@ while ($t =~ s|\.a\b|\.lib|) {} while ($t =~ s|\.o\b|\.obj|) {} while ($t =~ s|\.lo\b|\.obj|) {} - while ($t =~ s|\.so\b|\.dll|) {} print $dstfl $t; From 9aad46a6b53b31f2b6e5e946631c56009fc1c8b0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 3 Apr 2001 18:20:48 +0000 Subject: [PATCH 1456/7878] Add a simple configuration macro to determine how APR itself was built. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61445 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 850cb8566ba..32b291978bf 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -168,6 +168,17 @@ AC_DEFUN(APR_CHECK_DEFINE,[ fi ]) +dnl +dnl APR_CHECK_APR_DEFINE( symbol, path_to_apr ) +dnl +AC_DEFUN(APR_CHECK_APR_DEFINE,[ + AC_EGREP_CPP(YES_IS_DEFINED, [ + #include "$2/include/apr.h" + #if $1 + YES_IS_DEFINED + #endif + ], ac_cv_define_$1=yes, ac_cv_define_$1=no) +]) define(APR_IFALLYES,[dnl ac_rc=yes From 9d853b2bde973241b5bf65c61ecf1bdf60099931 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 3 Apr 2001 20:32:06 +0000 Subject: [PATCH 1457/7878] Allow APR to be installed using `make install` git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61446 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ Makefile.in | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 8d45800409b..422db5fe8b2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Allow APR to be installed. [Ryan Bloom] + *) Generate config.nice for easy re-run of configure. [Roy Fielding] *) Define preprocessor flags in CPPFLAGS instead of CFLAGS and diff --git a/Makefile.in b/Makefile.in index cd4ed34c215..bacd6dca51c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -35,8 +35,10 @@ EXTRACLEAN_TARGETS = configure libtool aclocal.m4 \ SCANDOC_TEMPLATE = -i$(apr_builders)/scandoc_template.pl -### fix this up at some point (install location) -libdir = /usr/local/lib +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ delete-lib: @if test -f $(TARGET_LIB); then \ @@ -48,6 +50,16 @@ delete-lib: fi \ fi +install: $(TARGET_LIB) + if [ ! -d $(includedir) ]; then \ + ./build/mkdir.sh $(includedir); \ + fi; \ + cp include/*.h $(includedir); \ + if [ ! -d $(libdir) ]; then \ + ./build/mkdir.sh $(libdir); \ + fi; \ + libtool --mode=install cp $(TARGET_LIB) $(libdir) + $(TARGET_LIB): @for i in $(SUBDIRS); do objects="$$objects $$i/*.lo"; done ; \ echo $(LINK) -rpath $(libdir) $$objects ; \ From 0fa58209ace7aaf99ca70a78b27df769c2b0c3a4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 3 Apr 2001 20:37:05 +0000 Subject: [PATCH 1458/7878] Something helpful, probably non-portable, catch David :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61447 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/testtime.c b/test/testtime.c index c92b9260d8f..9a74fb274cc 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -93,7 +93,11 @@ int main(void) exit(-1); } if (imp != now) { - fprintf(stderr, "implode/explode mismatch\n"); + fprintf(stderr, "implode/explode mismatch\n" + "apr_explode of apr_now() %15I64d\n" + "apr_implode() returned %15I64d\n" + "error delta was %15I64d\n", + now, imp, imp-now); exit(-1); } fprintf(stdout, "OK\n"); From 3190b8956eaac185a5acceec487e3b86e30cab6c Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 3 Apr 2001 20:37:54 +0000 Subject: [PATCH 1459/7878] Minor sync-up of how httpd-2.0 and apr handles these. -g is more an Optimization flag, and the others are more compiler flags git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61448 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index ed47ec7a949..3205b45cb05 100644 --- a/configure.in +++ b/configure.in @@ -102,10 +102,10 @@ nl=' echo $ac_n "${nl}Check for compiler flags..." AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile time warnings], - [if test "$GCC" = "yes"; then OPTIM="$OPTIM -g -Wall"; else OPTIM="$OPTIM -g"; fi]) + [OPTIM="$OPTIM -g"; if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi]) AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and compile time warnings], - [if test "$GCC" = "yes"; then OPTIM="$OPTIM -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"; else OPTIM="$OPTIM -g"; fi]) + [OPTIM="$OPTIM -g"; if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"; fi]) dnl # this is the place to put specific options for platform/compiler dnl # combinations From cb7a3aba8ae9f009119a73393382942bcc8b067c Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 3 Apr 2001 20:38:49 +0000 Subject: [PATCH 1460/7878] Add an extra check to the time test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61449 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/test/testtime.c b/test/testtime.c index 9a74fb274cc..1d58508d6e8 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -55,6 +55,7 @@ #include "apr_time.h" #include "apr_errno.h" #include "apr_general.h" +#include "apr_lib.h" #include #include #ifdef BEOS @@ -66,28 +67,36 @@ int main(void) apr_time_t now; apr_exploded_time_t xt; apr_time_t imp; + apr_pool_t *p; + char *str; + apr_size_t sz; fprintf(stdout, "Testing Time functions.\n"); - fprintf(stdout, "\tapr_time_now......."); + if (apr_pool_create(&p, NULL) != APR_SUCCESS){ + printf("Failed to create a context!\n"); + exit (-1); + } + + fprintf(stdout, "\tapr_time_now.................."); now = apr_time_now(); fprintf(stdout, "OK\n"); - fprintf(stdout, "\tapr_explode_localtime......."); + fprintf(stdout, "\tapr_explode_localtime........."); if (apr_explode_localtime(&xt, now) != APR_SUCCESS) { fprintf(stderr, "Couldn't explode the time\n"); exit(-1); } fprintf(stdout, "OK\n"); - fprintf(stdout, "\tapr_explode_gmt......."); + fprintf(stdout, "\tapr_explode_gmt..............."); if (apr_explode_gmt(&xt, now) != APR_SUCCESS) { fprintf(stderr, "Couldn't explode the time\n"); exit(-1); } fprintf(stdout, "OK\n"); - fprintf(stdout, "\tapr_implode_time........"); + fprintf(stdout, "\tapr_implode_time.............."); if (apr_implode_time(&imp, &xt) != APR_SUCCESS) { fprintf(stderr, "Couldn't implode the time\n"); exit(-1); @@ -102,6 +111,18 @@ int main(void) } fprintf(stdout, "OK\n"); + printf("\tapr_strftime.................."); + str = (char*) apr_pcalloc(p, sizeof(char) * 30); + if (str == NULL){ + printf("Couldn't allocate memory.\n"); + exit (-1); + } + if (apr_strftime(str, &sz, 30, "%R %A %d %B %Y", &xt) != + APR_SUCCESS){ + printf("Failed!"); + } + printf("%s\n", str); + return 1; } From 216f540896adec8b7f7c44c86de85403726909c5 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 3 Apr 2001 20:57:44 +0000 Subject: [PATCH 1461/7878] Oh bother. OPTIM isn't treated the same in apr and httpd-2.0. While being fixed, allow to build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61450 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 3205b45cb05..23dc02c4245 100644 --- a/configure.in +++ b/configure.in @@ -102,10 +102,10 @@ nl=' echo $ac_n "${nl}Check for compiler flags..." AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile time warnings], - [OPTIM="$OPTIM -g"; if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi]) + [CFLAGS="$CFLAGS -g"; if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi]) AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and compile time warnings], - [OPTIM="$OPTIM -g"; if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"; fi]) + [CFLAGS="$CFLAGS -g"; if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"; fi]) dnl # this is the place to put specific options for platform/compiler dnl # combinations From 0816b3ed23b5ae17d180cd44e979633465f4da2b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 3 Apr 2001 22:53:04 +0000 Subject: [PATCH 1462/7878] get rid of a parameter check in apr_proc_wait(); better to segfault git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61451 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 355e83b979a..4c4f74d5450 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -382,8 +382,7 @@ apr_status_t apr_proc_wait(apr_proc_t *proc, apr_wait_how_e waithow) { pid_t status; - if (!proc) - return APR_ENOPROC; + if (waithow == APR_WAIT) { if ((status = waitpid(proc->pid, NULL, WUNTRACED)) > 0) { return APR_CHILD_DONE; From 918db447a766b9b3084cac8bf13d41e6aa8e5028 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 4 Apr 2001 00:26:45 +0000 Subject: [PATCH 1463/7878] If the process no longer exists, we might as well remember not to SIGTERM/SIGKILL it later. I can't imagine that doing so would hurt, but it does present some confusion when looking at systraces and seeing that some syscalls fail. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61452 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_pools.c | 2 +- memory/unix/apr_pools.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 577f864277e..8e47243db44 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -1237,7 +1237,7 @@ static void free_proc_chain(struct process_chain *procs) #ifndef NEED_WAITPID /* Pick up all defunct processes */ for (p = procs; p; p = p->next) { - if (apr_proc_wait(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { + if (apr_proc_wait(p->pid, APR_NOWAIT) != APR_CHILD_NOTDONE) { p->kill_how = kill_never; } } diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 577f864277e..8e47243db44 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1237,7 +1237,7 @@ static void free_proc_chain(struct process_chain *procs) #ifndef NEED_WAITPID /* Pick up all defunct processes */ for (p = procs; p; p = p->next) { - if (apr_proc_wait(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { + if (apr_proc_wait(p->pid, APR_NOWAIT) != APR_CHILD_NOTDONE) { p->kill_how = kill_never; } } From 7b31b9290c86ca08ac6c487cb41513ceaf8880ee Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 4 Apr 2001 00:45:13 +0000 Subject: [PATCH 1464/7878] More changes to the time test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61454 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/test/testtime.c b/test/testtime.c index 1d58508d6e8..4c6e2cc187a 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -70,6 +70,7 @@ int main(void) apr_pool_t *p; char *str; apr_size_t sz; + apr_interval_time_t hr_off = 5 * 3600; /* 5 hours in seconds */ fprintf(stdout, "Testing Time functions.\n"); @@ -78,32 +79,32 @@ int main(void) exit (-1); } - fprintf(stdout, "\tapr_time_now.................."); + fprintf(stdout, "\tapr_time_now.............................."); now = apr_time_now(); fprintf(stdout, "OK\n"); - fprintf(stdout, "\tapr_explode_localtime........."); + fprintf(stdout, "\tapr_explode_localtime....................."); if (apr_explode_localtime(&xt, now) != APR_SUCCESS) { fprintf(stderr, "Couldn't explode the time\n"); exit(-1); } fprintf(stdout, "OK\n"); - fprintf(stdout, "\tapr_explode_gmt..............."); + fprintf(stdout, "\tapr_explode_gmt..........................."); if (apr_explode_gmt(&xt, now) != APR_SUCCESS) { fprintf(stderr, "Couldn't explode the time\n"); exit(-1); } fprintf(stdout, "OK\n"); - fprintf(stdout, "\tapr_implode_time.............."); + fprintf(stdout, "\tapr_implode_time.........................."); if (apr_implode_time(&imp, &xt) != APR_SUCCESS) { fprintf(stderr, "Couldn't implode the time\n"); exit(-1); } - if (imp != now) { + if (imp != now) { fprintf(stderr, "implode/explode mismatch\n" - "apr_explode of apr_now() %15I64d\n" + "apr_explode of apr_now() %lld\n" "apr_implode() returned %15I64d\n" "error delta was %15I64d\n", now, imp, imp-now); @@ -111,7 +112,7 @@ int main(void) } fprintf(stdout, "OK\n"); - printf("\tapr_strftime.................."); + printf("\tapr_strftime...................."); str = (char*) apr_pcalloc(p, sizeof(char) * 30); if (str == NULL){ printf("Couldn't allocate memory.\n"); @@ -120,9 +121,35 @@ int main(void) if (apr_strftime(str, &sz, 30, "%R %A %d %B %Y", &xt) != APR_SUCCESS){ printf("Failed!"); + exit (-1); } printf("%s\n", str); - + + printf("\tTime Zone (???)..........................."); + if (apr_strftime(str, &sz, 30, "%R %Z", &xt) != APR_SUCCESS){ + printf("Failed!\n"); + exit (-1); + } + printf ("%s\n", str); + + xt.tm_gmtoff = hr_off; /* 5 hour offset */ + printf("\tOffset Time Zone -5 hours................."); + if (apr_strftime(str, &sz, 30, "%R %Z", &xt) != APR_SUCCESS){ + printf("Failed!\n"); + exit(-1); + } + printf("%s\n", str); + + printf("\tChecking imploded time after offset......."); + apr_implode_time(&imp, &xt); + hr_off *= APR_USEC_PER_SEC; /* microseconds */ + if (imp != now - hr_off){ + printf("Failed! :(\n"); + printf("Difference is %lld (should be %lld)\n", imp - now, hr_off); + exit(-1); + } + printf("OK\n"); + return 1; } From d1d3b12c5416ffeee94f5a2da3bb2d3147387152 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Wed, 4 Apr 2001 07:35:52 +0000 Subject: [PATCH 1465/7878] Speling git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61455 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index f71f01e6469..e944ec1c86f 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -321,10 +321,10 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) sigset_t sig_mask; int rv; - /* All threads should mask signals out, accoring to sigwait(2) man page */ + /* All threads should mask signals out, according to sigwait(2) man page */ sigfillset(&sig_mask); -#if !APR_HAS_THREADS || defined(SIGPROCMASK_SETS_THREAD_MASK) +#if defined(SIGPROCMASK_SETS_THREAD_MASK) rv = sigprocmask(SIG_SETMASK, &sig_mask, NULL); #else if ((rv = pthread_sigmask(SIG_SETMASK, &sig_mask, NULL)) != 0) { From 7f0aecbe777f008b7744d3d97d4b82c35375470c Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 4 Apr 2001 21:43:04 +0000 Subject: [PATCH 1466/7878] Try to resolve the send blocking issues on BeOS R5. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61456 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/sendrecv.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index ec08949d273..74479a81085 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -92,6 +92,9 @@ static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) return APR_SUCCESS; } +#define SEND_WAIT APR_USEC_PER_SEC / 10 +#define MAX_SEND_WAIT 2 * APR_USEC_PER_SEC + apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { ssize_t rv; @@ -101,16 +104,31 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) } while (rv == -1 && errno == EINTR); if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { + apr_int32_t snooze = SEND_WAIT; + apr_int32_t zzz = 0; + int loop = 1; +/* apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; } else { - do { - rv = send(sock->socketdes, buf, (*len), 0); - } while (rv == -1 && errno == EINTR); +*/ + do { + rv = send(sock->socketdes, buf, (*len), 0); + if (rv == -1 && errno == EWOULDBLOCK){ + snooze (snooze_val); + zzz += snooze_val; + snooze_val += (SEND_WAIT * loop++); + /* have we passed our timeout value */ + if (zzz > (sock->timeout * APR_USECS_PER_SEC)) + break; + } + } while (rv == -1 && (errno == EINTR || errno == EWOULDBLOCK)); +/* } +*/ } if (rv == -1) { *len = 0; From d4a62ece36e4723f7030aca6b1952aa99e81d6d3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 4 Apr 2001 22:52:45 +0000 Subject: [PATCH 1467/7878] This change fixes the biggest outstanding bug on BeOS R5. This may need to be applied to the other send/recv functions but more testing will be required to see if they also suffer from the problem. Suggested by Jeff Trawick. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61457 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/sendrecv.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 74479a81085..9af199ea89b 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -57,6 +57,7 @@ #include "../unix/sendrecv.c" #else #include "networkio.h" +#include "apr_time.h" static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) { @@ -93,7 +94,6 @@ static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) } #define SEND_WAIT APR_USEC_PER_SEC / 10 -#define MAX_SEND_WAIT 2 * APR_USEC_PER_SEC apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { @@ -104,31 +104,20 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) } while (rv == -1 && errno == EINTR); if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { - apr_int32_t snooze = SEND_WAIT; + apr_int32_t snooze_val = SEND_WAIT; apr_int32_t zzz = 0; - int loop = 1; -/* - apr_status_t arv = wait_for_io_or_timeout(sock, 0); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } - else { -*/ + do { rv = send(sock->socketdes, buf, (*len), 0); if (rv == -1 && errno == EWOULDBLOCK){ - snooze (snooze_val); + apr_sleep (snooze_val); zzz += snooze_val; - snooze_val += (SEND_WAIT * loop++); + snooze_val += SEND_WAIT; /* have we passed our timeout value */ - if (zzz > (sock->timeout * APR_USECS_PER_SEC)) + if (zzz > (sock->timeout * APR_USEC_PER_SEC)) break; } } while (rv == -1 && (errno == EINTR || errno == EWOULDBLOCK)); -/* - } -*/ } if (rv == -1) { *len = 0; From c4bf91f6449069fc0b0763f2588672bf2a016ce3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 5 Apr 2001 00:58:25 +0000 Subject: [PATCH 1468/7878] More checks and tests for time functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61458 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/test/testtime.c b/test/testtime.c index 4c6e2cc187a..10e313bc258 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -62,13 +62,15 @@ #include #endif +#define STR_SIZE 45 + int main(void) { apr_time_t now; apr_exploded_time_t xt; apr_time_t imp; apr_pool_t *p; - char *str; + char *str, *str2; apr_size_t sz; apr_interval_time_t hr_off = 5 * 3600; /* 5 hours in seconds */ @@ -111,22 +113,37 @@ int main(void) exit(-1); } fprintf(stdout, "OK\n"); + str = apr_pcalloc(p, sizeof(char) * STR_SIZE); + str2 = apr_pcalloc(p, sizeof(char) * STR_SIZE); + + printf("\tapr_rfc822_date.(GMT)..........."); + if (apr_rfc822_date(str, now) != APR_SUCCESS){ + printf("Failed!\n"); + exit (-1); + } + printf("%s\n", str); + + printf("\tapr_ctime.......(local)........."); + if (apr_ctime(str, now) != APR_SUCCESS){ + printf("Failed!\n"); + exit(-1); + } + printf("%s\n", str); printf("\tapr_strftime...................."); - str = (char*) apr_pcalloc(p, sizeof(char) * 30); if (str == NULL){ printf("Couldn't allocate memory.\n"); exit (-1); } - if (apr_strftime(str, &sz, 30, "%R %A %d %B %Y", &xt) != + if (apr_strftime(str, &sz, STR_SIZE, "%R %A %d %B %Y", &xt) != APR_SUCCESS){ printf("Failed!"); exit (-1); } printf("%s\n", str); - printf("\tTime Zone (???)..........................."); - if (apr_strftime(str, &sz, 30, "%R %Z", &xt) != APR_SUCCESS){ + printf("\tCurrent time (GMT)......................."); + if (apr_strftime(str, &sz, STR_SIZE, "%T %Z", &xt) != APR_SUCCESS){ printf("Failed!\n"); exit (-1); } @@ -134,11 +151,21 @@ int main(void) xt.tm_gmtoff = hr_off; /* 5 hour offset */ printf("\tOffset Time Zone -5 hours................."); - if (apr_strftime(str, &sz, 30, "%R %Z", &xt) != APR_SUCCESS){ + if (apr_strftime(str2, &sz, STR_SIZE, "%T %Z", &xt) != APR_SUCCESS){ printf("Failed!\n"); exit(-1); } - printf("%s\n", str); + printf("%s\n", str2); + + /* We just check and report, but this isn't a hanging offense + as it currently doesn't work + */ + printf("\tComparing the created times..............."); + if (! strcmp(str,str2)){ + printf("Failed\n"); + } else { + printf("OK\n"); + } printf("\tChecking imploded time after offset......."); apr_implode_time(&imp, &xt); From 63f9d6822f7c4d788d7aad5b7f320e656f272e0f Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 5 Apr 2001 03:59:29 +0000 Subject: [PATCH 1469/7878] Use $(LIBTOOL) instead of libtool git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61459 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index bacd6dca51c..2065af7f4de 100644 --- a/Makefile.in +++ b/Makefile.in @@ -58,7 +58,7 @@ install: $(TARGET_LIB) if [ ! -d $(libdir) ]; then \ ./build/mkdir.sh $(libdir); \ fi; \ - libtool --mode=install cp $(TARGET_LIB) $(libdir) + $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(libdir) $(TARGET_LIB): @for i in $(SUBDIRS); do objects="$$objects $$i/*.lo"; done ; \ From b52fadc2dad2e4f4f3d219c6b5b759c0cea3f318 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 5 Apr 2001 09:21:44 +0000 Subject: [PATCH 1470/7878] Time to refresh mak on Win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61460 13f79535-47bb-0310-9956-ffa450edef68 --- apr.mak | 5 +++-- libapr.mak | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apr.mak b/apr.mak index f9f9e7e70a3..115cb5e3ad4 100644 --- a/apr.mak +++ b/apr.mak @@ -223,6 +223,7 @@ ALL : "$(OUTDIR)\apr.lib" CLEAN : -@erase "$(INTDIR)\access.obj" -@erase "$(INTDIR)\apr.idb" + -@erase "$(INTDIR)\apr.pdb" -@erase "$(INTDIR)\apr_cpystrn.obj" -@erase "$(INTDIR)\apr_fnmatch.obj" -@erase "$(INTDIR)\apr_getpass.obj" @@ -279,10 +280,10 @@ CLEAN : RSC=rc.exe CPP=cl.exe -CPP_PROJ=/nologo /MDd /W3 /GX /Od /I "./include" /I "./include/arch" /I\ +CPP_PROJ=/nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I\ "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D\ "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ - /Fd"$(INTDIR)\apr" /FD /ZI /c + /Fd"$(INTDIR)\apr" /FD /c CPP_OBJS=.\LibD/ CPP_SBRS=. diff --git a/libapr.mak b/libapr.mak index e57ebef5dd4..cce02ed8bb2 100644 --- a/libapr.mak +++ b/libapr.mak @@ -231,6 +231,7 @@ ALL : "$(OUTDIR)\libapr.dll" CLEAN : -@erase "$(INTDIR)\access.obj" -@erase "$(INTDIR)\apr.idb" + -@erase "$(INTDIR)\apr.pdb" -@erase "$(INTDIR)\apr_cpystrn.obj" -@erase "$(INTDIR)\apr_fnmatch.obj" -@erase "$(INTDIR)\apr_getpass.obj" @@ -290,10 +291,10 @@ CLEAN : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe -CPP_PROJ=/nologo /MDd /W3 /GX /Od /I "./include" /I "./include/arch" /I\ +CPP_PROJ=/nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I\ "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D\ "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ - /Fd"$(INTDIR)\apr" /FD /ZI /c + /Fd"$(INTDIR)\apr" /FD /c CPP_OBJS=.\Debug/ CPP_SBRS=. From 58bdc8724f85ed3b15db5601e95be82c88df6d67 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 5 Apr 2001 16:14:59 +0000 Subject: [PATCH 1471/7878] extremely minor cleanup git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61461 13f79535-47bb-0310-9956-ffa450edef68 --- test/testshmem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/testshmem.c b/test/testshmem.c index 9c0fb5c92d8..f5b6be58d53 100644 --- a/test/testshmem.c +++ b/test/testshmem.c @@ -62,7 +62,6 @@ #include #include #include -/*#include */ #if APR_HAVE_UNISTD_H #include #endif @@ -138,7 +137,7 @@ int main(void) } else if (pid > 0) { msgput(1, "Sending a message\n"); - apr_sleep(1); + apr_sleep(1); msgwait(0); exit(1); } From 23f75619bc0a818fc86b70f8e7dee7d67608efc9 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 5 Apr 2001 18:08:30 +0000 Subject: [PATCH 1472/7878] Change the getnameinfo check so that it should work on Tru64. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61462 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 54 ++++++++++++++++++++++++++++++++++++++++++++ configure.in | 2 +- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index ef5ded0c0df..9fb15354c18 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -48,6 +48,60 @@ if test "$ac_cv_working_getaddrinfo" = "yes"; then fi ]) +dnl +dnl check for working getnameinfo() +dnl +AC_DEFUN(APR_CHECK_WORKING_GETNAMEINFO,[ + AC_CACHE_CHECK(for working getnameinfo, ac_cv_working_getnameinfo,[ + AC_TRY_RUN( [ +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + +void main(void) { + struct sockaddr_in sa; + char hbuf[256]; + int error; + + sa.sin_family = AF_INET; + sa.sin_port = 0; + sa.sin_addr.s_addr = inet_addr("127.0.0.1"); +#ifdef SIN6_LEN + sa.sin_len = sizeof(sa); +#endif + + error = getnameinfo((const struct sockaddr *)&sa, sizeof(sa), + hbuf, 256, NULL, 0, + NI_NAMEREQD); + if (error) { + exit(1); + } else { + exit(0); + } +} +],[ + ac_cv_working_getnameinfo="yes" +],[ + ac_cv_working_getnameinfo="no" +],[ + ac_cv_working_getnameinfo="yes" +])]) +if test "$ac_cv_working_getnameinfo"="yes"; then + AC_DEFINE(HAVE_GETNAMEINFO, 1, [Define if getnameinfo exists]) +fi +]) dnl dnl check for gethostbyname() which handles numeric address strings diff --git a/configure.in b/configure.in index 23dc02c4245..1f722a9da56 100644 --- a/configure.in +++ b/configure.in @@ -991,7 +991,7 @@ dnl # Start of checking for IPv6 support... AC_SEARCH_LIBS(getaddrinfo, inet6) AC_SEARCH_LIBS(getnameinfo, inet6) APR_CHECK_WORKING_GETADDRINFO -AC_CHECK_FUNCS(getnameinfo) +APR_CHECK_WORKING_GETNAMEINFO AC_CHECK_FUNCS(getipnodebyname) AC_CHECK_FUNCS(getipnodebyaddr) APR_CHECK_SOCKADDR_IN6 From 322d16b5c1c519faa7f284f2a81030c39acbbbea Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 5 Apr 2001 18:56:08 +0000 Subject: [PATCH 1473/7878] Recognize systems where the TCP_NODELAY setting is inherited from the listening socket, and optimize apr_setsockopt(APR_TCP_NODELAY) accordingly. Also, note a recent change to find getnameinfo() on Tru64 in CHANGES. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61463 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++ build/apr_network.m4 | 105 ++++++++++++++++++++++++++++++++++ configure.in | 4 ++ include/apr.h.in | 4 ++ include/arch/unix/networkio.h | 2 + network_io/unix/sockets.c | 6 ++ network_io/unix/sockopt.c | 58 +++++++++---------- 7 files changed, 156 insertions(+), 29 deletions(-) diff --git a/CHANGES b/CHANGES index 422db5fe8b2..c7ce3099b7a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) Recognize systems where the TCP_NODELAY setting is inherited from + the listening socket, and optimize apr_setsockopt(APR_TCP_NODELAY) + accordingly. [Jeff Trawick] + + *) Recognize the presence of getnameinfo() on Tru64. [David Reid] + *) Allow APR to be installed. [Ryan Bloom] *) Generate config.nice for easy re-run of configure. [Roy Fielding] diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 9fb15354c18..ebe5e6b1b3f 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -146,6 +146,111 @@ fi ]) +dnl +dnl see if TCP_NODELAY setting is inherited from listening sockets +dnl +AC_DEFUN(APR_CHECK_TCP_NODELAY_INHERITED,[ + AC_CACHE_CHECK(if TCP_NODELAY setting is inherited from listening sockets, ac_cv_tcp_nodelay_inherited,[ + AC_TRY_RUN( [ +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_TCP_H +#include +#endif +int main(void) { + int listen_s, connected_s, client_s; + int listen_port, rc; + struct sockaddr_in sa; + int sa_len; + int option_len; + int option; + + listen_s = socket(AF_INET, SOCK_STREAM, 0); + if (listen_s < 0) { + perror("socket"); + exit(1); + } + option = 1; + rc = setsockopt(listen_s, IPPROTO_TCP, TCP_NODELAY, &option, sizeof option); + if (rc < 0) { + perror("setsockopt TCP_NODELAY"); + exit(1); + } + memset(&sa, 0, sizeof sa); + sa.sin_family = AF_INET; + /* leave port 0 to get ephemeral */ + rc = bind(listen_s, (struct sockaddr *)&sa, sizeof sa); + if (rc < 0) { + perror("bind for ephemeral port"); + exit(1); + } + /* find ephemeral port */ + sa_len = sizeof(sa); + rc = getsockname(listen_s, (struct sockaddr *)&sa, &sa_len); + if (rc < 0) { + perror("getsockname"); + exit(1); + } + listen_port = sa.sin_port; + rc = listen(listen_s, 5); + if (rc < 0) { + perror("listen"); + exit(1); + } + client_s = socket(AF_INET, SOCK_STREAM, 0); + if (client_s < 0) { + perror("socket"); + exit(1); + } + memset(&sa, 0, sizeof sa); + sa.sin_family = AF_INET; + sa.sin_port = listen_port; + /* leave sin_addr all zeros to use loopback */ + rc = connect(client_s, (struct sockaddr *)&sa, sizeof sa); + if (rc < 0) { + perror("connect"); + exit(1); + } + sa_len = sizeof sa; + connected_s = accept(listen_s, (struct sockaddr *)&sa, &sa_len); + if (connected_s < 0) { + perror("accept"); + exit(1); + } + option_len = sizeof option; + rc = getsockopt(connected_s, IPPROTO_TCP, TCP_NODELAY, &option, &option_len); + if (rc < 0) { + perror("getsockopt"); + exit(1); + } + if (!option) { + fprintf(stderr, "TCP_NODELAY is not set in the child.\n"); + exit(1); + } + return 0; +} +],[ + ac_cv_tcp_nodelay_inherited="yes" +],[ + ac_cv_tcp_nodelay_inherited="no" +],[ + ac_cv_tcp_nodelay_inherited="yes" +])]) +if test "$ac_cv_tcp_nodelay_inherited" = "yes"; then + tcp_nodelay_inherited=1 +else + tcp_nodelay_inherited=0 +fi +]) + dnl dnl check for socklen_t, fall back to unsigned int dnl diff --git a/configure.in b/configure.in index 1f722a9da56..a23e92a250c 100644 --- a/configure.in +++ b/configure.in @@ -431,6 +431,7 @@ AC_CHECK_FUNCS(mkstemp) AC_SUBST(fork) AC_SUBST(have_inet_addr) +AC_SUBST(tcp_nodelay_inherited) AC_SUBST(have_inet_network) AC_SUBST(have_sigaction) AC_SUBST(have_setrlimit) @@ -514,6 +515,7 @@ AC_TRY_CPP([ ], netinet_tcph="1", netinet_tcph="0") if test $netinet_tcph = 1; then AC_MSG_RESULT(yes) + echo "#define HAVE_NETINET_TCP_H 1" >> confdefs.h else AC_MSG_RESULT(no) fi @@ -945,6 +947,8 @@ APR_CHECK_SOCKADDR_SA_LEN APR_CHECK_GETHOSTBYNAME_NAS +APR_CHECK_TCP_NODELAY_INHERITED + dnl # Look for a way of corking TCP... APR_CHECK_DEFINE(TCP_CORK, netinet/tcp.h) APR_CHECK_DEFINE(TCP_NOPUSH, netinet/tcp.h) diff --git a/include/apr.h.in b/include/apr.h.in index 583d5225288..544090ee983 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -146,6 +146,10 @@ */ #define APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@ +/* Is the TCP_NODELAY socket option inherited from listening sockets? +*/ +#define APR_TCP_NODELAY_INHERITED @tcp_nodelay_inherited@ + /* Typedefs that APR needs. */ typedef unsigned char apr_byte_t; diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index af12997f4e1..07782f10161 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -156,6 +156,8 @@ struct apr_pollfd_t { const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); +int apr_is_option_set(apr_int32_t, apr_int32_t); +void apr_set_option(apr_int32_t *, apr_int32_t, int); #endif /* ! NETWORK_IO_H */ diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 1d40c3319ee..adeb9612110 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -230,6 +230,12 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn (*new)->local_port_unknown = 1; } +#if APR_TCP_NODELAY_INHERITED + if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) == 1) { + apr_set_option(&(*new)->netmask, APR_TCP_NODELAY, 1); + } +#endif /* TCP_NODELAY_INHERITED */ + if (sock->local_interface_unknown || /* XXX IPv6 issue */ sock->local_addr->sa.sin.sin_addr.s_addr == 0) { diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 5369478d699..780887e6b78 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -55,12 +55,12 @@ #include "networkio.h" #include "apr_strings.h" -static int is_option_set(apr_int32_t mask, apr_int32_t option) +int apr_is_option_set(apr_int32_t mask, apr_int32_t option) { return (mask & option) == option; } -static void set_option(apr_int32_t *mask, apr_int32_t option, int on) +void apr_set_option(apr_int32_t *mask, apr_int32_t option, int on) { if (on) *mask |= option; @@ -134,46 +134,46 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o one = 0; if (opt & APR_SO_KEEPALIVE) { #ifdef SO_KEEPALIVE - if (on != is_option_set(sock->netmask, APR_SO_KEEPALIVE)){ + if (on != apr_is_option_set(sock->netmask, APR_SO_KEEPALIVE)){ if (setsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { return errno; } - set_option(&sock->netmask,APR_SO_KEEPALIVE, on); + apr_set_option(&sock->netmask,APR_SO_KEEPALIVE, on); } #else return APR_ENOTIMPL; #endif } if (opt & APR_SO_DEBUG) { - if (on != is_option_set(sock->netmask, APR_SO_DEBUG)){ + if (on != apr_is_option_set(sock->netmask, APR_SO_DEBUG)){ if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { return errno; } - set_option(&sock->netmask, APR_SO_DEBUG, on); + apr_set_option(&sock->netmask, APR_SO_DEBUG, on); } } if (opt & APR_SO_REUSEADDR) { - if (on != is_option_set(sock->netmask, APR_SO_REUSEADDR)){ + if (on != apr_is_option_set(sock->netmask, APR_SO_REUSEADDR)){ if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { return errno; } - set_option(&sock->netmask, APR_SO_REUSEADDR, on); + apr_set_option(&sock->netmask, APR_SO_REUSEADDR, on); } } if (opt & APR_SO_SNDBUF) { #ifdef SO_SNDBUF - if (is_option_set(sock->netmask, APR_SO_SNDBUF) != on){ + if (apr_is_option_set(sock->netmask, APR_SO_SNDBUF) != on){ if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { return errno; } - set_option(&sock->netmask, APR_SO_SNDBUF, on); + apr_set_option(&sock->netmask, APR_SO_SNDBUF, on); } #else return APR_ENOTIMPL; #endif } if (opt & APR_SO_NONBLOCK) { - if (is_option_set(sock->netmask, APR_SO_NONBLOCK) != on){ + if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != on){ if (on) { if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) return stat; @@ -182,19 +182,19 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) return stat; } - set_option(&sock->netmask, APR_SO_NONBLOCK, on); + apr_set_option(&sock->netmask, APR_SO_NONBLOCK, on); } } if (opt & APR_SO_LINGER) { #ifdef SO_LINGER - if (is_option_set(sock->netmask, APR_SO_LINGER) != on){ + if (apr_is_option_set(sock->netmask, APR_SO_LINGER) != on){ struct linger li; li.l_onoff = on; li.l_linger = MAX_SECS_TO_LINGER; if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { return errno; } - set_option(&sock->netmask, APR_SO_LINGER, on); + apr_set_option(&sock->netmask, APR_SO_LINGER, on); } #else return APR_ENOTIMPL; @@ -203,29 +203,29 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o if (opt & APR_SO_TIMEOUT) { /* don't do the fcntl foo more than needed */ if (on >= 0 && sock->timeout < 0){ - if (is_option_set(sock->netmask, APR_SO_NONBLOCK) != 1){ + if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 1){ if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS){ return stat; } } } else if (on < 0 && sock->timeout >= 0){ - if (is_option_set(sock->netmask, APR_SO_NONBLOCK) != 0){ + if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 0){ if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) { return stat; } } } sock->timeout = on; - set_option(&sock->netmask, APR_SO_TIMEOUT, on); + apr_set_option(&sock->netmask, APR_SO_TIMEOUT, on); } if (opt & APR_TCP_NODELAY) { #if defined(TCP_NODELAY) - if (is_option_set(sock->netmask, APR_TCP_NODELAY) != on){ + if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) != on){ if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { return errno; } - set_option(&sock->netmask, APR_TCP_NODELAY, on); + apr_set_option(&sock->netmask, APR_TCP_NODELAY, on); } #else /* BeOS pre-BONE has TCP_NODELAY set by default. @@ -242,10 +242,10 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o } if (opt & APR_TCP_NOPUSH){ #if APR_TCP_NOPUSH_FLAG - if (is_option_set(sock->netmask, APR_TCP_NOPUSH) != on){ + if (apr_is_option_set(sock->netmask, APR_TCP_NOPUSH) != on){ /* OK we're going to change some settings here... */ /* TCP_NODELAY is mutually exclusive, so do we have it set? */ - if (is_option_set(sock->netmask, APR_TCP_NODELAY) == 1 && on){ + if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) == 1 && on){ /* If we want to set NOPUSH then if we have the TCP_NODELAY * flag set we need to switch it off... */ @@ -254,25 +254,25 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o (void*)&tmpflag, sizeof(int)) == -1){ return errno; } - set_option(&sock->netmask, APR_RESET_NODELAY, 1); - set_option(&sock->netmask, APR_TCP_NODELAY, 0); + apr_set_option(&sock->netmask, APR_RESET_NODELAY, 1); + apr_set_option(&sock->netmask, APR_TCP_NODELAY, 0); } else if (on){ - set_option(&sock->netmask, APR_RESET_NODELAY, 0); + apr_set_option(&sock->netmask, APR_RESET_NODELAY, 0); } /* OK, now we can just set the TCP_NOPUSH flag accordingly...*/ if (setsockopt(sock->socketdes, IPPROTO_TCP, APR_TCP_NOPUSH_FLAG, (void*)&on, sizeof(int)) == -1){ return errno; } - set_option(&sock->netmask, APR_TCP_NOPUSH, on); - if (!on && is_option_set(sock->netmask, APR_RESET_NODELAY)){ + apr_set_option(&sock->netmask, APR_TCP_NOPUSH, on); + if (!on && apr_is_option_set(sock->netmask, APR_RESET_NODELAY)){ int tmpflag = 1; if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void*)&tmpflag, sizeof(int)) == -1){ return errno; } - set_option(&sock->netmask, APR_RESET_NODELAY,0); - set_option(&sock->netmask, APR_TCP_NODELAY, 1); + apr_set_option(&sock->netmask, APR_RESET_NODELAY,0); + apr_set_option(&sock->netmask, APR_TCP_NODELAY, 1); } } #else @@ -290,7 +290,7 @@ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t * *on = sock->timeout; break; default: - *on = is_option_set(sock->netmask, opt); + *on = apr_is_option_set(sock->netmask, opt); } return APR_SUCCESS; } From a3fad0d871b624097fb3a283554062cdd36f43eb Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Fri, 6 Apr 2001 12:40:15 +0000 Subject: [PATCH 1474/7878] Change the order of the flags of COMPILE to make sure that our includes are before the CFLAGS ones. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61464 13f79535-47bb-0310-9956-ffa450edef68 --- build/rules.mk.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/rules.mk.in b/build/rules.mk.in index 98746385af9..133c24fc991 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -83,7 +83,7 @@ LTFLAGS = --silent # # Basic macro setup # -COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) $(OPTIM) $(INCLUDES) +COMPILE = $(CC) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) $(OPTIM) LT_COMPILE = $(LIBTOOL) --mode=compile $(LTFLAGS) $(COMPILE) -c $< && touch $@ LINK = $(LIBTOOL) --mode=link $(LTFLAGS) $(COMPILE) $(LDFLAGS) -o $@ From c341207d9517b0145e427b25448b31ce44946b3e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 6 Apr 2001 18:57:17 +0000 Subject: [PATCH 1475/7878] Make libtool a configure-time option. This is done with --without-libtool. The default is to use libtool git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61465 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ Makefile.in | 7 +++---- build/rules.mk.in | 6 +++--- configure.in | 20 ++++++++++++++++++++ 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index c7ce3099b7a..85ff46b70a3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Make libtool optional at configure time. This is done with + --without-libtool. [Ryan Bloom] + *) Recognize systems where the TCP_NODELAY setting is inherited from the listening socket, and optimize apr_setsockopt(APR_TCP_NODELAY) accordingly. [Jeff Trawick] diff --git a/Makefile.in b/Makefile.in index 2065af7f4de..6375665a134 100644 --- a/Makefile.in +++ b/Makefile.in @@ -42,7 +42,7 @@ includedir=@includedir@ delete-lib: @if test -f $(TARGET_LIB); then \ - for i in $(SUBDIRS); do objects="$$objects $$i/*.lo"; done ; \ + for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \ if test -n "`find $$objects -newer $(TARGET_LIB)`"; then \ echo Found newer objects. Will relink $(TARGET_LIB). ; \ echo $(RM) -f $(TARGET_LIB) ; \ @@ -61,9 +61,8 @@ install: $(TARGET_LIB) $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(libdir) $(TARGET_LIB): - @for i in $(SUBDIRS); do objects="$$objects $$i/*.lo"; done ; \ - echo $(LINK) -rpath $(libdir) $$objects ; \ - $(LINK) -rpath $(libdir) $$objects + @for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \ + $(LINK) delete-exports: @if test -f $(TARGET_EXPORTS); then \ diff --git a/build/rules.mk.in b/build/rules.mk.in index 133c24fc991..0b672aa26fa 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -83,10 +83,10 @@ LTFLAGS = --silent # # Basic macro setup # -COMPILE = $(CC) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) $(OPTIM) -LT_COMPILE = $(LIBTOOL) --mode=compile $(LTFLAGS) $(COMPILE) -c $< && touch $@ +COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) $(OPTIM) $(INCLUDES) +LT_COMPILE = @lt_compile@ -LINK = $(LIBTOOL) --mode=link $(LTFLAGS) $(COMPILE) $(LDFLAGS) -o $@ +LINK = @link@ MKEXPORT = $(AWK) -f $(apr_builders)/make_export.awk MKDEP = $(apr_builders)/mkdep.sh diff --git a/configure.in b/configure.in index a23e92a250c..232b93b48ff 100644 --- a/configure.in +++ b/configure.in @@ -96,6 +96,26 @@ AC_PROG_LIBTOOL ;; esac +AC_ARG_WITH(libtool, [--with-libtool use libtool to link the library], + [ if test "$withval" = "yes"; then + lt_compile="\$(LIBTOOL) --mode=compile \$(LTFLAGS) \$(COMPILE) -c \$< && touch $@" + link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(LDFLAGS) -o \$@ -rpath \$(libdir) \$\$objects" + so_ext="lo" + lib_target="\$(libdir) \$\$objects" + else + lt_compile="\$(COMPILE) -c \$< && touch \$@" + link="ar cr \$(TARGET_LIB) \$\$objects; ranlib \$(TARGET_LIB)" + so_ext="o" + fi ], [ + lt_compile="\$(LIBTOOL) --mode=compile \$(LTFLAGS) \$(COMPILE) -c \$< && touch $@" + link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(LDFLAGS) -o \$@" + so_ext="lo" + ] ) +AC_SUBST(lt_compile) +AC_SUBST(link) +AC_SUBST(so_ext) + + dnl #----------------------------- Checks for compiler flags nl=' ' From 5d2c656d95aed255377330009c09f268dba573d2 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Fri, 6 Apr 2001 23:51:38 +0000 Subject: [PATCH 1476/7878] If we don't have sigwait(), but we have sigsuspend(), use the latter. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61466 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index e944ec1c86f..8c9a9b377d7 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -267,7 +267,7 @@ const char *apr_signal_get_description(int signum) #endif /* SYS_SIGLIST_DECLARED */ -#if APR_HAS_THREADS && !defined(OS2) && APR_HAVE_SIGWAIT +#if APR_HAS_THREADS && (HAVE_SIGSUSPEND || APR_HAVE_SIGWAIT) && !defined(OS2) static void *signal_thread_func(void *signal_handler) { sigset_t sig_mask; @@ -303,6 +303,7 @@ static void *signal_thread_func(void *signal_handler) #endif while (1) { +#if APR_HAVE_SIGWAIT int signal_received; if (apr_sigwait(&sig_mask, &signal_received) != 0) @@ -313,6 +314,11 @@ static void *signal_thread_func(void *signal_handler) if (sig_func(signal_received) == 1) { return NULL; } +#elif HAVE_SIGSUSPEND + sigsuspend(&sig_mask); +#else +#error No apr_sigwait() and no sigsuspend(); I'm stuck. +#endif } } From 8a4872b629632c8df70c6d6a34747dd58a4a526c Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Fri, 6 Apr 2001 23:52:54 +0000 Subject: [PATCH 1477/7878] Check for sigsuspend() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61467 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index 232b93b48ff..ba99bee7719 100644 --- a/configure.in +++ b/configure.in @@ -271,6 +271,7 @@ else echo "APR will be non-threaded" fi +AC_CHECK_FUNCS(sigsuspend) AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ]) dnl AC_CHECK_FUNCS doesn't work for this on Tru64 since the function dnl is renamed in signal.h. Todo: Autodetect From 490c622edd9a37ec2f16eac2f21b83f513acc134 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Sat, 7 Apr 2001 01:02:31 +0000 Subject: [PATCH 1478/7878] Detect mach-o/dyld.h, which we'll need for DSO support on Darwin. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61468 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index ba99bee7719..402d06f3b90 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,7 @@ APR_FLAG_HEADERS( io.h \ langinfo.h \ limits.h \ + mach-o/dyld.h \ malloc.h \ memory.h \ netdb.h \ From abc979fe715dcb8b5ea592112593dafab2fce7bd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 7 Apr 2001 01:03:15 +0000 Subject: [PATCH 1479/7878] execute from the source tree root (e.g. httpd-2.0 or apr itself) with the syntax perl cvsdsp5 -[5|6] to convert to devstudio 5 or 6 dsp format git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61469 13f79535-47bb-0310-9956-ffa450edef68 --- build/cvstodsp5.pl | 43 --------------------- build/cvtdsp.pl | 94 ++++++++++++++++++++++++++++++++++++++++++++++ build/dsp5tocvs.pl | 46 ----------------------- 3 files changed, 94 insertions(+), 89 deletions(-) delete mode 100644 build/cvstodsp5.pl create mode 100644 build/cvtdsp.pl delete mode 100644 build/dsp5tocvs.pl diff --git a/build/cvstodsp5.pl b/build/cvstodsp5.pl deleted file mode 100644 index d37442735f4..00000000000 --- a/build/cvstodsp5.pl +++ /dev/null @@ -1,43 +0,0 @@ -use IO::File; -use File::Find; - -chdir '..'; -find(\&tovc5, '.'); - -sub tovc5 { - - if (m|.dsp$|) { - $oname = $_; - $tname = '.#' . $_; - $verchg = 0; - $srcfl = new IO::File $oname, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - if ($src =~ s|Format Version 6\.00|Format Version 5\.00|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD CPP .*)/ZI (.*)|$1/Zi $2|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD BASE CPP .*)/ZI (.*)|$1/Zi $2|) { - $verchg = -1; - } - if ($src !~ m|^# PROP AllowPerConfigDependencies|) { - print $dstfl $src; } - else { - $verchg = -1; - - } - } - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Converted VC6 project " . $oname . " to VC5 in " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } - } -} \ No newline at end of file diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl new file mode 100644 index 00000000000..45bbb6fb190 --- /dev/null +++ b/build/cvtdsp.pl @@ -0,0 +1,94 @@ +use IO::File; +use File::Find; + +if ($ARGV[0] == '-6') { + find(\&tovc6, '.'); +} +else { + if ($ARGV[0] == '-5') { + find(\&tovc5, '.'); + } + else { + print "Specify -5 or -6 for Visual Studio 5 or 6 (98) .dsp format\n\n"; + die "Missing argument"; + } +} + +sub tovc5 { + + if (m|.dsp$|) { + $oname = $_; + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $oname, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|Format Version 6\.00|Format Version 5\.00|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD CPP .*)/ZI (.*)|$1/Zi $2|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD BASE CPP .*)/ZI (.*)|$1/Zi $2|) { + $verchg = -1; + } + if ($src !~ m|^# PROP AllowPerConfigDependencies|) { + print $dstfl $src; } + else { + $verchg = -1; + + } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted VC6 project " . $oname . " to VC5 in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } + } +} + +sub tovc6 { + + if (m|.dsp$|) { + $oname = $_; + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $_, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|Format Version 5\.00|Format Version 6\.00|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD CPP .*)/Zi (.*)|$1/ZI $2|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD BASE CPP .*)/Zi (.*)|$1/ZI $2|) { + $verchg = -1; + } + if ($src =~ s|^(!MESSAGE .*)\\\n|$1|) { + $cont = <$srcfl>; + $src = $src . $cont; + $verchg = -1; + } + print $dstfl $src; + if ($verchg && $src =~ m|^# Begin Project|) { + print $dstfl "# PROP AllowPerConfigDependencies 0\n"; + } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted VC5 project " . $oname . " to VC6 in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } + } +} diff --git a/build/dsp5tocvs.pl b/build/dsp5tocvs.pl deleted file mode 100644 index 9686b43634b..00000000000 --- a/build/dsp5tocvs.pl +++ /dev/null @@ -1,46 +0,0 @@ -use IO::File; -use File::Find; - -chdir '..'; -find(\&tovc6, '.'); - -sub tovc6 { - - if (m|.dsp$|) { - $oname = $_; - $tname = '.#' . $_; - $verchg = 0; - $srcfl = new IO::File $_, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - if ($src =~ s|Format Version 5\.00|Format Version 6\.00|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD CPP .*)/Zi (.*)|$1/ZI $2|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD BASE CPP .*)/Zi (.*)|$1/ZI $2|) { - $verchg = -1; - } - if ($src =~ s|^(!MESSAGE .*)\\\n|$1|) { - $cont = <$srcfl>; - $src = $src . $cont; - $verchg = -1; - } - print $dstfl $src; - if ($verchg && $src =~ m|^# Begin Project|) { - print $dstfl "# PROP AllowPerConfigDependencies 0\n"; - } - } - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Converted VC5 project " . $oname . " to VC6 in " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } - } -} From 9bf9a62c6e8fda14601da3c5442c910ec3e20c6f Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 7 Apr 2001 04:00:02 +0000 Subject: [PATCH 1480/7878] - When linking a dll, automatically build an import library from the .def file generated so we can link other modules against it. - Recognize install mode. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61470 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/build/aplibtool.c b/build/aplibtool.c index c8f6bc3f631..a549294c7b3 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -66,13 +66,14 @@ typedef char bool; bool silent = false; bool shared = false; bool export_all = false; -enum mode_t { mCompile, mLink }; +enum mode_t { mCompile, mLink, mInstall }; enum output_type_t { otGeneral, otObject, otProgram, otStaticLibrary, otDynamicLibrary }; #ifdef __EMX__ # define SHELL_CMD "sh" # define CC "gcc" # define GEN_EXPORTS "emxexp" +# define DEF2IMPLIB_CMD "emximp" # define SHARE_SW "-Zdll -Zmtd" # define USE_OMF true # define TRUNCATE_DLL_NAME @@ -197,9 +198,14 @@ bool parse_long_opt(char *arg, cmd_data_t *cmd_data) cmd_data->mode = mCompile; cmd_data->output_type = otObject; } + if (strcmp(value, "link") == 0) { cmd_data->mode = mLink; } + + if (strcmp(value, "install") == 0) { + cmd_data->mode = mInstall; + } } else if (strcmp(var, "shared") == 0) { shared = true; } else if (strcmp(var, "export-all") == 0) { @@ -641,6 +647,8 @@ void cleanup_tmp_dirs(cmd_data_t *cmd_data) void generate_def_file(cmd_data_t *cmd_data) { char def_file[1024]; + char implib_file[1024]; + char *ext; FILE *hDef; char *export_args[1024]; int num_export_args = 0; @@ -680,14 +688,36 @@ void generate_def_file(cmd_data_t *cmd_data) export_args[num_export_args++] = NULL; spawnvp(P_WAIT, export_args[0], export_args); cmd_data->arglist[cmd_data->num_args++] = strdup(def_file); + + /* Now make an import library for the dll */ + num_export_args = 0; + export_args[num_export_args++] = DEF2IMPLIB_CMD; + export_args[num_export_args++] = "-o"; + + strcpy(implib_file, ".libs/"); + strcat(implib_file, cmd_data->stub_name); + ext = strrchr(implib_file, '.'); + + if (ext) + *ext = 0; + + strcat(implib_file, "."); + strcat(implib_file, STATIC_LIB_EXT); + + export_args[num_export_args++] = implib_file; + export_args[num_export_args++] = def_file; + spawnvp(P_WAIT, export_args[0], export_args); } } } +/* returns just a file's name without path or extension */ char *nameof(char *fullpath) { + char buffer[1024]; + char *ext; char *name = strrchr(fullpath, '/'); if (name == NULL) { @@ -700,5 +730,13 @@ char *nameof(char *fullpath) name++; } + strcpy(buffer, name); + ext = strrchr(buffer, '.'); + + if (ext) { + *ext = 0; + return strdup(buffer); + } + return name; } From 98691bf9291b394042ee8853767b795cd986b769 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 7 Apr 2001 14:23:22 +0000 Subject: [PATCH 1481/7878] Fix a #error so that signals.c compiles again. Submitted by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61471 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 8c9a9b377d7..e42d7811e4c 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -317,7 +317,7 @@ static void *signal_thread_func(void *signal_handler) #elif HAVE_SIGSUSPEND sigsuspend(&sig_mask); #else -#error No apr_sigwait() and no sigsuspend(); I'm stuck. +#error No apr_sigwait() and no sigsuspend(); I am stuck. #endif } } From ad828c1f628d7857775456fe33f07ac08935011e Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Sat, 7 Apr 2001 18:32:11 +0000 Subject: [PATCH 1482/7878] APR_FLAG_HEADERS: Don't try to set variable with '-' in its name; do the same as we do with '.': drop it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61472 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 32b291978bf..0140fcd341d 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -393,7 +393,7 @@ dnl APR_FLAG_HEADERS(HEADER-FILE ... [, FLAG-TO-SET ] [, "yes" ]) dnl we set FLAG-TO-SET to 1 if we find HEADER-FILE, otherwise we set to 0 dnl if FLAG-TO-SET is null, we automagically determine it's name dnl by changing all "/" to "_" in the HEADER-FILE and dropping -dnl all "." chars. If the 3rd parameter is "yes" then instead of +dnl all "." and "-" chars. If the 3rd parameter is "yes" then instead of dnl setting to 1 or 0, we set FLAG-TO-SET to yes or no. dnl AC_DEFUN(APR_FLAG_HEADERS,[ @@ -401,7 +401,7 @@ AC_CHECK_HEADERS($1) for aprt_i in $1 do ac_safe=`echo "$aprt_i" | sed 'y%./+-%__p_%'` - aprt_2=`echo "$aprt_i" | sed -e 's%/%_%g' -e 's/\.//g'` + aprt_2=`echo "$aprt_i" | sed -e 's%/%_%g' -e 's/\.//g' -e 's/-//g'` if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then eval "ifelse($2,,$aprt_2,$2)=ifelse($3,yes,yes,1)" else From 67ece9e3dda9115018068f3bc359e6489ea31f7a Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Sat, 7 Apr 2001 18:35:25 +0000 Subject: [PATCH 1483/7878] Note sigsuspend() change git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61473 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 85ff46b70a3..c0ab79111dd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) If we don't have sigwait() in the system, see if sigsuspend() is + available, and use that instead. [Wilfredo Sanchez] + *) Make libtool optional at configure time. This is done with --without-libtool. [Ryan Bloom] From 215dfeb65df22fb99d8c912f31bc6e09f44f15a3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 7 Apr 2001 20:19:06 +0000 Subject: [PATCH 1484/7878] Repair the libtool parms so that we can link again. Submitted by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61474 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 402d06f3b90..4bf30558279 100644 --- a/configure.in +++ b/configure.in @@ -108,8 +108,9 @@ AC_ARG_WITH(libtool, [--with-libtool use libtool to link the library], so_ext="o" fi ], [ lt_compile="\$(LIBTOOL) --mode=compile \$(LTFLAGS) \$(COMPILE) -c \$< && touch $@" - link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(LDFLAGS) -o \$@" + link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(LDFLAGS) -o \$@ -rpath \$(libdir) \$\$objects" so_ext="lo" + lib_target="\$(libdir) \$\$objects" ] ) AC_SUBST(lt_compile) AC_SUBST(link) From 8075337f715faada96a0d7ca07d622bcc193c42c Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 8 Apr 2001 04:11:22 +0000 Subject: [PATCH 1485/7878] Don't litter the filesystem with ranlib and touch files if we aren't using libtool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61475 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 4bf30558279..b8d420df4b2 100644 --- a/configure.in +++ b/configure.in @@ -103,7 +103,7 @@ AC_ARG_WITH(libtool, [--with-libtool use libtool to link the library], so_ext="lo" lib_target="\$(libdir) \$\$objects" else - lt_compile="\$(COMPILE) -c \$< && touch \$@" + lt_compile="\$(COMPILE) -c \$<" link="ar cr \$(TARGET_LIB) \$\$objects; ranlib \$(TARGET_LIB)" so_ext="o" fi ], [ From 05c6efdd34e2be14927c81e37bfb23c9fe5e04f4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 8 Apr 2001 04:50:13 +0000 Subject: [PATCH 1486/7878] Cleanup the --without-libtool option. This ensures that the default will always be equivalent to --with-libtool git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61476 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index b8d420df4b2..ed964f8b553 100644 --- a/configure.in +++ b/configure.in @@ -97,21 +97,20 @@ AC_PROG_LIBTOOL esac AC_ARG_WITH(libtool, [--with-libtool use libtool to link the library], - [ if test "$withval" = "yes"; then + [ use_libtool=$withval ], [ use_libtool="yes" ] ) + +echo "FOOBAR::::: $use_libtool" +if test "x$use_libtool" = "xyes"; then lt_compile="\$(LIBTOOL) --mode=compile \$(LTFLAGS) \$(COMPILE) -c \$< && touch $@" link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(LDFLAGS) -o \$@ -rpath \$(libdir) \$\$objects" so_ext="lo" lib_target="\$(libdir) \$\$objects" - else +else lt_compile="\$(COMPILE) -c \$<" link="ar cr \$(TARGET_LIB) \$\$objects; ranlib \$(TARGET_LIB)" so_ext="o" - fi ], [ - lt_compile="\$(LIBTOOL) --mode=compile \$(LTFLAGS) \$(COMPILE) -c \$< && touch $@" - link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(LDFLAGS) -o \$@ -rpath \$(libdir) \$\$objects" - so_ext="lo" - lib_target="\$(libdir) \$\$objects" - ] ) +fi + AC_SUBST(lt_compile) AC_SUBST(link) AC_SUBST(so_ext) From e3069deedbd4a4e8544b7f012871f59737559daa Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 8 Apr 2001 07:56:21 +0000 Subject: [PATCH 1487/7878] The more elaborate check for getnameinfo() sets ac_cv_working_getnameinfo instead of apr_cv_func_getnameinfo. The overall have_ipv6 check needs to take this into account so that IPv6 support can be enabled. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61477 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index ed964f8b553..d823bee80c7 100644 --- a/configure.in +++ b/configure.in @@ -1025,7 +1025,7 @@ AC_MSG_CHECKING(if APR supports IPv6) have_ipv6="0" if test "x$have_sockaddr_in6" = "x1"; then if test "x$ac_cv_working_getaddrinfo" = "xyes"; then - if test "x$ac_cv_func_getnameinfo" = "xyes"; then + if test "x$ac_cv_working_getnameinfo" = "xyes"; then have_ipv6="1" AC_MSG_RESULT("yes") else From dd82fbec7932f551a8182367ca0ee5901c14ad1d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 8 Apr 2001 08:00:01 +0000 Subject: [PATCH 1488/7878] Add working apr_filepath_get/set and apr_filepath_parseroot ports for win32, and bring the (wrong but current) unix apr_filepath_merge into the module as the starting point. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61478 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 501 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 501 insertions(+) create mode 100644 file_io/win32/filepath.c diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c new file mode 100644 index 00000000000..5ab98c56615 --- /dev/null +++ b/file_io/win32/filepath.c @@ -0,0 +1,501 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "fileio.h" +#include "apr_file_io.h" +#include "apr_strings.h" + + +/* Win32 Exceptions: + * + * Note that trailing spaces and trailing periods are never recorded + * in the file system, except by a very obscure bug where any file + * that is created with a trailing space or period, followed by the + * ':' stream designator on an NTFS volume can never be accessed again. + * In other words, don't ever accept them if designating a stream! + * + * An interesting side effect is that two or three periods are both + * treated as the parent directory, although the fourth and on are + * not [strongly suggest all trailing periods are trimmed off, or + * down to two if there are no other characters.] + * + * Leading spaces and periods are accepted, however. + */ +static int is_fnchar(char ch) +{ + /* No control code between 0 and 31 is allowed + * The * ? < > codes all have wildcard effects + * The " / \ : are exlusively separator tokens + * The system doesn't accept | for any purpose. + * Oddly, \x7f _is_ acceptable. + */ + if (ch >= 0 && ch < 32) + return 0; + + if (ch == '\"' || ch == '*' || ch == '/' + || ch == ':' || ch == '<' || ch == '>' + || ch == '?' || ch == '\\' || ch == '|') + return 0; + + return 1; +} + + +APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, + apr_pool_t *p) +{ + char path[APR_PATH_MAX]; +#if APR_HAS_UNICODE_FS + apr_oslevel_e os_level; + if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t wpath[APR_PATH_MAX]; + apr_status_t rv; + if (!GetCurrentDirectoryW(sizeof(wpath) / sizeof(apr_wchar_t), wpath)) + return apr_get_os_error(); + if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) + return rv; + } + else +#endif + { + if (!GetCurrentDirectory(sizeof(path), path)) + return apr_get_os_error(); + } + *rootpath = apr_pstrdup(p, path); + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath, + apr_pool_t *p) +{ +#if APR_HAS_UNICODE_FS + apr_oslevel_e os_level; + if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t wpath[APR_PATH_MAX]; + apr_status_t rv; + if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) + / sizeof(apr_wchar_t), rootpath)) + return rv; + if (!SetCurrentDirectoryW(wpath)) + return apr_get_os_error(); + } + else +#endif + { + if (!SetCurrentDirectory(rootpath)) + return apr_get_os_error(); + } + return APR_SUCCESS; +} + + +/* WinNT accepts several odd forms of a 'root' path. Under Unicode + * calls (ApiFunctionW) the //?/C:/foo or //?/UNC/mach/share/foo forms + * are accepted. Ansi and Unicode functions both accept the //./C:/foo + * form. Since these forms are handled in the utf-8 to unicode + * translation phase, we don't want the user confused by them, so we + * will accept them but always return the canonical C:/ or //mach/share/ + */ + +APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, + const char **inpath, apr_pool_t *p) +{ + const char *testpath = *inpath; + const char *delim1; + const char *delim2; + char *newpath; + + if (testpath[0] == '/' || testpath[0] == '\\') { + if (testpath[1] == '/' || testpath[1] == '\\') { + /* //server/share isn't the only // delimited syntax */ + if ((testpath[2] == '?' || testpath[2] == '.') + && (testpath[3] == '/' || testpath[3] == '\\')) { + if (is_fnchar(testpath[4]) && testpath[5] == ':') + { + apr_status_t rv; + testpath += 4; + /* given '//?/C: or //./C: let us try this + * all over again from the drive designator + */ + rv = apr_filepath_root(rootpath, &testpath, p); + if (!rv || rv == APR_EINCOMPLETE) + *inpath = testpath; + return rv; + } + else if (strncasecmp(testpath + 4, "UNC", 3) == 0 + && (testpath[7] == '/' || testpath[7] == '\\') + && (testpath[2] == '?')) { + /* given '//?/UNC/machine/share, a little magic + * at the end makes this all work out by using + * 'C/machine' as the starting point and replacing + * the UNC delimiters with \'s, including the 'C' + */ + testpath += 6; + } + else + /* This must not be a path to a file, but rather + * a volume or device. Die for now. + */ + return APR_EBADPATH; + } + + /* Evaluate path of '//[machine/[share[/]]]' */ + delim1 = testpath + 2; + do { + /* Protect against //X/ where X is illegal */ + if (*delim1 && !is_fnchar(*(delim1++))) + return APR_EBADPATH; + } while (*delim1 && *delim1 != '/' && *delim1 != '\\'); + + if (*delim1) { + delim2 = delim1 + 1; + do { + /* Protect against //machine/X/ where X is illegal */ + if (*delim2 && !is_fnchar(*(delim2++))) + return APR_EBADPATH; + } while (*delim2 && *delim2 != '/' && *delim2 != '\\'); + + if (delim2) { + /* Have path of '//machine/share/[whatnot]' */ + newpath = apr_pstrndup(p, testpath, delim2 - testpath); + newpath[0] = '\\'; + newpath[1] = '\\'; + newpath[delim1 - testpath] = '\\'; + newpath[delim2 - testpath] = '\\'; + *rootpath = newpath; + *inpath = delim2 + 1; + while (**inpath == '/' || **inpath == '\\') + ++*inpath; + return APR_SUCCESS; + } + + /* Have path of '//machine/[share]' */ + delim2 = strchr(delim1, '\0'); + newpath = apr_pstrndup(p, testpath, delim2 - testpath); + newpath[0] = '\\'; + newpath[1] = '\\'; + newpath[delim1 - testpath] = '\\'; + *rootpath = newpath; + *inpath = delim2; + return APR_EINCOMPLETE; + } + + /* Have path of '//[machine]' */ + delim1 = strchr(testpath, '\0'); + newpath = apr_pstrndup(p, testpath, delim1 - testpath); + newpath[0] = '\\'; + newpath[1] = '\\'; + *rootpath = newpath; + *inpath = delim1; + return APR_EINCOMPLETE; + } + + /* Left with a path of '/', what drive are we asking about? */ + *rootpath = apr_pstrdup(p, "/"); + *inpath = ++testpath; + return APR_EINCOMPLETE; + } + + /* Evaluate path of 'd:[/]' */ + if (is_fnchar(*testpath) && testpath[1] == ':') { + if (testpath[2] == '/' || testpath[2] == '\\') { + *rootpath = apr_pstrndup(p, testpath, 3); + *inpath = testpath + 3; + while (**inpath == '/' || **inpath == '\\') + ++*inpath; + return APR_SUCCESS; + } + + /* Left with path of 'd:' from the cwd of this drive letter */ + *rootpath = apr_pstrndup(p, testpath, 2); + *inpath = testpath + 2; + return APR_EINCOMPLETE; + } + + /* Nothing interesting */ + return APR_ERELATIVE; +} + + +APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, + const char *rootpath, + const char *addpath, + apr_int32_t flags, + apr_pool_t *p) +{ + char path[APR_PATH_MAX]; /* isn't null term */ + apr_size_t rootlen; /* is the length of the src rootpath */ + apr_size_t keptlen; /* is the length of the retained rootpath */ + apr_size_t pathlen; /* is the length of the result path */ + apr_size_t seglen; /* is the end of the current segment */ + apr_status_t rv; + + /* Treat null as an empty path. + */ + if (!addpath) + addpath = ""; + + if (addpath[0] == '/') + { + /* If addpath is rooted, then rootpath is unused. + * Ths violates any APR_FILEPATH_SECUREROOTTEST and + * APR_FILEPATH_NOTABSOLUTE flags specified. + */ + if (flags & APR_FILEPATH_SECUREROOTTEST) + return APR_EABOVEROOT; + if (flags & APR_FILEPATH_NOTABSOLUTE) + return APR_EABSOLUTE; + + /* If APR_FILEPATH_NOTABOVEROOT wasn't specified, + * we won't test the root again, it's ignored. + * Waste no CPU retrieving the working path. + */ + if (!rootpath && !(flags & APR_FILEPATH_NOTABOVEROOT)) + rootpath = ""; + } + else + { + /* If APR_FILEPATH_NOTABSOLUTE is specified, the caller + * requires a relative result. If the rootpath is + * ommitted, we do not retrieve the working path, + * if rootpath was supplied as absolute then fail. + */ + if (flags & APR_FILEPATH_NOTABSOLUTE) + { + if (!rootpath) + rootpath = ""; + else if (rootpath[0] == '/') + return APR_EABSOLUTE; + } + } + + if (!rootpath) + { + /* Start with the current working path. This is bass akwards, + * but required since the compiler (at least vc) doesn't like + * passing the address of a char const* for a char** arg. + */ + char *getpath; + rv = apr_filepath_get(&getpath, p); + rootpath = getpath; + if (rv != APR_SUCCESS) + return errno; + + /* XXX: Any kernel subject to goofy, uncanonical results + * must run the rootpath against the user's given flags. + * Simplest would be a recursive call to apr_filepath_merge + * with an empty (not null) rootpath and addpath of the cwd. + */ + } + + rootlen = strlen(rootpath); + + if (addpath[0] == '/') + { + /* Ignore the given root path, strip off leading + * '/'s to a single leading '/' from the addpath, + * and leave addpath at the first non-'/' character. + */ + keptlen = 0; + while (addpath[0] == '/') + ++addpath; + path[0] = '/'; + pathlen = 1; + } + else + { + /* If both paths are relative, fail early + */ + if (rootpath[0] != '/' && (flags & APR_FILEPATH_NOTRELATIVE)) + return APR_ERELATIVE; + + /* Base the result path on the rootpath + */ + keptlen = rootlen; + if (rootlen >= sizeof(path)) + return APR_ENAMETOOLONG; + memcpy(path, rootpath, rootlen); + + /* Always '/' terminate the given root path + */ + if (keptlen && path[keptlen - 1] != '/') { + if (keptlen + 1 >= sizeof(path)) + return APR_ENAMETOOLONG; + path[keptlen++] = '/'; + } + pathlen = keptlen; + } + + while (*addpath) + { + /* Parse each segment, find the closing '/' + */ + seglen = 0; + while (addpath[seglen] && addpath[seglen] != '/') + ++seglen; + + if (seglen == 0 || (seglen == 1 && addpath[0] == '.')) + { + /* noop segment (/ or ./) so skip it + */ + } + else if (seglen == 2 && addpath[0] == '.' && addpath[1] == '.') + { + /* backpath (../) */ + if (pathlen == 1 && path[0] == '/') + { + /* Attempt to move above root. Always die if the + * APR_FILEPATH_SECUREROOTTEST flag is specified. + */ + if (flags & APR_FILEPATH_SECUREROOTTEST) + return APR_EABOVEROOT; + + /* Otherwise this is simply a noop, above root is root. + * Flag that rootpath was entirely replaced. + */ + keptlen = 0; + } + else if (pathlen == 0 + || (pathlen == 3 && !memcmp(path + pathlen - 3, "../", 3)) + || (pathlen > 3 && !memcmp(path + pathlen - 4, "/../", 4))) + { + /* Path is already backpathed or empty, if the + * APR_FILEPATH_SECUREROOTTEST.was given die now. + */ + if (flags & APR_FILEPATH_SECUREROOTTEST) + return APR_EABOVEROOT; + + /* Otherwise append another backpath. + */ + if (pathlen + 3 >= sizeof(path)) + return APR_ENAMETOOLONG; + memcpy(path + pathlen, "../", 3); + pathlen += 3; + } + else + { + /* otherwise crop the prior segment + */ + do { + --pathlen; + } while (pathlen && path[pathlen - 1] != '/'); + } + + /* Now test if we are above where we started and back up + * the keptlen offset to reflect the added/altered path. + */ + if (pathlen < keptlen) + { + if (flags & APR_FILEPATH_SECUREROOTTEST) + return APR_EABOVEROOT; + keptlen = pathlen; + } + } + else + { + /* An actual segment, append it to the destination path + */ + apr_size_t i = (addpath[seglen] != '\0'); + if (pathlen + seglen + i >= sizeof(path)) + return APR_ENAMETOOLONG; + memcpy(path + pathlen, addpath, seglen + i); + pathlen += seglen + i; + } + + /* Skip over trailing slash to the next segment + */ + if (addpath[seglen]) + ++seglen; + + addpath += seglen; + } + path[pathlen] = '\0'; + + /* keptlen will be the rootlen unless the addpath contained + * backpath elements. If so, and APR_FILEPATH_NOTABOVEROOT + * is specified (APR_FILEPATH_SECUREROOTTEST was caught above), + * compare the original root to assure the result path is + * still within given root path. + */ + if ((flags & APR_FILEPATH_NOTABOVEROOT) && keptlen < rootlen) { + if (strncmp(rootpath, path, rootlen)) + return APR_EABOVEROOT; + if (rootpath[rootlen - 1] != '/' + && path[rootlen] && path[rootlen] != '/') + return APR_EABOVEROOT; + } + +#if 0 + /* Just an idea - don't know where it's headed yet */ + if (addpath && addpath[endseg - 1] != '/' + && (flags & APR_FILEPATH_TRUECASE)) { + apr_finfo_t finfo; + if (apr_stat(&finfo, path, APR_FINFO_TYPE, p) == APR_SUCCESS) { + if (addpath[endseg - 1] != finfo.filetype == APR_DIR) { + if (endseg + 1 >= sizeof(path)) + return APR_ENAMETOOLONG; + path[endseg++] = '/'; + path[endseg] = '\0'; + } + } + } +#endif + + *newpath = apr_pstrdup(p, path); + return APR_SUCCESS; +} From eddd070c24994f8d4828a0cebe8c6f80327223fe Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 8 Apr 2001 08:01:38 +0000 Subject: [PATCH 1489/7878] This fmt requires a corresponding macro for unix apr.h.in, which I threw out to new-httpd, but have no way to test git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61479 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/apr.hw b/include/apr.hw index be0e7eb0732..3c1cc3194ac 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -292,6 +292,10 @@ typedef int gid_t; #define APR_OS_PROC_T_FMT "d" +#define APR_INT64_T_FMT "I64d" + +#define APR_TIME_T_FMT APR_INT64_T_FMT + /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" From 02f0c7bec8d0936d7c544945e285dae6a5946f48 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 8 Apr 2001 08:02:40 +0000 Subject: [PATCH 1490/7878] A new status APR_EBADPATH, plus the '-' prefix on messages that are still missing from errorcodes.c (!) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61480 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 702a93c1ddf..5aa49d1331c 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -161,7 +161,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, /** *
      * APR ERROR VALUES
    - * APR_ENOSTAT      APR was unable to perform a stat on the file 
    + * APR_ENOSTAT     -APR was unable to perform a stat on the file 
      * APR_ENOPOOL      APR was not provided a pool with which to allocate memory
      * APR_EBADDATE     APR was given an invalid date 
      * APR_EINVALSOCK   APR was given an invalid socket
    @@ -177,7 +177,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
      * APR_ENOSHMAVAIL  There is no more shared memory available
      * APR_EDSOOPEN     APR was unable to open the dso object.  For more 
      *                  information call apr_dso_error().
    - * APR_EGENERAL     General failure (specific information not available)
    + * APR_EGENERAL    -General failure (specific information not available)
      * APR_EBADIP       The specified IP address is invalid
      * APR_EBADMASK     The specified netmask is invalid
      * 
    @@ -247,6 +247,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_ERELATIVE (APR_OS_START_ERROR + 21) #define APR_EINCOMPLETE (APR_OS_START_ERROR + 22) #define APR_EABOVEROOT (APR_OS_START_ERROR + 23) +#define APR_EBADPATH (APR_OS_START_ERROR + 24) /* APR ERROR VALUE TESTS */ @@ -273,6 +274,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ERELATIVE(s) ((s) == APR_ERELATIVE) #define APR_STATUS_IS_EINCOMPLETE(s) ((s) == APR_EINCOMPLETE) #define APR_STATUS_IS_EABOVEROOT(s) ((s) == APR_EABOVEROOT) +#define APR_STATUS_IS_EBADPATH(s) ((s) == APR_EBADPATH) /* APR STATUS VALUES */ From c04aba3dac09a0b99778f5b8fdc789e2f8ba04f2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 8 Apr 2001 08:03:09 +0000 Subject: [PATCH 1491/7878] Hmmm... some missing messages (my bad) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61481 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index adc6395c7ea..63267001a8d 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -79,12 +79,12 @@ static char *apr_error_string(apr_status_t statcode) switch (statcode) { case APR_ENOPOOL: return "A new pool could not be created."; - case APR_ENOFILE: - return "No file was provided and one was required."; case APR_EBADDATE: return "An invalid date has been provided"; case APR_EINVALSOCK: return "An invalid socket was returned"; + case APR_ENOFILE: + return "No file was provided and one was required."; case APR_ENOPROC: return "No process was provided and one was required."; case APR_ENOTIME: @@ -103,18 +103,17 @@ static char *apr_error_string(apr_status_t statcode) return "No thread key structure was provided and one was required."; case APR_ENOSHMAVAIL: return "No shared memory is currently available"; -#if APR_HAS_DSO case APR_EDSOOPEN: -#ifdef HAVE_LIBDL +#if APR_HAS_DSO && defined(HAVE_LIBDL) return dlerror(); #else return "DSO load failed"; #endif /* HAVE_LIBDL */ -#endif /* APR_HAS_DSO */ case APR_EBADIP: return "The specified IP address is invalid."; case APR_EBADMASK: return "The specified network mask is invalid."; + case APR_INCHILD: return "Your code just forked, and you are currently executing in the " @@ -157,7 +156,17 @@ static char *apr_error_string(apr_status_t statcode) return "This function has not been implemented on this platform"; case APR_EMISMATCH: return "passwords do not match"; - default: + case APR_EABSOLUTE: + return "The given path is absolute"; + case APR_ERELATIVE: + return "The given path is relative"; + case APR_EINCOMPLETE: + return "The given path is incomplete"; + case APR_EABOVEROOT: + return "The given path was above the root path"; + case APR_EBADPATH: + return "The given path misformatted or contained invalid characters"; + default: return "Error string not specified yet"; } } From 64d0dab731f4c6c79adf29aecbc346429e1db045 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 8 Apr 2001 08:06:15 +0000 Subject: [PATCH 1492/7878] The code all compiles, but apr_filepath_merge isn't trained yet to parse backslashes and win32 roots. That's the next patch tommorow. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61482 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++++ libapr.dsp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apr.dsp b/apr.dsp index fae69ae34e7..588986ddf45 100644 --- a/apr.dsp +++ b/apr.dsp @@ -214,6 +214,10 @@ SOURCE=.\include\arch\win32\fileio.h # End Source File # Begin Source File +SOURCE=.\file_io\win32\filepath.c +# End Source File +# Begin Source File + SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index c019deeedac..68f83265a21 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -219,6 +219,10 @@ SOURCE=.\include\arch\win32\fileio.h # End Source File # Begin Source File +SOURCE=.\file_io\win32\filepath.c +# End Source File +# Begin Source File + SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File From 8765bb3e2b587ae17a1c72d8050ec024bc71671b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 8 Apr 2001 08:08:19 +0000 Subject: [PATCH 1493/7878] Add my testbench that demonstrates apr_filepath_merge. This would be better written to handle and compare a list of demonstration cases to the expected results, but I've no time for it this weekend git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61483 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.pl | 2 +- test/Makefile.in | 4 ++ test/testnames.c | 130 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 test/testnames.c diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl index 4fb80b6f37c..c756f79423d 100644 --- a/test/MakeWin32Make.pl +++ b/test/MakeWin32Make.pl @@ -15,7 +15,7 @@ if ($t =~ m|^ALL_LIBS=|) { $t = "ALL_LIBS=../LibD/apr.lib kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib"; } - if ($t =~ s|\@CFLAGS\@|\/nologo \/MDd \/W3 \/Gm \/GX \/Zi \/Od \/D "_DEBUG" \/D "WIN32" \/D APR_DECLARE_STATIC \/FD|) { + if ($t =~ s|\@CFLAGS\@|\/nologo \/c \/MDd \/W3 \/Gm \/GX \/Zi \/Od \/D "_DEBUG" \/D "WIN32" \/D APR_DECLARE_STATIC \/FD|) { $t =~ s|-g ||; } $t =~ s|\$\{LD_FLAGS\}||; diff --git a/test/Makefile.in b/test/Makefile.in index f791d766891..a8abf302a91 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -4,6 +4,7 @@ PROGRAMS = \ sendfile@EXEEXT@ \ server@EXEEXT@ \ testfile@EXEEXT@ \ + testnames@EXEEXT@ \ testflock@EXEEXT@ \ testproc@EXEEXT@ \ testsock@EXEEXT@ \ @@ -42,6 +43,9 @@ INCLUDES=-I$(INCDIR) testfile@EXEEXT@: testfile.lo ../libapr.la $(LINK) testfile.lo $(ALL_LIBS) +testnames@EXEEXT@: testnames.lo ../libapr.la + $(LINK) testnames.lo $(ALL_LIBS) + testflock@EXEEXT@: testflock.lo ../libapr.la $(LINK) testflock.lo $(ALL_LIBS) diff --git a/test/testnames.c b/test/testnames.c new file mode 100644 index 00000000000..d9c31e248c1 --- /dev/null +++ b/test/testnames.c @@ -0,0 +1,130 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include +#include +#include +#include "apr_file_io.h" +#include "apr_file_info.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_lib.h" + +apr_pool_t *context; + +static void closeapr(void) +{ + apr_pool_destroy(context); + apr_terminate(); +} + +static void mergeresult(char *rootpath, char *addpath, apr_int32_t mergetype, char *tdesc) +{ + char errmsg[256]; + char *dstpath = NULL; + char *srcpath; + apr_status_t status = apr_filepath_merge(&dstpath, + strcmp(rootpath, "NULL") ? rootpath : NULL, + strcmp(addpath, "NULL") ? addpath : NULL, + mergetype, context); + apr_strerror(status, errmsg, sizeof(errmsg)); + if (dstpath) { + fprintf(stderr, "%s result for %s\n\tResult Path \"%s\"\n", errmsg, tdesc, dstpath); + srcpath = dstpath; + status = apr_filepath_root(&dstpath, &srcpath, context); + if (srcpath != dstpath) { + apr_strerror(status, errmsg, sizeof(errmsg)); + fprintf(stderr, "\tRoot of \"%s\" (%s)\n", dstpath, errmsg); + } + } + else { + fprintf(stderr, "%s result for %s\n", errmsg, tdesc, dstpath); + } +} + +#define merge_result(r, a, t) mergeresult(r, a, t, #t) + +int main(void) +{ + char rootpath[256]; + char addpath[256]; + + if (apr_initialize() != APR_SUCCESS) { + fprintf(stderr, "Couldn't initialize."); + exit(-1); + } + atexit(closeapr); + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { + fprintf(stderr, "Couldn't allocate context."); + exit(-1); + } + + fprintf(stdout, "Testing file truepath.\n"); + + while (1) { + fprintf(stdout, "\nEnter a root path$ "); + if (!gets(rootpath)) + exit(0); + fprintf(stdout, "Enter an add path$ "); + if (!gets(addpath)) + exit(0); + merge_result(rootpath, addpath, 0); + merge_result(rootpath, addpath, APR_FILEPATH_NOTABOVEROOT); + merge_result(rootpath, addpath, APR_FILEPATH_SECUREROOT); + merge_result(rootpath, addpath, APR_FILEPATH_NOTABSOLUTE); + merge_result(rootpath, addpath, APR_FILEPATH_NOTRELATIVE); + } + return (0); +} From 225dc116e2e79a4b8f46def0b1d1ca146f92ca60 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 8 Apr 2001 08:18:05 +0000 Subject: [PATCH 1494/7878] Another source, and the makefile itself to help troubleshoot the .pl conversion when the source makefile.in is changing git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61484 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.dsp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/aprtest.dsp b/test/aprtest.dsp index f562131f7b4..3965caddd17 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -128,6 +128,10 @@ SOURCE=.\testmmap.c # End Source File # Begin Source File +SOURCE=.\testnames.c +# End Source File +# Begin Source File + SOURCE=.\testoc.c # End Source File # Begin Source File @@ -169,6 +173,10 @@ SOURCE=.\aprtest.win # End Source File # Begin Source File +SOURCE=.\Makefile +# End Source File +# Begin Source File + SOURCE=.\Makefile.in # End Source File # Begin Source File From c8a606769bce88d0e9aecb92035125ce9449a174 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 8 Apr 2001 08:21:04 +0000 Subject: [PATCH 1495/7878] Fix the touch invocation in the lt_compile variable so that we don't leave stray "ranlib" and "dummy" files everywhere. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61485 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index d823bee80c7..ca53eb962eb 100644 --- a/configure.in +++ b/configure.in @@ -101,7 +101,7 @@ AC_ARG_WITH(libtool, [--with-libtool use libtool to link the library], echo "FOOBAR::::: $use_libtool" if test "x$use_libtool" = "xyes"; then - lt_compile="\$(LIBTOOL) --mode=compile \$(LTFLAGS) \$(COMPILE) -c \$< && touch $@" + lt_compile="\$(LIBTOOL) --mode=compile \$(LTFLAGS) \$(COMPILE) -c \$< && touch \$@" link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(LDFLAGS) -o \$@ -rpath \$(libdir) \$\$objects" so_ext="lo" lib_target="\$(libdir) \$\$objects" From 2c9d703ec24822f3ccd2decd6926de17aef533a8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 8 Apr 2001 16:44:37 +0000 Subject: [PATCH 1496/7878] Remove a debug statement git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61486 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.in b/configure.in index ca53eb962eb..06e8854791a 100644 --- a/configure.in +++ b/configure.in @@ -99,7 +99,6 @@ esac AC_ARG_WITH(libtool, [--with-libtool use libtool to link the library], [ use_libtool=$withval ], [ use_libtool="yes" ] ) -echo "FOOBAR::::: $use_libtool" if test "x$use_libtool" = "xyes"; then lt_compile="\$(LIBTOOL) --mode=compile \$(LTFLAGS) \$(COMPILE) -c \$< && touch \$@" link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(LDFLAGS) -o \$@ -rpath \$(libdir) \$\$objects" From 85ff736efe1a0c8fbf7110080272ebeda84e332e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 9 Apr 2001 04:48:17 +0000 Subject: [PATCH 1497/7878] Cleanup the --with-libtool option. The test directory now compiles cleanly when libtool is used. It doesn't work without libtool yet however. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61487 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ Makefile.in | 2 +- configure.in | 7 ++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index c0ab79111dd..8d56deac8dd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Fixup the --with-libtool option. This allows the test directory + to compile again. The test directory still doesn't work when + APR is configured without libtool. [Ryan Bloom] + *) If we don't have sigwait() in the system, see if sigsuspend() is available, and use that instead. [Wilfredo Sanchez] diff --git a/Makefile.in b/Makefile.in index 6375665a134..f3d7022381d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -62,7 +62,7 @@ install: $(TARGET_LIB) $(TARGET_LIB): @for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \ - $(LINK) + $(LINK) @lib_target@ delete-exports: @if test -f $(TARGET_EXPORTS); then \ diff --git a/configure.in b/configure.in index 06e8854791a..b07e80c4e61 100644 --- a/configure.in +++ b/configure.in @@ -101,19 +101,20 @@ AC_ARG_WITH(libtool, [--with-libtool use libtool to link the library], if test "x$use_libtool" = "xyes"; then lt_compile="\$(LIBTOOL) --mode=compile \$(LTFLAGS) \$(COMPILE) -c \$< && touch \$@" - link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(LDFLAGS) -o \$@ -rpath \$(libdir) \$\$objects" + link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(LDFLAGS) -o \$@" so_ext="lo" - lib_target="\$(libdir) \$\$objects" + lib_target="-rpath \$(libdir) \$\$objects" else lt_compile="\$(COMPILE) -c \$<" link="ar cr \$(TARGET_LIB) \$\$objects; ranlib \$(TARGET_LIB)" so_ext="o" + lib_target="" fi AC_SUBST(lt_compile) AC_SUBST(link) AC_SUBST(so_ext) - +AC_SUBST(lib_target) dnl #----------------------------- Checks for compiler flags nl=' From d986c66762bab7dfec8d5b2535ee0097e50c1992 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 9 Apr 2001 04:57:46 +0000 Subject: [PATCH 1498/7878] gets is an unsafe function, and it outputs and error message on Linux. Using fgets makes this compile quietly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61488 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testnames.c b/test/testnames.c index d9c31e248c1..02372686a52 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -115,10 +115,10 @@ int main(void) while (1) { fprintf(stdout, "\nEnter a root path$ "); - if (!gets(rootpath)) + if (!fgets(rootpath, 256, stdin)) exit(0); fprintf(stdout, "Enter an add path$ "); - if (!gets(addpath)) + if (!fgets(addpath, 256, stdin)) exit(0); merge_result(rootpath, addpath, 0); merge_result(rootpath, addpath, APR_FILEPATH_NOTABOVEROOT); From 10140656aa3c37a089ad846dc7af0d78b322a650 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 9 Apr 2001 04:58:53 +0000 Subject: [PATCH 1499/7878] new test program, we should ignore it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61489 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.cvsignore b/test/.cvsignore index 2f432f49555..6e9f53e7606 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -35,3 +35,4 @@ testipsub *.pdb *.idb mod_test.dll +testnames From fde0509d2548246aae42e2f587335853bcb9171a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 9 Apr 2001 16:40:19 +0000 Subject: [PATCH 1500/7878] Change --with-libtool to --enable-libtool git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61490 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++-- configure.in | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 8d56deac8dd..c38414fe8ab 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,6 @@ Changes with APR b1 - *) Fixup the --with-libtool option. This allows the test directory + *) Fixup the --enable-libtool option. This allows the test directory to compile again. The test directory still doesn't work when APR is configured without libtool. [Ryan Bloom] @@ -8,7 +8,7 @@ Changes with APR b1 available, and use that instead. [Wilfredo Sanchez] *) Make libtool optional at configure time. This is done with - --without-libtool. [Ryan Bloom] + --disable-libtool. [Ryan Bloom] *) Recognize systems where the TCP_NODELAY setting is inherited from the listening socket, and optimize apr_setsockopt(APR_TCP_NODELAY) diff --git a/configure.in b/configure.in index b07e80c4e61..23aafc8a1a6 100644 --- a/configure.in +++ b/configure.in @@ -96,7 +96,7 @@ AC_PROG_LIBTOOL ;; esac -AC_ARG_WITH(libtool, [--with-libtool use libtool to link the library], +AC_ARG_ENABLE(libtool, [--with-libtool use libtool to link the library], [ use_libtool=$withval ], [ use_libtool="yes" ] ) if test "x$use_libtool" = "xyes"; then From 578647a744d17b56f3ae98f6fb955f27b013d120 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 9 Apr 2001 20:18:16 +0000 Subject: [PATCH 1501/7878] Hmmm... fgets() is flavored a bit differenly from gets() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61491 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/testnames.c b/test/testnames.c index 02372686a52..009d92ae11d 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -100,6 +100,7 @@ int main(void) { char rootpath[256]; char addpath[256]; + char *eos; if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Couldn't initialize."); @@ -117,9 +118,15 @@ int main(void) fprintf(stdout, "\nEnter a root path$ "); if (!fgets(rootpath, 256, stdin)) exit(0); + for (eos = strchr(rootpath, '\0'); --eos >= rootpath; ) + if (isspace(*eos)) + *eos = '\0'; fprintf(stdout, "Enter an add path$ "); if (!fgets(addpath, 256, stdin)) exit(0); + for (eos = strchr(addpath, '\0'); --eos >= addpath; ) + if (isspace(*eos)) + *eos = '\0'; merge_result(rootpath, addpath, 0); merge_result(rootpath, addpath, APR_FILEPATH_NOTABOVEROOT); merge_result(rootpath, addpath, APR_FILEPATH_SECUREROOT); From f6bed0c070c70bf1e39b0cf3d5abf74a29e7e9f4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 10 Apr 2001 05:11:32 +0000 Subject: [PATCH 1502/7878] Implement specific to win32, validate the actual root requested (to avoid walking off into "Device Not Ready" nonsense) and tear apart and put back together all [most?] of the nightmarish flavors of win32 file paths. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61492 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 + file_io/win32/filepath.c | 581 +++++++++++++++++++++++++++++++-------- 2 files changed, 468 insertions(+), 119 deletions(-) diff --git a/CHANGES b/CHANGES index c38414fe8ab..ff2a7ef0af0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) Initial implementation of of apr_filepath (get/set/parse_root and + merge) for Windows. [William Rowe] + + *) Cleaned up implementation of of apr_filepath (get/set/parse_root + and merge) for Unix. [Greg Stein, William Rowe] + *) Fixup the --enable-libtool option. This allows the test directory to compile again. The test directory still doesn't work when APR is configured without libtool. [Ryan Bloom] diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 5ab98c56615..56ae8006d7a 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -64,7 +64,7 @@ * in the file system, except by a very obscure bug where any file * that is created with a trailing space or period, followed by the * ':' stream designator on an NTFS volume can never be accessed again. - * In other words, don't ever accept them if designating a stream! + * In other words, don't ever accept them when designating a stream! * * An interesting side effect is that two or three periods are both * treated as the parent directory, although the fourth and on are @@ -93,6 +93,30 @@ static int is_fnchar(char ch) } +static apr_status_t apr_filepath_root_test(char *path, + apr_pool_t *p) +{ + apr_status_t rv; +#if APR_HAS_UNICODE_FS + apr_oslevel_e os_level; + if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t wpath[APR_PATH_MAX]; + if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) + / sizeof(apr_wchar_t), path)) + return rv; + rv = GetDriveTypeW(wpath); + } + else +#endif + rv = GetDriveType(path); + + if (rv == DRIVE_UNKNOWN || rv == DRIVE_NO_ROOT_DIR) + return APR_EBADPATH; + return APR_SUCCESS; +} + + APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_pool_t *p) { @@ -119,6 +143,47 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, } +static apr_status_t apr_filepath_drive_get(char **rootpath, + char drive, + apr_pool_t *p) +{ + char path[APR_PATH_MAX]; +#if APR_HAS_UNICODE_FS + apr_oslevel_e os_level; + if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t *ignored; + apr_wchar_t wdrive[8]; + apr_wchar_t wpath[APR_PATH_MAX]; + apr_status_t rv; + /* ???: This needs review, apparently "\\?\d:." returns "\\?\d:" + * as if that is useful for anything. + */ + wcscpy(wdrive, L"D:."); + wdrive[0] = (apr_wchar_t)(unsigned char)drive; + if (!GetFullPathNameW(wdrive, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored)) + return apr_get_os_error(); + if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) + return rv; + *rootpath = apr_pstrdup(p, path); + } + else +#endif + { + char *ignored; + char drivestr[4]; + drivestr[0] = drive; + drivestr[1] = ':'; + drivestr[2] = '.';; + drivestr[3] = '\0'; + if (!GetFullPathName(drivestr, sizeof(path), path, &ignored)) + return apr_get_os_error(); + *rootpath = apr_pstrdup(p, path); + } + return APR_SUCCESS; +} + + APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath, apr_pool_t *p) { @@ -203,41 +268,73 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, } while (*delim1 && *delim1 != '/' && *delim1 != '\\'); if (*delim1) { + apr_status_t rv; delim2 = delim1 + 1; - do { + while (*delim2 && *delim2 != '/' && *delim2 != '\\') { /* Protect against //machine/X/ where X is illegal */ - if (*delim2 && !is_fnchar(*(delim2++))) + if (!is_fnchar(*(delim2++))) return APR_EBADPATH; - } while (*delim2 && *delim2 != '/' && *delim2 != '\\'); + } - if (delim2) { - /* Have path of '//machine/share/[whatnot]' */ + if (!*delim2) { + /* Have path of '//machine/[share]' so we must have + * an extra byte for the trailing slash + */ + newpath = apr_pstrndup(p, testpath, delim2 - testpath + 1); + newpath[delim2 - testpath + 1] = '\0'; + } + else newpath = apr_pstrndup(p, testpath, delim2 - testpath); - newpath[0] = '\\'; - newpath[1] = '\\'; - newpath[delim1 - testpath] = '\\'; - newpath[delim2 - testpath] = '\\'; + + newpath[0] = '\\'; + newpath[1] = '\\'; + newpath[delim1 - testpath] = '\\'; + + if (delim2 == delim1 + 1) { + /* We simply \\machine\, so give up already + */ *rootpath = newpath; + *inpath = delim2; + return APR_EINCOMPLETE; + } + + /* Validate the \\Machine\Share\ designation, must + * root this designation! + */ + newpath[delim2 - testpath] = '\\'; + rv = apr_filepath_root_test(newpath, p); + if (rv) + return rv; + + /* If this root included the trailing / or \ designation + * then lop off multiple trailing slashes + */ + if (*delim2) { *inpath = delim2 + 1; while (**inpath == '/' || **inpath == '\\') ++*inpath; - return APR_SUCCESS; + /* Give back the caller's own trailing delimiter + */ + newpath[delim2 - testpath] = *delim2; } - - /* Have path of '//machine/[share]' */ - delim2 = strchr(delim1, '\0'); - newpath = apr_pstrndup(p, testpath, delim2 - testpath); - newpath[0] = '\\'; - newpath[1] = '\\'; - newpath[delim1 - testpath] = '\\'; + else + *inpath = delim2; + *rootpath = newpath; - *inpath = delim2; - return APR_EINCOMPLETE; + return APR_SUCCESS; } - /* Have path of '//[machine]' */ + /* Have path of '\\[machine]', if the machine is given, + * append the trailing \ + */ delim1 = strchr(testpath, '\0'); - newpath = apr_pstrndup(p, testpath, delim1 - testpath); + if (delim1 > testpath + 2) { + newpath = apr_pstrndup(p, testpath, delim1 - testpath + 1); + newpath[delim1 - testpath] = '\\'; + newpath[delim1 - testpath + 1] = '\0'; + } + else + newpath = apr_pstrndup(p, testpath, delim1 - testpath); newpath[0] = '\\'; newpath[1] = '\\'; *rootpath = newpath; @@ -245,24 +342,43 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, return APR_EINCOMPLETE; } - /* Left with a path of '/', what drive are we asking about? */ - *rootpath = apr_pstrdup(p, "/"); + /* Left with a path of '/', what drive are we asking about? + * The guess is left to the caller. + */ + *rootpath = apr_pstrndup(p, testpath, 1); *inpath = ++testpath; return APR_EINCOMPLETE; } /* Evaluate path of 'd:[/]' */ - if (is_fnchar(*testpath) && testpath[1] == ':') { + if (is_fnchar(*testpath) && testpath[1] == ':') + { + apr_status_t rv; + /* Validate that d:\ drive exists, test must be rooted + */ + newpath = apr_pstrndup(p, testpath, 3); + newpath[2] = '\\'; + newpath[3] = '\0'; + rv = apr_filepath_root_test(newpath, p); + if (rv) + return rv; + + /* Have full 'd:/' so replace our \ with the given root char + */ if (testpath[2] == '/' || testpath[2] == '\\') { - *rootpath = apr_pstrndup(p, testpath, 3); + newpath[2] = testpath[2]; + *rootpath = newpath; *inpath = testpath + 3; while (**inpath == '/' || **inpath == '\\') ++*inpath; return APR_SUCCESS; } - /* Left with path of 'd:' from the cwd of this drive letter */ - *rootpath = apr_pstrndup(p, testpath, 2); + /* Left with path of 'd:' from the cwd of this drive letter + * so truncate the root \ we added above; + */ + newpath[2] = '\0'; + *rootpath = newpath; *inpath = testpath + 2; return APR_EINCOMPLETE; } @@ -273,112 +389,254 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, - const char *rootpath, + const char *basepath, const char *addpath, apr_int32_t flags, apr_pool_t *p) { char path[APR_PATH_MAX]; /* isn't null term */ - apr_size_t rootlen; /* is the length of the src rootpath */ - apr_size_t keptlen; /* is the length of the retained rootpath */ - apr_size_t pathlen; /* is the length of the result path */ - apr_size_t seglen; /* is the end of the current segment */ + char *baseroot = NULL; + char *addroot; + apr_size_t rootlen; /* the length of the root portion of path, d:/ is 3 */ + apr_size_t baselen; /* the length of basepath (excluding baseroot) */ + apr_size_t keptlen; /* the length of the retained basepath (incl root) */ + apr_size_t pathlen; /* the length of the result path */ + apr_size_t segend; /* the end of the current segment */ + apr_size_t seglen; /* the length of the segment (excl trailing chars) */ + apr_status_t basetype; /* from parsing the basepath's baseroot */ + apr_status_t addtype; /* from parsing the addpath's addroot */ apr_status_t rv; - - /* Treat null as an empty path. + int fixunc = 0; /* flag to complete an incomplete UNC basepath */ + + /* Treat null as an empty path, otherwise split addroot from the addpath */ - if (!addpath) - addpath = ""; + if (!addpath) { + addpath = addroot = ""; + addtype = APR_ERELATIVE; + } + else { + addtype = apr_filepath_root(&addroot, &addpath, p); + if (addtype == APR_SUCCESS) { + addtype = APR_EABSOLUTE; + } + else if (addtype == APR_ERELATIVE) { + addroot = ""; + } + else if (addtype != APR_EINCOMPLETE) { + /* apr_filepath_root was incomprehensible so fail already + */ + return addtype; + } + } - if (addpath[0] == '/') + /* If addpath is (even partially) rooted, then basepath is + * unused. Ths violates any APR_FILEPATH_SECUREROOTTEST + * and APR_FILEPATH_NOTABSOLUTE flags specified. + */ + if (addtype == APR_EABSOLUTE || addtype == APR_EINCOMPLETE) { - /* If addpath is rooted, then rootpath is unused. - * Ths violates any APR_FILEPATH_SECUREROOTTEST and - * APR_FILEPATH_NOTABSOLUTE flags specified. - */ if (flags & APR_FILEPATH_SECUREROOTTEST) return APR_EABOVEROOT; if (flags & APR_FILEPATH_NOTABSOLUTE) - return APR_EABSOLUTE; + return addtype; + } + + /* Optimized tests before we query the current working path + */ + if (!basepath) { /* If APR_FILEPATH_NOTABOVEROOT wasn't specified, * we won't test the root again, it's ignored. * Waste no CPU retrieving the working path. */ - if (!rootpath && !(flags & APR_FILEPATH_NOTABOVEROOT)) - rootpath = ""; - } - else - { + if (addtype == APR_EABSOLUTE && !(flags & APR_FILEPATH_NOTABOVEROOT)) { + basepath = baseroot = ""; + basetype = APR_ERELATIVE; + } + /* If APR_FILEPATH_NOTABSOLUTE is specified, the caller - * requires a relative result. If the rootpath is - * ommitted, we do not retrieve the working path, - * if rootpath was supplied as absolute then fail. + * requires an absolutely relative result, So do not retrieve + * the working path. */ - if (flags & APR_FILEPATH_NOTABSOLUTE) - { - if (!rootpath) - rootpath = ""; - else if (rootpath[0] == '/') - return APR_EABSOLUTE; + if (addtype == APR_ERELATIVE && (flags & APR_FILEPATH_NOTABSOLUTE)) { + basepath = baseroot = ""; + basetype = APR_ERELATIVE; } } - if (!rootpath) + if (!basepath) { /* Start with the current working path. This is bass akwards, * but required since the compiler (at least vc) doesn't like * passing the address of a char const* for a char** arg. + * We must grab the current path of the designated drive + * if addroot is given in drive-relative form (e.g. d:foo) */ char *getpath; - rv = apr_filepath_get(&getpath, p); - rootpath = getpath; + if (addtype == APR_EINCOMPLETE && addroot[1] == ':') + rv = apr_filepath_drive_get(&getpath, addroot[0], p); + else + rv = apr_filepath_get(&getpath, p); if (rv != APR_SUCCESS) - return errno; - - /* XXX: Any kernel subject to goofy, uncanonical results - * must run the rootpath against the user's given flags. - * Simplest would be a recursive call to apr_filepath_merge - * with an empty (not null) rootpath and addpath of the cwd. - */ + return rv; + basepath = getpath; } - rootlen = strlen(rootpath); + if (!baseroot) { + basetype = apr_filepath_root(&baseroot, &basepath, p); + if (basetype == APR_SUCCESS) { + basetype = APR_EABSOLUTE; + } + else if (basetype == APR_ERELATIVE) { + baseroot = ""; + } + else if (basetype != APR_EINCOMPLETE) { + /* apr_filepath_root was incomprehensible so fail already + */ + return basetype; + } + } + baselen = strlen(basepath); - if (addpath[0] == '/') + /* If APR_FILEPATH_NOTABSOLUTE is specified, the caller + * requires an absolutely relative result. If the given + * basepath is not relative then fail. + */ + if ((flags & APR_FILEPATH_NOTABSOLUTE) && basetype != APR_ERELATIVE) + return basetype; + + /* The Win32 nightmare on unc street... start combining for + * many possible root combinations. + */ + if (addtype == APR_EABSOLUTE) { - /* Ignore the given root path, strip off leading - * '/'s to a single leading '/' from the addpath, - * and leave addpath at the first non-'/' character. + /* Ignore the given root path, and start with the addroot */ + if ((flags & APR_FILEPATH_NOTABOVEROOT) + && strncmp(baseroot, addroot, strlen(baseroot))) + return APR_EABOVEROOT; keptlen = 0; - while (addpath[0] == '/') - ++addpath; - path[0] = '/'; - pathlen = 1; + rootlen = pathlen = strlen(addroot); + memcpy(path, addroot, pathlen); } - else + else if (addtype == APR_EINCOMPLETE) { + /* There are several types of incomplete paths, + * incomplete UNC paths (//foo/ or //), + * drives without rooted paths (d: as in d:foo), + * and simple roots (/ as in /foo). + * Deal with these in significantly different manners... + */ + if ((addroot[0] == '/' || addroot[0] == '\\') && + (addroot[1] == '/' || addroot[1] == '\\')) + { + /* Ignore the given root path if the incomplete addpath is UNC, + * (note that the final result will be incomplete). + */ + if (flags & APR_FILEPATH_NOTRELATIVE) + return addtype; + if ((flags & APR_FILEPATH_NOTABOVEROOT) + && strncmp(baseroot, addroot, strlen(baseroot))) + return APR_EABOVEROOT; + fixunc = 1; + keptlen = 0; + rootlen = pathlen = strlen(addroot); + memcpy(path, addroot, pathlen); + } + else if ((addroot[0] == '/' || addroot[0] == '\\') && !addroot[1]) + { + /* Bring together the drive or UNC root from the baseroot + * if the addpath is a simple root and basepath is rooted, + * otherwise disregard the basepath entirely. + */ + if (basetype != APR_EABSOLUTE && (flags & APR_FILEPATH_NOTRELATIVE)) + return basetype; + if (basetype != APR_ERELATIVE) { + if (basetype == APR_INCOMPLETE + && (baseroot[0] == '/' || baseroot[0] == '\\') + && (baseroot[1] == '/' || baseroot[1] == '\\')) + fixunc = 1; + keptlen = rootlen = pathlen = strlen(baseroot); + memcpy(path, baseroot, pathlen); + } + else { + if (flags & APR_FILEPATH_NOTABOVEROOT) + return APR_EABOVEROOT; + keptlen = 0; + rootlen = pathlen = strlen(addroot); + memcpy(path, addroot, pathlen); + } + } + else if (addroot[0] && addroot[1] == ':' && !addroot[2]) + { + /* If the addroot is a drive (without a volume root) + * use the basepath _if_ it matches this drive letter! + * Otherwise we must discard the basepath. + */ + if (addroot[0] == baseroot[0] && baseroot[1] == ':') { + /* Base the result path on the basepath + */ + if (basetype != APR_EABSOLUTE && (flags & APR_FILEPATH_NOTRELATIVE)) + return basetype; + rootlen = strlen(baseroot); + pathlen = baselen; + if (rootlen + pathlen >= sizeof(path)) + return APR_ENAMETOOLONG; + memcpy(path, baseroot, rootlen); + memcpy(path + rootlen, basepath, pathlen); + pathlen += rootlen; + } + else { + if (flags & APR_FILEPATH_NOTRELATIVE) + return addtype; + if (flags & APR_FILEPATH_NOTABOVEROOT) + return APR_EABOVEROOT; + keptlen = 0; + rootlen = pathlen = strlen(addroot); + memcpy(path, addroot, pathlen); + } + } + else { + /* Now this is unexpected, we aren't aware of any other + * incomplete path forms! Fail now. + */ + return APR_EBADPATH; + } + } + else { /* addtype == APR_ERELATIVE */ /* If both paths are relative, fail early */ - if (rootpath[0] != '/' && (flags & APR_FILEPATH_NOTRELATIVE)) - return APR_ERELATIVE; + if (basetype != APR_EABSOLUTE && (flags & APR_FILEPATH_NOTRELATIVE)) + return basetype; + + /* An incomplete UNC path must be completed + */ + if (basetype == APR_INCOMPLETE + && (baseroot[0] == '/' || baseroot[0] == '\\') + && (baseroot[1] == '/' || baseroot[1] == '\\')) + fixunc = 1; - /* Base the result path on the rootpath + /* Base the result path on the basepath */ - keptlen = rootlen; - if (rootlen >= sizeof(path)) + rootlen = strlen(baseroot); + pathlen = baselen; + if (rootlen + pathlen >= sizeof(path)) + return APR_ENAMETOOLONG; + memcpy(path, baseroot, rootlen); + memcpy(path + rootlen, basepath, pathlen); + pathlen += rootlen; + } + + /* '/' terminate the given root path unless it's already terminated + * or is an incomplete drive root. + */ + if (pathlen && path[pathlen - 1] != '/' && path[pathlen - 1] != '\\' + && path[pathlen - 1] != ':') { + if (pathlen + 1 >= sizeof(path)) return APR_ENAMETOOLONG; - memcpy(path, rootpath, rootlen); - /* Always '/' terminate the given root path - */ - if (keptlen && path[keptlen - 1] != '/') { - if (keptlen + 1 >= sizeof(path)) - return APR_ENAMETOOLONG; - path[keptlen++] = '/'; - } - pathlen = keptlen; + path[pathlen++] = '/'; + } while (*addpath) @@ -386,18 +644,51 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* Parse each segment, find the closing '/' */ seglen = 0; - while (addpath[seglen] && addpath[seglen] != '/') + while (addpath[seglen] && addpath[seglen] != '/' + && addpath[seglen] != '\\') ++seglen; + /* Truncate all trailing spaces and all but the first two dots */ + segend = seglen; + while (seglen && (addpath[seglen - 1] == ' ' + || addpath[seglen - 1] == '.')) { + if (seglen > 2 || addpath[seglen - 1] != '.' || addpath[0] != '.') + --seglen; + else + break; + } + if (seglen == 0 || (seglen == 1 && addpath[0] == '.')) { - /* noop segment (/ or ./) so skip it + /* NOTE: win32 _hates_ '/ /' and '/. /' (yes, with spaces in there) + * so eliminate all preconceptions that it is valid. + */ + if (seglen < segend) + return APR_EBADPATH; + + /* This isn't legal unless the unc path is completed + */ + if (fixunc) + return APR_EBADPATH; + + /* Otherwise, this is a noop segment (/ or ./) so ignore it */ } else if (seglen == 2 && addpath[0] == '.' && addpath[1] == '.') { + /* NOTE: win32 _hates_ '/.. /' (yes, with a space in there) and + * '/..../' so eliminate all preconceptions that they are valid. + */ + if (seglen < segend && (seglen != 3 || addpath[2] != '.')) + return APR_EBADPATH; + + /* This isn't legal unless the unc path is completed + */ + if (fixunc) + return APR_EBADPATH; + /* backpath (../) */ - if (pathlen == 1 && path[0] == '/') + if (pathlen <= rootlen) { /* Attempt to move above root. Always die if the * APR_FILEPATH_SECUREROOTTEST flag is specified. @@ -406,13 +697,15 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, return APR_EABOVEROOT; /* Otherwise this is simply a noop, above root is root. - * Flag that rootpath was entirely replaced. */ - keptlen = 0; } - else if (pathlen == 0 - || (pathlen == 3 && !memcmp(path + pathlen - 3, "../", 3)) - || (pathlen > 3 && !memcmp(path + pathlen - 4, "/../", 4))) + else if (pathlen == 0 || + (pathlen >= 3 && (pathlen == 3 + || path[pathlen - 4] == ':') + && path[pathlen - 3] == '.' + && path[pathlen - 2] == '.' + && (path[pathlen - 1] == '/' + || path[pathlen - 1] == '\\'))) { /* Path is already backpathed or empty, if the * APR_FILEPATH_SECUREROOTTEST.was given die now. @@ -433,7 +726,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, */ do { --pathlen; - } while (pathlen && path[pathlen - 1] != '/'); + } while (pathlen && path[pathlen - 1] != '/' + && path[pathlen - 1] != '\\'); } /* Now test if we are above where we started and back up @@ -446,42 +740,91 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, keptlen = pathlen; } } - else + else /* not empty or dots */ { - /* An actual segment, append it to the destination path - */ - apr_size_t i = (addpath[seglen] != '\0'); - if (pathlen + seglen + i >= sizeof(path)) - return APR_ENAMETOOLONG; - memcpy(path + pathlen, addpath, seglen + i); - pathlen += seglen + i; + if (fixunc) { + char *testpath = path; + char *testroot; + apr_status_t testtype; + apr_size_t i = (addpath[segend] != '\0'); + + + /* This isn't legal unless the unc path is complete! + */ + if (seglen < segend) + return APR_EBADPATH; + if (pathlen + seglen + 1 >= sizeof(path)) + return APR_ENAMETOOLONG; + memcpy(path + pathlen, addpath, seglen + i); + + /* Always add the trailing slash to a UNC segment + */ + if (i) + path[pathlen + seglen] = addpath[segend]; + else + path[pathlen + seglen] = '\\'; + pathlen += seglen + 1; + + /* Recanonicalize the UNC root with the new UNC segment, + * and if we succeed, reset this test and the rootlen, + * and replace our path with the canonical UNC root path + */ + path[pathlen] = '\0'; + testtype = apr_filepath_root(&testroot, &testpath, p); + if (testtype == APR_SUCCESS) { + rootlen = pathlen = (testpath - path); + memcpy(path, testroot, pathlen); + fixunc = 0; + } + else if (testtype != APR_EINCOMPLETE) { + /* apr_filepath_root was very unexpected so fail already + */ + return testtype; + } + } + else { + /* An actual segment, append it to the destination path + */ + apr_size_t i = (addpath[segend] != '\0'); + if (pathlen + seglen + i >= sizeof(path)) + return APR_ENAMETOOLONG; + memcpy(path + pathlen, addpath, seglen + i); + if (i) + path[pathlen + seglen] = addpath[segend]; + pathlen += seglen + i; + } } /* Skip over trailing slash to the next segment */ - if (addpath[seglen]) - ++seglen; + if (addpath[segend]) + ++segend; - addpath += seglen; + addpath += segend; } path[pathlen] = '\0'; - /* keptlen will be the rootlen unless the addpath contained + /* keptlen will be the baselen unless the addpath contained * backpath elements. If so, and APR_FILEPATH_NOTABOVEROOT * is specified (APR_FILEPATH_SECUREROOTTEST was caught above), - * compare the original root to assure the result path is - * still within given root path. + * compare the string beyond the root to assure the result path + * is still within given basepath. Note that the root path + * segment is thoroughly tested prior to path parsing. */ - if ((flags & APR_FILEPATH_NOTABOVEROOT) && keptlen < rootlen) { - if (strncmp(rootpath, path, rootlen)) + if (flags & APR_FILEPATH_NOTABOVEROOT && (keptlen - rootlen) < baselen) { + if (strncmp(basepath, path + rootlen, baselen)) return APR_EABOVEROOT; - if (rootpath[rootlen - 1] != '/' - && path[rootlen] && path[rootlen] != '/') + + /* Ahem... if we weren't given a trailing slash on the basepath, + * we better be sure that /foo wasn't replaced with /foobar! + */ + if (basepath[baselen - 1] != '/' && basepath[baselen - 1] != '\\' + && path[baselen] && path[baselen] != '/' && path[baselen] != '\\') return APR_EABOVEROOT; } #if 0 - /* Just an idea - don't know where it's headed yet */ + /* Just an idea - still don't know where it's headed */ if (addpath && addpath[endseg - 1] != '/' && (flags & APR_FILEPATH_TRUECASE)) { apr_finfo_t finfo; From c9187d8a13c2178fcb0864b26bc57c33f8623137 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 10 Apr 2001 05:34:12 +0000 Subject: [PATCH 1503/7878] Fix two minor bogosities, the case folding of directory names and my first two bugs in this code. Still needs some canonicalization and some major vetting. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61493 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 56ae8006d7a..7efb5234212 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -354,9 +354,15 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, if (is_fnchar(*testpath) && testpath[1] == ':') { apr_status_t rv; - /* Validate that d:\ drive exists, test must be rooted + /* Validate that D:\ drive exists, test must be rooted + * Note that posix/win32 insists a drive letter is upper case, + * so who are we to argue with a 'feature' we might exploit. + * It is a safe fold, since only A-Z is legal, and has no + * side effects of legal mis-mapped non-us-ascii codes. */ - newpath = apr_pstrndup(p, testpath, 3); + newpath = apr_palloc(p, 3); + newpath[0] = toupper(testpath[0]); + newpath[1] = ':'; newpath[2] = '\\'; newpath[3] = '\0'; rv = apr_filepath_root_test(newpath, p); @@ -819,7 +825,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * we better be sure that /foo wasn't replaced with /foobar! */ if (basepath[baselen - 1] != '/' && basepath[baselen - 1] != '\\' - && path[baselen] && path[baselen] != '/' && path[baselen] != '\\') + && path[rootlen + baselen] && path[rootlen + baselen] != '/' + && path[rootlen + baselen] != '\\') return APR_EABOVEROOT; } From 4e2ba8dd52ae0da953f350d6bbf1965fa8f247fd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 10 Apr 2001 19:22:13 +0000 Subject: [PATCH 1504/7878] APR_FILEPATH_CANONICAL is senseless, so it's gone. OTOH, APR_FILEPATH_NATIVE does make sense, so it's added (noop on unix). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61494 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 17ff8ef3b88..7bdfecca6d0 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -282,9 +282,9 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); /* Fail apr_filepath_merge if the merged path is absolute */ #define APR_FILEPATH_NOTABSOLUTE 0x08 -/* Cleans all ambigious /./ or // segments - * if the target is a directory */ -#define APR_FILEPATH_CANONICAL 0x10 +/* Return the file system's native path format (e.g. path delimiters + * of ':' on MacOS9, '\' on Win32, etc.) */ +#define APR_FILEPATH_NATIVE 0x10 /* Resolve the true case of existing directories and file elements * of addpath, and append a proper trailing slash if a directory From f1c859196ad39ee1d0a46e03d7deae18ab30f811 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Wed, 11 Apr 2001 02:01:23 +0000 Subject: [PATCH 1505/7878] Fix the naming of the apr_threadattr_detach_xxx functions. get and set were reversed. This may have broken the Unix threaded mpm's when they started using the bogus "set" function. A likely symptom would be failure to stop a threaded process cleanly. Note: it appears these functions are essentially no-ops except in Unix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61495 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 12 ++++++------ include/arch/unix/threadproc.h | 1 + threadproc/beos/thread.c | 4 ++-- threadproc/os2/thread.c | 4 ++-- threadproc/unix/thread.c | 4 ++-- threadproc/win32/thread.c | 4 ++-- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 5e37b489247..b86c14aa1aa 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -165,20 +165,20 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new_attr, apr_pool_t *cont); /** - * Set if newly created threads should be created in detach mode. + * Set if newly created threads should be created in detached state. * @param attr The threadattr to affect * @param on Thread detach state on or off - * @deffunc apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) + * @deffunc apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) */ -APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr, +APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on); /** - * Get the detach mode for this threadattr. + * Get the detach state for this threadattr. * @param attr The threadattr to reference - * @deffunc apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) + * @deffunc apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) */ -APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr); +APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr); /** * Create a new thread of execution diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index c14270dd39b..832001f9e74 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -86,6 +86,7 @@ #define SHELL_PATH "/bin/sh" #if APR_HAS_THREADS + struct apr_thread_t { apr_pool_t *cntxt; pthread_t *td; diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 041319d9c16..d0fac8e4e42 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -69,7 +69,7 @@ apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) +apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) { if (on == 1){ attr->detached = 1; @@ -79,7 +79,7 @@ apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) return APR_SUCCESS; } -apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) +apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) { if (attr->detached == 1){ return APR_DETACH; diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index aa85f43f16e..0f15e6fe327 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -77,7 +77,7 @@ apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) -apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) +apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) { attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; @@ -85,7 +85,7 @@ apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) -apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) +apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) { return (attr->attr & APR_THREADATTR_DETACHED) ? APR_DETACH : APR_NOTDETACH; } diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 90f4d0c164a..a8bcc333418 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -82,7 +82,7 @@ apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) return stat; } -apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) +apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) { apr_status_t stat; #ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR @@ -102,7 +102,7 @@ apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr, apr_int32_t on) } } -apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr) +apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) { int state; diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 624da55fb07..047a68a9429 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -75,14 +75,14 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr, +APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) { attr->detach = on; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr) +APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) { if (attr->detach == 1) return APR_DETACH; From d2a0d547977a23b4b589859eaec56ecf0eaaafb4 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Wed, 11 Apr 2001 06:16:33 +0000 Subject: [PATCH 1506/7878] Make clean, distclean, and extraclean consistently according to the Gnu makefile guidelines. Submitted by: Justin Erenkrantz Reviewed by: Roy Fielding git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61496 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ Makefile.in | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index ff2a7ef0af0..bf3f9d476de 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Make clean, distclean, and extraclean consistently according to the + Gnu makefile guidelines. [Justin Erenkrantz ] + *) Initial implementation of of apr_filepath (get/set/parse_root and merge) for Windows. [William Rowe] diff --git a/Makefile.in b/Makefile.in index f3d7022381d..31873e56c5e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -29,9 +29,8 @@ TARGETS = delete-lib $(TARGET_LIB) delete-exports $(TARGET_EXPORTS) CLEAN_TARGETS = $(TARGET_EXPORTS) DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ - APRVARS -EXTRACLEAN_TARGETS = configure libtool aclocal.m4 \ - include/arch/unix/apr_private.h.in + APRVARS libtool build/rules.mk +EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in SCANDOC_TEMPLATE = -i$(apr_builders)/scandoc_template.pl From 93b94c49d7d41d875ac29b56354ffbda5d4543ad Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 11 Apr 2001 17:01:50 +0000 Subject: [PATCH 1507/7878] Whoops, lost a zero somewhere along the line git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61497 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libapr.dsp b/libapr.dsp index 68f83265a21..4b8fead0ff5 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -52,8 +52,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF !ELSEIF "$(CFG)" == "libapr - Win32 Debug" @@ -78,8 +78,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF !ENDIF From 31d8a5520b41285d189071cedcc89ebb2c54071b Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 12 Apr 2001 04:40:21 +0000 Subject: [PATCH 1508/7878] Replace the libtool version check (once again) with something that actually works given the screwy way that they number beta versions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61498 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index c2538e9e8a4..74d1c92e095 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -23,7 +23,7 @@ fi # libtool 1.3.3 or newer libtool=`build/PrintPath glibtool libtool` lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'` -if test "$lt_pversion" = ""; then +if test -z "$lt_pversion"; then echo "buildconf: libtool not found." echo " You need libtool version 1.3 or newer installed" echo " to build Apache from CVS." @@ -31,14 +31,25 @@ exit 1 fi lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` IFS=.; set $lt_version; IFS=' ' -if test "$1" -gt "1" || test "$2" -gt "3" || test "$2" = "3" -a "$3" -ge "3" || test "$2" = "3" -a "$3" -ge "b" -then -echo "buildconf: libtool version $lt_pversion (ok)" -else +lt_status="good" +if test "$1" = "1"; then + if test "$2" -lt "3"; then + lt_status="bad" + else + if test "$2" = "3"; then + if test -z "$3" -o "$3" = "1" -o "$3" = "2"; then + lt_status="bad" + fi + fi + fi +fi +if test $lt_status = "good"; then + echo "buildconf: libtool version $lt_pversion (ok)" + exit 0 +fi + echo "buildconf: libtool version $lt_pversion found." echo " You need libtool version 1.3.3 or newer installed" echo " to build Apache from CVS." -exit 1 -fi -exit 0 +exit 1 From aa7baed7515713220d5fe5fec4905c0e8d886c98 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 12 Apr 2001 05:04:46 +0000 Subject: [PATCH 1509/7878] I don't think this routine is ever used, but the key needs to be allocated (just like the other platforms) to avoid a null reference. Submitted by: Christian Gross Reviewed by: Roy Fielding git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61499 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/threadpriv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 5163914c87e..06d5a4a9ee3 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -63,8 +63,15 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) { + (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); + if ((*key) == NULL) { + return APR_ENOMEM; + } + + (*key)->cntxt = cont; + if (((*key)->key = TlsAlloc()) != 0xFFFFFFFF) { - return APR_SUCCESS; + return APR_SUCCESS; } return apr_get_os_error(); } From a411a5bd415c1e09a48ed798d9d2e097352a4284 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 12 Apr 2001 07:05:49 +0000 Subject: [PATCH 1510/7878] Carefully select an appropriate native type for apr_int64_t and define its format as APR_INT64_T_FMT and literal using APR_INT64_C(). Submitted by: Justin Erenkrantz, William Rowe Reviewed by: Roy Fielding git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61500 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ acconfig.h | 2 ++ configure.in | 56 ++++++++++++++++++++++++++++++++++++---------- include/apr.h.in | 17 +++++++------- include/apr.hw | 2 -- include/apr_time.h | 2 ++ 6 files changed, 61 insertions(+), 22 deletions(-) diff --git a/CHANGES b/CHANGES index bf3f9d476de..4dca526890a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Carefully select an appropriate native type for apr_int64_t and + define its format as APR_INT64_T_FMT and literal using APR_INT64_C(). + [Justin Erenkrantz, William Rowe] + *) Make clean, distclean, and extraclean consistently according to the Gnu makefile guidelines. [Justin Erenkrantz ] diff --git a/acconfig.h b/acconfig.h index 4cc307b51b4..3b63b217fec 100644 --- a/acconfig.h +++ b/acconfig.h @@ -34,6 +34,8 @@ #undef SIZEOF_OFF_T #undef SIZEOF_PID_T +#undef HAVE_INT64_C + #undef HAVE_MM_SHMT_MMFILE /* BeOS specific flag */ diff --git a/configure.in b/configure.in index 23aafc8a1a6..d8322d4f62f 100644 --- a/configure.in +++ b/configure.in @@ -608,21 +608,49 @@ fi if test "$ac_cv_sizeof_int" = "4"; then int_value=int fi -if test "$ac_cv_sizeof_long" = "8"; then +dnl # Now we need to find what apr_int64_t (sizeof == 8) will be. +dnl # The first match is our preference. +if test "$ac_cv_sizeof_int" = "8"; then + int64_literal='#define APR_INT64_C(val) (val)' + int64_t_fmt='#define APR_INT64_T_FMT "d"' + int64_value="int" + long_value=int +elif test "$ac_cv_sizeof_long" = "8"; then + int64_literal='#define APR_INT64_C(val) (val##L)' + int64_t_fmt='#define APR_INT64_T_FMT "ld"' + int64_value="long" long_value=long -fi -if test "$ac_cv_sizeof_long_double" = "8"; then +elif test "$ac_cv_sizeof_long_long" = "8"; then + int64_literal='#define APR_INT64_C(val) (val##LL)' + dnl Linux, Solaris, FreeBSD all support ll with printf. + dnl BSD 4.4 originated 'q'. Solaris is more popular and + dnl doesn't support 'q'. Solaris wins. Exceptions can + dnl go to the OS-dependent section. + int64_t_fmt='#define APR_INT64_T_FMT "lld"' + int64_value="long long" + long_value="long long" +elif test "$ac_cv_sizeof_long_double" = "8"; then + int64_literal='#define APR_INT64_C(val) (val##LD)' + int64_t_fmt='#define APR_INT64_T_FMT "Ld"' + int64_value="long double" long_value="long double" -fi -if test "$ac_cv_sizeof_long_long" = "8"; then - if test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_long"; then - long_value="long" - else - long_value="long long" - fi -fi -if test "$ac_cv_sizeof_longlong" = "8"; then +elif test "$ac_cv_sizeof_longlong" = "8"; then + int64_literal='#define APR_INT64_C(val) (val##LL)' + int64_t_fmt='#define APR_INT64_T_FMT "qd"' + int64_value="__int64" long_value="__int64" +else + dnl # int64_literal may be overriden if your compiler thinks you have + dnl # a 64-bit value but APR does not agree. + int64_literal='#error Can not determine the proper size for apr_int64_t' + int64_t_fmt='#error Can not determine the proper size for apr_int64_t' +fi + +dnl # If present, allow the C99 macro INT64_C to override our conversion. +APR_CHECK_DEFINE(INT64_C, stdint.h) +if test "$ac_cv_define_INT64_C" = "yes"; then + int64_literal='#define APR_INT64_C(val) INT64_C(val)' + stdint=1 fi if test "$ac_cv_type_off_t" = "yes"; then @@ -716,14 +744,18 @@ esac AC_SUBST(short_value) AC_SUBST(int_value) AC_SUBST(long_value) +AC_SUBST(int64_value) AC_SUBST(off_t_value) AC_SUBST(size_t_value) AC_SUBST(ssize_t_value) AC_SUBST(socklen_t_value) +AC_SUBST(int64_t_fmt) AC_SUBST(ssize_t_fmt) AC_SUBST(size_t_fmt) AC_SUBST(off_t_fmt) AC_SUBST(os_proc_t_fmt) +AC_SUBST(int64_literal) +AC_SUBST(stdint) dnl #----------------------------- Checking for string functions AC_CHECK_FUNCS(strnicmp, have_strnicmp="1", have_strnicmp="0") diff --git a/include/apr.h.in b/include/apr.h.in index 544090ee983..936c55e9406 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -43,6 +43,7 @@ #define APR_HAVE_PTHREAD_H @pthreadh@ #define APR_HAVE_STDARG_H @stdargh@ #define APR_HAVE_STDIO_H @stdioh@ +#define APR_HAVE_STDINT_H @stdint@ #define APR_HAVE_STDLIB_H @stdlibh@ #define APR_HAVE_SIGNAL_H @signalh@ #define APR_HAVE_STRING_H @stringh@ @@ -107,6 +108,10 @@ #include #endif +#if APR_HAVE_STDINT_H +#include +#endif + /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY @sharedmem@ #define APR_HAS_THREADS @threads@ @@ -170,14 +175,7 @@ typedef @socklen_t_value@ apr_socklen_t; /* Mechanisms to properly type numeric literals */ - -/* XXX: this is wrong -- the LL is only required if int64 is implemented as - * a long long, it could be just a long on some platforms. the C99 - * correct way of doing this is to use INT64_C(1000000) which comes - * from stdint.h. we'd probably be doing a Good Thing to check for - * INT64_C in autoconf... or otherwise define an APR_INT64_C(). -dean - */ -#define APR_INT64_C(val) (val##LL) +@int64_literal@ /* Definitions that APR programs need to work properly. */ @@ -243,6 +241,9 @@ typedef @socklen_t_value@ apr_socklen_t; /* And APR_OS_PROC_T_FMT */ @os_proc_t_fmt@ +/* And APR_INT64_T_FMT */ +@int64_t_fmt@ + /* Local machine definition for console and log output. */ #define APR_EOL_STR "@eolstr@" diff --git a/include/apr.hw b/include/apr.hw index 3c1cc3194ac..9fa0043b7e0 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -294,8 +294,6 @@ typedef int gid_t; #define APR_INT64_T_FMT "I64d" -#define APR_TIME_T_FMT APR_INT64_T_FMT - /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" diff --git a/include/apr_time.h b/include/apr_time.h index 45ec564485c..575e306281b 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -78,6 +78,8 @@ typedef apr_int64_t apr_time_t; /* mechanism to properly type apr_time_t literals */ #define APR_TIME_C(val) APR_INT64_C(val) +/* mechanism to properly print apr_time_t values */ +#define APR_TIME_T_FMT APR_INT64_T_FMT /* intervals for I/O timeouts, in microseconds */ typedef apr_int64_t apr_interval_time_t; From cecbce2913661c286bbee0af7349052a557b3adb Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 12 Apr 2001 07:20:31 +0000 Subject: [PATCH 1511/7878] Eliminate usage of long long in favor of apr_uint64_t. Problem identified by Christian Gross. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61501 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_pools.c | 9 +++++---- memory/unix/apr_pools.c | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 8e47243db44..c29cc0438d4 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -206,8 +206,8 @@ static union block_hdr *global_block_list; #endif /* APR_POOL_DEBUG */ #ifdef ALLOC_STATS -static unsigned long long num_free_blocks_calls; -static unsigned long long num_blocks_freed; +static apr_uint64_t num_free_blocks_calls; +static apr_uint64_t num_blocks_freed; static unsigned max_blocks_in_one_free; static unsigned num_malloc_calls; static unsigned num_malloc_bytes; @@ -525,8 +525,9 @@ static void stack_var_init(char *s) static void dump_stats(void) { fprintf(stderr, - "alloc_stats: [%d] #free_blocks %llu #blocks %llu max " - "%u #malloc %u #bytes %u\n", + "alloc_stats: [%d] #free_blocks %" APR_INT64_T_FMT + " #blocks %" APR_INT64_T_FMT + " max %u #malloc %u #bytes %u\n", (int) getpid(), num_free_blocks_calls, num_blocks_freed, diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 8e47243db44..c29cc0438d4 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -206,8 +206,8 @@ static union block_hdr *global_block_list; #endif /* APR_POOL_DEBUG */ #ifdef ALLOC_STATS -static unsigned long long num_free_blocks_calls; -static unsigned long long num_blocks_freed; +static apr_uint64_t num_free_blocks_calls; +static apr_uint64_t num_blocks_freed; static unsigned max_blocks_in_one_free; static unsigned num_malloc_calls; static unsigned num_malloc_bytes; @@ -525,8 +525,9 @@ static void stack_var_init(char *s) static void dump_stats(void) { fprintf(stderr, - "alloc_stats: [%d] #free_blocks %llu #blocks %llu max " - "%u #malloc %u #bytes %u\n", + "alloc_stats: [%d] #free_blocks %" APR_INT64_T_FMT + " #blocks %" APR_INT64_T_FMT + " max %u #malloc %u #bytes %u\n", (int) getpid(), num_free_blocks_calls, num_blocks_freed, From b8d2c672a85bdecd82ceb678cb1a865630c6dad7 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 12 Apr 2001 13:05:38 +0000 Subject: [PATCH 1512/7878] If we don't have stdint.h then this stops the build from breaking as we don't then have anything in apr.h. Not sure the logic is what was intended, but as we only really need to include stdint.h for one macro, if we have the header but not the macro seems reasonable to drop the header. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61502 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index d8322d4f62f..3df854c8787 100644 --- a/configure.in +++ b/configure.in @@ -651,6 +651,8 @@ APR_CHECK_DEFINE(INT64_C, stdint.h) if test "$ac_cv_define_INT64_C" = "yes"; then int64_literal='#define APR_INT64_C(val) INT64_C(val)' stdint=1 +else + stdint=0 fi if test "$ac_cv_type_off_t" = "yes"; then From 2817ce4c964b570638c6c8e203a0c1436ba7a79a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Apr 2001 13:40:00 +0000 Subject: [PATCH 1513/7878] Uninitialized data error. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61503 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 0e1e900ed5a..eaaaa96cc4e 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -149,7 +149,8 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, */ #if APR_HAS_UNICODE_FS apr_oslevel_e os_level; - apr_wchar_t *eos, wdirname[APR_PATH_MAX]; + apr_wchar_t wdirname[APR_PATH_MAX]; + apr_wchar_t *eos = NULL; if (!apr_get_oslevel(thedir->cntxt, &os_level) && os_level >= APR_WIN_NT) { if (thedir->dirhand == INVALID_HANDLE_VALUE) @@ -224,6 +225,8 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, /* Almost all our work is done. Tack on the wide file name * to the end of the wdirname (already / delimited) */ + if (!eos) + eos = wcschr(wdirname, '\0'); wcscpy(eos, thedir->w.entry->cFileName); return more_finfo(finfo, wdirname, wanted, MORE_OF_WFSPEC, os_level); } From 92e33efc3fc8c4a1a5a96781f75f675a8cd5bb25 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Apr 2001 13:41:57 +0000 Subject: [PATCH 1514/7878] Still needs one more piece of work. While this ought to have worked, it doesn't for UNC paths, so we will need to case-fold using the OS's own case-folding [language insensitive unicode (NT) or local (9x)] rules. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61504 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 92 ++++++++++++++++++++++++++++++---------- 1 file changed, 69 insertions(+), 23 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 7efb5234212..efd4e79f167 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -184,6 +184,48 @@ static apr_status_t apr_filepath_drive_get(char **rootpath, } +static apr_status_t apr_filepath_root_case(char **rootpath, + char *root, + apr_pool_t *p) +{ +#if APR_HAS_UNICODE_FS + apr_oslevel_e os_level; + if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t *ignored; + apr_wchar_t wpath[APR_PATH_MAX]; + apr_status_t rv; + /* ???: This needs review, apparently "\\?\d:." returns "\\?\d:" + * as if that is useful for anything. + */ + { + apr_wchar_t wroot[APR_PATH_MAX]; + if (rv = utf8_to_unicode_path(wroot, sizeof(wroot) + / sizeof(apr_wchar_t), root)) + return rv; + if (!GetFullPathNameW(wroot, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored)) + return apr_get_os_error(); + } + { + char path[APR_PATH_MAX]; + if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) + return rv; + *rootpath = apr_pstrdup(p, path); + } + } + else +#endif + { + char path[APR_PATH_MAX]; + char *ignored; + if (!GetFullPathName(root, sizeof(path), path, &ignored)) + return apr_get_os_error(); + *rootpath = apr_pstrdup(p, path); + } + return APR_SUCCESS; +} + + APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath, apr_pool_t *p) { @@ -303,6 +345,9 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, */ newpath[delim2 - testpath] = '\\'; rv = apr_filepath_root_test(newpath, p); + if (rv) + return rv; + rv = apr_filepath_root_case(&newpath, newpath, p); if (rv) return rv; @@ -409,8 +454,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, apr_size_t pathlen; /* the length of the result path */ apr_size_t segend; /* the end of the current segment */ apr_size_t seglen; /* the length of the segment (excl trailing chars) */ - apr_status_t basetype; /* from parsing the basepath's baseroot */ - apr_status_t addtype; /* from parsing the addpath's addroot */ + apr_status_t basetype = 0; /* from parsing the basepath's baseroot */ + apr_status_t addtype; /* from parsing the addpath's addroot */ apr_status_t rv; int fixunc = 0; /* flag to complete an incomplete UNC basepath */ @@ -585,12 +630,11 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, if (basetype != APR_EABSOLUTE && (flags & APR_FILEPATH_NOTRELATIVE)) return basetype; rootlen = strlen(baseroot); - pathlen = baselen; - if (rootlen + pathlen >= sizeof(path)) + keptlen = pathlen = rootlen + baselen; + if (keptlen >= sizeof(path)) return APR_ENAMETOOLONG; memcpy(path, baseroot, rootlen); - memcpy(path + rootlen, basepath, pathlen); - pathlen += rootlen; + memcpy(path + rootlen, basepath, baselen); } else { if (flags & APR_FILEPATH_NOTRELATIVE) @@ -625,24 +669,26 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* Base the result path on the basepath */ rootlen = strlen(baseroot); - pathlen = baselen; - if (rootlen + pathlen >= sizeof(path)) + keptlen = pathlen = rootlen + baselen; + if (keptlen >= sizeof(path)) return APR_ENAMETOOLONG; memcpy(path, baseroot, rootlen); - memcpy(path + rootlen, basepath, pathlen); - pathlen += rootlen; + memcpy(path + rootlen, basepath, baselen); } /* '/' terminate the given root path unless it's already terminated - * or is an incomplete drive root. + * or is an incomplete drive root. Correct the trailing slash unless + * we have an incomplete UNC path still to fix. */ - if (pathlen && path[pathlen - 1] != '/' && path[pathlen - 1] != '\\' - && path[pathlen - 1] != ':') { - if (pathlen + 1 >= sizeof(path)) - return APR_ENAMETOOLONG; + if (pathlen && path[pathlen - 1] != ':') { + if (path[pathlen - 1] != '/' && path[pathlen - 1] != '\\') { + if (pathlen + 1 >= sizeof(path)) + return APR_ENAMETOOLONG; - path[pathlen++] = '/'; - + path[pathlen++] = ((flags & APR_FILEPATH_NATIVE) ? '\\' : '/'); + } + else if (!fixunc) + path[pathlen++] = ((flags & APR_FILEPATH_NATIVE) ? '\\' : '/'); } while (*addpath) @@ -723,7 +769,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, */ if (pathlen + 3 >= sizeof(path)) return APR_ENAMETOOLONG; - memcpy(path + pathlen, "../", 3); + memcpy(path + pathlen, ((flags && APR_FILEPATH_NATIVE) + ? "..\\" : "../"), 3); pathlen += 3; } else @@ -765,10 +812,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* Always add the trailing slash to a UNC segment */ - if (i) - path[pathlen + seglen] = addpath[segend]; - else - path[pathlen + seglen] = '\\'; + path[pathlen + seglen] = ((flags & APR_FILEPATH_NATIVE) + ? '\\' : '/'); pathlen += seglen + 1; /* Recanonicalize the UNC root with the new UNC segment, @@ -796,7 +841,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, return APR_ENAMETOOLONG; memcpy(path + pathlen, addpath, seglen + i); if (i) - path[pathlen + seglen] = addpath[segend]; + path[pathlen + seglen] = ((flags & APR_FILEPATH_NATIVE) + ? '\\' : '/'); pathlen += seglen + i; } } From fac05982db763c984e493039a7c616e04bc3721e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Apr 2001 13:43:53 +0000 Subject: [PATCH 1515/7878] More /w4 emit cleanups for uninit data errors git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61505 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 6 ++++-- file_io/win32/seek.c | 26 ++++++++++++++------------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 61dc7557138..b4097d222bd 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -52,8 +52,8 @@ * . */ -#include #include "apr_private.h" +#include #include "win32/fileio.h" #include "apr_file_io.h" #include "apr_general.h" @@ -92,7 +92,7 @@ static apr_fileperms_t convert_prot(ACCESS_MASK acc, prot_scope_e scope) * the given behavior. They are -not- recommended for any set protection * function, such a function should -set- use GENERIC_READ/WRITE/EXECUTE */ - apr_fileperms_t prot; + apr_fileperms_t prot = 0; if (acc & FILE_EXECUTE) prot |= APR_WEXECUTE; if (acc & FILE_WRITE_DATA) @@ -245,6 +245,8 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, apr_int32_t wante ((wanted & APR_FINFO_GROUP) ? &grp : NULL), ((wanted & APR_FINFO_PROT) ? &dacl : NULL), NULL, &pdesc); + else + return APR_INCOMPLETE; if (rv == ERROR_SUCCESS) apr_pool_cleanup_register(finfo->cntxt, pdesc, free_localheap, apr_pool_cleanup_null); diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index ffa309cc7a6..63daceaebf6 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -115,18 +115,20 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh return rc; } else { switch(where) { - case APR_SET: { - howmove = FILE_BEGIN; - break; - } - case APR_CUR: { - howmove = FILE_CURRENT; - break; - } - case APR_END: { - howmove = FILE_END; - break; - } + case APR_SET: + howmove = FILE_BEGIN; + break; + + case APR_CUR: + howmove = FILE_CURRENT; + break; + + case APR_END: + howmove = FILE_END; + break; + + default: + return APR_BADARG; } rv = SetFilePointer(thefile->filehand, *offset, NULL, howmove); From 4cfaab73a235ed4298631e4bc39230117dbbf40e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Apr 2001 13:45:36 +0000 Subject: [PATCH 1516/7878] Snap unicode into unsigned format for win32 internals git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61506 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/i18n.h | 2 +- include/arch/win32/fileio.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/arch/unix/i18n.h b/include/arch/unix/i18n.h index 9b32746490f..728ff23b1ff 100644 --- a/include/arch/unix/i18n.h +++ b/include/arch/unix/i18n.h @@ -60,7 +60,7 @@ /* If we ever support anything more exciting than char... this could move. */ -typedef apr_int16_t apr_wchar_t; +typedef apr_uint16_t apr_wchar_t; /** * An APR internal function for fast utf-8 octet-encoded Unicode conversion diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 507fb3c8d5a..fd10f56c9e0 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -89,7 +89,7 @@ #include "i18n.h" #include -typedef apr_int16_t apr_wchar_t; +typedef apr_uint16_t apr_wchar_t; apr_status_t utf8_to_unicode_path(apr_wchar_t* dststr, apr_size_t dstchars, const char* srcstr); From 39829a74c8c4dafba96bdf96600bd147d4e11e3f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Apr 2001 13:46:16 +0000 Subject: [PATCH 1517/7878] Point out a possible issue, and clean up the includes sequence. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61507 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/getuuid.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/misc/win32/getuuid.c b/misc/win32/getuuid.c index e833472ec98..1082b6dd181 100644 --- a/misc/win32/getuuid.c +++ b/misc/win32/getuuid.c @@ -57,16 +57,32 @@ * located at http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt */ -#include +#define _WINUSER_ #include "apr.h" #include "apr_uuid.h" +#ifdef NOUSER +#undef NOUSER +#endif +#undef _WINUSER_ +#include +#include + APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid) { GUID guid; - /* Note: this call doesn't actually require CoInitialize() first */ + /* Note: this call doesn't actually require CoInitialize() first + * + * XXX: This is wrong (two ways) ... one we need to test the HRESULT + * and if not S_OK (0) then we actually FAILED! + * + * Second, we should scramble the bytes or some such to eliminate the + * possible misuse/abuse since uuid is based on the NIC address, and + * is therefore not only a uniqifier, but an identity (which might not + * be appropriate in all cases. + */ (void) CoCreateGuid(&guid); memcpy(uuid->data, &guid, sizeof(uuid->data)); } From ac356d0a2e92cb8ef187cdc9b3b4b221f071684f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Apr 2001 13:47:02 +0000 Subject: [PATCH 1518/7878] Missing a default error case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61508 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 679c57f5273..74875894245 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -180,6 +180,8 @@ APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, winhow = SD_BOTH; break; } + default: + return APR_BADARG; } if (shutdown(thesocket->sock, winhow) == 0) { return APR_SUCCESS; From d459a4a5132ad4812a9424965eec482c57ba0d6a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Apr 2001 13:47:51 +0000 Subject: [PATCH 1519/7878] Clean up win32's own header bogosity git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61509 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_getpass.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index dc1a44d6034..8d012255e34 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -68,7 +68,9 @@ #include #endif #if APR_HAVE_CONIO_H +#pragma warning(disable: 4032) #include +#pragma warning(default: 4032) #endif #if APR_HAVE_STDLIB_H #include From 220da4c48bf82c16d01c1a9886b7c61028f3f5c2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Apr 2001 13:48:53 +0000 Subject: [PATCH 1520/7878] More /w4 emits git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61510 13f79535-47bb-0310-9956-ffa450edef68 --- user/win32/userinfo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index d3334ff9121..f07154e064d 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -92,6 +92,8 @@ APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, rv = LookupAccountName(domain, username, *uid, &sidlen, NULL, NULL, &sidtype); } + else + rv = 0; /* Quiet the compiler */ if (!sidlen || !rv) { return apr_get_os_error(); } From bd501ae45952ce626da256d0f21faae3c3f23b94 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Apr 2001 13:51:44 +0000 Subject: [PATCH 1521/7878] Include windows headers in apr.h (.hw) and include apr.h within apr_private.h for consistency. Also provide exceptions for many common errors when compiling /W4. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61511 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 12 +++++++++++ include/arch/win32/apr_private.h | 36 +++++--------------------------- 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 9fa0043b7e0..70e1c346690 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -97,6 +97,7 @@ * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now */ #define SW_HIDE 0 +#include #include #include #endif /* !_WINDOWS_ */ @@ -108,6 +109,17 @@ #include #include +/* disable or reduce the frequency of... + * C4057: indirection to slightly different base types + * C4075: slight indirection changes (unsigned short* vs short[]) + * C4100: unreferenced formal parameter + * C4127: conditional expression is constant + * C4201: nonstandard extension nameless struct/unions + * C4244: int to char/short - precision loss + * + */ +#pragma warning(disable: 4100 4127 4201; once: 4057 4075 4244) + #define APR_INLINE __inline #define APR_HAS_INLINE 1 #define __attribute__(__x) diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index d2cbc8ded56..8fc85510a39 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -63,45 +63,19 @@ #ifndef APR_PRIVATE_H #define APR_PRIVATE_H -/* Has windows.h already been included? If so, our preferences don't matter, - * but we will still need the winsock things no matter what was included. - * If not, include a restricted set of windows headers to our tastes. +/* Include the public APR symbols, include our idea of the 'right' + * subset of the Windows.h header. This saves us repetition. */ -#ifndef _WINDOWS_ -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#ifndef _WIN32_WINNT +#include "apr.h" -/* Restrict the server to a subset of Windows NT 4.0 header files by default - */ -#define _WIN32_WINNT 0x0400 -#endif -#ifndef NOUSER -#define NOUSER -#endif -#ifndef NOGDI -#define NOGDI -#endif -#ifndef NONLS -#define NONLS -#endif -#ifndef NOMCX -#define NOMCX -#endif -#ifndef NOIME -#define NOIME -#endif -#include /* * Add a _very_few_ declarations missing from the restricted set of headers * (If this list becomes extensive, re-enable the required headers above!) * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now */ +#ifndef SW_HIDE #define SW_HIDE 0 -#include -#include -#endif /* !_WINDOWS_ */ +#endif #include #include From 2031fab8c6abf53b1bdd7edaed3868f8fa38d9d3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Apr 2001 13:57:15 +0000 Subject: [PATCH 1522/7878] Add -w3 -w4 options to toggle all .dsp files to build with higher or lower order error checking. Don't commit back -w4 versions :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61512 13f79535-47bb-0310-9956-ffa450edef68 --- build/cvtdsp.pl | 81 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 8 deletions(-) diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl index 45bbb6fb190..0c0eb61b7d5 100644 --- a/build/cvtdsp.pl +++ b/build/cvtdsp.pl @@ -4,14 +4,19 @@ if ($ARGV[0] == '-6') { find(\&tovc6, '.'); } +elsif ($ARGV[0] == '-5') { + find(\&tovc5, '.'); +} +elsif ($ARGV[0] == '-w3') { + find(\&tow3, '.'); +} +elsif ($ARGV[0] == '-w4') { + find(\&tow4, '.'); +} else { - if ($ARGV[0] == '-5') { - find(\&tovc5, '.'); - } - else { - print "Specify -5 or -6 for Visual Studio 5 or 6 (98) .dsp format\n\n"; - die "Missing argument"; - } + print "Specify -5 or -6 for Visual Studio 5 or 6 (98) .dsp format\n"; + print "Specify -w3 or -w4 for .dsp build with warning level 3 or 4 (strict)\n\n"; + die "Missing argument"; } sub tovc5 { @@ -36,7 +41,6 @@ sub tovc5 { print $dstfl $src; } else { $verchg = -1; - } } undef $srcfl; @@ -92,3 +96,64 @@ sub tovc6 { } } } + +sub tow3 { + + if (m|.dsp$|) { + $oname = $_; + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $oname, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|^(# ADD CPP .*)/W4 (.*)|$1/W3 $2|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD BASE CPP .*)/W4 (.*)|$1/W3 $2|) { + $verchg = -1; + } + print $dstfl $src; + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted project " . $oname . " to warn:3 in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } + } +} + +sub tow4 { + + if (m|.dsp$|) { + $oname = $_; + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $oname, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|^(# ADD CPP .*)/W3 (.*)|$1/W4 $2|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD BASE CPP .*)/W3 (.*)|$1/W4 $2|) { + $verchg = -1; + } + print $dstfl $src; + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted project " . $oname . " to warn:4 " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } + } +} + From 37dfb363bf89a3d00f811f4ba16299a2655a934e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Apr 2001 15:30:46 +0000 Subject: [PATCH 1523/7878] Clean up some status notes, and add symbol rename references for everyone to kibitz before we close this book. Feel free to add missing symbols, these lists are from win32's exports lists of libapr.dll and libaprutil.dll. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61513 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 15 ++- renames_pending | 238 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 249 insertions(+), 4 deletions(-) create mode 100644 renames_pending diff --git a/STATUS b/STATUS index bef9e0b5afe..da00c65166f 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/03/22 10:17:35 $] +Last modified at [$Date: 2001/04/12 15:30:46 $] Release: @@ -16,11 +16,18 @@ Release: RELEASE SHOWSTOPPERS: * Unix apr_stat/lstat/getfileinfo were very fast hacks, needs review. - Will suggests: Unix is looking pretty good. Ignore APR_FINFO_NAME - issues for b1, I've noted that issue below. + Ignore APR_FINFO_NAME issues for b1, I've noted that issue below. + OtherBill asks has someone done so? * OS2 apr_stat/lstat/getfileinfo/dir_read were very fast hacks, need cleanup, toggle messy (APR_INCOMPLETE) result when appropriate. + OtherBill asks has someone done so? + + * complete the efforts started by DougM for cleaner fn naming + conventions: see proposed name changes in renames_pending + and offer up any additions/vetos/clarifications. + DougM offered to complete the work with his nifty perl rename + script at the hackathon. RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: @@ -30,7 +37,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Solve Win32 APR_CHR, APR_BLK, etc for Win32 apr_stat without GetFileType? How about inode/dev/nlink? - Status: Will's WIP + Status: OtherBill's WIP * SysV semaphore support isn't usable by Apache when started as root because we don't have a way to allow the semaphore to be diff --git a/renames_pending b/renames_pending new file mode 100644 index 00000000000..4e6fb42c66c --- /dev/null +++ b/renames_pending @@ -0,0 +1,238 @@ +Symbol renames pending for APR (keep complete and ordered, please!) +apr_accept +apr_array_append +apr_array_cat +apr_array_copy +apr_array_copy_hdr +apr_array_make +apr_array_pstrcat +apr_array_push +apr_bind +apr_collapse_spaces +apr_compare_groups +apr_compare_users +apr_connect +apr_cpystrn +apr_day_snames +apr_dir_close +apr_dir_make +apr_dir_open +apr_dir_read +apr_dir_remove +apr_dir_rewind +apr_dso_error +apr_dso_load +apr_dso_sym +apr_dso_unload +apr_file_close +apr_file_data_get +apr_file_data_set +apr_file_dup +apr_file_eof +apr_file_flush +apr_file_getc +apr_file_gets +apr_file_info_get +apr_file_lock +apr_file_lstat from apr_lstat +apr_file_name_get +apr_file_open +apr_file_open_stderr +apr_file_open_stdout +apr_file_perms_set +apr_file_pipe_create +apr_file_pipe_timeout_get +apr_file_pipe_timeout_set +apr_file_pool_get +apr_file_printf +apr_file_putc +apr_file_puts +apr_file_read +apr_file_read_full +apr_file_remove +apr_file_rename +apr_file_seek +apr_file_stat from apr_stat +apr_file_ungetc +apr_file_unlock +apr_file_write +apr_file_write_full +apr_file_writev +apr_filename_of_pathname +apr_filepath_get +apr_filepath_merge +apr_filepath_root +apr_filepath_set +apr_fnmatch +apr_generate_random_bytes +apr_groupname_get from apr_get_groupname +apr_homepath_get from apr_get_home_directory +apr_userid_get from apr_get_userid +apr_username_get from apr_get_username +apr_gethostname +apr_getnameinfo +apr_getopt +apr_getopt_init +apr_getopt_long +apr_getservbyname +apr_getsocketopt +apr_hash_count +apr_hash_first +apr_hash_get +apr_hash_make +apr_hash_next +apr_hash_set +apr_hash_this +apr_initialize +apr_ipsubnet_create +apr_ipsubnet_test +apr_fnmatch_found from apr_is_fnmatch +apr_listen +apr_lock_acquire +apr_lock_child_init +apr_lock_create +apr_lock_data_get +apr_lock_data_set +apr_lock_destroy +apr_lock_release +apr_md5_encode +apr_md5_final +apr_md5_init +apr_md5_update +apr_mmap_create +apr_mmap_delete +apr_mmap_offset +apr_month_snames +apr_os_dir_get +apr_os_dir_put +apr_os_file_get +apr_os_file_put +apr_os_lock_get +apr_os_lock_put +apr_os_sock_get +apr_os_sock_make +apr_os_sock_put +apr_os_thread_get +apr_os_thread_put +apr_os_threadkey_get +apr_os_threadkey_put +apr_palloc +apr_parse_addr_port +apr_password_get +apr_password_validate +apr_pcalloc +apr_pmemdup +apr_poll +apr_poll_data_get +apr_poll_data_set +apr_poll_revents_get +apr_poll_setup +apr_poll_socket_add +apr_poll_socket_clear +apr_poll_socket_mask +apr_poll_socket_remove +apr_pool_alloc_init +apr_pool_alloc_term +apr_pool_cleanup_for_exec +apr_pool_cleanup_kill +apr_pool_cleanup_null +apr_pool_cleanup_register +apr_pool_cleanup_run +apr_pool_clear +apr_pool_create +apr_pool_destroy +apr_pool_free_blocks_num_bytes +apr_pool_note_subprocess +apr_pool_num_bytes +apr_pool_sub_make +apr_pool_userdata_get +apr_pool_userdata_set +apr_proc_create +apr_proc_kill +apr_proc_wait +apr_procattr_child_err_set +apr_procattr_child_in_set +apr_procattr_child_out_set +apr_procattr_cmdtype_set +apr_procattr_create +apr_procattr_detach_set +apr_procattr_dir_set +apr_procattr_io_set +apr_psprintf +apr_pstrcat +apr_pstrdup +apr_pstrndup +apr_pvsprintf +apr_recv +apr_recvfrom +apr_rfc822_date +apr_send +apr_sendfile +apr_sendto +apr_sendv +apr_set_abort +apr_setsocketopt +apr_shutdown +apr_sleep +apr_snprintf +apr_sockaddr_info_get +apr_sockaddr_ip_get +apr_sockaddr_ip_set +apr_sockaddr_port_get +apr_sockaddr_port_set +apr_socket_addr_get +apr_socket_close +apr_socket_create +apr_socket_data_get +apr_socket_data_set +apr_strerror +apr_strftime +apr_strnatcasecmp +apr_strnatcmp +apr_table_add +apr_table_addn +apr_table_clear +apr_table_copy +apr_table_do +apr_table_get +apr_table_make +apr_table_merge +apr_table_mergen +apr_table_overlap +apr_table_overlay +apr_table_set +apr_table_setn +apr_table_unset +apr_table_vdo +apr_terminate +apr_thread_create +apr_thread_data_get +apr_thread_data_set +apr_thread_detach +apr_thread_exit +apr_thread_join +apr_threadattr_create +apr_threadattr_detach_get +apr_threadattr_detach_set +apr_threadkey_data_get +apr_threadkey_data_set +apr_threadkey_private_create +apr_threadkey_private_delete +apr_threadkey_private_get +apr_threadkey_private_set +apr_time_ctime_fmt from apr_ctime +apr_time_os_explode_get from apr_os_exp_time_get +apr_time_os_explode_put from apr_os_exp_time_put +apr_time_os_get from apr_os_imp_time_get +apr_time_os_get from apr_os_imp_time_put +apr_time_ansi_put from apr_ansi_time_to_apr_time +apr_time_gmt_explode from apr_explode_gmt +apr_time_implode from apr_implode_time +apr_time_lt_explode from apr_explode_localtime +apr_time_now +apr_tokenize_to_argv +apr_uuid_format +apr_uuid_get +apr_uuid_parse +apr_vformatter +apr_vsnprintf From 87bf1b16442e1e25893e1bbbbe4011eddf0ea7d3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Apr 2001 15:38:21 +0000 Subject: [PATCH 1524/7878] propose apr_user_ family for user info, and re-sort the goofs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61514 13f79535-47bb-0310-9956-ffa450edef68 --- renames_pending | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/renames_pending b/renames_pending index 4e6fb42c66c..d6c7ac025a6 100644 --- a/renames_pending +++ b/renames_pending @@ -64,11 +64,8 @@ apr_filepath_merge apr_filepath_root apr_filepath_set apr_fnmatch +apr_fnmatch_found from apr_is_fnmatch apr_generate_random_bytes -apr_groupname_get from apr_get_groupname -apr_homepath_get from apr_get_home_directory -apr_userid_get from apr_get_userid -apr_username_get from apr_get_username apr_gethostname apr_getnameinfo apr_getopt @@ -76,6 +73,7 @@ apr_getopt_init apr_getopt_long apr_getservbyname apr_getsocketopt +apr_groupname_get from apr_get_groupname apr_hash_count apr_hash_first apr_hash_get @@ -86,7 +84,6 @@ apr_hash_this apr_initialize apr_ipsubnet_create apr_ipsubnet_test -apr_fnmatch_found from apr_is_fnmatch apr_listen apr_lock_acquire apr_lock_child_init @@ -231,6 +228,9 @@ apr_time_implode from apr_implode_time apr_time_lt_explode from apr_explode_localtime apr_time_now apr_tokenize_to_argv +apr_user_path_get from apr_get_home_directory +apr_user_id_get from apr_get_userid +apr_user_name_get from apr_get_username apr_uuid_format apr_uuid_get apr_uuid_parse From ccf98be64c65b06b64f8348671487f55ad5e0dd1 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 12 Apr 2001 16:50:50 +0000 Subject: [PATCH 1525/7878] Some adjustments to the time code that gets us working better with timezones. Also change the beos sleep to use snooze instead of select. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61515 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 13 +++++ time/unix/time.c | 121 +++++++++++++++++++------------------------- time/unix/timestr.c | 2 +- 3 files changed, 67 insertions(+), 69 deletions(-) diff --git a/include/apr_time.h b/include/apr_time.h index 575e306281b..328a1bf29b5 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -134,6 +134,19 @@ struct apr_exploded_time_t { APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, time_t input); +/** + * convert a time to its human readable components using an offset + * from GMT + * @param result the exploded time + * @param input the time to explode + * @param offs the number of seconds offset to apply + * @param zone the zone description + * @deffunc apr_status_t apr_explode_time(apr_exploded_time_t *result, apr_time_t input, apr_int32_t offs) + */ +APR_DECLARE(apr_status_t) apr_explode_time(apr_exploded_time_t *result, + apr_time_t input, + apr_int32_t offs); + /** * convert a time to its human readable components in GMT timezone * @param result the exploded time diff --git a/time/unix/time.c b/time/unix/time.c index 6427f29f4c0..dbf950364bd 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -56,6 +56,7 @@ #include "apr_time.h" #include "apr_lib.h" #include "apr_private.h" +#include "apr_strings.h" /* System Headers required for time library */ #if APR_HAVE_SYS_TIME_H #include @@ -66,9 +67,6 @@ #ifdef HAVE_TIME_H #include #endif -#ifdef BEOS -#include /* for select */ -#endif /* End System Headers */ @@ -86,8 +84,28 @@ apr_time_t apr_time_now(void) return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec; } +static void set_xt_gmtoff_from_tm(apr_exploded_time_t *xt, struct tm *tm, + time_t *tt) +{ +#ifdef HAVE_GMTOFF + xt->tm_gmtoff = tm->tm_gmtoff; +#elif defined(HAVE___OFFSET) + xt->tm_gmtoff = tm->__tm_gmtoff; +#else + { + struct tm t; + int days = 0, hours = 0, minutes = 0; + gmtime_r(tt, &t); + days = xt->tm_yday - t.tm_yday; + hours = ((days < -1 ? 24 : 1 < days ? -24 : days * 24) + + xt->tm_hour - t.tm_hour); + minutes = hours * 60 + xt->tm_min - t.tm_min; + xt->tm_gmtoff = minutes * 60; + } +#endif +} -static void tm_to_exp(apr_exploded_time_t *xt, struct tm *tm) +static void tm_to_exp(apr_exploded_time_t *xt, struct tm *tm, time_t *tt) { xt->tm_sec = tm->tm_sec; xt->tm_min = tm->tm_min; @@ -98,82 +116,48 @@ static void tm_to_exp(apr_exploded_time_t *xt, struct tm *tm) xt->tm_wday = tm->tm_wday; xt->tm_yday = tm->tm_yday; xt->tm_isdst = tm->tm_isdst; + set_xt_gmtoff_from_tm(xt,tm,tt); } - -apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input) +apr_status_t apr_explode_time(apr_exploded_time_t *result, apr_time_t input, + apr_int32_t offs) { - time_t t = input / APR_USEC_PER_SEC; -#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) - struct tm banana; -#endif - + time_t t = (input / APR_USEC_PER_SEC) + offs; result->tm_usec = input % APR_USEC_PER_SEC; -#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) - gmtime_r(&t, &banana); - tm_to_exp(result, &banana); +#if APR_HAS_THREADS && defined (_POSIX_THREAD_SAFE_FUNCTIONS) + { + struct tm apple; + gmtime_r(&t, &apple); + tm_to_exp(result, &apple, &t); + } #else - tm_to_exp(result, gmtime(&t)); + tm_to_exp(result, gmtime(&t), &t); #endif - result->tm_gmtoff = 0; + result->tm_gmtoff = offs; return APR_SUCCESS; } -apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) +apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input) { -#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) - time_t t = input / APR_USEC_PER_SEC; - struct tm apricot; - - result->tm_usec = input % APR_USEC_PER_SEC; - - localtime_r(&t, &apricot); - tm_to_exp(result, &apricot); -#if defined(HAVE_GMTOFF) - result->tm_gmtoff = apricot.tm_gmtoff; -#elif defined(HAVE___GMTOFF) - result->tm_gmtoff = apricot.__tm_gmtoff; -#else - /* solaris is backwards enough to have pthreads but no tm_gmtoff, feh */ - { - int days, hours, minutes; - - gmtime_r(&t, &apricot); - days = result->tm_yday - apricot.tm_yday; - hours = ((days < -1 ? 24 : 1 < days ? -24 : days * 24) - + result->tm_hour - apricot.tm_hour); - minutes = hours * 60 + result->tm_min - apricot.tm_min; - result->tm_gmtoff = minutes * 60; - } -#endif -#else - time_t t = input / APR_USEC_PER_SEC; - struct tm *tmx; + return apr_explode_time(result, input, 0); +} - result->tm_usec = input % APR_USEC_PER_SEC; +apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) +{ + time_t mango = input / APR_USEC_PER_SEC; + apr_int32_t offs; - tmx = localtime(&t); - tm_to_exp(result, tmx); -#if defined(HAVE_GMTOFF) - result->tm_gmtoff = tmx->tm_gmtoff; -#elif defined(HAVE___GMTOFF) - result->tm_gmtoff = tmx->__tm_gmtoff; +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) + struct tm mangotm; + localtime_r(&mangotm, &mango); + offs = mangotm.tm_gmtoff; #else - /* need to create tm_gmtoff... assume we are never more than 24 hours away */ - { - int days, hours, minutes; - - tmx = gmtime(&t); - days = result->tm_yday - tmx->tm_yday; - hours = ((days < -1 ? 24 : 1 < days ? -24 : days * 24) - + result->tm_hour - tmx->tm_hour); - minutes = hours * 60 + result->tm_min - tmx->tm_min; - result->tm_gmtoff = minutes * 60; - } + struct tm *mangotm; + mangotm=localtime(&mango); + offs = mangotm->tm_gmtoff; #endif -#endif - return APR_SUCCESS; + return apr_explode_time(result, input, offs); } @@ -185,7 +169,6 @@ apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; year = xt->tm_year; - if (year < 70 || ((sizeof(time_t) <= 4) && (year >= 138))) { return APR_EBADDATE; } @@ -200,13 +183,11 @@ apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) days = year * 365 + year / 4 - year / 100 + (year / 100 + 3) / 4; days += dayoffset[xt->tm_mon] + xt->tm_mday - 1; days -= 25508; /* 1 jan 1970 is 25508 days since 1 mar 1900 */ - days = ((days * 24 + xt->tm_hour) * 60 + xt->tm_min) * 60 + xt->tm_sec; if (days < 0) { return APR_EBADDATE; } - days -= xt->tm_gmtoff; *t = days * APR_USEC_PER_SEC + xt->tm_usec; return APR_SUCCESS; } @@ -230,6 +211,7 @@ apr_status_t apr_os_exp_time_get(apr_os_exp_time_t **ostime, (*ostime)->tm_wday = aprtime->tm_wday; (*ostime)->tm_yday = aprtime->tm_yday; (*ostime)->tm_isdst = aprtime->tm_isdst; + /* XXX - Need to handle gmt_offset's here ! */ return APR_SUCCESS; } @@ -252,6 +234,7 @@ apr_status_t apr_os_exp_time_put(apr_exploded_time_t *aprtime, aprtime->tm_wday = (*ostime)->tm_wday; aprtime->tm_yday = (*ostime)->tm_yday; aprtime->tm_isdst = (*ostime)->tm_isdst; + /* XXX - Need to handle gmt_offsets here */ return APR_SUCCESS; } @@ -259,6 +242,8 @@ void apr_sleep(apr_interval_time_t t) { #ifdef OS2 DosSleep(t/1000); +#elseif defined(BEOS) + snooze(t); #else struct timeval tv; tv.tv_usec = t % APR_USEC_PER_SEC; diff --git a/time/unix/timestr.c b/time/unix/timestr.c index dcf928a6207..d9ab7bd0369 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -171,7 +171,6 @@ apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, apr_exploded_time_t *xt) { struct tm tm; - memset(&tm, 0, sizeof tm); tm.tm_sec = xt->tm_sec; tm.tm_min = xt->tm_min; @@ -182,6 +181,7 @@ apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, tm.tm_wday = xt->tm_wday; tm.tm_yday = xt->tm_yday; tm.tm_isdst = xt->tm_isdst; + tm.tm_gmtoff = xt->tm_gmtoff; (*retsize) = strftime(s, max, format, &tm); return APR_SUCCESS; } From ad91b12fbb9f6341f8a6035ecd54fe43b97a0ade Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 12 Apr 2001 16:53:11 +0000 Subject: [PATCH 1526/7878] I actually remembered to add an entry to the CHANGES file and here is a modified time test that exercises more of the time functions and some simple timezone tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61516 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ test/testtime.c | 74 +++++++++++++++++++++++++++---------------------- 2 files changed, 44 insertions(+), 33 deletions(-) diff --git a/CHANGES b/CHANGES index 4dca526890a..8024a2df851 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Amend the time code to better deal with time zones. + [David Reid] + *) Carefully select an appropriate native type for apr_int64_t and define its format as APR_INT64_T_FMT and literal using APR_INT64_C(). [Justin Erenkrantz, William Rowe] diff --git a/test/testtime.c b/test/testtime.c index 10e313bc258..65812270e4b 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -67,12 +67,12 @@ int main(void) { apr_time_t now; - apr_exploded_time_t xt; + apr_exploded_time_t xt, xt2; apr_time_t imp; apr_pool_t *p; char *str, *str2; apr_size_t sz; - apr_interval_time_t hr_off = 5 * 3600; /* 5 hours in seconds */ + apr_interval_time_t hr_off = -5 * 3600; /* 5 hours in seconds */ fprintf(stdout, "Testing Time functions.\n"); @@ -81,42 +81,47 @@ int main(void) exit (-1); } - fprintf(stdout, "\tapr_time_now.............................."); + printf("\tapr_time_now...................................."); now = apr_time_now(); - fprintf(stdout, "OK\n"); + printf("OK\n"); - fprintf(stdout, "\tapr_explode_localtime....................."); - if (apr_explode_localtime(&xt, now) != APR_SUCCESS) { - fprintf(stderr, "Couldn't explode the time\n"); + printf("\tapr_explode_gmt................................."); + if (apr_explode_gmt(&xt, now) != APR_SUCCESS) { + printf("Couldn't explode the time\n"); exit(-1); } - fprintf(stdout, "OK\n"); + printf("OK\n"); - fprintf(stdout, "\tapr_explode_gmt..........................."); - if (apr_explode_gmt(&xt, now) != APR_SUCCESS) { - fprintf(stderr, "Couldn't explode the time\n"); + printf("\tapr_explode_localtime..........................."); + if (apr_explode_localtime(&xt2, now) != APR_SUCCESS) { + printf("Couldn't explode the time\n"); exit(-1); } - fprintf(stdout, "OK\n"); + printf("OK\n"); - fprintf(stdout, "\tapr_implode_time.........................."); + printf("\tapr_implode_time................................"); if (apr_implode_time(&imp, &xt) != APR_SUCCESS) { - fprintf(stderr, "Couldn't implode the time\n"); + printf("Couldn't implode the time\n"); exit(-1); } - if (imp != now) { - fprintf(stderr, "implode/explode mismatch\n" - "apr_explode of apr_now() %lld\n" - "apr_implode() returned %15I64d\n" - "error delta was %15I64d\n", + printf("OK\n"); + + printf("\tchecking the explode/implode (GMT).............."); + if (imp != now) { + printf("mismatch\n" + "\tapr_now() %lld\n" + "\tapr_implode() returned %lld\n" + "\terror delta was %lld\n", now, imp, imp-now); exit(-1); } - fprintf(stdout, "OK\n"); + printf("OK\n"); + str = apr_pcalloc(p, sizeof(char) * STR_SIZE); str2 = apr_pcalloc(p, sizeof(char) * STR_SIZE); + imp = 0; - printf("\tapr_rfc822_date.(GMT)..........."); + printf("\tapr_rfc822_date................."); if (apr_rfc822_date(str, now) != APR_SUCCESS){ printf("Failed!\n"); exit (-1); @@ -142,35 +147,38 @@ int main(void) } printf("%s\n", str); - printf("\tCurrent time (GMT)......................."); - if (apr_strftime(str, &sz, STR_SIZE, "%T %Z", &xt) != APR_SUCCESS){ + printf("\tCurrent time (GMT).............................."); + if (apr_strftime(str, &sz, STR_SIZE, "%T ", &xt) != APR_SUCCESS){ printf("Failed!\n"); exit (-1); } printf ("%s\n", str); - xt.tm_gmtoff = hr_off; /* 5 hour offset */ - printf("\tOffset Time Zone -5 hours................."); - if (apr_strftime(str2, &sz, STR_SIZE, "%T %Z", &xt) != APR_SUCCESS){ + printf("\tTrying to explode time with 5 hour offset......."); + if (apr_explode_time(&xt2, now, hr_off) != APR_SUCCESS){ + printf("Failed.\n"); + exit(-1); + } + printf("OK\n"); + + printf("\tOffset Time Zone -5 hours......................."); + if (apr_strftime(str2, &sz, STR_SIZE, "%T (%z)", &xt2) != APR_SUCCESS){ printf("Failed!\n"); exit(-1); } printf("%s\n", str2); - /* We just check and report, but this isn't a hanging offense - as it currently doesn't work - */ - printf("\tComparing the created times..............."); + printf("\tComparing the created times....................."); if (! strcmp(str,str2)){ printf("Failed\n"); } else { printf("OK\n"); } - printf("\tChecking imploded time after offset......."); - apr_implode_time(&imp, &xt); + printf("\tChecking imploded time after offset............."); + apr_implode_time(&imp, &xt2); hr_off *= APR_USEC_PER_SEC; /* microseconds */ - if (imp != now - hr_off){ + if (imp != now + hr_off){ printf("Failed! :(\n"); printf("Difference is %lld (should be %lld)\n", imp - now, hr_off); exit(-1); From 211189b2efa5390664aec788ffe9efc61ccd2641 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 12 Apr 2001 16:54:50 +0000 Subject: [PATCH 1527/7878] This small change stops a build breakage. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61517 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index e42d7811e4c..11d82aa6dc2 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -317,7 +317,7 @@ static void *signal_thread_func(void *signal_handler) #elif HAVE_SIGSUSPEND sigsuspend(&sig_mask); #else -#error No apr_sigwait() and no sigsuspend(); I am stuck. +#error No apr_sigwait() and no sigsuspend() #endif } } From 4230521181d790f6efdfad23c1f28f7f09c06af6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 12 Apr 2001 18:46:32 +0000 Subject: [PATCH 1528/7878] Convert the apr_create_signal_thread to apr_signal_thread. The main difference, is that instead of creating a separate thread to listen for signals, the thread that calls this function does the listening. Many platforms have issues when the main thread isn't the thread that is listening for signals. Even more platforms complain when the main thread dies, but the process doesn't. This gets the main thread back to being the signal handling thread. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61518 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 12 +++--------- threadproc/unix/signals.c | 12 ++---------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index b86c14aa1aa..fc9f60e9b65 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -598,19 +598,13 @@ APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, APR_DECLARE(apr_status_t) apr_setup_signal_thread(void); /** - * Create a thread that will listen for signals. The thread will loop + * Make the current thread listen for signals. This thread will loop * forever, calling a provided function whenever it receives a signal. That * functions should return 1 if the signal has been handled, 0 otherwise. - * @param td The newly created thread - * @param tattr The threadattr to use when creating the thread * @param signal_handler The function to call when a signal is received - * @param p The pool to use when creating the thread - * @deffunc apr_status_t apr_create_signal_thread(apr_thread_t **td, apr_threadattr_t *tattr, int (*signal_handler)(int signum), apr_pool_t *p) + * apr_status_t apr_signal_thread((int)(*signal_handler)(int signum)) */ -APR_DECLARE(apr_status_t) apr_create_signal_thread(apr_thread_t **td, - apr_threadattr_t *tattr, - int (*signal_handler)(int signum), - apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)); #endif /* APR_HAS_THREADS */ #ifdef __cplusplus diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 11d82aa6dc2..41d454307b7 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -268,7 +268,7 @@ const char *apr_signal_get_description(int signum) #endif /* SYS_SIGLIST_DECLARED */ #if APR_HAS_THREADS && (HAVE_SIGSUSPEND || APR_HAVE_SIGWAIT) && !defined(OS2) -static void *signal_thread_func(void *signal_handler) +APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)) { sigset_t sig_mask; int (*sig_func)(int signum) = (int (*)(int))signal_handler; @@ -312,7 +312,7 @@ static void *signal_thread_func(void *signal_handler) } if (sig_func(signal_received) == 1) { - return NULL; + return APR_SUCCESS; } #elif HAVE_SIGSUSPEND sigsuspend(&sig_mask); @@ -342,12 +342,4 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) return rv; } -APR_DECLARE(apr_status_t) apr_create_signal_thread(apr_thread_t **td, - apr_threadattr_t *tattr, - int (*signal_handler)(int signum), - apr_pool_t *p) -{ - return apr_thread_create(td, tattr, signal_thread_func, (void *)signal_handler, p); -} - #endif From ee50336496ac2c5d3dc6dd737f52ececae98c70e Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 12 Apr 2001 22:44:42 +0000 Subject: [PATCH 1529/7878] Daniel Padwa pointed out the last patch broke the build on Solaris, so this patch is an attempt to get it building again. The eventual solution will be more general access functions for getting/setting the timezone from the different structures. I've made a partial start at it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61519 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 8 ++++++-- time/unix/timestr.c | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/time/unix/time.c b/time/unix/time.c index dbf950364bd..31f056106e5 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -151,8 +151,13 @@ apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) struct tm mangotm; localtime_r(&mangotm, &mango); +/* XXX - Add support for Solaris */ +#ifdef HAVE_GMTOFF offs = mangotm.tm_gmtoff; -#else +#elif defined(HAVE___OFFSET) + offs = mangotm.__tm_gmtoff; +#endif +#else /* !APR_HAS_THREADS */ struct tm *mangotm; mangotm=localtime(&mango); offs = mangotm->tm_gmtoff; @@ -160,7 +165,6 @@ apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input return apr_explode_time(result, input, offs); } - apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) { int year; diff --git a/time/unix/timestr.c b/time/unix/timestr.c index d9ab7bd0369..c41d876b1a8 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -181,7 +181,11 @@ apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, tm.tm_wday = xt->tm_wday; tm.tm_yday = xt->tm_yday; tm.tm_isdst = xt->tm_isdst; +#if defined(HAVE_GMTOFF) tm.tm_gmtoff = xt->tm_gmtoff; +#elif defined(HAVE___OFFSET) + tm.__tm_gmtoff = xt->tm_gmtoff; +#endif (*retsize) = strftime(s, max, format, &tm); return APR_SUCCESS; } From ea93e22f53073103f4e2c6fb6710f0691010cfd1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 13 Apr 2001 03:18:52 +0000 Subject: [PATCH 1530/7878] Fix compiler break on VC6 Reported by Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61520 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 1 - 1 file changed, 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index 70e1c346690..15cdc054dcc 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -97,7 +97,6 @@ * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now */ #define SW_HIDE 0 -#include #include #include #endif /* !_WINDOWS_ */ From 0958d116341b82d027beefb06fe02a94bc830303 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 13 Apr 2001 15:31:31 +0000 Subject: [PATCH 1531/7878] Further problems to resolve for Win32 in VC98; reported by Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61521 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 3 ++- misc/win32/getuuid.c | 11 ++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index b4097d222bd..475ef97d1ff 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -52,8 +52,9 @@ * . */ -#include "apr_private.h" +#include #include +#include "apr_private.h" #include "win32/fileio.h" #include "apr_file_io.h" #include "apr_general.h" diff --git a/misc/win32/getuuid.c b/misc/win32/getuuid.c index 1082b6dd181..f6fb999dfe9 100644 --- a/misc/win32/getuuid.c +++ b/misc/win32/getuuid.c @@ -57,18 +57,11 @@ * located at http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt */ -#define _WINUSER_ - +#include +#include #include "apr.h" #include "apr_uuid.h" -#ifdef NOUSER -#undef NOUSER -#endif -#undef _WINUSER_ -#include -#include - APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid) { GUID guid; From 84a64a0fdd38a8ffb0893b3167f91972140a72c0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 14 Apr 2001 22:02:04 +0000 Subject: [PATCH 1532/7878] Fix detection of tm_gmtoff in struct tm, and remove some warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61522 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- time/unix/time.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 3df854c8787..c1480ce5284 100644 --- a/configure.in +++ b/configure.in @@ -967,7 +967,7 @@ dnl #----------------------------- Checking for Time Support echo $ac_n "${nl}Checking for Time Support...${nl}" AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, [AC_TRY_COMPILE([#include -#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;], +#include ], [struct tm tm; tm.tm_gmtoff;], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) if test "$ac_cv_struct_tm_gmtoff" = "yes"; then diff --git a/time/unix/time.c b/time/unix/time.c index 31f056106e5..c399f56d369 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -146,11 +146,11 @@ apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input) apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) { time_t mango = input / APR_USEC_PER_SEC; - apr_int32_t offs; + apr_int32_t offs = 0; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) struct tm mangotm; - localtime_r(&mangotm, &mango); + localtime_r(&mango, &mangotm); /* XXX - Add support for Solaris */ #ifdef HAVE_GMTOFF offs = mangotm.tm_gmtoff; From 80fec2f5b027cf32d62ebad93be8417dce9aa245 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 17 Apr 2001 02:03:09 +0000 Subject: [PATCH 1533/7878] Fix make depend in APR. mkdep.sh wasn't getting passed any include paths. Not sure when/how this got broken..... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61523 13f79535-47bb-0310-9956-ffa450edef68 --- build/rules.mk.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/rules.mk.in b/build/rules.mk.in index 0b672aa26fa..67fdc6c8237 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -143,8 +143,8 @@ local-all: $(TARGETS) local-depend: @if test -n "`ls *.c 2> /dev/null`"; then \ - echo $(MKDEP) $(CFLAGS) $(CPPFLAGS) *.c ; \ - $(MKDEP) $(CFLAGS) $(CPPFLAGS) *.c ; \ + echo $(MKDEP) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) *.c ; \ + $(MKDEP) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) *.c ; \ fi # to be filled in by the actual Makefile From 59e6a1346d77c996dab65b4d1a5ce1db8e87e66a Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 17 Apr 2001 02:20:19 +0000 Subject: [PATCH 1534/7878] Fix OS/2 build where we have no gmtime_r (or an *_r's for that matter) or tm_gmtoff. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61524 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/time/unix/time.c b/time/unix/time.c index c399f56d369..32930db8e71 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -95,7 +95,11 @@ static void set_xt_gmtoff_from_tm(apr_exploded_time_t *xt, struct tm *tm, { struct tm t; int days = 0, hours = 0, minutes = 0; +#ifdef HAVE_GMTIME_R gmtime_r(tt, &t); +#else + t = *gmtime(tt); +#endif days = xt->tm_yday - t.tm_yday; hours = ((days < -1 ? 24 : 1 < days ? -24 : days * 24) + xt->tm_hour - t.tm_hour); @@ -145,6 +149,10 @@ apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input) apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) { +#if defined(__EMX__) + /* EMX gcc (OS/2) has a timezone global we can use */ + return apr_explode_time(result, input, -timezone); +#else time_t mango = input / APR_USEC_PER_SEC; apr_int32_t offs = 0; @@ -163,6 +171,7 @@ apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input offs = mangotm->tm_gmtoff; #endif return apr_explode_time(result, input, offs); +#endif /* __EMX__ */ } apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) @@ -246,7 +255,7 @@ void apr_sleep(apr_interval_time_t t) { #ifdef OS2 DosSleep(t/1000); -#elseif defined(BEOS) +#elif defined(BEOS) snooze(t); #else struct timeval tv; From ed16ec2ac52e8b46bcc92c63f268053e04e43fc4 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Tue, 17 Apr 2001 10:49:02 +0000 Subject: [PATCH 1535/7878] * shift some debug symbols to apr_pools.c since they are entirely internal * add a bunch of comments to apr_pools.c * in apr_pool_destroy(), clear out a->first to catch a double destroy git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61526 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 3 --- lib/apr_pools.c | 47 ++++++++++++++++++++++++++++++++++++----- memory/unix/apr_pools.c | 47 ++++++++++++++++++++++++++++++++++++----- 3 files changed, 84 insertions(+), 13 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 5cf5c5d3b41..9419c0e9028 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -88,11 +88,8 @@ extern "C" { */ /* -#define ALLOC_DEBUG #define APR_POOL_DEBUG #define ALLOC_USE_MALLOC -#define MAKE_TABLE_PROFILE -#define ALLOC_STATS */ /** The fundamental pool type */ diff --git a/lib/apr_pools.c b/lib/apr_pools.c index c29cc0438d4..91820f8526f 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -107,6 +107,10 @@ /* Details of the debugging options can now be found in the developer * section of the documentaion. */ +/* +#define ALLOC_DEBUG +#define ALLOC_STATS +*/ /* magic numbers --- min free bytes to consider a free apr_pool_t block useable, * and the min amount to allocate if we have to go to malloc() */ @@ -721,22 +725,37 @@ APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp) */ APR_DECLARE(void) apr_pool_clear(apr_pool_t *a) { + /* free the subpools. we can just loop -- the subpools will detach + themselve from us, so this is easy. */ while (a->sub_pools) { apr_pool_destroy(a->sub_pools); } - /* - * Don't hold the mutex during cleanups. - */ + + /* run cleanups and free any subprocesses. */ run_cleanups(a->cleanups); a->cleanups = NULL; free_proc_chain(a->subprocesses); a->subprocesses = NULL; + + /* free the pool's blocks, *except* for the first one. the actual pool + structure is contained in the first block. this also gives us some + ready memory for reallocating within this pool. */ free_blocks(a->first->h.next); a->first->h.next = NULL; + /* this was allocated in self, or a subpool of self. it simply + disappears, so forget the hash table. */ a->prog_data = NULL; + /* no other blocks, so the last block is the first. */ a->last = a->first; + + /* "free_first_avail" is the original first_avail when the pool was + constructed. (kind of a misnomer, but it means "when freeing, use + this as the first available ptr) + + restore the first/only block avail pointer, effectively resetting + the block to empty (except for the pool structure). */ a->first->h.first_avail = a->free_first_avail; debug_fill(a->first->h.first_avail, a->first->h.endp - a->first->h.first_avail); @@ -756,13 +775,18 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *a) APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) { + union block_hdr *blok; + + /* toss everything in the pool. */ apr_pool_clear(a); + #if APR_HAS_THREADS if (alloc_mutex) { apr_lock_acquire(alloc_mutex); } #endif + /* detach this pool from its parent. */ if (a->parent) { if (a->parent->sub_pools == a) { a->parent->sub_pools = a->sub_next; @@ -774,12 +798,26 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) a->sub_next->sub_prev = a->sub_prev; } } + #if APR_HAS_THREADS if (alloc_mutex) { apr_lock_release(alloc_mutex); } #endif - free_blocks(a->first); + + /* freeing the first block will include the pool structure. to prevent + a double call to apr_pool_destroy, we want to fill a NULL into + a->first so that the second call (or any attempted usage of the + pool) will segfault on a deref. + + Note: when ALLOC_DEBUG is on, the free'd blocks are filled with + 0xa5. That will cause future use of this pool to die since the pool + structure resides within the block's 0xa5 overwrite area. However, + we want this to fail much more regularly, so stash the NULL. + */ + blok = a->first; + a->first = NULL; + free_blocks(blok); } APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p) @@ -895,7 +933,6 @@ APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) b->h.owning_pool = p; } } - return 0; } #endif diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index c29cc0438d4..91820f8526f 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -107,6 +107,10 @@ /* Details of the debugging options can now be found in the developer * section of the documentaion. */ +/* +#define ALLOC_DEBUG +#define ALLOC_STATS +*/ /* magic numbers --- min free bytes to consider a free apr_pool_t block useable, * and the min amount to allocate if we have to go to malloc() */ @@ -721,22 +725,37 @@ APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp) */ APR_DECLARE(void) apr_pool_clear(apr_pool_t *a) { + /* free the subpools. we can just loop -- the subpools will detach + themselve from us, so this is easy. */ while (a->sub_pools) { apr_pool_destroy(a->sub_pools); } - /* - * Don't hold the mutex during cleanups. - */ + + /* run cleanups and free any subprocesses. */ run_cleanups(a->cleanups); a->cleanups = NULL; free_proc_chain(a->subprocesses); a->subprocesses = NULL; + + /* free the pool's blocks, *except* for the first one. the actual pool + structure is contained in the first block. this also gives us some + ready memory for reallocating within this pool. */ free_blocks(a->first->h.next); a->first->h.next = NULL; + /* this was allocated in self, or a subpool of self. it simply + disappears, so forget the hash table. */ a->prog_data = NULL; + /* no other blocks, so the last block is the first. */ a->last = a->first; + + /* "free_first_avail" is the original first_avail when the pool was + constructed. (kind of a misnomer, but it means "when freeing, use + this as the first available ptr) + + restore the first/only block avail pointer, effectively resetting + the block to empty (except for the pool structure). */ a->first->h.first_avail = a->free_first_avail; debug_fill(a->first->h.first_avail, a->first->h.endp - a->first->h.first_avail); @@ -756,13 +775,18 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *a) APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) { + union block_hdr *blok; + + /* toss everything in the pool. */ apr_pool_clear(a); + #if APR_HAS_THREADS if (alloc_mutex) { apr_lock_acquire(alloc_mutex); } #endif + /* detach this pool from its parent. */ if (a->parent) { if (a->parent->sub_pools == a) { a->parent->sub_pools = a->sub_next; @@ -774,12 +798,26 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) a->sub_next->sub_prev = a->sub_prev; } } + #if APR_HAS_THREADS if (alloc_mutex) { apr_lock_release(alloc_mutex); } #endif - free_blocks(a->first); + + /* freeing the first block will include the pool structure. to prevent + a double call to apr_pool_destroy, we want to fill a NULL into + a->first so that the second call (or any attempted usage of the + pool) will segfault on a deref. + + Note: when ALLOC_DEBUG is on, the free'd blocks are filled with + 0xa5. That will cause future use of this pool to die since the pool + structure resides within the block's 0xa5 overwrite area. However, + we want this to fail much more regularly, so stash the NULL. + */ + blok = a->first; + a->first = NULL; + free_blocks(blok); } APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p) @@ -895,7 +933,6 @@ APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) b->h.owning_pool = p; } } - return 0; } #endif From 33d37dbe42b7b7f96ee7244ef725b07fbe3a0167 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Wed, 18 Apr 2001 17:46:39 +0000 Subject: [PATCH 1536/7878] Check for NSLinkModule and enable dso if found. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61527 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index c1480ce5284..42e6b3f923a 100644 --- a/configure.in +++ b/configure.in @@ -780,8 +780,11 @@ AC_ARG_ENABLE(dso, [ --enable-dso Enable dso support ], [ tempdso=$enableval], [ - AC_CHECK_LIB(dl, dlopen, [ tempdso="yes" LIBS="$LIBS -ldl" ], - tempdso="no") + AC_CHECK_FUNCS(NSLinkModule, [ tempdso="yes" ], [ tempdso="no" ]) + if test "$tempdso" = "no"; then + AC_CHECK_LIB(dl, dlopen, [ tempdso="yes" LIBS="$LIBS -ldl" ], + tempdso="no") + fi if test "$tempdso" = "no"; then AC_CHECK_FUNCS(dlopen, [ tempdso="yes" ], [ tempdso="no" ]) fi From 3d9ecf7381319e7b76dff05391c3e146b6d1876e Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Wed, 18 Apr 2001 17:47:09 +0000 Subject: [PATCH 1537/7878] Add -DSIGPROCMASK_SETS_THREAD_MASK for Darwin for now git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61528 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index f46e24992d2..7b6ca0846b8 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -174,7 +174,7 @@ dnl *-apple-rhapsody*) dnl APR_ADDTO(CPPFLAGS, [-DDARWIN -DMAC_OS_X_SERVER]) dnl ;; *-apple-darwin*) - APR_ADDTO(CPPFLAGS, [-DDARWIN]) + APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK]) ;; *-dec-osf*) APR_ADDTO(CPPFLAGS, [-DOSF1]) From a6519ec9ae64901f2fcba253fc68e8de7aa45c4e Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Wed, 18 Apr 2001 17:47:10 +0000 Subject: [PATCH 1538/7878] Add dyld support git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61529 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 6ff0baf3fd9..2c7f20c703e 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -73,6 +73,8 @@ static apr_status_t dso_cleanup(void *thedso) #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) shl_unload((shl_t)dso->handle); +#elif defined(DARWIN) + NSUnLinkModule(dso->handle, FALSE); #else if (dlclose(dso->handle) != 0) return APR_EINIT; @@ -87,9 +89,28 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) shl_t os_handle = shl_load(path, BIND_IMMEDIATE|BIND_VERBOSE|BIND_NOSTART, 0L); + +#elif defined(DARWIN) + NSObjectFileImage image; + NSModule os_handle; + char* err_msg = NULL; + if (NSCreateObjectFileImageFromFile(path, &image) != NSObjectFileImageSuccess) { + err_msg = "cannot create object file image"; + } + else { +#ifdef NSLINKMODULE_OPTION_PRIVATE + os_handle = NSLinkModule(image, path, + NSLINKMODULE_OPTION_PRIVATE | + NSLINKMODULE_OPTION_RETURN_ON_ERROR); +#else + os_handle = NSLinkModule(image, path, TRUE); +#endif + } + #elif defined(OSF1) || defined(SEQUENT) || defined(SNI) ||\ (defined(__FreeBSD_version) && (__FreeBSD_version >= 220000)) void *os_handle = dlopen((char *)path, RTLD_NOW | RTLD_GLOBAL); + #else void *os_handle = dlopen(path, RTLD_NOW | RTLD_GLOBAL); #endif @@ -100,6 +121,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) (*res_handle)->errormsg = strerror(errno); return errno; +#elif defined(DARWIN) + (*res_handle)->errormsg = (err_msg) ? err_msg : "link failed"; + return APR_EDSOOPEN; #else (*res_handle)->errormsg = dlerror(); return APR_EDSOOPEN; @@ -136,7 +160,29 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, return APR_EINIT; *ressym = symaddr; return APR_SUCCESS; -#else /* not HP-UX; use dlsym()/dlerror() */ + +#elif defined(DARWIN) + void *retval = NULL; + NSSymbol symbol; + char *symname2 = (char*)malloc(sizeof(char)*(strlen(symname)+2)); + sprintf(symname2, "_%s", symname); +#ifdef NSLINKMODULE_OPTION_PRIVATE + symbol = NSLookupSymbolInModule((NSModule)handle->handle, symname2); +#else + symbol = NSLookupAndBindSymbol(symname2); +#endif + free(symname2); + if (symbol == NULL) { + handle->errormsg = "undefined symbol"; + return APR_EINIT; + } + retval = NSAddressOfSymbol(symbol); + if (retval == NULL) { + handle->errormsg = "cannot resolve symbol"; + return APR_EINIT; + } + +#else /* use dlsym()/dlerror() */ #if defined(DLSYM_NEEDS_UNDERSCORE) void *retval; @@ -159,7 +205,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, *ressym = retval; return APR_SUCCESS; -#endif /* not HP-UX; use dlsym()/dlerror() */ +#endif /* use dlsym()/dlerror() */ } APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) From 356b43c321d5b01873d8d815463e5bf1cf150365 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Wed, 18 Apr 2001 17:47:11 +0000 Subject: [PATCH 1539/7878] Include git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61530 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/dso.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/arch/unix/dso.h b/include/arch/unix/dso.h index c7472c02666..9f94d00de98 100644 --- a/include/arch/unix/dso.h +++ b/include/arch/unix/dso.h @@ -63,6 +63,10 @@ #if APR_HAS_DSO +#ifdef HAVE_MACH_O_DYLD_H +#include +#endif + #ifdef HAVE_DLFCN_H #include #endif From 8409032a76a7ea67080e7e94c576dcf90a539d31 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Wed, 18 Apr 2001 17:56:48 +0000 Subject: [PATCH 1540/7878] *** empty log message *** git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61531 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 8024a2df851..4d15f2bf35a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Add DSO support for dyld platforms (Darwin/Mac OS and OpenStep). + [Wilfredo Sanchez] + *) Amend the time code to better deal with time zones. [David Reid] From 675a4573506f348ca9185d842f4c154233f460e3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 18 Apr 2001 20:37:39 +0000 Subject: [PATCH 1541/7878] This commit adds - apr_os_dso_handle_t type to Win32 and BeOS - apr_os_dso_handle_get/put This would seem to fill in a hole that we've overlooked until now. Code to follow. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61532 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/apr_portable.h b/include/apr_portable.h index 0b33ef0e9b6..4c6159ce10b 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -101,6 +101,7 @@ typedef PROCESS_INFORMATION apr_os_proc_t; typedef DWORD apr_os_threadkey_t; typedef FILETIME apr_os_imp_time_t; typedef SYSTEMTIME apr_os_exp_time_t; +typedef HANDLE apr_os_dso_handle_t; #elif defined(OS2) typedef HFILE apr_os_file_t; @@ -112,6 +113,7 @@ typedef PID apr_os_proc_t; typedef PULONG apr_os_threadkey_t; typedef struct timeval apr_os_imp_time_t; typedef struct tm apr_os_exp_time_t; +/* insert dso typedef here */ #elif defined(__BEOS__) #include @@ -134,6 +136,7 @@ typedef thread_id apr_os_proc_t; typedef int apr_os_threadkey_t; typedef struct timeval apr_os_imp_time_t; typedef struct tm apr_os_exp_time_t; +typedef image_id apr_os_dso_handle_t; #else /* Any other OS should go above this one. This is the lowest common @@ -180,6 +183,7 @@ typedef pthread_key_t apr_os_threadkey_t; typedef pid_t apr_os_proc_t; typedef struct timeval apr_os_imp_time_t; typedef struct tm apr_os_exp_time_t; +/* insert dso typedef here */ #endif /** @@ -383,6 +387,26 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, #endif /* APR_HAS_THREADS */ +/** + * convert the dso handle from os specific to apr + * @param dso The apr handle we are converting to + * @param thedso the os specific handle to convert + * @param pool the pool to use if it is needed + * @deffunc apr_status_t apr_os_dso_handle_put(apr_dso_handle_t **dso, apr_os_dso_handle_t *thedso, apr_pool_t *pool) + */ +APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **dso, + apr_os_dso_handle_t *thedso, + apr_pool_t *pool); + +/** + * convert the apr dso handle into an os specific one + * @param aprdso The apr dso handle to convert + * @param dso The os specific dso to return + * @deffunc apr_status_t apr_os_dso_handle_get(apr_os_dso_handle_t *dso, apr_dso_handle_t *aprdso); + */ +APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso, + apr_dso_handle_t *aprdso); + #ifdef __cplusplus } #endif From 571d428150bb576859b24f9acb4fc81fbf93e696 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 18 Apr 2001 20:47:19 +0000 Subject: [PATCH 1542/7878] Try to add the apr_os_dso_handle_t typedefs for those platforms that use the unix dso code. This isn't complete and may not even build but does get us building again on FreeBSD. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61533 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 4c6159ce10b..7f5a3f51e81 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -183,7 +183,15 @@ typedef pthread_key_t apr_os_threadkey_t; typedef pid_t apr_os_proc_t; typedef struct timeval apr_os_imp_time_t; typedef struct tm apr_os_exp_time_t; -/* insert dso typedef here */ +/* dso types... */ +#if defined(HPUX) || defined(HPUX10) || defined(HPUX11) +typedef shl_t apr_os_dso_handle_t; +#elif defined(DRAWIN) +typedef NSModule apr_os_dso_handle_t; +#else +typedef void * apr_os_dso_handle_t; +#endif + #endif /** From 34ab993468a6e307209a2fab3a7637f9a7cc9ef0 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Thu, 19 Apr 2001 07:18:47 +0000 Subject: [PATCH 1543/7878] Clean up conditionals in unix DSO code so that we decide based on the dynamic loading implementation, which we noticed at configure time, instead of by operating system, which should be simpler to maintain. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61534 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ acconfig.h | 4 ++++ configure.in | 13 +++++++++---- dso/unix/dso.c | 35 ++++++++++++++++++++--------------- 4 files changed, 38 insertions(+), 19 deletions(-) diff --git a/CHANGES b/CHANGES index 4d15f2bf35a..33cfc29141e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Clean up conditionals in unix DSO code so that we decide based on + the dynamic loading implementation, which we noticed at configure + time, instead of by operating system. + [Wilfredo Sanchez] + *) Add DSO support for dyld platforms (Darwin/Mac OS and OpenStep). [Wilfredo Sanchez] diff --git a/acconfig.h b/acconfig.h index 3b63b217fec..b238713b5a7 100644 --- a/acconfig.h +++ b/acconfig.h @@ -29,6 +29,10 @@ #undef HAVE_GMTOFF #undef USE_THREADS +#undef DSO_USE_DLFCN +#undef DSO_USE_SHL +#undef DSO_USE_DYLD + #undef SIZEOF_SSIZE_T #undef SIZEOF_SIZE_T #undef SIZEOF_OFF_T diff --git a/configure.in b/configure.in index 42e6b3f923a..74fefc240cf 100644 --- a/configure.in +++ b/configure.in @@ -780,19 +780,19 @@ AC_ARG_ENABLE(dso, [ --enable-dso Enable dso support ], [ tempdso=$enableval], [ - AC_CHECK_FUNCS(NSLinkModule, [ tempdso="yes" ], [ tempdso="no" ]) + AC_CHECK_FUNCS(NSLinkModule, [ tempdso="dyld" ], [ tempdso="no" ]) if test "$tempdso" = "no"; then - AC_CHECK_LIB(dl, dlopen, [ tempdso="yes" LIBS="$LIBS -ldl" ], + AC_CHECK_LIB(dl, dlopen, [ tempdso="dlfcn" LIBS="$LIBS -ldl" ], tempdso="no") fi if test "$tempdso" = "no"; then - AC_CHECK_FUNCS(dlopen, [ tempdso="yes" ], [ tempdso="no" ]) + AC_CHECK_FUNCS(dlopen, [ tempdso="dlfcn" ], [ tempdso="no" ]) fi if test "$tempdso" = "no"; then AC_CHECK_LIB(root, load_image, tempdso="yes", tempdso="no") fi if test "$tempdso" = "no"; then - AC_CHECK_LIB(dld, shl_load, [ tempdso="yes" LIBS="$LIBS -ldld" ], + AC_CHECK_LIB(dld, shl_load, [ tempdso="shl" LIBS="$LIBS -ldld" ], tempdso="no") fi if test "$tempdso" = "no"; then @@ -807,6 +807,11 @@ AC_ARG_ENABLE(dso, if test "$tempdso" = "no"; then aprdso="0" else + case "$tempdso" in + dlfcn) AC_DEFINE(DSO_USE_DLFCN);; + shl) AC_DEFINE(DSO_USE_SHL);; + dyld) AC_DEFINE(DSO_USE_DYLD);; + esac aprdso="1" apr_modules="$apr_modules dso" fi diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 2c7f20c703e..cad0a08fcdd 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -57,6 +57,10 @@ #if APR_HAS_DSO +#if !defined(DSO_USE_DLFCN) && !defined(DSO_USE_SHL) && !defined(DSO_USE_DYLD) +#error No DSO implementation specified. +#endif + #ifdef HAVE_STDDEF_H #include #endif @@ -71,11 +75,11 @@ static apr_status_t dso_cleanup(void *thedso) if (dso->handle == NULL) return APR_SUCCESS; -#if defined(HPUX) || defined(HPUX10) || defined(HPUX11) +#if defined(DSO_USE_SHL) shl_unload((shl_t)dso->handle); -#elif defined(DARWIN) +#elif defined(DSO_USE_DYLD) NSUnLinkModule(dso->handle, FALSE); -#else +#elif defined(DSO_USE_DLFCN) if (dlclose(dso->handle) != 0) return APR_EINIT; #endif @@ -87,10 +91,10 @@ static apr_status_t dso_cleanup(void *thedso) APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { -#if defined(HPUX) || defined(HPUX10) || defined(HPUX11) +#if defined(DSO_USE_SHL) shl_t os_handle = shl_load(path, BIND_IMMEDIATE|BIND_VERBOSE|BIND_NOSTART, 0L); -#elif defined(DARWIN) +#elif defined(DSO_USE_DYLD) NSObjectFileImage image; NSModule os_handle; char* err_msg = NULL; @@ -107,24 +111,26 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, #endif } -#elif defined(OSF1) || defined(SEQUENT) || defined(SNI) ||\ +#elif defined(DSO_USE_DLFCN) +#if defined(OSF1) || defined(SEQUENT) || defined(SNI) ||\ (defined(__FreeBSD_version) && (__FreeBSD_version >= 220000)) void *os_handle = dlopen((char *)path, RTLD_NOW | RTLD_GLOBAL); #else void *os_handle = dlopen(path, RTLD_NOW | RTLD_GLOBAL); #endif +#endif /* DSO_USE_x */ *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); if(os_handle == NULL) { -#if defined(HPUX) || defined(HPUX10) || defined(HPUX11) +#if defined(DSO_USE_SHL) (*res_handle)->errormsg = strerror(errno); return errno; -#elif defined(DARWIN) +#elif defined(DSO_USE_DYLD) (*res_handle)->errormsg = (err_msg) ? err_msg : "link failed"; return APR_EDSOOPEN; -#else +#elif defined(DSO_USE_DLFCN) (*res_handle)->errormsg = dlerror(); return APR_EDSOOPEN; #endif @@ -148,7 +154,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, const char *symname) { -#if defined(HPUX) || defined(HPUX10) || defined(HPUX11) +#if defined(DSO_USE_SHL) void *symaddr = NULL; int status; @@ -161,7 +167,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, *ressym = symaddr; return APR_SUCCESS; -#elif defined(DARWIN) +#elif defined(DSO_USE_DYLD) void *retval = NULL; NSSymbol symbol; char *symname2 = (char*)malloc(sizeof(char)*(strlen(symname)+2)); @@ -182,7 +188,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, return APR_EINIT; } -#else /* use dlsym()/dlerror() */ +#elif defined(DSO_USE_DLFCN) #if defined(DLSYM_NEEDS_UNDERSCORE) void *retval; @@ -190,12 +196,11 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, sprintf(symbol, "_%s", symname); retval = dlsym(handle->handle, symbol); free(symbol); - #elif defined(SEQUENT) || defined(SNI) void *retval = dlsym(handle->handle, (char *)symname); #else void *retval = dlsym(handle->handle, symname); -#endif +#endif /* DLSYM_NEEDS_UNDERSCORE */ if (retval == NULL) { handle->errormsg = dlerror(); @@ -205,7 +210,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, *ressym = retval; return APR_SUCCESS; -#endif /* use dlsym()/dlerror() */ +#endif /* DSO_USE_x */ } APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) From 5626f07f1d2e9faef4c567764f25cb9156010f21 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Thu, 19 Apr 2001 07:29:48 +0000 Subject: [PATCH 1544/7878] Back out -DSIGPROCMASK_SETS_THREAD_MASK flag for Darwin. Please excuse me while I extinguish my pants. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61535 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 7b6ca0846b8..f46e24992d2 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -174,7 +174,7 @@ dnl *-apple-rhapsody*) dnl APR_ADDTO(CPPFLAGS, [-DDARWIN -DMAC_OS_X_SERVER]) dnl ;; *-apple-darwin*) - APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK]) + APR_ADDTO(CPPFLAGS, [-DDARWIN]) ;; *-dec-osf*) APR_ADDTO(CPPFLAGS, [-DOSF1]) From ad5a01ca84adf193d9fee68acc4adb45d072edc0 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Thu, 19 Apr 2001 07:43:06 +0000 Subject: [PATCH 1545/7878] Enable rhapsody git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61536 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index f46e24992d2..266296b335e 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -170,9 +170,9 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(OPTIM, [-O]) APR_ADDTO(CPPFLAGS, [-DNEXT]) ;; -dnl *-apple-rhapsody*) -dnl APR_ADDTO(CPPFLAGS, [-DDARWIN -DMAC_OS_X_SERVER]) -dnl ;; + *-apple-rhapsody*) + APR_ADDTO(CPPFLAGS, [-DRHAPSODY]) + ;; *-apple-darwin*) APR_ADDTO(CPPFLAGS, [-DDARWIN]) ;; From 4caee477bd75396408535401fbe95d9d61ad0a4f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 19 Apr 2001 14:24:14 +0000 Subject: [PATCH 1546/7878] implement apr_os_dso_handle_get|put() so that Apache builds again; Apache's exports.c reflected that the prototypes were added but the function wasn't actually implemented more implementations forthcoming as people figure out they can't link... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61537 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index cad0a08fcdd..985f57fc54c 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -54,6 +54,7 @@ #include "dso.h" #include "apr_strings.h" +#include "apr_portable.h" #if APR_HAS_DSO @@ -68,6 +69,22 @@ #include /* for strerror() on HP-UX */ #endif +APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, + apr_os_dso_handle_t *osdso, + apr_pool_t *pool) +{ + *aprdso = apr_pcalloc(pool, sizeof **aprdso); + (*aprdso)->handle = *osdso; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *osdso, + apr_dso_handle_t *aprdso) +{ + *osdso = aprdso->handle; + return APR_SUCCESS; +} + static apr_status_t dso_cleanup(void *thedso) { apr_dso_handle_t *dso = thedso; From f85fbe9b47ab37e80d1af40201c5eb0f837d3157 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 19 Apr 2001 14:54:39 +0000 Subject: [PATCH 1547/7878] Inserting dso typedef here.... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61538 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 7f5a3f51e81..db7241ef5a9 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -113,7 +113,7 @@ typedef PID apr_os_proc_t; typedef PULONG apr_os_threadkey_t; typedef struct timeval apr_os_imp_time_t; typedef struct tm apr_os_exp_time_t; -/* insert dso typedef here */ +typedef HMODULE apr_os_dso_handle_t; #elif defined(__BEOS__) #include From 694c77e4ca3f5c19a7860f25b3e8a266fe9fc55f Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 19 Apr 2001 15:17:28 +0000 Subject: [PATCH 1548/7878] Add OS/2 implementation of apr_os_dso_handle_put/get. Mostly copied from Jeff's unix version. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61539 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os2/dso.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dso/os2/dso.c b/dso/os2/dso.c index 16ae6693fed..7c910c33ad1 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -54,6 +54,7 @@ #include "dso.h" #include "apr_strings.h" +#include "apr_portable.h" #include #include @@ -137,4 +138,27 @@ APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr return buffer; } + + +APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, + apr_os_dso_handle_t *osdso, + apr_pool_t *pool) +{ + *aprdso = apr_pcalloc(pool, sizeof **aprdso); + (*aprdso)->handle = *osdso; + (*aprdso)->cont = pool; + (*aprdso)->load_error = APR_SUCCESS; + (*aprdso)->failed_module = NULL; + return APR_SUCCESS; +} + + + +APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *osdso, + apr_dso_handle_t *aprdso) +{ + *osdso = aprdso->handle; + return APR_SUCCESS; +} + #endif From 42fe9f059b466d32f6f2d5b40c9c362b697171c2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 19 Apr 2001 16:43:20 +0000 Subject: [PATCH 1549/7878] store the pool handle in apr_os_dso_handle_put() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61540 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 985f57fc54c..04e8a964d17 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -75,6 +75,7 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, { *aprdso = apr_pcalloc(pool, sizeof **aprdso); (*aprdso)->handle = *osdso; + (*aprdso)->cont = pool; return APR_SUCCESS; } From acea698d59eeba6336dad4c05aa9d9fb7e831416 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 19 Apr 2001 21:21:37 +0000 Subject: [PATCH 1550/7878] ignore failure to set APR_SO_DEBUG; some platforms don't have it git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61541 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsockopt.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/test/testsockopt.c b/test/testsockopt.c index b51da23fceb..54fe6cc552d 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -138,24 +138,24 @@ int main(void) printf("\tTrying to set APR_SO_DEBUG..............."); if (apr_setsocketopt(sock, APR_SO_DEBUG, 1) != APR_SUCCESS){ - apr_socket_close(sock); - printf("Failed\n"); - exit (-1); - } - printf ("OK\n"); - - printf("\tChecking if we recorded it..............."); - if (apr_getsocketopt(sock, APR_SO_DEBUG, &ck) != APR_SUCCESS){ - apr_socket_close(sock); - printf("Failed!\n"); - exit (-1); + printf("Failed (ignored)\n"); + } + else { + printf ("OK\n"); + + printf("\tChecking if we recorded it..............."); + if (apr_getsocketopt(sock, APR_SO_DEBUG, &ck) != APR_SUCCESS){ + apr_socket_close(sock); + printf("Failed!\n"); + exit (-1); + } + if (ck != 1){ + printf ("No (%d)\n", ck); + apr_socket_close(sock); + exit (-1); + } + printf ("Yes\n"); } - if (ck != 1){ - printf ("No (%d)\n", ck); - apr_socket_close(sock); - exit (-1); - } - printf ("Yes\n"); printf ("\tTrying to remove APR_SO_KEEPALIVE........"); if (apr_setsocketopt(sock, APR_SO_KEEPALIVE, 0) != APR_SUCCESS){ From 3643dc312379d54cc4ada5578f1dd6e46ad50bd4 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 19 Apr 2001 22:01:06 +0000 Subject: [PATCH 1551/7878] help OS/390 recover from its post-Hackathon hangover (don't use try to use tm_gmtoff if it doesn't exist, and neither does _POSIX_THREAD_SAFE_FUNCTIONS) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61542 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/time/unix/time.c b/time/unix/time.c index 32930db8e71..743a9f21da5 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -168,7 +168,9 @@ apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input #else /* !APR_HAS_THREADS */ struct tm *mangotm; mangotm=localtime(&mango); +#ifdef HAVE_GMTOFF offs = mangotm->tm_gmtoff; +#endif #endif return apr_explode_time(result, input, offs); #endif /* __EMX__ */ From a0103a5837f9b23b31298932797971d376e86a80 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Fri, 20 Apr 2001 12:29:50 +0000 Subject: [PATCH 1552/7878] Change COMPILE macro to make sure that APR includes are before the CFLAGS ones (like /usr/local/include. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61543 13f79535-47bb-0310-9956-ffa450edef68 --- build/rules.mk.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/rules.mk.in b/build/rules.mk.in index 67fdc6c8237..6a46d0f3b93 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -83,7 +83,7 @@ LTFLAGS = --silent # # Basic macro setup # -COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) $(OPTIM) $(INCLUDES) +COMPILE = $(CC) $(CPPFLAGS) $(INCLUDES) $(OPTIM) $(CFLAGS) LT_COMPILE = @lt_compile@ LINK = @link@ From 1d0b8b8090b934dcbdccaf9c0926b82068446126 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sat, 21 Apr 2001 00:50:35 +0000 Subject: [PATCH 1553/7878] This file was getting a bit outdated, so this gets it a bit more up to speed. It's possible that it has outlived its usefulness. If not, someone might want to add information about 'make install' and/or change the file from README.dev to just plain README. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61544 13f79535-47bb-0310-9956-ffa450edef68 --- README.dev | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.dev b/README.dev index 8819a7ce1f9..c3527a0999d 100644 --- a/README.dev +++ b/README.dev @@ -1,13 +1,15 @@ Apache Portable Runtime ======================= -Right now, if you are building APR, it means that you are probably a -developer. If you are building it as a standalone package, however, -this means using a slightly non-standard build process. +If you are building APR from CVS, you need to use a slightly non-standard +build process. You must have autoconf and libtool installed for this to +work. There are three steps: 1) ./buildconf 2) ./configure 3) make -Currently, there is no make install step, as APR is not yet -installable. +If you are building APR from a distribution tarball, buildconf will have +already been run for you, and you therefore do not need to have either +autoconf or libtool installed, and you do not need to run buildconf. Skip +step one above and just run configure then make. From b6f8bd1b1c348de4c8e64bcecb8c49a500f73d0e Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 22 Apr 2001 21:05:41 +0000 Subject: [PATCH 1554/7878] Add the apr_os_dso_handle_get/set for BeOS and some other pieces of tidying up to remove some errors as the handle is an integer not a pointer. Also add the include to apr_portable.h that I missed as pointed out by Peter Schultz. Submitted by: Peter Schultz Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61545 13f79535-47bb-0310-9956-ffa450edef68 --- dso/beos/dso.c | 22 ++++++++++++++++++++-- include/apr_portable.h | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/dso/beos/dso.c b/dso/beos/dso.c index e6764944a16..7b578c31a5d 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -53,6 +53,7 @@ */ #include "beos/dso.h" +#include "apr_portable.h" #if APR_HAS_DSO @@ -60,9 +61,9 @@ static apr_status_t dso_cleanup(void *thedso) { apr_dso_handle_t *dso = thedso; - if (dso->handle != NULL && unload_add_on(dso->handle) < B_NO_ERROR) + if (dso->handle > 0 && unload_add_on(dso->handle) < B_NO_ERROR) return APR_EINIT; - dso->handle = NULL; + dso->handle = -1; return APR_SUCCESS; } @@ -112,4 +113,21 @@ APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr return buffer; } +APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, + apr_os_dso_handle_t *osdso, + apr_pool_t *pool) +{ + *aprdso = apr_pcalloc(pool, sizeof **aprdso); + (*aprdso)->handle = *osdso; + (*aprdso)->cont = pool; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *osdso, + apr_dso_handle_t *aprdso) +{ + *osdso = aprdso->handle; + return APR_SUCCESS; +} + #endif diff --git a/include/apr_portable.h b/include/apr_portable.h index db7241ef5a9..d0aa1d92d10 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -117,6 +117,7 @@ typedef HMODULE apr_os_dso_handle_t; #elif defined(__BEOS__) #include +#include struct apr_os_lock_t { /* Inter proc */ From 03133b9c8e0b9ccd03b71e957012e696e04ce6a1 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 23 Apr 2001 14:55:14 +0000 Subject: [PATCH 1555/7878] clean up *.obj files, generated by OS/2 build using aplibtool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61546 13f79535-47bb-0310-9956-ffa450edef68 --- build/rules.mk.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/rules.mk.in b/build/rules.mk.in index 6a46d0f3b93..268e326be3c 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -127,7 +127,7 @@ all-recursive depend-recursive clean-recursive distclean-recursive \ fi local-clean: x-local-clean - $(RM) -f *.o *.lo *.a *.la *.so $(CLEAN_TARGETS) $(PROGRAMS) + $(RM) -f *.o *.lo *.a *.la *.so *.obj $(CLEAN_TARGETS) $(PROGRAMS) $(RM) -rf .libs local-distclean: local-clean x-local-distclean From 0c0c3f069b7439a96ef073c50784b4f7fd219920 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 23 Apr 2001 15:18:30 +0000 Subject: [PATCH 1556/7878] OS/2: Return APR_EOF where appropriate from apr_file_read(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61547 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index c3f4d7bb03b..b2077486b7e 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -107,6 +107,11 @@ apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) *nbytes = rc == 0 ? pos - (char *)buf : 0; apr_lock_release(thefile->mutex); + + if (*nbytes == 0 && rc == 0) { + return APR_EOF; + } + return APR_OS2_STATUS(rc); } else { if (thefile->pipe) @@ -130,6 +135,7 @@ apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) if (bytesread == 0) { thefile->eof_hit = TRUE; + return APR_EOF; } return APR_SUCCESS; From 65514021a2eba2ac36b2d337517e2a834193d77a Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 25 Apr 2001 05:26:39 +0000 Subject: [PATCH 1557/7878] get apr_os_dso_handle_put working git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61548 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os2/dso.c | 4 ++-- dso/unix/dso.c | 4 ++-- include/apr_portable.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dso/os2/dso.c b/dso/os2/dso.c index 7c910c33ad1..2b0a1cde939 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -141,11 +141,11 @@ APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, - apr_os_dso_handle_t *osdso, + apr_os_dso_handle_t osdso, apr_pool_t *pool) { *aprdso = apr_pcalloc(pool, sizeof **aprdso); - (*aprdso)->handle = *osdso; + (*aprdso)->handle = osdso; (*aprdso)->cont = pool; (*aprdso)->load_error = APR_SUCCESS; (*aprdso)->failed_module = NULL; diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 04e8a964d17..679b6ba46b0 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -70,11 +70,11 @@ #endif APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, - apr_os_dso_handle_t *osdso, + apr_os_dso_handle_t osdso, apr_pool_t *pool) { *aprdso = apr_pcalloc(pool, sizeof **aprdso); - (*aprdso)->handle = *osdso; + (*aprdso)->handle = osdso; (*aprdso)->cont = pool; return APR_SUCCESS; } diff --git a/include/apr_portable.h b/include/apr_portable.h index d0aa1d92d10..986ff741ab0 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -404,7 +404,7 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, * @deffunc apr_status_t apr_os_dso_handle_put(apr_dso_handle_t **dso, apr_os_dso_handle_t *thedso, apr_pool_t *pool) */ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **dso, - apr_os_dso_handle_t *thedso, + apr_os_dso_handle_t thedso, apr_pool_t *pool); /** From 13c56963ac2f9c3b721102c34322b7e2536d7dc8 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 25 Apr 2001 09:00:47 +0000 Subject: [PATCH 1558/7878] Fix the build after Doug M's commit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61549 13f79535-47bb-0310-9956-ffa450edef68 --- dso/beos/dso.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 7b578c31a5d..5a4b5823589 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -114,11 +114,11 @@ APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr } APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, - apr_os_dso_handle_t *osdso, + apr_os_dso_handle_t osdso, apr_pool_t *pool) { *aprdso = apr_pcalloc(pool, sizeof **aprdso); - (*aprdso)->handle = *osdso; + (*aprdso)->handle = osdso; (*aprdso)->cont = pool; return APR_SUCCESS; } From cbf30713ec66d4ac51aeb5f9c85ef09c579b857f Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Thu, 26 Apr 2001 15:30:52 +0000 Subject: [PATCH 1559/7878] Add a nifty memory/pool debugging option: allocation everything on a page, then turn the page inaccessible at "free" time. Causes segfaults on access. Chews memory like nothing else, but it works really well (it helped me find a use-after-destroy problem already). Memory consumption can be reduced by reimplementing this to not require the ALLOC_USE_MALLOC option. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61550 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_pools.c | 100 +++++++++++++++++++++++++++++++++++----- memory/unix/apr_pools.c | 100 +++++++++++++++++++++++++++++++++++----- 2 files changed, 176 insertions(+), 24 deletions(-) diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 91820f8526f..bcdcf25de93 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -106,10 +106,32 @@ #endif /* Details of the debugging options can now be found in the developer - * section of the documentaion. */ + * section of the documentaion. + * ### gjs: where the hell is that? + * + * DEBUG_WITH_MPROTECT: + * This is known to work on Linux systems. It can only be used in + * conjunction with ALLOC_USE_MALLOC (for now). ALLOC_USE_MALLOC will + * use malloc() for *each* allocation, and then free it when the pool + * is cleared. When DEBUG_WITH_MPROTECT is used, the allocation is + * performed using an anonymous mmap() call to get page-aligned memory. + * Rather than free'ing the memory, an mprotect() call is made to make + * the memory non-accessible. Thus, if the memory is referred to *after* + * the pool is cleared, an immediate segfault occurs. :-) + * + * WARNING: Since every allocation creates a new mmap, aligned on a new + * page, this debugging option chews memory. A **LOT** of + * memory. Linux "recovered" the memory from my X Server process + * the first time I ran a "largish" sequence of operations. + * + * ### it should be possible to use this option without ALLOC_USE_MALLOC + * ### and simply mprotect the blocks at clear time (rather than put them + * ### into the free block list). + */ /* #define ALLOC_DEBUG #define ALLOC_STATS +#define DEBUG_WITH_MPROTECT */ /* magic numbers --- min free bytes to consider a free apr_pool_t block useable, @@ -141,8 +163,12 @@ #define BLOCK_MINALLOC 0 #endif /* ALLOC_USE_MALLOC */ -#define APR_SLACK_LOW 1 -#define APR_SLACK_HIGH 2 +#ifdef DEBUG_WITH_MPROTECT +#ifndef ALLOC_USE_MALLOC +#error "ALLOC_USE_MALLOC must be enabled to use DEBUG_WITH_MPROTECT" +#endif +#include +#endif /***************************************************************** @@ -238,11 +264,62 @@ static APR_INLINE void debug_verify_filled(const char *ptr, const char *endp, #define debug_verify_filled(a,b,c) #endif /* ALLOC_DEBUG */ +#ifdef DEBUG_WITH_MPROTECT + +#define SIZEOF_BLOCK(p) (((union block_hdr *)(p) - 1)->a.l) + +static void *mprotect_malloc(apr_size_t size) +{ + union block_hdr * addr; + + size += sizeof(union block_hdr); + addr = mmap(NULL, size + sizeof(union block_hdr), + PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, + -1, 0); + if (addr == MAP_FAILED) + return NULL; + addr->a.l = size; + return addr + 1; +} + +static void mprotect_free(void *addr) +{ + apr_size_t size = SIZEOF_BLOCK(addr); + int rv = mprotect((union block_hdr *)addr - 1, size, PROT_NONE); + if (rv != 0) { + fprintf(stderr, "could not protect. errno=%d\n", errno); + abort(); + } +} + +static void *mprotect_realloc(void *addr, apr_size_t size) +{ + void *new_addr = mprotect_malloc(size); + apr_size_t old_size = SIZEOF_BLOCK(addr); + + if (size < old_size) + old_size = size; + memcpy(new_addr, addr, old_size); + mprotect_free(addr); + return new_addr; +} + +#define DO_MALLOC(s) mprotect_malloc(s) +#define DO_FREE(p) mprotect_free(p) +#define DO_REALLOC(p,s) mprotect_realloc(p,s) + +#else /* DEBUG_WITH_MPROTECT */ + +#define DO_MALLOC(s) malloc(s) +#define DO_FREE(p) free(p) +#define DO_REALLOC(p,s) realloc(p,s) + +#endif /* DEBUG_WITH_MPROTECT */ + /* * Get a completely new block from the system pool. Note that we rely on * malloc() to provide aligned memory. */ - static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) { union block_hdr *blok; @@ -259,7 +336,7 @@ static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) num_malloc_bytes += size + sizeof(union block_hdr); #endif /* ALLOC_STATS */ - blok = (union block_hdr *) malloc(size + sizeof(union block_hdr)); + blok = (union block_hdr *) DO_MALLOC(size + sizeof(union block_hdr)); APR_ABORT(blok == NULL, APR_ENOMEM, apr_abort, "Ouch! malloc failed in malloc_block()\n"); debug_fill(blok, size + sizeof(union block_hdr)); @@ -311,7 +388,7 @@ static void free_blocks(union block_hdr *blok) for ( ; blok; blok = next) { next = blok->h.next; - free(blok); + DO_FREE(blok); } #else /* ALLOC_USE_MALLOC */ @@ -395,7 +472,6 @@ static void free_blocks(union block_hdr *blok) * Get a new block, from our own free list if possible, from the system * if necessary. Must be called with alarms blocked. */ - static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) { union block_hdr **lastptr = &block_freelist; @@ -766,7 +842,7 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *a) for (c = a->allocation_list; c; c = n) { n = *(void **)c; - free(c); + DO_FREE(c); } a->allocation_list = NULL; } @@ -947,7 +1023,7 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) apr_size_t size = reqsize + CLICK_SZ; void *ptr; - ptr = malloc(size); + ptr = DO_MALLOC(size); if (ptr == NULL) { fputs("Ouch! Out of memory!\n", stderr); exit(1); @@ -1104,7 +1180,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) char *ptr; size = (char *)ps->vbuff.curpos - ps->base; - ptr = realloc(ps->base, 2*size); + ptr = DO_REALLOC(ps->base, 2*size); if (ptr == NULL) { fputs("Ouch! Out of memory!\n", stderr); exit(1); @@ -1164,7 +1240,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) struct psprintf_data ps; void *ptr; - ps.base = malloc(512); + ps.base = DO_MALLOC(512); if (ps.base == NULL) { fputs("Ouch! Out of memory!\n", stderr); exit(1); @@ -1176,7 +1252,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) *ps.vbuff.curpos++ = '\0'; ptr = ps.base; /* shrink */ - ptr = realloc(ptr, (char *)ps.vbuff.curpos - (char *)ptr); + ptr = DO_REALLOC(ptr, (char *)ps.vbuff.curpos - (char *)ptr); if (ptr == NULL) { fputs("Ouch! Out of memory!\n", stderr); exit(1); diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 91820f8526f..bcdcf25de93 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -106,10 +106,32 @@ #endif /* Details of the debugging options can now be found in the developer - * section of the documentaion. */ + * section of the documentaion. + * ### gjs: where the hell is that? + * + * DEBUG_WITH_MPROTECT: + * This is known to work on Linux systems. It can only be used in + * conjunction with ALLOC_USE_MALLOC (for now). ALLOC_USE_MALLOC will + * use malloc() for *each* allocation, and then free it when the pool + * is cleared. When DEBUG_WITH_MPROTECT is used, the allocation is + * performed using an anonymous mmap() call to get page-aligned memory. + * Rather than free'ing the memory, an mprotect() call is made to make + * the memory non-accessible. Thus, if the memory is referred to *after* + * the pool is cleared, an immediate segfault occurs. :-) + * + * WARNING: Since every allocation creates a new mmap, aligned on a new + * page, this debugging option chews memory. A **LOT** of + * memory. Linux "recovered" the memory from my X Server process + * the first time I ran a "largish" sequence of operations. + * + * ### it should be possible to use this option without ALLOC_USE_MALLOC + * ### and simply mprotect the blocks at clear time (rather than put them + * ### into the free block list). + */ /* #define ALLOC_DEBUG #define ALLOC_STATS +#define DEBUG_WITH_MPROTECT */ /* magic numbers --- min free bytes to consider a free apr_pool_t block useable, @@ -141,8 +163,12 @@ #define BLOCK_MINALLOC 0 #endif /* ALLOC_USE_MALLOC */ -#define APR_SLACK_LOW 1 -#define APR_SLACK_HIGH 2 +#ifdef DEBUG_WITH_MPROTECT +#ifndef ALLOC_USE_MALLOC +#error "ALLOC_USE_MALLOC must be enabled to use DEBUG_WITH_MPROTECT" +#endif +#include +#endif /***************************************************************** @@ -238,11 +264,62 @@ static APR_INLINE void debug_verify_filled(const char *ptr, const char *endp, #define debug_verify_filled(a,b,c) #endif /* ALLOC_DEBUG */ +#ifdef DEBUG_WITH_MPROTECT + +#define SIZEOF_BLOCK(p) (((union block_hdr *)(p) - 1)->a.l) + +static void *mprotect_malloc(apr_size_t size) +{ + union block_hdr * addr; + + size += sizeof(union block_hdr); + addr = mmap(NULL, size + sizeof(union block_hdr), + PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, + -1, 0); + if (addr == MAP_FAILED) + return NULL; + addr->a.l = size; + return addr + 1; +} + +static void mprotect_free(void *addr) +{ + apr_size_t size = SIZEOF_BLOCK(addr); + int rv = mprotect((union block_hdr *)addr - 1, size, PROT_NONE); + if (rv != 0) { + fprintf(stderr, "could not protect. errno=%d\n", errno); + abort(); + } +} + +static void *mprotect_realloc(void *addr, apr_size_t size) +{ + void *new_addr = mprotect_malloc(size); + apr_size_t old_size = SIZEOF_BLOCK(addr); + + if (size < old_size) + old_size = size; + memcpy(new_addr, addr, old_size); + mprotect_free(addr); + return new_addr; +} + +#define DO_MALLOC(s) mprotect_malloc(s) +#define DO_FREE(p) mprotect_free(p) +#define DO_REALLOC(p,s) mprotect_realloc(p,s) + +#else /* DEBUG_WITH_MPROTECT */ + +#define DO_MALLOC(s) malloc(s) +#define DO_FREE(p) free(p) +#define DO_REALLOC(p,s) realloc(p,s) + +#endif /* DEBUG_WITH_MPROTECT */ + /* * Get a completely new block from the system pool. Note that we rely on * malloc() to provide aligned memory. */ - static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) { union block_hdr *blok; @@ -259,7 +336,7 @@ static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) num_malloc_bytes += size + sizeof(union block_hdr); #endif /* ALLOC_STATS */ - blok = (union block_hdr *) malloc(size + sizeof(union block_hdr)); + blok = (union block_hdr *) DO_MALLOC(size + sizeof(union block_hdr)); APR_ABORT(blok == NULL, APR_ENOMEM, apr_abort, "Ouch! malloc failed in malloc_block()\n"); debug_fill(blok, size + sizeof(union block_hdr)); @@ -311,7 +388,7 @@ static void free_blocks(union block_hdr *blok) for ( ; blok; blok = next) { next = blok->h.next; - free(blok); + DO_FREE(blok); } #else /* ALLOC_USE_MALLOC */ @@ -395,7 +472,6 @@ static void free_blocks(union block_hdr *blok) * Get a new block, from our own free list if possible, from the system * if necessary. Must be called with alarms blocked. */ - static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) { union block_hdr **lastptr = &block_freelist; @@ -766,7 +842,7 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *a) for (c = a->allocation_list; c; c = n) { n = *(void **)c; - free(c); + DO_FREE(c); } a->allocation_list = NULL; } @@ -947,7 +1023,7 @@ APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) apr_size_t size = reqsize + CLICK_SZ; void *ptr; - ptr = malloc(size); + ptr = DO_MALLOC(size); if (ptr == NULL) { fputs("Ouch! Out of memory!\n", stderr); exit(1); @@ -1104,7 +1180,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) char *ptr; size = (char *)ps->vbuff.curpos - ps->base; - ptr = realloc(ps->base, 2*size); + ptr = DO_REALLOC(ps->base, 2*size); if (ptr == NULL) { fputs("Ouch! Out of memory!\n", stderr); exit(1); @@ -1164,7 +1240,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) struct psprintf_data ps; void *ptr; - ps.base = malloc(512); + ps.base = DO_MALLOC(512); if (ps.base == NULL) { fputs("Ouch! Out of memory!\n", stderr); exit(1); @@ -1176,7 +1252,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) *ps.vbuff.curpos++ = '\0'; ptr = ps.base; /* shrink */ - ptr = realloc(ptr, (char *)ps.vbuff.curpos - (char *)ptr); + ptr = DO_REALLOC(ptr, (char *)ps.vbuff.curpos - (char *)ptr); if (ptr == NULL) { fputs("Ouch! Out of memory!\n", stderr); exit(1); From cf47c683c0c4ea24de0426e823e509fb0cc1702d Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Thu, 26 Apr 2001 21:29:00 +0000 Subject: [PATCH 1560/7878] *) Make the apr_pool_t structure private. *) rename apr_set_abort (in apr_general.h) to apr_pool_set_abort (in apr_pools.h) *) add apr_pool_get_abort (used in apr-util/xml/apr_xml.c) *) add apr_abortfunc_t type and use throughout *) some simplifications within apr_pools.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61551 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 13 ----- include/apr_pools.h | 56 +++++++++------------- lib/apr_pools.c | 102 ++++++++++++++++++++++++++++------------ memory/unix/apr_pools.c | 102 ++++++++++++++++++++++++++++------------ misc/unix/start.c | 6 --- 5 files changed, 163 insertions(+), 116 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index f49ba6c0cd7..4d62d42d807 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -174,19 +174,6 @@ APR_DECLARE(apr_status_t) apr_initialize(void); */ APR_DECLARE(void) apr_terminate(void); -/** - * Set the APR_ABORT function. - * @tip This is in for backwards compatability. If the program using - * APR wants APR to exit on a memory allocation error, then this - * function should be called to set the function to use in order - * to actually exit the program. If this function is not called, - * then APR will return an error and expect the calling program to - * deal with the error accordingly. - * @deffunc apr_status_t apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont) - */ -APR_DECLARE(apr_status_t) apr_set_abort(int (*apr_abort)(int retcode), - apr_pool_t *cont); - #ifdef __cplusplus } #endif diff --git a/include/apr_pools.h b/include/apr_pools.h index 9419c0e9028..10449e7cbe4 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -89,46 +89,13 @@ extern "C" { /* #define APR_POOL_DEBUG -#define ALLOC_USE_MALLOC */ /** The fundamental pool type */ typedef struct apr_pool_t apr_pool_t; -/** The memory allocation structure - */ -struct apr_pool_t { - /** The first block in this pool. */ - union block_hdr *first; - /** The last block in this pool. */ - union block_hdr *last; - /** The list of cleanups to run on pool cleanup. */ - struct cleanup *cleanups; - /** A list of processes to kill when this pool is cleared */ - struct process_chain *subprocesses; - /** The first sub_pool of this pool */ - struct apr_pool_t *sub_pools; - /** The next sibling pool */ - struct apr_pool_t *sub_next; - /** The previous sibling pool */ - struct apr_pool_t *sub_prev; - /** The parent pool of this pool */ - struct apr_pool_t *parent; - /** The first free byte in this pool */ - char *free_first_avail; -#ifdef ALLOC_USE_MALLOC - /** The allocation list if using malloc */ - void *allocation_list; -#endif -#ifdef APR_POOL_DEBUG - /** a list of joined pools */ - struct apr_pool_t *joined; -#endif - /** A function to control how pools behave when they receive ENOMEM */ - int (*apr_abort)(int retcode); - /** A place to hold user data associated with this pool */ - struct apr_hash_t *prog_data; -}; +/** A function that is called when allocation fails. */ +typedef int (*apr_abortfunc_t)(int retcode); /* pools have nested lifetimes -- sub_pools are destroyed when the * parent pool is cleared. We allow certain liberties with operations @@ -225,6 +192,25 @@ APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp); APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont); +/** + * Set the function to be called when an allocation failure occurs. + * @tip If the program wants APR to exit on a memory allocation error, + * then this function can be called to set the callback to use (for + * performing cleanup and then exiting). If this function is not called, + * then APR will return an error and expect the calling program to + * deal with the error accordingly. + * @deffunc apr_status_t apr_pool_set_abort(apr_abortfunc_t abortfunc, apr_pool_t *pool) + */ +APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abortfunc, + apr_pool_t *pool); + +/** + * Get the abort function associated with the specified pool. + * @param pool The pool for retrieving the abort function. + * @deffunc apr_abortfunc_t apr_pool_get_abort(apr_pool_t *pool) + */ +APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool); + /** * Set the data associated with the current pool * @param data The user data associated with the pool. diff --git a/lib/apr_pools.c b/lib/apr_pools.c index bcdcf25de93..4763b447e52 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -131,6 +131,7 @@ /* #define ALLOC_DEBUG #define ALLOC_STATS +#define ALLOC_USE_MALLOC #define DEBUG_WITH_MPROTECT */ @@ -171,6 +172,42 @@ #endif +/** The memory allocation structure + */ +struct apr_pool_t { + /** The first block in this pool. */ + union block_hdr *first; + /** The last block in this pool. */ + union block_hdr *last; + /** The list of cleanups to run on pool cleanup. */ + struct cleanup *cleanups; + /** A list of processes to kill when this pool is cleared */ + struct process_chain *subprocesses; + /** The first sub_pool of this pool */ + struct apr_pool_t *sub_pools; + /** The next sibling pool */ + struct apr_pool_t *sub_next; + /** The previous sibling pool */ + struct apr_pool_t *sub_prev; + /** The parent pool of this pool */ + struct apr_pool_t *parent; + /** The first free byte in this pool */ + char *free_first_avail; +#ifdef ALLOC_USE_MALLOC + /** The allocation list if using malloc */ + void *allocation_list; +#endif +#ifdef APR_POOL_DEBUG + /** a list of joined pools */ + struct apr_pool_t *joined; +#endif + /** A function to control how pools behave when they receive ENOMEM */ + int (*apr_abort)(int retcode); + /** A place to hold user data associated with this pool */ + struct apr_hash_t *prog_data; +}; + + /***************************************************************** * * Managing free storage blocks... @@ -207,16 +244,6 @@ union block_hdr { } h; }; -#define APR_ABORT(conditional, retcode, func, str) \ - if (conditional) { \ - if ((func) == NULL) { \ - return NULL; \ - } \ - else { \ - fprintf(stderr, "%s", str); \ - (*(func))(retcode); \ - } \ - } /* * Static cells for managing our internal synchronisation. @@ -320,7 +347,7 @@ static void *mprotect_realloc(void *addr, apr_size_t size) * Get a completely new block from the system pool. Note that we rely on * malloc() to provide aligned memory. */ -static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) +static union block_hdr *malloc_block(int size, apr_abortfunc_t abortfunc) { union block_hdr *blok; @@ -337,8 +364,15 @@ static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) #endif /* ALLOC_STATS */ blok = (union block_hdr *) DO_MALLOC(size + sizeof(union block_hdr)); - APR_ABORT(blok == NULL, APR_ENOMEM, apr_abort, - "Ouch! malloc failed in malloc_block()\n"); + if (blok == NULL) { + /* ### keep this fprintf here? */ + fprintf(stderr, "Ouch! malloc failed in malloc_block()\n"); + if (abortfunc != NULL) { + (void) (*abortfunc)(APR_ENOMEM); + } + return NULL; + } + debug_fill(blok, size + sizeof(union block_hdr)); blok->h.next = NULL; @@ -472,7 +506,7 @@ static void free_blocks(union block_hdr *blok) * Get a new block, from our own free list if possible, from the system * if necessary. Must be called with alarms blocked. */ -static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) +static union block_hdr *new_block(int min_size, apr_abortfunc_t abortfunc) { union block_hdr **lastptr = &block_freelist; union block_hdr *blok = block_freelist; @@ -500,7 +534,7 @@ static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) min_size += BLOCK_MINFREE; blok = malloc_block((min_size > BLOCK_MINALLOC) - ? min_size : BLOCK_MINALLOC, apr_abort); + ? min_size : BLOCK_MINALLOC, abortfunc); return blok; } @@ -546,7 +580,8 @@ static apr_pool_t *permanent_pool; #define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int retcode)) +APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, + apr_abortfunc_t abortfunc) { union block_hdr *blok; apr_pool_t *new_pool; @@ -558,7 +593,7 @@ APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int } #endif - blok = new_block(POOL_HDR_BYTES, apr_abort); + blok = new_block(POOL_HDR_BYTES, abortfunc); new_pool = (apr_pool_t *) blok->h.first_avail; blok->h.first_avail += POOL_HDR_BYTES; #ifdef APR_POOL_DEBUG @@ -618,32 +653,37 @@ static void dump_stats(void) #endif /* ### why do we have this, in addition to apr_pool_sub_make? */ -APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, + apr_pool_t *parent_pool) { apr_pool_t *newpool; + apr_abortfunc_t abortfunc; - if (cont) { - newpool = apr_pool_sub_make(cont, cont->apr_abort); - } - else { - newpool = apr_pool_sub_make(NULL, NULL); - } - + abortfunc = parent_pool ? parent_pool->apr_abort : NULL; + + newpool = apr_pool_sub_make(parent_pool, abortfunc); if (newpool == NULL) { return APR_ENOPOOL; } newpool->prog_data = NULL; - if (cont) { - newpool->apr_abort = cont->apr_abort; - } - else { - newpool->apr_abort = NULL; - } + newpool->apr_abort = abortfunc; + *newcont = newpool; return APR_SUCCESS; } +APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abortfunc, + apr_pool_t *pool) +{ + pool->apr_abort = abortfunc; +} + +APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool) +{ + return pool->apr_abort; +} + /***************************************************************** * * Managing generic cleanups. diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index bcdcf25de93..4763b447e52 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -131,6 +131,7 @@ /* #define ALLOC_DEBUG #define ALLOC_STATS +#define ALLOC_USE_MALLOC #define DEBUG_WITH_MPROTECT */ @@ -171,6 +172,42 @@ #endif +/** The memory allocation structure + */ +struct apr_pool_t { + /** The first block in this pool. */ + union block_hdr *first; + /** The last block in this pool. */ + union block_hdr *last; + /** The list of cleanups to run on pool cleanup. */ + struct cleanup *cleanups; + /** A list of processes to kill when this pool is cleared */ + struct process_chain *subprocesses; + /** The first sub_pool of this pool */ + struct apr_pool_t *sub_pools; + /** The next sibling pool */ + struct apr_pool_t *sub_next; + /** The previous sibling pool */ + struct apr_pool_t *sub_prev; + /** The parent pool of this pool */ + struct apr_pool_t *parent; + /** The first free byte in this pool */ + char *free_first_avail; +#ifdef ALLOC_USE_MALLOC + /** The allocation list if using malloc */ + void *allocation_list; +#endif +#ifdef APR_POOL_DEBUG + /** a list of joined pools */ + struct apr_pool_t *joined; +#endif + /** A function to control how pools behave when they receive ENOMEM */ + int (*apr_abort)(int retcode); + /** A place to hold user data associated with this pool */ + struct apr_hash_t *prog_data; +}; + + /***************************************************************** * * Managing free storage blocks... @@ -207,16 +244,6 @@ union block_hdr { } h; }; -#define APR_ABORT(conditional, retcode, func, str) \ - if (conditional) { \ - if ((func) == NULL) { \ - return NULL; \ - } \ - else { \ - fprintf(stderr, "%s", str); \ - (*(func))(retcode); \ - } \ - } /* * Static cells for managing our internal synchronisation. @@ -320,7 +347,7 @@ static void *mprotect_realloc(void *addr, apr_size_t size) * Get a completely new block from the system pool. Note that we rely on * malloc() to provide aligned memory. */ -static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) +static union block_hdr *malloc_block(int size, apr_abortfunc_t abortfunc) { union block_hdr *blok; @@ -337,8 +364,15 @@ static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) #endif /* ALLOC_STATS */ blok = (union block_hdr *) DO_MALLOC(size + sizeof(union block_hdr)); - APR_ABORT(blok == NULL, APR_ENOMEM, apr_abort, - "Ouch! malloc failed in malloc_block()\n"); + if (blok == NULL) { + /* ### keep this fprintf here? */ + fprintf(stderr, "Ouch! malloc failed in malloc_block()\n"); + if (abortfunc != NULL) { + (void) (*abortfunc)(APR_ENOMEM); + } + return NULL; + } + debug_fill(blok, size + sizeof(union block_hdr)); blok->h.next = NULL; @@ -472,7 +506,7 @@ static void free_blocks(union block_hdr *blok) * Get a new block, from our own free list if possible, from the system * if necessary. Must be called with alarms blocked. */ -static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) +static union block_hdr *new_block(int min_size, apr_abortfunc_t abortfunc) { union block_hdr **lastptr = &block_freelist; union block_hdr *blok = block_freelist; @@ -500,7 +534,7 @@ static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) min_size += BLOCK_MINFREE; blok = malloc_block((min_size > BLOCK_MINALLOC) - ? min_size : BLOCK_MINALLOC, apr_abort); + ? min_size : BLOCK_MINALLOC, abortfunc); return blok; } @@ -546,7 +580,8 @@ static apr_pool_t *permanent_pool; #define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int retcode)) +APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, + apr_abortfunc_t abortfunc) { union block_hdr *blok; apr_pool_t *new_pool; @@ -558,7 +593,7 @@ APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, int (*apr_abort)(int } #endif - blok = new_block(POOL_HDR_BYTES, apr_abort); + blok = new_block(POOL_HDR_BYTES, abortfunc); new_pool = (apr_pool_t *) blok->h.first_avail; blok->h.first_avail += POOL_HDR_BYTES; #ifdef APR_POOL_DEBUG @@ -618,32 +653,37 @@ static void dump_stats(void) #endif /* ### why do we have this, in addition to apr_pool_sub_make? */ -APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, + apr_pool_t *parent_pool) { apr_pool_t *newpool; + apr_abortfunc_t abortfunc; - if (cont) { - newpool = apr_pool_sub_make(cont, cont->apr_abort); - } - else { - newpool = apr_pool_sub_make(NULL, NULL); - } - + abortfunc = parent_pool ? parent_pool->apr_abort : NULL; + + newpool = apr_pool_sub_make(parent_pool, abortfunc); if (newpool == NULL) { return APR_ENOPOOL; } newpool->prog_data = NULL; - if (cont) { - newpool->apr_abort = cont->apr_abort; - } - else { - newpool->apr_abort = NULL; - } + newpool->apr_abort = abortfunc; + *newcont = newpool; return APR_SUCCESS; } +APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abortfunc, + apr_pool_t *pool) +{ + pool->apr_abort = abortfunc; +} + +APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool) +{ + return pool->apr_abort; +} + /***************************************************************** * * Managing generic cleanups. diff --git a/misc/unix/start.c b/misc/unix/start.c index 9f90db08d01..096591d3cc4 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -112,9 +112,3 @@ APR_DECLARE(void) apr_terminate(void) } apr_pool_alloc_term(global_apr_pool); } - -APR_DECLARE(apr_status_t) apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont) -{ - cont->apr_abort = apr_abort; - return APR_SUCCESS; -} From 4021e5505a3cf2453b2c3d33d297ae7982a0e5c3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 27 Apr 2001 00:16:03 +0000 Subject: [PATCH 1561/7878] Fix DSO support on HPUX. We have to use ==, not = and it helps to return errno so that debugging is easier. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61552 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ dso/unix/dso.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 33cfc29141e..9eeba990cb8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Fix DSO code on HP/UX. We have to use == not =, and it makes more + sense to actually return errno, so that the return code means + something. [Ryan Bloom] + *) Clean up conditionals in unix DSO code so that we decide based on the dynamic loading implementation, which we noticed at configure time, instead of by operating system. diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 679b6ba46b0..a23b5223e55 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -180,8 +180,8 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, status = shl_findsym((shl_t *)&handle->handle, symname, TYPE_PROCEDURE, &symaddr); if (status == -1 && errno == 0) /* try TYPE_DATA instead */ status = shl_findsym((shl_t *)&handle->handle, symname, TYPE_DATA, &symaddr); - if (status = -1) - return APR_EINIT; + if (status == -1) + return errno; *ressym = symaddr; return APR_SUCCESS; From 2a9dc7d1f7617bf04d8d6b87c0227c5ba8adaa55 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Fri, 27 Apr 2001 03:46:15 +0000 Subject: [PATCH 1562/7878] *) add apr_pool_get_parent() function. *) add "recurse" parameter to apr_pool_num_bytes() function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61553 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 12 +++++++++++- lib/apr_pools.c | 16 ++++++++++++++-- memory/unix/apr_pools.c | 16 ++++++++++++++-- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 10449e7cbe4..b1a6ea6a28e 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -207,10 +207,19 @@ APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abortfunc, /** * Get the abort function associated with the specified pool. * @param pool The pool for retrieving the abort function. + * @return The abort function for the given pool. * @deffunc apr_abortfunc_t apr_pool_get_abort(apr_pool_t *pool) */ APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool); +/** + * Get the parent pool of the specified pool. + * @param pool The pool for retrieving the parent pool. + * @return The parent of the given pool. + * @deffunc apr_pool_t * apr_pool_get_parent(apr_pool_t *pool) + */ +APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool); + /** * Set the data associated with the current pool * @param data The user data associated with the pool. @@ -272,9 +281,10 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); /** * Report the number of bytes currently in the pool * @param p The pool to inspect + * @param recurse Recurse/include the subpools' sizes * @return The number of bytes */ -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p); +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse); /** * Report the number of bytes currently in the list of free blocks diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 4763b447e52..7d34df7ffc9 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -684,6 +684,11 @@ APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool) return pool->apr_abort; } +APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool) +{ + return pool->parent; +} + /***************************************************************** * * Managing generic cleanups. @@ -936,10 +941,17 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) free_blocks(blok); } -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p) +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse) { - return bytes_in_block_list(p->first); + apr_size_t total_bytes = bytes_in_block_list(p->first); + + if (recurse) + for (p = p->sub_pools; p != NULL; p = p->sub_next) + total_bytes += apr_pool_num_bytes(p, 1); + + return total_bytes; } + APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void) { return bytes_in_block_list(block_freelist); diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 4763b447e52..7d34df7ffc9 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -684,6 +684,11 @@ APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool) return pool->apr_abort; } +APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool) +{ + return pool->parent; +} + /***************************************************************** * * Managing generic cleanups. @@ -936,10 +941,17 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) free_blocks(blok); } -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p) +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse) { - return bytes_in_block_list(p->first); + apr_size_t total_bytes = bytes_in_block_list(p->first); + + if (recurse) + for (p = p->sub_pools; p != NULL; p = p->sub_next) + total_bytes += apr_pool_num_bytes(p, 1); + + return total_bytes; } + APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void) { return bytes_in_block_list(block_freelist); From 26052f59da2cdfe7fb26ca672eedbd79b502839b Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 27 Apr 2001 04:06:51 +0000 Subject: [PATCH 1563/7878] This changes the TCP_NODELAY test to use the loopback address on BeOS as otherwise the test hangs and eventually fails, giving the impression that configure has hung. Not sure if this should be applied to other platforms as well so the #ifdef's. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61554 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index ebe5e6b1b3f..ecbf36e3dff 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -186,6 +186,9 @@ int main(void) { } memset(&sa, 0, sizeof sa); sa.sin_family = AF_INET; +#ifdef BEOS + sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); +#endif /* leave port 0 to get ephemeral */ rc = bind(listen_s, (struct sockaddr *)&sa, sizeof sa); if (rc < 0) { @@ -213,6 +216,9 @@ int main(void) { memset(&sa, 0, sizeof sa); sa.sin_family = AF_INET; sa.sin_port = listen_port; +#ifdef BEOS + sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); +#endif /* leave sin_addr all zeros to use loopback */ rc = connect(client_s, (struct sockaddr *)&sa, sizeof sa); if (rc < 0) { From 1ff82c542e4a12f656f301d854fd78f4c0bbda30 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Fri, 27 Apr 2001 13:01:59 +0000 Subject: [PATCH 1564/7878] Make ap_snprintf() more robust against border situations with floating point numbers. Submitted by: Lukas Schroeder git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61555 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 0499531e980..f001a104131 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -157,7 +157,7 @@ static char *apr_cvt(double arg, int ndigits, int *decpt, int *sign, */ if (fi != 0) { p1 = &buf[NDIG]; - while (fi != 0) { + while (p1 > &buf[0] && fi != 0) { fj = modf(fi / 10, &fi); *--p1 = (int) ((fj + .03) * 10) + '0'; r2++; @@ -954,15 +954,25 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * * We use &num_buf[ 1 ], so that we have room for the sign */ - s = conv_fp(*fmt, fp_num, alternate_form, - (adjust_precision == NO) ? FLOAT_DIGITS : precision, - &is_negative, &num_buf[1], &s_len); - if (is_negative) - prefix_char = '-'; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; + if (isnan(fp_num)) { + s = "nan"; + s_len = 3; + } + else if (isinf(fp_num)) { + s = "inf"; + s_len = 3; + } + else { + s = conv_fp(*fmt, fp_num, alternate_form, + (adjust_precision == NO) ? FLOAT_DIGITS : precision, + &is_negative, &num_buf[1], &s_len); + if (is_negative) + prefix_char = '-'; + else if (print_sign) + prefix_char = '+'; + else if (print_blank) + prefix_char = ' '; + } break; From fd0cb56e042dfef17341adeb36f14d37e8a0fd45 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 27 Apr 2001 15:43:56 +0000 Subject: [PATCH 1565/7878] This change gets BeOS building again. We have sigsuspend but we certainly don't have pthread_ so we need to use sigprocmask the same as OS/390. Also, change where the libraries are added. This may not be right, but with this change it's possible to get APR building as a shared library. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61556 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 266296b335e..a0612887586 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -363,9 +363,9 @@ dnl # Not a problem in 10.20. Otherwise, who knows? PLATOSVERS=`uname -r` case $PLATOSVERS in 5.1) - APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) - APR_ADDTO(LDFLAGS, [-nodefaultlibs -L/boot/develop/lib/x86 -L/boot/beos/system/lib]) - APR_ADDTO(EXTRA_LIBS, [-lbind -lsocket -lbe -lroot]) + APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone -DSIGPROCMASK_SETS_THREAD_MASK]) + APR_ADDTO(LDFLAGS, [-L/boot/develop/lib/x86 -L/boot/beos/system/lib -lbind -lsocket]) + APR_ADDTO(LIBS, [-lbind -lsocket -lbe -lroot]) ;; esac ;; From a13ead6fc67cae9f2e3c7a16fdb358b9fd30a304 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 27 Apr 2001 18:36:06 +0000 Subject: [PATCH 1566/7878] Get apr_snprintf() compiling again on platforms without isnan() or isinf(). (Such platforms include Solaris and OS/390.) Submitted by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61557 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- strings/apr_snprintf.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 74fefc240cf..36441bca13e 100644 --- a/configure.in +++ b/configure.in @@ -390,7 +390,7 @@ AC_CHECK_LIB(m,modf) dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) -AC_CHECK_FUNCS(strcasecmp stricmp setsid nl_langinfo) +AC_CHECK_FUNCS(strcasecmp stricmp setsid nl_langinfo isinf isnan) AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) AC_CHECK_FUNCS(writev) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index f001a104131..aec8d740c03 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -952,17 +952,22 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), case 'E': fp_num = va_arg(ap, double); /* - * * We use &num_buf[ 1 ], so that we have room for the sign + * We use &num_buf[ 1 ], so that we have room for the sign */ + s = NULL; +#ifdef HAVE_ISNAN if (isnan(fp_num)) { s = "nan"; s_len = 3; } - else if (isinf(fp_num)) { +#endif +#ifdef HAVE_ISINF + if (!s && isinf(fp_num)) { s = "inf"; s_len = 3; } - else { +#endif + if (!s) { s = conv_fp(*fmt, fp_num, alternate_form, (adjust_precision == NO) ? FLOAT_DIGITS : precision, &is_negative, &num_buf[1], &s_len); From b3bc809d4158bb8560f85524a87fd25ceb67b0ef Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 27 Apr 2001 19:00:46 +0000 Subject: [PATCH 1567/7878] implement apr_os_dso_handle_get() and apr_os_dso_handle_put() for OS/390; also, store the pool pointer in the apr_dso_handle_t in an existing path git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61558 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os390/dso.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/dso/os390/dso.c b/dso/os390/dso.c index 02a2970bf9d..feeeaa0d2f8 100644 --- a/dso/os390/dso.c +++ b/dso/os390/dso.c @@ -52,6 +52,7 @@ * . */ +#include "apr_portable.h" #include "apr_strings.h" #include "dso.h" #include @@ -59,6 +60,23 @@ #if APR_HAS_DSO +APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, + apr_os_dso_handle_t osdso, + apr_pool_t *pool) +{ + *aprdso = apr_pcalloc(pool, sizeof **aprdso); + (*aprdso)->handle = osdso; + (*aprdso)->pool = pool; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *osdso, + apr_dso_handle_t *aprdso) +{ + *osdso = aprdso->handle; + return APR_SUCCESS; +} + static apr_status_t dso_cleanup(void *thedso) { apr_dso_handle_t *dso = thedso; @@ -84,7 +102,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, int rc; *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); - + (*res_handle)->pool = ctx; if ((handle = dllload(path)) != NULL) { (*res_handle)->handle = handle; apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); From 4f78d7e63f20f62a224ede99857a0419dc1f7653 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Fri, 27 Apr 2001 20:01:34 +0000 Subject: [PATCH 1568/7878] Vegas, baby! Vegas! T-8 hrs and counting... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61559 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index da00c65166f..c0913921980 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/04/12 15:30:46 $] +Last modified at [$Date: 2001/04/27 20:01:34 $] Release: @@ -29,6 +29,7 @@ RELEASE SHOWSTOPPERS: DougM offered to complete the work with his nifty perl rename script at the hackathon. + RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Unconditionally setting AI_CANONNAME flag when apr_sockaddr_info_get() @@ -129,10 +130,20 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * may be good to have a --disable-ipv6 configure option + * add a pool argument to setaside() to tell a bucket "do whatever + you need to do, to ensure that you survive as long as this + pool." Immortal and heap buckets never have work. File, socket, + mmap, pipe, and pool buckets can do nothing if the given pool is + equal to, or a descendent of the pool they are using. Apache's + core_output_filter can then say "setside(conn->pool)" to ensure + that a saved brigade will last as long as the connection. + + Documentation that needs writing: * API documentation + Stuff waiting for code thawing after Beta 1: * Implement APR_FINFO_ICASE/APR_FINFO_NAME for stat'ish calls. From 1679e95cd441ff284787ace4634a419d81b976af Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sun, 29 Apr 2001 05:22:16 +0000 Subject: [PATCH 1569/7878] Completely revamp configure so that it preserves the standard make variables CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS and LIBS by moving the configure additions to EXTRA_* variables. Also, allow the user to specify NOTEST_* values for all of the above, which eliminates the need for THREAD_CPPFLAGS, THREAD_CFLAGS, and OPTIM. Fix the setting of INCLUDES and EXTRA_INCLUDES. Check flags as they are added to avoid pointless duplications. Fix the order in which flags are given on the compile and link lines. The Makefile.in in the test directory hasn't been updated in ages, but that will have to wait. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61560 13f79535-47bb-0310-9956-ffa450edef68 --- APRVARS.in | 10 ++-- CHANGES | 9 +++ build/apr_common.m4 | 135 ++++++++++++++++++++++++++++-------------- build/apr_hints.m4 | 40 ++++++------- build/apr_threads.m4 | 27 +++++++-- build/rules.mk.in | 47 ++++++++++++--- configure.in | 103 +++++++++++++++++++------------- test/MakeWin32Make.pl | 1 - test/Makefile.in | 52 ++++++++-------- 9 files changed, 270 insertions(+), 154 deletions(-) diff --git a/APRVARS.in b/APRVARS.in index dc207e42704..5852a30fa58 100644 --- a/APRVARS.in +++ b/APRVARS.in @@ -1,4 +1,6 @@ -EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS @THREAD_CPPFLAGS@" -EXTRA_CFLAGS="$EXTRA_CFLAGS @THREAD_CFLAGS@" -EXTRA_LIBS="$EXTRA_LIBS @LIBS@" -LIBTOOL_LIBS="$LIBTOOL_LIBS @LIBTOOL_LIBS@" +EXTRA_CPPFLAGS="@EXTRA_CPPFLAGS@" +EXTRA_CFLAGS="@EXTRA_CFLAGS@" +EXTRA_LDFLAGS="@EXTRA_LDFLAGS@" +EXTRA_LIBS="@EXTRA_LIBS@" +EXTRA_INCLUDES="@EXTRA_INCLUDES@" +LIBTOOL_LIBS="@LIBTOOL_LIBS@" diff --git a/CHANGES b/CHANGES index 9eeba990cb8..56558ea1c9f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,14 @@ Changes with APR b1 + *) Completely revamp configure so that it preserves the standard make + variables CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS and LIBS by moving + the configure additions to EXTRA_* variables. Also, allow the user + to specify NOTEST_* values for all of the above, which eliminates the + need for THREAD_CPPFLAGS, THREAD_CFLAGS, and OPTIM. Fix the setting + of INCLUDES and EXTRA_INCLUDES. Check flags as they are added to + avoid pointless duplications. Fix the order in which flags are given + on the compile and link lines. [Roy Fielding] + *) Fix DSO code on HP/UX. We have to use == not =, and it makes more sense to actually return errno, so that the return code means something. [Ryan Bloom] diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 0140fcd341d..9456ffab643 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -2,6 +2,10 @@ dnl ----------------------------------------------------------------- dnl apr_common.m4: APR's general-purpose autoconf macros dnl +dnl APR_CONFIG_NICE(filename) +dnl +dnl Saves a snapshot of the configure command-line for later reuse +dnl AC_DEFUN(APR_CONFIG_NICE,[ rm -f $1 cat >$1<> $1 + if test -n "$MAKE"; then + echo "MAKE=\"$MAKE\"; export MAKE" >> $1 + fi + if test -n "$CFLAGS"; then + echo "CFLAGS=\"$CFLAGS\"; export CFLAGS" >> $1 + fi + if test -n "$CPPFLAGS"; then + echo "CPPFLAGS=\"$CPPFLAGS\"; export CPPFLAGS" >> $1 + fi + if test -n "$LDFLAGS"; then + echo "LDFLAGS=\"$LDFLAGS\"; export LDFLAGS" >> $1 + fi + if test -n "$LIBS"; then + echo "LIBS=\"$LIBS\"; export LIBS" >> $1 + fi + if test -n "$INCLUDES"; then + echo "INCLUDES=\"$INCLUDES\"; export INCLUDES" >> $1 + fi + if test -n "$NOTEST_CFLAGS"; then + echo "NOTEST_CFLAGS=\"$NOTEST_CFLAGS\"; export NOTEST_CFLAGS" >> $1 + fi + if test -n "$NOTEST_CPPFLAGS"; then + echo "NOTEST_CPPFLAGS=\"$NOTEST_CPPFLAGS\"; export NOTEST_CPPFLAGS" >> $1 + fi + if test -n "$NOTEST_LDFLAGS"; then + echo "NOTEST_LDFLAGS=\"$NOTEST_LDFLAGS\"; export NOTEST_LDFLAGS" >> $1 + fi + if test -n "$NOTEST_LIBS"; then + echo "NOTEST_LIBS=\"$NOTEST_LIBS\"; export NOTEST_LIBS" >> $1 fi for arg in [$]0 "[$]@"; do @@ -19,7 +50,7 @@ EOF done echo '"[$]@"' >> $1 chmod +x $1 -]) +])dnl dnl dnl APR_SUBDIR_CONFIG(dir [, sub-package-cmdline-args]) @@ -62,37 +93,39 @@ changequote([, ])dnl AC_CACHE_LOAD ])dnl - dnl -dnl APR_DOEXTRA -dnl -dnl Handle the use of EXTRA_* variables. -dnl Basically, EXTRA_* vars are added to the -dnl current settings of their "parents". We -dnl can expand as needed for additional -dnl EXTRA_* variables by adding them to the -dnl "for i in..." line. -dnl -dnl To handle recursive configures, the 1st time -dnl through we need to null out EXTRA_* and then -dnl export the lot of them, since we want/need -dnl them to exist in the sub-configures' environment. -dnl The nasty eval's allow us to use the 'for' -dnl construct and save some lines of code. -dnl -AC_DEFUN(APR_DOEXTRA, [ - for i in CFLAGS CPPFLAGS LDFLAGS LIBS - do - eval APR_TMP=\$EXTRA_$i - if test -n "$APR_TMP"; then - eval $i=\"\$$i $APR_TMP\" - eval export $i - eval unset EXTRA_${i} - eval export EXTRA_${i} - fi - done -]) +dnl APR_SAVE_THE_ENVIRONMENT(variable_name) +dnl +dnl Stores the variable (usually a Makefile macro) for later restoration +dnl +AC_DEFUN(APR_SAVE_THE_ENVIRONMENT,[ + apr_ste_save_$1="$$1" +])dnl +dnl +dnl APR_RESTORE_THE_ENVIRONMENT(variable_name, prefix_) +dnl +dnl Uses the previously saved variable content to figure out what configure +dnl has added to the variable, moving the new bits to prefix_variable_name +dnl and restoring the original variable contents. This makes it possible +dnl for a user to override configure when it does something stupid. +dnl +AC_DEFUN(APR_RESTORE_THE_ENVIRONMENT,[ +if test "x$apr_ste_save_$1" = "x"; then + $2$1="$$1" + $1= +else + if test "x$apr_ste_save_$1" = "x$$1"; then + $2$1= + else + $2$1=`echo $$1 | sed -e "s%${apr_ste_save_$1}%%"` + $1="$apr_ste_save_$1" + fi +fi +echo " restoring $1 to \"$$1\"" +echo " setting $2$1 to \"$$2$1\"" +AC_SUBST($2$1) +])dnl dnl dnl APR_SETIFNULL(variable, value) @@ -101,11 +134,10 @@ dnl Set variable iff it's currently null dnl AC_DEFUN(APR_SETIFNULL,[ if test -z "$$1"; then - echo " Setting $1 to \"$2\"" - $1="$2"; export $1 + echo " setting $1 to \"$2\"" + $1="$2" fi -]) - +])dnl dnl dnl APR_SETVAR(variable, value) @@ -113,10 +145,9 @@ dnl dnl Set variable no matter what dnl AC_DEFUN(APR_SETVAR,[ - echo " Forcing $1 to \"$2\"" - $1="$2"; export $1 -]) - + echo " forcing $1 to \"$2\"" + $1="$2" +])dnl dnl dnl APR_ADDTO(variable, value) @@ -124,10 +155,26 @@ dnl dnl Add value to variable dnl AC_DEFUN(APR_ADDTO,[ - echo " Adding \"$2\" to $1" - $1="$$1 $2"; export $1 -]) - + if test "x$$1" = "x"; then + echo " setting $1 to \"$2\"" + $1="$2" + else + apr_addto_bugger="$2" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $$1; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + echo " adding \"$i\" to $1" + $1="$$1 $i" + fi + done + fi +])dnl dnl dnl APR_CHECK_DEFINE_FILES( symbol, header_file [header_file ...] ) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index a0612887586..5df991aa1fc 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -88,7 +88,7 @@ else APR_ADDTO(CFLAGS, [-qHALT=E -qLANGLVL=extended]) fi APR_SETIFNULL(apr_iconv_inbuf_const, [1]) - APR_ADDTO(THREAD_CPPFLAGS, [-D_THREAD_SAFE]) + APR_ADDTO(CPPFLAGS, [-D_THREAD_SAFE]) ;; *-apollo-*) APR_ADDTO(CPPFLAGS, [-DAPOLLO]) @@ -103,8 +103,7 @@ else APR_ADDTO(CPPFLAGS, [-DHIUX]) ;; *-hp-hpux11.*) - APR_ADDTO(CPPFLAGS, [-DHPUX11]) - APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) + APR_ADDTO(CPPFLAGS, [-DHPUX11 -D_REENTRANT]) ;; *-hp-hpux10.*) case $host in @@ -114,11 +113,10 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DSELECT_NEEDS_CAST]) ;; esac - APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) + APR_ADDTO(CPPFLAGS, [-D_REENTRANT]) ;; *-hp-hpux*) - APR_ADDTO(CPPFLAGS, [-DHPUX]) - APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) + APR_ADDTO(CPPFLAGS, [-DHPUX -D_REENTRANT]) ;; *-linux-*) case `uname -r` in @@ -131,7 +129,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? * ) ;; esac - APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) + APR_ADDTO(CPPFLAGS, [-D_REENTRANT]) ;; *-GNU*) APR_ADDTO(CPPFLAGS, [-DHURD]) @@ -145,7 +143,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CFLAGS, [-m486]) ;; *-openbsd*) - APR_ADDTO(THREAD_CPPFLAGS, [-D_POSIX_THREADS]) + APR_ADDTO(CPPFLAGS, [-D_POSIX_THREADS]) ;; *-netbsd*) APR_ADDTO(CPPFLAGS, [-DNETBSD]) @@ -159,15 +157,15 @@ dnl # Not a problem in 10.20. Otherwise, who knows? esac APR_ADDTO(LIBS, [-lcrypt]) APR_SETIFNULL(enable_threads, [no]) - APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT -D_THREAD_SAFE]) + APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_THREAD_SAFE]) ;; *-next-nextstep*) - APR_SETIFNULL(OPTIM, [-O]) + APR_SETIFNULL(CFLAGS, [-O]) APR_ADDTO(CPPFLAGS, [-DNEXT]) ;; *-next-openstep*) APR_SETVAR(CC, [cc]) - APR_SETIFNULL(OPTIM, [-O]) + APR_SETIFNULL(CFLAGS, [-O]) APR_ADDTO(CPPFLAGS, [-DNEXT]) ;; *-apple-rhapsody*) @@ -196,27 +194,23 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(LIBS, [-linet]) ;; *-sco3*) - APR_ADDTO(CPPFLAGS, [-DSCO]) + APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT]) APR_ADDTO(CFLAGS, [-Oacgiltz]) APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) - APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-sco5*) - APR_ADDTO(CPPFLAGS, [-DSCO5]) + APR_ADDTO(CPPFLAGS, [-DSCO5 -D_REENTRANT]) APR_ADDTO(LIBS, [-lsocket -lmalloc -lprot -ltinfo -lx]) - APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-sco_sv*|*-SCO_SV*) - APR_ADDTO(CPPFLAGS, [-DSCO]) + APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT]) APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) - APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT]) ;; *-solaris2*) PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` - APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS]) + APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT]) APR_ADDTO(LIBS, [-lsocket -lnsl]) APR_SETIFNULL(apr_iconv_inbuf_const, [1]) - APR_ADDTO(THREAD_CPPFLAGS, [-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT]) ;; *-sunos4*) APR_ADDTO(CPPFLAGS, [-DSUNOS4 -DUSEBCOPY]) @@ -310,8 +304,8 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *convex-v11*) APR_ADDTO(CPPFLAGS, [-DCONVEXOS11]) + APR_SETIFNULL(CFLAGS, [-O1]) APR_ADDTO(CFLAGS, [-ext]) - APR_SETIFNULL(OPTIM, [-O1]) APR_SETVAR(CC, [cc]) ;; i860-intel-osf1) @@ -352,11 +346,11 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-riscix) APR_ADDTO(CPPFLAGS, [-DRISCIX]) - APR_SETIFNULL(OPTIM, [-O]) + APR_SETIFNULL(CFLAGS, [-O]) APR_SETIFNULL(MAKE, [make]) ;; *-irix*) - APR_ADDTO(THREAD_CPPFLAGS, [-D_POSIX_THREAD_SAFE_FUNCTIONS]) + APR_ADDTO(CPPFLAGS, [-D_POSIX_THREAD_SAFE_FUNCTIONS]) ;; *beos*) APR_ADDTO(CPPFLAGS, [-DBEOS]) @@ -393,6 +387,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-U_NO_PROTO -DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR -DPTHREAD_SETS_ERRNO -DPTHREAD_DETACH_ARG1_ADDR -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1]) ;; esac - APR_DOEXTRA + fi ]) diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index 95f744ce5e1..ad96d115e57 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -109,7 +109,6 @@ fi if test -n "$ac_cv_pthreads_cflags"; then CFLAGS="$CFLAGS $ac_cv_pthreads_cflags" - THREAD_CFLAGS="$THREAD_CFLAGS $ac_cv_pthreads_cflags" fi APR_PTHREADS_CHECK_COMPILE @@ -123,8 +122,6 @@ if test "$pthreads_working" != "yes"; then APR_PTHREADS_CHECK_COMPILE if test "$pthreads_working" = "yes"; then ac_cv_pthreads_cflags="$flag" - dnl this was already added to CFLAGS; add to THREAD_CFLAGS, too - THREAD_CFLAGS="$THREAD_CFLAGS $ac_cv_pthreads_cflags" break fi CFLAGS="$ac_save" @@ -132,7 +129,6 @@ if test "$pthreads_working" != "yes"; then fi ]) - AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[ ac_cv_pthreads_lib="" if test "$pthreads_working" != "yes"; then @@ -156,6 +152,27 @@ else fi ])dnl +dnl +dnl APR_PTHREADS_CHECK_SAVE +dnl APR_PTHREADS_CHECK_RESTORE +dnl +dnl Save the global environment variables that might be modified during +dnl the checks for threading support so that they can restored if the +dnl result is not what the caller wanted. +dnl +AC_DEFUN(APR_PTHREADS_CHECK_SAVE, [ + apr_pthsv_CFLAGS="$CFLAGS" + apr_pthsv_LIBS="$LIBS" +])dnl + +AC_DEFUN(APR_PTHREADS_CHECK_RESTORE, [ + CFLAGS="$apr_pthsv_CFLAGS" + LIBS="$apr_pthsv_LIBS" +])dnl + +dnl +dnl APR_CHECK_SIGWAIT_ONE_ARG +dnl AC_DEFUN(APR_CHECK_SIGWAIT_ONE_ARG,[ AC_CACHE_CHECK(whether sigwait takes one argument,ac_cv_sigwait_one_arg,[ AC_TRY_COMPILE([ @@ -179,4 +196,4 @@ AC_DEFUN(APR_CHECK_SIGWAIT_ONE_ARG,[ if test "$ac_cv_sigwait_one_arg" = "yes"; then AC_DEFINE(SIGWAIT_TAKES_ONE_ARG,1,[ ]) fi -]) +]) diff --git a/build/rules.mk.in b/build/rules.mk.in index 268e326be3c..08d5b2233cc 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -65,17 +65,48 @@ top_builddir=@top_builddir@ apr_builders=@apr_builders@ CC=@CC@ +RM=@RM@ AWK=@AWK@ +SHELL=@SHELL@ LIBTOOL=@LIBTOOL@ -CFLAGS=@CFLAGS@ -OPTIM=@OPTIM@ +# compilation and linking flags that are supposed to be set only by the user. +# configure adds to them for tests, but we restore them at the end. +# CPPFLAGS=@CPPFLAGS@ -LIBS=@LIBS@ +CFLAGS=@CFLAGS@ LDFLAGS=@LDFLAGS@ +LIBS=@LIBS@ +DEFS=@DEFS@ -RM=@RM@ -SHELL=@SHELL@ +# anything added to the standard flags by configure is moved to EXTRA_* +# at the end of the process. +# +EXTRA_CPPFLAGS=@EXTRA_CPPFLAGS@ +EXTRA_CFLAGS=@EXTRA_CFLAGS@ +EXTRA_LDFLAGS=@EXTRA_LDFLAGS@ +EXTRA_LIBS=@EXTRA_LIBS@ +EXTRA_INCLUDES=@EXTRA_INCLUDES@ + +# NOTEST_* are flags and libraries that can be added by the user without +# causing them to be used in configure tests (necessary for things like +# -Werror and other strict warnings that maintainers like to use). +# +NOTEST_CPPFLAGS=@NOTEST_CPPFLAGS@ +NOTEST_CFLAGS=@NOTEST_CFLAGS@ +NOTEST_LDFLAGS=@NOTEST_LDFLAGS@ +NOTEST_LIBS=@NOTEST_LIBS@ + +# Finally, combine all of the flags together in the proper order so that +# the user-defined flags can always override the configure ones, if needed. +# Note that includes are listed after the flags because -I options have +# left-to-right precedence and CPPFLAGS may include user-defined overrides. +# +ALL_CPPFLAGS = $(DEFS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS) +ALL_CFLAGS = $(EXTRA_CFLAGS) $(NOTEST_CFLAGS) $(CFLAGS) +ALL_LDFLAGS = $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(LDFLAGS) +ALL_LIBS = $(EXTRA_LIBS) $(NOTEST_LIBS) $(LIBS) +ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) ### make LTFLAGS somewhat variable? LTFLAGS = --silent @@ -83,7 +114,7 @@ LTFLAGS = --silent # # Basic macro setup # -COMPILE = $(CC) $(CPPFLAGS) $(INCLUDES) $(OPTIM) $(CFLAGS) +COMPILE = $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(ALL_INCLUDES) LT_COMPILE = @lt_compile@ LINK = @link@ @@ -143,8 +174,8 @@ local-all: $(TARGETS) local-depend: @if test -n "`ls *.c 2> /dev/null`"; then \ - echo $(MKDEP) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) *.c ; \ - $(MKDEP) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) *.c ; \ + echo $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c ; \ + $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c ; \ fi # to be filled in by the actual Makefile diff --git a/configure.in b/configure.in index 36441bca13e..e437a0ab87e 100644 --- a/configure.in +++ b/configure.in @@ -17,6 +17,14 @@ sinclude(build/apr_threads.m4) sinclude(build/apr_hints.m4) sinclude(build/libtool.m4) +dnl Save user-defined environment settings for later restoration +dnl +APR_SAVE_THE_ENVIRONMENT(CPPFLAGS) +APR_SAVE_THE_ENVIRONMENT(CFLAGS) +APR_SAVE_THE_ENVIRONMENT(LDFLAGS) +APR_SAVE_THE_ENVIRONMENT(LIBS) +APR_SAVE_THE_ENVIRONMENT(INCLUDES) + dnl Generate ./config.nice for reproducing runs of configure dnl APR_CONFIG_NICE(config.nice) @@ -55,31 +63,30 @@ AC_SUBST(apr_builders) MKDIR=$apr_builders/mkdir.sh -# These added to allow default directories to be used... +dnl These added to allow default directories to be used... DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" apr_modules="file_io network_io threadproc misc locks time mmap shmem i18n user" -dnl # Checks for programs. -AC_PROG_CC +dnl Checks for programs. AC_PROG_MAKE_SET +AC_PROG_CC +AC_PROG_CPP AC_PROG_AWK +AC_PROG_LN_S +AC_PROG_RANLIB +AC_PROG_INSTALL AC_CHECK_PROG(RM, rm, rm) AC_CHECK_TOOL(AR, ar, ar) -# This macro needs to be here in case we are on an AIX box. +dnl Various OS checks that apparently set required flags AC_AIX +AC_ISC_POSIX +AC_MINIX APR_EBCDIC -# Use /bin/sh if it exists, otherwise go looking for sh in the path -if test ".$SH" = . -a -f /bin/sh; then - SH="/bin/sh" -fi -AC_CHECK_PROG(SH, sh, sh) - -dnl dnl prep libtool dnl echo "performing libtool configuration..." @@ -101,7 +108,7 @@ AC_ARG_ENABLE(libtool, [--with-libtool use libtool to link the library], if test "x$use_libtool" = "xyes"; then lt_compile="\$(LIBTOOL) --mode=compile \$(LTFLAGS) \$(COMPILE) -c \$< && touch \$@" - link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(LDFLAGS) -o \$@" + link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(ALL_LDFLAGS) -o \$@" so_ext="lo" lib_target="-rpath \$(libdir) \$\$objects" else @@ -122,24 +129,32 @@ nl=' echo $ac_n "${nl}Check for compiler flags..." AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile time warnings], - [CFLAGS="$CFLAGS -g"; if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi]) + [APR_ADDTO(CFLAGS,-g) + if test "$GCC" = "yes"; then + APR_ADDTO(CFLAGS,-Wall) + fi +])dnl AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and compile time warnings], - [CFLAGS="$CFLAGS -g"; if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"; fi]) + [APR_ADDTO(CFLAGS,-g) + if test "$GCC" = "yes"; then + APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations]) + fi +])dnl dnl # this is the place to put specific options for platform/compiler dnl # combinations case "$OS:$CC" in *-hp-hpux*:cc ) - CFLAGS="$CFLAGS -Ae +DAportable +Z" + APR_ADDTO(CFLAGS,[-Ae +DAportable +Z]) ;; powerpc-*-beos:mwcc* ) - CPP="mwcc -E" - CC="mwcc" - AR="ar" - ;; + APR_SETVAR(CPP,[mwcc -E]) + APR_SETVAR(CC,mwcc) + APR_SETVAR(AR,ar) + ;; mips-sni-sysv4:cc ) - CFLAGS="$CFLAGS -Kthread" + APR_ADDTO(CFLAGS,-Kthread) ;; esac @@ -151,8 +166,8 @@ case "$OS" in eolstr="\\n" ;; *-os2*) - CPPFLAGS="$CPPFLAGS -DOS2" - CFLAGS="$CFLAGS -Zmt" + APR_ADDTO(CPPFLAGS,-DOS2) + APR_ADDTO(CFLAGS,-Zmt) OSDIR="os2" enable_threads="system_threads" eolstr="\\r\\n" @@ -160,7 +175,7 @@ case "$OS" in ;; *beos*) OSDIR="beos" - CPPFLAGS="$CPPFLAGS -DBEOS" + APR_ADDTO(CPPFLAGS,-DBEOS) enable_threads="system_threads" config_subdirs="shmem/unix/mm" native_mmap_emul="1" @@ -214,20 +229,10 @@ echo "Don't enable threads" pthreadh="0" pthreadser="0" else -# -# Play with CPPFLAGS given what was learned from APR_PRELOAD. -# -# [Roy: I don't like this because it messes up an environment -# variable that should remain pristine. However, it is needed -# for compatibility until all flag handling can be rewritten.] -# - apr_save_cppflags="$CPPFLAGS" - if test -n "$THREAD_CPPFLAGS"; then - CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS" - fi if test "$enable_threads" = "pthread"; then # We have specified pthreads for our threading library, just make sure # that we have everything we need + APR_PTHREADS_CHECK_SAVE APR_PTHREADS_CHECK APR_CHECK_PTHREADS_H([ threads="1" @@ -236,7 +241,8 @@ else AC_DEFINE(USE_THREADS) ], [ threads="0" pthreadh="0" - pthreadser="0" ] ) + pthreadser="0" + APR_PTHREADS_CHECK_RESTORE ] ) elif test "$enable_threads" = "system_threads"; then threads="1" pthreadh="0" @@ -245,6 +251,7 @@ else # We basically specified that we wanted threads, but not how to implement # them. In this case, just look for pthreads. In the future, we can check # for other threading libraries as well. + APR_PTHREADS_CHECK_SAVE APR_PTHREADS_CHECK APR_CHECK_PTHREADS_H([ threads="1" @@ -254,7 +261,7 @@ else threads="0" pthreadser="0" pthreadh="0" - CPPFLAGS="$apr_save_cppflags" ] ) + APR_PTHREADS_CHECK_RESTORE ] ) fi if test "$pthreadh" = "1"; then APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS @@ -359,7 +366,7 @@ AC_SUBST(mem_based) AC_SUBST(file_based) if test ".$SYS_SW" = ".AIX"; then - CPPFLAGS="$CPPFLAGS -U__STR__" + APR_ADDTO(CPPFLAGS,-U__STR__) case "$SYS_KV" in [12]*) AC_DEFINE(USEBCOPY) @@ -782,7 +789,7 @@ AC_ARG_ENABLE(dso, [ AC_CHECK_FUNCS(NSLinkModule, [ tempdso="dyld" ], [ tempdso="no" ]) if test "$tempdso" = "no"; then - AC_CHECK_LIB(dl, dlopen, [ tempdso="dlfcn" LIBS="$LIBS -ldl" ], + AC_CHECK_LIB(dl, dlopen, [ tempdso="dlfcn" APR_ADDTO(LIBS,-ldl) ], tempdso="no") fi if test "$tempdso" = "no"; then @@ -792,7 +799,7 @@ AC_ARG_ENABLE(dso, AC_CHECK_LIB(root, load_image, tempdso="yes", tempdso="no") fi if test "$tempdso" = "no"; then - AC_CHECK_LIB(dld, shl_load, [ tempdso="shl" LIBS="$LIBS -ldld" ], + AC_CHECK_LIB(dld, shl_load, [ tempdso="shl" APR_ADDTO(LIBS,-ldld) ], tempdso="no") fi if test "$tempdso" = "no"; then @@ -1081,17 +1088,29 @@ else fi AC_SUBST(have_ipv6) +dnl #----------------------------- Finalize the variables + +echo $ac_n "${nl}Restore user-defined environment settings...${nl}" + +APR_RESTORE_THE_ENVIRONMENT(CPPFLAGS, EXTRA_) +APR_RESTORE_THE_ENVIRONMENT(CFLAGS, EXTRA_) +APR_RESTORE_THE_ENVIRONMENT(LDFLAGS, EXTRA_) +APR_RESTORE_THE_ENVIRONMENT(LIBS, EXTRA_) +APR_RESTORE_THE_ENVIRONMENT(INCLUDES, EXTRA_) +AC_SUBST(NOTEST_CPPFLAGS) +AC_SUBST(NOTEST_CFLAGS) +AC_SUBST(NOTEST_LDFLAGS) +AC_SUBST(NOTEST_LIBS) +AC_SUBST(NOTEST_INCLUDES) + dnl #----------------------------- Construct the files AC_SUBST(LDLIBS) -AC_SUBST(OPTIM) AC_SUBST(AR) AC_SUBST(RM) AC_SUBST(OSDIR) AC_SUBST(DEFAULT_OSDIR) AC_SUBST(EXEEXT) -AC_SUBST(THREAD_CPPFLAGS) -AC_SUBST(THREAD_CFLAGS) AC_SUBST(LIBTOOL_LIBS) echo "${nl}Construct Makefiles and header files." diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl index c756f79423d..a3e873c8fb7 100644 --- a/test/MakeWin32Make.pl +++ b/test/MakeWin32Make.pl @@ -28,7 +28,6 @@ } $t =~ s|\@CC\@|cl|; $t =~ s|\@RANLIB\@||; - $t =~ s|\@OPTIM\@||; $t =~ s|-I\$\(INCDIR\)|\/I "\$\(INCDIR\)"|; $t =~ s|\.\.\/libapr\.a|\.\./LibD/apr\.lib|; if ($t =~ s|\@EXEEXT\@|\.exe|) { diff --git a/test/Makefile.in b/test/Makefile.in index a8abf302a91..8adf75f36e5 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -30,87 +30,85 @@ TARGETS = $(PROGRAMS) # bring in rules.mk for standard functionality @INCLUDE_RULES@ -ALL_LIBS=../libapr.la ../shmem/unix/mm/libmm.la $(LIBS) +LIBS=../libapr.la ../shmem/unix/mm/libmm.la $(LIBS) CLEAN_TARGETS = testfile.tmp -CFLAGS = -g @CFLAGS@ @OPTIM@ $(INCLUDES) - INCDIR=../include INCLUDES=-I$(INCDIR) testfile@EXEEXT@: testfile.lo ../libapr.la - $(LINK) testfile.lo $(ALL_LIBS) + $(LINK) testfile.lo testnames@EXEEXT@: testnames.lo ../libapr.la - $(LINK) testnames.lo $(ALL_LIBS) + $(LINK) testnames.lo testflock@EXEEXT@: testflock.lo ../libapr.la - $(LINK) testflock.lo $(ALL_LIBS) + $(LINK) testflock.lo ### why the export-dynamic? testdso@EXEEXT@: testdso.lo ../libapr.la - $(LINK) --export-dynamic testdso.lo $(ALL_LIBS) + $(LINK) --export-dynamic testdso.lo testoc@EXEEXT@: testoc.lo ../libapr.la - $(LINK) testoc.lo $(ALL_LIBS) + $(LINK) testoc.lo occhild@EXEEXT@: occhild.lo ../libapr.la - $(LINK) occhild.lo $(ALL_LIBS) + $(LINK) occhild.lo mod_test.so: mod_test.lo ../libapr.la - $(LINK) -o mod_test.so ${LD_FLAGS} -shared mod_test.o $(ALL_LIBS) + $(LINK) -shared mod_test.o testargs@EXEEXT@: testargs.lo ../libapr.la - $(LINK) testargs.lo $(ALL_LIBS) + $(LINK) testargs.lo testcontext@EXEEXT@: testcontext.lo ../libapr.la - $(LINK) testcontext.lo $(ALL_LIBS) + $(LINK) testcontext.lo testproc@EXEEXT@: testproc.lo ../libapr.la - $(LINK) testproc.lo $(ALL_LIBS) + $(LINK) testproc.lo testthread@EXEEXT@: testthread.lo ../libapr.la - $(LINK) testthread.lo $(ALL_LIBS) + $(LINK) testthread.lo testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ ../libapr.la - $(LINK) testsock.lo $(ALL_LIBS) + $(LINK) testsock.lo client@EXEEXT@: client.lo ../libapr.la - $(LINK) client.lo $(ALL_LIBS) + $(LINK) client.lo server@EXEEXT@: server.lo sendfile.lo ../libapr.la - $(LINK) server.lo $(ALL_LIBS) + $(LINK) server.lo sendfile@EXEEXT@: sendfile.lo ../libapr.la - $(LINK) sendfile.lo $(ALL_LIBS) + $(LINK) sendfile.lo testtime@EXEEXT@: testtime.lo ../libapr.la - $(LINK) testtime.lo $(ALL_LIBS) + $(LINK) testtime.lo testmmap@EXEEXT@: testmmap.lo ../libapr.la - $(LINK) testmmap.lo $(ALL_LIBS) + $(LINK) testmmap.lo testshmem@EXEEXT@: testshmem.lo ../libapr.la - $(LINK) testshmem.lo $(ALL_LIBS) + $(LINK) testshmem.lo testpipe@EXEEXT@: testpipe.lo ../libapr.la - $(LINK) testpipe.lo $(ALL_LIBS) + $(LINK) testpipe.lo testuuid@EXEEXT@: testuuid.lo ../libapr.la - $(LINK) testuuid.lo $(ALL_LIBS) + $(LINK) testuuid.lo testsockopt@EXEEXT@: testsockopt.lo ../libapr.la - $(LINK) testsockopt.lo $(ALL_LIBS) + $(LINK) testsockopt.lo testipsub@EXEEXT@: testipsub.lo ../libapr.la - $(LINK) testipsub.lo $(ALL_LIBS) + $(LINK) testipsub.lo testmd5@EXEEXT@: testmd5.lo ../libapr.la - $(LINK) testmd5.lo $(ALL_LIBS) + $(LINK) testmd5.lo testpoll@EXEEXT@: testpoll.lo ../libapr.la - $(LINK) testpoll.lo $(ALL_LIBS) + $(LINK) testpoll.lo # DO NOT REMOVE From cf17c06e3a1aa9fa5169a31b4a84d2af12e438b1 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 29 Apr 2001 07:19:40 +0000 Subject: [PATCH 1570/7878] Make --mode=install work for OS/2 DLLs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61561 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 54 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/build/aplibtool.c b/build/aplibtool.c index a549294c7b3..8436b8b8f0b 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -119,6 +119,7 @@ char *shell_esc(const char *str); void cleanup_tmp_dirs(cmd_data_t *cmd_data); void generate_def_file(cmd_data_t *cmd_data); char *nameof(char *fullpath); +char *truncate_dll_name(char *path); int main(int argc, char *argv[]) @@ -290,7 +291,14 @@ bool parse_input_file_name(char *arg, cmd_data_t *cmd_data) strcat(newarg, name); ext = strrchr(newarg, '.') + 1; - strcpy(ext, STATIC_LIB_EXT); + + if (shared && cmd_data->mode == mInstall) { + strcpy(ext, DYNAMIC_LIB_EXT); + newarg = truncate_dll_name(newarg); + } else { + strcpy(ext, STATIC_LIB_EXT); + } + cmd_data->arglist[cmd_data->num_args++] = newarg; return true; } @@ -361,25 +369,14 @@ bool parse_output_file_name(char *arg, cmd_data_t *cmd_data) strcat(newarg, arg); newext = strrchr(newarg, '.') + 1; strcpy(newext, shared ? DYNAMIC_LIB_EXT : STATIC_LIB_EXT); - cmd_data->arglist[cmd_data->num_args++] = newarg; #ifdef TRUNCATE_DLL_NAME if (shared) { - /* Cut DLL name down to 8 characters after removing any mod_ prefix */ - int len = ext - name - 1; - char *newname = strrchr(newarg, '/') + 1; - - if (strncmp(newname, "mod_", 4) == 0) { - strcpy(newname, newname + 4); - len -= 4; - } - - if (len > 8) { - strcpy(newname + 8, strchr(newname, '.')); - } + newarg = truncate_dll_name(newarg); } #endif + cmd_data->arglist[cmd_data->num_args++] = newarg; cmd_data->output_name = newarg; return true; } @@ -487,7 +484,7 @@ void post_parse_fixup(cmd_data_t *cmd_data) } #endif - if (shared) { + if (shared && (cmd_data->output_type == otObject || cmd_data->output_type == otDynamicLibrary)) { cmd_data->arglist[cmd_data->num_args++] = SHARE_SW; } } @@ -740,3 +737,30 @@ char *nameof(char *fullpath) return name; } + + + +char *truncate_dll_name(char *path) +{ + /* Cut DLL name down to 8 characters after removing any mod_ prefix */ + char *tmppath = strdup(path); + char *newname = strrchr(tmppath, '/') + 1; + char *ext = strrchr(tmppath, '.'); + int len; + + if (ext == NULL) + return tmppath; + + len = ext - newname; + + if (strncmp(newname, "mod_", 4) == 0) { + strcpy(newname, newname + 4); + len -= 4; + } + + if (len > 8) { + strcpy(newname + 8, strchr(newname, '.')); + } + + return tmppath; +} From 8f673913b9bf69fb671fe913a8da0f0c3a7f36d8 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 29 Apr 2001 21:37:17 +0000 Subject: [PATCH 1571/7878] We have pools not contexts... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61562 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 15 ++++++++------- include/arch/unix/dso.h | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index a23b5223e55..ef9fc7773e6 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -75,7 +75,7 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, { *aprdso = apr_pcalloc(pool, sizeof **aprdso); (*aprdso)->handle = osdso; - (*aprdso)->cont = pool; + (*aprdso)->pool = pool; return APR_SUCCESS; } @@ -107,7 +107,7 @@ static apr_status_t dso_cleanup(void *thedso) } APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, - const char *path, apr_pool_t *ctx) + const char *path, apr_pool_t *pool) { #if defined(DSO_USE_SHL) shl_t os_handle = shl_load(path, BIND_IMMEDIATE|BIND_VERBOSE|BIND_NOSTART, 0L); @@ -139,7 +139,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, #endif #endif /* DSO_USE_x */ - *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); + *res_handle = apr_pcalloc(pool, sizeof(**res_handle)); if(os_handle == NULL) { #if defined(DSO_USE_SHL) @@ -155,17 +155,17 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, } (*res_handle)->handle = (void*)os_handle; - (*res_handle)->cont = ctx; + (*res_handle)->pool = pool; (*res_handle)->errormsg = NULL; - apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); + apr_pool_cleanup_register(pool, *res_handle, dso_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->pool, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, @@ -231,7 +231,8 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, #endif /* DSO_USE_x */ } -APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) +APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, + apr_size_t buflen) { if (dso->errormsg) { apr_cpystrn(buffer, dso->errormsg, buflen); diff --git a/include/arch/unix/dso.h b/include/arch/unix/dso.h index 9f94d00de98..a5395052c68 100644 --- a/include/arch/unix/dso.h +++ b/include/arch/unix/dso.h @@ -90,9 +90,9 @@ #endif struct apr_dso_handle_t { - apr_pool_t *cont; + apr_pool_t *pool; void *handle; - const char *errormsg; + const char *errormsg; }; #endif From 1f01fe13fb886916d1f3214a047e4909bf33d5b3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 29 Apr 2001 22:03:43 +0000 Subject: [PATCH 1572/7878] More pools instead of contexts... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61563 13f79535-47bb-0310-9956-ffa450edef68 --- dso/beos/dso.c | 16 ++++++++-------- include/arch/beos/dso.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 5a4b5823589..5ded23b15e3 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -62,32 +62,32 @@ static apr_status_t dso_cleanup(void *thedso) apr_dso_handle_t *dso = thedso; if (dso->handle > 0 && unload_add_on(dso->handle) < B_NO_ERROR) - return APR_EINIT; + return APR_EINIT; dso->handle = -1; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, - apr_pool_t *ctx) +APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, + const char *path, apr_pool_t *pool) { image_id newid; if((newid = load_add_on(path)) < B_NO_ERROR) return APR_EINIT; - *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); + *res_handle = apr_pcalloc(pool, sizeof(*res_handle)); (*res_handle)->handle = newid; - (*res_handle)->cont = ctx; + (*res_handle)->pool = pool; - apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); + apr_pool_cleanup_register(pool, *res_handle, dso_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->pool, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, @@ -119,7 +119,7 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, { *aprdso = apr_pcalloc(pool, sizeof **aprdso); (*aprdso)->handle = osdso; - (*aprdso)->cont = pool; + (*aprdso)->pool = pool; return APR_SUCCESS; } diff --git a/include/arch/beos/dso.h b/include/arch/beos/dso.h index 112f9aad2ce..4f1560315d1 100644 --- a/include/arch/beos/dso.h +++ b/include/arch/beos/dso.h @@ -67,8 +67,8 @@ #if APR_HAS_DSO struct apr_dso_handle_t { - image_id handle; /* Handle to the DSO loaded */ - apr_pool_t *cont; + image_id handle; /* Handle to the DSO loaded */ + apr_pool_t *pool; }; #endif From cabd4968a920d93f6ab1e476a0fbed7220c0ae4f Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 29 Apr 2001 22:11:29 +0000 Subject: [PATCH 1573/7878] This option needs to be set for all versions of beos, not just BONE. With this change we're building again on BeOS R5. Submitted by: Peter Moore Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61564 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 5df991aa1fc..730f610a82f 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -357,12 +357,13 @@ dnl # Not a problem in 10.20. Otherwise, who knows? PLATOSVERS=`uname -r` case $PLATOSVERS in 5.1) - APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone -DSIGPROCMASK_SETS_THREAD_MASK]) + APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) APR_ADDTO(LDFLAGS, [-L/boot/develop/lib/x86 -L/boot/beos/system/lib -lbind -lsocket]) APR_ADDTO(LIBS, [-lbind -lsocket -lbe -lroot]) ;; esac - ;; + APR_ADDTO(CPPFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK]) + ;; 4850-*.*) APR_ADDTO(CPPFLAGS, [-DSVR4 -DMPRAS]) APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) From 1b12a4ac0775b8f8add61eac4ebd6e59673dcad1 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 30 Apr 2001 00:07:35 +0000 Subject: [PATCH 1574/7878] Make the apr_mmap_create() function use the native_flags variable. This allows us to actually create WRITEABLE MMAPs. Submitted by: Ed Korthof git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61565 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ mmap/unix/mmap.c | 14 ++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 56558ea1c9f..6110dabc481 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Make the apr_mmap_create() function use the native_flags variable. + This allows us to actually create WRITEABLE MMAPs. + [Ed Korthof ] + *) Completely revamp configure so that it preserves the standard make variables CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS and LIBS by moving the configure additions to EXTRA_* variables. Also, allow the user diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index b5907772ba5..a225075ef4a 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -105,13 +105,12 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, apr_off_t offset, apr_size_t size, apr_int32_t flag, apr_pool_t *cont) { - apr_int32_t native_flags = 0; -#ifdef BEOS void *mm; +#ifdef BEOS area_id aid = -1; uint32 pages = 0; #else - void *mm; + apr_int32_t native_flags = 0; #endif if (file == NULL || file->filedes == -1 || file->buffered) @@ -121,15 +120,10 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, #ifdef BEOS /* XXX: mmap shouldn't really change the seek offset */ apr_file_seek(file, APR_SET, &offset); - if (flag & APR_MMAP_WRITE) { - native_flags |= B_WRITE_AREA; - } - if (flag & APR_MMAP_READ) { - native_flags |= B_READ_AREA; - } /* There seems to be some strange interactions that mean our area must * be set as READ & WRITE or writev will fail! Go figure... + * So we ignore the value in flags and always ask for both READ and WRITE */ pages = (size + B_PAGE_SIZE -1) / B_PAGE_SIZE; aid = create_area("apr_mmap", &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, @@ -153,7 +147,7 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, native_flags |= PROT_READ; } - mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes, offset); + mm = mmap(NULL, size, native_flags, MAP_SHARED, file->filedes, offset); if (mm == (void *)-1) { /* we failed to get an mmap'd file... */ From c2808c0baa0db8d696a79a70003754352859845d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 30 Apr 2001 00:10:03 +0000 Subject: [PATCH 1575/7878] Back out the last change to the Makefile in the test directory. Those changes broke the build in that directory. By backing them out, we can continue to build the test programs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61566 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 50 ++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 8adf75f36e5..884c8c7b60a 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -30,7 +30,7 @@ TARGETS = $(PROGRAMS) # bring in rules.mk for standard functionality @INCLUDE_RULES@ -LIBS=../libapr.la ../shmem/unix/mm/libmm.la $(LIBS) +ALL_LIBS=../libapr.la ../shmem/unix/mm/libmm.la $(LIBS) $(EXTRA_LIBS) CLEAN_TARGETS = testfile.tmp @@ -39,76 +39,76 @@ INCLUDES=-I$(INCDIR) testfile@EXEEXT@: testfile.lo ../libapr.la - $(LINK) testfile.lo + $(LINK) testfile.lo $(ALL_LIBS) testnames@EXEEXT@: testnames.lo ../libapr.la - $(LINK) testnames.lo + $(LINK) testnames.lo $(ALL_LIBS) testflock@EXEEXT@: testflock.lo ../libapr.la - $(LINK) testflock.lo + $(LINK) testflock.lo $(ALL_LIBS) ### why the export-dynamic? testdso@EXEEXT@: testdso.lo ../libapr.la - $(LINK) --export-dynamic testdso.lo + $(LINK) --export-dynamic testdso.lo $(ALL_LIBS) testoc@EXEEXT@: testoc.lo ../libapr.la - $(LINK) testoc.lo + $(LINK) testoc.lo $(ALL_LIBS) occhild@EXEEXT@: occhild.lo ../libapr.la - $(LINK) occhild.lo + $(LINK) occhild.lo $(ALL_LIBS) mod_test.so: mod_test.lo ../libapr.la - $(LINK) -shared mod_test.o + $(LINK) -shared mod_test.o $(ALL_LIBS) testargs@EXEEXT@: testargs.lo ../libapr.la - $(LINK) testargs.lo + $(LINK) testargs.lo $(ALL_LIBS) testcontext@EXEEXT@: testcontext.lo ../libapr.la - $(LINK) testcontext.lo + $(LINK) testcontext.lo $(ALL_LIBS) testproc@EXEEXT@: testproc.lo ../libapr.la - $(LINK) testproc.lo + $(LINK) testproc.lo $(ALL_LIBS) testthread@EXEEXT@: testthread.lo ../libapr.la - $(LINK) testthread.lo + $(LINK) testthread.lo $(ALL_LIBS) testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ ../libapr.la - $(LINK) testsock.lo + $(LINK) testsock.lo $(ALL_LIBS) client@EXEEXT@: client.lo ../libapr.la - $(LINK) client.lo + $(LINK) client.lo $(ALL_LIBS) server@EXEEXT@: server.lo sendfile.lo ../libapr.la - $(LINK) server.lo + $(LINK) server.lo $(ALL_LIBS) sendfile@EXEEXT@: sendfile.lo ../libapr.la - $(LINK) sendfile.lo + $(LINK) sendfile.lo $(ALL_LIBS) testtime@EXEEXT@: testtime.lo ../libapr.la - $(LINK) testtime.lo + $(LINK) testtime.lo $(ALL_LIBS) testmmap@EXEEXT@: testmmap.lo ../libapr.la - $(LINK) testmmap.lo + $(LINK) testmmap.lo $(ALL_LIBS) testshmem@EXEEXT@: testshmem.lo ../libapr.la - $(LINK) testshmem.lo + $(LINK) testshmem.lo $(ALL_LIBS) testpipe@EXEEXT@: testpipe.lo ../libapr.la - $(LINK) testpipe.lo + $(LINK) testpipe.lo $(ALL_LIBS) testuuid@EXEEXT@: testuuid.lo ../libapr.la - $(LINK) testuuid.lo + $(LINK) testuuid.lo $(ALL_LIBS) testsockopt@EXEEXT@: testsockopt.lo ../libapr.la - $(LINK) testsockopt.lo + $(LINK) testsockopt.lo $(ALL_LIBS) testipsub@EXEEXT@: testipsub.lo ../libapr.la - $(LINK) testipsub.lo + $(LINK) testipsub.lo $(ALL_LIBS) testmd5@EXEEXT@: testmd5.lo ../libapr.la - $(LINK) testmd5.lo + $(LINK) testmd5.lo $(ALL_LIBS) testpoll@EXEEXT@: testpoll.lo ../libapr.la - $(LINK) testpoll.lo + $(LINK) testpoll.lo $(ALL_LIBS) # DO NOT REMOVE From f7d7c4dd86b311a0507facd2eb97a5410870923c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 30 Apr 2001 19:03:38 +0000 Subject: [PATCH 1576/7878] shared sdbm file locking patch, writes/deletes require an excl lock, read/getkeys require a shared lock git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61567 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 6664763e428..f5eaba87281 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -81,11 +81,14 @@ extern "C" { #define APR_TRUNCATE 16 /* Open the file and truncate to 0 length */ #define APR_BINARY 32 /* Open the file in binary mode */ #define APR_EXCL 64 /* Open should fail if APR_CREATE and file - exists. */ + exists. */ #define APR_BUFFERED 128 /* Open the file for buffered I/O */ #define APR_DELONCLOSE 256 /* Delete the file after close */ #define APR_XTHREAD 512 /* Platform dependent tag to open the file for use across multiple threads */ +#define APR_SHARELOCK 1024 /* Platform dependent support for higher + level locked read/write access to support + writes across process/machines */ /* flags for apr_file_seek */ #define APR_SET SEEK_SET From b5921c3f3d1ea908ac18ffb59d84922b55404cb3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 30 Apr 2001 20:32:51 +0000 Subject: [PATCH 1577/7878] More cvsignore goodness... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61568 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.cvsignore b/test/.cvsignore index 6e9f53e7606..b2a9a2b752b 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -36,3 +36,4 @@ testipsub *.idb mod_test.dll testnames +*.dbg From 69ee81a4760f00e1db291ddf569d0c0f4d9e2257 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 30 Apr 2001 20:33:55 +0000 Subject: [PATCH 1578/7878] Add some testing to testshmem. This needs more work, but at least we now try to stress it a little... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61569 13f79535-47bb-0310-9956-ffa450edef68 --- test/testshmem.c | 152 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 140 insertions(+), 12 deletions(-) diff --git a/test/testshmem.c b/test/testshmem.c index f5b6be58d53..59fe32ee421 100644 --- a/test/testshmem.c +++ b/test/testshmem.c @@ -73,6 +73,11 @@ typedef struct mbox { apr_pool_t *context; mbox *boxes; +#define SIZE 256 +#define CYCLES 40 +#define TESTSIZE 4096 * SIZE +#define TEST2SIZE CYCLES * SIZE + static void msgwait(int boxnum) { volatile int test = 0; @@ -96,25 +101,36 @@ int main(void) #if APR_HAS_SHARED_MEMORY apr_shmem_t *shm; pid_t pid; - int size; - + int size, cntr; + char *ptrs[CYCLES]; + apr_size_t psize[CYCLES]; + apr_status_t rv; + apr_size_t cksize; apr_initialize(); + - fprintf(stdout, "Initializing the context......."); + for (size = 0;size < CYCLES;size++){ + ptrs[size] = NULL; + psize[size] = sizeof(mbox) * (size + 1); + } + + printf("APR Shared Memory Test\n"); + printf("======================\n\n"); + printf("Initializing the context............................"); if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - fprintf(stderr, "could not initialize\n"); + printf("could not initialize\n"); exit(-1); } - fprintf(stdout, "OK\n"); + printf("OK\n"); - fprintf(stdout, "Creating shared memory block......."); - if (apr_shm_init(&shm, 1048576, NULL, context) != APR_SUCCESS) { + printf("Creating shared memory block (%ld bytes)........", TESTSIZE); + if (apr_shm_init(&shm, TESTSIZE, NULL, context) != APR_SUCCESS) { fprintf(stderr, "Error allocating shared memory block\n"); exit(-1); } fprintf(stdout, "OK\n"); - fprintf(stdout, "Allocating shared memory......."); + printf("Allocating shared mbox memory......................."); size = sizeof(mbox) * 2; boxes = apr_shm_calloc(shm, size); if (boxes == NULL) { @@ -123,7 +139,119 @@ int main(void) } fprintf(stdout, "OK\n"); - fprintf(stdout, "Creating a child process\n"); + printf("\nAbout to stress the alloc/free cycle.\n"); + printf("Smallest allocation will be %ld bytes\n", psize[0]); + printf("Largest allocation will be %ld bytes\n", psize[CYCLES -1]); + printf("I will be doing it in %d steps\n", CYCLES); + + printf("\tAllocating via apr_shm_malloc..............."); + for (cntr = 0;cntr < CYCLES;cntr++){ + ptrs[cntr] = apr_shm_malloc(shm, psize[cntr]); + if (ptrs[cntr] == NULL){ + printf("Failed at step %d, %ld bytes\n", cntr, psize[cntr]); + exit (-1); + } + } + printf("OK\n\tFreeing....................................."); + for (cntr = 0;cntr < CYCLES;cntr++){ + if (apr_shm_free(shm, ptrs[cntr]) != APR_SUCCESS){ + printf("Failed at step %d, %ld bytes\n", cntr, psize[cntr]); + exit (-1); + } + } + printf("OK\n"); + + printf("\tAllocating via apr_shm_calloc..............."); + for (cntr = CYCLES-1;cntr > -1;cntr--){ + ptrs[cntr] = apr_shm_malloc(shm, psize[cntr]); + if (ptrs[cntr] == NULL){ + printf("Failed at %ld bytes\n", psize[cntr]); + exit (-1); + } + } + printf("OK\n\tFreeing....................................."); + for (cntr = 0;cntr < CYCLES;cntr++){ + if (apr_shm_free(shm, ptrs[cntr]) != APR_SUCCESS){ + printf("Failed at step %d, %ld bytes\n", cntr, psize[cntr]); + exit (-1); + } + } + printf("OK\n"); + + printf("Checking we have all we should have remaining......."); + rv = apr_shm_avail(shm, &cksize); + if (rv == APR_ENOTIMPL){ + printf("Not Impl.\n"); + } else { + if (rv != APR_SUCCESS){ + printf("Failed!\n"); + exit (-1); + } + if (cksize == (TESTSIZE - size)){ + printf ("OK\n"); + } else { + printf ("Failed.\nShould have had %ld bytes, instead there are %ld bytes :(\n", + TESTSIZE - size, cksize); + exit(-1); + } + } + printf("%d cycles of malloc and calloc passed.\n\n", CYCLES); + + printf("Block test.\n"); + printf("\tI am about to allocate %ld bytes..........", TEST2SIZE); + if ((ptrs[0] = apr_shm_malloc(shm, TEST2SIZE)) == NULL){ + printf("Failed.\n"); + exit (-1); + } + printf ("OK\n"); + printf("\tFreeing the block of %ld bytes............", TEST2SIZE); + if ((rv = apr_shm_free(shm, ptrs[0])) != APR_SUCCESS){ + printf("Failed!\n"); + exit(-1); + } + printf ("OK\n"); + + printf ("\tAbout to allocate %d blocks of %d bytes....", CYCLES, SIZE); + for (cntr = 0;cntr < CYCLES;cntr++){ + if ((ptrs[cntr] = apr_shm_malloc(shm, SIZE)) == NULL){ + printf("Failed.\n"); + printf("Couldn't allocate block %d\n", cntr + 1); + exit (-1); + } + } + printf("Complete.\n"); + + printf ("\tAbout to free %d blocks of %d bytes........", CYCLES, SIZE); + for (cntr = 0;cntr < CYCLES;cntr++){ + if ((rv = apr_shm_free(shm, ptrs[cntr])) != APR_SUCCESS){ + printf("Failed\n"); + printf("Counldn't free block %d\n", cntr + 1); + exit (-1); + } + } + printf("Complete.\n"); + + printf("Checking we have all we should have remaining......."); + rv = apr_shm_avail(shm, &cksize); + if (rv == APR_ENOTIMPL){ + printf("Not Impl.\n"); + } else { + if (rv != APR_SUCCESS){ + printf("Failed!\n"); + exit (-1); + } + if (cksize == (TESTSIZE - size)){ + printf ("OK\n"); + } else { + printf ("Failed.\nShould have had %ld bytes, instead there are %ld bytes :(\n", + TESTSIZE - size, cksize); + exit(-1); + } + } + + printf("Block test complete.\n\n"); + + printf("Creating a child process\n"); pid = fork(); if (pid == 0) { apr_sleep(1); @@ -142,12 +270,12 @@ int main(void) exit(1); } else { - fprintf(stderr, "Error creating a child process\n"); + printf("Error creating a child process\n"); exit(1); } #else - fprintf(stdout, "APR SHMEM test failed!\n"); - fprintf(stdout, "shmem is not supported on this platform\n"); + printf("APR SHMEM test not run!\n"); + printf("shmem is not supported on this platform\n"); return (-1); #endif } From f2a218fc24164c3f8f8fd90d57be565929fd041c Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 30 Apr 2001 20:55:17 +0000 Subject: [PATCH 1579/7878] This is replacement shared memory code for BeOS. It's simple but seems to work and reduces the build problems that we've seen using MM. This can probably be improved on, but it's a starting point. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61570 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/beos/.cvsignore | 3 + shmem/beos/Makefile.in | 12 ++ shmem/beos/shmem.c | 354 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 369 insertions(+) create mode 100644 shmem/beos/.cvsignore create mode 100644 shmem/beos/Makefile.in create mode 100644 shmem/beos/shmem.c diff --git a/shmem/beos/.cvsignore b/shmem/beos/.cvsignore new file mode 100644 index 00000000000..06e18a7aafb --- /dev/null +++ b/shmem/beos/.cvsignore @@ -0,0 +1,3 @@ +Makefile +*.lo +.libs diff --git a/shmem/beos/Makefile.in b/shmem/beos/Makefile.in new file mode 100644 index 00000000000..2c8d436407a --- /dev/null +++ b/shmem/beos/Makefile.in @@ -0,0 +1,12 @@ + +TARGETS = shmem.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + +INCDIR=../../include +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) + +# DO NOT REMOVE diff --git a/shmem/beos/shmem.c b/shmem/beos/shmem.c new file mode 100644 index 00000000000..428300aa5e4 --- /dev/null +++ b/shmem/beos/shmem.c @@ -0,0 +1,354 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_general.h" +#include "apr_shmem.h" +#include "apr_errno.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include +#include + +struct block_t { + apr_pool_t *p; + void *addr; + apr_size_t size; + void *nxt; + void *prev; +}; + +struct shmem_t { + apr_pool_t *p; + void *memblock; + void *ptr; + apr_size_t avail; + area_id aid; + struct block_t *uselist; + struct block_t *freelist; +}; + +#define MIN_BLK_SIZE 128 + +#define DEBUG_ 1 + +void add_block(struct block_t **list, struct block_t *blk); +void split_block(struct block_t **list, struct block_t *blk, apr_size_t size); + +/* Debugging functions */ +#if DEBUG_ +static void printf_block(struct block_t *b) +{ + printf ("Block : %ld bytes\n\tthis = %x\n\tnext = %x\n", + b->size, b, b->nxt); +} + +static void walk_list(struct block_t *list) +{ + struct block_t *b = list; + do { + printf_block(b); + } + while ((b = b->nxt) != NULL); +} +#endif + +static struct block_t * find_block_by_addr(struct block_t *list, void *addr) +{ + struct block_t *b = list; + do { + if (b->addr == addr) + return b; + } + while ((b = b->nxt) != NULL); + + return NULL; +} + +static struct block_t *find_block_of_size(struct block_t *list, apr_size_t size) +{ + struct block_t *b = list, *rv = NULL; + apr_ssize_t diff = -1; + + if (!list) + return NULL; + + do { + if (b->size == size) + return b; + if (b->size > size){ + if (diff == -1) + diff = b->size; + if ((b->size - size) < diff){ + diff = b->size - size; + rv = b; + } + } + } + while ((b = b->nxt) != list); + + if (diff > MIN_BLK_SIZE){ + split_block(&list, rv, size); + + /* we're going to split the block now... */ +/* apr_size_t nsz = rv->size - size; + struct block_t *blk = (struct block_t*)apr_pcalloc(rv->p, sizeof(struct block_t)); + blk->p = rv->p; + blk->size = nsz; + rv->size = size; + blk->addr = rv->addr + size; + add_block(&list, blk); +*/ + } + + if (rv) + return rv; + + return NULL; +} + +void add_block(struct block_t **list, struct block_t *blk) +{ + if ((*list) == NULL) + *list = blk; + + if (blk == (*list)){ + blk->prev = blk; + blk->nxt = blk; + } else { + ((struct block_t*)(*list)->prev)->nxt = blk; + blk->prev = ((struct block_t *)(*list))->prev; + blk->nxt = (*list); + (*list)->prev = blk; + } +} + +void split_block(struct block_t **list, struct block_t *blk, apr_size_t size) +{ + apr_size_t nsz = blk->size - size; + struct block_t *b = (struct block_t*)apr_pcalloc(blk->p, sizeof(struct block_t)); + b->p = blk->p; + b->size = nsz; + blk->size = size; + b->addr = blk->addr + size; + add_block(list, b); +} + +static void remove_block(struct block_t **list, struct block_t *blk) +{ + if (((*list) == blk) && (blk->nxt == blk) && (blk == blk->prev)){ + *list = NULL; + blk->nxt = NULL; + blk->prev = NULL; + } else { + ((struct block_t*)(blk->nxt))->prev = blk->prev; + ((struct block_t*)(blk->prev))->nxt = blk->nxt; + if (*list == blk) + *list = blk->nxt; + blk->nxt = NULL; + blk->prev = NULL; + } +} + +/* puts a used block onto the free list for it to be reused... */ +static void free_block(struct shmem_t *m, void *entity) +{ + struct block_t *b; + if (b = find_block_by_addr(m->uselist, entity)){ + remove_block(&(m->uselist), b); + add_block(&(m->freelist), b); + m->avail += b->size; + } +} + +/* assigns a block of our memory and puts an entry on the uselist */ +static struct block_t *alloc_block(struct shmem_t *m, apr_size_t size) +{ + struct block_t *b = NULL; + if (m->avail < size) + return NULL; + + if ((b = find_block_of_size(m->freelist, size))){ + remove_block(&(m->freelist), b); + } else { + b = (struct block_t*)apr_pcalloc(m->p, sizeof(struct block_t)); + b->p = m->p; + b->addr = m->ptr; + b->size = size; + m->ptr += size; + } + m->avail -= b->size; /* actual size may be different if we're reusing a block */ + add_block(&(m->uselist), b); + + return b; +} + +apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, + apr_pool_t *p) +{ + int rc; + int pages; + apr_size_t pagesize; + area_id newid; + char *name = NULL; + char *addr; + + (*m) = (struct shmem_t *)apr_pcalloc(p, sizeof(struct shmem_t)); + /* we MUST allocate in pages, so calculate how big an area we need... */ + pagesize = ((reqsize + B_PAGE_SIZE - 1) / B_PAGE_SIZE) * B_PAGE_SIZE; + + newid = create_area("apr_shm", (void*)&addr, B_ANY_ADDRESS, + pagesize, B_CONTIGUOUS, B_READ_AREA|B_WRITE_AREA); + + if (newid < 0) + return errno; + + (*m)->p = p; + (*m)->aid = newid; + (*m)->memblock = addr; + (*m)->ptr = (void*)addr; + (*m)->avail = pagesize; /* record how big an area we actually created... */ + (*m)->uselist = NULL; + (*m)->freelist = NULL; + return APR_SUCCESS; +} + + + +apr_status_t apr_shm_destroy(struct shmem_t *m) +{ + delete_area(m->aid); + m->avail = 0; + m->freelist = NULL; + m->uselist = NULL; + m->memblock = NULL; + return APR_SUCCESS; +} + +void *apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize) +{ + struct block_t *b; + if (b = alloc_block(m, reqsize)) + return b->addr; + return NULL; +} + +void *apr_shm_calloc(struct shmem_t *m, apr_size_t reqsize) +{ + struct block_t *b; + if (b = alloc_block(m, reqsize)){ + memset(b->addr, 0, reqsize); + return b->addr; + } + return NULL; +} + +apr_status_t apr_shm_free(struct shmem_t *m, void *entity) +{ + free_block(m, entity); + return APR_SUCCESS; +} + +apr_status_t apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) +{ + *name = NULL; + return APR_ANONYMOUS; +} + +apr_status_t apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) +{ + return APR_ANONYMOUS; +} + +apr_status_t apr_shm_open(struct shmem_t *m) +{ + /* If we've forked we need a clone of the original area or we + * will only have access to a one time copy of the data made when + * the fork occurred. This strange bit of code fixes that problem! + */ + thread_info ti; + area_info ai; + area_id deleteme = area_for(m->memblock); + + /* we need to check which team we're in, so we need to get + * the appropriate info structures for the current thread and + * the area we're using. + */ + get_area_info(m->aid, &ai); + get_thread_info(find_thread(NULL), &ti); + + if (ti.team != ai.team){ + area_id nai; + /* if we are in a child then we need to delete the system + * created area as it's a one time copy and won't be a clone + * which is not good. + */ + delete_area(deleteme); + /* now we make our own clone and use that from now on! */ + nai = clone_area(ai.name, &(ai.address), B_CLONE_ADDRESS, + B_READ_AREA | B_WRITE_AREA, ai.area); + get_area_info(nai, &ai); + m->memblock = ai.address; + } + + return APR_SUCCESS; +} + +apr_status_t apr_shm_avail(struct shmem_t *m, apr_size_t *size) +{ + *size = m->avail; + if (m->avail == 0) + return APR_ENOSHMAVAIL; + return APR_SUCCESS; + +} From af4b74474cef237bd7a36aeeb16280907b1831c7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 1 May 2001 02:03:20 +0000 Subject: [PATCH 1580/7878] Get rid of a bunch of warnings about printf format/argument mismatch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61571 13f79535-47bb-0310-9956-ffa450edef68 --- test/testshmem.c | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/test/testshmem.c b/test/testshmem.c index 59fe32ee421..6b685576c54 100644 --- a/test/testshmem.c +++ b/test/testshmem.c @@ -75,8 +75,8 @@ mbox *boxes; #define SIZE 256 #define CYCLES 40 -#define TESTSIZE 4096 * SIZE -#define TEST2SIZE CYCLES * SIZE +#define TESTSIZE (apr_size_t)(4096 * SIZE) +#define TEST2SIZE (apr_size_t)(CYCLES * SIZE) static void msgwait(int boxnum) { @@ -101,7 +101,8 @@ int main(void) #if APR_HAS_SHARED_MEMORY apr_shmem_t *shm; pid_t pid; - int size, cntr; + int cntr; + apr_size_t size; char *ptrs[CYCLES]; apr_size_t psize[CYCLES]; apr_status_t rv; @@ -123,7 +124,8 @@ int main(void) } printf("OK\n"); - printf("Creating shared memory block (%ld bytes)........", TESTSIZE); + printf("Creating shared memory block (%" APR_SIZE_T_FMT " bytes)........", + TESTSIZE); if (apr_shm_init(&shm, TESTSIZE, NULL, context) != APR_SUCCESS) { fprintf(stderr, "Error allocating shared memory block\n"); exit(-1); @@ -140,22 +142,26 @@ int main(void) fprintf(stdout, "OK\n"); printf("\nAbout to stress the alloc/free cycle.\n"); - printf("Smallest allocation will be %ld bytes\n", psize[0]); - printf("Largest allocation will be %ld bytes\n", psize[CYCLES -1]); + printf("Smallest allocation will be %" APR_SIZE_T_FMT " bytes\n", + psize[0]); + printf("Largest allocation will be %" APR_SIZE_T_FMT " bytes\n", + psize[CYCLES -1]); printf("I will be doing it in %d steps\n", CYCLES); printf("\tAllocating via apr_shm_malloc..............."); for (cntr = 0;cntr < CYCLES;cntr++){ ptrs[cntr] = apr_shm_malloc(shm, psize[cntr]); if (ptrs[cntr] == NULL){ - printf("Failed at step %d, %ld bytes\n", cntr, psize[cntr]); + printf("Failed at step %d, %" APR_SIZE_T_FMT " bytes\n", + cntr, psize[cntr]); exit (-1); } } printf("OK\n\tFreeing....................................."); for (cntr = 0;cntr < CYCLES;cntr++){ if (apr_shm_free(shm, ptrs[cntr]) != APR_SUCCESS){ - printf("Failed at step %d, %ld bytes\n", cntr, psize[cntr]); + printf("Failed at step %d, %" APR_SIZE_T_FMT " bytes\n", + cntr, psize[cntr]); exit (-1); } } @@ -165,14 +171,16 @@ int main(void) for (cntr = CYCLES-1;cntr > -1;cntr--){ ptrs[cntr] = apr_shm_malloc(shm, psize[cntr]); if (ptrs[cntr] == NULL){ - printf("Failed at %ld bytes\n", psize[cntr]); + printf("Failed at %" APR_SIZE_T_FMT" bytes\n", + psize[cntr]); exit (-1); } } printf("OK\n\tFreeing....................................."); for (cntr = 0;cntr < CYCLES;cntr++){ if (apr_shm_free(shm, ptrs[cntr]) != APR_SUCCESS){ - printf("Failed at step %d, %ld bytes\n", cntr, psize[cntr]); + printf("Failed at step %d, %" APR_SIZE_T_FMT + " bytes\n", cntr, psize[cntr]); exit (-1); } } @@ -190,7 +198,9 @@ int main(void) if (cksize == (TESTSIZE - size)){ printf ("OK\n"); } else { - printf ("Failed.\nShould have had %ld bytes, instead there are %ld bytes :(\n", + printf ("Failed.\nShould have had %" APR_SIZE_T_FMT + " bytes, instead there are %" + APR_SIZE_T_FMT " bytes :(\n", TESTSIZE - size, cksize); exit(-1); } @@ -198,13 +208,15 @@ int main(void) printf("%d cycles of malloc and calloc passed.\n\n", CYCLES); printf("Block test.\n"); - printf("\tI am about to allocate %ld bytes..........", TEST2SIZE); + printf("\tI am about to allocate %" APR_SIZE_T_FMT + " bytes..........", TEST2SIZE); if ((ptrs[0] = apr_shm_malloc(shm, TEST2SIZE)) == NULL){ printf("Failed.\n"); exit (-1); } printf ("OK\n"); - printf("\tFreeing the block of %ld bytes............", TEST2SIZE); + printf("\tFreeing the block of %" APR_SIZE_T_FMT + " bytes............", TEST2SIZE); if ((rv = apr_shm_free(shm, ptrs[0])) != APR_SUCCESS){ printf("Failed!\n"); exit(-1); @@ -243,7 +255,9 @@ int main(void) if (cksize == (TESTSIZE - size)){ printf ("OK\n"); } else { - printf ("Failed.\nShould have had %ld bytes, instead there are %ld bytes :(\n", + printf ("Failed.\nShould have had %" + APR_SIZE_T_FMT " bytes, instead there are %" + APR_SIZE_T_FMT " bytes :(\n", TESTSIZE - size, cksize); exit(-1); } From e25a19d470d1537109d657bda17b9ea89d4279ec Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 1 May 2001 02:06:09 +0000 Subject: [PATCH 1581/7878] rm -f is sufficient -- no need to check existence first. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61572 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/buildconf b/buildconf index f5e0ab5fc4a..c2a455aa722 100755 --- a/buildconf +++ b/buildconf @@ -84,10 +84,7 @@ if [ ! -f $ltfile ]; then exit 1 fi -# Ugly. 'cp -f' isn't portable, so we work around -if [ -f build/libtool.m4 ]; then - rm -f build/libtool.m4 -fi +rm -f build/libtool.m4 cp $ltfile build/libtool.m4 # This is just temporary until people's workspaces are cleared -- remove From 1dbd95b5fae04290a82a60e2fbaaa89fb4e3f79f Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 1 May 2001 02:17:16 +0000 Subject: [PATCH 1582/7878] Use symbols for AR and RANLIB. Add missing newline to output. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61573 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index e437a0ab87e..7cdb73ee41e 100644 --- a/configure.in +++ b/configure.in @@ -113,7 +113,7 @@ if test "x$use_libtool" = "xyes"; then lib_target="-rpath \$(libdir) \$\$objects" else lt_compile="\$(COMPILE) -c \$<" - link="ar cr \$(TARGET_LIB) \$\$objects; ranlib \$(TARGET_LIB)" + link="\$(AR) cr \$(TARGET_LIB) \$\$objects; \$(RANLIB) \$(TARGET_LIB)" so_ext="o" lib_target="" fi @@ -126,7 +126,7 @@ AC_SUBST(lib_target) dnl #----------------------------- Checks for compiler flags nl=' ' -echo $ac_n "${nl}Check for compiler flags..." +echo $ac_n "${nl}Check for compiler flags...${nl}" AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile time warnings], [APR_ADDTO(CFLAGS,-g) From 407391e4e6edb513ddedb2a92c14ea59d71a4e8c Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 1 May 2001 04:52:03 +0000 Subject: [PATCH 1583/7878] Add the test and build directories (when present) to the recursive make process, being sure that they are run last. This may not be a good idea if the test programs are not as portable as APR itself. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61574 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ Makefile.in | 2 +- build/Makefile.in | 8 ++++++++ build/rules.mk.in | 21 +++++++++++++++------ configure.in | 2 +- 5 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 build/Makefile.in diff --git a/CHANGES b/CHANGES index 6110dabc481..aa6549dbe6b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Add the test and build directories (when present) to the recursive + make process, being sure that they are run last. [Roy Fielding] + *) Make the apr_mmap_create() function use the native_flags variable. This allows us to actually create WRITEABLE MMAPs. [Ed Korthof ] diff --git a/Makefile.in b/Makefile.in index 31873e56c5e..1184d0f6345 100644 --- a/Makefile.in +++ b/Makefile.in @@ -29,7 +29,7 @@ TARGETS = delete-lib $(TARGET_LIB) delete-exports $(TARGET_EXPORTS) CLEAN_TARGETS = $(TARGET_EXPORTS) DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ - APRVARS libtool build/rules.mk + APRVARS libtool EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in SCANDOC_TEMPLATE = -i$(apr_builders)/scandoc_template.pl diff --git a/build/Makefile.in b/build/Makefile.in new file mode 100644 index 00000000000..c486d6941b3 --- /dev/null +++ b/build/Makefile.in @@ -0,0 +1,8 @@ +TARGETS= +INCLUDES= +DISTCLEAN_TARGETS = rules.mk + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + +# DO NOT REMOVE diff --git a/build/rules.mk.in b/build/rules.mk.in index 08d5b2233cc..fb6b3a2ed6a 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -155,6 +155,14 @@ all-recursive depend-recursive clean-recursive distclean-recursive \ fi; \ if test -z "$$made_local"; then \ $(MAKE) "local-$$otarget" || exit 1; \ + fi; \ + if test -d "test"; then \ + echo "Making $$target in test"; \ + (cd test && $(MAKE) local-$$target) || exit 1; \ + fi; \ + if test -d "build"; then \ + echo "Making $$target in build"; \ + (cd build && $(MAKE) local-$$target) || exit 1; \ fi local-clean: x-local-clean @@ -164,23 +172,23 @@ local-clean: x-local-clean local-distclean: local-clean x-local-distclean $(RM) -f Makefile $(DISTCLEAN_TARGETS) -local-extraclean: local-distclean +local-extraclean: local-distclean x-local-extraclean @if test -n "$(EXTRACLEAN_TARGETS)"; then \ echo $(RM) -f $(EXTRACLEAN_TARGETS) ; \ $(RM) -f $(EXTRACLEAN_TARGETS) ; \ fi -local-all: $(TARGETS) +local-all: $(TARGETS) x-local-all -local-depend: +local-depend: x-local-depend @if test -n "`ls *.c 2> /dev/null`"; then \ echo $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c ; \ $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c ; \ fi # to be filled in by the actual Makefile -x-local-clean x-local-distclean: - +x-local-all x-local-depend: +x-local-clean x-local-distclean x-local-extraclean: # # Implicit rules for creating outputs from input files @@ -198,4 +206,5 @@ x-local-clean x-local-distclean: all-recursive depend-recursive clean-recursive distclean-recursive \ extraclean-recursive local-all local-depend local-clean local-distclean local-extraclean \ - x-local-clean x-local-distclean + x-local-all x-local-depend x-local-clean x-local-distclean \ + x-local-extraclean diff --git a/configure.in b/configure.in index 7cdb73ee41e..dc4d772de80 100644 --- a/configure.in +++ b/configure.in @@ -1114,7 +1114,7 @@ AC_SUBST(EXEEXT) AC_SUBST(LIBTOOL_LIBS) echo "${nl}Construct Makefiles and header files." -MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile" +MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile build/Makefile" SUBDIRS="lib strings passwd tables " for dir in $apr_modules do From eebe32e8976e5cca31597e481c59222b5ad26d57 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 1 May 2001 05:54:21 +0000 Subject: [PATCH 1584/7878] Be careful not to override what was set by configure for ALL_LIBS and order them such that user-defined LIBS are preferred over those picked as EXTRA_LIBS by configure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61575 13f79535-47bb-0310-9956-ffa450edef68 --- build/rules.mk.in | 2 +- test/Makefile.in | 98 +++++++++++++++++++++++------------------------ 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/build/rules.mk.in b/build/rules.mk.in index fb6b3a2ed6a..b3e44f23acd 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -105,7 +105,7 @@ NOTEST_LIBS=@NOTEST_LIBS@ ALL_CPPFLAGS = $(DEFS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS) ALL_CFLAGS = $(EXTRA_CFLAGS) $(NOTEST_CFLAGS) $(CFLAGS) ALL_LDFLAGS = $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(LDFLAGS) -ALL_LIBS = $(EXTRA_LIBS) $(NOTEST_LIBS) $(LIBS) +ALL_LIBS = $(LIBS) $(NOTEST_LIBS) $(EXTRA_LIBS) ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) ### make LTFLAGS somewhat variable? diff --git a/test/Makefile.in b/test/Makefile.in index 884c8c7b60a..35aa7489cb7 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -30,7 +30,7 @@ TARGETS = $(PROGRAMS) # bring in rules.mk for standard functionality @INCLUDE_RULES@ -ALL_LIBS=../libapr.la ../shmem/unix/mm/libmm.la $(LIBS) $(EXTRA_LIBS) +LOCAL_LIBS=../libapr.la ../shmem/unix/mm/libmm.la CLEAN_TARGETS = testfile.tmp @@ -38,77 +38,77 @@ INCDIR=../include INCLUDES=-I$(INCDIR) -testfile@EXEEXT@: testfile.lo ../libapr.la - $(LINK) testfile.lo $(ALL_LIBS) +testfile@EXEEXT@: testfile.lo $(LOCAL_LIBS) + $(LINK) testfile.lo $(LOCAL_LIBS) $(ALL_LIBS) -testnames@EXEEXT@: testnames.lo ../libapr.la - $(LINK) testnames.lo $(ALL_LIBS) +testnames@EXEEXT@: testnames.lo $(LOCAL_LIBS) + $(LINK) testnames.lo $(LOCAL_LIBS) $(ALL_LIBS) -testflock@EXEEXT@: testflock.lo ../libapr.la - $(LINK) testflock.lo $(ALL_LIBS) +testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS) + $(LINK) testflock.lo $(LOCAL_LIBS) $(ALL_LIBS) ### why the export-dynamic? -testdso@EXEEXT@: testdso.lo ../libapr.la - $(LINK) --export-dynamic testdso.lo $(ALL_LIBS) +testdso@EXEEXT@: testdso.lo $(LOCAL_LIBS) + $(LINK) --export-dynamic testdso.lo $(LOCAL_LIBS) $(ALL_LIBS) -testoc@EXEEXT@: testoc.lo ../libapr.la - $(LINK) testoc.lo $(ALL_LIBS) +testoc@EXEEXT@: testoc.lo $(LOCAL_LIBS) + $(LINK) testoc.lo $(LOCAL_LIBS) $(ALL_LIBS) -occhild@EXEEXT@: occhild.lo ../libapr.la - $(LINK) occhild.lo $(ALL_LIBS) +occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS) + $(LINK) occhild.lo $(LOCAL_LIBS) $(ALL_LIBS) -mod_test.so: mod_test.lo ../libapr.la - $(LINK) -shared mod_test.o $(ALL_LIBS) +mod_test.so: mod_test.lo $(LOCAL_LIBS) + $(LINK) -shared mod_test.o $(LOCAL_LIBS) $(ALL_LIBS) -testargs@EXEEXT@: testargs.lo ../libapr.la - $(LINK) testargs.lo $(ALL_LIBS) +testargs@EXEEXT@: testargs.lo $(LOCAL_LIBS) + $(LINK) testargs.lo $(LOCAL_LIBS) $(ALL_LIBS) -testcontext@EXEEXT@: testcontext.lo ../libapr.la - $(LINK) testcontext.lo $(ALL_LIBS) +testcontext@EXEEXT@: testcontext.lo $(LOCAL_LIBS) + $(LINK) testcontext.lo $(LOCAL_LIBS) $(ALL_LIBS) -testproc@EXEEXT@: testproc.lo ../libapr.la - $(LINK) testproc.lo $(ALL_LIBS) +testproc@EXEEXT@: testproc.lo $(LOCAL_LIBS) + $(LINK) testproc.lo $(LOCAL_LIBS) $(ALL_LIBS) -testthread@EXEEXT@: testthread.lo ../libapr.la - $(LINK) testthread.lo $(ALL_LIBS) +testthread@EXEEXT@: testthread.lo $(LOCAL_LIBS) + $(LINK) testthread.lo $(LOCAL_LIBS) $(ALL_LIBS) -testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ ../libapr.la - $(LINK) testsock.lo $(ALL_LIBS) +testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ $(LOCAL_LIBS) + $(LINK) testsock.lo $(LOCAL_LIBS) $(ALL_LIBS) -client@EXEEXT@: client.lo ../libapr.la - $(LINK) client.lo $(ALL_LIBS) +client@EXEEXT@: client.lo $(LOCAL_LIBS) + $(LINK) client.lo $(LOCAL_LIBS) $(ALL_LIBS) -server@EXEEXT@: server.lo sendfile.lo ../libapr.la - $(LINK) server.lo $(ALL_LIBS) +server@EXEEXT@: server.lo sendfile.lo $(LOCAL_LIBS) + $(LINK) server.lo $(LOCAL_LIBS) $(ALL_LIBS) -sendfile@EXEEXT@: sendfile.lo ../libapr.la - $(LINK) sendfile.lo $(ALL_LIBS) +sendfile@EXEEXT@: sendfile.lo $(LOCAL_LIBS) + $(LINK) sendfile.lo $(LOCAL_LIBS) $(ALL_LIBS) -testtime@EXEEXT@: testtime.lo ../libapr.la - $(LINK) testtime.lo $(ALL_LIBS) +testtime@EXEEXT@: testtime.lo $(LOCAL_LIBS) + $(LINK) testtime.lo $(LOCAL_LIBS) $(ALL_LIBS) -testmmap@EXEEXT@: testmmap.lo ../libapr.la - $(LINK) testmmap.lo $(ALL_LIBS) +testmmap@EXEEXT@: testmmap.lo $(LOCAL_LIBS) + $(LINK) testmmap.lo $(LOCAL_LIBS) $(ALL_LIBS) -testshmem@EXEEXT@: testshmem.lo ../libapr.la - $(LINK) testshmem.lo $(ALL_LIBS) +testshmem@EXEEXT@: testshmem.lo $(LOCAL_LIBS) + $(LINK) testshmem.lo $(LOCAL_LIBS) $(ALL_LIBS) -testpipe@EXEEXT@: testpipe.lo ../libapr.la - $(LINK) testpipe.lo $(ALL_LIBS) +testpipe@EXEEXT@: testpipe.lo $(LOCAL_LIBS) + $(LINK) testpipe.lo $(LOCAL_LIBS) $(ALL_LIBS) -testuuid@EXEEXT@: testuuid.lo ../libapr.la - $(LINK) testuuid.lo $(ALL_LIBS) +testuuid@EXEEXT@: testuuid.lo $(LOCAL_LIBS) + $(LINK) testuuid.lo $(LOCAL_LIBS) $(ALL_LIBS) -testsockopt@EXEEXT@: testsockopt.lo ../libapr.la - $(LINK) testsockopt.lo $(ALL_LIBS) +testsockopt@EXEEXT@: testsockopt.lo $(LOCAL_LIBS) + $(LINK) testsockopt.lo $(LOCAL_LIBS) $(ALL_LIBS) -testipsub@EXEEXT@: testipsub.lo ../libapr.la - $(LINK) testipsub.lo $(ALL_LIBS) +testipsub@EXEEXT@: testipsub.lo $(LOCAL_LIBS) + $(LINK) testipsub.lo $(LOCAL_LIBS) $(ALL_LIBS) -testmd5@EXEEXT@: testmd5.lo ../libapr.la - $(LINK) testmd5.lo $(ALL_LIBS) +testmd5@EXEEXT@: testmd5.lo $(LOCAL_LIBS) + $(LINK) testmd5.lo $(LOCAL_LIBS) $(ALL_LIBS) -testpoll@EXEEXT@: testpoll.lo ../libapr.la - $(LINK) testpoll.lo $(ALL_LIBS) +testpoll@EXEEXT@: testpoll.lo $(LOCAL_LIBS) + $(LINK) testpoll.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE From 5de32856aa2ab9cea8bea4b82225567cf1616422 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 1 May 2001 11:09:21 +0000 Subject: [PATCH 1585/7878] get rid of a couple of warnings in testnames.c, one for a bad printf call and one for an argument type mismatch still one left: testnames.c: In function `mergeresult': testnames.c:86: warning: passing arg 1 of `apr_filepath_root' from incompatible pointer type I'm not sure why first parm to apr_filepath_root() and first parm to apr_filepath_merge() have different types (and thus the same local var can't be passed cleanly to both). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61576 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testnames.c b/test/testnames.c index 009d92ae11d..3468b423e21 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -74,7 +74,7 @@ static void mergeresult(char *rootpath, char *addpath, apr_int32_t mergetype, ch { char errmsg[256]; char *dstpath = NULL; - char *srcpath; + const char *srcpath; apr_status_t status = apr_filepath_merge(&dstpath, strcmp(rootpath, "NULL") ? rootpath : NULL, strcmp(addpath, "NULL") ? addpath : NULL, @@ -90,7 +90,7 @@ static void mergeresult(char *rootpath, char *addpath, apr_int32_t mergetype, ch } } else { - fprintf(stderr, "%s result for %s\n", errmsg, tdesc, dstpath); + fprintf(stderr, "%s result for %s\n", errmsg, tdesc); } } From 5c86fb010d8dcd972baee0560ea507ee49b74e2e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 1 May 2001 17:51:39 +0000 Subject: [PATCH 1586/7878] don't build the APR DSO test program automatically... we don't know how to build it portably, and now that we build the test directory automatically it becomes very important to ignore it so that make finishes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61577 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 35aa7489cb7..4ec57897aaf 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -15,15 +15,13 @@ PROGRAMS = \ testmmap@EXEEXT@ \ testshmem@EXEEXT@ \ testpipe@EXEEXT@ \ - testdso@EXEEXT@ \ testoc@EXEEXT@ \ testuuid@EXEEXT@ \ testsockopt@EXEEXT@ \ testipsub@EXEEXT@ \ testmd5@EXEEXT@ \ testpoll@EXEEXT@ \ - occhild@EXEEXT@ \ - mod_test.so + occhild@EXEEXT@ TARGETS = $(PROGRAMS) @@ -32,7 +30,7 @@ TARGETS = $(PROGRAMS) LOCAL_LIBS=../libapr.la ../shmem/unix/mm/libmm.la -CLEAN_TARGETS = testfile.tmp +CLEAN_TARGETS = testfile.tmp testdso@EXEEXT@ mod_test.so INCDIR=../include INCLUDES=-I$(INCDIR) @@ -48,7 +46,7 @@ testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS) $(LINK) testflock.lo $(LOCAL_LIBS) $(ALL_LIBS) ### why the export-dynamic? -testdso@EXEEXT@: testdso.lo $(LOCAL_LIBS) +testdso@EXEEXT@: testdso.lo mod_test.so $(LOCAL_LIBS) $(LINK) --export-dynamic testdso.lo $(LOCAL_LIBS) $(ALL_LIBS) testoc@EXEEXT@: testoc.lo $(LOCAL_LIBS) From 9abe9711bcc061b49042052a81f89fc37dbedff3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 1 May 2001 19:29:34 +0000 Subject: [PATCH 1587/7878] when DSO support is enabled, assume for OS/390 that APR symbols should be exported and hard-code required CFLAGS for OS/390 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61578 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index dc4d772de80..133f94a1c8a 100644 --- a/configure.in +++ b/configure.in @@ -804,9 +804,13 @@ AC_ARG_ENABLE(dso, fi if test "$tempdso" = "no"; then case $OS in - *os390|*-os2*) + *-os2*) tempdso="yes" ;; + *os390) + tempdso="yes" + APR_ADDTO(CFLAGS, [-Wc,DLL,EXPORTALL]) + ;; esac fi ] ) From e312d78326241e21926c498d2cc293b8f304232b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 1 May 2001 19:36:05 +0000 Subject: [PATCH 1588/7878] ignore generated file "Makefile" git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61579 13f79535-47bb-0310-9956-ffa450edef68 --- build/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/build/.cvsignore b/build/.cvsignore index 6226c1f67e2..2531063d20d 100644 --- a/build/.cvsignore +++ b/build/.cvsignore @@ -1,3 +1,4 @@ +Makefile libtool.m4 ltconfig ltmain.sh From bdd44bd214a7a4645efba470a1c7036c6ba982d3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 2 May 2001 02:32:49 +0000 Subject: [PATCH 1589/7878] Add a family field to apr_sockaddr_t so there is a straightforward place to look to find the address family. (Yes, it could be found in addr->sa.sin.sin_family even if it was not an AF_INET socket but that isn't so friendly.) Also, try fairly hard to get the port field filled out properly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61580 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 2 ++ network_io/os2/sockets.c | 4 +++- network_io/unix/sa_common.c | 4 ++++ network_io/unix/sockets.c | 4 +++- network_io/win32/sockets.c | 4 +++- test/client.c | 2 +- 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 316ac95f3a6..ac1e0bd728b 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -176,6 +176,8 @@ struct apr_sockaddr_t { char *servname; /** The numeric port */ apr_port_t port; + /** The family */ + apr_int32_t family; union { /** IPv4 sockaddr structure */ struct sockaddr_in sin; diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 6b6ba9328d1..c1a7c5185a8 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -85,7 +85,9 @@ static apr_status_t socket_cleanup(void *sock) static void set_socket_vars(apr_socket_t *sock, int family) { + sock->local_addr->family = family; sock->local_addr->sa.sin.sin_family = family; + sock->remote_addr->family = family; sock->remote_addr->sa.sin.sin_family = family; if (family == AF_INET) { @@ -222,7 +224,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn if ((*new)->socketdes < 0) { return APR_OS2_STATUS(sock_errno()); } - + (*new)->remote_addr->port = ntohs((*new)->remote_addr->sa.sin.sin_port); apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index b823a91fb65..a4c5c940e32 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -74,6 +74,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, apr_port_t port) { + sockaddr->port = port; /* XXX IPv6: assumes sin_port and sin6_port at same offset */ sockaddr->sa.sin.sin_port = htons(port); return APR_SUCCESS; @@ -137,6 +138,9 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, static void set_sockaddr_vars(apr_sockaddr_t *addr, int family) { + addr->family = family; + /* XXX IPv6: assumes sin_port and sin6_port at same offset */ + addr->port = ntohs(addr->sa.sin.sin_port); addr->sa.sin.sin_family = family; if (family == APR_INET) { diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index adeb9612110..d60712e9e11 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -75,7 +75,9 @@ static apr_status_t socket_cleanup(void *sock) static void set_socket_vars(apr_socket_t *sock, int family, int type) { sock->type = type; + sock->local_addr->family = family; sock->local_addr->sa.sin.sin_family = family; + sock->remote_addr->family = family; sock->remote_addr->sa.sin.sin_family = family; if (family == APR_INET) { @@ -224,7 +226,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn (*new)->local_addr->ipaddr_ptr = &(*new)->local_addr->sa.sin6.sin6_addr; } #endif - + (*new)->remote_addr->port = ntohs((*new)->remote_addr->sa.sin.sin_port); if (sock->local_port_unknown) { /* not likely for a listening socket, but theoretically possible :) */ (*new)->local_port_unknown = 1; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 74875894245..dff1cd78072 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -75,7 +75,9 @@ static apr_status_t socket_cleanup(void *sock) static void set_socket_vars(apr_socket_t *sock, int family, int type) { sock->type = type; + sock->local_addr->family = family; sock->local_addr->sa.sin.sin_family = family; + sock->remote_addr->family = family; sock->remote_addr->sa.sin.sin_family = family; if (family == AF_INET) { @@ -248,7 +250,7 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, (*new)->local_addr->ipaddr_ptr = &(*new)->local_addr->sa.sin6.sin6_addr; } #endif - + (*new)->remote_addr->port = ntohs((*new)->remote_addr->sa.sin.sin_port); if (sock->local_port_unknown) { /* not likely for a listening socket, but theoretically possible :) */ (*new)->local_port_unknown = 1; diff --git a/test/client.c b/test/client.c index bb5d3db6378..7f95d5ba2ad 100644 --- a/test/client.c +++ b/test/client.c @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) fprintf(stdout,"OK\n"); fprintf(stdout, "\tClient: Creating new socket......."); - if (apr_socket_create(&sock, remote_sa->sa.sin.sin_family, SOCK_STREAM, + if (apr_socket_create(&sock, remote_sa->family, SOCK_STREAM, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); From d6425042e16612d077cb439554326a6355c74acc Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 2 May 2001 02:54:11 +0000 Subject: [PATCH 1590/7878] Fix a problem on unixware where clearing h_errno wouldn't work. Use set_h_errno() instead. PR: 7651 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61581 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 2 ++ network_io/unix/sa_common.c | 10 +++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index aa6549dbe6b..08f11c6f917 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix a problem on unixware where clearing h_errno wouldn't work. + Use set_h_errno() instead. PR #7651 [Jeff Trawick] + *) Add the test and build directories (when present) to the recursive make process, being sure that they are run last. [Roy Fielding] diff --git a/configure.in b/configure.in index 133f94a1c8a..a4af625a719 100644 --- a/configure.in +++ b/configure.in @@ -1065,6 +1065,8 @@ AC_SUBST(apr_tcp_nopush_flag) AC_SUBST(have_corkable_tcp) AC_SUBST(accept_filter) +AC_CHECK_FUNCS(set_h_errno) + echo $ac_n "${nl}Checking for IPv6 Networking support...${nl}" dnl # Start of checking for IPv6 support... AC_SEARCH_LIBS(getaddrinfo, inet6) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index a4c5c940e32..5e1a7e329d4 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -71,6 +71,12 @@ #include #endif +#ifdef HAVE_SET_H_ERRNO +#define SET_H_ERRNO(newval) set_h_errno(newval) +#else +#define SET_H_ERRNO(newval) h_errno = (newval) +#endif + APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, apr_port_t port) { @@ -441,7 +447,9 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, char tmphostname[256]; #endif - h_errno = 0; /* don't know if it is portable for getnameinfo() to set h_errno */ + /* don't know if it is portable for getnameinfo() to set h_errno; + * clear it then see if it was set */ + SET_H_ERRNO(0); /* default flags are NI_NAMREQD; otherwise, getnameinfo() will return * a numeric address string if it fails to resolve the host name; * that is *not* what we want here From c289c01b50ba0a6edf06cbad387e50b6cb71ea06 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 2 May 2001 19:59:54 +0000 Subject: [PATCH 1591/7878] APRize WAIT_TIMEOUT before return from apr_sendfile() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61582 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 8f26e07c440..812475d63be 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -332,9 +332,16 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (rv == WAIT_OBJECT_0) status = APR_SUCCESS; else if (rv == WAIT_TIMEOUT) - status = WAIT_TIMEOUT; - else if (rv == WAIT_ABANDONED) - status = WAIT_ABANDONED; + status = APR_FROM_OS_ERROR(WAIT_TIMEOUT); + else if (rv == WAIT_ABANDONED) { + /* Hummm... WAIT_ABANDONDED is not an error code. It is + * a return specific to the Win32 WAIT functions that + * indicates that a thread exited while holding a + * mutex. Should consider triggering an assert + * to detect the condition... + */ + status = APR_FROM_OS_ERROR(WAIT_TIMEOUT); + } else status = apr_get_os_error(); } From 2d8432df1ba39f207bfadbc0f1113a18192e6f49 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 2 May 2001 20:01:43 +0000 Subject: [PATCH 1592/7878] Win32: Include WAIT_TIMEOUT in the APR_STATUS_IS_ETIMEDOUT check. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61583 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 5aa49d1331c..32660888e1b 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -667,7 +667,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + WSAECONNRESET) #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ - || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT) + || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT) \ + || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ From 1562a1280648e80192787c780ad541621d98810b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 3 May 2001 16:51:05 +0000 Subject: [PATCH 1593/7878] Patch to allow %qd within apr_snprintf, but handle the platform specific APR_INT64_T_FMT string regardless (e.g. older lld or win32 I64d). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61584 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index aec8d740c03..5bccc15b5a2 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -807,7 +807,13 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * Modifier check */ - if (*fmt == 'q') { + if (strncmp(fmt, APR_INT64_T_FMT, + sizeof(APR_INT64_T_FMT) - 2) == 0) { + /* Need to account for trailing 'd' and null in sizeof() */ + var_type = IS_QUAD; + fmt += (sizeof(APR_INT64_T_FMT) - 2); + } + else if (*fmt == 'q') { var_type = IS_QUAD; fmt++; } From 7ea4758a047d8304a42df1490a2fffc6ea32d82a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 3 May 2001 22:38:00 +0000 Subject: [PATCH 1594/7878] fix a problem with the FreeBSD flavor of apr_sendfile(); we could return APR_EAGAIN+bytes sent for a non-blocking socket git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61585 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ network_io/unix/sendrecv.c | 18 ++++++++++++------ test/sendfile.c | 1 + 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 08f11c6f917..bad0da9a23a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix a problem with the FreeBSD flavor of apr_sendfile() where we + could return APR_EAGAIN+bytes_sent. [Jeff Trawick] + *) Fix a problem on unixware where clearing h_errno wouldn't work. Use set_h_errno() instead. PR #7651 [Jeff Trawick] diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 467a7a7d86e..1e9df3d6291 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -376,11 +376,6 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, return rv < 0 ? errno : APR_SUCCESS; } -/* These are just demos of how the code for the other OSes. - * I haven't tested these, but they're right in terms of interface. - * I just wanted to see what types of vars would be required from other OSes. - */ - #elif defined(__FreeBSD__) /* Release 3.1 or greater */ @@ -423,6 +418,10 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, * first chunk of data twice, once in the first call and once in the * second. If we are using a timed write, then we check to make sure * we can send data before trying to send it. + * + * JLT: doing this first doesn't eliminate the possibility that + * we get -1/EAGAIN/nbytes>0; AFAICT it just means extra syscalls + * from time to time */ apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { @@ -444,6 +443,13 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, &headerstruct, /* Headers/footers */ &nbytes, /* number of bytes written */ flags); /* undefined, set to 0 */ + /* FreeBSD's sendfile can return -1/EAGAIN even if it + * sent bytes. Sanitize the result so we get normal EAGAIN + * semantics w.r.t. bytes sent. + */ + if (rv == -1 && errno == EAGAIN && nbytes) { + rv = 0; + } } else { /* just trailer bytes... use writev() @@ -462,7 +468,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, } while (rv == -1 && errno == EINTR); (*len) = nbytes; - if (rv == -1 && (errno != EAGAIN || (errno == EAGAIN && sock->timeout < 0))) { + if (rv == -1) { return errno; } return APR_SUCCESS; diff --git a/test/sendfile.c b/test/sendfile.c index 6be409116a1..b8e44ee06f2 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -373,6 +373,7 @@ static int client(client_socket_mode_t socket_mode) printf("apr_sendfile()->%d, sent %ld bytes\n", rv, (long)tmplen); if (rv) { if (APR_STATUS_IS_EAGAIN(rv)) { + assert(tmplen == 0); nsocks = 1; tmprv = apr_poll(pfd, &nsocks, -1); assert(!tmprv); From e79307425f9641820581fca4e60382dc4a328620 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Fri, 4 May 2001 02:39:44 +0000 Subject: [PATCH 1595/7878] Only make test recursively for the *clean targets. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61586 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++- build/Makefile.in | 3 +++ build/rules.mk.in | 14 ++++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index bad0da9a23a..0e41fc68481 100644 --- a/CHANGES +++ b/CHANGES @@ -7,7 +7,8 @@ Changes with APR b1 Use set_h_errno() instead. PR #7651 [Jeff Trawick] *) Add the test and build directories (when present) to the recursive - make process, being sure that they are run last. [Roy Fielding] + make process, being sure that they are run last. test is only done + recursively for make *clean targets. [Roy Fielding] *) Make the apr_mmap_create() function use the native_flags variable. This allows us to actually create WRITEABLE MMAPs. diff --git a/build/Makefile.in b/build/Makefile.in index c486d6941b3..7302da7e1f6 100644 --- a/build/Makefile.in +++ b/build/Makefile.in @@ -5,4 +5,7 @@ DISTCLEAN_TARGETS = rules.mk # bring in rules.mk for standard functionality @INCLUDE_RULES@ +x-local-all x-local-depend x-local-clean: + @echo "Congratulations -- make has successfully completed" + # DO NOT REMOVE diff --git a/build/rules.mk.in b/build/rules.mk.in index b3e44f23acd..128d576682f 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -156,13 +156,15 @@ all-recursive depend-recursive clean-recursive distclean-recursive \ if test -z "$$made_local"; then \ $(MAKE) "local-$$otarget" || exit 1; \ fi; \ - if test -d "test"; then \ - echo "Making $$target in test"; \ - (cd test && $(MAKE) local-$$target) || exit 1; \ - fi; \ + case $$otarget in *clean) \ + if test -d "test"; then \ + echo "Making local-$$otarget in test"; \ + (cd test && $(MAKE) local-$$otarget) || exit 1; \ + fi ;; \ + esac; \ if test -d "build"; then \ - echo "Making $$target in build"; \ - (cd build && $(MAKE) local-$$target) || exit 1; \ + echo "Making local-$$otarget in build"; \ + (cd build && $(MAKE) local-$$otarget) || exit 1; \ fi local-clean: x-local-clean From a7b0f2044880f8a61c82d8d07085bc27785311dd Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 4 May 2001 17:35:44 +0000 Subject: [PATCH 1596/7878] fix a typo in a comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61587 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index fc9f60e9b65..16ae54fea29 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -508,7 +508,7 @@ apr_status_t apr_proc_detach(void); /** * Register an other_child -- a child which must be kept track of so - * that the program knows when it has dies or disappeared. + * that the program knows when it has died or disappeared. * @param pid pid is the pid of the child. * @param maintenance maintenance is a function that is invoked with a * reason and the data pointer passed here. From 8d8b6004d25ace6940106f5009b28bb9c162397f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 4 May 2001 18:33:41 +0000 Subject: [PATCH 1597/7878] get otherchild.c to compile when !APR_HAS_OTHER_CHILD git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61588 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/otherchild.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 3dc6f6ef2a5..8ebe698513b 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -53,6 +53,9 @@ */ #include "apr.h" + +#if APR_HAS_OTHER_CHILD + #include "misc.h" #include "threadproc.h" #include "fileio.h" @@ -198,3 +201,5 @@ APR_DECLARE(void) apr_proc_other_child_check(void) } } } + +#endif /* APR_HAS_OTHER_CHILD */ From 802a9145579a691b108b5fad6e5ad2b065dc0278 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 7 May 2001 14:35:40 +0000 Subject: [PATCH 1598/7878] stop looking for getipnodebyname and getipnodebyaddr; we don't use these functions (note: these simple checks don't work on Tru64, which requires that be included in order to see a rename of the functions via #define) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61589 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure.in b/configure.in index a4af625a719..9ee94f4ceb1 100644 --- a/configure.in +++ b/configure.in @@ -1073,8 +1073,6 @@ AC_SEARCH_LIBS(getaddrinfo, inet6) AC_SEARCH_LIBS(getnameinfo, inet6) APR_CHECK_WORKING_GETADDRINFO APR_CHECK_WORKING_GETNAMEINFO -AC_CHECK_FUNCS(getipnodebyname) -AC_CHECK_FUNCS(getipnodebyaddr) APR_CHECK_SOCKADDR_IN6 AC_MSG_CHECKING(if APR supports IPv6) have_ipv6="0" From 1ff8a96edba232fd5e2cf0ebcd2b7e1a531beb49 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 7 May 2001 18:04:13 +0000 Subject: [PATCH 1599/7878] fix a comment regarding APR_EOF and file I/O; use APR_SUCCESS instead of 0 in apr_file_read() for Win32 Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61590 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 2 +- include/apr_file_io.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 124aea6aa17..46275a96cda 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -209,7 +209,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size *len = pos - (char *)buf; if (*len) { - rv = 0; + rv = APR_SUCCESS; } apr_lock_release(thefile->mutex); } else { diff --git a/include/apr_file_io.h b/include/apr_file_io.h index f5eaba87281..0e6e0e3b265 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -214,7 +214,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, * reflect the number of bytes read. If a char was put back into the * stream via ungetc, it will be the first character returned. * - * It is possible for both bytes to be read and an APR_EOF or other + * It is not possible for both bytes to be read and an APR_EOF or other * error to be returned. * * APR_EINTR is never returned. @@ -275,7 +275,7 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, * is reached. If a char was put back into the stream via ungetc, * it will be the first character returned. * - * It is possible for both bytes to be read and an APR_EOF or other + * It is not possible for both bytes to be read and an APR_EOF or other * error to be returned. * * APR_EINTR is never returned. From 9386a3f325f9b2fbd391a070df4b21176fe70043 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 9 May 2001 11:58:47 +0000 Subject: [PATCH 1600/7878] This removes MM from the beos build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61591 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure.in b/configure.in index 9ee94f4ceb1..1ccc154aac3 100644 --- a/configure.in +++ b/configure.in @@ -177,9 +177,7 @@ case "$OS" in OSDIR="beos" APR_ADDTO(CPPFLAGS,-DBEOS) enable_threads="system_threads" - config_subdirs="shmem/unix/mm" native_mmap_emul="1" - USE_MM=yes APR_CHECK_DEFINE(BONE_VERSION, sys/socket.h) eolstr="\\n" file_as_socket="0" From a243b6c163b3fdda8bfdab42c8d9481bfaba40cd Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 9 May 2001 12:13:27 +0000 Subject: [PATCH 1601/7878] In trying to get as many modules as possible building this flag is required to get mod_auth_dbm building. Is this the correct place for it to be defined though? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61592 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 730f610a82f..44e8f425e95 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -362,7 +362,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(LIBS, [-lbind -lsocket -lbe -lroot]) ;; esac - APR_ADDTO(CPPFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK]) + APR_ADDTO(CPPFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK -DAP_AUTH_DBM_USE_APR]) ;; 4850-*.*) APR_ADDTO(CPPFLAGS, [-DSVR4 -DMPRAS]) From f034a3a8b7296475607a529845fa94ee8f5109b3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 9 May 2001 15:33:20 +0000 Subject: [PATCH 1602/7878] Add a new error value APR_ENOCLEANUP that's used by the new shared memory code. Also start adding the new memory code. I wasn't sure if we wanted to split out the standard memory allocation stuff from the main header as this should be our "standard" and thus normally needed. So, I left it in :) Obtained from: Sander, Luke, Elrond Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61593 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 4 +- include/apr_memory_system.h | 245 +++++++++++++++++++++++++++ include/apr_tracking_memory_system.h | 81 +++++++++ 3 files changed, 328 insertions(+), 2 deletions(-) create mode 100644 include/apr_memory_system.h create mode 100644 include/apr_tracking_memory_system.h diff --git a/include/apr_errno.h b/include/apr_errno.h index 32660888e1b..a07838bb64f 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -302,7 +302,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_EINIT (APR_OS_START_STATUS + 22) #define APR_ENOTIMPL (APR_OS_START_STATUS + 23) #define APR_EMISMATCH (APR_OS_START_STATUS + 24) - +#define APR_ENOCLEANUP (APR_OS_START_STATUS + 25) /* APR STATUS VALUE TESTS */ #define APR_STATUS_IS_INCHILD(s) ((s) == APR_INCHILD) @@ -329,7 +329,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_EINIT(s) ((s) == APR_EINIT) #define APR_STATUS_IS_ENOTIMPL(s) ((s) == APR_ENOTIMPL) #define APR_STATUS_IS_EMISMATCH(s) ((s) == APR_EMISMATCH) - +#define APR_STATUS_IS_ENOCLEANUP(s) ((s) == APR_ENOCLEANUP) /* APR CANONICAL ERROR VALUES */ #ifdef EACCES diff --git a/include/apr_memory_system.h b/include/apr_memory_system.h new file mode 100644 index 00000000000..038ce95ad88 --- /dev/null +++ b/include/apr_memory_system.h @@ -0,0 +1,245 @@ +/* strikerXXX: license goes here */ + +#ifndef APR_MEMORY_SYSTEM_H +#define APR_MEMORY_SYSTEM_H + +/* strikerXXX: includes go here */ +/* strikerXXX: HACK ALERT */ +//#include "apr_stuff.h" +/* END OF HACK */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @package APR memory system + */ + + +/* + * + */ + +typedef struct apr_memory_system_t apr_memory_system_t; + +struct apr_memory_system_cleanup; + +/** + * The memory system structure + */ +struct apr_memory_system_t +{ + apr_memory_system_t *parent_memory_system; + apr_memory_system_t *child_memory_system; + apr_memory_system_t *sibling_memory_system; + apr_memory_system_t **ref_memory_system; + apr_memory_system_t *accounting_memory_system; + + struct apr_memory_system_cleanup *cleanups; + + void * (*malloc_fn)(apr_memory_system_t *memory_system, apr_size_t size); + void * (*realloc_fn)(apr_memory_system_t *memory_system, void *memory, + apr_size_t size); + void (*free_fn)(apr_memory_system_t *memory_system, void *memory); + void (*reset_fn)(apr_memory_system_t *memory_system); + void (*pre_destroy_fn)(apr_memory_system_t *memory_system); + void (*destroy_fn)(apr_memory_system_t *memory_system); + void (*threadsafe_lock_fn)(apr_memory_system_t *memory_system); + void (*threadsafe_unlock_fn)(apr_memory_system_t *memory_system); +}; + +/* + * memory allocation functions + */ + +/** + * Allocate a block of memory using a certain memory system + * @param memory_system The memory system to use + * @param size The (minimal required) size of the block to be allocated + * @return pointer to a newly allocated block of memory, NULL if insufficient + * memory available + * @deffunc void *apr_memory_system_malloc(apr_memory_system_t *memory_system, + * apr_size_t size) + */ +APR_DECLARE(void *) +apr_memory_system_malloc(apr_memory_system_t *memory_system, + apr_size_t size); + +/** + * Change the size of a previously allocated block of memory + * @param memory_system The memory system to use (should be the same as the + * one that returned the block) + * @param mem Pointer to the previously allocated block. If NULL, this + * function acts like apr_memory_system_malloc. + * @param size The (minimal required) size of the block to be allocated + * @return pointer to a newly allocated block of memory, NULL if insufficient + * memory available + * @deffunc void *apr_memory_system_realloc(apr_memory_system_t *memory_system, + * void *mem, apr_size_t size) + */ +APR_DECLARE(void *) +apr_memory_system_realloc(apr_memory_system_t *memory_system, + void *mem, + apr_size_t size); + +/** + * Free a block of memory + * @param memory_system The memory system to use (should be the same as the + * one that returned the block) +G * @param mem The block of memory to be freed + * @deffunc void apr_memory_system_free(apr_memory_system_t *memory_system, + * void *mem) + */ +APR_DECLARE(void) +apr_memory_system_free(apr_memory_system_t *memory_system, + void *mem); + +/* + * memory system functions + */ + +/** + * Create a memory system (actually it initialized a memory system structure) + * @caution Call this function as soon as you have obtained a block of memory + * to serve as a memory system structure from your + * apr_xxx_memory_system_create. Only use this function when you are + * implementing a memory system. + * @param memory The memory to turn into a memory system + * @warning The memory passed in should be at least of size + * sizeof(apr_memory_system_t) + * @param parent_memory_system The parent memory system + * @return The freshly initialized memory system + * @deffunc apr_memory_system_t *apr_memory_system_create(void *memory, + * apr_memory_system_t *parent_memory_system) + */ +APR_DECLARE(apr_memory_system_t *) +apr_memory_system_create(void *memory, + apr_memory_system_t *parent_memory_system); + +/** + * Check if a memory system is obeying all rules. + * @caution Call this function as the last statement before returning a new + * memory system from your apr_xxx_memory_system_create. + * @deffunc void apr_memory_system_validate(apr_memory_system_t *memory_system) + */ +#ifdef APR_MEMORY_SYSTEM_DEBUG +APR_DECLARE(void) +apr_memory_system_assert(apr_memory_system_t *memory_system); +#else +#ifdef apr_memory_system_assert +#undef apr_memory_system_assert +#endif +#define apr_memory_system_assert(memory_system) +#endif /* APR_MEMORY_SYSTEM_DEBUG */ + +/** + * Reset a memory system so it can be reused. + * This will also run all cleanup functions associated with the memory system + * @warning This function will fail if there is no reset function available + * for the given memory system (i.e. the memory system is non- + * tracking). + * @param memory_system The memory system to be reset + * @deffunc void apr_memory_system_reset(apr_memory_system_t *memory_system) + */ +APR_DECLARE(void) +apr_memory_system_reset(apr_memory_system_t *memory_system); + +/** + * Destroy a memory system, effectively freeing all of its memory, and itself. + * This will also run all cleanup functions associated with the memory system. + * @caution Be carefull when using this function with a non-tracking memory + * system + * @param memory_system The memory system to be destroyed + * @deffunc void apr_memory_system_destroy(apr_memory_system_t *memory_system) + */ +APR_DECLARE(void) +apr_memory_system_destroy(apr_memory_system_t *memory_system); + +/** + * Perform thread-safe locking required whilst this memory system is modified + * @param memory_system The memory system to be locked for thread-safety + * @deffunc void apr_memory_system_threadsafe_lock(apr_memory_system_t *memory_system) + */ +APR_DECLARE(void) +apr_memory_system_threadsafe_lock(apr_memory_system_t *memory_system); + +/** + * Release thread-safe locking required whilst this memory system was + * being modified + * @param memory_system The memory system to be released from thread-safety + * @deffunc void apr_memory_system_threadsafe_unlock(apr_memory_system_t *memory_system) + */ +APR_DECLARE(void) +apr_memory_system_threadsafe_unlock(apr_memory_system_t *memory_system); + +/** + * Determine if memory system a is an ancestor of memory system b + * @param a The memory system to search + * @param b The memory system to search for + * @return TRUE if a is an ancestor of b, FALSE if a is not an ancestor of b + * @deffunc apr_bool_t apr_memory_system_is_ancestor(apr_memory_system_t *a, + * apr_memory_system_t *b) + */ +APR_DECLARE(apr_status_t) +apr_memory_system_is_ancestor(apr_memory_system_t *a, apr_memory_system_t *b); + +/* + * memory system cleanup management functions + */ + +/** + * Register a function to be called when a memory system is reset or destroyed + * @param memory_system The memory system to register the cleanup function with + * @param data The data to pass to the cleanup function + * @param cleanup_fn The function to call when the memory system is reset or + * destroyed + * @deffunc void apr_memory_system_cleanup_register(apr_memory_system_t *memory_system, + * void *data, apr_status_t (*cleanup_fn)(void *)); + */ +APR_DECLARE(apr_status_t) +apr_memory_system_cleanup_register(apr_memory_system_t *memory_system, + void *data, + apr_status_t (*cleanup_fn)(void *)); + +/** + * Unregister a previously registered cleanup function + * @param memory_system The memory system the cleanup function is registered + * with + * @param data The data associated with the cleanup function + * @param cleanup_fn The registered cleanup function + * @deffunc void apr_memory_system_cleanup_unregister(apr_memory_system_t *memory_system, + * void *data, apr_status_t (*cleanup_fn)(void *)); + */ +APR_DECLARE(apr_status_t) +apr_memory_system_cleanup_unregister(apr_memory_system_t *memory_system, + void *data, + apr_status_t (*cleanup)(void *)); + +/** + * Run the specified cleanup function immediately and unregister it + * @param memory_system The memory system the cleanup function is registered + * with + * @param data The data associated with the cleanup function + * @param cleanup The registered cleanup function + * @deffunc apr_status_t apr_memory_system_cleanup_run(apr_memory_system_t *memory_system, + * void *data, apr_status_t (*cleanup)(void *)); + */ +APR_DECLARE(apr_status_t) +apr_memory_system_cleanup_run(apr_memory_system_t *memory_system, + void *data, + apr_status_t (*cleanup)(void *)); + +/** + * Create a standard malloc/realloc/free memory system + */ +APR_DECLARE(apr_status_t) +apr_standard_memory_system_create(apr_memory_system_t **memory_system); + + +#ifdef __cplusplus +} +#endif + +#endif /* !APR_MEMORY_SYSTEM_H */ + diff --git a/include/apr_tracking_memory_system.h b/include/apr_tracking_memory_system.h new file mode 100644 index 00000000000..8bf43f6f36b --- /dev/null +++ b/include/apr_tracking_memory_system.h @@ -0,0 +1,81 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_TRACKING_MEMORY_SYSTEM_H +#define APR_TRACKING_MEMORY_SYSTEM_H + +#include "apr_memory_system.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @package APR tracking memory system + */ + +/** + * Create a tracking malloc/realloc/free memory system + */ +APR_DECLARE(apr_status_t) +apr_tracking_memory_system_create(apr_memory_system_t **memory_system, + apr_memory_system_t *parent_memory_system); + + + +#ifdef __cplusplus +} +#endif + +#endif /* !APR_MEMORY_SYSTEM_H */ From 50b24b308c139490346642189ab00ef139ca8ea0 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 9 May 2001 15:36:13 +0000 Subject: [PATCH 1603/7878] The new memory code from Sander, Luke and Elrond. This has been modified to get it building within the APR framework, some code has been adapted to the ASF coding style (though more needs doing). There is still some work to do to get the code integrated correctly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61594 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/Makefile.in | 13 + memory/unix/apr_memory_system.c | 578 +++++++++++++++++++++++ memory/unix/apr_standard_memory_system.c | 123 +++++ memory/unix/apr_tracking_memory_system.c | 227 +++++++++ 4 files changed, 941 insertions(+) create mode 100644 memory/unix/Makefile.in create mode 100644 memory/unix/apr_memory_system.c create mode 100644 memory/unix/apr_standard_memory_system.c create mode 100644 memory/unix/apr_tracking_memory_system.c diff --git a/memory/unix/Makefile.in b/memory/unix/Makefile.in new file mode 100644 index 00000000000..3434fde05b2 --- /dev/null +++ b/memory/unix/Makefile.in @@ -0,0 +1,13 @@ + +TARGETS = apr_memory_system.lo \ + apr_tracking_memory.lo \ + apr_standard_memory_system.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) + +# DO NOT REMOVE diff --git a/memory/unix/apr_memory_system.c b/memory/unix/apr_memory_system.c new file mode 100644 index 00000000000..468a6431795 --- /dev/null +++ b/memory/unix/apr_memory_system.c @@ -0,0 +1,578 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/* This code donated to APR by + * Elrond + * Luke Kenneth Casson Leighton + * Sander Striker + */ + +#include "apr.h" +#include "apr_general.h" +#include "apr_memory_system.h" +#include +#include + +#include /* strikerXXX: had to add this for windows to stop + * complaining, please autoconf the include stuff + */ + +/* + * private structure defenitions + */ +struct apr_memory_system_cleanup +{ + struct apr_memory_system_cleanup *next; + void *data; + apr_status_t (*cleanup_fn)(void *); +}; + +/* + * memory allocation functions + */ + +APR_DECLARE(void *) +apr_memory_system_malloc(apr_memory_system_t *memory_system, + apr_size_t size) +{ + assert(memory_system != NULL); + assert(memory_system->malloc_fn != NULL); + + if (size == 0) + return NULL; + + return memory_system->malloc_fn(memory_system, size); +} + +APR_DECLARE(void *) +apr_memory_system_realloc(apr_memory_system_t *memory_system, + void *mem, + apr_size_t size) +{ + assert(memory_system != NULL); + assert(memory_system->realloc_fn != NULL); + + if (mem == NULL) + return apr_memory_system_malloc(memory_system, size); + + if (size == 0) + { + apr_memory_system_free(memory_system, mem); + return NULL; + } + + return memory_system->realloc_fn(memory_system, mem, size); +} + +APR_DECLARE(void) +apr_memory_system_free(apr_memory_system_t *memory_system, + void *mem) +{ + assert(memory_system != NULL); + + if (mem == NULL) + return; + + if (memory_system->free_fn != NULL) + memory_system->free_fn(memory_system, mem); + +#ifdef APR_MEMORY_SYSTEM_DEBUG + else /* assume this is a tracking memory system */ + { + /* issue a warning: + * WARNING: Called apr_memory_system_free() on a tracking memory system + */ + } +#endif /* APR_MEMORY_SYSTEM_DEBUG */ +} + +/* + * memory system functions + */ + +static int apr_memory_system_is_tracking(apr_memory_system_t *memory_system) +{ + /* + * The presense of a reset function gives us the clue that this is a + * tracking memory system. + */ + return memory_system->reset_fn != NULL; +} + +APR_DECLARE(apr_memory_system_t *) +apr_memory_system_create(void *memory, + apr_memory_system_t *parent_memory_system) +{ + apr_memory_system_t *memory_system; + + if (memory == NULL) + return NULL; + + /* Just typecast it, and clear it */ + memory_system = (apr_memory_system_t *)memory; + memset(memory_system, '\0', sizeof(apr_memory_system_t)); + + /* Initialize the parent and accounting memory system pointers */ + memory_system->parent_memory_system = parent_memory_system; + memory_system->accounting_memory_system = memory_system; + + if (parent_memory_system != NULL) + { + if ((memory_system->sibling_memory_system = + parent_memory_system->child_memory_system) != NULL) + { + memory_system->sibling_memory_system->ref_memory_system = + &memory_system->sibling_memory_system; + } + memory_system->ref_memory_system = + &parent_memory_system->child_memory_system; + parent_memory_system->child_memory_system = memory_system; + } + /* This seems a bit redundant, but we're not taking chances */ + else + { + memory_system->ref_memory_system = NULL; + memory_system->sibling_memory_system = NULL; + memory_system->child_memory_system = NULL; + } + + return memory_system; +} + +#ifdef APR_MEMORY_SYSTEM_DEBUG +APR_DECLARE(void) +apr_memory_system_assert(apr_memory_system_t *memory_system) +{ + apr_memory_system_t *parent; + + /* + * A memory system without a malloc won't do us much good + */ + assert(memory_system->malloc_fn != NULL); + + /* + * Check to see if this is either a non-tracking or + * a tracking memory system. It has to have at least a free + * or destroy function. And to avoid half implementations + * we require reset to be present when destroy is. + */ + assert(memory_system->free_fn != NULL || + (memory_system->destroy_fn != NULL && + memory_system->reset_fn != NULL)); + + assert(memory_system->destroy_fn == NULL || + memory_system->reset_fn != NULL); + + assert(memory_system->reset_fn == NULL || + memory_system->destroy_fn != NULL); + + /* + * Make sure all accounting memory dies with the memory system. + * To be more specific, make sure the accounting memort system + * is either the memory system itself or a direct child. + */ + assert(memory_system->accounting_memory_system == memory_system || + memory_system->accounting_memory_system->parent_memory_system == + memory_system); + + /* + * A non-tracking memory system can be the child of + * another non-tracking memory system if there are no + * tracking ancestors, but in that specific case we issue a + * warning. + */ + if (memory_system->parent_memory_system == NULL) + return; + + parent = memory_system + while (parent) + { + if (apr_memory_system_is_tracking(parent)) + return; /* Tracking memory system found, return satisfied ;-) */ + + parent = parent->parent_memory_system; + } + + /* issue a warning: + * WARNING: A non-tracking memory system was created without a tracking + * parent. + */ +} +#endif /* APR_MEMORY_SYSTEM_DEBUG */ + +/* + * LOCAL FUNCTION used in: + * - apr_memory_system_do_child_cleanups + * - apr_memory_system_reset + * - apr_memory_system_destroy + * + * Call all the cleanup routines registered with a memory system. + */ +static +void +apr_memory_system_do_cleanups(apr_memory_system_t *memory_system) +{ + struct apr_memory_system_cleanup *cleanup; + + cleanup = memory_system->cleanups; + while (cleanup) + { + cleanup->cleanup_fn(cleanup->data); + cleanup = cleanup->next; + } +} + +/* + * LOCAL FUNCTION used in: + * - apr_memory_system_reset + * - apr_memory_system_destroy + * + * This not only calls do_cleanups, but also calls the pre_destroy(!) + */ +static +void +apr_memory_system_do_child_cleanups(apr_memory_system_t *memory_system) +{ + if (memory_system == NULL) + return; + + memory_system = memory_system->child_memory_system; + while (memory_system) + { + apr_memory_system_do_child_cleanups(memory_system); + apr_memory_system_do_cleanups(memory_system); + + if (memory_system->pre_destroy_fn != NULL) + memory_system->pre_destroy_fn(memory_system); + + memory_system = memory_system->sibling_memory_system; + } +} + +APR_DECLARE(void) +apr_memory_system_reset(apr_memory_system_t *memory_system) +{ + assert(memory_system != NULL); + /* Assert when called on a non-tracking memory system */ + assert(memory_system->reset_fn != NULL); + + /* + * Run the cleanups of all child memory systems _including_ + * the accounting memory system. + */ + apr_memory_system_do_child_cleanups(memory_system); + + /* Run all cleanups, the memory will be freed by the reset */ + apr_memory_system_do_cleanups(memory_system); + memory_system->cleanups = NULL; + + /* We don't have any child memory systems after the reset */ + memory_system->child_memory_system = NULL; + + /* Reset the accounting memory system to ourselves, any + * child memory system _including_ the accounting memory + * system will be destroyed by the reset + * strikerXXX: Maybe this should be the responsibility of + * the reset function(?). + */ + memory_system->accounting_memory_system = memory_system; + + /* Let the memory system handle the actual reset */ + memory_system->reset_fn(memory_system); +} + +APR_DECLARE(void) +apr_memory_system_destroy(apr_memory_system_t *memory_system) +{ + apr_memory_system_t *child_memory_system; + apr_memory_system_t *sibling_memory_system; + struct apr_memory_system_cleanup *cleanup; + struct apr_memory_system_cleanup *next_cleanup; + + assert(memory_system != NULL); + + if (apr_memory_system_is_tracking(memory_system)) + { + /* + * Run the cleanups of all child memory systems _including_ + * the accounting memory system. + */ + apr_memory_system_do_child_cleanups(memory_system); + + /* Run all cleanups, the memory will be freed by the destroy */ + apr_memory_system_do_cleanups(memory_system); + } + else + { + if (memory_system->accounting_memory_system != memory_system) + { + child_memory_system = memory_system->accounting_memory_system; + + /* + * Remove the accounting memory system from the memory systems + * child list (we will explicitly destroy it later in this block). + */ + if (child_memory_system->sibling_memory_system != NULL) + child_memory_system->sibling_memory_system->ref_memory_system = + child_memory_system->ref_memory_system; + + *child_memory_system->ref_memory_system = + child_memory_system->sibling_memory_system; + + /* Set this fields so destroy will work */ + child_memory_system->ref_memory_system = NULL; + child_memory_system->sibling_memory_system = NULL; + } + + /* Visit all children and destroy them */ + child_memory_system = memory_system->child_memory_system; + while (child_memory_system != NULL) + { + sibling_memory_system = child_memory_system->sibling_memory_system; + apr_memory_system_destroy(child_memory_system); + child_memory_system = sibling_memory_system; + } + + /* + * If the accounting memory system _is_ tracking, we also know that it is + * not the memory system itself. + */ + if (apr_memory_system_is_tracking(memory_system->accounting_memory_system)) + { + /* + * Run all cleanups, the memory will be freed by the destroying of the + * accounting memory system. + */ + apr_memory_system_do_cleanups(memory_system); + + /* Destroy the accounting memory system */ + apr_memory_system_destroy(memory_system->accounting_memory_system); + + /* + * Set the accounting memory system back to the parent memory system + * just in case... + */ + memory_system->accounting_memory_system = memory_system; + } + else + { + /* Run all cleanups, free'ing memory as we go */ + cleanup = memory_system->cleanups; + while (cleanup) + { + cleanup->cleanup_fn(cleanup->data); + next_cleanup = cleanup->next; + apr_memory_system_free(memory_system->accounting_memory_system, + cleanup); + cleanup = next_cleanup; + } + + if (memory_system->accounting_memory_system != memory_system) + { + /* Destroy the accounting memory system */ + apr_memory_system_destroy(memory_system->accounting_memory_system); + /* + * Set the accounting memory system back to the parent memory system + * just in case... + */ + memory_system->accounting_memory_system = memory_system; + } + } + } + + /* Remove the memory system from the parent memory systems child list */ + if (memory_system->sibling_memory_system != NULL) + memory_system->sibling_memory_system->ref_memory_system = + memory_system->ref_memory_system; + if (memory_system->ref_memory_system != NULL) + *memory_system->ref_memory_system = memory_system->sibling_memory_system; + + /* Call the pre-destroy if present */ + if (memory_system->pre_destroy_fn != NULL) + memory_system->pre_destroy_fn(memory_system); + + /* 1 - If we have a self destruct, use it */ + if (memory_system->destroy_fn != NULL) + memory_system->destroy_fn(memory_system); + + /* 2 - If we don't have a parent, free using ourselves */ + else if (memory_system->parent_memory_system == NULL) + memory_system->free_fn(memory_system, memory_system); + + /* 3 - If we do have a parent and it has a free function, use it */ + else if (memory_system->parent_memory_system->free_fn != NULL) + apr_memory_system_free(memory_system->parent_memory_system, memory_system); + + /* 4 - Assume we are the child of a tracking memory system, and do nothing */ +#ifdef APR_MEMORY_SYSTEM_DEBUG + memory_system = memory_system->parent_memory_system; + while (memory_system) + { + if (apr_memory_system_is_tracking(memory_system)) + return; + + memory_system = memory_system->parent_memory_system; + } + + assert(0); /* Made the wrong assumption, so we assert */ +#endif /* APR_MEMORY_SYSTEM_DEBUG */ +} + +APR_DECLARE(apr_status_t) +apr_memory_system_is_ancestor(apr_memory_system_t *a, + apr_memory_system_t *b) +{ + assert(b != NULL); + + while (b && b != a) + b = b->parent_memory_system; + + /* strikerXXX: should this be: return b == a ? APR_TRUE : APR_FALSE; */ + /* APR_SUCCESS = 0, so if they agree we should return that... */ + return !(b == a); +} + +APR_DECLARE(void) +apr_memory_system_threadsafe_lock(apr_memory_system_t *memory_system) +{ + assert(memory_system != NULL); + if (memory_system->threadsafe_lock_fn != NULL) + memory_system->threadsafe_lock_fn(memory_system); +} + +APR_DECLARE(void) +apr_memory_system_threadsafe_unlock(apr_memory_system_t *memory_system) +{ + assert(memory_system != NULL); + if (memory_system->threadsafe_unlock_fn != NULL) + memory_system->threadsafe_unlock_fn(memory_system); +} + +/* + * memory system cleanup management functions + */ + +APR_DECLARE(apr_status_t) +apr_memory_system_cleanup_register(apr_memory_system_t *memory_system, + void *data, + apr_status_t (*cleanup_fn)(void *)) +{ + struct apr_memory_system_cleanup *cleanup; + + assert(memory_system != NULL); + assert(memory_system->accounting_memory_system != NULL); + + /* + * If someone passes us a NULL cleanup_fn, assert, because the cleanup + * code can't handle it _and_ it makes no sense. + */ + cleanup = (struct apr_memory_system_cleanup *) + apr_memory_system_malloc(memory_system->accounting_memory_system, + sizeof(struct apr_memory_system_cleanup)); + + /* See if we actually got the memory */ + if (cleanup == NULL) + return APR_ENOMEM; /* strikerXXX: Should this become APR_FALSE? */ + + cleanup->data = data; + cleanup->cleanup_fn = cleanup_fn; + cleanup->next = memory_system->cleanups; + memory_system->cleanups = cleanup; + + return APR_SUCCESS; /* strikerXXX: Should this become APR_TRUE? */ +} + +APR_DECLARE(apr_status_t) +apr_memory_system_cleanup_unregister(apr_memory_system_t *memory_system, + void *data, + apr_status_t (*cleanup_fn)(void *)) +{ + struct apr_memory_system_cleanup *cleanup; + struct apr_memory_system_cleanup **cleanup_ref; + + assert(memory_system != NULL); + assert(memory_system->accounting_memory_system != NULL); + + cleanup = memory_system->cleanups; + cleanup_ref = &memory_system->cleanups; + while (cleanup) + { + if (cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) + { + *cleanup_ref = cleanup->next; + + memory_system = memory_system->accounting_memory_system; + + if (memory_system->free_fn != NULL) + apr_memory_system_free(memory_system, cleanup); + + return APR_SUCCESS; /* strikerXXX: Should this become APR_TRUE? */ + } + + cleanup_ref = &cleanup->next; + cleanup = cleanup->next; + } + + /* The cleanup function should have been registered previously */ + return APR_ENOCLEANUP; +} + +APR_DECLARE(apr_status_t) +apr_memory_system_cleanup_run(apr_memory_system_t *memory_system, + void *data, + apr_status_t (*cleanup_fn)(void *)) +{ + apr_memory_system_cleanup_unregister(memory_system, data, cleanup_fn); + return cleanup_fn(data); +} diff --git a/memory/unix/apr_standard_memory_system.c b/memory/unix/apr_standard_memory_system.c new file mode 100644 index 00000000000..8ef0434477d --- /dev/null +++ b/memory/unix/apr_standard_memory_system.c @@ -0,0 +1,123 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/* This code donated to APR by + * Elrond + * Luke Kenneth Casson Leighton + * Sander Striker + */ + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_memory_system.h" +#include +#include + +#include /* strikerXXX: had to add this for windows to stop + * complaining, please autoconf the include stuff + */ + +/* + * standard memory system + */ + +static +void * +apr_standard_memory_system_malloc(apr_memory_system_t *memory_system, + size_t size) +{ + return malloc(size); +} + +static +void * +apr_standard_memory_system_realloc(apr_memory_system_t *memory_system, + void *mem, + size_t size) +{ + return realloc(mem, size); +} + +static +void +apr_standard_memory_system_free(apr_memory_system_t *memory_system, + void *mem) +{ + free(mem); +} + +APR_DECLARE(apr_status_t) +apr_standard_memory_system_create(apr_memory_system_t **memory_system) +{ + apr_memory_system_t *new_memory_system; + + assert(memory_system != NULL); + + *memory_system = NULL; + new_memory_system = apr_memory_system_create( + malloc(sizeof(apr_memory_system_t)), NULL); + + if (new_memory_system == NULL) + return APR_ENOMEM; + + new_memory_system->malloc_fn = apr_standard_memory_system_malloc; + new_memory_system->realloc_fn = apr_standard_memory_system_realloc; + new_memory_system->free_fn = apr_standard_memory_system_free; + + apr_memory_system_assert(new_memory_system); + + *memory_system = new_memory_system; + return APR_SUCCESS; +} diff --git a/memory/unix/apr_tracking_memory_system.c b/memory/unix/apr_tracking_memory_system.c new file mode 100644 index 00000000000..800f2b0c52f --- /dev/null +++ b/memory/unix/apr_tracking_memory_system.c @@ -0,0 +1,227 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/* This code donated to APR by + * Elrond + * Luke Kenneth Casson Leighton + * Sander Striker + */ + +#include "apr.h" +#include "apr_general.h" +#include "apr_private.h" +#include "apr_tracking_memory_system.h" +#include +#include + +/* + * tracking memory system + */ + +/* INTERNALLY USED STRUCTURES */ +typedef struct apr_track_node_t +{ + struct apr_track_node_t *next; + struct apr_track_node_t **ref; +} apr_track_node_t; + +typedef struct apr_tracking_memory_system_t +{ + apr_memory_system_t header; + apr_track_node_t *nodes; +} apr_tracking_memory_system_t; + +static +void * +apr_tracking_memory_system_malloc(apr_memory_system_t *memory_system, + size_t size) +{ + apr_tracking_memory_system_t *tracking_memory_system; + apr_track_node_t *node; + + assert (memory_system != NULL); + + tracking_memory_system = (apr_tracking_memory_system_t *)memory_system; + node = apr_memory_system_malloc(memory_system->parent_memory_system, + size + sizeof(apr_track_node_t)); + if (node == NULL) + return NULL; + + node->next = tracking_memory_system->nodes; + tracking_memory_system->nodes = node; + node->ref = &tracking_memory_system->nodes; + if (node->next != NULL) + node->next->ref = &node->next; + + node++; + + return (void *)node; +} + +static +void * +apr_tracking_memory_system_realloc(apr_memory_system_t *memory_system, + void *mem, + size_t size) +{ + apr_tracking_memory_system_t *tracking_memory_system; + apr_track_node_t *node; + + assert (memory_system != NULL); + + tracking_memory_system = (apr_tracking_memory_system_t *)memory_system; + node = (apr_track_node_t *)mem; + + if (node != NULL) + { + node--; + *(node->ref) = node->next; + } + + node = apr_memory_system_realloc(memory_system->parent_memory_system, + node, size + sizeof(apr_track_node_t)); + if (node == NULL) + return NULL; + + node->next = tracking_memory_system->nodes; + tracking_memory_system->nodes = node; + node->ref = &tracking_memory_system->nodes; + if (node->next != NULL) + node->next->ref = &node->next; + + node++; + + return (void *)node; +} + +static +void +apr_tracking_memory_system_free(apr_memory_system_t *memory_system, + void *mem) +{ + apr_track_node_t *node; + + assert (memory_system != NULL); + assert (mem != NULL); + + node = (apr_track_node_t *)mem; + node--; + + *(node->ref) = node->next; + + apr_memory_system_free(memory_system->parent_memory_system, node); +} + +static +void +apr_tracking_memory_system_reset(apr_memory_system_t *memory_system) +{ + apr_tracking_memory_system_t *tracking_memory_system; + apr_track_node_t *node; + + assert (memory_system != NULL); + + tracking_memory_system = (apr_tracking_memory_system_t *)memory_system; + + while (tracking_memory_system->nodes != NULL) + { + node = tracking_memory_system->nodes; + *(node->ref) = node->next; + apr_memory_system_free(memory_system->parent_memory_system, node); + } +} + +static +void +apr_tracking_memory_system_destroy(apr_memory_system_t *memory_system) +{ + assert (memory_system != NULL); + + apr_tracking_memory_system_reset(memory_system); + apr_memory_system_free(memory_system->parent_memory_system, memory_system); +} + +APR_DECLARE(apr_status_t) +apr_tracking_memory_system_create(apr_memory_system_t **memory_system, + apr_memory_system_t *parent_memory_system) +{ + apr_memory_system_t *new_memory_system; + apr_tracking_memory_system_t *tracking_memory_system; + + assert (memory_system != NULL); + assert (parent_memory_system != NULL); + + new_memory_system = apr_memory_system_create( + apr_memory_system_malloc(parent_memory_system, + sizeof(apr_tracking_memory_system_t)), + parent_memory_system); + + *memory_system = NULL; + if (new_memory_system == NULL) + return APR_ENOMEM; + + new_memory_system->malloc_fn = apr_tracking_memory_system_malloc; + new_memory_system->realloc_fn = apr_tracking_memory_system_realloc; + new_memory_system->free_fn = apr_tracking_memory_system_free; + new_memory_system->reset_fn = apr_tracking_memory_system_reset; + new_memory_system->destroy_fn = apr_tracking_memory_system_destroy; + + tracking_memory_system = (apr_tracking_memory_system_t *)new_memory_system; + tracking_memory_system->nodes = NULL; + + apr_memory_system_assert(new_memory_system); + + *memory_system = new_memory_system; + return APR_SUCCESS; +} From 1bfbed8da75bdb3d2edd9e6130fcb61c41d2edb2 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 9 May 2001 15:37:24 +0000 Subject: [PATCH 1604/7878] Add cvs goodness... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61595 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/.cvsignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 memory/unix/.cvsignore diff --git a/memory/unix/.cvsignore b/memory/unix/.cvsignore new file mode 100644 index 00000000000..aaaad72bcdb --- /dev/null +++ b/memory/unix/.cvsignore @@ -0,0 +1,4 @@ +Makefile +*.lo +.libs +*.o From 699f341e9526f907e9891179c43141d435bc2cdf Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 9 May 2001 16:30:21 +0000 Subject: [PATCH 1605/7878] Thought I'd already done this... This is needed to get the new memory stuff building. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61596 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memory/unix/Makefile.in b/memory/unix/Makefile.in index 3434fde05b2..aa29d6e5886 100644 --- a/memory/unix/Makefile.in +++ b/memory/unix/Makefile.in @@ -1,7 +1,7 @@ TARGETS = apr_memory_system.lo \ - apr_tracking_memory.lo \ - apr_standard_memory_system.lo + apr_tracking_memory_system.lo \ + apr_standard_memory_system.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ From f588f962f98ef1cfc4613a44846ff20b0dd6479e Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 9 May 2001 16:32:26 +0000 Subject: [PATCH 1606/7878] BeOS now uses it's own shmem files and doesn't need MM, so this code can be simplified. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61597 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shmem.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 5647842861d..a9c5d01f069 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -57,15 +57,8 @@ #include "apr_shmem.h" #include "apr_errno.h" -#if BEOS -#include -#endif - struct shmem_t { MM *mm; -#if BEOS - area_id id; -#endif }; apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) @@ -82,9 +75,6 @@ apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *fi return errno; } (*m)->mm = newmm; -#if BEOS - (*m)->id = area_for((*m)); -#endif return APR_SUCCESS; } @@ -149,36 +139,6 @@ apr_status_t apr_shm_open(struct shmem_t *c) { #if APR_USES_ANONYMOUS_SHM -#if BEOS - /* If we've forked we need a clone of the original area or we - * will only have access to a one time copy of the data made when - * the fork occurred. This strange bit of code fixes that problem! - */ - thread_info ti; - area_info ai; - area_id deleteme = area_for(c); - - /* we need to check which team we're in, so we need to get - * the appropriate info structures for the current thread and - * the area we're using. - */ - get_area_info(c->id, &ai); - get_thread_info(find_thread(NULL), &ti); - - if (ti.team != ai.team){ - area_id nai; - /* if we are in a child then we need to delete the system - * created area as it's a one time copy and won't be a clone - * which is not good. - */ - delete_area(deleteme); - /* now we make our own clone and use that from now on! */ - nai = clone_area(ai.name, &(ai.address), B_CLONE_ADDRESS, - B_READ_AREA | B_WRITE_AREA, ai.area); - get_area_info(nai, &ai); - c = ai.address; - } -#endif /* When using MM, we don't need to open shared memory segments in child * segments, so just return immediately. */ From eb323a8d4b4c41bfbb8fae6bfdde6c9f34689b0f Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 9 May 2001 16:44:46 +0000 Subject: [PATCH 1607/7878] Thought I'd already added the licence to the main memory header, so here it is. Also some small changes to make the files more usable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61598 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_memory_system.h | 66 +++++++++++++++++++++++----- include/apr_tracking_memory_system.h | 1 + 2 files changed, 56 insertions(+), 11 deletions(-) diff --git a/include/apr_memory_system.h b/include/apr_memory_system.h index 038ce95ad88..792f0f69f56 100644 --- a/include/apr_memory_system.h +++ b/include/apr_memory_system.h @@ -1,12 +1,61 @@ -/* strikerXXX: license goes here */ - +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + #ifndef APR_MEMORY_SYSTEM_H #define APR_MEMORY_SYSTEM_H -/* strikerXXX: includes go here */ -/* strikerXXX: HACK ALERT */ -//#include "apr_stuff.h" -/* END OF HACK */ +#include "apr.h" #ifdef __cplusplus extern "C" { @@ -16,11 +65,6 @@ extern "C" { * @package APR memory system */ - -/* - * - */ - typedef struct apr_memory_system_t apr_memory_system_t; struct apr_memory_system_cleanup; diff --git a/include/apr_tracking_memory_system.h b/include/apr_tracking_memory_system.h index 8bf43f6f36b..4d6dad1e4bf 100644 --- a/include/apr_tracking_memory_system.h +++ b/include/apr_tracking_memory_system.h @@ -55,6 +55,7 @@ #ifndef APR_TRACKING_MEMORY_SYSTEM_H #define APR_TRACKING_MEMORY_SYSTEM_H +#include "apr.h" #include "apr_memory_system.h" #ifdef __cplusplus From b28287a57c0cca9d07405f823164f353c3ae7b44 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 9 May 2001 17:46:18 +0000 Subject: [PATCH 1608/7878] Add a test file for the new memory code. Pretty simple, but at least it tests that the code works and allows development to continue. Not included in the normal build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61599 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 3 + test/testmem.c | 163 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 test/testmem.c diff --git a/test/Makefile.in b/test/Makefile.in index 4ec57897aaf..3ad7ee5ef3e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -109,4 +109,7 @@ testmd5@EXEEXT@: testmd5.lo $(LOCAL_LIBS) testpoll@EXEEXT@: testpoll.lo $(LOCAL_LIBS) $(LINK) testpoll.lo $(LOCAL_LIBS) $(ALL_LIBS) +testmem@EXEEXT@: testmem.lo $(LOCAL_LIBS) + $(LINK) testmem.lo $(LOCAL_LIBS) $(ALL_LIBS) + # DO NOT REMOVE diff --git a/test/testmem.c b/test/testmem.c new file mode 100644 index 00000000000..d98a154c008 --- /dev/null +++ b/test/testmem.c @@ -0,0 +1,163 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_memory_system.h" +#include "apr_tracking_memory_system.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include "apr_time.h" +#include +#include +#include +#if APR_HAVE_UNISTD_H +#include +#endif + +#define LUMPS 10 +#define LUMP_SIZE 1024 + +static void do_test(apr_memory_system_t *ams) +{ + int cntr,cntr2; + char *ptrs[LUMPS]; + + printf("\tCreating %d lumps of memory, each %d bytes........", + LUMPS, LUMP_SIZE); + for (cntr = 0;cntr < LUMPS;cntr ++){ + ptrs[cntr] = apr_memory_system_malloc(ams, LUMP_SIZE); + if (!ptrs[cntr]){ + printf("Failed @ lump %d of %d\n", cntr + 1, LUMPS); + exit (-1); + } + } + printf ("OK\n"); + + printf("\tWriting to the lumps of memory......................"); + for (cntr = 0;cntr < LUMPS;cntr ++){ + if (memset(ptrs[cntr], cntr, LUMP_SIZE) != ptrs[cntr]){ + printf("Failed to write into lump %d\n", cntr + 1); + exit(-1); + } + } + printf("OK\n"); + + printf("\tCheck what we wrote................................."); + for (cntr = 0;cntr < LUMPS;cntr++){ + for (cntr2 = 0;cntr2 < LUMP_SIZE; cntr2 ++){ + if (*(ptrs[cntr] + cntr2) != cntr){ + printf("Got %d instead of %d at byte %d\n", + *(ptrs[cntr] + cntr2), cntr, cntr2 + 1); + exit (-1); + } + } + } + printf("OK\n"); + + printf("\tFreeing the memory we created......................."); + for (cntr = 0;cntr < LUMPS;cntr ++){ + if (apr_memory_system_free(ams, ptrs[cntr]) != APR_SUCCESS){ + printf("Failed to free block %d\n", cntr + 1); + exit (-1); + } + } + printf("OK\n"); +} + +int main(void) +{ + apr_memory_system_t *ams, *ams2; + apr_initialize(); + + printf("APR Memory Test\n"); + printf("===============\n\n"); + + printf("Standard Memory\n"); + printf("\tCreating the memory area............................"); + if (apr_standard_memory_system_create(&ams) != APR_SUCCESS){ + printf("Failed.\n"); + exit(-1); + } + printf("OK\n"); + + do_test(ams); + + printf("Tracking Memory\n"); + printf("\tCreating the memory area............................"); + if (apr_tracking_memory_system_create(&ams2, ams) != APR_SUCCESS){ + printf("Failed.\n"); + exit(-1); + } + printf("OK\n"); + + do_test(ams2); + + printf("Trying to destroy the tracking memory segment..............."); + if (apr_memory_system_destroy(ams2) != APR_SUCCESS){ + printf("Failed.\n"); + exit (-1); + } + printf("OK\n"); + + printf("Trying to destroy the standard memory segment..............."); + if (apr_memory_system_destroy(ams) != APR_SUCCESS){ + printf("Failed.\n"); + exit (-1); + } + printf("OK\n\n"); + + printf("Memory test complete.\n"); + return (0); +} From 5e1850feaff408b3952ccd3e39ebf7e16b409b74 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 9 May 2001 18:11:57 +0000 Subject: [PATCH 1609/7878] Some small changes to the return values of some functions. Basically these changes allow us to check that all went well. However, as we're not yet passing errors "up" from the lower levels this also needs fixed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61600 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_memory_system.h | 5 +++-- memory/unix/apr_memory_system.c | 12 +++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/apr_memory_system.h b/include/apr_memory_system.h index 792f0f69f56..f30c60b705f 100644 --- a/include/apr_memory_system.h +++ b/include/apr_memory_system.h @@ -56,6 +56,7 @@ #define APR_MEMORY_SYSTEM_H #include "apr.h" +#include "apr_errno.h" #ifdef __cplusplus extern "C" { @@ -135,7 +136,7 @@ G * @param mem The block of memory to be freed * @deffunc void apr_memory_system_free(apr_memory_system_t *memory_system, * void *mem) */ -APR_DECLARE(void) +APR_DECLARE(apr_status_t) apr_memory_system_free(apr_memory_system_t *memory_system, void *mem); @@ -197,7 +198,7 @@ apr_memory_system_reset(apr_memory_system_t *memory_system); * @param memory_system The memory system to be destroyed * @deffunc void apr_memory_system_destroy(apr_memory_system_t *memory_system) */ -APR_DECLARE(void) +APR_DECLARE(apr_status_t) apr_memory_system_destroy(apr_memory_system_t *memory_system); /** diff --git a/memory/unix/apr_memory_system.c b/memory/unix/apr_memory_system.c index 468a6431795..b6c273c5983 100644 --- a/memory/unix/apr_memory_system.c +++ b/memory/unix/apr_memory_system.c @@ -115,14 +115,14 @@ apr_memory_system_realloc(apr_memory_system_t *memory_system, return memory_system->realloc_fn(memory_system, mem, size); } -APR_DECLARE(void) +APR_DECLARE(apr_status_t) apr_memory_system_free(apr_memory_system_t *memory_system, void *mem) { assert(memory_system != NULL); if (mem == NULL) - return; + return APR_EINVAL; /* Hmm, is this an error??? */ if (memory_system->free_fn != NULL) memory_system->free_fn(memory_system, mem); @@ -135,6 +135,7 @@ apr_memory_system_free(apr_memory_system_t *memory_system, */ } #endif /* APR_MEMORY_SYSTEM_DEBUG */ + return APR_SUCCESS; } /* @@ -157,7 +158,7 @@ apr_memory_system_create(void *memory, apr_memory_system_t *memory_system; if (memory == NULL) - return NULL; + return NULL; /* Just typecast it, and clear it */ memory_system = (apr_memory_system_t *)memory; @@ -332,7 +333,7 @@ apr_memory_system_reset(apr_memory_system_t *memory_system) memory_system->reset_fn(memory_system); } -APR_DECLARE(void) +APR_DECLARE(apr_status_t) apr_memory_system_destroy(apr_memory_system_t *memory_system) { apr_memory_system_t *child_memory_system; @@ -460,13 +461,14 @@ apr_memory_system_destroy(apr_memory_system_t *memory_system) while (memory_system) { if (apr_memory_system_is_tracking(memory_system)) - return; + return APR_SUCCESS; memory_system = memory_system->parent_memory_system; } assert(0); /* Made the wrong assumption, so we assert */ #endif /* APR_MEMORY_SYSTEM_DEBUG */ + return APR_SUCCESS; } APR_DECLARE(apr_status_t) From f68ff5a346c96e3f2162da5561823f6cf9743787 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 9 May 2001 18:25:58 +0000 Subject: [PATCH 1610/7878] Add testmem to the cvsignore... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61601 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.cvsignore b/test/.cvsignore index b2a9a2b752b..57d1c204912 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -37,3 +37,4 @@ testipsub mod_test.dll testnames *.dbg +testmem From 3ade3f579e18b6adfb3e8573f79a502811b31fb8 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 10 May 2001 10:33:15 +0000 Subject: [PATCH 1611/7878] Some more updates and small corrections to the memory code. This starts to implement the returning of apr_status_t from more functions. Submitted by: Sander Striker Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61602 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_memory_system.h | 16 +++++----- include/apr_tracking_memory_system.h | 4 +-- memory/unix/apr_memory_system.c | 20 ++++++------ memory/unix/apr_standard_memory_system.c | 39 +++++++++++------------- memory/unix/apr_tracking_memory_system.c | 36 ++++++++++++---------- 5 files changed, 57 insertions(+), 58 deletions(-) diff --git a/include/apr_memory_system.h b/include/apr_memory_system.h index f30c60b705f..cac7c2451b9 100644 --- a/include/apr_memory_system.h +++ b/include/apr_memory_system.h @@ -86,8 +86,8 @@ struct apr_memory_system_t void * (*malloc_fn)(apr_memory_system_t *memory_system, apr_size_t size); void * (*realloc_fn)(apr_memory_system_t *memory_system, void *memory, apr_size_t size); - void (*free_fn)(apr_memory_system_t *memory_system, void *memory); - void (*reset_fn)(apr_memory_system_t *memory_system); + apr_status_t (*free_fn)(apr_memory_system_t *memory_system, void *memory); + apr_status_t (*reset_fn)(apr_memory_system_t *memory_system); void (*pre_destroy_fn)(apr_memory_system_t *memory_system); void (*destroy_fn)(apr_memory_system_t *memory_system); void (*threadsafe_lock_fn)(apr_memory_system_t *memory_system); @@ -132,7 +132,7 @@ apr_memory_system_realloc(apr_memory_system_t *memory_system, * Free a block of memory * @param memory_system The memory system to use (should be the same as the * one that returned the block) -G * @param mem The block of memory to be freed + * @param mem The block of memory to be freed * @deffunc void apr_memory_system_free(apr_memory_system_t *memory_system, * void *mem) */ @@ -185,9 +185,9 @@ apr_memory_system_assert(apr_memory_system_t *memory_system); * for the given memory system (i.e. the memory system is non- * tracking). * @param memory_system The memory system to be reset - * @deffunc void apr_memory_system_reset(apr_memory_system_t *memory_system) + * @deffunc apr_status_t apr_memory_system_reset(apr_memory_system_t *memory_system) */ -APR_DECLARE(void) +APR_DECLARE(apr_status_t) apr_memory_system_reset(apr_memory_system_t *memory_system); /** @@ -196,7 +196,7 @@ apr_memory_system_reset(apr_memory_system_t *memory_system); * @caution Be carefull when using this function with a non-tracking memory * system * @param memory_system The memory system to be destroyed - * @deffunc void apr_memory_system_destroy(apr_memory_system_t *memory_system) + * @deffunc apr_status_t apr_memory_system_destroy(apr_memory_system_t *memory_system) */ APR_DECLARE(apr_status_t) apr_memory_system_destroy(apr_memory_system_t *memory_system); @@ -222,8 +222,8 @@ apr_memory_system_threadsafe_unlock(apr_memory_system_t *memory_system); * Determine if memory system a is an ancestor of memory system b * @param a The memory system to search * @param b The memory system to search for - * @return TRUE if a is an ancestor of b, FALSE if a is not an ancestor of b - * @deffunc apr_bool_t apr_memory_system_is_ancestor(apr_memory_system_t *a, + * @return APR_SUCCESS if a is an ancestor of b, 1 if it isn't + * @deffunc apr_status_t apr_memory_system_is_ancestor(apr_memory_system_t *a, * apr_memory_system_t *b) */ APR_DECLARE(apr_status_t) diff --git a/include/apr_tracking_memory_system.h b/include/apr_tracking_memory_system.h index 4d6dad1e4bf..d83963fc458 100644 --- a/include/apr_tracking_memory_system.h +++ b/include/apr_tracking_memory_system.h @@ -67,7 +67,7 @@ extern "C" { */ /** - * Create a tracking malloc/realloc/free memory system + * Create a standard malloc/realloc/free memory system */ APR_DECLARE(apr_status_t) apr_tracking_memory_system_create(apr_memory_system_t **memory_system, @@ -79,4 +79,4 @@ apr_tracking_memory_system_create(apr_memory_system_t **memory_system, } #endif -#endif /* !APR_MEMORY_SYSTEM_H */ +#endif /* !APR_TRACKING_MEMORY_SYSTEM_H */ diff --git a/memory/unix/apr_memory_system.c b/memory/unix/apr_memory_system.c index b6c273c5983..2c119fd634c 100644 --- a/memory/unix/apr_memory_system.c +++ b/memory/unix/apr_memory_system.c @@ -125,7 +125,7 @@ apr_memory_system_free(apr_memory_system_t *memory_system, return APR_EINVAL; /* Hmm, is this an error??? */ if (memory_system->free_fn != NULL) - memory_system->free_fn(memory_system, mem); + return memory_system->free_fn(memory_system, mem); #ifdef APR_MEMORY_SYSTEM_DEBUG else /* assume this is a tracking memory system */ @@ -301,7 +301,7 @@ apr_memory_system_do_child_cleanups(apr_memory_system_t *memory_system) } } -APR_DECLARE(void) +APR_DECLARE(apr_status_t) apr_memory_system_reset(apr_memory_system_t *memory_system) { assert(memory_system != NULL); @@ -330,7 +330,7 @@ apr_memory_system_reset(apr_memory_system_t *memory_system) memory_system->accounting_memory_system = memory_system; /* Let the memory system handle the actual reset */ - memory_system->reset_fn(memory_system); + return memory_system->reset_fn(memory_system); } APR_DECLARE(apr_status_t) @@ -515,24 +515,22 @@ apr_memory_system_cleanup_register(apr_memory_system_t *memory_system, assert(memory_system != NULL); assert(memory_system->accounting_memory_system != NULL); - /* - * If someone passes us a NULL cleanup_fn, assert, because the cleanup - * code can't handle it _and_ it makes no sense. - */ + if (cleanup_fn == NULL) + return APR_EINVAL; + cleanup = (struct apr_memory_system_cleanup *) apr_memory_system_malloc(memory_system->accounting_memory_system, sizeof(struct apr_memory_system_cleanup)); - /* See if we actually got the memory */ if (cleanup == NULL) - return APR_ENOMEM; /* strikerXXX: Should this become APR_FALSE? */ + return APR_ENOMEM; cleanup->data = data; cleanup->cleanup_fn = cleanup_fn; cleanup->next = memory_system->cleanups; memory_system->cleanups = cleanup; - return APR_SUCCESS; /* strikerXXX: Should this become APR_TRUE? */ + return APR_SUCCESS; } APR_DECLARE(apr_status_t) @@ -559,7 +557,7 @@ apr_memory_system_cleanup_unregister(apr_memory_system_t *memory_system, if (memory_system->free_fn != NULL) apr_memory_system_free(memory_system, cleanup); - return APR_SUCCESS; /* strikerXXX: Should this become APR_TRUE? */ + return APR_SUCCESS; } cleanup_ref = &cleanup->next; diff --git a/memory/unix/apr_standard_memory_system.c b/memory/unix/apr_standard_memory_system.c index 8ef0434477d..2fb84082230 100644 --- a/memory/unix/apr_standard_memory_system.c +++ b/memory/unix/apr_standard_memory_system.c @@ -65,10 +65,6 @@ #include #include -#include /* strikerXXX: had to add this for windows to stop - * complaining, please autoconf the include stuff - */ - /* * standard memory system */ @@ -78,7 +74,7 @@ void * apr_standard_memory_system_malloc(apr_memory_system_t *memory_system, size_t size) { - return malloc(size); + return malloc(size); } static @@ -87,37 +83,38 @@ apr_standard_memory_system_realloc(apr_memory_system_t *memory_system, void *mem, size_t size) { - return realloc(mem, size); + return realloc(mem, size); } static -void +apr_status_t apr_standard_memory_system_free(apr_memory_system_t *memory_system, void *mem) { - free(mem); + free(mem); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_standard_memory_system_create(apr_memory_system_t **memory_system) { - apr_memory_system_t *new_memory_system; + apr_memory_system_t *new_memory_system; - assert(memory_system != NULL); + assert(memory_system != NULL); - *memory_system = NULL; - new_memory_system = apr_memory_system_create( - malloc(sizeof(apr_memory_system_t)), NULL); + *memory_system = NULL; + new_memory_system = apr_memory_system_create( + malloc(sizeof(apr_memory_system_t)), NULL); - if (new_memory_system == NULL) - return APR_ENOMEM; + if (new_memory_system == NULL) + return APR_ENOMEM; - new_memory_system->malloc_fn = apr_standard_memory_system_malloc; - new_memory_system->realloc_fn = apr_standard_memory_system_realloc; - new_memory_system->free_fn = apr_standard_memory_system_free; + new_memory_system->malloc_fn = apr_standard_memory_system_malloc; + new_memory_system->realloc_fn = apr_standard_memory_system_realloc; + new_memory_system->free_fn = apr_standard_memory_system_free; - apr_memory_system_assert(new_memory_system); + apr_memory_system_assert(new_memory_system); - *memory_system = new_memory_system; - return APR_SUCCESS; + *memory_system = new_memory_system; + return APR_SUCCESS; } diff --git a/memory/unix/apr_tracking_memory_system.c b/memory/unix/apr_tracking_memory_system.c index 800f2b0c52f..c01fd0516d6 100644 --- a/memory/unix/apr_tracking_memory_system.c +++ b/memory/unix/apr_tracking_memory_system.c @@ -146,7 +146,7 @@ apr_tracking_memory_system_realloc(apr_memory_system_t *memory_system, } static -void +apr_status_t apr_tracking_memory_system_free(apr_memory_system_t *memory_system, void *mem) { @@ -160,26 +160,30 @@ apr_tracking_memory_system_free(apr_memory_system_t *memory_system, *(node->ref) = node->next; - apr_memory_system_free(memory_system->parent_memory_system, node); + return apr_memory_system_free(memory_system->parent_memory_system, node); } static -void +apr_status_t apr_tracking_memory_system_reset(apr_memory_system_t *memory_system) { - apr_tracking_memory_system_t *tracking_memory_system; - apr_track_node_t *node; - - assert (memory_system != NULL); - - tracking_memory_system = (apr_tracking_memory_system_t *)memory_system; - - while (tracking_memory_system->nodes != NULL) - { - node = tracking_memory_system->nodes; - *(node->ref) = node->next; - apr_memory_system_free(memory_system->parent_memory_system, node); - } + apr_tracking_memory_system_t *tracking_memory_system; + apr_track_node_t *node; + apr_status_t rv; + + assert (memory_system != NULL); + + tracking_memory_system = (apr_tracking_memory_system_t *)memory_system; + + while (tracking_memory_system->nodes != NULL) + { + node = tracking_memory_system->nodes; + *(node->ref) = node->next; + if ((rv = apr_memory_system_free(memory_system->parent_memory_system, + node)) != APR_SUCCESS) + return rv; + } + return APR_SUCCESS; } static From b5591ed48379f15340eaf8ce1e86ffc5fbe877d7 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 10 May 2001 10:45:00 +0000 Subject: [PATCH 1612/7878] This adds Sanders suggestion of testing the reset for the tracking memory system. This also exposes a problem in that code where free is called twice for the same piece of memory, generating a segfault. Using some extra debugging This is what I see... Tracking Memory Creating the memory area............................OK Creating 10 lumps of memory, each 1024 bytes........OK Writing to the lumps of memory......................OK Check what we wrote.................................OK About to reset the tracking memory.................. calling free on 800259a8 calling free on 80025598 calling free on 80025598 I don't have tim to investigate in more detail at the moment. NB this will segfault, but it's being committed to allow people to see the problem themselves :) Submitted by: Sander Striker Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61603 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmem.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/test/testmem.c b/test/testmem.c index d98a154c008..e493f5efa34 100644 --- a/test/testmem.c +++ b/test/testmem.c @@ -68,11 +68,11 @@ #define LUMPS 10 #define LUMP_SIZE 1024 +char *ptrs[LUMPS]; static void do_test(apr_memory_system_t *ams) { int cntr,cntr2; - char *ptrs[LUMPS]; printf("\tCreating %d lumps of memory, each %d bytes........", LUMPS, LUMP_SIZE); @@ -104,7 +104,12 @@ static void do_test(apr_memory_system_t *ams) } } } - printf("OK\n"); + printf("OK\n"); +} + +static void do_free(apr_memory_system_t *ams) +{ + int cntr; printf("\tFreeing the memory we created......................."); for (cntr = 0;cntr < LUMPS;cntr ++){ @@ -133,7 +138,8 @@ int main(void) printf("OK\n"); do_test(ams); - + do_free(ams); + printf("Tracking Memory\n"); printf("\tCreating the memory area............................"); if (apr_tracking_memory_system_create(&ams2, ams) != APR_SUCCESS){ @@ -143,7 +149,15 @@ int main(void) printf("OK\n"); do_test(ams2); - + printf("\tAbout to reset the tracking memory..................\n"); + if (apr_memory_system_reset(ams2) != APR_SUCCESS){ + printf("Failed.\n"); + exit(-1); + } + printf("OK\n"); + do_test(ams2); + do_free(ams2); + printf("Trying to destroy the tracking memory segment..............."); if (apr_memory_system_destroy(ams2) != APR_SUCCESS){ printf("Failed.\n"); From 483078c809f509b2405f739e15293f763eb20876 Mon Sep 17 00:00:00 2001 From: "Victor J. Orlikowski" Date: Thu, 10 May 2001 17:21:01 +0000 Subject: [PATCH 1613/7878] Minor header inclusion bug. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61604 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/networkio.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 07782f10161..5d983bd80c9 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -69,12 +69,15 @@ #if APR_HAVE_SYS_UIO_H #include #endif -#if APR_HAVE_SYS_POLL_H +#ifdef HAVE_SYS_POLL_H #include #endif #ifdef HAVE_POLL_H #include #endif +#ifdef HAVE_SYS_SELECT_H +#include +#endif #if APR_HAVE_ERRNO_H #include #endif From 3a77e80fac4a58b062cfebfa5abfd380466955fe Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Thu, 10 May 2001 17:44:28 +0000 Subject: [PATCH 1614/7878] apr_dir_read() returns APR_OS_START_SYSERR + ERROR_NO_MORE_FILES because of a failed FindNextFileW call on Windows 2000. So we need to add it the APR_STATUS_IS_ENOENT macro. Submitted by: Bill Tutt git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61605 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index a07838bb64f..c0ddc14bdc0 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -636,7 +636,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ - || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED) + || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \ + || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES) #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL) From b473f5faad17de62131dabf693e31d23346cc806 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Thu, 10 May 2001 18:05:18 +0000 Subject: [PATCH 1615/7878] * apr_pstrndup: Check string length with memchr instead of strlen so that s doesn't have to be null-terminated. * Provide memchr implementation if !APR_HAS_MEMCHR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61606 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strings.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/strings/apr_strings.c b/strings/apr_strings.c index c2d9c1fb4cf..ab52478c519 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -54,6 +54,7 @@ #include "apr.h" #include "apr_strings.h" +#include "apr_general.h" #include "apr_private.h" #include "apr_lib.h" #ifdef HAVE_STDDEF_H @@ -83,14 +84,14 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *a, const char *s) APR_DECLARE(char *) apr_pstrndup(apr_pool_t *a, const char *s, apr_size_t n) { char *res; - apr_size_t len; + const char *end; if (s == NULL) { return NULL; } - len = strlen(s); - if (len < n) - n = len; + end = memchr(s, '\0', n); + if (end != NULL) + n = end - s; res = apr_palloc(a, n + 1); memcpy(res, s, n); res[n] = '\0'; @@ -147,3 +148,16 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) return res; } +#if (!APR_HAVE_MEMCHR) +void *memchr(const void *s, int c, size_t n) +{ + const char *cp; + + for (cp = s; n > 0; n--, cp++) { + if (*cp == c) + return (char *) cp; /* Casting away the const here */ + } + + return NULL; +} +#endif From d93c7545b49eb88c4a2321089b59f872c2998f0a Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Thu, 10 May 2001 18:06:24 +0000 Subject: [PATCH 1616/7878] Declare memchr() if !APR_HAVE_MEMCHR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61607 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/apr_general.h b/include/apr_general.h index 4d62d42d807..81debdf0414 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -139,6 +139,10 @@ int strncasecmp(const char *a, const char *b, size_t n); #define memmove(a,b,c) bcopy(b,a,c) #endif +#if (!APR_HAVE_MEMCHR) +void *memchr(const void *s, int c, size_t n); +#endif + /** * @package APR Random Functions */ From 1ef4619987b881af08ff43101dc6d63f8d25c04c Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Thu, 10 May 2001 18:08:12 +0000 Subject: [PATCH 1617/7878] Check for memchr. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61608 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index 1ccc154aac3..63bb2bf7f65 100644 --- a/configure.in +++ b/configure.in @@ -771,6 +771,7 @@ AC_CHECK_FUNCS(stricmp, have_stricmp="1", have_stricmp="0") AC_CHECK_FUNCS(strcasecmp, have_strcasecmp="1", have_strcasecmp="0") AC_CHECK_FUNCS(strdup, have_strdup="1", have_strdup="0") AC_CHECK_FUNCS(strstr, have_strstr="1", have_strstr="0") +AC_CHECK_FUNCS(memchr, have_memchr="1", have_memchr="0") AC_SUBST(have_strnicmp) AC_SUBST(have_strncasecmp) @@ -778,6 +779,7 @@ AC_SUBST(have_stricmp) AC_SUBST(have_strcasecmp) AC_SUBST(have_strdup) AC_SUBST(have_strstr) +AC_SUBST(have_memchr) dnl #----------------------------- Checking for DSO support echo $ac_n "${nl}Checking for DSO...${nl}" From 2ffab0bff4a43b6eea04c8459e8d0868e38b9182 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Thu, 10 May 2001 18:10:26 +0000 Subject: [PATCH 1618/7878] Define APR_HAVE_MEMCHR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61609 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 1 + include/apr.hw | 1 + 2 files changed, 2 insertions(+) diff --git a/include/apr.h.in b/include/apr.h.in index 936c55e9406..63136726c3f 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -97,6 +97,7 @@ #define APR_HAVE_STRNCASECMP @have_strncasecmp@ #define APR_HAVE_STRNICMP @have_strnicmp@ #define APR_HAVE_STRSTR @have_strstr@ +#define APR_HAVE_MEMCHR @have_memchr@ #define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@ #define APR_HAVE_UNION_SEMUN @have_union_semun@ diff --git a/include/apr.hw b/include/apr.hw index 15cdc054dcc..6ea11d79f27 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -181,6 +181,7 @@ #define APR_HAVE_STRNCASECMP 0 #define APR_HAVE_STRNICMP 1 #define APR_HAVE_STRSTR 1 +#define APR_HAVE_MEMCHR 1 #define APR_HAVE_STRUCT_RLIMIT 0 #define APR_HAVE_UNION_SEMUN 0 From 2fd203decb00c45650a705164b53d929a7fc8d81 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Thu, 10 May 2001 18:11:12 +0000 Subject: [PATCH 1619/7878] Define HAVE_MEMCHR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61610 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_private.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 8fc85510a39..884bedcd062 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -95,6 +95,7 @@ #define HAVE_STRNICMP 1 #define HAVE_STRDUP 1 #define HAVE_STRSTR 1 +#define HAVE_MEMCHR 1 #define SIGHUP 1 /* 2 is used for SIGINT on windows */ From 2070c74a841e46914cdda2d5240fb976aa633a9e Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 11 May 2001 00:29:24 +0000 Subject: [PATCH 1620/7878] As I'm off to work again tomorrow, here is the final batch of memory changes that I have on my HDD. This includes Sanders patch for getting the tracking stuff working again. Also add some entries to CHANGES and STATUS so we know where it's got to. This means that testmem now works and doesn't segfault. The formatting should be closer to the APR style throughout the code so review should be easier for folks. No more changes to come for a while, so review at leisure. Enjoy... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61611 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 + STATUS | 14 ++- memory/unix/apr_standard_memory_system.c | 5 +- memory/unix/apr_tracking_memory_system.c | 149 ++++++++++++----------- test/testmem.c | 2 +- 5 files changed, 98 insertions(+), 78 deletions(-) diff --git a/CHANGES b/CHANGES index 0e41fc68481..8da3ee8464b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) Add memory code kindly donated to APR by + Elrond + Luke Kenneth Casson Leighton + Sander Striker + [David Reid] + *) Fix a problem with the FreeBSD flavor of apr_sendfile() where we could return APR_EAGAIN+bytes_sent. [Jeff Trawick] diff --git a/STATUS b/STATUS index c0913921980..94828ca4ec5 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/04/27 20:01:34 $] +Last modified at [$Date: 2001/05/11 00:29:23 $] Release: @@ -138,6 +138,13 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: core_output_filter can then say "setside(conn->pool)" to ensure that a saved brigade will last as long as the connection. + * APR memory code - code has been added but we still need to + - decide on a better name for the code + - reformat to APR style (think this is now done, but some tabs left) + - test on more systems + - add to the default build as currently it's omitted. Also need to + add testmem to the test build at that point. + - add more detailed tests to testmem.c Documentation that needs writing: @@ -156,3 +163,8 @@ Stuff waiting for code thawing after Beta 1: * Identify and implement those protection bits that have general usefulness, perhaps hidden, generic read-only [immutable], effective current user permissions, etc. + + * APR memory code + - Look at how we'll handle run-time loading of memory sub systems. + - shared memory module? + - decide on where we're actually going with the code... diff --git a/memory/unix/apr_standard_memory_system.c b/memory/unix/apr_standard_memory_system.c index 2fb84082230..f7712eb275b 100644 --- a/memory/unix/apr_standard_memory_system.c +++ b/memory/unix/apr_standard_memory_system.c @@ -72,7 +72,7 @@ static void * apr_standard_memory_system_malloc(apr_memory_system_t *memory_system, - size_t size) + apr_size_t size) { return malloc(size); } @@ -80,8 +80,7 @@ apr_standard_memory_system_malloc(apr_memory_system_t *memory_system, static void * apr_standard_memory_system_realloc(apr_memory_system_t *memory_system, - void *mem, - size_t size) + void *mem, apr_size_t size) { return realloc(mem, size); } diff --git a/memory/unix/apr_tracking_memory_system.c b/memory/unix/apr_tracking_memory_system.c index c01fd0516d6..977460dcc25 100644 --- a/memory/unix/apr_tracking_memory_system.c +++ b/memory/unix/apr_tracking_memory_system.c @@ -72,77 +72,76 @@ /* INTERNALLY USED STRUCTURES */ typedef struct apr_track_node_t { - struct apr_track_node_t *next; - struct apr_track_node_t **ref; + struct apr_track_node_t *next; + struct apr_track_node_t **ref; } apr_track_node_t; typedef struct apr_tracking_memory_system_t { - apr_memory_system_t header; - apr_track_node_t *nodes; + apr_memory_system_t header; + apr_track_node_t *nodes; } apr_tracking_memory_system_t; static void * apr_tracking_memory_system_malloc(apr_memory_system_t *memory_system, - size_t size) + apr_size_t size) { - apr_tracking_memory_system_t *tracking_memory_system; - apr_track_node_t *node; + apr_tracking_memory_system_t *tracking_memory_system; + apr_track_node_t *node; - assert (memory_system != NULL); + assert (memory_system != NULL); - tracking_memory_system = (apr_tracking_memory_system_t *)memory_system; - node = apr_memory_system_malloc(memory_system->parent_memory_system, + tracking_memory_system = (apr_tracking_memory_system_t *)memory_system; + node = apr_memory_system_malloc(memory_system->parent_memory_system, size + sizeof(apr_track_node_t)); - if (node == NULL) - return NULL; + if (node == NULL) + return NULL; - node->next = tracking_memory_system->nodes; - tracking_memory_system->nodes = node; - node->ref = &tracking_memory_system->nodes; - if (node->next != NULL) - node->next->ref = &node->next; + node->next = tracking_memory_system->nodes; + tracking_memory_system->nodes = node; + node->ref = &tracking_memory_system->nodes; + if (node->next != NULL) + node->next->ref = &node->next; - node++; + node++; - return (void *)node; + return (void *)node; } static void * apr_tracking_memory_system_realloc(apr_memory_system_t *memory_system, - void *mem, - size_t size) + void *mem, apr_size_t size) { - apr_tracking_memory_system_t *tracking_memory_system; - apr_track_node_t *node; + apr_tracking_memory_system_t *tracking_memory_system; + apr_track_node_t *node; - assert (memory_system != NULL); + assert (memory_system != NULL); - tracking_memory_system = (apr_tracking_memory_system_t *)memory_system; - node = (apr_track_node_t *)mem; + tracking_memory_system = (apr_tracking_memory_system_t *)memory_system; + node = (apr_track_node_t *)mem; - if (node != NULL) - { - node--; - *(node->ref) = node->next; - } + if (node != NULL) + { + node--; + *(node->ref) = node->next; + } - node = apr_memory_system_realloc(memory_system->parent_memory_system, + node = apr_memory_system_realloc(memory_system->parent_memory_system, node, size + sizeof(apr_track_node_t)); - if (node == NULL) - return NULL; + if (node == NULL) + return NULL; - node->next = tracking_memory_system->nodes; - tracking_memory_system->nodes = node; - node->ref = &tracking_memory_system->nodes; - if (node->next != NULL) - node->next->ref = &node->next; + node->next = tracking_memory_system->nodes; + tracking_memory_system->nodes = node; + node->ref = &tracking_memory_system->nodes; + if (node->next != NULL) + node->next->ref = &node->next; - node++; + node++; - return (void *)node; + return (void *)node; } static @@ -150,17 +149,19 @@ apr_status_t apr_tracking_memory_system_free(apr_memory_system_t *memory_system, void *mem) { - apr_track_node_t *node; + apr_track_node_t *node; - assert (memory_system != NULL); - assert (mem != NULL); + assert (memory_system != NULL); + assert (mem != NULL); - node = (apr_track_node_t *)mem; - node--; + node = (apr_track_node_t *)mem; + node--; - *(node->ref) = node->next; - - return apr_memory_system_free(memory_system->parent_memory_system, node); + *(node->ref) = node->next; + if (node->next != NULL) + node->next->ref = node->ref; + + return apr_memory_system_free(memory_system->parent_memory_system, node); } static @@ -179,6 +180,8 @@ apr_tracking_memory_system_reset(apr_memory_system_t *memory_system) { node = tracking_memory_system->nodes; *(node->ref) = node->next; + if (node->next != NULL) + node->next->ref = node->ref; if ((rv = apr_memory_system_free(memory_system->parent_memory_system, node)) != APR_SUCCESS) return rv; @@ -190,42 +193,42 @@ static void apr_tracking_memory_system_destroy(apr_memory_system_t *memory_system) { - assert (memory_system != NULL); + assert (memory_system != NULL); - apr_tracking_memory_system_reset(memory_system); - apr_memory_system_free(memory_system->parent_memory_system, memory_system); + apr_tracking_memory_system_reset(memory_system); + apr_memory_system_free(memory_system->parent_memory_system, memory_system); } APR_DECLARE(apr_status_t) apr_tracking_memory_system_create(apr_memory_system_t **memory_system, apr_memory_system_t *parent_memory_system) { - apr_memory_system_t *new_memory_system; - apr_tracking_memory_system_t *tracking_memory_system; + apr_memory_system_t *new_memory_system; + apr_tracking_memory_system_t *tracking_memory_system; - assert (memory_system != NULL); - assert (parent_memory_system != NULL); + assert (memory_system != NULL); + assert (parent_memory_system != NULL); - new_memory_system = apr_memory_system_create( - apr_memory_system_malloc(parent_memory_system, - sizeof(apr_tracking_memory_system_t)), - parent_memory_system); + new_memory_system = apr_memory_system_create( + apr_memory_system_malloc(parent_memory_system, + sizeof(apr_tracking_memory_system_t)), + parent_memory_system); - *memory_system = NULL; - if (new_memory_system == NULL) - return APR_ENOMEM; + *memory_system = NULL; + if (new_memory_system == NULL) + return APR_ENOMEM; - new_memory_system->malloc_fn = apr_tracking_memory_system_malloc; - new_memory_system->realloc_fn = apr_tracking_memory_system_realloc; - new_memory_system->free_fn = apr_tracking_memory_system_free; - new_memory_system->reset_fn = apr_tracking_memory_system_reset; - new_memory_system->destroy_fn = apr_tracking_memory_system_destroy; + new_memory_system->malloc_fn = apr_tracking_memory_system_malloc; + new_memory_system->realloc_fn = apr_tracking_memory_system_realloc; + new_memory_system->free_fn = apr_tracking_memory_system_free; + new_memory_system->reset_fn = apr_tracking_memory_system_reset; + new_memory_system->destroy_fn = apr_tracking_memory_system_destroy; - tracking_memory_system = (apr_tracking_memory_system_t *)new_memory_system; - tracking_memory_system->nodes = NULL; + tracking_memory_system = (apr_tracking_memory_system_t *)new_memory_system; + tracking_memory_system->nodes = NULL; - apr_memory_system_assert(new_memory_system); + apr_memory_system_assert(new_memory_system); - *memory_system = new_memory_system; - return APR_SUCCESS; + *memory_system = new_memory_system; + return APR_SUCCESS; } diff --git a/test/testmem.c b/test/testmem.c index e493f5efa34..fe2c5a02bf1 100644 --- a/test/testmem.c +++ b/test/testmem.c @@ -149,7 +149,7 @@ int main(void) printf("OK\n"); do_test(ams2); - printf("\tAbout to reset the tracking memory..................\n"); + printf("\tAbout to reset the tracking memory.................."); if (apr_memory_system_reset(ams2) != APR_SUCCESS){ printf("Failed.\n"); exit(-1); From d86da0a11c1364820b960efaa908e7e516ead19a Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Fri, 11 May 2001 03:59:03 +0000 Subject: [PATCH 1621/7878] Remove useless cruft and make it unnecessary for clients of APR to call APR_PRELOAD. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61612 13f79535-47bb-0310-9956-ffa450edef68 --- APRVARS.in | 2 ++ build/apr_common.m4 | 3 --- build/apr_hints.m4 | 10 ++-------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/APRVARS.in b/APRVARS.in index 5852a30fa58..5459b658517 100644 --- a/APRVARS.in +++ b/APRVARS.in @@ -1,3 +1,5 @@ +CC="@CC@" +SHELL="@SHELL@" EXTRA_CPPFLAGS="@EXTRA_CPPFLAGS@" EXTRA_CFLAGS="@EXTRA_CFLAGS@" EXTRA_LDFLAGS="@EXTRA_LDFLAGS@" diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 9456ffab643..f17b4ed4037 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -14,9 +14,6 @@ AC_DEFUN(APR_CONFIG_NICE,[ # Created by configure EOF - if test -n "$MAKE"; then - echo "MAKE=\"$MAKE\"; export MAKE" >> $1 - fi if test -n "$CFLAGS"; then echo "CFLAGS=\"$CFLAGS\"; export CFLAGS" >> $1 fi diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 44e8f425e95..f1ea069a2d5 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -20,13 +20,9 @@ dnl Generally, we force the setting of CC, and add flags dnl to CFLAGS, CPPFLAGS, LIBS and LDFLAGS. dnl AC_DEFUN(APR_PRELOAD, [ -if test "$DID_APR_PRELOAD" = "yes" ; then +if test "x$apr_preload_done" != "xyes" ; then - echo "APR hints file rules for $host already applied" - -else - - DID_APR_PRELOAD="yes"; export DID_APR_PRELOAD + apr_preload_done="yes" echo "Applying APR hints file rules for $host" @@ -39,7 +35,6 @@ else APR_ADDTO(CPPFLAGS, [-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE]) APR_ADDTO(LIBS, [-lsocket -lsvipc -lcurses]) APR_ADDTO(LDFLAGS, [-Xlinker \"-WL,cap=ia,ba,ph;nmstack=1024000\"]) - APR_SETVAR(CAT, [/bin/cat]) ;; *-apple-aux3*) APR_SETVAR(CC, [gcc]) @@ -347,7 +342,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-riscix) APR_ADDTO(CPPFLAGS, [-DRISCIX]) APR_SETIFNULL(CFLAGS, [-O]) - APR_SETIFNULL(MAKE, [make]) ;; *-irix*) APR_ADDTO(CPPFLAGS, [-D_POSIX_THREAD_SAFE_FUNCTIONS]) From 1dddda700bce7d126f38a11e58de104df4b68a66 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Fri, 11 May 2001 06:49:19 +0000 Subject: [PATCH 1622/7878] export the setting for CPP as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61613 13f79535-47bb-0310-9956-ffa450edef68 --- APRVARS.in | 1 + 1 file changed, 1 insertion(+) diff --git a/APRVARS.in b/APRVARS.in index 5459b658517..f4f0d0fe7ba 100644 --- a/APRVARS.in +++ b/APRVARS.in @@ -1,4 +1,5 @@ CC="@CC@" +CPP="@CPP@" SHELL="@SHELL@" EXTRA_CPPFLAGS="@EXTRA_CPPFLAGS@" EXTRA_CFLAGS="@EXTRA_CFLAGS@" From 2604922b70200fee43231f9d6c42db8e2afdc40e Mon Sep 17 00:00:00 2001 From: "Victor J. Orlikowski" Date: Fri, 11 May 2001 19:46:22 +0000 Subject: [PATCH 1623/7878] Hum. On systems that don't necessarily have gcc, this is a breakage. However, this doesn't seem quite clean. Anyone have any better ideas? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61614 13f79535-47bb-0310-9956-ffa450edef68 --- build/mkdep.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/mkdep.sh b/build/mkdep.sh index 510bdc02fbf..baa74147114 100755 --- a/build/mkdep.sh +++ b/build/mkdep.sh @@ -7,6 +7,10 @@ # Note that we use && to ensure that Makefile is not changed if an error # occurs during the process # +if [ -z $CC ]; then + CC=cc +fi + sed -ne '1,/^# DO NOT REMOVE/p' Makefile > Makefile.new \ - && gcc -MM $* | sed -e "s/\.o:/\.lo:/" >> Makefile.new \ + && $CC -MM $* | sed -e "s/\.o:/\.lo:/" >> Makefile.new \ && mv Makefile.new Makefile From 566c1d0c0b7c2f7b3c1d15faec5d840a5614c2ae Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 11 May 2001 21:03:32 +0000 Subject: [PATCH 1624/7878] Minor nit. We know that 'test -z' is OK, since we use it elsewhere, so be safe :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61615 13f79535-47bb-0310-9956-ffa450edef68 --- build/mkdep.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/mkdep.sh b/build/mkdep.sh index baa74147114..eca1c119119 100755 --- a/build/mkdep.sh +++ b/build/mkdep.sh @@ -7,7 +7,7 @@ # Note that we use && to ensure that Makefile is not changed if an error # occurs during the process # -if [ -z $CC ]; then +if test -z "$CC"; then CC=cc fi From 6dd1a3ddcc1090068404a51c3717480f03b32db0 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 12 May 2001 03:41:53 +0000 Subject: [PATCH 1625/7878] Allow LTFLAGS to be overridden by the configure command-line (default="--silent") and introduce LT_LDFLAGS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61616 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ build/rules.mk.in | 4 ++-- configure.in | 21 +++++++++++++-------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 8da3ee8464b..14962ac005a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Allow LTFLAGS to be overridden by the configure command-line + (default="--silent") and introduce LT_LDFLAGS. [Roy Fielding] + *) Add memory code kindly donated to APR by Elrond Luke Kenneth Casson Leighton diff --git a/build/rules.mk.in b/build/rules.mk.in index 128d576682f..4c128f4e1a3 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -108,8 +108,8 @@ ALL_LDFLAGS = $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(LDFLAGS) ALL_LIBS = $(LIBS) $(NOTEST_LIBS) $(EXTRA_LIBS) ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) -### make LTFLAGS somewhat variable? -LTFLAGS = --silent +LTFLAGS = @LTFLAGS@ +LT_LDFLAGS = @LT_LDFLAGS@ # # Basic macro setup diff --git a/configure.in b/configure.in index 63bb2bf7f65..f61e034882d 100644 --- a/configure.in +++ b/configure.in @@ -100,6 +100,9 @@ case "$host_alias" in ;; *) dnl libtoolize requires that the following not be indented AC_PROG_LIBTOOL + if test "x$LTFLAGS" = "x"; then + LTFLAGS='--silent' + fi ;; esac @@ -107,21 +110,23 @@ AC_ARG_ENABLE(libtool, [--with-libtool use libtool to link the library], [ use_libtool=$withval ], [ use_libtool="yes" ] ) if test "x$use_libtool" = "xyes"; then - lt_compile="\$(LIBTOOL) --mode=compile \$(LTFLAGS) \$(COMPILE) -c \$< && touch \$@" - link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(ALL_LDFLAGS) -o \$@" - so_ext="lo" - lib_target="-rpath \$(libdir) \$\$objects" + lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -c $< && touch $@' + link='$(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(ALL_LDFLAGS) -o $@' + so_ext='lo' + lib_target='-rpath $(libdir) $$objects' else - lt_compile="\$(COMPILE) -c \$<" - link="\$(AR) cr \$(TARGET_LIB) \$\$objects; \$(RANLIB) \$(TARGET_LIB)" - so_ext="o" - lib_target="" + lt_compile='$(COMPILE) -c $<' + link='$(AR) cr $(TARGET_LIB) $$objects; $(RANLIB) $(TARGET_LIB)' + so_ext='o' + lib_target='' fi AC_SUBST(lt_compile) AC_SUBST(link) AC_SUBST(so_ext) AC_SUBST(lib_target) +AC_SUBST(LTFLAGS) +AC_SUBST(LT_LDFLAGS) dnl #----------------------------- Checks for compiler flags nl=' From ebf10ee2ba4a6e5c7fb8474582ef84769ed5c4ff Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 12 May 2001 03:51:12 +0000 Subject: [PATCH 1626/7878] Fix an odd test switch, though it is still odd. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61617 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index 3ad7ee5ef3e..eaffd26143d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -47,7 +47,7 @@ testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS) ### why the export-dynamic? testdso@EXEEXT@: testdso.lo mod_test.so $(LOCAL_LIBS) - $(LINK) --export-dynamic testdso.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK) -export-dynamic testdso.lo $(LOCAL_LIBS) $(ALL_LIBS) testoc@EXEEXT@: testoc.lo $(LOCAL_LIBS) $(LINK) testoc.lo $(LOCAL_LIBS) $(ALL_LIBS) From 2f188794b0e69e91432ff1dab770b96ade5d629a Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 13 May 2001 10:42:09 +0000 Subject: [PATCH 1627/7878] This has been on my list of things to do for a while, and as I had some time between 40West and 30West at 39,000' it seemed like a good idea. This is still a starting point, but at least this commit shows what I'm thinking. I'll try to adapt some of the other test apps soon. test_apr.h needs to be changed to use better error semantics (apr ones) but this was just a quick hack. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61618 13f79535-47bb-0310-9956-ffa450edef68 --- test/test_apr.h | 89 +++++++++++++++++++++++++++++++++++++ test/testproc.c | 114 +++++++++++++++++------------------------------- 2 files changed, 128 insertions(+), 75 deletions(-) create mode 100644 test/test_apr.h diff --git a/test/test_apr.h b/test/test_apr.h new file mode 100644 index 00000000000..478aa72cab7 --- /dev/null +++ b/test/test_apr.h @@ -0,0 +1,89 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/* Some simple functions to make the test apps easier to write and + * a bit more consistent... + * + * These still need more work... + * + * It'd be nice to get proper error reporting in here... + * + */ + +#include + +#define TEST_EQ(str, func, value, good, bad) \ + printf("%-60s", str); \ + { apr_status_t rv; \ + if ((rv = func) == value){ \ + printf("%s\n", bad); \ + printf("Error was %ld : %s\n", rv, strerror(rv)); \ + exit(-1); \ + } \ + printf("%s\n", good); \ + } + +#define TEST_NEQ(str, func, value, good, bad) \ + printf("%-60s", str); \ + { apr_status_t rv; \ + if ((rv = func) != value){ \ + printf("%s\n", bad); \ + printf("Error was %ld : %s\n", rv, strerror(rv)); \ + exit(-1); \ + } \ + printf("%s\n", good); \ + } + +#define STD_TEST(str, func) \ + TEST_NEQ(str, func, APR_SUCCESS, "OK", "Failed"); \ No newline at end of file diff --git a/test/testproc.c b/test/testproc.c index 04c0d1ebd61..ec62ca9e2eb 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -65,6 +65,7 @@ #include #include #include +#include "test_apr.h" int test_filedel(void); int testdirs(void); @@ -76,7 +77,7 @@ static void closeapr(void) int main(int argc, char *argv[]) { - apr_pool_t *context; + apr_pool_t *pool; apr_proc_t newproc; apr_procattr_t *attr; apr_file_t *testfile = NULL; @@ -85,108 +86,71 @@ int main(int argc, char *argv[]) const char *args[3]; char *teststr; - if (apr_initialize() != APR_SUCCESS) { - fprintf(stderr, "Couldn't initialize."); + if (apr_initialize() != APR_SUCCESS){ + printf("Failed to initialize APR\n"); exit(-1); - } + } atexit(closeapr); - apr_pool_create(&context, NULL); - + apr_pool_create(&pool, NULL); if (argc > 1) { - teststr = apr_palloc(context, 256); + teststr = apr_palloc(pool, 256); teststr = fgets(teststr, 256, stdin); - fprintf(stdout, "%s", teststr); + printf("%s", teststr); exit(1); } - teststr = apr_pstrdup(context, "Whooo Hoooo\0"); - - fprintf(stdout, "Creating directory for later use......."); - if (apr_dir_make("proctest", APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) { - fprintf(stderr, "Could not create dir\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - - fprintf(stdout, "Creating procattr......."); - if (apr_procattr_create(&attr, context) != APR_SUCCESS) { - fprintf(stderr, "Could not create attr\n"); - exit(-1);; - } - fprintf(stdout, "OK.\n"); - - fprintf(stdout, "Setting attr pipes, all three......."); - if (apr_procattr_io_set(attr, APR_FULL_BLOCK, - APR_CHILD_BLOCK, APR_NO_PIPE) != APR_SUCCESS) { - fprintf(stderr, "Could not set pipes attr\n"); - exit(-1); - } - fprintf(stdout, "OK.\n"); + teststr = apr_pstrdup(pool, "Whooo Hoooo\0"); - fprintf(stdout, "Setting attr dir......."); - if (apr_procattr_dir_set(attr, "proctest") != APR_SUCCESS) { - fprintf(stderr, "Could not set directory attr\n"); - exit(-1); - } - fprintf(stdout, "OK.\n"); - - fprintf(stdout, "Setting attr cmd type......."); - if (apr_procattr_cmdtype_set(attr, APR_PROGRAM) != APR_SUCCESS) { - fprintf(stderr, "Could not set cmd type attr\n"); - exit(-1); - } - fprintf(stdout, "OK.\n"); + printf("APR Process Test\n================\n\n"); + + STD_TEST_NEQ("Creating directory for later use", + apr_dir_make("proctest", APR_UREAD | APR_UWRITE | APR_UEXECUTE, pool)) + STD_TEST_NEQ("Creating procattr", apr_procattr_create(&attr, pool)) + STD_TEST_NEQ("Setting attr pipes, all three", apr_procattr_io_set(attr, APR_FULL_BLOCK, + APR_CHILD_BLOCK, APR_NO_PIPE)) + STD_TEST_NEQ("Setting attr dir", apr_procattr_dir_set(attr, "proctest")) + STD_TEST_NEQ("Setting attr cmd type", apr_procattr_cmdtype_set(attr, APR_PROGRAM)) args[0] = "testproc"; args[1] = "-X"; args[2] = NULL; - fprintf(stdout, "Creating a new process......."); - if (apr_proc_create(&newproc, "../testproc", args, NULL, attr, context) != APR_SUCCESS) { - fprintf(stderr, "Could not create the new process\n"); - exit(-1); - } - fprintf(stdout, "OK.\n"); + STD_TEST_NEQ("Creating a new process", apr_proc_create(&newproc, + "../testproc", args, NULL, attr, pool)) - fprintf(stdout, "Grabbing child's stdin......."); + printf("%-60s","Grabbing child's stdin"); testfile = newproc.in; - fprintf(stdout, "OK.\n"); + printf("OK\n"); length = 256; - fprintf(stdout, "Writing the data to child......."); + printf("%-60s", "Writing the data to child"); if (apr_file_write(testfile, teststr, &length) == APR_SUCCESS) { - fprintf(stdout,"OK\n"); + printf("OK\n"); } - else fprintf(stderr, "Write failed.\n"); + else printf("Write failed.\n"); - fprintf(stdout, "Grabbing child's stdout......."); + printf("%-60s", "Grabbing child's stdout"); testfile = newproc.out; - fprintf(stdout, "OK.\n"); + printf("OK\n"); length = 256; - fprintf(stdout, "Checking the data read from pipe to child......."); - buf = apr_pcalloc(context, length); + printf("%-60s", "Checking the data read from pipe to child"); + buf = apr_pcalloc(pool, length); if (apr_file_read(testfile, buf, &length) == APR_SUCCESS) { if (!strcmp(buf, teststr)) - fprintf(stdout,"OK\n"); - else fprintf(stderr, "Uh-Oh\n"); + printf("OK\n"); + else { + printf( "Uh-Oh\n", buf); + printf(" (I actually got %s_\n", buf); + } } - else fprintf(stderr, "Read failed.\n"); + else printf( "Read failed.\n"); - fprintf(stdout, "Waiting for child to die......."); - if (apr_proc_wait(&newproc, APR_WAIT) != APR_CHILD_DONE) { - fprintf(stderr, "Wait for child failed\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - - fprintf(stdout, "Removing directory......."); - if (apr_dir_remove("proctest", context) != APR_SUCCESS) { - fprintf(stderr, "Could not remove directory.\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); + TEST_NEQ("Waiting for child to die", apr_proc_wait(&newproc, APR_WAIT), + APR_CHILD_DONE, "OK", "Failed") + STD_TEST_NEQ("Removing directory", apr_dir_remove("proctest", pool)) + printf("\nTest completed succesfully\n"); return(1); } From 9008510de7ac714d9be8cad5395fcd28cf5535c7 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 13 May 2001 10:50:07 +0000 Subject: [PATCH 1628/7878] 2 small changes... - change some defines and add an extra one (BONE7) so we build again on the latest BeOS beta. - Make the inclusion of libmm optional for the test directory so it's possible to build on beos and os2 with no changes required. Basically some cleanups.. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61619 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 13 ++++++++++--- include/arch/unix/fileio.h | 12 ++++++++---- test/Makefile.in | 3 ++- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index f61e034882d..2dfeeecc99f 100644 --- a/configure.in +++ b/configure.in @@ -162,7 +162,7 @@ case "$OS:$CC" in APR_ADDTO(CFLAGS,-Kthread) ;; esac - +LOCAL_MM_LIB="../shmem/unix/mm/libmm.la" case "$OS" in i386-ibm-aix* | *-ibm-aix[1-2].* | *-ibm-aix3.* | *-ibm-aix4.1 | *-ibm-aix4.1.* | *-ibm-aix4.2 | *-ibm-aix4.2.*) OSDIR="aix" @@ -175,6 +175,7 @@ case "$OS" in APR_ADDTO(CFLAGS,-Zmt) OSDIR="os2" enable_threads="system_threads" + LOCAL_MM_LIB="" eolstr="\\r\\n" file_as_socket="0" ;; @@ -185,7 +186,13 @@ case "$OS" in native_mmap_emul="1" APR_CHECK_DEFINE(BONE_VERSION, sys/socket.h) eolstr="\\n" - file_as_socket="0" + osver=`uname -r` + if test "$osver"="5.0.4"; then + file_as_socket="1" + else + file_as_socket="0" + fi + LOCAL_MM_LIB="" ;; *os390) OSDIR="os390" @@ -227,7 +234,6 @@ if test -z "$enable_threads"; then fi if test "$enable_threads" = "no"; then -echo "Don't enable threads" threads="0" pthreadh="0" pthreadser="0" @@ -1121,6 +1127,7 @@ AC_SUBST(OSDIR) AC_SUBST(DEFAULT_OSDIR) AC_SUBST(EXEEXT) AC_SUBST(LIBTOOL_LIBS) +AC_SUBST(LOCAL_MM_LIB) echo "${nl}Construct Makefiles and header files." MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile build/Makefile" diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 3d71a43672a..2aff13e4058 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -104,11 +104,15 @@ #ifdef BEOS #include #endif -/* BeOS still defines fd_set in sys/socket.h so include it here. - * I'm not just including it as most platforms won't need it... - */ + #if BEOS_BONE -#include /* for fd_set definitions */ + #ifndef BONE7 + /* prior to BONE/7 fd_set & select were defined in sys/socket.h */ + #include + #else + /* Be moved the fd_set stuff and also the FIONBIO definition... */ + #include + #endif #endif /* End System headers */ diff --git a/test/Makefile.in b/test/Makefile.in index eaffd26143d..d19f6c3b8a4 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -28,7 +28,8 @@ TARGETS = $(PROGRAMS) # bring in rules.mk for standard functionality @INCLUDE_RULES@ -LOCAL_LIBS=../libapr.la ../shmem/unix/mm/libmm.la +LOCAL_LIBS=../libapr.la @LOCAL_MM_LIB@ +##../shmem/unix/mm/libmm.la CLEAN_TARGETS = testfile.tmp testdso@EXEEXT@ mod_test.so From 7d3d9fb762a8e32ad085a30bc91253d2937400ce Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 13 May 2001 10:53:01 +0000 Subject: [PATCH 1629/7878] Another small update of a test program that I did yesterday afternoon. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61620 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmd5.c | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/test/testmd5.c b/test/testmd5.c index 4329cbbac6c..91ab7dc87dc 100644 --- a/test/testmd5.c +++ b/test/testmd5.c @@ -95,31 +95,43 @@ static void try(const void *buf, size_t bufLen, apr_xlate_t *xlate, apr_status_t rv; apr_md5_ctx_t context; unsigned char hash[MD5_DIGESTSIZE]; + + printf("Trying a translation...\n"); - rv = apr_md5_init(&context); - assert(!rv); + if ((rv = apr_md5_init(&context)) != APR_SUCCESS){ + printf("Failed to init APR's md5 routines!\n"); + exit(-1); + } if (xlate) { #if APR_HAS_XLATE - apr_md5_set_xlate(&context, xlate); + if ((rv = apr_md5_set_xlate(&context, xlate)) != APR_SUCCESS){ + fprintf("Couldn't set the MD5 translation handle!\n"); + exit(-1); + } #else - fprintf(stderr, - "A translation handle was unexpected.\n"); + printf("\tDidn't expect a translation handle! Not fatal.\n"); #endif } - rv = apr_md5_update(&context, buf, bufLen); - assert(!rv); + if ((rv = apr_md5_update(&context, buf, bufLen)) != APR_SUCCESS){ + printf("The call to apr_md5_update failed!\n"); + exit(-1); + } - rv = apr_md5_final(hash, &context); - assert(!rv); + if ((rv = apr_md5_final(hash, &context)) != APR_SUCCESS){ + printf("The call to apr_md5_final failed!\n"); + exit(-1); + } + printf("\t (MD5 hash : "); for (i = 0; i < MD5_DIGESTSIZE; i++) { printf("%02x",hash[i]); } + + printf(")\n"); - printf("\n"); - + printf("\tChecking hash against expected...................."); if (memcmp(hash, digest, MD5_DIGESTSIZE)) { fprintf(stderr, "The digest is not as expected!\n"); @@ -131,6 +143,7 @@ static void try(const void *buf, size_t bufLen, apr_xlate_t *xlate, "being in ASCII.\n"); #endif } + printf("OK\n"); } int main(int argc, char **argv) @@ -159,7 +172,14 @@ int main(int argc, char **argv) assert(!rv); atexit(closeapr); - rv = apr_pool_create(&pool, NULL); + printf("APR MD5 Test\n============\n\n"); + printf("Creating pool............................................."); + if ((rv = apr_pool_create(&pool, NULL)) != APR_SUCCESS){ + printf("Failed.\n"); + exit(-1); + } + printf("OK\n"); + if (src) { #if APR_HAS_XLATE @@ -182,6 +202,7 @@ int main(int argc, char **argv) try(testcases[cur].s, strlen(testcases[cur].s), xlate, testcases[cur].digest); } - + + printf("\nMD5 Test passed.\n"); return 0; } From 15fc6c49f7e092e441b011eaf3ff94222d505293 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 13 May 2001 11:03:59 +0000 Subject: [PATCH 1630/7878] I missed this previously. Basically the latest BeOS beta has changed the version number and moved a lot of defines around in the header files to make it more compliant, but of course this broke my workarounds... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61621 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index f1ea069a2d5..49b4e3f1d0f 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -350,8 +350,12 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DBEOS]) PLATOSVERS=`uname -r` case $PLATOSVERS in + 5.0.4) + APR_ADDTO(LDFLAGS, [-L/boot/develop/lib/x86 -L/boot/beos/system/lib -lbind -lsocket]) + APR_ADDTO(LIBS, [-lbind -lsocket -lbe -lroot]) + APR_ADDTO(CPPFLAGS,[-DBONE7]) + ;; 5.1) - APR_ADDTO(CPPFLAGS, [-I/boot/develop/headers/bone]) APR_ADDTO(LDFLAGS, [-L/boot/develop/lib/x86 -L/boot/beos/system/lib -lbind -lsocket]) APR_ADDTO(LIBS, [-lbind -lsocket -lbe -lroot]) ;; From f3d2201dcc18817fc0b5bd9d035442dc63611f47 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 13 May 2001 11:11:48 +0000 Subject: [PATCH 1631/7878] The big name change for the memory code. Names used follow the outline I posted yesterday. Please review at our leisure. Also adds a calloc function that uses calloc if available or does malloc /memset. Test program updated to new names. Shorter variable names as well. The next step is the asserts & checks... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61622 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_memory_system.h | 180 ++++++----- include/apr_tracking_memory_system.h | 18 +- memory/unix/apr_memory_system.c | 388 +++++++++++------------ memory/unix/apr_standard_memory_system.c | 69 ++-- memory/unix/apr_tracking_memory_system.c | 171 +++++----- test/testmem.c | 71 ++++- 6 files changed, 486 insertions(+), 411 deletions(-) diff --git a/include/apr_memory_system.h b/include/apr_memory_system.h index cac7c2451b9..23357f4d891 100644 --- a/include/apr_memory_system.h +++ b/include/apr_memory_system.h @@ -51,6 +51,14 @@ * information on the Apache Software Foundation, please see * . */ + +/* This code kindly donated to APR by + * Elrond + * Luke Kenneth Casson Leighton + * Sander Striker + * + * May 2001 + */ #ifndef APR_MEMORY_SYSTEM_H #define APR_MEMORY_SYSTEM_H @@ -66,32 +74,33 @@ extern "C" { * @package APR memory system */ -typedef struct apr_memory_system_t apr_memory_system_t; +typedef struct apr_sms_t apr_sms_t; -struct apr_memory_system_cleanup; +struct apr_sms_cleanup; /** * The memory system structure */ -struct apr_memory_system_t +struct apr_sms_t { - apr_memory_system_t *parent_memory_system; - apr_memory_system_t *child_memory_system; - apr_memory_system_t *sibling_memory_system; - apr_memory_system_t **ref_memory_system; - apr_memory_system_t *accounting_memory_system; + apr_sms_t *parent_mem_sys; + apr_sms_t *child_mem_sys; + apr_sms_t *sibling_mem_sys; + apr_sms_t **ref_mem_sys; + apr_sms_t *accounting_mem_sys; - struct apr_memory_system_cleanup *cleanups; + struct apr_sms_cleanup *cleanups; - void * (*malloc_fn)(apr_memory_system_t *memory_system, apr_size_t size); - void * (*realloc_fn)(apr_memory_system_t *memory_system, void *memory, - apr_size_t size); - apr_status_t (*free_fn)(apr_memory_system_t *memory_system, void *memory); - apr_status_t (*reset_fn)(apr_memory_system_t *memory_system); - void (*pre_destroy_fn)(apr_memory_system_t *memory_system); - void (*destroy_fn)(apr_memory_system_t *memory_system); - void (*threadsafe_lock_fn)(apr_memory_system_t *memory_system); - void (*threadsafe_unlock_fn)(apr_memory_system_t *memory_system); + void * (*malloc_fn)(apr_sms_t *mem_sys, apr_size_t size); + void * (*calloc_fn)(apr_sms_t *mem_sys, apr_size_t size); + void * (*realloc_fn)(apr_sms_t *mem_sys, void *memory, + apr_size_t size); + apr_status_t (*free_fn)(apr_sms_t *mem_sys, void *memory); + apr_status_t (*reset_fn)(apr_sms_t *mem_sys); + void (*pre_destroy_fn)(apr_sms_t *mem_sys); + void (*destroy_fn)(apr_sms_t *mem_sys); + void (*threadsafe_lock_fn)(apr_sms_t *mem_sys); + void (*threadsafe_unlock_fn)(apr_sms_t *mem_sys); }; /* @@ -100,45 +109,46 @@ struct apr_memory_system_t /** * Allocate a block of memory using a certain memory system - * @param memory_system The memory system to use + * @param mem_sys The memory system to use + * @param size The (minimal required) size of the block to be allocated + * @return pointer to a newly allocated block of memory, NULL if insufficient + * memory available + * @deffunc void *apr_sms_malloc(apr_sms_t *mem_sys, apr_size_t size) + */ +APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *mem_sys, apr_size_t size); + +/** + * Allocate a block of zeroed memory using a certain memory system + * @param mem_sys The memory system to use * @param size The (minimal required) size of the block to be allocated * @return pointer to a newly allocated block of memory, NULL if insufficient * memory available - * @deffunc void *apr_memory_system_malloc(apr_memory_system_t *memory_system, - * apr_size_t size) + * @deffunc void *apr_sms_calloc(apr_sms_t *mem_sys, apr_size_t size) */ -APR_DECLARE(void *) -apr_memory_system_malloc(apr_memory_system_t *memory_system, - apr_size_t size); +APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *mem_sys, apr_size_t size); /** * Change the size of a previously allocated block of memory - * @param memory_system The memory system to use (should be the same as the + * @param mem_sys The memory system to use (should be the same as the * one that returned the block) * @param mem Pointer to the previously allocated block. If NULL, this - * function acts like apr_memory_system_malloc. + * function acts like apr_sms_malloc. * @param size The (minimal required) size of the block to be allocated * @return pointer to a newly allocated block of memory, NULL if insufficient * memory available - * @deffunc void *apr_memory_system_realloc(apr_memory_system_t *memory_system, - * void *mem, apr_size_t size) + * @deffunc void *apr_sms_realloc(apr_sms_t *mem_sys, void *mem, apr_size_t size) */ -APR_DECLARE(void *) -apr_memory_system_realloc(apr_memory_system_t *memory_system, - void *mem, - apr_size_t size); +APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem, apr_size_t size); /** * Free a block of memory - * @param memory_system The memory system to use (should be the same as the + * @param mem_sys The memory system to use (should be the same as the * one that returned the block) * @param mem The block of memory to be freed - * @deffunc void apr_memory_system_free(apr_memory_system_t *memory_system, + * @deffunc void apr_sms_free(apr_sms_t *mem_sys, * void *mem) */ -APR_DECLARE(apr_status_t) -apr_memory_system_free(apr_memory_system_t *memory_system, - void *mem); +APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys, void *mem); /* * memory system functions @@ -148,34 +158,32 @@ apr_memory_system_free(apr_memory_system_t *memory_system, * Create a memory system (actually it initialized a memory system structure) * @caution Call this function as soon as you have obtained a block of memory * to serve as a memory system structure from your - * apr_xxx_memory_system_create. Only use this function when you are + * apr_xxx_sms_create. Only use this function when you are * implementing a memory system. * @param memory The memory to turn into a memory system * @warning The memory passed in should be at least of size - * sizeof(apr_memory_system_t) - * @param parent_memory_system The parent memory system + * sizeof(apr_sms_t) + * @param parent_mem_sys The parent memory system * @return The freshly initialized memory system - * @deffunc apr_memory_system_t *apr_memory_system_create(void *memory, - * apr_memory_system_t *parent_memory_system) + * @deffunc apr_sms_t *apr_sms_create(void *memory, + * apr_sms_t *parent_mem_sys) */ -APR_DECLARE(apr_memory_system_t *) -apr_memory_system_create(void *memory, - apr_memory_system_t *parent_memory_system); +APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory, apr_sms_t *parent_mem_sys); /** * Check if a memory system is obeying all rules. * @caution Call this function as the last statement before returning a new - * memory system from your apr_xxx_memory_system_create. - * @deffunc void apr_memory_system_validate(apr_memory_system_t *memory_system) + * memory system from your apr_xxx_sms_create. + * @deffunc void apr_sms_validate(apr_sms_t *mem_sys) */ #ifdef APR_MEMORY_SYSTEM_DEBUG APR_DECLARE(void) -apr_memory_system_assert(apr_memory_system_t *memory_system); +apr_sms_assert(apr_sms_t *mem_sys); #else -#ifdef apr_memory_system_assert -#undef apr_memory_system_assert +#ifdef apr_sms_assert +#undef apr_sms_assert #endif -#define apr_memory_system_assert(memory_system) +#define apr_sms_assert(mem_sys) #endif /* APR_MEMORY_SYSTEM_DEBUG */ /** @@ -184,50 +192,45 @@ apr_memory_system_assert(apr_memory_system_t *memory_system); * @warning This function will fail if there is no reset function available * for the given memory system (i.e. the memory system is non- * tracking). - * @param memory_system The memory system to be reset - * @deffunc apr_status_t apr_memory_system_reset(apr_memory_system_t *memory_system) + * @param mem_sys The memory system to be reset + * @deffunc apr_status_t apr_sms_reset(apr_sms_t *mem_sys) */ -APR_DECLARE(apr_status_t) -apr_memory_system_reset(apr_memory_system_t *memory_system); +APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys); /** * Destroy a memory system, effectively freeing all of its memory, and itself. * This will also run all cleanup functions associated with the memory system. * @caution Be carefull when using this function with a non-tracking memory * system - * @param memory_system The memory system to be destroyed - * @deffunc apr_status_t apr_memory_system_destroy(apr_memory_system_t *memory_system) + * @param mem_sys The memory system to be destroyed + * @deffunc apr_status_t apr_sms_destroy(apr_sms_t *mem_sys) */ -APR_DECLARE(apr_status_t) -apr_memory_system_destroy(apr_memory_system_t *memory_system); +APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys); /** * Perform thread-safe locking required whilst this memory system is modified - * @param memory_system The memory system to be locked for thread-safety - * @deffunc void apr_memory_system_threadsafe_lock(apr_memory_system_t *memory_system) + * @param mem_sys The memory system to be locked for thread-safety + * @deffunc void apr_sms_threadsafe_lock(apr_sms_t *mem_sys) */ -APR_DECLARE(void) -apr_memory_system_threadsafe_lock(apr_memory_system_t *memory_system); +APR_DECLARE(void) apr_sms_threadsafe_lock(apr_sms_t *mem_sys); /** * Release thread-safe locking required whilst this memory system was * being modified - * @param memory_system The memory system to be released from thread-safety - * @deffunc void apr_memory_system_threadsafe_unlock(apr_memory_system_t *memory_system) + * @param mem_sys The memory system to be released from thread-safety + * @deffunc void apr_sms_threadsafe_unlock(apr_sms_t *mem_sys) */ -APR_DECLARE(void) -apr_memory_system_threadsafe_unlock(apr_memory_system_t *memory_system); +APR_DECLARE(void) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys); /** * Determine if memory system a is an ancestor of memory system b * @param a The memory system to search * @param b The memory system to search for * @return APR_SUCCESS if a is an ancestor of b, 1 if it isn't - * @deffunc apr_status_t apr_memory_system_is_ancestor(apr_memory_system_t *a, - * apr_memory_system_t *b) + * @deffunc apr_status_t apr_sms_is_ancestor(apr_sms_t *a, + * apr_sms_t *b) */ -APR_DECLARE(apr_status_t) -apr_memory_system_is_ancestor(apr_memory_system_t *a, apr_memory_system_t *b); +APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a, apr_sms_t *b); /* * memory system cleanup management functions @@ -235,51 +238,46 @@ apr_memory_system_is_ancestor(apr_memory_system_t *a, apr_memory_system_t *b); /** * Register a function to be called when a memory system is reset or destroyed - * @param memory_system The memory system to register the cleanup function with + * @param mem_sys The memory system to register the cleanup function with * @param data The data to pass to the cleanup function * @param cleanup_fn The function to call when the memory system is reset or * destroyed - * @deffunc void apr_memory_system_cleanup_register(apr_memory_system_t *memory_system, + * @deffunc void apr_sms_cleanup_register(apr_sms_t *mem_sys, * void *data, apr_status_t (*cleanup_fn)(void *)); */ -APR_DECLARE(apr_status_t) -apr_memory_system_cleanup_register(apr_memory_system_t *memory_system, - void *data, - apr_status_t (*cleanup_fn)(void *)); +APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys, void *data, + apr_status_t (*cleanup_fn)(void *)); /** * Unregister a previously registered cleanup function - * @param memory_system The memory system the cleanup function is registered + * @param mem_sys The memory system the cleanup function is registered * with * @param data The data associated with the cleanup function * @param cleanup_fn The registered cleanup function - * @deffunc void apr_memory_system_cleanup_unregister(apr_memory_system_t *memory_system, + * @deffunc void apr_sms_cleanup_unregister(apr_sms_t *mem_sys, * void *data, apr_status_t (*cleanup_fn)(void *)); */ -APR_DECLARE(apr_status_t) -apr_memory_system_cleanup_unregister(apr_memory_system_t *memory_system, - void *data, - apr_status_t (*cleanup)(void *)); +APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys, void *data, + apr_status_t (*cleanup)(void *)); /** * Run the specified cleanup function immediately and unregister it - * @param memory_system The memory system the cleanup function is registered + * @param mem_sys The memory system the cleanup function is registered * with * @param data The data associated with the cleanup function * @param cleanup The registered cleanup function - * @deffunc apr_status_t apr_memory_system_cleanup_run(apr_memory_system_t *memory_system, + * @deffunc apr_status_t apr_sms_cleanup_run(apr_sms_t *mem_sys, * void *data, apr_status_t (*cleanup)(void *)); */ -APR_DECLARE(apr_status_t) -apr_memory_system_cleanup_run(apr_memory_system_t *memory_system, - void *data, - apr_status_t (*cleanup)(void *)); +APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *mem_sys, void *data, + apr_status_t (*cleanup)(void *)); /** * Create a standard malloc/realloc/free memory system + * @param mem_sys A pointer to the created apr_sms_t* + * @deffunc apr_status_t apr_sms_std_create(apr_sms_t **mem_sys); */ -APR_DECLARE(apr_status_t) -apr_standard_memory_system_create(apr_memory_system_t **memory_system); +APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys); #ifdef __cplusplus diff --git a/include/apr_tracking_memory_system.h b/include/apr_tracking_memory_system.h index d83963fc458..c07c8a7d6a9 100644 --- a/include/apr_tracking_memory_system.h +++ b/include/apr_tracking_memory_system.h @@ -52,6 +52,14 @@ * . */ +/* This code kindly donated to APR by + * Elrond + * Luke Kenneth Casson Leighton + * Sander Striker + * + * May 2001 + */ + #ifndef APR_TRACKING_MEMORY_SYSTEM_H #define APR_TRACKING_MEMORY_SYSTEM_H @@ -68,10 +76,14 @@ extern "C" { /** * Create a standard malloc/realloc/free memory system + * @param mem_sys A pointer to the returned apr_sms_t* + * @param pms The parent memory system, used to allocate the memory + * that we will be tracking. + * @deffunc apr_status_t apr_sms_tracking_create(apr_sms_t **mem_sys, + * apr_sms_t *pms); */ -APR_DECLARE(apr_status_t) -apr_tracking_memory_system_create(apr_memory_system_t **memory_system, - apr_memory_system_t *parent_memory_system); +APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys, + apr_sms_t *pms); diff --git a/memory/unix/apr_memory_system.c b/memory/unix/apr_memory_system.c index 2c119fd634c..22170a7ca1a 100644 --- a/memory/unix/apr_memory_system.c +++ b/memory/unix/apr_memory_system.c @@ -52,10 +52,12 @@ * . */ -/* This code donated to APR by +/* This code kindly donated to APR by * Elrond * Luke Kenneth Casson Leighton * Sander Striker + * + * May 2001 */ #include "apr.h" @@ -71,9 +73,9 @@ /* * private structure defenitions */ -struct apr_memory_system_cleanup +struct apr_sms_cleanup { - struct apr_memory_system_cleanup *next; + struct apr_sms_cleanup *next; void *data; apr_status_t (*cleanup_fn)(void *); }; @@ -82,59 +84,66 @@ struct apr_memory_system_cleanup * memory allocation functions */ -APR_DECLARE(void *) -apr_memory_system_malloc(apr_memory_system_t *memory_system, - apr_size_t size) +APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *mem_sys, + apr_size_t size) { - assert(memory_system != NULL); - assert(memory_system->malloc_fn != NULL); + assert(mem_sys != NULL); + assert(mem_sys->malloc_fn != NULL); if (size == 0) return NULL; - return memory_system->malloc_fn(memory_system, size); + return mem_sys->malloc_fn(mem_sys, size); } -APR_DECLARE(void *) -apr_memory_system_realloc(apr_memory_system_t *memory_system, - void *mem, - apr_size_t size) +APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *mem_sys, + apr_size_t size) { - assert(memory_system != NULL); - assert(memory_system->realloc_fn != NULL); + assert(mem_sys != NULL); + + if (size == 0) + return NULL; + + if (mem_sys->calloc_fn == NULL){ + /* Assumption - if we don't have calloc we have + * malloc, might be bogus... + */ + void *mem = mem_sys->malloc_fn(mem_sys, size); + memset(mem, '\0', size); + return mem; + } else + return mem_sys->calloc_fn(mem_sys, size); +} + +APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem, + apr_size_t size) +{ + assert(mem_sys != NULL); + assert(mem_sys->realloc_fn != NULL); if (mem == NULL) - return apr_memory_system_malloc(memory_system, size); + return apr_sms_malloc(mem_sys, size); if (size == 0) { - apr_memory_system_free(memory_system, mem); + apr_sms_free(mem_sys, mem); return NULL; } - return memory_system->realloc_fn(memory_system, mem, size); + return mem_sys->realloc_fn(mem_sys, mem, size); } -APR_DECLARE(apr_status_t) -apr_memory_system_free(apr_memory_system_t *memory_system, - void *mem) +APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys, + void *mem) { - assert(memory_system != NULL); + assert(mem_sys != NULL); if (mem == NULL) - return APR_EINVAL; /* Hmm, is this an error??? */ + return APR_EINVAL; - if (memory_system->free_fn != NULL) - return memory_system->free_fn(memory_system, mem); + if (mem_sys->free_fn != NULL) + return mem_sys->free_fn(mem_sys, mem); -#ifdef APR_MEMORY_SYSTEM_DEBUG - else /* assume this is a tracking memory system */ - { - /* issue a warning: - * WARNING: Called apr_memory_system_free() on a tracking memory system - */ - } -#endif /* APR_MEMORY_SYSTEM_DEBUG */ return APR_SUCCESS; } @@ -142,65 +151,63 @@ apr_memory_system_free(apr_memory_system_t *memory_system, * memory system functions */ -static int apr_memory_system_is_tracking(apr_memory_system_t *memory_system) +static int apr_sms_is_tracking(apr_sms_t *mem_sys) { /* * The presense of a reset function gives us the clue that this is a * tracking memory system. */ - return memory_system->reset_fn != NULL; + return mem_sys->reset_fn != NULL; } -APR_DECLARE(apr_memory_system_t *) -apr_memory_system_create(void *memory, - apr_memory_system_t *parent_memory_system) +APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory, + apr_sms_t *parent_mem_sys) { - apr_memory_system_t *memory_system; + apr_sms_t *mem_sys; if (memory == NULL) return NULL; /* Just typecast it, and clear it */ - memory_system = (apr_memory_system_t *)memory; - memset(memory_system, '\0', sizeof(apr_memory_system_t)); + mem_sys = (apr_sms_t *)memory; + memset(mem_sys, '\0', sizeof(apr_sms_t)); /* Initialize the parent and accounting memory system pointers */ - memory_system->parent_memory_system = parent_memory_system; - memory_system->accounting_memory_system = memory_system; + mem_sys->parent_mem_sys = parent_mem_sys; + mem_sys->accounting_mem_sys = mem_sys; - if (parent_memory_system != NULL) + if (parent_mem_sys != NULL) { - if ((memory_system->sibling_memory_system = - parent_memory_system->child_memory_system) != NULL) + if ((mem_sys->sibling_mem_sys = + parent_mem_sys->child_mem_sys) != NULL) { - memory_system->sibling_memory_system->ref_memory_system = - &memory_system->sibling_memory_system; + mem_sys->sibling_mem_sys->ref_mem_sys = + &mem_sys->sibling_mem_sys; } - memory_system->ref_memory_system = - &parent_memory_system->child_memory_system; - parent_memory_system->child_memory_system = memory_system; + mem_sys->ref_mem_sys = + &parent_mem_sys->child_mem_sys; + parent_mem_sys->child_mem_sys = mem_sys; } /* This seems a bit redundant, but we're not taking chances */ else { - memory_system->ref_memory_system = NULL; - memory_system->sibling_memory_system = NULL; - memory_system->child_memory_system = NULL; + mem_sys->ref_mem_sys = NULL; + mem_sys->sibling_mem_sys = NULL; + mem_sys->child_mem_sys = NULL; } - return memory_system; + return mem_sys; } #ifdef APR_MEMORY_SYSTEM_DEBUG -APR_DECLARE(void) -apr_memory_system_assert(apr_memory_system_t *memory_system) +APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys) { - apr_memory_system_t *parent; + apr_sms_t *parent; /* * A memory system without a malloc won't do us much good */ - assert(memory_system->malloc_fn != NULL); + assert(mem_sys->malloc_fn != NULL); /* * Check to see if this is either a non-tracking or @@ -208,24 +215,24 @@ apr_memory_system_assert(apr_memory_system_t *memory_system) * or destroy function. And to avoid half implementations * we require reset to be present when destroy is. */ - assert(memory_system->free_fn != NULL || - (memory_system->destroy_fn != NULL && - memory_system->reset_fn != NULL)); + assert(mem_sys->free_fn != NULL || + (mem_sys->destroy_fn != NULL && + mem_sys->reset_fn != NULL)); - assert(memory_system->destroy_fn == NULL || - memory_system->reset_fn != NULL); + assert(mem_sys->destroy_fn == NULL || + mem_sys->reset_fn != NULL); - assert(memory_system->reset_fn == NULL || - memory_system->destroy_fn != NULL); + assert(mem_sys->reset_fn == NULL || + mem_sys->destroy_fn != NULL); /* * Make sure all accounting memory dies with the memory system. * To be more specific, make sure the accounting memort system * is either the memory system itself or a direct child. */ - assert(memory_system->accounting_memory_system == memory_system || - memory_system->accounting_memory_system->parent_memory_system == - memory_system); + assert(mem_sys->accounting_mem_sys == mem_sys || + mem_sys->accounting_mem_sys->parent_mem_sys == + mem_sys); /* * A non-tracking memory system can be the child of @@ -233,16 +240,16 @@ apr_memory_system_assert(apr_memory_system_t *memory_system) * tracking ancestors, but in that specific case we issue a * warning. */ - if (memory_system->parent_memory_system == NULL) + if (mem_sys->parent_mem_sys == NULL) return; - parent = memory_system + parent = mem_sys while (parent) { - if (apr_memory_system_is_tracking(parent)) + if (apr_sms_is_tracking(parent)) return; /* Tracking memory system found, return satisfied ;-) */ - parent = parent->parent_memory_system; + parent = parent->parent_mem_sys; } /* issue a warning: @@ -254,19 +261,17 @@ apr_memory_system_assert(apr_memory_system_t *memory_system) /* * LOCAL FUNCTION used in: - * - apr_memory_system_do_child_cleanups - * - apr_memory_system_reset - * - apr_memory_system_destroy + * - apr_sms_do_child_cleanups + * - apr_sms_reset + * - apr_sms_destroy * * Call all the cleanup routines registered with a memory system. */ -static -void -apr_memory_system_do_cleanups(apr_memory_system_t *memory_system) +static void apr_sms_do_cleanups(apr_sms_t *mem_sys) { - struct apr_memory_system_cleanup *cleanup; + struct apr_sms_cleanup *cleanup; - cleanup = memory_system->cleanups; + cleanup = mem_sys->cleanups; while (cleanup) { cleanup->cleanup_fn(cleanup->data); @@ -276,50 +281,47 @@ apr_memory_system_do_cleanups(apr_memory_system_t *memory_system) /* * LOCAL FUNCTION used in: - * - apr_memory_system_reset - * - apr_memory_system_destroy + * - apr_sms_reset + * - apr_sms_destroy * * This not only calls do_cleanups, but also calls the pre_destroy(!) */ -static -void -apr_memory_system_do_child_cleanups(apr_memory_system_t *memory_system) +static void apr_sms_do_child_cleanups(apr_sms_t *mem_sys) { - if (memory_system == NULL) + if (mem_sys == NULL) return; - memory_system = memory_system->child_memory_system; - while (memory_system) + mem_sys = mem_sys->child_mem_sys; + while (mem_sys) { - apr_memory_system_do_child_cleanups(memory_system); - apr_memory_system_do_cleanups(memory_system); + apr_sms_do_child_cleanups(mem_sys); + apr_sms_do_cleanups(mem_sys); - if (memory_system->pre_destroy_fn != NULL) - memory_system->pre_destroy_fn(memory_system); + if (mem_sys->pre_destroy_fn != NULL) + mem_sys->pre_destroy_fn(mem_sys); - memory_system = memory_system->sibling_memory_system; + mem_sys = mem_sys->sibling_mem_sys; } } -APR_DECLARE(apr_status_t) -apr_memory_system_reset(apr_memory_system_t *memory_system) +APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys) { - assert(memory_system != NULL); + assert(mem_sys != NULL); /* Assert when called on a non-tracking memory system */ - assert(memory_system->reset_fn != NULL); + assert(mem_sys->reset_fn != NULL); /* * Run the cleanups of all child memory systems _including_ * the accounting memory system. */ - apr_memory_system_do_child_cleanups(memory_system); + apr_sms_do_child_cleanups(mem_sys); /* Run all cleanups, the memory will be freed by the reset */ - apr_memory_system_do_cleanups(memory_system); - memory_system->cleanups = NULL; + apr_sms_do_cleanups(mem_sys); + mem_sys->cleanups = NULL; /* We don't have any child memory systems after the reset */ - memory_system->child_memory_system = NULL; + mem_sys->child_mem_sys = NULL; /* Reset the accounting memory system to ourselves, any * child memory system _including_ the accounting memory @@ -327,143 +329,142 @@ apr_memory_system_reset(apr_memory_system_t *memory_system) * strikerXXX: Maybe this should be the responsibility of * the reset function(?). */ - memory_system->accounting_memory_system = memory_system; + mem_sys->accounting_mem_sys = mem_sys; /* Let the memory system handle the actual reset */ - return memory_system->reset_fn(memory_system); + return mem_sys->reset_fn(mem_sys); } -APR_DECLARE(apr_status_t) -apr_memory_system_destroy(apr_memory_system_t *memory_system) +APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys) { - apr_memory_system_t *child_memory_system; - apr_memory_system_t *sibling_memory_system; - struct apr_memory_system_cleanup *cleanup; - struct apr_memory_system_cleanup *next_cleanup; + apr_sms_t *child_mem_sys; + apr_sms_t *sibling_mem_sys; + struct apr_sms_cleanup *cleanup; + struct apr_sms_cleanup *next_cleanup; - assert(memory_system != NULL); + assert(mem_sys != NULL); - if (apr_memory_system_is_tracking(memory_system)) + if (apr_sms_is_tracking(mem_sys)) { /* * Run the cleanups of all child memory systems _including_ * the accounting memory system. */ - apr_memory_system_do_child_cleanups(memory_system); + apr_sms_do_child_cleanups(mem_sys); /* Run all cleanups, the memory will be freed by the destroy */ - apr_memory_system_do_cleanups(memory_system); + apr_sms_do_cleanups(mem_sys); } else { - if (memory_system->accounting_memory_system != memory_system) + if (mem_sys->accounting_mem_sys != mem_sys) { - child_memory_system = memory_system->accounting_memory_system; + child_mem_sys = mem_sys->accounting_mem_sys; /* * Remove the accounting memory system from the memory systems * child list (we will explicitly destroy it later in this block). */ - if (child_memory_system->sibling_memory_system != NULL) - child_memory_system->sibling_memory_system->ref_memory_system = - child_memory_system->ref_memory_system; + if (child_mem_sys->sibling_mem_sys != NULL) + child_mem_sys->sibling_mem_sys->ref_mem_sys = + child_mem_sys->ref_mem_sys; - *child_memory_system->ref_memory_system = - child_memory_system->sibling_memory_system; + *child_mem_sys->ref_mem_sys = + child_mem_sys->sibling_mem_sys; /* Set this fields so destroy will work */ - child_memory_system->ref_memory_system = NULL; - child_memory_system->sibling_memory_system = NULL; + child_mem_sys->ref_mem_sys = NULL; + child_mem_sys->sibling_mem_sys = NULL; } /* Visit all children and destroy them */ - child_memory_system = memory_system->child_memory_system; - while (child_memory_system != NULL) + child_mem_sys = mem_sys->child_mem_sys; + while (child_mem_sys != NULL) { - sibling_memory_system = child_memory_system->sibling_memory_system; - apr_memory_system_destroy(child_memory_system); - child_memory_system = sibling_memory_system; + sibling_mem_sys = child_mem_sys->sibling_mem_sys; + apr_sms_destroy(child_mem_sys); + child_mem_sys = sibling_mem_sys; } /* * If the accounting memory system _is_ tracking, we also know that it is * not the memory system itself. */ - if (apr_memory_system_is_tracking(memory_system->accounting_memory_system)) + if (apr_sms_is_tracking(mem_sys->accounting_mem_sys)) { /* * Run all cleanups, the memory will be freed by the destroying of the * accounting memory system. */ - apr_memory_system_do_cleanups(memory_system); + apr_sms_do_cleanups(mem_sys); /* Destroy the accounting memory system */ - apr_memory_system_destroy(memory_system->accounting_memory_system); + apr_sms_destroy(mem_sys->accounting_mem_sys); /* * Set the accounting memory system back to the parent memory system * just in case... */ - memory_system->accounting_memory_system = memory_system; + mem_sys->accounting_mem_sys = mem_sys; } else { /* Run all cleanups, free'ing memory as we go */ - cleanup = memory_system->cleanups; + cleanup = mem_sys->cleanups; while (cleanup) { cleanup->cleanup_fn(cleanup->data); next_cleanup = cleanup->next; - apr_memory_system_free(memory_system->accounting_memory_system, + apr_sms_free(mem_sys->accounting_mem_sys, cleanup); cleanup = next_cleanup; } - if (memory_system->accounting_memory_system != memory_system) + if (mem_sys->accounting_mem_sys != mem_sys) { /* Destroy the accounting memory system */ - apr_memory_system_destroy(memory_system->accounting_memory_system); + apr_sms_destroy(mem_sys->accounting_mem_sys); /* * Set the accounting memory system back to the parent memory system * just in case... */ - memory_system->accounting_memory_system = memory_system; + mem_sys->accounting_mem_sys = mem_sys; } } } /* Remove the memory system from the parent memory systems child list */ - if (memory_system->sibling_memory_system != NULL) - memory_system->sibling_memory_system->ref_memory_system = - memory_system->ref_memory_system; - if (memory_system->ref_memory_system != NULL) - *memory_system->ref_memory_system = memory_system->sibling_memory_system; + if (mem_sys->sibling_mem_sys != NULL) + mem_sys->sibling_mem_sys->ref_mem_sys = + mem_sys->ref_mem_sys; + if (mem_sys->ref_mem_sys != NULL) + *mem_sys->ref_mem_sys = mem_sys->sibling_mem_sys; /* Call the pre-destroy if present */ - if (memory_system->pre_destroy_fn != NULL) - memory_system->pre_destroy_fn(memory_system); + if (mem_sys->pre_destroy_fn != NULL) + mem_sys->pre_destroy_fn(mem_sys); /* 1 - If we have a self destruct, use it */ - if (memory_system->destroy_fn != NULL) - memory_system->destroy_fn(memory_system); + if (mem_sys->destroy_fn != NULL) + mem_sys->destroy_fn(mem_sys); /* 2 - If we don't have a parent, free using ourselves */ - else if (memory_system->parent_memory_system == NULL) - memory_system->free_fn(memory_system, memory_system); + else if (mem_sys->parent_mem_sys == NULL) + mem_sys->free_fn(mem_sys, mem_sys); /* 3 - If we do have a parent and it has a free function, use it */ - else if (memory_system->parent_memory_system->free_fn != NULL) - apr_memory_system_free(memory_system->parent_memory_system, memory_system); + else if (mem_sys->parent_mem_sys->free_fn != NULL) + apr_sms_free(mem_sys->parent_mem_sys, mem_sys); /* 4 - Assume we are the child of a tracking memory system, and do nothing */ #ifdef APR_MEMORY_SYSTEM_DEBUG - memory_system = memory_system->parent_memory_system; - while (memory_system) + mem_sys = mem_sys->parent_mem_sys; + while (mem_sys) { - if (apr_memory_system_is_tracking(memory_system)) + if (apr_sms_is_tracking(mem_sys)) return APR_SUCCESS; - memory_system = memory_system->parent_memory_system; + mem_sys = mem_sys->parent_mem_sys; } assert(0); /* Made the wrong assumption, so we assert */ @@ -471,91 +472,87 @@ apr_memory_system_destroy(apr_memory_system_t *memory_system) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) -apr_memory_system_is_ancestor(apr_memory_system_t *a, - apr_memory_system_t *b) +APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a, + apr_sms_t *b) { assert(b != NULL); while (b && b != a) - b = b->parent_memory_system; + b = b->parent_mem_sys; - /* strikerXXX: should this be: return b == a ? APR_TRUE : APR_FALSE; */ /* APR_SUCCESS = 0, so if they agree we should return that... */ return !(b == a); } APR_DECLARE(void) -apr_memory_system_threadsafe_lock(apr_memory_system_t *memory_system) +apr_sms_threadsafe_lock(apr_sms_t *mem_sys) { - assert(memory_system != NULL); - if (memory_system->threadsafe_lock_fn != NULL) - memory_system->threadsafe_lock_fn(memory_system); + assert(mem_sys != NULL); + if (mem_sys->threadsafe_lock_fn != NULL) + mem_sys->threadsafe_lock_fn(mem_sys); } APR_DECLARE(void) -apr_memory_system_threadsafe_unlock(apr_memory_system_t *memory_system) +apr_sms_threadsafe_unlock(apr_sms_t *mem_sys) { - assert(memory_system != NULL); - if (memory_system->threadsafe_unlock_fn != NULL) - memory_system->threadsafe_unlock_fn(memory_system); + assert(mem_sys != NULL); + if (mem_sys->threadsafe_unlock_fn != NULL) + mem_sys->threadsafe_unlock_fn(mem_sys); } /* * memory system cleanup management functions */ -APR_DECLARE(apr_status_t) -apr_memory_system_cleanup_register(apr_memory_system_t *memory_system, - void *data, - apr_status_t (*cleanup_fn)(void *)) +APR_DECLARE(apr_status_t) +apr_sms_cleanup_register(apr_sms_t *mem_sys, void *data, + apr_status_t (*cleanup_fn)(void *)) { - struct apr_memory_system_cleanup *cleanup; + struct apr_sms_cleanup *cleanup; - assert(memory_system != NULL); - assert(memory_system->accounting_memory_system != NULL); + assert(mem_sys != NULL); + assert(mem_sys->accounting_mem_sys != NULL); if (cleanup_fn == NULL) return APR_EINVAL; - cleanup = (struct apr_memory_system_cleanup *) - apr_memory_system_malloc(memory_system->accounting_memory_system, - sizeof(struct apr_memory_system_cleanup)); + cleanup = (struct apr_sms_cleanup *) + apr_sms_malloc(mem_sys->accounting_mem_sys, + sizeof(struct apr_sms_cleanup)); if (cleanup == NULL) return APR_ENOMEM; cleanup->data = data; cleanup->cleanup_fn = cleanup_fn; - cleanup->next = memory_system->cleanups; - memory_system->cleanups = cleanup; + cleanup->next = mem_sys->cleanups; + mem_sys->cleanups = cleanup; return APR_SUCCESS; } APR_DECLARE(apr_status_t) -apr_memory_system_cleanup_unregister(apr_memory_system_t *memory_system, - void *data, - apr_status_t (*cleanup_fn)(void *)) +apr_sms_cleanup_unregister(apr_sms_t *mem_sys, void *data, + apr_status_t (*cleanup_fn)(void *)) { - struct apr_memory_system_cleanup *cleanup; - struct apr_memory_system_cleanup **cleanup_ref; + struct apr_sms_cleanup *cleanup; + struct apr_sms_cleanup **cleanup_ref; - assert(memory_system != NULL); - assert(memory_system->accounting_memory_system != NULL); + assert(mem_sys != NULL); + assert(mem_sys->accounting_mem_sys != NULL); - cleanup = memory_system->cleanups; - cleanup_ref = &memory_system->cleanups; + cleanup = mem_sys->cleanups; + cleanup_ref = &mem_sys->cleanups; while (cleanup) { if (cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) { *cleanup_ref = cleanup->next; - memory_system = memory_system->accounting_memory_system; + mem_sys = mem_sys->accounting_mem_sys; - if (memory_system->free_fn != NULL) - apr_memory_system_free(memory_system, cleanup); + if (mem_sys->free_fn != NULL) + apr_sms_free(mem_sys, cleanup); return APR_SUCCESS; } @@ -568,11 +565,10 @@ apr_memory_system_cleanup_unregister(apr_memory_system_t *memory_system, return APR_ENOCLEANUP; } -APR_DECLARE(apr_status_t) -apr_memory_system_cleanup_run(apr_memory_system_t *memory_system, - void *data, - apr_status_t (*cleanup_fn)(void *)) +APR_DECLARE(apr_status_t) +apr_sms_cleanup_run(apr_sms_t *mem_sys, void *data, + apr_status_t (*cleanup_fn)(void *)) { - apr_memory_system_cleanup_unregister(memory_system, data, cleanup_fn); + apr_sms_cleanup_unregister(mem_sys, data, cleanup_fn); return cleanup_fn(data); } diff --git a/memory/unix/apr_standard_memory_system.c b/memory/unix/apr_standard_memory_system.c index f7712eb275b..791835835e4 100644 --- a/memory/unix/apr_standard_memory_system.c +++ b/memory/unix/apr_standard_memory_system.c @@ -52,15 +52,16 @@ * . */ -/* This code donated to APR by +/* This code kindly donated to APR by * Elrond * Luke Kenneth Casson Leighton * Sander Striker + * + * May 2001 */ #include "apr.h" #include "apr_private.h" -#include "apr_general.h" #include "apr_memory_system.h" #include #include @@ -69,51 +70,63 @@ * standard memory system */ -static -void * -apr_standard_memory_system_malloc(apr_memory_system_t *memory_system, - apr_size_t size) +static void * apr_sms_std_malloc(apr_sms_t *mem_sys, + apr_size_t size) { return malloc(size); } -static -void * -apr_standard_memory_system_realloc(apr_memory_system_t *memory_system, - void *mem, apr_size_t size) +static void * apr_sms_std_calloc(apr_sms_t *mem_sys, + apr_size_t size) +{ +#if HAVE_CALLOC + return calloc(1, size); +#else + void *mem; + mem = malloc(size); + memset(mem, '\0', size); + return mem; +#endif +} + + +static void * apr_sms_std_realloc(apr_sms_t *mem_sys, + void *mem, apr_size_t size) { return realloc(mem, size); } -static -apr_status_t -apr_standard_memory_system_free(apr_memory_system_t *memory_system, - void *mem) +static apr_status_t apr_sms_std_free(apr_sms_t *mem_sys, + void *mem) { free(mem); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) -apr_standard_memory_system_create(apr_memory_system_t **memory_system) +APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys) { - apr_memory_system_t *new_memory_system; + apr_sms_t *new_mem_sys; - assert(memory_system != NULL); + assert(mem_sys != NULL); - *memory_system = NULL; - new_memory_system = apr_memory_system_create( - malloc(sizeof(apr_memory_system_t)), NULL); + *mem_sys = NULL; + /* should we be using apr_sms_calloc now we have it??? */ + new_mem_sys = apr_sms_create(malloc(sizeof(apr_sms_t)), + NULL); - if (new_memory_system == NULL) + if (new_mem_sys == NULL) return APR_ENOMEM; - new_memory_system->malloc_fn = apr_standard_memory_system_malloc; - new_memory_system->realloc_fn = apr_standard_memory_system_realloc; - new_memory_system->free_fn = apr_standard_memory_system_free; - - apr_memory_system_assert(new_memory_system); + new_mem_sys->malloc_fn = apr_sms_std_malloc; + new_mem_sys->calloc_fn = apr_sms_std_calloc; + new_mem_sys->realloc_fn = apr_sms_std_realloc; + new_mem_sys->free_fn = apr_sms_std_free; + /* as we're not a tracking memory module, i.e. we don't keep + * track of our allocations, we don't have apr_sms_reset or + * apr_sms_destroy functions. + */ + apr_sms_assert(new_mem_sys); - *memory_system = new_memory_system; + *mem_sys = new_mem_sys; return APR_SUCCESS; } diff --git a/memory/unix/apr_tracking_memory_system.c b/memory/unix/apr_tracking_memory_system.c index 977460dcc25..afb3690846d 100644 --- a/memory/unix/apr_tracking_memory_system.c +++ b/memory/unix/apr_tracking_memory_system.c @@ -52,10 +52,12 @@ * . */ -/* This code donated to APR by +/* This code kindly donated to APR by * Elrond * Luke Kenneth Casson Leighton * Sander Striker + * + * May 2001 */ #include "apr.h" @@ -66,41 +68,39 @@ #include /* - * tracking memory system + * Simple tracking memory system */ /* INTERNALLY USED STRUCTURES */ typedef struct apr_track_node_t { - struct apr_track_node_t *next; + struct apr_track_node_t *next; struct apr_track_node_t **ref; } apr_track_node_t; -typedef struct apr_tracking_memory_system_t +typedef struct apr_sms_tracking_t { - apr_memory_system_t header; + apr_sms_t header; apr_track_node_t *nodes; -} apr_tracking_memory_system_t; +} apr_sms_tracking_t; -static -void * -apr_tracking_memory_system_malloc(apr_memory_system_t *memory_system, - apr_size_t size) +static void * apr_sms_tracking_malloc(apr_sms_t *mem_sys, + apr_size_t size) { - apr_tracking_memory_system_t *tracking_memory_system; + apr_sms_tracking_t *tms; apr_track_node_t *node; - assert (memory_system != NULL); + assert (mem_sys != NULL); - tracking_memory_system = (apr_tracking_memory_system_t *)memory_system; - node = apr_memory_system_malloc(memory_system->parent_memory_system, - size + sizeof(apr_track_node_t)); + tms = (apr_sms_tracking_t *)mem_sys; + node = apr_sms_malloc(mem_sys->parent_mem_sys, + size + sizeof(apr_track_node_t)); if (node == NULL) return NULL; - node->next = tracking_memory_system->nodes; - tracking_memory_system->nodes = node; - node->ref = &tracking_memory_system->nodes; + node->next = tms->nodes; + tms->nodes = node; + node->ref = &tms->nodes; if (node->next != NULL) node->next->ref = &node->next; @@ -109,17 +109,40 @@ apr_tracking_memory_system_malloc(apr_memory_system_t *memory_system, return (void *)node; } -static -void * -apr_tracking_memory_system_realloc(apr_memory_system_t *memory_system, - void *mem, apr_size_t size) +static void * apr_sms_tracking_calloc(apr_sms_t *mem_sys, + apr_size_t size) { - apr_tracking_memory_system_t *tracking_memory_system; + apr_sms_tracking_t *tms; apr_track_node_t *node; + + assert (mem_sys != NULL); + + tms = (apr_sms_tracking_t *)mem_sys; + node = apr_sms_calloc(mem_sys->parent_mem_sys, + size + sizeof(apr_track_node_t)); + if (node == NULL) + return NULL; - assert (memory_system != NULL); + node->next = tms->nodes; + tms->nodes = node; + node->ref = &tms->nodes; + if (node->next != NULL) + node->next->ref = &node->next; - tracking_memory_system = (apr_tracking_memory_system_t *)memory_system; + node++; + + return (void *)node; +} + +static void * apr_sms_tracking_realloc(apr_sms_t *mem_sys, + void *mem, apr_size_t size) +{ + apr_sms_tracking_t *tms; + apr_track_node_t *node; + + assert (mem_sys != NULL); + + tms = (apr_sms_tracking_t *)mem_sys; node = (apr_track_node_t *)mem; if (node != NULL) @@ -128,14 +151,14 @@ apr_tracking_memory_system_realloc(apr_memory_system_t *memory_system, *(node->ref) = node->next; } - node = apr_memory_system_realloc(memory_system->parent_memory_system, - node, size + sizeof(apr_track_node_t)); + node = apr_sms_realloc(mem_sys->parent_mem_sys, + node, size + sizeof(apr_track_node_t)); if (node == NULL) return NULL; - node->next = tracking_memory_system->nodes; - tracking_memory_system->nodes = node; - node->ref = &tracking_memory_system->nodes; + node->next = tms->nodes; + tms->nodes = node; + node->ref = &tms->nodes; if (node->next != NULL) node->next->ref = &node->next; @@ -144,14 +167,12 @@ apr_tracking_memory_system_realloc(apr_memory_system_t *memory_system, return (void *)node; } -static -apr_status_t -apr_tracking_memory_system_free(apr_memory_system_t *memory_system, - void *mem) +static apr_status_t apr_sms_tracking_free(apr_sms_t *mem_sys, + void *mem) { apr_track_node_t *node; - assert (memory_system != NULL); + assert (mem_sys != NULL); assert (mem != NULL); node = (apr_track_node_t *)mem; @@ -161,74 +182,70 @@ apr_tracking_memory_system_free(apr_memory_system_t *memory_system, if (node->next != NULL) node->next->ref = node->ref; - return apr_memory_system_free(memory_system->parent_memory_system, node); + return apr_sms_free(mem_sys->parent_mem_sys, node); } -static -apr_status_t -apr_tracking_memory_system_reset(apr_memory_system_t *memory_system) +static apr_status_t apr_sms_tracking_reset(apr_sms_t *mem_sys) { - apr_tracking_memory_system_t *tracking_memory_system; + apr_sms_tracking_t *tms; apr_track_node_t *node; apr_status_t rv; - assert (memory_system != NULL); + assert (mem_sys != NULL); - tracking_memory_system = (apr_tracking_memory_system_t *)memory_system; + tms = (apr_sms_tracking_t *)mem_sys; - while (tracking_memory_system->nodes != NULL) + while (tms->nodes != NULL) { - node = tracking_memory_system->nodes; + node = tms->nodes; *(node->ref) = node->next; if (node->next != NULL) node->next->ref = node->ref; - if ((rv = apr_memory_system_free(memory_system->parent_memory_system, - node)) != APR_SUCCESS) + if ((rv = apr_sms_free(mem_sys->parent_mem_sys, + node)) != APR_SUCCESS) return rv; } return APR_SUCCESS; } -static -void -apr_tracking_memory_system_destroy(apr_memory_system_t *memory_system) +static void apr_sms_tracking_destroy(apr_sms_t *mem_sys) { - assert (memory_system != NULL); + assert (mem_sys != NULL); - apr_tracking_memory_system_reset(memory_system); - apr_memory_system_free(memory_system->parent_memory_system, memory_system); + apr_sms_tracking_reset(mem_sys); + apr_sms_free(mem_sys->parent_mem_sys, mem_sys); } -APR_DECLARE(apr_status_t) -apr_tracking_memory_system_create(apr_memory_system_t **memory_system, - apr_memory_system_t *parent_memory_system) +APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys, + apr_sms_t *pms) { - apr_memory_system_t *new_memory_system; - apr_tracking_memory_system_t *tracking_memory_system; - - assert (memory_system != NULL); - assert (parent_memory_system != NULL); - - new_memory_system = apr_memory_system_create( - apr_memory_system_malloc(parent_memory_system, - sizeof(apr_tracking_memory_system_t)), - parent_memory_system); - - *memory_system = NULL; - if (new_memory_system == NULL) + apr_sms_t *new_mem_sys, *tmpms; + apr_sms_tracking_t *tms; + + assert (mem_sys != NULL); + assert (pms != NULL); + *mem_sys = NULL; + /* changed this to 2 stages to make easier to follow... + * should we be using apr_sms_calloc now we have it? + */ + tmpms = apr_sms_malloc(pms, sizeof(apr_sms_tracking_t)); + new_mem_sys = apr_sms_create(tmpms, pms); + + if (new_mem_sys == NULL) return APR_ENOMEM; - new_memory_system->malloc_fn = apr_tracking_memory_system_malloc; - new_memory_system->realloc_fn = apr_tracking_memory_system_realloc; - new_memory_system->free_fn = apr_tracking_memory_system_free; - new_memory_system->reset_fn = apr_tracking_memory_system_reset; - new_memory_system->destroy_fn = apr_tracking_memory_system_destroy; + new_mem_sys->malloc_fn = apr_sms_tracking_malloc; + new_mem_sys->calloc_fn = apr_sms_tracking_calloc; + new_mem_sys->realloc_fn = apr_sms_tracking_realloc; + new_mem_sys->free_fn = apr_sms_tracking_free; + new_mem_sys->reset_fn = apr_sms_tracking_reset; + new_mem_sys->destroy_fn = apr_sms_tracking_destroy; - tracking_memory_system = (apr_tracking_memory_system_t *)new_memory_system; - tracking_memory_system->nodes = NULL; + tms = (apr_sms_tracking_t *)new_mem_sys; + tms->nodes = NULL; - apr_memory_system_assert(new_memory_system); + apr_sms_assert(new_mem_sys); - *memory_system = new_memory_system; + *mem_sys = new_mem_sys; return APR_SUCCESS; } diff --git a/test/testmem.c b/test/testmem.c index fe2c5a02bf1..5f569645832 100644 --- a/test/testmem.c +++ b/test/testmem.c @@ -69,22 +69,55 @@ #define LUMPS 10 #define LUMP_SIZE 1024 char *ptrs[LUMPS]; +int cntr; -static void do_test(apr_memory_system_t *ams) +static void malloc_mem(apr_sms_t *ams) { - int cntr,cntr2; + int cntr; - printf("\tCreating %d lumps of memory, each %d bytes........", + printf("\tMalloc'ing %d lumps of memory, each %d bytes......", LUMPS, LUMP_SIZE); for (cntr = 0;cntr < LUMPS;cntr ++){ - ptrs[cntr] = apr_memory_system_malloc(ams, LUMP_SIZE); + ptrs[cntr] = apr_sms_malloc(ams, LUMP_SIZE); if (!ptrs[cntr]){ printf("Failed @ lump %d of %d\n", cntr + 1, LUMPS); exit (-1); } } printf ("OK\n"); +} +static void calloc_mem(apr_sms_t *ams) +{ + int cntr, cntr2; + + printf("\tCalloc'ing %d lumps of memory, each %d bytes......", + LUMPS, LUMP_SIZE); + for (cntr = 0;cntr < LUMPS;cntr ++){ + ptrs[cntr] = apr_sms_calloc(ams, LUMP_SIZE); + if (!ptrs[cntr]){ + printf("Failed @ lump %d of %d\n", cntr + 1, LUMPS); + exit (-1); + } + } + printf ("OK\n"); + printf("\t (checking that memory is zeroed.................."); + for (cntr = 0;cntr < LUMPS;cntr++){ + for (cntr2 = 0;cntr2 < LUMP_SIZE; cntr2 ++){ + if (*(ptrs[cntr] + cntr2) != 0){ + printf("Failed!\nGot %d instead of 0 at byte %d\n", + *(ptrs[cntr] + cntr2), cntr2 + 1); + exit (-1); + } + } + } + printf("OK)\n"); +} + +static void do_test(apr_sms_t *ams) +{ + int cntr,cntr2; + printf("\tWriting to the lumps of memory......................"); for (cntr = 0;cntr < LUMPS;cntr ++){ if (memset(ptrs[cntr], cntr, LUMP_SIZE) != ptrs[cntr]){ @@ -107,13 +140,13 @@ static void do_test(apr_memory_system_t *ams) printf("OK\n"); } -static void do_free(apr_memory_system_t *ams) +static void do_free(apr_sms_t *ams) { int cntr; printf("\tFreeing the memory we created......................."); for (cntr = 0;cntr < LUMPS;cntr ++){ - if (apr_memory_system_free(ams, ptrs[cntr]) != APR_SUCCESS){ + if (apr_sms_free(ams, ptrs[cntr]) != APR_SUCCESS){ printf("Failed to free block %d\n", cntr + 1); exit (-1); } @@ -123,7 +156,7 @@ static void do_free(apr_memory_system_t *ams) int main(void) { - apr_memory_system_t *ams, *ams2; + apr_sms_t *ams, *tms; apr_initialize(); printf("APR Memory Test\n"); @@ -131,47 +164,53 @@ int main(void) printf("Standard Memory\n"); printf("\tCreating the memory area............................"); - if (apr_standard_memory_system_create(&ams) != APR_SUCCESS){ + if (apr_sms_std_create(&ams) != APR_SUCCESS){ printf("Failed.\n"); exit(-1); } printf("OK\n"); + malloc_mem(ams); do_test(ams); do_free(ams); + calloc_mem(ams); + do_test(ams); + do_free(ams); printf("Tracking Memory\n"); printf("\tCreating the memory area............................"); - if (apr_tracking_memory_system_create(&ams2, ams) != APR_SUCCESS){ + if (apr_sms_tracking_create(&tms, ams) != APR_SUCCESS){ printf("Failed.\n"); exit(-1); } printf("OK\n"); - do_test(ams2); + malloc_mem(tms); + do_test(tms); printf("\tAbout to reset the tracking memory.................."); - if (apr_memory_system_reset(ams2) != APR_SUCCESS){ + if (apr_sms_reset(tms) != APR_SUCCESS){ printf("Failed.\n"); exit(-1); } printf("OK\n"); - do_test(ams2); - do_free(ams2); + calloc_mem(tms); + do_test(tms); + do_free(tms); printf("Trying to destroy the tracking memory segment..............."); - if (apr_memory_system_destroy(ams2) != APR_SUCCESS){ + if (apr_sms_destroy(tms) != APR_SUCCESS){ printf("Failed.\n"); exit (-1); } printf("OK\n"); printf("Trying to destroy the standard memory segment..............."); - if (apr_memory_system_destroy(ams) != APR_SUCCESS){ + if (apr_sms_destroy(ams) != APR_SUCCESS){ printf("Failed.\n"); exit (-1); } printf("OK\n\n"); - printf("Memory test complete.\n"); + printf("Memory test passed.\n"); return (0); } From 92396dad7bd9c8fcccaedce9cff5e691844e3e76 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 13 May 2001 11:13:14 +0000 Subject: [PATCH 1632/7878] Add the check for calloc to configure.in. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61623 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 2dfeeecc99f..fcc49ac0bbe 100644 --- a/configure.in +++ b/configure.in @@ -406,7 +406,7 @@ AC_CHECK_LIB(m,modf) dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) -AC_CHECK_FUNCS(strcasecmp stricmp setsid nl_langinfo isinf isnan) +AC_CHECK_FUNCS(calloc strcasecmp stricmp setsid nl_langinfo isinf isnan) AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) AC_CHECK_FUNCS(writev) From 0a4d04739bc46f57fbf4ce123dec2f8c0290210f Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 13 May 2001 12:01:29 +0000 Subject: [PATCH 1633/7878] OK, this commit basically tries to address the assert vs check thing we've all been talking about. Essentially it's my opinion that in a production build we shouldn't be using asserts, but they do have a use for developers and can really help with reducing the time it takes to find and fix a problem. So, this adds a new configure option, --enable-assert-memory which adds a define to the build that includes asserts. My criteria for having an assert is that it has to provide additional information over any checks that already exist. for instance, look at apr_sms_malloc where the asserts are there as otherwise we miss out on why we return NULL. I've tried to follow this but this is just the start. I've added an extra error message that we return when we have the opportunity and an invalid mem_sys is passed in, APR_EMEMSYS. Comments? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61624 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 ++- include/apr_memory_system.h | 7 ++- memory/unix/apr_memory_system.c | 91 ++++++++++++++++++++++++--------- 3 files changed, 74 insertions(+), 30 deletions(-) diff --git a/configure.in b/configure.in index fcc49ac0bbe..9e7a44cbd91 100644 --- a/configure.in +++ b/configure.in @@ -141,12 +141,16 @@ AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile t ])dnl AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and compile time warnings], - [APR_ADDTO(CFLAGS,-g) + [APR_ADDTO(CFLAGS,-g -DAPR_ASSERT_MEMORY) if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations]) fi ])dnl +AC_ARG_ENABLE(assert-memory,[ --enable-assert-memory Turn on asserts in the APR memory code], + [APR_ADDTO(CFLAGS,-DAPR_ASSERT_MEMORY) +]) + dnl # this is the place to put specific options for platform/compiler dnl # combinations case "$OS:$CC" in diff --git a/include/apr_memory_system.h b/include/apr_memory_system.h index 23357f4d891..46f6b7c4601 100644 --- a/include/apr_memory_system.h +++ b/include/apr_memory_system.h @@ -176,15 +176,14 @@ APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory, apr_sms_t *parent_mem_sys) * memory system from your apr_xxx_sms_create. * @deffunc void apr_sms_validate(apr_sms_t *mem_sys) */ -#ifdef APR_MEMORY_SYSTEM_DEBUG -APR_DECLARE(void) -apr_sms_assert(apr_sms_t *mem_sys); +#ifdef APR_MEMORY_ASSERT +APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys); #else #ifdef apr_sms_assert #undef apr_sms_assert #endif #define apr_sms_assert(mem_sys) -#endif /* APR_MEMORY_SYSTEM_DEBUG */ +#endif /* APR_MEMORY_ASSERT */ /** * Reset a memory system so it can be reused. diff --git a/memory/unix/apr_memory_system.c b/memory/unix/apr_memory_system.c index 22170a7ca1a..00b607956f0 100644 --- a/memory/unix/apr_memory_system.c +++ b/memory/unix/apr_memory_system.c @@ -87,9 +87,14 @@ struct apr_sms_cleanup APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *mem_sys, apr_size_t size) { - assert(mem_sys != NULL); - assert(mem_sys->malloc_fn != NULL); - +#ifdef APR_ASSERT_MEMORY + assert(mem_sys); + assert(mem_sys->malloc_fn); +#endif + + if (!mem_sys || !mem_sys->malloc_fn) + return NULL; + if (size == 0) return NULL; @@ -99,7 +104,11 @@ APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *mem_sys, APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *mem_sys, apr_size_t size) { - assert(mem_sys != NULL); +#ifdef APR_ASSERT_MEMORY + assert(mem_sys); + assert(mem_sys->malloc_fn); + assert(mem_sys->calloc_fn); +#endif if (size == 0) return NULL; @@ -118,9 +127,11 @@ APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *mem_sys, APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem, apr_size_t size) { - assert(mem_sys != NULL); - assert(mem_sys->realloc_fn != NULL); - +#ifdef APR_ASSERT_MEMORY + assert(mem_sys); + assert(mem_sys->realloc_fn); +#endif + if (mem == NULL) return apr_sms_malloc(mem_sys, size); @@ -136,7 +147,12 @@ APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem, APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys, void *mem) { - assert(mem_sys != NULL); +#ifdef APR_ASSERT_MEMORY + assert(mem_sys->free_fn); +#endif + + if (!mem_sys) + return APR_EMEMSYS; if (mem == NULL) return APR_EINVAL; @@ -153,6 +169,9 @@ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys, static int apr_sms_is_tracking(apr_sms_t *mem_sys) { +#ifdef APR_ASSERT_MEMORY + assert(mem_sys->reset_fn); +#endif /* * The presense of a reset function gives us the clue that this is a * tracking memory system. @@ -199,7 +218,7 @@ APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory, return mem_sys; } -#ifdef APR_MEMORY_SYSTEM_DEBUG +#ifdef APR_MEMORY_ASSERT APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys) { apr_sms_t *parent; @@ -257,7 +276,7 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys) * parent. */ } -#endif /* APR_MEMORY_SYSTEM_DEBUG */ +#endif /* APR_MEMORY_ASSERT */ /* * LOCAL FUNCTION used in: @@ -306,9 +325,10 @@ static void apr_sms_do_child_cleanups(apr_sms_t *mem_sys) APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys) { - assert(mem_sys != NULL); - /* Assert when called on a non-tracking memory system */ - assert(mem_sys->reset_fn != NULL); + if (!mem_sys) + return APR_EMEMSYS; + if (!mem_sys->reset_fn) + return APR_EMEMALLOCATOR; /* * Run the cleanups of all child memory systems _including_ @@ -342,7 +362,8 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys) struct apr_sms_cleanup *cleanup; struct apr_sms_cleanup *next_cleanup; - assert(mem_sys != NULL); + if (!mem_sys) + return APR_EMEMSYS; if (apr_sms_is_tracking(mem_sys)) { @@ -457,7 +478,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys) apr_sms_free(mem_sys->parent_mem_sys, mem_sys); /* 4 - Assume we are the child of a tracking memory system, and do nothing */ -#ifdef APR_MEMORY_SYSTEM_DEBUG +#ifdef APR_ASSERT_MEMORY mem_sys = mem_sys->parent_mem_sys; while (mem_sys) { @@ -466,17 +487,21 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys) mem_sys = mem_sys->parent_mem_sys; } - assert(0); /* Made the wrong assumption, so we assert */ -#endif /* APR_MEMORY_SYSTEM_DEBUG */ +#endif /* APR_MEMORY_ASSERT */ return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a, apr_sms_t *b) { +#ifdef APR_ASSERT_MEMORY + assert(a != NULL); assert(b != NULL); - +#endif + if (!b) + return APR_EINVAL; + while (b && b != a) b = b->parent_mem_sys; @@ -484,18 +509,26 @@ APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a, return !(b == a); } -APR_DECLARE(void) -apr_sms_threadsafe_lock(apr_sms_t *mem_sys) +APR_DECLARE(void) apr_sms_threadsafe_lock(apr_sms_t *mem_sys) { +#ifdef APR_ASSERT_MEMORY assert(mem_sys != NULL); +#endif + + if (!mem_sys) + return; if (mem_sys->threadsafe_lock_fn != NULL) mem_sys->threadsafe_lock_fn(mem_sys); } -APR_DECLARE(void) -apr_sms_threadsafe_unlock(apr_sms_t *mem_sys) +APR_DECLARE(void) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys) { +#ifdef APR_ASSERT_MEMORY assert(mem_sys != NULL); +#endif + + if (!mem_sys) + return; if (mem_sys->threadsafe_unlock_fn != NULL) mem_sys->threadsafe_unlock_fn(mem_sys); } @@ -510,15 +543,19 @@ apr_sms_cleanup_register(apr_sms_t *mem_sys, void *data, { struct apr_sms_cleanup *cleanup; - assert(mem_sys != NULL); +#ifdef APR_ASSERT_MEMORY assert(mem_sys->accounting_mem_sys != NULL); +#endif + if (!mem_sys) + return APR_EMEMSYS; + if (cleanup_fn == NULL) return APR_EINVAL; cleanup = (struct apr_sms_cleanup *) apr_sms_malloc(mem_sys->accounting_mem_sys, - sizeof(struct apr_sms_cleanup)); + sizeof(struct apr_sms_cleanup)); if (cleanup == NULL) return APR_ENOMEM; @@ -538,9 +575,13 @@ apr_sms_cleanup_unregister(apr_sms_t *mem_sys, void *data, struct apr_sms_cleanup *cleanup; struct apr_sms_cleanup **cleanup_ref; - assert(mem_sys != NULL); +#ifdef APR_ASSERT_MEMORY assert(mem_sys->accounting_mem_sys != NULL); +#endif + if (!mem_sys) + return APR_EMEMSYS; + cleanup = mem_sys->cleanups; cleanup_ref = &mem_sys->cleanups; while (cleanup) From ff296d57a6413353ee8ad6dfc75efe171930458a Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 13 May 2001 12:03:28 +0000 Subject: [PATCH 1634/7878] This was missed from the last commit for some reason... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61625 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index c0ddc14bdc0..fff0ae8c8cf 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -161,7 +161,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, /** *
      * APR ERROR VALUES
    - * APR_ENOSTAT     -APR was unable to perform a stat on the file 
    + * APR_ENOSTAT      APR was unable to perform a stat on the file 
      * APR_ENOPOOL      APR was not provided a pool with which to allocate memory
      * APR_EBADDATE     APR was given an invalid date 
      * APR_EINVALSOCK   APR was given an invalid socket
    @@ -177,9 +177,12 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
      * APR_ENOSHMAVAIL  There is no more shared memory available
      * APR_EDSOOPEN     APR was unable to open the dso object.  For more 
      *                  information call apr_dso_error().
    - * APR_EGENERAL    -General failure (specific information not available)
    + * APR_EGENERAL     General failure (specific information not available)
      * APR_EBADIP       The specified IP address is invalid
      * APR_EBADMASK     The specified netmask is invalid
    + * APR_ENOCLEANUP     There is no memory cleanup available
    + * APR_EMEMSYS        An invalid memory system was passed in to an 
    + *                    apr_sms function
      * 
    * *
    @@ -248,7 +251,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_EINCOMPLETE    (APR_OS_START_ERROR + 22)
     #define APR_EABOVEROOT     (APR_OS_START_ERROR + 23)
     #define APR_EBADPATH       (APR_OS_START_ERROR + 24)
    -
    +#define APR_ENOCLEANUP     (APR_OS_START_ERROR + 25)
    +#define APR_EMEMSYS        (APR_OS_START_ERROR + 26)
     
     /* APR ERROR VALUE TESTS */
     #define APR_STATUS_IS_ENOSTAT(s)        ((s) == APR_ENOSTAT)
    @@ -275,6 +279,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_EINCOMPLETE(s)    ((s) == APR_EINCOMPLETE)
     #define APR_STATUS_IS_EABOVEROOT(s)     ((s) == APR_EABOVEROOT)
     #define APR_STATUS_IS_EBADPATH(s)       ((s) == APR_EBADPATH)
    +#define APR_STATUS_IS_ENOCLEANUP(s)     ((s) == APR_ENOCLEANUP)
    +#define APR_STATUS_IS_EMEMSYS(s)        ((s) == APR_EMEMSYS)
     
     
     /* APR STATUS VALUES */
    @@ -302,7 +308,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_EINIT          (APR_OS_START_STATUS + 22)  
     #define APR_ENOTIMPL       (APR_OS_START_STATUS + 23)
     #define APR_EMISMATCH      (APR_OS_START_STATUS + 24)
    -#define APR_ENOCLEANUP     (APR_OS_START_STATUS + 25)
     
     /* APR STATUS VALUE TESTS */
     #define APR_STATUS_IS_INCHILD(s)        ((s) == APR_INCHILD)
    @@ -329,7 +334,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_EINIT(s)          ((s) == APR_EINIT)
     #define APR_STATUS_IS_ENOTIMPL(s)       ((s) == APR_ENOTIMPL)
     #define APR_STATUS_IS_EMISMATCH(s)      ((s) == APR_EMISMATCH)
    -#define APR_STATUS_IS_ENOCLEANUP(s)     ((s) == APR_ENOCLEANUP)
     
     /* APR CANONICAL ERROR VALUES */
     #ifdef EACCES
    
    From 33c1d70e3374f9926fb62295ff9dddda8a530d9c Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sun, 13 May 2001 13:06:10 +0000
    Subject: [PATCH 1635/7878] build the APR memory code; otherwise, Apache won't
     build because exports.c references the memory functions
    
    build the testmem program by default too
    
    Reviewed/Submitted by: David Reid
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61626 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in     | 2 +-
     test/Makefile.in | 1 +
     2 files changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/configure.in b/configure.in
    index 9e7a44cbd91..528bbf04945 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -67,7 +67,7 @@ dnl These added to allow default directories to be used...
     DEFAULT_OSDIR="unix"
     echo "(Default will be ${DEFAULT_OSDIR})"
     
    -apr_modules="file_io network_io threadproc misc locks time mmap shmem i18n user"
    +apr_modules="file_io network_io threadproc misc locks time mmap shmem i18n user memory"
     
     dnl Checks for programs.
     AC_PROG_MAKE_SET
    diff --git a/test/Makefile.in b/test/Makefile.in
    index d19f6c3b8a4..31ac59f5e32 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -21,6 +21,7 @@ PROGRAMS = \
             testipsub@EXEEXT@ \
             testmd5@EXEEXT@ \
             testpoll@EXEEXT@ \
    +        testmem@EXEEXT@ \
     	occhild@EXEEXT@
     
     TARGETS = $(PROGRAMS)
    
    From 52e9acd2180e723dfd65c3988d661e0c9f08bec2 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 13 May 2001 14:40:57 +0000
    Subject: [PATCH 1636/7878] This should have been updated already, but I must
     have missed it. Too many commits... :)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61627 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/test_apr.h | 10 +++-------
     1 file changed, 3 insertions(+), 7 deletions(-)
    
    diff --git a/test/test_apr.h b/test/test_apr.h
    index 478aa72cab7..4fe966ff2da 100644
    --- a/test/test_apr.h
    +++ b/test/test_apr.h
    @@ -54,11 +54,6 @@
     
     /* Some simple functions to make the test apps easier to write and
      * a bit more consistent...
    - *
    - * These still need more work...
    - *
    - * It'd be nice to get proper error reporting in here...
    - *
      */
      
     #include 
    @@ -85,5 +80,6 @@
     	    printf("%s\n", good); \
     	}
     
    -#define STD_TEST(str, func) \
    -	TEST_NEQ(str, func, APR_SUCCESS, "OK", "Failed");
    \ No newline at end of file
    +#define STD_TEST_NEQ(str, func) \
    +	TEST_NEQ(str, func, APR_SUCCESS, "OK", "Failed");
    +
    
    From 52fd5b3d3b594060a06e0affc0b2c16248603b15 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 13 May 2001 14:43:49 +0000
    Subject: [PATCH 1637/7878] This should get the memory code building again and
     also added a patch from Sander Striker that gets apr_sms_destroy returning an
     apr_status_t correctly.
    
    Submitted by:	Sander Striker 
    Reviewed by:	David Reid 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61628 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_memory_system.h              |  2 +-
     memory/unix/apr_memory_system.c          | 11 ++++-------
     memory/unix/apr_tracking_memory_system.c | 18 ++++++++++++++----
     3 files changed, 19 insertions(+), 12 deletions(-)
    
    diff --git a/include/apr_memory_system.h b/include/apr_memory_system.h
    index 46f6b7c4601..d34ecc16b68 100644
    --- a/include/apr_memory_system.h
    +++ b/include/apr_memory_system.h
    @@ -98,7 +98,7 @@ struct apr_sms_t
       apr_status_t (*free_fn)(apr_sms_t *mem_sys, void *memory);
       apr_status_t (*reset_fn)(apr_sms_t *mem_sys);
       void (*pre_destroy_fn)(apr_sms_t *mem_sys);
    -  void (*destroy_fn)(apr_sms_t *mem_sys);
    +  apr_status_t (*destroy_fn)(apr_sms_t *mem_sys);
       void (*threadsafe_lock_fn)(apr_sms_t *mem_sys);
       void (*threadsafe_unlock_fn)(apr_sms_t *mem_sys);
     };
    diff --git a/memory/unix/apr_memory_system.c b/memory/unix/apr_memory_system.c
    index 00b607956f0..820a68c181d 100644
    --- a/memory/unix/apr_memory_system.c
    +++ b/memory/unix/apr_memory_system.c
    @@ -169,9 +169,6 @@ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys,
     
     static int apr_sms_is_tracking(apr_sms_t *mem_sys)
     {
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys->reset_fn);
    -#endif
         /*
          * The presense of a reset function gives us the clue that this is a 
          * tracking memory system.
    @@ -328,7 +325,7 @@ APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys)
         if (!mem_sys)
             return APR_EMEMSYS;
         if (!mem_sys->reset_fn)
    -        return APR_EMEMALLOCATOR;
    +        return APR_EINVAL; /* Not sure if this is right... */
     
         /* 
          * Run the cleanups of all child memory systems _including_
    @@ -467,15 +464,15 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
     
       /* 1 - If we have a self destruct, use it */
       if (mem_sys->destroy_fn != NULL)
    -      mem_sys->destroy_fn(mem_sys);
    +      return mem_sys->destroy_fn(mem_sys);
     
       /* 2 - If we don't have a parent, free using ourselves */
       else if (mem_sys->parent_mem_sys == NULL)
    -      mem_sys->free_fn(mem_sys, mem_sys);
    +      return mem_sys->free_fn(mem_sys, mem_sys);
     
       /* 3 - If we do have a parent and it has a free function, use it */
       else if (mem_sys->parent_mem_sys->free_fn != NULL)
    -      apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
    +      return apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
     
       /* 4 - Assume we are the child of a tracking memory system, and do nothing */
     #ifdef APR_ASSERT_MEMORY
    diff --git a/memory/unix/apr_tracking_memory_system.c b/memory/unix/apr_tracking_memory_system.c
    index afb3690846d..2beda942ead 100644
    --- a/memory/unix/apr_tracking_memory_system.c
    +++ b/memory/unix/apr_tracking_memory_system.c
    @@ -208,12 +208,22 @@ static apr_status_t apr_sms_tracking_reset(apr_sms_t *mem_sys)
         return APR_SUCCESS;
     }
     
    -static void apr_sms_tracking_destroy(apr_sms_t *mem_sys)
    +static apr_status_t apr_sms_tracking_destroy(apr_sms_t *mem_sys)
     {
    -    assert (mem_sys != NULL);
    +    apr_status_t rv;
    +    /* If this is NULL we won't blow up as it should be caught at the
    +     * next level down and then passed back to us...
    +     */
    +#ifdef APR_ASSERT_MEMORY
    +    assert (mem_sys->parent_mem_sys != NULL);
    +#endif
    +    
    +    if (!mem_sys)
    +        return APR_EMEMSYS;
     
    -    apr_sms_tracking_reset(mem_sys);
    -    apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
    +    if ((rv = apr_sms_tracking_reset(mem_sys)) != APR_SUCCESS)
    +        return rv;
    +    return apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
     }
     
     APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys, 
    
    From 2533f6743dfb564d6bc3cde0dfbcbd4b8b378ed1 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sun, 13 May 2001 15:34:17 +0000
    Subject: [PATCH 1638/7878] fix some bad parms to printf/fprintf
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61629 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/test_apr.h | 4 ++--
     test/testmd5.c  | 2 +-
     test/testproc.c | 2 +-
     3 files changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/test/test_apr.h b/test/test_apr.h
    index 4fe966ff2da..942d4d8fa60 100644
    --- a/test/test_apr.h
    +++ b/test/test_apr.h
    @@ -63,7 +63,7 @@
     	{ apr_status_t rv; \
     	    if ((rv = func) == value){ \
     	        printf("%s\n", bad); \
    -            printf("Error was %ld : %s\n", rv, strerror(rv)); \
    +            printf("Error was %d : %s\n", rv, strerror(rv)); \
     	        exit(-1); \
     	    } \
     	    printf("%s\n", good); \
    @@ -74,7 +74,7 @@
     	{ apr_status_t rv; \
     	    if ((rv = func) != value){ \
     	        printf("%s\n", bad); \
    -            printf("Error was %ld : %s\n", rv, strerror(rv)); \
    +            printf("Error was %d : %s\n", rv, strerror(rv)); \
     	        exit(-1); \
     	    } \
     	    printf("%s\n", good); \
    diff --git a/test/testmd5.c b/test/testmd5.c
    index 91ab7dc87dc..1bde53ce73d 100644
    --- a/test/testmd5.c
    +++ b/test/testmd5.c
    @@ -106,7 +106,7 @@ static void try(const void *buf, size_t bufLen, apr_xlate_t *xlate,
         if (xlate) {
     #if APR_HAS_XLATE
             if ((rv = apr_md5_set_xlate(&context, xlate)) != APR_SUCCESS){
    -            fprintf("Couldn't set the MD5 translation handle!\n");
    +            fprintf(stderr, "Couldn't set the MD5 translation handle!\n");
                 exit(-1);
             }
     #else
    diff --git a/test/testproc.c b/test/testproc.c
    index ec62ca9e2eb..f27e88297b0 100644
    --- a/test/testproc.c
    +++ b/test/testproc.c
    @@ -140,7 +140,7 @@ int main(int argc, char *argv[])
             if (!strcmp(buf, teststr))
                 printf("OK\n");
             else {
    -            printf( "Uh-Oh\n", buf);
    +            printf( "Uh-Oh\n");
                 printf("  (I actually got %s_\n", buf);
             }
         }
    
    From fa6e60b0979c75da4f3f482f424c869005c1039c Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 13 May 2001 17:55:43 +0000
    Subject: [PATCH 1639/7878] Some changes that Jeff suggested.  basically when
     we get an error we print the details on stderr, but otherwise we use stdout
     for messages.  This also changes the code to use apr_strerror which should be
     more portable and APR friendly :)
    
    Submitted by:	Jeff Trawick
    Reviewed by:	David Reid
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61630 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/test_apr.h | 44 +++++++++++++++++++++++++-------------------
     1 file changed, 25 insertions(+), 19 deletions(-)
    
    diff --git a/test/test_apr.h b/test/test_apr.h
    index 942d4d8fa60..669293dd1c2 100644
    --- a/test/test_apr.h
    +++ b/test/test_apr.h
    @@ -56,29 +56,35 @@
      * a bit more consistent...
      */
      
    -#include 
    +#include "apr_strings.h"
     
     #define TEST_EQ(str, func, value, good, bad) \
    -	printf("%-60s", str); \
    -	{ apr_status_t rv; \
    -	    if ((rv = func) == value){ \
    -	        printf("%s\n", bad); \
    -            printf("Error was %d : %s\n", rv, strerror(rv)); \
    -	        exit(-1); \
    -	    } \
    -	    printf("%s\n", good); \
    -	}
    +    printf("%-60s", str); \
    +    { \
    +    apr_status_t rv; \
    +    if ((rv = func) == value){ \
    +        char errmsg[200]; \
    +        printf("%s\n", bad); \
    +        fprintf(stderr, "Error was %d : %s\n", rv, \
    +                apr_strerror(rv, (char*)&errmsg, 200)); \
    +        exit(-1); \
    +    } \
    +    printf("%s\n", good); \
    +    }
     
     #define TEST_NEQ(str, func, value, good, bad) \
    -	printf("%-60s", str); \
    -	{ apr_status_t rv; \
    -	    if ((rv = func) != value){ \
    -	        printf("%s\n", bad); \
    -            printf("Error was %d : %s\n", rv, strerror(rv)); \
    -	        exit(-1); \
    -	    } \
    -	    printf("%s\n", good); \
    -	}
    +printf("%-60s", str); \
    +    { \
    +    apr_status_t rv; \
    +    if ((rv = func) != value){ \
    +        char errmsg[200]; \
    +        printf("%s\n", bad); \
    +        fprintf(stderr, "Error was %d : %s\n", rv, \
    +                apr_strerror(rv, (char*)&errmsg, 200)); \
    +        exit(-1); \
    +    } \
    +    printf("%s\n", good); \
    +    }
     
     #define STD_TEST_NEQ(str, func) \
     	TEST_NEQ(str, func, APR_SUCCESS, "OK", "Failed");
    
    From d97569f39f8167e2434f12f4f010893b1a91355e Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 14 May 2001 11:52:25 +0000
    Subject: [PATCH 1640/7878] Update the testmd5 program to use the test_apr
     functions to do the reporting and some small adjustments to what we report on
     stderr and stdout.  Essentially we should only be using stderr for
     critical/fatal errors, everything else should go to stdout.  This makes it
     easier for regression test suites to find the errors.
    
    Submitted by:    David Reid
    Reviewed by:	 Jeff Trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61631 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testmd5.c | 62 ++++++++++++++++----------------------------------
     1 file changed, 20 insertions(+), 42 deletions(-)
    
    diff --git a/test/testmd5.c b/test/testmd5.c
    index 1bde53ce73d..1806803401c 100644
    --- a/test/testmd5.c
    +++ b/test/testmd5.c
    @@ -59,6 +59,9 @@
     #include "apr_md5.h"
     #include "apr_xlate.h"
     #include "apr_general.h"
    +#include "test_apr.h"
    +
    +int cur; 
     
     struct testcase {
         const char *s;
    @@ -96,45 +99,33 @@ static void try(const void *buf, size_t bufLen, apr_xlate_t *xlate,
         apr_md5_ctx_t context;
         unsigned char hash[MD5_DIGESTSIZE];
         
    -    printf("Trying a translation...\n");
    +    printf("Trying translation %d\n", cur + 1);
     
    -    if ((rv = apr_md5_init(&context)) != APR_SUCCESS){
    -        printf("Failed to init APR's md5 routines!\n");
    -        exit(-1);
    -    }
    +    STD_TEST_NEQ("    apr_md5_init", apr_md5_init(&context))
     
         if (xlate) {
     #if APR_HAS_XLATE
    -        if ((rv = apr_md5_set_xlate(&context, xlate)) != APR_SUCCESS){
    -            fprintf(stderr, "Couldn't set the MD5 translation handle!\n");
    -            exit(-1);
    -        }
    +        STD_TEST_NEQ("    apr_md5_set_xlate", 
    +                     apr_md5_set_xlate(&context, xlate))
     #else
    -        printf("\tDidn't expect a translation handle! Not fatal.\n");
    +        printf("    Didn't expect a translation handle! Not fatal.\n");
     #endif
         }
         
    -    if ((rv = apr_md5_update(&context, buf, bufLen)) != APR_SUCCESS){
    -        printf("The call to apr_md5_update failed!\n");
    -        exit(-1);
    -    }
    -
    -    if ((rv = apr_md5_final(hash, &context)) != APR_SUCCESS){
    -        printf("The call to apr_md5_final failed!\n");
    -        exit(-1);
    -    }
    +    STD_TEST_NEQ("    apr_md5_update", apr_md5_update(&context, buf, bufLen))
    +    STD_TEST_NEQ("    apr_md5_final", apr_md5_final(hash, &context))
     
    -    printf("\t (MD5 hash : ");
    +    printf("     (MD5 hash : ");
         for (i = 0; i < MD5_DIGESTSIZE; i++) {
             printf("%02x",hash[i]);
         }
         
         printf(")\n");
     
    -    printf("\tChecking hash against expected....................");
    +    printf("%-60s", "    Checking hash against expected");
         if (memcmp(hash, digest, MD5_DIGESTSIZE)) {
    -        fprintf(stderr,
    -                "The digest is not as expected!\n");
    +        /* This is a fatal error...report on stderr */
    +        fprintf(stderr, "The digest is not as expected!\n");
     #if 'A' != 0x41
             fprintf(stderr,
                     "Maybe you didn't tell me what character sets "
    @@ -152,7 +143,6 @@ int main(int argc, char **argv)
         apr_xlate_t *xlate = NULL;
         apr_pool_t *pool;
         const char *src = NULL, *dst = NULL;
    -    int cur;
     
         switch(argc) {
         case 1:
    @@ -173,28 +163,16 @@ int main(int argc, char **argv)
         atexit(closeapr);
     
         printf("APR MD5 Test\n============\n\n");
    -    printf("Creating pool.............................................");
    -    if ((rv = apr_pool_create(&pool, NULL)) != APR_SUCCESS){
    -        printf("Failed.\n");
    -        exit(-1);
    -    }
    -    printf("OK\n");
    -
    +    STD_TEST_NEQ("Creating pool", apr_pool_create(&pool, NULL))
     
         if (src) {
     #if APR_HAS_XLATE
    -        rv = apr_xlate_open(&xlate, dst, src, pool);
    -        if (rv) {
    -            char buf[80];
    -
    -            fprintf(stderr, "apr_xlate_open()->%s (%d)\n",
    -                    apr_strerror(rv, buf, sizeof(buf)), rv);
    -            exit(1);
    -        }
    +        STD_TEST_NEQ("Opening xlate functions", 
    +                     apr_xlate_open(&xlate, dst, src, pool))
     #else
    -        fprintf(stderr,
    -                "APR doesn't implement translation for this "
    -                "configuration.\n");
    +        /* This isn't a fatal error, so just report it... */
    +        printf("APR doesn't implement translation for this "
    +               "configuration.\n");
     #endif
         }
     
    
    From 00229b2d9b44549e0ceb79f61fac6d8d94091890 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 14 May 2001 12:57:06 +0000
    Subject: [PATCH 1641/7878] Change testfile.c to start using the new functions
     in test_apr.h. I've added a couple more functions to make it more useful.
     Also change from using "context" as the apr_pool_t to "pool" :)
    
    The rest of the file needs to be done at some point.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61632 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/test_apr.h |  20 +++-
     test/testfile.c | 282 +++++++++++++++++-------------------------------
     2 files changed, 115 insertions(+), 187 deletions(-)
    
    diff --git a/test/test_apr.h b/test/test_apr.h
    index 669293dd1c2..744dd5d3b5a 100644
    --- a/test/test_apr.h
    +++ b/test/test_apr.h
    @@ -55,7 +55,13 @@
     /* Some simple functions to make the test apps easier to write and
      * a bit more consistent...
      */
    - 
    +
    +/* Things to bear in mind when using these...
    + *
    + * If you include '\t' within the string passed in it won't be included
    + * in the spacing, so use spaces instead :)
    + * 
    + */ 
     #include "apr_strings.h"
     
     #define TEST_EQ(str, func, value, good, bad) \
    @@ -89,3 +95,15 @@ printf("%-60s", str); \
     #define STD_TEST_NEQ(str, func) \
     	TEST_NEQ(str, func, APR_SUCCESS, "OK", "Failed");
     
    +#define PRINT_ERROR(rv) \
    +    { \
    +        char errmsg[200]; \
    +        fprintf(stderr, "Error was %d : %s\n", rv, \
    +                apr_strerror(rv, (char*)&errmsg, 200)); \
    +        exit(-1); \
    +    }
    +
    +#define MSG_AND_EXIT(msg) \
    +    printf("%s\n", msg); \
    +    exit (-1);
    +    
    \ No newline at end of file
    diff --git a/test/testfile.c b/test/testfile.c
    index 9985dd06e40..ec9d9beaf58 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -62,9 +62,7 @@
     #include "apr_errno.h"
     #include "apr_general.h"
     #include "apr_lib.h"
    -#ifdef BEOS
    -#include 
    -#endif
    +#include "test_apr.h"
     
     struct view_fileinfo
     {
    @@ -98,8 +96,8 @@ static void closeapr(void)
     
     int main(void)
     {
    -    apr_pool_t *context;
    -    apr_pool_t *cont2;
    +    apr_pool_t *pool;
    +    apr_pool_t *pool2;
         apr_file_t *thefile = NULL;
         apr_finfo_t finfo;
         apr_socket_t *testsock = NULL;
    @@ -119,250 +117,162 @@ int main(void)
         apr_int32_t num;
     #endif
     
    -    if (apr_initialize() != APR_SUCCESS) {
    -        fprintf(stderr, "Couldn't initialize.");
    -        exit(-1);
    -    }
    +    printf("APR File Functions Test\n=======================\n\n");
    +    
    +    STD_TEST_NEQ("Initializing APR", apr_initialize())
         atexit(closeapr);
    -    if (apr_pool_create(&context, NULL) != APR_SUCCESS) {
    -        fprintf(stderr, "Couldn't allocate context.");
    -        exit(-1);
    -    }
    -    if (apr_pool_create(&cont2, context) != APR_SUCCESS) {
    -        fprintf(stderr, "Couldn't allocate context.");
    -        exit(-1);
    -    }
    +    STD_TEST_NEQ("Creating the main pool we'll use", 
    +                 apr_pool_create(&pool, NULL))
    +    STD_TEST_NEQ("Creating the second pool we'll use", 
    +                 apr_pool_create(&pool, NULL))
    +    
     
         fprintf(stdout, "Testing file functions.\n");
     
    -    fprintf(stdout, "\tOpening file.......");
    -    status = apr_file_open(&thefile, filename, flag, APR_UREAD | APR_UWRITE | APR_GREAD, context);
    -    if (status != APR_SUCCESS) {
    -        fprintf(stderr, "Didn't open file: %d/%s\n", status, 
    -                apr_strerror(status, errmsg, sizeof errmsg));
    -        exit(-1);
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    -    }
    +    STD_TEST_NEQ("    Opening file", 
    +                 apr_file_open(&thefile, filename, flag, 
    +                               APR_UREAD | APR_UWRITE | APR_GREAD, pool))
         
    -    fprintf(stdout, "\tChecking file.......");
    -    if (thefile == NULL) {
    -        fprintf(stderr, "Bad file des\n");
    -        exit(-1);
    +    printf("%-60s", "    Checking filename");
    +    if (thefile == NULL){
    +        MSG_AND_EXIT("\nBad file descriptor")
         }
         apr_file_name_get(&str, thefile);
    -    if (strcmp(str, filename) != 0) {
    -        fprintf(stderr, "wrong filename\n");
    -        exit(-1);
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    +    printf("%s\n", str);
    +    if (strcmp(str, filename) != 0){
    +        MSG_AND_EXIT("Wrong filename\n")
         }
    -
    -    fprintf(stdout, "\tWriting to file.......");
    +    
    +    printf("%-60s", "    Writing to file");
         
         nbytes = strlen("this is a test");
         status = apr_file_write(thefile, "this is a test", &nbytes);
         if (status != APR_SUCCESS) {
    -        fprintf(stderr, "something's wrong; apr_file_write->%d/%s\n",
    -                status, apr_strerror(status, errmsg, sizeof errmsg));
    -        exit(-1);
    +        printf("Failed\n");
    +        PRINT_ERROR(status);
         }
         if (nbytes != strlen("this is a test")) {
    -        fprintf(stderr, "didn't write properly.\n");
    -        exit(-1);
    +        printf("Failed\n");
    +        MSG_AND_EXIT("Failed to write correctly.");
         }
         else {
    -        fprintf(stdout, "OK\n");
    +        printf("OK\n");
         }
     
    -    fprintf(stdout, "\tMoving to start of file.......");
         zer = 0;
    -    status = apr_file_seek(thefile, SEEK_SET, &zer);
    -    if (status != APR_SUCCESS) {
    -        fprintf(stderr, "couldn't seek to beginning of file: %d/%s",
    -                status, apr_strerror(status, errmsg, sizeof errmsg));
    -        exit(-1);
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    -    }
    -
    +    STD_TEST_NEQ("    Moving to the start of file", 
    +                 apr_file_seek(thefile, SEEK_SET, &zer))
    +                 
     #if APR_FILES_AS_SOCKETS
    -    fprintf(stdout, "\tThis platform supports files_like_sockets\n");
    -    fprintf(stdout, "\t\tMaking file look like a socket.......");
    -    status = apr_socket_from_file(&testsock, thefile);
    -    if (status != APR_SUCCESS) {
    -        fprintf(stderr, "apr_socket_from_file()->%d/%s\n",
    -                status, apr_strerror(status, errmsg, sizeof errmsg));
    -        exit(-1);
    -    }
    -    fprintf(stdout, "OK\n");
    +    printf("    This platform supports files_like_sockets, testing...\n");
    +    STD_TEST_NEQ("        Making file look like a socket",
    +                 apr_socket_from_file(&testsock, thefile))
     
    -    fprintf(stdout, "\t\tChecking for incoming data.......");
    -    apr_poll_setup(&sdset, 1, context);
    +    apr_poll_setup(&sdset, 1, pool);
         apr_poll_socket_add(sdset, testsock, APR_POLLIN);
         num = 1;
    -    if (apr_poll(sdset, &num, -1) != APR_SUCCESS) {
    -        fprintf(stderr, "Select caused an error\n");
    -        exit(-1);
    +    STD_TEST_NEQ("        Checking for incoming data",
    +                 apr_poll(sdset, &num, -1))
    +    if (num == 0) {
    +        MSG_AND_EXIT("I should not return until num == 1\n")
         }
    -    else if (num == 0) {
    -        fprintf(stderr, "I should not return until num == 1\n");
    -        exit(-1);
    -    }
    -    fprintf(stdout, "OK\n");
    +    printf("    End of files as sockets test.\n");
     #endif
     
    -    fprintf(stdout, "\tReading from the file.......");
         nbytes = strlen("this is a test");
    -    buf = (char *)apr_palloc(context, nbytes + 1);
    -    status = apr_file_read(thefile, buf, &nbytes);
    -    if (status != APR_SUCCESS) {
    -        fprintf(stderr, "apr_file_read()->%d/%s\n",
    -                status, apr_strerror(status, errmsg, sizeof errmsg));
    -        exit(-1);
    -    }
    +    buf = (char *)apr_palloc(pool, nbytes + 1);
    +    STD_TEST_NEQ("    Reading from the file",
    +                 apr_file_read(thefile, buf, &nbytes))
         if (nbytes != strlen("this is a test")) {
    -        fprintf(stderr, "didn't read properly.\n");
    -        exit(-1);
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    -    }
    -
    -    fprintf(stdout, "\tAdding user data to the file.......");
    -    status = apr_file_data_set(thefile, "This is a test", "test", apr_pool_cleanup_null);
    -    if (status  != APR_SUCCESS) {
    -        fprintf(stderr, "Couldn't add the data\n");
    -        exit(-1); 
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    +        MSG_AND_EXIT("We didn't read properly.\n");
         }
    +    
    +    STD_TEST_NEQ("    Adding user data to the file",
    +                 apr_file_data_set(thefile, "This is a test",
    +                                   "test", apr_pool_cleanup_null))
     
    -    fprintf(stdout, "\tGetting user data from the file.......");
    -    status = apr_file_data_get((void **)&teststr, "test", thefile);
    -    if (status  != APR_SUCCESS || strcmp(teststr, "This is a test")) {
    -        fprintf(stderr, "Couldn't get the data\n");
    -        exit(-1); 
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    +    STD_TEST_NEQ("    Getting user data from the file",
    +                 apr_file_data_get((void **)&teststr, "test", thefile))
    +                 
    +    if (strcmp(teststr, "This is a test")) {
    +        MSG_AND_EXIT("Got the data, but it was wrong");
         }
     
    -    fprintf(stdout, "\tGetting fileinfo.......");
    +    printf("%-60s", "    Getting fileinfo");
         status = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile);
         if (status  == APR_INCOMPLETE) {
     	int i;
    -        fprintf(stdout, "INCOMPLETE\n");
    +        printf("INCOMPLETE\n");
             for (i = 0; vfi[i].bits; ++i)
                 if (vfi[i].bits & ~finfo.valid)
    -                fprintf(stdout, "\t    Missing %s\n", vfi[i].description);
    +                fprintf(stderr, "\t    Missing %s\n", vfi[i].description);
         }
    -    else if (status  != APR_SUCCESS) {
    -        fprintf(stderr, "Couldn't get the fileinfo\n");
    -        exit(-1); 
    +    else if (status != APR_SUCCESS) {
    +        printf("OK\n");
    +        MSG_AND_EXIT("Couldn't get the fileinfo")
         }
         else {
    -        fprintf(stdout, "OK\n");
    +        printf("OK\n");
         }
         gid = finfo.group;
         uid = finfo.user;
     
    -    fprintf(stdout, "\tClosing File.......");
    -    status = apr_file_close(thefile);
    -    if (status  != APR_SUCCESS) {
    -        fprintf(stderr, "Couldn't close the file\n");
    -        exit(-1); 
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    -    }
    +    STD_TEST_NEQ("    Closing the file", apr_file_close(thefile))
     
    -    fprintf(stdout, "\tStat'ing file.......");
    -    status = apr_stat(&finfo, filename, APR_FINFO_NORM, context);
    +    printf("%-60s", "    Stat'ing file");
    +    status = apr_stat(&finfo, filename, APR_FINFO_NORM, pool);
         if (status  == APR_INCOMPLETE) {
     	int i;
    -        fprintf(stdout, "INCOMPLETE\n");
    +        printf("INCOMPLETE\n");
             for (i = 0; vfi[i].bits; ++i)
                 if (vfi[i].bits & ~finfo.valid)
    -                fprintf(stdout, "\t    Missing %s\n", vfi[i].description);
    +                fprintf(stderr, "\t    Missing %s\n", vfi[i].description);
         }
         else if (status  != APR_SUCCESS) {
    -        fprintf(stderr, "Couldn't stat the file\n");
    -        exit(-1); 
    +        printf("Failed\n");
    +        MSG_AND_EXIT("Couldn't stat the file")
         }
         else {
    -        fprintf(stdout, "OK\n");
    +        printf("OK\n");
         }    
     
         if (finfo.valid & APR_FINFO_GROUP) {
    -        fprintf(stdout, "\tComparing group ids.......");
    -        status = apr_get_groupname(&buf, finfo.group, context);
    -        if (status  != APR_SUCCESS) {
    -            fprintf(stderr, "Couldn't retrieve the group name\n");
    -            exit(-1); 
    -        }
    -        status = apr_compare_groups(finfo.group, gid);
    -        if (status  != APR_SUCCESS) {
    -            fprintf(stderr, "gid's for %s don't match\n", buf);
    -            exit(-1); 
    -        }
    -        fprintf(stdout, "gid's for %s match\n", buf);
    +        STD_TEST_NEQ("    Getting groupname", 
    +                     apr_get_groupname(&buf, finfo.group, pool))
    +        STD_TEST_NEQ("    Comparing group ID's",
    +                     apr_compare_groups(finfo.group, gid))
    +        printf("     (gid's for %s match)\n", buf);
         }
     
         if (finfo.valid & APR_FINFO_USER) {
    -        fprintf(stdout, "\tComparing user ids.......");
    -        status = apr_get_username(&buf, finfo.user, context);
    -        if (status  != APR_SUCCESS) {
    -            fprintf(stderr, "Couldn't retrieve the user name\n");
    -            exit(-1); 
    -        }
    -        status = apr_compare_users(finfo.user, uid);
    -        if (status  != APR_SUCCESS) {
    -            fprintf(stderr, "uid's for %s don't match\n", buf);
    -            exit(-1); 
    -        }
    -        fprintf(stdout, "uid's for %s match\n", buf);
    +        STD_TEST_NEQ("    Getting username", 
    +                     apr_get_username(&buf, finfo.user, pool))
    +        STD_TEST_NEQ("    Comparing users",
    +                     apr_compare_users(finfo.user, uid))
    +        printf("     (uid's for %s match)\n", buf);
         }
     
    -    fprintf(stdout, "\tDeleting file.......");
    -    status = apr_file_remove(filename, context);
    -    if (status  != APR_SUCCESS) {
    -        fprintf(stderr, "Couldn't delete the file\n");
    -        exit(-1); 
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    -    }
    -    
    -    fprintf(stdout, "\tMaking sure it's gone.......");
    -    status = apr_file_open(&thefile, filename, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context);
    -    if (status == APR_SUCCESS) {
    -        fprintf(stderr, "I could open the file for some reason?\n");
    -        exit(-1);
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    -    }
    +    STD_TEST_NEQ("    Deleting the file", apr_file_remove(filename, pool))
    +    TEST_EQ("    Making sure it's gone",
    +           apr_file_open(&thefile, filename, APR_READ, 
    +                         APR_UREAD | APR_UWRITE | APR_GREAD, pool),
    +           APR_SUCCESS, "OK", "Failed")
     
    -    testdirs(context); 
    -    test_filedel(context);
    -    test_read(context);
    +    testdirs(pool); 
    +    test_filedel(pool);
    +    test_read(pool);
     
    -    apr_pool_destroy(context);
    +    apr_pool_destroy(pool);
         return 1;
     }
     
    -int test_filedel(apr_pool_t *context)
    +int test_filedel(apr_pool_t *pool)
     {
         apr_file_t *thefile = NULL;
         apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE;
         apr_status_t stat;
       
    -    stat = apr_file_open(&thefile, "testdel", flag, APR_UREAD | APR_UWRITE | APR_GREAD, context);
    +    stat = apr_file_open(&thefile, "testdel", flag, APR_UREAD | APR_UWRITE | APR_GREAD, pool);
         if (stat != APR_SUCCESS) {
              return stat;
         }
    @@ -371,11 +281,11 @@ int test_filedel(apr_pool_t *context)
             return stat;
         }
     
    -    if ((stat = apr_file_remove("testdel", context))  != APR_SUCCESS) {
    +    if ((stat = apr_file_remove("testdel", pool))  != APR_SUCCESS) {
             return stat;
         }
     
    -    stat = apr_file_open(&thefile, "testdel", APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context);
    +    stat = apr_file_open(&thefile, "testdel", APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, pool);
         if (stat == APR_SUCCESS) {
             return stat;
         }
    @@ -383,7 +293,7 @@ int test_filedel(apr_pool_t *context)
         return APR_SUCCESS;
     }
     
    -int testdirs(apr_pool_t *context)
    +int testdirs(apr_pool_t *pool)
     {
         apr_dir_t *temp;  
         apr_file_t *file = NULL;
    @@ -393,7 +303,7 @@ int testdirs(apr_pool_t *context)
         fprintf(stdout, "Testing Directory functions.\n");
     
         fprintf(stdout, "\tMakeing Directory.......");
    -    if (apr_dir_make("testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE | APR_GREAD | APR_GWRITE | APR_GEXECUTE | APR_WREAD | APR_WWRITE | APR_WEXECUTE, context)  != APR_SUCCESS) {
    +    if (apr_dir_make("testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE | APR_GREAD | APR_GWRITE | APR_GEXECUTE | APR_WREAD | APR_WWRITE | APR_WEXECUTE, pool)  != APR_SUCCESS) {
             fprintf(stderr, "Could not create directory\n");
             return -1;
         }
    @@ -401,7 +311,7 @@ int testdirs(apr_pool_t *context)
             fprintf(stdout, "OK\n");
         }
     
    -    if (apr_file_open(&file, "testdir/testfile", APR_READ | APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) {;
    +    if (apr_file_open(&file, "testdir/testfile", APR_READ | APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_UEXECUTE, pool) != APR_SUCCESS) {;
             return -1;
         }
     
    @@ -410,7 +320,7 @@ int testdirs(apr_pool_t *context)
     	apr_file_close(file);
     
         fprintf(stdout, "\tOpening Directory.......");
    -    if (apr_dir_open(&temp, "testdir", context) != APR_SUCCESS) {
    +    if (apr_dir_open(&temp, "testdir", pool) != APR_SUCCESS) {
             fprintf(stderr, "Could not open directory\n");
             return -1;
         }
    @@ -474,7 +384,7 @@ int testdirs(apr_pool_t *context)
         }
     
         fprintf(stdout, "\tRemoving file from directory.......");
    -    if (apr_file_remove("testdir/testfile", context)  != APR_SUCCESS) {
    +    if (apr_file_remove("testdir/testfile", pool)  != APR_SUCCESS) {
             fprintf(stderr, "Could not remove file\n");
             return -1;
         }
    @@ -483,7 +393,7 @@ int testdirs(apr_pool_t *context)
         }
     
         fprintf(stdout, "\tRemoving Directory.......");
    -    if (apr_dir_remove("testdir", context)  != APR_SUCCESS) {
    +    if (apr_dir_remove("testdir", pool)  != APR_SUCCESS) {
             fprintf(stderr, "Could not remove directory\n");
             return -1;
         }
    
    From bba1d462ca72f099a0e6d94f744232407b9343e8 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 14 May 2001 15:12:35 +0000
    Subject: [PATCH 1642/7878] get rid of some unused variables
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61633 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfile.c | 2 --
     test/testmd5.c  | 1 -
     2 files changed, 3 deletions(-)
    
    diff --git a/test/testfile.c b/test/testfile.c
    index ec9d9beaf58..497ff4663f5 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -97,7 +97,6 @@ static void closeapr(void)
     int main(void)
     {
         apr_pool_t *pool;
    -    apr_pool_t *pool2;
         apr_file_t *thefile = NULL;
         apr_finfo_t finfo;
         apr_socket_t *testsock = NULL;
    @@ -106,7 +105,6 @@ int main(void)
         apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE;
         apr_size_t nbytes = 0;
         apr_off_t zer = 0;
    -    char errmsg[120];
         char *buf;
         const char *str;
         char *filename = "test.fil";
    diff --git a/test/testmd5.c b/test/testmd5.c
    index 1806803401c..ae737269ad3 100644
    --- a/test/testmd5.c
    +++ b/test/testmd5.c
    @@ -95,7 +95,6 @@ static void try(const void *buf, size_t bufLen, apr_xlate_t *xlate,
                     const void *digest)
     {
         int i;
    -    apr_status_t rv;
         apr_md5_ctx_t context;
         unsigned char hash[MD5_DIGESTSIZE];
         
    
    From e77af91c2cf756f708351f82128ee49136b6ddd9 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 14 May 2001 19:55:30 +0000
    Subject: [PATCH 1643/7878] The remainder of the changes to testfile.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61634 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfile.c | 219 ++++++++++++++++--------------------------------
     1 file changed, 73 insertions(+), 146 deletions(-)
    
    diff --git a/test/testfile.c b/test/testfile.c
    index 497ff4663f5..44fa471521a 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -85,8 +85,8 @@ struct view_fileinfo
         {0,                NULL}
     }; 
     
    -int test_filedel(apr_pool_t *);
    -int testdirs(apr_pool_t *);
    +void test_filedel(apr_pool_t *);
    +void testdirs(apr_pool_t *);
     static void test_read(apr_pool_t *);
     
     static void closeapr(void)
    @@ -97,6 +97,7 @@ static void closeapr(void)
     int main(void)
     {
         apr_pool_t *pool;
    +    apr_pool_t *pool2;
         apr_file_t *thefile = NULL;
         apr_finfo_t finfo;
         apr_socket_t *testsock = NULL;
    @@ -105,6 +106,7 @@ int main(void)
         apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE;
         apr_size_t nbytes = 0;
         apr_off_t zer = 0;
    +    char errmsg[120];
         char *buf;
         const char *str;
         char *filename = "test.fil";
    @@ -141,21 +143,11 @@ int main(void)
             MSG_AND_EXIT("Wrong filename\n")
         }
         
    -    printf("%-60s", "    Writing to file");
    -    
         nbytes = strlen("this is a test");
    -    status = apr_file_write(thefile, "this is a test", &nbytes);
    -    if (status != APR_SUCCESS) {
    -        printf("Failed\n");
    -        PRINT_ERROR(status);
    -    }
    -    if (nbytes != strlen("this is a test")) {
    -        printf("Failed\n");
    -        MSG_AND_EXIT("Failed to write correctly.");
    -    }
    -    else {
    -        printf("OK\n");
    -    }
    +    STD_TEST_NEQ("    Writing to the file", 
    +                 apr_file_write(thefile, "this is a test", &nbytes))
    +    TEST_NEQ("    Checking we wrote everything", nbytes,
    +             strlen("this is a test"), "OK", "Failed to write everything")
     
         zer = 0;
         STD_TEST_NEQ("    Moving to the start of file", 
    @@ -181,20 +173,15 @@ int main(void)
         buf = (char *)apr_palloc(pool, nbytes + 1);
         STD_TEST_NEQ("    Reading from the file",
                      apr_file_read(thefile, buf, &nbytes))
    -    if (nbytes != strlen("this is a test")) {
    -        MSG_AND_EXIT("We didn't read properly.\n");
    -    }
    -    
    +    TEST_NEQ("    Checking what we read", nbytes, strlen("this is a test"),
    +             "OK", "We didn't read properly.\n")
         STD_TEST_NEQ("    Adding user data to the file",
                      apr_file_data_set(thefile, "This is a test",
                                        "test", apr_pool_cleanup_null))
    -
         STD_TEST_NEQ("    Getting user data from the file",
                      apr_file_data_get((void **)&teststr, "test", thefile))
    -                 
    -    if (strcmp(teststr, "This is a test")) {
    -        MSG_AND_EXIT("Got the data, but it was wrong");
    -    }
    +    TEST_NEQ("    Checking the data we got", strcmp(teststr, "This is a test"), 0,
    +             "OK", "Got the data, but it was wrong")
     
         printf("%-60s", "    Getting fileinfo");
         status = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile);
    @@ -261,37 +248,30 @@ int main(void)
         test_read(pool);
     
         apr_pool_destroy(pool);
    +
    +    printf("\nAll tests passed OK\n");
         return 1;
     }
     
    -int test_filedel(apr_pool_t *pool)
    +void test_filedel(apr_pool_t *pool)
     {
         apr_file_t *thefile = NULL;
         apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE;
    -    apr_status_t stat;
       
    -    stat = apr_file_open(&thefile, "testdel", flag, APR_UREAD | APR_UWRITE | APR_GREAD, pool);
    -    if (stat != APR_SUCCESS) {
    -         return stat;
    -    }
    -
    -    if ((stat = apr_file_close(thefile))  != APR_SUCCESS) {
    -        return stat;
    -    }
    -
    -    if ((stat = apr_file_remove("testdel", pool))  != APR_SUCCESS) {
    -        return stat;
    -    }
    -
    -    stat = apr_file_open(&thefile, "testdel", APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, pool);
    -    if (stat == APR_SUCCESS) {
    -        return stat;
    -    }
    -  
    -    return APR_SUCCESS;
    +    STD_TEST_NEQ("    Creating the file",
    +                 apr_file_open(&thefile, "testdel", flag, 
    +                               APR_UREAD | APR_UWRITE | APR_GREAD, pool))
    +    STD_TEST_NEQ("    Closing the file",
    +                 apr_file_close(thefile))
    +    STD_TEST_NEQ("    Removing the file", apr_file_remove("testdel", pool))
    +    TEST_EQ("    Checking it's gone",
    +            apr_file_open(&thefile, "testdel", APR_READ, 
    +                          APR_UREAD | APR_UWRITE | APR_GREAD, pool),
    +            APR_SUCCESS,
    +            "OK", "Failed")
     }
     
    -int testdirs(apr_pool_t *pool)
    +void testdirs(apr_pool_t *pool)
     {
         apr_dir_t *temp;  
         apr_file_t *file = NULL;
    @@ -300,43 +280,26 @@ int testdirs(apr_pool_t *pool)
     
         fprintf(stdout, "Testing Directory functions.\n");
     
    -    fprintf(stdout, "\tMakeing Directory.......");
    -    if (apr_dir_make("testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE | APR_GREAD | APR_GWRITE | APR_GEXECUTE | APR_WREAD | APR_WWRITE | APR_WEXECUTE, pool)  != APR_SUCCESS) {
    -        fprintf(stderr, "Could not create directory\n");
    -        return -1;
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    -    }
    +    STD_TEST_NEQ("    Making directory",
    +                 apr_dir_make("testdir", 
    +                               APR_UREAD | APR_UWRITE | APR_UEXECUTE |
    +                               APR_GREAD | APR_GWRITE | APR_GEXECUTE | 
    +                               APR_WREAD | APR_WWRITE | APR_WEXECUTE, pool))
     
    -    if (apr_file_open(&file, "testdir/testfile", APR_READ | APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_UEXECUTE, pool) != APR_SUCCESS) {;
    -        return -1;
    -    }
    +    STD_TEST_NEQ("    Creating a file in the new directory",
    +                 apr_file_open(&file, "testdir/testfile", 
    +                               APR_READ | APR_WRITE | APR_CREATE, 
    +                               APR_UREAD | APR_UWRITE | APR_UEXECUTE, pool))
     
         bytes = strlen("Another test!!!");
         apr_file_write(file, "Another test!!", &bytes); 
     	apr_file_close(file);
     
    -    fprintf(stdout, "\tOpening Directory.......");
    -    if (apr_dir_open(&temp, "testdir", pool) != APR_SUCCESS) {
    -        fprintf(stderr, "Could not open directory\n");
    -        return -1;
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    -    }
    -
    -    fprintf(stdout, "\tReading Directory.......");
    -    if ((apr_dir_read(&dirent, APR_FINFO_DIRENT, temp))  != APR_SUCCESS) {
    -        fprintf(stderr, "Could not read directory\n");
    -        return -1;
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    -    }
    -   
    -    fprintf(stdout, "\tGetting Information about the file.......\n");
    -    fprintf(stdout, "\t\tFile name.......");
    +    STD_TEST_NEQ("    Opening directory", apr_dir_open(&temp, "testdir", pool))
    +    STD_TEST_NEQ("    Reading directory", 
    +                 apr_dir_read(&dirent, APR_FINFO_DIRENT, temp))
    +       
    +    printf("    Getting Information about the file...\n");
         do {
             /* Because I want the file I created, I am skipping the "." and ".."
              * files that are here. 
    @@ -345,61 +308,22 @@ int testdirs(apr_pool_t *pool)
                                     | APR_FINFO_SIZE | APR_FINFO_MTIME, temp) 
                     != APR_SUCCESS) {
                 fprintf(stderr, "Error reading directory testdir"); 
    -            return -1;
    +            exit(-1);
             }
         } while (dirent.name[0] == '.');
    -    if (strcmp(dirent.name, "testfile")) {
    -        fprintf(stderr, "Got wrong file name %s\n", dirent.name);
    -        return -1;
    -    }
    -    fprintf(stdout, "OK\n");
    -
    -    fprintf(stdout, "\t\tFile type.......");
    -    if (dirent.filetype != APR_REG) {
    -        fprintf(stderr, "Got wrong file type\n");
    -        return -1;
    -    }
    -    fprintf(stdout, "OK\n");
    -
    -    fprintf(stdout, "\t\tFile size.......");
    -    if (dirent.size != bytes) {
    -        fprintf(stderr, "Got wrong file size %" APR_OFF_T_FMT "\n", dirent.size);
    -        return -1;
    -    }
    -    fprintf(stdout, "OK\n");
    -     
    -    fprintf(stdout, "\tRewinding directory.......");
    -    apr_dir_rewind(temp); 
    -    fprintf(stdout, "OK\n");
    -    
    -    fprintf(stdout, "\tClosing Directory.......");
    -    if (apr_dir_close(temp)  != APR_SUCCESS) {
    -        fprintf(stderr, "Could not close directory\n");
    -        return -1;
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    -    }
    -
    -    fprintf(stdout, "\tRemoving file from directory.......");
    -    if (apr_file_remove("testdir/testfile", pool)  != APR_SUCCESS) {
    -        fprintf(stderr, "Could not remove file\n");
    -        return -1;
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    -    }
    -
    -    fprintf(stdout, "\tRemoving Directory.......");
    -    if (apr_dir_remove("testdir", pool)  != APR_SUCCESS) {
    -        fprintf(stderr, "Could not remove directory\n");
    -        return -1;
    -    }
    -    else {
    -        fprintf(stdout, "OK\n");
    -    }
    -    
    -    return 1; 
    +    TEST_NEQ("        File name",
    +             strcmp(dirent.name, "testfile"), 0,
    +             "OK", "Got wrong file name");
    +    TEST_NEQ("        File type", dirent.filetype, APR_REG,
    +             "OK", "Got wrong file type")
    +    TEST_NEQ("        File size", dirent.size, bytes,
    +             "OK", "Got wrong file size")
    +    printf("    Done checking file information\n");
    +    STD_TEST_NEQ("    Rewind directory", apr_dir_rewind(temp))
    +    STD_TEST_NEQ("    Closing directory", apr_dir_close(temp))
    +    STD_TEST_NEQ("    Removing file from directory",
    +                 apr_file_remove("testdir/testfile", pool))
    +    STD_TEST_NEQ("    Removing directory", apr_dir_remove("testdir", pool))
     }    
     
     #define TESTREAD_BLKSIZE 1024
    @@ -414,6 +338,7 @@ static void create_testread(apr_pool_t *p, const char *fname)
     
         /* Create a test file with known content.
          */
    +    
         rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p);
         if (rv) {
             fprintf(stderr, "apr_file_open()->%d/%s\n",
    @@ -460,7 +385,7 @@ static char read_one(apr_file_t *f, int expected)
       return bytes[1];
     }
     
    -static void test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_flags)
    +static int test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_flags)
     {
         apr_file_t *f = NULL;
         apr_status_t rv;
    @@ -473,9 +398,9 @@ static void test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_f
         read_one(f, 'a');
         read_one(f, 'b');
         if (extra_flags & APR_BUFFERED) {
    -        fprintf(stdout, 
    -                "\n\t\tskipping apr_file_ungetc() for APR_BUFFERED... "
    -                "doesn't work yet...\n\t\t\t\t ");
    +        printf("\n        skipping apr_file_ungetc() for APR_BUFFERED as it "
    +               "doesn't work yet\n");
    +        return (0);
         }
         else {
             rv = apr_file_ungetc('b', f);
    @@ -542,6 +467,7 @@ static void test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_f
         assert(rv == APR_EOF);
         rv = apr_file_close(f);
         assert(!rv);
    +    return (1);
     }
     
     static void test_bigread(apr_pool_t *p, const char *fname, apr_int32_t extra_flags)
    @@ -582,23 +508,24 @@ static void test_read(apr_pool_t *p)
         const char *fname = "testread.dat";
         apr_status_t rv;
     
    -    fprintf(stdout, "Testing file read functions.\n");
    +    printf("Testing file read functions.\n");
     
         create_testread(p, fname);
    -    fprintf(stdout, "\tBuffered file tests......");
    -    test_read_guts(p, fname, APR_BUFFERED);
    -    fprintf(stdout, "OK\n");
    -    fprintf(stdout, "\tUnbuffered file tests....");
    +    printf("%-60s", "    Buffered file tests");
    +    if (test_read_guts(p, fname, APR_BUFFERED))
    +        printf("OK\n");
    +    printf("%-60s", "    Unbuffered file tests");
         test_read_guts(p, fname, 0);
    -    fprintf(stdout, "OK\n");
    -    fprintf(stdout, "\tMore buffered file tests......");
    +    printf("OK\n");
    +    printf("%-60s", "    More buffered file tests");
         test_bigread(p, fname, APR_BUFFERED);
    -    fprintf(stdout, "OK\n");
    -    fprintf(stdout, "\tMore unbuffered file tests......");
    +    printf("OK\n");
    +    printf("%-60s", "    More unbuffered file tests");
         test_bigread(p, fname, 0);
    -    fprintf(stdout, "OK\n");
    +    printf("OK\n");
         rv = apr_file_remove(fname, p);
         assert(!rv);
    -    fprintf(stdout, "\tAll read tests...........OK\n");
    +    printf("%-60s", "    All read tests");
    +    printf("OK\n");
     }
     
    
    From d1959403baeacd3d2adb130385b05f7fa73170a2 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 14 May 2001 22:52:46 +0000
    Subject: [PATCH 1644/7878] get rid of some unused variables
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61635 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfile.c | 2 --
     1 file changed, 2 deletions(-)
    
    diff --git a/test/testfile.c b/test/testfile.c
    index 44fa471521a..be2c8d6da99 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -97,7 +97,6 @@ static void closeapr(void)
     int main(void)
     {
         apr_pool_t *pool;
    -    apr_pool_t *pool2;
         apr_file_t *thefile = NULL;
         apr_finfo_t finfo;
         apr_socket_t *testsock = NULL;
    @@ -106,7 +105,6 @@ int main(void)
         apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE;
         apr_size_t nbytes = 0;
         apr_off_t zer = 0;
    -    char errmsg[120];
         char *buf;
         const char *str;
         char *filename = "test.fil";
    
    From 088d9cb1cd07680af1b98cd2209dda9a0f683ddd Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 14 May 2001 22:56:13 +0000
    Subject: [PATCH 1645/7878] The renamed memory headers...
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61636 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_sms.h          | 287 +++++++++++++++++++++++++++++++++++++
     include/apr_sms_tracking.h |  94 ++++++++++++
     2 files changed, 381 insertions(+)
     create mode 100644 include/apr_sms.h
     create mode 100644 include/apr_sms_tracking.h
    
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    new file mode 100644
    index 00000000000..d34ecc16b68
    --- /dev/null
    +++ b/include/apr_sms.h
    @@ -0,0 +1,287 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +/* This code kindly donated to APR by 
    + *    Elrond  
    + *    Luke Kenneth Casson Leighton 
    + *    Sander Striker 
    + *
    + * May 2001
    + */
    + 
    +#ifndef APR_MEMORY_SYSTEM_H
    +#define APR_MEMORY_SYSTEM_H
    +
    +#include "apr.h"
    +#include "apr_errno.h"
    +
    +#ifdef __cplusplus
    +extern "C" {
    +#endif
    +
    +/**
    + * @package APR memory system
    + */
    +
    +typedef struct apr_sms_t apr_sms_t;
    +
    +struct apr_sms_cleanup;
    +
    +/**
    + * The memory system structure
    + */
    +struct apr_sms_t
    +{
    +  apr_sms_t  *parent_mem_sys;
    +  apr_sms_t  *child_mem_sys;
    +  apr_sms_t  *sibling_mem_sys;
    +  apr_sms_t **ref_mem_sys;
    +  apr_sms_t  *accounting_mem_sys;
    +
    +  struct apr_sms_cleanup *cleanups;
    +
    +  void * (*malloc_fn)(apr_sms_t *mem_sys, apr_size_t size);
    +  void * (*calloc_fn)(apr_sms_t *mem_sys, apr_size_t size);
    +  void * (*realloc_fn)(apr_sms_t *mem_sys, void *memory, 
    +                       apr_size_t size);
    +  apr_status_t (*free_fn)(apr_sms_t *mem_sys, void *memory);
    +  apr_status_t (*reset_fn)(apr_sms_t *mem_sys);
    +  void (*pre_destroy_fn)(apr_sms_t *mem_sys);
    +  apr_status_t (*destroy_fn)(apr_sms_t *mem_sys);
    +  void (*threadsafe_lock_fn)(apr_sms_t *mem_sys);
    +  void (*threadsafe_unlock_fn)(apr_sms_t *mem_sys);
    +};
    +
    +/*
    + * memory allocation functions 
    + */
    +
    +/**
    + * Allocate a block of memory using a certain memory system
    + * @param mem_sys The memory system to use
    + * @param size The (minimal required) size of the block to be allocated
    + * @return pointer to a newly allocated block of memory, NULL if insufficient
    + *         memory available
    + * @deffunc void *apr_sms_malloc(apr_sms_t *mem_sys, apr_size_t size)
    + */
    +APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *mem_sys, apr_size_t size);
    +
    +/**
    + * Allocate a block of zeroed memory using a certain memory system
    + * @param mem_sys The memory system to use
    + * @param size The (minimal required) size of the block to be allocated
    + * @return pointer to a newly allocated block of memory, NULL if insufficient
    + *         memory available
    + * @deffunc void *apr_sms_calloc(apr_sms_t *mem_sys, apr_size_t size)
    + */
    +APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *mem_sys, apr_size_t size);
    +
    +/**
    + * Change the size of a previously allocated block of memory
    + * @param mem_sys The memory system to use (should be the same as the
    + *        one that returned the block)
    + * @param mem Pointer to the previously allocated block. If NULL, this
    + *        function acts like apr_sms_malloc.
    + * @param size The (minimal required) size of the block to be allocated
    + * @return pointer to a newly allocated block of memory, NULL if insufficient
    + *         memory available
    + * @deffunc void *apr_sms_realloc(apr_sms_t *mem_sys, void *mem, apr_size_t size)
    + */
    +APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem, apr_size_t size);
    +
    +/**
    + * Free a block of memory
    + * @param mem_sys The memory system to use (should be the same as the
    + *        one that returned the block)
    + * @param mem The block of memory to be freed
    + * @deffunc void apr_sms_free(apr_sms_t *mem_sys,
    + *					void *mem)
    + */
    +APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys, void *mem);
    +
    +/*
    + * memory system functions
    + */
    +
    +/**
    + * Create a memory system (actually it initialized a memory system structure)
    + * @caution Call this function as soon as you have obtained a block of memory
    + *          to serve as a memory system structure from your 
    + *          apr_xxx_sms_create. Only use this function when you are
    + *          implementing a memory system.
    + * @param memory The memory to turn into a memory system
    + * @warning The memory passed in should be at least of size 
    + *          sizeof(apr_sms_t)
    + * @param parent_mem_sys The parent memory system
    + * @return The freshly initialized memory system
    + * @deffunc apr_sms_t *apr_sms_create(void *memory,
    + *				   apr_sms_t *parent_mem_sys)
    + */
    +APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory, apr_sms_t *parent_mem_sys);
    +
    +/**
    + * Check if a memory system is obeying all rules. 
    + * @caution Call this function as the last statement before returning a new
    + *          memory system from your apr_xxx_sms_create.
    + * @deffunc void apr_sms_validate(apr_sms_t *mem_sys)
    + */
    +#ifdef APR_MEMORY_ASSERT
    +APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys);
    +#else
    +#ifdef apr_sms_assert
    +#undef apr_sms_assert
    +#endif
    +#define apr_sms_assert(mem_sys)
    +#endif /* APR_MEMORY_ASSERT */
    +
    +/**
    + * Reset a memory system so it can be reused. 
    + * This will also run all cleanup functions associated with the memory system
    + * @warning This function will fail if there is no reset function available
    + *          for the given memory system (i.e. the memory system is non-
    + *          tracking).
    + * @param mem_sys The memory system to be reset
    + * @deffunc apr_status_t apr_sms_reset(apr_sms_t *mem_sys)
    + */
    +APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys);
    +
    +/**
    + * Destroy a memory system, effectively freeing all of its memory, and itself. 
    + * This will also run all cleanup functions associated with the memory system.
    + * @caution Be carefull when using this function with a non-tracking memory
    + *          system
    + * @param mem_sys The memory system to be destroyed
    + * @deffunc apr_status_t apr_sms_destroy(apr_sms_t *mem_sys)
    + */
    +APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys);
    +
    +/**
    + * Perform thread-safe locking required whilst this memory system is modified
    + * @param mem_sys The memory system to be locked for thread-safety
    + * @deffunc void apr_sms_threadsafe_lock(apr_sms_t *mem_sys)
    + */
    +APR_DECLARE(void) apr_sms_threadsafe_lock(apr_sms_t *mem_sys);
    +
    +/**
    + * Release thread-safe locking required whilst this memory system was
    + * being modified
    + * @param mem_sys The memory system to be released from thread-safety
    + * @deffunc void apr_sms_threadsafe_unlock(apr_sms_t *mem_sys)
    + */
    +APR_DECLARE(void) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys);
    +
    +/**
    + * Determine if memory system a is an ancestor of memory system b
    + * @param a The memory system to search
    + * @param b The memory system to search for
    + * @return APR_SUCCESS if a is an ancestor of b, 1 if it isn't
    + * @deffunc apr_status_t apr_sms_is_ancestor(apr_sms_t *a,
    + *						     apr_sms_t *b)
    + */
    +APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a, apr_sms_t *b);
    +
    +/*
    + * memory system cleanup management functions
    + */
    +
    +/**
    + * Register a function to be called when a memory system is reset or destroyed
    + * @param mem_sys The memory system to register the cleanup function with
    + * @param data The data to pass to the cleanup function
    + * @param cleanup_fn The function to call when the memory system is reset or
    + *        destroyed
    + * @deffunc void apr_sms_cleanup_register(apr_sms_t *mem_sys,
    + *		   void *data, apr_status_t (*cleanup_fn)(void *));
    + */
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys, void *data, 
    +                                                   apr_status_t (*cleanup_fn)(void *));
    +
    +/**
    + * Unregister a previously registered cleanup function
    + * @param mem_sys The memory system the cleanup function is registered
    + *        with
    + * @param data The data associated with the cleanup function
    + * @param cleanup_fn The registered cleanup function
    + * @deffunc void apr_sms_cleanup_unregister(apr_sms_t *mem_sys,
    + *		   void *data, apr_status_t (*cleanup_fn)(void *));
    + */
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys, void *data,
    +                                                     apr_status_t (*cleanup)(void *));
    +
    +/**
    + * Run the specified cleanup function immediately and unregister it
    + * @param mem_sys The memory system the cleanup function is registered
    + *        with
    + * @param data The data associated with the cleanup function
    + * @param cleanup The registered cleanup function
    + * @deffunc apr_status_t apr_sms_cleanup_run(apr_sms_t *mem_sys,
    + *			   void *data, apr_status_t (*cleanup)(void *));
    + */
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *mem_sys, void *data,
    +                                              apr_status_t (*cleanup)(void *));
    +
    +/**
    + * Create a standard malloc/realloc/free memory system
    + * @param mem_sys A pointer to the created apr_sms_t*
    + * @deffunc apr_status_t apr_sms_std_create(apr_sms_t **mem_sys);
    + */
    +APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys);
    +
    +
    +#ifdef __cplusplus
    +}
    +#endif
    +
    +#endif /* !APR_MEMORY_SYSTEM_H */
    +
    diff --git a/include/apr_sms_tracking.h b/include/apr_sms_tracking.h
    new file mode 100644
    index 00000000000..c07c8a7d6a9
    --- /dev/null
    +++ b/include/apr_sms_tracking.h
    @@ -0,0 +1,94 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +/* This code kindly donated to APR by 
    + *    Elrond  
    + *    Luke Kenneth Casson Leighton 
    + *    Sander Striker 
    + *
    + * May 2001
    + */
    +
    +#ifndef APR_TRACKING_MEMORY_SYSTEM_H
    +#define APR_TRACKING_MEMORY_SYSTEM_H
    +
    +#include "apr.h"
    +#include "apr_memory_system.h"
    +
    +#ifdef __cplusplus
    +extern "C" {
    +#endif
    +
    +/**
    + * @package APR tracking memory system
    + */
    +
    +/**
    + * Create a standard malloc/realloc/free memory system
    + * @param mem_sys A pointer to the returned apr_sms_t*
    + * @param pms The parent memory system, used to allocate the memory
    + *            that we will be tracking.
    + * @deffunc apr_status_t apr_sms_tracking_create(apr_sms_t **mem_sys,
    + *                                               apr_sms_t *pms);
    + */
    +APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys,
    +                                                  apr_sms_t *pms);
    +
    +
    +
    +#ifdef __cplusplus
    +}
    +#endif
    +
    +#endif /* !APR_TRACKING_MEMORY_SYSTEM_H */
    
    From cdd888deaaef91830f3e442c544eb43aa081bda5 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 14 May 2001 22:57:47 +0000
    Subject: [PATCH 1646/7878] apr_memory_system.h has become apr_sms.h
     apr_tracking_memory_system.h has become apr_sms_tracking.h
    
    This removes the originals.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61637 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_memory_system.h          | 287 ---------------------------
     include/apr_tracking_memory_system.h |  94 ---------
     2 files changed, 381 deletions(-)
     delete mode 100644 include/apr_memory_system.h
     delete mode 100644 include/apr_tracking_memory_system.h
    
    diff --git a/include/apr_memory_system.h b/include/apr_memory_system.h
    deleted file mode 100644
    index d34ecc16b68..00000000000
    --- a/include/apr_memory_system.h
    +++ /dev/null
    @@ -1,287 +0,0 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    - *
    - * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    - * reserved.
    - *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    - *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    - */
    -
    -/* This code kindly donated to APR by 
    - *    Elrond  
    - *    Luke Kenneth Casson Leighton 
    - *    Sander Striker 
    - *
    - * May 2001
    - */
    - 
    -#ifndef APR_MEMORY_SYSTEM_H
    -#define APR_MEMORY_SYSTEM_H
    -
    -#include "apr.h"
    -#include "apr_errno.h"
    -
    -#ifdef __cplusplus
    -extern "C" {
    -#endif
    -
    -/**
    - * @package APR memory system
    - */
    -
    -typedef struct apr_sms_t apr_sms_t;
    -
    -struct apr_sms_cleanup;
    -
    -/**
    - * The memory system structure
    - */
    -struct apr_sms_t
    -{
    -  apr_sms_t  *parent_mem_sys;
    -  apr_sms_t  *child_mem_sys;
    -  apr_sms_t  *sibling_mem_sys;
    -  apr_sms_t **ref_mem_sys;
    -  apr_sms_t  *accounting_mem_sys;
    -
    -  struct apr_sms_cleanup *cleanups;
    -
    -  void * (*malloc_fn)(apr_sms_t *mem_sys, apr_size_t size);
    -  void * (*calloc_fn)(apr_sms_t *mem_sys, apr_size_t size);
    -  void * (*realloc_fn)(apr_sms_t *mem_sys, void *memory, 
    -                       apr_size_t size);
    -  apr_status_t (*free_fn)(apr_sms_t *mem_sys, void *memory);
    -  apr_status_t (*reset_fn)(apr_sms_t *mem_sys);
    -  void (*pre_destroy_fn)(apr_sms_t *mem_sys);
    -  apr_status_t (*destroy_fn)(apr_sms_t *mem_sys);
    -  void (*threadsafe_lock_fn)(apr_sms_t *mem_sys);
    -  void (*threadsafe_unlock_fn)(apr_sms_t *mem_sys);
    -};
    -
    -/*
    - * memory allocation functions 
    - */
    -
    -/**
    - * Allocate a block of memory using a certain memory system
    - * @param mem_sys The memory system to use
    - * @param size The (minimal required) size of the block to be allocated
    - * @return pointer to a newly allocated block of memory, NULL if insufficient
    - *         memory available
    - * @deffunc void *apr_sms_malloc(apr_sms_t *mem_sys, apr_size_t size)
    - */
    -APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *mem_sys, apr_size_t size);
    -
    -/**
    - * Allocate a block of zeroed memory using a certain memory system
    - * @param mem_sys The memory system to use
    - * @param size The (minimal required) size of the block to be allocated
    - * @return pointer to a newly allocated block of memory, NULL if insufficient
    - *         memory available
    - * @deffunc void *apr_sms_calloc(apr_sms_t *mem_sys, apr_size_t size)
    - */
    -APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *mem_sys, apr_size_t size);
    -
    -/**
    - * Change the size of a previously allocated block of memory
    - * @param mem_sys The memory system to use (should be the same as the
    - *        one that returned the block)
    - * @param mem Pointer to the previously allocated block. If NULL, this
    - *        function acts like apr_sms_malloc.
    - * @param size The (minimal required) size of the block to be allocated
    - * @return pointer to a newly allocated block of memory, NULL if insufficient
    - *         memory available
    - * @deffunc void *apr_sms_realloc(apr_sms_t *mem_sys, void *mem, apr_size_t size)
    - */
    -APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem, apr_size_t size);
    -
    -/**
    - * Free a block of memory
    - * @param mem_sys The memory system to use (should be the same as the
    - *        one that returned the block)
    - * @param mem The block of memory to be freed
    - * @deffunc void apr_sms_free(apr_sms_t *mem_sys,
    - *					void *mem)
    - */
    -APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys, void *mem);
    -
    -/*
    - * memory system functions
    - */
    -
    -/**
    - * Create a memory system (actually it initialized a memory system structure)
    - * @caution Call this function as soon as you have obtained a block of memory
    - *          to serve as a memory system structure from your 
    - *          apr_xxx_sms_create. Only use this function when you are
    - *          implementing a memory system.
    - * @param memory The memory to turn into a memory system
    - * @warning The memory passed in should be at least of size 
    - *          sizeof(apr_sms_t)
    - * @param parent_mem_sys The parent memory system
    - * @return The freshly initialized memory system
    - * @deffunc apr_sms_t *apr_sms_create(void *memory,
    - *				   apr_sms_t *parent_mem_sys)
    - */
    -APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory, apr_sms_t *parent_mem_sys);
    -
    -/**
    - * Check if a memory system is obeying all rules. 
    - * @caution Call this function as the last statement before returning a new
    - *          memory system from your apr_xxx_sms_create.
    - * @deffunc void apr_sms_validate(apr_sms_t *mem_sys)
    - */
    -#ifdef APR_MEMORY_ASSERT
    -APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys);
    -#else
    -#ifdef apr_sms_assert
    -#undef apr_sms_assert
    -#endif
    -#define apr_sms_assert(mem_sys)
    -#endif /* APR_MEMORY_ASSERT */
    -
    -/**
    - * Reset a memory system so it can be reused. 
    - * This will also run all cleanup functions associated with the memory system
    - * @warning This function will fail if there is no reset function available
    - *          for the given memory system (i.e. the memory system is non-
    - *          tracking).
    - * @param mem_sys The memory system to be reset
    - * @deffunc apr_status_t apr_sms_reset(apr_sms_t *mem_sys)
    - */
    -APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys);
    -
    -/**
    - * Destroy a memory system, effectively freeing all of its memory, and itself. 
    - * This will also run all cleanup functions associated with the memory system.
    - * @caution Be carefull when using this function with a non-tracking memory
    - *          system
    - * @param mem_sys The memory system to be destroyed
    - * @deffunc apr_status_t apr_sms_destroy(apr_sms_t *mem_sys)
    - */
    -APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys);
    -
    -/**
    - * Perform thread-safe locking required whilst this memory system is modified
    - * @param mem_sys The memory system to be locked for thread-safety
    - * @deffunc void apr_sms_threadsafe_lock(apr_sms_t *mem_sys)
    - */
    -APR_DECLARE(void) apr_sms_threadsafe_lock(apr_sms_t *mem_sys);
    -
    -/**
    - * Release thread-safe locking required whilst this memory system was
    - * being modified
    - * @param mem_sys The memory system to be released from thread-safety
    - * @deffunc void apr_sms_threadsafe_unlock(apr_sms_t *mem_sys)
    - */
    -APR_DECLARE(void) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys);
    -
    -/**
    - * Determine if memory system a is an ancestor of memory system b
    - * @param a The memory system to search
    - * @param b The memory system to search for
    - * @return APR_SUCCESS if a is an ancestor of b, 1 if it isn't
    - * @deffunc apr_status_t apr_sms_is_ancestor(apr_sms_t *a,
    - *						     apr_sms_t *b)
    - */
    -APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a, apr_sms_t *b);
    -
    -/*
    - * memory system cleanup management functions
    - */
    -
    -/**
    - * Register a function to be called when a memory system is reset or destroyed
    - * @param mem_sys The memory system to register the cleanup function with
    - * @param data The data to pass to the cleanup function
    - * @param cleanup_fn The function to call when the memory system is reset or
    - *        destroyed
    - * @deffunc void apr_sms_cleanup_register(apr_sms_t *mem_sys,
    - *		   void *data, apr_status_t (*cleanup_fn)(void *));
    - */
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys, void *data, 
    -                                                   apr_status_t (*cleanup_fn)(void *));
    -
    -/**
    - * Unregister a previously registered cleanup function
    - * @param mem_sys The memory system the cleanup function is registered
    - *        with
    - * @param data The data associated with the cleanup function
    - * @param cleanup_fn The registered cleanup function
    - * @deffunc void apr_sms_cleanup_unregister(apr_sms_t *mem_sys,
    - *		   void *data, apr_status_t (*cleanup_fn)(void *));
    - */
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys, void *data,
    -                                                     apr_status_t (*cleanup)(void *));
    -
    -/**
    - * Run the specified cleanup function immediately and unregister it
    - * @param mem_sys The memory system the cleanup function is registered
    - *        with
    - * @param data The data associated with the cleanup function
    - * @param cleanup The registered cleanup function
    - * @deffunc apr_status_t apr_sms_cleanup_run(apr_sms_t *mem_sys,
    - *			   void *data, apr_status_t (*cleanup)(void *));
    - */
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *mem_sys, void *data,
    -                                              apr_status_t (*cleanup)(void *));
    -
    -/**
    - * Create a standard malloc/realloc/free memory system
    - * @param mem_sys A pointer to the created apr_sms_t*
    - * @deffunc apr_status_t apr_sms_std_create(apr_sms_t **mem_sys);
    - */
    -APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys);
    -
    -
    -#ifdef __cplusplus
    -}
    -#endif
    -
    -#endif /* !APR_MEMORY_SYSTEM_H */
    -
    diff --git a/include/apr_tracking_memory_system.h b/include/apr_tracking_memory_system.h
    deleted file mode 100644
    index c07c8a7d6a9..00000000000
    --- a/include/apr_tracking_memory_system.h
    +++ /dev/null
    @@ -1,94 +0,0 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    - *
    - * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    - * reserved.
    - *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    - *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    - */
    -
    -/* This code kindly donated to APR by 
    - *    Elrond  
    - *    Luke Kenneth Casson Leighton 
    - *    Sander Striker 
    - *
    - * May 2001
    - */
    -
    -#ifndef APR_TRACKING_MEMORY_SYSTEM_H
    -#define APR_TRACKING_MEMORY_SYSTEM_H
    -
    -#include "apr.h"
    -#include "apr_memory_system.h"
    -
    -#ifdef __cplusplus
    -extern "C" {
    -#endif
    -
    -/**
    - * @package APR tracking memory system
    - */
    -
    -/**
    - * Create a standard malloc/realloc/free memory system
    - * @param mem_sys A pointer to the returned apr_sms_t*
    - * @param pms The parent memory system, used to allocate the memory
    - *            that we will be tracking.
    - * @deffunc apr_status_t apr_sms_tracking_create(apr_sms_t **mem_sys,
    - *                                               apr_sms_t *pms);
    - */
    -APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys,
    -                                                  apr_sms_t *pms);
    -
    -
    -
    -#ifdef __cplusplus
    -}
    -#endif
    -
    -#endif /* !APR_TRACKING_MEMORY_SYSTEM_H */
    
    From 4ea1ce716ce56636df445aee827cb68f52ed22d1 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 14 May 2001 23:01:26 +0000
    Subject: [PATCH 1647/7878] Add the renamed memory files to APR.
    
    apr_sms.c used to be apr_memory_system.c
    apr_sms_std.c used to be apr_standard_memory_system.c
    apr_sms_tracking.c used to be apr_tracking_memory_system.c
    
    Alter Makefile.in to actually build the new files.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61638 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/Makefile.in        |   6 +-
     memory/unix/apr_sms.c          | 612 +++++++++++++++++++++++++++++++++
     memory/unix/apr_sms_std.c      | 132 +++++++
     memory/unix/apr_sms_tracking.c | 261 ++++++++++++++
     4 files changed, 1008 insertions(+), 3 deletions(-)
     create mode 100644 memory/unix/apr_sms.c
     create mode 100644 memory/unix/apr_sms_std.c
     create mode 100644 memory/unix/apr_sms_tracking.c
    
    diff --git a/memory/unix/Makefile.in b/memory/unix/Makefile.in
    index aa29d6e5886..4b7b12eb577 100644
    --- a/memory/unix/Makefile.in
    +++ b/memory/unix/Makefile.in
    @@ -1,7 +1,7 @@
     
    -TARGETS = apr_memory_system.lo \
    -          apr_tracking_memory_system.lo \
    -          apr_standard_memory_system.lo
    +TARGETS = apr_sms.lo \
    +          apr_sms_std.lo \
    +          apr_sms_tracking.lo
     
     # bring in rules.mk for standard functionality
     @INCLUDE_RULES@
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    new file mode 100644
    index 00000000000..820a68c181d
    --- /dev/null
    +++ b/memory/unix/apr_sms.c
    @@ -0,0 +1,612 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +/* This code kindly donated to APR by 
    + *    Elrond  
    + *    Luke Kenneth Casson Leighton 
    + *    Sander Striker 
    + *
    + * May 2001
    + */
    + 
    +#include "apr.h"
    +#include "apr_general.h"
    +#include "apr_memory_system.h"
    +#include 
    +#include 
    +
    +#include  /* strikerXXX: had to add this for windows to stop 
    +                     * complaining, please autoconf the include stuff
    +                     */
    +
    +/*
    + * private structure defenitions
    + */
    +struct apr_sms_cleanup
    +{
    +    struct apr_sms_cleanup *next;
    +    void *data;
    +    apr_status_t (*cleanup_fn)(void *);
    +};
    +
    +/* 
    + * memory allocation functions
    + */
    +
    +APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *mem_sys,
    +                                   apr_size_t size)
    +{
    +#ifdef APR_ASSERT_MEMORY
    +    assert(mem_sys);
    +    assert(mem_sys->malloc_fn);
    +#endif
    +
    +    if (!mem_sys || !mem_sys->malloc_fn)
    +        return NULL;
    +
    +    if (size == 0)
    +        return NULL;
    +
    +    return mem_sys->malloc_fn(mem_sys, size);
    +}
    +
    +APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *mem_sys,
    +                                   apr_size_t size)
    +{
    +#ifdef APR_ASSERT_MEMORY
    +    assert(mem_sys);
    +    assert(mem_sys->malloc_fn);
    +    assert(mem_sys->calloc_fn);
    +#endif
    +
    +    if (size == 0)
    +        return NULL;
    +
    +    if (mem_sys->calloc_fn == NULL){
    +        /* Assumption - if we don't have calloc we have
    +         * malloc, might be bogus...
    +         */
    +        void *mem = mem_sys->malloc_fn(mem_sys, size);
    +        memset(mem, '\0', size);
    +        return mem;
    +    } else
    +        return mem_sys->calloc_fn(mem_sys, size);
    +}
    +
    +APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem,
    +                                    apr_size_t size)
    +{
    +#ifdef APR_ASSERT_MEMORY
    +    assert(mem_sys);
    +    assert(mem_sys->realloc_fn);
    +#endif
    +   
    +    if (mem == NULL)
    +        return apr_sms_malloc(mem_sys, size);
    +
    +    if (size == 0)
    +    {
    +        apr_sms_free(mem_sys, mem);
    +        return NULL;
    +    }
    +
    +    return mem_sys->realloc_fn(mem_sys, mem, size);
    +}
    +
    +APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys,
    +                                       void *mem)
    +{
    +#ifdef APR_ASSERT_MEMORY
    +    assert(mem_sys->free_fn);
    +#endif
    +
    +    if (!mem_sys)
    +        return APR_EMEMSYS;
    +  
    +    if (mem == NULL)
    +        return APR_EINVAL;
    +
    +    if (mem_sys->free_fn != NULL)
    +        return mem_sys->free_fn(mem_sys, mem);  
    +
    +    return APR_SUCCESS;
    +}
    +
    +/*
    + * memory system functions
    + */
    +
    +static int apr_sms_is_tracking(apr_sms_t *mem_sys)
    +{
    +    /*
    +     * The presense of a reset function gives us the clue that this is a 
    +     * tracking memory system.
    +     */
    +    return mem_sys->reset_fn != NULL;
    +}
    +
    +APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory, 
    +                                        apr_sms_t *parent_mem_sys)
    +{
    +    apr_sms_t *mem_sys;
    +
    +    if (memory == NULL)
    +        return NULL;
    +
    +    /* Just typecast it, and clear it */
    +    mem_sys = (apr_sms_t *)memory;
    +    memset(mem_sys, '\0', sizeof(apr_sms_t));
    +
    +    /* Initialize the parent and accounting memory system pointers */
    +    mem_sys->parent_mem_sys = parent_mem_sys;
    +    mem_sys->accounting_mem_sys = mem_sys;
    +
    +    if (parent_mem_sys != NULL)
    +    {
    +        if ((mem_sys->sibling_mem_sys = 
    +           parent_mem_sys->child_mem_sys) != NULL)
    +        {
    +            mem_sys->sibling_mem_sys->ref_mem_sys = 
    +              &mem_sys->sibling_mem_sys;
    +        }
    +        mem_sys->ref_mem_sys = 
    +          &parent_mem_sys->child_mem_sys;
    +        parent_mem_sys->child_mem_sys = mem_sys;
    +    }
    +    /* This seems a bit redundant, but we're not taking chances */
    +    else
    +    {
    +        mem_sys->ref_mem_sys = NULL;
    +        mem_sys->sibling_mem_sys = NULL;
    +        mem_sys->child_mem_sys = NULL;
    +    }
    +
    +    return mem_sys;
    +}
    +
    +#ifdef APR_MEMORY_ASSERT
    +APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
    +{
    +    apr_sms_t *parent;
    +
    +    /*
    +     * A memory system without a malloc won't do us much good
    +     */
    +    assert(mem_sys->malloc_fn != NULL);
    +
    +    /* 
    +     * Check to see if this is either a non-tracking or
    +     * a tracking memory system. It has to have at least a free
    +     * or destroy function. And to avoid half implementations
    +     * we require reset to be present when destroy is.
    +     */
    +    assert(mem_sys->free_fn != NULL ||
    +         (mem_sys->destroy_fn != NULL &&
    +          mem_sys->reset_fn != NULL));
    +
    +    assert(mem_sys->destroy_fn == NULL ||
    +         mem_sys->reset_fn != NULL);
    +  
    +    assert(mem_sys->reset_fn == NULL ||
    +         mem_sys->destroy_fn != NULL);
    +
    +    /*
    +     * Make sure all accounting memory dies with the memory system.
    +     * To be more specific, make sure the accounting memort system
    +     * is either the memory system itself or a direct child.
    +     */
    +    assert(mem_sys->accounting_mem_sys == mem_sys ||
    +	 mem_sys->accounting_mem_sys->parent_mem_sys == 
    +	   mem_sys);
    +
    +    /*
    +     * A non-tracking memory system can be the child of
    +     * another non-tracking memory system if there are no
    +     * tracking ancestors, but in that specific case we issue a
    +     * warning.
    +     */
    +    if (mem_sys->parent_mem_sys == NULL)
    +        return;
    +
    +    parent = mem_sys
    +    while (parent)
    +    {
    +        if (apr_sms_is_tracking(parent))
    +            return; /* Tracking memory system found, return satisfied ;-) */
    +
    +        parent = parent->parent_mem_sys;
    +    }
    +
    +    /* issue a warning: 
    +     * WARNING: A non-tracking memory system was created without a tracking 
    +     * parent.
    +     */
    +}
    +#endif /* APR_MEMORY_ASSERT */
    +
    +/*
    + * LOCAL FUNCTION used in:
    + *  - apr_sms_do_child_cleanups
    + *  - apr_sms_reset
    + *  - apr_sms_destroy
    + *
    + * Call all the cleanup routines registered with a memory system.
    + */
    +static void apr_sms_do_cleanups(apr_sms_t *mem_sys)
    +{
    +    struct apr_sms_cleanup *cleanup;
    +
    +    cleanup = mem_sys->cleanups;
    +    while (cleanup)
    +    {
    +        cleanup->cleanup_fn(cleanup->data);
    +        cleanup = cleanup->next;
    +    }
    +}
    +
    +/*
    + * LOCAL FUNCTION used in:
    + *  - apr_sms_reset
    + *  - apr_sms_destroy
    + *
    + * This not only calls do_cleanups, but also calls the pre_destroy(!)
    + */
    +static void apr_sms_do_child_cleanups(apr_sms_t *mem_sys)
    +{
    +    if (mem_sys == NULL)
    +        return;
    +
    +    mem_sys = mem_sys->child_mem_sys;
    +    while (mem_sys)
    +    {
    +        apr_sms_do_child_cleanups(mem_sys);
    +        apr_sms_do_cleanups(mem_sys);
    +
    +        if (mem_sys->pre_destroy_fn != NULL)
    +            mem_sys->pre_destroy_fn(mem_sys);
    +
    +        mem_sys = mem_sys->sibling_mem_sys;
    +    }
    +}
    +
    +APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys)
    +{
    +    if (!mem_sys)
    +        return APR_EMEMSYS;
    +    if (!mem_sys->reset_fn)
    +        return APR_EINVAL; /* Not sure if this is right... */
    +
    +    /* 
    +     * Run the cleanups of all child memory systems _including_
    +     * the accounting memory system.
    +     */
    +    apr_sms_do_child_cleanups(mem_sys);
    +
    +    /* Run all cleanups, the memory will be freed by the reset */
    +    apr_sms_do_cleanups(mem_sys);
    +    mem_sys->cleanups = NULL;
    +
    +    /* We don't have any child memory systems after the reset */
    +    mem_sys->child_mem_sys = NULL;
    +
    +    /* Reset the accounting memory system to ourselves, any
    +     * child memory system _including_ the accounting memory
    +     * system will be destroyed by the reset 
    +     * strikerXXX: Maybe this should be the responsibility of
    +     *             the reset function(?).
    +     */
    +    mem_sys->accounting_mem_sys = mem_sys;
    +
    +    /* Let the memory system handle the actual reset */
    +    return mem_sys->reset_fn(mem_sys);
    +}
    +
    +APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
    +{
    +    apr_sms_t *child_mem_sys;
    +    apr_sms_t *sibling_mem_sys;
    +    struct apr_sms_cleanup *cleanup;
    +    struct apr_sms_cleanup *next_cleanup;
    +
    +    if (!mem_sys)
    +        return APR_EMEMSYS;
    +
    +    if (apr_sms_is_tracking(mem_sys))
    +    {
    +        /* 
    +         * Run the cleanups of all child memory systems _including_
    +         * the accounting memory system.
    +         */
    +        apr_sms_do_child_cleanups(mem_sys);
    +
    +        /* Run all cleanups, the memory will be freed by the destroy */
    +        apr_sms_do_cleanups(mem_sys);
    +    }
    +    else
    +    {
    +        if (mem_sys->accounting_mem_sys != mem_sys)
    +        {
    +            child_mem_sys = mem_sys->accounting_mem_sys;
    +		    
    +            /* 
    +             * Remove the accounting memory system from the memory systems 
    +             * child list (we will explicitly destroy it later in this block).
    +             */
    +            if (child_mem_sys->sibling_mem_sys != NULL)
    +	            child_mem_sys->sibling_mem_sys->ref_mem_sys =
    +	              child_mem_sys->ref_mem_sys;
    +
    +            *child_mem_sys->ref_mem_sys = 
    +            child_mem_sys->sibling_mem_sys;
    +
    +            /* Set this fields so destroy will work */
    +            child_mem_sys->ref_mem_sys = NULL;
    +            child_mem_sys->sibling_mem_sys = NULL;
    +        }
    +
    +        /* Visit all children and destroy them */
    +        child_mem_sys = mem_sys->child_mem_sys;
    +        while (child_mem_sys != NULL)
    +        {
    +            sibling_mem_sys = child_mem_sys->sibling_mem_sys;
    +            apr_sms_destroy(child_mem_sys);
    +            child_mem_sys = sibling_mem_sys;
    +        }
    +
    +        /*
    +         * If the accounting memory system _is_ tracking, we also know that it is
    +         * not the memory system itself.
    +         */
    +        if (apr_sms_is_tracking(mem_sys->accounting_mem_sys))
    +        {
    +            /* 
    +             * Run all cleanups, the memory will be freed by the destroying of the
    +             * accounting memory system.
    +             */
    +            apr_sms_do_cleanups(mem_sys);
    +
    +            /* Destroy the accounting memory system */
    +            apr_sms_destroy(mem_sys->accounting_mem_sys);
    +
    +            /* 
    +             * Set the accounting memory system back to the parent memory system
    +             * just in case...
    +             */
    +            mem_sys->accounting_mem_sys = mem_sys;
    +        }
    +        else
    +        {
    +            /* Run all cleanups, free'ing memory as we go */
    +            cleanup = mem_sys->cleanups;
    +            while (cleanup)
    +            {
    +                cleanup->cleanup_fn(cleanup->data);
    +                next_cleanup = cleanup->next;
    +                apr_sms_free(mem_sys->accounting_mem_sys, 
    +			       cleanup);
    +                cleanup = next_cleanup;
    +            }
    +
    +            if (mem_sys->accounting_mem_sys != mem_sys)
    +            {
    +                /* Destroy the accounting memory system */
    +                apr_sms_destroy(mem_sys->accounting_mem_sys);
    +                /* 
    +                 * Set the accounting memory system back to the parent memory system
    +                 * just in case...
    +                 */
    +                mem_sys->accounting_mem_sys = mem_sys;
    +            }
    +       }
    +  }
    +
    +  /* Remove the memory system from the parent memory systems child list */
    +  if (mem_sys->sibling_mem_sys != NULL)
    +      mem_sys->sibling_mem_sys->ref_mem_sys =
    +        mem_sys->ref_mem_sys;
    +  if (mem_sys->ref_mem_sys != NULL)
    +      *mem_sys->ref_mem_sys = mem_sys->sibling_mem_sys;
    +
    +  /* Call the pre-destroy if present */
    +  if (mem_sys->pre_destroy_fn != NULL)
    +      mem_sys->pre_destroy_fn(mem_sys);
    +
    +  /* 1 - If we have a self destruct, use it */
    +  if (mem_sys->destroy_fn != NULL)
    +      return mem_sys->destroy_fn(mem_sys);
    +
    +  /* 2 - If we don't have a parent, free using ourselves */
    +  else if (mem_sys->parent_mem_sys == NULL)
    +      return mem_sys->free_fn(mem_sys, mem_sys);
    +
    +  /* 3 - If we do have a parent and it has a free function, use it */
    +  else if (mem_sys->parent_mem_sys->free_fn != NULL)
    +      return apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
    +
    +  /* 4 - Assume we are the child of a tracking memory system, and do nothing */
    +#ifdef APR_ASSERT_MEMORY
    +    mem_sys = mem_sys->parent_mem_sys;
    +    while (mem_sys)
    +    {
    +        if (apr_sms_is_tracking(mem_sys))
    +            return APR_SUCCESS;
    +
    +        mem_sys = mem_sys->parent_mem_sys;
    +    }
    +    assert(0); /* Made the wrong assumption, so we assert */
    +#endif /* APR_MEMORY_ASSERT */
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a,
    +                                              apr_sms_t *b)
    +{
    +#ifdef APR_ASSERT_MEMORY
    +    assert(a != NULL);
    +    assert(b != NULL);
    +#endif
    +    if (!b)
    +        return APR_EINVAL;
    +        
    +    while (b && b != a)
    +        b = b->parent_mem_sys;
    +
    +    /* APR_SUCCESS = 0, so if they agree we should return that... */
    +    return !(b == a); 
    +}
    +
    +APR_DECLARE(void) apr_sms_threadsafe_lock(apr_sms_t *mem_sys)
    +{
    +#ifdef APR_ASSERT_MEMORY
    +    assert(mem_sys != NULL);
    +#endif
    +
    +    if (!mem_sys)
    +        return;       
    +    if (mem_sys->threadsafe_lock_fn != NULL)
    +        mem_sys->threadsafe_lock_fn(mem_sys);
    +}
    +
    +APR_DECLARE(void) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys)
    +{
    +#ifdef APR_ASSERT_MEMORY
    +    assert(mem_sys != NULL);
    +#endif
    +
    +    if (!mem_sys)
    +        return;
    +    if (mem_sys->threadsafe_unlock_fn != NULL)
    +        mem_sys->threadsafe_unlock_fn(mem_sys);
    +}
    +
    +/*
    + * memory system cleanup management functions
    + */
    +
    +APR_DECLARE(apr_status_t) 
    +apr_sms_cleanup_register(apr_sms_t *mem_sys, void *data,
    +                         apr_status_t (*cleanup_fn)(void *))
    +{
    +    struct apr_sms_cleanup *cleanup;
    +
    +#ifdef APR_ASSERT_MEMORY
    +    assert(mem_sys->accounting_mem_sys != NULL);
    +#endif
    +
    +    if (!mem_sys)
    +        return APR_EMEMSYS;
    +    
    +    if (cleanup_fn == NULL)
    +        return APR_EINVAL;
    +
    +    cleanup = (struct apr_sms_cleanup *)
    +	    apr_sms_malloc(mem_sys->accounting_mem_sys,
    +                       sizeof(struct apr_sms_cleanup));
    +
    +    if (cleanup == NULL)
    +        return APR_ENOMEM;
    +
    +    cleanup->data = data;
    +    cleanup->cleanup_fn = cleanup_fn;
    +    cleanup->next = mem_sys->cleanups;
    +    mem_sys->cleanups = cleanup;
    +
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(apr_status_t)
    +apr_sms_cleanup_unregister(apr_sms_t *mem_sys, void *data,
    +                           apr_status_t (*cleanup_fn)(void *))
    +{
    +    struct apr_sms_cleanup *cleanup;
    +    struct apr_sms_cleanup **cleanup_ref;
    +
    +#ifdef APR_ASSERT_MEMORY
    +    assert(mem_sys->accounting_mem_sys != NULL);
    +#endif
    +
    +    if (!mem_sys)
    +        return APR_EMEMSYS;
    +        
    +    cleanup = mem_sys->cleanups;
    +    cleanup_ref = &mem_sys->cleanups;
    +    while (cleanup)
    +    {
    +        if (cleanup->data == data && cleanup->cleanup_fn == cleanup_fn)
    +        {
    +            *cleanup_ref = cleanup->next;
    +
    +            mem_sys = mem_sys->accounting_mem_sys;
    +
    +            if (mem_sys->free_fn != NULL)
    +                apr_sms_free(mem_sys, cleanup);
    +
    +            return APR_SUCCESS;
    +        }
    +
    +        cleanup_ref = &cleanup->next;
    +        cleanup = cleanup->next;
    +    }
    +
    +    /* The cleanup function should have been registered previously */
    +    return APR_ENOCLEANUP;
    +}
    +
    +APR_DECLARE(apr_status_t) 
    +apr_sms_cleanup_run(apr_sms_t *mem_sys, void *data, 
    +			        apr_status_t (*cleanup_fn)(void *))
    +{
    +    apr_sms_cleanup_unregister(mem_sys, data, cleanup_fn);
    +    return cleanup_fn(data);
    +}
    diff --git a/memory/unix/apr_sms_std.c b/memory/unix/apr_sms_std.c
    new file mode 100644
    index 00000000000..791835835e4
    --- /dev/null
    +++ b/memory/unix/apr_sms_std.c
    @@ -0,0 +1,132 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +/* This code kindly donated to APR by 
    + *    Elrond  
    + *    Luke Kenneth Casson Leighton 
    + *    Sander Striker 
    + *
    + * May 2001
    + */
    +
    +#include "apr.h"
    +#include "apr_private.h"
    +#include "apr_memory_system.h"
    +#include 
    +#include 
    +
    +/*
    + * standard memory system
    + */
    +
    +static void * apr_sms_std_malloc(apr_sms_t *mem_sys,
    +                                 apr_size_t size)
    +{
    +    return malloc(size);
    +}
    +
    +static void * apr_sms_std_calloc(apr_sms_t *mem_sys,
    +                                 apr_size_t size)
    +{
    +#if HAVE_CALLOC
    +    return calloc(1, size);
    +#else
    +    void *mem;
    +    mem = malloc(size);
    +    memset(mem, '\0', size);
    +    return mem;
    +#endif
    +}
    +
    +
    +static void * apr_sms_std_realloc(apr_sms_t *mem_sys,
    +                                  void *mem, apr_size_t size)
    +{
    +    return realloc(mem, size);
    +}
    +
    +static apr_status_t apr_sms_std_free(apr_sms_t *mem_sys,
    +                                     void *mem)
    +{
    +    free(mem);
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys)
    +{
    +    apr_sms_t *new_mem_sys;
    +
    +    assert(mem_sys != NULL);
    +
    +    *mem_sys = NULL;
    +    /* should we be using apr_sms_calloc now we have it??? */
    +    new_mem_sys = apr_sms_create(malloc(sizeof(apr_sms_t)),
    +                                 NULL);
    +
    +    if (new_mem_sys == NULL)
    +        return APR_ENOMEM;
    +
    +    new_mem_sys->malloc_fn  = apr_sms_std_malloc;
    +    new_mem_sys->calloc_fn  = apr_sms_std_calloc;
    +    new_mem_sys->realloc_fn = apr_sms_std_realloc;
    +    new_mem_sys->free_fn    = apr_sms_std_free;
    +    /* as we're not a tracking memory module, i.e. we don't keep
    +     * track of our allocations, we don't have apr_sms_reset or
    +     * apr_sms_destroy functions.
    +     */
    +    apr_sms_assert(new_mem_sys);
    +
    +    *mem_sys = new_mem_sys;
    +    return APR_SUCCESS;
    +}
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    new file mode 100644
    index 00000000000..2beda942ead
    --- /dev/null
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -0,0 +1,261 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +/* This code kindly donated to APR by 
    + *    Elrond  
    + *    Luke Kenneth Casson Leighton 
    + *    Sander Striker 
    + *
    + * May 2001
    + */
    +
    +#include "apr.h"
    +#include "apr_general.h"
    +#include "apr_private.h"
    +#include "apr_tracking_memory_system.h"
    +#include 
    +#include 
    +
    +/*
    + * Simple tracking memory system
    + */
    +
    +/* INTERNALLY USED STRUCTURES */
    +typedef struct apr_track_node_t
    +{
    +    struct apr_track_node_t  *next;
    +    struct apr_track_node_t **ref;
    +} apr_track_node_t;
    +
    +typedef struct apr_sms_tracking_t
    +{
    +    apr_sms_t            header;
    +    apr_track_node_t    *nodes;
    +} apr_sms_tracking_t;
    +
    +static void * apr_sms_tracking_malloc(apr_sms_t *mem_sys,
    +                                      apr_size_t size)
    +{
    +    apr_sms_tracking_t *tms;
    +    apr_track_node_t *node;
    +  
    +    assert (mem_sys != NULL);
    +
    +    tms = (apr_sms_tracking_t *)mem_sys;
    +    node = apr_sms_malloc(mem_sys->parent_mem_sys,
    +                          size + sizeof(apr_track_node_t));
    +    if (node == NULL)
    +        return NULL;
    +
    +    node->next = tms->nodes;
    +    tms->nodes = node;
    +    node->ref = &tms->nodes;
    +    if (node->next != NULL)
    +        node->next->ref = &node->next;
    +
    +    node++;
    +
    +    return (void *)node;
    +}
    +
    +static  void * apr_sms_tracking_calloc(apr_sms_t *mem_sys, 
    +                                       apr_size_t size)
    +{
    +    apr_sms_tracking_t *tms;
    +    apr_track_node_t *node;
    +  
    +    assert (mem_sys != NULL);
    +
    +    tms = (apr_sms_tracking_t *)mem_sys;
    +    node = apr_sms_calloc(mem_sys->parent_mem_sys,
    +                          size + sizeof(apr_track_node_t));
    +    if (node == NULL)
    +        return NULL;
    +
    +    node->next = tms->nodes;
    +    tms->nodes = node;
    +    node->ref = &tms->nodes;
    +    if (node->next != NULL)
    +        node->next->ref = &node->next;
    +
    +    node++;
    +
    +    return (void *)node;
    +}
    +
    +static  void * apr_sms_tracking_realloc(apr_sms_t *mem_sys,
    +                                        void *mem, apr_size_t size)
    +{
    +    apr_sms_tracking_t *tms;
    +    apr_track_node_t *node;
    +
    +    assert (mem_sys != NULL);
    +
    +    tms = (apr_sms_tracking_t *)mem_sys;
    +    node = (apr_track_node_t *)mem;
    +
    +    if (node != NULL)
    +    {
    +        node--;
    +        *(node->ref) = node->next;
    +    }
    +
    +    node = apr_sms_realloc(mem_sys->parent_mem_sys,
    +                           node, size + sizeof(apr_track_node_t));
    +    if (node == NULL)
    +        return NULL;
    +
    +    node->next = tms->nodes;
    +    tms->nodes = node;
    +    node->ref = &tms->nodes;
    +    if (node->next != NULL)
    +        node->next->ref = &node->next;
    +
    +    node++;
    +
    +    return (void *)node;
    +}
    +
    +static  apr_status_t apr_sms_tracking_free(apr_sms_t *mem_sys,
    +                                           void *mem)
    +{
    +    apr_track_node_t *node;
    +
    +    assert (mem_sys != NULL);
    +    assert (mem != NULL);
    +
    +    node = (apr_track_node_t *)mem;
    +    node--;
    +
    +    *(node->ref) = node->next;
    +    if (node->next != NULL)
    +        node->next->ref = node->ref;
    +          
    +    return apr_sms_free(mem_sys->parent_mem_sys, node);
    +}
    +
    +static apr_status_t apr_sms_tracking_reset(apr_sms_t *mem_sys)
    +{
    +    apr_sms_tracking_t *tms;
    +    apr_track_node_t *node;
    +    apr_status_t rv;
    +    
    +    assert (mem_sys != NULL);
    +
    +    tms = (apr_sms_tracking_t *)mem_sys;
    +
    +    while (tms->nodes != NULL)
    +    {
    +        node = tms->nodes;
    +        *(node->ref) = node->next;
    +        if (node->next != NULL)
    +            node->next->ref = node->ref;
    +        if ((rv = apr_sms_free(mem_sys->parent_mem_sys, 
    +                               node)) != APR_SUCCESS)
    +            return rv;
    +    }
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t apr_sms_tracking_destroy(apr_sms_t *mem_sys)
    +{
    +    apr_status_t rv;
    +    /* If this is NULL we won't blow up as it should be caught at the
    +     * next level down and then passed back to us...
    +     */
    +#ifdef APR_ASSERT_MEMORY
    +    assert (mem_sys->parent_mem_sys != NULL);
    +#endif
    +    
    +    if (!mem_sys)
    +        return APR_EMEMSYS;
    +
    +    if ((rv = apr_sms_tracking_reset(mem_sys)) != APR_SUCCESS)
    +        return rv;
    +    return apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
    +}
    +
    +APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys, 
    +                                                  apr_sms_t *pms)
    +{
    +    apr_sms_t *new_mem_sys, *tmpms;
    +    apr_sms_tracking_t *tms;
    +
    +    assert (mem_sys != NULL);
    +    assert (pms != NULL);
    +    *mem_sys = NULL;
    +    /* changed this to 2 stages to make easier to follow...
    +     * should we be using apr_sms_calloc now we have it? 
    +     */
    +    tmpms = apr_sms_malloc(pms, sizeof(apr_sms_tracking_t));
    +    new_mem_sys = apr_sms_create(tmpms, pms);
    +
    +    if (new_mem_sys == NULL)
    +        return APR_ENOMEM;
    +
    +    new_mem_sys->malloc_fn  = apr_sms_tracking_malloc;
    +    new_mem_sys->calloc_fn  = apr_sms_tracking_calloc;
    +    new_mem_sys->realloc_fn = apr_sms_tracking_realloc;
    +    new_mem_sys->free_fn    = apr_sms_tracking_free;
    +    new_mem_sys->reset_fn   = apr_sms_tracking_reset;
    +    new_mem_sys->destroy_fn = apr_sms_tracking_destroy;
    +
    +    tms = (apr_sms_tracking_t *)new_mem_sys;
    +    tms->nodes = NULL;
    +
    +    apr_sms_assert(new_mem_sys);
    +
    +    *mem_sys = new_mem_sys;
    +    return APR_SUCCESS;
    +}
    
    From da23f05d35dd725fc56f49d6730d14aeda86bbec Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 14 May 2001 23:03:15 +0000
    Subject: [PATCH 1648/7878] Remove the old memory files...
    
    apr_memory_system.c has become apr_sms.c
    apr_standard_memory_system.c has become apr_sms_std.c
    apr_tracking_memory_system.c has become apr_sms_tracking.c
    
    Off to the attic you go!
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61639 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_memory_system.c          | 612 -----------------------
     memory/unix/apr_standard_memory_system.c | 132 -----
     memory/unix/apr_tracking_memory_system.c | 261 ----------
     3 files changed, 1005 deletions(-)
     delete mode 100644 memory/unix/apr_memory_system.c
     delete mode 100644 memory/unix/apr_standard_memory_system.c
     delete mode 100644 memory/unix/apr_tracking_memory_system.c
    
    diff --git a/memory/unix/apr_memory_system.c b/memory/unix/apr_memory_system.c
    deleted file mode 100644
    index 820a68c181d..00000000000
    --- a/memory/unix/apr_memory_system.c
    +++ /dev/null
    @@ -1,612 +0,0 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    - *
    - * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    - * reserved.
    - *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    - *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    - */
    -
    -/* This code kindly donated to APR by 
    - *    Elrond  
    - *    Luke Kenneth Casson Leighton 
    - *    Sander Striker 
    - *
    - * May 2001
    - */
    - 
    -#include "apr.h"
    -#include "apr_general.h"
    -#include "apr_memory_system.h"
    -#include 
    -#include 
    -
    -#include  /* strikerXXX: had to add this for windows to stop 
    -                     * complaining, please autoconf the include stuff
    -                     */
    -
    -/*
    - * private structure defenitions
    - */
    -struct apr_sms_cleanup
    -{
    -    struct apr_sms_cleanup *next;
    -    void *data;
    -    apr_status_t (*cleanup_fn)(void *);
    -};
    -
    -/* 
    - * memory allocation functions
    - */
    -
    -APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *mem_sys,
    -                                   apr_size_t size)
    -{
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys);
    -    assert(mem_sys->malloc_fn);
    -#endif
    -
    -    if (!mem_sys || !mem_sys->malloc_fn)
    -        return NULL;
    -
    -    if (size == 0)
    -        return NULL;
    -
    -    return mem_sys->malloc_fn(mem_sys, size);
    -}
    -
    -APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *mem_sys,
    -                                   apr_size_t size)
    -{
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys);
    -    assert(mem_sys->malloc_fn);
    -    assert(mem_sys->calloc_fn);
    -#endif
    -
    -    if (size == 0)
    -        return NULL;
    -
    -    if (mem_sys->calloc_fn == NULL){
    -        /* Assumption - if we don't have calloc we have
    -         * malloc, might be bogus...
    -         */
    -        void *mem = mem_sys->malloc_fn(mem_sys, size);
    -        memset(mem, '\0', size);
    -        return mem;
    -    } else
    -        return mem_sys->calloc_fn(mem_sys, size);
    -}
    -
    -APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem,
    -                                    apr_size_t size)
    -{
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys);
    -    assert(mem_sys->realloc_fn);
    -#endif
    -   
    -    if (mem == NULL)
    -        return apr_sms_malloc(mem_sys, size);
    -
    -    if (size == 0)
    -    {
    -        apr_sms_free(mem_sys, mem);
    -        return NULL;
    -    }
    -
    -    return mem_sys->realloc_fn(mem_sys, mem, size);
    -}
    -
    -APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys,
    -                                       void *mem)
    -{
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys->free_fn);
    -#endif
    -
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -  
    -    if (mem == NULL)
    -        return APR_EINVAL;
    -
    -    if (mem_sys->free_fn != NULL)
    -        return mem_sys->free_fn(mem_sys, mem);  
    -
    -    return APR_SUCCESS;
    -}
    -
    -/*
    - * memory system functions
    - */
    -
    -static int apr_sms_is_tracking(apr_sms_t *mem_sys)
    -{
    -    /*
    -     * The presense of a reset function gives us the clue that this is a 
    -     * tracking memory system.
    -     */
    -    return mem_sys->reset_fn != NULL;
    -}
    -
    -APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory, 
    -                                        apr_sms_t *parent_mem_sys)
    -{
    -    apr_sms_t *mem_sys;
    -
    -    if (memory == NULL)
    -        return NULL;
    -
    -    /* Just typecast it, and clear it */
    -    mem_sys = (apr_sms_t *)memory;
    -    memset(mem_sys, '\0', sizeof(apr_sms_t));
    -
    -    /* Initialize the parent and accounting memory system pointers */
    -    mem_sys->parent_mem_sys = parent_mem_sys;
    -    mem_sys->accounting_mem_sys = mem_sys;
    -
    -    if (parent_mem_sys != NULL)
    -    {
    -        if ((mem_sys->sibling_mem_sys = 
    -           parent_mem_sys->child_mem_sys) != NULL)
    -        {
    -            mem_sys->sibling_mem_sys->ref_mem_sys = 
    -              &mem_sys->sibling_mem_sys;
    -        }
    -        mem_sys->ref_mem_sys = 
    -          &parent_mem_sys->child_mem_sys;
    -        parent_mem_sys->child_mem_sys = mem_sys;
    -    }
    -    /* This seems a bit redundant, but we're not taking chances */
    -    else
    -    {
    -        mem_sys->ref_mem_sys = NULL;
    -        mem_sys->sibling_mem_sys = NULL;
    -        mem_sys->child_mem_sys = NULL;
    -    }
    -
    -    return mem_sys;
    -}
    -
    -#ifdef APR_MEMORY_ASSERT
    -APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
    -{
    -    apr_sms_t *parent;
    -
    -    /*
    -     * A memory system without a malloc won't do us much good
    -     */
    -    assert(mem_sys->malloc_fn != NULL);
    -
    -    /* 
    -     * Check to see if this is either a non-tracking or
    -     * a tracking memory system. It has to have at least a free
    -     * or destroy function. And to avoid half implementations
    -     * we require reset to be present when destroy is.
    -     */
    -    assert(mem_sys->free_fn != NULL ||
    -         (mem_sys->destroy_fn != NULL &&
    -          mem_sys->reset_fn != NULL));
    -
    -    assert(mem_sys->destroy_fn == NULL ||
    -         mem_sys->reset_fn != NULL);
    -  
    -    assert(mem_sys->reset_fn == NULL ||
    -         mem_sys->destroy_fn != NULL);
    -
    -    /*
    -     * Make sure all accounting memory dies with the memory system.
    -     * To be more specific, make sure the accounting memort system
    -     * is either the memory system itself or a direct child.
    -     */
    -    assert(mem_sys->accounting_mem_sys == mem_sys ||
    -	 mem_sys->accounting_mem_sys->parent_mem_sys == 
    -	   mem_sys);
    -
    -    /*
    -     * A non-tracking memory system can be the child of
    -     * another non-tracking memory system if there are no
    -     * tracking ancestors, but in that specific case we issue a
    -     * warning.
    -     */
    -    if (mem_sys->parent_mem_sys == NULL)
    -        return;
    -
    -    parent = mem_sys
    -    while (parent)
    -    {
    -        if (apr_sms_is_tracking(parent))
    -            return; /* Tracking memory system found, return satisfied ;-) */
    -
    -        parent = parent->parent_mem_sys;
    -    }
    -
    -    /* issue a warning: 
    -     * WARNING: A non-tracking memory system was created without a tracking 
    -     * parent.
    -     */
    -}
    -#endif /* APR_MEMORY_ASSERT */
    -
    -/*
    - * LOCAL FUNCTION used in:
    - *  - apr_sms_do_child_cleanups
    - *  - apr_sms_reset
    - *  - apr_sms_destroy
    - *
    - * Call all the cleanup routines registered with a memory system.
    - */
    -static void apr_sms_do_cleanups(apr_sms_t *mem_sys)
    -{
    -    struct apr_sms_cleanup *cleanup;
    -
    -    cleanup = mem_sys->cleanups;
    -    while (cleanup)
    -    {
    -        cleanup->cleanup_fn(cleanup->data);
    -        cleanup = cleanup->next;
    -    }
    -}
    -
    -/*
    - * LOCAL FUNCTION used in:
    - *  - apr_sms_reset
    - *  - apr_sms_destroy
    - *
    - * This not only calls do_cleanups, but also calls the pre_destroy(!)
    - */
    -static void apr_sms_do_child_cleanups(apr_sms_t *mem_sys)
    -{
    -    if (mem_sys == NULL)
    -        return;
    -
    -    mem_sys = mem_sys->child_mem_sys;
    -    while (mem_sys)
    -    {
    -        apr_sms_do_child_cleanups(mem_sys);
    -        apr_sms_do_cleanups(mem_sys);
    -
    -        if (mem_sys->pre_destroy_fn != NULL)
    -            mem_sys->pre_destroy_fn(mem_sys);
    -
    -        mem_sys = mem_sys->sibling_mem_sys;
    -    }
    -}
    -
    -APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys)
    -{
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -    if (!mem_sys->reset_fn)
    -        return APR_EINVAL; /* Not sure if this is right... */
    -
    -    /* 
    -     * Run the cleanups of all child memory systems _including_
    -     * the accounting memory system.
    -     */
    -    apr_sms_do_child_cleanups(mem_sys);
    -
    -    /* Run all cleanups, the memory will be freed by the reset */
    -    apr_sms_do_cleanups(mem_sys);
    -    mem_sys->cleanups = NULL;
    -
    -    /* We don't have any child memory systems after the reset */
    -    mem_sys->child_mem_sys = NULL;
    -
    -    /* Reset the accounting memory system to ourselves, any
    -     * child memory system _including_ the accounting memory
    -     * system will be destroyed by the reset 
    -     * strikerXXX: Maybe this should be the responsibility of
    -     *             the reset function(?).
    -     */
    -    mem_sys->accounting_mem_sys = mem_sys;
    -
    -    /* Let the memory system handle the actual reset */
    -    return mem_sys->reset_fn(mem_sys);
    -}
    -
    -APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
    -{
    -    apr_sms_t *child_mem_sys;
    -    apr_sms_t *sibling_mem_sys;
    -    struct apr_sms_cleanup *cleanup;
    -    struct apr_sms_cleanup *next_cleanup;
    -
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -
    -    if (apr_sms_is_tracking(mem_sys))
    -    {
    -        /* 
    -         * Run the cleanups of all child memory systems _including_
    -         * the accounting memory system.
    -         */
    -        apr_sms_do_child_cleanups(mem_sys);
    -
    -        /* Run all cleanups, the memory will be freed by the destroy */
    -        apr_sms_do_cleanups(mem_sys);
    -    }
    -    else
    -    {
    -        if (mem_sys->accounting_mem_sys != mem_sys)
    -        {
    -            child_mem_sys = mem_sys->accounting_mem_sys;
    -		    
    -            /* 
    -             * Remove the accounting memory system from the memory systems 
    -             * child list (we will explicitly destroy it later in this block).
    -             */
    -            if (child_mem_sys->sibling_mem_sys != NULL)
    -	            child_mem_sys->sibling_mem_sys->ref_mem_sys =
    -	              child_mem_sys->ref_mem_sys;
    -
    -            *child_mem_sys->ref_mem_sys = 
    -            child_mem_sys->sibling_mem_sys;
    -
    -            /* Set this fields so destroy will work */
    -            child_mem_sys->ref_mem_sys = NULL;
    -            child_mem_sys->sibling_mem_sys = NULL;
    -        }
    -
    -        /* Visit all children and destroy them */
    -        child_mem_sys = mem_sys->child_mem_sys;
    -        while (child_mem_sys != NULL)
    -        {
    -            sibling_mem_sys = child_mem_sys->sibling_mem_sys;
    -            apr_sms_destroy(child_mem_sys);
    -            child_mem_sys = sibling_mem_sys;
    -        }
    -
    -        /*
    -         * If the accounting memory system _is_ tracking, we also know that it is
    -         * not the memory system itself.
    -         */
    -        if (apr_sms_is_tracking(mem_sys->accounting_mem_sys))
    -        {
    -            /* 
    -             * Run all cleanups, the memory will be freed by the destroying of the
    -             * accounting memory system.
    -             */
    -            apr_sms_do_cleanups(mem_sys);
    -
    -            /* Destroy the accounting memory system */
    -            apr_sms_destroy(mem_sys->accounting_mem_sys);
    -
    -            /* 
    -             * Set the accounting memory system back to the parent memory system
    -             * just in case...
    -             */
    -            mem_sys->accounting_mem_sys = mem_sys;
    -        }
    -        else
    -        {
    -            /* Run all cleanups, free'ing memory as we go */
    -            cleanup = mem_sys->cleanups;
    -            while (cleanup)
    -            {
    -                cleanup->cleanup_fn(cleanup->data);
    -                next_cleanup = cleanup->next;
    -                apr_sms_free(mem_sys->accounting_mem_sys, 
    -			       cleanup);
    -                cleanup = next_cleanup;
    -            }
    -
    -            if (mem_sys->accounting_mem_sys != mem_sys)
    -            {
    -                /* Destroy the accounting memory system */
    -                apr_sms_destroy(mem_sys->accounting_mem_sys);
    -                /* 
    -                 * Set the accounting memory system back to the parent memory system
    -                 * just in case...
    -                 */
    -                mem_sys->accounting_mem_sys = mem_sys;
    -            }
    -       }
    -  }
    -
    -  /* Remove the memory system from the parent memory systems child list */
    -  if (mem_sys->sibling_mem_sys != NULL)
    -      mem_sys->sibling_mem_sys->ref_mem_sys =
    -        mem_sys->ref_mem_sys;
    -  if (mem_sys->ref_mem_sys != NULL)
    -      *mem_sys->ref_mem_sys = mem_sys->sibling_mem_sys;
    -
    -  /* Call the pre-destroy if present */
    -  if (mem_sys->pre_destroy_fn != NULL)
    -      mem_sys->pre_destroy_fn(mem_sys);
    -
    -  /* 1 - If we have a self destruct, use it */
    -  if (mem_sys->destroy_fn != NULL)
    -      return mem_sys->destroy_fn(mem_sys);
    -
    -  /* 2 - If we don't have a parent, free using ourselves */
    -  else if (mem_sys->parent_mem_sys == NULL)
    -      return mem_sys->free_fn(mem_sys, mem_sys);
    -
    -  /* 3 - If we do have a parent and it has a free function, use it */
    -  else if (mem_sys->parent_mem_sys->free_fn != NULL)
    -      return apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
    -
    -  /* 4 - Assume we are the child of a tracking memory system, and do nothing */
    -#ifdef APR_ASSERT_MEMORY
    -    mem_sys = mem_sys->parent_mem_sys;
    -    while (mem_sys)
    -    {
    -        if (apr_sms_is_tracking(mem_sys))
    -            return APR_SUCCESS;
    -
    -        mem_sys = mem_sys->parent_mem_sys;
    -    }
    -    assert(0); /* Made the wrong assumption, so we assert */
    -#endif /* APR_MEMORY_ASSERT */
    -    return APR_SUCCESS;
    -}
    -
    -APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a,
    -                                              apr_sms_t *b)
    -{
    -#ifdef APR_ASSERT_MEMORY
    -    assert(a != NULL);
    -    assert(b != NULL);
    -#endif
    -    if (!b)
    -        return APR_EINVAL;
    -        
    -    while (b && b != a)
    -        b = b->parent_mem_sys;
    -
    -    /* APR_SUCCESS = 0, so if they agree we should return that... */
    -    return !(b == a); 
    -}
    -
    -APR_DECLARE(void) apr_sms_threadsafe_lock(apr_sms_t *mem_sys)
    -{
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys != NULL);
    -#endif
    -
    -    if (!mem_sys)
    -        return;       
    -    if (mem_sys->threadsafe_lock_fn != NULL)
    -        mem_sys->threadsafe_lock_fn(mem_sys);
    -}
    -
    -APR_DECLARE(void) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys)
    -{
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys != NULL);
    -#endif
    -
    -    if (!mem_sys)
    -        return;
    -    if (mem_sys->threadsafe_unlock_fn != NULL)
    -        mem_sys->threadsafe_unlock_fn(mem_sys);
    -}
    -
    -/*
    - * memory system cleanup management functions
    - */
    -
    -APR_DECLARE(apr_status_t) 
    -apr_sms_cleanup_register(apr_sms_t *mem_sys, void *data,
    -                         apr_status_t (*cleanup_fn)(void *))
    -{
    -    struct apr_sms_cleanup *cleanup;
    -
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys->accounting_mem_sys != NULL);
    -#endif
    -
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -    
    -    if (cleanup_fn == NULL)
    -        return APR_EINVAL;
    -
    -    cleanup = (struct apr_sms_cleanup *)
    -	    apr_sms_malloc(mem_sys->accounting_mem_sys,
    -                       sizeof(struct apr_sms_cleanup));
    -
    -    if (cleanup == NULL)
    -        return APR_ENOMEM;
    -
    -    cleanup->data = data;
    -    cleanup->cleanup_fn = cleanup_fn;
    -    cleanup->next = mem_sys->cleanups;
    -    mem_sys->cleanups = cleanup;
    -
    -    return APR_SUCCESS;
    -}
    -
    -APR_DECLARE(apr_status_t)
    -apr_sms_cleanup_unregister(apr_sms_t *mem_sys, void *data,
    -                           apr_status_t (*cleanup_fn)(void *))
    -{
    -    struct apr_sms_cleanup *cleanup;
    -    struct apr_sms_cleanup **cleanup_ref;
    -
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys->accounting_mem_sys != NULL);
    -#endif
    -
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -        
    -    cleanup = mem_sys->cleanups;
    -    cleanup_ref = &mem_sys->cleanups;
    -    while (cleanup)
    -    {
    -        if (cleanup->data == data && cleanup->cleanup_fn == cleanup_fn)
    -        {
    -            *cleanup_ref = cleanup->next;
    -
    -            mem_sys = mem_sys->accounting_mem_sys;
    -
    -            if (mem_sys->free_fn != NULL)
    -                apr_sms_free(mem_sys, cleanup);
    -
    -            return APR_SUCCESS;
    -        }
    -
    -        cleanup_ref = &cleanup->next;
    -        cleanup = cleanup->next;
    -    }
    -
    -    /* The cleanup function should have been registered previously */
    -    return APR_ENOCLEANUP;
    -}
    -
    -APR_DECLARE(apr_status_t) 
    -apr_sms_cleanup_run(apr_sms_t *mem_sys, void *data, 
    -			        apr_status_t (*cleanup_fn)(void *))
    -{
    -    apr_sms_cleanup_unregister(mem_sys, data, cleanup_fn);
    -    return cleanup_fn(data);
    -}
    diff --git a/memory/unix/apr_standard_memory_system.c b/memory/unix/apr_standard_memory_system.c
    deleted file mode 100644
    index 791835835e4..00000000000
    --- a/memory/unix/apr_standard_memory_system.c
    +++ /dev/null
    @@ -1,132 +0,0 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    - *
    - * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    - * reserved.
    - *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    - *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    - */
    -
    -/* This code kindly donated to APR by 
    - *    Elrond  
    - *    Luke Kenneth Casson Leighton 
    - *    Sander Striker 
    - *
    - * May 2001
    - */
    -
    -#include "apr.h"
    -#include "apr_private.h"
    -#include "apr_memory_system.h"
    -#include 
    -#include 
    -
    -/*
    - * standard memory system
    - */
    -
    -static void * apr_sms_std_malloc(apr_sms_t *mem_sys,
    -                                 apr_size_t size)
    -{
    -    return malloc(size);
    -}
    -
    -static void * apr_sms_std_calloc(apr_sms_t *mem_sys,
    -                                 apr_size_t size)
    -{
    -#if HAVE_CALLOC
    -    return calloc(1, size);
    -#else
    -    void *mem;
    -    mem = malloc(size);
    -    memset(mem, '\0', size);
    -    return mem;
    -#endif
    -}
    -
    -
    -static void * apr_sms_std_realloc(apr_sms_t *mem_sys,
    -                                  void *mem, apr_size_t size)
    -{
    -    return realloc(mem, size);
    -}
    -
    -static apr_status_t apr_sms_std_free(apr_sms_t *mem_sys,
    -                                     void *mem)
    -{
    -    free(mem);
    -    return APR_SUCCESS;
    -}
    -
    -APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys)
    -{
    -    apr_sms_t *new_mem_sys;
    -
    -    assert(mem_sys != NULL);
    -
    -    *mem_sys = NULL;
    -    /* should we be using apr_sms_calloc now we have it??? */
    -    new_mem_sys = apr_sms_create(malloc(sizeof(apr_sms_t)),
    -                                 NULL);
    -
    -    if (new_mem_sys == NULL)
    -        return APR_ENOMEM;
    -
    -    new_mem_sys->malloc_fn  = apr_sms_std_malloc;
    -    new_mem_sys->calloc_fn  = apr_sms_std_calloc;
    -    new_mem_sys->realloc_fn = apr_sms_std_realloc;
    -    new_mem_sys->free_fn    = apr_sms_std_free;
    -    /* as we're not a tracking memory module, i.e. we don't keep
    -     * track of our allocations, we don't have apr_sms_reset or
    -     * apr_sms_destroy functions.
    -     */
    -    apr_sms_assert(new_mem_sys);
    -
    -    *mem_sys = new_mem_sys;
    -    return APR_SUCCESS;
    -}
    diff --git a/memory/unix/apr_tracking_memory_system.c b/memory/unix/apr_tracking_memory_system.c
    deleted file mode 100644
    index 2beda942ead..00000000000
    --- a/memory/unix/apr_tracking_memory_system.c
    +++ /dev/null
    @@ -1,261 +0,0 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    - *
    - * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    - * reserved.
    - *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    - *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    - */
    -
    -/* This code kindly donated to APR by 
    - *    Elrond  
    - *    Luke Kenneth Casson Leighton 
    - *    Sander Striker 
    - *
    - * May 2001
    - */
    -
    -#include "apr.h"
    -#include "apr_general.h"
    -#include "apr_private.h"
    -#include "apr_tracking_memory_system.h"
    -#include 
    -#include 
    -
    -/*
    - * Simple tracking memory system
    - */
    -
    -/* INTERNALLY USED STRUCTURES */
    -typedef struct apr_track_node_t
    -{
    -    struct apr_track_node_t  *next;
    -    struct apr_track_node_t **ref;
    -} apr_track_node_t;
    -
    -typedef struct apr_sms_tracking_t
    -{
    -    apr_sms_t            header;
    -    apr_track_node_t    *nodes;
    -} apr_sms_tracking_t;
    -
    -static void * apr_sms_tracking_malloc(apr_sms_t *mem_sys,
    -                                      apr_size_t size)
    -{
    -    apr_sms_tracking_t *tms;
    -    apr_track_node_t *node;
    -  
    -    assert (mem_sys != NULL);
    -
    -    tms = (apr_sms_tracking_t *)mem_sys;
    -    node = apr_sms_malloc(mem_sys->parent_mem_sys,
    -                          size + sizeof(apr_track_node_t));
    -    if (node == NULL)
    -        return NULL;
    -
    -    node->next = tms->nodes;
    -    tms->nodes = node;
    -    node->ref = &tms->nodes;
    -    if (node->next != NULL)
    -        node->next->ref = &node->next;
    -
    -    node++;
    -
    -    return (void *)node;
    -}
    -
    -static  void * apr_sms_tracking_calloc(apr_sms_t *mem_sys, 
    -                                       apr_size_t size)
    -{
    -    apr_sms_tracking_t *tms;
    -    apr_track_node_t *node;
    -  
    -    assert (mem_sys != NULL);
    -
    -    tms = (apr_sms_tracking_t *)mem_sys;
    -    node = apr_sms_calloc(mem_sys->parent_mem_sys,
    -                          size + sizeof(apr_track_node_t));
    -    if (node == NULL)
    -        return NULL;
    -
    -    node->next = tms->nodes;
    -    tms->nodes = node;
    -    node->ref = &tms->nodes;
    -    if (node->next != NULL)
    -        node->next->ref = &node->next;
    -
    -    node++;
    -
    -    return (void *)node;
    -}
    -
    -static  void * apr_sms_tracking_realloc(apr_sms_t *mem_sys,
    -                                        void *mem, apr_size_t size)
    -{
    -    apr_sms_tracking_t *tms;
    -    apr_track_node_t *node;
    -
    -    assert (mem_sys != NULL);
    -
    -    tms = (apr_sms_tracking_t *)mem_sys;
    -    node = (apr_track_node_t *)mem;
    -
    -    if (node != NULL)
    -    {
    -        node--;
    -        *(node->ref) = node->next;
    -    }
    -
    -    node = apr_sms_realloc(mem_sys->parent_mem_sys,
    -                           node, size + sizeof(apr_track_node_t));
    -    if (node == NULL)
    -        return NULL;
    -
    -    node->next = tms->nodes;
    -    tms->nodes = node;
    -    node->ref = &tms->nodes;
    -    if (node->next != NULL)
    -        node->next->ref = &node->next;
    -
    -    node++;
    -
    -    return (void *)node;
    -}
    -
    -static  apr_status_t apr_sms_tracking_free(apr_sms_t *mem_sys,
    -                                           void *mem)
    -{
    -    apr_track_node_t *node;
    -
    -    assert (mem_sys != NULL);
    -    assert (mem != NULL);
    -
    -    node = (apr_track_node_t *)mem;
    -    node--;
    -
    -    *(node->ref) = node->next;
    -    if (node->next != NULL)
    -        node->next->ref = node->ref;
    -          
    -    return apr_sms_free(mem_sys->parent_mem_sys, node);
    -}
    -
    -static apr_status_t apr_sms_tracking_reset(apr_sms_t *mem_sys)
    -{
    -    apr_sms_tracking_t *tms;
    -    apr_track_node_t *node;
    -    apr_status_t rv;
    -    
    -    assert (mem_sys != NULL);
    -
    -    tms = (apr_sms_tracking_t *)mem_sys;
    -
    -    while (tms->nodes != NULL)
    -    {
    -        node = tms->nodes;
    -        *(node->ref) = node->next;
    -        if (node->next != NULL)
    -            node->next->ref = node->ref;
    -        if ((rv = apr_sms_free(mem_sys->parent_mem_sys, 
    -                               node)) != APR_SUCCESS)
    -            return rv;
    -    }
    -    return APR_SUCCESS;
    -}
    -
    -static apr_status_t apr_sms_tracking_destroy(apr_sms_t *mem_sys)
    -{
    -    apr_status_t rv;
    -    /* If this is NULL we won't blow up as it should be caught at the
    -     * next level down and then passed back to us...
    -     */
    -#ifdef APR_ASSERT_MEMORY
    -    assert (mem_sys->parent_mem_sys != NULL);
    -#endif
    -    
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -
    -    if ((rv = apr_sms_tracking_reset(mem_sys)) != APR_SUCCESS)
    -        return rv;
    -    return apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
    -}
    -
    -APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys, 
    -                                                  apr_sms_t *pms)
    -{
    -    apr_sms_t *new_mem_sys, *tmpms;
    -    apr_sms_tracking_t *tms;
    -
    -    assert (mem_sys != NULL);
    -    assert (pms != NULL);
    -    *mem_sys = NULL;
    -    /* changed this to 2 stages to make easier to follow...
    -     * should we be using apr_sms_calloc now we have it? 
    -     */
    -    tmpms = apr_sms_malloc(pms, sizeof(apr_sms_tracking_t));
    -    new_mem_sys = apr_sms_create(tmpms, pms);
    -
    -    if (new_mem_sys == NULL)
    -        return APR_ENOMEM;
    -
    -    new_mem_sys->malloc_fn  = apr_sms_tracking_malloc;
    -    new_mem_sys->calloc_fn  = apr_sms_tracking_calloc;
    -    new_mem_sys->realloc_fn = apr_sms_tracking_realloc;
    -    new_mem_sys->free_fn    = apr_sms_tracking_free;
    -    new_mem_sys->reset_fn   = apr_sms_tracking_reset;
    -    new_mem_sys->destroy_fn = apr_sms_tracking_destroy;
    -
    -    tms = (apr_sms_tracking_t *)new_mem_sys;
    -    tms->nodes = NULL;
    -
    -    apr_sms_assert(new_mem_sys);
    -
    -    *mem_sys = new_mem_sys;
    -    return APR_SUCCESS;
    -}
    
    From f5d697bcf2429b82073376b58fc773c302c3367f Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 14 May 2001 23:19:54 +0000
    Subject: [PATCH 1649/7878] Now we've moved the memory files update the
     references so we can build again. :)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61640 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_sms_tracking.h     | 2 +-
     memory/unix/apr_sms.c          | 2 +-
     memory/unix/apr_sms_std.c      | 2 +-
     memory/unix/apr_sms_tracking.c | 3 ++-
     test/testmem.c                 | 4 ++--
     5 files changed, 7 insertions(+), 6 deletions(-)
    
    diff --git a/include/apr_sms_tracking.h b/include/apr_sms_tracking.h
    index c07c8a7d6a9..ec7a22c98fe 100644
    --- a/include/apr_sms_tracking.h
    +++ b/include/apr_sms_tracking.h
    @@ -64,7 +64,7 @@
     #define APR_TRACKING_MEMORY_SYSTEM_H
     
     #include "apr.h"
    -#include "apr_memory_system.h"
    +#include "apr_sms.h"
     
     #ifdef __cplusplus
     extern "C" {
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index 820a68c181d..188970cd31d 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -62,7 +62,7 @@
      
     #include "apr.h"
     #include "apr_general.h"
    -#include "apr_memory_system.h"
    +#include "apr_sms.h"
     #include 
     #include 
     
    diff --git a/memory/unix/apr_sms_std.c b/memory/unix/apr_sms_std.c
    index 791835835e4..8bb0136ece6 100644
    --- a/memory/unix/apr_sms_std.c
    +++ b/memory/unix/apr_sms_std.c
    @@ -62,7 +62,7 @@
     
     #include "apr.h"
     #include "apr_private.h"
    -#include "apr_memory_system.h"
    +#include "apr_sms.h"
     #include 
     #include 
     
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    index 2beda942ead..ab12d98da6a 100644
    --- a/memory/unix/apr_sms_tracking.c
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -63,7 +63,8 @@
     #include "apr.h"
     #include "apr_general.h"
     #include "apr_private.h"
    -#include "apr_tracking_memory_system.h"
    +#include "apr_sms.h"
    +#include "apr_sms_tracking.h"
     #include 
     #include 
     
    diff --git a/test/testmem.c b/test/testmem.c
    index 5f569645832..1ef8e8fe4e0 100644
    --- a/test/testmem.c
    +++ b/test/testmem.c
    @@ -52,8 +52,8 @@
      * .
      */
     
    -#include "apr_memory_system.h"
    -#include "apr_tracking_memory_system.h"
    +#include "apr_sms.h"
    +#include "apr_sms_tracking.h"
     #include "apr_errno.h"
     #include "apr_general.h"
     #include "apr_lib.h"
    
    From 1c72b537020bd679c716b7d54a6b1fea45585049 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 15 May 2001 12:45:00 +0000
    Subject: [PATCH 1650/7878] don't hard-code some dll-related flags for OS/390
     in configure.in; libtool should figure out whether or not objects should
     export their symbols for use in DLLs
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61641 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 6 +-----
     1 file changed, 1 insertion(+), 5 deletions(-)
    
    diff --git a/configure.in b/configure.in
    index 528bbf04945..6aeb301e03c 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -819,13 +819,9 @@ AC_ARG_ENABLE(dso,
         fi
         if test "$tempdso" = "no"; then
             case $OS in
    -            *-os2*)
    +            *os390|*-os2*)
                     tempdso="yes"
                     ;;
    -            *os390)
    -                tempdso="yes"
    -                APR_ADDTO(CFLAGS, [-Wc,DLL,EXPORTALL])
    -                ;;
             esac
         fi
      ] )
    
    From 9affbce493df9746883a7d28516491f9966c706c Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 15 May 2001 14:15:50 +0000
    Subject: [PATCH 1651/7878]   Byte counts are apr_size_t, win32 declares a
     goofy ptrdiff_t that   corresponds to a normal ssize_t.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61642 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr.hw    | 4 ++--
     include/apr_md5.h | 4 ++--
     passwd/apr_md5.c  | 4 ++--
     3 files changed, 6 insertions(+), 6 deletions(-)
    
    diff --git a/include/apr.hw b/include/apr.hw
    index 6ea11d79f27..756539eb7d8 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -226,8 +226,8 @@ typedef  unsigned int      apr_uint32_t;
     typedef  __int64           apr_int64_t;
     typedef  unsigned __int64  apr_uint64_t;
     
    -typedef  int         apr_size_t;
    -typedef  int         apr_ssize_t;
    +typedef  size_t      apr_size_t;
    +typedef  ptrdiff_t   apr_ssize_t;
     typedef  _off_t      apr_off_t;
     typedef  size_t      apr_socklen_t;
     typedef  int         pid_t;
    diff --git a/include/apr_md5.h b/include/apr_md5.h
    index 4b916ad73bb..e2de68e908d 100644
    --- a/include/apr_md5.h
    +++ b/include/apr_md5.h
    @@ -143,11 +143,11 @@ APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context,
      * @param context The MD5 content to update.
      * @param input next message block to update
      * @param inputLen The length of the next message block
    - * @deffunc apr_status_t apr_md5_update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen)
    + * @deffunc apr_status_t apr_md5_update(apr_md5_ctx_t *context, apr_size_t char *input, unsigned int inputLen)
      */
     APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
                                             const unsigned char *input,
    -                                        unsigned int inputLen);
    +                                        apr_size_t inputLen);
     
     /**
      * MD5 finalization.  Ends an MD5 message-digest operation, writing the 
    diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c
    index 48d1f1c4b45..a2aecb49f3e 100644
    --- a/passwd/apr_md5.c
    +++ b/passwd/apr_md5.c
    @@ -231,7 +231,7 @@ APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context,
      */
     APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
                                          const unsigned char *input,
    -                                     unsigned int inputLen)
    +                                     apr_size_t inputLen)
     {
         unsigned int i, idx, partLen;
     #if APR_HAS_XLATE
    @@ -503,7 +503,7 @@ APR_DECLARE(apr_status_t) apr_md5_encode(const char *pw, const char *salt,
         char passwd[120], *p;
         const char *sp, *ep;
         unsigned char final[MD5_DIGESTSIZE];
    -    int sl, pl, i;
    +    apr_ssize_t sl, pl, i;
         apr_md5_ctx_t ctx, ctx1;
         unsigned long l;
     
    
    From 3cd7be44da72d155f506e14df53c836c92bd23af Mon Sep 17 00:00:00 2001
    From: Bill Stoddard 
    Date: Tue, 15 May 2001 14:48:50 +0000
    Subject: [PATCH 1652/7878] Required for reliable piped logs in Apache 2.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61643 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 4 +++-
     1 file changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/STATUS b/STATUS
    index 94828ca4ec5..a0dca88d76f 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -1,5 +1,5 @@
     APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS:			-*-text-*-
    -Last modified at [$Date: 2001/05/11 00:29:23 $]
    +Last modified at [$Date: 2001/05/15 14:48:50 $]
     
     Release:
     
    @@ -31,6 +31,8 @@ RELEASE SHOWSTOPPERS:
     
     
     RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
    +    * Get OTHER_CHILD support into Win32
    +        Status: Bill S. is looking into this
     
         * Unconditionally setting AI_CANONNAME flag when apr_sockaddr_info_get()
           calls getaddrinfo() is bogus and causes undesired DNS requests.
    
    From 71b1240ab9bb26a8301f686adc94c068a03e172d Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 16 May 2001 03:42:35 +0000
    Subject: [PATCH 1653/7878]   If I don't understand my original comment, who
     else will?
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61644 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filepath.c | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c
    index efd4e79f167..5f5ccc513ce 100644
    --- a/file_io/win32/filepath.c
    +++ b/file_io/win32/filepath.c
    @@ -254,9 +254,9 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath,
     /* WinNT accepts several odd forms of a 'root' path.  Under Unicode
      * calls (ApiFunctionW) the //?/C:/foo or //?/UNC/mach/share/foo forms
      * are accepted.  Ansi and Unicode functions both accept the //./C:/foo 
    - * form.  Since these forms are handled in the utf-8 to unicode 
    - * translation phase, we don't want the user confused by them, so we 
    - * will accept them but always return the canonical C:/ or //mach/share/
    + * form under WinNT/2K.  Since these forms are handled in the utf-8 to 
    + * unicode translation phase, we don't want the user confused by them, so 
    + * we will accept them but always return the canonical C:/ or //mach/share/
      */
     
     APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, 
    
    From 07594ca13cfdd03ca5cfdb3ca483f6da11b33e51 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 16 May 2001 03:46:32 +0000
    Subject: [PATCH 1654/7878]   Partially solve the char/device issue, with a
     couple of observations   I made testing some canonicalization.  Not perfect,
     and needs a bit   of fleshing out, but the traveled codepath does work.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61645 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filestat.c | 122 ++++++++++++++++++++++++++++++---------
     1 file changed, 94 insertions(+), 28 deletions(-)
    
    diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
    index 475ef97d1ff..0c26b8e8154 100644
    --- a/file_io/win32/filestat.c
    +++ b/file_io/win32/filestat.c
    @@ -278,12 +278,18 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, apr_int32_t wante
      * a WIN32_FILE_ATTRIBUTE_DATA or either WIN32_FIND_DATA [A or W] is
      * passed for wininfo.  When the BY_HANDLE_FILE_INFORMATION structure
      * is passed for wininfo, byhandle is passed as 1 to offset the one
    - * dword discrepancy in the High/Low size structure members.
    + * dword discrepancy in offset of the High/Low size structure members.
    + *
    + * The generic fillin returns 1 if the caller should further inquire
    + * if this is a CHR filetype.  If it's resonably certain it can't be,
    + * then the function returns 0.
      */
    -void fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, 
    -                     int byhandle) 
    +int fillin_fileinfo(apr_finfo_t *finfo, 
    +                    WIN32_FILE_ATTRIBUTE_DATA *wininfo, 
    +                    int byhandle) 
     {
         DWORD *sizes = &wininfo->nFileSizeHigh + byhandle;
    +    int warn = 0;
     
         memset(finfo, '\0', sizeof(*finfo));
     
    @@ -306,11 +312,21 @@ void fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo,
         else if (wininfo->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
             finfo->filetype = APR_DIR;
         }
    +    else if (wininfo->dwFileAttributes & FILE_ATTRIBUTE_DEVICE) {
    +        /* Warning: This test only succeeds on Win9x, on NT these files
    +         * (con, aux, nul, lpt#, com# etc) escape early detection!
    +         */
    +        finfo->filetype = APR_CHR;
    +    }
         else {
    -        /* XXX: Solve this:  Short of opening the handle to the file, the 
    -         * 'FileType' appears to be unknowable (in any trustworthy or 
    -         * consistent sense), that is, as far as PIPE, CHR, etc are concerned.
    +        /* Warning: Short of opening the handle to the file, the 'FileType'
    +         * appears to be unknowable (in any trustworthy or consistent sense)
    +         * on WinNT/2K as far as PIPE, CHR, etc are concerned.
              */
    +        if (!wininfo->ftLastWriteTime.dwLowDateTime 
    +                && !wininfo->ftLastWriteTime.dwHighDateTime 
    +                && !finfo->size)
    +            warn = 1;
             finfo->filetype = APR_REG;
         }
     
    @@ -322,6 +338,7 @@ void fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo,
         
         finfo->valid = APR_FINFO_ATIME | APR_FINFO_CTIME | APR_FINFO_MTIME
                      | APR_FINFO_SIZE  | APR_FINFO_TYPE;   /* == APR_FINFO_MIN */
    +    return warn;
     }
     
     
    @@ -335,38 +352,37 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want
         }
     
         fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 1);
    -    finfo->cntxt = thefile->cntxt;
    - 
    -    /* Extra goodies known only by GetFileInformationByHandle() */
    -    finfo->inode  =  (apr_ino_t)FileInfo.nFileIndexLow
    -                  | ((apr_ino_t)FileInfo.nFileIndexHigh << 32);
    -    finfo->device = FileInfo.dwVolumeSerialNumber;
    -    finfo->nlink  = FileInfo.nNumberOfLinks;
     
    -    finfo->valid |= APR_FINFO_IDENT | APR_FINFO_NLINK;
    -
    -    if ((wanted & APR_FINFO_TYPE) && (APR_FINFO_TYPE == APR_REG))
    +    if (finfo->filetype == APR_REG)
         {
             /* Go the extra mile to be -certain- that we have a real, regular
    -         * file, since the attribute bits aren't a certain thing.
    +         * file, since the attribute bits aren't a certain thing.  Even
    +         * though fillin should have hinted if we *must* do this, we
    +         * don't need to take chances while the handle is already open.
              */
             DWORD FileType;
             if (FileType = GetFileType(thefile->filehand)) {
    -            if (FileType == FILE_TYPE_DISK) {
    -                finfo->filetype = APR_REG;
    -            }
    -            else if (FileType == FILE_TYPE_CHAR) {
    +            if (FileType == FILE_TYPE_CHAR) {
                     finfo->filetype = APR_CHR;
                 }
                 else if (FileType == FILE_TYPE_PIPE) {
                     finfo->filetype = APR_PIPE;
                 }
    -            else {
    -                finfo->filetype = APR_NOFILE;
    -            }
    +            /* Otherwise leave the original conclusion alone 
    +             */
             }
         }
     
    +    finfo->cntxt = thefile->cntxt;
    + 
    +    /* Extra goodies known only by GetFileInformationByHandle() */
    +    finfo->inode  =  (apr_ino_t)FileInfo.nFileIndexLow
    +                  | ((apr_ino_t)FileInfo.nFileIndexHigh << 32);
    +    finfo->device = FileInfo.dwVolumeSerialNumber;
    +    finfo->nlink  = FileInfo.nNumberOfLinks;
    +
    +    finfo->valid |= APR_FINFO_IDENT | APR_FINFO_NLINK;
    +
         if (wanted &= ~finfo->valid) {
             apr_oslevel_e os_level;
             if (apr_get_oslevel(thefile->cntxt, &os_level))
    @@ -386,6 +402,8 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname,
     APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
                                        apr_int32_t wanted, apr_pool_t *cont)
     {
    +    /* XXX: is constant - needs testing - which needs a lighter-weight root test fn */
    +    int isroot = 0;
     #ifdef APR_HAS_UNICODE_FS
         apr_wchar_t wfname[APR_PATH_MAX];
     #endif
    @@ -442,16 +460,36 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
         }
         else 
     #endif
    -      if ((os_level >= APR_WIN_98) && !(wanted & APR_FINFO_NAME))
    +      if ((os_level >= APR_WIN_98) && (!(wanted & APR_FINFO_NAME) || isroot))
         {
    +        /* cannot use FindFile on a Win98 root, it returns \*
    +         */
             if (!GetFileAttributesExA(fname, GetFileExInfoStandard, 
                                      &FileInfo.i)) {
                 return apr_get_os_error();
             }
         }
    +    else if (isroot) {
    +        /* This is Win95 and we are trying to stat a root.  Lie.
    +         */
    +        if (GetDriveType(fname) != DRIVE_UNKNOWN) 
    +        {
    +            finfo->cntxt = cont;
    +            finfo->filetype = 0;
    +            finfo->mtime = apr_time_now();
    +            finfo->protection |= APR_WREAD | APR_WEXECUTE | APR_WWRITE;
    +            finfo->protection |= (finfo->protection << prot_scope_group) 
    +                               | (finfo->protection << prot_scope_user);
    +            finfo->valid |= APR_FINFO_TYPE | APR_FINFO_PROT | APR_FINFO_MTIME;
    +            return (wanted &= ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;            
    +        }
    +        else
    +            return APR_FROM_OS_ERROR(ERROR_PATH_NOT_FOUND);
    +    }
         else  {
             /* Guard against bogus wildcards and retrieve by name
    -         * since we want the true name, or are stuck in Win95
    +         * since we want the true name, or are stuck in Win95,
    +         * or are looking for the root of a Win98 drive.
              */
             HANDLE hFind;
             if (strchr(fname, '*') || strchr(fname, '?'))
    @@ -464,10 +502,38 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
             filename = apr_pstrdup(cont, FileInfo.n.cFileName);
         }
     
    -    fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 0);
    +    if (fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 0))
    +    {
    +        /* Go the extra mile to assure we have a file.  WinNT/2000 seems
    +         * to reliably translate char devices to the path '\\.\device'
    +         * so go ask for the full path.
    +         */
    +        if (os_level >= APR_WIN_NT) {
    +#ifdef APR_HAS_UNICODE_FS
    +            apr_wchar_t tmpname[APR_FILE_MAX];
    +            apr_wchar_t *tmpoff;
    +            if (GetFullPathNameW(wfname, sizeof(tmpname) / sizeof(apr_wchar_t),
    +                                 tmpname, &tmpoff))
    +            {
    +                if ((tmpoff == tmpname + 4) 
    +                    && !wcsncmp(tmpname, L"\\\\.\\", 4))
    +                    finfo->filetype = APR_CHR;
    +            }
    +#else
    +            char tmpname[APR_FILE_MAX];
    +            char *tmpoff;
    +            if (GetFullPathName(fname, sizeof(tmpname), tmpname, &tmpoff))
    +            {
    +                if ((tmpoff == tmpname + 4) 
    +                    && !strncmp(tmpname, "\\\\.\\", 4))
    +                    finfo->filetype = APR_CHR;
    +            }
    +#endif
    +        }
    +    }
         finfo->cntxt = cont;
     
    -    if (filename) {
    +    if (filename && !isroot) {
             finfo->name = filename;
             finfo->valid |= APR_FINFO_NAME;
         }
    
    From ef89046bacaf0b4f3424706d1a92151be6440316 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 16 May 2001 03:47:59 +0000
    Subject: [PATCH 1655/7878]   Needed for the filestat.c change in win32. 
     Should help vanilla VC5   builds that need the symbol.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61646 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/win32/fileio.h | 7 +++++--
     1 file changed, 5 insertions(+), 2 deletions(-)
    
    diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h
    index fd10f56c9e0..de282bc5943 100644
    --- a/include/arch/win32/fileio.h
    +++ b/include/arch/win32/fileio.h
    @@ -119,6 +119,9 @@ apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars,
     
     /* Entries missing from the MSVC 5.0 Win32 SDK:
      */
    +#ifndef FILE_ATTRIBUTE_DEVICE
    +#define FILE_ATTRIBUTE_DEVICE        0x00000040
    +#endif
     #ifndef FILE_ATTRIBUTE_REPARSE_POINT
     #define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
     #endif
    @@ -141,8 +144,8 @@ apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars,
     #define APR_FREADONLY 0x10000000 
     
     /* Private function for apr_stat/lstat/getfileinfo/dir_read */
    -void fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, 
    -                     int byhandle);
    +int fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, 
    +                    int byhandle);
     
     /* Private function that extends apr_stat/lstat/getfileinfo/dir_read */
     apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, 
    
    From af55bd086838621e20d03402df553533e2917ff3 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 16 May 2001 03:49:16 +0000
    Subject: [PATCH 1656/7878]   Those aren't DWORDs, they are apr_size_t.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61647 13f79535-47bb-0310-9956-ffa450edef68
    ---
     misc/unix/errorcodes.c | 5 ++---
     1 file changed, 2 insertions(+), 3 deletions(-)
    
    diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c
    index 63267001a8d..2e8099116af 100644
    --- a/misc/unix/errorcodes.c
    +++ b/misc/unix/errorcodes.c
    @@ -278,15 +278,14 @@ static const struct {
     
     static char *apr_os_strerror(char *buf, apr_size_t bufsize, apr_status_t errcode)
     {
    -    DWORD len;
    -    DWORD i;
    +    apr_size_t len, i;
     
         len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
                             NULL,
                             errcode,
                             MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
                             (LPTSTR) buf,
    -                        bufsize,
    +                        (DWORD)bufsize,
                             NULL);
     
         if (!len) {
    
    From 2e34c2ae3d896c9fcb59b2771993ed508ed5331b Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 16 May 2001 03:52:01 +0000
    Subject: [PATCH 1657/7878]   Hmmm... been sitting on this little test bench a
     while, time to share.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61648 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testnames.c | 23 +++++++++++++++++------
     1 file changed, 17 insertions(+), 6 deletions(-)
    
    diff --git a/test/testnames.c b/test/testnames.c
    index 3468b423e21..f14550342e6 100644
    --- a/test/testnames.c
    +++ b/test/testnames.c
    @@ -70,6 +70,21 @@ static void closeapr(void)
         apr_terminate();
     }
     
    +static void root_result(char *path)
    +{
    +    apr_status_t status;
    +    char errmsg[256];
    +    char *root = NULL;
    +    status = apr_filepath_root(&root, &path, context);
    +    apr_strerror(status, errmsg, sizeof(errmsg));
    +    if (root)
    +        fprintf(stderr, "\tRoot \"%s\" Path \"%s\" (%s)\n", 
    +                root, path, errmsg);
    +    else
    +        fprintf(stderr, "\tPath \"%s\" Error (%s)\n", 
    +                path, errmsg);
    +}
    +
     static void mergeresult(char *rootpath, char *addpath, apr_int32_t mergetype, char *tdesc)
     {
         char errmsg[256];
    @@ -82,12 +97,6 @@ static void mergeresult(char *rootpath, char *addpath, apr_int32_t mergetype, ch
         apr_strerror(status, errmsg, sizeof(errmsg));
         if (dstpath) {
             fprintf(stderr, "%s result for %s\n\tResult Path \"%s\"\n", errmsg, tdesc, dstpath);
    -        srcpath = dstpath;
    -        status = apr_filepath_root(&dstpath, &srcpath, context);
    -        if (srcpath != dstpath) {
    -            apr_strerror(status, errmsg, sizeof(errmsg));
    -            fprintf(stderr, "\tRoot of \"%s\" (%s)\n", dstpath, errmsg);
    -        }
         }
         else {
             fprintf(stderr, "%s result for %s\n", errmsg, tdesc);
    @@ -132,6 +141,8 @@ int main(void)
             merge_result(rootpath, addpath, APR_FILEPATH_SECUREROOT);
             merge_result(rootpath, addpath, APR_FILEPATH_NOTABSOLUTE);
             merge_result(rootpath, addpath, APR_FILEPATH_NOTRELATIVE);
    +        root_result(rootpath);
    +        root_result(addpath);
         }
         return (0);
     }
    
    From 153382cfdabe70be3604dcf4b8b8d3b7fdf071d2 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 16 May 2001 05:30:52 +0000
    Subject: [PATCH 1658/7878]   Sing, "we are apr"...  and make all hash
     functions accept apr_ssize_t   if we are going to bury -1 flags (I'd prefer
     the flag cast to apr_size_t   and use that value throughout the hash api,
     however.)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61649 13f79535-47bb-0310-9956-ffa450edef68
    ---
     i18n/unix/utf8_ucs2.c   | 11 ++++++++---
     include/apr_hash.h      |  6 +++---
     include/apr_strings.h   |  8 ++++----
     lib/apr_pools.c         |  8 ++++----
     memory/unix/apr_pools.c |  8 ++++----
     misc/unix/getopt.c      |  2 +-
     strings/apr_snprintf.c  |  8 ++++----
     tables/apr_hash.c       | 12 ++++++------
     tables/apr_tables.c     |  3 ++-
     9 files changed, 36 insertions(+), 30 deletions(-)
    
    diff --git a/i18n/unix/utf8_ucs2.c b/i18n/unix/utf8_ucs2.c
    index 68336c6543d..15cb411a5ef 100644
    --- a/i18n/unix/utf8_ucs2.c
    +++ b/i18n/unix/utf8_ucs2.c
    @@ -102,7 +102,8 @@ apr_status_t conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes,
                                    apr_wchar_t *out, apr_size_t *outwords)
     {
         apr_int64_t newch, mask;
    -    int ch, expect, eating;
    +    apr_size_t expect, eating;
    +    int ch;
         
         while (*inbytes && *outwords) 
         {
    @@ -167,7 +168,10 @@ apr_status_t conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes,
                                 return APR_EINVAL;
                         }
                     }
    -                if (*outwords < (expect > 2) + 1) 
    +                /* Where the boolean (expect > 2) is true, we will need
    +                 * an extra word for the output.
    +                 */
    +                if (*outwords < (apr_size_t)(expect > 2) + 1) 
                         break; /* buffer full */
                     while (expect--)
                     {
    @@ -207,8 +211,9 @@ apr_status_t conv_ucs2_to_utf8(const apr_wchar_t *in, apr_size_t *inwords,
                                    char *out, apr_size_t *outbytes)
     {
         apr_int64_t newch, require;
    +    apr_size_t need;
         char *invout;
    -    int ch, need;
    +    int ch;
         
         while (*inwords && *outbytes) 
         {
    diff --git a/include/apr_hash.h b/include/apr_hash.h
    index c17a208515c..4548905eb8d 100644
    --- a/include/apr_hash.h
    +++ b/include/apr_hash.h
    @@ -119,7 +119,7 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key,
      * @param key Pointer to the key
      * @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string length.
      * @return Returns NULL if the key is not present.
    - * @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, apr_size_t klen)
    + * @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, apr_ssize_t klen)
      */
     APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key,
                                      apr_ssize_t klen);
    @@ -168,10 +168,10 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi);
      * @param val Return pointer for the associated value.
      * @tip The return pointers should point to a variable that will be set to the
      *      corresponding data, or they may be NULL if the data isn't interesting.
    - * @deffunc void apr_hash_this(apr_hash_index_t *hi, const void **key, apr_size_t *klen, void **val);
    + * @deffunc void apr_hash_this(apr_hash_index_t *hi, const void **key, apr_ssize_t *klen, void **val);
      */
     APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, 
    -                                apr_size_t *klen, void **val);
    +                                apr_ssize_t *klen, void **val);
     
     /**
      * Get the number of key/value pairs in the hash table.
    diff --git a/include/apr_strings.h b/include/apr_strings.h
    index 85d070273cb..a381855eb9b 100644
    --- a/include/apr_strings.h
    +++ b/include/apr_strings.h
    @@ -244,9 +244,9 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str,
      * @param len The size of the buffer
      * @param format The format string
      * @param ... The arguments to use to fill out the format string.
    - * @deffunc int apr_snprintf(char *buf, size_t len, const char *format, ...)
    + * @deffunc int apr_snprintf(char *buf, apr_size_t len, const char *format, ...)
      */
    -APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, size_t len,
    +APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len,
                                          const char *format, ...)
             __attribute__((format(printf,3,4)));
     
    @@ -257,9 +257,9 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, size_t len,
      * @param len The size of the buffer
      * @param format The format string
      * @param ap The arguments to use to fill out the format string.
    - * @deffunc int apr_vsnprintf(char *buf, size_t len, const char *format, va_list ap)
    + * @deffunc int apr_vsnprintf(char *buf, apr_size_t len, const char *format, va_list ap)
      */
    -APR_DECLARE(int) apr_vsnprintf(char *buf, size_t len, const char *format,
    +APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format,
                                    va_list ap);
     
     #ifdef __cplusplus
    diff --git a/lib/apr_pools.c b/lib/apr_pools.c
    index 7d34df7ffc9..4a87c987cdd 100644
    --- a/lib/apr_pools.c
    +++ b/lib/apr_pools.c
    @@ -347,7 +347,7 @@ static void *mprotect_realloc(void *addr, apr_size_t size)
      * Get a completely new block from the system pool. Note that we rely on
      * malloc() to provide aligned memory.
      */
    -static union block_hdr *malloc_block(int size, apr_abortfunc_t abortfunc)
    +static union block_hdr *malloc_block(apr_size_t size, apr_abortfunc_t abortfunc)
     {
         union block_hdr *blok;
     
    @@ -506,7 +506,7 @@ static void free_blocks(union block_hdr *blok)
      * Get a new block, from our own free list if possible, from the system
      * if necessary.  Must be called with alarms blocked.
      */
    -static union block_hdr *new_block(int min_size, apr_abortfunc_t abortfunc)
    +static union block_hdr *new_block(apr_size_t min_size, apr_abortfunc_t abortfunc)
     {
         union block_hdr **lastptr = &block_freelist;
         union block_hdr *blok = block_freelist;
    @@ -516,7 +516,7 @@ static union block_hdr *new_block(int min_size, apr_abortfunc_t abortfunc)
          */
     
         while (blok != NULL) {
    -	if (min_size + BLOCK_MINFREE <= blok->h.endp - blok->h.first_avail) {
    +	if ((apr_ssize_t)min_size + BLOCK_MINFREE <= blok->h.endp - blok->h.first_avail) {
     	    *lastptr = blok->h.next;
     	    blok->h.next = NULL;
     	    debug_verify_filled(blok->h.first_avail, blok->h.endp,
    @@ -1169,7 +1169,7 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *ke
     			      apr_status_t (*cleanup) (void *),
     			      apr_pool_t *cont)
     {
    -    int keylen = strlen(key);
    +    apr_size_t keylen = strlen(key);
     
         if (cont->prog_data == NULL)
             cont->prog_data = apr_hash_make(cont);
    diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
    index 7d34df7ffc9..4a87c987cdd 100644
    --- a/memory/unix/apr_pools.c
    +++ b/memory/unix/apr_pools.c
    @@ -347,7 +347,7 @@ static void *mprotect_realloc(void *addr, apr_size_t size)
      * Get a completely new block from the system pool. Note that we rely on
      * malloc() to provide aligned memory.
      */
    -static union block_hdr *malloc_block(int size, apr_abortfunc_t abortfunc)
    +static union block_hdr *malloc_block(apr_size_t size, apr_abortfunc_t abortfunc)
     {
         union block_hdr *blok;
     
    @@ -506,7 +506,7 @@ static void free_blocks(union block_hdr *blok)
      * Get a new block, from our own free list if possible, from the system
      * if necessary.  Must be called with alarms blocked.
      */
    -static union block_hdr *new_block(int min_size, apr_abortfunc_t abortfunc)
    +static union block_hdr *new_block(apr_size_t min_size, apr_abortfunc_t abortfunc)
     {
         union block_hdr **lastptr = &block_freelist;
         union block_hdr *blok = block_freelist;
    @@ -516,7 +516,7 @@ static union block_hdr *new_block(int min_size, apr_abortfunc_t abortfunc)
          */
     
         while (blok != NULL) {
    -	if (min_size + BLOCK_MINFREE <= blok->h.endp - blok->h.first_avail) {
    +	if ((apr_ssize_t)min_size + BLOCK_MINFREE <= blok->h.endp - blok->h.first_avail) {
     	    *lastptr = blok->h.next;
     	    blok->h.next = NULL;
     	    debug_verify_filled(blok->h.first_avail, blok->h.endp,
    @@ -1169,7 +1169,7 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *ke
     			      apr_status_t (*cleanup) (void *),
     			      apr_pool_t *cont)
     {
    -    int keylen = strlen(key);
    +    apr_size_t keylen = strlen(key);
     
         if (cont->prog_data == NULL)
             cont->prog_data = apr_hash_make(cont);
    diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c
    index 40378d20d03..b14b8c9fec9 100644
    --- a/misc/unix/getopt.c
    +++ b/misc/unix/getopt.c
    @@ -239,7 +239,7 @@ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os,
     	p = os->argv[os->ind++] + 1;
     	if (*p == '-' && p[1] != '\0') {        /* Long option */
     	    /* Search for the long option name in the caller's table. */
    -	    int len = 0;
    +	    apr_size_t len = 0;
     
     	    p++;
     	    for (i = 0; ; i++) {
    diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c
    index 5bccc15b5a2..2973191bfc5 100644
    --- a/strings/apr_snprintf.c
    +++ b/strings/apr_snprintf.c
    @@ -1199,7 +1199,7 @@ static int snprintf_flush(apr_vformatter_buff_t *vbuff)
     }
     
     
    -APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, size_t len, 
    +APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, 
                                        const char *format, ...)
     {
         int cc;
    @@ -1216,11 +1216,11 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, size_t len,
         cc = apr_vformatter(snprintf_flush, &vbuff, format, ap);
         va_end(ap);
         *vbuff.curpos = '\0';
    -    return (cc == -1) ? len : cc;
    +    return (cc == -1) ? (int)len : cc;
     }
     
     
    -APR_DECLARE(int) apr_vsnprintf(char *buf, size_t len, const char *format,
    +APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format,
     			     va_list ap)
     {
         int cc;
    @@ -1234,5 +1234,5 @@ APR_DECLARE(int) apr_vsnprintf(char *buf, size_t len, const char *format,
         vbuff.endpos = buf + len - 1;
         cc = apr_vformatter(snprintf_flush, &vbuff, format, ap);
         *vbuff.curpos = '\0';
    -    return (cc == -1) ? len : cc;
    +    return (cc == -1) ? (int)len : cc;
     }
    diff --git a/tables/apr_hash.c b/tables/apr_hash.c
    index 4da4020163e..36409e35401 100644
    --- a/tables/apr_hash.c
    +++ b/tables/apr_hash.c
    @@ -86,7 +86,7 @@ struct apr_hash_entry_t {
         apr_hash_entry_t	*next;
         int			 hash;
         const void		*key;
    -    apr_size_t		 klen;
    +    apr_ssize_t		 klen;
         const void		*val;
     };
     
    @@ -168,7 +168,7 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht)
     
     APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi,
     			       const void **key,
    -			       apr_size_t *klen,
    +			       apr_ssize_t *klen,
     			       void **val)
     {
         if (key)  *key  = hi->this->key;
    @@ -209,14 +209,14 @@ static void expand_array(apr_hash_t *ht)
      */
     
     static apr_hash_entry_t **find_entry(apr_hash_t *ht,
    -				    const void *key,
    -				    apr_ssize_t klen,
    -				    const void *val)
    +				     const void *key,
    +				     apr_ssize_t klen,
    +				     const void *val)
     {
         apr_hash_entry_t **hep, *he;
         const unsigned char *p;
         int hash;
    -    int i;
    +    apr_ssize_t i;
     
         if (klen == APR_HASH_KEY_STRING)
     	klen = strlen(key);
    diff --git a/tables/apr_tables.c b/tables/apr_tables.c
    index ef6bc17e2e8..b2cf518db17 100644
    --- a/tables/apr_tables.c
    +++ b/tables/apr_tables.c
    @@ -221,7 +221,8 @@ APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p,
     				     const char sep)
     {
         char *cp, *res, **strpp;
    -    int i, len;
    +    apr_size_t len;
    +    int i;
     
         if (arr->nelts <= 0 || arr->elts == NULL) {    /* Empty table? */
             return (char *) apr_pcalloc(p, 1);
    
    From 7a55823a6fa913417f0e316ebeabad68f0564ebd Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 16 May 2001 05:33:27 +0000
    Subject: [PATCH 1659/7878]   A touch of fixes for win32.  Lots more wrong
     apr_size_t vs apr_off_t   assumptions to correct, though.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61650 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/readwrite.c   | 4 ++--
     include/apr.hw              | 2 +-
     network_io/win32/sendrecv.c | 2 +-
     threadproc/win32/proc.c     | 2 +-
     4 files changed, 5 insertions(+), 5 deletions(-)
    
    diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c
    index 46275a96cda..64ab1f27b38 100644
    --- a/file_io/win32/readwrite.c
    +++ b/file_io/win32/readwrite.c
    @@ -236,7 +236,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a
     
             if (thefile->direction == 0) {
                 // Position file pointer for writing at the offset we are logically reading from
    -            apr_size_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos;
    +            apr_off_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos;
                 if (offset != thefile->filePtr)
                     SetFilePointer(thefile->filehand, offset, NULL, FILE_BEGIN);
                 thefile->bufpos = thefile->dataRead = 0;
    @@ -282,7 +282,7 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile,
                                          apr_size_t *nbytes)
     {
         apr_status_t rv = APR_SUCCESS;
    -    int i;
    +    apr_size_t i;
         DWORD bwrote = 0;
         char *buf;
     
    diff --git a/include/apr.hw b/include/apr.hw
    index 756539eb7d8..442b6ad67cd 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -229,7 +229,7 @@ typedef  unsigned __int64  apr_uint64_t;
     typedef  size_t      apr_size_t;
     typedef  ptrdiff_t   apr_ssize_t;
     typedef  _off_t      apr_off_t;
    -typedef  size_t      apr_socklen_t;
    +typedef  int         apr_socklen_t;
     typedef  int         pid_t;
     typedef  int         uid_t;
     typedef  int         gid_t;
    diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c
    index 812475d63be..865dbca6bcb 100644
    --- a/network_io/win32/sendrecv.c
    +++ b/network_io/win32/sendrecv.c
    @@ -121,7 +121,7 @@ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf,
     
     APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock,
                                         const struct iovec *vec,
    -                                    apr_int32_t nvec, apr_int32_t *nbytes)
    +                                    apr_int32_t nvec, apr_size_t *nbytes)
     {
         apr_ssize_t rv;
         int i;
    diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c
    index 6ddeb626499..394f871112b 100644
    --- a/threadproc/win32/proc.c
    +++ b/threadproc/win32/proc.c
    @@ -323,7 +323,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
                                                  apr_procattr_t *attr,
                                                  apr_pool_t *cont)
     {
    -    int i, iEnvBlockLen;
    +    apr_size_t i, iEnvBlockLen;
         char *cmdline;
         char ppid[20];
         char *envstr;
    
    From 7099ba394f06138fe0188f7bf36713968938bad4 Mon Sep 17 00:00:00 2001
    From: Bill Stoddard 
    Date: Wed, 16 May 2001 18:11:51 +0000
    Subject: [PATCH 1660/7878] Make the other child struct a bit more portable wrt
     to the file descriptor.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61651 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/unix/misc.h  | 3 ++-
     include/arch/win32/misc.h | 3 ++-
     2 files changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h
    index 696943772ca..8b79f03afc5 100644
    --- a/include/arch/unix/misc.h
    +++ b/include/arch/unix/misc.h
    @@ -56,6 +56,7 @@
     #define MISC_H
     
     #include "apr.h"
    +#include "apr_portable.h"
     #include "apr_private.h"
     #include "apr_general.h"
     #include "apr_pools.h"
    @@ -92,7 +93,7 @@ struct apr_other_child_rec_t {
         int id;  /* This is either a pid or tid depending on the platform */
         void (*maintenance) (int, void *, int);
         void *data;
    -    int write_fd;
    +    apr_os_file_t write_fd;
     };
     
     #ifdef WIN32
    diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h
    index 696943772ca..8b79f03afc5 100644
    --- a/include/arch/win32/misc.h
    +++ b/include/arch/win32/misc.h
    @@ -56,6 +56,7 @@
     #define MISC_H
     
     #include "apr.h"
    +#include "apr_portable.h"
     #include "apr_private.h"
     #include "apr_general.h"
     #include "apr_pools.h"
    @@ -92,7 +93,7 @@ struct apr_other_child_rec_t {
         int id;  /* This is either a pid or tid depending on the platform */
         void (*maintenance) (int, void *, int);
         void *data;
    -    int write_fd;
    +    apr_os_file_t write_fd;
     };
     
     #ifdef WIN32
    
    From 4d5589a8c6d96b719601873a93ecefa86c018349 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 16 May 2001 19:14:50 +0000
    Subject: [PATCH 1661/7878] Automatically remove other-child registrations when
     the associated pool is destroyed.  This avoids garbage in the list of
     registrations when a pool with a registration is freed.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61652 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                   |  5 +++++
     include/arch/unix/misc.h  |  1 +
     include/arch/win32/misc.h |  1 +
     misc/unix/otherchild.c    | 37 +++++++++++++++++++++++++++++--------
     4 files changed, 36 insertions(+), 8 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 14962ac005a..13897af4489 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,10 @@
     Changes with APR b1  
     
    +  *) Other-child registrations are automatically removed when the
    +     associated pool is destroyed.  This avoids garbage in the list
    +     of registrations when a pool with a registration is freed.
    +     [Jeff Trawick]
    +
       *) Allow LTFLAGS to be overridden by the configure command-line 
          (default="--silent") and introduce LT_LDFLAGS.  [Roy Fielding]
     
    diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h
    index 8b79f03afc5..e896f1224d1 100644
    --- a/include/arch/unix/misc.h
    +++ b/include/arch/unix/misc.h
    @@ -89,6 +89,7 @@
     #endif
     
     struct apr_other_child_rec_t {
    +    apr_pool_t *p;
         struct apr_other_child_rec_t *next;
         int id;  /* This is either a pid or tid depending on the platform */
         void (*maintenance) (int, void *, int);
    diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h
    index 8b79f03afc5..e896f1224d1 100644
    --- a/include/arch/win32/misc.h
    +++ b/include/arch/win32/misc.h
    @@ -89,6 +89,7 @@
     #endif
     
     struct apr_other_child_rec_t {
    +    apr_pool_t *p;
         struct apr_other_child_rec_t *next;
         int id;  /* This is either a pid or tid depending on the platform */
         void (*maintenance) (int, void *, int);
    diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c
    index 8ebe698513b..b263392a7b8 100644
    --- a/misc/unix/otherchild.c
    +++ b/misc/unix/otherchild.c
    @@ -74,6 +74,22 @@
     
     static apr_other_child_rec_t *other_children = NULL;
     
    +static apr_status_t other_child_cleanup(void *data)
    +{
    +    apr_other_child_rec_t **pocr, *nocr;
    +
    +    for (pocr = &other_children; *pocr; pocr = &(*pocr)->next) {
    +        if ((*pocr)->data == data) {
    +            nocr = (*pocr)->next;
    +            (*(*pocr)->maintenance) (APR_OC_REASON_UNREGISTER, (*pocr)->data, -1);
    +            *pocr = nocr;
    +            /* XXX: um, well we've just wasted some space in pconf ? */
    +            return APR_SUCCESS;
    +        }
    +    }
    +    return APR_SUCCESS;
    +}
    +
     APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid,
                          void (*maintenance) (int reason, void *, int status),
                          void *data, apr_file_t *write_fd, apr_pool_t *p)
    @@ -81,6 +97,7 @@ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid,
         apr_other_child_rec_t *ocr;
     
         ocr = apr_palloc(p, sizeof(*ocr));
    +    ocr->p = p;
         ocr->id = pid->pid;
         ocr->maintenance = maintenance;
         ocr->data = data;
    @@ -92,21 +109,25 @@ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid,
         }
         ocr->next = other_children;
         other_children = ocr;
    +    apr_pool_cleanup_register(p, ocr->data, other_child_cleanup, 
    +                              apr_pool_cleanup_null);
     }
     
     APR_DECLARE(void) apr_proc_other_child_unregister(void *data)
     {
    -    apr_other_child_rec_t **pocr, *nocr;
    +    apr_other_child_rec_t *cur;
     
    -    for (pocr = &other_children; *pocr; pocr = &(*pocr)->next) {
    -        if ((*pocr)->data == data) {
    -            nocr = (*pocr)->next;
    -            (*(*pocr)->maintenance) (APR_OC_REASON_UNREGISTER, (*pocr)->data, -1);
    -            *pocr = nocr;
    -            /* XXX: um, well we've just wasted some space in pconf ? */
    -            return;
    +    cur = other_children;
    +    while (cur) {
    +        if (cur->data == data) {
    +            break;
             }
    +        cur = cur->next;
         }
    +
    +    /* segfault if this function called with invalid parm */
    +    apr_pool_cleanup_kill(cur->p, cur->data, other_child_cleanup);
    +    other_child_cleanup(data);
     }
     
     /* test to ensure that the write_fds are all still writable, otherwise
    
    From ee84f7d0acb2118dcd60ae0ce91bce0a382bb126 Mon Sep 17 00:00:00 2001
    From: Bill Stoddard 
    Date: Wed, 16 May 2001 20:56:01 +0000
    Subject: [PATCH 1662/7878] Remove apr_proc_probe_writable_fds
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61653 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_thread_proc.h |  7 ------
     misc/unix/otherchild.c    | 50 ---------------------------------------
     test/testoc.c             |  1 -
     3 files changed, 58 deletions(-)
    
    diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h
    index 16ae54fea29..cb3f5ef4c9d 100644
    --- a/include/apr_thread_proc.h
    +++ b/include/apr_thread_proc.h
    @@ -554,13 +554,6 @@ APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *pid, int status)
      */
     APR_DECLARE(void) apr_proc_other_child_check(void); 
     
    -/**
    - * Ensure all the registered write_fds are still writable, otherwise 
    - * invoke the maintenance functions as appropriate.
    - * @deffunc void apr_proc_probe_writable_fds()
    - */
    -APR_DECLARE(void) apr_proc_probe_writable_fds(void);
    -
     #endif /* APR_HAS_OTHER_CHILD */
     
     /** 
    diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c
    index b263392a7b8..b102ddcf64d 100644
    --- a/misc/unix/otherchild.c
    +++ b/misc/unix/otherchild.c
    @@ -130,56 +130,6 @@ APR_DECLARE(void) apr_proc_other_child_unregister(void *data)
         other_child_cleanup(data);
     }
     
    -/* test to ensure that the write_fds are all still writable, otherwise
    - * invoke the maintenance functions as appropriate */
    -void apr_proc_probe_writable_fds(void)
    -{
    -    fd_set writable_fds;
    -    int fd_max;
    -    apr_other_child_rec_t *ocr, *nocr; 
    -    struct timeval tv; 
    -    int rc;
    -
    -    if (other_children == NULL)
    -        return;
    -
    -    fd_max = 0;
    -    FD_ZERO(&writable_fds);
    -    do {
    -        for (ocr = other_children; ocr; ocr = ocr->next) {
    -            if (ocr->write_fd == -1)
    -                continue;
    -            FD_SET(ocr->write_fd, &writable_fds);
    -            if (ocr->write_fd > fd_max) {
    -                fd_max = ocr->write_fd;
    -            }
    -        }
    -        if (fd_max == 0)
    -            return;
    -
    -        tv.tv_sec = 0;
    -        tv.tv_usec = 0;
    -        rc = select(fd_max + 1, NULL, &writable_fds, NULL, &tv);
    -    } while (rc == -1 && errno == EINTR);
    -
    -    if (rc == -1) {
    -        /* XXX: uhh this could be really bad, we could have a bad file
    -         * descriptor due to a bug in one of the maintenance routines */
    -        return;
    -    }
    -    if (rc == 0)
    -        return;
    -
    -    for (ocr = other_children; ocr; ocr = nocr) {
    -        nocr = ocr->next;
    -        if (ocr->write_fd == -1)
    -            continue;
    -        if (FD_ISSET(ocr->write_fd, &writable_fds))
    -            continue;
    -        (*ocr->maintenance) (APR_OC_REASON_UNWRITABLE, ocr->data, -1);
    -    }
    -}
    -
     APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *pid, int status)
     {
         apr_other_child_rec_t *ocr, *nocr;
    diff --git a/test/testoc.c b/test/testoc.c
    index 8d0896b630e..c5c084d20d9 100644
    --- a/test/testoc.c
    +++ b/test/testoc.c
    @@ -147,7 +147,6 @@ int main(int argc, char *argv[])
         
         /* allow time for things to settle... */
         apr_sleep(3 * APR_USEC_PER_SEC);
    -    apr_proc_probe_writable_fds();
         
         fprintf(stdout, "[PARENT] Checking on children..........\n");
         apr_proc_other_child_check();
    
    From e5172bd056ad19f0821c39e9246c6abc23774de6 Mon Sep 17 00:00:00 2001
    From: Bill Stoddard 
    Date: Thu, 17 May 2001 12:20:01 +0000
    Subject: [PATCH 1663/7878] Add APR_HAS_OTHER_CHILD support to Win32
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61654 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                |  1 +
     apr.dsp                | 15 +++++++++------
     include/apr.hw         |  2 +-
     libapr.dsp             |  4 ++++
     misc/unix/otherchild.c | 40 +++++++++++++++++++++++++++++++++++++++-
     5 files changed, 54 insertions(+), 8 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 13897af4489..5ce7ad04afe 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,4 +1,5 @@
     Changes with APR b1  
    +  *) Add other child support to Win32 [Bill Stoddard]
     
       *) Other-child registrations are automatically removed when the
          associated pool is destroyed.  This avoids garbage in the list
    diff --git a/apr.dsp b/apr.dsp
    index 588986ddf45..f8977f7e335 100644
    --- a/apr.dsp
    +++ b/apr.dsp
    @@ -26,6 +26,7 @@ CFG=apr - Win32 Debug
     # PROP Scc_ProjName ""
     # PROP Scc_LocalPath ""
     CPP=cl.exe
    +RSC=rc.exe
     
     !IF  "$(CFG)" == "apr - Win32 Release"
     
    @@ -39,11 +40,10 @@ CPP=cl.exe
     # PROP Output_Dir "LibR"
     # PROP Intermediate_Dir "LibR"
     # PROP Target_Dir ""
    -RSC=rc.exe
    -# ADD BASE RSC /l 0x409
    -# ADD RSC /l 0x409
     # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
     # ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c
    +# ADD BASE RSC /l 0x409
    +# ADD RSC /l 0x409
     BSC32=bscmake.exe
     # ADD BASE BSC32 /nologo
     # ADD BSC32 /nologo
    @@ -64,11 +64,10 @@ LIB32=link.exe -lib
     # PROP Intermediate_Dir "LibD"
     # PROP Ignore_Export_Lib 0
     # PROP Target_Dir ""
    -RSC=rc.exe
    -# ADD BASE RSC /l 0x409
    -# ADD RSC /l 0x409
     # ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
     # ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c
    +# ADD BASE RSC /l 0x409
    +# ADD RSC /l 0x409
     BSC32=bscmake.exe
     # ADD BASE BSC32 /nologo
     # ADD BSC32 /nologo
    @@ -182,6 +181,10 @@ SOURCE=.\misc\win32\names.c
     # End Source File
     # Begin Source File
     
    +SOURCE=.\misc\unix\otherchild.c
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\misc\win32\rand.c
     # End Source File
     # Begin Source File
    diff --git a/include/apr.hw b/include/apr.hw
    index 442b6ad67cd..236adc2b85d 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -198,7 +198,7 @@
     #define APR_HAS_FORK              0
     #define APR_HAS_RANDOM            1
     #define APR_HAS_XLATE             0
    -#define APR_HAS_OTHER_CHILD       0
    +#define APR_HAS_OTHER_CHILD       1
     #define APR_HAS_DSO               1
     #define APR_HAS_UNICODE_FS        1
     #define APR_HAS_USER              1
    diff --git a/libapr.dsp b/libapr.dsp
    index 4b8fead0ff5..c20f8113203 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -187,6 +187,10 @@ SOURCE=.\misc\win32\names.c
     # End Source File
     # Begin Source File
     
    +SOURCE=.\misc\unix\otherchild.c
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\misc\win32\rand.c
     # End Source File
     # Begin Source File
    diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c
    index b102ddcf64d..62896b8cbee 100644
    --- a/misc/unix/otherchild.c
    +++ b/misc/unix/otherchild.c
    @@ -102,10 +102,18 @@ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid,
         ocr->maintenance = maintenance;
         ocr->data = data;
         if (write_fd == NULL) {
    -        ocr->write_fd = -1;
    +        ocr->write_fd = (apr_os_file_t) -1;
         }
         else {
    +#ifdef WIN32
    +        /* This should either go away as part of eliminating apr_proc_probe_writable_fds
    +         * or write_fd should point to an apr_file_t
    +         */
    +        ocr->write_fd = write_fd->filehand; 
    +#else
             ocr->write_fd = write_fd->filedes;
    +#endif
    +
         }
         ocr->next = other_children;
         other_children = ocr;
    @@ -145,7 +153,36 @@ APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *pid, int status)
         }
         return APR_CHILD_NOTDONE;
     }
    +#ifdef WIN32
    +/*
    + * Run the list of Other Children and restart the ones that have died.
    + * ToDo: APR'ize this function so it will serve Unix and Win32.
    + * Not clear to me how to make the Win32 function behave exactly like
    + * the non-win32 branch. wgs
    + */
    +APR_DECLARE(void) apr_proc_other_child_check(void)
    +{
    +    apr_other_child_rec_t *ocr, *nocr;
    +    apr_status_t rv;
    +
    +    /* Todo: 
    +     * Implement code to detect if a pipe is still alive on Windows.
    +     */
    +    if (other_children == NULL)
    +        return;
     
    +    for (ocr = other_children; ocr; ocr = nocr) {
    +        nocr = ocr->next;
    +        if (ocr->id == -1)
    +            continue;
    +
    +        rv = WaitForSingleObject((HANDLE) ocr->id, 0);
    +        if (rv != WAIT_TIMEOUT) {
    +            (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1);
    +        }
    +    }
    +}
    +#else /* Win32 */
     APR_DECLARE(void) apr_proc_other_child_check(void)
     {
         apr_other_child_rec_t *ocr, *nocr;
    @@ -172,5 +209,6 @@ APR_DECLARE(void) apr_proc_other_child_check(void)
             }
         }
     }
    +#endif
     
     #endif /* APR_HAS_OTHER_CHILD */
    
    From aa09eb2f9a749409ccee65d7e8c215c96e46bdcb Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 17 May 2001 13:36:44 +0000
    Subject: [PATCH 1664/7878]   There is a list of pending renames in apr...
     comments folks?
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61655 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 16 +++-------------
     1 file changed, 3 insertions(+), 13 deletions(-)
    
    diff --git a/STATUS b/STATUS
    index a0dca88d76f..ea9a830161c 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -1,5 +1,5 @@
     APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS:			-*-text-*-
    -Last modified at [$Date: 2001/05/15 14:48:50 $]
    +Last modified at [$Date: 2001/05/17 13:36:44 $]
     
     Release:
     
    @@ -15,14 +15,6 @@ Release:
     
     RELEASE SHOWSTOPPERS:
     
    -    * Unix apr_stat/lstat/getfileinfo were very fast hacks, needs review.
    -        Ignore APR_FINFO_NAME issues for b1, I've noted that issue below.
    -        OtherBill asks has someone done so?
    -
    -    * OS2 apr_stat/lstat/getfileinfo/dir_read were very fast hacks, need
    -        cleanup, toggle messy (APR_INCOMPLETE) result when appropriate.
    -        OtherBill asks has someone done so?
    -
         * complete the efforts started by DougM for cleaner fn naming
           conventions: see proposed name changes in renames_pending
           and offer up any additions/vetos/clarifications.
    @@ -38,10 +30,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
           calls getaddrinfo() is bogus and causes undesired DNS requests.
             Status: Jeff will look into this
     
    -    * Solve Win32 APR_CHR, APR_BLK, etc for Win32 apr_stat without 
    -        GetFileType?  How about inode/dev/nlink?
    -        Status: OtherBill's WIP
    -
         * SysV semaphore support isn't usable by Apache when started as
           root because we don't have a way to allow the semaphore to be
           used by the configured User and Group.  Current work-around:
    @@ -129,6 +117,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
         * need to export the shared library extension (e.g. ".so") for the
           platform. clients need to use this to construct filenames to
           pass to apr_dso_load()
    +      -- note on Win32 we distinguish 'apache module' names from other 
    +         'loadable module' names, so be careful with Apache's directive.
     
         * may be good to have a --disable-ipv6 configure option
     
    
    From f4aee572684594661577ef7c3f1faa772d418787 Mon Sep 17 00:00:00 2001
    From: "Roy T. Fielding" 
    Date: Thu, 17 May 2001 22:25:57 +0000
    Subject: [PATCH 1665/7878] Do the cleans in test and build the right way, like
     apr-util.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61656 13f79535-47bb-0310-9956-ffa450edef68
    ---
     Makefile.in       |  1 +
     build/Makefile.in |  3 ---
     build/rules.mk.in | 19 ++++++-------------
     3 files changed, 7 insertions(+), 16 deletions(-)
    
    diff --git a/Makefile.in b/Makefile.in
    index 1184d0f6345..2f06f03ce4c 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -13,6 +13,7 @@ INCLUDES=-I$(INCDIR) -I$(INCDIR1)
     # Macros for target determination
     #
     SUBDIRS=@SUBDIRS@
    +CLEAN_SUBDIRS= . test build
     
     TARGET_LIB = libapr.la
     TARGET_EXPORTS = apr.exports
    diff --git a/build/Makefile.in b/build/Makefile.in
    index 7302da7e1f6..c486d6941b3 100644
    --- a/build/Makefile.in
    +++ b/build/Makefile.in
    @@ -5,7 +5,4 @@ DISTCLEAN_TARGETS = rules.mk
     # bring in rules.mk for standard functionality
     @INCLUDE_RULES@
     
    -x-local-all x-local-depend x-local-clean:
    -	@echo "Congratulations -- make has successfully completed"
    -
     # DO NOT REMOVE
    diff --git a/build/rules.mk.in b/build/rules.mk.in
    index 4c128f4e1a3..1664bb11b9c 100644
    --- a/build/rules.mk.in
    +++ b/build/rules.mk.in
    @@ -138,7 +138,10 @@ install: all-recursive
     all-recursive depend-recursive clean-recursive distclean-recursive \
       extraclean-recursive:
     	@otarget=`echo $@ | sed s/-recursive//`; \
    -	list='$(SUBDIRS)'; \
    +	case $$otarget in \
    +	    *clean) list='$(SUBDIRS) $(CLEAN_SUBDIRS)';; \
    +	    *)      list='$(SUBDIRS)';; \
    +	esac; \
     	for i in $$list; do \
     	    if test -d "$$i"; then \
     		target="$$otarget"; \
    @@ -151,20 +154,10 @@ all-recursive depend-recursive clean-recursive distclean-recursive \
     	    fi; \
     	done; \
             if test "$$otarget" = "all" && test -z "$(TARGETS)"; then \
    -	    made_local=n/a; \
    +	    made_local=yes; \
     	fi; \
    -	if test -z "$$made_local"; then \
    +	if test "$$made_local" != "yes"; then \
     	    $(MAKE) "local-$$otarget" || exit 1; \
    -	fi; \
    -	case $$otarget in *clean) \
    -	    if test -d "test"; then \
    -	        echo "Making local-$$otarget in test"; \
    -	        (cd test && $(MAKE) local-$$otarget) || exit 1; \
    -	    fi ;; \
    -	esac; \
    -	if test -d "build"; then \
    -	    echo "Making local-$$otarget in build"; \
    -	    (cd build && $(MAKE) local-$$otarget) || exit 1; \
     	fi
     
     local-clean: x-local-clean
    
    From f8e72fbab7f604a0e4d9f7f4a2c7ff5285f4e7ef Mon Sep 17 00:00:00 2001
    From: "Roy T. Fielding" 
    Date: Thu, 17 May 2001 23:15:14 +0000
    Subject: [PATCH 1666/7878] I wish I'd thought of this first...
    
    We don't want a make *clean to stop just because one of the subdirs
    has already been cleaned.  Separating the recursive clean rules from
    the recursive build rules allows us to make that distinction.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61657 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/rules.mk.in | 45 ++++++++++++++++++++++++++++++---------------
     1 file changed, 30 insertions(+), 15 deletions(-)
    
    diff --git a/build/rules.mk.in b/build/rules.mk.in
    index 1664bb11b9c..db6a2576512 100644
    --- a/build/rules.mk.in
    +++ b/build/rules.mk.in
    @@ -135,13 +135,9 @@ extraclean: extraclean-recursive
     install: all-recursive
     
     
    -all-recursive depend-recursive clean-recursive distclean-recursive \
    -  extraclean-recursive:
    +all-recursive depend-recursive:
     	@otarget=`echo $@ | sed s/-recursive//`; \
    -	case $$otarget in \
    -	    *clean) list='$(SUBDIRS) $(CLEAN_SUBDIRS)';; \
    -	    *)      list='$(SUBDIRS)';; \
    -	esac; \
    +	list='$(SUBDIRS)'; \
     	for i in $$list; do \
     	    if test -d "$$i"; then \
     		target="$$otarget"; \
    @@ -160,6 +156,27 @@ all-recursive depend-recursive clean-recursive distclean-recursive \
     	    $(MAKE) "local-$$otarget" || exit 1; \
     	fi
     
    +clean-recursive distclean-recursive extraclean-recursive:
    +	@otarget=`echo $@ | sed s/-recursive//`; \
    +	list='$(SUBDIRS) $(CLEAN_SUBDIRS)'; \
    +	for i in $$list; do \
    +	    if test -d "$$i"; then \
    +		target="$$otarget"; \
    +		echo "Making $$target in $$i"; \
    +		if test "$$i" = "."; then \
    +		    made_local=yes; \
    +		    target="local-$$target"; \
    +		fi; \
    +		(cd $$i && $(MAKE) $$target); \
    +	    fi; \
    +	done; \
    +        if test "$$otarget" = "all" && test -z "$(TARGETS)"; then \
    +	    made_local=yes; \
    +	fi; \
    +	if test "$$made_local" != "yes"; then \
    +	    $(MAKE) "local-$$otarget"; \
    +	fi
    +
     local-clean: x-local-clean
     	$(RM) -f *.o *.lo *.a *.la *.so *.obj $(CLEAN_TARGETS) $(PROGRAMS)
     	$(RM) -rf .libs
    @@ -173,7 +190,7 @@ local-extraclean: local-distclean x-local-extraclean
     	    $(RM) -f $(EXTRACLEAN_TARGETS) ; \
     	fi
     
    -local-all: $(TARGETS) x-local-all
    +local-all: $(TARGETS)
     
     local-depend: x-local-depend
     	@if test -n "`ls *.c 2> /dev/null`"; then \
    @@ -182,8 +199,7 @@ local-depend: x-local-depend
     	fi
     
     # to be filled in by the actual Makefile
    -x-local-all x-local-depend:
    -x-local-clean x-local-distclean x-local-extraclean:
    +x-local-depend x-local-clean x-local-distclean x-local-extraclean:
     
     #
     # Implicit rules for creating outputs from input files
    @@ -197,9 +213,8 @@ x-local-clean x-local-distclean x-local-extraclean:
     .c.lo:
     	$(LT_COMPILE)
     
    -.PHONY: all depend clean distclean extraclean install \
    -	all-recursive depend-recursive clean-recursive distclean-recursive \
    -	extraclean-recursive
    -	local-all local-depend local-clean local-distclean local-extraclean \
    -	x-local-all x-local-depend x-local-clean x-local-distclean \
    -	x-local-extraclean
    +.PHONY: all all-recursive local-all install \
    +	depend depend-recursive local-depend x-local-depend \
    +	clean clean-recursive local-clean x-local-clean \
    +	distclean distclean-recursive local-distclean x-local-distclean \
    +	extraclean extraclean-recursive local-extraclean x-local-extraclean
    
    From 7d129d2061921b5105d2ac008d2e80aff58d40fe Mon Sep 17 00:00:00 2001
    From: "Roy T. Fielding" 
    Date: Fri, 18 May 2001 02:35:52 +0000
    Subject: [PATCH 1667/7878] Get the compile flag types right and in order.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61658 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/rules.mk.in | 10 +++++-----
     configure.in      |  7 ++++---
     2 files changed, 9 insertions(+), 8 deletions(-)
    
    diff --git a/build/rules.mk.in b/build/rules.mk.in
    index db6a2576512..020e7ef50c6 100644
    --- a/build/rules.mk.in
    +++ b/build/rules.mk.in
    @@ -73,8 +73,8 @@ LIBTOOL=@LIBTOOL@
     # compilation and linking flags that are supposed to be set only by the user.
     # configure adds to them for tests, but we restore them at the end.
     #
    -CPPFLAGS=@CPPFLAGS@
     CFLAGS=@CFLAGS@
    +CPPFLAGS=@CPPFLAGS@
     LDFLAGS=@LDFLAGS@
     LIBS=@LIBS@
     DEFS=@DEFS@
    @@ -82,8 +82,8 @@ DEFS=@DEFS@
     # anything added to the standard flags by configure is moved to EXTRA_*
     # at the end of the process.
     #
    -EXTRA_CPPFLAGS=@EXTRA_CPPFLAGS@
     EXTRA_CFLAGS=@EXTRA_CFLAGS@
    +EXTRA_CPPFLAGS=@EXTRA_CPPFLAGS@
     EXTRA_LDFLAGS=@EXTRA_LDFLAGS@
     EXTRA_LIBS=@EXTRA_LIBS@
     EXTRA_INCLUDES=@EXTRA_INCLUDES@
    @@ -92,8 +92,8 @@ EXTRA_INCLUDES=@EXTRA_INCLUDES@
     # causing them to be used in configure tests (necessary for things like
     # -Werror and other strict warnings that maintainers like to use).
     #
    -NOTEST_CPPFLAGS=@NOTEST_CPPFLAGS@
     NOTEST_CFLAGS=@NOTEST_CFLAGS@
    +NOTEST_CPPFLAGS=@NOTEST_CPPFLAGS@
     NOTEST_LDFLAGS=@NOTEST_LDFLAGS@
     NOTEST_LIBS=@NOTEST_LIBS@
     
    @@ -102,8 +102,8 @@ NOTEST_LIBS=@NOTEST_LIBS@
     # Note that includes are listed after the flags because -I options have
     # left-to-right precedence and CPPFLAGS may include user-defined overrides.
     #
    -ALL_CPPFLAGS = $(DEFS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS)
     ALL_CFLAGS   = $(EXTRA_CFLAGS) $(NOTEST_CFLAGS) $(CFLAGS)
    +ALL_CPPFLAGS = $(DEFS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS)
     ALL_LDFLAGS  = $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(LDFLAGS)
     ALL_LIBS     = $(LIBS) $(NOTEST_LIBS) $(EXTRA_LIBS)
     ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES)
    @@ -114,7 +114,7 @@ LT_LDFLAGS   = @LT_LDFLAGS@
     #
     # Basic macro setup
     #
    -COMPILE      = $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(ALL_INCLUDES)
    +COMPILE      = $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(ALL_INCLUDES)
     LT_COMPILE   = @lt_compile@
     
     LINK         = @link@
    diff --git a/configure.in b/configure.in
    index 6aeb301e03c..4ee64a151e4 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -96,7 +96,7 @@ case "$host_alias" in
         # Use a custom-made libtool replacement
         echo "using aplibtool"
         LIBTOOL="$srcdir/build/aplibtool"
    -    gcc $CPPFLAGS $CFLAGS -o $LIBTOOL.exe $LIBTOOL.c
    +    gcc $CFLAGS $CPPFLAGS -o $LIBTOOL.exe $LIBTOOL.c
         ;;
     *)  dnl libtoolize requires that the following not be indented
     AC_PROG_LIBTOOL
    @@ -141,14 +141,15 @@ AC_ARG_ENABLE(debug,[  --enable-debug            Turn on debugging and compile t
     ])dnl
     
     AC_ARG_ENABLE(maintainer-mode,[  --enable-maintainer-mode  Turn on debugging and compile time warnings],
    -  [APR_ADDTO(CFLAGS,-g -DAPR_ASSERT_MEMORY)
    +  [APR_ADDTO(NOTEST_CPPFLAGS,-DAPR_ASSERT_MEMORY)
    +   APR_ADDTO(CFLAGS,-g)
        if test "$GCC" = "yes"; then
          APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations])
        fi
     ])dnl
     
     AC_ARG_ENABLE(assert-memory,[ --enable-assert-memory  Turn on asserts in the APR memory code],
    -  [APR_ADDTO(CFLAGS,-DAPR_ASSERT_MEMORY)
    +  [APR_ADDTO(NOTEST_CPPFLAGS,-DAPR_ASSERT_MEMORY)
     ])
     
     dnl # this is the place to put specific options for platform/compiler
    
    From 54e209f823ac2978203ccbf4180358e0b255b150 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sat, 19 May 2001 13:53:06 +0000
    Subject: [PATCH 1668/7878]  More cleanup and improvement of the memory code...
    
    - general code clean up (from Sander Striker)
    - add a type flag to the cleanup's we register (from Sander Striker)
    - add an extra error code to signify you asked for a function
      that isn't available in a memory system
    - add the new memory codes into errorcodes.c so we can report
      the errors (missed first time around)
    
    The types for the cleanups should allow us to be much more selective
    in the cleanup we call.  Sander has some work in progress that will use
    these to provide a better feel of how they'll work.
    
    Submitted by:	Sander Striker 
    Reviewed by:	David Reid
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61660 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h    |  11 +-
     include/apr_sms.h      |  72 ++++++++---
     memory/unix/apr_sms.c  | 263 ++++++++++++++++++++++++++---------------
     misc/unix/errorcodes.c |   9 +-
     4 files changed, 233 insertions(+), 122 deletions(-)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index fff0ae8c8cf..162df835ecd 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -180,9 +180,11 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
      * APR_EGENERAL     General failure (specific information not available)
      * APR_EBADIP       The specified IP address is invalid
      * APR_EBADMASK     The specified netmask is invalid
    - * APR_ENOCLEANUP     There is no memory cleanup available
    - * APR_EMEMSYS        An invalid memory system was passed in to an 
    - *                    apr_sms function
    + * APR_ENOCLEANUP   There is no memory cleanup available
    + * APR_EMEMSYS      An invalid memory system was passed in to an 
    + *                  apr_sms function
    + * APR_EMEMFUNC     A function was called that isn't available in the
    + *                  selected memory system
      * 
    * *
    @@ -253,6 +255,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_EBADPATH       (APR_OS_START_ERROR + 24)
     #define APR_ENOCLEANUP     (APR_OS_START_ERROR + 25)
     #define APR_EMEMSYS        (APR_OS_START_ERROR + 26)
    +#define APR_EMEMFUNC       (APR_OS_START_ERROR + 27)
     
     /* APR ERROR VALUE TESTS */
     #define APR_STATUS_IS_ENOSTAT(s)        ((s) == APR_ENOSTAT)
    @@ -281,7 +284,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_EBADPATH(s)       ((s) == APR_EBADPATH)
     #define APR_STATUS_IS_ENOCLEANUP(s)     ((s) == APR_ENOCLEANUP)
     #define APR_STATUS_IS_EMEMSYS(s)        ((s) == APR_EMEMSYS)
    -
    +#define APR_STATUS_IS_EMEMFUNC(s)       ((s) == APR_EMEMFUNC)
     
     /* APR STATUS VALUES */
     #define APR_INCHILD        (APR_OS_START_STATUS + 1)
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index d34ecc16b68..5639629b79c 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -70,6 +70,11 @@
     extern "C" {
     #endif
     
    +/* The various types of cleanup's we can offer */
    +#define APR_ALL_CLEANUPS      0x0000
    +#define APR_CHILD_CLEANUP     0x0001
    +#define APR_PARENT_CLEANUP    0x0002
    +
     /**
      * @package APR memory system
      */
    @@ -91,16 +96,16 @@ struct apr_sms_t
     
       struct apr_sms_cleanup *cleanups;
     
    -  void * (*malloc_fn)(apr_sms_t *mem_sys, apr_size_t size);
    -  void * (*calloc_fn)(apr_sms_t *mem_sys, apr_size_t size);
    -  void * (*realloc_fn)(apr_sms_t *mem_sys, void *memory, 
    -                       apr_size_t size);
    -  apr_status_t (*free_fn)(apr_sms_t *mem_sys, void *memory);
    -  apr_status_t (*reset_fn)(apr_sms_t *mem_sys);
    -  void (*pre_destroy_fn)(apr_sms_t *mem_sys);
    +  void * (*malloc_fn)       (apr_sms_t *mem_sys, apr_size_t size);
    +  void * (*calloc_fn)       (apr_sms_t *mem_sys, apr_size_t size);
    +  void * (*realloc_fn)      (apr_sms_t *mem_sys, void *memory, 
    +                             apr_size_t size);
    +  apr_status_t (*free_fn)   (apr_sms_t *mem_sys, void *memory);
    +  apr_status_t (*reset_fn)  (apr_sms_t *mem_sys);
    +  void (*pre_destroy_fn)    (apr_sms_t *mem_sys);
       apr_status_t (*destroy_fn)(apr_sms_t *mem_sys);
    -  void (*threadsafe_lock_fn)(apr_sms_t *mem_sys);
    -  void (*threadsafe_unlock_fn)(apr_sms_t *mem_sys);
    +  apr_status_t (*lock_fn)   (apr_sms_t *mem_sys);
    +  apr_status_t (*unlock_fn) (apr_sms_t *mem_sys);
     };
     
     /*
    @@ -209,17 +214,17 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys);
     /**
      * Perform thread-safe locking required whilst this memory system is modified
      * @param mem_sys The memory system to be locked for thread-safety
    - * @deffunc void apr_sms_threadsafe_lock(apr_sms_t *mem_sys)
    + * @deffunc void apr_sms_lock(apr_sms_t *mem_sys)
      */
    -APR_DECLARE(void) apr_sms_threadsafe_lock(apr_sms_t *mem_sys);
    +APR_DECLARE(apr_status_t) apr_sms_lock(apr_sms_t *mem_sys);
     
     /**
      * Release thread-safe locking required whilst this memory system was
      * being modified
      * @param mem_sys The memory system to be released from thread-safety
    - * @deffunc void apr_sms_threadsafe_unlock(apr_sms_t *mem_sys)
    + * @deffunc void apr_sms_unlock(apr_sms_t *mem_sys)
      */
    -APR_DECLARE(void) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys);
    +APR_DECLARE(apr_status_t) apr_sms__unlock(apr_sms_t *mem_sys);
     
     /**
      * Determine if memory system a is an ancestor of memory system b
    @@ -238,39 +243,68 @@ APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a, apr_sms_t *b);
     /**
      * Register a function to be called when a memory system is reset or destroyed
      * @param mem_sys The memory system to register the cleanup function with
    + * @param type The type of cleanup to register
      * @param data The data to pass to the cleanup function
      * @param cleanup_fn The function to call when the memory system is reset or
      *        destroyed
    - * @deffunc void apr_sms_cleanup_register(apr_sms_t *mem_sys,
    + * @deffunc void apr_sms_cleanup_register(apr_sms_t *mem_sys, apr_int32_t type,
      *		   void *data, apr_status_t (*cleanup_fn)(void *));
      */
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys, void *data, 
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys, apr_int32_t type,
    +                                                   void *data, 
                                                        apr_status_t (*cleanup_fn)(void *));
     
     /**
      * Unregister a previously registered cleanup function
      * @param mem_sys The memory system the cleanup function is registered
      *        with
    + * @param type The type of the cleanup to unregister
      * @param data The data associated with the cleanup function
      * @param cleanup_fn The registered cleanup function
      * @deffunc void apr_sms_cleanup_unregister(apr_sms_t *mem_sys,
      *		   void *data, apr_status_t (*cleanup_fn)(void *));
      */
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys, void *data,
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys, apr_int32_t type,
    +                                                     void *data,
                                                          apr_status_t (*cleanup)(void *));
     
    +/**
    + * Unregister all previously registered cleanup functions of the specified type
    + * @param mem_sys The memory system the cleanup functions are registered with
    + * @param type The type associated with the cleanup function. Pass 0 to 
    + *        unregister all cleanup functions.
    + * @deffunc apr_status_t apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys,
    + *                 apr_int32_t type);
    + */
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys,
    +                                                           apr_int32_t type);
    +
     /**
      * Run the specified cleanup function immediately and unregister it
      * @param mem_sys The memory system the cleanup function is registered
      *        with
    + * @param mem_sys The memory system the cleanup function is registered with
    + * @param type The type associated with the cleanup function. Pass 0 to ignore type.
      * @param data The data associated with the cleanup function
      * @param cleanup The registered cleanup function
    - * @deffunc apr_status_t apr_sms_cleanup_run(apr_sms_t *mem_sys,
    - *			   void *data, apr_status_t (*cleanup)(void *));
    + * @deffunc apr_status_t apr_sms_cleanup_run(apr_sms_t *mem_sys, 
    + *                 apr_int32_t type, void *data, apr_status_t (*cleanup)(void *));
      */
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *mem_sys, void *data,
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *mem_sys, 
    +                                              apr_int32_t type, void *data,
                                                   apr_status_t (*cleanup)(void *));
     
    +/**
    + * Run the specified type of cleanup functions immediately and unregister them
    + * @param mem_sys The memory system the cleanup functions are registered with
    + * @param type The category of cleanup functions to run. Pass 0 to run all
    + *        cleanup functions.
    + * @deffunc apr_status_t apr_sms_cleanup_run_type(apr_sms_t *mem_sys,
    + *	           apr_int32_t type);
    + */
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *mem_sys, 
    +                                                   apr_int32_t type);
    +
     /**
      * Create a standard malloc/realloc/free memory system
      * @param mem_sys A pointer to the created apr_sms_t*
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index 188970cd31d..4d627dde3a6 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -76,6 +76,7 @@
     struct apr_sms_cleanup
     {
         struct apr_sms_cleanup *next;
    +    apr_int32_t type;
         void *data;
         apr_status_t (*cleanup_fn)(void *);
     };
    @@ -107,13 +108,12 @@ APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *mem_sys,
     #ifdef APR_ASSERT_MEMORY
         assert(mem_sys);
         assert(mem_sys->malloc_fn);
    -    assert(mem_sys->calloc_fn);
     #endif
     
         if (size == 0)
             return NULL;
     
    -    if (mem_sys->calloc_fn == NULL){
    +    if (!mem_sys->calloc_fn){
             /* Assumption - if we don't have calloc we have
              * malloc, might be bogus...
              */
    @@ -132,7 +132,7 @@ APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem,
         assert(mem_sys->realloc_fn);
     #endif
        
    -    if (mem == NULL)
    +    if (!mem)
             return apr_sms_malloc(mem_sys, size);
     
         if (size == 0)
    @@ -147,20 +147,20 @@ APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem,
     APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys,
                                            void *mem)
     {
    +    if (!mem_sys)
    +        return APR_EMEMSYS;
    +       
     #ifdef APR_ASSERT_MEMORY
         assert(mem_sys->free_fn);
     #endif
     
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -  
    -    if (mem == NULL)
    +    if (!mem)
             return APR_EINVAL;
     
    -    if (mem_sys->free_fn != NULL)
    +    if (!mem_sys->free_fn)
             return mem_sys->free_fn(mem_sys, mem);  
     
    -    return APR_SUCCESS;
    +    return APR_EMEMFUNC;
     }
     
     /*
    @@ -181,7 +181,7 @@ APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory,
     {
         apr_sms_t *mem_sys;
     
    -    if (memory == NULL)
    +    if (!memory)
             return NULL;
     
         /* Just typecast it, and clear it */
    @@ -192,16 +192,11 @@ APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory,
         mem_sys->parent_mem_sys = parent_mem_sys;
         mem_sys->accounting_mem_sys = mem_sys;
     
    -    if (parent_mem_sys != NULL)
    -    {
    -        if ((mem_sys->sibling_mem_sys = 
    -           parent_mem_sys->child_mem_sys) != NULL)
    -        {
    -            mem_sys->sibling_mem_sys->ref_mem_sys = 
    -              &mem_sys->sibling_mem_sys;
    +    if (parent_mem_sys != NULL){
    +        if (mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys){
    +            mem_sys->sibling_mem_sys->ref_mem_sys = &mem_sys->sibling_mem_sys;
             }
    -        mem_sys->ref_mem_sys = 
    -          &parent_mem_sys->child_mem_sys;
    +        mem_sys->ref_mem_sys = &parent_mem_sys->child_mem_sys;
             parent_mem_sys->child_mem_sys = mem_sys;
         }
         /* This seems a bit redundant, but we're not taking chances */
    @@ -231,15 +226,11 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
          * or destroy function. And to avoid half implementations
          * we require reset to be present when destroy is.
          */
    -    assert(mem_sys->free_fn != NULL ||
    -         (mem_sys->destroy_fn != NULL &&
    -          mem_sys->reset_fn != NULL));
    +    assert(mem_sys->free_fn || (mem_sys->destroy_fn && mem_sys->reset_fn));
     
    -    assert(mem_sys->destroy_fn == NULL ||
    -         mem_sys->reset_fn != NULL);
    +    assert(!mem_sys->destroy_fn || mem_sys->reset_fn);
       
    -    assert(mem_sys->reset_fn == NULL ||
    -         mem_sys->destroy_fn != NULL);
    +    assert(!mem_sys->reset_fn || mem_sys->destroy_fn);
     
         /*
          * Make sure all accounting memory dies with the memory system.
    @@ -247,8 +238,7 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
          * is either the memory system itself or a direct child.
          */
         assert(mem_sys->accounting_mem_sys == mem_sys ||
    -	 mem_sys->accounting_mem_sys->parent_mem_sys == 
    -	   mem_sys);
    +	 mem_sys->accounting_mem_sys->parent_mem_sys ==  mem_sys);
     
         /*
          * A non-tracking memory system can be the child of
    @@ -260,8 +250,7 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
             return;
     
         parent = mem_sys
    -    while (parent)
    -    {
    +    while (parent){
             if (apr_sms_is_tracking(parent))
                 return; /* Tracking memory system found, return satisfied ;-) */
     
    @@ -304,12 +293,11 @@ static void apr_sms_do_cleanups(apr_sms_t *mem_sys)
      */
     static void apr_sms_do_child_cleanups(apr_sms_t *mem_sys)
     {
    -    if (mem_sys == NULL)
    +    if (!mem_sys)
             return;
     
         mem_sys = mem_sys->child_mem_sys;
    -    while (mem_sys)
    -    {
    +    while (mem_sys){
             apr_sms_do_child_cleanups(mem_sys);
             apr_sms_do_cleanups(mem_sys);
     
    @@ -324,8 +312,9 @@ APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys)
     {
         if (!mem_sys)
             return APR_EMEMSYS;
    +
         if (!mem_sys->reset_fn)
    -        return APR_EINVAL; /* Not sure if this is right... */
    +        return APR_EMEMFUNC;
     
         /* 
          * Run the cleanups of all child memory systems _including_
    @@ -362,8 +351,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
         if (!mem_sys)
             return APR_EMEMSYS;
     
    -    if (apr_sms_is_tracking(mem_sys))
    -    {
    +    if (apr_sms_is_tracking(mem_sys)){
             /* 
              * Run the cleanups of all child memory systems _including_
              * the accounting memory system.
    @@ -384,11 +372,9 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
                  * child list (we will explicitly destroy it later in this block).
                  */
                 if (child_mem_sys->sibling_mem_sys != NULL)
    -	            child_mem_sys->sibling_mem_sys->ref_mem_sys =
    -	              child_mem_sys->ref_mem_sys;
    +	            child_mem_sys->sibling_mem_sys->ref_mem_sys = child_mem_sys->ref_mem_sys;
     
    -            *child_mem_sys->ref_mem_sys = 
    -            child_mem_sys->sibling_mem_sys;
    +            *child_mem_sys->ref_mem_sys = child_mem_sys->sibling_mem_sys;
     
                 /* Set this fields so destroy will work */
                 child_mem_sys->ref_mem_sys = NULL;
    @@ -397,8 +383,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
     
             /* Visit all children and destroy them */
             child_mem_sys = mem_sys->child_mem_sys;
    -        while (child_mem_sys != NULL)
    -        {
    +        while (child_mem_sys != NULL){
                 sibling_mem_sys = child_mem_sys->sibling_mem_sys;
                 apr_sms_destroy(child_mem_sys);
                 child_mem_sys = sibling_mem_sys;
    @@ -408,8 +393,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
              * If the accounting memory system _is_ tracking, we also know that it is
              * not the memory system itself.
              */
    -        if (apr_sms_is_tracking(mem_sys->accounting_mem_sys))
    -        {
    +        if (apr_sms_is_tracking(mem_sys->accounting_mem_sys)){
                 /* 
                  * Run all cleanups, the memory will be freed by the destroying of the
                  * accounting memory system.
    @@ -429,12 +413,10 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
             {
                 /* Run all cleanups, free'ing memory as we go */
                 cleanup = mem_sys->cleanups;
    -            while (cleanup)
    -            {
    +            while (cleanup){
                     cleanup->cleanup_fn(cleanup->data);
                     next_cleanup = cleanup->next;
    -                apr_sms_free(mem_sys->accounting_mem_sys, 
    -			       cleanup);
    +                apr_sms_free(mem_sys->accounting_mem_sys, cleanup);
                     cleanup = next_cleanup;
                 }
     
    @@ -452,33 +434,32 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
       }
     
       /* Remove the memory system from the parent memory systems child list */
    -  if (mem_sys->sibling_mem_sys != NULL)
    -      mem_sys->sibling_mem_sys->ref_mem_sys =
    -        mem_sys->ref_mem_sys;
    -  if (mem_sys->ref_mem_sys != NULL)
    +  if (mem_sys->sibling_mem_sys)
    +      mem_sys->sibling_mem_sys->ref_mem_sys = mem_sys->ref_mem_sys;
    +
    +  if (mem_sys->ref_mem_sys)
           *mem_sys->ref_mem_sys = mem_sys->sibling_mem_sys;
     
       /* Call the pre-destroy if present */
    -  if (mem_sys->pre_destroy_fn != NULL)
    +  if (mem_sys->pre_destroy_fn)
           mem_sys->pre_destroy_fn(mem_sys);
     
       /* 1 - If we have a self destruct, use it */
    -  if (mem_sys->destroy_fn != NULL)
    +  if (mem_sys->destroy_fn)
           return mem_sys->destroy_fn(mem_sys);
     
       /* 2 - If we don't have a parent, free using ourselves */
    -  else if (mem_sys->parent_mem_sys == NULL)
    +  else if (!mem_sys->parent_mem_sys)
           return mem_sys->free_fn(mem_sys, mem_sys);
     
       /* 3 - If we do have a parent and it has a free function, use it */
    -  else if (mem_sys->parent_mem_sys->free_fn != NULL)
    +  else if (mem_sys->parent_mem_sys->free_fn)
           return apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
     
       /* 4 - Assume we are the child of a tracking memory system, and do nothing */
     #ifdef APR_ASSERT_MEMORY
         mem_sys = mem_sys->parent_mem_sys;
    -    while (mem_sys)
    -    {
    +    while (mem_sys){
             if (apr_sms_is_tracking(mem_sys))
                 return APR_SUCCESS;
     
    @@ -492,12 +473,13 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
     APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a,
                                                   apr_sms_t *b)
     {
    +    if (!b)
    +        return APR_EMEMSYS;
    +
     #ifdef APR_ASSERT_MEMORY
         assert(a != NULL);
         assert(b != NULL);
     #endif
    -    if (!b)
    -        return APR_EINVAL;
             
         while (b && b != a)
             b = b->parent_mem_sys;
    @@ -506,58 +488,58 @@ APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a,
         return !(b == a); 
     }
     
    -APR_DECLARE(void) apr_sms_threadsafe_lock(apr_sms_t *mem_sys)
    +APR_DECLARE(apr_status_t) apr_sms_threadsafe_lock(apr_sms_t *mem_sys)
     {
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys != NULL);
    -#endif
    -
         if (!mem_sys)
    -        return;       
    -    if (mem_sys->threadsafe_lock_fn != NULL)
    -        mem_sys->threadsafe_lock_fn(mem_sys);
    +        return APR_EMEMSYS;       
    +
    +    if (!mem_sys->lock_fn)
    +        return APR_EMEMFUNC;
    +
    +    if (mem_sys->lock_fn)
    +        return mem_sys->lock_fn(mem_sys);
     }
     
    -APR_DECLARE(void) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys)
    +APR_DECLARE(apr_status_t) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys)
     {
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys != NULL);
    -#endif
    -
         if (!mem_sys)
    -        return;
    -    if (mem_sys->threadsafe_unlock_fn != NULL)
    -        mem_sys->threadsafe_unlock_fn(mem_sys);
    +        return APR_EMEMSYS;
    +
    +    if (!mem_sys->unlock_fn)
    +        return APR_EMEMFUNC;
    +        
    +    if (mem_sys->unlock_fn)
    +        return mem_sys->unlock_fn(mem_sys);
     }
     
     /*
      * memory system cleanup management functions
      */
     
    -APR_DECLARE(apr_status_t) 
    -apr_sms_cleanup_register(apr_sms_t *mem_sys, void *data,
    -                         apr_status_t (*cleanup_fn)(void *))
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys, 
    +                                                   apr_int32_t type, void *data,
    +                                                   apr_status_t (*cleanup_fn)(void *))
     {
         struct apr_sms_cleanup *cleanup;
     
    +    if (!mem_sys)
    +        return APR_EMEMSYS;
    +
     #ifdef APR_ASSERT_MEMORY
         assert(mem_sys->accounting_mem_sys != NULL);
     #endif
    -
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
         
    -    if (cleanup_fn == NULL)
    -        return APR_EINVAL;
    +    if (!cleanup_fn)
    +        return APR_EMEMFUNC;
     
         cleanup = (struct apr_sms_cleanup *)
    -	    apr_sms_malloc(mem_sys->accounting_mem_sys,
    -                       sizeof(struct apr_sms_cleanup));
    +	    apr_sms_malloc(mem_sys->accounting_mem_sys, sizeof(struct apr_sms_cleanup));
     
    -    if (cleanup == NULL)
    +    if (!cleanup)
             return APR_ENOMEM;
     
         cleanup->data = data;
    +    cleanup->type = type;
         cleanup->cleanup_fn = cleanup_fn;
         cleanup->next = mem_sys->cleanups;
         mem_sys->cleanups = cleanup;
    @@ -566,25 +548,25 @@ apr_sms_cleanup_register(apr_sms_t *mem_sys, void *data,
     }
     
     APR_DECLARE(apr_status_t)
    -apr_sms_cleanup_unregister(apr_sms_t *mem_sys, void *data,
    +apr_sms_cleanup_unregister(apr_sms_t *mem_sys, apr_int32_t type, void *data,
                                apr_status_t (*cleanup_fn)(void *))
     {
         struct apr_sms_cleanup *cleanup;
         struct apr_sms_cleanup **cleanup_ref;
     
    +    if (!mem_sys)
    +        return APR_EMEMSYS;
    +
     #ifdef APR_ASSERT_MEMORY
         assert(mem_sys->accounting_mem_sys != NULL);
     #endif
    -
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
             
         cleanup = mem_sys->cleanups;
         cleanup_ref = &mem_sys->cleanups;
         while (cleanup)
         {
    -        if (cleanup->data == data && cleanup->cleanup_fn == cleanup_fn)
    -        {
    +        if ((type == 0 || cleanup->cleanup_fn == cleanup_fn) &&
    +            cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) {
                 *cleanup_ref = cleanup->next;
     
                 mem_sys = mem_sys->accounting_mem_sys;
    @@ -603,10 +585,95 @@ apr_sms_cleanup_unregister(apr_sms_t *mem_sys, void *data,
         return APR_ENOCLEANUP;
     }
     
    -APR_DECLARE(apr_status_t) 
    -apr_sms_cleanup_run(apr_sms_t *mem_sys, void *data, 
    -			        apr_status_t (*cleanup_fn)(void *))
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys, 
    +                                                          apr_int32_t type)
     {
    -    apr_sms_cleanup_unregister(mem_sys, data, cleanup_fn);
    -    return cleanup_fn(data);
    +    struct apr_sms_cleanup *cleanup;
    +    struct apr_sms_cleanup **cleanup_ref;
    +    apr_status_t rv = APR_ENOCLEANUP;
    +
    +    if (!mem_sys)
    +        return APR_EMEMSYS;
    +        
    +#ifdef APR_ASSERT_MEMORY
    +    assert(mem_sys->accounting_mem_sys != NULL);
    +#endif
    +    
    +    cleanup = mem_sys->cleanups;
    +    cleanup_ref = &mem_sys->cleanups;
    +    mem_sys = mem_sys->accounting_mem_sys;
    +    while (cleanup) {
    +        if (type == 0 || cleanup->type == type) {
    +            *cleanup_ref = cleanup->next;
    +
    +            if (mem_sys->free_fn != NULL)
    +                apr_sms_free(mem_sys, cleanup);
    +
    +            cleanup = *cleanup_ref;
    +            rv = APR_SUCCESS;
    +        }
    +        else {
    +            cleanup_ref = &cleanup->next;
    +            cleanup = cleanup->next;
    +        }
    +    }
    +
    +    /* The cleanup function should have been registered previously */
    +    return rv;
     }
    +
    +APR_DECLARE(apr_status_t)  apr_sms_cleanup_run(apr_sms_t *mem_sys, apr_int32_t type,
    +                                               void *data, 
    +			                                   apr_status_t (*cleanup_fn)(void *))
    +{
    +    apr_status_t rv;
    +
    +    if (!mem_sys)
    +        return APR_EMEMSYS;
    +
    +    if ((rv = apr_sms_cleanup_unregister(mem_sys, type, data, cleanup_fn)) != APR_SUCCESS)
    +        return rv;
    +
    +     return cleanup_fn(data);
    +}
    +
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *mem_sys, 
    +                                                   apr_int32_t type)
    +{
    +    struct apr_sms_cleanup *cleanup;
    +    struct apr_sms_cleanup **cleanup_ref;
    +    apr_status_t rv = APR_ENOCLEANUP;
    +
    +    if (!mem_sys)
    +        return APR_EMEMSYS;
    +        
    +#ifdef APR_ASSERT_MEMORY
    +    assert(mem_sys->accounting_mem_sys != NULL);
    +#endif
    +    
    +    cleanup = mem_sys->cleanups;
    +    cleanup_ref = &mem_sys->cleanups;
    +    mem_sys = mem_sys->accounting_mem_sys;
    +    while (cleanup)
    +    {
    +        if (type == 0 || cleanup->type == type) {
    +            *cleanup_ref = cleanup->next;
    +
    +            cleanup->cleanup_fn(cleanup->data);
    +            
    +            if (mem_sys->free_fn != NULL)
    +                apr_sms_free(mem_sys, cleanup);
    +
    +            cleanup = *cleanup_ref;
    +            rv = APR_SUCCESS;
    +        }
    +        else {
    +            cleanup_ref = &cleanup->next;
    +            cleanup = cleanup->next;
    +        }
    +    }
    +
    +    /* The cleanup function should have been registered previously */
    +    return rv;
    +}
    +
    diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c
    index 2e8099116af..1a12b9a34e5 100644
    --- a/misc/unix/errorcodes.c
    +++ b/misc/unix/errorcodes.c
    @@ -166,7 +166,14 @@ static char *apr_error_string(apr_status_t statcode)
             return "The given path was above the root path";
         case APR_EBADPATH:
             return "The given path misformatted or contained invalid characters";
    -     default:
    +    case APR_EMEMSYS:
    +        return "The memory system passed does not exist";
    +    case APR_EMEMFUNC:
    +        return "The function requested is not available in the memory "
    +               "system used";
    +    case APR_ENOCLEANUP:
    +        return "The requested cleanup function does not exist";
    +    default:
             return "Error string not specified yet";
         }
     }
    
    From 3f90228c3fd905e4c1a539f79846598853f9984e Mon Sep 17 00:00:00 2001
    From: Ben Laurie 
    Date: Sat, 19 May 2001 15:35:45 +0000
    Subject: [PATCH 1669/7878] Fix warnings.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61661 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_sms.h     | 2 ++
     memory/unix/apr_sms.c | 6 +++++-
     2 files changed, 7 insertions(+), 1 deletion(-)
    
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index 5639629b79c..cdd46dcebce 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -312,6 +312,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *mem_sys,
      */
     APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys);
     
    +APR_DECLARE(apr_status_t) apr_sms_threadsafe_lock(apr_sms_t *mem_sys);
    +APR_DECLARE(apr_status_t) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys);
     
     #ifdef __cplusplus
     }
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index 4d627dde3a6..e48203bfe26 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -193,7 +193,7 @@ APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory,
         mem_sys->accounting_mem_sys = mem_sys;
     
         if (parent_mem_sys != NULL){
    -        if (mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys){
    +        if ((mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys)){
                 mem_sys->sibling_mem_sys->ref_mem_sys = &mem_sys->sibling_mem_sys;
             }
             mem_sys->ref_mem_sys = &parent_mem_sys->child_mem_sys;
    @@ -498,6 +498,8 @@ APR_DECLARE(apr_status_t) apr_sms_threadsafe_lock(apr_sms_t *mem_sys)
     
         if (mem_sys->lock_fn)
             return mem_sys->lock_fn(mem_sys);
    +
    +    return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys)
    @@ -510,6 +512,8 @@ APR_DECLARE(apr_status_t) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys)
             
         if (mem_sys->unlock_fn)
             return mem_sys->unlock_fn(mem_sys);
    +
    +    return APR_SUCCESS;
     }
     
     /*
    
    From 0a81ec4fc3257d103fd0539cf0d12f4c31877232 Mon Sep 17 00:00:00 2001
    From: Cliff Woolley 
    Date: Sat, 19 May 2001 21:55:43 +0000
    Subject: [PATCH 1670/7878] This assignment does seem to be intentional, so
     throw a !=NULL in there to make it more clear what's going on.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61662 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index e48203bfe26..0a1d9ffed89 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -192,8 +192,8 @@ APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory,
         mem_sys->parent_mem_sys = parent_mem_sys;
         mem_sys->accounting_mem_sys = mem_sys;
     
    -    if (parent_mem_sys != NULL){
    -        if ((mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys)){
    +    if (parent_mem_sys != NULL) {
    +        if ((mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys)!=NULL) {
                 mem_sys->sibling_mem_sys->ref_mem_sys = &mem_sys->sibling_mem_sys;
             }
             mem_sys->ref_mem_sys = &parent_mem_sys->child_mem_sys;
    
    From 3ba387571b63929a91dccb1c316df02a90b69091 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sat, 19 May 2001 22:47:30 +0000
    Subject: [PATCH 1671/7878] Some more tidying up. - remove the declarations
     from apr_sms.h for the old lock/unlock   definitions as apr_sms.c has been
     updated to use the new simpler   definitions.  Noticed by Justin/Cliff/Ben...
     - in apr_sms_destroy simplify the logic of if...else if to simple   if
     statements as we'll never move on if a check is true   Suggested by Sander
     Striker - remove the APR_EMEMFUNC definition and replace it with the  
     existing APR_ENITIMPL value.  Suggested by Cliff Woolley - I'm leaving the
     EMEMSYS as it conveys more information than if we   simply return with
     EINVAL.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61663 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h    |  2 --
     include/apr_sms.h      |  5 +----
     memory/unix/apr_sms.c  | 33 +++++++++++++++++----------------
     misc/unix/errorcodes.c |  3 ---
     4 files changed, 18 insertions(+), 25 deletions(-)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 162df835ecd..0978a227a75 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -255,7 +255,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_EBADPATH       (APR_OS_START_ERROR + 24)
     #define APR_ENOCLEANUP     (APR_OS_START_ERROR + 25)
     #define APR_EMEMSYS        (APR_OS_START_ERROR + 26)
    -#define APR_EMEMFUNC       (APR_OS_START_ERROR + 27)
     
     /* APR ERROR VALUE TESTS */
     #define APR_STATUS_IS_ENOSTAT(s)        ((s) == APR_ENOSTAT)
    @@ -284,7 +283,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_EBADPATH(s)       ((s) == APR_EBADPATH)
     #define APR_STATUS_IS_ENOCLEANUP(s)     ((s) == APR_ENOCLEANUP)
     #define APR_STATUS_IS_EMEMSYS(s)        ((s) == APR_EMEMSYS)
    -#define APR_STATUS_IS_EMEMFUNC(s)       ((s) == APR_EMEMFUNC)
     
     /* APR STATUS VALUES */
     #define APR_INCHILD        (APR_OS_START_STATUS + 1)
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index cdd46dcebce..2ff389f6116 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -224,7 +224,7 @@ APR_DECLARE(apr_status_t) apr_sms_lock(apr_sms_t *mem_sys);
      * @param mem_sys The memory system to be released from thread-safety
      * @deffunc void apr_sms_unlock(apr_sms_t *mem_sys)
      */
    -APR_DECLARE(apr_status_t) apr_sms__unlock(apr_sms_t *mem_sys);
    +APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *mem_sys);
     
     /**
      * Determine if memory system a is an ancestor of memory system b
    @@ -312,9 +312,6 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *mem_sys,
      */
     APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys);
     
    -APR_DECLARE(apr_status_t) apr_sms_threadsafe_lock(apr_sms_t *mem_sys);
    -APR_DECLARE(apr_status_t) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys);
    -
     #ifdef __cplusplus
     }
     #endif
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index 0a1d9ffed89..f2499f2d746 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -160,7 +160,7 @@ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys,
         if (!mem_sys->free_fn)
             return mem_sys->free_fn(mem_sys, mem);  
     
    -    return APR_EMEMFUNC;
    +    return APR_ENOTIMPL;
     }
     
     /*
    @@ -218,7 +218,7 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
         /*
          * A memory system without a malloc won't do us much good
          */
    -    assert(mem_sys->malloc_fn != NULL);
    +    assert(mem_sys->malloc_fn);
     
         /* 
          * Check to see if this is either a non-tracking or
    @@ -246,7 +246,7 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
          * tracking ancestors, but in that specific case we issue a
          * warning.
          */
    -    if (mem_sys->parent_mem_sys == NULL)
    +    if (!mem_sys->parent_mem_sys)
             return;
     
         parent = mem_sys
    @@ -314,7 +314,7 @@ APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys)
             return APR_EMEMSYS;
     
         if (!mem_sys->reset_fn)
    -        return APR_EMEMFUNC;
    +        return APR_ENOTIMPL;
     
         /* 
          * Run the cleanups of all child memory systems _including_
    @@ -383,6 +383,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
     
             /* Visit all children and destroy them */
             child_mem_sys = mem_sys->child_mem_sys;
    +
             while (child_mem_sys != NULL){
                 sibling_mem_sys = child_mem_sys->sibling_mem_sys;
                 apr_sms_destroy(child_mem_sys);
    @@ -413,6 +414,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
             {
                 /* Run all cleanups, free'ing memory as we go */
                 cleanup = mem_sys->cleanups;
    +
                 while (cleanup){
                     cleanup->cleanup_fn(cleanup->data);
                     next_cleanup = cleanup->next;
    @@ -449,11 +451,11 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
           return mem_sys->destroy_fn(mem_sys);
     
       /* 2 - If we don't have a parent, free using ourselves */
    -  else if (!mem_sys->parent_mem_sys)
    +  if (!mem_sys->parent_mem_sys)
           return mem_sys->free_fn(mem_sys, mem_sys);
     
       /* 3 - If we do have a parent and it has a free function, use it */
    -  else if (mem_sys->parent_mem_sys->free_fn)
    +  if (mem_sys->parent_mem_sys->free_fn)
           return apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
     
       /* 4 - Assume we are the child of a tracking memory system, and do nothing */
    @@ -477,8 +479,7 @@ APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a,
             return APR_EMEMSYS;
     
     #ifdef APR_ASSERT_MEMORY
    -    assert(a != NULL);
    -    assert(b != NULL);
    +    assert(a);
     #endif
             
         while (b && b != a)
    @@ -488,13 +489,13 @@ APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a,
         return !(b == a); 
     }
     
    -APR_DECLARE(apr_status_t) apr_sms_threadsafe_lock(apr_sms_t *mem_sys)
    +APR_DECLARE(apr_status_t) apr_sms_lock(apr_sms_t *mem_sys)
     {
         if (!mem_sys)
             return APR_EMEMSYS;       
     
         if (!mem_sys->lock_fn)
    -        return APR_EMEMFUNC;
    +        return APR_ENOTIMPL;
     
         if (mem_sys->lock_fn)
             return mem_sys->lock_fn(mem_sys);
    @@ -502,13 +503,13 @@ APR_DECLARE(apr_status_t) apr_sms_threadsafe_lock(apr_sms_t *mem_sys)
         return APR_SUCCESS;
     }
     
    -APR_DECLARE(apr_status_t) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys)
    +APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *mem_sys)
     {
         if (!mem_sys)
             return APR_EMEMSYS;
     
         if (!mem_sys->unlock_fn)
    -        return APR_EMEMFUNC;
    +        return APR_ENOTIMPL;
             
         if (mem_sys->unlock_fn)
             return mem_sys->unlock_fn(mem_sys);
    @@ -534,7 +535,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys,
     #endif
         
         if (!cleanup_fn)
    -        return APR_EMEMFUNC;
    +        return APR_ENOTIMPL;
     
         cleanup = (struct apr_sms_cleanup *)
     	    apr_sms_malloc(mem_sys->accounting_mem_sys, sizeof(struct apr_sms_cleanup));
    @@ -551,9 +552,9 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys,
         return APR_SUCCESS;
     }
     
    -APR_DECLARE(apr_status_t)
    -apr_sms_cleanup_unregister(apr_sms_t *mem_sys, apr_int32_t type, void *data,
    -                           apr_status_t (*cleanup_fn)(void *))
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys, apr_int32_t type,
    +                                                     void *data,
    +                                                     apr_status_t (*cleanup_fn)(void *))
     {
         struct apr_sms_cleanup *cleanup;
         struct apr_sms_cleanup **cleanup_ref;
    diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c
    index 1a12b9a34e5..f6224f7a85f 100644
    --- a/misc/unix/errorcodes.c
    +++ b/misc/unix/errorcodes.c
    @@ -168,9 +168,6 @@ static char *apr_error_string(apr_status_t statcode)
             return "The given path misformatted or contained invalid characters";
         case APR_EMEMSYS:
             return "The memory system passed does not exist";
    -    case APR_EMEMFUNC:
    -        return "The function requested is not available in the memory "
    -               "system used";
         case APR_ENOCLEANUP:
             return "The requested cleanup function does not exist";
         default:
    
    From 5ee9f8e6a9ef41a1cf6e3011a0ee66ff3fda3509 Mon Sep 17 00:00:00 2001
    From: Jim Jagielski 
    Date: Sat, 19 May 2001 23:35:29 +0000
    Subject: [PATCH 1672/7878] Minor wrapper for functions which should only be
     defined if we support DSO.
    
    PR:
    Obtained from:
    Submitted by:
    Reviewed by:
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61664 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_portable.h | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/include/apr_portable.h b/include/apr_portable.h
    index 986ff741ab0..0254551f8db 100644
    --- a/include/apr_portable.h
    +++ b/include/apr_portable.h
    @@ -396,6 +396,7 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key,
     
     #endif /* APR_HAS_THREADS */
     
    +#if APR_HAS_DSO
     /**
      * convert the dso handle from os specific to apr
      * @param dso The apr handle we are converting to
    @@ -416,6 +417,8 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **dso,
     APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso,
                                                     apr_dso_handle_t *aprdso);
     
    +#endif /* APR_HAS_DSO */
    +
     #ifdef __cplusplus
     }
     #endif
    
    From 84cc59291ae9155104852acb94098f33c2b29091 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Sun, 20 May 2001 05:21:08 +0000
    Subject: [PATCH 1673/7878] Include recently added ap_hook_get_* functions in
     list of exports.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61665 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/make_export.awk | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/build/make_export.awk b/build/make_export.awk
    index cce47120481..a92136e772c 100644
    --- a/build/make_export.awk
    +++ b/build/make_export.awk
    @@ -56,6 +56,7 @@ function add_symbol (sym_name) {
     /^[ \t]*AP_DECLARE_HOOK[(][^,]+,[a-z_]+,.+[)]$/ {
     	split($0, args, ",");
     	add_symbol("ap_hook_" args[2]);
    +	add_symbol("ap_hook_get_" args[2]);
     	add_symbol("ap_run_" args[2]);
     }
     
    
    From 9f44d353c7f5c32f46b92e34dabc10d91a31ad20 Mon Sep 17 00:00:00 2001
    From: Ben Laurie 
    Date: Sun, 20 May 2001 12:45:51 +0000
    Subject: [PATCH 1674/7878] Long overdue name change from "generic hook" to
     "optional hook".
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61666 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_sms.h | 2 --
     1 file changed, 2 deletions(-)
    
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index 2ff389f6116..ba1de1296dc 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -214,7 +214,6 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys);
     /**
      * Perform thread-safe locking required whilst this memory system is modified
      * @param mem_sys The memory system to be locked for thread-safety
    - * @deffunc void apr_sms_lock(apr_sms_t *mem_sys)
      */
     APR_DECLARE(apr_status_t) apr_sms_lock(apr_sms_t *mem_sys);
     
    @@ -222,7 +221,6 @@ APR_DECLARE(apr_status_t) apr_sms_lock(apr_sms_t *mem_sys);
      * Release thread-safe locking required whilst this memory system was
      * being modified
      * @param mem_sys The memory system to be released from thread-safety
    - * @deffunc void apr_sms_unlock(apr_sms_t *mem_sys)
      */
     APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *mem_sys);
     
    
    From b69df90a9087817c2fcc8bcaf6fa9fd8e076c570 Mon Sep 17 00:00:00 2001
    From: Cliff Woolley 
    Date: Sun, 20 May 2001 21:47:52 +0000
    Subject: [PATCH 1675/7878] Fix some accidentally inverted logic.
    
    Submitted by:	Sander Striker 
    Reviewed by:	Cliff Woolley
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61667 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index f2499f2d746..c8adb0f057e 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -157,7 +157,7 @@ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys,
         if (!mem)
             return APR_EINVAL;
     
    -    if (!mem_sys->free_fn)
    +    if (mem_sys->free_fn)
             return mem_sys->free_fn(mem_sys, mem);  
     
         return APR_ENOTIMPL;
    
    From ea57c3f17756e49c2892ce4e11427649df735ea9 Mon Sep 17 00:00:00 2001
    From: Cliff Woolley 
    Date: Sun, 20 May 2001 22:34:54 +0000
    Subject: [PATCH 1676/7878] Bring SMS code into line with the Apache
     styleguide.  No functional change.
    
    Submitted by:	Sander Striker 
    Reviewed by:	Cliff Woolley
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61668 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms.c          | 160 +++++++++++++++++----------------
     memory/unix/apr_sms_std.c      |  17 ++--
     memory/unix/apr_sms_tracking.c |  62 ++++++-------
     3 files changed, 123 insertions(+), 116 deletions(-)
    
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index c8adb0f057e..9f0bc1136aa 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -113,15 +113,17 @@ APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *mem_sys,
         if (size == 0)
             return NULL;
     
    -    if (!mem_sys->calloc_fn){
    +    if (!mem_sys->calloc_fn) {
             /* Assumption - if we don't have calloc we have
              * malloc, might be bogus...
              */
             void *mem = mem_sys->malloc_fn(mem_sys, size);
             memset(mem, '\0', size);
             return mem;
    -    } else
    -        return mem_sys->calloc_fn(mem_sys, size);
    +    }
    +    
    +    return mem_sys->calloc_fn(mem_sys, size);
    +
     }
     
     APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem,
    @@ -135,8 +137,7 @@ APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem,
         if (!mem)
             return apr_sms_malloc(mem_sys, size);
     
    -    if (size == 0)
    -    {
    +    if (size == 0) {
             apr_sms_free(mem_sys, mem);
             return NULL;
         }
    @@ -193,18 +194,17 @@ APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory,
         mem_sys->accounting_mem_sys = mem_sys;
     
         if (parent_mem_sys != NULL) {
    -        if ((mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys)!=NULL) {
    +        if ((mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys) != NULL)
                 mem_sys->sibling_mem_sys->ref_mem_sys = &mem_sys->sibling_mem_sys;
    -        }
    +
             mem_sys->ref_mem_sys = &parent_mem_sys->child_mem_sys;
             parent_mem_sys->child_mem_sys = mem_sys;
         }
         /* This seems a bit redundant, but we're not taking chances */
    -    else
    -    {
    -        mem_sys->ref_mem_sys = NULL;
    +    else {
    +        mem_sys->ref_mem_sys     = NULL;
             mem_sys->sibling_mem_sys = NULL;
    -        mem_sys->child_mem_sys = NULL;
    +        mem_sys->child_mem_sys   = NULL;
         }
     
         return mem_sys;
    @@ -238,7 +238,7 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
          * is either the memory system itself or a direct child.
          */
         assert(mem_sys->accounting_mem_sys == mem_sys ||
    -	 mem_sys->accounting_mem_sys->parent_mem_sys ==  mem_sys);
    +           mem_sys->accounting_mem_sys->parent_mem_sys == mem_sys);
     
         /*
          * A non-tracking memory system can be the child of
    @@ -250,7 +250,7 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
             return;
     
         parent = mem_sys
    -    while (parent){
    +    while (parent) {
             if (apr_sms_is_tracking(parent))
                 return; /* Tracking memory system found, return satisfied ;-) */
     
    @@ -277,8 +277,7 @@ static void apr_sms_do_cleanups(apr_sms_t *mem_sys)
         struct apr_sms_cleanup *cleanup;
     
         cleanup = mem_sys->cleanups;
    -    while (cleanup)
    -    {
    +    while (cleanup) {
             cleanup->cleanup_fn(cleanup->data);
             cleanup = cleanup->next;
         }
    @@ -297,7 +296,7 @@ static void apr_sms_do_child_cleanups(apr_sms_t *mem_sys)
             return;
     
         mem_sys = mem_sys->child_mem_sys;
    -    while (mem_sys){
    +    while (mem_sys) {
             apr_sms_do_child_cleanups(mem_sys);
             apr_sms_do_cleanups(mem_sys);
     
    @@ -351,7 +350,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
         if (!mem_sys)
             return APR_EMEMSYS;
     
    -    if (apr_sms_is_tracking(mem_sys)){
    +    if (apr_sms_is_tracking(mem_sys)) {
             /* 
              * Run the cleanups of all child memory systems _including_
              * the accounting memory system.
    @@ -361,18 +360,17 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
             /* Run all cleanups, the memory will be freed by the destroy */
             apr_sms_do_cleanups(mem_sys);
         }
    -    else
    -    {
    -        if (mem_sys->accounting_mem_sys != mem_sys)
    -        {
    +    else {
    +        if (mem_sys->accounting_mem_sys != mem_sys) {
                 child_mem_sys = mem_sys->accounting_mem_sys;
    -		    
    +            
                 /* 
                  * Remove the accounting memory system from the memory systems 
                  * child list (we will explicitly destroy it later in this block).
                  */
                 if (child_mem_sys->sibling_mem_sys != NULL)
    -	            child_mem_sys->sibling_mem_sys->ref_mem_sys = child_mem_sys->ref_mem_sys;
    +                child_mem_sys->sibling_mem_sys->ref_mem_sys =
    +                    child_mem_sys->ref_mem_sys;
     
                 *child_mem_sys->ref_mem_sys = child_mem_sys->sibling_mem_sys;
     
    @@ -384,20 +382,20 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
             /* Visit all children and destroy them */
             child_mem_sys = mem_sys->child_mem_sys;
     
    -        while (child_mem_sys != NULL){
    +        while (child_mem_sys) {
                 sibling_mem_sys = child_mem_sys->sibling_mem_sys;
                 apr_sms_destroy(child_mem_sys);
                 child_mem_sys = sibling_mem_sys;
             }
     
             /*
    -         * If the accounting memory system _is_ tracking, we also know that it is
    -         * not the memory system itself.
    +         * If the accounting memory system _is_ tracking, we also know that
    +         * it is not the memory system itself.
              */
    -        if (apr_sms_is_tracking(mem_sys->accounting_mem_sys)){
    +        if (apr_sms_is_tracking(mem_sys->accounting_mem_sys)) {
                 /* 
    -             * Run all cleanups, the memory will be freed by the destroying of the
    -             * accounting memory system.
    +             * Run all cleanups, the memory will be freed by the destroying
    +             * of the accounting memory system.
                  */
                 apr_sms_do_cleanups(mem_sys);
     
    @@ -405,63 +403,62 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
                 apr_sms_destroy(mem_sys->accounting_mem_sys);
     
                 /* 
    -             * Set the accounting memory system back to the parent memory system
    -             * just in case...
    +             * Set the accounting memory system back to the parent memory
    +             * system just in case...
                  */
                 mem_sys->accounting_mem_sys = mem_sys;
             }
    -        else
    -        {
    +        else {
                 /* Run all cleanups, free'ing memory as we go */
                 cleanup = mem_sys->cleanups;
     
    -            while (cleanup){
    +            while (cleanup) {
                     cleanup->cleanup_fn(cleanup->data);
                     next_cleanup = cleanup->next;
                     apr_sms_free(mem_sys->accounting_mem_sys, cleanup);
                     cleanup = next_cleanup;
                 }
     
    -            if (mem_sys->accounting_mem_sys != mem_sys)
    -            {
    +            if (mem_sys->accounting_mem_sys != mem_sys) {
                     /* Destroy the accounting memory system */
                     apr_sms_destroy(mem_sys->accounting_mem_sys);
    +                
                     /* 
    -                 * Set the accounting memory system back to the parent memory system
    -                 * just in case...
    +                 * Set the accounting memory system back to the parent memory
    +                 * system just in case...
                      */
                     mem_sys->accounting_mem_sys = mem_sys;
                 }
    -       }
    -  }
    +        }
    +    }
     
    -  /* Remove the memory system from the parent memory systems child list */
    -  if (mem_sys->sibling_mem_sys)
    -      mem_sys->sibling_mem_sys->ref_mem_sys = mem_sys->ref_mem_sys;
    +    /* Remove the memory system from the parent memory systems child list */
    +    if (mem_sys->sibling_mem_sys)
    +        mem_sys->sibling_mem_sys->ref_mem_sys = mem_sys->ref_mem_sys;
     
    -  if (mem_sys->ref_mem_sys)
    -      *mem_sys->ref_mem_sys = mem_sys->sibling_mem_sys;
    +    if (mem_sys->ref_mem_sys)
    +        *mem_sys->ref_mem_sys = mem_sys->sibling_mem_sys;
     
    -  /* Call the pre-destroy if present */
    -  if (mem_sys->pre_destroy_fn)
    -      mem_sys->pre_destroy_fn(mem_sys);
    +    /* Call the pre-destroy if present */
    +    if (mem_sys->pre_destroy_fn)
    +        mem_sys->pre_destroy_fn(mem_sys);
     
    -  /* 1 - If we have a self destruct, use it */
    -  if (mem_sys->destroy_fn)
    -      return mem_sys->destroy_fn(mem_sys);
    +    /* 1 - If we have a self destruct, use it */
    +    if (mem_sys->destroy_fn)
    +        return mem_sys->destroy_fn(mem_sys);
     
    -  /* 2 - If we don't have a parent, free using ourselves */
    -  if (!mem_sys->parent_mem_sys)
    -      return mem_sys->free_fn(mem_sys, mem_sys);
    +    /* 2 - If we don't have a parent, free using ourselves */
    +    if (!mem_sys->parent_mem_sys)
    +        return mem_sys->free_fn(mem_sys, mem_sys);
     
    -  /* 3 - If we do have a parent and it has a free function, use it */
    -  if (mem_sys->parent_mem_sys->free_fn)
    -      return apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
    +    /* 3 - If we do have a parent and it has a free function, use it */
    +    if (mem_sys->parent_mem_sys->free_fn)
    +        return apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
     
    -  /* 4 - Assume we are the child of a tracking memory system, and do nothing */
    +    /* 4 - Assume we are the child of a tracking memory system, do nothing */
     #ifdef APR_ASSERT_MEMORY
         mem_sys = mem_sys->parent_mem_sys;
    -    while (mem_sys){
    +    while (mem_sys) {
             if (apr_sms_is_tracking(mem_sys))
                 return APR_SUCCESS;
     
    @@ -469,6 +466,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
         }
         assert(0); /* Made the wrong assumption, so we assert */
     #endif /* APR_MEMORY_ASSERT */
    +    
         return APR_SUCCESS;
     }
     
    @@ -522,8 +520,10 @@ APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *mem_sys)
      */
     
     APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys, 
    -                                                   apr_int32_t type, void *data,
    -                                                   apr_status_t (*cleanup_fn)(void *))
    +                                                   apr_int32_t type,
    +                                                   void *data,
    +                                                   apr_status_t
    +                                                       (*cleanup_fn)(void *))
     {
         struct apr_sms_cleanup *cleanup;
     
    @@ -531,14 +531,15 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys,
             return APR_EMEMSYS;
     
     #ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys->accounting_mem_sys != NULL);
    +    assert(mem_sys->accounting_mem_sys);
     #endif
         
         if (!cleanup_fn)
             return APR_ENOTIMPL;
     
         cleanup = (struct apr_sms_cleanup *)
    -	    apr_sms_malloc(mem_sys->accounting_mem_sys, sizeof(struct apr_sms_cleanup));
    +                  apr_sms_malloc(mem_sys->accounting_mem_sys,
    +                                 sizeof(struct apr_sms_cleanup));
     
         if (!cleanup)
             return APR_ENOMEM;
    @@ -552,9 +553,11 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys,
         return APR_SUCCESS;
     }
     
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys, apr_int32_t type,
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys,
    +                                                     apr_int32_t type,
                                                          void *data,
    -                                                     apr_status_t (*cleanup_fn)(void *))
    +                                                     apr_status_t
    +                                                         (*cleanup_fn)(void *))
     {
         struct apr_sms_cleanup *cleanup;
         struct apr_sms_cleanup **cleanup_ref;
    @@ -563,13 +566,12 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys, apr_int
             return APR_EMEMSYS;
     
     #ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys->accounting_mem_sys != NULL);
    +    assert(mem_sys->accounting_mem_sys);
     #endif
             
         cleanup = mem_sys->cleanups;
         cleanup_ref = &mem_sys->cleanups;
    -    while (cleanup)
    -    {
    +    while (cleanup) {
             if ((type == 0 || cleanup->cleanup_fn == cleanup_fn) &&
                 cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) {
                 *cleanup_ref = cleanup->next;
    @@ -601,7 +603,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys,
             return APR_EMEMSYS;
             
     #ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys->accounting_mem_sys != NULL);
    +    assert(mem_sys->accounting_mem_sys);
     #endif
         
         cleanup = mem_sys->cleanups;
    @@ -611,7 +613,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys,
             if (type == 0 || cleanup->type == type) {
                 *cleanup_ref = cleanup->next;
     
    -            if (mem_sys->free_fn != NULL)
    +            if (mem_sys->free_fn)
                     apr_sms_free(mem_sys, cleanup);
     
                 cleanup = *cleanup_ref;
    @@ -627,16 +629,19 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys,
         return rv;
     }
     
    -APR_DECLARE(apr_status_t)  apr_sms_cleanup_run(apr_sms_t *mem_sys, apr_int32_t type,
    -                                               void *data, 
    -			                                   apr_status_t (*cleanup_fn)(void *))
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *mem_sys,
    +                                              apr_int32_t type,
    +                                              void *data, 
    +                                              apr_status_t
    +                                                  (*cleanup_fn)(void *))
     {
         apr_status_t rv;
     
         if (!mem_sys)
             return APR_EMEMSYS;
     
    -    if ((rv = apr_sms_cleanup_unregister(mem_sys, type, data, cleanup_fn)) != APR_SUCCESS)
    +    if ((rv = apr_sms_cleanup_unregister(mem_sys, type,
    +                                         data, cleanup_fn)) != APR_SUCCESS)
             return rv;
     
          return cleanup_fn(data);
    @@ -653,20 +658,19 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *mem_sys,
             return APR_EMEMSYS;
             
     #ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys->accounting_mem_sys != NULL);
    +    assert(mem_sys->accounting_mem_sys);
     #endif
         
         cleanup = mem_sys->cleanups;
         cleanup_ref = &mem_sys->cleanups;
         mem_sys = mem_sys->accounting_mem_sys;
    -    while (cleanup)
    -    {
    +    while (cleanup) {
             if (type == 0 || cleanup->type == type) {
                 *cleanup_ref = cleanup->next;
     
                 cleanup->cleanup_fn(cleanup->data);
                 
    -            if (mem_sys->free_fn != NULL)
    +            if (mem_sys->free_fn)
                     apr_sms_free(mem_sys, cleanup);
     
                 cleanup = *cleanup_ref;
    diff --git a/memory/unix/apr_sms_std.c b/memory/unix/apr_sms_std.c
    index 8bb0136ece6..9282faed468 100644
    --- a/memory/unix/apr_sms_std.c
    +++ b/memory/unix/apr_sms_std.c
    @@ -70,14 +70,14 @@
      * standard memory system
      */
     
    -static void * apr_sms_std_malloc(apr_sms_t *mem_sys,
    -                                 apr_size_t size)
    +static void *apr_sms_std_malloc(apr_sms_t *mem_sys,
    +                                apr_size_t size)
     {
         return malloc(size);
     }
     
    -static void * apr_sms_std_calloc(apr_sms_t *mem_sys,
    -                                 apr_size_t size)
    +static void *apr_sms_std_calloc(apr_sms_t *mem_sys,
    +                                apr_size_t size)
     {
     #if HAVE_CALLOC
         return calloc(1, size);
    @@ -90,8 +90,8 @@ static void * apr_sms_std_calloc(apr_sms_t *mem_sys,
     }
     
     
    -static void * apr_sms_std_realloc(apr_sms_t *mem_sys,
    -                                  void *mem, apr_size_t size)
    +static void *apr_sms_std_realloc(apr_sms_t *mem_sys,
    +                                 void *mem, apr_size_t size)
     {
         return realloc(mem, size);
     }
    @@ -107,14 +107,14 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys)
     {
         apr_sms_t *new_mem_sys;
     
    -    assert(mem_sys != NULL);
    +    assert(mem_sys);
     
         *mem_sys = NULL;
         /* should we be using apr_sms_calloc now we have it??? */
         new_mem_sys = apr_sms_create(malloc(sizeof(apr_sms_t)),
                                      NULL);
     
    -    if (new_mem_sys == NULL)
    +    if (!new_mem_sys)
             return APR_ENOMEM;
     
         new_mem_sys->malloc_fn  = apr_sms_std_malloc;
    @@ -125,6 +125,7 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys)
          * track of our allocations, we don't have apr_sms_reset or
          * apr_sms_destroy functions.
          */
    +    
         apr_sms_assert(new_mem_sys);
     
         *mem_sys = new_mem_sys;
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    index ab12d98da6a..9a1cf374372 100644
    --- a/memory/unix/apr_sms_tracking.c
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -85,24 +85,24 @@ typedef struct apr_sms_tracking_t
         apr_track_node_t    *nodes;
     } apr_sms_tracking_t;
     
    -static void * apr_sms_tracking_malloc(apr_sms_t *mem_sys,
    -                                      apr_size_t size)
    +static void *apr_sms_tracking_malloc(apr_sms_t *mem_sys,
    +                                     apr_size_t size)
     {
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
       
    -    assert (mem_sys != NULL);
    +    assert(mem_sys);
     
         tms = (apr_sms_tracking_t *)mem_sys;
         node = apr_sms_malloc(mem_sys->parent_mem_sys,
                               size + sizeof(apr_track_node_t));
    -    if (node == NULL)
    +    if (!node)
             return NULL;
     
         node->next = tms->nodes;
         tms->nodes = node;
         node->ref = &tms->nodes;
    -    if (node->next != NULL)
    +    if (node->next)
             node->next->ref = &node->next;
     
         node++;
    @@ -110,24 +110,24 @@ static void * apr_sms_tracking_malloc(apr_sms_t *mem_sys,
         return (void *)node;
     }
     
    -static  void * apr_sms_tracking_calloc(apr_sms_t *mem_sys, 
    -                                       apr_size_t size)
    +static void *apr_sms_tracking_calloc(apr_sms_t *mem_sys, 
    +                                     apr_size_t size)
     {
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
       
    -    assert (mem_sys != NULL);
    +    assert(mem_sys);
     
         tms = (apr_sms_tracking_t *)mem_sys;
         node = apr_sms_calloc(mem_sys->parent_mem_sys,
                               size + sizeof(apr_track_node_t));
    -    if (node == NULL)
    +    if (!node)
             return NULL;
     
         node->next = tms->nodes;
         tms->nodes = node;
         node->ref = &tms->nodes;
    -    if (node->next != NULL)
    +    if (node->next)
             node->next->ref = &node->next;
     
         node++;
    @@ -135,32 +135,31 @@ static  void * apr_sms_tracking_calloc(apr_sms_t *mem_sys,
         return (void *)node;
     }
     
    -static  void * apr_sms_tracking_realloc(apr_sms_t *mem_sys,
    -                                        void *mem, apr_size_t size)
    +static void *apr_sms_tracking_realloc(apr_sms_t *mem_sys,
    +                                      void *mem, apr_size_t size)
     {
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
     
    -    assert (mem_sys != NULL);
    +    assert(mem_sys);
     
         tms = (apr_sms_tracking_t *)mem_sys;
         node = (apr_track_node_t *)mem;
     
    -    if (node != NULL)
    -    {
    +    if (node) {
             node--;
             *(node->ref) = node->next;
         }
     
         node = apr_sms_realloc(mem_sys->parent_mem_sys,
                                node, size + sizeof(apr_track_node_t));
    -    if (node == NULL)
    +    if (!node)
             return NULL;
     
         node->next = tms->nodes;
         tms->nodes = node;
         node->ref = &tms->nodes;
    -    if (node->next != NULL)
    +    if (node->next)
             node->next->ref = &node->next;
     
         node++;
    @@ -168,19 +167,19 @@ static  void * apr_sms_tracking_realloc(apr_sms_t *mem_sys,
         return (void *)node;
     }
     
    -static  apr_status_t apr_sms_tracking_free(apr_sms_t *mem_sys,
    -                                           void *mem)
    +static apr_status_t apr_sms_tracking_free(apr_sms_t *mem_sys,
    +                                          void *mem)
     {
         apr_track_node_t *node;
     
    -    assert (mem_sys != NULL);
    -    assert (mem != NULL);
    +    assert(mem_sys);
    +    assert(mem);
     
         node = (apr_track_node_t *)mem;
         node--;
     
         *(node->ref) = node->next;
    -    if (node->next != NULL)
    +    if (node->next)
             node->next->ref = node->ref;
               
         return apr_sms_free(mem_sys->parent_mem_sys, node);
    @@ -192,31 +191,32 @@ static apr_status_t apr_sms_tracking_reset(apr_sms_t *mem_sys)
         apr_track_node_t *node;
         apr_status_t rv;
         
    -    assert (mem_sys != NULL);
    +    assert(mem_sys);
     
         tms = (apr_sms_tracking_t *)mem_sys;
     
    -    while (tms->nodes != NULL)
    -    {
    +    while (tms->nodes) {
             node = tms->nodes;
             *(node->ref) = node->next;
    -        if (node->next != NULL)
    +        if (node->next)
                 node->next->ref = node->ref;
             if ((rv = apr_sms_free(mem_sys->parent_mem_sys, 
                                    node)) != APR_SUCCESS)
                 return rv;
         }
    +    
         return APR_SUCCESS;
     }
     
     static apr_status_t apr_sms_tracking_destroy(apr_sms_t *mem_sys)
     {
         apr_status_t rv;
    +    
         /* If this is NULL we won't blow up as it should be caught at the
          * next level down and then passed back to us...
          */
     #ifdef APR_ASSERT_MEMORY
    -    assert (mem_sys->parent_mem_sys != NULL);
    +    assert(mem_sys->parent_mem_sys);
     #endif
         
         if (!mem_sys)
    @@ -224,6 +224,7 @@ static apr_status_t apr_sms_tracking_destroy(apr_sms_t *mem_sys)
     
         if ((rv = apr_sms_tracking_reset(mem_sys)) != APR_SUCCESS)
             return rv;
    +    
         return apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
     }
     
    @@ -233,8 +234,9 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys,
         apr_sms_t *new_mem_sys, *tmpms;
         apr_sms_tracking_t *tms;
     
    -    assert (mem_sys != NULL);
    -    assert (pms != NULL);
    +    assert(mem_sys);
    +    assert(pms);
    +    
         *mem_sys = NULL;
         /* changed this to 2 stages to make easier to follow...
          * should we be using apr_sms_calloc now we have it? 
    @@ -242,7 +244,7 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys,
         tmpms = apr_sms_malloc(pms, sizeof(apr_sms_tracking_t));
         new_mem_sys = apr_sms_create(tmpms, pms);
     
    -    if (new_mem_sys == NULL)
    +    if (!new_mem_sys)
             return APR_ENOMEM;
     
         new_mem_sys->malloc_fn  = apr_sms_tracking_malloc;
    
    From a13168e2faadc2013ee8b7c69e8395470e586a1b Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 22 May 2001 11:23:47 +0000
    Subject: [PATCH 1677/7878] minor tweak to the doc of apr_tokenize_to_argv
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61669 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_strings.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr_strings.h b/include/apr_strings.h
    index a381855eb9b..3aea147af06 100644
    --- a/include/apr_strings.h
    +++ b/include/apr_strings.h
    @@ -210,7 +210,7 @@ APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src);
     
     /**
      * Convert the arguments to a program from one string to an array of 
    - * strings term inated by a NULL
    + * strings terminated by a NULL pointer
      * @param str The arguments to convert
      * @param argv_out Output location.  This is a pointer to an array of strings.
      * @param token_context Pool to use.
    
    From 627e0730f2a41ee6cc37efccf5bdf314e8c41fc1 Mon Sep 17 00:00:00 2001
    From: Jean-Frederic Clere 
    Date: Tue, 22 May 2001 14:30:54 +0000
    Subject: [PATCH 1678/7878] Add APR_EFTYPE: /* Inappropriate file type or
     format */  EFTYPE in FreeBSD. Reviewed by:	William A. Rowe, Jr.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61670 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h | 8 ++++++++
     1 file changed, 8 insertions(+)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 0978a227a75..a5ed8b58bef 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -471,6 +471,12 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_ENETUNREACH    (APR_OS_START_CANONERR + 22)
     #endif
     
    +#ifdef EFTYPE
    +#define APR_EFTYPE
    +#else
    +#define APR_EFTYPE        (APR_OS_START_CANONERR + 23)
    +#endif
    +
     
     #if defined(OS2)
     
    @@ -582,6 +588,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
                     || (s) == APR_OS_START_SYSERR + SOCEHOSTUNREACH)
     #define APR_STATUS_IS_ENETUNREACH(s)    ((s) == APR_ENETUNREACH \
                     || (s) == APR_OS_START_SYSERR + SOCENETUNREACH)
    +#define APR_STATUS_IS_EFTYPE(s)         ((s) == APR_EFTYPE)
     
     /*
         Sorry, too tired to wrap this up for OS2... feel free to
    @@ -741,6 +748,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_ETIMEDOUT(s)       ((s) == APR_ETIMEDOUT)    
     #define APR_STATUS_IS_EHOSTUNREACH(s)    ((s) == APR_EHOSTUNREACH)
     #define APR_STATUS_IS_ENETUNREACH(s)     ((s) == APR_ENETUNREACH)
    +#define APR_STATUS_IS_EFTYPE(s)          ((s) == APR_EFTYPE)
     
     #endif /* !def OS2 || WIN32 */
     
    
    From 9cd4c45af502f03ae338849898b0f42c0e1ece91 Mon Sep 17 00:00:00 2001
    From: Jean-Frederic Clere 
    Date: Tue, 22 May 2001 15:08:25 +0000
    Subject: [PATCH 1679/7878] Arrange APR_EFTYPE EFTYPE was missing!
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61671 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index a5ed8b58bef..824b9eba490 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -472,7 +472,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #endif
     
     #ifdef EFTYPE
    -#define APR_EFTYPE
    +#define APR_EFTYPE EFTYPE
     #else
     #define APR_EFTYPE        (APR_OS_START_CANONERR + 23)
     #endif
    
    From df6e8bb1d5e116fb102af862b30db7626970d08c Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 23 May 2001 12:27:29 +0000
    Subject: [PATCH 1680/7878] Get HP-UX (11.0 at least) to build again by
     including the definition of shl_t.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61672 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_portable.h | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/include/apr_portable.h b/include/apr_portable.h
    index 0254551f8db..26c4bec7da8 100644
    --- a/include/apr_portable.h
    +++ b/include/apr_portable.h
    @@ -186,6 +186,7 @@ typedef struct timeval        apr_os_imp_time_t;
     typedef struct tm             apr_os_exp_time_t;
     /* dso types... */
     #if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
    +#include 
     typedef shl_t                 apr_os_dso_handle_t;
     #elif defined(DRAWIN)
     typedef NSModule              apr_os_dso_handle_t;
    
    From d64e606b0e8bb81d92c1ec518be65c58203c38cf Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 23 May 2001 14:15:53 +0000
    Subject: [PATCH 1681/7878] Add apr_strtok(), a thread-safe flavor of strtok()
     which has the same interface as strtok_r().
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61673 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES               |   4 ++
     apr.dsp               |   4 ++
     include/apr_strings.h |  14 +++++
     libapr.dsp            |   4 ++
     strings/Makefile.in   |   3 +-
     strings/apr_strtok.c  |  94 ++++++++++++++++++++++++++++
     test/.cvsignore       |   1 +
     test/Makefile.in      |   6 +-
     test/teststr.c        | 138 ++++++++++++++++++++++++++++++++++++++++++
     9 files changed, 266 insertions(+), 2 deletions(-)
     create mode 100644 strings/apr_strtok.c
     create mode 100644 test/teststr.c
    
    diff --git a/CHANGES b/CHANGES
    index 5ce7ad04afe..d62667bb411 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,4 +1,8 @@
     Changes with APR b1  
    +
    +  *) Add apr_strtok(), a thread-safe flavor of strtok() which has the
    +     same interface as strtok_r().  [Jeff Trawick]
    +     
       *) Add other child support to Win32 [Bill Stoddard]
     
       *) Other-child registrations are automatically removed when the
    diff --git a/apr.dsp b/apr.dsp
    index f8977f7e335..ff499ce85ac 100644
    --- a/apr.dsp
    +++ b/apr.dsp
    @@ -127,6 +127,10 @@ SOURCE=.\strings\apr_strings.c
     
     SOURCE=.\strings\apr_strnatcmp.c
     # End Source File
    +# Begin Source File
    +
    +SOURCE=.\strings\apr_strtok.c
    +# End Source File
     # End Group
     # Begin Group "passwd"
     
    diff --git a/include/apr_strings.h b/include/apr_strings.h
    index 3aea147af06..acbe0cee9c4 100644
    --- a/include/apr_strings.h
    +++ b/include/apr_strings.h
    @@ -220,6 +220,20 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str,
                                                    char ***argv_out,
                                                    apr_pool_t *token_context);
     
    +/**
    + * Split a string into separate '\0'-terminated tokens.  The tokens are 
    + * delimited in the string by one or more characters from the sep
    + * argument.
    + * @param str The string to separate; this should be specified on the
    + *            first call to apr_strtok() for a given string, and NULL
    + *            on subsequent calls.
    + * @param sep The set of delimiters
    + * @param last Internal state saved by apr_strtok() between calls.
    + * @return The next token from the string
    + * @deffunc char *apr_strtok(char *str, const char *sep, char **last)
    + */
    +APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last);
    +
     /*
      * These are snprintf implementations based on apr_vformatter().
      *
    diff --git a/libapr.dsp b/libapr.dsp
    index c20f8113203..8e5e87f8019 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -133,6 +133,10 @@ SOURCE=.\strings\apr_strings.c
     
     SOURCE=.\strings\apr_strnatcmp.c
     # End Source File
    +# Begin Source File
    +
    +SOURCE=.\strings\apr_strtok.c
    +# End Source File
     # End Group
     # Begin Group "passwd"
     
    diff --git a/strings/Makefile.in b/strings/Makefile.in
    index 2c1425c5e21..90e01877626 100644
    --- a/strings/Makefile.in
    +++ b/strings/Makefile.in
    @@ -4,7 +4,8 @@ TARGETS = \
     	apr_snprintf.lo \
     	apr_strnatcmp.lo \
     	apr_strings.lo \
    -	apr_fnmatch.lo
    +	apr_fnmatch.lo \
    +	apr_strtok.lo
     
     # bring in rules.mk for standard functionality
     @INCLUDE_RULES@
    diff --git a/strings/apr_strtok.c b/strings/apr_strtok.c
    new file mode 100644
    index 00000000000..6b569cc2db9
    --- /dev/null
    +++ b/strings/apr_strtok.c
    @@ -0,0 +1,94 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +#ifdef HAVE_STDDEF_H
    +#include         /* for NULL */
    +#endif
    +
    +#include "apr.h"
    +#include "apr_strings.h"
    +
    +#define APR_WANT_STRFUNC   /* for strchr() */
    +#include "apr_want.h"
    +
    +APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last)
    +{
    +    char *token;
    +
    +    if (!str)           /* subsequent call */
    +        str = *last;    /* start where we left off */
    +
    +    /* skip characters in sep (will terminate at '\0') */
    +    while (*str && strchr(sep, *str))
    +        ++str;
    +
    +    if (!*str)          /* no more tokens */
    +        return NULL;
    +
    +    token = str;
    +
    +    /* skip valid token characters to terminate token and
    +     * prepare for the next call (will terminate at '\0) 
    +     */
    +    *last = token + 1;
    +    while (**last && !strchr(sep, **last))
    +        ++*last;
    +
    +    if (**last) {
    +        **last = '\0';
    +        ++*last;
    +    }
    +
    +    return token;
    +}
    diff --git a/test/.cvsignore b/test/.cvsignore
    index 57d1c204912..6aa1d0b281a 100644
    --- a/test/.cvsignore
    +++ b/test/.cvsignore
    @@ -13,6 +13,7 @@ testoc
     testpipe
     testpoll
     testshmem
    +teststr
     testtime
     testthread
     client
    diff --git a/test/Makefile.in b/test/Makefile.in
    index 31ac59f5e32..ea8b8916d65 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -22,7 +22,8 @@ PROGRAMS = \
             testmd5@EXEEXT@ \
             testpoll@EXEEXT@ \
             testmem@EXEEXT@ \
    -	occhild@EXEEXT@
    +	occhild@EXEEXT@ \
    +        teststr@EXEEXT@
     
     TARGETS = $(PROGRAMS)
     
    @@ -114,4 +115,7 @@ testpoll@EXEEXT@: testpoll.lo $(LOCAL_LIBS)
     testmem@EXEEXT@: testmem.lo $(LOCAL_LIBS)
     	$(LINK) testmem.lo $(LOCAL_LIBS) $(ALL_LIBS)
     
    +teststr@EXEEXT@: teststr.lo $(LOCAL_LIBS)
    +	$(LINK) teststr.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +
     # DO NOT REMOVE
    diff --git a/test/teststr.c b/test/teststr.c
    new file mode 100644
    index 00000000000..64ec7b144c6
    --- /dev/null
    +++ b/test/teststr.c
    @@ -0,0 +1,138 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +#include 
    +#include 
    +#include 
    +
    +#include "apr_general.h"
    +#include "apr_strings.h"
    +
    +static void closeapr(void)
    +{
    +    apr_terminate();
    +}
    +
    +static void test_strtok(apr_pool_t *p)
    +{
    +    struct {
    +        char *input;
    +        char *sep;
    +    }
    +    tc[] = {
    +        {
    +            "",
    +            "Z"
    +        },
    +        {
    +            "      asdf jkl; 77889909            \r\n\1\2\3Z",
    +            " \r\n\3\2\1"
    +        },
    +        {
    +            NULL,  /* but who cares if apr_strtok() segfaults? */
    +            " \t"
    +        },
    +#if 0     /* don't do this... you deserve to segfault */
    +        {
    +            "a b c              ",
    +            NULL
    +        },
    +#endif
    +        {
    +            "   a       b        c   ",
    +            ""
    +        },
    +        {
    +            "a              b c         ",
    +            " "
    +        }
    +    };
    +    int curtc;
    +
    +    for (curtc = 0; curtc < sizeof tc / sizeof tc[0]; curtc++) {
    +        char *retval1, *retval2;
    +        char *str1, *str2;
    +        char *state;
    +
    +        str1 = apr_pstrdup(p, tc[curtc].input);
    +        str2 = apr_pstrdup(p, tc[curtc].input);
    +
    +        do {
    +            retval1 = apr_strtok(str1, tc[curtc].sep, &state);
    +            retval2 = strtok(str2, tc[curtc].sep);
    +
    +            if (!retval1)
    +                assert(!retval2);
    +            else {
    +                assert(retval2);
    +                assert(!strcmp(retval1, retval2));
    +            }
    +
    +            str1 = str2 = NULL; /* make sure we pass NULL on subsequent calls */
    +        } while (retval1);
    +    }
    +}
    +
    +int main(int argc, const char * const argv[])
    +{
    +    apr_pool_t *p;
    +
    +    apr_initialize();
    +    atexit(closeapr);
    +    apr_pool_create(&p, NULL);
    +
    +    test_strtok(p);
    +
    +    return 0;
    +}
    
    From 20e11a85bfef14c6e55bb51da0fc525890f42c72 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Wed, 23 May 2001 14:49:25 +0000
    Subject: [PATCH 1682/7878] Add a function to truncate a file without having to
     close and re-open the file.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61674 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/seek.c   | 9 +++++++++
     include/apr_file_io.h | 8 ++++++++
     2 files changed, 17 insertions(+)
    
    diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c
    index d50cfdc4db1..c4f4d8bec71 100644
    --- a/file_io/unix/seek.c
    +++ b/file_io/unix/seek.c
    @@ -53,6 +53,7 @@
      */
     
     #include "fileio.h"
    +#include 
     
     static apr_status_t setptr(apr_file_t *thefile, unsigned long pos )
     {
    @@ -125,3 +126,11 @@ apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_
             }
         }
     }
    +
    +apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset)
    +{
    +    if (ftruncate(fp->filedes, offset) == -1) {
    +        return errno;
    +    }
    +    return setptr(fp, offset);
    +}
    diff --git a/include/apr_file_io.h b/include/apr_file_io.h
    index 0e6e0e3b265..f1646bfcd94 100644
    --- a/include/apr_file_io.h
    +++ b/include/apr_file_io.h
    @@ -532,6 +532,14 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo,
                                               apr_int32_t wanted,
                                               apr_file_t *thefile);
     
    +
    +/**
    + * Truncate the file's length to the specified offset
    + * @param fp The file to truncate
    + * @param offset The offset to truncate to.
    + */
    +APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset);
    +
     /**
      * Get the pool used by the file.
      * @return apr_pool_t the pool
    
    From 5234ebe0cef46a40da7007be4d277a4f8388d180 Mon Sep 17 00:00:00 2001
    From: Ben Collins-Sussman 
    Date: Wed, 23 May 2001 15:08:44 +0000
    Subject: [PATCH 1683/7878] (apr_finfo_t):  note that this field doesn't work.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61675 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_file_info.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr_file_info.h b/include/apr_file_info.h
    index 7bdfecca6d0..0732e97d2e7 100644
    --- a/include/apr_file_info.h
    +++ b/include/apr_file_info.h
    @@ -189,7 +189,7 @@ struct apr_finfo_t {
         apr_time_t mtime;
         /** The time the file was last changed */
         apr_time_t ctime;
    -    /** The full pathname of the file */
    +    /** The full pathname of the file.  NOT YET IMPLEMENTED. */
         const char *fname;
         /** The file's name (no path) in filesystem case */
         const char *name;
    
    From c8ff66feed4996454188304334a8f61a8733001e Mon Sep 17 00:00:00 2001
    From: Ben Collins-Sussman 
    Date: Wed, 23 May 2001 17:43:59 +0000
    Subject: [PATCH 1684/7878] (apr_finfo_t):  revert comment.  my bad, I
     misunderstood the 'valid' field.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61676 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_file_info.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr_file_info.h b/include/apr_file_info.h
    index 0732e97d2e7..7bdfecca6d0 100644
    --- a/include/apr_file_info.h
    +++ b/include/apr_file_info.h
    @@ -189,7 +189,7 @@ struct apr_finfo_t {
         apr_time_t mtime;
         /** The time the file was last changed */
         apr_time_t ctime;
    -    /** The full pathname of the file.  NOT YET IMPLEMENTED. */
    +    /** The full pathname of the file */
         const char *fname;
         /** The file's name (no path) in filesystem case */
         const char *name;
    
    From dece1373aceff7938b59a664581eca57f9d650e9 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Tue, 29 May 2001 23:48:34 +0000
    Subject: [PATCH 1685/7878] Add a TODO for the memory stuff.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61677 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/TODO | 29 +++++++++++++++++++++++++++++
     1 file changed, 29 insertions(+)
     create mode 100644 memory/unix/TODO
    
    diff --git a/memory/unix/TODO b/memory/unix/TODO
    new file mode 100644
    index 00000000000..e107fa88572
    --- /dev/null
    +++ b/memory/unix/TODO
    @@ -0,0 +1,29 @@
    +This is just a small list of things yet to be done, or things
    +that we may want/need to consider.  I haven't put it in the
    +STATUS file for APR as none of these can be considered
    +showstoppers for the time being.
    +david - 28 May 2001
    +
    +- we need to add dynamic loading ability for memory
    +  systems.  As to how it should be done this needs to be
    +  looked at.  Some known issues include 
    +    o differing arguments for create functions
    +
    +  Just to clarify why this will be very cool if we can get
    +  it working, we give the user the ability to use 3rd party modules
    +  that can actually have almost total control over how the
    +  memory is allocated. Not sure I know of other libraries where
    +  this is possible.
    +
    +- given the problems that can occur when trying to find 
    +  alloc/free problems we should probably have a special debug
    +  memory system that records everything it does and any
    +  other information we think is useful.
    +
    +- in addition to the debugging system, we need to look at
    +  methods of checking memory allocations to ensure we're
    +  behaving when we have the ASSERT_MEMORY flag turned on.
    +  The pools in 1.3 had code from dean and Roy, Greg has added
    +  some special stuff for pools under Linux on 2.0, so we just
    +  need some ideas
    +
    
    From 33b1ee88534a0023a7e62bea6b40f5560541f729 Mon Sep 17 00:00:00 2001
    From: Martin Kraemer 
    Date: Wed, 30 May 2001 07:54:51 +0000
    Subject: [PATCH 1686/7878] First step at stamping out gif's: convert them to
     png
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61678 13f79535-47bb-0310-9956-ffa450edef68
    ---
     images/ball1.png   | Bin 0 -> 499 bytes
     images/ball2.png   | Bin 0 -> 436 bytes
     images/bug.png     | Bin 0 -> 383 bytes
     images/caution.png | Bin 0 -> 217 bytes
     images/master.png  | Bin 0 -> 3371 bytes
     images/tip.png     | Bin 0 -> 331 bytes
     images/warning.png | Bin 0 -> 217 bytes
     7 files changed, 0 insertions(+), 0 deletions(-)
     create mode 100644 images/ball1.png
     create mode 100644 images/ball2.png
     create mode 100644 images/bug.png
     create mode 100644 images/caution.png
     create mode 100644 images/master.png
     create mode 100644 images/tip.png
     create mode 100644 images/warning.png
    
    diff --git a/images/ball1.png b/images/ball1.png
    new file mode 100644
    index 0000000000000000000000000000000000000000..311d4b3fa7a38ff77d5b8d10adace33143acee99
    GIT binary patch
    literal 499
    zcmWNMO=#0l0LPyWjd)pzNI_Wd{wdwdq<*Xt(*qu^Dic90p5qVg|($
    zoWqD9^E)VtMRCM~IAKEYAQY>$XmJ};DAOG(wyt`q)We?d$Nz)>@jo4l20g9YTLA!`
    z&{4m_dK+^)Y++e3+upNUi1oz-wrx|YQA+3>q7Dz1Li5TfQq!p27BY{UqgsK7M87SyLvVh2>0;~Wm
    z0zn0W3^)xS3=lu@R-Ir6H=GIw{YSj7n!ng6g#3r&=e|S=XVgqj+vXKtHF+{|sCvgC
    zzjONCwecr=zf&5T-QSsi+?(HFrmpXtilqkj)P|+xvMaYQb-|I2rF4GN>iG+?{y+Yn
    zEAtP6!KuLy+KYd6eDJh6e=iw$9o#xvl5STo?|ygf)|+N+`o^rUBe2X5k%x(6msTn>
    zoiE2)!atgcNaOhPualmOB{cT*)4s^r^!-&do@q?F>+6FBpF$+?am(n4_ffnbmBQH*
    nLswIu`+i0bbbsq^bX9t9rp*QK+Q7!zF7^wA0#W}nX*lyAUsB7^
    
    literal 0
    HcmV?d00001
    
    diff --git a/images/ball2.png b/images/ball2.png
    new file mode 100644
    index 0000000000000000000000000000000000000000..cac3c07ab113a627c1a7d471636a9833d6b15376
    GIT binary patch
    literal 436
    zcmV;l0ZaagP)?rLX6Ha*6%T`r7@iUF1lJ_s(OBMc^PWkY^$h{ayqd<4<5qodVAbu
    zkD{|pGs1VIo2f;1qU
    zX>1H6fUGnyPD?We!Zc%`D3Acr#>Na_Xv_el85sQe&u;@#j7i?^F5=wRX7mF&hdo^!
    zLn>~S23{9BWWZC*Fg0+hfaC4||AR%`9$HP>Z4+^=K*rF%r*|`J!0WGNi{np3*2`ot
    zl}M#0iD+iZOl|(-rr_ONB=2=GW2L{O=354)+LxhhN}tTl&-jLENv%=a=NfR|+1X>+
    z7k-~@oGYeyy)bQcea*L7=G6A1`Jav{N~~Rc??j$`@0V9!ZhPLWJCd_!R;vwj48yte
    zwe7c0ZMT*xcstGh^`_%JKb_umm3VGsh;d->W`Dov)*1#gi@31wT>rk>GYbFUI-zNr
    y{t@UMu@cva66gHf+|;}h2H(V#RE6@)k_-iRPv3yLRN1LO6%3xPelF{r5}E)JCzlQY
    
    literal 0
    HcmV?d00001
    
    diff --git a/images/caution.png b/images/caution.png
    new file mode 100644
    index 0000000000000000000000000000000000000000..965fe7eb877a16fedbfd0f3d457d0d42632a6430
    GIT binary patch
    literal 217
    zcmeAS@N?(olHy`uVBq!ia0vp^f@~
    
    literal 0
    HcmV?d00001
    
    diff --git a/images/master.png b/images/master.png
    new file mode 100644
    index 0000000000000000000000000000000000000000..a5c0508a640621e3e8cc4830e1491aea8b69f4bf
    GIT binary patch
    literal 3371
    zcmV+`4b<|9P)nyEYf`mR
    zIrql3rE_CaArRh-YsOkB@2!m1V;Gb<0RPst|IVfFYXIkjDgUiX&Wthdi~#?}T3R^(
    z|JH=}wE*X}0Hu^l&b>MR_k{oVW6s7oDKY0#QhQ2Dr7O|4Ks6l#K6MQl%jf#;v8^gmdo*068%jwIL9DwWaq`LYx=~T3SM_IWbZ~A*Gaa
    z=W9aNN;zve7;~+R-g{ELQX!Nv5L$a{n_j41#iy_~gsIcsY%T7)@cj5%Y3b9>H&rHn#adpSzy
    zy~ed`dz?a2#*~~f00;m806RIhlmGw=nMp)JRCwB5m-|E7$QH*Bs3{6oYwM!j)@`@l
    zy?gIP5hMiy2?(Z$fMOz8m54klDl-57kN10K0@8cp116I*pPbj6p`+bwHhZ}DB8T{X
    zdVTtn<>nMWH>cOvr~Lh$5;=}%vT8QZXHnmGkAEyEIo{pd%bwm$pW^4B>6f(*v5-{z
    zuX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lZhE-t6=`MH%ve<7dN0UNHfoY
    zCn1?s7$_U@#=urUTNH^5Uko)x8csV&d3uWYR-Zr2sxy%~J4z_Y^zrrUFVcM}wdIBf0lhBKWS6)NVzJ@V(I&rEcEGJ0ePf}mkoQYZpgWc}S
    zNI3lZ_51f6BPI5=%~}_EQKITOQBBZ=;$c^s~pKGOLETI+Un}^>IQyS*FvGrY_6QaI#!je
    zt*)&}mHh>%WUZa43J5+mr=n?EXfw3Ai83t~{s)c3_+!<5IFJAU002ovPDHLkV1lq|
    Be&_%I
    
    literal 0
    HcmV?d00001
    
    diff --git a/images/tip.png b/images/tip.png
    new file mode 100644
    index 0000000000000000000000000000000000000000..82dfaa2abbd3f0370f6a2fb2d2484485a976e6a9
    GIT binary patch
    literal 331
    zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc3?z4jzqJQamH|E?uK)j^`47Zr&di(%L^IRQ
    z{7;(+L}${{(u`-GF`j8`oHo-K$WAi`vVfQYh!}u~K|R=^3`j91dAqv^Rqx3GvKi)i
    zx;TbZ+$s&YD0EnXX__NbZC>!b+)&yxywWjDQ4p
    O@{FgepUXO@geCy2gM|A4
    
    literal 0
    HcmV?d00001
    
    diff --git a/images/warning.png b/images/warning.png
    new file mode 100644
    index 0000000000000000000000000000000000000000..cf0d7ee4a833648cbac03ebfa9f7585ba65ff2a5
    GIT binary patch
    literal 217
    zcmeAS@N?(olHy`uVBq!ia0vp^fSNDdTRb0zGVRlsmkN3Q;NmG|hkvx3vK)>J7xNDR4&MP6eu9@O1Ta
    JS?83{1OOUTN-+Qc
    
    literal 0
    HcmV?d00001
    
    
    From 434d21ecb745383f39a2d185781b4f93991df9b8 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 30 May 2001 11:03:37 +0000
    Subject: [PATCH 1687/7878] Add an identity string to the memory modules. 
     Justin pointed out that there was no way of checking which module we were
     using, so now there is :)
    
    Updated the memory test to use the new test header and to check the
    identity returned.
    
    Submitted by:	Concept from Justin Erenkrantz
                    Refined by Sander Striker
    Reviewed by:	David Reid
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61679 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_sms.h              |  1 +
     memory/unix/apr_sms_std.c      |  3 ++
     memory/unix/apr_sms_tracking.c |  3 ++
     test/testmem.c                 | 79 ++++++++++++++++------------------
     4 files changed, 44 insertions(+), 42 deletions(-)
    
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index ba1de1296dc..e29db6ba738 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -93,6 +93,7 @@ struct apr_sms_t
       apr_sms_t  *sibling_mem_sys;
       apr_sms_t **ref_mem_sys;
       apr_sms_t  *accounting_mem_sys;
    +  const char *identity; /* a string identifying the module */
     
       struct apr_sms_cleanup *cleanups;
     
    diff --git a/memory/unix/apr_sms_std.c b/memory/unix/apr_sms_std.c
    index 9282faed468..bdf54d7ee8e 100644
    --- a/memory/unix/apr_sms_std.c
    +++ b/memory/unix/apr_sms_std.c
    @@ -66,6 +66,8 @@
     #include 
     #include 
     
    +static const char *module_identity = "STANDARD";
    +
     /*
      * standard memory system
      */
    @@ -121,6 +123,7 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys)
         new_mem_sys->calloc_fn  = apr_sms_std_calloc;
         new_mem_sys->realloc_fn = apr_sms_std_realloc;
         new_mem_sys->free_fn    = apr_sms_std_free;
    +    new_mem_sys->identity   = module_identity;
         /* as we're not a tracking memory module, i.e. we don't keep
          * track of our allocations, we don't have apr_sms_reset or
          * apr_sms_destroy functions.
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    index 9a1cf374372..40f48d2c72c 100644
    --- a/memory/unix/apr_sms_tracking.c
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -68,6 +68,8 @@
     #include 
     #include 
     
    +static const char *module_identity = "TRACKING";
    +
     /*
      * Simple tracking memory system
      */
    @@ -253,6 +255,7 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys,
         new_mem_sys->free_fn    = apr_sms_tracking_free;
         new_mem_sys->reset_fn   = apr_sms_tracking_reset;
         new_mem_sys->destroy_fn = apr_sms_tracking_destroy;
    +    new_mem_sys->identity   = module_identity;
     
         tms = (apr_sms_tracking_t *)new_mem_sys;
         tms->nodes = NULL;
    diff --git a/test/testmem.c b/test/testmem.c
    index 1ef8e8fe4e0..976466e2eaf 100644
    --- a/test/testmem.c
    +++ b/test/testmem.c
    @@ -59,6 +59,7 @@
     #include "apr_lib.h"
     #include "apr_strings.h"
     #include "apr_time.h"
    +#include "test_apr.h"
     #include 
     #include 
     #include 
    @@ -75,12 +76,13 @@ static void malloc_mem(apr_sms_t *ams)
     {
         int cntr;
         
    -    printf("\tMalloc'ing %d lumps of memory, each %d bytes......", 
    +    printf("    Malloc'ing %d lumps of memory, each %d bytes          ",
                LUMPS, LUMP_SIZE);
         for (cntr = 0;cntr < LUMPS;cntr ++){
             ptrs[cntr] = apr_sms_malloc(ams, LUMP_SIZE);
             if (!ptrs[cntr]){
    -            printf("Failed @ lump %d of %d\n", cntr + 1, LUMPS);
    +            printf("Failed\n");
    +            fprintf(stderr,"Failed @ lump %d of %d\n", cntr + 1, LUMPS);
                 exit (-1);
             }
         }
    @@ -91,21 +93,23 @@ static void calloc_mem(apr_sms_t *ams)
     {
         int cntr, cntr2;
         
    -    printf("\tCalloc'ing %d lumps of memory, each %d bytes......", 
    +    printf("    Calloc'ing %d lumps of memory, each %d bytes          ",
                LUMPS, LUMP_SIZE);
         for (cntr = 0;cntr < LUMPS;cntr ++){
             ptrs[cntr] = apr_sms_calloc(ams, LUMP_SIZE);
             if (!ptrs[cntr]){
    -            printf("Failed @ lump %d of %d\n", cntr + 1, LUMPS);
    +            printf("Failed\n");
    +            fprintf(stderr, "Failed @ lump %d of %d\n", cntr + 1, LUMPS);
                 exit (-1);
             }
         }
         printf ("OK\n");
    -    printf("\t (checking that memory is zeroed..................");
    +    printf("     (checking that memory is zeroed                      ");
         for (cntr = 0;cntr < LUMPS;cntr++){
             for (cntr2 = 0;cntr2 < LUMP_SIZE; cntr2 ++){
                 if (*(ptrs[cntr] + cntr2) != 0){
    -                printf("Failed!\nGot %d instead of 0 at byte %d\n",
    +                printf("Failed\n");
    +                fprintf(stderr, "Failed!\nGot %d instead of 0 at byte %d\n",
                            *(ptrs[cntr] + cntr2), cntr2 + 1);
                     exit (-1);
                 }
    @@ -118,20 +122,22 @@ static void do_test(apr_sms_t *ams)
     {
         int cntr,cntr2;
         
    -    printf("\tWriting to the lumps of memory......................");
    +    printf("    Writing to the lumps of memory                          ");
         for (cntr = 0;cntr < LUMPS;cntr ++){
             if (memset(ptrs[cntr], cntr, LUMP_SIZE) != ptrs[cntr]){
    -            printf("Failed to write into lump %d\n", cntr + 1);
    +            printf("Failed\n");
    +            fprintf(stderr,"Failed to write into lump %d\n", cntr + 1);
                 exit(-1);
             }
         }
         printf("OK\n");    
     
    -    printf("\tCheck what we wrote.................................");
    +    printf("    Check what we wrote                                     ");
         for (cntr = 0;cntr < LUMPS;cntr++){
             for (cntr2 = 0;cntr2 < LUMP_SIZE; cntr2 ++){
                 if (*(ptrs[cntr] + cntr2) != cntr){
    -                printf("Got %d instead of %d at byte %d\n",
    +                printf("Failed\n");
    +                fprintf(stderr,"Got %d instead of %d at byte %d\n",
                            *(ptrs[cntr] + cntr2), cntr, cntr2 + 1);
                     exit (-1);
                 }
    @@ -144,10 +150,11 @@ static void do_free(apr_sms_t *ams)
     {
         int cntr;
         
    -    printf("\tFreeing the memory we created.......................");
    +    printf("    Freeing the memory we created                           ");
         for (cntr = 0;cntr < LUMPS;cntr ++){
             if (apr_sms_free(ams, ptrs[cntr]) != APR_SUCCESS){
    -            printf("Failed to free block %d\n", cntr + 1);
    +            printf("Failed\n");
    +            fprintf(stderr,"Failed to free block %d\n", cntr + 1);
                 exit (-1);
             }
         }
    @@ -163,12 +170,11 @@ int main(void)
         printf("===============\n\n");
     
         printf("Standard Memory\n");
    -    printf("\tCreating the memory area............................");
    -    if (apr_sms_std_create(&ams) != APR_SUCCESS){
    -        printf("Failed.\n");
    -        exit(-1);
    -    }
    -    printf("OK\n");
    +    STD_TEST_NEQ("    Creating the memory system",
    +                 apr_sms_std_create(&ams))
    +    TEST_NEQ("    Checking identity of memory system",
    +             strcmp(ams->identity, "STANDARD"), 0,
    +             "OK","Not STANDARD")
     
         malloc_mem(ams);
         do_test(ams);
    @@ -178,38 +184,27 @@ int main(void)
         do_free(ams);
         
         printf("Tracking Memory\n");
    -    printf("\tCreating the memory area............................");
    -    if (apr_sms_tracking_create(&tms, ams) != APR_SUCCESS){
    -        printf("Failed.\n");
    -        exit(-1);
    -    }
    -    printf("OK\n");
    +    STD_TEST_NEQ("    Creating the memory system",
    +                 apr_sms_tracking_create(&tms, ams))
    +
    +    TEST_NEQ("    Checking the identity of the memory system",
    +             strcmp(tms->identity, "TRACKING"), 0,
    +             "OK", "Not TRACKING")
     
         malloc_mem(tms);
         do_test(tms);
    -    printf("\tAbout to reset the tracking memory..................");
    -    if (apr_sms_reset(tms) != APR_SUCCESS){
    -        printf("Failed.\n");
    -        exit(-1);
    -    }
    -    printf("OK\n");
    +    STD_TEST_NEQ("    About to reset the tracking system", apr_sms_reset(tms))
    +
         calloc_mem(tms);
         do_test(tms);
         do_free(tms);
         
    -    printf("Trying to destroy the tracking memory segment...............");
    -    if (apr_sms_destroy(tms) != APR_SUCCESS){
    -        printf("Failed.\n");
    -        exit (-1);
    -    }
    -    printf("OK\n");
    +    STD_TEST_NEQ("Trying to destroy the tracking memory system",
    +                 apr_sms_destroy(tms))
     
    -    printf("Trying to destroy the standard memory segment...............");
    -    if (apr_sms_destroy(ams) != APR_SUCCESS){
    -        printf("Failed.\n");
    -        exit (-1);
    -    }
    -    printf("OK\n\n");
    +
    +    STD_TEST_NEQ("Trying to destroy the standard memory system",
    +                 apr_sms_destroy(ams))
     
         printf("Memory test passed.\n");
         return (0);          
    
    From 9e07f2295a5ed6c59f3b641cc4399e55cca530ce Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 30 May 2001 11:15:36 +0000
    Subject: [PATCH 1688/7878] Add some more stuff to the TODO
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61680 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/TODO | 15 +++++++++++++++
     1 file changed, 15 insertions(+)
    
    diff --git a/memory/unix/TODO b/memory/unix/TODO
    index e107fa88572..4b3c8cc8f0f 100644
    --- a/memory/unix/TODO
    +++ b/memory/unix/TODO
    @@ -4,10 +4,20 @@ STATUS file for APR as none of these can be considered
     showstoppers for the time being.
     david - 28 May 2001
     
    +- add a shared memory module.
    +
    +- locking needs to be addressed.  The scope of the locks needs
    +  to be defined and it's likely we'll need some way of
    +  varying the scope when locking.
    +
     - we need to add dynamic loading ability for memory
       systems.  As to how it should be done this needs to be
       looked at.  Some known issues include 
         o differing arguments for create functions
    +    o it would be very cool to use the APR dso code, but
    +      as this uses pools and we're not using pools anywhere in the
    +      memory code (for obvious reasons) this is a bit of a stopper.
    +      Sander says he found the same thing with using the locking code
     
       Just to clarify why this will be very cool if we can get
       it working, we give the user the ability to use 3rd party modules
    @@ -27,3 +37,8 @@ david - 28 May 2001
       some special stuff for pools under Linux on 2.0, so we just
       need some ideas
     
    +Possible Extras
    +
    +- Is there any ebenfit in adding a version number to the memory
    +  systems?  This probably isn't an issue until we have dynamic 
    +  loading when binary memory systems may be distributed.
    
    From e2e045bbbd52d55d58b50fb7b0f5dac54b822377 Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Thu, 31 May 2001 00:11:12 +0000
    Subject: [PATCH 1689/7878] Add apr_file_open_stdin - which allows the stdin
     file handle to be obtained by an APR-based program in a portable fashion. 
     This completes the stdin/stdout/stderr calls.
    
    This is similar to the apr_file_open_std{out,err} calls.
    
    The Win32 and OS/2 folks will have to verify that I got their respective
    implementations right.  I don't have access to their compilers to ensure
    that it is correct.  I blindly coded these up based on the
    apr_file_open_std{out,err} implementations.
    
    Submitted by: Aaron Bannert 
    Reviewed by: Justin Erenkrantz
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61681 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES               |  3 +++
     file_io/os2/open.c    |  7 +++++++
     file_io/unix/open.c   |  7 +++++++
     file_io/win32/open.c  | 11 +++++++++++
     include/apr_file_io.h |  9 +++++++++
     5 files changed, 37 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index d62667bb411..41a1333fdc7 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,8 @@
     Changes with APR b1  
     
    +  *) Add apr_open_stdin.  This mirrors apr_open_stderr, except it works
    +     on stdin.  [Aaron Bannert ]
    +
       *) Add apr_strtok(), a thread-safe flavor of strtok() which has the
          same interface as strtok_r().  [Jeff Trawick]
          
    diff --git a/file_io/os2/open.c b/file_io/os2/open.c
    index 42c798f821d..bbe84c6c32e 100644
    --- a/file_io/os2/open.c
    +++ b/file_io/os2/open.c
    @@ -261,4 +261,11 @@ apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont)
     }
     
     
    +apr_status_t apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont)
    +{
    +    apr_os_file_t fd = 0;
    +
    +    return apr_os_file_put(thefile, &fd, cont);
    +}
    +
     APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt);
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index 25484522287..032891abea7 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -252,4 +252,11 @@ apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont)
         return apr_os_file_put(thefile, &fd, cont);
     }
     
    +apr_status_t apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont)
    +{
    +    int fd = STDIN_FILENO;
    +
    +    return apr_os_file_put(thefile, &fd, cont);
    +}
    +
     APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt);
    diff --git a/file_io/win32/open.c b/file_io/win32/open.c
    index f5996f71fed..ea6e17e8006 100644
    --- a/file_io/win32/open.c
    +++ b/file_io/win32/open.c
    @@ -439,4 +439,15 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t
         return apr_os_file_put(thefile, &file_handle, cont);
     }
     
    +APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont)
    +{
    +    apr_os_file_t file_handle;
    +
    +    file_handle = GetStdHandle(STD_INPUT_HANDLE);
    +    if (file_handle == INVALID_HANDLE_VALUE)
    +        return apr_get_os_error();
    +
    +    return apr_os_file_put(thefile, &file_handle, cont);
    +}
    +
     APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt);
    diff --git a/include/apr_file_io.h b/include/apr_file_io.h
    index f1646bfcd94..bb785b474f4 100644
    --- a/include/apr_file_io.h
    +++ b/include/apr_file_io.h
    @@ -203,6 +203,15 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile,
     APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile,
                                               apr_pool_t *cont);
     
    +/**
    + * open standard input as an apr file pointer.
    + * @param thefile The apr file to use as stdin.
    + * @param cont The pool to allocate the file out of.
    + * @deffunc apr_status_t apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont)
    + */
    +APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile,
    +                                              apr_pool_t *cont);
    +
     /**
      * Read data from the specified file.
      * @param thefile The file descriptor to read from.
    
    From 5c3bdc64f0dc26632f489871bc1c26c082e1b71b Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Thu, 31 May 2001 03:30:06 +0000
    Subject: [PATCH 1690/7878] Implement read write locks.  This commit will
     support POSIX pthread rw locks on Unix platforms.  This is based on earlier
     patches that I posted to apr-dev, but did not receive feedback from others
     on. Hence, I'm committing.
    
    This will require a buildconf run for those of you who use Unix.
    This has only really been tested on Solaris, but it should work
    for those platforms that have POSIX rw locks.  Other Unix
    platforms will simply return APR_ENOTIMPL.
    
    Add apr_lock_acquire_rw().  Notice that the Unix implementation
    will only allow a readwrite lock to be acquired via this function.
    Technically, apr_lock_acquire could obtain some sort of readwrite
    lock in this case, but that might lead to confusion.
    
    Added test/testlock.c which will attempt to test *both* APR_MUTEX
    and APR_READWRITE.  This was based off of the testthread.c, but has
    been rewritten to use the new stdin/stdout/stderr code and just
    make more sense overall.  testthread.c should probably be rewritten
    to test threading more specifically.
    
    Added framework that will hopefully still let BeOS, OS/2, and Win32
    compile.  Any operation relating to an APR_READWRITE lock on these
    platforms should just return APR_ENOTIMPL until the appropriate
    people get around to it.  Some structure has been added to make what
    they have to implement fairly obvious.  Again, I hope it compiles,
    but I can't guarantee it.
    
    Christian Gross has a Win32 readwrite lock patch floating around,
    but I can't vouch for Win32 code.  The other platforms probably
    have ways to do it, but I'm not sure what they are.
    
    (Sorry, I write long commit messages...)
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61682 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                   |   4 +
     configure.in              |   2 +-
     include/apr_lock.h        |  11 ++
     include/arch/unix/locks.h |   9 +-
     locks/beos/locks.c        |  94 ++++++++++----
     locks/os2/locks.c         |  88 ++++++++++----
     locks/unix/locks.c        |  80 ++++++++++++
     locks/win32/locks.c       |  87 ++++++++++---
     test/.cvsignore           |   1 +
     test/Makefile.in          |   4 +
     test/testlock.c           | 250 ++++++++++++++++++++++++++++++++++++++
     11 files changed, 562 insertions(+), 68 deletions(-)
     create mode 100644 test/testlock.c
    
    diff --git a/CHANGES b/CHANGES
    index 41a1333fdc7..3a0b7a713bd 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,9 @@
     Changes with APR b1  
     
    +  *) Implement APR_READWRITE locks on Unix with POSIX rwlocks.
    +     Introduce new apr_lock_acquire_rw() function which takes in 
    +     APR_READER or APR_WRITER.  [Justin Erenkrantz]
    +
       *) Add apr_open_stdin.  This mirrors apr_open_stderr, except it works
          on stdin.  [Aaron Bannert ]
     
    diff --git a/configure.in b/configure.in
    index 4ee64a151e4..3b978178e61 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -280,7 +280,7 @@ else
         if test "$pthreadh" = "1"; then
             APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS
             APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG
    -        AC_CHECK_FUNCS(pthread_key_delete)
    +        AC_CHECK_FUNCS(pthread_key_delete pthread_rwlock_init)
         fi
     fi
     
    diff --git a/include/apr_lock.h b/include/apr_lock.h
    index 47a091337bd..1be21ed1ab3 100644
    --- a/include/apr_lock.h
    +++ b/include/apr_lock.h
    @@ -71,6 +71,8 @@ typedef enum {APR_CROSS_PROCESS, APR_INTRAPROCESS, APR_LOCKALL} apr_lockscope_e;
     
     typedef enum {APR_MUTEX, APR_READWRITE} apr_locktype_e;
     
    +typedef enum {APR_READER, APR_WRITER} apr_readerwriter_e;
    +
     typedef struct apr_lock_t           apr_lock_t;
     
     /*   Function definitions */
    @@ -111,6 +113,15 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock,
      */
     APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock);
     
    +/**
    + * Lock a region with either a reader or writer lock.
    + * @param lock The lock to set.
    + * @param type The type of lock to acquire.
    + * @deffunc apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e type)
    + */
    +APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock,
    +                                              apr_readerwriter_e type);
    +
     /**
      * Unlock a protected region.
      * @param lock The lock to reset.
    diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h
    index b71638a0bca..beaecac25d7 100644
    --- a/include/arch/unix/locks.h
    +++ b/include/arch/unix/locks.h
    @@ -130,9 +130,12 @@ struct apr_lock_t {
     #if APR_USE_PTHREAD_SERIALIZE
         pthread_mutex_t *intraproc;
     #endif
    +#ifdef HAVE_PTHREAD_RWLOCK_INIT
    +    pthread_rwlock_t rwlock;
    +#endif
     #endif
         /* At some point, we should do a scope for both inter and intra process
    -     *  locking here.  Something like pthread_mutex with PTHREAD_PROCESS_SHARED
    +     * locking here.  Something like pthread_mutex with PTHREAD_PROCESS_SHARED
          */    
     };
     
    @@ -149,8 +152,8 @@ apr_status_t apr_unix_lock_inter(struct apr_lock_t *lock);
     apr_status_t apr_unix_unlock_inter(struct apr_lock_t *lock);
     apr_status_t apr_unix_destroy_inter_lock(struct apr_lock_t *lock);
     
    -apr_status_t apr_unix_child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, 
    -                            const char *fname);
    +apr_status_t apr_unix_child_init_lock(struct apr_lock_t **lock, 
    +                                      apr_pool_t *cont, const char *fname);
     
     #endif  /* LOCKS_H */
     
    diff --git a/locks/beos/locks.c b/locks/beos/locks.c
    index 9a915212ddc..b292c87e035 100644
    --- a/locks/beos/locks.c
    +++ b/locks/beos/locks.c
    @@ -62,7 +62,11 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
     {
         apr_lock_t *new;
         apr_status_t stat;
    -    
    +  
    +    /* FIXME: Remove when read write locks implemented. */ 
    +    if (type == APR_READWRITE)
    +        return APR_ENOTIMPL; 
    +
         new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t));
         if (new == NULL){
             return APR_ENOMEM;
    @@ -89,49 +93,95 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
     apr_status_t apr_lock_acquire(apr_lock_t *lock)
     {
         apr_status_t stat;
    -    
    -    if (lock->scope != APR_CROSS_PROCESS) {
    -        if ((stat = lock_intra(lock)) != APR_SUCCESS) {
    -            return stat;
    +
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
    +        if (lock->scope != APR_CROSS_PROCESS) {
    +            if ((stat = lock_intra(lock)) != APR_SUCCESS) {
    +                return stat;
    +            }
    +        }
    +        if (lock->scope != APR_INTRAPROCESS) {
    +            if ((stat = lock_inter(lock)) != APR_SUCCESS) {
    +                return stat;
    +            }
             }
    +        break;
    +    case APR_READWRITE:
    +        return APR_ENOTIMPL;
         }
    -    if (lock->scope != APR_INTRAPROCESS) {
    -        if ((stat = lock_inter(lock)) != APR_SUCCESS) {
    -            return stat;
    +
    +    return APR_SUCCESS;
    +}
    +
    +apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e)
    +{
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
    +        return APR_ENOTIMPL;
    +    case APR_READWRITE:
    +        switch (e)
    +        {
    +        case APR_READER:
    +            break;
    +        case APR_WRITER:
    +            break;
             }
    +        return APR_ENOTIMPL;
         }
    +
         return APR_SUCCESS;
     }
     
     apr_status_t apr_lock_release(apr_lock_t *lock)
     {
         apr_status_t stat;
    -    if (lock->scope != APR_CROSS_PROCESS) {
    -        if ((stat = unlock_intra(lock)) != APR_SUCCESS) {
    -            return stat;
    +
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
    +        if (lock->scope != APR_CROSS_PROCESS) {
    +            if ((stat = unlock_intra(lock)) != APR_SUCCESS) {
    +                return stat;
    +            }
             }
    -    }
    -    if (lock->scope != APR_INTRAPROCESS) {
    -        if ((stat = unlock_inter(lock)) != APR_SUCCESS) {
    -            return stat;
    +        if (lock->scope != APR_INTRAPROCESS) {
    +            if ((stat = unlock_inter(lock)) != APR_SUCCESS) {
    +                return stat;
    +            }
             }
    +        break;
    +    case APR_READWRITE:
    +        return APR_ENOTIMPL;
         }
    +
         return APR_SUCCESS;
     }
     
     apr_status_t apr_lock_destroy(apr_lock_t *lock)
     {
         apr_status_t stat; 
    -    if (lock->scope != APR_CROSS_PROCESS) {
    -        if ((stat = destroy_intra_lock(lock)) != APR_SUCCESS) {
    -            return stat;
    +
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
    +        if (lock->scope != APR_CROSS_PROCESS) {
    +            if ((stat = destroy_intra_lock(lock)) != APR_SUCCESS) {
    +                return stat;
    +            }
             }
    -    }
    -    if (lock->scope != APR_INTRAPROCESS) {
    -        if ((stat = destroy_inter_lock(lock)) != APR_SUCCESS) {
    -            return stat;
    +        if (lock->scope != APR_INTRAPROCESS) {
    +            if ((stat = destroy_inter_lock(lock)) != APR_SUCCESS) {
    +                return stat;
    +            }
             }
    +        break;
    +    case APR_READWRITE:
    +        return APR_ENOTIMPL;
         }
    +
         return APR_SUCCESS;
     }
     
    diff --git a/locks/os2/locks.c b/locks/os2/locks.c
    index 713e849b5d2..a0fae4b76bd 100644
    --- a/locks/os2/locks.c
    +++ b/locks/os2/locks.c
    @@ -71,14 +71,19 @@ static apr_status_t lock_cleanup(void *thelock)
     
     
     
    -apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, 
    -			   const char *fname, apr_pool_t *cont)
    +apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, 
    +                             apr_lockscope_e scope, const char *fname, 
    +                             apr_pool_t *cont)
     {
         apr_lock_t *new;
         ULONG rc;
         char *semname;
         PIB *ppib;
     
    +    /* FIXME: Remove when read write locks implemented. */
    +    if (type == APR_READWRITE)
    +        return APR_ENOTIMPL;
    +
         new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t));
         new->cntxt = cont;
         new->type  = type;
    @@ -131,27 +136,58 @@ apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname,
     apr_status_t apr_lock_acquire(apr_lock_t *lock)
     {
         ULONG rc;
    -    
    -    rc = DosRequestMutexSem(lock->hMutex, SEM_INDEFINITE_WAIT);
     
    -    if (rc == 0) {
    -        lock->owner = CurrentTid;
    -        lock->lock_count++;
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX: 
    +        rc = DosRequestMutexSem(lock->hMutex, SEM_INDEFINITE_WAIT);
    +
    +        if (rc == 0) {
    +            lock->owner = CurrentTid;
    +            lock->lock_count++;
    +        }
    +        break;
    +    case APR_READWRITE:
    +        return APR_ENOTIMPL;
         }
     
         return APR_OS2_STATUS(rc);
     }
     
    -
    +apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e)
    +{
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
    +        return APR_ENOTIMPL;
    +    case APR_READWRITE:
    +        switch (e)
    +        {
    +        case APR_READER:
    +            break;
    +        case APR_WRITER:
    +            break;
    +        }
    +        return APR_ENOTIMPL;
    +    }
    +    return APR_SUCCESS;
    +}
     
     apr_status_t apr_lock_release(apr_lock_t *lock)
     {
         ULONG rc;
         
    -    if (lock->owner == CurrentTid && lock->lock_count > 0) {
    -        lock->lock_count--;
    -        rc = DosReleaseMutexSem(lock->hMutex);
    -        return APR_OS2_STATUS(rc);
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
    +        if (lock->owner == CurrentTid && lock->lock_count > 0) {
    +            lock->lock_count--;
    +            rc = DosReleaseMutexSem(lock->hMutex);
    +            return APR_OS2_STATUS(rc);
    +        }
    +        break;
    +    case APR_READWRITE:
    +        return APR_ENOTIMPL;
         }
         
         return APR_SUCCESS;
    @@ -164,21 +200,27 @@ apr_status_t apr_lock_destroy(apr_lock_t *lock)
         ULONG rc;
         apr_status_t stat = APR_SUCCESS;
     
    -    if (lock->owner == CurrentTid) {
    -        while (lock->lock_count > 0 && stat == APR_SUCCESS)
    -            stat = apr_lock_release(lock);
    -    }
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
    +        if (lock->owner == CurrentTid) {
    +            while (lock->lock_count > 0 && stat == APR_SUCCESS)
    +                stat = apr_lock_release(lock);
     
    -    if (stat != APR_SUCCESS)
    -        return stat;
    +        if (stat != APR_SUCCESS)
    +            return stat;
             
    -    if (lock->hMutex == 0)
    -        return APR_SUCCESS;
    +        if (lock->hMutex == 0)
    +            return APR_SUCCESS;
     
    -    rc = DosCloseMutexSem(lock->hMutex);
    +        rc = DosCloseMutexSem(lock->hMutex);
         
    -    if (!rc)
    -        lock->hMutex = 0;
    +        if (!rc)
    +            lock->hMutex = 0;
    +        break;
    +    case APR_READWRITE:
    +        return APR_ENOTIMPL;
    +    }
             
         return APR_OS2_STATUS(rc);
     }
    diff --git a/locks/unix/locks.c b/locks/unix/locks.c
    index 52ae5900f83..f05681b3cff 100644
    --- a/locks/unix/locks.c
    +++ b/locks/unix/locks.c
    @@ -68,6 +68,9 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
         new->cntxt = cont;
         new->type  = type;
         new->scope = scope;
    +    switch (new->type)
    +    {
    +    case APR_MUTEX:
     #if (APR_USE_FCNTL_SERIALIZE) || (APR_USE_FLOCK_SERIALIZE)
         /* file-based serialization primitives */
         if (scope != APR_INTRAPROCESS) {
    @@ -97,6 +100,18 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
                 return stat;
             }
         }
    +    break;
    +    case APR_READWRITE:
    +#ifdef HAVE_PTHREAD_RWLOCK_INIT
    +    if (scope != APR_INTRAPROCESS)
    +        return APR_ENOTIMPL;
    +    pthread_rwlock_init(&new->rwlock, NULL);
    +    break;
    +#else
    +    return APR_ENOTIMPL;
    +#endif
    +    }
    +
         *lock = new;
         return APR_SUCCESS;
     }
    @@ -104,6 +119,10 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
     apr_status_t apr_lock_acquire(apr_lock_t *lock)
     {
         apr_status_t stat;
    +
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
     #if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */
         if (lock->scope == APR_INTRAPROCESS) {
     #else
    @@ -122,13 +141,49 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock)
                 return stat;
             }
         }
    +    break;
    +    case APR_READWRITE:
    +        return APR_ENOTIMPL;
    +    }
    +
         return APR_SUCCESS;
     }
     
    +apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e)
    +{
    +    apr_status_t stat = APR_SUCCESS;
    +
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
    +        return APR_ENOTIMPL;
    +    case APR_READWRITE:
    +#ifdef HAVE_PTHREAD_RWLOCK_INIT
    +        switch (e)
    +        {
    +        case APR_READER:
    +            stat = pthread_rwlock_rdlock(&lock->rwlock);
    +            break;
    +        case APR_WRITER:
    +            stat = pthread_rwlock_wrlock(&lock->rwlock);
    +            break;
    +        }
    +        break;
    +#else
    +        return APR_ENOTIMPL;
    +#endif
    +    }
    +
    +    return stat;
    +}
    +
     apr_status_t apr_lock_release(apr_lock_t *lock)
     {
         apr_status_t stat;
     
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
     #if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */
         if (lock->scope == APR_INTRAPROCESS) {
     #else
    @@ -147,12 +202,27 @@ apr_status_t apr_lock_release(apr_lock_t *lock)
                 return stat;
             }
         }
    +    break;
    +    case APR_READWRITE:
    +#ifdef HAVE_PTHREAD_RWLOCK_INIT
    +        if ((stat = pthread_rwlock_unlock(&lock->rwlock)) != 0)
    +            return stat;
    +        break;
    +#else
    +        return APR_ENOTIMPL;
    +#endif
    +    }
    +    
         return APR_SUCCESS;
     }
     
     apr_status_t apr_lock_destroy(apr_lock_t *lock)
     {
         apr_status_t stat;
    +
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
     #if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */
         if (lock->scope == APR_INTRAPROCESS) {
     #else
    @@ -173,6 +243,16 @@ apr_status_t apr_lock_destroy(apr_lock_t *lock)
                 return stat;
             }
         }
    +    break;
    +    case APR_READWRITE:
    +#ifdef HAVE_PTHREAD_RWLOCK_INIT
    +    if ((stat = pthread_rwlock_destroy(&lock->rwlock)) != 0)
    +        return stat;
    +    break;
    +#else
    +    return APR_ENOTIMPL;
    +#endif
    +    }
         return APR_SUCCESS;
     }
     
    diff --git a/locks/win32/locks.c b/locks/win32/locks.c
    index 41856a4fcc2..63f096f783f 100644
    --- a/locks/win32/locks.c
    +++ b/locks/win32/locks.c
    @@ -66,6 +66,10 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock,
         apr_lock_t *newlock;
         SECURITY_ATTRIBUTES sec;
     
    +    /* FIXME: Remove when read write locks implemented. */
    +    if (type == APR_READWRITE)
    +        return APR_ENOTIMPL;
    +
         newlock = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t));
     
         newlock->cntxt = cont;
    @@ -118,42 +122,87 @@ APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock,
     APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock)
     {
         DWORD rv;
    -    if (lock->scope == APR_INTRAPROCESS) {
    -        EnterCriticalSection(&lock->section);
    -        return APR_SUCCESS;
    -    } else {
    -        rv = WaitForSingleObject(lock->mutex, INFINITE);
    -
    -        if (rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) {
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
    +        if (lock->scope == APR_INTRAPROCESS) {
    +            EnterCriticalSection(&lock->section);
                 return APR_SUCCESS;
    +        } else {
    +            rv = WaitForSingleObject(lock->mutex, INFINITE);
    +
    +            if (rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) {
    +                return APR_SUCCESS;
    +            }
             }
    +        break;
    +    case APR_READWRITE:
    +        return APR_ENOTIMPL;
         }
    +
         return apr_get_os_error();
     }
     
    +APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock,
    +                                              apr_readerwriter_e e)
    +{
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
    +        return APR_ENOTIMPL;
    +    case APR_READWRITE:
    +        switch (e)
    +        {
    +        case APR_READER:
    +            break;
    +        case APR_WRITER:
    +            break;
    +        } 
    +        return APR_ENOTIMPL;
    +    }
    +
    +    return APR_SUCCESS;
    +}
    +
     APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock)
     {
    -    if (lock->scope == APR_INTRAPROCESS) {
    -        LeaveCriticalSection(&lock->section);
    -        return APR_SUCCESS;
    -    } else {
    -        if (ReleaseMutex(lock->mutex) == 0) {
    -            return apr_get_os_error();
    +    switch (apr->lock)
    +    {
    +    case APR_MUTEX:
    +        if (lock->scope == APR_INTRAPROCESS) {
    +            LeaveCriticalSection(&lock->section);
    +            return APR_SUCCESS;
    +        } else {
    +            if (ReleaseMutex(lock->mutex) == 0) {
    +                return apr_get_os_error();
    +            }
             }
    +        break;
    +    case APR_READWRITE:
    +        return APR_ENOTIMPL;
         }
    +
         return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock)
     {
    -    if (lock->scope == APR_INTRAPROCESS) {
    -        DeleteCriticalSection(&lock->section);
    -        return APR_SUCCESS;
    -    } else {
    -        if (CloseHandle(lock->mutex) == 0) {
    -            return apr_get_os_error();
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
    +        if (lock->scope == APR_INTRAPROCESS) {
    +            DeleteCriticalSection(&lock->section);
    +            return APR_SUCCESS;
    +        } else {
    +            if (CloseHandle(lock->mutex) == 0) {
    +                return apr_get_os_error();
    +            }
             }
    +        break;
    +    case APR_READWRITE:
    +        return APR_ENOTIMPL;
         }
    +
         return APR_SUCCESS;
     }
     
    diff --git a/test/.cvsignore b/test/.cvsignore
    index 6aa1d0b281a..20dd59dfb73 100644
    --- a/test/.cvsignore
    +++ b/test/.cvsignore
    @@ -39,3 +39,4 @@ mod_test.dll
     testnames
     *.dbg
     testmem
    +testlock
    diff --git a/test/Makefile.in b/test/Makefile.in
    index ea8b8916d65..c477bb46d67 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -9,6 +9,7 @@ PROGRAMS = \
     	testproc@EXEEXT@ \
     	testsock@EXEEXT@ \
     	testthread@EXEEXT@ \
    +	testlock@EXEEXT@ \
     	testtime@EXEEXT@ \
     	testargs@EXEEXT@ \
     	testcontext@EXEEXT@ \
    @@ -73,6 +74,9 @@ testproc@EXEEXT@: testproc.lo $(LOCAL_LIBS)
     testthread@EXEEXT@: testthread.lo $(LOCAL_LIBS)
     	$(LINK) testthread.lo $(LOCAL_LIBS) $(ALL_LIBS)
     
    +testlock@EXEEXT@: testlock.lo $(LOCAL_LIBS)
    +	$(LINK) testlock.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +
     testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ $(LOCAL_LIBS)
     	$(LINK) testsock.lo $(LOCAL_LIBS) $(ALL_LIBS)
     
    diff --git a/test/testlock.c b/test/testlock.c
    new file mode 100644
    index 00000000000..6da1872d22f
    --- /dev/null
    +++ b/test/testlock.c
    @@ -0,0 +1,250 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +#include "apr_thread_proc.h"
    +#include "apr_file_io.h"
    +#include "apr_lock.h"
    +#include "apr_errno.h"
    +#include "apr_general.h"
    +#include "errno.h"
    +#include 
    +#include 
    +#ifdef BEOS
    +#include 
    +#endif
    +
    +#if !APR_HAS_THREADS
    +int main(void)
    +{
    +    fprintf(stderr,
    +            "This program won't work on this platform because there is no "
    +            "support for threads.\n");
    +    return 0;
    +}
    +#else /* !APR_HAS_THREADS */
    +
    +#define MAX_ITER 40000
    +
    +void * APR_THREAD_FUNC thread_rw_func(void *data);
    +void * APR_THREAD_FUNC thread_func(void *data);
    +
    +apr_file_t *in, *out, *err;
    +apr_lock_t *thread_rw_lock, *thread_lock;
    +apr_pool_t *context;
    +int i = 0, x = 0;
    +
    +void * APR_THREAD_FUNC thread_rw_func(void *data)
    +{
    +    int exitLoop = 1;
    +
    +    while (1)
    +    {
    +        apr_lock_acquire_rw(thread_rw_lock, APR_READER);
    +        if (i == MAX_ITER)
    +            exitLoop = 0;
    +        apr_lock_release(thread_rw_lock);
    +
    +        if (!exitLoop)
    +            break;
    +
    +        apr_lock_acquire_rw(thread_rw_lock, APR_WRITER);
    +        if (i != MAX_ITER)
    +        {
    +            i++;
    +            x++;
    +        }
    +        apr_lock_release(thread_rw_lock);
    +    }
    +    return NULL;
    +} 
    +
    +void * APR_THREAD_FUNC thread_func(void *data)
    +{
    +    int exitLoop = 1;
    +
    +    while (1)
    +    {
    +        apr_lock_acquire(thread_lock);
    +        if (i == MAX_ITER)
    +            exitLoop = 0;
    +        else 
    +        {
    +            i++;
    +            x++;
    +        }
    +        apr_lock_release(thread_lock);
    +
    +        if (!exitLoop)
    +            break;
    +    }
    +    return NULL;
    +} 
    +
    +int test_rw(void)
    +{
    +    apr_thread_t *t1, *t2, *t3, *t4;
    +    apr_status_t s1, s2, s3, s4;
    +
    +    apr_file_printf(out, "Initializing the rw lock.");
    +    s1 = apr_lock_create(&thread_rw_lock, APR_READWRITE, APR_INTRAPROCESS, 
    +                         "lock.file", context); 
    +    if (s1 != APR_SUCCESS) {
    +        apr_file_printf(err, "Could not create lock\n");
    +        return s1;
    +    }
    +    apr_file_printf(out, " OK\n");
    +
    +    i = 0;
    +    x = 0;
    +
    +    apr_file_printf(out, "Starting all the threads......."); 
    +    s1 = apr_thread_create(&t1, NULL, thread_rw_func, NULL, context);
    +    s2 = apr_thread_create(&t2, NULL, thread_rw_func, NULL, context);
    +    s3 = apr_thread_create(&t3, NULL, thread_rw_func, NULL, context);
    +    s4 = apr_thread_create(&t4, NULL, thread_rw_func, NULL, context);
    +    if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || 
    +        s3 != APR_SUCCESS || s4 != APR_SUCCESS) {
    +        apr_file_printf(err, "Error starting threads\n");
    +        return s1;
    +    }
    +    apr_file_printf(out, "OK\n");
    +
    +    apr_file_printf(out, "Waiting for threads to exit.......");
    +    apr_thread_join(&s1, t1);
    +    apr_thread_join(&s2, t2);
    +    apr_thread_join(&s3, t3);
    +    apr_thread_join(&s4, t4);
    +    apr_file_printf(out, "OK\n");
    +
    +    apr_file_printf(out, "OK\n");
    +    if (x != MAX_ITER) {
    +        apr_file_printf(err, "The locks didn't work????  %d\n", x);
    +    }
    +    else {
    +        apr_file_printf(out, "Everything is working!\n");
    +    }
    +    return APR_SUCCESS;
    +}
    +
    +int test_exclusive(void)
    +{
    +    apr_thread_t *t1, *t2, *t3, *t4;
    +    apr_status_t s1, s2, s3, s4;
    +
    +    apr_file_printf(out, "Initializing the lock.");
    +    s1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, 
    +                         "lock.file", context); 
    +
    +    if (s1 != APR_SUCCESS) {
    +        apr_file_printf(err, "Could not create lock\n");
    +        return s1;
    +    }
    +    apr_file_printf(out, " OK\n");
    +
    +    i = 0;
    +    x = 0;
    +
    +    apr_file_printf(out, "Starting all the threads......."); 
    +    s1 = apr_thread_create(&t1, NULL, thread_func, NULL, context);
    +    s2 = apr_thread_create(&t2, NULL, thread_func, NULL, context);
    +    s3 = apr_thread_create(&t3, NULL, thread_func, NULL, context);
    +    s4 = apr_thread_create(&t4, NULL, thread_func, NULL, context);
    +    if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || 
    +        s3 != APR_SUCCESS || s4 != APR_SUCCESS) {
    +        apr_file_printf(err, "Error starting threads\n");
    +        return s1;
    +    }
    +    apr_file_printf(out, "OK\n");
    +
    +    apr_file_printf(out, "Waiting for threads to exit.......");
    +    apr_thread_join(&s1, t1);
    +    apr_thread_join(&s2, t2);
    +    apr_thread_join(&s3, t3);
    +    apr_thread_join(&s4, t4);
    +    apr_file_printf(out, "OK\n");
    +
    +    apr_file_printf(out, "OK\n");
    +    if (x != MAX_ITER) {
    +        apr_file_printf(err, "The locks didn't work????  %d\n", x);
    +    }
    +    else {
    +        apr_file_printf(out, "Everything is working!\n");
    +    }
    +    return APR_SUCCESS;
    +}
    +
    +int main(void)
    +{
    +    apr_initialize();
    +    atexit(apr_terminate);
    +
    +    if (apr_pool_create(&context, NULL) != APR_SUCCESS)
    +        exit(-1);
    +
    +    apr_file_open_stdin(&in, context); 
    +    apr_file_open_stdout(&out, context); 
    +    apr_file_open_stderr(&err, context); 
    +
    +    apr_file_printf(out, "OK\n");
    +
    +    if (test_rw() != APR_SUCCESS)
    +        exit(-2);
    +
    +    if (test_exclusive() != APR_SUCCESS)
    +        exit(-3);
    +
    +    return 1;
    +}
    +
    +#endif /* !APR_HAS_THREADS */
    
    From 98c8d741601ba60ef0f1620ad5d4a65c8589b401 Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Thu, 31 May 2001 04:10:03 +0000
    Subject: [PATCH 1691/7878] Dear Old Stockholm - 'Round About Midnight
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61683 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/STATUS b/STATUS
    index ea9a830161c..e32447b44b1 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -1,5 +1,5 @@
     APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS:			-*-text-*-
    -Last modified at [$Date: 2001/05/17 13:36:44 $]
    +Last modified at [$Date: 2001/05/31 04:10:03 $]
     
     Release:
     
    @@ -65,6 +65,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
         * add apr_crypt() and APR_HAS_CRYPT for apps to determine whether the
           crypt() function is available, and a way to call it (whether it is
           located in libc, libcrypt, or libufc)
    +      Justin says: Should apr_crypt() be in apr-util?
    +
             Status: Greg +1 (volunteers)
     
         * apr_create_lock() changes:
    @@ -76,6 +78,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
                         The fname parameter is essentially required if you
                         want to be portable, but I dislike wasting cycles to
                         outsmart the programmer.
    +        Justin says: The type parameter is now used.
             Status: david +1
                     rbb -1
     
    @@ -113,6 +116,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
         * I think apr_open_stderr() and friends dup() the descriptor. That
           would allow the new/returned file to be closed (via pool cleanup
           or manually) without accidentally closing stderr/out.
    +      Justin says: Is this "I think it should?"
     
         * need to export the shared library extension (e.g. ".so") for the
           platform. clients need to use this to construct filenames to
    
    From a59e6160975189848aebb9386439641daa251322 Mon Sep 17 00:00:00 2001
    From: "Victor J. Orlikowski" 
    Date: Fri, 1 Jun 2001 00:35:48 +0000
    Subject: [PATCH 1692/7878] Linux needs these options for the posix rwlocks to
     work. Normally, _SVID_SOURCE and _BSD_SOURCE are defined by default. However,
     we must re-define them if we define _XOPEN_SOURCE, which is needed for the
     rwlock definitions.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61684 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_hints.m4 | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/build/apr_hints.m4 b/build/apr_hints.m4
    index 49b4e3f1d0f..e892f5252b4 100644
    --- a/build/apr_hints.m4
    +++ b/build/apr_hints.m4
    @@ -115,9 +115,11 @@ dnl	       # Not a problem in 10.20.  Otherwise, who knows?
     	;;
         *-linux-*)
             case `uname -r` in
    -	    2.2* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2])
    +	    2.2* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2 -D_XOPEN_SOURCE=500])
    +	           APR_ADDTO(CPPFLAGS, [-D_BSD_SOURCE -D_SVID_SOURCE]) 
     	           ;;
    -	    2.0* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2])
    +	    2.0* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2 -D_XOPEN_SOURCE=500])
    +	           APR_ADDTO(CPPFLAGS, [-D_BSD_SOURCE -D_SVID_SOURCE])
     	           ;;
     	    1.* )  APR_ADDTO(CPPFLAGS, [-DLINUX=1])
     	           ;;
    
    From ace3c3ea022bcfcf920e19c3ffa702b904344771 Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Fri, 1 Jun 2001 02:57:02 +0000
    Subject: [PATCH 1693/7878] Revert Victor's patch for the _XOPEN_SOURCE
     (handled by configure now). Also allow 2.4 kernels to pick up the LINUX
     define (also 2.1, 2.3 can pick it up now).
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61685 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_hints.m4 | 6 +-----
     1 file changed, 1 insertion(+), 5 deletions(-)
    
    diff --git a/build/apr_hints.m4 b/build/apr_hints.m4
    index e892f5252b4..841cfa8e5be 100644
    --- a/build/apr_hints.m4
    +++ b/build/apr_hints.m4
    @@ -115,11 +115,7 @@ dnl	       # Not a problem in 10.20.  Otherwise, who knows?
     	;;
         *-linux-*)
             case `uname -r` in
    -	    2.2* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2 -D_XOPEN_SOURCE=500])
    -	           APR_ADDTO(CPPFLAGS, [-D_BSD_SOURCE -D_SVID_SOURCE]) 
    -	           ;;
    -	    2.0* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2 -D_XOPEN_SOURCE=500])
    -	           APR_ADDTO(CPPFLAGS, [-D_BSD_SOURCE -D_SVID_SOURCE])
    +	    2.* )  APR_ADDTO(CPPFLAGS, [-DLINUX=2])
     	           ;;
     	    1.* )  APR_ADDTO(CPPFLAGS, [-DLINUX=1])
     	           ;;
    
    From 56db976289b4a83c25244cb5ebf2bda9687ed407 Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Fri, 1 Jun 2001 02:58:31 +0000
    Subject: [PATCH 1694/7878] Detect the wacky Linux-specific condition where
     pthread_rwlock_init is defined, but the declaration of pthread_rwlock_t
     requires extra #defines.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61686 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 25 +++++++++++++++++++++++++
     1 file changed, 25 insertions(+)
    
    diff --git a/configure.in b/configure.in
    index 3b978178e61..b8c1b6711d6 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -281,6 +281,31 @@ else
             APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS
             APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG
             AC_CHECK_FUNCS(pthread_key_delete pthread_rwlock_init)
    +
    +        if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then
    +            dnl #----------------------------- Checking for pthread_rwlock_t
    +            dnl # Linux is silly as it has pthread_rwlock_init defined
    +            dnl # but keeps the pthread_rwlock_t structure hidden unless 
    +            dnl # special things are defined.
    +            AC_CACHE_CHECK([for pthread_rwlock_t], ac_cv_struct_pthread_rw,
    +                [AC_TRY_COMPILE([#include 
    +                #include ], 
    +                [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
    +                ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no)])
    +            if test "$ac_cv_struct_pthread_rw" = "no"; then
    +                AC_TRY_COMPILE([#define _XOPEN_SOURCE 500
    +                    #define _BSD_SOURCE
    +                    #define _SVID_SOURCE
    +                    #include 
    +                    #include ], 
    +                    [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
    +                    ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no)
    +                if test "$ac_cv_struct_pthread_rw" = "yes"; then
    +                    APR_ADDTO(CPPFLAGS, [-D_XOPEN_SOURCE=500 -D_BSD_SOURCE])
    +                    APR_ADDTO(CPPFLAGS, [-D_SVID_SOURCE])
    +                fi
    +            fi
    +        fi
         fi
     fi
     
    
    From 59e7dc2590c1e0292c3dd4329434b0ea3c85aeb4 Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Fri, 1 Jun 2001 09:59:36 +0000
    Subject: [PATCH 1695/7878] GCC's -Wshadow option complains about "optarg"
     shadowing another definition. This has started showing up with the recent
     POSIX/BSD/whatever preprocessor defines for the R/W lock stuff.
    
    Name the argument something else to shut up GCC.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61687 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_getopt.h | 15 ++++++++-------
     1 file changed, 8 insertions(+), 7 deletions(-)
    
    diff --git a/include/apr_getopt.h b/include/apr_getopt.h
    index 579cf983675..e206d4f26ac 100644
    --- a/include/apr_getopt.h
    +++ b/include/apr_getopt.h
    @@ -126,8 +126,8 @@ APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont,
      * @param opts   A string of characters that are acceptable options to the 
      *               program.  Characters followed by ":" are required to have an 
      *               option associated
    - * @param optch  The next option character parsed
    - * @param optarg The argument following the option character:
    + * @param option_ch  The next option character parsed
    + * @param option_arg The argument following the option character:
      * @return There are four potential status values on exit. They are:
      * 
      *             APR_EOF      --  No more options to parse
    @@ -138,7 +138,7 @@ APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont,
      * @deffunc apr_status_t apr_getopt(apr_getopt_t *os, const char *opts, char *optch, const char **optarg)
      */
     APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, 
    -                                     char *optch, const char **optarg);
    +                                     char *option_ch, const char **option_arg);
     
     /**
      * Parse the options initialized by apr_getopt_init(), accepting long
    @@ -149,9 +149,9 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts,
      *               can be initialized with { "name", optch, has_args }.  has_args
      *               is nonzero if the option requires an argument.  A structure
      *               with an optch value of 0 terminates the list.
    - * @param optch  Receives the value of "optch" from the apr_getopt_option_t
    - *               structure corresponding to the next option matched.
    - * @param optarg Receives the argument following the option, if any.
    + * @param option_ch  Receives the value of "optch" from the apr_getopt_option_t
    + *                   structure corresponding to the next option matched.
    + * @param option_arg Receives the argument following the option, if any.
      * @return There are four potential status values on exit.   They are:
      * 
      *             APR_EOF      --  No more options to parse
    @@ -168,7 +168,8 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts,
      */
     APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os,
     					  const apr_getopt_option_t *opts,
    -					  int *optch, const char **optarg);
    +					  int *option_ch,
    +                                          const char **option_arg);
     
     #ifdef __cplusplus
     }
    
    From 77271bb57a511993edd3ec939e8f21b634f4a12e Mon Sep 17 00:00:00 2001
    From: "Allan K. Edwards" 
    Date: Fri, 1 Jun 2001 15:05:18 +0000
    Subject: [PATCH 1696/7878] Fix typo that broke windows
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61688 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/win32/locks.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/locks/win32/locks.c b/locks/win32/locks.c
    index 63f096f783f..267b8ad9005 100644
    --- a/locks/win32/locks.c
    +++ b/locks/win32/locks.c
    @@ -166,7 +166,7 @@ APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock,
     
     APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock)
     {
    -    switch (apr->lock)
    +    switch (lock->type)
         {
         case APR_MUTEX:
             if (lock->scope == APR_INTRAPROCESS) {
    
    From 7f021712ac570c3b323ce212fedbae30633efb9b Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Fri, 1 Jun 2001 17:32:14 +0000
    Subject: [PATCH 1697/7878] This changes apr_sms_create into a more
     appropriately named apr_sms_init. It also now returns an apr_status_t which
     is more inline with the rest of the code.
    
    I've changed to using calloc for the memory structures rather
    than memset in the function, but we may want to change this again.
    This patch is a modified version of one submitted by Sander Striker.
    
    Submitted by:	Sander Striker 
    Reviewed by:	David Reid (applied in a modified form)
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61689 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_sms.h              | 14 ++++++--------
     memory/unix/apr_sms.c          | 31 +++++++++++++++++--------------
     memory/unix/apr_sms_std.c      | 13 ++++++++++---
     memory/unix/apr_sms_tracking.c | 19 ++++++++++++-------
     4 files changed, 45 insertions(+), 32 deletions(-)
    
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index e29db6ba738..d616264f36b 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -161,20 +161,18 @@ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys, void *mem);
      */
     
     /**
    - * Create a memory system (actually it initialized a memory system structure)
    + * Initialize a memory system
      * @caution Call this function as soon as you have obtained a block of memory
      *          to serve as a memory system structure from your 
      *          apr_xxx_sms_create. Only use this function when you are
      *          implementing a memory system.
    - * @param memory The memory to turn into a memory system
    - * @warning The memory passed in should be at least of size 
    - *          sizeof(apr_sms_t)
    + * @param mem_sys The memory system created
      * @param parent_mem_sys The parent memory system
    - * @return The freshly initialized memory system
    - * @deffunc apr_sms_t *apr_sms_create(void *memory,
    - *				   apr_sms_t *parent_mem_sys)
    + * @deffunc apr_status_t apr_sms_init(apr_sms_t *sms,
    + *				      apr_sms_t *parent_mem_sys)
      */
    -APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory, apr_sms_t *parent_mem_sys);
    +APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *mem_sys, 
    +                                       apr_sms_t *parent_mem_sys);
     
     /**
      * Check if a memory system is obeying all rules. 
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index 9f0bc1136aa..202ccfb43e5 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -177,37 +177,40 @@ static int apr_sms_is_tracking(apr_sms_t *mem_sys)
         return mem_sys->reset_fn != NULL;
     }
     
    -APR_DECLARE(apr_sms_t *) apr_sms_create(void *memory, 
    -                                        apr_sms_t *parent_mem_sys)
    +APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *mem_sys, 
    +                                       apr_sms_t *parent_mem_sys)
     {
    -    apr_sms_t *mem_sys;
    -
    -    if (!memory)
    -        return NULL;
    +    /* XXX - I've assumed that memory passed in will be zeroed,
    +     * i.e. calloc'd instead of malloc'd...
    +     * This may well be a bogus assumption, and if so we either need
    +     * to memset or have a series of =NULL's at the end.
    +     * This function is only called by modules, so this isn't as crazy
    +     * an assumption to make as it sounds :)
    +     */
     
    -    /* Just typecast it, and clear it */
    -    mem_sys = (apr_sms_t *)memory;
    -    memset(mem_sys, '\0', sizeof(apr_sms_t));
    +    if (!mem_sys)
    +        return APR_EINVAL;
     
    -    /* Initialize the parent and accounting memory system pointers */
         mem_sys->parent_mem_sys = parent_mem_sys;
         mem_sys->accounting_mem_sys = mem_sys;
    +    mem_sys->child_mem_sys = NULL;
     
    -    if (parent_mem_sys != NULL) {
    +    if (parent_mem_sys) {
             if ((mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys) != NULL)
                 mem_sys->sibling_mem_sys->ref_mem_sys = &mem_sys->sibling_mem_sys;
     
             mem_sys->ref_mem_sys = &parent_mem_sys->child_mem_sys;
    +        /* This is probably not correct as we could have multiple children
    +         * from a single parent...  We probably need a list...
    +         */
             parent_mem_sys->child_mem_sys = mem_sys;
         }
    -    /* This seems a bit redundant, but we're not taking chances */
         else {
             mem_sys->ref_mem_sys     = NULL;
             mem_sys->sibling_mem_sys = NULL;
    -        mem_sys->child_mem_sys   = NULL;
         }
     
    -    return mem_sys;
    +    return APR_SUCCESS;
     }
     
     #ifdef APR_MEMORY_ASSERT
    diff --git a/memory/unix/apr_sms_std.c b/memory/unix/apr_sms_std.c
    index bdf54d7ee8e..328615c66ba 100644
    --- a/memory/unix/apr_sms_std.c
    +++ b/memory/unix/apr_sms_std.c
    @@ -108,22 +108,28 @@ static apr_status_t apr_sms_std_free(apr_sms_t *mem_sys,
     APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys)
     {
         apr_sms_t *new_mem_sys;
    +    apr_status_t rv;
     
         assert(mem_sys);
     
         *mem_sys = NULL;
    -    /* should we be using apr_sms_calloc now we have it??? */
    -    new_mem_sys = apr_sms_create(malloc(sizeof(apr_sms_t)),
    -                                 NULL);
    +    /* We don't have a parent so we allocate the memory
    +     * for the structure ourselves...
    +     */
    +    new_mem_sys = apr_sms_std_calloc(NULL, sizeof(apr_sms_t));
     
         if (!new_mem_sys)
             return APR_ENOMEM;
     
    +    if ((rv = apr_sms_init(new_mem_sys, NULL)) != APR_SUCCESS)
    +        return rv;
    +
         new_mem_sys->malloc_fn  = apr_sms_std_malloc;
         new_mem_sys->calloc_fn  = apr_sms_std_calloc;
         new_mem_sys->realloc_fn = apr_sms_std_realloc;
         new_mem_sys->free_fn    = apr_sms_std_free;
         new_mem_sys->identity   = module_identity;
    +
         /* as we're not a tracking memory module, i.e. we don't keep
          * track of our allocations, we don't have apr_sms_reset or
          * apr_sms_destroy functions.
    @@ -134,3 +140,4 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys)
         *mem_sys = new_mem_sys;
         return APR_SUCCESS;
     }
    +
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    index 40f48d2c72c..0fda45b5e6e 100644
    --- a/memory/unix/apr_sms_tracking.c
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -173,7 +173,7 @@ static apr_status_t apr_sms_tracking_free(apr_sms_t *mem_sys,
                                               void *mem)
     {
         apr_track_node_t *node;
    -
    +    
         assert(mem_sys);
         assert(mem);
     
    @@ -192,7 +192,7 @@ static apr_status_t apr_sms_tracking_reset(apr_sms_t *mem_sys)
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
         apr_status_t rv;
    -    
    + 
         assert(mem_sys);
     
         tms = (apr_sms_tracking_t *)mem_sys;
    @@ -233,22 +233,26 @@ static apr_status_t apr_sms_tracking_destroy(apr_sms_t *mem_sys)
     APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys, 
                                                       apr_sms_t *pms)
     {
    -    apr_sms_t *new_mem_sys, *tmpms;
    +    apr_sms_t *new_mem_sys;
         apr_sms_tracking_t *tms;
    +    apr_status_t rv;
     
         assert(mem_sys);
         assert(pms);
         
         *mem_sys = NULL;
    -    /* changed this to 2 stages to make easier to follow...
    -     * should we be using apr_sms_calloc now we have it? 
    +    /* We're not a top level module, ie we have a parent, so
    +     * we allocate the memory for the structure from our parent.
    +     * This is safe as we shouldn't outlive our parent...
          */
    -    tmpms = apr_sms_malloc(pms, sizeof(apr_sms_tracking_t));
    -    new_mem_sys = apr_sms_create(tmpms, pms);
    +    new_mem_sys = apr_sms_calloc(pms, sizeof(apr_sms_tracking_t));
     
         if (!new_mem_sys)
             return APR_ENOMEM;
     
    +    if ((rv = apr_sms_init(new_mem_sys, pms)) != APR_SUCCESS)
    +        return rv;
    +
         new_mem_sys->malloc_fn  = apr_sms_tracking_malloc;
         new_mem_sys->calloc_fn  = apr_sms_tracking_calloc;
         new_mem_sys->realloc_fn = apr_sms_tracking_realloc;
    @@ -265,3 +269,4 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys,
         *mem_sys = new_mem_sys;
         return APR_SUCCESS;
     }
    +
    
    From 49d007b344b26b79b32e186918bf078a84f1e618 Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Sat, 2 Jun 2001 17:01:57 +0000
    Subject: [PATCH 1698/7878] Code reformat and APRization of types. Submitted
     by:	Sander Striker  Reviewed by:	Justin
     Erenkrantz
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61690 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_md5.h |  18 ++-
     passwd/apr_md5.c  | 319 +++++++++++++++++++++++-----------------------
     2 files changed, 171 insertions(+), 166 deletions(-)
    
    diff --git a/include/apr_md5.h b/include/apr_md5.h
    index e2de68e908d..a035bd5b431 100644
    --- a/include/apr_md5.h
    +++ b/include/apr_md5.h
    @@ -98,16 +98,14 @@ extern "C" {
     
     #define MD5_DIGESTSIZE 16
     
    -/* UINT4 defines a four byte word */
    -typedef unsigned int UINT4;
     typedef struct apr_md5_ctx_t apr_md5_ctx_t;
     
     /** MD5 context. */
     struct apr_md5_ctx_t {
         /** state (ABCD) */
    -    UINT4 state[4];
    +    apr_uint32_t state[4];
         /** number of bits, modulo 2^64 (lsb first) */
    -    UINT4 count[2];
    +    apr_uint32_t count[2];
         /** input buffer */
         unsigned char buffer[64];
     #if APR_HAS_XLATE
    @@ -132,7 +130,7 @@ APR_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context);
      */
     #if APR_HAS_XLATE
     APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context,
    -                                          apr_xlate_t *xlate);
    +                                            apr_xlate_t *xlate);
     #else
     #define apr_md5_set_xlate(context, xlate) APR_ENOTIMPL
     #endif
    @@ -146,8 +144,8 @@ APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context,
      * @deffunc apr_status_t apr_md5_update(apr_md5_ctx_t *context, apr_size_t char *input, unsigned int inputLen)
      */
     APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
    -                                        const unsigned char *input,
    -                                        apr_size_t inputLen);
    +                                         const unsigned char *input,
    +                                         apr_size_t inputLen);
     
     /**
      * MD5 finalization.  Ends an MD5 message-digest operation, writing the 
    @@ -157,7 +155,7 @@ APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
      * @deffunc apr_status_t apr_md5_final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context)
      */
     APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE],
    -                                       apr_md5_ctx_t *context);
    +                                        apr_md5_ctx_t *context);
     
     /**
      * Encode a password using an MD5 algorithm
    @@ -168,10 +166,10 @@ APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE],
      * @deffunc apr_status_t apr_md5_encode(const char *password, const char *salt, char *result, size_t nbytes)
      */
     APR_DECLARE(apr_status_t) apr_md5_encode(const char *password, const char *salt,
    -                                        char *result, size_t nbytes);
    +                                         char *result, size_t nbytes);
     
     #ifdef __cplusplus
     }
     #endif
     
    -#endif	/* !APR_MD5_H */
    +#endif /* !APR_MD5_H */
    diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c
    index a2aecb49f3e..b75626a96bf 100644
    --- a/passwd/apr_md5.c
    +++ b/passwd/apr_md5.c
    @@ -132,11 +132,11 @@
     #define S43 15
     #define S44 21
     
    -static void MD5Transform(UINT4 state[4], const unsigned char block[64]);
    -static void Encode(unsigned char *output, const UINT4 *input,
    -		   unsigned int len);
    -static void Decode(UINT4 *output, const unsigned char *input,
    -		   unsigned int len);
    +static void MD5Transform(apr_uint32_t state[4], const unsigned char block[64]);
    +static void Encode(unsigned char *output, const apr_uint32_t *input,
    +                   unsigned int len);
    +static void Decode(apr_uint32_t *output, const unsigned char *input,
    +                   unsigned int len);
     
     static unsigned char PADDING[64] =
     {
    @@ -161,25 +161,25 @@ static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_md5_encode() */
     #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
     
     /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
    -   Rotation is separate from addition to prevent recomputation.
    + * Rotation is separate from addition to prevent recomputation.
      */
     #define FF(a, b, c, d, x, s, ac) { \
    - (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
    + (a) += F ((b), (c), (d)) + (x) + (apr_uint32_t)(ac); \
      (a) = ROTATE_LEFT ((a), (s)); \
      (a) += (b); \
       }
     #define GG(a, b, c, d, x, s, ac) { \
    - (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
    + (a) += G ((b), (c), (d)) + (x) + (apr_uint32_t)(ac); \
      (a) = ROTATE_LEFT ((a), (s)); \
      (a) += (b); \
       }
     #define HH(a, b, c, d, x, s, ac) { \
    - (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
    + (a) += H ((b), (c), (d)) + (x) + (apr_uint32_t)(ac); \
      (a) = ROTATE_LEFT ((a), (s)); \
      (a) += (b); \
       }
     #define II(a, b, c, d, x, s, ac) { \
    - (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
    + (a) += I ((b), (c), (d)) + (x) + (apr_uint32_t)(ac); \
      (a) = ROTATE_LEFT ((a), (s)); \
      (a) += (b); \
       }
    @@ -189,14 +189,17 @@ static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_md5_encode() */
     APR_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context)
     {
         context->count[0] = context->count[1] = 0;
    +    
         /* Load magic initialization constants. */
         context->state[0] = 0x67452301;
         context->state[1] = 0xefcdab89;
         context->state[2] = 0x98badcfe;
         context->state[3] = 0x10325476;
    +    
     #if APR_HAS_XLATE
         context->xlate = NULL;
     #endif
    +    
         return APR_SUCCESS;
     }
     
    @@ -206,7 +209,7 @@ APR_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context)
      * digest.
      */
     APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context, 
    -                                         apr_xlate_t *xlate)
    +                                            apr_xlate_t *xlate)
     {
         apr_status_t rv;
         int is_sb;
    @@ -230,8 +233,8 @@ APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context,
        context.
      */
     APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
    -                                     const unsigned char *input,
    -                                     apr_size_t inputLen)
    +                                         const unsigned char *input,
    +                                         apr_size_t inputLen)
     {
         unsigned int i, idx, partLen;
     #if APR_HAS_XLATE
    @@ -239,29 +242,29 @@ APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
     #endif
     
         /* Compute number of bytes mod 64 */
    -    idx = (unsigned int) ((context->count[0] >> 3) & 0x3F);
    +    idx = (unsigned int)((context->count[0] >> 3) & 0x3F);
     
         /* Update number of bits */
    -    if ((context->count[0] += ((UINT4) inputLen << 3)) 
    -            < ((UINT4) inputLen << 3))
    -	context->count[1]++;
    -    context->count[1] += (UINT4) inputLen >> 29;
    +    if ((context->count[0] += ((apr_uint32_t)inputLen << 3)) 
    +            < ((apr_uint32_t)inputLen << 3))
    +        context->count[1]++;
    +    context->count[1] += (apr_uint32_t)inputLen >> 29;
     
         partLen = 64 - idx;
     
         /* Transform as many times as possible. */
     #if !APR_HAS_XLATE
         if (inputLen >= partLen) {
    -	memcpy(&context->buffer[idx], input, partLen);
    -	MD5Transform(context->state, context->buffer);
    +        memcpy(&context->buffer[idx], input, partLen);
    +        MD5Transform(context->state, context->buffer);
     
    -	for (i = partLen; i + 63 < inputLen; i += 64)
    -	    MD5Transform(context->state, &input[i]);
    +        for (i = partLen; i + 63 < inputLen; i += 64)
    +            MD5Transform(context->state, &input[i]);
     
    -	idx = 0;
    +        idx = 0;
         }
         else
    -	i = 0;
    +        i = 0;
     
         /* Buffer remaining input */
         memcpy(&context->buffer[idx], &input[i], inputLen - i);
    @@ -270,36 +273,36 @@ APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
             if (context->xlate) {
                 inbytes_left = outbytes_left = partLen;
                 apr_xlate_conv_buffer(context->xlate, input, &inbytes_left,
    -                                 &context->buffer[idx],&outbytes_left);
    +                                  &context->buffer[idx], &outbytes_left);
             }
             else {
                 memcpy(&context->buffer[idx], input, partLen);
             }
    -	MD5Transform(context->state, context->buffer);
    +        MD5Transform(context->state, context->buffer);
     
    -	for (i = partLen; i + 63 < inputLen; i += 64) {
    +        for (i = partLen; i + 63 < inputLen; i += 64) {
                 if (context->xlate) {
                     unsigned char inp_tmp[64];
                     inbytes_left = outbytes_left = 64;
                     apr_xlate_conv_buffer(context->xlate, &input[i], &inbytes_left,
    -                                     inp_tmp, &outbytes_left);
    +                                      inp_tmp, &outbytes_left);
                     MD5Transform(context->state, inp_tmp);
                 }
                 else {
                     MD5Transform(context->state, &input[i]);
                 }
    -	}
    +        }
     
    -	idx = 0;
    +        idx = 0;
         }
         else
    -	i = 0;
    +        i = 0;
     
         /* Buffer remaining input */
         if (context->xlate) {
             inbytes_left = outbytes_left = inputLen - i;
             apr_xlate_conv_buffer(context->xlate, &input[i], &inbytes_left,
    -                             &context->buffer[idx], &outbytes_left);
    +                              &context->buffer[idx], &outbytes_left);
         }
         else {
             memcpy(&context->buffer[idx], &input[i], inputLen - i);
    @@ -312,7 +315,7 @@ APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
        the message digest and zeroizing the context.
      */
     APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE],
    -                                      apr_md5_ctx_t *context)
    +                                        apr_md5_ctx_t *context)
     {
         unsigned char bits[8];
         unsigned int idx, padLen;
    @@ -326,7 +329,7 @@ APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE],
     #endif /*APR_HAS_XLATE*/
     
         /* Pad out to 56 mod 64. */
    -    idx = (unsigned int) ((context->count[0] >> 3) & 0x3f);
    +    idx = (unsigned int)((context->count[0] >> 3) & 0x3f);
         padLen = (idx < 56) ? (56 - idx) : (120 - idx);
         apr_md5_update(context, PADDING, padLen);
     
    @@ -345,82 +348,82 @@ APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE],
     /* MD5 basic transformation. Transforms state based on block. */
     static void MD5Transform(UINT4 state[4], const unsigned char block[64])
     {
    -    UINT4 a = state[0], b = state[1], c = state[2], d = state[3],
    -          x[MD5_DIGESTSIZE];
    +    apr_uint32_t a = state[0], b = state[1], c = state[2], d = state[3],
    +                 x[MD5_DIGESTSIZE];
     
         Decode(x, block, 64);
     
         /* Round 1 */
    -    FF(a, b, c, d, x[0], S11, 0xd76aa478);	/* 1 */
    -    FF(d, a, b, c, x[1], S12, 0xe8c7b756);	/* 2 */
    -    FF(c, d, a, b, x[2], S13, 0x242070db);	/* 3 */
    -    FF(b, c, d, a, x[3], S14, 0xc1bdceee);	/* 4 */
    -    FF(a, b, c, d, x[4], S11, 0xf57c0faf);	/* 5 */
    -    FF(d, a, b, c, x[5], S12, 0x4787c62a);	/* 6 */
    -    FF(c, d, a, b, x[6], S13, 0xa8304613);	/* 7 */
    -    FF(b, c, d, a, x[7], S14, 0xfd469501);	/* 8 */
    -    FF(a, b, c, d, x[8], S11, 0x698098d8);	/* 9 */
    -    FF(d, a, b, c, x[9], S12, 0x8b44f7af);	/* 10 */
    -    FF(c, d, a, b, x[10], S13, 0xffff5bb1);	/* 11 */
    -    FF(b, c, d, a, x[11], S14, 0x895cd7be);	/* 12 */
    -    FF(a, b, c, d, x[12], S11, 0x6b901122);	/* 13 */
    -    FF(d, a, b, c, x[13], S12, 0xfd987193);	/* 14 */
    -    FF(c, d, a, b, x[14], S13, 0xa679438e);	/* 15 */
    -    FF(b, c, d, a, x[15], S14, 0x49b40821);	/* 16 */
    +    FF(a, b, c, d, x[0],  S11, 0xd76aa478); /* 1 */
    +    FF(d, a, b, c, x[1],  S12, 0xe8c7b756); /* 2 */
    +    FF(c, d, a, b, x[2],  S13, 0x242070db); /* 3 */
    +    FF(b, c, d, a, x[3],  S14, 0xc1bdceee); /* 4 */
    +    FF(a, b, c, d, x[4],  S11, 0xf57c0faf); /* 5 */
    +    FF(d, a, b, c, x[5],  S12, 0x4787c62a); /* 6 */
    +    FF(c, d, a, b, x[6],  S13, 0xa8304613); /* 7 */
    +    FF(b, c, d, a, x[7],  S14, 0xfd469501); /* 8 */
    +    FF(a, b, c, d, x[8],  S11, 0x698098d8); /* 9 */
    +    FF(d, a, b, c, x[9],  S12, 0x8b44f7af); /* 10 */
    +    FF(c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
    +    FF(b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
    +    FF(a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
    +    FF(d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
    +    FF(c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
    +    FF(b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
     
         /* Round 2 */
    -    GG(a, b, c, d, x[1], S21, 0xf61e2562);	/* 17 */
    -    GG(d, a, b, c, x[6], S22, 0xc040b340);	/* 18 */
    -    GG(c, d, a, b, x[11], S23, 0x265e5a51);	/* 19 */
    -    GG(b, c, d, a, x[0], S24, 0xe9b6c7aa);	/* 20 */
    -    GG(a, b, c, d, x[5], S21, 0xd62f105d);	/* 21 */
    -    GG(d, a, b, c, x[10], S22, 0x2441453);	/* 22 */
    -    GG(c, d, a, b, x[15], S23, 0xd8a1e681);	/* 23 */
    -    GG(b, c, d, a, x[4], S24, 0xe7d3fbc8);	/* 24 */
    -    GG(a, b, c, d, x[9], S21, 0x21e1cde6);	/* 25 */
    -    GG(d, a, b, c, x[14], S22, 0xc33707d6);	/* 26 */
    -    GG(c, d, a, b, x[3], S23, 0xf4d50d87);	/* 27 */
    -    GG(b, c, d, a, x[8], S24, 0x455a14ed);	/* 28 */
    -    GG(a, b, c, d, x[13], S21, 0xa9e3e905);	/* 29 */
    -    GG(d, a, b, c, x[2], S22, 0xfcefa3f8);	/* 30 */
    -    GG(c, d, a, b, x[7], S23, 0x676f02d9);	/* 31 */
    -    GG(b, c, d, a, x[12], S24, 0x8d2a4c8a);	/* 32 */
    +    GG(a, b, c, d, x[1],  S21, 0xf61e2562); /* 17 */
    +    GG(d, a, b, c, x[6],  S22, 0xc040b340); /* 18 */
    +    GG(c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
    +    GG(b, c, d, a, x[0],  S24, 0xe9b6c7aa); /* 20 */
    +    GG(a, b, c, d, x[5],  S21, 0xd62f105d); /* 21 */
    +    GG(d, a, b, c, x[10], S22, 0x2441453);  /* 22 */
    +    GG(c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
    +    GG(b, c, d, a, x[4],  S24, 0xe7d3fbc8); /* 24 */
    +    GG(a, b, c, d, x[9],  S21, 0x21e1cde6); /* 25 */
    +    GG(d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
    +    GG(c, d, a, b, x[3],  S23, 0xf4d50d87); /* 27 */
    +    GG(b, c, d, a, x[8],  S24, 0x455a14ed); /* 28 */
    +    GG(a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
    +    GG(d, a, b, c, x[2],  S22, 0xfcefa3f8); /* 30 */
    +    GG(c, d, a, b, x[7],  S23, 0x676f02d9); /* 31 */
    +    GG(b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
     
         /* Round 3 */
    -    HH(a, b, c, d, x[5], S31, 0xfffa3942);	/* 33 */
    -    HH(d, a, b, c, x[8], S32, 0x8771f681);	/* 34 */
    -    HH(c, d, a, b, x[11], S33, 0x6d9d6122);	/* 35 */
    -    HH(b, c, d, a, x[14], S34, 0xfde5380c);	/* 36 */
    -    HH(a, b, c, d, x[1], S31, 0xa4beea44);	/* 37 */
    -    HH(d, a, b, c, x[4], S32, 0x4bdecfa9);	/* 38 */
    -    HH(c, d, a, b, x[7], S33, 0xf6bb4b60);	/* 39 */
    -    HH(b, c, d, a, x[10], S34, 0xbebfbc70);	/* 40 */
    -    HH(a, b, c, d, x[13], S31, 0x289b7ec6);	/* 41 */
    -    HH(d, a, b, c, x[0], S32, 0xeaa127fa);	/* 42 */
    -    HH(c, d, a, b, x[3], S33, 0xd4ef3085);	/* 43 */
    -    HH(b, c, d, a, x[6], S34, 0x4881d05);	/* 44 */
    -    HH(a, b, c, d, x[9], S31, 0xd9d4d039);	/* 45 */
    -    HH(d, a, b, c, x[12], S32, 0xe6db99e5);	/* 46 */
    -    HH(c, d, a, b, x[15], S33, 0x1fa27cf8);	/* 47 */
    -    HH(b, c, d, a, x[2], S34, 0xc4ac5665);	/* 48 */
    +    HH(a, b, c, d, x[5],  S31, 0xfffa3942); /* 33 */
    +    HH(d, a, b, c, x[8],  S32, 0x8771f681); /* 34 */
    +    HH(c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
    +    HH(b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
    +    HH(a, b, c, d, x[1],  S31, 0xa4beea44); /* 37 */
    +    HH(d, a, b, c, x[4],  S32, 0x4bdecfa9); /* 38 */
    +    HH(c, d, a, b, x[7],  S33, 0xf6bb4b60); /* 39 */
    +    HH(b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
    +    HH(a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
    +    HH(d, a, b, c, x[0],  S32, 0xeaa127fa); /* 42 */
    +    HH(c, d, a, b, x[3],  S33, 0xd4ef3085); /* 43 */
    +    HH(b, c, d, a, x[6],  S34, 0x4881d05);  /* 44 */
    +    HH(a, b, c, d, x[9],  S31, 0xd9d4d039); /* 45 */
    +    HH(d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
    +    HH(c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
    +    HH(b, c, d, a, x[2],  S34, 0xc4ac5665); /* 48 */
     
         /* Round 4 */
    -    II(a, b, c, d, x[0], S41, 0xf4292244);	/* 49 */
    -    II(d, a, b, c, x[7], S42, 0x432aff97);	/* 50 */
    -    II(c, d, a, b, x[14], S43, 0xab9423a7);	/* 51 */
    -    II(b, c, d, a, x[5], S44, 0xfc93a039);	/* 52 */
    -    II(a, b, c, d, x[12], S41, 0x655b59c3);	/* 53 */
    -    II(d, a, b, c, x[3], S42, 0x8f0ccc92);	/* 54 */
    -    II(c, d, a, b, x[10], S43, 0xffeff47d);	/* 55 */
    -    II(b, c, d, a, x[1], S44, 0x85845dd1);	/* 56 */
    -    II(a, b, c, d, x[8], S41, 0x6fa87e4f);	/* 57 */
    -    II(d, a, b, c, x[15], S42, 0xfe2ce6e0);	/* 58 */
    -    II(c, d, a, b, x[6], S43, 0xa3014314);	/* 59 */
    -    II(b, c, d, a, x[13], S44, 0x4e0811a1);	/* 60 */
    -    II(a, b, c, d, x[4], S41, 0xf7537e82);	/* 61 */
    -    II(d, a, b, c, x[11], S42, 0xbd3af235);	/* 62 */
    -    II(c, d, a, b, x[2], S43, 0x2ad7d2bb);	/* 63 */
    -    II(b, c, d, a, x[9], S44, 0xeb86d391);	/* 64 */
    +    II(a, b, c, d, x[0],  S41, 0xf4292244); /* 49 */
    +    II(d, a, b, c, x[7],  S42, 0x432aff97); /* 50 */
    +    II(c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
    +    II(b, c, d, a, x[5],  S44, 0xfc93a039); /* 52 */
    +    II(a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
    +    II(d, a, b, c, x[3],  S42, 0x8f0ccc92); /* 54 */
    +    II(c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
    +    II(b, c, d, a, x[1],  S44, 0x85845dd1); /* 56 */
    +    II(a, b, c, d, x[8],  S41, 0x6fa87e4f); /* 57 */
    +    II(d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
    +    II(c, d, a, b, x[6],  S43, 0xa3014314); /* 59 */
    +    II(b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
    +    II(a, b, c, d, x[4],  S41, 0xf7537e82); /* 61 */
    +    II(d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
    +    II(c, d, a, b, x[2],  S43, 0x2ad7d2bb); /* 63 */
    +    II(b, c, d, a, x[9],  S44, 0xeb86d391); /* 64 */
     
         state[0] += a;
         state[1] += b;
    @@ -431,33 +434,37 @@ static void MD5Transform(UINT4 state[4], const unsigned char block[64])
         memset(x, 0, sizeof(x));
     }
     
    -/* Encodes input (UINT4) into output (unsigned char). Assumes len is
    -   a multiple of 4.
    +/* Encodes input (apr_uint32_t) into output (unsigned char). Assumes len is
    + * a multiple of 4.
      */
    -static void Encode(unsigned char *output, const UINT4 *input, unsigned int len)
    +static void Encode(unsigned char *output, const apr_uint32_t *input,
    +                   unsigned int len)
     {
         unsigned int i, j;
    -    UINT4 k;
    +    apr_uint32_t k;
     
         for (i = 0, j = 0; j < len; i++, j += 4) {
    -	k = input[i];
    -	output[j] = (unsigned char) (k & 0xff);
    -	output[j + 1] = (unsigned char) ((k >> 8) & 0xff);
    -	output[j + 2] = (unsigned char) ((k >> 16) & 0xff);
    -	output[j + 3] = (unsigned char) ((k >> 24) & 0xff);
    +        k = input[i];
    +        output[j]     = (unsigned char)(k & 0xff);
    +        output[j + 1] = (unsigned char)((k >> 8) & 0xff);
    +        output[j + 2] = (unsigned char)((k >> 16) & 0xff);
    +        output[j + 3] = (unsigned char)((k >> 24) & 0xff);
         }
     }
     
    -/* Decodes input (unsigned char) into output (UINT4). Assumes len is
    +/* Decodes input (unsigned char) into output (apr_uint32_t). Assumes len is
      * a multiple of 4.
      */
    -static void Decode(UINT4 *output, const unsigned char *input, unsigned int len)
    +static void Decode(apr_uint32_t *output, const unsigned char *input,
    +                   unsigned int len)
     {
         unsigned int i, j;
     
         for (i = 0, j = 0; j < len; i++, j += 4)
    -	output[i] = ((UINT4) input[j]) | (((UINT4) input[j + 1]) << 8) |
    -	    (((UINT4) input[j + 2]) << 16) | (((UINT4) input[j + 3]) << 24);
    +        output[i] = ((apr_uint32_t)input[j])             |
    +                    (((apr_uint32_t)input[j + 1]) << 8)  |
    +                    (((apr_uint32_t)input[j + 2]) << 16) |
    +                    (((apr_uint32_t)input[j + 3]) << 24);
     }
     
     #if APR_CHARSET_EBCDIC
    @@ -483,11 +490,11 @@ static const char *apr1_id = "$apr1$";
     static void to64(char *s, unsigned long v, int n)
     {
         static unsigned char itoa64[] =         /* 0 ... 63 => ASCII - 64 */
    -	"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    +        "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
     
         while (--n >= 0) {
    -	*s++ = itoa64[v&0x3f];
    -	v >>= 6;
    +        *s++ = itoa64[v&0x3f];
    +        v >>= 6;
         }
     }
     
    @@ -518,14 +525,14 @@ APR_DECLARE(apr_status_t) apr_md5_encode(const char *pw, const char *salt,
          * If it starts with the magic string, then skip that.
          */
         if (!strncmp(sp, apr1_id, strlen(apr1_id))) {
    -	sp += strlen(apr1_id);
    +        sp += strlen(apr1_id);
         }
     
         /*
          * It stops at the first '$' or 8 chars, whichever comes first
          */
         for (ep = sp; (*ep != '\0') && (*ep != '$') && (ep < (sp + 8)); ep++) {
    -	continue;
    +        continue;
         }
     
         /*
    @@ -578,12 +585,12 @@ APR_DECLARE(apr_status_t) apr_md5_encode(const char *pw, const char *salt,
          * Then something really weird...
          */
         for (i = strlen(pw); i != 0; i >>= 1) {
    -	if (i & 1) {
    -	    apr_md5_update(&ctx, final, 1);
    -	}
    -	else {
    -	    apr_md5_update(&ctx, (unsigned char *)pw, 1);
    -	}
    +        if (i & 1) {
    +            apr_md5_update(&ctx, final, 1);
    +        }
    +        else {
    +            apr_md5_update(&ctx, (unsigned char *)pw, 1);
    +        }
         }
     
         /*
    @@ -602,28 +609,28 @@ APR_DECLARE(apr_status_t) apr_md5_encode(const char *pw, const char *salt,
          * need 30 seconds to build a 1000 entry dictionary...
          */
         for (i = 0; i < 1000; i++) {
    -	apr_md5_init(&ctx1);
    -	if (i & 1) {
    -	    apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw));
    -	}
    -	else {
    -	    apr_md5_update(&ctx1, final, MD5_DIGESTSIZE);
    -	}
    -	if (i % 3) {
    -	    apr_md5_update(&ctx1, (unsigned char *)sp, sl);
    -	}
    -
    -	if (i % 7) {
    -	    apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw));
    -	}
    -
    -	if (i & 1) {
    -	    apr_md5_update(&ctx1, final, MD5_DIGESTSIZE);
    -	}
    -	else {
    -	    apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw));
    -	}
    -	apr_md5_final(final,&ctx1);
    +        apr_md5_init(&ctx1);
    +        if (i & 1) {
    +            apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw));
    +        }
    +        else {
    +            apr_md5_update(&ctx1, final, MD5_DIGESTSIZE);
    +        }
    +        if (i % 3) {
    +            apr_md5_update(&ctx1, (unsigned char *)sp, sl);
    +        }
    +
    +        if (i % 7) {
    +            apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw));
    +        }
    +
    +        if (i & 1) {
    +            apr_md5_update(&ctx1, final, MD5_DIGESTSIZE);
    +        }
    +        else {
    +            apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw));
    +        }
    +        apr_md5_final(final,&ctx1);
         }
     
         p = passwd + strlen(passwd);
    @@ -660,20 +667,20 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd,
         char *crypt_pw;
     #endif
         if (!strncmp(hash, apr1_id, strlen(apr1_id))) {
    -	/*
    -	 * The hash was created using our custom algorithm.
    -	 */
    -	apr_md5_encode(passwd, hash, sample, sizeof(sample));
    +        /*
    +         * The hash was created using our custom algorithm.
    +         */
    +        apr_md5_encode(passwd, hash, sample, sizeof(sample));
         }
         else {
    -	/*
    -	 * It's not our algorithm, so feed it to crypt() if possible.
    -	 */
    +        /*
    +         * It's not our algorithm, so feed it to crypt() if possible.
    +         */
     #if defined(WIN32) || defined(BEOS)
    -	apr_cpystrn(sample, passwd, sizeof(sample) - 1);
    +        apr_cpystrn(sample, passwd, sizeof(sample) - 1);
     #else
    -	crypt_pw = crypt(passwd, hash);
    -	apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1);
    +        crypt_pw = crypt(passwd, hash);
    +        apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1);
     #endif
         }
         return (strcmp(sample, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH;
    
    From ffc52b72fd1166e1e506740fb705182c77608cce Mon Sep 17 00:00:00 2001
    From: Ben Laurie 
    Date: Sun, 3 Jun 2001 11:15:30 +0000
    Subject: [PATCH 1699/7878] Lurking out-of-date type.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61691 13f79535-47bb-0310-9956-ffa450edef68
    ---
     passwd/apr_md5.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c
    index b75626a96bf..d507dfd1a45 100644
    --- a/passwd/apr_md5.c
    +++ b/passwd/apr_md5.c
    @@ -346,7 +346,7 @@ APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE],
     }
     
     /* MD5 basic transformation. Transforms state based on block. */
    -static void MD5Transform(UINT4 state[4], const unsigned char block[64])
    +static void MD5Transform(apr_uint32_t state[4], const unsigned char block[64])
     {
         apr_uint32_t a = state[0], b = state[1], c = state[2], d = state[3],
                      x[MD5_DIGESTSIZE];
    
    From 4e6fffec3360d7212ac8789c66198cda22b6e64a Mon Sep 17 00:00:00 2001
    From: Ben Laurie 
    Date: Sun, 3 Jun 2001 11:31:47 +0000
    Subject: [PATCH 1700/7878] Doxygenation.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61692 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_pools.h | 25 +++++++++++++++++++++++--
     1 file changed, 23 insertions(+), 2 deletions(-)
    
    diff --git a/include/apr_pools.h b/include/apr_pools.h
    index b1a6ea6a28e..2f413a8eb0e 100644
    --- a/include/apr_pools.h
    +++ b/include/apr_pools.h
    @@ -97,7 +97,10 @@ typedef struct apr_pool_t apr_pool_t;
     /** A function that is called when allocation fails. */
     typedef int (*apr_abortfunc_t)(int retcode);
     
    -/* pools have nested lifetimes -- sub_pools are destroyed when the
    +/**
    + * @defgroup PoolDebug Pool Debugging functions.
    + *
    + * pools have nested lifetimes -- sub_pools are destroyed when the
      * parent pool is cleared.  We allow certain liberties with operations
      * on things such as tables (and on other structures in a more general
      * sense) where we allow the caller to insert values into a table which
    @@ -133,9 +136,24 @@ typedef int (*apr_abortfunc_t)(int retcode);
      * In this case the caller must call apr_pool_join() to indicate this
      * guarantee to the APR_POOL_DEBUG code.  There are a few examples spread
      * through the standard modules.
    + *
    + * These functions are only implemented when #APR_POOL_DEBUG is set.
    + *
    + * @{
    + */
    +#if defined(APR_POOL_DEBUG) || defined(DOXYGEN)
    +/**
    + * Guarantee that a subpool has the same lifetime as the parent.
    + * @param p The parent pool
    + * @param sub The subpool
      */
    -#ifdef APR_POOL_DEBUG
     APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub);
    +
    +/**
    + * Find a pool from something allocated in it.
    + * @param ts The thing allocated in the pool
    + * @return The pool it is allocated in
    + */
     APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts);
     
     /**
    @@ -146,6 +164,9 @@ APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts);
      *         of all pools.
      */
     APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b);
    +
    +/* @} */
    +
     #else
     # ifdef apr_pool_join
     #  undef apr_pool_join
    
    From 762a1aee8dc8c6aa83b230908c9475dd3371972a Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Mon, 4 Jun 2001 18:11:09 +0000
    Subject: [PATCH 1701/7878] - adds some trivial error checking. Maybe someone  
     wants to complete this by adding the less trivial   error checks?
    
    - adds a direct md5 computation function:
    
      apr_status_t apr_md5(unsigned char digest[MD5_DIGESTSIZE],
                           const unsigned char *input,
                           apr_size_t inputLen);
    
    This will return the md5 digest of the given input block.
    Submitted by:	Sander Striker 
    Reviewed by:	Justin Erenkrantz
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61693 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_md5.h | 11 +++++++++++
     passwd/apr_md5.c  | 35 ++++++++++++++++++++++++++++++++---
     2 files changed, 43 insertions(+), 3 deletions(-)
    
    diff --git a/include/apr_md5.h b/include/apr_md5.h
    index a035bd5b431..11ea222ab3f 100644
    --- a/include/apr_md5.h
    +++ b/include/apr_md5.h
    @@ -157,6 +157,17 @@ APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
     APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE],
                                             apr_md5_ctx_t *context);
     
    +/**
    + * MD5 in one step
    + * @param digest The final MD5 digest
    + * @param input The message block to use
    + * @param inputLen The length of the message block
    + * @deffunc apr_status_t apr_md5(unsigned char digest[MD5_DIGESTSIZE], const unsigned char *input, apr_size_t size);
    + */
    +APR_DECLARE(apr_status_t) apr_md5(unsigned char digest[MD5_DIGESTSIZE],
    +                                  const unsigned char *input,
    +                                  apr_size_t inputLen);
    +
     /**
      * Encode a password using an MD5 algorithm
      * @param password The password to encode
    diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c
    index d507dfd1a45..55251c368d1 100644
    --- a/passwd/apr_md5.c
    +++ b/passwd/apr_md5.c
    @@ -188,6 +188,9 @@ static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_md5_encode() */
      */
     APR_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context)
     {
    +    if (!context)
    +        return APR_EINVAL;
    +    
         context->count[0] = context->count[1] = 0;
         
         /* Load magic initialization constants. */
    @@ -214,6 +217,9 @@ APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context,
         apr_status_t rv;
         int is_sb;
     
    +    if (!context)
    +        return APR_EINVAL;
    +    
         /* TODO: remove the single-byte-only restriction from this code
          */
         rv = apr_xlate_get_sb(xlate, &is_sb);
    @@ -229,8 +235,8 @@ APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context,
     #endif /* APR_HAS_XLATE */
     
     /* MD5 block update operation. Continues an MD5 message-digest
    -   operation, processing another message block, and updating the
    -   context.
    + * operation, processing another message block, and updating the
    + * context.
      */
     APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
                                              const unsigned char *input,
    @@ -241,6 +247,9 @@ APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
         apr_size_t inbytes_left, outbytes_left;
     #endif
     
    +    if (!context)
    +        return APR_EINVAL;
    +    
         /* Compute number of bytes mod 64 */
         idx = (unsigned int)((context->count[0] >> 3) & 0x3F);
     
    @@ -312,7 +321,7 @@ APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
     }
     
     /* MD5 finalization. Ends an MD5 message-digest operation, writing the
    -   the message digest and zeroizing the context.
    + * the message digest and zeroizing the context.
      */
     APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE],
                                             apr_md5_ctx_t *context)
    @@ -320,6 +329,9 @@ APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE],
         unsigned char bits[8];
         unsigned int idx, padLen;
     
    +    if (!context)
    +        return APR_EINVAL;
    +    
         /* Save number of bits */
         Encode(bits, context->count, 8);
     
    @@ -345,6 +357,23 @@ APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE],
         return APR_SUCCESS;
     }
     
    +/* MD5 in one step (init, update, final)
    + */
    +APR_DECLARE(apr_status_t) apr_md5(unsigned char digest[MD5_DIGESTSIZE],
    +                                  const unsigned char *input,
    +                                  apr_size_t inputLen)
    +{
    +    apr_md5_ctx_t ctx;
    +    apr_status_t rv;
    +
    +    apr_md5_init(&ctx);
    +
    +    if ((rv = apr_md5_update(&ctx, input, inputLen)) != APR_SUCCESS)
    +        return rv;
    +
    +    return apr_md5_final(digest, &ctx);
    +}
    +
     /* MD5 basic transformation. Transforms state based on block. */
     static void MD5Transform(apr_uint32_t state[4], const unsigned char block[64])
     {
    
    From d62314428848e18dbff11f40208172739c4008d3 Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Mon, 4 Jun 2001 18:38:31 +0000
    Subject: [PATCH 1702/7878] I've managed to get three -1s off this (Jeff, Ryan,
     and myself).
    
    Revert the context null check.  My bad.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61694 13f79535-47bb-0310-9956-ffa450edef68
    ---
     passwd/apr_md5.c | 12 ------------
     1 file changed, 12 deletions(-)
    
    diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c
    index 55251c368d1..9ce2e3f053d 100644
    --- a/passwd/apr_md5.c
    +++ b/passwd/apr_md5.c
    @@ -188,9 +188,6 @@ static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_md5_encode() */
      */
     APR_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context)
     {
    -    if (!context)
    -        return APR_EINVAL;
    -    
         context->count[0] = context->count[1] = 0;
         
         /* Load magic initialization constants. */
    @@ -217,9 +214,6 @@ APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context,
         apr_status_t rv;
         int is_sb;
     
    -    if (!context)
    -        return APR_EINVAL;
    -    
         /* TODO: remove the single-byte-only restriction from this code
          */
         rv = apr_xlate_get_sb(xlate, &is_sb);
    @@ -247,9 +241,6 @@ APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context,
         apr_size_t inbytes_left, outbytes_left;
     #endif
     
    -    if (!context)
    -        return APR_EINVAL;
    -    
         /* Compute number of bytes mod 64 */
         idx = (unsigned int)((context->count[0] >> 3) & 0x3F);
     
    @@ -329,9 +320,6 @@ APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE],
         unsigned char bits[8];
         unsigned int idx, padLen;
     
    -    if (!context)
    -        return APR_EINVAL;
    -    
         /* Save number of bits */
         Encode(bits, context->count, 8);
     
    
    From c3c356b8139e83e237093a8298a27ef749ac8912 Mon Sep 17 00:00:00 2001
    From: Cliff Woolley 
    Date: Mon, 4 Jun 2001 23:09:36 +0000
    Subject: [PATCH 1703/7878] * Remove the unnecessary parameter checks and the
     extra error codes that   went along with them.  The APR policy is to segfault
     on a NULL parameter   rather than silently returning some error code that the
     caller might   not check anyway. * Also remove lots of unnecessary assertions
     (where the code would have   segfaulted anyway, even without an explicit
     assert).  I've tried to be   sure that every one I removed will result in a
     virtually immediate   segfault anyway.  Ones that don't are the ones that are
     tricky to debug.   If I've removed too many, say so and I'll put them back. *
     Fix a misnamed APR_MEMORY_ASSERT -> APR_ASSERT_MEMORY, which was causing  
     apr_assert_memory() never to be compiled.  Also fix a syntax error in that  
     function that's been there since rev 1.1 of apr_sms.c, which no one's   ever
     noticed because they never compiled it before.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61695 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h            |   9 ---
     include/apr_sms.h              |   4 +-
     memory/unix/apr_sms.c          | 113 +++++----------------------------
     memory/unix/apr_sms_std.c      |   3 -
     memory/unix/apr_sms_tracking.c |  25 --------
     misc/unix/errorcodes.c         |   4 --
     6 files changed, 17 insertions(+), 141 deletions(-)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 824b9eba490..6b2198c5593 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -180,11 +180,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
      * APR_EGENERAL     General failure (specific information not available)
      * APR_EBADIP       The specified IP address is invalid
      * APR_EBADMASK     The specified netmask is invalid
    - * APR_ENOCLEANUP   There is no memory cleanup available
    - * APR_EMEMSYS      An invalid memory system was passed in to an 
    - *                  apr_sms function
    - * APR_EMEMFUNC     A function was called that isn't available in the
    - *                  selected memory system
      * 
    * *
    @@ -253,8 +248,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_EINCOMPLETE    (APR_OS_START_ERROR + 22)
     #define APR_EABOVEROOT     (APR_OS_START_ERROR + 23)
     #define APR_EBADPATH       (APR_OS_START_ERROR + 24)
    -#define APR_ENOCLEANUP     (APR_OS_START_ERROR + 25)
    -#define APR_EMEMSYS        (APR_OS_START_ERROR + 26)
     
     /* APR ERROR VALUE TESTS */
     #define APR_STATUS_IS_ENOSTAT(s)        ((s) == APR_ENOSTAT)
    @@ -281,8 +274,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_EINCOMPLETE(s)    ((s) == APR_EINCOMPLETE)
     #define APR_STATUS_IS_EABOVEROOT(s)     ((s) == APR_EABOVEROOT)
     #define APR_STATUS_IS_EBADPATH(s)       ((s) == APR_EBADPATH)
    -#define APR_STATUS_IS_ENOCLEANUP(s)     ((s) == APR_ENOCLEANUP)
    -#define APR_STATUS_IS_EMEMSYS(s)        ((s) == APR_EMEMSYS)
     
     /* APR STATUS VALUES */
     #define APR_INCHILD        (APR_OS_START_STATUS + 1)
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index d616264f36b..ec7825ef8ae 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -180,14 +180,14 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *mem_sys,
      *          memory system from your apr_xxx_sms_create.
      * @deffunc void apr_sms_validate(apr_sms_t *mem_sys)
      */
    -#ifdef APR_MEMORY_ASSERT
    +#ifdef APR_ASSERT_MEMORY
     APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys);
     #else
     #ifdef apr_sms_assert
     #undef apr_sms_assert
     #endif
     #define apr_sms_assert(mem_sys)
    -#endif /* APR_MEMORY_ASSERT */
    +#endif /* APR_ASSERT_MEMORY */
     
     /**
      * Reset a memory system so it can be reused. 
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index 202ccfb43e5..e679eb0a55d 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -64,7 +64,10 @@
     #include "apr_general.h"
     #include "apr_sms.h"
     #include 
    +
    +#ifdef APR_ASSERT_MEMORY
     #include 
    +#endif
     
     #include  /* strikerXXX: had to add this for windows to stop 
                          * complaining, please autoconf the include stuff
    @@ -88,14 +91,6 @@ struct apr_sms_cleanup
     APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *mem_sys,
                                        apr_size_t size)
     {
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys);
    -    assert(mem_sys->malloc_fn);
    -#endif
    -
    -    if (!mem_sys || !mem_sys->malloc_fn)
    -        return NULL;
    -
         if (size == 0)
             return NULL;
     
    @@ -105,11 +100,6 @@ APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *mem_sys,
     APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *mem_sys,
                                        apr_size_t size)
     {
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys);
    -    assert(mem_sys->malloc_fn);
    -#endif
    -
         if (size == 0)
             return NULL;
     
    @@ -129,11 +119,6 @@ APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *mem_sys,
     APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem,
                                         apr_size_t size)
     {
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys);
    -    assert(mem_sys->realloc_fn);
    -#endif
    -   
         if (!mem)
             return apr_sms_malloc(mem_sys, size);
     
    @@ -148,16 +133,6 @@ APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem,
     APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys,
                                            void *mem)
     {
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -       
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys->free_fn);
    -#endif
    -
    -    if (!mem)
    -        return APR_EINVAL;
    -
         if (mem_sys->free_fn)
             return mem_sys->free_fn(mem_sys, mem);  
     
    @@ -188,9 +163,6 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *mem_sys,
          * an assumption to make as it sounds :)
          */
     
    -    if (!mem_sys)
    -        return APR_EINVAL;
    -
         mem_sys->parent_mem_sys = parent_mem_sys;
         mem_sys->accounting_mem_sys = mem_sys;
         mem_sys->child_mem_sys = NULL;
    @@ -213,7 +185,7 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *mem_sys,
         return APR_SUCCESS;
     }
     
    -#ifdef APR_MEMORY_ASSERT
    +#ifdef APR_ASSERT_MEMORY
     APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
     {
         apr_sms_t *parent;
    @@ -249,10 +221,7 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
          * tracking ancestors, but in that specific case we issue a
          * warning.
          */
    -    if (!mem_sys->parent_mem_sys)
    -        return;
    -
    -    parent = mem_sys
    +    parent = mem_sys->parent_mem_sys;
         while (parent) {
             if (apr_sms_is_tracking(parent))
                 return; /* Tracking memory system found, return satisfied ;-) */
    @@ -265,7 +234,7 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
          * parent.
          */
     }
    -#endif /* APR_MEMORY_ASSERT */
    +#endif /* APR_ASSERT_MEMORY */
     
     /*
      * LOCAL FUNCTION used in:
    @@ -312,9 +281,6 @@ static void apr_sms_do_child_cleanups(apr_sms_t *mem_sys)
     
     APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys)
     {
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -
         if (!mem_sys->reset_fn)
             return APR_ENOTIMPL;
     
    @@ -350,9 +316,6 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
         struct apr_sms_cleanup *cleanup;
         struct apr_sms_cleanup *next_cleanup;
     
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -
         if (apr_sms_is_tracking(mem_sys)) {
             /* 
              * Run the cleanups of all child memory systems _including_
    @@ -468,7 +431,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
             mem_sys = mem_sys->parent_mem_sys;
         }
         assert(0); /* Made the wrong assumption, so we assert */
    -#endif /* APR_MEMORY_ASSERT */
    +#endif /* APR_ASSERT_MEMORY */
         
         return APR_SUCCESS;
     }
    @@ -476,9 +439,6 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
     APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a,
                                                   apr_sms_t *b)
     {
    -    if (!b)
    -        return APR_EMEMSYS;
    -
     #ifdef APR_ASSERT_MEMORY
         assert(a);
     #endif
    @@ -492,30 +452,18 @@ APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a,
     
     APR_DECLARE(apr_status_t) apr_sms_lock(apr_sms_t *mem_sys)
     {
    -    if (!mem_sys)
    -        return APR_EMEMSYS;       
    -
         if (!mem_sys->lock_fn)
             return APR_ENOTIMPL;
     
    -    if (mem_sys->lock_fn)
    -        return mem_sys->lock_fn(mem_sys);
    -
    -    return APR_SUCCESS;
    +    return mem_sys->lock_fn(mem_sys);
     }
     
     APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *mem_sys)
     {
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -
         if (!mem_sys->unlock_fn)
             return APR_ENOTIMPL;
             
    -    if (mem_sys->unlock_fn)
    -        return mem_sys->unlock_fn(mem_sys);
    -
    -    return APR_SUCCESS;
    +    return mem_sys->unlock_fn(mem_sys);
     }
     
     /*
    @@ -530,13 +478,6 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys,
     {
         struct apr_sms_cleanup *cleanup;
     
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys->accounting_mem_sys);
    -#endif
    -    
         if (!cleanup_fn)
             return APR_ENOTIMPL;
     
    @@ -565,13 +506,6 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys,
         struct apr_sms_cleanup *cleanup;
         struct apr_sms_cleanup **cleanup_ref;
     
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys->accounting_mem_sys);
    -#endif
    -        
         cleanup = mem_sys->cleanups;
         cleanup_ref = &mem_sys->cleanups;
         while (cleanup) {
    @@ -591,8 +525,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys,
             cleanup = cleanup->next;
         }
     
    -    /* The cleanup function should have been registered previously */
    -    return APR_ENOCLEANUP;
    +    /* The cleanup function must have been registered previously */
    +    return APR_EINVAL;
     }
     
     APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys, 
    @@ -600,15 +534,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys,
     {
         struct apr_sms_cleanup *cleanup;
         struct apr_sms_cleanup **cleanup_ref;
    -    apr_status_t rv = APR_ENOCLEANUP;
    +    apr_status_t rv = APR_EINVAL;
     
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -        
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys->accounting_mem_sys);
    -#endif
    -    
         cleanup = mem_sys->cleanups;
         cleanup_ref = &mem_sys->cleanups;
         mem_sys = mem_sys->accounting_mem_sys;
    @@ -628,7 +555,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys,
             }
         }
     
    -    /* The cleanup function should have been registered previously */
    +    /* The cleanup function must have been registered previously */
         return rv;
     }
     
    @@ -640,14 +567,11 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *mem_sys,
     {
         apr_status_t rv;
     
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -
         if ((rv = apr_sms_cleanup_unregister(mem_sys, type,
                                              data, cleanup_fn)) != APR_SUCCESS)
             return rv;
     
    -     return cleanup_fn(data);
    +    return cleanup_fn(data);
     }
     
     APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *mem_sys, 
    @@ -655,15 +579,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *mem_sys,
     {
         struct apr_sms_cleanup *cleanup;
         struct apr_sms_cleanup **cleanup_ref;
    -    apr_status_t rv = APR_ENOCLEANUP;
    +    apr_status_t rv = APR_ENOTIMPL;
     
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -        
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys->accounting_mem_sys);
    -#endif
    -    
         cleanup = mem_sys->cleanups;
         cleanup_ref = &mem_sys->cleanups;
         mem_sys = mem_sys->accounting_mem_sys;
    diff --git a/memory/unix/apr_sms_std.c b/memory/unix/apr_sms_std.c
    index 328615c66ba..0bcfb33b98e 100644
    --- a/memory/unix/apr_sms_std.c
    +++ b/memory/unix/apr_sms_std.c
    @@ -64,7 +64,6 @@
     #include "apr_private.h"
     #include "apr_sms.h"
     #include 
    -#include 
     
     static const char *module_identity = "STANDARD";
     
    @@ -110,8 +109,6 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys)
         apr_sms_t *new_mem_sys;
         apr_status_t rv;
     
    -    assert(mem_sys);
    -
         *mem_sys = NULL;
         /* We don't have a parent so we allocate the memory
          * for the structure ourselves...
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    index 0fda45b5e6e..5fe4e25161c 100644
    --- a/memory/unix/apr_sms_tracking.c
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -66,7 +66,6 @@
     #include "apr_sms.h"
     #include "apr_sms_tracking.h"
     #include 
    -#include 
     
     static const char *module_identity = "TRACKING";
     
    @@ -93,8 +92,6 @@ static void *apr_sms_tracking_malloc(apr_sms_t *mem_sys,
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
       
    -    assert(mem_sys);
    -
         tms = (apr_sms_tracking_t *)mem_sys;
         node = apr_sms_malloc(mem_sys->parent_mem_sys,
                               size + sizeof(apr_track_node_t));
    @@ -118,8 +115,6 @@ static void *apr_sms_tracking_calloc(apr_sms_t *mem_sys,
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
       
    -    assert(mem_sys);
    -
         tms = (apr_sms_tracking_t *)mem_sys;
         node = apr_sms_calloc(mem_sys->parent_mem_sys,
                               size + sizeof(apr_track_node_t));
    @@ -143,8 +138,6 @@ static void *apr_sms_tracking_realloc(apr_sms_t *mem_sys,
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
     
    -    assert(mem_sys);
    -
         tms = (apr_sms_tracking_t *)mem_sys;
         node = (apr_track_node_t *)mem;
     
    @@ -174,9 +167,6 @@ static apr_status_t apr_sms_tracking_free(apr_sms_t *mem_sys,
     {
         apr_track_node_t *node;
         
    -    assert(mem_sys);
    -    assert(mem);
    -
         node = (apr_track_node_t *)mem;
         node--;
     
    @@ -193,8 +183,6 @@ static apr_status_t apr_sms_tracking_reset(apr_sms_t *mem_sys)
         apr_track_node_t *node;
         apr_status_t rv;
      
    -    assert(mem_sys);
    -
         tms = (apr_sms_tracking_t *)mem_sys;
     
         while (tms->nodes) {
    @@ -214,16 +202,6 @@ static apr_status_t apr_sms_tracking_destroy(apr_sms_t *mem_sys)
     {
         apr_status_t rv;
         
    -    /* If this is NULL we won't blow up as it should be caught at the
    -     * next level down and then passed back to us...
    -     */
    -#ifdef APR_ASSERT_MEMORY
    -    assert(mem_sys->parent_mem_sys);
    -#endif
    -    
    -    if (!mem_sys)
    -        return APR_EMEMSYS;
    -
         if ((rv = apr_sms_tracking_reset(mem_sys)) != APR_SUCCESS)
             return rv;
         
    @@ -237,9 +215,6 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys,
         apr_sms_tracking_t *tms;
         apr_status_t rv;
     
    -    assert(mem_sys);
    -    assert(pms);
    -    
         *mem_sys = NULL;
         /* We're not a top level module, ie we have a parent, so
          * we allocate the memory for the structure from our parent.
    diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c
    index f6224f7a85f..b3b41f45f3b 100644
    --- a/misc/unix/errorcodes.c
    +++ b/misc/unix/errorcodes.c
    @@ -166,10 +166,6 @@ static char *apr_error_string(apr_status_t statcode)
             return "The given path was above the root path";
         case APR_EBADPATH:
             return "The given path misformatted or contained invalid characters";
    -    case APR_EMEMSYS:
    -        return "The memory system passed does not exist";
    -    case APR_ENOCLEANUP:
    -        return "The requested cleanup function does not exist";
         default:
             return "Error string not specified yet";
         }
    
    From 39e7e8ed2e36a4cc02f8c7e396c1cb93c91a9e3f Mon Sep 17 00:00:00 2001
    From: Cliff Woolley 
    Date: Mon, 4 Jun 2001 23:26:55 +0000
    Subject: [PATCH 1704/7878] It is satisfactory for the current memory system
     itself to be tracking. So the real typo which the previous patch was meant to
     fix was just a missing semicolon, not a truncated line.  =-)
    
    Submitted by:	Sander Striker 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61696 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms.c | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index e679eb0a55d..ec72e85f363 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -221,7 +221,10 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
          * tracking ancestors, but in that specific case we issue a
          * warning.
          */
    -    parent = mem_sys->parent_mem_sys;
    +    if (!mem_sys->parent_mem_sys)
    +        return;
    +
    +    parent = mem_sys;
         while (parent) {
             if (apr_sms_is_tracking(parent))
                 return; /* Tracking memory system found, return satisfied ;-) */
    
    From ea2b7e4449ee9f925237b47e2f22387cca463b89 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Tue, 5 Jun 2001 07:56:08 +0000
    Subject: [PATCH 1705/7878] Greg wanted the TODO file removed, Greg has the
     TODO file removed.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61697 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS           | 30 +++++++++++++++++++++++++-----
     memory/unix/TODO | 44 --------------------------------------------
     2 files changed, 25 insertions(+), 49 deletions(-)
     delete mode 100644 memory/unix/TODO
    
    diff --git a/STATUS b/STATUS
    index e32447b44b1..a61de115c46 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -1,5 +1,5 @@
     APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS:			-*-text-*-
    -Last modified at [$Date: 2001/05/31 04:10:03 $]
    +Last modified at [$Date: 2001/06/05 07:56:08 $]
     
     Release:
     
    @@ -160,7 +160,27 @@ Stuff waiting for code thawing after Beta 1:
             usefulness, perhaps hidden, generic read-only [immutable],
             effective current user permissions, etc.
     
    -    * APR memory code
    -      - Look at how we'll handle run-time loading of memory sub systems.
    -      - shared memory module?
    -      - decide on where we're actually going with the code...
    +APR Stackable Memory Code
    +=========================
    +
    +This is just a small list of things yet to be done, or things
    +that we may want/need to consider.
    +
    +- add a shared memory module.
    +
    +- locking needs to be addressed.  The scope of the locks needs
    +  to be defined and it's likely we'll need some way of
    +  varying the scope when locking.
    +
    +- given the problems that can occur when trying to find 
    +  alloc/free problems we should probably have a special debug
    +  memory system that records everything it does and any
    +  other information we think is useful.
    +
    +- in addition to the debugging system, we need to look at
    +  methods of checking memory allocations to ensure we're
    +  behaving when we have the ASSERT_MEMORY flag turned on.
    +  The pools in 1.3 had code from dean and Roy, Greg has added
    +  some special stuff for pools under Linux on 2.0, so we just
    +  need some ideas
    +
    diff --git a/memory/unix/TODO b/memory/unix/TODO
    deleted file mode 100644
    index 4b3c8cc8f0f..00000000000
    --- a/memory/unix/TODO
    +++ /dev/null
    @@ -1,44 +0,0 @@
    -This is just a small list of things yet to be done, or things
    -that we may want/need to consider.  I haven't put it in the
    -STATUS file for APR as none of these can be considered
    -showstoppers for the time being.
    -david - 28 May 2001
    -
    -- add a shared memory module.
    -
    -- locking needs to be addressed.  The scope of the locks needs
    -  to be defined and it's likely we'll need some way of
    -  varying the scope when locking.
    -
    -- we need to add dynamic loading ability for memory
    -  systems.  As to how it should be done this needs to be
    -  looked at.  Some known issues include 
    -    o differing arguments for create functions
    -    o it would be very cool to use the APR dso code, but
    -      as this uses pools and we're not using pools anywhere in the
    -      memory code (for obvious reasons) this is a bit of a stopper.
    -      Sander says he found the same thing with using the locking code
    -
    -  Just to clarify why this will be very cool if we can get
    -  it working, we give the user the ability to use 3rd party modules
    -  that can actually have almost total control over how the
    -  memory is allocated. Not sure I know of other libraries where
    -  this is possible.
    -
    -- given the problems that can occur when trying to find 
    -  alloc/free problems we should probably have a special debug
    -  memory system that records everything it does and any
    -  other information we think is useful.
    -
    -- in addition to the debugging system, we need to look at
    -  methods of checking memory allocations to ensure we're
    -  behaving when we have the ASSERT_MEMORY flag turned on.
    -  The pools in 1.3 had code from dean and Roy, Greg has added
    -  some special stuff for pools under Linux on 2.0, so we just
    -  need some ideas
    -
    -Possible Extras
    -
    -- Is there any ebenfit in adding a version number to the memory
    -  systems?  This probably isn't an issue until we have dynamic 
    -  loading when binary memory systems may be distributed.
    
    From 11790078df48ce8872c482ff9ddd32cc8c138508 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Tue, 5 Jun 2001 08:15:37 +0000
    Subject: [PATCH 1706/7878] OK, this basically adds a function that allows us
     to create apr_lock_t's using an apr_sms_t for the memory.  It's a very small
     first step, and at present is only intended to be used internally in APR,
     hence the position of the function definitions in the locks.h file.
    
    Given that we don't want to duplicate code where we don't have to, I've
    added some macros that allow us to do memory allocations regardless of
    whether we have a pool or sms.  This also highlighted that we haven't
    yet managed to change our member names from cntxt to pool everywhere!
    
    The surprise comes in just how far reaching the apr_pool_t goes.
    
    As apr_lock.h uses ap_sms_t and apr_sms.h uses apr_lock_t I've moved
    the tyepdef's into apr.h.in, but this may be bogus...
    
    Hopefully this will allow us to get locking into sms and so start
    moving forward again, and at the same time it starts to throw up
    the problems for changing our memory system throughout APR.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61698 13f79535-47bb-0310-9956-ffa450edef68
    ---
     acconfig.h                 | 42 ++++++++++++++++++++++++++
     include/apr.h.in           |  2 ++
     include/apr_lock.h         |  3 +-
     include/apr_sms.h          |  3 +-
     include/arch/beos/locks.h  |  5 ++++
     include/arch/os2/locks.h   |  6 ++++
     include/arch/unix/locks.h  |  6 ++++
     include/arch/win32/locks.h |  6 ++++
     locks/unix/crossproc.c     | 21 ++++++-------
     locks/unix/locks.c         | 61 ++++++++++++++++++++++++++++----------
     locks/win32/locks.c        | 39 ++++++++++++++++++++++++
     11 files changed, 164 insertions(+), 30 deletions(-)
    
    diff --git a/acconfig.h b/acconfig.h
    index b238713b5a7..35aa1f9b60a 100644
    --- a/acconfig.h
    +++ b/acconfig.h
    @@ -67,4 +67,46 @@
     #define apr_sigwait(a,b) sigwait((a),(b))
     #endif
     
    +/* Macros to deal with using either a pool or an sms
    + * to do memory stuff...
    + */
    +#define APR_REGISTER_CLEANUP(struct, data, func, scope) \
    +    if (struct->cntxt) { \
    +        apr_pool_cleanup_register(struct->cntxt, data, func, scope); \
    +    } else { \
    +        apr_sms_cleanup_register(struct->mem_sys, APR_CHILD_CLEANUP, \
    +                                 data, func); \
    +    }
    +
    +#define APR_REMOVE_CLEANUP(struct, data, func) \
    +    if (struct->cntxt) { \
    +        apr_pool_cleanup_kill(struct->cntxt, data, func); \
    +    } else { \
    +        apr_sms_cleanup_unregister(struct->mem_sys, APR_CHILD_CLEANUP, \
    +                                   data, func); \
    +    }
    +
    +#define APR_MEM_PSTRDUP(struct, ptr, str) \
    +    if (struct->cntxt) { \
    +        ptr = apr_pstrdup(struct->cntxt, str); \
    +    } else { \
    +        size_t len = strlen(str) + 1; \
    +        ptr = (char*) apr_sms_calloc(struct->mem_sys, len); \
    +        memcpy(ptr, str, len); \
    +    }
    +
    +#define APR_MEM_MALLOC(ptr, struct, type) \
    +    if (struct->cntxt) { \
    +        ptr = (type *)apr_palloc(struct->cntxt, sizeof(type)); \
    +    } else { \
    +        ptr = (type *)apr_sms_malloc(struct->mem_sys, sizeof(type)); \
    +    }
    +
    +#define APR_MEM_CALLOC(ptr, struct, type) \
    +    if (struct->cntxt) { \
    +        ptr = (type *)apr_pcalloc(struct->cntxt, sizeof(type)); \
    +    } else { \
    +        ptr = (type *)apr_sms_calloc(struct->mem_sys, sizeof(type)); \
    +    }
    +
     #endif /* APR_PRIVATE_H */
    diff --git a/include/apr.h.in b/include/apr.h.in
    index 63136726c3f..c72981e4318 100644
    --- a/include/apr.h.in
    +++ b/include/apr.h.in
    @@ -174,6 +174,8 @@ typedef  @ssize_t_value@         apr_ssize_t;
     typedef  @off_t_value@           apr_off_t;
     typedef  @socklen_t_value@       apr_socklen_t;
     
    +typedef struct apr_lock_t        apr_lock_t;
    +typedef struct apr_sms_t         apr_sms_t;
     
     /* Mechanisms to properly type numeric literals */
     @int64_literal@
    diff --git a/include/apr_lock.h b/include/apr_lock.h
    index 1be21ed1ab3..9c5e08fdf9a 100644
    --- a/include/apr_lock.h
    +++ b/include/apr_lock.h
    @@ -58,6 +58,7 @@
     #include "apr.h"
     #include "apr_pools.h"
     #include "apr_errno.h"
    +#include "apr_sms.h"
     
     #ifdef __cplusplus
     extern "C" {
    @@ -73,8 +74,6 @@ typedef enum {APR_MUTEX, APR_READWRITE} apr_locktype_e;
     
     typedef enum {APR_READER, APR_WRITER} apr_readerwriter_e;
     
    -typedef struct apr_lock_t           apr_lock_t;
    -
     /*   Function definitions */
     
     /**
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index ec7825ef8ae..38ff3b88be3 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -79,8 +79,6 @@ extern "C" {
      * @package APR memory system
      */
     
    -typedef struct apr_sms_t apr_sms_t;
    -
     struct apr_sms_cleanup;
     
     /**
    @@ -94,6 +92,7 @@ struct apr_sms_t
       apr_sms_t **ref_mem_sys;
       apr_sms_t  *accounting_mem_sys;
       const char *identity; /* a string identifying the module */
    +  apr_lock_t *lock;
     
       struct apr_sms_cleanup *cleanups;
     
    diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h
    index ec3e7753803..ce9fa6cfa9a 100644
    --- a/include/arch/beos/locks.h
    +++ b/include/arch/beos/locks.h
    @@ -60,9 +60,11 @@
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_lib.h"
    +#include "apr_sms.h"
     
     struct apr_lock_t {
         apr_pool_t *cntxt;
    +    apr_sms_t *mem_sys;
         apr_locktype_e type;
         apr_lockscope_e scope;
         /* Inter proc */
    @@ -86,6 +88,9 @@ apr_status_t destroy_inter_lock(struct apr_lock_t *lock);
     apr_status_t child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, 
                                 const char *fname);
     
    +apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
    +                                 apr_lockscope_e scope, const_char *fname,
    +                                 apr_sms_t *mem_sys);
     
     #endif  /* LOCKS_H */
     
    diff --git a/include/arch/os2/locks.h b/include/arch/os2/locks.h
    index 7c0a8782579..d3edf99d8e4 100644
    --- a/include/arch/os2/locks.h
    +++ b/include/arch/os2/locks.h
    @@ -57,9 +57,11 @@
     
     #include "apr_lock.h"
     #include "apr_file_io.h"
    +#include "apr_sms.h"
     
     struct apr_lock_t {
         apr_pool_t *cntxt;
    +    apr_sms_t *mem_sys;
         apr_locktype_e type;
         apr_lockscope_e scope;
         char *fname;
    @@ -69,5 +71,9 @@ struct apr_lock_t {
         TIB *tib;
     };
     
    +apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
    +                                 apr_lockscope_e scope, const char *fname,
    +                                 apr_sms_t *mem_sys);
    +
     #endif  /* LOCKS_H */
     
    diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h
    index beaecac25d7..e34dcc769a6 100644
    --- a/include/arch/unix/locks.h
    +++ b/include/arch/unix/locks.h
    @@ -60,6 +60,7 @@
     #include "apr_general.h"
     #include "apr_lib.h"
     #include "apr_lock.h"
    +#include "apr_sms.h"
     
     /* System headers required by Locks library */
     #if APR_HAVE_SYS_TYPES_H
    @@ -109,6 +110,7 @@ union semun {
     
     struct apr_lock_t {
         apr_pool_t *cntxt;
    +    apr_sms_t *mem_sys;
         apr_locktype_e type;
         apr_lockscope_e scope;
         int curr_locked;
    @@ -155,5 +157,9 @@ apr_status_t apr_unix_destroy_inter_lock(struct apr_lock_t *lock);
     apr_status_t apr_unix_child_init_lock(struct apr_lock_t **lock, 
                                           apr_pool_t *cont, const char *fname);
     
    +apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
    +                                 apr_lockscope_e scope, const char *fname,
    +                                 apr_sms_t *mem_sys);
    +
     #endif  /* LOCKS_H */
     
    diff --git a/include/arch/win32/locks.h b/include/arch/win32/locks.h
    index 38f8f105a9c..1083e685e4e 100644
    --- a/include/arch/win32/locks.h
    +++ b/include/arch/win32/locks.h
    @@ -56,9 +56,11 @@
     #define LOCKS_H
     
     #include "apr_lock.h"
    +#include "apr_sms.h"
     
     struct apr_lock_t {
         apr_pool_t *cntxt;
    +    apr_sms_t *mem_sys;
         apr_locktype_e type;
         apr_lockscope_e scope;
         HANDLE mutex;
    @@ -66,5 +68,9 @@ struct apr_lock_t {
         char *fname;
     };
     
    +apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
    +                                 apr_lockscope_e scope, const char *fname,
    +                                 apr_sms_t *mem_sys);
    +
     #endif  /* LOCKS_H */
     
    diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c
    index ae5b47e3080..29df0c1744f 100644
    --- a/locks/unix/crossproc.c
    +++ b/locks/unix/crossproc.c
    @@ -100,7 +100,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
             return errno;
         }
         new->curr_locked = 0;
    -    apr_pool_cleanup_register(new->cntxt, (void *)new, lock_cleanup, apr_pool_cleanup_null);
    +    APR_REGISTER_CLEANUP(new, (void *)new, lock_cleanup, apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    @@ -137,7 +137,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
         apr_status_t stat;
     
         if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        apr_pool_cleanup_kill(lock->cntxt, lock, lock_cleanup);
    +        APR_REMOVE_CLEANUP(lock, lock, lock_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    @@ -223,7 +223,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
         }
     
         new->curr_locked = 0;
    -    apr_pool_cleanup_register(new->cntxt, (void *)new, lock_cleanup, apr_pool_cleanup_null);
    +    APR_REGISTER_CLEANUP(new, (void *)new, lock_cleanup, apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    @@ -259,7 +259,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        apr_pool_cleanup_kill(lock->cntxt, lock, lock_cleanup);
    +        APR_REMOVE_CLEANUP(lock, lock, lock_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    @@ -305,7 +305,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
             new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644);
         }
         else {
    -        new->fname = apr_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); 
    +        APR_MEM_PSTRDUP(new, new->fname, "/tmp/aprXXXXXX")
             new->interproc = apr_mkstemp(new->fname);
         }
     
    @@ -316,7 +316,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
     
         new->curr_locked=0;
         unlink(new->fname);
    -    apr_pool_cleanup_register(new->cntxt, new, lock_cleanup, apr_pool_cleanup_null);
    +    APR_REGISTER_CLEANUP(new, new, lock_cleanup, apr_pool_cleanup_null);
         return APR_SUCCESS; 
     }
     
    @@ -352,7 +352,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        apr_pool_cleanup_kill(lock->cntxt, lock, lock_cleanup);
    +        APR_REMOVE_CLEANUP(lock, lock, lock_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    @@ -364,6 +364,7 @@ apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont,
         return APR_SUCCESS;
     }
     
    +
     #elif (APR_USE_FLOCK_SERIALIZE)
     
     void apr_unix_setup_lock(void)
    @@ -387,7 +388,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
             new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600);
         }
         else {
    -        new->fname = apr_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); 
    +        APR_MEM_PSTRDUP(new, new->fname, "/tmp/aprXXXXXX")
             new->interproc = apr_mkstemp(new->fname);
         }
     
    @@ -396,7 +397,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
             return errno;
         }
         new->curr_locked = 0;
    -    apr_pool_cleanup_register(new->cntxt, (void *)new, lock_cleanup, apr_pool_cleanup_null);
    +    APR_REGISTER_CLEANUP(new, (void *)new, lock_cleanup, apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    @@ -432,7 +433,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        apr_pool_cleanup_kill(lock->cntxt, lock, lock_cleanup);
    +        APR_REMOVE_CLEANUP(lock, lock, lock_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    diff --git a/locks/unix/locks.c b/locks/unix/locks.c
    index f05681b3cff..44bbd20ce5a 100644
    --- a/locks/unix/locks.c
    +++ b/locks/unix/locks.c
    @@ -56,46 +56,38 @@
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    -apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, 
    -                           apr_lockscope_e scope, const char *fname, 
    -                           apr_pool_t *cont)
    +static apr_status_t create_lock(apr_lock_t *new, const char *fname)
     {
    -    apr_lock_t *new;
         apr_status_t stat;
     
    -    new = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t));
    -
    -    new->cntxt = cont;
    -    new->type  = type;
    -    new->scope = scope;
         switch (new->type)
         {
         case APR_MUTEX:
     #if (APR_USE_FCNTL_SERIALIZE) || (APR_USE_FLOCK_SERIALIZE)
         /* file-based serialization primitives */
    -    if (scope != APR_INTRAPROCESS) {
    +    if (new->scope != APR_INTRAPROCESS) {
             if (fname != NULL) {
    -            new->fname = apr_pstrdup(cont, fname);
    +            APR_MEM_PSTRDUP(new, new->fname, fname);
             }
         }
     #endif
     
     #if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */
    -    if (scope == APR_INTRAPROCESS) {
    +    if (new->scope == APR_INTRAPROCESS) {
     #else
    -    if (scope != APR_CROSS_PROCESS) {
    +    if (new->scope != APR_CROSS_PROCESS) {
     #endif
     #if APR_HAS_THREADS
             if ((stat = apr_unix_create_intra_lock(new)) != APR_SUCCESS) {
                 return stat;
             }
     #else
    -        if (scope != APR_LOCKALL) {
    +        if (new->scope != APR_LOCKALL) {
                 return APR_ENOTIMPL;
             }
     #endif
         }
    -    if (scope != APR_INTRAPROCESS) {
    +    if (new->scope != APR_INTRAPROCESS) {
             if ((stat = apr_unix_create_inter_lock(new)) != APR_SUCCESS) {
                 return stat;
             }
    @@ -103,7 +95,7 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
         break;
         case APR_READWRITE:
     #ifdef HAVE_PTHREAD_RWLOCK_INIT
    -    if (scope != APR_INTRAPROCESS)
    +    if (new->scope != APR_INTRAPROCESS)
             return APR_ENOTIMPL;
         pthread_rwlock_init(&new->rwlock, NULL);
         break;
    @@ -111,6 +103,43 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
         return APR_ENOTIMPL;
     #endif
         }
    +    return APR_SUCCESS;
    +}
    +
    +apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, 
    +                           apr_lockscope_e scope, const char *fname, 
    +                           apr_pool_t *cont)
    +{
    +    apr_lock_t *new;
    +    apr_status_t stat;
    +
    +    new = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t));
    +
    +    new->cntxt = cont;
    +    new->type  = type;
    +    new->scope = scope;
    +    if ((stat = create_lock(new, fname)) != APR_SUCCESS)
    +        return APR_SUCCESS;
    +
    +    *lock = new;
    +    return APR_SUCCESS;
    +}
    +
    +apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
    +                                 apr_lockscope_e scope, const char *fname,
    +                                 apr_sms_t *mem_sys)
    +{
    +    apr_lock_t *new;
    +    apr_status_t stat;
    +    
    +    new = (apr_lock_t *)apr_sms_calloc(mem_sys, sizeof(apr_lock_t));
    +
    +    new->mem_sys = mem_sys;
    +    new->cntxt = NULL;
    +    new->type = type;
    +    new->scope = scope;
    +    if ((stat = create_lock(new, fname)) != APR_SUCCESS)
    +        return stat;
     
         *lock = new;
         return APR_SUCCESS;
    diff --git a/locks/win32/locks.c b/locks/win32/locks.c
    index 267b8ad9005..b30755dca98 100644
    --- a/locks/win32/locks.c
    +++ b/locks/win32/locks.c
    @@ -98,6 +98,45 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock,
         return APR_SUCCESS;
     }
     
    +APR_DECLARE(apr_status_t) apr_lock_sms_create(apr_lock_t **lock,
    +                                              apr_locktype_e type,
    +                                              apr_lockscope_e scope,
    +                                              const char *fname,
    +                                              apr_sms_t *mem_sys)
    +{
    +    apr_lock_t *newlock;
    +    SECURITY_ATTRIBUTES sec;
    +
    +    if (type == APR_READWRITE)
    +        return APR_ENOTIMPL;
    +
    +    newlock = (apr_lock_t *)apr_sms_malloc(mem_sys, sizeof(apr_lock_t));
    +
    +    newlock->cntxt = NULL;
    +    newlock->mem_sys = mem_sys;
    +
    +    APR_MEM_PSTRDUP(newlock, newlock->fname, fname);
    +    newlock->type = type;
    +    newlock->scope = scope;
    +    sec.nLength = sizeof(SECURITY_ATTRIBUTES);
    +    sec.lpSecurityDescriptor = NULL;
    +
    +    if (scope == APR_CROSS_PROCESS || scope == APR_LOCKALL) {
    +        sec.bInheritHandle = TRUE;
    +    }
    +    else {
    +        sec.bInheritHandle = FALSE;
    +    }
    +
    +    if (scope == APR_INTRAPROCESS) {
    +        InitializeCriticalSection(&newlock->section);
    +    } else {
    +        newlock->mutex = CreateMutex(&sec, FALSE, fname);
    +    }
    +    *lock = newlock;
    +    return APR_SUCCESS;
    +}
    +
     APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, 
                                                   const char *fname, 
                                                   apr_pool_t *cont)
    
    From aba9a549f0ea56e9df8d758559991970cfb7061a Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Tue, 5 Jun 2001 09:15:07 +0000
    Subject: [PATCH 1707/7878] Fix a silly typo and add support for
     apr_lock_sms_create to BeOS.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61699 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/beos/locks.h |  2 +-
     locks/beos/crossproc.c    |  7 ++++---
     locks/beos/intraproc.c    |  7 ++++---
     locks/beos/locks.c        | 35 +++++++++++++++++++++++++++++++++++
     4 files changed, 44 insertions(+), 7 deletions(-)
    
    diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h
    index ce9fa6cfa9a..387c536eff8 100644
    --- a/include/arch/beos/locks.h
    +++ b/include/arch/beos/locks.h
    @@ -89,7 +89,7 @@ apr_status_t child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont,
                                 const char *fname);
     
     apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
    -                                 apr_lockscope_e scope, const_char *fname,
    +                                 apr_lockscope_e scope, const char *fname,
                                      apr_sms_t *mem_sys);
     
     #endif  /* LOCKS_H */
    diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c
    index 536fa140f1e..9476f5041ac 100644
    --- a/locks/beos/crossproc.c
    +++ b/locks/beos/crossproc.c
    @@ -52,9 +52,10 @@
      * .
      */
     
    +#include "unix/apr_private.h"
     #include "beos/locks.h"
     
    -apr_status_t lock_inter_cleanup(void * data)
    +static apr_status_t lock_inter_cleanup(void * data)
     {
         apr_lock_t *lock = (apr_lock_t*)data;
         if (lock->ben_interproc != 0) {
    @@ -81,7 +82,7 @@ apr_status_t create_inter_lock(apr_lock_t *new)
         }
         new->ben_interproc = 0;
         new->sem_interproc = stat;
    -    apr_pool_cleanup_register(new->cntxt, (void *)new, lock_inter_cleanup,
    +    APR_REGISTER_CLEANUP(new, (void *)new, lock_inter_cleanup,
                             apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
    @@ -116,7 +117,7 @@ apr_status_t destroy_inter_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_inter_cleanup(lock)) == APR_SUCCESS) {
    -        apr_pool_cleanup_kill(lock->cntxt, lock, lock_inter_cleanup);
    +        APR_REMOVE_CLEANUP(lock, lock, lock_inter_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    diff --git a/locks/beos/intraproc.c b/locks/beos/intraproc.c
    index 88cae84132b..70bc4477c62 100644
    --- a/locks/beos/intraproc.c
    +++ b/locks/beos/intraproc.c
    @@ -52,9 +52,10 @@
      * .
      */
     
    +#include "unix/apr_private.h"
     #include "beos/locks.h"
     
    -apr_status_t lock_intra_cleanup(void *data)
    +static apr_status_t lock_intra_cleanup(void *data)
     {
         apr_lock_t *lock = (apr_lock_t *)data;
         if (lock->ben_intraproc != 0) {
    @@ -76,7 +77,7 @@ apr_status_t create_intra_lock(apr_lock_t *new)
         }
         new->ben_intraproc = 0;
         new->sem_intraproc = stat;
    -    apr_pool_cleanup_register(new->cntxt, (void *)new, lock_intra_cleanup,
    +    APR_REGISTER_CLEANUP(new, (void *)new, lock_intra_cleanup,
                             apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
    @@ -111,7 +112,7 @@ apr_status_t destroy_intra_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) {
    -        apr_pool_cleanup_kill(lock->cntxt, lock, lock_intra_cleanup);
    +        APR_REMOVE_CLEANUP(lock, lock, lock_intra_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    diff --git a/locks/beos/locks.c b/locks/beos/locks.c
    index b292c87e035..58749351f9a 100644
    --- a/locks/beos/locks.c
    +++ b/locks/beos/locks.c
    @@ -90,6 +90,41 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
         return APR_SUCCESS;
     }
     
    +apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type, 
    +                                 apr_lockscope_e scope, const char *fname, 
    +                                 apr_sms_t *mem_sys)
    +{
    +    apr_lock_t *new;
    +    apr_status_t stat;
    +  
    +    /* FIXME: Remove when read write locks implemented. */ 
    +    if (type == APR_READWRITE)
    +        return APR_ENOTIMPL; 
    +
    +    new = (apr_lock_t *)apr_sms_malloc(mem_sys, sizeof(apr_lock_t));
    +    if (new == NULL){
    +        return APR_ENOMEM;
    +    }
    +    
    +    new->mem_sys = mem_sys;
    +    new->cntxt = NULL;
    +    new->type  = type;
    +    new->scope = scope;
    +
    +    if (scope != APR_CROSS_PROCESS) {
    +        if ((stat = create_intra_lock(new)) != APR_SUCCESS) {
    +            return stat;
    +        }
    +    }
    +    if (scope != APR_INTRAPROCESS) {
    +        if ((stat = create_inter_lock(new)) != APR_SUCCESS) {
    +            return stat;
    +        }
    +    }
    +    (*lock) = new;
    +    return APR_SUCCESS;
    +}
    +
     apr_status_t apr_lock_acquire(apr_lock_t *lock)
     {
         apr_status_t stat;
    
    From b002587b809fd1b36ab63de47361af7fb49fa953 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Tue, 5 Jun 2001 09:23:32 +0000
    Subject: [PATCH 1708/7878] Add an accessor function for the SMS identity.
    
    Submitted by:    Sander Striker 
    Reviewed by:	 David Reid 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61700 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_sms.h     | 7 +++++++
     memory/unix/apr_sms.c | 4 ++++
     2 files changed, 11 insertions(+)
    
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index 38ff3b88be3..7f93ed98dc5 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -232,6 +232,13 @@ APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *mem_sys);
      */
     APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a, apr_sms_t *b);
     
    +/** 
    + * Get the memory_system identity
    + * @param mem_sys The memory system to use
    + * @deffunc const char * apr_sms_identity(apr_sms_t *mem_sys);
    + */
    +APR_DECLARE(const char *) apr_sms_identity(apr_sms_t *mem_sys);
    +
     /*
      * memory system cleanup management functions
      */
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index ec72e85f363..b19c6e4ca1b 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -609,3 +609,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *mem_sys,
         return rv;
     }
     
    +APR_DECLARE(const char*) apr_sms_identity(apr_sms_t *mem_sys)
    +{
    +    return mem_sys->identity;
    +}
    
    From 738c2e48dd40243cc18503863835fd402c710c03 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Tue, 5 Jun 2001 09:30:37 +0000
    Subject: [PATCH 1709/7878] Add some explanation of the way that
     parent/child/sibling relationships work and tidy up some now uneeded code and
     a comment who's time has passed...
    
    Submitted by:	Sander Striker 
    Reviewed by:	David Reid 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61701 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms.c | 25 ++++++++++++++++++-------
     1 file changed, 18 insertions(+), 7 deletions(-)
    
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index b19c6e4ca1b..d378c3d1525 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -167,20 +167,31 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *mem_sys,
         mem_sys->accounting_mem_sys = mem_sys;
         mem_sys->child_mem_sys = NULL;
     
    +    /*
    +     * Child memory systems are always linked to their parents.  This works
    +     * as follows...
    +     *
    +     *  parent
    +     *    |
    +     *    |
    +     *  child  --- sibling --- sibling --- sibling
    +     *
    +     * To be able to remove a memory system from a list we also need to
    +     * keep a ref pointer (a pointer to the pointer pointing to the memory
    +     * system).  To remove a memory system, basically...
    +     *
    +     *  *ref = sibling;
    +     *  if (sibling)
    +     *      sibling->ref = ref;
    +     */
    +     
         if (parent_mem_sys) {
             if ((mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys) != NULL)
                 mem_sys->sibling_mem_sys->ref_mem_sys = &mem_sys->sibling_mem_sys;
     
             mem_sys->ref_mem_sys = &parent_mem_sys->child_mem_sys;
    -        /* This is probably not correct as we could have multiple children
    -         * from a single parent...  We probably need a list...
    -         */
             parent_mem_sys->child_mem_sys = mem_sys;
         }
    -    else {
    -        mem_sys->ref_mem_sys     = NULL;
    -        mem_sys->sibling_mem_sys = NULL;
    -    }
     
         return APR_SUCCESS;
     }
    
    From 9139ab736dd3655e0e9aa31b4c6256c77ccf6f47 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Tue, 5 Jun 2001 13:22:50 +0000
    Subject: [PATCH 1710/7878] A couple of changes...
    
    - rename the CLEANUP macros so they make more sense (I hope)
    - cntxt -> pool in the lock code and macro's
    
    No functional change.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61702 13f79535-47bb-0310-9956-ffa450edef68
    ---
     acconfig.h                 | 24 ++++++++++++------------
     include/apr_lock.h         | 12 ++++++------
     include/arch/beos/locks.h  |  2 +-
     include/arch/os2/locks.h   |  2 +-
     include/arch/unix/locks.h  |  2 +-
     include/arch/win32/locks.h |  2 +-
     locks/beos/crossproc.c     |  6 +++---
     locks/beos/intraproc.c     |  4 ++--
     locks/beos/locks.c         | 29 ++++++++++++++---------------
     locks/os2/locks.c          | 38 ++++++++++++++++++++------------------
     locks/unix/crossproc.c     | 16 ++++++++--------
     locks/unix/locks.c         | 23 ++++++++++++-----------
     locks/win32/locks.c        | 30 +++++++++++++++---------------
     13 files changed, 96 insertions(+), 94 deletions(-)
    
    diff --git a/acconfig.h b/acconfig.h
    index 35aa1f9b60a..8cc5284a45a 100644
    --- a/acconfig.h
    +++ b/acconfig.h
    @@ -70,25 +70,25 @@
     /* Macros to deal with using either a pool or an sms
      * to do memory stuff...
      */
    -#define APR_REGISTER_CLEANUP(struct, data, func, scope) \
    -    if (struct->cntxt) { \
    -        apr_pool_cleanup_register(struct->cntxt, data, func, scope); \
    +#define APR_CLEANUP_REGISTER(struct, data, func, scope) \
    +    if (struct->pool) { \
    +        apr_pool_cleanup_register(struct->pool, data, func, scope); \
         } else { \
             apr_sms_cleanup_register(struct->mem_sys, APR_CHILD_CLEANUP, \
                                      data, func); \
         }
     
    -#define APR_REMOVE_CLEANUP(struct, data, func) \
    -    if (struct->cntxt) { \
    -        apr_pool_cleanup_kill(struct->cntxt, data, func); \
    +#define APR_CLEANUP_REMOVE(struct, data, func) \
    +    if (struct->pool) { \
    +        apr_pool_cleanup_kill(struct->pool, data, func); \
         } else { \
             apr_sms_cleanup_unregister(struct->mem_sys, APR_CHILD_CLEANUP, \
                                        data, func); \
         }
     
     #define APR_MEM_PSTRDUP(struct, ptr, str) \
    -    if (struct->cntxt) { \
    -        ptr = apr_pstrdup(struct->cntxt, str); \
    +    if (struct->pool) { \
    +        ptr = apr_pstrdup(struct->pool, str); \
         } else { \
             size_t len = strlen(str) + 1; \
             ptr = (char*) apr_sms_calloc(struct->mem_sys, len); \
    @@ -96,15 +96,15 @@
         }
     
     #define APR_MEM_MALLOC(ptr, struct, type) \
    -    if (struct->cntxt) { \
    -        ptr = (type *)apr_palloc(struct->cntxt, sizeof(type)); \
    +    if (struct->pool) { \
    +        ptr = (type *)apr_palloc(struct->pool, sizeof(type)); \
         } else { \
             ptr = (type *)apr_sms_malloc(struct->mem_sys, sizeof(type)); \
         }
     
     #define APR_MEM_CALLOC(ptr, struct, type) \
    -    if (struct->cntxt) { \
    -        ptr = (type *)apr_pcalloc(struct->cntxt, sizeof(type)); \
    +    if (struct->pool) { \
    +        ptr = (type *)apr_pcalloc(struct->pool, sizeof(type)); \
         } else { \
             ptr = (type *)apr_sms_calloc(struct->mem_sys, sizeof(type)); \
         }
    diff --git a/include/apr_lock.h b/include/apr_lock.h
    index 9c5e08fdf9a..0f495cec256 100644
    --- a/include/apr_lock.h
    +++ b/include/apr_lock.h
    @@ -94,16 +94,16 @@ typedef enum {APR_READER, APR_WRITER} apr_readerwriter_e;
      * @param fname A file name to use if the lock mechanism requires one.  This
      *        argument should always be provided.  The lock code itself will
      *        determine if it should be used.
    - * @param cont The pool to operate on.
    + * @param pool The pool to operate on.
      * @tip APR_CROSS_PROCESS may lock both processes and threads, but it is
      *      only guaranteed to lock processes.
    - * @deffunc apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *cont)
    + * @deffunc apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *pool)
      */
     APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock,
                                               apr_locktype_e type,
                                               apr_lockscope_e scope,
                                               const char *fname,
    -                                          apr_pool_t *cont);
    +                                          apr_pool_t *pool);
     
     /**
      * Lock a protected region.
    @@ -144,16 +144,16 @@ APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock);
      *              argument should always be provided.  The lock code itself will
      *              determine if it should be used.  This filename should be the 
      *              same one that was passed to apr_lock_create
    - * @param cont The pool to operate on.
    + * @param pool The pool to operate on.
      * @tip This function doesn't always do something, it depends on the
      *      locking mechanism chosen for the platform, but it is a good
      *      idea to call it regardless, because it makes the code more
      *      portable. 
    - * @deffunc apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *cont)
    + * @deffunc apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *pool)
      */
     APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock,
                                                   const char *fname,
    -                                              apr_pool_t *cont);
    +                                              apr_pool_t *pool);
     
     /**
      * Return the pool associated with the current lock.
    diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h
    index 387c536eff8..39f48e31954 100644
    --- a/include/arch/beos/locks.h
    +++ b/include/arch/beos/locks.h
    @@ -63,7 +63,7 @@
     #include "apr_sms.h"
     
     struct apr_lock_t {
    -    apr_pool_t *cntxt;
    +    apr_pool_t *pool;
         apr_sms_t *mem_sys;
         apr_locktype_e type;
         apr_lockscope_e scope;
    diff --git a/include/arch/os2/locks.h b/include/arch/os2/locks.h
    index d3edf99d8e4..09e700d001d 100644
    --- a/include/arch/os2/locks.h
    +++ b/include/arch/os2/locks.h
    @@ -60,7 +60,7 @@
     #include "apr_sms.h"
     
     struct apr_lock_t {
    -    apr_pool_t *cntxt;
    +    apr_pool_t *pool;
         apr_sms_t *mem_sys;
         apr_locktype_e type;
         apr_lockscope_e scope;
    diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h
    index e34dcc769a6..2a062190ce9 100644
    --- a/include/arch/unix/locks.h
    +++ b/include/arch/unix/locks.h
    @@ -109,7 +109,7 @@ union semun {
     #endif
     
     struct apr_lock_t {
    -    apr_pool_t *cntxt;
    +    apr_pool_t *pool;
         apr_sms_t *mem_sys;
         apr_locktype_e type;
         apr_lockscope_e scope;
    diff --git a/include/arch/win32/locks.h b/include/arch/win32/locks.h
    index 1083e685e4e..98cb41f95bf 100644
    --- a/include/arch/win32/locks.h
    +++ b/include/arch/win32/locks.h
    @@ -59,7 +59,7 @@
     #include "apr_sms.h"
     
     struct apr_lock_t {
    -    apr_pool_t *cntxt;
    +    apr_pool_t *pool;
         apr_sms_t *mem_sys;
         apr_locktype_e type;
         apr_lockscope_e scope;
    diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c
    index 9476f5041ac..5e7f55425d0 100644
    --- a/locks/beos/crossproc.c
    +++ b/locks/beos/crossproc.c
    @@ -82,7 +82,7 @@ apr_status_t create_inter_lock(apr_lock_t *new)
         }
         new->ben_interproc = 0;
         new->sem_interproc = stat;
    -    APR_REGISTER_CLEANUP(new, (void *)new, lock_inter_cleanup,
    +    APR_CLEANUP_REGISTER(new, (void *)new, lock_inter_cleanup,
                             apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
    @@ -117,13 +117,13 @@ apr_status_t destroy_inter_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_inter_cleanup(lock)) == APR_SUCCESS) {
    -        APR_REMOVE_CLEANUP(lock, lock, lock_inter_cleanup);
    +        APR_CLEANUP_REMOVE(lock, lock, lock_inter_cleanup);
             return APR_SUCCESS;
         }
         return stat;
     }
     
    -apr_status_t child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname)
    +apr_status_t child_init_lock(apr_lock_t **lock, apr_pool_t *pool, const char *fname)
     {
         return APR_SUCCESS;
     }
    diff --git a/locks/beos/intraproc.c b/locks/beos/intraproc.c
    index 70bc4477c62..c7b57606b79 100644
    --- a/locks/beos/intraproc.c
    +++ b/locks/beos/intraproc.c
    @@ -77,7 +77,7 @@ apr_status_t create_intra_lock(apr_lock_t *new)
         }
         new->ben_intraproc = 0;
         new->sem_intraproc = stat;
    -    APR_REGISTER_CLEANUP(new, (void *)new, lock_intra_cleanup,
    +    APR_CLEANUP_REGISTER(new, (void *)new, lock_intra_cleanup,
                             apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
    @@ -112,7 +112,7 @@ apr_status_t destroy_intra_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) {
    -        APR_REMOVE_CLEANUP(lock, lock, lock_intra_cleanup);
    +        APR_CLEANUP_REMOVE(lock, lock, lock_intra_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    diff --git a/locks/beos/locks.c b/locks/beos/locks.c
    index 58749351f9a..574baefd86b 100644
    --- a/locks/beos/locks.c
    +++ b/locks/beos/locks.c
    @@ -58,7 +58,7 @@
     
     apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, 
                                apr_lockscope_e scope, const char *fname, 
    -                           apr_pool_t *cont)
    +                           apr_pool_t *pool)
     {
         apr_lock_t *new;
         apr_status_t stat;
    @@ -67,12 +67,12 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
         if (type == APR_READWRITE)
             return APR_ENOTIMPL; 
     
    -    new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t));
    +    new = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t));
         if (new == NULL){
             return APR_ENOMEM;
         }
         
    -    new->cntxt = cont;
    +    new->pool  = pool;
         new->type  = type;
         new->scope = scope;
     
    @@ -101,15 +101,14 @@ apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
         if (type == APR_READWRITE)
             return APR_ENOTIMPL; 
     
    -    new = (apr_lock_t *)apr_sms_malloc(mem_sys, sizeof(apr_lock_t));
    +    new = (apr_lock_t *)apr_sms_calloc(mem_sys, sizeof(apr_lock_t));
         if (new == NULL){
             return APR_ENOMEM;
         }
         
         new->mem_sys = mem_sys;
    -    new->cntxt = NULL;
    -    new->type  = type;
    -    new->scope = scope;
    +    new->type    = type;
    +    new->scope   = scope;
     
         if (scope != APR_CROSS_PROCESS) {
             if ((stat = create_intra_lock(new)) != APR_SUCCESS) {
    @@ -221,11 +220,11 @@ apr_status_t apr_lock_destroy(apr_lock_t *lock)
     }
     
     apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, 
    -			       apr_pool_t *cont)
    +			       apr_pool_t *pool)
     {
         apr_status_t stat;
         if ((*lock)->scope != APR_CROSS_PROCESS) {
    -        if ((stat = child_init_lock(lock, cont, fname)) != APR_SUCCESS) {
    +        if ((stat = child_init_lock(lock, pool, fname)) != APR_SUCCESS) {
                 return stat;
             }
         }
    @@ -234,13 +233,13 @@ apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname,
     
     apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data)
     {
    -    return apr_pool_userdata_get(data, key, lock->cntxt);
    +    return apr_pool_userdata_get(data, key, lock->pool);
     }
     
     apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key,
                                 apr_status_t (*cleanup) (void *))
     {
    -    return apr_pool_userdata_set(data, key, cleanup, lock->cntxt);
    +    return apr_pool_userdata_set(data, key, cleanup, lock->pool);
     }
     
     apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock)
    @@ -253,14 +252,14 @@ apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock)
     }
     
     apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, 
    -                           apr_pool_t *cont)
    +                             apr_pool_t *pool)
     {
    -    if (cont == NULL) {
    +    if (pool == NULL) {
             return APR_ENOPOOL;
         }
         if ((*lock) == NULL) {
    -        (*lock) = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t));
    -        (*lock)->cntxt = cont;
    +        (*lock) = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t));
    +        (*lock)->pool = pool;
         }
         (*lock)->sem_interproc = thelock->sem_interproc;
         (*lock)->ben_interproc = thelock->ben_interproc;
    diff --git a/locks/os2/locks.c b/locks/os2/locks.c
    index a0fae4b76bd..2056cea77ad 100644
    --- a/locks/os2/locks.c
    +++ b/locks/os2/locks.c
    @@ -73,7 +73,7 @@ static apr_status_t lock_cleanup(void *thelock)
     
     apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, 
                                  apr_lockscope_e scope, const char *fname, 
    -                             apr_pool_t *cont)
    +                             apr_pool_t *pool)
     {
         apr_lock_t *new;
         ULONG rc;
    @@ -84,25 +84,27 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
         if (type == APR_READWRITE)
             return APR_ENOTIMPL;
     
    -    new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t));
    -    new->cntxt = cont;
    -    new->type  = type;
    -    new->scope = scope;
    -    new->owner = 0;
    +    new = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t));
    +
    +    new->pool       = pool;
    +    new->type       = type;
    +    new->scope      = scope;
    +    new->owner      = 0;
         new->lock_count = 0;
    -    new->fname = apr_pstrdup(cont, fname);
    +    new->fname      = apr_pstrdup(pool, fname);
    +
         DosGetInfoBlocks(&(new->tib), &ppib);
     
         if (fname == NULL)
             semname = NULL;
         else
    -        semname = apr_pstrcat(cont, "/SEM32/", fname, NULL);
    +        semname = apr_pstrcat(pool, "/SEM32/", fname, NULL);
     
         rc = DosCreateMutexSem(semname, &(new->hMutex), scope == APR_CROSS_PROCESS ? DC_SEM_SHARED : 0, FALSE);
         *lock = new;
     
         if (!rc)
    -        apr_pool_cleanup_register(cont, new, lock_cleanup, apr_pool_cleanup_null);
    +        apr_pool_cleanup_register(pool, new, lock_cleanup, apr_pool_cleanup_null);
     
         return APR_OS2_STATUS(rc);
     }
    @@ -110,12 +112,12 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
     
     
     apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname,
    -			       apr_pool_t *cont)
    +			       apr_pool_t *pool)
     {
         int rc;
         PIB *ppib;
     
    -    *lock = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t));
    +    *lock = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t));
     
         if (lock == NULL)
             return APR_ENOMEM;
    @@ -126,7 +128,7 @@ apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname,
         rc = DosOpenMutexSem( (char *)fname, &(*lock)->hMutex );
     
         if (!rc)
    -        apr_pool_cleanup_register(cont, *lock, lock_cleanup, apr_pool_cleanup_null);
    +        apr_pool_cleanup_register(pool, *lock, lock_cleanup, apr_pool_cleanup_null);
     
         return APR_OS2_STATUS(rc);
     }
    @@ -236,14 +238,14 @@ apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock)
     
     
     apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, 
    -                           apr_pool_t *cont)
    +                           apr_pool_t *pool)
     {
    -    if (cont == NULL) {
    +    if (pool == NULL) {
             return APR_ENOPOOL;
         }
         if ((*lock) == NULL) {
    -        (*lock) = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t));
    -        (*lock)->cntxt = cont;
    +        (*lock) = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t));
    +        (*lock)->pool = pool;
         }
         (*lock)->hMutex = *thelock;
         return APR_SUCCESS;
    @@ -253,7 +255,7 @@ apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock,
     
     apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data)
     {
    -    return apr_pool_userdata_get(data, key, lock->cntxt);
    +    return apr_pool_userdata_get(data, key, lock->pool);
     }
     
     
    @@ -261,5 +263,5 @@ apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data)
     apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key,
                                 apr_status_t (*cleanup) (void *))
     {
    -    return apr_pool_userdata_set(data, key, cleanup, lock->cntxt);
    +    return apr_pool_userdata_set(data, key, cleanup, lock->pool);
     }
    diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c
    index 29df0c1744f..fbe33388a4b 100644
    --- a/locks/unix/crossproc.c
    +++ b/locks/unix/crossproc.c
    @@ -100,7 +100,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
             return errno;
         }
         new->curr_locked = 0;
    -    APR_REGISTER_CLEANUP(new, (void *)new, lock_cleanup, apr_pool_cleanup_null);
    +    APR_CLEANUP_REGISTER(new, (void *)new, lock_cleanup, apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    @@ -137,7 +137,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
         apr_status_t stat;
     
         if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        APR_REMOVE_CLEANUP(lock, lock, lock_cleanup);
    +        APR_CLEANUP_REMOVE(lock, lock, lock_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    @@ -223,7 +223,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
         }
     
         new->curr_locked = 0;
    -    APR_REGISTER_CLEANUP(new, (void *)new, lock_cleanup, apr_pool_cleanup_null);
    +    APR_CLEANUP_REGISTER(new, (void *)new, lock_cleanup, apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    @@ -259,7 +259,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        APR_REMOVE_CLEANUP(lock, lock, lock_cleanup);
    +        APR_CLEANUP_REMOVE(lock, lock, lock_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    @@ -316,7 +316,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
     
         new->curr_locked=0;
         unlink(new->fname);
    -    APR_REGISTER_CLEANUP(new, new, lock_cleanup, apr_pool_cleanup_null);
    +    APR_CLEANUP_REGISTER(new, new, lock_cleanup, apr_pool_cleanup_null);
         return APR_SUCCESS; 
     }
     
    @@ -352,7 +352,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        APR_REMOVE_CLEANUP(lock, lock, lock_cleanup);
    +        APR_CLEANUP_REMOVE(lock, lock, lock_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    @@ -397,7 +397,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
             return errno;
         }
         new->curr_locked = 0;
    -    APR_REGISTER_CLEANUP(new, (void *)new, lock_cleanup, apr_pool_cleanup_null);
    +    APR_CLEANUP_REGISTER(new, (void *)new, lock_cleanup, apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    @@ -433,7 +433,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        APR_REMOVE_CLEANUP(lock, lock, lock_cleanup);
    +        APR_CLEANUP_REMOVE(lock, lock, lock_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    diff --git a/locks/unix/locks.c b/locks/unix/locks.c
    index 44bbd20ce5a..40a4718a4bf 100644
    --- a/locks/unix/locks.c
    +++ b/locks/unix/locks.c
    @@ -108,16 +108,17 @@ static apr_status_t create_lock(apr_lock_t *new, const char *fname)
     
     apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, 
                                apr_lockscope_e scope, const char *fname, 
    -                           apr_pool_t *cont)
    +                           apr_pool_t *pool)
     {
         apr_lock_t *new;
         apr_status_t stat;
     
    -    new = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t));
    +    new = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t));
     
    -    new->cntxt = cont;
    +    new->pool  = pool;
         new->type  = type;
         new->scope = scope;
    +
         if ((stat = create_lock(new, fname)) != APR_SUCCESS)
             return APR_SUCCESS;
     
    @@ -135,9 +136,9 @@ apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
         new = (apr_lock_t *)apr_sms_calloc(mem_sys, sizeof(apr_lock_t));
     
         new->mem_sys = mem_sys;
    -    new->cntxt = NULL;
    -    new->type = type;
    -    new->scope = scope;
    +    new->type    = type;
    +    new->scope   = scope;
    +
         if ((stat = create_lock(new, fname)) != APR_SUCCESS)
             return stat;
     
    @@ -299,13 +300,13 @@ apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname,
     
     apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data)
     {
    -    return apr_pool_userdata_get(data, key, lock->cntxt);
    +    return apr_pool_userdata_get(data, key, lock->pool);
     }
     
     apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key,
                                 apr_status_t (*cleanup) (void *))
     {
    -    return apr_pool_userdata_set(data, key, cleanup, lock->cntxt);
    +    return apr_pool_userdata_set(data, key, cleanup, lock->pool);
     }
     
     apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock)
    @@ -321,14 +322,14 @@ apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock)
     }
     
     apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, 
    -                           apr_pool_t *cont)
    +                           apr_pool_t *pool)
     {
         if (cont == NULL) {
             return APR_ENOPOOL;
         }
         if ((*lock) == NULL) {
    -        (*lock) = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t));
    -        (*lock)->cntxt = cont;
    +        (*lock) = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t));
    +        (*lock)->pool = pool;
         }
         (*lock)->interproc = thelock->crossproc;
     #if APR_HAS_THREADS
    diff --git a/locks/win32/locks.c b/locks/win32/locks.c
    index b30755dca98..4920f217ba4 100644
    --- a/locks/win32/locks.c
    +++ b/locks/win32/locks.c
    @@ -61,7 +61,7 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock,
                                               apr_locktype_e type, 
                                               apr_lockscope_e scope, 
                                               const char *fname,
    -                                          apr_pool_t *cont)
    +                                          apr_pool_t *pool)
     {
         apr_lock_t *newlock;
         SECURITY_ATTRIBUTES sec;
    @@ -70,13 +70,13 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock,
         if (type == APR_READWRITE)
             return APR_ENOTIMPL;
     
    -    newlock = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t));
    +    newlock = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t));
     
    -    newlock->cntxt = cont;
    -    /* ToDo:  How to handle the case when no context is available? 
    +    newlock->pool = pool;
    +    /* ToDo:  How to handle the case when no pool is available? 
         *         How to cleanup the storage properly?
         */
    -    newlock->fname = apr_pstrdup(cont, fname);
    +    newlock->fname = apr_pstrdup(pool, fname);
         newlock->type = type;
         newlock->scope = scope;
         sec.nLength = sizeof(SECURITY_ATTRIBUTES);
    @@ -112,7 +112,7 @@ APR_DECLARE(apr_status_t) apr_lock_sms_create(apr_lock_t **lock,
     
         newlock = (apr_lock_t *)apr_sms_malloc(mem_sys, sizeof(apr_lock_t));
     
    -    newlock->cntxt = NULL;
    +    newlock->pool = NULL;
         newlock->mem_sys = mem_sys;
     
         APR_MEM_PSTRDUP(newlock, newlock->fname, fname);
    @@ -139,17 +139,17 @@ APR_DECLARE(apr_status_t) apr_lock_sms_create(apr_lock_t **lock,
     
     APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, 
                                                   const char *fname, 
    -                                              apr_pool_t *cont)
    +                                              apr_pool_t *pool)
     {
         /* This routine should not be called (and OpenMutex will fail if called) 
          * on a INTRAPROCESS lock
          */
    -    (*lock) = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t));
    +    (*lock) = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t));
     
         if ((*lock) == NULL) {
             return APR_ENOMEM;
         }
    -    (*lock)->fname = apr_pstrdup(cont, fname);
    +    (*lock)->fname = apr_pstrdup(pool, fname);
         (*lock)->mutex = OpenMutex(MUTEX_ALL_ACCESS, TRUE, fname);
         
         if ((*lock)->mutex == NULL) {
    @@ -248,14 +248,14 @@ APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock)
     APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key,
                                                void *data)
     {
    -    return apr_pool_userdata_get(data, key, lock->cntxt);
    +    return apr_pool_userdata_get(data, key, lock->pool);
     }
     
     APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data,
                                                const char *key,
                                                apr_status_t (*cleanup) (void *))
     {
    -    return apr_pool_userdata_set(data, key, cleanup, lock->cntxt);
    +    return apr_pool_userdata_set(data, key, cleanup, lock->pool);
     }
     
     APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *thelock,
    @@ -267,14 +267,14 @@ APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *thelock,
     
     APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock,
                                               apr_os_lock_t *thelock,
    -                                          apr_pool_t *cont)
    +                                          apr_pool_t *pool)
     {
    -    if (cont == NULL) {
    +    if (pool == NULL) {
             return APR_ENOPOOL;
         }
         if ((*lock) == NULL) {
    -        (*lock) = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t));
    -        (*lock)->cntxt = cont;
    +        (*lock) = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t));
    +        (*lock)->pool = pool;
         }
         (*lock)->mutex = *thelock;
         return APR_SUCCESS;
    
    From 4324c238163eea561f423073e6a1039cfb7ed4e7 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Tue, 5 Jun 2001 13:48:25 +0000
    Subject: [PATCH 1711/7878] One slipped through the rename, but got it now!
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61703 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/unix/locks.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/locks/unix/locks.c b/locks/unix/locks.c
    index 40a4718a4bf..30dbab9b38d 100644
    --- a/locks/unix/locks.c
    +++ b/locks/unix/locks.c
    @@ -324,7 +324,7 @@ apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock)
     apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, 
                                apr_pool_t *pool)
     {
    -    if (cont == NULL) {
    +    if (pool == NULL) {
             return APR_ENOPOOL;
         }
         if ((*lock) == NULL) {
    
    From db77a537e3ecfdf7dc4465234f41a3c048fdc576 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 5 Jun 2001 16:46:52 +0000
    Subject: [PATCH 1712/7878] use new name for pool field
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61704 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/unix/intraproc.c | 10 +++++-----
     1 file changed, 5 insertions(+), 5 deletions(-)
    
    diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c
    index d0bad26ee70..ef01c8090c7 100644
    --- a/locks/unix/intraproc.c
    +++ b/locks/unix/intraproc.c
    @@ -78,8 +78,8 @@ apr_status_t apr_unix_create_intra_lock(apr_lock_t *new)
         apr_status_t stat;
         pthread_mutexattr_t mattr;
     
    -    new->intraproc = (pthread_mutex_t *)apr_palloc(new->cntxt, 
    -                              sizeof(pthread_mutex_t));
    +    new->intraproc = (pthread_mutex_t *)apr_palloc(new->pool, 
    +                                                   sizeof(pthread_mutex_t));
         if (new->intraproc == NULL ) {
             return errno;
         }
    @@ -108,8 +108,8 @@ apr_status_t apr_unix_create_intra_lock(apr_lock_t *new)
         }
     
         new->curr_locked = 0;
    -    apr_pool_cleanup_register(new->cntxt, (void *)new, lock_intra_cleanup,
    -                        apr_pool_cleanup_null);
    +    apr_pool_cleanup_register(new->pool, (void *)new, lock_intra_cleanup,
    +                              apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    @@ -143,7 +143,7 @@ apr_status_t apr_unix_destroy_intra_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) {
    -        apr_pool_cleanup_kill(lock->cntxt, lock, lock_intra_cleanup);
    +        apr_pool_cleanup_kill(lock->pool, lock, lock_intra_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    
    From 221ca1835d90288c07db55eab44a9b265ec85946 Mon Sep 17 00:00:00 2001
    From: Cliff Woolley 
    Date: Wed, 6 Jun 2001 00:07:46 +0000
    Subject: [PATCH 1713/7878] (Attempt to) fix the build on Win32 from the
     sms-ified locks that David checked in earlier.  This patch has a few things I
     don't quite like (eg, the macros are duplicated across the Unix/Win32
     apr_private.h files), but Greg has asked for an on-list discussion of David's
     original patch anyway, so this is just a quick hack to try to get things
     working again in the meanwhile. Unfortunately, DOS line endings are killing
     me and so I can't actually test this (MSVC won't grok .dsp files that were
     checked out with Unix line endings, apparently, and I don't have Win32 CVS
     tools handy...  sheesh), so I'll have to lean on you Win32 guys to make sure
     this gets us building again.  At least it still builds on Unix and *looks*
     reasonable for Win32, meaning that this patch can't have made us worse off
     than before.  ;-)
    
    Submitted by:	Ian Holsman 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61705 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr.dsp                          | 18 +++++++++++++-
     include/apr.hw                   |  2 ++
     include/arch/win32/apr_private.h | 41 ++++++++++++++++++++++++++++++++
     include/arch/win32/locks.h       |  2 +-
     libapr.dsp                       | 16 +++++++++++++
     locks/win32/locks.c              |  3 ++-
     6 files changed, 79 insertions(+), 3 deletions(-)
    
    diff --git a/apr.dsp b/apr.dsp
    index ff499ce85ac..1d1587d7063 100644
    --- a/apr.dsp
    +++ b/apr.dsp
    @@ -65,7 +65,7 @@ LIB32=link.exe -lib
     # PROP Ignore_Export_Lib 0
     # PROP Target_Dir ""
     # ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
    -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c
    +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /FR /Fd"LibD\apr" /FD /c
     # ADD BASE RSC /l 0x409
     # ADD RSC /l 0x409
     BSC32=bscmake.exe
    @@ -403,6 +403,22 @@ SOURCE=.\user\win32\groupinfo.c
     SOURCE=.\user\win32\userinfo.c
     # End Source File
     # End Group
    +# Begin Group "memory"
    +
    +# PROP Default_Filter ""
    +# Begin Source File
    +
    +SOURCE=.\memory\unix\apr_sms.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\memory\unix\apr_sms_std.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\memory\unix\apr_sms_tracking.c
    +# End Source File
    +# End Group
     # End Group
     # Begin Group "Generated Header Files"
     
    diff --git a/include/apr.hw b/include/apr.hw
    index 236adc2b85d..53f868c0659 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -235,6 +235,8 @@ typedef  int         uid_t;
     typedef  int         gid_t;
     
     
    +typedef struct apr_lock_t        apr_lock_t;
    +typedef struct apr_sms_t         apr_sms_t;
     /* Mechanisms to properly type numeric literals */
     
     #define APR_INT64_C(val) (val##i64)
    diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h
    index 884bedcd062..d3affa890ad 100644
    --- a/include/arch/win32/apr_private.h
    +++ b/include/arch/win32/apr_private.h
    @@ -149,6 +149,47 @@ typedef void (Sigfunc)(int);
     
     unsigned __stdcall SignalHandling(void *);
     int thread_ready(void);
    +/* Macros to deal with using either a pool or an sms
    + * to do memory stuff...
    + */
    +#define APR_CLEANUP_REGISTER(struct, data, func, scope) \
    +    if (struct->pool) { \
    +        apr_pool_cleanup_register(struct->pool, data, func, scope); \
    +    } else { \
    +        apr_sms_cleanup_register(struct->mem_sys, APR_CHILD_CLEANUP, \
    +                                 data, func); \
    +    }
    +
    +#define APR_CLEANUP_REMOVE(struct, data, func) \
    +    if (struct->pool) { \
    +        apr_pool_cleanup_kill(struct->pool, data, func); \
    +    } else { \
    +        apr_sms_cleanup_unregister(struct->mem_sys, APR_CHILD_CLEANUP, \
    +                                   data, func); \
    +    }
    +
    +#define APR_MEM_PSTRDUP(struct, ptr, str) \
    +    if (struct->pool) { \
    +        ptr = apr_pstrdup(struct->pool, str); \
    +    } else { \
    +        size_t len = strlen(str) + 1; \
    +        ptr = (char*) apr_sms_calloc(struct->mem_sys, len); \
    +        memcpy(ptr, str, len); \
    +    }
    +
    +#define APR_MEM_MALLOC(ptr, struct, type) \
    +    if (struct->pool) { \
    +        ptr = (type *)apr_palloc(struct->pool, sizeof(type)); \
    +    } else { \
    +        ptr = (type *)apr_sms_malloc(struct->mem_sys, sizeof(type)); \
    +    }
    +
    +#define APR_MEM_CALLOC(ptr, struct, type) \
    +    if (struct->pool) { \
    +        ptr = (type *)apr_pcalloc(struct->pool, sizeof(type)); \
    +    } else { \
    +        ptr = (type *)apr_sms_calloc(struct->mem_sys, sizeof(type)); \
    +    }
     
     #endif  /*APR_PRIVATE_H*/
     #endif  /*WIN32*/
    diff --git a/include/arch/win32/locks.h b/include/arch/win32/locks.h
    index 98cb41f95bf..b3da21a043a 100644
    --- a/include/arch/win32/locks.h
    +++ b/include/arch/win32/locks.h
    @@ -68,7 +68,7 @@ struct apr_lock_t {
         char *fname;
     };
     
    -apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
    +APR_DECLARE(apr_status_t) apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
                                      apr_lockscope_e scope, const char *fname,
                                      apr_sms_t *mem_sys);
     
    diff --git a/libapr.dsp b/libapr.dsp
    index 8e5e87f8019..1c94fe9c3df 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -409,6 +409,22 @@ SOURCE=.\user\win32\groupinfo.c
     SOURCE=.\user\win32\userinfo.c
     # End Source File
     # End Group
    +# Begin Group "memory"
    +
    +# PROP Default_Filter ""
    +# Begin Source File
    +
    +SOURCE=.\memory\unix\apr_sms.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\memory\unix\apr_sms_std.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\memory\unix\apr_sms_tracking.c
    +# End Source File
    +# End Group
     # End Group
     # Begin Group "Generated Header Files"
     
    diff --git a/locks/win32/locks.c b/locks/win32/locks.c
    index 4920f217ba4..0824b85a948 100644
    --- a/locks/win32/locks.c
    +++ b/locks/win32/locks.c
    @@ -51,7 +51,8 @@
      * information on the Apache Software Foundation, please see
      * .
      */
    -
    +#include "apr.h"
    +#include "apr_private.h"
     #include "apr_general.h"
     #include "apr_strings.h"
     #include "win32/locks.h"
    
    From 2bf5d42a8349f7c1d1df1586a00529b2e69d4ed3 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Wed, 6 Jun 2001 03:08:34 +0000
    Subject: [PATCH 1714/7878] Fix missing brace, broken in recent rwlock patch.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61706 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/os2/locks.c | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/locks/os2/locks.c b/locks/os2/locks.c
    index 2056cea77ad..cebf45887b2 100644
    --- a/locks/os2/locks.c
    +++ b/locks/os2/locks.c
    @@ -208,6 +208,7 @@ apr_status_t apr_lock_destroy(apr_lock_t *lock)
             if (lock->owner == CurrentTid) {
                 while (lock->lock_count > 0 && stat == APR_SUCCESS)
                     stat = apr_lock_release(lock);
    +        }
     
             if (stat != APR_SUCCESS)
                 return stat;
    
    From 028c5ca8e1aa592a254f3b7eaaf1ef0cd689e723 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Wed, 6 Jun 2001 03:12:48 +0000
    Subject: [PATCH 1715/7878] Style cleanup: switch statement opening braces
     belong on the same line.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61707 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/os2/locks.c | 15 +++++----------
     1 file changed, 5 insertions(+), 10 deletions(-)
    
    diff --git a/locks/os2/locks.c b/locks/os2/locks.c
    index cebf45887b2..808ffba9547 100644
    --- a/locks/os2/locks.c
    +++ b/locks/os2/locks.c
    @@ -139,8 +139,7 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock)
     {
         ULONG rc;
     
    -    switch (lock->type)
    -    {
    +    switch (lock->type) {
         case APR_MUTEX: 
             rc = DosRequestMutexSem(lock->hMutex, SEM_INDEFINITE_WAIT);
     
    @@ -158,13 +157,11 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock)
     
     apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e)
     {
    -    switch (lock->type)
    -    {
    +    switch (lock->type) {
         case APR_MUTEX:
             return APR_ENOTIMPL;
         case APR_READWRITE:
    -        switch (e)
    -        {
    +        switch (e) {
             case APR_READER:
                 break;
             case APR_WRITER:
    @@ -179,8 +176,7 @@ apr_status_t apr_lock_release(apr_lock_t *lock)
     {
         ULONG rc;
         
    -    switch (lock->type)
    -    {
    +    switch (lock->type) {
         case APR_MUTEX:
             if (lock->owner == CurrentTid && lock->lock_count > 0) {
                 lock->lock_count--;
    @@ -202,8 +198,7 @@ apr_status_t apr_lock_destroy(apr_lock_t *lock)
         ULONG rc;
         apr_status_t stat = APR_SUCCESS;
     
    -    switch (lock->type)
    -    {
    +    switch (lock->type) {
         case APR_MUTEX:
             if (lock->owner == CurrentTid) {
                 while (lock->lock_count > 0 && stat == APR_SUCCESS)
    
    From 929f0a01e9c669838a201c71cf195411c7949b24 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Wed, 6 Jun 2001 03:18:43 +0000
    Subject: [PATCH 1716/7878] Stop warnings about rc being used uninitialized.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61708 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/os2/locks.c | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/locks/os2/locks.c b/locks/os2/locks.c
    index 808ffba9547..3d7eed8a49a 100644
    --- a/locks/os2/locks.c
    +++ b/locks/os2/locks.c
    @@ -150,6 +150,8 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock)
             break;
         case APR_READWRITE:
             return APR_ENOTIMPL;
    +    default:
    +        return APR_EINVAL;
         }
     
         return APR_OS2_STATUS(rc);
    @@ -218,6 +220,8 @@ apr_status_t apr_lock_destroy(apr_lock_t *lock)
             break;
         case APR_READWRITE:
             return APR_ENOTIMPL;
    +    default:
    +        return APR_EINVAL;
         }
             
         return APR_OS2_STATUS(rc);
    
    From 41d3c5c1f2d30a4ec4eb1f707469fa1d9a480b13 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 6 Jun 2001 03:57:47 +0000
    Subject: [PATCH 1717/7878]   Two typographical nits, and add some missing
     headers to our browser view.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61709 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr.dsp             | 14 +++++++++++++-
     libapr.dsp          | 12 ++++++++++++
     locks/win32/locks.c |  1 +
     3 files changed, 26 insertions(+), 1 deletion(-)
    
    diff --git a/apr.dsp b/apr.dsp
    index 1d1587d7063..e7c32f63527 100644
    --- a/apr.dsp
    +++ b/apr.dsp
    @@ -65,7 +65,7 @@ LIB32=link.exe -lib
     # PROP Ignore_Export_Lib 0
     # PROP Target_Dir ""
     # ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
    -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /FR /Fd"LibD\apr" /FD /c
    +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c
     # ADD BASE RSC /l 0x409
     # ADD RSC /l 0x409
     BSC32=bscmake.exe
    @@ -534,10 +534,22 @@ SOURCE=.\include\apr_portable.h
     # End Source File
     # Begin Source File
     
    +SOURCE=.\include\apr_signal.h
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\apr_shmem.h
     # End Source File
     # Begin Source File
     
    +SOURCE=.\include\apr_sms.h
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\include\apr_sms_tracking.h
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\apr_strings.h
     # End Source File
     # Begin Source File
    diff --git a/libapr.dsp b/libapr.dsp
    index 1c94fe9c3df..515cd58c632 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -540,10 +540,22 @@ SOURCE=.\include\apr_portable.h
     # End Source File
     # Begin Source File
     
    +SOURCE=.\include\apr_signal.h
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\apr_shmem.h
     # End Source File
     # Begin Source File
     
    +SOURCE=.\include\apr_sms.h
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\include\apr_sms_tracking.h
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\apr_strings.h
     # End Source File
     # Begin Source File
    diff --git a/locks/win32/locks.c b/locks/win32/locks.c
    index 0824b85a948..043a630f347 100644
    --- a/locks/win32/locks.c
    +++ b/locks/win32/locks.c
    @@ -51,6 +51,7 @@
      * information on the Apache Software Foundation, please see
      * .
      */
    +
     #include "apr.h"
     #include "apr_private.h"
     #include "apr_general.h"
    
    From dea61beda023f249aea1d378e9e95befc6eb91f9 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 6 Jun 2001 15:22:04 +0000
    Subject: [PATCH 1718/7878]   All printf's of the world return int - this
     warning has driven me crazy   for months.  Sorry for the cast, but this one's
     quite harmless.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61710 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/inet_ntop.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c
    index 63752d615f8..2655ac6bdc7 100644
    --- a/network_io/unix/inet_ntop.c
    +++ b/network_io/unix/inet_ntop.c
    @@ -102,7 +102,7 @@ inet_ntop4(const unsigned char *src, char *dst, apr_size_t size)
     	static const char fmt[] = "%u.%u.%u.%u";
     	char tmp[sizeof "255.255.255.255"];
     
    -	if (apr_snprintf(tmp, sizeof tmp, fmt, src[0], src[1], src[2], src[3]) > size) {
    +	if (apr_snprintf(tmp, sizeof tmp, fmt, src[0], src[1], src[2], src[3]) > (int)size) {
     		errno = ENOSPC;
     		return (NULL);
     	}
    
    From 1a6ba6b1ba79ddd95480efe5a1eb3b4daddfcd23 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 6 Jun 2001 16:03:07 +0000
    Subject: [PATCH 1719/7878]   Should have added EPIPE long ago.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61711 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h | 11 +++++++++++
     1 file changed, 11 insertions(+)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 6b2198c5593..36050c3b69b 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -468,6 +468,12 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_EFTYPE        (APR_OS_START_CANONERR + 23)
     #endif
     
    +#ifdef EPIPE
    +#define APR_EPIPE EPIPE
    +#else
    +#define APR_EPIPE         (APR_OS_START_CANONERR + 24)
    +#endif
    +
     
     #if defined(OS2)
     
    @@ -580,6 +586,9 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_ENETUNREACH(s)    ((s) == APR_ENETUNREACH \
                     || (s) == APR_OS_START_SYSERR + SOCENETUNREACH)
     #define APR_STATUS_IS_EFTYPE(s)         ((s) == APR_EFTYPE)
    +#define APR_STATUS_IS_EPIPE(s)          ((s) == APR_EPIPE \
    +                || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE
    +                || (s) == APR_OS_START_SYSERR + SOCEPIPE)
     
     /*
         Sorry, too tired to wrap this up for OS2... feel free to
    @@ -677,6 +686,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
                     || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH)
     #define APR_STATUS_IS_ENETUNREACH(s)    ((s) == APR_ENETUNREACH \
                     || (s) == APR_OS_START_SYSERR + WSAENETUNREACH)
    +#define APR_STATUS_IS_EPIPE(s)          ((s) == APR_EPIPE \
    +                || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE)
     
     #else /* !def OS2 || WIN32 */
     
    
    From 4bdf089e235e4008bc0981c38a348d8dd32b21e9 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 6 Jun 2001 16:05:26 +0000
    Subject: [PATCH 1720/7878]   *) Complete the implementation of LARGEFILE
     support on Win32, although      the mmap semantics still need a touch of
     work.
    
      *) Fix the APR_XTHREAD support, and apr_sendfile mechanics, so we can
         handle cross-threaded file handles on Win32.
    
      Sorry, it's rather hard to untangle one from the other to create two patches.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61712 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                     |  6 +++
     file_io/win32/open.c        | 10 +++-
     file_io/win32/pipe.c        |  5 +-
     file_io/win32/readwrite.c   | 54 +++++++++++++++++----
     file_io/win32/seek.c        | 94 ++++++++++++++++++++++---------------
     include/apr.hw              |  2 +-
     include/apr_mmap.h          |  6 +--
     include/arch/win32/fileio.h |  8 ++--
     mmap/win32/mmap.c           | 17 +++++--
     network_io/win32/sendrecv.c | 32 +++++++------
     10 files changed, 158 insertions(+), 76 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 3a0b7a713bd..062b15d70f3 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,11 @@
     Changes with APR b1  
     
    +  *) Complete the implementation of LARGEFILE support on Win32, although
    +     the mmap semantics still need a touch of work.
    +
    +  *) Fix the APR_XTHREAD support, and apr_sendfile mechanics, so we can
    +     handle cross-threaded file handles on Win32.
    +
       *) Implement APR_READWRITE locks on Unix with POSIX rwlocks.
          Introduce new apr_lock_acquire_rw() function which takes in 
          APR_READER or APR_WRITER.  [Justin Erenkrantz]
    diff --git a/file_io/win32/open.c b/file_io/win32/open.c
    index ea6e17e8006..4192cccc9bf 100644
    --- a/file_io/win32/open.c
    +++ b/file_io/win32/open.c
    @@ -162,7 +162,7 @@ apr_status_t file_cleanup(void *thefile)
             CloseHandle(file->filehand);
             file->filehand = INVALID_HANDLE_VALUE;
         }
    -    if (file->pOverlapped) {
    +    if (file->pOverlapped && file->pOverlapped->hEvent) {
             CloseHandle(file->pOverlapped->hEvent);
             file->pOverlapped = NULL;
         }
    @@ -286,6 +286,14 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname,
             (*new)->mutex = NULL;
         }
     
    +    if (flag & APR_XTHREAD) {
    +        /* This win32 specific feature is required to pass
    +         * the current offset for an overlaped file handle.
    +         */
    +        (*new)->pOverlapped = (OVERLAPPED*) apr_pcalloc(cont, sizeof(OVERLAPPED));
    +        (*new)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
    +    }
    +
         (*new)->pipe = 0;
         (*new)->timeout = -1;
         (*new)->ungetchar = -1;
    diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c
    index bf321ce2184..8f5d296d99a 100644
    --- a/file_io/win32/pipe.c
    +++ b/file_io/win32/pipe.c
    @@ -161,7 +161,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out,
     
         (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t));
         (*in)->cntxt = p;
    -    (*in)->fname = "\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */
    +    (*in)->fname = ""; // What was this??? : apr_pstrdup(p, "PIPE"); */
         (*in)->pipe = 1;
         (*in)->timeout = -1;
         (*in)->ungetchar = -1;
    @@ -174,7 +174,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out,
     
         (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t));
         (*out)->cntxt = p;
    -    (*in)->fname = "\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */
    +    (*out)->fname = ""; // What was this??? : apr_pstrdup(p, "PIPE"); */
         (*out)->pipe = 1;
         (*out)->timeout = -1;
         (*out)->ungetchar = -1;
    @@ -192,7 +192,6 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out,
                 dwOpenMode |= FILE_FLAG_OVERLAPPED;
                 (*in)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED));
                 (*in)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
    -            /* register a cleanup for the event handle... */
             }
     
             dwPipeMode = 0;
    diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c
    index 64ab1f27b38..ccdaf765d1e 100644
    --- a/file_io/win32/readwrite.c
    +++ b/file_io/win32/readwrite.c
    @@ -105,6 +105,11 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le
             }
         }
     
    +    if (file->pOverlapped && !file->pipe) {
    +        file->pOverlapped->Offset     = (DWORD)file->filePtr;
    +        file->pOverlapped->OffsetHigh = (DWORD)(file->filePtr >> 32);
    +    }
    +
         rv = ReadFile(file->filehand, buf, len, nbytes, file->pOverlapped);
     
         if (!rv) {
    @@ -137,7 +142,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le
             }
             else if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) {
                 /* Assume ERROR_BROKEN_PIPE signals an EOF reading from a pipe */
    -            rv = APR_SUCCESS; /* APR_EOF? */
    +            rv = APR_EOF;
             }
         } else {
             /* OK and 0 bytes read ==> end of file */
    @@ -146,6 +151,9 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le
             else
                 rv = APR_SUCCESS;
         }
    +    if (rv == APR_SUCCESS && file->pOverlapped && !file->pipe) {
    +        file->filePtr += *nbytes;
    +    }
         return rv;
     }
     
    @@ -229,16 +237,18 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a
     
         if (thefile->buffered) {
             char *pos = (char *)buf;
    -        int blocksize;
    -        int size = *nbytes;
    +        apr_size_t blocksize;
    +        apr_size_t size = *nbytes;
     
             apr_lock_acquire(thefile->mutex);
     
             if (thefile->direction == 0) {
                 // Position file pointer for writing at the offset we are logically reading from
                 apr_off_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos;
    +            DWORD offlo = (DWORD)offset;
    +            DWORD offhi = (DWORD)(offset >> 32);
                 if (offset != thefile->filePtr)
    -                SetFilePointer(thefile->filehand, offset, NULL, FILE_BEGIN);
    +                SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN);
                 thefile->bufpos = thefile->dataRead = 0;
                 thefile->direction = 1;
             }
    @@ -258,22 +268,50 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a
             apr_lock_release(thefile->mutex);
             return rv;
         } else {
    -        if (!thefile->pipe && thefile->append) {
    +        if (thefile->pOverlapped && !thefile->pipe) {
    +            thefile->pOverlapped->Offset     = (DWORD)thefile->filePtr;
    +            thefile->pOverlapped->OffsetHigh = (DWORD)(thefile->filePtr >> 32);
    +        }
    +        else if (!thefile->pipe && thefile->append) {
                 SetFilePointer(thefile->filehand, 0, NULL, FILE_END);
             }
    -        if (WriteFile(thefile->filehand, buf, *nbytes, &bwrote, NULL)) {
    +        if (WriteFile(thefile->filehand, buf, *nbytes, &bwrote, 
    +                      thefile->pOverlapped)) {
                 *nbytes = bwrote;
                 rv = APR_SUCCESS;
             }
             else {
                 (*nbytes) = 0;
                 rv = apr_get_os_error();
    +            if (rv == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) {
    +                /* Wait for the pending i/o (put a timeout here?) */
    +                rv = WaitForSingleObject(thefile->pOverlapped->hEvent, INFINITE);
    +                switch (rv) {
    +                    case WAIT_OBJECT_0:
    +                        GetOverlappedResult(thefile->filehand, thefile->pOverlapped, nbytes, TRUE);
    +                        rv = APR_SUCCESS;
    +                        break;
    +                    case WAIT_TIMEOUT:
    +                        rv = APR_TIMEUP;
    +                        break;
    +                    case WAIT_FAILED:
    +                        rv = apr_get_os_error();
    +                        break;
    +                    default:
    +                        break;
    +                }
    +                if (rv != APR_SUCCESS) {
    +                    CancelIo(thefile->filehand);
    +                }
    +            }
    +        }
    +        if (rv == APR_SUCCESS && thefile->pOverlapped && !thefile->pipe) {
    +            thefile->filePtr += *nbytes;
             }
         }
    -
         return rv;
     }
    -/*
    +/* ToDo: Write for it anyway and test the oslevel!
      * Too bad WriteFileGather() is not supported on 95&98 (or NT prior to SP2)
      */
     APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile,
    diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c
    index 63daceaebf6..d6355ac332e 100644
    --- a/file_io/win32/seek.c
    +++ b/file_io/win32/seek.c
    @@ -57,9 +57,9 @@
     #include 
     #include 
     
    -static apr_status_t setptr(apr_file_t *thefile, unsigned long pos )
    +static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos )
     {
    -    long newbufpos;
    +    apr_off_t newbufpos;
         DWORD rc;
     
         if (thefile->direction == 1) {
    @@ -70,15 +70,19 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos )
         newbufpos = pos - (thefile->filePtr - thefile->dataRead);
     
         if (newbufpos >= 0 && newbufpos <= thefile->dataRead) {
    -        thefile->bufpos = newbufpos;
    +        thefile->bufpos = (apr_size_t)newbufpos;
             rc = 0;
         } else {
    -        rc = SetFilePointer(thefile->filehand, pos, NULL, FILE_BEGIN);
    +        DWORD offlo = (DWORD)pos;
    +        DWORD offhi = (DWORD)(pos >> 32);
    +        rc = SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN);
     
    -        if ( rc == 0xFFFFFFFF )
    +        if (rc == 0xFFFFFFFF)
                 rc = apr_get_os_error();
             else
    -            rc = thefile->bufpos = thefile->dataRead = 0;
    +            rc = APR_SUCCESS;
    +        if (rc == APR_SUCCESS)
    +            thefile->bufpos = thefile->dataRead = 0;
         }
     
         return rc;
    @@ -88,57 +92,73 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos )
     
     APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset)
     {
    -    DWORD howmove;
    -    DWORD rv;
    +    apr_finfo_t finfo;
    +    apr_status_t rc = APR_EINVAL;
     
         if (thefile->buffered) {
    -        int rc = APR_EINVAL;
    -        apr_finfo_t finfo;
    -
             switch (where) {
    -        case APR_SET:
    -            rc = setptr(thefile, *offset);
    -            break;
    +            case APR_SET:
    +                rc = setptr(thefile, *offset);
    +                break;
     
    -        case APR_CUR:
    -            rc = setptr(thefile, thefile->filePtr - thefile->dataRead + thefile->bufpos + *offset);
    -            break;
    +            case APR_CUR:
    +                rc = setptr(thefile, thefile->filePtr - thefile->dataRead 
    +                                      + thefile->bufpos + *offset);
    +                break;
     
    -        case APR_END:
    -            rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile);
    -            if (rc == APR_SUCCESS && (finfo.valid & APR_FINFO_SIZE))
    -                rc = setptr(thefile, finfo.size - *offset);
    -            break;
    +            case APR_END:
    +                rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile);
    +                if (rc == APR_SUCCESS)
    +                    rc = setptr(thefile, finfo.size - *offset);
    +                break;
             }
     
             *offset = thefile->filePtr + thefile->bufpos;
             return rc;
    -    } else {
    +    } 
    +    else if (thefile->pOverlapped) {
             switch(where) {
                 case APR_SET:
    -                howmove = FILE_BEGIN;
    +                thefile->filePtr = *offset;
                     break;
             
                 case APR_CUR:
    -                howmove = FILE_CURRENT;
    +                thefile->filePtr += *offset;
                     break;
             
                 case APR_END:
    -                howmove = FILE_END;
    +                rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile);
    +                if (rc == APR_SUCCESS && finfo.size - *offset < 0)
    +                    thefile->filePtr = finfo.size - *offset;
                     break;
    -
    -            default:
    -                return APR_BADARG;
             }
    +        *offset = thefile->filePtr;
    +        return rc;
    +    }
    +    else {
    +        DWORD howmove;
    +        DWORD offlo = (DWORD)*offset;
    +        DWORD offhi = (DWORD)(*offset >> 32);
     
    -        rv = SetFilePointer(thefile->filehand, *offset, NULL, howmove);
    -        if (rv == -1) {
    -            *offset = -1;
    -            return apr_get_os_error();
    -        }
    -        else {
    -            *offset = rv;
    -            return APR_SUCCESS;
    +        switch(where) {
    +            case APR_SET:
    +                howmove = FILE_BEGIN;   break;
    +            case APR_CUR:
    +                howmove = FILE_CURRENT; break;
    +            case APR_END:
    +                howmove = FILE_END;     break;
    +            default:
    +                return APR_EINVAL;
             }
    +        offlo = SetFilePointer(thefile->filehand, (LONG)offlo, 
    +                               (LONG*)&offhi, howmove);
    +        if (offlo == 0xFFFFFFFF)
    +            rc = apr_get_os_error();
    +        else
    +            rc = APR_SUCCESS;
    +        /* Since we can land at 0xffffffff we will measure our APR_SUCCESS */
    +        if (rc == APR_SUCCESS)
    +            *offset = ((apr_off_t)offhi << 32) | offlo;
    +        return rc;
         }
     }
    diff --git a/include/apr.hw b/include/apr.hw
    index 53f868c0659..2eda87a8ce8 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -228,7 +228,7 @@ typedef  unsigned __int64  apr_uint64_t;
     
     typedef  size_t      apr_size_t;
     typedef  ptrdiff_t   apr_ssize_t;
    -typedef  _off_t      apr_off_t;
    +typedef  __int64     apr_off_t;
     typedef  int         apr_socklen_t;
     typedef  int         pid_t;
     typedef  int         uid_t;
    diff --git a/include/apr_mmap.h b/include/apr_mmap.h
    index c6060e14035..99abc3831fc 100644
    --- a/include/apr_mmap.h
    +++ b/include/apr_mmap.h
    @@ -96,9 +96,9 @@ struct apr_mmap_t {
         /** The start of the real memory page area (mapped view) */
         void *mv;
         /** The physical start, size and offset */
    -    apr_off_t pstart;
    -    apr_off_t psize;
    -    apr_off_t poffset;
    +    apr_off_t  pstart;
    +    apr_size_t psize;
    +    apr_off_t  poffset;
     #endif
         /** The start of the memory mapped area */
         void *mm;
    diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h
    index de282bc5943..e17dc564468 100644
    --- a/include/arch/win32/fileio.h
    +++ b/include/arch/win32/fileio.h
    @@ -184,10 +184,10 @@ struct apr_file_t {
     
         /* Stuff for buffered mode */
         char *buffer;
    -    apr_ssize_t bufpos;        // Read/Write position in buffer
    -    apr_ssize_t dataRead;      // amount of valid data read into buffer
    -    int direction;            // buffer being used for 0 = read, 1 = write
    -    apr_ssize_t filePtr;       // position in file of handle
    +    apr_size_t bufpos;         // Read/Write position in buffer
    +    apr_size_t dataRead;       // amount of valid data read into buffer
    +    int direction;             // buffer being used for 0 = read, 1 = write
    +    apr_off_t filePtr;         // position in file of handle
         apr_lock_t *mutex;         // mutex semaphore, must be owned to access the above fields
     
         /* Pipe specific info */    
    diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c
    index 6060e0c9d5e..cab53992d53 100644
    --- a/mmap/win32/mmap.c
    +++ b/mmap/win32/mmap.c
    @@ -96,7 +96,10 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file,
                                               apr_int32_t flag, apr_pool_t *cont)
     {
         static DWORD memblock = 0;
    -    DWORD fmaccess = 0, mvaccess = 0;
    +    DWORD fmaccess = 0;
    +    DWORD mvaccess = 0;
    +    DWORD offlo;
    +    DWORD offhi;
     
         if (flag & APR_MMAP_WRITE)
             fmaccess |= PAGE_READWRITE;
    @@ -121,19 +124,23 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file,
         
         *new = apr_pcalloc(cont, sizeof(apr_mmap_t));
         (*new)->pstart = (offset / memblock) * memblock;
    -    (*new)->psize = (offset % memblock) + size;
    +    (*new)->psize = (apr_size_t)(offset % memblock) + size;
         (*new)->poffset = offset - (*new)->pstart;
    +    offlo = (DWORD)(*new)->psize;
    +    offhi = (DWORD)((*new)->psize << 32);
     
         (*new)->mhandle = CreateFileMapping(file->filehand, NULL, fmaccess,
    -                                        0, (*new)->psize, NULL);
    +                                        offhi, offlo, NULL);
         if (!(*new)->mhandle || (*new)->mhandle == INVALID_HANDLE_VALUE)
         {
             *new = NULL;
             return apr_get_os_error();
         }
     
    -    (*new)->mv = MapViewOfFile((*new)->mhandle, mvaccess, 0,
    -                               (*new)->poffset, (*new)->psize);
    +    offlo = (DWORD)(*new)->poffset;
    +    offhi = (DWORD)((*new)->poffset << 32);
    +    (*new)->mv = MapViewOfFile((*new)->mhandle, mvaccess, offhi,
    +                               offlo, (*new)->psize);
         if (!(*new)->mv)
         {
             apr_status_t rv = apr_get_os_error();
    diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c
    index 865dbca6bcb..da3ee6c7556 100644
    --- a/network_io/win32/sendrecv.c
    +++ b/network_io/win32/sendrecv.c
    @@ -258,12 +258,16 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file,
     
         /* Initialize the overlapped structure */
         memset(&overlapped,'\0', sizeof(overlapped));
    -    if (offset && *offset) {
    -        overlapped.Offset = *offset;
    -    }
    +    if (file->pOverlapped)
    +        overlapped.hEvent = file->pOverlapped->hEvent;
     #ifdef WAIT_FOR_EVENT
    -    overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
    +    else
    +        overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
     #endif
    +    if (offset && *offset) {
    +        file->pOverlapped->Offset     = (DWORD)*offset;
    +        file->pOverlapped->OffsetHigh = (DWORD)(*offset >> 32);
    +    }
     
         /* Handle the goofy case of sending headers/trailers and a zero byte file */
         if (!bytes_to_send && hdtr) {
    @@ -320,15 +324,14 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file,
             if (!rv) {
                 status = apr_get_netos_error();
                 if (status == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) {
    -#ifdef WAIT_FOR_EVENT
    -                rv = WaitForSingleObject(overlapped.hEvent, 
    -                                         (DWORD)(sock->timeout >= 0 
    -                                            ? sock->timeout : INFINITE));
    -#else
    -                rv = WaitForSingleObject((HANDLE) sock->sock, 
    -                                         (DWORD)(sock->timeout >= 0 
    -                                            ? sock->timeout : INFINITE));
    -#endif
    +                if (overlapped.hEvent)
    +                    rv = WaitForSingleObject(overlapped.hEvent, 
    +                                             (DWORD)(sock->timeout >= 0 
    +                                                ? sock->timeout : INFINITE));
    +                else
    +                    rv = WaitForSingleObject((HANDLE) sock->sock, 
    +                                             (DWORD)(sock->timeout >= 0 
    +                                                ? sock->timeout : INFINITE));
                     if (rv == WAIT_OBJECT_0)
                         status = APR_SUCCESS;
                     else if (rv == WAIT_TIMEOUT)
    @@ -376,7 +379,8 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file,
         }
     
     #ifdef WAIT_FOR_EVENT
    -    CloseHandle(overlapped.hEvent);
    +    if (!file->pOverlapped || !file->pOverlapped->hEvent)
    +        CloseHandle(overlapped.hEvent);
     #endif
         return status;
     }
    
    From 9ff13fbf1520b348fe064d7230a63b384a0a9942 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 6 Jun 2001 17:02:26 +0000
    Subject: [PATCH 1721/7878]   Catch up on win32
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61713 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/MakeWin32Make.pl | 14 +++++++++-----
     1 file changed, 9 insertions(+), 5 deletions(-)
    
    diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl
    index a3e873c8fb7..59f2105108f 100644
    --- a/test/MakeWin32Make.pl
    +++ b/test/MakeWin32Make.pl
    @@ -9,14 +9,18 @@
             $t = "ALL: \$(TARGETS)\n\n"
                . "CL = cl.exe\n"
                . "LINK = link.exe /nologo /debug /machine:I386\n\n"
    -           . "#.c.obj::\n"
    -           . "#\t\$(CL) -c \$*.c \$(CFLAGS)\n";
    +           . "CFLAGS = /nologo /c /MDd /W3 /Gm /GX /Zi /Od /D _DEBUG /D WIN32 /D APR_DECLARE_STATIC /FD \n\n"
    +           . ".c.obj::\n"
    +           . "\t\$(CL) -c \$*.c \$(CFLAGS) \$(INCLUDES)\n";
         }
         if ($t =~ m|^ALL_LIBS=|) {
    -        $t = "ALL_LIBS=../LibD/apr.lib kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib";
    +        $t = "";
         }
    -    if ($t =~ s|\@CFLAGS\@|\/nologo \/c \/MDd \/W3 \/Gm \/GX \/Zi \/Od \/D "_DEBUG" \/D "WIN32" \/D APR_DECLARE_STATIC \/FD|) {
    -        $t =~ s|-g ||;
    +    if ($t =~ m|^LOCAL_LIBS=|) {
    +        $t = "ALL_LIBS=../LibD/apr.lib kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib\n";
    +    }
    +    if ($t =~ s|\@CFLAGS\@||) {
    +        $t = "";
         }
         $t =~ s|\$\{LD_FLAGS\}||;
         $t =~ s|\.\./libapr\.la|../LibD/apr.lib|;
    
    From 40a65df4d1e7466cf942cd8939f702cf92a7b181 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 6 Jun 2001 17:07:21 +0000
    Subject: [PATCH 1722/7878]   Default to success.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61714 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/seek.c | 8 +++++++-
     1 file changed, 7 insertions(+), 1 deletion(-)
    
    diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c
    index d6355ac332e..1af5ce62f60 100644
    --- a/file_io/win32/seek.c
    +++ b/file_io/win32/seek.c
    @@ -93,7 +93,7 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos )
     APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset)
     {
         apr_finfo_t finfo;
    -    apr_status_t rc = APR_EINVAL;
    +    apr_status_t rc = APR_SUCCESS;
     
         if (thefile->buffered) {
             switch (where) {
    @@ -111,6 +111,9 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh
                     if (rc == APR_SUCCESS)
                         rc = setptr(thefile, finfo.size - *offset);
                     break;
    +
    +            default:
    +                return APR_EINVAL;
             }
     
             *offset = thefile->filePtr + thefile->bufpos;
    @@ -131,6 +134,9 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh
                     if (rc == APR_SUCCESS && finfo.size - *offset < 0)
                         thefile->filePtr = finfo.size - *offset;
                     break;
    +
    +            default:
    +                return APR_EINVAL;
             }
             *offset = thefile->filePtr;
             return rc;
    
    From f9be4d249a089d524d160e31b6d02c608c29c247 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 6 Jun 2001 17:19:03 +0000
    Subject: [PATCH 1723/7878]   Solve the linkage issue with a native-C (nonstd
     convention) declaration   of apr_terminate (for atexit(apr_terminate), etc),
     and provide an   alternate apr_terminate2 only for non-C languages ('pascal'
     convention.)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61715 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_general.h | 18 ++++++++++++++++--
     misc/unix/start.c     |  7 ++++++-
     2 files changed, 22 insertions(+), 3 deletions(-)
    
    diff --git a/include/apr_general.h b/include/apr_general.h
    index 81debdf0414..150aa513d96 100644
    --- a/include/apr_general.h
    +++ b/include/apr_general.h
    @@ -173,10 +173,24 @@ APR_DECLARE(apr_status_t) apr_initialize(void);
      * automatically.
      * @tip An APR program must call this function at termination once it 
      *      has stopped using APR services.  The APR developers suggest using
    - *      atexit to ensure this is called.
    + *      atexit to ensure this is called.  When using APR from a language
    + *      other than C that has problems with the calling convention, use
    + *      apr_terminate2() instead.
      * @deffunc void apr_terminate(void)
      */
    -APR_DECLARE(void) apr_terminate(void);
    +APR_DECLARE_NONSTD(void) apr_terminate(void);
    +
    +/**
    + * Tear down any APR internal data structures which aren't torn down 
    + * automatically, same as apr_terminate
    + * @tip An APR program must call either the apr_terminate or apr_terminate2 
    + *      function once it it has finished using APR services.  The APR 
    + *      developers suggest using atexit(apr_terminate) to ensure this is done.
    + *      apr_terminate2 exists to allow non-c language apps to tear down apr, 
    + *      while apr_terminate is recommended from c language applications.
    + * @deffunc void apr_terminate2(void)
    + */
    +APR_DECLARE(void) apr_terminate2(void);
     
     #ifdef __cplusplus
     }
    diff --git a/misc/unix/start.c b/misc/unix/start.c
    index 096591d3cc4..c7e0a7f762e 100644
    --- a/misc/unix/start.c
    +++ b/misc/unix/start.c
    @@ -104,7 +104,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void)
         return APR_SUCCESS;
     }
     
    -APR_DECLARE(void) apr_terminate(void)
    +APR_DECLARE_NONSTD(void) apr_terminate(void)
     {
         initialized--;
         if (initialized) {
    @@ -112,3 +112,8 @@ APR_DECLARE(void) apr_terminate(void)
         }
         apr_pool_alloc_term(global_apr_pool);
     }
    +
    +APR_DECLARE(void) apr_terminate2(void)
    +{
    +    apr_terminate();
    +}
    
    From 6d7c91eefec4c34d5b88694a180ea3de1cd88ed9 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 6 Jun 2001 18:12:14 +0000
    Subject: [PATCH 1724/7878] This is a much larger commit than I meant to have,
     but a lot has been changed in my tree today :)
    
    - remove the sms code I committed yesterday
    - add an apr_pool_t to the sms structure
    - add locking code to the tracking sms
    
    This threw up an issue with locking, so next
    
    - change the locking code to add an owner and ref counting
      so we can lock multiple times from the same thread.  this was
      needed by the apr_sms_tracking_reset code where we lock
      and then call free which locks again...
    
    I haven't added the locking changes for os2 or win32 after
    the problems I created with my last commit :)
    
    Changes to testlock on the way.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61716 13f79535-47bb-0310-9956-ffa450edef68
    ---
     acconfig.h                     | 42 -----------------------------
     include/apr.h.in               |  3 ---
     include/apr_lock.h             |  3 ++-
     include/apr_portable.h         |  2 ++
     include/apr_sms.h              | 45 +++++++++++++++++--------------
     include/apr_thread_proc.h      |  1 +
     include/arch/beos/locks.h      |  8 ++----
     include/arch/os2/locks.h       |  6 -----
     include/arch/unix/locks.h      | 11 ++++----
     include/arch/win32/locks.h     |  6 -----
     locks/beos/crossproc.c         |  6 ++---
     locks/beos/locks.c             | 49 +++++++++++-----------------------
     locks/unix/crossproc.c         | 24 ++++++++++-------
     locks/unix/locks.c             | 47 +++++++++++++++++---------------
     locks/win32/locks.c            | 39 ---------------------------
     memory/unix/apr_sms_std.c      |  3 +++
     memory/unix/apr_sms_tracking.c | 46 ++++++++++++++++++++++++++++---
     threadproc/beos/thread.c       |  6 +++++
     threadproc/unix/thread.c       |  5 ++++
     19 files changed, 154 insertions(+), 198 deletions(-)
    
    diff --git a/acconfig.h b/acconfig.h
    index 8cc5284a45a..b238713b5a7 100644
    --- a/acconfig.h
    +++ b/acconfig.h
    @@ -67,46 +67,4 @@
     #define apr_sigwait(a,b) sigwait((a),(b))
     #endif
     
    -/* Macros to deal with using either a pool or an sms
    - * to do memory stuff...
    - */
    -#define APR_CLEANUP_REGISTER(struct, data, func, scope) \
    -    if (struct->pool) { \
    -        apr_pool_cleanup_register(struct->pool, data, func, scope); \
    -    } else { \
    -        apr_sms_cleanup_register(struct->mem_sys, APR_CHILD_CLEANUP, \
    -                                 data, func); \
    -    }
    -
    -#define APR_CLEANUP_REMOVE(struct, data, func) \
    -    if (struct->pool) { \
    -        apr_pool_cleanup_kill(struct->pool, data, func); \
    -    } else { \
    -        apr_sms_cleanup_unregister(struct->mem_sys, APR_CHILD_CLEANUP, \
    -                                   data, func); \
    -    }
    -
    -#define APR_MEM_PSTRDUP(struct, ptr, str) \
    -    if (struct->pool) { \
    -        ptr = apr_pstrdup(struct->pool, str); \
    -    } else { \
    -        size_t len = strlen(str) + 1; \
    -        ptr = (char*) apr_sms_calloc(struct->mem_sys, len); \
    -        memcpy(ptr, str, len); \
    -    }
    -
    -#define APR_MEM_MALLOC(ptr, struct, type) \
    -    if (struct->pool) { \
    -        ptr = (type *)apr_palloc(struct->pool, sizeof(type)); \
    -    } else { \
    -        ptr = (type *)apr_sms_malloc(struct->mem_sys, sizeof(type)); \
    -    }
    -
    -#define APR_MEM_CALLOC(ptr, struct, type) \
    -    if (struct->pool) { \
    -        ptr = (type *)apr_pcalloc(struct->pool, sizeof(type)); \
    -    } else { \
    -        ptr = (type *)apr_sms_calloc(struct->mem_sys, sizeof(type)); \
    -    }
    -
     #endif /* APR_PRIVATE_H */
    diff --git a/include/apr.h.in b/include/apr.h.in
    index c72981e4318..0ce684ad1f4 100644
    --- a/include/apr.h.in
    +++ b/include/apr.h.in
    @@ -174,9 +174,6 @@ typedef  @ssize_t_value@         apr_ssize_t;
     typedef  @off_t_value@           apr_off_t;
     typedef  @socklen_t_value@       apr_socklen_t;
     
    -typedef struct apr_lock_t        apr_lock_t;
    -typedef struct apr_sms_t         apr_sms_t;
    -
     /* Mechanisms to properly type numeric literals */
     @int64_literal@
     
    diff --git a/include/apr_lock.h b/include/apr_lock.h
    index 0f495cec256..b3f0dff8760 100644
    --- a/include/apr_lock.h
    +++ b/include/apr_lock.h
    @@ -58,7 +58,6 @@
     #include "apr.h"
     #include "apr_pools.h"
     #include "apr_errno.h"
    -#include "apr_sms.h"
     
     #ifdef __cplusplus
     extern "C" {
    @@ -74,6 +73,8 @@ typedef enum {APR_MUTEX, APR_READWRITE} apr_locktype_e;
     
     typedef enum {APR_READER, APR_WRITER} apr_readerwriter_e;
     
    +typedef struct apr_lock_t    apr_lock_t;
    +
     /*   Function definitions */
     
     /**
    diff --git a/include/apr_portable.h b/include/apr_portable.h
    index 26c4bec7da8..b0b2b84a20a 100644
    --- a/include/apr_portable.h
    +++ b/include/apr_portable.h
    @@ -418,6 +418,8 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **dso,
     APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso,
                                                     apr_dso_handle_t *aprdso);
     
    +APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void);
    +
     #endif /* APR_HAS_DSO */
     
     #ifdef __cplusplus
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index 7f93ed98dc5..64e9abc5685 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -65,6 +65,8 @@
     
     #include "apr.h"
     #include "apr_errno.h"
    +#include "apr_pools.h"
    +#include "apr_lock.h"
     
     #ifdef __cplusplus
     extern "C" {
    @@ -80,32 +82,35 @@ extern "C" {
      */
     
     struct apr_sms_cleanup;
    +typedef struct apr_sms_t    apr_sms_t;
     
     /**
      * The memory system structure
      */
     struct apr_sms_t
     {
    -  apr_sms_t  *parent_mem_sys;
    -  apr_sms_t  *child_mem_sys;
    -  apr_sms_t  *sibling_mem_sys;
    -  apr_sms_t **ref_mem_sys;
    -  apr_sms_t  *accounting_mem_sys;
    -  const char *identity; /* a string identifying the module */
    -  apr_lock_t *lock;
    -
    -  struct apr_sms_cleanup *cleanups;
    -
    -  void * (*malloc_fn)       (apr_sms_t *mem_sys, apr_size_t size);
    -  void * (*calloc_fn)       (apr_sms_t *mem_sys, apr_size_t size);
    -  void * (*realloc_fn)      (apr_sms_t *mem_sys, void *memory, 
    -                             apr_size_t size);
    -  apr_status_t (*free_fn)   (apr_sms_t *mem_sys, void *memory);
    -  apr_status_t (*reset_fn)  (apr_sms_t *mem_sys);
    -  void (*pre_destroy_fn)    (apr_sms_t *mem_sys);
    -  apr_status_t (*destroy_fn)(apr_sms_t *mem_sys);
    -  apr_status_t (*lock_fn)   (apr_sms_t *mem_sys);
    -  apr_status_t (*unlock_fn) (apr_sms_t *mem_sys);
    +    apr_sms_t  *parent_mem_sys;
    +    apr_sms_t  *child_mem_sys;
    +    apr_sms_t  *sibling_mem_sys;
    +    apr_sms_t **ref_mem_sys;
    +    apr_sms_t  *accounting_mem_sys;
    +    const char *identity; /* a string identifying the module */
    +
    +    apr_pool_t *pool;
    +    apr_lock_t *lock;
    +
    +    struct apr_sms_cleanup *cleanups;
    +
    +    void * (*malloc_fn)       (apr_sms_t *mem_sys, apr_size_t size);
    +    void * (*calloc_fn)       (apr_sms_t *mem_sys, apr_size_t size);
    +    void * (*realloc_fn)      (apr_sms_t *mem_sys, void *memory, 
    +                               apr_size_t size);
    +    apr_status_t (*free_fn)   (apr_sms_t *mem_sys, void *memory);
    +    apr_status_t (*reset_fn)  (apr_sms_t *mem_sys);
    +    void (*pre_destroy_fn)    (apr_sms_t *mem_sys);
    +    apr_status_t (*destroy_fn)(apr_sms_t *mem_sys);
    +    apr_status_t (*lock_fn)   (apr_sms_t *mem_sys);
    +    apr_status_t (*unlock_fn) (apr_sms_t *mem_sys);
     };
     
     /*
    diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h
    index cb3f5ef4c9d..8fa692c9865 100644
    --- a/include/apr_thread_proc.h
    +++ b/include/apr_thread_proc.h
    @@ -65,6 +65,7 @@
     #include 
     #endif
     
    +
     #ifdef __cplusplus
     extern "C" {
     #endif /* __cplusplus */
    diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h
    index 39f48e31954..1b30116884e 100644
    --- a/include/arch/beos/locks.h
    +++ b/include/arch/beos/locks.h
    @@ -60,13 +60,13 @@
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_lib.h"
    -#include "apr_sms.h"
     
     struct apr_lock_t {
         apr_pool_t *pool;
    -    apr_sms_t *mem_sys;
         apr_locktype_e type;
         apr_lockscope_e scope;
    +    apr_os_thread_t *owner;
    +    int owner_ref;
         /* Inter proc */
         sem_id sem_interproc;
         int32  ben_interproc;
    @@ -88,9 +88,5 @@ apr_status_t destroy_inter_lock(struct apr_lock_t *lock);
     apr_status_t child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, 
                                 const char *fname);
     
    -apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
    -                                 apr_lockscope_e scope, const char *fname,
    -                                 apr_sms_t *mem_sys);
    -
     #endif  /* LOCKS_H */
     
    diff --git a/include/arch/os2/locks.h b/include/arch/os2/locks.h
    index 09e700d001d..716dfa2a569 100644
    --- a/include/arch/os2/locks.h
    +++ b/include/arch/os2/locks.h
    @@ -57,11 +57,9 @@
     
     #include "apr_lock.h"
     #include "apr_file_io.h"
    -#include "apr_sms.h"
     
     struct apr_lock_t {
         apr_pool_t *pool;
    -    apr_sms_t *mem_sys;
         apr_locktype_e type;
         apr_lockscope_e scope;
         char *fname;
    @@ -71,9 +69,5 @@ struct apr_lock_t {
         TIB *tib;
     };
     
    -apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
    -                                 apr_lockscope_e scope, const char *fname,
    -                                 apr_sms_t *mem_sys);
    -
     #endif  /* LOCKS_H */
     
    diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h
    index 2a062190ce9..65fa98456e3 100644
    --- a/include/arch/unix/locks.h
    +++ b/include/arch/unix/locks.h
    @@ -61,6 +61,7 @@
     #include "apr_lib.h"
     #include "apr_lock.h"
     #include "apr_sms.h"
    +#include "apr_portable.h"
     
     /* System headers required by Locks library */
     #if APR_HAVE_SYS_TYPES_H
    @@ -110,11 +111,11 @@ union semun {
     
     struct apr_lock_t {
         apr_pool_t *pool;
    -    apr_sms_t *mem_sys;
         apr_locktype_e type;
         apr_lockscope_e scope;
         int curr_locked;
         char *fname;
    +
     #if APR_USE_SYSVSEM_SERIALIZE
         int interproc;
     #elif APR_USE_FCNTL_SERIALIZE
    @@ -129,6 +130,10 @@ struct apr_lock_t {
     #if APR_HAS_THREADS
         /* APR doesn't have threads, no sense in having an thread lock mechanism.
          */
    +
    +    apr_os_thread_t owner;
    +    int owner_ref;
    +
     #if APR_USE_PTHREAD_SERIALIZE
         pthread_mutex_t *intraproc;
     #endif
    @@ -157,9 +162,5 @@ apr_status_t apr_unix_destroy_inter_lock(struct apr_lock_t *lock);
     apr_status_t apr_unix_child_init_lock(struct apr_lock_t **lock, 
                                           apr_pool_t *cont, const char *fname);
     
    -apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
    -                                 apr_lockscope_e scope, const char *fname,
    -                                 apr_sms_t *mem_sys);
    -
     #endif  /* LOCKS_H */
     
    diff --git a/include/arch/win32/locks.h b/include/arch/win32/locks.h
    index b3da21a043a..4d0562b8c81 100644
    --- a/include/arch/win32/locks.h
    +++ b/include/arch/win32/locks.h
    @@ -56,11 +56,9 @@
     #define LOCKS_H
     
     #include "apr_lock.h"
    -#include "apr_sms.h"
     
     struct apr_lock_t {
         apr_pool_t *pool;
    -    apr_sms_t *mem_sys;
         apr_locktype_e type;
         apr_lockscope_e scope;
         HANDLE mutex;
    @@ -68,9 +66,5 @@ struct apr_lock_t {
         char *fname;
     };
     
    -APR_DECLARE(apr_status_t) apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
    -                                 apr_lockscope_e scope, const char *fname,
    -                                 apr_sms_t *mem_sys);
    -
     #endif  /* LOCKS_H */
     
    diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c
    index 5e7f55425d0..317a76e358e 100644
    --- a/locks/beos/crossproc.c
    +++ b/locks/beos/crossproc.c
    @@ -82,8 +82,8 @@ apr_status_t create_inter_lock(apr_lock_t *new)
         }
         new->ben_interproc = 0;
         new->sem_interproc = stat;
    -    APR_CLEANUP_REGISTER(new, (void *)new, lock_inter_cleanup,
    -                        apr_pool_cleanup_null);
    +    apr_pool_cleanup_register(new->pool, (void *)new, lock_inter_cleanup,
    +                              apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    @@ -117,7 +117,7 @@ apr_status_t destroy_inter_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_inter_cleanup(lock)) == APR_SUCCESS) {
    -        APR_CLEANUP_REMOVE(lock, lock, lock_inter_cleanup);
    +        apr_pool_cleanup_kill(lock->pool, lock, lock_inter_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    diff --git a/locks/beos/locks.c b/locks/beos/locks.c
    index 574baefd86b..ae854fc40fc 100644
    --- a/locks/beos/locks.c
    +++ b/locks/beos/locks.c
    @@ -90,43 +90,14 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type, 
    -                                 apr_lockscope_e scope, const char *fname, 
    -                                 apr_sms_t *mem_sys)
    +apr_status_t apr_lock_acquire(apr_lock_t *lock)
     {
    -    apr_lock_t *new;
         apr_status_t stat;
    -  
    -    /* FIXME: Remove when read write locks implemented. */ 
    -    if (type == APR_READWRITE)
    -        return APR_ENOTIMPL; 
     
    -    new = (apr_lock_t *)apr_sms_calloc(mem_sys, sizeof(apr_lock_t));
    -    if (new == NULL){
    -        return APR_ENOMEM;
    +    if (lock->owner == apr_os_thread_current()) {
    +        lock->owner_ref++;
    +        return APR_SUCCESS;
         }
    -    
    -    new->mem_sys = mem_sys;
    -    new->type    = type;
    -    new->scope   = scope;
    -
    -    if (scope != APR_CROSS_PROCESS) {
    -        if ((stat = create_intra_lock(new)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -    }
    -    if (scope != APR_INTRAPROCESS) {
    -        if ((stat = create_inter_lock(new)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -    }
    -    (*lock) = new;
    -    return APR_SUCCESS;
    -}
    -
    -apr_status_t apr_lock_acquire(apr_lock_t *lock)
    -{
    -    apr_status_t stat;
     
         switch (lock->type)
         {
    @@ -146,6 +117,9 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock)
             return APR_ENOTIMPL;
         }
     
    +    lock->owner = apr_os_thread_current();
    +    lock->owner_ref = 1;
    +
         return APR_SUCCESS;
     }
     
    @@ -173,6 +147,12 @@ apr_status_t apr_lock_release(apr_lock_t *lock)
     {
         apr_status_t stat;
     
    +    if (lock->owner == apr_os_thread_current()) {
    +        lock->owner_ref--;
    +        if (lock->owner_ref > 0)
    +            return APR_SUCCESS;
    +    }
    +
         switch (lock->type)
         {
         case APR_MUTEX:
    @@ -191,6 +171,9 @@ apr_status_t apr_lock_release(apr_lock_t *lock)
             return APR_ENOTIMPL;
         }
     
    +    lock->owner = -1;
    +    lock->owner_ref = 0;
    +
         return APR_SUCCESS;
     }
     
    diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c
    index fbe33388a4b..bc32bc06d2d 100644
    --- a/locks/unix/crossproc.c
    +++ b/locks/unix/crossproc.c
    @@ -100,7 +100,8 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
             return errno;
         }
         new->curr_locked = 0;
    -    APR_CLEANUP_REGISTER(new, (void *)new, lock_cleanup, apr_pool_cleanup_null);
    +    apr_pool_cleanup_register(new->pool, (void *)new, lock_cleanup, 
    +                              apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    @@ -137,7 +138,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
         apr_status_t stat;
     
         if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        APR_CLEANUP_REMOVE(lock, lock, lock_cleanup);
    +        apr_pool_cleanup_kill(lock->pool, lock, lock_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    @@ -223,7 +224,8 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
         }
     
         new->curr_locked = 0;
    -    APR_CLEANUP_REGISTER(new, (void *)new, lock_cleanup, apr_pool_cleanup_null);
    +    apr_pool_register_cleanup(new->pool, (void *)new, lock_cleanup, 
    +                              apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    @@ -259,7 +261,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        APR_CLEANUP_REMOVE(lock, lock, lock_cleanup);
    +        apr_pool_cleanup_kill(lock->pool, lock, lock_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    @@ -305,7 +307,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
             new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644);
         }
         else {
    -        APR_MEM_PSTRDUP(new, new->fname, "/tmp/aprXXXXXX")
    +        new->fname = apr_pstrdup(new->pool, "/tmp/aprXXXXXX");
             new->interproc = apr_mkstemp(new->fname);
         }
     
    @@ -316,7 +318,8 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
     
         new->curr_locked=0;
         unlink(new->fname);
    -    APR_CLEANUP_REGISTER(new, new, lock_cleanup, apr_pool_cleanup_null);
    +    apr_pool_cleanup_register(new->pool, (void*)new, lock_cleanup, 
    +                              apr_pool_cleanup_null);
         return APR_SUCCESS; 
     }
     
    @@ -352,7 +355,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        APR_CLEANUP_REMOVE(lock, lock, lock_cleanup);
    +        apr_pool_cleanup_kill(lock->pool, lock, lock_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    @@ -388,7 +391,7 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
             new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600);
         }
         else {
    -        APR_MEM_PSTRDUP(new, new->fname, "/tmp/aprXXXXXX")
    +        new->fname = apr_pstrdup(new->pool, "/tmp/aprXXXXXX");
             new->interproc = apr_mkstemp(new->fname);
         }
     
    @@ -397,7 +400,8 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
             return errno;
         }
         new->curr_locked = 0;
    -    APR_CLEANUP_REGISTER(new, (void *)new, lock_cleanup, apr_pool_cleanup_null);
    +    apr_pool_cleanup_register(new->pool, (void *)new, lock_cleanup,
    +                              apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    @@ -433,7 +437,7 @@ apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        APR_CLEANUP_REMOVE(lock, lock, lock_cleanup);
    +        apr_pool_cleanup_kill(lock->new, lock, lock_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    diff --git a/locks/unix/locks.c b/locks/unix/locks.c
    index 30dbab9b38d..d86506c3333 100644
    --- a/locks/unix/locks.c
    +++ b/locks/unix/locks.c
    @@ -67,7 +67,7 @@ static apr_status_t create_lock(apr_lock_t *new, const char *fname)
         /* file-based serialization primitives */
         if (new->scope != APR_INTRAPROCESS) {
             if (fname != NULL) {
    -            APR_MEM_PSTRDUP(new, new->fname, fname);
    +            new->fname = apr_pstrdup(new->pool, fname);
             }
         }
     #endif
    @@ -126,30 +126,17 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_lock_sms_create(apr_lock_t **lock, apr_locktype_e type,
    -                                 apr_lockscope_e scope, const char *fname,
    -                                 apr_sms_t *mem_sys)
    -{
    -    apr_lock_t *new;
    -    apr_status_t stat;
    -    
    -    new = (apr_lock_t *)apr_sms_calloc(mem_sys, sizeof(apr_lock_t));
    -
    -    new->mem_sys = mem_sys;
    -    new->type    = type;
    -    new->scope   = scope;
    -
    -    if ((stat = create_lock(new, fname)) != APR_SUCCESS)
    -        return stat;
    -
    -    *lock = new;
    -    return APR_SUCCESS;
    -}
    -
     apr_status_t apr_lock_acquire(apr_lock_t *lock)
     {
         apr_status_t stat;
     
    +#if APR_HAS_THREADS
    +    if (lock->owner == apr_os_thread_current()){
    +        lock->owner_ref++;
    +        return APR_SUCCESS;
    +    }
    +#endif
    +
         switch (lock->type)
         {
         case APR_MUTEX:
    @@ -176,6 +163,11 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock)
             return APR_ENOTIMPL;
         }
     
    +#if APR_HAS_THREADS
    +    lock->owner = apr_os_thread_current();
    +    lock->owner_ref = 1;
    +#endif
    +
         return APR_SUCCESS;
     }
     
    @@ -211,6 +203,14 @@ apr_status_t apr_lock_release(apr_lock_t *lock)
     {
         apr_status_t stat;
     
    +#if APR_HAS_THREADS
    +    if (lock->owner == apr_os_thread_current()) {
    +        lock->owner_ref--;
    +        if (lock->owner_ref > 0)
    +            return APR_SUCCESS;
    +    }
    +#endif
    +
         switch (lock->type)
         {
         case APR_MUTEX:
    @@ -242,6 +242,11 @@ apr_status_t apr_lock_release(apr_lock_t *lock)
             return APR_ENOTIMPL;
     #endif
         }
    +
    +#if APR_HAS_THREADS
    +    lock->owner = NULL;
    +    lock->owner_ref = 0;
    +#endif
         
         return APR_SUCCESS;
     }
    diff --git a/locks/win32/locks.c b/locks/win32/locks.c
    index 043a630f347..22d932973e8 100644
    --- a/locks/win32/locks.c
    +++ b/locks/win32/locks.c
    @@ -100,45 +100,6 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock,
         return APR_SUCCESS;
     }
     
    -APR_DECLARE(apr_status_t) apr_lock_sms_create(apr_lock_t **lock,
    -                                              apr_locktype_e type,
    -                                              apr_lockscope_e scope,
    -                                              const char *fname,
    -                                              apr_sms_t *mem_sys)
    -{
    -    apr_lock_t *newlock;
    -    SECURITY_ATTRIBUTES sec;
    -
    -    if (type == APR_READWRITE)
    -        return APR_ENOTIMPL;
    -
    -    newlock = (apr_lock_t *)apr_sms_malloc(mem_sys, sizeof(apr_lock_t));
    -
    -    newlock->pool = NULL;
    -    newlock->mem_sys = mem_sys;
    -
    -    APR_MEM_PSTRDUP(newlock, newlock->fname, fname);
    -    newlock->type = type;
    -    newlock->scope = scope;
    -    sec.nLength = sizeof(SECURITY_ATTRIBUTES);
    -    sec.lpSecurityDescriptor = NULL;
    -
    -    if (scope == APR_CROSS_PROCESS || scope == APR_LOCKALL) {
    -        sec.bInheritHandle = TRUE;
    -    }
    -    else {
    -        sec.bInheritHandle = FALSE;
    -    }
    -
    -    if (scope == APR_INTRAPROCESS) {
    -        InitializeCriticalSection(&newlock->section);
    -    } else {
    -        newlock->mutex = CreateMutex(&sec, FALSE, fname);
    -    }
    -    *lock = newlock;
    -    return APR_SUCCESS;
    -}
    -
     APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, 
                                                   const char *fname, 
                                                   apr_pool_t *pool)
    diff --git a/memory/unix/apr_sms_std.c b/memory/unix/apr_sms_std.c
    index 0bcfb33b98e..7601d2bd1c1 100644
    --- a/memory/unix/apr_sms_std.c
    +++ b/memory/unix/apr_sms_std.c
    @@ -127,6 +127,9 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys)
         new_mem_sys->free_fn    = apr_sms_std_free;
         new_mem_sys->identity   = module_identity;
     
    +    /* If this fails, what should we do??? */
    +    apr_pool_create(&(new_mem_sys->pool), NULL);
    +     
         /* as we're not a tracking memory module, i.e. we don't keep
          * track of our allocations, we don't have apr_sms_reset or
          * apr_sms_destroy functions.
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    index 5fe4e25161c..d293682737c 100644
    --- a/memory/unix/apr_sms_tracking.c
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -86,11 +86,23 @@ typedef struct apr_sms_tracking_t
         apr_track_node_t    *nodes;
     } apr_sms_tracking_t;
     
    +static apr_status_t apr_sms_tracking_lock(apr_sms_t *mem_sys)
    +{
    +    return apr_lock_acquire(mem_sys->lock);
    +}
    +
    +static apr_status_t apr_sms_tracking_unlock(apr_sms_t *mem_sys)
    +{
    +    return apr_lock_release(mem_sys->lock);
    +}
    +
     static void *apr_sms_tracking_malloc(apr_sms_t *mem_sys,
                                          apr_size_t size)
     {
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
    +
    +    apr_sms_tracking_lock(mem_sys);
       
         tms = (apr_sms_tracking_t *)mem_sys;
         node = apr_sms_malloc(mem_sys->parent_mem_sys,
    @@ -106,6 +118,8 @@ static void *apr_sms_tracking_malloc(apr_sms_t *mem_sys,
     
         node++;
     
    +    apr_sms_tracking_unlock(mem_sys);
    +
         return (void *)node;
     }
     
    @@ -115,6 +129,8 @@ static void *apr_sms_tracking_calloc(apr_sms_t *mem_sys,
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
       
    +    apr_sms_tracking_lock(mem_sys);
    +
         tms = (apr_sms_tracking_t *)mem_sys;
         node = apr_sms_calloc(mem_sys->parent_mem_sys,
                               size + sizeof(apr_track_node_t));
    @@ -129,6 +145,8 @@ static void *apr_sms_tracking_calloc(apr_sms_t *mem_sys,
     
         node++;
     
    +    apr_sms_tracking_unlock(mem_sys);
    +
         return (void *)node;
     }
     
    @@ -138,6 +156,8 @@ static void *apr_sms_tracking_realloc(apr_sms_t *mem_sys,
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
     
    +    apr_sms_tracking_lock(mem_sys);
    +
         tms = (apr_sms_tracking_t *)mem_sys;
         node = (apr_track_node_t *)mem;
     
    @@ -159,6 +179,8 @@ static void *apr_sms_tracking_realloc(apr_sms_t *mem_sys,
     
         node++;
     
    +    apr_sms_tracking_unlock(mem_sys);
    +
         return (void *)node;
     }
     
    @@ -166,14 +188,18 @@ static apr_status_t apr_sms_tracking_free(apr_sms_t *mem_sys,
                                               void *mem)
     {
         apr_track_node_t *node;
    -    
    + 
    +    apr_sms_tracking_lock(mem_sys);
    +   
         node = (apr_track_node_t *)mem;
         node--;
     
         *(node->ref) = node->next;
         if (node->next)
             node->next->ref = node->ref;
    -          
    + 
    +    apr_sms_tracking_unlock(mem_sys);
    +         
         return apr_sms_free(mem_sys->parent_mem_sys, node);
     }
     
    @@ -182,6 +208,9 @@ static apr_status_t apr_sms_tracking_reset(apr_sms_t *mem_sys)
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
         apr_status_t rv;
    +
    +    if ((rv = apr_sms_tracking_lock(mem_sys)) != APR_SUCCESS)
    +        return rv;
      
         tms = (apr_sms_tracking_t *)mem_sys;
     
    @@ -191,10 +220,15 @@ static apr_status_t apr_sms_tracking_reset(apr_sms_t *mem_sys)
             if (node->next)
                 node->next->ref = node->ref;
             if ((rv = apr_sms_free(mem_sys->parent_mem_sys, 
    -                               node)) != APR_SUCCESS)
    +                               node)) != APR_SUCCESS) {
    +            apr_sms_tracking_unlock(mem_sys);
                 return rv;
    +        }
         }
         
    +    if ((rv = apr_sms_tracking_unlock(mem_sys)) != APR_SUCCESS)
    +        return rv;
    +
         return APR_SUCCESS;
     }
     
    @@ -233,9 +267,15 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys,
         new_mem_sys->realloc_fn = apr_sms_tracking_realloc;
         new_mem_sys->free_fn    = apr_sms_tracking_free;
         new_mem_sys->reset_fn   = apr_sms_tracking_reset;
    +    new_mem_sys->lock_fn    = apr_sms_tracking_lock;
    +    new_mem_sys->unlock_fn  = apr_sms_tracking_unlock;
         new_mem_sys->destroy_fn = apr_sms_tracking_destroy;
         new_mem_sys->identity   = module_identity;
     
    +    apr_pool_create(&(new_mem_sys->pool), pms->pool);
    +    apr_lock_create(&(new_mem_sys->lock), APR_MUTEX, APR_LOCKALL, NULL,
    +                    new_mem_sys->pool);
    +
         tms = (apr_sms_tracking_t *)new_mem_sys;
         tms->nodes = NULL;
     
    diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c
    index d0fac8e4e42..facd4119490 100644
    --- a/threadproc/beos/thread.c
    +++ b/threadproc/beos/thread.c
    @@ -53,6 +53,7 @@
      */
     
     #include "threadproc.h"
    +#include "apr_portable.h"
     
     apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont)
     {
    @@ -122,6 +123,11 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr,
         } 
     }
     
    +apr_os_thread_t apr_os_thread_current(void)
    +{
    +    return find_thread(NULL);
    +}
    +
     apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval)
     {
         apr_pool_destroy(thd->cntxt);
    diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c
    index a8bcc333418..8aa35e1bf84 100644
    --- a/threadproc/unix/thread.c
    +++ b/threadproc/unix/thread.c
    @@ -158,6 +158,11 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr,
         } 
     }
     
    +apr_os_thread_t apr_os_thread_current(void)
    +{
    +    return pthread_self();
    +}
    +
     apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval)
     {
         apr_pool_destroy(thd->cntxt);
    
    From 55073b2caf8a381a8e6c0697b5dfe10171667093 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 6 Jun 2001 18:21:57 +0000
    Subject: [PATCH 1725/7878] This adds a test to testlock for locking the same
     lock from the same thread a number of times.  Win32 and OS/2 don't have the
     changes yet.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61717 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testlock.c | 86 ++++++++++++++++++++++++++++++++++++++-----------
     1 file changed, 68 insertions(+), 18 deletions(-)
    
    diff --git a/test/testlock.c b/test/testlock.c
    index 6da1872d22f..c3d39188d22 100644
    --- a/test/testlock.c
    +++ b/test/testlock.c
    @@ -60,9 +60,6 @@
     #include "errno.h"
     #include 
     #include 
    -#ifdef BEOS
    -#include 
    -#endif
     
     #if !APR_HAS_THREADS
     int main(void)
    @@ -81,7 +78,7 @@ void * APR_THREAD_FUNC thread_func(void *data);
     
     apr_file_t *in, *out, *err;
     apr_lock_t *thread_rw_lock, *thread_lock;
    -apr_pool_t *context;
    +apr_pool_t *pool;
     int i = 0, x = 0;
     
     void * APR_THREAD_FUNC thread_rw_func(void *data)
    @@ -116,6 +113,8 @@ void * APR_THREAD_FUNC thread_func(void *data)
         while (1)
         {
             apr_lock_acquire(thread_lock);
    +        if (apr_lock_acquire(thread_lock) != APR_SUCCESS)
    +            printf("Failed!\n");
             if (i == MAX_ITER)
                 exitLoop = 0;
             else 
    @@ -124,6 +123,7 @@ void * APR_THREAD_FUNC thread_func(void *data)
                 x++;
             }
             apr_lock_release(thread_lock);
    +        apr_lock_release(thread_lock);
     
             if (!exitLoop)
                 break;
    @@ -138,7 +138,7 @@ int test_rw(void)
     
         apr_file_printf(out, "Initializing the rw lock.");
         s1 = apr_lock_create(&thread_rw_lock, APR_READWRITE, APR_INTRAPROCESS, 
    -                         "lock.file", context); 
    +                         "lock.file", pool); 
         if (s1 != APR_SUCCESS) {
             apr_file_printf(err, "Could not create lock\n");
             return s1;
    @@ -149,10 +149,10 @@ int test_rw(void)
         x = 0;
     
         apr_file_printf(out, "Starting all the threads......."); 
    -    s1 = apr_thread_create(&t1, NULL, thread_rw_func, NULL, context);
    -    s2 = apr_thread_create(&t2, NULL, thread_rw_func, NULL, context);
    -    s3 = apr_thread_create(&t3, NULL, thread_rw_func, NULL, context);
    -    s4 = apr_thread_create(&t4, NULL, thread_rw_func, NULL, context);
    +    s1 = apr_thread_create(&t1, NULL, thread_rw_func, NULL, pool);
    +    s2 = apr_thread_create(&t2, NULL, thread_rw_func, NULL, pool);
    +    s3 = apr_thread_create(&t3, NULL, thread_rw_func, NULL, pool);
    +    s4 = apr_thread_create(&t4, NULL, thread_rw_func, NULL, pool);
         if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || 
             s3 != APR_SUCCESS || s4 != APR_SUCCESS) {
             apr_file_printf(err, "Error starting threads\n");
    @@ -174,6 +174,7 @@ int test_rw(void)
         else {
             apr_file_printf(out, "Everything is working!\n");
         }
    +    
         return APR_SUCCESS;
     }
     
    @@ -184,7 +185,7 @@ int test_exclusive(void)
     
         apr_file_printf(out, "Initializing the lock.");
         s1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, 
    -                         "lock.file", context); 
    +                         "lock.file", pool); 
     
         if (s1 != APR_SUCCESS) {
             apr_file_printf(err, "Could not create lock\n");
    @@ -196,10 +197,10 @@ int test_exclusive(void)
         x = 0;
     
         apr_file_printf(out, "Starting all the threads......."); 
    -    s1 = apr_thread_create(&t1, NULL, thread_func, NULL, context);
    -    s2 = apr_thread_create(&t2, NULL, thread_func, NULL, context);
    -    s3 = apr_thread_create(&t3, NULL, thread_func, NULL, context);
    -    s4 = apr_thread_create(&t4, NULL, thread_func, NULL, context);
    +    s1 = apr_thread_create(&t1, NULL, thread_func, NULL, pool);
    +    s2 = apr_thread_create(&t2, NULL, thread_func, NULL, pool);
    +    s3 = apr_thread_create(&t3, NULL, thread_func, NULL, pool);
    +    s4 = apr_thread_create(&t4, NULL, thread_func, NULL, pool);
         if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || 
             s3 != APR_SUCCESS || s4 != APR_SUCCESS) {
             apr_file_printf(err, "Error starting threads\n");
    @@ -224,17 +225,63 @@ int test_exclusive(void)
         return APR_SUCCESS;
     }
     
    +apr_status_t test_multiple_locking(void)
    +{
    +    apr_lock_t *multi;
    +    int try = 0;
    +    apr_status_t rv;
    + 
    +    printf("Testing multiple locking\n");
    +    printf("%-60s","    Creating the lock we'll use");
    +    if ((rv = apr_lock_create(&multi, APR_MUTEX, APR_LOCKALL,"multi.lock",
    +                        pool)) != APR_SUCCESS) {
    +        printf("Failed!\n");
    +        return rv;
    +    }
    +    printf("OK\n");
    +
    +    printf("%-60s", "    Trying to lock 10 times");
    +    for (try = 0; try < 10; try++) {
    +        if ((rv = apr_lock_acquire(multi)) != APR_SUCCESS) {
    +            printf("Failed!\n");
    +            printf("Error at try %d\n", try);
    +            return rv;
    +        }
    +    }
    +    printf("OK\n");
    +
    +    printf("%-60s", "    Trying to unlock 10 times");
    +    for (try = 0; try < 10; try++) {
    +        if ((rv = apr_lock_release(multi)) != APR_SUCCESS) {
    +            printf("Failed!\n");
    +            printf("Error at try %d\n", try);
    +            return rv;
    +        }
    +    }
    +    printf("OK\n");
    +
    +    printf("%-60s", "    Destroying the lock we've been using");
    +    if ((rv = apr_lock_destroy(multi)) != APR_SUCCESS) {
    +        printf("Failed!\n");
    +        return rv;
    +    }
    +    printf("OK\n");
    +
    +    printf("Multiple locking test completed\n");
    +    return APR_SUCCESS;
    +}
    +
     int main(void)
     {
         apr_initialize();
         atexit(apr_terminate);
     
    -    if (apr_pool_create(&context, NULL) != APR_SUCCESS)
    +    if (apr_pool_create(&pool, NULL) != APR_SUCCESS)
             exit(-1);
     
    -    apr_file_open_stdin(&in, context); 
    -    apr_file_open_stdout(&out, context); 
    -    apr_file_open_stderr(&err, context); 
    +    apr_file_open_stdin(&in, pool); 
    +    apr_file_open_stdout(&out, pool); 
    +    apr_file_open_stderr(&err, pool); 
     
         apr_file_printf(out, "OK\n");
     
    @@ -244,6 +291,9 @@ int main(void)
         if (test_exclusive() != APR_SUCCESS)
             exit(-3);
     
    +    if (test_multiple_locking() != APR_SUCCESS)
    +        exit(-4);
    +
         return 1;
     }
     
    
    From db0061720a6d8721ea808a36ed7416898f27c33e Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 6 Jun 2001 18:59:25 +0000
    Subject: [PATCH 1726/7878]   Something is still broken with the testtime, but
     this gets us building.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61718 13f79535-47bb-0310-9956-ffa450edef68
    ---
     time/win32/time.c | 13 +++++++++++++
     1 file changed, 13 insertions(+)
    
    diff --git a/time/win32/time.c b/time/win32/time.c
    index 58a55f13449..18356de10a4 100644
    --- a/time/win32/time.c
    +++ b/time/win32/time.c
    @@ -148,6 +148,19 @@ APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result,
         return APR_SUCCESS;
     }
     
    +APR_DECLARE(apr_status_t) apr_explode_time(apr_exploded_time_t *result, 
    +                                           apr_time_t input, apr_int32_t offs)
    +{
    +    FILETIME ft;
    +    SYSTEMTIME st;
    +    AprTimeToFileTime(&ft, input + (offs *  APR_USEC_PER_SEC));
    +    FileTimeToSystemTime(&ft, &st);
    +    SystemTimeToAprExpTime(result, &st, 0);
    +    result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC);
    +    result->tm_gmtoff = offs;
    +    return APR_SUCCESS;
    +}
    +
     APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result,
                                                     apr_time_t input)
     {
    
    From 4aa27aaf36952aaef2aa072225cff1f9586b1102 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 6 Jun 2001 19:19:43 +0000
    Subject: [PATCH 1727/7878]   This quiets the compiler, and prints the time
     delta discrepancy.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61719 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testtime.c | 5 +++--
     1 file changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/test/testtime.c b/test/testtime.c
    index 65812270e4b..ce60d9874bf 100644
    --- a/test/testtime.c
    +++ b/test/testtime.c
    @@ -72,7 +72,7 @@ int main(void)
         apr_pool_t *p;
         char *str, *str2;
         apr_size_t sz;
    -    apr_interval_time_t hr_off = -5 * 3600; /* 5 hours in seconds */
    +    apr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */
     
         fprintf(stdout, "Testing Time functions.\n");
     
    @@ -180,7 +180,8 @@ int main(void)
         hr_off *= APR_USEC_PER_SEC; /* microseconds */ 
         if (imp != now + hr_off){
             printf("Failed! :(\n");
    -        printf("Difference is %lld (should be %lld)\n", imp - now, hr_off);
    +        printf("Difference is %" APR_TIME_T_FMT " (should be %" 
    +               APR_TIME_T_FMT ")\n", imp - now, hr_off);
             exit(-1);
         }
         printf("OK\n");
    
    From b011393ca63bf760cddb028d926e93c70cfff8a1 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 6 Jun 2001 19:55:36 +0000
    Subject: [PATCH 1728/7878]   Make these build, boy has this become tangled to
     the point of near   worthlessness.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61720 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/MakeWin32Make.pl | 5 +++--
     1 file changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl
    index 59f2105108f..1b56b12c55e 100644
    --- a/test/MakeWin32Make.pl
    +++ b/test/MakeWin32Make.pl
    @@ -8,7 +8,7 @@
         if ($t =~ m|\@INCLUDE_RULES\@|) {
             $t = "ALL: \$(TARGETS)\n\n"
                . "CL = cl.exe\n"
    -           . "LINK = link.exe /nologo /debug /machine:I386\n\n"
    +           . "LINK = link.exe /nologo /debug /machine:I386 /subsystem:console /incremental:no \n\n"
                . "CFLAGS = /nologo /c /MDd /W3 /Gm /GX /Zi /Od /D _DEBUG /D WIN32 /D APR_DECLARE_STATIC /FD \n\n"
                . ".c.obj::\n"
                . "\t\$(CL) -c \$*.c \$(CFLAGS) \$(INCLUDES)\n";
    @@ -17,7 +17,8 @@
             $t = "";
         }
         if ($t =~ m|^LOCAL_LIBS=|) {
    -        $t = "ALL_LIBS=../LibD/apr.lib kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib\n";
    +        $t = "LOCAL_LIBS=\n"
    +           . "ALL_LIBS=../LibD/apr.lib kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib\n\n";
         }
         if ($t =~ s|\@CFLAGS\@||) {
             $t = "";
    
    From 68c2844d578d9acc478ddcb99d54f771303005c7 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 6 Jun 2001 19:56:56 +0000
    Subject: [PATCH 1729/7878]   The test suite builds, once again.  The sig arg
     to TerminateProcess in   win32's apr_proc_kill is pretty bogus, however.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61721 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testoc.c | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/test/testoc.c b/test/testoc.c
    index c5c084d20d9..701f7439e5c 100644
    --- a/test/testoc.c
    +++ b/test/testoc.c
    @@ -85,6 +85,10 @@ static void ocmaint(int reason, void *data, int status)
     }
     #endif
     
    +#ifndef SIGKILL
    +#define SIGKILL 1
    +#endif
    +
     int main(int argc, char *argv[])
     {
     #if APR_HAS_OTHER_CHILD
    
    From d20a9e60646d61dd9deb0a393df9170270bb2603 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 6 Jun 2001 20:04:43 +0000
    Subject: [PATCH 1730/7878]   Whoops, APR_BADARG is bogus [my doing.]  Still
     return APR_EINVAL since   we don't know where the id came from, and if it's
     safe to pass to the   kernel.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61722 13f79535-47bb-0310-9956-ffa450edef68
    ---
     user/win32/groupinfo.c |  8 ++++----
     user/win32/userinfo.c  | 10 +++++-----
     2 files changed, 9 insertions(+), 9 deletions(-)
    
    diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c
    index b66853e15a8..6b8b74cff84 100644
    --- a/user/win32/groupinfo.c
    +++ b/user/win32/groupinfo.c
    @@ -66,12 +66,12 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid,
         char name[MAX_PATH], domain[MAX_PATH];
         DWORD cbname = sizeof(name), cbdomain = sizeof(domain);
         if (!groupid)
    -        return APR_BADARG;
    +        return APR_EINVAL;
         if (!LookupAccountSid(NULL, groupid, name, &cbname, domain, &cbdomain, &type))
             return apr_get_os_error();
         if (type != SidTypeGroup && type != SidTypeWellKnownGroup 
                                  && type != SidTypeAlias)
    -        return APR_BADARG;
    +        return APR_EINVAL;
         *groupname = apr_pstrdup(p, name);
         return APR_SUCCESS;
     }
    @@ -79,9 +79,9 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid,
     APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right)
     {
         if (!left || !right)
    -        return APR_BADARG;
    +        return APR_EINVAL;
         if (!IsValidSid(left) || !IsValidSid(right))
    -        return APR_BADARG;
    +        return APR_EINVAL;
         if (!EqualSid(left, right))
             return APR_EMISMATCH;
         return APR_SUCCESS;
    diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c
    index f07154e064d..3c160728ef5 100644
    --- a/user/win32/userinfo.c
    +++ b/user/win32/userinfo.c
    @@ -109,11 +109,11 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap
         char name[MAX_PATH], domain[MAX_PATH];
         DWORD cbname = sizeof(name), cbdomain = sizeof(domain);
         if (!userid)
    -        return APR_BADARG;
    +        return APR_EINVAL;
         if (!LookupAccountSid(NULL, userid, name, &cbname, domain, &cbdomain, &type))
             return apr_get_os_error();
    -    if (type != SidTypeUser && type != SidTypeAlias)
    -        return APR_BADARG;
    +    if (type != SidTypeUser && type != SidTypeAlias && type != SidTypeWellKnownGroup)
    +        return APR_EINVAL;
         *username = apr_pstrdup(p, name);
         return APR_SUCCESS;
     }
    @@ -121,9 +121,9 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap
     APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right)
     {
         if (!left || !right)
    -        return APR_BADARG;
    +        return APR_EINVAL;
         if (!IsValidSid(left) || !IsValidSid(right))
    -        return APR_BADARG;
    +        return APR_EINVAL;
         if (!EqualSid(left, right))
             return APR_EMISMATCH;
         return APR_SUCCESS;
    
    From 86d4881ede47ce65aea000d021cfd4fe7149eaee Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 6 Jun 2001 21:38:55 +0000
    Subject: [PATCH 1731/7878] we don't always have apr_os_thread_current()
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61723 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_portable.h | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/include/apr_portable.h b/include/apr_portable.h
    index b0b2b84a20a..17ed5bd3ae0 100644
    --- a/include/apr_portable.h
    +++ b/include/apr_portable.h
    @@ -418,7 +418,9 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **dso,
     APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso,
                                                     apr_dso_handle_t *aprdso);
     
    +#if APR_HAS_THREADS
     APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void);
    +#endif
     
     #endif /* APR_HAS_DSO */
     
    
    From fcb0f45652bf4d81d8408d2a147ddac3eb0e43f2 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 6 Jun 2001 21:49:00 +0000
    Subject: [PATCH 1732/7878] If we don't have a lock and unlock function in an
     sms module then it's not an error as this is allowed.  Add a comment to this
     effect to make it clearer.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61724 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms.c | 10 ++++++++--
     1 file changed, 8 insertions(+), 2 deletions(-)
    
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index d378c3d1525..7992e34acdb 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -466,16 +466,22 @@ APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a,
     
     APR_DECLARE(apr_status_t) apr_sms_lock(apr_sms_t *mem_sys)
     {
    +    /* If we don't have a lock_fn then we probably don't need one,
    +     * so this is OK and we just return APR_SUCCESS
    +     */
         if (!mem_sys->lock_fn)
    -        return APR_ENOTIMPL;
    +        return APR_SUCCESS;
     
         return mem_sys->lock_fn(mem_sys);
     }
     
     APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *mem_sys)
     {
    +    /* If we don't have a lock_fn then we probably don't need one,
    +     * so this is OK and we just return APR_SUCCESS
    +     */
         if (!mem_sys->unlock_fn)
    -        return APR_ENOTIMPL;
    +        return APR_SUCCESS;
             
         return mem_sys->unlock_fn(mem_sys);
     }
    
    From 3412d4e51158e95e79027c72d947b403fa3b0928 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 6 Jun 2001 21:51:18 +0000
    Subject: [PATCH 1733/7878] Fix a couple of errors that slipped through
     earlier...
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61725 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/beos/locks.h | 3 ++-
     locks/beos/intraproc.c    | 6 +++---
     2 files changed, 5 insertions(+), 4 deletions(-)
    
    diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h
    index 1b30116884e..66f3e009014 100644
    --- a/include/arch/beos/locks.h
    +++ b/include/arch/beos/locks.h
    @@ -60,12 +60,13 @@
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_lib.h"
    +#include "apr_portable.h"
     
     struct apr_lock_t {
         apr_pool_t *pool;
         apr_locktype_e type;
         apr_lockscope_e scope;
    -    apr_os_thread_t *owner;
    +    apr_os_thread_t owner;
         int owner_ref;
         /* Inter proc */
         sem_id sem_interproc;
    diff --git a/locks/beos/intraproc.c b/locks/beos/intraproc.c
    index c7b57606b79..c1847a39051 100644
    --- a/locks/beos/intraproc.c
    +++ b/locks/beos/intraproc.c
    @@ -77,8 +77,8 @@ apr_status_t create_intra_lock(apr_lock_t *new)
         }
         new->ben_intraproc = 0;
         new->sem_intraproc = stat;
    -    APR_CLEANUP_REGISTER(new, (void *)new, lock_intra_cleanup,
    -                        apr_pool_cleanup_null);
    +    apr_pool_cleanup_register(new->pool, (void *)new, lock_intra_cleanup,
    +                              apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    @@ -112,7 +112,7 @@ apr_status_t destroy_intra_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) {
    -        APR_CLEANUP_REMOVE(lock, lock, lock_intra_cleanup);
    +        apr_pool_cleanup_kill(lock->pool, lock, lock_intra_cleanup);
             return APR_SUCCESS;
         }
         return stat;
    
    From 767dafa889faef2c9471d5162034b84c161f2e1e Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 6 Jun 2001 21:52:42 +0000
    Subject: [PATCH 1734/7878] Stop some compiler warnings on beos...
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61726 13f79535-47bb-0310-9956-ffa450edef68
    ---
     shmem/beos/shmem.c | 12 ++++++------
     1 file changed, 6 insertions(+), 6 deletions(-)
    
    diff --git a/shmem/beos/shmem.c b/shmem/beos/shmem.c
    index 428300aa5e4..9eb4061bca7 100644
    --- a/shmem/beos/shmem.c
    +++ b/shmem/beos/shmem.c
    @@ -57,6 +57,7 @@
     #include "apr_errno.h"
     #include "apr_lib.h"
     #include "apr_strings.h"
    +#include 
     #include 
     #include 
     
    @@ -80,7 +81,9 @@ struct shmem_t {
     
     #define MIN_BLK_SIZE 128
     
    +/*
     #define DEBUG_ 1
    +*/
     
     void add_block(struct block_t **list, struct block_t *blk);
     void split_block(struct block_t **list, struct block_t *blk, apr_size_t size);
    @@ -204,7 +207,7 @@ static void remove_block(struct block_t **list, struct block_t *blk)
     static void free_block(struct shmem_t *m, void *entity)
     {
         struct block_t *b;
    -    if (b = find_block_by_addr(m->uselist, entity)){
    +    if ((b = find_block_by_addr(m->uselist, entity))){
             remove_block(&(m->uselist), b);
             add_block(&(m->freelist), b);
             m->avail += b->size;
    @@ -236,11 +239,8 @@ static struct block_t *alloc_block(struct shmem_t *m, apr_size_t size)
     apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, 
                               apr_pool_t *p)
     {
    -    int rc;
    -    int pages;
         apr_size_t pagesize;
         area_id newid;
    -    char *name = NULL;
         char *addr;
     
         (*m) = (struct shmem_t *)apr_pcalloc(p, sizeof(struct shmem_t));
    @@ -278,7 +278,7 @@ apr_status_t apr_shm_destroy(struct shmem_t *m)
     void *apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize)
     {
         struct block_t *b;
    -    if (b = alloc_block(m, reqsize))
    +    if ((b = alloc_block(m, reqsize)))
             return b->addr;
         return NULL;
     }
    @@ -286,7 +286,7 @@ void *apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize)
     void *apr_shm_calloc(struct shmem_t *m, apr_size_t reqsize)
     {
         struct block_t *b; 
    -    if (b = alloc_block(m, reqsize)){  
    +    if ((b = alloc_block(m, reqsize))){  
             memset(b->addr, 0, reqsize);
             return b->addr;
         }
    
    From 0ddc4dcb7e219fe02e5d721431b3f8afcaba21f0 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 6 Jun 2001 22:25:43 +0000
    Subject: [PATCH 1735/7878] Bring testlock in line with the rest of the test
     apps and change the order of the tests to have the least implemented at the
     end.  Also now has better output and errors are preserved shown.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61727 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testlock.c | 112 +++++++++++++++++++++++++++---------------------
     1 file changed, 63 insertions(+), 49 deletions(-)
    
    diff --git a/test/testlock.c b/test/testlock.c
    index c3d39188d22..af675ae48f3 100644
    --- a/test/testlock.c
    +++ b/test/testlock.c
    @@ -60,13 +60,13 @@
     #include "errno.h"
     #include 
     #include 
    +#include "test_apr.h"
     
     #if !APR_HAS_THREADS
     int main(void)
     {
    -    fprintf(stderr,
    -            "This program won't work on this platform because there is no "
    -            "support for threads.\n");
    +    printf("This program won't work on this platform because there is no "
    +           "support for threads.\n");
         return 0;
     }
     #else /* !APR_HAS_THREADS */
    @@ -74,7 +74,11 @@ int main(void)
     #define MAX_ITER 40000
     
     void * APR_THREAD_FUNC thread_rw_func(void *data);
    -void * APR_THREAD_FUNC thread_func(void *data);
    +void * APR_THREAD_FUNC thread_function(void *data);
    +apr_status_t test_exclusive(void);
    +apr_status_t test_rw(void);
    +apr_status_t test_multiple_locking(void);
    +
     
     apr_file_t *in, *out, *err;
     apr_lock_t *thread_rw_lock, *thread_lock;
    @@ -106,15 +110,16 @@ void * APR_THREAD_FUNC thread_rw_func(void *data)
         return NULL;
     } 
     
    -void * APR_THREAD_FUNC thread_func(void *data)
    +void * APR_THREAD_FUNC thread_function(void *data)
     {
         int exitLoop = 1;
     
    +    /* slight delay to allow things to settle */
    +    apr_sleep (1);
    +    
         while (1)
         {
             apr_lock_acquire(thread_lock);
    -        if (apr_lock_acquire(thread_lock) != APR_SUCCESS)
    -            printf("Failed!\n");
             if (i == MAX_ITER)
                 exitLoop = 0;
             else 
    @@ -123,7 +128,6 @@ void * APR_THREAD_FUNC thread_func(void *data)
                 x++;
             }
             apr_lock_release(thread_lock);
    -        apr_lock_release(thread_lock);
     
             if (!exitLoop)
                 break;
    @@ -136,91 +140,93 @@ int test_rw(void)
         apr_thread_t *t1, *t2, *t3, *t4;
         apr_status_t s1, s2, s3, s4;
     
    -    apr_file_printf(out, "Initializing the rw lock.");
    -    s1 = apr_lock_create(&thread_rw_lock, APR_READWRITE, APR_INTRAPROCESS, 
    -                         "lock.file", pool); 
    +    printf("RW Lock Tests\n");
    +    printf("%-60s", "    Initializing the RW lock");
    +    s1 = apr_lock_create(&thread_rw_lock, APR_READWRITE, APR_INTRAPROCESS,
    +                         "lock.file", pool);
         if (s1 != APR_SUCCESS) {
    -        apr_file_printf(err, "Could not create lock\n");
    +        printf("Failed!\n");
             return s1;
         }
    -    apr_file_printf(out, " OK\n");
    +    printf("OK\n");
     
         i = 0;
         x = 0;
     
    -    apr_file_printf(out, "Starting all the threads......."); 
    +    printf("%-60s","    Starting all the threads"); 
         s1 = apr_thread_create(&t1, NULL, thread_rw_func, NULL, pool);
         s2 = apr_thread_create(&t2, NULL, thread_rw_func, NULL, pool);
         s3 = apr_thread_create(&t3, NULL, thread_rw_func, NULL, pool);
         s4 = apr_thread_create(&t4, NULL, thread_rw_func, NULL, pool);
         if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || 
             s3 != APR_SUCCESS || s4 != APR_SUCCESS) {
    -        apr_file_printf(err, "Error starting threads\n");
    +        printf("Failed!\n");
             return s1;
         }
    -    apr_file_printf(out, "OK\n");
    +    printf("OK\n");
     
    -    apr_file_printf(out, "Waiting for threads to exit.......");
    +    printf("%-60s", "    Waiting for threads to exit");
         apr_thread_join(&s1, t1);
         apr_thread_join(&s2, t2);
         apr_thread_join(&s3, t3);
         apr_thread_join(&s4, t4);
    -    apr_file_printf(out, "OK\n");
    +    printf("OK\n");
     
    -    apr_file_printf(out, "OK\n");
         if (x != MAX_ITER) {
    -        apr_file_printf(err, "The locks didn't work????  %d\n", x);
    +        fprintf(stderr, "RW locks didn't work as expected. x = %d instead of %d\n",
    +                x, MAX_ITER);
         }
         else {
    -        apr_file_printf(out, "Everything is working!\n");
    +        printf("Test passed\n");
         }
         
         return APR_SUCCESS;
     }
     
    -int test_exclusive(void)
    +apr_status_t test_exclusive(void)
     {
         apr_thread_t *t1, *t2, *t3, *t4;
         apr_status_t s1, s2, s3, s4;
     
    -    apr_file_printf(out, "Initializing the lock.");
    +    printf("Exclusive lock test\n");
    +    printf("%-60s", "    Initializing the lock");
         s1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, 
                              "lock.file", pool); 
     
         if (s1 != APR_SUCCESS) {
    -        apr_file_printf(err, "Could not create lock\n");
    +        printf("Failed!\n");
             return s1;
         }
    -    apr_file_printf(out, " OK\n");
    +    printf("OK\n");
     
         i = 0;
         x = 0;
     
    -    apr_file_printf(out, "Starting all the threads......."); 
    -    s1 = apr_thread_create(&t1, NULL, thread_func, NULL, pool);
    -    s2 = apr_thread_create(&t2, NULL, thread_func, NULL, pool);
    -    s3 = apr_thread_create(&t3, NULL, thread_func, NULL, pool);
    -    s4 = apr_thread_create(&t4, NULL, thread_func, NULL, pool);
    +    printf("%-60s", "    Starting all the threads"); 
    +    s1 = apr_thread_create(&t1, NULL, thread_function, NULL, pool);
    +    s2 = apr_thread_create(&t2, NULL, thread_function, NULL, pool);
    +    s3 = apr_thread_create(&t3, NULL, thread_function, NULL, pool);
    +    s4 = apr_thread_create(&t4, NULL, thread_function, NULL, pool);
         if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || 
             s3 != APR_SUCCESS || s4 != APR_SUCCESS) {
    -        apr_file_printf(err, "Error starting threads\n");
    +        printf("Failed!\n");
             return s1;
         }
    -    apr_file_printf(out, "OK\n");
    +    printf("OK\n");
     
    -    apr_file_printf(out, "Waiting for threads to exit.......");
    +    printf("%-60s", "    Waiting for threads to exit");
         apr_thread_join(&s1, t1);
         apr_thread_join(&s2, t2);
         apr_thread_join(&s3, t3);
         apr_thread_join(&s4, t4);
    -    apr_file_printf(out, "OK\n");
    +    printf("OK\n");
     
    -    apr_file_printf(out, "OK\n");
         if (x != MAX_ITER) {
    -        apr_file_printf(err, "The locks didn't work????  %d\n", x);
    +        fprintf(stderr, "Locks don't appear to work!  x = %d instead of %d\n",
    +                x, MAX_ITER);
         }
         else {
    -        apr_file_printf(out, "Everything is working!\n");
    +        printf("Test passed\n");
         }
         return APR_SUCCESS;
     }
    @@ -267,32 +273,40 @@ apr_status_t test_multiple_locking(void)
         }
         printf("OK\n");
     
    -    printf("Multiple locking test completed\n");
    +    printf("Test passed\n");
         return APR_SUCCESS;
     }
     
     int main(void)
     {
    +    apr_status_t rv;
    +    char errmsg[200];
    +
    +    printf("APR Locks Test\n==============\n\n");
    +        
         apr_initialize();
         atexit(apr_terminate);
     
         if (apr_pool_create(&pool, NULL) != APR_SUCCESS)
             exit(-1);
     
    -    apr_file_open_stdin(&in, pool); 
    -    apr_file_open_stdout(&out, pool); 
    -    apr_file_open_stderr(&err, pool); 
    -
    -    apr_file_printf(out, "OK\n");
    -
    -    if (test_rw() != APR_SUCCESS)
    +    if ((rv = test_exclusive()) != APR_SUCCESS) {
    +        fprintf(stderr,"Exclusive Lock test failed : [%d] %s\n",
    +                rv, apr_strerror(rv, (char*)errmsg, 200));
             exit(-2);
    -
    -    if (test_exclusive() != APR_SUCCESS)
    +    }
    +    
    +    if ((rv = test_multiple_locking()) != APR_SUCCESS) {
    +        fprintf(stderr,"Multiple Locking test failed : [%d] %s\n",
    +                rv, apr_strerror(rv, (char*)errmsg, 200));
             exit(-3);
    -
    -    if (test_multiple_locking() != APR_SUCCESS)
    +    }
    +    
    +    if ((rv = test_rw()) != APR_SUCCESS) {
    +        fprintf(stderr,"RW Lock test failed : [%d] %s\n",
    +                rv, apr_strerror(rv, (char*)errmsg, 200));
             exit(-4);
    +    }
     
         return 1;
     }
    
    From 65348fdf714763da08579809f63aa73c1dbb4c83 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 7 Jun 2001 02:39:00 +0000
    Subject: [PATCH 1736/7878] apr_os_thread_t isn't necessarily a ptr; 0 is
     compatible with ptr or integer, but NULL isn't
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61728 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/unix/locks.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/locks/unix/locks.c b/locks/unix/locks.c
    index d86506c3333..037ee43cbed 100644
    --- a/locks/unix/locks.c
    +++ b/locks/unix/locks.c
    @@ -244,7 +244,7 @@ apr_status_t apr_lock_release(apr_lock_t *lock)
         }
     
     #if APR_HAS_THREADS
    -    lock->owner = NULL;
    +    lock->owner = 0;
         lock->owner_ref = 0;
     #endif
         
    
    From 77065c072ef8cb0c1bcf3e39c7fdff89b39f78a1 Mon Sep 17 00:00:00 2001
    From: "Victor J. Orlikowski" 
    Date: Thu, 7 Jun 2001 10:03:25 +0000
    Subject: [PATCH 1737/7878] Generate httpd.exp on the fly. This should allow
     DSOs to work on AIX, without the headache of maintaining the httpd.exp file.
     This is adapted from OS/2's generation of ApacheCoreOS2.def. There exist a
     few bugs still:     1) mod_dav and mod_proxy may not yet work, due to certain
     namespace issues.     2) Some symbols may need to be added, a la
     core_header.def Once these have been fixed, the old httpd.exp file will be
     deleted.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61729 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in                  |  2 ++
     include/arch/unix/networkio.h |  3 +++
     network_io/unix/poll.c        | 40 ++++++++++++++++++++++++++++++++++-
     3 files changed, 44 insertions(+), 1 deletion(-)
    
    diff --git a/configure.in b/configure.in
    index b8c1b6711d6..5c1a209366b 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -330,6 +330,7 @@ esac
     AC_SUBST(threads)
     AC_SUBST(have_sigwait)
     
    +AC_CHECK_FUNCS(kqueue)
     AC_CHECK_FUNCS(poll)
     
     dnl #----------------------------- Checking for missing POSIX thread functions
    @@ -556,6 +557,7 @@ APR_FLAG_HEADERS(
         net/errno.h		\
         netinet/in.h	\
         sys/file.h		\
    +    sys/event.h		\
         sys/mman.h		\
         sys/poll.h		\
         sys/resource.h	\
    diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h
    index 5d983bd80c9..0b1125ab700 100644
    --- a/include/arch/unix/networkio.h
    +++ b/include/arch/unix/networkio.h
    @@ -69,6 +69,9 @@
     #if APR_HAVE_SYS_UIO_H
     #include 
     #endif
    +#ifdef HAVE_SYS_EVENT_H
    +#include 
    +#endif
     #ifdef HAVE_SYS_POLL_H
     #include 
     #endif
    diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c
    index cfc5d44f751..b6709c300e2 100644
    --- a/network_io/unix/poll.c
    +++ b/network_io/unix/poll.c
    @@ -55,7 +55,45 @@
     #include "networkio.h"
     #include "fileio.h"
     
    -#ifdef HAVE_POLL    /* We can just use poll to do our socket polling. */
    +#if defined(HAVE_KQUEUE)  /* FreeBSD provides kqueue, let's use it :) */
    +
    +apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont)
    +{
    +    (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num);
    +    if ((*new) == NULL) {
    +        return APR_ENOMEM;
    +    }
    +
    +}
    +
    +apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset,
    +                               apr_socket_t *sock, apr_int16_t event)
    +{
    +}
    +
    +apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds,
    +                    apr_interval_time_t timeout)
    +{
    +}
    +
    +apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset)
    +{
    +}
    +
    +apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset,
    +                                  apr_socket_t *sock, apr_int16_t events)
    +{
    +}
    +
    +apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock)
    +{
    +}
    +
    +apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events)
    +{
    +}
    +
    +#elif defined(HAVE_POLL)    /* We can just use poll to do our socket polling. */
     
     apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont)
     {
    
    From 4588c4755b5f25d6b61c7c91f9469f7e7fb6424a Mon Sep 17 00:00:00 2001
    From: "Victor J. Orlikowski" 
    Date: Thu, 7 Jun 2001 10:31:24 +0000
    Subject: [PATCH 1738/7878] Ooopsie. Some unintended things slipped in. Backing
     them out. Sorry.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61730 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in                  |  2 --
     include/arch/unix/networkio.h |  3 ---
     network_io/unix/poll.c        | 40 +----------------------------------
     3 files changed, 1 insertion(+), 44 deletions(-)
    
    diff --git a/configure.in b/configure.in
    index 5c1a209366b..b8c1b6711d6 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -330,7 +330,6 @@ esac
     AC_SUBST(threads)
     AC_SUBST(have_sigwait)
     
    -AC_CHECK_FUNCS(kqueue)
     AC_CHECK_FUNCS(poll)
     
     dnl #----------------------------- Checking for missing POSIX thread functions
    @@ -557,7 +556,6 @@ APR_FLAG_HEADERS(
         net/errno.h		\
         netinet/in.h	\
         sys/file.h		\
    -    sys/event.h		\
         sys/mman.h		\
         sys/poll.h		\
         sys/resource.h	\
    diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h
    index 0b1125ab700..5d983bd80c9 100644
    --- a/include/arch/unix/networkio.h
    +++ b/include/arch/unix/networkio.h
    @@ -69,9 +69,6 @@
     #if APR_HAVE_SYS_UIO_H
     #include 
     #endif
    -#ifdef HAVE_SYS_EVENT_H
    -#include 
    -#endif
     #ifdef HAVE_SYS_POLL_H
     #include 
     #endif
    diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c
    index b6709c300e2..cfc5d44f751 100644
    --- a/network_io/unix/poll.c
    +++ b/network_io/unix/poll.c
    @@ -55,45 +55,7 @@
     #include "networkio.h"
     #include "fileio.h"
     
    -#if defined(HAVE_KQUEUE)  /* FreeBSD provides kqueue, let's use it :) */
    -
    -apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont)
    -{
    -    (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num);
    -    if ((*new) == NULL) {
    -        return APR_ENOMEM;
    -    }
    -
    -}
    -
    -apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset,
    -                               apr_socket_t *sock, apr_int16_t event)
    -{
    -}
    -
    -apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds,
    -                    apr_interval_time_t timeout)
    -{
    -}
    -
    -apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset)
    -{
    -}
    -
    -apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset,
    -                                  apr_socket_t *sock, apr_int16_t events)
    -{
    -}
    -
    -apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock)
    -{
    -}
    -
    -apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events)
    -{
    -}
    -
    -#elif defined(HAVE_POLL)    /* We can just use poll to do our socket polling. */
    +#ifdef HAVE_POLL    /* We can just use poll to do our socket polling. */
     
     apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont)
     {
    
    From c5a053af3c9d22c1034c8c7794fc9867024858d7 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 7 Jun 2001 14:32:21 +0000
    Subject: [PATCH 1739/7878] axe APR_ENOFILE
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61731 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/os2/open.c     | 4 ----
     file_io/unix/open.c    | 4 ----
     file_io/win32/open.c   | 3 ---
     include/apr_errno.h    | 8 +++-----
     misc/unix/errorcodes.c | 2 --
     5 files changed, 3 insertions(+), 18 deletions(-)
    
    diff --git a/file_io/os2/open.c b/file_io/os2/open.c
    index bbe84c6c32e..6a938abbcff 100644
    --- a/file_io/os2/open.c
    +++ b/file_io/os2/open.c
    @@ -207,10 +207,6 @@ apr_status_t apr_file_rename(const char *from_path, const char *to_path,
     
     apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file)
     {
    -    if (file == NULL) {
    -        return APR_ENOFILE;
    -    }
    -
         *thefile = file->filedes;
         return APR_SUCCESS;
     }
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index 032891abea7..87ee1b3a0ed 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -203,10 +203,6 @@ apr_status_t apr_file_rename(const char *from_path, const char *to_path,
     
     apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file)
     {
    -    if (file == NULL) {
    -        return APR_ENOFILE;
    -    }
    -
         *thefile = file->filedes;
         return APR_SUCCESS;
     }
    diff --git a/file_io/win32/open.c b/file_io/win32/open.c
    index 4192cccc9bf..92b21df1575 100644
    --- a/file_io/win32/open.c
    +++ b/file_io/win32/open.c
    @@ -399,9 +399,6 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath,
     APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile,
                                               apr_file_t *file)
     {
    -    if (file == NULL) {
    -        return APR_ENOFILE;
    -    }
         *thefile = file->filehand;
         return APR_SUCCESS;
     }
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 36050c3b69b..1e05819d599 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -165,7 +165,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
      * APR_ENOPOOL      APR was not provided a pool with which to allocate memory
      * APR_EBADDATE     APR was given an invalid date 
      * APR_EINVALSOCK   APR was given an invalid socket
    - * APR_ENOFILE      APR was not given a file structure
      * APR_ENOPROC      APR was not given a process structure
      * APR_ENOTIME      APR was not given a time structure
      * APR_ENODIR       APR was not given a directory structure
    @@ -218,15 +217,15 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
      * @param statcode The apr status code to test.
      * @deffunc int APR_STATUS_IS_status(apr_status_t statcode)
      * @tip Warning: macro implementations; the statcode argument may be
    - *      evaluated multiple times.  To test for APR_ENOFILE, always test
    - *      APR_STATUS_IS_ENOFILE(statcode) because platform-specific codes are
    + *      evaluated multiple times.  To test for APR_EOF, always test
    + *      APR_STATUS_IS_EOF(statcode) because platform-specific codes are
      *      not necessarily translated into the corresponding APR_Estatus code.
      */
     
     /* APR ERROR VALUES */
     #define APR_ENOSTAT        (APR_OS_START_ERROR + 1)
     #define APR_ENOPOOL        (APR_OS_START_ERROR + 2)
    -#define APR_ENOFILE        (APR_OS_START_ERROR + 3)
    +/* empty slot: +3 */
     #define APR_EBADDATE       (APR_OS_START_ERROR + 4)
     #define APR_EINVALSOCK     (APR_OS_START_ERROR + 5)
     #define APR_ENOPROC        (APR_OS_START_ERROR + 6)
    @@ -252,7 +251,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     /* APR ERROR VALUE TESTS */
     #define APR_STATUS_IS_ENOSTAT(s)        ((s) == APR_ENOSTAT)
     #define APR_STATUS_IS_ENOPOOL(s)        ((s) == APR_ENOPOOL)
    -#define APR_STATUS_IS_ENOFILE(s)        ((s) == APR_ENOFILE)
     #define APR_STATUS_IS_EBADDATE(s)       ((s) == APR_EBADDATE)
     #define APR_STATUS_IS_EINVALSOCK(s)     ((s) == APR_EINVALSOCK)
     #define APR_STATUS_IS_ENOPROC(s)        ((s) == APR_ENOPROC)
    diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c
    index b3b41f45f3b..e3d7f735315 100644
    --- a/misc/unix/errorcodes.c
    +++ b/misc/unix/errorcodes.c
    @@ -83,8 +83,6 @@ static char *apr_error_string(apr_status_t statcode)
             return "An invalid date has been provided";
         case APR_EINVALSOCK:
             return "An invalid socket was returned";
    -    case APR_ENOFILE:
    -        return "No file was provided and one was required.";
         case APR_ENOPROC:
             return "No process was provided and one was required.";
         case APR_ENOTIME:
    
    From e5e138be4f3882705213c1b527c143138ace4f1f Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Thu, 7 Jun 2001 14:55:43 +0000
    Subject: [PATCH 1740/7878] Make some of the checks clearer and remove the
     debugging stuff that is no longer needed.
    
    Submitted by:	Greg Stein
    Reviewed by:	David Reid
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61732 13f79535-47bb-0310-9956-ffa450edef68
    ---
     shmem/beos/shmem.c | 45 ++++++---------------------------------------
     1 file changed, 6 insertions(+), 39 deletions(-)
    
    diff --git a/shmem/beos/shmem.c b/shmem/beos/shmem.c
    index 9eb4061bca7..9c253ba3bd7 100644
    --- a/shmem/beos/shmem.c
    +++ b/shmem/beos/shmem.c
    @@ -81,31 +81,10 @@ struct shmem_t {
     
     #define MIN_BLK_SIZE 128
     
    -/*
    -#define DEBUG_ 1
    -*/
     
     void add_block(struct block_t **list, struct block_t *blk);
     void split_block(struct block_t **list, struct block_t *blk, apr_size_t size);
     
    -/* Debugging functions */
    -#if DEBUG_
    -static void printf_block(struct block_t *b)
    -{
    -    printf ("Block : %ld bytes\n\tthis = %x\n\tnext = %x\n",
    -            b->size, b, b->nxt);
    -}
    -
    -static void walk_list(struct block_t *list)
    -{
    -    struct block_t *b = list;
    -    do {
    -        printf_block(b);
    -    }
    -    while ((b = b->nxt) != NULL);
    -}
    -#endif
    -
     static struct block_t * find_block_by_addr(struct block_t *list, void *addr)
     {
         struct block_t *b = list;   
    @@ -140,18 +119,8 @@ static struct block_t *find_block_of_size(struct block_t *list, apr_size_t size)
         }
         while ((b = b->nxt) != list);
     
    -    if (diff > MIN_BLK_SIZE){
    -        split_block(&list, rv, size);
    -        
    -        /* we're going to split the block now... */
    -/*        apr_size_t nsz = rv->size - size;
    -        struct block_t *blk = (struct block_t*)apr_pcalloc(rv->p, sizeof(struct block_t));
    -        blk->p = rv->p;
    -        blk->size = nsz;
    -        rv->size = size;
    -        blk->addr = rv->addr + size;
    -        add_block(&list, blk);     
    -*/
    +    if (diff > MIN_BLK_SIZE) {
    +        split_block(&list, rv, size);       
         }
     
         if (rv)
    @@ -207,7 +176,7 @@ static void remove_block(struct block_t **list, struct block_t *blk)
     static void free_block(struct shmem_t *m, void *entity)
     {
         struct block_t *b;
    -    if ((b = find_block_by_addr(m->uselist, entity))){
    +    if ((b = find_block_by_addr(m->uselist, entity)) != NULL){
             remove_block(&(m->uselist), b);
             add_block(&(m->freelist), b);
             m->avail += b->size;
    @@ -221,7 +190,7 @@ static struct block_t *alloc_block(struct shmem_t *m, apr_size_t size)
         if (m->avail < size)
             return NULL; 
     
    -    if ((b = find_block_of_size(m->freelist, size))){
    +    if ((b = find_block_of_size(m->freelist, size)) != NULL){
             remove_block(&(m->freelist), b);
         } else {
             b = (struct block_t*)apr_pcalloc(m->p, sizeof(struct block_t));   
    @@ -263,8 +232,6 @@ apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *fi
         return APR_SUCCESS;
     }
     
    -
    -
     apr_status_t apr_shm_destroy(struct shmem_t *m)
     {
         delete_area(m->aid);
    @@ -278,7 +245,7 @@ apr_status_t apr_shm_destroy(struct shmem_t *m)
     void *apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize)
     {
         struct block_t *b;
    -    if ((b = alloc_block(m, reqsize)))
    +    if ((b = alloc_block(m, reqsize)) != NULL)
             return b->addr;
         return NULL;
     }
    @@ -286,7 +253,7 @@ void *apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize)
     void *apr_shm_calloc(struct shmem_t *m, apr_size_t reqsize)
     {
         struct block_t *b; 
    -    if ((b = alloc_block(m, reqsize))){  
    +    if ((b = alloc_block(m, reqsize)) != NULL){  
             memset(b->addr, 0, reqsize);
             return b->addr;
         }
    
    From 7247d229e9a4a66c6cfe743d46e7ed03cb8392a9 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Fri, 8 Jun 2001 00:44:52 +0000
    Subject: [PATCH 1741/7878] Some tidying up of the locking code. Move where we
     allocate the pool from and clean it up. Change the pre_destroy to be an
     apr_status_t Move the lock to the individual structures and add a
     lock_destroy in   the pre_destroy function. Some changing of parameter names
     to make them shorter.
    
    Submitted by:  Sander Striker 
                   David Reid 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61733 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_sms.h              |  21 +++--
     memory/unix/apr_sms.c          |  18 +++--
     memory/unix/apr_sms_std.c      |   3 -
     memory/unix/apr_sms_tracking.c | 144 ++++++++++++++++++++-------------
     4 files changed, 110 insertions(+), 76 deletions(-)
    
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index 64e9abc5685..cdb6aca7b7c 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -97,20 +97,19 @@ struct apr_sms_t
         const char *identity; /* a string identifying the module */
     
         apr_pool_t *pool;
    -    apr_lock_t *lock;
     
         struct apr_sms_cleanup *cleanups;
     
    -    void * (*malloc_fn)       (apr_sms_t *mem_sys, apr_size_t size);
    -    void * (*calloc_fn)       (apr_sms_t *mem_sys, apr_size_t size);
    -    void * (*realloc_fn)      (apr_sms_t *mem_sys, void *memory, 
    -                               apr_size_t size);
    -    apr_status_t (*free_fn)   (apr_sms_t *mem_sys, void *memory);
    -    apr_status_t (*reset_fn)  (apr_sms_t *mem_sys);
    -    void (*pre_destroy_fn)    (apr_sms_t *mem_sys);
    -    apr_status_t (*destroy_fn)(apr_sms_t *mem_sys);
    -    apr_status_t (*lock_fn)   (apr_sms_t *mem_sys);
    -    apr_status_t (*unlock_fn) (apr_sms_t *mem_sys);
    +    void * (*malloc_fn)            (apr_sms_t *mem_sys, apr_size_t size);
    +    void * (*calloc_fn)            (apr_sms_t *mem_sys, apr_size_t size);
    +    void * (*realloc_fn)           (apr_sms_t *mem_sys, void *memory, 
    +                                    apr_size_t size);
    +    apr_status_t (*free_fn)        (apr_sms_t *mem_sys, void *memory);
    +    apr_status_t (*reset_fn)       (apr_sms_t *mem_sys);
    +    apr_status_t (*pre_destroy_fn) (apr_sms_t *mem_sys);
    +    apr_status_t (*destroy_fn)     (apr_sms_t *mem_sys);
    +    apr_status_t (*lock_fn)        (apr_sms_t *mem_sys);
    +    apr_status_t (*unlock_fn)      (apr_sms_t *mem_sys);
     };
     
     /*
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index 7992e34acdb..ce83777b899 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -153,7 +153,7 @@ static int apr_sms_is_tracking(apr_sms_t *mem_sys)
     }
     
     APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *mem_sys, 
    -                                       apr_sms_t *parent_mem_sys)
    +                                       apr_sms_t *pms)
     {
         /* XXX - I've assumed that memory passed in will be zeroed,
          * i.e. calloc'd instead of malloc'd...
    @@ -163,7 +163,7 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *mem_sys,
          * an assumption to make as it sounds :)
          */
     
    -    mem_sys->parent_mem_sys = parent_mem_sys;
    +    mem_sys->parent_mem_sys = pms;
         mem_sys->accounting_mem_sys = mem_sys;
         mem_sys->child_mem_sys = NULL;
     
    @@ -185,14 +185,17 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *mem_sys,
          *      sibling->ref = ref;
          */
          
    -    if (parent_mem_sys) {
    -        if ((mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys) != NULL)
    +    if (pms) {
    +        if ((mem_sys->sibling_mem_sys = pms->child_mem_sys) != NULL)
                 mem_sys->sibling_mem_sys->ref_mem_sys = &mem_sys->sibling_mem_sys;
     
    -        mem_sys->ref_mem_sys = &parent_mem_sys->child_mem_sys;
    -        parent_mem_sys->child_mem_sys = mem_sys;
    +        mem_sys->ref_mem_sys = &pms->child_mem_sys;
    +        pms->child_mem_sys = mem_sys;
         }
     
    +    /* XXX - This should eventually be removed */
    +    apr_pool_create(&mem_sys->pool, pms ? pms->pool : NULL);
    +    
         return APR_SUCCESS;
     }
     
    @@ -423,6 +426,9 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
         if (mem_sys->pre_destroy_fn)
             mem_sys->pre_destroy_fn(mem_sys);
     
    +    /* XXX - This should eventually be removed */
    +    apr_pool_destroy(mem_sys->pool);
    +    
         /* 1 - If we have a self destruct, use it */
         if (mem_sys->destroy_fn)
             return mem_sys->destroy_fn(mem_sys);
    diff --git a/memory/unix/apr_sms_std.c b/memory/unix/apr_sms_std.c
    index 7601d2bd1c1..0bcfb33b98e 100644
    --- a/memory/unix/apr_sms_std.c
    +++ b/memory/unix/apr_sms_std.c
    @@ -127,9 +127,6 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys)
         new_mem_sys->free_fn    = apr_sms_std_free;
         new_mem_sys->identity   = module_identity;
     
    -    /* If this fails, what should we do??? */
    -    apr_pool_create(&(new_mem_sys->pool), NULL);
    -     
         /* as we're not a tracking memory module, i.e. we don't keep
          * track of our allocations, we don't have apr_sms_reset or
          * apr_sms_destroy functions.
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    index d293682737c..2d7631f49de 100644
    --- a/memory/unix/apr_sms_tracking.c
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -65,6 +65,7 @@
     #include "apr_private.h"
     #include "apr_sms.h"
     #include "apr_sms_tracking.h"
    +#include "apr_lock.h"
     #include 
     
     static const char *module_identity = "TRACKING";
    @@ -84,41 +85,32 @@ typedef struct apr_sms_tracking_t
     {
         apr_sms_t            header;
         apr_track_node_t    *nodes;
    +    apr_lock_t          *lock;
     } apr_sms_tracking_t;
     
    -static apr_status_t apr_sms_tracking_lock(apr_sms_t *mem_sys)
    -{
    -    return apr_lock_acquire(mem_sys->lock);
    -}
    -
    -static apr_status_t apr_sms_tracking_unlock(apr_sms_t *mem_sys)
    -{
    -    return apr_lock_release(mem_sys->lock);
    -}
    -
     static void *apr_sms_tracking_malloc(apr_sms_t *mem_sys,
                                          apr_size_t size)
     {
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
     
    -    apr_sms_tracking_lock(mem_sys);
    -  
    -    tms = (apr_sms_tracking_t *)mem_sys;
         node = apr_sms_malloc(mem_sys->parent_mem_sys,
                               size + sizeof(apr_track_node_t));
         if (!node)
             return NULL;
     
    +    tms = (apr_sms_tracking_t *)mem_sys;
    +    apr_lock_acquire(tms->lock);
    +
         node->next = tms->nodes;
         tms->nodes = node;
         node->ref = &tms->nodes;
         if (node->next)
             node->next->ref = &node->next;
     
    -    node++;
    +    apr_lock_release(tms->lock);
     
    -    apr_sms_tracking_unlock(mem_sys);
    +    node++;
     
         return (void *)node;
     }
    @@ -129,23 +121,23 @@ static void *apr_sms_tracking_calloc(apr_sms_t *mem_sys,
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
       
    -    apr_sms_tracking_lock(mem_sys);
    -
    -    tms = (apr_sms_tracking_t *)mem_sys;
         node = apr_sms_calloc(mem_sys->parent_mem_sys,
                               size + sizeof(apr_track_node_t));
         if (!node)
             return NULL;
     
    +    tms = (apr_sms_tracking_t *)mem_sys;
    +    apr_lock_acquire(tms->lock);
    +
         node->next = tms->nodes;
         tms->nodes = node;
         node->ref = &tms->nodes;
         if (node->next)
             node->next->ref = &node->next;
     
    -    node++;
    +    apr_lock_release(tms->lock);
     
    -    apr_sms_tracking_unlock(mem_sys);
    +    node++;
     
         return (void *)node;
     }
    @@ -156,14 +148,20 @@ static void *apr_sms_tracking_realloc(apr_sms_t *mem_sys,
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
     
    -    apr_sms_tracking_lock(mem_sys);
    -
         tms = (apr_sms_tracking_t *)mem_sys;
    +
    +
         node = (apr_track_node_t *)mem;
     
         if (node) {
             node--;
    +        apr_lock_acquire(tms->lock);
    +        
             *(node->ref) = node->next;
    +        if (node->next)
    +            node->next->ref = node->ref;
    +        
    +        apr_lock_release(tms->lock);
         }
     
         node = apr_sms_realloc(mem_sys->parent_mem_sys,
    @@ -171,16 +169,18 @@ static void *apr_sms_tracking_realloc(apr_sms_t *mem_sys,
         if (!node)
             return NULL;
     
    +    apr_lock_acquire(tms->lock);
    +    
         node->next = tms->nodes;
         tms->nodes = node;
         node->ref = &tms->nodes;
         if (node->next)
             node->next->ref = &node->next;
     
    +    apr_lock_release(tms->lock);
    +    
         node++;
     
    -    apr_sms_tracking_unlock(mem_sys);
    -
         return (void *)node;
     }
     
    @@ -188,17 +188,20 @@ static apr_status_t apr_sms_tracking_free(apr_sms_t *mem_sys,
                                               void *mem)
     {
         apr_track_node_t *node;
    - 
    -    apr_sms_tracking_lock(mem_sys);
    +    apr_sms_tracking_t *tms;
        
         node = (apr_track_node_t *)mem;
         node--;
     
    +    tms = (apr_sms_tracking_t *)mem_sys;
    + 
    +    apr_lock_acquire(tms->lock);
    +
         *(node->ref) = node->next;
         if (node->next)
             node->next->ref = node->ref;
      
    -    apr_sms_tracking_unlock(mem_sys);
    +    apr_lock_release(tms->lock);
              
         return apr_sms_free(mem_sys->parent_mem_sys, node);
     }
    @@ -208,12 +211,11 @@ static apr_status_t apr_sms_tracking_reset(apr_sms_t *mem_sys)
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
         apr_status_t rv;
    -
    -    if ((rv = apr_sms_tracking_lock(mem_sys)) != APR_SUCCESS)
    -        return rv;
      
         tms = (apr_sms_tracking_t *)mem_sys;
     
    +    apr_lock_acquire(tms->lock);
    +    
         while (tms->nodes) {
             node = tms->nodes;
             *(node->ref) = node->next;
    @@ -221,31 +223,64 @@ static apr_status_t apr_sms_tracking_reset(apr_sms_t *mem_sys)
                 node->next->ref = node->ref;
             if ((rv = apr_sms_free(mem_sys->parent_mem_sys, 
                                    node)) != APR_SUCCESS) {
    -            apr_sms_tracking_unlock(mem_sys);
    +            apr_lock_release(tms->lock);
                 return rv;
             }
         }
         
    -    if ((rv = apr_sms_tracking_unlock(mem_sys)) != APR_SUCCESS)
    -        return rv;
    +    apr_lock_release(tms->lock);
     
         return APR_SUCCESS;
     }
     
    +static apr_status_t apr_sms_tracking_pre_destroy(apr_sms_t *mem_sys)
    +{
    +    /* This function WILL alwways be called.  However, be aware that the
    +     * main sms destroy function knows that it's not wise to try and destroy
    +     * the same piece of memory twice, so the destroy function in a child won't
    +     * neccesarily be called.  To guarantee we destroy the lock it's therefore
    +     * destroyed here.
    +     */
    +    apr_sms_tracking_t *tms;
    + 
    +    tms = (apr_sms_tracking_t *)mem_sys;
    +    apr_lock_acquire(tms->lock);
    +    apr_lock_destroy(tms->lock);
    +    tms->lock = NULL;
    +    
    +    return APR_SUCCESS;    
    +}
    +
     static apr_status_t apr_sms_tracking_destroy(apr_sms_t *mem_sys)
     {
         apr_status_t rv;
    +    apr_sms_tracking_t *tms;
    +    apr_track_node_t *node;
         
    -    if ((rv = apr_sms_tracking_reset(mem_sys)) != APR_SUCCESS)
    -        return rv;
    +    tms = (apr_sms_tracking_t *)mem_sys;
    + 
    +    /* XXX - As we've already had the lock we've been using destroyed
    +     * in the pre_destroy function we can't use it.  However, if we
    +     * have threads trying to use the sms while another is trying to
    +     * destroy it, then we have serious problems anyway.
    +     */
    +    while (tms->nodes) {
    +        node = tms->nodes;
    +        *(node->ref) = node->next;
    +        if (node->next)
    +            node->next->ref = node->ref;
    +        if ((rv = apr_sms_free(mem_sys->parent_mem_sys, node)) != APR_SUCCESS)
    +            return rv;
    +    }
         
         return apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
     }
     
    +
     APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys, 
                                                       apr_sms_t *pms)
     {
    -    apr_sms_t *new_mem_sys;
    +    apr_sms_t *new_sms;
         apr_sms_tracking_t *tms;
         apr_status_t rv;
     
    @@ -254,34 +289,31 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys,
          * we allocate the memory for the structure from our parent.
          * This is safe as we shouldn't outlive our parent...
          */
    -    new_mem_sys = apr_sms_calloc(pms, sizeof(apr_sms_tracking_t));
    +    new_sms = apr_sms_calloc(pms, sizeof(apr_sms_tracking_t));
     
    -    if (!new_mem_sys)
    +    if (!new_sms)
             return APR_ENOMEM;
     
    -    if ((rv = apr_sms_init(new_mem_sys, pms)) != APR_SUCCESS)
    +    if ((rv = apr_sms_init(new_sms, pms)) != APR_SUCCESS)
             return rv;
     
    -    new_mem_sys->malloc_fn  = apr_sms_tracking_malloc;
    -    new_mem_sys->calloc_fn  = apr_sms_tracking_calloc;
    -    new_mem_sys->realloc_fn = apr_sms_tracking_realloc;
    -    new_mem_sys->free_fn    = apr_sms_tracking_free;
    -    new_mem_sys->reset_fn   = apr_sms_tracking_reset;
    -    new_mem_sys->lock_fn    = apr_sms_tracking_lock;
    -    new_mem_sys->unlock_fn  = apr_sms_tracking_unlock;
    -    new_mem_sys->destroy_fn = apr_sms_tracking_destroy;
    -    new_mem_sys->identity   = module_identity;
    -
    -    apr_pool_create(&(new_mem_sys->pool), pms->pool);
    -    apr_lock_create(&(new_mem_sys->lock), APR_MUTEX, APR_LOCKALL, NULL,
    -                    new_mem_sys->pool);
    -
    -    tms = (apr_sms_tracking_t *)new_mem_sys;
    +    new_sms->malloc_fn      = apr_sms_tracking_malloc;
    +    new_sms->calloc_fn      = apr_sms_tracking_calloc;
    +    new_sms->realloc_fn     = apr_sms_tracking_realloc;
    +    new_sms->free_fn        = apr_sms_tracking_free;
    +    new_sms->reset_fn       = apr_sms_tracking_reset;
    +    new_sms->destroy_fn     = apr_sms_tracking_destroy;
    +    new_sms->identity       = module_identity;
    +    new_sms->pre_destroy_fn = apr_sms_tracking_pre_destroy;
    +    
    +    tms = (apr_sms_tracking_t *)new_sms;
         tms->nodes = NULL;
    +    apr_lock_create(&tms->lock, APR_MUTEX, APR_LOCKALL, NULL,
    +                    new_sms->pool);
     
    -    apr_sms_assert(new_mem_sys);
    +    apr_sms_assert(new_sms);
     
    -    *mem_sys = new_mem_sys;
    +    *mem_sys = new_sms;
         return APR_SUCCESS;
     }
     
    
    From 0b8d06527380af7b68f9a3b37c5d51638ec6ad48 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Fri, 8 Jun 2001 02:34:34 +0000
    Subject: [PATCH 1742/7878] Some more locking, this time at the top level of
     sms to protect cleanups and the child lists.
    
    Submitted by:	Sander Striker 
                    David Reid 
    Reviewed by:	David Reid 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61734 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_sms.h     |  3 +-
     memory/unix/apr_sms.c | 71 ++++++++++++++++++++++++++++++++++++++-----
     2 files changed, 65 insertions(+), 9 deletions(-)
    
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index cdb6aca7b7c..03bcb56f04e 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -97,7 +97,8 @@ struct apr_sms_t
         const char *identity; /* a string identifying the module */
     
         apr_pool_t *pool;
    -
    +    apr_lock_t *sms_lock;
    +    
         struct apr_sms_cleanup *cleanups;
     
         void * (*malloc_fn)            (apr_sms_t *mem_sys, apr_size_t size);
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index ce83777b899..f3e2ed30162 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -186,16 +186,28 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *mem_sys,
          */
          
         if (pms) {
    +        /*
    +         * We only need to lock the parent as the only other function that
    +         * touches the fields we're about to mess with is apr_sms_destroy
    +         */
    +        apr_lock_acquire(pms->sms_lock);
    +        
             if ((mem_sys->sibling_mem_sys = pms->child_mem_sys) != NULL)
                 mem_sys->sibling_mem_sys->ref_mem_sys = &mem_sys->sibling_mem_sys;
     
             mem_sys->ref_mem_sys = &pms->child_mem_sys;
             pms->child_mem_sys = mem_sys;
    +
    +        apr_lock_release(pms->sms_lock);    
         }
     
         /* XXX - This should eventually be removed */
         apr_pool_create(&mem_sys->pool, pms ? pms->pool : NULL);
         
    +    /* Create the lock we'll use to protect cleanups and child lists */
    +    apr_lock_create(&mem_sys->sms_lock, APR_MUTEX, APR_LOCKALL, NULL,
    +                    mem_sys->pool);
    +                        
         return APR_SUCCESS;
     }
     
    @@ -298,9 +310,13 @@ static void apr_sms_do_child_cleanups(apr_sms_t *mem_sys)
     
     APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys)
     {
    +    apr_status_t rv;
    +    
         if (!mem_sys->reset_fn)
             return APR_ENOTIMPL;
     
    +    apr_lock_acquire(mem_sys->sms_lock);
    +    
         /* 
          * Run the cleanups of all child memory systems _including_
          * the accounting memory system.
    @@ -323,16 +339,23 @@ APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys)
         mem_sys->accounting_mem_sys = mem_sys;
     
         /* Let the memory system handle the actual reset */
    -    return mem_sys->reset_fn(mem_sys);
    +    rv = mem_sys->reset_fn(mem_sys);
    +
    +    apr_lock_release(mem_sys->sms_lock);
    +    
    +    return rv;
     }
     
     APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
     {
         apr_sms_t *child_mem_sys;
         apr_sms_t *sibling_mem_sys;
    +    apr_sms_t *pms;
         struct apr_sms_cleanup *cleanup;
         struct apr_sms_cleanup *next_cleanup;
     
    +    apr_lock_acquire(mem_sys->sms_lock);
    +    
         if (apr_sms_is_tracking(mem_sys)) {
             /* 
              * Run the cleanups of all child memory systems _including_
    @@ -415,17 +438,27 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
             }
         }
     
    +    pms = mem_sys->parent_mem_sys;
    +    
         /* Remove the memory system from the parent memory systems child list */
    +    if (pms)
    +        apr_lock_acquire(pms->sms_lock);
    +        
         if (mem_sys->sibling_mem_sys)
             mem_sys->sibling_mem_sys->ref_mem_sys = mem_sys->ref_mem_sys;
     
         if (mem_sys->ref_mem_sys)
             *mem_sys->ref_mem_sys = mem_sys->sibling_mem_sys;
     
    +    if (pms)
    +        apr_lock_release(pms->sms_lock);
    +        
         /* Call the pre-destroy if present */
         if (mem_sys->pre_destroy_fn)
             mem_sys->pre_destroy_fn(mem_sys);
     
    +    apr_lock_destroy(mem_sys->sms_lock);
    +    
         /* XXX - This should eventually be removed */
         apr_pool_destroy(mem_sys->pool);
         
    @@ -506,20 +539,27 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys,
     
         if (!cleanup_fn)
             return APR_ENOTIMPL;
    -
    +    
    +    apr_lock_acquire(mem_sys->sms_lock);
    +    
         cleanup = (struct apr_sms_cleanup *)
                       apr_sms_malloc(mem_sys->accounting_mem_sys,
                                      sizeof(struct apr_sms_cleanup));
     
    -    if (!cleanup)
    +    if (!cleanup){
    +        apr_lock_release(mem_sys->sms_lock);
             return APR_ENOMEM;
    +    }
     
         cleanup->data = data;
         cleanup->type = type;
         cleanup->cleanup_fn = cleanup_fn;
    +
         cleanup->next = mem_sys->cleanups;
         mem_sys->cleanups = cleanup;
     
    +    apr_lock_release(mem_sys->sms_lock);
    +    
         return APR_SUCCESS;
     }
     
    @@ -531,7 +571,10 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys,
     {
         struct apr_sms_cleanup *cleanup;
         struct apr_sms_cleanup **cleanup_ref;
    -
    +    apr_status_t rv = APR_EINVAL;
    +    
    +    apr_lock_acquire(mem_sys->sms_lock);
    +    
         cleanup = mem_sys->cleanups;
         cleanup_ref = &mem_sys->cleanups;
         while (cleanup) {
    @@ -539,18 +582,22 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys,
                 cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) {
                 *cleanup_ref = cleanup->next;
     
    +            apr_lock_release(mem_sys->sms_lock);
    +            
                 mem_sys = mem_sys->accounting_mem_sys;
     
    -            if (mem_sys->free_fn != NULL)
    +            if (mem_sys->free_fn)
                     apr_sms_free(mem_sys, cleanup);
     
    -            return APR_SUCCESS;
    +            rv = APR_SUCCESS;
             }
     
             cleanup_ref = &cleanup->next;
             cleanup = cleanup->next;
         }
     
    +    apr_lock_release(mem_sys->sms_lock);
    +
         /* The cleanup function must have been registered previously */
         return APR_EINVAL;
     }
    @@ -562,6 +609,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys,
         struct apr_sms_cleanup **cleanup_ref;
         apr_status_t rv = APR_EINVAL;
     
    +    apr_lock_acquire(mem_sys->sms_lock);
    +    
         cleanup = mem_sys->cleanups;
         cleanup_ref = &mem_sys->cleanups;
         mem_sys = mem_sys->accounting_mem_sys;
    @@ -581,6 +630,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys,
             }
         }
     
    +    apr_lock_release(mem_sys->sms_lock);
    +    
         /* The cleanup function must have been registered previously */
         return rv;
     }
    @@ -605,8 +656,10 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *mem_sys,
     {
         struct apr_sms_cleanup *cleanup;
         struct apr_sms_cleanup **cleanup_ref;
    -    apr_status_t rv = APR_ENOTIMPL;
    -
    +    apr_status_t rv = APR_EINVAL;
    +    
    +    apr_lock_acquire(mem_sys->sms_lock);
    +    
         cleanup = mem_sys->cleanups;
         cleanup_ref = &mem_sys->cleanups;
         mem_sys = mem_sys->accounting_mem_sys;
    @@ -628,6 +681,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *mem_sys,
             }
         }
     
    +    apr_lock_release(mem_sys->sms_lock);
    +
         /* The cleanup function should have been registered previously */
         return rv;
     }
    
    From 973adbc69593d754ad3746cea86bf1c1ac16b9e6 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 8 Jun 2001 04:49:50 +0000
    Subject: [PATCH 1743/7878]   These are (thankfully) now irrelevant stubs. 
     apr_terminate is defined   as _always_ compatible with atexit.  A nice
     mindless exercise for my   very sleep-deprived brain.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61735 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/client.c      | 7 +------
     test/sendfile.c    | 7 +------
     test/server.c      | 7 +------
     test/testargs.c    | 7 +------
     test/testcontext.c | 7 +------
     test/testdso.c     | 7 +------
     test/testfile.c    | 7 +------
     test/testflock.c   | 7 +------
     test/testipsub.c   | 7 +------
     test/testmd5.c     | 7 +------
     test/testmmap.c    | 7 +------
     test/testpipe.c    | 7 +------
     test/testpoll.c    | 7 +------
     test/testproc.c    | 7 +------
     test/testsock.c    | 7 +------
     test/testsockopt.c | 7 +------
     test/teststr.c     | 7 +------
     17 files changed, 17 insertions(+), 102 deletions(-)
    
    diff --git a/test/client.c b/test/client.c
    index 7f95d5ba2ad..71767b11546 100644
    --- a/test/client.c
    +++ b/test/client.c
    @@ -60,11 +60,6 @@
     
     #define STRLEN 15
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     int main(int argc, char *argv[])
     {
         apr_pool_t *context;
    @@ -95,7 +90,7 @@ int main(int argc, char *argv[])
             exit(-1);
         }
         fprintf(stdout, "OK\n");
    -    atexit(closeapr);
    +    atexit(apr_terminate);
     
         fprintf(stdout, "Creating context.......");
         if (apr_pool_create(&context, NULL) != APR_SUCCESS) {
    diff --git a/test/sendfile.c b/test/sendfile.c
    index b8e44ee06f2..d333e1657ea 100644
    --- a/test/sendfile.c
    +++ b/test/sendfile.c
    @@ -90,11 +90,6 @@ int main(void)
     
     typedef enum {BLK, NONBLK, TIMEOUT} client_socket_mode_t;
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family)
     {
         char buf[120];
    @@ -108,7 +103,7 @@ static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family)
             exit(1);
         }
     
    -    atexit(closeapr);
    +    atexit(apr_terminate);
     
         rv = apr_pool_create(p, NULL);
         if (rv != APR_SUCCESS) {
    diff --git a/test/server.c b/test/server.c
    index 69de39867d4..4c5087b8b78 100644
    --- a/test/server.c
    +++ b/test/server.c
    @@ -60,11 +60,6 @@
     
     #define STRLEN 15
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     int main(int argc, const char * const argv[])
     {
         apr_pool_t *context;
    @@ -92,7 +87,7 @@ int main(int argc, const char * const argv[])
             exit(-1);
         }
         fprintf(stdout, "OK\n");
    -    atexit(closeapr);
    +    atexit(apr_terminate);
     
         fprintf(stdout, "Creating context.......");
         if (apr_pool_create(&context, NULL) != APR_SUCCESS) {
    diff --git a/test/testargs.c b/test/testargs.c
    index 8a7cc825df9..a5f6593a583 100644
    --- a/test/testargs.c
    +++ b/test/testargs.c
    @@ -73,11 +73,6 @@ static void maybe_arg(const char *arg)
         }
     }
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     int main(int argc, const char * const argv[])
     {
         apr_pool_t *context;
    @@ -86,7 +81,7 @@ int main(int argc, const char * const argv[])
         const char *optarg;
     
         apr_initialize();
    -    atexit(closeapr);
    +    atexit(apr_terminate);
         apr_pool_create(&context, NULL);
     
         if (apr_getopt_init(&opt, context, argc, argv))
    diff --git a/test/testcontext.c b/test/testcontext.c
    index dbaf880bb25..18688123e1f 100644
    --- a/test/testcontext.c
    +++ b/test/testcontext.c
    @@ -68,11 +68,6 @@ static apr_status_t string_cleanup(void *data)
         return APR_SUCCESS;
     }
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     int main(void)
     {
         apr_pool_t *context;
    @@ -83,7 +78,7 @@ int main(void)
             fprintf(stderr, "Couldn't initialize.");
             exit(-1);
         }
    -    atexit(closeapr);
    +    atexit(apr_terminate);
     
         if (apr_pool_create(&context, NULL) != APR_SUCCESS) {
             fprintf(stderr, "Couldn't allocate context.");
    diff --git a/test/testdso.c b/test/testdso.c
    index 160fad15d7c..4283475970e 100644
    --- a/test/testdso.c
    +++ b/test/testdso.c
    @@ -11,11 +11,6 @@
     
     #define LIB_NAME "mod_test.so"
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     int main (int argc, char ** argv)
     {
         apr_dso_handle_t *h = NULL;
    @@ -33,7 +28,7 @@ int main (int argc, char ** argv)
         strcat(filename, LIB_NAME);
     
         apr_initialize();
    -    atexit(closeapr);
    +    atexit(apr_terminate);
             
         if (apr_pool_create(&cont, NULL) != APR_SUCCESS) {
             fprintf(stderr, "Couldn't allocate context.");
    diff --git a/test/testfile.c b/test/testfile.c
    index be2c8d6da99..8f8bae3958f 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -89,11 +89,6 @@ void test_filedel(apr_pool_t *);
     void testdirs(apr_pool_t *);
     static void test_read(apr_pool_t *);
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     int main(void)
     {
         apr_pool_t *pool;
    @@ -118,7 +113,7 @@ int main(void)
         printf("APR File Functions Test\n=======================\n\n");
         
         STD_TEST_NEQ("Initializing APR", apr_initialize())
    -    atexit(closeapr);
    +    atexit(apr_terminate);
         STD_TEST_NEQ("Creating the main pool we'll use", 
                      apr_pool_create(&pool, NULL))
         STD_TEST_NEQ("Creating the second pool we'll use", 
    diff --git a/test/testflock.c b/test/testflock.c
    index 74d46c5f0c7..e102714b131 100644
    --- a/test/testflock.c
    +++ b/test/testflock.c
    @@ -154,11 +154,6 @@ static void do_write(void)
         printf(" done.\nExiting.\n");
     }
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     int main(int argc, const char * const *argv)
     {
         int reader = 0;
    @@ -169,7 +164,7 @@ int main(int argc, const char * const *argv)
     
         if (apr_initialize() != APR_SUCCESS)
             errmsg("Could not initialize APR.\n");
    -    atexit(closeapr);
    +    atexit(apr_terminate);
     
         if (apr_pool_create(&pool, NULL) != APR_SUCCESS)
             errmsg("Could not create global pool.\n");
    diff --git a/test/testipsub.c b/test/testipsub.c
    index 3390d9aabd3..68510167f14 100644
    --- a/test/testipsub.c
    +++ b/test/testipsub.c
    @@ -59,11 +59,6 @@
     #include "apr_network_io.h"
     #include "apr_errno.h"
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     static void test_bad_input(apr_pool_t *p)
     {
         struct {
    @@ -202,7 +197,7 @@ int main(void)
             exit(1);
         }
     
    -    atexit(closeapr);
    +    atexit(apr_terminate);
     
         rv = apr_pool_create(&p, NULL);
         if (rv != APR_SUCCESS) {
    diff --git a/test/testmd5.c b/test/testmd5.c
    index ae737269ad3..84735ca6adb 100644
    --- a/test/testmd5.c
    +++ b/test/testmd5.c
    @@ -86,11 +86,6 @@ struct testcase testcases[] =
          "\xd1\xa1\xc0\x97\x8a\x60\xbb\xfb\x2a\x25\x46\x9d\xa5\xae\xd0\xb0"}
     };
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     static void try(const void *buf, size_t bufLen, apr_xlate_t *xlate,
                     const void *digest)
     {
    @@ -159,7 +154,7 @@ int main(int argc, char **argv)
     
         rv = apr_initialize();
         assert(!rv);
    -    atexit(closeapr);
    +    atexit(apr_terminate);
     
         printf("APR MD5 Test\n============\n\n");
         STD_TEST_NEQ("Creating pool", apr_pool_create(&pool, NULL))
    diff --git a/test/testmmap.c b/test/testmmap.c
    index 8a4cc8bbdcf..eaf53e89ae1 100644
    --- a/test/testmmap.c
    +++ b/test/testmmap.c
    @@ -69,11 +69,6 @@
      */
     #define PATH_LEN 255
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     int main(void)
     {
     #if APR_HAS_MMAP    
    @@ -94,7 +89,7 @@ int main(void)
             exit(-1);
         }
         fprintf(stdout,"OK\n");
    -    atexit(closeapr);
    +    atexit(apr_terminate);
     
         fprintf(stdout,"Creating context....................");    
         if (apr_pool_create(&context, NULL) != APR_SUCCESS) {
    diff --git a/test/testpipe.c b/test/testpipe.c
    index 991abe8302a..98659c26aac 100644
    --- a/test/testpipe.c
    +++ b/test/testpipe.c
    @@ -62,11 +62,6 @@
     #include 
     #endif
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     int main(void)
     {
         apr_pool_t *context;
    @@ -81,7 +76,7 @@ int main(void)
             fprintf(stderr, "Couldn't initialize.");
             exit(-1);
         }
    -    atexit(closeapr);
    +    atexit(apr_terminate);
         if (apr_pool_create(&context, NULL) != APR_SUCCESS) {
             fprintf(stderr, "Couldn't allocate context.");
             exit(-1);
    diff --git a/test/testpoll.c b/test/testpoll.c
    index cd4d1612ba1..510d2c33bf7 100644
    --- a/test/testpoll.c
    +++ b/test/testpoll.c
    @@ -64,11 +64,6 @@
     #include 
     #include 
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     static int make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, apr_port_t port,
                     apr_pool_t *p)
     {
    @@ -160,7 +155,7 @@ int main(void)
             exit(-1);
         }
         printf("OK\n");
    -    atexit(closeapr);
    +    atexit(apr_terminate);
     
         printf("Creating context...............................");    
         if (apr_pool_create(&context, NULL) != APR_SUCCESS) {
    diff --git a/test/testproc.c b/test/testproc.c
    index f27e88297b0..a5edf821189 100644
    --- a/test/testproc.c
    +++ b/test/testproc.c
    @@ -70,11 +70,6 @@
     int test_filedel(void);
     int testdirs(void);
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     int main(int argc, char *argv[])
     {
         apr_pool_t *pool;
    @@ -90,7 +85,7 @@ int main(int argc, char *argv[])
             printf("Failed to initialize APR\n");
             exit(-1);
         }   
    -    atexit(closeapr);
    +    atexit(apr_terminate);
         apr_pool_create(&pool, NULL);
     
         if (argc > 1) {
    diff --git a/test/testsock.c b/test/testsock.c
    index 1fe21bc6633..38237a56464 100644
    --- a/test/testsock.c
    +++ b/test/testsock.c
    @@ -181,11 +181,6 @@ static int run_sendfile(apr_pool_t *context, int number)
         return 1;
     }
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     int main(int argc, char *argv[])
     {
         apr_pool_t *context = NULL;
    @@ -196,7 +191,7 @@ int main(int argc, char *argv[])
             exit(-1);
         }
         fprintf(stdout, "OK\n");
    -    atexit(closeapr);
    +    atexit(apr_terminate);
     
         fprintf(stdout, "Creating context.......");
         if (apr_pool_create(&context, NULL) != APR_SUCCESS) {
    diff --git a/test/testsockopt.c b/test/testsockopt.c
    index 54fe6cc552d..f0b9641bf8f 100644
    --- a/test/testsockopt.c
    +++ b/test/testsockopt.c
    @@ -78,11 +78,6 @@ static void failureno(apr_socket_t *sock)
         exit(-1);
     }
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     int main(void)
     {
         apr_pool_t *context;
    @@ -95,7 +90,7 @@ int main(void)
             fprintf(stderr, "Couldn't initialize.");
             exit(-1);
         }
    -    atexit(closeapr);
    +    atexit(apr_terminate);
         if (apr_pool_create(&context, NULL) != APR_SUCCESS) {
             fprintf(stderr, "Couldn't allocate context.");
             exit(-1);
    diff --git a/test/teststr.c b/test/teststr.c
    index 64ec7b144c6..c6bf416c526 100644
    --- a/test/teststr.c
    +++ b/test/teststr.c
    @@ -59,11 +59,6 @@
     #include "apr_general.h"
     #include "apr_strings.h"
     
    -static void closeapr(void)
    -{
    -    apr_terminate();
    -}
    -
     static void test_strtok(apr_pool_t *p)
     {
         struct {
    @@ -129,7 +124,7 @@ int main(int argc, const char * const argv[])
         apr_pool_t *p;
     
         apr_initialize();
    -    atexit(closeapr);
    +    atexit(apr_terminate);
         apr_pool_create(&p, NULL);
     
         test_strtok(p);
    
    From d7717d8efae0bf94ad6dd0039df0371d81af2729 Mon Sep 17 00:00:00 2001
    From: "Victor J. Orlikowski" 
    Date: Sat, 9 Jun 2001 04:19:54 +0000
    Subject: [PATCH 1744/7878] Put some declarations in the right order, for
     detection's sake.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61736 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_time.h | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/include/apr_time.h b/include/apr_time.h
    index 328a1bf29b5..cf4fab0ad5b 100644
    --- a/include/apr_time.h
    +++ b/include/apr_time.h
    @@ -67,8 +67,8 @@ extern "C" {
      * @package APR Time library
      */
     
    -extern APR_DECLARE_DATA const char apr_month_snames[12][4];
    -extern APR_DECLARE_DATA const char apr_day_snames[7][4];
    +APR_DECLARE_DATA extern const char apr_month_snames[12][4];
    +APR_DECLARE_DATA extern char apr_day_snames[7][4];
     
     
     /* number of microseconds since 00:00:00 january 1, 1970 UTC */
    
    From b5c6a17e7a4a136731e55ecf5ee814319ce43390 Mon Sep 17 00:00:00 2001
    From: "Victor J. Orlikowski" 
    Date: Sat, 9 Jun 2001 06:43:44 +0000
    Subject: [PATCH 1745/7878] Revert this change, as it breaks the build.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61737 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_time.h | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/include/apr_time.h b/include/apr_time.h
    index cf4fab0ad5b..b5606c6e237 100644
    --- a/include/apr_time.h
    +++ b/include/apr_time.h
    @@ -67,8 +67,8 @@ extern "C" {
      * @package APR Time library
      */
     
    -APR_DECLARE_DATA extern const char apr_month_snames[12][4];
    -APR_DECLARE_DATA extern char apr_day_snames[7][4];
    +extern APR_DECLARE_DATA const char apr_month_snames[12][4];
    +extern APR_DECLARE_DATA char apr_day_snames[7][4];
     
     
     /* number of microseconds since 00:00:00 january 1, 1970 UTC */
    
    From 73ccbde855dba0afdf6ba5463e9c87aa68d9d4d7 Mon Sep 17 00:00:00 2001
    From: "Victor J. Orlikowski" 
    Date: Sat, 9 Jun 2001 06:54:33 +0000
    Subject: [PATCH 1746/7878] Lack of sleep makes Victor the village idiot.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61738 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_time.h | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/include/apr_time.h b/include/apr_time.h
    index b5606c6e237..9e70fe0506a 100644
    --- a/include/apr_time.h
    +++ b/include/apr_time.h
    @@ -67,8 +67,8 @@ extern "C" {
      * @package APR Time library
      */
     
    -extern APR_DECLARE_DATA const char apr_month_snames[12][4];
    -extern APR_DECLARE_DATA char apr_day_snames[7][4];
    +APR_DECLARE_DATA extern const char apr_month_snames[12][4];
    +APR_DECLARE_DATA extern const char apr_day_snames[7][4];
     
     
     /* number of microseconds since 00:00:00 january 1, 1970 UTC */
    
    From 358b01e6057b78a6036a973d1d44e1650082ea7f Mon Sep 17 00:00:00 2001
    From: "Victor J. Orlikowski" 
    Date: Sat, 9 Jun 2001 11:33:07 +0000
    Subject: [PATCH 1747/7878] Updating docs to change around the order of extern
     and AP[RU]_DECLARE_DATA. If this is incorrect, please yell. However, the vast
     majority of the code follows the convention documented in this patch. If this
     is in error, I will gladly back it out.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61739 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr.h.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr.h.in b/include/apr.h.in
    index 0ce684ad1f4..cad4c09d816 100644
    --- a/include/apr.h.in
    +++ b/include/apr.h.in
    @@ -217,7 +217,7 @@ typedef  @socklen_t_value@       apr_socklen_t;
      * This assures the appropriate indirection is invoked at compile time.
      *
      * @deffunc APR_DECLARE_DATA type apr_variable;
    - * @tip extern APR_DECLARE_DATA type apr_variable; syntax is required for
    + * @tip APR_DECLARE_DATA extern type apr_variable; syntax is required for
      * declarations within headers to properly import the variable.
      */
     #define APR_DECLARE_DATA
    
    From 155ff7f6b4b176e8e9ba10cf793173aa54ef3453 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 10 Jun 2001 00:34:32 +0000
    Subject: [PATCH 1748/7878]   After some careful review, this compiler warning
     can be done away with   on win32, since it serves no purpose on this
     platform.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61740 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/win32/sockets.c | 6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c
    index dff1cd78072..5a567eb27dc 100644
    --- a/network_io/win32/sockets.c
    +++ b/network_io/win32/sockets.c
    @@ -290,7 +290,11 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
             /* wait for the connect to complete */
             FD_ZERO(&temp);
             FD_SET(sock->sock, &temp);
    -        if (select(sock->sock+1, NULL, &temp, NULL, NULL) == SOCKET_ERROR) {
    +        /* the select(nfds, ...) nfds arg is ignored 
    +         * we don't have a bit table for fd_set on Win32,
    +         * we have a messy dynamic crossref table.
    +         */
    +        if (select(FD_SETSIZE+1, NULL, &temp, NULL, NULL) == SOCKET_ERROR) {
                 return apr_get_netos_error();
             }
         }
    
    From b4d554bcf63a5500470cfe2260f0ce997aa9a4fb Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 10 Jun 2001 14:37:38 +0000
    Subject: [PATCH 1749/7878] Fix the cleanup logic.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61741 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms.c | 12 +++++-------
     1 file changed, 5 insertions(+), 7 deletions(-)
    
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index f3e2ed30162..c8cd59a42df 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -578,28 +578,26 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys,
         cleanup = mem_sys->cleanups;
         cleanup_ref = &mem_sys->cleanups;
         while (cleanup) {
    -        if ((type == 0 || cleanup->cleanup_fn == cleanup_fn) &&
    +        if ((type == 0 || cleanup->type == type) &&
                 cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) {
                 *cleanup_ref = cleanup->next;
     
    -            apr_lock_release(mem_sys->sms_lock);
    -            
                 mem_sys = mem_sys->accounting_mem_sys;
     
                 if (mem_sys->free_fn)
                     apr_sms_free(mem_sys, cleanup);
     
                 rv = APR_SUCCESS;
    +        } else {
    +            cleanup_ref = &cleanup->next;
    +            cleanup = cleanup->next;
             }
    -
    -        cleanup_ref = &cleanup->next;
    -        cleanup = cleanup->next;
         }
     
         apr_lock_release(mem_sys->sms_lock);
     
         /* The cleanup function must have been registered previously */
    -    return APR_EINVAL;
    +    return rv;
     }
     
     APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys, 
    
    From d80c345b7ceb45ac6f808e1295cd609d2e0cc405 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 10 Jun 2001 14:45:32 +0000
    Subject: [PATCH 1750/7878] Renaming of sms to use shorter names, no functional
     change.
    
    mem_sys => sms
    parent_mem_sys => parent
    child_mem_sys => child
    ref_mem_sys => ref
    accounting_mem_sys => accounting
    sibling_mem_sys => sibling
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61742 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_sms.h              | 132 +++++++--------
     memory/unix/apr_sms.c          | 294 ++++++++++++++++-----------------
     memory/unix/apr_sms_std.c      |  34 ++--
     memory/unix/apr_sms_tracking.c |  48 +++---
     4 files changed, 254 insertions(+), 254 deletions(-)
    
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index 03bcb56f04e..6767ad815c9 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -89,11 +89,11 @@ typedef struct apr_sms_t    apr_sms_t;
      */
     struct apr_sms_t
     {
    -    apr_sms_t  *parent_mem_sys;
    -    apr_sms_t  *child_mem_sys;
    -    apr_sms_t  *sibling_mem_sys;
    -    apr_sms_t **ref_mem_sys;
    -    apr_sms_t  *accounting_mem_sys;
    +    apr_sms_t  *parent;
    +    apr_sms_t  *child;
    +    apr_sms_t  *sibling;
    +    apr_sms_t **ref;
    +    apr_sms_t  *accounting;
         const char *identity; /* a string identifying the module */
     
         apr_pool_t *pool;
    @@ -101,16 +101,16 @@ struct apr_sms_t
         
         struct apr_sms_cleanup *cleanups;
     
    -    void * (*malloc_fn)            (apr_sms_t *mem_sys, apr_size_t size);
    -    void * (*calloc_fn)            (apr_sms_t *mem_sys, apr_size_t size);
    -    void * (*realloc_fn)           (apr_sms_t *mem_sys, void *memory, 
    +    void * (*malloc_fn)            (apr_sms_t *sms, apr_size_t size);
    +    void * (*calloc_fn)            (apr_sms_t *sms, apr_size_t size);
    +    void * (*realloc_fn)           (apr_sms_t *sms, void *memory, 
                                         apr_size_t size);
    -    apr_status_t (*free_fn)        (apr_sms_t *mem_sys, void *memory);
    -    apr_status_t (*reset_fn)       (apr_sms_t *mem_sys);
    -    apr_status_t (*pre_destroy_fn) (apr_sms_t *mem_sys);
    -    apr_status_t (*destroy_fn)     (apr_sms_t *mem_sys);
    -    apr_status_t (*lock_fn)        (apr_sms_t *mem_sys);
    -    apr_status_t (*unlock_fn)      (apr_sms_t *mem_sys);
    +    apr_status_t (*free_fn)        (apr_sms_t *sms, void *memory);
    +    apr_status_t (*reset_fn)       (apr_sms_t *sms);
    +    apr_status_t (*pre_destroy_fn) (apr_sms_t *sms);
    +    apr_status_t (*destroy_fn)     (apr_sms_t *sms);
    +    apr_status_t (*lock_fn)        (apr_sms_t *sms);
    +    apr_status_t (*unlock_fn)      (apr_sms_t *sms);
     };
     
     /*
    @@ -119,46 +119,46 @@ struct apr_sms_t
     
     /**
      * Allocate a block of memory using a certain memory system
    - * @param mem_sys The memory system to use
    + * @param sms The memory system to use
      * @param size The (minimal required) size of the block to be allocated
      * @return pointer to a newly allocated block of memory, NULL if insufficient
      *         memory available
    - * @deffunc void *apr_sms_malloc(apr_sms_t *mem_sys, apr_size_t size)
    + * @deffunc void *apr_sms_malloc(apr_sms_t *sms, apr_size_t size)
      */
    -APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *mem_sys, apr_size_t size);
    +APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *sms, apr_size_t size);
     
     /**
      * Allocate a block of zeroed memory using a certain memory system
    - * @param mem_sys The memory system to use
    + * @param sms The memory system to use
      * @param size The (minimal required) size of the block to be allocated
      * @return pointer to a newly allocated block of memory, NULL if insufficient
      *         memory available
    - * @deffunc void *apr_sms_calloc(apr_sms_t *mem_sys, apr_size_t size)
    + * @deffunc void *apr_sms_calloc(apr_sms_t *sms, apr_size_t size)
      */
    -APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *mem_sys, apr_size_t size);
    +APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *sms, apr_size_t size);
     
     /**
      * Change the size of a previously allocated block of memory
    - * @param mem_sys The memory system to use (should be the same as the
    + * @param sms The memory system to use (should be the same as the
      *        one that returned the block)
      * @param mem Pointer to the previously allocated block. If NULL, this
      *        function acts like apr_sms_malloc.
      * @param size The (minimal required) size of the block to be allocated
      * @return pointer to a newly allocated block of memory, NULL if insufficient
      *         memory available
    - * @deffunc void *apr_sms_realloc(apr_sms_t *mem_sys, void *mem, apr_size_t size)
    + * @deffunc void *apr_sms_realloc(apr_sms_t *sms, void *mem, apr_size_t size)
      */
    -APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem, apr_size_t size);
    +APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *sms, void *mem, apr_size_t size);
     
     /**
      * Free a block of memory
    - * @param mem_sys The memory system to use (should be the same as the
    + * @param sms The memory system to use (should be the same as the
      *        one that returned the block)
      * @param mem The block of memory to be freed
    - * @deffunc void apr_sms_free(apr_sms_t *mem_sys,
    + * @deffunc void apr_sms_free(apr_sms_t *sms,
      *					void *mem)
      */
    -APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys, void *mem);
    +APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *sms, void *mem);
     
     /*
      * memory system functions
    @@ -170,27 +170,27 @@ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys, void *mem);
      *          to serve as a memory system structure from your 
      *          apr_xxx_sms_create. Only use this function when you are
      *          implementing a memory system.
    - * @param mem_sys The memory system created
    - * @param parent_mem_sys The parent memory system
    + * @param sms The memory system created
    + * @param parent_sms The parent memory system
      * @deffunc apr_status_t apr_sms_init(apr_sms_t *sms,
    - *				      apr_sms_t *parent_mem_sys)
    + *				      apr_sms_t *parent_sms)
      */
    -APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *mem_sys, 
    -                                       apr_sms_t *parent_mem_sys);
    +APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, 
    +                                       apr_sms_t *parent_sms);
     
     /**
      * Check if a memory system is obeying all rules. 
      * @caution Call this function as the last statement before returning a new
      *          memory system from your apr_xxx_sms_create.
    - * @deffunc void apr_sms_validate(apr_sms_t *mem_sys)
    + * @deffunc void apr_sms_validate(apr_sms_t *sms)
      */
     #ifdef APR_ASSERT_MEMORY
    -APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys);
    +APR_DECLARE(void) apr_sms_assert(apr_sms_t *sms);
     #else
     #ifdef apr_sms_assert
     #undef apr_sms_assert
     #endif
    -#define apr_sms_assert(mem_sys)
    +#define apr_sms_assert(sms)
     #endif /* APR_ASSERT_MEMORY */
     
     /**
    @@ -199,33 +199,33 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys);
      * @warning This function will fail if there is no reset function available
      *          for the given memory system (i.e. the memory system is non-
      *          tracking).
    - * @param mem_sys The memory system to be reset
    - * @deffunc apr_status_t apr_sms_reset(apr_sms_t *mem_sys)
    + * @param sms The memory system to be reset
    + * @deffunc apr_status_t apr_sms_reset(apr_sms_t *sms)
      */
    -APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys);
    +APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *sms);
     
     /**
      * Destroy a memory system, effectively freeing all of its memory, and itself. 
      * This will also run all cleanup functions associated with the memory system.
      * @caution Be carefull when using this function with a non-tracking memory
      *          system
    - * @param mem_sys The memory system to be destroyed
    - * @deffunc apr_status_t apr_sms_destroy(apr_sms_t *mem_sys)
    + * @param sms The memory system to be destroyed
    + * @deffunc apr_status_t apr_sms_destroy(apr_sms_t *sms)
      */
    -APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys);
    +APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms);
     
     /**
      * Perform thread-safe locking required whilst this memory system is modified
    - * @param mem_sys The memory system to be locked for thread-safety
    + * @param sms The memory system to be locked for thread-safety
      */
    -APR_DECLARE(apr_status_t) apr_sms_lock(apr_sms_t *mem_sys);
    +APR_DECLARE(apr_status_t) apr_sms_lock(apr_sms_t *sms);
     
     /**
      * Release thread-safe locking required whilst this memory system was
      * being modified
    - * @param mem_sys The memory system to be released from thread-safety
    + * @param sms The memory system to be released from thread-safety
      */
    -APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *mem_sys);
    +APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *sms);
     
     /**
      * Determine if memory system a is an ancestor of memory system b
    @@ -239,10 +239,10 @@ APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a, apr_sms_t *b);
     
     /** 
      * Get the memory_system identity
    - * @param mem_sys The memory system to use
    - * @deffunc const char * apr_sms_identity(apr_sms_t *mem_sys);
    + * @param sms The memory system to use
    + * @deffunc const char * apr_sms_identity(apr_sms_t *sms);
      */
    -APR_DECLARE(const char *) apr_sms_identity(apr_sms_t *mem_sys);
    +APR_DECLARE(const char *) apr_sms_identity(apr_sms_t *sms);
     
     /*
      * memory system cleanup management functions
    @@ -250,75 +250,75 @@ APR_DECLARE(const char *) apr_sms_identity(apr_sms_t *mem_sys);
     
     /**
      * Register a function to be called when a memory system is reset or destroyed
    - * @param mem_sys The memory system to register the cleanup function with
    + * @param sms The memory system to register the cleanup function with
      * @param type The type of cleanup to register
      * @param data The data to pass to the cleanup function
      * @param cleanup_fn The function to call when the memory system is reset or
      *        destroyed
    - * @deffunc void apr_sms_cleanup_register(apr_sms_t *mem_sys, apr_int32_t type,
    + * @deffunc void apr_sms_cleanup_register(apr_sms_t *sms, apr_int32_t type,
      *		   void *data, apr_status_t (*cleanup_fn)(void *));
      */
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys, apr_int32_t type,
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms, apr_int32_t type,
                                                        void *data, 
                                                        apr_status_t (*cleanup_fn)(void *));
     
     /**
      * Unregister a previously registered cleanup function
    - * @param mem_sys The memory system the cleanup function is registered
    + * @param sms The memory system the cleanup function is registered
      *        with
      * @param type The type of the cleanup to unregister
      * @param data The data associated with the cleanup function
      * @param cleanup_fn The registered cleanup function
    - * @deffunc void apr_sms_cleanup_unregister(apr_sms_t *mem_sys,
    + * @deffunc void apr_sms_cleanup_unregister(apr_sms_t *sms,
      *		   void *data, apr_status_t (*cleanup_fn)(void *));
      */
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys, apr_int32_t type,
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms, apr_int32_t type,
                                                          void *data,
                                                          apr_status_t (*cleanup)(void *));
     
     /**
      * Unregister all previously registered cleanup functions of the specified type
    - * @param mem_sys The memory system the cleanup functions are registered with
    + * @param sms The memory system the cleanup functions are registered with
      * @param type The type associated with the cleanup function. Pass 0 to 
      *        unregister all cleanup functions.
    - * @deffunc apr_status_t apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys,
    + * @deffunc apr_status_t apr_sms_cleanup_unregister_type(apr_sms_t *sms,
      *                 apr_int32_t type);
      */
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys,
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *sms,
                                                                apr_int32_t type);
     
     /**
      * Run the specified cleanup function immediately and unregister it
    - * @param mem_sys The memory system the cleanup function is registered
    + * @param sms The memory system the cleanup function is registered
      *        with
    - * @param mem_sys The memory system the cleanup function is registered with
    + * @param sms The memory system the cleanup function is registered with
      * @param type The type associated with the cleanup function. Pass 0 to ignore type.
      * @param data The data associated with the cleanup function
      * @param cleanup The registered cleanup function
    - * @deffunc apr_status_t apr_sms_cleanup_run(apr_sms_t *mem_sys, 
    + * @deffunc apr_status_t apr_sms_cleanup_run(apr_sms_t *sms, 
      *                 apr_int32_t type, void *data, apr_status_t (*cleanup)(void *));
      */
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *mem_sys, 
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms, 
                                                   apr_int32_t type, void *data,
                                                   apr_status_t (*cleanup)(void *));
     
     /**
      * Run the specified type of cleanup functions immediately and unregister them
    - * @param mem_sys The memory system the cleanup functions are registered with
    + * @param sms The memory system the cleanup functions are registered with
      * @param type The category of cleanup functions to run. Pass 0 to run all
      *        cleanup functions.
    - * @deffunc apr_status_t apr_sms_cleanup_run_type(apr_sms_t *mem_sys,
    + * @deffunc apr_status_t apr_sms_cleanup_run_type(apr_sms_t *sms,
      *	           apr_int32_t type);
      */
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *mem_sys, 
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, 
                                                        apr_int32_t type);
     
     /**
      * Create a standard malloc/realloc/free memory system
    - * @param mem_sys A pointer to the created apr_sms_t*
    - * @deffunc apr_status_t apr_sms_std_create(apr_sms_t **mem_sys);
    + * @param sms A pointer to the created apr_sms_t*
    + * @deffunc apr_status_t apr_sms_std_create(apr_sms_t **sms);
      */
    -APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys);
    +APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms);
     
     #ifdef __cplusplus
     }
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index c8cd59a42df..f53ff6694dc 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -88,53 +88,53 @@ struct apr_sms_cleanup
      * memory allocation functions
      */
     
    -APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *mem_sys,
    +APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *sms,
                                        apr_size_t size)
     {
         if (size == 0)
             return NULL;
     
    -    return mem_sys->malloc_fn(mem_sys, size);
    +    return sms->malloc_fn(sms, size);
     }
     
    -APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *mem_sys,
    +APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *sms,
                                        apr_size_t size)
     {
         if (size == 0)
             return NULL;
     
    -    if (!mem_sys->calloc_fn) {
    +    if (!sms->calloc_fn) {
             /* Assumption - if we don't have calloc we have
              * malloc, might be bogus...
              */
    -        void *mem = mem_sys->malloc_fn(mem_sys, size);
    +        void *mem = sms->malloc_fn(sms, size);
             memset(mem, '\0', size);
             return mem;
         }
         
    -    return mem_sys->calloc_fn(mem_sys, size);
    +    return sms->calloc_fn(sms, size);
     
     }
     
    -APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *mem_sys, void *mem,
    +APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *sms, void *mem,
                                         apr_size_t size)
     {
         if (!mem)
    -        return apr_sms_malloc(mem_sys, size);
    +        return apr_sms_malloc(sms, size);
     
         if (size == 0) {
    -        apr_sms_free(mem_sys, mem);
    +        apr_sms_free(sms, mem);
             return NULL;
         }
     
    -    return mem_sys->realloc_fn(mem_sys, mem, size);
    +    return sms->realloc_fn(sms, mem, size);
     }
     
    -APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys,
    +APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *sms,
                                            void *mem)
     {
    -    if (mem_sys->free_fn)
    -        return mem_sys->free_fn(mem_sys, mem);  
    +    if (sms->free_fn)
    +        return sms->free_fn(sms, mem);  
     
         return APR_ENOTIMPL;
     }
    @@ -143,16 +143,16 @@ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *mem_sys,
      * memory system functions
      */
     
    -static int apr_sms_is_tracking(apr_sms_t *mem_sys)
    +static int apr_sms_is_tracking(apr_sms_t *sms)
     {
         /*
          * The presense of a reset function gives us the clue that this is a 
          * tracking memory system.
          */
    -    return mem_sys->reset_fn != NULL;
    +    return sms->reset_fn != NULL;
     }
     
    -APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *mem_sys, 
    +APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, 
                                            apr_sms_t *pms)
     {
         /* XXX - I've assumed that memory passed in will be zeroed,
    @@ -163,9 +163,9 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *mem_sys,
          * an assumption to make as it sounds :)
          */
     
    -    mem_sys->parent_mem_sys = pms;
    -    mem_sys->accounting_mem_sys = mem_sys;
    -    mem_sys->child_mem_sys = NULL;
    +    sms->parent = pms;
    +    sms->accounting = sms;
    +    sms->child = NULL;
     
         /*
          * Child memory systems are always linked to their parents.  This works
    @@ -192,34 +192,34 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *mem_sys,
              */
             apr_lock_acquire(pms->sms_lock);
             
    -        if ((mem_sys->sibling_mem_sys = pms->child_mem_sys) != NULL)
    -            mem_sys->sibling_mem_sys->ref_mem_sys = &mem_sys->sibling_mem_sys;
    +        if ((sms->sibling = pms->child) != NULL)
    +            sms->sibling->ref = &sms->sibling;
     
    -        mem_sys->ref_mem_sys = &pms->child_mem_sys;
    -        pms->child_mem_sys = mem_sys;
    +        sms->ref = &pms->child;
    +        pms->child = sms;
     
             apr_lock_release(pms->sms_lock);    
         }
     
         /* XXX - This should eventually be removed */
    -    apr_pool_create(&mem_sys->pool, pms ? pms->pool : NULL);
    +    apr_pool_create(&sms->pool, pms ? pms->pool : NULL);
         
         /* Create the lock we'll use to protect cleanups and child lists */
    -    apr_lock_create(&mem_sys->sms_lock, APR_MUTEX, APR_LOCKALL, NULL,
    -                    mem_sys->pool);
    +    apr_lock_create(&sms->sms_lock, APR_MUTEX, APR_LOCKALL, NULL,
    +                    sms->pool);
                             
         return APR_SUCCESS;
     }
     
     #ifdef APR_ASSERT_MEMORY
    -APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
    +APR_DECLARE(void) apr_sms_assert(apr_sms_t *sms)
     {
         apr_sms_t *parent;
     
         /*
          * A memory system without a malloc won't do us much good
          */
    -    assert(mem_sys->malloc_fn);
    +    assert(sms->malloc_fn);
     
         /* 
          * Check to see if this is either a non-tracking or
    @@ -227,19 +227,19 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
          * or destroy function. And to avoid half implementations
          * we require reset to be present when destroy is.
          */
    -    assert(mem_sys->free_fn || (mem_sys->destroy_fn && mem_sys->reset_fn));
    +    assert(sms->free_fn || (sms->destroy_fn && sms->reset_fn));
     
    -    assert(!mem_sys->destroy_fn || mem_sys->reset_fn);
    +    assert(!sms->destroy_fn || sms->reset_fn);
       
    -    assert(!mem_sys->reset_fn || mem_sys->destroy_fn);
    +    assert(!sms->reset_fn || sms->destroy_fn);
     
         /*
          * Make sure all accounting memory dies with the memory system.
          * To be more specific, make sure the accounting memort system
          * is either the memory system itself or a direct child.
          */
    -    assert(mem_sys->accounting_mem_sys == mem_sys ||
    -           mem_sys->accounting_mem_sys->parent_mem_sys == mem_sys);
    +    assert(sms->accounting == sms ||
    +           sms->accounting->parent == sms);
     
         /*
          * A non-tracking memory system can be the child of
    @@ -247,15 +247,15 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
          * tracking ancestors, but in that specific case we issue a
          * warning.
          */
    -    if (!mem_sys->parent_mem_sys)
    +    if (!sms->parent)
             return;
     
    -    parent = mem_sys;
    +    parent = sms;
         while (parent) {
             if (apr_sms_is_tracking(parent))
                 return; /* Tracking memory system found, return satisfied ;-) */
     
    -        parent = parent->parent_mem_sys;
    +        parent = parent->parent;
         }
     
         /* issue a warning: 
    @@ -273,11 +273,11 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *mem_sys)
      *
      * Call all the cleanup routines registered with a memory system.
      */
    -static void apr_sms_do_cleanups(apr_sms_t *mem_sys)
    +static void apr_sms_do_cleanups(apr_sms_t *sms)
     {
         struct apr_sms_cleanup *cleanup;
     
    -    cleanup = mem_sys->cleanups;
    +    cleanup = sms->cleanups;
         while (cleanup) {
             cleanup->cleanup_fn(cleanup->data);
             cleanup = cleanup->next;
    @@ -291,44 +291,44 @@ static void apr_sms_do_cleanups(apr_sms_t *mem_sys)
      *
      * This not only calls do_cleanups, but also calls the pre_destroy(!)
      */
    -static void apr_sms_do_child_cleanups(apr_sms_t *mem_sys)
    +static void apr_sms_do_child_cleanups(apr_sms_t *sms)
     {
    -    if (!mem_sys)
    +    if (!sms)
             return;
     
    -    mem_sys = mem_sys->child_mem_sys;
    -    while (mem_sys) {
    -        apr_sms_do_child_cleanups(mem_sys);
    -        apr_sms_do_cleanups(mem_sys);
    +    sms = sms->child;
    +    while (sms) {
    +        apr_sms_do_child_cleanups(sms);
    +        apr_sms_do_cleanups(sms);
     
    -        if (mem_sys->pre_destroy_fn != NULL)
    -            mem_sys->pre_destroy_fn(mem_sys);
    +        if (sms->pre_destroy_fn != NULL)
    +            sms->pre_destroy_fn(sms);
     
    -        mem_sys = mem_sys->sibling_mem_sys;
    +        sms = sms->sibling;
         }
     }
     
    -APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys)
    +APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *sms)
     {
         apr_status_t rv;
         
    -    if (!mem_sys->reset_fn)
    +    if (!sms->reset_fn)
             return APR_ENOTIMPL;
     
    -    apr_lock_acquire(mem_sys->sms_lock);
    +    apr_lock_acquire(sms->sms_lock);
         
         /* 
          * Run the cleanups of all child memory systems _including_
          * the accounting memory system.
          */
    -    apr_sms_do_child_cleanups(mem_sys);
    +    apr_sms_do_child_cleanups(sms);
     
         /* Run all cleanups, the memory will be freed by the reset */
    -    apr_sms_do_cleanups(mem_sys);
    -    mem_sys->cleanups = NULL;
    +    apr_sms_do_cleanups(sms);
    +    sms->cleanups = NULL;
     
         /* We don't have any child memory systems after the reset */
    -    mem_sys->child_mem_sys = NULL;
    +    sms->child = NULL;
     
         /* Reset the accounting memory system to ourselves, any
          * child memory system _including_ the accounting memory
    @@ -336,152 +336,152 @@ APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *mem_sys)
          * strikerXXX: Maybe this should be the responsibility of
          *             the reset function(?).
          */
    -    mem_sys->accounting_mem_sys = mem_sys;
    +    sms->accounting = sms;
     
         /* Let the memory system handle the actual reset */
    -    rv = mem_sys->reset_fn(mem_sys);
    +    rv = sms->reset_fn(sms);
     
    -    apr_lock_release(mem_sys->sms_lock);
    +    apr_lock_release(sms->sms_lock);
         
         return rv;
     }
     
    -APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *mem_sys)
    +APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms)
     {
    -    apr_sms_t *child_mem_sys;
    -    apr_sms_t *sibling_mem_sys;
    +    apr_sms_t *child;
    +    apr_sms_t *sibling;
         apr_sms_t *pms;
         struct apr_sms_cleanup *cleanup;
         struct apr_sms_cleanup *next_cleanup;
     
    -    apr_lock_acquire(mem_sys->sms_lock);
    +    apr_lock_acquire(sms->sms_lock);
         
    -    if (apr_sms_is_tracking(mem_sys)) {
    +    if (apr_sms_is_tracking(sms)) {
             /* 
              * Run the cleanups of all child memory systems _including_
              * the accounting memory system.
              */
    -        apr_sms_do_child_cleanups(mem_sys);
    +        apr_sms_do_child_cleanups(sms);
     
             /* Run all cleanups, the memory will be freed by the destroy */
    -        apr_sms_do_cleanups(mem_sys);
    +        apr_sms_do_cleanups(sms);
         }
         else {
    -        if (mem_sys->accounting_mem_sys != mem_sys) {
    -            child_mem_sys = mem_sys->accounting_mem_sys;
    +        if (sms->accounting != sms) {
    +            child = sms->accounting;
                 
                 /* 
                  * Remove the accounting memory system from the memory systems 
                  * child list (we will explicitly destroy it later in this block).
                  */
    -            if (child_mem_sys->sibling_mem_sys != NULL)
    -                child_mem_sys->sibling_mem_sys->ref_mem_sys =
    -                    child_mem_sys->ref_mem_sys;
    +            if (child->sibling != NULL)
    +                child->sibling->ref =
    +                    child->ref;
     
    -            *child_mem_sys->ref_mem_sys = child_mem_sys->sibling_mem_sys;
    +            *child->ref = child->sibling;
     
                 /* Set this fields so destroy will work */
    -            child_mem_sys->ref_mem_sys = NULL;
    -            child_mem_sys->sibling_mem_sys = NULL;
    +            child->ref = NULL;
    +            child->sibling = NULL;
             }
     
             /* Visit all children and destroy them */
    -        child_mem_sys = mem_sys->child_mem_sys;
    +        child = sms->child;
     
    -        while (child_mem_sys) {
    -            sibling_mem_sys = child_mem_sys->sibling_mem_sys;
    -            apr_sms_destroy(child_mem_sys);
    -            child_mem_sys = sibling_mem_sys;
    +        while (child) {
    +            sibling = child->sibling;
    +            apr_sms_destroy(child);
    +            child = sibling;
             }
     
             /*
              * If the accounting memory system _is_ tracking, we also know that
              * it is not the memory system itself.
              */
    -        if (apr_sms_is_tracking(mem_sys->accounting_mem_sys)) {
    +        if (apr_sms_is_tracking(sms->accounting)) {
                 /* 
                  * Run all cleanups, the memory will be freed by the destroying
                  * of the accounting memory system.
                  */
    -            apr_sms_do_cleanups(mem_sys);
    +            apr_sms_do_cleanups(sms);
     
                 /* Destroy the accounting memory system */
    -            apr_sms_destroy(mem_sys->accounting_mem_sys);
    +            apr_sms_destroy(sms->accounting);
     
                 /* 
                  * Set the accounting memory system back to the parent memory
                  * system just in case...
                  */
    -            mem_sys->accounting_mem_sys = mem_sys;
    +            sms->accounting = sms;
             }
             else {
                 /* Run all cleanups, free'ing memory as we go */
    -            cleanup = mem_sys->cleanups;
    +            cleanup = sms->cleanups;
     
                 while (cleanup) {
                     cleanup->cleanup_fn(cleanup->data);
                     next_cleanup = cleanup->next;
    -                apr_sms_free(mem_sys->accounting_mem_sys, cleanup);
    +                apr_sms_free(sms->accounting, cleanup);
                     cleanup = next_cleanup;
                 }
     
    -            if (mem_sys->accounting_mem_sys != mem_sys) {
    +            if (sms->accounting != sms) {
                     /* Destroy the accounting memory system */
    -                apr_sms_destroy(mem_sys->accounting_mem_sys);
    +                apr_sms_destroy(sms->accounting);
                     
                     /* 
                      * Set the accounting memory system back to the parent memory
                      * system just in case...
                      */
    -                mem_sys->accounting_mem_sys = mem_sys;
    +                sms->accounting = sms;
                 }
             }
         }
     
    -    pms = mem_sys->parent_mem_sys;
    +    pms = sms->parent;
         
         /* Remove the memory system from the parent memory systems child list */
         if (pms)
             apr_lock_acquire(pms->sms_lock);
             
    -    if (mem_sys->sibling_mem_sys)
    -        mem_sys->sibling_mem_sys->ref_mem_sys = mem_sys->ref_mem_sys;
    +    if (sms->sibling)
    +        sms->sibling->ref = sms->ref;
     
    -    if (mem_sys->ref_mem_sys)
    -        *mem_sys->ref_mem_sys = mem_sys->sibling_mem_sys;
    +    if (sms->ref)
    +        *sms->ref = sms->sibling;
     
         if (pms)
             apr_lock_release(pms->sms_lock);
             
         /* Call the pre-destroy if present */
    -    if (mem_sys->pre_destroy_fn)
    -        mem_sys->pre_destroy_fn(mem_sys);
    +    if (sms->pre_destroy_fn)
    +        sms->pre_destroy_fn(sms);
     
    -    apr_lock_destroy(mem_sys->sms_lock);
    +    apr_lock_destroy(sms->sms_lock);
         
         /* XXX - This should eventually be removed */
    -    apr_pool_destroy(mem_sys->pool);
    +    apr_pool_destroy(sms->pool);
         
         /* 1 - If we have a self destruct, use it */
    -    if (mem_sys->destroy_fn)
    -        return mem_sys->destroy_fn(mem_sys);
    +    if (sms->destroy_fn)
    +        return sms->destroy_fn(sms);
     
         /* 2 - If we don't have a parent, free using ourselves */
    -    if (!mem_sys->parent_mem_sys)
    -        return mem_sys->free_fn(mem_sys, mem_sys);
    +    if (!sms->parent)
    +        return sms->free_fn(sms, sms);
     
         /* 3 - If we do have a parent and it has a free function, use it */
    -    if (mem_sys->parent_mem_sys->free_fn)
    -        return apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
    +    if (sms->parent->free_fn)
    +        return apr_sms_free(sms->parent, sms);
     
         /* 4 - Assume we are the child of a tracking memory system, do nothing */
     #ifdef APR_ASSERT_MEMORY
    -    mem_sys = mem_sys->parent_mem_sys;
    -    while (mem_sys) {
    -        if (apr_sms_is_tracking(mem_sys))
    +    sms = sms->parent;
    +    while (sms) {
    +        if (apr_sms_is_tracking(sms))
                 return APR_SUCCESS;
     
    -        mem_sys = mem_sys->parent_mem_sys;
    +        sms = sms->parent;
         }
         assert(0); /* Made the wrong assumption, so we assert */
     #endif /* APR_ASSERT_MEMORY */
    @@ -497,39 +497,39 @@ APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a,
     #endif
             
         while (b && b != a)
    -        b = b->parent_mem_sys;
    +        b = b->parent;
     
         /* APR_SUCCESS = 0, so if they agree we should return that... */
         return !(b == a); 
     }
     
    -APR_DECLARE(apr_status_t) apr_sms_lock(apr_sms_t *mem_sys)
    +APR_DECLARE(apr_status_t) apr_sms_lock(apr_sms_t *sms)
     {
         /* If we don't have a lock_fn then we probably don't need one,
          * so this is OK and we just return APR_SUCCESS
          */
    -    if (!mem_sys->lock_fn)
    +    if (!sms->lock_fn)
             return APR_SUCCESS;
     
    -    return mem_sys->lock_fn(mem_sys);
    +    return sms->lock_fn(sms);
     }
     
    -APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *mem_sys)
    +APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *sms)
     {
         /* If we don't have a lock_fn then we probably don't need one,
          * so this is OK and we just return APR_SUCCESS
          */
    -    if (!mem_sys->unlock_fn)
    +    if (!sms->unlock_fn)
             return APR_SUCCESS;
             
    -    return mem_sys->unlock_fn(mem_sys);
    +    return sms->unlock_fn(sms);
     }
     
     /*
      * memory system cleanup management functions
      */
     
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys, 
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms, 
                                                        apr_int32_t type,
                                                        void *data,
                                                        apr_status_t
    @@ -540,14 +540,14 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys,
         if (!cleanup_fn)
             return APR_ENOTIMPL;
         
    -    apr_lock_acquire(mem_sys->sms_lock);
    +    apr_lock_acquire(sms->sms_lock);
         
         cleanup = (struct apr_sms_cleanup *)
    -                  apr_sms_malloc(mem_sys->accounting_mem_sys,
    +                  apr_sms_malloc(sms->accounting,
                                      sizeof(struct apr_sms_cleanup));
     
         if (!cleanup){
    -        apr_lock_release(mem_sys->sms_lock);
    +        apr_lock_release(sms->sms_lock);
             return APR_ENOMEM;
         }
     
    @@ -555,15 +555,15 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *mem_sys,
         cleanup->type = type;
         cleanup->cleanup_fn = cleanup_fn;
     
    -    cleanup->next = mem_sys->cleanups;
    -    mem_sys->cleanups = cleanup;
    +    cleanup->next = sms->cleanups;
    +    sms->cleanups = cleanup;
     
    -    apr_lock_release(mem_sys->sms_lock);
    +    apr_lock_release(sms->sms_lock);
         
         return APR_SUCCESS;
     }
     
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys,
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms,
                                                          apr_int32_t type,
                                                          void *data,
                                                          apr_status_t
    @@ -573,19 +573,19 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys,
         struct apr_sms_cleanup **cleanup_ref;
         apr_status_t rv = APR_EINVAL;
         
    -    apr_lock_acquire(mem_sys->sms_lock);
    +    apr_lock_acquire(sms->sms_lock);
         
    -    cleanup = mem_sys->cleanups;
    -    cleanup_ref = &mem_sys->cleanups;
    +    cleanup = sms->cleanups;
    +    cleanup_ref = &sms->cleanups;
         while (cleanup) {
             if ((type == 0 || cleanup->type == type) &&
                 cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) {
                 *cleanup_ref = cleanup->next;
     
    -            mem_sys = mem_sys->accounting_mem_sys;
    +            sms = sms->accounting;
     
    -            if (mem_sys->free_fn)
    -                apr_sms_free(mem_sys, cleanup);
    +            if (sms->free_fn)
    +                apr_sms_free(sms, cleanup);
     
                 rv = APR_SUCCESS;
             } else {
    @@ -594,30 +594,30 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys,
             }
         }
     
    -    apr_lock_release(mem_sys->sms_lock);
    +    apr_lock_release(sms->sms_lock);
     
         /* The cleanup function must have been registered previously */
         return rv;
     }
     
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys, 
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *sms, 
                                                               apr_int32_t type)
     {
         struct apr_sms_cleanup *cleanup;
         struct apr_sms_cleanup **cleanup_ref;
         apr_status_t rv = APR_EINVAL;
     
    -    apr_lock_acquire(mem_sys->sms_lock);
    +    apr_lock_acquire(sms->sms_lock);
         
    -    cleanup = mem_sys->cleanups;
    -    cleanup_ref = &mem_sys->cleanups;
    -    mem_sys = mem_sys->accounting_mem_sys;
    +    cleanup = sms->cleanups;
    +    cleanup_ref = &sms->cleanups;
    +    sms = sms->accounting;
         while (cleanup) {
             if (type == 0 || cleanup->type == type) {
                 *cleanup_ref = cleanup->next;
     
    -            if (mem_sys->free_fn)
    -                apr_sms_free(mem_sys, cleanup);
    +            if (sms->free_fn)
    +                apr_sms_free(sms, cleanup);
     
                 cleanup = *cleanup_ref;
                 rv = APR_SUCCESS;
    @@ -628,13 +628,13 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys,
             }
         }
     
    -    apr_lock_release(mem_sys->sms_lock);
    +    apr_lock_release(sms->sms_lock);
         
         /* The cleanup function must have been registered previously */
         return rv;
     }
     
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *mem_sys,
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms,
                                                   apr_int32_t type,
                                                   void *data, 
                                                   apr_status_t
    @@ -642,33 +642,33 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *mem_sys,
     {
         apr_status_t rv;
     
    -    if ((rv = apr_sms_cleanup_unregister(mem_sys, type,
    +    if ((rv = apr_sms_cleanup_unregister(sms, type,
                                              data, cleanup_fn)) != APR_SUCCESS)
             return rv;
     
         return cleanup_fn(data);
     }
     
    -APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *mem_sys, 
    +APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, 
                                                        apr_int32_t type)
     {
         struct apr_sms_cleanup *cleanup;
         struct apr_sms_cleanup **cleanup_ref;
         apr_status_t rv = APR_EINVAL;
         
    -    apr_lock_acquire(mem_sys->sms_lock);
    +    apr_lock_acquire(sms->sms_lock);
         
    -    cleanup = mem_sys->cleanups;
    -    cleanup_ref = &mem_sys->cleanups;
    -    mem_sys = mem_sys->accounting_mem_sys;
    +    cleanup = sms->cleanups;
    +    cleanup_ref = &sms->cleanups;
    +    sms = sms->accounting;
         while (cleanup) {
             if (type == 0 || cleanup->type == type) {
                 *cleanup_ref = cleanup->next;
     
                 cleanup->cleanup_fn(cleanup->data);
                 
    -            if (mem_sys->free_fn)
    -                apr_sms_free(mem_sys, cleanup);
    +            if (sms->free_fn)
    +                apr_sms_free(sms, cleanup);
     
                 cleanup = *cleanup_ref;
                 rv = APR_SUCCESS;
    @@ -679,13 +679,13 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *mem_sys,
             }
         }
     
    -    apr_lock_release(mem_sys->sms_lock);
    +    apr_lock_release(sms->sms_lock);
     
         /* The cleanup function should have been registered previously */
         return rv;
     }
     
    -APR_DECLARE(const char*) apr_sms_identity(apr_sms_t *mem_sys)
    +APR_DECLARE(const char*) apr_sms_identity(apr_sms_t *sms)
     {
    -    return mem_sys->identity;
    +    return sms->identity;
     }
    diff --git a/memory/unix/apr_sms_std.c b/memory/unix/apr_sms_std.c
    index 0bcfb33b98e..8af97715fe2 100644
    --- a/memory/unix/apr_sms_std.c
    +++ b/memory/unix/apr_sms_std.c
    @@ -71,13 +71,13 @@ static const char *module_identity = "STANDARD";
      * standard memory system
      */
     
    -static void *apr_sms_std_malloc(apr_sms_t *mem_sys,
    +static void *apr_sms_std_malloc(apr_sms_t *sms,
                                     apr_size_t size)
     {
         return malloc(size);
     }
     
    -static void *apr_sms_std_calloc(apr_sms_t *mem_sys,
    +static void *apr_sms_std_calloc(apr_sms_t *sms,
                                     apr_size_t size)
     {
     #if HAVE_CALLOC
    @@ -91,50 +91,50 @@ static void *apr_sms_std_calloc(apr_sms_t *mem_sys,
     }
     
     
    -static void *apr_sms_std_realloc(apr_sms_t *mem_sys,
    +static void *apr_sms_std_realloc(apr_sms_t *sms,
                                      void *mem, apr_size_t size)
     {
         return realloc(mem, size);
     }
     
    -static apr_status_t apr_sms_std_free(apr_sms_t *mem_sys,
    +static apr_status_t apr_sms_std_free(apr_sms_t *sms,
                                          void *mem)
     {
         free(mem);
         return APR_SUCCESS;
     }
     
    -APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys)
    +APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms)
     {
    -    apr_sms_t *new_mem_sys;
    +    apr_sms_t *new_sms;
         apr_status_t rv;
     
    -    *mem_sys = NULL;
    +    *sms = NULL;
         /* We don't have a parent so we allocate the memory
          * for the structure ourselves...
          */
    -    new_mem_sys = apr_sms_std_calloc(NULL, sizeof(apr_sms_t));
    +    new_sms = apr_sms_std_calloc(NULL, sizeof(apr_sms_t));
     
    -    if (!new_mem_sys)
    +    if (!new_sms)
             return APR_ENOMEM;
     
    -    if ((rv = apr_sms_init(new_mem_sys, NULL)) != APR_SUCCESS)
    +    if ((rv = apr_sms_init(new_sms, NULL)) != APR_SUCCESS)
             return rv;
     
    -    new_mem_sys->malloc_fn  = apr_sms_std_malloc;
    -    new_mem_sys->calloc_fn  = apr_sms_std_calloc;
    -    new_mem_sys->realloc_fn = apr_sms_std_realloc;
    -    new_mem_sys->free_fn    = apr_sms_std_free;
    -    new_mem_sys->identity   = module_identity;
    +    new_sms->malloc_fn  = apr_sms_std_malloc;
    +    new_sms->calloc_fn  = apr_sms_std_calloc;
    +    new_sms->realloc_fn = apr_sms_std_realloc;
    +    new_sms->free_fn    = apr_sms_std_free;
    +    new_sms->identity   = module_identity;
     
         /* as we're not a tracking memory module, i.e. we don't keep
          * track of our allocations, we don't have apr_sms_reset or
          * apr_sms_destroy functions.
          */
         
    -    apr_sms_assert(new_mem_sys);
    +    apr_sms_assert(new_sms);
     
    -    *mem_sys = new_mem_sys;
    +    *sms = new_sms;
         return APR_SUCCESS;
     }
     
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    index 2d7631f49de..441d066baa7 100644
    --- a/memory/unix/apr_sms_tracking.c
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -88,18 +88,18 @@ typedef struct apr_sms_tracking_t
         apr_lock_t          *lock;
     } apr_sms_tracking_t;
     
    -static void *apr_sms_tracking_malloc(apr_sms_t *mem_sys,
    +static void *apr_sms_tracking_malloc(apr_sms_t *sms,
                                          apr_size_t size)
     {
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
     
    -    node = apr_sms_malloc(mem_sys->parent_mem_sys,
    +    node = apr_sms_malloc(sms->parent,
                               size + sizeof(apr_track_node_t));
         if (!node)
             return NULL;
     
    -    tms = (apr_sms_tracking_t *)mem_sys;
    +    tms = (apr_sms_tracking_t *)sms;
         apr_lock_acquire(tms->lock);
     
         node->next = tms->nodes;
    @@ -115,18 +115,18 @@ static void *apr_sms_tracking_malloc(apr_sms_t *mem_sys,
         return (void *)node;
     }
     
    -static void *apr_sms_tracking_calloc(apr_sms_t *mem_sys, 
    +static void *apr_sms_tracking_calloc(apr_sms_t *sms, 
                                          apr_size_t size)
     {
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
       
    -    node = apr_sms_calloc(mem_sys->parent_mem_sys,
    +    node = apr_sms_calloc(sms->parent,
                               size + sizeof(apr_track_node_t));
         if (!node)
             return NULL;
     
    -    tms = (apr_sms_tracking_t *)mem_sys;
    +    tms = (apr_sms_tracking_t *)sms;
         apr_lock_acquire(tms->lock);
     
         node->next = tms->nodes;
    @@ -142,13 +142,13 @@ static void *apr_sms_tracking_calloc(apr_sms_t *mem_sys,
         return (void *)node;
     }
     
    -static void *apr_sms_tracking_realloc(apr_sms_t *mem_sys,
    +static void *apr_sms_tracking_realloc(apr_sms_t *sms,
                                           void *mem, apr_size_t size)
     {
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
     
    -    tms = (apr_sms_tracking_t *)mem_sys;
    +    tms = (apr_sms_tracking_t *)sms;
     
     
         node = (apr_track_node_t *)mem;
    @@ -164,7 +164,7 @@ static void *apr_sms_tracking_realloc(apr_sms_t *mem_sys,
             apr_lock_release(tms->lock);
         }
     
    -    node = apr_sms_realloc(mem_sys->parent_mem_sys,
    +    node = apr_sms_realloc(sms->parent,
                                node, size + sizeof(apr_track_node_t));
         if (!node)
             return NULL;
    @@ -184,7 +184,7 @@ static void *apr_sms_tracking_realloc(apr_sms_t *mem_sys,
         return (void *)node;
     }
     
    -static apr_status_t apr_sms_tracking_free(apr_sms_t *mem_sys,
    +static apr_status_t apr_sms_tracking_free(apr_sms_t *sms,
                                               void *mem)
     {
         apr_track_node_t *node;
    @@ -193,7 +193,7 @@ static apr_status_t apr_sms_tracking_free(apr_sms_t *mem_sys,
         node = (apr_track_node_t *)mem;
         node--;
     
    -    tms = (apr_sms_tracking_t *)mem_sys;
    +    tms = (apr_sms_tracking_t *)sms;
      
         apr_lock_acquire(tms->lock);
     
    @@ -203,16 +203,16 @@ static apr_status_t apr_sms_tracking_free(apr_sms_t *mem_sys,
      
         apr_lock_release(tms->lock);
              
    -    return apr_sms_free(mem_sys->parent_mem_sys, node);
    +    return apr_sms_free(sms->parent, node);
     }
     
    -static apr_status_t apr_sms_tracking_reset(apr_sms_t *mem_sys)
    +static apr_status_t apr_sms_tracking_reset(apr_sms_t *sms)
     {
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
         apr_status_t rv;
      
    -    tms = (apr_sms_tracking_t *)mem_sys;
    +    tms = (apr_sms_tracking_t *)sms;
     
         apr_lock_acquire(tms->lock);
         
    @@ -221,7 +221,7 @@ static apr_status_t apr_sms_tracking_reset(apr_sms_t *mem_sys)
             *(node->ref) = node->next;
             if (node->next)
                 node->next->ref = node->ref;
    -        if ((rv = apr_sms_free(mem_sys->parent_mem_sys, 
    +        if ((rv = apr_sms_free(sms->parent, 
                                    node)) != APR_SUCCESS) {
                 apr_lock_release(tms->lock);
                 return rv;
    @@ -233,7 +233,7 @@ static apr_status_t apr_sms_tracking_reset(apr_sms_t *mem_sys)
         return APR_SUCCESS;
     }
     
    -static apr_status_t apr_sms_tracking_pre_destroy(apr_sms_t *mem_sys)
    +static apr_status_t apr_sms_tracking_pre_destroy(apr_sms_t *sms)
     {
         /* This function WILL alwways be called.  However, be aware that the
          * main sms destroy function knows that it's not wise to try and destroy
    @@ -243,7 +243,7 @@ static apr_status_t apr_sms_tracking_pre_destroy(apr_sms_t *mem_sys)
          */
         apr_sms_tracking_t *tms;
      
    -    tms = (apr_sms_tracking_t *)mem_sys;
    +    tms = (apr_sms_tracking_t *)sms;
         apr_lock_acquire(tms->lock);
         apr_lock_destroy(tms->lock);
         tms->lock = NULL;
    @@ -251,13 +251,13 @@ static apr_status_t apr_sms_tracking_pre_destroy(apr_sms_t *mem_sys)
         return APR_SUCCESS;    
     }
     
    -static apr_status_t apr_sms_tracking_destroy(apr_sms_t *mem_sys)
    +static apr_status_t apr_sms_tracking_destroy(apr_sms_t *sms)
     {
         apr_status_t rv;
         apr_sms_tracking_t *tms;
         apr_track_node_t *node;
         
    -    tms = (apr_sms_tracking_t *)mem_sys;
    +    tms = (apr_sms_tracking_t *)sms;
      
         /* XXX - As we've already had the lock we've been using destroyed
          * in the pre_destroy function we can't use it.  However, if we
    @@ -269,22 +269,22 @@ static apr_status_t apr_sms_tracking_destroy(apr_sms_t *mem_sys)
             *(node->ref) = node->next;
             if (node->next)
                 node->next->ref = node->ref;
    -        if ((rv = apr_sms_free(mem_sys->parent_mem_sys, node)) != APR_SUCCESS)
    +        if ((rv = apr_sms_free(sms->parent, node)) != APR_SUCCESS)
                 return rv;
         }
         
    -    return apr_sms_free(mem_sys->parent_mem_sys, mem_sys);
    +    return apr_sms_free(sms->parent, sms);
     }
     
     
    -APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys, 
    +APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **sms, 
                                                       apr_sms_t *pms)
     {
         apr_sms_t *new_sms;
         apr_sms_tracking_t *tms;
         apr_status_t rv;
     
    -    *mem_sys = NULL;
    +    *sms = NULL;
         /* We're not a top level module, ie we have a parent, so
          * we allocate the memory for the structure from our parent.
          * This is safe as we shouldn't outlive our parent...
    @@ -313,7 +313,7 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys,
     
         apr_sms_assert(new_sms);
     
    -    *mem_sys = new_sms;
    +    *sms = new_sms;
         return APR_SUCCESS;
     }
     
    
    From 30164e9ca9d7fe5914d33894013c8daeac41213f Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 10 Jun 2001 14:50:10 +0000
    Subject: [PATCH 1751/7878] Add a function to get the parent of a memory
     system.
    
    Submitted by:	Sander Striker 
    Reviewed by:	David Reid 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61743 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_sms.h     | 6 ++++++
     memory/unix/apr_sms.c | 5 +++++
     2 files changed, 11 insertions(+)
    
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index 6767ad815c9..22412932b4a 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -244,6 +244,12 @@ APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a, apr_sms_t *b);
      */
     APR_DECLARE(const char *) apr_sms_identity(apr_sms_t *sms);
     
    +/**
    + * Get the parent sms
    + * @param sms the memory system to get the parent from
    + */
    +APR_DECLARE(apr_sms_t *) apr_sms_get_parent(apr_sms_t *sms);
    +
     /*
      * memory system cleanup management functions
      */
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index f53ff6694dc..dc6bae71ab8 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -689,3 +689,8 @@ APR_DECLARE(const char*) apr_sms_identity(apr_sms_t *sms)
     {
         return sms->identity;
     }
    +
    +APR_DECLARE(apr_sms_t *) apr_sms_get_parent(apr_sms_t *sms)
    +{
    +    return sms->parent;
    +}
    
    From e174286b2820f809158327b922bf9216a5bd5343 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 10 Jun 2001 17:23:00 +0000
    Subject: [PATCH 1752/7878]   apr_get_home_directory is here
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61744 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES               |   6 +-
     user/win32/userinfo.c | 125 +++++++++++++++++++++++++++++++++++++++++-
     2 files changed, 127 insertions(+), 4 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 062b15d70f3..eceadb3370e 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,10 +1,12 @@
     Changes with APR b1  
     
    +  *) Implement apr_get_home_directory for Win32.  [William Rowe]
    +
       *) Complete the implementation of LARGEFILE support on Win32, although
    -     the mmap semantics still need a touch of work.
    +     the mmap semantics still need a touch of work.  [William Rowe]
     
       *) Fix the APR_XTHREAD support, and apr_sendfile mechanics, so we can
    -     handle cross-threaded file handles on Win32.
    +     handle cross-threaded file handles on Win32.  [William Rowe]
     
       *) Implement APR_READWRITE locks on Unix with POSIX rwlocks.
          Introduce new apr_lock_acquire_rw() function which takes in 
    diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c
    index 3c160728ef5..92f304b4c7a 100644
    --- a/user/win32/userinfo.c
    +++ b/user/win32/userinfo.c
    @@ -52,17 +52,138 @@
      * .
      */
     
    +#include "apr_private.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     #include "apr_user.h"
    -#include "apr_private.h"
    +#include "fileio.h"
     #if APR_HAVE_SYS_TYPES_H
     #include 
     #endif
     
    +/* Internal sid binary to string translation, see MSKB Q131320.
    + * Several user related operations require our SID to access
    + * the registry, but in a string format.  All error handling
    + * depends on IsValidSid(), which internally we better test long
    + * before we get here!
    + */
    +void get_sid_string(char *buf, int blen, apr_uid_t id)
    +{
    +    PSID_IDENTIFIER_AUTHORITY psia;
    +    DWORD nsa;
    +    DWORD sa;
    +    int slen;
    +
    +    /* Determine authority values (these is a big-endian value, 
    +     * and NT records the value as hex if the value is > 2^32.)
    +     */
    +    psia = GetSidIdentifierAuthority(id);
    +    nsa = (DWORD)psia->Value[5]       + (DWORD)psia->Value[4] <<  8 +
    +          (DWORD)psia->Value[3] << 16 + (DWORD)psia->Value[2] << 24;
    +    sa  = (DWORD)psia->Value[1]       + (DWORD)psia->Value[0] <<  8;
    +    if (sa) {
    +        slen = apr_snprintf(buf, blen, "S-%lu-0x%04x%08x",
    +                            SID_REVISION, sa, nsa);
    +    } else {
    +        slen = apr_snprintf(buf, blen, "S-%lu-%lu",
    +                            SID_REVISION, nsa);
    +    }
    +
    +    /* Now append all the subauthority strings.
    +     */
    +    nsa = *GetSidSubAuthorityCount(id);
    +    for (sa = 0; sa < nsa; ++sa) {
    +        slen += apr_snprintf(buf + slen, blen - slen, "-%lu",
    +                             *GetSidSubAuthority(id, sa));
    +    }
    +} 
    +
    +/* Query the ProfileImagePath from the version-specific branch, where the
    + * regkey uses the user's name on 9x, and user's sid string on NT.
    + */
     APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *username, apr_pool_t *p)
     {
    -    return APR_ENOTIMPL;
    +    apr_oslevel_e os_level;
    +    apr_status_t rv;
    +    char regkey[MAX_PATH * 2];
    +    DWORD keylen;
    +    DWORD type;
    +    HKEY key;
    +
    +    if (apr_get_oslevel(p, &os_level) || os_level >= APR_WIN_NT) {
    +        apr_uid_t uid;
    +        apr_gid_t gid;
    +    
    +        if ((rv = apr_get_userid(&uid, &gid, username, p)) != APR_SUCCESS)
    +            return rv;
    +
    +        strcpy(regkey, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\"
    +                       "ProfileList\\");
    +        keylen = strlen(regkey);
    +        get_sid_string(regkey + keylen, sizeof(regkey) - keylen, uid);
    +    }
    +    else {
    +        strcpy(regkey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
    +                       "ProfileList\\");
    +        keylen = strlen(regkey);
    +        apr_cpystrn(regkey + keylen, username, sizeof(regkey) - keylen);
    +
    +    }
    +
    +    if ((rv = RegOpenKeyEx(HKEY_LOCAL_MACHINE, regkey, 0, 
    +                           KEY_QUERY_VALUE, &key)) != ERROR_SUCCESS)
    +        return APR_FROM_OS_ERROR(rv);
    +
    +#if APR_HAS_UNICODE_FS
    +    if (apr_get_oslevel(p, &os_level) || os_level >= APR_WIN_NT) {
    +
    +        keylen = sizeof(regkey);
    +        rv = RegQueryValueExW(key, L"ProfileImagePath", NULL, &type,
    +                                   (void*)regkey, &keylen);
    +        RegCloseKey(key);
    +        if (rv != ERROR_SUCCESS)
    +            return APR_FROM_OS_ERROR(rv);
    +        if (type == REG_SZ) {
    +            char retdir[MAX_PATH];
    +            if ((rv = unicode_to_utf8_path(retdir, sizeof(retdir), 
    +                                           (apr_wchar_t*)regkey)) != APR_SUCCESS)
    +                return rv;
    +            *dirname = apr_pstrdup(p, retdir);
    +            return APR_SUCCESS;
    +        }
    +        else if (type == REG_EXPAND_SZ) {
    +            apr_wchar_t path[MAX_PATH];
    +            char retdir[MAX_PATH];
    +            ExpandEnvironmentStringsW((apr_wchar_t*)regkey, path, sizeof(path));
    +            if ((rv = unicode_to_utf8_path(retdir, sizeof(retdir), path))
    +                    != APR_SUCCESS)
    +                return rv;
    +            *dirname = apr_pstrdup(p, retdir);
    +            return APR_SUCCESS;
    +        }
    +        return APR_ENOENT;
    +    }
    +    else
    +#endif APR_HAS_UNICODE_FS
    +    {
    +        keylen = sizeof(regkey);
    +        rv = RegQueryValueEx(key, "ProfileImagePath", NULL, &type,
    +                                  (void*)regkey, &keylen);
    +        RegCloseKey(key);
    +        if (rv != ERROR_SUCCESS)
    +            return APR_FROM_OS_ERROR(rv);
    +        if (type == REG_SZ) {
    +            *dirname = apr_pstrdup(p, regkey);
    +            return APR_SUCCESS;
    +        }
    +        else if (type == REG_EXPAND_SZ) {
    +            char path[MAX_PATH];
    +            ExpandEnvironmentStrings(regkey, path, sizeof(path));
    +            *dirname = apr_pstrdup(p, path);
    +            return APR_SUCCESS;
    +        }
    +        return APR_ENOENT;
    +    }
     }
     
     APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid,
    
    From 0e8d4c7eaa7d8d3ba2aaa426d56988db21084e22 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 10 Jun 2001 17:48:46 +0000
    Subject: [PATCH 1753/7878]   Even user created buffer overflows are ugly (ever
     leave something leaning   on the keyboard :-?)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61745 13f79535-47bb-0310-9956-ffa450edef68
    ---
     passwd/apr_getpass.c | 13 +++++--------
     1 file changed, 5 insertions(+), 8 deletions(-)
    
    diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c
    index 8d012255e34..c6dfb5c5bdd 100644
    --- a/passwd/apr_getpass.c
    +++ b/passwd/apr_getpass.c
    @@ -113,11 +113,7 @@ static char *getpass(const char *prompt)
         static char password[MAX_STRING_LEN];
     
         fputs(prompt, stderr);
    -    gets((char *) &password);
    -
    -    if (strlen((char *) &password) > (MAX_STRING_LEN - 1)) {
    -	password[MAX_STRING_LEN - 1] = '\0';
    -    }
    +    fgets((char *) &password, sizeof(password), stdin);
     
         return (char *) &password;
     }
    @@ -140,7 +136,7 @@ static char *getpass(const char *prompt)
         if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &attr) != 0)
     	    return NULL;
         while ((password[n] = getchar()) != '\n') {
    -        if (password[n] >= ' ' && password[n] <= '~') {
    +        if (n < sizeof(password) - 1 && password[n] >= ' ' && password[n] <= '~') {
                 n++;
             } else {
                 fprintf(stderr,"\n");
    @@ -175,7 +171,7 @@ static char *getpass(const char *prompt)
         fputs(prompt, stderr);
         
         while ((password[n] = _getch()) != '\r') {
    -        if (password[n] >= ' ' && password[n] <= '~') {
    +        if (n < sizeof(password) - 1 && password[n] >= ' ' && password[n] <= '~') {
                 n++;
                 printf("*");
             }
    @@ -211,7 +207,8 @@ static char *getpass(const char *prompt)
      *
      * Restrictions: Truncation also occurs according to the host system's
      * getpass() semantics, or at position 255 if our own version is used,
    - * but the caller is *not* made aware of it.
    + * but the caller is *not* made aware of it unless their own buffer is
    + * smaller than our own.
      */
     
     APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, size_t *bufsiz)
    
    From 375ae1a80284d6f9ad55d31906d361a9ed5fa75a Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 10 Jun 2001 17:58:25 +0000
    Subject: [PATCH 1754/7878]   VC 64-bit compiler complains that /FD is invalid,
     add a new conversion   option to strip those.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61746 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/cvtdsp.pl | 33 +++++++++++++++++++++++++++++++++
     1 file changed, 33 insertions(+)
    
    diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl
    index 0c0eb61b7d5..74a3fef61d7 100644
    --- a/build/cvtdsp.pl
    +++ b/build/cvtdsp.pl
    @@ -13,9 +13,13 @@
     elsif ($ARGV[0] == '-w4') {
         find(\&tow4, '.');
     }
    +elsif ($ARGV[0] == '-ia64') {
    +    find(\&tovc64, '.');
    +}
     else {
         print "Specify -5 or -6 for Visual Studio 5 or 6 (98) .dsp format\n";
         print "Specify -w3 or -w4 for .dsp build with warning level 3 or 4 (strict)\n\n";
    +    print "Specify -ia64 for build targeted at Itanium (req's psdk tools)\n\n";
         die "Missing argument";
     }
     
    @@ -157,3 +161,32 @@ sub tow4 {
         }
     }
     
    +sub tovc64 { 
    +
    +    if (m|.dsp$| || m|.mak$|) {
    +        $oname = $_;
    +	$tname = '.#' . $_;
    +	$verchg = 0;
    +	$srcfl = new IO::File $_, "r" || die;
    +	$dstfl = new IO::File $tname, "w" || die;
    +	while ($src = <$srcfl>) {
    +	    while ($src =~ m|\\\n$|) {
    +		$src = $src . <$srcfl>
    +            }
    +	    if ($src =~ s|(\bCPP.*)/FD (.*)|$1$2|s) {
    +		$verchg = -1;
    +	    }
    +            print $dstfl $src; 
    +	}
    +	undef $srcfl;
    +	undef $dstfl;
    +	if ($verchg) {
    +	    unlink $oname || die;
    +	    rename $tname, $oname || die;
    +	    print "Converted build file " . $oname . " to Win64 in " . $File::Find::dir . "\n"; 
    +	}
    +	else {
    +	    unlink $tname;
    +	}
    +    }
    +}
    
    From 92ef3e22a0a10f5990bc8472b12c818733f18cb8 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 10 Jun 2001 19:34:27 +0000
    Subject: [PATCH 1755/7878]   Solve two flukes.  First, I mis-constructed the
     sid authority.  Second,   if the LookupAccountName call has to resolve the
     domain (e.g., lookup   user joe), it must have a domain buffer or we
     segfault.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61747 13f79535-47bb-0310-9956-ffa450edef68
    ---
     user/win32/userinfo.c | 25 +++++++++++++++----------
     1 file changed, 15 insertions(+), 10 deletions(-)
    
    diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c
    index 92f304b4c7a..1fe632faeed 100644
    --- a/user/win32/userinfo.c
    +++ b/user/win32/userinfo.c
    @@ -78,9 +78,9 @@ void get_sid_string(char *buf, int blen, apr_uid_t id)
          * and NT records the value as hex if the value is > 2^32.)
          */
         psia = GetSidIdentifierAuthority(id);
    -    nsa = (DWORD)psia->Value[5]       + (DWORD)psia->Value[4] <<  8 +
    -          (DWORD)psia->Value[3] << 16 + (DWORD)psia->Value[2] << 24;
    -    sa  = (DWORD)psia->Value[1]       + (DWORD)psia->Value[0] <<  8;
    +    nsa =  (DWORD)(psia->Value[5])        + ((DWORD)(psia->Value[4]) <<  8)
    +        + ((DWORD)(psia->Value[3])) << 16 + ((DWORD)(psia->Value[2]) << 24);
    +    sa  =  (DWORD)(psia->Value[1])        + ((DWORD)(psia->Value[0]) <<  8);
         if (sa) {
             slen = apr_snprintf(buf, blen, "S-%lu-0x%04x%08x",
                                 SID_REVISION, sa, nsa);
    @@ -190,8 +190,11 @@ APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid,
                                              const char *username, apr_pool_t *p)
     {
         SID_NAME_USE sidtype;
    -    char *domain = NULL;
    -    DWORD sidlen, rv;
    +    char anydomain[256];
    +    char *domain;
    +    DWORD sidlen = 0;
    +    DWORD domlen = sizeof(anydomain);
    +    DWORD rv;
         char *pos;
     
         if (pos = strchr(username, '/')) {
    @@ -202,19 +205,21 @@ APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid,
             domain = apr_pstrndup(p, username, pos - username);
             username = pos + 1;
         }
    +    else {
    +        domain = NULL;
    +    }
         /* Get nothing on the first pass ... need to size the sid buffer 
          */
    -    sidlen = LookupAccountName(domain, username, NULL, NULL, 
    -                               NULL, NULL, &sidtype);
    +    rv = LookupAccountName(domain, username, domain, &sidlen, 
    +                           anydomain, &domlen, &sidtype);
         if (sidlen) {
             /* Give it back on the second pass
              */
             *uid = apr_palloc(p, sidlen);
    +        domlen = sizeof(anydomain);
             rv = LookupAccountName(domain, username, *uid, &sidlen, 
    -                               NULL, NULL, &sidtype);
    +                               anydomain, &domlen, &sidtype);
         }
    -    else
    -        rv = 0; /* Quiet the compiler */
         if (!sidlen || !rv) {
             return apr_get_os_error();
         }
    
    From e2cfe31d18b139d4fafc28aab4c76acd28ae6646 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 10 Jun 2001 19:44:02 +0000
    Subject: [PATCH 1756/7878]   I hate obscure order of operations.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61748 13f79535-47bb-0310-9956-ffa450edef68
    ---
     user/win32/userinfo.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c
    index 1fe632faeed..38dcf7fe371 100644
    --- a/user/win32/userinfo.c
    +++ b/user/win32/userinfo.c
    @@ -79,7 +79,7 @@ void get_sid_string(char *buf, int blen, apr_uid_t id)
          */
         psia = GetSidIdentifierAuthority(id);
         nsa =  (DWORD)(psia->Value[5])        + ((DWORD)(psia->Value[4]) <<  8)
    -        + ((DWORD)(psia->Value[3])) << 16 + ((DWORD)(psia->Value[2]) << 24);
    +        + ((DWORD)(psia->Value[3]) << 16) + ((DWORD)(psia->Value[2]) << 24);
         sa  =  (DWORD)(psia->Value[1])        + ((DWORD)(psia->Value[0]) <<  8);
         if (sa) {
             slen = apr_snprintf(buf, blen, "S-%lu-0x%04x%08x",
    
    From fbb748d97fc10d9c1b12e3071d7b222eec357dcd Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 10 Jun 2001 19:53:28 +0000
    Subject: [PATCH 1757/7878]   Better make the path canonical to unixish
     expectations.   This is verified to allow mod_userdir do it's thing on win32.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61749 13f79535-47bb-0310-9956-ffa450edef68
    ---
     user/win32/userinfo.c | 14 ++++++++------
     1 file changed, 8 insertions(+), 6 deletions(-)
    
    diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c
    index 38dcf7fe371..70390d0fd2d 100644
    --- a/user/win32/userinfo.c
    +++ b/user/win32/userinfo.c
    @@ -106,6 +106,7 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use
         apr_oslevel_e os_level;
         apr_status_t rv;
         char regkey[MAX_PATH * 2];
    +    char *fixch;
         DWORD keylen;
         DWORD type;
         HKEY key;
    @@ -149,7 +150,6 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use
                                                (apr_wchar_t*)regkey)) != APR_SUCCESS)
                     return rv;
                 *dirname = apr_pstrdup(p, retdir);
    -            return APR_SUCCESS;
             }
             else if (type == REG_EXPAND_SZ) {
                 apr_wchar_t path[MAX_PATH];
    @@ -159,9 +159,9 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use
                         != APR_SUCCESS)
                     return rv;
                 *dirname = apr_pstrdup(p, retdir);
    -            return APR_SUCCESS;
             }
    -        return APR_ENOENT;
    +        else
    +            return APR_ENOENT;
         }
         else
     #endif APR_HAS_UNICODE_FS
    @@ -174,16 +174,18 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use
                 return APR_FROM_OS_ERROR(rv);
             if (type == REG_SZ) {
                 *dirname = apr_pstrdup(p, regkey);
    -            return APR_SUCCESS;
             }
             else if (type == REG_EXPAND_SZ) {
                 char path[MAX_PATH];
                 ExpandEnvironmentStrings(regkey, path, sizeof(path));
                 *dirname = apr_pstrdup(p, path);
    -            return APR_SUCCESS;
             }
    -        return APR_ENOENT;
    +        else
    +            return APR_ENOENT;
         }
    +    for (fixch = *dirname; *fixch; ++fixch)
    +        if (*fixch == '\\')
    +            *fixch = '/';
     }
     
     APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid,
    
    From 10838df4b04fb887fda7d418da08e188b85f7e50 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 10 Jun 2001 21:21:49 +0000
    Subject: [PATCH 1758/7878] Make locking conditional on having a lock to use
     and make the destroy function much cleaner.
    
    Submitted by:    Sander Striker 
    Reviewed by:     David Reid 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61750 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms_tracking.c | 77 +++++++++++++++++-----------------
     1 file changed, 38 insertions(+), 39 deletions(-)
    
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    index 441d066baa7..d71e13e476e 100644
    --- a/memory/unix/apr_sms_tracking.c
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -100,7 +100,8 @@ static void *apr_sms_tracking_malloc(apr_sms_t *sms,
             return NULL;
     
         tms = (apr_sms_tracking_t *)sms;
    -    apr_lock_acquire(tms->lock);
    +    if (tms->lock)
    +        apr_lock_acquire(tms->lock);
     
         node->next = tms->nodes;
         tms->nodes = node;
    @@ -108,7 +109,8 @@ static void *apr_sms_tracking_malloc(apr_sms_t *sms,
         if (node->next)
             node->next->ref = &node->next;
     
    -    apr_lock_release(tms->lock);
    +    if (tms->lock)
    +        apr_lock_release(tms->lock);
     
         node++;
     
    @@ -127,7 +129,8 @@ static void *apr_sms_tracking_calloc(apr_sms_t *sms,
             return NULL;
     
         tms = (apr_sms_tracking_t *)sms;
    -    apr_lock_acquire(tms->lock);
    +    if (tms->lock)
    +        apr_lock_acquire(tms->lock);
     
         node->next = tms->nodes;
         tms->nodes = node;
    @@ -135,7 +138,8 @@ static void *apr_sms_tracking_calloc(apr_sms_t *sms,
         if (node->next)
             node->next->ref = &node->next;
     
    -    apr_lock_release(tms->lock);
    +    if (tms->lock)
    +        apr_lock_release(tms->lock);
     
         node++;
     
    @@ -149,19 +153,20 @@ static void *apr_sms_tracking_realloc(apr_sms_t *sms,
         apr_track_node_t *node;
     
         tms = (apr_sms_tracking_t *)sms;
    -
    -
         node = (apr_track_node_t *)mem;
     
         if (node) {
             node--;
    -        apr_lock_acquire(tms->lock);
    +
    +        if (tms->lock)
    +            apr_lock_acquire(tms->lock);
             
             *(node->ref) = node->next;
             if (node->next)
                 node->next->ref = node->ref;
    -        
    -        apr_lock_release(tms->lock);
    +
    +        if (tms->lock)
    +            apr_lock_release(tms->lock);
         }
     
         node = apr_sms_realloc(sms->parent,
    @@ -169,7 +174,8 @@ static void *apr_sms_tracking_realloc(apr_sms_t *sms,
         if (!node)
             return NULL;
     
    -    apr_lock_acquire(tms->lock);
    +    if (tms->lock)
    +        apr_lock_acquire(tms->lock);
         
         node->next = tms->nodes;
         tms->nodes = node;
    @@ -177,7 +183,8 @@ static void *apr_sms_tracking_realloc(apr_sms_t *sms,
         if (node->next)
             node->next->ref = &node->next;
     
    -    apr_lock_release(tms->lock);
    +    if (tms->lock)
    +        apr_lock_release(tms->lock);
         
         node++;
     
    @@ -195,13 +202,15 @@ static apr_status_t apr_sms_tracking_free(apr_sms_t *sms,
     
         tms = (apr_sms_tracking_t *)sms;
      
    -    apr_lock_acquire(tms->lock);
    +    if (tms->lock)
    +        apr_lock_acquire(tms->lock);
     
         *(node->ref) = node->next;
         if (node->next)
             node->next->ref = node->ref;
      
    -    apr_lock_release(tms->lock);
    +    if (tms->lock)
    +        apr_lock_release(tms->lock);
              
         return apr_sms_free(sms->parent, node);
     }
    @@ -214,7 +223,8 @@ static apr_status_t apr_sms_tracking_reset(apr_sms_t *sms)
      
         tms = (apr_sms_tracking_t *)sms;
     
    -    apr_lock_acquire(tms->lock);
    +    if (tms->lock)
    +        apr_lock_acquire(tms->lock);
         
         while (tms->nodes) {
             node = tms->nodes;
    @@ -223,12 +233,15 @@ static apr_status_t apr_sms_tracking_reset(apr_sms_t *sms)
                 node->next->ref = node->ref;
             if ((rv = apr_sms_free(sms->parent, 
                                    node)) != APR_SUCCESS) {
    -            apr_lock_release(tms->lock);
    +            if (tms->lock) {
    +                apr_lock_release(tms->lock);
    +            }
                 return rv;
             }
         }
         
    -    apr_lock_release(tms->lock);
    +    if (tms->lock)
    +        apr_lock_release(tms->lock);
     
         return APR_SUCCESS;
     }
    @@ -244,9 +257,12 @@ static apr_status_t apr_sms_tracking_pre_destroy(apr_sms_t *sms)
         apr_sms_tracking_t *tms;
      
         tms = (apr_sms_tracking_t *)sms;
    -    apr_lock_acquire(tms->lock);
    -    apr_lock_destroy(tms->lock);
    -    tms->lock = NULL;
    +
    +    if (tms->lock) {
    +        apr_lock_acquire(tms->lock);
    +        apr_lock_destroy(tms->lock);
    +        tms->lock = NULL;
    +    }
         
         return APR_SUCCESS;    
     }
    @@ -254,26 +270,9 @@ static apr_status_t apr_sms_tracking_pre_destroy(apr_sms_t *sms)
     static apr_status_t apr_sms_tracking_destroy(apr_sms_t *sms)
     {
         apr_status_t rv;
    -    apr_sms_tracking_t *tms;
    -    apr_track_node_t *node;
    -    
    -    tms = (apr_sms_tracking_t *)sms;
    - 
    -    /* XXX - As we've already had the lock we've been using destroyed
    -     * in the pre_destroy function we can't use it.  However, if we
    -     * have threads trying to use the sms while another is trying to
    -     * destroy it, then we have serious problems anyway.
    -     */
    -    while (tms->nodes) {
    -        node = tms->nodes;
    -        *(node->ref) = node->next;
    -        if (node->next)
    -            node->next->ref = node->ref;
    -        if ((rv = apr_sms_free(sms->parent, node)) != APR_SUCCESS)
    -            return rv;
    -    }
    -    
    -    return apr_sms_free(sms->parent, sms);
    +
    +    if ((rv = apr_sms_reset(sms)) != APR_SUCCESS)
    +        return rv;
     }
     
     
    
    From d943404d548e9ae9ded1014f678b780696b66735 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 10 Jun 2001 21:33:45 +0000
    Subject: [PATCH 1759/7878] Remove the header I forgot to remove from Sanders
     last patch.
    
    Also, it's bugged me for a while now that we have identical code in
    a few places, so move the duplicate code to a macro and use that to
    simplify the code. Should make the file easier to maintain.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61751 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms_tracking.c | 85 +++++++++++++---------------------
     1 file changed, 32 insertions(+), 53 deletions(-)
    
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    index d71e13e476e..f6ac6942801 100644
    --- a/memory/unix/apr_sms_tracking.c
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -66,7 +66,6 @@
     #include "apr_sms.h"
     #include "apr_sms_tracking.h"
     #include "apr_lock.h"
    -#include 
     
     static const char *module_identity = "TRACKING";
     
    @@ -88,6 +87,30 @@ typedef struct apr_sms_tracking_t
         apr_lock_t          *lock;
     } apr_sms_tracking_t;
     
    +#define INSERT_NODE(node, tms) \
    +    if (tms->lock) \
    +        apr_lock_acquire(tms->lock); \
    +    \
    +    node->next = tms->nodes; \
    +    tms->nodes = node; \
    +    node->ref = &tms->nodes; \
    +    if (node->next) \
    +        node->next->ref = &node->next; \
    +    \
    +    if (tms->lock) \
    +        apr_lock_release(tms->lock);
    +    
    +#define REMOVE_NODE(node, tms) \
    +        if (tms->lock) \
    +            apr_lock_acquire(tms->lock); \
    +        \
    +        *(node->ref) = node->next; \
    +        if (node->next) \
    +            node->next->ref = node->ref; \
    +        \
    +        if (tms->lock) \
    +            apr_lock_release(tms->lock);
    +    
     static void *apr_sms_tracking_malloc(apr_sms_t *sms,
                                          apr_size_t size)
     {
    @@ -100,18 +123,9 @@ static void *apr_sms_tracking_malloc(apr_sms_t *sms,
             return NULL;
     
         tms = (apr_sms_tracking_t *)sms;
    -    if (tms->lock)
    -        apr_lock_acquire(tms->lock);
    -
    -    node->next = tms->nodes;
    -    tms->nodes = node;
    -    node->ref = &tms->nodes;
    -    if (node->next)
    -        node->next->ref = &node->next;
    -
    -    if (tms->lock)
    -        apr_lock_release(tms->lock);
     
    +    INSERT_NODE(node, tms)
    +    
         node++;
     
         return (void *)node;
    @@ -129,17 +143,8 @@ static void *apr_sms_tracking_calloc(apr_sms_t *sms,
             return NULL;
     
         tms = (apr_sms_tracking_t *)sms;
    -    if (tms->lock)
    -        apr_lock_acquire(tms->lock);
     
    -    node->next = tms->nodes;
    -    tms->nodes = node;
    -    node->ref = &tms->nodes;
    -    if (node->next)
    -        node->next->ref = &node->next;
    -
    -    if (tms->lock)
    -        apr_lock_release(tms->lock);
    +    INSERT_NODE(node, tms)
     
         node++;
     
    @@ -158,15 +163,7 @@ static void *apr_sms_tracking_realloc(apr_sms_t *sms,
         if (node) {
             node--;
     
    -        if (tms->lock)
    -            apr_lock_acquire(tms->lock);
    -        
    -        *(node->ref) = node->next;
    -        if (node->next)
    -            node->next->ref = node->ref;
    -
    -        if (tms->lock)
    -            apr_lock_release(tms->lock);
    +        REMOVE_NODE(node, tms)
         }
     
         node = apr_sms_realloc(sms->parent,
    @@ -174,18 +171,8 @@ static void *apr_sms_tracking_realloc(apr_sms_t *sms,
         if (!node)
             return NULL;
     
    -    if (tms->lock)
    -        apr_lock_acquire(tms->lock);
    -    
    -    node->next = tms->nodes;
    -    tms->nodes = node;
    -    node->ref = &tms->nodes;
    -    if (node->next)
    -        node->next->ref = &node->next;
    +    INSERT_NODE(node, tms)
     
    -    if (tms->lock)
    -        apr_lock_release(tms->lock);
    -    
         node++;
     
         return (void *)node;
    @@ -198,20 +185,12 @@ static apr_status_t apr_sms_tracking_free(apr_sms_t *sms,
         apr_sms_tracking_t *tms;
        
         node = (apr_track_node_t *)mem;
    +    tms = (apr_sms_tracking_t *)sms;
    +
         node--;
     
    -    tms = (apr_sms_tracking_t *)sms;
    - 
    -    if (tms->lock)
    -        apr_lock_acquire(tms->lock);
    +    REMOVE_NODE(node, tms);
     
    -    *(node->ref) = node->next;
    -    if (node->next)
    -        node->next->ref = node->ref;
    - 
    -    if (tms->lock)
    -        apr_lock_release(tms->lock);
    -         
         return apr_sms_free(sms->parent, node);
     }
     
    
    From 4551e05bbf4974cd9213a6ea5eacdc8e1af4d53c Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 10 Jun 2001 22:30:50 +0000
    Subject: [PATCH 1760/7878] Add a line I missed when doing Sanders earlier
     patch.  Thanks for the catch Sander. :)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61752 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms_tracking.c | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    index f6ac6942801..0a106e6526f 100644
    --- a/memory/unix/apr_sms_tracking.c
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -252,6 +252,8 @@ static apr_status_t apr_sms_tracking_destroy(apr_sms_t *sms)
     
         if ((rv = apr_sms_reset(sms)) != APR_SUCCESS)
             return rv;
    +    
    +    return apr_sms_free(sms->parent, sms);
     }
     
     
    
    From c4f901f32287456a98ce854d2a8d5054faaa1dea Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 10 Jun 2001 22:40:08 +0000
    Subject: [PATCH 1761/7878]   Missed a return value, thanks to gstein for the
     catch.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61753 13f79535-47bb-0310-9956-ffa450edef68
    ---
     user/win32/userinfo.c | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c
    index 70390d0fd2d..098755e4d9e 100644
    --- a/user/win32/userinfo.c
    +++ b/user/win32/userinfo.c
    @@ -186,6 +186,7 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use
         for (fixch = *dirname; *fixch; ++fixch)
             if (*fixch == '\\')
                 *fixch = '/';
    +    return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid,
    
    From de935d293a635a7e1d9552b588614bfad456d484 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 11 Jun 2001 11:33:36 +0000
    Subject: [PATCH 1762/7878] This has been on my ToDO list for a while, but
     essentially I've never quite got around to changing the locks and so they
     were still identical implementations, despite having different purposes :( 
     So, until I get the time to add the different impl. I'm simplifying what we
     had to make them quicker and easier to maintain.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61754 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/beos/Makefile.in |   5 +-
     locks/beos/crossproc.c | 129 -------------------------------------
     locks/beos/intraproc.c | 119 ----------------------------------
     locks/beos/locks.c     | 142 +++++++++++++++++++++++++----------------
     4 files changed, 87 insertions(+), 308 deletions(-)
     delete mode 100644 locks/beos/crossproc.c
     delete mode 100644 locks/beos/intraproc.c
    
    diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in
    index 8d5687f9db5..d8d200cea74 100644
    --- a/locks/beos/Makefile.in
    +++ b/locks/beos/Makefile.in
    @@ -1,8 +1,5 @@
     
    -TARGETS = \
    -	locks.lo \
    -	crossproc.lo \
    -	intraproc.lo
    +TARGETS = locks.lo
     
     # bring in rules.mk for standard functionality
     @INCLUDE_RULES@
    diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c
    deleted file mode 100644
    index 317a76e358e..00000000000
    --- a/locks/beos/crossproc.c
    +++ /dev/null
    @@ -1,129 +0,0 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    - *
    - * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    - * reserved.
    - *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    - *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    - */
    -
    -#include "unix/apr_private.h"
    -#include "beos/locks.h"
    -
    -static apr_status_t lock_inter_cleanup(void * data)
    -{
    -    apr_lock_t *lock = (apr_lock_t*)data;
    -    if (lock->ben_interproc != 0) {
    -        /* we're still locked... */
    -    	while (atomic_add(&lock->ben_interproc , -1) > 1){
    -    	    /* OK we had more than one person waiting on the lock so 
    -    	     * the sem is also locked. Release it until we have no more
    -    	     * locks left.
    -    	     */
    -            release_sem (lock->sem_interproc);
    -    	}
    -    }
    -    delete_sem(lock->sem_interproc);
    -    return APR_SUCCESS;
    -}    
    -
    -apr_status_t create_inter_lock(apr_lock_t *new)
    -{
    -    int32 stat;
    -    
    -    if ((stat = create_sem(0, "apr_interproc")) < B_NO_ERROR) {
    -        lock_inter_cleanup(new);
    -        return stat;
    -    }
    -    new->ben_interproc = 0;
    -    new->sem_interproc = stat;
    -    apr_pool_cleanup_register(new->pool, (void *)new, lock_inter_cleanup,
    -                              apr_pool_cleanup_null);
    -    return APR_SUCCESS;
    -}
    -
    -apr_status_t lock_inter(apr_lock_t *lock)
    -{
    -    int32 stat;
    -    
    -	if (atomic_add(&lock->ben_interproc, 1) > 0){
    -		if ((stat = acquire_sem(lock->sem_interproc)) < B_NO_ERROR){
    -		    atomic_add(&lock->ben_interproc, -1);
    -		    return stat;
    -		}
    -	}
    -    return APR_SUCCESS;
    -}
    -
    -apr_status_t unlock_inter(apr_lock_t *lock)
    -{
    -    int32 stat;
    -    
    -	if (atomic_add(&lock->ben_interproc, -1) > 1){
    -        if ((stat = release_sem(lock->sem_interproc)) < B_NO_ERROR) {
    -            atomic_add(&lock->ben_interproc, 1);
    -            return stat;
    -        }
    -    }
    -    return APR_SUCCESS;
    -}
    -
    -apr_status_t destroy_inter_lock(apr_lock_t *lock)
    -{
    -    apr_status_t stat;
    -    if ((stat = lock_inter_cleanup(lock)) == APR_SUCCESS) {
    -        apr_pool_cleanup_kill(lock->pool, lock, lock_inter_cleanup);
    -        return APR_SUCCESS;
    -    }
    -    return stat;
    -}
    -
    -apr_status_t child_init_lock(apr_lock_t **lock, apr_pool_t *pool, const char *fname)
    -{
    -    return APR_SUCCESS;
    -}
    diff --git a/locks/beos/intraproc.c b/locks/beos/intraproc.c
    deleted file mode 100644
    index c1847a39051..00000000000
    --- a/locks/beos/intraproc.c
    +++ /dev/null
    @@ -1,119 +0,0 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    - *
    - * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    - * reserved.
    - *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    - *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    - */
    -
    -#include "unix/apr_private.h"
    -#include "beos/locks.h"
    -
    -static apr_status_t lock_intra_cleanup(void *data)
    -{
    -    apr_lock_t *lock = (apr_lock_t *)data;
    -    if (lock->ben_intraproc != 0) {
    -    	while (atomic_add(&lock->ben_intraproc , -1) > 1){
    -            release_sem (lock->sem_intraproc);
    -    	}
    -    }
    -    delete_sem(lock->sem_intraproc);
    -    return APR_SUCCESS;
    -}    
    -
    -apr_status_t create_intra_lock(apr_lock_t *new)
    -{
    -    int32 stat;    
    -    
    -    if ((stat = create_sem(0, "apr_intraproc")) < B_NO_ERROR){
    -    	lock_intra_cleanup(new);
    -        return stat;
    -    }
    -    new->ben_intraproc = 0;
    -    new->sem_intraproc = stat;
    -    apr_pool_cleanup_register(new->pool, (void *)new, lock_intra_cleanup,
    -                              apr_pool_cleanup_null);
    -    return APR_SUCCESS;
    -}
    -
    -apr_status_t lock_intra(apr_lock_t *lock)
    -{
    -    int32 stat;
    -    
    -    if (atomic_add (&lock->ben_intraproc, 1) > 0){
    -        if ((stat = acquire_sem(lock->sem_intraproc)) < B_NO_ERROR){
    -            atomic_add(&lock->ben_intraproc,-1);
    -	        return stat;
    -        }
    -    }
    -    return APR_SUCCESS;
    -}
    -
    -apr_status_t unlock_intra(apr_lock_t *lock)
    -{
    -    int32 stat;
    -    
    -    if (atomic_add(&lock->ben_intraproc, -1) > 1){
    -        if ((stat = release_sem(lock->sem_intraproc)) < B_NO_ERROR) {
    -            atomic_add(&lock->ben_intraproc, 1);
    -            return stat;
    -        }
    -    }
    -    return APR_SUCCESS;
    -}
    -
    -apr_status_t destroy_intra_lock(apr_lock_t *lock)
    -{
    -    apr_status_t stat;
    -    if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) {
    -        apr_pool_cleanup_kill(lock->pool, lock, lock_intra_cleanup);
    -        return APR_SUCCESS;
    -    }
    -    return stat;
    -}
    diff --git a/locks/beos/locks.c b/locks/beos/locks.c
    index ae854fc40fc..3603e5b5648 100644
    --- a/locks/beos/locks.c
    +++ b/locks/beos/locks.c
    @@ -56,6 +56,76 @@
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    +
    +/* At present we only have one implementation, so here it is :) */
    +static apr_status_t _lock_cleanup(void * data)
    +{
    +    apr_lock_t *lock = (apr_lock_t*)data;
    +    if (lock->ben != 0) {
    +        /* we're still locked... */
    +    	while (atomic_add(&lock->ben , -1) > 1){
    +    	    /* OK we had more than one person waiting on the lock so 
    +    	     * the sem is also locked. Release it until we have no more
    +    	     * locks left.
    +    	     */
    +            release_sem (lock->sem);
    +    	}
    +    }
    +    delete_sem(lock->sem);
    +    return APR_SUCCESS;
    +}    
    +
    +static apr_status_t _create_lock(apr_lock_t *new)
    +{
    +    int32 stat;
    +    
    +    if ((stat = create_sem(0, "apr_lock")) < B_NO_ERROR) {
    +        _lock_cleanup(new);
    +        return stat;
    +    }
    +    new->ben = 0;
    +    new->sem = stat;
    +    apr_pool_cleanup_register(new->pool, (void *)new, _lock_cleanup,
    +                              apr_pool_cleanup_null);
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t _lock(apr_lock_t *lock)
    +{
    +    int32 stat;
    +    
    +	if (atomic_add(&lock->ben, 1) > 0) {
    +		if ((stat = acquire_sem(lock->sem)) < B_NO_ERROR) {
    +		    atomic_add(&lock->ben, -1);
    +		    return stat;
    +		}
    +	}
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t _unlock(apr_lock_t *lock)
    +{
    +    int32 stat;
    +    
    +	if (atomic_add(&lock->ben, -1) > 1) {
    +        if ((stat = release_sem(lock->sem)) < B_NO_ERROR) {
    +            atomic_add(&lock->ben, 1);
    +            return stat;
    +        }
    +    }
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t _destroy_lock(apr_lock_t *lock)
    +{
    +    apr_status_t stat;
    +    if ((stat = _lock_cleanup(lock)) == APR_SUCCESS) {
    +        apr_pool_cleanup_kill(lock->pool, lock, _lock_cleanup);
    +        return APR_SUCCESS;
    +    }
    +    return stat;
    +}
    +
     apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, 
                                apr_lockscope_e scope, const char *fname, 
                                apr_pool_t *pool)
    @@ -76,16 +146,9 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
         new->type  = type;
         new->scope = scope;
     
    -    if (scope != APR_CROSS_PROCESS) {
    -        if ((stat = create_intra_lock(new)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -    }
    -    if (scope != APR_INTRAPROCESS) {
    -        if ((stat = create_inter_lock(new)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -    }
    +    if ((stat = _create_lock(new)) != APR_SUCCESS)
    +        return stat;
    +
         (*lock) = new;
         return APR_SUCCESS;
     }
    @@ -102,17 +165,10 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock)
         switch (lock->type)
         {
         case APR_MUTEX:
    -        if (lock->scope != APR_CROSS_PROCESS) {
    -            if ((stat = lock_intra(lock)) != APR_SUCCESS) {
    -                return stat;
    -            }
    -        }
    -        if (lock->scope != APR_INTRAPROCESS) {
    -            if ((stat = lock_inter(lock)) != APR_SUCCESS) {
    -                return stat;
    -            }
    -        }
    +        if ((stat = _lock(lock)) != APR_SUCCESS)
    +            return stat;
             break;
    +
         case APR_READWRITE:
             return APR_ENOTIMPL;
         }
    @@ -147,7 +203,7 @@ apr_status_t apr_lock_release(apr_lock_t *lock)
     {
         apr_status_t stat;
     
    -    if (lock->owner == apr_os_thread_current()) {
    +    if (lock->owner_ref > 0 && lock->owner == apr_os_thread_current()) {
             lock->owner_ref--;
             if (lock->owner_ref > 0)
                 return APR_SUCCESS;
    @@ -156,16 +212,8 @@ apr_status_t apr_lock_release(apr_lock_t *lock)
         switch (lock->type)
         {
         case APR_MUTEX:
    -        if (lock->scope != APR_CROSS_PROCESS) {
    -            if ((stat = unlock_intra(lock)) != APR_SUCCESS) {
    -                return stat;
    -            }
    -        }
    -        if (lock->scope != APR_INTRAPROCESS) {
    -            if ((stat = unlock_inter(lock)) != APR_SUCCESS) {
    -                return stat;
    -            }
    -        }
    +        if ((stat = _unlock(lock)) != APR_SUCCESS)
    +            return stat;
             break;
         case APR_READWRITE:
             return APR_ENOTIMPL;
    @@ -184,16 +232,8 @@ apr_status_t apr_lock_destroy(apr_lock_t *lock)
         switch (lock->type)
         {
         case APR_MUTEX:
    -        if (lock->scope != APR_CROSS_PROCESS) {
    -            if ((stat = destroy_intra_lock(lock)) != APR_SUCCESS) {
    -                return stat;
    -            }
    -        }
    -        if (lock->scope != APR_INTRAPROCESS) {
    -            if ((stat = destroy_inter_lock(lock)) != APR_SUCCESS) {
    -                return stat;
    -            }
    -        }
    +        if ((stat = _destroy_lock(lock)) != APR_SUCCESS)
    +            return stat;
             break;
         case APR_READWRITE:
             return APR_ENOTIMPL;
    @@ -203,14 +243,8 @@ apr_status_t apr_lock_destroy(apr_lock_t *lock)
     }
     
     apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, 
    -			       apr_pool_t *pool)
    +			                     apr_pool_t *pool)
     {
    -    apr_status_t stat;
    -    if ((*lock)->scope != APR_CROSS_PROCESS) {
    -        if ((stat = child_init_lock(lock, pool, fname)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -    }
         return APR_SUCCESS;
     }
     
    @@ -227,10 +261,8 @@ apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key,
     
     apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock)
     {
    -    oslock->sem_interproc = lock->sem_interproc;
    -    oslock->sem_intraproc = lock->sem_intraproc;
    -    oslock->ben_interproc = lock->ben_interproc;
    -    oslock->ben_intraproc = lock->ben_intraproc;
    +    oslock->sem = lock->sem;
    +    oslock->ben = lock->ben;
         return APR_SUCCESS;
     }
     
    @@ -244,11 +276,9 @@ apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock,
             (*lock) = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t));
             (*lock)->pool = pool;
         }
    -    (*lock)->sem_interproc = thelock->sem_interproc;
    -    (*lock)->ben_interproc = thelock->ben_interproc;
    +    (*lock)->sem = thelock->sem;
    +    (*lock)->ben = thelock->ben;
     
    -    (*lock)->sem_intraproc = thelock->sem_intraproc;
    -    (*lock)->ben_intraproc = thelock->ben_intraproc;
         return APR_SUCCESS;
     }
         
    
    From 86763f991adb25df600f57f73835cb68424d73f6 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 11 Jun 2001 11:41:14 +0000
    Subject: [PATCH 1763/7878] Update the include files inline with the recent
     changes to locking code on beos.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61755 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_portable.h    |  8 ++------
     include/arch/beos/locks.h | 22 +++-------------------
     2 files changed, 5 insertions(+), 25 deletions(-)
    
    diff --git a/include/apr_portable.h b/include/apr_portable.h
    index 17ed5bd3ae0..7ce68513d23 100644
    --- a/include/apr_portable.h
    +++ b/include/apr_portable.h
    @@ -120,12 +120,8 @@ typedef HMODULE               apr_os_dso_handle_t;
     #include 
     
     struct apr_os_lock_t {
    -	/* Inter proc */
    -	sem_id sem_interproc;
    -	int32  ben_interproc;
    -	/* Intra Proc */
    -	sem_id sem_intraproc;
    -	int32  ben_intraproc;
    +	sem_id sem;
    +	int32  ben;
     };
     
     typedef int                   apr_os_file_t;
    diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h
    index 66f3e009014..8e332600f78 100644
    --- a/include/arch/beos/locks.h
    +++ b/include/arch/beos/locks.h
    @@ -68,26 +68,10 @@ struct apr_lock_t {
         apr_lockscope_e scope;
         apr_os_thread_t owner;
         int owner_ref;
    -    /* Inter proc */
    -    sem_id sem_interproc;
    -    int32  ben_interproc;
    -    /* Intra Proc */
    -    sem_id sem_intraproc;
    -    int32  ben_intraproc;
    -};
    -
    -apr_status_t create_intra_lock(struct apr_lock_t *new);
    -apr_status_t lock_intra(struct apr_lock_t *lock);
    -apr_status_t unlock_intra(struct apr_lock_t *lock);
    -apr_status_t destroy_intra_lock(struct apr_lock_t *lock);
     
    -apr_status_t create_inter_lock(struct apr_lock_t *new);
    -apr_status_t lock_inter(struct apr_lock_t *lock);
    -apr_status_t unlock_inter(struct apr_lock_t *lock);
    -apr_status_t destroy_inter_lock(struct apr_lock_t *lock);
    -
    -apr_status_t child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, 
    -                            const char *fname);
    +    sem_id sem;
    +    int32  ben;
    +};
     
     #endif  /* LOCKS_H */
     
    
    From b8fe15b611c8fa4aa554cc9d90b212dfc27adfaa Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 13 Jun 2001 00:16:50 +0000
    Subject: [PATCH 1764/7878] Some small tidy ups for the sms code. Passing in
     the cleanup list rather than the sms makes it more obvious what we're doing.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61756 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms.c | 26 +++++++++++---------------
     1 file changed, 11 insertions(+), 15 deletions(-)
    
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index dc6bae71ab8..caaa9126049 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -113,7 +113,6 @@ APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *sms,
         }
         
         return sms->calloc_fn(sms, size);
    -
     }
     
     APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *sms, void *mem,
    @@ -203,11 +202,11 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms,
     
         /* XXX - This should eventually be removed */
         apr_pool_create(&sms->pool, pms ? pms->pool : NULL);
    -    
    +
         /* Create the lock we'll use to protect cleanups and child lists */
         apr_lock_create(&sms->sms_lock, APR_MUTEX, APR_LOCKALL, NULL,
                         sms->pool);
    -                        
    +
         return APR_SUCCESS;
     }
     
    @@ -273,14 +272,11 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *sms)
      *
      * Call all the cleanup routines registered with a memory system.
      */
    -static void apr_sms_do_cleanups(apr_sms_t *sms)
    +static void apr_sms_do_cleanups(struct apr_sms_cleanup *c)
     {
    -    struct apr_sms_cleanup *cleanup;
    -
    -    cleanup = sms->cleanups;
    -    while (cleanup) {
    -        cleanup->cleanup_fn(cleanup->data);
    -        cleanup = cleanup->next;
    +    while (c) {
    +        c->cleanup_fn(c->data);
    +        c = c->next;
         }
     }
     
    @@ -299,7 +295,7 @@ static void apr_sms_do_child_cleanups(apr_sms_t *sms)
         sms = sms->child;
         while (sms) {
             apr_sms_do_child_cleanups(sms);
    -        apr_sms_do_cleanups(sms);
    +        apr_sms_do_cleanups(sms->cleanups);
     
             if (sms->pre_destroy_fn != NULL)
                 sms->pre_destroy_fn(sms);
    @@ -324,7 +320,7 @@ APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *sms)
         apr_sms_do_child_cleanups(sms);
     
         /* Run all cleanups, the memory will be freed by the reset */
    -    apr_sms_do_cleanups(sms);
    +    apr_sms_do_cleanups(sms->cleanups);
         sms->cleanups = NULL;
     
         /* We don't have any child memory systems after the reset */
    @@ -364,7 +360,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms)
             apr_sms_do_child_cleanups(sms);
     
             /* Run all cleanups, the memory will be freed by the destroy */
    -        apr_sms_do_cleanups(sms);
    +        apr_sms_do_cleanups(sms->cleanups);
         }
         else {
             if (sms->accounting != sms) {
    @@ -403,7 +399,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms)
                  * Run all cleanups, the memory will be freed by the destroying
                  * of the accounting memory system.
                  */
    -            apr_sms_do_cleanups(sms);
    +            apr_sms_do_cleanups(sms->cleanups);
     
                 /* Destroy the accounting memory system */
                 apr_sms_destroy(sms->accounting);
    @@ -461,7 +457,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms)
         
         /* XXX - This should eventually be removed */
         apr_pool_destroy(sms->pool);
    -    
    +
         /* 1 - If we have a self destruct, use it */
         if (sms->destroy_fn)
             return sms->destroy_fn(sms);
    
    From f349c05edc9bdbf8671b8d416f9d3739a095feb0 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 13 Jun 2001 00:31:14 +0000
    Subject: [PATCH 1765/7878] Check we have a realloc_fn before calling it. Add a
     default calloc_fn which should be more obvious than checking and doing it.
    
    Submitted by:	Sander Striker 
    Reviewed by:	David Reid 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61757 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms.c | 41 +++++++++++++++++++++++++++++++----------
     1 file changed, 31 insertions(+), 10 deletions(-)
    
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index caaa9126049..68b88f1ca41 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -103,15 +103,6 @@ APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *sms,
         if (size == 0)
             return NULL;
     
    -    if (!sms->calloc_fn) {
    -        /* Assumption - if we don't have calloc we have
    -         * malloc, might be bogus...
    -         */
    -        void *mem = sms->malloc_fn(sms, size);
    -        memset(mem, '\0', size);
    -        return mem;
    -    }
    -    
         return sms->calloc_fn(sms, size);
     }
     
    @@ -126,7 +117,11 @@ APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *sms, void *mem,
             return NULL;
         }
     
    -    return sms->realloc_fn(sms, mem, size);
    +    if (sms->realloc_fn)
    +        return sms->realloc_fn(sms, mem, size);
    +
    +    /* XXX - shoulod we free the block passed in ??? */
    +    return NULL;
     }
     
     APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *sms,
    @@ -138,6 +133,22 @@ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *sms,
         return APR_ENOTIMPL;
     }
     
    +/*
    + * default allocation functions
    + */
    +
    +static void *apr_sms_default_calloc(apr_sms_t *sms,
    +                                    apr_size_t size)
    +{
    +    void *mem;
    +
    +    mem = sms->malloc_fn(sms, size);
    +    if (mem)
    +        memset(mem, '\0', size);
    +
    +    return mem;
    +}
    +
     /*
      * memory system functions
      */
    @@ -200,6 +211,11 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms,
             apr_lock_release(pms->sms_lock);    
         }
     
    +    /* Set default functions.  These should NOT be altered by an sms
    +     * module unless it implements them itself.
    +     */
    +    sms->calloc_fn = apr_sms_default_calloc;
    +    
         /* XXX - This should eventually be removed */
         apr_pool_create(&sms->pool, pms ? pms->pool : NULL);
     
    @@ -232,6 +248,11 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *sms)
       
         assert(!sms->reset_fn || sms->destroy_fn);
     
    +    /* Has someone been stupid and NULL'd our default function without
    +     * providing an implementation of their own... tsch, tsch
    +     */
    +    assert(sms->calloc_fn);
    +    
         /*
          * Make sure all accounting memory dies with the memory system.
          * To be more specific, make sure the accounting memort system
    
    From f9ad1e6b004302062565a46416fd559c151ef420 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 13 Jun 2001 01:35:47 +0000
    Subject: [PATCH 1766/7878] More cleanup... - fix a spelling mistake (whoops) -
     add a comment about why we call pre_destroy where we do for   resets - make
     the child_cleanup calls more obvious by passing in the child   rather than
     the whole sms structure
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61758 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms.c | 30 +++++++++++++++++-------------
     1 file changed, 17 insertions(+), 13 deletions(-)
    
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index 68b88f1ca41..58cd99157a6 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -120,7 +120,7 @@ APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *sms, void *mem,
         if (sms->realloc_fn)
             return sms->realloc_fn(sms, mem, size);
     
    -    /* XXX - shoulod we free the block passed in ??? */
    +    /* XXX - should we free the block passed in ??? */
         return NULL;
     }
     
    @@ -310,17 +310,21 @@ static void apr_sms_do_cleanups(struct apr_sms_cleanup *c)
      */
     static void apr_sms_do_child_cleanups(apr_sms_t *sms)
     {
    -    if (!sms)
    -        return;
    -
    -    sms = sms->child;
         while (sms) {
    -        apr_sms_do_child_cleanups(sms);
    +        apr_sms_do_child_cleanups(sms->child);
             apr_sms_do_cleanups(sms->cleanups);
    -
    +        /*
    +         * We assume that all of our children & their siblings are created
    +         * from memory we've allocated, and as we're about to nuke it all 
    +         * we need to run the pre_destroy so things like locks can be 
    +         * cleaned up so we don't leak.
    +         * However, we aren't going to call destroy on a reset as we're about
    +         * to nuke them when we do the reset.  This is why all "leakable"
    +         * items created in an sms module MUST be cleaned up in the
    +         * pre_destroy not the destroy.
    +         */
             if (sms->pre_destroy_fn != NULL)
                 sms->pre_destroy_fn(sms);
    -
             sms = sms->sibling;
         }
     }
    @@ -338,7 +342,7 @@ APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *sms)
          * Run the cleanups of all child memory systems _including_
          * the accounting memory system.
          */
    -    apr_sms_do_child_cleanups(sms);
    +    apr_sms_do_child_cleanups(sms->child);
     
         /* Run all cleanups, the memory will be freed by the reset */
         apr_sms_do_cleanups(sms->cleanups);
    @@ -377,9 +381,10 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms)
             /* 
              * Run the cleanups of all child memory systems _including_
              * the accounting memory system.
    +         * This also does the pre_destroy functions in the children.
              */
    -        apr_sms_do_child_cleanups(sms);
    -
    +        apr_sms_do_child_cleanups(sms->child);
    +        
             /* Run all cleanups, the memory will be freed by the destroy */
             apr_sms_do_cleanups(sms->cleanups);
         }
    @@ -392,8 +397,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms)
                  * child list (we will explicitly destroy it later in this block).
                  */
                 if (child->sibling != NULL)
    -                child->sibling->ref =
    -                    child->ref;
    +                child->sibling->ref = child->ref;
     
                 *child->ref = child->sibling;
     
    
    From bd644ba97c65f720e3ebaee3e68d9fec93dd7c9a Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 13 Jun 2001 14:12:04 +0000
    Subject: [PATCH 1767/7878] Add a new sms module.
    
    This one basically takes a slice of memory (defaults to 8k) and then
    hands out pieces of it of a given size as fast as possible.  When free
    is called on an allocated block it's added to a free list and then
    re-allocated.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61759 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_sms_blocks.h     |  94 ++++++++++++++++
     memory/unix/Makefile.in      |   3 +-
     memory/unix/apr_sms_blocks.c | 205 +++++++++++++++++++++++++++++++++++
     3 files changed, 301 insertions(+), 1 deletion(-)
     create mode 100644 include/apr_sms_blocks.h
     create mode 100644 memory/unix/apr_sms_blocks.c
    
    diff --git a/include/apr_sms_blocks.h b/include/apr_sms_blocks.h
    new file mode 100644
    index 00000000000..03fe5005a56
    --- /dev/null
    +++ b/include/apr_sms_blocks.h
    @@ -0,0 +1,94 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +/* This code kindly donated to APR by 
    + *    Elrond  
    + *    Luke Kenneth Casson Leighton 
    + *    Sander Striker 
    + *
    + * May 2001
    + */
    +
    +#ifndef APR_BLOCKS_MEMORY_SYSTEM_H
    +#define APR_BLOCKS_MEMORY_SYSTEM_H
    +
    +#include "apr.h"
    +#include "apr_sms.h"
    +
    +#ifdef __cplusplus
    +extern "C" {
    +#endif
    +
    +/**
    + * @package APR blocks memory system
    + */
    +
    +/**
    + * Create an sms system that allocates blocks of a given size
    + * as fast as possible and tracks their free'ing
    + * @param sms A pointer to the returned apr_sms_t*
    + * @param pms The parent memory system, used to allocate the memory
    + *            that we will be tracking.
    + */
    +APR_DECLARE(apr_status_t) apr_sms_blocks_create(apr_sms_t **sms,
    +                                                apr_sms_t *pms,
    +                                                apr_size_t block_size);
    +
    +
    +
    +#ifdef __cplusplus
    +}
    +#endif
    +
    +#endif /* !APR_BLOCKS_MEMORY_SYSTEM_H */
    diff --git a/memory/unix/Makefile.in b/memory/unix/Makefile.in
    index 4b7b12eb577..60701e8fe71 100644
    --- a/memory/unix/Makefile.in
    +++ b/memory/unix/Makefile.in
    @@ -1,7 +1,8 @@
     
     TARGETS = apr_sms.lo \
               apr_sms_std.lo \
    -          apr_sms_tracking.lo
    +          apr_sms_tracking.lo \
    +          apr_sms_blocks.lo
     
     # bring in rules.mk for standard functionality
     @INCLUDE_RULES@
    diff --git a/memory/unix/apr_sms_blocks.c b/memory/unix/apr_sms_blocks.c
    new file mode 100644
    index 00000000000..1c43b294668
    --- /dev/null
    +++ b/memory/unix/apr_sms_blocks.c
    @@ -0,0 +1,205 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +/* This code kindly donated to APR by 
    + *    Elrond  
    + *    Luke Kenneth Casson Leighton 
    + *    Sander Striker 
    + *
    + * May 2001
    + */
    +
    +#include "apr.h"
    +#include "apr_general.h"
    +#include "apr_private.h"
    +#include "apr_sms.h"
    +#include "apr_sms_blocks.h"
    +#include "apr_lock.h"
    +#include 
    +#include "apr_portable.h"
    +
    +static const char *module_identity = "BLOCKS";
    +#define SIZE_TO_MALLOC 8 * 1024
    +
    +/*
    + * Simple bucket memory system
    + */
    +
    +/* INTERNALLY USED STRUCTURES */
    +typedef struct block_t block_t;
    +struct block_t {
    +    void *nxt;
    +};
    +
    +typedef struct apr_sms_blocks_t apr_sms_blocks_t;
    +struct apr_sms_blocks_t
    +{
    +    apr_sms_t            header;
    +    apr_size_t           block_sz;
    +    void                *ptr;
    +    void                *endp;
    +    block_t             *free_list;
    +    apr_lock_t          *lock;
    +};
    +
    +#define SIZEOF_BLOCKS_T (sizeof(apr_sms_blocks_t) + \
    +                        ((0x8 - (sizeof(apr_sms_blocks_t) & 0x7)) & 0x7))
    +#define BLOCKS_T(sms)   ((apr_sms_blocks_t *)sms)
    +
    +static void *apr_sms_blocks_malloc(apr_sms_t *sms,
    +                                   apr_size_t size)
    +{
    +    void *mem;
    +    
    +    if (size > BLOCKS_T(sms)->block_sz)
    +        return NULL;
    +
    +    if ((mem = BLOCKS_T(sms)->free_list) != NULL) {
    +        BLOCKS_T(sms)->free_list = ((block_t*)mem)->nxt;
    +        return mem;
    +    }
    +    
    +    mem = BLOCKS_T(sms)->ptr;
    +    BLOCKS_T(sms)->ptr += BLOCKS_T(sms)->block_sz;
    +
    +    if (BLOCKS_T(sms)->ptr > BLOCKS_T(sms)->endp)
    +        return NULL;
    +
    +    return mem;
    +}
    +    
    +static void *apr_sms_blocks_calloc(apr_sms_t *sms, 
    +                                   apr_size_t size)
    +{
    +    void *mem;
    +    
    +    if (size > BLOCKS_T(sms)->block_sz)
    +        return NULL;
    +
    +    if ((mem = BLOCKS_T(sms)->free_list) != NULL) {
    +        BLOCKS_T(sms)->free_list = ((block_t*)mem)->nxt;
    +        return mem;
    +    }
    +    
    +    mem = BLOCKS_T(sms)->ptr;
    +    BLOCKS_T(sms)->ptr += BLOCKS_T(sms)->block_sz;
    +
    +    if (BLOCKS_T(sms)->ptr > BLOCKS_T(sms)->endp)
    +        return NULL;
    +
    +    memset(mem, '\0', BLOCKS_T(sms)->block_sz);
    +    
    +    return mem;
    +}
    +
    +static apr_status_t apr_sms_blocks_free(apr_sms_t *sms,
    +                                        void *mem)
    +{
    +    ((block_t *)mem)->nxt = BLOCKS_T(sms)->free_list;
    +    BLOCKS_T(sms)->free_list = (block_t*)mem;
    +
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t apr_sms_blocks_reset(apr_sms_t *sms)
    +{
    +    BLOCKS_T(sms)->ptr = (char *)sms + SIZEOF_BLOCKS_T;
    +    BLOCKS_T(sms)->free_list = NULL;
    +    
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t apr_sms_blocks_destroy(apr_sms_t *sms)
    +{
    +    return apr_sms_free(sms->parent, sms);
    +}
    +
    +APR_DECLARE(apr_status_t) apr_sms_blocks_create(apr_sms_t **sms, 
    +                                                apr_sms_t *parent,
    +                                                apr_size_t block_size)
    +{
    +    apr_sms_t *new_sms;
    +    apr_status_t rv;
    +
    +    *sms = NULL;
    +    new_sms = apr_sms_calloc(parent, SIZE_TO_MALLOC);
    +
    +    if (!new_sms)
    +        return APR_ENOMEM;
    +
    +    if ((rv = apr_sms_init(new_sms, parent)) != APR_SUCCESS)
    +        return rv;
    +
    +    new_sms->malloc_fn      = apr_sms_blocks_malloc;
    +    new_sms->calloc_fn      = apr_sms_blocks_calloc;
    +    new_sms->free_fn        = apr_sms_blocks_free;
    +    new_sms->reset_fn       = apr_sms_blocks_reset;
    +    new_sms->destroy_fn     = apr_sms_blocks_destroy;
    +    new_sms->identity       = module_identity;
    +
    +    BLOCKS_T(new_sms)->ptr = (char *)new_sms + SIZEOF_BLOCKS_T;
    +    BLOCKS_T(new_sms)->endp = (char *)new_sms + SIZE_TO_MALLOC;
    +    
    +    BLOCKS_T(new_sms)->block_sz = block_size +
    +                                 ((0x8 - (block_size & 0x7)) & 0x7);
    +
    +    /* We are normally single threaded so no lock */
    +    
    +    apr_sms_assert(new_sms);
    +
    +    *sms = new_sms;
    +    return APR_SUCCESS;
    +}
    +
    +
    
    From 4e0e597ed33a3538c5c562b3bc076db565945e48 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 13 Jun 2001 14:17:38 +0000
    Subject: [PATCH 1768/7878] get NULL defined on FreeBSD 3.4
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61760 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms_tracking.c | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    index 0a106e6526f..2178872bd77 100644
    --- a/memory/unix/apr_sms_tracking.c
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -66,6 +66,7 @@
     #include "apr_sms.h"
     #include "apr_sms_tracking.h"
     #include "apr_lock.h"
    +#include  /* for NULL */
     
     static const char *module_identity = "TRACKING";
     
    
    From fa4163f00d9f69d5188069840bede668a923b4f5 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 13 Jun 2001 14:41:26 +0000
    Subject: [PATCH 1769/7878] Clean up Win32 locks when the pool goes away.
    
    Submitted by:       Justin Erenkrantz
    Further mangled by: Jeff Trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61761 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES             |  3 +++
     locks/win32/locks.c | 46 +++++++++++++++++++++++++++++----------------
     2 files changed, 33 insertions(+), 16 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index eceadb3370e..ab9eca79eb2 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,8 @@
     Changes with APR b1  
     
    +  *) Clean up Win32 locks when the pool goes away.
    +     [Justin Erenkrantz, Jeff Trawick]
    +
       *) Implement apr_get_home_directory for Win32.  [William Rowe]
     
       *) Complete the implementation of LARGEFILE support on Win32, although
    diff --git a/locks/win32/locks.c b/locks/win32/locks.c
    index 22d932973e8..dc9e889a5f0 100644
    --- a/locks/win32/locks.c
    +++ b/locks/win32/locks.c
    @@ -59,6 +59,28 @@
     #include "win32/locks.h"
     #include "apr_portable.h"
     
    +static apr_status_t lock_cleanup(void *lock_)
    +{
    +    apr_lock_t *lock = lock_;
    +
    +    switch (lock->type)
    +    {
    +    case APR_MUTEX:
    +        if (lock->scope == APR_INTRAPROCESS) {
    +            DeleteCriticalSection(&lock->section);
    +            return APR_SUCCESS;
    +        } else {
    +            if (CloseHandle(lock->mutex) == 0) {
    +                return apr_get_os_error();
    +            }
    +        }
    +        break;
    +    case APR_READWRITE:
    +        return APR_ENOTIMPL;
    +    }
    +    return APR_SUCCESS;
    +}
    +
     APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, 
                                               apr_locktype_e type, 
                                               apr_lockscope_e scope, 
    @@ -97,6 +119,8 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock,
             newlock->mutex = CreateMutex(&sec, FALSE, fname);
         }
         *lock = newlock;
    +    apr_pool_cleanup_register(newlock->pool, newlock, lock_cleanup,
    +                              apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    @@ -189,23 +213,13 @@ APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock)
     
     APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock)
     {
    -    switch (lock->type)
    -    {
    -    case APR_MUTEX:
    -        if (lock->scope == APR_INTRAPROCESS) {
    -            DeleteCriticalSection(&lock->section);
    -            return APR_SUCCESS;
    -        } else {
    -            if (CloseHandle(lock->mutex) == 0) {
    -                return apr_get_os_error();
    -            }
    -        }
    -        break;
    -    case APR_READWRITE:
    -        return APR_ENOTIMPL;
    -    }
    +    apr_status_t stat;
     
    -    return APR_SUCCESS;
    +    stat = lock_cleanup(lock);
    +    if (stat == APR_SUCCESS) {
    +        apr_pool_cleanup_kill(lock->pool, lock, lock_cleanup);
    +    }
    +    return stat;
     }
     
     APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key,
    
    From c7eb8bc7c1b01892a84f55ccc8e7cd016ec65add Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Wed, 13 Jun 2001 16:10:18 +0000
    Subject: [PATCH 1770/7878] Make apr_pool_is_ancestor a non-debug function. 
     This is required for some logic that HTTPD wants to implement.  I have left
     the join logic in that function as debug only.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61762 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                 |  4 ++++
     include/apr_pools.h     | 17 +++++++++--------
     lib/apr_pools.c         | 42 +++++++++++++++++++++--------------------
     memory/unix/apr_pools.c | 42 +++++++++++++++++++++--------------------
     4 files changed, 57 insertions(+), 48 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index ab9eca79eb2..9038af2ba0d 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,9 @@
     Changes with APR b1  
     
    +  *) Make the apr_pool_is_ancestor logic public.  This is required for 
    +     some new logic that is going into HTTPD.  I have left the join logic
    +     in that function debug only.  [Ryan Bloom]
    +
       *) Clean up Win32 locks when the pool goes away.
          [Justin Erenkrantz, Jeff Trawick]
     
    diff --git a/include/apr_pools.h b/include/apr_pools.h
    index 2f413a8eb0e..265c181759a 100644
    --- a/include/apr_pools.h
    +++ b/include/apr_pools.h
    @@ -156,6 +156,15 @@ APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub);
      */
     APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts);
     
    +/* @} */
    +
    +#else
    +# ifdef apr_pool_join
    +#  undef apr_pool_join
    +# endif
    +# define apr_pool_join(a,b)
    +#endif
    +
     /**
      * Determine if pool a is an ancestor of pool b
      * @param a The pool to search 
    @@ -165,14 +174,6 @@ APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts);
      */
     APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b);
     
    -/* @} */
    -
    -#else
    -# ifdef apr_pool_join
    -#  undef apr_pool_join
    -# endif
    -# define apr_pool_join(a,b)
    -#endif
     
     /*
      * APR memory structure manipulators (pools, tables, and arrays).
    diff --git a/lib/apr_pools.c b/lib/apr_pools.c
    index 4a87c987cdd..e5a523b5392 100644
    --- a/lib/apr_pools.c
    +++ b/lib/apr_pools.c
    @@ -1018,26 +1018,6 @@ APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts)
         return NULL;
     }
     
    -/* return TRUE iff a is an ancestor of b
    - * NULL is considered an ancestor of all pools
    - */
    -APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b)
    -{
    -    if (a == NULL) {
    -	return 1;
    -    }
    -    while (a->joined) {
    -	a = a->joined;
    -    }
    -    while (b) {
    -	if (a == b) {
    -	    return 1;
    -	}
    -	b = b->parent;
    -    }
    -    return 0;
    -}
    -
     /*
      * All blocks belonging to sub will be changed to point to p
      * instead.  This is a guarantee by the caller that sub will not
    @@ -1064,6 +1044,28 @@ APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub)
     }
     #endif
     
    +/* return TRUE iff a is an ancestor of b
    + * NULL is considered an ancestor of all pools
    + */
    +APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b)
    +{
    +    if (a == NULL) {
    +	return 1;
    +    }
    +#ifdef APR_POOL_DEBUG
    +    while (a->joined) {
    +	a = a->joined;
    +    }
    +#endif
    +    while (b) {
    +	if (a == b) {
    +	    return 1;
    +	}
    +	b = b->parent;
    +    }
    +    return 0;
    +}
    +
     /*****************************************************************
      *
      * Allocating stuff...
    diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
    index 4a87c987cdd..e5a523b5392 100644
    --- a/memory/unix/apr_pools.c
    +++ b/memory/unix/apr_pools.c
    @@ -1018,26 +1018,6 @@ APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts)
         return NULL;
     }
     
    -/* return TRUE iff a is an ancestor of b
    - * NULL is considered an ancestor of all pools
    - */
    -APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b)
    -{
    -    if (a == NULL) {
    -	return 1;
    -    }
    -    while (a->joined) {
    -	a = a->joined;
    -    }
    -    while (b) {
    -	if (a == b) {
    -	    return 1;
    -	}
    -	b = b->parent;
    -    }
    -    return 0;
    -}
    -
     /*
      * All blocks belonging to sub will be changed to point to p
      * instead.  This is a guarantee by the caller that sub will not
    @@ -1064,6 +1044,28 @@ APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub)
     }
     #endif
     
    +/* return TRUE iff a is an ancestor of b
    + * NULL is considered an ancestor of all pools
    + */
    +APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b)
    +{
    +    if (a == NULL) {
    +	return 1;
    +    }
    +#ifdef APR_POOL_DEBUG
    +    while (a->joined) {
    +	a = a->joined;
    +    }
    +#endif
    +    while (b) {
    +	if (a == b) {
    +	    return 1;
    +	}
    +	b = b->parent;
    +    }
    +    return 0;
    +}
    +
     /*****************************************************************
      *
      * Allocating stuff...
    
    From 4f199d1100df47478380fecd610f164863bc695c Mon Sep 17 00:00:00 2001
    From: Cliff Woolley 
    Date: Wed, 13 Jun 2001 19:39:37 +0000
    Subject: [PATCH 1771/7878] Nix a stray carriage return
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61763 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms_blocks.c | 1 -
     1 file changed, 1 deletion(-)
    
    diff --git a/memory/unix/apr_sms_blocks.c b/memory/unix/apr_sms_blocks.c
    index 1c43b294668..184b72122bc 100644
    --- a/memory/unix/apr_sms_blocks.c
    +++ b/memory/unix/apr_sms_blocks.c
    @@ -202,4 +202,3 @@ APR_DECLARE(apr_status_t) apr_sms_blocks_create(apr_sms_t **sms,
         return APR_SUCCESS;
     }
     
    -
    
    From 2b988eff3033ac6d6edb98fd422f2e213de47c4b Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 13 Jun 2001 22:38:57 +0000
    Subject: [PATCH 1772/7878]   Here's the latest proposal from Doug M and
     myself, to be committed this   week unless somebody yells.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61764 13f79535-47bb-0310-9956-ffa450edef68
    ---
     renames_pending | 249 +++---------------------------------------------
     1 file changed, 14 insertions(+), 235 deletions(-)
    
    diff --git a/renames_pending b/renames_pending
    index d6c7ac025a6..a84eceb1f1c 100644
    --- a/renames_pending
    +++ b/renames_pending
    @@ -1,238 +1,17 @@
    -Symbol renames pending for APR (keep complete and ordered, please!)
    -apr_accept
    -apr_array_append
    -apr_array_cat
    -apr_array_copy
    -apr_array_copy_hdr
    -apr_array_make
    -apr_array_pstrcat
    -apr_array_push
    -apr_bind
    -apr_collapse_spaces
    -apr_compare_groups
    -apr_compare_users
    -apr_connect
    -apr_cpystrn
    -apr_day_snames
    -apr_dir_close
    -apr_dir_make
    -apr_dir_open
    -apr_dir_read
    -apr_dir_remove
    -apr_dir_rewind
    -apr_dso_error
    -apr_dso_load
    -apr_dso_sym
    -apr_dso_unload
    -apr_file_close
    -apr_file_data_get
    -apr_file_data_set
    -apr_file_dup
    -apr_file_eof
    -apr_file_flush
    -apr_file_getc
    -apr_file_gets
    -apr_file_info_get
    -apr_file_lock
    -apr_file_lstat                   from apr_lstat
    -apr_file_name_get
    -apr_file_open
    -apr_file_open_stderr
    -apr_file_open_stdout
    -apr_file_perms_set
    -apr_file_pipe_create
    -apr_file_pipe_timeout_get
    -apr_file_pipe_timeout_set
    -apr_file_pool_get
    -apr_file_printf
    -apr_file_putc
    -apr_file_puts
    -apr_file_read
    -apr_file_read_full
    -apr_file_remove
    -apr_file_rename
    -apr_file_seek
    -apr_file_stat               from apr_stat
    -apr_file_ungetc
    -apr_file_unlock
    -apr_file_write
    -apr_file_write_full
    -apr_file_writev
    -apr_filename_of_pathname
    -apr_filepath_get
    -apr_filepath_merge
    -apr_filepath_root
    -apr_filepath_set
    -apr_fnmatch
    -apr_fnmatch_found               from apr_is_fnmatch
    -apr_generate_random_bytes
    -apr_gethostname
    -apr_getnameinfo
    -apr_getopt
    -apr_getopt_init
    -apr_getopt_long
    -apr_getservbyname
    -apr_getsocketopt
    -apr_groupname_get          from apr_get_groupname
    -apr_hash_count
    -apr_hash_first
    -apr_hash_get
    -apr_hash_make
    -apr_hash_next
    -apr_hash_set
    -apr_hash_this
    -apr_initialize
    -apr_ipsubnet_create
    -apr_ipsubnet_test
    -apr_listen
    -apr_lock_acquire
    -apr_lock_child_init
    -apr_lock_create
    -apr_lock_data_get
    -apr_lock_data_set
    -apr_lock_destroy
    -apr_lock_release
    -apr_md5_encode
    -apr_md5_final
    -apr_md5_init
    -apr_md5_update
    -apr_mmap_create
    -apr_mmap_delete
    -apr_mmap_offset
    -apr_month_snames
    -apr_os_dir_get
    -apr_os_dir_put
    -apr_os_file_get
    -apr_os_file_put
    -apr_os_lock_get
    -apr_os_lock_put
    -apr_os_sock_get
    -apr_os_sock_make
    -apr_os_sock_put
    -apr_os_thread_get
    -apr_os_thread_put
    -apr_os_threadkey_get
    -apr_os_threadkey_put
    -apr_palloc
    -apr_parse_addr_port
    -apr_password_get
    -apr_password_validate
    -apr_pcalloc
    -apr_pmemdup
    -apr_poll
    -apr_poll_data_get
    -apr_poll_data_set
    -apr_poll_revents_get
    -apr_poll_setup
    -apr_poll_socket_add
    -apr_poll_socket_clear
    -apr_poll_socket_mask
    -apr_poll_socket_remove
    -apr_pool_alloc_init
    -apr_pool_alloc_term
    -apr_pool_cleanup_for_exec
    -apr_pool_cleanup_kill
    -apr_pool_cleanup_null
    -apr_pool_cleanup_register
    -apr_pool_cleanup_run
    -apr_pool_clear
    -apr_pool_create
    -apr_pool_destroy
    -apr_pool_free_blocks_num_bytes
    -apr_pool_note_subprocess
    -apr_pool_num_bytes
    -apr_pool_sub_make
    -apr_pool_userdata_get
    -apr_pool_userdata_set
    -apr_proc_create
    -apr_proc_kill
    -apr_proc_wait
    -apr_procattr_child_err_set
    -apr_procattr_child_in_set
    -apr_procattr_child_out_set
    -apr_procattr_cmdtype_set
    -apr_procattr_create
    -apr_procattr_detach_set
    -apr_procattr_dir_set
    -apr_procattr_io_set
    -apr_psprintf
    -apr_pstrcat
    -apr_pstrdup
    -apr_pstrndup
    -apr_pvsprintf
    -apr_recv
    -apr_recvfrom
    -apr_rfc822_date
    -apr_send
    -apr_sendfile
    -apr_sendto
    -apr_sendv
    -apr_set_abort
    -apr_setsocketopt
    -apr_shutdown
    -apr_sleep
    -apr_snprintf
    -apr_sockaddr_info_get
    -apr_sockaddr_ip_get
    -apr_sockaddr_ip_set
    -apr_sockaddr_port_get
    -apr_sockaddr_port_set
    -apr_socket_addr_get
    -apr_socket_close
    -apr_socket_create
    -apr_socket_data_get
    -apr_socket_data_set
    -apr_strerror
    -apr_strftime
    -apr_strnatcasecmp
    -apr_strnatcmp
    -apr_table_add
    -apr_table_addn
    -apr_table_clear
    -apr_table_copy
    -apr_table_do
    -apr_table_get
    -apr_table_make
    -apr_table_merge
    -apr_table_mergen
    -apr_table_overlap
    -apr_table_overlay
    -apr_table_set
    -apr_table_setn
    -apr_table_unset
    -apr_table_vdo
    -apr_terminate
    -apr_thread_create
    -apr_thread_data_get
    -apr_thread_data_set
    -apr_thread_detach
    -apr_thread_exit
    -apr_thread_join
    -apr_threadattr_create
    -apr_threadattr_detach_get
    -apr_threadattr_detach_set
    -apr_threadkey_data_get
    -apr_threadkey_data_set
    -apr_threadkey_private_create
    -apr_threadkey_private_delete
    -apr_threadkey_private_get
    -apr_threadkey_private_set
    -apr_time_ctime_fmt               from apr_ctime
    -apr_time_os_explode_get          from apr_os_exp_time_get
    -apr_time_os_explode_put          from apr_os_exp_time_put
    -apr_time_os_get                  from apr_os_imp_time_get
    -apr_time_os_get                  from apr_os_imp_time_put
    +Symbol renames for APR 
    +
     apr_time_ansi_put                from apr_ansi_time_to_apr_time
    -apr_time_gmt_explode             from apr_explode_gmt
    -apr_time_implode                 from apr_implode_time
    -apr_time_lt_explode              from apr_explode_localtime
    -apr_time_now
    -apr_tokenize_to_argv
    -apr_user_path_get                from apr_get_home_directory
    +
    +apr_time_exp_t                   from apr_exploded_time_t
    +
    +apr_time_exp_get                 from apr_implode_time
    +apr_time_exp_gmt                 from apr_explode_gmt
    +apr_time_exp_lt                  from apr_explode_localtime
    +apr_time_exp_tz                  from apr_explode_time
    +
    +apr_group_name_get               from apr_get_groupname
    +
    +apr_user_homedir_get             from apr_get_home_directory
     apr_user_id_get                  from apr_get_userid
     apr_user_name_get                from apr_get_username
    -apr_uuid_format
    -apr_uuid_get
    -apr_uuid_parse
    -apr_vformatter
    -apr_vsnprintf
    +
    
    From faf282968d3c6af1d734115de39f7e43af7e594a Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 14 Jun 2001 10:59:18 +0000
    Subject: [PATCH 1773/7878] get the declaration of memset on FreeBSD 3.4
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61765 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms_blocks.c | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/memory/unix/apr_sms_blocks.c b/memory/unix/apr_sms_blocks.c
    index 184b72122bc..04f044b1160 100644
    --- a/memory/unix/apr_sms_blocks.c
    +++ b/memory/unix/apr_sms_blocks.c
    @@ -68,6 +68,8 @@
     #include "apr_lock.h"
     #include 
     #include "apr_portable.h"
    +#define APR_WANT_MEMFUNC
    +#include "apr_want.h"
     
     static const char *module_identity = "BLOCKS";
     #define SIZE_TO_MALLOC 8 * 1024
    
    From 700ea225fe15c4df88eb86948345431b61a1791b Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 14 Jun 2001 11:44:03 +0000
    Subject: [PATCH 1774/7878] can't add to void *; pretend it is char *
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61766 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms_blocks.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/memory/unix/apr_sms_blocks.c b/memory/unix/apr_sms_blocks.c
    index 04f044b1160..e0837ad9f6b 100644
    --- a/memory/unix/apr_sms_blocks.c
    +++ b/memory/unix/apr_sms_blocks.c
    @@ -113,7 +113,7 @@ static void *apr_sms_blocks_malloc(apr_sms_t *sms,
         }
         
         mem = BLOCKS_T(sms)->ptr;
    -    BLOCKS_T(sms)->ptr += BLOCKS_T(sms)->block_sz;
    +    BLOCKS_T(sms)->ptr = (char *)(BLOCKS_T(sms)->ptr) + BLOCKS_T(sms)->block_sz;
     
         if (BLOCKS_T(sms)->ptr > BLOCKS_T(sms)->endp)
             return NULL;
    @@ -135,7 +135,7 @@ static void *apr_sms_blocks_calloc(apr_sms_t *sms,
         }
         
         mem = BLOCKS_T(sms)->ptr;
    -    BLOCKS_T(sms)->ptr += BLOCKS_T(sms)->block_sz;
    +    BLOCKS_T(sms)->ptr = (char *)(BLOCKS_T(sms)->ptr) + BLOCKS_T(sms)->block_sz;
     
         if (BLOCKS_T(sms)->ptr > BLOCKS_T(sms)->endp)
             return NULL;
    
    From 4d76238bf49a4620c2fb041b27063b061e4e1dd2 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 14 Jun 2001 12:03:27 +0000
    Subject: [PATCH 1775/7878] change type of ptr and endp fields in
     apr_sms_blocks_t for easy ptr arithmetic
    
    Submitted by:	Sander Striker
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61767 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms_blocks.c | 8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/memory/unix/apr_sms_blocks.c b/memory/unix/apr_sms_blocks.c
    index e0837ad9f6b..fa7f346d074 100644
    --- a/memory/unix/apr_sms_blocks.c
    +++ b/memory/unix/apr_sms_blocks.c
    @@ -89,8 +89,8 @@ struct apr_sms_blocks_t
     {
         apr_sms_t            header;
         apr_size_t           block_sz;
    -    void                *ptr;
    -    void                *endp;
    +    char                *ptr;
    +    char                *endp;
         block_t             *free_list;
         apr_lock_t          *lock;
     };
    @@ -113,7 +113,7 @@ static void *apr_sms_blocks_malloc(apr_sms_t *sms,
         }
         
         mem = BLOCKS_T(sms)->ptr;
    -    BLOCKS_T(sms)->ptr = (char *)(BLOCKS_T(sms)->ptr) + BLOCKS_T(sms)->block_sz;
    +    BLOCKS_T(sms)->ptr += BLOCKS_T(sms)->block_sz;
     
         if (BLOCKS_T(sms)->ptr > BLOCKS_T(sms)->endp)
             return NULL;
    @@ -135,7 +135,7 @@ static void *apr_sms_blocks_calloc(apr_sms_t *sms,
         }
         
         mem = BLOCKS_T(sms)->ptr;
    -    BLOCKS_T(sms)->ptr = (char *)(BLOCKS_T(sms)->ptr) + BLOCKS_T(sms)->block_sz;
    +    BLOCKS_T(sms)->ptr += BLOCKS_T(sms)->block_sz;
     
         if (BLOCKS_T(sms)->ptr > BLOCKS_T(sms)->endp)
             return NULL;
    
    From fb13718c2816e70ea3d6943fe08ecbf0d44652a5 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 14 Jun 2001 18:52:09 +0000
    Subject: [PATCH 1776/7878] on some Unix platforms pthread_t is a structure and
     the compiler won't allow comparison of structures
    
    add apr_os_thread_equal() and implement it on the two platforms with
    apr_os_thread_current()
    
    use apr_os_thread_equal() in the Unix lock code so we don't compare
    structures
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61768 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_portable.h   | 1 +
     locks/unix/locks.c       | 6 +++---
     threadproc/beos/thread.c | 5 +++++
     threadproc/unix/thread.c | 5 +++++
     4 files changed, 14 insertions(+), 3 deletions(-)
    
    diff --git a/include/apr_portable.h b/include/apr_portable.h
    index 7ce68513d23..0ba40143b9a 100644
    --- a/include/apr_portable.h
    +++ b/include/apr_portable.h
    @@ -416,6 +416,7 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso,
     
     #if APR_HAS_THREADS
     APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void);
    +APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2);
     #endif
     
     #endif /* APR_HAS_DSO */
    diff --git a/locks/unix/locks.c b/locks/unix/locks.c
    index 037ee43cbed..539f2f29dbf 100644
    --- a/locks/unix/locks.c
    +++ b/locks/unix/locks.c
    @@ -131,7 +131,7 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock)
         apr_status_t stat;
     
     #if APR_HAS_THREADS
    -    if (lock->owner == apr_os_thread_current()){
    +    if (apr_os_thread_equal(lock->owner, apr_os_thread_current())) {
             lock->owner_ref++;
             return APR_SUCCESS;
         }
    @@ -204,7 +204,7 @@ apr_status_t apr_lock_release(apr_lock_t *lock)
         apr_status_t stat;
     
     #if APR_HAS_THREADS
    -    if (lock->owner == apr_os_thread_current()) {
    +    if (apr_os_thread_equal(lock->owner, apr_os_thread_current())) {
             lock->owner_ref--;
             if (lock->owner_ref > 0)
                 return APR_SUCCESS;
    @@ -244,7 +244,7 @@ apr_status_t apr_lock_release(apr_lock_t *lock)
         }
     
     #if APR_HAS_THREADS
    -    lock->owner = 0;
    +    memset(&lock->owner, 0, sizeof lock->owner);
         lock->owner_ref = 0;
     #endif
         
    diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c
    index facd4119490..6bec7de622f 100644
    --- a/threadproc/beos/thread.c
    +++ b/threadproc/beos/thread.c
    @@ -128,6 +128,11 @@ apr_os_thread_t apr_os_thread_current(void)
         return find_thread(NULL);
     }
     
    +int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2)
    +{
    +    return tid1 == tid2;
    +}
    +
     apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval)
     {
         apr_pool_destroy(thd->cntxt);
    diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c
    index 8aa35e1bf84..9aa49ce0265 100644
    --- a/threadproc/unix/thread.c
    +++ b/threadproc/unix/thread.c
    @@ -163,6 +163,11 @@ apr_os_thread_t apr_os_thread_current(void)
         return pthread_self();
     }
     
    +int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2)
    +{
    +    return pthread_equal(tid1, tid2);
    +}
    +
     apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval)
     {
         apr_pool_destroy(thd->cntxt);
    
    From 5f42502f67f7d0d3f13b92cd17de61728f5fa21a Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Thu, 14 Jun 2001 23:49:27 +0000
    Subject: [PATCH 1777/7878] Justin dons a big, brown paper bag over his head.
    
    We always need to check the pthread_rwlock_init because we may need to add
    the Linux-specific CPPFLAGS.  (It would work the first time, but the
    success of the compile would be cached, so the next time around we
    wouldn't detect that we needed to add the special CPPFLAGS.)
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61769 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 7 +++----
     1 file changed, 3 insertions(+), 4 deletions(-)
    
    diff --git a/configure.in b/configure.in
    index b8c1b6711d6..994435f8ff6 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -287,11 +287,10 @@ else
                 dnl # Linux is silly as it has pthread_rwlock_init defined
                 dnl # but keeps the pthread_rwlock_t structure hidden unless 
                 dnl # special things are defined.
    -            AC_CACHE_CHECK([for pthread_rwlock_t], ac_cv_struct_pthread_rw,
    -                [AC_TRY_COMPILE([#include 
    -                #include ], 
    +            AC_TRY_COMPILE([#include 
    +                            #include ], 
                     [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
    -                ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no)])
    +                 ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no)
                 if test "$ac_cv_struct_pthread_rw" = "no"; then
                     AC_TRY_COMPILE([#define _XOPEN_SOURCE 500
                         #define _BSD_SOURCE
    
    From db382d9aa44dc01f2bc266f0d606510a13bfcfd7 Mon Sep 17 00:00:00 2001
    From: Karl Fogel 
    Date: Fri, 15 Jun 2001 15:08:22 +0000
    Subject: [PATCH 1778/7878] (apr_cpystrn): Doc fix.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61770 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_strings.h | 7 +++++--
     1 file changed, 5 insertions(+), 2 deletions(-)
    
    diff --git a/include/apr_strings.h b/include/apr_strings.h
    index acbe0cee9c4..0a053ac7cab 100644
    --- a/include/apr_strings.h
    +++ b/include/apr_strings.h
    @@ -181,10 +181,13 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...)
             __attribute__((format(printf,2,3)));
     
     /**
    - * copy n characters from src to des>
    + * copy n characters from src to dst
      * @param dst The destination string
      * @param src The source string
    - * @param dst_size The number of characters to copy
    + * @param dst_size The space available in dst; dst always receives
    + *                 null-termination, so if src is longer than
    + *                 dst_size, the actual number of characters copied is
    + *                 dst_size - 1.
      * @tip  
      * 
      * We re-implement this function to implement these specific changes:
    
    From 36584fd271d97aae5a9e71e7084d102857828746 Mon Sep 17 00:00:00 2001
    From: Ben Collins-Sussman 
    Date: Fri, 15 Jun 2001 20:04:43 +0000
    Subject: [PATCH 1779/7878] Bugfix for the unix version of apr_dir_read().  I
     caught it on my FreeBSD 4.3 machine while trying to debug Subversion.  :)
    
    It happened in the thread-less section of code (since threads are
    turned off on FreeBSD).  It turns out that apr_dir_remove() had
    previously failed and set the global `errno'.  Then later on I tried
    to do a looping apr_dir_read() in an empty directory.  After returning
    `.' and `..' as usual, the underlying unix readdir() returned NULL --
    as it should.  However, apr_dir_read() didn't return ENOENT as it
    ought to; instead, it noticed that `errno' still had an old value and
    returned that instead.  The solution is to zero errno beforehand,
    unless someone has a better suggestion.
    
    * file_io/unix/dir.c (apr_dir_read): clear errno *before* you depend
      on its value after calling readdir().
    
    * test/testdir.c:  new regression test for this bug.
    
    * test/Makefile.in (testdir):  build the new test.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61771 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/dir.c |   4 ++
     test/Makefile.in   |   4 ++
     test/testdir.c     | 131 +++++++++++++++++++++++++++++++++++++++++++++
     3 files changed, 139 insertions(+)
     create mode 100644 test/testdir.c
    
    diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
    index b4ee74f8b76..013a9fcf5f3 100644
    --- a/file_io/unix/dir.c
    +++ b/file_io/unix/dir.c
    @@ -123,6 +123,10 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
         if(!ret && thedir->entry != retent)
             ret = APR_ENOENT;
     #else
    +    /* We're about to call a non-thread-safe readdir() that may
    +       possibly set `errno', and the logic below actually cares about
    +       errno after the call.  Therefore we need to clear errno first. */
    +    errno = 0;
         thedir->entry = readdir(thedir->dirstruct);
         if (thedir->entry == NULL) {
             /* If NULL was returned, this can NEVER be a success. Can it?! */
    diff --git a/test/Makefile.in b/test/Makefile.in
    index c477bb46d67..af31e41cb47 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -4,6 +4,7 @@ PROGRAMS = \
     	sendfile@EXEEXT@ \
     	server@EXEEXT@ \
     	testfile@EXEEXT@ \
    +	testdir@EXEEXT@ \
     	testnames@EXEEXT@ \
     	testflock@EXEEXT@ \
     	testproc@EXEEXT@ \
    @@ -43,6 +44,9 @@ INCLUDES=-I$(INCDIR)
     testfile@EXEEXT@: testfile.lo $(LOCAL_LIBS)
     	$(LINK) testfile.lo $(LOCAL_LIBS) $(ALL_LIBS)
     
    +testdir@EXEEXT@: testdir.lo $(LOCAL_LIBS)
    +	$(LINK) testdir.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +
     testnames@EXEEXT@: testnames.lo $(LOCAL_LIBS)
     	$(LINK) testnames.lo $(LOCAL_LIBS) $(ALL_LIBS)
     
    diff --git a/test/testdir.c b/test/testdir.c
    new file mode 100644
    index 00000000000..e20c219d271
    --- /dev/null
    +++ b/test/testdir.c
    @@ -0,0 +1,131 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +#include 
    +#include 
    +#include 
    +#include 
    +#include "apr_file_io.h"
    +#include "apr_file_info.h"
    +#include "apr_errno.h"
    +#include "apr_general.h"
    +#include "apr_lib.h"
    +#include "test_apr.h"
    +
    +
    +/* Test for a (fixed) bug in apr_dir_read().  This bug only happened
    +   in threadless cases. */
    +
    +int main(void)
    +{
    +    apr_pool_t *pool;
    +    apr_file_t *thefile = NULL;
    +    apr_finfo_t finfo;
    +    apr_int32_t finfo_flags = APR_FINFO_TYPE | APR_FINFO_NAME;
    +    apr_dir_t *this_dir;
    + 
    +    printf("APR Directory Read Test\n===========================\n\n");
    +    
    +    STD_TEST_NEQ("Initializing APR", apr_initialize())
    +    atexit(apr_terminate);
    +    STD_TEST_NEQ("Creating the main pool we'll use", 
    +                 apr_pool_create(&pool, NULL))    
    +
    +    fprintf(stdout, "Testing for readdir() bug.\n");
    +
    +    /* Make two empty directories, and put a file in one of them. */
    +    STD_TEST_NEQ("    Creating empty dir1",
    +                 apr_dir_make("dir1", APR_OS_DEFAULT, pool))
    +    STD_TEST_NEQ("    Creating empty dir2",
    +                 apr_dir_make("dir2", APR_OS_DEFAULT, pool))
    +    STD_TEST_NEQ("    Creating dir1/file1",
    +                 apr_file_open(&thefile, "dir1/file1",
    +                               APR_READ | APR_WRITE | APR_CREATE,
    +                               APR_OS_DEFAULT, pool))
    +
    +    /* Try to remove dir1.  This should fail because it's not empty.
    +       However, on a platform with threads disabled (such as FreeBSD),
    +       `errno' will be set as a result. */
    +    TEST_EQ("    Failing to remove dir1", apr_dir_remove("dir1", pool), 
    +            APR_SUCCESS, "OK", "Failed") 
    +    
    +    /* Read `.' and `..' out of dir2. */
    +    STD_TEST_NEQ("    Opening dir2",
    +                 apr_dir_open(&this_dir, "dir2", pool))
    +    STD_TEST_NEQ("       reading `.' entry",
    +                 apr_dir_read(&finfo, finfo_flags, this_dir))
    +    STD_TEST_NEQ("       reading `..' entry",
    +                 apr_dir_read(&finfo, finfo_flags, this_dir))
    +
    +    /* Now, when we attempt to do a third read of empty dir2, and the
    +       underlying system readdir() returns NULL, the old value of
    +       errno shouldn't cause a false alarm.  We should get an ENOENT
    +       back from apr_dir_read, and *not* the old errno. */
    +    TEST_NEQ("       get ENOENT on 3rd read", 
    +             apr_dir_read(&finfo, finfo_flags, this_dir),
    +             APR_ENOENT, "OK", "Failed")
    +
    +    /* Cleanup */
    +    STD_TEST_NEQ("    Cleanup file1",
    +                 apr_file_remove("dir1/file1", pool))
    +    STD_TEST_NEQ("    Cleanup dir1",
    +                 apr_dir_remove("dir1", pool))
    +    STD_TEST_NEQ("    Cleanup dir2",
    +                 apr_dir_remove("dir2", pool))
    +
    +    apr_pool_destroy(pool);
    +
    +    printf("\nAll tests passed OK\n");
    +    return 1;
    +}
    
    From 917fd8075ebd0492276ea355ac585693050407a1 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Sat, 16 Jun 2001 01:08:59 +0000
    Subject: [PATCH 1780/7878] OS/2: Add another possibility for ENOENT & fix a
     missing macro line joiner in APR_STATUS_IS_EPIPE.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61772 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 1e05819d599..cdca159e95b 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -546,6 +546,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_ENOENT(s)         ((s) == APR_ENOENT \
                     || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \
                     || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
    +                || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES \
                     || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED)
     #define APR_STATUS_IS_ENOTDIR(s)        ((s) == APR_ENOTDIR)
     #define APR_STATUS_IS_ENOSPC(s)         ((s) == APR_ENOSPC \
    @@ -585,7 +586,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
                     || (s) == APR_OS_START_SYSERR + SOCENETUNREACH)
     #define APR_STATUS_IS_EFTYPE(s)         ((s) == APR_EFTYPE)
     #define APR_STATUS_IS_EPIPE(s)          ((s) == APR_EPIPE \
    -                || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE
    +                || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE \
                     || (s) == APR_OS_START_SYSERR + SOCEPIPE)
     
     /*
    
    From d9c7627035bbcb7f22318448f9dbc035f7109b99 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Sat, 16 Jun 2001 01:13:34 +0000
    Subject: [PATCH 1781/7878] OS/2: correct APR_SIZE_T_FMT
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61773 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/configure.in b/configure.in
    index 994435f8ff6..aa3ccffa04f 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -770,9 +770,13 @@ fi
     # it right.  If you find that we don't get it right for your platform, 
     # you can override our decision below.
     case "$OS" in
    -   *linux* | *os2_emx)
    +   *linux*)
            off_t_fmt='#define APR_OFF_T_FMT "ld"'
            ;;
    +   *os2_emx)
    +       off_t_fmt='#define APR_OFF_T_FMT "ld"'
    +       size_t_fmt='#define APR_SIZE_T_FMT "lu"'
    +       ;;
        *-solaris*)
            off_t_fmt='#define APR_OFF_T_FMT "ld"'
            os_proc_t_fmt='#define APR_OS_PROC_T_FMT "ld"'
    
    From 58c963aef45168fffd1b8f4c6d9577bd341f9c1b Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Sat, 16 Jun 2001 01:27:15 +0000
    Subject: [PATCH 1782/7878] OS/2: Add implementations of apr_file_trunc(),
     apr_os_thread_current() & apr_os_thread_equal().
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61774 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/os2/seek.c      | 17 +++++++++++++++++
     threadproc/os2/thread.c | 17 +++++++++++++++++
     2 files changed, 34 insertions(+)
    
    diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c
    index 4d4c4d06a43..1744553fd41 100644
    --- a/file_io/os2/seek.c
    +++ b/file_io/os2/seek.c
    @@ -131,3 +131,20 @@ apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_
             return APR_OS2_STATUS(DosSetFilePtr(thefile->filedes, *offset, where, (ULONG *)&offset));
         }
     }
    +
    +
    +
    +apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset)
    +{
    +    int rc = DosSetFileSize(fp->filedes, offset);
    +
    +    if (rc != 0) {
    +        return APR_OS2_STATUS(rc);
    +    }
    +
    +    if (fp->buffered) {
    +        return setptr(fp, offset);
    +    }
    +
    +    return APR_SUCCESS;
    +}
    diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c
    index 0f15e6fe327..660e7e0efa0 100644
    --- a/threadproc/os2/thread.c
    +++ b/threadproc/os2/thread.c
    @@ -148,6 +148,16 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr,
     
     
     
    +apr_os_thread_t apr_os_thread_current()
    +{
    +    PIB *ppib;
    +    TIB *ptib;
    +    DosGetInfoBlocks(&ptib, &ppib);
    +    return ptib->tib_ptib2->tib2_ultid;
    +}
    +
    +
    +
     apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval)
     {
         thd->rv = retval;
    @@ -205,6 +215,13 @@ apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd,
     
     
     
    +int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2)
    +{
    +    return tid1 == tid2;
    +}
    +
    +
    +
     apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread)
     {
         return apr_pool_userdata_get(data, key, thread->cntxt);
    
    From 9a3a02e0b92d17b1a71557384785eb7946538147 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 17 Jun 2001 19:06:14 +0000
    Subject: [PATCH 1783/7878]   That is the _ugliest_ bug I've ever committed :-)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61775 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filestat.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
    index 0c26b8e8154..b5a41f4589f 100644
    --- a/file_io/win32/filestat.c
    +++ b/file_io/win32/filestat.c
    @@ -553,5 +553,5 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
     APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname,
                                         apr_int32_t wanted, apr_pool_t *cont)
     {
    -    return apr_stat(finfo, fname, wanted & APR_FINFO_LINK, cont);
    +    return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, cont);
     }
    
    From 5b9d00823b3b2b829ad201d08feaee6d78c59ac4 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 17 Jun 2001 19:54:41 +0000
    Subject: [PATCH 1784/7878] Add a read/write locking implementation for BeOS.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61776 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/beos/locks.h |  14 ++-
     locks/beos/locks.c        | 222 +++++++++++++++++++++++++++++++++-----
     2 files changed, 205 insertions(+), 31 deletions(-)
    
    diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h
    index 8e332600f78..31ddb7f184a 100644
    --- a/include/arch/beos/locks.h
    +++ b/include/arch/beos/locks.h
    @@ -69,8 +69,18 @@ struct apr_lock_t {
         apr_os_thread_t owner;
         int owner_ref;
     
    -    sem_id sem;
    -    int32  ben;
    +    /* Our lock :) */
    +    sem_id Lock;
    +    int32  LockCount;
    +
    +    /* Read/Write lock stuff */
    +    sem_id Read;
    +    int32  ReadCount;
    +    sem_id Write;
    +    int32  WriteCount;
    +    int32  Nested;
    +
    +    thread_id writer;
     };
     
     #endif  /* LOCKS_H */
    diff --git a/locks/beos/locks.c b/locks/beos/locks.c
    index 3603e5b5648..1e92fb0affe 100644
    --- a/locks/beos/locks.c
    +++ b/locks/beos/locks.c
    @@ -52,26 +52,56 @@
      * .
      */
     
    +/*Read/Write locking implementation based on the MultiLock code from
    + * Stephen Beaulieu 
    + */
    + 
     #include "beos/locks.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    +#define BIG_NUM 100000
     
    -/* At present we only have one implementation, so here it is :) */
     static apr_status_t _lock_cleanup(void * data)
     {
         apr_lock_t *lock = (apr_lock_t*)data;
    -    if (lock->ben != 0) {
    +    if (lock->LockCount != 0) {
             /* we're still locked... */
    -    	while (atomic_add(&lock->ben , -1) > 1){
    +    	while (atomic_add(&lock->LockCount , -1) > 1){
         	    /* OK we had more than one person waiting on the lock so 
         	     * the sem is also locked. Release it until we have no more
         	     * locks left.
         	     */
    -            release_sem (lock->sem);
    +            release_sem (lock->Lock);
         	}
         }
    -    delete_sem(lock->sem);
    +    delete_sem(lock->Lock);
    +    return APR_SUCCESS;
    +}    
    +
    +static apr_status_t _lock_rw_cleanup(void * data)
    +{
    +    apr_lock_t *lock = (apr_lock_t*)data;
    +
    +    if (lock->ReadCount != 0) {
    +    	while (atomic_add(&lock->ReadCount , -1) > 1){
    +            release_sem (lock->Read);
    +    	}
    +    }
    +    if (lock->WriteCount != 0) {
    +    	while (atomic_add(&lock->WriteCount , -1) > 1){
    +            release_sem (lock->Write);
    +    	}
    +    }
    +    if (lock->LockCount != 0) {
    +    	while (atomic_add(&lock->LockCount , -1) > 1){
    +            release_sem (lock->Lock);
    +    	}
    +    }
    +    
    +    delete_sem(lock->Read);
    +    delete_sem(lock->Write);
    +    delete_sem(lock->Lock);
         return APR_SUCCESS;
     }    
     
    @@ -79,24 +109,44 @@ static apr_status_t _create_lock(apr_lock_t *new)
     {
         int32 stat;
         
    -    if ((stat = create_sem(0, "apr_lock")) < B_NO_ERROR) {
    +    if ((stat = create_sem(0, "APR_Lock")) < B_NO_ERROR) {
             _lock_cleanup(new);
             return stat;
         }
    -    new->ben = 0;
    -    new->sem = stat;
    +    new->LockCount = 0;
    +    new->Lock = stat;
         apr_pool_cleanup_register(new->pool, (void *)new, _lock_cleanup,
                                   apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    +static apr_status_t _create_rw_lock(apr_lock_t *new)
    +{
    +    /* we need to make 3 locks... */
    +    new->ReadCount = 0;
    +    new->WriteCount = 0;
    +    new->LockCount = 0;
    +    new->Read  = create_sem(0, "APR_ReadLock");
    +    new->Write = create_sem(0, "APR_WriteLock");
    +    new->Lock  = create_sem(0, "APR_Lock");
    +    
    +    if (new->Lock < 0 || new->Read < 0 || new->Write < 0) {
    +        _lock_rw_cleanup(new);
    +        return -1;
    +    }
    +
    +    apr_pool_cleanup_register(new->pool, (void *)new, _lock_rw_cleanup,
    +                              apr_pool_cleanup_null);
    +    return APR_SUCCESS;
    +}
    +
     static apr_status_t _lock(apr_lock_t *lock)
     {
         int32 stat;
         
    -	if (atomic_add(&lock->ben, 1) > 0) {
    -		if ((stat = acquire_sem(lock->sem)) < B_NO_ERROR) {
    -		    atomic_add(&lock->ben, -1);
    +	if (atomic_add(&lock->LockCount, 1) > 0) {
    +		if ((stat = acquire_sem(lock->Lock)) < B_NO_ERROR) {
    +		    atomic_add(&lock->LockCount, -1);
     		    return stat;
     		}
     	}
    @@ -107,15 +157,112 @@ static apr_status_t _unlock(apr_lock_t *lock)
     {
         int32 stat;
         
    -	if (atomic_add(&lock->ben, -1) > 1) {
    -        if ((stat = release_sem(lock->sem)) < B_NO_ERROR) {
    -            atomic_add(&lock->ben, 1);
    +	if (atomic_add(&lock->LockCount, -1) > 1) {
    +        if ((stat = release_sem(lock->Lock)) < B_NO_ERROR) {
    +            atomic_add(&lock->LockCount, 1);
                 return stat;
             }
         }
         return APR_SUCCESS;
     }
     
    +static apr_status_t _read_lock(apr_lock_t *lock)
    +{
    +    int32 rv = APR_SUCCESS;
    +
    +    if (find_thread(NULL) == lock->writer) {
    +        /* we're the writer - no problem */
    +        lock->Nested++;
    +    } else {
    +        /* we're not the writer */
    +        int32 r = atomic_add(&lock->ReadCount, 1);
    +        if (r < 0) {
    +            /* Oh dear, writer holds lock, wait for sem */
    +            rv = acquire_sem_etc(lock->Read, 1, B_DO_NOT_RESCHEDULE,
    +                                 B_INFINITE_TIMEOUT);
    +        }
    +    }
    +
    +    return rv;
    +}
    +
    +static apr_status_t _write_lock(apr_lock_t *lock)
    +{
    +    int rv = APR_SUCCESS;
    +
    +    if (find_thread(NULL) == lock->writer) {
    +        lock->Nested++;
    +    } else {
    +        /* we're not the writer... */
    +        if (atomic_add(&lock->LockCount, 1) >= 1) {
    +            /* we're locked - acquire the sem */
    +            rv = acquire_sem_etc(lock->Lock, 1, B_DO_NOT_RESCHEDULE,
    +                                 B_INFINITE_TIMEOUT);
    +        }
    +        if (rv == APR_SUCCESS) {
    +            /* decrement the ReadCount to a large -ve number so that
    +             * we block on new readers...
    +             */
    +            int32 readers = atomic_add(&lock->ReadCount, -BIG_NUM);
    +            if (readers > 0) {
    +                /* readers are holding the lock */
    +                rv = acquire_sem_etc(lock->Write, readers, B_DO_NOT_RESCHEDULE,
    +                                     B_INFINITE_TIMEOUT);
    +            }
    +            if (rv == APR_SUCCESS)
    +                lock->writer = find_thread(NULL);
    +        }
    +    }
    +    
    +    return rv;
    +}
    +
    +
    +static apr_status_t _read_unlock(apr_lock_t *lock)
    +{
    +    apr_status_t rv = APR_SUCCESS;
    +    
    +    /* we know we hold the lock, so don't check it :) */
    +    if (find_thread(NULL) == lock->writer) {
    +        /* we're recursively locked */
    +        lock->Nested--;
    +        return APR_SUCCESS;
    +    }
    +    /* OK so we need to release the sem if we have it :) */
    +    if (atomic_add(&lock->ReadCount, -1) < 0) {
    +        /* we have a writer waiting for the lock, so release it */
    +        rv = release_sem_etc(lock->Write, 1, B_DO_NOT_RESCHEDULE);
    +    }
    +
    +    return rv;
    +}
    +
    +static apr_status_t _write_unlock(apr_lock_t *lock)
    +{
    +    apr_status_t rv = APR_SUCCESS;
    +    int32 readers;
    +    
    +    /* we know we hold the lock, so don't check it :) */
    +    if (lock->Nested > 1) {
    +        /* we're recursively locked */
    +        lock->Nested--;
    +        return APR_SUCCESS;
    +    }
    +    /* OK so we need to release the sem if we have it :) */
    +    readers = atomic_add(&lock->ReadCount, BIG_NUM) + BIG_NUM;
    +    if (readers > 0) {
    +        rv = release_sem_etc(lock->Read, readers, B_DO_NOT_RESCHEDULE);
    +    }
    +    if (rv == APR_SUCCESS) {
    +        lock->writer = -1;
    +        if (atomic_add(&lock->LockCount, -1) > 1) {
    +            rv = release_sem_etc(lock->Lock, 1, B_DO_NOT_RESCHEDULE);
    +        }
    +    }
    +    
    +    return rv;
    +}
    +
     static apr_status_t _destroy_lock(apr_lock_t *lock)
     {
         apr_status_t stat;
    @@ -131,12 +278,8 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
                                apr_pool_t *pool)
     {
         apr_lock_t *new;
    -    apr_status_t stat;
    +    apr_status_t stat = APR_SUCCESS;
       
    -    /* FIXME: Remove when read write locks implemented. */ 
    -    if (type == APR_READWRITE)
    -        return APR_ENOTIMPL; 
    -
         new = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t));
         if (new == NULL){
             return APR_ENOMEM;
    @@ -146,7 +289,13 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
         new->type  = type;
         new->scope = scope;
     
    -    if ((stat = _create_lock(new)) != APR_SUCCESS)
    +    if (type == APR_MUTEX) {
    +        stat = _create_lock(new);
    +    } else if (type == APR_READWRITE) {
    +        stat = _create_rw_lock(new);
    +    }
    +            
    +    if (stat != APR_SUCCESS)
             return stat;
     
         (*lock) = new;
    @@ -189,11 +338,12 @@ apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e)
             switch (e)
             {
             case APR_READER:
    +            _read_lock(lock);
                 break;
             case APR_WRITER:
    +            _write_lock(lock);
                 break;
             }
    -        return APR_ENOTIMPL;
         }
     
         return APR_SUCCESS;
    @@ -201,7 +351,7 @@ apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e)
     
     apr_status_t apr_lock_release(apr_lock_t *lock)
     {
    -    apr_status_t stat;
    +    apr_status_t stat = APR_SUCCESS;
     
         if (lock->owner_ref > 0 && lock->owner == apr_os_thread_current()) {
             lock->owner_ref--;
    @@ -212,13 +362,27 @@ apr_status_t apr_lock_release(apr_lock_t *lock)
         switch (lock->type)
         {
         case APR_MUTEX:
    -        if ((stat = _unlock(lock)) != APR_SUCCESS)
    -            return stat;
    +        stat = _unlock(lock);
             break;
         case APR_READWRITE:
    -        return APR_ENOTIMPL;
    +        {
    +            thread_id me = find_thread(NULL);
    +            if (me == lock->writer)
    +                stat = _write_unlock(lock);
    +            else
    +                stat = _read_unlock(lock);
    +        }
    +        /* if we don't hold the read or write lock then why are
    +         * we calling release???
    +         *
    +         * Just return success.
    +         */
    +        break;
         }
     
    +    if (stat != APR_SUCCESS)
    +        return stat;
    +    
         lock->owner = -1;
         lock->owner_ref = 0;
     
    @@ -261,8 +425,8 @@ apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key,
     
     apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock)
     {
    -    oslock->sem = lock->sem;
    -    oslock->ben = lock->ben;
    +    oslock->sem = lock->Lock;
    +    oslock->ben = lock->LockCount;
         return APR_SUCCESS;
     }
     
    @@ -276,8 +440,8 @@ apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock,
             (*lock) = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t));
             (*lock)->pool = pool;
         }
    -    (*lock)->sem = thelock->sem;
    -    (*lock)->ben = thelock->ben;
    +    (*lock)->Lock = thelock->sem;
    +    (*lock)->LockCount = thelock->ben;
     
         return APR_SUCCESS;
     }
    
    From 121541124f8ed17361406675302262114fbc266a Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 17 Jun 2001 21:07:43 +0000
    Subject: [PATCH 1785/7878] First pass at some alignment macro's for the sms
     code.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61777 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_sms.h | 7 +++++++
     1 file changed, 7 insertions(+)
    
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index 22412932b4a..5aef931b226 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -77,6 +77,13 @@ extern "C" {
     #define APR_CHILD_CLEANUP     0x0001
     #define APR_PARENT_CLEANUP    0x0002
     
    +/* Alignment macro's */
    +#define ALIGN(size, boundary) \
    +    ((size) + (((boundary) - ((size) & ((boundary) - 1))) & ((boundary) - 1)))
    +
    +#define ALIGN_DEFAULT(size) ALIGN(size, 8)
    +
    +
     /**
      * @package APR memory system
      */
    
    From 8d63a60c2e334ef21472deab30db2a637636003a Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 17 Jun 2001 21:11:58 +0000
    Subject: [PATCH 1786/7878] Make the locking conditional on having a lock to
     use.
    
    (Sander and I did this at the same time, so it's basically his patch,
    albeit from my machine :)
    
    Submitted by:	Sander Striker 
    Reviewed by:	David Reid 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61778 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms.c | 49 ++++++++++++++++++++++++++++---------------
     1 file changed, 32 insertions(+), 17 deletions(-)
    
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index 58cd99157a6..e50d5156536 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -200,7 +200,8 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms,
              * We only need to lock the parent as the only other function that
              * touches the fields we're about to mess with is apr_sms_destroy
              */
    -        apr_lock_acquire(pms->sms_lock);
    +        if (pms->sms_lock)
    +            apr_lock_acquire(pms->sms_lock);
             
             if ((sms->sibling = pms->child) != NULL)
                 sms->sibling->ref = &sms->sibling;
    @@ -208,7 +209,8 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms,
             sms->ref = &pms->child;
             pms->child = sms;
     
    -        apr_lock_release(pms->sms_lock);    
    +        if (pms->sms_lock)
    +            apr_lock_release(pms->sms_lock);    
         }
     
         /* Set default functions.  These should NOT be altered by an sms
    @@ -336,7 +338,8 @@ APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *sms)
         if (!sms->reset_fn)
             return APR_ENOTIMPL;
     
    -    apr_lock_acquire(sms->sms_lock);
    +    if (sms->sms_lock)
    +        apr_lock_acquire(sms->sms_lock);
         
         /* 
          * Run the cleanups of all child memory systems _including_
    @@ -362,7 +365,8 @@ APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *sms)
         /* Let the memory system handle the actual reset */
         rv = sms->reset_fn(sms);
     
    -    apr_lock_release(sms->sms_lock);
    +    if (sms->sms_lock)
    +        apr_lock_release(sms->sms_lock);
         
         return rv;
     }
    @@ -375,7 +379,8 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms)
         struct apr_sms_cleanup *cleanup;
         struct apr_sms_cleanup *next_cleanup;
     
    -    apr_lock_acquire(sms->sms_lock);
    +    if (sms->sms_lock)
    +        apr_lock_acquire(sms->sms_lock);
         
         if (apr_sms_is_tracking(sms)) {
             /* 
    @@ -462,7 +467,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms)
         pms = sms->parent;
         
         /* Remove the memory system from the parent memory systems child list */
    -    if (pms)
    +    if (pms->sms_lock)
             apr_lock_acquire(pms->sms_lock);
             
         if (sms->sibling)
    @@ -471,14 +476,15 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms)
         if (sms->ref)
             *sms->ref = sms->sibling;
     
    -    if (pms)
    +    if (pms->sms_lock)
             apr_lock_release(pms->sms_lock);
             
         /* Call the pre-destroy if present */
         if (sms->pre_destroy_fn)
             sms->pre_destroy_fn(sms);
     
    -    apr_lock_destroy(sms->sms_lock);
    +    if (sms->sms_lock)
    +        apr_lock_destroy(sms->sms_lock);
         
         /* XXX - This should eventually be removed */
         apr_pool_destroy(sms->pool);
    @@ -561,14 +567,16 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms,
         if (!cleanup_fn)
             return APR_ENOTIMPL;
         
    -    apr_lock_acquire(sms->sms_lock);
    +    if (sms->sms_lock)
    +        apr_lock_acquire(sms->sms_lock);
         
         cleanup = (struct apr_sms_cleanup *)
                       apr_sms_malloc(sms->accounting,
                                      sizeof(struct apr_sms_cleanup));
     
         if (!cleanup){
    -        apr_lock_release(sms->sms_lock);
    +        if (sms->sms_lock)
    +            apr_lock_release(sms->sms_lock);
             return APR_ENOMEM;
         }
     
    @@ -579,7 +587,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms,
         cleanup->next = sms->cleanups;
         sms->cleanups = cleanup;
     
    -    apr_lock_release(sms->sms_lock);
    +    if (sms->sms_lock)
    +        apr_lock_release(sms->sms_lock);
         
         return APR_SUCCESS;
     }
    @@ -594,7 +603,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms,
         struct apr_sms_cleanup **cleanup_ref;
         apr_status_t rv = APR_EINVAL;
         
    -    apr_lock_acquire(sms->sms_lock);
    +    if (sms->sms_lock)
    +        apr_lock_acquire(sms->sms_lock);
         
         cleanup = sms->cleanups;
         cleanup_ref = &sms->cleanups;
    @@ -615,7 +625,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms,
             }
         }
     
    -    apr_lock_release(sms->sms_lock);
    +    if (sms->sms_lock)
    +        apr_lock_release(sms->sms_lock);
     
         /* The cleanup function must have been registered previously */
         return rv;
    @@ -628,7 +639,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *sms,
         struct apr_sms_cleanup **cleanup_ref;
         apr_status_t rv = APR_EINVAL;
     
    -    apr_lock_acquire(sms->sms_lock);
    +    if (sms->sms_lock)
    +        apr_lock_acquire(sms->sms_lock);
         
         cleanup = sms->cleanups;
         cleanup_ref = &sms->cleanups;
    @@ -649,7 +661,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *sms,
             }
         }
     
    -    apr_lock_release(sms->sms_lock);
    +    if (sms->sms_lock)
    +        apr_lock_release(sms->sms_lock);
         
         /* The cleanup function must have been registered previously */
         return rv;
    @@ -677,7 +690,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms,
         struct apr_sms_cleanup **cleanup_ref;
         apr_status_t rv = APR_EINVAL;
         
    -    apr_lock_acquire(sms->sms_lock);
    +    if (sms->sms_lock)
    +        apr_lock_acquire(sms->sms_lock);
         
         cleanup = sms->cleanups;
         cleanup_ref = &sms->cleanups;
    @@ -700,7 +714,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms,
             }
         }
     
    -    apr_lock_release(sms->sms_lock);
    +    if (sms->sms_lock)
    +        apr_lock_release(sms->sms_lock);
     
         /* The cleanup function should have been registered previously */
         return rv;
    
    From e28bd40a0782a221f2f136a851d74bb8abafa498 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 18 Jun 2001 01:19:01 +0000
    Subject: [PATCH 1787/7878] Sander pointed out it might be worthwhile namespace
     protecting these a little more as it's a public header file :)
    
    Submitted by:	Sander Striker 
    Reviewed by:	David Reid 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61779 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_sms.h | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index 5aef931b226..731654566cb 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -78,10 +78,10 @@ extern "C" {
     #define APR_PARENT_CLEANUP    0x0002
     
     /* Alignment macro's */
    -#define ALIGN(size, boundary) \
    +#define APR_ALIGN(size, boundary) \
         ((size) + (((boundary) - ((size) & ((boundary) - 1))) & ((boundary) - 1)))
     
    -#define ALIGN_DEFAULT(size) ALIGN(size, 8)
    +#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
     
     
     /**
    
    From db9282e147f5cc1a5c5a81bb9958a96d9e527ac1 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 18 Jun 2001 05:08:44 +0000
    Subject: [PATCH 1788/7878]   Normalize (forward slash) path gets on win32, and
     nip a bug that I need   to research further.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61780 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filepath.c | 23 +++++++++++++++++++----
     1 file changed, 19 insertions(+), 4 deletions(-)
    
    diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c
    index 5f5ccc513ce..1c85593ca32 100644
    --- a/file_io/win32/filepath.c
    +++ b/file_io/win32/filepath.c
    @@ -138,6 +138,13 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath,
             if (!GetCurrentDirectory(sizeof(path), path))
                 return apr_get_os_error();
         }
    +    /* ###: We really should consider adding a flag to allow the user
    +     * to have the APR_FILEPATH_NATIVE result
    +     */
    +    for (*rootpath = path; **rootpath; ++*rootpath) {
    +        if (**rootpath == '\\')
    +            **rootpath = '/';
    +    }
         *rootpath = apr_pstrdup(p, path);
         return APR_SUCCESS;
     }
    @@ -165,7 +172,6 @@ static apr_status_t apr_filepath_drive_get(char **rootpath,
                 return apr_get_os_error();
             if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath)))
                 return rv;
    -        *rootpath = apr_pstrdup(p, path);
         }
         else
     #endif
    @@ -178,8 +184,15 @@ static apr_status_t apr_filepath_drive_get(char **rootpath,
             drivestr[3] = '\0';
             if (!GetFullPathName(drivestr, sizeof(path), path, &ignored))
                 return apr_get_os_error();
    -        *rootpath = apr_pstrdup(p, path);
         }
    +    /* ###: We really should consider adding a flag to allow the user
    +     * to have the APR_FILEPATH_NATIVE result
    +     */
    +    for (*rootpath = path; **rootpath; ++*rootpath) {
    +        if (**rootpath == '\\')
    +            **rootpath = '/';
    +    }
    +    *rootpath = apr_pstrdup(p, path);
         return APR_SUCCESS;
     }
     
    @@ -687,8 +700,10 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath,
             
                 path[pathlen++] = ((flags & APR_FILEPATH_NATIVE) ? '\\' : '/');
             }
    -        else if (!fixunc)
    -            path[pathlen++] = ((flags & APR_FILEPATH_NATIVE) ? '\\' : '/');
    +    /*  XXX: wrong, but gotta figure out what I intended;
    +     *  else if (!fixunc)
    +     *      path[pathlen++] = ((flags & APR_FILEPATH_NATIVE) ? '\\' : '/');
    +     */
         }
     
         while (*addpath) 
    
    From 94a5667a76eb3c37e09713aedc42a9dcb74866a8 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 18 Jun 2001 20:14:36 +0000
    Subject: [PATCH 1789/7878] Change some of the logic so we don't segfault if no
     parent. Change to use pms as it's been set to sms->parent and it's clearer.
    
    Submitted by:	Sander Striker 
    Reviewed by:	David Reid 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61781 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms.c | 25 ++++++++++++-------------
     1 file changed, 12 insertions(+), 13 deletions(-)
    
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index e50d5156536..6d8b442b05c 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -467,18 +467,17 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms)
         pms = sms->parent;
         
         /* Remove the memory system from the parent memory systems child list */
    -    if (pms->sms_lock)
    -        apr_lock_acquire(pms->sms_lock);
    +    if (pms) {
    +        if (pms->sms_lock)
    +            apr_lock_acquire(pms->sms_lock);
             
    -    if (sms->sibling)
    -        sms->sibling->ref = sms->ref;
    +        if ((*sms->ref = sms->sibling) != NULL)
    +            sms->sibling->ref = sms->ref;
     
    -    if (sms->ref)
    -        *sms->ref = sms->sibling;
    -
    -    if (pms->sms_lock)
    -        apr_lock_release(pms->sms_lock);
    -        
    +        if (pms->sms_lock)
    +            apr_lock_release(pms->sms_lock);
    +    }
    +    
         /* Call the pre-destroy if present */
         if (sms->pre_destroy_fn)
             sms->pre_destroy_fn(sms);
    @@ -494,16 +493,16 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms)
             return sms->destroy_fn(sms);
     
         /* 2 - If we don't have a parent, free using ourselves */
    -    if (!sms->parent)
    +    if (!pms)
             return sms->free_fn(sms, sms);
     
         /* 3 - If we do have a parent and it has a free function, use it */
    -    if (sms->parent->free_fn)
    +    if (pms->free_fn)
             return apr_sms_free(sms->parent, sms);
     
         /* 4 - Assume we are the child of a tracking memory system, do nothing */
     #ifdef APR_ASSERT_MEMORY
    -    sms = sms->parent;
    +    sms = pms;
         while (sms) {
             if (apr_sms_is_tracking(sms))
                 return APR_SUCCESS;
    
    From 4e865231473d964a558aa9284a850ec64f51da55 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 18 Jun 2001 20:24:13 +0000
    Subject: [PATCH 1790/7878] Change some of the logic for list management to
     make it faster. Adjust the order of assignments for the structure.
    
    Submitted by:	Sander Striker 
    Reviewed by:	David Reid 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61782 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms_tracking.c | 12 +++++-------
     1 file changed, 5 insertions(+), 7 deletions(-)
    
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    index 2178872bd77..9979b7451b1 100644
    --- a/memory/unix/apr_sms_tracking.c
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -92,11 +92,10 @@ typedef struct apr_sms_tracking_t
         if (tms->lock) \
             apr_lock_acquire(tms->lock); \
         \
    -    node->next = tms->nodes; \
    -    tms->nodes = node; \
         node->ref = &tms->nodes; \
    -    if (node->next) \
    +    if ((node->next = tms->nodes) != NULL) \
             node->next->ref = &node->next; \
    +    tms->nodes = node; \
         \
         if (tms->lock) \
             apr_lock_release(tms->lock);
    @@ -106,7 +105,7 @@ typedef struct apr_sms_tracking_t
                 apr_lock_acquire(tms->lock); \
             \
             *(node->ref) = node->next; \
    -        if (node->next) \
    +        if ((*(node->ref) = node->next) != NULL) \
                 node->next->ref = node->ref; \
             \
             if (tms->lock) \
    @@ -208,8 +207,7 @@ static apr_status_t apr_sms_tracking_reset(apr_sms_t *sms)
         
         while (tms->nodes) {
             node = tms->nodes;
    -        *(node->ref) = node->next;
    -        if (node->next)
    +        if ((*(node->ref) = node->next) != NULL)
                 node->next->ref = node->ref;
             if ((rv = apr_sms_free(sms->parent, 
                                    node)) != APR_SUCCESS) {
    @@ -283,9 +281,9 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **sms,
         new_sms->realloc_fn     = apr_sms_tracking_realloc;
         new_sms->free_fn        = apr_sms_tracking_free;
         new_sms->reset_fn       = apr_sms_tracking_reset;
    +    new_sms->pre_destroy_fn = apr_sms_tracking_pre_destroy;
         new_sms->destroy_fn     = apr_sms_tracking_destroy;
         new_sms->identity       = module_identity;
    -    new_sms->pre_destroy_fn = apr_sms_tracking_pre_destroy;
         
         tms = (apr_sms_tracking_t *)new_sms;
         tms->nodes = NULL;
    
    From 841f97900b8db0844db4aa5c43da222444cc707c Mon Sep 17 00:00:00 2001
    From: Doug MacEachern 
    Date: Tue, 19 Jun 2001 20:40:28 +0000
    Subject: [PATCH 1791/7878] apr_pstrcat() optimizations: reuse calculated
     strlen() length use memcpy instead of strcpy PR: Obtained from: Submitted by:
     dougm Reviewed by:	jeff trawick, ryan bloom, bill stoddard
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61783 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES               | 1 +
     strings/apr_strings.c | 7 ++++---
     2 files changed, 5 insertions(+), 3 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 9038af2ba0d..a757c36ba0b 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,4 +1,5 @@
     Changes with APR b1  
    +  *) apr_pstrcat() optimizations [Doug MacEachern, Jeff Trawick]
     
       *) Make the apr_pool_is_ancestor logic public.  This is required for 
          some new logic that is going into HTTPD.  I have left the join logic
    diff --git a/strings/apr_strings.c b/strings/apr_strings.c
    index ab52478c519..7dbbff14d7a 100644
    --- a/strings/apr_strings.c
    +++ b/strings/apr_strings.c
    @@ -130,15 +130,16 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...)
     
         res = (char *) apr_palloc(a, len + 1);
         cp = res;
    -    *cp = '\0';
    +    *(cp + len) = '\0';
     
         /* Pass two --- copy the argument strings into the result space */
     
         va_start(adummy, a);
     
         while ((argp = va_arg(adummy, char *)) != NULL) {
    -        strcpy(cp, argp);
    -        cp += strlen(argp);
    +        len = strlen(argp);
    +        memcpy(cp, argp, len);
    +        cp += len;
         }
     
         va_end(adummy);
    
    From c12c186f631cff9ea992269dc1278daecda94ebf Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 20 Jun 2001 00:56:02 +0000
    Subject: [PATCH 1792/7878]   A fine catch, Mr. Woolley
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61784 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/readwrite.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c
    index ccdaf765d1e..3b26821f304 100644
    --- a/file_io/win32/readwrite.c
    +++ b/file_io/win32/readwrite.c
    @@ -88,7 +88,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le
                                    &dwBytesAvail,          // pointer to total number of bytes available
                                    &dwBytesLeftThisMsg)) { // pointer to unread bytes in this message
                     rv = apr_get_os_error();
    -                if (rv = APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE))
    +                if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE))
                         return APR_SUCCESS;
                 }
                 else {
    
    From 4a698e6da32bd8ff24e76105a948b70ece33ac7c Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 20 Jun 2001 15:52:15 +0000
    Subject: [PATCH 1793/7878] It's not an error if we don't have a free function.
    
    Submitted by:    Sander Striker 
    Reviewed by:     David Reid 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61785 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms.c | 8 +++++++-
     1 file changed, 7 insertions(+), 1 deletion(-)
    
    diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
    index 6d8b442b05c..f25a3500cc4 100644
    --- a/memory/unix/apr_sms.c
    +++ b/memory/unix/apr_sms.c
    @@ -130,7 +130,13 @@ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *sms,
         if (sms->free_fn)
             return sms->free_fn(sms, mem);  
     
    -    return APR_ENOTIMPL;
    +    /*
    +     * If there is no free_fn, this sms is a tracking memory
    +     * system by definition.  In other words, it is ok
    +     * to return APR_SUCCESS because the memory will be
    +     * free()d by the reset or destroy.
    +     */
    +    return APR_SUCCESS;
     }
     
     /*
    
    From 0d5d7477dfedf23b43ecd90c387ece77764c026d Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 20 Jun 2001 17:56:04 +0000
    Subject: [PATCH 1794/7878] Add a macro to allow us to time how long a function
     takes.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61786 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/test_apr.h | 18 ++++++++++++++++--
     1 file changed, 16 insertions(+), 2 deletions(-)
    
    diff --git a/test/test_apr.h b/test/test_apr.h
    index 744dd5d3b5a..cfe4f6cf98c 100644
    --- a/test/test_apr.h
    +++ b/test/test_apr.h
    @@ -62,7 +62,12 @@
      * in the spacing, so use spaces instead :)
      * 
      */ 
    +
    +#ifndef APR_TEST_INCLUDES
    +#define APR_TEST_INCLUDES
    +
     #include "apr_strings.h"
    +#include "apr_time.h"
     
     #define TEST_EQ(str, func, value, good, bad) \
         printf("%-60s", str); \
    @@ -79,7 +84,7 @@
         }
     
     #define TEST_NEQ(str, func, value, good, bad) \
    -printf("%-60s", str); \
    +    printf("%-60s", str); \
         { \
         apr_status_t rv; \
         if ((rv = func) != value){ \
    @@ -106,4 +111,13 @@ printf("%-60s", str); \
     #define MSG_AND_EXIT(msg) \
         printf("%s\n", msg); \
         exit (-1);
    -    
    \ No newline at end of file
    +
    +#define TIME_FUNCTION(time, function) \
    +    { \
    +        apr_time_t tt = apr_time_now(); \
    +        function; \
    +        time = apr_time_now() - tt; \
    +    }
    +    
    +    
    +#endif /* APR_TEST_INCLUDES */
    
    From 83670befbe098fdaf4fbd92489032c1dc430da08 Mon Sep 17 00:00:00 2001
    From: Doug MacEachern 
    Date: Wed, 20 Jun 2001 19:50:29 +0000
    Subject: [PATCH 1795/7878] make termination of apr_pstrcat-ed string a bit
     faster (from jeff trawick)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61787 13f79535-47bb-0310-9956-ffa450edef68
    ---
     strings/apr_strings.c | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/strings/apr_strings.c b/strings/apr_strings.c
    index 7dbbff14d7a..7bdc1ef99b5 100644
    --- a/strings/apr_strings.c
    +++ b/strings/apr_strings.c
    @@ -130,7 +130,6 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...)
     
         res = (char *) apr_palloc(a, len + 1);
         cp = res;
    -    *(cp + len) = '\0';
     
         /* Pass two --- copy the argument strings into the result space */
     
    @@ -146,6 +145,8 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...)
     
         /* Return the result string */
     
    +    *cp = '\0';
    +
         return res;
     }
     
    
    From 3c95a8335155d1651dfc0b89ce94a8523ac4ccef Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Wed, 20 Jun 2001 23:36:30 +0000
    Subject: [PATCH 1796/7878] Update the blocks sms to deal with unlimited
     allocations.
    
    Reviewed by: Sander Striker 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61788 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms_blocks.c | 165 +++++++++++++++++++++++++----------
     1 file changed, 119 insertions(+), 46 deletions(-)
    
    diff --git a/memory/unix/apr_sms_blocks.c b/memory/unix/apr_sms_blocks.c
    index fa7f346d074..803a48fb297 100644
    --- a/memory/unix/apr_sms_blocks.c
    +++ b/memory/unix/apr_sms_blocks.c
    @@ -72,52 +72,77 @@
     #include "apr_want.h"
     
     static const char *module_identity = "BLOCKS";
    -#define SIZE_TO_MALLOC 8 * 1024
    +#define MIN_ALLOC     8 * 1024 /* don't allocate in smaller blocks than 8Kb */
     
     /*
      * Simple bucket memory system
      */
     
     /* INTERNALLY USED STRUCTURES */
    -typedef struct block_t block_t;
    -struct block_t {
    -    void *nxt;
    -};
    +typedef struct block_t {
    +    char *nxt;
    +} block_t;
     
    -typedef struct apr_sms_blocks_t apr_sms_blocks_t;
    -struct apr_sms_blocks_t
    +typedef struct apr_sms_blocks_t
     {
         apr_sms_t            header;
         apr_size_t           block_sz;
    +    apr_size_t           alloc_sz; 
    +    block_t             *alloc_list;
    +    block_t             *free_list;
         char                *ptr;
         char                *endp;
    -    block_t             *free_list;
    -    apr_lock_t          *lock;
    -};
    +    char                *self_endp;
    +} apr_sms_blocks_t;
    +
    +/* Various defines we'll use */
    +#define SIZEOF_SMS_BLOCKS_T         APR_ALIGN_DEFAULT(sizeof(apr_sms_blocks_t))
    +#define SIZEOF_BLOCK_T              APR_ALIGN_DEFAULT(sizeof(block_t))
     
    -#define SIZEOF_BLOCKS_T (sizeof(apr_sms_blocks_t) + \
    -                        ((0x8 - (sizeof(apr_sms_blocks_t) & 0x7)) & 0x7))
    -#define BLOCKS_T(sms)   ((apr_sms_blocks_t *)sms)
    +#define SMS_BLOCKS_T(sms)           ((apr_sms_blocks_t *)sms)
    +#define BLOCK_T(mem)                ((block_t *)mem)
     
     static void *apr_sms_blocks_malloc(apr_sms_t *sms,
                                        apr_size_t size)
     {
         void *mem;
    -    
    -    if (size > BLOCKS_T(sms)->block_sz)
    +
    +    if (size > SMS_BLOCKS_T(sms)->block_sz)
             return NULL;
     
    -    if ((mem = BLOCKS_T(sms)->free_list) != NULL) {
    -        BLOCKS_T(sms)->free_list = ((block_t*)mem)->nxt;
    +    if ((mem = SMS_BLOCKS_T(sms)->free_list) != NULL) {
    +        SMS_BLOCKS_T(sms)->free_list = BLOCK_T(BLOCK_T(mem)->nxt);
             return mem;
         }
    -    
    -    mem = BLOCKS_T(sms)->ptr;
    -    BLOCKS_T(sms)->ptr += BLOCKS_T(sms)->block_sz;
     
    -    if (BLOCKS_T(sms)->ptr > BLOCKS_T(sms)->endp)
    +    mem = SMS_BLOCKS_T(sms)->ptr;
    +    if ((SMS_BLOCKS_T(sms)->ptr = (char *)mem + SMS_BLOCKS_T(sms)->block_sz)
    +                               <= SMS_BLOCKS_T(sms)->endp)
    +        return mem;
    +        
    +    /* OK, we've run out of memory.  Let's get more :) */
    +    mem = apr_sms_malloc(sms->parent, SMS_BLOCKS_T(sms)->alloc_sz);
    +    if (!mem) {
    +        /* make safe and return */
    +        SMS_BLOCKS_T(sms)->ptr = SMS_BLOCKS_T(sms)->endp;
             return NULL;
    +    }
    +
    +    /* Insert our new bit of memory at the start of the list */
    +    BLOCK_T(mem)->nxt = (char*)SMS_BLOCKS_T(sms)->alloc_list;
    +    SMS_BLOCKS_T(sms)->alloc_list = mem;
    +    SMS_BLOCKS_T(sms)->endp = (char *)mem + SMS_BLOCKS_T(sms)->alloc_sz;
    +    (char *)mem += SIZEOF_BLOCK_T;
    +    SMS_BLOCKS_T(sms)->ptr = (char *)mem + SMS_BLOCKS_T(sms)->block_sz;
    +
    +    if (SMS_BLOCKS_T(sms)->alloc_list->nxt) {
    +        /* we're not the first block being added, so we increase our
    +         * size.
    +         */
    +        SMS_BLOCKS_T(sms)->alloc_sz <<= 1;
    +    }
     
    +    
         return mem;
     }
         
    @@ -125,45 +150,84 @@ static void *apr_sms_blocks_calloc(apr_sms_t *sms,
                                        apr_size_t size)
     {
         void *mem;
    -    
    -    if (size > BLOCKS_T(sms)->block_sz)
    +
    +    if (size > SMS_BLOCKS_T(sms)->block_sz)
             return NULL;
     
    -    if ((mem = BLOCKS_T(sms)->free_list) != NULL) {
    -        BLOCKS_T(sms)->free_list = ((block_t*)mem)->nxt;
    +    if ((mem = SMS_BLOCKS_T(sms)->free_list) != NULL) {
    +        SMS_BLOCKS_T(sms)->free_list = BLOCK_T(BLOCK_T(mem)->nxt);
    +        memset(mem, '\0', SMS_BLOCKS_T(sms)->block_sz);
             return mem;
         }
    -    
    -    mem = BLOCKS_T(sms)->ptr;
    -    BLOCKS_T(sms)->ptr += BLOCKS_T(sms)->block_sz;
     
    -    if (BLOCKS_T(sms)->ptr > BLOCKS_T(sms)->endp)
    +    mem = SMS_BLOCKS_T(sms)->ptr;
    +    if ((SMS_BLOCKS_T(sms)->ptr = (char *)mem + 
    +        SMS_BLOCKS_T(sms)->block_sz) <= SMS_BLOCKS_T(sms)->endp) {
    +        memset(mem, '\0', SMS_BLOCKS_T(sms)->block_sz);
    +        return mem;
    +    }
    +        
    +    /* probably quicker to just grab malloc memory, then memset as 
    +     * required.
    +     */
    +    mem = apr_sms_malloc(sms->parent, SMS_BLOCKS_T(sms)->alloc_sz);
    +    if (!mem) {
    +        SMS_BLOCKS_T(sms)->ptr = SMS_BLOCKS_T(sms)->endp;
             return NULL;
    +    }
    +
    +    /* Insert at the start of the list */
    +    BLOCK_T(mem)->nxt = (char*)SMS_BLOCKS_T(sms)->alloc_list;
    +    SMS_BLOCKS_T(sms)->alloc_list = mem;
    +    SMS_BLOCKS_T(sms)->endp = (char *)mem + SMS_BLOCKS_T(sms)->alloc_sz;
    +    (char *)mem += SIZEOF_BLOCK_T;
    +    SMS_BLOCKS_T(sms)->ptr = (char *)mem + SMS_BLOCKS_T(sms)->block_sz;
    +
    +    if (SMS_BLOCKS_T(sms)->alloc_list->nxt) {
    +        /* we're not the first block being added, so we increase our
    +         * size.
    +         */
    +        SMS_BLOCKS_T(sms)->alloc_sz <<= 1;
    +    }
    +
    +    memset(mem, '\0', SMS_BLOCKS_T(sms)->block_sz);
     
    -    memset(mem, '\0', BLOCKS_T(sms)->block_sz);
    -    
         return mem;
     }
     
     static apr_status_t apr_sms_blocks_free(apr_sms_t *sms,
                                             void *mem)
     {
    -    ((block_t *)mem)->nxt = BLOCKS_T(sms)->free_list;
    -    BLOCKS_T(sms)->free_list = (block_t*)mem;
    -
    +    BLOCK_T(mem)->nxt = (char*)SMS_BLOCKS_T(sms)->free_list;
    +    SMS_BLOCKS_T(sms)->free_list = mem;
         return APR_SUCCESS;
     }
     
     static apr_status_t apr_sms_blocks_reset(apr_sms_t *sms)
     {
    -    BLOCKS_T(sms)->ptr = (char *)sms + SIZEOF_BLOCKS_T;
    -    BLOCKS_T(sms)->free_list = NULL;
    -    
    +    block_t *block;
    +
    +    SMS_BLOCKS_T(sms)->ptr = (char *)sms + SIZEOF_SMS_BLOCKS_T;
    +    SMS_BLOCKS_T(sms)->endp = SMS_BLOCKS_T(sms)->self_endp;
    +    SMS_BLOCKS_T(sms)->free_list = NULL;
    +
    +    while ((block = SMS_BLOCKS_T(sms)->alloc_list) != NULL) {
    +        SMS_BLOCKS_T(sms)->alloc_list = BLOCK_T(block->nxt);
    +        apr_sms_free(sms->parent, block);
    +    }
    +
         return APR_SUCCESS;
     }
     
     static apr_status_t apr_sms_blocks_destroy(apr_sms_t *sms)
     {
    +    block_t *block;
    +    
    +    while ((block = SMS_BLOCKS_T(sms)->alloc_list) != NULL) {
    +        SMS_BLOCKS_T(sms)->alloc_list = BLOCK_T(block->nxt);
    +        apr_sms_free(sms->parent, block);
    +    }
    +    
         return apr_sms_free(sms->parent, sms);
     }
     
    @@ -173,9 +237,19 @@ APR_DECLARE(apr_status_t) apr_sms_blocks_create(apr_sms_t **sms,
     {
         apr_sms_t *new_sms;
         apr_status_t rv;
    -
    +    apr_size_t alloc_size;
    +    apr_sms_blocks_t *bms;
    +       
         *sms = NULL;
    -    new_sms = apr_sms_calloc(parent, SIZE_TO_MALLOC);
    +    if (block_size == 0)
    +        return APR_EINVAL;
    +
    +    block_size = APR_ALIGN_DEFAULT(block_size);
    +    alloc_size = block_size << 2;
    +    if (alloc_size < MIN_ALLOC)
    +        alloc_size = MIN_ALLOC;
    +
    +    new_sms = apr_sms_calloc(parent, alloc_size);
     
         if (!new_sms)
             return APR_ENOMEM;
    @@ -190,17 +264,16 @@ APR_DECLARE(apr_status_t) apr_sms_blocks_create(apr_sms_t **sms,
         new_sms->destroy_fn     = apr_sms_blocks_destroy;
         new_sms->identity       = module_identity;
     
    -    BLOCKS_T(new_sms)->ptr = (char *)new_sms + SIZEOF_BLOCKS_T;
    -    BLOCKS_T(new_sms)->endp = (char *)new_sms + SIZE_TO_MALLOC;
    -    
    -    BLOCKS_T(new_sms)->block_sz = block_size +
    -                                 ((0x8 - (block_size & 0x7)) & 0x7);
    +    bms = SMS_BLOCKS_T(new_sms);
    +    bms->block_sz = block_size;
    +    bms->alloc_sz = alloc_size;
    +    bms->ptr = (char*)new_sms + SIZEOF_SMS_BLOCKS_T;
    +    bms->endp = (bms->self_endp = (char*)new_sms + alloc_size);
     
         /* We are normally single threaded so no lock */
    -    
    +
         apr_sms_assert(new_sms);
     
         *sms = new_sms;
         return APR_SUCCESS;
     }
    -
    
    From 85fa39a9acbf1841c9d363d588f74c3191f96ebe Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Thu, 21 Jun 2001 00:39:22 +0000
    Subject: [PATCH 1797/7878] Big change to the memory test.  We now do a number
     of allocations of various sizes and time how long they take.  This is still a
     work in progress but is a reasonable start.  Multi-threaded test is needed if
     anyone wants to do that before I get there :)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61789 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testmem.c | 471 ++++++++++++++++++++++++++++++++++++++++---------
     1 file changed, 390 insertions(+), 81 deletions(-)
    
    diff --git a/test/testmem.c b/test/testmem.c
    index 976466e2eaf..b29d169467f 100644
    --- a/test/testmem.c
    +++ b/test/testmem.c
    @@ -54,6 +54,8 @@
     
     #include "apr_sms.h"
     #include "apr_sms_tracking.h"
    +#include "apr_sms_trivial.h"
    +#include "apr_sms_blocks.h"
     #include "apr_errno.h"
     #include "apr_general.h"
     #include "apr_lib.h"
    @@ -63,146 +65,453 @@
     #include 
     #include 
     #include 
    -#if APR_HAVE_UNISTD_H
    -#include 
    -#endif
    +#include "test_apr.h"
    +
    +#define LUMPS       10
    +#define LUMP_SIZE   1024
    +#define TIMED_RUNS  10
    +#define TIMED_LOOPS 50
    +char *ptrs[1000];
    +
    +typedef struct _test_ {
    +    void * (*malloc_fn)     (void *memsys, apr_size_t size);
    +    void * (*calloc_fn)     (void *memsys, apr_size_t size);
    +    void * (*free_fn)       (void *memsys, void *memptr);
    +    void * (*reset_fn)      (void *memsys);
    +    void * memory;
    +    char * title;
    +    int large_tests;
    +    apr_time_t howlong;
    +} _test_;
     
    -#define LUMPS 10
    -#define LUMP_SIZE 1024
    -char *ptrs[LUMPS];
    -int cntr;
    +#define T_QTY 4 /* how many tests do we have?? */
    +static _test_ t[T_QTY];
    +
    +static void its_an_sms(apr_sms_t *ams, _test_ *t, char *name, int lt)
    +{
    +    t->malloc_fn = (void*)apr_sms_malloc;
    +    t->calloc_fn = (void*)apr_sms_calloc;
    +    t->free_fn =   (void*)apr_sms_free;
    +    t->reset_fn =  (void*)apr_sms_reset;
    +    t->memory = ams;
    +    t->title = name;
    +    t->large_tests = lt;
    +    t->howlong = 0;
    +}
     
    -static void malloc_mem(apr_sms_t *ams)
    +static void its_a_pool(apr_pool_t *pool, _test_ *t, char *name, int lt)
    +{
    +    t->malloc_fn = (void*)apr_palloc;
    +    t->calloc_fn = (void*)apr_pcalloc;
    +    t->free_fn = NULL;
    +    t->reset_fn = (void*)apr_pool_clear;
    +    t->memory = pool;
    +    t->title = name;
    +    t->large_tests = lt;
    +    t->howlong = 0;
    +}
    +
    +static int malloc_test(_test_ *t, apr_size_t size, int howmany, int verbose)
     {
         int cntr;
    -    
    -    printf("    Malloc'ing %d lumps of memory, each %d bytes          ",
    -           LUMPS, LUMP_SIZE);
    -    for (cntr = 0;cntr < LUMPS;cntr ++){
    -        ptrs[cntr] = apr_sms_malloc(ams, LUMP_SIZE);
    +
    +    if (verbose)
    +        printf("    Malloc'ing %d lumps of memory, each of %" APR_SIZE_T_FMT " bytes  ",
    +               howmany, size);
    +    for (cntr = 0;cntr < howmany;cntr ++){
    +        ptrs[cntr] = t->malloc_fn(t->memory, size);
             if (!ptrs[cntr]){
                 printf("Failed\n");
    -            fprintf(stderr,"Failed @ lump %d of %d\n", cntr + 1, LUMPS);
    -            exit (-1);
    +            fprintf(stderr,"Failed @ lump %d of %d\n", cntr + 1, howmany);
    +            return 1;
             }
         }
    -    printf ("OK\n");
    +    if (verbose)
    +        printf ("OK\n");
    +
    +    return 0;
     }
     
    -static void calloc_mem(apr_sms_t *ams)
    +static int calloc_test(_test_ *t, apr_size_t size, int howmany, int verbose)
     {
         int cntr, cntr2;
         
    -    printf("    Calloc'ing %d lumps of memory, each %d bytes          ",
    -           LUMPS, LUMP_SIZE);
    -    for (cntr = 0;cntr < LUMPS;cntr ++){
    -        ptrs[cntr] = apr_sms_calloc(ams, LUMP_SIZE);
    +    if (verbose)
    +        printf("    Calloc'ing %d lumps of memory, each %" APR_SIZE_T_FMT " bytes          ",
    +               howmany, size);
    +    for (cntr = 0;cntr < howmany;cntr ++){
    +        ptrs[cntr] = t->calloc_fn(t->memory, size);
             if (!ptrs[cntr]){
                 printf("Failed\n");
    -            fprintf(stderr, "Failed @ lump %d of %d\n", cntr + 1, LUMPS);
    -            exit (-1);
    +            fprintf(stderr, "Failed @ lump %d of %d\n", cntr + 1, howmany);
    +            return 1;
             }
         }
    -    printf ("OK\n");
    -    printf("     (checking that memory is zeroed                      ");
    -    for (cntr = 0;cntr < LUMPS;cntr++){
    -        for (cntr2 = 0;cntr2 < LUMP_SIZE; cntr2 ++){
    +    if (verbose) {
    +        printf ("OK\n");
    +        printf("     (checking that memory is zeroed                      ");
    +    }
    +    for (cntr = 0;cntr < howmany;cntr++){
    +        for (cntr2 = 0;cntr2 < size; cntr2 ++){
                 if (*(ptrs[cntr] + cntr2) != 0){
                     printf("Failed\n");
    -                fprintf(stderr, "Failed!\nGot %d instead of 0 at byte %d\n",
    -                       *(ptrs[cntr] + cntr2), cntr2 + 1);
    -                exit (-1);
    +                fprintf(stderr, "Failed!\nGot %d instead of 0 at byte %d of chunk %d [%p]\n",
    +                       *(ptrs[cntr] + cntr2), cntr2 + 1, cntr + 1, ptrs[cntr] + cntr2);
    +                return 1;
                 }
             }
         } 
    -    printf("OK)\n");
    +    if (verbose)
    +        printf("OK)\n");
    +
    +    return 0;
     }
     
    -static void do_test(apr_sms_t *ams)
    +static int write_test(apr_size_t size, int howmany, int verbose)
     {
         int cntr,cntr2;
    +    int val;
         
    -    printf("    Writing to the lumps of memory                          ");
    -    for (cntr = 0;cntr < LUMPS;cntr ++){
    -        if (memset(ptrs[cntr], cntr, LUMP_SIZE) != ptrs[cntr]){
    +    if (verbose)
    +        printf("%-60s", "    Writing to the lumps of memory");
    +
    +    for (cntr = 0;cntr < howmany;cntr ++){
    +        if (size == 64) {
    +            /* we go past 256 in our tests, so use a different value :) */
    +            val = 99;
    +        } else {
    +            val = cntr;
    +        }
    +        if (memset(ptrs[cntr], val, size) != ptrs[cntr]){
                 printf("Failed\n");
                 fprintf(stderr,"Failed to write into lump %d\n", cntr + 1);
    -            exit(-1);
    +            return 1;
             }
         }
    -    printf("OK\n");    
     
    -    printf("    Check what we wrote                                     ");
    -    for (cntr = 0;cntr < LUMPS;cntr++){
    -        for (cntr2 = 0;cntr2 < LUMP_SIZE; cntr2 ++){
    -            if (*(ptrs[cntr] + cntr2) != cntr){
    +    if (verbose) {
    +        printf("OK\n");    
    +
    +        printf("%-60s", "    Check what we wrote");
    +    }
    +
    +    for (cntr = 0;cntr < howmany;cntr++){
    +        if (size == 64) {
    +            val = 99;
    +        } else {
    +            val = cntr;
    +        }
    +        for (cntr2 = 0;cntr2 < size; cntr2 ++){
    +            if (*(ptrs[cntr] + cntr2) != val){
                     printf("Failed\n");
                     fprintf(stderr,"Got %d instead of %d at byte %d\n",
    -                       *(ptrs[cntr] + cntr2), cntr, cntr2 + 1);
    -                exit (-1);
    +                       *(ptrs[cntr] + cntr2), val, cntr2 + 1);
    +                return 1;
                 }
             }
         } 
    -    printf("OK\n");   
    +    if (verbose)
    +        printf("OK\n");   
    +    return 0;
     }
     
    -static void do_free(apr_sms_t *ams)
    +static int free_memory(_test_ *t, int qty, int verbose)
     {
         int cntr;
         
    -    printf("    Freeing the memory we created                           ");
    -    for (cntr = 0;cntr < LUMPS;cntr ++){
    -        if (apr_sms_free(ams, ptrs[cntr]) != APR_SUCCESS){
    -            printf("Failed\n");
    -            fprintf(stderr,"Failed to free block %d\n", cntr + 1);
    -            exit (-1);
    +    if (verbose)
    +        printf("    Freeing the memory we created                           ");
    +    /* pools don't really do free... */
    +    if (t->free_fn) {
    +        for (cntr = 0;cntr < qty;cntr ++){
    +            if (t->free_fn(t->memory, ptrs[cntr]) != APR_SUCCESS){
    +                printf("Failed\n");
    +                fprintf(stderr,"Failed to free block %d\n", cntr + 1);
    +                return 1;
    +            }
             }
         }
    +    
    +    if (verbose)
    +        printf("OK\n");
    +    return 0;
    +}
    +
    +static int reset_memory(_test_ *t, int loops, int verbose)
    +{
    +    if (verbose)
    +        printf("    Resetting the memory we created                           ");
    +    if (!t->reset_fn) {
    +        free_memory(t, loops, verbose);
    +    } else {
    +        t->reset_fn(t->memory);
    +    }
    +    
    +    if (verbose)
    +        printf("OK\n");
    +    return 0;
    +}
    +
    +static int simple_test(_test_ *t, int verbose)
    +{
    +    char msg[60];
    +    if (t->large_tests == 0)
    +        return 0;
    +        
    +    sprintf(msg, "    Big allocation test for %s", t->title);
    +    printf("%-60s", msg);
    +    if (malloc_test(t, 4096, 100, verbose))
    +        return 1;
    +    if (write_test(4096, 100, verbose))
    +        return 1;
    +    if (free_memory(t, 100, verbose))
    +        return 1;
    +    if (calloc_test(t, 4096, 100, verbose))
    +        return 1;
    +    if (write_test(4096, 100, verbose))
    +        return 1;
    +    if (free_memory(t, 100, verbose))
    +        return 1;
         printf("OK\n");
    +    return 0;
     }
     
    -int main(void)
    +static int small_test(_test_ *t, int verbose)
     {
    -    apr_sms_t *ams, *tms;
    -    apr_initialize();
    +    char msg[60];
    +    sprintf(msg, "    Small allocation test for %s", t->title);
    +    printf("%-60s", msg);
    +    if (malloc_test(t, 64, 100,  verbose))
    +        return 1;
    +    if (write_test(64, 100, verbose))
    +        return 1;
    +    if (free_memory(t, 100, verbose))
    +        return 1;
    +    printf("OK\n");
    +    return 0;
    +}
         
    -    printf("APR Memory Test\n");
    -    printf("===============\n\n");
    +static int timed_test(_test_ *t, int verbose)
    +{
    +    int iloop, oloop, ooloop, rv;
    +    apr_time_t t1=0, t2=0, t3=0, t4 = 0, tmp = 0, total = 0;
    +    char msg[60];
    +    apr_size_t sz[5] = {1024, 4096, 256, 8 * 1024, 1024};
    +        
    +    if (t->large_tests == 0)
    +        return 0;
    + 
    +    sprintf(msg, "    Timed alloc test (%d - %d) for %s", LUMPS, LUMPS + ( 3 * LUMPS),
    +            t->title);
    +    if (verbose) {
    +        printf("%s\n", msg);
    +        printf("    alloc      <--------        timings (usecs)        -------->\n");
    +        printf("    size           malloc /     calloc /      reset /      total\n");
    +    } else {
    +        printf("%-60s", msg);
    +    }
    +         
    +    for (ooloop = 0; ooloop < 5; ooloop ++) {
    +        for (oloop = 0; oloop < TIMED_LOOPS;oloop ++) {
    +            for (iloop = 0; iloop < TIMED_RUNS; iloop ++) {
    +                TIME_FUNCTION(tmp, (rv = malloc_test(t, sz[ooloop], 100, 0)))
    +                t1 += tmp;
    +                if (rv)
    +                    return 1;
    +                TIME_FUNCTION(tmp, (rv = write_test(sz[ooloop], 100, 0)))
    +                if (rv)
    +                    return 1;
    +                TIME_FUNCTION(tmp, (rv = reset_memory(t, 100, 0)))
    +                t2 += tmp;
    +                if (rv)
    +                    return 1;
    +            }
    +            for (iloop = 0; iloop < TIMED_RUNS; iloop++) {
    +                TIME_FUNCTION(tmp, (rv = calloc_test(t, sz[ooloop], 100, 0)))
    +                t3 += tmp;
    +                if (rv)
    +                    return 1;
    +                TIME_FUNCTION(tmp, (rv = write_test(sz[ooloop], 100, 0)))
    +                if (rv)
    +                    return 1;
    +                TIME_FUNCTION(tmp, (rv = reset_memory(t, 100, 0)))
    +                t4 += tmp;
    +                if (rv)
    +                    return 1;
    +            }
    +        }
    +        if (verbose)
    +            printf("    %4" APR_SIZE_T_FMT "       %10lld / %10lld / %10lld / %10lld\n",
    +                   sz[ooloop], t1, t3, t2 + t4, t1 + t2 + t3 + t4);
    +        total += (t1 + t2 + t3 + t4);
    +        t1=0;t2=0;t3=0;t4=0; 
    +    }
    +    if (verbose) {        
    +        printf("          average = %lld\n", 
    +               (total / TIMED_LOOPS));
    +    } else {
    +        printf("OK\n");
    +    }
    +    t->howlong = (total / TIMED_LOOPS);
    +    return 0;
    +}
     
    -    printf("Standard Memory\n");
    -    STD_TEST_NEQ("    Creating the memory system",
    -                 apr_sms_std_create(&ams))
    -    TEST_NEQ("    Checking identity of memory system",
    -             strcmp(ams->identity, "STANDARD"), 0,
    -             "OK","Not STANDARD")
    +static int timed_test_64byte(_test_ *t, int small, int verbose)
    +{
    +    apr_size_t sz[4] = {100,300,600,1000};
    +    int iloop, oloop, ooloop, rv;
    +    apr_time_t t1=0, t2=0, t3=0, tmp = 0, total = 0;
    +    apr_time_t tt1=0, tt2=0, tt3=0;
    +    char msg[80];
    +    
    +    if (small) {
    +        sz[0] = 100;
    +        sz[1] = 100;
    +        sz[2] = 100;
    +        sz[3] = 100;
    +    }
    +            
    +    sprintf(msg, "    64 byte alloc test (%" APR_SIZE_T_FMT " - %" APR_SIZE_T_FMT " loops) %s",
    +            sz[0], sz[3], t->title);
    +    if (verbose) {
    +        printf("%s\n", msg);
    +        printf("                    <------    timings (usecs)    ------>\n");
    +        printf("    allocations          alloc /      reset /      total\n");
    +    } else {
    +        printf("%-60s", msg);
    +    }
    +    
    +    for (ooloop = 0; ooloop < 4; ooloop ++) {
    +        t1=0;t2=0;t3=0;
    +        for (oloop = 0; oloop < TIMED_LOOPS * 2;oloop ++) {
    +            for (iloop = 0; iloop < TIMED_RUNS; iloop ++) {
    +                TIME_FUNCTION(tmp, (rv = malloc_test(t, 64, sz[ooloop], 0)))
    +                t1 += tmp;
    +                if (rv)
    +                    return 1;
    +                tmp = apr_time_now();
    +                if (write_test(64, sz[ooloop], 0))
    +                    return 1;
    +                t2 += (apr_time_now() - tmp);
    +                tmp = apr_time_now();
    +                if (reset_memory(t, sz[ooloop], 0))
    +                    return 1;
    +                t3 += (apr_time_now() - tmp);
    +            }
    +        }
    +        if (verbose) {
    +            printf("    %4" APR_SIZE_T_FMT "            %10lld / %10lld / %10lld\n",
    +                   sz[ooloop], t1, t2, t1 + t2);
    +        }
    +        tt1 += t1;tt2 += t2;tt3 += t3;
    +        total += (t1 + t2 + t3);
    +        t1 = 0; t2 = 0;
    +    }
    +    if (verbose)
    +        printf("        average over 4 runs = %lld\n\n", total / 4);      
    +    else
    +        printf("OK\n");
    +        
    +    t->howlong = total / 4;
    +    
    +    return 0;
    +}
     
    -    malloc_mem(ams);
    -    do_test(ams);
    -    do_free(ams);
    -    calloc_mem(ams);
    -    do_test(ams);    
    -    do_free(ams);
    +static void print_timed_results(void)
    +{
    +    int i;
    +    printf("    Percentage Results  averages  %% of pools  %% of std sms\n");
    +    for (i=0;i < T_QTY; i++) {
    +        float pa = (float)t[i].howlong / (float)t[0].howlong;
    +        float pb = (float)t[i].howlong / (float)t[1].howlong;       
    +        printf("    %-20s %-8lld  %7.02f %%     %7.02f %%\n", t[i].title, t[i].howlong,
    +               pa * 100, pb * 100);
    +    } 
    +    printf("\n");  
    +    for (i=0;iidentity, "TRACKING"), 0,
    +    printf("Creating the memory systems...\n");
    +    STD_TEST_NEQ("    Creating a pool", 
    +                 apr_pool_create(&pool, NULL))
    +    STD_TEST_NEQ("    Creating the standard memory system",
    +                 apr_sms_std_create(&ams))   
    +    STD_TEST_NEQ("    Creating the tracking memory system",
    +                 apr_sms_tracking_create(&bms, ams))
    +    STD_TEST_NEQ("    Creating a 64 byte block system",
    +                 apr_sms_blocks_create(&dms, ams, 64))
    +
    +    its_a_pool(pool, &t[0], "Pool code",     1);
    +    its_an_sms(ams,  &t[1], "Standard sms",  1);
    +    t[1].reset_fn = NULL;
    +    its_an_sms(bms,  &t[2], "Tracking sms",  1);
    +    its_an_sms(dms,  &t[3], "Blocks sms",    0);
    +        
    +    printf("Checking sms identities...\n");
    +    TEST_NEQ("    Checking identity of standard memory system",
    +             strcmp(apr_sms_identity(ams), "STANDARD"), 0,
    +             "OK","Not STANDARD")
    +    TEST_NEQ("    Checking the identity of tracking memory system",
    +             strcmp(apr_sms_identity(bms), "TRACKING"), 0,
                  "OK", "Not TRACKING")
    +    TEST_NEQ("    Checking the identity of blocks memory system",
    +             strcmp(apr_sms_identity(dms), "BLOCKS"), 0,
    +             "OK", "Not BLOCKS")
     
    -    malloc_mem(tms);
    -    do_test(tms);
    -    STD_TEST_NEQ("    About to reset the tracking system", apr_sms_reset(tms))
    +    printf("Big allocation test...\n");
    +    for (i = 0; i < T_QTY; i++) {
    +        if (simple_test(&t[i], 0)) {
    +            exit (-1);
    +        }
    +    }
    +
    +    printf("64 byte allocation test...\n");
    +    for (i = 0; i< T_QTY; i++) {
    +        if (small_test(&t[i], 0))
    +            exit(-1);
    +    }
     
    -    calloc_mem(tms);
    -    do_test(tms);
    -    do_free(tms);
    +    printf("Timed test #1\n");
    +    for (i = 0; i< T_QTY; i++) {
    +        if (timed_test_64byte(&t[i], 1, 0)) {
    +            exit (-1);
    +        }
    +    }
    +    print_timed_results();
         
    -    STD_TEST_NEQ("Trying to destroy the tracking memory system",
    -                 apr_sms_destroy(tms))
    +    printf("Timed test #2\n");
    +    for (i = 0; i< T_QTY; i++) {
    +        if (timed_test_64byte(&t[i], 0, 0)) {
    +            exit (-1);
    +        }
    +    }
    +    print_timed_results();
     
    +    printf("Timed test #3\n");
    +    for (i = 0; i< T_QTY; i++) {
    +        if (timed_test(&t[i], 1))
    +            exit(-1);
    +    }
    +    print_timed_results();
    +    
    +    printf("Destroying the memory...\n");
     
    +    STD_TEST_NEQ("Trying to destroy the tracking memory system",
    +                 apr_sms_destroy(bms))
    +    STD_TEST_NEQ("Trying to destroy the block memory system",
    +                 apr_sms_destroy(dms))                        
         STD_TEST_NEQ("Trying to destroy the standard memory system",
                      apr_sms_destroy(ams))
     
    
    From abb325cfbe2004ddea292699956dbdbe4f54bd83 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Thu, 21 Jun 2001 00:46:12 +0000
    Subject: [PATCH 1798/7878] Remove some brackets that aren't needed...
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61790 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms_blocks.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/memory/unix/apr_sms_blocks.c b/memory/unix/apr_sms_blocks.c
    index 803a48fb297..3c3d8cc1bdb 100644
    --- a/memory/unix/apr_sms_blocks.c
    +++ b/memory/unix/apr_sms_blocks.c
    @@ -268,7 +268,7 @@ APR_DECLARE(apr_status_t) apr_sms_blocks_create(apr_sms_t **sms,
         bms->block_sz = block_size;
         bms->alloc_sz = alloc_size;
         bms->ptr = (char*)new_sms + SIZEOF_SMS_BLOCKS_T;
    -    bms->endp = (bms->self_endp = (char*)new_sms + alloc_size);
    +    bms->endp = bms->self_endp = (char*)new_sms + alloc_size;
     
         /* We are normally single threaded so no lock */
     
    
    From af83383baf9bfc2ccfb3922e9be1eb3a50f81e05 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 21 Jun 2001 11:33:54 +0000
    Subject: [PATCH 1799/7878] Fix some invalid lvalue casts.  These weren't
     acceptable to the native compilers on HP-UX and AIX.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61791 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_sms_blocks.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/memory/unix/apr_sms_blocks.c b/memory/unix/apr_sms_blocks.c
    index 3c3d8cc1bdb..9b5efb06dd0 100644
    --- a/memory/unix/apr_sms_blocks.c
    +++ b/memory/unix/apr_sms_blocks.c
    @@ -132,7 +132,7 @@ static void *apr_sms_blocks_malloc(apr_sms_t *sms,
         BLOCK_T(mem)->nxt = (char*)SMS_BLOCKS_T(sms)->alloc_list;
         SMS_BLOCKS_T(sms)->alloc_list = mem;
         SMS_BLOCKS_T(sms)->endp = (char *)mem + SMS_BLOCKS_T(sms)->alloc_sz;
    -    (char *)mem += SIZEOF_BLOCK_T;
    +    mem = (char *)mem + SIZEOF_BLOCK_T;
         SMS_BLOCKS_T(sms)->ptr = (char *)mem + SMS_BLOCKS_T(sms)->block_sz;
     
         if (SMS_BLOCKS_T(sms)->alloc_list->nxt) {
    @@ -180,7 +180,7 @@ static void *apr_sms_blocks_calloc(apr_sms_t *sms,
         BLOCK_T(mem)->nxt = (char*)SMS_BLOCKS_T(sms)->alloc_list;
         SMS_BLOCKS_T(sms)->alloc_list = mem;
         SMS_BLOCKS_T(sms)->endp = (char *)mem + SMS_BLOCKS_T(sms)->alloc_sz;
    -    (char *)mem += SIZEOF_BLOCK_T;
    +    mem = (char *)mem + SIZEOF_BLOCK_T;
         SMS_BLOCKS_T(sms)->ptr = (char *)mem + SMS_BLOCKS_T(sms)->block_sz;
     
         if (SMS_BLOCKS_T(sms)->alloc_list->nxt) {
    
    From 6aed53e5f1f7b283f55569e8e4581e864bcb1f62 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 22 Jun 2001 17:45:23 +0000
    Subject: [PATCH 1800/7878] use 64-bit int for conversion of gmt offset to
     microseconds... this was broken on Solaris Intel w/ gcc previously
    
    This change also gets rid of a warning due to the mismatch of
    apr_int32_t and APR_TIME_T_FMT.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61792 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testtime.c | 7 ++++---
     1 file changed, 4 insertions(+), 3 deletions(-)
    
    diff --git a/test/testtime.c b/test/testtime.c
    index ce60d9874bf..76bb7249de0 100644
    --- a/test/testtime.c
    +++ b/test/testtime.c
    @@ -73,6 +73,7 @@ int main(void)
         char *str, *str2;
         apr_size_t sz;
         apr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */
    +    apr_int64_t hr_off_64;
     
         fprintf(stdout, "Testing Time functions.\n");
     
    @@ -177,11 +178,11 @@ int main(void)
     
         printf("\tChecking imploded time after offset.............");
         apr_implode_time(&imp, &xt2);
    -    hr_off *= APR_USEC_PER_SEC; /* microseconds */ 
    -    if (imp != now + hr_off){
    +    hr_off_64 = (apr_int64_t)hr_off * APR_USEC_PER_SEC; /* microseconds */ 
    +    if (imp != now + hr_off_64){
             printf("Failed! :(\n");
             printf("Difference is %" APR_TIME_T_FMT " (should be %" 
    -               APR_TIME_T_FMT ")\n", imp - now, hr_off);
    +               APR_INT64_T_FMT ")\n", imp - now, hr_off_64);
             exit(-1);
         }
         printf("OK\n");
    
    From e21b446d59f5bdb3e72924c298645a521cc86032 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 22 Jun 2001 17:53:49 +0000
    Subject: [PATCH 1801/7878] Solaris doesn't have (struct tm *)->tm_gmtoff, so
     the server logs were written in GMT regardess of the system timezone. (The
     well-known Solaris headache)
    
    The Solaris-kludge did exist and worked in 2.0.16 of
    srclib/apr/time/unix/time.c:apr_explode_localtime(), but the code
    was moved from apr_explode_localtime() to set_xt_gmtoff_from_tm()
    around version 1.38.
    
    So the attached patch will use tm_to_exp() (which calls
    set_xt_gmtoff_from_tm()) in apr_explode_localtime(), which fixed the
    problem.
    
    PR:		7902
    Submitted by:	Taketo Kabe 
    Reviewed by:	Jeff Trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61793 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES          |  4 ++++
     time/unix/time.c | 17 ++++-------------
     2 files changed, 8 insertions(+), 13 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index a757c36ba0b..ec8434ccf89 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,4 +1,8 @@
     Changes with APR b1  
    +
    +  *) Fix gmt offset handling on Solaris.  Apache log messages now show
    +     local time again. PR #7902 [Taketo Kabe ]
    +
       *) apr_pstrcat() optimizations [Doug MacEachern, Jeff Trawick]
     
       *) Make the apr_pool_is_ancestor logic public.  This is required for 
    diff --git a/time/unix/time.c b/time/unix/time.c
    index 743a9f21da5..bac3051394e 100644
    --- a/time/unix/time.c
    +++ b/time/unix/time.c
    @@ -154,25 +154,16 @@ apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input
         return apr_explode_time(result, input, -timezone);
     #else
         time_t mango = input / APR_USEC_PER_SEC;
    -    apr_int32_t offs = 0;
     
     #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
         struct tm mangotm;
         localtime_r(&mango, &mangotm);
    -/* XXX - Add support for Solaris */
    -#ifdef HAVE_GMTOFF
    -    offs = mangotm.tm_gmtoff;
    -#elif defined(HAVE___OFFSET)
    -    offs = mangotm.__tm_gmtoff;
    -#endif
     #else /* !APR_HAS_THREADS */
    -    struct tm *mangotm;
    -    mangotm=localtime(&mango);
    -#ifdef HAVE_GMTOFF
    -    offs = mangotm->tm_gmtoff;
    -#endif    
    +    struct tm mangotm;
    +    mangotm = *localtime(&mango);
     #endif
    -    return apr_explode_time(result, input, offs);
    +    tm_to_exp(result, &mangotm, &mango);
    +    return APR_SUCCESS;
     #endif /* __EMX__ */
     }
     
    
    From c48f73f95158a09bf7d4be30fab011705b972b95 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 25 Jun 2001 18:53:36 +0000
    Subject: [PATCH 1802/7878] Teach the Unix implementation of locks to:
    
    1) build in as many implementation mechanisms (e.g., fcntl(), flock()) as the
       platform supports
    2) use function pointers set up during apr_lock_create() processing to call the
       low-level routines
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61794 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/unix/locks.h |  76 ++++++++----
     locks/unix/crossproc.c    | 206 +++++++++++++++++++------------
     locks/unix/intraproc.c    |  51 +++++++-
     locks/unix/locks.c        | 247 ++++++++++++++++++--------------------
     4 files changed, 350 insertions(+), 230 deletions(-)
    
    diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h
    index 65fa98456e3..ba25d9ed030 100644
    --- a/include/arch/unix/locks.h
    +++ b/include/arch/unix/locks.h
    @@ -100,7 +100,51 @@
     #endif
     /* End System Headers */
     
    -#if !APR_HAVE_UNION_SEMUN && APR_USE_SYSVSEM_SERIALIZE
    +struct apr_unix_lock_methods_t {
    +    apr_status_t (*create)(apr_lock_t *, const char *);
    +    apr_status_t (*acquire)(apr_lock_t *);
    +    apr_status_t (*release)(apr_lock_t *);
    +    apr_status_t (*destroy)(apr_lock_t *);
    +    apr_status_t (*child_init)(apr_lock_t **, apr_pool_t *, const char *);
    +};
    +typedef struct apr_unix_lock_methods_t apr_unix_lock_methods_t;
    +
    +#if defined(HAVE_SEMCTL) && defined(HAVE_SEMGET)
    +#define APR_HAS_SYSVSEM_SERIALIZE      1
    +extern const apr_unix_lock_methods_t apr_unix_sysv_methods;
    +#else
    +#define APR_HAS_SYSVSEM_SERIALIZE      0
    +#endif
    +
    +#if defined(HAVE_FCNTL_H) && defined(HAVE_F_SETLK)
    +#define APR_HAS_FCNTL_SERIALIZE        1
    +extern const apr_unix_lock_methods_t apr_unix_fcntl_methods;
    +#else
    +#define APR_HAS_FCNTL_SERIALIZE        0
    +#endif
    +
    +#if defined(HAVE_SYS_FILE_H) && defined(HAVE_LOCK_EX)
    +#define APR_HAS_FLOCK_SERIALIZE        1
    +extern const apr_unix_lock_methods_t apr_unix_flock_methods;
    +#else
    +#define APR_HAS_FLOCK_SERIALIZE        0
    +#endif
    +
    +#if defined(HAVE_PTHREAD_H) && defined(HAVE_PTHREAD_PROCESS_SHARED) && defined(HAVE_PTHREAD_MUTEXATTR_SETPSHARED)
    +#define APR_HAS_PROC_PTHREAD_SERIALIZE 1
    +extern const apr_unix_lock_methods_t apr_unix_proc_pthread_methods;
    +#else
    +#define APR_HAS_PROC_PTHREAD_SERIALIZE 0
    +#endif
    +
    +#if defined(HAVE_PTHREAD_RWLOCK_INIT)
    +#define APR_HAS_RWLOCK_SERIALIZE       1
    +extern const apr_unix_lock_methods_t apr_unix_rwlock_methods;
    +#else
    +#define APR_HAS_RWLOCK_SERIALIZE       0
    +#endif
    +
    +#if !APR_HAVE_UNION_SEMUN && defined(APR_HAS_SYSVSEM_SERIALIZE)
     /* it makes no sense, but this isn't defined on solaris */
     union semun {
         long val;
    @@ -111,22 +155,18 @@ union semun {
     
     struct apr_lock_t {
         apr_pool_t *pool;
    +    const apr_unix_lock_methods_t *meth;
    +    const apr_unix_lock_methods_t *inter_meth, *intra_meth; /* for APR_LOCK_ALL */
         apr_locktype_e type;
         apr_lockscope_e scope;
         int curr_locked;
         char *fname;
    -
    -#if APR_USE_SYSVSEM_SERIALIZE
    +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE
         int interproc;
    -#elif APR_USE_FCNTL_SERIALIZE
    -    int interproc;
    -#elif APR_USE_PROC_PTHREAD_SERIALIZE
    -    pthread_mutex_t *interproc;
    -#elif APR_USE_FLOCK_SERIALIZE
    -    int interproc;
    -#else
    -    /* No Interprocess serialization.  Too bad. */
    -#endif 
    +#endif
    +#if APR_HAS_PROC_PTHREAD_SERIALIZE
    +    pthread_mutex_t *pthread_interproc;
    +#endif
     #if APR_HAS_THREADS
         /* APR doesn't have threads, no sense in having an thread lock mechanism.
          */
    @@ -147,20 +187,10 @@ struct apr_lock_t {
     };
     
     #if APR_HAS_THREADS
    -apr_status_t apr_unix_create_intra_lock(struct apr_lock_t *new);
    -apr_status_t apr_unix_lock_intra(struct apr_lock_t *lock);
    -apr_status_t apr_unix_unlock_intra(struct apr_lock_t *lock);
    -apr_status_t apr_unix_destroy_intra_lock(struct apr_lock_t *lock);
    +extern const apr_unix_lock_methods_t apr_unix_intra_methods;
     #endif
     
     void apr_unix_setup_lock(void);
    -apr_status_t apr_unix_create_inter_lock(struct apr_lock_t *new);
    -apr_status_t apr_unix_lock_inter(struct apr_lock_t *lock);
    -apr_status_t apr_unix_unlock_inter(struct apr_lock_t *lock);
    -apr_status_t apr_unix_destroy_inter_lock(struct apr_lock_t *lock);
    -
    -apr_status_t apr_unix_child_init_lock(struct apr_lock_t **lock, 
    -                                      apr_pool_t *cont, const char *fname);
     
     #endif  /* LOCKS_H */
     
    diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c
    index bc32bc06d2d..a27d49525b7 100644
    --- a/locks/unix/crossproc.c
    +++ b/locks/unix/crossproc.c
    @@ -57,12 +57,12 @@
     #include "locks.h"
     #include "fileio.h" /* for apr_mkstemp() */
     
    -#if APR_USE_SYSVSEM_SERIALIZE  
    +#if APR_HAS_SYSVSEM_SERIALIZE
     
     static struct sembuf op_on;
     static struct sembuf op_off;
     
    -void apr_unix_setup_lock(void)
    +static void sysv_setup(void)
     {
         op_on.sem_num = 0;
         op_on.sem_op = -1;
    @@ -72,7 +72,7 @@ void apr_unix_setup_lock(void)
         op_off.sem_flg = SEM_UNDO;
     }
     
    -static apr_status_t lock_cleanup(void *lock_)
    +static apr_status_t sysv_cleanup(void *lock_)
     {
         apr_lock_t *lock=lock_;
         union semun ick;
    @@ -84,28 +84,28 @@ static apr_status_t lock_cleanup(void *lock_)
         return APR_SUCCESS;
     }    
     
    -apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
    +static apr_status_t sysv_create(apr_lock_t *new, const char *fname)
     {
         union semun ick;
         
         new->interproc = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600);
     
         if (new->interproc < 0) {
    -        lock_cleanup(new);
    +        sysv_cleanup(new);
             return errno;
         }
         ick.val = 1;
         if (semctl(new->interproc, 0, SETVAL, ick) < 0) {
    -        lock_cleanup(new);
    +        sysv_cleanup(new);
             return errno;
         }
         new->curr_locked = 0;
    -    apr_pool_cleanup_register(new->pool, (void *)new, lock_cleanup, 
    +    apr_pool_cleanup_register(new->pool, (void *)new, sysv_cleanup, 
                                   apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_unix_lock_inter(apr_lock_t *lock)
    +static apr_status_t sysv_acquire(apr_lock_t *lock)
     {
         int rc;
     
    @@ -119,7 +119,7 @@ apr_status_t apr_unix_lock_inter(apr_lock_t *lock)
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_unix_unlock_inter(apr_lock_t *lock)
    +static apr_status_t sysv_release(apr_lock_t *lock)
     {
         int rc;
     
    @@ -133,48 +133,59 @@ apr_status_t apr_unix_unlock_inter(apr_lock_t *lock)
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
    +static apr_status_t sysv_destroy(apr_lock_t *lock)
     {
         apr_status_t stat;
     
    -    if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        apr_pool_cleanup_kill(lock->pool, lock, lock_cleanup);
    +    if ((stat = sysv_cleanup(lock)) == APR_SUCCESS) {
    +        apr_pool_cleanup_kill(lock->pool, lock, sysv_cleanup);
             return APR_SUCCESS;
         }
         return stat;
     }
     
    -apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname)
    +static apr_status_t sysv_child_init(apr_lock_t **lock, apr_pool_t *cont, const char *fname)
     {
         return APR_SUCCESS;
     }
     
    -#elif (APR_USE_PROC_PTHREAD_SERIALIZE)  
    +const apr_unix_lock_methods_t apr_unix_sysv_methods =
    +{
    +    sysv_create,
    +    sysv_acquire,
    +    sysv_release,
    +    sysv_destroy,
    +    sysv_child_init
    +};
     
    -void apr_unix_setup_lock(void)
    +#endif /* SysV sem implementation */
    +
    +#if APR_HAS_PROC_PTHREAD_SERIALIZE
    +
    +static void proc_pthread_setup(void)
     {
     }
     
    -static apr_status_t lock_cleanup(void *lock_)
    +static apr_status_t proc_pthread_cleanup(void *lock_)
     {
         apr_lock_t *lock=lock_;
         apr_status_t stat;
     
         if (lock->curr_locked == 1) {
    -        if ((stat = pthread_mutex_unlock(lock->interproc))) {
    +        if ((stat = pthread_mutex_unlock(lock->pthread_interproc))) {
     #ifdef PTHREAD_SETS_ERRNO
                 stat = errno;
     #endif
                 return stat;
             } 
    -        if (munmap((caddr_t)lock->interproc, sizeof(pthread_mutex_t))){
    +        if (munmap((caddr_t)lock->pthread_interproc, sizeof(pthread_mutex_t))){
                 return errno;
             }
         }
         return APR_SUCCESS;
     }    
     
    -apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
    +static apr_status_t proc_pthread_create(apr_lock_t *new, const char *fname)
     {
         apr_status_t stat;
         int fd;
    @@ -185,10 +196,10 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
             return errno;
         }
     
    -    new->interproc = (pthread_mutex_t *)mmap((caddr_t) 0, 
    -                              sizeof(pthread_mutex_t), 
    -                              PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 
    -    if (new->interproc == (pthread_mutex_t *) (caddr_t) -1) {
    +    new->pthread_interproc = (pthread_mutex_t *)mmap((caddr_t) 0, 
    +                                                     sizeof(pthread_mutex_t), 
    +                                                     PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 
    +    if (new->pthread_interproc == (pthread_mutex_t *) (caddr_t) -1) {
             return errno;
         }
         close(fd);
    @@ -196,22 +207,22 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
     #ifdef PTHREAD_SETS_ERRNO
             stat = errno;
     #endif
    -        lock_cleanup(new);
    +        proc_pthread_cleanup(new);
             return stat;
         }
         if ((stat = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED))) {
     #ifdef PTHREAD_SETS_ERRNO
             stat = errno;
     #endif
    -        lock_cleanup(new);
    +        proc_pthread_cleanup(new);
             return stat;
         }
     
    -    if ((stat = pthread_mutex_init(new->interproc, &mattr))) {
    +    if ((stat = pthread_mutex_init(new->pthread_interproc, &mattr))) {
     #ifdef PTHREAD_SETS_ERRNO
             stat = errno;
     #endif
    -        lock_cleanup(new);
    +        proc_pthread_cleanup(new);
             return stat;
         }
     
    @@ -219,21 +230,21 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
     #ifdef PTHREAD_SETS_ERRNO
             stat = errno;
     #endif
    -        lock_cleanup(new);
    +        proc_pthread_cleanup(new);
             return stat;
         }
     
         new->curr_locked = 0;
    -    apr_pool_register_cleanup(new->pool, (void *)new, lock_cleanup, 
    +    apr_pool_cleanup_register(new->pool, (void *)new, proc_pthread_cleanup, 
                                   apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_unix_lock_inter(apr_lock_t *lock)
    +static apr_status_t proc_pthread_acquire(apr_lock_t *lock)
     {
         apr_status_t stat;
     
    -    if ((stat = pthread_mutex_lock(lock->interproc))) {
    +    if ((stat = pthread_mutex_lock(lock->pthread_interproc))) {
     #ifdef PTHREAD_SETS_ERRNO
             stat = errno;
     #endif
    @@ -243,11 +254,11 @@ apr_status_t apr_unix_lock_inter(apr_lock_t *lock)
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_unix_unlock_inter(apr_lock_t *lock)
    +static apr_status_t proc_pthread_release(apr_lock_t *lock)
     {
         apr_status_t stat;
     
    -    if ((stat = pthread_mutex_unlock(lock->interproc))) {
    +    if ((stat = pthread_mutex_unlock(lock->pthread_interproc))) {
     #ifdef PTHREAD_SETS_ERRNO
             stat = errno;
     #endif
    @@ -257,27 +268,40 @@ apr_status_t apr_unix_unlock_inter(apr_lock_t *lock)
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
    +static apr_status_t proc_pthread_destroy(apr_lock_t *lock)
     {
         apr_status_t stat;
    -    if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        apr_pool_cleanup_kill(lock->pool, lock, lock_cleanup);
    +    if ((stat = proc_pthread_cleanup(lock)) == APR_SUCCESS) {
    +        apr_pool_cleanup_kill(lock->pool, lock, proc_pthread_cleanup);
             return APR_SUCCESS;
         }
         return stat;
     }
     
    -apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname)
    +static apr_status_t proc_pthread_child_init(apr_lock_t **lock, apr_pool_t *cont, const char *fname)
     {
         return APR_SUCCESS;
     }
     
    -#elif (APR_USE_FCNTL_SERIALIZE)  
    +const apr_unix_lock_methods_t apr_unix_proc_pthread_methods =
    +{
    +    proc_pthread_create,
    +    proc_pthread_acquire,
    +    proc_pthread_release,
    +    proc_pthread_destroy,
    +    proc_pthread_child_init
    +};
    +
    +#endif
    +
    +#if APR_HAS_FCNTL_SERIALIZE
     
     static struct flock lock_it;
     static struct flock unlock_it;
     
    -void apr_unix_setup_lock(void)
    +static apr_status_t fcntl_release(apr_lock_t *);
    +
    +static void fcntl_setup(void)
     {
         lock_it.l_whence = SEEK_SET;        /* from current point */
         lock_it.l_start = 0;                /* -"- */
    @@ -291,19 +315,20 @@ void apr_unix_setup_lock(void)
         unlock_it.l_pid = 0;                /* pid not actually interesting */
     }
     
    -static apr_status_t lock_cleanup(void *lock_)
    +static apr_status_t fcntl_cleanup(void *lock_)
     {
         apr_lock_t *lock=lock_;
     
         if (lock->curr_locked == 1) {
    -        return apr_unix_unlock_inter(lock);
    +        return fcntl_release(lock);
         }
         return APR_SUCCESS;
     }    
     
    -apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
    +static apr_status_t fcntl_create(apr_lock_t *new, const char *fname)
     {
    -    if (new->fname) {
    +    if (fname) {
    +        new->fname = apr_pstrdup(new->pool, fname);
             new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644);
         }
         else {
    @@ -312,18 +337,18 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
         }
     
         if (new->interproc < 0) {
    -        lock_cleanup(new);
    +        fcntl_cleanup(new);
             return errno;
         }
     
         new->curr_locked=0;
         unlink(new->fname);
    -    apr_pool_cleanup_register(new->pool, (void*)new, lock_cleanup, 
    +    apr_pool_cleanup_register(new->pool, (void*)new, fcntl_cleanup, 
                                   apr_pool_cleanup_null);
         return APR_SUCCESS; 
     }
     
    -apr_status_t apr_unix_lock_inter(apr_lock_t *lock)
    +static apr_status_t fcntl_acquire(apr_lock_t *lock)
     {
         int rc;
     
    @@ -337,7 +362,7 @@ apr_status_t apr_unix_lock_inter(apr_lock_t *lock)
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_unix_unlock_inter(apr_lock_t *lock)
    +static apr_status_t fcntl_release(apr_lock_t *lock)
     {
         int rc;
     
    @@ -351,43 +376,56 @@ apr_status_t apr_unix_unlock_inter(apr_lock_t *lock)
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
    +static apr_status_t fcntl_destroy(apr_lock_t *lock)
     {
         apr_status_t stat;
    -    if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        apr_pool_cleanup_kill(lock->pool, lock, lock_cleanup);
    +    if ((stat = fcntl_cleanup(lock)) == APR_SUCCESS) {
    +        apr_pool_cleanup_kill(lock->pool, lock, fcntl_cleanup);
             return APR_SUCCESS;
         }
         return stat;
     }
     
    -apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, 
    -                                    const char *fname)
    +static apr_status_t fcntl_child_init(apr_lock_t **lock, apr_pool_t *cont, 
    +                                     const char *fname)
     {
         return APR_SUCCESS;
     }
     
    +const apr_unix_lock_methods_t apr_unix_fcntl_methods =
    +{
    +    fcntl_create,
    +    fcntl_acquire,
    +    fcntl_release,
    +    fcntl_destroy,
    +    fcntl_child_init
    +};
    +
    +#endif /* fcntl implementation */
     
    -#elif (APR_USE_FLOCK_SERIALIZE)
    +#if APR_HAS_FLOCK_SERIALIZE
     
    -void apr_unix_setup_lock(void)
    +static apr_status_t flock_release(apr_lock_t *);
    +
    +static void flock_setup(void)
     {
     }
     
    -static apr_status_t lock_cleanup(void *lock_)
    +static apr_status_t flock_cleanup(void *lock_)
     {
         apr_lock_t *lock=lock_;
     
         if (lock->curr_locked == 1) {
    -        return apr_unix_unlock_inter(lock);
    +        return flock_release(lock);
         }
         unlink(lock->fname);
         return APR_SUCCESS;
     }    
     
    -apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
    +static apr_status_t flock_create(apr_lock_t *new, const char *fname)
     {
    -    if (new->fname) {
    +    if (fname) {
    +        new->fname = apr_pstrdup(new->pool, fname);
             new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600);
         }
         else {
    @@ -396,16 +434,16 @@ apr_status_t apr_unix_create_inter_lock(apr_lock_t *new)
         }
     
         if (new->interproc < 0) {
    -        lock_cleanup(new);
    +        flock_cleanup(new);
             return errno;
         }
         new->curr_locked = 0;
    -    apr_pool_cleanup_register(new->pool, (void *)new, lock_cleanup,
    +    apr_pool_cleanup_register(new->pool, (void *)new, flock_cleanup,
                                   apr_pool_cleanup_null);
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_unix_lock_inter(apr_lock_t *lock)
    +static apr_status_t flock_acquire(apr_lock_t *lock)
     {
         int rc;
     
    @@ -419,7 +457,7 @@ apr_status_t apr_unix_lock_inter(apr_lock_t *lock)
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_unix_unlock_inter(apr_lock_t *lock)
    +static apr_status_t flock_release(apr_lock_t *lock)
     {
         int rc;
     
    @@ -433,18 +471,18 @@ apr_status_t apr_unix_unlock_inter(apr_lock_t *lock)
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock)
    +static apr_status_t flock_destroy(apr_lock_t *lock)
     {
         apr_status_t stat;
    -    if ((stat = lock_cleanup(lock)) == APR_SUCCESS) {
    -        apr_pool_cleanup_kill(lock->new, lock, lock_cleanup);
    +    if ((stat = flock_cleanup(lock)) == APR_SUCCESS) {
    +        apr_pool_cleanup_kill(lock->pool, lock, flock_cleanup);
             return APR_SUCCESS;
         }
         return stat;
     }
     
    -apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, 
    -                            const char *fname)
    +static apr_status_t flock_child_init(apr_lock_t **lock, apr_pool_t *cont, 
    +                                     const char *fname)
     {
         apr_lock_t *new;
     
    @@ -453,18 +491,36 @@ apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont,
         new->fname = apr_pstrdup(cont, fname);
         new->interproc = open(new->fname, O_WRONLY, 0600);
         if (new->interproc == -1) {
    -        apr_unix_destroy_inter_lock(new);
    +        flock_destroy(new);
             return errno;
         }
         *lock = new;
         return APR_SUCCESS;
     }
     
    -#else
    -/* No inter-process mutex on this platform.  Use at your own risk */
    -#define create_inter_lock(x, y)
    -#define lock_inter(x, y)
    -#define unlock_inter(x, y)
    -#define destroy_inter_lock(x, y)
    -#define child_init_lock(x, y, z)
    +const apr_unix_lock_methods_t apr_unix_flock_methods =
    +{
    +    flock_create,
    +    flock_acquire,
    +    flock_release,
    +    flock_destroy,
    +    flock_child_init
    +};
    +
    +#endif /* flock implementation */
    +
    +void apr_unix_setup_lock(void)
    +{
    +#if APR_HAS_SYSVSEM_SERIALIZE
    +    sysv_setup();
    +#endif
    +#if APR_HAS_PROC_PTHREAD_SERIALIZE
    +    proc_pthread_setup();
     #endif
    +#if APR_HAS_FCNTL_SERIALIZE
    +    fcntl_setup();
    +#endif
    +#if APR_HAS_FLOCK_SERIALIZE
    +    flock_setup();
    +#endif
    +}
    diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c
    index ef01c8090c7..216efc6b1bd 100644
    --- a/locks/unix/intraproc.c
    +++ b/locks/unix/intraproc.c
    @@ -73,7 +73,7 @@ static apr_status_t lock_intra_cleanup(void *data)
         return stat;
     }    
     
    -apr_status_t apr_unix_create_intra_lock(apr_lock_t *new)
    +static apr_status_t intra_create(apr_lock_t *new, const char *fname)
     {
         apr_status_t stat;
         pthread_mutexattr_t mattr;
    @@ -113,7 +113,7 @@ apr_status_t apr_unix_create_intra_lock(apr_lock_t *new)
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_unix_lock_intra(apr_lock_t *lock)
    +static apr_status_t intra_acquire(apr_lock_t *lock)
     {
         apr_status_t stat;
     
    @@ -126,7 +126,7 @@ apr_status_t apr_unix_lock_intra(apr_lock_t *lock)
         return stat;
     }
     
    -apr_status_t apr_unix_unlock_intra(apr_lock_t *lock)
    +static apr_status_t intra_release(apr_lock_t *lock)
     {
         apr_status_t status;
     
    @@ -139,7 +139,7 @@ apr_status_t apr_unix_unlock_intra(apr_lock_t *lock)
         return status;
     }
     
    -apr_status_t apr_unix_destroy_intra_lock(apr_lock_t *lock)
    +static apr_status_t intra_destroy(apr_lock_t *lock)
     {
         apr_status_t stat;
         if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) {
    @@ -148,5 +148,46 @@ apr_status_t apr_unix_destroy_intra_lock(apr_lock_t *lock)
         }
         return stat;
     }
    +
    +#endif /* APR_USE_PTHREAD_SERIALIZE */
    +
    +const apr_unix_lock_methods_t apr_unix_intra_methods =
    +{
    +    intra_create,
    +    intra_acquire,
    +    intra_release,
    +    intra_destroy,
    +    NULL /* no child init */
    +};
    +
    +#if APR_HAS_RWLOCK_SERIALIZE
    +static apr_status_t rwlock_create(apr_lock_t *new, const char *fname)
    +{
    +    /* XXX check retcode */
    +    pthread_rwlock_init(&new->rwlock, NULL);
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t rwlock_release(apr_lock_t *lock)
    +{
    +    /* XXX PTHREAD_SETS_ERRNO crap? */
    +    return pthread_rwlock_unlock(&lock->rwlock);
    +}
    +
    +static apr_status_t rwlock_destroy(apr_lock_t *lock)
    +{
    +    /* XXX PTHREAD_SETS_ERRNO crap? */
    +    return pthread_rwlock_destroy(&lock->rwlock);
    +}
    +
    +const apr_unix_lock_methods_t apr_unix_rwlock_methods =
    +{
    +    rwlock_create,
    +    NULL, /* no standard acquire method; app better not call :) */
    +    rwlock_release,
    +    rwlock_destroy,
    +    NULL /* no child init method */
    +};
     #endif
    -#endif
    +
    +#endif /* APR_HAS_THREADS */
    diff --git a/locks/unix/locks.c b/locks/unix/locks.c
    index 539f2f29dbf..e7e8659a576 100644
    --- a/locks/unix/locks.c
    +++ b/locks/unix/locks.c
    @@ -56,53 +56,134 @@
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    +#if !APR_PROCESS_LOCK_IS_GLOBAL && APR_HAS_THREADS
    +static apr_status_t lockall_create(apr_lock_t *new, const char *fname)
    +{
    +    apr_status_t rv;
    +
    +    if ((rv = new->inter_meth->create(new, fname)) != APR_SUCCESS) {
    +        return rv;
    +    }
    +    if ((rv = new->intra_meth->create(new, fname)) != APR_SUCCESS) {
    +        return rv;
    +    }
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t lockall_acquire(apr_lock_t *lock)
    +{
    +    apr_status_t rv;
    +
    +    if ((rv = lock->intra_meth->acquire(lock)) != APR_SUCCESS) {
    +        return rv;
    +    }
    +    if ((rv = lock->inter_meth->acquire(lock)) != APR_SUCCESS) {
    +        return rv;
    +    }
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t lockall_release(apr_lock_t *lock)
    +{
    +    apr_status_t rv;
    +
    +    if ((rv = lock->intra_meth->release(lock)) != APR_SUCCESS) {
    +        return rv;
    +    }
    +    if ((rv = lock->inter_meth->release(lock)) != APR_SUCCESS) {
    +        return rv;
    +    }
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t lockall_destroy(apr_lock_t *lock)
    +{
    +    apr_status_t rv;
    +
    +    if ((rv = lock->intra_meth->destroy(lock)) != APR_SUCCESS) {
    +        return rv;
    +    }
    +    if ((rv = lock->inter_meth->destroy(lock)) != APR_SUCCESS) {
    +        return rv;
    +    }
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t lockall_child_init(apr_lock_t **lock, apr_pool_t *pool,
    +                                       const char *fname)
    +{
    +    /* no child init for intra lock */
    +    return (*lock)->inter_meth->child_init(lock, pool, fname);
    +}
    +
    +static const struct apr_unix_lock_methods_t lockall_methods =
    +{
    +    lockall_create,
    +    lockall_acquire,
    +    lockall_release,
    +    lockall_destroy,
    +    lockall_child_init
    +};
    +#endif
    +
     static apr_status_t create_lock(apr_lock_t *new, const char *fname)
     {
         apr_status_t stat;
     
    -    switch (new->type)
    -    {
    -    case APR_MUTEX:
    -#if (APR_USE_FCNTL_SERIALIZE) || (APR_USE_FLOCK_SERIALIZE)
    -    /* file-based serialization primitives */
         if (new->scope != APR_INTRAPROCESS) {
    -        if (fname != NULL) {
    -            new->fname = apr_pstrdup(new->pool, fname);
    -        }
    -    }
    +#if APR_USE_FLOCK_SERIALIZE
    +        new->inter_meth = &apr_unix_flock_methods;
    +#elif APR_USE_SYSVSEM_SERIALIZE
    +        new->inter_meth = &apr_unix_sysv_methods;
    +#elif APR_USE_FCNTL_SERIALIZE
    +        new->inter_meth = &apr_unix_fcntl_methods;
    +#elif APR_USE_PROC_PTHREAD_SERIALIZE
    +        new->inter_method = &apr_unix_proc_pthread_methods;
    +#else
    +        return APR_ENOTIMPL;
     #endif
    +    }
     
    -#if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */
    -    if (new->scope == APR_INTRAPROCESS) {
    -#else
         if (new->scope != APR_CROSS_PROCESS) {
    -#endif
     #if APR_HAS_THREADS
    -        if ((stat = apr_unix_create_intra_lock(new)) != APR_SUCCESS) {
    -            return stat;
    -        }
    +        if (new->type == APR_READWRITE) {
    +#if APR_HAS_RWLOCK_SERIALIZE
    +            new->intra_meth = &apr_unix_rwlock_methods;
     #else
    -        if (new->scope != APR_LOCKALL) {
    -            return APR_ENOTIMPL;
    -        }
    +            return APR_ENOTIMPL; /* 'cause we don't have rwlocks */
     #endif
    -    }
    -    if (new->scope != APR_INTRAPROCESS) {
    -        if ((stat = apr_unix_create_inter_lock(new)) != APR_SUCCESS) {
    -            return stat;
             }
    +        else {
    +            new->intra_meth = &apr_unix_intra_methods;
    +        }
    +#else
    +        return APR_ENOTIMPL; /* 'cause we don't have threads */
    +#endif
         }
    -    break;
    -    case APR_READWRITE:
    -#ifdef HAVE_PTHREAD_RWLOCK_INIT
    -    if (new->scope != APR_INTRAPROCESS)
    -        return APR_ENOTIMPL;
    -    pthread_rwlock_init(&new->rwlock, NULL);
    -    break;
    +
    +    switch (new->scope) {
    +    case APR_LOCKALL:
    +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS
    +        /* XXX but how do we know that this particular mechanism has this
    +         * property?  for now we assume all mechanisms on this system have
    +         * the property
    +         */
    +        new->meth = new->inter_meth;
     #else
    -    return APR_ENOTIMPL;
    +        new->meth = &lockall_methods;
     #endif
    +        break;
    +    case APR_CROSS_PROCESS:
    +        new->meth = new->inter_meth;
    +        break;
    +    case APR_INTRAPROCESS:
    +        new->meth = new->intra_meth;
         }
    +
    +    if ((stat = new->meth->create(new, fname)) != APR_SUCCESS) {
    +        return stat;
    +    }
    +
         return APR_SUCCESS;
     }
     
    @@ -137,30 +218,8 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock)
         }
     #endif
     
    -    switch (lock->type)
    -    {
    -    case APR_MUTEX:
    -#if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */
    -    if (lock->scope == APR_INTRAPROCESS) {
    -#else
    -    if (lock->scope != APR_CROSS_PROCESS) {
    -#endif
    -#if APR_HAS_THREADS
    -        if ((stat = apr_unix_lock_intra(lock)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -#else
    -        /* must be APR_LOCKALL */
    -#endif
    -    }
    -    if (lock->scope != APR_INTRAPROCESS) {
    -        if ((stat = apr_unix_lock_inter(lock)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -    }
    -    break;
    -    case APR_READWRITE:
    -        return APR_ENOTIMPL;
    +    if ((stat = lock->meth->acquire(lock)) != APR_SUCCESS) {
    +        return stat;
         }
     
     #if APR_HAS_THREADS
    @@ -211,36 +270,8 @@ apr_status_t apr_lock_release(apr_lock_t *lock)
         }
     #endif
     
    -    switch (lock->type)
    -    {
    -    case APR_MUTEX:
    -#if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */
    -    if (lock->scope == APR_INTRAPROCESS) {
    -#else
    -    if (lock->scope != APR_CROSS_PROCESS) {
    -#endif
    -#if APR_HAS_THREADS
    -        if ((stat = apr_unix_unlock_intra(lock)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -#else
    -        /* must be APR_LOCKALL */
    -#endif
    -    }
    -    if (lock->scope != APR_INTRAPROCESS) {
    -        if ((stat = apr_unix_unlock_inter(lock)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -    }
    -    break;
    -    case APR_READWRITE:
    -#ifdef HAVE_PTHREAD_RWLOCK_INIT
    -        if ((stat = pthread_rwlock_unlock(&lock->rwlock)) != 0)
    -            return stat;
    -        break;
    -#else
    -        return APR_ENOTIMPL;
    -#endif
    +    if ((stat = lock->meth->release(lock)) != APR_SUCCESS) {
    +        return stat;
         }
     
     #if APR_HAS_THREADS
    @@ -253,53 +284,14 @@ apr_status_t apr_lock_release(apr_lock_t *lock)
     
     apr_status_t apr_lock_destroy(apr_lock_t *lock)
     {
    -    apr_status_t stat;
    -
    -    switch (lock->type)
    -    {
    -    case APR_MUTEX:
    -#if APR_PROCESS_LOCK_IS_GLOBAL /* don't need intra lock for APR_LOCKALL */
    -    if (lock->scope == APR_INTRAPROCESS) {
    -#else
    -    if (lock->scope != APR_CROSS_PROCESS) {
    -#endif
    -#if APR_HAS_THREADS
    -        if ((stat = apr_unix_destroy_intra_lock(lock)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -#else
    -        if (lock->scope != APR_LOCKALL) {
    -            return APR_ENOTIMPL;
    -        }
    -#endif
    -    }
    -    if (lock->scope != APR_INTRAPROCESS) {
    -        if ((stat = apr_unix_destroy_inter_lock(lock)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -    }
    -    break;
    -    case APR_READWRITE:
    -#ifdef HAVE_PTHREAD_RWLOCK_INIT
    -    if ((stat = pthread_rwlock_destroy(&lock->rwlock)) != 0)
    -        return stat;
    -    break;
    -#else
    -    return APR_ENOTIMPL;
    -#endif
    -    }
    -    return APR_SUCCESS;
    +    return lock->meth->destroy(lock);
     }
     
     apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, 
                                    apr_pool_t *cont)
     {
    -    apr_status_t stat;
    -    if ((*lock)->scope != APR_INTRAPROCESS) {
    -        if ((stat = apr_unix_child_init_lock(lock, cont, fname)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -    }
    +    if ((*lock)->scope != APR_INTRAPROCESS)
    +        return (*lock)->meth->child_init(lock, cont, fname);
         return APR_SUCCESS;
     }
     
    @@ -336,6 +328,7 @@ apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock,
             (*lock) = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t));
             (*lock)->pool = pool;
         }
    +    /* XXX handle setting of handle for PROC_PTHREAD_SERIALIZE here */
         (*lock)->interproc = thelock->crossproc;
     #if APR_HAS_THREADS
     #if (APR_USE_PTHREAD_SERIALIZE)
    
    From ad50db468e89224b2984937141cbd04d36bd1be5 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 25 Jun 2001 20:23:16 +0000
    Subject: [PATCH 1803/7878] Fix a few errors in the previous commit which
     affect locks on Unix:
    
    . don't return APR_SUCCESS for failures in create_lock()
    . don't return APR_ENOTIMPL for a request to create a lock with scope
      APR_LOCK_ALL when !APR_HAS_THREADS
    . when using flock(), get the new apr_lock_t constructed properly in
      the child init method
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61795 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/unix/crossproc.c | 10 ++++++++--
     locks/unix/locks.c     |  6 ++++--
     2 files changed, 12 insertions(+), 4 deletions(-)
    
    diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c
    index a27d49525b7..258607d780b 100644
    --- a/locks/unix/crossproc.c
    +++ b/locks/unix/crossproc.c
    @@ -486,8 +486,14 @@ static apr_status_t flock_child_init(apr_lock_t **lock, apr_pool_t *cont,
     {
         apr_lock_t *new;
     
    -    new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t));
    -
    +    new = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t));
    +
    +    new->pool = cont;
    +    new->meth = (*lock)->meth;
    +    new->inter_meth = (*lock)->inter_meth;
    +    new->intra_meth = NULL;
    +    new->type = (*lock)->type;
    +    new->scope = (*lock)->scope;
         new->fname = apr_pstrdup(cont, fname);
         new->interproc = open(new->fname, O_WRONLY, 0600);
         if (new->interproc == -1) {
    diff --git a/locks/unix/locks.c b/locks/unix/locks.c
    index e7e8659a576..11d719b820a 100644
    --- a/locks/unix/locks.c
    +++ b/locks/unix/locks.c
    @@ -157,7 +157,9 @@ static apr_status_t create_lock(apr_lock_t *new, const char *fname)
                 new->intra_meth = &apr_unix_intra_methods;
             }
     #else
    -        return APR_ENOTIMPL; /* 'cause we don't have threads */
    +        if (new->scope == APR_INTRAPROCESS) {
    +            return APR_ENOTIMPL; /* 'cause we don't have threads */
    +        }
     #endif
         }
     
    @@ -201,7 +203,7 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type,
         new->scope = scope;
     
         if ((stat = create_lock(new, fname)) != APR_SUCCESS)
    -        return APR_SUCCESS;
    +        return stat;
     
         *lock = new;
         return APR_SUCCESS;
    
    From d1c29989a65643078c9d3d63c7635bed5cdca242 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 26 Jun 2001 00:22:08 +0000
    Subject: [PATCH 1804/7878] Fix the check for flock() so we don't get confused
     on AIX.
    
    Instead of checking for the presence of , really
    check for the function.
    
    (I see flock() in the man pages but ld can't find it.  At least
    APR builds okay now.)
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61796 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in              | 2 +-
     include/arch/unix/locks.h | 2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/configure.in b/configure.in
    index aa3ccffa04f..3e0c80f29c0 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -907,7 +907,7 @@ AC_SUBST(struct_rlimit)
     dnl #----------------------------- Checking for Locking Characteristics 
     echo $ac_n "${nl}Checking for Locking...${nl}"
     
    -AC_CHECK_FUNCS(semget semctl)
    +AC_CHECK_FUNCS(semget semctl flock)
     
     # It's stupid, but not all platforms have union semun, even those that need it.
     AC_MSG_CHECKING(for union semun in sys/sem.h)
    diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h
    index ba25d9ed030..02a96b97f81 100644
    --- a/include/arch/unix/locks.h
    +++ b/include/arch/unix/locks.h
    @@ -123,7 +123,7 @@ extern const apr_unix_lock_methods_t apr_unix_fcntl_methods;
     #define APR_HAS_FCNTL_SERIALIZE        0
     #endif
     
    -#if defined(HAVE_SYS_FILE_H) && defined(HAVE_LOCK_EX)
    +#if defined(HAVE_FLOCK) && defined(HAVE_LOCK_EX)
     #define APR_HAS_FLOCK_SERIALIZE        1
     extern const apr_unix_lock_methods_t apr_unix_flock_methods;
     #else
    
    From 623b51fcee06c42b1a2f2507a4c7a38264a9381b Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 26 Jun 2001 02:05:05 +0000
    Subject: [PATCH 1805/7878] Add apr_lock_create_np() (Unix only, for now) which
     allows the caller to specify the mechanism used for the interprocess lock (if
     any).
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61797 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in       |  7 +++++
     include/apr.h.in   |  2 ++
     include/apr.hw     |  2 ++
     include/apr_lock.h | 48 ++++++++++++++++++++++++++++++++++
     locks/unix/locks.c | 65 ++++++++++++++++++++++++++++++++++++++++------
     5 files changed, 116 insertions(+), 8 deletions(-)
    
    diff --git a/configure.in b/configure.in
    index 3e0c80f29c0..83446a23743 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -974,11 +974,18 @@ case $ac_decision in
             ;;
     esac
     
    +if test "$flockser$sysvser$fcntlser$procpthreadser" = "0000"; then
    +  lockcreatenp="0"
    +else
    +  lockcreatenp="1"
    +fi
    +
     AC_SUBST(flockser)
     AC_SUBST(sysvser)
     AC_SUBST(fcntlser)
     AC_SUBST(procpthreadser)
     AC_SUBST(pthreadser)
    +AC_SUBST(lockcreatenp)
     
     AC_MSG_CHECKING(if interprocess lock affects threads)
     if test "x$apr_process_lock_is_global" = "xyes"; then
    diff --git a/include/apr.h.in b/include/apr.h.in
    index cad4c09d816..db8277db19e 100644
    --- a/include/apr.h.in
    +++ b/include/apr.h.in
    @@ -64,6 +64,8 @@
     #define APR_USE_PROC_PTHREAD_SERIALIZE    @procpthreadser@ 
     #define APR_USE_PTHREAD_SERIALIZE         @pthreadser@ 
     
    +#define APR_HAS_LOCK_CREATE_NP            @lockcreatenp@
    +
     #define APR_PROCESS_LOCK_IS_GLOBAL        @proclockglobal@
     
     #define APR_USES_ANONYMOUS_SHM            @anonymous_shm@
    diff --git a/include/apr.hw b/include/apr.hw
    index 2eda87a8ce8..7cc8b1a0f3a 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -157,6 +157,8 @@
     #define APR_USE_PROC_PTHREAD_SERIALIZE    0 
     #define APR_USE_PTHREAD_SERIALIZE         0 
     
    +#define APR_HAS_LOCK_CREATE_NP            0
    +
     #define APR_PROCESS_LOCK_IS_GLOBAL        0
     
     #define APR_USES_ANONYMOUS_SHM            0
    diff --git a/include/apr_lock.h b/include/apr_lock.h
    index b3f0dff8760..fd3439b367f 100644
    --- a/include/apr_lock.h
    +++ b/include/apr_lock.h
    @@ -178,6 +178,54 @@ APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data,
                                                const char *key,
                                                apr_status_t (*cleanup)(void *));
     
    +#if APR_HAS_LOCK_CREATE_NP
    +
    +typedef enum {APR_LOCK_FCNTL, APR_LOCK_FLOCK, APR_LOCK_SYSVSEM, APR_LOCK_PROC_PTHREAD,
    +              APR_LOCK_DEFAULT} apr_lockmech_e_np;
    +
    +/**
    + * non-portable interface to apr_lock_create()
    + *
    + * Create a new instance of a lock structure.  This is like apr_lock_create()
    + * but has some non-portable parameters.  This should be used sparingly.
    + *
    + * @param lock The newly created lock structure.
    + * @param type The type of lock to create, one of:
    + * 
    + *            APR_MUTEX
    + *            APR_READWRITE
    + * 
    + * @param scope The scope of the lock to create, one of: + *
    + *            APR_CROSS_PROCESS    lock processes from the protected area.
    + *            APR_INTRAPROCESS     lock threads from the protected area.
    + *            APR_LOCKALL          lock processes and threads from the
    + *                                 protected area.
    + * 
    + * @param mech The mechanism to use for the interprocess lock, if any; one of + *
    + *            APR_LOCK_FCNTL
    + *            APR_LOCK_FLOCK
    + *            APR_LOCK_SYSVSEM
    + *            APR_LOCK_PROC_PTHREAD
    + *            APR_LOCK_DEFAULT     pick the default mechanism for the platform
    + * 
    + * @param fname A file name to use if the lock mechanism requires one. This + * argument should always be provided. The lock code itself will + * determine if it should be used. + * @param pool The pool to operate on. + * @tip APR_CROSS_PROCESS may lock both processes and threads, but it is + * only guaranteed to lock processes. + * @deffunc apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *pool) + */ +APR_DECLARE(apr_status_t) apr_lock_create_np(apr_lock_t **lock, + apr_locktype_e type, + apr_lockscope_e scope, + apr_lockmech_e_np mech, + const char *fname, + apr_pool_t *pool); +#endif /* APR_HAS_LOCK_CREATE_NP */ + #ifdef __cplusplus } #endif diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 11d719b820a..b500df7b618 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -126,11 +126,38 @@ static const struct apr_unix_lock_methods_t lockall_methods = }; #endif -static apr_status_t create_lock(apr_lock_t *new, const char *fname) +static apr_status_t choose_method(apr_lock_t *new, apr_lockmech_e_np mech) { - apr_status_t stat; - - if (new->scope != APR_INTRAPROCESS) { + switch (mech) { + case APR_LOCK_FCNTL: +#if APR_HAS_FCNTL_SERIALIZE + new->inter_meth = &apr_unix_fcntl_methods; +#else + return APR_ENOTIMPL; +#endif + break; + case APR_LOCK_FLOCK: +#if APR_HAS_FLOCK_SERIALIZE + new->inter_meth = &apr_unix_flock_methods; +#else + return APR_ENOTIMPL; +#endif + break; + case APR_LOCK_SYSVSEM: +#if APR_HAS_SYSVSEM_SERIALIZE + new->inter_meth = &apr_unix_sysv_methods; +#else + return APR_ENOTIMPL; +#endif + break; + case APR_LOCK_PROC_PTHREAD: +#if APR_HAS_PROC_PTHREAD_SERIALIZE + new->inter_meth = &apr_unix_proc_pthread_methods; +#else + return APR_ENOTIMPL; +#endif + break; + case APR_LOCK_DEFAULT: #if APR_USE_FLOCK_SERIALIZE new->inter_meth = &apr_unix_flock_methods; #elif APR_USE_SYSVSEM_SERIALIZE @@ -142,6 +169,21 @@ static apr_status_t create_lock(apr_lock_t *new, const char *fname) #else return APR_ENOTIMPL; #endif + break; + default: + return APR_ENOTIMPL; + } + return APR_SUCCESS; +} + +static apr_status_t create_lock(apr_lock_t *new, apr_lockmech_e_np mech, const char *fname) +{ + apr_status_t stat; + + if (new->scope != APR_INTRAPROCESS) { + if ((stat = choose_method(new, mech)) != APR_SUCCESS) { + return stat; + } } if (new->scope != APR_CROSS_PROCESS) { @@ -189,9 +231,9 @@ static apr_status_t create_lock(apr_lock_t *new, const char *fname) return APR_SUCCESS; } -apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, - apr_lockscope_e scope, const char *fname, - apr_pool_t *pool) +apr_status_t apr_lock_create_np(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, apr_lockmech_e_np mech, + const char *fname, apr_pool_t *pool) { apr_lock_t *new; apr_status_t stat; @@ -202,13 +244,20 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, new->type = type; new->scope = scope; - if ((stat = create_lock(new, fname)) != APR_SUCCESS) + if ((stat = create_lock(new, mech, fname)) != APR_SUCCESS) return stat; *lock = new; return APR_SUCCESS; } +apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, const char *fname, + apr_pool_t *pool) +{ + return apr_lock_create_np(lock, type, scope, APR_LOCK_DEFAULT, fname, pool); +} + apr_status_t apr_lock_acquire(apr_lock_t *lock) { apr_status_t stat; From b649326686ab6f9bb3fe8ee98ac76671a6e580c5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 26 Jun 2001 15:07:31 +0000 Subject: [PATCH 1806/7878] Export APR_HAS_foo_SERIALIZE symbols from APR so apps can tell which lock mechanisms are available. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61798 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 17 ++++++++++++++++- include/apr.h.in | 5 +++++ include/apr.hw | 5 +++++ include/arch/unix/locks.h | 23 ++++------------------- 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/configure.in b/configure.in index 83446a23743..2f5e419e2b9 100644 --- a/configure.in +++ b/configure.in @@ -938,11 +938,22 @@ if test "$threads" = "1"; then APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h) fi +# See which lock mechanisms we can support on this system. +hassysvser="0" +hasflockser="0" +hasfcntlser="0" +hasprocpthreadser="0" +APR_IFALLYES(func:semget func:semctl, hassysvser="1") +APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1") +APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1") +APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED, hasprocpthreadser="1") + +# See which lock mechanism we'll select by default on this system. # The last APR_DECIDE to execute sets the default APR_BEGIN_DECISION([apr_lock implementation method]) APR_IFALLYES(func:semget func:semctl, APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) -APR_IFALLYES(header:sys/file.h define:LOCK_EX, +APR_IFALLYES(func:flock define:LOCK_EX, APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) APR_IFALLYES(header:fcntl.h define:F_SETLK, APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) @@ -980,6 +991,10 @@ else lockcreatenp="1" fi +AC_SUBST(hasflockser) +AC_SUBST(hassysvser) +AC_SUBST(hasfcntlser) +AC_SUBST(hasprocpthreadser) AC_SUBST(flockser) AC_SUBST(sysvser) AC_SUBST(fcntlser) diff --git a/include/apr.h.in b/include/apr.h.in index db8277db19e..ae898d3d80e 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -64,6 +64,11 @@ #define APR_USE_PROC_PTHREAD_SERIALIZE @procpthreadser@ #define APR_USE_PTHREAD_SERIALIZE @pthreadser@ +#define APR_HAS_FLOCK_SERIALIZE @hasflockser@ +#define APR_HAS_SYSVSEM_SERIALIZE @hassysvser@ +#define APR_HAS_FCNTL_SERIALIZE @hasfcntlser@ +#define APR_HAS_PROC_PTHREAD_SERIALIZE @hasprocpthreadser@ + #define APR_HAS_LOCK_CREATE_NP @lockcreatenp@ #define APR_PROCESS_LOCK_IS_GLOBAL @proclockglobal@ diff --git a/include/apr.hw b/include/apr.hw index 7cc8b1a0f3a..a5c57ae15f7 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -157,6 +157,11 @@ #define APR_USE_PROC_PTHREAD_SERIALIZE 0 #define APR_USE_PTHREAD_SERIALIZE 0 +#define APR_HAS_FLOCK_SERIALIZE 0 +#define APR_HAS_SYSVSEM_SERIALIZE 0 +#define APR_HAS_FCNTL_SERIALIZE 0 +#define APR_HAS_PROC_PTHREAD_SERIALIZE 0 + #define APR_HAS_LOCK_CREATE_NP 0 #define APR_PROCESS_LOCK_IS_GLOBAL 0 diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index 02a96b97f81..70b4476ddca 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -109,32 +109,17 @@ struct apr_unix_lock_methods_t { }; typedef struct apr_unix_lock_methods_t apr_unix_lock_methods_t; -#if defined(HAVE_SEMCTL) && defined(HAVE_SEMGET) -#define APR_HAS_SYSVSEM_SERIALIZE 1 +#if APR_HAS_SYSVSEM_SERIALIZE extern const apr_unix_lock_methods_t apr_unix_sysv_methods; -#else -#define APR_HAS_SYSVSEM_SERIALIZE 0 #endif - -#if defined(HAVE_FCNTL_H) && defined(HAVE_F_SETLK) -#define APR_HAS_FCNTL_SERIALIZE 1 +#if APR_HAS_FCNTL_SERIALIZE extern const apr_unix_lock_methods_t apr_unix_fcntl_methods; -#else -#define APR_HAS_FCNTL_SERIALIZE 0 #endif - -#if defined(HAVE_FLOCK) && defined(HAVE_LOCK_EX) -#define APR_HAS_FLOCK_SERIALIZE 1 +#if APR_HAS_FLOCK_SERIALIZE extern const apr_unix_lock_methods_t apr_unix_flock_methods; -#else -#define APR_HAS_FLOCK_SERIALIZE 0 #endif - -#if defined(HAVE_PTHREAD_H) && defined(HAVE_PTHREAD_PROCESS_SHARED) && defined(HAVE_PTHREAD_MUTEXATTR_SETPSHARED) -#define APR_HAS_PROC_PTHREAD_SERIALIZE 1 +#if APR_HAS_PROC_PTHREAD_SERIALIZE extern const apr_unix_lock_methods_t apr_unix_proc_pthread_methods; -#else -#define APR_HAS_PROC_PTHREAD_SERIALIZE 0 #endif #if defined(HAVE_PTHREAD_RWLOCK_INIT) From 92396f6fc7b3151cf89bc195411061edda2ad348 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 26 Jun 2001 15:09:20 +0000 Subject: [PATCH 1807/7878] get rid of an unused local variable git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61799 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 1 - 1 file changed, 1 deletion(-) diff --git a/test/testnames.c b/test/testnames.c index f14550342e6..d5f974f24ea 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -89,7 +89,6 @@ static void mergeresult(char *rootpath, char *addpath, apr_int32_t mergetype, ch { char errmsg[256]; char *dstpath = NULL; - const char *srcpath; apr_status_t status = apr_filepath_merge(&dstpath, strcmp(rootpath, "NULL") ? rootpath : NULL, strcmp(addpath, "NULL") ? addpath : NULL, From 108d36cd006b0e79cfd5e1293e6a7a1b68c848e6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 26 Jun 2001 15:33:01 +0000 Subject: [PATCH 1808/7878] tighten up the checking for when we have pthread process serialization; if the system doesn't have pthread_mutexattr_setpshared() then it won't build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61800 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 2f5e419e2b9..483513169a9 100644 --- a/configure.in +++ b/configure.in @@ -936,6 +936,7 @@ APR_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h) if test "$threads" = "1"; then APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h) + AC_CHECK_FUNCS(pthread_mutexattr_setpshared) fi # See which lock mechanisms we can support on this system. @@ -946,7 +947,7 @@ hasprocpthreadser="0" APR_IFALLYES(func:semget func:semctl, hassysvser="1") APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1") APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1") -APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED, hasprocpthreadser="1") +APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, hasprocpthreadser="1") # See which lock mechanism we'll select by default on this system. # The last APR_DECIDE to execute sets the default @@ -958,7 +959,7 @@ APR_IFALLYES(func:flock define:LOCK_EX, APR_IFALLYES(header:fcntl.h define:F_SETLK, APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl - custom:with_pthread_cross, + func:pthread_mutexattr_setpshared custom:with_pthread_cross, APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) From 148ed86008dccb366f66a7a733525caa09032e59 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 26 Jun 2001 17:15:51 +0000 Subject: [PATCH 1809/7878] get flock() mechanism child init working for APR_LOCK_ALL+APR_HAS_THREADS; previously, we didn't copy the pthread mutex or the intra process lock methods, leading to segfaults in a child process using the flock() mechanism git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61801 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/crossproc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 258607d780b..8e87ac88a11 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -486,14 +486,10 @@ static apr_status_t flock_child_init(apr_lock_t **lock, apr_pool_t *cont, { apr_lock_t *new; - new = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t)); + new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); + memcpy(new, *lock, sizeof *new); new->pool = cont; - new->meth = (*lock)->meth; - new->inter_meth = (*lock)->inter_meth; - new->intra_meth = NULL; - new->type = (*lock)->type; - new->scope = (*lock)->scope; new->fname = apr_pstrdup(cont, fname); new->interproc = open(new->fname, O_WRONLY, 0600); if (new->interproc == -1) { From 5fdd802876329e3cdaadccd505ea5b6114f7485c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 27 Jun 2001 16:44:40 +0000 Subject: [PATCH 1810/7878] clean up the generation of APR_HAS_foo_SERIALIZE just a bit by using APR_IFALLYES() in a smarter manner git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61802 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index 483513169a9..9ade3aa5f81 100644 --- a/configure.in +++ b/configure.in @@ -940,14 +940,10 @@ if test "$threads" = "1"; then fi # See which lock mechanisms we can support on this system. -hassysvser="0" -hasflockser="0" -hasfcntlser="0" -hasprocpthreadser="0" -APR_IFALLYES(func:semget func:semctl, hassysvser="1") -APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1") -APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1") -APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, hasprocpthreadser="1") +APR_IFALLYES(func:semget func:semctl, hassysvser="1", hassysvser="0") +APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1", hasflockser="0") +APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1", hasfcntlser="0") +APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, hasprocpthreadser="1", hasprocpthreadser="0") # See which lock mechanism we'll select by default on this system. # The last APR_DECIDE to execute sets the default From 71ea12d7e85516b0b68d8db7bf45835fdadfcb59 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 27 Jun 2001 19:08:33 +0000 Subject: [PATCH 1811/7878] what libapr? tests link to the static lib git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61803 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.dsw | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/aprtest.dsw b/test/aprtest.dsw index 5c02f9bdf51..a4e26943f3b 100644 --- a/test/aprtest.dsw +++ b/test/aprtest.dsw @@ -23,9 +23,6 @@ Package=<5> Package=<4> {{{ - Begin Project Dependency - Project_Dep_Name aprlib - End Project Dependency Begin Project Dependency Project_Dep_Name apr End Project Dependency From 589c01514e169060bebce612541f0089d2faa477 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 27 Jun 2001 19:40:53 +0000 Subject: [PATCH 1812/7878] *) Add apr_file_flags_get() which returns the flags that were originally passed in to apr_file_open(). *) Added APR_HAS_XTHREAD_FILES macro that indicates whether or not the platform handles files opened in APR_XTHREAD mode natively. Currently only Win32 has such native support. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61804 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++++++ file_io/unix/fileacc.c | 5 +++++ file_io/unix/filedup.c | 1 + file_io/unix/open.c | 2 +- file_io/win32/filedup.c | 1 + file_io/win32/open.c | 1 + include/apr.h.in | 1 + include/apr.hw | 1 + include/apr_file_io.h | 13 +++++++++++++ include/arch/unix/fileio.h | 2 +- include/arch/win32/fileio.h | 1 + 11 files changed, 33 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index ec8434ccf89..dbf47d88b9d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,12 @@ Changes with APR b1 + *) Add apr_file_flags_get() which returns the flags that were originally + passed in to apr_file_open(). [Cliff Woolley] + + *) Added APR_HAS_XTHREAD_FILES macro that indicates whether or not the + platform handles files opened in APR_XTHREAD mode natively. Currently + only Win32 has such native support. [Cliff Woolley] + *) Fix gmt offset handling on Solaris. Apache log messages now show local time again. PR #7902 [Taketo Kabe ] diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 6addcf9af69..0a6dfcd7da2 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -64,6 +64,11 @@ APR_DECLARE(apr_status_t) apr_file_name_get(const char **fname, return APR_SUCCESS; } +APR_DECLARE(apr_int32_t) apr_file_flags_get(apr_file_t *f) +{ + return f->flags; +} + #if !defined(OS2) && !defined(WIN32) mode_t apr_unix_perms2mode(apr_fileperms_t perms) { diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 89742924864..e7e6507d425 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -86,6 +86,7 @@ apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_ (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); } (*new_file)->blocking = old_file->blocking; /* this is the way dup() works */ + (*new_file)->flags = old_file->flags; apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), apr_unix_file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 87ee1b3a0ed..f3b9f9600f4 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -90,7 +90,7 @@ apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); (*new)->cntxt = cont; - (*new)->oflags = oflags; + (*new)->flags = flag; (*new)->filedes = -1; if ((flag & APR_READ) && (flag & APR_WRITE)) { diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index e3e048ebe61..e60eb1df639 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -103,6 +103,7 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, return APR_ENOTIMPL; } + (*new_file)->flags = old_file->flags; (*new_file)->cntxt = old_file->cntxt; (*new_file)->fname = apr_pstrdup(old_file->cntxt, old_file->fname); (*new_file)->append = old_file->append; diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 92b21df1575..8a3a8eb13b8 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -259,6 +259,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, (*new)->cntxt = cont; (*new)->filehand = handle; (*new)->fname = apr_pstrdup(cont, fname); + (*new)->flags = flag; if (flag & APR_APPEND) { (*new)->append = 1; diff --git a/include/apr.h.in b/include/apr.h.in index ae898d3d80e..c420e2aec1c 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -134,6 +134,7 @@ #define APR_HAS_UNICODE_FS 0 #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 0 +#define APR_HAS_XTHREAD_FILES 0 /* This macro tells APR that it is safe to make a file masquerade as a * socket. This is necessary, because some platforms support poll'ing diff --git a/include/apr.hw b/include/apr.hw index a5c57ae15f7..59be81439bf 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -210,6 +210,7 @@ #define APR_HAS_UNICODE_FS 1 #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 1 +#define APR_HAS_XTHREAD_FILES 1 /* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE * on all platforms. diff --git a/include/apr_file_io.h b/include/apr_file_io.h index bb785b474f4..902f1590184 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -136,6 +136,11 @@ typedef struct apr_file_t apr_file_t; * APR_BUFFERED buffer the data. Default is non-buffered * APR_EXCL return error if APR_CREATE and file exists * APR_DELONCLOSE delete the file after closing. + * APR_XTHREAD Platform dependent tag to open the file + * for use across multiple threads + * APR_SHARELOCK Platform dependent support for higher + * level locked read/write access to support + * writes across process/machines *
    * @param perm Access permissions for file. * @param cont The pool to use. @@ -549,6 +554,14 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, */ APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset); +/** + * Retrieve the flags that were passed into apr_file_open() + * when the file was opened. + * @return apr_int32_t the flags + * @deffunc apr_int32_t apr_file_flags_get(apr_file_t *f) + */ +APR_DECLARE(apr_int32_t) apr_file_flags_get(apr_file_t *f); + /** * Get the pool used by the file. * @return apr_pool_t the pool diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 2aff13e4058..cd3dd08485b 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -122,7 +122,7 @@ struct apr_file_t { apr_pool_t *cntxt; int filedes; char *fname; - int oflags; + apr_int32_t flags; int eof_hit; int pipe; apr_interval_time_t timeout; diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index e17dc564468..164651fd7c5 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -172,6 +172,7 @@ struct apr_file_t { BOOLEAN pipe; // Is this a pipe of a file? OVERLAPPED *pOverlapped; apr_interval_time_t timeout; + apr_int32_t flags; /* File specific info */ apr_finfo_t *finfo; From 2a493c0f60fd5f5d7ff6de6f4b0edc5ff1d3d6b0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 27 Jun 2001 19:44:26 +0000 Subject: [PATCH 1813/7878] Add the flags argument to apr_filepath_root, to allow finer control of canonicalization and os-native formatting. Renamed a bunch of local functions in the win32 implementation so it's clear they are not external. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61805 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 1 + file_io/win32/filepath.c | 99 +++++++++++++++++++++++----------------- include/apr_file_info.h | 24 +++++++--- 3 files changed, 76 insertions(+), 48 deletions(-) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 8d420926196..4573e20f433 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -94,6 +94,7 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p) APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, const char **inpath, + apr_int32_t flags, apr_pool_t *p) { if (**inpath == '/') diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 1c85593ca32..b23c4d120d3 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -93,8 +93,8 @@ static int is_fnchar(char ch) } -static apr_status_t apr_filepath_root_test(char *path, - apr_pool_t *p) +static apr_status_t filepath_root_test(char *path, + apr_pool_t *p) { apr_status_t rv; #if APR_HAS_UNICODE_FS @@ -150,9 +150,9 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, } -static apr_status_t apr_filepath_drive_get(char **rootpath, - char drive, - apr_pool_t *p) +static apr_status_t filepath_drive_get(char **rootpath, + char drive, + apr_pool_t *p) { char path[APR_PATH_MAX]; #if APR_HAS_UNICODE_FS @@ -197,7 +197,7 @@ static apr_status_t apr_filepath_drive_get(char **rootpath, } -static apr_status_t apr_filepath_root_case(char **rootpath, +static apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) { @@ -273,7 +273,9 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath, */ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, - const char **inpath, apr_pool_t *p) + const char **inpath, + apr_int32_t flags, + apr_pool_t *p) { const char *testpath = *inpath; const char *delim1; @@ -292,7 +294,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, /* given '//?/C: or //./C: let us try this * all over again from the drive designator */ - rv = apr_filepath_root(rootpath, &testpath, p); + rv = apr_filepath_root(rootpath, &testpath, flags, p); if (!rv || rv == APR_EINCOMPLETE) *inpath = testpath; return rv; @@ -341,6 +343,9 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, else newpath = apr_pstrndup(p, testpath, delim2 - testpath); + /* Win32 will argue about slashed in UNC paths, so use + * backslashes till we finish testing + */ newpath[0] = '\\'; newpath[1] = '\\'; newpath[delim1 - testpath] = '\\'; @@ -357,13 +362,14 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, * root this designation! */ newpath[delim2 - testpath] = '\\'; - rv = apr_filepath_root_test(newpath, p); - if (rv) - return rv; - rv = apr_filepath_root_case(&newpath, newpath, p); - if (rv) - return rv; - + if (flags & APR_FILEPATH_TRUENAME) { + rv = filepath_root_test(newpath, p); + if (rv) + return rv; + rv = filepath_root_case(&newpath, newpath, p); + if (rv) + return rv; + } /* If this root included the trailing / or \ designation * then lop off multiple trailing slashes */ @@ -401,10 +407,13 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, } /* Left with a path of '/', what drive are we asking about? - * The guess is left to the caller. */ - *rootpath = apr_pstrndup(p, testpath, 1); + // ?? if (flags & APR_FILEPATH_TRUENAME) *inpath = ++testpath; + newpath = apr_palloc(p, 2); + newpath[0] = ((flags & APR_FILEPATH_NATIVE) ? '\\' : '/'); + newpath[1] = '\0'; + *rootpath = newpath; return APR_EINCOMPLETE; } @@ -414,37 +423,37 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, apr_status_t rv; /* Validate that D:\ drive exists, test must be rooted * Note that posix/win32 insists a drive letter is upper case, - * so who are we to argue with a 'feature' we might exploit. + * so who are we to argue with a 'feature'. * It is a safe fold, since only A-Z is legal, and has no * side effects of legal mis-mapped non-us-ascii codes. */ - newpath = apr_palloc(p, 3); - newpath[0] = toupper(testpath[0]); + newpath = apr_palloc(p, 4); + newpath[0] = testpath[0]; newpath[1] = ':'; - newpath[2] = '\\'; + newpath[2] = ((flags & APR_FILEPATH_NATIVE) ? '\\' : '/'); newpath[3] = '\0'; - rv = apr_filepath_root_test(newpath, p); - if (rv) - return rv; - - /* Have full 'd:/' so replace our \ with the given root char + if (flags & APR_FILEPATH_TRUENAME) { + newpath[0] = toupper(newpath[0]); + rv = filepath_root_test(newpath, p); + if (rv) + return rv; + } + /* Just give back the root the user handed to us. */ - if (testpath[2] == '/' || testpath[2] == '\\') { - newpath[2] = testpath[2]; + if (testpath[2] != '/' && testpath[2] != '\\') { + newpath[2] = '\0'; *rootpath = newpath; - *inpath = testpath + 3; - while (**inpath == '/' || **inpath == '\\') - ++*inpath; - return APR_SUCCESS; + *inpath = testpath + 2; + return APR_EINCOMPLETE; } - /* Left with path of 'd:' from the cwd of this drive letter - * so truncate the root \ we added above; + /* strip off remaining slashes that designate the root. */ - newpath[2] = '\0'; + *inpath = testpath + 3; + while (**inpath == '/' || **inpath == '\\') + ++*inpath; *rootpath = newpath; - *inpath = testpath + 2; - return APR_EINCOMPLETE; + return APR_SUCCESS; } /* Nothing interesting */ @@ -479,7 +488,10 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, addtype = APR_ERELATIVE; } else { - addtype = apr_filepath_root(&addroot, &addpath, p); + /* This call _should_ test the path + */ + addtype = apr_filepath_root(&addroot, &addpath, + APR_FILEPATH_TRUENAME, p); if (addtype == APR_SUCCESS) { addtype = APR_EABSOLUTE; } @@ -538,7 +550,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, */ char *getpath; if (addtype == APR_EINCOMPLETE && addroot[1] == ':') - rv = apr_filepath_drive_get(&getpath, addroot[0], p); + rv = filepath_drive_get(&getpath, addroot[0], p); else rv = apr_filepath_get(&getpath, p); if (rv != APR_SUCCESS) @@ -547,7 +559,9 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } if (!baseroot) { - basetype = apr_filepath_root(&baseroot, &basepath, p); + /* This call should _not_ test the path + */ + basetype = apr_filepath_root(&baseroot, &basepath, 0, p); if (basetype == APR_SUCCESS) { basetype = APR_EABSOLUTE; } @@ -836,7 +850,10 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * and replace our path with the canonical UNC root path */ path[pathlen] = '\0'; - testtype = apr_filepath_root(&testroot, &testpath, p); + /* This call _should_ test the path + */ + testtype = apr_filepath_root(&testroot, &testpath, + APR_FILEPATH_TRUENAME, p); if (testtype == APR_SUCCESS) { rootlen = pathlen = (testpath - path); memcpy(path, testroot, pathlen); diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 7bdfecca6d0..dd876931614 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -262,7 +262,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, */ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); -/* apr_filepath flags +/* apr_filepath optional flags */ /* Cause apr_filepath_merge to fail if addpath is above rootpath */ @@ -287,7 +287,8 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); #define APR_FILEPATH_NATIVE 0x10 /* Resolve the true case of existing directories and file elements - * of addpath, and append a proper trailing slash if a directory + * of addpath, (resolving any aliases on Win32) and append a proper + * trailing slash if a directory */ #define APR_FILEPATH_TRUENAME 0x20 @@ -295,13 +296,21 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); * Extract the rootpath from the given filepath * @param rootpath the root file path returned with APR_SUCCESS or APR_EINCOMPLETE * @param filepath the pathname to parse for it's root component + * @param flags the desired rules to apply, from + *
    + *      APR_FILEPATH_NATIVE    Use native path seperators (e.g. '\' on Win32)
    + *      APR_FILEPATH_TRUENAME  Tests that the root exists, and makes it proper
    + * 
    * @param p the pool to allocate the new path string from * @deffunc apr_status_t apr_filepath_root(const char **rootpath, const char **inpath, apr_pool_t *p) - * @tip on return, filepath now points to the character following the root. - * In the simplest example, given a filepath of "/foo", returns the rootpath - * of "/" and filepath points at "foo". This is far more complex on other - * platforms, which even changes alternate format of rootpath to canonical - * form. The function returns APR_ERELATIVE if filepath isn't rooted (an + * @tip on return, filepath points to the first non-root character in the + * given filepath. In the simplest example, given a filepath of "/foo", + * returns the rootpath of "/" and filepath points at "foo". This is far + * more complex on other platforms, which will canonicalize the root form + * to a consistant format, given the APR_FILEPATH_TRUENAME flag, and also + * test for the validity of that root (e.g., that a drive d:/ or network + * share //machine/foovol/). + * The function returns APR_ERELATIVE if filepath isn't rooted (an * error), APR_EINCOMPLETE if the root path is ambigious (but potentially * legitimate, e.g. "/" on Windows is incomplete because it doesn't specify * the drive letter), or APR_EBADPATH if the root is simply invalid. @@ -309,6 +318,7 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); */ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, const char **filepath, + apr_int32_t flags, apr_pool_t *p); /** From e48f85641bdced5cc775d3f1649ed0333b57160b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 27 Jun 2001 22:07:24 +0000 Subject: [PATCH 1814/7878] More crufty stuff, yes, it was my bug, and no, this is really horked since we aren't distinguishing the size of the file backing the mmap from the size of the mmap'ed view. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61806 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/win32/mmap.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index cab53992d53..8a27618ee2b 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -126,11 +126,14 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, (*new)->pstart = (offset / memblock) * memblock; (*new)->psize = (apr_size_t)(offset % memblock) + size; (*new)->poffset = offset - (*new)->pstart; - offlo = (DWORD)(*new)->psize; - offhi = (DWORD)((*new)->psize << 32); + /* XXX: psize below should be the MAXIMUM size of the mmap object, + * (e.g. file size) not the size of the mapped region! + * Since apr doesn't seem to acknowledge the discrepancy (the mmap + * size/view/off concepts are pretty horked) this will have to wait. + */ (*new)->mhandle = CreateFileMapping(file->filehand, NULL, fmaccess, - offhi, offlo, NULL); + 0, (*new)->psize, NULL); if (!(*new)->mhandle || (*new)->mhandle == INVALID_HANDLE_VALUE) { *new = NULL; From 3fd468718562cbc55bc0dab25629b6be3ca1b7eb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 28 Jun 2001 00:28:06 +0000 Subject: [PATCH 1815/7878] Ugh... cd .. is not nice. Now this still needs a touch of work, but at least it's marginally better. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61807 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 1 - 1 file changed, 1 deletion(-) diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl index d8131fb448b..d7ca5bd1540 100644 --- a/build/fixwin32mak.pl +++ b/build/fixwin32mak.pl @@ -10,7 +10,6 @@ use IO::File; use File::Find; -chdir '..'; $root = cwd; # ignore our own direcory (allowing us to move into any parallel tree) $root =~ s|^.:(.*)/.*?$|cd "$1|; From 38499f4a12a34f84b59336258f0c8711c9a16db4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 28 Jun 2001 00:29:12 +0000 Subject: [PATCH 1816/7878] Refresh .mak files for tagging 2.0.19 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61808 13f79535-47bb-0310-9956-ffa450edef68 --- apr.mak | 198 +++++++++++++++++++++++++++++++++++++++++++++++++++ libapr.mak | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 398 insertions(+), 2 deletions(-) diff --git a/apr.mak b/apr.mak index 115cb5e3ad4..ed4e9ad1645 100644 --- a/apr.mak +++ b/apr.mak @@ -53,9 +53,13 @@ CLEAN : -@erase "$(INTDIR)\apr_md5.obj" -@erase "$(INTDIR)\apr_pools.obj" -@erase "$(INTDIR)\apr_signal.obj" + -@erase "$(INTDIR)\apr_sms.obj" + -@erase "$(INTDIR)\apr_sms_std.obj" + -@erase "$(INTDIR)\apr_sms_tracking.obj" -@erase "$(INTDIR)\apr_snprintf.obj" -@erase "$(INTDIR)\apr_strings.obj" -@erase "$(INTDIR)\apr_strnatcmp.obj" + -@erase "$(INTDIR)\apr_strtok.obj" -@erase "$(INTDIR)\apr_tables.obj" -@erase "$(INTDIR)\common.obj" -@erase "$(INTDIR)\dir.obj" @@ -63,6 +67,7 @@ CLEAN : -@erase "$(INTDIR)\errorcodes.obj" -@erase "$(INTDIR)\fileacc.obj" -@erase "$(INTDIR)\filedup.obj" + -@erase "$(INTDIR)\filepath.obj" -@erase "$(INTDIR)\filestat.obj" -@erase "$(INTDIR)\flock.obj" -@erase "$(INTDIR)\fullrw.obj" @@ -76,6 +81,7 @@ CLEAN : -@erase "$(INTDIR)\mmap.obj" -@erase "$(INTDIR)\names.obj" -@erase "$(INTDIR)\open.obj" + -@erase "$(INTDIR)\otherchild.obj" -@erase "$(INTDIR)\pipe.obj" -@erase "$(INTDIR)\poll.obj" -@erase "$(INTDIR)\proc.obj" @@ -154,9 +160,13 @@ LIB32_OBJS= \ "$(INTDIR)\apr_md5.obj" \ "$(INTDIR)\apr_pools.obj" \ "$(INTDIR)\apr_signal.obj" \ + "$(INTDIR)\apr_sms.obj" \ + "$(INTDIR)\apr_sms_std.obj" \ + "$(INTDIR)\apr_sms_tracking.obj" \ "$(INTDIR)\apr_snprintf.obj" \ "$(INTDIR)\apr_strings.obj" \ "$(INTDIR)\apr_strnatcmp.obj" \ + "$(INTDIR)\apr_strtok.obj" \ "$(INTDIR)\apr_tables.obj" \ "$(INTDIR)\common.obj" \ "$(INTDIR)\dir.obj" \ @@ -164,6 +174,7 @@ LIB32_OBJS= \ "$(INTDIR)\errorcodes.obj" \ "$(INTDIR)\fileacc.obj" \ "$(INTDIR)\filedup.obj" \ + "$(INTDIR)\filepath.obj" \ "$(INTDIR)\filestat.obj" \ "$(INTDIR)\flock.obj" \ "$(INTDIR)\fullrw.obj" \ @@ -177,6 +188,7 @@ LIB32_OBJS= \ "$(INTDIR)\mmap.obj" \ "$(INTDIR)\names.obj" \ "$(INTDIR)\open.obj" \ + "$(INTDIR)\otherchild.obj" \ "$(INTDIR)\pipe.obj" \ "$(INTDIR)\poll.obj" \ "$(INTDIR)\proc.obj" \ @@ -231,9 +243,13 @@ CLEAN : -@erase "$(INTDIR)\apr_md5.obj" -@erase "$(INTDIR)\apr_pools.obj" -@erase "$(INTDIR)\apr_signal.obj" + -@erase "$(INTDIR)\apr_sms.obj" + -@erase "$(INTDIR)\apr_sms_std.obj" + -@erase "$(INTDIR)\apr_sms_tracking.obj" -@erase "$(INTDIR)\apr_snprintf.obj" -@erase "$(INTDIR)\apr_strings.obj" -@erase "$(INTDIR)\apr_strnatcmp.obj" + -@erase "$(INTDIR)\apr_strtok.obj" -@erase "$(INTDIR)\apr_tables.obj" -@erase "$(INTDIR)\common.obj" -@erase "$(INTDIR)\dir.obj" @@ -241,6 +257,7 @@ CLEAN : -@erase "$(INTDIR)\errorcodes.obj" -@erase "$(INTDIR)\fileacc.obj" -@erase "$(INTDIR)\filedup.obj" + -@erase "$(INTDIR)\filepath.obj" -@erase "$(INTDIR)\filestat.obj" -@erase "$(INTDIR)\flock.obj" -@erase "$(INTDIR)\fullrw.obj" @@ -254,6 +271,7 @@ CLEAN : -@erase "$(INTDIR)\mmap.obj" -@erase "$(INTDIR)\names.obj" -@erase "$(INTDIR)\open.obj" + -@erase "$(INTDIR)\otherchild.obj" -@erase "$(INTDIR)\pipe.obj" -@erase "$(INTDIR)\poll.obj" -@erase "$(INTDIR)\proc.obj" @@ -332,9 +350,13 @@ LIB32_OBJS= \ "$(INTDIR)\apr_md5.obj" \ "$(INTDIR)\apr_pools.obj" \ "$(INTDIR)\apr_signal.obj" \ + "$(INTDIR)\apr_sms.obj" \ + "$(INTDIR)\apr_sms_std.obj" \ + "$(INTDIR)\apr_sms_tracking.obj" \ "$(INTDIR)\apr_snprintf.obj" \ "$(INTDIR)\apr_strings.obj" \ "$(INTDIR)\apr_strnatcmp.obj" \ + "$(INTDIR)\apr_strtok.obj" \ "$(INTDIR)\apr_tables.obj" \ "$(INTDIR)\common.obj" \ "$(INTDIR)\dir.obj" \ @@ -342,6 +364,7 @@ LIB32_OBJS= \ "$(INTDIR)\errorcodes.obj" \ "$(INTDIR)\fileacc.obj" \ "$(INTDIR)\filedup.obj" \ + "$(INTDIR)\filepath.obj" \ "$(INTDIR)\filestat.obj" \ "$(INTDIR)\flock.obj" \ "$(INTDIR)\fullrw.obj" \ @@ -355,6 +378,7 @@ LIB32_OBJS= \ "$(INTDIR)\mmap.obj" \ "$(INTDIR)\names.obj" \ "$(INTDIR)\open.obj" \ + "$(INTDIR)\otherchild.obj" \ "$(INTDIR)\pipe.obj" \ "$(INTDIR)\poll.obj" \ "$(INTDIR)\proc.obj" \ @@ -504,6 +528,7 @@ SOURCE=.\strings\apr_strings.c DEP_CPP_APR_ST=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ ".\include\apr_strings.h"\ @@ -529,6 +554,20 @@ DEP_CPP_APR_STR=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\strings\apr_strtok.c +DEP_CPP_APR_STRT=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_want.h"\ + + +"$(INTDIR)\apr_strtok.obj" : $(SOURCE) $(DEP_CPP_APR_STRT) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\passwd\apr_getpass.c DEP_CPP_APR_G=\ ".\include\apr.h"\ @@ -603,7 +642,10 @@ DEP_CPP_ERROR=\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -621,12 +663,16 @@ DEP_CPP_ERROR=\ SOURCE=.\misc\unix\getopt.c DEP_CPP_GETOP=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -656,12 +702,16 @@ DEP_CPP_GETUU=\ SOURCE=.\misc\win32\misc.c DEP_CPP_MISC_=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -695,6 +745,37 @@ DEP_CPP_NAMES=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\misc\unix\otherchild.c +DEP_CPP_OTHER=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\threadproc.h"\ + + +"$(INTDIR)\otherchild.obj" : $(SOURCE) $(DEP_CPP_OTHER) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\misc\win32\rand.c DEP_CPP_RAND_=\ ".\include\apr.h"\ @@ -711,13 +792,16 @@ DEP_CPP_RAND_=\ SOURCE=.\misc\unix\start.c DEP_CPP_START=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_signal.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -779,13 +863,16 @@ DEP_CPP_DIR_C=\ SOURCE=.\file_io\unix\fileacc.c DEP_CPP_FILEA=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -807,13 +894,16 @@ DEP_CPP_FILEA=\ SOURCE=.\file_io\win32\filedup.c DEP_CPP_FILED=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -832,16 +922,50 @@ DEP_CPP_FILED=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\file_io\win32\filepath.c +DEP_CPP_FILEP=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + + +"$(INTDIR)\filepath.obj" : $(SOURCE) $(DEP_CPP_FILEP) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\file_io\win32\filestat.c DEP_CPP_FILES=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -864,13 +988,16 @@ DEP_CPP_FILES=\ SOURCE=.\file_io\win32\flock.c DEP_CPP_FLOCK=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -938,13 +1065,16 @@ DEP_CPP_OPEN_=\ SOURCE=.\file_io\win32\pipe.c DEP_CPP_PIPE_=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -965,6 +1095,7 @@ DEP_CPP_PIPE_=\ SOURCE=.\file_io\win32\readwrite.c DEP_CPP_READW=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ @@ -972,7 +1103,9 @@ DEP_CPP_READW=\ ".\include\apr_getopt.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -995,13 +1128,16 @@ DEP_CPP_READW=\ SOURCE=.\file_io\win32\seek.c DEP_CPP_SEEK_=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1035,6 +1171,7 @@ DEP_CPP_LOCKS=\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\locks.h"\ @@ -1110,6 +1247,7 @@ SOURCE=.\network_io\unix\sa_common.c SOURCE=.\network_io\win32\sendrecv.c DEP_CPP_SENDR=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ @@ -1119,6 +1257,7 @@ DEP_CPP_SENDR=\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1240,13 +1379,16 @@ DEP_CPP_PROC_=\ SOURCE=.\threadproc\win32\signals.c DEP_CPP_SIGNA=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1327,7 +1469,9 @@ DEP_CPP_DSO_C=\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1482,16 +1626,23 @@ DEP_CPP_USERI=\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ "$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\ @@ -1499,6 +1650,53 @@ DEP_CPP_USERI=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\memory\unix\apr_sms.c +DEP_CPP_APR_SM=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ + + +"$(INTDIR)\apr_sms.obj" : $(SOURCE) $(DEP_CPP_APR_SM) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\memory\unix\apr_sms_std.c +DEP_CPP_APR_SMS=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ + ".\include\arch\win32\apr_private.h"\ + + +"$(INTDIR)\apr_sms_std.obj" : $(SOURCE) $(DEP_CPP_APR_SMS) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\memory\unix\apr_sms_tracking.c +DEP_CPP_APR_SMS_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_sms_tracking.h"\ + ".\include\arch\win32\apr_private.h"\ + + +"$(INTDIR)\apr_sms_tracking.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\include\apr.hw !IF "$(CFG)" == "apr - Win32 Release" diff --git a/libapr.mak b/libapr.mak index cce02ed8bb2..8a3828a6aeb 100644 --- a/libapr.mak +++ b/libapr.mak @@ -53,9 +53,13 @@ CLEAN : -@erase "$(INTDIR)\apr_md5.obj" -@erase "$(INTDIR)\apr_pools.obj" -@erase "$(INTDIR)\apr_signal.obj" + -@erase "$(INTDIR)\apr_sms.obj" + -@erase "$(INTDIR)\apr_sms_std.obj" + -@erase "$(INTDIR)\apr_sms_tracking.obj" -@erase "$(INTDIR)\apr_snprintf.obj" -@erase "$(INTDIR)\apr_strings.obj" -@erase "$(INTDIR)\apr_strnatcmp.obj" + -@erase "$(INTDIR)\apr_strtok.obj" -@erase "$(INTDIR)\apr_tables.obj" -@erase "$(INTDIR)\common.obj" -@erase "$(INTDIR)\dir.obj" @@ -63,6 +67,7 @@ CLEAN : -@erase "$(INTDIR)\errorcodes.obj" -@erase "$(INTDIR)\fileacc.obj" -@erase "$(INTDIR)\filedup.obj" + -@erase "$(INTDIR)\filepath.obj" -@erase "$(INTDIR)\filestat.obj" -@erase "$(INTDIR)\flock.obj" -@erase "$(INTDIR)\fullrw.obj" @@ -76,6 +81,7 @@ CLEAN : -@erase "$(INTDIR)\mmap.obj" -@erase "$(INTDIR)\names.obj" -@erase "$(INTDIR)\open.obj" + -@erase "$(INTDIR)\otherchild.obj" -@erase "$(INTDIR)\pipe.obj" -@erase "$(INTDIR)\poll.obj" -@erase "$(INTDIR)\proc.obj" @@ -150,7 +156,7 @@ BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo\ - /base:"0x6EE0000" /subsystem:windows /dll /incremental:no\ + /base:"0x6EE00000" /subsystem:windows /dll /incremental:no\ /pdb:"$(OUTDIR)\libapr.pdb" /map:"$(INTDIR)\libapr.map" /machine:I386\ /out:"$(OUTDIR)\libapr.dll" /implib:"$(OUTDIR)\libapr.lib" /OPT:NOREF LINK32_OBJS= \ @@ -162,9 +168,13 @@ LINK32_OBJS= \ "$(INTDIR)\apr_md5.obj" \ "$(INTDIR)\apr_pools.obj" \ "$(INTDIR)\apr_signal.obj" \ + "$(INTDIR)\apr_sms.obj" \ + "$(INTDIR)\apr_sms_std.obj" \ + "$(INTDIR)\apr_sms_tracking.obj" \ "$(INTDIR)\apr_snprintf.obj" \ "$(INTDIR)\apr_strings.obj" \ "$(INTDIR)\apr_strnatcmp.obj" \ + "$(INTDIR)\apr_strtok.obj" \ "$(INTDIR)\apr_tables.obj" \ "$(INTDIR)\common.obj" \ "$(INTDIR)\dir.obj" \ @@ -172,6 +182,7 @@ LINK32_OBJS= \ "$(INTDIR)\errorcodes.obj" \ "$(INTDIR)\fileacc.obj" \ "$(INTDIR)\filedup.obj" \ + "$(INTDIR)\filepath.obj" \ "$(INTDIR)\filestat.obj" \ "$(INTDIR)\flock.obj" \ "$(INTDIR)\fullrw.obj" \ @@ -185,6 +196,7 @@ LINK32_OBJS= \ "$(INTDIR)\mmap.obj" \ "$(INTDIR)\names.obj" \ "$(INTDIR)\open.obj" \ + "$(INTDIR)\otherchild.obj" \ "$(INTDIR)\pipe.obj" \ "$(INTDIR)\poll.obj" \ "$(INTDIR)\proc.obj" \ @@ -239,9 +251,13 @@ CLEAN : -@erase "$(INTDIR)\apr_md5.obj" -@erase "$(INTDIR)\apr_pools.obj" -@erase "$(INTDIR)\apr_signal.obj" + -@erase "$(INTDIR)\apr_sms.obj" + -@erase "$(INTDIR)\apr_sms_std.obj" + -@erase "$(INTDIR)\apr_sms_tracking.obj" -@erase "$(INTDIR)\apr_snprintf.obj" -@erase "$(INTDIR)\apr_strings.obj" -@erase "$(INTDIR)\apr_strnatcmp.obj" + -@erase "$(INTDIR)\apr_strtok.obj" -@erase "$(INTDIR)\apr_tables.obj" -@erase "$(INTDIR)\common.obj" -@erase "$(INTDIR)\dir.obj" @@ -249,6 +265,7 @@ CLEAN : -@erase "$(INTDIR)\errorcodes.obj" -@erase "$(INTDIR)\fileacc.obj" -@erase "$(INTDIR)\filedup.obj" + -@erase "$(INTDIR)\filepath.obj" -@erase "$(INTDIR)\filestat.obj" -@erase "$(INTDIR)\flock.obj" -@erase "$(INTDIR)\fullrw.obj" @@ -262,6 +279,7 @@ CLEAN : -@erase "$(INTDIR)\mmap.obj" -@erase "$(INTDIR)\names.obj" -@erase "$(INTDIR)\open.obj" + -@erase "$(INTDIR)\otherchild.obj" -@erase "$(INTDIR)\pipe.obj" -@erase "$(INTDIR)\poll.obj" -@erase "$(INTDIR)\proc.obj" @@ -337,7 +355,7 @@ BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo\ - /base:"0x6EE0000" /subsystem:windows /dll /incremental:no\ + /base:"0x6EE00000" /subsystem:windows /dll /incremental:no\ /pdb:"$(OUTDIR)\libapr.pdb" /map:"$(INTDIR)\libapr.map" /debug /machine:I386\ /out:"$(OUTDIR)\libapr.dll" /implib:"$(OUTDIR)\libapr.lib" /OPT:NOREF LINK32_OBJS= \ @@ -349,9 +367,13 @@ LINK32_OBJS= \ "$(INTDIR)\apr_md5.obj" \ "$(INTDIR)\apr_pools.obj" \ "$(INTDIR)\apr_signal.obj" \ + "$(INTDIR)\apr_sms.obj" \ + "$(INTDIR)\apr_sms_std.obj" \ + "$(INTDIR)\apr_sms_tracking.obj" \ "$(INTDIR)\apr_snprintf.obj" \ "$(INTDIR)\apr_strings.obj" \ "$(INTDIR)\apr_strnatcmp.obj" \ + "$(INTDIR)\apr_strtok.obj" \ "$(INTDIR)\apr_tables.obj" \ "$(INTDIR)\common.obj" \ "$(INTDIR)\dir.obj" \ @@ -359,6 +381,7 @@ LINK32_OBJS= \ "$(INTDIR)\errorcodes.obj" \ "$(INTDIR)\fileacc.obj" \ "$(INTDIR)\filedup.obj" \ + "$(INTDIR)\filepath.obj" \ "$(INTDIR)\filestat.obj" \ "$(INTDIR)\flock.obj" \ "$(INTDIR)\fullrw.obj" \ @@ -372,6 +395,7 @@ LINK32_OBJS= \ "$(INTDIR)\mmap.obj" \ "$(INTDIR)\names.obj" \ "$(INTDIR)\open.obj" \ + "$(INTDIR)\otherchild.obj" \ "$(INTDIR)\pipe.obj" \ "$(INTDIR)\poll.obj" \ "$(INTDIR)\proc.obj" \ @@ -521,6 +545,7 @@ SOURCE=.\strings\apr_strings.c DEP_CPP_APR_ST=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ ".\include\apr_strings.h"\ @@ -546,6 +571,20 @@ DEP_CPP_APR_STR=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\strings\apr_strtok.c +DEP_CPP_APR_STRT=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_want.h"\ + + +"$(INTDIR)\apr_strtok.obj" : $(SOURCE) $(DEP_CPP_APR_STRT) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\passwd\apr_getpass.c DEP_CPP_APR_G=\ ".\include\apr.h"\ @@ -620,7 +659,10 @@ DEP_CPP_ERROR=\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -638,12 +680,16 @@ DEP_CPP_ERROR=\ SOURCE=.\misc\unix\getopt.c DEP_CPP_GETOP=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -673,12 +719,16 @@ DEP_CPP_GETUU=\ SOURCE=.\misc\win32\misc.c DEP_CPP_MISC_=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -712,6 +762,37 @@ DEP_CPP_NAMES=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\misc\unix\otherchild.c +DEP_CPP_OTHER=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\threadproc.h"\ + + +"$(INTDIR)\otherchild.obj" : $(SOURCE) $(DEP_CPP_OTHER) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\misc\win32\rand.c DEP_CPP_RAND_=\ ".\include\apr.h"\ @@ -728,13 +809,16 @@ DEP_CPP_RAND_=\ SOURCE=.\misc\unix\start.c DEP_CPP_START=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_signal.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -796,13 +880,16 @@ DEP_CPP_DIR_C=\ SOURCE=.\file_io\unix\fileacc.c DEP_CPP_FILEA=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -824,13 +911,16 @@ DEP_CPP_FILEA=\ SOURCE=.\file_io\win32\filedup.c DEP_CPP_FILED=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -849,16 +939,50 @@ DEP_CPP_FILED=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\file_io\win32\filepath.c +DEP_CPP_FILEP=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + + +"$(INTDIR)\filepath.obj" : $(SOURCE) $(DEP_CPP_FILEP) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\file_io\win32\filestat.c DEP_CPP_FILES=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -881,13 +1005,16 @@ DEP_CPP_FILES=\ SOURCE=.\file_io\win32\flock.c DEP_CPP_FLOCK=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -955,13 +1082,16 @@ DEP_CPP_OPEN_=\ SOURCE=.\file_io\win32\pipe.c DEP_CPP_PIPE_=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -982,6 +1112,7 @@ DEP_CPP_PIPE_=\ SOURCE=.\file_io\win32\readwrite.c DEP_CPP_READW=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ @@ -989,7 +1120,9 @@ DEP_CPP_READW=\ ".\include\apr_getopt.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1012,13 +1145,16 @@ DEP_CPP_READW=\ SOURCE=.\file_io\win32\seek.c DEP_CPP_SEEK_=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1052,6 +1188,7 @@ DEP_CPP_LOCKS=\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\locks.h"\ @@ -1127,6 +1264,7 @@ SOURCE=.\network_io\unix\sa_common.c SOURCE=.\network_io\win32\sendrecv.c DEP_CPP_SENDR=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ @@ -1136,6 +1274,7 @@ DEP_CPP_SENDR=\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1257,13 +1396,16 @@ DEP_CPP_PROC_=\ SOURCE=.\threadproc\win32\signals.c DEP_CPP_SIGNA=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1344,7 +1486,9 @@ DEP_CPP_DSO_C=\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1499,16 +1643,23 @@ DEP_CPP_USERI=\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ "$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\ @@ -1516,6 +1667,53 @@ DEP_CPP_USERI=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\memory\unix\apr_sms.c +DEP_CPP_APR_SM=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ + + +"$(INTDIR)\apr_sms.obj" : $(SOURCE) $(DEP_CPP_APR_SM) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\memory\unix\apr_sms_std.c +DEP_CPP_APR_SMS=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ + ".\include\arch\win32\apr_private.h"\ + + +"$(INTDIR)\apr_sms_std.obj" : $(SOURCE) $(DEP_CPP_APR_SMS) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\memory\unix\apr_sms_tracking.c +DEP_CPP_APR_SMS_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_sms_tracking.h"\ + ".\include\arch\win32\apr_private.h"\ + + +"$(INTDIR)\apr_sms_tracking.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\include\apr.hw !IF "$(CFG)" == "libapr - Win32 Release" From 0b247aa563d6af683f954465a3571723e9fe4cb3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 28 Jun 2001 01:17:44 +0000 Subject: [PATCH 1817/7878] Not here, nope. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61809 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr.hw b/include/apr.hw index 59be81439bf..7ea5ef732ea 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -146,6 +146,7 @@ #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 +#define APR_HAVE_SYS_TIME_H 0 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 0 #define APR_HAVE_SYS_WAIT_H 0 From f0a52df153bb000b756b6ac49abcb37399a65798 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Thu, 28 Jun 2001 01:32:37 +0000 Subject: [PATCH 1818/7878] apr_explode_localtime was not setting result's tm_usec field. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61810 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 1 + 1 file changed, 1 insertion(+) diff --git a/time/unix/time.c b/time/unix/time.c index bac3051394e..b1e1fde44e8 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -163,6 +163,7 @@ apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input mangotm = *localtime(&mango); #endif tm_to_exp(result, &mangotm, &mango); + result->tm_usec = input % APR_USEC_PER_SEC; return APR_SUCCESS; #endif /* __EMX__ */ } From d0fea350a71a07513f308d76c889ccc99b197411 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Thu, 28 Jun 2001 01:36:22 +0000 Subject: [PATCH 1819/7878] Added explode/implode test for local time, and use APR's printf format defines. Also added a missing call to exit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61811 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/test/testtime.c b/test/testtime.c index 76bb7249de0..3730d547d95 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -92,7 +92,7 @@ int main(void) exit(-1); } printf("OK\n"); - + printf("\tapr_explode_localtime..........................."); if (apr_explode_localtime(&xt2, now) != APR_SUCCESS) { printf("Couldn't explode the time\n"); @@ -110,14 +110,32 @@ int main(void) printf("\tchecking the explode/implode (GMT).............."); if (imp != now) { printf("mismatch\n" - "\tapr_now() %lld\n" - "\tapr_implode() returned %lld\n" - "\terror delta was %lld\n", + "\t\tapr_now() %" APR_INT64_T_FMT "\n" + "\t\tapr_implode() returned %" APR_INT64_T_FMT "\n" + "\t\terror delta was %" APR_TIME_T_FMT "\n" + "\t\tshould have been 0\n", now, imp, imp-now); exit(-1); } printf("OK\n"); + printf("\tchecking the explode/implode (local time)......."); + if (apr_implode_time(&imp, &xt2) != APR_SUCCESS) { + printf("Couldn't implode the time\n"); + exit(-1); + } + hr_off_64 = (apr_int64_t)xt2.tm_gmtoff * APR_USEC_PER_SEC; /* microseconds */ + if (imp != now + hr_off_64) { + printf("mismatch\n" + "\t\tapr_now() %" APR_INT64_T_FMT "\n" + "\t\tapr_implode() returned %" APR_INT64_T_FMT "\n" + "\t\terror delta was %" APR_TIME_T_FMT "\n" + "\t\tshould have been %" APR_INT64_T_FMT "\n", + now, imp, imp-now, hr_off_64); + exit(-1); + } + printf("OK\n"); + str = apr_pcalloc(p, sizeof(char) * STR_SIZE); str2 = apr_pcalloc(p, sizeof(char) * STR_SIZE); imp = 0; @@ -171,7 +189,8 @@ int main(void) printf("\tComparing the created times....................."); if (! strcmp(str,str2)){ - printf("Failed\n"); + printf("Failed!\n"); + exit(-1); } else { printf("OK\n"); } @@ -180,9 +199,12 @@ int main(void) apr_implode_time(&imp, &xt2); hr_off_64 = (apr_int64_t)hr_off * APR_USEC_PER_SEC; /* microseconds */ if (imp != now + hr_off_64){ - printf("Failed! :(\n"); - printf("Difference is %" APR_TIME_T_FMT " (should be %" - APR_INT64_T_FMT ")\n", imp - now, hr_off_64); + printf("mismatch\n" + "\t\tapr_now() %" APR_INT64_T_FMT "\n" + "\t\tapr_implode() returned %" APR_INT64_T_FMT "\n" + "\t\terror delta was %" APR_TIME_T_FMT "\n" + "\t\tshould have been %" APR_INT64_T_FMT "\n", + now, imp, imp-now, hr_off_64); exit(-1); } printf("OK\n"); From 6ba75e9a80941949855a6060c1bd3c4c19a3b377 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 28 Jun 2001 01:57:02 +0000 Subject: [PATCH 1820/7878] We don't have apr_lock_create_np() on OS/2, override the test that thinks it might due to having a working flock. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61812 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.in b/configure.in index 9ade3aa5f81..b1dbce5fd4d 100644 --- a/configure.in +++ b/configure.in @@ -988,6 +988,14 @@ else lockcreatenp="1" fi +case "$OS" in + *-os2*) + # The above tests detect a working flock on OS/2 + # but we don't want to use it when we have native locks + lockcreatenp="0" + ;; +esac + AC_SUBST(hasflockser) AC_SUBST(hassysvser) AC_SUBST(hasfcntlser) From ad7ffea252d39df8ed6d079129f715d9cdfd6ab4 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Thu, 28 Jun 2001 02:17:36 +0000 Subject: [PATCH 1821/7878] Cleaned up the code a bit and refactored common functionality. (set_xt_gmtoff_from_tm): Check APR_HAS_THREADS and _POSIX_THREAD_SAFE_FUNCTIIONS, like elsewhere. (explode_time): New function. Contans most of the logic that was previowsly in tm_to_exp, apr_explode_time and apr_explode_localtime. (apr_explode_time and, apr_explode_localtime): Call explode_time. (tm_to_exp): Removed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61813 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 66 +++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/time/unix/time.c b/time/unix/time.c index b1e1fde44e8..94a394eba52 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -95,7 +95,7 @@ static void set_xt_gmtoff_from_tm(apr_exploded_time_t *xt, struct tm *tm, { struct tm t; int days = 0, hours = 0, minutes = 0; -#ifdef HAVE_GMTIME_R +#if APR_HAS_THREADS && defined (_POSIX_THREAD_SAFE_FUNCTIONS) gmtime_r(tt, &t); #else t = *gmtime(tt); @@ -109,35 +109,41 @@ static void set_xt_gmtoff_from_tm(apr_exploded_time_t *xt, struct tm *tm, #endif } -static void tm_to_exp(apr_exploded_time_t *xt, struct tm *tm, time_t *tt) +static void explode_time(apr_exploded_time_t *xt, apr_time_t t, + apr_int32_t offset, int use_localtime) { - xt->tm_sec = tm->tm_sec; - xt->tm_min = tm->tm_min; - xt->tm_hour = tm->tm_hour; - xt->tm_mday = tm->tm_mday; - xt->tm_mon = tm->tm_mon; - xt->tm_year = tm->tm_year; - xt->tm_wday = tm->tm_wday; - xt->tm_yday = tm->tm_yday; - xt->tm_isdst = tm->tm_isdst; - set_xt_gmtoff_from_tm(xt,tm,tt); + struct tm tm; + time_t tt = (t / APR_USEC_PER_SEC) + offset; + xt->tm_usec = t % APR_USEC_PER_SEC; + +#if APR_HAS_THREADS && defined (_POSIX_THREAD_SAFE_FUNCTIONS) + if (use_localtime) + localtime_r(&tt, &tm); + else + gmtime_r(&tt, &tm); +#else + if (use_localtime) + tm = *localtime(&tt); + else + tm = *gmtime(&tt); +#endif + + xt->tm_sec = tm.tm_sec; + xt->tm_min = tm.tm_min; + xt->tm_hour = tm.tm_hour; + xt->tm_mday = tm.tm_mday; + xt->tm_mon = tm.tm_mon; + xt->tm_year = tm.tm_year; + xt->tm_wday = tm.tm_wday; + xt->tm_yday = tm.tm_yday; + xt->tm_isdst = tm.tm_isdst; + set_xt_gmtoff_from_tm(xt,&tm,&tt); } apr_status_t apr_explode_time(apr_exploded_time_t *result, apr_time_t input, apr_int32_t offs) { - time_t t = (input / APR_USEC_PER_SEC) + offs; - result->tm_usec = input % APR_USEC_PER_SEC; - -#if APR_HAS_THREADS && defined (_POSIX_THREAD_SAFE_FUNCTIONS) - { - struct tm apple; - gmtime_r(&t, &apple); - tm_to_exp(result, &apple, &t); - } -#else - tm_to_exp(result, gmtime(&t), &t); -#endif + explode_time(result, input, offs, 0); result->tm_gmtoff = offs; return APR_SUCCESS; } @@ -153,17 +159,7 @@ apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input /* EMX gcc (OS/2) has a timezone global we can use */ return apr_explode_time(result, input, -timezone); #else - time_t mango = input / APR_USEC_PER_SEC; - -#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) - struct tm mangotm; - localtime_r(&mango, &mangotm); -#else /* !APR_HAS_THREADS */ - struct tm mangotm; - mangotm = *localtime(&mango); -#endif - tm_to_exp(result, &mangotm, &mango); - result->tm_usec = input % APR_USEC_PER_SEC; + explode_time(result, input, 0, 1); return APR_SUCCESS; #endif /* __EMX__ */ } From 0b2343ee141d39dda55ee806c629fad7448fb4ef Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 28 Jun 2001 04:03:19 +0000 Subject: [PATCH 1822/7878] Just my 2c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61814 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/STATUS b/STATUS index a61de115c46..b9db0f53df7 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/06/05 07:56:08 $] +Last modified at [$Date: 2001/06/28 04:03:19 $] Release: @@ -40,6 +40,11 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Build scripts do not recognise AIX 4.2.1 pthreads * Win32: Implement apr_shm_ functions + Status: rbb insists he has thoughts about splitting apr_shm_* + mechanisms to support muliple models (some sort of 'keyed' + schema as well as anonymous inheritable shmem), and has a + possible solution to the 'ask for 1MB, then ask for 4x256kb + bogosity, so we are waiting on this. * FirstBill says we need a new procattr, APR_CREATE_SUSPENDED (or something similar) to direct ap_create_process to create the @@ -149,13 +154,6 @@ Documentation that needs writing: Stuff waiting for code thawing after Beta 1: - * Implement APR_FINFO_ICASE/APR_FINFO_NAME for stat'ish calls. - Can wait till after b1, will be required to eliminate canonical - and add that functionallity in-line with directory_walk, which - is _not_ planned for 2.0b1, but immediately afterwards. It's - required to complete Apache/WinNT's Unicode schema as well. - Note: Will doesn't like his original APR_FINFO_ICASE definition. - * Identify and implement those protection bits that have general usefulness, perhaps hidden, generic read-only [immutable], effective current user permissions, etc. From 5e0b14e836d0e6e9e938643fba430dab379b667b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 28 Jun 2001 05:08:50 +0000 Subject: [PATCH 1823/7878] Fix up some recent additions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61815 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_errno.h b/include/apr_errno.h index cdca159e95b..ac8f7db87ba 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -685,6 +685,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ || (s) == APR_OS_START_SYSERR + WSAENETUNREACH) +#define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \ || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE) @@ -750,6 +751,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH) #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH) #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) +#define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE) #endif /* !def OS2 || WIN32 */ From 2de3aee769a53fad4ffd349266b9625621695811 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 28 Jun 2001 05:14:28 +0000 Subject: [PATCH 1824/7878] "I'm mad as hell and I'm not going to take it anymore." The threading and pool stuff just don't mix. If we ever plan on getting Apache 2.0 to work WELL with threading, this needs to be addressed. The most likely way to address this is via SMS. I need to play more with SMS to determine how close this is to being ready for prime-time. I may need to clean up SMS first. Expect this to be my focus once I get freed up at my day job. (Hopefully, end of this week...) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61817 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index b9db0f53df7..30674a83e66 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/06/28 04:03:19 $] +Last modified at [$Date: 2001/06/28 05:14:28 $] Release: @@ -147,6 +147,23 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: add testmem to the test build at that point. - add more detailed tests to testmem.c + * In line with the new SMS code is the fact that threading and pools + just are not working together well. This is due to the fact that + the pool code has one global mutex (alloc_mutex) and one freelist + (block_freelist) for all pools to share. This means that only + one worker can be allocating memory at any given time. This is + probably the reason why Apache 2.0 is faster with prefork MPM + (thread-disabled APR) than threaded MPM. The solution to this + is most likely to incorporate a rework of the pools to use the new + SMS code and allow certain pools (i.e. request pools in httpd-2.0) + to have an option for no locking (as they can't have contention + by definition). This would mean that the mutex and freelist + must be moved inside of apr_pool_t. Therefore, this is the + jumping-off point into SMS. Short-term, it is *possible* that + ALLOC_USE_MALLOC would be faster than the current pool code for + a threaded APR (but, I'm not sure). + Status: Justin volunteers + Documentation that needs writing: * API documentation From 1014c432f18ad80972fab0b615f487aa7f5fa145 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 28 Jun 2001 05:35:23 +0000 Subject: [PATCH 1825/7878] Hmmm... quite a menu on win32 for EFTYPE-style errors. I'd expect OS2 offers something similar. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61818 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index ac8f7db87ba..8e02c79fbae 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -685,7 +685,14 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ || (s) == APR_OS_START_SYSERR + WSAENETUNREACH) -#define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) +#define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE \ + || (s) == APR_OS_START_SYSERR + ERROR_EXE_MACHINE_TYPE_MISMATCH \ + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DLL \ + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_MODULETYPE \ + || (s) == APR_OS_START_SYSERR + ERROR_BAD_EXE_FORMAT \ + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_EXE_SIGNATURE \ + || (s) == APR_OS_START_SYSERR + ERROR_FILE_CORRUPT \ + || (s) == APR_OS_START_SYSERR + ERROR_BAD_FORMAT) #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \ || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE) From 974d7334e6629e3bc94d235441031f8a86f0bcac Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 28 Jun 2001 05:38:01 +0000 Subject: [PATCH 1826/7878] Another Win32 ESPIPE style error git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61819 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr_errno.h b/include/apr_errno.h index 8e02c79fbae..b873be6ce5a 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -662,6 +662,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION) #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ + || (s) == APR_OS_START_SYSERR + ERROR_SEEK_ON_DEVICE) || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \ From 45b5a12a556cc95471a3aba5346e2279c86be30d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 28 Jun 2001 05:38:38 +0000 Subject: [PATCH 1827/7878] Whoops. Try compiling, otherbill. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61820 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index b873be6ce5a..82b1a03f369 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -662,7 +662,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION) #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ - || (s) == APR_OS_START_SYSERR + ERROR_SEEK_ON_DEVICE) + || (s) == APR_OS_START_SYSERR + ERROR_SEEK_ON_DEVICE \ || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \ From 87ef8d82455e69be838bd70ae63ff68beb7d509a Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 28 Jun 2001 13:56:37 +0000 Subject: [PATCH 1828/7878] Add a standard test macro for testing a function's return value using an APR_STATUS_IS_* macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61821 13f79535-47bb-0310-9956-ffa450edef68 --- test/test_apr.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test_apr.h b/test/test_apr.h index cfe4f6cf98c..717b5514f9a 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -97,6 +97,20 @@ printf("%s\n", good); \ } +#define TEST_STATUS(str, func, testmacro, good, bad) \ + printf("%-60s", str); \ + { \ + apr_status_t rv = func; \ + if (!testmacro(rv)) { \ + char errmsg[200]; \ + printf("%s\n", bad); \ + fprintf(stderr, "Error was %d : %s\n", rv, \ + apr_strerror(rv, (char*)&errmsg, 200)); \ + exit(-1); \ + } \ + printf("%s\n", good); \ + } + #define STD_TEST_NEQ(str, func) \ TEST_NEQ(str, func, APR_SUCCESS, "OK", "Failed"); From 2458bf9485c98533065d0716c98cd1597a95f0c1 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 28 Jun 2001 14:05:20 +0000 Subject: [PATCH 1829/7878] Make testdir more portable - On anything not unix, a file must be closed before it can be deleted - Use APR_STATUS_IS_ENOENT to test for ENOENT. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61822 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdir.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/testdir.c b/test/testdir.c index e20c219d271..fb6ae7a780b 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -93,6 +93,8 @@ int main(void) apr_file_open(&thefile, "dir1/file1", APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, pool)) + STD_TEST_NEQ(" Closing dir1/file1", + apr_file_close(thefile)) /* Try to remove dir1. This should fail because it's not empty. However, on a platform with threads disabled (such as FreeBSD), @@ -112,9 +114,9 @@ int main(void) underlying system readdir() returns NULL, the old value of errno shouldn't cause a false alarm. We should get an ENOENT back from apr_dir_read, and *not* the old errno. */ - TEST_NEQ(" get ENOENT on 3rd read", - apr_dir_read(&finfo, finfo_flags, this_dir), - APR_ENOENT, "OK", "Failed") + TEST_STATUS(" get ENOENT on 3rd read", + apr_dir_read(&finfo, finfo_flags, this_dir), + APR_STATUS_IS_ENOENT, "OK", "Failed") /* Cleanup */ STD_TEST_NEQ(" Cleanup file1", From e0149f2f7c96b32598282b2bd8174f41932a14fa Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 29 Jun 2001 08:00:48 +0000 Subject: [PATCH 1830/7878] "When you moan and whine, lots of things magically appear before your eyes." git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61823 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 30674a83e66..e45ba27f4da 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/06/28 05:14:28 $] +Last modified at [$Date: 2001/06/29 08:00:48 $] Release: @@ -163,6 +163,17 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: ALLOC_USE_MALLOC would be faster than the current pool code for a threaded APR (but, I'm not sure). Status: Justin volunteers + David and Sander are working on some stuff that + should be ready Real Soon Now (TM). Sander has + posted a "trivial" SMS (what a bad name) - see: + + which uses the same memory management as the current + pool implementation (freelist that allocates any size). + David is finishing up prototyping a replacement for + apr_pool_t that is defined as an SMS (I believe it is + API-compatible). Not ready for prime-time, but ready + for us to start working out the kinks and actually + starting to use SMS. Documentation that needs writing: From 79664a36e879b302f56d2be6b79881c961032f75 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 29 Jun 2001 08:23:15 +0000 Subject: [PATCH 1831/7878] Update the time code to make it clearer what's going on and to correctly set the gmtoffset when we have it. Add a comment to try and it more obvious what's going on following discussion on the list. Update the time test to be more obvious and use the new test functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61824 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 148 ++++++++++++++--------------------------------- time/unix/time.c | 64 ++++++++++---------- 2 files changed, 79 insertions(+), 133 deletions(-) diff --git a/test/testtime.c b/test/testtime.c index 3730d547d95..2bac3f3b22d 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -58,9 +58,7 @@ #include "apr_lib.h" #include #include -#ifdef BEOS -#include -#endif +#include "test_apr.h" #define STR_SIZE 45 @@ -75,39 +73,21 @@ int main(void) apr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */ apr_int64_t hr_off_64; - fprintf(stdout, "Testing Time functions.\n"); + printf("APR Time Functions\n==================\n\n"); - if (apr_pool_create(&p, NULL) != APR_SUCCESS){ - printf("Failed to create a context!\n"); - exit (-1); - } + STD_TEST_NEQ("Creating a pool to use", apr_pool_create(&p, NULL)) - printf("\tapr_time_now...................................."); + printf("%-60s", " apr_time_now()"); now = apr_time_now(); printf("OK\n"); - printf("\tapr_explode_gmt................................."); - if (apr_explode_gmt(&xt, now) != APR_SUCCESS) { - printf("Couldn't explode the time\n"); - exit(-1); - } - printf("OK\n"); + STD_TEST_NEQ(" apr_explode_gmt", apr_explode_gmt(&xt, now)) + + STD_TEST_NEQ(" apr_explode_localtime", apr_explode_localtime(&xt2, now)) - printf("\tapr_explode_localtime..........................."); - if (apr_explode_localtime(&xt2, now) != APR_SUCCESS) { - printf("Couldn't explode the time\n"); - exit(-1); - } - printf("OK\n"); + STD_TEST_NEQ(" apr_implode_time (GMT)", apr_implode_time(&imp, &xt)) - printf("\tapr_implode_time................................"); - if (apr_implode_time(&imp, &xt) != APR_SUCCESS) { - printf("Couldn't implode the time\n"); - exit(-1); - } - printf("OK\n"); - - printf("\tchecking the explode/implode (GMT).............."); + printf("%-60s", " checking GMT explode == implode"); if (imp != now) { printf("mismatch\n" "\t\tapr_now() %" APR_INT64_T_FMT "\n" @@ -119,96 +99,56 @@ int main(void) } printf("OK\n"); - printf("\tchecking the explode/implode (local time)......."); - if (apr_implode_time(&imp, &xt2) != APR_SUCCESS) { - printf("Couldn't implode the time\n"); - exit(-1); - } - hr_off_64 = (apr_int64_t)xt2.tm_gmtoff * APR_USEC_PER_SEC; /* microseconds */ - if (imp != now + hr_off_64) { - printf("mismatch\n" - "\t\tapr_now() %" APR_INT64_T_FMT "\n" - "\t\tapr_implode() returned %" APR_INT64_T_FMT "\n" - "\t\terror delta was %" APR_TIME_T_FMT "\n" - "\t\tshould have been %" APR_INT64_T_FMT "\n", - now, imp, imp-now, hr_off_64); - exit(-1); - } - printf("OK\n"); - str = apr_pcalloc(p, sizeof(char) * STR_SIZE); str2 = apr_pcalloc(p, sizeof(char) * STR_SIZE); imp = 0; - printf("\tapr_rfc822_date................."); - if (apr_rfc822_date(str, now) != APR_SUCCESS){ - printf("Failed!\n"); - exit (-1); - } - printf("%s\n", str); - - printf("\tapr_ctime.......(local)........."); - if (apr_ctime(str, now) != APR_SUCCESS){ - printf("Failed!\n"); + if (!str || !str2) { + printf("Failure!\n"); + fprintf(stderr,"Failed to allocate memory!\n"); exit(-1); } - printf("%s\n", str); - - printf("\tapr_strftime...................."); - if (str == NULL){ - printf("Couldn't allocate memory.\n"); - exit (-1); - } - if (apr_strftime(str, &sz, STR_SIZE, "%R %A %d %B %Y", &xt) != - APR_SUCCESS){ - printf("Failed!"); - exit (-1); - } - printf("%s\n", str); - printf("\tCurrent time (GMT).............................."); - if (apr_strftime(str, &sz, STR_SIZE, "%T ", &xt) != APR_SUCCESS){ - printf("Failed!\n"); - exit (-1); - } - printf ("%s\n", str); + STD_TEST_NEQ(" apr_rfc822_date", apr_rfc822_date(str, now)) + printf(" ( %s )\n", str); - printf("\tTrying to explode time with 5 hour offset......."); - if (apr_explode_time(&xt2, now, hr_off) != APR_SUCCESS){ - printf("Failed.\n"); - exit(-1); - } - printf("OK\n"); + STD_TEST_NEQ(" apr_ctime (local time)", apr_ctime(str, now)) + printf(" ( %s )\n", str); - printf("\tOffset Time Zone -5 hours......................."); - if (apr_strftime(str2, &sz, STR_SIZE, "%T (%z)", &xt2) != APR_SUCCESS){ - printf("Failed!\n"); - exit(-1); - } - printf("%s\n", str2); + STD_TEST_NEQ(" apr_strftime (GMT) (24H day date month year)", + apr_strftime(str, &sz, STR_SIZE, "%R %A %d %B %Y", &xt)) + printf(" ( %s )\n", str); - printf("\tComparing the created times....................."); - if (! strcmp(str,str2)){ - printf("Failed!\n"); - exit(-1); - } else { - printf("OK\n"); - } + STD_TEST_NEQ(" apr_strftime (GMT) (HH:MM:SS)", + apr_strftime(str, &sz, STR_SIZE, "%T", &xt)) + printf (" ( %s )\n", str); + + STD_TEST_NEQ(" apr_explode_time (GMT -5 hours)", + apr_explode_time(&xt2, now, hr_off)) + + STD_TEST_NEQ(" apr_strftime (offset) (HH:MM:SS)", + apr_strftime(str2, &sz, STR_SIZE, "%T", &xt2)) + printf(" ( %s )\n", str2); + + TEST_EQ(" Comparing the GMT and offset time strings", + strcmp(str, str2), 0, "OK", "Failed") + printf(" ( %s != %s )\n", str, str2); - printf("\tChecking imploded time after offset............."); - apr_implode_time(&imp, &xt2); - hr_off_64 = (apr_int64_t)hr_off * APR_USEC_PER_SEC; /* microseconds */ + STD_TEST_NEQ(" apr_implode_time (offset)", + apr_implode_time(&imp, &xt2)) + + hr_off_64 = (apr_int64_t) hr_off * APR_USEC_PER_SEC; /* microseconds */ + printf("%-60s"," Checking offset is correct"); if (imp != now + hr_off_64){ - printf("mismatch\n" - "\t\tapr_now() %" APR_INT64_T_FMT "\n" - "\t\tapr_implode() returned %" APR_INT64_T_FMT "\n" - "\t\terror delta was %" APR_TIME_T_FMT "\n" - "\t\tshould have been %" APR_INT64_T_FMT "\n", - now, imp, imp-now, hr_off_64); + printf("Failed! :(\n"); + printf("Difference is %" APR_INT64_T_FMT " (should be %" + APR_INT64_T_FMT")\n", imp - now, hr_off_64); exit(-1); } printf("OK\n"); - + printf(" ( %lld - %lld = %lld )\n", imp, now, imp - now); + + printf("\nTest Complete.\n"); return 1; } diff --git a/time/unix/time.c b/time/unix/time.c index 94a394eba52..4763665d436 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -57,6 +57,7 @@ #include "apr_lib.h" #include "apr_private.h" #include "apr_strings.h" + /* System Headers required for time library */ #if APR_HAVE_SYS_TIME_H #include @@ -69,6 +70,28 @@ #endif /* End System Headers */ +static apr_int32_t get_offset(struct tm *tm) +{ +#ifdef HAVE_GMTOFF + return tm->tm_gmtoff; +#elif defined(HAVE___OFFSET) + return tm->__tm_gmtoff; +#else + /* we don't have an offset field to use, so calculate it */ + { + time_t t1 = time(0), t2 = 0; + struct tm t; + +# if APR_HAS_THREADS && defined (_POSIX_THREAD_SAFE_FUNCTIONS) + gmtime_r(tt, &t); +# else + t = *gmtime(tt); +# endif + t2 = mktime(&t); + return (apr_int32_t) difftime(t1,t2); + } +#endif +} apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input) { @@ -76,7 +99,7 @@ apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input) return APR_SUCCESS; } - +/* NB NB NB NB This returns GMT!!!!!!!!!! */ apr_time_t apr_time_now(void) { struct timeval tv; @@ -84,31 +107,6 @@ apr_time_t apr_time_now(void) return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec; } -static void set_xt_gmtoff_from_tm(apr_exploded_time_t *xt, struct tm *tm, - time_t *tt) -{ -#ifdef HAVE_GMTOFF - xt->tm_gmtoff = tm->tm_gmtoff; -#elif defined(HAVE___OFFSET) - xt->tm_gmtoff = tm->__tm_gmtoff; -#else - { - struct tm t; - int days = 0, hours = 0, minutes = 0; -#if APR_HAS_THREADS && defined (_POSIX_THREAD_SAFE_FUNCTIONS) - gmtime_r(tt, &t); -#else - t = *gmtime(tt); -#endif - days = xt->tm_yday - t.tm_yday; - hours = ((days < -1 ? 24 : 1 < days ? -24 : days * 24) + - xt->tm_hour - t.tm_hour); - minutes = hours * 60 + xt->tm_min - t.tm_min; - xt->tm_gmtoff = minutes * 60; - } -#endif -} - static void explode_time(apr_exploded_time_t *xt, apr_time_t t, apr_int32_t offset, int use_localtime) { @@ -137,7 +135,7 @@ static void explode_time(apr_exploded_time_t *xt, apr_time_t t, xt->tm_wday = tm.tm_wday; xt->tm_yday = tm.tm_yday; xt->tm_isdst = tm.tm_isdst; - set_xt_gmtoff_from_tm(xt,&tm,&tt); + xt->tm_gmtoff = get_offset(&tm); } apr_status_t apr_explode_time(apr_exploded_time_t *result, apr_time_t input, @@ -214,7 +212,11 @@ apr_status_t apr_os_exp_time_get(apr_os_exp_time_t **ostime, (*ostime)->tm_wday = aprtime->tm_wday; (*ostime)->tm_yday = aprtime->tm_yday; (*ostime)->tm_isdst = aprtime->tm_isdst; - /* XXX - Need to handle gmt_offset's here ! */ +#if HAVE_GMTOFF + (*ostime)->tm_gmtoff = aprtime->tm_gmtoff; +#else if defined(HAVE__OFFSET) + (*ostime)->__tm_gmtoff = aprtime->tm_gmtoff; +#endif return APR_SUCCESS; } @@ -237,7 +239,11 @@ apr_status_t apr_os_exp_time_put(apr_exploded_time_t *aprtime, aprtime->tm_wday = (*ostime)->tm_wday; aprtime->tm_yday = (*ostime)->tm_yday; aprtime->tm_isdst = (*ostime)->tm_isdst; - /* XXX - Need to handle gmt_offsets here */ +#if HAVE_GMTOFF + aprtime->tm_gmtoff = (*ostime)->tm_gmtoff; +#else if defined(HAVE__OFFSET) + aprtime->tm_gmtoff = (*ostime)->__tm_gmtoff; +#endif return APR_SUCCESS; } From e6706f581be63c709f3548ff7d29bbcfc61ed319 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 29 Jun 2001 08:51:30 +0000 Subject: [PATCH 1832/7878] Include the pools header. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61825 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/locks.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h index 31ddb7f184a..26f1f03e50c 100644 --- a/include/arch/beos/locks.h +++ b/include/arch/beos/locks.h @@ -56,6 +56,7 @@ #define LOCKS_H #include +#include "apr_pools.h" #include "apr_lock.h" #include "apr_file_io.h" #include "apr_general.h" From febaab963504eac327a7b4c18780ee7a096eb569 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 29 Jun 2001 09:01:41 +0000 Subject: [PATCH 1833/7878] struct apr_pool_t == apr_pool_t so change these parameters to reflect this... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61826 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index d8114a50da5..fcb2a446390 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -149,9 +149,9 @@ struct apr_table_entry_t { * @param nelts the number of elements in the initial array * @param elt_size The size of each element in the array. * @return The new array - * @deffunc apr_array_header_t *apr_array_make(struct apr_pool_t *p, int nelts, int elt_size) + * @deffunc apr_array_header_t *apr_array_make(apr_pool_t *p, int nelts, int elt_size) */ -APR_DECLARE(apr_array_header_t *) apr_array_make(struct apr_pool_t *p, +APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, int nelts, int elt_size); /** @@ -184,7 +184,7 @@ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, * for the elements to be copied if (and only if) the code subsequently does * a push or arraycat. */ -APR_DECLARE(apr_array_header_t *) apr_array_copy(struct apr_pool_t *p, +APR_DECLARE(apr_array_header_t *) apr_array_copy(apr_pool_t *p, const apr_array_header_t *arr); /** * Copy the headers of the array, and arrange for the elements to be copied if @@ -195,7 +195,7 @@ APR_DECLARE(apr_array_header_t *) apr_array_copy(struct apr_pool_t *p, * @deffunc apr_array_header_t *apr_array_copy_hdr(apr_pool_t *p, const apr_array_header_t *arr) * @tip The alternate apr_array_copy copies the *entire* array. */ -APR_DECLARE(apr_array_header_t *) apr_array_copy_hdr(struct apr_pool_t *p, +APR_DECLARE(apr_array_header_t *) apr_array_copy_hdr(apr_pool_t *p, const apr_array_header_t *arr); /** @@ -206,7 +206,7 @@ APR_DECLARE(apr_array_header_t *) apr_array_copy_hdr(struct apr_pool_t *p, * @param return A new array containing the data from the two arrays passed in. * @deffunc apr_array_header_t *apr_array_append(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second) */ -APR_DECLARE(apr_array_header_t *) apr_array_append(struct apr_pool_t *p, +APR_DECLARE(apr_array_header_t *) apr_array_append(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second); @@ -222,7 +222,7 @@ APR_DECLARE(apr_array_header_t *) apr_array_append(struct apr_pool_t *p, * @return A string containing all of the data in the array. * @deffunc char *apr_array_pstrcat(apr_pool_t *p, const apr_array_header_t *arr, const char sep) */ -APR_DECLARE(char *) apr_array_pstrcat(struct apr_pool_t *p, +APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, const apr_array_header_t *arr, const char sep); @@ -234,7 +234,7 @@ APR_DECLARE(char *) apr_array_pstrcat(struct apr_pool_t *p, * @warning This table can only store text data * @deffunc apr_table_t *apr_table_make(apr_pool_t *p, int nelts) */ -APR_DECLARE(apr_table_t *) apr_table_make(struct apr_pool_t *p, int nelts); +APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts); /** * Create a new table and copy another table into it @@ -243,7 +243,7 @@ APR_DECLARE(apr_table_t *) apr_table_make(struct apr_pool_t *p, int nelts); * @return A copy of the table passed in * @deffunc apr_table_t *apr_table_copy(apr_pool_t *p, const apr_table_t *t) */ -APR_DECLARE(apr_table_t *) apr_table_copy(struct apr_pool_t *p, +APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, const apr_table_t *t); /** @@ -357,9 +357,9 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, * @return A new table containing all of the data from the two passed in * @deffunc apr_table_t *apr_table_overlay(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); */ -APR_DECLARE(apr_table_t *) apr_table_overlay(struct apr_pool_t *p, - const apr_table_t *overlay, - const apr_table_t *base); +APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, + const apr_table_t *overlay, + const apr_table_t *base); /** * Iterate over a table running the provided function once for every From 07b6959c880830fdfb308999695fa2e25241f5e5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 29 Jun 2001 12:17:40 +0000 Subject: [PATCH 1834/7878] fix some compile breakage (on HP-UX, at least)... testtime is happy on HP-UX so hopefully the libc routines are called correctly git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61827 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/time/unix/time.c b/time/unix/time.c index 4763665d436..085c9aa8db4 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -82,13 +82,13 @@ static apr_int32_t get_offset(struct tm *tm) time_t t1 = time(0), t2 = 0; struct tm t; -# if APR_HAS_THREADS && defined (_POSIX_THREAD_SAFE_FUNCTIONS) - gmtime_r(tt, &t); -# else - t = *gmtime(tt); -# endif +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) + gmtime_r(&t1, &t); +#else + t = *gmtime(&t1); +#endif t2 = mktime(&t); - return (apr_int32_t) difftime(t1,t2); + return (apr_int32_t) difftime(t1, t2); } #endif } @@ -214,7 +214,7 @@ apr_status_t apr_os_exp_time_get(apr_os_exp_time_t **ostime, (*ostime)->tm_isdst = aprtime->tm_isdst; #if HAVE_GMTOFF (*ostime)->tm_gmtoff = aprtime->tm_gmtoff; -#else if defined(HAVE__OFFSET) +#elif defined(HAVE__OFFSET) (*ostime)->__tm_gmtoff = aprtime->tm_gmtoff; #endif return APR_SUCCESS; @@ -241,7 +241,7 @@ apr_status_t apr_os_exp_time_put(apr_exploded_time_t *aprtime, aprtime->tm_isdst = (*ostime)->tm_isdst; #if HAVE_GMTOFF aprtime->tm_gmtoff = (*ostime)->tm_gmtoff; -#else if defined(HAVE__OFFSET) +#elif defined(HAVE__OFFSET) aprtime->tm_gmtoff = (*ostime)->__tm_gmtoff; #endif return APR_SUCCESS; From e80ce75c0af00cb02f2051223254654ede2ff5bf Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 29 Jun 2001 16:07:32 +0000 Subject: [PATCH 1835/7878] Fix a bug in the cleanup code. Check for the APR_ALL_CLEANUPS instead of 0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61828 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index f25a3500cc4..48da02792b1 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -614,7 +614,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms, cleanup = sms->cleanups; cleanup_ref = &sms->cleanups; while (cleanup) { - if ((type == 0 || cleanup->type == type) && + if ((type == APR_ALL_CLEANUPS || cleanup->type == type) && cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) { *cleanup_ref = cleanup->next; @@ -623,6 +623,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms, if (sms->free_fn) apr_sms_free(sms, cleanup); + cleanup = *cleanup_ref; rv = APR_SUCCESS; } else { cleanup_ref = &cleanup->next; @@ -651,7 +652,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *sms, cleanup_ref = &sms->cleanups; sms = sms->accounting; while (cleanup) { - if (type == 0 || cleanup->type == type) { + if (type == APR_ALL_CLEANUPS || cleanup->type == type) { *cleanup_ref = cleanup->next; if (sms->free_fn) @@ -702,7 +703,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, cleanup_ref = &sms->cleanups; sms = sms->accounting; while (cleanup) { - if (type == 0 || cleanup->type == type) { + if (type == APR_ALL_CLEANUPS || cleanup->type == type) { *cleanup_ref = cleanup->next; cleanup->cleanup_fn(cleanup->data); From ecd6f732539336974e4fbbdc7eecee3c2965b5c1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 29 Jun 2001 17:53:35 +0000 Subject: [PATCH 1836/7878] slight cleanups to the Unix lock implementation... 1) apr_unix_lock_mech_t has a new flags field to indicate whether or not the particular mechanism is global (i.e., whether or not we need to add an additional intraprocess mutex to block out other threads in our process) this will help fixing our knowledge of whether or not a particular mechanism is global on a particular platform a proc_pthread lock is always global, so this change brings a slight performance improvement as we realize we don't need the intraprocess mutex too 2) apr_unix_lock_mech_t has new acquire_read and acquire_write fields; for now, this cleans up apr_lock_acquire_rw() and also makes it easy to add interprocess rw lock... ones based on flock() should take just a few lines of code to implement (but watch the complications for the lock create path since we need to sometimes use an intraprocess rw lock too :( ) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61829 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/locks.h | 6 +++++ locks/unix/crossproc.c | 24 ++++++++++++++++++++ locks/unix/intraproc.c | 18 +++++++++++++++ locks/unix/locks.c | 48 ++++++++++++--------------------------- 4 files changed, 63 insertions(+), 33 deletions(-) diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index 70b4476ddca..0005fd7c072 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -101,14 +101,20 @@ /* End System Headers */ struct apr_unix_lock_methods_t { + unsigned int flags; apr_status_t (*create)(apr_lock_t *, const char *); apr_status_t (*acquire)(apr_lock_t *); + apr_status_t (*acquire_read)(apr_lock_t *); + apr_status_t (*acquire_write)(apr_lock_t *); apr_status_t (*release)(apr_lock_t *); apr_status_t (*destroy)(apr_lock_t *); apr_status_t (*child_init)(apr_lock_t **, apr_pool_t *, const char *); }; typedef struct apr_unix_lock_methods_t apr_unix_lock_methods_t; +/* bit values for flags field in apr_unix_lock_methods_t */ +#define APR_PROCESS_LOCK_MECH_IS_GLOBAL 1 + #if APR_HAS_SYSVSEM_SERIALIZE extern const apr_unix_lock_methods_t apr_unix_sysv_methods; #endif diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 8e87ac88a11..a04a8e6810a 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -151,8 +151,15 @@ static apr_status_t sysv_child_init(apr_lock_t **lock, apr_pool_t *cont, const c const apr_unix_lock_methods_t apr_unix_sysv_methods = { +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS + APR_PROCESS_LOCK_MECH_IS_GLOBAL, +#else + 0, +#endif sysv_create, sysv_acquire, + NULL, /* no rw lock */ + NULL, /* no rw lock */ sysv_release, sysv_destroy, sysv_child_init @@ -285,8 +292,11 @@ static apr_status_t proc_pthread_child_init(apr_lock_t **lock, apr_pool_t *cont, const apr_unix_lock_methods_t apr_unix_proc_pthread_methods = { + APR_PROCESS_LOCK_MECH_IS_GLOBAL, proc_pthread_create, proc_pthread_acquire, + NULL, /* no rw lock */ + NULL, /* no rw lock */ proc_pthread_release, proc_pthread_destroy, proc_pthread_child_init @@ -394,8 +404,15 @@ static apr_status_t fcntl_child_init(apr_lock_t **lock, apr_pool_t *cont, const apr_unix_lock_methods_t apr_unix_fcntl_methods = { +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS + APR_PROCESS_LOCK_MECH_IS_GLOBAL, +#else + 0, +#endif fcntl_create, fcntl_acquire, + NULL, /* no rw lock */ + NULL, /* no rw lock */ fcntl_release, fcntl_destroy, fcntl_child_init @@ -502,8 +519,15 @@ static apr_status_t flock_child_init(apr_lock_t **lock, apr_pool_t *cont, const apr_unix_lock_methods_t apr_unix_flock_methods = { +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS + APR_PROCESS_LOCK_MECH_IS_GLOBAL, +#else + 0, +#endif flock_create, flock_acquire, + NULL, /* no rw lock */ + NULL, /* no rw lock */ flock_release, flock_destroy, flock_child_init diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index 216efc6b1bd..23e526367b9 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -153,8 +153,11 @@ static apr_status_t intra_destroy(apr_lock_t *lock) const apr_unix_lock_methods_t apr_unix_intra_methods = { + 0, intra_create, intra_acquire, + NULL, /* no read lock concept */ + NULL, /* no write lock concept */ intra_release, intra_destroy, NULL /* no child init */ @@ -168,6 +171,18 @@ static apr_status_t rwlock_create(apr_lock_t *new, const char *fname) return APR_SUCCESS; } +static apr_status_t rwlock_acquire_read(apr_lock_t *lock) +{ + /* XXX PTHREAD_SETS_ERRNO crap? */ + return pthread_rwlock_rdlock(&lock->rwlock); +} + +static apr_status_t rwlock_acquire_write(apr_lock_t *lock) +{ + /* XXX PTHREAD_SETS_ERRNO crap? */ + return pthread_rwlock_wrlock(&lock->rwlock); +} + static apr_status_t rwlock_release(apr_lock_t *lock) { /* XXX PTHREAD_SETS_ERRNO crap? */ @@ -182,8 +197,11 @@ static apr_status_t rwlock_destroy(apr_lock_t *lock) const apr_unix_lock_methods_t apr_unix_rwlock_methods = { + 0, rwlock_create, NULL, /* no standard acquire method; app better not call :) */ + rwlock_acquire_read, + rwlock_acquire_write, rwlock_release, rwlock_destroy, NULL /* no child init method */ diff --git a/locks/unix/locks.c b/locks/unix/locks.c index b500df7b618..257f452f513 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -56,7 +56,6 @@ #include "apr_strings.h" #include "apr_portable.h" -#if !APR_PROCESS_LOCK_IS_GLOBAL && APR_HAS_THREADS static apr_status_t lockall_create(apr_lock_t *new, const char *fname) { apr_status_t rv; @@ -118,13 +117,15 @@ static apr_status_t lockall_child_init(apr_lock_t **lock, apr_pool_t *pool, static const struct apr_unix_lock_methods_t lockall_methods = { + 0, lockall_create, lockall_acquire, + NULL, /* no read lock concept */ + NULL, /* no write lock concept */ lockall_release, lockall_destroy, lockall_child_init }; -#endif static apr_status_t choose_method(apr_lock_t *new, apr_lockmech_e_np mech) { @@ -207,15 +208,12 @@ static apr_status_t create_lock(apr_lock_t *new, apr_lockmech_e_np mech, const c switch (new->scope) { case APR_LOCKALL: -#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS - /* XXX but how do we know that this particular mechanism has this - * property? for now we assume all mechanisms on this system have - * the property - */ - new->meth = new->inter_meth; -#else - new->meth = &lockall_methods; -#endif + if (new->inter_meth->flags & APR_PROCESS_LOCK_MECH_IS_GLOBAL) { + new->meth = new->inter_meth; + } + else { + new->meth = &lockall_methods; + } break; case APR_CROSS_PROCESS: new->meth = new->inter_meth; @@ -283,30 +281,14 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock) apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) { - apr_status_t stat = APR_SUCCESS; - - switch (lock->type) + switch (e) { - case APR_MUTEX: - return APR_ENOTIMPL; - case APR_READWRITE: -#ifdef HAVE_PTHREAD_RWLOCK_INIT - switch (e) - { - case APR_READER: - stat = pthread_rwlock_rdlock(&lock->rwlock); - break; - case APR_WRITER: - stat = pthread_rwlock_wrlock(&lock->rwlock); - break; - } - break; -#else - return APR_ENOTIMPL; -#endif + case APR_READER: + return lock->meth->acquire_read(lock); + case APR_WRITER: + return lock->meth->acquire_write(lock); } - - return stat; + return APR_ENOTIMPL; } apr_status_t apr_lock_release(apr_lock_t *lock) From 31333edeff46f8ab2797e74edd71ccf9c65ab5f5 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 29 Jun 2001 18:29:43 +0000 Subject: [PATCH 1837/7878] We add another phase to the sms creation/initialisation that allows us to make calls that can/could use the sms and if we haven't finished initialising it, it'll segafult due to the lack of function pointers. This came up when trying to get pools running as sms :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61830 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 7 +++++++ memory/unix/apr_sms.c | 17 +++++++++++++---- memory/unix/apr_sms_blocks.c | 1 + memory/unix/apr_sms_std.c | 1 + memory/unix/apr_sms_tracking.c | 1 + 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index 731654566cb..a746577cfd4 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -185,6 +185,13 @@ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *sms, void *mem); APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, apr_sms_t *parent_sms); +/** + * Do post init work that needs the sms to have been fully + * initialised. + * @param sms The memory system to use + */ +APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms); + /** * Check if a memory system is obeying all rules. * @caution Call this function as the last statement before returning a new diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 48da02792b1..453daf9b850 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -227,13 +227,22 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, /* XXX - This should eventually be removed */ apr_pool_create(&sms->pool, pms ? pms->pool : NULL); - /* Create the lock we'll use to protect cleanups and child lists */ - apr_lock_create(&sms->sms_lock, APR_MUTEX, APR_LOCKALL, NULL, - sms->pool); - return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms) +{ + /* We do things here as these may potentially make calls + * to the sms that we're creating, and if we make the calls + * in the sms_init phase we haven't yet added the function + * pointers so we'll segfault! + */ + + /* Create the sms framework lock we'll use. */ + return apr_lock_create(&sms->sms_lock, APR_MUTEX, APR_LOCKALL, + NULL, sms->pool); +} + #ifdef APR_ASSERT_MEMORY APR_DECLARE(void) apr_sms_assert(apr_sms_t *sms) { diff --git a/memory/unix/apr_sms_blocks.c b/memory/unix/apr_sms_blocks.c index 9b5efb06dd0..69ecf517a71 100644 --- a/memory/unix/apr_sms_blocks.c +++ b/memory/unix/apr_sms_blocks.c @@ -273,6 +273,7 @@ APR_DECLARE(apr_status_t) apr_sms_blocks_create(apr_sms_t **sms, /* We are normally single threaded so no lock */ apr_sms_assert(new_sms); + apr_sms_post_init(new_sms); *sms = new_sms; return APR_SUCCESS; diff --git a/memory/unix/apr_sms_std.c b/memory/unix/apr_sms_std.c index 8af97715fe2..ac455267547 100644 --- a/memory/unix/apr_sms_std.c +++ b/memory/unix/apr_sms_std.c @@ -133,6 +133,7 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms) */ apr_sms_assert(new_sms); + apr_sms_post_init(new_sms); *sms = new_sms; return APR_SUCCESS; diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c index 9979b7451b1..1e8ad56f907 100644 --- a/memory/unix/apr_sms_tracking.c +++ b/memory/unix/apr_sms_tracking.c @@ -291,6 +291,7 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **sms, new_sms->pool); apr_sms_assert(new_sms); + apr_sms_post_init(new_sms); *sms = new_sms; return APR_SUCCESS; From eb2ba2824cf3139a44f904832a971dd98b8ba000 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sat, 30 Jun 2001 08:21:50 +0000 Subject: [PATCH 1838/7878] Replaced the APR_ALIGN macro with nicer one. Cleaned up some stray tab characters. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61831 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index a746577cfd4..8f29a250d76 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -60,8 +60,8 @@ * May 2001 */ -#ifndef APR_MEMORY_SYSTEM_H -#define APR_MEMORY_SYSTEM_H +#ifndef APR_SMS_H +#define APR_SMS_H #include "apr.h" #include "apr_errno.h" @@ -77,9 +77,13 @@ extern "C" { #define APR_CHILD_CLEANUP 0x0001 #define APR_PARENT_CLEANUP 0x0002 -/* Alignment macro's */ +/* Alignment macro's + * + * APR_ALIGN is only to be used to align on a power + * of two boundary + */ #define APR_ALIGN(size, boundary) \ - ((size) + (((boundary) - ((size) & ((boundary) - 1))) & ((boundary) - 1))) + (((size) + ((boundary) - 1)) & ~((boundary) - 1)) #define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) @@ -162,8 +166,7 @@ APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *sms, void *mem, apr_size_t size); * @param sms The memory system to use (should be the same as the * one that returned the block) * @param mem The block of memory to be freed - * @deffunc void apr_sms_free(apr_sms_t *sms, - * void *mem) + * @deffunc void apr_sms_free(apr_sms_t *sms, void *mem) */ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *sms, void *mem); @@ -180,7 +183,7 @@ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *sms, void *mem); * @param sms The memory system created * @param parent_sms The parent memory system * @deffunc apr_status_t apr_sms_init(apr_sms_t *sms, - * apr_sms_t *parent_sms) + * apr_sms_t *parent_sms) */ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, apr_sms_t *parent_sms); @@ -247,7 +250,7 @@ APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *sms); * @param b The memory system to search for * @return APR_SUCCESS if a is an ancestor of b, 1 if it isn't * @deffunc apr_status_t apr_sms_is_ancestor(apr_sms_t *a, - * apr_sms_t *b) + * apr_sms_t *b) */ APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a, apr_sms_t *b); @@ -276,7 +279,7 @@ APR_DECLARE(apr_sms_t *) apr_sms_get_parent(apr_sms_t *sms); * @param cleanup_fn The function to call when the memory system is reset or * destroyed * @deffunc void apr_sms_cleanup_register(apr_sms_t *sms, apr_int32_t type, - * void *data, apr_status_t (*cleanup_fn)(void *)); + * void *data, apr_status_t (*cleanup_fn)(void *)); */ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms, apr_int32_t type, void *data, @@ -290,7 +293,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms, apr_int32_t t * @param data The data associated with the cleanup function * @param cleanup_fn The registered cleanup function * @deffunc void apr_sms_cleanup_unregister(apr_sms_t *sms, - * void *data, apr_status_t (*cleanup_fn)(void *)); + * void *data, apr_status_t (*cleanup_fn)(void *)); */ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms, apr_int32_t type, void *data, @@ -328,7 +331,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms, * @param type The category of cleanup functions to run. Pass 0 to run all * cleanup functions. * @deffunc apr_status_t apr_sms_cleanup_run_type(apr_sms_t *sms, - * apr_int32_t type); + * apr_int32_t type); */ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, apr_int32_t type); @@ -344,5 +347,5 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms); } #endif -#endif /* !APR_MEMORY_SYSTEM_H */ +#endif /* !APR_SMS_H */ From 72dcefe3cea62850bcb1977a41adaa71f2179d99 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Sat, 30 Jun 2001 09:50:30 +0000 Subject: [PATCH 1839/7878] Added new function apr_implode_gmt, which works like apr_implode_time, except that it always produces an apr_time_t that represents GMT. * include/apr_time.h (apr_implode_gmt): New function. * time/unix/time.c, time/win32/time.c: Implement it. * test/testtime.c: Test it. The test is analogous to the apr_implode_time test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61832 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 10 ++++++++++ test/testtime.c | 15 +++++++++++++++ time/unix/time.c | 8 ++++++++ time/win32/time.c | 9 +++++++++ 4 files changed, 42 insertions(+) diff --git a/include/apr_time.h b/include/apr_time.h index 9e70fe0506a..dccaa984d0a 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -175,6 +175,16 @@ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *result, apr_exploded_time_t *input); +/** + * Convert time value from human readable format to a numeric apr_time_t that + * always represents GMT + * @param result the resulting imploded time + * @param input the input exploded time + * @deffunc apr_status_t apr_implode_gmt(apr_time_t *result, apr_exploded_time_t *input) + */ +APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *result, + apr_exploded_time_t *input); + /** * Sleep for the specified number of micro-seconds. * @param t desired amount of time to sleep. diff --git a/test/testtime.c b/test/testtime.c index 2bac3f3b22d..e81af28a719 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -99,6 +99,21 @@ int main(void) } printf("OK\n"); + STD_TEST_NEQ(" apr_implode_gmt (localtime)", + apr_implode_gmt(&imp, &xt2)) + + printf("%-60s", " checking localtime explode == GMT implode"); + if (imp != now) { + printf("mismatch\n" + "\t\tapr_now() %" APR_INT64_T_FMT "\n" + "\t\tapr_implode() returned %" APR_INT64_T_FMT "\n" + "\t\terror delta was %" APR_TIME_T_FMT "\n" + "\t\tshould have been 0\n", + now, imp, imp-now); + exit(-1); + } + printf("OK\n"); + str = apr_pcalloc(p, sizeof(char) * STR_SIZE); str2 = apr_pcalloc(p, sizeof(char) * STR_SIZE); imp = 0; diff --git a/time/unix/time.c b/time/unix/time.c index 085c9aa8db4..a39ca75a890 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -193,6 +193,14 @@ apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) return APR_SUCCESS; } +apr_status_t apr_implode_gmt(apr_time_t *t, apr_exploded_time_t *xt) +{ + apr_status_t status = apr_implode_time(t, xt); + if (status == APR_SUCCESS) + *t -= (apr_time_t) xt->tm_gmtoff * APR_USEC_PER_SEC; + return status; +} + apr_status_t apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime) { (*ostime)->tv_usec = *aprtime % APR_USEC_PER_SEC; diff --git a/time/win32/time.c b/time/win32/time.c index 18356de10a4..a8237491824 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -210,6 +210,15 @@ APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, + apr_exploded_time_t *xt) +{ + apr_status_t status = apr_implode_time(t, xt); + if (status == APR_SUCCESS) + *t -= (apr_time_t) xt->tm_gmtoff * APR_USEC_PER_SEC; + return status; +} + APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime) { From 9998e97fdb4d63a163b2a46c572874549f5e9ca6 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Sat, 30 Jun 2001 12:02:38 +0000 Subject: [PATCH 1840/7878] Added another test for apr_explode_gmt/apr_implode_gmt combinations. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61833 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/testtime.c b/test/testtime.c index e81af28a719..fdb2475776c 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -99,6 +99,21 @@ int main(void) } printf("OK\n"); + STD_TEST_NEQ(" apr_implode_gmt (GMT)", + apr_implode_gmt(&imp, &xt)) + + printf("%-60s", " checking GMT explode == GMT implode"); + if (imp != now) { + printf("mismatch\n" + "\t\tapr_now() %" APR_INT64_T_FMT "\n" + "\t\tapr_implode() returned %" APR_INT64_T_FMT "\n" + "\t\terror delta was %" APR_TIME_T_FMT "\n" + "\t\tshould have been 0\n", + now, imp, imp-now); + exit(-1); + } + printf("OK\n"); + STD_TEST_NEQ(" apr_implode_gmt (localtime)", apr_implode_gmt(&imp, &xt2)) From a53f3e3c43ff12f165c49dee5838cbafd6e2cedb Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 1 Jul 2001 03:38:56 +0000 Subject: [PATCH 1841/7878] Attempt to be smarter about detection of platforms that claim to have pthread_mutex_t with SHARED_PROCESS support. We now attempt to compile and run a test program that will validate these systems. If this passes, then we can use pthread_mutex_t as a cross process locking mechanism. Tested on Solaris (supports SHARED_PROCESS) and Linux (does not) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61834 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index b1dbce5fd4d..df0fc996b91 100644 --- a/configure.in +++ b/configure.in @@ -937,6 +937,31 @@ APR_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h) if test "$threads" = "1"; then APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h) AC_CHECK_FUNCS(pthread_mutexattr_setpshared) + dnl Some systems have setpshared and define PROCESS_SHARED, but don't + dnl really support PROCESS_SHARED locks. So, we must validate that we + dnl can go through the steps without receiving some sort of system error. + dnl Linux and older versions of AIX have this problem. + APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, + AC_TRY_RUN([ + #include + #include + int main() + { + pthread_mutex_t mutex; + pthread_mutexattr_t attr; + if (pthread_mutexattr_init(&attr)) + exit(1); + if (pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)) + exit(2); + if (pthread_mutex_init(&mutex, &attr)) + exit(3); + if (pthread_mutexattr_destroy(&attr)) + exit(4); + if (pthread_mutex_destroy(&mutex)) + exit(5); + exit(0); + }], [], [ac_cv_func_pthread_mutexattr_setpshared=no], + [ac_cv_func_pthread_mutexattr_setpshared=no])) fi # See which lock mechanisms we can support on this system. @@ -955,7 +980,7 @@ APR_IFALLYES(func:flock define:LOCK_EX, APR_IFALLYES(header:fcntl.h define:F_SETLK, APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl - func:pthread_mutexattr_setpshared custom:with_pthread_cross, + func:pthread_mutexattr_setpshared, APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) From 2d33d969538829d4992cbe6c40945159ff396a13 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 1 Jul 2001 03:41:35 +0000 Subject: [PATCH 1842/7878] Fix typo (method->meth). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61835 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/locks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 257f452f513..8a44cc07a34 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -166,7 +166,7 @@ static apr_status_t choose_method(apr_lock_t *new, apr_lockmech_e_np mech) #elif APR_USE_FCNTL_SERIALIZE new->inter_meth = &apr_unix_fcntl_methods; #elif APR_USE_PROC_PTHREAD_SERIALIZE - new->inter_method = &apr_unix_proc_pthread_methods; + new->inter_meth = &apr_unix_proc_pthread_methods; #else return APR_ENOTIMPL; #endif From aa788a4e74df6417c9cd16453d2d28931564951d Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 1 Jul 2001 05:49:44 +0000 Subject: [PATCH 1843/7878] Cleanup the detection of pthread_rwlock_t. Let autoconf play with the variables and set the APR_HAS_RWLOCK_SERIALIZE in apr.h rather than in arch/unix/locks.h to be consistent with the rest of the lock types. Also, add struct to the types "known" by APR_IFALLYES. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61836 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 1 + configure.in | 2 ++ include/apr.h.in | 1 + include/arch/unix/locks.h | 6 +----- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index f17b4ed4037..017af4641fd 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -239,6 +239,7 @@ for ac_spec in $1; do ac_var="ac_cv_file_$ac_item" ;; func ) ac_var="ac_cv_func_$ac_item" ;; + struct ) ac_var="ac_cv_struct_$ac_item" ;; define ) ac_var="ac_cv_define_$ac_item" ;; custom ) ac_var="$ac_item" ;; esac diff --git a/configure.in b/configure.in index df0fc996b91..e8d579c887a 100644 --- a/configure.in +++ b/configure.in @@ -969,6 +969,7 @@ APR_IFALLYES(func:semget func:semctl, hassysvser="1", hassysvser="0") APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1", hasflockser="0") APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1", hasfcntlser="0") APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, hasprocpthreadser="1", hasprocpthreadser="0") +APR_IFALLYES(struct:pthread_rw, hasrwlockser="1", hasrwlockser="0") # See which lock mechanism we'll select by default on this system. # The last APR_DECIDE to execute sets the default @@ -1025,6 +1026,7 @@ AC_SUBST(hasflockser) AC_SUBST(hassysvser) AC_SUBST(hasfcntlser) AC_SUBST(hasprocpthreadser) +AC_SUBST(hasrwlockser) AC_SUBST(flockser) AC_SUBST(sysvser) AC_SUBST(fcntlser) diff --git a/include/apr.h.in b/include/apr.h.in index c420e2aec1c..ecea32d5a33 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -68,6 +68,7 @@ #define APR_HAS_SYSVSEM_SERIALIZE @hassysvser@ #define APR_HAS_FCNTL_SERIALIZE @hasfcntlser@ #define APR_HAS_PROC_PTHREAD_SERIALIZE @hasprocpthreadser@ +#define APR_HAS_RWLOCK_SERIALIZE @hasrwlockser@ #define APR_HAS_LOCK_CREATE_NP @lockcreatenp@ diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index 0005fd7c072..a1f920d39cb 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -127,12 +127,8 @@ extern const apr_unix_lock_methods_t apr_unix_flock_methods; #if APR_HAS_PROC_PTHREAD_SERIALIZE extern const apr_unix_lock_methods_t apr_unix_proc_pthread_methods; #endif - -#if defined(HAVE_PTHREAD_RWLOCK_INIT) -#define APR_HAS_RWLOCK_SERIALIZE 1 +#if APR_HAS_RWLOCK_SERIALIZE extern const apr_unix_lock_methods_t apr_unix_rwlock_methods; -#else -#define APR_HAS_RWLOCK_SERIALIZE 0 #endif #if !APR_HAVE_UNION_SEMUN && defined(APR_HAS_SYSVSEM_SERIALIZE) From 48a8acab82b6754fda6665c7d447d3545efe6f3d Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 1 Jul 2001 06:09:49 +0000 Subject: [PATCH 1844/7878] Pure nitpick - remove whitespace. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61837 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/intraproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index 23e526367b9..3058c744ff4 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -80,7 +80,7 @@ static apr_status_t intra_create(apr_lock_t *new, const char *fname) new->intraproc = (pthread_mutex_t *)apr_palloc(new->pool, sizeof(pthread_mutex_t)); - if (new->intraproc == NULL ) { + if (new->intraproc == NULL) { return errno; } if ((stat = pthread_mutexattr_init(&mattr))) { From 4f1ac46baf47719332e99acd34808eb6480610d1 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 1 Jul 2001 06:14:12 +0000 Subject: [PATCH 1845/7878] Get this compiling again. Seems like the right choice. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61838 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testnames.c b/test/testnames.c index d5f974f24ea..f77a8833771 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -75,7 +75,7 @@ static void root_result(char *path) apr_status_t status; char errmsg[256]; char *root = NULL; - status = apr_filepath_root(&root, &path, context); + status = apr_filepath_root(&root, &path, APR_FILEPATH_NATIVE, context); apr_strerror(status, errmsg, sizeof(errmsg)); if (root) fprintf(stderr, "\tRoot \"%s\" Path \"%s\" (%s)\n", From d394c63e19f5b91b2b4d09d9d735597143a71d59 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 1 Jul 2001 06:23:10 +0000 Subject: [PATCH 1846/7878] Get apr_sms_trivial into APR and add the appropriate things to testmem. This should be similar to the current pool code in its method of allocation and having freelists. testmem was including "apr_sms_trivial.h", so instead of removing that line, I went the long way and added trivial SMS. I added the code to testmem. Sander still doesn't have his CVS access (although his account is setup?). This is based off of his submission to dev@apr from a few weeks ago - he might have a newer version locally that he hasn't posted. Submitted by: Sander Striker Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61839 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms_trivial.h | 106 ++++++++ memory/unix/Makefile.in | 3 +- memory/unix/apr_sms_trivial.c | 439 ++++++++++++++++++++++++++++++++++ test/testmem.c | 12 +- 4 files changed, 557 insertions(+), 3 deletions(-) create mode 100644 include/apr_sms_trivial.h create mode 100644 memory/unix/apr_sms_trivial.c diff --git a/include/apr_sms_trivial.h b/include/apr_sms_trivial.h new file mode 100644 index 00000000000..03644e8809a --- /dev/null +++ b/include/apr_sms_trivial.h @@ -0,0 +1,106 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_SMS_TRIVIAL_H +#define APR_SMS_TRIVIAL_H + +#include "apr.h" +#include "apr_sms.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @package APR trivial memory system + */ + +/** + * Create a pool like malloc/free/reset memory system + * @param mem_sys A pointer to the returned apr_sms_t* + * @param pms The parent memory system, used to allocate the memory + * that we will be trivial. + * @deffunc apr_status_t apr_sms_trivial_create(apr_sms_t **mem_sys, + * apr_sms_t *pms); + */ +APR_DECLARE(apr_status_t) apr_sms_trivial_create(apr_sms_t **sms, + apr_sms_t *pms); + +/** + * Create a pool like malloc/free/reset memory system + * @param mem_sys A pointer to the returned apr_sms_t* + * @param pms The parent memory system, used to allocate the memory + * that we will be trivial. + * @param min_alloc The minimal blocksize to allocate when getting + * memory from the parent + * @param min_free The minimal amount of memory to make sure is + * free in an allocated block from the parent + * @param max_free The amount of memory the sms may hold on to + * @deffunc apr_status_t apr_sms_trivial_create_ex(apr_sms_t **mem_sys, + * apr_sms_t *pms, + * apr_size_t min_alloc, + * apr_size_t min_free, + * apr_size_t max_free); + */ +APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, + apr_sms_t *pms, + apr_size_t min_alloc, + apr_size_t min_free, + apr_size_t max_free); + +#ifdef __cplusplus +} +#endif + +#endif /* !APR_SMS_TRIVIAL_H */ diff --git a/memory/unix/Makefile.in b/memory/unix/Makefile.in index 60701e8fe71..f2e3e0a0dc4 100644 --- a/memory/unix/Makefile.in +++ b/memory/unix/Makefile.in @@ -2,7 +2,8 @@ TARGETS = apr_sms.lo \ apr_sms_std.lo \ apr_sms_tracking.lo \ - apr_sms_blocks.lo + apr_sms_blocks.lo \ + apr_sms_trivial.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c new file mode 100644 index 00000000000..ba40556ad06 --- /dev/null +++ b/memory/unix/apr_sms_trivial.c @@ -0,0 +1,439 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_general.h" +#include "apr_private.h" +#include "apr_sms.h" +#include "apr_sms_trivial.h" +#include "apr_lock.h" + +static const char *module_identity = "TRIVIAL"; + +/* + * Simple trivial memory system + */ + + +/* INTERNALLY USED STRUCTURES */ + +typedef struct block_t +{ + struct node_t *node; +} block_t; + +typedef struct node_t +{ + struct node_t *next; + struct node_t *prev; + char *first_avail; + apr_size_t avail_size; + apr_uint16_t count; +} node_t; + +typedef struct apr_sms_trivial_t +{ + apr_sms_t sms_hdr; + node_t used_sentinel; + node_t free_sentinel; + node_t *self; + apr_size_t min_alloc; + apr_size_t min_free; + apr_size_t max_free; + apr_lock_t *lock; +} apr_sms_trivial_t; + +#define SIZEOF_BLOCK_T APR_ALIGN_DEFAULT(sizeof(block_t)) +#define SIZEOF_NODE_T APR_ALIGN_DEFAULT(sizeof(node_t)) +#define SIZEOF_TRIVIAL_T APR_ALIGN_DEFAULT(sizeof(apr_sms_trivial_t)) + +#define BLOCK_T(mem) ((block_t *)(mem)) +#define NODE_T(mem) ((node_t *)(mem)) +#define TRIVIAL_T(sms) ((apr_sms_trivial_t *)(sms)) + +/* Magic numbers :) */ + +#define MIN_ALLOC 0x2000 +#define MIN_FREE 0x1000 +#define MAX_FREE 0x80000 + +static void *apr_sms_trivial_malloc(apr_sms_t *sms, + apr_size_t size) +{ + node_t *node, *sentinel; + apr_size_t node_size; + void *mem; + + /* Round up the size to the next 8 byte boundary */ + size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; + + if (TRIVIAL_T(sms)->lock) + apr_lock_acquire(TRIVIAL_T(sms)->lock); + + node = TRIVIAL_T(sms)->used_sentinel.prev; + + if (node->avail_size >= size) { + mem = node->first_avail; + node->avail_size -= size; + node->first_avail += size; + node->count++; + + if (TRIVIAL_T(sms)->lock) + apr_lock_release(TRIVIAL_T(sms)->lock); + + BLOCK_T(mem)->node = node; + mem = (char *)mem + SIZEOF_BLOCK_T; + + return mem; + } + + /* reset the 'last' block, it will be replaced soon */ + node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + + /* browse the free list for a useable block */ + sentinel = &TRIVIAL_T(sms)->free_sentinel; + sentinel->avail_size = size; + + node = sentinel->next; + while (node->avail_size < size) + node = node->next; + + if (node != sentinel) { + node->prev->next = node->next; + node->next->prev = node->prev; + + node->prev = TRIVIAL_T(sms)->used_sentinel.prev; + node->prev->next = node; + node->next = &TRIVIAL_T(sms)->used_sentinel; + TRIVIAL_T(sms)->used_sentinel.prev = node; + + if (node != TRIVIAL_T(sms)->self) + TRIVIAL_T(sms)->max_free += node->avail_size; + + mem = node->first_avail; + node->avail_size -= size; + node->first_avail += size; + node->count = 1; + + if (TRIVIAL_T(sms)->lock) + apr_lock_release(TRIVIAL_T(sms)->lock); + + BLOCK_T(mem)->node = node; + mem = (char *)mem + SIZEOF_BLOCK_T; + + return mem; + } + + /* we have to allocate a new block from our parent */ + node_size = size + TRIVIAL_T(sms)->min_free; + if (node_size < TRIVIAL_T(sms)->min_alloc) + node_size = TRIVIAL_T(sms)->min_alloc; + + node = apr_sms_malloc(sms->parent, node_size); + if (!node) { + node = TRIVIAL_T(sms)->used_sentinel.prev; + node->first_avail += node->avail_size; + node->avail_size = 0; + + if (TRIVIAL_T(sms)->lock) + apr_lock_release(TRIVIAL_T(sms)->lock); + + return NULL; + } + + node->prev = TRIVIAL_T(sms)->used_sentinel.prev; + node->prev->next = node; + node->next = &TRIVIAL_T(sms)->used_sentinel; + TRIVIAL_T(sms)->used_sentinel.prev = node; + + mem = node->first_avail = (char *)node + SIZEOF_NODE_T; + node->first_avail += size; + node->avail_size = node_size - (node->first_avail - (char *)node); + node->count = 1; + + if (TRIVIAL_T(sms)->lock) + apr_lock_release(TRIVIAL_T(sms)->lock); + + BLOCK_T(mem)->node = node; + mem = (char *)mem + SIZEOF_BLOCK_T; + + return mem; +} + +static apr_status_t apr_sms_trivial_free(apr_sms_t *sms, void *mem) +{ + node_t *node; + + node = BLOCK_T((char *)mem - SIZEOF_BLOCK_T)->node; + + if (TRIVIAL_T(sms)->lock) + apr_lock_acquire(TRIVIAL_T(sms)->lock); + + node->count--; + + if (node->count) { + if (TRIVIAL_T(sms)->lock) + apr_lock_release(TRIVIAL_T(sms)->lock); + + return APR_SUCCESS; + } + + node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + + if (TRIVIAL_T(sms)->used_sentinel.prev != node) { + node->next->prev = node->prev; + node->prev->next = node->next; + + if (sms->parent->free_fn && + node->avail_size > TRIVIAL_T(sms)->max_free && + node != TRIVIAL_T(sms)->self) { + if (TRIVIAL_T(sms)->lock) + apr_lock_release(TRIVIAL_T(sms)->lock); + + return apr_sms_free(sms->parent, node); + } + + node->prev = TRIVIAL_T(sms)->free_sentinel.prev; + node->prev->next = node; + node->next = &TRIVIAL_T(sms)->free_sentinel; + TRIVIAL_T(sms)->free_sentinel.prev = node; + + if (node != TRIVIAL_T(sms)->self) + TRIVIAL_T(sms)->max_free -= node->avail_size; + } + + if (TRIVIAL_T(sms)->lock) + apr_lock_release(TRIVIAL_T(sms)->lock); + + return APR_SUCCESS; +} + +static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) +{ + node_t *node, *prev, *used_sentinel, *free_sentinel; + + if (TRIVIAL_T(sms)->lock) + apr_lock_acquire(TRIVIAL_T(sms)->lock); + + used_sentinel = &TRIVIAL_T(sms)->used_sentinel; + free_sentinel = &TRIVIAL_T(sms)->free_sentinel; + + node = TRIVIAL_T(sms)->self; + node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + node->count = 0; + node->prev->next = node->next; + node->next->prev = node->prev; + + node = used_sentinel->prev; + node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + + if (sms->parent->free_fn) { + used_sentinel->avail_size = TRIVIAL_T(sms)->min_alloc; + while (TRIVIAL_T(sms)->max_free > TRIVIAL_T(sms)->min_alloc) { + if (node->avail_size <= TRIVIAL_T(sms)->max_free) { + if (node == used_sentinel) + break; + + TRIVIAL_T(sms)->max_free -= node->avail_size; + node->prev->next = node->next; + node->next->prev = node->prev; + + prev = node->prev; + + node->next = free_sentinel->next; + free_sentinel->next = node; + node->next->prev = node; + node->prev = free_sentinel; + + node = prev; + } + else + node = node->prev; + } + + used_sentinel->prev->next = NULL; + while ((node = used_sentinel->next) != NULL) { + used_sentinel->next = node->next; + apr_sms_free(sms->parent, node); + } + } + else { + node = used_sentinel->prev; + node->next = free_sentinel->next; + node->next->prev = node; + + node = used_sentinel->next; + node->prev = free_sentinel; + free_sentinel->next = node; + } + + node = TRIVIAL_T(sms)->self; + node->next = node->prev = used_sentinel; + used_sentinel->next = used_sentinel->prev = node; + + if (TRIVIAL_T(sms)->lock) + apr_lock_release(TRIVIAL_T(sms)->lock); + + return APR_SUCCESS; +} + +static apr_status_t apr_sms_trivial_pre_destroy(apr_sms_t *sms) +{ + /* This function WILL always be called. However, be aware that the + * main sms destroy function knows that it's not wise to try and destroy + * the same piece of memory twice, so the destroy function in a child won't + * neccesarily be called. To guarantee we destroy the lock it's therefore + * destroyed here. + */ + + if (TRIVIAL_T(sms)->lock) { + apr_lock_acquire(TRIVIAL_T(sms)->lock); + apr_lock_destroy(TRIVIAL_T(sms)->lock); + TRIVIAL_T(sms)->lock = NULL; + } + + return APR_SUCCESS; +} + +static apr_status_t apr_sms_trivial_destroy(apr_sms_t *sms) +{ + apr_sms_trivial_t *tms; + node_t *node, *next; + + tms = TRIVIAL_T(sms); + node = tms->self; + node->next->prev = node->prev; + node->prev->next = node->next; + + tms->free_sentinel.prev->next = NULL; + tms->used_sentinel.prev->next = tms->free_sentinel.next; + + node = tms->used_sentinel.next; + while (node) { + next = node->next; + apr_sms_free(sms->parent, node); + node = next; + } + + apr_sms_free(sms->parent, sms); + + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_sms_trivial_create(apr_sms_t **sms, + apr_sms_t *pms) +{ + return apr_sms_trivial_create_ex(sms, pms, MIN_ALLOC, MIN_FREE, MAX_FREE); +} + +APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, + apr_sms_t *pms, + apr_size_t min_alloc, + apr_size_t min_free, + apr_size_t max_free) +{ + apr_sms_t *new_sms; + apr_sms_trivial_t *tms; + node_t *node; + apr_status_t rv; + + *sms = NULL; + + min_alloc = APR_ALIGN_DEFAULT(min_alloc); + min_free = APR_ALIGN_DEFAULT(min_free); + + /* We're not a top level module, ie we have a parent, so + * we allocate the memory for the structure from our parent. + * This is safe as we shouldn't outlive our parent... + */ + + new_sms = apr_sms_calloc(pms, min_alloc); + if (!new_sms) + return APR_ENOMEM; + + if ((rv = apr_sms_init(new_sms, pms)) != APR_SUCCESS) + return rv; + + new_sms->malloc_fn = apr_sms_trivial_malloc; + new_sms->free_fn = apr_sms_trivial_free; + new_sms->reset_fn = apr_sms_trivial_reset; + new_sms->pre_destroy_fn = apr_sms_trivial_pre_destroy; + new_sms->destroy_fn = apr_sms_trivial_destroy; + new_sms->identity = module_identity; + + node = (node_t *)((char *)new_sms + SIZEOF_TRIVIAL_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + node->avail_size = min_alloc - SIZEOF_TRIVIAL_T - SIZEOF_NODE_T; + node->count = 0; + + tms = TRIVIAL_T(new_sms); + tms->min_alloc = min_alloc; + tms->min_free = min_free; + tms->max_free = max_free; + tms->self = node; + + node->next = node->prev = &tms->used_sentinel; + tms->used_sentinel.next = tms->used_sentinel.prev = node; + tms->free_sentinel.next = tms->free_sentinel.prev = &tms->free_sentinel; + + apr_sms_assert(new_sms); + + *sms = new_sms; + return APR_SUCCESS; +} diff --git a/test/testmem.c b/test/testmem.c index b29d169467f..7cff3360a89 100644 --- a/test/testmem.c +++ b/test/testmem.c @@ -84,7 +84,7 @@ typedef struct _test_ { apr_time_t howlong; } _test_; -#define T_QTY 4 /* how many tests do we have?? */ +#define T_QTY 5 /* how many tests do we have?? */ static _test_ t[T_QTY]; static void its_an_sms(apr_sms_t *ams, _test_ *t, char *name, int lt) @@ -434,7 +434,7 @@ static void print_timed_results(void) int main(int argc, char **argv) { - apr_sms_t *ams, *bms, *dms; + apr_sms_t *ams, *bms, *dms, *tms; apr_pool_t *pool; int i; @@ -452,12 +452,15 @@ int main(int argc, char **argv) apr_sms_tracking_create(&bms, ams)) STD_TEST_NEQ(" Creating a 64 byte block system", apr_sms_blocks_create(&dms, ams, 64)) + STD_TEST_NEQ(" Creating a trivial system", + apr_sms_trivial_create(&tms, ams)) its_a_pool(pool, &t[0], "Pool code", 1); its_an_sms(ams, &t[1], "Standard sms", 1); t[1].reset_fn = NULL; its_an_sms(bms, &t[2], "Tracking sms", 1); its_an_sms(dms, &t[3], "Blocks sms", 0); + its_an_sms(tms, &t[4], "Trivial sms", 1); printf("Checking sms identities...\n"); TEST_NEQ(" Checking identity of standard memory system", @@ -469,6 +472,9 @@ int main(int argc, char **argv) TEST_NEQ(" Checking the identity of blocks memory system", strcmp(apr_sms_identity(dms), "BLOCKS"), 0, "OK", "Not BLOCKS") + TEST_NEQ(" Checking the identity of trivial memory system", + strcmp(apr_sms_identity(tms), "TRIVIAL"), 0, + "OK", "Not TRIVIAL") printf("Big allocation test...\n"); for (i = 0; i < T_QTY; i++) { @@ -508,6 +514,8 @@ int main(int argc, char **argv) printf("Destroying the memory...\n"); + STD_TEST_NEQ("Trying to destroy the trivial memory system", + apr_sms_destroy(tms)) STD_TEST_NEQ("Trying to destroy the tracking memory system", apr_sms_destroy(bms)) STD_TEST_NEQ("Trying to destroy the block memory system", From 4f600c4c1745a48353c4ddfcff71364750ca6d2b Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 1 Jul 2001 12:42:21 +0000 Subject: [PATCH 1847/7878] Increased the size of the count field. Although it is very unlikely we ever give out more than 0x10000 fragments from one single block, it seems better to rule it out. Replaced a typecast with a macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61840 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_trivial.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index ba40556ad06..5a76575a252 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -79,7 +79,7 @@ typedef struct node_t struct node_t *prev; char *first_avail; apr_size_t avail_size; - apr_uint16_t count; + apr_uint32_t count; } node_t; typedef struct apr_sms_trivial_t @@ -417,7 +417,7 @@ APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, new_sms->destroy_fn = apr_sms_trivial_destroy; new_sms->identity = module_identity; - node = (node_t *)((char *)new_sms + SIZEOF_TRIVIAL_T); + node = NODE_T((char *)new_sms + SIZEOF_TRIVIAL_T); node->first_avail = (char *)node + SIZEOF_NODE_T; node->avail_size = min_alloc - SIZEOF_TRIVIAL_T - SIZEOF_NODE_T; node->count = 0; From 7e27ca1ac5a389e6581b634753d2c3480b85fa30 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 1 Jul 2001 13:56:30 +0000 Subject: [PATCH 1848/7878] Moved the call to apr_sms_assert to within the apr_sms_post_init function. This will make it more convenient for sms developers. Added the call to apr_sms_post_init to the 'trivial' sms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61841 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms.c | 2 ++ memory/unix/apr_sms_blocks.c | 1 - memory/unix/apr_sms_std.c | 1 - memory/unix/apr_sms_tracking.c | 1 - memory/unix/apr_sms_trivial.c | 2 +- 5 files changed, 3 insertions(+), 4 deletions(-) diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 453daf9b850..cb2c2baa923 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -232,6 +232,8 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms) { + apr_sms_assert(sms); + /* We do things here as these may potentially make calls * to the sms that we're creating, and if we make the calls * in the sms_init phase we haven't yet added the function diff --git a/memory/unix/apr_sms_blocks.c b/memory/unix/apr_sms_blocks.c index 69ecf517a71..c39d794a05c 100644 --- a/memory/unix/apr_sms_blocks.c +++ b/memory/unix/apr_sms_blocks.c @@ -272,7 +272,6 @@ APR_DECLARE(apr_status_t) apr_sms_blocks_create(apr_sms_t **sms, /* We are normally single threaded so no lock */ - apr_sms_assert(new_sms); apr_sms_post_init(new_sms); *sms = new_sms; diff --git a/memory/unix/apr_sms_std.c b/memory/unix/apr_sms_std.c index ac455267547..235441a3bac 100644 --- a/memory/unix/apr_sms_std.c +++ b/memory/unix/apr_sms_std.c @@ -132,7 +132,6 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms) * apr_sms_destroy functions. */ - apr_sms_assert(new_sms); apr_sms_post_init(new_sms); *sms = new_sms; diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c index 1e8ad56f907..c8f85101d5b 100644 --- a/memory/unix/apr_sms_tracking.c +++ b/memory/unix/apr_sms_tracking.c @@ -290,7 +290,6 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **sms, apr_lock_create(&tms->lock, APR_MUTEX, APR_LOCKALL, NULL, new_sms->pool); - apr_sms_assert(new_sms); apr_sms_post_init(new_sms); *sms = new_sms; diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index 5a76575a252..c643100be91 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -432,7 +432,7 @@ APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, tms->used_sentinel.next = tms->used_sentinel.prev = node; tms->free_sentinel.next = tms->free_sentinel.prev = &tms->free_sentinel; - apr_sms_assert(new_sms); + apr_sms_post_init(new_sms); *sms = new_sms; return APR_SUCCESS; From 67fa78c4d910c6d1c7395cba866c8a2ab0c20a81 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Sun, 1 Jul 2001 15:13:34 +0000 Subject: [PATCH 1849/7878] Back out this portion of Bill Rowe's large file support patch. We should not use the event handle in the apr_file_t to do overlapped i/o on a socket. We either need to wait for io completion on the socket or create a thread specific event handle. This fixes the seg fault we were seeing when serving a cached file on Windows. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61842 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index da3ee6c7556..865dbca6bcb 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -258,16 +258,12 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, /* Initialize the overlapped structure */ memset(&overlapped,'\0', sizeof(overlapped)); - if (file->pOverlapped) - overlapped.hEvent = file->pOverlapped->hEvent; -#ifdef WAIT_FOR_EVENT - else - overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); -#endif if (offset && *offset) { - file->pOverlapped->Offset = (DWORD)*offset; - file->pOverlapped->OffsetHigh = (DWORD)(*offset >> 32); + overlapped.Offset = *offset; } +#ifdef WAIT_FOR_EVENT + overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); +#endif /* Handle the goofy case of sending headers/trailers and a zero byte file */ if (!bytes_to_send && hdtr) { @@ -324,14 +320,15 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (!rv) { status = apr_get_netos_error(); if (status == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) { - if (overlapped.hEvent) - rv = WaitForSingleObject(overlapped.hEvent, - (DWORD)(sock->timeout >= 0 - ? sock->timeout : INFINITE)); - else - rv = WaitForSingleObject((HANDLE) sock->sock, - (DWORD)(sock->timeout >= 0 - ? sock->timeout : INFINITE)); +#ifdef WAIT_FOR_EVENT + rv = WaitForSingleObject(overlapped.hEvent, + (DWORD)(sock->timeout >= 0 + ? sock->timeout : INFINITE)); +#else + rv = WaitForSingleObject((HANDLE) sock->sock, + (DWORD)(sock->timeout >= 0 + ? sock->timeout : INFINITE)); +#endif if (rv == WAIT_OBJECT_0) status = APR_SUCCESS; else if (rv == WAIT_TIMEOUT) @@ -379,8 +376,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, } #ifdef WAIT_FOR_EVENT - if (!file->pOverlapped || !file->pOverlapped->hEvent) - CloseHandle(overlapped.hEvent); + CloseHandle(overlapped.hEvent); #endif return status; } From d048bc8220b2f1e2cca1fbbaf8486863c779219a Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Sun, 1 Jul 2001 21:47:53 +0000 Subject: [PATCH 1850/7878] Adjust the calculated GMT offset on get_offset() for daylight savings time. This only affects platforms that do not have a tm_gmtoff field in struct tm (e.g., Solaris 2.6, HP-UX 10.20, ...). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61843 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/time/unix/time.c b/time/unix/time.c index a39ca75a890..35a9161f60b 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -77,18 +77,28 @@ static apr_int32_t get_offset(struct tm *tm) #elif defined(HAVE___OFFSET) return tm->__tm_gmtoff; #else - /* we don't have an offset field to use, so calculate it */ + /* We don't have an offset field to use, so calculate it. + mktime() is the inverse of localtime(); so, presumably, + passing in a struct tm made by gmtime() let's us calculate + the true GMT offset. However, there's a catch: if daylight + savings is in effect, gmtime()will set the tm_isdst field + and confuse mktime() into returning a time that's offset + by one hour. In that case, we must adjust the calculated GMT + offset. */ { time_t t1 = time(0), t2 = 0; struct tm t; + int was_dst; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) gmtime_r(&t1, &t); #else t = *gmtime(&t1); #endif + was_dst = (t.tm_isdst > 0); + t.tm_isdst = -1; t2 = mktime(&t); - return (apr_int32_t) difftime(t1, t2); + return (apr_int32_t) difftime(t1, t2) + (was_dst ? 3600 : 0); } #endif } From 5718c3501592f03a71a54f2dc8100d869ffcb42a Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 1 Jul 2001 23:03:26 +0000 Subject: [PATCH 1851/7878] Removed the creation of the private lock in apr_sms_tracking. This lets this sms start off as single threaded just like the other smss. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61844 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_tracking.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c index c8f85101d5b..52f60da87e3 100644 --- a/memory/unix/apr_sms_tracking.c +++ b/memory/unix/apr_sms_tracking.c @@ -287,8 +287,6 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **sms, tms = (apr_sms_tracking_t *)new_sms; tms->nodes = NULL; - apr_lock_create(&tms->lock, APR_MUTEX, APR_LOCKALL, NULL, - new_sms->pool); apr_sms_post_init(new_sms); From 1105e7322de5f90c96e34b201c3a2bd6bca2d2db Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 1 Jul 2001 23:06:17 +0000 Subject: [PATCH 1852/7878] Changed the macro names to be the same style as sms_blocks. Did a few simple optimizations that improved on readability aswell. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61845 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_trivial.c | 146 ++++++++++++++++++---------------- 1 file changed, 78 insertions(+), 68 deletions(-) diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index c643100be91..e4f730fb8f0 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -94,13 +94,13 @@ typedef struct apr_sms_trivial_t apr_lock_t *lock; } apr_sms_trivial_t; -#define SIZEOF_BLOCK_T APR_ALIGN_DEFAULT(sizeof(block_t)) -#define SIZEOF_NODE_T APR_ALIGN_DEFAULT(sizeof(node_t)) -#define SIZEOF_TRIVIAL_T APR_ALIGN_DEFAULT(sizeof(apr_sms_trivial_t)) +#define SIZEOF_BLOCK_T APR_ALIGN_DEFAULT(sizeof(block_t)) +#define SIZEOF_NODE_T APR_ALIGN_DEFAULT(sizeof(node_t)) +#define SIZEOF_SMS_TRIVIAL_T APR_ALIGN_DEFAULT(sizeof(apr_sms_trivial_t)) -#define BLOCK_T(mem) ((block_t *)(mem)) -#define NODE_T(mem) ((node_t *)(mem)) -#define TRIVIAL_T(sms) ((apr_sms_trivial_t *)(sms)) +#define BLOCK_T(mem) ((block_t *)(mem)) +#define NODE_T(mem) ((node_t *)(mem)) +#define SMS_TRIVIAL_T(sms) ((apr_sms_trivial_t *)(sms)) /* Magic numbers :) */ @@ -118,10 +118,10 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, /* Round up the size to the next 8 byte boundary */ size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; - if (TRIVIAL_T(sms)->lock) - apr_lock_acquire(TRIVIAL_T(sms)->lock); + if (SMS_TRIVIAL_T(sms)->lock) + apr_lock_acquire(SMS_TRIVIAL_T(sms)->lock); - node = TRIVIAL_T(sms)->used_sentinel.prev; + node = SMS_TRIVIAL_T(sms)->used_sentinel.prev; if (node->avail_size >= size) { mem = node->first_avail; @@ -129,8 +129,8 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, node->first_avail += size; node->count++; - if (TRIVIAL_T(sms)->lock) - apr_lock_release(TRIVIAL_T(sms)->lock); + if (SMS_TRIVIAL_T(sms)->lock) + apr_lock_release(SMS_TRIVIAL_T(sms)->lock); BLOCK_T(mem)->node = node; mem = (char *)mem + SIZEOF_BLOCK_T; @@ -143,7 +143,7 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, node->first_avail = (char *)node + SIZEOF_NODE_T; /* browse the free list for a useable block */ - sentinel = &TRIVIAL_T(sms)->free_sentinel; + sentinel = &SMS_TRIVIAL_T(sms)->free_sentinel; sentinel->avail_size = size; node = sentinel->next; @@ -154,21 +154,22 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, node->prev->next = node->next; node->next->prev = node->prev; - node->prev = TRIVIAL_T(sms)->used_sentinel.prev; + sentinel = &SMS_TRIVIAL_T(sms)->used_sentinel; + node->prev = sentinel->prev; node->prev->next = node; - node->next = &TRIVIAL_T(sms)->used_sentinel; - TRIVIAL_T(sms)->used_sentinel.prev = node; + node->next = sentinel; + sentinel->prev = node; - if (node != TRIVIAL_T(sms)->self) - TRIVIAL_T(sms)->max_free += node->avail_size; + if (node != SMS_TRIVIAL_T(sms)->self) + SMS_TRIVIAL_T(sms)->max_free += node->avail_size; mem = node->first_avail; - node->avail_size -= size; + node->avail_size -= size; node->first_avail += size; node->count = 1; - if (TRIVIAL_T(sms)->lock) - apr_lock_release(TRIVIAL_T(sms)->lock); + if (SMS_TRIVIAL_T(sms)->lock) + apr_lock_release(SMS_TRIVIAL_T(sms)->lock); BLOCK_T(mem)->node = node; mem = (char *)mem + SIZEOF_BLOCK_T; @@ -177,34 +178,38 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, } /* we have to allocate a new block from our parent */ - node_size = size + TRIVIAL_T(sms)->min_free; - if (node_size < TRIVIAL_T(sms)->min_alloc) - node_size = TRIVIAL_T(sms)->min_alloc; + node_size = size + SMS_TRIVIAL_T(sms)->min_free; + if (node_size < SMS_TRIVIAL_T(sms)->min_alloc) + node_size = SMS_TRIVIAL_T(sms)->min_alloc; node = apr_sms_malloc(sms->parent, node_size); if (!node) { - node = TRIVIAL_T(sms)->used_sentinel.prev; + /* restore the 'last' node, so the next allocation + * will not segfault + */ + node = SMS_TRIVIAL_T(sms)->used_sentinel.prev; node->first_avail += node->avail_size; node->avail_size = 0; - if (TRIVIAL_T(sms)->lock) - apr_lock_release(TRIVIAL_T(sms)->lock); + if (SMS_TRIVIAL_T(sms)->lock) + apr_lock_release(SMS_TRIVIAL_T(sms)->lock); return NULL; } - node->prev = TRIVIAL_T(sms)->used_sentinel.prev; + sentinel = &SMS_TRIVIAL_T(sms)->used_sentinel; + node->prev = sentinel->prev; node->prev->next = node; - node->next = &TRIVIAL_T(sms)->used_sentinel; - TRIVIAL_T(sms)->used_sentinel.prev = node; + node->next = sentinel; + sentinel->prev = node; mem = node->first_avail = (char *)node + SIZEOF_NODE_T; node->first_avail += size; node->avail_size = node_size - (node->first_avail - (char *)node); node->count = 1; - if (TRIVIAL_T(sms)->lock) - apr_lock_release(TRIVIAL_T(sms)->lock); + if (SMS_TRIVIAL_T(sms)->lock) + apr_lock_release(SMS_TRIVIAL_T(sms)->lock); BLOCK_T(mem)->node = node; mem = (char *)mem + SIZEOF_BLOCK_T; @@ -214,18 +219,18 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, static apr_status_t apr_sms_trivial_free(apr_sms_t *sms, void *mem) { - node_t *node; + node_t *node, *sentinel; node = BLOCK_T((char *)mem - SIZEOF_BLOCK_T)->node; - if (TRIVIAL_T(sms)->lock) - apr_lock_acquire(TRIVIAL_T(sms)->lock); + if (SMS_TRIVIAL_T(sms)->lock) + apr_lock_acquire(SMS_TRIVIAL_T(sms)->lock); node->count--; if (node->count) { - if (TRIVIAL_T(sms)->lock) - apr_lock_release(TRIVIAL_T(sms)->lock); + if (SMS_TRIVIAL_T(sms)->lock) + apr_lock_release(SMS_TRIVIAL_T(sms)->lock); return APR_SUCCESS; } @@ -233,30 +238,31 @@ static apr_status_t apr_sms_trivial_free(apr_sms_t *sms, void *mem) node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); node->first_avail = (char *)node + SIZEOF_NODE_T; - if (TRIVIAL_T(sms)->used_sentinel.prev != node) { + if (SMS_TRIVIAL_T(sms)->used_sentinel.prev != node) { node->next->prev = node->prev; node->prev->next = node->next; if (sms->parent->free_fn && - node->avail_size > TRIVIAL_T(sms)->max_free && - node != TRIVIAL_T(sms)->self) { - if (TRIVIAL_T(sms)->lock) - apr_lock_release(TRIVIAL_T(sms)->lock); + node->avail_size > SMS_TRIVIAL_T(sms)->max_free && + node != SMS_TRIVIAL_T(sms)->self) { + if (SMS_TRIVIAL_T(sms)->lock) + apr_lock_release(SMS_TRIVIAL_T(sms)->lock); return apr_sms_free(sms->parent, node); } - node->prev = TRIVIAL_T(sms)->free_sentinel.prev; + sentinel = &SMS_TRIVIAL_T(sms)->free_sentinel; + node->prev = sentinel->prev; node->prev->next = node; - node->next = &TRIVIAL_T(sms)->free_sentinel; - TRIVIAL_T(sms)->free_sentinel.prev = node; + node->next = sentinel; + sentinel->prev = node; - if (node != TRIVIAL_T(sms)->self) - TRIVIAL_T(sms)->max_free -= node->avail_size; + if (node != SMS_TRIVIAL_T(sms)->self) + SMS_TRIVIAL_T(sms)->max_free -= node->avail_size; } - if (TRIVIAL_T(sms)->lock) - apr_lock_release(TRIVIAL_T(sms)->lock); + if (SMS_TRIVIAL_T(sms)->lock) + apr_lock_release(SMS_TRIVIAL_T(sms)->lock); return APR_SUCCESS; } @@ -264,14 +270,15 @@ static apr_status_t apr_sms_trivial_free(apr_sms_t *sms, void *mem) static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) { node_t *node, *prev, *used_sentinel, *free_sentinel; + apr_size_t min_alloc, max_free; - if (TRIVIAL_T(sms)->lock) - apr_lock_acquire(TRIVIAL_T(sms)->lock); + if (SMS_TRIVIAL_T(sms)->lock) + apr_lock_acquire(SMS_TRIVIAL_T(sms)->lock); - used_sentinel = &TRIVIAL_T(sms)->used_sentinel; - free_sentinel = &TRIVIAL_T(sms)->free_sentinel; + used_sentinel = &SMS_TRIVIAL_T(sms)->used_sentinel; + free_sentinel = &SMS_TRIVIAL_T(sms)->free_sentinel; - node = TRIVIAL_T(sms)->self; + node = SMS_TRIVIAL_T(sms)->self; node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); node->first_avail = (char *)node + SIZEOF_NODE_T; node->count = 0; @@ -283,13 +290,15 @@ static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) node->first_avail = (char *)node + SIZEOF_NODE_T; if (sms->parent->free_fn) { - used_sentinel->avail_size = TRIVIAL_T(sms)->min_alloc; - while (TRIVIAL_T(sms)->max_free > TRIVIAL_T(sms)->min_alloc) { - if (node->avail_size <= TRIVIAL_T(sms)->max_free) { + min_alloc = SMS_TRIVIAL_T(sms)->min_alloc; + max_free = SMS_TRIVIAL_T(sms)->max_free; + used_sentinel->avail_size = min_alloc; + while (max_free > min_alloc) { + if (node->avail_size <= max_free) { if (node == used_sentinel) break; - TRIVIAL_T(sms)->max_free -= node->avail_size; + max_free -= node->avail_size; node->prev->next = node->next; node->next->prev = node->prev; @@ -305,6 +314,7 @@ static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) else node = node->prev; } + SMS_TRIVIAL_T(sms)->max_free = max_free; used_sentinel->prev->next = NULL; while ((node = used_sentinel->next) != NULL) { @@ -322,12 +332,12 @@ static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) free_sentinel->next = node; } - node = TRIVIAL_T(sms)->self; + node = SMS_TRIVIAL_T(sms)->self; node->next = node->prev = used_sentinel; used_sentinel->next = used_sentinel->prev = node; - if (TRIVIAL_T(sms)->lock) - apr_lock_release(TRIVIAL_T(sms)->lock); + if (SMS_TRIVIAL_T(sms)->lock) + apr_lock_release(SMS_TRIVIAL_T(sms)->lock); return APR_SUCCESS; } @@ -341,10 +351,10 @@ static apr_status_t apr_sms_trivial_pre_destroy(apr_sms_t *sms) * destroyed here. */ - if (TRIVIAL_T(sms)->lock) { - apr_lock_acquire(TRIVIAL_T(sms)->lock); - apr_lock_destroy(TRIVIAL_T(sms)->lock); - TRIVIAL_T(sms)->lock = NULL; + if (SMS_TRIVIAL_T(sms)->lock) { + apr_lock_acquire(SMS_TRIVIAL_T(sms)->lock); + apr_lock_destroy(SMS_TRIVIAL_T(sms)->lock); + SMS_TRIVIAL_T(sms)->lock = NULL; } return APR_SUCCESS; @@ -355,7 +365,7 @@ static apr_status_t apr_sms_trivial_destroy(apr_sms_t *sms) apr_sms_trivial_t *tms; node_t *node, *next; - tms = TRIVIAL_T(sms); + tms = SMS_TRIVIAL_T(sms); node = tms->self; node->next->prev = node->prev; node->prev->next = node->next; @@ -417,12 +427,12 @@ APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, new_sms->destroy_fn = apr_sms_trivial_destroy; new_sms->identity = module_identity; - node = NODE_T((char *)new_sms + SIZEOF_TRIVIAL_T); + node = NODE_T((char *)new_sms + SIZEOF_SMS_TRIVIAL_T); node->first_avail = (char *)node + SIZEOF_NODE_T; - node->avail_size = min_alloc - SIZEOF_TRIVIAL_T - SIZEOF_NODE_T; + node->avail_size = min_alloc - SIZEOF_SMS_TRIVIAL_T - SIZEOF_NODE_T; node->count = 0; - tms = TRIVIAL_T(new_sms); + tms = SMS_TRIVIAL_T(new_sms); tms->min_alloc = min_alloc; tms->min_free = min_free; tms->max_free = max_free; From 78496c502cd88d5fa0bc6b4f623f038be3128ecc Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 2 Jul 2001 01:39:10 +0000 Subject: [PATCH 1853/7878] Fix warnings on Solaris 2.6 about assigning from pointer to int and vice versa with APR_USE_PROC_PTHREAD_SERIALIZE. Submitted by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61846 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 13 ++++--------- locks/unix/locks.c | 11 ++++++++++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 0ba40143b9a..06ff8f36056 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -150,16 +150,11 @@ union semun { #endif struct apr_os_lock_t { -#if APR_USE_SYSVSEM_SERIALIZE +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE int crossproc; -#elif APR_USE_FCNTL_SERIALIZE - int crossproc; -#elif APR_USE_PROC_PTHREAD_SERIALIZE - pthread_mutex_t *crossproc; -#elif APR_USE_FLOCK_SERIALIZE - int crossproc; -#else - /* No Interprocess serialization, too bad. */ +#endif +#if APR_HAS_PROC_PTHREAD_SERIALIZE + pthread_mutex_t *pthread_interproc; #endif #if APR_HAS_THREADS /* If no threads, no need for thread locks */ diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 8a44cc07a34..06a7b583c0d 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -341,7 +341,12 @@ apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) { +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE oslock->crossproc = lock->interproc; +#endif +#if APR_HAS_PROC_PTHREAD_SERIALIZE + oslock->pthread_interproc = lock->pthread_interproc; +#endif #if APR_HAS_THREADS #if APR_USE_PTHREAD_SERIALIZE oslock->intraproc = lock->intraproc; @@ -361,8 +366,12 @@ apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, (*lock) = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t)); (*lock)->pool = pool; } - /* XXX handle setting of handle for PROC_PTHREAD_SERIALIZE here */ +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE (*lock)->interproc = thelock->crossproc; +#endif +#if APR_HAS_PROC_PTHREAD_SERIALIZE + (*lock)->pthread_interproc = thelock->pthread_interproc; +#endif #if APR_HAS_THREADS #if (APR_USE_PTHREAD_SERIALIZE) (*lock)->intraproc = thelock->intraproc; From d325c97f7ab84e884670f9787b2c3a10d773e781 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 2 Jul 2001 08:01:04 +0000 Subject: [PATCH 1854/7878] Add some debugging to sms... - add an option to print out when we create/reset/destroy an sms - add an option to allow us to print out a tree of the sms's showing the inter-relationships git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61847 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 66 ++++++++++++++++++--- memory/unix/apr_sms.c | 130 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 185 insertions(+), 11 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index 8f29a250d76..d8b491456f3 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -72,21 +72,51 @@ extern "C" { #endif + +/********************************************************************** + ** Defines + **********************************************************************/ + /* The various types of cleanup's we can offer */ #define APR_ALL_CLEANUPS 0x0000 #define APR_CHILD_CLEANUP 0x0001 #define APR_PARENT_CLEANUP 0x0002 -/* Alignment macro's - * - * APR_ALIGN is only to be used to align on a power - * of two boundary - */ +/* Alignment macro's */ #define APR_ALIGN(size, boundary) \ - (((size) + ((boundary) - 1)) & ~((boundary) - 1)) + ((size) + (((boundary) - ((size) & ((boundary) - 1))) & ((boundary) - 1))) #define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) +/********************************************************************** + ** Debug options + **********************************************************************/ +/* + * One of the aims of SMS is to provide a large range of debugging + * options. + * + * The options are normally turned off by having the define commented out. + * To use, simply remove the define and rebuild! + * + * Function definitions are at the end of the file... + */ + +/* DEBUG_SHOW_STRUCTURE + * This turns on a print of the ancestory of the SMS when + * creating/destroying an SMS so it's place in the world can be seen. + */ +/* #define DEBUG_SHOW_STRUCTURE 1 */ + +/* DEBUG_SHOW_FUNCTIONS + * This turns on debug printing of every call to i + * apr_sms_create + * apr_sms_destroy + * apr_sms_reset + * + * Format of output is + * CREATE - sms 0x0000000 [STANDARD] has been created + */ +/* #define DEBUG_SHOW_FUNCTIONS 1 */ /** * @package APR memory system @@ -195,13 +225,14 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, */ APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms); +#ifdef APR_ASSERT_MEMORY + /** * Check if a memory system is obeying all rules. * @caution Call this function as the last statement before returning a new * memory system from your apr_xxx_sms_create. * @deffunc void apr_sms_validate(apr_sms_t *sms) */ -#ifdef APR_ASSERT_MEMORY APR_DECLARE(void) apr_sms_assert(apr_sms_t *sms); #else #ifdef apr_sms_assert @@ -336,6 +367,10 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms, APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, apr_int32_t type); +/********************************************************************** + ** Standard SMS module + **********************************************************************/ + /** * Create a standard malloc/realloc/free memory system * @param sms A pointer to the created apr_sms_t* @@ -343,6 +378,23 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, */ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms); + +/********************************************************************** + ** Debug routines + **********************************************************************/ + +/* NB These are only available if the debugging option has been turned on. */ + +#if DEBUG_SHOW_STRUCTURE +/** + * Show the heirachy of the sms + * @param sms The sms to show the information for + * @param direction Do we show up (to parent) or down (to children) + */ +APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction); +#endif /* DEBUG_SHOW_STRUCTURE */ + + #ifdef __cplusplus } #endif diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index cb2c2baa923..2a1a82e12f0 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -232,19 +232,29 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms) { - apr_sms_assert(sms); - /* We do things here as these may potentially make calls * to the sms that we're creating, and if we make the calls * in the sms_init phase we haven't yet added the function * pointers so we'll segfault! */ + apr_status_t rv; + + apr_sms_assert(sms); /* Create the sms framework lock we'll use. */ - return apr_lock_create(&sms->sms_lock, APR_MUTEX, APR_LOCKALL, - NULL, sms->pool); + rv = apr_lock_create(&sms->sms_lock, APR_MUTEX, APR_LOCKALL, + NULL, sms->pool); +#if DEBUG_SHOW_FUNCTIONS + printf("CREATE - sms %p [%s] has been created\n", sms, sms->identity); +#endif +#if DEBUG_SHOW_STRUCTURE + apr_sms_show_structure(sms, 1); +#endif /* DEBUG_SHOW_STRUCTURE */ + + return rv; } + #ifdef APR_ASSERT_MEMORY APR_DECLARE(void) apr_sms_assert(apr_sms_t *sms) { @@ -355,6 +365,10 @@ APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *sms) if (!sms->reset_fn) return APR_ENOTIMPL; +#if DEBUG_SHOW_FUNCTIONS + printf("RESET - sms %p [%s] being reset\n", sms, sms->identity); +#endif + if (sms->sms_lock) apr_lock_acquire(sms->sms_lock); @@ -396,6 +410,14 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms) struct apr_sms_cleanup *cleanup; struct apr_sms_cleanup *next_cleanup; +#if DEBUG_SHOW_FUNCTIONS + printf("DESTROY - sms %p [%s] being destroyed\n", sms, sms->identity); +#endif +#if DEBUG_SHOW_STRUCTURE + printf("WARNING! Destroying this SMS will also destroy:\n"); + apr_sms_show_structure(sms, 0); +#endif /* DEBUG_SHOW_STRUCTURE */ + if (sms->sms_lock) apr_lock_acquire(sms->sms_lock); @@ -747,3 +769,103 @@ APR_DECLARE(apr_sms_t *) apr_sms_get_parent(apr_sms_t *sms) { return sms->parent; } + +#if DEBUG_SHOW_STRUCTURE +static void add_sms(char *a, char *b, apr_sms_t *sms, apr_sms_t *caller, + int sib) +{ + char tmp[20]; + if (sib == 1) { + strcat(a, "="); + strcat(b, " "); + } + sprintf(tmp, sms == caller ? "**%9p**" : " [%9p] ", sms); + strcat(a, tmp); + sprintf(tmp, sms == caller ? " [%9s] " : " [%9s] ", sms->identity); + strcat(b, tmp); +} + +static void add_tab(char *a, char *b, int level, apr_sms_t *sms) +{ + char buffer[100]; + int i; + for(i=0;i < level * 2;i++) + buffer[i] = ' '; + buffer[i] = '\0'; + strcpy(a, buffer); + strcpy(b, buffer); + if (sms->parent) + printf("%s |\n", buffer); +} + +static void print_structure(char *l1, char *l2) +{ + printf("%s\n%s\n", l1, l2); +} + +APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction) +{ + apr_sms_t *thesms, *sibling; + int levels = 0, i = 0, j = 0; + char l1[100], l2[100]; + + if (direction == 1) { + /* we're going up! */ + thesms = sms; + while (thesms->parent != NULL) { + levels++; + thesms = thesms->parent; + } + if (levels == 0) { + printf("The SMS is a top-level SMS.\n"); + } else { + printf("The SMS is %d level(s) deep!\n", levels); + } + /* thesms now eqauls the top level... so start showing them! */ + while (thesms) { + add_tab(l1, l2, i++, thesms); + + add_sms(l1, l2, thesms, sms, 0); + + sibling = thesms->sibling; + while (sibling) { + add_sms(l1, l2, sibling, NULL, 1); + sibling = sibling->sibling; + } + print_structure(l1, l2); + + thesms = thesms->child; + } + } else { + /* we go down! i.e. show our descendants */ + thesms = sms; + while (thesms->child) { + levels++; + thesms = thesms->child; + } + if (levels == 0) { + printf("The SMS is a bottom-level SMS with no descendants\n"); + } else { + printf("This SMS has %d descendants\n", levels); + } + thesms = sms; + while (thesms) { + add_tab(l1, l2, i++, thesms); + + /* add the child... */ + add_sms(l1, l2, thesms, sms, 0); + + /* add siblings... */ + sibling = thesms->sibling; + while (sibling != NULL) { + add_sms(l1, l2, sibling, sms, 1); + sibling = sibling->sibling; + } + print_structure(l1, l2); + thesms = thesms->child; + } + } +} +#endif /* DEBUG_SHOW_STRUCTURE */ + + From 78092cdb32bc96ad7375dafae27465dea083d924 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 2 Jul 2001 08:13:03 +0000 Subject: [PATCH 1855/7878] Hey Presto! He waved his hand over the files and the sms structure disappeared from the public header file. apr_sms_init and apr_sms_post_init are only ever used internally so they go to the private header as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61848 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 50 ------------- memory/unix/apr_sms.c | 1 + memory/unix/apr_sms_blocks.c | 1 + memory/unix/apr_sms_std.c | 1 + memory/unix/apr_sms_tracking.c | 1 + memory/unix/apr_sms_trivial.c | 1 + memory/unix/sms_private.h | 127 +++++++++++++++++++++++++++++++++ 7 files changed, 132 insertions(+), 50 deletions(-) create mode 100644 memory/unix/sms_private.h diff --git a/include/apr_sms.h b/include/apr_sms.h index d8b491456f3..82b71c1cc7e 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -125,35 +125,6 @@ extern "C" { struct apr_sms_cleanup; typedef struct apr_sms_t apr_sms_t; -/** - * The memory system structure - */ -struct apr_sms_t -{ - apr_sms_t *parent; - apr_sms_t *child; - apr_sms_t *sibling; - apr_sms_t **ref; - apr_sms_t *accounting; - const char *identity; /* a string identifying the module */ - - apr_pool_t *pool; - apr_lock_t *sms_lock; - - struct apr_sms_cleanup *cleanups; - - void * (*malloc_fn) (apr_sms_t *sms, apr_size_t size); - void * (*calloc_fn) (apr_sms_t *sms, apr_size_t size); - void * (*realloc_fn) (apr_sms_t *sms, void *memory, - apr_size_t size); - apr_status_t (*free_fn) (apr_sms_t *sms, void *memory); - apr_status_t (*reset_fn) (apr_sms_t *sms); - apr_status_t (*pre_destroy_fn) (apr_sms_t *sms); - apr_status_t (*destroy_fn) (apr_sms_t *sms); - apr_status_t (*lock_fn) (apr_sms_t *sms); - apr_status_t (*unlock_fn) (apr_sms_t *sms); -}; - /* * memory allocation functions */ @@ -204,27 +175,6 @@ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *sms, void *mem); * memory system functions */ -/** - * Initialize a memory system - * @caution Call this function as soon as you have obtained a block of memory - * to serve as a memory system structure from your - * apr_xxx_sms_create. Only use this function when you are - * implementing a memory system. - * @param sms The memory system created - * @param parent_sms The parent memory system - * @deffunc apr_status_t apr_sms_init(apr_sms_t *sms, - * apr_sms_t *parent_sms) - */ -APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, - apr_sms_t *parent_sms); - -/** - * Do post init work that needs the sms to have been fully - * initialised. - * @param sms The memory system to use - */ -APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms); - #ifdef APR_ASSERT_MEMORY /** diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 2a1a82e12f0..8d25c622804 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -64,6 +64,7 @@ #include "apr_general.h" #include "apr_sms.h" #include +#include "sms_private.h" #ifdef APR_ASSERT_MEMORY #include diff --git a/memory/unix/apr_sms_blocks.c b/memory/unix/apr_sms_blocks.c index c39d794a05c..e4a1f41c27f 100644 --- a/memory/unix/apr_sms_blocks.c +++ b/memory/unix/apr_sms_blocks.c @@ -70,6 +70,7 @@ #include "apr_portable.h" #define APR_WANT_MEMFUNC #include "apr_want.h" +#include "sms_private.h" static const char *module_identity = "BLOCKS"; #define MIN_ALLOC 8 * 1024 /* don't allocate in smaller blocks than 8Kb */ diff --git a/memory/unix/apr_sms_std.c b/memory/unix/apr_sms_std.c index 235441a3bac..628e0f1a317 100644 --- a/memory/unix/apr_sms_std.c +++ b/memory/unix/apr_sms_std.c @@ -64,6 +64,7 @@ #include "apr_private.h" #include "apr_sms.h" #include +#include "sms_private.h" static const char *module_identity = "STANDARD"; diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c index 52f60da87e3..4b15903b289 100644 --- a/memory/unix/apr_sms_tracking.c +++ b/memory/unix/apr_sms_tracking.c @@ -67,6 +67,7 @@ #include "apr_sms_tracking.h" #include "apr_lock.h" #include /* for NULL */ +#include "sms_private.h" static const char *module_identity = "TRACKING"; diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index e4f730fb8f0..778310ee918 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -58,6 +58,7 @@ #include "apr_sms.h" #include "apr_sms_trivial.h" #include "apr_lock.h" +#include "sms_private.h" static const char *module_identity = "TRIVIAL"; diff --git a/memory/unix/sms_private.h b/memory/unix/sms_private.h new file mode 100644 index 00000000000..8049d8a00bb --- /dev/null +++ b/memory/unix/sms_private.h @@ -0,0 +1,127 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef SMS_PRIVATE_H +#define SMS_PRIVATE_H + +#include "apr.h" +#include "apr_errno.h" +#include "apr_pools.h" +#include "apr_lock.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * The memory system structure + */ +struct apr_sms_t +{ + apr_sms_t *parent; + apr_sms_t *child; + apr_sms_t *sibling; + apr_sms_t **ref; + apr_sms_t *accounting; + const char *identity; /* a string identifying the module */ + + apr_pool_t *pool; + apr_lock_t *sms_lock; + + struct apr_sms_cleanup *cleanups; + + void * (*malloc_fn) (apr_sms_t *sms, apr_size_t size); + void * (*calloc_fn) (apr_sms_t *sms, apr_size_t size); + void * (*realloc_fn) (apr_sms_t *sms, void *memory, + apr_size_t size); + apr_status_t (*free_fn) (apr_sms_t *sms, void *memory); + apr_status_t (*reset_fn) (apr_sms_t *sms); + apr_status_t (*pre_destroy_fn) (apr_sms_t *sms); + apr_status_t (*destroy_fn) (apr_sms_t *sms); + apr_status_t (*lock_fn) (apr_sms_t *sms); + apr_status_t (*unlock_fn) (apr_sms_t *sms); +}; + +/* + * private memory system functions + */ + +/** + * Initialize a memory system + * @caution Call this function as soon as you have obtained a block of memory + * to serve as a memory system structure from your + * apr_xxx_sms_create. Only use this function when you are + * implementing a memory system. + * @param sms The memory system created + * @param parent_sms The parent memory system + * @deffunc apr_status_t apr_sms_init(apr_sms_t *sms, + * apr_sms_t *parent_sms) + */ +APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, + apr_sms_t *parent_sms); + +/** + * Do post init work that needs the sms to have been fully + * initialised. + * @param sms The memory system to use + */ +APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms); + + +#ifdef __cplusplus +} +#endif + +#endif /* !SMS_PRIVATE_H */ + From ae98837f00c58d7d7d9621e5b4d2df2bfbb8f044 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 2 Jul 2001 08:29:45 +0000 Subject: [PATCH 1856/7878] Included to make sure NULL is declared. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61849 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_trivial.c | 1 + 1 file changed, 1 insertion(+) diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index 778310ee918..e9dd9d2ef04 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -59,6 +59,7 @@ #include "apr_sms_trivial.h" #include "apr_lock.h" #include "sms_private.h" +#include static const char *module_identity = "TRIVIAL"; From bd64c02ab4309081fcd32744ebee7fdb0d541d72 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 2 Jul 2001 08:32:27 +0000 Subject: [PATCH 1857/7878] More debugging and a small cleanup... - change back some bits I removed in error - add the start of an ability to "tag" an sms so we have more information when debugging git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61850 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 21 +++++++++++++++++++-- memory/unix/apr_sms.c | 6 ++++++ memory/unix/sms_private.h | 4 ++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index 82b71c1cc7e..d03041e02ce 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -82,9 +82,12 @@ extern "C" { #define APR_CHILD_CLEANUP 0x0001 #define APR_PARENT_CLEANUP 0x0002 -/* Alignment macro's */ +/* Alignment macro's + * + * APR_ALIGN is only to be used to align on a power of 2 boundary + */ #define APR_ALIGN(size, boundary) \ - ((size) + (((boundary) - ((size) & ((boundary) - 1))) & ((boundary) - 1))) + (((size) + ((boundary) - 1)) & ~ ((boundary) -1)) #define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) @@ -118,6 +121,12 @@ extern "C" { */ /* #define DEBUG_SHOW_FUNCTIONS 1 */ +/* DEBUG_TAG_SMS + * Turn on the ability to give an SMS a "tag" that can be used to identify + * it. + */ +/* #define DEBUG_TAG_SMS 1 */ + /** * @package APR memory system */ @@ -344,6 +353,14 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms); APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction); #endif /* DEBUG_SHOW_STRUCTURE */ +#if DEBUG_TAG_SMS +/** + * Set the debugging tag for an sms + * @param tag The tag to give the sms + * @param sms The sms to apply the tag to + */ +APR_DECLARE(void) apr_sms_tag(const char*tag, apr_sms_t *sms); +#endif #ifdef __cplusplus } diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 8d25c622804..246d24d084e 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -869,4 +869,10 @@ APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction) } #endif /* DEBUG_SHOW_STRUCTURE */ +#if DEBUG_TAG_SMS +APR_DECLARE(void) apr_sms_tag(const char *tag, apr_sms_t *sms) +{ + sms->tag = tag; +} +#endif diff --git a/memory/unix/sms_private.h b/memory/unix/sms_private.h index 8049d8a00bb..64340ffe5b6 100644 --- a/memory/unix/sms_private.h +++ b/memory/unix/sms_private.h @@ -91,6 +91,10 @@ struct apr_sms_t apr_status_t (*destroy_fn) (apr_sms_t *sms); apr_status_t (*lock_fn) (apr_sms_t *sms); apr_status_t (*unlock_fn) (apr_sms_t *sms); + +#if DEBUG_TAG_SMS + const char *tag; +#endif }; /* From a8469f8d4ffa76826a8296432cecb4b9e238c87d Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 2 Jul 2001 09:01:38 +0000 Subject: [PATCH 1858/7878] Clean up some warnings and add an APR_ to the start of the debug options so that the exports scripts hide them correctly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61851 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 20 ++++++++++---------- memory/unix/apr_sms.c | 11 +++++++---- memory/unix/sms_private.h | 2 +- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index d03041e02ce..a6886201ced 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -104,13 +104,13 @@ extern "C" { * Function definitions are at the end of the file... */ -/* DEBUG_SHOW_STRUCTURE +/* APR_DEBUG_SHOW_STRUCTURE * This turns on a print of the ancestory of the SMS when * creating/destroying an SMS so it's place in the world can be seen. */ -/* #define DEBUG_SHOW_STRUCTURE 1 */ + #define APR_DEBUG_SHOW_STRUCTURE 1 -/* DEBUG_SHOW_FUNCTIONS +/* APR_DEBUG_SHOW_FUNCTIONS * This turns on debug printing of every call to i * apr_sms_create * apr_sms_destroy @@ -119,13 +119,13 @@ extern "C" { * Format of output is * CREATE - sms 0x0000000 [STANDARD] has been created */ -/* #define DEBUG_SHOW_FUNCTIONS 1 */ + #define APR_DEBUG_SHOW_FUNCTIONS 1 -/* DEBUG_TAG_SMS +/* APR_DEBUG_TAG_SMS * Turn on the ability to give an SMS a "tag" that can be used to identify * it. */ -/* #define DEBUG_TAG_SMS 1 */ + #define APR_DEBUG_TAG_SMS 1 /** * @package APR memory system @@ -344,23 +344,23 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms); /* NB These are only available if the debugging option has been turned on. */ -#if DEBUG_SHOW_STRUCTURE +#ifdef APR_DEBUG_SHOW_STRUCTURE /** * Show the heirachy of the sms * @param sms The sms to show the information for * @param direction Do we show up (to parent) or down (to children) */ APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction); -#endif /* DEBUG_SHOW_STRUCTURE */ +#endif /* APR_DEBUG_SHOW_STRUCTURE */ -#if DEBUG_TAG_SMS +#ifdef APR_DEBUG_TAG_SMS /** * Set the debugging tag for an sms * @param tag The tag to give the sms * @param sms The sms to apply the tag to */ APR_DECLARE(void) apr_sms_tag(const char*tag, apr_sms_t *sms); -#endif +#endif /* APR_DEBUG_TAG_SMS */ #ifdef __cplusplus } diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 246d24d084e..a3117bdbcd0 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -69,6 +69,9 @@ #ifdef APR_ASSERT_MEMORY #include #endif +#if defined(APR_DEBUG_SHOW_STRUCTURE) +#include +#endif #include /* strikerXXX: had to add this for windows to stop * complaining, please autoconf the include stuff @@ -771,7 +774,7 @@ APR_DECLARE(apr_sms_t *) apr_sms_get_parent(apr_sms_t *sms) return sms->parent; } -#if DEBUG_SHOW_STRUCTURE +#if APR_DEBUG_SHOW_STRUCTURE static void add_sms(char *a, char *b, apr_sms_t *sms, apr_sms_t *caller, int sib) { @@ -807,7 +810,7 @@ static void print_structure(char *l1, char *l2) APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction) { apr_sms_t *thesms, *sibling; - int levels = 0, i = 0, j = 0; + int levels = 0, i = 0; char l1[100], l2[100]; if (direction == 1) { @@ -867,9 +870,9 @@ APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction) } } } -#endif /* DEBUG_SHOW_STRUCTURE */ +#endif /* APR_DEBUG_SHOW_STRUCTURE */ -#if DEBUG_TAG_SMS +#if APR_DEBUG_TAG_SMS APR_DECLARE(void) apr_sms_tag(const char *tag, apr_sms_t *sms) { sms->tag = tag; diff --git a/memory/unix/sms_private.h b/memory/unix/sms_private.h index 64340ffe5b6..e90cd63ceda 100644 --- a/memory/unix/sms_private.h +++ b/memory/unix/sms_private.h @@ -92,7 +92,7 @@ struct apr_sms_t apr_status_t (*lock_fn) (apr_sms_t *sms); apr_status_t (*unlock_fn) (apr_sms_t *sms); -#if DEBUG_TAG_SMS +#if APR_DEBUG_TAG_SMS const char *tag; #endif }; From aa8fac742d86f4c5b9a26c2b3d89a638920dc28d Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 2 Jul 2001 09:03:43 +0000 Subject: [PATCH 1859/7878] Whoops. Need sleep :( These should be turned OFF by default, not ON as that last commit made them. Well, I had to make sure turning them on didn't break things didn't I? :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61852 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index a6886201ced..35c268120d6 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -108,7 +108,7 @@ extern "C" { * This turns on a print of the ancestory of the SMS when * creating/destroying an SMS so it's place in the world can be seen. */ - #define APR_DEBUG_SHOW_STRUCTURE 1 +/* #define APR_DEBUG_SHOW_STRUCTURE 1 */ /* APR_DEBUG_SHOW_FUNCTIONS * This turns on debug printing of every call to i @@ -119,13 +119,13 @@ extern "C" { * Format of output is * CREATE - sms 0x0000000 [STANDARD] has been created */ - #define APR_DEBUG_SHOW_FUNCTIONS 1 +/* #define APR_DEBUG_SHOW_FUNCTIONS 1 */ /* APR_DEBUG_TAG_SMS * Turn on the ability to give an SMS a "tag" that can be used to identify * it. */ - #define APR_DEBUG_TAG_SMS 1 +/* #define APR_DEBUG_TAG_SMS 1 */ /** * @package APR memory system From 961e7ef00b699b0fe9db04a40c715e57a9429746 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 2 Jul 2001 11:56:22 +0000 Subject: [PATCH 1860/7878] Handle the weird case where getpwnam() returns NULL but errno is zero. This led to a segfault on apache.org when apache did a home directory lookup on an invalid user name. This isn't cool on the part of libc, but oh well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61853 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ user/unix/userinfo.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index dbf47d88b9d..f09362841b5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Handle the weird case where getpwnam() returns NULL but errno is zero. + [Jeff Trawick] + *) Add apr_file_flags_get() which returns the flags that were originally passed in to apr_file_open(). [Cliff Woolley] diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index ac0b386fb07..aa062f44253 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -74,6 +74,10 @@ static apr_status_t getpwnam_safe(const char *username, #else if ((*pw = getpwnam(username)) == NULL) { #endif + if (errno == 0) { + /* this can happen with getpwnam() on FreeBSD 4.3 */ + return APR_EGENERAL; + } return errno; } return APR_SUCCESS; From 4792ce10d820a34fecb5b1e75cf9862827fbcbcc Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 2 Jul 2001 16:21:48 +0000 Subject: [PATCH 1861/7878] Add the ability to print the debugging output into a file instead of stdout. Change the way we "switch" on/off the debgugging to make it easier to use. Add support for showing the tag if we have one available. Still need to add a sensible default tag. Ben L suggested (at 5:45am this morning so I hope I remember this correctly) that we use the file and line number. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61854 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 16 ++++-- memory/unix/apr_sms.c | 121 ++++++++++++++++++++++++++---------------- 2 files changed, 86 insertions(+), 51 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index 35c268120d6..320066fc57d 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -104,14 +104,22 @@ extern "C" { * Function definitions are at the end of the file... */ +/* APR_DEBUG_TO_FILE + * This will put all debug output into a file, that you can name + * using the APR_DEBUG_FILE define. Normally this is set to setdout + * and the output is simply printed there. + */ +#define APR_DEBUG_TO_FILE 0 +#define APR_DEBUG_FILE "/tmp/sms_debug" + /* APR_DEBUG_SHOW_STRUCTURE * This turns on a print of the ancestory of the SMS when * creating/destroying an SMS so it's place in the world can be seen. */ -/* #define APR_DEBUG_SHOW_STRUCTURE 1 */ +#define APR_DEBUG_SHOW_STRUCTURE 0 /* APR_DEBUG_SHOW_FUNCTIONS - * This turns on debug printing of every call to i + * This turns on debug printing of every call to * apr_sms_create * apr_sms_destroy * apr_sms_reset @@ -119,13 +127,13 @@ extern "C" { * Format of output is * CREATE - sms 0x0000000 [STANDARD] has been created */ -/* #define APR_DEBUG_SHOW_FUNCTIONS 1 */ +#define APR_DEBUG_SHOW_FUNCTIONS 0 /* APR_DEBUG_TAG_SMS * Turn on the ability to give an SMS a "tag" that can be used to identify * it. */ -/* #define APR_DEBUG_TAG_SMS 1 */ +#define APR_DEBUG_TAG_SMS 0 /** * @package APR memory system diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index a3117bdbcd0..72525cef9b6 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -69,14 +69,14 @@ #ifdef APR_ASSERT_MEMORY #include #endif -#if defined(APR_DEBUG_SHOW_STRUCTURE) #include -#endif #include /* strikerXXX: had to add this for windows to stop * complaining, please autoconf the include stuff */ +FILE *dbg_file; + /* * private structure defenitions */ @@ -175,6 +175,13 @@ static int apr_sms_is_tracking(apr_sms_t *sms) APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, apr_sms_t *pms) { +#if APR_DEBUG_TO_FILE + if (!dbg_file) + dbg_file = fopen(APR_DEBUG_FILE, "w"); +#else + dbg_file = stdout; +#endif + /* XXX - I've assumed that memory passed in will be zeroed, * i.e. calloc'd instead of malloc'd... * This may well be a bogus assumption, and if so we either need @@ -248,12 +255,14 @@ APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms) /* Create the sms framework lock we'll use. */ rv = apr_lock_create(&sms->sms_lock, APR_MUTEX, APR_LOCKALL, NULL, sms->pool); -#if DEBUG_SHOW_FUNCTIONS - printf("CREATE - sms %p [%s] has been created\n", sms, sms->identity); + +#if APR_DEBUG_SHOW_FUNCTIONS + fprintf(dbg_file, "CREATE - sms %p [%s] has been created\n", + sms, sms->identity); #endif -#if DEBUG_SHOW_STRUCTURE +#if APR_DEBUG_SHOW_STRUCTURE apr_sms_show_structure(sms, 1); -#endif /* DEBUG_SHOW_STRUCTURE */ +#endif /* APR_DEBUG_SHOW_STRUCTURE */ return rv; } @@ -369,8 +378,13 @@ APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *sms) if (!sms->reset_fn) return APR_ENOTIMPL; -#if DEBUG_SHOW_FUNCTIONS - printf("RESET - sms %p [%s] being reset\n", sms, sms->identity); +#if APR_DEBUG_SHOW_FUNCTIONS +# if APR_DEBUG_TAG_SMS + fprintf(dbg_file, "RESET - sms %p '%s' [%s] being reset\n", sms, + sms->tag, sms->identity); +# else + fprintf(dbg_file, "RESET - sms %p [%s] being reset\n", sms, sms->identity); +# endif #endif if (sms->sms_lock) @@ -414,13 +428,14 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms) struct apr_sms_cleanup *cleanup; struct apr_sms_cleanup *next_cleanup; -#if DEBUG_SHOW_FUNCTIONS - printf("DESTROY - sms %p [%s] being destroyed\n", sms, sms->identity); -#endif -#if DEBUG_SHOW_STRUCTURE - printf("WARNING! Destroying this SMS will also destroy:\n"); +#if APR_DEBUG_SHOW_FUNCTIONS + fprintf(dbg_file, "DESTROY - sms %p [%s] being destroyed\n", + sms, sms->identity); +#endif /* APR_DEBUG_SHOW_FUNCTIONS */ +#if APR_DEBUG_SHOW_STRUCTURE + fprintf(dbg_file, "The following SMS will be destroyed by this action:\n"); apr_sms_show_structure(sms, 0); -#endif /* DEBUG_SHOW_STRUCTURE */ +#endif /* APR_DEBUG_SHOW_STRUCTURE */ if (sms->sms_lock) apr_lock_acquire(sms->sms_lock); @@ -775,21 +790,28 @@ APR_DECLARE(apr_sms_t *) apr_sms_get_parent(apr_sms_t *sms) } #if APR_DEBUG_SHOW_STRUCTURE -static void add_sms(char *a, char *b, apr_sms_t *sms, apr_sms_t *caller, - int sib) +static void add_sms(char *a, char *b, char *c, apr_sms_t *sms, + apr_sms_t *caller, int sib) { - char tmp[20]; + char tmp[40]; if (sib == 1) { strcat(a, "="); strcat(b, " "); + strcat(c, " "); } sprintf(tmp, sms == caller ? "**%9p**" : " [%9p] ", sms); strcat(a, tmp); - sprintf(tmp, sms == caller ? " [%9s] " : " [%9s] ", sms->identity); +#if APR_DEBUG_TAG_SMS + sprintf(tmp, " '%9s' ", sms->tag); +#else + sprintf(tmp, " "); +#endif strcat(b, tmp); + sprintf(tmp, " [%9s] ", sms->identity); + strcat(c, tmp); } -static void add_tab(char *a, char *b, int level, apr_sms_t *sms) +static void add_tab(char *a, char *b, char *c, int level, apr_sms_t *sms) { char buffer[100]; int i; @@ -798,21 +820,30 @@ static void add_tab(char *a, char *b, int level, apr_sms_t *sms) buffer[i] = '\0'; strcpy(a, buffer); strcpy(b, buffer); + strcpy(c, buffer); if (sms->parent) - printf("%s |\n", buffer); + fprintf(dbg_file, "%s |\n", buffer); + fflush(dbg_file); } -static void print_structure(char *l1, char *l2) +static void print_structure(char *l1, char *l2, char *l3) { - printf("%s\n%s\n", l1, l2); + fprintf(dbg_file, "%s\n%s\n%s\n", l1, l2, l3); + fflush(dbg_file); +} + +static void print_depth(int levels) +{ + fprintf(dbg_file, "Showing %d level%s of SMS\n", levels + 1, + levels == 0 ? "" : "s"); } APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction) { apr_sms_t *thesms, *sibling; int levels = 0, i = 0; - char l1[100], l2[100]; - + char l1[256], l2[256], l3[256]; + if (direction == 1) { /* we're going up! */ thesms = sms; @@ -820,23 +851,19 @@ APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction) levels++; thesms = thesms->parent; } - if (levels == 0) { - printf("The SMS is a top-level SMS.\n"); - } else { - printf("The SMS is %d level(s) deep!\n", levels); - } + print_depth(levels); /* thesms now eqauls the top level... so start showing them! */ while (thesms) { - add_tab(l1, l2, i++, thesms); + add_tab(l1, l2, l3, i++, thesms); - add_sms(l1, l2, thesms, sms, 0); + add_sms(l1, l2, l3, thesms, sms, 0); sibling = thesms->sibling; while (sibling) { - add_sms(l1, l2, sibling, NULL, 1); + add_sms(l1, l2, l3, sibling, NULL, 1); sibling = sibling->sibling; } - print_structure(l1, l2); + print_structure(l1, l2, l3); thesms = thesms->child; } @@ -847,25 +874,25 @@ APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction) levels++; thesms = thesms->child; } - if (levels == 0) { - printf("The SMS is a bottom-level SMS with no descendants\n"); - } else { - printf("This SMS has %d descendants\n", levels); - } + print_depth(levels); thesms = sms; while (thesms) { - add_tab(l1, l2, i++, thesms); + add_tab(l1, l2, l3, i++, thesms); /* add the child... */ - add_sms(l1, l2, thesms, sms, 0); - - /* add siblings... */ - sibling = thesms->sibling; - while (sibling != NULL) { - add_sms(l1, l2, sibling, sms, 1); - sibling = sibling->sibling; + add_sms(l1, l2, l3, thesms, sms, 0); + /* If we're destroying a sibling, then we won't be destroying + * the other siblings, just descendants of this SMS, so + * make sure what we show makes sense! + */ + if (thesms != sms && thesms->sibling) { + sibling = thesms->sibling; + while (sibling) { + add_sms(l1, l2, l3, sibling, NULL, 1); + sibling = sibling->sibling; + } } - print_structure(l1, l2); + print_structure(l1, l2, l3); thesms = thesms->child; } } From 5a014225f62aa5e03a485c083cd86b1970da67e8 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 2 Jul 2001 16:23:45 +0000 Subject: [PATCH 1862/7878] fcntl() should be our preference for the short-term. Our support of pthread_mutex_t needs more work before we can make it the default (if that's what we want anyway). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61855 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index e8d579c887a..adeb9729381 100644 --- a/configure.in +++ b/configure.in @@ -967,8 +967,8 @@ fi # See which lock mechanisms we can support on this system. APR_IFALLYES(func:semget func:semctl, hassysvser="1", hassysvser="0") APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1", hasflockser="0") -APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1", hasfcntlser="0") APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, hasprocpthreadser="1", hasprocpthreadser="0") +APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1", hasfcntlser="0") APR_IFALLYES(struct:pthread_rw, hasrwlockser="1", hasrwlockser="0") # See which lock mechanism we'll select by default on this system. From b13bad842444b7d58801a4001980dd32411f4ed5 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 2 Jul 2001 16:52:27 +0000 Subject: [PATCH 1863/7878] REALLY flip the order of the pthread_mutex_t and fcntl() decision. I have no clue what I was thinking before. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61856 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index adeb9729381..87831b62fc6 100644 --- a/configure.in +++ b/configure.in @@ -967,8 +967,8 @@ fi # See which lock mechanisms we can support on this system. APR_IFALLYES(func:semget func:semctl, hassysvser="1", hassysvser="0") APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1", hasflockser="0") -APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, hasprocpthreadser="1", hasprocpthreadser="0") APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1", hasfcntlser="0") +APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, hasprocpthreadser="1", hasprocpthreadser="0") APR_IFALLYES(struct:pthread_rw, hasrwlockser="1", hasrwlockser="0") # See which lock mechanism we'll select by default on this system. @@ -978,11 +978,11 @@ APR_IFALLYES(func:semget func:semctl, APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) APR_IFALLYES(func:flock define:LOCK_EX, APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) -APR_IFALLYES(header:fcntl.h define:F_SETLK, - APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl func:pthread_mutexattr_setpshared, APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) +APR_IFALLYES(header:fcntl.h define:F_SETLK, + APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) fi From cfdeacc47092ffbe10569acab566e6ecaa9abfea Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 2 Jul 2001 18:54:05 +0000 Subject: [PATCH 1864/7878] tighten up the checking for sysV semaphore support... Darwin didn't have full support but it did have semget() and semctl(), resulting in a build error... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61857 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 1 + configure.in | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/acconfig.h b/acconfig.h index b238713b5a7..f9318b233c5 100644 --- a/acconfig.h +++ b/acconfig.h @@ -6,6 +6,7 @@ /* Various #defines we need to know about */ #undef HAVE_LOCK_EX #undef HAVE_F_SETLK +#undef HAVE_SEM_UNDO #undef HAVE_CODESET #undef HAVE_PTHREAD_PROCESS_SHARED #undef DEV_RANDOM diff --git a/configure.in b/configure.in index 87831b62fc6..0a01df99c27 100644 --- a/configure.in +++ b/configure.in @@ -928,6 +928,7 @@ AC_SUBST(have_union_semun) dnl Checks for libraries. APR_CHECK_DEFINE(LOCK_EX, sys/file.h) APR_CHECK_DEFINE(F_SETLK, fcntl.h) +APR_CHECK_DEFINE(SEM_UNDO, sys/sem.h) APR_CHECK_DEFINE(CODESET, langinfo.h) # We are assuming that if the platform doesn't have POLLIN, it doesn't have @@ -965,7 +966,7 @@ if test "$threads" = "1"; then fi # See which lock mechanisms we can support on this system. -APR_IFALLYES(func:semget func:semctl, hassysvser="1", hassysvser="0") +APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, hassysvser="1", hassysvser="0") APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1", hasflockser="0") APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1", hasfcntlser="0") APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, hasprocpthreadser="1", hasprocpthreadser="0") @@ -974,7 +975,7 @@ APR_IFALLYES(struct:pthread_rw, hasrwlockser="1", hasrwlockser="0") # See which lock mechanism we'll select by default on this system. # The last APR_DECIDE to execute sets the default APR_BEGIN_DECISION([apr_lock implementation method]) -APR_IFALLYES(func:semget func:semctl, +APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) APR_IFALLYES(func:flock define:LOCK_EX, APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) From 5f01cfec2385e0cdbe2df380299fa32cb70ce20f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 2 Jul 2001 19:36:44 +0000 Subject: [PATCH 1865/7878] get APR_SSIZE_T_FMT and APR_SIZE_T_FMT defined properly on Darwin git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61858 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.in b/configure.in index 0a01df99c27..5bccc2b246b 100644 --- a/configure.in +++ b/configure.in @@ -790,6 +790,10 @@ case "$OS" in ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' size_t_fmt='#define APR_SIZE_T_FMT "ld"' ;; + *apple-darwin*) + ssize_t_fmt='#define APR_SSIZE_T_FMT "d"' + size_t_fmt='#define APR_SIZE_T_FMT "lu"' + ;; esac AC_SUBST(short_value) From 244fbb71a734d81decfa5e29d1fbbab76af04e82 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 2 Jul 2001 20:17:11 +0000 Subject: [PATCH 1866/7878] include stdlib.h for malloc() and free() prototypes (Darwin) fix the DSO_USE_DYLD flavor of apr_dso_sym() so that it returns a predictable value on success (Darwin) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61859 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index ef9fc7773e6..726034c78b1 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -65,6 +65,9 @@ #ifdef HAVE_STDDEF_H #include #endif +#if APR_HAVE_STDLIB_H +#include /* malloc(), free() */ +#endif #if APR_HAVE_STRING_H #include /* for strerror() on HP-UX */ #endif @@ -205,7 +208,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, handle->errormsg = "cannot resolve symbol"; return APR_EINIT; } - + return APR_SUCCESS; #elif defined(DSO_USE_DLFCN) #if defined(DLSYM_NEEDS_UNDERSCORE) From 91b89717486bbe23311c3dcd858efddccb70baba Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 2 Jul 2001 20:31:44 +0000 Subject: [PATCH 1867/7878] set the int interprocess lock handle to -1 at init in case this helps keep straight what the caller of apr_os_lock_get() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61860 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/locks.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 06a7b583c0d..11898db8d22 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -241,6 +241,9 @@ apr_status_t apr_lock_create_np(apr_lock_t **lock, apr_locktype_e type, new->pool = pool; new->type = type; new->scope = scope; +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE + new->interproc = -1; +#endif if ((stat = create_lock(new, mech, fname)) != APR_SUCCESS) return stat; From ba06b2198d2a9a5020e8277872876332c5351938 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 2 Jul 2001 22:22:52 +0000 Subject: [PATCH 1868/7878] This adds another somewhat drastic debugging mode, but it has already found a problem in the ongoing work to get pools as sms working correctly. Essentially it should only be used if all else has failed as it records a lot of information to a file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61861 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 13 +++++++++++ memory/unix/apr_sms.c | 52 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/include/apr_sms.h b/include/apr_sms.h index 320066fc57d..a1af69c1fcc 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -135,6 +135,19 @@ extern "C" { */ #define APR_DEBUG_TAG_SMS 0 +/* APR_DEBUG_ALLOCATIONS + * This will record ALL calls made to + * apr_sms_malloc + * apr_sms_calloc + * apr_sms_realloc + * apr_sms_free + * Details are put into the file specified in the APR_DEBUG_ALLOC_FILE + * define + */ +#define APR_DEBUG_ALLOCATIONS 0 +#define APR_DEBUG_ALLOC_FILE "/tmp/sms_alloc" + + /** * @package APR memory system */ diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 72525cef9b6..602baeefc92 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -88,6 +88,37 @@ struct apr_sms_cleanup apr_status_t (*cleanup_fn)(void *); }; +#if APR_DEBUG_ALLOCATIONS +FILE *alloc_file = NULL; + +static void _record_(apr_sms_t *sms, const char *what, apr_size_t size, + void *ptr) +{ + if (!alloc_file) + return; + + if (ptr) { +#if APR_DEBUG_TAG_SMS + fprintf(alloc_file, "%10s %p '%9s' [%9s] @ %p\n", + what, sms, sms->tag, sms->identity, ptr); +#else + fprintf(alloc_file, "%10s %p [%9s] @ %p\n", + what, sms, sms->identity, ptr); +#endif + } else { +#if APR_DEBUG_TAG_SMS + fprintf(alloc_file, "%10s %p '%9s' [%9s] %6" APR_SIZE_T_FMT " bytes\n", + what, sms, sms->tag, sms->identity, size); +#else + fprintf(alloc_file, "%10s %p [%9s] %6" APR_SIZE_T_FMT " bytes\n", + what, sms, sms->identity, size); +#endif + } + fflush(alloc_file); +} +#endif + + /* * memory allocation functions */ @@ -98,6 +129,10 @@ APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *sms, if (size == 0) return NULL; +#if APR_DEBUG_ALLOCATIONS + _record_(sms, "MALLOC", size, NULL); +#endif + return sms->malloc_fn(sms, size); } @@ -107,12 +142,20 @@ APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *sms, if (size == 0) return NULL; +#if APR_DEBUG_ALLOCATIONS + _record_(sms, "CALLOC", size, NULL); +#endif + return sms->calloc_fn(sms, size); } APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *sms, void *mem, apr_size_t size) { +#if APR_DEBUG_ALLOCATIONS + _record_(sms, "REALLOC", size, NULL); +#endif + if (!mem) return apr_sms_malloc(sms, size); @@ -131,6 +174,11 @@ APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *sms, void *mem, APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *sms, void *mem) { + +#if APR_DEBUG_ALLOCATIONS + _record_(sms, "FREE", 0, mem); +#endif + if (sms->free_fn) return sms->free_fn(sms, mem); @@ -181,6 +229,10 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, #else dbg_file = stdout; #endif +#if APR_DEBUG_ALLOCATIONS + if (!alloc_file) + alloc_file = fopen(APR_DEBUG_ALLOC_FILE, "w"); +#endif /* XXX - I've assumed that memory passed in will be zeroed, * i.e. calloc'd instead of malloc'd... From 2c085c980b4134c021186ad5911b99f09cbd26fa Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 3 Jul 2001 11:07:28 +0000 Subject: [PATCH 1869/7878] First step in adding dynamic locking to sms. The framework now starts off without locking. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61862 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 27 +++++++++++++++ memory/unix/apr_sms.c | 62 ++++++++++++++++++++++++++++++++--- memory/unix/apr_sms_trivial.c | 36 ++++++++++++++++---- memory/unix/sms_private.h | 9 +++++ 4 files changed, 124 insertions(+), 10 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index a1af69c1fcc..825156e4854 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -68,6 +68,10 @@ #include "apr_pools.h" #include "apr_lock.h" +#if APR_HAS_THREADS +#include "apr_portable.h" +#endif /* APR_HAS_THREADS */ + #ifdef __cplusplus extern "C" { #endif @@ -347,6 +351,29 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms, APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, apr_int32_t type); +#if APR_HAS_THREADS +/** + * Register the specified thread with the sms + * @param sms The memory system the thread is to be registered with + * @param thread The thread to register + * @deffunc apr_status_t apr_sms_thread_register(apr_sms_t *sms, + * apr_os_thread_t thread); + */ +APR_DECLARE(apr_status_t) apr_sms_thread_register(apr_sms_t *sms, + apr_os_thread_t thread); + +/** + * Unregister a previously registered thread from the sms + * @param sms The memory system the thread is to be unregistered from + * @param thread The thread to unregister + * @deffunc apr_status_t apr_sms_thread_unregister(apr_sms_t *sms, + * apr_os_thread_t thread); + */ +APR_DECLARE(apr_status_t) apr_sms_thread_unregister(apr_sms_t *sms, + apr_os_thread_t thread); + +#endif /* APR_HAS_THREADS */ + /********************************************************************** ** Standard SMS module **********************************************************************/ diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 602baeefc92..e2f58913c48 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -287,6 +287,10 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, */ sms->calloc_fn = apr_sms_default_calloc; +#if APR_HAS_THREADS + sms->threads = 1; +#endif /* APR_HAS_THREADS */ + /* XXX - This should eventually be removed */ apr_pool_create(&sms->pool, pms ? pms->pool : NULL); @@ -304,10 +308,13 @@ APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms) apr_sms_assert(sms); - /* Create the sms framework lock we'll use. */ - rv = apr_lock_create(&sms->sms_lock, APR_MUTEX, APR_LOCKALL, - NULL, sms->pool); - + rv = APR_SUCCESS; + +#if APR_HAS_THREADS + if (sms->thread_register_fn) + rv = sms->thread_register_fn(sms, apr_os_thread_current()); +#endif /* APR_HAS_THREADS */ + #if APR_DEBUG_SHOW_FUNCTIONS fprintf(dbg_file, "CREATE - sms %p [%s] has been created\n", sms, sms->identity); @@ -831,6 +838,53 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, return rv; } +#if APR_HAS_THREADS +APR_DECLARE(apr_status_t) apr_sms_thread_register(apr_sms_t *sms, + apr_os_thread_t thread) +{ + do { + if (!sms->sms_lock) { + /* Create the sms framework lock we'll use. */ + apr_lock_create(&sms->sms_lock, APR_MUTEX, APR_LOCKALL, + NULL, sms->pool); + } + + apr_lock_acquire(sms->sms_lock); + + sms->threads++; + + /* let the sms know about the thread if it is + * interested (so it can protect its private + * data with its own lock) + */ + if (sms->thread_register_fn) + sms->thread_register_fn(sms, thread); + + apr_lock_release(sms->sms_lock); + + sms = sms->parent; + } while (sms); + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_sms_thread_unregister(apr_sms_t *sms, + apr_os_thread_t thread) +{ + if (sms->sms_lock) + apr_lock_acquire(sms->sms_lock); + + sms->threads--; + + /* Even if the thread count hits one, we don't destroy the + * lock for now + */ + + if (sms->sms_lock) + apr_lock_release(sms->sms_lock); +} +#endif /* APR_HAS_THREADS */ + APR_DECLARE(const char*) apr_sms_identity(apr_sms_t *sms) { return sms->identity; diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index e9dd9d2ef04..eb5477f2b32 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -387,6 +387,26 @@ static apr_status_t apr_sms_trivial_destroy(apr_sms_t *sms) return APR_SUCCESS; } +#if APR_HAS_THREADS +APR_DECLARE(apr_status_t) apr_sms_trivial_thread_register( + apr_sms_t *sms, + apr_os_thread_t thread) +{ + if (!SMS_TRIVIAL_T(sms)->lock && sms->threads > 1) + return apr_lock_create(&SMS_TRIVIAL_T(sms)->lock, + APR_MUTEX, APR_LOCKALL, + NULL, sms->pool); + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_sms_trivial_thread_unregister( + apr_sms_t *sms, + apr_os_thread_t thread) +{ + return APR_SUCCESS; +} +#endif /* APR_HAS_THREADS */ APR_DECLARE(apr_status_t) apr_sms_trivial_create(apr_sms_t **sms, apr_sms_t *pms) @@ -422,12 +442,16 @@ APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, if ((rv = apr_sms_init(new_sms, pms)) != APR_SUCCESS) return rv; - new_sms->malloc_fn = apr_sms_trivial_malloc; - new_sms->free_fn = apr_sms_trivial_free; - new_sms->reset_fn = apr_sms_trivial_reset; - new_sms->pre_destroy_fn = apr_sms_trivial_pre_destroy; - new_sms->destroy_fn = apr_sms_trivial_destroy; - new_sms->identity = module_identity; + new_sms->malloc_fn = apr_sms_trivial_malloc; + new_sms->free_fn = apr_sms_trivial_free; + new_sms->reset_fn = apr_sms_trivial_reset; + new_sms->pre_destroy_fn = apr_sms_trivial_pre_destroy; + new_sms->destroy_fn = apr_sms_trivial_destroy; +#if APR_HAS_THREADS + new_sms->thread_register_fn = apr_sms_trivial_thread_register; + new_sms->thread_unregister_fn = apr_sms_trivial_thread_unregister; +#endif /* APR_HAS_THREADS */ + new_sms->identity = module_identity; node = NODE_T((char *)new_sms + SIZEOF_SMS_TRIVIAL_T); node->first_avail = (char *)node + SIZEOF_NODE_T; diff --git a/memory/unix/sms_private.h b/memory/unix/sms_private.h index e90cd63ceda..5a9a86a51eb 100644 --- a/memory/unix/sms_private.h +++ b/memory/unix/sms_private.h @@ -59,6 +59,7 @@ #include "apr_errno.h" #include "apr_pools.h" #include "apr_lock.h" +#include "apr_portable.h" #ifdef __cplusplus extern "C" { @@ -92,6 +93,14 @@ struct apr_sms_t apr_status_t (*lock_fn) (apr_sms_t *sms); apr_status_t (*unlock_fn) (apr_sms_t *sms); +#if APR_HAS_THREADS + apr_status_t (*thread_register_fn) (apr_sms_t *sms, + apr_os_thread_t thread); + apr_status_t (*thread_unregister_fn) (apr_sms_t *sms, + apr_os_thread_t thread); + apr_uint16_t threads; +#endif /* APR_HAS_THREADS */ + #if APR_DEBUG_TAG_SMS const char *tag; #endif From 809390a4c1bfaddf664f46725bf774299886d281 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 3 Jul 2001 12:02:56 +0000 Subject: [PATCH 1870/7878] fix some apr_filepath_root() doc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61863 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index dd876931614..c4debc14b9e 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -302,7 +302,7 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); * APR_FILEPATH_TRUENAME Tests that the root exists, and makes it proper *
    * @param p the pool to allocate the new path string from - * @deffunc apr_status_t apr_filepath_root(const char **rootpath, const char **inpath, apr_pool_t *p) + * @deffunc apr_status_t apr_filepath_root(const char **rootpath, const char **inpath, apr_int32_t flags, apr_pool_t *p) * @tip on return, filepath points to the first non-root character in the * given filepath. In the simplest example, given a filepath of "/foo", * returns the rootpath of "/" and filepath points at "foo". This is far From 720ff234899a5a06c97f1332683a05b642e5fd1b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 3 Jul 2001 12:44:50 +0000 Subject: [PATCH 1871/7878] apr_sms_thread_unregister() needs to return something git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61864 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index e2f58913c48..67e8c634ded 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -882,6 +882,8 @@ APR_DECLARE(apr_status_t) apr_sms_thread_unregister(apr_sms_t *sms, if (sms->sms_lock) apr_lock_release(sms->sms_lock); + + return APR_SUCCESS; } #endif /* APR_HAS_THREADS */ From 2581b1a471cc7ed5431e4a557129680e88a760b6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 3 Jul 2001 12:55:26 +0000 Subject: [PATCH 1872/7878] apr_sms_trivial_thread_[un]register() got warnings since it was exported but had no prototype; I don't think it needs to be exported, so make it static git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61865 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_trivial.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index eb5477f2b32..6a68a842dd0 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -388,9 +388,9 @@ static apr_status_t apr_sms_trivial_destroy(apr_sms_t *sms) } #if APR_HAS_THREADS -APR_DECLARE(apr_status_t) apr_sms_trivial_thread_register( - apr_sms_t *sms, - apr_os_thread_t thread) +static apr_status_t apr_sms_trivial_thread_register( + apr_sms_t *sms, + apr_os_thread_t thread) { if (!SMS_TRIVIAL_T(sms)->lock && sms->threads > 1) return apr_lock_create(&SMS_TRIVIAL_T(sms)->lock, @@ -400,7 +400,7 @@ APR_DECLARE(apr_status_t) apr_sms_trivial_thread_register( return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_sms_trivial_thread_unregister( +static apr_status_t apr_sms_trivial_thread_unregister( apr_sms_t *sms, apr_os_thread_t thread) { From fe9ff77141c66d2e0a7677bedce934647887c32e Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 3 Jul 2001 13:58:43 +0000 Subject: [PATCH 1873/7878] Second pass at implementing dynamic locking in the sms code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61866 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 3 --- memory/unix/apr_sms.c | 11 ++++++++++ memory/unix/apr_sms_std.c | 28 +++++++++++++++++++----- memory/unix/apr_sms_tracking.c | 40 +++++++++++++++++++++++++++------- memory/unix/apr_sms_trivial.c | 6 ++--- 5 files changed, 68 insertions(+), 20 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index 825156e4854..0e69d36f41c 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -67,10 +67,7 @@ #include "apr_errno.h" #include "apr_pools.h" #include "apr_lock.h" - -#if APR_HAS_THREADS #include "apr_portable.h" -#endif /* APR_HAS_THREADS */ #ifdef __cplusplus extern "C" { diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 67e8c634ded..78ef885e94a 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -842,6 +842,8 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, APR_DECLARE(apr_status_t) apr_sms_thread_register(apr_sms_t *sms, apr_os_thread_t thread) { + apr_status_t rv; + do { if (!sms->sms_lock) { /* Create the sms framework lock we'll use. */ @@ -856,12 +858,21 @@ APR_DECLARE(apr_status_t) apr_sms_thread_register(apr_sms_t *sms, /* let the sms know about the thread if it is * interested (so it can protect its private * data with its own lock) + * + * if the sms is doesn't have a thread register + * function, or it wasn't able to register the + * thread, we should bomb out! + * XXX - not sure how to implement the bombing out */ + rv = APR_ENOTIMPL; if (sms->thread_register_fn) sms->thread_register_fn(sms, thread); apr_lock_release(sms->sms_lock); + if (rv != APR_SUCCESS) + return rv; + sms = sms->parent; } while (sms); diff --git a/memory/unix/apr_sms_std.c b/memory/unix/apr_sms_std.c index 628e0f1a317..44145c5ae3f 100644 --- a/memory/unix/apr_sms_std.c +++ b/memory/unix/apr_sms_std.c @@ -105,6 +105,20 @@ static apr_status_t apr_sms_std_free(apr_sms_t *sms, return APR_SUCCESS; } +#if APR_HAS_THREADS +static apr_status_t apr_sms_std_thread_register(apr_sms_t *sms, + apr_os_thread_t thread) +{ + return APR_SUCCESS; +} + +static apr_status_t apr_sms_std_thread_unregister(apr_sms_t *sms, + apr_os_thread_t thread) +{ + return APR_SUCCESS; +} +#endif /* APR_HAS_THREADS */ + APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms) { apr_sms_t *new_sms; @@ -122,11 +136,15 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms) if ((rv = apr_sms_init(new_sms, NULL)) != APR_SUCCESS) return rv; - new_sms->malloc_fn = apr_sms_std_malloc; - new_sms->calloc_fn = apr_sms_std_calloc; - new_sms->realloc_fn = apr_sms_std_realloc; - new_sms->free_fn = apr_sms_std_free; - new_sms->identity = module_identity; + new_sms->malloc_fn = apr_sms_std_malloc; + new_sms->calloc_fn = apr_sms_std_calloc; + new_sms->realloc_fn = apr_sms_std_realloc; + new_sms->free_fn = apr_sms_std_free; +#if APR_HAS_THREADS + new_sms->thread_register_fn = apr_sms_std_thread_register; + new_sms->thread_unregister_fn = apr_sms_std_thread_unregister; +#endif /* APR_HAS_THREADS */ + new_sms->identity = module_identity; /* as we're not a tracking memory module, i.e. we don't keep * track of our allocations, we don't have apr_sms_reset or diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c index 4b15903b289..8a38df5460e 100644 --- a/memory/unix/apr_sms_tracking.c +++ b/memory/unix/apr_sms_tracking.c @@ -89,6 +89,8 @@ typedef struct apr_sms_tracking_t apr_lock_t *lock; } apr_sms_tracking_t; +#define SMS_TRACKING_T(sms) ((apr_sms_tracking_t *)(sms)) + #define INSERT_NODE(node, tms) \ if (tms->lock) \ apr_lock_acquire(tms->lock); \ @@ -256,6 +258,24 @@ static apr_status_t apr_sms_tracking_destroy(apr_sms_t *sms) return apr_sms_free(sms->parent, sms); } +#if APR_HAS_THREADS +static apr_status_t apr_sms_tracking_thread_register(apr_sms_t *sms, + apr_os_thread_t thread) +{ + if (!SMS_TRACKING_T(sms)->lock && sms->threads > 1) + return apr_lock_create(&SMS_TRACKING_T(sms)->lock, + APR_MUTEX, APR_LOCKALL, + NULL, sms->pool); + return APR_SUCCESS; +} + +static apr_status_t apr_sms_tracking_thread_unregister(apr_sms_t *sms, + apr_os_thread_t thread) +{ + return APR_SUCCESS; +} +#endif /* APR_HAS_THREADS */ + APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **sms, apr_sms_t *pms) @@ -277,14 +297,18 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **sms, if ((rv = apr_sms_init(new_sms, pms)) != APR_SUCCESS) return rv; - new_sms->malloc_fn = apr_sms_tracking_malloc; - new_sms->calloc_fn = apr_sms_tracking_calloc; - new_sms->realloc_fn = apr_sms_tracking_realloc; - new_sms->free_fn = apr_sms_tracking_free; - new_sms->reset_fn = apr_sms_tracking_reset; - new_sms->pre_destroy_fn = apr_sms_tracking_pre_destroy; - new_sms->destroy_fn = apr_sms_tracking_destroy; - new_sms->identity = module_identity; + new_sms->malloc_fn = apr_sms_tracking_malloc; + new_sms->calloc_fn = apr_sms_tracking_calloc; + new_sms->realloc_fn = apr_sms_tracking_realloc; + new_sms->free_fn = apr_sms_tracking_free; + new_sms->reset_fn = apr_sms_tracking_reset; + new_sms->pre_destroy_fn = apr_sms_tracking_pre_destroy; + new_sms->destroy_fn = apr_sms_tracking_destroy; +#if APR_HAS_THREADS + new_sms->thread_register_fn = apr_sms_tracking_thread_register; + new_sms->thread_unregister_fn = apr_sms_tracking_thread_unregister; +#endif /* APR_HAS_THREADS */ + new_sms->identity = module_identity; tms = (apr_sms_tracking_t *)new_sms; tms->nodes = NULL; diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index 6a68a842dd0..ccede32af3e 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -388,8 +388,7 @@ static apr_status_t apr_sms_trivial_destroy(apr_sms_t *sms) } #if APR_HAS_THREADS -static apr_status_t apr_sms_trivial_thread_register( - apr_sms_t *sms, +static apr_status_t apr_sms_trivial_thread_register(apr_sms_t *sms, apr_os_thread_t thread) { if (!SMS_TRIVIAL_T(sms)->lock && sms->threads > 1) @@ -400,8 +399,7 @@ static apr_status_t apr_sms_trivial_thread_register( return APR_SUCCESS; } -static apr_status_t apr_sms_trivial_thread_unregister( - apr_sms_t *sms, +static apr_status_t apr_sms_trivial_thread_unregister(apr_sms_t *sms, apr_os_thread_t thread) { return APR_SUCCESS; From 4ba446bc1c4add3e0c2f273e945909fe3c3c80ea Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 3 Jul 2001 15:00:36 +0000 Subject: [PATCH 1874/7878] Noticed too late that I wasn't setting the return value in apr_sms_thread_register git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61867 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 78ef885e94a..8b0978181a7 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -866,7 +866,7 @@ APR_DECLARE(apr_status_t) apr_sms_thread_register(apr_sms_t *sms, */ rv = APR_ENOTIMPL; if (sms->thread_register_fn) - sms->thread_register_fn(sms, thread); + rv = sms->thread_register_fn(sms, thread); apr_lock_release(sms->sms_lock); From 1806b7de4753532ff5c348f392a125c8724c9575 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 3 Jul 2001 18:54:13 +0000 Subject: [PATCH 1875/7878] Cleaned up the tracking sms. Brought it into the same style as blocks and trivial. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61868 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_tracking.c | 178 ++++++++++++++------------------- 1 file changed, 74 insertions(+), 104 deletions(-) diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c index 8a38df5460e..047330d897d 100644 --- a/memory/unix/apr_sms_tracking.c +++ b/memory/unix/apr_sms_tracking.c @@ -76,155 +76,133 @@ static const char *module_identity = "TRACKING"; */ /* INTERNALLY USED STRUCTURES */ -typedef struct apr_track_node_t +typedef struct block_t { - struct apr_track_node_t *next; - struct apr_track_node_t **ref; -} apr_track_node_t; + struct block_t *next; + struct block_t **ref; +} block_t; typedef struct apr_sms_tracking_t { - apr_sms_t header; - apr_track_node_t *nodes; - apr_lock_t *lock; + apr_sms_t sms_hdr; + block_t *blocks; + apr_lock_t *lock; } apr_sms_tracking_t; -#define SMS_TRACKING_T(sms) ((apr_sms_tracking_t *)(sms)) +#define SIZEOF_BLOCK_T APR_ALIGN_DEFAULT(sizeof(block_t)) +#define SIZEOF_SMS_TRACKING_T APR_ALIGN_DEFAULT(sizeof(apr_sms_tracking_t)) -#define INSERT_NODE(node, tms) \ +#define BLOCK_T(sms) ((block_t *)(mem)) +#define SMS_TRACKING_T(sms) ((apr_sms_tracking_t *)(sms)) + +#define INSERT_BLOCK(block, tms) \ if (tms->lock) \ apr_lock_acquire(tms->lock); \ \ - node->ref = &tms->nodes; \ - if ((node->next = tms->nodes) != NULL) \ - node->next->ref = &node->next; \ - tms->nodes = node; \ + block->ref = &tms->blocks; \ + if ((block->next = tms->blocks) != NULL) \ + block->next->ref = &block->next; \ + tms->blocks = block; \ \ if (tms->lock) \ apr_lock_release(tms->lock); -#define REMOVE_NODE(node, tms) \ - if (tms->lock) \ - apr_lock_acquire(tms->lock); \ - \ - *(node->ref) = node->next; \ - if ((*(node->ref) = node->next) != NULL) \ - node->next->ref = node->ref; \ - \ - if (tms->lock) \ - apr_lock_release(tms->lock); +#define REMOVE_BLOCK(block, tms) \ + if (tms->lock) \ + apr_lock_acquire(tms->lock); \ + \ + *block->ref = block->next; \ + if ((*block->ref = block->next) != NULL) \ + block->next->ref = block->ref; \ + \ + if (tms->lock) \ + apr_lock_release(tms->lock); static void *apr_sms_tracking_malloc(apr_sms_t *sms, apr_size_t size) { - apr_sms_tracking_t *tms; - apr_track_node_t *node; + void *mem; - node = apr_sms_malloc(sms->parent, - size + sizeof(apr_track_node_t)); - if (!node) + size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; + mem = apr_sms_malloc(sms->parent, size); + if (!mem) return NULL; - tms = (apr_sms_tracking_t *)sms; - - INSERT_NODE(node, tms) + INSERT_BLOCK(BLOCK_T(mem), SMS_TRACKING_T(sms)) - node++; + mem = (char *)mem + SIZEOF_BLOCK_T; - return (void *)node; + return mem; } static void *apr_sms_tracking_calloc(apr_sms_t *sms, apr_size_t size) { - apr_sms_tracking_t *tms; - apr_track_node_t *node; - - node = apr_sms_calloc(sms->parent, - size + sizeof(apr_track_node_t)); - if (!node) - return NULL; + void *mem; - tms = (apr_sms_tracking_t *)sms; - - INSERT_NODE(node, tms) + size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; + mem = apr_sms_calloc(sms->parent, size); + if (!mem) + return NULL; - node++; + INSERT_BLOCK(BLOCK_T(mem), SMS_TRACKING_T(sms)) + + mem = (char *)mem + SIZEOF_BLOCK_T; - return (void *)node; + return mem; } static void *apr_sms_tracking_realloc(apr_sms_t *sms, void *mem, apr_size_t size) { - apr_sms_tracking_t *tms; - apr_track_node_t *node; - - tms = (apr_sms_tracking_t *)sms; - node = (apr_track_node_t *)mem; - - if (node) { - node--; + block_t *block; + + block = BLOCK_T((char *)mem - SIZEOF_BLOCK_T); - REMOVE_NODE(node, tms) - } + REMOVE_BLOCK(block, SMS_TRACKING_T(sms)) - node = apr_sms_realloc(sms->parent, - node, size + sizeof(apr_track_node_t)); - if (!node) + size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; + mem = apr_sms_realloc(sms->parent, block, size); + if (!mem) return NULL; - INSERT_NODE(node, tms) + INSERT_BLOCK(BLOCK_T(mem), SMS_TRACKING_T(sms)) - node++; + mem = (char *)mem + SIZEOF_BLOCK_T; - return (void *)node; + return mem; } static apr_status_t apr_sms_tracking_free(apr_sms_t *sms, void *mem) { - apr_track_node_t *node; - apr_sms_tracking_t *tms; - - node = (apr_track_node_t *)mem; - tms = (apr_sms_tracking_t *)sms; - - node--; + mem = (char *)mem - SIZEOF_BLOCK_T; - REMOVE_NODE(node, tms); + REMOVE_BLOCK(BLOCK_T(mem), SMS_TRACKING_T(sms)); - return apr_sms_free(sms->parent, node); + return apr_sms_free(sms->parent, mem); } static apr_status_t apr_sms_tracking_reset(apr_sms_t *sms) { - apr_sms_tracking_t *tms; - apr_track_node_t *node; - apr_status_t rv; + block_t *block; + apr_status_t rv = APR_SUCCESS; - tms = (apr_sms_tracking_t *)sms; - - if (tms->lock) - apr_lock_acquire(tms->lock); + if (SMS_TRACKING_T(sms)->lock) + apr_lock_acquire(SMS_TRACKING_T(sms)->lock); - while (tms->nodes) { - node = tms->nodes; - if ((*(node->ref) = node->next) != NULL) - node->next->ref = node->ref; - if ((rv = apr_sms_free(sms->parent, - node)) != APR_SUCCESS) { - if (tms->lock) { - apr_lock_release(tms->lock); - } - return rv; - } + while ((block = SMS_TRACKING_T(sms)->blocks) != NULL) { + if ((*block->ref = block->next) != NULL) + block->next->ref = block->ref; + + if ((rv = apr_sms_free(sms->parent, block)) != APR_SUCCESS) + break; } - if (tms->lock) - apr_lock_release(tms->lock); + if (SMS_TRACKING_T(sms)->lock) + apr_lock_release(SMS_TRACKING_T(sms)->lock); - return APR_SUCCESS; + return rv; } static apr_status_t apr_sms_tracking_pre_destroy(apr_sms_t *sms) @@ -235,14 +213,11 @@ static apr_status_t apr_sms_tracking_pre_destroy(apr_sms_t *sms) * neccesarily be called. To guarantee we destroy the lock it's therefore * destroyed here. */ - apr_sms_tracking_t *tms; - tms = (apr_sms_tracking_t *)sms; - - if (tms->lock) { - apr_lock_acquire(tms->lock); - apr_lock_destroy(tms->lock); - tms->lock = NULL; + if (SMS_TRACKING_T(sms)->lock) { + apr_lock_acquire(SMS_TRACKING_T(sms)->lock); + apr_lock_destroy(SMS_TRACKING_T(sms)->lock); + SMS_TRACKING_T(sms)->lock = NULL; } return APR_SUCCESS; @@ -281,7 +256,6 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **sms, apr_sms_t *pms) { apr_sms_t *new_sms; - apr_sms_tracking_t *tms; apr_status_t rv; *sms = NULL; @@ -289,7 +263,7 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **sms, * we allocate the memory for the structure from our parent. * This is safe as we shouldn't outlive our parent... */ - new_sms = apr_sms_calloc(pms, sizeof(apr_sms_tracking_t)); + new_sms = apr_sms_calloc(pms, SIZEOF_SMS_TRACKING_T); if (!new_sms) return APR_ENOMEM; @@ -310,12 +284,8 @@ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **sms, #endif /* APR_HAS_THREADS */ new_sms->identity = module_identity; - tms = (apr_sms_tracking_t *)new_sms; - tms->nodes = NULL; - apr_sms_post_init(new_sms); *sms = new_sms; return APR_SUCCESS; } - From ddcd4a6e9b5cb43ca567e330fcff794f6cf33861 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 4 Jul 2001 18:25:58 +0000 Subject: [PATCH 1876/7878] Added a realloc function. Releasing the lock earlier in reset. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61869 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_trivial.c | 68 ++++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index ccede32af3e..50696baf94f 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -108,10 +108,10 @@ typedef struct apr_sms_trivial_t #define MIN_ALLOC 0x2000 #define MIN_FREE 0x1000 -#define MAX_FREE 0x80000 +#define MAX_FREE 0x80000 static void *apr_sms_trivial_malloc(apr_sms_t *sms, - apr_size_t size) + apr_size_t size) { node_t *node, *sentinel; apr_size_t node_size; @@ -127,7 +127,7 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, if (node->avail_size >= size) { mem = node->first_avail; - node->avail_size -= size; + node->avail_size -= size; node->first_avail += size; node->count++; @@ -191,7 +191,7 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, */ node = SMS_TRIVIAL_T(sms)->used_sentinel.prev; node->first_avail += node->avail_size; - node->avail_size = 0; + node->avail_size = 0; if (SMS_TRIVIAL_T(sms)->lock) apr_lock_release(SMS_TRIVIAL_T(sms)->lock); @@ -219,6 +219,37 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, return mem; } +static apr_status_t apr_sms_trivial_free(apr_sms_t *sms, void *mem); + +static void *apr_sms_trivial_realloc(apr_sms_t *sms, void *mem, apr_size_t reqsize) +{ + void *new_mem; + apr_size_t size; + node_t *node; + char *endp; + + reqsize = APR_ALIGN_DEFAULT(reqsize); + + new_mem = apr_sms_trivial_malloc(sms, reqsize); + if (new_mem) { + node = BLOCK_T((char *)mem - SIZEOF_NODE_T)->node; + + endp = node->first_avail; + if (endp == (char *)node + SIZEOF_NODE_T) + endp += node->avail_size; + + size = endp - (char *)mem; + if (size > reqsize) + size = reqsize; + + memcpy(new_mem, mem, size); + } + + apr_sms_trivial_free(sms, mem); + + return new_mem; +} + static apr_status_t apr_sms_trivial_free(apr_sms_t *sms, void *mem) { node_t *node, *sentinel; @@ -271,14 +302,16 @@ static apr_status_t apr_sms_trivial_free(apr_sms_t *sms, void *mem) static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) { - node_t *node, *prev, *used_sentinel, *free_sentinel; + node_t *node, *prev, *used_sentinel, *free_sentinel, *free_list; apr_size_t min_alloc, max_free; - if (SMS_TRIVIAL_T(sms)->lock) - apr_lock_acquire(SMS_TRIVIAL_T(sms)->lock); - used_sentinel = &SMS_TRIVIAL_T(sms)->used_sentinel; free_sentinel = &SMS_TRIVIAL_T(sms)->free_sentinel; + + free_list = NULL; + + if (SMS_TRIVIAL_T(sms)->lock) + apr_lock_acquire(SMS_TRIVIAL_T(sms)->lock); node = SMS_TRIVIAL_T(sms)->self; node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); @@ -319,10 +352,7 @@ static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) SMS_TRIVIAL_T(sms)->max_free = max_free; used_sentinel->prev->next = NULL; - while ((node = used_sentinel->next) != NULL) { - used_sentinel->next = node->next; - apr_sms_free(sms->parent, node); - } + free_list = used_sentinel->next; } else { node = used_sentinel->prev; @@ -341,6 +371,11 @@ static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) if (SMS_TRIVIAL_T(sms)->lock) apr_lock_release(SMS_TRIVIAL_T(sms)->lock); + while ((node = free_list) != NULL) { + free_list = node->next; + apr_sms_free(sms->parent, node); + } + return APR_SUCCESS; } @@ -441,6 +476,7 @@ APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, return rv; new_sms->malloc_fn = apr_sms_trivial_malloc; + new_sms->realloc_fn = apr_sms_trivial_realloc; new_sms->free_fn = apr_sms_trivial_free; new_sms->reset_fn = apr_sms_trivial_reset; new_sms->pre_destroy_fn = apr_sms_trivial_pre_destroy; @@ -457,10 +493,10 @@ APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, node->count = 0; tms = SMS_TRIVIAL_T(new_sms); - tms->min_alloc = min_alloc; - tms->min_free = min_free; - tms->max_free = max_free; - tms->self = node; + tms->min_alloc = min_alloc; + tms->min_free = min_free; + tms->max_free = max_free; + tms->self = node; node->next = node->prev = &tms->used_sentinel; tms->used_sentinel.next = tms->used_sentinel.prev = node; From 9de131fdd8fe0674fa884e610a49ac4168879bc9 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 4 Jul 2001 18:44:00 +0000 Subject: [PATCH 1877/7878] Remove a bunch of warning from the trivial sms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61870 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_trivial.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index 50696baf94f..bdf143a0f08 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -441,17 +441,11 @@ static apr_status_t apr_sms_trivial_thread_unregister(apr_sms_t *sms, } #endif /* APR_HAS_THREADS */ -APR_DECLARE(apr_status_t) apr_sms_trivial_create(apr_sms_t **sms, - apr_sms_t *pms) -{ - return apr_sms_trivial_create_ex(sms, pms, MIN_ALLOC, MIN_FREE, MAX_FREE); -} - -APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, - apr_sms_t *pms, - apr_size_t min_alloc, - apr_size_t min_free, - apr_size_t max_free) +static apr_status_t apr_sms_trivial_create_ex(apr_sms_t **sms, + apr_sms_t *pms, + apr_size_t min_alloc, + apr_size_t min_free, + apr_size_t max_free) { apr_sms_t *new_sms; apr_sms_trivial_t *tms; @@ -507,3 +501,11 @@ APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, *sms = new_sms; return APR_SUCCESS; } + + +APR_DECLARE(apr_status_t) apr_sms_trivial_create(apr_sms_t **sms, + apr_sms_t *pms) +{ + return apr_sms_trivial_create_ex(sms, pms, MIN_ALLOC, MIN_FREE, MAX_FREE); +} + From 7a4c30276a59ecc094387090a7cb795adec8b704 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 4 Jul 2001 20:27:22 +0000 Subject: [PATCH 1878/7878] Sander pointed out that this is declared in the header file and it should be exported, so export it once again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61871 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_trivial.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index bdf143a0f08..bfe9d511447 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -229,8 +229,9 @@ static void *apr_sms_trivial_realloc(apr_sms_t *sms, void *mem, apr_size_t reqsi char *endp; reqsize = APR_ALIGN_DEFAULT(reqsize); - + new_mem = apr_sms_trivial_malloc(sms, reqsize); + if (new_mem) { node = BLOCK_T((char *)mem - SIZEOF_NODE_T)->node; @@ -441,11 +442,11 @@ static apr_status_t apr_sms_trivial_thread_unregister(apr_sms_t *sms, } #endif /* APR_HAS_THREADS */ -static apr_status_t apr_sms_trivial_create_ex(apr_sms_t **sms, - apr_sms_t *pms, - apr_size_t min_alloc, - apr_size_t min_free, - apr_size_t max_free) +APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, + apr_sms_t *pms, + apr_size_t min_alloc, + apr_size_t min_free, + apr_size_t max_free) { apr_sms_t *new_sms; apr_sms_trivial_t *tms; From 259378baee8492928027960e608dba3a0de403fe Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 4 Jul 2001 22:11:44 +0000 Subject: [PATCH 1879/7878] Change the way we do the cleanups slightly. We now have just 2 basic types and when we do a run_cleanups we only remove the APR_GENERAL_CLEANUP, in the same way as the pools code does. This keeps us much more in sync but still offers the potential to improve upon the cleanups. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61872 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 5 ++--- memory/unix/apr_sms.c | 10 ++++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index 0e69d36f41c..c3badc19440 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -79,9 +79,8 @@ extern "C" { **********************************************************************/ /* The various types of cleanup's we can offer */ -#define APR_ALL_CLEANUPS 0x0000 -#define APR_CHILD_CLEANUP 0x0001 -#define APR_PARENT_CLEANUP 0x0002 +#define APR_GENERAL_CLEANUP 0x0001 +#define APR_CHILD_CLEANUP 0x0002 /* Alignment macro's * diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 8b0978181a7..dc1b2e323c6 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -397,7 +397,9 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *sms) static void apr_sms_do_cleanups(struct apr_sms_cleanup *c) { while (c) { - c->cleanup_fn(c->data); + if (c->type == APR_GENERAL_CLEANUP) { + c->cleanup_fn(c->data); + } c = c->next; } } @@ -725,7 +727,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms, cleanup = sms->cleanups; cleanup_ref = &sms->cleanups; while (cleanup) { - if ((type == APR_ALL_CLEANUPS || cleanup->type == type) && + if (cleanup->type == type && cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) { *cleanup_ref = cleanup->next; @@ -763,7 +765,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *sms, cleanup_ref = &sms->cleanups; sms = sms->accounting; while (cleanup) { - if (type == APR_ALL_CLEANUPS || cleanup->type == type) { + if (cleanup->type == type) { *cleanup_ref = cleanup->next; if (sms->free_fn) @@ -814,7 +816,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, cleanup_ref = &sms->cleanups; sms = sms->accounting; while (cleanup) { - if (type == APR_ALL_CLEANUPS || cleanup->type == type) { + if (cleanup->type == type) { *cleanup_ref = cleanup->next; cleanup->cleanup_fn(cleanup->data); From 01e57d85cfb99a674a0b247a6f281f1039422d97 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 4 Jul 2001 23:28:54 +0000 Subject: [PATCH 1880/7878] Fixed a stupid typo that caused the realloc to segfault. Moved the realloc so we don't need a forward declaration. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61873 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_trivial.c | 62 +++++++++++++++++------------------ 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index bfe9d511447..e50aa6ceba5 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -219,38 +219,6 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, return mem; } -static apr_status_t apr_sms_trivial_free(apr_sms_t *sms, void *mem); - -static void *apr_sms_trivial_realloc(apr_sms_t *sms, void *mem, apr_size_t reqsize) -{ - void *new_mem; - apr_size_t size; - node_t *node; - char *endp; - - reqsize = APR_ALIGN_DEFAULT(reqsize); - - new_mem = apr_sms_trivial_malloc(sms, reqsize); - - if (new_mem) { - node = BLOCK_T((char *)mem - SIZEOF_NODE_T)->node; - - endp = node->first_avail; - if (endp == (char *)node + SIZEOF_NODE_T) - endp += node->avail_size; - - size = endp - (char *)mem; - if (size > reqsize) - size = reqsize; - - memcpy(new_mem, mem, size); - } - - apr_sms_trivial_free(sms, mem); - - return new_mem; -} - static apr_status_t apr_sms_trivial_free(apr_sms_t *sms, void *mem) { node_t *node, *sentinel; @@ -301,6 +269,36 @@ static apr_status_t apr_sms_trivial_free(apr_sms_t *sms, void *mem) return APR_SUCCESS; } +static void *apr_sms_trivial_realloc(apr_sms_t *sms, void *mem, apr_size_t reqsize) +{ + void *new_mem; + apr_size_t size; + node_t *node; + char *endp; + + reqsize = APR_ALIGN_DEFAULT(reqsize); + + new_mem = apr_sms_trivial_malloc(sms, reqsize); + + if (new_mem) { + node = BLOCK_T((char *)mem - SIZEOF_BLOCK_T)->node; + + endp = node->first_avail; + if (endp == (char *)node + SIZEOF_NODE_T) + endp += node->avail_size; + + size = endp - (char *)mem; + if (size > reqsize) + size = reqsize; + + memcpy(new_mem, mem, size); + } + + apr_sms_trivial_free(sms, mem); + + return new_mem; +} + static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) { node_t *node, *prev, *used_sentinel, *free_sentinel, *free_list; From f045fafa5917c421038044320d8d6ce439247c28 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 5 Jul 2001 00:02:10 +0000 Subject: [PATCH 1881/7878] Stop trying to provide cross-process pthread mutexes on systems where the form of shared memory used with this code isn't available. This gets APR_HAS_PROC_PTHREAD_SERIALIZE set to 0 on (at least) HP-UX and OS/390. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61874 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 19 +++++++++++++++++++ configure.in | 9 +++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 017af4641fd..4bd4133cd8d 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -224,6 +224,25 @@ AC_DEFUN(APR_CHECK_APR_DEFINE,[ ], ac_cv_define_$1=yes, ac_cv_define_$1=no) ]) +define(APR_CHECK_FILE,[ +ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(ac_cv_file_$ac_safe, [ + if test -r $1; then + eval "ac_cv_file_$ac_safe=yes" + else + eval "ac_cv_file_$ac_safe=no" + fi +])dnl +if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) +ifelse([$3], , , [$3]) +fi +]) + define(APR_IFALLYES,[dnl ac_rc=yes for ac_spec in $1; do diff --git a/configure.in b/configure.in index 5bccc2b246b..c904a3130b2 100644 --- a/configure.in +++ b/configure.in @@ -912,6 +912,7 @@ dnl #----------------------------- Checking for Locking Characteristics echo $ac_n "${nl}Checking for Locking...${nl}" AC_CHECK_FUNCS(semget semctl flock) +APR_CHECK_FILE(/dev/zero) # It's stupid, but not all platforms have union semun, even those that need it. AC_MSG_CHECKING(for union semun in sys/sem.h) @@ -973,7 +974,10 @@ fi APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, hassysvser="1", hassysvser="0") APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1", hasflockser="0") APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1", hasfcntlser="0") -APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, hasprocpthreadser="1", hasprocpthreadser="0") +# note: the current APR use of shared mutex requires /dev/zero +APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl + func:pthread_mutexattr_setpshared file:/dev/zero, + hasprocpthreadser="1", hasprocpthreadser="0") APR_IFALLYES(struct:pthread_rw, hasrwlockser="1", hasrwlockser="0") # See which lock mechanism we'll select by default on this system. @@ -983,8 +987,9 @@ APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) APR_IFALLYES(func:flock define:LOCK_EX, APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) +# note: the current APR use of shared mutex requires /dev/zero APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl - func:pthread_mutexattr_setpshared, + func:pthread_mutexattr_setpshared file:/dev/zero, APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) APR_IFALLYES(header:fcntl.h define:F_SETLK, APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) From d05baacc38cde7866081588ef2db0773138955dd Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 5 Jul 2001 00:41:12 +0000 Subject: [PATCH 1882/7878] We seemed to have jumped the gun a bit in a previous commit. The problem we saw was fixed, but with the previous patch we lost functionality. Putting that back in. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61875 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 7 ++++--- memory/unix/apr_sms.c | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index c3badc19440..39f5a6c93f6 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -79,6 +79,7 @@ extern "C" { **********************************************************************/ /* The various types of cleanup's we can offer */ +#define APR_ALL_CLEANUPS 0x0000 #define APR_GENERAL_CLEANUP 0x0001 #define APR_CHILD_CLEANUP 0x0002 @@ -87,7 +88,7 @@ extern "C" { * APR_ALIGN is only to be used to align on a power of 2 boundary */ #define APR_ALIGN(size, boundary) \ - (((size) + ((boundary) - 1)) & ~ ((boundary) -1)) + (((size) + ((boundary) - 1)) & ~((boundary) - 1)) #define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) @@ -109,7 +110,7 @@ extern "C" { * using the APR_DEBUG_FILE define. Normally this is set to setdout * and the output is simply printed there. */ -#define APR_DEBUG_TO_FILE 0 +#define APR_DEBUG_TO_FILE 0 #define APR_DEBUG_FILE "/tmp/sms_debug" /* APR_DEBUG_SHOW_STRUCTURE @@ -403,7 +404,7 @@ APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction); * @param tag The tag to give the sms * @param sms The sms to apply the tag to */ -APR_DECLARE(void) apr_sms_tag(const char*tag, apr_sms_t *sms); +APR_DECLARE(void) apr_sms_tag(const char *tag, apr_sms_t *sms); #endif /* APR_DEBUG_TAG_SMS */ #ifdef __cplusplus diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index dc1b2e323c6..f89f5d7b5f4 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -397,7 +397,7 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *sms) static void apr_sms_do_cleanups(struct apr_sms_cleanup *c) { while (c) { - if (c->type == APR_GENERAL_CLEANUP) { + if (c->type == APR_ALL_CLEANUPS || c->type == APR_GENERAL_CLEANUP) { c->cleanup_fn(c->data); } c = c->next; @@ -727,7 +727,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms, cleanup = sms->cleanups; cleanup_ref = &sms->cleanups; while (cleanup) { - if (cleanup->type == type && + if ((type == APR_ALL_CLEANUPS || cleanup->type == type) && cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) { *cleanup_ref = cleanup->next; @@ -765,7 +765,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *sms, cleanup_ref = &sms->cleanups; sms = sms->accounting; while (cleanup) { - if (cleanup->type == type) { + if (type == APR_ALL_CLEANUPS || cleanup->type == type) { *cleanup_ref = cleanup->next; if (sms->free_fn) @@ -816,7 +816,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, cleanup_ref = &sms->cleanups; sms = sms->accounting; while (cleanup) { - if (cleanup->type == type) { + if (type == APR_ALL_CLEANUPS || cleanup->type == type) { *cleanup_ref = cleanup->next; cleanup->cleanup_fn(cleanup->data); From a43d3b8bb6534e7638cec6264aa7566aad5e9ae9 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 5 Jul 2001 23:32:50 +0000 Subject: [PATCH 1883/7878] Added a cleanup type check that was missed earlier on. Swapped the arguments to apr_sms_tag. The sms is now the first argument, like in the rest of the functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61876 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 2 +- memory/unix/apr_sms.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index 39f5a6c93f6..3735084c10c 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -404,7 +404,7 @@ APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction); * @param tag The tag to give the sms * @param sms The sms to apply the tag to */ -APR_DECLARE(void) apr_sms_tag(const char *tag, apr_sms_t *sms); +APR_DECLARE(void) apr_sms_tag(apr_sms_t *sms, const char *tag); #endif /* APR_DEBUG_TAG_SMS */ #ifdef __cplusplus diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index f89f5d7b5f4..97587175ecb 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -564,7 +564,9 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms) cleanup = sms->cleanups; while (cleanup) { - cleanup->cleanup_fn(cleanup->data); + if (cleanup->type == APR_GENERAL_CLEANUP) + cleanup->cleanup_fn(cleanup->data); + next_cleanup = cleanup->next; apr_sms_free(sms->accounting, cleanup); cleanup = next_cleanup; @@ -688,13 +690,12 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms, if (sms->sms_lock) apr_lock_acquire(sms->sms_lock); - cleanup = (struct apr_sms_cleanup *) - apr_sms_malloc(sms->accounting, - sizeof(struct apr_sms_cleanup)); + cleanup = apr_sms_malloc(sms->accounting, sizeof(struct apr_sms_cleanup)); - if (!cleanup){ + if (!cleanup) { if (sms->sms_lock) apr_lock_release(sms->sms_lock); + return APR_ENOMEM; } @@ -1021,7 +1022,7 @@ APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction) #endif /* APR_DEBUG_SHOW_STRUCTURE */ #if APR_DEBUG_TAG_SMS -APR_DECLARE(void) apr_sms_tag(const char *tag, apr_sms_t *sms) +APR_DECLARE(void) apr_sms_tag(apr_sms_t *sms, const char *tag) { sms->tag = tag; } From 5f7131184cefb6fc7149459d507d7204f0a33b6a Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 6 Jul 2001 01:03:22 +0000 Subject: [PATCH 1884/7878] No code changes. Just documentation updates from my review of the code. May help others. Reviewed by: Sander Striker git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61877 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_trivial.c | 65 +++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 18 deletions(-) diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index e50aa6ceba5..977ba06cd55 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -65,9 +65,11 @@ static const char *module_identity = "TRIVIAL"; /* * Simple trivial memory system + * + * The goal of this SMS is to make malloc and reset operations as efficient + * as possible. */ - /* INTERNALLY USED STRUCTURES */ typedef struct block_t @@ -104,8 +106,14 @@ typedef struct apr_sms_trivial_t #define NODE_T(mem) ((node_t *)(mem)) #define SMS_TRIVIAL_T(sms) ((apr_sms_trivial_t *)(sms)) -/* Magic numbers :) */ - +/* Magic numbers :) + * MIN_ALLOC defines the floor of how many bytes we will ask our parent for + * MIN_FREE defines how many extra bytes we will allocate when asking the + * the system for memory. + * MAX_FREE defines how many bytes the SMS may hold at one time. If it + * exceeds this value, it will return memory to the parent SMS. + * (note that this implementation counts down to 0) + */ #define MIN_ALLOC 0x2000 #define MIN_FREE 0x1000 #define MAX_FREE 0x80000 @@ -144,7 +152,10 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); node->first_avail = (char *)node + SIZEOF_NODE_T; - /* browse the free list for a useable block */ + /* browse the free list for a useable block. Note that we set the + * sentinel to be the size we are looking for - so, we'll have to + * stop when we hit the sentinel again. + */ sentinel = &SMS_TRIVIAL_T(sms)->free_sentinel; sentinel->avail_size = size; @@ -153,6 +164,7 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, node = node->next; if (node != sentinel) { + /* Remove from chain of free nodes and add it to used chain */ node->prev->next = node->next; node->next->prev = node->prev; @@ -161,7 +173,8 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, node->prev->next = node; node->next = sentinel; sentinel->prev = node; - + + /* We are no longer free, so increase available free mem. */ if (node != SMS_TRIVIAL_T(sms)->self) SMS_TRIVIAL_T(sms)->max_free += node->avail_size; @@ -178,27 +191,28 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, return mem; } - - /* we have to allocate a new block from our parent */ + + /* We couldn't find any used or free node that had enough space, + * so we have to allocate a new block from our parent. + */ node_size = size + SMS_TRIVIAL_T(sms)->min_free; if (node_size < SMS_TRIVIAL_T(sms)->min_alloc) node_size = SMS_TRIVIAL_T(sms)->min_alloc; node = apr_sms_malloc(sms->parent, node_size); if (!node) { - /* restore the 'last' node, so the next allocation - * will not segfault - */ + /* restore the 'last' node, so next allocation will not segfault */ node = SMS_TRIVIAL_T(sms)->used_sentinel.prev; node->first_avail += node->avail_size; node->avail_size = 0; - + if (SMS_TRIVIAL_T(sms)->lock) apr_lock_release(SMS_TRIVIAL_T(sms)->lock); return NULL; } + /* Add the new node to the used chain. */ sentinel = &SMS_TRIVIAL_T(sms)->used_sentinel; node->prev = sentinel->prev; node->prev->next = node; @@ -312,32 +326,42 @@ static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) if (SMS_TRIVIAL_T(sms)->lock) apr_lock_acquire(SMS_TRIVIAL_T(sms)->lock); + /* Always reset our base node as this can't be reclaimed. */ node = SMS_TRIVIAL_T(sms)->self; node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); node->first_avail = (char *)node + SIZEOF_NODE_T; node->count = 0; node->prev->next = node->next; node->next->prev = node->prev; - + + /* used_sentinel->prev may be currently "active", so disable it. */ node = used_sentinel->prev; node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); node->first_avail = (char *)node + SIZEOF_NODE_T; if (sms->parent->free_fn) { + /* We only reserve max_free bytes. The rest will be passed to the + * parent SMS to be freed. + */ min_alloc = SMS_TRIVIAL_T(sms)->min_alloc; max_free = SMS_TRIVIAL_T(sms)->max_free; + used_sentinel->avail_size = min_alloc; + while (max_free > min_alloc) { if (node->avail_size <= max_free) { if (node == used_sentinel) break; - + /* These are the nodes that will NOT be freed, but + * placed on the free list for later reuse. + */ max_free -= node->avail_size; + node->prev->next = node->next; node->next->prev = node->prev; - + prev = node->prev; - + node->next = free_sentinel->next; free_sentinel->next = node; node->next->prev = node; @@ -346,14 +370,18 @@ static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) node = prev; } else - node = node->prev; + node = node->prev; /* Will be reclaimed. */ } + + /* Remember that when sms->max_free hits zero, we free everything. */ SMS_TRIVIAL_T(sms)->max_free = max_free; - + + /* Anything remaining on the used_sentinel list will be freed. */ used_sentinel->prev->next = NULL; free_list = used_sentinel->next; } else { + /* Everything we have allocated goes into free_sentinel. */ node = used_sentinel->prev; node->next = free_sentinel->next; node->next->prev = node; @@ -362,7 +390,8 @@ static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) node->prev = free_sentinel; free_sentinel->next = node; } - + + /* Reset used_sentinel to just be the originally allocated node. */ node = SMS_TRIVIAL_T(sms)->self; node->next = node->prev = used_sentinel; used_sentinel->next = used_sentinel->prev = node; From 76829b77f759368aae9c1a50ee537ace8d4f1ca7 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 6 Jul 2001 14:20:03 +0000 Subject: [PATCH 1885/7878] Win32: Add apr_os_thread_current() Submitted by: Ian Holsman Reviewed by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61878 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/thread.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 047a68a9429..131ee228f1a 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -177,6 +177,11 @@ APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); } +APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) +{ + return GetCurrentThread(); +} + APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { From 62af4b37844fc24bf35eb06ec32fae165a0e8888 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sat, 7 Jul 2001 02:51:43 +0000 Subject: [PATCH 1886/7878] Document what the function passed to apr_table_[v]do() should return to indicate whether iteration should continue. Submitted by: Joe Orton Reviewed by: Cliff Woolley git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61879 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index fcb2a446390..db2c1be37b8 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -366,7 +366,7 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, * element in the table. If there is data passed in as a vararg, then the * function is only run on those element's whose key matches something in * the vararg. If the vararg is NULL, then every element is run through the - * function. + * function. Iteration continues while the function returns non-zero. * @param comp The function to run * @param rec The data to pass as the first argument to the function * @param t The table to iterate over @@ -383,7 +383,7 @@ APR_DECLARE_NONSTD(void) apr_table_do(int (*comp)(void *, const char *, const ch * element in the table. If there is data passed in as a vararg, then the * function is only run on those element's whose key matches something in * the vararg. If the vararg is NULL, then every element is run through the - * function. + * function. Iteration continues while the function returns non-zero. * @param comp The function to run * @param rec The data to pass as the first argument to the function * @param t The table to iterate over From 86558b208041987ba86c45df4ee5f5e607af6be2 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 06:34:58 +0000 Subject: [PATCH 1887/7878] Add some documentation for the os_thread functions recently added and fix the #ifdef's around them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61880 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 06ff8f36056..0022ad7eea1 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -409,12 +409,23 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **dso, APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso, apr_dso_handle_t *aprdso); +#endif /* APR_HAS_DSO */ + #if APR_HAS_THREADS +/** + * Get the thread ID + */ APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void); -APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2); -#endif -#endif /* APR_HAS_DSO */ +/** + * Compare two thread id's + * @param tid1 1st Thread ID to compare + * @param tid2 2nd Thread ID to compare + */ +APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, + apr_os_thread_t tid2); +#endif /* APR_HAS_THREADS */ + #ifdef __cplusplus } From 286d804ae634a5a602d4e21ac4f3125ce13072b9 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 06:42:23 +0000 Subject: [PATCH 1888/7878] Move the thread registration functions from the apr_sms header into the portable header as this seems a more logical place for them given they use apr_os_thread_t. This also simplify's the build process ordering in certain situations. BTW, do we still need to add the @deffunc lines as we don't seem to have been doing in some places. Is this a scandoc change Ben? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61881 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 18 +++++++++++++++++- include/apr_sms.h | 23 ----------------------- memory/unix/apr_sms.c | 1 + 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 0022ad7eea1..94d4c93dc62 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -424,8 +424,24 @@ APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void); */ APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2); -#endif /* APR_HAS_THREADS */ +/** + * Register the specified thread with an sms + * @param sms The SMS to register with + * @param thread The thread to register + */ +APR_DECLARE(apr_status_t) apr_sms_thread_register(apr_sms_t *sms, + apr_os_thread_t thread); + +/** + * Unregister a thread from an sms + * @param sms The sms to unregister from + * @param thread The thread to be unregistered + */ +APR_DECLARE(apr_status_t) apr_sms_thread_unregister(apr_sms_t *sms, + apr_os_thread_t thread); + +#endif /* APR_HAS_THREADS */ #ifdef __cplusplus } diff --git a/include/apr_sms.h b/include/apr_sms.h index 3735084c10c..1b005ae00c5 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -348,29 +348,6 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms, APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, apr_int32_t type); -#if APR_HAS_THREADS -/** - * Register the specified thread with the sms - * @param sms The memory system the thread is to be registered with - * @param thread The thread to register - * @deffunc apr_status_t apr_sms_thread_register(apr_sms_t *sms, - * apr_os_thread_t thread); - */ -APR_DECLARE(apr_status_t) apr_sms_thread_register(apr_sms_t *sms, - apr_os_thread_t thread); - -/** - * Unregister a previously registered thread from the sms - * @param sms The memory system the thread is to be unregistered from - * @param thread The thread to unregister - * @deffunc apr_status_t apr_sms_thread_unregister(apr_sms_t *sms, - * apr_os_thread_t thread); - */ -APR_DECLARE(apr_status_t) apr_sms_thread_unregister(apr_sms_t *sms, - apr_os_thread_t thread); - -#endif /* APR_HAS_THREADS */ - /********************************************************************** ** Standard SMS module **********************************************************************/ diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 97587175ecb..fa5e2bf3afe 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -65,6 +65,7 @@ #include "apr_sms.h" #include #include "sms_private.h" +#include "apr_portable.h" #ifdef APR_ASSERT_MEMORY #include From ae4bbf29b6fbc7ede54a72362c596428ec48a8fe Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 06:51:23 +0000 Subject: [PATCH 1889/7878] Constify the data in the sms cleanups. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61882 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 25 +++++++++++++++++-------- memory/unix/apr_sms.c | 16 ++++++++-------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index 1b005ae00c5..57e5850de0e 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -291,10 +291,12 @@ APR_DECLARE(apr_sms_t *) apr_sms_get_parent(apr_sms_t *sms); * @param cleanup_fn The function to call when the memory system is reset or * destroyed * @deffunc void apr_sms_cleanup_register(apr_sms_t *sms, apr_int32_t type, - * void *data, apr_status_t (*cleanup_fn)(void *)); + * const void *data, + * apr_status_t (*cleanup_fn)(void *)); */ -APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms, apr_int32_t type, - void *data, +APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms, + apr_int32_t type, + const void *data, apr_status_t (*cleanup_fn)(void *)); /** @@ -302,13 +304,17 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms, apr_int32_t t * @param sms The memory system the cleanup function is registered * with * @param type The type of the cleanup to unregister + * @param type The type of cleanup to run * @param data The data associated with the cleanup function * @param cleanup_fn The registered cleanup function * @deffunc void apr_sms_cleanup_unregister(apr_sms_t *sms, - * void *data, apr_status_t (*cleanup_fn)(void *)); + * apr_int32_t type, + * const void *data, + * apr_status_t (*cleanup_fn)(void *)); */ -APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms, apr_int32_t type, - void *data, +APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms, + apr_int32_t type, + const void *data, apr_status_t (*cleanup)(void *)); /** @@ -331,10 +337,13 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *sms, * @param data The data associated with the cleanup function * @param cleanup The registered cleanup function * @deffunc apr_status_t apr_sms_cleanup_run(apr_sms_t *sms, - * apr_int32_t type, void *data, apr_status_t (*cleanup)(void *)); + * apr_int32_t type, + * const void *data, + * apr_status_t (*cleanup)(void *)); */ APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms, - apr_int32_t type, void *data, + apr_int32_t type, + const void *data, apr_status_t (*cleanup)(void *)); /** diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index fa5e2bf3afe..859006a9e6f 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -85,7 +85,7 @@ struct apr_sms_cleanup { struct apr_sms_cleanup *next; apr_int32_t type; - void *data; + const void *data; apr_status_t (*cleanup_fn)(void *); }; @@ -399,7 +399,7 @@ static void apr_sms_do_cleanups(struct apr_sms_cleanup *c) { while (c) { if (c->type == APR_ALL_CLEANUPS || c->type == APR_GENERAL_CLEANUP) { - c->cleanup_fn(c->data); + c->cleanup_fn((void*)c->data); } c = c->next; } @@ -566,7 +566,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms) while (cleanup) { if (cleanup->type == APR_GENERAL_CLEANUP) - cleanup->cleanup_fn(cleanup->data); + cleanup->cleanup_fn((void*)cleanup->data); next_cleanup = cleanup->next; apr_sms_free(sms->accounting, cleanup); @@ -679,7 +679,7 @@ APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *sms) APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms, apr_int32_t type, - void *data, + const void *data, apr_status_t (*cleanup_fn)(void *)) { @@ -715,7 +715,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms, APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms, apr_int32_t type, - void *data, + const void *data, apr_status_t (*cleanup_fn)(void *)) { @@ -791,7 +791,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *sms, APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms, apr_int32_t type, - void *data, + const void *data, apr_status_t (*cleanup_fn)(void *)) { @@ -801,7 +801,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms, data, cleanup_fn)) != APR_SUCCESS) return rv; - return cleanup_fn(data); + return cleanup_fn((void*)data); } APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, @@ -821,7 +821,7 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, if (type == APR_ALL_CLEANUPS || cleanup->type == type) { *cleanup_ref = cleanup->next; - cleanup->cleanup_fn(cleanup->data); + cleanup->cleanup_fn((void*)cleanup->data); if (sms->free_fn) apr_sms_free(sms, cleanup); From 36e04dfc12b2f4c024cf17bc30d55cebc434b07f Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 06:53:16 +0000 Subject: [PATCH 1890/7878] Fix the _np lock define for beos... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61883 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.in b/configure.in index c904a3130b2..59c9b799a06 100644 --- a/configure.in +++ b/configure.in @@ -1030,6 +1030,10 @@ case "$OS" in # but we don't want to use it when we have native locks lockcreatenp="0" ;; + *-beos*) + # This applies to beos as well + lockcreatenp="0" + ;; esac AC_SUBST(hasflockser) From 1afbd7614d314f881c293d7d5736faea675ae83d Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 07:17:32 +0000 Subject: [PATCH 1891/7878] So I think I've moved apr_pools.c succesfully, so now we'll build it in it's new location, memory/unix. The lib directory is now no longer touched during a build so I guess the files in there (apr_pools.c and apr_signal.c) can be removed at some point. I haven't removed apr_pools.c as I wanted to be sure that that the move was OK first! Just call me yellow :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61884 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- lib/Makefile.in | 2 +- memory/unix/Makefile.in | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 59c9b799a06..b4cdbef98c6 100644 --- a/configure.in +++ b/configure.in @@ -1227,8 +1227,8 @@ AC_SUBST(LIBTOOL_LIBS) AC_SUBST(LOCAL_MM_LIB) echo "${nl}Construct Makefiles and header files." -MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile build/Makefile" -SUBDIRS="lib strings passwd tables " +MAKEFILE1="Makefile strings/Makefile passwd/Makefile tables/Makefile build/Makefile" +SUBDIRS="strings passwd tables " for dir in $apr_modules do test -d $dir || $MKDIR $dir diff --git a/lib/Makefile.in b/lib/Makefile.in index 1169f7418fc..d3da7c5d652 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -1,5 +1,5 @@ -TARGETS = apr_pools.lo +TARGETS = # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/memory/unix/Makefile.in b/memory/unix/Makefile.in index f2e3e0a0dc4..7d57f23cb92 100644 --- a/memory/unix/Makefile.in +++ b/memory/unix/Makefile.in @@ -3,7 +3,8 @@ TARGETS = apr_sms.lo \ apr_sms_std.lo \ apr_sms_tracking.lo \ apr_sms_blocks.lo \ - apr_sms_trivial.lo + apr_sms_trivial.lo \ + apr_pools.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ From 05e5b2a597be1b487d9483d071018995cf87ba96 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 07:21:14 +0000 Subject: [PATCH 1892/7878] As far as Sander and I can tell the num_bytes functions are debug only and not used anywhere in the apache code, so they should be hidden behind the pool debug checks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61885 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index e5a523b5392..75debc4297d 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -941,6 +941,12 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) free_blocks(blok); } + +/***************************************************************** + * APR_POOL_DEBUG support + */ +#ifdef APR_POOL_DEBUG + APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse) { apr_size_t total_bytes = bytes_in_block_list(p->first); @@ -957,11 +963,6 @@ APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void) return bytes_in_block_list(block_freelist); } -/***************************************************************** - * APR_POOL_DEBUG support - */ -#ifdef APR_POOL_DEBUG - /* the unix linker defines this symbol as the last byte + 1 of * the executable... so it includes TEXT, BSS, and DATA */ From 916002329ac70828ca2ac7e3db606883e156ac4e Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 07:49:16 +0000 Subject: [PATCH 1893/7878] s/cont/pool/g Saw this when debugging and thought it should be fixed. :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61886 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 2 +- tables/apr_tables.c | 54 ++++++++++++++++++++++---------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index db2c1be37b8..ff6deff36de 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -85,7 +85,7 @@ typedef struct apr_array_header_t apr_array_header_t; /** An opaque array type */ struct apr_array_header_t { /** The pool the array is allocated out of */ - apr_pool_t *cont; + apr_pool_t *pool; /** The amount of memory allocated for each element of the array */ int elt_size; /** The number of active elements in the array */ diff --git a/tables/apr_tables.c b/tables/apr_tables.c index b2cf518db17..cbd6f5dafea 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -88,7 +88,7 @@ * The 'array' functions... */ -static void make_array_core(apr_array_header_t *res, apr_pool_t *c, +static void make_array_core(apr_array_header_t *res, apr_pool_t *p, int nelts, int elt_size) { /* @@ -99,9 +99,9 @@ static void make_array_core(apr_array_header_t *res, apr_pool_t *c, nelts = 1; } - res->elts = apr_pcalloc(c, nelts * elt_size); + res->elts = apr_pcalloc(p, nelts * elt_size); - res->cont = c; + res->pool = p; res->elt_size = elt_size; res->nelts = 0; /* No active elements yet... */ res->nalloc = nelts; /* ...but this many allocated */ @@ -123,7 +123,7 @@ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr) int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2; char *new_data; - new_data = apr_pcalloc(arr->cont, arr->elt_size * new_size); + new_data = apr_pcalloc(arr->pool, arr->elt_size * new_size); memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size); arr->elts = new_data; @@ -147,7 +147,7 @@ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, new_size *= 2; } - new_data = apr_pcalloc(dst->cont, elt_size * new_size); + new_data = apr_pcalloc(dst->pool, elt_size * new_size); memcpy(new_data, dst->elts, dst->nalloc * elt_size); dst->elts = new_data; @@ -192,7 +192,7 @@ APR_DECLARE(apr_array_header_t *) apr_array_header_t *res; res = (apr_array_header_t *) apr_palloc(p, sizeof(apr_array_header_t)); - res->cont = p; + res->pool = p; copy_array_hdr_core(res, arr); return res; } @@ -357,7 +357,7 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, for (i = 0; i < t->a.nelts; ) { if (!strcasecmp(elts[i].key, key)) { if (!done) { - elts[i].val = apr_pstrdup(t->a.cont, val); + elts[i].val = apr_pstrdup(t->a.pool, val); done = 1; ++i; } @@ -376,8 +376,8 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, if (!done) { elts = (apr_table_entry_t *) table_push(t); - elts->key = apr_pstrdup(t->a.cont, key); - elts->val = apr_pstrdup(t->a.cont, val); + elts->key = apr_pstrdup(t->a.pool, key); + elts->val = apr_pstrdup(t->a.pool, val); } } @@ -390,11 +390,11 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.cont)) { + if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.cont)) { + if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.pool)) { fprintf(stderr, "table_set: val not in ancestor pool of t\n"); abort(); } @@ -461,14 +461,14 @@ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, for (i = 0; i < t->a.nelts; ++i) { if (!strcasecmp(elts[i].key, key)) { - elts[i].val = apr_pstrcat(t->a.cont, elts[i].val, ", ", val, NULL); + elts[i].val = apr_pstrcat(t->a.pool, elts[i].val, ", ", val, NULL); return; } } elts = (apr_table_entry_t *) table_push(t); - elts->key = apr_pstrdup(t->a.cont, key); - elts->val = apr_pstrdup(t->a.cont, val); + elts->key = apr_pstrdup(t->a.pool, key); + elts->val = apr_pstrdup(t->a.pool, val); } APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, @@ -479,11 +479,11 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.cont)) { + if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.cont)) { + if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } @@ -492,7 +492,7 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, for (i = 0; i < t->a.nelts; ++i) { if (!strcasecmp(elts[i].key, key)) { - elts[i].val = apr_pstrcat(t->a.cont, elts[i].val, ", ", val, NULL); + elts[i].val = apr_pstrcat(t->a.pool, elts[i].val, ", ", val, NULL); return; } } @@ -508,8 +508,8 @@ APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; elts = (apr_table_entry_t *) table_push(t); - elts->key = apr_pstrdup(t->a.cont, key); - elts->val = apr_pstrdup(t->a.cont, val); + elts->key = apr_pstrdup(t->a.pool, key); + elts->val = apr_pstrdup(t->a.pool, val); } APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, @@ -519,11 +519,11 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.cont)) { + if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.cont)) { + if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } @@ -546,12 +546,12 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, * overlay->a.pool and base->a.pool have a life span at least * as long as p */ - if (!apr_pool_is_ancestor(overlay->a.cont, p)) { + if (!apr_pool_is_ancestor(overlay->a.pool, p)) { fprintf(stderr, "overlay_tables: overlay's pool is not an ancestor of p\n"); abort(); } - if (!apr_pool_is_ancestor(base->a.cont, p)) { + if (!apr_pool_is_ancestor(base->a.pool, p)) { fprintf(stderr, "overlay_tables: base's pool is not an ancestor of p\n"); abort(); @@ -560,7 +560,7 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, res = apr_palloc(p, sizeof(apr_table_t)); /* behave like append_arrays */ - res->a.cont = p; + res->a.pool = p; copy_array_hdr_core(&res->a, &overlay->a); apr_array_cat(&res->a, &base->a); @@ -686,7 +686,7 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, /* XXX: could use scratch free space in a or b's pool instead... * which could save an allocation in b's pool. */ - cat_keys = apr_palloc(b->a.cont, sizeof(overlap_key) * nkeys); + cat_keys = apr_palloc(b->a.pool, sizeof(overlap_key) * nkeys); } nkeys = 0; @@ -721,7 +721,7 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, */ a->a.nelts = 0; if (a->a.nalloc < nkeys) { - a->a.elts = apr_palloc(a->a.cont, a->a.elt_size * nkeys * 2); + a->a.elts = apr_palloc(a->a.pool, a->a.elt_size * nkeys * 2); a->a.nalloc = nkeys * 2; } @@ -763,7 +763,7 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, } while (right < last && !strcasecmp(left->key, right->key)); /* right points one past the last header to merge */ - value = apr_palloc(a->a.cont, len + 1); + value = apr_palloc(a->a.pool, len + 1); strp = value; for (;;) { memcpy(strp, left->val, left->order); From 786a62ef18cbe45c69001749a40234cd4664efb4 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 07:51:48 +0000 Subject: [PATCH 1894/7878] This basically adds - tag debugging support - simple test of heirachy building in sms following some problems we had. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61887 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmem.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/test/testmem.c b/test/testmem.c index 7cff3360a89..acdc3b26203 100644 --- a/test/testmem.c +++ b/test/testmem.c @@ -437,7 +437,8 @@ int main(int argc, char **argv) apr_sms_t *ams, *bms, *dms, *tms; apr_pool_t *pool; int i; - + apr_sms_t *lsms[10]; + apr_initialize(); printf("APR Memory Test\n"); @@ -455,6 +456,14 @@ int main(int argc, char **argv) STD_TEST_NEQ(" Creating a trivial system", apr_sms_trivial_create(&tms, ams)) +/* if we're using tag's then add them :) */ +#if APR_DEBUG_TAG_SMS + apr_sms_tag("top-level", ams); + apr_sms_tag("tracking", bms); + apr_sms_tag("blocks", dms); + apr_sms_tag("trivial", tms); +#endif + its_a_pool(pool, &t[0], "Pool code", 1); its_an_sms(ams, &t[1], "Standard sms", 1); t[1].reset_fn = NULL; @@ -511,7 +520,7 @@ int main(int argc, char **argv) exit(-1); } print_timed_results(); - + printf("Destroying the memory...\n"); STD_TEST_NEQ("Trying to destroy the trivial memory system", @@ -520,6 +529,15 @@ int main(int argc, char **argv) apr_sms_destroy(bms)) STD_TEST_NEQ("Trying to destroy the block memory system", apr_sms_destroy(dms)) + + printf("Testing layering...\n"); + apr_sms_tracking_create(&lsms[0], ams); + for (i=1;i<5;i++) { + apr_sms_tracking_create(&lsms[i], lsms[i-1]); + } + for (i=5;i<10;i++) { + apr_sms_tracking_create(&lsms[i], lsms[4]); + } STD_TEST_NEQ("Trying to destroy the standard memory system", apr_sms_destroy(ams)) From 5124097b13aaa909345ed9e6cbb09b083b889aef Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 07:55:18 +0000 Subject: [PATCH 1895/7878] Add a simple test that creates a number of sockets of different types and carries out a very simple sendto/recvfrom test. At some point we really should review all the network test apps we have and try to reduce the number. OTOH it's good that we can test so many aspects of our networking support :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61888 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 3 + test/testsockets.c | 152 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 test/testsockets.c diff --git a/test/Makefile.in b/test/Makefile.in index af31e41cb47..4c3ec35cab3 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -126,4 +126,7 @@ testmem@EXEEXT@: testmem.lo $(LOCAL_LIBS) teststr@EXEEXT@: teststr.lo $(LOCAL_LIBS) $(LINK) teststr.lo $(LOCAL_LIBS) $(ALL_LIBS) +testsockets@EXEEXT@: testsockets.lo $(LOCAL_LIBS) + $(LINK) testsockets.lo $(LOCAL_LIBS) $(ALL_LIBS) + # DO NOT REMOVE diff --git a/test/testsockets.c b/test/testsockets.c new file mode 100644 index 00000000000..8fc74b9374d --- /dev/null +++ b/test/testsockets.c @@ -0,0 +1,152 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include +#include +#include +#include +#include "apr_network_io.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "test_apr.h" + +#if APR_HAVE_IPV6 +#define US "::1" +#else +#define US "127.0.0.1" +#endif + +static void closeapr(void) +{ + apr_terminate(); +} + +static void close_sock(apr_socket_t *sock) +{ + STD_TEST_NEQ(" Closing socket", apr_socket_close(sock)) +} + +#define STRLEN 21 + +int main(void) +{ + apr_pool_t *pool; + apr_socket_t *sock = NULL, *sock2 = NULL; + apr_sockaddr_t *from; + apr_sockaddr_t *to; + apr_size_t len = 30; + char sendbuf[STRLEN] = "APR_INET, SOCK_DGRAM"; + char recvbuf[80]; + char *ip_addr; + apr_port_t fromport; + int family = APR_INET6; + + STD_TEST_NEQ("Initializing APR", apr_initialize()) + + atexit(closeapr); + STD_TEST_NEQ("Creating 1st pool", apr_pool_create(&pool, NULL)) + + printf("Testing socket creation functions.\n"); + + STD_TEST_NEQ(" Creating a TCP socket", + apr_socket_create(&sock, APR_INET, SOCK_STREAM, pool)) + close_sock(sock); + + STD_TEST_NEQ(" Creating UDP socket", + apr_socket_create(&sock, APR_INET, SOCK_DGRAM, pool)) + close_sock(sock); + +#if APR_HAVE_IPV6 + STD_TEST_NEQ(" Creating an IPv6 TCP socket", + apr_socket_create(&sock, APR_INET6, SOCK_STREAM, pool)) + close_sock(sock); + + STD_TEST_NEQ(" Creating an IPv6 UDP socket", + apr_socket_create(&sock, APR_INET6, SOCK_DGRAM, pool)) + close_sock(sock); +#else + printf("NO IPv6 support.\n"); +#endif + + printf("Now trying sendto/recvfrom (simple tests only)\n"); + + STD_TEST_NEQ(" Creating socket #1 for test", + apr_socket_create(&sock, family, SOCK_DGRAM, pool)) + STD_TEST_NEQ(" Creating socket #2 for test", + apr_socket_create(&sock2, family, SOCK_DGRAM, pool)) + + apr_sockaddr_info_get(&to, US, APR_UNSPEC, 7772, 0, pool); + apr_sockaddr_info_get(&from, US, APR_UNSPEC, 7771, 0, pool); + + STD_TEST_NEQ(" Binding socket #1", apr_bind(sock, to)) + STD_TEST_NEQ(" Binding socket #2", apr_bind(sock2, from)) + + len = STRLEN; + + STD_TEST_NEQ(" Trying to sendto", + apr_sendto(sock2, to, 0, sendbuf, &len)) + len = 80; + STD_TEST_NEQ(" Trying to recvfrom", + apr_recvfrom(from, sock, 0, recvbuf, &len)) + printf("\t\tGot back %d bytes [%s] from recvfrom\n", len, recvbuf); + apr_sockaddr_ip_get(&ip_addr, from); + apr_sockaddr_port_get(&fromport, from); + printf("\t\tData came from %s:%u\n", ip_addr, fromport); + + close_sock(sock); + close_sock(sock2); + + return 1; +} From 45d511e812f195758436d5d4f7460ea38732fea5 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 12:26:32 +0000 Subject: [PATCH 1896/7878] Add the abort function into sms. This is largely to keep compatability with pools and at present we don't do anything more than get/set, but that's easily fixed. Question is, do we still want this capability? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61889 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 50 +++++++++++++++-------------------- memory/unix/apr_sms.c | 10 +++++++ memory/unix/apr_sms_trivial.c | 1 + memory/unix/sms_private.h | 2 ++ 4 files changed, 35 insertions(+), 28 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index 57e5850de0e..b5863cb8356 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -166,7 +166,6 @@ typedef struct apr_sms_t apr_sms_t; * @param size The (minimal required) size of the block to be allocated * @return pointer to a newly allocated block of memory, NULL if insufficient * memory available - * @deffunc void *apr_sms_malloc(apr_sms_t *sms, apr_size_t size) */ APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *sms, apr_size_t size); @@ -176,7 +175,6 @@ APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *sms, apr_size_t size); * @param size The (minimal required) size of the block to be allocated * @return pointer to a newly allocated block of memory, NULL if insufficient * memory available - * @deffunc void *apr_sms_calloc(apr_sms_t *sms, apr_size_t size) */ APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *sms, apr_size_t size); @@ -189,7 +187,6 @@ APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *sms, apr_size_t size); * @param size The (minimal required) size of the block to be allocated * @return pointer to a newly allocated block of memory, NULL if insufficient * memory available - * @deffunc void *apr_sms_realloc(apr_sms_t *sms, void *mem, apr_size_t size) */ APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *sms, void *mem, apr_size_t size); @@ -198,7 +195,6 @@ APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *sms, void *mem, apr_size_t size); * @param sms The memory system to use (should be the same as the * one that returned the block) * @param mem The block of memory to be freed - * @deffunc void apr_sms_free(apr_sms_t *sms, void *mem) */ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *sms, void *mem); @@ -212,7 +208,6 @@ APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *sms, void *mem); * Check if a memory system is obeying all rules. * @caution Call this function as the last statement before returning a new * memory system from your apr_xxx_sms_create. - * @deffunc void apr_sms_validate(apr_sms_t *sms) */ APR_DECLARE(void) apr_sms_assert(apr_sms_t *sms); #else @@ -229,7 +224,6 @@ APR_DECLARE(void) apr_sms_assert(apr_sms_t *sms); * for the given memory system (i.e. the memory system is non- * tracking). * @param sms The memory system to be reset - * @deffunc apr_status_t apr_sms_reset(apr_sms_t *sms) */ APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *sms); @@ -239,7 +233,6 @@ APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *sms); * @caution Be carefull when using this function with a non-tracking memory * system * @param sms The memory system to be destroyed - * @deffunc apr_status_t apr_sms_destroy(apr_sms_t *sms) */ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms); @@ -261,17 +254,14 @@ APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *sms); * @param a The memory system to search * @param b The memory system to search for * @return APR_SUCCESS if a is an ancestor of b, 1 if it isn't - * @deffunc apr_status_t apr_sms_is_ancestor(apr_sms_t *a, - * apr_sms_t *b) */ APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a, apr_sms_t *b); /** * Get the memory_system identity - * @param sms The memory system to use - * @deffunc const char * apr_sms_identity(apr_sms_t *sms); + * @param sms The memory system to identify */ -APR_DECLARE(const char *) apr_sms_identity(apr_sms_t *sms); +APR_DECLARE(const char *) apr_sms_get_identity(apr_sms_t *sms); /** * Get the parent sms @@ -279,6 +269,26 @@ APR_DECLARE(const char *) apr_sms_identity(apr_sms_t *sms); */ APR_DECLARE(apr_sms_t *) apr_sms_get_parent(apr_sms_t *sms); +/** + * Set the abort function. This is called when we fail to + * fulfil an allocation request. + * @tip If an app wants APR to exit on a memory allocation error + * then this function can be called to set the callback to + * use. If this function is not called then APR will return an error + * and expect the app to deal with it. + * @param abortfunc The function to call + * @param sms The sms to register the function with + */ +APR_DECLARE(void) apr_sms_set_abort(apr_abortfunc_t abortfunc, + apr_sms_t *sms); + +/** + * Get the abort function registered with the sms. + * @param sms The sms to get the function for + * @return The abort function registered + */ +APR_DECLARE(apr_abortfunc_t) apr_sms_get_abort(apr_sms_t *sms); + /* * memory system cleanup management functions */ @@ -290,9 +300,6 @@ APR_DECLARE(apr_sms_t *) apr_sms_get_parent(apr_sms_t *sms); * @param data The data to pass to the cleanup function * @param cleanup_fn The function to call when the memory system is reset or * destroyed - * @deffunc void apr_sms_cleanup_register(apr_sms_t *sms, apr_int32_t type, - * const void *data, - * apr_status_t (*cleanup_fn)(void *)); */ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms, apr_int32_t type, @@ -307,10 +314,6 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms, * @param type The type of cleanup to run * @param data The data associated with the cleanup function * @param cleanup_fn The registered cleanup function - * @deffunc void apr_sms_cleanup_unregister(apr_sms_t *sms, - * apr_int32_t type, - * const void *data, - * apr_status_t (*cleanup_fn)(void *)); */ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms, apr_int32_t type, @@ -322,8 +325,6 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms, * @param sms The memory system the cleanup functions are registered with * @param type The type associated with the cleanup function. Pass 0 to * unregister all cleanup functions. - * @deffunc apr_status_t apr_sms_cleanup_unregister_type(apr_sms_t *sms, - * apr_int32_t type); */ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *sms, apr_int32_t type); @@ -336,10 +337,6 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *sms, * @param type The type associated with the cleanup function. Pass 0 to ignore type. * @param data The data associated with the cleanup function * @param cleanup The registered cleanup function - * @deffunc apr_status_t apr_sms_cleanup_run(apr_sms_t *sms, - * apr_int32_t type, - * const void *data, - * apr_status_t (*cleanup)(void *)); */ APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms, apr_int32_t type, @@ -351,8 +348,6 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms, * @param sms The memory system the cleanup functions are registered with * @param type The category of cleanup functions to run. Pass 0 to run all * cleanup functions. - * @deffunc apr_status_t apr_sms_cleanup_run_type(apr_sms_t *sms, - * apr_int32_t type); */ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, apr_int32_t type); @@ -364,7 +359,6 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, /** * Create a standard malloc/realloc/free memory system * @param sms A pointer to the created apr_sms_t* - * @deffunc apr_status_t apr_sms_std_create(apr_sms_t **sms); */ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms); diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 859006a9e6f..ed2a5a12ac6 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -912,6 +912,16 @@ APR_DECLARE(apr_sms_t *) apr_sms_get_parent(apr_sms_t *sms) return sms->parent; } +APR_DECLARE(void) apr_sms_set_abort(apr_abortfunc_t abort, apr_sms_t *sms) +{ + sms->apr_abort = abort; +} + +APR_DECLARE(apr_abortfunc_t) apr_sms_get_abort(apr_sms_t *sms) +{ + return sms->apr_abort; +} + #if APR_DEBUG_SHOW_STRUCTURE static void add_sms(char *a, char *b, char *c, apr_sms_t *sms, apr_sms_t *caller, int sib) diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index 977ba06cd55..20e5c7c6871 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -441,6 +441,7 @@ static apr_status_t apr_sms_trivial_destroy(apr_sms_t *sms) node = tms->used_sentinel.next; while (node) { next = node->next; + apr_sms_free(sms->parent, node); node = next; } diff --git a/memory/unix/sms_private.h b/memory/unix/sms_private.h index 5a9a86a51eb..c753bc93e68 100644 --- a/memory/unix/sms_private.h +++ b/memory/unix/sms_private.h @@ -93,6 +93,8 @@ struct apr_sms_t apr_status_t (*lock_fn) (apr_sms_t *sms); apr_status_t (*unlock_fn) (apr_sms_t *sms); + apr_status_t (*apr_abort)(int retcode); + #if APR_HAS_THREADS apr_status_t (*thread_register_fn) (apr_sms_t *sms, apr_os_thread_t thread); From 7ea1c52f03ffdf181753fddfd54c1d44ccdec774 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 13:03:46 +0000 Subject: [PATCH 1897/7878] Few changes, mainly to add more support for sms :) - add apr_sms_userdata_get/set routines - change testcontext into testud as all it does is test user data - add a test for sms user data into testud - remove testcontext as we haven't been calling our memory contexts for a very long time now :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61890 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 21 ++++++++++++++ memory/unix/apr_sms.c | 36 ++++++++++++++++++++++- memory/unix/sms_private.h | 1 + test/Makefile.in | 6 ++-- test/{testcontext.c => testud.c} | 50 ++++++++++++++++++-------------- 5 files changed, 89 insertions(+), 25 deletions(-) rename test/{testcontext.c => testud.c} (71%) diff --git a/include/apr_sms.h b/include/apr_sms.h index b5863cb8356..37342d192b0 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -289,6 +289,27 @@ APR_DECLARE(void) apr_sms_set_abort(apr_abortfunc_t abortfunc, */ APR_DECLARE(apr_abortfunc_t) apr_sms_get_abort(apr_sms_t *sms); +/** + * Set user data into the current sms. + * @param data The user data to insert + * @param key The key to assign to this data + * @param cleanup The cleanup program to use when cleaning up the data + * @param sms The sms to inert the data into + */ +APR_DECLARE(apr_status_t) apr_sms_userdata_set(const void *data, + const char *key, + apr_status_t (*cleanup)(void*), + apr_sms_t *sms); + +/** + * Get user data from an sms using the key it was registered with + * @param data A pointer to the returned data + * @param key The key to use to identify the data + * @param sms The sms to get the data from + */ +APR_DECLARE(apr_status_t) apr_sms_userdata_get(void **data, const char *key, + apr_sms_t *sms); + /* * memory system cleanup management functions */ diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index ed2a5a12ac6..5e7657f5c20 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -64,9 +64,12 @@ #include "apr_general.h" #include "apr_sms.h" #include -#include "sms_private.h" +#include "apr_hash.h" +#include "apr_strings.h" #include "apr_portable.h" +#include "sms_private.h" + #ifdef APR_ASSERT_MEMORY #include #endif @@ -922,6 +925,37 @@ APR_DECLARE(apr_abortfunc_t) apr_sms_get_abort(apr_sms_t *sms) return sms->apr_abort; } +APR_DECLARE(apr_status_t) apr_sms_userdata_set(const void *data, + const char *key, + apr_status_t (*cleanup)(void*), + apr_sms_t *sms) +{ + apr_size_t keylen = strlen(key); + + if (sms->prog_data == NULL) + sms->prog_data = apr_hash_make(sms->pool); + + if (apr_hash_get(sms->prog_data, key, keylen) == NULL) { + char *new_key = apr_pstrdup((apr_pool_t*)sms->pool, key); + apr_hash_set(sms->prog_data, new_key, keylen, data); + } else { + apr_hash_set(sms->prog_data, key, keylen, data); + } + + apr_sms_cleanup_register(sms, APR_GENERAL_CLEANUP, data, cleanup); + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_sms_userdata_get(void **data, const char *key, + apr_sms_t *sms) +{ + if (sms->prog_data == NULL) + *data = NULL; + else + *data = apr_hash_get(sms->prog_data, key, strlen(key)); + return APR_SUCCESS; +} + #if APR_DEBUG_SHOW_STRUCTURE static void add_sms(char *a, char *b, char *c, apr_sms_t *sms, apr_sms_t *caller, int sib) diff --git a/memory/unix/sms_private.h b/memory/unix/sms_private.h index c753bc93e68..ddd4d880d7f 100644 --- a/memory/unix/sms_private.h +++ b/memory/unix/sms_private.h @@ -94,6 +94,7 @@ struct apr_sms_t apr_status_t (*unlock_fn) (apr_sms_t *sms); apr_status_t (*apr_abort)(int retcode); + struct apr_hash_t *prog_data; #if APR_HAS_THREADS apr_status_t (*thread_register_fn) (apr_sms_t *sms, diff --git a/test/Makefile.in b/test/Makefile.in index 4c3ec35cab3..dce1df23216 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -13,7 +13,7 @@ PROGRAMS = \ testlock@EXEEXT@ \ testtime@EXEEXT@ \ testargs@EXEEXT@ \ - testcontext@EXEEXT@ \ + testud@EXEEXT@ \ testmmap@EXEEXT@ \ testshmem@EXEEXT@ \ testpipe@EXEEXT@ \ @@ -69,8 +69,8 @@ mod_test.so: mod_test.lo $(LOCAL_LIBS) testargs@EXEEXT@: testargs.lo $(LOCAL_LIBS) $(LINK) testargs.lo $(LOCAL_LIBS) $(ALL_LIBS) -testcontext@EXEEXT@: testcontext.lo $(LOCAL_LIBS) - $(LINK) testcontext.lo $(LOCAL_LIBS) $(ALL_LIBS) +testud@EXEEXT@: testud.lo $(LOCAL_LIBS) + $(LINK) testud.lo $(LOCAL_LIBS) $(ALL_LIBS) testproc@EXEEXT@: testproc.lo $(LOCAL_LIBS) $(LINK) testproc.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/testcontext.c b/test/testud.c similarity index 71% rename from test/testcontext.c rename to test/testud.c index 18688123e1f..eff25509865 100644 --- a/test/testcontext.c +++ b/test/testud.c @@ -59,9 +59,8 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" -#ifdef BEOS -#include -#endif +#include "apr_sms.h" +#include "test_apr.h" static apr_status_t string_cleanup(void *data) { @@ -70,33 +69,42 @@ static apr_status_t string_cleanup(void *data) int main(void) { - apr_pool_t *context; + apr_pool_t *pool; + apr_sms_t *sms; char *testdata; char *retdata; - if (apr_initialize() != APR_SUCCESS) { - fprintf(stderr, "Couldn't initialize."); - exit(-1); - } + printf("APR User Data Test\n==================\n\n"); + + STD_TEST_NEQ("Initializing APR", apr_initialize()) atexit(apr_terminate); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - fprintf(stderr, "Couldn't allocate context."); - exit(-1); - } + STD_TEST_NEQ("Creating a pool", apr_pool_create(&pool, NULL)) + STD_TEST_NEQ("Creating an sms", apr_sms_std_create(&sms)) - testdata = apr_pstrdup(context, "This is a test\n"); + testdata = apr_pstrdup(pool, "This is a test\n"); - apr_pool_userdata_set(testdata, "TEST", string_cleanup, context); + printf("Testing pool\n"); + STD_TEST_NEQ(" Setting user data into the pool", + apr_pool_userdata_set(testdata, "TEST", string_cleanup, pool)) + + STD_TEST_NEQ(" Getting user data from the pool", + apr_pool_userdata_get((void **)&retdata, "TEST", pool)) - apr_pool_userdata_get((void **)&retdata, "TEST", context); + TEST_NEQ(" Checking the data we got", strcmp(testdata, retdata), + 0, "OK","Failed :(") - if (!strcmp(testdata, retdata)) { - fprintf(stdout, "User data is working ok\n"); - } - else { - fprintf(stdout, "User data is not working\n"); - } + printf("Testing SMS\n"); + + STD_TEST_NEQ(" Setting user data into the pool", + apr_sms_userdata_set(testdata, "TEST", string_cleanup, sms)) + STD_TEST_NEQ(" Getting user data from the pool", + apr_sms_userdata_get((void **)&retdata, "TEST", sms)) + + TEST_NEQ(" Checking the data we got", strcmp(testdata, retdata), + 0, "OK","Failed :(") + + printf("\nTest complete\n"); return 1; } From 4ab10fedbe82e87395126490fc3e06ed7d17aed1 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 13:10:11 +0000 Subject: [PATCH 1898/7878] Update cvsignore for testud and add .core. Don't know about others, but during testing I often see a couple of these :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61891 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/.cvsignore b/test/.cvsignore index 20dd59dfb73..eba69a68aa1 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -6,7 +6,7 @@ testmmap htdigest ab proctest -testcontext +testud testargs testdso testoc @@ -40,3 +40,4 @@ testnames *.dbg testmem testlock +*.core From 389216ec7fbb6b97711e2cd20d520a60a331c4ac Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 13:11:38 +0000 Subject: [PATCH 1899/7878] Whoops, meant to add testsockets as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61892 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.cvsignore b/test/.cvsignore index eba69a68aa1..2388677c6fc 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -41,3 +41,4 @@ testnames testmem testlock *.core +testsockets From 5c7b5cbe060836541b7424a6e00afc9921128c91 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 13:26:28 +0000 Subject: [PATCH 1900/7878] Remove an uneeded cast. Submitted by: Sander Striker Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61893 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 5e7657f5c20..efdff842602 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -936,7 +936,7 @@ APR_DECLARE(apr_status_t) apr_sms_userdata_set(const void *data, sms->prog_data = apr_hash_make(sms->pool); if (apr_hash_get(sms->prog_data, key, keylen) == NULL) { - char *new_key = apr_pstrdup((apr_pool_t*)sms->pool, key); + char *new_key = apr_pstrdup(sms->pool, key); apr_hash_set(sms->prog_data, new_key, keylen, data); } else { apr_hash_set(sms->prog_data, key, keylen, data); From b0dadac6f7cda7cfcf29fe0cc8c36c9f8820c485 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 7 Jul 2001 16:45:08 +0000 Subject: [PATCH 1901/7878] FreeBSD doesn't use threads so this didn't show up on my system, but Ian noticed it and yelled :) Basically we need the definition of apr_sms_t now that we have the register functions in apr_portable.h, so add the header. Submitted by: Ian Holsman Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61894 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr_portable.h b/include/apr_portable.h index 94d4c93dc62..c37ae105c9b 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -72,6 +72,7 @@ #include "apr_lock.h" #include "apr_time.h" #include "apr_dso.h" +#include "apr_sms.h" #if APR_HAVE_DIRENT_H #include From 4efccd7447555889c5e34857d3f9fce7655a45cd Mon Sep 17 00:00:00 2001 From: dgaudet Date: Sat, 7 Jul 2001 17:40:02 +0000 Subject: [PATCH 1902/7878] well i don't know if this is the right fix, but at least i can compile now. apr_sms.h needs apr_portable.h, and apr_portable.h needs apr_sms.h. maybe the right fix is to move those two declarations in apr_portable.h which need apr_sms_t to apr_sms.h. dunno. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61895 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index 37342d192b0..82f92fb01e7 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -63,6 +63,8 @@ #ifndef APR_SMS_H #define APR_SMS_H +typedef struct apr_sms_t apr_sms_t; + #include "apr.h" #include "apr_errno.h" #include "apr_pools.h" @@ -154,7 +156,6 @@ extern "C" { */ struct apr_sms_cleanup; -typedef struct apr_sms_t apr_sms_t; /* * memory allocation functions From b32eda7af094607df13ab021c7895600500e7b51 Mon Sep 17 00:00:00 2001 From: Karl Fogel Date: Sat, 7 Jul 2001 18:43:31 +0000 Subject: [PATCH 1903/7878] (apr_table_do): Trivial grammar fix to doc string. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61896 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index ff6deff36de..4113e2eb8fb 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -364,7 +364,7 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, /** * Iterate over a table running the provided function once for every * element in the table. If there is data passed in as a vararg, then the - * function is only run on those element's whose key matches something in + * function is only run on those elements whose key matches something in * the vararg. If the vararg is NULL, then every element is run through the * function. Iteration continues while the function returns non-zero. * @param comp The function to run From 646d1366b1691c16edaa7f3c1fbf78ac0ad3c67a Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 7 Jul 2001 18:53:17 +0000 Subject: [PATCH 1904/7878] When David moved the code from lib/ to memory/unix, they made these functions accessible only when APR_POOL_DEBUG is defined. They forgot to update the headers. This gets us building again. David's POOLS_ARE_SMS patch has better reorganization (and includes this fix). This works for now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61897 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 265c181759a..9dd5dc79fe1 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -156,6 +156,20 @@ APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub); */ APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts); +/** + * Report the number of bytes currently in the pool + * @param p The pool to inspect + * @param recurse Recurse/include the subpools' sizes + * @return The number of bytes + */ +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse); + +/** + * Report the number of bytes currently in the list of free blocks + * @return The number of bytes + */ +APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void); + /* @} */ #else @@ -300,20 +314,6 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); */ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); -/** - * Report the number of bytes currently in the pool - * @param p The pool to inspect - * @param recurse Recurse/include the subpools' sizes - * @return The number of bytes - */ -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse); - -/** - * Report the number of bytes currently in the list of free blocks - * @return The number of bytes - */ -APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void); - /** * Allocate a block of memory from a pool * @param c The pool to allocate from From 2488bcbbff5b8e55ff0a6b920bbc70b83026e933 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 7 Jul 2001 18:54:32 +0000 Subject: [PATCH 1905/7878] Get us building again. David changed the header files, but not the .c file. s/apr_sms_identity/apr_sms_get_identity/ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61898 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index efdff842602..a9835510541 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -905,7 +905,7 @@ APR_DECLARE(apr_status_t) apr_sms_thread_unregister(apr_sms_t *sms, } #endif /* APR_HAS_THREADS */ -APR_DECLARE(const char*) apr_sms_identity(apr_sms_t *sms) +APR_DECLARE(const char*) apr_sms_get_identity(apr_sms_t *sms) { return sms->identity; } From 2a2fc2c7a356234850483675f1308e701571029c Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 7 Jul 2001 22:23:54 +0000 Subject: [PATCH 1906/7878] This function is only used if we are debugging the code, so we should only define it if we are debugging. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61899 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 75debc4297d..b45c0cc52ee 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -540,7 +540,7 @@ static union block_hdr *new_block(apr_size_t min_size, apr_abortfunc_t abortfunc /* Accounting */ - +#ifdef APR_POOL_DEBUG static apr_size_t bytes_in_block_list(union block_hdr *blok) { apr_size_t size = 0; @@ -552,7 +552,7 @@ static apr_size_t bytes_in_block_list(union block_hdr *blok) return size; } - +#endif /***************************************************************** * From 2a5f099d07bbfc9ac314b77672aa1d6afb0dc286 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 7 Jul 2001 22:48:09 +0000 Subject: [PATCH 1907/7878] We are setting a simple bitmask. Calling a function to do that is far too expensive. It is much easier to just turn these into macros that do the exact same thing. Submitted by: Dean Gaudet git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61900 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/networkio.h | 12 ++++++++++-- network_io/unix/sockopt.c | 13 ------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 5d983bd80c9..517e0a16199 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -159,8 +159,16 @@ struct apr_pollfd_t { const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); -int apr_is_option_set(apr_int32_t, apr_int32_t); -void apr_set_option(apr_int32_t *, apr_int32_t, int); + +#define apr_is_option_set(mask, option) ((mask & option) ==option) + +#define apr_set_option(mask, option, on) \ + do { \ + if (on) \ + *mask |= option; \ + else \ + *mask &= ~option; \ + } while (0) #endif /* ! NETWORK_IO_H */ diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 780887e6b78..30dcdf2fe14 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -55,19 +55,6 @@ #include "networkio.h" #include "apr_strings.h" -int apr_is_option_set(apr_int32_t mask, apr_int32_t option) -{ - return (mask & option) == option; -} - -void apr_set_option(apr_int32_t *mask, apr_int32_t option, int on) -{ - if (on) - *mask |= option; - else - *mask &= ~option; -} - static apr_status_t soblock(int sd) { /* BeOS uses setsockopt at present for non blocking... */ From 6dd191fce6ab3c722b5631de0a6dd8b2afdd8556 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 8 Jul 2001 02:48:53 +0000 Subject: [PATCH 1908/7878] Add an option to configure to add -pg if we're using gcc to add profiling information to the build. Given that we need to be concerned about performance this sort of useful addition seems like a good idea to me. Should we be leaving -O2 in the build if we're specifying -pg? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61901 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index b4cdbef98c6..cd0fb8a740e 100644 --- a/configure.in +++ b/configure.in @@ -149,8 +149,14 @@ AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and ])dnl AC_ARG_ENABLE(assert-memory,[ --enable-assert-memory Turn on asserts in the APR memory code], - [APR_ADDTO(NOTEST_CPPFLAGS,-DAPR_ASSERT_MEMORY) -]) + APR_ADDTO(NOTEST_CPPFLAGS,-DAPR_ASSERT_MEMORY) +)dnl + +AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build (GCC)], + if test "$GCC" = "yes"; then + APR_ADDTO(CFLAGS, -pg) + fi +)dnl dnl # this is the place to put specific options for platform/compiler dnl # combinations From 999c92b41b334aea34be1b6174ceb26b04c64ea6 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 8 Jul 2001 18:39:15 +0000 Subject: [PATCH 1909/7878] Thinko. This would cause a segfault if you tried to call realloc with this SMS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61902 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_tracking.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c index 047330d897d..afbfeea135f 100644 --- a/memory/unix/apr_sms_tracking.c +++ b/memory/unix/apr_sms_tracking.c @@ -92,7 +92,7 @@ typedef struct apr_sms_tracking_t #define SIZEOF_BLOCK_T APR_ALIGN_DEFAULT(sizeof(block_t)) #define SIZEOF_SMS_TRACKING_T APR_ALIGN_DEFAULT(sizeof(apr_sms_tracking_t)) -#define BLOCK_T(sms) ((block_t *)(mem)) +#define BLOCK_T(mem) ((block_t *)(mem)) #define SMS_TRACKING_T(sms) ((apr_sms_tracking_t *)(sms)) #define INSERT_BLOCK(block, tms) \ From 01ab75824d836d66474b38626725f8d88e4af9ab Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 9 Jul 2001 02:30:44 +0000 Subject: [PATCH 1910/7878] Allow all parts of Apache 2.0 to build when --srcdir is used. This required exposing a build directory and a source directory to all parts of Apache's build system. It also required a small hack in APR-util, if we are using the bundled Expat, and we are using VPATH support, then we have hard-coded the xml/expat location. I couldn't figure out how to allow the configure script to determine the correct location. I added a comment, but if somebody else figures it out, we should fix that at some point. PR: 7630 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61903 13f79535-47bb-0310-9956-ffa450edef68 --- APRVARS.in | 1 + configure.in | 1 + 2 files changed, 2 insertions(+) diff --git a/APRVARS.in b/APRVARS.in index f4f0d0fe7ba..ca1f3571d06 100644 --- a/APRVARS.in +++ b/APRVARS.in @@ -7,3 +7,4 @@ EXTRA_LDFLAGS="@EXTRA_LDFLAGS@" EXTRA_LIBS="@EXTRA_LIBS@" EXTRA_INCLUDES="@EXTRA_INCLUDES@" LIBTOOL_LIBS="@LIBTOOL_LIBS@" +APR_SOURCE_DIR="@abs_srcdir@" diff --git a/configure.in b/configure.in index cd0fb8a740e..1dd2abd2a40 100644 --- a/configure.in +++ b/configure.in @@ -53,6 +53,7 @@ dnl the generated libtool script (not necessarily the "top" build dir). dnl top_builddir="$abs_builddir" AC_SUBST(top_builddir) +AC_SUBST(abs_srcdir) dnl Directory containing apr build macros, helpers, and make rules dnl NOTE: make rules (rules.mk) will be in the builddir for vpath From 324103dbfd25200ad909e3cef04065045b21ca48 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 9 Jul 2001 15:31:47 +0000 Subject: [PATCH 1911/7878] * use memory/unix/apr_pools.c instead of lib/apr_pools.c * include sms_blocks & sms_trivial in build. Submitted by: Ian Holsman Reviewed by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61904 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 16 ++++++++++------ libapr.dsp | 20 ++++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/apr.dsp b/apr.dsp index e7c32f63527..06e22d5950f 100644 --- a/apr.dsp +++ b/apr.dsp @@ -346,10 +346,6 @@ SOURCE=.\include\arch\win32\dso.h # PROP Default_Filter "" # Begin Source File -SOURCE=.\lib\apr_pools.c -# End Source File -# Begin Source File - SOURCE=.\lib\apr_signal.c # End Source File # End Group @@ -408,10 +404,18 @@ SOURCE=.\user\win32\userinfo.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\memory\unix\apr_pools.c +# End Source File +# Begin Source File + SOURCE=.\memory\unix\apr_sms.c # End Source File # Begin Source File +SOURCE=.\memory\unix\apr_sms_blocks.c +# End Source File +# Begin Source File + SOURCE=.\memory\unix\apr_sms_std.c # End Source File # Begin Source File @@ -534,11 +538,11 @@ SOURCE=.\include\apr_portable.h # End Source File # Begin Source File -SOURCE=.\include\apr_signal.h +SOURCE=.\include\apr_shmem.h # End Source File # Begin Source File -SOURCE=.\include\apr_shmem.h +SOURCE=.\include\apr_signal.h # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index 515cd58c632..cb5ff1b2a4a 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -352,10 +352,6 @@ SOURCE=.\include\arch\win32\dso.h # PROP Default_Filter "" # Begin Source File -SOURCE=.\lib\apr_pools.c -# End Source File -# Begin Source File - SOURCE=.\lib\apr_signal.c # End Source File # End Group @@ -414,16 +410,28 @@ SOURCE=.\user\win32\userinfo.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\memory\unix\apr_pools.c +# End Source File +# Begin Source File + SOURCE=.\memory\unix\apr_sms.c # End Source File # Begin Source File +SOURCE=.\memory\unix\apr_sms_blocks.c +# End Source File +# Begin Source File + SOURCE=.\memory\unix\apr_sms_std.c # End Source File # Begin Source File SOURCE=.\memory\unix\apr_sms_tracking.c # End Source File +# Begin Source File + +SOURCE=.\memory\unix\apr_sms_trivial.c +# End Source File # End Group # End Group # Begin Group "Generated Header Files" @@ -540,11 +548,11 @@ SOURCE=.\include\apr_portable.h # End Source File # Begin Source File -SOURCE=.\include\apr_signal.h +SOURCE=.\include\apr_shmem.h # End Source File # Begin Source File -SOURCE=.\include\apr_shmem.h +SOURCE=.\include\apr_signal.h # End Source File # Begin Source File From e600b03211069644fd953d0151a82f85019833eb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 9 Jul 2001 17:54:52 +0000 Subject: [PATCH 1912/7878] Win32 build cleanups for recent .dsp changes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61905 13f79535-47bb-0310-9956-ffa450edef68 --- apr.mak | 154 +++++++++++++++++++++++++++++++++++--------- libapr.mak | 185 ++++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 277 insertions(+), 62 deletions(-) diff --git a/apr.mak b/apr.mak index ed4e9ad1645..75231dae8d9 100644 --- a/apr.mak +++ b/apr.mak @@ -54,6 +54,7 @@ CLEAN : -@erase "$(INTDIR)\apr_pools.obj" -@erase "$(INTDIR)\apr_signal.obj" -@erase "$(INTDIR)\apr_sms.obj" + -@erase "$(INTDIR)\apr_sms_blocks.obj" -@erase "$(INTDIR)\apr_sms_std.obj" -@erase "$(INTDIR)\apr_sms_tracking.obj" -@erase "$(INTDIR)\apr_snprintf.obj" @@ -161,6 +162,7 @@ LIB32_OBJS= \ "$(INTDIR)\apr_pools.obj" \ "$(INTDIR)\apr_signal.obj" \ "$(INTDIR)\apr_sms.obj" \ + "$(INTDIR)\apr_sms_blocks.obj" \ "$(INTDIR)\apr_sms_std.obj" \ "$(INTDIR)\apr_sms_tracking.obj" \ "$(INTDIR)\apr_snprintf.obj" \ @@ -244,6 +246,7 @@ CLEAN : -@erase "$(INTDIR)\apr_pools.obj" -@erase "$(INTDIR)\apr_signal.obj" -@erase "$(INTDIR)\apr_sms.obj" + -@erase "$(INTDIR)\apr_sms_blocks.obj" -@erase "$(INTDIR)\apr_sms_std.obj" -@erase "$(INTDIR)\apr_sms_tracking.obj" -@erase "$(INTDIR)\apr_snprintf.obj" @@ -351,6 +354,7 @@ LIB32_OBJS= \ "$(INTDIR)\apr_pools.obj" \ "$(INTDIR)\apr_signal.obj" \ "$(INTDIR)\apr_sms.obj" \ + "$(INTDIR)\apr_sms_blocks.obj" \ "$(INTDIR)\apr_sms_std.obj" \ "$(INTDIR)\apr_sms_tracking.obj" \ "$(INTDIR)\apr_snprintf.obj" \ @@ -438,6 +442,7 @@ DEP_CPP_TIME_=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -461,6 +466,7 @@ DEP_CPP_TIMES=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -646,6 +652,7 @@ DEP_CPP_ERROR=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -673,6 +680,7 @@ DEP_CPP_GETOP=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -712,6 +720,7 @@ DEP_CPP_MISC_=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -758,6 +767,7 @@ DEP_CPP_OTHER=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -803,6 +813,7 @@ DEP_CPP_START=\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_signal.h"\ + ".\include\apr_sms.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -842,6 +853,7 @@ DEP_CPP_DIR_C=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -873,6 +885,7 @@ DEP_CPP_FILEA=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -904,6 +917,7 @@ DEP_CPP_FILED=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -935,6 +949,7 @@ DEP_CPP_FILEP=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -966,6 +981,7 @@ DEP_CPP_FILES=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -998,6 +1014,7 @@ DEP_CPP_FLOCK=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1045,6 +1062,7 @@ DEP_CPP_OPEN_=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1075,6 +1093,7 @@ DEP_CPP_PIPE_=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1106,6 +1125,7 @@ DEP_CPP_READW=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1138,6 +1158,7 @@ DEP_CPP_SEEK_=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1166,6 +1187,7 @@ DEP_CPP_LOCKS=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1258,6 +1280,7 @@ DEP_CPP_SENDR=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1312,6 +1335,7 @@ DEP_CPP_SOCKE=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -1358,6 +1382,7 @@ DEP_CPP_PROC_=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1389,6 +1414,7 @@ DEP_CPP_SIGNA=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1420,6 +1446,7 @@ DEP_CPP_THREA=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -1446,6 +1473,7 @@ DEP_CPP_THREAD=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -1472,6 +1500,7 @@ DEP_CPP_DSO_C=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1490,33 +1519,6 @@ DEP_CPP_DSO_C=\ $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\lib\apr_pools.c -DEP_CPP_APR_P=\ - ".\include\apr.h"\ - ".\include\apr_dso.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ - ".\include\apr_hash.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ - ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_thread_proc.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ - ".\include\arch\win32\apr_private.h"\ - - -"$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - SOURCE=.\lib\apr_signal.c DEP_CPP_APR_SI=\ ".\include\apr.h"\ @@ -1579,6 +1581,7 @@ DEP_CPP_MMAP_=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1606,6 +1609,7 @@ DEP_CPP_GROUP=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1632,6 +1636,7 @@ DEP_CPP_USERI=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1650,14 +1655,54 @@ DEP_CPP_USERI=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\memory\unix\apr_pools.c +DEP_CPP_APR_P=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_hash.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + + +"$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\memory\unix\apr_sms.c DEP_CPP_APR_SM=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_hash.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\memory\unix\sms_private.h"\ "$(INTDIR)\apr_sms.obj" : $(SOURCE) $(DEP_CPP_APR_SM) "$(INTDIR)"\ @@ -1665,34 +1710,81 @@ DEP_CPP_APR_SM=\ $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\memory\unix\apr_sms_std.c +SOURCE=.\memory\unix\apr_sms_blocks.c DEP_CPP_APR_SMS=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_sms_blocks.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\memory\unix\sms_private.h"\ + + +"$(INTDIR)\apr_sms_blocks.obj" : $(SOURCE) $(DEP_CPP_APR_SMS) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\memory\unix\apr_sms_std.c +DEP_CPP_APR_SMS_=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + ".\memory\unix\sms_private.h"\ -"$(INTDIR)\apr_sms_std.obj" : $(SOURCE) $(DEP_CPP_APR_SMS) "$(INTDIR)"\ +"$(INTDIR)\apr_sms_std.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=.\memory\unix\apr_sms_tracking.c -DEP_CPP_APR_SMS_=\ +DEP_CPP_APR_SMS_T=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_sms_tracking.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + ".\memory\unix\sms_private.h"\ -"$(INTDIR)\apr_sms_tracking.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_) "$(INTDIR)"\ +"$(INTDIR)\apr_sms_tracking.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_T) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) diff --git a/libapr.mak b/libapr.mak index 8a3828a6aeb..b8a6fdc5877 100644 --- a/libapr.mak +++ b/libapr.mak @@ -54,8 +54,10 @@ CLEAN : -@erase "$(INTDIR)\apr_pools.obj" -@erase "$(INTDIR)\apr_signal.obj" -@erase "$(INTDIR)\apr_sms.obj" + -@erase "$(INTDIR)\apr_sms_blocks.obj" -@erase "$(INTDIR)\apr_sms_std.obj" -@erase "$(INTDIR)\apr_sms_tracking.obj" + -@erase "$(INTDIR)\apr_sms_trivial.obj" -@erase "$(INTDIR)\apr_snprintf.obj" -@erase "$(INTDIR)\apr_strings.obj" -@erase "$(INTDIR)\apr_strnatcmp.obj" @@ -169,8 +171,10 @@ LINK32_OBJS= \ "$(INTDIR)\apr_pools.obj" \ "$(INTDIR)\apr_signal.obj" \ "$(INTDIR)\apr_sms.obj" \ + "$(INTDIR)\apr_sms_blocks.obj" \ "$(INTDIR)\apr_sms_std.obj" \ "$(INTDIR)\apr_sms_tracking.obj" \ + "$(INTDIR)\apr_sms_trivial.obj" \ "$(INTDIR)\apr_snprintf.obj" \ "$(INTDIR)\apr_strings.obj" \ "$(INTDIR)\apr_strnatcmp.obj" \ @@ -252,8 +256,10 @@ CLEAN : -@erase "$(INTDIR)\apr_pools.obj" -@erase "$(INTDIR)\apr_signal.obj" -@erase "$(INTDIR)\apr_sms.obj" + -@erase "$(INTDIR)\apr_sms_blocks.obj" -@erase "$(INTDIR)\apr_sms_std.obj" -@erase "$(INTDIR)\apr_sms_tracking.obj" + -@erase "$(INTDIR)\apr_sms_trivial.obj" -@erase "$(INTDIR)\apr_snprintf.obj" -@erase "$(INTDIR)\apr_strings.obj" -@erase "$(INTDIR)\apr_strnatcmp.obj" @@ -368,8 +374,10 @@ LINK32_OBJS= \ "$(INTDIR)\apr_pools.obj" \ "$(INTDIR)\apr_signal.obj" \ "$(INTDIR)\apr_sms.obj" \ + "$(INTDIR)\apr_sms_blocks.obj" \ "$(INTDIR)\apr_sms_std.obj" \ "$(INTDIR)\apr_sms_tracking.obj" \ + "$(INTDIR)\apr_sms_trivial.obj" \ "$(INTDIR)\apr_snprintf.obj" \ "$(INTDIR)\apr_strings.obj" \ "$(INTDIR)\apr_strnatcmp.obj" \ @@ -455,6 +463,7 @@ DEP_CPP_TIME_=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -478,6 +487,7 @@ DEP_CPP_TIMES=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -663,6 +673,7 @@ DEP_CPP_ERROR=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -690,6 +701,7 @@ DEP_CPP_GETOP=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -729,6 +741,7 @@ DEP_CPP_MISC_=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -775,6 +788,7 @@ DEP_CPP_OTHER=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -820,6 +834,7 @@ DEP_CPP_START=\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_signal.h"\ + ".\include\apr_sms.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -859,6 +874,7 @@ DEP_CPP_DIR_C=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -890,6 +906,7 @@ DEP_CPP_FILEA=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -921,6 +938,7 @@ DEP_CPP_FILED=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -952,6 +970,7 @@ DEP_CPP_FILEP=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -983,6 +1002,7 @@ DEP_CPP_FILES=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1015,6 +1035,7 @@ DEP_CPP_FLOCK=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1062,6 +1083,7 @@ DEP_CPP_OPEN_=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1092,6 +1114,7 @@ DEP_CPP_PIPE_=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1123,6 +1146,7 @@ DEP_CPP_READW=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1155,6 +1179,7 @@ DEP_CPP_SEEK_=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1183,6 +1208,7 @@ DEP_CPP_LOCKS=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1275,6 +1301,7 @@ DEP_CPP_SENDR=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1329,6 +1356,7 @@ DEP_CPP_SOCKE=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -1375,6 +1403,7 @@ DEP_CPP_PROC_=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1406,6 +1435,7 @@ DEP_CPP_SIGNA=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1437,6 +1467,7 @@ DEP_CPP_THREA=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -1463,6 +1494,7 @@ DEP_CPP_THREAD=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -1489,6 +1521,7 @@ DEP_CPP_DSO_C=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1507,33 +1540,6 @@ DEP_CPP_DSO_C=\ $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\lib\apr_pools.c -DEP_CPP_APR_P=\ - ".\include\apr.h"\ - ".\include\apr_dso.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ - ".\include\apr_hash.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ - ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_thread_proc.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ - ".\include\arch\win32\apr_private.h"\ - - -"$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - SOURCE=.\lib\apr_signal.c DEP_CPP_APR_SI=\ ".\include\apr.h"\ @@ -1596,6 +1602,7 @@ DEP_CPP_MMAP_=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1623,6 +1630,7 @@ DEP_CPP_GROUP=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1649,6 +1657,7 @@ DEP_CPP_USERI=\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ @@ -1667,14 +1676,54 @@ DEP_CPP_USERI=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\memory\unix\apr_pools.c +DEP_CPP_APR_P=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_hash.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + + +"$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\memory\unix\apr_sms.c DEP_CPP_APR_SM=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_hash.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\memory\unix\sms_private.h"\ "$(INTDIR)\apr_sms.obj" : $(SOURCE) $(DEP_CPP_APR_SM) "$(INTDIR)"\ @@ -1682,34 +1731,108 @@ DEP_CPP_APR_SM=\ $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\memory\unix\apr_sms_std.c +SOURCE=.\memory\unix\apr_sms_blocks.c DEP_CPP_APR_SMS=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_sms_blocks.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + ".\memory\unix\sms_private.h"\ -"$(INTDIR)\apr_sms_std.obj" : $(SOURCE) $(DEP_CPP_APR_SMS) "$(INTDIR)"\ +"$(INTDIR)\apr_sms_blocks.obj" : $(SOURCE) $(DEP_CPP_APR_SMS) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\memory\unix\apr_sms_tracking.c +SOURCE=.\memory\unix\apr_sms_std.c DEP_CPP_APR_SMS_=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\memory\unix\sms_private.h"\ + + +"$(INTDIR)\apr_sms_std.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\memory\unix\apr_sms_tracking.c +DEP_CPP_APR_SMS_T=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_sms_tracking.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\memory\unix\sms_private.h"\ + + +"$(INTDIR)\apr_sms_tracking.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_T) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\memory\unix\apr_sms_trivial.c +DEP_CPP_APR_SMS_TR=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_sms_trivial.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + ".\memory\unix\sms_private.h"\ -"$(INTDIR)\apr_sms_tracking.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_) "$(INTDIR)"\ +"$(INTDIR)\apr_sms_trivial.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_TR) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) From 538809953f9294942975e2161032dc221a7f0fb3 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 9 Jul 2001 23:14:33 +0000 Subject: [PATCH 1913/7878] As discussed on dev@apr (no feedback - may have gotten lost in shuffle?), switch the priority of the pthread mutex to be the "best" one if it satisfies all stated conditions (which includes the existance of /dev/zero which will preclude the pthread mutex from being used on HP-UX and OS/390 - which was Jeff Trawick's original concern). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61907 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 1dd2abd2a40..8e3295773cb 100644 --- a/configure.in +++ b/configure.in @@ -994,12 +994,12 @@ APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) APR_IFALLYES(func:flock define:LOCK_EX, APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) +APR_IFALLYES(header:fcntl.h define:F_SETLK, + APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) # note: the current APR use of shared mutex requires /dev/zero APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl func:pthread_mutexattr_setpshared file:/dev/zero, APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) -APR_IFALLYES(header:fcntl.h define:F_SETLK, - APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) fi From 25b8f0c0a1e5003b1e93a994caa226c677687a48 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Mon, 9 Jul 2001 23:30:17 +0000 Subject: [PATCH 1914/7878] For some reason --with-libtool was changed to AC_ARG_ENABLE without changing the variables or the documentation, which aside from being bogus wasn't a desirable change anyway (libtool is a package). Also, clean up some of the help spacing and properly quote the macro arguments to some new options. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61908 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 8e3295773cb..b04756c7e34 100644 --- a/configure.in +++ b/configure.in @@ -107,7 +107,7 @@ AC_PROG_LIBTOOL ;; esac -AC_ARG_ENABLE(libtool, [--with-libtool use libtool to link the library], +AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the library], [ use_libtool=$withval ], [ use_libtool="yes" ] ) if test "x$use_libtool" = "xyes"; then @@ -134,7 +134,7 @@ nl=' ' echo $ac_n "${nl}Check for compiler flags...${nl}" -AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile time warnings], +AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile time warnings], [APR_ADDTO(CFLAGS,-g) if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,-Wall) @@ -149,15 +149,15 @@ AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and fi ])dnl -AC_ARG_ENABLE(assert-memory,[ --enable-assert-memory Turn on asserts in the APR memory code], +AC_ARG_ENABLE(assert-memory,[ --enable-assert-memory Turn on asserts in the APR memory code],[ APR_ADDTO(NOTEST_CPPFLAGS,-DAPR_ASSERT_MEMORY) -)dnl +])dnl -AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build (GCC)], +AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build (GCC)],[ if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS, -pg) fi -)dnl +])dnl dnl # this is the place to put specific options for platform/compiler dnl # combinations @@ -453,7 +453,7 @@ dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a dnl threaded poll() and we don't want to use sendfile on early FreeBSD dnl systems if we are also using threads. -AC_ARG_WITH(sendfile, [ --with-sendfile Force sendfile to be on or off], +AC_ARG_WITH(sendfile, [ --with-sendfile Override decision to use sendfile], [ if test "$withval" = "yes"; then sendfile="1" else From f9afded07e480521800e3815774e3f9fb834eb5f Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 10 Jul 2001 02:18:52 +0000 Subject: [PATCH 1915/7878] Use the autoconf variable "host" consistently for OS checks instead of creating a copy called "OS" or using "host_alias". Submitted by: Roy Fielding, Mo DeJong git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61909 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/configure.in b/configure.in index b04756c7e34..3218486b1ef 100644 --- a/configure.in +++ b/configure.in @@ -31,8 +31,7 @@ APR_CONFIG_NICE(config.nice) AC_CANONICAL_SYSTEM echo "Configuring APR library" -OS=$host -echo "Platform: $OS" +echo "Platform: $host" dnl # Some initial steps for configuration. We setup the default directory dnl # and which files are to be configured. @@ -92,7 +91,7 @@ dnl prep libtool dnl echo "performing libtool configuration..." -case "$host_alias" in +case $host in *os2*) # Use a custom-made libtool replacement echo "using aplibtool" @@ -161,7 +160,7 @@ AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build dnl # this is the place to put specific options for platform/compiler dnl # combinations -case "$OS:$CC" in +case "$host:$CC" in *-hp-hpux*:cc ) APR_ADDTO(CFLAGS,[-Ae +DAportable +Z]) ;; @@ -175,7 +174,7 @@ case "$OS:$CC" in ;; esac LOCAL_MM_LIB="../shmem/unix/mm/libmm.la" -case "$OS" in +case $host in i386-ibm-aix* | *-ibm-aix[1-2].* | *-ibm-aix3.* | *-ibm-aix4.1 | *-ibm-aix4.1.* | *-ibm-aix4.2 | *-ibm-aix4.2.*) OSDIR="aix" config_subdirs="shmem/unix/mm" @@ -224,7 +223,7 @@ AC_SUBST(eolstr) dnl For some platforms we need a version string which allows easy numeric dnl comparisons. -case "$OS" in +case $host in *freebsd*) # 3.4-RELEASE: 340 4.1.1-RELEASE: 411 os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/' | sed -e 's/\(.\)\.\(.\)\-.*/\1\20/'` @@ -327,7 +326,7 @@ AC_CHECK_FUNCS(sigsuspend) AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ]) dnl AC_CHECK_FUNCS doesn't work for this on Tru64 since the function dnl is renamed in signal.h. Todo: Autodetect -case "$OS" in +case $host in *alpha*-dec-osf* ) have_sigwait="1" ;; @@ -460,7 +459,7 @@ AC_ARG_WITH(sendfile, [ --with-sendfile Override decision to use sendfi sendfile="0" fi ], [ orig_sendfile=$sendfile - case "$OS" in + case $host in *freebsd*) if test $os_version -le "410"; then if test "$threads" = "1"; then @@ -776,7 +775,7 @@ fi # for APR types which vary between platforms, but we don't always get # it right. If you find that we don't get it right for your platform, # you can override our decision below. -case "$OS" in +case $host in *linux*) off_t_fmt='#define APR_OFF_T_FMT "ld"' ;; @@ -858,7 +857,7 @@ AC_ARG_ENABLE(dso, tempdso="no") fi if test "$tempdso" = "no"; then - case $OS in + case $host in *os390|*-os2*) tempdso="yes" ;; @@ -1031,7 +1030,7 @@ else lockcreatenp="1" fi -case "$OS" in +case $host in *-os2*) # The above tests detect a working flock on OS/2 # but we don't want to use it when we have native locks @@ -1080,7 +1079,7 @@ elif test -r "/dev/urandom"; then else AC_MSG_RESULT(not found); - case "$OS" in + case $host in # we have built in support for OS/2 *-os2*) rand="1" @@ -1148,7 +1147,7 @@ if test "x$ac_cv_define_TCP_CORK" = "xyes"; then apr_tcp_nopush_flag="TCP_CORK" have_corkable_tcp="1" else - case $OS in + case $host in *linux*) AC_EGREP_CPP(yes,[ #include @@ -1256,7 +1255,7 @@ AC_SUBST(SUBDIRS) dnl dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles dnl -case "$host_alias" in +case $host in *bsdi*) # Check whether they've installed GNU make if make --version > /dev/null 2>&1; then From 2a2fcebc8fedfafb515450b9e1ead0266be3fdff Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 10 Jul 2001 15:01:43 +0000 Subject: [PATCH 1916/7878] apr_connect() on Unix: handle EINTR handle APR timeouts on the socket git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61910 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ include/arch/unix/networkio.h | 1 + network_io/unix/sendrecv.c | 20 +++++------ network_io/unix/sockets.c | 67 +++++++++++++++++++++++------------ test/client.c | 20 +++++------ 5 files changed, 68 insertions(+), 43 deletions(-) diff --git a/CHANGES b/CHANGES index f09362841b5..90a52afda38 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) apr_connect() on Unix: Handle EINTR during connect(). Handle timeouts. + [Jeff Trawick] + *) Handle the weird case where getpwnam() returns NULL but errno is zero. [Jeff Trawick] diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 517e0a16199..5c879db7bc5 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -159,6 +159,7 @@ struct apr_pollfd_t { const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); +apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read); #define apr_is_option_set(mask, option) ((mask & option) ==option) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 1e9df3d6291..abd77409cec 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -59,7 +59,7 @@ #include "fileio.h" #endif /* APR_HAS_SENDFILE */ -static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) +apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read) { struct timeval tv, *tvptr; fd_set fdset; @@ -103,7 +103,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -132,7 +132,7 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 1); + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -167,7 +167,7 @@ apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -200,7 +200,7 @@ apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 1); + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -235,7 +235,7 @@ apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -324,7 +324,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { - arv = wait_for_io_or_timeout(sock, 0); + arv = apr_wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -423,7 +423,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, * we get -1/EAGAIN/nbytes>0; AFAICT it just means extra syscalls * from time to time */ - apr_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -577,7 +577,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (rc == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -710,7 +710,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { - arv = wait_for_io_or_timeout(sock, 0); + arv = apr_wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index d60712e9e11..c14ce547567 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -257,39 +257,60 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { + int rc; + if ((sock->socketdes < 0) || (!sock->remote_addr)) { return APR_ENOTSOCK; } - if ((connect(sock->socketdes, - (const struct sockaddr *)&sa->sa.sin, - sa->salen) < 0) && - (errno != EINPROGRESS)) { + do { + rc = connect(sock->socketdes, + (const struct sockaddr *)&sa->sa.sin, + sa->salen); + } while (rc == -1 && errno == EINTR); + + /* we can see EINPROGRESS the first time connect is called on a non-blocking + * socket; if called again, we can see EALREADY + */ + if (rc == -1 && (errno == EINPROGRESS || errno == EALREADY) && sock->timeout != 0) { + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); + if (arv != APR_SUCCESS) { + return arv; + } + else { + do { + rc = connect(sock->socketdes, + (const struct sockaddr *)&sa->sa.sin, + sa->salen); + } while (rc == -1 && errno == EINTR); + } + } + + if (rc == -1) { return errno; } - else { - sock->remote_addr = sa; - /* XXX IPv6 assumes sin_port and sin6_port at same offset */ - if (sock->local_addr->sa.sin.sin_port == 0) { - /* connect() got us an ephemeral port */ - sock->local_port_unknown = 1; - } - /* XXX IPv6 to be handled better later... */ - if ( + + sock->remote_addr = sa; + /* XXX IPv6 assumes sin_port and sin6_port at same offset */ + if (sock->local_addr->sa.sin.sin_port == 0) { + /* connect() got us an ephemeral port */ + sock->local_port_unknown = 1; + } + /* XXX IPv6 to be handled better later... */ + if ( #if APR_HAVE_IPV6 - sock->local_addr->sa.sin.sin_family == APR_INET6 || + sock->local_addr->sa.sin.sin_family == APR_INET6 || #endif - sock->local_addr->sa.sin.sin_addr.s_addr == 0) { - /* not bound to specific local interface; connect() had to assign - * one for the socket - */ - sock->local_interface_unknown = 1; - } + sock->local_addr->sa.sin.sin_addr.s_addr == 0) { + /* not bound to specific local interface; connect() had to assign + * one for the socket + */ + sock->local_interface_unknown = 1; + } #ifndef HAVE_POLL - sock->connected=1; + sock->connected=1; #endif - return APR_SUCCESS; - } + return APR_SUCCESS; } apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *sock) diff --git a/test/client.c b/test/client.c index 71767b11546..a7a5eb1904f 100644 --- a/test/client.c +++ b/test/client.c @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) char *local_ipaddr, *remote_ipaddr; char *dest = "127.0.0.1"; apr_port_t local_port, remote_port; - apr_interval_time_t read_timeout = 2 * APR_USEC_PER_SEC; + apr_interval_time_t timeout = 2 * APR_USEC_PER_SEC; apr_sockaddr_t *local_sa, *remote_sa; setbuf(stdout, NULL); @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) } if (argc > 2) { - read_timeout = APR_USEC_PER_SEC * atoi(argv[2]); + timeout = atoi(argv[2]); } fprintf(stdout, "Initializing........."); @@ -117,6 +117,14 @@ int main(int argc, char *argv[]) } fprintf(stdout, "OK\n"); + fprintf(stdout, "\tClient: Setting socket timeout......."); + stat = apr_setsocketopt(sock, APR_SO_TIMEOUT, timeout); + if (stat) { + fprintf(stderr, "Problem setting timeout: %d\n", stat); + exit(-1); + } + fprintf(stdout, "OK\n"); + fprintf(stdout, "\tClient: Connecting to socket......."); stat = apr_connect(sock, remote_sa); @@ -147,14 +155,6 @@ int main(int argc, char *argv[]) } fprintf(stdout, "OK\n"); - fprintf(stdout, "\tClient: Setting read timeout......."); - stat = apr_setsocketopt(sock, APR_SO_TIMEOUT, read_timeout); - if (stat) { - fprintf(stderr, "Problem setting timeout: %d\n", stat); - exit(-1); - } - fprintf(stdout, "OK\n"); - length = STRLEN; fprintf(stdout, "\tClient: Trying to receive data over socket......."); From 8592929ff7bfe1fedddc074966891e7ba974c688 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 10 Jul 2001 17:18:55 +0000 Subject: [PATCH 1917/7878] get rid of some unnecessary checking of apr_socket_t in apr_connect() if the fd is bad, the kernel is sure to let us know we no longer care about remote addr field at this point git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61911 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index c14ce547567..a2e4dc32dba 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -259,10 +259,6 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { int rc; - if ((sock->socketdes < 0) || (!sock->remote_addr)) { - return APR_ENOTSOCK; - } - do { rc = connect(sock->socketdes, (const struct sockaddr *)&sa->sa.sin, From be46ef3088f79865a713806deff124fa14e9e1da Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 10 Jul 2001 22:21:04 +0000 Subject: [PATCH 1918/7878] Remove the old apr_pools.c file hich is no longer used. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61912 13f79535-47bb-0310-9956-ffa450edef68 --- lib/apr_pools.c | 1467 ----------------------------------------------- 1 file changed, 1467 deletions(-) delete mode 100644 lib/apr_pools.c diff --git a/lib/apr_pools.c b/lib/apr_pools.c deleted file mode 100644 index e5a523b5392..00000000000 --- a/lib/apr_pools.c +++ /dev/null @@ -1,1467 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* - * Resource allocation code... the code here is responsible for making - * sure that nothing leaks. - * - * rst --- 4/95 --- 6/95 - */ - -#include "apr.h" -#include "apr_private.h" - -#include "apr_portable.h" /* for get_os_proc */ -#include "apr_strings.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_lib.h" -#include "apr_lock.h" -#include "apr_hash.h" - -#if APR_HAVE_STDIO_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#if APR_HAVE_SYS_SIGNAL_H -#include -#endif -#if APR_HAVE_SIGNAL_H -#include -#endif -#if APR_HAVE_SYS_WAIT_H -#include -#endif -#if APR_HAVE_SYS_TYPES_H -#include -#endif -#if APR_HAVE_UNISTD_H -#include -#endif -#if APR_HAVE_FCNTL_H -#include -#endif - -#if APR_HAVE_STRING_H -#include -#endif -#if APR_HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_MALLOC_H -#include -#endif - -/* Details of the debugging options can now be found in the developer - * section of the documentaion. - * ### gjs: where the hell is that? - * - * DEBUG_WITH_MPROTECT: - * This is known to work on Linux systems. It can only be used in - * conjunction with ALLOC_USE_MALLOC (for now). ALLOC_USE_MALLOC will - * use malloc() for *each* allocation, and then free it when the pool - * is cleared. When DEBUG_WITH_MPROTECT is used, the allocation is - * performed using an anonymous mmap() call to get page-aligned memory. - * Rather than free'ing the memory, an mprotect() call is made to make - * the memory non-accessible. Thus, if the memory is referred to *after* - * the pool is cleared, an immediate segfault occurs. :-) - * - * WARNING: Since every allocation creates a new mmap, aligned on a new - * page, this debugging option chews memory. A **LOT** of - * memory. Linux "recovered" the memory from my X Server process - * the first time I ran a "largish" sequence of operations. - * - * ### it should be possible to use this option without ALLOC_USE_MALLOC - * ### and simply mprotect the blocks at clear time (rather than put them - * ### into the free block list). - */ -/* -#define ALLOC_DEBUG -#define ALLOC_STATS -#define ALLOC_USE_MALLOC -#define DEBUG_WITH_MPROTECT -*/ - -/* magic numbers --- min free bytes to consider a free apr_pool_t block useable, - * and the min amount to allocate if we have to go to malloc() */ - -#ifndef BLOCK_MINFREE -#define BLOCK_MINFREE 4096 -#endif -#ifndef BLOCK_MINALLOC -#define BLOCK_MINALLOC 8192 -#endif - -#ifdef APR_POOL_DEBUG -/* first do some option checking... */ -#ifdef ALLOC_USE_MALLOC -#error "sorry, no support for ALLOC_USE_MALLOC and APR_POOL_DEBUG at the same time" -#endif /* ALLOC_USE_MALLOC */ - -#ifdef MULTITHREAD -# error "sorry, no support for MULTITHREAD and APR_POOL_DEBUG at the same time" -#endif /* MULTITHREAD */ - -#endif /* APR_POOL_DEBUG */ - -#ifdef ALLOC_USE_MALLOC -#undef BLOCK_MINFREE -#undef BLOCK_MINALLOC -#define BLOCK_MINFREE 0 -#define BLOCK_MINALLOC 0 -#endif /* ALLOC_USE_MALLOC */ - -#ifdef DEBUG_WITH_MPROTECT -#ifndef ALLOC_USE_MALLOC -#error "ALLOC_USE_MALLOC must be enabled to use DEBUG_WITH_MPROTECT" -#endif -#include -#endif - - -/** The memory allocation structure - */ -struct apr_pool_t { - /** The first block in this pool. */ - union block_hdr *first; - /** The last block in this pool. */ - union block_hdr *last; - /** The list of cleanups to run on pool cleanup. */ - struct cleanup *cleanups; - /** A list of processes to kill when this pool is cleared */ - struct process_chain *subprocesses; - /** The first sub_pool of this pool */ - struct apr_pool_t *sub_pools; - /** The next sibling pool */ - struct apr_pool_t *sub_next; - /** The previous sibling pool */ - struct apr_pool_t *sub_prev; - /** The parent pool of this pool */ - struct apr_pool_t *parent; - /** The first free byte in this pool */ - char *free_first_avail; -#ifdef ALLOC_USE_MALLOC - /** The allocation list if using malloc */ - void *allocation_list; -#endif -#ifdef APR_POOL_DEBUG - /** a list of joined pools */ - struct apr_pool_t *joined; -#endif - /** A function to control how pools behave when they receive ENOMEM */ - int (*apr_abort)(int retcode); - /** A place to hold user data associated with this pool */ - struct apr_hash_t *prog_data; -}; - - -/***************************************************************** - * - * Managing free storage blocks... - */ - -union align { - /* - * Types which are likely to have the longest RELEVANT alignment - * restrictions... - */ - - char *cp; - void (*f) (void); - long l; - FILE *fp; - double d; -}; - -#define CLICK_SZ (sizeof(union align)) - -union block_hdr { - union align a; - - /* Actual header... */ - - struct { - char *endp; - union block_hdr *next; - char *first_avail; -#ifdef APR_POOL_DEBUG - union block_hdr *global_next; - apr_pool_t *owning_pool; -#endif /* APR_POOL_DEBUG */ - } h; -}; - - -/* - * Static cells for managing our internal synchronisation. - */ -static union block_hdr *block_freelist = NULL; - -#if APR_HAS_THREADS -static apr_lock_t *alloc_mutex; -static apr_lock_t *spawn_mutex; -#endif - -#ifdef APR_POOL_DEBUG -static char *known_stack_point; -static int stack_direction; -static union block_hdr *global_block_list; -#define FREE_POOL ((apr_pool_t *)(-1)) -#endif /* APR_POOL_DEBUG */ - -#ifdef ALLOC_STATS -static apr_uint64_t num_free_blocks_calls; -static apr_uint64_t num_blocks_freed; -static unsigned max_blocks_in_one_free; -static unsigned num_malloc_calls; -static unsigned num_malloc_bytes; -#endif /* ALLOC_STATS */ - -#ifdef ALLOC_DEBUG -#define FILL_BYTE ((char)(0xa5)) -#define debug_fill(ptr,size) ((void)memset((ptr), FILL_BYTE, (size))) - -static APR_INLINE void debug_verify_filled(const char *ptr, const char *endp, - const char *error_msg) -{ - for ( ; ptr < endp; ++ptr) { - if (*ptr != FILL_BYTE) { - fputs(error_msg, stderr); - abort(); - exit(1); - } - } -} - -#else /* ALLOC_DEBUG */ -#define debug_fill(a,b) -#define debug_verify_filled(a,b,c) -#endif /* ALLOC_DEBUG */ - -#ifdef DEBUG_WITH_MPROTECT - -#define SIZEOF_BLOCK(p) (((union block_hdr *)(p) - 1)->a.l) - -static void *mprotect_malloc(apr_size_t size) -{ - union block_hdr * addr; - - size += sizeof(union block_hdr); - addr = mmap(NULL, size + sizeof(union block_hdr), - PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, - -1, 0); - if (addr == MAP_FAILED) - return NULL; - addr->a.l = size; - return addr + 1; -} - -static void mprotect_free(void *addr) -{ - apr_size_t size = SIZEOF_BLOCK(addr); - int rv = mprotect((union block_hdr *)addr - 1, size, PROT_NONE); - if (rv != 0) { - fprintf(stderr, "could not protect. errno=%d\n", errno); - abort(); - } -} - -static void *mprotect_realloc(void *addr, apr_size_t size) -{ - void *new_addr = mprotect_malloc(size); - apr_size_t old_size = SIZEOF_BLOCK(addr); - - if (size < old_size) - old_size = size; - memcpy(new_addr, addr, old_size); - mprotect_free(addr); - return new_addr; -} - -#define DO_MALLOC(s) mprotect_malloc(s) -#define DO_FREE(p) mprotect_free(p) -#define DO_REALLOC(p,s) mprotect_realloc(p,s) - -#else /* DEBUG_WITH_MPROTECT */ - -#define DO_MALLOC(s) malloc(s) -#define DO_FREE(p) free(p) -#define DO_REALLOC(p,s) realloc(p,s) - -#endif /* DEBUG_WITH_MPROTECT */ - -/* - * Get a completely new block from the system pool. Note that we rely on - * malloc() to provide aligned memory. - */ -static union block_hdr *malloc_block(apr_size_t size, apr_abortfunc_t abortfunc) -{ - union block_hdr *blok; - -#ifdef ALLOC_DEBUG - /* make some room at the end which we'll fill and expect to be - * always filled - */ - size += CLICK_SZ; -#endif /* ALLOC_DEBUG */ - -#ifdef ALLOC_STATS - ++num_malloc_calls; - num_malloc_bytes += size + sizeof(union block_hdr); -#endif /* ALLOC_STATS */ - - blok = (union block_hdr *) DO_MALLOC(size + sizeof(union block_hdr)); - if (blok == NULL) { - /* ### keep this fprintf here? */ - fprintf(stderr, "Ouch! malloc failed in malloc_block()\n"); - if (abortfunc != NULL) { - (void) (*abortfunc)(APR_ENOMEM); - } - return NULL; - } - - debug_fill(blok, size + sizeof(union block_hdr)); - - blok->h.next = NULL; - blok->h.first_avail = (char *) (blok + 1); - blok->h.endp = size + blok->h.first_avail; - -#ifdef ALLOC_DEBUG - blok->h.endp -= CLICK_SZ; -#endif /* ALLOC_DEBUG */ - -#ifdef APR_POOL_DEBUG - blok->h.global_next = global_block_list; - global_block_list = blok; - blok->h.owning_pool = NULL; -#endif /* APR_POOL_DEBUG */ - - return blok; -} - - - -#if defined(ALLOC_DEBUG) && !defined(ALLOC_USE_MALLOC) -static void chk_on_blk_list(union block_hdr *blok, union block_hdr *free_blk) -{ - debug_verify_filled(blok->h.endp, blok->h.endp + CLICK_SZ, - "[chk_on_blk_list] Ouch! Someone trounced the padding " - "at the end of a block!\n"); - while (free_blk) { - if (free_blk == blok) { - fprintf(stderr, "Ouch! Freeing free block\n"); - abort(); - exit(1); - } - free_blk = free_blk->h.next; - } -} -#else /* defined(ALLOC_DEBUG) && !defined(ALLOC_USE_MALLOC) */ -#define chk_on_blk_list(_x, _y) -#endif /* defined(ALLOC_DEBUG) && !defined(ALLOC_USE_MALLOC) */ - -/* Free a chain of blocks --- must be called with alarms blocked. */ - -static void free_blocks(union block_hdr *blok) -{ -#ifdef ALLOC_USE_MALLOC - union block_hdr *next; - - for ( ; blok; blok = next) { - next = blok->h.next; - DO_FREE(blok); - } -#else /* ALLOC_USE_MALLOC */ - -#ifdef ALLOC_STATS - unsigned num_blocks; -#endif /* ALLOC_STATS */ - - /* - * First, put new blocks at the head of the free list --- - * we'll eventually bash the 'next' pointer of the last block - * in the chain to point to the free blocks we already had. - */ - - union block_hdr *old_free_list; - - if (blok == NULL) { - return; /* Sanity check --- freeing empty pool? */ - } - -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_acquire(alloc_mutex); - } -#endif - old_free_list = block_freelist; - block_freelist = blok; - - /* - * Next, adjust first_avail pointers of each block --- have to do it - * sooner or later, and it simplifies the search in new_block to do it - * now. - */ - -#ifdef ALLOC_STATS - num_blocks = 1; -#endif /* ALLOC_STATS */ - - while (blok->h.next != NULL) { - -#ifdef ALLOC_STATS - ++num_blocks; -#endif /* ALLOC_STATS */ - - chk_on_blk_list(blok, old_free_list); - blok->h.first_avail = (char *) (blok + 1); - debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#ifdef APR_POOL_DEBUG - blok->h.owning_pool = FREE_POOL; -#endif /* APR_POOL_DEBUG */ - blok = blok->h.next; - } - - chk_on_blk_list(blok, old_free_list); - blok->h.first_avail = (char *) (blok + 1); - debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#ifdef APR_POOL_DEBUG - blok->h.owning_pool = FREE_POOL; -#endif /* APR_POOL_DEBUG */ - - /* Finally, reset next pointer to get the old free blocks back */ - - blok->h.next = old_free_list; - -#ifdef ALLOC_STATS - if (num_blocks > max_blocks_in_one_free) { - max_blocks_in_one_free = num_blocks; - } - ++num_free_blocks_calls; - num_blocks_freed += num_blocks; -#endif /* ALLOC_STATS */ - -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_release(alloc_mutex); - } -#endif /* APR_HAS_THREADS */ -#endif /* ALLOC_USE_MALLOC */ -} - -/* - * Get a new block, from our own free list if possible, from the system - * if necessary. Must be called with alarms blocked. - */ -static union block_hdr *new_block(apr_size_t min_size, apr_abortfunc_t abortfunc) -{ - union block_hdr **lastptr = &block_freelist; - union block_hdr *blok = block_freelist; - - /* First, see if we have anything of the required size - * on the free list... - */ - - while (blok != NULL) { - if ((apr_ssize_t)min_size + BLOCK_MINFREE <= blok->h.endp - blok->h.first_avail) { - *lastptr = blok->h.next; - blok->h.next = NULL; - debug_verify_filled(blok->h.first_avail, blok->h.endp, - "[new_block] Ouch! Someone trounced a block " - "on the free list!\n"); - return blok; - } - else { - lastptr = &blok->h.next; - blok = blok->h.next; - } - } - - /* Nope. */ - - min_size += BLOCK_MINFREE; - blok = malloc_block((min_size > BLOCK_MINALLOC) - ? min_size : BLOCK_MINALLOC, abortfunc); - return blok; -} - - -/* Accounting */ - -static apr_size_t bytes_in_block_list(union block_hdr *blok) -{ - apr_size_t size = 0; - - while (blok) { - size += blok->h.endp - (char *) (blok + 1); - blok = blok->h.next; - } - - return size; -} - - -/***************************************************************** - * - * Pool internals and management... - * NB that subprocesses are not handled by the generic cleanup code, - * basically because we don't want cleanups for multiple subprocesses - * to result in multiple three-second pauses. - */ - -struct process_chain; -struct cleanup; - -static void run_cleanups(struct cleanup *c); -static void free_proc_chain(struct process_chain *p); - -static apr_pool_t *permanent_pool; - -/* Each pool structure is allocated in the start of its own first block, - * so we need to know how many bytes that is (once properly aligned...). - * This also means that when a pool's sub-pool is destroyed, the storage - * associated with it is *completely* gone, so we have to make sure it - * gets taken off the parent's sub-pool list... - */ - -#define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) -#define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) - -APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, - apr_abortfunc_t abortfunc) -{ - union block_hdr *blok; - apr_pool_t *new_pool; - - -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_acquire(alloc_mutex); - } -#endif - - blok = new_block(POOL_HDR_BYTES, abortfunc); - new_pool = (apr_pool_t *) blok->h.first_avail; - blok->h.first_avail += POOL_HDR_BYTES; -#ifdef APR_POOL_DEBUG - blok->h.owning_pool = new_pool; -#endif - - memset((char *) new_pool, '\0', sizeof(struct apr_pool_t)); - new_pool->free_first_avail = blok->h.first_avail; - new_pool->first = new_pool->last = blok; - - if (p) { - new_pool->parent = p; - new_pool->sub_next = p->sub_pools; - if (new_pool->sub_next) { - new_pool->sub_next->sub_prev = new_pool; - } - p->sub_pools = new_pool; - } - -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_release(alloc_mutex); - } -#endif - - return new_pool; -} - -#ifdef APR_POOL_DEBUG -static void stack_var_init(char *s) -{ - char t; - - if (s < &t) { - stack_direction = 1; /* stack grows up */ - } - else { - stack_direction = -1; /* stack grows down */ - } -} -#endif - -#ifdef ALLOC_STATS -static void dump_stats(void) -{ - fprintf(stderr, - "alloc_stats: [%d] #free_blocks %" APR_INT64_T_FMT - " #blocks %" APR_INT64_T_FMT - " max %u #malloc %u #bytes %u\n", - (int) getpid(), - num_free_blocks_calls, - num_blocks_freed, - max_blocks_in_one_free, - num_malloc_calls, - num_malloc_bytes); -} -#endif - -/* ### why do we have this, in addition to apr_pool_sub_make? */ -APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, - apr_pool_t *parent_pool) -{ - apr_pool_t *newpool; - apr_abortfunc_t abortfunc; - - abortfunc = parent_pool ? parent_pool->apr_abort : NULL; - - newpool = apr_pool_sub_make(parent_pool, abortfunc); - if (newpool == NULL) { - return APR_ENOPOOL; - } - - newpool->prog_data = NULL; - newpool->apr_abort = abortfunc; - - *newcont = newpool; - return APR_SUCCESS; -} - -APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abortfunc, - apr_pool_t *pool) -{ - pool->apr_abort = abortfunc; -} - -APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool) -{ - return pool->apr_abort; -} - -APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool) -{ - return pool->parent; -} - -/***************************************************************** - * - * Managing generic cleanups. - */ - -struct cleanup { - const void *data; - apr_status_t (*plain_cleanup) (void *); - apr_status_t (*child_cleanup) (void *); - struct cleanup *next; -}; - -APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup) (void *), - apr_status_t (*child_cleanup) (void *)) -{ - struct cleanup *c; - - if (p != NULL) { - c = (struct cleanup *) apr_palloc(p, sizeof(struct cleanup)); - c->data = data; - c->plain_cleanup = plain_cleanup; - c->child_cleanup = child_cleanup; - c->next = p->cleanups; - p->cleanups = c; - } -} - -APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup) (void *)) -{ - struct cleanup *c; - struct cleanup **lastp; - - if (p == NULL) - return; - c = p->cleanups; - lastp = &p->cleanups; - while (c) { - if (c->data == data && c->plain_cleanup == cleanup) { - *lastp = c->next; - break; - } - - lastp = &c->next; - c = c->next; - } -} - -APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, - apr_status_t (*cleanup) (void *)) -{ - apr_pool_cleanup_kill(p, data, cleanup); - return (*cleanup) (data); -} - -static void run_cleanups(struct cleanup *c) -{ - while (c) { - (*c->plain_cleanup) ((void *)c->data); - c = c->next; - } -} - -static void run_child_cleanups(struct cleanup *c) -{ - while (c) { - (*c->child_cleanup) ((void *)c->data); - c = c->next; - } -} - -static void cleanup_pool_for_exec(apr_pool_t *p) -{ - run_child_cleanups(p->cleanups); - p->cleanups = NULL; - - for (p = p->sub_pools; p; p = p->sub_next) { - cleanup_pool_for_exec(p); - } -} - -APR_DECLARE(void) apr_pool_cleanup_for_exec(void) -{ -#if !defined(WIN32) && !defined(OS2) - /* - * Don't need to do anything on NT or OS/2, because I - * am actually going to spawn the new process - not - * exec it. All handles that are not inheritable, will - * be automajically closed. The only problem is with - * file handles that are open, but there isn't much - * I can do about that (except if the child decides - * to go out and close them - */ - cleanup_pool_for_exec(permanent_pool); -#endif /* ndef WIN32 */ -} - -APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) -{ - /* do nothing cleanup routine */ - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *globalp) -{ -#if APR_HAS_THREADS - apr_status_t status; -#endif -#ifdef APR_POOL_DEBUG - char s; - - known_stack_point = &s; - stack_var_init(&s); -#endif -#if APR_HAS_THREADS - status = apr_lock_create(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, - NULL, globalp); - if (status != APR_SUCCESS) { - apr_lock_destroy(alloc_mutex); - return status; - } - status = apr_lock_create(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, - NULL, globalp); - if (status != APR_SUCCESS) { - apr_lock_destroy(spawn_mutex); - return status; - } -#endif - permanent_pool = apr_pool_sub_make(globalp, NULL); - -#ifdef ALLOC_STATS - atexit(dump_stats); -#endif - - return APR_SUCCESS; -} - -APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp) -{ -#if APR_HAS_THREADS - apr_lock_destroy(alloc_mutex); - apr_lock_destroy(spawn_mutex); - alloc_mutex = NULL; - spawn_mutex = NULL; -#endif - apr_pool_destroy(globalp); -} - -/* We only want to lock the mutex if we are being called from apr_pool_clear. - * This is because if we also call this function from apr_destroy_real_pool, - * which also locks the same mutex, and recursive locks aren't portable. - * This way, we are garaunteed that we only lock this mutex once when calling - * either one of these functions. - */ -APR_DECLARE(void) apr_pool_clear(apr_pool_t *a) -{ - /* free the subpools. we can just loop -- the subpools will detach - themselve from us, so this is easy. */ - while (a->sub_pools) { - apr_pool_destroy(a->sub_pools); - } - - /* run cleanups and free any subprocesses. */ - run_cleanups(a->cleanups); - a->cleanups = NULL; - free_proc_chain(a->subprocesses); - a->subprocesses = NULL; - - /* free the pool's blocks, *except* for the first one. the actual pool - structure is contained in the first block. this also gives us some - ready memory for reallocating within this pool. */ - free_blocks(a->first->h.next); - a->first->h.next = NULL; - - /* this was allocated in self, or a subpool of self. it simply - disappears, so forget the hash table. */ - a->prog_data = NULL; - - /* no other blocks, so the last block is the first. */ - a->last = a->first; - - /* "free_first_avail" is the original first_avail when the pool was - constructed. (kind of a misnomer, but it means "when freeing, use - this as the first available ptr) - - restore the first/only block avail pointer, effectively resetting - the block to empty (except for the pool structure). */ - a->first->h.first_avail = a->free_first_avail; - debug_fill(a->first->h.first_avail, - a->first->h.endp - a->first->h.first_avail); - -#ifdef ALLOC_USE_MALLOC - { - void *c, *n; - - for (c = a->allocation_list; c; c = n) { - n = *(void **)c; - DO_FREE(c); - } - a->allocation_list = NULL; - } -#endif -} - -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) -{ - union block_hdr *blok; - - /* toss everything in the pool. */ - apr_pool_clear(a); - -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_acquire(alloc_mutex); - } -#endif - - /* detach this pool from its parent. */ - if (a->parent) { - if (a->parent->sub_pools == a) { - a->parent->sub_pools = a->sub_next; - } - if (a->sub_prev) { - a->sub_prev->sub_next = a->sub_next; - } - if (a->sub_next) { - a->sub_next->sub_prev = a->sub_prev; - } - } - -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_release(alloc_mutex); - } -#endif - - /* freeing the first block will include the pool structure. to prevent - a double call to apr_pool_destroy, we want to fill a NULL into - a->first so that the second call (or any attempted usage of the - pool) will segfault on a deref. - - Note: when ALLOC_DEBUG is on, the free'd blocks are filled with - 0xa5. That will cause future use of this pool to die since the pool - structure resides within the block's 0xa5 overwrite area. However, - we want this to fail much more regularly, so stash the NULL. - */ - blok = a->first; - a->first = NULL; - free_blocks(blok); -} - -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse) -{ - apr_size_t total_bytes = bytes_in_block_list(p->first); - - if (recurse) - for (p = p->sub_pools; p != NULL; p = p->sub_next) - total_bytes += apr_pool_num_bytes(p, 1); - - return total_bytes; -} - -APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void) -{ - return bytes_in_block_list(block_freelist); -} - -/***************************************************************** - * APR_POOL_DEBUG support - */ -#ifdef APR_POOL_DEBUG - -/* the unix linker defines this symbol as the last byte + 1 of - * the executable... so it includes TEXT, BSS, and DATA - */ -extern char _end; - -/* is ptr in the range [lo,hi) */ -#define is_ptr_in_range(ptr, lo, hi) \ - (((unsigned long)(ptr) - (unsigned long)(lo)) \ - < (unsigned long)(hi) - (unsigned long)(lo)) - -/* Find the pool that ts belongs to, return NULL if it doesn't - * belong to any pool. - */ -APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts) -{ - const char *s = ts; - union block_hdr **pb; - union block_hdr *b; - - /* short-circuit stuff which is in TEXT, BSS, or DATA */ - if (is_ptr_in_range(s, 0, &_end)) { - return NULL; - } - /* consider stuff on the stack to also be in the NULL pool... - * XXX: there's cases where we don't want to assume this - */ - if ((stack_direction == -1 && is_ptr_in_range(s, &ts, known_stack_point)) - || (stack_direction == 1 && is_ptr_in_range(s, known_stack_point, &ts))) { - abort(); - return NULL; - } - /* search the global_block_list */ - for (pb = &global_block_list; *pb; pb = &b->h.global_next) { - b = *pb; - if (is_ptr_in_range(s, b, b->h.endp)) { - if (b->h.owning_pool == FREE_POOL) { - fprintf(stderr, - "Ouch! find_pool() called on pointer in a free block\n"); - abort(); - exit(1); - } - if (b != global_block_list) { - /* - * promote b to front of list, this is a hack to speed - * up the lookup - */ - *pb = b->h.global_next; - b->h.global_next = global_block_list; - global_block_list = b; - } - return b->h.owning_pool; - } - } - return NULL; -} - -/* - * All blocks belonging to sub will be changed to point to p - * instead. This is a guarantee by the caller that sub will not - * be destroyed before p is. - */ -APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) -{ - union block_hdr *b; - - /* We could handle more general cases... but this is it for now. */ - if (sub->parent != p) { - fprintf(stderr, "pool_join: p is not parent of sub\n"); - abort(); - } - while (p->joined) { - p = p->joined; - } - sub->joined = p; - for (b = global_block_list; b; b = b->h.global_next) { - if (b->h.owning_pool == sub) { - b->h.owning_pool = p; - } - } -} -#endif - -/* return TRUE iff a is an ancestor of b - * NULL is considered an ancestor of all pools - */ -APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) -{ - if (a == NULL) { - return 1; - } -#ifdef APR_POOL_DEBUG - while (a->joined) { - a = a->joined; - } -#endif - while (b) { - if (a == b) { - return 1; - } - b = b->parent; - } - return 0; -} - -/***************************************************************** - * - * Allocating stuff... - */ - -APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) -{ -#ifdef ALLOC_USE_MALLOC - apr_size_t size = reqsize + CLICK_SZ; - void *ptr; - - ptr = DO_MALLOC(size); - if (ptr == NULL) { - fputs("Ouch! Out of memory!\n", stderr); - exit(1); - } - debug_fill(ptr, size); /* might as well get uninitialized protection */ - *(void **)ptr = a->allocation_list; - a->allocation_list = ptr; - return (char *)ptr + CLICK_SZ; -#else - - /* - * Round up requested size to an even number of alignment units - * (core clicks) - */ - apr_size_t nclicks; - apr_size_t size; - - /* First, see if we have space in the block most recently - * allocated to this pool - */ - - union block_hdr *blok; - char *first_avail; - char *new_first_avail; - - nclicks = 1 + ((reqsize - 1) / CLICK_SZ); - size = nclicks * CLICK_SZ; - - /* First, see if we have space in the block most recently - * allocated to this pool - */ - - blok = a->last; - first_avail = blok->h.first_avail; - - if (reqsize <= 0) { - return NULL; - } - - new_first_avail = first_avail + size; - - if (new_first_avail <= blok->h.endp) { - debug_verify_filled(first_avail, blok->h.endp, - "[apr_palloc] Ouch! Someone trounced past the end " - "of their allocation!\n"); - blok->h.first_avail = new_first_avail; - return (void *) first_avail; - } - - /* Nope --- get a new one that's guaranteed to be big enough */ - -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_acquire(alloc_mutex); - } -#endif - - blok = new_block(size, a->apr_abort); - a->last->h.next = blok; - a->last = blok; -#ifdef APR_POOL_DEBUG - blok->h.owning_pool = a; -#endif - -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_release(alloc_mutex); - } -#endif - - first_avail = blok->h.first_avail; - blok->h.first_avail += size; - - return (void *) first_avail; -#endif -} - -APR_DECLARE(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) -{ - void *res = apr_palloc(a, size); - memset(res, '\0', size); - return res; -} - -/***************************************************************** - * - * User data management functions - */ - -APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_pool_t *cont) -{ - apr_size_t keylen = strlen(key); - - if (cont->prog_data == NULL) - cont->prog_data = apr_hash_make(cont); - - if (apr_hash_get(cont->prog_data, key, keylen) == NULL){ - char *new_key = apr_pstrdup(cont, key); - apr_hash_set(cont->prog_data, new_key, keylen, data); - } - else { - apr_hash_set(cont->prog_data, key, keylen, data); - } - - apr_pool_cleanup_register(cont, data, cleanup, cleanup); - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *cont) -{ - if (cont->prog_data == NULL) - *data = NULL; - else - *data = apr_hash_get(cont->prog_data, key, strlen(key)); - return APR_SUCCESS; -} - -/***************************************************************** - * - * "Print" functions - */ - -/* - * apr_psprintf is implemented by writing directly into the current - * block of the pool, starting right at first_avail. If there's - * insufficient room, then a new block is allocated and the earlier - * output is copied over. The new block isn't linked into the pool - * until all the output is done. - * - * Note that this is completely safe because nothing else can - * allocate in this apr_pool_t while apr_psprintf is running. alarms are - * blocked, and the only thing outside of alloc.c that's invoked - * is apr_vformatter -- which was purposefully written to be - * self-contained with no callouts. - */ - -struct psprintf_data { - apr_vformatter_buff_t vbuff; -#ifdef ALLOC_USE_MALLOC - char *base; -#else - union block_hdr *blok; - int got_a_new_block; -#endif -}; - -static int psprintf_flush(apr_vformatter_buff_t *vbuff) -{ - struct psprintf_data *ps = (struct psprintf_data *)vbuff; -#ifdef ALLOC_USE_MALLOC - apr_size_t size; - char *ptr; - - size = (char *)ps->vbuff.curpos - ps->base; - ptr = DO_REALLOC(ps->base, 2*size); - if (ptr == NULL) { - fputs("Ouch! Out of memory!\n", stderr); - exit(1); - } - ps->base = ptr; - ps->vbuff.curpos = ptr + size; - ps->vbuff.endpos = ptr + 2*size - 1; - return 0; -#else - union block_hdr *blok; - union block_hdr *nblok; - apr_size_t cur_len; - char *strp; - - blok = ps->blok; - strp = ps->vbuff.curpos; - cur_len = strp - blok->h.first_avail; - - /* must try another blok */ -#if APR_HAS_THREADS - apr_lock_acquire(alloc_mutex); -#endif - nblok = new_block(2 * cur_len, NULL); -#if APR_HAS_THREADS - apr_lock_release(alloc_mutex); -#endif - memcpy(nblok->h.first_avail, blok->h.first_avail, cur_len); - ps->vbuff.curpos = nblok->h.first_avail + cur_len; - /* save a byte for the NUL terminator */ - ps->vbuff.endpos = nblok->h.endp - 1; - - /* did we allocate the current blok? if so free it up */ - if (ps->got_a_new_block) { - debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#if APR_HAS_THREADS - apr_lock_acquire(alloc_mutex); -#endif - blok->h.next = block_freelist; - block_freelist = blok; -#if APR_HAS_THREADS - apr_lock_release(alloc_mutex); -#endif - } - ps->blok = nblok; - ps->got_a_new_block = 1; - /* note that we've deliberately not linked the new block onto - * the pool yet... because we may need to flush again later, and - * we'd have to spend more effort trying to unlink the block. - */ - return 0; -#endif -} - -APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) -{ -#ifdef ALLOC_USE_MALLOC - struct psprintf_data ps; - void *ptr; - - ps.base = DO_MALLOC(512); - if (ps.base == NULL) { - fputs("Ouch! Out of memory!\n", stderr); - exit(1); - } - /* need room at beginning for allocation_list */ - ps.vbuff.curpos = ps.base + CLICK_SZ; - ps.vbuff.endpos = ps.base + 511; - apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); - *ps.vbuff.curpos++ = '\0'; - ptr = ps.base; - /* shrink */ - ptr = DO_REALLOC(ptr, (char *)ps.vbuff.curpos - (char *)ptr); - if (ptr == NULL) { - fputs("Ouch! Out of memory!\n", stderr); - exit(1); - } - *(void **)ptr = p->allocation_list; - p->allocation_list = ptr; - return (char *)ptr + CLICK_SZ; -#else - struct psprintf_data ps; - char *strp; - apr_size_t size; - - ps.blok = p->last; - ps.vbuff.curpos = ps.blok->h.first_avail; - ps.vbuff.endpos = ps.blok->h.endp - 1; /* save one for NUL */ - ps.got_a_new_block = 0; - - apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); - - strp = ps.vbuff.curpos; - *strp++ = '\0'; - - size = strp - ps.blok->h.first_avail; - size = (1 + ((size - 1) / CLICK_SZ)) * CLICK_SZ; - strp = ps.blok->h.first_avail; /* save away result pointer */ - ps.blok->h.first_avail += size; - - /* have to link the block in if it's a new one */ - if (ps.got_a_new_block) { - p->last->h.next = ps.blok; - p->last = ps.blok; -#ifdef APR_POOL_DEBUG - ps.blok->h.owning_pool = p; -#endif - } - - return strp; -#endif -} - -APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) -{ - va_list ap; - char *res; - - va_start(ap, fmt); - res = apr_pvsprintf(p, fmt, ap); - va_end(ap); - return res; -} - - -/***************************************************************** - * - * More grotty system stuff... subprocesses. Frump. These don't use - * the generic cleanup interface because I don't want multiple - * subprocesses to result in multiple three-second pauses; the - * subprocesses have to be "freed" all at once. If someone comes - * along with another resource they want to allocate which has the - * same property, we might want to fold support for that into the - * generic interface, but for now, it's a special case - */ - -APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, - enum kill_conditions how) -{ - struct process_chain *new = - (struct process_chain *) apr_palloc(a, sizeof(struct process_chain)); - - new->pid = pid; - new->kill_how = how; - new->next = a->subprocesses; - a->subprocesses = new; -} - -static void free_proc_chain(struct process_chain *procs) -{ - /* Dispose of the subprocesses we've spawned off in the course of - * whatever it was we're cleaning up now. This may involve killing - * some of them off... - */ - struct process_chain *p; - int need_timeout = 0; - - if (procs == NULL) { - return; /* No work. Whew! */ - } - - /* First, check to see if we need to do the SIGTERM, sleep, SIGKILL - * dance with any of the processes we're cleaning up. If we've got - * any kill-on-sight subprocesses, ditch them now as well, so they - * don't waste any more cycles doing whatever it is that they shouldn't - * be doing anymore. - */ - -#ifndef NEED_WAITPID - /* Pick up all defunct processes */ - for (p = procs; p; p = p->next) { - if (apr_proc_wait(p->pid, APR_NOWAIT) != APR_CHILD_NOTDONE) { - p->kill_how = kill_never; - } - } -#endif - - for (p = procs; p; p = p->next) { - if ((p->kill_how == kill_after_timeout) - || (p->kill_how == kill_only_once)) { - /* - * Subprocess may be dead already. Only need the timeout if not. - * Note: apr_proc_kill on Windows is TerminateProcess(), which is - * similar to a SIGKILL, so always give the process a timeout - * under Windows before killing it. - */ -#ifdef WIN32 - need_timeout = 1; -#else - if (apr_proc_kill(p->pid, SIGTERM) == APR_SUCCESS) { - need_timeout = 1; - } -#endif - } - else if (p->kill_how == kill_always) { - apr_proc_kill(p->pid, SIGKILL); - } - } - - /* Sleep only if we have to... */ - if (need_timeout) { - sleep(3); - } - - /* OK, the scripts we just timed out for have had a chance to clean up - * --- now, just get rid of them, and also clean up the system accounting - * goop... - */ - for (p = procs; p; p = p->next) { - if (p->kill_how == kill_after_timeout) { - apr_proc_kill(p->pid, SIGKILL); - } - } -#ifdef WIN32 - /* - * Do we need an APR function to clean-up a proc_t? - */ - { - for (p = procs; p; p = p->next) { - CloseHandle((HANDLE)p->pid->pid); - } - } -#endif /* WIN32 */ - - /* Now wait for all the signaled processes to die */ - for (p = procs; p; p = p->next) { - if (p->kill_how != kill_never) { - (void) apr_proc_wait(p->pid, APR_WAIT); - } - } -} From 856674503febac30ad2d814f534cd0382931e84d Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 11 Jul 2001 13:23:51 +0000 Subject: [PATCH 1919/7878] Remove some more unused files... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61913 13f79535-47bb-0310-9956-ffa450edef68 --- lib/Makefile.in | 12 ------- lib/apr_signal.c | 84 ------------------------------------------------ 2 files changed, 96 deletions(-) delete mode 100644 lib/Makefile.in delete mode 100644 lib/apr_signal.c diff --git a/lib/Makefile.in b/lib/Makefile.in deleted file mode 100644 index d3da7c5d652..00000000000 --- a/lib/Makefile.in +++ /dev/null @@ -1,12 +0,0 @@ - -TARGETS = - -# bring in rules.mk for standard functionality -@INCLUDE_RULES@ - -INCDIR=../include -OSDIR=$(INCDIR)/arch/@OSDIR@ -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) - -# DO NOT REMOVE diff --git a/lib/apr_signal.c b/lib/apr_signal.c deleted file mode 100644 index 2fcc77c66aa..00000000000 --- a/lib/apr_signal.c +++ /dev/null @@ -1,84 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_private.h" -#include "apr_lib.h" -#if APR_HAVE_SIGNAL_H -#include -#endif - -#if !defined(NO_USE_SIGACTION) && defined(HAVE_SIGACTION) -/* - * Replace standard signal() with the more reliable sigaction equivalent - * from W. Richard Stevens' "Advanced Programming in the UNIX Environment" - * (the version that does not automatically restart system calls). - */ -Sigfunc *apr_signal(int signo, Sigfunc * func) -{ - struct sigaction act, oact; - - act.sa_handler = func; - sigemptyset(&act.sa_mask); - act.sa_flags = 0; -#ifdef SA_INTERRUPT /* SunOS */ - act.sa_flags |= SA_INTERRUPT; -#endif - if (sigaction(signo, &act, &oact) < 0) - return SIG_ERR; - return oact.sa_handler; -} -#else -/* need some function in this file, otherwise the linker on NeXT bitches */ -void apr_signal_is_not_here(void) {} -#endif From 63460c34e2e400289b817beb1e36b8a299639ee5 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 11 Jul 2001 14:20:23 +0000 Subject: [PATCH 1920/7878] The 'pools are sms' patch. Think I got everything :) To use the patch you need to add --enable-sms into the configure line. You'll also need to do a make clean before rebuilding as we use defines for apr_palloc and so on... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61914 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 15 ++- include/apr_pools.h | 93 +++++++++++++--- include/apr_sms.h | 13 ++- memory/unix/apr_sms.c | 6 + memory/unix/apr_sms_pools.c | 211 ++++++++++++++++++++++++++++++++++++ memory/unix/sms_private.h | 5 + 6 files changed, 321 insertions(+), 22 deletions(-) create mode 100644 memory/unix/apr_sms_pools.c diff --git a/configure.in b/configure.in index 3218486b1ef..52f721a676a 100644 --- a/configure.in +++ b/configure.in @@ -152,11 +152,22 @@ AC_ARG_ENABLE(assert-memory,[ --enable-assert-memory Turn on asserts in the AP APR_ADDTO(NOTEST_CPPFLAGS,-DAPR_ASSERT_MEMORY) ])dnl -AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build (GCC)],[ +AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build (GCC)], if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS, -pg) fi -])dnl +)dnl + +POOLS_TARGET=apr_pools.lo +AC_ARG_ENABLE(sms, [ --enable-sms Build APR to use sms emulating pools], + echo "************* WARNING ***************" + echo "You have switched ON using SMS to emulate pools. This is highly" + echo "experimental and so you may want to think about it!" + echo "Presently this option is only advised for people working on SMS" + APR_ADDTO(CFLAGS, -DAPR_POOLS_ARE_SMS) + POOLS_TARGET=apr_sms_pools.lo +)dnl +AC_SUBST(POOLS_TARGET) dnl # this is the place to put specific options for platform/compiler dnl # combinations diff --git a/include/apr_pools.h b/include/apr_pools.h index 9dd5dc79fe1..1806416cf86 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -55,6 +55,10 @@ #ifndef APR_POOLS_H #define APR_POOLS_H +#ifdef APR_POOLS_ARE_SMS +#include "apr_sms.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -91,11 +95,13 @@ extern "C" { #define APR_POOL_DEBUG */ +#ifndef APR_POOLS_ARE_SMS /** The fundamental pool type */ typedef struct apr_pool_t apr_pool_t; /** A function that is called when allocation fails. */ typedef int (*apr_abortfunc_t)(int retcode); +#endif /* !APR_POOLS_ARE_SMS */ /** * @defgroup PoolDebug Pool Debugging functions. @@ -228,6 +234,7 @@ APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp); APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont); +#if !defined(APR_POOLS_ARE_SMS) || defined(DOXYGEN) /** * Set the function to be called when an allocation failure occurs. * @tip If the program wants APR to exit on a memory allocation error, @@ -286,17 +293,6 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *cont); -/** - * Make a sub pool from the current pool - * @param p The pool to use as a parent pool - * @param apr_abort A function to use if the pool cannot allocate more memory. - * @return The new sub-pool - * @remark The @a apr_abort function provides a way to quit the program if the - * machine is out of memory. By default, APR will return on error. - */ -APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, - int (*apr_abort)(int retcode)); - /** * Clear all memory in the pool and run all the cleanups. This also clears all * subpools. @@ -330,6 +326,35 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *c, apr_size_t reqsize); */ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); +#endif /* !APR_POOLS_ARE_SMS || DOXYGEN */ + +/** + * Make a sub pool from the current pool + * @param p The pool to use as a parent pool + * @param apr_abort A function to use if the pool cannot allocate more memory. + * @return The new sub-pool + * @remark The @a apr_abort function provides a way to quit the program if the + * machine is out of memory. By default, APR will return on error. + */ +APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, + int (*apr_abort)(int retcode)); + +#if defined(APR_POOL_DEBUG) || defined(DOXYGEN) +/** + * Report the number of bytes currently in the pool + * @param p The pool to inspect + * @param recurse Recurse/include the subpools' sizes + * @return The number of bytes + */ +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse); + +/** + * Report the number of bytes currently in the list of free blocks + * @return The number of bytes + */ +APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void); +#endif + /** * Register a function to be called when a pool is cleared or destroyed * @param p The pool register the cleanup with @@ -343,6 +368,7 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)); +#if !defined(APR_POOLS_ARE_SMS) || defined(DOXYGEN) /** * Remove a previously registered cleanup function * @param p The pool remove the cleanup from @@ -364,6 +390,14 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, apr_status_t (*cleanup)(void *)); +/** + * An empty cleanup function + * @param data The data to cleanup + */ +APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); + +#endif /* !APR_POOLS_ARE_SMS || DOXYGEN */ + /* Preparing for exec() --- close files, etc., but *don't* flush I/O * buffers, *don't* wait for subprocesses, and *don't* free any memory. */ @@ -373,12 +407,6 @@ APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, */ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); -/** - * An empty cleanup function - * @param data The data to cleanup - */ -APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); - /* * Pool accessor functions. * @@ -419,6 +447,37 @@ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); # define apr_pool_join(a,b) #endif /* APR_POOL_DEBUG */ + +#ifdef APR_POOLS_ARE_SMS +/* Add a number of defines where the sms equivalent is 1 to 1 */ +#define apr_pool_get_abort(p) apr_sms_get_abort(p) +#define apr_pool_set_abort(fn, p) apr_sms_set_abort(fn, p) + +#define apr_pool_get_parent(p) apr_sms_get_parent(p) + +#define apr_pool_userdata_set(d, k, c, p) \ + apr_sms_userdata_set(d, k, c, p) +#define apr_pool_userdata_get(d, k, p) \ + apr_sms_userdata_get(d, k, p) + +#define apr_pool_cleanup_kill(p, d, c) \ + apr_sms_cleanup_unregister(p, APR_ALL_CLEANUPS, d, c) +#define apr_pool_cleanup_run(p, d, c) \ + apr_sms_cleanup_run(p, APR_GENERAL_CLEANUP, d, c) + +/* we won't even bother to register these as they'll be ignored when + * we call the register fucntion + */ +#define apr_pool_cleanup_null NULL + +/* The parameters match exactly for these, so just define them directly */ +#define apr_palloc apr_sms_malloc +#define apr_pcalloc apr_sms_calloc +#define apr_pool_clear apr_sms_reset +#define apr_pool_destroy apr_sms_destroy + +#endif /* APR_POOLS_ARE_SMS */ + #ifdef __cplusplus } #endif diff --git a/include/apr_sms.h b/include/apr_sms.h index 82f92fb01e7..cf283c29fa9 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -67,14 +67,18 @@ typedef struct apr_sms_t apr_sms_t; #include "apr.h" #include "apr_errno.h" +#ifndef APR_POOLS_ARE_SMS #include "apr_pools.h" -#include "apr_lock.h" -#include "apr_portable.h" +#endif #ifdef __cplusplus extern "C" { #endif +#ifdef APR_POOLS_ARE_SMS +typedef struct apr_sms_t apr_pool_t; +typedef int (*apr_abortfunc_t)(int retcode); +#endif /********************************************************************** ** Defines @@ -150,7 +154,6 @@ extern "C" { #define APR_DEBUG_ALLOCATIONS 0 #define APR_DEBUG_ALLOC_FILE "/tmp/sms_alloc" - /** * @package APR memory system */ @@ -409,6 +412,10 @@ APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction); APR_DECLARE(void) apr_sms_tag(apr_sms_t *sms, const char *tag); #endif /* APR_DEBUG_TAG_SMS */ +#if SMS_ALLOC_STATS +APR_DECLARE(void) apr_sms_dump_stats(apr_sms_t *sms); +#endif + #ifdef __cplusplus } #endif diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index a9835510541..87d2c0bac99 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -295,8 +295,12 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, sms->threads = 1; #endif /* APR_HAS_THREADS */ +#ifndef APR_POOLS_ARE_SMS /* XXX - This should eventually be removed */ apr_pool_create(&sms->pool, pms ? pms->pool : NULL); +#else + sms->pool = sms; +#endif return APR_SUCCESS; } @@ -610,8 +614,10 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms) if (sms->sms_lock) apr_lock_destroy(sms->sms_lock); +#ifndef APR_POOLS_ARE_SMS /* XXX - This should eventually be removed */ apr_pool_destroy(sms->pool); +#endif /* 1 - If we have a self destruct, use it */ if (sms->destroy_fn) diff --git a/memory/unix/apr_sms_pools.c b/memory/unix/apr_sms_pools.c new file mode 100644 index 00000000000..bef536661f4 --- /dev/null +++ b/memory/unix/apr_sms_pools.c @@ -0,0 +1,211 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_pools.h" /* includes apr_sms.h" */ +#include "apr_sms_trivial.h" +#include "apr_errno.h" +#include "apr_lock.h" +#include "apr_portable.h" +#include "apr_lib.h" /* for apr_vformatter */ + +#include "sms_private.h" + +static int initialized = 0; +static apr_pool_t *permanent_pool = NULL; + +APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, apr_pool_t *p) +{ + if (!initialized) + /* Hmm, if we are given a parent here, is this correct? + * It should never happen, so we're probably OK.... + */ + return apr_sms_std_create(newpool); + + return apr_sms_trivial_create(newpool, p ? p : permanent_pool); +} + +APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t * p, + apr_abortfunc_t abort) +{ + apr_pool_t *np; + + if (apr_sms_trivial_create(&np, p) != APR_SUCCESS) + return NULL; + + apr_sms_set_abort(abort, np); + + return np; +} + +APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *pool, + const void *data, + apr_status_t (*plain_cleanup)(void*), + apr_status_t (*child_cleanup)(void*)) +{ + if (plain_cleanup == child_cleanup) { + /* we only need to register one as an ALL_CLEANUP */ + apr_sms_cleanup_register(pool, APR_ALL_CLEANUPS, data, plain_cleanup); + return; + } + if (plain_cleanup) + apr_sms_cleanup_register(pool, APR_GENERAL_CLEANUP, data, + plain_cleanup); + + if (child_cleanup) + apr_sms_cleanup_register(pool, APR_CHILD_CLEANUP, data, + child_cleanup); +} + +APR_DECLARE(void) apr_pool_cleanup_for_exec(void) +{ +#if !defined(WIN32) && !defined(OS2) + /* See note in apr_pools.c for why we do this :) */ + apr_sms_cleanup_run_type(permanent_pool, APR_CHILD_CLEANUP); +#endif +} + +APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *gp) +{ + initialized = 1; + return apr_sms_trivial_create(&permanent_pool, gp); +} + +APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *gp) +{ + apr_sms_destroy(permanent_pool); + /* so, are we still initialized after this???? */ +} + +APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) +{ + while (b && b != a) + b = b->parent; + + return b == a; +} + +/* This stuff needs to be reviewed, but here it is :) */ + +struct psprintf_data { + apr_vformatter_buff_t vbuff; + char *base; + apr_sms_t *sms; +}; + +static int psprintf_flush(apr_vformatter_buff_t *vbuff) +{ + struct psprintf_data *ps = (struct psprintf_data*)vbuff; + apr_size_t size; + char *ptr; + + size = (char*) ps->vbuff.curpos - ps->base; + ptr = apr_sms_realloc(ps->sms, ps->base, 2*size); + if (ptr == NULL) { + fputs("[psprintf_flush] Ouch! Out of memory!\n", stderr); + exit(1); + } + ps->base = ptr; + ps->vbuff.curpos = ptr + size; + ps->vbuff.endpos = ptr + 2 * size - 1; + return 0; +} + +APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) +{ + struct psprintf_data ps; + void *ptr; + + ps.sms = (apr_sms_t*)p; + ps.base = apr_sms_malloc(ps.sms, 512); + if (ps.base == NULL) { + fputs("[apr_pvsprintf] Ouch! Out of memory!\n", stderr); + exit(1); + } + ps.vbuff.curpos = ps.base; + ps.vbuff.endpos = ps.base + 511; + apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); + *ps.vbuff.curpos++ = '\0'; + ptr = ps.base; + ptr = apr_sms_realloc(ps.sms, ptr, (char*)ps.vbuff.curpos - (char*)ptr); + if (ptr == NULL) { + fputs("[apr_pvsprintf #2] Ouch! Out of memory!\n", stderr); + exit(1); + } + return (char*)ptr; +} + +APR_DECLARE_NONSTD(char*) apr_psprintf(apr_pool_t *p, const char *fmt, ...) +{ + va_list ap; + char *res; + + va_start(ap,fmt); + res = apr_pvsprintf(p, fmt, ap); + va_end(ap); + return res; +} + +APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, + enum kill_conditions how) +{ + struct process_chain *newpc = (struct process_chain*) + apr_sms_malloc(a, sizeof(struct process_chain)); + + newpc->pid = pid; + newpc->kill_how = how; + newpc->next = a -> subprocesses; + a->subprocesses = newpc; +} + diff --git a/memory/unix/sms_private.h b/memory/unix/sms_private.h index ddd4d880d7f..9b4791fcdb9 100644 --- a/memory/unix/sms_private.h +++ b/memory/unix/sms_private.h @@ -68,6 +68,7 @@ extern "C" { /** * The memory system structure */ + struct apr_sms_t { apr_sms_t *parent; @@ -96,6 +97,10 @@ struct apr_sms_t apr_status_t (*apr_abort)(int retcode); struct apr_hash_t *prog_data; +#ifdef APR_POOLS_ARE_SMS + struct process_chain *subprocesses; +#endif + #if APR_HAS_THREADS apr_status_t (*thread_register_fn) (apr_sms_t *sms, apr_os_thread_t thread); From 78f34006ad12c52b72cad56559d218b7a43d8f96 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 11 Jul 2001 17:00:00 +0000 Subject: [PATCH 1921/7878] All #define symbols need to be prefixed with APR so that make exports knows that they are conditional. Otherwise, it'll assume that the symbol is exported. Which in this case, it isn't - build failure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61915 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index cf283c29fa9..c61bf393e71 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -412,7 +412,7 @@ APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction); APR_DECLARE(void) apr_sms_tag(apr_sms_t *sms, const char *tag); #endif /* APR_DEBUG_TAG_SMS */ -#if SMS_ALLOC_STATS +#if APR_SMS_ALLOC_STATS APR_DECLARE(void) apr_sms_dump_stats(apr_sms_t *sms); #endif From 218998f15dce42aa5c8b247eaa5457d1d43b8be2 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 11 Jul 2001 17:08:59 +0000 Subject: [PATCH 1922/7878] Keep the ./configure --help output aligned correctly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61916 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 52f721a676a..4cfb6a9ddbc 100644 --- a/configure.in +++ b/configure.in @@ -152,14 +152,14 @@ AC_ARG_ENABLE(assert-memory,[ --enable-assert-memory Turn on asserts in the AP APR_ADDTO(NOTEST_CPPFLAGS,-DAPR_ASSERT_MEMORY) ])dnl -AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build (GCC)], +AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build (GCC)], if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS, -pg) fi )dnl POOLS_TARGET=apr_pools.lo -AC_ARG_ENABLE(sms, [ --enable-sms Build APR to use sms emulating pools], +AC_ARG_ENABLE(sms, [ --enable-sms Build APR to use sms emulating pools], echo "************* WARNING ***************" echo "You have switched ON using SMS to emulate pools. This is highly" echo "experimental and so you may want to think about it!" From 42ffa4bc66f902a3a59da1c5685291ebe2a1a262 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 11 Jul 2001 18:41:47 +0000 Subject: [PATCH 1923/7878] Win32: Get apr_connect to correctly handle timeouts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61917 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ network_io/win32/sockets.c | 46 +++++++++++++++++++++++++------------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index 90a52afda38..6ab3eab343d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) apr_connect()on Windows: Handle timeouts and returning the proper + status code when a connect is in progress. [Bill Stoddard] + *) apr_connect() on Unix: Handle EINTR during connect(). Handle timeouts. [Jeff Trawick] diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 5a567eb27dc..42072c23ec6 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -224,9 +224,9 @@ APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) } APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, - apr_pool_t *connection_context) + apr_pool_t *p) { - alloc_socket(new, connection_context); + alloc_socket(new, p); set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM); (*new)->timeout = -1; @@ -274,8 +274,7 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { - apr_status_t lasterror; - fd_set temp; + apr_status_t rv;; if ((sock->sock == INVALID_SOCKET) || (!sock->local_addr)) { return APR_ENOTSOCK; @@ -283,18 +282,35 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) if (connect(sock->sock, (const struct sockaddr *)&sa->sa.sin, sa->salen) == SOCKET_ERROR) { - lasterror = apr_get_netos_error(); - if (lasterror != APR_FROM_OS_ERROR(WSAEWOULDBLOCK)) { - return lasterror; + struct timeval tv, *tvptr; + fd_set fdset; + + rv = apr_get_netos_error(); + if (rv != APR_FROM_OS_ERROR(WSAEWOULDBLOCK)) { + return rv; } - /* wait for the connect to complete */ - FD_ZERO(&temp); - FD_SET(sock->sock, &temp); - /* the select(nfds, ...) nfds arg is ignored - * we don't have a bit table for fd_set on Win32, - * we have a messy dynamic crossref table. - */ - if (select(FD_SETSIZE+1, NULL, &temp, NULL, NULL) == SOCKET_ERROR) { + + if (sock->timeout == 0) { + /* Tell the app that the connect is in progress... + * Gotta play some games here. connect on Unix will return + * EINPROGRESS under the same circumstances that Windows + * returns WSAEWOULDBLOCK. Do some adhoc canonicalization... + */ + return APR_FROM_OS_ERROR(WSAEINPROGRESS); + } + + /* wait for the connect to complete or timeout */ + FD_ZERO(&fdset); + FD_SET(sock->sock, &fdset); + if (sock->timeout < 0) { + tvptr = NULL; + } + else { + tv.tv_sec = sock->timeout / APR_USEC_PER_SEC; + tv.tv_usec = sock->timeout % APR_USEC_PER_SEC; + tvptr = &tv; + } + if (select(FD_SETSIZE+1, NULL, &fdset, NULL, tvptr) == SOCKET_ERROR) { return apr_get_netos_error(); } } From 4ec0267910c0c9e6de4b14769f350227194831bc Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 11 Jul 2001 20:15:39 +0000 Subject: [PATCH 1924/7878] s/apr_sms_identity/apr_sms_get_identity/ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61918 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testmem.c b/test/testmem.c index acdc3b26203..0c50c6cd030 100644 --- a/test/testmem.c +++ b/test/testmem.c @@ -473,16 +473,16 @@ int main(int argc, char **argv) printf("Checking sms identities...\n"); TEST_NEQ(" Checking identity of standard memory system", - strcmp(apr_sms_identity(ams), "STANDARD"), 0, + strcmp(apr_sms_get_identity(ams), "STANDARD"), 0, "OK","Not STANDARD") TEST_NEQ(" Checking the identity of tracking memory system", - strcmp(apr_sms_identity(bms), "TRACKING"), 0, + strcmp(apr_sms_get_identity(bms), "TRACKING"), 0, "OK", "Not TRACKING") TEST_NEQ(" Checking the identity of blocks memory system", - strcmp(apr_sms_identity(dms), "BLOCKS"), 0, + strcmp(apr_sms_get_identity(dms), "BLOCKS"), 0, "OK", "Not BLOCKS") TEST_NEQ(" Checking the identity of trivial memory system", - strcmp(apr_sms_identity(tms), "TRIVIAL"), 0, + strcmp(apr_sms_get_identity(tms), "TRIVIAL"), 0, "OK", "Not TRIVIAL") printf("Big allocation test...\n"); From de9d91d25e27d46474fc52c6eac32e2c67d41f0e Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Thu, 12 Jul 2001 02:23:27 +0000 Subject: [PATCH 1925/7878] Fix a typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61919 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 42072c23ec6..c4bd5e3f146 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -274,7 +274,7 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { - apr_status_t rv;; + apr_status_t rv; if ((sock->sock == INVALID_SOCKET) || (!sock->local_addr)) { return APR_ENOTSOCK; From 69f252ccdfd062e7eef045943756e072dc5eabcb Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Thu, 12 Jul 2001 03:41:05 +0000 Subject: [PATCH 1926/7878] Handle the return from select correctly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61920 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index c4bd5e3f146..7a06fb64c3d 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -282,8 +282,9 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) if (connect(sock->sock, (const struct sockaddr *)&sa->sa.sin, sa->salen) == SOCKET_ERROR) { + int rc; struct timeval tv, *tvptr; - fd_set fdset; + fd_set wfdset, efdset; rv = apr_get_netos_error(); if (rv != APR_FROM_OS_ERROR(WSAEWOULDBLOCK)) { @@ -300,8 +301,11 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) } /* wait for the connect to complete or timeout */ - FD_ZERO(&fdset); - FD_SET(sock->sock, &fdset); + FD_ZERO(&wfdset); + FD_SET(sock->sock, &wfdset); + FD_ZERO(&efdset); + FD_SET(sock->sock, &efdset); + if (sock->timeout < 0) { tvptr = NULL; } @@ -310,9 +314,22 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) tv.tv_usec = sock->timeout % APR_USEC_PER_SEC; tvptr = &tv; } - if (select(FD_SETSIZE+1, NULL, &fdset, NULL, tvptr) == SOCKET_ERROR) { + rc = select(FD_SETSIZE+1, NULL, &wfdset, &efdset, tvptr); + if (rc == SOCKET_ERROR) { return apr_get_netos_error(); } + else if (!rc) { + return APR_FROM_OS_ERROR(WSAETIMEDOUT); + } + /* Evaluate the efdset */ + if (FD_ISSET(sock->sock, &efdset)) { + /* The connect failed. */ + unsigned int rclen = sizeof(rc); + if (getsockopt(sock->sock, SOL_SOCKET, SO_ERROR, (char*) &rc, &rclen)) { + return apr_get_netos_error(); + } + return APR_FROM_OS_ERROR(rc); + } } /* connect was OK .. amazing */ sock->remote_addr = sa; From 87738aea3ad50c7d1d51b6c8c3815102a9f6fc31 Mon Sep 17 00:00:00 2001 From: "Victor J. Orlikowski" Date: Thu, 12 Jul 2001 07:52:25 +0000 Subject: [PATCH 1927/7878] Making sure that the message matches the requirement. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61921 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 74d1c92e095..86cf95f3412 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -25,7 +25,7 @@ libtool=`build/PrintPath glibtool libtool` lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'` if test -z "$lt_pversion"; then echo "buildconf: libtool not found." -echo " You need libtool version 1.3 or newer installed" +echo " You need libtool version 1.3.3 or newer installed" echo " to build Apache from CVS." exit 1 fi From c9e56f2af40f385fe6d4729e05bafb0a3e404e91 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 12 Jul 2001 16:50:19 +0000 Subject: [PATCH 1928/7878] Add a SMS module that will maintain a free list per thread. This could be usefull when avoiding locking across threads. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61922 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms_threads.h | 110 ++++ memory/unix/Makefile.in | 3 +- memory/unix/apr_sms_threads.c | 962 ++++++++++++++++++++++++++++++++++ 3 files changed, 1074 insertions(+), 1 deletion(-) create mode 100644 include/apr_sms_threads.h create mode 100644 memory/unix/apr_sms_threads.c diff --git a/include/apr_sms_threads.h b/include/apr_sms_threads.h new file mode 100644 index 00000000000..f99e1b3d1c5 --- /dev/null +++ b/include/apr_sms_threads.h @@ -0,0 +1,110 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_SMS_THREADS_H +#define APR_SMS_THREADS_H + +#include "apr.h" +#include "apr_sms.h" + +#if APR_HAS_THREADS + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @package APR threads memory system + */ + +/** + * Create a pool like malloc/free/reset memory system + * @param mem_sys A pointer to the returned apr_sms_t* + * @param pms The parent memory system, used to allocate the memory + * that we will be threads. + * @deffunc apr_status_t apr_sms_threads_create(apr_sms_t **mem_sys, + * apr_sms_t *pms); + */ +APR_DECLARE(apr_status_t) apr_sms_threads_create(apr_sms_t **sms, + apr_sms_t *pms); + +/** + * Create a pool like malloc/free/reset memory system + * @param mem_sys A pointer to the returned apr_sms_t* + * @param pms The parent memory system, used to allocate the memory + * that we will be threads. + * @param min_alloc The minimal blocksize to allocate when getting + * memory from the parent + * @param min_free The minimal amount of memory to make sure is + * free in an allocated block from the parent + * @param max_free The amount of memory the sms may hold on to + * @deffunc apr_status_t apr_sms_threads_create_ex(apr_sms_t **mem_sys, + * apr_sms_t *pms, + * apr_size_t min_alloc, + * apr_size_t min_free, + * apr_size_t max_free); + */ +APR_DECLARE(apr_status_t) apr_sms_threads_create_ex(apr_sms_t **sms, + apr_sms_t *pms, + apr_size_t min_alloc, + apr_size_t min_free, + apr_size_t max_free); + +#ifdef __cplusplus +} +#endif + +#endif /* APR_HAS_THREADS */ + +#endif /* !APR_SMS_THREADS_H */ diff --git a/memory/unix/Makefile.in b/memory/unix/Makefile.in index 7d57f23cb92..7a122dc00fa 100644 --- a/memory/unix/Makefile.in +++ b/memory/unix/Makefile.in @@ -4,7 +4,8 @@ TARGETS = apr_sms.lo \ apr_sms_tracking.lo \ apr_sms_blocks.lo \ apr_sms_trivial.lo \ - apr_pools.lo + apr_sms_threads.lo \ + @POOLS_TARGET@ # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/memory/unix/apr_sms_threads.c b/memory/unix/apr_sms_threads.c new file mode 100644 index 00000000000..6475050b212 --- /dev/null +++ b/memory/unix/apr_sms_threads.c @@ -0,0 +1,962 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_general.h" +#include "apr_private.h" +#include "apr_sms.h" +#include "apr_sms_threads.h" +#include "apr_lock.h" +#include "sms_private.h" + +#if APR_HAS_THREADS + +static const char *module_identity = "THREADS"; +static const char *module_acct_identity = "THREADS_ACCT"; + +/* + * Simple thread memory system + */ + +/* INTERNALLY USED STRUCTURES */ + +typedef struct block_t +{ + struct node_t *node; +} block_t; + +typedef struct node_t +{ + struct node_t *next; + struct node_t *prev; + char *first_avail; + apr_size_t avail_size; + apr_uint16_t count; +} node_t; + +typedef struct thread_node_t +{ + struct thread_node_t *next; + struct thread_node_t **ref; + apr_os_thread_t thread; + node_t used_sentinel; + node_t free_sentinel; + node_t *self; + apr_size_t max_free; +} thread_node_t; + +/* + * Primes just below a power of 2: + * 3, 7, 13, 31, 61, 127, 251, 509, 1021, + * 2039, 4093, 8191, 16381, 32749, 65521 + */ + +#define HASH_SIZE 1021 +#define SIZEOF_HASHTABLE APR_ALIGN_DEFAULT(HASH_SIZE) + +typedef struct apr_sms_threads_t +{ + apr_sms_t sms_hdr; + node_t used_sentinel; + node_t free_sentinel; + node_t *self; + char *first_avail; + thread_node_t *hashtable[SIZEOF_HASHTABLE]; + apr_size_t min_free; + apr_size_t min_alloc; + apr_size_t max_free; + apr_size_t thread_max_free; + apr_lock_t *lock; +} apr_sms_threads_t; + +typedef struct apr_sms_threads_acct_t +{ + apr_sms_t sms_hdr; + apr_sms_threads_t *tms; +} apr_sms_threads_acct_t; + +#define SIZEOF_BLOCK_T APR_ALIGN_DEFAULT(sizeof(block_t)) +#define SIZEOF_NODE_T APR_ALIGN_DEFAULT(sizeof(node_t)) +#define SIZEOF_THREAD_NODE_T APR_ALIGN_DEFAULT(sizeof(thread_node_t)) +#define SIZEOF_SMS_THREADS_T APR_ALIGN_DEFAULT(sizeof(apr_sms_threads_t)) +#define SIZEOF_SMS_ACCT_T APR_ALIGN_DEFAULT(sizeof(apr_sms_threads_acct_t)) + +#define BLOCK_T(mem) ((block_t *)(mem)) +#define NODE_T(mem) ((node_t *)(mem)) +#define THREAD_NODE_T(mem) ((thread_node_t *)(mem)) +#define SMS_THREADS_T(sms) ((apr_sms_threads_t *)(sms)) +#define SMS_ACCT_T(sms) ((apr_sms_threads_acct_t *)(sms)) + +/* Magic numbers :) */ + +#define MIN_ALLOC 0x2000 +#define MIN_FREE 0x1000 +#define MAX_FREE 0x100000 +#define THREAD_MAX_FREE 0x80000 + +static void *apr_sms_threads_malloc(apr_sms_t *sms, + apr_size_t size) +{ + thread_node_t *thread_node; + apr_os_thread_t thread; + node_t *node, *sentinel; + apr_size_t node_size; + apr_uint16_t hash; + void *mem; + + /* Round up the size to the next 8 byte boundary */ + size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; + + thread = apr_os_thread_current(); + hash = thread % HASH_SIZE; + + /* If the thread wasn't registered before, we will segfault */ + thread_node = SMS_THREADS_T(sms)->hashtable[hash]; + while (thread_node->thread != thread) + thread_node = thread_node->next; + + node = thread_node->used_sentinel.prev; + + if (node->avail_size >= size) { + mem = node->first_avail; + node->avail_size -= size; + node->first_avail += size; + node->count++; + + BLOCK_T(mem)->node = node; + mem = (char *)mem + SIZEOF_BLOCK_T; + + return mem; + } + + /* reset the 'last' block, it will be replaced soon */ + node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + + /* browse the free list for a useable block */ + sentinel = &thread_node->free_sentinel; + sentinel->avail_size = size; + + node = sentinel->next; + while (node->avail_size < size) + node = node->next; + + if (node != sentinel) { + node->prev->next = node->next; + node->next->prev = node->prev; + + sentinel = &thread_node->used_sentinel; + node->prev = sentinel->prev; + node->prev->next = node; + node->next = sentinel; + sentinel->prev = node; + + if (node != thread_node->self) + thread_node->max_free += node->avail_size; + + mem = node->first_avail; + node->avail_size -= size; + node->first_avail += size; + node->count = 1; + + BLOCK_T(mem)->node = node; + mem = (char *)mem + SIZEOF_BLOCK_T; + + return mem; + } + + if (SMS_THREADS_T(sms)->lock) + apr_lock_acquire(SMS_THREADS_T(sms)->lock); + + /* browse the shared free list for a useable block */ + sentinel = &SMS_THREADS_T(sms)->free_sentinel; + sentinel->avail_size = size; + + node = sentinel->next; + while (node->avail_size < size) + node = node->next; + + if (node != sentinel) { + node->prev->next = node->next; + node->next->prev = node->prev; + + if (SMS_THREADS_T(sms)->lock) + apr_lock_release(SMS_THREADS_T(sms)->lock); + + sentinel = &thread_node->used_sentinel; + node->prev = sentinel->prev; + node->prev->next = node; + node->next = sentinel; + sentinel->prev = node; + + SMS_THREADS_T(sms)->max_free += node->avail_size; + + mem = node->first_avail; + node->avail_size -= size; + node->first_avail += size; + node->count = 1; + + BLOCK_T(mem)->node = node; + mem = (char *)mem + SIZEOF_BLOCK_T; + + return mem; + } + + if (SMS_THREADS_T(sms)->lock) + apr_lock_release(SMS_THREADS_T(sms)->lock); + + /* we have to allocate a new block from our parent */ + node_size = size + SMS_THREADS_T(sms)->min_free; + if (node_size < SMS_THREADS_T(sms)->min_alloc) + node_size = SMS_THREADS_T(sms)->min_alloc; + + node = apr_sms_malloc(sms->parent, node_size); + if (!node) { + /* restore the 'last' node to prevent the + * next allocation from segfaulting + */ + node = thread_node->used_sentinel.prev; + node->first_avail += node->avail_size; + node->avail_size = 0; + + return NULL; + } + + sentinel = &thread_node->used_sentinel; + node->prev = sentinel->prev; + node->prev->next = node; + node->next = sentinel; + sentinel->prev = node; + + mem = node->first_avail = (char *)node + SIZEOF_NODE_T; + node->first_avail += size; + node->avail_size = node_size - (node->first_avail - (char *)node); + node->count = 1; + + BLOCK_T(mem)->node = node; + mem = (char *)mem + SIZEOF_BLOCK_T; + + return mem; +} + +static apr_status_t apr_sms_threads_free(apr_sms_t *sms, void *mem) +{ + node_t *node, *sentinel; + thread_node_t *thread_node; + apr_os_thread_t thread; + apr_uint16_t hash; + + node = BLOCK_T((char *)mem - SIZEOF_BLOCK_T)->node; + + node->count--; + if (node->count) + return APR_SUCCESS; + + thread = apr_os_thread_current(); + hash = thread % HASH_SIZE; + + thread_node = SMS_THREADS_T(sms)->hashtable[hash]; + while (thread_node->thread != thread) + thread_node = thread_node->next; + + node->avail_size += node->first_avail - + ((char *)node + SIZEOF_NODE_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + + if (thread_node->used_sentinel.prev == node) + return APR_SUCCESS; + + node->next->prev = node->prev; + node->prev->next = node->next; + + if (thread_node->max_free >= node->avail_size || + node == thread_node->self) { + sentinel = &thread_node->free_sentinel; + node->prev = sentinel->prev; + node->prev->next = node; + node->next = sentinel; + sentinel->prev = node; + + if (node != thread_node->self) + thread_node->max_free -= node->avail_size; + + return APR_SUCCESS; + } + + if (sms->parent->free_fn && + node->avail_size > SMS_THREADS_T(sms)->max_free) + return apr_sms_free(sms->parent, node); + + if (SMS_THREADS_T(sms)->lock) + apr_lock_acquire(SMS_THREADS_T(sms)->lock); + + sentinel = &SMS_THREADS_T(sms)->free_sentinel; + node->prev = sentinel->prev; + node->prev->next = node; + node->next = sentinel; + sentinel->prev = node; + + SMS_THREADS_T(sms)->max_free -= node->avail_size; + + if (SMS_THREADS_T(sms)->lock) + apr_lock_release(SMS_THREADS_T(sms)->lock); + + return APR_SUCCESS; +} + +static apr_status_t apr_sms_threads_thread_register(apr_sms_t *sms, + apr_os_thread_t thread); + +static apr_status_t apr_sms_threads_reset(apr_sms_t *sms) +{ + node_t *node, *prev, *used_sentinel, *free_sentinel, *free_list; + thread_node_t *thread_node; + apr_uint16_t hash; + apr_size_t min_alloc, max_free; + + used_sentinel = &SMS_THREADS_T(sms)->used_sentinel; + free_sentinel = &SMS_THREADS_T(sms)->free_sentinel; + + free_list = NULL; + + if (SMS_THREADS_T(sms)->lock) + apr_lock_acquire(SMS_THREADS_T(sms)->lock); + + /* Actually, the thread creation function should have installed + * a cleanup which effectively kills all the threads created using + * this sms. Therefor it is not wise to call reset from another + * thread than the 'master' thread. + */ + for (hash = 0; hash < HASH_SIZE; hash++) { + while ((thread_node = SMS_THREADS_T(sms)->hashtable[hash]) != NULL) { + if ((*thread_node->ref = thread_node->next) != NULL) + thread_node->next->ref = thread_node->ref; + + node = thread_node->self; + node->prev->next = node->next; + node->next->prev = node->prev; + node->avail_size += node->first_avail - + ((char *)node + SIZEOF_NODE_T); + + node = thread_node->used_sentinel.prev; + node->avail_size += node->first_avail - + ((char *)node + SIZEOF_NODE_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + node->next = thread_node->free_sentinel.next; + node->next->prev = node; + + node = thread_node->free_sentinel.prev; + node->next = used_sentinel->next; + node->next->prev = node; + + used_sentinel->next = thread_node->used_sentinel.next; + used_sentinel->next->prev = used_sentinel; + + node = NODE_T(thread_node); + node->avail_size = thread_node->self->avail_size + + SIZEOF_THREAD_NODE_T; + node->first_avail = (char *)node + SIZEOF_NODE_T; + + node->next = used_sentinel->next; + node->next->prev = node; + used_sentinel->next = node; + node->prev = used_sentinel; + } + } + + node = SMS_THREADS_T(sms)->self; + node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + node->count = 0; + node->prev->next = node->next; + node->next->prev = node->prev; + + node = used_sentinel->prev; + node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + + if (sms->parent->free_fn) { + min_alloc = SMS_THREADS_T(sms)->min_alloc; + max_free = SMS_THREADS_T(sms)->max_free; + used_sentinel->avail_size = min_alloc; + while (max_free > min_alloc) { + if (node->avail_size <= max_free) { + if (node == used_sentinel) + break; + + max_free -= node->avail_size; + node->prev->next = node->next; + node->next->prev = node->prev; + + prev = node->prev; + + node->next = free_sentinel->next; + free_sentinel->next = node; + node->next->prev = node; + node->prev = free_sentinel; + + node = prev; + } + else + node = node->prev; + } + SMS_THREADS_T(sms)->max_free = max_free; + + used_sentinel->prev->next = NULL; + free_list = used_sentinel->next; + } + else { + node = used_sentinel->prev; + node->next = free_sentinel->next; + node->next->prev = node; + + node = used_sentinel->next; + node->prev = free_sentinel; + free_sentinel->next = node; + } + + node = SMS_THREADS_T(sms)->self; + node->next = node->prev = used_sentinel; + used_sentinel->next = used_sentinel->prev = node; + + sms->accounting = (apr_sms_t *)((char *)sms + SIZEOF_SMS_THREADS_T); + + apr_sms_threads_thread_register(sms, apr_os_thread_current()); + + if (SMS_THREADS_T(sms)->lock) + apr_lock_release(SMS_THREADS_T(sms)->lock); + + while ((node = free_list) != NULL) { + free_list = node->next; + apr_sms_free(sms->parent, node); + } + + return APR_SUCCESS; +} + +static apr_status_t apr_sms_threads_pre_destroy(apr_sms_t *sms) +{ + /* This function WILL always be called. However, be aware that the + * main sms destroy function knows that it's not wise to try and destroy + * the same piece of memory twice, so the destroy function in a child won't + * neccesarily be called. To guarantee we destroy the lock it's therefore + * destroyed here. + */ + + if (SMS_THREADS_T(sms)->lock) { + apr_lock_acquire(SMS_THREADS_T(sms)->lock); + apr_lock_destroy(SMS_THREADS_T(sms)->lock); + SMS_THREADS_T(sms)->lock = NULL; + } + + return APR_SUCCESS; +} + +static apr_status_t apr_sms_threads_destroy(apr_sms_t *sms) +{ + node_t *node, *next, *used_sentinel, *free_sentinel; + thread_node_t *thread_node; + apr_uint16_t hash; + + for (hash = 0; hash < HASH_SIZE; hash++) { + while ((thread_node = SMS_THREADS_T(sms)->hashtable[hash]) != NULL) { + if ((*thread_node->ref = thread_node->next) != NULL) + thread_node->next->ref = thread_node->ref; + + node = thread_node->self; + node->prev->next = node->next; + node->next->prev = node->prev; + + used_sentinel = &thread_node->used_sentinel; + free_sentinel = &thread_node->free_sentinel; + + free_sentinel->prev->next = NULL; + used_sentinel->prev->next = free_sentinel->next; + + node = used_sentinel->next; + while (node) { + next = node->next; + apr_sms_free(sms->parent, node); + node = next; + } + + apr_sms_free(sms->parent, thread_node); + } + } + + node = SMS_THREADS_T(sms)->self; + node->prev->next = node->next; + node->next->prev = node->prev; + + used_sentinel = &SMS_THREADS_T(sms)->used_sentinel; + free_sentinel = &SMS_THREADS_T(sms)->free_sentinel; + + free_sentinel->prev->next = NULL; + used_sentinel->prev->next = free_sentinel->next; + + node = used_sentinel->next; + while (node) { + next = node->next; + apr_sms_free(sms->parent, node); + node = next; + } + + return apr_sms_free(sms->parent, sms); +} + +static apr_status_t apr_sms_threads_thread_register(apr_sms_t *sms, + apr_os_thread_t thread) +{ + thread_node_t *thread_node; + node_t *node, *sentinel; + apr_uint16_t hash; + + hash = thread % HASH_SIZE; + + if (sms->threads > 1 && !SMS_THREADS_T(sms)->lock) { + apr_lock_create(&SMS_THREADS_T(sms)->lock, + APR_MUTEX, APR_LOCKALL, + NULL, sms->pool); + } + + if (SMS_THREADS_T(sms)->lock) + apr_lock_acquire(SMS_THREADS_T(sms)->lock); + + sentinel = &SMS_THREADS_T(sms)->free_sentinel; + if ((node = sentinel->next) != sentinel) { + node->prev->next = node->next; + node->next->prev = node->prev; + + thread_node = THREAD_NODE_T(node); + node = NODE_T((char *)thread_node + SIZEOF_THREAD_NODE_T); + node->avail_size = NODE_T(thread_node)->avail_size - + SIZEOF_THREAD_NODE_T; + node->first_avail = (char *)node + SIZEOF_NODE_T; + } + else { + thread_node = apr_sms_malloc(sms->parent, SMS_THREADS_T(sms)->min_alloc); + if (!thread_node) { + if (SMS_THREADS_T(sms)->lock) + apr_lock_release(SMS_THREADS_T(sms)->lock); + + return APR_ENOMEM; + } + + node = NODE_T((char *)thread_node + SIZEOF_THREAD_NODE_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + node->avail_size = SMS_THREADS_T(sms)->min_alloc - + (node->first_avail - (char *)thread_node); + } + node->count = 0; + + thread_node->self = node; + thread_node->max_free = SMS_THREADS_T(sms)->thread_max_free; + + sentinel = &thread_node->used_sentinel; + node->prev = node->next = sentinel; + sentinel->prev = sentinel->next = node; + + sentinel = &thread_node->free_sentinel; + sentinel->prev = sentinel->next = sentinel; + + thread_node->thread = thread; + if ((thread_node->next = SMS_THREADS_T(sms)->hashtable[hash]) != NULL) + thread_node->next->ref = &thread_node->next; + thread_node->ref = &SMS_THREADS_T(sms)->hashtable[hash]; + SMS_THREADS_T(sms)->hashtable[hash] = thread_node; + + if (SMS_THREADS_T(sms)->lock) + apr_lock_release(SMS_THREADS_T(sms)->lock); + + return APR_SUCCESS; +} + +static apr_status_t apr_sms_threads_thread_unregister(apr_sms_t *sms, + apr_os_thread_t thread) +{ + thread_node_t *thread_node; + node_t *node, *prev, *free_list, *used_sentinel, *free_sentinel; + apr_uint16_t hash; + apr_size_t min_alloc, max_free; + + hash = thread % HASH_SIZE; + free_list = NULL; + + if (SMS_THREADS_T(sms)->lock) + apr_lock_acquire(SMS_THREADS_T(sms)->lock); + + thread_node = SMS_THREADS_T(sms)->hashtable[hash]; + while (thread_node->thread != thread) + thread_node = thread_node->next; + + if ((*thread_node->ref = thread_node->next) != NULL) + thread_node->next->ref = thread_node->ref; + + node = thread_node->self; + node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); + node->prev->next = node->next; + node->next->prev = node->prev; + + used_sentinel = &thread_node->used_sentinel; + free_sentinel = &SMS_THREADS_T(sms)->free_sentinel; + + node = used_sentinel->prev; + node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + + node->next = thread_node->free_sentinel.next; + node->next->prev = node; + + node = thread_node->free_sentinel.prev; + node->next = used_sentinel; + used_sentinel->prev = node; + + min_alloc = SMS_THREADS_T(sms)->min_alloc; + max_free = SMS_THREADS_T(sms)->max_free; + used_sentinel->avail_size = min_alloc; + while (max_free > min_alloc) { + if (node->avail_size <= max_free) { + if (node == used_sentinel) + break; + + max_free -= node->avail_size; + node->prev->next = node->next; + node->next->prev = node->prev; + prev = node->prev; + + node->next = free_sentinel->next; + free_sentinel->next = node; + node->next->prev = node; + node->prev = free_sentinel; + + node = prev; + } + else + node = node->prev; + } + + used_sentinel->prev->next = NULL; + free_list = used_sentinel->next; + + node = NODE_T(thread_node); + node->avail_size = thread_node->self->avail_size + + SIZEOF_THREAD_NODE_T; + node->first_avail = (char *)node + SIZEOF_NODE_T; + + if (max_free >= node->avail_size) { + max_free -= node->avail_size; + + node->next = free_sentinel->next; + node->next->prev = node; + free_sentinel->next = node; + node->prev = free_sentinel; + } + else { + node->next = free_list; + free_list = node; + } + + SMS_THREADS_T(sms)->max_free = max_free; + + if (SMS_THREADS_T(sms)->lock) + apr_lock_release(SMS_THREADS_T(sms)->lock); + + while ((node = free_list) != NULL) { + free_list = node->next; + apr_sms_free(sms->parent, node); + } + + return APR_SUCCESS; +} + +static void *apr_sms_threads_acct_malloc(apr_sms_t *sms, apr_size_t size) +{ + apr_sms_threads_t *tms; + node_t *node, *sentinel; + apr_size_t node_size; + void *mem; + + tms = SMS_ACCT_T(sms)->tms; + + /* Round up the size to the next 8 byte boundary */ + size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; + + if (tms->lock) + apr_lock_acquire(tms->lock); + + node = tms->used_sentinel.prev; + + if (node->avail_size >= size) { + mem = node->first_avail; + node->avail_size -= size; + node->first_avail += size; + node->count++; + + if (tms->lock) + apr_lock_release(tms->lock); + + BLOCK_T(mem)->node = node; + mem = (char *)mem + SIZEOF_BLOCK_T; + + return mem; + } + + /* reset the 'last' block, it will be replaced soon */ + node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + + /* browse the free list for a useable block */ + sentinel = &tms->free_sentinel; + sentinel->avail_size = size; + + node = sentinel->next; + while (node->avail_size < size) + node = node->next; + + if (node != sentinel) { + node->prev->next = node->next; + node->next->prev = node->prev; + + sentinel = &tms->used_sentinel; + node->prev = sentinel->prev; + node->prev->next = node; + node->next = sentinel; + sentinel->prev = node; + + if (node != tms->self) + tms->max_free += node->avail_size; + + mem = node->first_avail; + node->avail_size -= size; + node->first_avail += size; + node->count = 1; + + if (tms->lock) + apr_lock_release(tms->lock); + + BLOCK_T(mem)->node = node; + mem = (char *)mem + SIZEOF_BLOCK_T; + + return mem; + } + + /* we have to allocate a new block from our parent */ + node_size = size + tms->min_free; + if (node_size < tms->min_alloc) + node_size = tms->min_alloc; + + node = apr_sms_malloc(sms->parent, node_size); + if (!node) { + /* restore the 'last' node, so the next allocation + * will not segfault + */ + node = tms->used_sentinel.prev; + node->first_avail += node->avail_size; + node->avail_size = 0; + + if (tms->lock) + apr_lock_release(tms->lock); + + return NULL; + } + + sentinel = &tms->used_sentinel; + node->prev = sentinel->prev; + node->prev->next = node; + node->next = sentinel; + sentinel->prev = node; + + mem = node->first_avail = (char *)node + SIZEOF_NODE_T; + node->first_avail += size; + node->avail_size = node_size - (node->first_avail - (char *)node); + node->count = 1; + + if (tms->lock) + apr_lock_release(tms->lock); + + BLOCK_T(mem)->node = node; + mem = (char *)mem + SIZEOF_BLOCK_T; + + return mem; +} + +static apr_status_t apr_sms_threads_acct_free(apr_sms_t *sms, void *mem) +{ + apr_sms_threads_t *tms; + node_t *node, *sentinel; + + tms = SMS_ACCT_T(sms)->tms; + node = BLOCK_T((char *)mem - SIZEOF_BLOCK_T)->node; + + if (tms->lock) + apr_lock_acquire(tms->lock); + + node->count--; + + if (node->count) { + if (tms->lock) + apr_lock_release(tms->lock); + + return APR_SUCCESS; + } + + node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + + if (tms->used_sentinel.prev != node) { + node->next->prev = node->prev; + node->prev->next = node->next; + + if (sms->parent->free_fn && + node->avail_size > tms->max_free && + node != tms->self) { + if (tms->lock) + apr_lock_release(tms->lock); + + return apr_sms_free(sms->parent, node); + } + + sentinel = &tms->free_sentinel; + node->prev = sentinel->prev; + node->prev->next = node; + node->next = sentinel; + sentinel->prev = node; + + if (node != tms->self) + tms->max_free -= node->avail_size; + } + + if (tms->lock) + apr_lock_release(tms->lock); + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_sms_threads_create(apr_sms_t **sms, + apr_sms_t *pms) +{ + return apr_sms_threads_create_ex(sms, pms, MIN_ALLOC, MIN_FREE, MAX_FREE); +} + +APR_DECLARE(apr_status_t) apr_sms_threads_create_ex(apr_sms_t **sms, + apr_sms_t *pms, + apr_size_t min_alloc, + apr_size_t min_free, + apr_size_t max_free) +{ + apr_sms_t *new_sms, *ams; + apr_sms_threads_t *tms; + node_t *node; + apr_status_t rv; + + *sms = NULL; + + min_alloc = APR_ALIGN_DEFAULT(min_alloc); + min_free = APR_ALIGN_DEFAULT(min_free); + + /* We're not a top level module, ie we have a parent, so + * we allocate the memory for the structure from our parent. + * This is safe as we shouldn't outlive our parent... + */ + new_sms = apr_sms_calloc(pms, min_alloc); + if (!new_sms) + return APR_ENOMEM; + + if ((rv = apr_sms_init(new_sms, pms)) != APR_SUCCESS) + return rv; + + new_sms->malloc_fn = apr_sms_threads_malloc; + new_sms->free_fn = apr_sms_threads_free; + new_sms->reset_fn = apr_sms_threads_reset; + new_sms->pre_destroy_fn = apr_sms_threads_pre_destroy; + new_sms->destroy_fn = apr_sms_threads_destroy; + new_sms->thread_register_fn = apr_sms_threads_thread_register; + new_sms->thread_unregister_fn = apr_sms_threads_thread_unregister; + new_sms->identity = module_identity; + + ams = (apr_sms_t *)((char *)new_sms + SIZEOF_SMS_THREADS_T); + + node = NODE_T((char *)ams + SIZEOF_SMS_ACCT_T); + node->first_avail = (char *)node + SIZEOF_NODE_T; + node->avail_size = min_alloc - (node->first_avail - (char *)new_sms); + node->count = 0; + + tms = SMS_THREADS_T(new_sms); + tms->min_alloc = min_alloc; + tms->min_free = min_free; + tms->max_free = max_free; + tms->thread_max_free = THREAD_MAX_FREE; + tms->self = node; + + node->next = node->prev = &tms->used_sentinel; + tms->used_sentinel.next = tms->used_sentinel.prev = node; + tms->free_sentinel.next = tms->free_sentinel.prev = &tms->free_sentinel; + + apr_sms_init(ams, new_sms); + ams->malloc_fn = apr_sms_threads_acct_malloc; + ams->free_fn = apr_sms_threads_acct_free; + ams->identity = module_acct_identity; + SMS_ACCT_T(ams)->tms = tms; + apr_sms_post_init(ams); + + new_sms->accounting = ams; + + apr_sms_post_init(new_sms); + + *sms = new_sms; + return APR_SUCCESS; +} + +#endif /* APR_HAS_THREADS */ + From 363e82a7433292abf977653a5ddc8a99590ca3c8 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 12 Jul 2001 16:52:14 +0000 Subject: [PATCH 1929/7878] Changed the calls to apr_sms_trivial_create to apr_sms_trivial_create_ex calls. This way we can set min_free to 0, which I did. Hopefully this fixes the memory hunger httpd with pools as sms has. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61923 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_pools.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/memory/unix/apr_sms_pools.c b/memory/unix/apr_sms_pools.c index bef536661f4..624a4b5ba8b 100644 --- a/memory/unix/apr_sms_pools.c +++ b/memory/unix/apr_sms_pools.c @@ -73,7 +73,8 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, apr_pool_t *p) */ return apr_sms_std_create(newpool); - return apr_sms_trivial_create(newpool, p ? p : permanent_pool); + return apr_sms_trivial_create_ex(newpool, p ? p : permanent_pool, + 0x2000, 0, 0x80000); } APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t * p, @@ -118,14 +119,23 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void) APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *gp) { + apr_status_t rv; + + if ((rv = apr_sms_trivial_create_ex(&permanent_pool, gp, + 0x2000, 0, 0x80000)) != APR_SUCCESS) + return rv; + initialized = 1; - return apr_sms_trivial_create(&permanent_pool, gp); + + return APR_SUCCESS; } APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *gp) { - apr_sms_destroy(permanent_pool); - /* so, are we still initialized after this???? */ + if (initialized) + apr_sms_destroy(permanent_pool); + + initialized = 0; } APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) From 210c6c685cfc5dc3d8070e89b5e0de4db2005e98 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 12 Jul 2001 16:57:52 +0000 Subject: [PATCH 1930/7878] Fix up the min_free setting in the create function is a way that it always reserves enough extra space to fit the node header. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61924 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_trivial.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index 20e5c7c6871..14165e689fd 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -485,7 +485,9 @@ APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, min_alloc = APR_ALIGN_DEFAULT(min_alloc); min_free = APR_ALIGN_DEFAULT(min_free); - + if (min_free < SIZEOF_NODE_T) + min_free = SIZEOF_NODE_T; + /* We're not a top level module, ie we have a parent, so * we allocate the memory for the structure from our parent. * This is safe as we shouldn't outlive our parent... From 1c830197c804f002ef78da9e2eb9127d1e53827e Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Thu, 12 Jul 2001 17:30:14 +0000 Subject: [PATCH 1931/7878] Set the DETACHED_PROCESS creation flag git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61925 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 394f871112b..4b19b650dc4 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -317,11 +317,11 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, */ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, - const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, - apr_pool_t *cont) + const char *progname, + const char * const *args, + const char * const *env, + apr_procattr_t *attr, + apr_pool_t *cont) { apr_size_t i, iEnvBlockLen; char *cmdline; @@ -329,6 +329,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, char *envstr; char *pEnvBlock, *pNext; PROCESS_INFORMATION pi; + DWORD dwCreationFlags = 0; new->in = attr->parent_in; new->err = attr->parent_err; @@ -340,6 +341,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * window we are starting in. And we had better redfine our * handles for STDIN, STDOUT, and STDERR. */ + dwCreationFlags |= DETACHED_PROCESS; attr->si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; attr->si.wShowWindow = SW_HIDE; @@ -427,7 +429,12 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } - if (CreateProcess(NULL, cmdline, NULL, NULL, TRUE, 0, pEnvBlock, attr->currdir, + if (CreateProcess(NULL, cmdline, /* Command line */ + NULL, NULL, /* Proc & thread security attributes */ + TRUE, /* Inherit handles */ + dwCreationFlags, /* Creation flags */ + pEnvBlock, /* Environment block */ + attr->currdir, /* Current directory name */ &attr->si, &pi)) { // TODO: THIS IS BADNESS From 031c6726d29d10c17be42d261cd1a5e86e134b64 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Jul 2001 18:27:53 +0000 Subject: [PATCH 1932/7878] Goodbye lib/apr_signals.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61926 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 8 -------- libapr.dsp | 8 -------- 2 files changed, 16 deletions(-) diff --git a/apr.dsp b/apr.dsp index 06e22d5950f..e966aa786e2 100644 --- a/apr.dsp +++ b/apr.dsp @@ -341,14 +341,6 @@ SOURCE=.\dso\win32\dso.c SOURCE=.\include\arch\win32\dso.h # End Source File # End Group -# Begin Group "lib" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\lib\apr_signal.c -# End Source File -# End Group # Begin Group "i18n" # PROP Default_Filter "" diff --git a/libapr.dsp b/libapr.dsp index cb5ff1b2a4a..7575959b36f 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -347,14 +347,6 @@ SOURCE=.\dso\win32\dso.c SOURCE=.\include\arch\win32\dso.h # End Source File # End Group -# Begin Group "lib" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\lib\apr_signal.c -# End Source File -# End Group # Begin Group "i18n" # PROP Default_Filter "" From 90d31017980cf1c74e868bf676b37ee3c1c91944 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Jul 2001 18:58:57 +0000 Subject: [PATCH 1933/7878] Return LARGE_FILE support for win32 sendfile (quiets compiler) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61927 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 865dbca6bcb..43cec4f2ee5 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -246,6 +246,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, { apr_status_t status = APR_SUCCESS; apr_ssize_t rv; + apr_off_t curoff = *offset; DWORD dwFlags = 0; DWORD nbytes; OVERLAPPED overlapped; @@ -258,9 +259,6 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, /* Initialize the overlapped structure */ memset(&overlapped,'\0', sizeof(overlapped)); - if (offset && *offset) { - overlapped.Offset = *offset; - } #ifdef WAIT_FOR_EVENT overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); #endif @@ -310,6 +308,10 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, } } + overlapped.Offset = (DWORD)(curoff); +#if APR_HAS_LARGE_FILES + overlapped.OffsetHigh = (DWORD)(curoff >> 32); +#endif rv = TransmitFile(sock->sock, /* socket */ file->filehand, /* open file descriptor of the file to be sent */ nbytes, /* number of bytes to send. 0=send all */ @@ -357,7 +359,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, } bytes_to_send -= nbytes; *len += nbytes; - overlapped.Offset += nbytes; + curoff += nbytes; } From fa3b03712511c74d31486011d8acebea8d81e1ff Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Jul 2001 23:25:57 +0000 Subject: [PATCH 1934/7878] Fix the iovec len on win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61928 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 7ea5ef732ea..6c48487300d 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -324,8 +324,8 @@ typedef int apr_wait_t; /* struct iovec is needed to emulate Unix writev */ struct iovec { - char* iov_base; - int iov_len; + char* iov_base; + size_t iov_len; }; /* Nasty Win32 .h ommissions we really need */ From 89f1b55fcb337e0d8f701001ce463d6ec45e3db2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Jul 2001 23:26:40 +0000 Subject: [PATCH 1935/7878] Assure we resolve_ident to get the inode,device and nlinks on Win32's apr_stat/lstat implementations. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61929 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 86 +++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 32 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index b5a41f4589f..6c3afb5fccf 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -141,8 +141,8 @@ static void resolve_prot(apr_finfo_t *finfo, apr_int32_t wanted, PACL dacl) } } -static int resolve_ident(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) +static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname, + apr_int32_t wanted, apr_pool_t *cont) { apr_file_t *thefile = NULL; apr_status_t rv; @@ -179,12 +179,13 @@ static int resolve_ident(apr_finfo_t *finfo, const char *fname, apr_file_close(thefile); } } + if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) return (rv); + /* We picked up this case above and had opened the link's properties */ if (wanted & APR_FINFO_LINK) finfo->valid |= APR_FINFO_LINK; - finfo->fname = thefile->fname; return rv; } @@ -383,7 +384,9 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want finfo->valid |= APR_FINFO_IDENT | APR_FINFO_NLINK; - if (wanted &= ~finfo->valid) { + /* If we still want something more (besides the name) go get it! + */ + if ((wanted &= ~finfo->valid) & ~APR_FINFO_NAME) { apr_oslevel_e os_level; if (apr_get_oslevel(thefile->cntxt, &os_level)) os_level = APR_WIN_95; @@ -402,10 +405,13 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *cont) { - /* XXX: is constant - needs testing - which needs a lighter-weight root test fn */ + /* XXX: is constant - needs testing - which requires a lighter-weight root test fn */ int isroot = 0; + apr_status_t ident_rv = 0; + apr_status_t rv; #ifdef APR_HAS_UNICODE_FS apr_wchar_t wfname[APR_PATH_MAX]; + #endif apr_oslevel_e os_level; char *filename = NULL; @@ -427,9 +433,23 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, return APR_ENAMETOOLONG; } + if ((os_level >= APR_WIN_NT) + && (wanted & (APR_FINFO_IDENT | APR_FINFO_NLINK))) { + /* FindFirstFile and GetFileAttributesEx can't figure the inode, + * device or number of links, so we need to resolve with an open + * file handle. If the user has asked for these fields, fall over + * to the get file info by handle method. If we fail, or the user + * also asks for the file name, continue by our usual means. + */ + if ((ident_rv = resolve_ident(finfo, fname, wanted, cont)) + == APR_SUCCESS) + return ident_rv; + else if (ident_rv == APR_INCOMPLETE) + wanted &= ~finfo->valid; + } + #ifdef APR_HAS_UNICODE_FS if (os_level >= APR_WIN_NT) { - apr_status_t rv; if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) / sizeof(apr_wchar_t), fname)) return rv; @@ -458,7 +478,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, filename = apr_pstrdup(cont, tmpname); } } - else + else #endif if ((os_level >= APR_WIN_98) && (!(wanted & APR_FINFO_NAME) || isroot)) { @@ -502,36 +522,38 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, filename = apr_pstrdup(cont, FileInfo.n.cFileName); } - if (fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 0)) - { - /* Go the extra mile to assure we have a file. WinNT/2000 seems - * to reliably translate char devices to the path '\\.\device' - * so go ask for the full path. - */ - if (os_level >= APR_WIN_NT) { + if (ident_rv != APR_INCOMPLETE) { + if (fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 0)) + { + /* Go the extra mile to assure we have a file. WinNT/2000 seems + * to reliably translate char devices to the path '\\.\device' + * so go ask for the full path. + */ + if (os_level >= APR_WIN_NT) { #ifdef APR_HAS_UNICODE_FS - apr_wchar_t tmpname[APR_FILE_MAX]; - apr_wchar_t *tmpoff; - if (GetFullPathNameW(wfname, sizeof(tmpname) / sizeof(apr_wchar_t), - tmpname, &tmpoff)) - { - if ((tmpoff == tmpname + 4) - && !wcsncmp(tmpname, L"\\\\.\\", 4)) - finfo->filetype = APR_CHR; - } + apr_wchar_t tmpname[APR_FILE_MAX]; + apr_wchar_t *tmpoff; + if (GetFullPathNameW(wfname, sizeof(tmpname) / sizeof(apr_wchar_t), + tmpname, &tmpoff)) + { + if ((tmpoff == tmpname + 4) + && !wcsncmp(tmpname, L"\\\\.\\", 4)) + finfo->filetype = APR_CHR; + } #else - char tmpname[APR_FILE_MAX]; - char *tmpoff; - if (GetFullPathName(fname, sizeof(tmpname), tmpname, &tmpoff)) - { - if ((tmpoff == tmpname + 4) - && !strncmp(tmpname, "\\\\.\\", 4)) - finfo->filetype = APR_CHR; - } + char tmpname[APR_FILE_MAX]; + char *tmpoff; + if (GetFullPathName(fname, sizeof(tmpname), tmpname, &tmpoff)) + { + if ((tmpoff == tmpname + 4) + && !strncmp(tmpname, "\\\\.\\", 4)) + finfo->filetype = APR_CHR; + } #endif + } } + finfo->cntxt = cont; } - finfo->cntxt = cont; if (filename && !isroot) { finfo->name = filename; From 18a58f56869036064194408b7a62dfd0074d9090 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Jul 2001 23:27:50 +0000 Subject: [PATCH 1936/7878] we are definately ok with these values, so cast off the converison err. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61930 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 7a06fb64c3d..7c854f9ed8d 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -310,8 +310,8 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) tvptr = NULL; } else { - tv.tv_sec = sock->timeout / APR_USEC_PER_SEC; - tv.tv_usec = sock->timeout % APR_USEC_PER_SEC; + tv.tv_sec = (long)(sock->timeout / APR_USEC_PER_SEC); + tv.tv_usec = (long)(sock->timeout % APR_USEC_PER_SEC); tvptr = &tv; } rc = select(FD_SETSIZE+1, NULL, &wfdset, &efdset, tvptr); From 91d2f11ec12037173b8de3b5149b10b121434628 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Jul 2001 23:35:56 +0000 Subject: [PATCH 1937/7878] You can't map more bytes than a size_t ... eliminate an abused apr_off_t git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61931 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_mmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 99abc3831fc..0cfc4adefcd 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -103,7 +103,7 @@ struct apr_mmap_t { /** The start of the memory mapped area */ void *mm; /** The amount of data in the mmap */ - apr_off_t size; + apr_size_t size; }; #if APR_HAS_MMAP From 880d2d12d0accf0f7540e65f9351cc1a261516df Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 13 Jul 2001 06:19:01 +0000 Subject: [PATCH 1938/7878] Implement POSIX pthread cross process locks that are "robust" - when the process which owns the mutex dies, another process attempting to acquire that lock will now receive EOWNERDIED instead of deadlocking. It is then the responsibility of that holder of the mutex to restore it to a consistent state. This is lightly tested on Solaris 8/Intel 4/01. The mutex is recovered (i.e. no deadlock), but this probably needs to be tested further. AFAIK, Solaris 8 is the only platform which implements this. Because the possiblity of the process dying while holding the lock is too great, upgrade the conditions for using a pthread mutex for an interprocess lock to require robust locks. This probably means that Solaris (and maybe only Solaris 8) will use pthread_mutex_t for cross-process locks. Too bad. This completely avoids the question of why my httpd is segfaulting in the first place, but now it doesn't deadlock when it does (to be fair, this is with mod_mbox). BTW, the threaded MPM isn't starting up enough child processes (only 1). StartServers is 3 - is the count of 3 supposed to include the parent and the unixd child? If so, that's lame. If not, we've got a bug somewhere in threaded MPM on Solaris 8. I'll have to stare at my two whiteboards full of the diagrams of threaded MPM more. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61932 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 37 ++++++++++++++++++++++++++++++++++--- locks/unix/crossproc.c | 31 ++++++++++++++++++++++++++++++- 2 files changed, 64 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 4cfb6a9ddbc..768a0ba6105 100644 --- a/configure.in +++ b/configure.in @@ -985,15 +985,45 @@ if test "$threads" = "1"; then exit(0); }], [], [ac_cv_func_pthread_mutexattr_setpshared=no], [ac_cv_func_pthread_mutexattr_setpshared=no])) + if test "$ac_cv_func_pthread_mutexattr_setpshared" = "yes"; then + AC_CHECK_FUNCS(pthread_mutexattr_setrobust_np) + if test "$ac_cv_func_pthread_mutexattr_setrobust_np" = "no"; then + AC_TRY_COMPILE([#define _POSIX_THREAD_PRIO_INHERIT + #include + #include ],[ + int main() + { + pthread_mutex_t mutex; + pthread_mutexattr_t attr; + if (pthread_mutexattr_init(&attr)) + exit(1); + if (pthread_mutexattr_setrobust_np(&attr, + PTHREAD_MUTEX_ROBUST_NP)) + exit(2); + if (pthread_mutex_init(&mutex, &attr)) + exit(3); + if (pthread_mutexattr_destroy(&attr)) + exit(4); + if (pthread_mutex_destroy(&mutex)) + exit(5); + exit(0); + }], [ac_cv_func_pthread_mutexattr_setrobust_np=yes], []) + if test "$ac_cv_func_pthread_mutexattr_setrobust_np" = "yes"; then + APR_ADDTO(CPPFLAGS, -D_POSIX_THREAD_PRIO_INHERIT) + fi + fi + fi fi # See which lock mechanisms we can support on this system. -APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, hassysvser="1", hassysvser="0") +APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, hassysvser="1", + hassysvser="0") APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1", hasflockser="0") APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1", hasfcntlser="0") # note: the current APR use of shared mutex requires /dev/zero APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl - func:pthread_mutexattr_setpshared file:/dev/zero, + func:pthread_mutexattr_setpshared dnl + func:pthread_mutexattr_setrobust_np file:/dev/zero, hasprocpthreadser="1", hasprocpthreadser="0") APR_IFALLYES(struct:pthread_rw, hasrwlockser="1", hasrwlockser="0") @@ -1008,7 +1038,8 @@ APR_IFALLYES(header:fcntl.h define:F_SETLK, APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) # note: the current APR use of shared mutex requires /dev/zero APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl - func:pthread_mutexattr_setpshared file:/dev/zero, + func:pthread_mutexattr_setpshared dnl + func:pthread_mutexattr_setrobust_np file:/dev/zero, APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index a04a8e6810a..2b2aac5bd5e 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -225,6 +225,24 @@ static apr_status_t proc_pthread_create(apr_lock_t *new, const char *fname) return stat; } +#ifdef HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP + if ((stat = pthread_mutexattr_setrobust_np(&mattr, + PTHREAD_MUTEX_ROBUST_NP))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + proc_pthread_cleanup(new); + return stat; + } + if ((stat = pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + proc_pthread_cleanup(new); + return stat; + } +#endif + if ((stat = pthread_mutex_init(new->pthread_interproc, &mattr))) { #ifdef PTHREAD_SETS_ERRNO stat = errno; @@ -255,7 +273,16 @@ static apr_status_t proc_pthread_acquire(apr_lock_t *lock) #ifdef PTHREAD_SETS_ERRNO stat = errno; #endif +#ifdef HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP + /* Okay, our owner died. Let's try to make it consistent again. */ + if (stat == EOWNERDEAD) { + pthread_mutex_consistent_np(lock->pthread_interproc); + } + else + return stat; +#else return stat; +#endif } lock->curr_locked = 1; return APR_SUCCESS; @@ -285,7 +312,9 @@ static apr_status_t proc_pthread_destroy(apr_lock_t *lock) return stat; } -static apr_status_t proc_pthread_child_init(apr_lock_t **lock, apr_pool_t *cont, const char *fname) +static apr_status_t proc_pthread_child_init(apr_lock_t **lock, + apr_pool_t *cont, + const char *fname) { return APR_SUCCESS; } From 754c692fe37c99b03bc4eeda6933fa0aef07ab2d Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 13 Jul 2001 13:37:24 +0000 Subject: [PATCH 1939/7878] Win32: Do not set the detached attribute for os_levels less than NT. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61933 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 4b19b650dc4..806720493a0 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -339,9 +339,17 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->detached) { /* If we are creating ourselves detached, Then we should hide the * window we are starting in. And we had better redfine our - * handles for STDIN, STDOUT, and STDERR. + * handles for STDIN, STDOUT, and STDERR. Do not set the + * detached attribute for Win9x. We have found that Win9x does + * not manage the stdio handles properly when running old 16 + * bit executables if the detached attribute is set. */ - dwCreationFlags |= DETACHED_PROCESS; + apr_oslevel_e os_level; + if (apr_get_oslevel(cont, &os_level) == APR_SUCCESS) { + if (os_level >= APR_WIN_NT) { + dwCreationFlags |= DETACHED_PROCESS; + } + } attr->si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; attr->si.wShowWindow = SW_HIDE; From f6a5264d3fd7b9515a764202cddc5a0bee71421e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 13 Jul 2001 17:44:41 +0000 Subject: [PATCH 1940/7878] The C namespace block must occur _outside_ of the conditionals. Hiroyuki Hanai git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61934 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms_threads.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_sms_threads.h b/include/apr_sms_threads.h index f99e1b3d1c5..cbe448839c1 100644 --- a/include/apr_sms_threads.h +++ b/include/apr_sms_threads.h @@ -58,12 +58,12 @@ #include "apr.h" #include "apr_sms.h" -#if APR_HAS_THREADS - #ifdef __cplusplus extern "C" { #endif +#if APR_HAS_THREADS + /** * @package APR threads memory system */ From 78e57b8f4e623677226cc653c3131e1037937297 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 13 Jul 2001 17:47:58 +0000 Subject: [PATCH 1941/7878] Not the problem I first expected... here's the balance fix, and Sander is researching further why this is even a problem. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61935 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms_threads.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_sms_threads.h b/include/apr_sms_threads.h index cbe448839c1..974272835eb 100644 --- a/include/apr_sms_threads.h +++ b/include/apr_sms_threads.h @@ -101,10 +101,10 @@ APR_DECLARE(apr_status_t) apr_sms_threads_create_ex(apr_sms_t **sms, apr_size_t min_free, apr_size_t max_free); +#endif /* APR_HAS_THREADS */ + #ifdef __cplusplus } #endif -#endif /* APR_HAS_THREADS */ - #endif /* !APR_SMS_THREADS_H */ From 04e0c439c083940d2f47df3dc4cc2bb2ac269644 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 14 Jul 2001 00:13:36 +0000 Subject: [PATCH 1942/7878] I think this is better as CPPFLAGS than CFLAGS because this defines something that the preprocessor will interpret. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61936 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 768a0ba6105..513ac49af52 100644 --- a/configure.in +++ b/configure.in @@ -164,7 +164,7 @@ AC_ARG_ENABLE(sms, [ --enable-sms Build APR to use sms emulating poo echo "You have switched ON using SMS to emulate pools. This is highly" echo "experimental and so you may want to think about it!" echo "Presently this option is only advised for people working on SMS" - APR_ADDTO(CFLAGS, -DAPR_POOLS_ARE_SMS) + APR_ADDTO(CPPFLAGS, -DAPR_POOLS_ARE_SMS) POOLS_TARGET=apr_sms_pools.lo )dnl AC_SUBST(POOLS_TARGET) From d617a8595cf6dd6e51548c7199364fdbd604b725 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 14 Jul 2001 22:31:38 +0000 Subject: [PATCH 1943/7878] Add a new function to be able to cancel a child cleanup. This is necessary for some other work I am doing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61937 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 9 +++++++++ memory/unix/apr_pools.c | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/include/apr_pools.h b/include/apr_pools.h index 1806416cf86..e24636f94bc 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -380,6 +380,15 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *)); +/** + * Remove a previously registered child cleanup function + * @param p The pool remove the cleanup from + * @param data The data to remove from cleanup + * @param cleanup The function to remove from cleanup + */ +APR_DECLARE(void) apr_pool_child_cleanup_kill(apr_pool_t *p, const void *data, + apr_status_t (*cleanup) (void *)); + /** * Run the specified cleanup function immediately and unregister it. Use * @a data instead of the data that was registered with the cleanup. diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index b45c0cc52ee..4e7f1e02bdb 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -738,6 +738,27 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, } } +APR_DECLARE(void) apr_pool_child_cleanup_kill(apr_pool_t *p, const void *data, + apr_status_t (*cleanup) (void *)) +{ + struct cleanup *c; + struct cleanup **lastp; + + if (p == NULL) + return; + c = p->cleanups; + lastp = &p->cleanups; + while (c) { + if (c->data == data && c->child_cleanup == cleanup) { + *lastp = c->next; + break; + } + + lastp = &c->next; + c = c->next; + } +} + APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, apr_status_t (*cleanup) (void *)) { From 8ab4241dc4aa507d89677b899fbd18a565f20f8d Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 16 Jul 2001 08:06:14 +0000 Subject: [PATCH 1944/7878] SMS status updates. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61938 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/STATUS b/STATUS index e45ba27f4da..6aaebd5f6ca 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/06/29 08:00:48 $] +Last modified at [$Date: 2001/07/16 08:06:14 $] Release: @@ -143,9 +143,17 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: - decide on a better name for the code - reformat to APR style (think this is now done, but some tabs left) - test on more systems - - add to the default build as currently it's omitted. Also need to - add testmem to the test build at that point. - add more detailed tests to testmem.c + Status: Optionally enable it with --enable-sms. Still wildly + unproven. But, it actually works as a replacement for + pools now. (httpd works without pools.) + There is a current (non-fatal, but silly) flaw in + the trivial SMS implementation that makes it add 4KB + to each level in the allocation chain. This is bad. + Adding a child_malloc path has been discussed. Making + the apr_sms_pools.c call with 0 for MIN_FREE has been + suggested. As has rethinking which SMSs constitute an + old-style apr_pool_t. * In line with the new SMS code is the fact that threading and pools just are not working together well. This is due to the fact that @@ -159,21 +167,16 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: to have an option for no locking (as they can't have contention by definition). This would mean that the mutex and freelist must be moved inside of apr_pool_t. Therefore, this is the - jumping-off point into SMS. Short-term, it is *possible* that - ALLOC_USE_MALLOC would be faster than the current pool code for - a threaded APR (but, I'm not sure). - Status: Justin volunteers - David and Sander are working on some stuff that - should be ready Real Soon Now (TM). Sander has - posted a "trivial" SMS (what a bad name) - see: - - which uses the same memory management as the current - pool implementation (freelist that allocates any size). - David is finishing up prototyping a replacement for - apr_pool_t that is defined as an SMS (I believe it is - API-compatible). Not ready for prime-time, but ready - for us to start working out the kinks and actually - starting to use SMS. + jumping-off point into SMS. + Justin: The SMS code has been checked into CVS (see above). + To solve this problem, we want only one trivial SMS + per thread which acts as the parent for all SMSs in + that thread (giving us thread-local allocation). + Each descendant SMS should be something along the + lines of a tracking SMS. That's how I see it anyway. + There are other possibilities. Any of those probably + work as well. See the apr archives for more info. + We're still debating this. Documentation that needs writing: From 3c2641ef7aff81802b77a86d2dca0fe004269af6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 16 Jul 2001 16:11:05 +0000 Subject: [PATCH 1945/7878] Added an inherit flag to apr_socket_create and other socket creation functions. This allows APR programs to specify that a socket should be passed to any child processes that are created. The inherit flag is only meaningful if programs use apr_process_create(). This also adds a couple of macros that allow APR types to set and unset the inherit flag. This also fixes Apache to use the new API. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61939 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++ include/apr_inherit.h | 91 +++++++++++++++++++++++++++++++++++ include/apr_network_io.h | 6 ++- include/apr_portable.h | 2 + include/arch/unix/networkio.h | 1 + network_io/unix/sockets.c | 15 ++++-- test/client.c | 2 +- test/sendfile.c | 2 +- test/server.c | 2 +- test/testpoll.c | 2 +- test/testsockets.c | 12 ++--- test/testsockopt.c | 2 +- 12 files changed, 128 insertions(+), 16 deletions(-) create mode 100644 include/apr_inherit.h diff --git a/CHANGES b/CHANGES index 6ab3eab343d..e9c6ba75d63 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,12 @@ Changes with APR b1 + *) Added an inherit flag to apr_socket_create and other socket creation + functions. This allows APR programs to specify that a socket should + be passed to any child processes that are created. The inherit flag + is only meaningful if programs use apr_process_create(). This + also adds a couple of macros that allow APR types to set and unset + the inherit flag. [Ryan Bloom] + *) apr_connect()on Windows: Handle timeouts and returning the proper status code when a connect is in progress. [Bill Stoddard] diff --git a/include/apr_inherit.h b/include/apr_inherit.h new file mode 100644 index 00000000000..3b1882095c3 --- /dev/null +++ b/include/apr_inherit.h @@ -0,0 +1,91 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_INHERIT_H +#define APR_INHERIT_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#define APR_NO_INHERIT 0 +#define APR_INHERIT 1 + +#define APR_DECLARE_SET_INHERIT(name) \ + void apr_##name##_set_inherit(apr_##name##_t *name) + +#define APR_SET_INHERIT(name, pool, cleanup, field_exists) \ +void apr_##name##_set_inherit(apr_##name##_t *name) \ +{ \ + name->inherit = 1; \ + apr_pool_cleanup_register(name->##pool, (void *)##name##, NULL, \ + cleanup); \ +} + +#define APR_DECLARE_UNSET_INHERIT(name) \ + void apr_##name##_unset_inherit(apr_##name##_t *name) + +#define APR_UNSET_INHERIT(name, pool, cleanup, field_exists) \ +void apr_##name##_unset_inherit(apr_##name##_t *name) \ +{ \ + name->inherit = 0; \ + apr_pool_cleanup_kill(name->##pool, (void *)##name##, NULL, \ + cleanup); \ +} + +#ifdef __cplusplus +} +#endif + +#endif /* ! APR_INHERIT_H */ diff --git a/include/apr_network_io.h b/include/apr_network_io.h index ac1e0bd728b..822fcb58c7f 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -63,6 +63,7 @@ #include "apr_pools.h" #include "apr_file_io.h" #include "apr_errno.h" +#include "apr_inherit.h" #if APR_HAVE_NETINET_IN_H #include @@ -240,12 +241,13 @@ struct apr_ipsubnet_t { * @param new_sock The new socket that has been set up. * @param family The address family of the socket (e.g., APR_INET). * @param type The type of the socket (e.g., SOCK_STREAM). + * @param inherit Should this socket be inherited by child processes * @param cont The pool to use * @deffunc apr_status_t apr_socket_create(apr_socket_t **new_sock, int family, int type, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, int family, int type, - apr_pool_t *cont); + int inherit, apr_pool_t *cont); /** * Shutdown either reading, writing, or both sides of a tcp socket. @@ -801,6 +803,8 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char name[16], char args[256 - 16]); #endif +APR_DECLARE_SET_INHERIT(socket); + #ifdef __cplusplus } #endif diff --git a/include/apr_portable.h b/include/apr_portable.h index c37ae105c9b..5970f3e7d1e 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -321,6 +321,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, * @param apr_sock The new socket that has been set up * @param os_sock_info The os representation of the socket handle and * other characteristics of the socket + * @param inherit Should this socket be inherited by child processes * @param cont The pool to use * @deffunc apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont) * @tip If you only know the descriptor/handle or if it isn't really @@ -328,6 +329,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, */ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, + int inherit, apr_pool_t *cont); /** diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 5c879db7bc5..46bacfdd43f 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -135,6 +135,7 @@ struct apr_socket_t { int local_port_unknown; int local_interface_unknown; apr_int32_t netmask; + int inherit; }; struct apr_pollfd_t { diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index a2e4dc32dba..edde222987f 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -53,7 +53,9 @@ */ #include "networkio.h" +#include "apr_network_io.h" #include "apr_portable.h" +#include "apr_inherit.h" static apr_status_t socket_cleanup(void *sock) { @@ -125,7 +127,7 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) } apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, - apr_pool_t *cont) + int inherit, apr_pool_t *cont) { int family = ofamily; @@ -158,8 +160,9 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, set_socket_vars(*new, family, type); (*new)->timeout = -1; + (*new)->inherit = inherit; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_pool_cleanup_null); + socket_cleanup, inherit ? socket_cleanup : NULL ); return APR_SUCCESS; } @@ -250,8 +253,9 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn (*new)->local_interface_unknown = 1; } + (*new)->inherit = sock->inherit; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), - socket_cleanup, apr_pool_cleanup_null); + socket_cleanup, (*new)->inherit ? socket_cleanup : NULL); return APR_SUCCESS; } @@ -328,6 +332,7 @@ apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, + int inherit, apr_pool_t *cont) { alloc_socket(apr_sock, cont); @@ -351,8 +356,9 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, (*apr_sock)->remote_addr->salen); } + (*apr_sock)->inherit = inherit; apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), - socket_cleanup, apr_pool_cleanup_null); + socket_cleanup, inherit ? socket_cleanup : NULL); return APR_SUCCESS; } @@ -373,3 +379,4 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, return APR_SUCCESS; } +APR_SET_INHERIT(socket, cntxt, socket_cleanup, 1) diff --git a/test/client.c b/test/client.c index a7a5eb1904f..c463a403d42 100644 --- a/test/client.c +++ b/test/client.c @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) fprintf(stdout,"OK\n"); fprintf(stdout, "\tClient: Creating new socket......."); - if (apr_socket_create(&sock, remote_sa->family, SOCK_STREAM, + if (apr_socket_create(&sock, remote_sa->family, SOCK_STREAM, APR_NO_INHERIT, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); diff --git a/test/sendfile.c b/test/sendfile.c index d333e1657ea..3a4e5ad4b00 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -114,7 +114,7 @@ static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family) } *sock = NULL; - rv = apr_socket_create(sock, *family, SOCK_STREAM, *p); + rv = apr_socket_create(sock, *family, SOCK_STREAM, APR_NO_INHERIT, *p); if (rv != APR_SUCCESS) { fprintf(stderr, "apr_socket_create()->%d/%s\n", rv, diff --git a/test/server.c b/test/server.c index 4c5087b8b78..074eeb6c7e8 100644 --- a/test/server.c +++ b/test/server.c @@ -132,7 +132,7 @@ int main(int argc, const char * const argv[]) } fprintf(stdout, "\tServer: Creating new socket......."); - if (apr_socket_create(&sock, family, SOCK_STREAM, context) != APR_SUCCESS) { + if (apr_socket_create(&sock, family, SOCK_STREAM, APR_NO_INHERIT, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); } diff --git a/test/testpoll.c b/test/testpoll.c index 510d2c33bf7..c20762e35f8 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -72,7 +72,7 @@ static int make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, apr_port_t port printf("couldn't create control socket information, shutting down"); return 1; } - if (apr_socket_create(sock, (*sa)->sa.sin.sin_family, SOCK_DGRAM, p) + if (apr_socket_create(sock, (*sa)->sa.sin.sin_family, SOCK_DGRAM, APR_NO_INHERIT, p) != APR_SUCCESS){ printf("couldn't create UDP socket, shutting down"); return 1; diff --git a/test/testsockets.c b/test/testsockets.c index 8fc74b9374d..82c4af7d7de 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -101,20 +101,20 @@ int main(void) printf("Testing socket creation functions.\n"); STD_TEST_NEQ(" Creating a TCP socket", - apr_socket_create(&sock, APR_INET, SOCK_STREAM, pool)) + apr_socket_create(&sock, APR_INET, SOCK_STREAM, APR_NO_INHERIT, pool)) close_sock(sock); STD_TEST_NEQ(" Creating UDP socket", - apr_socket_create(&sock, APR_INET, SOCK_DGRAM, pool)) + apr_socket_create(&sock, APR_INET, SOCK_DGRAM, APR_NO_INHERIT, pool)) close_sock(sock); #if APR_HAVE_IPV6 STD_TEST_NEQ(" Creating an IPv6 TCP socket", - apr_socket_create(&sock, APR_INET6, SOCK_STREAM, pool)) + apr_socket_create(&sock, APR_INET6, SOCK_STREAM, APR_NO_INHERIT, pool)) close_sock(sock); STD_TEST_NEQ(" Creating an IPv6 UDP socket", - apr_socket_create(&sock, APR_INET6, SOCK_DGRAM, pool)) + apr_socket_create(&sock, APR_INET6, SOCK_DGRAM, APR_NO_INHERIT, pool)) close_sock(sock); #else printf("NO IPv6 support.\n"); @@ -123,9 +123,9 @@ int main(void) printf("Now trying sendto/recvfrom (simple tests only)\n"); STD_TEST_NEQ(" Creating socket #1 for test", - apr_socket_create(&sock, family, SOCK_DGRAM, pool)) + apr_socket_create(&sock, family, SOCK_DGRAM, APR_NO_INHERIT, pool)) STD_TEST_NEQ(" Creating socket #2 for test", - apr_socket_create(&sock2, family, SOCK_DGRAM, pool)) + apr_socket_create(&sock2, family, SOCK_DGRAM, APR_NO_INHERIT, pool)) apr_sockaddr_info_get(&to, US, APR_UNSPEC, 7772, 0, pool); apr_sockaddr_info_get(&from, US, APR_UNSPEC, 7771, 0, pool); diff --git a/test/testsockopt.c b/test/testsockopt.c index f0b9641bf8f..6cec1e1f26c 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -103,7 +103,7 @@ int main(void) printf("Testing socket option functions.\n"); printf("\tCreating socket.........................."); - if ((stat = apr_socket_create(&sock, APR_INET, SOCK_STREAM, context)) + if ((stat = apr_socket_create(&sock, APR_INET, SOCK_STREAM, APR_NO_INHERIT, context)) != APR_SUCCESS){ printf("Failed to create a socket!\n"); exit(-1); From a291c3d24891ad85113ae28677f8aacb82f9dd15 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 Jul 2001 18:14:24 +0000 Subject: [PATCH 1946/7878] Change 'inherit' to a usual flags value, use 2^24 for the first rather global switch value. We may have more (APR_THREAD_SAFE, anyone?) that are very consistent from type to type, pick those up from 2^25. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61940 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_inherit.h | 24 ++++++++++++++---------- include/apr_network_io.h | 26 +++++++++++++++++++++++--- network_io/unix/sockets.c | 23 ++++++++++++++--------- network_io/win32/sockets.c | 6 +++++- 4 files changed, 56 insertions(+), 23 deletions(-) diff --git a/include/apr_inherit.h b/include/apr_inherit.h index 3b1882095c3..148aa8a27d6 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -60,28 +60,32 @@ extern "C" { #endif /* __cplusplus */ #define APR_NO_INHERIT 0 -#define APR_INHERIT 1 +#define APR_INHERIT (2^24) /* Outside of conflicts with other bits */ #define APR_DECLARE_SET_INHERIT(name) \ void apr_##name##_set_inherit(apr_##name##_t *name) -#define APR_SET_INHERIT(name, pool, cleanup, field_exists) \ +#define APR_IMPLEMENT_SET_INHERIT(name, pool, cleanup) \ void apr_##name##_set_inherit(apr_##name##_t *name) \ { \ - name->inherit = 1; \ - apr_pool_cleanup_register(name->##pool, (void *)##name##, NULL, \ - cleanup); \ + if (!name->inherit) { \ + name->inherit = 1; \ + apr_pool_cleanup_register(name->##pool, (void *)##name##, \ + NULL, cleanup); \ + } \ } #define APR_DECLARE_UNSET_INHERIT(name) \ void apr_##name##_unset_inherit(apr_##name##_t *name) -#define APR_UNSET_INHERIT(name, pool, cleanup, field_exists) \ -void apr_##name##_unset_inherit(apr_##name##_t *name) \ +#define APR_IMPLEMENT_UNSET_INHERIT(name, pool, cleanup) \ +void apr_##name##_unset_inherit(apr_##name##_t *name) \ { \ - name->inherit = 0; \ - apr_pool_cleanup_kill(name->##pool, (void *)##name##, NULL, \ - cleanup); \ + if (name->inherit) { \ + name->inherit = 0; \ + apr_pool_cleanup_kill(name->##pool, (void *)##name##, \ + NULL, cleanup); \ + } \ } #ifdef __cplusplus diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 822fcb58c7f..522f5fd25b9 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -241,13 +241,17 @@ struct apr_ipsubnet_t { * @param new_sock The new socket that has been set up. * @param family The address family of the socket (e.g., APR_INET). * @param type The type of the socket (e.g., SOCK_STREAM). - * @param inherit Should this socket be inherited by child processes + * @param flag Should this socket be inherited by child processes. One of + *
    + *          APR_INHERIT       This socket is inherited by children
    + *          APR_NO_INHERIT    This socket is not inherited by children.
    + * 
    * @param cont The pool to use - * @deffunc apr_status_t apr_socket_create(apr_socket_t **new_sock, int family, int type, apr_pool_t *cont) + * @deffunc apr_status_t apr_socket_create(apr_socket_t **new_sock, int family, int type, apr_int32_t flag, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, int family, int type, - int inherit, apr_pool_t *cont); + apr_int32_t flag, apr_pool_t *cont); /** * Shutdown either reading, writing, or both sides of a tcp socket. @@ -803,8 +807,24 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char name[16], char args[256 - 16]); #endif +/** + * Set a socket to be inherited by child processes. + * @param socket The socket to enable inheritance. + * @deffunc void apr_socket_set_inherit(apr_socket_t *socket) + * @tip Same effect as passing the APR_INHERIT flag to apr_socket_create(), + * but it is far more efficient to pass the correct value in the first place. + */ APR_DECLARE_SET_INHERIT(socket); +/** + * Unset a socket from being inherited by child processes. + * @param socket The socket to disable inheritance. + * @deffunc void apr_socket_unset_inherit(apr_socket_t *socket) + * @tip Same effect as passing the APR_NO_INHERIT flag to apr_socket_create(), + * but it is far more efficient to pass the correct value in the first place. + */ +APR_DECLARE_UNSET_INHERIT(socket); + #ifdef __cplusplus } #endif diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index edde222987f..abceebc95e3 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -160,9 +160,10 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, set_socket_vars(*new, family, type); (*new)->timeout = -1; - (*new)->inherit = inherit; - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), - socket_cleanup, inherit ? socket_cleanup : NULL ); + (*new)->inherit = (inherit & APR_INHERIT) ? 1 : 0; + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, + (*new)->inherit ? apr_pool_cleanup_null + : socket_cleanup); return APR_SUCCESS; } @@ -254,8 +255,9 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn } (*new)->inherit = sock->inherit; - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), - socket_cleanup, (*new)->inherit ? socket_cleanup : NULL); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, + (inherit & APR_INHERIT) ? apr_pool_cleanup_null + : socket_cleanup); return APR_SUCCESS; } @@ -356,10 +358,11 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, (*apr_sock)->remote_addr->salen); } - (*apr_sock)->inherit = inherit; + (*apr_sock)->inherit = (inherit & APR_INHERIT) ? 1 : 0; apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), - socket_cleanup, inherit ? socket_cleanup : NULL); - + socket_cleanup, + (*apr_sock)->inherit ? apr_pool_cleanup_null + : socket_cleanup); return APR_SUCCESS; } @@ -379,4 +382,6 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, return APR_SUCCESS; } -APR_SET_INHERIT(socket, cntxt, socket_cleanup, 1) +APR_IMPLEMENT_SET_INHERIT(socket, cntxt, socket_cleanup) + +APR_IMPLEMENT_UNSET_INHERIT(socket, cntxt, socket_cleanup) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 7c854f9ed8d..5cbbfd9b718 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -118,8 +118,10 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) } APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, - int type, apr_pool_t *cont) + int type, apr_int32_t inherit, + apr_pool_t *cont) { + /* XXX: Todo: process the inherit value */ int family = ofamily; if (family == AF_UNSPEC) { @@ -365,8 +367,10 @@ APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, + apr_int32_t inherit, apr_pool_t *cont) { + /* XXX: Todo: process the inherit value */ alloc_socket(apr_sock, cont); set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type); (*apr_sock)->timeout = -1; From 2f66c147042fc9bf5745156b8fa1188bbd0d325e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 Jul 2001 18:45:33 +0000 Subject: [PATCH 1947/7878] Placeholders are useful git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61941 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index c1a7c5185a8..912e3858d6b 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -129,8 +129,9 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) } apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, - apr_pool_t *cont) + apr_int32_t inherit, apr_pool_t *cont) { + /* TODO: Implement inherit flag */ int family = ofamily; if (family == AF_UNSPEC) { @@ -270,8 +271,9 @@ apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, - apr_pool_t *cont) + apr_int32_t inherit, apr_pool_t *cont) { + /* TODO: Implement inherit flag */ alloc_socket(apr_sock, cont); set_socket_vars(*apr_sock, os_sock_info->family); (*apr_sock)->timeout = -1; From cb10f48ca1464da21a84d56063ff7adb5ddb1592 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 Jul 2001 18:51:30 +0000 Subject: [PATCH 1948/7878] If these will support the inherit toggle, they need 'da flag. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61942 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/networkio.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 639b4be0242..86a211a9a8c 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -69,6 +69,7 @@ struct apr_socket_t { int local_port_unknown; int local_interface_unknown; apr_int32_t netmask; + int inherit; }; struct apr_pollfd_t { From 6c2cf5a42ea3e01c2895491d226c58bbede5e0e3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 Jul 2001 18:52:17 +0000 Subject: [PATCH 1949/7878] If this platform will support 'da inherit bit, needs the flag git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61943 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/networkio.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index 64ed34a7e93..942b5f1735a 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -73,6 +73,7 @@ struct apr_socket_t { int local_port_unknown; int local_interface_unknown; apr_int32_t netmask; + int inherit; }; struct apr_pollfd_t { From 44774114a6e295a08a3b6d185648f9aad0ebdd2f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 Jul 2001 20:14:56 +0000 Subject: [PATCH 1950/7878] Yup Ian... this was borked :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61944 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_inherit.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_inherit.h b/include/apr_inherit.h index 148aa8a27d6..fbb5b429f21 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -70,7 +70,7 @@ void apr_##name##_set_inherit(apr_##name##_t *name) \ { \ if (!name->inherit) { \ name->inherit = 1; \ - apr_pool_cleanup_register(name->##pool, (void *)##name##, \ + apr_pool_cleanup_register(name->pool, (void *)name, \ NULL, cleanup); \ } \ } @@ -83,7 +83,7 @@ void apr_##name##_unset_inherit(apr_##name##_t *name) \ { \ if (name->inherit) { \ name->inherit = 0; \ - apr_pool_cleanup_kill(name->##pool, (void *)##name##, \ + apr_pool_cleanup_kill(name->pool, (void *)name, \ NULL, cleanup); \ } \ } From 83aa5c8e7f44aca3fe3246ffe00b8216b7cb5ac7 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 16 Jul 2001 20:24:21 +0000 Subject: [PATCH 1951/7878] We need to use the correct flag in apr_accept. Apr_accept doesn't get the inherit flag passed in, so we need to find it in the structure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61945 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index abceebc95e3..1a60fdcafb7 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -256,7 +256,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn (*new)->inherit = sock->inherit; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, - (inherit & APR_INHERIT) ? apr_pool_cleanup_null + ((*new)->inherit & APR_INHERIT) ? apr_pool_cleanup_null : socket_cleanup); return APR_SUCCESS; } From 7480743f179f1208db617c6748b2c5f092db5d35 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 Jul 2001 20:37:00 +0000 Subject: [PATCH 1952/7878] In order to use this IMPLEMENT_SET/UNSET schema, this has got to be a bit flag... the apr_file_t already has too many int flags hiding in it, and ->flags is already a member of the apr_file_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61946 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_inherit.h | 16 ++++++++-------- include/arch/os2/networkio.h | 2 +- include/arch/unix/networkio.h | 2 +- include/arch/win32/networkio.h | 2 +- network_io/unix/sockets.c | 24 ++++++++++++------------ 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/apr_inherit.h b/include/apr_inherit.h index fbb5b429f21..89e0450735f 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -65,12 +65,12 @@ extern "C" { #define APR_DECLARE_SET_INHERIT(name) \ void apr_##name##_set_inherit(apr_##name##_t *name) -#define APR_IMPLEMENT_SET_INHERIT(name, pool, cleanup) \ +#define APR_IMPLEMENT_SET_INHERIT(name, flag, pool, cleanup) \ void apr_##name##_set_inherit(apr_##name##_t *name) \ { \ - if (!name->inherit) { \ - name->inherit = 1; \ - apr_pool_cleanup_register(name->pool, (void *)name, \ + if (!(name->flag & APR_INHERIT)) { \ + name->flag |= APR_INHERIT; \ + apr_pool_cleanup_register(name->pool, (void *)name, \ NULL, cleanup); \ } \ } @@ -78,12 +78,12 @@ void apr_##name##_set_inherit(apr_##name##_t *name) \ #define APR_DECLARE_UNSET_INHERIT(name) \ void apr_##name##_unset_inherit(apr_##name##_t *name) -#define APR_IMPLEMENT_UNSET_INHERIT(name, pool, cleanup) \ +#define APR_IMPLEMENT_UNSET_INHERIT(name, flag, pool, cleanup) \ void apr_##name##_unset_inherit(apr_##name##_t *name) \ { \ - if (name->inherit) { \ - name->inherit = 0; \ - apr_pool_cleanup_kill(name->pool, (void *)name, \ + if (name->flag & APR_INHERIT) { \ + name->flag &= ~APR_INHERIT; \ + apr_pool_cleanup_kill(name->pool, (void *)name, \ NULL, cleanup); \ } \ } diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index 942b5f1735a..b6ea0f72d65 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -73,7 +73,7 @@ struct apr_socket_t { int local_port_unknown; int local_interface_unknown; apr_int32_t netmask; - int inherit; + apr_int32_t inherit; }; struct apr_pollfd_t { diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 46bacfdd43f..58a1cd0b1bd 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -135,7 +135,7 @@ struct apr_socket_t { int local_port_unknown; int local_interface_unknown; apr_int32_t netmask; - int inherit; + apr_int32_t inherit; }; struct apr_pollfd_t { diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 86a211a9a8c..90a7c658c50 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -69,7 +69,7 @@ struct apr_socket_t { int local_port_unknown; int local_interface_unknown; apr_int32_t netmask; - int inherit; + apr_int32_t inherit; }; struct apr_pollfd_t { diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 1a60fdcafb7..c298b44aae7 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -127,7 +127,7 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) } apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, - int inherit, apr_pool_t *cont) + apr_int32_t inherit, apr_pool_t *cont) { int family = ofamily; @@ -160,10 +160,10 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, set_socket_vars(*new, family, type); (*new)->timeout = -1; - (*new)->inherit = (inherit & APR_INHERIT) ? 1 : 0; + (*new)->inherit = inherit; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, - (*new)->inherit ? apr_pool_cleanup_null - : socket_cleanup); + (*new)->inherit & APR_INHERIT) + ? apr_pool_cleanup_null : socket_cleanup); return APR_SUCCESS; } @@ -256,8 +256,8 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn (*new)->inherit = sock->inherit; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, - ((*new)->inherit & APR_INHERIT) ? apr_pool_cleanup_null - : socket_cleanup); + ((*new)->inherit & APR_INHERIT) + ? apr_pool_cleanup_null : socket_cleanup); return APR_SUCCESS; } @@ -334,7 +334,7 @@ apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, - int inherit, + apr_int32_t inherit, apr_pool_t *cont) { alloc_socket(apr_sock, cont); @@ -358,11 +358,11 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, (*apr_sock)->remote_addr->salen); } - (*apr_sock)->inherit = (inherit & APR_INHERIT) ? 1 : 0; + (*apr_sock)->inherit = inherit; apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), socket_cleanup, - (*apr_sock)->inherit ? apr_pool_cleanup_null - : socket_cleanup); + ((*apr_sock)->inherit & APR_INHERIT) + ? apr_pool_cleanup_null : socket_cleanup); return APR_SUCCESS; } @@ -382,6 +382,6 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, return APR_SUCCESS; } -APR_IMPLEMENT_SET_INHERIT(socket, cntxt, socket_cleanup) +APR_IMPLEMENT_SET_INHERIT(socket, inherit, cntxt, socket_cleanup) -APR_IMPLEMENT_UNSET_INHERIT(socket, cntxt, socket_cleanup) +APR_IMPLEMENT_UNSET_INHERIT(socket, inherit, cntxt, socket_cleanup) From 5a2578c5215109428c90e53e691e863bd9c107db Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 Jul 2001 20:44:17 +0000 Subject: [PATCH 1953/7878] This should introduce the APR_INHERIT flag for Unix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61947 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 6 ++++-- file_io/unix/open.c | 8 +++++++- include/apr_file_io.h | 31 ++++++++++++++++++++++++++++++- 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index e7e6507d425..7cc6c3f8fc0 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -87,8 +87,10 @@ apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_ } (*new_file)->blocking = old_file->blocking; /* this is the way dup() works */ (*new_file)->flags = old_file->flags; - apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), apr_unix_file_cleanup, - apr_pool_cleanup_null); + apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), + apr_unix_file_cleanup, + (*new_file)->flags ? apr_pool_cleanup_null + : apr_unix_file_cleanup); return APR_SUCCESS; } diff --git a/file_io/unix/open.c b/file_io/unix/open.c index f3b9f9600f4..cf1702314d7 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -167,7 +167,8 @@ apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag (*new)->dataRead = 0; (*new)->direction = 0; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), apr_unix_file_cleanup, - apr_pool_cleanup_null); + ((*new)->flag & APR_INHERIT) ? apr_pool_cleanup_null + : apr_unix_file_cleanup); return APR_SUCCESS; } @@ -223,6 +224,7 @@ apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, /* buffer already NULL; * don't get a lock (only for buffered files) */ + (*file)->inherit = 1; return APR_SUCCESS; } @@ -255,4 +257,8 @@ apr_status_t apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) return apr_os_file_put(thefile, &fd, cont); } +APR_IMPLEMENT_SET_INHERIT(file, flags, cntxt, apr_unix_file_cleanup) + +APR_IMPLEMENT_UNSET_INHERIT(file, flags, cntxt, apr_unix_file_cleanup) + APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 902f1590184..97edde44b64 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -60,6 +60,7 @@ #include "apr_time.h" #include "apr_errno.h" #include "apr_file_info.h" +#include "apr_inherit.h" #define APR_WANT_STDIO /* for SEEK_* */ #define APR_WANT_IOVEC @@ -89,6 +90,12 @@ extern "C" { #define APR_SHARELOCK 1024 /* Platform dependent support for higher level locked read/write access to support writes across process/machines */ +#ifndef APR_INHERIT +#define APR_INHERIT (2^24) /* Create the file inheritable by the child + process. fork()ed implementations + automatically register a child cleanup + in the _absense_ of this flag. */ +#endif /* flags for apr_file_seek */ #define APR_SET SEEK_SET @@ -96,7 +103,7 @@ extern "C" { #define APR_END SEEK_END /* should be same as whence type in lseek, POSIX defines this as int */ -typedef apr_int32_t apr_seek_where_t; +typedef int apr_seek_where_t; /** * Structure for referencing files. @@ -141,6 +148,10 @@ typedef struct apr_file_t apr_file_t; * APR_SHARELOCK Platform dependent support for higher * level locked read/write access to support * writes across process/machines + * APR_INHERIT Create the file inheritable by the child + * processes. fork()ed implementations + * automatically register a child cleanup + * in the _absense_ of this flag. *
    * @param perm Access permissions for file. * @param cont The pool to use. @@ -569,6 +580,24 @@ APR_DECLARE(apr_int32_t) apr_file_flags_get(apr_file_t *f); */ APR_POOL_DECLARE_ACCESSOR(file); +/** + * Set a file to be inherited by child processes. + * @param file The file to enable inheritance. + * @deffunc void apr_file_set_inherit(apr_file_t *file) + * @tip Same effect as passing the APR_INHERIT flag to apr_file_open(), + * but it is far more efficient to pass the correct value in the first place. + */ +APR_DECLARE_SET_INHERIT(file); + +/** + * Unset a file from being inherited by child processes. + * @param file The file to disable inheritance. + * @deffunc void apr_file_unset_inherit(apr_file_t *file) + * @tip Same effect as omiting the APR_INHERIT flag to apr_file_open(), + * but it is far more efficient to pass the correct value in the first place. + */ +APR_DECLARE_UNSET_INHERIT(file); + #ifdef __cplusplus } #endif From b9290b67bb8b96eb086a4c9486bde6b5a72c0a0f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 Jul 2001 20:46:23 +0000 Subject: [PATCH 1954/7878] Introduce opening a file inheritable on Win32, and some general text cleanup. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61948 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 2 +- file_io/win32/open.c | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index e60eb1df639..49634a04985 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -59,7 +59,7 @@ #include APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, - apr_file_t *old_file, apr_pool_t *p) + apr_file_t *old_file, apr_pool_t *p) { BOOLEAN isStdHandle = FALSE; HANDLE hCurrentProcess = GetCurrentProcess(); diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 8a3a8eb13b8..ac1f785e79c 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -173,14 +173,11 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) { - /* XXX: The default FILE_FLAG_SEQUENTIAL_SCAN is _wrong_ for - * sdbm and any other random files! We _must_ rethink - * this approach. - */ + SECURITY_ATTRIBUTES sa, *psa = NULL; HANDLE handle = INVALID_HANDLE_VALUE; DWORD oflags = 0; DWORD createflags = 0; - DWORD attributes = 0 /* FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN*/; + DWORD attributes = 0; DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE; apr_oslevel_e os_level; apr_status_t rv; @@ -221,7 +218,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, if (flag & APR_DELONCLOSE) { attributes |= FILE_FLAG_DELETE_ON_CLOSE; } - if (flag & APR_OPENLINK) { + if (flag & APR_OPENLINK) { attributes |= FILE_FLAG_OPEN_REPARSE_POINT; } if (!(flag & (APR_READ | APR_WRITE)) && (os_level >= APR_WIN_NT)) { @@ -236,6 +233,12 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, */ attributes |= FILE_FLAG_OVERLAPPED; } + if (flag & APR_INHERIT) { + sa.nLength = sizeof(sa); + sa.bInheritHandle = TRUE; + sa.lpSecurityDescriptor = NULL; + psa = &sa; + } #if APR_HAS_UNICODE_FS if (os_level >= APR_WIN_NT) { @@ -244,12 +247,12 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, / sizeof(apr_wchar_t), fname)) return rv; handle = CreateFileW(wfname, oflags, sharemode, - NULL, createflags, attributes, 0); + psa, createflags, attributes, 0); } else #endif handle = CreateFileA(fname, oflags, sharemode, - NULL, createflags, attributes, 0); + psa, createflags, attributes, 0); if (handle == INVALID_HANDLE_VALUE) { return apr_get_os_error(); @@ -307,7 +310,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, (*new)->filePtr = 0; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), file_cleanup, - apr_pool_cleanup_null); + apr_pool_cleanup_null); return APR_SUCCESS; } From fa360acdaabb572d4bed835075596435e228fae6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 Jul 2001 20:49:57 +0000 Subject: [PATCH 1955/7878] Split public from private declaration for INHERIT stuff git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61949 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 1 + include/apr_inherit.h | 20 ---------- include/arch/unix/inherit.h | 80 +++++++++++++++++++++++++++++++++++++ network_io/unix/sockets.c | 2 +- 4 files changed, 82 insertions(+), 21 deletions(-) create mode 100644 include/arch/unix/inherit.h diff --git a/file_io/unix/open.c b/file_io/unix/open.c index cf1702314d7..f5bc528636c 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -55,6 +55,7 @@ #include "fileio.h" #include "apr_strings.h" #include "apr_portable.h" +#include "inherit.h" apr_status_t apr_unix_file_cleanup(void *thefile) { diff --git a/include/apr_inherit.h b/include/apr_inherit.h index 89e0450735f..0d30e3fc754 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -65,29 +65,9 @@ extern "C" { #define APR_DECLARE_SET_INHERIT(name) \ void apr_##name##_set_inherit(apr_##name##_t *name) -#define APR_IMPLEMENT_SET_INHERIT(name, flag, pool, cleanup) \ -void apr_##name##_set_inherit(apr_##name##_t *name) \ -{ \ - if (!(name->flag & APR_INHERIT)) { \ - name->flag |= APR_INHERIT; \ - apr_pool_cleanup_register(name->pool, (void *)name, \ - NULL, cleanup); \ - } \ -} - #define APR_DECLARE_UNSET_INHERIT(name) \ void apr_##name##_unset_inherit(apr_##name##_t *name) -#define APR_IMPLEMENT_UNSET_INHERIT(name, flag, pool, cleanup) \ -void apr_##name##_unset_inherit(apr_##name##_t *name) \ -{ \ - if (name->flag & APR_INHERIT) { \ - name->flag &= ~APR_INHERIT; \ - apr_pool_cleanup_kill(name->pool, (void *)name, \ - NULL, cleanup); \ - } \ -} - #ifdef __cplusplus } #endif diff --git a/include/arch/unix/inherit.h b/include/arch/unix/inherit.h new file mode 100644 index 00000000000..6389c418c2b --- /dev/null +++ b/include/arch/unix/inherit.h @@ -0,0 +1,80 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef INHERIT_H +#define INHERIT_H + +#include "apr_inherit.h" + +#define APR_IMPLEMENT_SET_INHERIT(name, flag, pool, cleanup) \ +void apr_##name##_set_inherit(apr_##name##_t *name) \ +{ \ + if (!(name->flag & APR_INHERIT)) { \ + name->flag |= APR_INHERIT; \ + apr_pool_cleanup_register(name->pool, (void *)name, \ + NULL, cleanup); \ + } \ +} + +#define APR_IMPLEMENT_UNSET_INHERIT(name, flag, pool, cleanup) \ +void apr_##name##_unset_inherit(apr_##name##_t *name) \ +{ \ + if (name->flag & APR_INHERIT) { \ + name->flag &= ~APR_INHERIT; \ + apr_pool_cleanup_kill(name->pool, (void *)name, \ + NULL, cleanup); \ + } \ +} + +#endif /* ! INHERIT_H */ diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index c298b44aae7..aa0f8cacd58 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -55,7 +55,7 @@ #include "networkio.h" #include "apr_network_io.h" #include "apr_portable.h" -#include "apr_inherit.h" +#include "inherit.h" static apr_status_t socket_cleanup(void *sock) { From 49a4d253222c6c2e6f0b93cf7a6a95c945b19cc4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 Jul 2001 20:51:43 +0000 Subject: [PATCH 1956/7878] Write once, recheck twice ) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61950 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 7cc6c3f8fc0..1e5a0f39c62 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -89,8 +89,8 @@ apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_ (*new_file)->flags = old_file->flags; apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), apr_unix_file_cleanup, - (*new_file)->flags ? apr_pool_cleanup_null - : apr_unix_file_cleanup); + ((*new_file)->flags & APR_INHERIT) + ? apr_pool_cleanup_null : apr_unix_file_cleanup); return APR_SUCCESS; } From 50b2848e3f9b8e14e9525db7cf0a65451797a529 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 Jul 2001 20:53:53 +0000 Subject: [PATCH 1957/7878] er, I meant ->flags git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61951 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index f5bc528636c..a96c3c295a6 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -167,9 +167,11 @@ apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag (*new)->bufpos = 0; (*new)->dataRead = 0; (*new)->direction = 0; - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), apr_unix_file_cleanup, - ((*new)->flag & APR_INHERIT) ? apr_pool_cleanup_null - : apr_unix_file_cleanup); + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + apr_unix_file_cleanup, + ((*new)->flags & APR_INHERIT) + ? apr_pool_cleanup_null + : apr_unix_file_cleanup); return APR_SUCCESS; } From d2a430b6c061173931c4b68f3018a1c2afc90e68 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 16 Jul 2001 23:35:14 +0000 Subject: [PATCH 1958/7878] Fix some compile breaks git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61952 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 2 +- include/arch/unix/inherit.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index a96c3c295a6..f0bcfbe5b22 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -227,7 +227,7 @@ apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, /* buffer already NULL; * don't get a lock (only for buffered files) */ - (*file)->inherit = 1; + (*file)->flags = APR_INHERIT; return APR_SUCCESS; } diff --git a/include/arch/unix/inherit.h b/include/arch/unix/inherit.h index 6389c418c2b..085cf2e0f03 100644 --- a/include/arch/unix/inherit.h +++ b/include/arch/unix/inherit.h @@ -73,7 +73,7 @@ void apr_##name##_unset_inherit(apr_##name##_t *name) \ if (name->flag & APR_INHERIT) { \ name->flag &= ~APR_INHERIT; \ apr_pool_cleanup_kill(name->pool, (void *)name, \ - NULL, cleanup); \ + cleanup); \ } \ } From 1d4ec5c95a5201023b5d0a28705a9a33f594eb17 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 16 Jul 2001 23:43:21 +0000 Subject: [PATCH 1959/7878] Fix a compile break in sockets.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61953 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index aa0f8cacd58..e7ef61fb2f6 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -162,7 +162,7 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, (*new)->timeout = -1; (*new)->inherit = inherit; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, - (*new)->inherit & APR_INHERIT) + ((*new)->inherit & APR_INHERIT) ? apr_pool_cleanup_null : socket_cleanup); return APR_SUCCESS; } From 5e8ae9ea3435245998d6eefa7b16a78b464b4248 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 17 Jul 2001 05:43:53 +0000 Subject: [PATCH 1960/7878] Add note about the gmtime_r mutex on Solaris. I'm sure there are other bad libc calls out there, but this is the one I see right now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61954 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 6aaebd5f6ca..ae05282f972 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/07/16 08:06:14 $] +Last modified at [$Date: 2001/07/17 05:43:53 $] Release: @@ -178,6 +178,15 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: work as well. See the apr archives for more info. We're still debating this. + * Possible gmtime_r replacement in explode_time + On Solaris (and possibly others), the gmtime_r libc function obtains + a mutex. We have seen 21/25 threads being blocked in this mutex on + a threaded httpd MPM when requesting static pages. It may be worth + it to hand optimize this since there is no real need for a mutex at + the system level (straight arithmetic from what I can tell). If you + have access to the Solaris source code: + osnet_volume/usr/src/lib/libc/port/gen/time_comm.c. + Documentation that needs writing: * API documentation From 549de8a67371d0954ff477dc1392ed786bd40e7a Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 18 Jul 2001 09:41:44 +0000 Subject: [PATCH 1961/7878] Changed two #ifdefs to #ifs since they are always defined. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61955 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index c61bf393e71..098b04b7298 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -394,7 +394,7 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms); /* NB These are only available if the debugging option has been turned on. */ -#ifdef APR_DEBUG_SHOW_STRUCTURE +#if APR_DEBUG_SHOW_STRUCTURE /** * Show the heirachy of the sms * @param sms The sms to show the information for @@ -403,7 +403,7 @@ APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms); APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction); #endif /* APR_DEBUG_SHOW_STRUCTURE */ -#ifdef APR_DEBUG_TAG_SMS +#if APR_DEBUG_TAG_SMS /** * Set the debugging tag for an sms * @param tag The tag to give the sms From 39550ef6ac52604c5682a7242bf6b5bffed1a29e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 18 Jul 2001 13:05:17 +0000 Subject: [PATCH 1962/7878] Something here, nothing there git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61956 13f79535-47bb-0310-9956-ffa450edef68 --- lib/.cvsignore | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 lib/.cvsignore diff --git a/lib/.cvsignore b/lib/.cvsignore deleted file mode 100644 index 06e18a7aafb..00000000000 --- a/lib/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -*.lo -.libs From a2ef655a458e16b8e267cb5b3066cd5ffb1b701f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 18 Jul 2001 16:51:49 +0000 Subject: [PATCH 1963/7878] Back out the inherit flag from apr_socket_create/apr_os_socket_put. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61957 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 13 ++----------- network_io/os2/sockets.c | 6 ++---- network_io/unix/sockets.c | 19 +++++++------------ network_io/win32/sockets.c | 6 +----- test/client.c | 2 +- test/sendfile.c | 2 +- test/server.c | 2 +- test/testpoll.c | 2 +- test/testsockets.c | 12 ++++++------ test/testsockopt.c | 2 +- 10 files changed, 23 insertions(+), 43 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 522f5fd25b9..ea85e8e023a 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -241,17 +241,12 @@ struct apr_ipsubnet_t { * @param new_sock The new socket that has been set up. * @param family The address family of the socket (e.g., APR_INET). * @param type The type of the socket (e.g., SOCK_STREAM). - * @param flag Should this socket be inherited by child processes. One of - *
    - *          APR_INHERIT       This socket is inherited by children
    - *          APR_NO_INHERIT    This socket is not inherited by children.
    - * 
    * @param cont The pool to use - * @deffunc apr_status_t apr_socket_create(apr_socket_t **new_sock, int family, int type, apr_int32_t flag, apr_pool_t *cont) + * @deffunc apr_status_t apr_socket_create(apr_socket_t **new_sock, int family, int type, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, int family, int type, - apr_int32_t flag, apr_pool_t *cont); + apr_pool_t *cont); /** * Shutdown either reading, writing, or both sides of a tcp socket. @@ -811,8 +806,6 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char name[16], * Set a socket to be inherited by child processes. * @param socket The socket to enable inheritance. * @deffunc void apr_socket_set_inherit(apr_socket_t *socket) - * @tip Same effect as passing the APR_INHERIT flag to apr_socket_create(), - * but it is far more efficient to pass the correct value in the first place. */ APR_DECLARE_SET_INHERIT(socket); @@ -820,8 +813,6 @@ APR_DECLARE_SET_INHERIT(socket); * Unset a socket from being inherited by child processes. * @param socket The socket to disable inheritance. * @deffunc void apr_socket_unset_inherit(apr_socket_t *socket) - * @tip Same effect as passing the APR_NO_INHERIT flag to apr_socket_create(), - * but it is far more efficient to pass the correct value in the first place. */ APR_DECLARE_UNSET_INHERIT(socket); diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 912e3858d6b..c1a7c5185a8 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -129,9 +129,8 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) } apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, - apr_int32_t inherit, apr_pool_t *cont) + apr_pool_t *cont) { - /* TODO: Implement inherit flag */ int family = ofamily; if (family == AF_UNSPEC) { @@ -271,9 +270,8 @@ apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, - apr_int32_t inherit, apr_pool_t *cont) + apr_pool_t *cont) { - /* TODO: Implement inherit flag */ alloc_socket(apr_sock, cont); set_socket_vars(*apr_sock, os_sock_info->family); (*apr_sock)->timeout = -1; diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index e7ef61fb2f6..06a3930c4d5 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -127,7 +127,7 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) } apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, - apr_int32_t inherit, apr_pool_t *cont) + apr_pool_t *cont) { int family = ofamily; @@ -160,10 +160,9 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, set_socket_vars(*new, family, type); (*new)->timeout = -1; - (*new)->inherit = inherit; + (*new)->inherit = 0; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, - ((*new)->inherit & APR_INHERIT) - ? apr_pool_cleanup_null : socket_cleanup); + socket_cleanup); return APR_SUCCESS; } @@ -254,10 +253,9 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn (*new)->local_interface_unknown = 1; } - (*new)->inherit = sock->inherit; + (*new)->inherit = 0; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, - ((*new)->inherit & APR_INHERIT) - ? apr_pool_cleanup_null : socket_cleanup); + socket_cleanup); return APR_SUCCESS; } @@ -334,7 +332,6 @@ apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, - apr_int32_t inherit, apr_pool_t *cont) { alloc_socket(apr_sock, cont); @@ -358,11 +355,9 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, (*apr_sock)->remote_addr->salen); } - (*apr_sock)->inherit = inherit; + (*apr_sock)->inherit = 0; apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), - socket_cleanup, - ((*apr_sock)->inherit & APR_INHERIT) - ? apr_pool_cleanup_null : socket_cleanup); + socket_cleanup, socket_cleanup); return APR_SUCCESS; } diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 5cbbfd9b718..7c854f9ed8d 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -118,10 +118,8 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) } APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, - int type, apr_int32_t inherit, - apr_pool_t *cont) + int type, apr_pool_t *cont) { - /* XXX: Todo: process the inherit value */ int family = ofamily; if (family == AF_UNSPEC) { @@ -367,10 +365,8 @@ APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, - apr_int32_t inherit, apr_pool_t *cont) { - /* XXX: Todo: process the inherit value */ alloc_socket(apr_sock, cont); set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type); (*apr_sock)->timeout = -1; diff --git a/test/client.c b/test/client.c index c463a403d42..a7a5eb1904f 100644 --- a/test/client.c +++ b/test/client.c @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) fprintf(stdout,"OK\n"); fprintf(stdout, "\tClient: Creating new socket......."); - if (apr_socket_create(&sock, remote_sa->family, SOCK_STREAM, APR_NO_INHERIT, + if (apr_socket_create(&sock, remote_sa->family, SOCK_STREAM, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); diff --git a/test/sendfile.c b/test/sendfile.c index 3a4e5ad4b00..d333e1657ea 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -114,7 +114,7 @@ static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family) } *sock = NULL; - rv = apr_socket_create(sock, *family, SOCK_STREAM, APR_NO_INHERIT, *p); + rv = apr_socket_create(sock, *family, SOCK_STREAM, *p); if (rv != APR_SUCCESS) { fprintf(stderr, "apr_socket_create()->%d/%s\n", rv, diff --git a/test/server.c b/test/server.c index 074eeb6c7e8..4c5087b8b78 100644 --- a/test/server.c +++ b/test/server.c @@ -132,7 +132,7 @@ int main(int argc, const char * const argv[]) } fprintf(stdout, "\tServer: Creating new socket......."); - if (apr_socket_create(&sock, family, SOCK_STREAM, APR_NO_INHERIT, context) != APR_SUCCESS) { + if (apr_socket_create(&sock, family, SOCK_STREAM, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); } diff --git a/test/testpoll.c b/test/testpoll.c index c20762e35f8..510d2c33bf7 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -72,7 +72,7 @@ static int make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, apr_port_t port printf("couldn't create control socket information, shutting down"); return 1; } - if (apr_socket_create(sock, (*sa)->sa.sin.sin_family, SOCK_DGRAM, APR_NO_INHERIT, p) + if (apr_socket_create(sock, (*sa)->sa.sin.sin_family, SOCK_DGRAM, p) != APR_SUCCESS){ printf("couldn't create UDP socket, shutting down"); return 1; diff --git a/test/testsockets.c b/test/testsockets.c index 82c4af7d7de..8fc74b9374d 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -101,20 +101,20 @@ int main(void) printf("Testing socket creation functions.\n"); STD_TEST_NEQ(" Creating a TCP socket", - apr_socket_create(&sock, APR_INET, SOCK_STREAM, APR_NO_INHERIT, pool)) + apr_socket_create(&sock, APR_INET, SOCK_STREAM, pool)) close_sock(sock); STD_TEST_NEQ(" Creating UDP socket", - apr_socket_create(&sock, APR_INET, SOCK_DGRAM, APR_NO_INHERIT, pool)) + apr_socket_create(&sock, APR_INET, SOCK_DGRAM, pool)) close_sock(sock); #if APR_HAVE_IPV6 STD_TEST_NEQ(" Creating an IPv6 TCP socket", - apr_socket_create(&sock, APR_INET6, SOCK_STREAM, APR_NO_INHERIT, pool)) + apr_socket_create(&sock, APR_INET6, SOCK_STREAM, pool)) close_sock(sock); STD_TEST_NEQ(" Creating an IPv6 UDP socket", - apr_socket_create(&sock, APR_INET6, SOCK_DGRAM, APR_NO_INHERIT, pool)) + apr_socket_create(&sock, APR_INET6, SOCK_DGRAM, pool)) close_sock(sock); #else printf("NO IPv6 support.\n"); @@ -123,9 +123,9 @@ int main(void) printf("Now trying sendto/recvfrom (simple tests only)\n"); STD_TEST_NEQ(" Creating socket #1 for test", - apr_socket_create(&sock, family, SOCK_DGRAM, APR_NO_INHERIT, pool)) + apr_socket_create(&sock, family, SOCK_DGRAM, pool)) STD_TEST_NEQ(" Creating socket #2 for test", - apr_socket_create(&sock2, family, SOCK_DGRAM, APR_NO_INHERIT, pool)) + apr_socket_create(&sock2, family, SOCK_DGRAM, pool)) apr_sockaddr_info_get(&to, US, APR_UNSPEC, 7772, 0, pool); apr_sockaddr_info_get(&from, US, APR_UNSPEC, 7771, 0, pool); diff --git a/test/testsockopt.c b/test/testsockopt.c index 6cec1e1f26c..f0b9641bf8f 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -103,7 +103,7 @@ int main(void) printf("Testing socket option functions.\n"); printf("\tCreating socket.........................."); - if ((stat = apr_socket_create(&sock, APR_INET, SOCK_STREAM, APR_NO_INHERIT, context)) + if ((stat = apr_socket_create(&sock, APR_INET, SOCK_STREAM, context)) != APR_SUCCESS){ printf("Failed to create a socket!\n"); exit(-1); From d815f1b2ae8ec66f9fe32b6b1741fd0076ad510a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 18 Jul 2001 16:56:06 +0000 Subject: [PATCH 1964/7878] Strip the inherit flag from apr_os_sock_make() (what a lousy name) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61958 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 5970f3e7d1e..c37ae105c9b 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -321,7 +321,6 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, * @param apr_sock The new socket that has been set up * @param os_sock_info The os representation of the socket handle and * other characteristics of the socket - * @param inherit Should this socket be inherited by child processes * @param cont The pool to use * @deffunc apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont) * @tip If you only know the descriptor/handle or if it isn't really @@ -329,7 +328,6 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, */ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, - int inherit, apr_pool_t *cont); /** From a62972b290be3c4462b9a993b135fb53f66b1386 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 18 Jul 2001 16:59:04 +0000 Subject: [PATCH 1965/7878] All that should be needed on OS2 for inheritance. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61959 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index c1a7c5185a8..f39faaf669e 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -309,3 +309,6 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_po return APR_SUCCESS; } +APR_IMPLEMENT_SET_INHERIT(socket, inherit, cntxt, socket_cleanup) + +APR_IMPLEMENT_UNSET_INHERIT(socket, inherit, cntxt, socket_cleanup) From 7ddff6547ab7a6b05bd35cfde325352099528f72 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 18 Jul 2001 17:23:38 +0000 Subject: [PATCH 1966/7878] apr_socket_[un]set_inherit is a noop on Win32, but must be exported. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61960 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_inherit.h | 5 ++--- network_io/win32/sockets.c | 8 ++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/apr_inherit.h b/include/apr_inherit.h index 0d30e3fc754..3e0e28bf6f2 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -59,14 +59,13 @@ extern "C" { #endif /* __cplusplus */ -#define APR_NO_INHERIT 0 #define APR_INHERIT (2^24) /* Outside of conflicts with other bits */ #define APR_DECLARE_SET_INHERIT(name) \ - void apr_##name##_set_inherit(apr_##name##_t *name) + APR_DECLARE(void) apr_##name##_set_inherit(apr_##name##_t *name) #define APR_DECLARE_UNSET_INHERIT(name) \ - void apr_##name##_unset_inherit(apr_##name##_t *name) + APR_DECLARE(void) apr_##name##_unset_inherit(apr_##name##_t *name) #ifdef __cplusplus } diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 7c854f9ed8d..aad05ce5600 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -410,3 +410,11 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, (*sock)->sock = *thesock; return APR_SUCCESS; } + +APR_DECLARE_SET_INHERIT(socket) { + return; +} + +APR_DECLARE_UNSET_INHERIT(socket) { + return; +} \ No newline at end of file From 12828aac9fb7c02fe87d62519c9fff942693fa32 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 18 Jul 2001 18:41:37 +0000 Subject: [PATCH 1967/7878] use a macro for obtaining the thread hash value so that the gory details aren't spread all over make an attempt to compute the thread hash value using a mechanism which will work when apr_os_thread_t is a scalar (e.g., glibc), pointer (e.g., Tru64), or even a structure (e.g., OS/390); previously, it only compiled on systems where apr_os_thread_t was a scalar git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61961 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_threads.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/memory/unix/apr_sms_threads.c b/memory/unix/apr_sms_threads.c index 6475050b212..f701bbcde6a 100644 --- a/memory/unix/apr_sms_threads.c +++ b/memory/unix/apr_sms_threads.c @@ -104,6 +104,8 @@ typedef struct thread_node_t #define HASH_SIZE 1021 #define SIZEOF_HASHTABLE APR_ALIGN_DEFAULT(HASH_SIZE) +#define THREAD_HASH(tid) \ +(*(int *)&(tid) % HASH_SIZE) typedef struct apr_sms_threads_t { @@ -159,7 +161,7 @@ static void *apr_sms_threads_malloc(apr_sms_t *sms, size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; thread = apr_os_thread_current(); - hash = thread % HASH_SIZE; + hash = THREAD_HASH(thread); /* If the thread wasn't registered before, we will segfault */ thread_node = SMS_THREADS_T(sms)->hashtable[hash]; @@ -304,7 +306,7 @@ static apr_status_t apr_sms_threads_free(apr_sms_t *sms, void *mem) return APR_SUCCESS; thread = apr_os_thread_current(); - hash = thread % HASH_SIZE; + hash = THREAD_HASH(thread); thread_node = SMS_THREADS_T(sms)->hashtable[hash]; while (thread_node->thread != thread) @@ -562,7 +564,7 @@ static apr_status_t apr_sms_threads_thread_register(apr_sms_t *sms, node_t *node, *sentinel; apr_uint16_t hash; - hash = thread % HASH_SIZE; + hash = THREAD_HASH(thread); if (sms->threads > 1 && !SMS_THREADS_T(sms)->lock) { apr_lock_create(&SMS_THREADS_T(sms)->lock, @@ -630,7 +632,7 @@ static apr_status_t apr_sms_threads_thread_unregister(apr_sms_t *sms, apr_uint16_t hash; apr_size_t min_alloc, max_free; - hash = thread % HASH_SIZE; + hash = THREAD_HASH(thread); free_list = NULL; if (SMS_THREADS_T(sms)->lock) From 039ba68783edba1d36010b6378fd4fb0ca4ecc9a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 18 Jul 2001 19:12:41 +0000 Subject: [PATCH 1968/7878] Set up the inherit mechanics to drop the APR_INHERIT flag. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61962 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 8 ++++++-- file_io/unix/filedup.c | 12 +++++++----- file_io/unix/open.c | 6 +----- file_io/win32/open.c | 19 ++++++++++--------- include/apr_file_io.h | 14 -------------- 5 files changed, 24 insertions(+), 35 deletions(-) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 6a938abbcff..2209caa625a 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -143,8 +143,7 @@ apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag dafile->dataRead = 0; dafile->direction = 0; dafile->pipe = FALSE; - - apr_pool_cleanup_register(dafile->cntxt, dafile, apr_file_cleanup, apr_pool_cleanup_null); + apr_pool_cleanup_register(dafile->cntxt, dafile, apr_file_cleanup, apr_file_cleanup); return APR_SUCCESS; } @@ -265,3 +264,8 @@ apr_status_t apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) } APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); + +APR_IMPLEMENT_SET_INHERIT(socket, inherit, cntxt, socket_cleanup) + +APR_IMPLEMENT_UNSET_INHERIT(socket, inherit, cntxt, socket_cleanup) + diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 1e5a0f39c62..baf5339dcd3 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -85,12 +85,14 @@ apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_ #endif (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); } - (*new_file)->blocking = old_file->blocking; /* this is the way dup() works */ - (*new_file)->flags = old_file->flags; + /* this is the way dup() works */ + (*new_file)->blocking = old_file->blocking; + /* apr_file_dup() clears the inherit attribute, user must call + * apr_file_set_inherit() again on the dupped handle, as necessary. + */ + (*new_file)->flags = old_file->flags & ~APR_INHERIT; apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), - apr_unix_file_cleanup, - ((*new_file)->flags & APR_INHERIT) - ? apr_pool_cleanup_null : apr_unix_file_cleanup); + apr_unix_file_cleanup, apr_unix_file_cleanup); return APR_SUCCESS; } diff --git a/file_io/unix/open.c b/file_io/unix/open.c index f0bcfbe5b22..3b9ee73595e 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -168,10 +168,7 @@ apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag (*new)->dataRead = 0; (*new)->direction = 0; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), - apr_unix_file_cleanup, - ((*new)->flags & APR_INHERIT) - ? apr_pool_cleanup_null - : apr_unix_file_cleanup); + apr_unix_file_cleanup, apr_unix_file_cleanup); return APR_SUCCESS; } @@ -227,7 +224,6 @@ apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, /* buffer already NULL; * don't get a lock (only for buffered files) */ - (*file)->flags = APR_INHERIT; return APR_SUCCESS; } diff --git a/file_io/win32/open.c b/file_io/win32/open.c index ac1f785e79c..998c7a12d3c 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -173,7 +173,6 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) { - SECURITY_ATTRIBUTES sa, *psa = NULL; HANDLE handle = INVALID_HANDLE_VALUE; DWORD oflags = 0; DWORD createflags = 0; @@ -233,12 +232,6 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, */ attributes |= FILE_FLAG_OVERLAPPED; } - if (flag & APR_INHERIT) { - sa.nLength = sizeof(sa); - sa.bInheritHandle = TRUE; - sa.lpSecurityDescriptor = NULL; - psa = &sa; - } #if APR_HAS_UNICODE_FS if (os_level >= APR_WIN_NT) { @@ -247,12 +240,12 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, / sizeof(apr_wchar_t), fname)) return rv; handle = CreateFileW(wfname, oflags, sharemode, - psa, createflags, attributes, 0); + NULL, createflags, attributes, 0); } else #endif handle = CreateFileA(fname, oflags, sharemode, - psa, createflags, attributes, 0); + NULL, createflags, attributes, 0); if (handle == INVALID_HANDLE_VALUE) { return apr_get_os_error(); @@ -460,3 +453,11 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t * } APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); + +APR_DECLARE_SET_INHERIT(file) { + return; +} + +APR_DECLARE_UNSET_INHERIT(file) { + return; +} \ No newline at end of file diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 97edde44b64..bb228a69382 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -90,12 +90,6 @@ extern "C" { #define APR_SHARELOCK 1024 /* Platform dependent support for higher level locked read/write access to support writes across process/machines */ -#ifndef APR_INHERIT -#define APR_INHERIT (2^24) /* Create the file inheritable by the child - process. fork()ed implementations - automatically register a child cleanup - in the _absense_ of this flag. */ -#endif /* flags for apr_file_seek */ #define APR_SET SEEK_SET @@ -148,10 +142,6 @@ typedef struct apr_file_t apr_file_t; * APR_SHARELOCK Platform dependent support for higher * level locked read/write access to support * writes across process/machines - * APR_INHERIT Create the file inheritable by the child - * processes. fork()ed implementations - * automatically register a child cleanup - * in the _absense_ of this flag. *
    * @param perm Access permissions for file. * @param cont The pool to use. @@ -584,8 +574,6 @@ APR_POOL_DECLARE_ACCESSOR(file); * Set a file to be inherited by child processes. * @param file The file to enable inheritance. * @deffunc void apr_file_set_inherit(apr_file_t *file) - * @tip Same effect as passing the APR_INHERIT flag to apr_file_open(), - * but it is far more efficient to pass the correct value in the first place. */ APR_DECLARE_SET_INHERIT(file); @@ -593,8 +581,6 @@ APR_DECLARE_SET_INHERIT(file); * Unset a file from being inherited by child processes. * @param file The file to disable inheritance. * @deffunc void apr_file_unset_inherit(apr_file_t *file) - * @tip Same effect as omiting the APR_INHERIT flag to apr_file_open(), - * but it is far more efficient to pass the correct value in the first place. */ APR_DECLARE_UNSET_INHERIT(file); From 505cd4ef05514c54ebd82055def6a764913dee6c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 18 Jul 2001 19:32:29 +0000 Subject: [PATCH 1969/7878] Clean up APR_INHERIT - it's now a private flag. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61963 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filedup.c | 3 ++- file_io/win32/filedup.c | 5 ++++- include/apr_inherit.h | 2 -- include/arch/unix/inherit.h | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 5829f4f2932..717d08ed937 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -57,6 +57,7 @@ #include "apr_lib.h" #include "apr_strings.h" #include +#include "inherit.h" apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { @@ -85,7 +86,7 @@ apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_ dup_file->fname = apr_pstrdup(dup_file->cntxt, old_file->fname); dup_file->buffered = old_file->buffered; dup_file->isopen = old_file->isopen; - dup_file->flags = old_file->flags; + dup_file->flags = old_file->flags & ~APR_INHERIT; /* TODO - dup pipes correctly */ dup_file->pipe = old_file->pipe; diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 49634a04985..7ddbb3ad92e 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -57,6 +57,7 @@ #include "apr_general.h" #include "apr_strings.h" #include +#include "inherit.h" APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) @@ -81,6 +82,8 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, } } else { HANDLE hFile = (*new_file)->filehand; + /* XXX: need to dup the handle!!! + */ /* dup2 is not supported with native Windows handles. We * can, however, emulate dup2 for the standard i/o handles. */ @@ -103,7 +106,7 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, return APR_ENOTIMPL; } - (*new_file)->flags = old_file->flags; + (*new_file)->flags = old_file->flags & ~APR_INHERIT; (*new_file)->cntxt = old_file->cntxt; (*new_file)->fname = apr_pstrdup(old_file->cntxt, old_file->fname); (*new_file)->append = old_file->append; diff --git a/include/apr_inherit.h b/include/apr_inherit.h index 3e0e28bf6f2..849fa8b8c03 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -59,8 +59,6 @@ extern "C" { #endif /* __cplusplus */ -#define APR_INHERIT (2^24) /* Outside of conflicts with other bits */ - #define APR_DECLARE_SET_INHERIT(name) \ APR_DECLARE(void) apr_##name##_set_inherit(apr_##name##_t *name) diff --git a/include/arch/unix/inherit.h b/include/arch/unix/inherit.h index 085cf2e0f03..19d9bbc3b2d 100644 --- a/include/arch/unix/inherit.h +++ b/include/arch/unix/inherit.h @@ -57,6 +57,8 @@ #include "apr_inherit.h" +#define APR_INHERIT (2^24) /* Must not conflicts with other bits */ + #define APR_IMPLEMENT_SET_INHERIT(name, flag, pool, cleanup) \ void apr_##name##_set_inherit(apr_##name##_t *name) \ { \ From b7301485660172159f41ffd1263a321a65cb10c0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 18 Jul 2001 19:41:20 +0000 Subject: [PATCH 1970/7878] Remove last public vestigages of APR_INHERIT git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61964 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index baf5339dcd3..50235a3ac83 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -55,6 +55,7 @@ #include "fileio.h" #include "apr_strings.h" #include "apr_portable.h" +#include "inherit.h" apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { From 87a3d31fceb9c68ad8b7596e48e31e9d44fdbd36 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 19 Jul 2001 00:11:57 +0000 Subject: [PATCH 1971/7878] Add tryacquire function to the apr_lock_* stable. (tryacquire will not block but return APR_EBUSY if the lock is held.) Currently, I only implemented this on Unix for intraprocess locks (as this is the only one I need right now). Other lock types on Unix may well be able to support them (definitely interprocess pthread mutex!). All others platforms should return APR_ENOTIMPL for now until their respective gurus add it (if they need it). I wasn't sure if we could rely on EBUSY on all platforms, so I added the APR_EBUSY constant. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61965 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_errno.h | 3 +++ include/apr_lock.h | 8 ++++++++ include/arch/unix/locks.h | 1 + locks/beos/locks.c | 5 +++++ locks/os2/locks.c | 5 +++++ locks/unix/crossproc.c | 4 ++++ locks/unix/intraproc.c | 18 ++++++++++++++++++ locks/unix/locks.c | 24 ++++++++++++++++++++++++ locks/win32/locks.c | 5 +++++ 10 files changed, 77 insertions(+) diff --git a/CHANGES b/CHANGES index e9c6ba75d63..1098ffb9dc9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Added apr_lock_tryacquire. It will attempt to acquire the lock, but + will not block if it can not acquire the lock. Returns APR_EBUSY if + acquistion can not happen. [Justin Erenkrantz] + *) Added an inherit flag to apr_socket_create and other socket creation functions. This allows APR programs to specify that a socket should be passed to any child processes that are created. The inherit flag diff --git a/include/apr_errno.h b/include/apr_errno.h index 82b1a03f369..479bca39dba 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -211,6 +211,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * APR_ERELATIVE The given path was relative. * APR_EINCOMPLETE The given path was neither relative nor absolute. * APR_EABOVEROOT The given path was above the root path. + * APR_EBUSY The given lock was busy. * * * @param status The APR_status code to check. @@ -298,6 +299,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_EINIT (APR_OS_START_STATUS + 22) #define APR_ENOTIMPL (APR_OS_START_STATUS + 23) #define APR_EMISMATCH (APR_OS_START_STATUS + 24) +#define APR_EBUSY (APR_OS_START_STATUS + 25) /* APR STATUS VALUE TESTS */ #define APR_STATUS_IS_INCHILD(s) ((s) == APR_INCHILD) @@ -324,6 +326,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_EINIT(s) ((s) == APR_EINIT) #define APR_STATUS_IS_ENOTIMPL(s) ((s) == APR_ENOTIMPL) #define APR_STATUS_IS_EMISMATCH(s) ((s) == APR_EMISMATCH) +#define APR_STATUS_IS_EBUSY(s) ((s) == APR_EBUSY) /* APR CANONICAL ERROR VALUES */ #ifdef EACCES diff --git a/include/apr_lock.h b/include/apr_lock.h index fd3439b367f..fbc447c7252 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -113,6 +113,14 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, */ APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock); +/** + * Tries to lock a protected region. + * If it fails, returns APR_EBUSY. Otherwise, it returns APR_SUCCESS. + * @param lock The lock to set. + * @deffunc apr_status_t apr_lock_tryacquire(apr_lock_t *lock) + */ +APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock); + /** * Lock a region with either a reader or writer lock. * @param lock The lock to set. diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index a1f920d39cb..a0a19f8b0e0 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -104,6 +104,7 @@ struct apr_unix_lock_methods_t { unsigned int flags; apr_status_t (*create)(apr_lock_t *, const char *); apr_status_t (*acquire)(apr_lock_t *); + apr_status_t (*tryacquire)(apr_lock_t *); apr_status_t (*acquire_read)(apr_lock_t *); apr_status_t (*acquire_write)(apr_lock_t *); apr_status_t (*release)(apr_lock_t *); diff --git a/locks/beos/locks.c b/locks/beos/locks.c index 1e92fb0affe..efa44a0ad03 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -328,6 +328,11 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock) return APR_SUCCESS; } +apr_status_t apr_lock_tryacquire(apr_lock_t *lock) +{ + return APR_ENOTIMPL; +} + apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) { switch (lock->type) diff --git a/locks/os2/locks.c b/locks/os2/locks.c index 3d7eed8a49a..1417a828e59 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -157,6 +157,11 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock) return APR_OS2_STATUS(rc); } +apr_status_t apr_lock_tryacquire(apr_lock_t *lock) +{ + return APR_ENOTIMPL; +} + apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) { switch (lock->type) { diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 2b2aac5bd5e..67f098ca97a 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -158,6 +158,7 @@ const apr_unix_lock_methods_t apr_unix_sysv_methods = #endif sysv_create, sysv_acquire, + NULL, /* no tryacquire */ NULL, /* no rw lock */ NULL, /* no rw lock */ sysv_release, @@ -324,6 +325,7 @@ const apr_unix_lock_methods_t apr_unix_proc_pthread_methods = APR_PROCESS_LOCK_MECH_IS_GLOBAL, proc_pthread_create, proc_pthread_acquire, + NULL, /* no tryacquire */ NULL, /* no rw lock */ NULL, /* no rw lock */ proc_pthread_release, @@ -440,6 +442,7 @@ const apr_unix_lock_methods_t apr_unix_fcntl_methods = #endif fcntl_create, fcntl_acquire, + NULL, /* no tryacquire */ NULL, /* no rw lock */ NULL, /* no rw lock */ fcntl_release, @@ -555,6 +558,7 @@ const apr_unix_lock_methods_t apr_unix_flock_methods = #endif flock_create, flock_acquire, + NULL, /* no tryacquire */ NULL, /* no rw lock */ NULL, /* no rw lock */ flock_release, diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index 3058c744ff4..5a45cbe0a04 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -126,6 +126,22 @@ static apr_status_t intra_acquire(apr_lock_t *lock) return stat; } +static apr_status_t intra_tryacquire(apr_lock_t *lock) +{ + apr_status_t stat; + + stat = pthread_mutex_trylock(lock->intraproc); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + /* Normalize the return code. */ + if (stat == EBUSY) + stat = APR_EBUSY; + return stat; +} + static apr_status_t intra_release(apr_lock_t *lock) { apr_status_t status; @@ -156,6 +172,7 @@ const apr_unix_lock_methods_t apr_unix_intra_methods = 0, intra_create, intra_acquire, + intra_tryacquire, NULL, /* no read lock concept */ NULL, /* no write lock concept */ intra_release, @@ -200,6 +217,7 @@ const apr_unix_lock_methods_t apr_unix_rwlock_methods = 0, rwlock_create, NULL, /* no standard acquire method; app better not call :) */ + NULL, /* no standard tryacquire method; app better not call :) */ rwlock_acquire_read, rwlock_acquire_write, rwlock_release, diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 11898db8d22..02c519d7342 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -120,6 +120,7 @@ static const struct apr_unix_lock_methods_t lockall_methods = 0, lockall_create, lockall_acquire, + NULL, /* no tryacquire concept */ NULL, /* no read lock concept */ NULL, /* no write lock concept */ lockall_release, @@ -282,6 +283,29 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock) return APR_SUCCESS; } +apr_status_t apr_lock_tryacquire(apr_lock_t *lock) +{ + apr_status_t stat; + +#if APR_HAS_THREADS + if (apr_os_thread_equal(lock->owner, apr_os_thread_current())) { + lock->owner_ref++; + return APR_SUCCESS; + } +#endif + + if ((stat = lock->meth->tryacquire(lock)) != APR_SUCCESS) { + return stat; + } + +#if APR_HAS_THREADS + lock->owner = apr_os_thread_current(); + lock->owner_ref = 1; +#endif + + return APR_SUCCESS; +} + apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) { switch (e) diff --git a/locks/win32/locks.c b/locks/win32/locks.c index dc9e889a5f0..079b5e2d576 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -169,6 +169,11 @@ APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock) return apr_get_os_error(); } +APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock) +{ + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) { From ac6526907a82440265dbdf57cf79a3adce663855 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 19 Jul 2001 03:45:33 +0000 Subject: [PATCH 1972/7878] Add apr_hash_overlay function in the spirit of apr_table_overlay. Also add testhash.c program to test the proper operation of the hash functions. I (Justin) did the following things to Ian's patch as posted: - Reformatted to fit APR coding style. - Fixed comment in apr_hash.h (swapped base and overlay) - Also reformat the test/Makefile.in while I'm at it Submitted by: Ian Holsman Reviewed by: Justin Erenkrantz, Brian Pane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61966 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 13 ++ tables/apr_hash.c | 55 +++++++++ test/Makefile.in | 16 ++- test/testhash.c | 293 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 371 insertions(+), 6 deletions(-) create mode 100644 test/testhash.c diff --git a/include/apr_hash.h b/include/apr_hash.h index 4548905eb8d..a834318a3c2 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -181,6 +181,19 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, */ APR_DECLARE(int) apr_hash_count(apr_hash_t *ht); +/** + * Merge two hash tables into one new hash table. The values of the overlay + * hash override the values of the base if both have the same key. + * @param p The pool to use for the new hash table + * @param overlay The table to add to the initial table + * @param base The table that represents the initial values of the new table + * @return A new hash table containing all of the data from the two passed in + * @deffunc apr_hash_t *apr_hash_overlay(apr_pool_t *p, const apr_table_t *over +lay, const apr_table_t *base); + */ +APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p, + const apr_hash_t *overlay, + const apr_hash_t *base); #ifdef __cplusplus } diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 36409e35401..21f8c405886 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -325,3 +325,58 @@ APR_DECLARE(int) apr_hash_count(apr_hash_t *ht) { return ht->count; } + +APR_DECLARE(apr_hash_t*) apr_hash_overlay(apr_pool_t *p, + const apr_hash_t *overlay, + const apr_hash_t *base) +{ + apr_hash_t *res; + apr_hash_index_t *hi; + apr_hash_entry_t *new_vals; + int i,j; + +#ifdef POOL_DEBUG + /* we don't copy keys and values, so it's necessary that + * overlay->a.pool and base->a.pool have a life span at least + * as long as p + */ + if (!apr_pool_is_ancestor(overlay->a.pool, p)) { + fprintf(stderr, + "apr_hash_overlay: overlay's pool is not an ancestor of p\n"); + abort(); + } + if (!apr_pool_is_ancestor(base->a.pool, p)) { + fprintf(stderr, + "apr_hash_overlay: base's pool is not an ancestor of p\n"); + abort(); + } +#endif + + res = apr_palloc(p, sizeof(apr_hash_t)); + res->pool = p; + res->count = base->count; + res->max = (overlay->max > base->max) ? overlay->max : base->max; + res->array = alloc_array(res, res->max); + new_vals = apr_palloc(p, sizeof(apr_hash_entry_t) * res->count); + j = 0; + for (hi = apr_hash_first((apr_hash_t*)base); hi; hi = apr_hash_next(hi)) { + i = hi->this->hash & res->max; + + new_vals[j].klen = hi->this->klen; + new_vals[j].key = hi->this->key; + new_vals[j].val = hi->this->val; + new_vals[j].hash = hi->this->hash; + new_vals[j].next = res->array[i]; + res->array[i] = &new_vals[j]; + j++; + } + + /* can't simply copy the stuff over, need to set each one so as to + * increment the counts/array properly + */ + for (hi = apr_hash_first((apr_hash_t*)overlay); hi; + hi = apr_hash_next(hi)) { + apr_hash_set(res, hi->this->key, hi->this->klen, hi->this->val); + } + return res; +} diff --git a/test/Makefile.in b/test/Makefile.in index dce1df23216..e1a96dfc9ad 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -19,13 +19,14 @@ PROGRAMS = \ testpipe@EXEEXT@ \ testoc@EXEEXT@ \ testuuid@EXEEXT@ \ - testsockopt@EXEEXT@ \ - testipsub@EXEEXT@ \ - testmd5@EXEEXT@ \ - testpoll@EXEEXT@ \ - testmem@EXEEXT@ \ + testsockopt@EXEEXT@ \ + testipsub@EXEEXT@ \ + testmd5@EXEEXT@ \ + testpoll@EXEEXT@ \ + testmem@EXEEXT@ \ + testhash@EXEEXT@ \ occhild@EXEEXT@ \ - teststr@EXEEXT@ + teststr@EXEEXT@ TARGETS = $(PROGRAMS) @@ -123,6 +124,9 @@ testpoll@EXEEXT@: testpoll.lo $(LOCAL_LIBS) testmem@EXEEXT@: testmem.lo $(LOCAL_LIBS) $(LINK) testmem.lo $(LOCAL_LIBS) $(ALL_LIBS) +testhash@EXEEXT@: testhash.lo $(LOCAL_LIBS) + $(LINK) testhash.lo $(LOCAL_LIBS) $(ALL_LIBS) + teststr@EXEEXT@: teststr.lo $(LOCAL_LIBS) $(LINK) teststr.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/testhash.c b/test/testhash.c new file mode 100644 index 00000000000..da1e9c3b0b5 --- /dev/null +++ b/test/testhash.c @@ -0,0 +1,293 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_strings.h" +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_hash.h" +#if APR_HAVE_STDIO_H +#include +#endif +#if APR_HAVE_STDLIB_H +#include +#endif +#if APR_HAVE_STRING_H +#include +#endif + +static void dump_hash(apr_hash_t *h) +{ + apr_hash_index_t *hi; + char *val, *key; + int len; + int i = 0; + + for (hi = apr_hash_first(h); hi; hi = apr_hash_next(hi)) { + apr_hash_this(hi,(void*) &key, &len,(void*) &val); + fprintf(stdout, "Key %s (%d) Value %s\n",key,len,val); + i++; + } + if (i != apr_hash_count(h)) + fprintf(stderr, "ERROR: #entries (%d) does not match count (%d)\n", + i, apr_hash_count(h)); + else + fprintf(stdout, "#entries %d \n", i); +} + +static void sum_hash(apr_hash_t *h, int *pcount, int *keySum, int *valSum) +{ + apr_hash_index_t *hi; + void *val, *key; + int count = 0; + + *keySum = 0; + *valSum = 0; + *pcount = 0; + for (hi = apr_hash_first(h); hi; hi = apr_hash_next(hi)) { + apr_hash_this(hi, (void*)&key, NULL, &val); + *valSum += *(int *)val; + *keySum += *(int *)key; + count++; + } + *pcount=count; +} + +int main(int argc, const char *const argv[]) +{ + apr_pool_t *cntxt; + apr_hash_t *h, *h2, *h3, *h4; + + int i, j, *val, *key; + char *result; + int sumKeys, sumVal, trySumKey, trySumVal; + + apr_initialize(); + atexit(apr_terminate); + + apr_pool_create(&cntxt, NULL); + + /* table defaults */ + h = apr_hash_make(cntxt); + if (h == NULL) { + fprintf(stderr, "ERROR: can not allocate HASH!\n"); + exit(-1); + } + + apr_hash_set(h, "OVERWRITE", APR_HASH_KEY_STRING, "should not see this"); + apr_hash_set(h, "FOO3", APR_HASH_KEY_STRING, "bar3"); + apr_hash_set(h, "FOO3", APR_HASH_KEY_STRING, "bar3"); + apr_hash_set(h, "FOO1", APR_HASH_KEY_STRING, "bar1"); + apr_hash_set(h, "FOO2", APR_HASH_KEY_STRING, "bar2"); + apr_hash_set(h, "FOO4", APR_HASH_KEY_STRING, "bar4"); + apr_hash_set(h, "SAME1", APR_HASH_KEY_STRING, "same"); + apr_hash_set(h, "SAME2", APR_HASH_KEY_STRING, "same"); + apr_hash_set(h, "OVERWRITE", APR_HASH_KEY_STRING, "Overwrite key"); + + result = apr_hash_get(h, "FOO2", APR_HASH_KEY_STRING); + if (strcmp(result, "bar2")) + fprintf(stderr, "ERROR:apr_hash_get FOO2 = %s (should be bar2)\n", + result); + + result = apr_hash_get(h, "SAME2", APR_HASH_KEY_STRING); + if (strcmp(result, "same")) + fprintf(stderr, "ERROR:apr_hash_get SAME2 = %s (should be same)\n", + result); + + result = apr_hash_get(h, "OVERWRITE", APR_HASH_KEY_STRING); + if (strcmp(result, "Overwrite key")) + fprintf(stderr, + "ERROR:apr_hash_get OVERWRITE = %s (should be 'Overwrite key')\n", + result); + + result = apr_hash_get(h, "NOTTHERE", APR_HASH_KEY_STRING); + if (result) + fprintf(stderr, "ERROR:apr_hash_get NOTTHERE = %s (should be NULL)\n", + result); + + result=apr_hash_get(h, "FOO3", APR_HASH_KEY_STRING); + if (strcmp(result, "bar3")) + fprintf(stderr, "ERROR:apr_hash_get FOO3 = %s (should be bar3)\n", + result); + + dump_hash(h); + + h2 =apr_hash_make(cntxt); + if (h2 == NULL) { + fprintf(stderr, "ERROR: can not allocate HASH!\n"); + exit(-1); + } + sumKeys = 0; + sumVal = 0; + trySumKey = 0; + trySumVal = 0; + + for (i = 0; i < 100; i++) { + j = i * 10 + 1; + sumKeys += j; + sumVal += i; + key = apr_palloc(cntxt, sizeof(int)); + *key = j; + val = apr_palloc(cntxt, sizeof(int)); + *val = i; + apr_hash_set(h2, key, sizeof(int), val); + } + + sum_hash(h2, &i, &trySumKey, &trySumVal); + if (i==100) { + fprintf(stdout, "All keys accounted for\n"); + } else { + fprintf(stderr, "ERROR: Only got %d (out of 100)\n",i); + } + if (trySumVal != sumVal) { + fprintf(stderr, "ERROR:Values don't add up Got %d expected %d\n", + trySumVal, sumVal); + } + if (trySumKey != sumKeys) { + fprintf(stderr, "ERROR:Keys don't add up Got %d expected %d\n", + trySumKey, sumKeys); + } + + j=891; + apr_hash_set(h2, &j, sizeof(int), NULL); + + if (apr_hash_get(h2, &j, sizeof(int))) { + fprintf(stderr, "ERROR: Delete not working\n"); + } else { + fprintf(stdout, "Delete working\n"); + } + sum_hash(h2, &i, &trySumKey, &trySumVal); + + sumKeys -= 891; + sumVal -= 89; + + if (i==99) { + fprintf(stdout, "All keys accounted for.. Delete OK\n"); + } else { + fprintf(stderr, "Only got %d (out of 99) Delete Not OK\n", i); + } + if (trySumVal != sumVal) { + fprintf(stderr, "ERROR:Values don't add up Got %d expected %d\n", + trySumVal, sumVal); + } + if (trySumKey != sumKeys) { + fprintf(stderr, "ERROR:Keys don't add up Got %d expected %d\n", + trySumKey, sumKeys); + } + + /* test overlay */ + h3 = apr_hash_make(cntxt); + /* test with blank hash tables */ + h4 = apr_hash_overlay(cntxt, h3, h); + + if (apr_hash_count(h4) != apr_hash_count(h)) { + fprintf(stderr, + "ERROR: overlay not working with blank overlay as overlay\n"); + dump_hash(h4); + } + + h4 = apr_hash_overlay(cntxt, h, h3); + if (apr_hash_count(h4) != apr_hash_count(h)) { + fprintf(stderr, + "ERROR: overlay not working with blank overlay as base\n"); + dump_hash(h4); + } + + h4 = apr_hash_overlay(cntxt, h, h2); + if (apr_hash_count(h4) != (apr_hash_count(h) + apr_hash_count(h2))) + fprintf(stderr, + "ERROR: overlay not working when overlaying 2 unique hashs\n"); + + h4 = apr_hash_overlay(cntxt, h, h); + if (apr_hash_count(h4) != apr_hash_count(h)) { + fprintf(stderr, + "ERROR: overlay not working when overlaying same hash\n"); + dump_hash(h4); + } + + result = apr_hash_get(h4, "FOO2", APR_HASH_KEY_STRING); + if (strcmp(result, "bar2")) + fprintf(stderr, "ERROR:apr_hash_get FOO2 = %s (should be bar2)\n", + result); + + result = apr_hash_get(h4, "SAME2", APR_HASH_KEY_STRING); + if (strcmp(result, "same")) + fprintf(stderr, "ERROR:apr_hash_get SAME2 = %s (should be same)\n", + result); + + result = apr_hash_get(h4, "OVERWRITE", APR_HASH_KEY_STRING); + if (strcmp(result, "Overwrite key")) + fprintf(stderr, + "ERROR:apr_hash_get OVERWRITE = %s (should be 'Overwrite key')\n", + result); + + result = apr_hash_get(h4, "NOTTHERE", APR_HASH_KEY_STRING); + if (result) + fprintf(stderr, "ERROR:apr_hash_get NOTTHERE = %s (should be NULL)\n", + result); + + result = apr_hash_get(h4, "FOO3", APR_HASH_KEY_STRING); + if (strcmp(result, "bar3")) + fprintf(stderr, "ERROR:apr_hash_get FOO3 = %s (should be bar3)\n", + result); + + apr_hash_set(h4, "FOO3", sizeof(int), NULL); + result = apr_hash_get(h4, "FOO3", APR_HASH_KEY_STRING); + if (result) + fprintf(stderr, + "ERROR:apr_hash_get FOO3 = %s (should be NULL, we just deleted it!)\n", + result); + + return 0; +} From c88c18bf82cb57987558934564317d1147454237 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 19 Jul 2001 04:13:05 +0000 Subject: [PATCH 1973/7878] Uninitialized data :( git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61967 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getopt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index b14b8c9fec9..4ed1d534985 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -55,6 +55,7 @@ APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, *os = apr_palloc(cont, sizeof(apr_getopt_t)); (*os)->cont = cont; + (*os)->reset = 0; (*os)->err = 1; (*os)->place = EMSG; (*os)->argc = argc; From 5724ad1ad5771606833b29ae780591bda7ffb414 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 19 Jul 2001 04:29:58 +0000 Subject: [PATCH 1974/7878] It's really evil to keep accumulating 256 byte chunks out of the pollfd :( git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61968 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/poll.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 780039301ae..6d11777f811 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -148,14 +148,15 @@ APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, { apr_int16_t revents = 0; WSABUF data; + char buf[256]; int dummy; int flags = MSG_PEEK; /* We just want to PEEK at the data, so I am setting up a dummy WSABUF * variable here. */ - data.len = 256; - data.buf = (char *)apr_palloc(aprset->cntxt, 256); + data.len = sizeof(buf); + data.buf = buf; if (FD_ISSET(sock->sock, aprset->read)) { revents |= APR_POLLIN; From cd7502aa01d414b2200b3951afb5158543c8fe30 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 19 Jul 2001 11:58:33 +0000 Subject: [PATCH 1975/7878] Some formatting changes, no code change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61969 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index cbd6f5dafea..4cf971ab0f0 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -96,7 +96,7 @@ static void make_array_core(apr_array_header_t *res, apr_pool_t *p, * array of zero elts. */ if (nelts < 1) { - nelts = 1; + nelts = 1; } res->elts = apr_pcalloc(p, nelts * elt_size); @@ -120,14 +120,14 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr) { if (arr->nelts == arr->nalloc) { - int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2; - char *new_data; + int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2; + char *new_data; - new_data = apr_pcalloc(arr->pool, arr->elt_size * new_size); + new_data = apr_pcalloc(arr->pool, arr->elt_size * new_size); - memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size); - arr->elts = new_data; - arr->nalloc = new_size; + memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size); + arr->elts = new_data; + arr->nalloc = new_size; } ++arr->nelts; From 289fc85ee1a6ed2b11c59358e080076b209d540c Mon Sep 17 00:00:00 2001 From: Karl Fogel Date: Thu, 19 Jul 2001 17:31:05 +0000 Subject: [PATCH 1976/7878] #include , for memcpy(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61970 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_trivial.c | 1 + 1 file changed, 1 insertion(+) diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index 14165e689fd..54948bf7c72 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -60,6 +60,7 @@ #include "apr_lock.h" #include "sms_private.h" #include +#include static const char *module_identity = "TRIVIAL"; From 680705b585696b8487a25173468f1deb88cfcd5c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 20 Jul 2001 12:36:13 +0000 Subject: [PATCH 1977/7878] include to get _POSIX_THREAD_SAFE_FUNCTIONS defined (at least glibc 2.1) I didn't check to see if this was broken in a9, so I mentioned it in CHANGES just to be safe (or lazy) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61971 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ user/unix/groupinfo.c | 3 +++ user/unix/userinfo.c | 3 +++ 3 files changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index 1098ffb9dc9..d14348227d5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Use getpwnam_r() and getgrgid_r() instead of getpwnam() and getgrgid() + with threaded builds on glibc (2.1, at least) to avoid thread safety + issues. [Jeff Trawick] + *) Added apr_lock_tryacquire. It will attempt to acquire the lock, but will not block if it can not acquire the lock. Returns APR_EBUSY if acquistion can not happen. [Justin Erenkrantz] diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index eac3aa843a5..34f2e434579 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -62,6 +62,9 @@ #if APR_HAVE_SYS_TYPES_H #include #endif +#if APR_HAVE_UNISTD_H +#include /* for _POSIX_THREAD_SAFE_FUNCTIONS */ +#endif APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) { diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index aa062f44253..5aae6e8ee35 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -62,6 +62,9 @@ #if APR_HAVE_SYS_TYPES_H #include #endif +#if APR_HAVE_UNISTD_H +#include /* for _POSIX_THREAD_SAFE_FUNCTIONS */ +#endif static apr_status_t getpwnam_safe(const char *username, struct passwd **pw) From 048e6d765c97e7680cee158533dc025dcd733b5f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 20 Jul 2001 13:28:43 +0000 Subject: [PATCH 1978/7878] add a simple test driver for some of the APR userid-based functions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61972 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + test/Makefile.in | 6 ++- test/testuser.c | 127 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 test/testuser.c diff --git a/test/.cvsignore b/test/.cvsignore index 2388677c6fc..7b0bf706de6 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -42,3 +42,4 @@ testmem testlock *.core testsockets +testuser diff --git a/test/Makefile.in b/test/Makefile.in index e1a96dfc9ad..e214534a3e5 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -26,7 +26,8 @@ PROGRAMS = \ testmem@EXEEXT@ \ testhash@EXEEXT@ \ occhild@EXEEXT@ \ - teststr@EXEEXT@ + teststr@EXEEXT@ \ + testuser@EXEEXT@ TARGETS = $(PROGRAMS) @@ -133,4 +134,7 @@ teststr@EXEEXT@: teststr.lo $(LOCAL_LIBS) testsockets@EXEEXT@: testsockets.lo $(LOCAL_LIBS) $(LINK) testsockets.lo $(LOCAL_LIBS) $(ALL_LIBS) +testuser@EXEEXT@: testuser.lo $(LOCAL_LIBS) + $(LINK) testuser.lo $(LOCAL_LIBS) $(ALL_LIBS) + # DO NOT REMOVE diff --git a/test/testuser.c b/test/testuser.c new file mode 100644 index 00000000000..4de8ff9ed5a --- /dev/null +++ b/test/testuser.c @@ -0,0 +1,127 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include +#include + +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_user.h" + +#if !APR_HAS_USER +int main(void) +{ + fprintf(stderr, + "This program won't work on this platform because !APR_HAS_USER.\n"); + return 0; +} +#else +int main(int argc, char *argv[]) +{ + apr_pool_t *p; + apr_status_t rv; + char msgbuf[80]; + const char *username; + char *homedir; + apr_uid_t userid; + apr_gid_t groupid; + + if (argc != 2) { + fprintf(stderr, + "usage: %s username\n", + argv[0]); + exit(-1); + } + + username = argv[1]; + + if (apr_initialize() != APR_SUCCESS) { + fprintf(stderr, "Something went wrong\n"); + exit(-1); + } + atexit(apr_terminate); + + if (apr_pool_create(&p, NULL) != APR_SUCCESS) { + fprintf(stderr, "Something went wrong\n"); + exit(-1); + } + + rv = apr_get_home_directory(&homedir, username, p); + if (rv != APR_SUCCESS) { + fprintf(stderr, "apr_get_home_directory(,%s,) failed: %s\n", + username, + apr_strerror(rv, msgbuf, sizeof(msgbuf))); + exit(-1); + } + else { + printf("home directory for %s: `%s'\n", + username, homedir); + } + + rv = apr_get_userid(&userid, &groupid, username, p); + if (rv != APR_SUCCESS) { + fprintf(stderr, "apr_get_userid(,,%s,) failed: %s\n", + username, + apr_strerror(rv, msgbuf, sizeof(msgbuf))); + exit(-1); + } + else { + printf("user/group ids for %s: %d/%d\n", + username, + (int)userid, (int)groupid); + } + + return 1; +} +#endif /* APR_HAS_USER */ From 5afdee0a3ee8d703ec053ee2610ac70ec09c9815 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 20 Jul 2001 13:35:27 +0000 Subject: [PATCH 1979/7878] getpwnam_safe() must be provided with the struct passwd and char buffer to provide to getpwnam_r()... otherwise, the struct passwd and the data pointed to by it (e.g., pw_name) are no longer valid storage when getpwnam_safe() returns git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61973 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++- user/unix/userinfo.c | 44 ++++++++++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/CHANGES b/CHANGES index d14348227d5..e5ff1524978 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ Changes with APR b1 - *) Use getpwnam_r() and getgrgid_r() instead of getpwnam() and getgrgid() + *) Fix a possible data corruption problem with the use of getpwnam_r() on + all platforms where that function is used. + Use getpwnam_r() and getgrgid_r() instead of getpwnam() and getgrgid() with threaded builds on glibc (2.1, at least) to avoid thread safety issues. [Jeff Trawick] diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 5aae6e8ee35..154164aab85 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -66,17 +66,22 @@ #include /* for _POSIX_THREAD_SAFE_FUNCTIONS */ #endif +#define PWBUF_SIZE 512 + static apr_status_t getpwnam_safe(const char *username, - struct passwd **pw) + struct passwd *pw, + char pwbuf[PWBUF_SIZE]) { + struct passwd *pwptr; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) - struct passwd pwd; - char pwbuf[512]; - - if (getpwnam_r(username, &pwd, pwbuf, sizeof(pwbuf), pw)) { + if (!getpwnam_r(username, pw, pwbuf, PWBUF_SIZE, &pwptr)) { + /* nothing extra to do on success */ #else - if ((*pw = getpwnam(username)) == NULL) { + if ((pwptr = getpwnam(username)) != NULL) { + memcpy(pw, pwptr, sizeof *pw); #endif + } + else { if (errno == 0) { /* this can happen with getpwnam() on FreeBSD 4.3 */ return APR_EGENERAL; @@ -90,17 +95,18 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *username, apr_pool_t *p) { - struct passwd *pw; + struct passwd pw; + char pwbuf[PWBUF_SIZE]; apr_status_t rv; - if ((rv = getpwnam_safe(username, &pw)) != APR_SUCCESS) + if ((rv = getpwnam_safe(username, &pw, pwbuf)) != APR_SUCCESS) return rv; #ifdef OS2 /* Need to manually add user name for OS/2 */ - *dirname = apr_pstrcat(p, pw->pw_dir, pw->pw_name, NULL); + *dirname = apr_pstrcat(p, pw.pw_dir, pw.pw_name, NULL); #else - *dirname = apr_pstrdup(p, pw->pw_dir); + *dirname = apr_pstrdup(p, pw.pw_dir); #endif return APR_SUCCESS; } @@ -108,14 +114,15 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, const char *username, apr_pool_t *p) { - struct passwd *pw; + struct passwd pw; + char pwbuf[PWBUF_SIZE]; apr_status_t rv; - if ((rv = getpwnam_safe(username, &pw)) != APR_SUCCESS) + if ((rv = getpwnam_safe(username, &pw, pwbuf)) != APR_SUCCESS) return rv; - *uid = pw->pw_uid; - *gid = pw->pw_gid; + *uid = pw.pw_uid; + *gid = pw.pw_gid; return APR_SUCCESS; } @@ -125,7 +132,7 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap struct passwd *pw; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWUID_R) struct passwd pwd; - char pwbuf[512]; + char pwbuf[PWBUF_SIZE]; if (getpwuid_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw)) { #else @@ -140,16 +147,17 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap APR_DECLARE(apr_status_t) apr_get_user_passwd(char **passwd, const char *username, apr_pool_t *p) { - struct passwd *pw; + struct passwd pw; + char pwbuf[PWBUF_SIZE]; apr_status_t rv; - if ((rv = getpwnam_safe(username, &pw)) != APR_SUCCESS) + if ((rv = getpwnam_safe(username, &pw, pwbuf)) != APR_SUCCESS) return rv; #if defined(__MVS__) /* silly hack, but this function will be replaced soon anyway */ *passwd = "x"; /* same as many Linux (and Solaris and more) boxes these days */ #else - *passwd = apr_pstrdup(p, pw->pw_passwd); + *passwd = apr_pstrdup(p, pw.pw_passwd); #endif return APR_SUCCESS; From 42a2c1f9943973abd6174116b83a5cbd050f04f2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 20 Jul 2001 20:00:50 +0000 Subject: [PATCH 1980/7878] Update for latest structure changes for 2.0.21 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61974 13f79535-47bb-0310-9956-ffa450edef68 --- apr.mak | 80 +++++++++++++++++++++++++++++++++++++++++------------ libapr.mak | 81 ++++++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 127 insertions(+), 34 deletions(-) diff --git a/apr.mak b/apr.mak index 75231dae8d9..0fade9cf5b0 100644 --- a/apr.mak +++ b/apr.mak @@ -52,7 +52,6 @@ CLEAN : -@erase "$(INTDIR)\apr_hash.obj" -@erase "$(INTDIR)\apr_md5.obj" -@erase "$(INTDIR)\apr_pools.obj" - -@erase "$(INTDIR)\apr_signal.obj" -@erase "$(INTDIR)\apr_sms.obj" -@erase "$(INTDIR)\apr_sms_blocks.obj" -@erase "$(INTDIR)\apr_sms_std.obj" @@ -160,7 +159,6 @@ LIB32_OBJS= \ "$(INTDIR)\apr_hash.obj" \ "$(INTDIR)\apr_md5.obj" \ "$(INTDIR)\apr_pools.obj" \ - "$(INTDIR)\apr_signal.obj" \ "$(INTDIR)\apr_sms.obj" \ "$(INTDIR)\apr_sms_blocks.obj" \ "$(INTDIR)\apr_sms_std.obj" \ @@ -244,7 +242,6 @@ CLEAN : -@erase "$(INTDIR)\apr_hash.obj" -@erase "$(INTDIR)\apr_md5.obj" -@erase "$(INTDIR)\apr_pools.obj" - -@erase "$(INTDIR)\apr_signal.obj" -@erase "$(INTDIR)\apr_sms.obj" -@erase "$(INTDIR)\apr_sms_blocks.obj" -@erase "$(INTDIR)\apr_sms_std.obj" @@ -352,7 +349,6 @@ LIB32_OBJS= \ "$(INTDIR)\apr_hash.obj" \ "$(INTDIR)\apr_md5.obj" \ "$(INTDIR)\apr_pools.obj" \ - "$(INTDIR)\apr_signal.obj" \ "$(INTDIR)\apr_sms.obj" \ "$(INTDIR)\apr_sms_blocks.obj" \ "$(INTDIR)\apr_sms_std.obj" \ @@ -419,6 +415,7 @@ DEP_CPP_ACCES=\ ".\include\apr_general.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_time.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ @@ -437,6 +434,7 @@ DEP_CPP_TIME_=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -462,6 +460,7 @@ DEP_CPP_TIMES=\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -486,6 +485,7 @@ DEP_CPP_APR_C=\ ".\include\apr_errno.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\arch\win32\apr_private.h"\ @@ -515,9 +515,11 @@ DEP_CPP_APR_S=\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -537,6 +539,7 @@ DEP_CPP_APR_ST=\ ".\include\apr_general.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\arch\win32\apr_private.h"\ @@ -552,6 +555,7 @@ DEP_CPP_APR_STR=\ ".\include\apr_errno.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ @@ -565,6 +569,7 @@ DEP_CPP_APR_STRT=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_want.h"\ @@ -580,6 +585,7 @@ DEP_CPP_APR_G=\ ".\include\apr_errno.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\arch\win32\apr_private.h"\ @@ -596,6 +602,7 @@ DEP_CPP_APR_M=\ ".\include\apr_lib.h"\ ".\include\apr_md5.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_xlate.h"\ ".\include\arch\win32\apr_private.h"\ @@ -613,6 +620,7 @@ DEP_CPP_APR_H=\ ".\include\apr_general.h"\ ".\include\apr_hash.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\arch\win32\apr_private.h"\ @@ -628,6 +636,7 @@ DEP_CPP_APR_T=\ ".\include\apr_general.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\arch\win32\apr_private.h"\ @@ -647,6 +656,7 @@ DEP_CPP_ERROR=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -676,6 +686,7 @@ DEP_CPP_GETOP=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -716,6 +727,7 @@ DEP_CPP_MISC_=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -740,8 +752,10 @@ DEP_CPP_NAMES=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -763,6 +777,7 @@ DEP_CPP_OTHER=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -792,6 +807,7 @@ DEP_CPP_RAND_=\ ".\include\apr_errno.h"\ ".\include\apr_general.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\arch\win32\apr_private.h"\ @@ -808,6 +824,7 @@ DEP_CPP_START=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -849,6 +866,7 @@ DEP_CPP_DIR_C=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -881,6 +899,7 @@ DEP_CPP_FILEA=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -913,6 +932,7 @@ DEP_CPP_FILED=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -926,6 +946,7 @@ DEP_CPP_FILED=\ ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\inherit.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ @@ -945,6 +966,7 @@ DEP_CPP_FILEP=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -977,6 +999,7 @@ DEP_CPP_FILES=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1010,6 +1033,7 @@ DEP_CPP_FLOCK=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1038,7 +1062,9 @@ DEP_CPP_FULLR=\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ @@ -1058,6 +1084,7 @@ DEP_CPP_OPEN_=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1089,6 +1116,7 @@ DEP_CPP_PIPE_=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1120,6 +1148,7 @@ DEP_CPP_READW=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -1154,6 +1183,7 @@ DEP_CPP_SEEK_=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1183,6 +1213,7 @@ DEP_CPP_LOCKS=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1209,8 +1240,10 @@ DEP_CPP_INET_=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -1231,8 +1264,10 @@ DEP_CPP_INET_P=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ @@ -1252,9 +1287,11 @@ DEP_CPP_POLL_=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ @@ -1275,6 +1312,7 @@ DEP_CPP_SENDR=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -1306,9 +1344,11 @@ DEP_CPP_SOCKA=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -1330,6 +1370,7 @@ DEP_CPP_SOCKE=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -1355,8 +1396,10 @@ DEP_CPP_SOCKO=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -1378,6 +1421,7 @@ DEP_CPP_PROC_=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1410,6 +1454,7 @@ DEP_CPP_SIGNA=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1441,6 +1486,7 @@ DEP_CPP_THREA=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -1468,6 +1514,7 @@ DEP_CPP_THREAD=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -1496,6 +1543,7 @@ DEP_CPP_DSO_C=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1519,24 +1567,12 @@ DEP_CPP_DSO_C=\ $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\lib\apr_signal.c -DEP_CPP_APR_SI=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_lib.h"\ - ".\include\arch\win32\apr_private.h"\ - - -"$(INTDIR)\apr_signal.obj" : $(SOURCE) $(DEP_CPP_APR_SI) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - SOURCE=.\i18n\unix\utf8_ucs2.c DEP_CPP_UTF8_=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ @@ -1554,8 +1590,10 @@ DEP_CPP_COMMO=\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_mmap.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ @@ -1576,6 +1614,7 @@ DEP_CPP_MMAP_=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_mmap.h"\ ".\include\apr_network_io.h"\ @@ -1605,6 +1644,7 @@ DEP_CPP_GROUP=\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1632,6 +1672,7 @@ DEP_CPP_USERI=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1664,6 +1705,7 @@ DEP_CPP_APR_P=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_hash.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -1692,6 +1734,7 @@ DEP_CPP_APR_SM=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_hash.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1718,6 +1761,7 @@ DEP_CPP_APR_SMS=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1744,6 +1788,7 @@ DEP_CPP_APR_SMS_=\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1770,6 +1815,7 @@ DEP_CPP_APR_SMS_T=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ diff --git a/libapr.mak b/libapr.mak index b8a6fdc5877..4ef6c31c49f 100644 --- a/libapr.mak +++ b/libapr.mak @@ -52,7 +52,6 @@ CLEAN : -@erase "$(INTDIR)\apr_hash.obj" -@erase "$(INTDIR)\apr_md5.obj" -@erase "$(INTDIR)\apr_pools.obj" - -@erase "$(INTDIR)\apr_signal.obj" -@erase "$(INTDIR)\apr_sms.obj" -@erase "$(INTDIR)\apr_sms_blocks.obj" -@erase "$(INTDIR)\apr_sms_std.obj" @@ -169,7 +168,6 @@ LINK32_OBJS= \ "$(INTDIR)\apr_hash.obj" \ "$(INTDIR)\apr_md5.obj" \ "$(INTDIR)\apr_pools.obj" \ - "$(INTDIR)\apr_signal.obj" \ "$(INTDIR)\apr_sms.obj" \ "$(INTDIR)\apr_sms_blocks.obj" \ "$(INTDIR)\apr_sms_std.obj" \ @@ -254,7 +252,6 @@ CLEAN : -@erase "$(INTDIR)\apr_hash.obj" -@erase "$(INTDIR)\apr_md5.obj" -@erase "$(INTDIR)\apr_pools.obj" - -@erase "$(INTDIR)\apr_signal.obj" -@erase "$(INTDIR)\apr_sms.obj" -@erase "$(INTDIR)\apr_sms_blocks.obj" -@erase "$(INTDIR)\apr_sms_std.obj" @@ -372,7 +369,6 @@ LINK32_OBJS= \ "$(INTDIR)\apr_hash.obj" \ "$(INTDIR)\apr_md5.obj" \ "$(INTDIR)\apr_pools.obj" \ - "$(INTDIR)\apr_signal.obj" \ "$(INTDIR)\apr_sms.obj" \ "$(INTDIR)\apr_sms_blocks.obj" \ "$(INTDIR)\apr_sms_std.obj" \ @@ -440,6 +436,7 @@ DEP_CPP_ACCES=\ ".\include\apr_general.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_time.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ @@ -458,6 +455,7 @@ DEP_CPP_TIME_=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -483,6 +481,7 @@ DEP_CPP_TIMES=\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -507,6 +506,7 @@ DEP_CPP_APR_C=\ ".\include\apr_errno.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\arch\win32\apr_private.h"\ @@ -536,9 +536,11 @@ DEP_CPP_APR_S=\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -558,6 +560,7 @@ DEP_CPP_APR_ST=\ ".\include\apr_general.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\arch\win32\apr_private.h"\ @@ -573,6 +576,7 @@ DEP_CPP_APR_STR=\ ".\include\apr_errno.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ @@ -586,6 +590,7 @@ DEP_CPP_APR_STRT=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_want.h"\ @@ -601,6 +606,7 @@ DEP_CPP_APR_G=\ ".\include\apr_errno.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\arch\win32\apr_private.h"\ @@ -617,6 +623,7 @@ DEP_CPP_APR_M=\ ".\include\apr_lib.h"\ ".\include\apr_md5.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_xlate.h"\ ".\include\arch\win32\apr_private.h"\ @@ -634,6 +641,7 @@ DEP_CPP_APR_H=\ ".\include\apr_general.h"\ ".\include\apr_hash.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\arch\win32\apr_private.h"\ @@ -649,6 +657,7 @@ DEP_CPP_APR_T=\ ".\include\apr_general.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\arch\win32\apr_private.h"\ @@ -668,6 +677,7 @@ DEP_CPP_ERROR=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -697,6 +707,7 @@ DEP_CPP_GETOP=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -737,6 +748,7 @@ DEP_CPP_MISC_=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -761,8 +773,10 @@ DEP_CPP_NAMES=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -784,6 +798,7 @@ DEP_CPP_OTHER=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -813,6 +828,7 @@ DEP_CPP_RAND_=\ ".\include\apr_errno.h"\ ".\include\apr_general.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\arch\win32\apr_private.h"\ @@ -829,6 +845,7 @@ DEP_CPP_START=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -870,6 +887,7 @@ DEP_CPP_DIR_C=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -902,6 +920,7 @@ DEP_CPP_FILEA=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -934,6 +953,7 @@ DEP_CPP_FILED=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -947,6 +967,7 @@ DEP_CPP_FILED=\ ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\inherit.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ @@ -966,6 +987,7 @@ DEP_CPP_FILEP=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -998,6 +1020,7 @@ DEP_CPP_FILES=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1031,6 +1054,7 @@ DEP_CPP_FLOCK=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1059,7 +1083,9 @@ DEP_CPP_FULLR=\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ @@ -1079,6 +1105,7 @@ DEP_CPP_OPEN_=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1110,6 +1137,7 @@ DEP_CPP_PIPE_=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1141,6 +1169,7 @@ DEP_CPP_READW=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -1175,6 +1204,7 @@ DEP_CPP_SEEK_=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1204,6 +1234,7 @@ DEP_CPP_LOCKS=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1230,8 +1261,10 @@ DEP_CPP_INET_=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -1252,8 +1285,10 @@ DEP_CPP_INET_P=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ @@ -1273,9 +1308,11 @@ DEP_CPP_POLL_=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ @@ -1296,6 +1333,7 @@ DEP_CPP_SENDR=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -1327,9 +1365,11 @@ DEP_CPP_SOCKA=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -1351,6 +1391,7 @@ DEP_CPP_SOCKE=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -1376,8 +1417,10 @@ DEP_CPP_SOCKO=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ @@ -1399,6 +1442,7 @@ DEP_CPP_PROC_=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1431,6 +1475,7 @@ DEP_CPP_SIGNA=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1462,6 +1507,7 @@ DEP_CPP_THREA=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -1489,6 +1535,7 @@ DEP_CPP_THREAD=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -1517,6 +1564,7 @@ DEP_CPP_DSO_C=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1540,24 +1588,12 @@ DEP_CPP_DSO_C=\ $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\lib\apr_signal.c -DEP_CPP_APR_SI=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_lib.h"\ - ".\include\arch\win32\apr_private.h"\ - - -"$(INTDIR)\apr_signal.obj" : $(SOURCE) $(DEP_CPP_APR_SI) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - SOURCE=.\i18n\unix\utf8_ucs2.c DEP_CPP_UTF8_=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_xlate.h"\ ".\include\arch\unix\i18n.h"\ @@ -1575,8 +1611,10 @@ DEP_CPP_COMMO=\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_mmap.h"\ ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ @@ -1597,6 +1635,7 @@ DEP_CPP_MMAP_=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_mmap.h"\ ".\include\apr_network_io.h"\ @@ -1626,6 +1665,7 @@ DEP_CPP_GROUP=\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1653,6 +1693,7 @@ DEP_CPP_USERI=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1685,6 +1726,7 @@ DEP_CPP_APR_P=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_hash.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ @@ -1713,6 +1755,7 @@ DEP_CPP_APR_SM=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_hash.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1739,6 +1782,7 @@ DEP_CPP_APR_SMS=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1765,6 +1809,7 @@ DEP_CPP_APR_SMS_=\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1791,6 +1836,7 @@ DEP_CPP_APR_SMS_T=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ @@ -1818,6 +1864,7 @@ DEP_CPP_APR_SMS_TR=\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ From e8d717a85fa1b2c2291e69cefa11bef5bb01c287 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 21 Jul 2001 06:41:09 +0000 Subject: [PATCH 1981/7878] Add thread-safe resolver - with a high thread count, we can run into problems using a non-thread safe resolver function. We'll attempt to use gethostbyname_r if: APR_HAS_THREADS is defined, libc_r doesn't have gethostbyname (BSD), and gethostbyname_r even exists. I've tested this on Solaris 7. Ian Holsman has reported success on Solaris 8 (I wonder if he didn't have IPv6 support turned on - that would cause it to use the non-getaddrinfo() code path). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61976 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 1 + configure.in | 3 +++ network_io/unix/sa_common.c | 26 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/acconfig.h b/acconfig.h index f9318b233c5..e63bac496bb 100644 --- a/acconfig.h +++ b/acconfig.h @@ -23,6 +23,7 @@ #undef USE_PTHREAD_SERIALIZE #undef READDIR_IS_THREAD_SAFE +#undef GETHOSTBYNAME_IS_THREAD_SAFE #undef NEED_RLIM_T #undef USEBCOPY diff --git a/configure.in b/configure.in index 513ac49af52..c089f423b4a 100644 --- a/configure.in +++ b/configure.in @@ -326,9 +326,12 @@ else fi ac_cv_define_READDIR_IS_THREAD_SAFE=no +ac_cv_define_GETHOSTBYNAME_IS_THREAD_SAFE=no if test "$threads" = "1"; then echo "APR will use threads" AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE)) + AC_CHECK_LIB(c_r, gethostbyname, AC_DEFINE(GETHOSTBYNAME_IS_THREAD_SAFE)) + AC_CHECK_FUNCS(gethostbyname_r) else echo "APR will be non-threaded" fi diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 5e1a7e329d4..50fd269710c 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -77,6 +77,15 @@ #define SET_H_ERRNO(newval) h_errno = (newval) #endif +#if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ + defined(HAVE_GETHOSTBYNAME_R) +/* This is the maximum size that may be returned from the reentrant + * gethostbyname_r function. If the system tries to use more, it + * should return ERANGE. + */ +#define GETHOSTBYNAME_BUFLEN 512 +#endif + APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, apr_port_t port) { @@ -380,6 +389,12 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, struct hostent *hp; apr_sockaddr_t *cursa; int curaddr; +#if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ + defined(HAVE_GETHOSTBYNAME_R) + char tmp[GETHOSTBYNAME_BUFLEN]; + int hosterror; + struct hostent hs; +#endif if (family == APR_UNSPEC) { family = APR_INET; /* we don't support IPv6 here */ @@ -395,11 +410,22 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, } else { #endif +#if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ + defined(HAVE_GETHOSTBYNAME_R) + hp = gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, + &hosterror); +#else hp = gethostbyname(hostname); +#endif if (!hp) { #ifdef WIN32 apr_get_netos_error(); +#elif APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ + defined(HAVE_GETHOSTBYNAME_R) + /* If you see ERANGE, that means GETHOSBYNAME_BUFLEN needs to be + * bumped. */ + return (hosterror + APR_OS_START_SYSERR); #else return (h_errno + APR_OS_START_SYSERR); #endif From da76c6a4c1f4a4d444501ca56c902e6b7e89658d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 21 Jul 2001 11:14:56 +0000 Subject: [PATCH 1982/7878] yank apr_get_user_passwd() This function doesn't work on many/most current Unix boxes (think "shadow") and the concept is not portable to many other platforms either. You just can't count on retrieving the password for a user, and even when you can you can't count on the encryption method (if any). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61977 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_user.h | 10 ---------- user/unix/userinfo.c | 18 ------------------ 2 files changed, 28 deletions(-) diff --git a/include/apr_user.h b/include/apr_user.h index 542f17625f5..3c70da037ad 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -161,16 +161,6 @@ APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right); #define apr_compare_groups(left,right) ((left == right) ? APR_SUCCESS : APR_EMISMATCH) #endif -/** - * Get a password from the system, given a username. - * @param passwd The returned password - * @param username The username to get the password for - * @param p The pool to allocate out of. - * @deffunc apr_status_t apr_get_user_passwd(char **passwd, const char *username, apr_pool_t *p); - */ -APR_DECLARE(apr_status_t) apr_get_user_passwd(char **passwd, - const char *username, apr_pool_t *p); - #endif /* ! APR_HAS_USER */ #ifdef __cplusplus diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 154164aab85..4dade21a034 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -144,22 +144,4 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_user_passwd(char **passwd, - const char *username, apr_pool_t *p) -{ - struct passwd pw; - char pwbuf[PWBUF_SIZE]; - apr_status_t rv; - - if ((rv = getpwnam_safe(username, &pw, pwbuf)) != APR_SUCCESS) - return rv; - -#if defined(__MVS__) /* silly hack, but this function will be replaced soon anyway */ - *passwd = "x"; /* same as many Linux (and Solaris and more) boxes these days */ -#else - *passwd = apr_pstrdup(p, pw.pw_passwd); -#endif - - return APR_SUCCESS; -} From 238b4e89df0161ec3724bc345731e90c44a04245 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 21 Jul 2001 16:40:31 +0000 Subject: [PATCH 1983/7878] Make sure that mkdep.sh knows which compiler we are supposed to use. Otherwise, it defaults to cc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61978 13f79535-47bb-0310-9956-ffa450edef68 --- build/rules.mk.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/rules.mk.in b/build/rules.mk.in index 020e7ef50c6..9786d8709f2 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -195,7 +195,7 @@ local-all: $(TARGETS) local-depend: x-local-depend @if test -n "`ls *.c 2> /dev/null`"; then \ echo $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c ; \ - $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c ; \ + CC=${CC} $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c ; \ fi # to be filled in by the actual Makefile From d403794d94d780199ad8ff228b013b2a00757246 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 22 Jul 2001 14:40:22 +0000 Subject: [PATCH 1984/7878] Couple of pieces of tidying up... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61979 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + test/Makefile.in | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/.cvsignore b/test/.cvsignore index 7b0bf706de6..b6f2b65ff57 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -43,3 +43,4 @@ testlock *.core testsockets testuser +test.fil diff --git a/test/Makefile.in b/test/Makefile.in index e214534a3e5..99e46177a83 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -27,7 +27,8 @@ PROGRAMS = \ testhash@EXEEXT@ \ occhild@EXEEXT@ \ teststr@EXEEXT@ \ - testuser@EXEEXT@ + testuser@EXEEXT@ \ + testsockets@EXEEXT@ TARGETS = $(PROGRAMS) From 610e3b5886dbc254efc9522770fefbda5babcdbd Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 23 Jul 2001 03:28:30 +0000 Subject: [PATCH 1985/7878] Close file descriptor when we are done with fcntl or flock-based cross-process locks. Otherwise, we leak descriptors. This bug rears its ugly head when the SMS locking actually works (more on that soon). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61980 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ locks/unix/crossproc.c | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index e5ff1524978..f2f04750b3d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Close file descriptor when we are done with fcntl or flock-based + cross-process lock. Otherwise, we leak descriptors. + [Justin Erenkrantz] + *) Fix a possible data corruption problem with the use of getpwnam_r() on all platforms where that function is used. Use getpwnam_r() and getgrgid_r() instead of getpwnam() and getgrgid() diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 67f098ca97a..f48e84b3fb8 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -358,11 +358,16 @@ static void fcntl_setup(void) static apr_status_t fcntl_cleanup(void *lock_) { + apr_status_t status; apr_lock_t *lock=lock_; if (lock->curr_locked == 1) { - return fcntl_release(lock); + status = fcntl_release(lock); + if (status != APR_SUCCESS) + return status; } + close(lock->interproc); + return APR_SUCCESS; } @@ -462,11 +467,15 @@ static void flock_setup(void) static apr_status_t flock_cleanup(void *lock_) { + apr_status_t status; apr_lock_t *lock=lock_; if (lock->curr_locked == 1) { - return flock_release(lock); + status = flock_release(lock); + if (status != APR_SUCCESS) + return status; } + close(lock->interproc); unlink(lock->fname); return APR_SUCCESS; } From 12b9cb85c522600e015a1b7a98d6ae1720ca1671 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 23 Jul 2001 07:13:53 +0000 Subject: [PATCH 1986/7878] Fix compilation error when on non-IPv6 platforms git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61981 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsockets.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testsockets.c b/test/testsockets.c index 8fc74b9374d..2573da85ec5 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -91,7 +91,11 @@ int main(void) char recvbuf[80]; char *ip_addr; apr_port_t fromport; +#if APR_HAVE_IPV6 int family = APR_INET6; +#else + int family = APR_INET; +#endif STD_TEST_NEQ("Initializing APR", apr_initialize()) From ddc641e30061ed618065af7bde05a52da679dd4f Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 23 Jul 2001 07:31:07 +0000 Subject: [PATCH 1987/7878] Fix compiler warning git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61982 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 3b9ee73595e..10156ce62a9 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -260,4 +260,4 @@ APR_IMPLEMENT_SET_INHERIT(file, flags, cntxt, apr_unix_file_cleanup) APR_IMPLEMENT_UNSET_INHERIT(file, flags, cntxt, apr_unix_file_cleanup) -APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); +APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt) From 51e915a418e32ce3b2ed7fc915c58f6c62f1a9ac Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 23 Jul 2001 12:30:52 +0000 Subject: [PATCH 1988/7878] BeOS can have some very nice and useful memory checking routines, they're built in to newer kernels and can be switched on a simple export on the command line, but to make use we need to build with some extra flags. this patch basically adds those flags when we're using beos and have enabled their usage. AFAIK these are beos specific so that's why they're protected. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61983 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.in b/configure.in index c089f423b4a..364d8bbe661 100644 --- a/configure.in +++ b/configure.in @@ -158,6 +158,12 @@ AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build fi )dnl +if test "$host" = "i586-pc-beos"; then + AC_ARG_ENABLE(malloc-debug,[ --enable-malloc-debug Switch on malloc_debug for BeOS], + APR_ADDTO(CPPFLAGS, -fcheck-memory-usage -D_KERNEL_MODE) + ) dnl +fi + POOLS_TARGET=apr_pools.lo AC_ARG_ENABLE(sms, [ --enable-sms Build APR to use sms emulating pools], echo "************* WARNING ***************" From bbc778c8a94049db09f6b6f2fec549eedbf974a1 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 23 Jul 2001 16:05:00 +0000 Subject: [PATCH 1989/7878] Enable getaddrinfo even if we don't have IPv6. We're not aware of any platforms that have getaddrinfo and not IPv6, but we think this code could work with IPv4-only platforms anyway. Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61984 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 50fd269710c..287e2cbb56a 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -300,7 +300,7 @@ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, return APR_SUCCESS; } -#if defined(HAVE_GETADDRINFO) && APR_HAVE_IPV6 +#if defined(HAVE_GETADDRINFO) static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa, struct addrinfo *ai, apr_port_t port) { @@ -333,7 +333,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, return APR_ENOMEM; (*sa)->hostname = apr_pstrdup(p, hostname); -#if defined(HAVE_GETADDRINFO) && APR_HAVE_IPV6 +#if defined(HAVE_GETADDRINFO) if (hostname != NULL) { struct addrinfo hints, *ai; apr_sockaddr_t *cursa; From fba87c6e0b263df2a1bc02795cddeed52795f8b6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 23 Jul 2001 17:47:27 +0000 Subject: [PATCH 1990/7878] leave apr_file_t->fname NULL for a pipe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61985 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/pipe.c | 4 ++-- file_io/win32/pipe.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index c9b543f55c8..7a99b4e3cbd 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -166,7 +166,7 @@ apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t (*in)->cntxt = cont; (*in)->filedes = filedes[0]; (*in)->pipe = 1; - (*in)->fname = apr_pstrdup(cont, "PIPE"); + (*in)->fname = NULL; (*in)->buffered = 0; (*in)->blocking = BLK_ON; (*in)->timeout = -1; @@ -179,7 +179,7 @@ apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t (*out)->cntxt = cont; (*out)->filedes = filedes[1]; (*out)->pipe = 1; - (*out)->fname = apr_pstrdup(cont, "PIPE"); + (*out)->fname = NULL; (*out)->buffered = 0; (*out)->blocking = BLK_ON; (*out)->timeout = -1; diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 8f5d296d99a..a26b107eaf0 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -91,7 +91,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*in)->cntxt = p; - (*in)->fname = "\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */ + (*in)->fname = NULL; (*in)->pipe = 1; (*in)->timeout = -1; (*in)->ungetchar = -1; @@ -103,7 +103,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*out)->cntxt = p; - (*in)->fname = "\0"; // What was this??? : apr_pstrdup(p, "PIPE"); */ + (*in)->fname = NULL; (*out)->pipe = 1; (*out)->timeout = -1; (*out)->ungetchar = -1; @@ -161,7 +161,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*in)->cntxt = p; - (*in)->fname = ""; // What was this??? : apr_pstrdup(p, "PIPE"); */ + (*in)->fname = NULL; (*in)->pipe = 1; (*in)->timeout = -1; (*in)->ungetchar = -1; @@ -174,7 +174,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*out)->cntxt = p; - (*out)->fname = ""; // What was this??? : apr_pstrdup(p, "PIPE"); */ + (*out)->fname = NULL; (*out)->pipe = 1; (*out)->timeout = -1; (*out)->ungetchar = -1; From 43c38c7df488e389c09167c71cd33e5826fe685f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 23 Jul 2001 17:58:08 +0000 Subject: [PATCH 1991/7878] copy over the pipe timeout when creating a socket from a pipe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61986 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/poll.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index cfc5d44f751..2bc753ddf07 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -404,6 +404,7 @@ apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file) (*newsock) = apr_pcalloc(file->cntxt, sizeof(**newsock)); (*newsock)->socketdes = file->filedes; (*newsock)->cntxt = file->cntxt; + (*newsock)->timeout = file->timeout; return APR_SUCCESS; } #endif From 0a80fc82cf0f32dc02742a4a7277af54c54fe908 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 23 Jul 2001 20:47:31 +0000 Subject: [PATCH 1992/7878] Ensure that our parent knows to be thread-safe before we continue Switch to INTRAPROCESS lock - when we fork(), our shared memory doesn't matter anymore Create the lock from our parent's memory space - not our own as it may disappear while we still need the lock git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61987 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms.c | 57 +++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 87d2c0bac99..2d956ea773a 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -319,8 +319,7 @@ APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms) rv = APR_SUCCESS; #if APR_HAS_THREADS - if (sms->thread_register_fn) - rv = sms->thread_register_fn(sms, apr_os_thread_current()); + apr_sms_thread_register(sms, apr_os_thread_current()); #endif /* APR_HAS_THREADS */ #if APR_DEBUG_SHOW_FUNCTIONS @@ -612,7 +611,11 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms) sms->pre_destroy_fn(sms); if (sms->sms_lock) + { apr_lock_destroy(sms->sms_lock); + if (pms->free_fn) + return apr_sms_free(sms->parent, sms->sms_lock); + } #ifndef APR_POOLS_ARE_SMS /* XXX - This should eventually be removed */ @@ -856,38 +859,44 @@ APR_DECLARE(apr_status_t) apr_sms_thread_register(apr_sms_t *sms, apr_os_thread_t thread) { apr_status_t rv; - - do { + + /* Before attempting to acquire a lock for us, we must ensure that our + * parent is lock-safe. + */ + if (sms->parent) + { + apr_sms_thread_register(sms->parent, thread); + if (!sms->sms_lock) { /* Create the sms framework lock we'll use. */ - apr_lock_create(&sms->sms_lock, APR_MUTEX, APR_LOCKALL, - NULL, sms->pool); + apr_lock_create(&sms->sms_lock, APR_MUTEX, APR_INTRAPROCESS, + NULL, sms->parent->pool); } + } + if (sms->sms_lock) apr_lock_acquire(sms->sms_lock); - sms->threads++; + sms->threads++; - /* let the sms know about the thread if it is - * interested (so it can protect its private - * data with its own lock) - * - * if the sms is doesn't have a thread register - * function, or it wasn't able to register the - * thread, we should bomb out! - * XXX - not sure how to implement the bombing out - */ - rv = APR_ENOTIMPL; - if (sms->thread_register_fn) - rv = sms->thread_register_fn(sms, thread); + /* let the sms know about the thread if it is + * interested (so it can protect its private + * data with its own lock) + * + * if the sms is doesn't have a thread register + * function, or it wasn't able to register the + * thread, we should bomb out! + * XXX - not sure how to implement the bombing out + */ + rv = APR_ENOTIMPL; + if (sms->thread_register_fn) + rv = sms->thread_register_fn(sms, thread); + if (sms->sms_lock) apr_lock_release(sms->sms_lock); - if (rv != APR_SUCCESS) - return rv; - - sms = sms->parent; - } while (sms); + if (rv != APR_SUCCESS) + return rv; return APR_SUCCESS; } From 103424738e2dccd2d44ba21fcab520e9d593e9a1 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 23 Jul 2001 20:48:46 +0000 Subject: [PATCH 1993/7878] Remove independent lock. Rely on the lock in the apr_sms_t structure instead. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61988 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_trivial.c | 63 ++++++++++++++--------------------- 1 file changed, 25 insertions(+), 38 deletions(-) diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index 54948bf7c72..b32f6b98da8 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -96,7 +96,6 @@ typedef struct apr_sms_trivial_t apr_size_t min_alloc; apr_size_t min_free; apr_size_t max_free; - apr_lock_t *lock; } apr_sms_trivial_t; #define SIZEOF_BLOCK_T APR_ALIGN_DEFAULT(sizeof(block_t)) @@ -129,8 +128,8 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, /* Round up the size to the next 8 byte boundary */ size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; - if (SMS_TRIVIAL_T(sms)->lock) - apr_lock_acquire(SMS_TRIVIAL_T(sms)->lock); + if (sms->sms_lock) + apr_lock_acquire(sms->sms_lock); node = SMS_TRIVIAL_T(sms)->used_sentinel.prev; @@ -140,8 +139,8 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, node->first_avail += size; node->count++; - if (SMS_TRIVIAL_T(sms)->lock) - apr_lock_release(SMS_TRIVIAL_T(sms)->lock); + if (sms->sms_lock) + apr_lock_release(sms->sms_lock); BLOCK_T(mem)->node = node; mem = (char *)mem + SIZEOF_BLOCK_T; @@ -184,8 +183,8 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, node->first_avail += size; node->count = 1; - if (SMS_TRIVIAL_T(sms)->lock) - apr_lock_release(SMS_TRIVIAL_T(sms)->lock); + if (sms->sms_lock) + apr_lock_release(sms->sms_lock); BLOCK_T(mem)->node = node; mem = (char *)mem + SIZEOF_BLOCK_T; @@ -207,8 +206,8 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, node->first_avail += node->avail_size; node->avail_size = 0; - if (SMS_TRIVIAL_T(sms)->lock) - apr_lock_release(SMS_TRIVIAL_T(sms)->lock); + if (sms->sms_lock) + apr_lock_release(sms->sms_lock); return NULL; } @@ -225,8 +224,8 @@ static void *apr_sms_trivial_malloc(apr_sms_t *sms, node->avail_size = node_size - (node->first_avail - (char *)node); node->count = 1; - if (SMS_TRIVIAL_T(sms)->lock) - apr_lock_release(SMS_TRIVIAL_T(sms)->lock); + if (sms->sms_lock) + apr_lock_release(sms->sms_lock); BLOCK_T(mem)->node = node; mem = (char *)mem + SIZEOF_BLOCK_T; @@ -240,14 +239,14 @@ static apr_status_t apr_sms_trivial_free(apr_sms_t *sms, void *mem) node = BLOCK_T((char *)mem - SIZEOF_BLOCK_T)->node; - if (SMS_TRIVIAL_T(sms)->lock) - apr_lock_acquire(SMS_TRIVIAL_T(sms)->lock); + if (sms->sms_lock) + apr_lock_acquire(sms->sms_lock); node->count--; if (node->count) { - if (SMS_TRIVIAL_T(sms)->lock) - apr_lock_release(SMS_TRIVIAL_T(sms)->lock); + if (sms->sms_lock) + apr_lock_release(sms->sms_lock); return APR_SUCCESS; } @@ -262,8 +261,8 @@ static apr_status_t apr_sms_trivial_free(apr_sms_t *sms, void *mem) if (sms->parent->free_fn && node->avail_size > SMS_TRIVIAL_T(sms)->max_free && node != SMS_TRIVIAL_T(sms)->self) { - if (SMS_TRIVIAL_T(sms)->lock) - apr_lock_release(SMS_TRIVIAL_T(sms)->lock); + if (sms->sms_lock) + apr_lock_release(sms->sms_lock); return apr_sms_free(sms->parent, node); } @@ -278,8 +277,8 @@ static apr_status_t apr_sms_trivial_free(apr_sms_t *sms, void *mem) SMS_TRIVIAL_T(sms)->max_free -= node->avail_size; } - if (SMS_TRIVIAL_T(sms)->lock) - apr_lock_release(SMS_TRIVIAL_T(sms)->lock); + if (sms->sms_lock) + apr_lock_release(sms->sms_lock); return APR_SUCCESS; } @@ -324,8 +323,8 @@ static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) free_list = NULL; - if (SMS_TRIVIAL_T(sms)->lock) - apr_lock_acquire(SMS_TRIVIAL_T(sms)->lock); + if (sms->sms_lock) + apr_lock_acquire(sms->sms_lock); /* Always reset our base node as this can't be reclaimed. */ node = SMS_TRIVIAL_T(sms)->self; @@ -397,8 +396,8 @@ static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) node->next = node->prev = used_sentinel; used_sentinel->next = used_sentinel->prev = node; - if (SMS_TRIVIAL_T(sms)->lock) - apr_lock_release(SMS_TRIVIAL_T(sms)->lock); + if (sms->sms_lock) + apr_lock_release(sms->sms_lock); while ((node = free_list) != NULL) { free_list = node->next; @@ -413,16 +412,9 @@ static apr_status_t apr_sms_trivial_pre_destroy(apr_sms_t *sms) /* This function WILL always be called. However, be aware that the * main sms destroy function knows that it's not wise to try and destroy * the same piece of memory twice, so the destroy function in a child won't - * neccesarily be called. To guarantee we destroy the lock it's therefore - * destroyed here. + * neccesarily be called. */ - - if (SMS_TRIVIAL_T(sms)->lock) { - apr_lock_acquire(SMS_TRIVIAL_T(sms)->lock); - apr_lock_destroy(SMS_TRIVIAL_T(sms)->lock); - SMS_TRIVIAL_T(sms)->lock = NULL; - } - + return APR_SUCCESS; } @@ -456,11 +448,6 @@ static apr_status_t apr_sms_trivial_destroy(apr_sms_t *sms) static apr_status_t apr_sms_trivial_thread_register(apr_sms_t *sms, apr_os_thread_t thread) { - if (!SMS_TRIVIAL_T(sms)->lock && sms->threads > 1) - return apr_lock_create(&SMS_TRIVIAL_T(sms)->lock, - APR_MUTEX, APR_LOCKALL, - NULL, sms->pool); - return APR_SUCCESS; } @@ -483,7 +470,7 @@ APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, apr_status_t rv; *sms = NULL; - + min_alloc = APR_ALIGN_DEFAULT(min_alloc); min_free = APR_ALIGN_DEFAULT(min_free); if (min_free < SIZEOF_NODE_T) From 7c2505ca3e80640c4261739a82bc5d8ac785b2b9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 23 Jul 2001 21:22:06 +0000 Subject: [PATCH 1994/7878] Reorganize these projects just a bit, and sort the sources. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61989 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 223 ++++++++++++++++++++++++++-------------------------- libapr.dsp | 225 +++++++++++++++++++++++++++-------------------------- 2 files changed, 227 insertions(+), 221 deletions(-) diff --git a/apr.dsp b/apr.dsp index e966aa786e2..0cc8dc5aa4b 100644 --- a/apr.dsp +++ b/apr.dsp @@ -84,76 +84,105 @@ LIB32=link.exe -lib # Begin Group "Source Files" # PROP Default_Filter ".c" -# Begin Group "time" +# Begin Group "dso" # PROP Default_Filter "" # Begin Source File -SOURCE=.\time\win32\access.c +SOURCE=.\dso\win32\dso.c # End Source File +# End Group +# Begin Group "file_io" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\arch\win32\atime.h +SOURCE=.\file_io\win32\dir.c # End Source File # Begin Source File -SOURCE=.\time\win32\time.c +SOURCE=.\file_io\unix\fileacc.c # End Source File # Begin Source File -SOURCE=.\time\win32\timestr.c +SOURCE=.\file_io\win32\filedup.c # End Source File -# End Group -# Begin Group "strings" +# Begin Source File -# PROP Default_Filter "" +SOURCE=.\file_io\win32\filepath.c +# End Source File # Begin Source File -SOURCE=.\strings\apr_cpystrn.c +SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File -SOURCE=.\strings\apr_fnmatch.c +SOURCE=.\file_io\win32\flock.c # End Source File # Begin Source File -SOURCE=.\strings\apr_snprintf.c +SOURCE=.\file_io\unix\fullrw.c # End Source File # Begin Source File -SOURCE=.\strings\apr_strings.c +SOURCE=.\file_io\win32\open.c # End Source File # Begin Source File -SOURCE=.\strings\apr_strnatcmp.c +SOURCE=.\file_io\win32\pipe.c # End Source File # Begin Source File -SOURCE=.\strings\apr_strtok.c +SOURCE=.\file_io\win32\readwrite.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\seek.c # End Source File # End Group -# Begin Group "passwd" +# Begin Group "i18n" # PROP Default_Filter "" # Begin Source File -SOURCE=.\passwd\apr_getpass.c +SOURCE=.\i18n\unix\utf8_ucs2.c # End Source File # Begin Source File -SOURCE=.\passwd\apr_md5.c +SOURCE=.\i18n\unix\xlate.c +# PROP Exclude_From_Build 1 # End Source File # End Group -# Begin Group "tables" +# Begin Group "locks" # PROP Default_Filter "" # Begin Source File -SOURCE=.\tables\apr_hash.c +SOURCE=.\locks\win32\locks.c # End Source File +# End Group +# Begin Group "memory" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\tables\apr_tables.c +SOURCE=.\memory\unix\apr_pools.c +# End Source File +# Begin Source File + +SOURCE=.\memory\unix\apr_sms.c +# End Source File +# Begin Source File + +SOURCE=.\memory\unix\apr_sms_blocks.c +# End Source File +# Begin Source File + +SOURCE=.\memory\unix\apr_sms_std.c +# End Source File +# Begin Source File + +SOURCE=.\memory\unix\apr_sms_tracking.c # End Source File # End Group # Begin Group "misc" @@ -177,10 +206,6 @@ SOURCE=.\misc\win32\misc.c # End Source File # Begin Source File -SOURCE=.\include\arch\unix\misc.h -# End Source File -# Begin Source File - SOURCE=.\misc\win32\names.c # End Source File # Begin Source File @@ -200,109 +225,114 @@ SOURCE=.\misc\unix\start.c SOURCE=.\misc\unix\uuid.c # End Source File # End Group -# Begin Group "file_io" +# Begin Group "mmap" # PROP Default_Filter "" # Begin Source File -SOURCE=.\file_io\win32\dir.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\unix\fileacc.c +SOURCE=.\mmap\unix\common.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\filedup.c +SOURCE=.\mmap\win32\mmap.c # End Source File -# Begin Source File +# End Group +# Begin Group "network_io" -SOURCE=.\include\arch\win32\fileio.h -# End Source File +# PROP Default_Filter "" # Begin Source File -SOURCE=.\file_io\win32\filepath.c +SOURCE=.\network_io\unix\inet_ntop.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\filestat.c +SOURCE=.\network_io\unix\inet_pton.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\flock.c +SOURCE=.\network_io\win32\poll.c # End Source File # Begin Source File -SOURCE=.\file_io\unix\fullrw.c +SOURCE=.\network_io\unix\sa_common.c +# PROP Exclude_From_Build 1 # End Source File # Begin Source File -SOURCE=.\file_io\win32\open.c +SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\pipe.c +SOURCE=.\network_io\win32\sockaddr.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\readwrite.c +SOURCE=.\network_io\win32\sockets.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\seek.c +SOURCE=.\network_io\win32\sockopt.c # End Source File # End Group -# Begin Group "locks" +# Begin Group "passwd" # PROP Default_Filter "" # Begin Source File -SOURCE=.\locks\win32\locks.c +SOURCE=.\passwd\apr_getpass.c # End Source File # Begin Source File -SOURCE=.\include\arch\win32\locks.h +SOURCE=.\passwd\apr_md5.c # End Source File # End Group -# Begin Group "network_io" +# Begin Group "shmem" # PROP Default_Filter "" # Begin Source File -SOURCE=.\network_io\unix\inet_ntop.c +SOURCE=.\shmem\win32\shmem.c +# PROP Exclude_From_Build 1 # End Source File +# End Group +# Begin Group "strings" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\network_io\unix\inet_pton.c +SOURCE=.\strings\apr_cpystrn.c # End Source File # Begin Source File -SOURCE=.\include\arch\win32\networkio.h +SOURCE=.\strings\apr_fnmatch.c # End Source File # Begin Source File -SOURCE=.\network_io\win32\poll.c +SOURCE=.\strings\apr_snprintf.c # End Source File # Begin Source File -SOURCE=.\network_io\unix\sa_common.c -# PROP Exclude_From_Build 1 +SOURCE=.\strings\apr_strings.c # End Source File # Begin Source File -SOURCE=.\network_io\win32\sendrecv.c +SOURCE=.\strings\apr_strnatcmp.c # End Source File # Begin Source File -SOURCE=.\network_io\win32\sockaddr.c +SOURCE=.\strings\apr_strtok.c # End Source File +# End Group +# Begin Group "tables" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\network_io\win32\sockets.c +SOURCE=.\tables\apr_hash.c # End Source File # Begin Source File -SOURCE=.\network_io\win32\sockopt.c +SOURCE=.\tables\apr_tables.c # End Source File # End Group # Begin Group "threadproc" @@ -324,108 +354,87 @@ SOURCE=.\threadproc\win32\thread.c SOURCE=.\threadproc\win32\threadpriv.c # End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\threadproc.h -# End Source File # End Group -# Begin Group "dso" +# Begin Group "time" # PROP Default_Filter "" # Begin Source File -SOURCE=.\dso\win32\dso.c +SOURCE=.\time\win32\access.c # End Source File # Begin Source File -SOURCE=.\include\arch\win32\dso.h +SOURCE=.\time\win32\time.c # End Source File -# End Group -# Begin Group "i18n" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\arch\unix\i18n.h +SOURCE=.\time\win32\timestr.c # End Source File +# End Group +# Begin Group "user" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\i18n\unix\utf8_ucs2.c +SOURCE=.\user\win32\groupinfo.c # End Source File # Begin Source File -SOURCE=.\i18n\unix\xlate.c -# PROP Exclude_From_Build 1 +SOURCE=.\user\win32\userinfo.c # End Source File # End Group -# Begin Group "shmem" +# End Group +# Begin Group "Internal Header Files" # PROP Default_Filter "" # Begin Source File -SOURCE=.\shmem\win32\shmem.c -# PROP Exclude_From_Build 1 +SOURCE=.\include\arch\win32\apr_private.h # End Source File -# End Group -# Begin Group "mmap" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\mmap\unix\common.c +SOURCE=.\include\arch\win32\atime.h # End Source File # Begin Source File -SOURCE=.\mmap\win32\mmap.c +SOURCE=.\include\arch\win32\dso.h # End Source File -# End Group -# Begin Group "user" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\user\win32\groupinfo.c +SOURCE=.\include\arch\win32\fileio.h # End Source File # Begin Source File -SOURCE=.\user\win32\userinfo.c +SOURCE=.\include\arch\unix\i18n.h # End Source File -# End Group -# Begin Group "memory" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\memory\unix\apr_pools.c +SOURCE=.\include\arch\unix\inherit.h # End Source File # Begin Source File -SOURCE=.\memory\unix\apr_sms.c +SOURCE=.\include\arch\win32\locks.h # End Source File # Begin Source File -SOURCE=.\memory\unix\apr_sms_blocks.c +SOURCE=.\include\arch\unix\misc.h # End Source File # Begin Source File -SOURCE=.\memory\unix\apr_sms_std.c +SOURCE=.\include\arch\win32\networkio.h # End Source File # Begin Source File -SOURCE=.\memory\unix\apr_sms_tracking.c +SOURCE=.\include\arch\win32\threadproc.h # End Source File # End Group -# End Group -# Begin Group "Generated Header Files" +# Begin Group "External Header Files" # PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr.h -# End Source File -# Begin Source File - SOURCE=.\include\apr.h.in +# PROP Exclude_From_Build 1 # End Source File # Begin Source File @@ -458,14 +467,6 @@ InputPath=.\include\apr.hw # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_private.h -# End Source File -# End Group -# Begin Group "External Header Files" - -# PROP Default_Filter "" -# Begin Source File - SOURCE=.\include\apr_compat.h # End Source File # Begin Source File @@ -502,6 +503,10 @@ SOURCE=.\include\apr_hash.h # End Source File # Begin Source File +SOURCE=.\include\apr_inherit.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_lib.h # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index 7575959b36f..9eee611c62a 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -90,76 +90,105 @@ LINK32=link.exe # Begin Group "Source Files" # PROP Default_Filter ".c" -# Begin Group "time" +# Begin Group "dso" # PROP Default_Filter "" # Begin Source File -SOURCE=.\time\win32\access.c +SOURCE=.\dso\win32\dso.c # End Source File +# End Group +# Begin Group "file_io" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\arch\win32\atime.h +SOURCE=.\file_io\win32\dir.c # End Source File # Begin Source File -SOURCE=.\time\win32\time.c +SOURCE=.\file_io\unix\fileacc.c # End Source File # Begin Source File -SOURCE=.\time\win32\timestr.c +SOURCE=.\file_io\win32\filedup.c # End Source File -# End Group -# Begin Group "strings" +# Begin Source File -# PROP Default_Filter "" +SOURCE=.\file_io\win32\filepath.c +# End Source File # Begin Source File -SOURCE=.\strings\apr_cpystrn.c +SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File -SOURCE=.\strings\apr_fnmatch.c +SOURCE=.\file_io\win32\flock.c # End Source File # Begin Source File -SOURCE=.\strings\apr_snprintf.c +SOURCE=.\file_io\unix\fullrw.c # End Source File # Begin Source File -SOURCE=.\strings\apr_strings.c +SOURCE=.\file_io\win32\open.c # End Source File # Begin Source File -SOURCE=.\strings\apr_strnatcmp.c +SOURCE=.\file_io\win32\pipe.c # End Source File # Begin Source File -SOURCE=.\strings\apr_strtok.c +SOURCE=.\file_io\win32\readwrite.c +# End Source File +# Begin Source File + +SOURCE=.\file_io\win32\seek.c # End Source File # End Group -# Begin Group "passwd" +# Begin Group "i18n" # PROP Default_Filter "" # Begin Source File -SOURCE=.\passwd\apr_getpass.c +SOURCE=.\i18n\unix\utf8_ucs2.c # End Source File # Begin Source File -SOURCE=.\passwd\apr_md5.c +SOURCE=.\i18n\unix\xlate.c +# PROP Exclude_From_Build 1 # End Source File # End Group -# Begin Group "tables" +# Begin Group "locks" # PROP Default_Filter "" # Begin Source File -SOURCE=.\tables\apr_hash.c +SOURCE=.\locks\win32\locks.c # End Source File +# End Group +# Begin Group "memory" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\tables\apr_tables.c +SOURCE=.\memory\unix\apr_pools.c +# End Source File +# Begin Source File + +SOURCE=.\memory\unix\apr_sms.c +# End Source File +# Begin Source File + +SOURCE=.\memory\unix\apr_sms_blocks.c +# End Source File +# Begin Source File + +SOURCE=.\memory\unix\apr_sms_std.c +# End Source File +# Begin Source File + +SOURCE=.\memory\unix\apr_sms_tracking.c # End Source File # End Group # Begin Group "misc" @@ -183,10 +212,6 @@ SOURCE=.\misc\win32\misc.c # End Source File # Begin Source File -SOURCE=.\include\arch\unix\misc.h -# End Source File -# Begin Source File - SOURCE=.\misc\win32\names.c # End Source File # Begin Source File @@ -206,109 +231,114 @@ SOURCE=.\misc\unix\start.c SOURCE=.\misc\unix\uuid.c # End Source File # End Group -# Begin Group "file_io" +# Begin Group "mmap" # PROP Default_Filter "" # Begin Source File -SOURCE=.\file_io\win32\dir.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\unix\fileacc.c +SOURCE=.\mmap\unix\common.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\filedup.c +SOURCE=.\mmap\win32\mmap.c # End Source File -# Begin Source File +# End Group +# Begin Group "network_io" -SOURCE=.\include\arch\win32\fileio.h -# End Source File +# PROP Default_Filter "" # Begin Source File -SOURCE=.\file_io\win32\filepath.c +SOURCE=.\network_io\unix\inet_ntop.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\filestat.c +SOURCE=.\network_io\unix\inet_pton.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\flock.c +SOURCE=.\network_io\win32\poll.c # End Source File # Begin Source File -SOURCE=.\file_io\unix\fullrw.c +SOURCE=.\network_io\unix\sa_common.c +# PROP Exclude_From_Build 1 # End Source File # Begin Source File -SOURCE=.\file_io\win32\open.c +SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\pipe.c +SOURCE=.\network_io\win32\sockaddr.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\readwrite.c +SOURCE=.\network_io\win32\sockets.c # End Source File # Begin Source File -SOURCE=.\file_io\win32\seek.c +SOURCE=.\network_io\win32\sockopt.c # End Source File # End Group -# Begin Group "locks" +# Begin Group "passwd" # PROP Default_Filter "" # Begin Source File -SOURCE=.\locks\win32\locks.c +SOURCE=.\passwd\apr_getpass.c # End Source File # Begin Source File -SOURCE=.\include\arch\win32\locks.h +SOURCE=.\passwd\apr_md5.c # End Source File # End Group -# Begin Group "network_io" +# Begin Group "shmem" # PROP Default_Filter "" # Begin Source File -SOURCE=.\network_io\unix\inet_ntop.c +SOURCE=.\shmem\win32\shmem.c +# PROP Exclude_From_Build 1 # End Source File +# End Group +# Begin Group "strings" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\network_io\unix\inet_pton.c +SOURCE=.\strings\apr_cpystrn.c # End Source File # Begin Source File -SOURCE=.\include\arch\win32\networkio.h +SOURCE=.\strings\apr_fnmatch.c # End Source File # Begin Source File -SOURCE=.\network_io\win32\poll.c +SOURCE=.\strings\apr_snprintf.c # End Source File # Begin Source File -SOURCE=.\network_io\unix\sa_common.c -# PROP Exclude_From_Build 1 +SOURCE=.\strings\apr_strings.c # End Source File # Begin Source File -SOURCE=.\network_io\win32\sendrecv.c +SOURCE=.\strings\apr_strnatcmp.c # End Source File # Begin Source File -SOURCE=.\network_io\win32\sockaddr.c +SOURCE=.\strings\apr_strtok.c # End Source File +# End Group +# Begin Group "tables" + +# PROP Default_Filter "" # Begin Source File -SOURCE=.\network_io\win32\sockets.c +SOURCE=.\tables\apr_hash.c # End Source File # Begin Source File -SOURCE=.\network_io\win32\sockopt.c +SOURCE=.\tables\apr_tables.c # End Source File # End Group # Begin Group "threadproc" @@ -330,112 +360,87 @@ SOURCE=.\threadproc\win32\thread.c SOURCE=.\threadproc\win32\threadpriv.c # End Source File -# Begin Source File - -SOURCE=.\include\arch\win32\threadproc.h -# End Source File # End Group -# Begin Group "dso" +# Begin Group "time" # PROP Default_Filter "" # Begin Source File -SOURCE=.\dso\win32\dso.c +SOURCE=.\time\win32\access.c # End Source File # Begin Source File -SOURCE=.\include\arch\win32\dso.h +SOURCE=.\time\win32\time.c # End Source File -# End Group -# Begin Group "i18n" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\include\arch\unix\i18n.h +SOURCE=.\time\win32\timestr.c # End Source File -# Begin Source File +# End Group +# Begin Group "user" -SOURCE=.\i18n\unix\utf8_ucs2.c -# End Source File +# PROP Default_Filter "" # Begin Source File -SOURCE=.\i18n\unix\xlate.c -# PROP Exclude_From_Build 1 +SOURCE=.\user\win32\groupinfo.c # End Source File -# End Group -# Begin Group "shmem" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\shmem\win32\shmem.c -# PROP Exclude_From_Build 1 +SOURCE=.\user\win32\userinfo.c # End Source File # End Group -# Begin Group "mmap" +# End Group +# Begin Group "Internal Header Files" # PROP Default_Filter "" # Begin Source File -SOURCE=.\mmap\unix\common.c +SOURCE=.\include\arch\win32\apr_private.h # End Source File # Begin Source File -SOURCE=.\mmap\win32\mmap.c +SOURCE=.\include\arch\win32\atime.h # End Source File -# End Group -# Begin Group "user" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\user\win32\groupinfo.c +SOURCE=.\include\arch\win32\dso.h # End Source File # Begin Source File -SOURCE=.\user\win32\userinfo.c +SOURCE=.\include\arch\win32\fileio.h # End Source File -# End Group -# Begin Group "memory" - -# PROP Default_Filter "" # Begin Source File -SOURCE=.\memory\unix\apr_pools.c +SOURCE=.\include\arch\unix\i18n.h # End Source File # Begin Source File -SOURCE=.\memory\unix\apr_sms.c +SOURCE=.\include\arch\unix\inherit.h # End Source File # Begin Source File -SOURCE=.\memory\unix\apr_sms_blocks.c +SOURCE=.\include\arch\win32\locks.h # End Source File # Begin Source File -SOURCE=.\memory\unix\apr_sms_std.c +SOURCE=.\include\arch\unix\misc.h # End Source File # Begin Source File -SOURCE=.\memory\unix\apr_sms_tracking.c +SOURCE=.\include\arch\win32\networkio.h # End Source File # Begin Source File -SOURCE=.\memory\unix\apr_sms_trivial.c +SOURCE=.\include\arch\win32\threadproc.h # End Source File # End Group -# End Group -# Begin Group "Generated Header Files" +# Begin Group "External Header Files" # PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr.h -# End Source File -# Begin Source File - SOURCE=.\include\apr.h.in +# PROP Exclude_From_Build 1 # End Source File # Begin Source File @@ -468,14 +473,6 @@ InputPath=.\include\apr.hw # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_private.h -# End Source File -# End Group -# Begin Group "External Header Files" - -# PROP Default_Filter "" -# Begin Source File - SOURCE=.\include\apr_compat.h # End Source File # Begin Source File @@ -512,6 +509,10 @@ SOURCE=.\include\apr_hash.h # End Source File # Begin Source File +SOURCE=.\include\apr_inherit.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_lib.h # End Source File # Begin Source File From c1fcd2ea8ddf9c1cc2243487752ae66f3e18ff2f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 23 Jul 2001 22:19:13 +0000 Subject: [PATCH 1995/7878] Depricated the broken apr_pool_child_cleanup_kill, and added the new apr_pool_child_cleanup_set() to replace the registered child cleanup with another cleanup fn. Fixed the inherit macro declarations to never register a NULL cleanup fn. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61990 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 16 +++++++++------- include/arch/unix/inherit.h | 6 +++--- memory/unix/apr_pools.c | 14 ++++++++------ 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index e24636f94bc..153c268b54a 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -381,13 +381,15 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *)); /** - * Remove a previously registered child cleanup function - * @param p The pool remove the cleanup from - * @param data The data to remove from cleanup - * @param cleanup The function to remove from cleanup - */ -APR_DECLARE(void) apr_pool_child_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup) (void *)); + * Replace the child cleanup of a previously registered cleanup + * @param p The pool of the registered cleanup + * @param data The data of the registered cleanup + * @param plain_cleanup The plain cleanup function of the registered cleanup + * @param child_cleanup The function to register as the child cleanup + */ +APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup) (void *), + apr_status_t (*child_cleanup) (void *)); /** * Run the specified cleanup function immediately and unregister it. Use diff --git a/include/arch/unix/inherit.h b/include/arch/unix/inherit.h index 19d9bbc3b2d..f011bec1e08 100644 --- a/include/arch/unix/inherit.h +++ b/include/arch/unix/inherit.h @@ -64,8 +64,8 @@ void apr_##name##_set_inherit(apr_##name##_t *name) \ { \ if (!(name->flag & APR_INHERIT)) { \ name->flag |= APR_INHERIT; \ - apr_pool_cleanup_register(name->pool, (void *)name, \ - NULL, cleanup); \ + apr_pool_cleanup_child_set(name->pool, (void *)name, \ + cleanup, apr_pool_cleanup_null); \ } \ } @@ -75,7 +75,7 @@ void apr_##name##_unset_inherit(apr_##name##_t *name) \ if (name->flag & APR_INHERIT) { \ name->flag &= ~APR_INHERIT; \ apr_pool_cleanup_kill(name->pool, (void *)name, \ - cleanup); \ + cleanup, cleanup); \ } \ } diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 4e7f1e02bdb..327ff7456b2 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -717,8 +717,9 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, } } -APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup) (void *)) +APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup) (void *)) + apr_status_t (*plain_cleanup) (void *)) { struct cleanup *c; struct cleanup **lastp; @@ -738,8 +739,9 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, } } -APR_DECLARE(void) apr_pool_child_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup) (void *)) +APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup) (void *), + apr_status_t (*child_cleanup) (void *)) { struct cleanup *c; struct cleanup **lastp; @@ -749,8 +751,8 @@ APR_DECLARE(void) apr_pool_child_cleanup_kill(apr_pool_t *p, const void *data, c = p->cleanups; lastp = &p->cleanups; while (c) { - if (c->data == data && c->child_cleanup == cleanup) { - *lastp = c->next; + if (c->data == data && c->plain_cleanup == plain_cleanup) { + c->child_cleanup = child_cleanup; break; } From 14ba8779368324b93f22821d57791c649704d630 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 23 Jul 2001 22:32:06 +0000 Subject: [PATCH 1996/7878] turn off AI_CANONNAME flag in apr_sockaddr_info_get call to getaddrinfo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61991 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 287e2cbb56a..5cd6caf9b05 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -341,7 +341,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, char num[8]; memset(&hints, 0, sizeof(hints)); - hints.ai_flags = AI_CANONNAME; + hints.ai_flags = 0; /* XXX: might need a way to turn on AI_CANONNAME */ hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; From 18bde55906006fcffd2eaa2e514d2c34797fac01 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 23 Jul 2001 22:38:36 +0000 Subject: [PATCH 1997/7878] This is the patch described in the prior cvs checkin git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61992 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 327ff7456b2..fc8b75f01d8 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -717,9 +717,8 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, } } -APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup) (void *)) - apr_status_t (*plain_cleanup) (void *)) +APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, + apr_status_t (*cleanup) (void *)) { struct cleanup *c; struct cleanup **lastp; @@ -744,19 +743,16 @@ APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, apr_status_t (*child_cleanup) (void *)) { struct cleanup *c; - struct cleanup **lastp; if (p == NULL) return; c = p->cleanups; - lastp = &p->cleanups; while (c) { if (c->data == data && c->plain_cleanup == plain_cleanup) { - c->child_cleanup = child_cleanup; + c->child_cleanup == child_cleanup; break; } - lastp = &c->next; c = c->next; } } From e0cca8584e3b83af2474e791130b1edcd88d2b2e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 23 Jul 2001 22:51:41 +0000 Subject: [PATCH 1998/7878] Thank you justin :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61993 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index fc8b75f01d8..4b6e2ddf0f1 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -749,7 +749,7 @@ APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, c = p->cleanups; while (c) { if (c->data == data && c->plain_cleanup == plain_cleanup) { - c->child_cleanup == child_cleanup; + c->child_cleanup = child_cleanup; break; } From aa8c902cb9e60911bb4859aee52a59f282946b8e Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 23 Jul 2001 23:56:39 +0000 Subject: [PATCH 1999/7878] Fix typos to get us building again Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61994 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/inherit.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/arch/unix/inherit.h b/include/arch/unix/inherit.h index f011bec1e08..58c86b6cf7c 100644 --- a/include/arch/unix/inherit.h +++ b/include/arch/unix/inherit.h @@ -64,7 +64,7 @@ void apr_##name##_set_inherit(apr_##name##_t *name) \ { \ if (!(name->flag & APR_INHERIT)) { \ name->flag |= APR_INHERIT; \ - apr_pool_cleanup_child_set(name->pool, (void *)name, \ + apr_pool_child_cleanup_set(name->pool, (void *)name, \ cleanup, apr_pool_cleanup_null); \ } \ } @@ -74,8 +74,7 @@ void apr_##name##_unset_inherit(apr_##name##_t *name) \ { \ if (name->flag & APR_INHERIT) { \ name->flag &= ~APR_INHERIT; \ - apr_pool_cleanup_kill(name->pool, (void *)name, \ - cleanup, cleanup); \ + apr_pool_cleanup_kill(name->pool, (void *)name, cleanup); \ } \ } From 09cbe790771661234ab1b3f59d24fb7152c5cea2 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 24 Jul 2001 03:02:58 +0000 Subject: [PATCH 2000/7878] Add Solaris 8 sendfilev() support. Passes the sendfile client/server test in apr. Tested on Solaris 8/Sparc with latest recommended patches and the patches as listed in: http://sunsolve.Sun.COM/pub-cgi/retrieve.pl?doc=fpatches%2F111297 (Sparc) http://sunsolve.Sun.COM/pub-cgi/retrieve.pl?doc=fpatches%2F111298 (x86) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61995 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++ configure.in | 3 +- network_io/unix/sendrecv.c | 87 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index f2f04750b3d..5e142709eb6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Add Solaris 8's sendfilev() support. This requires the following + patches from Sun: 111297 (Sparc), 111298 (x86). You'll need the + other patches listed in the patch description. [Justin Erenkrantz] + *) Close file descriptor when we are done with fcntl or flock-based cross-process lock. Otherwise, we leak descriptors. [Justin Erenkrantz] diff --git a/configure.in b/configure.in index 364d8bbe661..72cb6cd03b1 100644 --- a/configure.in +++ b/configure.in @@ -466,7 +466,8 @@ AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) AC_CHECK_FUNCS(writev) sendfile="0" -AC_CHECK_FUNCS(sendfile send_file, [ sendfile="1" ]) +AC_CHECK_LIB(sendfile, sendfilev) +AC_CHECK_FUNCS(sendfile send_file sendfilev, [ sendfile="1" ]) dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a dnl threaded poll() and we don't want to use sendfile on early FreeBSD diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index abd77409cec..e4152ec6d50 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -742,6 +742,93 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, * we don't use it until it is fixed. If it is used as it is now, it will * hang the machine and the only way to fix it is a reboot. */ +#elif defined(HAVE_SENDFILEV) +/* Solaris 8's sendfilev() interface + * + * SFV_FD_SELF refers to our memory space. + * + * Required Sparc patches (or newer): + * 111297-01, 108528-09, 109472-06, 109234-03, 108995-02, 111295-01, 109025-03, + * 108991-13 + * Required x86 patches (or newer): + * 111298-01, 108529-09, 109473-06, 109235-04, 108996-02, 111296-01, 109026-04, + * 108992-13 + */ +apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, + apr_int32_t flags) +{ + apr_status_t rv; + size_t nbytes; + sendfilevec_t *sfv; + int vecs, curvec, i; + + if (!hdtr) { + hdtr = &no_hdtr; + } + + /* Ignore flags for now. */ + flags = 0; + + /* Calculate how much space we need. */ + vecs = hdtr->numheaders + hdtr->numtrailers + 1; + sfv = apr_palloc(sock->cntxt, sizeof(sendfilevec_t) * vecs); + + curvec = 0; + + /* Add the headers */ + for (i = 0; i < hdtr->numheaders; i++, curvec++) { + sfv[curvec].sfv_fd = SFV_FD_SELF; + sfv[curvec].sfv_flag = 0; + sfv[curvec].sfv_off = hdtr->headers[i].iov_base; + sfv[curvec].sfv_len = hdtr->headers[i].iov_len; + } + + /* If the len is 0, we skip the file. */ + if (*len) + { + sfv[curvec].sfv_fd = file->filedes; + sfv[curvec].sfv_flag = 0; + sfv[curvec].sfv_off = *offset; + sfv[curvec].sfv_len = *len; + + curvec++; + } + else + vecs--; + + /* Add the footers */ + for (i = 0; i < hdtr->numtrailers; i++, curvec++) { + sfv[curvec].sfv_fd = SFV_FD_SELF; + sfv[curvec].sfv_flag = 0; + sfv[curvec].sfv_off = hdtr->trailers[i].iov_base; + sfv[curvec].sfv_len = hdtr->trailers[i].iov_len; + } + + /* If we are in non-blocking mode, we need to make sure we wait until + * the other side says it is okay. */ + if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) == 1 || + apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) == 1) + { + rv = apr_wait_for_io_or_timeout(sock, 0); + } + + /* Actually do the sendfilev */ + do { + /* socket, vecs, number of vecs, bytes written */ + rv = sendfilev(sock->socketdes, sfv, vecs, &nbytes); + } while (rv == -1 && errno == EINTR); + + /* Solaris returns EAGAIN even though it sent bytes on a non-block sock */ + if (rv == -1 && errno != EAGAIN) { + rv = errno; + return rv; + } + + /* Update how much we sent */ + *len = nbytes; + return APR_SUCCESS; +} #else #error APR has detected sendfile on your system, but nobody has written a #error version of it for APR yet. To get past this, either write apr_sendfile From cf8767725d97a36fb4fc9c0f03a01d7a314c27ea Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 24 Jul 2001 03:10:59 +0000 Subject: [PATCH 2001/7878] I don't even want to know how that tab slipped in. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61996 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index e4152ec6d50..caed1088905 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -816,7 +816,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, /* Actually do the sendfilev */ do { /* socket, vecs, number of vecs, bytes written */ - rv = sendfilev(sock->socketdes, sfv, vecs, &nbytes); + rv = sendfilev(sock->socketdes, sfv, vecs, &nbytes); } while (rv == -1 && errno == EINTR); /* Solaris returns EAGAIN even though it sent bytes on a non-block sock */ From 47b0b4f356290e4043efed8b68eed069081fb62f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 24 Jul 2001 04:45:46 +0000 Subject: [PATCH 2002/7878] These both need to be apr_pool_child_cleanup_set() ... we are simply toggling between the null cleanup and a real cleanup. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61997 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/inherit.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/arch/unix/inherit.h b/include/arch/unix/inherit.h index 58c86b6cf7c..394c2cd5b99 100644 --- a/include/arch/unix/inherit.h +++ b/include/arch/unix/inherit.h @@ -74,7 +74,8 @@ void apr_##name##_unset_inherit(apr_##name##_t *name) \ { \ if (name->flag & APR_INHERIT) { \ name->flag &= ~APR_INHERIT; \ - apr_pool_cleanup_kill(name->pool, (void *)name, cleanup); \ + apr_pool_child_cleanup_set(name->pool, (void *)name, \ + cleanup, cleanup); \ } \ } From cdcc810cf8c623eaa217ce381d9ef4b251fe3191 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 24 Jul 2001 05:16:32 +0000 Subject: [PATCH 2003/7878] Updated APR to pass the thread worker_function prototype (apr_thread_start_t) two parameters, the apr private data (apr_thread_t*) and the application private data (void*). Applications' worker_thread() routines may use apr_thread_pool_get to access the pool (implemented using APR_POOL_*_ACCESSOR() macros.) Submitted by: Aaron Bannert Reviewed by: Will Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61998 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++++++ include/apr_thread_proc.h | 13 ++++++++++++- include/arch/beos/threadproc.h | 2 ++ include/arch/os2/threadproc.h | 2 -- include/arch/unix/threadproc.h | 2 ++ include/arch/win32/threadproc.h | 2 ++ threadproc/beos/thread.c | 12 +++++++++++- threadproc/os2/thread.c | 14 ++++++-------- threadproc/unix/thread.c | 17 ++++++++++++++--- threadproc/win32/thread.c | 13 +++++++++++-- 10 files changed, 67 insertions(+), 17 deletions(-) diff --git a/CHANGES b/CHANGES index 5e142709eb6..d5e1cf2e489 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,12 @@ Changes with APR b1 + *) Updated APR to pass the thread worker_function prototype + (apr_thread_start_t) two parameters, the apr private data + (apr_thread_t*) and the application private data (void*). + Applications' worker_thread() routines may use apr_thread_pool_get + to access the pool (implemented using APR_POOL_*_ACCESSOR() macros.) + [Aaron Bannert ] + *) Add Solaris 8's sendfilev() support. This requires the following patches from Sun: 111297 (Sparc), 111298 (x86). You'll need the other patches listed in the patch description. [Justin Erenkrantz] diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 8fa692c9865..8bf943113a3 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -125,7 +125,10 @@ typedef struct apr_threadkey_t apr_threadkey_t; typedef struct apr_other_child_rec_t apr_other_child_rec_t; #endif /* APR_HAS_OTHER_CHILD */ -typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(void *); +/** + * The prototype for any APR thread worker functions. + */ +typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(apr_thread_t*, void*); enum kill_conditions { kill_never, /* process is never sent any signals */ @@ -599,6 +602,14 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void); * apr_status_t apr_signal_thread((int)(*signal_handler)(int signum)) */ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)); + +/** + * Get the child-pool used by the thread from the thread info. + * @return apr_pool_t the pool + * @deffunc apr_pool_t apr_thread_info_pool_get(apr_thread_info_t *i) + */ +APR_POOL_DECLARE_ACCESSOR(thread); + #endif /* APR_HAS_THREADS */ #ifdef __cplusplus diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h index cb77839b17a..145cf4a5b2f 100644 --- a/include/arch/beos/threadproc.h +++ b/include/arch/beos/threadproc.h @@ -80,6 +80,8 @@ struct apr_thread_t { apr_pool_t *cntxt; thread_id td; + void *data; + apr_thread_start_t func; }; struct apr_threadattr_t { diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/threadproc.h index b9808102c6b..f33cde006f2 100644 --- a/include/arch/os2/threadproc.h +++ b/include/arch/os2/threadproc.h @@ -95,7 +95,5 @@ struct apr_procattr_t { apr_int32_t detached; }; -typedef void (*os2_thread_start_t)(void *); - #endif /* ! THREAD_PROC_H */ diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index 832001f9e74..388b78aa6e2 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -90,6 +90,8 @@ struct apr_thread_t { apr_pool_t *cntxt; pthread_t *td; + void *data; + apr_thread_start_t func; }; struct apr_threadattr_t { diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/threadproc.h index 58a718e35b6..deaf0e45b55 100644 --- a/include/arch/win32/threadproc.h +++ b/include/arch/win32/threadproc.h @@ -66,6 +66,8 @@ struct apr_thread_t { HANDLE td; apr_int32_t cancel; apr_int32_t cancel_how; + void *data; + apr_thread_start_t func; }; struct apr_threadattr_t { diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 6bec7de622f..51838973ba5 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -88,6 +88,12 @@ apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) return APR_NOTDETACH; } +void *dummy_worker(void *opaque) +{ + apr_thread_t *thd = (apr_thread_t*)opaque; + return thd->func(thd, thd->data); +} + apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) @@ -101,6 +107,8 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, } (*new)->cntxt = cont; + (*new)->data = data; + (*new)->func = func; /* First we create the new thread...*/ if (attr) @@ -113,7 +121,7 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, return stat; } - (*new)->td = spawn_thread((thread_func)func, "apr thread", temp, data); + (*new)->td = spawn_thread((thread_func)dummy_func, "apr thread", temp, (*new)); /* Now we try to run it...*/ if (resume_thread((*new)->td) == B_NO_ERROR) { return APR_SUCCESS; @@ -191,3 +199,5 @@ apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, (*thd)->td = *thethd; return APR_SUCCESS; } + +APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 660e7e0efa0..510b62d1490 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -95,7 +95,7 @@ apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) static void apr_thread_begin(void *arg) { apr_thread_t *thread = (apr_thread_t *)arg; - thread->rv = thread->func(thread->data); + thread->rv = thread->func(thread, thread->data); } @@ -131,13 +131,9 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, return stat; } } - - if (thread->attr->attr & APR_THREADATTR_DETACHED) - thread->tid = _beginthread((os2_thread_start_t)func, NULL, - APR_THREAD_STACKSIZE, data); - else - thread->tid = _beginthread(apr_thread_begin, NULL, - APR_THREAD_STACKSIZE, thread); + + thread->tid = _beginthread(apr_thread_begin, NULL, + APR_THREAD_STACKSIZE, thread); if (thread->tid < 0) { return errno; @@ -235,3 +231,5 @@ apr_status_t apr_thread_data_set(void *data, const char *key, { return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); } + +APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 9aa49ce0265..ce1faacb1b2 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -116,6 +116,12 @@ apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) return APR_NOTDETACH; } +void *dummy_worker(void *opaque) +{ + apr_thread_t *thread = (apr_thread_t*)opaque; + return thread->func(thread, thread->data); +} + apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) @@ -136,18 +142,20 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, } (*new)->cntxt = cont; - + (*new)->data = data; + (*new)->func = func; + if (attr) temp = attr->attr; else temp = NULL; - + stat = apr_pool_create(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } - if ((stat = pthread_create((*new)->td, temp, func, data)) == 0) { + if ((stat = pthread_create((*new)->td, temp, dummy_worker, (*new))) == 0) { return APR_SUCCESS; } else { @@ -240,6 +248,9 @@ apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, (*thd)->td = thethd; return APR_SUCCESS; } + +APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) + #endif /* HAVE_PTHREAD_H */ #endif /* APR_HAS_THREADS */ diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 131ee228f1a..e3384093532 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -89,6 +89,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) return APR_NOTDETACH; } +void *dummy_func(void *opaque) +{ + apr_thread_t *thd = (apr_thread_t *)opaque; + return thd->func(thd, thd->data); +} + APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, @@ -105,6 +111,8 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, } (*new)->cntxt = cont; + (*new)->data = data; + (*new)->func = func; stat = apr_pool_create(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { @@ -114,8 +122,8 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, /* Use 0 for Thread Stack Size, because that will default the stack to the * same size as the calling thread. */ - if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, (unsigned int (APR_THREAD_FUNC *)(void *))func, - data, 0, &temp)) == 0) { + if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, (unsigned int (APR_THREAD_FUNC *)(void *))dummy_func, + (*new), 0, &temp)) == 0) { lasterror = apr_get_os_error(); return APR_EEXIST; /* MSVC++ doc doesn't mention any additional error info @@ -207,3 +215,4 @@ APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, return APR_SUCCESS; } +APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) From 6fac16b29e39f8d51507038417ae2d7919788e01 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 24 Jul 2001 05:17:26 +0000 Subject: [PATCH 2004/7878] Update the test suite to reflect the new thread worker's arguments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61999 13f79535-47bb-0310-9956-ffa450edef68 --- test/testthread.c | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/test/testthread.c b/test/testthread.c index a17dd5cf507..5bf9a27b6a5 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -58,6 +58,7 @@ #include "apr_general.h" #include "errno.h" #include +#include #ifdef BEOS #include #endif @@ -72,57 +73,66 @@ int main(void) } #else /* !APR_HAS_THREADS */ -void * APR_THREAD_FUNC thread_func1(void *data); -void * APR_THREAD_FUNC thread_func2(void *data); -void * APR_THREAD_FUNC thread_func3(void *data); -void * APR_THREAD_FUNC thread_func4(void *data); +void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_func2(apr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_func3(apr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_func4(apr_thread_t *thd, void *data); apr_lock_t *thread_lock; apr_pool_t *context; int x = 0; +apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ -void * APR_THREAD_FUNC thread_func1(void *data) +void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data) { int i; + apr_pool_t *pool = apr_thread_pool_get(thd); for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; apr_lock_release(thread_lock); } + apr_thread_exit(thd, &exit_ret_val); return NULL; } -void * APR_THREAD_FUNC thread_func2(void *data) +void * APR_THREAD_FUNC thread_func2(apr_thread_t *thd, void *data) { int i; + apr_pool_t *pool = apr_thread_pool_get(thd); for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; apr_lock_release(thread_lock); } + apr_thread_exit(thd, &exit_ret_val); return NULL; } -void * APR_THREAD_FUNC thread_func3(void *data) +void * APR_THREAD_FUNC thread_func3(apr_thread_t *thd, void *data) { int i; + apr_pool_t *pool = apr_thread_pool_get(thd); for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; apr_lock_release(thread_lock); } + apr_thread_exit(thd, &exit_ret_val); return NULL; } -void * APR_THREAD_FUNC thread_func4(void *data) +void * APR_THREAD_FUNC thread_func4(apr_thread_t *thd, void *data) { int i; + apr_pool_t *pool = apr_thread_pool_get(thd); for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; apr_lock_release(thread_lock); } + apr_thread_exit(thd, &exit_ret_val); return NULL; } @@ -172,7 +182,15 @@ int main(void) apr_thread_join(&s2, t2); apr_thread_join(&s3, t3); apr_thread_join(&s4, t4); - fprintf (stdout, "OK\n"); + fprintf (stdout, "OK\n"); + + fprintf(stdout, "Checking thread's returned value......."); + if (s1 != exit_ret_val || s2 != exit_ret_val || + s3 != exit_ret_val || s4 != exit_ret_val) { + fprintf(stderr, "Invalid return value (not expected value)\n"); + exit(-1); + } + fprintf(stdout, "OK\n"); fprintf(stdout, "Checking if locks worked......."); if (x != 40000) { From 55eb98499b3802a3fd946f8f1f247129ab98a384 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 24 Jul 2001 06:51:58 +0000 Subject: [PATCH 2005/7878] D'oh - that was stupid. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62000 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 2d956ea773a..32fe5646d1b 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -614,7 +614,7 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms) { apr_lock_destroy(sms->sms_lock); if (pms->free_fn) - return apr_sms_free(sms->parent, sms->sms_lock); + apr_sms_free(sms->parent, sms->sms_lock); } #ifndef APR_POOLS_ARE_SMS From 2a6fc9697b01403a18b4fda062d3ef217f122b6e Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 24 Jul 2001 10:04:06 +0000 Subject: [PATCH 2006/7878] Panto season comes early this year... the bug's fixed! oh no it isn't oh yes it is oh no it isn't oh yes it is oh no it isn't Well, you get the idea. anyway fork + threads = evil on beos (still) despite being told that it was fixed, it isn't :( git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62001 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/procsup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index c7f828bad7b..1b797e3aa96 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -60,7 +60,7 @@ apr_status_t apr_proc_detach(void) pid_t pgrp; chdir("/"); -#if !defined(MPE) && !defined(OS2) && !defined(TPF) && !defined(BEOS_R5) +#if !defined(MPE) && !defined(OS2) && !defined(TPF) && !defined(BEOS) /* Don't detach for MPE because child processes can't survive the death of the parent. */ if ((x = fork()) > 0) From 104d0ded66605045ba8cba40aa894fcd77320f3a Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 24 Jul 2001 10:05:36 +0000 Subject: [PATCH 2007/7878] Add the ability to remove an element as well as add one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62002 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 4bd4133cd8d..0bc9ec48fc1 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -173,6 +173,32 @@ AC_DEFUN(APR_ADDTO,[ fi ])dnl +dnl +dnl APR_REMOVEFROM(variable, value) +dnl +dnl Remove a value from a variable +dnl +AC_DEFUN(APR_REMOVEFROM,[ + if test "x$$1" = "x$2"; then + echo " nulling $1" + $1="" + else + apr_new_bugger="" + apr_removed=0 + for i in $$1; do + if test "x$i" != "x$2"; then + apr_new_bugger="$apr_new_bugger $i" + else + apr_removed=1 + fi + done + if test $apr_removed = "1"; then + echo " removed \"$2\" from $1" + $1=$apr_new_bugger + fi + fi +]) dnl + dnl dnl APR_CHECK_DEFINE_FILES( symbol, header_file [header_file ...] ) dnl From a131c87ff4d078b5fe1d45cc898f00450bc22c9f Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 24 Jul 2001 10:08:38 +0000 Subject: [PATCH 2008/7878] If we're using malloc_debug on beos remove the O2 flag or we'll be building forever and a day and you better have huge amounts of ram. With this we can just build as normal. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62003 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index 72cb6cd03b1..958778601ad 100644 --- a/configure.in +++ b/configure.in @@ -160,6 +160,7 @@ AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build if test "$host" = "i586-pc-beos"; then AC_ARG_ENABLE(malloc-debug,[ --enable-malloc-debug Switch on malloc_debug for BeOS], + APR_REMOVEFROM(CFLAGS, -O2) APR_ADDTO(CPPFLAGS, -fcheck-memory-usage -D_KERNEL_MODE) ) dnl fi From f6579e35100141d53eb0fe7d6b9c6adc864c9241 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 24 Jul 2001 10:53:06 +0000 Subject: [PATCH 2009/7878] dummy_func != dummy_worker I'm sorry, but this change seems crazy to me. Know I haven't been following the discussion that closely - how many patches???? - but this doesn't feel right. Adding more indirections to gain what exactly? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62004 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/thread.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 51838973ba5..4903823cc18 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -88,25 +88,25 @@ apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) return APR_NOTDETACH; } -void *dummy_worker(void *opaque) +static void *dummy_worker(void *opaque) { apr_thread_t *thd = (apr_thread_t*)opaque; return thd->func(thd, thd->data); } apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, - apr_thread_start_t func, void *data, - apr_pool_t *cont) + apr_thread_start_t func, void *data, + apr_pool_t *pool) { int32 temp; apr_status_t stat; - (*new) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); + (*new) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; + (*new)->cntxt = pool; (*new)->data = data; (*new)->func = func; @@ -116,12 +116,12 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, else temp = B_NORMAL_PRIORITY; - stat = apr_pool_create(&(*new)->cntxt, cont); + stat = apr_pool_create(&(*new)->cntxt, pool); if (stat != APR_SUCCESS) { return stat; } - (*new)->td = spawn_thread((thread_func)dummy_func, "apr thread", temp, (*new)); + (*new)->td = spawn_thread((thread_func)dummy_worker, "apr thread", temp, (*new)); /* Now we try to run it...*/ if (resume_thread((*new)->td) == B_NO_ERROR) { return APR_SUCCESS; From 3353a8d2f3767f852a7c008aa756591978887c41 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 24 Jul 2001 12:36:56 +0000 Subject: [PATCH 2010/7878] OS/2: Fix inherit stuff git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62005 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 2209caa625a..05089f5bfb8 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -57,6 +57,7 @@ #include "apr_lib.h" #include "apr_portable.h" #include "apr_strings.h" +#include "inherit.h" #include apr_status_t apr_file_cleanup(void *thefile) @@ -265,7 +266,7 @@ apr_status_t apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); -APR_IMPLEMENT_SET_INHERIT(socket, inherit, cntxt, socket_cleanup) +APR_IMPLEMENT_SET_INHERIT(file, flags, cntxt, apr_file_cleanup) -APR_IMPLEMENT_UNSET_INHERIT(socket, inherit, cntxt, socket_cleanup) +APR_IMPLEMENT_UNSET_INHERIT(file, flags, cntxt, apr_file_cleanup) From ebafa5029fded159fc520f035b8b94bd94eec40c Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 24 Jul 2001 12:41:37 +0000 Subject: [PATCH 2011/7878] Need to include inherit.h here for the APR_IMPLEMENT_[UN]SET_INHERIT macros. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62006 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index f39faaf669e..5ea5db4dcc2 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -53,6 +53,7 @@ */ #include "networkio.h" +#include "inherit.h" #include "apr_network_io.h" #include "apr_general.h" #include "apr_portable.h" From 2f00791b71033b94b648723d08b61acb56a32cdf Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 24 Jul 2001 13:47:46 +0000 Subject: [PATCH 2012/7878] fix a warning for dummy_worker(); it wasn't static and didn't have a prototype git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62007 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index ce1faacb1b2..634c08b82a1 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -116,7 +116,7 @@ apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) return APR_NOTDETACH; } -void *dummy_worker(void *opaque) +static void *dummy_worker(void *opaque) { apr_thread_t *thread = (apr_thread_t*)opaque; return thread->func(thread, thread->data); From 0d8fa11dd55da8349932b4926775ab2c19deb504 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 24 Jul 2001 15:56:43 +0000 Subject: [PATCH 2013/7878] Fix warning: implicit declaration of function `strchr' git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62008 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 5cd6caf9b05..4df541acb4b 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -71,6 +71,9 @@ #include #endif +#define APR_WANT_STRFUNC +#include "apr_want.h" + #ifdef HAVE_SET_H_ERRNO #define SET_H_ERRNO(newval) set_h_errno(newval) #else From 3de2f94a9830346c1067f1216baad62bf73f1459 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 24 Jul 2001 16:05:24 +0000 Subject: [PATCH 2014/7878] OS/2: Add support for datagram sockets. Mostly adapted from the unix code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62009 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/networkio.h | 1 + include/arch/os2/os2calls.h | 4 ++ network_io/os2/os2calls.c | 8 ++++ network_io/os2/sendrecv_udp.c | 90 ++++++++++++++++++++++++++++++++++- network_io/os2/sockets.c | 13 ++--- 5 files changed, 108 insertions(+), 8 deletions(-) diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index b6ea0f72d65..3f1a336a900 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -66,6 +66,7 @@ struct apr_socket_t { apr_pool_t *cntxt; int socketdes; + int type; apr_sockaddr_t *local_addr; apr_sockaddr_t *remote_addr; apr_interval_time_t timeout; diff --git a/include/arch/os2/os2calls.h b/include/arch/os2/os2calls.h index 6dd6ae0919c..c1397c5c758 100644 --- a/include/arch/os2/os2calls.h +++ b/include/arch/os2/os2calls.h @@ -73,6 +73,8 @@ extern int (*apr_os2_setsockopt)(int, int, int, char *, int); extern int (*apr_os2_shutdown)(int, int); extern int (*apr_os2_soclose)(int); extern int (*apr_os2_writev)(int, struct iovec *, int); +extern int (*apr_os2_sendto)(int, const char *, int, int, const struct sockaddr *, int); +extern int (*apr_os2_recvfrom)(int, char *, int, int, struct sockaddr *, int *); #define socket apr_os2_socket #define select apr_os2_select @@ -91,3 +93,5 @@ extern int (*apr_os2_writev)(int, struct iovec *, int); #define shutdown apr_os2_shutdown #define soclose apr_os2_soclose #define writev apr_os2_writev +#define sendto apr_os2_sendto +#define recvfrom apr_os2_recvfrom diff --git a/network_io/os2/os2calls.c b/network_io/os2/os2calls.c index 423b7ec22e8..3042118a838 100644 --- a/network_io/os2/os2calls.c +++ b/network_io/os2/os2calls.c @@ -77,6 +77,8 @@ int (*apr_os2_setsockopt)(int, int, int, char *, int) = NULL; int (*apr_os2_shutdown)(int, int) = NULL; int (*apr_os2_soclose)(int) = NULL; int (*apr_os2_writev)(int, struct iovec *, int) = NULL; +int (*apr_os2_sendto)(int, const char *, int, int, const struct sockaddr *, int); +int (*apr_os2_recvfrom)(int, char *, int, int, struct sockaddr *, int *); static HMODULE hSO32DLL; @@ -143,6 +145,12 @@ static int os2_fn_link() if (!rc) rc = DosQueryProcAddr(hSO32DLL, 0, "WRITEV", &apr_os2_writev); + if (!rc) + rc = DosQueryProcAddr(hSO32DLL, 0, "SENDTO", &apr_os2_sendto); + + if (!rc) + rc = DosQueryProcAddr(hSO32DLL, 0, "RECVFROM", &apr_os2_recvfrom); + if (rc) return APR_OS2_STATUS(rc); } diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c index a2b0b046b01..0a86ed369b3 100644 --- a/network_io/os2/sendrecv_udp.c +++ b/network_io/os2/sendrecv_udp.c @@ -59,15 +59,101 @@ #include "apr_lib.h" #include +apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read) +{ + int waitsock = sock->socketdes; + int srv; + + do { + waitsock = sock->socketdes; + srv = select(&waitsock, for_read > 0, !for_read, 0, sock->timeout / 1000); + } while (srv < 0 && sock_errno() == SOCEINTR); + + if (srv == 0) { + return APR_TIMEUP; + } + else if (srv < 0) { + return APR_FROM_OS_ERROR(sock_errno()); + } + + return APR_SUCCESS; +} + + + apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, apr_int32_t flags, const char *buf, apr_size_t *len) { - return APR_ENOTIMPL; + ssize_t rv; + int serrno; + + do { + rv = sendto(sock->socketdes, buf, (*len), flags, + (struct sockaddr*)&where->sa, + where->salen); + } while (rv == -1 && (serrno = sock_errno()) == EINTR); + + if (rv == -1 && serrno == SOCEWOULDBLOCK && sock->timeout != 0) { + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); + + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } else { + do { + rv = sendto(sock->socketdes, buf, *len, flags, + (const struct sockaddr*)&where->sa, + where->salen); + } while (rv == -1 && (serrno = sock_errno()) == SOCEINTR); + } + } + + if (rv == -1) { + *len = 0; + return APR_FROM_OS_ERROR(serrno); + } + + *len = rv; + return APR_SUCCESS; } + + apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, apr_int32_t flags, char *buf, apr_size_t *len) { - return APR_ENOTIMPL; + ssize_t rv; + int serrno; + + do { + rv = recvfrom(sock->socketdes, buf, (*len), flags, + (struct sockaddr*)&from->sa, &from->salen); + } while (rv == -1 && (serrno = sock_errno()) == EINTR); + + if (rv == -1 && serrno == SOCEWOULDBLOCK && sock->timeout != 0) { + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 1); + + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } else { + do { + rv = recvfrom(sock->socketdes, buf, *len, flags, + (struct sockaddr*)&from->sa, &from->salen); + } while (rv == -1 && (serrno = sock_errno()) == EINTR); + } + } + + if (rv == -1) { + (*len) = 0; + return APR_FROM_OS_ERROR(serrno); + } + + (*len) = rv; + + if (rv == 0 && sock->type == SOCK_STREAM) + return APR_EOF; + + return APR_SUCCESS; } diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 5ea5db4dcc2..94ba176dedf 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -84,8 +84,9 @@ static apr_status_t socket_cleanup(void *sock) } } -static void set_socket_vars(apr_socket_t *sock, int family) +static void set_socket_vars(apr_socket_t *sock, int family, int type) { + sock->type = type; sock->local_addr->family = family; sock->local_addr->sa.sin.sin_family = family; sock->remote_addr->family = family; @@ -151,7 +152,7 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, return APR_ENOMEM; } - (*new)->socketdes = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + (*new)->socketdes = socket(AF_INET, type, 0); #if APR_HAVE_IPV6 if ((*new)->socketdes < 0 && ofamily == AF_UNSPEC) { family = AF_INET; @@ -162,7 +163,7 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, if ((*new)->socketdes < 0) { return APR_OS2_STATUS(sock_errno()); } - set_socket_vars(*new, family); + set_socket_vars(*new, family, type); (*new)->timeout = -1; (*new)->nonblock = FALSE; @@ -213,7 +214,7 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { alloc_socket(new, connection_context); - set_socket_vars(*new, sock->local_addr->sa.sin.sin_family); + set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM); (*new)->timeout = -1; (*new)->nonblock = FALSE; @@ -274,7 +275,7 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_pool_t *cont) { alloc_socket(apr_sock, cont); - set_socket_vars(*apr_sock, os_sock_info->family); + set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type); (*apr_sock)->timeout = -1; (*apr_sock)->socketdes = *os_sock_info->os_sock; if (os_sock_info->local) { @@ -304,7 +305,7 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_po } if ((*sock) == NULL) { alloc_socket(sock, cont); - set_socket_vars(*sock, AF_INET); + set_socket_vars(*sock, AF_INET, SOCK_STREAM); } (*sock)->socketdes = *thesock; return APR_SUCCESS; From 06a863e71c7452da6d1f65591433b66fbc1e3748 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Tue, 24 Jul 2001 16:12:34 +0000 Subject: [PATCH 2015/7878] Use apr_want.h instead of using string.h directly git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62010 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_trivial.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c index b32f6b98da8..800b219f7d2 100644 --- a/memory/unix/apr_sms_trivial.c +++ b/memory/unix/apr_sms_trivial.c @@ -58,9 +58,10 @@ #include "apr_sms.h" #include "apr_sms_trivial.h" #include "apr_lock.h" +#define APR_WANT_MEMFUNC +#include "apr_want.h" #include "sms_private.h" #include -#include static const char *module_identity = "TRIVIAL"; From 4c0b52fd0d3a18f228d7c1a75330cd9c2f6ed4e8 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 24 Jul 2001 16:37:23 +0000 Subject: [PATCH 2016/7878] Bring the Solaris sendfilev() in line with the rest of the code in that it will block after receiving an EAGAIN instead of before the sendfilev(). However, both Solaris and FreeBSD will return EAGAIN even if the write was successful. This makes it a bit awkward to block after the write (hence why FreeBSD does it the way it does). Other platforms will return EAGAIN without having sent anything - after the wait_for_io returns they need to recall their sendfile. Solaris and FreeBSD can just continue on their merry way. - Update *len to be zero when we get an error - the others seem to do this. - Only wait when it is a timeout not if it is a true non-blocking socket. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62011 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 42 +++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index caed1088905..a9b0d7db7bf 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -805,24 +805,42 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, sfv[curvec].sfv_len = hdtr->trailers[i].iov_len; } - /* If we are in non-blocking mode, we need to make sure we wait until - * the other side says it is okay. */ - if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) == 1 || - apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) == 1) - { - rv = apr_wait_for_io_or_timeout(sock, 0); - } - /* Actually do the sendfilev */ do { /* socket, vecs, number of vecs, bytes written */ rv = sendfilev(sock->socketdes, sfv, vecs, &nbytes); } while (rv == -1 && errno == EINTR); - /* Solaris returns EAGAIN even though it sent bytes on a non-block sock */ - if (rv == -1 && errno != EAGAIN) { - rv = errno; - return rv; + /* Solaris returns EAGAIN even though it sent bytes on a non-block sock. + * However, if we are on a TIMEOUT socket, we want to block until the + * other side has read the data. + */ + if (rv == -1) + { + if (errno == EAGAIN) { + if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) == 1) + { + /* If the wait fails for some reason, we're going to lie to our + * caller and say that we didn't write any bytes. That's + * untrue. + */ + rv = apr_wait_for_io_or_timeout(sock, 0); + + /* Indicate that we sent zero bytes. */ + if (rv != APR_SUCCESS) + { + *len = 0; + return rv; + } + } + } + else + { + /* Indicate that we sent zero bytes. */ + rv = errno; + *len = 0; + return rv; + } } /* Update how much we sent */ From 8b1c4e948c6c640258f0fecf9cddc4ed348889ff Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 24 Jul 2001 16:53:40 +0000 Subject: [PATCH 2017/7878] Move the blocking logic on FreeBSD to match everyone else to be after the sendfile() call rather than before. Redid the comment to make a bit more sense given its new location. Someone who has FreeBSD will need to make sure this still works as expected. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62012 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 41 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index a9b0d7db7bf..c7c9bb0eb7d 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -410,26 +410,6 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, headerstruct.trl_cnt = hdtr->numtrailers; /* FreeBSD can send the headers/footers as part of the system call */ - if (sock->timeout >= 0) { - /* On FreeBSD, it is possible for the first call to sendfile to - * get EAGAIN, but still send some data. This means that we cannot - * call sendfile and then check for EAGAIN, and then wait and call - * sendfile again. If we do that, then we are likely to send the - * first chunk of data twice, once in the first call and once in the - * second. If we are using a timed write, then we check to make sure - * we can send data before trying to send it. - * - * JLT: doing this first doesn't eliminate the possibility that - * we get -1/EAGAIN/nbytes>0; AFAICT it just means extra syscalls - * from time to time - */ - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } - } - do { if (bytes_to_send) { /* We won't dare call sendfile() if we don't have @@ -467,6 +447,27 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, } } while (rv == -1 && errno == EINTR); + /* On FreeBSD, it is possible that sendfile will return EAGAIN, but + * still send some data. This means that we cannot call sendfile + * and then check for EAGAIN, and then wait and call sendfile again. + * If we do that, then we are likely to send the first chunk of data + * twice, once in the first call and once in the second. + * + * When we are dealing with a non-blocking or timeout socket, the + * caller must already be aware that we may not be able to write + * everything in one call. Therefore, we should return back to + * the caller with how much we actually sent (as specified from EAGAIN). + * + * If we are using a timed write, we will now block until we are clear. + */ + if (errno == EAGAIN && nbytes && sock->timeout >= 0) { + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } + } + (*len) = nbytes; if (rv == -1) { return errno; From 2de9ebb0524e1285c91cccee1333b05cd654e2b5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 24 Jul 2001 20:20:02 +0000 Subject: [PATCH 2018/7878] Bring the naming conventions more inline with unix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62013 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/thread.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index e3384093532..45aa0538a7f 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -89,7 +89,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) return APR_NOTDETACH; } -void *dummy_func(void *opaque) +static void *dummy_worker(void *opaque) { apr_thread_t *thd = (apr_thread_t *)opaque; return thd->func(thd, thd->data); @@ -122,8 +122,9 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, /* Use 0 for Thread Stack Size, because that will default the stack to the * same size as the calling thread. */ - if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, (unsigned int (APR_THREAD_FUNC *)(void *))dummy_func, - (*new), 0, &temp)) == 0) { + if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, + (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker, + (*new), 0, &temp)) == 0) { lasterror = apr_get_os_error(); return APR_EEXIST; /* MSVC++ doc doesn't mention any additional error info From 230029afc3296893c2b961cb1317d8537cceda30 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 24 Jul 2001 22:18:34 +0000 Subject: [PATCH 2019/7878] This is a hack but it get beos working again. This will probably have to stay until be fix the implementation as everything else I've tried didn't work. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62014 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 4df541acb4b..644906acba3 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -393,7 +393,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, apr_sockaddr_t *cursa; int curaddr; #if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ - defined(HAVE_GETHOSTBYNAME_R) + defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) char tmp[GETHOSTBYNAME_BUFLEN]; int hosterror; struct hostent hs; @@ -414,7 +414,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, else { #endif #if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ - defined(HAVE_GETHOSTBYNAME_R) + defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) hp = gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hosterror); #else @@ -425,7 +425,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, #ifdef WIN32 apr_get_netos_error(); #elif APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ - defined(HAVE_GETHOSTBYNAME_R) + defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) /* If you see ERANGE, that means GETHOSBYNAME_BUFLEN needs to be * bumped. */ return (hosterror + APR_OS_START_SYSERR); From 0d09945e3a9e51ac3c31d30663e03e76317527e9 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 24 Jul 2001 22:55:28 +0000 Subject: [PATCH 2020/7878] Reduce CPU consumption in conv_10 function, used to format "%d" by apr_*printf This includes two changes to APR: * new functions apr_itoa, apr_ltoa, and apr_off_t_toa that provide itoa-type functionality based on pools * Inline code in inet_ntop4 to replace sprintf for converting binary IP addresses into dotted-decimal format and two changes to Apache: * use the apr_itoa functions in setting the content length, in place of apr_psprintf * use the apr_itoa functions to replace frequent uses of 'sprintf("%d",...)' in mod_log_config. Submitted by: Brian Pane Reviewed by: Dean Gaudet, Greg Ames git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62015 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++ include/apr_strings.h | 27 ++++++++++++++ network_io/unix/inet_ntop.c | 31 ++++++++++++---- strings/apr_strings.c | 72 +++++++++++++++++++++++++++++++++++++ 4 files changed, 127 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index d5e1cf2e489..00fa1da64c5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Provide new number conversion functions apr_itoa, apr_ltoa, and + apr_off_t_toa, and inline code in inet_ntop4, to reduce CPU + consumption. [Brian Pane] + *) Updated APR to pass the thread worker_function prototype (apr_thread_start_t) two parameters, the apr private data (apr_thread_t*) and the application private data (void*). diff --git a/include/apr_strings.h b/include/apr_strings.h index 0a053ac7cab..c11c58f8810 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -279,6 +279,33 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format, va_list ap); +/** + * create a string representation of an int, allocated from a pool + * @param p The pool from which to allocate + * @param n The number to format + * @return The string representation of the number + * @deffunc int apr_itoa(apr_pool_t *p, int n) + */ +APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n); + +/** + * create a string representation of a long, allocated from a pool + * @param p The pool from which to allocate + * @param n The number to format + * @return The string representation of the number + * @deffunc int apr_ltoa(apr_pool_t *p, long n) + */ +APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n); + +/** + * create a string representation of an apr_off_t, allocated from a pool + * @param p The pool from which to allocate + * @param n The number to format + * @return The string representation of the number + * @deffunc int apr_ltoa(apr_pool_t *p, apr_off_t n) + */ +APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); + #ifdef __cplusplus } #endif diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index 2655ac6bdc7..45536237d69 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -99,15 +99,32 @@ apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size) static const char * inet_ntop4(const unsigned char *src, char *dst, apr_size_t size) { - static const char fmt[] = "%u.%u.%u.%u"; - char tmp[sizeof "255.255.255.255"]; + const int MIN_SIZE = 16; /* space for 255.255.255.255\0 */ + int n = 0; + char *next = dst; - if (apr_snprintf(tmp, sizeof tmp, fmt, src[0], src[1], src[2], src[3]) > (int)size) { - errno = ENOSPC; - return (NULL); + if (size < MIN_SIZE) { + errno = ENOSPC; + return NULL; } - strcpy(dst, tmp); - return (dst); + do { + unsigned char u = *src++; + if (u > 99) { + *next++ = '0' + u/100; + u %= 100; + *next++ = '0' + u/10; + u %= 10; + } + else if (u > 9) { + *next++ = '0' + u/10; + u %= 10; + } + *next++ = '0' + u; + *next++ = '.'; + n++; + } while (n < 4); + *--next = 0; + return dst; } #if APR_HAVE_IPV6 diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 7bdc1ef99b5..f0cbb159f1c 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -163,3 +163,75 @@ void *memchr(const void *s, int c, size_t n) return NULL; } #endif + +APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n) +{ + const int BUFFER_SIZE = sizeof(int) * 3 + 2; + char *buf = apr_palloc(p, BUFFER_SIZE); + char *start = buf + BUFFER_SIZE - 1; + int negative; + if (n < 0) { + negative = 1; + n = -n; + } + else { + negative = 0; + } + *start = 0; + do { + *--start = '0' + (n % 10); + n /= 10; + } while (n); + if (negative) { + *--start = '-'; + } + return start; +} + +APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n) +{ + const int BUFFER_SIZE = sizeof(long) * 3 + 2; + char *buf = apr_palloc(p, BUFFER_SIZE); + char *start = buf + BUFFER_SIZE - 1; + int negative; + if (n < 0) { + negative = 1; + n = -n; + } + else { + negative = 0; + } + *start = 0; + do { + *--start = '0' + (n % 10); + n /= 10; + } while (n); + if (negative) { + *--start = '-'; + } + return start; +} + +APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, long n) +{ + const int BUFFER_SIZE = sizeof(apr_off_t) * 3 + 2; + char *buf = apr_palloc(p, BUFFER_SIZE); + char *start = buf + BUFFER_SIZE - 1; + int negative; + if (n < 0) { + negative = 1; + n = -n; + } + else { + negative = 0; + } + *start = 0; + do { + *--start = '0' + (n % 10); + n /= 10; + } while (n); + if (negative) { + *--start = '-'; + } + return start; +} From e81aa4e20a3ac37d4b0786083811a9b7190b238c Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 25 Jul 2001 00:33:05 +0000 Subject: [PATCH 2021/7878] Fix build breakage due to mismatch between function and prototype git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62016 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/apr_strings.c b/strings/apr_strings.c index f0cbb159f1c..2d0eda79026 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -212,7 +212,7 @@ APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n) return start; } -APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, long n) +APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n) { const int BUFFER_SIZE = sizeof(apr_off_t) * 3 + 2; char *buf = apr_palloc(p, BUFFER_SIZE); From 18f862720229ad3cf5a8c1a7c84dd955a72634c4 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 25 Jul 2001 05:27:32 +0000 Subject: [PATCH 2022/7878] Shush lame compiler warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62017 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index c7c9bb0eb7d..d74c3d6cfa7 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -781,7 +781,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, for (i = 0; i < hdtr->numheaders; i++, curvec++) { sfv[curvec].sfv_fd = SFV_FD_SELF; sfv[curvec].sfv_flag = 0; - sfv[curvec].sfv_off = hdtr->headers[i].iov_base; + sfv[curvec].sfv_off = (off_t)hdtr->headers[i].iov_base; sfv[curvec].sfv_len = hdtr->headers[i].iov_len; } @@ -802,7 +802,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, for (i = 0; i < hdtr->numtrailers; i++, curvec++) { sfv[curvec].sfv_fd = SFV_FD_SELF; sfv[curvec].sfv_flag = 0; - sfv[curvec].sfv_off = hdtr->trailers[i].iov_base; + sfv[curvec].sfv_off = (off_t)hdtr->trailers[i].iov_base; sfv[curvec].sfv_len = hdtr->trailers[i].iov_len; } From 443de57957a68468daa369f4420897603238dbee Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Wed, 25 Jul 2001 16:09:35 +0000 Subject: [PATCH 2023/7878] Change the size_t into apr_size_t (It causes problems on Solaris with gcc). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62018 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 5 +++-- strings/apr_cpystrn.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index c11c58f8810..c313c71f23c 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -198,9 +198,10 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) * destination string, we return a pointer to the terminating '\0' * to allow us to check for truncation. * - * @deffunc char *apr_cpystrn(char *dst, const char *src, size_t dst_size) + * @deffunc char *apr_cpystrn(char *dst, const char *src, apr_size_t dst_size) */ -APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, size_t dst_size); +APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, + apr_size_t dst_size); /** * Strip spaces from a string diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index 0ece3ed17db..85aa3f3ecdb 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -80,7 +80,7 @@ * apr_cpystrn() follows the same call structure as strncpy(). */ -APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, size_t dst_size) +APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, apr_size_t dst_size) { char *d, *end; From e920b7e55d1a9144112ed4302f3051d391a6b7fe Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 25 Jul 2001 18:01:01 +0000 Subject: [PATCH 2024/7878] Fix accept filters by making all the various macro names agree with each other. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62019 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 2 +- configure.in | 10 +++++----- include/apr.h.in | 2 +- include/apr.hw | 1 + include/apr_network_io.h | 6 +++--- network_io/unix/sockopt.c | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/acconfig.h b/acconfig.h index e63bac496bb..89909514e10 100644 --- a/acconfig.h +++ b/acconfig.h @@ -13,7 +13,7 @@ #undef HAVE_TRUERAND #undef HAVE_POLLIN #undef HAVE_isascii -#undef HAVE_SO_ACCEPT_FILTER +#undef HAVE_SO_ACCEPTFILTER /* Cross process serialization techniques */ #undef USE_FLOCK_SERIALIZE diff --git a/configure.in b/configure.in index 958778601ad..1461d90508f 100644 --- a/configure.in +++ b/configure.in @@ -1221,16 +1221,16 @@ if test "x$ac_cv_define_TCP_NOPUSH" = "xyes"; then have_corkable_tcp="1" fi -APR_CHECK_DEFINE(SO_ACCEPT_FILTER, sys/socket.h) -if test "x$ac_cv_define_SO_ACCEPT_FILTER" = "xyes"; then - accept_filter="1" +APR_CHECK_DEFINE(SO_ACCEPTFILTER, sys/socket.h) +if test "x$ac_cv_define_SO_ACCEPTFILTER" = "xyes"; then + acceptfilter="1" else - accept_filter="0" + acceptfilter="0" fi AC_SUBST(apr_tcp_nopush_flag) AC_SUBST(have_corkable_tcp) -AC_SUBST(accept_filter) +AC_SUBST(acceptfilter) AC_CHECK_FUNCS(set_h_errno) diff --git a/include/apr.h.in b/include/apr.h.in index ecea32d5a33..4f0364adb61 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -131,7 +131,7 @@ #define APR_HAS_XLATE @iconv@ #define APR_HAS_OTHER_CHILD @oc@ #define APR_HAS_DSO @aprdso@ -#define APR_HAS_SO_ACCEPT_FILTER @accept_filter@ +#define APR_HAS_SO_ACCEPTFILTER @acceptfilter@ #define APR_HAS_UNICODE_FS 0 #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 0 diff --git a/include/apr.hw b/include/apr.hw index 6c48487300d..40488a8844a 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -208,6 +208,7 @@ #define APR_HAS_XLATE 0 #define APR_HAS_OTHER_CHILD 1 #define APR_HAS_DSO 1 +#define APR_HAS_SO_ACCEPTFILTER 0 #define APR_HAS_UNICODE_FS 1 #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 1 diff --git a/include/apr_network_io.h b/include/apr_network_io.h index ea85e8e023a..f85a3fda571 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -790,7 +790,7 @@ APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char */ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa); -#ifdef APR_OS_ACCEPT_FILTER +#if APR_HAS_SO_ACCEPTFILTER /** * Set an OS level accept filter. * @param sock The socket to put the accept filter on. @@ -798,8 +798,8 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa); * @param args Any extra args to the accept filter. Passing NULL here removes * the accept filter. */ -apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char name[16], - char args[256 - 16]); +apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, + char *args); #endif /** diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 30dcdf2fe14..fdf8b8b4e98 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -290,7 +290,7 @@ apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) return APR_SUCCESS; } -#ifdef SO_ACCEPTFILTER +#if APR_HAS_SO_ACCEPTFILTER apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, char *args) { From 5e0b86069246b303036912fe27238cd22279e0cb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 25 Jul 2001 19:45:27 +0000 Subject: [PATCH 2025/7878] Yes, this is a bogus cast. It's necessary since win32 figures out the same calculation in apr_ltoa() is safe, but can't figure this out for an int64 value :( git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62020 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 2d0eda79026..d7ae082b64f 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -227,7 +227,7 @@ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n) } *start = 0; do { - *--start = '0' + (n % 10); + *--start = '0' + (char)(n % 10); n /= 10; } while (n); if (negative) { From 03a2a6ba0f1ab1313a785cf5be6420e36d824720 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 25 Jul 2001 19:47:50 +0000 Subject: [PATCH 2026/7878] Another bit of MSVC bogusness. Has to argue signedness with us, even though MIN_SIZE is a const value :( git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62021 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_ntop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index 45536237d69..51dbebbca4b 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -99,7 +99,7 @@ apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size) static const char * inet_ntop4(const unsigned char *src, char *dst, apr_size_t size) { - const int MIN_SIZE = 16; /* space for 255.255.255.255\0 */ + const apr_size_t MIN_SIZE = 16; /* space for 255.255.255.255\0 */ int n = 0; char *next = dst; From 4916b14f5409e001db47310f83e2205e7f5e6fbf Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 25 Jul 2001 20:59:29 +0000 Subject: [PATCH 2027/7878] fix some issues with apr_sendfile() for FreeBSD 1) checking when to call wait_for_io_or_timeout() it checked errno without checking rv it required that we already sent bytes (nbytes != 0) it checked timeout != 0 instead of timeout > 0 2) it didn't retry the sendfile() (or writev()) after a successful wait_for_io_or_timeout() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62022 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 55 ++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index d74c3d6cfa7..59fc96bc02e 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -447,25 +447,52 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, } } while (rv == -1 && errno == EINTR); - /* On FreeBSD, it is possible that sendfile will return EAGAIN, but - * still send some data. This means that we cannot call sendfile - * and then check for EAGAIN, and then wait and call sendfile again. - * If we do that, then we are likely to send the first chunk of data - * twice, once in the first call and once in the second. - * - * When we are dealing with a non-blocking or timeout socket, the - * caller must already be aware that we may not be able to write - * everything in one call. Therefore, we should return back to - * the caller with how much we actually sent (as specified from EAGAIN). - * - * If we are using a timed write, we will now block until we are clear. - */ - if (errno == EAGAIN && nbytes && sock->timeout >= 0) { + if (rv == -1 && + errno == EAGAIN && + sock->timeout > 0) { apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; } + else { + do { + if (bytes_to_send) { + /* We won't dare call sendfile() if we don't have + * header or file bytes to send because bytes_to_send == 0 + * means send the whole file. + */ + rv = sendfile(file->filedes, /* file to be sent */ + sock->socketdes, /* socket */ + *offset, /* where in the file to start */ + bytes_to_send, /* number of bytes to send */ + &headerstruct, /* Headers/footers */ + &nbytes, /* number of bytes written */ + flags); /* undefined, set to 0 */ + /* FreeBSD's sendfile can return -1/EAGAIN even if it + * sent bytes. Sanitize the result so we get normal EAGAIN + * semantics w.r.t. bytes sent. + */ + if (rv == -1 && errno == EAGAIN && nbytes) { + rv = 0; + } + } + else { + /* just trailer bytes... use writev() + */ + rv = writev(sock->socketdes, + hdtr->trailers, + hdtr->numtrailers); + if (rv > 0) { + nbytes = rv; + rv = 0; + } + else { + nbytes = 0; + } + } + } while (rv == -1 && errno == EINTR); + } } (*len) = nbytes; From 31821b05dcc51e559828509b2dfb45f47be2013e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 25 Jul 2001 21:32:45 +0000 Subject: [PATCH 2028/7878] Replace the very limited-use ap_send_size with apr_strfsize(), which works within a fixed buffer. I'm open to using the old ap_send_size() text formatting, but this result is one character shorter in size and equally readable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62023 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 11 +++++++++++ strings/apr_strings.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/include/apr_strings.h b/include/apr_strings.h index c313c71f23c..11969a7eccf 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -307,6 +307,17 @@ APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n); */ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); +/** + * Format a binary size (magnitiudes are 2^10 rather than 10^3) from an apr_off_t, + * as bytes, K, M, T, etc, to a four character compacted human readable string. + * @param size The size to format + * @param buf The 5 byte text buffer (counting the trailing null) + * @return The buf passed to apr_strfsize() + * @deffunc char *apr_strfsize(apr_off_t size, char *buf) + * @tip All negative sizes report ' - ', apr_strfsize only formats positive values. + */ +APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf); + #ifdef __cplusplus } #endif diff --git a/strings/apr_strings.c b/strings/apr_strings.c index d7ae082b64f..01ea9ff5f91 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -235,3 +235,37 @@ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n) } return start; } + +APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf) +{ + const char ord[] = "KMTPE"; + const char *o = ord; + int remain; + + if (size < 0) { + return strcpy(buf, " - "); + } + if (size < 973) { + sprintf(buf, "%3d ", (int) size, o); + return buf; + } + do { + remain = (int)(size & 1023); + size >>= 10; + if (size >= 973) { + ++o; + continue; + } + if (size < 9 || (size == 9 && remain < 973)) { + if ((remain = ((remain * 5) + 256) / 512) >= 10) + ++size, remain = 0; + sprintf(buf, "%d.%d%c", (int) size, remain, *o); + return buf; + } + if (remain >= 512) + ++size; + sprintf(buf, "%3d%c", (int) size, *o); + return buf; + } while (1); +} + From 0fee28f36d19f6031256c80bd6ae84b1e4fd919b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 26 Jul 2001 00:08:40 +0000 Subject: [PATCH 2029/7878] Fix our installation. We need to install APRVARS and all the MM stuff. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62024 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ Makefile.in | 5 +++++ configure.in | 3 +++ 3 files changed, 11 insertions(+) diff --git a/CHANGES b/CHANGES index 00fa1da64c5..5740b337eb6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Better installation. This makes us install the APRVARS file, + as well as MM. [Ryan Bloom] + *) Provide new number conversion functions apr_itoa, apr_ltoa, and apr_off_t_toa, and inline code in inet_ntop4, to reduce CPU consumption. [Brian Pane] diff --git a/Makefile.in b/Makefile.in index 2f06f03ce4c..cbcb1a472b0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -14,6 +14,7 @@ INCLUDES=-I$(INCDIR) -I$(INCDIR1) # SUBDIRS=@SUBDIRS@ CLEAN_SUBDIRS= . test build +INSTALL_SUBDIRS=@INSTALL_SUBDIRS@ TARGET_LIB = libapr.la TARGET_EXPORTS = apr.exports @@ -59,6 +60,10 @@ install: $(TARGET_LIB) ./build/mkdir.sh $(libdir); \ fi; \ $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(libdir) + $(LIBTOOL) --mode=install cp APRVARS $(libdir) + @for i in $(INSTALL_SUBDIRS); do \ + ( cd $$i ; $(MAKE) install ); \ + done $(TARGET_LIB): @for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \ diff --git a/configure.in b/configure.in index 1461d90508f..5049730b726 100644 --- a/configure.in +++ b/configure.in @@ -384,6 +384,9 @@ if test "$USE_MM" = "yes"; then APR_SUBDIR_CONFIG($config_subdirs) fi +INSTALL_SUBDIRS=$config_subdirs +AC_SUBST(INSTALL_SUBDIRS) + AC_MSG_CHECKING(for Shared memory support) AC_ARG_ENABLE(shmem, [ --enable-shmem Enable shared memory support in APR. ], From 96ea70129fedcc12c1c7dc4dc8a6390b355747cc Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Thu, 26 Jul 2001 03:11:00 +0000 Subject: [PATCH 2030/7878] Silence warnings: - sprintf() was used without including stdio.h (fixed by using apr_want.h) - too many arguments to sprintf() for the format string given git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62025 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strings.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 01ea9ff5f91..e8a1c2f2667 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -57,15 +57,13 @@ #include "apr_general.h" #include "apr_private.h" #include "apr_lib.h" +#define APR_WANT_STDIO +#define APR_WANT_STRFUNC +#include "apr_want.h" + #ifdef HAVE_STDDEF_H #include /* NULL */ #endif -#if APR_HAVE_STRING_H -#include -#endif -#if APR_HAVE_STRINGS_H -#include -#endif APR_DECLARE(char *) apr_pstrdup(apr_pool_t *a, const char *s) { @@ -246,7 +244,7 @@ APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf) return strcpy(buf, " - "); } if (size < 973) { - sprintf(buf, "%3d ", (int) size, o); + sprintf(buf, "%3d ", (int) size); return buf; } do { From d6f7842ca0ab350b59386b278707b2dcfc7519ad Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Thu, 26 Jul 2001 03:33:21 +0000 Subject: [PATCH 2031/7878] I did a recursive grep for "#ifdef APR_" and am cleaning up what I found. =-) PS: How did that "#endif APR_HAS_UNICODE_FS" thing ever compile? Does MSVC actually let you do that sort of thing? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62026 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 8 ++++---- user/win32/userinfo.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 6c3afb5fccf..d16ff3f7a23 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -409,7 +409,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, int isroot = 0; apr_status_t ident_rv = 0; apr_status_t rv; -#ifdef APR_HAS_UNICODE_FS +#if APR_HAS_UNICODE_FS apr_wchar_t wfname[APR_PATH_MAX]; #endif @@ -448,7 +448,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, wanted &= ~finfo->valid; } -#ifdef APR_HAS_UNICODE_FS +#if APR_HAS_UNICODE_FS if (os_level >= APR_WIN_NT) { if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) / sizeof(apr_wchar_t), fname)) @@ -530,7 +530,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * so go ask for the full path. */ if (os_level >= APR_WIN_NT) { -#ifdef APR_HAS_UNICODE_FS +#if APR_HAS_UNICODE_FS apr_wchar_t tmpname[APR_FILE_MAX]; apr_wchar_t *tmpoff; if (GetFullPathNameW(wfname, sizeof(tmpname) / sizeof(apr_wchar_t), @@ -562,7 +562,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, if (wanted &= ~finfo->valid) { /* Caller wants more than APR_FINFO_MIN | APR_FINFO_NAME */ -#ifdef APR_HAS_UNICODE_FS +#if APR_HAS_UNICODE_FS if (os_level >= APR_WIN_NT) return more_finfo(finfo, wfname, wanted, MORE_OF_WFSPEC, os_level); #endif diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 098755e4d9e..8636d174a26 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -164,7 +164,7 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use return APR_ENOENT; } else -#endif APR_HAS_UNICODE_FS +#endif /* APR_HAS_UNICODE_FS */ { keylen = sizeof(regkey); rv = RegQueryValueEx(key, "ProfileImagePath", NULL, &type, From 13386f1b8ef72a970bcb0368603ce4154e7be4fc Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Thu, 26 Jul 2001 03:59:24 +0000 Subject: [PATCH 2032/7878] I thought it was going to rain today, but it didn't. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62027 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/STATUS b/STATUS index ae05282f972..4b9bb60e692 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/07/17 05:43:53 $] +Last modified at [$Date: 2001/07/26 03:59:24 $] Release: @@ -131,14 +131,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * may be good to have a --disable-ipv6 configure option - * add a pool argument to setaside() to tell a bucket "do whatever - you need to do, to ensure that you survive as long as this - pool." Immortal and heap buckets never have work. File, socket, - mmap, pipe, and pool buckets can do nothing if the given pool is - equal to, or a descendent of the pool they are using. Apache's - core_output_filter can then say "setside(conn->pool)" to ensure - that a saved brigade will last as long as the connection. - * APR memory code - code has been added but we still need to - decide on a better name for the code - reformat to APR style (think this is now done, but some tabs left) From c11d90f3b5ede36461aac44c93e60967a0a5bada Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 26 Jul 2001 14:58:37 +0000 Subject: [PATCH 2033/7878] tweak FreeBSD's apr_sendfile to shrink the object code size. This is what is running on daedalus now (minus the trap for our once-every-three-days-or-so core dump). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62028 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 58 ++++++++------------------------------ 1 file changed, 12 insertions(+), 46 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 59fc96bc02e..ac76c978289 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -430,7 +430,12 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, if (rv == -1 && errno == EAGAIN && nbytes) { rv = 0; } - } + + /* ??? performance: if rv == 0 is the most common case, + * we may want to return here and avoid a potential + * i-cache miss. + */ + } else { /* just trailer bytes... use writev() */ @@ -445,55 +450,16 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, nbytes = 0; } } - } while (rv == -1 && errno == EINTR); - if (rv == -1 && errno == EAGAIN && sock->timeout > 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } - else { - do { - if (bytes_to_send) { - /* We won't dare call sendfile() if we don't have - * header or file bytes to send because bytes_to_send == 0 - * means send the whole file. - */ - rv = sendfile(file->filedes, /* file to be sent */ - sock->socketdes, /* socket */ - *offset, /* where in the file to start */ - bytes_to_send, /* number of bytes to send */ - &headerstruct, /* Headers/footers */ - &nbytes, /* number of bytes written */ - flags); /* undefined, set to 0 */ - /* FreeBSD's sendfile can return -1/EAGAIN even if it - * sent bytes. Sanitize the result so we get normal EAGAIN - * semantics w.r.t. bytes sent. - */ - if (rv == -1 && errno == EAGAIN && nbytes) { - rv = 0; - } - } - else { - /* just trailer bytes... use writev() - */ - rv = writev(sock->socketdes, - hdtr->trailers, - hdtr->numtrailers); - if (rv > 0) { - nbytes = rv; - rv = 0; - } - else { - nbytes = 0; - } - } - } while (rv == -1 && errno == EINTR); + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } } - } + } while (rv == -1 && (errno == EINTR || errno == EAGAIN)); (*len) = nbytes; if (rv == -1) { From 09c975b25386fb2b9e0dcd94671a68aa4d2ec185 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 26 Jul 2001 15:03:16 +0000 Subject: [PATCH 2034/7878] Do the "right" thing with inherit macros when SMS is enabled. This highlights the one major difference between pools and SMS - the cleanups are different. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62029 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/inherit.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/arch/unix/inherit.h b/include/arch/unix/inherit.h index 394c2cd5b99..d268bfa2a41 100644 --- a/include/arch/unix/inherit.h +++ b/include/arch/unix/inherit.h @@ -59,6 +59,7 @@ #define APR_INHERIT (2^24) /* Must not conflicts with other bits */ +#ifndef APR_POOLS_ARE_SMS #define APR_IMPLEMENT_SET_INHERIT(name, flag, pool, cleanup) \ void apr_##name##_set_inherit(apr_##name##_t *name) \ { \ @@ -68,7 +69,19 @@ void apr_##name##_set_inherit(apr_##name##_t *name) \ cleanup, apr_pool_cleanup_null); \ } \ } +#else +#define APR_IMPLEMENT_SET_INHERIT(name, flag, pool, cleanup) \ +void apr_##name##_set_inherit(apr_##name##_t *name) \ +{ \ + if (!(name->flag & APR_INHERIT)) { \ + name->flag |= APR_INHERIT; \ + apr_sms_cleanup_unregister(name->pool, APR_CHILD_CLEANUP, \ + (void *)name, cleanup); \ + } \ +} +#endif +#ifndef APR_POOLS_ARE_SMS #define APR_IMPLEMENT_UNSET_INHERIT(name, flag, pool, cleanup) \ void apr_##name##_unset_inherit(apr_##name##_t *name) \ { \ @@ -78,5 +91,16 @@ void apr_##name##_unset_inherit(apr_##name##_t *name) \ cleanup, cleanup); \ } \ } +#else +#define APR_IMPLEMENT_UNSET_INHERIT(name, flag, pool, cleanup) \ +void apr_##name##_unset_inherit(apr_##name##_t *name) \ +{ \ + if (name->flag & APR_INHERIT) { \ + name->flag &= ~APR_INHERIT; \ + apr_sms_cleanup_register(name->pool, APR_CHILD_CLEANUP, \ + (void *)name, cleanup); \ + } \ +} +#endif #endif /* ! INHERIT_H */ From 599f11b14ee658d38faaef20e214dfd98866f92f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 26 Jul 2001 15:39:25 +0000 Subject: [PATCH 2035/7878] Solve the make exports problems with these accessor wrappers by simply replacing with the proper declarations. [Brian Havard] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62030 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 4 ++-- include/apr_network_io.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index bb228a69382..c62ffe49233 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -575,14 +575,14 @@ APR_POOL_DECLARE_ACCESSOR(file); * @param file The file to enable inheritance. * @deffunc void apr_file_set_inherit(apr_file_t *file) */ -APR_DECLARE_SET_INHERIT(file); +APR_DECLARE(void) apr_file_set_inherit(apr_file_t *file); /** * Unset a file from being inherited by child processes. * @param file The file to disable inheritance. * @deffunc void apr_file_unset_inherit(apr_file_t *file) */ -APR_DECLARE_UNSET_INHERIT(file); +APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); #ifdef __cplusplus } diff --git a/include/apr_network_io.h b/include/apr_network_io.h index f85a3fda571..9441abc7d66 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -807,14 +807,14 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, * @param socket The socket to enable inheritance. * @deffunc void apr_socket_set_inherit(apr_socket_t *socket) */ -APR_DECLARE_SET_INHERIT(socket); +APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *socket); /** * Unset a socket from being inherited by child processes. * @param socket The socket to disable inheritance. * @deffunc void apr_socket_unset_inherit(apr_socket_t *socket) */ -APR_DECLARE_UNSET_INHERIT(socket); +APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *socket); #ifdef __cplusplus } From 32ed4745a50c6ca0dc80c88efea0bf01b6cc3811 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 26 Jul 2001 15:58:57 +0000 Subject: [PATCH 2036/7878] Add appropriate APR_DECLARE's for signal functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62031 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_signal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_signal.h b/include/apr_signal.h index 940ed7e0d44..f6e43cb1e5e 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -75,7 +75,7 @@ extern "C" { typedef void apr_sigfunc_t(int); /* ### how to doc this? */ -apr_sigfunc_t *apr_signal(int signo, apr_sigfunc_t * func); +APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func); #if defined(SIG_IGN) && !defined(SIG_ERR) #define SIG_ERR ((apr_sigfunc_t *) -1) @@ -92,7 +92,7 @@ apr_sigfunc_t *apr_signal(int signo, apr_sigfunc_t * func); * @return The description of the signal * @deffunc const char *apr_signal_get_description(int signum) */ -const char *apr_signal_get_description(int signum); +APR_DECLARE(const char *) apr_signal_get_description(int signum); /** * APR-private function for initializing the signal package From d9d4b48c3306de91b02dd3d556d974f47381a4f8 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 26 Jul 2001 16:08:21 +0000 Subject: [PATCH 2037/7878] While we're tidying up warnings, fix this warning: implicit declaration of function `strncmp' git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62032 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 4573e20f433..22eb45ee455 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -56,6 +56,8 @@ #include "fileio.h" #include "apr_file_io.h" #include "apr_strings.h" +#define APR_WANT_STRFUNC +#include "apr_want.h" #if APR_HAVE_UNISTD_H #include #endif From df185c0e6ee3190ad30268a0cbdb9a88fa115093 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 26 Jul 2001 17:11:04 +0000 Subject: [PATCH 2038/7878] Cleanup Solaris 8 sendfilev() logic to actually behave similarly to the others (i.e. repeat the sendfile if we got EAGAIN and didn't send any bytes). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62033 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 63 +++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index ac76c978289..304be1b3dc9 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -752,10 +752,10 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags) { - apr_status_t rv; + apr_status_t rv, arv; size_t nbytes; sendfilevec_t *sfv; - int vecs, curvec, i; + int vecs, curvec, i, repeat; if (!hdtr) { hdtr = &no_hdtr; @@ -799,42 +799,49 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, sfv[curvec].sfv_len = hdtr->trailers[i].iov_len; } - /* Actually do the sendfilev */ + /* Actually do the sendfilev + * + * Solaris may return -1/EAGAIN even if it sent bytes on a non-block sock. + * + * If no bytes were originally sent (nbytes == 0) and we are on a TIMEOUT + * socket (which as far as the OS is concerned is a non-blocking socket), + * we want to retry after waiting for the other side to read the data (as + * determined by poll). Once it is clear to send, we want to retry + * sending the sendfilevec_t once more. + */ + arv = 0; do { + /* Clear out the repeat */ + repeat = 0; + /* socket, vecs, number of vecs, bytes written */ rv = sendfilev(sock->socketdes, sfv, vecs, &nbytes); - } while (rv == -1 && errno == EINTR); - /* Solaris returns EAGAIN even though it sent bytes on a non-block sock. - * However, if we are on a TIMEOUT socket, we want to block until the - * other side has read the data. - */ - if (rv == -1) - { - if (errno == EAGAIN) { - if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) == 1) + if (rv == -1 && errno == EAGAIN) + { + if (nbytes) + rv = 0; + else if (!arv && + apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) == 1) { - /* If the wait fails for some reason, we're going to lie to our - * caller and say that we didn't write any bytes. That's - * untrue. - */ - rv = apr_wait_for_io_or_timeout(sock, 0); - - /* Indicate that we sent zero bytes. */ - if (rv != APR_SUCCESS) + apr_status_t t = apr_wait_for_io_or_timeout(sock, 0); + + if (t != APR_SUCCESS) { *len = 0; - return rv; + return t; } + + arv = 1; + repeat = 1; } } - else - { - /* Indicate that we sent zero bytes. */ - rv = errno; - *len = 0; - return rv; - } + } while ((rv == -1 && errno == EINTR) || repeat); + + if (rv == -1) + { + *len = 0; + return errno; } /* Update how much we sent */ From 7842b61d44ac6d1b3756f3a2c5988831053fd028 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 26 Jul 2001 17:26:38 +0000 Subject: [PATCH 2039/7878] Update make files for Win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62034 13f79535-47bb-0310-9956-ffa450edef68 --- apr.mak | 925 +++++++++++++++++++++++++++-------------------------- libapr.mak | 905 +++++++++++++++++++++++++-------------------------- 2 files changed, 900 insertions(+), 930 deletions(-) diff --git a/apr.mak b/apr.mak index 0fade9cf5b0..37761c6d69d 100644 --- a/apr.mak +++ b/apr.mak @@ -408,247 +408,291 @@ LIB32_OBJS= \ !IF "$(CFG)" == "apr - Win32 Release" || "$(CFG)" == "apr - Win32 Debug" -SOURCE=.\time\win32\access.c -DEP_CPP_ACCES=\ +SOURCE=.\dso\win32\dso.c +DEP_CPP_DSO_C=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_lib.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\atime.h"\ + ".\include\arch\win32\dso.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\access.obj" : $(SOURCE) $(DEP_CPP_ACCES) "$(INTDIR)"\ - ".\include\apr.h" +"$(INTDIR)\dso.obj" : $(SOURCE) $(DEP_CPP_DSO_C) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\time\win32\time.c -DEP_CPP_TIME_=\ +SOURCE=.\file_io\win32\dir.c +DEP_CPP_DIR_C=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ - ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\time\win32\timestr.c -DEP_CPP_TIMES=\ +SOURCE=.\file_io\unix\fileacc.c +DEP_CPP_FILEA=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\atime.h"\ - - -"$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -SOURCE=.\strings\apr_cpystrn.c -DEP_CPP_APR_C=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_pools.h"\ - ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\arch\win32\apr_private.h"\ - - -"$(INTDIR)\apr_cpystrn.obj" : $(SOURCE) $(DEP_CPP_APR_C) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -SOURCE=.\strings\apr_fnmatch.c -DEP_CPP_APR_F=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_fnmatch.h"\ - ".\include\apr_lib.h"\ - ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\apr_fnmatch.obj" : $(SOURCE) $(DEP_CPP_APR_F) "$(INTDIR)"\ +"$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\strings\apr_snprintf.c -DEP_CPP_APR_S=\ +SOURCE=.\file_io\win32\filedup.c +DEP_CPP_FILED=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ - ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\inherit.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_S) "$(INTDIR)"\ +"$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\strings\apr_strings.c -DEP_CPP_APR_ST=\ +SOURCE=.\file_io\win32\filepath.c +DEP_CPP_FILEP=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_lib.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\apr_strings.obj" : $(SOURCE) $(DEP_CPP_APR_ST) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -SOURCE=.\strings\apr_strnatcmp.c -DEP_CPP_APR_STR=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_pools.h"\ - ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - - -"$(INTDIR)\apr_strnatcmp.obj" : $(SOURCE) $(DEP_CPP_APR_STR) "$(INTDIR)"\ +"$(INTDIR)\filepath.obj" : $(SOURCE) $(DEP_CPP_FILEP) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\strings\apr_strtok.c -DEP_CPP_APR_STRT=\ +SOURCE=.\file_io\win32\filestat.c +DEP_CPP_FILES=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ ".\include\apr_want.h"\ - - -"$(INTDIR)\apr_strtok.obj" : $(SOURCE) $(DEP_CPP_APR_STRT) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -SOURCE=.\passwd\apr_getpass.c -DEP_CPP_APR_G=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_pools.h"\ - ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\apr_getpass.obj" : $(SOURCE) $(DEP_CPP_APR_G) "$(INTDIR)"\ +"$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\passwd\apr_md5.c -DEP_CPP_APR_M=\ +SOURCE=.\file_io\win32\flock.c +DEP_CPP_FLOCK=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_md5.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\apr_md5.obj" : $(SOURCE) $(DEP_CPP_APR_M) "$(INTDIR)"\ +"$(INTDIR)\flock.obj" : $(SOURCE) $(DEP_CPP_FLOCK) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\tables\apr_hash.c -DEP_CPP_APR_H=\ +SOURCE=.\file_io\unix\fullrw.c +DEP_CPP_FULLR=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ - ".\include\apr_general.h"\ - ".\include\apr_hash.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_pools.h"\ ".\include\apr_sms.h"\ - ".\include\arch\win32\apr_private.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ -"$(INTDIR)\apr_hash.obj" : $(SOURCE) $(DEP_CPP_APR_H) "$(INTDIR)"\ +"$(INTDIR)\fullrw.obj" : $(SOURCE) $(DEP_CPP_FULLR) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\tables\apr_tables.c -DEP_CPP_APR_T=\ +SOURCE=.\file_io\win32\open.c +DEP_CPP_OPEN_=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_lib.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\apr_tables.obj" : $(SOURCE) $(DEP_CPP_APR_T) "$(INTDIR)"\ - ".\include\apr.h" +"$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\unix\errorcodes.c -DEP_CPP_ERROR=\ +SOURCE=.\file_io\win32\pipe.c +DEP_CPP_PIPE_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -657,28 +701,30 @@ DEP_CPP_ERROR=\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ - ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\errorcodes.obj" : $(SOURCE) $(DEP_CPP_ERROR) "$(INTDIR)"\ - ".\include\apr.h" +"$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\unix\getopt.c -DEP_CPP_GETOP=\ +SOURCE=.\file_io\win32\readwrite.c +DEP_CPP_READW=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -687,39 +733,33 @@ DEP_CPP_GETOP=\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ + ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -SOURCE=.\misc\win32\getuuid.c -DEP_CPP_GETUU=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_uuid.h"\ - - -"$(INTDIR)\getuuid.obj" : $(SOURCE) $(DEP_CPP_GETUU) "$(INTDIR)"\ +"$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\win32\misc.c -DEP_CPP_MISC_=\ +SOURCE=.\file_io\win32\seek.c +DEP_CPP_SEEK_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -733,232 +773,207 @@ DEP_CPP_MISC_=\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\misc.obj" : $(SOURCE) $(DEP_CPP_MISC_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\win32\names.c -DEP_CPP_NAMES=\ +SOURCE=.\i18n\unix\utf8_ucs2.c +DEP_CPP_UTF8_=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ - ".\include\apr_inherit.h"\ - ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ - ".\include\arch\win32\apr_private.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ -"$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"\ +"$(INTDIR)\utf8_ucs2.obj" : $(SOURCE) $(DEP_CPP_UTF8_) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\unix\otherchild.c -DEP_CPP_OTHER=\ +SOURCE=.\i18n\unix\xlate.c +SOURCE=.\locks\win32\locks.c +DEP_CPP_LOCKS=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_tables.h"\ + ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ - ".\include\arch\win32\threadproc.h"\ + ".\include\arch\win32\locks.h"\ -"$(INTDIR)\otherchild.obj" : $(SOURCE) $(DEP_CPP_OTHER) "$(INTDIR)"\ +"$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\win32\rand.c -DEP_CPP_RAND_=\ +SOURCE=.\memory\unix\apr_pools.c +DEP_CPP_APR_P=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_hash.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ -"$(INTDIR)\rand.obj" : $(SOURCE) $(DEP_CPP_RAND_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ + ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\unix\start.c -DEP_CPP_START=\ +SOURCE=.\memory\unix\apr_sms.c +DEP_CPP_APR_S=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ + ".\include\apr_hash.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ - ".\include\apr_signal.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\arch\unix\misc.h"\ - ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\locks.h"\ + ".\memory\unix\sms_private.h"\ -"$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"\ +"$(INTDIR)\apr_sms.obj" : $(SOURCE) $(DEP_CPP_APR_S) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\unix\uuid.c -DEP_CPP_UUID_=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_uuid.h"\ - - -"$(INTDIR)\uuid.obj" : $(SOURCE) $(DEP_CPP_UUID_) "$(INTDIR)" ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -SOURCE=.\file_io\win32\dir.c -DEP_CPP_DIR_C=\ +SOURCE=.\memory\unix\apr_sms_blocks.c +DEP_CPP_APR_SM=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ + ".\include\apr_sms_blocks.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\atime.h"\ - ".\include\arch\win32\fileio.h"\ + ".\memory\unix\sms_private.h"\ -"$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\apr_sms_blocks.obj" : $(SOURCE) $(DEP_CPP_APR_SM) "$(INTDIR)"\ + ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\unix\fileacc.c -DEP_CPP_FILEA=\ +SOURCE=.\memory\unix\apr_sms_std.c +DEP_CPP_APR_SMS=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ + ".\memory\unix\sms_private.h"\ -"$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"\ +"$(INTDIR)\apr_sms_std.obj" : $(SOURCE) $(DEP_CPP_APR_SMS) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\filedup.c -DEP_CPP_FILED=\ +SOURCE=.\memory\unix\apr_sms_tracking.c +DEP_CPP_APR_SMS_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ + ".\include\apr_sms_tracking.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\inherit.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ + ".\memory\unix\sms_private.h"\ -"$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"\ +"$(INTDIR)\apr_sms_tracking.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\filepath.c -DEP_CPP_FILEP=\ +SOURCE=.\misc\unix\errorcodes.c +DEP_CPP_ERROR=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -967,31 +982,28 @@ DEP_CPP_FILEP=\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ + ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\filepath.obj" : $(SOURCE) $(DEP_CPP_FILEP) "$(INTDIR)"\ +"$(INTDIR)\errorcodes.obj" : $(SOURCE) $(DEP_CPP_ERROR) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\filestat.c -DEP_CPP_FILES=\ +SOURCE=.\misc\unix\getopt.c +DEP_CPP_GETOP=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -1006,26 +1018,33 @@ DEP_CPP_FILES=\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\atime.h"\ - ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"\ +"$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\flock.c -DEP_CPP_FLOCK=\ +SOURCE=.\misc\win32\getuuid.c +DEP_CPP_GETUU=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_uuid.h"\ + + +"$(INTDIR)\getuuid.obj" : $(SOURCE) $(DEP_CPP_GETUU) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\win32\misc.c +DEP_CPP_MISC_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -1039,44 +1058,43 @@ DEP_CPP_FLOCK=\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\flock.obj" : $(SOURCE) $(DEP_CPP_FLOCK) "$(INTDIR)"\ - ".\include\apr.h" +"$(INTDIR)\misc.obj" : $(SOURCE) $(DEP_CPP_MISC_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\unix\fullrw.c -DEP_CPP_FULLR=\ +SOURCE=.\misc\win32\names.c +DEP_CPP_NAMES=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ ".\include\apr_inherit.h"\ + ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ -"$(INTDIR)\fullrw.obj" : $(SOURCE) $(DEP_CPP_FULLR) "$(INTDIR)"\ +"$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\open.c -DEP_CPP_OPEN_=\ +SOURCE=.\misc\unix\otherchild.c +DEP_CPP_OTHER=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -1090,7 +1108,6 @@ DEP_CPP_OPEN_=\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1101,46 +1118,30 @@ DEP_CPP_OPEN_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\otherchild.obj" : $(SOURCE) $(DEP_CPP_OTHER) "$(INTDIR)"\ + ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\pipe.c -DEP_CPP_PIPE_=\ +SOURCE=.\misc\win32\rand.c +DEP_CPP_RAND_=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ - ".\include\apr_inherit.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ - ".\include\apr_thread_proc.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\rand.obj" : $(SOURCE) $(DEP_CPP_RAND_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\readwrite.c -DEP_CPP_READW=\ +SOURCE=.\misc\unix\start.c +DEP_CPP_START=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -1149,87 +1150,88 @@ DEP_CPP_READW=\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ - ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_signal.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\atime.h"\ - ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\locks.h"\ -"$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"\ +"$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\seek.c -DEP_CPP_SEEK_=\ +SOURCE=.\misc\unix\uuid.c +DEP_CPP_UUID_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_uuid.h"\ + + +"$(INTDIR)\uuid.obj" : $(SOURCE) $(DEP_CPP_UUID_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\mmap\unix\common.c +DEP_CPP_COMMO=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ + ".\include\apr_mmap.h"\ ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_tables.h"\ - ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\common.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ + ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\locks\win32\locks.c -DEP_CPP_LOCKS=\ +SOURCE=.\mmap\win32\mmap.c +DEP_CPP_MMAP_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ + ".\include\apr_mmap.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\locks.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"\ - ".\include\apr.h" +"$(INTDIR)\mmap.obj" : $(SOURCE) $(DEP_CPP_MMAP_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) @@ -1384,19 +1386,107 @@ DEP_CPP_SOCKE=\ ".\include\arch\win32\networkio.h"\ -"$(INTDIR)\sockets.obj" : $(SOURCE) $(DEP_CPP_SOCKE) "$(INTDIR)"\ +"$(INTDIR)\sockets.obj" : $(SOURCE) $(DEP_CPP_SOCKE) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\network_io\win32\sockopt.c +DEP_CPP_SOCKO=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\networkio.h"\ + + +"$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\passwd\apr_getpass.c +DEP_CPP_APR_G=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\arch\win32\apr_private.h"\ + + +"$(INTDIR)\apr_getpass.obj" : $(SOURCE) $(DEP_CPP_APR_G) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\passwd\apr_md5.c +DEP_CPP_APR_M=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_md5.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\win32\apr_private.h"\ + + +"$(INTDIR)\apr_md5.obj" : $(SOURCE) $(DEP_CPP_APR_M) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\shmem\win32\shmem.c +SOURCE=.\strings\apr_cpystrn.c +DEP_CPP_APR_C=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\arch\win32\apr_private.h"\ + + +"$(INTDIR)\apr_cpystrn.obj" : $(SOURCE) $(DEP_CPP_APR_C) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\strings\apr_fnmatch.c +DEP_CPP_APR_F=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_fnmatch.h"\ + ".\include\apr_lib.h"\ + ".\include\arch\win32\apr_private.h"\ + + +"$(INTDIR)\apr_fnmatch.obj" : $(SOURCE) $(DEP_CPP_APR_F) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\network_io\win32\sockopt.c -DEP_CPP_SOCKO=\ +SOURCE=.\strings\apr_snprintf.c +DEP_CPP_APR_SN=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ ".\include\apr_inherit.h"\ + ".\include\apr_lib.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_sms.h"\ @@ -1404,138 +1494,98 @@ DEP_CPP_SOCKO=\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\arch\win32\networkio.h"\ + ".\include\arch\win32\apr_private.h"\ -"$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"\ +"$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_SN) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\threadproc\win32\proc.c -DEP_CPP_PROC_=\ +SOURCE=.\strings\apr_strings.c +DEP_CPP_APR_ST=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ - ".\include\apr_inherit.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ + ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ - ".\include\apr_thread_proc.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ - ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\apr_strings.obj" : $(SOURCE) $(DEP_CPP_APR_ST) "$(INTDIR)"\ + ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\threadproc\win32\signals.c -DEP_CPP_SIGNA=\ +SOURCE=.\strings\apr_strnatcmp.c +DEP_CPP_APR_STR=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ - ".\include\apr_inherit.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ + ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_tables.h"\ - ".\include\apr_thread_proc.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ + ".\include\apr_strings.h"\ + + +"$(INTDIR)\apr_strnatcmp.obj" : $(SOURCE) $(DEP_CPP_APR_STR) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\strings\apr_strtok.c +DEP_CPP_APR_STRT=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ - ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ - ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"\ +"$(INTDIR)\apr_strtok.obj" : $(SOURCE) $(DEP_CPP_APR_STRT) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\threadproc\win32\thread.c -DEP_CPP_THREA=\ +SOURCE=.\tables\apr_hash.c +DEP_CPP_APR_H=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_inherit.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ + ".\include\apr_hash.h"\ ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_thread_proc.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"\ +"$(INTDIR)\apr_hash.obj" : $(SOURCE) $(DEP_CPP_APR_H) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\threadproc\win32\threadpriv.c -DEP_CPP_THREAD=\ +SOURCE=.\tables\apr_tables.c +DEP_CPP_APR_T=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_thread_proc.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"\ +"$(INTDIR)\apr_tables.obj" : $(SOURCE) $(DEP_CPP_APR_T) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\dso\win32\dso.c -DEP_CPP_DSO_C=\ +SOURCE=.\threadproc\win32\proc.c +DEP_CPP_PROC_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -1559,54 +1609,16 @@ DEP_CPP_DSO_C=\ ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\dso.h"\ ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\dso.obj" : $(SOURCE) $(DEP_CPP_DSO_C) "$(INTDIR)" ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -SOURCE=.\i18n\unix\utf8_ucs2.c -DEP_CPP_UTF8_=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_pools.h"\ - ".\include\apr_sms.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - - -"$(INTDIR)\utf8_ucs2.obj" : $(SOURCE) $(DEP_CPP_UTF8_) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -SOURCE=.\i18n\unix\xlate.c -SOURCE=.\shmem\win32\shmem.c -SOURCE=.\mmap\unix\common.c -DEP_CPP_COMMO=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ - ".\include\apr_inherit.h"\ - ".\include\apr_mmap.h"\ - ".\include\apr_pools.h"\ - ".\include\apr_sms.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ - ".\include\arch\win32\apr_private.h"\ - - -"$(INTDIR)\common.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ - ".\include\apr.h" +"$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\mmap\win32\mmap.c -DEP_CPP_MMAP_=\ +SOURCE=.\threadproc\win32\signals.c +DEP_CPP_SIGNA=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -1616,7 +1628,6 @@ DEP_CPP_MMAP_=\ ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ - ".\include\apr_mmap.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ @@ -1631,158 +1642,143 @@ DEP_CPP_MMAP_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\mmap.obj" : $(SOURCE) $(DEP_CPP_MMAP_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"\ + ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\user\win32\groupinfo.c -DEP_CPP_GROUP=\ +SOURCE=.\threadproc\win32\thread.c +DEP_CPP_THREA=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ ".\include\apr_inherit.h"\ + ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\groupinfo.obj" : $(SOURCE) $(DEP_CPP_GROUP) "$(INTDIR)"\ +"$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\user\win32\userinfo.c -DEP_CPP_USERI=\ +SOURCE=.\threadproc\win32\threadpriv.c +DEP_CPP_THREAD=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ + ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\ +"$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\memory\unix\apr_pools.c -DEP_CPP_APR_P=\ +SOURCE=.\time\win32\access.c +DEP_CPP_ACCES=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_hash.h"\ - ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ -"$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ +"$(INTDIR)\access.obj" : $(SOURCE) $(DEP_CPP_ACCES) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\memory\unix\apr_sms.c -DEP_CPP_APR_SM=\ +SOURCE=.\time\win32\time.c +DEP_CPP_TIME_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_hash.h"\ ".\include\apr_inherit.h"\ + ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\memory\unix\sms_private.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ -"$(INTDIR)\apr_sms.obj" : $(SOURCE) $(DEP_CPP_APR_SM) "$(INTDIR)"\ - ".\include\apr.h" +"$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\memory\unix\apr_sms_blocks.c -DEP_CPP_APR_SMS=\ +SOURCE=.\time\win32\timestr.c +DEP_CPP_TIMES=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_sms_blocks.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\memory\unix\sms_private.h"\ + ".\include\arch\win32\atime.h"\ -"$(INTDIR)\apr_sms_blocks.obj" : $(SOURCE) $(DEP_CPP_APR_SMS) "$(INTDIR)"\ +"$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\memory\unix\apr_sms_std.c -DEP_CPP_APR_SMS_=\ +SOURCE=.\user\win32\groupinfo.c +DEP_CPP_GROUP=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -1794,43 +1790,48 @@ DEP_CPP_APR_SMS_=\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\memory\unix\sms_private.h"\ -"$(INTDIR)\apr_sms_std.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_) "$(INTDIR)"\ +"$(INTDIR)\groupinfo.obj" : $(SOURCE) $(DEP_CPP_GROUP) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\memory\unix\apr_sms_tracking.c -DEP_CPP_APR_SMS_T=\ +SOURCE=.\user\win32\userinfo.c +DEP_CPP_USERI=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_sms_tracking.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\memory\unix\sms_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\apr_sms_tracking.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_T) "$(INTDIR)"\ +"$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) diff --git a/libapr.mak b/libapr.mak index 4ef6c31c49f..74ecee541d6 100644 --- a/libapr.mak +++ b/libapr.mak @@ -56,7 +56,6 @@ CLEAN : -@erase "$(INTDIR)\apr_sms_blocks.obj" -@erase "$(INTDIR)\apr_sms_std.obj" -@erase "$(INTDIR)\apr_sms_tracking.obj" - -@erase "$(INTDIR)\apr_sms_trivial.obj" -@erase "$(INTDIR)\apr_snprintf.obj" -@erase "$(INTDIR)\apr_strings.obj" -@erase "$(INTDIR)\apr_strnatcmp.obj" @@ -172,7 +171,6 @@ LINK32_OBJS= \ "$(INTDIR)\apr_sms_blocks.obj" \ "$(INTDIR)\apr_sms_std.obj" \ "$(INTDIR)\apr_sms_tracking.obj" \ - "$(INTDIR)\apr_sms_trivial.obj" \ "$(INTDIR)\apr_snprintf.obj" \ "$(INTDIR)\apr_strings.obj" \ "$(INTDIR)\apr_strnatcmp.obj" \ @@ -256,7 +254,6 @@ CLEAN : -@erase "$(INTDIR)\apr_sms_blocks.obj" -@erase "$(INTDIR)\apr_sms_std.obj" -@erase "$(INTDIR)\apr_sms_tracking.obj" - -@erase "$(INTDIR)\apr_sms_trivial.obj" -@erase "$(INTDIR)\apr_snprintf.obj" -@erase "$(INTDIR)\apr_strings.obj" -@erase "$(INTDIR)\apr_strnatcmp.obj" @@ -373,7 +370,6 @@ LINK32_OBJS= \ "$(INTDIR)\apr_sms_blocks.obj" \ "$(INTDIR)\apr_sms_std.obj" \ "$(INTDIR)\apr_sms_tracking.obj" \ - "$(INTDIR)\apr_sms_trivial.obj" \ "$(INTDIR)\apr_snprintf.obj" \ "$(INTDIR)\apr_strings.obj" \ "$(INTDIR)\apr_strnatcmp.obj" \ @@ -429,247 +425,291 @@ LINK32_OBJS= \ !IF "$(CFG)" == "libapr - Win32 Release" || "$(CFG)" == "libapr - Win32 Debug" -SOURCE=.\time\win32\access.c -DEP_CPP_ACCES=\ +SOURCE=.\dso\win32\dso.c +DEP_CPP_DSO_C=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_lib.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\atime.h"\ + ".\include\arch\win32\dso.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\access.obj" : $(SOURCE) $(DEP_CPP_ACCES) "$(INTDIR)"\ - ".\include\apr.h" +"$(INTDIR)\dso.obj" : $(SOURCE) $(DEP_CPP_DSO_C) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\time\win32\time.c -DEP_CPP_TIME_=\ +SOURCE=.\file_io\win32\dir.c +DEP_CPP_DIR_C=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ - ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\atime.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\time\win32\timestr.c -DEP_CPP_TIMES=\ +SOURCE=.\file_io\unix\fileacc.c +DEP_CPP_FILEA=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\atime.h"\ - - -"$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -SOURCE=.\strings\apr_cpystrn.c -DEP_CPP_APR_C=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_pools.h"\ - ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\arch\win32\apr_private.h"\ - - -"$(INTDIR)\apr_cpystrn.obj" : $(SOURCE) $(DEP_CPP_APR_C) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -SOURCE=.\strings\apr_fnmatch.c -DEP_CPP_APR_F=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_fnmatch.h"\ - ".\include\apr_lib.h"\ - ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\apr_fnmatch.obj" : $(SOURCE) $(DEP_CPP_APR_F) "$(INTDIR)"\ +"$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\strings\apr_snprintf.c -DEP_CPP_APR_S=\ +SOURCE=.\file_io\win32\filedup.c +DEP_CPP_FILED=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ - ".\include\apr_lib.h"\ + ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\inherit.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_S) "$(INTDIR)"\ +"$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\strings\apr_strings.c -DEP_CPP_APR_ST=\ +SOURCE=.\file_io\win32\filepath.c +DEP_CPP_FILEP=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_lib.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\apr_strings.obj" : $(SOURCE) $(DEP_CPP_APR_ST) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -SOURCE=.\strings\apr_strnatcmp.c -DEP_CPP_APR_STR=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_pools.h"\ - ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - - -"$(INTDIR)\apr_strnatcmp.obj" : $(SOURCE) $(DEP_CPP_APR_STR) "$(INTDIR)"\ +"$(INTDIR)\filepath.obj" : $(SOURCE) $(DEP_CPP_FILEP) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\strings\apr_strtok.c -DEP_CPP_APR_STRT=\ +SOURCE=.\file_io\win32\filestat.c +DEP_CPP_FILES=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ ".\include\apr_want.h"\ - - -"$(INTDIR)\apr_strtok.obj" : $(SOURCE) $(DEP_CPP_APR_STRT) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -SOURCE=.\passwd\apr_getpass.c -DEP_CPP_APR_G=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_pools.h"\ - ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\apr_getpass.obj" : $(SOURCE) $(DEP_CPP_APR_G) "$(INTDIR)"\ +"$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\passwd\apr_md5.c -DEP_CPP_APR_M=\ +SOURCE=.\file_io\win32\flock.c +DEP_CPP_FLOCK=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_md5.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\apr_md5.obj" : $(SOURCE) $(DEP_CPP_APR_M) "$(INTDIR)"\ +"$(INTDIR)\flock.obj" : $(SOURCE) $(DEP_CPP_FLOCK) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\tables\apr_hash.c -DEP_CPP_APR_H=\ +SOURCE=.\file_io\unix\fullrw.c +DEP_CPP_FULLR=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ - ".\include\apr_general.h"\ - ".\include\apr_hash.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_inherit.h"\ ".\include\apr_pools.h"\ ".\include\apr_sms.h"\ - ".\include\arch\win32\apr_private.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ -"$(INTDIR)\apr_hash.obj" : $(SOURCE) $(DEP_CPP_APR_H) "$(INTDIR)"\ +"$(INTDIR)\fullrw.obj" : $(SOURCE) $(DEP_CPP_FULLR) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\tables\apr_tables.c -DEP_CPP_APR_T=\ +SOURCE=.\file_io\win32\open.c +DEP_CPP_OPEN_=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_lib.h"\ + ".\include\apr_getopt.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\apr_tables.obj" : $(SOURCE) $(DEP_CPP_APR_T) "$(INTDIR)"\ - ".\include\apr.h" +"$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\unix\errorcodes.c -DEP_CPP_ERROR=\ +SOURCE=.\file_io\win32\pipe.c +DEP_CPP_PIPE_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -678,28 +718,30 @@ DEP_CPP_ERROR=\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ - ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\errorcodes.obj" : $(SOURCE) $(DEP_CPP_ERROR) "$(INTDIR)"\ - ".\include\apr.h" +"$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\unix\getopt.c -DEP_CPP_GETOP=\ +SOURCE=.\file_io\win32\readwrite.c +DEP_CPP_READW=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -708,39 +750,33 @@ DEP_CPP_GETOP=\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ + ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"\ - ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -SOURCE=.\misc\win32\getuuid.c -DEP_CPP_GETUU=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_uuid.h"\ - - -"$(INTDIR)\getuuid.obj" : $(SOURCE) $(DEP_CPP_GETUU) "$(INTDIR)"\ +"$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\win32\misc.c -DEP_CPP_MISC_=\ +SOURCE=.\file_io\win32\seek.c +DEP_CPP_SEEK_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -754,232 +790,207 @@ DEP_CPP_MISC_=\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\misc.obj" : $(SOURCE) $(DEP_CPP_MISC_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\win32\names.c -DEP_CPP_NAMES=\ +SOURCE=.\i18n\unix\utf8_ucs2.c +DEP_CPP_UTF8_=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ - ".\include\apr_inherit.h"\ - ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ - ".\include\arch\win32\apr_private.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ -"$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"\ +"$(INTDIR)\utf8_ucs2.obj" : $(SOURCE) $(DEP_CPP_UTF8_) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\unix\otherchild.c -DEP_CPP_OTHER=\ +SOURCE=.\i18n\unix\xlate.c +SOURCE=.\locks\win32\locks.c +DEP_CPP_LOCKS=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_tables.h"\ + ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ - ".\include\arch\win32\threadproc.h"\ + ".\include\arch\win32\locks.h"\ -"$(INTDIR)\otherchild.obj" : $(SOURCE) $(DEP_CPP_OTHER) "$(INTDIR)"\ +"$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\win32\rand.c -DEP_CPP_RAND_=\ - ".\include\apr.h"\ - ".\include\apr_errno.h"\ - ".\include\apr_general.h"\ - ".\include\apr_pools.h"\ - ".\include\apr_sms.h"\ - ".\include\arch\win32\apr_private.h"\ - - -"$(INTDIR)\rand.obj" : $(SOURCE) $(DEP_CPP_RAND_) "$(INTDIR)" ".\include\apr.h" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -SOURCE=.\misc\unix\start.c -DEP_CPP_START=\ +SOURCE=.\memory\unix\apr_pools.c +DEP_CPP_APR_P=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ + ".\include\apr_hash.h"\ ".\include\apr_inherit.h"\ + ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ - ".\include\apr_signal.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\locks.h"\ -"$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"\ +"$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\misc\unix\uuid.c -DEP_CPP_UUID_=\ +SOURCE=.\memory\unix\apr_sms.c +DEP_CPP_APR_S=\ ".\include\apr.h"\ + ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_uuid.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_hash.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\memory\unix\sms_private.h"\ -"$(INTDIR)\uuid.obj" : $(SOURCE) $(DEP_CPP_UUID_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\apr_sms.obj" : $(SOURCE) $(DEP_CPP_APR_S) "$(INTDIR)"\ + ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\dir.c -DEP_CPP_DIR_C=\ +SOURCE=.\memory\unix\apr_sms_blocks.c +DEP_CPP_APR_SM=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ + ".\include\apr_sms_blocks.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\atime.h"\ - ".\include\arch\win32\fileio.h"\ + ".\memory\unix\sms_private.h"\ -"$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\apr_sms_blocks.obj" : $(SOURCE) $(DEP_CPP_APR_SM) "$(INTDIR)"\ + ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\unix\fileacc.c -DEP_CPP_FILEA=\ +SOURCE=.\memory\unix\apr_sms_std.c +DEP_CPP_APR_SMS=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ + ".\memory\unix\sms_private.h"\ -"$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"\ +"$(INTDIR)\apr_sms_std.obj" : $(SOURCE) $(DEP_CPP_APR_SMS) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\filedup.c -DEP_CPP_FILED=\ +SOURCE=.\memory\unix\apr_sms_tracking.c +DEP_CPP_APR_SMS_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ + ".\include\apr_sms_tracking.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\inherit.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ + ".\memory\unix\sms_private.h"\ -"$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"\ +"$(INTDIR)\apr_sms_tracking.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\filepath.c -DEP_CPP_FILEP=\ +SOURCE=.\misc\unix\errorcodes.c +DEP_CPP_ERROR=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -988,31 +999,28 @@ DEP_CPP_FILEP=\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ + ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\filepath.obj" : $(SOURCE) $(DEP_CPP_FILEP) "$(INTDIR)"\ +"$(INTDIR)\errorcodes.obj" : $(SOURCE) $(DEP_CPP_ERROR) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\filestat.c -DEP_CPP_FILES=\ +SOURCE=.\misc\unix\getopt.c +DEP_CPP_GETOP=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -1027,26 +1035,33 @@ DEP_CPP_FILES=\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\atime.h"\ - ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"\ +"$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\flock.c -DEP_CPP_FLOCK=\ +SOURCE=.\misc\win32\getuuid.c +DEP_CPP_GETUU=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_uuid.h"\ + + +"$(INTDIR)\getuuid.obj" : $(SOURCE) $(DEP_CPP_GETUU) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\misc\win32\misc.c +DEP_CPP_MISC_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -1060,44 +1075,43 @@ DEP_CPP_FLOCK=\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\flock.obj" : $(SOURCE) $(DEP_CPP_FLOCK) "$(INTDIR)"\ - ".\include\apr.h" +"$(INTDIR)\misc.obj" : $(SOURCE) $(DEP_CPP_MISC_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\unix\fullrw.c -DEP_CPP_FULLR=\ +SOURCE=.\misc\win32\names.c +DEP_CPP_NAMES=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ ".\include\apr_inherit.h"\ + ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ -"$(INTDIR)\fullrw.obj" : $(SOURCE) $(DEP_CPP_FULLR) "$(INTDIR)"\ +"$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\open.c -DEP_CPP_OPEN_=\ +SOURCE=.\misc\unix\otherchild.c +DEP_CPP_OTHER=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -1111,7 +1125,6 @@ DEP_CPP_OPEN_=\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1122,46 +1135,30 @@ DEP_CPP_OPEN_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\otherchild.obj" : $(SOURCE) $(DEP_CPP_OTHER) "$(INTDIR)"\ + ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\pipe.c -DEP_CPP_PIPE_=\ +SOURCE=.\misc\win32\rand.c +DEP_CPP_RAND_=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ - ".\include\apr_inherit.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ - ".\include\apr_thread_proc.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\rand.obj" : $(SOURCE) $(DEP_CPP_RAND_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\readwrite.c -DEP_CPP_READW=\ +SOURCE=.\misc\unix\start.c +DEP_CPP_START=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -1170,87 +1167,88 @@ DEP_CPP_READW=\ ".\include\apr_general.h"\ ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ - ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ + ".\include\apr_signal.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\atime.h"\ - ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\locks.h"\ -"$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"\ +"$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\file_io\win32\seek.c -DEP_CPP_SEEK_=\ +SOURCE=.\misc\unix\uuid.c +DEP_CPP_UUID_=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_uuid.h"\ + + +"$(INTDIR)\uuid.obj" : $(SOURCE) $(DEP_CPP_UUID_) "$(INTDIR)" ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\mmap\unix\common.c +DEP_CPP_COMMO=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ + ".\include\apr_mmap.h"\ ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_tables.h"\ - ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\common.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ + ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\locks\win32\locks.c -DEP_CPP_LOCKS=\ +SOURCE=.\mmap\win32\mmap.c +DEP_CPP_MMAP_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ + ".\include\apr_mmap.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\locks.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"\ - ".\include\apr.h" +"$(INTDIR)\mmap.obj" : $(SOURCE) $(DEP_CPP_MMAP_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) @@ -1422,212 +1420,189 @@ DEP_CPP_SOCKO=\ ".\include\apr_pools.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ - ".\include\arch\win32\networkio.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\networkio.h"\ + + +"$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\passwd\apr_getpass.c +DEP_CPP_APR_G=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\arch\win32\apr_private.h"\ + + +"$(INTDIR)\apr_getpass.obj" : $(SOURCE) $(DEP_CPP_APR_G) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\passwd\apr_md5.c +DEP_CPP_APR_M=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_md5.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\win32\apr_private.h"\ + + +"$(INTDIR)\apr_md5.obj" : $(SOURCE) $(DEP_CPP_APR_M) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +SOURCE=.\shmem\win32\shmem.c +SOURCE=.\strings\apr_cpystrn.c +DEP_CPP_APR_C=\ + ".\include\apr.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_lib.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ + ".\include\arch\win32\apr_private.h"\ -"$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"\ +"$(INTDIR)\apr_cpystrn.obj" : $(SOURCE) $(DEP_CPP_APR_C) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\threadproc\win32\proc.c -DEP_CPP_PROC_=\ +SOURCE=.\strings\apr_fnmatch.c +DEP_CPP_APR_F=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ - ".\include\apr_inherit.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ - ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ - ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ - ".\include\apr_thread_proc.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ + ".\include\apr_fnmatch.h"\ + ".\include\apr_lib.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ - ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\apr_fnmatch.obj" : $(SOURCE) $(DEP_CPP_APR_F) "$(INTDIR)"\ + ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\threadproc\win32\signals.c -DEP_CPP_SIGNA=\ +SOURCE=.\strings\apr_snprintf.c +DEP_CPP_APR_SN=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ - ".\include\apr_lock.h"\ + ".\include\apr_lib.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_tables.h"\ - ".\include\apr_thread_proc.h"\ + ".\include\apr_strings.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ - ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"\ +"$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_SN) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\threadproc\win32\thread.c -DEP_CPP_THREA=\ +SOURCE=.\strings\apr_strings.c +DEP_CPP_APR_ST=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_thread_proc.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ + ".\include\apr_strings.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"\ +"$(INTDIR)\apr_strings.obj" : $(SOURCE) $(DEP_CPP_APR_ST) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\threadproc\win32\threadpriv.c -DEP_CPP_THREAD=\ +SOURCE=.\strings\apr_strnatcmp.c +DEP_CPP_APR_STR=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ - ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_thread_proc.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ - ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\threadproc.h"\ + ".\include\apr_strings.h"\ -"$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"\ +"$(INTDIR)\apr_strnatcmp.obj" : $(SOURCE) $(DEP_CPP_APR_STR) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\dso\win32\dso.c -DEP_CPP_DSO_C=\ +SOURCE=.\strings\apr_strtok.c +DEP_CPP_APR_STRT=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ - ".\include\apr_inherit.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ - ".\include\apr_thread_proc.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ - ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\dso.h"\ - ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\dso.obj" : $(SOURCE) $(DEP_CPP_DSO_C) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\apr_strtok.obj" : $(SOURCE) $(DEP_CPP_APR_STRT) "$(INTDIR)"\ + ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\i18n\unix\utf8_ucs2.c -DEP_CPP_UTF8_=\ +SOURCE=.\tables\apr_hash.c +DEP_CPP_APR_H=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ + ".\include\apr_general.h"\ + ".\include\apr_hash.h"\ ".\include\apr_pools.h"\ ".\include\apr_sms.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ + ".\include\arch\win32\apr_private.h"\ -"$(INTDIR)\utf8_ucs2.obj" : $(SOURCE) $(DEP_CPP_UTF8_) "$(INTDIR)"\ +"$(INTDIR)\apr_hash.obj" : $(SOURCE) $(DEP_CPP_APR_H) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\i18n\unix\xlate.c -SOURCE=.\shmem\win32\shmem.c -SOURCE=.\mmap\unix\common.c -DEP_CPP_COMMO=\ +SOURCE=.\tables\apr_tables.c +DEP_CPP_APR_T=\ ".\include\apr.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ - ".\include\apr_inherit.h"\ - ".\include\apr_mmap.h"\ + ".\include\apr_general.h"\ + ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ ".\include\apr_sms.h"\ - ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\arch\win32\apr_private.h"\ -"$(INTDIR)\common.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\ +"$(INTDIR)\apr_tables.obj" : $(SOURCE) $(DEP_CPP_APR_T) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\mmap\win32\mmap.c -DEP_CPP_MMAP_=\ +SOURCE=.\threadproc\win32\proc.c +DEP_CPP_PROC_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -1637,11 +1612,11 @@ DEP_CPP_MMAP_=\ ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ - ".\include\apr_mmap.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ + ".\include\apr_strings.h"\ ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ @@ -1652,80 +1627,82 @@ DEP_CPP_MMAP_=\ ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\mmap.obj" : $(SOURCE) $(DEP_CPP_MMAP_) "$(INTDIR)" ".\include\apr.h" +"$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\user\win32\groupinfo.c -DEP_CPP_GROUP=\ +SOURCE=.\threadproc\win32\signals.c +DEP_CPP_SIGNA=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\groupinfo.obj" : $(SOURCE) $(DEP_CPP_GROUP) "$(INTDIR)"\ +"$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\user\win32\userinfo.c -DEP_CPP_USERI=\ +SOURCE=.\threadproc\win32\thread.c +DEP_CPP_THREA=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ + ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ - ".\include\apr_xlate.h"\ - ".\include\arch\unix\i18n.h"\ - ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\include\arch\win32\fileio.h"\ + ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\ +"$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\memory\unix\apr_pools.c -DEP_CPP_APR_P=\ +SOURCE=.\threadproc\win32\threadpriv.c +DEP_CPP_THREAD=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_hash.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ @@ -1733,49 +1710,39 @@ DEP_CPP_APR_P=\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\threadproc.h"\ -"$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\ +"$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\memory\unix\apr_sms.c -DEP_CPP_APR_SM=\ +SOURCE=.\time\win32\access.c +DEP_CPP_ACCES=\ ".\include\apr.h"\ - ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ - ".\include\apr_file_info.h"\ - ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ - ".\include\apr_hash.h"\ - ".\include\apr_inherit.h"\ - ".\include\apr_lock.h"\ - ".\include\apr_network_io.h"\ + ".\include\apr_lib.h"\ ".\include\apr_pools.h"\ - ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_strings.h"\ - ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ - ".\include\apr_user.h"\ - ".\include\apr_want.h"\ - ".\memory\unix\sms_private.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\include\arch\win32\atime.h"\ -"$(INTDIR)\apr_sms.obj" : $(SOURCE) $(DEP_CPP_APR_SM) "$(INTDIR)"\ +"$(INTDIR)\access.obj" : $(SOURCE) $(DEP_CPP_ACCES) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\memory\unix\apr_sms_blocks.c -DEP_CPP_APR_SMS=\ +SOURCE=.\time\win32\time.c +DEP_CPP_TIME_=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -1783,27 +1750,26 @@ DEP_CPP_APR_SMS=\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ ".\include\apr_inherit.h"\ + ".\include\apr_lib.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_sms_blocks.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\memory\unix\sms_private.h"\ + ".\include\arch\win32\atime.h"\ -"$(INTDIR)\apr_sms_blocks.obj" : $(SOURCE) $(DEP_CPP_APR_SMS) "$(INTDIR)"\ - ".\include\apr.h" +"$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)" ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\memory\unix\apr_sms_std.c -DEP_CPP_APR_SMS_=\ +SOURCE=.\time\win32\timestr.c +DEP_CPP_TIMES=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ @@ -1820,66 +1786,69 @@ DEP_CPP_APR_SMS_=\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\memory\unix\sms_private.h"\ + ".\include\arch\win32\atime.h"\ -"$(INTDIR)\apr_sms_std.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_) "$(INTDIR)"\ +"$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\memory\unix\apr_sms_tracking.c -DEP_CPP_APR_SMS_T=\ +SOURCE=.\user\win32\groupinfo.c +DEP_CPP_GROUP=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ - ".\include\apr_general.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_sms_tracking.h"\ + ".\include\apr_strings.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ ".\include\arch\win32\apr_private.h"\ - ".\memory\unix\sms_private.h"\ -"$(INTDIR)\apr_sms_tracking.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_T) "$(INTDIR)"\ +"$(INTDIR)\groupinfo.obj" : $(SOURCE) $(DEP_CPP_GROUP) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=.\memory\unix\apr_sms_trivial.c -DEP_CPP_APR_SMS_TR=\ +SOURCE=.\user\win32\userinfo.c +DEP_CPP_USERI=\ ".\include\apr.h"\ ".\include\apr_dso.h"\ ".\include\apr_errno.h"\ ".\include\apr_file_info.h"\ ".\include\apr_file_io.h"\ ".\include\apr_general.h"\ + ".\include\apr_getopt.h"\ ".\include\apr_inherit.h"\ ".\include\apr_lock.h"\ ".\include\apr_network_io.h"\ ".\include\apr_pools.h"\ ".\include\apr_portable.h"\ ".\include\apr_sms.h"\ - ".\include\apr_sms_trivial.h"\ + ".\include\apr_strings.h"\ + ".\include\apr_tables.h"\ ".\include\apr_thread_proc.h"\ ".\include\apr_time.h"\ ".\include\apr_user.h"\ ".\include\apr_want.h"\ + ".\include\apr_xlate.h"\ + ".\include\arch\unix\i18n.h"\ + ".\include\arch\unix\misc.h"\ ".\include\arch\win32\apr_private.h"\ - ".\memory\unix\sms_private.h"\ + ".\include\arch\win32\fileio.h"\ -"$(INTDIR)\apr_sms_trivial.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_TR) "$(INTDIR)"\ +"$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\ ".\include\apr.h" $(CPP) $(CPP_PROJ) $(SOURCE) From 3f3244d2aa60cd0a435c970d438e92f69a9b19a4 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 26 Jul 2001 18:46:19 +0000 Subject: [PATCH 2040/7878] Update STATUS file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62035 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/STATUS b/STATUS index 4b9bb60e692..18a3057e5a2 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/07/26 03:59:24 $] +Last modified at [$Date: 2001/07/26 18:46:19 $] Release: @@ -26,10 +26,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Get OTHER_CHILD support into Win32 Status: Bill S. is looking into this - * Unconditionally setting AI_CANONNAME flag when apr_sockaddr_info_get() - calls getaddrinfo() is bogus and causes undesired DNS requests. - Status: Jeff will look into this - * SysV semaphore support isn't usable by Apache when started as root because we don't have a way to allow the semaphore to be used by the configured User and Group. Current work-around: @@ -116,6 +112,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * toss the per-Makefile setup of INCLUDES; shift to rules.mk.in * add the rest of the pool accessor declare/impl macros. + Justin says: Both thread and file have the accessors now. Any others? Status: Greg volunteers * I think apr_open_stderr() and friends dup() the descriptor. That @@ -138,14 +135,9 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: - add more detailed tests to testmem.c Status: Optionally enable it with --enable-sms. Still wildly unproven. But, it actually works as a replacement for - pools now. (httpd works without pools.) - There is a current (non-fatal, but silly) flaw in - the trivial SMS implementation that makes it add 4KB - to each level in the allocation chain. This is bad. - Adding a child_malloc path has been discussed. Making - the apr_sms_pools.c call with 0 for MIN_FREE has been - suggested. As has rethinking which SMSs constitute an - old-style apr_pool_t. + pools now. It may even not segfault when running httpd + under high-loads. The performance impact/benefit still + needs to be examined. * In line with the new SMS code is the fact that threading and pools just are not working together well. This is due to the fact that @@ -179,6 +171,11 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: have access to the Solaris source code: osnet_volume/usr/src/lib/libc/port/gen/time_comm.c. + * Add a way to query APR for what features it has at runtime (i.e. + threads). + Justin says: I'm not completely sold on this, but it has been mentioned + before and at least added to STATUS. + Documentation that needs writing: * API documentation From 77e0f7d0c6536b7c2ac2fdf3936fe6097e2365d6 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 26 Jul 2001 18:52:51 +0000 Subject: [PATCH 2041/7878] Ain't Wastin' Time No More git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62036 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 18a3057e5a2..35355d76b1d 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/07/26 18:46:19 $] +Last modified at [$Date: 2001/07/26 18:52:51 $] Release: @@ -176,6 +176,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Justin says: I'm not completely sold on this, but it has been mentioned before and at least added to STATUS. + * apr_xlate.h generates a bunch of compiler warnings. + Documentation that needs writing: * API documentation From 9b473c92f8f77d741ccbfd2c8cf46af34c5b8dd8 Mon Sep 17 00:00:00 2001 From: Ben Collins-Sussman Date: Thu, 26 Jul 2001 21:49:32 +0000 Subject: [PATCH 2042/7878] * apr_user.h (apr_current_userid): new declaration. * userinfo.c (apr_current_userid): implement Unix version. Somebody want to write a Win32 equivalent? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62037 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_user.h | 12 ++++++++++++ user/unix/userinfo.c | 15 +++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/include/apr_user.h b/include/apr_user.h index 3c70da037ad..ac781bd6d8d 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -89,6 +89,18 @@ typedef gid_t apr_gid_t; #if APR_HAS_USER +/*** + * Get the userid (and groupid) of the calling process + * @param userid Returns the user id + * @param groupid Returns the user's group id + * @param p The pool from which to allocate working space + * @tip This function is available only if APR_HAS_USER is defined. + * @deffunc apr_status_t apr_current_userid(apr_uid_t *userid, apr_gid_t *groupid, apr_pool_t *p) + */ +APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *userid, + apr_gid_t *groupid, + apr_pool_t *p); + /*** * Get the user name for a specified userid * @param username Pointer to new string containing user name (on output) diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 4dade21a034..27445e4ee76 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -111,6 +111,21 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, return APR_SUCCESS; } + + +APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, + apr_gid_t *gid, + apr_pool_t *p) +{ + *uid = getuid(); + *gid = getgid(); + + return APR_SUCCESS; +} + + + + APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, const char *username, apr_pool_t *p) { From 4a65285f4448dfa76f935b2250f4b1953a0a86c3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 27 Jul 2001 01:27:07 +0000 Subject: [PATCH 2043/7878] Couple of fixes for pre-BONE beos... - correctly set the file_as_socket - add the apr_wait_for_timeout so it's visible These come from Brad Froehle. Submitted by: Brad Froehle Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62038 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 13 ++++++++----- network_io/beos/sendrecv.c | 8 ++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index 5049730b726..afaf1c631b5 100644 --- a/configure.in +++ b/configure.in @@ -216,11 +216,14 @@ case $host in APR_CHECK_DEFINE(BONE_VERSION, sys/socket.h) eolstr="\\n" osver=`uname -r` - if test "$osver"="5.0.4"; then - file_as_socket="1" - else - file_as_socket="0" - fi + case $osver in + 5.0.4) + file_as_socket="1" + ;; + *) + file_as_socket="0" + ;; + esac LOCAL_MM_LIB="" ;; *os390) diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 9af199ea89b..2d584a60200 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -59,7 +59,7 @@ #include "networkio.h" #include "apr_time.h" -static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) +apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read) { struct timeval tv, *tvptr; fd_set fdset; @@ -137,7 +137,7 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) } while (rv == -1 && errno == EINTR); if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 1); + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -180,7 +180,7 @@ apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -220,7 +220,7 @@ apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 1); + apr_status_t arv = apr_wait_for_io_or_timeout(sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; From 57d91448db72994981541e5e33c07fab13fc130a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 27 Jul 2001 05:37:13 +0000 Subject: [PATCH 2044/7878] Nasty... OS2 needs checking out, still having trouble with Win32. This doesn't hold us up, since win32 didn't use the threading library. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62039 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 8bf943113a3..8b33d403258 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -585,7 +585,9 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how); -#if APR_HAS_THREADS && !defined(OS2) && APR_HAVE_SIGWAIT +#if APR_HAS_THREADS + +#if !defined(OS2) && APR_HAVE_SIGWAIT /** * Setup the process for a single thread to be used for all signal handling. @@ -603,10 +605,12 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void); */ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)); +#endif /* !defined(OS2) && APR_HAVE_SIGWAIT */ + /** * Get the child-pool used by the thread from the thread info. * @return apr_pool_t the pool - * @deffunc apr_pool_t apr_thread_info_pool_get(apr_thread_info_t *i) + * @deffunc apr_pool_t apr_thread_pool_get(apr_thread_t *i) */ APR_POOL_DECLARE_ACCESSOR(thread); From cc6399f4e708aafac5f3d094b79c92e43a8d272f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 27 Jul 2001 05:40:18 +0000 Subject: [PATCH 2045/7878] More fooness git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62040 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testlock.c b/test/testlock.c index af675ae48f3..229b4de0154 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -73,8 +73,8 @@ int main(void) #define MAX_ITER 40000 -void * APR_THREAD_FUNC thread_rw_func(void *data); -void * APR_THREAD_FUNC thread_function(void *data); +void * APR_THREAD_FUNC thread_rw_func(apr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_function(apr_thread_t *thd, void *data); apr_status_t test_exclusive(void); apr_status_t test_rw(void); apr_status_t test_multiple_locking(void); @@ -85,7 +85,7 @@ apr_lock_t *thread_rw_lock, *thread_lock; apr_pool_t *pool; int i = 0, x = 0; -void * APR_THREAD_FUNC thread_rw_func(void *data) +void * APR_THREAD_FUNC thread_rw_func(apr_thread_t *thd, void *data) { int exitLoop = 1; @@ -110,7 +110,7 @@ void * APR_THREAD_FUNC thread_rw_func(void *data) return NULL; } -void * APR_THREAD_FUNC thread_function(void *data) +void * APR_THREAD_FUNC thread_function(apr_thread_t *thd, void *data) { int exitLoop = 1; From 51331c6a5649cee3a206d8dcbf5294494110e595 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 27 Jul 2001 05:47:31 +0000 Subject: [PATCH 2046/7878] Caught by apr/test/ faults, we were still missing apr_sms_trivial.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62041 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++++ libapr.dsp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apr.dsp b/apr.dsp index 0cc8dc5aa4b..9fbf8d0e74b 100644 --- a/apr.dsp +++ b/apr.dsp @@ -184,6 +184,10 @@ SOURCE=.\memory\unix\apr_sms_std.c SOURCE=.\memory\unix\apr_sms_tracking.c # End Source File +# Begin Source File + +SOURCE=.\memory\unix\apr_sms_trivial.c +# End Source File # End Group # Begin Group "misc" diff --git a/libapr.dsp b/libapr.dsp index 9eee611c62a..5745a94a8b4 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -190,6 +190,10 @@ SOURCE=.\memory\unix\apr_sms_std.c SOURCE=.\memory\unix\apr_sms_tracking.c # End Source File +# Begin Source File + +SOURCE=.\memory\unix\apr_sms_trivial.c +# End Source File # End Group # Begin Group "misc" From d1a31ef2203bf650536a62ab96848677898e4106 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 27 Jul 2001 07:10:07 +0000 Subject: [PATCH 2047/7878] Fixes and goodness git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62042 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmmap.c | 6 ++--- test/testuser.c | 63 +++++++++++++++++++++++++++++-------------------- 2 files changed, 41 insertions(+), 28 deletions(-) diff --git a/test/testmmap.c b/test/testmmap.c index eaf53e89ae1..0fe59b90e8a 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -57,6 +57,7 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_file_io.h" +#include "apr_strings.h" #if APR_HAVE_UNISTD_H #include #endif @@ -98,9 +99,8 @@ int main(void) } fprintf(stdout,"OK\n"); - file1 = (char*) apr_palloc(context, sizeof(char) * PATH_LEN); - getcwd(file1, PATH_LEN); - strncat(file1,"/testmmap.c",11); + apr_filepath_get(&file1, context); + file1 = apr_pstrcat(context,file1,"/testmmap.c",NULL); fprintf(stdout, "Opening file........................"); rv = apr_file_open(&thefile, file1, flag, APR_UREAD | APR_GREAD, context); diff --git a/test/testuser.c b/test/testuser.c index 4de8ff9ed5a..9c7b3e43a8b 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -72,20 +72,12 @@ int main(int argc, char *argv[]) apr_pool_t *p; apr_status_t rv; char msgbuf[80]; - const char *username; + char *groupname; + char *username; char *homedir; apr_uid_t userid; apr_gid_t groupid; - if (argc != 2) { - fprintf(stderr, - "usage: %s username\n", - argv[0]); - exit(-1); - } - - username = argv[1]; - if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Something went wrong\n"); exit(-1); @@ -97,30 +89,51 @@ int main(int argc, char *argv[]) exit(-1); } - rv = apr_get_home_directory(&homedir, username, p); - if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_get_home_directory(,%s,) failed: %s\n", - username, - apr_strerror(rv, msgbuf, sizeof(msgbuf))); - exit(-1); + if (argc != 2) { + fprintf(stderr, + "optional: %s username\n", + argv[0]); + if ((rv = apr_current_userid(&userid, &groupid, p)) != APR_SUCCESS) { + fprintf(stderr, "apr_current_userid failed: %s\n", + apr_strerror(rv, msgbuf, sizeof(msgbuf))); + exit(-1); + } + apr_get_username(&username, userid, p); + if (rv != APR_SUCCESS) { + fprintf(stderr, "apr_get_username(,,) failed: %s\n", + apr_strerror(rv, msgbuf, sizeof(msgbuf))); + exit(-1); + } } else { - printf("home directory for %s: `%s'\n", - username, homedir); + username = argv[1]; + + rv = apr_get_userid(&userid, &groupid, username, p); + if (rv != APR_SUCCESS) { + fprintf(stderr, "apr_get_userid(,,%s,) failed: %s\n", + username, + apr_strerror(rv, msgbuf, sizeof(msgbuf))); + exit(-1); + } } - rv = apr_get_userid(&userid, &groupid, username, p); + rv = apr_get_groupname(&groupname, groupid, p); + if (rv != APR_SUCCESS) + groupname = "(none)"; + + printf("user/group ids for %s: %d/%d\n", + username, + (int)userid, (int)groupid); + + rv = apr_get_home_directory(&homedir, username, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_get_userid(,,%s,) failed: %s\n", + fprintf(stderr, "apr_get_home_directory(,%s,) failed: %s\n", username, apr_strerror(rv, msgbuf, sizeof(msgbuf))); exit(-1); } - else { - printf("user/group ids for %s: %d/%d\n", - username, - (int)userid, (int)groupid); - } + printf("home directory for %s (member of %s) is:\n`%s'\n", + username, groupname, homedir); return 1; } From c1933bef5d0a75701119eb4125f7d653488003b6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 27 Jul 2001 07:11:07 +0000 Subject: [PATCH 2048/7878] Here's an implementation, dunno if it's _the_ implementation we are looking for. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62043 13f79535-47bb-0310-9956-ffa450edef68 --- user/win32/userinfo.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 8636d174a26..66f9abb4a12 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -189,6 +189,39 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, + apr_gid_t *gid, + apr_pool_t *p) +{ + HANDLE threadtok; + DWORD needed; + TOKEN_USER *usr; + TOKEN_PRIMARY_GROUP *grp; + + if(!OpenProcessToken(GetCurrentProcess(), STANDARD_RIGHTS_READ | READ_CONTROL | TOKEN_QUERY, &threadtok)) { + return apr_get_os_error(); + } + + *uid = NULL; + if (!GetTokenInformation(threadtok, TokenUser, NULL, 0, &needed) + && (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + && (usr = apr_palloc(p, needed)) + && GetTokenInformation(threadtok, TokenUser, usr, needed, &needed)) + *uid = usr->User.Sid; + else + return apr_get_os_error(); + + if (!GetTokenInformation(threadtok, TokenPrimaryGroup, NULL, 0, &needed) + && (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + && (grp = apr_palloc(p, needed)) + && GetTokenInformation(threadtok, TokenPrimaryGroup, grp, needed, &needed)) + *gid = grp->PrimaryGroup; + else + return apr_get_os_error(); + + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, const char *username, apr_pool_t *p) { From 5bb84e012f47dc497291c5a306794d64b235b2e5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 27 Jul 2001 07:12:29 +0000 Subject: [PATCH 2049/7878] Another new source git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62044 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.dsp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/aprtest.dsp b/test/aprtest.dsp index 3965caddd17..94ec0f5f569 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -164,6 +164,10 @@ SOURCE=.\testucs.c # End Source File # Begin Source File +SOURCE=.\testuser.c +# End Source File +# Begin Source File + SOURCE=.\testuuid.c # End Source File # End Group From 5a520498b48b5489630a1f6c73ff90f5e1d488a2 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 27 Jul 2001 10:22:04 +0000 Subject: [PATCH 2050/7878] Neither beos or OS/2 has any subdirs that need installing, so the commit that added INSTALL_SUBDIRS broke the build. I couldn't find a way of getting it to work with an empty INSTALL_SUBDIRS (others may be able to) so I opted for setting it initially to 'none' and then testing for that when come to make install. This gets make install working again but was only tested on beos. Other platforms shouldn't be affected, but please test. Brian, does this work for OS/2? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62045 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 8 +++++--- configure.in | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index cbcb1a472b0..48795379703 100644 --- a/Makefile.in +++ b/Makefile.in @@ -61,9 +61,11 @@ install: $(TARGET_LIB) fi; \ $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(libdir) $(LIBTOOL) --mode=install cp APRVARS $(libdir) - @for i in $(INSTALL_SUBDIRS); do \ - ( cd $$i ; $(MAKE) install ); \ - done + @if [ $(INSTALL_SUBDIRS) != "none" ]; then \ + for i in $(INSTALL_SUBDIRS); do \ + ( cd $$i ; $(MAKE) install ); \ + done \ + fi $(TARGET_LIB): @for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \ diff --git a/configure.in b/configure.in index afaf1c631b5..a8abf544850 100644 --- a/configure.in +++ b/configure.in @@ -192,6 +192,7 @@ case "$host:$CC" in ;; esac LOCAL_MM_LIB="../shmem/unix/mm/libmm.la" +config_subdirs="none" case $host in i386-ibm-aix* | *-ibm-aix[1-2].* | *-ibm-aix3.* | *-ibm-aix4.1 | *-ibm-aix4.1.* | *-ibm-aix4.2 | *-ibm-aix4.2.*) OSDIR="aix" From fa3a2820aedce2b207d3bf7f85a280cd2f98a9d5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 27 Jul 2001 16:54:44 +0000 Subject: [PATCH 2051/7878] gotta use apr_os_thread_equal() instead of comparing apr_os_thread_t directly; the latter doesn't work on OS/390 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62046 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms_threads.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/memory/unix/apr_sms_threads.c b/memory/unix/apr_sms_threads.c index f701bbcde6a..e4ede123fef 100644 --- a/memory/unix/apr_sms_threads.c +++ b/memory/unix/apr_sms_threads.c @@ -165,7 +165,7 @@ static void *apr_sms_threads_malloc(apr_sms_t *sms, /* If the thread wasn't registered before, we will segfault */ thread_node = SMS_THREADS_T(sms)->hashtable[hash]; - while (thread_node->thread != thread) + while (!apr_os_thread_equal(thread_node->thread, thread)) thread_node = thread_node->next; node = thread_node->used_sentinel.prev; @@ -309,7 +309,7 @@ static apr_status_t apr_sms_threads_free(apr_sms_t *sms, void *mem) hash = THREAD_HASH(thread); thread_node = SMS_THREADS_T(sms)->hashtable[hash]; - while (thread_node->thread != thread) + while (!apr_os_thread_equal(thread_node->thread, thread)) thread_node = thread_node->next; node->avail_size += node->first_avail - @@ -639,7 +639,7 @@ static apr_status_t apr_sms_threads_thread_unregister(apr_sms_t *sms, apr_lock_acquire(SMS_THREADS_T(sms)->lock); thread_node = SMS_THREADS_T(sms)->hashtable[hash]; - while (thread_node->thread != thread) + while (!apr_os_thread_equal(thread_node->thread, thread)) thread_node = thread_node->next; if ((*thread_node->ref = thread_node->next) != NULL) From 62a291fd1678ba88edcf24e56e7b0bc6ac9b4578 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 27 Jul 2001 17:40:11 +0000 Subject: [PATCH 2052/7878] How is this for short and sweet. Drop in #include "aprtest.h" for these slick little wrappers. I got so ticked at server.c not reporting anything useful (such as the actual error.) This should make the tests simpler. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62047 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.h | 86 ++++++++++++++++++++++++ test/server.c | 178 +++++++++++++++---------------------------------- 2 files changed, 138 insertions(+), 126 deletions(-) create mode 100644 test/aprtest.h diff --git a/test/aprtest.h b/test/aprtest.h new file mode 100644 index 00000000000..825fa560446 --- /dev/null +++ b/test/aprtest.h @@ -0,0 +1,86 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_strings.h" + +#define APR_TEST_BEGIN(rv, desc, op) \ + fprintf(stdout, "%s%.*s ", desc, \ + strlen(desc) < 37 ? 40 - strlen(desc) : 3, \ + "........................................"); \ + APR_TEST_MORE(rv, op) + +#define APR_TEST_MORE(rv, op) \ + if ((rv = (op)) != APR_SUCCESS) { \ + char msgbuf[256]; \ + fprintf (stdout, "Failed\n"); \ + fprintf (stderr, "%s Failed, error %d\n%s", #op, rv, \ + apr_strerror(stat, msgbuf, sizeof(msgbuf))); \ + exit(-1); } + +#define APR_TEST_END(rv, op) \ + APR_TEST_MORE(rv, op) \ + fprintf(stdout, "OK\n"); + +#define APR_TEST_SUCCESS(rv, desc, op) \ + APR_TEST_BEGIN(rv, desc, op) \ + fprintf(stdout, "OK\n"); + +#define APR_TEST_INITIALIZE(rv, pool) \ + APR_TEST_SUCCESS(rv, "Initializing", apr_initialize()); \ + atexit(apr_terminate); \ + APR_TEST_SUCCESS(rv, "Creating context", \ + apr_pool_create(&pool, NULL)); + diff --git a/test/server.c b/test/server.c index 4c5087b8b78..add49cb7571 100644 --- a/test/server.c +++ b/test/server.c @@ -52,10 +52,9 @@ * . */ +#include "aprtest.h" #include #include "apr_network_io.h" -#include "apr_errno.h" -#include "apr_general.h" #include "apr_getopt.h" #define STRLEN 15 @@ -63,10 +62,11 @@ int main(int argc, const char * const argv[]) { apr_pool_t *context; + apr_status_t rv; apr_socket_t *sock; apr_socket_t *sock2; apr_size_t length; - apr_int32_t rv; + apr_int32_t pollres; apr_pollfd_t *sdset; char datasend[STRLEN]; char datarecv[STRLEN] = "Recv data test"; @@ -76,31 +76,15 @@ int main(int argc, const char * const argv[]) apr_sockaddr_t *localsa = NULL, *remotesa; apr_status_t stat; int family = APR_UNSPEC; - char buf[128]; apr_getopt_t *opt; const char *optarg; char optchar; - fprintf(stdout, "Initializing........."); - if (apr_initialize() != APR_SUCCESS) { - fprintf(stderr, "Something went wrong\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - atexit(apr_terminate); - - fprintf(stdout, "Creating context......."); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - fprintf(stderr, "Could not create a context\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - - if (apr_getopt_init(&opt, context, argc, argv)) { - fprintf(stderr, "failed to initialize opts\n"); - exit(-1); - } + APR_TEST_INITIALIZE(rv, context); + APR_TEST_SUCCESS(rv, "Preparing getopt", + apr_getopt_init(&opt, context, argc, argv)) + while ((stat = apr_getopt(opt, "i:", &optchar, &optarg)) == APR_SUCCESS) { switch(optchar) { case 'i': @@ -120,147 +104,89 @@ int main(int argc, const char * const argv[]) * socket we need. We'll use the returned sockaddr later when * we bind. */ - stat = apr_sockaddr_info_get(&localsa, bind_to_ipaddr, APR_UNSPEC, 8021, 0, - context); - if (stat != APR_SUCCESS) { - fprintf(stderr, - "Couldn't build the socket address correctly: %s\n", - apr_strerror(stat, buf, sizeof buf)); - exit(-1); - } + APR_TEST_SUCCESS(rv, "Preparing sockaddr", + apr_sockaddr_info_get(&localsa, bind_to_ipaddr, APR_UNSPEC, 8021, 0, context)) family = localsa->sa.sin.sin_family; } - fprintf(stdout, "\tServer: Creating new socket......."); - if (apr_socket_create(&sock, family, SOCK_STREAM, context) != APR_SUCCESS) { - fprintf(stderr, "Couldn't create socket\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); + APR_TEST_SUCCESS(rv, "Creating new socket", + apr_socket_create(&sock, family, SOCK_STREAM, context)) - fprintf(stdout, "\tServer: Setting socket option NONBLOCK......."); - if (apr_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { - apr_socket_close(sock); - fprintf(stderr, "Couldn't set socket option\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); + APR_TEST_SUCCESS(rv, "Setting option APR_SO_NONBLOCK", + apr_setsocketopt(sock, APR_SO_NONBLOCK, 1)) - fprintf(stdout, "\tServer: Setting socket option REUSEADDR......."); - if (apr_setsocketopt(sock, APR_SO_REUSEADDR, 1) != APR_SUCCESS) { - apr_socket_close(sock); - fprintf(stderr, "Couldn't set socket option\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); + APR_TEST_SUCCESS(rv, "Setting option APR_SO_REUSEADDR", + apr_setsocketopt(sock, APR_SO_REUSEADDR, 1)) if (!localsa) { apr_socket_addr_get(&localsa, APR_LOCAL, sock); apr_sockaddr_port_set(localsa, 8021); } - fprintf(stdout, "\tServer: Binding socket to port......."); - if ((stat = apr_bind(sock, localsa)) != APR_SUCCESS) { - apr_socket_close(sock); - fprintf(stderr, "Could not bind: %s\n", - apr_strerror(stat, buf, sizeof buf)); - exit(-1); - } - fprintf(stdout, "OK\n"); + APR_TEST_SUCCESS(rv, "Binding socket to port", + apr_bind(sock, localsa)) - fprintf(stdout, "\tServer: Listening to socket......."); - if (apr_listen(sock, 5) != APR_SUCCESS) { - apr_socket_close(sock); - fprintf(stderr, "Could not listen\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - - fprintf(stdout, "\tServer: Setting up socket for polling......."); - apr_poll_setup(&sdset, 1, context); - apr_poll_socket_add(sdset, sock, APR_POLLIN); - fprintf(stdout, "OK\n"); + APR_TEST_SUCCESS(rv, "Listening to socket", + apr_listen(sock, 5)) - fprintf(stdout, "\tServer: Beginning to poll for socket......."); - rv = 1; - if (apr_poll(sdset, &rv, -1) != APR_SUCCESS) { - apr_socket_close(sock); - fprintf(stderr, "Select caused an error\n"); - exit(-1); - } - else if (rv == 0) { - apr_socket_close(sock); - fprintf(stderr, "I should not return until rv == 1\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); + APR_TEST_BEGIN(rv, "Setting up for polling", + apr_poll_setup(&sdset, 1, context)) + APR_TEST_END(rv, + apr_poll_socket_add(sdset, sock, APR_POLLIN)) + + pollres = 1; + APR_TEST_BEGIN(rv, "Polling for socket", + apr_poll(sdset, &pollres, -1)) - fprintf(stdout, "\tServer: Accepting a connection......."); - if (apr_accept(&sock2, sock, context) != APR_SUCCESS) { + if (pollres == 0) { + fprintf(stdout, "Failed\n"); apr_socket_close(sock); - fprintf(stderr, "Could not accept connection.\n"); + fprintf(stderr, "Error: Unrecognized poll result, " + "expected 1, received %d\n", pollres); exit(-1); } fprintf(stdout, "OK\n"); + APR_TEST_SUCCESS(rv, "Accepting a connection", + apr_accept(&sock2, sock, context)) + apr_socket_addr_get(&remotesa, APR_REMOTE, sock2); apr_sockaddr_ip_get(&remote_ipaddr, remotesa); apr_sockaddr_port_get(&remote_port, remotesa); apr_socket_addr_get(&localsa, APR_LOCAL, sock2); apr_sockaddr_ip_get(&local_ipaddr, localsa); apr_sockaddr_port_get(&local_port, localsa); - fprintf(stdout, "\tServer socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); + fprintf(stdout, "Server socket: %s:%u -> %s:%u\n", local_ipaddr, + local_port, remote_ipaddr, remote_port); length = STRLEN; - fprintf(stdout, "\tServer: Trying to recv data from socket......."); - if (apr_recv(sock2, datasend, &length) != APR_SUCCESS) { - apr_socket_close(sock); - apr_socket_close(sock2); - fprintf(stderr, "Problem recving data\n"); - exit(-1); - } + APR_TEST_BEGIN(rv, "Receiving data from socket", + apr_recv(sock2, datasend, &length)) + if (strcmp(datasend, "Send data test")) { + fprintf(stdout, "Failed\n"); apr_socket_close(sock); apr_socket_close(sock2); - fprintf(stderr, "I did not receive the correct data %s\n", datarecv); + fprintf(stderr, "Error: Unrecognized response;\n" + "Expected: \"Send data test\"\n" + "Received: \"%s\"\n", datarecv); exit(-1); } fprintf(stdout, "OK\n"); length = STRLEN; - fprintf(stdout, "\tServer: Sending data over socket......."); - if (apr_send(sock2, datarecv, &length) != APR_SUCCESS) { - apr_socket_close(sock); - apr_socket_close(sock2); - fprintf(stderr, "Problem sending data\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); + APR_TEST_SUCCESS(rv, "Sending data over socket", + apr_send(sock2, datarecv, &length)) - fprintf(stdout, "\tServer: Shutting down accepted socket......."); - if (apr_shutdown(sock2, APR_SHUTDOWN_READ) != APR_SUCCESS) { - apr_socket_close(sock); - apr_socket_close(sock2); - fprintf(stderr, "Problem shutting down\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); + APR_TEST_SUCCESS(rv, "Shutting down accepted socket", + apr_shutdown(sock2, APR_SHUTDOWN_READ)) - fprintf(stdout, "\tServer: closing duplicate socket......."); - if (apr_socket_close(sock2) != APR_SUCCESS) { - apr_socket_close(sock); - fprintf(stderr, "Problem closing down\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); + APR_TEST_SUCCESS(rv, "Closing duplicate socket", + apr_socket_close(sock2)) - fprintf(stdout, "\tServer: closing original socket......."); - if (apr_socket_close(sock) != APR_SUCCESS) { - fprintf(stderr, "Problem closing down\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); + APR_TEST_SUCCESS(rv, "Closing original socket", + apr_socket_close(sock)) - return 1; + return 0; } From c626bd37ec733dcc100898f23b66dd263382c061 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 27 Jul 2001 17:46:01 +0000 Subject: [PATCH 2053/7878] Hmmm... parent-child status messages need to be interwoven. This aught to do the trick. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62048 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.h | 8 ++++++-- test/server.c | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/aprtest.h b/test/aprtest.h index 825fa560446..e51ec50567b 100644 --- a/test/aprtest.h +++ b/test/aprtest.h @@ -56,8 +56,12 @@ #include "apr_general.h" #include "apr_strings.h" +#ifndef APR_TEST_PREFIX +#define APR_TEST_PREFIX "" +#endif + #define APR_TEST_BEGIN(rv, desc, op) \ - fprintf(stdout, "%s%.*s ", desc, \ + fprintf(stdout, "%s%.*s ", APR_TEST_PREFIX desc, \ strlen(desc) < 37 ? 40 - strlen(desc) : 3, \ "........................................"); \ APR_TEST_MORE(rv, op) @@ -66,7 +70,7 @@ if ((rv = (op)) != APR_SUCCESS) { \ char msgbuf[256]; \ fprintf (stdout, "Failed\n"); \ - fprintf (stderr, "%s Failed, error %d\n%s", #op, rv, \ + fprintf (stderr, "Error (%d): %s\n%s", rv, #op, \ apr_strerror(stat, msgbuf, sizeof(msgbuf))); \ exit(-1); } diff --git a/test/server.c b/test/server.c index add49cb7571..539da10ff85 100644 --- a/test/server.c +++ b/test/server.c @@ -52,6 +52,8 @@ * . */ +#define APR_TEST_PREFIX "server: " + #include "aprtest.h" #include #include "apr_network_io.h" From 075596fe403c32818efa75ef3fe3bdd5458e29e2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 27 Jul 2001 18:37:11 +0000 Subject: [PATCH 2054/7878] Improve ourselves git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62049 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.pl | 6 ++++-- test/aprtest.dsp | 8 ++++---- test/aprtest.h | 2 +- test/aprtest.win | 9 ++++++--- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl index 1b56b12c55e..eaf58e6b5d4 100644 --- a/test/MakeWin32Make.pl +++ b/test/MakeWin32Make.pl @@ -17,8 +17,8 @@ $t = ""; } if ($t =~ m|^LOCAL_LIBS=|) { - $t = "LOCAL_LIBS=\n" - . "ALL_LIBS=../LibD/apr.lib kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib\n\n"; + $t = "LOCAL_LIBS=../LibD/apr.lib\n" + . "ALL_LIBS=kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib\n\n"; } if ($t =~ s|\@CFLAGS\@||) { $t = ""; @@ -55,3 +55,5 @@ undef $srcfl; undef $dstfl; + +print "Generated Makefile from Makefile.in\n"; diff --git a/test/aprtest.dsp b/test/aprtest.dsp index 94ec0f5f569..771a3b76b5d 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -39,8 +39,8 @@ CFG=aprtest - Win32 Debug # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" -# PROP Cmd_Line "NMAKE /f aprtest.win /a" -# PROP Rebuild_Opt "" +# PROP Cmd_Line "NMAKE /f aprtest.win" +# PROP Rebuild_Opt "/a" # PROP Bsc_Name "" # PROP Target_Dir "" @@ -57,8 +57,8 @@ CFG=aprtest - Win32 Debug # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" -# PROP Cmd_Line "NMAKE /f aprtest.win /a" -# PROP Rebuild_Opt "" +# PROP Cmd_Line "NMAKE /f aprtest.win" +# PROP Rebuild_Opt "/a" # PROP Bsc_Name "" # PROP Target_Dir "" diff --git a/test/aprtest.h b/test/aprtest.h index e51ec50567b..5c26e43e761 100644 --- a/test/aprtest.h +++ b/test/aprtest.h @@ -1,4 +1,4 @@ -/* ==================================================================== + * ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights diff --git a/test/aprtest.win b/test/aprtest.win index fe343d4aeba..f2a42451f96 100644 --- a/test/aprtest.win +++ b/test/aprtest.win @@ -5,11 +5,14 @@ # E.g. add c:\program files\perl\bin to the list of directories !IF "$(TARGET)" == "" -TARGET=all +TARGET=ALL !ENDIF -all: Makefile +$(TARGET): Makefile $(MAKE) /nologo /f Makefile $(TARGET) -Makefile: Makefile.in +Makefile: Makefile.in MakeWin32Make.pl perl MakeWin32Make.pl + +clean: + del makefile *.obj *.exe *.idb *.pdb \ No newline at end of file From a067091b8a8f4e8554770ab8f65a5a2c28b375dd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 27 Jul 2001 19:12:46 +0000 Subject: [PATCH 2055/7878] Toss in apr_sms_trival for apr/test success git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62050 13f79535-47bb-0310-9956-ffa450edef68 --- apr.mak | 32 ++++++++++++++++++++++++++++++++ libapr.mak | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/apr.mak b/apr.mak index 37761c6d69d..aa2f59b33e1 100644 --- a/apr.mak +++ b/apr.mak @@ -56,6 +56,7 @@ CLEAN : -@erase "$(INTDIR)\apr_sms_blocks.obj" -@erase "$(INTDIR)\apr_sms_std.obj" -@erase "$(INTDIR)\apr_sms_tracking.obj" + -@erase "$(INTDIR)\apr_sms_trivial.obj" -@erase "$(INTDIR)\apr_snprintf.obj" -@erase "$(INTDIR)\apr_strings.obj" -@erase "$(INTDIR)\apr_strnatcmp.obj" @@ -163,6 +164,7 @@ LIB32_OBJS= \ "$(INTDIR)\apr_sms_blocks.obj" \ "$(INTDIR)\apr_sms_std.obj" \ "$(INTDIR)\apr_sms_tracking.obj" \ + "$(INTDIR)\apr_sms_trivial.obj" \ "$(INTDIR)\apr_snprintf.obj" \ "$(INTDIR)\apr_strings.obj" \ "$(INTDIR)\apr_strnatcmp.obj" \ @@ -246,6 +248,7 @@ CLEAN : -@erase "$(INTDIR)\apr_sms_blocks.obj" -@erase "$(INTDIR)\apr_sms_std.obj" -@erase "$(INTDIR)\apr_sms_tracking.obj" + -@erase "$(INTDIR)\apr_sms_trivial.obj" -@erase "$(INTDIR)\apr_snprintf.obj" -@erase "$(INTDIR)\apr_strings.obj" -@erase "$(INTDIR)\apr_strnatcmp.obj" @@ -353,6 +356,7 @@ LIB32_OBJS= \ "$(INTDIR)\apr_sms_blocks.obj" \ "$(INTDIR)\apr_sms_std.obj" \ "$(INTDIR)\apr_sms_tracking.obj" \ + "$(INTDIR)\apr_sms_trivial.obj" \ "$(INTDIR)\apr_snprintf.obj" \ "$(INTDIR)\apr_strings.obj" \ "$(INTDIR)\apr_strnatcmp.obj" \ @@ -972,6 +976,34 @@ DEP_CPP_APR_SMS_=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\memory\unix\apr_sms_trivial.c +DEP_CPP_APR_SMS_T=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_sms_trivial.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\memory\unix\sms_private.h"\ + + +"$(INTDIR)\apr_sms_trivial.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_T) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\misc\unix\errorcodes.c DEP_CPP_ERROR=\ ".\include\apr.h"\ diff --git a/libapr.mak b/libapr.mak index 74ecee541d6..e430ed0995c 100644 --- a/libapr.mak +++ b/libapr.mak @@ -56,6 +56,7 @@ CLEAN : -@erase "$(INTDIR)\apr_sms_blocks.obj" -@erase "$(INTDIR)\apr_sms_std.obj" -@erase "$(INTDIR)\apr_sms_tracking.obj" + -@erase "$(INTDIR)\apr_sms_trivial.obj" -@erase "$(INTDIR)\apr_snprintf.obj" -@erase "$(INTDIR)\apr_strings.obj" -@erase "$(INTDIR)\apr_strnatcmp.obj" @@ -171,6 +172,7 @@ LINK32_OBJS= \ "$(INTDIR)\apr_sms_blocks.obj" \ "$(INTDIR)\apr_sms_std.obj" \ "$(INTDIR)\apr_sms_tracking.obj" \ + "$(INTDIR)\apr_sms_trivial.obj" \ "$(INTDIR)\apr_snprintf.obj" \ "$(INTDIR)\apr_strings.obj" \ "$(INTDIR)\apr_strnatcmp.obj" \ @@ -254,6 +256,7 @@ CLEAN : -@erase "$(INTDIR)\apr_sms_blocks.obj" -@erase "$(INTDIR)\apr_sms_std.obj" -@erase "$(INTDIR)\apr_sms_tracking.obj" + -@erase "$(INTDIR)\apr_sms_trivial.obj" -@erase "$(INTDIR)\apr_snprintf.obj" -@erase "$(INTDIR)\apr_strings.obj" -@erase "$(INTDIR)\apr_strnatcmp.obj" @@ -370,6 +373,7 @@ LINK32_OBJS= \ "$(INTDIR)\apr_sms_blocks.obj" \ "$(INTDIR)\apr_sms_std.obj" \ "$(INTDIR)\apr_sms_tracking.obj" \ + "$(INTDIR)\apr_sms_trivial.obj" \ "$(INTDIR)\apr_snprintf.obj" \ "$(INTDIR)\apr_strings.obj" \ "$(INTDIR)\apr_strnatcmp.obj" \ @@ -989,6 +993,34 @@ DEP_CPP_APR_SMS_=\ $(CPP) $(CPP_PROJ) $(SOURCE) +SOURCE=.\memory\unix\apr_sms_trivial.c +DEP_CPP_APR_SMS_T=\ + ".\include\apr.h"\ + ".\include\apr_dso.h"\ + ".\include\apr_errno.h"\ + ".\include\apr_file_info.h"\ + ".\include\apr_file_io.h"\ + ".\include\apr_general.h"\ + ".\include\apr_inherit.h"\ + ".\include\apr_lock.h"\ + ".\include\apr_network_io.h"\ + ".\include\apr_pools.h"\ + ".\include\apr_portable.h"\ + ".\include\apr_sms.h"\ + ".\include\apr_sms_trivial.h"\ + ".\include\apr_thread_proc.h"\ + ".\include\apr_time.h"\ + ".\include\apr_user.h"\ + ".\include\apr_want.h"\ + ".\include\arch\win32\apr_private.h"\ + ".\memory\unix\sms_private.h"\ + + +"$(INTDIR)\apr_sms_trivial.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_T) "$(INTDIR)"\ + ".\include\apr.h" + $(CPP) $(CPP_PROJ) $(SOURCE) + + SOURCE=.\misc\unix\errorcodes.c DEP_CPP_ERROR=\ ".\include\apr.h"\ From ab3db030523c2ec226c9cb4403532ec4fbbb9e7a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 27 Jul 2001 19:19:56 +0000 Subject: [PATCH 2056/7878] Fix a typo in aprtest.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62051 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/aprtest.h b/test/aprtest.h index 5c26e43e761..aa8aa238859 100644 --- a/test/aprtest.h +++ b/test/aprtest.h @@ -1,4 +1,4 @@ - * ==================================================================== + /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights From 4d4f3bc02ffbce86a3e313938dfcf79793d1261e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 27 Jul 2001 19:21:39 +0000 Subject: [PATCH 2057/7878] Remove unused pool variables from the testthread code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62052 13f79535-47bb-0310-9956-ffa450edef68 --- test/testthread.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/testthread.c b/test/testthread.c index 5bf9a27b6a5..a9a9b22f254 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -87,7 +87,6 @@ apr_status_t exit_ret_val = 123; /* just some made up number to check on later * void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data) { int i; - apr_pool_t *pool = apr_thread_pool_get(thd); for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; @@ -100,7 +99,6 @@ void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data) void * APR_THREAD_FUNC thread_func2(apr_thread_t *thd, void *data) { int i; - apr_pool_t *pool = apr_thread_pool_get(thd); for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; @@ -113,7 +111,6 @@ void * APR_THREAD_FUNC thread_func2(apr_thread_t *thd, void *data) void * APR_THREAD_FUNC thread_func3(apr_thread_t *thd, void *data) { int i; - apr_pool_t *pool = apr_thread_pool_get(thd); for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; @@ -126,7 +123,6 @@ void * APR_THREAD_FUNC thread_func3(apr_thread_t *thd, void *data) void * APR_THREAD_FUNC thread_func4(apr_thread_t *thd, void *data) { int i; - apr_pool_t *pool = apr_thread_pool_get(thd); for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; From b2e32964ba57f40b5c2be7ceed06c7c35819bfab Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 28 Jul 2001 03:26:59 +0000 Subject: [PATCH 2058/7878] Reorder test so make_exports.awk recognises that it needs to go in exports.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62053 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 8b33d403258..b0d6b1a111b 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -587,7 +587,7 @@ APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, #if APR_HAS_THREADS -#if !defined(OS2) && APR_HAVE_SIGWAIT +#if APR_HAVE_SIGWAIT && !defined(OS2) /** * Setup the process for a single thread to be used for all signal handling. From 35d29bee39748b69b571d9fc5be2287f3f511106 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 30 Jul 2001 03:04:07 +0000 Subject: [PATCH 2059/7878] Pretty good day today. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62055 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 35355d76b1d..8dbf1d8a612 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/07/26 18:52:51 $] +Last modified at [$Date: 2001/07/30 03:04:07 $] Release: @@ -110,6 +110,9 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: get around to it soonish... * toss the per-Makefile setup of INCLUDES; shift to rules.mk.in + rbb: This is a bad thing IMHO. If we do this, then we + can't use these makefiles for anything else. For example, + apr-util * add the rest of the pool accessor declare/impl macros. Justin says: Both thread and file have the accessors now. Any others? From 84ec51f61577e43931cc5f3c82b19664abcc888f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 30 Jul 2001 03:12:28 +0000 Subject: [PATCH 2060/7878] Fix a potential source of confusion... any bad filename string is EINVAL git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62056 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 998c7a12d3c..05440654ef5 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -98,7 +98,7 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, } if (rv = conv_utf8_to_ucs2(srcstr, &srcremains, t, &retremains)) { - return rv; + return (rv == APR_INCOMPLETE) ? APR_EINVAL : rv; } if (srcremains) { return APR_ENAMETOOLONG; From 1682a18f9a40a676c2d999be93dec2b43177988a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 30 Jul 2001 04:20:03 +0000 Subject: [PATCH 2061/7878] The rules.mk files must use something other than top_builddir. This is so that multiple source trees can all use $(top_builddir), and just use APR's rules.mk file. Without this, every source tree that uses this rules.mk file, thinks it's top_builddir is APR's top_builddir. This ties in with the next commit to APR-util to make it use APR's build directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62057 13f79535-47bb-0310-9956-ffa450edef68 --- build/rules.mk.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/rules.mk.in b/build/rules.mk.in index 9786d8709f2..a241da65886 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -61,7 +61,7 @@ # # Configuration variables # -top_builddir=@top_builddir@ +apr_builddir=@top_builddir@ apr_builders=@apr_builders@ CC=@CC@ From 36453f05b47a4abdc0ca604d34448e1cb72d111e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 30 Jul 2001 04:21:48 +0000 Subject: [PATCH 2062/7878] Quickly parse the libtool.m4 file to use $(apr_builddir) instead of $(top_builddir). This allows apr-util to use APR's build directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62058 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildconf b/buildconf index c2a455aa722..e86bd91359f 100755 --- a/buildconf +++ b/buildconf @@ -85,7 +85,7 @@ if [ ! -f $ltfile ]; then fi rm -f build/libtool.m4 -cp $ltfile build/libtool.m4 +cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 # This is just temporary until people's workspaces are cleared -- remove # any old aclocal.m4 left over from prior build so it doesn't cause errors. From 8e6a211cbd4efa54dd580df0a723cce113a3deb4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 30 Jul 2001 17:25:54 +0000 Subject: [PATCH 2063/7878] printf() * variable (as in "%.*s") must be int git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62059 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/aprtest.h b/test/aprtest.h index aa8aa238859..7487a2d4a14 100644 --- a/test/aprtest.h +++ b/test/aprtest.h @@ -62,7 +62,7 @@ #define APR_TEST_BEGIN(rv, desc, op) \ fprintf(stdout, "%s%.*s ", APR_TEST_PREFIX desc, \ - strlen(desc) < 37 ? 40 - strlen(desc) : 3, \ + strlen(desc) < 37 ? (int)(40 - strlen(desc)) : 3, \ "........................................"); \ APR_TEST_MORE(rv, op) From eb9f1c0559b0cffdd030b4ec057f6e2058e1c36d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 30 Jul 2001 17:31:54 +0000 Subject: [PATCH 2064/7878] if your system has pthread_mutexattr_setrobust_np()* we'll use it, but we shouldn't require it in order to support cross process pthread mutexes (i.e., Solaris) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62060 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index a8abf544850..06d3f3fbbcc 100644 --- a/configure.in +++ b/configure.in @@ -1041,7 +1041,7 @@ APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1", hasfcntlser="0") # note: the current APR use of shared mutex requires /dev/zero APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl func:pthread_mutexattr_setpshared dnl - func:pthread_mutexattr_setrobust_np file:/dev/zero, + file:/dev/zero, hasprocpthreadser="1", hasprocpthreadser="0") APR_IFALLYES(struct:pthread_rw, hasrwlockser="1", hasrwlockser="0") @@ -1057,7 +1057,7 @@ APR_IFALLYES(header:fcntl.h define:F_SETLK, # note: the current APR use of shared mutex requires /dev/zero APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl func:pthread_mutexattr_setpshared dnl - func:pthread_mutexattr_setrobust_np file:/dev/zero, + file:/dev/zero, APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) From fe486c46062a4df64b67836f4a7c8657476988e9 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 30 Jul 2001 17:56:16 +0000 Subject: [PATCH 2065/7878] Performance: Add new socket option, APR_INCOMPLETE_READ, that should be set when you expect the first non-blocking read to fail with EAGAIN. Setting APR_INCOMPLETE_READ prior to calling apr_read will cause select() to be called first to wait for bytes to read. [Brian Pane, Dean Gaudet] Reviewed by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62061 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ include/apr_network_io.h | 11 +++++++++++ network_io/unix/sendrecv.c | 14 ++++++++++++-- network_io/unix/sockopt.c | 9 +++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 5740b337eb6..75979797e18 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) Add new socket option, APR_INCOMPLETE_READ, that should be + set when you expect the first non-blocking read to fail with + EAGAIN. Setting APR_INCOMPLETE_READ prior to calling apr_read + will cause select() to be called first to wait for bytes + to read. [Brian Pane, Dean Gaudet] + *) Better installation. This makes us install the APRVARS file, as well as MM. [Ryan Bloom] diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 9441abc7d66..d49a01ac0fb 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -103,6 +103,17 @@ extern "C" { * APR_TCP_NODELAY should be turned on * again when NOPUSH is turned off */ +#define APR_INCOMPLETE_READ 4096 /* Set on non-blocking sockets + * (APR_SO_TIMEOUT != 0) on which the + * previous read() did not fill a buffer + * completely. the next apr_recv() will + * first call select()/poll() rather than + * going straight into read(). (Can also + * be set by an application to force a + * select()/poll() call before the next + * read, in cases where the app expects + * that an immediate read would fail.) + */ #define APR_POLLIN 0x001 #define APR_POLLPRI 0x002 diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 304be1b3dc9..17b25a5ef06 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -125,14 +125,21 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) { ssize_t rv; - + apr_status_t arv; + + if (sock->netmask & APR_INCOMPLETE_READ) { + sock->netmask &= ~APR_INCOMPLETE_READ; + goto do_select; + } + do { rv = read(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 1); +do_select: + arv = apr_wait_for_io_or_timeout(sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -147,6 +154,9 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) (*len) = 0; return errno; } + if (sock->timeout && rv < *len) { + sock->netmask |= APR_INCOMPLETE_READ; + } (*len) = rv; if (rv == 0) { return APR_EOF; diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index fdf8b8b4e98..db90aac863e 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -203,6 +203,12 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o } } } + /* must disable the incomplete read support if we change to a + * blocking socket. + */ + if (on == 0) { + sock->netmask &= ~APR_INCOMPLETE_READ; + } sock->timeout = on; apr_set_option(&sock->netmask, APR_SO_TIMEOUT, on); } @@ -266,6 +272,9 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o return APR_ENOTIMPL; #endif } + if (opt & APR_INCOMPLETE_READ) { + apr_set_option(&sock->netmask, APR_INCOMPLETE_READ, on); + } return APR_SUCCESS; } From 24b16a9dd0a01678cd65565c7d04276ce7d520cd Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 30 Jul 2001 18:06:26 +0000 Subject: [PATCH 2066/7878] default to fcntl() for cross-process locks git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62062 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 06d3f3fbbcc..a33d48500cc 100644 --- a/configure.in +++ b/configure.in @@ -1052,13 +1052,13 @@ APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) APR_IFALLYES(func:flock define:LOCK_EX, APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) -APR_IFALLYES(header:fcntl.h define:F_SETLK, - APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) # note: the current APR use of shared mutex requires /dev/zero APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl func:pthread_mutexattr_setpshared dnl file:/dev/zero, APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) +APR_IFALLYES(header:fcntl.h define:F_SETLK, + APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) fi From 247dc2c36595e5c6a1f14a2f6fc8c40b7c01eecc Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 31 Jul 2001 02:10:11 +0000 Subject: [PATCH 2067/7878] Support the AIX, glibc2, and Solaris variants of gethostby{name|addr}_r. Use gethostbyaddr_r function when available. The AIX gurus will have to test this to make sure I got their prototype right. This compiles on Solaris. Submitted by: Sterling Hughes (Modified by Justin) Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62063 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++ acconfig.h | 1 + build/apr_network.m4 | 63 +++++++++++++++++++++++++++++++++++++ configure.in | 9 +++++- network_io/unix/sa_common.c | 60 ++++++++++++++++++++++++++++++++--- 5 files changed, 131 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 75979797e18..89762cc744f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Support the AIX, glibc2, and Solaris variants of gethostby{name|addr}_r. + Use gethostbyaddr_r function when available. + [Sterling Hughes ] + *) Add new socket option, APR_INCOMPLETE_READ, that should be set when you expect the first non-blocking read to fail with EAGAIN. Setting APR_INCOMPLETE_READ prior to calling apr_read diff --git a/acconfig.h b/acconfig.h index 89909514e10..22047e54556 100644 --- a/acconfig.h +++ b/acconfig.h @@ -24,6 +24,7 @@ #undef READDIR_IS_THREAD_SAFE #undef GETHOSTBYNAME_IS_THREAD_SAFE +#undef GETHOSTBYADDR_IS_THREAD_SAFE #undef NEED_RLIM_T #undef USEBCOPY diff --git a/build/apr_network.m4 b/build/apr_network.m4 index ecbf36e3dff..e9278d66129 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -145,6 +145,69 @@ if test "$ac_cv_gethostbyname_nas" = "yes"; then fi ]) +dnl +dnl Checks the definition of gethostbyname_r and gethostbyaddr_r +dnl which are different for glibc, solaris and assorted other operating +dnl systems +dnl +dnl Note that this test is executed too early to see if we have all of +dnl the headers. +AC_DEFUN(APR_CHECK_GETHOSTBYNAME_R_STYLE,[ + +dnl Try and compile a glibc2 gethostbyname_r piece of code, and set the +dnl style of the routines to glibc2 on success +AC_CACHE_CHECK([style of gethostbyname_r routine], ac_cv_gethostbyname_r_style, +APR_TRY_COMPILE_NO_WARNING([ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +],[ +int tmp = gethostbyname_r((const char *) 0, (struct hostent *) 0, + (char *) 0, 0, (struct hostent **) 0, &tmp); +], ac_cv_gethostbyname_r_style=glibc2, ac_cv_gethostbyname_r_style=none)) + +if test "$ac_cv_gethostbyname_r_style" = "glibc2"; then + AC_DEFINE(GETHOSTBYNAME_R_GLIBC2, 1, [Define if gethostbyname_r has the glibc style]) +fi + +AC_CACHE_CHECK([3rd argument to the gethostbyname_r routines], ac_cv_gethostbyname_r_arg, +APR_TRY_COMPILE_NO_WARNING([ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +],[ +int tmp = gethostbyname_r((const char *) 0, (struct hostent *) 0, + (struct hostent_data *) 0);], +ac_cv_gethostbyname_r_arg=hostent_data, ac_cv_gethostbyname_r_arg=char)) + +if test "$ac_cv_gethostbyname_r_arg" = "hostent_data"; then + AC_DEFINE(GETHOSTBYNAME_R_HOSTENT_DATA, 1, [Define if gethostbyname_r has the hostent_data for the third argument]) +fi +]) dnl dnl see if TCP_NODELAY setting is inherited from listening sockets diff --git a/configure.in b/configure.in index a33d48500cc..656f3271b31 100644 --- a/configure.in +++ b/configure.in @@ -338,11 +338,13 @@ fi ac_cv_define_READDIR_IS_THREAD_SAFE=no ac_cv_define_GETHOSTBYNAME_IS_THREAD_SAFE=no +ac_cv_define_GETHOSTBYADDR_IS_THREAD_SAFE=no if test "$threads" = "1"; then echo "APR will use threads" AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE)) AC_CHECK_LIB(c_r, gethostbyname, AC_DEFINE(GETHOSTBYNAME_IS_THREAD_SAFE)) - AC_CHECK_FUNCS(gethostbyname_r) + AC_CHECK_LIB(c_r, gethostbyaddr, AC_DEFINE(GETHOSTBYADDR_IS_THREAD_SAFE)) + AC_CHECK_FUNCS(gethostbyname_r gethostbyaddr_r) else echo "APR will be non-threaded" fi @@ -1196,6 +1198,11 @@ APR_CHECK_SOCKADDR_SA_LEN APR_CHECK_GETHOSTBYNAME_NAS +dnl Check the types only if we have gethostbyname_r +if test "$ac_cv_func_gethostbyname_r" = "yes"; then + APR_CHECK_GETHOSTBYNAME_R_STYLE +fi + APR_CHECK_TCP_NODELAY_INHERITED dnl # Look for a way of corking TCP... diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 644906acba3..0907ab8a18f 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -394,7 +394,11 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, int curaddr; #if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) +#ifdef GETHOSTBYNAME_R_HOSTENT_DATA + struct hostent_data hd; +#else char tmp[GETHOSTBYNAME_BUFLEN]; +#endif int hosterror; struct hostent hs; #endif @@ -415,8 +419,19 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, #endif #if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) - hp = gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, +#if defined(GETHOSTBYNAME_R_HOSTENT_DATA) + /* AIX, HP/UX, D/UX et alia */ + gethostbyname_r(hostname, &hs, &hd); + hp = &hs; +#elif defined(GETHOSTBYNAME_R_GLIBC2) + /* Linux glibc2+ */ + gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, + &hp, &hosterror); +#else + /* Solaris, Irix et alia */ + hp = gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hosterror); +#endif #else hp = gethostbyname(hostname); #endif @@ -426,9 +441,13 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, apr_get_netos_error(); #elif APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) +#ifdef GETHOSTBYNAME_R_HOSTENT_DATA + return (h_errno + APR_OS_START_SYSERR); +#else /* If you see ERANGE, that means GETHOSBYNAME_BUFLEN needs to be * bumped. */ return (hosterror + APR_OS_START_SYSERR); +#endif #else return (h_errno + APR_OS_START_SYSERR); #endif @@ -501,18 +520,49 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, tmphostname); return APR_SUCCESS; +#else +#if APR_HAS_THREADS && !defined(GETHOSTBYADDR_IS_THREAD_SAFE) && \ + defined(HAVE_GETHOSTBYADDR_R) && !defined(BEOS) +#ifdef GETHOSTBYNAME_R_HOSTENT_DATA + struct hostent_data hd; +#else + char tmp[GETHOSTBYNAME_BUFLEN]; +#endif + int hosterror; + struct hostent hs, *hptr; + +#if defined(GETHOSTBYNAME_R_HOSTENT_DATA) + /* AIX, HP/UX, D/UX et alia */ + gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, + sizeof(struct in_addr), AF_INET, &hs, &hd); + hptr = &hs; +#elif defined(GETHOSTBYNAME_R_GLIBC2) + /* Linux glibc2+ */ + gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, + sizeof(struct in_addr), AF_INET, + &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hptr, &hosterror); +#else + /* Solaris, Irix et alia */ + hptr = gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, + sizeof(struct in_addr), AF_INET, + &hs, tmp, GETHOSTBYNAME_BUFLEN, &hosterror); +#endif #else struct hostent *hptr; - hptr = gethostbyaddr((char *)&sockaddr->sa.sin.sin_addr, - sizeof(struct in_addr), - AF_INET); + sizeof(struct in_addr), AF_INET); +#endif + if (hptr) { *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, hptr->h_name); return APR_SUCCESS; } *hostname = NULL; -#if defined(WIN32) +#if APR_HAS_THREADS && !defined(GETHOSTBYADDR_IS_THREAD_SAFE) && \ + defined(HAVE_GETHOSTBYADDR_R) && !defined(BEOS) && \ + !defined(GETHOSTBYNAME_R_HOSTENT_DATA) + return hosterror + APR_OS_START_SYSERR; +#elif defined(WIN32) return apr_get_netos_error(); #elif defined(OS2) return h_errno; From 0069242719e334a05fddc862616ccb85a9f22254 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 31 Jul 2001 05:59:36 +0000 Subject: [PATCH 2068/7878] Remove the dependency on IPv6 for getnameinfo(). A system can have getnameinfo(), but not IPv6. (Solaris 7.) I made a similar change for getaddrinfo a week or two ago. No complaints so far for that commit, so see how this fares. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62064 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 0907ab8a18f..9b27b7fe779 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -487,7 +487,7 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, apr_sockaddr_t *sockaddr, apr_int32_t flags) { -#if defined(HAVE_GETNAMEINFO) && APR_HAVE_IPV6 +#if defined(HAVE_GETNAMEINFO) int rc; #if defined(NI_MAXHOST) char tmphostname[NI_MAXHOST]; From 2074a24482ef02d9d2ea43b7d9379b338de6b9f0 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 31 Jul 2001 06:15:41 +0000 Subject: [PATCH 2069/7878] Fix tpyo. (Caused getnameinfo to always be defined as present even when it is not.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62065 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index e9278d66129..2da1daf44a6 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -98,7 +98,7 @@ void main(void) { ],[ ac_cv_working_getnameinfo="yes" ])]) -if test "$ac_cv_working_getnameinfo"="yes"; then +if test "$ac_cv_working_getnameinfo" = "yes"; then AC_DEFINE(HAVE_GETNAMEINFO, 1, [Define if getnameinfo exists]) fi ]) From e636f63d05b185ec7045208b5a8f1c5b5f38a130 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 31 Jul 2001 19:51:34 +0000 Subject: [PATCH 2070/7878] Missing fn git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62066 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/seek.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 1af5ce62f60..5698c356970 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -89,7 +89,6 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) } - APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { apr_finfo_t finfo; @@ -168,3 +167,26 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh return rc; } } + + +APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *thefile, apr_off_t offset) +{ + apr_status_t rv; + DWORD offlo = (DWORD)offset; + DWORD offhi = (DWORD)(offset >> 32); + DWORD rc; + + rc = SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); + if (rc == 0xFFFFFFFF) + if ((rv = apr_get_os_error()) != APR_SUCCESS) + return rv; + + if (!SetEndOfFile(thefile->filehand)) + return apr_get_os_error(); + + if (thefile->buffered) { + return setptr(thefile, offset); + } + + return APR_SUCCESS; +} From 73c96cfe9455c7e0a3a7f87eea7d1dc5d6d8cde2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 1 Aug 2001 15:56:36 +0000 Subject: [PATCH 2071/7878] Fix the unresolved reference to pthread_sigmask() on Darwin. While I did not find definitive information that SIGPROCMASK_SETS_THREAD_MASK on Darwin, I did see that some other apps are using sigprocmask() in lieu of pthread_sigmask(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62067 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 841cfa8e5be..cad08aa585c 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -165,7 +165,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DRHAPSODY]) ;; *-apple-darwin*) - APR_ADDTO(CPPFLAGS, [-DDARWIN]) + APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK]) ;; *-dec-osf*) APR_ADDTO(CPPFLAGS, [-DOSF1]) From 26484d222a773dad8656056e0823f0eb8fcfcaf2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 1 Aug 2001 16:45:48 +0000 Subject: [PATCH 2072/7878] fix apr_thread_join() on Unix to pick up the correct thread exit status code git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62068 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/thread.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 634c08b82a1..d2a56842854 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -186,8 +186,10 @@ apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { apr_status_t stat; + apr_status_t *thread_stat; - if ((stat = pthread_join(*thd->td,(void *)&retval)) == 0) { + if ((stat = pthread_join(*thd->td,(void *)&thread_stat)) == 0) { + *retval = *thread_stat; return APR_SUCCESS; } else { From c7d02b04b89373ad7a4b902ed7318f160bcfb9ca Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 1 Aug 2001 16:49:29 +0000 Subject: [PATCH 2073/7878] get rid of vestigial !APR_HAS_THREADS logic flush stdout before writing to stderr, as no '\n' was written previously to the stdout buffer git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62069 13f79535-47bb-0310-9956-ffa450edef68 --- test/testthread.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/testthread.c b/test/testthread.c index a9a9b22f254..ee879006b87 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -134,7 +134,6 @@ void * APR_THREAD_FUNC thread_func4(apr_thread_t *thd, void *data) int main(void) { -#if APR_HAS_THREADS apr_thread_t *t1; apr_thread_t *t2; apr_thread_t *t3; @@ -148,6 +147,7 @@ int main(void) fprintf(stdout, "Initializing the context......."); if (apr_pool_create(&context, NULL) != APR_SUCCESS) { + fflush(stdout); fprintf(stderr, "could not initialize\n"); exit(-1); } @@ -156,6 +156,7 @@ int main(void) fprintf(stdout, "Initializing the lock......."); s1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); if (s1 != APR_SUCCESS) { + fflush(stdout); fprintf(stderr, "Could not create lock\n"); exit(-1); } @@ -168,6 +169,7 @@ int main(void) s4 = apr_thread_create(&t4, NULL, thread_func4, NULL, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || s3 != APR_SUCCESS || s4 != APR_SUCCESS) { + fflush(stdout); fprintf(stderr, "Error starting thread\n"); exit(-1); } @@ -178,24 +180,27 @@ int main(void) apr_thread_join(&s2, t2); apr_thread_join(&s3, t3); apr_thread_join(&s4, t4); - fprintf (stdout, "OK\n"); + fprintf(stdout, "OK\n"); fprintf(stdout, "Checking thread's returned value......."); if (s1 != exit_ret_val || s2 != exit_ret_val || s3 != exit_ret_val || s4 != exit_ret_val) { - fprintf(stderr, "Invalid return value (not expected value)\n"); + fflush(stdout); + fprintf(stderr, + "Invalid return value %d/%d/%d/%d (not expected value %d)\n", + s1, s2, s3, s4, exit_ret_val); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Checking if locks worked......."); if (x != 40000) { + fflush(stdout); fprintf(stderr, "The locks didn't work???? %d\n", x); } else { fprintf(stdout, "Everything is working!\n"); } -#endif return 1; } From 4838233f0cd841bfc5fa07840dbc5257f089a851 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 1 Aug 2001 16:54:58 +0000 Subject: [PATCH 2074/7878] if the thread returns NULL instead of the address of an apr_status_t then assume a status of APR_SUCCESS in apr_thread_join() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62070 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index d2a56842854..daa8b25660f 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -189,7 +189,7 @@ apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) apr_status_t *thread_stat; if ((stat = pthread_join(*thd->td,(void *)&thread_stat)) == 0) { - *retval = *thread_stat; + *retval = thread_stat ? *thread_stat : APR_SUCCESS; return APR_SUCCESS; } else { From beca9e645e843d75d659ce921db4cc38083450af Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 1 Aug 2001 18:03:33 +0000 Subject: [PATCH 2075/7878] free the whole list of addrinfo structures returned by getaddrinfo() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62071 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 9b27b7fe779..3df2679be33 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -338,7 +338,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, #if defined(HAVE_GETADDRINFO) if (hostname != NULL) { - struct addrinfo hints, *ai; + struct addrinfo hints, *ai, *ai_list; apr_sockaddr_t *cursa; int error; char num[8]; @@ -349,7 +349,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; apr_snprintf(num, sizeof(num), "%d", port); - error = getaddrinfo(hostname, num, &hints, &ai); + error = getaddrinfo(hostname, num, &hints, &ai_list); if (error) { if (error == EAI_SYSTEM) { return errno; @@ -366,6 +366,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, } } cursa = *sa; + ai = ai_list; save_addrinfo(p, cursa, ai, port); while (ai->ai_next) { /* while more addresses to report */ cursa->next = apr_pcalloc(p, sizeof(apr_sockaddr_t)); @@ -373,7 +374,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, cursa = cursa->next; save_addrinfo(p, cursa, ai, port); } - freeaddrinfo(ai); + freeaddrinfo(ai_list); } else { if (family == APR_UNSPEC) { From dbd9a2f080d2936db81463db010136a36259a8f3 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 1 Aug 2001 20:37:03 +0000 Subject: [PATCH 2076/7878] Add ALL_LIBS to the link command for APR since LINK is used for building the test programs in apr-util. Export the so_ext and lib_target macros via APRVARS. This is needed in the Makefiles for apr-util. (lib_target needs to be escaped.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62072 13f79535-47bb-0310-9956-ffa450edef68 --- APRVARS.in | 3 +++ configure.in | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/APRVARS.in b/APRVARS.in index ca1f3571d06..b91cda6552a 100644 --- a/APRVARS.in +++ b/APRVARS.in @@ -8,3 +8,6 @@ EXTRA_LIBS="@EXTRA_LIBS@" EXTRA_INCLUDES="@EXTRA_INCLUDES@" LIBTOOL_LIBS="@LIBTOOL_LIBS@" APR_SOURCE_DIR="@abs_srcdir@" +APR_SO_EXT="@so_ext@" +APR_LIB_TARGET="@export_lib_target@" + diff --git a/configure.in b/configure.in index 656f3271b31..e8689ee05e7 100644 --- a/configure.in +++ b/configure.in @@ -111,20 +111,23 @@ AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the if test "x$use_libtool" = "xyes"; then lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -c $< && touch $@' - link='$(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(ALL_LDFLAGS) -o $@' + link='$(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(ALL_LDFLAGS) $(ALL_LIBS) -o $@' so_ext='lo' lib_target='-rpath $(libdir) $$objects' + export_lib_target='-rpath $(libdir) \$\$objects' else lt_compile='$(COMPILE) -c $<' link='$(AR) cr $(TARGET_LIB) $$objects; $(RANLIB) $(TARGET_LIB)' so_ext='o' lib_target='' + export_lib_target='' fi AC_SUBST(lt_compile) AC_SUBST(link) AC_SUBST(so_ext) AC_SUBST(lib_target) +AC_SUBST(export_lib_target) AC_SUBST(LTFLAGS) AC_SUBST(LT_LDFLAGS) From 4ffc6a697612394f70ed6671d7a328a9a1cf15b5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 1 Aug 2001 21:06:26 +0000 Subject: [PATCH 2077/7878] change some of the test programs to use exit status 0 for success git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62073 13f79535-47bb-0310-9956-ffa450edef68 --- test/testargs.c | 2 +- test/testfile.c | 2 +- test/testlock.c | 2 +- test/testmmap.c | 2 +- test/testpipe.c | 2 +- test/testpoll.c | 2 +- test/testsockopt.c | 2 +- test/testtime.c | 2 +- test/testud.c | 2 +- test/testuser.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/testargs.c b/test/testargs.c index a5f6593a583..11b17996293 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -112,5 +112,5 @@ int main(int argc, const char * const argv[]) while (opt->ind < opt->argc) printf("extra arg: %s\n", opt->argv[opt->ind++]); - return 1; + return 0; } diff --git a/test/testfile.c b/test/testfile.c index 8f8bae3958f..94280578826 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -243,7 +243,7 @@ int main(void) apr_pool_destroy(pool); printf("\nAll tests passed OK\n"); - return 1; + return 0; } void test_filedel(apr_pool_t *pool) diff --git a/test/testlock.c b/test/testlock.c index 229b4de0154..d4d8a8b7f8a 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -308,7 +308,7 @@ int main(void) exit(-4); } - return 1; + return 0; } #endif /* !APR_HAS_THREADS */ diff --git a/test/testmmap.c b/test/testmmap.c index 0fe59b90e8a..0aafd43e689 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -142,7 +142,7 @@ int main(void) fprintf (stdout,"\nTest Complete\n"); - return 1; + return 0; #else fprintf(stdout,"APR MMAP Test\n*************\n\n"); fprintf(stdout,"Failed! APR was not built with MMAP.\n"); diff --git a/test/testpipe.c b/test/testpipe.c index 98659c26aac..e3cf491784d 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -114,5 +114,5 @@ int main(void) exit(-1); } - return 1; + return 0; } diff --git a/test/testpoll.c b/test/testpoll.c index 510d2c33bf7..0f12b293673 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -220,5 +220,5 @@ int main(void) } } printf ("OK\n"); - return 1; + return 0; } diff --git a/test/testsockopt.c b/test/testsockopt.c index f0b9641bf8f..ac2886f8298 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -216,5 +216,5 @@ int main(void) } printf("OK\n"); - return 1; + return 0; } diff --git a/test/testtime.c b/test/testtime.c index fdb2475776c..9a6033a40a3 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -179,6 +179,6 @@ int main(void) printf(" ( %lld - %lld = %lld )\n", imp, now, imp - now); printf("\nTest Complete.\n"); - return 1; + return 0; } diff --git a/test/testud.c b/test/testud.c index eff25509865..d98b224e799 100644 --- a/test/testud.c +++ b/test/testud.c @@ -106,5 +106,5 @@ int main(void) 0, "OK","Failed :(") printf("\nTest complete\n"); - return 1; + return 0; } diff --git a/test/testuser.c b/test/testuser.c index 9c7b3e43a8b..e12457a1dca 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -135,6 +135,6 @@ int main(int argc, char *argv[]) printf("home directory for %s (member of %s) is:\n`%s'\n", username, groupname, homedir); - return 1; + return 0; } #endif /* APR_HAS_USER */ From 498e21394ccee578becf5e8e54d2cf5e2f23c191 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 1 Aug 2001 22:57:32 +0000 Subject: [PATCH 2078/7878] Forgot to escape the $ in libdir. This breaks the apr-util build with libtool-1.4, but not with libtool-1.3. Odd. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62074 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index e8689ee05e7..7b89f0e0604 100644 --- a/configure.in +++ b/configure.in @@ -114,7 +114,7 @@ if test "x$use_libtool" = "xyes"; then link='$(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(ALL_LDFLAGS) $(ALL_LIBS) -o $@' so_ext='lo' lib_target='-rpath $(libdir) $$objects' - export_lib_target='-rpath $(libdir) \$\$objects' + export_lib_target='-rpath \$(libdir) \$\$objects' else lt_compile='$(COMPILE) -c $<' link='$(AR) cr $(TARGET_LIB) $$objects; $(RANLIB) $(TARGET_LIB)' From fb7f5fa4d9c879797f57d9b982e4734a0bf7d002 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 1 Aug 2001 23:22:47 +0000 Subject: [PATCH 2079/7878] Almost used this when I thought our contents were going out of context. Turns out the hash contents were really corrupted by a request merge, but heck, this is still useful. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62075 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 1 + tables/apr_hash.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/apr_hash.h b/include/apr_hash.h index a834318a3c2..12d60dae1ab 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -195,6 +195,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p, const apr_hash_t *overlay, const apr_hash_t *base); +APR_DECLARE(apr_pool_t *) apr_hash_pool_get(apr_hash_t *hash); #ifdef __cplusplus } #endif diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 21f8c405886..b21c5f33c1f 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -380,3 +380,5 @@ APR_DECLARE(apr_hash_t*) apr_hash_overlay(apr_pool_t *p, } return res; } + +APR_POOL_IMPLEMENT_ACCESSOR(hash) From 530431c1f5490e74296ed88294d8d96b4b7acef3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 2 Aug 2001 00:03:44 +0000 Subject: [PATCH 2080/7878] Quell a slow leak. The iterator's allocation is NOT pertinant to the hash! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62076 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 9 +++++---- tables/apr_hash.c | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index 12d60dae1ab..b7f80bc0562 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -126,17 +126,18 @@ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, /** * Start iterating over the entries in a hash table. + * @param p The pool to allocate the apr_hash_index_t iterator * @param ht The hash table * @return a pointer to the iteration state, or NULL if there are no entries. * @tip Example: *
      * 
    - *     int sum_values(apr_hash_t *ht)
    + *     int sum_values(apr_pool_t *p, apr_hash_t *ht)
      *     {
      *         apr_hash_index_t *hi;
      * 	   void *val;
      * 	   int sum = 0;
    - * 	   for (hi = apr_hash_first(ht); hi; hi = apr_hash_next(hi)) {
    + * 	   for (hi = apr_hash_first(p, ht); hi; hi = apr_hash_next(hi)) {
      * 	       apr_hash_this(hi, NULL, NULL, &val);
      * 	       sum += *(int *)val;
      * 	   }
    @@ -148,9 +149,9 @@ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key,
      * is delete the current entry) and multiple iterations can be in
      * progress at the same time.
      * 
    - * @deffunc apr_hash_index_t *apr_hash_first(apr_hash_t *ht) + * @deffunc apr_hash_index_t *apr_hash_first(apr_pool_t *p, apr_hash_t *ht) */ -APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht); +APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht); /** * Continue iterating over the entries in a hash table. diff --git a/tables/apr_hash.c b/tables/apr_hash.c index b21c5f33c1f..7871b3d20b7 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -155,10 +155,10 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi) return hi; } -APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht) +APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht) { apr_hash_index_t *hi; - hi = apr_palloc(ht->pool, sizeof(*hi)); + hi = apr_palloc(p, sizeof(*hi)); hi->ht = ht; hi->index = 0; hi->this = NULL; From 9e8a71f46ed51b44ae219c29b00259fe2a58cbde Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 2 Aug 2001 00:11:17 +0000 Subject: [PATCH 2081/7878] Provide every hash a private, internal iterator for internal reconstruction and merging operations. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62077 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 7871b3d20b7..21f4bb37182 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -90,6 +90,19 @@ struct apr_hash_entry_t { const void *val; }; +/* + * Data structure for iterating through a hash table. + * + * We keep a pointer to the next hash entry here to allow the current + * hash entry to be freed or otherwise mangled between calls to + * apr_hash_next(). + */ +struct apr_hash_index_t { + apr_hash_t *ht; + apr_hash_entry_t *this, *next; + int index; +}; + /* * The size of the array is always a power of two. We use the maximum * index rather than the size so that we can use bitwise-AND for @@ -100,23 +113,11 @@ struct apr_hash_entry_t { struct apr_hash_t { apr_pool_t *pool; apr_hash_entry_t **array; + apr_hash_index_t iterator; /* For apr_hash_first(NULL, ...) */ int count, max; }; #define INITIAL_MAX 15 /* tunable == 2^n - 1 */ -/* - * Data structure for iterating through a hash table. - * - * We keep a pointer to the next hash entry here to allow the current - * hash entry to be freed or otherwise mangled between calls to - * apr_hash_next(). - */ -struct apr_hash_index_t { - apr_hash_t *ht; - apr_hash_entry_t *this, *next; - int index; -}; - /* * Hash creation functions. @@ -158,7 +159,10 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi) APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht) { apr_hash_index_t *hi; - hi = apr_palloc(p, sizeof(*hi)); + if (p) + hi = apr_palloc(p, sizeof(*hi)); + else + hi = &ht->iterator; hi->ht = ht; hi->index = 0; hi->this = NULL; @@ -190,7 +194,7 @@ static void expand_array(apr_hash_t *ht) new_max = ht->max * 2 + 1; new_array = alloc_array(ht, new_max); - for (hi = apr_hash_first(ht); hi; hi = apr_hash_next(hi)) { + for (hi = apr_hash_first(NULL, ht); hi; hi = apr_hash_next(hi)) { i = hi->this->hash & new_max; hi->this->next = new_array[i]; new_array[i] = hi->this; @@ -359,7 +363,7 @@ APR_DECLARE(apr_hash_t*) apr_hash_overlay(apr_pool_t *p, res->array = alloc_array(res, res->max); new_vals = apr_palloc(p, sizeof(apr_hash_entry_t) * res->count); j = 0; - for (hi = apr_hash_first((apr_hash_t*)base); hi; hi = apr_hash_next(hi)) { + for (hi = apr_hash_first(NULL, (apr_hash_t*)base); hi; hi = apr_hash_next(hi)) { i = hi->this->hash & res->max; new_vals[j].klen = hi->this->klen; @@ -374,7 +378,7 @@ APR_DECLARE(apr_hash_t*) apr_hash_overlay(apr_pool_t *p, /* can't simply copy the stuff over, need to set each one so as to * increment the counts/array properly */ - for (hi = apr_hash_first((apr_hash_t*)overlay); hi; + for (hi = apr_hash_first(NULL, (apr_hash_t*)overlay); hi; hi = apr_hash_next(hi)) { apr_hash_set(res, hi->this->key, hi->this->klen, hi->this->val); } From d1f90e6e2ae5fb146ba8b9fb756cfe0e46b69698 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 2 Aug 2001 00:13:05 +0000 Subject: [PATCH 2082/7878] Context man, give me context git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62078 13f79535-47bb-0310-9956-ffa450edef68 --- test/testhash.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/testhash.c b/test/testhash.c index da1e9c3b0b5..d72eaf17be5 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -67,14 +67,14 @@ #include #endif -static void dump_hash(apr_hash_t *h) +static void dump_hash(apr_pool_t *p, apr_hash_t *h) { apr_hash_index_t *hi; char *val, *key; int len; int i = 0; - for (hi = apr_hash_first(h); hi; hi = apr_hash_next(hi)) { + for (hi = apr_hash_first(p, h); hi; hi = apr_hash_next(hi)) { apr_hash_this(hi,(void*) &key, &len,(void*) &val); fprintf(stdout, "Key %s (%d) Value %s\n",key,len,val); i++; @@ -86,7 +86,7 @@ static void dump_hash(apr_hash_t *h) fprintf(stdout, "#entries %d \n", i); } -static void sum_hash(apr_hash_t *h, int *pcount, int *keySum, int *valSum) +static void sum_hash(apr_pool_t *p, apr_hash_t *h, int *pcount, int *keySum, int *valSum) { apr_hash_index_t *hi; void *val, *key; @@ -95,7 +95,7 @@ static void sum_hash(apr_hash_t *h, int *pcount, int *keySum, int *valSum) *keySum = 0; *valSum = 0; *pcount = 0; - for (hi = apr_hash_first(h); hi; hi = apr_hash_next(hi)) { + for (hi = apr_hash_first(p, h); hi; hi = apr_hash_next(hi)) { apr_hash_this(hi, (void*)&key, NULL, &val); *valSum += *(int *)val; *keySum += *(int *)key; @@ -161,7 +161,7 @@ int main(int argc, const char *const argv[]) fprintf(stderr, "ERROR:apr_hash_get FOO3 = %s (should be bar3)\n", result); - dump_hash(h); + dump_hash(cntxt, h); h2 =apr_hash_make(cntxt); if (h2 == NULL) { @@ -184,7 +184,7 @@ int main(int argc, const char *const argv[]) apr_hash_set(h2, key, sizeof(int), val); } - sum_hash(h2, &i, &trySumKey, &trySumVal); + sum_hash(cntxt, h2, &i, &trySumKey, &trySumVal); if (i==100) { fprintf(stdout, "All keys accounted for\n"); } else { @@ -207,7 +207,7 @@ int main(int argc, const char *const argv[]) } else { fprintf(stdout, "Delete working\n"); } - sum_hash(h2, &i, &trySumKey, &trySumVal); + sum_hash(cntxt, h2, &i, &trySumKey, &trySumVal); sumKeys -= 891; sumVal -= 89; @@ -234,14 +234,14 @@ int main(int argc, const char *const argv[]) if (apr_hash_count(h4) != apr_hash_count(h)) { fprintf(stderr, "ERROR: overlay not working with blank overlay as overlay\n"); - dump_hash(h4); + dump_hash(cntxt, h4); } h4 = apr_hash_overlay(cntxt, h, h3); if (apr_hash_count(h4) != apr_hash_count(h)) { fprintf(stderr, "ERROR: overlay not working with blank overlay as base\n"); - dump_hash(h4); + dump_hash(cntxt, h4); } h4 = apr_hash_overlay(cntxt, h, h2); @@ -253,7 +253,7 @@ int main(int argc, const char *const argv[]) if (apr_hash_count(h4) != apr_hash_count(h)) { fprintf(stderr, "ERROR: overlay not working when overlaying same hash\n"); - dump_hash(h4); + dump_hash(cntxt, h4); } result = apr_hash_get(h4, "FOO2", APR_HASH_KEY_STRING); From 3d6093531cf9d16c6e829d98be206a780ed6fc3d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 2 Aug 2001 03:15:56 +0000 Subject: [PATCH 2083/7878] Warning Will Robinson, someone's about to trounce you git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62079 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 15ffed1a401..cdff9c29977 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -115,7 +115,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, os_handle = LoadLibraryEx(path, NULL, 0); SetErrorMode(em); } - *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); + *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); if(os_handle == NULL) { (*res_handle)->load_error = apr_get_os_error(); From 5f75143dcb879efa1097da6316bf006ffa78dc37 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 2 Aug 2001 03:17:29 +0000 Subject: [PATCH 2084/7878] It just won't work on win32 that way... need an .m4 test for HAVE__END (is the _end symbol defined?) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62080 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 4b6e2ddf0f1..34ea468e68a 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -985,7 +985,9 @@ APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void) /* the unix linker defines this symbol as the last byte + 1 of * the executable... so it includes TEXT, BSS, and DATA */ +#ifdef HAVE__END extern char _end; +#endif /* is ptr in the range [lo,hi) */ #define is_ptr_in_range(ptr, lo, hi) \ @@ -1001,16 +1003,20 @@ APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts) union block_hdr **pb; union block_hdr *b; +#ifdef HAVE__END /* short-circuit stuff which is in TEXT, BSS, or DATA */ if (is_ptr_in_range(s, 0, &_end)) { return NULL; } +#endif /* consider stuff on the stack to also be in the NULL pool... * XXX: there's cases where we don't want to assume this */ if ((stack_direction == -1 && is_ptr_in_range(s, &ts, known_stack_point)) || (stack_direction == 1 && is_ptr_in_range(s, known_stack_point, &ts))) { - abort(); +#ifdef HAVE__END + abort(); +#endif return NULL; } /* search the global_block_list */ @@ -1073,7 +1079,7 @@ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) return 1; } #ifdef APR_POOL_DEBUG - while (a->joined) { + while (a && a->joined) { a = a->joined; } #endif From 0f600c344fce7ad0dc8c6e53d9e86762f360f98e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 2 Aug 2001 03:18:44 +0000 Subject: [PATCH 2085/7878] Now I _know_ how long it's been since someone actually was _really_ testing these goodies ;) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62081 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 4 ++-- tables/apr_tables.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 21f4bb37182..49e11f5ef97 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -344,12 +344,12 @@ APR_DECLARE(apr_hash_t*) apr_hash_overlay(apr_pool_t *p, * overlay->a.pool and base->a.pool have a life span at least * as long as p */ - if (!apr_pool_is_ancestor(overlay->a.pool, p)) { + if (!apr_pool_is_ancestor(overlay->pool, p)) { fprintf(stderr, "apr_hash_overlay: overlay's pool is not an ancestor of p\n"); abort(); } - if (!apr_pool_is_ancestor(base->a.pool, p)) { + if (!apr_pool_is_ancestor(base->pool, p)) { fprintf(stderr, "apr_hash_overlay: base's pool is not an ancestor of p\n"); abort(); diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 4cf971ab0f0..e6e29ee0f6f 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -313,7 +313,7 @@ APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, const apr_table_t *t) /* we don't copy keys and values, so it's necessary that t->a.pool * have a life span at least as long as p */ - if (!apr_pool_is_ancestor(t->a.cont, p)) { + if (!apr_pool_is_ancestor(t->a.pool, p)) { fprintf(stderr, "copy_table: t's pool is not an ancestor of p\n"); abort(); } From 21155e80c7835cb87eca85380be2611b10912a4d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 2 Aug 2001 04:26:53 +0000 Subject: [PATCH 2086/7878] Add APR_DECLARE to the functions in mmap.c Submitted by: Sterling Hughes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62082 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/unix/mmap.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index a225075ef4a..ae8f22935a0 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -101,9 +101,10 @@ static apr_status_t mmap_cleanup(void *themmap) return errno; } -apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, - apr_off_t offset, apr_size_t size, - apr_int32_t flag, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, + apr_file_t *file, apr_off_t offset, + apr_size_t size, apr_int32_t flag, + apr_pool_t *cont) { void *mm; #ifdef BEOS @@ -112,7 +113,7 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, #else apr_int32_t native_flags = 0; #endif - + if (file == NULL || file->filedes == -1 || file->buffered) return APR_EBADF; (*new) = (apr_mmap_t *)apr_pcalloc(cont, sizeof(apr_mmap_t)); @@ -158,14 +159,14 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, (*new)->mm = mm; (*new)->size = size; (*new)->cntxt = cont; - + /* register the cleanup... */ apr_pool_cleanup_register((*new)->cntxt, (void*)(*new), mmap_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } -apr_status_t apr_mmap_delete(apr_mmap_t *mmap) +APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap) { apr_status_t rv; From 0559e309482b27b21f1c1e7053348a600d684709 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 2 Aug 2001 05:24:42 +0000 Subject: [PATCH 2087/7878] Modify this semantic to 1. keep in tune with apr return values (although no apr_status_t is required) and 2. prepare for additional diagnostics (passing the first arg, macroized, as a string 'name'.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62083 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 9 +++++---- memory/unix/apr_pools.c | 29 ++++++++++++++--------------- memory/unix/apr_sms_pools.c | 13 ++++++------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 153c268b54a..ae2d67b1fbe 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -329,14 +329,15 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); #endif /* !APR_POOLS_ARE_SMS || DOXYGEN */ /** - * Make a sub pool from the current pool - * @param p The pool to use as a parent pool + * @param p The new sub-pool + * @param parent The pool to use as a parent pool * @param apr_abort A function to use if the pool cannot allocate more memory. - * @return The new sub-pool + * @deffunc void apr_pool_sub_make(apr_pool_t **p, apr_pool_t *parent, int (*apr_abort)(int retcode), const char *created) * @remark The @a apr_abort function provides a way to quit the program if the * machine is out of memory. By default, APR will return on error. */ -APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, +APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **p, + apr_pool_t *pparent, int (*apr_abort)(int retcode)); #if defined(APR_POOL_DEBUG) || defined(DOXYGEN) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 34ea468e68a..be0e4179f05 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -580,8 +580,9 @@ static apr_pool_t *permanent_pool; #define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, - apr_abortfunc_t abortfunc) +APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **p, + apr_pool_t *parent, + apr_abortfunc_t abortfunc) { union block_hdr *blok; apr_pool_t *new_pool; @@ -604,13 +605,13 @@ APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, new_pool->free_first_avail = blok->h.first_avail; new_pool->first = new_pool->last = blok; - if (p) { - new_pool->parent = p; - new_pool->sub_next = p->sub_pools; + if (parent) { + new_pool->parent = parent; + new_pool->sub_next = parent->sub_pools; if (new_pool->sub_next) { new_pool->sub_next->sub_prev = new_pool; } - p->sub_pools = new_pool; + parent->sub_pools = new_pool; } #if APR_HAS_THREADS @@ -619,7 +620,7 @@ APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t *p, } #endif - return new_pool; + *p = new_pool; } #ifdef APR_POOL_DEBUG @@ -653,23 +654,21 @@ static void dump_stats(void) #endif /* ### why do we have this, in addition to apr_pool_sub_make? */ -APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, +APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, apr_pool_t *parent_pool) { - apr_pool_t *newpool; apr_abortfunc_t abortfunc; abortfunc = parent_pool ? parent_pool->apr_abort : NULL; - newpool = apr_pool_sub_make(parent_pool, abortfunc); - if (newpool == NULL) { + apr_pool_sub_make(newpool, parent_pool, abortfunc); + if (*newpool == NULL) { return APR_ENOPOOL; } - newpool->prog_data = NULL; - newpool->apr_abort = abortfunc; + (*newpool)->prog_data = NULL; + (*newpool)->apr_abort = abortfunc; - *newcont = newpool; return APR_SUCCESS; } @@ -837,7 +836,7 @@ APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *globalp) return status; } #endif - permanent_pool = apr_pool_sub_make(globalp, NULL); + apr_pool_sub_make(&permanent_pool, globalp, NULL); #ifdef ALLOC_STATS atexit(dump_stats); diff --git a/memory/unix/apr_sms_pools.c b/memory/unix/apr_sms_pools.c index 624a4b5ba8b..f2de23ca90a 100644 --- a/memory/unix/apr_sms_pools.c +++ b/memory/unix/apr_sms_pools.c @@ -77,17 +77,16 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, apr_pool_t *p) 0x2000, 0, 0x80000); } -APR_DECLARE(apr_pool_t *) apr_pool_sub_make(apr_pool_t * p, - apr_abortfunc_t abort) +APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **p, + apr_pool_t *pparent, + apr_abortfunc_t abort) { - apr_pool_t *np; - - if (apr_sms_trivial_create(&np, p) != APR_SUCCESS) + if (apr_sms_trivial_create(p, pparent) != APR_SUCCESS) return NULL; - apr_sms_set_abort(abort, np); + apr_sms_set_abort(abort, *p); - return np; + return p; } APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *pool, From e2adea031bc0e97d58809a9df0519f60ebe6427c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 2 Aug 2001 14:57:36 +0000 Subject: [PATCH 2088/7878] fix the exit status of testthread so it is easier to use in an automated regression script git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62084 13f79535-47bb-0310-9956-ffa450edef68 --- test/testthread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/testthread.c b/test/testthread.c index ee879006b87..0af31e55611 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -197,11 +197,12 @@ int main(void) if (x != 40000) { fflush(stdout); fprintf(stderr, "The locks didn't work???? %d\n", x); + exit(-1); } else { fprintf(stdout, "Everything is working!\n"); } - return 1; + return 0; } #endif /* !APR_HAS_THREADS */ From 575ffb186b4d5c909234cc02556da65c0a91aa58 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 2 Aug 2001 15:37:34 +0000 Subject: [PATCH 2089/7878] don't hang forever on systems which don't report readability on a regular file; this'll keep my regression script from hanging on FreeBSD :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62085 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testfile.c b/test/testfile.c index 94280578826..e8426a7f12e 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -155,9 +155,9 @@ int main(void) apr_poll_socket_add(sdset, testsock, APR_POLLIN); num = 1; STD_TEST_NEQ(" Checking for incoming data", - apr_poll(sdset, &num, -1)) + apr_poll(sdset, &num, 1 * APR_USEC_PER_SEC)) if (num == 0) { - MSG_AND_EXIT("I should not return until num == 1\n") + printf("** This platform doesn't return readability on a regular file.**\n"); } printf(" End of files as sockets test.\n"); #endif From e64020e78f634ddfa561726e1a7176ef15c2dea0 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 2 Aug 2001 19:51:57 +0000 Subject: [PATCH 2090/7878] Some small changes to the profile options... - remove the -g so we don't duplicate by hvaing -pg and -g - add the correct flags to get it all working correctly on beos git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62086 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.in b/configure.in index 7b89f0e0604..d9baa088052 100644 --- a/configure.in +++ b/configure.in @@ -158,6 +158,12 @@ AC_ARG_ENABLE(assert-memory,[ --enable-assert-memory Turn on asserts in the AP AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build (GCC)], if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS, -pg) + APR_REMOVEFROM(CFLAGS, -g) + if test "$host" = "i586-pc-beos"; then + APR_REMOVEFROM(CFLAGS, -O2) + APR_ADDTO(CFLAGS, -O1) + APR_ADDTO(LDFLAGS, -p) + fi fi )dnl From 3c1f0b0d6da147a3feef7f38f5a55bc88883868f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 2 Aug 2001 20:22:48 +0000 Subject: [PATCH 2091/7878] Ported the apr_time_now() function to support the NetWare OS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62087 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/time/unix/time.c b/time/unix/time.c index 35a9161f60b..d20f34de07e 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -112,9 +112,16 @@ apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input) /* NB NB NB NB This returns GMT!!!!!!!!!! */ apr_time_t apr_time_now(void) { +#ifdef NETWARE + uint64_t usec; + + NXGetTime(NX_SINCE_1970, NX_USECONDS, &usec); + return usec; +#else struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec; +#endif } static void explode_time(apr_exploded_time_t *xt, apr_time_t t, From 708395afacaf72195a40ce1bbf4e3c31abb89747 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 2 Aug 2001 20:29:14 +0000 Subject: [PATCH 2092/7878] NetWare port of the threadproc functions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62088 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 448 ++++++++++++++++++++++++++++++++ threadproc/netware/procsup.c | 140 ++++++++++ threadproc/netware/signals.c | 107 ++++++++ threadproc/netware/thread.c | 245 +++++++++++++++++ threadproc/netware/threadpriv.c | 140 ++++++++++ 5 files changed, 1080 insertions(+) create mode 100644 threadproc/netware/proc.c create mode 100644 threadproc/netware/procsup.c create mode 100644 threadproc/netware/signals.c create mode 100644 threadproc/netware/thread.c create mode 100644 threadproc/netware/threadpriv.c diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c new file mode 100644 index 00000000000..7124f8a17ed --- /dev/null +++ b/threadproc/netware/proc.c @@ -0,0 +1,448 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "threadproc.h" +#include "fileio.h" +#include "apr_strings.h" +#include "apr_portable.h" + +/* + * some of the ideas expressed herein are based off of Microsoft + * Knowledge Base article: Q190351 + * + */ +apr_status_t apr_procattr_create(apr_procattr_t **new,apr_pool_t *cont) +{ + (*new) = (apr_procattr_t *)apr_pcalloc(cont, sizeof(apr_procattr_t)); + + if ((*new) == NULL) { + return APR_ENOMEM; + } + (*new)->cntxt = cont; + (*new)->cmdtype = APR_PROGRAM; + return APR_SUCCESS; + +} + +apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) +{ + apr_status_t status; + if (in != 0) { + if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, + attr->cntxt)) != APR_SUCCESS) { + return status; + } + switch (in) { + case APR_FULL_BLOCK: + break; + case APR_PARENT_BLOCK: + apr_file_pipe_timeout_set(attr->child_in, 0); + break; + case APR_CHILD_BLOCK: + apr_file_pipe_timeout_set(attr->parent_in, 0); + break; + default: + apr_file_pipe_timeout_set(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, 0); + } + } + if (out) { + if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, + attr->cntxt)) != APR_SUCCESS) { + return status; + } + switch (out) { + case APR_FULL_BLOCK: + break; + case APR_PARENT_BLOCK: + apr_file_pipe_timeout_set(attr->child_out, 0); + break; + case APR_CHILD_BLOCK: + apr_file_pipe_timeout_set(attr->parent_out, 0); + break; + default: + apr_file_pipe_timeout_set(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, 0); + } + } + if (err) { + if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, + attr->cntxt)) != APR_SUCCESS) { + return status; + } + switch (err) { + case APR_FULL_BLOCK: + break; + case APR_PARENT_BLOCK: + apr_file_pipe_timeout_set(attr->child_err, 0); + break; + case APR_CHILD_BLOCK: + apr_file_pipe_timeout_set(attr->parent_err, 0); + break; + default: + apr_file_pipe_timeout_set(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, 0); + } + } + return APR_SUCCESS; +} + + +apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in) +{ + if (attr->child_in == NULL && attr->parent_in == NULL) + apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); + + if (child_in != NULL) + apr_file_dup(&attr->child_in, child_in, attr->cntxt); + + if (parent_in != NULL) + apr_file_dup(&attr->parent_in, parent_in, attr->cntxt); + + return APR_SUCCESS; +} + + +apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) +{ + if (attr->child_out == NULL && attr->parent_out == NULL) + apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); + + if (child_out != NULL) + apr_file_dup(&attr->child_out, child_out, attr->cntxt); + + if (parent_out != NULL) + apr_file_dup(&attr->parent_out, parent_out, attr->cntxt); + + return APR_SUCCESS; +} + + +apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) +{ + if (attr->child_err == NULL && attr->parent_err == NULL) + apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); + + if (child_err != NULL) + apr_file_dup(&attr->child_err, child_err, attr->cntxt); + + if (parent_err != NULL) + apr_file_dup(&attr->parent_err, parent_err, attr->cntxt); + + return APR_SUCCESS; +} + + +apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, + const char *dir) +{ + attr->currdir = apr_pstrdup(attr->cntxt, dir); + if (attr->currdir) { + return APR_SUCCESS; + } + return APR_ENOMEM; +} + +apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, + apr_cmdtype_e cmd) +{ + attr->cmdtype = cmd; + return APR_SUCCESS; +} + +apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) +{ + attr->detached = detach; + return APR_SUCCESS; +} + +apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) +{ +#if 0 + int pid; + + if ((pid = fork()) < 0) { + return errno; + } + else if (pid == 0) { + proc->pid = pid; + proc->in = NULL; + proc->out = NULL; + proc->err = NULL; + return APR_INCHILD; + } + proc->pid = pid; + proc->in = NULL; + proc->out = NULL; + proc->err = NULL; +#endif + return APR_INPARENT; +} + +static apr_status_t limit_proc(apr_procattr_t *attr) +{ +#if APR_HAVE_STRUCT_RLIMIT && APR_HAVE_SETRLIMIT +#ifdef RLIMIT_CPU + if (attr->limit_cpu != NULL) { + if ((setrlimit(RLIMIT_CPU, attr->limit_cpu)) != 0) { + return errno; + } + } +#endif +#ifdef RLIMIT_NPROC + if (attr->limit_nproc != NULL) { + if ((setrlimit(RLIMIT_NPROC, attr->limit_nproc)) != 0) { + return errno; + } + } +#endif +#if defined(RLIMIT_AS) + if (attr->limit_mem != NULL) { + if ((setrlimit(RLIMIT_AS, attr->limit_mem)) != 0) { + return errno; + } + } +#elif defined(RLIMIT_DATA) + if (attr->limit_mem != NULL) { + if ((setrlimit(RLIMIT_DATA, attr->limit_mem)) != 0) { + return errno; + } + } +#elif defined(RLIMIT_VMEM) + if (attr->limit_mem != NULL) { + if ((setrlimit(RLIMIT_VMEM, attr->limit_mem)) != 0) { + return errno; + } + } +#endif +#else + /* + * Maybe make a note in error_log that setrlimit isn't supported?? + */ + +#endif + return APR_SUCCESS; +} + +apr_status_t apr_proc_create(apr_proc_t *new, + const char *progname, + const char * const *args, + const char * const *env, + apr_procattr_t *attr, + apr_pool_t *cont) +{ +#if 0 + int i; + const char **newargs; + + new->in = attr->parent_in; + new->err = attr->parent_err; + new->out = attr->parent_out; + if ((new->pid = fork()) < 0) { + return errno; + } + else if (new->pid == 0) { + int status; + /* child process */ + if (attr->child_in) { + apr_file_close(attr->parent_in); + dup2(attr->child_in->filedes, STDIN_FILENO); + apr_file_close(attr->child_in); + } + if (attr->child_out) { + apr_file_close(attr->parent_out); + dup2(attr->child_out->filedes, STDOUT_FILENO); + apr_file_close(attr->child_out); + } + if (attr->child_err) { + apr_file_close(attr->parent_err); + dup2(attr->child_err->filedes, STDERR_FILENO); + apr_file_close(attr->child_err); + } + + apr_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ + + if (attr->currdir != NULL) { + if (chdir(attr->currdir) == -1) { + exit(-1); /* We have big problems, the child should exit. */ + } + } + + apr_pool_cleanup_for_exec(); + + if ((status = limit_proc(attr)) != APR_SUCCESS) { + return status; + } + + if (attr->cmdtype == APR_SHELLCMD) { + i = 0; + while (args[i]) { + i++; + } + newargs = + (const char **) apr_palloc(cont, sizeof (char *) * (i + 3)); + newargs[0] = SHELL_PATH; + newargs[1] = "-c"; + i = 0; + while (args[i]) { + newargs[i + 2] = args[i]; + i++; + } + newargs[i + 2] = NULL; + if (attr->detached) { + apr_proc_detach(); + } + execve(SHELL_PATH, (char * const *) newargs, (char * const *)env); + } + else { + if (attr->detached) { + apr_proc_detach(); + } + execve(progname, (char * const *)args, (char * const *)env); + } + exit(-1); /* if we get here, there is a problem, so exit with an */ + /* error code. */ + } + /* Parent process */ + if (attr->child_in) { + apr_file_close(attr->child_in); + } + if (attr->child_out) { + apr_file_close(attr->child_out); + } + if (attr->child_err) { + apr_file_close(attr->child_err); + } +#endif + return APR_SUCCESS; +} + +apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p) +{ +#if 0 + int waitpid_options = WUNTRACED; + + if (waithow != APR_WAIT) { + waitpid_options |= WNOHANG; + } + + if ((proc->pid = waitpid(-1, status, waitpid_options)) > 0) { + return APR_CHILD_DONE; + } + else if (proc->pid == 0) { + return APR_CHILD_NOTDONE; + } +#endif + return errno; +} + +apr_status_t apr_proc_wait(apr_proc_t *proc, + apr_wait_how_e waithow) +{ +#if 0 + pid_t status; + + if (waithow == APR_WAIT) { + if ((status = waitpid(proc->pid, NULL, WUNTRACED)) > 0) { + return APR_CHILD_DONE; + } + else if (status == 0) { + return APR_CHILD_NOTDONE; + } + return errno; + } + if ((status = waitpid(proc->pid, NULL, WUNTRACED | WNOHANG)) > 0) { + return APR_CHILD_DONE; + } + else if (status == 0) { + return APR_CHILD_NOTDONE; + } +#endif + return errno; +} + +apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, + struct rlimit *limit) +{ + switch(what) { + case APR_LIMIT_CPU: +#ifdef RLIMIT_CPU + attr->limit_cpu = limit; + break; +#else + return APR_ENOTIMPL; +#endif + case APR_LIMIT_MEM: +#if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS) + attr->limit_mem = limit; + break; +#else + return APR_ENOTIMPL; +#endif + case APR_LIMIT_NPROC: +#ifdef RLIMIT_NPROC + attr->limit_nproc = limit; + break; +#else + return APR_ENOTIMPL; +#endif + } + return APR_SUCCESS; +} + diff --git a/threadproc/netware/procsup.c b/threadproc/netware/procsup.c new file mode 100644 index 00000000000..e7a3d69a410 --- /dev/null +++ b/threadproc/netware/procsup.c @@ -0,0 +1,140 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "threadproc.h" + +apr_status_t apr_proc_detach(void) +{ +#if 0 + int x; + pid_t pgrp; + + chdir("/"); +#if !defined(MPE) && !defined(OS2) && !defined(TPF) && !defined(BEOS) +/* Don't detach for MPE because child processes can't survive the death of + the parent. */ + if ((x = fork()) > 0) + exit(0); + else if (x == -1) { + perror("fork"); + fprintf(stderr, "unable to fork new process\n"); + exit(1); /* we can't do anything here, so just exit. */ + } +/* RAISE_SIGSTOP(DETACH);*/ +#endif +#if APR_HAVE_SETSID + if ((pgrp = setsid()) == -1) { + return errno; + } +#elif defined(NEXT) || defined(NEWSOS) + if (setpgrp(0, getpid()) == -1 || (pgrp = getpgrp(0)) == -1) { + return errno; + } +#elif defined(OS2) || defined(TPF) + /* OS/2 don't support process group IDs */ + pgrp = getpid(); +#elif defined(MPE) + /* MPE uses negative pid for process group */ + pgrp = -getpid(); +#else + if ((pgrp = setpgid(0, 0)) == -1) { + return errno; + } +#endif + + /* close out the standard file descriptors */ + if (freopen("/dev/null", "r", stdin) == NULL) { + return errno; + /* continue anyhow -- note we can't close out descriptor 0 because we + * have nothing to replace it with, and if we didn't have a descriptor + * 0 the next file would be created with that value ... leading to + * havoc. + */ + } + if (freopen("/dev/null", "w", stdout) == NULL) { + return errno; + } + /* We are going to reopen this again in a little while to the error + * log file, but better to do it twice and suffer a small performance + * hit for consistancy than not reopen it here. + */ + if (freopen("/dev/null", "w", stderr) == NULL) { + return errno; + } +#endif + return APR_SUCCESS; +} + +#if 0 +#if (!HAVE_WAITPID) +/* From ikluft@amdahl.com + * this is not ideal but it works for SVR3 variants + * Modified by dwd@bell-labs.com to call wait3 instead of wait because + * apache started to use the WNOHANG option. + */ +int waitpid(pid_t pid, int *statusp, int options) +{ + int tmp_pid; + if (kill(pid, 0) == -1) { + errno = ECHILD; + return -1; + } + while (((tmp_pid = wait3(statusp, options, 0)) != pid) && + (tmp_pid != -1) && (tmp_pid != 0) && (pid != -1)) + ; + return tmp_pid; +} +#endif +#endif + diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c new file mode 100644 index 00000000000..6899af8770a --- /dev/null +++ b/threadproc/netware/signals.c @@ -0,0 +1,107 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "threadproc.h" +#include +#include "apr_private.h" +#include "apr_pools.h" +#include "apr_signal.h" +#include "apr_strings.h" + +#define APR_WANT_SIGNAL +#include "apr_want.h" + +#include +#if APR_HAS_THREADS && APR_HAVE_PTHREAD_H +#include +#endif + +apr_status_t apr_proc_kill(apr_proc_t *proc, int signum) +{ +#ifndef NETWARE + if (kill(proc->pid, signum) == -1) { + return errno; + } +#endif + + //srj need to find equal to kill or use sigterm in nks + //srj windows is using TerminateProcess here + //srj if ( NXThreadExit(proc->pid) != 0) { + //srj return errno; + //srj } + return APR_SUCCESS; +} + + +void apr_signal_init(apr_pool_t *pglobal) +{ +} + +const char *apr_signal_get_description(int signum) +{ + return "unknown signal (not supported)"; +} + +static void *signal_thread_func(void *signal_handler) +{ + return NULL; +} + +apr_status_t apr_setup_signal_thread(void) +{ + int rv = 0; + + return rv; +} + diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c new file mode 100644 index 00000000000..c8a42d49374 --- /dev/null +++ b/threadproc/netware/thread.c @@ -0,0 +1,245 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_portable.h" +#include "threadproc.h" + + +apr_status_t apr_threadattr_create(apr_threadattr_t **new, + apr_pool_t *cont) +{ + (*new) = (apr_threadattr_t *)apr_palloc(cont, + sizeof(apr_threadattr_t)); + + if ((*new) == NULL) { + return APR_ENOMEM; + } + + (*new)->cntxt = cont; + return APR_SUCCESS; +} + +apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr,apr_int32_t on) +{ + attr->detach = on; + return APR_SUCCESS; +} + +apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) +{ + if (attr->detach == 1) + return APR_DETACH; + return APR_NOTDETACH; +} + +apr_status_t apr_thread_create(apr_thread_t **new, + apr_threadattr_t *attr, + apr_thread_start_t func, + void *data, + apr_pool_t *cont) +{ + apr_status_t stat; + size_t stacksize; + long flags = NX_CTX_AUTO_CLEANUP; + char threadName[NX_MAX_OBJECT_NAME_LEN+1]; + //srj added for nks giving the threads names + + sprintf(threadName, "Apache-2.0 %003ld",data); + + (*new) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); + + if ((*new) == NULL) { + return APR_ENOMEM; + } + + (*new)->cntxt = cont; + + stat = apr_pool_create(&(*new)->cntxt, cont); + if (stat != APR_SUCCESS) { + return stat; + } + + if (attr) { + stacksize = attr->stack_size; + if (attr->detach) + flags |= NX_THR_DETACHED; + else + flags |= NX_THR_JOINABLE; + } + else { + stacksize = APR_DEFAULT_STACK_SIZE; + flags |= NX_THR_JOINABLE; + } + + (*new)->ctx = NXContextAlloc( + /* void(*start_routine)(void *arg)*/(void (*)(void *)) func, + /* void *arg */ data, + /* int priority */ NX_PRIO_MED, + /* NXSize_t stackSize */ stacksize, + /* long flags */ NX_CTX_NORMAL, + /* int *error */ &stat); + + + stat = NXContextSetName( + /* NXContext_t ctx */ (*new)->ctx, + /* const char *name */ threadName); + + stat = NXThreadCreate( + /* NXContext_t context */ (*new)->ctx, + /* long flags */ flags, + /* NXThreadId_t *thread_id */ &(*new)->td); + + if(stat==0) + return APR_SUCCESS; + + return(stat);// if error +} + +apr_os_thread_t apr_os_thread_current() +{ + return NXThreadGetId(); +} + +int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) +{ + return (tid1 == tid2); +} + +apr_status_t apr_thread_yield() +{ + NXThreadYield(); + return APR_SUCCESS; +} + +apr_status_t apr_thread_exit(apr_thread_t *thd, + apr_status_t *retval) +{ + apr_pool_destroy(thd->cntxt); + NXThreadExit((void *)*retval); + return APR_SUCCESS; +} + +apr_status_t apr_thread_join(apr_status_t *retval, + apr_thread_t *thd) +{ + apr_status_t stat; + NXThreadId_t dthr; + + if ((stat = NXThreadJoin(thd->td, &dthr, (void *)&retval)) == 0) { + return APR_SUCCESS; + } + else { + return stat; + } +} + +apr_status_t apr_thread_detach(apr_thread_t *thd) +{ + return APR_SUCCESS; +} + +apr_status_t apr_thread_data_get(void **data, const char *key, + apr_thread_t *thread) +{ + if (thread != NULL) { + return apr_pool_userdata_get(data, key, thread->cntxt); + } + else { + data = NULL; + return APR_ENOTHREAD; + } +} + +apr_status_t apr_thread_data_set(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread) +{ + if (thread != NULL) { + return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); + } + else { + data = NULL; + return APR_ENOTHREAD; + } +} + + +/*SRJ Need to resolve + APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, + apr_thread_t *thd) +{ + if (thd == NULL) { + return APR_ENOTHREAD; + } + *thethd = thd->td; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, + apr_os_thread_t *thethd, + apr_pool_t *cont) +{ + if (cont == NULL) { + return APR_ENOPOOL; + } + if ((*thd) == NULL) { + (*thd) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); + (*thd)->cntxt = cont; + } + (*thd)->td = thethd; + return APR_SUCCESS; +} + +*/ \ No newline at end of file diff --git a/threadproc/netware/threadpriv.c b/threadproc/netware/threadpriv.c new file mode 100644 index 00000000000..8964deb4a72 --- /dev/null +++ b/threadproc/netware/threadpriv.c @@ -0,0 +1,140 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_portable.h" +#include "threadproc.h" + +apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, + void (*dest)(void *), apr_pool_t *cont) +{ + apr_status_t stat; + + (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); + if ((*key) == NULL) { + return APR_ENOMEM; + } + + (*key)->cntxt = cont; + + if ((stat = NXKeyCreate(NULL, dest, &(*key)->key)) == 0) { + return stat; + } + return stat; +} + +apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) +{ + apr_status_t stat; + + if ((stat = NXKeyGetValue(key->key, new)) == 0) { + return APR_SUCCESS; + } + else { + return stat; + } +} + +apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) +{ + apr_status_t stat; + if ((stat = NXKeySetValue(key->key, priv)) == 0) { + return APR_SUCCESS; + } + else { + return stat; + } +} + +apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) +{ + apr_status_t stat; + if ((stat = NXKeyDelete(key->key)) == 0) { + return APR_SUCCESS; + } + return stat; +} + +apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) +{ + return apr_pool_userdata_get(data, key, threadkey->cntxt); +} + +apr_status_t apr_threadkey_data_set(void *data, + const char *key, apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey) +{ + return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); +} + +apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, + apr_threadkey_t *key) +{ + thekey = &(key->key); + return APR_SUCCESS; +} + +apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, apr_pool_t *cont) +{ + if (cont == NULL) { + return APR_ENOPOOL; + } + if ((*key) == NULL) { + (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); + (*key)->cntxt = cont; + } + (*key)->key = *thekey; + return APR_SUCCESS; +} + From cbdfd9dc89748fbbe97dcef20eb1fc2ee5753738 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 2 Aug 2001 20:35:12 +0000 Subject: [PATCH 2093/7878] server isn't really dependent upon sendfile.lo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62089 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index 99e46177a83..a7c3450e495 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -90,7 +90,7 @@ testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ $(L client@EXEEXT@: client.lo $(LOCAL_LIBS) $(LINK) client.lo $(LOCAL_LIBS) $(ALL_LIBS) -server@EXEEXT@: server.lo sendfile.lo $(LOCAL_LIBS) +server@EXEEXT@: server.lo $(LOCAL_LIBS) $(LINK) server.lo $(LOCAL_LIBS) $(ALL_LIBS) sendfile@EXEEXT@: sendfile.lo $(LOCAL_LIBS) From 2898444b591664801199a0a87010e618f402dc3a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 2 Aug 2001 20:44:43 +0000 Subject: [PATCH 2094/7878] Added the NetWare specific typedef's git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62090 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/apr_portable.h b/include/apr_portable.h index c37ae105c9b..a6a3831d76f 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -136,6 +136,18 @@ typedef struct timeval apr_os_imp_time_t; typedef struct tm apr_os_exp_time_t; typedef image_id apr_os_dso_handle_t; +#elif defined(NETWARE) +typedef int apr_os_file_t; +typedef DIR apr_os_dir_t; +typedef int apr_os_sock_t; +typedef NXMutex_t apr_os_lock_t; +typedef NXThreadId_t apr_os_thread_t; +typedef long apr_os_proc_t; +typedef NXKey_t apr_os_threadkey_t; +typedef struct timeval apr_os_imp_time_t; +typedef struct tm apr_os_exp_time_t; +typedef void * apr_os_dso_handle_t; + #else /* Any other OS should go above this one. This is the lowest common * denominator typedefs for all UNIX-like systems. :) From 1c5e02a02cda58721d68f916903279d0cdb8cb60 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 2 Aug 2001 20:52:53 +0000 Subject: [PATCH 2095/7878] Adding NetWare specific headers git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62091 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr.h | 325 +++++++++++++++++++++++++++++ include/arch/netware/apr_private.h | 199 ++++++++++++++++++ include/arch/netware/pre_nw.h | 43 ++++ 3 files changed, 567 insertions(+) create mode 100644 include/arch/netware/apr.h create mode 100644 include/arch/netware/apr_private.h create mode 100644 include/arch/netware/pre_nw.h diff --git a/include/arch/netware/apr.h b/include/arch/netware/apr.h new file mode 100644 index 00000000000..9cf39a6a7a1 --- /dev/null +++ b/include/arch/netware/apr.h @@ -0,0 +1,325 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/* + * Note: This is a NetWare specific version of apr.h. It is renamed to + * apr.h at the start of a Windows build. + */ + +#ifdef NETWARE +#ifndef APR_H +#define APR_H + + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include + + +#include + +#define _POSIX_THREAD_SAFE_FUNCTIONS 1 +#define READDIR_IS_THREAD_SAFE 1 + +#define APR_INLINE __inline +#define APR_HAS_INLINE 1 +#define __attribute__(__x) +#define ENUM_BITFIELD(e,n,w) signed int n : w + +#define APR_HAVE_ARPA_INET_H 0 +#define APR_HAVE_CONIO_H 0 +#define APR_HAVE_CRYPT_H 0 +#define APR_HAVE_CTYPE_H 1 +#define APR_HAVE_DIRENT_H 1 +#define APR_HAVE_ERRNO_H 1 +#define APR_HAVE_FCNTL_H 1 +#define APR_HAVE_IO_H 0 +#define APR_HAVE_LIMITS_H 1 +#define APR_HAVE_NETDB_H 0 +#define APR_HAVE_NETINET_IN_H 0 +#define APR_HAVE_PTHREAD_H 0 +#define APR_HAVE_SIGNAL_H 1 +#define APR_HAVE_STDARG_H 1 +#define APR_HAVE_STDIO_H 1 +#define APR_HAVE_STDLIB_H 1 +#define APR_HAVE_STRING_H 1 +#define APR_HAVE_STRINGS_H 0 +#define APR_HAVE_SYS_SIGNAL_H 0 +#define APR_HAVE_SYS_SOCKET_H 0 +#define APR_HAVE_SYS_SYSLIMITS_H 0 +#define APR_HAVE_SYS_TYPES_H 1 +#define APR_HAVE_SYS_UIO_H 1 +#define APR_HAVE_SYS_WAIT_H 0 +#define APR_HAVE_UNISTD_H 1 + +#define APR_USE_FLOCK_SERIALIZE 0 +#define APR_USE_SYSVSEM_SERIALIZE 0 +#define APR_USE_FCNTL_SERIALIZE 0 +#define APR_USE_PROC_PTHREAD_SERIALIZE 0 +#define APR_USE_PTHREAD_SERIALIZE 0 + +#define APR_PROCESS_LOCK_IS_GLOBAL 0 + +#define APR_USES_ANONYMOUS_SHM 0 +#define APR_USES_FILEBASED_SHM 0 +#define APR_USES_KEYBASED_SHM 0 + +#define APR_FILE_BASED_SHM 0 +#define APR_MEM_BASED_SHM 0 + +#define APR_HAVE_CORKABLE_TCP 0 +#define APR_HAVE_GETRLIMIT 0 +#define APR_HAVE_IN_ADDR 1 +#define APR_HAVE_INET_ADDR 1 +#define APR_HAVE_INET_NETWORK 0 +#define APR_HAVE_IPV6 0 +#define APR_HAVE_MEMCHR 1 +#define APR_HAVE_MEMMOVE 1 +#define APR_HAVE_SETRLIMIT 0 +#define APR_HAVE_SIGACTION 0 +#define APR_HAVE_STRCASECMP 1 +#define APR_HAVE_STRDUP 1 +#define APR_HAVE_STRICMP 1 +#define APR_HAVE_STRNCASECMP 0 +#define APR_HAVE_STRNICMP 1 +#define APR_HAVE_STRSTR 1 +#define APR_HAVE_STRUCT_RLIMIT 0 +#define APR_HAVE_UNION_SEMUN 0 + + +#if APR_HAVE_SYS_TYPES_H +#include +#endif + +/* APR Feature Macros */ +#define APR_HAS_SHARED_MEMORY 0 +#define APR_HAS_THREADS 1 +#define APR_HAS_SENDFILE 0 +#define APR_HAS_MMAP 0 +#define APR_HAS_FORK 0 +#define APR_HAS_RANDOM 1 +#define APR_HAS_XLATE 0 +#define APR_HAS_OTHER_CHILD 0 +#define APR_HAS_DSO 1 +#define APR_HAS_UNICODE_FS 1 +#define APR_HAS_USER 1 +#define APR_HAS_LARGE_FILES 1 + +/* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE + * on all platforms. + */ +#define APR_INADDR_NONE INADDR_NONE + +/* This macro indicates whether or not EBCDIC is the native character set. + */ +#define APR_CHARSET_EBCDIC 0 + +/* Typedefs that APR needs. */ + +typedef unsigned char apr_byte_t; + +typedef short apr_int16_t; +typedef unsigned short apr_uint16_t; + +typedef int apr_int32_t; +typedef unsigned int apr_uint32_t; + +typedef INT64 apr_int64_t; +typedef unsigned INT64 apr_uint64_t; + +typedef size_t apr_size_t; +typedef ssize_t apr_ssize_t; +typedef off_t apr_off_t; +typedef int apr_socklen_t; +//typedef int pid_t; +//typedef int uid_t; +//typedef int gid_t; + + +/* Mechanisms to properly type numeric literals */ + +#define APR_INT64_C(val) (val##i64) + +//srj added in here, libc c no longer takes care of these + +typedef unsigned char nuint8; +typedef unsigned short nuint16; + +#define NGetLo8(a16) ((nuint8)((nuint16)(a16) & 0xFF)) +#define NGetHi8(a16) ((nuint8)((nuint16)(a16) >> 8)) + + +#if !defined( HIBYTE ) + #define HIBYTE NGetHi8 + #endif + #if !defined( LOBYTE ) + #define LOBYTE NGetLo8 +#endif + + +/* Definitions that APR programs need to work properly. */ + +#define APR_THREAD_FUNC __stdcall + +/** + * APR_DECLARE_EXPORT is defined when building the APR dynamic library, + * so that all public symbols are exported. + * + * APR_DECLARE_STATIC is defined when including the APR public headers, + * to provide static linkage when the dynamic library may be unavailable. + * + * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when + * including the APR public headers, to import and link the symbols from the + * dynamic APR library and assure appropriate indirection and calling + * conventions at compile time. + */ + +#if !defined(WIN32) +/** + * The public APR functions are declared with APR_DECLARE(), so they may + * use the most appropriate calling convention. Public APR functions with + * variable arguments must use APR_DECLARE_NONSTD(). + * + * @deffunc APR_DECLARE(rettype) apr_func(args); + */ +#define APR_DECLARE(type) type +/** + * The public APR functions using variable arguments are declared with + * AP_DECLARE(), as they must use the C language calling convention. + * + * @deffunc APR_DECLARE_NONSTD(rettype) apr_func(args, ...); + */ +#define APR_DECLARE_NONSTD(type) type +/** + * The public APR variables are declared with AP_MODULE_DECLARE_DATA. + * This assures the appropriate indirection is invoked at compile time. + * + * @deffunc APR_DECLARE_DATA type apr_variable; + * @tip extern APR_DECLARE_DATA type apr_variable; syntax is required for + * declarations within headers to properly import the variable. + */ +#define APR_DECLARE_DATA +#elif defined(APR_DECLARE_STATIC) +#define APR_DECLARE(type) type __stdcall +#define APR_DECLARE_NONSTD(type) type +#define APR_DECLARE_DATA +#elif defined(APR_DECLARE_EXPORT) +#define APR_DECLARE(type) __declspec(dllexport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type +#define APR_DECLARE_DATA __declspec(dllexport) +#else +#define APR_DECLARE(type) __declspec(dllimport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type +#define APR_DECLARE_DATA __declspec(dllimport) +#endif + +#define APR_SSIZE_T_FMT "d" + +#define APR_SIZE_T_FMT "d" + +#define APR_OFF_T_FMT "ld" + +#define APR_OS_PROC_T_FMT "d" + +/* Local machine definition for console and log output. */ +#define APR_EOL_STR "\r\n" + +typedef int apr_wait_t; + +/* struct iovec is needed to emulate Unix writev */ +//struct iovec { +// char* iov_base; +// int iov_len; +//}; + +/* Nasty Win32 .h ommissions we really need */ +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 + +#if APR_HAS_UNICODE_FS +/* An arbitrary size that is digestable. True max is a bit less than 32000 */ +#define APR_PATH_MAX 8192 +#else /* !APR_HAS_UNICODE_FS */ +#define APR_PATH_MAX MAX_PATH +#endif + +///* These need to move into apr_compat.h when the symbol rename is complete +// */ +//#define APR_EXPORT(t) APR_DECLARE(t) +//#define APR_EXPORT_NONSTD(t) APR_DECLARE_NONSTD(t) +//#define APR_VAR_EXPORT APR_DECLARE_DATA +//#define APR_VAR_IMPORT APR_DECLARE_DATA + +#define APR_INT64_T_FMT "l64d" +#define APR_TIME_T_FMT APR_INT64_T_FMT + + +//#define apr_signal(a,b) signal(a,b) +// +//typedef int apr_wait_t; + +#endif /* APR_H */ +#endif /* NETWARE */ diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h new file mode 100644 index 00000000000..4ad90592756 --- /dev/null +++ b/include/arch/netware/apr_private.h @@ -0,0 +1,199 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/* + * Note: + * This is the windows specific autoconf-like config file + * which unix would create at build time. + */ + +#ifdef NETWARE + +#ifndef APR_PRIVATE_H +#define APR_PRIVATE_H + +/* Include the public APR symbols, include our idea of the 'right' + * subset of the Windows.h header. This saves us repetition. + */ +#include "apr.h" + +#include +#include +#include +#include + +//#include "memcheck.h" + +/* Use this section to define all of the HAVE_FOO_H + * that are required to build properly. + */ +#define HAVE_DLFCN_H 1 +#define HAVE_LIMITS_H 1 +//#define HAVE_MALLOC_H 1 +#define HAVE_SIGNAL_H 1 +/* #define HAVE_STDDEF_H 1 why not? */ +#define HAVE_STDLIB_H 1 +#define HAVE_SYS_STAT_H 1 + +#define HAVE_STRICMP 1 +#define HAVE_STRNICMP 1 +#define HAVE_STRDUP 1 +#define HAVE_STRSTR 1 +#define HAVE_MEMCHR 1 +#define HAVE_CALLOC 1 + +#define ALLOC_USE_MALLOC +#define DSO_USE_DLFCN + + +#if 0 +#define SIGHUP 1 +/* 2 is used for SIGINT on windows */ +#define SIGQUIT 3 +/* 4 is used for SIGILL on windows */ +#define SIGTRAP 5 +#define SIGIOT 6 +#define SIGBUS 7 +/* 8 is used for SIGFPE on windows */ +#define SIGKILL 9 +#define SIGUSR1 10 +/* 11 is used for SIGSEGV on windows */ +#define SIGUSR2 12 +#define SIGPIPE 13 +#define SIGALRM 14 +/* 15 is used for SIGTERM on windows */ +#define SIGSTKFLT 16 +#define SIGCHLD 17 +#define SIGCONT 18 +#define SIGSTOP 19 +#define SIGTSTP 20 +/* 21 is used for SIGBREAK on windows */ +/* 22 is used for SIGABRT on windows */ +#define SIGTTIN 23 +#define SIGTTOU 24 +#define SIGURG 25 +#define SIGXCPU 26 +#define SIGXFSZ 27 +#define SIGVTALRM 28 +#define SIGPROF 29 +#define SIGWINCH 30 +#define SIGIO 31 + +#define __attribute__(__x) + +/* APR COMPATABILITY FUNCTIONS + * This section should be used to define functions and + * macros which are need to make Windows features look + * like POSIX features. + */ +typedef void (Sigfunc)(int); +#endif + +#define strcasecmp(s1, s2) stricmp(s1, s2) +#define sleep(t) delay(t * 1000) +#define Sleep(t) delay(t) +#define lstat(a,b) stat(a,b) + +#define SIZEOF_SHORT 2 +#define SIZEOF_INT 4 +#define SIZEOF_LONGLONG 8 +#define SIZEOF_CHAR 1 +#define SIZEOF_SSIZE_T SIZEOF_INT + +//unsigned __stdcall SignalHandling(void *); +//int thread_ready(void); +/* Macros to deal with using either a pool or an sms + * to do memory stuff... + */ +#define APR_CLEANUP_REGISTER(struct, data, func, scope) \ + if (struct->pool) { \ + apr_pool_cleanup_register(struct->pool, data, func, scope); \ + } else { \ + apr_sms_cleanup_register(struct->mem_sys, APR_CHILD_CLEANUP, \ + data, func); \ + } + +#define APR_CLEANUP_REMOVE(struct, data, func) \ + if (struct->pool) { \ + apr_pool_cleanup_kill(struct->pool, data, func); \ + } else { \ + apr_sms_cleanup_unregister(struct->mem_sys, APR_CHILD_CLEANUP, \ + data, func); \ + } + +#define APR_MEM_PSTRDUP(struct, ptr, str) \ + if (struct->pool) { \ + ptr = apr_pstrdup(struct->pool, str); \ + } else { \ + size_t len = strlen(str) + 1; \ + ptr = (char*) apr_sms_calloc(struct->mem_sys, len); \ + memcpy(ptr, str, len); \ + } + +#define APR_MEM_MALLOC(ptr, struct, type) \ + if (struct->pool) { \ + ptr = (type *)apr_palloc(struct->pool, sizeof(type)); \ + } else { \ + ptr = (type *)apr_sms_malloc(struct->mem_sys, sizeof(type)); \ + } + +#define APR_MEM_CALLOC(ptr, struct, type) \ + if (struct->pool) { \ + ptr = (type *)apr_pcalloc(struct->pool, sizeof(type)); \ + } else { \ + ptr = (type *)apr_sms_calloc(struct->mem_sys, sizeof(type)); \ + } + +#endif /*APR_PRIVATE_H*/ +#endif /*NETWARE*/ diff --git a/include/arch/netware/pre_nw.h b/include/arch/netware/pre_nw.h new file mode 100644 index 00000000000..6a3d99c45d9 --- /dev/null +++ b/include/arch/netware/pre_nw.h @@ -0,0 +1,43 @@ +#ifndef __pre_nw__ +#define __pre_nw__ + +#pragma precompile_target "precomp.mch" +#define NETWARE + + +#define N_PLAT_NLM + +/* hint for MSL C++ that we're on NetWare platform */ +#define __NETWARE__ + +/* the FAR keyword has no meaning in a 32-bit environment + but is used in the SDK headers so we take it out */ +#define FAR +#define far + +/* no-op for Codewarrior C compiler; a functions are cdecl + by default */ +#define cdecl + +/* if we have wchar_t enabled in C++, predefine this type to avoid + a conflict in Novell's header files */ +#if (__option(cplusplus) && __option(wchar_type)) +#define _WCHAR_T +#endif + +/* C9X defintion used by MSL C++ library */ +#define DECIMAL_DIG 17 + +/* define long long typedefs for Watcom compatiblity */ +typedef long long int64_t; +typedef unsigned long long uint64_t; + +/* some code may want to use the MS convention for long long */ +#ifndef __int64 +#define __int64 long long +#endif + +#endif + + + From c3cb0bdba0a8306ce91816a47308e2cd8ef5b7bd Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 2 Aug 2001 20:54:49 +0000 Subject: [PATCH 2096/7878] rename the temporary scratch directory from testdir to tmpdir we have a program called testdir, so depending on the order you build/run stuff the testfile program may not have worked git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62092 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/testfile.c b/test/testfile.c index e8426a7f12e..e79bb67bfbe 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -274,13 +274,13 @@ void testdirs(apr_pool_t *pool) fprintf(stdout, "Testing Directory functions.\n"); STD_TEST_NEQ(" Making directory", - apr_dir_make("testdir", + apr_dir_make("tmpdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE | APR_GREAD | APR_GWRITE | APR_GEXECUTE | APR_WREAD | APR_WWRITE | APR_WEXECUTE, pool)) STD_TEST_NEQ(" Creating a file in the new directory", - apr_file_open(&file, "testdir/testfile", + apr_file_open(&file, "tmpdir/testfile", APR_READ | APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_UEXECUTE, pool)) @@ -288,7 +288,7 @@ void testdirs(apr_pool_t *pool) apr_file_write(file, "Another test!!", &bytes); apr_file_close(file); - STD_TEST_NEQ(" Opening directory", apr_dir_open(&temp, "testdir", pool)) + STD_TEST_NEQ(" Opening directory", apr_dir_open(&temp, "tmpdir", pool)) STD_TEST_NEQ(" Reading directory", apr_dir_read(&dirent, APR_FINFO_DIRENT, temp)) @@ -300,7 +300,7 @@ void testdirs(apr_pool_t *pool) if (apr_dir_read(&dirent, APR_FINFO_DIRENT | APR_FINFO_TYPE | APR_FINFO_SIZE | APR_FINFO_MTIME, temp) != APR_SUCCESS) { - fprintf(stderr, "Error reading directory testdir"); + fprintf(stderr, "Error reading directory tmpdir"); exit(-1); } } while (dirent.name[0] == '.'); @@ -315,8 +315,8 @@ void testdirs(apr_pool_t *pool) STD_TEST_NEQ(" Rewind directory", apr_dir_rewind(temp)) STD_TEST_NEQ(" Closing directory", apr_dir_close(temp)) STD_TEST_NEQ(" Removing file from directory", - apr_file_remove("testdir/testfile", pool)) - STD_TEST_NEQ(" Removing directory", apr_dir_remove("testdir", pool)) + apr_file_remove("tmpdir/testfile", pool)) + STD_TEST_NEQ(" Removing directory", apr_dir_remove("tmpdir", pool)) } #define TESTREAD_BLKSIZE 1024 From 4f625fc3b17afb6cf87e7b0cdac493fd798df7ef Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 2 Aug 2001 21:07:04 +0000 Subject: [PATCH 2097/7878] use exit status 0 for success in testdir, testoc, and testproc since testoc depends on occhild, build occhild when testoc is built add some trivial error code display logic to testoc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62093 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- test/testdir.c | 2 +- test/testoc.c | 10 +++++++--- test/testproc.c | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index a7c3450e495..2eb90b6804b 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -60,7 +60,7 @@ testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS) testdso@EXEEXT@: testdso.lo mod_test.so $(LOCAL_LIBS) $(LINK) -export-dynamic testdso.lo $(LOCAL_LIBS) $(ALL_LIBS) -testoc@EXEEXT@: testoc.lo $(LOCAL_LIBS) +testoc@EXEEXT@: testoc.lo occhild@EXEEXT@ $(LOCAL_LIBS) $(LINK) testoc.lo $(LOCAL_LIBS) $(ALL_LIBS) occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS) diff --git a/test/testdir.c b/test/testdir.c index fb6ae7a780b..ee26c8ef75c 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -129,5 +129,5 @@ int main(void) apr_pool_destroy(pool); printf("\nAll tests passed OK\n"); - return 1; + return 0; } diff --git a/test/testoc.c b/test/testoc.c index 701f7439e5c..fa486afd231 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -92,6 +92,7 @@ static void ocmaint(int reason, void *data, int status) int main(int argc, char *argv[]) { #if APR_HAS_OTHER_CHILD + apr_status_t rv; apr_pool_t *context; apr_proc_t newproc; apr_procattr_t *procattr = NULL; @@ -143,8 +144,11 @@ int main(int argc, char *argv[]) fprintf(stdout, "[PARENT] Sending SIGKILL to child......"); fflush(stdout); apr_sleep(1 * APR_USEC_PER_SEC); - if (apr_proc_kill(&newproc, SIGKILL) != APR_SUCCESS) { - fprintf(stderr,"couldn't send the signal!\n"); + if ((rv = apr_proc_kill(&newproc, SIGKILL)) != APR_SUCCESS) { + char msgbuf[120]; + + fprintf(stderr,"couldn't send the signal: %d/%s!\n", + rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); exit(-1); } fprintf(stdout,"OK\n"); @@ -159,6 +163,6 @@ int main(int argc, char *argv[]) fprintf(stdout, "Other_child is not supported on this platform\n"); #endif - return 1; + return 0; } diff --git a/test/testproc.c b/test/testproc.c index a5edf821189..48aafcc2124 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -146,6 +146,6 @@ int main(int argc, char *argv[]) STD_TEST_NEQ("Removing directory", apr_dir_remove("proctest", pool)) printf("\nTest completed succesfully\n"); - return(1); + return 0; } From acea563a247ecb469dd518989eaf892845b45459 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 2 Aug 2001 21:37:52 +0000 Subject: [PATCH 2098/7878] Pool debugging is pretty cool... use build/cvtdsp.pl -d (or from Apache, srclib/apr/build/cvtdsp.pl -d) to enable. Then build in debug mode. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62094 13f79535-47bb-0310-9956-ffa450edef68 --- build/cvtdsp.pl | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl index 74a3fef61d7..5fca5b554a8 100644 --- a/build/cvtdsp.pl +++ b/build/cvtdsp.pl @@ -1,25 +1,29 @@ use IO::File; use File::Find; -if ($ARGV[0] == '-6') { +if ($ARGV[0] eq '-6') { find(\&tovc6, '.'); } -elsif ($ARGV[0] == '-5') { +elsif ($ARGV[0] eq '-5') { find(\&tovc5, '.'); } -elsif ($ARGV[0] == '-w3') { +elsif ($ARGV[0] eq '-w3') { find(\&tow3, '.'); } -elsif ($ARGV[0] == '-w4') { +elsif ($ARGV[0] eq '-w4') { find(\&tow4, '.'); } -elsif ($ARGV[0] == '-ia64') { +elsif ($ARGV[0] eq '-ia64') { find(\&tovc64, '.'); } +elsif ($ARGV[0] eq '-d') { + find(\&todebugpools, '.'); +} else { print "Specify -5 or -6 for Visual Studio 5 or 6 (98) .dsp format\n"; print "Specify -w3 or -w4 for .dsp build with warning level 3 or 4 (strict)\n\n"; print "Specify -ia64 for build targeted at Itanium (req's psdk tools)\n\n"; + print "Specify -p for extreme pool debugging\n\n"; die "Missing argument"; } @@ -190,3 +194,34 @@ sub tovc64 { } } } + +sub todebugpools { + + if (m|.dsp$|) { + $oname = $_; + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $oname, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|^(# ADD CPP .* /D "_DEBUG" )|$1/D "APR_POOL_DEBUG" |) { + $verchg = -1; + if ($oname =~ /apr\.dsp$/) { + $src =~ s|^(# ADD CPP .* /D "_DEBUG" )|$1/D "POOL_DEBUG" |; + } + } + print $dstfl $src; + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted project " . $oname . " to debug pools in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } + } +} + From e5f131b799fec85cf5d31bafe7b23cce2080a358 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 2 Aug 2001 22:27:02 +0000 Subject: [PATCH 2099/7878] Added NETWARE to the WIN32 ifdef list git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62095 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/unix/start.c b/misc/unix/start.c index c7e0a7f762e..7fb2dfeab56 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -67,7 +67,7 @@ static apr_pool_t *global_apr_pool; APR_DECLARE(apr_status_t) apr_initialize(void) { apr_status_t status; -#if defined WIN32 +#if defined WIN32 || defined(NETWARE) int iVersionRequested; WSADATA wsaData; int err; @@ -81,9 +81,9 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_ENOPOOL; } -#if !defined(BEOS) && !defined(OS2) && !defined(WIN32) +#if !defined(BEOS) && !defined(OS2) && !defined(WIN32) && !defined(NETWARE) apr_unix_setup_lock(); -#elif defined WIN32 +#elif defined WIN32 || defined(NETWARE) iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); err = WSAStartup((WORD) iVersionRequested, &wsaData); if (err) { From ec35f97a7098718e69d109a095a9e59890ca3b5e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 3 Aug 2001 00:31:43 +0000 Subject: [PATCH 2100/7878] Added a stub for apr_thread_yield() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62096 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/thread.c | 4 ++++ threadproc/netware/thread.c | 3 +-- threadproc/os2/thread.c | 6 ++++++ threadproc/unix/thread.c | 4 ++++ threadproc/win32/thread.c | 5 +++++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 4903823cc18..8ceda143ad0 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -168,6 +168,10 @@ apr_status_t apr_thread_detach(apr_thread_t *thd) } } +void apr_thread_yield() +{ +} + apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { return apr_pool_userdata_get(data, key, thread->cntxt); diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index c8a42d49374..43efb0faa04 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -157,10 +157,9 @@ int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) return (tid1 == tid2); } -apr_status_t apr_thread_yield() +void apr_thread_yield() { NXThreadYield(); - return APR_SUCCESS; } apr_status_t apr_thread_exit(apr_thread_t *thd, diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 510b62d1490..0aaa342c57b 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -190,6 +190,12 @@ apr_status_t apr_thread_detach(apr_thread_t *thd) +void apr_thread_yield() +{ +} + + + apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { *thethd = &thd->tid; diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index daa8b25660f..73d6b96dd4b 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -219,6 +219,10 @@ apr_status_t apr_thread_detach(apr_thread_t *thd) } } +void apr_thread_yield() +{ +} + apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { return apr_pool_userdata_get(data, key, thread->cntxt); diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 45aa0538a7f..3e9c027f52b 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -173,6 +173,11 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) } } +APR_DECLARE(void) apr_thread_yield() +{ + SwitchToThread(); +} + APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { From cffefd693190f7772eb38c96aa5081e909927a8c Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 3 Aug 2001 00:32:10 +0000 Subject: [PATCH 2101/7878] Added the prototype for apr_thread_yield() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62097 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index b0d6b1a111b..a741c57e381 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -216,6 +216,12 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd); +/** + * force the current thread to yield the processor + * @deffunc void apr_thread_yield() + */ +APR_DECLARE(void) apr_thread_yield(); + /** * detach a thread * @param thd The thread to detach From 785a190309d7555539e827535c5aa716130eccb7 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Fri, 3 Aug 2001 03:29:14 +0000 Subject: [PATCH 2102/7878] correct the prototype to eliminate warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62098 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index a741c57e381..ddfd5528c1a 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -220,7 +220,7 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, * force the current thread to yield the processor * @deffunc void apr_thread_yield() */ -APR_DECLARE(void) apr_thread_yield(); +APR_DECLARE(void) apr_thread_yield(void); /** * detach a thread From e1ab076fa8f2b13258c2e72c89f765f31f4c992d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 4 Aug 2001 02:46:02 +0000 Subject: [PATCH 2103/7878] add optional -f parameter to set filename; this is a workaround for possible NFS locking bogosity git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62099 13f79535-47bb-0310-9956-ffa450edef68 --- test/testflock.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/test/testflock.c b/test/testflock.c index e102714b131..7e5537a7380 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -81,11 +81,10 @@ #include #include -#define TESTFILE "testfile.tmp" +const char *testfile = "testfile.tmp"; static apr_pool_t *pool = NULL; - static void errmsg(const char *msg) { if (pool != NULL) @@ -111,7 +110,7 @@ static void do_read(void) apr_file_t *file; apr_status_t status; - if (apr_file_open(&file, TESTFILE, APR_WRITE, + if (apr_file_open(&file, testfile, APR_WRITE, APR_OS_DEFAULT, pool) != APR_SUCCESS) errmsg("Could not open test file.\n"); printf("Test file opened.\n"); @@ -138,7 +137,7 @@ static void do_write(void) apr_file_t *file; apr_status_t rv; - if (apr_file_open(&file, TESTFILE, APR_WRITE|APR_CREATE, APR_OS_DEFAULT, + if (apr_file_open(&file, testfile, APR_WRITE|APR_CREATE, APR_OS_DEFAULT, pool) != APR_SUCCESS) errmsg("Could not create file.\n"); printf("Test file created.\n"); @@ -172,9 +171,18 @@ int main(int argc, const char * const *argv) if (apr_getopt_init(&opt, pool, argc, argv) != APR_SUCCESS) errmsg("Could not parse options.\n"); - while ((status = apr_getopt(opt, "r", &optchar, &optarg)) == APR_SUCCESS) { + while ((status = apr_getopt(opt, "rf:", &optchar, &optarg)) == APR_SUCCESS) { if (optchar == 'r') ++reader; + else if (optchar == 'f') + testfile = optarg; + } + if (status != APR_SUCCESS && status != APR_EOF) { + char msgbuf[80]; + + fprintf(stderr, "error: %s\n", + apr_strerror(status, msgbuf, sizeof msgbuf)); + exit(1); } if (reader) From b602f8f484107c139c5d7da5233d8a1fb3b08307 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 5 Aug 2001 10:15:46 +0000 Subject: [PATCH 2104/7878] OS/2: implement apr_lock_tryacquire() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62100 13f79535-47bb-0310-9956-ffa450edef68 --- locks/os2/locks.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/locks/os2/locks.c b/locks/os2/locks.c index 1417a828e59..d44c361b976 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -135,13 +135,14 @@ apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, -apr_status_t apr_lock_acquire(apr_lock_t *lock) +// blocks for no more than ms_timeout milliseconds +static apr_status_t os2_lock_acquire(apr_lock_t *lock, int ms_timeout) { ULONG rc; switch (lock->type) { case APR_MUTEX: - rc = DosRequestMutexSem(lock->hMutex, SEM_INDEFINITE_WAIT); + rc = DosRequestMutexSem(lock->hMutex, ms_timeout); if (rc == 0) { lock->owner = CurrentTid; @@ -157,11 +158,22 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock) return APR_OS2_STATUS(rc); } + + +apr_status_t apr_lock_acquire(apr_lock_t *lock) +{ + return os2_lock_acquire(lock, SEM_INDEFINITE_WAIT); +} + + + apr_status_t apr_lock_tryacquire(apr_lock_t *lock) { - return APR_ENOTIMPL; + return os2_lock_acquire(lock, SEM_IMMEDIATE_RETURN); } + + apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) { switch (lock->type) { From d486ce7e78d183246a8c869409184b8c65706c52 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 5 Aug 2001 23:05:37 +0000 Subject: [PATCH 2105/7878] Move the required library autoconf checks before we do the first compilation test (threads). This also removes the duplicate libraries in EXTRA_LIBS. Some OSes specified -lsocket and -lnsl in apr_hints.m4 and we'd detect it later on in the autoconf process (and add it to LIBS), but some systems need these for the threading libraries to properly link. So, if we do it before our first test, we shouldn't need it to have them listed in our hints file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62101 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ build/apr_hints.m4 | 66 ++++++++++++++++++++-------------------------- configure.in | 18 ++++++------- 3 files changed, 41 insertions(+), 46 deletions(-) diff --git a/CHANGES b/CHANGES index 89762cc744f..afdc783e694 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Detect required libraries first. This minimizes the libraries + needed in apr_hints.m4. [Justin Erenkrantz] + *) Support the AIX, glibc2, and Solaris variants of gethostby{name|addr}_r. Use gethostbyaddr_r function when available. [Sterling Hughes ] diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index cad08aa585c..511c1f1dd32 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -29,11 +29,11 @@ if test "x$apr_preload_done" != "xyes" ; then case "$host" in *mint) APR_ADDTO(CPPFLAGS, [-DMINT]) - APR_ADDTO(LIBS, [-lportlib -lsocket]) + APR_ADDTO(LIBS, [-lportlib]) ;; *MPE/iX*) APR_ADDTO(CPPFLAGS, [-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE]) - APR_ADDTO(LIBS, [-lsocket -lsvipc -lcurses]) + APR_ADDTO(LIBS, [-lsvipc -lcurses]) APR_ADDTO(LDFLAGS, [-Xlinker \"-WL,cap=ia,ba,ph;nmstack=1024000\"]) ;; *-apple-aux3*) @@ -126,11 +126,10 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-GNU*) APR_ADDTO(CPPFLAGS, [-DHURD]) - APR_ADDTO(LIBS, [-lcrypt]) ;; *-lynx-lynxos) APR_ADDTO(CPPFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) - APR_ADDTO(LIBS, [-lbsd -lcrypt]) + APR_ADDTO(LIBS, [-lbsd]) ;; *486-*-bsdi*) APR_ADDTO(CFLAGS, [-m486]) @@ -140,7 +139,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-netbsd*) APR_ADDTO(CPPFLAGS, [-DNETBSD]) - APR_ADDTO(LIBS, [-lcrypt]) ;; *-freebsd*) case $host in @@ -148,7 +146,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CFLAGS, [-funsigned-char]) ;; esac - APR_ADDTO(LIBS, [-lcrypt]) APR_SETIFNULL(enable_threads, [no]) APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_THREAD_SAFE]) ;; @@ -172,13 +169,13 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-qnx) APR_ADDTO(CPPFLAGS, [-DQNX]) - APR_ADDTO(LIBS, [-N128k -lsocket -lunix]) + APR_ADDTO(LIBS, [-N128k -lunix]) ;; *-qnx32) APR_SETVAR(CC, [cc -F]) APR_ADDTO(CPPFLAGS, [-DQNX]) APR_ADDTO(CFLAGS, [-mf -3]) - APR_ADDTO(LIBS, [-N128k -lsocket -lunix]) + APR_ADDTO(LIBS, [-N128k -lunix]) ;; *-isc4*) APR_SETVAR(CC, [gcc]) @@ -189,20 +186,19 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-sco3*) APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT]) APR_ADDTO(CFLAGS, [-Oacgiltz]) - APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) + APR_ADDTO(LIBS, [-lPW -lmalloc _i]) ;; *-sco5*) APR_ADDTO(CPPFLAGS, [-DSCO5 -D_REENTRANT]) - APR_ADDTO(LIBS, [-lsocket -lmalloc -lprot -ltinfo -lx]) + APR_ADDTO(LIBS, [-lmalloc -lprot -ltinfo -lx]) ;; *-sco_sv*|*-SCO_SV*) APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT]) - APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i]) + APR_ADDTO(LIBS, [-lPW -lmalloc _i]) ;; *-solaris2*) PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT]) - APR_ADDTO(LIBS, [-lsocket -lnsl]) APR_SETIFNULL(apr_iconv_inbuf_const, [1]) ;; *-sunos4*) @@ -210,31 +206,30 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-unixware1) APR_ADDTO(CPPFLAGS, [-DUW=100]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt]) ;; *-unixware2) APR_ADDTO(CPPFLAGS, [-DUW=200]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) + APR_ADDTO(LIBS, [-lgen]) ;; *-unixware211) APR_ADDTO(CPPFLAGS, [-DUW=211]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) + APR_ADDTO(LIBS, [-lgen]) ;; *-unixware212) APR_ADDTO(CPPFLAGS, [-DUW=212]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) + APR_ADDTO(LIBS, [-lgen]) ;; *-unixware7) APR_ADDTO(CPPFLAGS, [-DUW=700]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen]) + APR_ADDTO(LIBS, [-lgen]) ;; maxion-*-sysv4*) APR_ADDTO(CPPFLAGS, [-DSVR4]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc -lgen]) + APR_ADDTO(LIBS, [-lc -lgen]) ;; *-*-powermax*) APR_ADDTO(CPPFLAGS, [-DSVR4]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lgen]) + APR_ADDTO(LIBS, [-lgen]) ;; TPF) APR_SETVAR(CC, [c89]) @@ -246,27 +241,25 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-siemens-sysv4*) APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT -DNEED_UNION_SEMUN]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) + APR_ADDTO(LIBS, [-lc]) ;; pyramid-pyramid-svr4) APR_ADDTO(CPPFLAGS, [-DSVR4 -DNO_LONG_DOUBLE]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) + APR_ADDTO(LIBS, [-lc]) ;; DS/90\ 7000-*-sysv4*) APR_ADDTO(CPPFLAGS, [-DUXPDS]) - APR_ADDTO(LIBS, [-lsocket -lnsl]) ;; *-tandem-sysv4*) APR_ADDTO(CPPFLAGS, [-DSVR4]) - APR_ADDTO(LIBS, [-lsocket -lnsl]) ;; *-ncr-sysv4) APR_ADDTO(CPPFLAGS, [-DSVR4 -DMPRAS]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) + APR_ADDTO(LIBS, [-lc -L/usr/ucblib -lucb]) ;; *-sysv4*) APR_ADDTO(CPPFLAGS, [-DSVR4]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) + APR_ADDTO(LIBS, [-lc]) ;; 88k-encore-sysv4) APR_ADDTO(CPPFLAGS, [-DSVR4 -DENCORE]) @@ -277,11 +270,10 @@ dnl # Not a problem in 10.20. Otherwise, who knows? case $PLATOSVERS in 2*) APR_ADDTO(CPPFLAGS, [-DUTS21 -DUSEBCOPY]) APR_ADDTO(CFLAGS, [-Xa -eft]) - APR_ADDTO(LIBS, [-lsocket -lbsd -la]) + APR_ADDTO(LIBS, [-lbsd -la]) ;; *) APR_ADDTO(CPPFLAGS, [-DSVR4]) APR_ADDTO(CFLAGS, [-Xa]) - APR_ADDTO(LIBS, [-lsocket -lnsl]) ;; esac ;; @@ -307,32 +299,32 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-sequent-ptx2.*.*) APR_ADDTO(CPPFLAGS, [-DSEQUENT=20]) APR_ADDTO(CFLAGS, [-Wc,-pw]) - APR_ADDTO(LIBS, [-lsocket -linet -lnsl -lc -lseq]) + APR_ADDTO(LIBS, [-linet -lc -lseq]) ;; *-sequent-ptx4.0.*) APR_ADDTO(CPPFLAGS, [-DSEQUENT=40]) APR_ADDTO(CFLAGS, [-Wc,-pw]) - APR_ADDTO(LIBS, [-lsocket -linet -lnsl -lc]) + APR_ADDTO(LIBS, [-linet -lc]) ;; *-sequent-ptx4.[123].*) APR_ADDTO(CPPFLAGS, [-DSEQUENT=41]) APR_ADDTO(CFLAGS, [-Wc,-pw]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) + APR_ADDTO(LIBS, [-lc]) ;; *-sequent-ptx4.4.*) APR_ADDTO(CPPFLAGS, [-DSEQUENT=44]) APR_ADDTO(CFLAGS, [-Wc,-pw]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) + APR_ADDTO(LIBS, [-lc]) ;; *-sequent-ptx4.5.*) APR_ADDTO(CPPFLAGS, [-DSEQUENT=45]) APR_ADDTO(CFLAGS, [-Wc,-pw]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) + APR_ADDTO(LIBS, [-lc]) ;; *-sequent-ptx5.0.*) APR_ADDTO(CPPFLAGS, [-DSEQUENT=50]) APR_ADDTO(CFLAGS, [-Wc,-pw]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc]) + APR_ADDTO(LIBS, [-lc]) ;; *NEWS-OS*) APR_ADDTO(CPPFLAGS, [-DNEWSOS]) @@ -350,23 +342,23 @@ dnl # Not a problem in 10.20. Otherwise, who knows? case $PLATOSVERS in 5.0.4) APR_ADDTO(LDFLAGS, [-L/boot/develop/lib/x86 -L/boot/beos/system/lib -lbind -lsocket]) - APR_ADDTO(LIBS, [-lbind -lsocket -lbe -lroot]) + APR_ADDTO(LIBS, [-lbind -lbe -lroot]) APR_ADDTO(CPPFLAGS,[-DBONE7]) ;; 5.1) APR_ADDTO(LDFLAGS, [-L/boot/develop/lib/x86 -L/boot/beos/system/lib -lbind -lsocket]) - APR_ADDTO(LIBS, [-lbind -lsocket -lbe -lroot]) + APR_ADDTO(LIBS, [-lbind -lbe -lroot]) ;; esac APR_ADDTO(CPPFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK -DAP_AUTH_DBM_USE_APR]) ;; 4850-*.*) APR_ADDTO(CPPFLAGS, [-DSVR4 -DMPRAS]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) + APR_ADDTO(LIBS, [-lc -L/usr/ucblib -lucb]) ;; drs6000*) APR_ADDTO(CPPFLAGS, [-DSVR4]) - APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb]) + APR_ADDTO(LIBS, [-lc -L/usr/ucblib -lucb]) ;; m88k-*-CX/SX|CYBER) APR_ADDTO(CPPFLAGS, [-D_CX_SX]) diff --git a/configure.in b/configure.in index d9baa088052..9e79b989ca8 100644 --- a/configure.in +++ b/configure.in @@ -264,6 +264,15 @@ case $host in ;; esac +dnl #----------------------------- Checks for Any required Libraries +AC_CHECK_LIB(nsl, gethostbyname) +AC_SEARCH_LIBS(gethostname, nsl) +AC_CHECK_LIB(socket, socket) +AC_SEARCH_LIBS(crypt, crypt ufc) +AC_CHECK_LIB(truerand, main) +AC_CHECK_LIB(iconv, iconv) +AC_CHECK_LIB(m, modf) + dnl #----------------------------- Checking for Threads echo $ac_n "${nl}Checking for Threads...${nl}" @@ -469,15 +478,6 @@ if test ".$SYS_SW" = ".AIX"; then esac fi -dnl #----------------------------- Checks for Any required Libraries -AC_CHECK_LIB(nsl,gethostbyname) -AC_SEARCH_LIBS(gethostname, nsl) -AC_CHECK_LIB(socket,socket) -AC_SEARCH_LIBS(crypt, crypt ufc) -AC_CHECK_LIB(truerand,main) -AC_CHECK_LIB(iconv,iconv) -AC_CHECK_LIB(m,modf) - dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) AC_CHECK_FUNCS(calloc strcasecmp stricmp setsid nl_langinfo isinf isnan) From b33e3de2697b1156949be747d80276d7d80b394e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 6 Aug 2001 15:09:52 +0000 Subject: [PATCH 2106/7878] access the memset() declaration git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62102 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/testmem.c b/test/testmem.c index 0c50c6cd030..38e55be7d08 100644 --- a/test/testmem.c +++ b/test/testmem.c @@ -65,6 +65,8 @@ #include #include #include +#define APR_WANT_MEMFUNC +#include "apr_want.h" #include "test_apr.h" #define LUMPS 10 From a738dba761d118d2c6ffefc49b3ec0f758895e03 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 6 Aug 2001 15:46:04 +0000 Subject: [PATCH 2107/7878] Added NETWARE to the #ifdef list git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62103 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_md5.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index 9ce2e3f053d..e2fd57a602c 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -680,7 +680,7 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, const char *hash) { char sample[120]; -#if !defined(WIN32) && !defined(BEOS) +#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) char *crypt_pw; #endif if (!strncmp(hash, apr1_id, strlen(apr1_id))) { @@ -693,7 +693,7 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, /* * It's not our algorithm, so feed it to crypt() if possible. */ -#if defined(WIN32) || defined(BEOS) +#if defined(WIN32) || defined(BEOS) || defined(NETWARE) apr_cpystrn(sample, passwd, sizeof(sample) - 1); #else crypt_pw = crypt(passwd, hash); From 34e8d151f9394dfc225e95c95c71b04e4ecd0575 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 6 Aug 2001 15:50:49 +0000 Subject: [PATCH 2108/7878] Added NetWare version of locks.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62104 13f79535-47bb-0310-9956-ffa450edef68 --- locks/netware/locks.c | 313 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 313 insertions(+) create mode 100644 locks/netware/locks.c diff --git a/locks/netware/locks.c b/locks/netware/locks.c new file mode 100644 index 00000000000..71bf356e788 --- /dev/null +++ b/locks/netware/locks.c @@ -0,0 +1,313 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_strings.h" +#include "locks.h" +#include "apr_portable.h" + +static apr_status_t lock_cleanup(void *lock_) +{ + apr_lock_t *lock = lock_; + + switch (lock->type) + { + case APR_MUTEX: + NXMutexFree(lock->mutex); + break; + case APR_READWRITE: + NXRwLockFree (lock->rwlock); + break; + } + return APR_SUCCESS; +} + +apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, + const char *fname, apr_pool_t *pool) +{ + + apr_lock_t *newlock = NULL; + + /* struct apr_lock_t { + apr_pool_t *pool; + apr_locktype_e type; + apr_lockscope_e scope; + NXMutex_t *mutex; + NXRwLock_t *rwlock; + char *fname; + }; + */ + NXHierarchy_t hierarchy=0; //for libc NKS NXRwLockAlloc + NXLockInfo_t *info; //for libc NKS NXRwLockAlloc + apr_status_t status; + long flags = 0; + + newlock = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); + + if(newlock ==NULL) { + return APR_ENOMEM; + } + newlock->pool = pool; + /* ToDo: How to handle the case when no pool is available? + * How to cleanup the storage properly? + */ + newlock->fname = apr_pstrdup(pool, fname); + newlock->type = type; + newlock->scope = scope; + +//srj fill in scope later +//srj if (scope == APR_INTRAPROCESS) { +//srj InitializeCriticalSection(&newlock->section); +//srj } else { + + switch (type) + { + case APR_MUTEX: + flags=NX_MUTEX_RECURSIVE; + newlock->mutex = NXMutexAlloc(flags,NULL, NULL); + + if(newlock->mutex == NULL) + return APR_ENOMEM; + break; + case APR_READWRITE: + + info = (NXLockInfo_t *)apr_palloc(pool, sizeof(NXLockInfo_t)); + hierarchy=1; + //srj NXRwLockAlloc Allocates and initializes a reader/writer lock + //srj RWLocks are not recursive + newlock->rwlock = NXRwLockAlloc(hierarchy,info); + if(newlock->rwlock == NULL) + return APR_ENOMEM; + break; + } + +// } end of else for scope + + *lock = newlock; + apr_pool_cleanup_register(newlock->pool, newlock, lock_cleanup, + apr_pool_cleanup_null); + return APR_SUCCESS; +} + +apr_status_t apr_lock_child_init(apr_lock_t **lock, + const char *fname, + apr_pool_t *pool) +{ + /* This routine should not be called ( OpenMutex will fail if called) + * on a INTRAPROCESS lock + */ + (*lock) = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); + + if ((*lock) == NULL) { + return APR_ENOMEM; + } + (*lock)->fname = apr_pstrdup(pool, fname); + + if ((*lock)->mutex == NULL) { + return apr_get_os_error(); + } + return APR_SUCCESS; +} + +apr_status_t apr_lock_acquire(apr_lock_t *lock) +{ + DWORD rv; + switch (lock->type) + { + case APR_MUTEX: + if(NXLock(lock->mutex)==0) + return APR_SUCCESS; + break; + //srj APR_READWRITE should not be called here. Not Needed + //srj since we have apr_lock_acquire_rw function + + case APR_READWRITE: + return APR_ENOTIMPL; + default: + return APR_EINVAL; + } + + return apr_get_os_error(); +} + +APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, + apr_readerwriter_e e) +{ + switch (lock->type) + { + case APR_MUTEX: + return APR_ENOTIMPL; + + case APR_READWRITE: + + switch (e) + { + case APR_READER: +#if 0 + //srj NXRdLock specifies the reader/writer lock in the read mode + //No return values + NXRdLock (lock->rwlock); +#endif + break; + case APR_WRITER: +#if 0 + //srj NXWrLock specifies the reader/writer lock in the write mode + //No return values + NXWrLock (lock->rwlock); +#endif + break; + } + + default: + return APR_EINVAL; + } + + return APR_SUCCESS; +} + +apr_status_t apr_lock_release(apr_lock_t *lock) +{ + switch (lock->type) + { + case APR_MUTEX: +//srj will work on scope later +// +// if (lock->scope == APR_INTRAPROCESS) { +// LeaveCriticalSection(&lock->section); +// return APR_SUCCESS; +// } else { + if(NXUnlock(lock->mutex)==0); + return APR_SUCCESS; +// } + break; + + case APR_READWRITE: + return APR_ENOTIMPL; + /*NXRwUnlock (lock->rwlock);*/ + } + + return apr_get_os_error(); +} + +apr_status_t apr_lock_destroy(apr_lock_t *lock) +{ + apr_status_t stat; + + stat = lock_cleanup(lock); + if (stat == APR_SUCCESS) { + apr_pool_cleanup_kill(lock->pool, lock, lock_cleanup); + } + return stat; +} + +apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, + void *data) +{ + return apr_pool_userdata_get(data, key, lock->pool); +} + +apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, + const char *key, + apr_status_t (*cleanup) (void *)) +{ + return apr_pool_userdata_set(data, key, cleanup, lock->pool); +} + +apr_status_t apr_os_lock_get(apr_os_lock_t *thelock, + apr_lock_t *lock) +{ + switch (lock->type) + { + case APR_MUTEX: + thelock = lock->mutex; + break; + case APR_READWRITE: + return APR_ENOTIMPL; + /* thelock = lock->rwlock;*/ + break; + } + + return APR_SUCCESS; +} + +apr_status_t apr_os_lock_put(apr_lock_t **lock, + apr_os_lock_t *thelock, + apr_pool_t *pool) +{ + if (pool == NULL) { + return APR_ENOPOOL; + } + if ((*lock) == NULL) { + (*lock) = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); + (*lock)->pool = pool; + } + switch ((*lock)->type) + { + case APR_MUTEX: + (*lock)->mutex = thelock; + break; + case APR_READWRITE: + return APR_ENOTIMPL; + /*(*lock)->rwlock = *thelock;*/ + break; + } + return APR_SUCCESS; +} From 45c46c755874b75391fe5944eeb06bc38a3eab36 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 6 Aug 2001 15:57:29 +0000 Subject: [PATCH 2109/7878] Fixed the data types of the local variables used in the calls to ioctlsocket() to conform to the prototypes in order to clean up a type mismatch problem during compilation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62105 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockopt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 1534e584b87..40fab71a9b0 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -60,7 +60,7 @@ apr_status_t soblock(SOCKET sd) { - int zero = 0; + u_long zero = 0; if (ioctlsocket(sd, FIONBIO, &zero) == SOCKET_ERROR) { return apr_get_netos_error(); @@ -70,7 +70,7 @@ apr_status_t soblock(SOCKET sd) apr_status_t sononblock(SOCKET sd) { - int one = 1; + u_long one = 1; if (ioctlsocket(sd, FIONBIO, &one) == SOCKET_ERROR) { return apr_get_netos_error(); From 37b48988a959e90acf6723f5c2af2605ead2240b Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 6 Aug 2001 16:15:04 +0000 Subject: [PATCH 2110/7878] Added an ifdef for NetWare to call the delay() function and also fixed the data types of the local variables used in the call to WSARecv() to conform to the prototypes in order to clean up a type mismatch problem during compilation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62106 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/poll.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 6d11777f811..45100d69575 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -119,7 +119,11 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, } if (newread == NULL && newwrite == NULL && newexcept == NULL) { +#ifdef NETWARE + delay((DWORD)(timeout / 1000)); /* convert microseconds into milliseconds */ +#else Sleep((DWORD)(timeout / 1000)); /* convert microseconds into milliseconds */ +#endif return APR_TIMEUP; /* TODO - get everybody in synch with Win32 apr_status_t */ } else { @@ -149,8 +153,8 @@ APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_int16_t revents = 0; WSABUF data; char buf[256]; - int dummy; - int flags = MSG_PEEK; + DWORD dummy; + DWORD flags = MSG_PEEK; /* We just want to PEEK at the data, so I am setting up a dummy WSABUF * variable here. From cebd3a163b2206e8cf084781dda3bcb4acbbcaeb Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 6 Aug 2001 20:47:11 +0000 Subject: [PATCH 2111/7878] Changed the type of a local variable used in the call to getsockopt() from unsigned int to int as per the prototype. This avoids a type mismatch during compilation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62107 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index aad05ce5600..5e390a4620e 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -324,7 +324,7 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) /* Evaluate the efdset */ if (FD_ISSET(sock->sock, &efdset)) { /* The connect failed. */ - unsigned int rclen = sizeof(rc); + int rclen = sizeof(rc); if (getsockopt(sock->sock, SOL_SOCKET, SO_ERROR, (char*) &rc, &rclen)) { return apr_get_netos_error(); } From ebab91a364fbd886924529594b65bfbb4ada1168 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 6 Aug 2001 20:49:17 +0000 Subject: [PATCH 2112/7878] Added the NetWare version of get_system_time() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62108 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getuuid.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index 3d8f72cdd8e..2ecdbd99a0c 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -128,6 +128,16 @@ static void get_pseudo_node_identifier(unsigned char *node) static void get_system_time(apr_uint64_t *uuid_time) { +#ifdef NETWARE + uint64_t sec; + uint64_t usec; + + NXGetTime(NX_SINCE_1970, NX_SECONDS, &sec); + NXGetTime(NX_SINCE_1970, NX_USECONDS, &usec); + *uuid_time = (sec * 10000000) + (usec * 10) + + 0x01B21DD213814000LL; +EnterDebugger(); /* Check to make sure that we are actually getting what we expect. */ +#else struct timeval tp; /* ### fix this call to be more portable? */ @@ -138,6 +148,7 @@ static void get_system_time(apr_uint64_t *uuid_time) Unix base time is January 1, 1970. */ *uuid_time = (tp.tv_sec * 10000000) + (tp.tv_usec * 10) + 0x01B21DD213814000LL; +#endif } /* true_random -- generate a crypto-quality random number. */ From 6d52fc1661ed55a7f6e5e7106a1f3bd5d551b3d7 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 6 Aug 2001 20:51:54 +0000 Subject: [PATCH 2113/7878] Added the .def file used to build the NetWare test NLMs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62109 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.def | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 test/aprtest.def diff --git a/test/aprtest.def b/test/aprtest.def new file mode 100644 index 00000000000..72c158a0fb3 --- /dev/null +++ b/test/aprtest.def @@ -0,0 +1,3 @@ +FLAG_ON 3 +#FLAG_ON 29 +MODULE LIBC.NLM From cdf0cda30bcf0b9eb67c924e77ddb9efc48de10f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 6 Aug 2001 21:04:50 +0000 Subject: [PATCH 2114/7878] As Mats Nilsson points out, we weren't resetting the path buffer on each call, so this buffer simply grew and grew if we wanted more info than Find*File() returned. Patch based on his suggested patch to new-httpd. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62110 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index eaaaa96cc4e..b206dfb49b3 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -165,10 +165,10 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, eos[0] = '*'; eos[1] = '\0'; thedir->dirhand = FindFirstFileW(wdirname, thedir->w.entry); + eos[0] = '\0'; if (thedir->dirhand == INVALID_HANDLE_VALUE) { return apr_get_os_error(); } - eos[0] = '\0'; } else if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) { return apr_get_os_error(); @@ -188,12 +188,14 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, else #endif { + char *eop = strchr(thedir->dirname, '\0'); if (thedir->dirhand == INVALID_HANDLE_VALUE) { /* '/' terminated, so add the '*' and pop it when we finish */ - *strchr(thedir->dirname, '\0') = '*'; + eop[0] = '*'; + eop[1] = '\0'; thedir->dirhand = FindFirstFileA(thedir->dirname, thedir->n.entry); - *(strchr(thedir->dirname, '\0') - 1) = '\0'; + eop[0] = '\0'; if (thedir->dirhand == INVALID_HANDLE_VALUE) { return apr_get_os_error(); } @@ -228,7 +230,9 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if (!eos) eos = wcschr(wdirname, '\0'); wcscpy(eos, thedir->w.entry->cFileName); - return more_finfo(finfo, wdirname, wanted, MORE_OF_WFSPEC, os_level); + rv = more_finfo(finfo, wdirname, wanted, MORE_OF_WFSPEC, os_level); + eos[0] = '\0'; + return rv; } else { /* Don't waste stack space on a second buffer, the one we set From b0e6d43151678b53827758431f8883b4d348a8be Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 6 Aug 2001 21:11:15 +0000 Subject: [PATCH 2115/7878] get apr_os_dso_handle_t defined properly on Darwin Submitted by: Greg Ames git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62111 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index a6a3831d76f..8330a4fc5af 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -192,7 +192,8 @@ typedef struct tm apr_os_exp_time_t; #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) #include typedef shl_t apr_os_dso_handle_t; -#elif defined(DRAWIN) +#elif defined(DARWIN) +#include typedef NSModule apr_os_dso_handle_t; #else typedef void * apr_os_dso_handle_t; From 7409f84f39c1dbf302d4fdff59ecf0040ae04579 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 6 Aug 2001 21:43:25 +0000 Subject: [PATCH 2116/7878] gotta close the dir before it can be removed (at least on Win32); Unix never cared, but that's what we love about it git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62112 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/testdir.c b/test/testdir.c index ee26c8ef75c..c499554c50a 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -118,6 +118,9 @@ int main(void) apr_dir_read(&finfo, finfo_flags, this_dir), APR_STATUS_IS_ENOENT, "OK", "Failed") + STD_TEST_NEQ(" closing dir", + apr_dir_close(this_dir)); + /* Cleanup */ STD_TEST_NEQ(" Cleanup file1", apr_file_remove("dir1/file1", pool)) From 8cf7d50d468303ce3e171d29ebcb93c82aadb21f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 6 Aug 2001 21:54:32 +0000 Subject: [PATCH 2117/7878] Added the NetWare supported signal descriptions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62113 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/signals.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c index 6899af8770a..e46fc3c8259 100644 --- a/threadproc/netware/signals.c +++ b/threadproc/netware/signals.c @@ -90,7 +90,25 @@ void apr_signal_init(apr_pool_t *pglobal) const char *apr_signal_get_description(int signum) { - return "unknown signal (not supported)"; + switch (signum) + { + case SIGABRT: + return "Abort"; + case SIGFPE: + return "Arithmetic exception"; + case SIGILL: + return "Illegal instruction"; + case SIGINT: + return "Interrupt"; + case SIGSEGV: + return "Segmentation fault"; + case SIGTERM: + return "Terminated"; + case SIGPOLL: + return "Pollable event occurred"; + default: + return "unknown signal (not supported)"; + } } static void *signal_thread_func(void *signal_handler) From 294f4b2cd4e3f9f2b25e9b88a6950773599237f8 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 6 Aug 2001 21:55:43 +0000 Subject: [PATCH 2118/7878] Added stubs for the unsupported signals on NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62114 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_private.h | 69 ++++++++++++++++-------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 4ad90592756..460b13979d5 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -85,6 +85,8 @@ /* #define HAVE_STDDEF_H 1 why not? */ #define HAVE_STDLIB_H 1 #define HAVE_SYS_STAT_H 1 +#define HAVE_FCNTL_H 1 +#define HAVE_MKSTEMP 1 #define HAVE_STRICMP 1 #define HAVE_STRNICMP 1 @@ -97,39 +99,42 @@ #define DSO_USE_DLFCN -#if 0 -#define SIGHUP 1 -/* 2 is used for SIGINT on windows */ -#define SIGQUIT 3 -/* 4 is used for SIGILL on windows */ -#define SIGTRAP 5 -#define SIGIOT 6 -#define SIGBUS 7 -/* 8 is used for SIGFPE on windows */ -#define SIGKILL 9 -#define SIGUSR1 10 -/* 11 is used for SIGSEGV on windows */ -#define SIGUSR2 12 -#define SIGPIPE 13 -#define SIGALRM 14 -/* 15 is used for SIGTERM on windows */ -#define SIGSTKFLT 16 -#define SIGCHLD 17 -#define SIGCONT 18 -#define SIGSTOP 19 -#define SIGTSTP 20 -/* 21 is used for SIGBREAK on windows */ -/* 22 is used for SIGABRT on windows */ -#define SIGTTIN 23 -#define SIGTTOU 24 -#define SIGURG 25 -#define SIGXCPU 26 -#define SIGXFSZ 27 -#define SIGVTALRM 28 -#define SIGPROF 29 -#define SIGWINCH 30 -#define SIGIO 31 +/* 1 is used for SIGABRT on netware */ +/* 2 is used for SIGFPE on netware */ +/* 3 is used for SIGILL on netware */ +/* 4 is used for SIGINT on netware */ +/* 5 is used for SIGSEGV on netware */ +/* 6 is used for SIGTERM on netware */ +/* 7 is used for SIGPOLL on netware */ + +#define SIGKILL 11 +#define SA_NOCLDSTOP 12 +#define SIGALRM 13 +#define SIGCHLD 14 +#define SIGCONT 15 +#define SIGHUP 16 +#define SIGPIPE 17 +#define SIGQUIT 18 +#define SIGSTOP 19 +#define SIGTSTP 20 +#define SIGTTIN 21 +#define SIGTTOU 22 +#define SIGUSR1 23 +#define SIGUSR2 24 + +#define SIGTRAP 25 +#define SIGIOT 26 +#define SIGBUS 27 +#define SIGSTKFLT 28 +#define SIGURG 29 +#define SIGXCPU 30 +#define SIGXFSZ 31 +#define SIGVTALRM 32 +#define SIGPROF 33 +#define SIGWINCH 34 +#define SIGIO 35 +#if 0 #define __attribute__(__x) /* APR COMPATABILITY FUNCTIONS From 6fec697ece5af2da75a5adc8c2e2a93acd94e550 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 6 Aug 2001 22:05:47 +0000 Subject: [PATCH 2119/7878] Added a #define for the NetWare version of apr_get_netos_error() that handles WinSock error codes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62115 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 479bca39dba..dbb47e4681d 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -702,7 +702,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #else /* !def OS2 || WIN32 */ - /* * os error codes are clib error codes */ @@ -711,6 +710,9 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) +#ifdef NETWARE +#define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) +#endif #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) From b3ea36069e9ea91fa29e4de6da8f89d64ef1ee70 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 7 Aug 2001 14:12:29 +0000 Subject: [PATCH 2120/7878] mention some problems with apr_dir_rewind() for Win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62116 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index b206dfb49b3..cc048737cbd 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -257,6 +257,12 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *dir) { + /* XXX FIXME... + * 1) dir_cleanup() does FindClose(), so the FindClose() call + * here will always return a meaningless error (bad handle). + * 2) Don't we need to re-open the directory, or is there a + * Win32 way to rewind? + */ dir_cleanup(dir); if (!FindClose(dir->dirhand)) { return apr_get_os_error(); From 9725a786ab15860dd72c439053fc27aae872ea1b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 7 Aug 2001 14:16:49 +0000 Subject: [PATCH 2121/7878] add some simple diagnostics for apr_send() failures git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62117 13f79535-47bb-0310-9956-ffa450edef68 --- test/client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/client.c b/test/client.c index a7a5eb1904f..5ae27378230 100644 --- a/test/client.c +++ b/test/client.c @@ -148,9 +148,10 @@ int main(int argc, char *argv[]) fprintf(stdout, "\tClient: Trying to send data over socket......."); length = STRLEN; - if (apr_send(sock, datasend, &length) != APR_SUCCESS) { + if ((stat = apr_send(sock, datasend, &length) != APR_SUCCESS)) { apr_socket_close(sock); - fprintf(stderr, "Problem sending data\n"); + fprintf(stderr, "Problem sending data: %s (%d)\n", + apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); exit(-1); } fprintf(stdout, "OK\n"); From 08317254376057f05c0112969d89a83966425646 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 7 Aug 2001 14:23:38 +0000 Subject: [PATCH 2122/7878] add a comment to apr_file_lock() for Win32 about an issue detecting the retry-able condition when another process is holding the lock git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62118 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/flock.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index 9308a6c41be..9e580300b12 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -63,6 +63,11 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) + (((type & APR_FLOCK_TYPEMASK) == APR_FLOCK_SHARED) ? 0 : LOCKFILE_EXCLUSIVE_LOCK); memset (&offset, 0, sizeof(offset)); + /* XXX on NT 4.0 we get ERROR_LOCK_VIOLATION when we specify + * LOCKFILE_FAIL_IMMEDIATELY and another process is holding + * the lock; something needs to be done so an APR app can + * recognize this as a try-again situation + */ /* Syntax is correct, len is passed for LengthLow and LengthHigh*/ if (!LockFileEx(thefile->filehand, flags, 0, len, len, &offset)) return apr_get_os_error(); From f26f835c907aa6ce2bf2dc7bc9d2c85714fc68ad Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 7 Aug 2001 17:21:21 +0000 Subject: [PATCH 2123/7878] Update for the 2.0.23 tag git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62119 13f79535-47bb-0310-9956-ffa450edef68 --- apr.mak | 96 +++++++++++++++++-------------------------------- libapr.mak | 102 ++++++++++++++++++----------------------------------- 2 files changed, 66 insertions(+), 132 deletions(-) diff --git a/apr.mak b/apr.mak index aa2f59b33e1..bb67cd3e001 100644 --- a/apr.mak +++ b/apr.mak @@ -25,6 +25,8 @@ NULL= NULL=nul !ENDIF +CPP=cl.exe + !IF "$(CFG)" == "apr - Win32 Release" OUTDIR=.\LibR @@ -108,44 +110,12 @@ CLEAN : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" RSC=rc.exe -CPP=cl.exe CPP_PROJ=/nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I\ "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D\ "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ /Fd"$(INTDIR)\apr" /FD /c CPP_OBJS=.\LibR/ CPP_SBRS=. - -.c{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\apr.bsc" BSC32_SBRS= \ @@ -300,44 +270,12 @@ CLEAN : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" RSC=rc.exe -CPP=cl.exe CPP_PROJ=/nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I\ "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D\ "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ /Fd"$(INTDIR)\apr" /FD /c CPP_OBJS=.\LibD/ CPP_SBRS=. - -.c{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\apr.bsc" BSC32_SBRS= \ @@ -410,6 +348,36 @@ LIB32_OBJS= \ !ENDIF +.c{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + !IF "$(CFG)" == "apr - Win32 Release" || "$(CFG)" == "apr - Win32 Debug" SOURCE=.\dso\win32\dso.c diff --git a/libapr.mak b/libapr.mak index e430ed0995c..4a80bb64429 100644 --- a/libapr.mak +++ b/libapr.mak @@ -25,6 +25,10 @@ NULL= NULL=nul !ENDIF +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + !IF "$(CFG)" == "libapr - Win32 Release" OUTDIR=.\Release @@ -110,47 +114,13 @@ CLEAN : "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" -CPP=cl.exe CPP_PROJ=/nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I\ "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D\ "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ /Fd"$(INTDIR)\apr" /FD /c CPP_OBJS=.\Release/ CPP_SBRS=. - -.c{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -MTL=midl.exe MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -RSC=rc.exe BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapr.bsc" BSC32_SBRS= \ @@ -311,47 +281,13 @@ CLEAN : "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" -CPP=cl.exe CPP_PROJ=/nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I\ "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D\ "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\ /Fd"$(INTDIR)\apr" /FD /c CPP_OBJS=.\Debug/ CPP_SBRS=. - -.c{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -MTL=midl.exe MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -RSC=rc.exe BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapr.bsc" BSC32_SBRS= \ @@ -427,6 +363,36 @@ LINK32_OBJS= \ !ENDIF +.c{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(CPP_OBJS)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(CPP_SBRS)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + !IF "$(CFG)" == "libapr - Win32 Release" || "$(CFG)" == "libapr - Win32 Debug" SOURCE=.\dso\win32\dso.c From 0f9ddefdd27ac0c9f0e1f7050c91f661d117f9ad Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 7 Aug 2001 17:30:10 +0000 Subject: [PATCH 2124/7878] Ramblings git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62120 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 8dbf1d8a612..71d5d740989 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/07/30 03:04:07 $] +Last modified at [$Date: 2001/08/07 17:30:10 $] Release: @@ -21,6 +21,13 @@ RELEASE SHOWSTOPPERS: DougM offered to complete the work with his nifty perl rename script at the hackathon. + * Win32 utf-8 filenames are broken by GetSecurityInfoByNameW() + which won't accept Win32's canonical \\?\D:\foo long naming + conventions. Convert to _ByHandle or add an arg to our utf-8 + name converter so we can handle this. + + * Jeff Trawick reports our pool cleanup on apr_dir_*() is horked + on Win32. RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Get OTHER_CHILD support into Win32 From 218162d914eb47f7cf4a9ed16f1c6371cc662e88 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 7 Aug 2001 19:09:21 +0000 Subject: [PATCH 2125/7878] fix the APR_TEST_* macros to retrieve the proper APR error string git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62121 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/aprtest.h b/test/aprtest.h index 7487a2d4a14..7a0e559ceb9 100644 --- a/test/aprtest.h +++ b/test/aprtest.h @@ -71,7 +71,7 @@ char msgbuf[256]; \ fprintf (stdout, "Failed\n"); \ fprintf (stderr, "Error (%d): %s\n%s", rv, #op, \ - apr_strerror(stat, msgbuf, sizeof(msgbuf))); \ + apr_strerror(rv, msgbuf, sizeof(msgbuf))); \ exit(-1); } #define APR_TEST_END(rv, op) \ From 889a7ed03b779ea722219831908111fd71f2860c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 7 Aug 2001 19:13:27 +0000 Subject: [PATCH 2126/7878] fix the type of the length parameter to apr_hash_this() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62122 13f79535-47bb-0310-9956-ffa450edef68 --- test/testhash.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testhash.c b/test/testhash.c index d72eaf17be5..fa9d60dfbc8 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -71,12 +71,12 @@ static void dump_hash(apr_pool_t *p, apr_hash_t *h) { apr_hash_index_t *hi; char *val, *key; - int len; + apr_ssize_t len; int i = 0; for (hi = apr_hash_first(p, h); hi; hi = apr_hash_next(hi)) { - apr_hash_this(hi,(void*) &key, &len,(void*) &val); - fprintf(stdout, "Key %s (%d) Value %s\n",key,len,val); + apr_hash_this(hi,(void*) &key, &len, (void*) &val); + fprintf(stdout, "Key %s (%" APR_SSIZE_T_FMT ") Value %s\n", key, len, val); i++; } if (i != apr_hash_count(h)) From ac93eed2e1dc6c88cf1c72ec4a7c8218051b60f3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 7 Aug 2001 19:57:44 +0000 Subject: [PATCH 2127/7878] Fix apr_dir_rewind() for Win32 to avoid returning a bogus error. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62123 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ STATUS | 5 +---- file_io/win32/dir.c | 14 +++----------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index afdc783e694..69b8e5f61fe 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix apr_dir_rewind() for Win32 to avoid returning a bogus error. + [Jeff Trawick, William Rowe] + *) Detect required libraries first. This minimizes the libraries needed in apr_hints.m4. [Justin Erenkrantz] diff --git a/STATUS b/STATUS index 71d5d740989..2d4bc8b14c3 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/08/07 17:30:10 $] +Last modified at [$Date: 2001/08/07 19:57:44 $] Release: @@ -26,9 +26,6 @@ RELEASE SHOWSTOPPERS: conventions. Convert to _ByHandle or add an arg to our utf-8 name converter so we can handle this. - * Jeff Trawick reports our pool cleanup on apr_dir_*() is horked - on Win32. - RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Get OTHER_CHILD support into Win32 Status: Bill S. is looking into this diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index cc048737cbd..33149933807 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -257,18 +257,10 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *dir) { - /* XXX FIXME... - * 1) dir_cleanup() does FindClose(), so the FindClose() call - * here will always return a meaningless error (bad handle). - * 2) Don't we need to re-open the directory, or is there a - * Win32 way to rewind? + /* this will mark the handle as invalid and we'll open it + * again if apr_dir_read() is subsequently called */ - dir_cleanup(dir); - if (!FindClose(dir->dirhand)) { - return apr_get_os_error(); - } - dir->dirhand = INVALID_HANDLE_VALUE; - return APR_SUCCESS; + return dir_cleanup(dir); } APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, From 48eb8fbabae19d357ed1e4dd70bd13da8637cfd6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 7 Aug 2001 20:24:50 +0000 Subject: [PATCH 2128/7878] Non-blocking connects shouldn't be calling connect a second time. According to Single Unix, a non-blocking connect has succeeded when the select pops successfully. It has failed if the select failed. The second connect was causing 502's in the httpd-proxy. Submitted by: John Barbee barbee@veribox.net Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62124 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ network_io/unix/sockets.c | 13 +++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 69b8e5f61fe..1d633b7f065 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) Non-blocking connects shouldn't be calling connect a second + time. According to Single Unix, a non-blocking connect has + succeeded when the select pops successfully. It has failed + if the select failed. The second connect was causing 502's + in the httpd-proxy. [John Barbee barbee@veribox.net] + *) Fix apr_dir_rewind() for Win32 to avoid returning a bogus error. [Jeff Trawick, William Rowe] diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 06a3930c4d5..3ff01912d31 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -273,16 +273,9 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) * socket; if called again, we can see EALREADY */ if (rc == -1 && (errno == EINPROGRESS || errno == EALREADY) && sock->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); - if (arv != APR_SUCCESS) { - return arv; - } - else { - do { - rc = connect(sock->socketdes, - (const struct sockaddr *)&sa->sa.sin, - sa->salen); - } while (rc == -1 && errno == EINTR); + rc = apr_wait_for_io_or_timeout(sock, 0); + if (rc != APR_SUCCESS) { + return rc; } } From f69bd3c7a35a808769c244049f0d6f3e026bcbcb Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 7 Aug 2001 21:46:34 +0000 Subject: [PATCH 2129/7878] Turned off APR_HAS_RANDOM for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62125 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arch/netware/apr.h b/include/arch/netware/apr.h index 9cf39a6a7a1..70cf00a7b01 100644 --- a/include/arch/netware/apr.h +++ b/include/arch/netware/apr.h @@ -159,7 +159,7 @@ #define APR_HAS_SENDFILE 0 #define APR_HAS_MMAP 0 #define APR_HAS_FORK 0 -#define APR_HAS_RANDOM 1 +#define APR_HAS_RANDOM 0 #define APR_HAS_XLATE 0 #define APR_HAS_OTHER_CHILD 0 #define APR_HAS_DSO 1 From 7845882b8bb53ffcde1dbf99ab875d3923310be7 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 7 Aug 2001 21:48:34 +0000 Subject: [PATCH 2130/7878] Added the NetWare specific calls to enable get_random_info() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62126 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getuuid.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index 2ecdbd99a0c..57665c71a51 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -99,15 +99,24 @@ static void get_random_info(unsigned char node[NODE_LENGTH]) * replace with pid/tid for portability (in the spirit of mod_unique_id) */ struct { /* Add thread id here, if applicable, when we get to pthread or apr */ - pid_t pid; + pid_t pid; +#ifdef NETWARE + apr_uint64_t t; +#else struct timeval t; +#endif char hostname[257]; } r; apr_md5_init(&c); +#ifdef NETWARE + r.pid = NXThreadGetId(); + NXGetTime(NX_SINCE_BOOT, NX_USECONDS, &(r.t)); +#else r.pid = getpid(); gettimeofday(&r.t, (struct timezone *)0); +#endif gethostname(r.hostname, 256); apr_md5_update(&c, (const unsigned char *)&r, sizeof(r)); apr_md5_final(seed, &c); @@ -130,13 +139,9 @@ static void get_system_time(apr_uint64_t *uuid_time) { #ifdef NETWARE uint64_t sec; - uint64_t usec; NXGetTime(NX_SINCE_1970, NX_SECONDS, &sec); - NXGetTime(NX_SINCE_1970, NX_USECONDS, &usec); - *uuid_time = (sec * 10000000) + (usec * 10) + - 0x01B21DD213814000LL; -EnterDebugger(); /* Check to make sure that we are actually getting what we expect. */ + *uuid_time = (sec * 10000000) + 0x01B21DD213814000LL; #else struct timeval tp; From f704c6278df117984bdb137b253099d5419ef94e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 7 Aug 2001 23:21:32 +0000 Subject: [PATCH 2131/7878] Fixed apr_os_strerror() to allow it to handle Winsock errors for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62127 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index e3d7f735315..caea40ca601 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -215,7 +215,7 @@ static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) return stuffbuffer(buf, bufsize, result); } -#elif defined(WIN32) +#elif defined(WIN32) || defined(NETWARE) static const struct { apr_status_t code; @@ -276,8 +276,9 @@ static const struct { static char *apr_os_strerror(char *buf, apr_size_t bufsize, apr_status_t errcode) { - apr_size_t len, i; + apr_size_t len=0, i; +#ifndef NETWARE len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, errcode, @@ -285,6 +286,7 @@ static char *apr_os_strerror(char *buf, apr_size_t bufsize, apr_status_t errcode (LPTSTR) buf, (DWORD)bufsize, NULL); +#endif if (!len) { for (i = 0; gaErrorList[i].msg; ++i) { From a064817915408a229a0b7e62d754879fe5a5fbdb Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 7 Aug 2001 23:22:52 +0000 Subject: [PATCH 2132/7878] Fixed the apr_get_netos_error() macro to allow it to handle Winsock errors for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62128 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index dbb47e4681d..bb310d549e5 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -711,7 +711,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) #ifdef NETWARE -#define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) +#define apr_get_netos_error() (WSAGetLastError()+APR_OS_START_SYSERR) #endif #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) From 1b8cf7897d10a4a5e42c5f808cdf122070c48495 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 7 Aug 2001 23:56:35 +0000 Subject: [PATCH 2133/7878] Finish the fix for the non-blocking connect. Basically, we need to query the socket to find the actual error if the connect failed. This is done using getsockopt with the SO_ERROR option. If error == 0, then the connect succeeded, else error is the connect errno value. Submitted by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62129 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 3ff01912d31..e3df6e91438 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -273,10 +273,18 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) * socket; if called again, we can see EALREADY */ if (rc == -1 && (errno == EINPROGRESS || errno == EALREADY) && sock->timeout != 0) { + int error; + apr_size_t len = sizeof(error); rc = apr_wait_for_io_or_timeout(sock, 0); if (rc != APR_SUCCESS) { return rc; } + if ((rc = getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len)) < 0) { + return(rc); + } + if (error) { + return error; + } } if (rc == -1) { From 114b3698036f3807c7e8a2ef2b0e95a3e05ce190 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 8 Aug 2001 00:30:17 +0000 Subject: [PATCH 2134/7878] get sockets.c to compile and fix a bug in the error path from getsockopt() (not tested... 2 yr old is begging for a walk :) ) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62130 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index e3df6e91438..b03c850acf1 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -275,12 +275,13 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) if (rc == -1 && (errno == EINPROGRESS || errno == EALREADY) && sock->timeout != 0) { int error; apr_size_t len = sizeof(error); + rc = apr_wait_for_io_or_timeout(sock, 0); if (rc != APR_SUCCESS) { return rc; } - if ((rc = getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len)) < 0) { - return(rc); + if ((rc = getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR, &error, &len)) < 0) { + return errno; } if (error) { return error; From b68049cdafd244b1af9a0312d026ee26307cdc61 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 8 Aug 2001 05:48:58 +0000 Subject: [PATCH 2135/7878] Clean up two warnings: Warning #1 may or may not have ever existed (my mind is a blur), but this change seems to be the most sensible way to go anyhow. The len parameter to getsockopt() seems to most want to be an apr_socklen_t in order to get along with all platforms. Warning #2 I definitely saw on Solaris 2.6, which was that parm 4 to getsockopt() was an incompatible pointer type. That's funky, because we were passing in an int* to a function that generally expects a void*. Right? Wrong, not in this case. Solaris 2.6 ifndef _XPG4_2 (and possibly Win32 as well according to msdn.microsoft.com) expect a char*! That's wacky. Anyway, casting the int* to a char* makes these platforms happy (ugly though it is), and the sane platforms that just take a void* could care less either way. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62131 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index b03c850acf1..e76b7954c2c 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -274,13 +274,13 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) */ if (rc == -1 && (errno == EINPROGRESS || errno == EALREADY) && sock->timeout != 0) { int error; - apr_size_t len = sizeof(error); + apr_socklen_t len = sizeof(error); rc = apr_wait_for_io_or_timeout(sock, 0); if (rc != APR_SUCCESS) { return rc; } - if ((rc = getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR, &error, &len)) < 0) { + if ((rc = getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR, (char *)&error, &len)) < 0) { return errno; } if (error) { From 642a23ecda6ff6f190fbf36d5c514e2f64525cc5 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 8 Aug 2001 05:54:41 +0000 Subject: [PATCH 2136/7878] Fix a segfault on Win32 when hostname resolution fails. We were looking up the error but forgot to actually return with that error number. Submitted by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62132 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 3df2679be33..1290b7983e5 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -439,7 +439,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, if (!hp) { #ifdef WIN32 - apr_get_netos_error(); + return apr_get_netos_error(); #elif APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) #ifdef GETHOSTBYNAME_R_HOSTENT_DATA From a9fcaad44adf2850c0939cb2d8924aea8985796c Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Wed, 8 Aug 2001 19:11:25 +0000 Subject: [PATCH 2137/7878] Don't use the name "socket" because certain GCC settings warn about shadowing the global function socket() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62134 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index d49a01ac0fb..05800a70174 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -818,14 +818,14 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, * @param socket The socket to enable inheritance. * @deffunc void apr_socket_set_inherit(apr_socket_t *socket) */ -APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *socket); +APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *skt); /** * Unset a socket from being inherited by child processes. * @param socket The socket to disable inheritance. * @deffunc void apr_socket_unset_inherit(apr_socket_t *socket) */ -APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *socket); +APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *skt); #ifdef __cplusplus } From 7467d6599e608f5a6ada573c1a3e687d54929f3a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 9 Aug 2001 19:33:58 +0000 Subject: [PATCH 2138/7878] don't destroy an APR lock which wasn't successfully created; this fixes a segfault reported by Shail Bhatnagar git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62135 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index be0e4179f05..112ced993c9 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -826,13 +826,11 @@ APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *globalp) status = apr_lock_create(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, globalp); if (status != APR_SUCCESS) { - apr_lock_destroy(alloc_mutex); return status; } status = apr_lock_create(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, globalp); if (status != APR_SUCCESS) { - apr_lock_destroy(spawn_mutex); return status; } #endif From 1f6214bd11fb93367c29468578517d7511abbd59 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 9 Aug 2001 23:26:18 +0000 Subject: [PATCH 2139/7878] Implemented apr_getsocketopt() for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62136 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockopt.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 40fab71a9b0..87000b260f4 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -173,6 +173,41 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { +#ifdef NETWARE + int sol_opt = 0; + + switch (opt) { + case APR_SO_TIMEOUT: + /* Convert from milliseconds (windows units) to microseconds + * (APR units) */ + *on = (apr_int32_t)(sock->timeout * 1000); + break; + case APR_SO_DISCONNECTED: + *on = sock->disconnected; + break; + case APR_SO_KEEPALIVE: + sol_opt = SO_KEEPALIVE; + break; + case APR_SO_DEBUG: + sol_opt = SO_DEBUG; + break; + case APR_SO_REUSEADDR: + sol_opt = SO_REUSEADDR; + break; + case APR_SO_NONBLOCK: + case APR_SO_LINGER: + default: + return APR_ENOTIMPL; + break; + } + if (sol_opt) { + int sz = sizeof(apr_int32_t); + + if (getsockopt(sock->sock, SOL_SOCKET, sol_opt, (char *)on, &sz) == -1) { + return apr_get_netos_error(); + } + } +#else switch (opt) { case APR_SO_TIMEOUT: /* Convert from milliseconds (windows units) to microseconds @@ -191,6 +226,7 @@ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, return APR_ENOTIMPL; break; } +#endif return APR_SUCCESS; } From e7da6a8d81aa851e1d44f381ccb57bc8380d86b2 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 9 Aug 2001 23:28:38 +0000 Subject: [PATCH 2140/7878] Added a call to socket() in apr_socket_create() that is not hard coded to TCP git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62137 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 5e390a4620e..0e10006a5d1 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -139,10 +139,14 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, return APR_ENOMEM; } +#ifdef NETWARE + (*new)->sock = socket(family, type, 0); +#else /* For right now, we are not using socket groups. We may later. * No flags to use when creating a socket, so use 0 for that parameter as well. */ (*new)->sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); +#endif #if APR_HAVE_IPV6 if ((*new)->sock == INVALID_SOCKET && ofamily == AF_UNSPEC) { family = AF_INET; From 5188a24ab63170d7cf71f04a7fad16f6f292251f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 10 Aug 2001 01:38:44 +0000 Subject: [PATCH 2141/7878] Changed the create thread flags due to changes in the NetWare threading APIs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62138 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/thread.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 43efb0faa04..70909b0b7be 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -92,7 +92,7 @@ apr_status_t apr_thread_create(apr_thread_t **new, { apr_status_t stat; size_t stacksize; - long flags = NX_CTX_AUTO_CLEANUP; + long flags = NX_THR_BIND_CONTEXT; char threadName[NX_MAX_OBJECT_NAME_LEN+1]; //srj added for nks giving the threads names @@ -115,12 +115,9 @@ apr_status_t apr_thread_create(apr_thread_t **new, stacksize = attr->stack_size; if (attr->detach) flags |= NX_THR_DETACHED; - else - flags |= NX_THR_JOINABLE; } else { stacksize = APR_DEFAULT_STACK_SIZE; - flags |= NX_THR_JOINABLE; } (*new)->ctx = NXContextAlloc( From 415094b4c63940877d9fd99baadfcbbea55354d8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 10 Aug 2001 21:04:49 +0000 Subject: [PATCH 2142/7878] Wrap all APR functions in APR_DECLARE macro. Submitted by: Sterling Hughes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62139 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ file_io/os2/dir.c | 20 ++++++------- file_io/os2/filedup.c | 2 +- file_io/os2/filestat.c | 14 ++++----- file_io/os2/flock.c | 4 +-- file_io/os2/open.c | 24 ++++++++-------- file_io/os2/pipe.c | 8 +++--- file_io/os2/readwrite.c | 21 ++++++-------- file_io/os2/seek.c | 4 +-- file_io/unix/filestat.c | 15 ++++++---- file_io/unix/flock.c | 4 +-- file_io/unix/open.c | 24 ++++++++-------- file_io/unix/pipe.c | 10 +++---- file_io/unix/readwrite.c | 20 ++++++------- file_io/unix/seek.c | 2 +- locks/beos/locks.c | 36 +++++++++++++----------- locks/os2/locks.c | 30 ++++++++++---------- locks/unix/locks.c | 37 ++++++++++++------------ misc/unix/getuuid.c | 2 +- misc/unix/rand.c | 3 +- network_io/beos/poll.c | 28 +++++++++--------- network_io/beos/sendrecv.c | 18 ++++++------ network_io/os2/poll.c | 25 ++++++++--------- network_io/os2/sendrecv.c | 6 ++-- network_io/os2/sendrecv_udp.c | 10 +++---- network_io/os2/sockets.c | 38 +++++++++++-------------- network_io/os2/sockopt.c | 6 ++-- shmem/beos/shmem.c | 20 ++++++------- shmem/os2/shmem.c | 18 ++++++------ shmem/unix/shmem.c | 18 ++++++------ threadproc/beos/proc.c | 48 +++++++++++++++---------------- threadproc/beos/thread.c | 34 +++++++++++----------- threadproc/beos/threadpriv.c | 28 +++++++++--------- threadproc/os2/proc.c | 48 +++++++++++++++---------------- threadproc/os2/thread.c | 34 +++++++++++----------- threadproc/os2/threadpriv.c | 28 +++++++++--------- threadproc/unix/proc.c | 53 ++++++++++++++++++----------------- threadproc/unix/procsup.c | 2 +- threadproc/unix/signals.c | 4 +-- threadproc/unix/thread.c | 34 +++++++++++----------- threadproc/unix/threadpriv.c | 28 +++++++++--------- time/unix/time.c | 36 +++++++++++++----------- 42 files changed, 426 insertions(+), 421 deletions(-) diff --git a/CHANGES b/CHANGES index 1d633b7f065..dccb099d197 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Wrap all functions in APR_DECLARE macro. + [Sterling Hughes ] + *) Non-blocking connects shouldn't be calling connect a second time. According to Single Unix, a non-blocking connect has succeeded when the select pops successfully. It has failed diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 12d5679e7af..3281d7a4bed 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -67,7 +67,7 @@ static apr_status_t dir_cleanup(void *thedir) -apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cntxt) +APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cntxt) { apr_dir_t *thedir = (apr_dir_t *)apr_palloc(cntxt, sizeof(apr_dir_t)); @@ -89,7 +89,7 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cntx -apr_status_t apr_dir_close(apr_dir_t *thedir) +APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir) { int rv = 0; @@ -106,8 +106,8 @@ apr_status_t apr_dir_close(apr_dir_t *thedir) -apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, - apr_dir_t *thedir) +APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, + apr_dir_t *thedir) { int rv; ULONG entries = 1; @@ -161,28 +161,28 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, -apr_status_t apr_dir_rewind(apr_dir_t *thedir) +APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir) { return apr_dir_close(thedir); } -apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { return APR_OS2_STATUS(DosCreateDir(path, NULL)); } -apr_status_t apr_dir_remove(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont) { return APR_OS2_STATUS(DosDeleteDir(path)); } -apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) +APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) { if (dir == NULL) { return APR_ENODIR; @@ -193,8 +193,8 @@ apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) -apr_status_t apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, + apr_pool_t *cont) { if ((*dir) == NULL) { (*dir) = (apr_dir_t *)apr_pcalloc(cont, sizeof(apr_dir_t)); diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 717d08ed937..6a3acf3ef34 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -59,7 +59,7 @@ #include #include "inherit.h" -apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { int rv; apr_file_t *dup_file; diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 71c59bba64d..e9a7820adcf 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -115,8 +115,8 @@ static apr_status_t handle_type(apr_filetype_e *ftype, HFILE file) -apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, - apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, + apr_file_t *thefile) { ULONG rc; FILESTATUS3 fstatus; @@ -145,14 +145,14 @@ apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, return APR_OS2_STATUS(rc); } -apr_status_t apr_file_perms_set(const char *fname, apr_fileperms_t perms) +APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, apr_fileperms_t perms) { return APR_ENOTIMPL; } -apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, + apr_int32_t wanted, apr_pool_t *cont) { ULONG rc; FILESTATUS3 fstatus; @@ -177,8 +177,8 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, -apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, + apr_int32_t wanted, apr_pool_t *cont) { return apr_stat(finfo, fname, wanted, cont); } diff --git a/file_io/os2/flock.c b/file_io/os2/flock.c index 98e6c52d145..697f2cc846b 100644 --- a/file_io/os2/flock.c +++ b/file_io/os2/flock.c @@ -54,7 +54,7 @@ #include "fileio.h" -apr_status_t apr_file_lock(apr_file_t *thefile, int type) +APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) { FILELOCK lockrange = { 0, 0x7fffffff }; ULONG rc; @@ -65,7 +65,7 @@ apr_status_t apr_file_lock(apr_file_t *thefile, int type) return APR_FROM_OS_ERROR(rc); } -apr_status_t apr_file_unlock(apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) { FILELOCK unlockrange = { 0, 0x7fffffff }; ULONG rc; diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 05089f5bfb8..91a5d39226a 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -68,7 +68,7 @@ apr_status_t apr_file_cleanup(void *thefile) -apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cntxt) +APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cntxt) { int oflags = 0; int mflags = OPEN_FLAGS_FAIL_ON_ERROR|OPEN_SHARE_DENYNONE; @@ -150,7 +150,7 @@ apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag -apr_status_t apr_file_close(apr_file_t *file) +APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) { ULONG rc; apr_status_t status; @@ -179,7 +179,7 @@ apr_status_t apr_file_close(apr_file_t *file) -apr_status_t apr_file_remove(const char *path, apr_pool_t *cntxt) +APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cntxt) { ULONG rc = DosDelete(path); return APR_OS2_STATUS(rc); @@ -187,8 +187,8 @@ apr_status_t apr_file_remove(const char *path, apr_pool_t *cntxt) -apr_status_t apr_file_rename(const char *from_path, const char *to_path, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_path, + apr_pool_t *p) { ULONG rc = DosMove(from_path, to_path); @@ -205,7 +205,7 @@ apr_status_t apr_file_rename(const char *from_path, const char *to_path, -apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) +APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) { *thefile = file->filedes; return APR_SUCCESS; @@ -213,7 +213,7 @@ apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) -apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) { apr_os_file_t *dafile = thefile; @@ -229,8 +229,7 @@ apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool } - -apr_status_t apr_file_eof(apr_file_t *fptr) +APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) { if (!fptr->isopen || fptr->eof_hit == 1) { return APR_EOF; @@ -239,8 +238,7 @@ apr_status_t apr_file_eof(apr_file_t *fptr) } - -apr_status_t apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { apr_os_file_t fd = 2; @@ -249,7 +247,7 @@ apr_status_t apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) -apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) { apr_os_file_t fd = 1; @@ -257,7 +255,7 @@ apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) } -apr_status_t apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) { apr_os_file_t fd = 0; diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 2e20caf125e..6219c34e49c 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -61,7 +61,7 @@ #include #include -apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) { ULONG filedes[2]; ULONG rc, action; @@ -141,7 +141,7 @@ apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t -apr_status_t apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) { /* Not yet implemented, interface not suitable */ return APR_ENOTIMPL; @@ -149,7 +149,7 @@ apr_status_t apr_file_namedpipe_create(const char *filename, apr_fileperms_t per -apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; @@ -172,7 +172,7 @@ apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t -apr_status_t apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) { if (thepipe->pipe == 1) { *timeout = thepipe->timeout; diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index b2077486b7e..86c474f5adc 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -62,7 +62,7 @@ #include -apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) +APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) { ULONG rc = 0; ULONG bytesread; @@ -144,7 +144,7 @@ apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) -apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) +APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { ULONG rc = 0; ULONG byteswritten; @@ -200,7 +200,7 @@ apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nb #ifdef HAVE_WRITEV -apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) +APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { int bytes; if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { @@ -216,7 +216,7 @@ apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_s -apr_status_t apr_file_putc(char ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile) { ULONG rc; ULONG byteswritten; @@ -236,15 +236,14 @@ apr_status_t apr_file_putc(char ch, apr_file_t *thefile) -apr_status_t apr_file_ungetc(char ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile) { apr_off_t offset = -1; return apr_file_seek(thefile, APR_CUR, &offset); } - -apr_status_t apr_file_getc(char *ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile) { ULONG rc; apr_size_t bytesread; @@ -270,7 +269,7 @@ apr_status_t apr_file_getc(char *ch, apr_file_t *thefile) -apr_status_t apr_file_puts(const char *str, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile) { apr_size_t len; @@ -279,8 +278,7 @@ apr_status_t apr_file_puts(const char *str, apr_file_t *thefile) } - -apr_status_t apr_file_flush(apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) { if (thefile->buffered) { ULONG written = 0; @@ -304,8 +302,7 @@ apr_status_t apr_file_flush(apr_file_t *thefile) } - -apr_status_t apr_file_gets(char *str, int len, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) { size_t readlen; apr_status_t rv = APR_SUCCESS; diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index 1744553fd41..fc51d5ddb80 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -85,7 +85,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) -apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) +APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { if (!thefile->isopen) { return APR_EBADF; @@ -134,7 +134,7 @@ apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_ -apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset) +APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset) { int rc = DosSetFileSize(fp->filedes, offset); diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 070db8e291d..1f2f48df24d 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -105,8 +105,9 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, */ } -apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, - apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, + apr_int32_t wanted, + apr_file_t *thefile) { struct stat info; @@ -121,7 +122,8 @@ apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, } } -apr_status_t apr_file_perms_set(const char *fname, apr_fileperms_t perms) +APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, + apr_fileperms_t perms) { mode_t mode = apr_unix_perms2mode(perms); @@ -130,8 +132,9 @@ apr_status_t apr_file_perms_set(const char *fname, apr_fileperms_t perms) return APR_SUCCESS; } -apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, + const char *fname, + apr_int32_t wanted, apr_pool_t *cont) { struct stat info; int srv; @@ -186,7 +189,7 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, /* Perhaps this becomes nothing but a macro? */ -apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, +APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *cont) { return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, cont); diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c index e656b1baf87..f95df8a61de 100644 --- a/file_io/unix/flock.c +++ b/file_io/unix/flock.c @@ -61,7 +61,7 @@ #include #endif -apr_status_t apr_file_lock(apr_file_t *thefile, int type) +APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) { int rc; @@ -112,7 +112,7 @@ apr_status_t apr_file_lock(apr_file_t *thefile, int type) return APR_SUCCESS; } -apr_status_t apr_file_unlock(apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) { int rc; diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 10156ce62a9..6fee1a7b902 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -82,7 +82,7 @@ apr_status_t apr_unix_file_cleanup(void *thefile) return rv != APR_SUCCESS ? rv : flush_rv; } -apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) { int oflags = 0; #if APR_HAS_THREADS @@ -172,7 +172,7 @@ apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag return APR_SUCCESS; } -apr_status_t apr_file_close(apr_file_t *file) +APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) { apr_status_t rv; @@ -183,7 +183,7 @@ apr_status_t apr_file_close(apr_file_t *file) return rv; } -apr_status_t apr_file_remove(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) { if (unlink(path) == 0) { return APR_SUCCESS; @@ -193,8 +193,8 @@ apr_status_t apr_file_remove(const char *path, apr_pool_t *cont) } } -apr_status_t apr_file_rename(const char *from_path, const char *to_path, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_path, + apr_pool_t *p) { if (rename(from_path, to_path) != 0) { return errno; @@ -202,14 +202,14 @@ apr_status_t apr_file_rename(const char *from_path, const char *to_path, return APR_SUCCESS; } -apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) +APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) { *thefile = file->filedes; return APR_SUCCESS; } -apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, + apr_pool_t *cont) { int *dafile = thefile; @@ -227,7 +227,7 @@ apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, return APR_SUCCESS; } -apr_status_t apr_file_eof(apr_file_t *fptr) +APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) { if (fptr->eof_hit == 1) { return APR_EOF; @@ -235,21 +235,21 @@ apr_status_t apr_file_eof(apr_file_t *fptr) return APR_SUCCESS; } -apr_status_t apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { int fd = STDERR_FILENO; return apr_os_file_put(thefile, &fd, cont); } -apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) { int fd = STDOUT_FILENO; return apr_os_file_put(thefile, &fd, cont); } -apr_status_t apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) { int fd = STDIN_FILENO; diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 7a99b4e3cbd..310ad91dd6b 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -126,7 +126,7 @@ static apr_status_t pipenonblock(apr_file_t *thepipe) return APR_SUCCESS; } -apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; @@ -145,7 +145,7 @@ apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t return APR_EINVAL; } -apr_status_t apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) { if (thepipe->pipe == 1) { *timeout = thepipe->timeout; @@ -154,7 +154,7 @@ apr_status_t apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t return APR_EINVAL; } -apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) { int filedes[2]; @@ -194,8 +194,8 @@ apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t return APR_SUCCESS; } -apr_status_t apr_file_namedpipe_create(const char *filename, - apr_fileperms_t perm, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, + apr_fileperms_t perm, apr_pool_t *cont) { mode_t mode = apr_unix_perms2mode(perm); diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 9f4795a7308..cda958e0b09 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -102,7 +102,7 @@ static apr_status_t wait_for_io_or_timeout(apr_file_t *file, int for_read) /* problems: * 1) ungetchar not used for buffered files */ -apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) +APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) { apr_ssize_t rv; apr_size_t bytes_read; @@ -206,7 +206,7 @@ apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) } } -apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) +APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { apr_size_t rv; @@ -277,8 +277,8 @@ apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nb } } -apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, - apr_size_t nvec, apr_size_t *nbytes) +APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, + apr_size_t nvec, apr_size_t *nbytes) { #ifdef HAVE_WRITEV int bytes; @@ -297,34 +297,34 @@ apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, #endif } -apr_status_t apr_file_putc(char ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile) { apr_size_t nbytes = 1; return apr_file_write(thefile, &ch, &nbytes); } -apr_status_t apr_file_ungetc(char ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile) { thefile->ungetchar = (unsigned char)ch; return APR_SUCCESS; } -apr_status_t apr_file_getc(char *ch, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile) { apr_size_t nbytes = 1; return apr_file_read(thefile, ch, &nbytes); } -apr_status_t apr_file_puts(const char *str, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile) { apr_size_t nbytes = strlen(str); return apr_file_write(thefile, str, &nbytes); } -apr_status_t apr_file_flush(apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) { if (thefile->buffered) { apr_int64_t written = 0; @@ -346,7 +346,7 @@ apr_status_t apr_file_flush(apr_file_t *thefile) return APR_SUCCESS; } -apr_status_t apr_file_gets(char *str, int len, apr_file_t *thefile) +APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) { apr_status_t rv = APR_SUCCESS; /* get rid of gcc warning */ apr_size_t nbytes; diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index c4f4d8bec71..2b58cf9c4b3 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -86,7 +86,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) } -apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) +APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { apr_off_t rv; diff --git a/locks/beos/locks.c b/locks/beos/locks.c index efa44a0ad03..44366474207 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -273,9 +273,9 @@ static apr_status_t _destroy_lock(apr_lock_t *lock) return stat; } -apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, - apr_lockscope_e scope, const char *fname, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, const char *fname, + apr_pool_t *pool) { apr_lock_t *new; apr_status_t stat = APR_SUCCESS; @@ -302,7 +302,7 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, return APR_SUCCESS; } -apr_status_t apr_lock_acquire(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock) { apr_status_t stat; @@ -328,12 +328,12 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_lock_tryacquire(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock) { return APR_ENOTIMPL; } -apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) +APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) { switch (lock->type) { @@ -354,7 +354,7 @@ apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) return APR_SUCCESS; } -apr_status_t apr_lock_release(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock) { apr_status_t stat = APR_SUCCESS; @@ -394,7 +394,7 @@ apr_status_t apr_lock_release(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_lock_destroy(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock) { apr_status_t stat; @@ -411,32 +411,34 @@ apr_status_t apr_lock_destroy(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, const char *fname, + apr_pool_t *pool) { return APR_SUCCESS; } -apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) +APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, + const char *key, void *data) { return apr_pool_userdata_get(data, key, lock->pool); } -apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, - apr_status_t (*cleanup) (void *)) +APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, + void *data, const char *key, + apr_status_t (*cleanup) (void *)) { return apr_pool_userdata_set(data, key, cleanup, lock->pool); } -apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) { oslock->sem = lock->Lock; oslock->ben = lock->LockCount; return APR_SUCCESS; } -apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, + apr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; @@ -450,4 +452,4 @@ apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, return APR_SUCCESS; } - + diff --git a/locks/os2/locks.c b/locks/os2/locks.c index d44c361b976..71f58a9b544 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -71,9 +71,9 @@ static apr_status_t lock_cleanup(void *thelock) -apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, - apr_lockscope_e scope, const char *fname, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, const char *fname, + apr_pool_t *pool) { apr_lock_t *new; ULONG rc; @@ -111,7 +111,7 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, -apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, +APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *pool) { int rc; @@ -160,21 +160,21 @@ static apr_status_t os2_lock_acquire(apr_lock_t *lock, int ms_timeout) -apr_status_t apr_lock_acquire(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock) { return os2_lock_acquire(lock, SEM_INDEFINITE_WAIT); } -apr_status_t apr_lock_tryacquire(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock) { return os2_lock_acquire(lock, SEM_IMMEDIATE_RETURN); } -apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) +APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) { switch (lock->type) { case APR_MUTEX: @@ -191,7 +191,7 @@ apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) return APR_SUCCESS; } -apr_status_t apr_lock_release(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock) { ULONG rc; @@ -212,7 +212,7 @@ apr_status_t apr_lock_release(apr_lock_t *lock) -apr_status_t apr_lock_destroy(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock) { ULONG rc; apr_status_t stat = APR_SUCCESS; @@ -246,7 +246,7 @@ apr_status_t apr_lock_destroy(apr_lock_t *lock) -apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) { *oslock = lock->hMutex; return APR_SUCCESS; @@ -254,8 +254,8 @@ apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) -apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, + apr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; @@ -270,15 +270,15 @@ apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, -apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) +APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) { return apr_pool_userdata_get(data, key, lock->pool); } -apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, - apr_status_t (*cleanup) (void *)) +APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { return apr_pool_userdata_set(data, key, cleanup, lock->pool); } diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 02c519d7342..fe96abea631 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -230,9 +230,9 @@ static apr_status_t create_lock(apr_lock_t *new, apr_lockmech_e_np mech, const c return APR_SUCCESS; } -apr_status_t apr_lock_create_np(apr_lock_t **lock, apr_locktype_e type, - apr_lockscope_e scope, apr_lockmech_e_np mech, - const char *fname, apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_lock_create_np(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, apr_lockmech_e_np mech, + const char *fname, apr_pool_t *pool) { apr_lock_t *new; apr_status_t stat; @@ -253,14 +253,14 @@ apr_status_t apr_lock_create_np(apr_lock_t **lock, apr_locktype_e type, return APR_SUCCESS; } -apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, - apr_lockscope_e scope, const char *fname, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, const char *fname, + apr_pool_t *pool) { return apr_lock_create_np(lock, type, scope, APR_LOCK_DEFAULT, fname, pool); } -apr_status_t apr_lock_acquire(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock) { apr_status_t stat; @@ -283,7 +283,7 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_lock_tryacquire(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock) { apr_status_t stat; @@ -306,7 +306,8 @@ apr_status_t apr_lock_tryacquire(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) +APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock, + apr_readerwriter_e e) { switch (e) { @@ -318,7 +319,7 @@ apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) return APR_ENOTIMPL; } -apr_status_t apr_lock_release(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock) { apr_status_t stat; @@ -342,12 +343,12 @@ apr_status_t apr_lock_release(apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_lock_destroy(apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock) { return lock->meth->destroy(lock); } -apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, +APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *cont) { if ((*lock)->scope != APR_INTRAPROCESS) @@ -355,18 +356,18 @@ apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, return APR_SUCCESS; } -apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) +APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) { return apr_pool_userdata_get(data, key, lock->pool); } -apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, +APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup) (void *)) { return apr_pool_userdata_set(data, key, cleanup, lock->pool); } -apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) +APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) { #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE oslock->crossproc = lock->interproc; @@ -383,8 +384,8 @@ apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) return APR_SUCCESS; } -apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, + apr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; @@ -406,4 +407,4 @@ apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, #endif return APR_SUCCESS; } - + diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index 57665c71a51..abd8ca7fcc5 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -212,7 +212,7 @@ static void get_current_time(apr_uint64_t *timestamp) *timestamp = time_now + fudge; } -void apr_uuid_get(apr_uuid_t *uuid) +APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid) { apr_uint64_t timestamp; unsigned char *d = uuid->data; diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 6f1d773099c..fc0f3950794 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -65,7 +65,8 @@ #define XSTR(x) #x #define STR(x) XSTR(x) -apr_status_t apr_generate_random_bytes(unsigned char * buf, int length) +APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, + int length) { #ifdef DEV_RANDOM diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index d8cbfbc8a98..3cc2e2b7baa 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -67,7 +67,7 @@ * select for R4.5 of BeOS. So here we use code that uses the write * bits. */ -apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num); if ((*new) == NULL) { @@ -90,8 +90,8 @@ apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con return APR_SUCCESS; } -apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t event) +APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t event) { if (event & APR_POLLIN) { FD_SET(sock->socketdes, aprset->read_set); @@ -108,9 +108,9 @@ apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, return APR_SUCCESS; } -apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, - apr_socket_t *sock, - apr_int16_t events) +APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, + apr_socket_t *sock, + apr_int16_t events) { if (events & APR_POLLIN) { FD_CLR(sock->socketdes, aprset->read_set); @@ -124,8 +124,8 @@ apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, return APR_SUCCESS; } -apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, - apr_interval_time_t timeout) +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, + apr_interval_time_t timeout) { int rv; struct timeval tv, *tvptr; @@ -156,7 +156,7 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, return APR_SUCCESS; } -apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { apr_int16_t revents = 0; char data[1]; @@ -200,7 +200,7 @@ apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_po return APR_SUCCESS; } -apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) +APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { FD_CLR(sock->socketdes, aprset->read_set); FD_CLR(sock->socketdes, aprset->except_set); @@ -208,7 +208,7 @@ apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) return APR_SUCCESS; } -apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t event) +APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t event) { if (event & APR_POLLIN) { FD_ZERO(aprset->read_set); @@ -223,13 +223,13 @@ apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t event) return APR_SUCCESS; } -apr_status_t apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) +APR_DECLARE(apr_status_t) apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) { return apr_pool_userdata_get(data, key, pollfd->cntxt); } -apr_status_t apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, - apr_status_t (*cleanup) (void *)) +APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt); } diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 2d584a60200..486148ce40c 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -95,7 +95,7 @@ apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read) #define SEND_WAIT APR_USEC_PER_SEC / 10 -apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { ssize_t rv; @@ -128,7 +128,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) return APR_SUCCESS; } -apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) { apr_ssize_t rv; @@ -160,15 +160,15 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) /* BeOS doesn't have writev for sockets so we use the following instead... */ -apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, - apr_int32_t nvec, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t * sock, const struct iovec *vec, + apr_int32_t nvec, apr_size_t *len) { *len = vec[0].iov_len; return apr_send(sock, vec[0].iov_base, len); } -apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, apr_size_t *len) { ssize_t rv; @@ -200,9 +200,9 @@ apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, return APR_SUCCESS; } -apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, - apr_int32_t flags, char *buf, - apr_size_t *len) +APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, + apr_int32_t flags, char *buf, + apr_size_t *len) { ssize_t rv; diff --git a/network_io/os2/poll.c b/network_io/os2/poll.c index 55e2f01753b..1bc70a09946 100644 --- a/network_io/os2/poll.c +++ b/network_io/os2/poll.c @@ -62,7 +62,7 @@ /* OS/2 doesn't have a poll function, implement using OS/2 style select */ -apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { *new = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t)); @@ -93,8 +93,8 @@ apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con -apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t events) +APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t events) { int i; @@ -124,8 +124,8 @@ apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, -apr_status_t apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, - apr_interval_time_t timeout) +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, + apr_interval_time_t timeout) { int i; int rv = 0; @@ -158,7 +158,7 @@ apr_status_t apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, -apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { int i; @@ -180,8 +180,8 @@ apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_po -apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t events) +APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t events) { int start, *count, pos; @@ -218,14 +218,14 @@ apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, -apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) +APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { return apr_poll_socket_mask(aprset, sock, APR_POLLIN|APR_POLLOUT|APR_POLLPRI); } -apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) +APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) { aprset->num_read = 0; aprset->num_write = 0; @@ -235,15 +235,14 @@ apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) } - -apr_status_t apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) +APR_DECLARE(apr_status_t) apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) { return apr_pool_userdata_get(data, key, pollfd->cntxt); } -apr_status_t apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, +APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup) (void *)) { return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt); diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index e4a8e747497..891fda294e8 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -59,7 +59,7 @@ #include "apr_lib.h" #include -apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { ssize_t rv; int fds, err = 0; @@ -98,7 +98,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) -apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) { ssize_t rv; int fds, err = 0; @@ -137,7 +137,7 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) -apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len) { apr_status_t rv; struct iovec *tmpvec; diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c index 0a86ed369b3..9f2f438f806 100644 --- a/network_io/os2/sendrecv_udp.c +++ b/network_io/os2/sendrecv_udp.c @@ -81,8 +81,8 @@ apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read) -apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, apr_size_t *len) { ssize_t rv; int serrno; @@ -119,9 +119,9 @@ apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, -apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, - apr_int32_t flags, char *buf, - apr_size_t *len) +APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, + apr_int32_t flags, char *buf, + apr_size_t *len) { ssize_t rv; int serrno; diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 94ba176dedf..895b778affd 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -130,8 +130,8 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr->pool = p; } -apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, int type, + apr_pool_t *cont) { int family = ofamily; @@ -172,7 +172,7 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, return APR_SUCCESS; } -apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) +APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { if (shutdown(thesocket->socketdes, how) == 0) { return APR_SUCCESS; @@ -182,16 +182,13 @@ apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) } } -apr_status_t apr_socket_close(apr_socket_t *thesocket) +APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket) { apr_pool_cleanup_kill(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } - - - -apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) +APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) { if (bind(sock->socketdes, (struct sockaddr *)&sa->sa, @@ -203,7 +200,7 @@ apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) } } -apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) +APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return APR_OS2_STATUS(sock_errno()); @@ -211,7 +208,7 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) return APR_SUCCESS; } -apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) +APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { alloc_socket(new, connection_context); set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM); @@ -232,7 +229,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return APR_SUCCESS; } -apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) +APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { if ((connect(sock->socketdes, (struct sockaddr *)&sa->sa.sin, sa->salen) < 0) && @@ -249,30 +246,29 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) } - -apr_status_t apr_socket_data_get(void **data, const char *key, - apr_socket_t *socket) +APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, + apr_socket_t *socket) { return apr_pool_userdata_get(data, key, socket->cntxt); } -apr_status_t apr_socket_data_set(apr_socket_t *socket, void *data, const char *key, - apr_status_t (*cleanup) (void *)) +APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *socket, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { return apr_pool_userdata_set(data, key, cleanup, socket->cntxt); } -apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) +APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->socketdes; return APR_SUCCESS; } -apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, - apr_os_sock_info_t *os_sock_info, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, + apr_os_sock_info_t *os_sock_info, + apr_pool_t *cont) { alloc_socket(apr_sock, cont); set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type); @@ -298,7 +294,7 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, return APR_SUCCESS; } -apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index b9827a50e53..4015852428e 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -67,7 +67,7 @@ #include -apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) +APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { int one; struct linger li; @@ -124,7 +124,7 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o -apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) +APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch(opt) { case APR_SO_TIMEOUT: @@ -138,7 +138,7 @@ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t * -apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { if (gethostname(buf, len) == -1) return APR_OS2_STATUS(sock_errno()); diff --git a/shmem/beos/shmem.c b/shmem/beos/shmem.c index 9c253ba3bd7..abca8be2d83 100644 --- a/shmem/beos/shmem.c +++ b/shmem/beos/shmem.c @@ -205,8 +205,8 @@ static struct block_t *alloc_block(struct shmem_t *m, apr_size_t size) return b; } -apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, + apr_pool_t *p) { apr_size_t pagesize; area_id newid; @@ -232,7 +232,7 @@ apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *fi return APR_SUCCESS; } -apr_status_t apr_shm_destroy(struct shmem_t *m) +APR_DECLARE(apr_status_t) apr_shm_destroy(struct shmem_t *m) { delete_area(m->aid); m->avail = 0; @@ -242,7 +242,7 @@ apr_status_t apr_shm_destroy(struct shmem_t *m) return APR_SUCCESS; } -void *apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize) +APR_DEClARE(void *) apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize) { struct block_t *b; if ((b = alloc_block(m, reqsize)) != NULL) @@ -250,7 +250,7 @@ void *apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize) return NULL; } -void *apr_shm_calloc(struct shmem_t *m, apr_size_t reqsize) +APR_DECLARE(void *) apr_shm_calloc(struct shmem_t *m, apr_size_t reqsize) { struct block_t *b; if ((b = alloc_block(m, reqsize)) != NULL){ @@ -260,24 +260,24 @@ void *apr_shm_calloc(struct shmem_t *m, apr_size_t reqsize) return NULL; } -apr_status_t apr_shm_free(struct shmem_t *m, void *entity) +APR_DECLARE(apr_status_t) apr_shm_free(struct shmem_t *m, void *entity) { free_block(m, entity); return APR_SUCCESS; } -apr_status_t apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) +APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) { *name = NULL; return APR_ANONYMOUS; } -apr_status_t apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) +APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) { return APR_ANONYMOUS; } -apr_status_t apr_shm_open(struct shmem_t *m) +APR_DECLARE(apr_status_t) apr_shm_open(struct shmem_t *m) { /* If we've forked we need a clone of the original area or we * will only have access to a one time copy of the data made when @@ -311,7 +311,7 @@ apr_status_t apr_shm_open(struct shmem_t *m) return APR_SUCCESS; } -apr_status_t apr_shm_avail(struct shmem_t *m, apr_size_t *size) +APR_DECLARE(apr_status_t) apr_shm_avail(struct shmem_t *m, apr_size_t *size) { *size = m->avail; if (m->avail == 0) diff --git a/shmem/os2/shmem.c b/shmem/os2/shmem.c index 4bb279062ba..672081f7cf7 100644 --- a/shmem/os2/shmem.c +++ b/shmem/os2/shmem.c @@ -67,7 +67,7 @@ struct shmem_t { -apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) { int rc; struct shmem_t *newm = (struct shmem_t *)apr_palloc(cont, sizeof(struct shmem_t)); @@ -89,7 +89,7 @@ apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *fi -apr_status_t apr_shm_destroy(struct shmem_t *m) +APR_DECLARE(apr_status_t) apr_shm_destroy(struct shmem_t *m) { _uclose(m->heap); _udestroy(m->heap, _FORCE); @@ -99,21 +99,21 @@ apr_status_t apr_shm_destroy(struct shmem_t *m) -void *apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize) +APR_DECLARE(void *) apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize) { return _umalloc(m->heap, reqsize); } -void *apr_shm_calloc(struct shmem_t *m, apr_size_t size) +APR_DECLARE(void *) apr_shm_calloc(struct shmem_t *m, apr_size_t size) { return _ucalloc(m->heap, size, 1); } -apr_status_t apr_shm_free(struct shmem_t *m, void *entity) +APR_DECLARE(apr_status_t) apr_shm_free(struct shmem_t *m, void *entity) { free(entity); return APR_SUCCESS; @@ -121,7 +121,7 @@ apr_status_t apr_shm_free(struct shmem_t *m, void *entity) -apr_status_t apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) +APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) { *name = NULL; return APR_ANONYMOUS; @@ -129,14 +129,14 @@ apr_status_t apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) -apr_status_t apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) +APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) { return APR_ANONYMOUS; } -apr_status_t apr_shm_open(struct shmem_t *m) +APR_DECLARE(apr_status_t) apr_shm_open(struct shmem_t *m) { int rc; @@ -151,7 +151,7 @@ apr_status_t apr_shm_open(struct shmem_t *m) -apr_status_t apr_shm_avail(struct shmem_t *c, apr_size_t *size) +APR_DECLARE(apr_status_t) apr_shm_avail(struct shmem_t *c, apr_size_t *size) { return APR_ENOTIMPL; diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index a9c5d01f069..825929e9c86 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -61,7 +61,7 @@ struct shmem_t { MM *mm; }; -apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) { MM *newmm = mm_create(reqsize + sizeof(**m), file, MM_ALLOCATE_ENOUGH); if (newmm == NULL) { @@ -78,13 +78,13 @@ apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *fi return APR_SUCCESS; } -apr_status_t apr_shm_destroy(struct shmem_t *m) +APR_DECLARE(apr_status_t) apr_shm_destroy(struct shmem_t *m) { mm_destroy(m->mm); return APR_SUCCESS; } -void *apr_shm_malloc(struct shmem_t *c, apr_size_t reqsize) +APR_DECLARE(void *) apr_shm_malloc(struct shmem_t *c, apr_size_t reqsize) { if (c->mm == NULL) { return NULL; @@ -92,7 +92,7 @@ void *apr_shm_malloc(struct shmem_t *c, apr_size_t reqsize) return mm_malloc(c->mm, reqsize); } -void *apr_shm_calloc(struct shmem_t *shared, apr_size_t size) +APR_DECLARE(void *) apr_shm_calloc(struct shmem_t *shared, apr_size_t size) { if (shared == NULL) { return NULL; @@ -100,13 +100,13 @@ void *apr_shm_calloc(struct shmem_t *shared, apr_size_t size) return mm_calloc(shared->mm, 1, size); } -apr_status_t apr_shm_free(struct shmem_t *shared, void *entity) +APR_DECLARE(apr_status_t) apr_shm_free(struct shmem_t *shared, void *entity) { mm_free(shared->mm, entity); return APR_SUCCESS; } -apr_status_t apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) +APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) { #if APR_USES_ANONYMOUS_SHM *name = NULL; @@ -121,7 +121,7 @@ apr_status_t apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) #endif } -apr_status_t apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) +APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) { #if APR_USES_ANONYMOUS_SHM return APR_ANONYMOUS; @@ -135,7 +135,7 @@ apr_status_t apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) #endif } -apr_status_t apr_shm_open(struct shmem_t *c) +APR_DECLARE(apr_status_t) apr_shm_open(struct shmem_t *c) { #if APR_USES_ANONYMOUS_SHM @@ -153,7 +153,7 @@ apr_status_t apr_shm_open(struct shmem_t *c) #endif } -apr_status_t apr_shm_avail(struct shmem_t *c, apr_size_t *size) +APR_DECLARE(apr_status_t) apr_shm_avail(struct shmem_t *c, apr_size_t *size) { *size = mm_available(c); if (*size == 0) { diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 063b993ec70..99ca78f0b78 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -61,7 +61,7 @@ struct send_pipe { int err; }; -apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); @@ -82,8 +82,8 @@ apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, - apr_int32_t out, apr_int32_t err) +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) { apr_status_t status; if (in != 0) { @@ -146,8 +146,8 @@ apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, return APR_SUCCESS; } -apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, - const char *dir) +APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, + const char *dir) { char * cwd; if (strncmp("/",dir,1) != 0 ) { @@ -166,20 +166,20 @@ apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, return APR_ENOMEM; } -apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, - apr_cmdtype_e cmd) +APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) +APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -201,10 +201,10 @@ apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) } -apr_status_t apr_proc_create(apr_proc_t *new, const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, + const char * const *args, + const char * const *env, + apr_procattr_t *attr, apr_pool_t *cont) { int i=0,nargs=0; char **newargs = NULL; @@ -279,8 +279,8 @@ apr_status_t apr_proc_create(apr_proc_t *new, const char *progname, return APR_SUCCESS; } -apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, - apr_wait_how_e waithow, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p) { int waitpid_options = WUNTRACED; @@ -297,8 +297,8 @@ apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, return errno; } -apr_status_t apr_proc_wait(apr_proc_t *proc, - apr_wait_how_e wait) +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, + apr_wait_how_e wait) { status_t exitval, rv; @@ -321,7 +321,7 @@ apr_status_t apr_proc_wait(apr_proc_t *proc, return APR_CHILD_NOTDONE; } -apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, +APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) @@ -336,8 +336,8 @@ apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_i return APR_SUCCESS; } -apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, - apr_file_t *parent_out) +APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); @@ -351,8 +351,8 @@ apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_ return APR_SUCCESS; } -apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, - apr_file_t *parent_err) +APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); @@ -366,8 +366,8 @@ apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_ return APR_SUCCESS; } -apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, - void *limit) +APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, + void *limit) { return APR_ENOTIMPL; } diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 8ceda143ad0..c37fffec72f 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -55,7 +55,7 @@ #include "threadproc.h" #include "apr_portable.h" -apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { (*new) = (apr_threadattr_t *)apr_palloc(cont, sizeof(apr_threadattr_t)); @@ -70,7 +70,7 @@ apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) +APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) { if (on == 1){ attr->detached = 1; @@ -80,7 +80,7 @@ apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) return APR_SUCCESS; } -apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) +APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) { if (attr->detached == 1){ return APR_DETACH; @@ -94,9 +94,9 @@ static void *dummy_worker(void *opaque) return thd->func(thd, thd->data); } -apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, - apr_thread_start_t func, void *data, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *pool) { int32 temp; apr_status_t stat; @@ -131,7 +131,7 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, } } -apr_os_thread_t apr_os_thread_current(void) +APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) { return find_thread(NULL); } @@ -141,14 +141,14 @@ int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) return tid1 == tid2; } -apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) +APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { apr_pool_destroy(thd->cntxt); exit_thread ((status_t)retval); return APR_SUCCESS; } -apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { if (wait_for_thread(thd->td,(void *)&retval) == B_NO_ERROR) { return APR_SUCCESS; @@ -158,7 +158,7 @@ apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) } } -apr_status_t apr_thread_detach(apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) { if (suspend_thread(thd->td) == B_NO_ERROR){ return APR_SUCCESS; @@ -172,26 +172,26 @@ void apr_thread_yield() { } -apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) +APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { return apr_pool_userdata_get(data, key, thread->cntxt); } -apr_status_t apr_thread_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_thread_t *thread) +APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread) { return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); } -apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { *thethd = &thd->td; return APR_SUCCESS; } -apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index 949d67afa5b..4ca030aa5e4 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -58,8 +58,8 @@ static struct beos_key key_table[BEOS_MAX_DATAKEYS]; static struct beos_private_data *beos_data[BEOS_MAX_DATAKEYS]; static sem_id lock; -apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, - void (*dest)(void *), apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, + void (*dest)(void *), apr_pool_t *cont) { (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); if ((*key) == NULL) { @@ -82,7 +82,7 @@ apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, return APR_ENOMEM; } -apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key) { thread_id tid; int i, index=0; @@ -114,7 +114,7 @@ apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) return APR_SUCCESS; } -apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { thread_id tid; int i,index = 0, ret; @@ -169,7 +169,7 @@ apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) return APR_ENOMEM; } -apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) { if (key->key < BEOS_MAX_DATAKEYS){ acquire_sem(key_table[key->key].lock); @@ -184,27 +184,27 @@ apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) return APR_SUCCESS; } -apr_status_t apr_threadkey_data_get(void **data, const char *key, - apr_threadkey_t *threadkey) +APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, + apr_threadkey_t *threadkey) { return apr_pool_userdata_get(data, key, threadkey->cntxt); } -apr_status_t apr_threadkey_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_threadkey_t *threadkey) +APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey) { return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); } -apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; @@ -215,4 +215,4 @@ apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, } (*key)->key = *thekey; return APR_SUCCESS; -} +} diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 9b406164847..7d3db004aa4 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -72,7 +72,7 @@ #include #include -apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); @@ -93,8 +93,8 @@ apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, - apr_int32_t out, apr_int32_t err) +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) { apr_status_t stat; if (in) { @@ -157,8 +157,8 @@ apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, return APR_SUCCESS; } -apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, - apr_file_t *parent_in) +APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); @@ -173,8 +173,8 @@ apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_i } -apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, - apr_file_t *parent_out) +APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); @@ -189,8 +189,8 @@ apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_ } -apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, - apr_file_t *parent_err) +APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); @@ -205,7 +205,7 @@ apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_ } -apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) +APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { attr->currdir = apr_pstrdup(attr->cntxt, dir); if (attr->currdir) { @@ -214,20 +214,20 @@ apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) return APR_ENOMEM; } -apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, - apr_cmdtype_e cmd) +APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) +APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -278,10 +278,10 @@ static char *double_quotes(apr_pool_t *cntxt, const char *str) -apr_status_t apr_proc_create(apr_proc_t *proc, const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname, + const char * const *args, + const char * const *env, + apr_procattr_t *attr, apr_pool_t *cont) { int i, arg, numargs, cmdlen; apr_status_t status; @@ -495,8 +495,8 @@ apr_status_t apr_proc_create(apr_proc_t *proc, const char *progname, -apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, - apr_wait_how_e waithow, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p) { RESULTCODES codes; ULONG rc; @@ -523,8 +523,8 @@ apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, -apr_status_t apr_proc_wait(apr_proc_t *proc, - apr_wait_how_e wait) +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, + apr_wait_how_e wait) { RESULTCODES codes; ULONG rc; @@ -546,7 +546,7 @@ apr_status_t apr_proc_wait(apr_proc_t *proc, -apr_status_t apr_get_os_proc(apr_os_proc_t *theproc, apr_proc_t *proc) +APR_DECLARE(apr_status_t) apr_get_os_proc(apr_os_proc_t *theproc, apr_proc_t *proc) { if (proc == NULL) { return APR_ENOPROC; @@ -557,7 +557,7 @@ apr_status_t apr_get_os_proc(apr_os_proc_t *theproc, apr_proc_t *proc) -apr_status_t apr_proc_detach() +APR_DECLARE(apr_status_t) apr_proc_detach() { return APR_ENOTIMPL; } diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 0aaa342c57b..9653edf5085 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -62,7 +62,7 @@ #include "fileio.h" #include -apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { (*new) = (apr_threadattr_t *)apr_palloc(cont, sizeof(apr_threadattr_t)); @@ -77,7 +77,7 @@ apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) -apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) +APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) { attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; @@ -85,7 +85,7 @@ apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) -apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) +APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) { return (attr->attr & APR_THREADATTR_DETACHED) ? APR_DETACH : APR_NOTDETACH; } @@ -100,9 +100,9 @@ static void apr_thread_begin(void *arg) -apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, - apr_thread_start_t func, void *data, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont) { apr_status_t stat; apr_thread_t *thread; @@ -144,7 +144,7 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, -apr_os_thread_t apr_os_thread_current() +APR_DECLARE(apr_os_thread_t) apr_os_thread_current() { PIB *ppib; TIB *ptib; @@ -154,7 +154,7 @@ apr_os_thread_t apr_os_thread_current() -apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) +APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { thd->rv = retval; _endthread(); @@ -163,7 +163,7 @@ apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) -apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { ULONG rc; TID waittid = thd->tid; @@ -182,7 +182,7 @@ apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) -apr_status_t apr_thread_detach(apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) { thd->attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; @@ -196,7 +196,7 @@ void apr_thread_yield() -apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { *thethd = &thd->tid; return APR_SUCCESS; @@ -204,8 +204,8 @@ apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) -apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, + apr_pool_t *cont) { if ((*thd) == NULL) { (*thd) = (apr_thread_t *)apr_pcalloc(cont, sizeof(apr_thread_t)); @@ -224,16 +224,16 @@ int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) -apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) +APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { return apr_pool_userdata_get(data, key, thread->cntxt); } -apr_status_t apr_thread_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_thread_t *thread) +APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread) { return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); } diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index 5a93765e4dd..e04dc6a88a5 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -60,8 +60,9 @@ #include "apr_lib.h" #include "fileio.h" -apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, - void (*dest)(void *), apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, + void (*dest)(void *), + apr_pool_t *cont) { (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); @@ -73,44 +74,45 @@ apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, return APR_OS2_STATUS(DosAllocThreadLocalMemory(1, &((*key)->key))); } -apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key) { (*new) = (void *)*(key->key); return APR_SUCCESS; } -apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { *(key->key) = (ULONG)priv; return APR_SUCCESS; } -apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) { return APR_OS2_STATUS(DosFreeThreadLocalMemory(key->key)); } -apr_status_t apr_threadkey_data_get(void **data, const char *key, - apr_threadkey_t *threadkey) +APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, + apr_threadkey_t *threadkey) { return apr_pool_userdata_get(data, key, threadkey->cntxt); } -apr_status_t apr_threadkey_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_threadkey_t *threadkey) +APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey) { return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); } -apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 4c4f74d5450..41f8007c96f 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -57,7 +57,7 @@ #include "apr_portable.h" #include "apr_signal.h" -apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_pcalloc(cont, sizeof(apr_procattr_t)); @@ -69,8 +69,8 @@ apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, - apr_int32_t out, apr_int32_t err) +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) { apr_status_t status; if (in != 0) { @@ -134,8 +134,8 @@ apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, } -apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, - apr_file_t *parent_in) +APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); @@ -150,8 +150,8 @@ apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_i } -apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, - apr_file_t *parent_out) +APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); @@ -166,8 +166,8 @@ apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_ } -apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, - apr_file_t *parent_err) +APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); @@ -182,8 +182,8 @@ apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_ } -apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, - const char *dir) +APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, + const char *dir) { attr->currdir = apr_pstrdup(attr->cntxt, dir); if (attr->currdir) { @@ -192,20 +192,21 @@ apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, return APR_ENOMEM; } -apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, - apr_cmdtype_e cmd) +APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) +APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, + apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -271,10 +272,10 @@ static apr_status_t limit_proc(apr_procattr_t *attr) return APR_SUCCESS; } -apr_status_t apr_proc_create(apr_proc_t *new, const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, + const char * const *args, + const char * const *env, + apr_procattr_t *attr, apr_pool_t *cont) { int i; const char **newargs; @@ -360,8 +361,8 @@ apr_status_t apr_proc_create(apr_proc_t *new, const char *progname, return APR_SUCCESS; } -apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, - apr_wait_how_e waithow, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p) { int waitpid_options = WUNTRACED; @@ -378,8 +379,8 @@ apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, return errno; } -apr_status_t apr_proc_wait(apr_proc_t *proc, - apr_wait_how_e waithow) +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, + apr_wait_how_e waithow) { pid_t status; @@ -401,8 +402,8 @@ apr_status_t apr_proc_wait(apr_proc_t *proc, return errno; } -apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, - struct rlimit *limit) +APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, + struct rlimit *limit) { switch(what) { case APR_LIMIT_CPU: @@ -428,4 +429,4 @@ apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, #endif } return APR_SUCCESS; -} +} diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index 1b797e3aa96..5c1d12fd485 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -54,7 +54,7 @@ #include "threadproc.h" -apr_status_t apr_proc_detach(void) +APR_DECLARE(apr_status_t) apr_proc_detach(void) { int x; pid_t pgrp; diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 41d454307b7..1d905e058b3 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -67,7 +67,7 @@ #include #endif -apr_status_t apr_proc_kill(apr_proc_t *proc, int signum) +APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signum) { #ifdef OS2 /* SIGTERM's don't work too well in OS/2 (only affects other EMX @@ -95,7 +95,7 @@ apr_status_t apr_proc_kill(apr_proc_t *proc, int signum) * from W. Richard Stevens' "Advanced Programming in the UNIX Environment" * (the version that does not automatically restart system calls). */ -apr_sigfunc_t *apr_signal(int signo, apr_sigfunc_t * func) +APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func) { struct sigaction act, oact; diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 73d6b96dd4b..d360543ce28 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -59,7 +59,7 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { apr_status_t stat; @@ -82,7 +82,7 @@ apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) return stat; } -apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) +APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) { apr_status_t stat; #ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR @@ -102,7 +102,7 @@ apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) } } -apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) +APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) { int state; @@ -122,9 +122,9 @@ static void *dummy_worker(void *opaque) return thread->func(thread, thread->data); } -apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, - apr_thread_start_t func, void *data, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont) { apr_status_t stat; pthread_attr_t *temp; @@ -166,24 +166,24 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, } } -apr_os_thread_t apr_os_thread_current(void) +APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) { return pthread_self(); } -int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) +APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) { return pthread_equal(tid1, tid2); } -apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) +APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { apr_pool_destroy(thd->cntxt); pthread_exit(retval); return APR_SUCCESS; } -apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { apr_status_t stat; apr_status_t *thread_stat; @@ -200,7 +200,7 @@ apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) } } -apr_status_t apr_thread_detach(apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) { apr_status_t stat; @@ -223,25 +223,25 @@ void apr_thread_yield() { } -apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) +APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { return apr_pool_userdata_get(data, key, thread->cntxt); } -apr_status_t apr_thread_data_set(void *data, const char *key, +APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) { return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); } -apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { *thethd = thd->td; return APR_SUCCESS; } -apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, +APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont) { if (cont == NULL) { @@ -262,9 +262,9 @@ APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) #if !APR_HAS_THREADS -apr_status_t apr_os_thread_get(void); /* avoid warning for no prototype */ +APR_DECLARE(apr_status_t) apr_os_thread_get(void); /* avoid warning for no prototype */ -apr_status_t apr_os_thread_get(void) +APR_DECLARE(apr_status_t) apr_os_thread_get(void) { return APR_ENOTIMPL; } diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 1799b34f1dc..64e6aa5d002 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -59,8 +59,8 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, - void (*dest)(void *), apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, + void (*dest)(void *), apr_pool_t *cont) { (*key) = (apr_threadkey_t *)apr_pcalloc(cont, sizeof(apr_threadkey_t)); @@ -74,7 +74,7 @@ apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, } -apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key) { #ifdef PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS if (pthread_getspecific(key->key,new)) @@ -85,7 +85,7 @@ apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) return APR_SUCCESS; } -apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { apr_status_t stat; if ((stat = pthread_setspecific(key->key, priv)) == 0) { @@ -97,7 +97,7 @@ apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) } #ifdef HAVE_PTHREAD_KEY_DELETE -apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) { apr_status_t stat; if ((stat = pthread_key_delete(key->key)) == 0) { @@ -107,27 +107,27 @@ apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) } #endif -apr_status_t apr_threadkey_data_get(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { return apr_pool_userdata_get(data, key, threadkey->cntxt); } -apr_status_t apr_threadkey_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_threadkey_t *threadkey) +APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey) { return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); } -apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; @@ -143,9 +143,9 @@ apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, #endif /* APR_HAS_THREADS */ #if !APR_HAS_THREADS -apr_status_t apr_os_threadkey_get(void); /* avoid warning for no prototype */ +APR_DECLARE(apr_status_t) apr_os_threadkey_get(void); /* avoid warning for no prototype */ -apr_status_t apr_os_threadkey_get(void) +APR_DECLARE(apr_status_t) apr_os_threadkey_get(void) { return APR_ENOTIMPL; } diff --git a/time/unix/time.c b/time/unix/time.c index d20f34de07e..5f46b5ff199 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -103,14 +103,15 @@ static apr_int32_t get_offset(struct tm *tm) #endif } -apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input) +APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, + time_t input) { *result = (apr_time_t)input * APR_USEC_PER_SEC; return APR_SUCCESS; } /* NB NB NB NB This returns GMT!!!!!!!!!! */ -apr_time_t apr_time_now(void) +APR_DECLARE(apr_time_t) apr_time_now(void) { #ifdef NETWARE uint64_t usec; @@ -155,7 +156,7 @@ static void explode_time(apr_exploded_time_t *xt, apr_time_t t, xt->tm_gmtoff = get_offset(&tm); } -apr_status_t apr_explode_time(apr_exploded_time_t *result, apr_time_t input, +APR_DECLARE(apr_status_t) apr_explode_time(apr_exploded_time_t *result, apr_time_t input, apr_int32_t offs) { explode_time(result, input, offs, 0); @@ -163,12 +164,12 @@ apr_status_t apr_explode_time(apr_exploded_time_t *result, apr_time_t input, return APR_SUCCESS; } -apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input) +APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input) { return apr_explode_time(result, input, 0); } -apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) +APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) { #if defined(__EMX__) /* EMX gcc (OS/2) has a timezone global we can use */ @@ -179,7 +180,7 @@ apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input #endif /* __EMX__ */ } -apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) +APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) { int year; time_t days; @@ -210,7 +211,7 @@ apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) return APR_SUCCESS; } -apr_status_t apr_implode_gmt(apr_time_t *t, apr_exploded_time_t *xt) +APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, apr_exploded_time_t *xt) { apr_status_t status = apr_implode_time(t, xt); if (status == APR_SUCCESS) @@ -218,15 +219,16 @@ apr_status_t apr_implode_gmt(apr_time_t *t, apr_exploded_time_t *xt) return status; } -apr_status_t apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime) +APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, + apr_time_t *aprtime) { (*ostime)->tv_usec = *aprtime % APR_USEC_PER_SEC; (*ostime)->tv_sec = *aprtime / APR_USEC_PER_SEC; return APR_SUCCESS; } -apr_status_t apr_os_exp_time_get(apr_os_exp_time_t **ostime, - apr_exploded_time_t *aprtime) +APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, + apr_exploded_time_t *aprtime) { (*ostime)->tm_sec = aprtime->tm_sec; (*ostime)->tm_min = aprtime->tm_min; @@ -245,15 +247,15 @@ apr_status_t apr_os_exp_time_get(apr_os_exp_time_t **ostime, return APR_SUCCESS; } -apr_status_t apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, + apr_pool_t *cont) { *aprtime = (*ostime)->tv_sec * APR_USEC_PER_SEC + (*ostime)->tv_usec; return APR_SUCCESS; } -apr_status_t apr_os_exp_time_put(apr_exploded_time_t *aprtime, - apr_os_exp_time_t **ostime, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_exploded_time_t *aprtime, + apr_os_exp_time_t **ostime, apr_pool_t *cont) { aprtime->tm_sec = (*ostime)->tm_sec; aprtime->tm_min = (*ostime)->tm_min; @@ -272,7 +274,7 @@ apr_status_t apr_os_exp_time_put(apr_exploded_time_t *aprtime, return APR_SUCCESS; } -void apr_sleep(apr_interval_time_t t) +APR_DECLARE(void) apr_sleep(apr_interval_time_t t) { #ifdef OS2 DosSleep(t/1000); @@ -287,8 +289,8 @@ void apr_sleep(apr_interval_time_t t) } #ifdef OS2 -apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, - FTIME os2time) +APR_DECLARE(apr_status_t) apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, + FTIME os2time) { struct tm tmpdate; From e9e8f1592576222b2ed343c8feb178089fb3f42e Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 11 Aug 2001 07:32:54 +0000 Subject: [PATCH 2143/7878] It is possible to have pthread.h without having threads enabled. The pthread.h header has more than thread-specific functions in it. Imagine trying to use pthread_mutex_t for the cross-process mutex without having threading enabled. (The configure script won't allow that, but that's coming up next.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62140 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/locks.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index a0a19f8b0e0..ed4fe1f9a71 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -92,12 +92,9 @@ #ifdef HAVE_SYS_MMAN_H #include #endif - -#if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H #include #endif -#endif /* End System Headers */ struct apr_unix_lock_methods_t { From 2c513dcf294fbcb8312c6b7b07f80ba61294db4d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 11 Aug 2001 17:57:11 +0000 Subject: [PATCH 2144/7878] Begin to move the APR documentation to Doxygen. Submitted by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62141 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 23 +++++--- include/apr_file_info.h | 117 ++++++++++++++++++++++++---------------- include/apr_pools.h | 8 ++- 3 files changed, 91 insertions(+), 57 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index bb310d549e5..f6cc6f3f786 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -69,6 +69,11 @@ extern "C" { * @file apr_errno.h * @brief Error Codes */ +/** + * @defgroup APR_Error_Codes Error Codes + * @ingroup APR + * @{ + */ /** * Type for specifying an error or status code. @@ -80,32 +85,33 @@ typedef int apr_status_t; * @param statcode The error code the get a string for. * @param buf A buffer to hold the error string. * @param bufsize Size of the buffer to hold the string. - * @deffunc char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize) */ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); /** + * @def APR_FROM_OS_ERROR(os_err_type syserr) * Fold a platform specific error into an apr_status_t code. + * @return apr_status_t * @param syserr The platform os error code. - * @deffunc apr_status_t APR_FROM_OS_ERROR(os_err_type syserr) - * @tip Warning: macro implementation; the syserr argument may be evaluated + * @warning macro implementation; the syserr argument may be evaluated * multiple times. */ /** + * @def APR_TO_OS_ERROR(apr_status_t statcode) + * @return os_err_type * Fold an apr_status_t code back to the native platform defined error. * @param syserr The apr_status_t folded platform os error code. - * @deffunc os_err_type APR_TO_OS_ERROR(apr_status_t statcode) - * @tip Warning: macro implementation; the statcode argument may be evaluated + * @warning macro implementation; the statcode argument may be evaluated * multiple times. If the statcode was not created by apr_get_os_error * or APR_FROM_OS_ERROR, the results are undefined. */ /** - * Return the last platform error, folded into apr_status_t, on some platforms - * @deffunc apr_status_t apr_get_os_error() - * @tip This retrieves errno, or calls a GetLastError() style function, and + * @def apr_get_os_error() + * @return apr_status_t the last platform error, folded into apr_status_t, on some platforms + * @remark This retrieves errno, or calls a GetLastError() style function, and * folds it with APR_FROM_OS_ERROR. Some platforms (such as OS2) have no * such mechanism, so this call may be unsupported. Some platforms * require the alternate apr_get_netos_error() to retrieve the last @@ -768,6 +774,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #endif /* !def OS2 || WIN32 */ +/** @} */ #ifdef __cplusplus } diff --git a/include/apr_file_info.h b/include/apr_file_info.h index c4debc14b9e..e2a990e3d4e 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -68,37 +68,49 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ - /** + * @file apr_file_info.h + * @brief APR File handling + */ +/** + * @defgroup APR_File_Handle File Handling Functions + * @ingroup APR + * @{ + */ +/* * @package APR File handling */ typedef enum { - APR_NOFILE = 0, /* the file exists, but APR doesn't know its type */ - APR_REG, /* a regular file */ - APR_DIR, /* a directory */ - APR_CHR, /* a character device */ - APR_BLK, /* a block device */ - APR_PIPE, /* a FIFO / pipe */ - APR_LNK, /* a symbolic link */ - APR_SOCK /* a [unix domain] socket */ + APR_NOFILE = 0, /**< the file exists, but APR doesn't know its type */ + APR_REG, /**< a regular file */ + APR_DIR, /**< a directory */ + APR_CHR, /**< a character device */ + APR_BLK, /**< a block device */ + APR_PIPE, /**< a FIFO / pipe */ + APR_LNK, /**< a symbolic link */ + APR_SOCK /**< a [unix domain] socket */ } apr_filetype_e; -/* Permissions flags */ +/** + * @defgroup APR_file_handle_permission File Permissions flags + * @{ + */ -#define APR_UREAD 0x400 -#define APR_UWRITE 0x200 -#define APR_UEXECUTE 0x100 +#define APR_UREAD 0x400 /**< Read by user */ +#define APR_UWRITE 0x200 /**< Write by user */ +#define APR_UEXECUTE 0x100 /**< Execute by user */ -#define APR_GREAD 0x040 -#define APR_GWRITE 0x020 -#define APR_GEXECUTE 0x010 +#define APR_GREAD 0x040 /**< Read by group */ +#define APR_GWRITE 0x020 /**< Write by group */ +#define APR_GEXECUTE 0x010 /**< Execute by group */ -#define APR_WREAD 0x004 -#define APR_WWRITE 0x002 -#define APR_WEXECUTE 0x001 +#define APR_WREAD 0x004 /**< Read by others */ +#define APR_WWRITE 0x002 /**< Write by others */ +#define APR_WEXECUTE 0x001 /**< Execute by others */ -#define APR_OS_DEFAULT 0xFFF +#define APR_OS_DEFAULT 0xFFF /**< use default permissions of Underlying Operating System*/ +/** @} */ /** * Structure for referencing directories. @@ -126,9 +138,13 @@ typedef ino_t apr_ino_t; typedef dev_t apr_dev_t; #endif +/** + * @defgroup APR_File_Info Stat Functions + * @{ + */ typedef struct apr_finfo_t apr_finfo_t; -#define APR_FINFO_LINK 0x00000001 +#define APR_FINFO_LINK 0x00000001 /**< Stat the link not the file itself if it is a link */ #define APR_FINFO_MTIME 0x00000010 #define APR_FINFO_CTIME 0x00000020 #define APR_FINFO_ATIME 0x00000040 @@ -143,15 +159,15 @@ typedef struct apr_finfo_t apr_finfo_t; #define APR_FINFO_UPROT 0x00100000 #define APR_FINFO_GPROT 0x00200000 #define APR_FINFO_WPROT 0x00400000 -#define APR_FINFO_ICASE 0x01000000 /* if dev is case insensitive */ -#define APR_FINFO_NAME 0x02000000 /* ->name in proper case */ +#define APR_FINFO_ICASE 0x01000000 /**< if dev is case insensitive */ +#define APR_FINFO_NAME 0x02000000 /**< ->name in proper case */ -#define APR_FINFO_MIN 0x00008170 /* type, mtime, ctime, atime, size */ -#define APR_FINFO_IDENT 0x00003000 /* dev and inode */ -#define APR_FINFO_OWNER 0x00030000 /* user and group */ -#define APR_FINFO_PROT 0x00700000 /* all protections */ -#define APR_FINFO_NORM 0x0073b170 /* an atomic unix apr_stat() */ -#define APR_FINFO_DIRENT 0x02000000 /* an atomic unix apr_dir_read() */ +#define APR_FINFO_MIN 0x00008170 /**< type, mtime, ctime, atime, size */ +#define APR_FINFO_IDENT 0x00003000 /**< dev and inode */ +#define APR_FINFO_OWNER 0x00030000 /**< user and group */ +#define APR_FINFO_PROT 0x00700000 /**< all protections */ +#define APR_FINFO_NORM 0x0073b170 /**< an atomic unix apr_stat() */ +#define APR_FINFO_DIRENT 0x02000000 /**< an atomic unix apr_dir_read() */ /** * The file information structure. This is analogous to the POSIX @@ -205,7 +221,6 @@ struct apr_finfo_t { * @param fname The name of the file to stat. * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values * @param cont the pool to use to allocate the new file. - * @deffunc apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *cont); @@ -219,19 +234,22 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * @param fname The name of the file to stat. * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values * @param cont the pool to use to allocate the new file. - * @deffunc apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *cont) - * @tip This function is depreciated, it's equivilant to calling apr_stat with + * @deprecated This function is depreciated, it's equivilant to calling apr_stat with * the wanted flag value APR_FINFO_LINK */ APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *cont); +/** @} */ +/** + * @defgroup APR_DIRECTORY Directory Manipulation Functions + * @{ + */ /** * Open the specified directory. * @param new_dir The opened directory descriptor. * @param dirname The full path to the directory (use / on all systems) * @param cont The pool to use. - * @deffunc apr_status_t apr_dir_open(apr_dir_t **new_dir, const char *dirname, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir, const char *dirname, @@ -240,7 +258,6 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir, /** * close the specified directory. * @param thedir the directory descriptor to close. - * @deffunc apr_status_t apr_dir_close(apr_dir_t *thedir) */ APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir); @@ -249,8 +266,7 @@ APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir); * @param finfo the file info structure and filled in by apr_dir_read * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values * @param thedir the directory descriptor returned from apr_dir_open - * @tip All systems return . and .. as the first two files. - * @deffunc apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_dir_t *thedir) + * @remark All systems return . and .. as the first two files. */ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_dir_t *thedir); @@ -258,42 +274,45 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, /** * Rewind the directory to the first entry. * @param thedir the directory descriptor to rewind. - * @deffunc apr_status_t apr_dir_rewind(apr_dir_t *thedir) */ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); +/** @} */ -/* apr_filepath optional flags +/** + * @defgroup apr_filepath FilePath Manipulation operations + * @{ */ -/* Cause apr_filepath_merge to fail if addpath is above rootpath */ +/** Cause apr_filepath_merge to fail if addpath is above rootpath */ #define APR_FILEPATH_NOTABOVEROOT 0x01 -/* internal: Only meaningful with APR_FILEPATH_NOTABOVEROOT */ +/** internal: Only meaningful with APR_FILEPATH_NOTABOVEROOT */ #define APR_FILEPATH_SECUREROOTTEST 0x02 -/* Cause apr_filepath_merge to fail if addpath is above rootpath, +/** Cause apr_filepath_merge to fail if addpath is above rootpath, * even given a rootpath /foo/bar and an addpath ../bar/bash */ #define APR_FILEPATH_SECUREROOT 0x03 -/* Fail apr_filepath_merge if the merged path is relative */ +/** Fail apr_filepath_merge if the merged path is relative */ #define APR_FILEPATH_NOTRELATIVE 0x04 -/* Fail apr_filepath_merge if the merged path is absolute */ +/** Fail apr_filepath_merge if the merged path is absolute */ #define APR_FILEPATH_NOTABSOLUTE 0x08 -/* Return the file system's native path format (e.g. path delimiters +/** Return the file system's native path format (e.g. path delimiters * of ':' on MacOS9, '\' on Win32, etc.) */ #define APR_FILEPATH_NATIVE 0x10 -/* Resolve the true case of existing directories and file elements +/** Resolve the true case of existing directories and file elements * of addpath, (resolving any aliases on Win32) and append a proper * trailing slash if a directory */ #define APR_FILEPATH_TRUENAME 0x20 - +/** @} */ /** * Extract the rootpath from the given filepath + * @ingroup apr_filepath * @param rootpath the root file path returned with APR_SUCCESS or APR_EINCOMPLETE * @param filepath the pathname to parse for it's root component * @param flags the desired rules to apply, from @@ -303,7 +322,7 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); * * @param p the pool to allocate the new path string from * @deffunc apr_status_t apr_filepath_root(const char **rootpath, const char **inpath, apr_int32_t flags, apr_pool_t *p) - * @tip on return, filepath points to the first non-root character in the + * @remark on return, filepath points to the first non-root character in the * given filepath. In the simplest example, given a filepath of "/foo", * returns the rootpath of "/" and filepath points at "foo". This is far * more complex on other platforms, which will canonicalize the root form @@ -323,6 +342,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, /** * Merge additional file path onto the previously processed rootpath + * @ingroup apr_filepath * @param newpath the merged paths returned * @param rootpath the root file path (NULL uses the current working path) * @param addpath the path to add to the root path @@ -338,6 +358,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /** * Return the default file path (for relative file names) + * @ingroup apr_filepath * @param path the default path string returned * @param p the pool to allocate the default path string from * @deffunc apr_status_t apr_filepath_get(char **path, apr_pool_t *p) @@ -346,12 +367,14 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **path, apr_pool_t *p); /** * Set the default file path (for relative file names) + * @ingroup apr_filepath * @param path the default path returned * @param p the pool to allocate any working storage * @deffunc apr_status_t apr_filepath_get(char **defpath, apr_pool_t *p) */ APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p); +/** @} */ #ifdef __cplusplus } diff --git a/include/apr_pools.h b/include/apr_pools.h index ae2d67b1fbe..1adfa5303a2 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -79,7 +79,11 @@ extern "C" { * we can delete everything in the per-transaction apr_pool_t without fear, * and without thinking too hard about it either. */ - +/** + * @defgroup APR_Pool Pool Allocation Functions + * @ingroup APR + * @{ + */ #include "apr.h" #include "apr_errno.h" @@ -489,7 +493,7 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); #define apr_pool_destroy apr_sms_destroy #endif /* APR_POOLS_ARE_SMS */ - +/** @} */ #ifdef __cplusplus } #endif From 1203c9940989c13b862e0ca40ee691db487d9d8b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 12 Aug 2001 04:31:52 +0000 Subject: [PATCH 2145/7878] These two pool functions were declared twice in apr_pools.h. This brings us back down to just declaring them once. Submitted by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62142 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 1adfa5303a2..2affa3a7898 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -344,22 +344,6 @@ APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **p, apr_pool_t *pparent, int (*apr_abort)(int retcode)); -#if defined(APR_POOL_DEBUG) || defined(DOXYGEN) -/** - * Report the number of bytes currently in the pool - * @param p The pool to inspect - * @param recurse Recurse/include the subpools' sizes - * @return The number of bytes - */ -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse); - -/** - * Report the number of bytes currently in the list of free blocks - * @return The number of bytes - */ -APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void); -#endif - /** * Register a function to be called when a pool is cleared or destroyed * @param p The pool register the cleanup with From 98530cd8d1a45b4c76219fb67c6c58080fbd4966 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 12 Aug 2001 04:39:14 +0000 Subject: [PATCH 2146/7878] First pass at making apr_portable.h use doxygen. Submitted by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62143 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 8330a4fc5af..e0d8e3b8172 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -58,9 +58,14 @@ */ #ifndef APR_PORTABLE_H #define APR_PORTABLE_H - +/* + * @file apr_portable.h + * @brief APR Portability Routines + */ /** - * @package APR portability Routines + * @defgroup APR_portability Portability Routines + * @ingroup APR + * @{ */ #include "apr.h" @@ -201,16 +206,20 @@ typedef void * apr_os_dso_handle_t; #endif +/** + * @typedef apr_os_sock_t + * @brief alias for local OS socket + */ /** * everything APR needs to know about an active socket to construct * an APR socket from it; currently, this is platform-independent */ struct apr_os_sock_info_t { - apr_os_sock_t *os_sock; /* always required */ - struct sockaddr *local; /* NULL if not yet bound */ - struct sockaddr *remote; /* NULL if not connected */ - int family; /* always required (APR_INET, APR_INET6, etc. */ - int type; /* always required (SOCK_STREAM, SOCK_DGRAM, etc. */ + apr_os_sock_t *os_sock; /**< always required */ + struct sockaddr *local; /**< NULL if not yet bound */ + struct sockaddr *remote; /**< NULL if not connected */ + int family; /**< always required (APR_INET, APR_INET6, etc. */ + int type; /**< always required (SOCK_STREAM, SOCK_DGRAM, etc. */ }; typedef struct apr_os_sock_info_t apr_os_sock_info_t; @@ -461,4 +470,6 @@ APR_DECLARE(apr_status_t) apr_sms_thread_unregister(apr_sms_t *sms, } #endif +/** @} */ + #endif /* ! APR_PORTABLE_H */ From fec2978ee7264fd91de47afa7b39b790a1613ff5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 12 Aug 2001 05:10:28 +0000 Subject: [PATCH 2147/7878] Add doxygen work for SMS code. Submitted by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62144 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 17 ++++++++++++- memory/unix/sms_private.h | 51 ++++++++++++++++++++++++--------------- 2 files changed, 47 insertions(+), 21 deletions(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index 098b04b7298..e33407896f5 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -60,9 +60,24 @@ * May 2001 */ +/** + * @file apr_sms.h + * @brief APR SMS Memory routines + */ +/** + * @defgroup SMS SMS Shared Memory allocation system + * @ingroup APR + * @{ + */ + #ifndef APR_SMS_H #define APR_SMS_H +/** + * @typedef apr_sms_t + * @brief holds the internal details required to implement a SMS + * @see sms_private.h + */ typedef struct apr_sms_t apr_sms_t; #include "apr.h" @@ -419,6 +434,6 @@ APR_DECLARE(void) apr_sms_dump_stats(apr_sms_t *sms); #ifdef __cplusplus } #endif - +/** @} */ #endif /* !APR_SMS_H */ diff --git a/memory/unix/sms_private.h b/memory/unix/sms_private.h index 9b4791fcdb9..4adee8c1e1d 100644 --- a/memory/unix/sms_private.h +++ b/memory/unix/sms_private.h @@ -51,7 +51,17 @@ * information on the Apache Software Foundation, please see * . */ - +/** + * @file sms_private.h + * @brief SMS private definitions/routines + * @internal + */ +/** + * + * @defgroup SMS_Private Private routines + * @ingroup SMS + * @{ + */ #ifndef SMS_PRIVATE_H #define SMS_PRIVATE_H @@ -66,33 +76,35 @@ extern "C" { #endif /** - * The memory system structure + * @struct apr_sms_t + * @brief The SMS memory system structure */ struct apr_sms_t { - apr_sms_t *parent; - apr_sms_t *child; - apr_sms_t *sibling; + apr_sms_t *parent; /**< parent of the current SMS */ + apr_sms_t *child; /**< children of the current SMS */ + apr_sms_t *sibling; /**< next SMS at the same level */ apr_sms_t **ref; apr_sms_t *accounting; - const char *identity; /* a string identifying the module */ + const char *identity; /**< a string identifying the module */ apr_pool_t *pool; apr_lock_t *sms_lock; struct apr_sms_cleanup *cleanups; - void * (*malloc_fn) (apr_sms_t *sms, apr_size_t size); - void * (*calloc_fn) (apr_sms_t *sms, apr_size_t size); - void * (*realloc_fn) (apr_sms_t *sms, void *memory, - apr_size_t size); - apr_status_t (*free_fn) (apr_sms_t *sms, void *memory); - apr_status_t (*reset_fn) (apr_sms_t *sms); - apr_status_t (*pre_destroy_fn) (apr_sms_t *sms); - apr_status_t (*destroy_fn) (apr_sms_t *sms); - apr_status_t (*lock_fn) (apr_sms_t *sms); - apr_status_t (*unlock_fn) (apr_sms_t *sms); + void * (*malloc_fn) (apr_sms_t *sms, apr_size_t size); /**< malloc fn for this SMS */ + void * (*calloc_fn) (apr_sms_t *sms, apr_size_t size); /**< calloc fn for this SMS */ + void * (*realloc_fn) (apr_sms_t *sms, void *memory, + apr_size_t size); /**< realloc fn for this SMS */ + apr_status_t (*free_fn) (apr_sms_t *sms, void *memory); /**< free fn */ + apr_status_t (*reset_fn) (apr_sms_t *sms); /**< reset fn */ + apr_status_t (*pre_destroy_fn) (apr_sms_t *sms); /**< called before destroying memory */ + apr_status_t (*destroy_fn) (apr_sms_t *sms); /**< function to destory +the SMS */ + apr_status_t (*lock_fn) (apr_sms_t *sms); /**< locking function */ + apr_status_t (*unlock_fn) (apr_sms_t *sms); /**< unlocking function */ apr_status_t (*apr_abort)(int retcode); struct apr_hash_t *prog_data; @@ -120,14 +132,12 @@ struct apr_sms_t /** * Initialize a memory system - * @caution Call this function as soon as you have obtained a block of memory + * @warning Call this function as soon as you have obtained a block of memory * to serve as a memory system structure from your * apr_xxx_sms_create. Only use this function when you are * implementing a memory system. * @param sms The memory system created * @param parent_sms The parent memory system - * @deffunc apr_status_t apr_sms_init(apr_sms_t *sms, - * apr_sms_t *parent_sms) */ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, apr_sms_t *parent_sms); @@ -136,6 +146,7 @@ APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, * Do post init work that needs the sms to have been fully * initialised. * @param sms The memory system to use + * @return apr_status_t */ APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms); @@ -143,6 +154,6 @@ APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms); #ifdef __cplusplus } #endif - +/** @} */ #endif /* !SMS_PRIVATE_H */ From dcad04f5391cd0ecb80243e201c9e1952079f2c6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 12 Aug 2001 05:13:20 +0000 Subject: [PATCH 2148/7878] Setup APR to use doxygen instead of ScanDoc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62145 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 6 +- build/rules.mk.in | 1 - build/scandoc.pl | 1339 ------------------------------------- build/scandoc_template.pl | 518 -------------- docs/doxygen.conf | 19 + 5 files changed, 21 insertions(+), 1862 deletions(-) delete mode 100755 build/scandoc.pl delete mode 100644 build/scandoc_template.pl create mode 100644 docs/doxygen.conf diff --git a/Makefile.in b/Makefile.in index 48795379703..5f06ffb7af7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -34,8 +34,6 @@ DISTCLEAN_TARGETS = config.cache config.log config.status \ APRVARS libtool EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in -SCANDOC_TEMPLATE = -i$(apr_builders)/scandoc_template.pl - prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ @@ -84,8 +82,8 @@ delete-exports: $(TARGET_EXPORTS): $(MKEXPORT) include/*.h > $@ -docs: - $(SCANDOC) $(SCANDOC_TEMPLATE) -p./docs/ $(INCDIR)/*.h +dox: + doxygen docs/doxygen.conf test: $(TARGET_LIB) (cd test; make clean; make; \ diff --git a/build/rules.mk.in b/build/rules.mk.in index a241da65886..2942dddca5e 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -121,7 +121,6 @@ LINK = @link@ MKEXPORT = $(AWK) -f $(apr_builders)/make_export.awk MKDEP = $(apr_builders)/mkdep.sh -SCANDOC = $(apr_builders)/scandoc.pl # # Standard build rules diff --git a/build/scandoc.pl b/build/scandoc.pl deleted file mode 100755 index 13043a30660..00000000000 --- a/build/scandoc.pl +++ /dev/null @@ -1,1339 +0,0 @@ -#!/usr/bin/perl -# -# ScanDoc - Version 0.12, A C/C++ Embedded Documentation Analyser -# ---------------------------------------------------------------- -# -# Distributed under the "Artistic License". See the file -# "COPYING" that accompanies the ScanDoc distribution. -# -# See http://scandoc.sourceforge.net/ for more information and -# complete documentation. -# -# (c) 1997 - 2000 Talin and others. - -require "ctime.pl"; -require "getopts.pl"; - -# 1 = on (verbose); 0 = off -$debug = 0; - -# Get the current date -$date = &ctime(time); - -# Set the default tab size -$tabSize = 4; - -$minorVersion = 12; -$majorVersion = 0; -$scandocURL = "http://scandoc.sourceforge.net/"; - -# Set up default templates -&Getopts( 'i:d:p:t:' ); - -if ($#ARGV < 0) { - die "Usage: -i -p -t -d= [ ... ]\n"; -} - -# Read the template -if (!defined $opt_i) { - $opt_i = "default.pl"; -} -&readTemplate( $opt_i ); - -# Set the destination path. -$destPath = ""; -$destPath = $opt_p if (defined($opt_p)); - -# Set the tab size. -$tabSize = $opt_t if (defined($opt_t)); - -# Handle defines -if ($opt_d) { - foreach $def (split( /,/, $opt_d )) { - if ($def =~ /\s*(\w*)\=(.*)/) { - $${1} = $2; - } - else { - $${1} = 1; - } - } -} - -# For each input filename, parse it -while ($srcfile = shift(@ARGV)) { - - $linenumber = 0; - open( FILE, $srcfile ) || die "Can't open file $srcfile\n"; - print STDERR "Reading \"$srcfile\"\n"; - - $docTag = 'description'; - $docEmpty = 1; - $packageName = '.general'; - $author = ''; - $version = ''; - $class = 0; - $_ = ''; - - while (&parseDeclaration( '' )) {} -} - -# Collate subclasses and associate with class record. -foreach $className (keys %subclasses) { - my $class = &classRecord( $className ); - - if ($class) { - my @subs = (); - # print STDERR "$className ", join( ',', @{$subclasses{ $className }} ), "\n"; - foreach $subName ($subclasses{ $className }) { - if (&classRecord( $subName )) { - push @subs, $subName; - } - $class->{ 'subs' } = @subs; - } - } -} - -# Turn packages into objects. Special case for "default" package. -foreach $pkg (keys %packages) -{ - # print STDERR $pkg, "\n"; - bless $packages{ $pkg }, PackageRecord; - if ($pkg eq '.general') { - $packages{ $pkg }{ 'name' } = "General"; - } - else { - $packages{ $pkg }{ 'name' } = $pkg; - } - # print STDERR $packages{ $pkg }->Classes(), "\n"; -} - -# Execute template file -# print STDERR $docTemplate; # For debugging -eval $docTemplate; -print STDERR $@; - -exit; - -# ======================= Subroutines ================================ - -# Read a line of input, and remove blank lines and preprocessor directives. -sub rdln { - my ($skip_next_line) = 0; - if (defined ($_)) { - my ($previous_line) = $_; - while ( (/^(\s*|\#.*)$/ || $skip_next_line ) && ($_ = )) { - if ($previous_line =~ m/\\\s*/) { $skip_next_line = 1; } - else { $skip_next_line = 0; } - $previous_line = $_; - $linenumber++; - if ($debug) { print STDERR "(0:$srcfile) $linenumber.\n"; } - } - } - # Dispose of Apache specific macros - removeApacheMacros(); -} - -# Don't skip "#" -sub rdln2 { - if (defined ($_)) { - while (/^(\s*)$/ && ($_ = )) {$linenumber++; if ($debug) { print STDERR "(0:$srcfile) $linenumber.\n"; } } - } -} - -# Remove comments from current line -sub removeComment { - s|//.*||; -} - -# parsing functions -sub matchKW { &rdln; return (s/^\s*($_[0])//, $1) if defined ($_); return (0, 0); } -#sub matchStruct { &rdln; return (s/^\s*(struct|class)//, $1) if defined ($_); return (0, 0); } -#sub matchPermission { &rdln; return (s/^\s*(public|private|protected)// && $1) if defined ($_); return (0,0); } -sub matchID { &rdln; return (s/^\s*([A-Za-z_]\w*)//, $1) if defined ($_); return (0,0); } -sub matchColon { &rdln; return (s/^\s*\://) if defined ($_); return 0; } -sub matchComma { &rdln; return (s/^\s*\,//) if defined ($_); return 0; } -sub matchSemi { &rdln; return (s/^\s*\;//) if defined ($_); return 0; } -sub matchRBracket { &rdln; return (s/^\s*\{//) if defined ($_); return 0; } -sub matchLBracket { &rdln; return (s/^\s*\}//) if defined ($_); return 0; } -sub matchRParen { &rdln; return (s/^\s*\(//) if defined ($_); return 0; } -sub matchLParen { &rdln; return (s/^\s*\)//) if defined ($_); return 0; } -sub matchRAngle { &rdln; return (s/^\s*\//) if defined ($_); return 0; } -sub matchDecl { &rdln; return (s/^(\s*[\s\w\*\[\]\~\&\n\:]+)//, $1) if defined ($_); return (0, 0); } -sub matchOper { &rdln; return (s/^\s*([\~\&\^\>\<\=\!\%\*\+\-\/\|\w]*)// && $1) if defined ($_); return 0; } -sub matchFuncOper { &rdln; return (s/^\s*(\(\))// && $1) if defined ($_); return 0; } -sub matchAny { &rdln; return (s/^\s*(\S+)//, $1) if defined ($_); return (0, 0); } -sub matchChar { &rdln; return (s/^(.)//, $1) if defined ($_); return (0, 0); } -sub matchChar2 { &rdln2; return (s/^(.)//, $1) if defined ($_); return (0, 0); } -sub matchString { &rdln; return (s/^\"(([^\\\"]|(\\.)))*\"//, $1) if defined ($_); return (0, 0); } - -# Skip to next semicolon -sub skipToSemi { - - while (!&matchSemi) { - - &rdln; - s|//.*||; # Eat comments - if (&matchLBracket) { - &skipBody; - next; - } - last if !s/^\s*([^\s\{\;]+)//; - # print STDERR "$1 "; - } -} - -# Skip function body -sub skipBody { - local( $nest ); - - $nest = 1; - - for (;;) { - if (&matchRBracket) { $nest++; } - elsif (&matchLBracket) { - $nest--; - last if !$nest; - } - else { - last if ((($valid,) = &matchKW( "[^\{\}]")) && !$valid); - } - } -} - -# Skip a string. (multiline) -sub skipString { - local( $char, $lastchar); - $lastchar = "\""; - - for (;;) { - ($valid, $char) = &matchChar2; - if (($char eq "\"") && ($lastchar ne "\\")) { last; } - if ($lastchar eq "\\") { $lastchar = " "; } - else { $lastchar = $char; } - } -} - - -# Skip everything in parenthesis. -sub skipParenBody { - local( $nest ); - - $nest = 1; - - for (;;) { - if (&matchRParen) { $nest++; } - elsif (&matchLParen) { - $nest--; - last if !$nest; - } - else { - last if ((($valid,) = &matchKW( "[^\(\)]")) && !$valid); - } - } -} - -# Parse (*name) syntax -sub parseParenPointer { - if (s/^(\s*\(\s*\*)//) { - $decl .= $1; - $nest = 1; - - for (;;) { - # Preserve spaces, eliminate in-line comments - &removeComment; - while (s/^(\s+)//) { $decl .= $1; &rdln; } - - if (&matchRParen) { $nest++; $decl .= "("; } - elsif (&matchLParen) { - $decl .= ")"; - $nest--; - last if !$nest; - } - elsif ((($valid, $d) = &matchKW( "[^\(\)]*")) && $valid) { $decl .= $d; } - else { last; } - } - - # Just in case there are array braces afterwards. - while ((($valid, $d) = &matchDecl) && $valid) { $decl .= $d; } - } -} - -# Parse template arguments -sub matchAngleArgs { - - if (&matchRAngle) { - local ($args, $nest); - - $args = "<"; - $nest = 1; - - for (;;) { - if (&matchRAngle) { $nest++; $args .= "<"; } - elsif (&matchLAngle) { - $nest--; - $args .= ">"; - last if !$nest; - } - elsif ((($valid, $d) = &matchChar) && $valid) { $args .= $d; } - else { last; } - } - return $args; - } - else { return ''; } -} - -# convert tabs to spaces -sub expandTabs { - local ($text) = @_; - local ($n); - - while (($n = index($text,"\t")) >= 0) { - substr($text, $n, 1) = " " x ($tabSize-($n % $tabSize)); - } - - return $text; -} - -# Process a line of text from a "special" comment -sub handleCommentLine { - local ($_) = @_; - - if ($docEmpty) { - # Eliminate blank lines at the head of the doc. - return if (/^\s*$/); - } - - # First, expand tabs. - $_ = &expandTabs( $_ ); - - # Remove gratuitous \s*\s (james) - s/(^|\n)\s*\*\s/$1/g; - - # If it's one of the standard tags - if (s/^\s*\@(see|package|version|author|param|return|result|exception|keywords|deffunc|defvar|heading|todo)\s*//) { - my $tag = $1; - $tag = 'return' if ($tag eq 'result'); - - # for param and exception, split the param name and the text - # seperate them with tabs. - if ($tag eq "param" || $tag eq "exception") { - s/^\s*(\w+)\s*(.*)/\t$1\t$2/; - } - elsif ($tag eq "heading") { - # 'heading' is processed by the template, if at all. - $_ = "\@heading\t$_"; - $tag = "description"; - } - elsif ($tag eq 'todo') { - if ($todolist{ $srcfile } ne '') { - $todolist{ $srcfile } .= "\n"; - } - } - - # If it's @deffunc or @defvar - if ($tag =~ /def(.*)/) { - - $type = $1; - - # @deffunc and @defvar force a comment to be written out as if there was a - # declaration. - # Designed for use with macros and other constructs I can't parse. - - if (/(\S+)\s+(.*)$/) { - $name = $1; - $decl = $2; - $dbname = &uniqueName( "$baseScope$name" ); - - my $entry = { 'type' => $type, - 'name' => $name, - 'longname'=> $name, - 'fullname'=> "$name $decl", - 'scopename'=>"$baseScope$name", - 'uname' => $dbname, - 'decl' => $decl, - 'package' => $packageName }; - - bless $entry, MemberRecord; - - if ($class) { - $entry->{ 'class' } = "$context"; - $class->{ 'members' }{ $dbname } = $entry; - } - else { - $packages{ $packageName }{ 'globals' }{ $dbname } = $entry; - } - $docTag = 'description'; - &dumpComments( $entry ); - return; - } - } - elsif ($tag eq 'package') { - s/^\s*//; - s/\s*$//; - $packageName = $_; - $docTag = 'description'; - return; - } - elsif ($tag eq 'author') { - $author = $_; - $docTag = 'description'; - return; - } - elsif ($tag eq 'version') { - $version = $_; - $docTag = 'description'; - return; - } - - $docTag = $tag; - } - elsif (/^\s*@\w+/) { - # any other line that begins with an @ should be inserted into the main - # description for later expansion. - $docTag = 'description'; - } - - # "To-do" lists are handled specially, and not associated with a class. - if ($docTag eq 'todo') { - $todolist{ $srcfile } .= $_; - return; - } - - # Append to current doc tag, regardless of whether it's a new line - # or a continuation. Also mark this doc as non-empty. - $docTags{ $docTag } .= $_; - $docEmpty = 0; - - # @see doesn't persist. - if ($docTag eq 'see') { $docTag = 'description'; } - - # print STDERR ":$_"; -} - -# Clear doc tag information at end of class or file -sub clearComments { - - $docTag = 'description'; - $docEmpty = 1; - %docTags = (); -} - -# Add doc tag information to current documented item -sub dumpComments { - local ($hashref) = @_; - - if ($docEmpty == 0) { - - if ($author ne '') { $hashref->{ 'author' } = $author; } - if ($version ne '') { $hashref->{ 'version' } = $version; } - $hashref->{ 'sourcefile' } = $srcfile; - - # Store the tags for this documentation into the global doc symbol table - foreach $key (keys %docTags) { - my $data = $docTags{ $key }; - - $data =~ s/\s*$//; - - $hashref->{ $key } = $data; - } - } - - &clearComments(); -} - -# Generate a unique name from the given name. -sub uniqueName { - local ($name) = @_; - - # Duplicate doc entries need to be distinguished, so give them a different label. - while ($docs{ $name }) { - if ($name =~ /-(\d+)$/) { - $name = $` . "-" . ($1 + 1); - } - else { $name .= "-2"; } - } - - $docs{ $name } = 1; - return $name; -} - -# Get the current class record. -sub classRecord { - local ($className) = @_; - local ($pkg) = $classToPackage{ $className }; - - if ($pkg) { - return $packages{ $pkg }{ 'classes' }{ $className }; - } - return 0; -} - -# Parse a declaration in the file -sub parseDeclaration { - - local ($context) = @_; - local ($baseScope) = ''; - local ($decl); - my ($token); - - if ($context) { $baseScope = $context . "::"; } - - &rdln; - - if (!defined ($_)) { return 0; } - - if (s|^\s*//\*\s+||) { - # Special C++ comment - &handleCommentLine( $' ); - $_ = ''; &rdln; - } - elsif (s|^\s*//||) { - # Ordinary C++ comment - $_ = ''; - &rdln; - } - elsif (s|^\s*\/\*\*\s+||) { - # Special C comments - - s/\={3,}|\-{3,}|\*{3,}//; # Eliminate banner strips - $text = ''; - $docTag = 'description'; - - # Special comment - while (!/\*\//) { &handleCommentLine( $_ ); $text .= $_; $_ = ; $linenumber++; if ($debug) { print STDERR "(1) $linenumber\n."; }} - s/\={3,}|\-{3,}|\*{3,}//; # Eliminate banner strips - /\*\//; - &handleCommentLine( $` ); - $text.= $`; $_ = $'; - } - elsif (s|^\s*\/\*||) { - # Ordinary C comment - $text = ""; - - while (!/\*\//) { $text .= $_; $_ = ; $linenumber++; if ($debug) { print STDERR "(2) $linenumber\n."; }} - /\*\//; - $text.= $`; $_ = $'; - } - elsif ((($valid, $tag) = &matchKW( "template")) && $valid) { - # Template definition - $args = &matchAngleArgs; - &rdln; - - ##$tmplParams = $args; JAMES - $result = &parseDeclaration( $context ); - ##$tmplParams = ''; JAMES - return $result; - } - elsif ((($valid, $tag) = &matchKW("class|struct")) && $valid) { - # Class or structure definition - local ($className,$class); - - if ((($valid, $className) = &matchID) && $valid) { - - return 1 if (&matchSemi); # Only a struct tag - - # A class instance - if ((($valid,)=&matchID) && $valid) { - &matchSemi; - return 1; - } - - my $fullName = "$baseScope$className"; ##$tmplParams"; JAMES - # print STDERR "CLASS $fullName\n"; - - my @bases = (); - - if (&matchColon) { - - for (;;) { - my $p; - &matchKW( "virtual" ); - $perm = "private"; - if ((($valid, $p) = &matchKW( "public|private|protected" )) && $valid) { $perm = $p; } - &matchKW( "virtual" ); - - last if !( (($valid, $base) = &matchID) && $valid ); - - push @bases, $base; - push @{ $subclasses{ $base } }, $fullName; - # print STDERR " : $perm $base\n"; - last if !&matchComma; - } - } - - # print STDERR "\n"; - # print STDERR "parsing class $fullName\n"; - - if ($docEmpty == 0) { - $class = { 'type' => $tag, - 'name' => $fullName, - 'longname'=> "$tag $className", - 'fullname'=> "$tag $className", - 'scopename'=> "$tag $fullName", - 'uname' => $fullName, - 'bases' => \@bases, - 'package' => $packageName, - 'members' => {} }; - - # print STDERR "$className: @bases\n"; - - bless $class, ClassRecord; - - print STDERR " parsing class $fullName\n"; - # $classToPackage{ $className } = $packageName; - $classToPackage{ $fullName } = $packageName; - # $classList{ $className } = $class; - $classList{ $fullName } = $class; - $packages{ $packageName }{ 'classes' }{ $fullName } = $class; - &dumpComments( $class ); - } - - if (&matchRBracket) { - local ($perm) = ("private"); - - while (!&matchLBracket) { - my $p; - if ((($valid, $p) = &matchKW( "public\:|private\:|protected\:" )) && $valid) { - $perm = $p; - } - else { - &parseDeclaration( $fullName ) - || die "Unmatched brace! line = $linenumber\n"; - } - } - - &matchSemi; - } - - &clearComments; - } - } - elsif ( ((($valid,)=&matchKW( "enum")) && $valid) || ((($valid,)=&matchKW( "typedef" )) && $valid)) { - &skipToSemi; - } - elsif ((($valid,)=&matchKW( "friend\s*class" )) && $valid) { - &skipToSemi; - } - elsif ((($valid, $token) = &matchKW("extern\\s*\\\"C\\\"")) && $valid) { - &matchRBracket; - while (!&matchLBracket) { - &parseDeclaration( '' ) || die "Unmatched brace! line = $linenumber\n"; - } - &matchSemi; - } - # elsif ($kw = &matchID) { - # $type = "$kw "; - # - # if ($kw =~/virtual|static|const|volatile/) { - # $type .= &typ; - # } - # } - elsif ((($valid, $decl) = &matchDecl) && $valid) { - my ($instanceClass) = ""; - - # print STDERR "DECLARATION=$decl, REST=$_, baseScope=$baseScope\n"; - - return 1 if ($decl =~ /^\s*$/); - - if (!($class)) { - if ($decl =~ s/(\S*\s*)(\S+)\:\:(\S+)\s*$/$1$3/) { - $instanceClass = $2; - } - } - - # Eliminate in-line comments - &removeComment; - - # Check for multi-line declaration - while ((($valid, $d) = &matchDecl) && $valid) { $decl .= $d; } - - # Handle template args, but don't let operator overloading confuse us! - $tempArgs = ''; - if (!($decl =~ /\boperator\b/) && ($tempArgs = &matchAngleArgs)) { - $tempArgs = $decl . $tempArgs; - $decl = ''; - while ((($valid, $d) = &matchDecl) && $valid) { $decl .= $d; } - } - - # Look for (*name) syntax - &parseParenPointer; - - # Special handling for operator... syntax - $oper = ""; - if ($decl =~ s/\boperator\b(.*)/operator/) { - $oper = $1; - $oper .= &matchOper; - # If, after all that there's no opers, then try a () operator - if (!($oper =~ /\S/)) { $oper .= &matchFuncOper; } - } - - ($type,$mod,$decl) = $decl =~ /([\s\w]*)([\s\*\&]+\s?)(\~?\w+(\[.*\])*)/; - - $type = $tempArgs . $type; - $decl .= $oper; - - if ($mod =~ /\s/) { $type .= $mod; $mod = ""; } - - for (;;) { - - # print STDERR "Looping: $type/$mod/$decl\n"; - - if (&matchRParen) { - $nest = 1; - $args = ""; - - for (;;) { - # print STDERR "Argloop $_\n"; - - # Process argument lists. - - # Preserve spaces, eliminate in-line comments - # REM: Change this to save inline comments and automatically - # generate @param clauses - s|//.*||; - while (s/^(\s+)//) { $args .= " "; &rdln; } - - if (&matchRParen) { $nest++; $args .= "("; } - elsif (&matchLParen) { - $nest--; - last if !$nest; - $args .= ")"; - } - elsif ((($valid, $d) = &matchKW( "[\,\=\.\:\-]" )) && $valid) { $args .= $d; } - elsif ((($valid, $d) = &matchDecl) && $valid) { $args .= $d; } - elsif ((($valid, $d) = &matchAngleArgs) && $valid) { $args .= $d; } - elsif ((($valid, $d) = &matchString) && $valid) { $args .= "\"$d\""; } - else { last; } - } - - # print STDERR "$type$mod$baseScope$decl($args);\n"; - - &matchKW( "const" ); - - # Search for any text within the name field - # if ($docTag && $decl =~ /\W*(~?\w*).*/) - if ($docEmpty == 0) { - $type =~ s/^\s+//; - $mod =~ s/\&/\&/g; - $args =~ s/\&/\&/g; - $args =~ s/\s+/ /g; - $dbname = &uniqueName( "$baseScope$decl" ); - - my $entry = { 'type' => 'func', - 'name' => $decl, - 'longname'=> "$decl()", - 'fullname'=> "$type$mod$decl($args)", - 'scopename'=>"$type$mod$baseScope$decl($args)", - 'uname' => $dbname, - 'decl' => "$type$mod$decl($args)", - 'package' => $packageName }; - - bless $entry, MemberRecord; - - if ($class) { - $entry->{ 'class' } = "$context"; - $class->{ 'members' }{ $dbname } = $entry; - } - elsif ($instanceClass) { - $class = &classRecord ($instanceClass); - if (!($class)) { - print STDERR "WARNING: Skipping \"$instanceClass\:\:$decl\". Class \"$instanceClass\" not declared ($linenumber).\n"; - } else { - $entry->{ 'class' } = "$instanceClass"; - $class->{ 'members' }{ $dbname } = $entry; - $class = 0; - } - } - else { - $packages{ $packageName }{ 'globals' }{ $dbname } = $entry; - } - &dumpComments( $entry ); - } - else { &clearComments; } - - s|//.*||; - - # Constructor super-call syntax - if (&matchColon) { - - # Skip over it. - for (;;) { - &rdln; - last if /^\s*(\{|\;)/; - last if !((($valid,)=&matchAny) && $valid); - } - } - - last if &matchSemi; - if (&matchRBracket) { &skipBody; last; } - last if !&matchComma; - last if !((($valid, $decl) = &matchDecl) && $valid); - - # Look for (*name) syntax - &parseParenPointer; - - $decl =~ s/^\s*//; - $oper = ""; - if ($decl =~ /\boperator\b/) { - $decl =~ s/\boperator\b(.*)/operator/; - $oper = $1 . &matchOper; - } - ($mod,$d) = $decl =~ /^\s*([\*\&]*)\s*(\~?\w+(\[.*\])*)/; - $decl .= $oper; - $decl = $d if $d ne ""; - } - else { - s|//.*||; - - $final = 0; - - if ((($valid,)=&matchKW( "\=" )) && $valid) { - for (;;) { - - if (&matchRBracket) { - &skipBody; - $final = 1; - last; - } - - if (&matchSemi) { - $final = 1; - last; - } - - # var = new ... (...) - if ((($valid,)=&matchKW("new")) && $valid) { - &matchKW("[A-Za-z_0-9 ]*"); - if (&matchRParen) { - &skipParenBody; - } - } - - # var = (.....) ... - if (&matchRParen) { - &skipParenBody; - } - - # var = ... * ... - &matchKW ("[\/\*\-\+]*"); - - # var = "..." - if ((($valid,) = &matchKW ("[\"]")) && $valid) { - &skipString; - } - #&matchString; - - last if /^\s*,/; - #last if !((($valid,)=&matchAny) && $valid); - last if !((($valid,)=&matchKW("[A-Za-z_0-9 \-]*")) && $valid); - if (&matchSemi) { - $final = 1; - last; - } - } - } - - s|//.*||; - - # void ~*&foo[]; - # void foo[]; - # void far*foo[]; - # print STDERR "Decl: $type$mod$baseScope$decl;\n"; - - # Search for any text within the name field - if ($docEmpty == 0 && ($decl =~ /\W*(~?\w*).*/)) - { - $mod =~ s/\&/\&/g; - $name = $decl; - - $dbname = &uniqueName( "$baseScope$1" ); - - my $entry = { 'type' => 'var', - 'name' => $1, - 'longname' => "$name", - 'fullname' => "$type$mod$decl", - 'scopename'=> "$baseScope$type$mod$decl", - 'uname' => $dbname, - 'decl' => "$type$mod$decl", - 'package' => $packageName }; - - bless $entry, MemberRecord; - - if ($class) { - $entry->{ 'class' } = "$context"; - $class->{ 'members' }{ $dbname } = $entry; - } - else { - $packages{ $packageName }{ 'globals' }{ $dbname } = $entry; - } - &dumpComments( $entry ); - } - else { &clearComments; } - - last if $final; - last if &matchSemi; - last if !&matchComma; - last if !((($valid, $decl) = &matchDecl) && $valid); - - # Look for (*name) syntax - &parseParenPointer; - - $decl =~ s/^\s*//; - ($mod,$d) = $decl =~ /^\s*([\*\&]*)(\~?\w+(\[.*\])*)/; - $decl = $d if $d ne ""; - } - } - } - elsif ($context ne "" && /^\s*\}/) { - # print STDERR "Popping!\n"; - return 1; - } - elsif (&matchRBracket) { - &skipBody; - } - elsif ((($valid, $token) = &matchAny) && $valid) { - # Comment in for debugging - # print STDERR "token: $token \n"; - } - else { return 0; } - - return 1; -} - -# read a file into a string ( filename, default-value ) -sub readFile { - local ( $filename, $result ) = @_; - - if ($filename && open( FILE, $filename )) { - $result = ""; - while () { $result .= $_; } - close( FILE ); - } - return $result; -} - -# Read the entire document template and translate into PERL code. -sub readTemplate { - local ( $filename ) = @_; - $docTemplate = ''; - $indent = ''; - $literal = 1; # We're in literal mode. - - if (!-e $filename) { - if (-e "./templates/$filename") { $filename = "./templates/$filename"; } - elsif (-e "../templates/$filename") { $filename = "../templates/$filename"; } - else { die "Could not find template '$filename'.\n"; } - } - - open( FILE, $filename ) || die "Error opening '$filename'.\n"; - while () { - last if (/END/); - - # if we found a code entry. - for (;;) { - &expandTabs( $_ ); - if ($literal) { - # Check for beginning of code block. - if (s/^(.*)\<\$2() \. \"/g; - $docTemplate .= "${indent}print\"$line\";"; - } - # else { $docTemplate .= "\n"; } - $literal = 0; - } - else { - if (substr( $_, 0, length( $indent ) ) eq $indent) { - substr( $_, 0, length( $indent ) ) = ""; - } - chop; - s/\"/\\\"/g; - s/\$\((\w+)\.(\w+)\)/\" \. \$$1->$2() \. \"/g; - $_ = $indent . "print \"" . $_ . "\\n\";\n"; - last; - } - } - else { - # Check for beginning of literal block. - if (s/^(\s*)\>\>//) { - $indent = $1; - $literal = 1; - } - elsif (s/^(\s*)(.*)\>\>//) { - $docTemplate .= "$indent$2"; - $literal = 1; - } - else { - last; - } - } - } - - $docTemplate .= $_; - } - close( FILE ); - # print $docTemplate; -} - -# Functions intended to be called from doc template file. - -# Open a new output file -sub file { - my $mfile = $_[ 0 ]; - - open( STDOUT, ">$destPath$mfile" ) || die "Error writing to '$mfile'\n"; -} - -# return list of package objects -sub packages { - my ($p, @r); - @r = (); - - foreach $p (sort keys %packages) { - push @r, $packages{ $p }; - } - return @r; -} - -# return list of source files which have to-do lists -sub todolistFiles { - my ($p, @r); - @r = (); - - foreach $p (sort keys %todolist) { - push @r, $p; - } - return @r; -} - -# return list of tab-delimited to-do-list texts. -sub todolistEntries { - local $_ = $todolist{ $_[0] }; - s/^\s+//; # Remove whitespace from beginning - s/\s+$/\n/; # Remove whitespace from end - return split( /\n/, $_ ); -} - -# Convert package name to URL. -sub packageURL { - my $p = $_[0]; - - if ($p eq 'General') { $p = '.general'; } - if ($p eq '') { $p = '.general'; } - - if (ref $packages{ $p }) { - return $packages{ $p }->url(); - } - return 0; -} - -# Get the see-also list for an object -sub seealsoList { - my $self = shift; - my ($see, $name, $url, $p, @r); - @r = (); - - if (defined ($self->{ 'see' })) { - foreach $_ (split(/\n/,$self->{ 'see' })) { - - if (/^\ $name, - 'url' => $url }; - - bless $entry, DocReference; - - push @r, $entry; - } - } - return @r; -} - -sub removeApacheMacros { -# print "removing from $_"; - s|AP_DECLARE\((.*?)\)|$1|; -} - -# Class for parsed package -package PackageRecord; - -sub classes { - my $self = shift; - my $classes = $self->{ 'classes' }; - return map $classes->{ $_ }, (sort keys %$classes); -} - -sub globals { - my $self = shift; - my $globals = $self->{ 'globals' }; - return map $globals->{ $_ }, (sort keys %$globals); -} - -sub globalvars { - my $self = shift; - my $globals = $self->{ 'globals' }; - my ($p, @r); - @r = (); - - foreach $p (sort keys %$globals) { - my $m = $globals->{ $p }; - if ($m->{ 'type' } ne 'func') { push @r, $m; } - } - return @r; -} - -sub globalfuncs { - my $self = shift; - my $globals = $self->{ 'globals' }; - my ($p, @r); - @r = (); - - foreach $p (sort keys %$globals) { - my $m = $globals->{ $p }; - if ($m->{ 'type' } eq 'func') { push @r, $m; } - } - return @r; -} - -sub name { - my $self = shift; - return $self->{ 'name' }; -} - -sub url { - my $self = shift; - return "default-pkg.html" if ($self->{ 'name' } eq '.general'); - return $self->{ 'name' } . '.html'; -} - -sub anchor { - my $self = shift; - my $url = $self->{ 'name' }; - return $url; -} - -# Class for parsed class -package ClassRecord; - -sub keywords { return ${$_[0]}{ 'keywords' }; } -sub author { return ${$_[0]}{ 'author' }; } -sub version { return ${$_[0]}{ 'version' }; } -sub name { return ${$_[0]}{ 'name' }; } -sub longname { return ${$_[0]}{ 'longname' }; } -sub fullname { return ${$_[0]}{ 'fullname' }; } -sub scopename { return ${$_[0]}{ 'scopename' }; } -sub sourcefile { return ${$_[0]}{ 'sourcefile' }; } -#sub description { return &::processDescription( ${$_[0]}{ 'description' } ); } -sub description { return ${$_[0]}{ 'description' }; } -sub seealso { &::seealsoList( $_[0] ); } - -sub url { - my $self = shift; - return 0 unless $self->{ 'package' }; - my $pname = ::packageURL( $self->{ 'package' } ); - my $url = $self->{ 'uname' }; - $url =~ s/::/-/g; - return "$pname#$url"; -} - -sub anchor { - my $self = shift; - my $url = $self->{ 'uname' }; - $url =~ s/::/-/g; - return $url; -} - -sub members { - my $self = shift; - my $members = $self->{ 'members' }; - my ($p, @r); - @r = (); - - foreach $p (sort keys %$members) { - push @r, $members->{ $p }; - } - return @r; -} - -sub membervars { - my $self = shift; - my $members = $self->{ 'members' }; - my ($p, @r); - @r = (); - - foreach $p (sort keys %$members) { - my $m = $members->{ $p }; - if ($m->{ 'type' } ne 'func') { push @r, $m; } - } - return @r; -} - -sub memberfuncs { - my $self = shift; - my $members = $self->{ 'members' }; - my ($p, @r); - @r = (); - - foreach $p (sort keys %$members) { - my $m = $members->{ $p }; - if ($m->{ 'type' } eq 'func') { push @r, $m; } - } - return @r; -} - -sub baseclasses { - my $self = shift; - my $bases = $self->{ 'bases' }; - my ($p, $class, @r); - @r = (); - - foreach $p (@$bases) { - - unless ($class = $::classList{ $p }) { - # It's one we don't know about, so just make something up - $class = { 'name' => $p, - 'longname'=> "class $p", - 'fullname'=> "class $p", - 'scopename'=>"class $p", - 'uname' => $p, - 'members' => {} }; - - if ($::classToPackage{ $p }) { - $class->{ 'package' } = $::classToPackage{ $p }; - } - - bless $class, ClassRecord; - } - push @r, $class; - } - return @r; -} - -sub subclasses { - my $self = shift; - my $subs; - my ($p, $class, @r); - @r = (); - - if (defined ($self->{ 'subs' })) { - $subs = $self->{ 'subs' }; - foreach $p (sort @$subs) { - $class = $::classList{ $p }; - push @r, $class; - } - } - return @r; -} - -# Class for parsed class member or global -package MemberRecord; - -sub type { return ${$_[0]}{ 'type' }; } -sub keywords { return ${$_[0]}{ 'keywords' }; } -sub author { return ${$_[0]}{ 'author' }; } -sub version { return ${$_[0]}{ 'version' }; } -sub name { return ${$_[0]}{ 'name' }; } -sub longname { return ${$_[0]}{ 'longname' }; } -sub fullname { return ${$_[0]}{ 'fullname' }; } -sub scopename { return ${$_[0]}{ 'scopename' }; } -sub returnValue { return ${$_[0]}{ 'return' }; } -sub sourcefile { return ${$_[0]}{ 'sourcefile' }; } -sub description { return ${$_[0]}{ 'description' }; } -sub seealso { &::seealsoList( $_[0] ); } - -sub url { - my $self = shift; - return 0 unless $self->{ 'package' }; - my $pname = ::packageURL( $self->{ 'package' } ); - my $url = $self->{ 'uname' }; - $url =~ s/::/-/g; - return "$pname#$url"; -} - -sub anchor { - my $self = shift; - my $url = $self->{ 'uname' }; - $url =~ s/::/-/g; - $url; -} - -sub params { - my $self = shift; - my $params = $self->{ 'param' }; - my @r; - @r = (); - - return 0 unless ($params); - - my @paramList = split( /\t/, $params ); - - for ($i = 1; $i < $#paramList; $i += 2) { - my $entry = { 'name' => $paramList[ $i ], - 'description' => $paramList[ $i + 1 ] }; - - bless $entry, ArgRecord; - - push @r, $entry; - } - return @r; -} - -sub exceptions { - my $self = shift; - my $params = $self->{ 'exception' }; - my @r; - @r = (); - - return 0 unless ($params); - - my @paramList = split( /\t/, $params ); - - for ($i = 1; $i < $#paramList; $i += 2) { - my $entry = { 'name' => $paramList[ $i ], - 'description' => $paramList[ $i + 1 ] }; - - bless $entry, ArgRecord; - - push @r, $entry; - } - return @r; -} - -package ArgRecord; -sub name { return ${$_[0]}{ 'name' }; } -sub description { return ${$_[0]}{ 'description' }; } - -package DocReference; -sub name { return ${$_[0]}{ 'name' }; } -sub url { return ${$_[0]}{ 'url' }; } diff --git a/build/scandoc_template.pl b/build/scandoc_template.pl deleted file mode 100644 index f260cd5d38d..00000000000 --- a/build/scandoc_template.pl +++ /dev/null @@ -1,518 +0,0 @@ -<< -# Scandoc template file. -# -# This is an example set of templates that is designed to create several -# different kinds of index files. It generates a "master index" which intended -# for use with a frames browser; A "package index" which is the root page of -# the index, and then "package files" containing documentation for all of the -# classes within a single package. - -###################################################################### - -## For quick and superficial customization, -## simply change these variables - -$project_name = '[Apache Portable RunTime]'; -#$company_logo = ''; # change this to an image tag. -$copyright = '© 2000 [Apache Software Foundation]'; -$image_directory = "../images/"; -$bullet1_image = $image_directory . "ball1.gif"; -$bullet2_image = $image_directory . "ball2.gif"; -$bgcolor1 = "#FFFFFF"; -$bgcolor2 = "#FFFFFF"; - -###################################################################### - -## Begin generating frame index file. - -file "index.html"; ->> - - - $project_name - - - - - - <body bgcolor="$bgcolor2" stylesrc="index.html"> - <p>Some Documentation</p> - </body> - - - -<< - -###################################################################### - -## Begin generating master index file (left-hand frame). - -file "master.html"; ->> - - Master Index - - -
    -

    - Master Index -

    -

    - - -<< - -## For each package, generate an index entry. - -foreach $p (packages()) { - $_ = $p->url; - s/\s/_/g; - >>$(p.name)
    -

    - << - foreach $e ($p->classes()) { - $_ = $e->url; - s/\s/_/g; - >>
  • $(e.fullname) - << - } - foreach $e ($p->globals()) { - $_ = $e->url; - s/\s/_/g; - >>
  • $(e.fullname) - << - } - >>
  • << -} - ->> - To-Do List
    -
    -
    -

    - - -<< - -###################################################################### - -## Begin generating package index file - -file "packages.html"; ->> - - $project_name -- Packages - - - -
    $company_logo -

    Documentation for $project_name

    -
    -

    Package List

    -<< - -## For each package, generate an index entry. - -foreach $p (packages()) { - $_ = $p->url; - s/\s/_/g; - >>$(p.name)
    - << -} - ->> -

    -


    - $copyright
    - Generated by ScanDoc $majorVersion.$minorVersion
    - Last Updated: $date
    - - - -<< - -###################################################################### - -## Generate "To-do list" - -file "to-do.html"; ->> - - $project_name -- To-Do list - - - - $company_logo - -

    To-do list for $project_name

    -<< - -if (&todolistFiles()) { - >>

    - << - foreach $f (&todolistFiles()) { - my @m = &todolistEntries( $f ); - if ($f =~ /([^\/]+)$/) { $f = $1; } - >>$f:

      - << - foreach $text (@m) { - if ($text) { - print "
    • ", &processDescription( $text ), "\n"; - } - } - >>
    - << - } -} - ->> -
    - $copyright
    - Generated by ScanDoc $majorVersion.$minorVersion
    - Last Updated: $date
    - - -<< - -###################################################################### - -## Generate individual files for each package. - -my $p; -foreach $p (packages()) { - $_ = $p->name; - s/\s/_/g; - file $_ . ".html"; - >> - - $project_name -- $(p.name) - - -
    - $project_name -

    -

    - -

    Package Name: $(p.name)

    - -<< - -## Generate class and member index at the top of the file. - -foreach $c ($p->classes()) { - $_ = $c->url; - s/\s/_/g; - >>

    - $(c.fullname)

    -
      - << - foreach $m ($c->members()) { - $_ = $m->url; - s/\s/_/g; - >>
    • $(m.longname) - << - } - >>
    - << -} - ->> -
    -<< - -## Generate detailed class documentation -foreach $c ($p->classes()) { - ## Output searchable keyword list - if ($c->keywords()) { - print "\n"; - } - - >>
    - -

    $(c.fullname)

    - - - - - << - - # Output author tag - if ($c->author()) { - >><< - >><< - } - - # Output package version - if ($c->version()) { - >><< - >><< - } - - # Output Source file - if ($c->sourcefile()) { - >><< - >><< - } - - # Output base class list - if ($c->baseclasses()) { - >> - - << - } - - # Output subclasses list - if ($c->subclasses()) { - >> - << - } - - # Output main class description - >> -
    -
    Author:$(c.author)
    Version:$(c.version)
    Source:$(c.sourcefile)
    Base classes:<< - my @t = (); - foreach $b ($c->baseclasses()) { - my $name = $b->name(); - if ($url = $b->url()) { - $_ = $url; - s/\s/_/g; - push @t, "$name"; - } - else { push @t, $name; } - } - print join( ', ', @t ); - >>
    Subclasses:<< - my @t = (); - foreach $s ($c->subclasses()) { - my $name = $s->name(); - if ($url = $s->url()) { - $_ = $url; - s/\s/_/g; - push @t, "$name"; - } - else { push @t, $name; } - } - print join( ', ', @t ); - >>
    -

    - << - print &processDescription( $c->description() ); - - # Output "see also" information - if ($c->seealso()) { - >>

    See Also
    - << - my @r = (); - foreach $a ($c->seealso()) { - my $name = $a->name(); - if ($url = $a->url()) { - $_ = $url; - s/\s/_/g; - push @r, "$name"; - } - else { push @r, $name; } - } - print join( ',', @r ); - >>

    - << - } - - # Output class member index - if ($c->members()) { - print "

    Member Index

    \n"; - print "
      "; - foreach $m ($c->members()) { - $_ = $m->url; - s/\s/_/g; - >>
    • $(m.fullname) - << - } - >>
    << - } - - # Output class member variable documentation - if ($c->membervars()) { - print "

    Class Variables

    \n"; - print "
    \n"; - foreach $m ($c->membervars()) { &variable( $m ); } - print "
    \n"; - } - - # Output class member function documentation - if ($c->memberfuncs()) { - print "

    Class Methods

    \n"; - print "
    \n"; - foreach $m ($c->memberfuncs()) { &function( $m ); } - print "
    \n"; - } -} - -# Output global variables -if ($p->globalvars()) { - >>

    Global Variables

    -
    - << - foreach $m ($p->globalvars()) { &variable( $m ); } - print "
    \n"; -} - -# Output global functions -if ($p->globalfuncs()) { - >>

    Global Functions

    -
    - << - foreach $m ($p->globalfuncs()) { &function( $m ); } - print "
    \n"; -} - ->> -
    - $copyright
    - Generated by ScanDoc $majorVersion.$minorVersion
    - Last Updated: $date
    - - -<< -} # end of foreach (packages) loop - -###################################################################### - -## Subroutine to generate documentation for a member function or global function - -sub function { - local ($f) = @_; - - if ($f->keywords()) { - >> - << - } - >> - -
    -
    - $(f.fullname); -
    - << - print &processDescription( $f->description() ); - >> -

    - << - if ($f->params()) { - >> -
    Parameters
    - - << - foreach $a ($f->params()) { - >> - << - } - >>
    - $(a.name)<< - print &processDescription( $a->description() ); - >>
    - << - } - - if ($f->returnValue()) { - >>
    Return Value -
    << - print &processDescription( $f->returnValue() ); - >>

    << - } - - if ($f->exceptions()) { - >>

    Exceptions
    - - << - foreach $a ($f->exceptions()) { - >> - << - } - >>

    - $(a.name)<< - print &processDescription( $a->description() ); - >>

    - << - } - - if ($f->seealso()) { - >>
    See Also
    - << - my @r = (); - foreach $a ($f->seealso()) { - my $name = $a->name(); - if ($url = $a->url()) { - $_ = $url; - s/\s/_/g; - push @r, "$name"; - } - else { push @r, $name; } - } - print join( ',', @r ); - >>

    << - } - >>

    - << -} - -###################################################################### - -## Subroutine to generate documentation for a member variable or global variable. - -sub variable { - local ($v) = @_; - - if ($v->keywords()) { - print ""; - } - - >> - -
    - $(v.fullname); -
    - <description() );>> -

    - << - if ($v->seealso()) { - >>
    See Also
    - << - $comma = 0; - foreach $a ($v->seealso()) { - $_ = $a->url; - s/\s/_/g; - if ($comma) { print ","; } - $comma = 1; - >>$(a.name) - << - } - >>

    - << - } - >>

    - << -} - -###################################################################### - -sub processDescription { - local ($_) = @_; - - # handle HTML markup issues. - s//>/g; - - s/^\s+//; # Remove whitespace from beginning - s/\s+$/\n/; # Remove whitespace from end - s/\n\n/

    \n/g; # Replace multiple CR's with paragraph markers - s:\@heading(.*)\n:

    $1

    :; # Handle heading text - - # Handle embedded image tags - s:\@caution:

    :; - s:\@warning:

    :; - s:\@bug:

    :; - s:\@tip:

    :; - - return $_; -} diff --git a/docs/doxygen.conf b/docs/doxygen.conf new file mode 100644 index 00000000000..dbe4b75c8e9 --- /dev/null +++ b/docs/doxygen.conf @@ -0,0 +1,19 @@ +PROJECT_NAME=Apache Portable Run-Time + +INPUT=. +RECURSIVE=YES +FILE_PATTERNS=*.h + +OUTPUT_DIRECTORY=docs/dox + +MACRO_EXPANSION=YES +EXPAND_ONLY_PREDEF=YES +EXPAND_AS_DEFINED= +# not sure why this doesn't work as EXPAND_AS_DEFINED, it should! +PREDEFINED=APR_DECLARE(x)=x APR_DECLARE_NONSTD(x)=x \ + +OPTIMIZE_OUTPUT_FOR_C=YES + +FULL_PATH_NAMES=YES +# some autoconf guru needs to make configure set this correctly... +STRIP_FROM_PATH=/home/rbb/httpd-2.0/srclib/apr From 9d2c7f1fd77a85eeeb5ac8c2e1f54524c12becb4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 12 Aug 2001 05:15:54 +0000 Subject: [PATCH 2149/7878] Argh! Ian told me about this, but I forgot before I committed. Submitted by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62146 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_sms.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_sms.h b/include/apr_sms.h index e33407896f5..d5c0082f1b7 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -65,7 +65,7 @@ * @brief APR SMS Memory routines */ /** - * @defgroup SMS SMS Shared Memory allocation system + * @defgroup SMS SMS Stackable Memory allocation system * @ingroup APR * @{ */ From ef8db50a9a65b5c8d2b58384ec81e97520eeecf3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 12 Aug 2001 05:50:46 +0000 Subject: [PATCH 2150/7878] Add the rest of the doxygen changes for APR. Submitted by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62147 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 6 +- include/apr.hw | 11 +++ include/apr_compat.h | 103 ++++++++++++++++++++++++- include/apr_dso.h | 17 +++-- include/apr_file_io.h | 159 +++++++++++++++++---------------------- include/apr_fnmatch.h | 32 ++++---- include/apr_md5.h | 15 ++-- include/apr_network_io.h | 113 ++++++++++++---------------- include/apr_uuid.h | 19 +++-- 9 files changed, 288 insertions(+), 187 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 4f0364adb61..c385a3b62c3 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -5,6 +5,10 @@ * @file apr.h * @brief Basic APR header */ +/** + * @defgroup APR APR Functions + * @{ + */ /* So that we can use inline on some critical functions, and use * GNUC attributes (such as to get -Wall warnings for printf-like @@ -291,5 +295,5 @@ typedef @socklen_t_value@ apr_socklen_t; #else #error no decision has been made on APR_PATH_MAX for your platform #endif - +/** @} */ #endif /* APR_H */ diff --git a/include/apr.hw b/include/apr.hw index 40488a8844a..70426ce42d4 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -56,6 +56,16 @@ * Note: This is a Windows specific version of apr.h. It is copied as * apr.h at the start of a Windows build. */ +/** + * @file apr.h + * @brief Basic APR header + */ + +/** + * @defgroup APR APR Functions + * @{ + */ + #ifdef WIN32 #ifndef APR_H @@ -343,3 +353,4 @@ struct iovec { #endif /* APR_H */ #endif /* WIN32 */ +/** @} */ diff --git a/include/apr_compat.h b/include/apr_compat.h index 38982f34bef..471849ba8ff 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -1,101 +1,202 @@ #ifndef APR_COMPAT_H #define APR_COMPAT_H +/** + * @file apr_compat.h + * @brief APR Compatibilty Functions + * @deprecated These functions are only present for historical purposes + */ +/** + * @defgroup APR_compat 1.3 Compatibility Functions + * @ingroup APR + * @{ + */ /* redefine 1.3.x symbols to those that now live in libapr */ +/** @see APR_INLINE */ #define ap_inline APR_INLINE +/** @deprecated @see apr_md5_ctx_t */ #define ap_md5_ctx_t apr_md5_ctx_t +/** @deprecated @see apr_md5_encode */ #define ap_MD5Encode apr_md5_encode +/** @deprecated @see apr_md5_final */ #define ap_MD5Final apr_md5_final +/** @deprecated @see apr_md5_init */ #define ap_MD5Init apr_md5_init +/** @deprecated @see apr_md5_update */ #define ap_MD5Update apr_md5_update +/** @deprecated @see apr_array_append */ #define ap_append_arrays apr_array_append +/** @deprecated @see apr_array_cat */ #define ap_array_cat apr_array_cat +/** @deprecated @see apr_array_header_t */ #define ap_array_header_t apr_array_header_t +/** @deprecated @see apr_array_pstrcat */ #define ap_array_pstrcat apr_array_pstrcat +/** @deprecated @see apr_pool_free_blocks_num_bytes */ #define ap_bytes_in_free_blocks apr_pool_free_blocks_num_bytes +/** @deprecated @see apr_pool_num_bytes */ #define ap_bytes_in_pool apr_pool_num_bytes +/** @deprecated @see apr_check_file_time */ #define ap_check_file_time apr_check_file_time +/** @deprecated @see apr_filetype_e */ #define ap_filetype_e apr_filetype_e +/** @deprecated @see apr_pool_cleanup_for_exec */ #define ap_cleanup_for_exec apr_pool_cleanup_for_exec +/** @deprecated @see apr_pool_clear */ #define ap_clear_pool apr_pool_clear +/** @deprecated @see apr_table_clear */ #define ap_clear_table apr_table_clear +/** @deprecated @see apr_array_copy */ #define ap_copy_array apr_array_copy +/** @deprecated @see apr_array_copy_hdr */ #define ap_copy_array_hdr apr_array_copy_hdr +/** @deprecated @see apr_table_copy */ #define ap_copy_table apr_table_copy +/** @deprecated @see apr_cpystrn */ #define ap_cpystrn apr_cpystrn +/** @deprecated @see apr_day_snames */ #define ap_day_snames apr_day_snames +/** @deprecated @see apr_pool_destroy */ #define ap_destroy_pool apr_pool_destroy +/** @deprecated @see apr_exploded_time_t */ #define ap_exploded_time_t apr_exploded_time_t +/** @deprecated @see apr_fnmatch */ #define ap_fnmatch apr_fnmatch +/** @deprecated @see apr_getopt */ #define ap_getopt apr_getopt +/** @deprecated @see apr_inet_addr */ #define ap_inet_addr apr_inet_addr +/** @deprecated @see apr_pool_alloc_init */ #define ap_init_alloc apr_pool_alloc_init +/** @deprecated @see apr_is_empty_table */ #define ap_is_empty_table apr_is_empty_table +/** @deprecated @see apr_is_fnmatch */ #define ap_is_fnmatch apr_is_fnmatch +/** @deprecated @see apr_pool_cleanup_kill */ #define ap_kill_cleanup apr_pool_cleanup_kill +/** @deprecated @see apr_array_make */ #define ap_make_array apr_array_make +/** @deprecated @see apr_pool_sub_make */ #define ap_make_sub_pool apr_pool_sub_make +/** @deprecated @see apr_table_make */ #define ap_make_table apr_table_make +/** @deprecated @see apr_month_snames */ #define ap_month_snames apr_month_snames +/** @deprecated @see apr_pool_note_subprocess*/ #define ap_note_subprocess apr_pool_note_subprocess +/** @deprecated @see apr_pool_cleanup_null */ #define ap_null_cleanup apr_pool_cleanup_null +/** @deprecated @see apr_dso_load */ #define ap_os_dso_load apr_dso_load +/** @deprecated @see apr_dso_unload */ #define ap_os_dso_unload apr_dso_unload +/** @deprecated @see apr_dso_sym */ #define ap_os_dso_sym apr_dso_sym +/** @deprecated @see apr_dso_error */ #define ap_os_dso_error apr_dso_error +/** @deprecated @see apr_proc_kill */ #define ap_os_kill apr_proc_kill +/** @deprecated @see apr_table_overlap */ #define ap_overlap_tables apr_table_overlap +/** @deprecated @see apr_table_overlay */ #define ap_overlay_tables apr_table_overlay +/** @deprecated @see apr_palloc */ #define ap_palloc apr_palloc +/** @deprecated @see apr_pcalloc */ #define ap_pcalloc apr_pcalloc +/** @deprecated @see apr_pool_join */ #define ap_pool_join apr_pool_join +/** @deprecated @see apr_psprintf */ #define ap_psprintf apr_psprintf +/** @deprecated @see apr_pstrcat */ #define ap_pstrcat apr_pstrcat +/** @deprecated @see apr_pstrdup */ #define ap_pstrdup apr_pstrdup +/** @deprecated @see apr_pstrndup */ #define ap_pstrndup apr_pstrndup +/** @deprecated @see apr_array_push */ #define ap_push_array apr_array_push +/** @deprecated @see apr_pvsprintf */ #define ap_pvsprintf apr_pvsprintf +/** @deprecated @see apr_pool_cleanup_register */ #define ap_register_cleanup apr_pool_cleanup_register +/** @deprecated @see apr_proc_other_child_register */ #define ap_register_other_child apr_proc_other_child_register +/** @deprecated @see apr_pool_cleanup_run */ #define ap_run_cleanup apr_pool_cleanup_run +/** @deprecated @see apr_signal */ #define ap_signal apr_signal +/** @deprecated @see apr_snprintf */ #define ap_snprintf apr_snprintf +/** @deprecated @see apr_table_add */ #define ap_table_add apr_table_add +/** @deprecated @see apr_table_addn */ #define ap_table_addn apr_table_addn +/** @deprecated @see apr_table_do */ #define ap_table_do apr_table_do +/** @deprecated @see apr_table_elts */ #define ap_table_elts apr_table_elts +/** @deprecated @see apr_table_get */ #define ap_table_get apr_table_get +/** @deprecated @see apr_table_merge */ #define ap_table_merge apr_table_merge +/** @deprecated @see apr_table_mergen */ #define ap_table_mergen apr_table_mergen +/** @deprecated @see apr_table_set */ #define ap_table_set apr_table_set +/** @deprecated @see apr_table_setn */ #define ap_table_setn apr_table_setn +/** @deprecated @see apr_table_unset */ #define ap_table_unset apr_table_unset +/** @deprecated @see apr_proc_other_child_unregister */ #define ap_unregister_other_child apr_proc_other_child_unregister +/** @deprecated @see apr_password_validate */ #define ap_validate_password apr_password_validate +/** @deprecated @see apr_vformatter */ #define ap_vformatter apr_vformatter +/** @deprecated @see apr_vsnprintf */ #define ap_vsnprintf apr_vsnprintf +/** @deprecated @see apr_wait_t */ #define ap_wait_t apr_wait_t +/** @deprecated @see apr_isalnum */ #define ap_isalnum apr_isalnum +/** @deprecated @see apr_isalpha*/ #define ap_isalpha apr_isalpha +/** @deprecated @see apr_iscntrl */ #define ap_iscntrl apr_iscntrl +/** @deprecated @see apr_isdigit */ #define ap_isdigit apr_isdigit +/** @deprecated @see apr_isgraph */ #define ap_isgraph apr_isgraph +/** @deprecated @see apr_islower */ #define ap_islower apr_islower +/** @deprecated @see apr_isascii */ #define ap_isascii apr_isascii +/** @deprecated @see apr_isprint */ #define ap_isprint apr_isprint +/** @deprecated @see apr_ispunct */ #define ap_ispunct apr_ispunct +/** @deprecated @see apr_isspace */ #define ap_isspace apr_isspace +/** @deprecated @see apr_isupper */ #define ap_isupper apr_isupper +/** @deprecated @see apr_isxdigit */ #define ap_isxdigit apr_isxdigit +/** @deprecated @see apr_tolower */ #define ap_tolower apr_tolower +/** @deprecated @see apr_toupper */ #define ap_toupper apr_toupper +/** @deprecated @see APR_USEC_PER_SEC */ #define AP_USEC_PER_SEC APR_USEC_PER_SEC +/** @deprecated @see APR_RFC822_DATE_LEN */ #define AP_RFC822_DATE_LEN APR_RFC822_DATE_LEN +/** @deprecated @see APR_OVERLAP_TABLES_MERGE */ #define AP_OVERLAP_TABLES_MERGE APR_OVERLAP_TABLES_MERGE +/** @deprecated @see APR_OVERLAP_TABLES_SET */ #define AP_OVERLAP_TABLES_SET APR_OVERLAP_TABLES_SET - +/** @} */ #endif /* APR_COMPAT_H */ diff --git a/include/apr_dso.h b/include/apr_dso.h index b34054c8d37..01c0fc30d2c 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -58,16 +58,23 @@ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" +/** + * @file apr_dso.h + * @brief APR Dynamic Object Handling Routines + */ + /** - * @package Dynamic Object Handling + * @defgroup APR_DSO Dynamic Object Handling + * @ingroup APR + * @{ */ #ifdef __cplusplus extern "C" { #endif -#if APR_HAS_DSO +#if APR_HAS_DSO || defined(DOXYGEN) /** * Structure for referencing dynamic objects @@ -86,7 +93,6 @@ typedef void * apr_dso_handle_sym_t; * @param res_handle Location to store new handle for the DSO. * @param path Path to the DSO library * @param ctx Pool to use. - * @deffunc apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) */ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx); @@ -94,7 +100,6 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, /** * Close a DSO library. * @param handle handle to close. - * @deffunc apr_status_t apr_dso_unload(apr_dso_handle_t *handle) */ APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle); @@ -103,7 +108,6 @@ APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle); * @param ressym Location to store the loaded symbol * @param handle handle to load the symbol from. * @param symname Name of the symbol to load. - * @deffunc apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, const char *symname) */ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, @@ -114,7 +118,6 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, * @param dso The dso handle that has been opened * @param buf Location to store the dso error * @param bufsize The size of the provided buffer - * @deffunc const char *apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize) */ APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize); @@ -123,5 +126,5 @@ APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_si #ifdef __cplusplus } #endif - +/** @} */ #endif diff --git a/include/apr_file_io.h b/include/apr_file_io.h index c62ffe49233..08a9523e9a6 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -54,6 +54,17 @@ #ifndef APR_FILE_IO_H #define APR_FILE_IO_H +/** + * @file apr_file_io.h + * @brief APR File I/O Handling + */ +/** + * @defgroup APR_File_IO_Handle I/O Handling Functions + * @ingroup APR_File_Handle + * @{ + */ + + #include "apr.h" #include "apr_pools.h" @@ -71,32 +82,39 @@ extern "C" { #endif /* __cplusplus */ /** - * @package APR File handling + * @defgroup apr_file_open File Open Flags/Routines + * @{ */ -/* Flags for apr_file_open */ -#define APR_READ 1 /* Open the file for reading */ -#define APR_WRITE 2 /* Open the file for writing */ -#define APR_CREATE 4 /* Create the file if not there */ -#define APR_APPEND 8 /* Append to the end of the file */ -#define APR_TRUNCATE 16 /* Open the file and truncate to 0 length */ -#define APR_BINARY 32 /* Open the file in binary mode */ -#define APR_EXCL 64 /* Open should fail if APR_CREATE and file - exists. */ -#define APR_BUFFERED 128 /* Open the file for buffered I/O */ -#define APR_DELONCLOSE 256 /* Delete the file after close */ -#define APR_XTHREAD 512 /* Platform dependent tag to open the file - for use across multiple threads */ -#define APR_SHARELOCK 1024 /* Platform dependent support for higher - level locked read/write access to support - writes across process/machines */ +#define APR_READ 1 /**< Open the file for reading */ +#define APR_WRITE 2 /**< Open the file for writing */ +#define APR_CREATE 4 /**< Create the file if not there */ +#define APR_APPEND 8 /**< Append to the end of the file */ +#define APR_TRUNCATE 16 /**< Open the file and truncate to 0 length */ +#define APR_BINARY 32 /**< Open the file in binary mode */ +#define APR_EXCL 64 /**< Open should fail if APR_CREATE and file + exists. */ +#define APR_BUFFERED 128 /**< Open the file for buffered I/O */ +#define APR_DELONCLOSE 256 /**< Delete the file after close */ +#define APR_XTHREAD 512 /**< Platform dependent tag to open the file + for use across multiple threads */ +#define APR_SHARELOCK 1024 /**< Platform dependent support for higher + level locked read/write access to support + writes across process/machines */ + +/** @} */ + +/** + * @defgroup APR_file_seek_flags File Seek Flags + * @{ + */ /* flags for apr_file_seek */ #define APR_SET SEEK_SET #define APR_CUR SEEK_CUR #define APR_END SEEK_END -/* should be same as whence type in lseek, POSIX defines this as int */ +/** should be same as whence type in lseek, POSIX defines this as int */ typedef int apr_seek_where_t; /** @@ -106,21 +124,26 @@ typedef int apr_seek_where_t; typedef struct apr_file_t apr_file_t; /* File lock types/flags */ -#define APR_FLOCK_SHARED 1 /* Shared lock. More than one process +/** + * @defgroup APR_file_lock_types File Lock Types + * @{ + */ + +#define APR_FLOCK_SHARED 1 /**< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock. */ -#define APR_FLOCK_EXCLUSIVE 2 /* Exclusive lock. Only one process +#define APR_FLOCK_EXCLUSIVE 2 /**< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock". */ -#define APR_FLOCK_TYPEMASK 0x000F /* mask to extract lock type */ -#define APR_FLOCK_NONBLOCK 0x0010 /* do not block while acquiring the +#define APR_FLOCK_TYPEMASK 0x000F /**< mask to extract lock type */ +#define APR_FLOCK_NONBLOCK 0x0010 /**< do not block while acquiring the file lock */ - +/** @} */ /** * Open the specified file. * @param new_file The opened file descriptor. @@ -145,8 +168,8 @@ typedef struct apr_file_t apr_file_t; * * @param perm Access permissions for file. * @param cont The pool to use. - * @deffunc apr_status_t apr_file_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) - * @tip If perm is APR_OS_DEFAULT and the file is being created, appropriate + * @ingroup apr_file_open + * @remark If perm is APR_OS_DEFAULT and the file is being created, appropriate * default permissions will be used. *arg1 must point to a valid file_t, * or NULL (in which case it will be allocated) */ @@ -157,7 +180,6 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new_file, const char *fname /** * Close the specified file. * @param file The file descriptor to close. - * @deffunc apr_status_t apr_file_close(apr_file_t *file) */ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file); @@ -165,8 +187,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file); * delete the specified file. * @param path The full path to the file (using / on all systems) * @param cont The pool to use. - * @deffunc apr_status_t apr_file_remove(const char *path, apr_pool_t *cont) - * @tip If the file is open, it won't be removed until all instances are closed. + * @remark If the file is open, it won't be removed until all instances are closed. */ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont); @@ -175,9 +196,8 @@ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont); * @param from_path The full path to the original file (using / on all systems) * @param to_path The full path to the new file (using / on all systems) * @param pool The pool to use. - * @tip If a file exists at the new location, then it will be overwritten. + * @warning If a file exists at the new location, then it will be overwritten. * Moving files or directories across devices may not be possible. - * @deffunc apr_status_t apr_file_rename(const char *from_path, const char *to_path, apr_pool_t *pool) */ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_path, @@ -186,8 +206,7 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, /** * Are we at the end of the file * @param fptr The apr file we are testing. - * @tip Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise. - * @deffunc apr_status_t apr_file_eof(apr_file_t *fptr) + * @remark Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise. */ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); @@ -195,7 +214,7 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); * open standard error as an apr file pointer. * @param thefile The apr file to use as stderr. * @param cont The pool to allocate the file out of. - * @deffunc apr_status_t apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) + * @ingroup apr_file_open */ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont); @@ -204,7 +223,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, * open standard output as an apr file pointer. * @param thefile The apr file to use as stdout. * @param cont The pool to allocate the file out of. - * @deffunc apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) + * @ingroup apr_file_open */ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont); @@ -213,7 +232,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, * open standard input as an apr file pointer. * @param thefile The apr file to use as stdin. * @param cont The pool to allocate the file out of. - * @deffunc apr_status_t apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) + * @ingroup apr_file_open */ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont); @@ -223,17 +242,17 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, * @param thefile The file descriptor to read from. * @param buf The buffer to store the data to. * @param nbytes On entry, the number of bytes to read; on exit, the number of bytes read. - * @tip apr_file_read will read up to the specified number of bytes, but never - * more. If there isn't enough data to fill that number of bytes, all - * of the available data is read. The third argument is modified to - * reflect the number of bytes read. If a char was put back into the - * stream via ungetc, it will be the first character returned. + * @remark apr_file_read will read up to the specified number of bytes, but + * never more. If there isn't enough data to fill that number of + * bytes, all of the available data is read. The third argument is + * modified to reflect the number of bytes read. If a char was put + * back into the stream via ungetc, it will be the first character + * returned. * - * It is not possible for both bytes to be read and an APR_EOF or other - * error to be returned. + * It is not possible for both bytes to be read and an APR_EOF or other + * error to be returned. * - * APR_EINTR is never returned. - * @deffunc apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) + * APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes); @@ -244,7 +263,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, * @param buf The buffer which contains the data. * @param nbytes On entry, the number of bytes to write; on exit, the number * of bytes written. - * @tip apr_file_write will write up to the specified number of bytes, but never + * @remark apr_file_write will write up to the specified number of bytes, but never * more. If the OS cannot write that many bytes, it will write as many * as it can. The third argument is modified to reflect the * number * of bytes written. @@ -252,7 +271,6 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, * It is possible for both bytes to be written and an error to be returned. * * APR_EINTR is never returned. - * @deffunc apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) */ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes); @@ -265,13 +283,12 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, * be smaller than APR_MAX_IOVEC_SIZE. If it isn't, the function * will fail with APR_EINVAL. * @param nbytes The number of bytes written. - * @tip It is possible for both bytes to be written and an error to be returned. + * @remark It is possible for both bytes to be written and an error to be returned. * APR_EINTR is never returned. * * apr_file_writev is available even if the underlying operating system * * doesn't provide writev(). - * @deffunc apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) */ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, @@ -284,7 +301,7 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, * @param buf The buffer to store the data to. * @param nbytes The number of bytes to read. * @param bytes_read If non-NULL, this will contain the number of bytes read. - * @tip apr_file_read will read up to the specified number of bytes, but never + * @remark apr_file_read will read up to the specified number of bytes, but never * more. If there isn't enough data to fill that number of bytes, * then the process/thread will block until it is available or EOF * is reached. If a char was put back into the stream via ungetc, @@ -294,7 +311,6 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, * error to be returned. * * APR_EINTR is never returned. - * @deffunc apr_status_t apr_file_read_full(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read) */ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, apr_size_t nbytes, @@ -307,7 +323,7 @@ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, * @param buf The buffer which contains the data. * @param nbytes The number of bytes to write. * @param bytes_written If non-NULL, this will contain the number of bytes written. - * @tip apr_file_write will write up to the specified number of bytes, but never + * @remark apr_file_write will write up to the specified number of bytes, but never * more. If the OS cannot write that many bytes, the process/thread * will block until they can be written. Exceptional error such as * "out of space" or "pipe closed" will terminate with an error. @@ -315,7 +331,6 @@ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, * It is possible for both bytes to be written and an error to be returned. * * APR_EINTR is never returned. - * @deffunc apr_status_t apr_file_write_full(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written) */ APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, const void *buf, apr_size_t nbytes, @@ -325,7 +340,6 @@ APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, const void *b * put a character into the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to - * @deffunc apr_status_t apr_file_putc(char ch, apr_file_t *thefile) */ APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile); @@ -333,7 +347,6 @@ APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile); * get a character from the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to - * @deffunc apr_status_t apr_file_getc(char *ch, apr_file_t *thefile) */ APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile); @@ -341,7 +354,6 @@ APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile); * put a character back onto a specified stream. * @param ch The character to write. * @param thefile The file descriptor to write to - * @deffunc apr_status_t apr_file_ungetc(char ch, apr_file_t *thefile) */ APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile); @@ -350,7 +362,6 @@ APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile); * @param str The buffer to store the string in. * @param len The length of the string * @param thefile The file descriptor to read from - * @deffunc apr_status_t apr_file_gets(char *str, int len, apr_file_t *thefile) */ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile); @@ -358,14 +369,12 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) * Put the string into a specified file. * @param str The string to write. * @param thefile The file descriptor to write to - * @deffunc apr_status_t apr_file_puts(const char *str, apr_file_t *thefile) */ APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile); /** * Flush the file's buffer. * @param thefile The file descriptor to flush - * @deffunc apr_status_t apr_file_flush(apr_file_t *thefile) */ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile); @@ -374,8 +383,7 @@ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile); * @param new_file The structure to duplicate into. * @param old_file The file to duplicate. * @param p The pool to use for the new file. - * @tip *arg1 must point to a valid apr_file_t, or point to NULL - * @deffunc apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) + * @remark *arg1 must point to a valid apr_file_t, or point to NULL */ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, @@ -391,9 +399,8 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, * APR_END -- add the offset to the current file size * * @param offset The offset to move the pointer to. - * @tip The third argument is modified to be the offset the pointer + * @remark The third argument is modified to be the offset the pointer was actually moved to. - * @deffunc apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) */ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, @@ -404,7 +411,6 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, * @param in The file descriptor to use as input to the pipe. * @param out The file descriptor to use as output from the pipe. * @param cont The pool to operate on. - * @deffunc apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont); @@ -414,7 +420,6 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out * @param filename The filename of the named pipe * @param perm The permissions for the newly created pipe. * @param cont The pool to operate on. - * @deffunc apr_status_t apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, @@ -424,7 +429,6 @@ APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, * Get the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are getting a timeout for. * @param timeout The current timeout value in microseconds. - * @deffunc apr_status_t apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) */ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout); @@ -434,7 +438,6 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, * @param thepipe The pipe we are setting a timeout on. * @param timeout The timeout value in microseconds. Values < 0 mean wait * forever, 0 means do not wait at all. - * @deffunc apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) */ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout); @@ -449,14 +452,12 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, * block. * @param thefile The file to lock. * @param type The type of lock to establish on the file. - * @deffunc apr_status_t apr_file_lock(apr_file_t *thefile, int type) */ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type); /** * Remove any outstanding locks on the file. * @param thefile The file to unlock. - * @deffunc apr_status_t apr_file_unlock(apr_file_t *thefile) */ APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile); @@ -466,7 +467,6 @@ APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile); * return the file name of the current file. * @param new_path The path of the file. * @param thefile The currently open file. - * @deffunc apr_status_t apr_file_name_get(const char **new_path, apr_file_t *thefile) */ APR_DECLARE(apr_status_t) apr_file_name_get(const char **new_path, apr_file_t *thefile); @@ -476,7 +476,6 @@ APR_DECLARE(apr_status_t) apr_file_name_get(const char **new_path, * @param data The user data associated with the file. * @param key The key to use for retreiving data associated with this file. * @param file The currently open file. - * @deffunc apr_status_t apr_file_data_get(void **data, const char *key, apr_file_t *file) */ APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, apr_file_t *file); @@ -487,7 +486,6 @@ APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, * @param data The user data to associate with the file. * @param key The key to use for assocaiteing data with the file. * @param cleanup The cleanup routine to use when the file is destroyed. - * @deffunc apr_status_t apr_file_data_set(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)) */ APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, const char *key, @@ -499,7 +497,6 @@ APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, * @param format The format string * @param ... The values to substitute in the format string * @return The number of bytes written - * @deffunc int apr_file_printf(apr_file_t *fptr, const char *format, ...) */ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) __attribute__((format(printf,2,3))); @@ -508,12 +505,11 @@ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, const char *format, .. * set the specified file's permission bits. * @param fname The file (name) to apply the permissions to. * @param perms The permission bits to apply to the file. - * @tip Some platforms may not be able to apply all of the available + * @warning Some platforms may not be able to apply all of the available * permission bits; APR_INCOMPLETE will be returned if some permissions * are specified which could not be set. * * Platforms which do not implement this feature will return APR_ENOTIMPL. - * @deffunc apr_status_t apr_file_perms_set(const char *fname, apr_fileperms_t perms) */ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, apr_fileperms_t perms); @@ -523,7 +519,6 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, * @param path the path for the directory to be created. (use / on all systems) * @param perm Permissions for the new direcoty. * @param cont the pool to use. - * @deffunc apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont); @@ -532,7 +527,6 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, * Remove directory from the file system. * @param path the path for the directory to be removed. (use / on all systems) * @param cont the pool to use. - * @deffunc apr_status_t apr_dir_remove(const char *path, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont); @@ -541,7 +535,6 @@ APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont); * @param finfo Where to store the information about the file. * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values * @param thefile The file to get information about. - * @deffunc apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) */ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, @@ -559,33 +552,23 @@ APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset); * Retrieve the flags that were passed into apr_file_open() * when the file was opened. * @return apr_int32_t the flags - * @deffunc apr_int32_t apr_file_flags_get(apr_file_t *f) */ APR_DECLARE(apr_int32_t) apr_file_flags_get(apr_file_t *f); /** * Get the pool used by the file. * @return apr_pool_t the pool - * @deffunc apr_pool_t apr_file_pool_get(apr_file_t *f) - */ -APR_POOL_DECLARE_ACCESSOR(file); - -/** - * Set a file to be inherited by child processes. - * @param file The file to enable inheritance. - * @deffunc void apr_file_set_inherit(apr_file_t *file) */ APR_DECLARE(void) apr_file_set_inherit(apr_file_t *file); /** * Unset a file from being inherited by child processes. * @param file The file to disable inheritance. - * @deffunc void apr_file_unset_inherit(apr_file_t *file) */ APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); #ifdef __cplusplus } #endif - +/** @} */ #endif /* ! APR_FILE_IO_H */ diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index c43828ea948..033deab9f7e 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -37,23 +37,29 @@ #ifndef _APR_FNMATCH_H_ #define _APR_FNMATCH_H_ +/** + * @file apr_fnmatch.h + * @brief APR FNMatch Functions + */ +/** + * @defgroup APR_FNMatch FNMatch Functions + * @ingroup APR + * @{ + */ + #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif -/** - * @package Fnmatch functions - */ - -#define FNM_NOMATCH 1 /* Match failed. */ - -#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */ -#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ -#define FNM_PERIOD 0x04 /* Period must be matched by period. */ -/* This flag is an Apache addition */ -#define FNM_CASE_BLIND 0x08 /* Compare characters case-insensitively. */ +#define FNM_NOMATCH 1 /**< Match failed. */ + +#define FNM_NOESCAPE 0x01 /**< Disable backslash escaping. */ +#define FNM_PATHNAME 0x02 /**< Slash must be matched by slash. */ +#define FNM_PERIOD 0x04 /**< Period must be matched by period. */ + +#define FNM_CASE_BLIND 0x08 /**< Compare characters case-insensitively. @remark This flag is an Apache addition */ /** * Try to match the string to the given pattern. @@ -66,7 +72,6 @@ extern "C" { * FNM_PERIOD Period must be matched by period * FNM_CASE_BLIND Compare characters case-insensitively. * - * @deffunc apr_status_t apr_fnmatch(const char *pattern, const char *strings, int flags) */ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, @@ -76,12 +81,11 @@ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, * Determine if the given pattern is a regular expression. * @param pattern The pattern to search for glob characters. * @return non-zero if pattern has any glob characters in it - * @deffunc int apr_is_fnmatch(const char *pattern) */ APR_DECLARE(int) apr_is_fnmatch(const char *pattern); #ifdef __cplusplus } #endif - +/** @} */ #endif /* !_FNMATCH_H_ */ diff --git a/include/apr_md5.h b/include/apr_md5.h index 11ea222ab3f..fa9b1b9ae89 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -91,9 +91,15 @@ #ifdef __cplusplus extern "C" { #endif +/** + * @file apr_md5.h + * @brief APR MD5 Routines + */ /** - * @package APR MD5 Library + * @defgroup APR_MD5 MD5 Routines + * @ingroup APR + * @{ */ #define MD5_DIGESTSIZE 16 @@ -117,7 +123,6 @@ struct apr_md5_ctx_t { /** * MD5 Initialize. Begins an MD5 operation, writing a new context. * @param context The MD5 context to initialize. - * @deffunc apr_status_t apr_md5_init(apr_md5_ctx_t *context) */ APR_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context); @@ -126,7 +131,6 @@ APR_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context); * for translating the content before calculating the digest. * @param context The MD5 content to set the translation for. * @param xlate The translation handle to use for this MD5 context - * @deffunc apr_status_t apr_md5_set_xlate(apr_md5_ctx_t *context, apr_xlate_t *xlate) */ #if APR_HAS_XLATE APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context, @@ -141,7 +145,6 @@ APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context, * @param context The MD5 content to update. * @param input next message block to update * @param inputLen The length of the next message block - * @deffunc apr_status_t apr_md5_update(apr_md5_ctx_t *context, apr_size_t char *input, unsigned int inputLen) */ APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context, const unsigned char *input, @@ -152,7 +155,6 @@ APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context, * message digest and zeroing the context * @param digest The final MD5 digest * @param context The MD5 content we are finalizing. - * @deffunc apr_status_t apr_md5_final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context) */ APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context); @@ -162,7 +164,6 @@ APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE], * @param digest The final MD5 digest * @param input The message block to use * @param inputLen The length of the message block - * @deffunc apr_status_t apr_md5(unsigned char digest[MD5_DIGESTSIZE], const unsigned char *input, apr_size_t size); */ APR_DECLARE(apr_status_t) apr_md5(unsigned char digest[MD5_DIGESTSIZE], const unsigned char *input, @@ -174,11 +175,11 @@ APR_DECLARE(apr_status_t) apr_md5(unsigned char digest[MD5_DIGESTSIZE], * @param salt The salt to use for the encoding * @param result The string to store the encoded password in * @param nbytes The length of the string - * @deffunc apr_status_t apr_md5_encode(const char *password, const char *salt, char *result, size_t nbytes) */ APR_DECLARE(apr_status_t) apr_md5_encode(const char *password, const char *salt, char *result, size_t nbytes); +/** @} */ #ifdef __cplusplus } #endif diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 05800a70174..40fa8557cf7 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -54,9 +54,14 @@ #ifndef APR_NETWORK_IO_H #define APR_NETWORK_IO_H - /** - * @package APR Network library + * @file apr_network_io.h + * @brief APR Network library + */ +/** + * @defgroup APR_Net Network Routines + * @ingroup APR + * @{ */ #include "apr.h" @@ -85,7 +90,10 @@ extern "C" { #define APR_ANYADDR "0.0.0.0" #endif -/* Socket option definitions */ +/** + * @defgroup Sock_opt Socket option definitions + * @{ + */ #define APR_SO_LINGER 1 #define APR_SO_KEEPALIVE 2 #define APR_SO_DEBUG 4 @@ -97,13 +105,13 @@ extern "C" { #define APR_SO_DISCONNECTED 256 #define APR_TCP_NODELAY 512 #define APR_TCP_NOPUSH 1024 -#define APR_RESET_NODELAY 2048 /* This flag is ONLY set internally +#define APR_RESET_NODELAY 2048 /**< This flag is ONLY set internally * when we set APR_TCP_NOPUSH with * APR_TCP_NODELAY set to tell us that * APR_TCP_NODELAY should be turned on * again when NOPUSH is turned off */ -#define APR_INCOMPLETE_READ 4096 /* Set on non-blocking sockets +#define APR_INCOMPLETE_READ 4096 /**< Set on non-blocking sockets * (APR_SO_TIMEOUT != 0) on which the * previous read() did not fill a buffer * completely. the next apr_recv() will @@ -121,23 +129,30 @@ extern "C" { #define APR_POLLERR 0x010 #define APR_POLLHUP 0x020 #define APR_POLLNVAL 0x040 +/** @} */ typedef enum {APR_SHUTDOWN_READ, APR_SHUTDOWN_WRITE, APR_SHUTDOWN_READWRITE} apr_shutdown_how_e; -/* We need to make sure we always have an in_addr type, so APR will just +#if (!APR_HAVE_IN_ADDR) +/** + * We need to make sure we always have an in_addr type, so APR will just * define it ourselves, if the platform doesn't provide it. */ -#if (!APR_HAVE_IN_ADDR) struct in_addr { - apr_uint32_t s_addr; + apr_uint32_t s_addr; /**< storage to hold the IP# */ } #endif -/* Not all platforms have these defined, so we'll define them here +/** + * @def APR_INET + * Not all platforms have these defined, so we'll define them here * The default values come from FreeBSD 4.1.1 */ #define APR_INET AF_INET +/** @def APR_UNSPEC + * Let the system decide which address family to use + */ #ifdef AF_UNSPEC #define APR_UNSPEC AF_UNSPEC #else @@ -147,7 +162,9 @@ struct in_addr { #define APR_INET6 AF_INET6 #endif -/* Enum to tell us if we're interested in remote or local socket */ +/** + * Enum to tell us if we're interested in remote or local socket + */ typedef enum { APR_LOCAL, APR_REMOTE @@ -160,25 +177,31 @@ typedef enum { #if APR_HAVE_INET_ADDR #define apr_inet_addr inet_addr #elif APR_HAVE_INET_NETWORK /* only DGUX, as far as I know */ -/* not generally safe... inet_network() and inet_addr() perform +/** + * @warning + * not generally safe... inet_network() and inet_addr() perform * different functions */ #define apr_inet_addr inet_network #endif typedef struct apr_socket_t apr_socket_t; typedef struct apr_pollfd_t apr_pollfd_t; +/** + * A structure to encapsulate headers and trailers for apr_sendfile + */ typedef struct apr_hdtr_t apr_hdtr_t; typedef struct in_addr apr_in_addr_t; -/* use apr_uint16_t just in case some system has a short that isn't 16 bits... */ +/** @remark use apr_uint16_t just in case some system has a short that isn't 16 bits... */ typedef apr_uint16_t apr_port_t; /* It's defined here as I think it should all be platform safe... */ -typedef struct apr_sockaddr_t apr_sockaddr_t; /** * APRs socket address type, used to ensure protocol independence */ +typedef struct apr_sockaddr_t apr_sockaddr_t; + struct apr_sockaddr_t { /** The pool to use... */ apr_pool_t *pool; @@ -253,7 +276,6 @@ struct apr_ipsubnet_t { * @param family The address family of the socket (e.g., APR_INET). * @param type The type of the socket (e.g., SOCK_STREAM). * @param cont The pool to use - * @deffunc apr_status_t apr_socket_create(apr_socket_t **new_sock, int family, int type, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, int family, int type, @@ -268,8 +290,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, * APR_SHUTDOWN_WRITE no longer allow write requests * APR_SHUTDOWN_READWRITE no longer allow read or write requests * - * @deffunc apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) - * @tip This does not actually close the socket descriptor, it just + * @remark This does not actually close the socket descriptor, it just * controls which calls are still valid on the socket. */ APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, @@ -278,7 +299,6 @@ APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, /** * Close a tcp socket. * @param thesocket The socket to close - * @deffunc apr_status_t apr_socket_close(apr_socket_t *thesocket) */ APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket); @@ -286,9 +306,8 @@ APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket); * Bind the socket to its associated port * @param sock The socket to bind * @param sa The socket address to bind to - * @tip This may be where we will find out if there is any other process + * @remark This may be where we will find out if there is any other process * using the selected port. - * @deffunc apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) */ APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa); @@ -298,7 +317,6 @@ APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa); * @param backlog The number of outstanding connections allowed in the sockets * listen queue. If this value is less than zero, the listen * queue size is set to zero. - * @deffunc apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) */ APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog); @@ -309,7 +327,6 @@ APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog); * be used for all future communication. * @param sock The socket we are listening on. * @param connection_pool The pool for the new socket. - * @deffunc apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, apr_pool_t *connection_pool) */ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, @@ -322,7 +339,6 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new_sock, * @param sa The address of the machine we wish to connect to. If NULL, * APR assumes that the sockaddr_in in the apr_socket is * completely filled out. - * @deffunc apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) */ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa); @@ -335,7 +351,6 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa); * @param port The port number. * @param flags Special processing flags. * @param p The pool for the apr_sockaddr_t and associated storage. - * @deffunc apr_status_t apr_sockaddr_info_get(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p) */ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, const char *hostname, @@ -349,7 +364,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, * @param hostname The hostname. * @param sa The apr_sockaddr_t. * @param flags Special processing flags. - * @deffunc apr_status_t apr_getnameinfo(char **hostname, apr_sockaddr_t *sa, apr_int32_t flags) */ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, apr_sockaddr_t *sa, @@ -378,10 +392,10 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, * specified. * @param str The input string to be parsed. * @param p The pool from which *addr and *scope_id are allocated. - * @tip If scope id shouldn't be allowed, check for scope_id != NULL in addition - * to checking the return code. If addr/hostname should be required, check - * for addr == NULL in addition to checking the return code. - * @deffunc apr_status_t apr_parse_addr_port(char **addr, char **scope_id, apr_port_t *port, const char *str, apr_pool_t *p) + * @remark If scope id shouldn't be allowed, check for scope_id != NULL in + * addition to checking the return code. If addr/hostname should be + * required, check for addr == NULL in addition to checking the + * return code. */ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, char **scope_id, @@ -395,7 +409,6 @@ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, * @param len The maximum length of the hostname that can be stored in the * buffer provided. * @param cont The pool to use. - * @deffunc apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont); @@ -404,7 +417,6 @@ APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont); * @param data The user data associated with the socket. * @param key The key to associate with the user data. * @param sock The currently open socket. - * @deffunc apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *sock) */ APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, apr_socket_t *sock); @@ -415,7 +427,6 @@ APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, * @param data The user data to associate with the socket. * @param key The key to associate with the data. * @param cleanup The cleanup to call when the socket is destroyed. - * @deffunc apr_status_t apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup)(void*)) */ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, @@ -427,8 +438,7 @@ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, * @param buf The buffer which contains the data to be sent. * @param len On entry, the number of bytes to send; on exit, the number * of bytes sent. - * @deffunc apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) - * @tip + * @remark *

      * This functions acts like a blocking write by default.  To change 
      * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option.
    @@ -447,8 +457,7 @@ APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf,
      * @param vec The array of iovec structs containing the data to send 
      * @param nvec The number of iovec structs in the array
      * @param len Receives the number of bytes actually written
    - * @deffunc apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len)
    - * @tip
    + * @remark
      * 
      * This functions acts like a blocking write by default.  To change 
      * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option.
    @@ -497,10 +506,9 @@ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock,
      *            (output) - Number of bytes actually sent, 
      *                       including headers, file, and trailers
      * @param flags APR flags that are mapped to OS specific flags
    - * @deffunc apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags)
    - * @tip This functions acts like a blocking write by default.  To change 
    - *      this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option.
    - *      The number of bytes actually sent is stored in argument 5.
    + * @remark This functions acts like a blocking write by default.  To change 
    + *         this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option.
    + *         The number of bytes actually sent is stored in argument 5.
      */
     APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file,
                                            apr_hdtr_t *hdtr, apr_off_t *offset,
    @@ -514,8 +522,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file,
      * @param buf The buffer to store the data in. 
      * @param len On entry, the number of bytes to receive; on exit, the number
      *            of bytes received.
    - * @deffunc apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
    - * @tip
    + * @remark
      * 
      * This functions acts like a blocking read by default.  To change 
      * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option.
    @@ -549,7 +556,6 @@ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock,
      *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
      * 
    * @param on Value for the option. - * @deffunc apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) */ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on); @@ -575,7 +581,6 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, * (Currently only used on Windows) *
    * @param on Socket option returned on the call. - * @deffunc apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) */ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on); @@ -585,7 +590,6 @@ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, * @param sa The returned apr_sockaddr_t. * @param which Which interface do we want the apr_sockaddr_t for? * @param sock The socket to use - * @deffunc apr_status_t apr_socket_addr_get(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock) */ APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, apr_interface_e which, @@ -595,7 +599,6 @@ APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, * Set the port in an APR socket address. * @param sockaddr The socket address to set. * @param port The port to be stored in the socket address. - * @deffunc apr_status_t apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, apr_port_t port) */ APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, apr_port_t port); @@ -604,7 +607,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, * Return the port in an APR socket address. * @param port The port from the socket address. * @param sockaddr The socket address to reference. - * @deffunc apr_status_t apr_sockaddr_port_get(apr_port_t *port, apr_sockaddr_t *sockaddr) */ APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, apr_sockaddr_t *sockaddr); @@ -614,7 +616,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, * @param sockaddr The socket address to use * @param addr The IP address to attach to the socket. * Use APR_ANYADDR to use any IP addr on the machine. - * @deffunc apr_status_t apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, const char *addr) */ APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, const char *addr); @@ -624,7 +625,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, * an APR socket address. * @param addr The IP address. * @param sockaddr The socket address to reference. - * @deffunc apr_status_t apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr) */ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr); @@ -634,7 +634,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, * @param new_poll The poll structure to be used. * @param num The number of socket descriptors to be polled. * @param cont The pool to operate on. - * @deffunc apr_status_t apr_poll_setup(apr_pollfd_t **new_poll, apr_int32_t num, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new_poll, apr_int32_t num, @@ -648,14 +647,13 @@ APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new_poll, * a maximum, not a minimum. If a socket is signalled, we * will wake up before this time. A negative number means * wait until a socket is signalled. - * @tip + * @remark *
      * The number of sockets signalled is returned in the second argument. 
      *
      *        This is a blocking call, and it will not return until either a 
      *        socket has been signalled, or the timeout has expired. 
      * 
    - * @deffunc apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_interval_time_t timeout) */ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_interval_time_t timeout); @@ -670,7 +668,6 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, * APR_POLLPRI signal if prioirty data is availble to be read * APR_POLLOUT signal if write will not block *
    - * @deffunc apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) */ APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, @@ -686,7 +683,6 @@ APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, * APR_POLLPRI signal if prioirty data is availble to be read * APR_POLLOUT signal if write will not block * - * @deffunc apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) */ APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, @@ -695,7 +691,6 @@ APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, * Remove a socket from the poll structure. * @param aprset The poll structure we will be using. * @param sock The socket to remove from the current poll structure. - * @deffunc apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) */ APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock); @@ -709,7 +704,6 @@ APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, * APR_POLLPRI signal if prioirty data is availble to be read * APR_POLLOUT signal if write will not block * - * @deffunc apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) */ APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events); @@ -728,7 +722,6 @@ APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, * * @param sock The socket we wish to get information about. * @param aprset The poll structure we will be using. - * @deffunc apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) */ APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, @@ -739,7 +732,6 @@ APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, * @param pollfd The currently open pollfd. * @param key The key to use for retreiving data associated with a poll struct. * @param data The user data associated with the pollfd. - * @deffunc apr_status_t apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) */ APR_DECLARE(apr_status_t) apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data); @@ -750,7 +742,6 @@ APR_DECLARE(apr_status_t) apr_poll_data_get(apr_pollfd_t *pollfd, * @param data The key to associate with the data. * @param key The user data to associate with the pollfd. * @param cleanup The cleanup function - * @deffunc apr_status_t apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup)(void *)) */ APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, @@ -762,7 +753,6 @@ APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data, * Convert a File type to a socket so that it can be used in a poll operation. * @param newsock the newly created socket which represents a file. * @param file the file to mask as a socket. - * @deffunc apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file) * @warning This is not available on all platforms. Platforms that have the * ability to poll files for data to be read/written/exceptions will * have the APR_FILES_AS_SOCKETS macro defined as true. @@ -776,7 +766,6 @@ APR_DECLARE(apr_status_t) apr_socket_from_file(apr_socket_t **newsock, * Given an apr_sockaddr_t and a service name, set the port for the service * @param sockaddr The apr_sockaddr_t that will have it's port set * @param servname The name of the service you wish to use - * @deffunc apr_status_t apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname) */ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname); @@ -816,20 +805,18 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, /** * Set a socket to be inherited by child processes. * @param socket The socket to enable inheritance. - * @deffunc void apr_socket_set_inherit(apr_socket_t *socket) */ APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *skt); /** * Unset a socket from being inherited by child processes. * @param socket The socket to disable inheritance. - * @deffunc void apr_socket_unset_inherit(apr_socket_t *socket) */ APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *skt); #ifdef __cplusplus } #endif - +/** @} */ #endif /* ! APR_NETWORK_IO_H */ diff --git a/include/apr_uuid.h b/include/apr_uuid.h index 988ac970087..4185536972b 100644 --- a/include/apr_uuid.h +++ b/include/apr_uuid.h @@ -52,6 +52,10 @@ * . */ +/** + * @file apr_uuid.h + * @brief routines that maninpulate UUID's + */ #ifndef APR_UUID_H #define APR_UUID_H @@ -63,12 +67,17 @@ extern "C" { #endif /* __cplusplus */ /** - * @package APR UUID Handling + * @defgroup APR_UUID UUID Handling + * @ingroup APR + * @{ + */ + +/** + * we represent a UUID as a block of 16 bytes. */ -/* we represent a UUID as a block of 16 bytes. */ typedef struct { - unsigned char data[16]; + unsigned char data[16]; /**< the actual UUID */ } apr_uuid_t; /* UUIDs are formatted as: 00112233-4455-6677-8899-AABBCCDDEEFF */ @@ -78,7 +87,6 @@ typedef struct { /** * Generate and return a (new) UUID * @param uuid The resulting UUID - * @deffunc void apr_uuid_get(apr_uuid_t *uuid) */ APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid); @@ -88,7 +96,6 @@ APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid); * be at least APR_UUID_FORMATTED_LENGTH + 1 bytes long to hold * the formatted UUID and a null terminator * @param uuid The UUID to format - * @deffunc void apr_uuid_format(char *buffer, const apr_uuid_t *uuid) */ APR_DECLARE(void) apr_uuid_format(char *buffer, const apr_uuid_t *uuid); @@ -96,10 +103,10 @@ APR_DECLARE(void) apr_uuid_format(char *buffer, const apr_uuid_t *uuid); * Parse a standard-format string into a UUID * @param uuid The resulting UUID * @param uuid_str The formatted UUID - * @deffunc apr_status_t apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str) */ APR_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str); +/** @} */ #ifdef __cplusplus } #endif From 60f205ac15c1c570e80ea6f00ed55c82c7d82d8e Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 12 Aug 2001 13:13:55 +0000 Subject: [PATCH 2151/7878] Peter Moore reported this small typo... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62148 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/beos/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shmem/beos/shmem.c b/shmem/beos/shmem.c index abca8be2d83..740b44bf9f8 100644 --- a/shmem/beos/shmem.c +++ b/shmem/beos/shmem.c @@ -242,7 +242,7 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(struct shmem_t *m) return APR_SUCCESS; } -APR_DEClARE(void *) apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize) +APR_DECLARE(void *) apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize) { struct block_t *b; if ((b = alloc_block(m, reqsize)) != NULL) From 946ff0cc04109af41689086cece5523ba7202497 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 12 Aug 2001 16:02:01 +0000 Subject: [PATCH 2152/7878] Ian reports that I missed this line. :-) Submitted by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62149 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 08a9523e9a6..b6cbaaf67d5 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -113,6 +113,7 @@ extern "C" { #define APR_SET SEEK_SET #define APR_CUR SEEK_CUR #define APR_END SEEK_END +/** @} */ /** should be same as whence type in lseek, POSIX defines this as int */ typedef int apr_seek_where_t; From d29c76b57dfa74e6c6601fae05db554d31ff82a1 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 12 Aug 2001 16:10:43 +0000 Subject: [PATCH 2153/7878] Accidentally remove the pool accessor. Submitted by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62150 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index b6cbaaf67d5..d15f47fef95 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -560,6 +560,13 @@ APR_DECLARE(apr_int32_t) apr_file_flags_get(apr_file_t *f); * Get the pool used by the file. * @return apr_pool_t the pool */ +APR_POOL_DECLARE_ACCESSOR(file); + +/** + * Set a file to be inherited by child processes. + * @param file The file to enable inheritance. + * + */ APR_DECLARE(void) apr_file_set_inherit(apr_file_t *file); /** From ef9841ac34ed1afc31da7117b199e32b3eb4b79b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 13 Aug 2001 02:13:28 +0000 Subject: [PATCH 2154/7878] Ignore the dox directory git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62151 13f79535-47bb-0310-9956-ffa450edef68 --- docs/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/.cvsignore b/docs/.cvsignore index 2d19fc766d9..84a7a796ddd 100644 --- a/docs/.cvsignore +++ b/docs/.cvsignore @@ -1 +1,2 @@ *.html +dox From 9629c2166531cceb2ba24ed2ce445fa0d744058d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 13 Aug 2001 04:20:19 +0000 Subject: [PATCH 2155/7878] Make all APR pools be allocated out of the permanent pool. This brings APR pools back to a tree structure. There are no longer any way to create a pool that is not a decendant of the permanent_pool. PR: 7891 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62152 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ include/apr_pools.h | 1 - memory/unix/apr_pools.c | 7 +++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index dccb099d197..5d8100684ca 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Make all APR pools be allocated out of the permanent pool. + This brings APR pools back to a tree structure. There are + no longer any way to create a pool that is not a decendant + of the permanent_pool. [Ryan Bloom] + *) Wrap all functions in APR_DECLARE macro. [Sterling Hughes ] diff --git a/include/apr_pools.h b/include/apr_pools.h index 2affa3a7898..d32b76cfeda 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -447,7 +447,6 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); # define apr_pool_join(a,b) #endif /* APR_POOL_DEBUG */ - #ifdef APR_POOLS_ARE_SMS /* Add a number of defines where the sms equivalent is 1 to 1 */ #define apr_pool_get_abort(p) apr_sms_get_abort(p) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 112ced993c9..c03f6c45948 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -658,10 +658,12 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, apr_pool_t *parent_pool) { apr_abortfunc_t abortfunc; + apr_pool_t *ppool; abortfunc = parent_pool ? parent_pool->apr_abort : NULL; + ppool = parent_pool ? parent_pool : permanent_pool; - apr_pool_sub_make(newpool, parent_pool, abortfunc); + apr_pool_sub_make(newpool, ppool, abortfunc); if (*newpool == NULL) { return APR_ENOPOOL; } @@ -834,7 +836,7 @@ APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *globalp) return status; } #endif - apr_pool_sub_make(&permanent_pool, globalp, NULL); + permanent_pool = globalp; #ifdef ALLOC_STATS atexit(dump_stats); @@ -1488,3 +1490,4 @@ static void free_proc_chain(struct process_chain *procs) } } } + From 9d003ac661e8481e84ee793b176b098a4aba9798 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 13 Aug 2001 13:22:30 +0000 Subject: [PATCH 2156/7878] Get apr_file_lock and apr_file_unlock working on Win9x. Not tested. Submitted by: Mladen Turk Reviewed by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62153 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ file_io/win32/flock.c | 29 +++++++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 5d8100684ca..f6661a284ee 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ Changes with APR b1 + *) Get apr_lock_file and apr_unlock_file working on Windows 9x. + [Mladen Turk, Bill Stoddard] *) Make all APR pools be allocated out of the permanent pool. This brings APR pools back to a tree structure. There are diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index 9e580300b12..d3bbe1da88a 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -56,6 +56,7 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) { + apr_oslevel_e level; OVERLAPPED offset; DWORD flags, len = 0xffffffff; @@ -68,22 +69,38 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) * the lock; something needs to be done so an APR app can * recognize this as a try-again situation */ - /* Syntax is correct, len is passed for LengthLow and LengthHigh*/ - if (!LockFileEx(thefile->filehand, flags, 0, len, len, &offset)) - return apr_get_os_error(); + apr_get_oslevel(NULL, &level); + if (level >= APR_WIN_NT) { + /* Syntax is correct, len is passed for LengthLow and LengthHigh*/ + if (!LockFileEx(thefile->filehand, flags, 0, len, len, &offset)) + return apr_get_os_error(); + } + else { + if (!LockFile(thefile->filehand, 0, 0, len, 0)) + return apr_get_os_error(); + } return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) { + apr_oslevel_e level; OVERLAPPED offset; DWORD len = 0xffffffff; memset (&offset, 0, sizeof(offset)); - /* Syntax is correct, len is passed for LengthLow and LengthHigh*/ - if (!UnlockFileEx(thefile->filehand, 0, len, len, &offset)) - return apr_get_os_error(); + + apr_get_oslevel(NULL, &level); + if (level >= APR_WIN_NT) { + /* Syntax is correct, len is passed for LengthLow and LengthHigh*/ + if (!UnlockFileEx(thefile->filehand, 0, len, len, &offset)) + return apr_get_os_error(); + } + else { + if (!UnlockFile(thefile->filehand, 0, 0, len, 0)) + return apr_get_os_error(); + } return APR_SUCCESS; } From 71d6a34101fa8f9c36477ff7892b476ce1c08b59 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 13 Aug 2001 20:04:28 +0000 Subject: [PATCH 2157/7878] LINK shouldn't include ALL_LIBS; that puts -lm -lcrypt -lwhatever before -o target, which some link commands can't handle; also, it left us with a lot of duplicate libraries on link invocations since our Makefiles specify the libraries to include too git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62154 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 9e79b989ca8..73881413380 100644 --- a/configure.in +++ b/configure.in @@ -111,7 +111,7 @@ AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the if test "x$use_libtool" = "xyes"; then lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -c $< && touch $@' - link='$(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(ALL_LDFLAGS) $(ALL_LIBS) -o $@' + link='$(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(ALL_LDFLAGS) -o $@' so_ext='lo' lib_target='-rpath $(libdir) $$objects' export_lib_target='-rpath \$(libdir) \$\$objects' From 713c148881b8aa90881a55bd0ecaa8a03ba06405 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 13 Aug 2001 21:49:08 +0000 Subject: [PATCH 2158/7878] Move the necessary shared memory code from MM into APR and remove our dependency upon MM. (This commit does not delete the MM files - they are still there for the time being.) MM has a bunch of features that we do not need (locking, three different APIs, etc, etc, etc.) Also clean up the migrated code while I'm at it to be cleaner. This code works on Solaris with shmget. I'll be testing it again with Linux in a few. This really needs to get hammered to make sure that I didn't miss anything. This gets us moving in the right direction. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62155 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 + acconfig.h | 1 + configure.in | 162 ++++++++++++++++-------------- include/apr.h.in | 6 ++ shmem/unix/Makefile.in | 14 +-- shmem/unix/shmem.c | 222 ++++++++++++++++++++++++++++++++++------- test/Makefile.in | 3 +- test/testshmem.c | 109 +++++++------------- 8 files changed, 320 insertions(+), 201 deletions(-) diff --git a/CHANGES b/CHANGES index f6661a284ee..e22f90b9a22 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR b1 + + *) Move the necessary shared memory code from MM into APR and remove + our dependency upon MM. [Justin Erenkrantz] + *) Get apr_lock_file and apr_unlock_file working on Windows 9x. [Mladen Turk, Bill Stoddard] diff --git a/acconfig.h b/acconfig.h index 22047e54556..3ceb016e0a8 100644 --- a/acconfig.h +++ b/acconfig.h @@ -14,6 +14,7 @@ #undef HAVE_POLLIN #undef HAVE_isascii #undef HAVE_SO_ACCEPTFILTER +#undef HAVE_MAP_ANON /* Cross process serialization techniques */ #undef USE_FLOCK_SERIALIZE diff --git a/configure.in b/configure.in index 73881413380..382086dc0ca 100644 --- a/configure.in +++ b/configure.in @@ -200,13 +200,11 @@ case "$host:$CC" in APR_ADDTO(CFLAGS,-Kthread) ;; esac -LOCAL_MM_LIB="../shmem/unix/mm/libmm.la" config_subdirs="none" +INSTALL_SUBDIRS="none" case $host in i386-ibm-aix* | *-ibm-aix[1-2].* | *-ibm-aix3.* | *-ibm-aix4.1 | *-ibm-aix4.1.* | *-ibm-aix4.2 | *-ibm-aix4.2.*) OSDIR="aix" - config_subdirs="shmem/unix/mm" - USE_MM=yes eolstr="\\n" ;; *-os2*) @@ -214,7 +212,6 @@ case $host in APR_ADDTO(CFLAGS,-Zmt) OSDIR="os2" enable_threads="system_threads" - LOCAL_MM_LIB="" eolstr="\\r\\n" file_as_socket="0" ;; @@ -234,23 +231,19 @@ case $host in file_as_socket="0" ;; esac - LOCAL_MM_LIB="" ;; *os390) OSDIR="os390" - config_subdirs="shmem/unix/mm" - USE_MM=yes eolstr="\\n" ;; *) OSDIR="unix" - config_subdirs="shmem/unix/mm" - USE_MM=yes eolstr="\\n" ;; esac AC_SUBST(eolstr) +AC_SUBST(INSTALL_SUBDIRS) dnl For some platforms we need a version string which allows easy numeric dnl comparisons. @@ -390,73 +383,100 @@ AC_CHECK_FUNCS(getgrgid_r) dnl #----------------------------- Checking for Shared Memory Support echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" -# run the MM config script regardless of whether we are going to use -# it or not. When we have a much better idea of who is using MM, we can -# run this on a more conditional basis. -mm_dir=shmem/unix/mm +AC_HAVE_HEADERS(sys/mman.h) +APR_CHECK_DEFINE(MAP_ANON, sys/mman.h) +AC_HAVE_FUNCS(mmap munmap shm_open shm_unlink) +APR_CHECK_FILE(/dev/zero) +AC_HAVE_HEADERS(sys/ipc.h sys/shm.h sys/file.h) +AC_HAVE_FUNCS(shmget shmat shmdt shmctl) +AC_HAVE_HEADERS(kernel/OS.h) +AC_HAVE_FUNCS(create_area) + +dnl Now we determine which one is our preference. +APR_BEGIN_DECISION([shared memory allocation method]) +APR_IFALLYES(header:sys/mman.h func:mmap func:munmap, + APR_DECIDE(USE_SHMEM_MMAP_TMP, + [Classical mmap() on temporary file])) +APR_IFALLYES(header:sys/mman.h func:mmap func:munmap func:shm_open dnl + func:shm_unlink, + APR_DECIDE(USE_SHMEM_MMAP_SHM, + [mmap() via POSIX.1 shm_open() on temporary file])) +APR_IFALLYES(header:sys/mman.h func:mmap func:munmap file:/dev/zero, + APR_DECIDE(USE_SHMEM_MMAP_ZERO, + [SVR4-style mmap() on /dev/zero])) +APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl + func:shmget func:shmat func:shmdt func:shmctl, + APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()])) +APR_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON, + APR_DECIDE(USE_SHMEM_MMAP_ANON, + [4.4BSD-style mmap() via MAP_ANON])) +APR_IFALLYES(header:kernel/OS.h func:create_area, + APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])) +APR_END_DECISION +AC_DEFINE_UNQUOTED($ac_decision) -dnl #----------------------------- Prepare mm directory for VPATH support -if test "$USE_MM" = "yes"; then - if test -n "$USE_VPATH"; then - test -d $mm_dir || $MKDIR $mm_dir +usemmaptmp="0" +usemmapshm="0" +usemmapzero="0" +useshmget="0" +usemmapanon="0" +usebeosarea="0" +mem_based="0" +file_based="1" - for i in shtool config.guess config.sub fbtool ltconfig \ - ltmain.sh mm_vers.c; do - test -r $mm_dir/$i || ln -s $abs_srcdir/$mm_dir/$i $mm_dir/$i - done - fi - APR_SUBDIR_CONFIG($config_subdirs) -fi +case $ac_decision in + USE_SHMEM_MMAP_TMP ) + usemmaptmp="1" + file_based="1" + ;; + USE_SHMEM_MMAP_SHM ) + usemmapshm="1" + mem_based="1" + ;; + USE_SHMEM_MMAP_ZERO ) + usemmapzero="1" + mem_based="1" + ;; + USE_SHMEM_SHMGET ) + useshmget="1" + mem_based="1" + ;; + USE_SHMEM_MMAP_ANON ) + usemmapanon="1" + mem_based="1" + ;; + USE_SHMEM_BEOS ) + usebeosarea="1" + mem_based="1" + ;; +esac -INSTALL_SUBDIRS=$config_subdirs -AC_SUBST(INSTALL_SUBDIRS) +dnl Do we have any shared memory support? +if test "$usemmaptmp$usemmapshm$usemmapzero$useshmget$usemmapanon$usebeosarea" = "000000"; then + sharedmem="0" +else + sharedmem="1" +fi -AC_MSG_CHECKING(for Shared memory support) -AC_ARG_ENABLE(shmem, - [ --enable-shmem Enable shared memory support in APR. ], - [ ], - ac_cv_enable_shmem="mm" ) +AC_SUBST(usemmaptmp) +AC_SUBST(usemmapshm) +AC_SUBST(usemmapzero) +AC_SUBST(useshmget) +AC_SUBST(usemmapanon) +AC_SUBST(usebeosarea) +AC_SUBST(sharedmem) +AC_SUBST(file_based) +AC_SUBST(mem_based) -sharedmem="0" -anonymous_shm="0" +dnl We only support anonymous shared memory in Unix currently. +anonymous_shm="1" filebased_shm="0" keybased_shm="0" -if test "$ac_cv_enable_shmem" = "mm"; then - sharedmem="1" - anonymous_shm="1" - AC_MSG_RESULT(anonymous) - if test "$USE_MM" = "yes"; then - LIBTOOL_LIBS="$abs_builddir/shmem/unix/mm/libmm.la" - fi -elif test "$ac_cv_enable_shmem" = "file"; then - sharedmem="1" - filebased_shm="1" - AC_MSG_RESULT(file based) -elif test "$ac_cv_enable_shmem" = "key"; then - sharedmem="1" - keybased_shm="1" - AC_MSG_RESULT(key based) -else - AC_MSG_RESULT(no) -fi -AC_SUBST(sharedmem) + AC_SUBST(anonymous_shm) AC_SUBST(filebased_shm) AC_SUBST(keybased_shm) -APR_CHECK_DEFINE(MM_SHMT_MMFILE, $srcdir/shmem/unix/mm/mm_conf.h) - -if test "$ac_cv_define_MM_SHMT_MMFILE" = "yes"; then - file_based="1" - mem_based="0" -else - file_based="0" - mem_based="1" -fi - -AC_SUBST(mem_based) -AC_SUBST(file_based) - if test ".$SYS_SW" = ".AIX"; then APR_ADDTO(CPPFLAGS,-U__STR__) case "$SYS_KV" in @@ -1306,7 +1326,6 @@ AC_SUBST(OSDIR) AC_SUBST(DEFAULT_OSDIR) AC_SUBST(EXEEXT) AC_SUBST(LIBTOOL_LIBS) -AC_SUBST(LOCAL_MM_LIB) echo "${nl}Construct Makefiles and header files." MAKEFILE1="Makefile strings/Makefile passwd/Makefile tables/Makefile build/Makefile" @@ -1376,9 +1395,6 @@ dnl #----------------------------- Fixup Makefiles for VPATH support changequote({,}) if test -n "$USE_VPATH"; then - if test -n "$USE_MM"; then - MAKEFILE3="$MAKEFILE3 $mm_dir/Makefile" - fi for makefile in $MAKEFILE1 $MAKEFILE2 $MAKEFILE3; do dir=`echo $makefile|sed 's%[^/][^/]*$%%'` (cat < tmp cp tmp $makefile done - if test -n "$USE_MM"; then - cat $mm_dir/Makefile | \ - sed \ - -e 's#\($(CFLAGS)\)#\1 -I$(srcdir) -I.#' \ - -e '/mm_global\.c/d' \ - > tmp - cp tmp $mm_dir/Makefile - fi rm -f tmp fi diff --git a/include/apr.h.in b/include/apr.h.in index c385a3b62c3..8c3c2ae5922 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -62,6 +62,12 @@ #define APR_HAVE_SYS_WAIT_H @sys_waith@ #define APR_HAVE_UNISTD_H @unistdh@ +#define APR_USE_SHMEM_MMAP_TMP @usemmaptmp@ +#define APR_USE_SHMEM_MMAP_SHM @usemmapshm@ +#define APR_USE_SHMEM_MMAP_ZERO @usemmapzero@ +#define APR_USE_SHMEM_SHMGET @useshmget@ +#define APR_USE_SHMEM_BEOS @usebeosarea@ + #define APR_USE_FLOCK_SERIALIZE @flockser@ #define APR_USE_SYSVSEM_SERIALIZE @sysvser@ #define APR_USE_FCNTL_SERIALIZE @fcntlser@ diff --git a/shmem/unix/Makefile.in b/shmem/unix/Makefile.in index dc4cdf0fb63..7b8e9622322 100644 --- a/shmem/unix/Makefile.in +++ b/shmem/unix/Makefile.in @@ -1,20 +1,10 @@ -TARGETS = shmem.lo build-mm +TARGETS = shmem.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ INCDIR=../../include -INCDIR1=mm -INCLUDES=-I$(INCDIR) -I$(INCDIR1) - -x-local-clean: - (cd mm && $(MAKE) clean) - -x-local-distclean: - (cd mm && $(MAKE) distclean) - -build-mm: - (cd mm && $(MAKE) libmm.la) +INCLUDES=-I$(INCDIR) # DO NOT REMOVE diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 825929e9c86..0cf2826abf4 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -52,61 +52,199 @@ * . */ -#include "mm.h" #include "apr_general.h" #include "apr_shmem.h" +#include "apr_lock.h" +#include "apr_portable.h" #include "apr_errno.h" +/* + * This is the Unix implementation of shared memory. + * + * Currently, this code supports the following shared memory techniques: + * + * - mmap on a temporary file + * - mmap/shm_open on a temporary file (POSIX.1) + * - mmap with MAP_ANON (4.4BSD) + * - mmap /dev/zero (SVR4) + * - shmget (SysV) + * - create_area (BeOS) + */ + +#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_MMAP_ANON +#include +#elif APR_USE_SHMEM_SHMGET +#include +#include +#include +#elif APR_USE_SHMEM_BEOS +#include +#endif + struct shmem_t { - MM *mm; + void *mem; + void *curmem; + apr_size_t length; + apr_lock_t *lock; + char *filename; +#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO + apr_file_t *file; +#elif APR_USE_SHMEM_MMAP_ANON + /* Nothing else. */ +#elif APR_USE_SHMEM_SHMGET + apr_os_file_t file; +#elif APR_USE_SHMEM_BEOS + area_id areaid; +#endif }; -APR_DECLARE(apr_status_t) apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, + const char *filename, apr_pool_t *pool) { - MM *newmm = mm_create(reqsize + sizeof(**m), file, MM_ALLOCATE_ENOUGH); - if (newmm == NULL) { - return errno; - } - (*m) = mm_malloc(newmm, sizeof(struct shmem_t)); - /* important to check this; we may be locking a lock file for the first - * time, which won't work if the file is on NFS - */ - if (!*m) { - return errno; + apr_shmem_t *new_m; + int tmpfd; + void *mem; + +#if APR_USE_SHMEM_SHMGET + struct shmid_ds shmbuf; +#else + apr_status_t stat; +#endif + + new_m = apr_palloc(pool, sizeof(apr_shmem_t)); + if (!new_m) + return APR_ENOMEM; + +/* These implementations are very similar except for opening the file. */ +#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO + /* FIXME: Ignore error for now. * + *stat = apr_file_remove(filename, pool);*/ + +#if APR_USE_SHMEM_MMAP_TMP + /* FIXME: Is APR_OS_DEFAULT sufficient? */ + stat = apr_file_open(new_m->file, filename, + APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, + pool); + if (stat != APR_SUCCESS) + return APR_EGENERAL; + + tmpfd = apr_os_file_get(&tmpfd, new_m->file); + stat = apr_file_trunc(new_m->file, reqsize); + if (stat != APR_SUCCESS) + return APR_EGENERAL; + +#elif APR_USE_SHMEM_MMAP_SHM + /* FIXME: Is APR_OS_DEFAULT sufficient? */ + tmpfd = shm_open(filename, O_RDWR | O_CREAT, APR_OS_DEFAULT); + if (tmpfd == -1) + return errno + APR_OS_START_SYSERR; + + apr_os_file_put(new_m->file, &tmpfd, pool); + stat = apr_file_trunc(new_m->file, reqsize); + if (stat != APR_SUCCESS) + { + shm_unlink(filename); + return APR_EGENERAL; } - (*m)->mm = newmm; +#elif APR_USE_SHMEM_MMAP_ZERO + stat = apr_file_open(new_m->file, "/dev/zero", APR_READ | APR_WRITE, + APR_OS_DEFAULT); + if (stat != APR_SUCCESS) + return APR_EGENERAL; + tmpfd = apr_os_file_get(&tmpfd, new_m->file); +#endif + + mem = mmap(NULL, reqsize, PROT_READ|PROT_WRITE, MAP_SHARED, tmpfd, 0); + +#elif APR_USE_SHMEM_MMAP_ANON + mem = mmap(NULL, reqsize, PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0); +#elif APR_USE_SHMEM_SHMGET + tmpfd = shmget(IPC_PRIVATE, reqsize, (SHM_R|SHM_W|IPC_CREAT)); + if (tmpfd == -1) + return errno + APR_OS_START_SYSERR; + + new_m->file = tmpfd; + + mem = shmat(new_m->file, NULL, 0); + + /* FIXME: Handle errors. */ + if (shmctl(new_m->file, IPC_STAT, &shmbuf) == -1) + return errno + APR_OS_START_SYSERR; + + apr_current_userid(&shmbuf.shm_perm.uid, &shmbuf.shm_perm.gid, pool); + + if (shmctl(new_m->file, IPC_SET, &shmbuf) == -1) + return errno + APR_OS_START_SYSERR; + +#elif APR_USE_SHMEM_BEOS + new_m->area_id = create_area("mm", (void*)&mem, B_ANY_ADDRESS, reqsize, + B_LAZY_LOCK, B_READ_AREA|B_WRITE_AREA); + /* FIXME: error code? */ + if (new_m->area_id < 0) + return APR_EGENERAL; + +#endif + + new_m->mem = mem; + new_m->curmem = mem; + new_m->length = reqsize; + + apr_lock_create(&new_m->lock, APR_MUTEX, APR_CROSS_PROCESS, NULL, pool); + if (!new_m->lock) + return APR_EGENERAL; + + *m = new_m; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_destroy(struct shmem_t *m) +APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m) { - mm_destroy(m->mm); +#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO + munmap(m->mem); + apr_file_close(m->file); +#elif APR_USE_SHMEM_MMAP_ANON + munmap(m->mem); +#elif APR_USE_SHMEM_SHMGET + shmdt(m->mem); +#elif APR_USE_SHMEM_BEOS + delete_area(new_m->area_id); +#endif + return APR_SUCCESS; } -APR_DECLARE(void *) apr_shm_malloc(struct shmem_t *c, apr_size_t reqsize) +APR_DECLARE(void *) apr_shm_malloc(apr_shmem_t *m, apr_size_t reqsize) { - if (c->mm == NULL) { - return NULL; + void *new; + new = NULL; + + apr_lock_acquire(m->lock); + /* Do we have enough space? */ + if ((m->curmem - m->mem + reqsize) <= m->length) + { + new = m->curmem; + m->curmem += reqsize; } - return mm_malloc(c->mm, reqsize); + apr_lock_release(m->lock); + return new; } -APR_DECLARE(void *) apr_shm_calloc(struct shmem_t *shared, apr_size_t size) +APR_DECLARE(void *) apr_shm_calloc(apr_shmem_t *m, apr_size_t reqsize) { - if (shared == NULL) { - return NULL; - } - return mm_calloc(shared->mm, 1, size); + void *new = apr_shm_malloc(m, reqsize); + memset(new, '\0', reqsize); + return new; } -APR_DECLARE(apr_status_t) apr_shm_free(struct shmem_t *shared, void *entity) +APR_DECLARE(apr_status_t) apr_shm_free(apr_shmem_t *shared, void *entity) { - mm_free(shared->mm, entity); + /* Without a memory management scheme within our shared memory, it + * is impossible to implement free. */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) +APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, + apr_shm_name_t **name) { #if APR_USES_ANONYMOUS_SHM *name = NULL; @@ -121,7 +259,8 @@ APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name #endif } -APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) +APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, + apr_shm_name_t *name) { #if APR_USES_ANONYMOUS_SHM return APR_ANONYMOUS; @@ -135,12 +274,12 @@ APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) #endif } -APR_DECLARE(apr_status_t) apr_shm_open(struct shmem_t *c) +APR_DECLARE(apr_status_t) apr_shm_open(apr_shmem_t *c) { #if APR_USES_ANONYMOUS_SHM -/* When using MM, we don't need to open shared memory segments in child - * segments, so just return immediately. +/* we don't need to open shared memory segments in child segments, so + * just return immediately. */ return APR_SUCCESS; /* Currently, we are not supporting name based shared memory on Unix @@ -153,11 +292,18 @@ APR_DECLARE(apr_status_t) apr_shm_open(struct shmem_t *c) #endif } -APR_DECLARE(apr_status_t) apr_shm_avail(struct shmem_t *c, apr_size_t *size) +APR_DECLARE(apr_status_t) apr_shm_avail(apr_shmem_t *m, apr_size_t *size) { - *size = mm_available(c); - if (*size == 0) { - return APR_ENOSHMAVAIL; - } - return APR_SUCCESS; + apr_status_t stat; + + stat = APR_ENOSHMAVAIL; + + apr_lock_acquire(m->lock); + + *size = m->length - (m->curmem - m->mem); + if (*size) + stat = APR_SUCCESS; + + apr_lock_release(m->lock); + return stat; } diff --git a/test/Makefile.in b/test/Makefile.in index 2eb90b6804b..3e97ad5e3a2 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -35,8 +35,7 @@ TARGETS = $(PROGRAMS) # bring in rules.mk for standard functionality @INCLUDE_RULES@ -LOCAL_LIBS=../libapr.la @LOCAL_MM_LIB@ -##../shmem/unix/mm/libmm.la +LOCAL_LIBS=../libapr.la CLEAN_TARGETS = testfile.tmp testdso@EXEEXT@ mod_test.so diff --git a/test/testshmem.c b/test/testshmem.c index 6b685576c54..5c705451c34 100644 --- a/test/testshmem.c +++ b/test/testshmem.c @@ -85,7 +85,7 @@ static void msgwait(int boxnum) apr_sleep(0); test = boxes[boxnum].msgavail; } - fprintf(stdout, "\nreceived a message in box %d, message was: %s\n", + fprintf(stdout, "received a message in box %d, message was: %s\n", boxnum, boxes[boxnum].msg); } @@ -145,7 +145,7 @@ int main(void) printf("Smallest allocation will be %" APR_SIZE_T_FMT " bytes\n", psize[0]); printf("Largest allocation will be %" APR_SIZE_T_FMT " bytes\n", - psize[CYCLES -1]); + psize[CYCLES - 1]); printf("I will be doing it in %d steps\n", CYCLES); printf("\tAllocating via apr_shm_malloc..............."); @@ -167,45 +167,35 @@ int main(void) } printf("OK\n"); - printf("\tAllocating via apr_shm_calloc..............."); - for (cntr = CYCLES-1;cntr > -1;cntr--){ - ptrs[cntr] = apr_shm_malloc(shm, psize[cntr]); - if (ptrs[cntr] == NULL){ - printf("Failed at %" APR_SIZE_T_FMT" bytes\n", - psize[cntr]); - exit (-1); - } - } - printf("OK\n\tFreeing....................................."); - for (cntr = 0;cntr < CYCLES;cntr++){ - if (apr_shm_free(shm, ptrs[cntr]) != APR_SUCCESS){ - printf("Failed at step %d, %" APR_SIZE_T_FMT - " bytes\n", cntr, psize[cntr]); - exit (-1); - } - } - printf("OK\n"); - - printf("Checking we have all we should have remaining......."); + printf("\tDetermining how much space is remaining....."); rv = apr_shm_avail(shm, &cksize); if (rv == APR_ENOTIMPL){ - printf("Not Impl.\n"); + printf("Not Impl."); } else { if (rv != APR_SUCCESS){ printf("Failed!\n"); exit (-1); } - if (cksize == (TESTSIZE - size)){ - printf ("OK\n"); - } else { - printf ("Failed.\nShould have had %" APR_SIZE_T_FMT - " bytes, instead there are %" - APR_SIZE_T_FMT " bytes :(\n", - TESTSIZE - size, cksize); - exit(-1); - } + printf("%" APR_SIZE_T_FMT, cksize); + } + printf("\n\t%d cycles of malloc and calloc passed.", CYCLES); + + printf("\n\nClearing shmem segment.............................."); + rv = apr_shm_destroy(shm); + if (rv != APR_SUCCESS) + { + printf("Failed\n"); + exit(-1); + } + printf("OK\n"); + + printf("Recreating shared memory block (%" APR_SIZE_T_FMT " bytes)......", + TESTSIZE); + if (apr_shm_init(&shm, TESTSIZE, NULL, context) != APR_SUCCESS) { + fprintf(stderr, "Error allocating shared memory block\n"); + exit(-1); } - printf("%d cycles of malloc and calloc passed.\n\n", CYCLES); + fprintf(stdout, "OK\n"); printf("Block test.\n"); printf("\tI am about to allocate %" APR_SIZE_T_FMT @@ -223,49 +213,24 @@ int main(void) } printf ("OK\n"); - printf ("\tAbout to allocate %d blocks of %d bytes....", CYCLES, SIZE); - for (cntr = 0;cntr < CYCLES;cntr++){ - if ((ptrs[cntr] = apr_shm_malloc(shm, SIZE)) == NULL){ - printf("Failed.\n"); - printf("Couldn't allocate block %d\n", cntr + 1); - exit (-1); - } - } - printf("Complete.\n"); - - printf ("\tAbout to free %d blocks of %d bytes........", CYCLES, SIZE); - for (cntr = 0;cntr < CYCLES;cntr++){ - if ((rv = apr_shm_free(shm, ptrs[cntr])) != APR_SUCCESS){ - printf("Failed\n"); - printf("Counldn't free block %d\n", cntr + 1); - exit (-1); - } + printf("Clearing shmem segment.............................."); + rv = apr_shm_destroy(shm); + if (rv != APR_SUCCESS) + { + printf("Failed\n"); + exit(-1); } - printf("Complete.\n"); + printf("OK\n"); - printf("Checking we have all we should have remaining......."); - rv = apr_shm_avail(shm, &cksize); - if (rv == APR_ENOTIMPL){ - printf("Not Impl.\n"); - } else { - if (rv != APR_SUCCESS){ - printf("Failed!\n"); - exit (-1); - } - if (cksize == (TESTSIZE - size)){ - printf ("OK\n"); - } else { - printf ("Failed.\nShould have had %" - APR_SIZE_T_FMT " bytes, instead there are %" - APR_SIZE_T_FMT " bytes :(\n", - TESTSIZE - size, cksize); - exit(-1); - } + printf("Recreating shared memory block (%" APR_SIZE_T_FMT " bytes)......", + TESTSIZE); + if (apr_shm_init(&shm, TESTSIZE, NULL, context) != APR_SUCCESS) { + fprintf(stderr, "Error allocating shared memory block\n"); + exit(-1); } + fprintf(stdout, "OK\n"); - printf("Block test complete.\n\n"); - - printf("Creating a child process\n"); + printf("Shared Process Test (child/parent)\n"); pid = fork(); if (pid == 0) { apr_sleep(1); From 6ef50990a0c4bf7afce75d15b610fc3c1540b0e7 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 13 Aug 2001 22:46:08 +0000 Subject: [PATCH 2159/7878] More fallout from MM's departure. - Fix buildconf to not build MM's configure - Add the line in apr.h.in for MAP_ANON mmap usage - Fix munmap to have the right parameters - Add APR_WANT_MEMFUNC to import memset in shmem.c. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62156 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 3 ++- include/apr.h.in | 1 + shmem/unix/shmem.c | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/buildconf b/buildconf index e86bd91359f..a301989efd3 100755 --- a/buildconf +++ b/buildconf @@ -101,6 +101,7 @@ echo "Creating configure ..." ### do some work to toss config.cache? autoconf -(cd shmem/unix/mm && autoconf) +# We do not currently use MM +#(cd shmem/unix/mm && autoconf) exit 0 diff --git a/include/apr.h.in b/include/apr.h.in index 8c3c2ae5922..f5849a7a4e5 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -66,6 +66,7 @@ #define APR_USE_SHMEM_MMAP_SHM @usemmapshm@ #define APR_USE_SHMEM_MMAP_ZERO @usemmapzero@ #define APR_USE_SHMEM_SHMGET @useshmget@ +#define APR_USE_SHMEM_MMAP_ANON @usemmapanon@ #define APR_USE_SHMEM_BEOS @usebeosarea@ #define APR_USE_FLOCK_SERIALIZE @flockser@ diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 0cf2826abf4..294da7e0599 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -57,6 +57,8 @@ #include "apr_lock.h" #include "apr_portable.h" #include "apr_errno.h" +#define APR_WANT_MEMFUNC +#include "apr_want.h" /* * This is the Unix implementation of shared memory. @@ -200,10 +202,10 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m) { #if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO - munmap(m->mem); + munmap(m->mem, m->length); apr_file_close(m->file); #elif APR_USE_SHMEM_MMAP_ANON - munmap(m->mem); + munmap(m->mem, m->length); #elif APR_USE_SHMEM_SHMGET shmdt(m->mem); #elif APR_USE_SHMEM_BEOS From 0c7f0b8f81b9dbb3a3ca32110280033e00d346bf Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Mon, 13 Aug 2001 23:45:48 +0000 Subject: [PATCH 2160/7878] Fix warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62157 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shmem.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 294da7e0599..5bb6abcab59 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -104,13 +104,16 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *filename, apr_pool_t *pool) { apr_shmem_t *new_m; - int tmpfd; void *mem; - #if APR_USE_SHMEM_SHMGET struct shmid_ds shmbuf; -#else - apr_status_t stat; +#endif +#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO + apr_status_t status; +#endif +#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || \ + APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_SHMGET + int tmpfd; #endif new_m = apr_palloc(pool, sizeof(apr_shmem_t)); @@ -120,19 +123,20 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, /* These implementations are very similar except for opening the file. */ #if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO /* FIXME: Ignore error for now. * - *stat = apr_file_remove(filename, pool);*/ + * status = apr_file_remove(filename, pool);*/ + status = APR_SUCCESS; #if APR_USE_SHMEM_MMAP_TMP /* FIXME: Is APR_OS_DEFAULT sufficient? */ - stat = apr_file_open(new_m->file, filename, + status = apr_file_open(new_m->file, filename, APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, pool); - if (stat != APR_SUCCESS) + if (status != APR_SUCCESS) return APR_EGENERAL; tmpfd = apr_os_file_get(&tmpfd, new_m->file); - stat = apr_file_trunc(new_m->file, reqsize); - if (stat != APR_SUCCESS) + status = apr_file_trunc(new_m->file, reqsize); + if (status != APR_SUCCESS) return APR_EGENERAL; #elif APR_USE_SHMEM_MMAP_SHM @@ -142,16 +146,16 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, return errno + APR_OS_START_SYSERR; apr_os_file_put(new_m->file, &tmpfd, pool); - stat = apr_file_trunc(new_m->file, reqsize); - if (stat != APR_SUCCESS) + status = apr_file_trunc(new_m->file, reqsize); + if (status != APR_SUCCESS) { shm_unlink(filename); return APR_EGENERAL; } #elif APR_USE_SHMEM_MMAP_ZERO - stat = apr_file_open(new_m->file, "/dev/zero", APR_READ | APR_WRITE, + status = apr_file_open(new_m->file, "/dev/zero", APR_READ | APR_WRITE, APR_OS_DEFAULT); - if (stat != APR_SUCCESS) + if (status != APR_SUCCESS) return APR_EGENERAL; tmpfd = apr_os_file_get(&tmpfd, new_m->file); #endif @@ -296,16 +300,16 @@ APR_DECLARE(apr_status_t) apr_shm_open(apr_shmem_t *c) APR_DECLARE(apr_status_t) apr_shm_avail(apr_shmem_t *m, apr_size_t *size) { - apr_status_t stat; + apr_status_t status; - stat = APR_ENOSHMAVAIL; + status = APR_ENOSHMAVAIL; apr_lock_acquire(m->lock); *size = m->length - (m->curmem - m->mem); if (*size) - stat = APR_SUCCESS; + status = APR_SUCCESS; apr_lock_release(m->lock); - return stat; + return status; } From 42d18822c4b88310a5957c15bc3ab868848cbc4f Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 14 Aug 2001 04:05:16 +0000 Subject: [PATCH 2161/7878] Next batch of moving the docs from ScanDoc to DoxyGen. Submitted by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62158 13f79535-47bb-0310-9956-ffa450edef68 --- docs/doxygen.conf | 9 ++- include/apr_getopt.h | 16 +++-- include/apr_inherit.h | 20 +++++- include/apr_lib.h | 59 ++++++++++++----- include/apr_thread_proc.h | 120 +++++++++++++--------------------- include/arch/netware/pre_nw.h | 2 + 6 files changed, 125 insertions(+), 101 deletions(-) diff --git a/docs/doxygen.conf b/docs/doxygen.conf index dbe4b75c8e9..d05be9c0da9 100644 --- a/docs/doxygen.conf +++ b/docs/doxygen.conf @@ -1,6 +1,7 @@ -PROJECT_NAME=Apache Portable Run-Time +PROJECT_NAME="Apache Portable Run-Time" INPUT=. +QUIET=YES RECURSIVE=YES FILE_PATTERNS=*.h @@ -8,9 +9,11 @@ OUTPUT_DIRECTORY=docs/dox MACRO_EXPANSION=YES EXPAND_ONLY_PREDEF=YES -EXPAND_AS_DEFINED= +#EXPAND_AS_DEFINED= # not sure why this doesn't work as EXPAND_AS_DEFINED, it should! -PREDEFINED=APR_DECLARE(x)=x APR_DECLARE_NONSTD(x)=x \ +PREDEFINED="APR_DECLARE(x)=x" \ + "APR_DECLARE_NONSTD(x)=x" \ + DOXYGEN= OPTIMIZE_OUTPUT_FOR_C=YES diff --git a/include/apr_getopt.h b/include/apr_getopt.h index e206d4f26ac..263635576e0 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -62,8 +62,14 @@ extern "C" { #endif /* __cplusplus */ /** - * @package APR command arguments - */ + * @file apr_getopt.h + * @brief APR Command Arguments (getopt) + */ +/** + * @defgroup APR_getopt Command Argument Parsing + * @ingroup APR + * @{ + */ typedef struct apr_getopt_t apr_getopt_t; /** @@ -114,8 +120,7 @@ struct apr_getopt_option_t { * @param cont The pool to operate on * @param argc The number of arguments to parse * @param argv The array of arguments to parse - * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) - * @deffunc apr_status_t apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont,int argc, char *const *argv) + * @remark Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) */ APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, int argc, const char * const *argv); @@ -135,7 +140,6 @@ APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, * APR_BADARG -- No argument followed @parameter: * APR_SUCCESS -- The next option was found. * - * @deffunc apr_status_t apr_getopt(apr_getopt_t *os, const char *opts, char *optch, const char **optarg) */ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, char *option_ch, const char **option_arg); @@ -164,12 +168,12 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, * os->err is set to 0. If os->interleave is set to nonzero, options can come * after arguments, and os->argv will be permuted to leave non-option arguments * at the end (the original argv is unaffected). - * @deffunc apr_status_t apr_getopt_long(apr_getopt_t *os, const apr_getopt_option_t *opts, int *optch, const char **optarg) */ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, const apr_getopt_option_t *opts, int *option_ch, const char **option_arg); +/** @} */ #ifdef __cplusplus } diff --git a/include/apr_inherit.h b/include/apr_inherit.h index 849fa8b8c03..76c80a9bd95 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -54,13 +54,30 @@ #ifndef APR_INHERIT_H #define APR_INHERIT_H +/** + * @file apr_inherit.h + * @brief APR File Handle Inheritance + */ +/** + * @defgroup APR_File_Inheritance Inheritance Of File/Sockets + * @ingroup APR_File_Handle + * Sets/Unsets inheritance for File descriptor inheritance in children + * processes. + * + * @{ + */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ - +/** + * @param name Set Inheritance for this Socket/File Handle + */ #define APR_DECLARE_SET_INHERIT(name) \ APR_DECLARE(void) apr_##name##_set_inherit(apr_##name##_t *name) +/** + * @param name Unset Inheritance for this Socket/File Handle + */ #define APR_DECLARE_UNSET_INHERIT(name) \ APR_DECLARE(void) apr_##name##_unset_inherit(apr_##name##_t *name) @@ -68,5 +85,6 @@ extern "C" { #ifdef __cplusplus } #endif +/** @} */ #endif /* ! APR_INHERIT_H */ diff --git a/include/apr_lib.h b/include/apr_lib.h index d66d122e5d1..cd7c948dd35 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -54,6 +54,10 @@ #ifndef APR_LIB_H #define APR_LIB_H +/** + * @file apr_lib.h + * @brief general purpose library routines + */ #include "apr.h" #include "apr_errno.h" @@ -64,9 +68,10 @@ #if APR_HAVE_STDARG_H #include #endif - /** - * @package APR general-purpose library + * @defgroup APR_General General Purpose Library Routines + * @ingroup APR + * @{ */ #ifdef __cplusplus @@ -95,42 +100,62 @@ struct apr_vformatter_buff_t { * return the final element of the pathname * @param pathname The path to get the final element of * @return the final element of the path - * @tip Examples: + * @example + */ +/** + * Examples: *
      *                 "/foo/bar/gum"   -> "gum"
      *                 "/foo/bar/gum/"  -> ""
      *                 "gum"            -> "gum"
      *                 "wi\\n32\\stuff" -> "stuff"
      * 
    - * @deffunc const char * apr_filename_of_pathname(const char *pathname) */ APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname); -/* These macros allow correct support of 8-bit characters on systems which +/** + * These macros allow correct support of 8-bit characters on systems which * support 8-bit characters. Pretty dumb how the cast is required, but * that's legacy libc for ya. These new macros do not support EOF like * the standard macros do. Tough. + * @defgroup apr_ctype ctype functions + * @{ */ +/** @see isalnum */ #define apr_isalnum(c) (isalnum(((unsigned char)(c)))) +/** @see isalpha */ #define apr_isalpha(c) (isalpha(((unsigned char)(c)))) +/** @see iscntrl */ #define apr_iscntrl(c) (iscntrl(((unsigned char)(c)))) +/** @see isdigit */ #define apr_isdigit(c) (isdigit(((unsigned char)(c)))) +/** @see isgraph */ #define apr_isgraph(c) (isgraph(((unsigned char)(c)))) +/** @see islower*/ #define apr_islower(c) (islower(((unsigned char)(c)))) +/** @see isascii */ #ifdef isascii #define apr_isascii(c) (isascii(((unsigned char)(c)))) #else #define apr_isascii(c) (((c) & ~0x7f)==0) #endif +/** @see isprint */ #define apr_isprint(c) (isprint(((unsigned char)(c)))) +/** @see ispunct */ #define apr_ispunct(c) (ispunct(((unsigned char)(c)))) +/** @see isspace */ #define apr_isspace(c) (isspace(((unsigned char)(c)))) +/** @see isupper */ #define apr_isupper(c) (isupper(((unsigned char)(c)))) +/** @see isxdigit */ #define apr_isxdigit(c) (isxdigit(((unsigned char)(c)))) +/** @see tolower */ #define apr_tolower(c) (tolower(((unsigned char)(c)))) +/** @see toupper */ #define apr_toupper(c) (toupper(((unsigned char)(c)))) - -/* +/** @} */ +/** + * apr_killpg * Small utility macros to make things easier to read. Not usually a * goal, to be sure.. */ @@ -153,17 +178,20 @@ APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname); * @param fmt The format string * @param ap The arguments to use to fill out the format string. * - * @tip
    + * @example 
    + */
    +/**
    + * 
      * The extensions are:
      *
    - * %pA	takes a struct in_addr *, and prints it as a.b.c.d
    - * %pI	takes an apr_sockaddr_t * and prints it as a.b.c.d:port or
    + * %%pA	takes a struct in_addr *, and prints it as a.b.c.d
    + * %%pI	takes an apr_sockaddr_t * and prints it as a.b.c.d:port or
      *      [ipv6-address]:port
    - * %pp  takes a void * and outputs it in hex
    + * %%pp takes a void * and outputs it in hex
      *
    - * The %p hacks are to force gcc's printf warning code to skip
    + * The %%p hacks are to force gcc's printf warning code to skip
      * over a pointer argument without complaining.  This does
    - * mean that the ANSI-style %p (output a void * in hex format) won't
    + * mean that the ANSI-style %%p (output a void * in hex format) won't
      * work as expected at all, but that seems to be a fair trade-off
      * for the increased robustness of having printf-warnings work.
      *
    @@ -202,7 +230,6 @@ APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname);
      * that the space is in use until it either has to flush the buffer
      * or until apr_vformatter returns.
      * 
    - * @deffunc int apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), apr_vformatter_buff_t *c, const char *fmt, va_list ap) */ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), apr_vformatter_buff_t *c, const char *fmt, @@ -212,7 +239,6 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), * Validate any password encypted with any algorithm that APR understands * @param passwd The password to validate * @param hash The password to validate against - * @deffunc apr_status_t apr_password_validate(const char *passwd, const char *hash) */ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, const char *hash); @@ -222,7 +248,6 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, * @param prompt The prompt to display * @param pwbuf Buffer to store the password * @param bufsize The length of the password buffer. - * @deffunc apr_status_t apr_password_get(const char *prompt, char *pwbuf, size_t *bufsize) */ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, size_t *bufsize); @@ -230,5 +255,5 @@ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, #ifdef __cplusplus } #endif - +/** @} */ #endif /* ! APR_LIB_H */ diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index ddfd5528c1a..b7ba4aa219f 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -69,9 +69,14 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ - /** - * @package APR Thread library + * @file apr_thread_proc.h + * @brief APR Thread Libraru + */ +/** + * @defgroup APR_Thread Thread Library + * @ingroup APR + * @{ */ typedef enum {APR_SHELLCMD, APR_PROGRAM} apr_cmdtype_e; @@ -87,19 +92,24 @@ typedef enum {APR_WAIT, APR_NOWAIT} apr_wait_how_e; #define APR_LIMIT_MEM 1 #define APR_LIMIT_NPROC 2 -#if APR_HAS_OTHER_CHILD -#define APR_OC_REASON_DEATH 0 /* child has died, caller must call +#if APR_HAS_OTHER_CHILD || defined(DOXYGEN) +/** + * @defgroup Other_Child Other Child Flags + * @{ + */ +#define APR_OC_REASON_DEATH 0 /**< child has died, caller must call * unregister still */ -#define APR_OC_REASON_UNWRITABLE 1 /* write_fd is unwritable */ -#define APR_OC_REASON_RESTART 2 /* a restart is occuring, perform +#define APR_OC_REASON_UNWRITABLE 1 /**< write_fd is unwritable */ +#define APR_OC_REASON_RESTART 2 /**< a restart is occuring, perform * any necessary cleanup (including * sending a special signal to child) */ -#define APR_OC_REASON_UNREGISTER 3 /* unregister has been called, do +#define APR_OC_REASON_UNREGISTER 3 /**< unregister has been called, do * whatever is necessary (including * kill the child) */ -#define APR_OC_REASON_LOST 4 /* somehow the child exited without +#define APR_OC_REASON_LOST 4 /**< somehow the child exited without * us knowing ... buggy os? */ +/** @} */ #endif /* APR_HAS_OTHER_CHILD */ typedef struct apr_proc_t apr_proc_t; @@ -112,7 +122,7 @@ struct apr_proc_t { apr_file_t *in; /** Parent's side of pipe to child's stdout */ apr_file_t *out; - /* Parent's side of pipe to child's stdouterr */ + /** Parent's side of pipe to child's stdouterr */ apr_file_t *err; }; @@ -131,11 +141,11 @@ typedef struct apr_other_child_rec_t apr_other_child_rec_t; typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(apr_thread_t*, void*); enum kill_conditions { - kill_never, /* process is never sent any signals */ - kill_always, /* process is sent SIGKILL on apr_pool_t cleanup */ - kill_after_timeout, /* SIGTERM, wait 3 seconds, SIGKILL */ - just_wait, /* wait forever for the process to complete */ - kill_only_once /* send SIGTERM and then wait */ + kill_never, /**< process is never sent any signals */ + kill_always, /**< process is sent SIGKILL on apr_pool_t cleanup */ + kill_after_timeout, /**< SIGTERM, wait 3 seconds, SIGKILL */ + just_wait, /**< wait forever for the process to complete */ + kill_only_once /**< send SIGTERM and then wait */ }; /** A list of processes */ @@ -150,8 +160,7 @@ struct process_chain { * kill_only_once -- send SIGTERM and then wait
    */ enum kill_conditions kill_how; - /** The next process in the list - * @defvar process_chain *next */ + /** The next process in the list */ struct process_chain *next; }; @@ -163,7 +172,6 @@ struct process_chain { * Create and initialize a new threadattr variable * @param new_attr The newly created threadattr. * @param cont The pool to use - * @deffunc apr_status_t apr_threadattr_create(apr_threadattr_t **new_attr, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new_attr, apr_pool_t *cont); @@ -172,7 +180,6 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new_attr, * Set if newly created threads should be created in detached state. * @param attr The threadattr to affect * @param on Thread detach state on or off - * @deffunc apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) */ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on); @@ -180,7 +187,6 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, /** * Get the detach state for this threadattr. * @param attr The threadattr to reference - * @deffunc apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) */ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr); @@ -191,7 +197,6 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr); * @param func The function to start the new thread in * @param data Any data to be passed to the starting function * @param cont The pool to use - * @deffunc apr_status_t apr_thread_create(apr_thread_t **new_thread, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new_thread, apr_threadattr_t *attr, @@ -202,7 +207,6 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new_thread, * stop the current thread * @param thd The thread to stop * @param retval The return value to pass back to any thread that cares - * @deffunc apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) */ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t *retval); @@ -211,21 +215,18 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, * block until the desired thread stops executing. * @param retval The return value from the dead thread. * @param thd The thread to join - * @deffunc apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd); */ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd); /** * force the current thread to yield the processor - * @deffunc void apr_thread_yield() */ APR_DECLARE(void) apr_thread_yield(void); /** * detach a thread * @param thd The thread to detach - * @deffunc apr_status_t apr_thread_detach(apr_thread_t *thd) */ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd); @@ -234,7 +235,6 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd); * @param data The user data associated with the thread. * @param key The key to associate with the data * @param thread The currently open thread. - * @deffunc apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) */ APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread); @@ -245,7 +245,6 @@ APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, * @param key The key to use for associating the data with the tread * @param cleanup The cleanup routine to use when the thread is destroyed. * @param thread The currently open thread. - * @deffunc apr_status_t apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) */ APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), @@ -256,7 +255,6 @@ APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, * @param key The thread private handle. * @param dest The destructor to use when freeing the private memory. * @param cont The pool to use - * @deffunc apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), @@ -266,7 +264,6 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, * Get a pointer to the thread private memory * @param new_mem The data stored in private memory * @param key The handle for the desired thread private memory - * @deffunc apr_status_t apr_threadkey_private_get(void **new_mem, apr_threadkey_t *key) */ APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new_mem, apr_threadkey_t *key); @@ -275,7 +272,6 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new_mem, * Set the data to be stored in thread private memory * @param priv The data to be stored in private memory * @param key The handle for the desired thread private memory - * @deffunc apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) */ APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key); @@ -283,7 +279,6 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, /** * Free the thread private memory * @param key The handle for the desired thread private memory - * @deffunc apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) */ APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key); @@ -292,7 +287,6 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key); * @param data The user data associated with the threadkey. * @param key The key associated with the data * @param threadkey The currently open threadkey. - * @deffunc apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) */ APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey); @@ -303,7 +297,6 @@ APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, * @param key The key to associate with the data. * @param cleanup The cleanup routine to use when the file is destroyed. * @param threadkey The currently open threadkey. - * @deffunc apr_status_t apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) */ APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), @@ -321,7 +314,6 @@ APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, * Create and initialize a new procattr variable * @param new_attr The newly created procattr. * @param cont The pool to use - * @deffunc apr_status_t apr_procattr_create(apr_procattr_t **new_attr, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new_attr, apr_pool_t *cont); @@ -333,7 +325,6 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new_attr, * @param in Should stdin be a pipe back to the parent? * @param out Should stdout be a pipe back to the parent? * @param err Should stderr be a pipe back to the parent? - * @deffunc apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) */ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, @@ -344,13 +335,12 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, * @param attr The procattr we care about. * @param child_in apr_file_t value to use as child_in. Must be a valid file. * @param parent_in apr_file_t value to use as parent_in. Must be a valid file. - * @deffunc apr_status_t apr_procattr_child_in_set(struct apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) - * @tip This is NOT a required initializer function. This is - * useful if you have already opened a pipe (or multiple files) - * that you wish to use, perhaps persistently across multiple - * process invocations - such as a log file. You can save some - * extra function calls by not creating your own pipe since this - * creates one in the process space for you. + * @remark This is NOT a required initializer function. This is + * useful if you have already opened a pipe (or multiple files) + * that you wish to use, perhaps persistently across multiple + * process invocations - such as a log file. You can save some + * extra function calls by not creating your own pipe since this + * creates one in the process space for you. */ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(struct apr_procattr_t *attr, apr_file_t *child_in, @@ -361,11 +351,10 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(struct apr_procattr_t *attr, * @param attr The procattr we care about. * @param child_out apr_file_t value to use as child_out. Must be a valid file. * @param parent_out apr_file_t value to use as parent_out. Must be a valid file. - * @deffunc apr_status_t apr_procattr_child_out_set(struct apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) - * @tip This is NOT a required initializer function. This is - * useful if you have already opened a pipe (or multiple files) - * that you wish to use, perhaps persistently across multiple - * process invocations - such as a log file. + * @remark This is NOT a required initializer function. This is + * useful if you have already opened a pipe (or multiple files) + * that you wish to use, perhaps persistently across multiple + * process invocations - such as a log file. */ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(struct apr_procattr_t *attr, apr_file_t *child_out, @@ -376,11 +365,10 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(struct apr_procattr_t *attr * @param attr The procattr we care about. * @param child_err apr_file_t value to use as child_err. Must be a valid file. * @param parent_err apr_file_t value to use as parent_err. Must be a valid file. - * @deffunc apr_status_t apr_procattr_child_err_set(struct apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) - * @tip This is NOT a required initializer function. This is - * useful if you have already opened a pipe (or multiple files) - * that you wish to use, perhaps persistently across multiple - * process invocations - such as a log file. + * @remark This is NOT a required initializer function. This is + * useful if you have already opened a pipe (or multiple files) + * that you wish to use, perhaps persistently across multiple + * process invocations - such as a log file. */ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(struct apr_procattr_t *attr, apr_file_t *child_err, @@ -392,7 +380,6 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(struct apr_procattr_t *attr * @param dir Which dir to start in. By default, this is the same dir as * the parent currently resides in, when the createprocess call * is made. - * @deffunc apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) */ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir); @@ -405,7 +392,6 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, * APR_SHELLCMD -- Shell script * APR_PROGRAM -- Executable program (default) * - * @deffunc apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) */ APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd); @@ -414,7 +400,6 @@ APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, * Determine if the chlid should start in detached state. * @param attr The procattr we care about. * @param detach Should the child start in detached state? Default is no. - * @deffunc apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) */ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach); @@ -430,7 +415,6 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, * APR_LIMIT_NPROC * * @param limit Value to set the limit to. - * @deffunc apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, apr_int32_t what, struct rlimit *limit) */ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, @@ -443,7 +427,6 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, * a standard unix fork. * @param proc The resulting process handle. * @param cont The pool to use. - * @deffunc apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont); #endif @@ -459,7 +442,6 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont); * @param attr the procattr we should use to determine how to create the new * process * @param cont The pool to use. - * @deffunc apr_status_t apr_proc_create(apr_proc_t *new_proc, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc, const char *progname, @@ -477,8 +459,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc, * APR_NOWAIT -- return immediately regardless of if the * child is dead or not. * - * @deffunc apr_status_t apr_proc_wait(apr_proc_t *proc, apr_wait_how_e waithow) - * @tip The childs status is in the return code to this process. It is one of: + * @remark The childs status is in the return code to this process. It is one of: *
      *            APR_CHILD_DONE     -- child is no longer running.
      *            APR_CHILD_NOTDONE  -- child is still running.
    @@ -502,7 +483,6 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
      *                          child is dead or not.
      * 
    * @param p Pool to allocate child information out of. - * @deffunc apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p) */ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, @@ -527,7 +507,6 @@ apr_status_t apr_proc_detach(void); * then the maintenance is invoked with reason * OC_REASON_UNWRITABLE. * @param p The pool to use for allocating memory. - * @deffunc void apr_proc_other_child_register(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), void *data, apr_file_t *write_fd, apr_pool_t *p) */ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid, void (*maintenance) (int reason, @@ -540,11 +519,10 @@ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid, * Stop watching the specified process. * @param data The data to pass to the maintenance function. This is * used to find the process to unregister. - * @deffunc void apr_proc_other_child_unregister(void *data) - * @tip Since this can be called by a maintenance function while we're - * scanning the other_children list, all scanners should protect - * themself by loading ocr->next before calling any maintenance - * function. + * @warning Since this can be called by a maintenance function while we're + * scanning the other_children list, all scanners should protect + * themself by loading ocr->next before calling any maintenance + * function. */ APR_DECLARE(void) apr_proc_other_child_unregister(void *data); @@ -553,14 +531,12 @@ APR_DECLARE(void) apr_proc_other_child_unregister(void *data); * function. * @param pid The process to check. * @param status The status to pass to the maintenance function. - * @deffunc apr_status_t apr_proc_other_child_read(apr_proc_t *pid, int status); */ APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *pid, int status); /** * Loop through all registered other_children and call the appropriate * maintenance function when necessary. - * @deffunc void apr_proc_other_child_check(); */ APR_DECLARE(void) apr_proc_other_child_check(void); @@ -570,7 +546,6 @@ APR_DECLARE(void) apr_proc_other_child_check(void); * Terminate a process. * @param proc The process to terminate. * @param sig How to kill the process. - * @deffunc apr_status_t apr_proc_kill(apr_proc_t *proc, int sig) */ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); @@ -586,7 +561,6 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); * just_wait -- wait forever for the process to complete * kill_only_once -- send SIGTERM and then wait * - * @deffunc void apr_pool_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) */ APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how); @@ -597,8 +571,7 @@ APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, /** * Setup the process for a single thread to be used for all signal handling. - * @warn This must be called before any threads are created - * @deffunc apr_status_t apr_setup_signal_thread(void) + * @warning This must be called before any threads are created */ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void); @@ -616,12 +589,11 @@ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)); /** * Get the child-pool used by the thread from the thread info. * @return apr_pool_t the pool - * @deffunc apr_pool_t apr_thread_pool_get(apr_thread_t *i) */ APR_POOL_DECLARE_ACCESSOR(thread); #endif /* APR_HAS_THREADS */ - +/** @} */ #ifdef __cplusplus } #endif diff --git a/include/arch/netware/pre_nw.h b/include/arch/netware/pre_nw.h index 6a3d99c45d9..c75da3a5c72 100644 --- a/include/arch/netware/pre_nw.h +++ b/include/arch/netware/pre_nw.h @@ -21,9 +21,11 @@ /* if we have wchar_t enabled in C++, predefine this type to avoid a conflict in Novell's header files */ +#ifndef DOXYGEN #if (__option(cplusplus) && __option(wchar_type)) #define _WCHAR_T #endif +#endif /* C9X defintion used by MSL C++ library */ #define DECIMAL_DIG 17 From 7bc441d14775d20ed7a57efd83399c665ba689de Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 14 Aug 2001 05:14:59 +0000 Subject: [PATCH 2162/7878] Fix the new shared memory configure script. The APR_DECIDE macros go in order, so the last set of dependancies that are met are the ones used. That means that when using those macros, options should be listed with the least desirable option first, and the most desirable last. The new shared memory routines did the opposite, so we chose the wrong shared memory option on Linux. CS: Obtained from: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62159 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++++++ configure.in | 24 ++++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index e22f90b9a22..1d309e412dd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,13 @@ Changes with APR b1 + *) Fix the new shared memory configure script. The APR_DECIDE + macros go in order, so the last set of dependancies that are + met are the ones used. That means that when using those macros, + options should be listed with the least desirable option first, + and the most desirable last. The new shared memory routines did + the opposite, so we chose the wrong shared memory option on Linux. + [Ryan Bloom] + *) Move the necessary shared memory code from MM into APR and remove our dependency upon MM. [Justin Erenkrantz] diff --git a/configure.in b/configure.in index 382086dc0ca..a126e549593 100644 --- a/configure.in +++ b/configure.in @@ -394,22 +394,22 @@ AC_HAVE_FUNCS(create_area) dnl Now we determine which one is our preference. APR_BEGIN_DECISION([shared memory allocation method]) -APR_IFALLYES(header:sys/mman.h func:mmap func:munmap, - APR_DECIDE(USE_SHMEM_MMAP_TMP, - [Classical mmap() on temporary file])) +APR_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON, + APR_DECIDE(USE_SHMEM_MMAP_ANON, + [4.4BSD-style mmap() via MAP_ANON])) +APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl + func:shmget func:shmat func:shmdt func:shmctl, + APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()])) +APR_IFALLYES(header:sys/mman.h func:mmap func:munmap file:/dev/zero, + APR_DECIDE(USE_SHMEM_MMAP_ZERO, + [SVR4-style mmap() on /dev/zero])) APR_IFALLYES(header:sys/mman.h func:mmap func:munmap func:shm_open dnl func:shm_unlink, APR_DECIDE(USE_SHMEM_MMAP_SHM, [mmap() via POSIX.1 shm_open() on temporary file])) -APR_IFALLYES(header:sys/mman.h func:mmap func:munmap file:/dev/zero, - APR_DECIDE(USE_SHMEM_MMAP_ZERO, - [SVR4-style mmap() on /dev/zero])) -APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl - func:shmget func:shmat func:shmdt func:shmctl, - APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()])) -APR_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON, - APR_DECIDE(USE_SHMEM_MMAP_ANON, - [4.4BSD-style mmap() via MAP_ANON])) +APR_IFALLYES(header:sys/mman.h func:mmap func:munmap, + APR_DECIDE(USE_SHMEM_MMAP_TMP, + [Classical mmap() on temporary file])) APR_IFALLYES(header:kernel/OS.h func:create_area, APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])) APR_END_DECISION From 4a62642de0293582cf5a1292b5c29745775e5cc7 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 14 Aug 2001 05:17:58 +0000 Subject: [PATCH 2163/7878] Fix the new shared memory code. We need to pass a pointer to an apr_file_t to apr_file_open. Also, apr_os_file_get returns a status value, not the OS file descriptor. This gets Apache running again on Linux. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62160 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ shmem/unix/shmem.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 1d309e412dd..2684640c302 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Fix the new shared memory code. We need to pass a pointer to + an apr_file_t to apr_file_open. Also, apr_os_file_get returns + a status value, not the OS file descriptor. [Ryan Bloom] + *) Fix the new shared memory configure script. The APR_DECIDE macros go in order, so the last set of dependancies that are met are the ones used. That means that when using those macros, diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 5bb6abcab59..8924731d7fa 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -128,13 +128,13 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, #if APR_USE_SHMEM_MMAP_TMP /* FIXME: Is APR_OS_DEFAULT sufficient? */ - status = apr_file_open(new_m->file, filename, + status = apr_file_open(&new_m->file, filename, APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, pool); if (status != APR_SUCCESS) return APR_EGENERAL; - tmpfd = apr_os_file_get(&tmpfd, new_m->file); + status = apr_os_file_get(&tmpfd, new_m->file); status = apr_file_trunc(new_m->file, reqsize); if (status != APR_SUCCESS) return APR_EGENERAL; @@ -157,7 +157,7 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, APR_OS_DEFAULT); if (status != APR_SUCCESS) return APR_EGENERAL; - tmpfd = apr_os_file_get(&tmpfd, new_m->file); + status = apr_os_file_get(&tmpfd, new_m->file); #endif mem = mmap(NULL, reqsize, PROT_READ|PROT_WRITE, MAP_SHARED, tmpfd, 0); From 2ba0fa93c7eec81dcafa01da9aaafc3d59402568 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 14 Aug 2001 05:32:13 +0000 Subject: [PATCH 2164/7878] Remove all warnings from the shared memory code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62161 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shmem.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 8924731d7fa..2ebcea5f087 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -107,6 +107,8 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, void *mem; #if APR_USE_SHMEM_SHMGET struct shmid_ds shmbuf; + apr_uid_t uid; + apr_gid_t gid; #endif #if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO apr_status_t status; @@ -145,7 +147,7 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, if (tmpfd == -1) return errno + APR_OS_START_SYSERR; - apr_os_file_put(new_m->file, &tmpfd, pool); + apr_os_file_put(&new_m->file, &tmpfd, pool); status = apr_file_trunc(new_m->file, reqsize); if (status != APR_SUCCESS) { @@ -153,8 +155,8 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, return APR_EGENERAL; } #elif APR_USE_SHMEM_MMAP_ZERO - status = apr_file_open(new_m->file, "/dev/zero", APR_READ | APR_WRITE, - APR_OS_DEFAULT); + status = apr_file_open(&new_m->file, "/dev/zero", APR_READ | APR_WRITE, + APR_OS_DEFAULT, pool); if (status != APR_SUCCESS) return APR_EGENERAL; status = apr_os_file_get(&tmpfd, new_m->file); @@ -177,7 +179,9 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, if (shmctl(new_m->file, IPC_STAT, &shmbuf) == -1) return errno + APR_OS_START_SYSERR; - apr_current_userid(&shmbuf.shm_perm.uid, &shmbuf.shm_perm.gid, pool); + apr_current_userid(&uid, &gid, pool); + shmbuf.shm_perm.uid = uid; + shmbuf.shm_perm.gid = gid; if (shmctl(new_m->file, IPC_SET, &shmbuf) == -1) return errno + APR_OS_START_SYSERR; From 60a9a89b545bbde3de316677ba6c9cbe2c389b76 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 15 Aug 2001 00:15:50 +0000 Subject: [PATCH 2165/7878] Applied changes made to apr.h on other platforms that didn't make it in NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62162 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/arch/netware/apr.h b/include/arch/netware/apr.h index 70cf00a7b01..1f6a31b1a03 100644 --- a/include/arch/netware/apr.h +++ b/include/arch/netware/apr.h @@ -56,6 +56,16 @@ * Note: This is a NetWare specific version of apr.h. It is renamed to * apr.h at the start of a Windows build. */ +/** + * @file apr.h + * @brief Basic APR header + */ + +/** + * @defgroup APR APR Functions + * @{ + */ + #ifdef NETWARE #ifndef APR_H @@ -323,3 +333,5 @@ typedef int apr_wait_t; #endif /* APR_H */ #endif /* NETWARE */ +/** @} */ + From 3eb3c98e42ed98c137d0980618c29180a26f291f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 15 Aug 2001 00:17:01 +0000 Subject: [PATCH 2166/7878] Added the NetWare OS specific headers for threadproc and locks git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62163 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/locks.h | 71 ++++++++++++++++++++ include/arch/netware/threadproc.h | 103 ++++++++++++++++++++++++++++++ 2 files changed, 174 insertions(+) create mode 100644 include/arch/netware/locks.h create mode 100644 include/arch/netware/threadproc.h diff --git a/include/arch/netware/locks.h b/include/arch/netware/locks.h new file mode 100644 index 00000000000..9a747e79d8c --- /dev/null +++ b/include/arch/netware/locks.h @@ -0,0 +1,71 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef LOCKS_H +#define LOCKS_H + +#include "apr_lock.h" +#include + +struct apr_lock_t { + apr_pool_t *pool; + apr_locktype_e type; + apr_lockscope_e scope; + NXMutex_t *mutex; + NXRwLock_t *rwlock; + char *fname; +}; + +#endif /* LOCKS_H */ + diff --git a/include/arch/netware/threadproc.h b/include/arch/netware/threadproc.h new file mode 100644 index 00000000000..94355a7722d --- /dev/null +++ b/include/arch/netware/threadproc.h @@ -0,0 +1,103 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_thread_proc.h" +#include "apr_file_io.h" +//srj #include "apr_portable.h" + +#ifndef THREAD_PROC_H +#define THREAD_PROC_H + +#define SHELL_PATH "cmd.exe" +#define APR_DEFAULT_STACK_SIZE 65536 + +struct apr_thread_t { + apr_pool_t *cntxt; + NXContext_t ctx; + NXThreadId_t td; +}; + +struct apr_threadattr_t { + apr_pool_t *cntxt; + size_t stack_size; + apr_int32_t detach; +}; + +struct apr_threadkey_t { + apr_pool_t *cntxt; + NXKey_t key; +}; + +struct apr_procattr_t { + apr_pool_t *cntxt; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; + char *currdir; + apr_int32_t cmdtype; + apr_int32_t detached; +}; + +//struct apr_proc_t { +// apr_pool_t *cntxt; +// pid_t pid; +// apr_procattr_t *attr; +//}; + +#endif /* ! THREAD_PROC_H */ + From f7106c09909983130daa0bd73d690ac05c31265b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 15 Aug 2001 01:59:08 +0000 Subject: [PATCH 2167/7878] add testdir, testhash; remove ab git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62164 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/.cvsignore b/test/.cvsignore index b6f2b65ff57..dfbf89a9518 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -4,11 +4,12 @@ Makefile testmd5 testmmap htdigest -ab proctest testud testargs +testdir testdso +testhash testoc testpipe testpoll From 3006daa3780b7c7ec330749a7566a2fdf2b79bc3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 15 Aug 2001 02:47:22 +0000 Subject: [PATCH 2168/7878] don't do arithmetic with void * this definitely clears up warnings on Tru64 and should get APR building again on HP-UX, where this is an error git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62165 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 2ebcea5f087..33febcde2d5 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -230,10 +230,10 @@ APR_DECLARE(void *) apr_shm_malloc(apr_shmem_t *m, apr_size_t reqsize) apr_lock_acquire(m->lock); /* Do we have enough space? */ - if ((m->curmem - m->mem + reqsize) <= m->length) + if (((char *)m->curmem - (char *)m->mem + reqsize) <= m->length) { new = m->curmem; - m->curmem += reqsize; + m->curmem = (char *)m->curmem + reqsize; } apr_lock_release(m->lock); return new; @@ -310,7 +310,7 @@ APR_DECLARE(apr_status_t) apr_shm_avail(apr_shmem_t *m, apr_size_t *size) apr_lock_acquire(m->lock); - *size = m->length - (m->curmem - m->mem); + *size = m->length - ((char *)m->curmem - (char *)m->mem); if (*size) status = APR_SUCCESS; From 2d7823f7a78c0dbe0b50ae66c9409ea9470cb97a Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 15 Aug 2001 11:13:57 +0000 Subject: [PATCH 2169/7878] Allow for OS/2 in shared memory type test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62166 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index a126e549593..b08f74b28db 100644 --- a/configure.in +++ b/configure.in @@ -391,6 +391,7 @@ AC_HAVE_HEADERS(sys/ipc.h sys/shm.h sys/file.h) AC_HAVE_FUNCS(shmget shmat shmdt shmctl) AC_HAVE_HEADERS(kernel/OS.h) AC_HAVE_FUNCS(create_area) +AC_HAVE_HEADERS(os2.h) dnl Now we determine which one is our preference. APR_BEGIN_DECISION([shared memory allocation method]) @@ -412,6 +413,8 @@ APR_IFALLYES(header:sys/mman.h func:mmap func:munmap, [Classical mmap() on temporary file])) APR_IFALLYES(header:kernel/OS.h func:create_area, APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])) +APR_IFALLYES(header:os2.h, + APR_DECIDE(USE_SHMEM_OS2, [OS/2 DosAllocSharedMem()])) APR_END_DECISION AC_DEFINE_UNQUOTED($ac_decision) @@ -421,6 +424,7 @@ usemmapzero="0" useshmget="0" usemmapanon="0" usebeosarea="0" +useos2shm="0" mem_based="0" file_based="1" @@ -449,10 +453,14 @@ case $ac_decision in usebeosarea="1" mem_based="1" ;; + USE_SHMEM_OS2 ) + useos2shm="1" + file_based="0" + ;; esac dnl Do we have any shared memory support? -if test "$usemmaptmp$usemmapshm$usemmapzero$useshmget$usemmapanon$usebeosarea" = "000000"; then +if test "$usemmaptmp$usemmapshm$usemmapzero$useshmget$usemmapanon$usebeosarea$useos2shm" = "0000000"; then sharedmem="0" else sharedmem="1" From 0122104825569d7c480f7eeae6c118d184526bf1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 15 Aug 2001 11:57:09 +0000 Subject: [PATCH 2170/7878] get rid of boatloads of warnings on Darwin apparently, cc first tries an Apple-provided cpp which barfs on a lot of C stuff in our code; when it barfs, cc backs off to the GNU cpp; this avoids trying the Apple-provided cpp first git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62167 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 511c1f1dd32..4971473f26e 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -162,7 +162,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DRHAPSODY]) ;; *-apple-darwin*) - APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK]) + APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -traditional-cpp]) ;; *-dec-osf*) APR_ADDTO(CPPFLAGS, [-DOSF1]) From 9b761a8d2a22b4cc227408160df000a2a09cc156 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 15 Aug 2001 16:01:24 +0000 Subject: [PATCH 2171/7878] Previously, we considered gethostbyname/gethostbyaddr to be thread-safe if they were found in libc_r. This didn't work on OS/390 since there is no libc_r, but they are thread-safe. Now, variables apr_gethostbyname_is_thread_safe or apr_gethostbyaddr_is_thread_safe can be set to bypass the libc_r check, either to state that they are thread-safe or to state that they aren't (not necessary unless the ones in libc_r aren't thread-safe after all). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62168 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 ++ configure.in | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 4971473f26e..ddaa233be42 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -372,6 +372,8 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-ibm-os390) APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE]) APR_SETIFNULL(apr_process_lock_is_global, [yes]) + APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes]) + APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes]) APR_SETIFNULL(CC, [cc]) APR_ADDTO(CPPFLAGS, [-U_NO_PROTO -DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR -DPTHREAD_SETS_ERRNO -DPTHREAD_DETACH_ARG1_ADDR -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1]) ;; diff --git a/configure.in b/configure.in index b08f74b28db..41e46d6297f 100644 --- a/configure.in +++ b/configure.in @@ -353,8 +353,18 @@ ac_cv_define_GETHOSTBYADDR_IS_THREAD_SAFE=no if test "$threads" = "1"; then echo "APR will use threads" AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE)) - AC_CHECK_LIB(c_r, gethostbyname, AC_DEFINE(GETHOSTBYNAME_IS_THREAD_SAFE)) - AC_CHECK_LIB(c_r, gethostbyaddr, AC_DEFINE(GETHOSTBYADDR_IS_THREAD_SAFE)) + if test "x$apr_gethostbyname_is_thread_safe" = "x"; then + AC_CHECK_LIB(c_r, gethostbyname, apr_gethostbyname_is_thread_safe=yes) + fi + if test "$apr_gethostbyname_is_thread_safe" = "yes"; then + AC_DEFINE(GETHOSTBYNAME_IS_THREAD_SAFE) + fi + if test "x$apr_gethostbyaddr_is_thread_safe" = "x"; then + AC_CHECK_LIB(c_r, gethostbyaddr, apr_gethostbyaddr_is_thread_safe=yes) + fi + if test "$apr_gethostbyaddr_is_thread_safe" = "yes"; then + AC_DEFINE(GETHOSTBYADDR_IS_THREAD_SAFE) + fi AC_CHECK_FUNCS(gethostbyname_r gethostbyaddr_r) else echo "APR will be non-threaded" From 78dcc824bd96bac64c944d04b54dd164be670540 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 15 Aug 2001 18:06:47 +0000 Subject: [PATCH 2172/7878] APR doesn't need to define union semun for apps; the logic didn't work quite right anyway we had NEED_UNION_SEMUN vs. APR_HAVE_UNION_SEMUN mixed up we included sys/sem.h when we didn't need to define union semun but we'd need it the header file if we tried to define it so that struct semid_ds would be defined git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62169 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- include/apr_portable.h | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index ddaa233be42..659f09b4a5f 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -240,7 +240,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV]) ;; *-siemens-sysv4*) - APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT -DNEED_UNION_SEMUN]) + APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT]) APR_ADDTO(LIBS, [-lc]) ;; pyramid-pyramid-svr4) diff --git a/include/apr_portable.h b/include/apr_portable.h index e0d8e3b8172..299f5a443be 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -88,9 +88,6 @@ #if APR_HAVE_PTHREAD_H #include #endif -#if APR_HAVE_UNION_SEMUN -#include -#endif #ifdef __cplusplus extern "C" { @@ -158,15 +155,6 @@ typedef void * apr_os_dso_handle_t; * denominator typedefs for all UNIX-like systems. :) */ -#ifdef NEED_UNION_SEMUN -/* it makes no sense, but this isn't defined on solaris */ -union semun { - long val; - struct semid_ds *buf; - ushort *array; -}; -#endif - struct apr_os_lock_t { #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE int crossproc; From 8a0a39a2d29760587036024c4949e5b1d2ced9ca Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 15 Aug 2001 21:02:54 +0000 Subject: [PATCH 2173/7878] fix some homophonic issues in comments, as well as some mispelings found near "its" or "it's" (helping our 4th grader with homework, couldn't help but grep) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62170 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 2 +- include/apr_file_info.h | 2 +- include/apr_network_io.h | 2 +- include/apr_pools.h | 2 +- include/apr_sms.h | 2 +- include/apr_tables.h | 2 +- memory/unix/apr_sms_threads.c | 2 +- memory/unix/apr_sms_tracking.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index d16ff3f7a23..88cd40cf252 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -282,7 +282,7 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, apr_int32_t wante * dword discrepancy in offset of the High/Low size structure members. * * The generic fillin returns 1 if the caller should further inquire - * if this is a CHR filetype. If it's resonably certain it can't be, + * if this is a CHR filetype. If it's reasonably certain it can't be, * then the function returns 0. */ int fillin_fileinfo(apr_finfo_t *finfo, diff --git a/include/apr_file_info.h b/include/apr_file_info.h index e2a990e3d4e..de2e7c06af0 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -314,7 +314,7 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); * Extract the rootpath from the given filepath * @ingroup apr_filepath * @param rootpath the root file path returned with APR_SUCCESS or APR_EINCOMPLETE - * @param filepath the pathname to parse for it's root component + * @param filepath the pathname to parse for its root component * @param flags the desired rules to apply, from *
      *      APR_FILEPATH_NATIVE    Use native path seperators (e.g. '\' on Win32)
    diff --git a/include/apr_network_io.h b/include/apr_network_io.h
    index 40fa8557cf7..acb39b4c31f 100644
    --- a/include/apr_network_io.h
    +++ b/include/apr_network_io.h
    @@ -764,7 +764,7 @@ APR_DECLARE(apr_status_t) apr_socket_from_file(apr_socket_t **newsock,
     
     /**
      * Given an apr_sockaddr_t and a service name, set the port for the service
    - * @param sockaddr The apr_sockaddr_t that will have it's port set
    + * @param sockaddr The apr_sockaddr_t that will have its port set
      * @param servname The name of the service you wish to use
      */
     APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, 
    diff --git a/include/apr_pools.h b/include/apr_pools.h
    index d32b76cfeda..4c1e1f317ef 100644
    --- a/include/apr_pools.h
    +++ b/include/apr_pools.h
    @@ -232,7 +232,7 @@ APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp);
      * @param newcont The pool we have just created.
      * @param cont The parent pool.  If this is NULL, the new pool is a root
      *        pool.  If it is non-NULL, the new pool will inherit all
    - *        of it's parent pool's attributes, except the apr_pool_t will 
    + *        of its parent pool's attributes, except the apr_pool_t will 
      *        be a sub-pool.
      */
     APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont,
    diff --git a/include/apr_sms.h b/include/apr_sms.h
    index d5c0082f1b7..ce37ae59520 100644
    --- a/include/apr_sms.h
    +++ b/include/apr_sms.h
    @@ -136,7 +136,7 @@ typedef int (*apr_abortfunc_t)(int retcode);
     
     /* APR_DEBUG_SHOW_STRUCTURE
      * This turns on a print of the ancestory of the SMS when
    - * creating/destroying an SMS so it's place in the world can be seen.
    + * creating/destroying an SMS so its place in the world can be seen.
      */
     #define APR_DEBUG_SHOW_STRUCTURE      0
     
    diff --git a/include/apr_tables.h b/include/apr_tables.h
    index 4113e2eb8fb..1da77071c33 100644
    --- a/include/apr_tables.h
    +++ b/include/apr_tables.h
    @@ -423,7 +423,7 @@ APR_DECLARE(void) apr_table_vdo(int (*comp)(void *, const char *, const char *),
      * For each element in table b, either use setn or mergen to add the data
      * to table a.  Which method is used is determined by the flags passed in.
      * @param a The table to add the data to.
    - * @param b The table to iterate over, adding it's data to table a
    + * @param b The table to iterate over, adding its data to table a
      * @param flags How to add the table to table a.  One of:
      *          APR_OVERLAP_TABLES_SET        Use apr_table_setn
      *          APR_OVERLAP_TABLES_MERGE      Use apr_table_mergen
    diff --git a/memory/unix/apr_sms_threads.c b/memory/unix/apr_sms_threads.c
    index e4ede123fef..359a9a17727 100644
    --- a/memory/unix/apr_sms_threads.c
    +++ b/memory/unix/apr_sms_threads.c
    @@ -492,7 +492,7 @@ static apr_status_t apr_sms_threads_pre_destroy(apr_sms_t *sms)
         /* This function WILL always be called.  However, be aware that the
          * main sms destroy function knows that it's not wise to try and destroy
          * the same piece of memory twice, so the destroy function in a child won't
    -     * neccesarily be called.  To guarantee we destroy the lock it's therefore
    +     * necessarily be called.  To guarantee we destroy the lock it's therefore
          * destroyed here.
          */
             
    diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c
    index afbfeea135f..64ecbfbc400 100644
    --- a/memory/unix/apr_sms_tracking.c
    +++ b/memory/unix/apr_sms_tracking.c
    @@ -210,7 +210,7 @@ static apr_status_t apr_sms_tracking_pre_destroy(apr_sms_t *sms)
         /* This function WILL alwways be called.  However, be aware that the
          * main sms destroy function knows that it's not wise to try and destroy
          * the same piece of memory twice, so the destroy function in a child won't
    -     * neccesarily be called.  To guarantee we destroy the lock it's therefore
    +     * necessarily be called.  To guarantee we destroy the lock it's therefore
          * destroyed here.
          */
      
    
    From e4aaf52bcc2d978d7a63a1bc49b751a204abdb54 Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Thu, 16 Aug 2001 06:29:48 +0000
    Subject: [PATCH 2174/7878] Remove variable that is no longer needed since we
     no longer depend on MM.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62171 13f79535-47bb-0310-9956-ffa450edef68
    ---
     acconfig.h | 2 --
     1 file changed, 2 deletions(-)
    
    diff --git a/acconfig.h b/acconfig.h
    index 3ceb016e0a8..d522cd90cde 100644
    --- a/acconfig.h
    +++ b/acconfig.h
    @@ -44,8 +44,6 @@
     
     #undef HAVE_INT64_C
     
    -#undef HAVE_MM_SHMT_MMFILE
    -
     /* BeOS specific flag */
     #undef HAVE_BONE_VERSION
     
    
    From 17f6f3d0364acb0878f3b0454d0652fa8c97190e Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Thu, 16 Aug 2001 06:49:46 +0000
    Subject: [PATCH 2175/7878] Reorder the shared memory preferences to match what
     MM originally had.
    
    This effectively backs out rbb's earlier commit which was valid then
    because we weren't treating Linux as special.  Now, since older versions
    of Linux are safe, we should go back to the original order.
    
    We now safeguard MAP_ANON usage to only be used with >=2.4.0 Linux kernels.
    On Linux versions less than that, we will not use MAP_ANON because Linux
    lies and says it has it when it doesn't.  I am sure that we could fine tune
    the >=2.4.0 to match the specific 2.3 version that this was fixed in.
    (This may very well be a glibc issue as well...)
    
    On Linux 2.2 (Mandrake 7.2 distro), we choose shmget.
    On Linux 2.4 (Mandrake 8.0 distro), we choose mmap with MAP_ANON.
    
    Please try out.  It works here.  If this needs a glibc check instead,
    let me know and we can work something out.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62172 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 39 +++++++++++++++++++++++++++------------
     1 file changed, 27 insertions(+), 12 deletions(-)
    
    diff --git a/configure.in b/configure.in
    index 41e46d6297f..e3fd8525ff1 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -252,6 +252,9 @@ case $host in
             # 3.4-RELEASE: 340   4.1.1-RELEASE: 411
             os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/' | sed -e 's/\(.\)\.\(.\)\-.*/\1\20/'`
             ;;
    +    *linux*)
    +        os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/'`
    +        ;;
          *)
             os_version=OS_VERSION_IS_NOT_SET
             ;;
    @@ -405,26 +408,38 @@ AC_HAVE_HEADERS(os2.h)
     
     dnl Now we determine which one is our preference.
     APR_BEGIN_DECISION([shared memory allocation method])
    -APR_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON,
    -             APR_DECIDE(USE_SHMEM_MMAP_ANON, 
    -             [4.4BSD-style mmap() via MAP_ANON]))
    -APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl
    -             func:shmget func:shmat func:shmdt func:shmctl,
    -             APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()]))
    -APR_IFALLYES(header:sys/mman.h func:mmap func:munmap file:/dev/zero,
    -             APR_DECIDE(USE_SHMEM_MMAP_ZERO, 
    -             [SVR4-style mmap() on /dev/zero]))
    +APR_IFALLYES(header:sys/mman.h func:mmap func:munmap,
    +             APR_DECIDE(USE_SHMEM_MMAP_TMP, 
    +             [Classical mmap() on temporary file]))
     APR_IFALLYES(header:sys/mman.h func:mmap func:munmap func:shm_open dnl
                  func:shm_unlink,
                  APR_DECIDE(USE_SHMEM_MMAP_SHM, 
                  [mmap() via POSIX.1 shm_open() on temporary file]))
    -APR_IFALLYES(header:sys/mman.h func:mmap func:munmap,
    -             APR_DECIDE(USE_SHMEM_MMAP_TMP, 
    -             [Classical mmap() on temporary file]))
    +APR_IFALLYES(header:sys/mman.h func:mmap func:munmap file:/dev/zero,
    +             APR_DECIDE(USE_SHMEM_MMAP_ZERO, 
    +             [SVR4-style mmap() on /dev/zero]))
    +APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl
    +             func:shmget func:shmat func:shmdt func:shmctl,
    +             APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()]))
    +APR_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON,
    +             APR_DECIDE(USE_SHMEM_MMAP_ANON, 
    +             [4.4BSD-style mmap() via MAP_ANON]))
     APR_IFALLYES(header:kernel/OS.h func:create_area,
                  APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas]))
     APR_IFALLYES(header:os2.h,
                  APR_DECIDE(USE_SHMEM_OS2, [OS/2 DosAllocSharedMem()]))
    +case $host in
    +    *linux* ) 
    +        dnl Linux has problems with MM_SHMT_MMANON even though it reports
    +        dnl that it has it.
    +        dnl FIXME - find exact 2.3 version that MMANON was fixed in.  It is
    +        dnl confirmed fixed in 2.4 series.
    +        if test $os_version -le "240"; then
    +            APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_TMP USE_SHMEM_MMAP_SHM dnl
    +                                  USE_SHMEM_MMAP_ZERO USE_SHMEM_SHMGET)
    +        fi
    +        ;;
    +esac
     APR_END_DECISION
     AC_DEFINE_UNQUOTED($ac_decision)
     
    
    From b5c4e07eefb8a1b27b938516a39082f79051b7a0 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 16 Aug 2001 21:04:41 +0000
    Subject: [PATCH 2176/7878]   Short term hack, this works only for httpd-2.0
     builds.  I'll revert out   after pushing tag.
    
      This reiterates the horrid situation - we STILL are missing an
      apr_release.h and we can't take ourselves seriously as a library project
      until we get around to fixing this issue.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62173 13f79535-47bb-0310-9956-ffa450edef68
    ---
     libapr.dsp | 36 ++++++++++++++++++++++++++++++++++++
     1 file changed, 36 insertions(+)
    
    diff --git a/libapr.dsp b/libapr.dsp
    index 5745a94a8b4..c7287e2b787 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -592,5 +592,41 @@ SOURCE=.\include\apr_want.h
     SOURCE=.\include\apr_xlate.h
     # End Source File
     # End Group
    +# Begin Source File
    +
    +SOURCE=.\libapr.rc
    +
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=..\..\build\win32ver.awk
    +
    +!IF  "$(CFG)" == "libapr - Win32 Release"
    +
    +# PROP Ignore_Default_Tool 1
    +# Begin Custom Build - Creating Version Resource
    +InputPath=..\..\build\win32ver.awk
    +
    +".\libapr.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
    +	awk -f ../../build/win32/win32ver.awk libapr "Apache Portability Runtime Library"\
    + ../../include/ap_release.h > .\libapr.rc
    +
    +# End Custom Build
    +
    +!ELSEIF  "$(CFG)" == "libapr - Win32 Debug"
    +
    +# PROP Ignore_Default_Tool 1
    +# Begin Custom Build - Creating Version Resource
    +InputPath=..\..\build\win32\win32ver.awk
    +
    +".\libapr.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
    +	awk -f ../../build/win32/win32ver.awk libapr "Apache Portability Runtime Library"\
    + ../../include/ap_release.h > .\libapr.rc
    +
    +# End Custom Build
    +
    +!ENDIF 
    +
    +# End Source File
     # End Target
     # End Project
    
    From c47b733fc1a20b4a998006bdcd17eaa7d51f76a2 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 16 Aug 2001 21:13:07 +0000
    Subject: [PATCH 2177/7878]   Slight of fingers - fix my typo of the last
     revision
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62174 13f79535-47bb-0310-9956-ffa450edef68
    ---
     libapr.dsp | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/libapr.dsp b/libapr.dsp
    index c7287e2b787..d24e571ffdb 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -599,13 +599,13 @@ SOURCE=.\libapr.rc
     # End Source File
     # Begin Source File
     
    -SOURCE=..\..\build\win32ver.awk
    +SOURCE=..\..\build\win32\win32ver.awk
     
     !IF  "$(CFG)" == "libapr - Win32 Release"
     
     # PROP Ignore_Default_Tool 1
     # Begin Custom Build - Creating Version Resource
    -InputPath=..\..\build\win32ver.awk
    +InputPath=..\..\build\win32\win32ver.awk
     
     ".\libapr.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
     	awk -f ../../build/win32/win32ver.awk libapr "Apache Portability Runtime Library"\
    
    From e493272216f1bc941a39dd3e88017b137c904600 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 16 Aug 2001 22:07:59 +0000
    Subject: [PATCH 2178/7878]   Silence autogenerated files
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62175 13f79535-47bb-0310-9956-ffa450edef68
    ---
     .cvsignore | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/.cvsignore b/.cvsignore
    index a43b6e101f7..ceb4242f92a 100644
    --- a/.cvsignore
    +++ b/.cvsignore
    @@ -16,3 +16,4 @@ Release
     apr.exports
     .libs
     *.la
    +libapr.rc
    
    From ddce17318096aba132439be98104929e0a7187ca Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 16 Aug 2001 22:10:27 +0000
    Subject: [PATCH 2179/7878]   Just for us (apr/apr-util) - independent of
     Apache.   We still need two of these unless we plan on growing a whole lot
     more   (generally repetitive) arguments to this script
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62176 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/win32ver.awk | 106 +++++++++++++++++++++++++++++++++++++++++++++
     1 file changed, 106 insertions(+)
     create mode 100644 build/win32ver.awk
    
    diff --git a/build/win32ver.awk b/build/win32ver.awk
    new file mode 100644
    index 00000000000..810e5fc5bf6
    --- /dev/null
    +++ b/build/win32ver.awk
    @@ -0,0 +1,106 @@
    +BEGIN {
    +
    +  # ff bits: 1(debug), 2(prerelease), 4(patched), 8(vendor) and 32(special)
    +  # debug is summed based on the /Define _DEBUG
    +  # prerelease is based on the -dev extension,
    +  # patched is based on a non-standard "-ver" extension, 
    +  # special and vendor are toggled by their args.
    +  #
    +  ff = 0;
    +
    +  file=ARGV[1];
    +  desc=ARGV[2];
    +  rel_h=ARGV[3];
    +
    +  i = 4;
    +  while (length(ARGV[i])) {
    +    if (match(ARGV[i], /icon=/)) {
    +      icon = substr(ARGV[i], 6);
    +    }
    +    if (match(ARGV[i], /vendor=/)) {
    +      vendor = substr(ARGV[i], 8);
    +      ff = ff + 8;
    +    }
    +    if (match(ARGV[i], /special=/)) {
    +      special = substr(ARGV[i], 9);
    +      ff = ff + 32;
    +    }
    +    i = i + 1
    +  }
    +
    +  i = i - 1;
    +  while (i) {
    +    delete ARGV[i];
    +    i = i - 1;
    +  }
    +
    +  while ((getline < rel_h) > 0) {
    +    if (match ($0, /^#define AP_SERVER_BASEREVISION "[^"]+"/)) {
    +      ver = substr($0, RSTART + 32, RLENGTH - 33);
    +    }
    +  }
    +
    +  verc = ver;
    +  gsub(/\./, ",", verc);
    +  if (build) {
    +    sub(/-.*/, "", verc)
    +    verc = verc "," build;
    +  } else if (sub(/-dev/, ",0", verc)) {
    +      ff = ff + 2;
    +  } else if (!sub(/-alpha/, ",10", verc)  \
    +          && !sub(/-beta/, ",100", verc)  \
    +          && !sub(/-gold/, ",200", verc)) {
    +    sub(/-.*/, "", verc);
    +    verc = verc "," 0;
    +  }
    +  
    +  if (length(vendor)) {
    +    ff = ff + 8;
    +  }
    +
    +  if (length(icon)) {
    +    print "1 ICON DISCARDABLE \"" icon "\"";
    +  }
    +  print "1 VERSIONINFO";
    +  print " FILEVERSION " verc "";
    +  print " PRODUCTVERSION " verc "";
    +  print " FILEFLAGSMASK 0x3fL";
    +  print "#if defined(_DEBUG)"
    +  print " FILEFLAGS 0x" sprintf("%02x", ff + 1) "L";
    +  print "#else"
    +  print " FILEFLAGS 0x" sprintf("%02x", ff) "L";
    +  print "#endif"
    +  print " FILEOS 0x40004L";
    +  print " FILETYPE 0x1L";
    +  print " FILESUBTYPE 0x0L";
    +  print "BEGIN";
    +  print "  BLOCK \"StringFileInfo\"";
    +  print "  BEGIN";
    +  print "    BLOCK \"040904b0\"";
    +  print "    BEGIN";
    +  print "      VALUE \"Comments\", \"All rights reserved.  The "\
    +        "license is available at .  "\
    +        "The APR project pages are at .\\0\"";
    +  print "      VALUE \"CompanyName\", \"Apache Software Foundation\\0\"";
    +  print "      VALUE \"FileDescription\", \"" desc "\\0\"";
    +  print "      VALUE \"FileVersion\", \"" ver "\\0\"";
    +  print "      VALUE \"InternalName\", \"" file "\\0\"";
    +  print "      VALUE \"LegalCopyright\", \"Copyright © 2001 "\
    +        "The Apache Software Foundation.\\0\"";
    +  print "      VALUE \"OriginalFilename\", \"" file ".exe\\0\"";
    +  if (vendor) {
    +    print "      VALUE \"PrivateBuild\", \"" vendor "\\0\"";
    +  }
    +  if (special) {
    +    print "      VALUE \"SpecialBuild\", \"" vendor "\\0\"";
    +  }
    +  print "      VALUE \"ProductName\", \"Apache Portable Runtime\\0\"";
    +  print "      VALUE \"ProductVersion\", \"" ver "\\0\"";
    +  print "    END";
    +  print "  END";
    +  print "  BLOCK \"VarFileInfo\"";
    +  print "  BEGIN";
    +  print "    VALUE \"Translation\", 0x409, 1200";
    +  print "  END";
    +  print "END";
    +}
    \ No newline at end of file
    
    From 42f46776dd837dcc70bd29a6fe08a8eda9495a8a Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 16 Aug 2001 22:32:03 +0000
    Subject: [PATCH 2180/7878]   Gobble our local .rc autogeneration script,
     instead of httpd-2.0's
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62177 13f79535-47bb-0310-9956-ffa450edef68
    ---
     libapr.dsp | 10 +++++-----
     1 file changed, 5 insertions(+), 5 deletions(-)
    
    diff --git a/libapr.dsp b/libapr.dsp
    index d24e571ffdb..c727a0ef0ef 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -599,16 +599,16 @@ SOURCE=.\libapr.rc
     # End Source File
     # Begin Source File
     
    -SOURCE=..\..\build\win32\win32ver.awk
    +SOURCE=.\build\win32ver.awk
     
     !IF  "$(CFG)" == "libapr - Win32 Release"
     
     # PROP Ignore_Default_Tool 1
     # Begin Custom Build - Creating Version Resource
    -InputPath=..\..\build\win32\win32ver.awk
    +InputPath=.\build\win32ver.awk
     
     ".\libapr.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
    -	awk -f ../../build/win32/win32ver.awk libapr "Apache Portability Runtime Library"\
    +	awk -f ./build/win32ver.awk libapr "Apache Portability Runtime Library"\
      ../../include/ap_release.h > .\libapr.rc
     
     # End Custom Build
    @@ -617,10 +617,10 @@ InputPath=..\..\build\win32\win32ver.awk
     
     # PROP Ignore_Default_Tool 1
     # Begin Custom Build - Creating Version Resource
    -InputPath=..\..\build\win32\win32ver.awk
    +InputPath=.\build\win32ver.awk
     
     ".\libapr.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
    -	awk -f ../../build/win32/win32ver.awk libapr "Apache Portability Runtime Library"\
    +	awk -f ./build/win32ver.awk libapr "Apache Portability Runtime Library"\
      ../../include/ap_release.h > .\libapr.rc
     
     # End Custom Build
    
    From b140649f92528969f931d0944d8507992a178670 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 16 Aug 2001 22:37:03 +0000
    Subject: [PATCH 2181/7878]   Ugly, quick hack to get apr(-util) building
     without httpd
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62178 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/win32ver.awk | 34 ++++++++++++++++++++--------------
     1 file changed, 20 insertions(+), 14 deletions(-)
    
    diff --git a/build/win32ver.awk b/build/win32ver.awk
    index 810e5fc5bf6..0089c0b5102 100644
    --- a/build/win32ver.awk
    +++ b/build/win32ver.awk
    @@ -39,21 +39,27 @@ BEGIN {
           ver = substr($0, RSTART + 32, RLENGTH - 33);
         }
       }
    -
    -  verc = ver;
    -  gsub(/\./, ",", verc);
    -  if (build) {
    -    sub(/-.*/, "", verc)
    -    verc = verc "," build;
    -  } else if (sub(/-dev/, ",0", verc)) {
    -      ff = ff + 2;
    -  } else if (!sub(/-alpha/, ",10", verc)  \
    -          && !sub(/-beta/, ",100", verc)  \
    -          && !sub(/-gold/, ",200", verc)) {
    -    sub(/-.*/, "", verc);
    -    verc = verc "," 0;
    +  if (ver) {
    +    verc = ver;
    +    gsub(/\./, ",", verc);
    +    if (build) {
    +      sub(/-.*/, "", verc)
    +      verc = verc "," build;
    +    } else if (sub(/-dev/, ",0", verc)) {
    +        ff = ff + 2;
    +    } else if (!sub(/-alpha/, ",10", verc)  \
    +            && !sub(/-beta/, ",100", verc)  \
    +            && !sub(/-gold/, ",200", verc)) {
    +      sub(/-.*/, "", verc);
    +      verc = verc "," 0;
    +    }
    +  } else {
    +# XXX Gotta fix this for non-httpd installs :(
    +    ver = "0.0.0.0"
    +    verc = "0,0,0,0"
    +    ff = ff + 2;
       }
    -  
    +
       if (length(vendor)) {
         ff = ff + 8;
       }
    
    From 571008f83fca77069c574861f70f326adb7ead60 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 17 Aug 2001 01:38:51 +0000
    Subject: [PATCH 2182/7878]   Keep the date of the exported makefile consistent
     with the .dsp date.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62179 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/fixwin32mak.pl | 9 +++++++++
     1 file changed, 9 insertions(+)
    
    diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl
    index d7ca5bd1540..baf7b11d629 100644
    --- a/build/fixwin32mak.pl
    +++ b/build/fixwin32mak.pl
    @@ -48,5 +48,14 @@ sub fixcwd {
     	else {
     	    unlink $tname;
     	}
    +        $dname = $oname;
    +        $dname =~ s/.mak$/.dsp/;
    +	@dstat = stat($dname);
    +        @ostat = stat($oname);    
    +        if ($ostat[9] != $dstat[9]) {
    +            @onames = ($oname);
    +            utime $dstat[9], $dstat[9], @onames;
    +	    print "Touched datestamp for " . $oname . " in " . $File::Find::dir . "\n"; 
    +        }
         }
     }
    
    From 6f9c100f99ff14cefc1bad6f49b98cbdbf4836f2 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 17 Aug 2001 03:23:58 +0000
    Subject: [PATCH 2183/7878]   Given a choice between chasing my tail to keep
     these updated, and rolling   a set when we actually roll a tarball, I'll take
     the later, thank you.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62180 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr.mak    | 1863 ---------------------------------------------------
     libapr.mak | 1878 ----------------------------------------------------
     2 files changed, 3741 deletions(-)
     delete mode 100644 apr.mak
     delete mode 100644 libapr.mak
    
    diff --git a/apr.mak b/apr.mak
    deleted file mode 100644
    index bb67cd3e001..00000000000
    --- a/apr.mak
    +++ /dev/null
    @@ -1,1863 +0,0 @@
    -# Microsoft Developer Studio Generated NMAKE File, Based on apr.dsp
    -!IF "$(CFG)" == ""
    -CFG=apr - Win32 Debug
    -!MESSAGE No configuration specified. Defaulting to apr - Win32 Debug.
    -!ENDIF 
    -
    -!IF "$(CFG)" != "apr - Win32 Release" && "$(CFG)" != "apr - Win32 Debug"
    -!MESSAGE Invalid configuration "$(CFG)" specified.
    -!MESSAGE You can specify a configuration when running NMAKE
    -!MESSAGE by defining the macro CFG on the command line. For example:
    -!MESSAGE 
    -!MESSAGE NMAKE /f "apr.mak" CFG="apr - Win32 Debug"
    -!MESSAGE 
    -!MESSAGE Possible choices for configuration are:
    -!MESSAGE 
    -!MESSAGE "apr - Win32 Release" (based on "Win32 (x86) Static Library")
    -!MESSAGE "apr - Win32 Debug" (based on "Win32 (x86) Static Library")
    -!MESSAGE 
    -!ERROR An invalid configuration is specified.
    -!ENDIF 
    -
    -!IF "$(OS)" == "Windows_NT"
    -NULL=
    -!ELSE 
    -NULL=nul
    -!ENDIF 
    -
    -CPP=cl.exe
    -
    -!IF  "$(CFG)" == "apr - Win32 Release"
    -
    -OUTDIR=.\LibR
    -INTDIR=.\LibR
    -# Begin Custom Macros
    -OutDir=.\LibR
    -# End Custom Macros
    -
    -!IF "$(RECURSE)" == "0" 
    -
    -ALL : "$(OUTDIR)\apr.lib"
    -
    -!ELSE 
    -
    -ALL : "$(OUTDIR)\apr.lib"
    -
    -!ENDIF 
    -
    -CLEAN :
    -	-@erase "$(INTDIR)\access.obj"
    -	-@erase "$(INTDIR)\apr.idb"
    -	-@erase "$(INTDIR)\apr_cpystrn.obj"
    -	-@erase "$(INTDIR)\apr_fnmatch.obj"
    -	-@erase "$(INTDIR)\apr_getpass.obj"
    -	-@erase "$(INTDIR)\apr_hash.obj"
    -	-@erase "$(INTDIR)\apr_md5.obj"
    -	-@erase "$(INTDIR)\apr_pools.obj"
    -	-@erase "$(INTDIR)\apr_sms.obj"
    -	-@erase "$(INTDIR)\apr_sms_blocks.obj"
    -	-@erase "$(INTDIR)\apr_sms_std.obj"
    -	-@erase "$(INTDIR)\apr_sms_tracking.obj"
    -	-@erase "$(INTDIR)\apr_sms_trivial.obj"
    -	-@erase "$(INTDIR)\apr_snprintf.obj"
    -	-@erase "$(INTDIR)\apr_strings.obj"
    -	-@erase "$(INTDIR)\apr_strnatcmp.obj"
    -	-@erase "$(INTDIR)\apr_strtok.obj"
    -	-@erase "$(INTDIR)\apr_tables.obj"
    -	-@erase "$(INTDIR)\common.obj"
    -	-@erase "$(INTDIR)\dir.obj"
    -	-@erase "$(INTDIR)\dso.obj"
    -	-@erase "$(INTDIR)\errorcodes.obj"
    -	-@erase "$(INTDIR)\fileacc.obj"
    -	-@erase "$(INTDIR)\filedup.obj"
    -	-@erase "$(INTDIR)\filepath.obj"
    -	-@erase "$(INTDIR)\filestat.obj"
    -	-@erase "$(INTDIR)\flock.obj"
    -	-@erase "$(INTDIR)\fullrw.obj"
    -	-@erase "$(INTDIR)\getopt.obj"
    -	-@erase "$(INTDIR)\getuuid.obj"
    -	-@erase "$(INTDIR)\groupinfo.obj"
    -	-@erase "$(INTDIR)\inet_ntop.obj"
    -	-@erase "$(INTDIR)\inet_pton.obj"
    -	-@erase "$(INTDIR)\locks.obj"
    -	-@erase "$(INTDIR)\misc.obj"
    -	-@erase "$(INTDIR)\mmap.obj"
    -	-@erase "$(INTDIR)\names.obj"
    -	-@erase "$(INTDIR)\open.obj"
    -	-@erase "$(INTDIR)\otherchild.obj"
    -	-@erase "$(INTDIR)\pipe.obj"
    -	-@erase "$(INTDIR)\poll.obj"
    -	-@erase "$(INTDIR)\proc.obj"
    -	-@erase "$(INTDIR)\rand.obj"
    -	-@erase "$(INTDIR)\readwrite.obj"
    -	-@erase "$(INTDIR)\seek.obj"
    -	-@erase "$(INTDIR)\sendrecv.obj"
    -	-@erase "$(INTDIR)\signals.obj"
    -	-@erase "$(INTDIR)\sockaddr.obj"
    -	-@erase "$(INTDIR)\sockets.obj"
    -	-@erase "$(INTDIR)\sockopt.obj"
    -	-@erase "$(INTDIR)\start.obj"
    -	-@erase "$(INTDIR)\thread.obj"
    -	-@erase "$(INTDIR)\threadpriv.obj"
    -	-@erase "$(INTDIR)\time.obj"
    -	-@erase "$(INTDIR)\timestr.obj"
    -	-@erase "$(INTDIR)\userinfo.obj"
    -	-@erase "$(INTDIR)\utf8_ucs2.obj"
    -	-@erase "$(INTDIR)\uuid.obj"
    -	-@erase "$(OUTDIR)\apr.lib"
    -
    -"$(OUTDIR)" :
    -    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
    -
    -RSC=rc.exe
    -CPP_PROJ=/nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I\
    - "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D\
    - "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\
    - /Fd"$(INTDIR)\apr" /FD /c 
    -CPP_OBJS=.\LibR/
    -CPP_SBRS=.
    -BSC32=bscmake.exe
    -BSC32_FLAGS=/nologo /o"$(OUTDIR)\apr.bsc" 
    -BSC32_SBRS= \
    -	
    -LIB32=link.exe -lib
    -LIB32_FLAGS=/nologo /out:"$(OUTDIR)\apr.lib" 
    -LIB32_OBJS= \
    -	"$(INTDIR)\access.obj" \
    -	"$(INTDIR)\apr_cpystrn.obj" \
    -	"$(INTDIR)\apr_fnmatch.obj" \
    -	"$(INTDIR)\apr_getpass.obj" \
    -	"$(INTDIR)\apr_hash.obj" \
    -	"$(INTDIR)\apr_md5.obj" \
    -	"$(INTDIR)\apr_pools.obj" \
    -	"$(INTDIR)\apr_sms.obj" \
    -	"$(INTDIR)\apr_sms_blocks.obj" \
    -	"$(INTDIR)\apr_sms_std.obj" \
    -	"$(INTDIR)\apr_sms_tracking.obj" \
    -	"$(INTDIR)\apr_sms_trivial.obj" \
    -	"$(INTDIR)\apr_snprintf.obj" \
    -	"$(INTDIR)\apr_strings.obj" \
    -	"$(INTDIR)\apr_strnatcmp.obj" \
    -	"$(INTDIR)\apr_strtok.obj" \
    -	"$(INTDIR)\apr_tables.obj" \
    -	"$(INTDIR)\common.obj" \
    -	"$(INTDIR)\dir.obj" \
    -	"$(INTDIR)\dso.obj" \
    -	"$(INTDIR)\errorcodes.obj" \
    -	"$(INTDIR)\fileacc.obj" \
    -	"$(INTDIR)\filedup.obj" \
    -	"$(INTDIR)\filepath.obj" \
    -	"$(INTDIR)\filestat.obj" \
    -	"$(INTDIR)\flock.obj" \
    -	"$(INTDIR)\fullrw.obj" \
    -	"$(INTDIR)\getopt.obj" \
    -	"$(INTDIR)\getuuid.obj" \
    -	"$(INTDIR)\groupinfo.obj" \
    -	"$(INTDIR)\inet_ntop.obj" \
    -	"$(INTDIR)\inet_pton.obj" \
    -	"$(INTDIR)\locks.obj" \
    -	"$(INTDIR)\misc.obj" \
    -	"$(INTDIR)\mmap.obj" \
    -	"$(INTDIR)\names.obj" \
    -	"$(INTDIR)\open.obj" \
    -	"$(INTDIR)\otherchild.obj" \
    -	"$(INTDIR)\pipe.obj" \
    -	"$(INTDIR)\poll.obj" \
    -	"$(INTDIR)\proc.obj" \
    -	"$(INTDIR)\rand.obj" \
    -	"$(INTDIR)\readwrite.obj" \
    -	"$(INTDIR)\seek.obj" \
    -	"$(INTDIR)\sendrecv.obj" \
    -	"$(INTDIR)\signals.obj" \
    -	"$(INTDIR)\sockaddr.obj" \
    -	"$(INTDIR)\sockets.obj" \
    -	"$(INTDIR)\sockopt.obj" \
    -	"$(INTDIR)\start.obj" \
    -	"$(INTDIR)\thread.obj" \
    -	"$(INTDIR)\threadpriv.obj" \
    -	"$(INTDIR)\time.obj" \
    -	"$(INTDIR)\timestr.obj" \
    -	"$(INTDIR)\userinfo.obj" \
    -	"$(INTDIR)\utf8_ucs2.obj" \
    -	"$(INTDIR)\uuid.obj"
    -
    -"$(OUTDIR)\apr.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
    -    $(LIB32) @<<
    -  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
    -<<
    -
    -!ELSEIF  "$(CFG)" == "apr - Win32 Debug"
    -
    -OUTDIR=.\LibD
    -INTDIR=.\LibD
    -# Begin Custom Macros
    -OutDir=.\LibD
    -# End Custom Macros
    -
    -!IF "$(RECURSE)" == "0" 
    -
    -ALL : "$(OUTDIR)\apr.lib"
    -
    -!ELSE 
    -
    -ALL : "$(OUTDIR)\apr.lib"
    -
    -!ENDIF 
    -
    -CLEAN :
    -	-@erase "$(INTDIR)\access.obj"
    -	-@erase "$(INTDIR)\apr.idb"
    -	-@erase "$(INTDIR)\apr.pdb"
    -	-@erase "$(INTDIR)\apr_cpystrn.obj"
    -	-@erase "$(INTDIR)\apr_fnmatch.obj"
    -	-@erase "$(INTDIR)\apr_getpass.obj"
    -	-@erase "$(INTDIR)\apr_hash.obj"
    -	-@erase "$(INTDIR)\apr_md5.obj"
    -	-@erase "$(INTDIR)\apr_pools.obj"
    -	-@erase "$(INTDIR)\apr_sms.obj"
    -	-@erase "$(INTDIR)\apr_sms_blocks.obj"
    -	-@erase "$(INTDIR)\apr_sms_std.obj"
    -	-@erase "$(INTDIR)\apr_sms_tracking.obj"
    -	-@erase "$(INTDIR)\apr_sms_trivial.obj"
    -	-@erase "$(INTDIR)\apr_snprintf.obj"
    -	-@erase "$(INTDIR)\apr_strings.obj"
    -	-@erase "$(INTDIR)\apr_strnatcmp.obj"
    -	-@erase "$(INTDIR)\apr_strtok.obj"
    -	-@erase "$(INTDIR)\apr_tables.obj"
    -	-@erase "$(INTDIR)\common.obj"
    -	-@erase "$(INTDIR)\dir.obj"
    -	-@erase "$(INTDIR)\dso.obj"
    -	-@erase "$(INTDIR)\errorcodes.obj"
    -	-@erase "$(INTDIR)\fileacc.obj"
    -	-@erase "$(INTDIR)\filedup.obj"
    -	-@erase "$(INTDIR)\filepath.obj"
    -	-@erase "$(INTDIR)\filestat.obj"
    -	-@erase "$(INTDIR)\flock.obj"
    -	-@erase "$(INTDIR)\fullrw.obj"
    -	-@erase "$(INTDIR)\getopt.obj"
    -	-@erase "$(INTDIR)\getuuid.obj"
    -	-@erase "$(INTDIR)\groupinfo.obj"
    -	-@erase "$(INTDIR)\inet_ntop.obj"
    -	-@erase "$(INTDIR)\inet_pton.obj"
    -	-@erase "$(INTDIR)\locks.obj"
    -	-@erase "$(INTDIR)\misc.obj"
    -	-@erase "$(INTDIR)\mmap.obj"
    -	-@erase "$(INTDIR)\names.obj"
    -	-@erase "$(INTDIR)\open.obj"
    -	-@erase "$(INTDIR)\otherchild.obj"
    -	-@erase "$(INTDIR)\pipe.obj"
    -	-@erase "$(INTDIR)\poll.obj"
    -	-@erase "$(INTDIR)\proc.obj"
    -	-@erase "$(INTDIR)\rand.obj"
    -	-@erase "$(INTDIR)\readwrite.obj"
    -	-@erase "$(INTDIR)\seek.obj"
    -	-@erase "$(INTDIR)\sendrecv.obj"
    -	-@erase "$(INTDIR)\signals.obj"
    -	-@erase "$(INTDIR)\sockaddr.obj"
    -	-@erase "$(INTDIR)\sockets.obj"
    -	-@erase "$(INTDIR)\sockopt.obj"
    -	-@erase "$(INTDIR)\start.obj"
    -	-@erase "$(INTDIR)\thread.obj"
    -	-@erase "$(INTDIR)\threadpriv.obj"
    -	-@erase "$(INTDIR)\time.obj"
    -	-@erase "$(INTDIR)\timestr.obj"
    -	-@erase "$(INTDIR)\userinfo.obj"
    -	-@erase "$(INTDIR)\utf8_ucs2.obj"
    -	-@erase "$(INTDIR)\uuid.obj"
    -	-@erase "$(OUTDIR)\apr.lib"
    -
    -"$(OUTDIR)" :
    -    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
    -
    -RSC=rc.exe
    -CPP_PROJ=/nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I\
    - "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D\
    - "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\
    - /Fd"$(INTDIR)\apr" /FD /c 
    -CPP_OBJS=.\LibD/
    -CPP_SBRS=.
    -BSC32=bscmake.exe
    -BSC32_FLAGS=/nologo /o"$(OUTDIR)\apr.bsc" 
    -BSC32_SBRS= \
    -	
    -LIB32=link.exe -lib
    -LIB32_FLAGS=/nologo /out:"$(OUTDIR)\apr.lib" 
    -LIB32_OBJS= \
    -	"$(INTDIR)\access.obj" \
    -	"$(INTDIR)\apr_cpystrn.obj" \
    -	"$(INTDIR)\apr_fnmatch.obj" \
    -	"$(INTDIR)\apr_getpass.obj" \
    -	"$(INTDIR)\apr_hash.obj" \
    -	"$(INTDIR)\apr_md5.obj" \
    -	"$(INTDIR)\apr_pools.obj" \
    -	"$(INTDIR)\apr_sms.obj" \
    -	"$(INTDIR)\apr_sms_blocks.obj" \
    -	"$(INTDIR)\apr_sms_std.obj" \
    -	"$(INTDIR)\apr_sms_tracking.obj" \
    -	"$(INTDIR)\apr_sms_trivial.obj" \
    -	"$(INTDIR)\apr_snprintf.obj" \
    -	"$(INTDIR)\apr_strings.obj" \
    -	"$(INTDIR)\apr_strnatcmp.obj" \
    -	"$(INTDIR)\apr_strtok.obj" \
    -	"$(INTDIR)\apr_tables.obj" \
    -	"$(INTDIR)\common.obj" \
    -	"$(INTDIR)\dir.obj" \
    -	"$(INTDIR)\dso.obj" \
    -	"$(INTDIR)\errorcodes.obj" \
    -	"$(INTDIR)\fileacc.obj" \
    -	"$(INTDIR)\filedup.obj" \
    -	"$(INTDIR)\filepath.obj" \
    -	"$(INTDIR)\filestat.obj" \
    -	"$(INTDIR)\flock.obj" \
    -	"$(INTDIR)\fullrw.obj" \
    -	"$(INTDIR)\getopt.obj" \
    -	"$(INTDIR)\getuuid.obj" \
    -	"$(INTDIR)\groupinfo.obj" \
    -	"$(INTDIR)\inet_ntop.obj" \
    -	"$(INTDIR)\inet_pton.obj" \
    -	"$(INTDIR)\locks.obj" \
    -	"$(INTDIR)\misc.obj" \
    -	"$(INTDIR)\mmap.obj" \
    -	"$(INTDIR)\names.obj" \
    -	"$(INTDIR)\open.obj" \
    -	"$(INTDIR)\otherchild.obj" \
    -	"$(INTDIR)\pipe.obj" \
    -	"$(INTDIR)\poll.obj" \
    -	"$(INTDIR)\proc.obj" \
    -	"$(INTDIR)\rand.obj" \
    -	"$(INTDIR)\readwrite.obj" \
    -	"$(INTDIR)\seek.obj" \
    -	"$(INTDIR)\sendrecv.obj" \
    -	"$(INTDIR)\signals.obj" \
    -	"$(INTDIR)\sockaddr.obj" \
    -	"$(INTDIR)\sockets.obj" \
    -	"$(INTDIR)\sockopt.obj" \
    -	"$(INTDIR)\start.obj" \
    -	"$(INTDIR)\thread.obj" \
    -	"$(INTDIR)\threadpriv.obj" \
    -	"$(INTDIR)\time.obj" \
    -	"$(INTDIR)\timestr.obj" \
    -	"$(INTDIR)\userinfo.obj" \
    -	"$(INTDIR)\utf8_ucs2.obj" \
    -	"$(INTDIR)\uuid.obj"
    -
    -"$(OUTDIR)\apr.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
    -    $(LIB32) @<<
    -  $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
    -<<
    -
    -!ENDIF 
    -
    -.c{$(CPP_OBJS)}.obj::
    -   $(CPP) @<<
    -   $(CPP_PROJ) $< 
    -<<
    -
    -.cpp{$(CPP_OBJS)}.obj::
    -   $(CPP) @<<
    -   $(CPP_PROJ) $< 
    -<<
    -
    -.cxx{$(CPP_OBJS)}.obj::
    -   $(CPP) @<<
    -   $(CPP_PROJ) $< 
    -<<
    -
    -.c{$(CPP_SBRS)}.sbr::
    -   $(CPP) @<<
    -   $(CPP_PROJ) $< 
    -<<
    -
    -.cpp{$(CPP_SBRS)}.sbr::
    -   $(CPP) @<<
    -   $(CPP_PROJ) $< 
    -<<
    -
    -.cxx{$(CPP_SBRS)}.sbr::
    -   $(CPP) @<<
    -   $(CPP_PROJ) $< 
    -<<
    -
    -
    -!IF "$(CFG)" == "apr - Win32 Release" || "$(CFG)" == "apr - Win32 Debug"
    -SOURCE=.\dso\win32\dso.c
    -DEP_CPP_DSO_C=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\dso.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\dso.obj" : $(SOURCE) $(DEP_CPP_DSO_C) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\dir.c
    -DEP_CPP_DIR_C=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\atime.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\unix\fileacc.c
    -DEP_CPP_FILEA=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\filedup.c
    -DEP_CPP_FILED=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\inherit.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\filepath.c
    -DEP_CPP_FILEP=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\filepath.obj" : $(SOURCE) $(DEP_CPP_FILEP) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\filestat.c
    -DEP_CPP_FILES=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\atime.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\flock.c
    -DEP_CPP_FLOCK=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\flock.obj" : $(SOURCE) $(DEP_CPP_FLOCK) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\unix\fullrw.c
    -DEP_CPP_FULLR=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	
    -
    -"$(INTDIR)\fullrw.obj" : $(SOURCE) $(DEP_CPP_FULLR) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\open.c
    -DEP_CPP_OPEN_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\pipe.c
    -DEP_CPP_PIPE_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\readwrite.c
    -DEP_CPP_READW=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\atime.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\seek.c
    -DEP_CPP_SEEK_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\i18n\unix\utf8_ucs2.c
    -DEP_CPP_UTF8_=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	
    -
    -"$(INTDIR)\utf8_ucs2.obj" : $(SOURCE) $(DEP_CPP_UTF8_) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\i18n\unix\xlate.c
    -SOURCE=.\locks\win32\locks.c
    -DEP_CPP_LOCKS=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\locks.h"\
    -	
    -
    -"$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\memory\unix\apr_pools.c
    -DEP_CPP_APR_P=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_hash.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\memory\unix\apr_sms.c
    -DEP_CPP_APR_S=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_hash.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\memory\unix\sms_private.h"\
    -	
    -
    -"$(INTDIR)\apr_sms.obj" : $(SOURCE) $(DEP_CPP_APR_S) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\memory\unix\apr_sms_blocks.c
    -DEP_CPP_APR_SM=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_sms_blocks.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\memory\unix\sms_private.h"\
    -	
    -
    -"$(INTDIR)\apr_sms_blocks.obj" : $(SOURCE) $(DEP_CPP_APR_SM) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\memory\unix\apr_sms_std.c
    -DEP_CPP_APR_SMS=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\memory\unix\sms_private.h"\
    -	
    -
    -"$(INTDIR)\apr_sms_std.obj" : $(SOURCE) $(DEP_CPP_APR_SMS) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\memory\unix\apr_sms_tracking.c
    -DEP_CPP_APR_SMS_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_sms_tracking.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\memory\unix\sms_private.h"\
    -	
    -
    -"$(INTDIR)\apr_sms_tracking.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\memory\unix\apr_sms_trivial.c
    -DEP_CPP_APR_SMS_T=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_sms_trivial.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\memory\unix\sms_private.h"\
    -	
    -
    -"$(INTDIR)\apr_sms_trivial.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_T) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\unix\errorcodes.c
    -DEP_CPP_ERROR=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\errorcodes.obj" : $(SOURCE) $(DEP_CPP_ERROR) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\unix\getopt.c
    -DEP_CPP_GETOP=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\win32\getuuid.c
    -DEP_CPP_GETUU=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_uuid.h"\
    -	
    -
    -"$(INTDIR)\getuuid.obj" : $(SOURCE) $(DEP_CPP_GETUU) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\win32\misc.c
    -DEP_CPP_MISC_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\misc.obj" : $(SOURCE) $(DEP_CPP_MISC_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\win32\names.c
    -DEP_CPP_NAMES=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\unix\otherchild.c
    -DEP_CPP_OTHER=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	".\include\arch\win32\threadproc.h"\
    -	
    -
    -"$(INTDIR)\otherchild.obj" : $(SOURCE) $(DEP_CPP_OTHER) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\win32\rand.c
    -DEP_CPP_RAND_=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\rand.obj" : $(SOURCE) $(DEP_CPP_RAND_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\unix\start.c
    -DEP_CPP_START=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_signal.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\locks.h"\
    -	
    -
    -"$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\unix\uuid.c
    -DEP_CPP_UUID_=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_uuid.h"\
    -	
    -
    -"$(INTDIR)\uuid.obj" : $(SOURCE) $(DEP_CPP_UUID_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\mmap\unix\common.c
    -DEP_CPP_COMMO=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_mmap.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\common.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\mmap\win32\mmap.c
    -DEP_CPP_MMAP_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_mmap.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\mmap.obj" : $(SOURCE) $(DEP_CPP_MMAP_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\network_io\unix\inet_ntop.c
    -DEP_CPP_INET_=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\networkio.h"\
    -	
    -
    -"$(INTDIR)\inet_ntop.obj" : $(SOURCE) $(DEP_CPP_INET_) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\network_io\unix\inet_pton.c
    -DEP_CPP_INET_P=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\networkio.h"\
    -	
    -
    -"$(INTDIR)\inet_pton.obj" : $(SOURCE) $(DEP_CPP_INET_P) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\network_io\win32\poll.c
    -DEP_CPP_POLL_=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\networkio.h"\
    -	
    -
    -"$(INTDIR)\poll.obj" : $(SOURCE) $(DEP_CPP_POLL_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\network_io\unix\sa_common.c
    -SOURCE=.\network_io\win32\sendrecv.c
    -DEP_CPP_SENDR=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	".\include\arch\win32\networkio.h"\
    -	
    -
    -"$(INTDIR)\sendrecv.obj" : $(SOURCE) $(DEP_CPP_SENDR) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\network_io\win32\sockaddr.c
    -DEP_CPP_SOCKA=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\networkio.h"\
    -	".\network_io\unix\sa_common.c"\
    -	
    -
    -"$(INTDIR)\sockaddr.obj" : $(SOURCE) $(DEP_CPP_SOCKA) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\network_io\win32\sockets.c
    -DEP_CPP_SOCKE=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\networkio.h"\
    -	
    -
    -"$(INTDIR)\sockets.obj" : $(SOURCE) $(DEP_CPP_SOCKE) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\network_io\win32\sockopt.c
    -DEP_CPP_SOCKO=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\networkio.h"\
    -	
    -
    -"$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\passwd\apr_getpass.c
    -DEP_CPP_APR_G=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_getpass.obj" : $(SOURCE) $(DEP_CPP_APR_G) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\passwd\apr_md5.c
    -DEP_CPP_APR_M=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_md5.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_md5.obj" : $(SOURCE) $(DEP_CPP_APR_M) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\shmem\win32\shmem.c
    -SOURCE=.\strings\apr_cpystrn.c
    -DEP_CPP_APR_C=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_cpystrn.obj" : $(SOURCE) $(DEP_CPP_APR_C) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\strings\apr_fnmatch.c
    -DEP_CPP_APR_F=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_fnmatch.h"\
    -	".\include\apr_lib.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_fnmatch.obj" : $(SOURCE) $(DEP_CPP_APR_F) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\strings\apr_snprintf.c
    -DEP_CPP_APR_SN=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_SN) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\strings\apr_strings.c
    -DEP_CPP_APR_ST=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_strings.obj" : $(SOURCE) $(DEP_CPP_APR_ST) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\strings\apr_strnatcmp.c
    -DEP_CPP_APR_STR=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	
    -
    -"$(INTDIR)\apr_strnatcmp.obj" : $(SOURCE) $(DEP_CPP_APR_STR) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\strings\apr_strtok.c
    -DEP_CPP_APR_STRT=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_want.h"\
    -	
    -
    -"$(INTDIR)\apr_strtok.obj" : $(SOURCE) $(DEP_CPP_APR_STRT) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\tables\apr_hash.c
    -DEP_CPP_APR_H=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_hash.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_hash.obj" : $(SOURCE) $(DEP_CPP_APR_H) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\tables\apr_tables.c
    -DEP_CPP_APR_T=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_tables.obj" : $(SOURCE) $(DEP_CPP_APR_T) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\threadproc\win32\proc.c
    -DEP_CPP_PROC_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	".\include\arch\win32\threadproc.h"\
    -	
    -
    -"$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\threadproc\win32\signals.c
    -DEP_CPP_SIGNA=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	".\include\arch\win32\threadproc.h"\
    -	
    -
    -"$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\threadproc\win32\thread.c
    -DEP_CPP_THREA=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\threadproc.h"\
    -	
    -
    -"$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\threadproc\win32\threadpriv.c
    -DEP_CPP_THREAD=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\threadproc.h"\
    -	
    -
    -"$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\time\win32\access.c
    -DEP_CPP_ACCES=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_time.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\atime.h"\
    -	
    -
    -"$(INTDIR)\access.obj" : $(SOURCE) $(DEP_CPP_ACCES) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\time\win32\time.c
    -DEP_CPP_TIME_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\atime.h"\
    -	
    -
    -"$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\time\win32\timestr.c
    -DEP_CPP_TIMES=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\atime.h"\
    -	
    -
    -"$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\user\win32\groupinfo.c
    -DEP_CPP_GROUP=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\groupinfo.obj" : $(SOURCE) $(DEP_CPP_GROUP) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\user\win32\userinfo.c
    -DEP_CPP_USERI=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\include\apr.hw
    -
    -!IF  "$(CFG)" == "apr - Win32 Release"
    -
    -InputPath=.\include\apr.hw
    -
    -".\include\apr.h"	 : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
    -	copy .\include\apr.hw .\include\apr.h > nul 
    -	echo Created apr.h from apr.hw 
    -	
    -
    -!ELSEIF  "$(CFG)" == "apr - Win32 Debug"
    -
    -InputPath=.\include\apr.hw
    -
    -".\include\apr.h"	 : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
    -	copy .\include\apr.hw .\include\apr.h > nul 
    -	echo Created apr.h from apr.hw 
    -	
    -
    -!ENDIF 
    -
    -
    -!ENDIF 
    -
    diff --git a/libapr.mak b/libapr.mak
    deleted file mode 100644
    index 4a80bb64429..00000000000
    --- a/libapr.mak
    +++ /dev/null
    @@ -1,1878 +0,0 @@
    -# Microsoft Developer Studio Generated NMAKE File, Based on libapr.dsp
    -!IF "$(CFG)" == ""
    -CFG=libapr - Win32 Debug
    -!MESSAGE No configuration specified. Defaulting to libapr - Win32 Debug.
    -!ENDIF 
    -
    -!IF "$(CFG)" != "libapr - Win32 Release" && "$(CFG)" != "libapr - Win32 Debug"
    -!MESSAGE Invalid configuration "$(CFG)" specified.
    -!MESSAGE You can specify a configuration when running NMAKE
    -!MESSAGE by defining the macro CFG on the command line. For example:
    -!MESSAGE 
    -!MESSAGE NMAKE /f "libapr.mak" CFG="libapr - Win32 Debug"
    -!MESSAGE 
    -!MESSAGE Possible choices for configuration are:
    -!MESSAGE 
    -!MESSAGE "libapr - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
    -!MESSAGE "libapr - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
    -!MESSAGE 
    -!ERROR An invalid configuration is specified.
    -!ENDIF 
    -
    -!IF "$(OS)" == "Windows_NT"
    -NULL=
    -!ELSE 
    -NULL=nul
    -!ENDIF 
    -
    -CPP=cl.exe
    -MTL=midl.exe
    -RSC=rc.exe
    -
    -!IF  "$(CFG)" == "libapr - Win32 Release"
    -
    -OUTDIR=.\Release
    -INTDIR=.\Release
    -# Begin Custom Macros
    -OutDir=.\Release
    -# End Custom Macros
    -
    -!IF "$(RECURSE)" == "0" 
    -
    -ALL : "$(OUTDIR)\libapr.dll"
    -
    -!ELSE 
    -
    -ALL : "$(OUTDIR)\libapr.dll"
    -
    -!ENDIF 
    -
    -CLEAN :
    -	-@erase "$(INTDIR)\access.obj"
    -	-@erase "$(INTDIR)\apr.idb"
    -	-@erase "$(INTDIR)\apr_cpystrn.obj"
    -	-@erase "$(INTDIR)\apr_fnmatch.obj"
    -	-@erase "$(INTDIR)\apr_getpass.obj"
    -	-@erase "$(INTDIR)\apr_hash.obj"
    -	-@erase "$(INTDIR)\apr_md5.obj"
    -	-@erase "$(INTDIR)\apr_pools.obj"
    -	-@erase "$(INTDIR)\apr_sms.obj"
    -	-@erase "$(INTDIR)\apr_sms_blocks.obj"
    -	-@erase "$(INTDIR)\apr_sms_std.obj"
    -	-@erase "$(INTDIR)\apr_sms_tracking.obj"
    -	-@erase "$(INTDIR)\apr_sms_trivial.obj"
    -	-@erase "$(INTDIR)\apr_snprintf.obj"
    -	-@erase "$(INTDIR)\apr_strings.obj"
    -	-@erase "$(INTDIR)\apr_strnatcmp.obj"
    -	-@erase "$(INTDIR)\apr_strtok.obj"
    -	-@erase "$(INTDIR)\apr_tables.obj"
    -	-@erase "$(INTDIR)\common.obj"
    -	-@erase "$(INTDIR)\dir.obj"
    -	-@erase "$(INTDIR)\dso.obj"
    -	-@erase "$(INTDIR)\errorcodes.obj"
    -	-@erase "$(INTDIR)\fileacc.obj"
    -	-@erase "$(INTDIR)\filedup.obj"
    -	-@erase "$(INTDIR)\filepath.obj"
    -	-@erase "$(INTDIR)\filestat.obj"
    -	-@erase "$(INTDIR)\flock.obj"
    -	-@erase "$(INTDIR)\fullrw.obj"
    -	-@erase "$(INTDIR)\getopt.obj"
    -	-@erase "$(INTDIR)\getuuid.obj"
    -	-@erase "$(INTDIR)\groupinfo.obj"
    -	-@erase "$(INTDIR)\inet_ntop.obj"
    -	-@erase "$(INTDIR)\inet_pton.obj"
    -	-@erase "$(INTDIR)\locks.obj"
    -	-@erase "$(INTDIR)\misc.obj"
    -	-@erase "$(INTDIR)\mmap.obj"
    -	-@erase "$(INTDIR)\names.obj"
    -	-@erase "$(INTDIR)\open.obj"
    -	-@erase "$(INTDIR)\otherchild.obj"
    -	-@erase "$(INTDIR)\pipe.obj"
    -	-@erase "$(INTDIR)\poll.obj"
    -	-@erase "$(INTDIR)\proc.obj"
    -	-@erase "$(INTDIR)\rand.obj"
    -	-@erase "$(INTDIR)\readwrite.obj"
    -	-@erase "$(INTDIR)\seek.obj"
    -	-@erase "$(INTDIR)\sendrecv.obj"
    -	-@erase "$(INTDIR)\signals.obj"
    -	-@erase "$(INTDIR)\sockaddr.obj"
    -	-@erase "$(INTDIR)\sockets.obj"
    -	-@erase "$(INTDIR)\sockopt.obj"
    -	-@erase "$(INTDIR)\start.obj"
    -	-@erase "$(INTDIR)\thread.obj"
    -	-@erase "$(INTDIR)\threadpriv.obj"
    -	-@erase "$(INTDIR)\time.obj"
    -	-@erase "$(INTDIR)\timestr.obj"
    -	-@erase "$(INTDIR)\userinfo.obj"
    -	-@erase "$(INTDIR)\utf8_ucs2.obj"
    -	-@erase "$(INTDIR)\uuid.obj"
    -	-@erase "$(OUTDIR)\libapr.dll"
    -	-@erase "$(OUTDIR)\libapr.exp"
    -	-@erase "$(OUTDIR)\libapr.lib"
    -	-@erase "$(OUTDIR)\libapr.map"
    -
    -"$(OUTDIR)" :
    -    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
    -
    -CPP_PROJ=/nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I\
    - "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D\
    - "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\
    - /Fd"$(INTDIR)\apr" /FD /c 
    -CPP_OBJS=.\Release/
    -CPP_SBRS=.
    -MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" 
    -BSC32=bscmake.exe
    -BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapr.bsc" 
    -BSC32_SBRS= \
    -	
    -LINK32=link.exe
    -LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo\
    - /base:"0x6EE00000" /subsystem:windows /dll /incremental:no\
    - /pdb:"$(OUTDIR)\libapr.pdb" /map:"$(INTDIR)\libapr.map" /machine:I386\
    - /out:"$(OUTDIR)\libapr.dll" /implib:"$(OUTDIR)\libapr.lib" /OPT:NOREF 
    -LINK32_OBJS= \
    -	"$(INTDIR)\access.obj" \
    -	"$(INTDIR)\apr_cpystrn.obj" \
    -	"$(INTDIR)\apr_fnmatch.obj" \
    -	"$(INTDIR)\apr_getpass.obj" \
    -	"$(INTDIR)\apr_hash.obj" \
    -	"$(INTDIR)\apr_md5.obj" \
    -	"$(INTDIR)\apr_pools.obj" \
    -	"$(INTDIR)\apr_sms.obj" \
    -	"$(INTDIR)\apr_sms_blocks.obj" \
    -	"$(INTDIR)\apr_sms_std.obj" \
    -	"$(INTDIR)\apr_sms_tracking.obj" \
    -	"$(INTDIR)\apr_sms_trivial.obj" \
    -	"$(INTDIR)\apr_snprintf.obj" \
    -	"$(INTDIR)\apr_strings.obj" \
    -	"$(INTDIR)\apr_strnatcmp.obj" \
    -	"$(INTDIR)\apr_strtok.obj" \
    -	"$(INTDIR)\apr_tables.obj" \
    -	"$(INTDIR)\common.obj" \
    -	"$(INTDIR)\dir.obj" \
    -	"$(INTDIR)\dso.obj" \
    -	"$(INTDIR)\errorcodes.obj" \
    -	"$(INTDIR)\fileacc.obj" \
    -	"$(INTDIR)\filedup.obj" \
    -	"$(INTDIR)\filepath.obj" \
    -	"$(INTDIR)\filestat.obj" \
    -	"$(INTDIR)\flock.obj" \
    -	"$(INTDIR)\fullrw.obj" \
    -	"$(INTDIR)\getopt.obj" \
    -	"$(INTDIR)\getuuid.obj" \
    -	"$(INTDIR)\groupinfo.obj" \
    -	"$(INTDIR)\inet_ntop.obj" \
    -	"$(INTDIR)\inet_pton.obj" \
    -	"$(INTDIR)\locks.obj" \
    -	"$(INTDIR)\misc.obj" \
    -	"$(INTDIR)\mmap.obj" \
    -	"$(INTDIR)\names.obj" \
    -	"$(INTDIR)\open.obj" \
    -	"$(INTDIR)\otherchild.obj" \
    -	"$(INTDIR)\pipe.obj" \
    -	"$(INTDIR)\poll.obj" \
    -	"$(INTDIR)\proc.obj" \
    -	"$(INTDIR)\rand.obj" \
    -	"$(INTDIR)\readwrite.obj" \
    -	"$(INTDIR)\seek.obj" \
    -	"$(INTDIR)\sendrecv.obj" \
    -	"$(INTDIR)\signals.obj" \
    -	"$(INTDIR)\sockaddr.obj" \
    -	"$(INTDIR)\sockets.obj" \
    -	"$(INTDIR)\sockopt.obj" \
    -	"$(INTDIR)\start.obj" \
    -	"$(INTDIR)\thread.obj" \
    -	"$(INTDIR)\threadpriv.obj" \
    -	"$(INTDIR)\time.obj" \
    -	"$(INTDIR)\timestr.obj" \
    -	"$(INTDIR)\userinfo.obj" \
    -	"$(INTDIR)\utf8_ucs2.obj" \
    -	"$(INTDIR)\uuid.obj"
    -
    -"$(OUTDIR)\libapr.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
    -    $(LINK32) @<<
    -  $(LINK32_FLAGS) $(LINK32_OBJS)
    -<<
    -
    -!ELSEIF  "$(CFG)" == "libapr - Win32 Debug"
    -
    -OUTDIR=.\Debug
    -INTDIR=.\Debug
    -# Begin Custom Macros
    -OutDir=.\Debug
    -# End Custom Macros
    -
    -!IF "$(RECURSE)" == "0" 
    -
    -ALL : "$(OUTDIR)\libapr.dll"
    -
    -!ELSE 
    -
    -ALL : "$(OUTDIR)\libapr.dll"
    -
    -!ENDIF 
    -
    -CLEAN :
    -	-@erase "$(INTDIR)\access.obj"
    -	-@erase "$(INTDIR)\apr.idb"
    -	-@erase "$(INTDIR)\apr.pdb"
    -	-@erase "$(INTDIR)\apr_cpystrn.obj"
    -	-@erase "$(INTDIR)\apr_fnmatch.obj"
    -	-@erase "$(INTDIR)\apr_getpass.obj"
    -	-@erase "$(INTDIR)\apr_hash.obj"
    -	-@erase "$(INTDIR)\apr_md5.obj"
    -	-@erase "$(INTDIR)\apr_pools.obj"
    -	-@erase "$(INTDIR)\apr_sms.obj"
    -	-@erase "$(INTDIR)\apr_sms_blocks.obj"
    -	-@erase "$(INTDIR)\apr_sms_std.obj"
    -	-@erase "$(INTDIR)\apr_sms_tracking.obj"
    -	-@erase "$(INTDIR)\apr_sms_trivial.obj"
    -	-@erase "$(INTDIR)\apr_snprintf.obj"
    -	-@erase "$(INTDIR)\apr_strings.obj"
    -	-@erase "$(INTDIR)\apr_strnatcmp.obj"
    -	-@erase "$(INTDIR)\apr_strtok.obj"
    -	-@erase "$(INTDIR)\apr_tables.obj"
    -	-@erase "$(INTDIR)\common.obj"
    -	-@erase "$(INTDIR)\dir.obj"
    -	-@erase "$(INTDIR)\dso.obj"
    -	-@erase "$(INTDIR)\errorcodes.obj"
    -	-@erase "$(INTDIR)\fileacc.obj"
    -	-@erase "$(INTDIR)\filedup.obj"
    -	-@erase "$(INTDIR)\filepath.obj"
    -	-@erase "$(INTDIR)\filestat.obj"
    -	-@erase "$(INTDIR)\flock.obj"
    -	-@erase "$(INTDIR)\fullrw.obj"
    -	-@erase "$(INTDIR)\getopt.obj"
    -	-@erase "$(INTDIR)\getuuid.obj"
    -	-@erase "$(INTDIR)\groupinfo.obj"
    -	-@erase "$(INTDIR)\inet_ntop.obj"
    -	-@erase "$(INTDIR)\inet_pton.obj"
    -	-@erase "$(INTDIR)\locks.obj"
    -	-@erase "$(INTDIR)\misc.obj"
    -	-@erase "$(INTDIR)\mmap.obj"
    -	-@erase "$(INTDIR)\names.obj"
    -	-@erase "$(INTDIR)\open.obj"
    -	-@erase "$(INTDIR)\otherchild.obj"
    -	-@erase "$(INTDIR)\pipe.obj"
    -	-@erase "$(INTDIR)\poll.obj"
    -	-@erase "$(INTDIR)\proc.obj"
    -	-@erase "$(INTDIR)\rand.obj"
    -	-@erase "$(INTDIR)\readwrite.obj"
    -	-@erase "$(INTDIR)\seek.obj"
    -	-@erase "$(INTDIR)\sendrecv.obj"
    -	-@erase "$(INTDIR)\signals.obj"
    -	-@erase "$(INTDIR)\sockaddr.obj"
    -	-@erase "$(INTDIR)\sockets.obj"
    -	-@erase "$(INTDIR)\sockopt.obj"
    -	-@erase "$(INTDIR)\start.obj"
    -	-@erase "$(INTDIR)\thread.obj"
    -	-@erase "$(INTDIR)\threadpriv.obj"
    -	-@erase "$(INTDIR)\time.obj"
    -	-@erase "$(INTDIR)\timestr.obj"
    -	-@erase "$(INTDIR)\userinfo.obj"
    -	-@erase "$(INTDIR)\utf8_ucs2.obj"
    -	-@erase "$(INTDIR)\uuid.obj"
    -	-@erase "$(OUTDIR)\libapr.dll"
    -	-@erase "$(OUTDIR)\libapr.exp"
    -	-@erase "$(OUTDIR)\libapr.lib"
    -	-@erase "$(OUTDIR)\libapr.map"
    -	-@erase "$(OUTDIR)\libapr.pdb"
    -
    -"$(OUTDIR)" :
    -    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
    -
    -CPP_PROJ=/nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I\
    - "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D\
    - "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\\"\
    - /Fd"$(INTDIR)\apr" /FD /c 
    -CPP_OBJS=.\Debug/
    -CPP_SBRS=.
    -MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" 
    -BSC32=bscmake.exe
    -BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapr.bsc" 
    -BSC32_SBRS= \
    -	
    -LINK32=link.exe
    -LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo\
    - /base:"0x6EE00000" /subsystem:windows /dll /incremental:no\
    - /pdb:"$(OUTDIR)\libapr.pdb" /map:"$(INTDIR)\libapr.map" /debug /machine:I386\
    - /out:"$(OUTDIR)\libapr.dll" /implib:"$(OUTDIR)\libapr.lib" /OPT:NOREF 
    -LINK32_OBJS= \
    -	"$(INTDIR)\access.obj" \
    -	"$(INTDIR)\apr_cpystrn.obj" \
    -	"$(INTDIR)\apr_fnmatch.obj" \
    -	"$(INTDIR)\apr_getpass.obj" \
    -	"$(INTDIR)\apr_hash.obj" \
    -	"$(INTDIR)\apr_md5.obj" \
    -	"$(INTDIR)\apr_pools.obj" \
    -	"$(INTDIR)\apr_sms.obj" \
    -	"$(INTDIR)\apr_sms_blocks.obj" \
    -	"$(INTDIR)\apr_sms_std.obj" \
    -	"$(INTDIR)\apr_sms_tracking.obj" \
    -	"$(INTDIR)\apr_sms_trivial.obj" \
    -	"$(INTDIR)\apr_snprintf.obj" \
    -	"$(INTDIR)\apr_strings.obj" \
    -	"$(INTDIR)\apr_strnatcmp.obj" \
    -	"$(INTDIR)\apr_strtok.obj" \
    -	"$(INTDIR)\apr_tables.obj" \
    -	"$(INTDIR)\common.obj" \
    -	"$(INTDIR)\dir.obj" \
    -	"$(INTDIR)\dso.obj" \
    -	"$(INTDIR)\errorcodes.obj" \
    -	"$(INTDIR)\fileacc.obj" \
    -	"$(INTDIR)\filedup.obj" \
    -	"$(INTDIR)\filepath.obj" \
    -	"$(INTDIR)\filestat.obj" \
    -	"$(INTDIR)\flock.obj" \
    -	"$(INTDIR)\fullrw.obj" \
    -	"$(INTDIR)\getopt.obj" \
    -	"$(INTDIR)\getuuid.obj" \
    -	"$(INTDIR)\groupinfo.obj" \
    -	"$(INTDIR)\inet_ntop.obj" \
    -	"$(INTDIR)\inet_pton.obj" \
    -	"$(INTDIR)\locks.obj" \
    -	"$(INTDIR)\misc.obj" \
    -	"$(INTDIR)\mmap.obj" \
    -	"$(INTDIR)\names.obj" \
    -	"$(INTDIR)\open.obj" \
    -	"$(INTDIR)\otherchild.obj" \
    -	"$(INTDIR)\pipe.obj" \
    -	"$(INTDIR)\poll.obj" \
    -	"$(INTDIR)\proc.obj" \
    -	"$(INTDIR)\rand.obj" \
    -	"$(INTDIR)\readwrite.obj" \
    -	"$(INTDIR)\seek.obj" \
    -	"$(INTDIR)\sendrecv.obj" \
    -	"$(INTDIR)\signals.obj" \
    -	"$(INTDIR)\sockaddr.obj" \
    -	"$(INTDIR)\sockets.obj" \
    -	"$(INTDIR)\sockopt.obj" \
    -	"$(INTDIR)\start.obj" \
    -	"$(INTDIR)\thread.obj" \
    -	"$(INTDIR)\threadpriv.obj" \
    -	"$(INTDIR)\time.obj" \
    -	"$(INTDIR)\timestr.obj" \
    -	"$(INTDIR)\userinfo.obj" \
    -	"$(INTDIR)\utf8_ucs2.obj" \
    -	"$(INTDIR)\uuid.obj"
    -
    -"$(OUTDIR)\libapr.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
    -    $(LINK32) @<<
    -  $(LINK32_FLAGS) $(LINK32_OBJS)
    -<<
    -
    -!ENDIF 
    -
    -.c{$(CPP_OBJS)}.obj::
    -   $(CPP) @<<
    -   $(CPP_PROJ) $< 
    -<<
    -
    -.cpp{$(CPP_OBJS)}.obj::
    -   $(CPP) @<<
    -   $(CPP_PROJ) $< 
    -<<
    -
    -.cxx{$(CPP_OBJS)}.obj::
    -   $(CPP) @<<
    -   $(CPP_PROJ) $< 
    -<<
    -
    -.c{$(CPP_SBRS)}.sbr::
    -   $(CPP) @<<
    -   $(CPP_PROJ) $< 
    -<<
    -
    -.cpp{$(CPP_SBRS)}.sbr::
    -   $(CPP) @<<
    -   $(CPP_PROJ) $< 
    -<<
    -
    -.cxx{$(CPP_SBRS)}.sbr::
    -   $(CPP) @<<
    -   $(CPP_PROJ) $< 
    -<<
    -
    -
    -!IF "$(CFG)" == "libapr - Win32 Release" || "$(CFG)" == "libapr - Win32 Debug"
    -SOURCE=.\dso\win32\dso.c
    -DEP_CPP_DSO_C=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\dso.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\dso.obj" : $(SOURCE) $(DEP_CPP_DSO_C) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\dir.c
    -DEP_CPP_DIR_C=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\atime.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\unix\fileacc.c
    -DEP_CPP_FILEA=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\filedup.c
    -DEP_CPP_FILED=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\inherit.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\filepath.c
    -DEP_CPP_FILEP=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\filepath.obj" : $(SOURCE) $(DEP_CPP_FILEP) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\filestat.c
    -DEP_CPP_FILES=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\atime.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\flock.c
    -DEP_CPP_FLOCK=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\flock.obj" : $(SOURCE) $(DEP_CPP_FLOCK) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\unix\fullrw.c
    -DEP_CPP_FULLR=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	
    -
    -"$(INTDIR)\fullrw.obj" : $(SOURCE) $(DEP_CPP_FULLR) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\open.c
    -DEP_CPP_OPEN_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\pipe.c
    -DEP_CPP_PIPE_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\readwrite.c
    -DEP_CPP_READW=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\atime.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\file_io\win32\seek.c
    -DEP_CPP_SEEK_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\i18n\unix\utf8_ucs2.c
    -DEP_CPP_UTF8_=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	
    -
    -"$(INTDIR)\utf8_ucs2.obj" : $(SOURCE) $(DEP_CPP_UTF8_) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\i18n\unix\xlate.c
    -SOURCE=.\locks\win32\locks.c
    -DEP_CPP_LOCKS=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\locks.h"\
    -	
    -
    -"$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\memory\unix\apr_pools.c
    -DEP_CPP_APR_P=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_hash.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\memory\unix\apr_sms.c
    -DEP_CPP_APR_S=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_hash.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\memory\unix\sms_private.h"\
    -	
    -
    -"$(INTDIR)\apr_sms.obj" : $(SOURCE) $(DEP_CPP_APR_S) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\memory\unix\apr_sms_blocks.c
    -DEP_CPP_APR_SM=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_sms_blocks.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\memory\unix\sms_private.h"\
    -	
    -
    -"$(INTDIR)\apr_sms_blocks.obj" : $(SOURCE) $(DEP_CPP_APR_SM) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\memory\unix\apr_sms_std.c
    -DEP_CPP_APR_SMS=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\memory\unix\sms_private.h"\
    -	
    -
    -"$(INTDIR)\apr_sms_std.obj" : $(SOURCE) $(DEP_CPP_APR_SMS) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\memory\unix\apr_sms_tracking.c
    -DEP_CPP_APR_SMS_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_sms_tracking.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\memory\unix\sms_private.h"\
    -	
    -
    -"$(INTDIR)\apr_sms_tracking.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\memory\unix\apr_sms_trivial.c
    -DEP_CPP_APR_SMS_T=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_sms_trivial.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\memory\unix\sms_private.h"\
    -	
    -
    -"$(INTDIR)\apr_sms_trivial.obj" : $(SOURCE) $(DEP_CPP_APR_SMS_T) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\unix\errorcodes.c
    -DEP_CPP_ERROR=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\errorcodes.obj" : $(SOURCE) $(DEP_CPP_ERROR) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\unix\getopt.c
    -DEP_CPP_GETOP=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\win32\getuuid.c
    -DEP_CPP_GETUU=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_uuid.h"\
    -	
    -
    -"$(INTDIR)\getuuid.obj" : $(SOURCE) $(DEP_CPP_GETUU) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\win32\misc.c
    -DEP_CPP_MISC_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\misc.obj" : $(SOURCE) $(DEP_CPP_MISC_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\win32\names.c
    -DEP_CPP_NAMES=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\unix\otherchild.c
    -DEP_CPP_OTHER=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	".\include\arch\win32\threadproc.h"\
    -	
    -
    -"$(INTDIR)\otherchild.obj" : $(SOURCE) $(DEP_CPP_OTHER) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\win32\rand.c
    -DEP_CPP_RAND_=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\rand.obj" : $(SOURCE) $(DEP_CPP_RAND_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\unix\start.c
    -DEP_CPP_START=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_signal.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\locks.h"\
    -	
    -
    -"$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\misc\unix\uuid.c
    -DEP_CPP_UUID_=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_uuid.h"\
    -	
    -
    -"$(INTDIR)\uuid.obj" : $(SOURCE) $(DEP_CPP_UUID_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\mmap\unix\common.c
    -DEP_CPP_COMMO=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_mmap.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\common.obj" : $(SOURCE) $(DEP_CPP_COMMO) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\mmap\win32\mmap.c
    -DEP_CPP_MMAP_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_mmap.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\mmap.obj" : $(SOURCE) $(DEP_CPP_MMAP_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\network_io\unix\inet_ntop.c
    -DEP_CPP_INET_=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\networkio.h"\
    -	
    -
    -"$(INTDIR)\inet_ntop.obj" : $(SOURCE) $(DEP_CPP_INET_) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\network_io\unix\inet_pton.c
    -DEP_CPP_INET_P=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\networkio.h"\
    -	
    -
    -"$(INTDIR)\inet_pton.obj" : $(SOURCE) $(DEP_CPP_INET_P) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\network_io\win32\poll.c
    -DEP_CPP_POLL_=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\networkio.h"\
    -	
    -
    -"$(INTDIR)\poll.obj" : $(SOURCE) $(DEP_CPP_POLL_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\network_io\unix\sa_common.c
    -SOURCE=.\network_io\win32\sendrecv.c
    -DEP_CPP_SENDR=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	".\include\arch\win32\networkio.h"\
    -	
    -
    -"$(INTDIR)\sendrecv.obj" : $(SOURCE) $(DEP_CPP_SENDR) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\network_io\win32\sockaddr.c
    -DEP_CPP_SOCKA=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\networkio.h"\
    -	".\network_io\unix\sa_common.c"\
    -	
    -
    -"$(INTDIR)\sockaddr.obj" : $(SOURCE) $(DEP_CPP_SOCKA) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\network_io\win32\sockets.c
    -DEP_CPP_SOCKE=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\networkio.h"\
    -	
    -
    -"$(INTDIR)\sockets.obj" : $(SOURCE) $(DEP_CPP_SOCKE) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\network_io\win32\sockopt.c
    -DEP_CPP_SOCKO=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\networkio.h"\
    -	
    -
    -"$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\passwd\apr_getpass.c
    -DEP_CPP_APR_G=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_getpass.obj" : $(SOURCE) $(DEP_CPP_APR_G) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\passwd\apr_md5.c
    -DEP_CPP_APR_M=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_md5.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_md5.obj" : $(SOURCE) $(DEP_CPP_APR_M) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\shmem\win32\shmem.c
    -SOURCE=.\strings\apr_cpystrn.c
    -DEP_CPP_APR_C=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_cpystrn.obj" : $(SOURCE) $(DEP_CPP_APR_C) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\strings\apr_fnmatch.c
    -DEP_CPP_APR_F=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_fnmatch.h"\
    -	".\include\apr_lib.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_fnmatch.obj" : $(SOURCE) $(DEP_CPP_APR_F) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\strings\apr_snprintf.c
    -DEP_CPP_APR_SN=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_SN) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\strings\apr_strings.c
    -DEP_CPP_APR_ST=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_strings.obj" : $(SOURCE) $(DEP_CPP_APR_ST) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\strings\apr_strnatcmp.c
    -DEP_CPP_APR_STR=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	
    -
    -"$(INTDIR)\apr_strnatcmp.obj" : $(SOURCE) $(DEP_CPP_APR_STR) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\strings\apr_strtok.c
    -DEP_CPP_APR_STRT=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_want.h"\
    -	
    -
    -"$(INTDIR)\apr_strtok.obj" : $(SOURCE) $(DEP_CPP_APR_STRT) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\tables\apr_hash.c
    -DEP_CPP_APR_H=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_hash.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_hash.obj" : $(SOURCE) $(DEP_CPP_APR_H) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\tables\apr_tables.c
    -DEP_CPP_APR_T=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\apr_tables.obj" : $(SOURCE) $(DEP_CPP_APR_T) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\threadproc\win32\proc.c
    -DEP_CPP_PROC_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	".\include\arch\win32\threadproc.h"\
    -	
    -
    -"$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\threadproc\win32\signals.c
    -DEP_CPP_SIGNA=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	".\include\arch\win32\threadproc.h"\
    -	
    -
    -"$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\threadproc\win32\thread.c
    -DEP_CPP_THREA=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\threadproc.h"\
    -	
    -
    -"$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\threadproc\win32\threadpriv.c
    -DEP_CPP_THREAD=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\threadproc.h"\
    -	
    -
    -"$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\time\win32\access.c
    -DEP_CPP_ACCES=\
    -	".\include\apr.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_time.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\atime.h"\
    -	
    -
    -"$(INTDIR)\access.obj" : $(SOURCE) $(DEP_CPP_ACCES) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\time\win32\time.c
    -DEP_CPP_TIME_=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lib.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\atime.h"\
    -	
    -
    -"$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)" ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\time\win32\timestr.c
    -DEP_CPP_TIMES=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\atime.h"\
    -	
    -
    -"$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\user\win32\groupinfo.c
    -DEP_CPP_GROUP=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	
    -
    -"$(INTDIR)\groupinfo.obj" : $(SOURCE) $(DEP_CPP_GROUP) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\user\win32\userinfo.c
    -DEP_CPP_USERI=\
    -	".\include\apr.h"\
    -	".\include\apr_dso.h"\
    -	".\include\apr_errno.h"\
    -	".\include\apr_file_info.h"\
    -	".\include\apr_file_io.h"\
    -	".\include\apr_general.h"\
    -	".\include\apr_getopt.h"\
    -	".\include\apr_inherit.h"\
    -	".\include\apr_lock.h"\
    -	".\include\apr_network_io.h"\
    -	".\include\apr_pools.h"\
    -	".\include\apr_portable.h"\
    -	".\include\apr_sms.h"\
    -	".\include\apr_strings.h"\
    -	".\include\apr_tables.h"\
    -	".\include\apr_thread_proc.h"\
    -	".\include\apr_time.h"\
    -	".\include\apr_user.h"\
    -	".\include\apr_want.h"\
    -	".\include\apr_xlate.h"\
    -	".\include\arch\unix\i18n.h"\
    -	".\include\arch\unix\misc.h"\
    -	".\include\arch\win32\apr_private.h"\
    -	".\include\arch\win32\fileio.h"\
    -	
    -
    -"$(INTDIR)\userinfo.obj" : $(SOURCE) $(DEP_CPP_USERI) "$(INTDIR)"\
    - ".\include\apr.h"
    -	$(CPP) $(CPP_PROJ) $(SOURCE)
    -
    -
    -SOURCE=.\include\apr.hw
    -
    -!IF  "$(CFG)" == "libapr - Win32 Release"
    -
    -InputPath=.\include\apr.hw
    -
    -".\include\apr.h"	 : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
    -	copy .\include\apr.hw .\include\apr.h > nul 
    -	echo Created apr.h from apr.hw 
    -	
    -
    -!ELSEIF  "$(CFG)" == "libapr - Win32 Debug"
    -
    -InputPath=.\include\apr.hw
    -
    -".\include\apr.h"	 : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
    -	copy .\include\apr.hw .\include\apr.h > nul 
    -	echo Created apr.h from apr.hw 
    -	
    -
    -!ENDIF 
    -
    -
    -!ENDIF 
    -
    
    From cdd93053eb291fea666eabb2aa583645a429b441 Mon Sep 17 00:00:00 2001
    From: Ian Holsman 
    Date: Fri, 17 Aug 2001 03:33:55 +0000
    Subject: [PATCH 2184/7878] Doxygen'zation of Hash routines
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62181 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_hash.h | 53 ++++++++++++++++++++++++----------------------
     1 file changed, 28 insertions(+), 25 deletions(-)
    
    diff --git a/include/apr_hash.h b/include/apr_hash.h
    index b7f80bc0562..651f729bb9c 100644
    --- a/include/apr_hash.h
    +++ b/include/apr_hash.h
    @@ -62,34 +62,38 @@
     #ifdef __cplusplus
     extern "C" {
     #endif
    +/**
    + * @file apr_hash.h
    + * @brief Hash Tables
    + */
     
     /**
    - * @package Hash Tables
    + * @defgroup APR_Hash  Hash Tables
    + * @ingroup APR
    + * @{
      */
     
     #include "apr_pools.h"
     
    -/*
    +/**
      * When passing a key to apr_hash_set or apr_hash_get, this value can be
      * passed to indicate a string-valued key, and have apr_hash compute the
      * length automatically.
      *
    - * Note: apr_hash will use strlen(key) for the length. The null-terminator
    - *       is not included in the hash value (why throw a constant in?).
    - *       Since the hash table merely references the provided key (rather
    - *       than copying it), apr_hash_this() will return the null-term'd key.
    + * @remark apr_hash will use strlen(key) for the length. The null-terminator
    + *         is not included in the hash value (why throw a constant in?).
    + *         Since the hash table merely references the provided key (rather
    + *         than copying it), apr_hash_this() will return the null-term'd key.
      */
     #define APR_HASH_KEY_STRING     (-1)
     
     /**
      * Abstract type for hash tables.
    - * @defvar apr_hash_t
      */
     typedef struct apr_hash_t apr_hash_t;
     
     /**
      * Abstract type for scanning hash tables.
    - * @defvar apr_hash_index_t
      */
     typedef struct apr_hash_index_t apr_hash_index_t;
     
    @@ -97,8 +101,7 @@ typedef struct apr_hash_index_t apr_hash_index_t;
      * Create a hash table.
      * @param pool The pool to allocate the hash table out of
      * @return The hash table just created
    - * @deffunc apr_hash_t *apr_hash_make(apr_pool_t *pool)
    - */
    +  */
     APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool);
     
     /**
    @@ -107,8 +110,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool);
      * @param key Pointer to the key
      * @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string length.
      * @param val Value to associate with the key
    - * @tip If the value is NULL the hash entry is deleted.
    - * @deffunc void apr_hash_set(apr_hash_t *ht, const void *key, apr_size_t klen, const void *val)
    + * @remark If the value is NULL the hash entry is deleted.
      */
     APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key,
                                    apr_ssize_t klen, const void *val);
    @@ -119,7 +121,6 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key,
      * @param key Pointer to the key
      * @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string length.
      * @return Returns NULL if the key is not present.
    - * @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, apr_ssize_t klen)
      */
     APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key,
                                      apr_ssize_t klen);
    @@ -128,8 +129,9 @@ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key,
      * Start iterating over the entries in a hash table.
      * @param p The pool to allocate the apr_hash_index_t iterator 
      * @param ht The hash table
    - * @return a pointer to the iteration state, or NULL if there are no entries.
    - * @tip Example:
    + * @example
    + */
    +/**
      * 
      * 
      *     int sum_values(apr_pool_t *p, apr_hash_t *ht)
    @@ -149,15 +151,14 @@ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key,
      * is delete the current entry) and multiple iterations can be in
      * progress at the same time.
      * 
    - * @deffunc apr_hash_index_t *apr_hash_first(apr_pool_t *p, apr_hash_t *ht) - */ + */ APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht); /** * Continue iterating over the entries in a hash table. * @param hi The iteration state - * @return a pointer to the updated iteration state. NULL if there are no more * entries. - * @deffunc apr_hash_index_t *apr_hash_next(apr_hash_index_t *hi) + * @return a pointer to the updated iteration state. NULL if there are no more + * entries. */ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); @@ -167,9 +168,8 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); * @param key Return pointer for the pointer to the key. * @param klen Return pointer for the key length. * @param val Return pointer for the associated value. - * @tip The return pointers should point to a variable that will be set to the - * corresponding data, or they may be NULL if the data isn't interesting. - * @deffunc void apr_hash_this(apr_hash_index_t *hi, const void **key, apr_ssize_t *klen, void **val); + * @remark The return pointers should point to a variable that will be set to the + * corresponding data, or they may be NULL if the data isn't interesting. */ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, apr_ssize_t *klen, void **val); @@ -178,7 +178,6 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, * Get the number of key/value pairs in the hash table. * @param ht The hash table * @return The number of key/value pairs in the hash table. - * @deffunc int apr_hash_count(apr_hash_t *ht); */ APR_DECLARE(int) apr_hash_count(apr_hash_t *ht); @@ -189,14 +188,18 @@ APR_DECLARE(int) apr_hash_count(apr_hash_t *ht); * @param overlay The table to add to the initial table * @param base The table that represents the initial values of the new table * @return A new hash table containing all of the data from the two passed in - * @deffunc apr_hash_t *apr_hash_overlay(apr_pool_t *p, const apr_table_t *over -lay, const apr_table_t *base); */ APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p, const apr_hash_t *overlay, const apr_hash_t *base); +/** + * Get a pointer to the pool which the hash table + * was created in + * @param hash the hash table in question + */ APR_DECLARE(apr_pool_t *) apr_hash_pool_get(apr_hash_t *hash); +/** @} */ #ifdef __cplusplus } #endif From ba4fb07d0e291054a58ef0485967fe7a8090b4e3 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 17 Aug 2001 03:44:40 +0000 Subject: [PATCH 2185/7878] move DOxygen comments to inside the #ifdef NETWARE block PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62182 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/arch/netware/apr.h b/include/arch/netware/apr.h index 1f6a31b1a03..4fcadfeaf28 100644 --- a/include/arch/netware/apr.h +++ b/include/arch/netware/apr.h @@ -56,9 +56,10 @@ * Note: This is a NetWare specific version of apr.h. It is renamed to * apr.h at the start of a Windows build. */ +#ifdef NETWARE /** - * @file apr.h - * @brief Basic APR header + * @file netware/apr.h netware/apr.h + * @brief APR header for NetWare */ /** @@ -67,7 +68,6 @@ */ -#ifdef NETWARE #ifndef APR_H #define APR_H @@ -332,6 +332,6 @@ typedef int apr_wait_t; //typedef int apr_wait_t; #endif /* APR_H */ -#endif /* NETWARE */ /** @} */ +#endif /* NETWARE */ From 0ce6fdf495a464246074292bb8473c888fe806fa Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 17 Aug 2001 03:45:34 +0000 Subject: [PATCH 2186/7878] The purpose of this patch is to toggle the debugging mode (default) to Program Database (from Program Database for Modify on the fly debugging). The net effect of this patch is to clean up all of the irrelevant entries associated with either the debugging or release command line switches, and generally straighten the projects as they would be exported from VC6/SP5. The outcome of this patch is that VC5 users -should- be able to load and build the workspace without any errors (as they used to have no symbols database at all, the /ZI option doesn't work, they had to use cvtdsp.pl to toggle these to /Zi.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62183 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 2 +- libapr.dsp | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/apr.dsp b/apr.dsp index 9fbf8d0e74b..f44df23527f 100644 --- a/apr.dsp +++ b/apr.dsp @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe diff --git a/libapr.dsp b/libapr.dsp index c727a0ef0ef..84f91d51372 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -69,7 +69,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\apr" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\apr" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -595,7 +595,6 @@ SOURCE=.\include\apr_xlate.h # Begin Source File SOURCE=.\libapr.rc - # End Source File # Begin Source File @@ -608,8 +607,7 @@ SOURCE=.\build\win32ver.awk InputPath=.\build\win32ver.awk ".\libapr.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - awk -f ./build/win32ver.awk libapr "Apache Portability Runtime Library"\ - ../../include/ap_release.h > .\libapr.rc + awk -f ./build/win32ver.awk libapr "Apache Portability Runtime Library" ../../include/ap_release.h > .\libapr.rc # End Custom Build @@ -620,8 +618,7 @@ InputPath=.\build\win32ver.awk InputPath=.\build\win32ver.awk ".\libapr.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - awk -f ./build/win32ver.awk libapr "Apache Portability Runtime Library"\ - ../../include/ap_release.h > .\libapr.rc + awk -f ./build/win32ver.awk libapr "Apache Portability Runtime Library" ../../include/ap_release.h > .\libapr.rc # End Custom Build From 787ab0e449fd64649ef31bd72e1cab76bc46ff3a Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 17 Aug 2001 03:54:04 +0000 Subject: [PATCH 2187/7878] DOxygen of apr_lock.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62184 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lock.h | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/include/apr_lock.h b/include/apr_lock.h index fbc447c7252..82078b2824e 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -64,7 +64,14 @@ extern "C" { #endif /* __cplusplus */ /** - * @package APR lock library + * @file apr_lock.h + * @brief APR Locking Routines + */ + +/** + * @defgroup APR_Lock Locking Routines + * @ingroup APR + * @{ */ typedef enum {APR_CROSS_PROCESS, APR_INTRAPROCESS, APR_LOCKALL} apr_lockscope_e; @@ -96,9 +103,8 @@ typedef struct apr_lock_t apr_lock_t; * argument should always be provided. The lock code itself will * determine if it should be used. * @param pool The pool to operate on. - * @tip APR_CROSS_PROCESS may lock both processes and threads, but it is - * only guaranteed to lock processes. - * @deffunc apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *pool) + * @warning APR_CROSS_PROCESS may lock both processes and threads, but it is + * only guaranteed to lock processes. */ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, @@ -109,15 +115,13 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, /** * Lock a protected region. * @param lock The lock to set. - * @deffunc apr_status_t apr_lock_acquire(apr_lock_t *lock) */ APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock); /** * Tries to lock a protected region. - * If it fails, returns APR_EBUSY. Otherwise, it returns APR_SUCCESS. * @param lock The lock to set. - * @deffunc apr_status_t apr_lock_tryacquire(apr_lock_t *lock) + * @return If it fails, returns APR_EBUSY. Otherwise, it returns APR_SUCCESS. */ APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock); @@ -125,7 +129,6 @@ APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock); * Lock a region with either a reader or writer lock. * @param lock The lock to set. * @param type The type of lock to acquire. - * @deffunc apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e type) */ APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e type); @@ -133,16 +136,14 @@ APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock, /** * Unlock a protected region. * @param lock The lock to reset. - * @deffunc apr_status_t apr_lock_release(apr_lock_t *lock) */ APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock); /** * Free the memory associated with a lock. * @param lock The lock to free. - * @deffunc apr_status_t apr_lock_destroy(apr_lock_t *lock) - * @tip If the lock is currently active when it is destroyed, it - * will be unlocked first. + * @remark If the lock is currently active when it is destroyed, it + * will be unlocked first. */ APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock); @@ -154,11 +155,10 @@ APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock); * determine if it should be used. This filename should be the * same one that was passed to apr_lock_create * @param pool The pool to operate on. - * @tip This function doesn't always do something, it depends on the - * locking mechanism chosen for the platform, but it is a good - * idea to call it regardless, because it makes the code more - * portable. - * @deffunc apr_status_t apr_lock_child_init(apr_lock_t **lock, const char *fname, apr_pool_t *pool) + * @remark This function doesn't always do something, it depends on the + * locking mechanism chosen for the platform, but it is a good + * idea to call it regardless, because it makes the code more + * portable. */ APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, const char *fname, @@ -169,7 +169,6 @@ APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, * @param lock The currently open lock. * @param key The key to use when retreiving data associated with this lock * @param data The user data associated with the lock. - * @deffunc apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) */ APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key, void *data); @@ -180,7 +179,6 @@ APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key, * @param data The user data to associate with the lock. * @param key The key to use when associating data with this lock * @param cleanup The cleanup to use when the lock is destroyed. - * @deffunc apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup)(void *)) */ APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, @@ -222,9 +220,8 @@ typedef enum {APR_LOCK_FCNTL, APR_LOCK_FLOCK, APR_LOCK_SYSVSEM, APR_LOCK_PROC_PT * argument should always be provided. The lock code itself will * determine if it should be used. * @param pool The pool to operate on. - * @tip APR_CROSS_PROCESS may lock both processes and threads, but it is - * only guaranteed to lock processes. - * @deffunc apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *pool) + * @warning APR_CROSS_PROCESS may lock both processes and threads, but it is + * only guaranteed to lock processes. */ APR_DECLARE(apr_status_t) apr_lock_create_np(apr_lock_t **lock, apr_locktype_e type, @@ -233,7 +230,7 @@ APR_DECLARE(apr_status_t) apr_lock_create_np(apr_lock_t **lock, const char *fname, apr_pool_t *pool); #endif /* APR_HAS_LOCK_CREATE_NP */ - +/** @} */ #ifdef __cplusplus } #endif From 5e36d701e97436fd7a3c045e293856e2c33b1d5e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 17 Aug 2001 03:54:13 +0000 Subject: [PATCH 2188/7878] Eliminate the cvtdsp -6 transformation back to the /ZI debugging flag, leave it at /Zi. We can add another cvtdsp -ZI option to toggle that, if folks would like. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62185 13f79535-47bb-0310-9956-ffa450edef68 --- build/cvtdsp.pl | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl index 5fca5b554a8..536018bbda2 100644 --- a/build/cvtdsp.pl +++ b/build/cvtdsp.pl @@ -76,12 +76,6 @@ sub tovc6 { if ($src =~ s|Format Version 5\.00|Format Version 6\.00|) { $verchg = -1; } - if ($src =~ s|^(# ADD CPP .*)/Zi (.*)|$1/ZI $2|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD BASE CPP .*)/Zi (.*)|$1/ZI $2|) { - $verchg = -1; - } if ($src =~ s|^(!MESSAGE .*)\\\n|$1|) { $cont = <$srcfl>; $src = $src . $cont; From 5f913b5e12c0fbc17617946b601cefd1a3f284d3 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 17 Aug 2001 04:01:54 +0000 Subject: [PATCH 2189/7878] change the @file parameter to include 'include' this removes the warning about duplicate file names caused by netware's apr.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62186 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 2 +- include/apr.hw | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index f5849a7a4e5..44abe401fe3 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -2,7 +2,7 @@ #define APR_H /** - * @file apr.h + * @file include\apr.h * @brief Basic APR header */ /** diff --git a/include/apr.hw b/include/apr.hw index 70426ce42d4..742e827732e 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -52,17 +52,16 @@ * . */ -/* - * Note: This is a Windows specific version of apr.h. It is copied as - * apr.h at the start of a Windows build. - */ + /** - * @file apr.h - * @brief Basic APR header + * @file include\apr.h + * @brief Basic APR header for WIN32 + * @remark This is a Windows specific version of apr.h. It is copied as + * apr.h at the start of a Windows build. */ /** - * @defgroup APR APR Functions + * @defgroup APR APR Functions (WIN32) * @{ */ From 53014eaf4c38517e835f6da5f158d6dd2e649151 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 17 Aug 2001 04:17:01 +0000 Subject: [PATCH 2190/7878] * Doxygen of Header File. * Combined multipe #ifdef APR_HAVE_THREADS into a single #ifdef git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62187 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 150 ++++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 84 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 299f5a443be..548112839f7 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -58,7 +58,7 @@ */ #ifndef APR_PORTABLE_H #define APR_PORTABLE_H -/* +/** * @file apr_portable.h * @brief APR Portability Routines */ @@ -216,9 +216,8 @@ typedef struct apr_os_sock_info_t apr_os_sock_info_t; * convert the file from apr type to os specific type. * @param thefile The os specific file we are converting to * @param file The apr file to convert. - * @deffunc apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) - * @tip On Unix, it is only possible to get a file descriptor from - * an apr file type. + * @remark On Unix, it is only possible to get a file descriptor from + * an apr file type. */ APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file); @@ -227,7 +226,6 @@ APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, * convert the dir from apr type to os specific type. * @param thedir The os specific dir we are converting to * @param dir The apr dir to convert. - * @deffunc apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) */ APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir); @@ -236,7 +234,6 @@ APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, * Convert the socket from an apr type to an OS specific socket * @param thesock The socket to convert. * @param sock The os specifc equivelant of the apr socket.. - * @deffunc apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) */ APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock); @@ -245,7 +242,6 @@ APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, * Convert the lock from os specific type to apr type * @param oslock The os specific lock we are converting to. * @param lock The apr lock to convert. - * @deffunc apr_status_t apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) */ APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock); @@ -254,7 +250,6 @@ APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *oslock, * Get the exploded time in the platforms native format. * @param ostime the native time format * @param aprtime the time to convert - * @deffunc apr_status_t apr_os_exp_time_get(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprtime) */ APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprtime); @@ -263,18 +258,19 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, * Get the imploded time in the platforms native format. * @param ostime the native time format * @param aprtimethe time to convert - * @deffunc apr_status_t apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime) */ APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime); -#if APR_HAS_THREADS - +#if APR_HAS_THREADS || defined(DOXYGEN) +/** + * @defgroup APR_PORT_Thread Thread portability Routines + * @{ + */ /** * convert the thread to os specific type from apr type. * @param thethd The apr thread to convert * @param thd The os specific thread we are converting to - * @deffunc apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) */ APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd); @@ -283,11 +279,59 @@ APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, * convert the thread private memory key to os specific type from an apr type. * @param thekey The apr handle we are converting from. * @param key The os specific handle we are converting to. - * @deffunc apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) */ APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key); +/** + * convert the thread from os specific type to apr type. + * @param thd The apr thread we are converting to. + * @param thethd The os specific thread to convert + * @param cont The pool to use if it is needed. + */ +APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, + apr_os_thread_t *thethd, + apr_pool_t *cont); + +/** + * convert the thread private memory key from os specific type to apr type. + * @param key The apr handle we are converting to. + * @param thekey The os specific handle to convert + * @param cont The pool to use if it is needed. + */ +APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, + apr_pool_t *cont); +/** + * Get the thread ID + */ +APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void); + +/** + * Compare two thread id's + * @param tid1 1st Thread ID to compare + * @param tid2 2nd Thread ID to compare + */ +APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, + apr_os_thread_t tid2); + +/** + * Register the specified thread with an sms + * @param sms The SMS to register with + * @param thread The thread to register + */ +APR_DECLARE(apr_status_t) apr_sms_thread_register(apr_sms_t *sms, + apr_os_thread_t thread); + +/** + * Unregister a thread from an sms + * @param sms The sms to unregister from + * @param thread The thread to be unregistered + */ +APR_DECLARE(apr_status_t) apr_sms_thread_unregister(apr_sms_t *sms, + apr_os_thread_t thread); + +/** @} */ #endif /* APR_HAS_THREADS */ /** @@ -295,9 +339,8 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, * @param file The apr file we are converting to. * @param thefile The os specific file to convert * @param cont The pool to use if it is needed. - * @deffunc apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) - * @tip On Unix, it is only possible to put a file descriptor into - * an apr file type. + * @remark On Unix, it is only possible to put a file descriptor into + * an apr file type. */ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, @@ -308,7 +351,6 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, * @param dir The apr dir we are converting to. * @param thedir The os specific dir to convert * @param cont The pool to use when creating to apr directory. - * @deffunc apr_status_t apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, @@ -319,7 +361,6 @@ APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, * @param sock The pool to use. * @param thesock The socket to convert to. * @param cont The socket we are converting to an apr type. - * @deffunc apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, @@ -332,9 +373,8 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, * @param os_sock_info The os representation of the socket handle and * other characteristics of the socket * @param cont The pool to use - * @deffunc apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont) - * @tip If you only know the descriptor/handle or if it isn't really - * a true socket, use apr_os_sock_put() instead. + * @remark If you only know the descriptor/handle or if it isn't really + * a true socket, use apr_os_sock_put() instead. */ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, @@ -345,7 +385,6 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, * @param lock The apr lock we are converting to. * @param thelock The os specific lock to convert. * @param cont The pool to use if it is needed. - * @deffunc apr_status_t apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, @@ -356,7 +395,6 @@ APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, * @param aprtime the APR time format * @param ostime the time to convert * @param cont the pool to use if necessary - * @deffunc apr_status_t apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, @@ -367,45 +405,22 @@ APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, * @param aprtime the APR time format * @param ostime the time to convert * @param cont the pool to use if necessary - * @deffunc apr_status_t apr_os_exp_time_put(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont); -#if APR_HAS_THREADS - -/** - * convert the thread from os specific type to apr type. - * @param thd The apr thread we are converting to. - * @param thethd The os specific thread to convert - * @param cont The pool to use if it is needed. - * @deffunc apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, - */ -APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, - apr_os_thread_t *thethd, - apr_pool_t *cont); -/** - * convert the thread private memory key from os specific type to apr type. - * @param key The apr handle we are converting to. - * @param thekey The os specific handle to convert - * @param cont The pool to use if it is needed. - * @deffunc apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont) +#if APR_HAS_DSO || defined(DOXYGEN) +/** + * @defgroup apr_port_DSO DSO (Dynamic Loading) Portabiliity Routines + * @{ */ -APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, - apr_pool_t *cont); - -#endif /* APR_HAS_THREADS */ - -#if APR_HAS_DSO /** * convert the dso handle from os specific to apr * @param dso The apr handle we are converting to * @param thedso the os specific handle to convert * @param pool the pool to use if it is needed - * @deffunc apr_status_t apr_os_dso_handle_put(apr_dso_handle_t **dso, apr_os_dso_handle_t *thedso, apr_pool_t *pool) */ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **dso, apr_os_dso_handle_t thedso, @@ -415,45 +430,12 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **dso, * convert the apr dso handle into an os specific one * @param aprdso The apr dso handle to convert * @param dso The os specific dso to return - * @deffunc apr_status_t apr_os_dso_handle_get(apr_os_dso_handle_t *dso, apr_dso_handle_t *aprdso); */ APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso, apr_dso_handle_t *aprdso); - +/** @} */ #endif /* APR_HAS_DSO */ -#if APR_HAS_THREADS -/** - * Get the thread ID - */ -APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void); - -/** - * Compare two thread id's - * @param tid1 1st Thread ID to compare - * @param tid2 2nd Thread ID to compare - */ -APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, - apr_os_thread_t tid2); - -/** - * Register the specified thread with an sms - * @param sms The SMS to register with - * @param thread The thread to register - */ -APR_DECLARE(apr_status_t) apr_sms_thread_register(apr_sms_t *sms, - apr_os_thread_t thread); - -/** - * Unregister a thread from an sms - * @param sms The sms to unregister from - * @param thread The thread to be unregistered - */ -APR_DECLARE(apr_status_t) apr_sms_thread_unregister(apr_sms_t *sms, - apr_os_thread_t thread); - -#endif /* APR_HAS_THREADS */ - #ifdef __cplusplus } #endif From b2b4064e54023a6d7043b35a112f80ffdbd878c2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 17 Aug 2001 06:46:30 +0000 Subject: [PATCH 2191/7878] Win32 VS6.0 projects require the .dep's file, let's touch those as well when we are syncing the timestamps to the source .dsp. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62188 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl index baf7b11d629..c3f6acf86b8 100644 --- a/build/fixwin32mak.pl +++ b/build/fixwin32mak.pl @@ -57,5 +57,12 @@ sub fixcwd { utime $dstat[9], $dstat[9], @onames; print "Touched datestamp for " . $oname . " in " . $File::Find::dir . "\n"; } + $oname =~ s/.mak$/.dep/; + @ostat = stat($oname); + if ($ostat[9] != $dstat[9]) { + @onames = ($oname); + utime $dstat[9], $dstat[9], @onames; + print "Touched datestamp for " . $oname . " in " . $File::Find::dir . "\n"; + } } } From 3216cfb14fd62b5a3e4b1d7f5354663efd8ffc50 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 17 Aug 2001 07:30:59 +0000 Subject: [PATCH 2192/7878] The last of the ignore goodness for tonight git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62189 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.cvsignore b/.cvsignore index ceb4242f92a..d66bf90db56 100644 --- a/.cvsignore +++ b/.cvsignore @@ -10,10 +10,14 @@ LibD LibR Debug Release -*.mak *.opt *.plg apr.exports .libs *.la libapr.rc +*.aps +*.plg +*.dep +*.mak +*.rc From 75d37c358606d6d01a5435f9b5357ac1267f3a69 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 17 Aug 2001 13:35:34 +0000 Subject: [PATCH 2193/7878] Introduce a new --disable-ipv6 option to disable IPv6 support. Submitted by: Sterling Hughes Reviewed and mangled by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62191 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ STATUS | 4 +--- configure.in | 31 ++++++++++++++++++++++--------- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 2684640c302..5d7cc75347b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Introduce a new --disable-ipv6 option to disable IPv6 support. + [Sterling Hughes , Jeff + Trawick] + *) Fix the new shared memory code. We need to pass a pointer to an apr_file_t to apr_file_open. Also, apr_os_file_get returns a status value, not the OS file descriptor. [Ryan Bloom] diff --git a/STATUS b/STATUS index 2d4bc8b14c3..143a2bbea1f 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/08/07 19:57:44 $] +Last modified at [$Date: 2001/08/17 13:35:34 $] Release: @@ -133,8 +133,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: -- note on Win32 we distinguish 'apache module' names from other 'loadable module' names, so be careful with Apache's directive. - * may be good to have a --disable-ipv6 configure option - * APR memory code - code has been added but we still need to - decide on a better name for the code - reformat to APR style (think this is now done, but some tabs left) diff --git a/configure.in b/configure.in index e3fd8525ff1..541d8a652cc 100644 --- a/configure.in +++ b/configure.in @@ -1312,6 +1312,14 @@ AC_CHECK_FUNCS(set_h_errno) echo $ac_n "${nl}Checking for IPv6 Networking support...${nl}" dnl # Start of checking for IPv6 support... + +AC_ARG_ENABLE(ipv6, + [ --disable-ipv6 Disable IPv6 support in APR.], + [ if test "$enableval" = "no"; then + user_disabled_ipv6=1 + fi ], + [ user_disabled_ipv6=0 ] ) + AC_SEARCH_LIBS(getaddrinfo, inet6) AC_SEARCH_LIBS(getnameinfo, inet6) APR_CHECK_WORKING_GETADDRINFO @@ -1319,20 +1327,25 @@ APR_CHECK_WORKING_GETNAMEINFO APR_CHECK_SOCKADDR_IN6 AC_MSG_CHECKING(if APR supports IPv6) have_ipv6="0" -if test "x$have_sockaddr_in6" = "x1"; then - if test "x$ac_cv_working_getaddrinfo" = "xyes"; then - if test "x$ac_cv_working_getnameinfo" = "xyes"; then - have_ipv6="1" - AC_MSG_RESULT("yes") +if test "$user_disabled_ipv6" = 1; then + AC_MSG_RESULT("no -- disabled by user") +else + if test "x$have_sockaddr_in6" = "x1"; then + if test "x$ac_cv_working_getaddrinfo" = "xyes"; then + if test "x$ac_cv_working_getnameinfo" = "xyes"; then + have_ipv6="1" + AC_MSG_RESULT("yes") + else + AC_MSG_RESULT("no -- no getnameinfo") + fi else - AC_MSG_RESULT("no -- no getnameinfo") + AC_MSG_RESULT("no -- no working getaddrinfo") fi else - AC_MSG_RESULT("no -- no working getaddrinfo") + AC_MSG_RESULT("no -- no sockaddr_in6"); fi -else - AC_MSG_RESULT("no -- no sockaddr_in6"); fi + AC_SUBST(have_ipv6) dnl #----------------------------- Finalize the variables From dbec2a08baa597364dc3edcc826bc12919a87d9a Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 17 Aug 2001 15:36:44 +0000 Subject: [PATCH 2194/7878] fix warning about slash being the wrong way around git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62192 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 44abe401fe3..f4e297c5701 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -2,11 +2,11 @@ #define APR_H /** - * @file include\apr.h - * @brief Basic APR header + * @file include/apr.h + * @brief APR APR Main Include */ /** - * @defgroup APR APR Functions + * @defgroup APR APR Routines * @{ */ From ef0c840724a9f99a4ec8c70a1af4ef1be6cf4583 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Fri, 17 Aug 2001 16:16:49 +0000 Subject: [PATCH 2195/7878] OS/2: -Zstack takes a parameter which must also be removed when "linking" a static library. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62193 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/aplibtool.c b/build/aplibtool.c index 8436b8b8f0b..f670ce5ed0c 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -435,6 +435,10 @@ void post_parse_fixup(cmd_data_t *cmd_data) cmd_data->arglist[a+1] = NULL; } + if (strcmp(arg, "-Zstack") == 0 && a+1 < cmd_data->num_args) { + cmd_data->arglist[a+1] = NULL; + } + if (strcmp(arg, "-o") == 0) { a++; } From ad44e98feeb3507165154a601a54ddde6f50dcf2 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 18 Aug 2001 04:36:48 +0000 Subject: [PATCH 2196/7878] OS/2: Simplify & standardize apr_poll(), we usually want it to return if interrupted. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62194 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/poll.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/network_io/os2/poll.c b/network_io/os2/poll.c index 1bc70a09946..6d294737904 100644 --- a/network_io/os2/poll.c +++ b/network_io/os2/poll.c @@ -129,28 +129,26 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, { int i; int rv = 0; - apr_time_t starttime = apr_time_now(); - do { - for (i=0; inum_total; i++) { - pollfdset->r_socket_list[i] = pollfdset->socket_list[i]; - } - - rv = select(pollfdset->r_socket_list, - pollfdset->num_read, - pollfdset->num_write, - pollfdset->num_except, - timeout >= 0 ? timeout / 1000 : -1); - - if (rv < 0 && sock_errno() == SOCEINTR && timeout >= 0 ) { - apr_interval_time_t elapsed = apr_time_now() - starttime; + for (i=0; inum_total; i++) { + pollfdset->r_socket_list[i] = pollfdset->socket_list[i]; + } - if (timeout <= elapsed) - break; + rv = select(pollfdset->r_socket_list, + pollfdset->num_read, + pollfdset->num_write, + pollfdset->num_except, + timeout >= 0 ? timeout / 1000 : -1); - timeout -= elapsed; + /* select() doesn't wipe the socket list in the case of a timeout or + * interrupt. This prevents false positives from revents_get + */ + if (rv == 0) { + for (i=0; inum_total; i++) { + pollfdset->r_socket_list[i] = -1; } - } while ( rv < 0 && sock_errno() == SOCEINTR ); + return APR_TIMEUP; + } (*nsds) = rv; return rv < 0 ? APR_OS2_STATUS(sock_errno()) : APR_SUCCESS; From 02fbd534de6891c871f810844b254c78a4747706 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 18 Aug 2001 09:19:25 +0000 Subject: [PATCH 2197/7878] OS/2: When a file is opened in append mode, make sure all writes go at the current end of file, even if the file is being written to by other processes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62195 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 86c474f5adc..da186995baa 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -184,7 +184,16 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a apr_lock_release(thefile->mutex); return APR_OS2_STATUS(rc); } else { - rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten); + if (thefile->flags & APR_APPEND) { + FILELOCK all = { 0, 0x7fffffff }; + ULONG newpos; + DosSetFileLocks(thefile->filedes, NULL, &all, -1, 0); + DosSetFilePtr(thefile->filedes, 0, FILE_END, &newpos); + rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten); + DosSetFileLocks(thefile->filedes, &all, NULL, -1, 0); + } else { + rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten); + } if (rc) { *nbytes = 0; From 2a31e76d90767eae1a98bd85e7babb9d6e0f0654 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sat, 18 Aug 2001 15:15:46 +0000 Subject: [PATCH 2198/7878] Changes to make Doxygen work git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62196 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 3 --- include/apr_mmap.h | 24 ++++++++++++++---------- include/apr_shmem.h | 20 ++++++++------------ 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index de2e7c06af0..efd2ec8a24b 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -77,9 +77,6 @@ extern "C" { * @ingroup APR * @{ */ -/* - * @package APR File handling - */ typedef enum { APR_NOFILE = 0, /**< the file exists, but APR doesn't know its type */ diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 0cfc4adefcd..6edceaa0d61 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -67,16 +67,23 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +/** + * @file apr_mmap.h + * @brief APR MMAP routines + */ +/** + * @defgroup APR_MMAP MMAP (Memory Map) Routines + * @ingroup APR + * @{ + */ #define APR_MMAP_READ 1 #define APR_MMAP_WRITE 2 -/** - * @package APR MMAP library - */ - typedef struct apr_mmap_t apr_mmap_t; -/* As far as I can tell the only really sane way to store an MMAP is as a +/** + * @remark + * As far as I can tell the only really sane way to store an MMAP is as a * void * and a length. BeOS requires this area_id, but that's just a little * something extra. I am exposing this type, because it doesn't make much * sense to keep it private, and opening it up makes some stuff easier in @@ -106,7 +113,7 @@ struct apr_mmap_t { apr_size_t size; }; -#if APR_HAS_MMAP +#if APR_HAS_MMAP || defined(DOXYGEN) /* Function definitions */ @@ -122,7 +129,6 @@ struct apr_mmap_t { * APR_MMAP_WRITE MMap opened for writing *
    * @param cntxt The pool to use when creating the mmap. - * @deffunc apr_status_t apr_mmap_create(apr_mmap_t **newmmap, apr_file_t *file, apr_off_t offset, apr_size_t size, apr_int32_t flag, apr_pool_t *cntxt) */ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap, apr_file_t *file, apr_off_t offset, @@ -132,7 +138,6 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap, /** * Remove a mmap'ed. * @param mmap The mmap'ed file. - * @deffunc apr_status_t apr_mmap_delete(apr_mmap_t *mmap) */ APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap); @@ -141,13 +146,12 @@ APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap); * @param addr The pointer to the offset specified. * @param mmap The mmap'ed file. * @param offset The offset to move to. - * @deffunc apr_status_t apr_mmap_offset(void **addr, apr_mmap_t *mmap, apr_off_t offset) */ APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mmap, apr_off_t offset); #endif /* APR_HAS_MMAP */ - +/** @} */ #ifdef __cplusplus } #endif diff --git a/include/apr_shmem.h b/include/apr_shmem.h index a291e730b5d..31e0c5f411e 100644 --- a/include/apr_shmem.h +++ b/include/apr_shmem.h @@ -54,9 +54,14 @@ #ifndef APR_SHMEM_H #define APR_SHMEM_H - +/** + * @file apr_shmem.h + * @brief APR Shared Memory Routines + */ /** - * @package Shared Memory library + * @defgroup APR_shmem Shared Memory Routines + * @ingroup APR + * @{ */ #include "apr.h" @@ -87,7 +92,6 @@ typedef struct shmem_t apr_shmem_t; * @param file The file to use for the shared memory on platforms * that require it. * @param cont The pool to use - * @deffunc apr_status_t apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) */ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont); @@ -95,7 +99,6 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, /** * Destroy the shared memory block. * @param m The shared memory block to destroy. - * @deffunc apr_status_t apr_shm_destroy(apr_shmem_t *m) */ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m); @@ -103,7 +106,6 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m); * allocate memory from the block of shared memory. * @param c The shared memory block to destroy. * @param reqsize How much memory to allocate - * @deffunc void *apr_shm_malloc(apr_shmem_t *c, apr_size_t reqsize) */ APR_DECLARE(void *) apr_shm_malloc(apr_shmem_t *c, apr_size_t reqsize); @@ -111,7 +113,6 @@ APR_DECLARE(void *) apr_shm_malloc(apr_shmem_t *c, apr_size_t reqsize); * allocate memory from the block of shared memory and initialize it to zero. * @param shared The shared memory block to destroy. * @param size How much memory to allocate - * @deffunc void *apr_shm_calloc(apr_shmem_t *shared, apr_size_t size) */ APR_DECLARE(void *) apr_shm_calloc(apr_shmem_t *shared, apr_size_t size); @@ -119,7 +120,6 @@ APR_DECLARE(void *) apr_shm_calloc(apr_shmem_t *shared, apr_size_t size); * free shared memory previously allocated. * @param shared The shared memory block to destroy. * @param entity The actual data to free. - * @deffunc apr_status_t apr_shm_free(apr_shmem_t *shared, void *entity) */ APR_DECLARE(apr_status_t) apr_shm_free(apr_shmem_t *shared, void *entity); @@ -134,7 +134,6 @@ APR_DECLARE(apr_status_t) apr_shm_free(apr_shmem_t *shared, void *entity); * based on file access. APR_USES_KEYBASED_SHM if shared * memory is based on a key value such as shmctl. If the * shared memory is anonymous, the name is NULL. - * @deffunc apr_status_t apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) */ APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name); @@ -149,7 +148,6 @@ APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, * @return APR_USES_ANONYMOUS_SHM if we are using anonymous shared * memory. APR_SUCCESS if we are using named shared memory * and we were able to assign the name correctly. - * @deffunc apr_status_t apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) */ APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name); @@ -157,7 +155,6 @@ APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, /** * Open the shared memory block in a child process. * @param The shared memory block to open in the child. - * @deffunc apr_status_t apr_shm_open(apr_shmem_t *c) */ APR_DECLARE(apr_status_t) apr_shm_open(apr_shmem_t *c); @@ -165,13 +162,12 @@ APR_DECLARE(apr_status_t) apr_shm_open(apr_shmem_t *c); * Determine how much memory is available in the specified shared memory block * @param c The shared memory block to open in the child. * @param avail The amount of space available in the shared memory block. - * @deffunc apr_status_t apr_shm_avail(apr_shmem_t *c, apr_size_t *avail) */ APR_DECLARE(apr_status_t) apr_shm_avail(apr_shmem_t *c, apr_size_t *avail); #ifdef __cplusplus } #endif - +/** @} */ #endif /* ! APR_SHMEM_H */ From 9721f85bed12f1198da48ce65e76bba205323395 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Sun, 19 Aug 2001 02:05:04 +0000 Subject: [PATCH 2199/7878] Put the WSABUFs on the stack in apr_sendv to save a malloc/free call. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62197 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 43cec4f2ee5..7a07961f44d 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -69,7 +69,7 @@ * bytes. */ #define MAX_SEGMENT_SIZE 65536 - +#define WSABUF_ON_STACK 50 APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) @@ -123,33 +123,33 @@ APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *nbytes) { + apr_status_t rc = APR_SUCCESS; apr_ssize_t rv; int i; - int lasterror; DWORD dwBytes = 0; + WSABUF wsabuf[WSABUF_ON_STACK]; + LPWSABUF pWsaBuf = wsabuf; - /* Todo: Put the WSABUF array on the stack. */ - LPWSABUF pWsaData = (LPWSABUF) malloc(sizeof(WSABUF) * nvec); - - if (!pWsaData) - return APR_ENOMEM; - + if (nvec > WSABUF_ON_STACK) { + pWsaBuf = (LPWSABUF) malloc(sizeof(WSABUF) * nvec); + if (!pWsaBuf) + return APR_ENOMEM; + } for (i = 0; i < nvec; i++) { - pWsaData[i].buf = vec[i].iov_base; - pWsaData[i].len = vec[i].iov_len; + pWsaBuf[i].buf = vec[i].iov_base; + pWsaBuf[i].len = vec[i].iov_len; } - rv = WSASend(sock->sock, pWsaData, nvec, &dwBytes, 0, NULL, NULL); + rv = WSASend(sock->sock, pWsaBuf, nvec, &dwBytes, 0, NULL, NULL); if (rv == SOCKET_ERROR) { - lasterror = apr_get_netos_error(); - free(pWsaData); - return lasterror; + rc = apr_get_netos_error(); } - free(pWsaData); + if (nvec > WSABUF_ON_STACK) + free(pWsaBuf); *nbytes = dwBytes; - return APR_SUCCESS; + return rc; } From 1025b77c2ab18bbd0de88c3996511a38ba9b9794 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 19 Aug 2001 05:45:41 +0000 Subject: [PATCH 2200/7878] Rename XtOffset to APR_XtOffset. This namespace protection is important to keep from conflicting with other packages. Submitted by: Doug MacEachern git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62198 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_general.h | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 5d7cc75347b..8f4337abbb9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Rename XtOffset to APR_XtOffset. This namespace protection + is important to keep from conflicting with other packages. + [Doug MacEachern] + *) Introduce a new --disable-ipv6 option to disable IPv6 support. [Sterling Hughes , Jeff Trawick] diff --git a/include/apr_general.h b/include/apr_general.h index 150aa513d96..0fda82e7612 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -90,29 +90,29 @@ typedef int apr_signum_t; #if defined(CRAY) || (defined(__arm) && !defined(LINUX)) #ifdef __STDC__ -#define XtOffset(p_type,field) _Offsetof(p_type,field) +#define APR_XtOffset(p_type,field) _Offsetof(p_type,field) #else #ifdef CRAY2 -#define XtOffset(p_type,field) \ +#define APR_XtOffset(p_type,field) \ (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) #else /* !CRAY2 */ -#define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field)) +#define APR_XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field)) #endif /* !CRAY2 */ #endif /* __STDC__ */ #else /* ! (CRAY || __arm) */ -#define XtOffset(p_type,field) \ +#define APR_XtOffset(p_type,field) \ ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) #endif /* !CRAY */ #ifdef offsetof -#define XtOffsetOf(s_type,field) offsetof(s_type,field) +#define APR_XtOffsetOf(s_type,field) offsetof(s_type,field) #else -#define XtOffsetOf(s_type,field) XtOffset(s_type*,field) +#define APR_XtOffsetOf(s_type,field) APR_XtOffset(s_type*,field) #endif From 3ecece7e050f48434c3b40bcb5af4d3c03e19212 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 19 Aug 2001 16:09:09 +0000 Subject: [PATCH 2201/7878] i didnt make this change (and sure didnt choose the new name! :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62199 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8f4337abbb9..33385494ea5 100644 --- a/CHANGES +++ b/CHANGES @@ -2,7 +2,7 @@ Changes with APR b1 *) Rename XtOffset to APR_XtOffset. This namespace protection is important to keep from conflicting with other packages. - [Doug MacEachern] + [Perl] *) Introduce a new --disable-ipv6 option to disable IPv6 support. [Sterling Hughes , Jeff From 3ea51bf96a74769624f26ca56d316dabafc3cd13 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 20 Aug 2001 07:12:55 +0000 Subject: [PATCH 2202/7878] OS/2: Partial workaround for a bug/oddity of select(). When interrupted by a signal, it returns 0, as if a timeout occurred. If timeout was indefinite we can safely assume that it was in fact interrupted. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62200 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/poll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/os2/poll.c b/network_io/os2/poll.c index 6d294737904..2ce51860a2a 100644 --- a/network_io/os2/poll.c +++ b/network_io/os2/poll.c @@ -147,7 +147,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, for (i=0; inum_total; i++) { pollfdset->r_socket_list[i] = -1; } - return APR_TIMEUP; + return timeout < 0 ? APR_EINTR : APR_TIMEUP; } (*nsds) = rv; From 9edb6db7945b54bb744c33af799ac70a0755f2ac Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 20 Aug 2001 10:59:55 +0000 Subject: [PATCH 2203/7878] Fix an incorrect memory allocation size. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62201 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/aplibtool.c b/build/aplibtool.c index f670ce5ed0c..bac617b7acd 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -384,7 +384,7 @@ bool parse_output_file_name(char *arg, cmd_data_t *cmd_data) if (strcmp(ext, "lo") == 0) { cmd_data->stub_name = arg; cmd_data->output_type = otObject; - newarg = (char *)malloc(strlen(newarg) + 2); + newarg = (char *)malloc(strlen(arg) + 2); strcpy(newarg, arg); ext = strrchr(newarg, '.') + 1; strcpy(ext, OBJECT_EXT); From bdd5f9afd1ea20087bfa05ac68111626474325e5 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 20 Aug 2001 13:33:51 +0000 Subject: [PATCH 2204/7878] Don't share data segments between shared modules. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62202 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/build/aplibtool.c b/build/aplibtool.c index bac617b7acd..76e009952fa 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -664,6 +664,7 @@ void generate_def_file(cmd_data_t *cmd_data) if (hDef != NULL) { fprintf(hDef, "LIBRARY %s INITINSTANCE\n", nameof(cmd_data->output_name)); + fprintf(hDef, "DATA NONSHARED\n"); fprintf(hDef, "EXPORTS\n"); fclose(hDef); From f4d77e201515ae19ace8731c50beea9e1771155d Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Mon, 20 Aug 2001 18:43:20 +0000 Subject: [PATCH 2205/7878] get shmem.c to compile on platforms that have different names for SHM_R and SHM_W (e.g. OS/390) Submitted by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62203 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shmem.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 33febcde2d5..a66e1a137b3 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -78,6 +78,12 @@ #elif APR_USE_SHMEM_SHMGET #include #include +#if !defined(SHM_R) +#define SHM_R 0400 +#endif +#if !defined(SHM_W) +#define SHM_W 0200 +#endif #include #elif APR_USE_SHMEM_BEOS #include From f08f6879a7b84d0005b7cfdf8a02c1fec404cb65 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 21 Aug 2001 12:09:50 +0000 Subject: [PATCH 2206/7878] OS/2: Fix storing of new offset in offset arg to apr_file_seek(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62204 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/seek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index fc51d5ddb80..17f21782381 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -128,7 +128,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh break; } - return APR_OS2_STATUS(DosSetFilePtr(thefile->filedes, *offset, where, (ULONG *)&offset)); + return APR_OS2_STATUS(DosSetFilePtr(thefile->filedes, *offset, where, (ULONG *)offset)); } } From 4701cc7d01cf60bb5970cc210e3e2aca45ad2394 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Wed, 22 Aug 2001 15:40:29 +0000 Subject: [PATCH 2207/7878] Use uniform wrapping for unistd.h, and don't include it if it's aready included via fileio.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62205 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/mktemp.c | 1 - file_io/unix/seek.c | 1 - test/testproc.c | 2 +- test/testsockopt.c | 2 +- test/testthread.c | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 36c2d23d571..0376afc6474 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -65,7 +65,6 @@ static const char rcsid[] = #include #include #include -#include #ifdef SVR4 /* arrange to compile it on my machine */ diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 2b58cf9c4b3..872d4385c3c 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -53,7 +53,6 @@ */ #include "fileio.h" -#include static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) { diff --git a/test/testproc.c b/test/testproc.c index 48aafcc2124..67abe5009d6 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -58,7 +58,7 @@ #include "apr_lib.h" #include "apr_strings.h" #include -#ifndef WIN32 +#if APR_HAVE_UNISTD_H #include #endif #include diff --git a/test/testsockopt.c b/test/testsockopt.c index ac2886f8298..94eb721904f 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -60,7 +60,7 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" -#ifdef BEOS +#if APR_HAVE_UNISTD_H #include #endif diff --git a/test/testthread.c b/test/testthread.c index 0af31e55611..a916a1cd26c 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -59,7 +59,7 @@ #include "errno.h" #include #include -#ifdef BEOS +#if APR_HAVE_UNISTD_H #include #endif From 78c5130dbe65942959e50da36000acd3bd73a200 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 22 Aug 2001 19:23:24 +0000 Subject: [PATCH 2208/7878] fix some indentation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62206 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 17b25a5ef06..a0f617e9a20 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -460,9 +460,9 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, nbytes = 0; } } - if (rv == -1 && - errno == EAGAIN && - sock->timeout > 0) { + if (rv == -1 && + errno == EAGAIN && + sock->timeout > 0) { apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; From fe462f9c19f0bdff6e57dc6110edac17e6218219 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 23 Aug 2001 01:49:56 +0000 Subject: [PATCH 2209/7878] Ignore a few more libtool switches. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62207 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/aplibtool.c b/build/aplibtool.c index 76e009952fa..34cdce7b784 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -238,6 +238,14 @@ bool parse_short_opt(char *arg, cmd_data_t *cmd_data) return true; } + if (strcmp(arg, "prefer-pic") == 0) { + return true; + } + + if (strcmp(arg, "prefer-non-pic") == 0) { + return true; + } + return false; } From 1a535691b7ec20549d0aaf38bae6c2638316f88d Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 23 Aug 2001 01:52:02 +0000 Subject: [PATCH 2210/7878] Always close what we open. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62208 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testfile.c b/test/testfile.c index e79bb67bfbe..3db771677db 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -393,6 +393,7 @@ static int test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_fl if (extra_flags & APR_BUFFERED) { printf("\n skipping apr_file_ungetc() for APR_BUFFERED as it " "doesn't work yet\n"); + apr_file_close(f); return (0); } else { From 984ebe526df2853bdbe7d12bfa8790ba465dfaf9 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 23 Aug 2001 02:01:47 +0000 Subject: [PATCH 2211/7878] OS/2: change apr_file_gets() to leave the trailing \n on the string, matching the output of the unix version. While I think it's dumb behaviour (I get sick of removing it again in application code) at least it's consistently dumb :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62209 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index da186995baa..4e4ce04ef0d 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -328,8 +328,10 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) if (str[i] == '\r' || str[i] == '\x1A') i--; - else if (str[i] == '\n') + else if (str[i] == '\n') { + i++; break; + } } str[i] = 0; return rv; From ded06ec13db91ca5b84481c65604b59a3230d46c Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 23 Aug 2001 03:55:32 +0000 Subject: [PATCH 2212/7878] We don't use MM anymore by default. Waiting for final word/note (can I get 3 +1s??) to cvs rm those files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62210 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/STATUS b/STATUS index 143a2bbea1f..8e6ece3d0ea 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/08/17 13:35:34 $] +Last modified at [$Date: 2001/08/23 03:55:32 $] Release: @@ -64,9 +64,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: MsgID: Status: Greg +1 (volunteers), Jeff +1, Ryan +1, Tony -0(?), david +1 - * The MM library is built as static and shared library. This should - be set up to build only the required version. - * add apr_crypt() and APR_HAS_CRYPT for apps to determine whether the crypt() function is available, and a way to call it (whether it is located in libc, libcrypt, or libufc) From e2576cc3074dba041270d74a4ecbc74eeb173044 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 23 Aug 2001 04:03:37 +0000 Subject: [PATCH 2213/7878] We'll Be Together (yes, Sting...) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62211 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 8e6ece3d0ea..0444e26e190 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/08/23 03:55:32 $] +Last modified at [$Date: 2001/08/23 04:03:37 $] Release: @@ -38,6 +38,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Status: Jim will look into this * Build scripts do not recognise AIX 4.2.1 pthreads + Justin says: "Is this still true?" * Win32: Implement apr_shm_ functions Status: rbb insists he has thoughts about splitting apr_shm_* @@ -45,6 +46,9 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: schema as well as anonymous inheritable shmem), and has a possible solution to the 'ask for 1MB, then ask for 4x256kb bogosity, so we are waiting on this. + Justin says: "That problem should be fixed now because we ignore memory + management with shared memory on Unix (at least). So, + the Win32 guys should be able to go ahead if they want." * FirstBill says we need a new procattr, APR_CREATE_SUSPENDED (or something similar) to direct ap_create_process to create the @@ -100,6 +104,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: built-in macro processing is much more powerful, and combined with the include facility, generating Makefiles becomes simpler and faster. + Justin says: "I think this got fixed with Roy's build changes." * use os_(un)cork in network_io/unix/sendrecv.c for FreeBSD's sendfile implementation. From 60a40291910b478f3b0f1d25e6c66b48495060be Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 23 Aug 2001 16:20:41 +0000 Subject: [PATCH 2214/7878] \n removal, needed now OS/2 apr_file_gets() leaves them on. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62212 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/proc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 7d3db004aa4..5a2917768d8 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -360,6 +360,11 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname if (status == APR_SUCCESS) { if (interpreter[0] == '#' && interpreter[1] == '!') { + /* delete newline */ + if (interpreter[0]) { + interpreter[strlen(interpreter) - 1] = '\0'; + } + if (interpreter[2] != '/' && interpreter[2] != '\\' && interpreter[3] != ':') { char buffer[300]; From 25c79d83fd1c0afd6adbe86cb01e8ef2df118770 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 23 Aug 2001 16:42:27 +0000 Subject: [PATCH 2215/7878] Ooops, test is redundant. We wouldn't get here if interpreter was 0 length. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62213 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/proc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 5a2917768d8..f890986fb81 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -361,9 +361,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname if (status == APR_SUCCESS) { if (interpreter[0] == '#' && interpreter[1] == '!') { /* delete newline */ - if (interpreter[0]) { - interpreter[strlen(interpreter) - 1] = '\0'; - } + interpreter[strlen(interpreter) - 1] = '\0'; if (interpreter[2] != '/' && interpreter[2] != '\\' && interpreter[3] != ':') { char buffer[300]; From 18fc16158243608e0b4dc2c04267ea25884043f8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 23 Aug 2001 16:50:59 +0000 Subject: [PATCH 2216/7878] Remove MM from the source tree. We don't use it anymore. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62214 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/mm/CHANGES | 162 -- shmem/unix/mm/ChangeLog | 250 --- shmem/unix/mm/INSTALL | 22 - shmem/unix/mm/LICENSE | 40 - shmem/unix/mm/Makefile.in | 219 -- shmem/unix/mm/PORTING | 87 - shmem/unix/mm/README | 29 - shmem/unix/mm/THANKS | 61 - shmem/unix/mm/aclocal.m4 | 417 ---- shmem/unix/mm/config.guess | 986 --------- shmem/unix/mm/config.sub | 1222 ----------- shmem/unix/mm/configure.in | 226 -- shmem/unix/mm/fbtool | 42 - shmem/unix/mm/ltconfig | 3078 --------------------------- shmem/unix/mm/ltmain.sh | 4012 ----------------------------------- shmem/unix/mm/mm-config.1 | 284 --- shmem/unix/mm/mm-config.in | 127 -- shmem/unix/mm/mm-config.pod | 128 -- shmem/unix/mm/mm.3 | 760 ------- shmem/unix/mm/mm.h | 382 ---- shmem/unix/mm/mm.pod | 633 ------ shmem/unix/mm/mm_alloc.c | 446 ---- shmem/unix/mm/mm_conf.h.in | 88 - shmem/unix/mm/mm_core.c | 625 ------ shmem/unix/mm/mm_global.c | 151 -- shmem/unix/mm/mm_lib.c | 114 - shmem/unix/mm/mm_test.c | 265 --- shmem/unix/mm/mm_vers.c | 32 - shmem/unix/mm/shtool | 1239 ----------- 29 files changed, 16127 deletions(-) delete mode 100644 shmem/unix/mm/CHANGES delete mode 100644 shmem/unix/mm/ChangeLog delete mode 100644 shmem/unix/mm/INSTALL delete mode 100644 shmem/unix/mm/LICENSE delete mode 100644 shmem/unix/mm/Makefile.in delete mode 100644 shmem/unix/mm/PORTING delete mode 100644 shmem/unix/mm/README delete mode 100644 shmem/unix/mm/THANKS delete mode 100644 shmem/unix/mm/aclocal.m4 delete mode 100755 shmem/unix/mm/config.guess delete mode 100755 shmem/unix/mm/config.sub delete mode 100644 shmem/unix/mm/configure.in delete mode 100755 shmem/unix/mm/fbtool delete mode 100755 shmem/unix/mm/ltconfig delete mode 100644 shmem/unix/mm/ltmain.sh delete mode 100644 shmem/unix/mm/mm-config.1 delete mode 100644 shmem/unix/mm/mm-config.in delete mode 100644 shmem/unix/mm/mm-config.pod delete mode 100644 shmem/unix/mm/mm.3 delete mode 100644 shmem/unix/mm/mm.h delete mode 100644 shmem/unix/mm/mm.pod delete mode 100644 shmem/unix/mm/mm_alloc.c delete mode 100644 shmem/unix/mm/mm_conf.h.in delete mode 100644 shmem/unix/mm/mm_core.c delete mode 100644 shmem/unix/mm/mm_global.c delete mode 100644 shmem/unix/mm/mm_lib.c delete mode 100644 shmem/unix/mm/mm_test.c delete mode 100644 shmem/unix/mm/mm_vers.c delete mode 100755 shmem/unix/mm/shtool diff --git a/shmem/unix/mm/CHANGES b/shmem/unix/mm/CHANGES deleted file mode 100644 index 4048a223cb2..00000000000 --- a/shmem/unix/mm/CHANGES +++ /dev/null @@ -1,162 +0,0 @@ - - MM CHANGES - ========== - - Changes between 1.0.10 and 1.0.11 (27-Aug-1999 to 06-Sep-1999) - - *) Cleaned up various file permission in source tree - *) Enhanced mm-config.in: new --all option and less newlines - *) Added support --silent to libtool glue code in aclocal.m4 - *) Upgraded to GNU Pth's more recent config.{guess,sub} - *) Upgraded to GNU shtool 1.4.6 - *) Fixed --section for mm-config in Makefile.in - *) Added `void *' casts to MAP_FAILED (= -1) values to avoid - warnings under some platforms. - *) Fixed a few typos in mm.pod - - Changes between 1.0.9 and 1.0.10 (02-Jul-1999 to 27-Aug-1999) - - *) Changed "make dist" and "make snap" to use "shtool tarball" - *) Added #define KERNEL for SunOS to get SHM_R und SHM_W values. - *) Upgraded to GNU libtool 1.3.3 - *) Upgraded to GNU shtool 1.4.5 - *) Downgraded required Autoconf version to 2.12 - *) Added MM version number to test report - *) Added --enable-batch - *) Moved mm_lock_mode in mm.h to top to avoid warnings - - Changes between 1.0.8 and 1.0.9 (24-Jun-1999 to 02-Jul-1999) - - *) Fixed a nasty bug related to {MM,mm}_[un]lock(): - an additional semicolon broke the semantics. - *) Upgraded to released shtool 1.4.0 - *) Fixed `make test' - - Changes between 1.0.7 and 1.0.8 (22-Jun-1999 to 24-Jun-1999) - - *) Added important MAP_FAILED fallback also to Autoconf stuff - *) Upgraded to latest shtool 1.3.0-dev to fix two Awk problems - - Changes between 1.0.6 and 1.0.7 (06-Jun-1999 to 22-Jun-1999) - - *) Upgraded to latest shtool 1.3.0-dev - *) Avoid -g under non-debugging situation - *) Complain with a fatal error message when MM_SHM_MAXSEGSIZE - couldn't be determined. - *) Updated config.guess/config.sub - *) Fixed a nasty permission bug for the lock files: - they were opened write-only, but at least fcntl() - requires them to be opened read-write. - *) Check return value of mm_core_lock() in mm_alloc.c - - Changes between 1.0.5 and 1.0.6 (02-Jun-1999 to 06-Jun-1999) - - *) Fixed mm_malloc() function: it returned the wrong pointer when a chunk - was reused and forgot to lock/unlock the data structures. - *) Fixed internal best-fit algorithm for finding a free memory chunk: - - things got inserted out of order in the list - - when chunk is found which matches size exactly it stops immediately - - lowered chunk splitting threshold to MIN(2*size,128) - *) Moved internal definitions in mm.h to private section - - Changes between 1.0.4 and 1.0.5 (21-May-1999 to 02-Jun-1999) - - *) Fixed output of mm-config.in - *) Fixed output of configure --help - *) Upgraded to GNU libtool 1.3.2 - *) Upgraded to shtool 1.2.9 - *) Made libtool calls visible but use --quiet - *) Hint user to send feedback only on errors or for new platform - *) Removed unnecessary "elf" hint for FreeBSD from config.guess - - Changes between 1.0.3 and 1.0.4 (15-May-1999 to 21-May-1999) - - *) Fixed maximum memory size determination and internal handling - *) Documented the mm_lib_xxx() functions. - - Changes between 1.0.2 and 1.0.3 (26-Apr-1999 to 15-May-1999) - - *) Added {MM,mm,mm_core}_permission() function - *) Fixed version information and mod_ssl URL in manual page - *) Upgraded config.{guess,sub} from libtool 1.3 distribution - *) Upgraded to GNU libtool 1.3 - *) Upgraded to shtool 1.2.7 - *) Fixed public includes for xx_t types - *) Fixed mm_vers.c and shtool type inside CVS - - Changes between 1.0.1 and 1.0.2 (18-Apr-1999 to 26-Apr-1999) - - *) Upgraded to GNU libtool 1.2f - *) Upgraded to shtool 1.1.0 - - Changes between 1.0.0 and 1.0.1 (18-Mar-1999 to 18-Apr-1999) - - *) Fixed "dist" Makefile target to not distribute CVS stuff - *) Upgraded lshtool to the latest version - *) Const'ification of the API - - Changes between 1.0b6 and 1.0.0 (18-Mar-1999 to 28-Mar-1999) - - *) Finally cleaned up and polished the mm.pod manual page. - *) Fixed mm-config program - - Changes between 1.0b5 and 1.0b6 (18-Mar-1999 to 18-Mar-1999) - - *) Added {MM,mm}_maxsize() to manual page - *) Changed MM_create() signature to match mm_create() - - Changes between 1.0b4 and 1.0b5 (15-Mar-1999 to 18-Mar-1999) - - *) Make sure the maximum allocateable size takes - the overhead of the memory pool into account. - *) Fixed lshtool and this way hex version string - *) Fixed Makefile for mm_test target dependecies - *) Added {MM,mm}_maxsize() function to let one - determine in advance the maximum allocateable pool - - Changes between 1.0b3 and 1.0b4 (15-Mar-1999 to 15-Mar-1999) - - *) Added mm-config.pod manpage - *) Split mm-config --ldflags into --ldflags and --libs - *) Removed TODO and fulltest files - - Changes between 1.0b2 and 1.0b3 (13-Mar-1999 to 15-Mar-1999) - - *) Added Autoconf check for determining max shared mem segment size - *) Changed -1 to MAP_FAILED when available - *) Replaced 8KB default shared memory segment size with max size - *) Added mm_core_maxsegsize() function - *) Use a remembered offset for mmap() on temporary files - *) Imported source tree into CVS - *) Added read-only locking support - *) Fixed MMFILE and MMZERO variants - - Changes between 1.0b1 and 1.0b2 (12-Mar-1999 to 13-Mar-1999) - - *) Updated the mm.pod manual page. - *) Split README into README and LICENSE files - *) Fixed becho problems - *) Added a test suite summary - *) Added INSTALL file - *) Reduced mm_test's memory size from 1MB to 512KB - *) Fixed unsigned long and %X related warnings - - Changes between 1.0b0 and 1.0b1 (11-Mar-1999 to 12-Mar-1999) - - *) Enhanced mm_test - *) Added {MM,mm}_available() function - *) Fixed MMZERO - *) Fixed IPC Semaphore initialization - *) Added --with-{sem,shm}=TYPE options - *) Fixed "make test" and mm_memory_display() function - *) Added mm_lib.c source with mm_lib_xx() functions - - Changes between 0.9.0 and 1.0b0 (10-Mar-1999 to 11-Mar-1999) - - *) Switched to GNU Autoconf and GNU Libtool - - Changes between GENESIS and 0.9.0 (Jan-1999 to 10-Mar-1999) - - *) Created initial version on FreeBSD - *) Ported to Linux and Solaris - diff --git a/shmem/unix/mm/ChangeLog b/shmem/unix/mm/ChangeLog deleted file mode 100644 index 2f0503ef652..00000000000 --- a/shmem/unix/mm/ChangeLog +++ /dev/null @@ -1,250 +0,0 @@ - __ __ __ __ - | \/ | \/ | - | |\/| | |\/| | - | | | | | | | - |_| |_|_| |_| - - MM - Shared Memory Library - - ChangeLog - ========= - _ _ - / | / | - | | | | - | |_| | - __|_(_)_|__________________________________________________________ - - Changes between 1.1.0 and 1.1.1 (30-Apr-2000 to 30-Apr-2000) - - *) Fixed compilation under Solaris where the SunOS4 and BS2000 kludges - for conflicted with the Sun vendor includes (which - unfortunately use the defines). - [Ralf S. Engelschall, Jeff Beard ] - - Changes between 1.0.12 and 1.1.0 (28-Sep-1999 to 30-Apr-2000) - - *) Fixed `make test' feedback procedure in Makefile.in now that the - platform list is stored in the PORTING file. - [Ralf S. Engelschall] - - *) Renamed file CHANGES to ChangeLog. - [Ralf S. Engelschall] - - *) Fixed pointer arithmentic in memset/memcpy replacements - by casting `void *' arguments to `char *'. - [Sascha Schumann ] - - *) Added BS2000 support for stuff. - [Martin Kraemer ] - - *) Added an include for to maximum shared mem segment size - check in aclocal.m4. This especially fixes compile problems under for - Solaris 8. - [Alexander Demenchuk , Greg Gears ] - - *) Fixed a warning under IRIX related to size_t comparisons - [Ralf S. Engelschall] - - *) Added support for IBM OS/390 - [Jeff Trawick ] - - *) Upgraded to GNU libtool from version 1.3.3 to 1.3.4 - and upgraded GNU shtool from version 1.4.6 to 1.4.9 - [Ralf S. Engelschall] - - *) Upgraded config.guess to GNU Pth's version and - use "/sbin/sysctl" under FreeBSD instead of just "sysctl" - [Jeff Trawick ] - - *) Added platform support for the esoteric Unix look-alike BeOS - [David Reid" ] - - *) Added `make check' as an alias for `make test' - [Ralf S. Engelschall] - - *) Adjusted copyright messages for year 2000 - [Ralf S. Engelschall] - - *) Fixed Autoconf checks for SunOS - [Ralf S. Engelschall] - - *) Fixed a bug in aclocal.m4's AC_CHECK_DEFINE macro. - [Ralf S. Engelschall] - - *) Updated the manual page (typos, fixes, etc.) - [Ralf S. Engelschall] - - *) Splitted README into README, PORTING and THANKS document. - [Ralf S. Engelschall] - - _ ___ - / | / _ \ - | || | | | - | || |_| | - __|_(_)___/________________________________________________________ - - Changes between 1.0.11 and 1.0.12 (06-Sep-1999 to 28-Sep-1999) - - *) Recreated configure with latest Autoconf 2.13.1 (snapshot) - *) Always use --mode=xxx for libtool calls to avoid problems under - situations where $CC doesn't allow libtool to guess the mode - correctly. - - Changes between 1.0.10 and 1.0.11 (27-Aug-1999 to 06-Sep-1999) - - *) Cleaned up various file permission in source tree - *) Enhanced mm-config.in: new --all option and less newlines - *) Added support --silent to libtool glue code in aclocal.m4 - *) Upgraded to GNU Pth's more recent config.{guess,sub} - *) Upgraded to GNU shtool 1.4.6 - *) Fixed --section for mm-config in Makefile.in - *) Added `void *' casts to MAP_FAILED (= -1) values to avoid - warnings under some platforms. - *) Fixed a few typos in mm.pod - - Changes between 1.0.9 and 1.0.10 (02-Jul-1999 to 27-Aug-1999) - - *) Changed "make dist" and "make snap" to use "shtool tarball" - *) Added #define KERNEL for SunOS to get SHM_R und SHM_W values. - *) Upgraded to GNU libtool 1.3.3 - *) Upgraded to GNU shtool 1.4.5 - *) Downgraded required Autoconf version to 2.12 - *) Added MM version number to test report - *) Added --enable-batch - *) Moved mm_lock_mode in mm.h to top to avoid warnings - - Changes between 1.0.8 and 1.0.9 (24-Jun-1999 to 02-Jul-1999) - - *) Fixed a nasty bug related to {MM,mm}_[un]lock(): - an additional semicolon broke the semantics. - *) Upgraded to released shtool 1.4.0 - *) Fixed `make test' - - Changes between 1.0.7 and 1.0.8 (22-Jun-1999 to 24-Jun-1999) - - *) Added important MAP_FAILED fallback also to Autoconf stuff - *) Upgraded to latest shtool 1.3.0-dev to fix two Awk problems - - Changes between 1.0.6 and 1.0.7 (06-Jun-1999 to 22-Jun-1999) - - *) Upgraded to latest shtool 1.3.0-dev - *) Avoid -g under non-debugging situation - *) Complain with a fatal error message when MM_SHM_MAXSEGSIZE - couldn't be determined. - *) Updated config.guess/config.sub - *) Fixed a nasty permission bug for the lock files: - they were opened write-only, but at least fcntl() - requires them to be opened read-write. - *) Check return value of mm_core_lock() in mm_alloc.c - - Changes between 1.0.5 and 1.0.6 (02-Jun-1999 to 06-Jun-1999) - - *) Fixed mm_malloc() function: it returned the wrong pointer when a chunk - was reused and forgot to lock/unlock the data structures. - *) Fixed internal best-fit algorithm for finding a free memory chunk: - - things got inserted out of order in the list - - when chunk is found which matches size exactly it stops immediately - - lowered chunk splitting threshold to MIN(2*size,128) - *) Moved internal definitions in mm.h to private section - - Changes between 1.0.4 and 1.0.5 (21-May-1999 to 02-Jun-1999) - - *) Fixed output of mm-config.in - *) Fixed output of configure --help - *) Upgraded to GNU libtool 1.3.2 - *) Upgraded to shtool 1.2.9 - *) Made libtool calls visible but use --quiet - *) Hint user to send feedback only on errors or for new platform - *) Removed unnecessary "elf" hint for FreeBSD from config.guess - - Changes between 1.0.3 and 1.0.4 (15-May-1999 to 21-May-1999) - - *) Fixed maximum memory size determination and internal handling - *) Documented the mm_lib_xxx() functions. - - Changes between 1.0.2 and 1.0.3 (26-Apr-1999 to 15-May-1999) - - *) Added {MM,mm,mm_core}_permission() function - *) Fixed version information and mod_ssl URL in manual page - *) Upgraded config.{guess,sub} from libtool 1.3 distribution - *) Upgraded to GNU libtool 1.3 - *) Upgraded to shtool 1.2.7 - *) Fixed public includes for xx_t types - *) Fixed mm_vers.c and shtool type inside CVS - - Changes between 1.0.1 and 1.0.2 (18-Apr-1999 to 26-Apr-1999) - - *) Upgraded to GNU libtool 1.2f - *) Upgraded to shtool 1.1.0 - - Changes between 1.0.0 and 1.0.1 (18-Mar-1999 to 18-Apr-1999) - - *) Fixed "dist" Makefile target to not distribute CVS stuff - *) Upgraded lshtool to the latest version - *) Const'ification of the API - - Changes between 1.0b6 and 1.0.0 (18-Mar-1999 to 28-Mar-1999) - - *) Finally cleaned up and polished the mm.pod manual page. - *) Fixed mm-config program - - Changes between 1.0b5 and 1.0b6 (18-Mar-1999 to 18-Mar-1999) - - *) Added {MM,mm}_maxsize() to manual page - *) Changed MM_create() signature to match mm_create() - - Changes between 1.0b4 and 1.0b5 (15-Mar-1999 to 18-Mar-1999) - - *) Make sure the maximum allocateable size takes - the overhead of the memory pool into account. - *) Fixed lshtool and this way hex version string - *) Fixed Makefile for mm_test target dependecies - *) Added {MM,mm}_maxsize() function to let one - determine in advance the maximum allocateable pool - - Changes between 1.0b3 and 1.0b4 (15-Mar-1999 to 15-Mar-1999) - - *) Added mm-config.pod manpage - *) Split mm-config --ldflags into --ldflags and --libs - *) Removed TODO and fulltest files - - Changes between 1.0b2 and 1.0b3 (13-Mar-1999 to 15-Mar-1999) - - *) Added Autoconf check for determining max shared mem segment size - *) Changed -1 to MAP_FAILED when available - *) Replaced 8KB default shared memory segment size with max size - *) Added mm_core_maxsegsize() function - *) Use a remembered offset for mmap() on temporary files - *) Imported source tree into CVS - *) Added read-only locking support - *) Fixed MMFILE and MMZERO variants - - Changes between 1.0b1 and 1.0b2 (12-Mar-1999 to 13-Mar-1999) - - *) Updated the mm.pod manual page. - *) Split README into README and LICENSE files - *) Fixed becho problems - *) Added a test suite summary - *) Added INSTALL file - *) Reduced mm_test's memory size from 1MB to 512KB - *) Fixed unsigned long and %X related warnings - - Changes between 1.0b0 and 1.0b1 (11-Mar-1999 to 12-Mar-1999) - - *) Enhanced mm_test - *) Added {MM,mm}_available() function - *) Fixed MMZERO - *) Fixed IPC Semaphore initialization - *) Added --with-{sem,shm}=TYPE options - *) Fixed "make test" and mm_memory_display() function - *) Added mm_lib.c source with mm_lib_xx() functions - - Changes between 0.9.0 and 1.0b0 (10-Mar-1999 to 11-Mar-1999) - - *) Switched to GNU Autoconf and GNU Libtool - - Changes between GENESIS and 0.9.0 (Jan-1999 to 10-Mar-1999) - - *) Created initial version on FreeBSD - *) Ported to Linux and Solaris - diff --git a/shmem/unix/mm/INSTALL b/shmem/unix/mm/INSTALL deleted file mode 100644 index 15b6388634c..00000000000 --- a/shmem/unix/mm/INSTALL +++ /dev/null @@ -1,22 +0,0 @@ - __ __ __ __ - | \/ | \/ | - | |\/| | |\/| | - | | | | | | | - |_| |_|_| |_| - - MM - Shared Memory Library - - INSTALL - ======= - - To install the MM library into /path/to/mm/{bin,lib,include,man}/ perform - the following steps in your shell: - - $ ./configure --prefix=/path/to/mm - $ make - $ make test - $ make install - - This installs at least a static variant of the MM library and when your - platforms support it, also a shared library variant of the MM library. - diff --git a/shmem/unix/mm/LICENSE b/shmem/unix/mm/LICENSE deleted file mode 100644 index c95b7d240ab..00000000000 --- a/shmem/unix/mm/LICENSE +++ /dev/null @@ -1,40 +0,0 @@ - - ==================================================================== - Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - 3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by - Ralf S. Engelschall ." - - 4. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by - Ralf S. Engelschall ." - - THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY - EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR - ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - OF THE POSSIBILITY OF SUCH DAMAGE. - ==================================================================== - diff --git a/shmem/unix/mm/Makefile.in b/shmem/unix/mm/Makefile.in deleted file mode 100644 index 681f7ab48af..00000000000 --- a/shmem/unix/mm/Makefile.in +++ /dev/null @@ -1,219 +0,0 @@ -## ==================================================================== -## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in -## the documentation and/or other materials provided with the -## distribution. -## -## 3. All advertising materials mentioning features or use of this -## software must display the following acknowledgment: -## "This product includes software developed by -## Ralf S. Engelschall ." -## -## 4. Redistributions of any form whatsoever must retain the following -## acknowledgment: -## "This product includes software developed by -## Ralf S. Engelschall ." -## -## THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY -## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR -## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -## OF THE POSSIBILITY OF SUCH DAMAGE. -## ==================================================================== - -## -## Makefile -## - -@SET_MAKE@ - -TOP = . -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -libdir = @libdir@ -includedir = @includedir@ -mandir = @mandir@ - -SHELL = /bin/sh -CC = @CC@ -CFLAGS = @CFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -RM = rm -f -LIBTOOL = @LIBTOOL@ -SHTOOL = @SHTOOL@ - -MAN = mm.3 mm-config.1 -OBJ = mm_global.o mm_alloc.o mm_core.o mm_lib.o mm_vers.o -LOBJ = mm_global.lo mm_alloc.lo mm_core.lo mm_lib.lo mm_vers.lo - -_VERSION_FILE = \ - mm_vers.c -_VERSION = \ - $(SHTOOL) version -l c -n MM -p MM $$OPT $(_VERSION_FILE);\ - V=`$(SHTOOL) version -l c -d long $(_VERSION_FILE)`;\ - sed -e "s/Version .*(.*)/Version $$V/g" README.n && mv README.n README - -.SUFFIXES: .o .lo - -.c.o: - $(LIBTOOL) --quiet --mode=compile $(CC) -c $(CFLAGS) $< - -.c.lo: - $(LIBTOOL) --quiet --mode=compile $(CC) -c $(CFLAGS) $< - -all: libmm.la $(MAN) mm_test - -libmm.la: $(OBJ) $(LOBJ) - $(LIBTOOL) --quiet --mode=link $(CC) -o libmm.la $(LOBJ) \ - -rpath $(libdir) -version-info `$(SHTOOL) version -l c -d libtool mm_vers.c` - -mm_alloc.c mm_core.c mm_global.c: mm_conf.h mm.h mm_vers.c - -check: test -test: mm_test - -@./mm_test; \ - if [ $$? -eq 0 ]; then \ - PLATFORM=`$(SHELL) ./config.guess`; \ - PLATFORM=`$(SHELL) ./config.sub $$PLATFORM`; \ - if [ ".`grep $$PLATFORM PORTING`" = . ]; then \ - echo "Please send the following summary via Email to the author"; \ - echo "Ralf S. Engelschall for inclusion into"; \ - echo "the list of successfully tested platforms (see PORTING file):"; \ - echo ""; \ - echo "Ok" >.fbtool; \ - $(SHELL) ./fbtool -d; \ - fi; \ - else \ - echo "Please send the following summary together with as much other"; \ - echo "details about the configuration, build and test steps to the author"; \ - echo "Ralf S. Engelschall to help him in tracking"; \ - echo "down your platform problem."; \ - echo ""; \ - echo "Failed" >.fbtool; \ - $(SHELL) ./fbtool -d; \ - fi; \ - exit 0 - -debug: mm_test - @$(LIBTOOL) --mode=execute gdb mm_test - -mm_test: mm_test.lo libmm.la - $(LIBTOOL) --quiet --mode=link $(CC) -o $@ mm_test.lo libmm.la - -mm.3: mm.pod - V1=`$(SHTOOL) version -l c -d short $(_VERSION_FILE)`; \ - V2=`$(SHTOOL) version -l c -d long $(_VERSION_FILE)`; \ - D=`$(SHTOOL) version -l c -d long $(_VERSION_FILE) | sed -e 's;.*(;;' -e 's;).*;;'`; \ - pod2man --section=3 --center="Shared Memory Library" --release="$$D" --date="MM $$V1" mm.pod |\ - perl -p -e 's;^(\\\&\s+.+?)([Mm][Mm]_[a-zA-Z0-9_]+)(\(.+?)$$;$$1\\fB$$2\\fR$$3;' |\ - sed -e "s;MM_VERSION_STR;$$V2;" >mm.3 - -mm-config.1: mm-config.pod - V1=`$(SHTOOL) version -l c -d short $(_VERSION_FILE)`; \ - V2=`$(SHTOOL) version -l c -d long $(_VERSION_FILE)`; \ - D=`$(SHTOOL) version -l c -d long $(_VERSION_FILE) | sed -e 's;.*(;;' -e 's;).*;;'`; \ - pod2man --section=1 --center="Shared Memory Library" --release="$$D" --date="MM $$V1" mm-config.pod |\ - perl -p -e 's;^(\\\&\s+.+?)([Mm][Mm]_[a-zA-Z0-9_]+)(\(.+?)$$;$$1\\fB$$2\\fR$$3;' |\ - sed -e "s;MM_VERSION_STR;$$V2;" >mm-config.1 - -update: - @$(RM) ltmain.sh ltconfig shtool - @$(MAKE) $(MFLAGS) ltmain.sh ltconfig configure shtool - -configure: configure.in aclocal.m4 - $(RM) configure - autoconf - -ltmain.sh: - @F=`libtoolize -n -c -f | grep 'cp.*ltmain.sh' |\ - sed -e 's;[^/]*;;' -e 's; .*;;'`; \ - echo "ltmain.sh <-- $$F"; cat $$F |\ - sed -e 's:/bin/sh; then:/bin/sh || test "$$nonopt" = ./shtool;then:' \ - -e 's:exec \$$SHELL \$$0 --finish:exit 0 #:' >ltmain.sh - -ltconfig: - @F=`libtoolize -n -c -f | grep 'cp.*ltconfig' | sed -e 's;[^/]*;;' -e 's; .*;;'`; \ - echo "ltconfig <-- $$F"; cp $$F . - -shtool: - shtoolize -o shtool version echo mkdir install fixperm tarball - -install: all - $(SHTOOL) mkdir -f -p -m 755 $(bindir) - $(SHTOOL) mkdir -f -p -m 755 $(includedir) - $(SHTOOL) mkdir -f -p -m 755 $(libdir) - $(SHTOOL) mkdir -f -p -m 755 $(mandir)/man1 - $(SHTOOL) mkdir -f -p -m 755 $(mandir)/man3 - $(SHTOOL) install -c -m 755 mm-config $(bindir)/mm-config - $(SHTOOL) install -c -m 644 mm-config.1 $(mandir)/man1/mm-config.1 - $(SHTOOL) install -c -m 644 mm.3 $(mandir)/man3/mm.3 - $(SHTOOL) install -c -m 644 mm.h $(includedir)/mm.h - @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 libmm.la $(libdir)/libmm.la - -clean: - $(RM) mm_test mm_test.o mm_test.lo - $(RM) core *.core *.bak *~ - $(RM) $(LOBJ) - $(RM) $(OBJ) - $(RM) libmm.la - $(RM) -r .libs - -distclean: clean - $(RM) Makefile - $(RM) mm-config mm_conf.h - $(RM) config.h config.cache config.status config.log - $(RM) libtool - $(RM) .fbtool - -realclean: distclean - $(RM) $(MAN) - -dist: distclean - @$(SHTOOL) fixperm -v *; \ - V=`$(SHTOOL) version -l c -d short $(_VERSION_FILE)`; \ - $(SHTOOL) tarball -o mm-$${V}.tar.gz -d mm-$${V} -u rse -g mm \ - -e 'CVS,\.cvsignore,\.[ao],^\.' -c 'gzip --best' .; \ - ls -l mm-$${V}.tar.gz - -snap: distclean - @$(SHTOOL) fixperm *; \ - V=`$(SHTOOL) version -l c -d short $(_VERSION_FILE)`; \ - $(SHTOOL) tarball -o mm-$${V}-SNAP.tar.gz -d mm-$${V}-SNAP -u rse -g mm \ - -e 'CVS,\.cvsignore,\.[ao],^\.' -c 'gzip --best' .; \ - ls -l mm-$${V}-SNAP.tar.gz - -new-version: - OPT='-i v' && $(_VERSION) -new-revision: - OPT='-i r' && $(_VERSION) -new-patchlevel: - OPT='-i P' && $(_VERSION) -new-betalevel: - OPT='-i b' && $(_VERSION) -new-alphalevel: - OPT='-i a' && $(_VERSION) -new-snaplevel: - OPT='-i s' && $(_VERSION) -new-release: - OPT='-s $(R)' && $(_VERSION) -update-version: - OPT="-s `$(SHTOOL) version -l c -d short $(_VERSION_FILE)`" && $(_VERSION) - diff --git a/shmem/unix/mm/PORTING b/shmem/unix/mm/PORTING deleted file mode 100644 index 04d4c241969..00000000000 --- a/shmem/unix/mm/PORTING +++ /dev/null @@ -1,87 +0,0 @@ - __ __ __ __ - | \/ | \/ | - | |\/| | |\/| | - | | | | | | | - |_| |_|_| |_| - - MM - Shared Memory Library - - PORTING - ======= - - The MM library was successfully tested on the following platforms (and - should automatically adjust to other platforms, of course): - - o i686-pc-freebsd3.1 FreeBSD 3.1 - o i686-pc-freebsd3.2 FreeBSD 3.2 - o i686-pc-freebsd3.3 FreeBSD 3.3 - o i586-pc-freebsd3.4 FreeBSD 3.4 - o i686-pc-freebsd3.4 FreeBSD 3.4 - o i586-pc-freebsd2.2.7 FreeBSD 2.2.7 - o i586-pc-freebsd2.2.8 FreeBSD 2.2.8 - o i486-pc-freebsd2.2.6 FreeBSD 2.2.6 - o i586-pc-freebsd2.2.2 FreeBSD 2.2.2 - o i686-pc-freebsd4.0 FreeBSD 4.0 - o i386-unknown-openbsd2.4 OpenBSD 2.4 - o i386-unknown-openbsd2.5 OpenBSD 2.5 - o i386-unknown-netbsd1.4 NetBSD 1.4/x86 - o i386-unknown-netbsd1.4.2 NetBSD 1.4.2/x86 - o sparc-unknown-netbsd1.4.1 NetBSD 1.4.1/sparc - o sparc-unknown-netbsd1.4.2 NetBSD 1.4.2/sparc - o alpha-unknown-netbsd1.4.2 NetBSD 1.4.2/alpha - o i386-pc-bsdi2.1 BSDI 2.1 - o i386-pc-bsdi4.0.1 BSDI 4.0.1 - o i586-pc-linux-gnu RedHat 5.2 - o i586-pc-linux-gnu RedHat 5.0 - o i686-pc-linux-gnu Redhat 6.0 - o i686-pc-linux-gnu Slackware 7.0 - o i486-pc-linux-gnulibc1 Linux - o i686-pc-linux-gnulibc1 Linux - o i686-pc-linux-gnulibc1 Slackware 4.0 - o i586-pc-linux-gnulibc1 Slackware 4.0 - o sparc64-unknown-linux-gnu Linux - o sparc-unknown-linux-gnu Linux - o alphaev6-unknown-linux-gnu Linux - o alpha-unknown-linux-gnu Linux - o powerpc-unknown-linux-gnulibc1 MkLinux DR3 - o sparc-sun-sunos4.1.4 SunOS 4.1.4 - o sparc-sun-sunos4.1.3_U1 SunOS 4.1.3_U1 - o sparc-sun-solaris2.5.1 Solaris 2.5.1 - o sparc-sun-solaris2.6 Solaris 2.6 - o sparc-sun-solaris2.7 Solaris 2.7 - o i386-pc-solaris2.6 Solaris 2.6/x86 - o i386-pc-solaris2.7 Solaris 2.7/x86 - o i386-pc-solaris2.8 Solaris 2.7/x86 - o sparc-sun-solaris2.8 Solaris 2.8 - o alphaev56-dec-osf4.0d Digital Unix v4.0D - o alphaev56-dec-osf4.0c Digital Unix v4.0C - o alphaev6-dec-osf5.0 Digital Unix v5.0 (Tru64) - o powerpc-ibm-aix4.2.0.0 AIX 4.2.0 - o powerpc-ibm-aix4.2.1.0 AIX 4.2.1 - o rs6000-ibm-aix4.2.1.0 AIX 4.2.1 - o powerpc-ibm-aix4.3.1.0 AIX 4.3.1 - o powerpc-ibm-aix4.3.2.0 AIX 4.3.2 - o rs6000-ibm-aix4.3.2.0 AIX 4.3.2 - o alphaev56-unknown-linux-gnu Linux/Alpha - o powerpc-unknown-linux-gnu LinuxPPC 4 - o m68k-apple-aux3.1.1 A/UX 3.1.1 - o hppa1.1-hp-hpux10.10 HP-UX 10.10 - o hppa1.1-hp-hpux10.20 HP-UX 10.20 - o hppa2.0-hp-hpux10.20 HP-UX 10.20 - o hppa1.1-hp-hpux11.00 HP-UX 11.00 - o hppa2.0w-hp-hpux11.00 HP-UX 11.00 - o arm-unknown-linux-gnu Corel Netwinder SA110 - o mips-sni-sysv4 SIEMENS ReliantUNIX - o mips-sgi-irix5.3 IRIX 5.3 - o mips-sgi-irix6.2 IRIX 6.2 - o mips-sgi-irix6.3 IRIX 6.3 - o mips-sgi-irix6.4 IRIX 6.4 - o mips-sgi-irix6.5 IRIX 6.5.4 - o i686-pc-cygwin Win32 CygWin 20.1 - o alpha-dec-osf3.2 OSF/1 3.2 - o alpha-dec-osf4.0d OSF/1 4.0d - o alpha-dec-osf4.0e OSF/1 4.0e - o alphaev6-dec-osf4.0f OSF/1 4.0f - o i686-UnixWare7.1.0-sysv5 UnixWare 7.1 - o i686-pc-sco3.2v5.0.5 SCO OpenServer 5.0.5 - diff --git a/shmem/unix/mm/README b/shmem/unix/mm/README deleted file mode 100644 index 626e130e5f3..00000000000 --- a/shmem/unix/mm/README +++ /dev/null @@ -1,29 +0,0 @@ - __ __ __ __ - | \/ | \/ | - | |\/| | |\/| | - | | | | | | | - |_| |_|_| |_| - - MM - Shared Memory Library - Copyright (c) 1999-2000 Ralf S. Engelschall, All rights reserved. - Version 1.1.1 (30-Apr-2000) - - The MM library is a 2-layer abstraction library which simplifies the usage - of shared memory between forked (and this way strongly related) processes - under Unix platforms. On the first (lower) layer it hides all platform - dependent implementation details (allocation and locking) when dealing with - shared memory segments and on the second (higher) layer it provides a - high-level malloc(3)-style API for a convenient and well known way to work - with data-structures inside those shared memory segments. - - This library was successfully tested on FreeBSD, OpenBSD, NetBSD, BSDI, - Linux, SunOS, Solaris, Tru64, AIX, A/UX, HP-UX, ReliantUNIX, IRIX, UnixWare - and even Win32 Cygwin, BeOS and OS/390. - - The documentation and latest release can be found on - http://www.engelschall.com/sw/mm/ - - Ralf S. Engelschall - rse@engelschall.com - www.engelschall.com - diff --git a/shmem/unix/mm/THANKS b/shmem/unix/mm/THANKS deleted file mode 100644 index d2081ee0b80..00000000000 --- a/shmem/unix/mm/THANKS +++ /dev/null @@ -1,61 +0,0 @@ - __ __ __ __ - | \/ | \/ | - | |\/| | |\/| | - | | | | | | | - |_| |_|_| |_| - - MM - Shared Memory Library - - THANKS - ====== - - Credit has to be given to the following people who contributed ideas, - bugfixes, hints, gave platform feedback, etc. (in alphabetical order): - - o Ronald Appelfelder - o Robert Belleman - o Ryan Bloom - o Volker Borchert - o William Campbell - o Richard Cardwell - o Jeff Clark - o Eric Cholet - o Alexander Demenchuk - o Jason Dillon - o Joe France - o Richard Furda - o Dean Gaudet - o Greg Gears - o Ask Bjoern Hansen - o Robin Hunt - o Markus Kilbinger - o Kristian Köhntopp - o Jim Jagielski - o Bob Jones - o Mats Josefsson - o Sergey Kachanovsky - o Martin Kraemer - o Mike Latinovich - o Rasmus Lerdorf - o Dave Malhotra - o Christophe Massiot - o Thomas J. Menini - o Patrick - o Charles Randall - o David Rees - o Martin Rosenbach - o David Reid - o Scott Rothgaber - o Saeid Sadeghi - o Mehul N. Sanghvi - o Joaquim Sanmarti - o Sascha Schumann - o Dan Sullivan - o Jeff Trawick - o Tom Vaughan - o Kai Voigt - o Martin Waterworth - o Rick Watson - o Mark Wilkie - o Cliff Woolley - diff --git a/shmem/unix/mm/aclocal.m4 b/shmem/unix/mm/aclocal.m4 deleted file mode 100644 index 235753a53cb..00000000000 --- a/shmem/unix/mm/aclocal.m4 +++ /dev/null @@ -1,417 +0,0 @@ -## ==================================================================== -## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in -## the documentation and/or other materials provided with the -## distribution. -## -## 3. All advertising materials mentioning features or use of this -## software must display the following acknowledgment: -## "This product includes software developed by -## Ralf S. Engelschall ." -## -## 4. Redistributions of any form whatsoever must retain the following -## acknowledgment: -## "This product includes software developed by -## Ralf S. Engelschall ." -## -## THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY -## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR -## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -## OF THE POSSIBILITY OF SUCH DAMAGE. -## ==================================================================== -divert(-1) - -define(AC_PROG_LIBTOOL,[dnl -AC_ARG_ENABLE(static,dnl -[ --enable-static build static libraries (default=yes)], -enable_static="$enableval", -enable_static=yes -) -AC_ARG_ENABLE(shared,dnl -[ --enable-shared build shared libraries (default=yes)], -enable_shared="$enableval", -enable_shared=yes -) -libtool_flags='' -echo "Calling ltconfig with PLATFORM=$PLATFORM" -test ".$silent" = .yes && libtool_flags="$libtool_flags --silent" -test ".$enable_static" = .no && libtool_flags="$libtool_flags --disable-static" -test ".$enable_shared" = .no && libtool_flags="$libtool_flags --disable-shared" -test ".$ac_cv_prog_gcc" = .yes && libtool_flags="$libtool_flags --with-gcc" -test ".$ac_cv_prog_gnu_ld" = .yes && libtool_flags="$libtool_flags --with-gnu-ld" -CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LD="$LD" \ -${CONFIG_SHELL-/bin/sh} ltconfig --no-reexec \ -$libtool_flags --no-verify ltmain.sh $PLATFORM ||\ -AC_MSG_ERROR([libtool configuration failed]) -LIBTOOL="\$(TOP)/libtool" -AC_SUBST(LIBTOOL) -]) - -define(AC_CHECK_DEBUGGING,[dnl -AC_MSG_CHECKING(for compilation debug mode) -AC_ARG_ENABLE(debug,dnl -[ --enable-debug build for debugging (default=no)], -[dnl -if test ".$ac_cv_prog_gcc" = ".yes"; then - case "$CFLAGS" in - *-O2* ) ;; - * ) CFLAGS="$CFLAGS -O2" ;; - esac - case "$CFLAGS" in - *-g* ) ;; - * ) CFLAGS="$CFLAGS -g" ;; - esac - CFLAGS="$CFLAGS -ggdb3" - CFLAGS="$CFLAGS -Wall -Wshadow -Wpointer-arith -Wcast-align" - CFLAGS="$CFLAGS -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline" -else - case "$CFLAGS" in - *-g* ) ;; - * ) CFLAGS="$CFLAGS -g" ;; - esac -fi -msg="enabled" -AC_DEFINE(MM_DEBUG) -],[ -case "$CFLAGS" in - *-g* ) CFLAGS=`echo "$CFLAGS" |\ - sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;; -esac -msg=disabled -]) -AC_MSG_RESULT([$msg]) -]) - -define(AC_CONFIGURE_PART,[dnl -AC_MSG_RESULT() -AC_MSG_RESULT(${T_MD}$1:${T_ME}) -])dnl - -define(AC_CHECK_DEFINE,[dnl - AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1, - AC_EGREP_CPP([YES_IS_DEFINED], [ -#include <$2> -#ifdef $1 -YES_IS_DEFINED -#endif - ], ac_cv_define_$1=yes, ac_cv_define_$1=no) - ) - if test "$ac_cv_define_$1" = "yes" ; then - AC_DEFINE(HAVE_$1) - fi -])dnl -AC_DEFINE(HAVE_$1) - -define(AC_IFALLYES,[dnl -ac_rc=yes -for ac_spec in $1; do - ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'` - ac_item=`echo "$ac_spec" | sed -e 's/^.*://'` - case $ac_type in - header ) - ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'` - ac_var="ac_cv_header_$ac_item" - ;; - file ) - ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'` - ac_var="ac_cv_file_$ac_item" - ;; - func ) ac_var="ac_cv_func_$ac_item" ;; - define ) ac_var="ac_cv_define_$ac_item" ;; - custom ) ac_var="$ac_item" ;; - esac - eval "ac_val=\$$ac_var" - if test ".$ac_val" != .yes; then - ac_rc=no - break - fi -done -if test ".$ac_rc" = .yes; then - : - $2 -else - : - $3 -fi -])dnl - -define(AC_BEGIN_DECISION,[dnl -ac_decision_item='$1' -ac_decision_msg='FAILED' -ac_decision='' -])dnl -define(AC_DECIDE,[dnl -ac_decision='$1' -ac_decision_msg='$2' -ac_decision_$1=yes -ac_decision_$1_msg='$2' -])dnl -define(AC_DECISION_OVERRIDE,[dnl - ac_decision='' - for ac_item in $1; do - eval "ac_decision_this=\$ac_decision_${ac_item}" - if test ".$ac_decision_this" = .yes; then - ac_decision=$ac_item - eval "ac_decision_msg=\$ac_decision_${ac_item}_msg" - fi - done -])dnl -define(AC_DECISION_FORCE,[dnl -ac_decision="$1" -eval "ac_decision_msg=\"\$ac_decision_${ac_decision}_msg\"" -])dnl -define(AC_END_DECISION,[dnl -if test ".$ac_decision" = .; then - echo "[$]0:Error: decision on $ac_decision_item failed" 1>&2 - exit 1 -else - if test ".$ac_decision_msg" = .; then - ac_decision_msg="$ac_decision" - fi - AC_MSG_RESULT([decision on $ac_decision_item... $ac_decision_msg]) -fi -])dnl - -AC_DEFUN(AC_TEST_FILE, -[AC_REQUIRE([AC_PROG_CC]) -ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(ac_cv_file_$ac_safe, [ - if test -r $1; then - eval "ac_cv_file_$ac_safe=yes" - else - eval "ac_cv_file_$ac_safe=no" - fi -])dnl -if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) -else - AC_MSG_RESULT(no) -ifelse([$3], , , [$3]) -fi -]) - -AC_DEFUN(AC_PROG_NM, -[AC_MSG_CHECKING([for BSD-compatible nm]) -AC_CACHE_VAL(ac_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - ac_cv_path_NM="$NM" -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -B" - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -p" - else - ac_cv_path_NM="$ac_dir/nm" - fi - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm -fi]) -NM="$ac_cv_path_NM" -AC_MSG_RESULT([$NM]) -AC_SUBST(NM) -]) - -define(AC_CHECK_MAXSEGSIZE,[dnl -AC_MSG_CHECKING(for shared memory maximum segment size) -AC_CACHE_VAL(ac_cv_maxsegsize, -[ -OCFLAGS="$CFLAGS" -case "$1" in - MM_SHMT_MM* ) CFLAGS="-DTEST_MMAP $CFLAGS" ;; - MM_SHMT_IPCSHM ) CFLAGS="-DTEST_SHMGET $CFLAGS" ;; - MM_SHMT_BEOS ) CFLAGS="-DTEST_AREAS $CFLAGS" ;; -esac -AC_TRY_RUN( -changequote(<<, >>)dnl -<< -#include -#include -#include -#include -#include -#include -#include -#ifdef TEST_MMAP -#include -#endif -#ifdef TEST_SHMGET -#ifdef MM_OS_SUNOS -#define KERNEL 1 -#endif -#ifdef MM_OS_BS2000 -#define _KMEMUSER -#endif -#include -#include -#ifdef MM_OS_SUNOS -#undef KERNEL -#endif -#ifdef MM_OS_BS2000 -#undef _KMEMUSER -#endif -#if !defined(SHM_R) -#define SHM_R 0400 -#endif -#if !defined(SHM_W) -#define SHM_W 0200 -#endif -#endif -#if !defined(MAP_FAILED) -#define MAP_FAILED ((void *)-1) -#endif -#ifdef MM_OS_BEOS -#include -#endif - - -int testit(int size) -{ - int fd; - void *segment; -#ifdef TEST_MMAP - char file[] = "./ac_test.tmp"; - unlink(file); - if ((fd = open(file, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR)) == -1) - return 0; - if (ftruncate(fd, size) == -1) - return 0; - if ((segment = (void *)mmap(NULL, size, PROT_READ|PROT_WRITE, - MAP_SHARED, fd, 0)) == MAP_FAILED) { - close(fd); - return 0; - } - munmap((caddr_t)segment, size); - close(fd); - unlink(file); -#endif -#ifdef TEST_SHMGET - if ((fd = shmget(IPC_PRIVATE, size, SHM_R|SHM_W|IPC_CREAT)) == -1) - return 0; - if ((segment = (void *)shmat(fd, NULL, 0)) == ((void *)-1)) { - shmctl(fd, IPC_RMID, NULL); - return 0; - } - shmdt(segment); - shmctl(fd, IPC_RMID, NULL); -#endif -#ifdef TEST_BEOS - area_id id; - id = create_area("mm_test", (void*)&segment, B_ANY_ADDRESS, size, - B_LAZY_LOCK, B_READ_AREA|B_WRITE_AREA); - if (id < 0) - return 0; - delete_area(id); -#endif - return 1; -} - -#define ABS(n) ((n) >= 0 ? (n) : (-(n))) - -int main(int argc, char *argv[]) -{ - int t, m, b; - int d; - int rc; - FILE *f; - - /* - * Find maximum possible allocation size by performing a - * binary search starting with a search space between 0 and - * 64MB of memory. - */ - t = 1024*1024*64 /* = 67108864 */; - if (testit(t)) - m = t; - else { - m = 1024*1024*32; - b = 0; - for (;;) { - /* fprintf(stderr, "t=%d, m=%d, b=%d\n", t, m, b); */ - rc = testit(m); - if (rc) { - d = ((t-m)/2); - b = m; - } - else { - d = -((m-b)/2); - t = m; - } - if (ABS(d) < 1024*1) { - if (!rc) - m = b; - break; - } - if (m < 1024*8) - break; - m += d; - } - if (m < 1024*8) - m = 0; - } - if ((f = fopen("conftestval", "w")) == NULL) - exit(1); - fprintf(f, "%d\n", m); - fclose(f); - exit(0); -} ->> -changequote([, ])dnl -,[ac_cv_maxsegsize="`cat conftestval`" -], -ac_cv_maxsegsize=0 -, -ac_cv_maxsegsize=0 -) -CFLAGS="$OCFLAGS" -]) -msg="$ac_cv_maxsegsize" -if test $msg -eq 67108864; then - msg="64MB (soft limit)" -elif test $msg -gt 1048576; then - msg="`expr $msg / 1024`" - msg="`expr $msg / 1024`" - msg="${msg}MB" -elif test $msg -gt 1024; then - msg="`expr $msg / 1024`" - msg="${msg}KB" -else - ac_cv_maxsegsize=0 - msg=unknown -fi -MM_SHM_MAXSEGSIZE=$ac_cv_maxsegsize -test ".$msg" = .unknown && AC_MSG_ERROR([Unable to determine maximum shared memory segment size]) -AC_MSG_RESULT([$msg]) -AC_DEFINE_UNQUOTED(MM_SHM_MAXSEGSIZE, $MM_SHM_MAXSEGSIZE) -]) - -divert diff --git a/shmem/unix/mm/config.guess b/shmem/unix/mm/config.guess deleted file mode 100755 index fdeb6b1822d..00000000000 --- a/shmem/unix/mm/config.guess +++ /dev/null @@ -1,986 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 -# Free Software Foundation, Inc. -# -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Written by Per Bothner . -# The master version of this file is at the FSF in /home/gd/gnu/lib. -# Please send patches to the Autoconf mailing list . -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit system type (host/target name). -# -# Only a few systems have been added to this list; please add others -# (but try to keep the structure clean). -# - -# Use $HOST_CC if defined. $CC may point to a cross-compiler -if test x"$CC_FOR_BUILD" = x; then - if test x"$HOST_CC" != x; then - CC_FOR_BUILD="$HOST_CC" - else - if test x"$CC" != x; then - CC_FOR_BUILD="$CC" - else - CC_FOR_BUILD=cc - fi - fi -fi - - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - cat <$dummy.s - .globl main - .ent main -main: - .frame \$30,0,\$26,0 - .prologue 0 - .long 0x47e03d80 # implver $0 - lda \$2,259 - .long 0x47e20c21 # amask $2,$1 - srl \$1,8,\$2 - sll \$2,2,\$2 - sll \$0,3,\$0 - addl \$1,\$0,\$0 - addl \$2,\$0,\$0 - ret \$31,(\$26),1 - .end main -EOF - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy - case "$?" in - 7) - UNAME_MACHINE="alpha" - ;; - 15) - UNAME_MACHINE="alphaev5" - ;; - 14) - UNAME_MACHINE="alphaev56" - ;; - 10) - UNAME_MACHINE="alphapca56" - ;; - 16) - UNAME_MACHINE="alphaev6" - ;; - esac - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-cbm-sysv4 - exit 0;; - amiga:NetBSD:*:*) - echo m68k-cbm-netbsd${UNAME_RELEASE} - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - arc64:OpenBSD:*:*) - echo mips64el-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hkmips:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - arm32:NetBSD:*:*) - echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - SR2?01:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - atari*:NetBSD:*:*) - echo m68k-atari-netbsd${UNAME_RELEASE} - exit 0 ;; - atari*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - sun3*:NetBSD:*:*) - echo m68k-sun-netbsd${UNAME_RELEASE} - exit 0 ;; - sun3*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:NetBSD:*:*) - echo m68k-apple-netbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - macppc:NetBSD:*:*) - echo powerpc-apple-netbsd${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy \ - && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ - -o ${TARGET_BINARY_INTERFACE}x = x ] ; then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i?86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:4) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` - if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=4.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - sed 's/^ //' << EOF >$dummy.c - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` - rm -f $dummy.c $dummy - esac - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i?86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - hppa*:OpenBSD:*:*) - echo hppa-unknown-openbsd - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*X-MP:*:*:*) - echo xmp-cray-unicos - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} - exit 0 ;; - CRAY*T3E:*:*:*) - echo t3e-cray-unicosmk${UNAME_RELEASE} - exit 0 ;; - CRAY-2:*:*:*) - echo cray2-cray-unicos - exit 0 ;; - F300:UNIX_System_V:*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - F301:UNIX_System_V:*:*) - echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` - exit 0 ;; - hp3[0-9][05]:NetBSD:*:*) - echo m68k-hp-netbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*) - # echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - VERS=`echo ${UNAME_RELEASE} | sed -e 's/[-(].*//'` - MACH=`/sbin/sysctl -n hw.model` - ARCH='unknown' - case ${MACH} in - *386* ) MACH="i386" ;; - *486* ) MACH="i486" ;; - Pentium\ II*) MACH="i686" ;; - Pentium* ) MACH="i586" ;; - Alpha* ) MACH="alpha" ;; - * ) MACH="$UNAME_MACHINE" ;; - esac - case ${MACH} in - i[0-9]86 ) ARCH="pc" ;; - esac - echo "${MACH}-${ARCH}-freebsd${VERS}" - exit 0 ;; - *:NetBSD:*:*) - echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i386-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - *:Linux:*:*) - # determine canonical machine name - MACHINE="$UNAME_MACHINE" - case "$MACHINE" in - arm*|sa110*) MACHINE="arm" ;; - esac - - # determine (distribution) vendor - VENDOR="gnu" - for tagfile in dummy `cd /etc && echo *-release *_version 2>/dev/null`; do - test ! -f /etc/$tagfile && continue - VENDOR=`echo $tagfile | sed -e 's/-release$//' -e 's/_version$//' |\ - tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - done - - # determine kernel version - KERNEL=`echo ${UNAME_RELEASE} | sed -e 's/^\([0-9]*\.[0-9]*\)\..*$/\1/'` - - # determine [g]libc version - cat >$dummy.c < -#include -main(argc, argv) -int argc; -char *argv[]; -{ -#if defined(__GLIBC__) && !defined(__GLIBC_MINOR__) - printf("%d", __GLIBC__); -#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) - printf("%d.%d", __GLIBC__, __GLIBC_MINOR__); -#elif defined(__GNU_LIBRARY__) - printf("%d", __GNU_LIBRARY__); -#else - printf("1"); -#endif - return 0; -} -EOF - LIBC="1" - $CC_FOR_BUILD $dummy.c -o $dummy # 2>/dev/null - if [ $? = 0 ]; then - LIBC=`./$dummy | sed -e 's/^\([0-9]*\.[0-9]*\)\..*$/\1/'` - fi - rm -f $dummy.c $dummy - - echo "${MACHINE}-${VENDOR}-linux${KERNEL}glibc${LIBC}" - ;; -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions -# are messed up and put the nodename in both sysname and nodename. - i?86:DYNIX/ptx:4*:*) - echo i386-sequent-sysv4 - exit 0 ;; - i?86:UnixWare:*:* ) - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}uw${UNAME_VERSION} - exit 0 ;; - i?86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} - fi - exit 0 ;; - i?86:*:5:7*) - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585 - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE} - exit 0 ;; - i?86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - pc:*:*:*) - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - BS2000:POSIX-BC:*:*) - echo BS2000-siemens-sysv4 - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:*:6*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} - exit 0 ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -#if !defined (ultrix) - printf ("vax-dec-bsd\n"); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 -rm -f $dummy.c $dummy - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -#echo '(Unable to guess system type)' 1>&2 - -exit 1 diff --git a/shmem/unix/mm/config.sub b/shmem/unix/mm/config.sub deleted file mode 100755 index 89fbd90d367..00000000000 --- a/shmem/unix/mm/config.sub +++ /dev/null @@ -1,1222 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -if [ x$1 = x ] -then - echo Configuration name missing. 1>&2 - echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 - echo "or $0 ALIAS" 1>&2 - echo where ALIAS is a recognized configuration type. 1>&2 - exit 1 -fi - -# First pass through any local machine types. -case $1 in - *local*) - echo $1 - exit 0 - ;; - *) - ;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - linux-gnu*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=vxworks - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ - | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ - | 580 | i960 | h8300 \ - | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \ - | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ - | mips64orion | mips64orionel | mipstx39 | mipstx39el \ - | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ - | mips64vr5000 | miprs64vr5000el | mcore \ - | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v) - basic_machine=$basic_machine-unknown - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i[34567]86) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - # FIXME: clean up the formatting here. - vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ - | xmp-* | ymp-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ - | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \ - | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ - | clipper-* | orion-* \ - | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ - | mipstx39-* | mipstx39el-* | mcore-* \ - | f301-* | armv*-* | t3e-* \ - | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* ) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-cbm - ;; - amigaos | amigados) - basic_machine=m68k-cbm - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-cbm - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | ymp) - basic_machine=ymp-cray - os=-unicos - ;; - cray2) - basic_machine=cray2-cray - os=-unicos - ;; - [ctj]90-cray) - basic_machine=c90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - os=-mvs - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[34567]86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i[34567]86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i[34567]86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i[34567]86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - i386-go32 | go32) - basic_machine=i386-unknown - os=-go32 - ;; - i386-mingw32 | mingw32) - basic_machine=i386-unknown - os=-mingw32 - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | *MiNT) - basic_machine=m68k-atari - os=-mint - ;; - mipsel*-linux*) - basic_machine=mipsel-unknown - os=-linux-gnu - ;; - mips*-linux*) - basic_machine=mips-unknown - os=-linux-gnu - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - msdos) - basic_machine=i386-unknown - os=-msdos - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-corel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - np1) - basic_machine=np1-gould - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexen) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86) - basic_machine=i686-pc - ;; - pentiumii | pentium2) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexen-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=rs6000-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sparclite-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - s390*) - basic_machine=s390-ibm - ;; - t3e) - basic_machine=t3e-cray - os=-unicos - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xmp) - basic_machine=xmp-cray - os=-unicos - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - mips) - if [ x$os = x-linux-gnu ]; then - basic_machine=mips-unknown - else - basic_machine=mips-mips - fi - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sparc | sparcv9) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - c4x*) - basic_machine=c4x-none - os=-coff - ;; - BS2000-siemens) - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -darwin* | -openstep* | -oskit*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -ns2 ) - os=-nextstep2 - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -*MiNT) - os=-mint - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-corel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f301-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -*MiNT) - vendor=atari - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit 0 diff --git a/shmem/unix/mm/configure.in b/shmem/unix/mm/configure.in deleted file mode 100644 index cf378e17567..00000000000 --- a/shmem/unix/mm/configure.in +++ /dev/null @@ -1,226 +0,0 @@ -dnl ## -dnl ## Autoconf specification for MM library -dnl ## - -dnl # -dnl # standard Autoconf prolog -dnl # - -AC_PREREQ(2.12)dnl -AC_REVISION($1.0$)dnl - -dnl # autoconf initialization -AC_INIT(README) -AC_CONFIG_AUX_DIR(../../../build) -AC_CONFIG_HEADER(mm_conf.h) -AC_PREFIX_DEFAULT(/usr/local) - -dnl # shtool bootstrap -SHTOOL="\$(TOP)/shtool" -AC_SUBST(SHTOOL) -ac_shtool="./shtool" -T_MD=`$ac_shtool echo -n -e %B` -T_ME=`$ac_shtool echo -n -e %b` - -AC_CANONICAL_SYSTEM - -PLATFORM=$host -echo "Platform = $host" - -MM_VERSION_STR="`$ac_shtool version -l c -d long mm_vers.c`" -AC_SUBST(MM_VERSION_STR) - -dnl # friendly header ;-) -echo "Configuring ${T_MD}MM${T_ME} (Shared Memory Library), Version ${T_MD}${MM_VERSION_STR}${T_ME}" -echo "Copyright (c) 1999-2000 Ralf S. Engelschall, All Rights Reserved." -echo "Platform: ${T_MD}${PLATFORM}${T_ME}" - -dnl # determine build mode -AC_ARG_ENABLE(batch,dnl -[ --enable-batch build in batch mode (default=no)], -enable_batch="$enableval", -if test ".$enable_batch" = .; then - enable_batch=no -fi -) - -dnl # -dnl # determine build tools and parameters -dnl # - -AC_CONFIGURE_PART(Build Tools) -AC_PROG_CC -AC_PROG_CPP -#AC_CHECK_TOOL(RANLIB, ranlib, true) -AC_CHECK_DEBUGGING -AC_SET_MAKE -AC_PROG_LIBTOOL - -dnl # support for some special platform/compiler options -case "$PLATFORM:$CC" in - *-hp-hpux*:cc ) CFLAGS="$CFLAGS -Ae +DAportable" ;; -esac - -dnl # -dnl # determine system parameters -dnl # - -AC_CONFIGURE_PART(Platform Environment) - -AC_HAVE_HEADERS(stdio.h stdlib.h string.h dnl - errno.h limits.h unistd.h fcntl.h dnl - sys/stat.h sys/types.h) -AC_BEGIN_DECISION([mandatory system headers]) -AC_IFALLYES(header:stdio.h header:stdlib.h header:string.h dnl - header:errno.h header:limits.h header:unistd.h header:fcntl.h dnl - header:sys/stat.h header:sys/types.h, - AC_DECIDE(fine, [all fine])) -AC_END_DECISION - -AC_HAVE_HEADERS(memory.h) -AC_CHECK_FUNCS(memcpy memset bcopy) -AC_CHECK_DEFINE(_POSIX_PATH_MAX, limits.h) -AC_CHECK_DEFINE(PATH_MAX, limits.h) -AC_CHECK_DEFINE(MAXPATHLEN, sys/param.h) -AC_CHECK_DEFINE(_POSIX_CHILD_MAX, limits.h) -AC_CHECK_DEFINE(CHILD_MAX, limits.h) - -dnl # some special defines for brain dead platforms -case $PLATFORM in - *-*-sunos* ) AC_DEFINE(MM_OS_SUNOS) ;; - BS2000-*-* ) AC_DEFINE(MM_OS_BS2000) ;; - *-*-beos* ) AC_DEFINE(MM_OS_BEOS) ;; -esac - -dnl # -dnl # method to determine virtual memory page size -dnl # - -AC_CONFIGURE_PART(Virtual Memory Page Size) - -AC_HAVE_HEADERS(unistd.h kernel/OS.h) -AC_HAVE_FUNCS(getpagesize sysconf) -AC_CHECK_DEFINE(_SC_PAGESIZE, unistd.h) -AC_CHECK_DEFINE(B_PAGE_SIZE, kernel/OS.h) - -AC_BEGIN_DECISION([memory page size determination]) -AC_IFALLYES(header:unistd.h func:getpagesize, - AC_DECIDE(MM_VMPS_GETPAGESIZE, [4.2BSD getpagesize()])) -AC_IFALLYES(header:unistd.h func:sysconf define:_SC_PAGESIZE, - AC_DECIDE(MM_VMPS_SYSCONF, [POSIX.1 sysconf(_SC_PAGESIZE)])) -AC_IFALLYES(header:kernel/OS.h define:B_PAGE_SIZE, - AC_DECIDE(MM_VMPS_BEOS, [BeOS B_PAGE_SIZE])) -AC_END_DECISION -AC_DEFINE_UNQUOTED($ac_decision) - -dnl # -dnl # Shared Memory -dnl # - -AC_CONFIGURE_PART(Shared Memory Implementation) - -AC_HAVE_HEADERS(sys/mman.h) -AC_CHECK_DEFINE(MAP_ANON, sys/mman.h) -AC_HAVE_FUNCS(mmap munmap shm_open shm_unlink) -AC_TEST_FILE(/dev/zero) -AC_HAVE_HEADERS(sys/ipc.h sys/shm.h sys/file.h) -AC_HAVE_FUNCS(shmget shmat shmdt shmctl) -AC_HAVE_HEADERS(kernel/OS.h) -AC_HAVE_FUNCS(create_area) - -AC_BEGIN_DECISION([shared memory allocation method]) -AC_IFALLYES(header:sys/mman.h func:mmap func:munmap, - AC_DECIDE(MM_SHMT_MMFILE, [Classical mmap() on temporary file])) -AC_IFALLYES(header:sys/mman.h func:mmap func:munmap func:shm_open func:shm_unlink, - AC_DECIDE(MM_SHMT_MMPOSX, [mmap() via POSIX.1 shm_open() on temporary file])) -AC_IFALLYES(header:sys/mman.h func:mmap func:munmap file:/dev/zero, - AC_DECIDE(MM_SHMT_MMZERO, [SVR4-style mmap() on /dev/zero])) -AC_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl - func:shmget func:shmat func:shmdt func:shmctl, - AC_DECIDE(MM_SHMT_IPCSHM, [SysV IPC shmget()])) -AC_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON, - AC_DECIDE(MM_SHMT_MMANON, [4.4BSD-style mmap() via MAP_ANON])) -AC_IFALLYES(header:kernel/OS.h func:create_area, - AC_DECIDE(MM_SHMT_BEOS, [BeOS areas])) -case $PLATFORM in - *-*-linux* ) - # Linux has problems with MM_SHMT_MMANON - AC_DECISION_OVERRIDE(MM_SHMT_MMANON MM_SHMT_MMFILE MM_SHMT_MMZERO dnl - MM_SHMT_MMPOSX MM_SHMT_IPCSHM) - ;; -esac -AC_ARG_WITH(shm,dnl -[ --with-shm=TYPE force shared memory type: MMFILE MMZERO MMPOSX MMANON IPCSHM BEOS], -AC_DECISION_FORCE(MM_SHMT_$withval) -) -AC_END_DECISION -AC_DEFINE_UNQUOTED($ac_decision) - -AC_CHECK_MAXSEGSIZE($ac_decision) - -dnl # -dnl # Mutex -dnl # - -AC_CONFIGURE_PART(Mutual Exclusion Implementation) - -AC_HAVE_HEADERS(sys/ipc.h sys/sem.h sys/file.h) -AC_HAVE_FUNCS(semget semctl) -AC_CHECK_DEFINE(LOCK_EX, sys/file.h) -AC_CHECK_DEFINE(F_SETLK, fcntl.h) -AC_CHECK_DEFINE(IPC_PRIVATE, sys/ipc.h) -AC_CHECK_DEFINE(SEM_UNDO, sys/sem.h) -AC_HAVE_HEADERS(kernel/OS.h) -AC_CHECK_FUNCS(create_sem) - -AC_MSG_CHECKING(whether union semun is defined in sys/sem.h) -AC_TRY_COMPILE([ -#include -#include -#include -],[ -union semun arg; -semctl(0, 0, 0, arg); -], -AC_DEFINE(HAVE_UNION_SEMUN) -msg=yes,dnl -msg=no) -AC_MSG_RESULT([$msg]) - -AC_BEGIN_DECISION([mutex implementation method]) -AC_IFALLYES(header:sys/file.h define:LOCK_EX, - AC_DECIDE(MM_SEMT_FLOCK, [4.2BSD-style flock() on temporary file])) -AC_IFALLYES(header:sys/ipc.h header:sys/sem.h header:sys/file.h dnl - func:semget func:semctl, - AC_DECIDE(MM_SEMT_IPCSEM, [SysV IPC semget()])) -AC_IFALLYES(header:fcntl.h define:F_SETLK, - AC_DECIDE(MM_SEMT_FCNTL, [SVR4-style fcntl() on temporary file])) -AC_IFALLYES(header:kernel/OS.h func:create_sem, - AC_DECIDE(MM_SEMT_BEOS, [BeOS semaphores])) -AC_ARG_WITH(sem,dnl -[ --with-sem=TYPE force semaphore type: FLOCK FCNTL IPCSEM BEOS], -AC_DECISION_FORCE(MM_SEMT_$withval) -) -AC_END_DECISION -AC_DEFINE_UNQUOTED($ac_decision) - -dnl # -dnl # finally: source file substitution... -dnl # - -AC_CONFIGURE_PART(Output Substitution) - -AC_OUTPUT(dnl -Makefile dnl -mm-config dnl -,dnl -chmod a+x mm-config -) - -if test ".$enable_batch" != .yes; then - echo "" - echo "Now please type \`${T_MD}make${T_ME}' to compile. Good luck." - echo "" -fi - -dnl ##EOF## diff --git a/shmem/unix/mm/fbtool b/shmem/unix/mm/fbtool deleted file mode 100755 index ead314880b5..00000000000 --- a/shmem/unix/mm/fbtool +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -## -## fbtool -- MM library feedback tool -## Copyright (c) 1999-2000 Ralf S. Engelschall, All Rights Reserved. -## - -if [ ! -f .fbtool ]; then - echo "fbtool:Error: still no results known"; - exit 1 -fi -result=`cat .fbtool` - -VERSION=`./shtool version -l c -d long mm_vers.c` - -PLATFORM=`/bin/sh ./config.guess` -PLATFORM=`/bin/sh ./config.sub $PLATFORM` - -VMPS=`grep MM_VMPS_ mm_conf.h | grep define | sed -e 's;.*MM_;MM_;' -e 's; .*;;'`; \ -SHMT=`grep MM_SHMT_ mm_conf.h | grep define | sed -e 's;.*MM_;MM_;' -e 's; .*;;'`; \ -SEMT=`grep MM_SEMT_ mm_conf.h | grep define | sed -e 's;.*MM_;MM_;' -e 's; .*;;'`; \ -SEGS=`grep MM_SHM_MAXSEGSIZE mm_conf.h | grep define | sed -e 's;.*SIZE *;;' -e 's; .*;;'`; \ - -TMP=".fbsummary" -rm -f $TMP >/dev/null 2>&1 -touch $TMP -echo "+-MM-Library-Test-Suite-Summary---------------------------" >>$TMP -echo "| Library Version : MM $VERSION" >>$TMP -echo "| Platform : $PLATFORM" >>$TMP -echo "| Memory Page Size Type : $VMPS" >>$TMP -echo "| Shared Memory Type : $SHMT" >>$TMP -echo "| Semaphore Type : $SEMT" >>$TMP -echo "| Maximum Segment Size : $SEGS" >>$TMP -echo "| Test Suite : $result" >>$TMP -echo "+---------------------------------------------------------" >>$TMP - -case $1 in - -d ) cat $TMP ;; - -s ) ;; -esac - -rm -f $TMP >/dev/null 2>&1 - diff --git a/shmem/unix/mm/ltconfig b/shmem/unix/mm/ltconfig deleted file mode 100755 index a01334f9212..00000000000 --- a/shmem/unix/mm/ltconfig +++ /dev/null @@ -1,3078 +0,0 @@ -#! /bin/sh - -# ltconfig - Create a system-specific libtool. -# Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A lot of this script is taken from autoconf-2.10. - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} -echo=echo -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec "$SHELL" "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null`} - case X$UNAME in - *-DOS) PATH_SEPARATOR=';' ;; - *) PATH_SEPARATOR=':' ;; - esac -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || - test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH /usr/ucb; do - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running ltconfig again with it. - ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf "%s\n"' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - # Cool, printf works - : - elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && - test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && - test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# The name of this program. -progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` - -# Constants: -PROGRAM=ltconfig -PACKAGE=libtool -VERSION=1.3.4 -TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)" -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -rm="rm -f" - -help="Try \`$progname --help' for more information." - -# Global variables: -default_ofile=libtool -can_build_shared=yes -enable_shared=yes -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -enable_static=yes -enable_fast_install=yes -enable_dlopen=unknown -enable_win32_dll=no -ltmain= -silent= -srcdir= -ac_config_guess= -ac_config_sub= -host= -nonopt= -ofile="$default_ofile" -verify_host=yes -with_gcc=no -with_gnu_ld=no -need_locks=yes -ac_ext=c -objext=o -libext=a -exeext= -cache_file= - -old_AR="$AR" -old_CC="$CC" -old_CFLAGS="$CFLAGS" -old_CPPFLAGS="$CPPFLAGS" -old_LDFLAGS="$LDFLAGS" -old_LD="$LD" -old_LN_S="$LN_S" -old_LIBS="$LIBS" -old_NM="$NM" -old_RANLIB="$RANLIB" -old_DLLTOOL="$DLLTOOL" -old_OBJDUMP="$OBJDUMP" -old_AS="$AS" - -# Parse the command line options. -args= -prev= -for option -do - case "$option" in - -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - eval "$prev=\$option" - prev= - continue - fi - - case "$option" in - --help) cat <&2 - echo "$help" 1>&2 - exit 1 - ;; - - *) - if test -z "$ltmain"; then - ltmain="$option" - elif test -z "$host"; then -# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 -# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then -# echo "$progname: warning \`$option' is not a valid host type" 1>&2 -# fi - host="$option" - else - echo "$progname: too many arguments" 1>&2 - echo "$help" 1>&2 - exit 1 - fi ;; - esac -done - -if test -z "$ltmain"; then - echo "$progname: you must specify a LTMAIN file" 1>&2 - echo "$help" 1>&2 - exit 1 -fi - -if test ! -f "$ltmain"; then - echo "$progname: \`$ltmain' does not exist" 1>&2 - echo "$help" 1>&2 - exit 1 -fi - -# Quote any args containing shell metacharacters. -ltconfig_args= -for arg -do - case "$arg" in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ltconfig_args="$ltconfig_args '$arg'" ;; - *) ltconfig_args="$ltconfig_args $arg" ;; - esac -done - -# A relevant subset of AC_INIT. - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 5 compiler messages saved in config.log -# 6 checking for... messages and results -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>>./config.log - -# NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi -if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi - -if test -n "$cache_file" && test -r "$cache_file"; then - echo "loading cache $cache_file within ltconfig" - . $cache_file -fi - -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - -if test -z "$srcdir"; then - # Assume the source directory is the same one as the path to LTMAIN. - srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` - test "$srcdir" = "$ltmain" && srcdir=. -fi - -trap "$rm conftest*; exit 1" 1 2 15 -if test "$verify_host" = yes; then - # Check for config.guess and config.sub. - ac_aux_dir= - for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/config.guess; then - ac_aux_dir=$ac_dir - break - fi - done - if test -z "$ac_aux_dir"; then - echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 - echo "$help" 1>&2 - exit 1 - fi - ac_config_guess=$ac_aux_dir/config.guess - ac_config_sub=$ac_aux_dir/config.sub - - # Make sure we can run config.sub. - if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : - else - echo "$progname: cannot run $ac_config_sub" 1>&2 - echo "$help" 1>&2 - exit 1 - fi - - echo $ac_n "checking host system type""... $ac_c" 1>&6 - - host_alias=$host - case "$host_alias" in - "") - if host_alias=`$SHELL $ac_config_guess`; then : - else - echo "$progname: cannot guess host type; you must specify one" 1>&2 - echo "$help" 1>&2 - exit 1 - fi ;; - esac - host=`$SHELL $ac_config_sub $host_alias` - echo "$ac_t$host" 1>&6 - - # Make sure the host verified. - test -z "$host" && exit 1 - -elif test -z "$host"; then - echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 - echo "$help" 1>&2 - exit 1 -else - host_alias=$host -fi - -# Transform linux* to *-*-linux-gnu*, to support old configure scripts. -case "$host_os" in -linux-gnu*) ;; -linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` -esac - -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - -case "$host_os" in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR cru $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -# Set a sane default for `AR'. -test -z "$AR" && AR=ar - -# Set a sane default for `OBJDUMP'. -test -z "$OBJDUMP" && OBJDUMP=objdump - -# If RANLIB is not set, then run the test. -if test "${RANLIB+set}" != "set"; then - result=no - - echo $ac_n "checking for ranlib... $ac_c" 1>&6 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then - RANLIB="ranlib" - result="ranlib" - break - fi - done - IFS="$save_ifs" - - echo "$ac_t$result" 1>&6 -fi - -if test -n "$RANLIB"; then - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" -fi - -# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$AS" && AS=as - -# Check to see if we are using GCC. -if test "$with_gcc" != yes || test -z "$CC"; then - # If CC is not set, then try to find GCC or a usable CC. - if test -z "$CC"; then - echo $ac_n "checking for gcc... $ac_c" 1>&6 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then - CC="gcc" - break - fi - done - IFS="$save_ifs" - - if test -n "$CC"; then - echo "$ac_t$CC" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - fi - - # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". - if test -z "$CC"; then - echo $ac_n "checking for cc... $ac_c" 1>&6 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - cc_rejected=no - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/cc || test -f $dir/cc$ac_exeext; then - if test "$dir/cc" = "/usr/ucb/cc"; then - cc_rejected=yes - continue - fi - CC="cc" - break - fi - done - IFS="$save_ifs" - if test $cc_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same name, so the bogon will be chosen - # first if we set CC to just the name; use the full file name. - shift - set dummy "$dir/cc" "$@" - shift - CC="$@" - fi - fi - - if test -n "$CC"; then - echo "$ac_t$CC" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - - if test -z "$CC"; then - echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 - exit 1 - fi - fi - - # Now see if the compiler is really GCC. - with_gcc=no - echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 - echo "$progname:581: checking whether we are using GNU C" >&5 - - $rm conftest.c - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - with_gcc=yes - fi - $rm conftest.c - echo "$ac_t$with_gcc" 1>&6 -fi - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler="$2" - -echo $ac_n "checking for object suffix... $ac_c" 1>&6 -$rm conftest* -echo 'int i = 1;' > conftest.c -echo "$progname:603: checking for object suffix" >& 5 -if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - for ac_file in conftest.*; do - case $ac_file in - *.c) ;; - *) objext=`echo $ac_file | sed -e s/conftest.//` ;; - esac - done -else - cat conftest.err 1>&5 - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 -fi -$rm conftest* -echo "$ac_t$objext" 1>&6 - -echo $ac_n "checking for executable suffix... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_cv_exeext="no" - $rm conftest* - echo 'main () { return 0; }' > conftest.c - echo "$progname:629: checking for executable suffix" >& 5 - if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - for ac_file in conftest.*; do - case $ac_file in - *.c | *.err | *.$objext ) ;; - *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; - esac - done - else - cat conftest.err 1>&5 - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 - fi - $rm conftest* -fi -if test "X$ac_cv_exeext" = Xno; then - exeext="" -else - exeext="$ac_cv_exeext" -fi -echo "$ac_t$ac_cv_exeext" 1>&6 - -echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 -pic_flag= -special_shlib_compile_flags= -wl= -link_static_flag= -no_builtin_flag= - -if test "$with_gcc" = yes; then - wl='-Wl,' - link_static_flag='-static' - - case "$host_os" in - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - aix*) - # Below there is a dirty hack to force normal static linking with -ldl - # The problem is because libdl dynamically linked with both libc and - # libC (AIX C++ library), which obviously doesn't included in libraries - # list by gcc. This cause undefined symbols with -static flags. - # This hack allows C programs to be linked with "-static -ldl", but - # we not sure about C++ programs. - link_static_flag="$link_static_flag ${wl}-lC" - ;; - cygwin* | mingw* | os2*) - # We can build DLLs from non-PIC. - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - pic_flag='-m68020 -resident32 -malways-restore-a4' - ;; - sysv4*MP*) - if test -d /usr/nec; then - pic_flag=-Kconform_pic - fi - ;; - *) - pic_flag='-fPIC' - ;; - esac -else - # PORTME Check for PIC flags for the system compiler. - case "$host_os" in - aix3* | aix4*) - # All AIX code is PIC. - link_static_flag='-bnso -bI:/lib/syscalls.exp' - ;; - - hpux9* | hpux10* | hpux11*) - # Is there a better link_static_flag that works with the bundled CC? - wl='-Wl,' - link_static_flag="${wl}-a ${wl}archive" - pic_flag='+Z' - ;; - - irix5* | irix6*) - wl='-Wl,' - link_static_flag='-non_shared' - # PIC (with -KPIC) is the default. - ;; - - cygwin* | mingw* | os2*) - # We can build DLLs from non-PIC. - ;; - - osf3* | osf4* | osf5*) - # All OSF/1 code is PIC. - wl='-Wl,' - link_static_flag='-non_shared' - ;; - - sco3.2v5*) - pic_flag='-Kpic' - link_static_flag='-dn' - special_shlib_compile_flags='-belf' - ;; - - solaris*) - pic_flag='-KPIC' - link_static_flag='-Bstatic' - wl='-Wl,' - ;; - - sunos4*) - pic_flag='-PIC' - link_static_flag='-Bstatic' - wl='-Qoption ld ' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - pic_flag='-KPIC' - link_static_flag='-Bstatic' - wl='-Wl,' - ;; - - uts4*) - pic_flag='-pic' - link_static_flag='-Bstatic' - ;; - sysv4*MP*) - if test -d /usr/nec ;then - pic_flag='-Kconform_pic' - link_static_flag='-Bstatic' - fi - ;; - *) - can_build_shared=no - ;; - esac -fi - -if test -n "$pic_flag"; then - echo "$ac_t$pic_flag" 1>&6 - - # Check to make sure the pic_flag actually works. - echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $pic_flag -DPIC" - echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 - if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - case "$host_os" in - hpux9* | hpux10* | hpux11*) - # On HP-UX, both CC and GCC only warn that PIC is supported... then they - # create non-PIC objects. So, if there were any warnings, we assume that - # PIC is not supported. - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - can_build_shared=no - pic_flag= - else - echo "$ac_t"yes 1>&6 - pic_flag=" $pic_flag" - fi - ;; - *) - echo "$ac_t"yes 1>&6 - pic_flag=" $pic_flag" - ;; - esac - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - can_build_shared=no - pic_flag= - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* -else - echo "$ac_t"none 1>&6 -fi - -# Check to see if options -o and -c are simultaneously supported by compiler -echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 -$rm -r conftest 2>/dev/null -mkdir conftest -cd conftest -$rm conftest* -echo "int some_variable = 0;" > conftest.c -mkdir out -# According to Tom Tromey, Ian Lance Taylor reported there are C compilers -# that will create temporary files in the current directory regardless of -# the output directory. Thus, making CWD read-only will cause this test -# to fail, enabling locking or at least warning the user not to do parallel -# builds. -chmod -w . -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -o out/conftest2.o" -echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 -if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s out/conftest.err; then - echo "$ac_t"no 1>&6 - compiler_c_o=no - else - echo "$ac_t"yes 1>&6 - compiler_c_o=yes - fi -else - # Append any errors to the config.log. - cat out/conftest.err 1>&5 - compiler_c_o=no - echo "$ac_t"no 1>&6 -fi -CFLAGS="$save_CFLAGS" -chmod u+w . -$rm conftest* out/* -rmdir out -cd .. -rmdir conftest -$rm -r conftest 2>/dev/null - -if test x"$compiler_c_o" = x"yes"; then - # Check to see if we can write to a .lo - echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -c -o conftest.lo" - echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 -if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - compiler_o_lo=no - else - echo "$ac_t"yes 1>&6 - compiler_o_lo=yes - fi - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - compiler_o_lo=no - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* -else - compiler_o_lo=no -fi - -# Check to see if we can do hard links to lock some files if needed -hard_links="nottested" -if test "$compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$ac_t$hard_links" 1>&6 - $rm conftest* - if test "$hard_links" = no; then - echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 - need_locks=warn - fi -else - need_locks=no -fi - -if test "$with_gcc" = yes; then - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler - echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" - echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 - if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - compiler_rtti_exceptions=no - else - echo "$ac_t"yes 1>&6 - compiler_rtti_exceptions=yes - fi - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - compiler_rtti_exceptions=no - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* - - if test "$compiler_rtti_exceptions" = "yes"; then - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' - else - no_builtin_flag=' -fno-builtin' - fi - -fi - -# Check for any special shared library compilation flags. -if test -n "$special_shlib_compile_flags"; then - echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 - if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : - else - echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 - can_build_shared=no - fi -fi - -echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 -$rm conftest* -echo 'main(){return(0);}' > conftest.c -save_LDFLAGS="$LDFLAGS" -LDFLAGS="$LDFLAGS $link_static_flag" -echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 -if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - echo "$ac_t$link_static_flag" 1>&6 -else - echo "$ac_t"none 1>&6 - link_static_flag= -fi -LDFLAGS="$save_LDFLAGS" -$rm conftest* - -if test -z "$LN_S"; then - # Check to see if we can use ln -s, or we need hard links. - echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 - $rm conftest.dat - if ln -s X conftest.dat 2>/dev/null; then - $rm conftest.dat - LN_S="ln -s" - else - LN_S=ln - fi - if test "$LN_S" = "ln -s"; then - echo "$ac_t"yes 1>&6 - else - echo "$ac_t"no 1>&6 - fi -fi - -# Make sure LD is an absolute path. -if test -z "$LD"; then - ac_prog=ld - if test "$with_gcc" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 - echo "$progname:991: checking for ld used by GCC" >&5 - ac_prog=`($CC -print-prog-name=ld) 2>&5` - case "$ac_prog" in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we are not using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac - elif test "$with_gnu_ld" = yes; then - echo $ac_n "checking for GNU ld... $ac_c" 1>&6 - echo "$progname:1015: checking for GNU ld" >&5 - else - echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 - echo "$progname:1018: checking for non-GNU ld" >&5 - fi - - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" - fi - - if test -n "$LD"; then - echo "$ac_t$LD" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - - if test -z "$LD"; then - echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 - exit 1 - fi -fi - -# Check to see if it really is or is not GNU ld. -echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 -# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - with_gnu_ld=yes -else - with_gnu_ld=no -fi -echo "$ac_t$with_gnu_ld" 1>&6 - -# See if the linker supports building shared libraries. -echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 - -allow_undefined_flag= -no_undefined_flag= -need_lib_prefix=unknown -need_version=unknown -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -archive_cmds= -archive_expsym_cmds= -old_archive_from_new_cmds= -export_dynamic_flag_spec= -whole_archive_flag_spec= -thread_safe_flag_spec= -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no -hardcode_shlibpath_var=unsupported -runpath_var= -always_export_symbols=no -export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' -# include_expsyms should be a list of space-separated symbols to be *always* -# included in the symbol list -include_expsyms= -# exclude_expsyms can be an egrep regular expression of symbols to exclude -# it will be wrapped by ` (' and `)$', so one must not match beginning or -# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -# as well as any symbol that contains `d'. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_" -# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -# platforms (ab)use it in PIC code, but their linkers get confused if -# the symbol is explicitly referenced. Since portable code cannot -# rely on this symbol name, it's probably fine to never include it in -# preloaded symbol tables. - -case "$host_os" in -cygwin* | mingw*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$with_gcc" != yes; then - with_gnu_ld=no - fi - ;; - -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case "$host_os" in - aix3* | aix4*) - # On AIX, the GNU linker is very broken - ld_shlibs=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - ;; - - amigaos*) - archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can use - # them. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=yes - - # Extract the symbol export list from an `--export-all' def file, - # then regenerate the def file from the symbol export list, so that - # the compiled dll only exports the symbol export list. - export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ - test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ - $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols' - - archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ - _lt_hint=1; - for symbol in `cat $export_symbols`; do - echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; - _lt_hint=`expr 1 + \$_lt_hint`; - done~ - test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ - test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ - $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ - $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ - $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' - - old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' - # can we support soname and/or expsyms with a.out? -oliva - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - case $host_os in - cygwin* | mingw*) - # dlltool doesn't understand --whole-archive et. al. - whole_archive_flag_spec= - ;; - *) - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - ;; - esac - fi -else - # PORTME fill in a description of your system's linker (not GNU ld) - case "$host_os" in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$with_gcc" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4*) - hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' - hardcode_libdir_separator=':' - if test "$with_gcc" = yes; then - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - shared_flag='-shared' - else - shared_flag='${wl}-bM:SRE' - hardcode_direct=yes - fi - allow_undefined_flag=' ${wl}-berok' - archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' - archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' - case "$host_os" in aix4.[01]|aix4.[01].*) - # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on - always_export_symbols=yes ;; - esac - ;; - - amigaos*) - archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - cygwin* | mingw*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs' - fix_srcfile_path='`cygpath -w $srcfile`' - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9* | hpux10* | hpux11*) - case "$host_os" in - hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; - *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; - esac - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - export_dynamic_flag_spec='${wl}-E' - ;; - - irix5* | irix6*) - if test "$with_gcc" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF - fi - hardcode_libdir_flag_spec='${wl}-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - openbsd*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' - ;; - - osf3*) - if test "$with_gcc" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # As osf3* with the addition of the -msym flag - if test "$with_gcc" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case "$host_os" in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv5*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' - hardcode_libdir_flag_spec= - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - unixware7*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac -fi -echo "$ac_t$ld_shlibs" 1>&6 -test "$ld_shlibs" = no && can_build_shared=no - -if test -z "$NM"; then - echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 - case "$NM" in - [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - NM="$ac_dir/nm -B" - break - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - NM="$ac_dir/nm -p" - break - else - NM=${NM="$ac_dir/nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$NM" && NM=nm - ;; - esac - echo "$ac_t$NM" 1>&6 -fi - -# Check for command to grab the raw symbol name followed by C symbol from nm. -echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Define system-specific variables. -case "$host_os" in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" - ;; -irix*) - symcode='[BCDEGRST]' - ;; -solaris*) - symcode='[BDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - symcode='[ABCDGISTW]' -fi - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. - global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - $rm conftest* - cat > conftest.c <&5 - if { (eval echo $progname:1636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then - # Now try to grab the symbols. - nlist=conftest.nm - if { echo "$progname:1639: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then - - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$nlist" >/dev/null; then - if egrep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.c -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' - - cat <> conftest.c -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c - cat <<\EOF >> conftest.c - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$objext conftstm.$objext - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="conftstm.$objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo $progname:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - pipe_works=yes - else - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 - fi - LIBS="$save_LIBS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 - fi - $rm conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - global_symbol_pipe= - fi -done -if test "$pipe_works" = yes; then - echo "${ac_t}ok" 1>&6 -else - echo "${ac_t}failed" 1>&6 -fi - -if test -z "$global_symbol_pipe"; then - global_symbol_to_cdecl= -fi - -# Check hardcoding attributes. -echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var"; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$hardcode_shlibpath_var" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -echo "$ac_t$hardcode_action" 1>&6 - - -reload_flag= -reload_cmds='$LD$reload_flag -o $output$reload_objs' -echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 -# PORTME Some linkers may need a different reload flag. -reload_flag='-r' -echo "$ac_t$reload_flag" 1>&6 -test -n "$reload_flag" && reload_flag=" $reload_flag" - -# PORTME Fill in your ld.so characteristics -library_names_spec= -libname_spec='lib$name' -soname_spec= -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -file_magic_cmd= -file_magic_test_file= -deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [regex]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given egrep regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. -echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 -case "$host_os" in -aix3*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}.so$major' - ;; - -aix4*) - version_type=linux - # AIX has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - # We preserve .a as extension for shared libraries though AIX4.2 - # and later linker supports .so - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' - shlibpath_var=LIBPATH - deplibs_check_method=pass_all - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}.so' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - deplibs_check_method=pass_all - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - file_magic_cmd=/usr/bin/file - file_magic_test_file=/shlib/libc.so - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - export_dynamic_flag_spec=-rdynamic - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw*) - version_type=windows - need_version=no - need_lib_prefix=no - if test "$with_gcc" = yes; then - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' - else - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' - fi - dynamic_linker='Win32 ld.exe' - deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - file_magic_cmd='${OBJDUMP} -f' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case "$version_type" in - freebsd-elf*) - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /usr/lib/libc.so*` - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - deplibs_check_method=unknown - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case "$host_os" in - freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - dynamic_linker="$host_os dld.sl" - version_type=sunos - need_lib_prefix=no - need_version=no - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6*) - version_type=irix - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}.so.$major' - library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so' - case "$host_os" in - irix5*) - libsuff= shlibsuff= - # this will be overridden with pass_all, but let us keep it just in case - deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" - ;; - *) - case "$LD" in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib${libsuff}/libc.so*` - deplibs_check_method='pass_all' - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux-gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` - - if test -f /lib/ld.so.1; then - dynamic_linker='GNU ld.so' - else - # Only the GNU ld.so supports shared libraries on MkLinux. - case "$host_cpu" in - powerpc*) dynamic_linker=no ;; - *) dynamic_linker='Linux ld.so' ;; - esac - fi - ;; - -netbsd*) - version_type=sunos - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' - soname_spec='${libname}${release}.so$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - ;; - -openbsd*) - version_type=sunos - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - need_version=no - fi - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - ;; - -os2*) - libname_spec='$name' - need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH - # this will be overridden with pass_all, but let us keep it just in case - deplibs_check_method='file_magic COFF format alpha shared library' - file_magic_cmd=/usr/bin/file - file_magic_test_file=/shlib/libc.so - deplibs_check_method='pass_all' - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" - file_magic_cmd=/usr/bin/file - file_magic_test_file=/lib/libc.so - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - case "$host_vendor" in - ncr) - deplibs_check_method='pass_all' - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - esac - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' - soname_spec='$libname.so.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -*) - dynamic_linker=no - ;; -esac -echo "$ac_t$dynamic_linker" 1>&6 -test "$dynamic_linker" = no && can_build_shared=no - -# Report the final consequences. -echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 - -# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in -# configure.in, otherwise build static only libraries. -case "$host_os" in -cygwin* | mingw* | os2*) - if test x$can_build_shared = xyes; then - test x$enable_win32_dll = xno && can_build_shared=no - echo "checking if package supports dlls... $can_build_shared" 1>&6 - fi -;; -esac - -if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then - case "$deplibs_check_method" in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac -fi - -echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4*) - test "$enable_shared" = yes && enable_static=no - ;; -esac - -echo "$ac_t$enable_shared" 1>&6 - -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes - -echo "checking whether to build static libraries... $enable_static" 1>&6 - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -echo $ac_n "checking for objdir... $ac_c" 1>&6 -rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - objdir=_libs -fi -rmdir .libs 2>/dev/null -echo "$ac_t$objdir" 1>&6 - -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else -if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then - lt_cv_dlopen=no lt_cv_dlopen_libs= -echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "$progname:2212: checking for dlopen in -ldl" >&5 -ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldl $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "$progname:2252: checking for dlopen" >&5 -if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -dlopen(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_dlopen=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_dlopen=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -echo "$progname:2299: checking for dld_link in -ldld" >&5 -ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldld $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "$progname:2339: checking for shl_load" >&5 -if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -shl_load(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_shl_load=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_shl_load=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="shl_load" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "$progname:2387: checking for shl_load in -ldld" >&5 -ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldld $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - echo "$ac_t""no" 1>&6 -fi - - -fi - - -fi - - -fi - - -fi - -fi - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - fi - - case "$lt_cv_dlopen" in - dlopen) -for ac_hdr in dlfcn.h; do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "$progname:2452: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -int fnord = 0; -EOF -ac_try="$ac_compile >/dev/null 2>conftest.out" -{ (eval echo $progname:2462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi -done - - if test "x$ac_cv_header_dlfcn_h" = xyes; then - CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - fi - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - LIBS="$lt_cv_dlopen_libs $LIBS" - - echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2490: checking whether a program can dlopen itself" >&5 -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - lt_cv_dlopen_self=cross - else - cat > conftest.c < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LTDL_GLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LTDL_GLOBAL DL_GLOBAL -# else -# define LTDL_GLOBAL 0 -# endif -#endif - -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LTDL_LAZY_OR_NOW -# ifdef RTLD_LAZY -# define LTDL_LAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LTDL_LAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LTDL_LAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LTDL_LAZY_OR_NOW DL_NOW -# else -# define LTDL_LAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -fnord() { int i=42;} -main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } - -EOF -if { (eval echo $progname:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - lt_cv_dlopen_self=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - lt_cv_dlopen_self=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$lt_cv_dlopen_self" 1>&6 - - if test "$lt_cv_dlopen_self" = yes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2563: checking whether a statically linked program can dlopen itself" >&5 -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - lt_cv_dlopen_self_static=cross - else - cat > conftest.c < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LTDL_GLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LTDL_GLOBAL DL_GLOBAL -# else -# define LTDL_GLOBAL 0 -# endif -#endif - -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LTDL_LAZY_OR_NOW -# ifdef RTLD_LAZY -# define LTDL_LAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LTDL_LAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LTDL_LAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LTDL_LAZY_OR_NOW DL_NOW -# else -# define LTDL_LAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -fnord() { int i=42;} -main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } - -EOF -if { (eval echo $progname:2617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - lt_cv_dlopen_self_static=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - lt_cv_dlopen_self_static=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 -fi - ;; - esac - - case "$lt_cv_dlopen_self" in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case "$lt_cv_dlopen_self_static" in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - -# Copy echo and quote the copy, instead of the original, because it is -# used later. -ltecho="$echo" -if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ltecho="$CONFIG_SHELL \$0 --fallback-echo" -fi -LTSHELL="$SHELL" - -LTCONFIG_VERSION="$VERSION" - -# Only quote variables if we're using ltmain.sh. -case "$ltmain" in -*.sh) - # Now quote all the things that may contain metacharacters. - for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ - old_LD old_LDFLAGS old_LIBS \ - old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ - AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ - reload_flag reload_cmds wl \ - pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ - thread_safe_flag_spec whole_archive_flag_spec libname_spec \ - library_names_spec soname_spec \ - RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ - old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ - file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ - finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ - hardcode_libdir_flag_spec hardcode_libdir_separator \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do - - case "$var" in - reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case "$ltecho" in - *'\$0 --fallback-echo"') - ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - - trap "$rm \"$ofile\"; exit 1" 1 2 15 - echo "creating $ofile" - $rm "$ofile" - cat < "$ofile" -#! $SHELL - -# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. -# -# Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="sed -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -### BEGIN LIBTOOL CONFIG -EOF - cfgfile="$ofile" - ;; - -*) - # Double-quote the variables that need it (for aesthetics). - for var in old_CC old_CFLAGS old_CPPFLAGS \ - old_LD old_LDFLAGS old_LIBS \ - old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do - eval "$var=\\\"\$var\\\"" - done - - # Just create a config file. - cfgfile="$ofile.cfg" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - echo "creating $cfgfile" - $rm "$cfgfile" - cat < "$cfgfile" -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -EOF - ;; -esac - -cat <> "$cfgfile" -# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ -# LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ -# NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ -# DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ -# $0$ltconfig_args -# -# Compiler and other test output produced by $progname, useful for -# debugging $progname, is in ./config.log if it exists. - -# The version of $progname that generated this script. -LTCONFIG_VERSION=$LTCONFIG_VERSION - -# Shell to use when invoking shell scripts. -SHELL=$LTSHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$ltecho - -# The archiver. -AR=$AR - -# The default C compiler. -CC=$CC - -# The linker used to build libraries. -LD=$LD - -# Whether we need hard or soft links. -LN_S=$LN_S - -# A BSD-compatible nm program. -NM=$NM - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$reload_flag -reload_cmds=$reload_cmds - -# How to pass a linker flag through the compiler. -wl=$wl - -# Object file suffix (normally "o"). -objext="$objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$pic_flag - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$compiler_c_o - -# Can we write directly to a .lo ? -compiler_o_lo=$compiler_o_lo - -# Must we lock files when doing compilation ? -need_locks=$need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$link_static_flag - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$whole_archive_flag_spec - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$RANLIB -old_archive_cmds=$old_archive_cmds -old_postinstall_cmds=$old_postinstall_cmds -old_postuninstall_cmds=$old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$old_archive_from_new_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$archive_cmds -archive_expsym_cmds=$archive_expsym_cmds -postinstall_cmds=$postinstall_cmds -postuninstall_cmds=$postuninstall_cmds - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$global_symbol_to_cdecl - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$hardcode_libdir_separator - -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$include_expsyms - -EOF - -case "$ltmain" in -*.sh) - echo '### END LIBTOOL CONFIG' >> "$ofile" - echo >> "$ofile" - case "$host_os" in - aix3*) - cat <<\EOF >> "$ofile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # Append the ltmain.sh script. - sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - - chmod +x "$ofile" - ;; - -*) - # Compile the libtool program. - echo "FIXME: would compile $ltmain" - ;; -esac - -test -n "$cache_file" || exit 0 - -# AC_CACHE_SAVE -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -exit 0 - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/shmem/unix/mm/ltmain.sh b/shmem/unix/mm/ltmain.sh deleted file mode 100644 index b01e311ffdf..00000000000 --- a/shmem/unix/mm/ltmain.sh +++ /dev/null @@ -1,4012 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun ltconfig. -# -# Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 -fi - -if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - echo "$modename: not configured to build any kind of library" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" - -# Parse our command line options once, thoroughly. -while test $# -gt 0 -do - arg="$1" - shift - - case "$arg" in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case "$prev" in - execute_dlfiles) - eval "$prev=\"\$$prev \$arg\"" - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case "$arg" in - --help) - show_help=yes - ;; - - --version) - echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - exit 0 - ;; - - --config) - sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0 - exit 0 - ;; - - --debug) - echo "$progname: enabling shell trace mode" - set -x - ;; - - --dry-run | -n) - run=: - ;; - - --features) - echo "host: $host" - if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - exit 0 - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --quiet | --silent) - show=: - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 -fi - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - case "$nonopt" in - *cc | *++ | gcc* | *-gcc*) - mode=link - for arg - do - case "$arg" in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case "$mode" in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - lastarg= - srcfile="$nonopt" - suppress_output= - - user_target=no - for arg - do - # Accept any command-line options. - case "$arg" in - -o) - if test "$user_target" != "no"; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit 1 - fi - user_target=next - ;; - - -static) - build_old_libs=yes - continue - ;; - esac - - case "$user_target" in - next) - # The next one is the -o target name - user_target=yes - continue - ;; - yes) - # We got the output file - user_target=set - libobj="$arg" - continue - ;; - esac - - # Accept the current argument as the source file. - lastarg="$srcfile" - srcfile="$arg" - - # Aesthetically quote the previous argument. - - # Backslashify any backslashes, double quotes, and dollar signs. - # These are the only characters that are still specially - # interpreted inside of double-quoted scrings. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly in scan - # sets, so we specify it separately. - case "$lastarg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - lastarg="\"$lastarg\"" - ;; - esac - - # Add the previous argument to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi - done - - case "$user_target" in - set) - ;; - no) - # Get the name of the library object. - libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - *) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit 1 - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSfmso]' - case "$libobj" in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case "$libobj" in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit 1 - ;; - esac - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $libobj" - else - removelist="$libobj" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit 1" 1 2 15 - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit 1" 1 2 15 - else - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until ln "$0" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - echo $srcfile > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - # All platforms use -DPIC, to notify preprocessed assembler code. - command="$base_compile $srcfile $pic_flag -DPIC" - if test "$build_old_libs" = yes; then - lo_libobj="$libobj" - dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$libobj"; then - dir="$objdir" - else - dir="$dir/$objdir" - fi - libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` - - if test -d "$dir"; then - $show "$rm $libobj" - $run $rm $libobj - else - $show "$mkdir $dir" - $run $mkdir $dir - status=$? - if test $status -ne 0 && test ! -d $dir; then - exit $status - fi - fi - fi - if test "$compiler_o_lo" = yes; then - output_obj="$libobj" - command="$command -o $output_obj" - elif test "$compiler_c_o" = yes; then - output_obj="$obj" - command="$command -o $output_obj" - fi - - $run $rm "$output_obj" - $show "$command" - if $run eval "$command"; then : - else - test -n "$output_obj" && $run $rm $removelist - exit 1 - fi - - if test "$need_locks" = warn && - test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then - echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed, then go on to compile the next one - if test x"$output_obj" != x"$libobj"; then - $show "$mv $output_obj $libobj" - if $run $mv $output_obj $libobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # If we have no pic_flag, then copy the object into place and finish. - if test -z "$pic_flag" && test "$build_old_libs" = yes; then - # Rename the .lo from within objdir to obj - if test -f $obj; then - $show $rm $obj - $run $rm $obj - fi - - $show "$mv $libobj $obj" - if $run $mv $libobj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` - libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` - # Now arrange that obj and lo_libobj become the same file - $show "(cd $xdir && $LN_S $baseobj $libobj)" - if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then - exit 0 - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Allow error messages only from the first compilation. - suppress_output=' >/dev/null 2>&1' - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - command="$base_compile $srcfile" - if test "$compiler_c_o" = yes; then - command="$command -o $obj" - output_obj="$obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" - $run $rm "$output_obj" - $show "$command" - if $run eval "$command"; then : - else - $run $rm $removelist - exit 1 - fi - - if test "$need_locks" = warn && - test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then - echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed - if test x"$output_obj" != x"$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Create an invalid libtool object if no PIC, so that we do not - # accidentally link it into a program. - if test "$build_libtool_libs" != yes; then - $show "echo timestamp > $libobj" - $run eval "echo timestamp > \$libobj" || exit $? - else - # Move the .lo from within objdir - $show "$mv $libobj $lo_libobj" - if $run $mv $libobj $lo_libobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - fi - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - $rm "$lockfile" - fi - - exit 0 - ;; - - # libtool link mode - link) - modename="$modename: link" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invokation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments -# /* impgen.c starts here */ -# /* Copyright (C) 1999 Free Software Foundation, Inc. -# -# This file is part of GNU libtool. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# */ -# -# #include /* for printf() */ -# #include /* for open(), lseek(), read() */ -# #include /* for O_RDONLY, O_BINARY */ -# #include /* for strdup() */ -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; -# -# filename = argv[1]; -# -# dll = open(filename, O_RDONLY|O_BINARY); -# if (!dll) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - else - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - fi - build_libtool_libs=no - build_old_libs=yes - prefer_static_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test $# -gt 0; do - arg="$1" - shift - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case "$prev" in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case "$prev" in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case "$arg" in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit 1 - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case "$arg" in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi - - prevarg="$arg" - - case "$arg" in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: not more than one -exported-symbols argument allowed" - exit 1 - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case "$dir" in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - absdir="$dir" - fi - dir="$absdir" - ;; - esac - case " $deplibs " in - *" $arg "*) ;; - *) deplibs="$deplibs $arg";; - esac - case " $lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir";; - esac - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - dllsearchdir=`cd "$dir" && pwd || echo "$dir"` - case ":$dllsearchpath:" in - ::) dllsearchpath="$dllsearchdir";; - *":$dllsearchdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dllsearchdir";; - esac - ;; - esac - ;; - - -l*) - if test "$arg" = "-lc"; then - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) - # These systems don't actually have c library (as such) - continue - ;; - esac - elif test "$arg" = "-lm"; then - case "$host" in - *-*-cygwin* | *-*-beos*) - # These systems don't actually have math library (as such) - continue - ;; - esac - fi - deplibs="$deplibs $arg" - ;; - - -module) - module=yes - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -o) prev=output ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case "$dir" in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static) - # If we have no pic_flag, then this is the same as -all-static. - if test -z "$pic_flag" && test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - ;; - - *.o | *.obj | *.a | *.lib) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A library object. - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` - prev= - fi - libobjs="$libobjs $arg" - ;; - - *.la) - # A libtool-controlled library. - - dlname= - libdir= - library_names= - old_library= - - # Check to see that this really is a libtool archive. - if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2 - exit 1 - fi - - # If the library was installed with an old release of libtool, - # it will not redefine variable installed. - installed=yes - - # Read the .la file - # If there is no directory component, then add one. - case "$arg" in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$arg'" 1>&2 - exit 1 - fi - - # Find the relevant object directory and library name. - name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'` - - if test "X$installed" = Xyes; then - dir="$libdir" - else - dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$arg"; then - dir="$objdir" - else - dir="$dir/$objdir" - fi - fi - - if test -n "$dependency_libs"; then - # Extract -R and -L from dependency_libs - temp_deplibs= - for deplib in $dependency_libs; do - case "$deplib" in - -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - case " $rpath $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - -L*) case "$compile_command $temp_deplibs " in - *" $deplib "*) ;; - *) temp_deplibs="$temp_deplibs $deplib";; - esac - temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'` - case " $lib_search_path " in - *" $temp_dir "*) ;; - *) lib_search_path="$lib_search_path $temp_dir";; - esac - ;; - *) temp_deplibs="$temp_deplibs $deplib";; - esac - done - dependency_libs="$temp_deplibs" - fi - - if test -z "$libdir"; then - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $dir/$old_library" - old_convenience="$old_convenience $dir/$old_library" - deplibs="$deplibs$dependency_libs" - compile_command="$compile_command $dir/$old_library$dependency_libs" - finalize_command="$finalize_command $dir/$old_library$dependency_libs" - continue - fi - - # This library was specified with -dlopen. - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking statically, - # we need to preload. - prev=dlprefiles - else - # We should not create a dependency on this library, but we - # may need any libraries it requires. - compile_command="$compile_command$dependency_libs" - finalize_command="$finalize_command$dependency_libs" - prev= - continue - fi - fi - - # The library was specified with -dlpreopen. - if test "$prev" = dlprefiles; then - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - dlprefiles="$dlprefiles $dir/$old_library" - else - dlprefiles="$dlprefiles $dir/$linklib" - fi - prev= - fi - - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - link_against_libtool_libs="$link_against_libtool_libs $arg" - if test -n "$shlibpath_var"; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *) temp_rpath="$temp_rpath $dir" ;; - esac - fi - - # We need an absolute path. - case "$dir" in - [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - absdir="$dir" - fi - ;; - esac - - # This is the magic to use -rpath. - # Skip directories that are in the system default run-time - # search path, unless they have been requested with -R. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - - lib_linked=yes - case "$hardcode_action" in - immediate | unsupported) - if test "$hardcode_direct" = no; then - compile_command="$compile_command $dir/$linklib" - deplibs="$deplibs $dir/$linklib" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - dllsearchdir=`cd "$dir" && pwd || echo "$dir"` - if test -n "$dllsearchpath"; then - dllsearchpath="$dllsearchpath:$dllsearchdir" - else - dllsearchpath="$dllsearchdir" - fi - ;; - esac - elif test "$hardcode_minus_L" = no; then - case "$host" in - *-*-sunos*) - compile_shlibpath="$compile_shlibpath$dir:" - ;; - esac - case "$compile_command " in - *" -L$dir "*) ;; - *) compile_command="$compile_command -L$dir";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -L$dir -l$name" - elif test "$hardcode_shlibpath_var" = no; then - case ":$compile_shlibpath:" in - *":$dir:"*) ;; - *) compile_shlibpath="$compile_shlibpath$dir:";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -l$name" - else - lib_linked=no - fi - ;; - - relink) - if test "$hardcode_direct" = yes; then - compile_command="$compile_command $absdir/$linklib" - deplibs="$deplibs $absdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - case "$compile_command " in - *" -L$absdir "*) ;; - *) compile_command="$compile_command -L$absdir";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -L$absdir -l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case ":$compile_shlibpath:" in - *":$absdir:"*) ;; - *) compile_shlibpath="$compile_shlibpath$absdir:";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -l$name" - else - lib_linked=no - fi - ;; - - *) - lib_linked=no - ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit 1 - fi - - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - finalize_command="$finalize_command $libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - case "$finalize_command " in - *" -L$libdir "*) ;; - *) finalize_command="$finalize_command -L$libdir";; - esac - finalize_command="$finalize_command -l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case ":$finalize_shlibpath:" in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:";; - esac - finalize_command="$finalize_command -l$name" - else - # We cannot seem to hardcode it, guess we'll fake it. - case "$finalize_command " in - *" -L$dir "*) ;; - *) finalize_command="$finalize_command -L$libdir";; - esac - finalize_command="$finalize_command -l$name" - fi - else - # Transform directly to old archives if we don't build new libraries. - if test -n "$pic_flag" && test -z "$old_library"; then - $echo "$modename: cannot find static library for \`$arg'" 1>&2 - exit 1 - fi - - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_command="$compile_command $dir/$linklib" - finalize_command="$finalize_command $dir/$linklib" - else - case "$compile_command " in - *" -L$dir "*) ;; - *) compile_command="$compile_command -L$dir";; - esac - compile_command="$compile_command -l$name" - case "$finalize_command " in - *" -L$dir "*) ;; - *) finalize_command="$finalize_command -L$dir";; - esac - finalize_command="$finalize_command -l$name" - fi - fi - - # Add in any libraries that this one depends upon. - compile_command="$compile_command$dependency_libs" - finalize_command="$finalize_command$dependency_libs" - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - ;; - esac - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - case "$output" in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - - *.a | *.lib) - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link libtool libraries into archives" 1>&2 - exit 1 - fi - - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - ;; - - *.la) - # Make sure we only generate libraries of the form `libNAME.la'. - case "$outputname" in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - - if test -n "$objs"; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 - exit 1 - fi - - # How the heck are we supposed to write a wrapper for a shared library? - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2 - exit 1 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test $# -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - libext=al - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - dependency_libs="$deplibs" - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - current="$2" - revision="$3" - age="$4" - - # Check that each of the things are valid numbers. - case "$current" in - 0 | [1-9] | [1-9][0-9]*) ;; - *) - $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case "$revision" in - 0 | [1-9] | [1-9][0-9]*) ;; - *) - $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case "$age" in - 0 | [1-9] | [1-9][0-9]*) ;; - *) - $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - if test $age -gt $current; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case "$version_type" in - none) ;; - - irix) - major=`expr $current - $age + 1` - versuffix="$major.$revision" - verstring="sgi$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test $loop != 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="sgi$major.$iface:$verstring" - done - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test $loop != 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - windows) - # Like Linux, but with '-' rather than '.', since we only - # want one extension on Windows 95. - major=`expr $current - $age` - versuffix="-$major-$age-$revision" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - verstring="0.0" - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - dependency_libs="$deplibs" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *) - # Add libc to deplibs on all other systems. - deplibs="$deplibs -lc" - ;; - esac - fi - - # Create the output directory, or remove our outputs if we need to. - if test -d $output_objdir; then - $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" - $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* - else - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $output_objdir; then - exit $status - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - if test "$build_libtool_libs" = yes; then - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case "$deplibs_check_method" in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behaviour. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c </dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | sed 's/.* -> //'` - case "$potliblink" in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | sed 10q \ - | egrep "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - echo "*** Warning: This library needs some functionality provided by $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | - grep . >/dev/null; then - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - echo "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - # Get the real and link names of the library. - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - lib="$output_objdir/$realname" - for link - do - linknames="$linknames $link" - done - - # Ensure that we have .o objects for linkers which dislike .lo - # (e.g. aix) in case we are running --disable-static - for obj in $libobjs; do - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` - if test ! -f $xdir/$oldobj; then - $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" - $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? - fi - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - eval cmds=\"$export_symbols_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - for xlib in $convenience; do - # Extract the objects. - case "$xlib" in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linkopts="$linkopts $flag" - fi - - # Do each of the archive commands. - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" - else - eval cmds=\"$archive_cmds\" - fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - *.lo | *.o | *.obj) - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link libtool libraries into objects" 1>&2 - exit 1 - fi - - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case "$output" in - *.lo) - if test -n "$objs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit 1 - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - for xlib in $convenience; do - # Extract the objects. - case "$xlib" in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - fi - - # Create the old-style object. - reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" - - output="$obj" - eval cmds=\"$reload_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit 0 - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - $show "echo timestamp > $libobj" - $run eval "echo timestamp > $libobj" || exit $? - exit 0 - fi - - if test -n "$pic_flag"; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - eval cmds=\"$reload_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - else - # Just create a symlink. - $show $rm $libobj - $run $rm $libobj - xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$libobj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` - oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` - $show "(cd $xdir && $LN_S $oldobj $baseobj)" - $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit 0 - ;; - - # Anything else should be a program. - *) - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$compile_rpath " in - *" $libdir "*) ;; - *) compile_rpath="$compile_rpath $libdir" ;; - esac - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - - # Create the binary in the object directory, then wrap it. - if test ! -d $output_objdir; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $output_objdir; then - exit $status - fi - fi - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case "$dlsyms" in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$output.exp" - $run $rm $export_symbols - $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - else - $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' - $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`echo "$arg" | sed -e 's%^.*/%%'` - $run eval 'echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{\ -" - - sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ - -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ - < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr_t) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case "$host" in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DPIC";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit 1 - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case "$dir" in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $0 --fallback-echo"; then - case "$0" in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; - *) qecho="$SHELL `pwd`/$0 --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`echo $output|sed 's,.exe$,,'` ;; - esac - $rm $output - trap "$rm $output; exit 1" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - link_against_libtool_libs='$link_against_libtool_libs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - echo >> $output "\ - program=lt-'$outputname' - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if (cd \"\$thisdir\" && eval \$relink_command); then : - else - $rm \"\$progdir/\$file\" - exit 1 - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - *-*-cygwin* | *-*-mingw | *-*-os2*) - # win32 systems need to use the prog path for dll - # lookup to work - $echo >> $output "\ - exec \$progdir\\\\\$program \${1+\"\$@\"} -" - ;; - *) - $echo >> $output "\ - # Export the path to the program. - PATH=\"\$progdir:\$PATH\" - export PATH - - exec \$program \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit 1 - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" - chmod +x $output - fi - exit 0 - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - # Add in members from convenience archives. - for xlib in $addlibs; do - # Extract the objects. - case "$xlib" in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` - done - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - eval cmds=\"$old_archive_from_new_cmds\" - else - # Ensure that we have .o objects in place in case we decided - # not to build a shared library, and have fallen back to building - # static libs even though --disable-static was passed! - for oldobj in $oldobjs; do - if test ! -f $oldobj; then - xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$oldobj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` - obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` - $show "(cd $xdir && ${LN_S} $obj $baseobj)" - $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? - fi - done - - eval cmds=\"$old_archive_cmds\" - fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case "$output" in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - if test -n "$xrpath"; then - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - done - dependency_libs="$temp_xrpath $dependency_libs" - fi - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - fi - $rm $output - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$dlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Directory that this library needs to be installed in: -libdir='$install_libdir'\ -" - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $? - ;; - esac - exit 0 - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || test "$nonopt" = ./shtool;then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg="$nonopt" - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest="$arg" - continue - fi - - case "$arg" in - -d) isdir=yes ;; - -f) prev="-f" ;; - -g) prev="-g" ;; - -m) prev="-m" ;; - -o) prev="-o" ;; - -s) - stripme=" -s" - continue - ;; - -*) ;; - - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest="$arg" - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit 1 - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test $# -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - fi - case "$destdir" in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case "$file" in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case "$file" in - *.a | *.lib) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - library_names= - old_library= - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/" - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$realname $destdir/$realname" - $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $? - - if test $# -gt 0; then - # Delete the old symlinks, and create new ones. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - eval cmds=\"$postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case "$destfile" in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.o | *.obj) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit 0 - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - link_against_libtool_libs= - relink_command= - - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Check the variables that should have been set. - if test -z "$link_against_libtool_libs"; then - $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 - exit 1 - fi - - finalize=yes - for lib in $link_against_libtool_libs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case "$lib" in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`" - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir="/tmp" - test -n "$TMPDIR" && tmpdir="$TMPDIR" - tmpdir="$tmpdir/libtool-$$" - if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : - else - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 - continue - fi - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - # Do each command in the postinstall commands. - eval cmds=\"$old_postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exit 0 #$current_libdirs - exit 1 - fi - - exit 0 - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - eval cmds=\"$finish_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit 0 - - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - echo " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - echo "See any operating system documentation about shared libraries for" - echo "more information, such as the ld(1) and ld.so(8) manual pages." - echo "----------------------------------------------------------------------" - exit 0 - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit 1 - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - dir= - case "$file" in - *.la) - # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit 1 - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case "$file" in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved enviroment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # Now actually exec the command. - eval "exec \$cmd$args" - - $echo "$modename: cannot exec \$cmd$args" - exit 1 - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - fi - $echo "$cmd$args" - exit 0 - fi - ;; - - # libtool uninstall mode - uninstall) - modename="$modename: uninstall" - rm="$nonopt" - files= - - for arg - do - case "$arg" in - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - rmfiles="$file" - - case "$name" in - *.la) - # Possibly a libtool archive, so verify it. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $dir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library" - - $show "$rm $rmfiles" - $run $rm $rmfiles - - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - eval cmds=\"$postuninstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - eval cmds=\"$old_postuninstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - done - IFS="$save_ifs" - fi - - # FIXME: should reinstall the best remaining shared library. - fi - ;; - - *.lo) - if test "$build_old_libs" = yes; then - oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` - rmfiles="$rmfiles $dir/$oldobj" - fi - $show "$rm $rmfiles" - $run $rm $rmfiles - ;; - - *) - $show "$rm $rmfiles" - $run $rm $rmfiles - ;; - esac - done - exit 0 - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 - ;; - esac - - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 -fi # test -z "$show_help" - -# We need to display help for each of the modes. -case "$mode" in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --version print version information - -MODE must be one of the following: - - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE." - exit 0 - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; -esac - -echo -$echo "Try \`$modename --help' for more information about other modes." - -exit 0 - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/shmem/unix/mm/mm-config.1 b/shmem/unix/mm/mm-config.1 deleted file mode 100644 index 16e1f9fbeba..00000000000 --- a/shmem/unix/mm/mm-config.1 +++ /dev/null @@ -1,284 +0,0 @@ -.rn '' }` -''' $RCSfile: mm-config.1,v $$Revision: 1.3 $$Date: 2000/05/03 17:15:48 $ -''' -''' $Log: mm-config.1,v $ -''' Revision 1.3 2000/05/03 17:15:48 rbb -''' Update MM to the latest version. retrieved from -''' http://www.engelschall.com/sw/mm -''' -''' Revision 1.11 2000/04/30 18:35:59 rse -''' *** empty log message *** -''' -''' -.de Sh -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp -.if t .sp .5v -.if n .sp -.. -.de Ip -.br -.ie \\n(.$>=3 .ne \\$3 -.el .ne 3 -.IP "\\$1" \\$2 -.. -.de Vb -.ft CW -.nf -.ne \\$1 -.. -.de Ve -.ft R - -.fi -.. -''' -''' -''' Set up \*(-- to give an unbreakable dash; -''' string Tr holds user defined translation string. -''' Bell System Logo is used as a dummy character. -''' -.tr \(*W-|\(bv\*(Tr -.ie n \{\ -.ds -- \(*W- -.ds PI pi -.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -.ds L" "" -.ds R" "" -''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of -''' \*(L" and \*(R", except that they are used on ".xx" lines, -''' such as .IP and .SH, which do another additional levels of -''' double-quote interpretation -.ds M" """ -.ds S" """ -.ds N" """"" -.ds T" """"" -.ds L' ' -.ds R' ' -.ds M' ' -.ds S' ' -.ds N' ' -.ds T' ' -'br\} -.el\{\ -.ds -- \(em\| -.tr \*(Tr -.ds L" `` -.ds R" '' -.ds M" `` -.ds S" '' -.ds N" `` -.ds T" '' -.ds L' ` -.ds R' ' -.ds M' ` -.ds S' ' -.ds N' ` -.ds T' ' -.ds PI \(*p -'br\} -.\" If the F register is turned on, we'll generate -.\" index entries out stderr for the following things: -.\" TH Title -.\" SH Header -.\" Sh Subsection -.\" Ip Item -.\" X<> Xref (embedded -.\" Of course, you have to process the output yourself -.\" in some meaninful fashion. -.if \nF \{ -.de IX -.tm Index:\\$1\t\\n%\t"\\$2" -.. -.nr % 0 -.rr F -.\} -.TH MM-CONFIG 1 "30-Apr-2000" "MM 1.1.1" "Shared Memory Library" -.UC -.if n .hy 0 -.if n .na -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.de CQ \" put $1 in typewriter font -.ft CW -'if n "\c -'if t \\&\\$1\c -'if n \\&\\$1\c -'if n \&" -\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7 -'.ft R -.. -.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2 -. \" AM - accent mark definitions -.bd B 3 -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds ? ? -. ds ! ! -. ds / -. ds q -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\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I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -.ds oe o\h'-(\w'o'u*4/10)'e -.ds Oe O\h'-(\w'O'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds v \h'-1'\o'\(aa\(ga' -. ds _ \h'-1'^ -. ds . \h'-1'. -. ds 3 3 -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -. ds oe oe -. ds Oe OE -.\} -.rm #[ #] #H #V #F C -.SH "NAME" -\fBmm-config\fR \- MM library configuration/build utility -.SH "VERSION" -MM 1.1.1 (30-Apr-2000) -.SH "SYNOPSIS" -\fBmm-config\fR -[\fB--help\fR] -[\fB--version\fR] -[\fB--cflags\fR] -[\fB--ldflags\fR] -[\fB--libs\fR] -.SH "DESCRIPTION" -The \fBmm-config\fR program is a little helper utility for easy configuring and -building applications based on the \fImm\fR\|(3) library. It can be used to query the -C compiler and linker flags which are required to correctly compile and link -the application against the \fImm\fR\|(3) library. -.SH "OPTIONS" -\fBmm-config\fR accepts the following options: -.Ip "\fB--help\fR" 4 -Prints the short usage information. -.Ip "\fB--version\fR" 4 -Prints the version number and date of the installed \fImm\fR\|(3) library. -.Ip "\fB--cflags\fR" 4 -Prints the C compiler flags which are needed to compile the \fImm\fR\|(3)\-based -application. The output is usually added to the \f(CWCFLAGS\fR variable of the -applications \f(CWMakefile\fR. -.Ip "\fB--ldflags\fR" 4 -Prints the linker flags (\f(CW-L\fR) which are needed to link the application with -the \fImm\fR\|(3) library. The output is usually added to the \f(CWLDFLAGS\fR variable of -the applications \f(CWMakefile\fR. -.Ip "\fB--libs\fR" 4 -Prints the library flags (\f(CW-l\fR) which are needed to link the application with -the \fImm\fR\|(3) library. The output is usually added to the \f(CWLIBS\fR variable of the -applications \f(CWMakefile\fR. -.SH "EXAMPLE" -.PP -.Vb 10 -\& CC=cc -\& CFLAGS=-O `mm-config --cflags` -\& LDFLAGS=`mm-config --ldflags` -\& LIBS=-lm `mm-config --libs` -\& -\& all: foo -\& foo: foo.o -\& $(CC) $(LDFLAGS) -o foo foo.o $(LIBS) -\& foo.o: foo.c -\& $(CC) $(CFLAGS) -c foo.c -.Ve -.SH "SEE ALSO" -\fImm\fR\|(3). -.SH "AUTHOR" -.PP -.Vb 3 -\& Ralf S. Engelschall -\& rse@engelschall.com -\& www.engelschall.com -.Ve - -.rn }` '' -.IX Title "MM-CONFIG 1" -.IX Name "B - MM library configuration/build utility" - -.IX Header "NAME" - -.IX Header "VERSION" - -.IX Header "SYNOPSIS" - -.IX Header "DESCRIPTION" - -.IX Header "OPTIONS" - -.IX Item "\fB--help\fR" - -.IX Item "\fB--version\fR" - -.IX Item "\fB--cflags\fR" - -.IX Item "\fB--ldflags\fR" - -.IX Item "\fB--libs\fR" - -.IX Header "EXAMPLE" - -.IX Header "SEE ALSO" - -.IX Header "AUTHOR" - diff --git a/shmem/unix/mm/mm-config.in b/shmem/unix/mm/mm-config.in deleted file mode 100644 index bfb3a248bb9..00000000000 --- a/shmem/unix/mm/mm-config.in +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/sh -## -## mm-config -- MM library build configuration utility -## -## ==================================================================== -## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in -## the documentation and/or other materials provided with the -## distribution. -## -## 3. All advertising materials mentioning features or use of this -## software must display the following acknowledgment: -## "This product includes software developed by -## Ralf S. Engelschall ." -## -## 4. Redistributions of any form whatsoever must retain the following -## acknowledgment: -## "This product includes software developed by -## Ralf S. Engelschall ." -## -## THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY -## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR -## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -## OF THE POSSIBILITY OF SUCH DAMAGE. -## ==================================================================== - -DIFS=' -' - -prefix="@prefix@" -exec_prefix="@exec_prefix@" - -mm_prefix="$prefix" -mm_libdir="@libdir@" -mm_includedir="@includedir@" -mm_mandir="@mandir@" -mm_cflags="@CFLAGS@" -mm_ldflags="@LDFLAGS@" -mm_libs="@LIBS@" -mm_version="@MM_VERSION_STR@" - -help=no -version=no - -usage="mm-config [--help] [--version] [--all] [--cflags] [--ldflags] [--libs]" -if [ $# -eq 0 ]; then - echo "mm-config:Error: Invalid option" 1>&2 - echo "mm-config:Usage: $usage" 1>&2 - exit 1 -fi -output="" -output_extra="" -all=no -prev='' -OIFS="$IFS" IFS="$DIFS" -for option -do - if [ ".$prev" != . ]; then - eval "$prev=\$option" - prev="" - continue - fi - case "$option" in - -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg='' ;; - esac - case "$option" in - --help|-h) - echo "Usage: $usage" - echo "Report bugs to rse@engelschall.com" - exit 0 - ;; - --version|-v) - echo "MM $mm_version" - exit 0 - ;; - --all) - all=yes - ;; - --cflags) - output="$output -I$mm_includedir" - output_extra="$output_extra $mm_cflags" - ;; - --ldflags) - output="$output -L$mm_libdir" - output_extra="$output_extra $mm_ldflags" - ;; - --libs) - output="$output -lmm" - output_extra="$output_extra $mm_libs" - ;; - * ) - echo "mm-config:Error: Invalid option" 1>&2 - echo "mm-config:Usage: $usage" 1>&2 - exit 1; - ;; - esac -done -IFS="$OIFS" -if [ ".$prev" != . ]; then - echo "mm-config:Error: missing argument to --`echo $prev | sed 's/_/-/g'`" 1>&2 - exit 1 -fi -if [ ".$output" != . ]; then - if [ ".$all" = .yes ]; then - output="$output $output_extra" - fi - echo $output -fi - diff --git a/shmem/unix/mm/mm-config.pod b/shmem/unix/mm/mm-config.pod deleted file mode 100644 index 9dbf6c4a1e6..00000000000 --- a/shmem/unix/mm/mm-config.pod +++ /dev/null @@ -1,128 +0,0 @@ -## ==================================================================== -## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in -## the documentation and/or other materials provided with the -## distribution. -## -## 3. All advertising materials mentioning features or use of this -## software must display the following acknowledgment: -## "This product includes software developed by -## Ralf S. Engelschall ." -## -## 4. Redistributions of any form whatsoever must retain the following -## acknowledgment: -## "This product includes software developed by -## Ralf S. Engelschall ." -## -## THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY -## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR -## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -## OF THE POSSIBILITY OF SUCH DAMAGE. -## ==================================================================== - -## -## mm-config.pod -- Manpage -## - -=pod - -=head1 NAME - -B - MM library configuration/build utility - -=head1 VERSION - -MM MM_VERSION_STR - -=head1 SYNOPSIS - -B -[B<--help>] -[B<--version>] -[B<--cflags>] -[B<--ldflags>] -[B<--libs>] - -=head1 DESCRIPTION - -The B program is a little helper utility for easy configuring and -building applications based on the mm(3) library. It can be used to query the -C compiler and linker flags which are required to correctly compile and link -the application against the mm(3) library. - -=head1 OPTIONS - -B accepts the following options: - -=over 4 - -=item B<--help> - -Prints the short usage information. - -=item B<--version> - -Prints the version number and date of the installed mm(3) library. - -=item B<--cflags> - -Prints the C compiler flags which are needed to compile the mm(3)-based -application. The output is usually added to the C variable of the -applications C. - -=item B<--ldflags> - -Prints the linker flags (C<-L>) which are needed to link the application with -the mm(3) library. The output is usually added to the C variable of -the applications C. - -=item B<--libs> - -Prints the library flags (C<-l>) which are needed to link the application with -the mm(3) library. The output is usually added to the C variable of the -applications C. - -=back - -=head1 EXAMPLE - - CC=cc - CFLAGS=-O `mm-config --cflags` - LDFLAGS=`mm-config --ldflags` - LIBS=-lm `mm-config --libs` - - all: foo - foo: foo.o - $(CC) $(LDFLAGS) -o foo foo.o $(LIBS) - foo.o: foo.c - $(CC) $(CFLAGS) -c foo.c - -=head1 SEE ALSO - -mm(3). - -=head1 AUTHOR - - Ralf S. Engelschall - rse@engelschall.com - www.engelschall.com - -=cut - diff --git a/shmem/unix/mm/mm.3 b/shmem/unix/mm/mm.3 deleted file mode 100644 index 46108f406ce..00000000000 --- a/shmem/unix/mm/mm.3 +++ /dev/null @@ -1,760 +0,0 @@ -.rn '' }` -''' $RCSfile: mm.3,v $$Revision: 1.4 $$Date: 2000/05/03 17:15:49 $ -''' -''' $Log: mm.3,v $ -''' Revision 1.4 2000/05/03 17:15:49 rbb -''' Update MM to the latest version. retrieved from -''' http://www.engelschall.com/sw/mm -''' -''' -.de Sh -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp -.if t .sp .5v -.if n .sp -.. -.de Ip -.br -.ie \\n(.$>=3 .ne \\$3 -.el .ne 3 -.IP "\\$1" \\$2 -.. -.de Vb -.ft CW -.nf -.ne \\$1 -.. -.de Ve -.ft R - -.fi -.. -''' -''' -''' Set up \*(-- to give an unbreakable dash; -''' string Tr holds user defined translation string. -''' Bell System Logo is used as a dummy character. -''' -.tr \(*W-|\(bv\*(Tr -.ie n \{\ -.ds -- \(*W- -.ds PI pi -.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -.ds L" "" -.ds R" "" -''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of -''' \*(L" and \*(R", except that they are used on ".xx" lines, -''' such as .IP and .SH, which do another additional levels of -''' double-quote interpretation -.ds M" """ -.ds S" """ -.ds N" """"" -.ds T" """"" -.ds L' ' -.ds R' ' -.ds M' ' -.ds S' ' -.ds N' ' -.ds T' ' -'br\} -.el\{\ -.ds -- \(em\| -.tr \*(Tr -.ds L" `` -.ds R" '' -.ds M" `` -.ds S" '' -.ds N" `` -.ds T" '' -.ds L' ` -.ds R' ' -.ds M' ` -.ds S' ' -.ds N' ` -.ds T' ' -.ds PI \(*p -'br\} -.\" If the F register is turned on, we'll generate -.\" index entries out stderr for the following things: -.\" TH Title -.\" SH Header -.\" Sh Subsection -.\" Ip Item -.\" X<> Xref (embedded -.\" Of course, you have to process the output yourself -.\" in some meaninful fashion. -.if \nF \{ -.de IX -.tm Index:\\$1\t\\n%\t"\\$2" -.. -.nr % 0 -.rr F -.\} -.TH mm 3 "30-Apr-2000" "MM 1.1.1" "Shared Memory Library" -.UC -.if n .hy 0 -.if n .na -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.de CQ \" put $1 in typewriter font -.ft CW -'if n "\c -'if t \\&\\$1\c -'if n \\&\\$1\c -'if n \&" -\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7 -'.ft R -.. -.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2 -. \" AM - accent mark definitions -.bd B 3 -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds ? ? -. ds ! ! -. ds / -. ds q -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\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10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -.ds oe o\h'-(\w'o'u*4/10)'e -.ds Oe O\h'-(\w'O'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds v \h'-1'\o'\(aa\(ga' -. ds _ \h'-1'^ -. ds . \h'-1'. -. ds 3 3 -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -. ds oe oe -. ds Oe OE -.\} -.rm #[ #] #H #V #F C -.SH "NAME" -\fBMM \- Shared Memory Library\fR -.SH "VERSION" -MM 1.1.1 (30-Apr-2000) -.SH "SYNOPSIS" -.PP -.Vb 1 -\& #include "mm.h" -.Ve -\fB Global Malloc-Replacement API\fR -.PP -.Vb 14 -\& int \fBMM_create\fR(size_t size, const char *file); -\& int \fBMM_permission\fR(mode_t mode, uid_t owner, gid_t group); -\& void \fBMM_destroy\fR(void); -\& int \fBMM_lock\fR(mm_lock_mode mode); -\& int \fBMM_unlock\fR(void); -\& void *\fBMM_malloc\fR(size_t size); -\& void *\fBMM_realloc\fR(void *ptr, size_t size); -\& void \fBMM_free\fR(void *ptr); -\& void *\fBMM_calloc\fR(size_t number, size_t size); -\& char *\fBMM_strdup\fR(const char *str); -\& size_t \fBMM_sizeof\fR(void *ptr); -\& size_t \fBMM_maxsize\fR(void); -\& size_t \fBMM_available\fR(void); -\& char *\fBMM_error\fR(void); -.Ve -\fB Standard Malloc-Style API\fR -.PP -.Vb 15 -\& MM *\fBmm_create\fR(size_t size, char *file); -\& int \fBmm_permission\fR(MM *mm, mode_t mode, uid_t owner, gid_t group); -\& void \fBmm_destroy\fR(MM *mm); -\& int \fBmm_lock\fR(MM *mm, mm_lock_mode mode); -\& int \fBmm_unlock\fR(MM *mm); -\& void *\fBmm_malloc\fR(MM *mm, size_t size); -\& void *\fBmm_realloc\fR(MM *mm, void *ptr, size_t size); -\& void \fBmm_free\fR(MM *mm, void *ptr); -\& void *\fBmm_calloc\fR(MM *mm, size_t number, size_t size); -\& char *\fBmm_strdup\fR(MM *mm, const char *str); -\& size_t \fBmm_sizeof\fR(void *ptr); -\& size_t \fBmm_maxsize\fR(void); -\& size_t \fBmm_available\fR(MM *mm); -\& char *\fBmm_error\fR(void); -\& void \fBmm_display_info\fR(MM *mm); -.Ve -\fB Low-level Shared Memory API\fR -.PP -.Vb 9 -\& void *\fBmm_core_create\fR(size_t size, char *file); -\& int \fBmm_core_permission\fR(void *core, mode_t mode, uid_t owner, gid_t group); -\& void \fBmm_core_delete\fR(void *core); -\& int \fBmm_core_lock\fR(void *core, mm_lock_mode mode); -\& int \fBmm_core_unlock\fR(void *core); -\& size_t \fBmm_core_size\fR(void *core); -\& size_t \fBmm_core_maxsegsize\fR(void); -\& size_t \fBmm_core_align2page\fR(size_t size); -\& size_t \fBmm_core_align2click\fR(size_t size); -.Ve -\fB Internal Library API\fR -.PP -.Vb 3 -\& void \fBmm_lib_error_set\fR(unsigned int, const char *str); -\& char *\fBmm_lib_error_get\fR(void); -\& int \fBmm_lib_version\fR(void); -.Ve -.SH "DESCRIPTION" -The \fBMM\fR library is a 2-layer abstraction library which simplifies the usage -of shared memory between forked (and this way strongly related) processes -under Unix platforms. On the first (lower) layer it hides all platform -dependent implementation details (allocation and locking) when dealing with -shared memory segments and on the second (higher) layer it provides a -high-level \fImalloc\fR\|(3)\-style API for a convenient and well known way to work -with data-structures inside those shared memory segments. -.PP -The abbreviation \fBMM\fR is historically and originally comes from the phrase -``\fImemory mapped\fR'\*(R' as used by the POSIX.1 \fImmap\fR\|(2) function. Because this -facility is internally used by this library on most platforms to establish the -shared memory segments. -.Sh "\s-1LIBRARY\s0 \s-1STRUCTURE\s0" -This library is structured into three main APIs which are internally based on -each other: -.Ip "\fBGlobal Malloc-Replacement \s-1API\s0\fR" 4 -This is the most high-level \s-1API\s0 which directly can be used as replacement \s-1API\s0 -for the \s-1POSIX\s0.1 memory allocation \s-1API\s0 (\fImalloc\fR\|(2) and friends). This is -useful when converting \fIheap\fR based data structures to \fIshared memory\fR -based data structures without the need to change the code dramatically. All -which is needed is to prefix the \s-1POSIX\s0.1 memory allocation functions with -`\f(CWMM_\fR\*(R', i.e. `\f(CWmalloc\fR\*(R' becomes `\f(CWMM_malloc\fR\*(R', `\f(CWstrdup\fR\*(R' becomes -`\f(CWMM_strdup\fR\*(R', etc. This \s-1API\s0 internally uses just a global `\f(CWMM *\fR\*(R' pool for -calling the corresponding functions (those with prefix `\f(CWmm_\fR') of the -\fIStandard Malloc-Style \s-1API\s0\fR. -.Ip "\fBStandard Malloc-Style \s-1API\s0\fR" 4 -This is the standard high-level memory allocation \s-1API\s0. Its interface is -similar to the \fIGlobal Malloc-Replacement \s-1API\s0\fR but it uses an explicit `\f(CWMM *\fR\*(R' -pool to operate on. That is why every function of this \s-1API\s0 has an argument of -type `\f(CWMM *\fR\*(R' as its first argument. This \s-1API\s0 provides a comfortable way to -work with small dynamically allocated shared memory chunks inside large -statically allocated shared memory segments. It is internally based on the -\fILow-Level Shared Memory \s-1API\s0\fR for creating the underlaying shared memory -segment. -.Ip "\fBLow-Level Shared Memory \s-1API\s0\fR" 4 -This is the basis of the whole \fB\s-1MM\s0\fR library. It provides low-level functions -for creating shared memory segments with mutual exclusion (in short \fImutex\fR) -capabilities in a portable way. Internally the shared memory and mutex -facility is implemented in various platform-dependent ways. A list of -implementation variants follows under the next topic. -.Sh "\s-1SHARED\s0 \s-1MEMORY\s0 \s-1IMPLEMENTATION\s0" -Internally the shared memory facility is implemented in various -platform-dependent ways. Each way has its own advantages and disadvantages -(in addition to the fact that some variants aren't available at all on some -platforms). The \fB\s-1MM\s0\fR library's configuration procedure tries hard to make a -good decision. The implemented variants are now given for overview and -background reasons with their advantages and disadvantages and in an ascending -order, i.e. the \fB\s-1MM\s0\fR configuration mechanism chooses the last available one -in the list as the preferred variant. -.Ip "Classical mmap(2) on temporary file (\s-1MMFILE\s0)" 4 -\fIAdvantage:\fR maximum portable. -\fIDisadvantage:\fR needs a temporary file on the filesystem. -.Ip "mmap(2) via \s-1POSIX\s0.1 shm_open(3) on temporary file (\s-1MMPOSX\s0)" 4 -\fIAdvantage:\fR standardized by \s-1POSIX\s0.1 and theoretically portable. -\fIDisadvantage:\fR needs a temporary file on the filesystem and is -is usually not available on existing Unix platform. -.Ip "\s-1SVR4-\s0style mmap(2) on \f(CW/dev/zero\fR device (\s-1MMZERO\s0)" 4 -\fIAdvantage:\fR widely available and mostly portable on \s-1SVR4\s0 platforms. -\fIDisadvantage:\fR needs the \f(CW/dev/zero/\fR device and a \fImmap\fR\|(2) -which supports memory mapping through this device. -.Ip "4.4BSD\-style mmap(2) via \f(CWMAP_ANON\fR facility (\s-1MMANON\s0)" 4 -\fIAdvantage:\fR does not need a temporary file or external device. -\fIDisadvantage:\fR usually only available on \s-1BSD\s0 platforms and derivatives. -.Ip "SysV \s-1IPC\s0 shmget(2) (\s-1IPCSHM\s0)" 4 -\fIAdvantage:\fR does not need a temporary file or external device. -\fIDisadvantage:\fR although available on mostly all modern Unix platforms, it has -strong restrictions like the maximum size of a single shared memory segment (can -be as small as 100KB, but depends on the platform). -.Sh "\s-1LOCKING\s0 \s-1IMPLEMENTATION\s0" -As for the shared memory facility, internally the locking facility is -implemented in various platform-dependent ways. A short overview of -implemented variants is given: -.Ip "4.2BSD\-style flock(2) on temporary file (\s-1FLOCK\s0)" 4 -\fIAdvantage:\fR exists on a lot of platforms, especially on older Unix -derivates. \fIDisadvantage:\fR needs a temporary file on the filesystem and has -to re-open file-descriptors to it in \fIeach\fR\|(!) \fIfork\fR\|(2)'ed child process. -.Ip "SysV \s-1IPC\s0 semget(2) (\s-1IPCSEM\s0)" 4 -\fIAdvantage:\fR exists on a lot of platforms and does not need a temporary file. -\fIDisadvantage:\fR an unmeant termination of the application leads to a -semaphore leak because the facility does not allow a ``remove in advance'\*(R' -trick (as the \s-1IPC\s0 shared memory facility does) for safe cleanups. -.Ip "\s-1SVR4-\s0style fcntl(2) on temporary file (\s-1FCNTL\s0)" 4 -\fIAdvantage:\fR exists on a lot of platforms and is also the most powerful -variant (although not always the fastest one). \fIDisadvantage:\fR needs a -temporary file. -.Sh "\s-1MEMORY\s0 \s-1ALLOCATION\s0 \s-1STRATEGY\s0" -The memory allocation strategy the \fIStandard Malloc-Style \s-1API\s0\fR functions use -internally is the following: -.Ip "\fBAllocation\fR" 4 -If a chunk of memory has to be allocated, the internal list of free chunks -is searched for a minimal-size chunk which is larger or equal than the size of -the to be allocated chunk (a \fIbest fit\fR strategy>). -.Sp -If a chunk is found which matches this best-fit criteria, but is still a lot -larger than the requested size, it is split into two chunks: One with exactly -the requested size (which is the resulting chunk given back) and one with the -remaining size (which is immediately re-inserted into the list of free -chunks). -.Sp -If no fitting chunk is found at all in the list of free chunks, a new one is -created from the spare area of the shared memory segment until the segment is -full (in which case an \fIout of memory\fR error occurs). -.Ip "\fBDeallocation\fR" 4 -If a chunk of memory has to be deallocated, it is inserted in sorted manner -into the internal list of free chunks. The insertion operation automatically -merges the chunk with a previous and/or a next free chunk if possible, i.e. -if the free chunks stay physically seamless (one after another) in memory, to -automatically form larger free chunks out of smaller ones. -.Sp -This way the shared memory segment is automatically defragmented when memory -is deallocated. -.PP -This strategy reduces memory waste and fragmentation caused by small and -frequent allocations and deallocations to a minimum. -.PP -The internal implementation of the list of free chunks is not specially -optimized (for instance by using binary search trees or even \fIsplay\fR trees, -etc), because it is assumed that the total amount of entries in the list of -free chunks is always small (caused both by the fact that shared memory -segments are usually a lot smaller than heaps and the fact that we always -defragment by merging the free chunks if possible). -.SH "API FUNCTIONS" -In the following all API functions are described in detail. -The order directly follows the one in the \fBSYNOPSIS\fR. -.Sh "Global Malloc-Replacement \s-1API\s0" -.Ip "int \fBMM_create\fR(size_t \fIsize\fR, const char *\fIfile\fR);" 4 -This initializes the global shared memory pool with \fIsize\fR and \fIfile\fR and -has to be called \fIbefore\fR any \fIfork\fR\|(2) operations are performed by the -application. -.Ip "int \fBMM_permission\fR(mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" 4 -This sets the filesystem \fImode\fR, \fIowner\fR and \fIgroup\fR for the global shared -memory pool (has effects only if the underlaying shared memory segment -implementation is actually based on external auxiliary files). The arguments -are directly passed through to \fIchmod\fR\|(2) and \fIchown\fR\|(2). -.Ip "void \fBMM_destroy\fR(void);" 4 -This destroys the global shared memory pool and should be called \fIafter\fR all -child processes were killed. -.Ip "int \fBMM_lock\fR(mm_lock_mode \fImode\fR);" 4 -This locks the global shared memory pool for the current process in order to -perform either shared/read-only (\fImode\fR is \f(CWMM_LOCK_RD\fR) or -exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) critical operations inside the -global shared memory pool. -.Ip "int \fBMM_unlock\fR(void);" 4 -This unlocks the global shared memory pool for the current process after the -critical operations were performed inside the global shared memory pool. -.Ip "void *\fBMM_malloc\fR(size_t \fIsize\fR);" 4 -Identical to the \s-1POSIX\s0.1 \fImalloc\fR\|(3) function but instead of allocating -memory from the \fIheap\fR it allocates it from the global shared memory pool. -.Ip "void \fBMM_free\fR(void *\fIptr\fR);" 4 -Identical to the \s-1POSIX\s0.1 \fIfree\fR\|(3) function but instead of deallocating -memory in the \fIheap\fR it deallocates it in the global shared memory pool. -.Ip "void *\fBMM_realloc\fR(void *\fIptr\fR, size_t \fIsize\fR);" 4 -Identical to the \s-1POSIX\s0.1 \fIrealloc\fR\|(3) function but instead of reallocating -memory in the \fIheap\fR it reallocates it inside the global shared memory pool. -.Ip "void *\fBMM_calloc\fR(size_t \fInumber\fR, size_t \fIsize\fR);" 4 -Identical to the \s-1POSIX\s0.1 \fIcalloc\fR\|(3) function but instead of allocating and -initializing memory from the \fIheap\fR it allocates and initializes it from the -global shared memory pool. -.Ip "char *\fBMM_strdup\fR(const char *\fIstr\fR);" 4 -Identical to the \s-1POSIX\s0.1 \fIstrdup\fR\|(3) function but instead of creating the -string copy in the \fIheap\fR it creates it in the global shared memory pool. -.Ip "size_t \fBMM_sizeof\fR(const void *\fIptr\fR);" 4 -This function returns the size in bytes of the chunk starting at \fIptr\fR when -\fIptr\fR was previously allocated with \fIMM_malloc\fR\|(3). The result is undefined -if \fIptr\fR was not previously allocated with \fIMM_malloc\fR\|(3). -.Ip "size_t \fBMM_maxsize\fR(void);" 4 -This function returns the maximum size which is allowed -as the first argument to the \fIMM_create\fR\|(3) function. -.Ip "size_t \fBMM_available\fR(void);" 4 -Returns the amount in bytes of still available (free) memory in the global -shared memory pool. -.Ip "char *\fBMM_error\fR(void);" 4 -Returns the last error message which occurred inside the \fB\s-1MM\s0\fR library. -.Sh "Standard Malloc-Style \s-1API\s0" -.Ip "\s-1MM\s0 *\fBmm_create\fR(size_t \fIsize\fR, const char *\fIfile\fR);" 4 -This creates a shared memory pool which has space for approximately a total of -\fIsize\fR bytes with the help of \fIfile\fR. Here \fIfile\fR is a filesystem path to a -file which need not to exist (and perhaps is never created because this -depends on the platform and chosen shared memory and mutex implementation). -The return value is a pointer to a \f(CWMM\fR structure which should be treated as -opaque by the application. It describes the internals of the created shared -memory pool. In case of an error \f(CWNULL\fR is returned. A \fIsize\fR of 0 means to -allocate the maximum allowed size which is platform dependent and is between a -few \s-1KB\s0 and the soft limit of 64MB. -.Ip "int \fBmm_permission\fR(\s-1MM\s0 *\fImm\fR, mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" 4 -This sets the filesystem \fImode\fR, \fIowner\fR and \fIgroup\fR for the shared memory -pool \fImm\fR (has effects only when the underlaying shared memory segment -implementation is actually based on external auxiliary files). The arguments -are directly passed through to \fIchmod\fR\|(2) and \fIchown\fR\|(2). -.Ip "void \fBmm_destroy\fR(\s-1MM\s0 *\fImm\fR);" 4 -This destroys the complete shared memory pool \fImm\fR and with it all chunks -which were allocated in this pool. Additionally any created files on the -filesystem corresponding the to shared memory pool are unlinked. -.Ip "int \fBmm_lock\fR(\s-1MM\s0 *\fImm\fR, mm_lock_mode \fImode\fR);" 4 -This locks the shared memory pool \fImm\fR for the current process in order to -perform either shared/read-only (\fImode\fR is \f(CWMM_LOCK_RD\fR) or -exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) critical operations inside the -global shared memory pool. -.Ip "int \fBmm_unlock\fR(\s-1MM\s0 *\fImm\fR);" 4 -This unlocks the shared memory pool \fImm\fR for the current process after -critical operations were performed inside the global shared memory pool. -.Ip "void *\fBmm_malloc\fR(\s-1MM\s0 *\fImm\fR, size_t \fIsize\fR);" 4 -This function allocates \fIsize\fR bytes from the shared memory pool \fImm\fR and -returns either a (virtual memory word aligned) pointer to it or \f(CWNULL\fR in -case of an error (out of memory). It behaves like the \s-1POSIX\s0.1 \fImalloc\fR\|(3) -function but instead of allocating memory from the \fIheap\fR it allocates it -from the shared memory segment underlaying \fImm\fR. -.Ip "void \fBmm_free\fR(\s-1MM\s0 *\fImm\fR, void *\fIptr\fR);" 4 -This deallocates the chunk starting at \fIptr\fR in the shared memory pool \fImm\fR. -It behaves like the \s-1POSIX\s0.1 \fIfree\fR\|(3) function but instead of deallocating -memory from the \fIheap\fR it deallocates it from the shared memory segment -underlaying \fImm\fR. -.Ip "void *\fBmm_realloc\fR(\s-1MM\s0 *\fImm\fR, void *\fIptr\fR, size_t \fIsize\fR);" 4 -This function reallocates the chunk starting at \fIptr\fR inside the shared -memory pool \fImm\fR with the new size of \fIsize\fR bytes. It behaves like the -\s-1POSIX\s0.1 \fIrealloc\fR\|(3) function but instead of reallocating memory in the -\fIheap\fR it reallocates it in the shared memory segment underlaying \fImm\fR. -.Ip "void *\fBmm_calloc\fR(\s-1MM\s0 *\fImm\fR, size_t \fInumber\fR, size_t \fIsize\fR);" 4 -This is similar to \fImm_malloc\fR\|(3), but additionally clears the chunk. It behaves -like the \s-1POSIX\s0.1 \fIcalloc\fR\|(3) function. It allocates space for \fInumber\fR -objects, each \fIsize\fR bytes in length from the shared memory pool \fImm\fR. The -result is identical to calling \fImm_malloc\fR\|(3) with an argument of ``\fInumber\fR * -\fIsize\fR'\*(R', with the exception that the allocated memory is initialized to nul -bytes. -.Ip "char *\fBmm_strdup\fR(\s-1MM\s0 *\fImm\fR, const char *\fIstr\fR);" 4 -This function behaves like the \s-1POSIX\s0.1 \fIstrdup\fR\|(3) function. It allocates -sufficient memory inside the shared memory pool \fImm\fR for a copy of the string -\fIstr\fR, does the copy, and returns a pointer to it. The pointer may -subsequently be used as an argument to the function \fImm_free\fR\|(3). If -insufficient shared memory is available, \f(CWNULL\fR is returned. -.Ip "size_t \fBmm_sizeof\fR(const void *\fIptr\fR);" 4 -This function returns the size in bytes of the chunk starting at \fIptr\fR when -\fIptr\fR was previously allocated with \fImm_malloc\fR\|(3). The result is undefined -when \fIptr\fR was not previously allocated with \fImm_malloc\fR\|(3). -.Ip "size_t \fBmm_maxsize\fR(void);" 4 -This function returns the maximum size which is allowed as the first argument -to the \fImm_create\fR\|(3) function. -.Ip "size_t \fBmm_available\fR(\s-1MM\s0 *\fImm\fR);" 4 -Returns the amount in bytes of still available (free) memory in the -shared memory pool \fImm\fR. -.Ip "char *\fBmm_error\fR(void);" 4 -Returns the last error message which occurred inside the \fB\s-1MM\s0\fR library. -.Ip "void \fBmm_display_info\fR(\s-1MM\s0 *\fImm\fR);" 4 -This is debugging function which displays a summary page for the shared memory -pool \fImm\fR describing various internal sizes and counters. -.Sh "Low-Level Shared Memory \s-1API\s0" -.Ip "void *\fBmm_core_create\fR(size_t \fIsize\fR, const char *\fIfile\fR);" 4 -This creates a shared memory area which is at least \fIsize\fR bytes in size with -the help of \fIfile\fR. The value \fIsize\fR has to be greater than 0 and less or -equal the value returned by \fImm_core_maxsegsize\fR\|(3). Here \fIfile\fR is a -filesystem path to a file which need not to exist (and perhaps is never -created because this depends on the platform and chosen shared memory and -mutex implementation). The return value is either a (virtual memory word -aligned) pointer to the shared memory segment or \f(CWNULL\fR in case of an error. -The application is guaranteed to be able to access the shared memory segment -from byte 0 to byte \fIsize\fR\-1 starting at the returned address. -.Ip "int \fBmm_core_permission\fR(void *\fIcore\fR, mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" 4 -This sets the filesystem \fImode\fR, \fIowner\fR and \fIgroup\fR for the shared memory -segment \fIcode\fR (has effects only when the underlaying shared memory segment -implementation is actually based on external auxiliary files). The arguments -are directly passed through to \fIchmod\fR\|(2) and \fIchown\fR\|(2). -.Ip "void \fBmm_core_delete\fR(void *\fIcore\fR);" 4 -This deletes a shared memory segment \fIcore\fR (as previously returned by a -\fImm_core_create\fR\|(3) call). After this operation, accessing the segment starting -at \fIcore\fR is no longer allowed and will usually lead to a segmentation fault. -.Ip "int \fBmm_core_lock\fR(const void *\fIcore\fR, mm_lock_mode \fImode\fR);" 4 -This function acquires an advisory lock for the current process on the shared -memory segment \fIcore\fR for either shared/read-only (\fImode\fR is \f(CWMM_LOCK_RD\fR) -or exclusive/read-write (\fImode\fR is \f(CWMM_LOCK_RW\fR) critical operations between -\fIfork\fR\|(2)'ed child processes. -.Ip "int \fBmm_core_unlock\fR(const void *\fIcore\fR);" 4 -This function releases a previously acquired advisory lock for the current -process on the shared memory segment \fIcore\fR. -.Ip "size_t \fBmm_core_size\fR(const void *\fIcore\fR);" 4 -This returns the size in bytes of \fIcore\fR. This size is exactly the size which -was used for creating the shared memory area via \fImm_core_create\fR\|(3). The -function is provided just for convenience reasons to not require the -application to remember the memory size behind \fIcore\fR itself. -.Ip "size_t \fBmm_core_maxsegsize\fR(void);" 4 -This returns the number of bytes of a maximum-size shared memory segment which -is allowed to allocate via the \s-1MM\s0 library. It is between a few \s-1KB\s0 and the soft -limit of 64MB. -.Ip "size_t \fBmm_core_align2page\fR(size_t \fIsize\fR);" 4 -This is just a utility function which can be used to align the number \fIsize\fR -to the next virtual memory \fIpage\fR boundary used by the underlaying platform. -The memory page boundary under Unix platforms is usually somewhere between -2048 and 16384 bytes. You do not have to align the \fIsize\fR arguments of other -\fB\s-1MM\s0\fR library functions yourself, because this is already done internally. -This function is exported by the \fB\s-1MM\s0\fR library just for convenience reasons in -case an application wants to perform similar calculations for other purposes. -.Ip "size_t \fBmm_core_align2word\fR(size_t \fIsize\fR);" 4 -This is another utility function which can be used to align the number \fIsize\fR -to the next virtual memory \fIword\fR boundary used by the underlaying platform. -The memory word boundary under Unix platforms is usually somewhere between 4 -and 16 bytes. You do not have to align the \fIsize\fR arguments of other \fB\s-1MM\s0\fR -library functions yourself, because this is already done internally. This -function is exported by the \fB\s-1MM\s0\fR library just for convenience reasons in case -an application wants to perform simular calculations for other purposes. -.Sh "Low-Level Shared Memory \s-1API\s0" -.Ip "void \fBmm_lib_error_set\fR(unsigned int, const char *str);" 4 -This is a function which is used internally by the various \s-1MM\s0 function to set -an error string. It's usually not called directly from applications. -.Ip "char *\fBmm_lib_error_get\fR(void);" 4 -This is a function which is used internally by \fIMM_error\fR\|(3) and \fImm_error\fR\|(3) -functions to get the current error string. It is usually not called directly -from applications. -.Ip "int \fBmm_lib_version\fR(void);" 4 -This function returns a hex-value ``0x\fIV\fR\fI\s-1RR\s0\fR\fIT\fR\fI\s-1LL\s0\fR'\*(R' which describes the -current \fB\s-1MM\s0\fR library version. \fIV\fR is the version, \fI\s-1RR\s0\fR the revisions, \fI\s-1LL\s0\fR -the level and \fIT\fR the type of the level (alphalevel=0, betalevel=1, -patchlevel=2, etc). For instance \fB\s-1MM\s0\fR version 1.0.4 is encoded as 0x100204. -The reason for this unusual mapping is that this way the version number is -steadily \fIincreasing\fR. -.SH "RESTRICTIONS" -The maximum size of a continuous shared memory segment one can allocate -depends on the underlaying platform. This cannot be changed, of course. But -currently the high-level \fImalloc\fR\|(3)\-style API just uses a single shared memory -segment as the underlaying data structure for an \f(CWMM\fR object which means that -the maximum amount of memory an \f(CWMM\fR object represents also depends on the -platform. -.PP -This should be changed in later versions by allowing at least the high-level -\fImalloc\fR\|(3)\-style API to internally use multiple shared memory segments to form -the \f(CWMM\fR object. This way \f(CWMM\fR objects could have arbitrary sizes, although -the maximum size of an allocatable chunk still is bounded by the maximum size -of a shared memory segment. -.SH "SEE ALSO" -mm-\fIconfig\fR\|(1). -.PP -\fImalloc\fR\|(3), \fIcalloc\fR\|(3), \fIrealloc\fR\|(3), \fIstrdup\fR\|(3), \fIfree\fR\|(3), \fImmap\fR\|(2), \fIshmget\fR\|(2), -\fIshmctl\fR\|(2), \fIflock\fR\|(2), \fIfcntl\fR\|(2), \fIsemget\fR\|(2), \fIsemctl\fR\|(2), \fIsemop\fR\|(2). -.SH "HOME" -http://www.engelschall.com/sw/mm/ - -.SH "HISTORY" -This library was originally written in January 1999 by \fIRalf S. -Engelschall\fR for use in the \fBExtended API\fR (EAPI) -of the \fBApache\fR HTTP server project (see www.apache.org), which was -originally invented for \fBmod_ssl\fR (see http://www.modssl.org/). -.PP -Its base idea (a malloc-style API for handling shared memory) was originally -derived from the non-publically available \fImm_malloc\fR library written in -October 1997 by \fICharles Randall\fR for MatchLogic, -Inc. -.SH "AUTHOR" -.PP -.Vb 3 -\& Ralf S. Engelschall -\& rse@engelschall.com -\& www.engelschall.com -.Ve - -.rn }` '' -.IX Title "mm 3" -.IX Name "B" - -.IX Header "NAME" - -.IX Header "VERSION" - -.IX Header "SYNOPSIS" - -.IX Header "DESCRIPTION" - -.IX Subsection "\s-1LIBRARY\s0 \s-1STRUCTURE\s0" - -.IX Item "\fBGlobal Malloc-Replacement \s-1API\s0\fR" - -.IX Item "\fBStandard Malloc-Style \s-1API\s0\fR" - -.IX Item "\fBLow-Level Shared Memory \s-1API\s0\fR" - -.IX Subsection "\s-1SHARED\s0 \s-1MEMORY\s0 \s-1IMPLEMENTATION\s0" - -.IX Item "Classical mmap(2) on temporary file (\s-1MMFILE\s0)" - -.IX Item "mmap(2) via \s-1POSIX\s0.1 shm_open(3) on temporary file (\s-1MMPOSX\s0)" - -.IX Item "\s-1SVR4-\s0style mmap(2) on \f(CW/dev/zero\fR device (\s-1MMZERO\s0)" - -.IX Item "4.4BSD\-style mmap(2) via \f(CWMAP_ANON\fR facility (\s-1MMANON\s0)" - -.IX Item "SysV \s-1IPC\s0 shmget(2) (\s-1IPCSHM\s0)" - -.IX Subsection "\s-1LOCKING\s0 \s-1IMPLEMENTATION\s0" - -.IX Item "4.2BSD\-style flock(2) on temporary file (\s-1FLOCK\s0)" - -.IX Item "SysV \s-1IPC\s0 semget(2) (\s-1IPCSEM\s0)" - -.IX Item "\s-1SVR4-\s0style fcntl(2) on temporary file (\s-1FCNTL\s0)" - -.IX Subsection "\s-1MEMORY\s0 \s-1ALLOCATION\s0 \s-1STRATEGY\s0" - -.IX Item "\fBAllocation\fR" - -.IX Item "\fBDeallocation\fR" - -.IX Header "API FUNCTIONS" - -.IX Subsection "Global Malloc-Replacement \s-1API\s0" - -.IX Item "int \fBMM_create\fR(size_t \fIsize\fR, const char *\fIfile\fR);" - -.IX Item "int \fBMM_permission\fR(mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" - -.IX Item "void \fBMM_destroy\fR(void);" - -.IX Item "int \fBMM_lock\fR(mm_lock_mode \fImode\fR);" - -.IX Item "int \fBMM_unlock\fR(void);" - -.IX Item "void *\fBMM_malloc\fR(size_t \fIsize\fR);" - -.IX Item "void \fBMM_free\fR(void *\fIptr\fR);" - -.IX Item "void *\fBMM_realloc\fR(void *\fIptr\fR, size_t \fIsize\fR);" - -.IX Item "void *\fBMM_calloc\fR(size_t \fInumber\fR, size_t \fIsize\fR);" - -.IX Item "char *\fBMM_strdup\fR(const char *\fIstr\fR);" - -.IX Item "size_t \fBMM_sizeof\fR(const void *\fIptr\fR);" - -.IX Item "size_t \fBMM_maxsize\fR(void);" - -.IX Item "size_t \fBMM_available\fR(void);" - -.IX Item "char *\fBMM_error\fR(void);" - -.IX Subsection "Standard Malloc-Style \s-1API\s0" - -.IX Item "\s-1MM\s0 *\fBmm_create\fR(size_t \fIsize\fR, const char *\fIfile\fR);" - -.IX Item "int \fBmm_permission\fR(\s-1MM\s0 *\fImm\fR, mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" - -.IX Item "void \fBmm_destroy\fR(\s-1MM\s0 *\fImm\fR);" - -.IX Item "int \fBmm_lock\fR(\s-1MM\s0 *\fImm\fR, mm_lock_mode \fImode\fR);" - -.IX Item "int \fBmm_unlock\fR(\s-1MM\s0 *\fImm\fR);" - -.IX Item "void *\fBmm_malloc\fR(\s-1MM\s0 *\fImm\fR, size_t \fIsize\fR);" - -.IX Item "void \fBmm_free\fR(\s-1MM\s0 *\fImm\fR, void *\fIptr\fR);" - -.IX Item "void *\fBmm_realloc\fR(\s-1MM\s0 *\fImm\fR, void *\fIptr\fR, size_t \fIsize\fR);" - -.IX Item "void *\fBmm_calloc\fR(\s-1MM\s0 *\fImm\fR, size_t \fInumber\fR, size_t \fIsize\fR);" - -.IX Item "char *\fBmm_strdup\fR(\s-1MM\s0 *\fImm\fR, const char *\fIstr\fR);" - -.IX Item "size_t \fBmm_sizeof\fR(const void *\fIptr\fR);" - -.IX Item "size_t \fBmm_maxsize\fR(void);" - -.IX Item "size_t \fBmm_available\fR(\s-1MM\s0 *\fImm\fR);" - -.IX Item "char *\fBmm_error\fR(void);" - -.IX Item "void \fBmm_display_info\fR(\s-1MM\s0 *\fImm\fR);" - -.IX Subsection "Low-Level Shared Memory \s-1API\s0" - -.IX Item "void *\fBmm_core_create\fR(size_t \fIsize\fR, const char *\fIfile\fR);" - -.IX Item "int \fBmm_core_permission\fR(void *\fIcore\fR, mode_t \fImode\fR, uid_t \fIowner\fR, gid_t \fIgroup\fR);" - -.IX Item "void \fBmm_core_delete\fR(void *\fIcore\fR);" - -.IX Item "int \fBmm_core_lock\fR(const void *\fIcore\fR, mm_lock_mode \fImode\fR);" - -.IX Item "int \fBmm_core_unlock\fR(const void *\fIcore\fR);" - -.IX Item "size_t \fBmm_core_size\fR(const void *\fIcore\fR);" - -.IX Item "size_t \fBmm_core_maxsegsize\fR(void);" - -.IX Item "size_t \fBmm_core_align2page\fR(size_t \fIsize\fR);" - -.IX Item "size_t \fBmm_core_align2word\fR(size_t \fIsize\fR);" - -.IX Subsection "Low-Level Shared Memory \s-1API\s0" - -.IX Item "void \fBmm_lib_error_set\fR(unsigned int, const char *str);" - -.IX Item "char *\fBmm_lib_error_get\fR(void);" - -.IX Item "int \fBmm_lib_version\fR(void);" - -.IX Header "RESTRICTIONS" - -.IX Header "SEE ALSO" - -.IX Header "HOME" - -.IX Header "HISTORY" - -.IX Header "AUTHOR" - diff --git a/shmem/unix/mm/mm.h b/shmem/unix/mm/mm.h deleted file mode 100644 index 9d2542591f2..00000000000 --- a/shmem/unix/mm/mm.h +++ /dev/null @@ -1,382 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by - * Ralf S. Engelschall ." - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by - * Ralf S. Engelschall ." - * - * THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - */ - -/* -** -** mm.h -- Shared Memory library API header -** -*/ - -#ifndef _MM_H_ -#define _MM_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** ____ Public Part (I) of the API ________________________ -*/ - -#include -#include -#include -#include -#include -#include - -typedef enum { - MM_LOCK_RD, MM_LOCK_RW -} mm_lock_mode; - -#define MM_ALLOCATE_ENOUGH 1 -#define MM_ALLOCATE_EXACT 2 - -/* -** ____ Private Part of the API ___________________________ -*/ - -#if defined(MM_PRIVATE) - -#include "mm_conf.h" - -#include -#include -#include -#include -#include -#include - -#ifdef MM_OS_SUNOS -#include -/* SunOS4 lacks prototypes */ -extern int getpagesize(void); -extern int munmap(caddr_t, int); -extern int ftruncate(int, off_t); -extern int flock(int, int); -extern char *strerror(int); -#endif - -#if !defined(FALSE) -#define FALSE 0 -#endif -#if !defined(TRUE) -#define TRUE !FALSE -#endif -#if !defined(NULL) -#define NULL (void *)0 -#endif -#if !defined(NUL) -#define NUL '\0' -#endif -#if !defined(min_of) -#define min_of(a,b) ((a) < (b) ? (a) : (b)) -#endif -#if !defined(max_of) -#define max_of(a,b) ((a) > (b) ? (a) : (b)) -#endif -#if !defined(absof) -#define abs_of(a) ((a) < 0 ? -(a) : (a)) -#endif -#if !defined(offset_of) -#define offset_of(type,member) ((size_t)(&((type *)0)->member)) -#endif - -#if !defined(HAVE_MEMCPY) -#if defined(HAVE_BCOPY) -#define memcpy(to,from,len) bcopy(from,to,len) -#else -#define memcpy(to,from,len) \ - { int i; for (i = 0; i < (len); i++) *(((char *)(to))+i) = *(((char *)(from))+i); } -#endif -#endif -#if !defined(HAVE_MEMSET) -#define memset(to,ch,len) \ - { int i; for (i = 0; i < (len); i++) *(((char *)(to))+i) = (ch); } -#endif - -#define ERR(type,str) mm_lib_error_set(type,str) -#define FAIL(type,str) { ERR(type,str); goto cus; } -#define BEGIN_FAILURE cus: -#define END_FAILURE - -#if defined(HAVE_PATH_MAX) -#define MM_MAXPATH PATH_MAX -#elif defined(HAVE__POSIX_PATH_MAX) -#define MM_MAXPATH _POSIX_PATH_MAX -#elif defined(HAVE_MAXPATHLEN) -#define MM_MAXPATH MAXPATHLEN -#else -#define MM_MAXPATH 2048 -#endif - -#if defined(HAVE_CHILD_MAX) -#define MM_MAXCHILD CHILD_MAX -#elif defined(HAVE__POSIX_CHILD_MAX) -#define MM_MAXCHILD _POSIX_CHILD_MAX -#else -#define MM_MAXCHILD 512 -#endif - -#if defined(MM_SHMT_MMANON) || defined(MM_SHMT_MMPOSX) ||\ - defined(MM_SHMT_MMZERO) || defined(MM_SHMT_MMFILE) -#include -#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS) -#define MAP_ANON MAP_ANONYMOUS -#endif -#if !defined(MAP_FAILED) -#define MAP_FAILED ((void *)-1) -#endif -#endif - -#if defined(MM_SHMT_IPCSHM) || defined(MM_SEMT_IPCSEM) -#include -#endif - -#if defined(MM_SHMT_IPCSHM) -#ifdef MM_OS_SUNOS -#define KERNEL 1 -#endif -#ifdef MM_OS_BS2000 -#define _KMEMUSER -#endif -#include -#ifdef MM_OS_SUNOS -#undef KERNEL -#endif -#ifdef MM_OS_BS2000 -#undef _KMEMUSER -#endif -#if !defined(SHM_R) -#define SHM_R 0400 -#endif -#if !defined(SHM_W) -#define SHM_W 0200 -#endif -#endif - -#ifdef MM_SHMT_BEOS -#include -#endif - -#if defined(MM_SEMT_IPCSEM) -#include -#ifndef HAVE_UNION_SEMUN -union semun { - int val; - struct semid_ds *buf; - u_short *array; -}; -#endif -#endif - -#ifdef MM_SEMT_FLOCK -#include -#endif - -#define MM_ALLOC_MINSIZE (1024*8) -#define MM_CORE_FILEMODE (S_IRUSR|S_IWUSR) -#define MM_CORE_DEFAULT_PAGESIZE (1024*8) -#define MM_CORE_DEFAULT_FILE "/tmp/mm.core.%d" /* %d is PID */ - -#define MM_ERR_ALLOC 1 -#define MM_ERR_CORE 2 -#define MM_ERR_SYSTEM 4 - -/* - * Define a union with types which are likely to have the longest - * *relevant* CPU-specific memory word alignment restrictions... - */ -union mem_word { - void *mw_vp; - void (*mw_fp)(void); - char *mw_cp; - long mw_l; - double mw_d; -}; -typedef union mem_word mem_word; -#define SIZEOF_mem_word (sizeof(mem_word)) - -/* - * Define the structure used for memory chunks - */ -union mem_chunk_mc_u { - struct mem_chunk *mc_next; /* really used when it's free */ - mem_word mc_base; /* virtually used when it's allocated */ -}; -struct mem_chunk { - size_t mc_size; /* physical size */ - size_t mc_usize; /* user known size */ - union mem_chunk_mc_u mc_u; -}; -typedef struct mem_chunk mem_chunk; -#define SIZEOF_mem_chunk (sizeof(mem_chunk)-sizeof(union mem_chunk_mc_u)) - -/* - * Define the structure describing a memory pool - */ -struct mem_pool { - size_t mp_size; - size_t mp_offset; - mem_chunk mp_freechunks; - mem_word mp_base; -}; -typedef struct mem_pool mem_pool; -#define SIZEOF_mem_pool (sizeof(mem_pool)-SIZEOF_mem_word) - -/* - * Define the structure holding per-process filedescriptors - */ -#if defined(MM_SEMT_FLOCK) -struct mem_core_fd { - pid_t pid; - int fd; -}; -typedef struct mem_core_fd mem_core_fd; -#define SIZEOF_mem_core_fd (sizeof(mem_core_fd) -#endif - -/* - * Define the structure describing a shared memory core area - * (the actual contents depends on the shared memory and - * semaphore/mutex type and is stripped down to a minimum - * required) - */ -struct mem_core { - size_t mc_size; - size_t mc_usize; - pid_t mc_pid; - int mc_fdmem; -#if defined(MM_SHMT_MMFILE) - char mc_fnmem[MM_MAXPATH]; -#endif -#if defined(MM_SHMT_BEOS) - area_id mc_areaid; -#endif -#if !defined(MM_SEMT_FLOCK) - int mc_fdsem; -#endif -#if defined(MM_SEMT_FLOCK) - mem_core_fd mc_fdsem[MM_MAXCHILD]; -#endif -#if defined(MM_SEMT_IPCSEM) - int mc_fdsem_rd; - int mc_readers; - mm_lock_mode mc_lockmode; -#endif -#if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL) - char mc_fnsem[MM_MAXPATH]; -#endif -#if defined(MM_SEMT_BEOS) - sem_id mc_semid; - int32 mc_ben; -#endif - mem_word mc_base; -}; -typedef struct mem_core mem_core; -#define SIZEOF_mem_core (sizeof(mem_core)-SIZEOF_mem_word) - -#endif /* MM_PRIVATE */ - -/* -** ____ Public Part (II) of the API _______________________ -*/ - -#if defined(MM_PRIVATE) -typedef mem_pool MM; -#else -typedef void MM; -#endif - -/* Global Malloc-Replacement API */ -int MM_create(size_t size, const char *file); -int MM_permission(mode_t mode, uid_t owner, gid_t group); -void MM_destroy(void); -int MM_lock(mm_lock_mode mode); -int MM_unlock(void); -void *MM_malloc(size_t size); -void *MM_realloc(void *ptr, size_t size); -void MM_free(void *ptr); -void *MM_calloc(size_t number, size_t size); -char *MM_strdup(const char *str); -size_t MM_sizeof(const void *ptr); -size_t MM_maxsize(void); -size_t MM_available(void); -char *MM_error(void); - -/* Standard Malloc-Style API */ -MM *mm_create(size_t size, const char *file, int flag); -int mm_permission(MM *mm, mode_t mode, uid_t owner, gid_t group); -void mm_destroy(MM *mm); -int mm_lock(MM *mm, mm_lock_mode mode); -int mm_unlock(MM *mm); -void *mm_malloc(MM *mm, size_t size); -void *mm_realloc(MM *mm, void *ptr, size_t size); -void mm_free(MM *mm, void *ptr); -void *mm_calloc(MM *mm, size_t number, size_t size); -char *mm_strdup(MM *mm, const char *str); -size_t mm_sizeof(MM *mm, const void *ptr); -size_t mm_maxsize(void); -size_t mm_available(MM *mm); -char *mm_error(void); -void mm_display_info(MM *mm); - -/* Low-Level Shared Memory API */ -void *mm_core_create(size_t size, const char *file); -int mm_core_permission(void *core, mode_t mode, uid_t owner, gid_t group); -void mm_core_delete(void *core); -size_t mm_core_size(const void *core); -int mm_core_lock(const void *core, mm_lock_mode mode); -int mm_core_unlock(const void *core); -size_t mm_core_maxsegsize(void); -size_t mm_core_align2page(size_t size); -size_t mm_core_align2word(size_t size); - -/* Internal Library API */ -void mm_lib_error_set(unsigned int, const char *str); -char *mm_lib_error_get(void); -int mm_lib_version(void); - -#ifdef __cplusplus -} -#endif - -#endif /* _MM_H_ */ - diff --git a/shmem/unix/mm/mm.pod b/shmem/unix/mm/mm.pod deleted file mode 100644 index e462dacaf35..00000000000 --- a/shmem/unix/mm/mm.pod +++ /dev/null @@ -1,633 +0,0 @@ -## ==================================================================== -## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in -## the documentation and/or other materials provided with the -## distribution. -## -## 3. All advertising materials mentioning features or use of this -## software must display the following acknowledgment: -## "This product includes software developed by -## Ralf S. Engelschall ." -## -## 4. Redistributions of any form whatsoever must retain the following -## acknowledgment: -## "This product includes software developed by -## Ralf S. Engelschall ." -## -## THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY -## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR -## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -## OF THE POSSIBILITY OF SUCH DAMAGE. -## ==================================================================== - -## -## mm.pod -- Manpage -## - -=pod - -=head1 NAME - -B - -=head1 VERSION - -MM MM_VERSION_STR - -=head1 SYNOPSIS - - #include "mm.h" - -B< Global Malloc-Replacement API> - - int MM_create(size_t size, const char *file); - int MM_permission(mode_t mode, uid_t owner, gid_t group); - void MM_destroy(void); - int MM_lock(mm_lock_mode mode); - int MM_unlock(void); - void *MM_malloc(size_t size); - void *MM_realloc(void *ptr, size_t size); - void MM_free(void *ptr); - void *MM_calloc(size_t number, size_t size); - char *MM_strdup(const char *str); - size_t MM_sizeof(void *ptr); - size_t MM_maxsize(void); - size_t MM_available(void); - char *MM_error(void); - -B< Standard Malloc-Style API> - - MM *mm_create(size_t size, char *file); - int mm_permission(MM *mm, mode_t mode, uid_t owner, gid_t group); - void mm_destroy(MM *mm); - int mm_lock(MM *mm, mm_lock_mode mode); - int mm_unlock(MM *mm); - void *mm_malloc(MM *mm, size_t size); - void *mm_realloc(MM *mm, void *ptr, size_t size); - void mm_free(MM *mm, void *ptr); - void *mm_calloc(MM *mm, size_t number, size_t size); - char *mm_strdup(MM *mm, const char *str); - size_t mm_sizeof(void *ptr); - size_t mm_maxsize(void); - size_t mm_available(MM *mm); - char *mm_error(void); - void mm_display_info(MM *mm); - -B< Low-level Shared Memory API> - - void *mm_core_create(size_t size, char *file); - int mm_core_permission(void *core, mode_t mode, uid_t owner, gid_t group); - void mm_core_delete(void *core); - int mm_core_lock(void *core, mm_lock_mode mode); - int mm_core_unlock(void *core); - size_t mm_core_size(void *core); - size_t mm_core_maxsegsize(void); - size_t mm_core_align2page(size_t size); - size_t mm_core_align2click(size_t size); - -B< Internal Library API> - - void mm_lib_error_set(unsigned int, const char *str); - char *mm_lib_error_get(void); - int mm_lib_version(void); - -=head1 DESCRIPTION - -The B library is a 2-layer abstraction library which simplifies the usage -of shared memory between forked (and this way strongly related) processes -under Unix platforms. On the first (lower) layer it hides all platform -dependent implementation details (allocation and locking) when dealing with -shared memory segments and on the second (higher) layer it provides a -high-level malloc(3)-style API for a convenient and well known way to work -with data-structures inside those shared memory segments. - -The abbreviation B is historically and originally comes from the phrase -``I'' as used by the POSIX.1 mmap(2) function. Because this -facility is internally used by this library on most platforms to establish the -shared memory segments. - -=head2 LIBRARY STRUCTURE - -This library is structured into three main APIs which are internally based on -each other: - -=over 4 - -=item B - -This is the most high-level API which directly can be used as replacement API -for the POSIX.1 memory allocation API (malloc(2) and friends). This is -useful when converting I based data structures to I -based data structures without the need to change the code dramatically. All -which is needed is to prefix the POSIX.1 memory allocation functions with -`C', i.e. `C' becomes `C', `C' becomes -`C', etc. This API internally uses just a global `C' pool for -calling the corresponding functions (those with prefix `C') of the -I. - -=item B - -This is the standard high-level memory allocation API. Its interface is -similar to the I but it uses an explicit `C' -pool to operate on. That is why every function of this API has an argument of -type `C' as its first argument. This API provides a comfortable way to -work with small dynamically allocated shared memory chunks inside large -statically allocated shared memory segments. It is internally based on the -I for creating the underlaying shared memory -segment. - -=item B - -This is the basis of the whole B library. It provides low-level functions -for creating shared memory segments with mutual exclusion (in short I) -capabilities in a portable way. Internally the shared memory and mutex -facility is implemented in various platform-dependent ways. A list of -implementation variants follows under the next topic. - -=back - -=head2 SHARED MEMORY IMPLEMENTATION - -Internally the shared memory facility is implemented in various -platform-dependent ways. Each way has its own advantages and disadvantages -(in addition to the fact that some variants aren't available at all on some -platforms). The B library's configuration procedure tries hard to make a -good decision. The implemented variants are now given for overview and -background reasons with their advantages and disadvantages and in an ascending -order, i.e. the B configuration mechanism chooses the last available one -in the list as the preferred variant. - -=over 4 - -=item Classical mmap(2) on temporary file (MMFILE) - -I maximum portable. -I needs a temporary file on the filesystem. - -=item mmap(2) via POSIX.1 shm_open(3) on temporary file (MMPOSX) - -I standardized by POSIX.1 and theoretically portable. -I needs a temporary file on the filesystem and is -is usually not available on existing Unix platform. - -=item SVR4-style mmap(2) on C device (MMZERO) - -I widely available and mostly portable on SVR4 platforms. -I needs the C device and a mmap(2) -which supports memory mapping through this device. - -=item 4.4BSD-style mmap(2) via C facility (MMANON) - -I does not need a temporary file or external device. -I usually only available on BSD platforms and derivatives. - -=item SysV IPC shmget(2) (IPCSHM) - -I does not need a temporary file or external device. -I although available on mostly all modern Unix platforms, it has -strong restrictions like the maximum size of a single shared memory segment (can -be as small as 100KB, but depends on the platform). - -=back - -=head2 LOCKING IMPLEMENTATION - -As for the shared memory facility, internally the locking facility is -implemented in various platform-dependent ways. A short overview of -implemented variants is given: - -=over 4 - -=item 4.2BSD-style flock(2) on temporary file (FLOCK) - -I exists on a lot of platforms, especially on older Unix -derivates. I needs a temporary file on the filesystem and has -to re-open file-descriptors to it in each(!) fork(2)'ed child process. - -=item SysV IPC semget(2) (IPCSEM) - -I exists on a lot of platforms and does not need a temporary file. -I an unmeant termination of the application leads to a -semaphore leak because the facility does not allow a ``remove in advance'' -trick (as the IPC shared memory facility does) for safe cleanups. - -=item SVR4-style fcntl(2) on temporary file (FCNTL) - -I exists on a lot of platforms and is also the most powerful -variant (although not always the fastest one). I needs a -temporary file. - -=back - -=head2 MEMORY ALLOCATION STRATEGY - -The memory allocation strategy the I functions use -internally is the following: - -=over 4 - -=item B - -If a chunk of memory has to be allocated, the internal list of free chunks -is searched for a minimal-size chunk which is larger or equal than the size of -the to be allocated chunk (a I strategy>). - -If a chunk is found which matches this best-fit criteria, but is still a lot -larger than the requested size, it is split into two chunks: One with exactly -the requested size (which is the resulting chunk given back) and one with the -remaining size (which is immediately re-inserted into the list of free -chunks). - -If no fitting chunk is found at all in the list of free chunks, a new one is -created from the spare area of the shared memory segment until the segment is -full (in which case an I error occurs). - -=item B - -If a chunk of memory has to be deallocated, it is inserted in sorted manner -into the internal list of free chunks. The insertion operation automatically -merges the chunk with a previous and/or a next free chunk if possible, i.e. -if the free chunks stay physically seamless (one after another) in memory, to -automatically form larger free chunks out of smaller ones. - -This way the shared memory segment is automatically defragmented when memory -is deallocated. - -=back - -This strategy reduces memory waste and fragmentation caused by small and -frequent allocations and deallocations to a minimum. - -The internal implementation of the list of free chunks is not specially -optimized (for instance by using binary search trees or even I trees, -etc), because it is assumed that the total amount of entries in the list of -free chunks is always small (caused both by the fact that shared memory -segments are usually a lot smaller than heaps and the fact that we always -defragment by merging the free chunks if possible). - -=head1 API FUNCTIONS - -In the following all API functions are described in detail. -The order directly follows the one in the B. - -=head2 Global Malloc-Replacement API - -=over 4 - -=item int B(size_t I, const char *I); - -This initializes the global shared memory pool with I and I and -has to be called I any fork(2) operations are performed by the -application. - -=item int B(mode_t I, uid_t I, gid_t I); - -This sets the filesystem I, I and I for the global shared -memory pool (has effects only if the underlaying shared memory segment -implementation is actually based on external auxiliary files). The arguments -are directly passed through to chmod(2) and chown(2). - -=item void B(void); - -This destroys the global shared memory pool and should be called I all -child processes were killed. - -=item int B(mm_lock_mode I); - -This locks the global shared memory pool for the current process in order to -perform either shared/read-only (I is C) or -exclusive/read-write (I is C) critical operations inside the -global shared memory pool. - -=item int B(void); - -This unlocks the global shared memory pool for the current process after the -critical operations were performed inside the global shared memory pool. - -=item void *B(size_t I); - -Identical to the POSIX.1 malloc(3) function but instead of allocating -memory from the I it allocates it from the global shared memory pool. - -=item void B(void *I); - -Identical to the POSIX.1 free(3) function but instead of deallocating -memory in the I it deallocates it in the global shared memory pool. - -=item void *B(void *I, size_t I); - -Identical to the POSIX.1 realloc(3) function but instead of reallocating -memory in the I it reallocates it inside the global shared memory pool. - -=item void *B(size_t I, size_t I); - -Identical to the POSIX.1 calloc(3) function but instead of allocating and -initializing memory from the I it allocates and initializes it from the -global shared memory pool. - -=item char *B(const char *I); - -Identical to the POSIX.1 strdup(3) function but instead of creating the -string copy in the I it creates it in the global shared memory pool. - -=item size_t B(const void *I); - -This function returns the size in bytes of the chunk starting at I when -I was previously allocated with MM_malloc(3). The result is undefined -if I was not previously allocated with MM_malloc(3). - -=item size_t B(void); - -This function returns the maximum size which is allowed -as the first argument to the MM_create(3) function. - -=item size_t B(void); - -Returns the amount in bytes of still available (free) memory in the global -shared memory pool. - -=item char *B(void); - -Returns the last error message which occurred inside the B library. - -=back - -=head2 Standard Malloc-Style API - -=over 4 - -=item MM *B(size_t I, const char *I); - -This creates a shared memory pool which has space for approximately a total of -I bytes with the help of I. Here I is a filesystem path to a -file which need not to exist (and perhaps is never created because this -depends on the platform and chosen shared memory and mutex implementation). -The return value is a pointer to a C structure which should be treated as -opaque by the application. It describes the internals of the created shared -memory pool. In case of an error C is returned. A I of 0 means to -allocate the maximum allowed size which is platform dependent and is between a -few KB and the soft limit of 64MB. - -=item int B(MM *I, mode_t I, uid_t I, gid_t I); - -This sets the filesystem I, I and I for the shared memory -pool I (has effects only when the underlaying shared memory segment -implementation is actually based on external auxiliary files). The arguments -are directly passed through to chmod(2) and chown(2). - -=item void B(MM *I); - -This destroys the complete shared memory pool I and with it all chunks -which were allocated in this pool. Additionally any created files on the -filesystem corresponding the to shared memory pool are unlinked. - -=item int B(MM *I, mm_lock_mode I); - -This locks the shared memory pool I for the current process in order to -perform either shared/read-only (I is C) or -exclusive/read-write (I is C) critical operations inside the -global shared memory pool. - -=item int B(MM *I); - -This unlocks the shared memory pool I for the current process after -critical operations were performed inside the global shared memory pool. - -=item void *B(MM *I, size_t I); - -This function allocates I bytes from the shared memory pool I and -returns either a (virtual memory word aligned) pointer to it or C in -case of an error (out of memory). It behaves like the POSIX.1 malloc(3) -function but instead of allocating memory from the I it allocates it -from the shared memory segment underlaying I. - -=item void B(MM *I, void *I); - -This deallocates the chunk starting at I in the shared memory pool I. -It behaves like the POSIX.1 free(3) function but instead of deallocating -memory from the I it deallocates it from the shared memory segment -underlaying I. - -=item void *B(MM *I, void *I, size_t I); - -This function reallocates the chunk starting at I inside the shared -memory pool I with the new size of I bytes. It behaves like the -POSIX.1 realloc(3) function but instead of reallocating memory in the -I it reallocates it in the shared memory segment underlaying I. - -=item void *B(MM *I, size_t I, size_t I); - -This is similar to mm_malloc(3), but additionally clears the chunk. It behaves -like the POSIX.1 calloc(3) function. It allocates space for I -objects, each I bytes in length from the shared memory pool I. The -result is identical to calling mm_malloc(3) with an argument of ``I * -I'', with the exception that the allocated memory is initialized to nul -bytes. - -=item char *B(MM *I, const char *I); - -This function behaves like the POSIX.1 strdup(3) function. It allocates -sufficient memory inside the shared memory pool I for a copy of the string -I, does the copy, and returns a pointer to it. The pointer may -subsequently be used as an argument to the function mm_free(3). If -insufficient shared memory is available, C is returned. - -=item size_t B(const void *I); - -This function returns the size in bytes of the chunk starting at I when -I was previously allocated with mm_malloc(3). The result is undefined -when I was not previously allocated with mm_malloc(3). - -=item size_t B(void); - -This function returns the maximum size which is allowed as the first argument -to the mm_create(3) function. - -=item size_t B(MM *I); - -Returns the amount in bytes of still available (free) memory in the -shared memory pool I. - -=item char *B(void); - -Returns the last error message which occurred inside the B library. - -=item void B(MM *I); - -This is debugging function which displays a summary page for the shared memory -pool I describing various internal sizes and counters. - -=back - -=head2 Low-Level Shared Memory API - -=over 4 - -=item void *B(size_t I, const char *I); - -This creates a shared memory area which is at least I bytes in size with -the help of I. The value I has to be greater than 0 and less or -equal the value returned by mm_core_maxsegsize(3). Here I is a -filesystem path to a file which need not to exist (and perhaps is never -created because this depends on the platform and chosen shared memory and -mutex implementation). The return value is either a (virtual memory word -aligned) pointer to the shared memory segment or C in case of an error. -The application is guaranteed to be able to access the shared memory segment -from byte 0 to byte I-1 starting at the returned address. - -=item int B(void *I, mode_t I, uid_t I, gid_t I); - -This sets the filesystem I, I and I for the shared memory -segment I (has effects only when the underlaying shared memory segment -implementation is actually based on external auxiliary files). The arguments -are directly passed through to chmod(2) and chown(2). - -=item void B(void *I); - -This deletes a shared memory segment I (as previously returned by a -mm_core_create(3) call). After this operation, accessing the segment starting -at I is no longer allowed and will usually lead to a segmentation fault. - -=item int B(const void *I, mm_lock_mode I); - -This function acquires an advisory lock for the current process on the shared -memory segment I for either shared/read-only (I is C) -or exclusive/read-write (I is C) critical operations between -fork(2)'ed child processes. - -=item int B(const void *I); - -This function releases a previously acquired advisory lock for the current -process on the shared memory segment I. - -=item size_t B(const void *I); - -This returns the size in bytes of I. This size is exactly the size which -was used for creating the shared memory area via mm_core_create(3). The -function is provided just for convenience reasons to not require the -application to remember the memory size behind I itself. - -=item size_t B(void); - -This returns the number of bytes of a maximum-size shared memory segment which -is allowed to allocate via the MM library. It is between a few KB and the soft -limit of 64MB. - -=item size_t B(size_t I); - -This is just a utility function which can be used to align the number I -to the next virtual memory I boundary used by the underlaying platform. -The memory page boundary under Unix platforms is usually somewhere between -2048 and 16384 bytes. You do not have to align the I arguments of other -B library functions yourself, because this is already done internally. -This function is exported by the B library just for convenience reasons in -case an application wants to perform similar calculations for other purposes. - -=item size_t B(size_t I); - -This is another utility function which can be used to align the number I -to the next virtual memory I boundary used by the underlaying platform. -The memory word boundary under Unix platforms is usually somewhere between 4 -and 16 bytes. You do not have to align the I arguments of other B -library functions yourself, because this is already done internally. This -function is exported by the B library just for convenience reasons in case -an application wants to perform simular calculations for other purposes. - -=back - -=head2 Low-Level Shared Memory API - -=over 4 - -=item void B(unsigned int, const char *str); - -This is a function which is used internally by the various MM function to set -an error string. It's usually not called directly from applications. - -=item char *B(void); - -This is a function which is used internally by MM_error(3) and mm_error(3) -functions to get the current error string. It is usually not called directly -from applications. - -=item int B(void); - -This function returns a hex-value ``0xIIII'' which describes the -current B library version. I is the version, I the revisions, I -the level and I the type of the level (alphalevel=0, betalevel=1, -patchlevel=2, etc). For instance B version 1.0.4 is encoded as 0x100204. -The reason for this unusual mapping is that this way the version number is -steadily I. - -=back - -=head1 RESTRICTIONS - -The maximum size of a continuous shared memory segment one can allocate -depends on the underlaying platform. This cannot be changed, of course. But -currently the high-level malloc(3)-style API just uses a single shared memory -segment as the underlaying data structure for an C object which means that -the maximum amount of memory an C object represents also depends on the -platform. - -This should be changed in later versions by allowing at least the high-level -malloc(3)-style API to internally use multiple shared memory segments to form -the C object. This way C objects could have arbitrary sizes, although -the maximum size of an allocatable chunk still is bounded by the maximum size -of a shared memory segment. - -=head1 SEE ALSO - -mm-config(1). - -malloc(3), calloc(3), realloc(3), strdup(3), free(3), mmap(2), shmget(2), -shmctl(2), flock(2), fcntl(2), semget(2), semctl(2), semop(2). - -=head1 HOME - -=for html -http://www.engelschall.com/sw/mm/ - -=for text -http://www.engelschall.com/sw/mm/ - -=for man -http://www.engelschall.com/sw/mm/ - -=head1 HISTORY - -This library was originally written in January 1999 by I for use in the B (EAPI) -of the B HTTP server project (see www.apache.org), which was -originally invented for B (see http://www.modssl.org/). - -Its base idea (a malloc-style API for handling shared memory) was originally -derived from the non-publically available I library written in -October 1997 by I for MatchLogic, -Inc. - -=head1 AUTHOR - - Ralf S. Engelschall - rse@engelschall.com - www.engelschall.com - -=cut - diff --git a/shmem/unix/mm/mm_alloc.c b/shmem/unix/mm/mm_alloc.c deleted file mode 100644 index 6efcbfc21fe..00000000000 --- a/shmem/unix/mm/mm_alloc.c +++ /dev/null @@ -1,446 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by - * Ralf S. Engelschall ." - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by - * Ralf S. Engelschall ." - * - * THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - */ - -/* -** -** mm_alloc.c -- Standard Malloc-Style API -** -*/ - -#define MM_PRIVATE -#include "mm.h" - -/* - * Create a memory pool - */ -MM *mm_create(size_t usize, const char *file, int flag) -{ - MM *mm = NULL; - void *core; - size_t size; - size_t maxsize; - - /* defaults */ - maxsize = mm_maxsize(); - if (usize == 0) - usize = maxsize; - if (usize > maxsize) - usize = maxsize; - if (usize < MM_ALLOC_MINSIZE) - usize = MM_ALLOC_MINSIZE; - - if (flag & MM_ALLOCATE_ENOUGH) { - usize += sizeof(*mm); - } - - /* determine size */ - size = usize+SIZEOF_mem_pool; - - /* get a shared memory area */ - if ((core = mm_core_create(size, file)) == NULL) - return NULL; - - /* fill in the memory pool structure */ - mm = (MM *)core; - mm->mp_size = size; - mm->mp_offset = SIZEOF_mem_pool; - - /* first element of list of free chunks counts existing chunks */ - mm->mp_freechunks.mc_size = 0; - mm->mp_freechunks.mc_usize = 0; - mm->mp_freechunks.mc_u.mc_next = NULL; - - return mm; -} - -/* - * Set permissions on memory pools underlaying disk files - */ -int mm_permission(MM *mm, mode_t mode, uid_t owner, gid_t group) -{ - if (mm == NULL) - return -1; - return mm_core_permission((void *)mm, mode, owner, group); -} - -/* - * Destroy a memory pool - */ -void mm_destroy(MM *mm) -{ - if (mm == NULL) - return; - /* wipe out the whole area to be safe */ - memset(mm, 0, mm->mp_size); - /* and delete the core area */ - (void)mm_core_delete((void *)mm); - return; -} - -/* - * Lock a memory pool - */ -int mm_lock(MM *mm, mm_lock_mode mode) -{ - if (mm == NULL) - return FALSE; - return mm_core_lock((void *)mm, mode); -} - -/* - * Unlock a memory pool - */ -int mm_unlock(MM *mm) -{ - if (mm == NULL) - return FALSE; - return mm_core_unlock((void *)mm); -} - -/* - * Display debugging information - */ -void mm_display_info(MM *mm) -{ - mem_chunk *mc; - int nFree; - int nAlloc; - int i; - - if (!mm_core_lock((void *)mm, MM_LOCK_RD)) - return; - mc = &(mm->mp_freechunks); - nFree = 0; - while (mc->mc_u.mc_next != NULL) { - mc = mc->mc_u.mc_next; - nFree += mc->mc_size; - } - nAlloc = mm->mp_offset-SIZEOF_mem_pool-nFree; - - fprintf(stderr, "Information for MM\n"); - fprintf(stderr, " memory area = 0x%lx - 0x%lx\n", (unsigned long)mm, (unsigned long)(mm+mm->mp_size)); - fprintf(stderr, " memory size = %d\n", mm->mp_size); - fprintf(stderr, " memory offset = %d\n", mm->mp_offset); - fprintf(stderr, " bytes spare = %d\n", mm->mp_size-mm->mp_offset); - fprintf(stderr, " bytes free = %d (%d chunk%s)\n", - nFree, mm->mp_freechunks.mc_usize, - mm->mp_freechunks.mc_usize == 1 ? "" : "s"); - fprintf(stderr, " bytes allocated = %d\n", nAlloc); - - fprintf(stderr, " List of free chunks:\n"); - if (mm->mp_freechunks.mc_usize > 0) { - mc = &(mm->mp_freechunks); - i = 1; - while (mc->mc_u.mc_next != NULL) { - mc = mc->mc_u.mc_next; - fprintf(stderr, " chunk #%03d: 0x%lx-0x%lx (%d bytes)\n", - i++, (unsigned long)mc, (unsigned long)(mc+mc->mc_size), mc->mc_size); - } - } - else { - fprintf(stderr, " \n"); - } - mm_core_unlock((void *)mm); - return; -} - -/* - * Insert a chunk to the list of free chunks. Algorithm used is: - * Insert in sorted manner to the list and merge with previous - * and/or next chunk when possible to form larger chunks out of - * smaller ones. - */ -static void mm_insert_chunk(MM *mm, mem_chunk *mcInsert) -{ - mem_chunk *mc; - mem_chunk *mcPrev; - mem_chunk *mcNext; - - if (!mm_core_lock((void *)mm, MM_LOCK_RW)) - return; - mc = &(mm->mp_freechunks); - while (mc->mc_u.mc_next != NULL && (char *)(mc->mc_u.mc_next) < (char *)mcInsert) - mc = mc->mc_u.mc_next; - mcPrev = mc; - mcNext = mc->mc_u.mc_next; - if ((char *)mcPrev+mcPrev->mc_size == (char *)mcInsert && - (mcNext != NULL && (char *)mcInsert+mcInsert->mc_size == (char *)mcNext)) { - /* merge with previous and next chunk */ - mcPrev->mc_size += mcInsert->mc_size + mcNext->mc_size; - mcPrev->mc_u.mc_next = mcNext->mc_u.mc_next; - mm->mp_freechunks.mc_usize -= 1; - } - else if ((char *)mcPrev+mcPrev->mc_size == (char *)mcInsert) { - /* merge with previous chunk */ - mcPrev->mc_size += mcInsert->mc_size; - } - else if (mcNext != NULL && (char *)mcInsert+mcInsert->mc_size == (char *)mcNext) { - /* merge with next chunk */ - mcInsert->mc_size += mcNext->mc_size; - mcInsert->mc_u.mc_next = mcNext->mc_u.mc_next; - mcPrev->mc_u.mc_next = mcInsert; - } - else { - /* no merging possible, so insert as new chunk */ - mcInsert->mc_u.mc_next = mcNext; - mcPrev->mc_u.mc_next = mcInsert; - mm->mp_freechunks.mc_usize += 1; - } - mm_core_unlock((void *)mm); - return; -} - -/* - * Retrieve a chunk from the list of free chunks. Algorithm used - * is: Search for minimal-sized chunk which is larger or equal - * than the request size. But when the retrieved chunk is still a - * lot larger than the requested size, split out the requested - * size to not waste memory. - */ -static mem_chunk *mm_retrieve_chunk(MM *mm, size_t size) -{ - mem_chunk *mc; - mem_chunk **pmcMin; - mem_chunk *mcRes; - size_t sMin; - size_t s; - - if (mm->mp_freechunks.mc_usize == 0) - return NULL; - if (!mm_core_lock((void *)mm, MM_LOCK_RW)) - return NULL; - /* find best-fitting chunk */ - pmcMin = NULL; - sMin = mm->mp_size; /* maximum possible */ - mc = &(mm->mp_freechunks); - while (mc->mc_u.mc_next != NULL) { - s = mc->mc_u.mc_next->mc_size; - if (s >= size && s < sMin) { - pmcMin = &(mc->mc_u.mc_next); - sMin = s; - if (s == size) - break; - } - mc = mc->mc_u.mc_next; - } - /* create result chunk */ - if (pmcMin == NULL) - mcRes = NULL; - else { - mcRes = *pmcMin; - if (mcRes->mc_size >= (size + min_of(2*size,128))) { - /* split out in part */ - s = mcRes->mc_size - size; - mcRes->mc_size = size; - /* add back remaining chunk part as new chunk */ - mc = (mem_chunk *)((char *)mcRes + size); - mc->mc_size = s; - mc->mc_u.mc_next = mcRes->mc_u.mc_next; - *pmcMin = mc; - } - else { - /* split out as a whole */ - *pmcMin = mcRes->mc_u.mc_next; - mm->mp_freechunks.mc_usize--; - } - } - mm_core_unlock((void *)mm); - return mcRes; -} - -/* - * Allocate a chunk of memory - */ -void *mm_malloc(MM *mm, size_t usize) -{ - mem_chunk *mc; - size_t size; - void *vp; - - if (mm == NULL || usize == 0) - return NULL; - size = mm_core_align2word(SIZEOF_mem_chunk+usize); - if ((mc = mm_retrieve_chunk(mm, size)) != NULL) { - mc->mc_usize = usize; - return &(mc->mc_u.mc_base.mw_cp); - } - if (!mm_core_lock((void *)mm, MM_LOCK_RW)) - return NULL; - if ((mm->mp_size - mm->mp_offset) < size) { - mm_core_unlock((void *)mm); - ERR(MM_ERR_ALLOC, "Out of memory"); - errno = ENOMEM; - return NULL; - } - mc = (mem_chunk *)((char *)mm + mm->mp_offset); - mc->mc_size = size; - mc->mc_usize = usize; - vp = (void *)&(mc->mc_u.mc_base.mw_cp); - mm->mp_offset += size; - mm_core_unlock((void *)mm); - return vp; -} - -/* - * Reallocate a chunk of memory - */ -void *mm_realloc(MM *mm, void *ptr, size_t usize) -{ - size_t size; - mem_chunk *mc; - void *vp; - - if (mm == NULL || usize == 0) - return NULL; - if (ptr == NULL) - return mm_malloc(mm, usize); /* POSIX.1 semantics */ - mc = (mem_chunk *)((char *)ptr - SIZEOF_mem_chunk); - if (usize <= mc->mc_usize) { - mc->mc_usize = usize; - return ptr; - } - size = mm_core_align2word(SIZEOF_mem_chunk+usize); - if (size <= mc->mc_size) { - mc->mc_usize = usize; - return ptr; - } - if ((vp = mm_malloc(mm, usize)) == NULL) - return NULL; - memcpy(vp, ptr, usize); - mm_free(mm, ptr); - return vp; -} - -/* - * Free a chunk of memory - */ -void mm_free(MM *mm, void *ptr) -{ - mem_chunk *mc; - - if (mm == NULL || ptr == NULL) - return; - mc = (mem_chunk *)((char *)ptr - SIZEOF_mem_chunk); - mm_insert_chunk(mm, mc); - return; -} - -/* - * Allocate and initialize a chunk of memory - */ -void *mm_calloc(MM *mm, size_t number, size_t usize) -{ - void *vp; - - if (mm == NULL || number*usize == 0) - return NULL; - if ((vp = mm_malloc(mm, number*usize)) == NULL) - return NULL; - memset(vp, 0, number*usize); - return vp; -} - -/* - * Duplicate a string - */ -char *mm_strdup(MM *mm, const char *str) -{ - int n; - void *vp; - - if (mm == NULL || str == NULL) - return NULL; - n = strlen(str); - if ((vp = mm_malloc(mm, n+1)) == NULL) - return NULL; - memcpy(vp, str, n+1); - return vp; -} - -/* - * Determine user size of a memory chunk - */ -size_t mm_sizeof(MM *mm, const void *ptr) -{ - mem_chunk *mc; - - if (mm == NULL || ptr == NULL) - return -1; - mc = (mem_chunk *)((char *)ptr - SIZEOF_mem_chunk); - return mc->mc_usize; -} - -/* - * Determine maximum size of an allocateable memory pool - */ -size_t mm_maxsize(void) -{ - return (mm_core_maxsegsize()-SIZEOF_mem_pool); -} - -/* - * Determine available memory - */ -size_t mm_available(MM *mm) -{ - mem_chunk *mc; - int nFree; - - if (!mm_core_lock((void *)mm, MM_LOCK_RD)) - return 0; - nFree = mm->mp_size-mm->mp_offset; - mc = &(mm->mp_freechunks); - while (mc->mc_u.mc_next != NULL) { - mc = mc->mc_u.mc_next; - nFree += mc->mc_size; - } - mm_core_unlock((void *)mm); - return nFree; -} - -/* - * Return last error string - */ -char *mm_error(void) -{ - return mm_lib_error_get(); -} - -/*EOF*/ diff --git a/shmem/unix/mm/mm_conf.h.in b/shmem/unix/mm/mm_conf.h.in deleted file mode 100644 index e9d81f1a3d9..00000000000 --- a/shmem/unix/mm/mm_conf.h.in +++ /dev/null @@ -1,88 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by - * Ralf S. Engelschall ." - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by - * Ralf S. Engelschall ." - * - * THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - */ - -/* -** -** mm_conf.h -** -*/ - -#ifndef _MM_CONF_H_ -#define _MM_CONF_H_ - -/* VM Page Size Determination */ -#undef MM_VMPS_GETPAGESIZE -#undef MM_VMPS_SYSCONF -#undef MM_VMPS_BEOS - -/* Shared Memory Type */ -#undef MM_SHMT_MMANON -#undef MM_SHMT_MMPOSX -#undef MM_SHMT_MMZERO -#undef MM_SHMT_MMFILE -#undef MM_SHMT_IPCSHM -#undef MM_SHMT_BEOS - -/* Shared Memory Maximum Segment Size */ -#define MM_SHM_MAXSEGSIZE @MM_SHM_MAXSEGSIZE@ - -/* Semaphore Type */ -#undef MM_SEMT_FLOCK -#undef MM_SEMT_FCNTL -#undef MM_SEMT_IPCSEM -#undef MM_SEMT_BEOS - -/* Debugging */ -#undef MM_DEBUG - -/* Standard Autoconf stuff */ -#undef HAVE_MEMCPY -#undef HAVE_MEMSET -#undef HAVE_BCOPY -#undef HAVE_MEMORY_H -#undef MM_OS_SUNOS -#undef MM_OS_BS2000 -#undef HAVE_PATH_MAX -#undef HAVE__POSIX_PATH_MAX -#undef HAVE_MAXPATHLEN -#undef HAVE_UNION_SEMUN - -#endif /* _MM_CONF_H_ */ - diff --git a/shmem/unix/mm/mm_core.c b/shmem/unix/mm/mm_core.c deleted file mode 100644 index 4b9a62bd90b..00000000000 --- a/shmem/unix/mm/mm_core.c +++ /dev/null @@ -1,625 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by - * Ralf S. Engelschall ." - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by - * Ralf S. Engelschall ." - * - * THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - */ - -/* -** -** mm_core.c -- Low-level Shared Memory API -** -*/ - -#define MM_PRIVATE -#include "mm.h" - -/* - * Some global variables - */ - -#if defined(MM_SEMT_FCNTL) -/* lock/unlock structures for fcntl() */ -static struct flock mm_core_dolock_rd; -static struct flock mm_core_dolock_rw; -static struct flock mm_core_dounlock; -#endif - -#if defined(MM_SEMT_IPCSEM) -/* lock/unlock structures for semop() */ -static union semun mm_core_semctlarg; -static struct sembuf mm_core_dolock[2]; -static struct sembuf mm_core_dounlock[1]; -#endif - -#if defined(MM_SHMT_MMFILE) || defined(MM_SHMT_MMPOSX) -static size_t mm_core_mapoffset = 0; /* we use own file */ -#elif defined(MM_SHMT_MMZERO) -static size_t mm_core_mapoffset = 1024*1024*1; /* we share with other apps */ -#endif - -static void mm_core_init(void) -{ - static int initialized = FALSE; - if (!initialized) { -#if defined(MM_SEMT_FCNTL) - mm_core_dolock_rd.l_whence = SEEK_SET; /* from current point */ - mm_core_dolock_rd.l_start = 0; /* -"- */ - mm_core_dolock_rd.l_len = 0; /* until end of file */ - mm_core_dolock_rd.l_type = F_RDLCK; /* set shard/read lock */ - mm_core_dolock_rd.l_pid = 0; /* pid not actually interesting */ - mm_core_dolock_rw.l_whence = SEEK_SET; /* from current point */ - mm_core_dolock_rw.l_start = 0; /* -"- */ - mm_core_dolock_rw.l_len = 0; /* until end of file */ - mm_core_dolock_rw.l_type = F_WRLCK; /* set exclusive/read-write lock */ - mm_core_dolock_rw.l_pid = 0; /* pid not actually interesting */ - mm_core_dounlock.l_whence = SEEK_SET; /* from current point */ - mm_core_dounlock.l_start = 0; /* -"- */ - mm_core_dounlock.l_len = 0; /* until end of file */ - mm_core_dounlock.l_type = F_UNLCK; /* unlock */ - mm_core_dounlock.l_pid = 0; /* pid not actually interesting */ -#endif -#if defined(MM_SEMT_IPCSEM) - mm_core_dolock[0].sem_num = 0; - mm_core_dolock[0].sem_op = 0; - mm_core_dolock[0].sem_flg = 0; - mm_core_dolock[1].sem_num = 0; - mm_core_dolock[1].sem_op = 1; - mm_core_dolock[1].sem_flg = SEM_UNDO; - mm_core_dounlock[0].sem_num = 0; - mm_core_dounlock[0].sem_op = -1; - mm_core_dounlock[0].sem_flg = SEM_UNDO; -#endif - initialized = TRUE; - } - return; -} - -#if defined(MM_SEMT_FLOCK) -/* - * Determine per-process fd for semaphore - * (needed only for flock() based semaphore) - */ -static int mm_core_getfdsem(mem_core *mc) -{ - int fd = -1; - pid_t pid; - int i; - - pid = getpid(); - for (i = 0; i < MM_MAXCHILD && - mc->mc_fdsem[i].pid != 0 && - mc->mc_fdsem[i].fd != -1; i++) { - if (mc->mc_fdsem[i].pid == pid) { - fd = mc->mc_fdsem[i].fd; - break; - } - } - if (fd == -1 && i < MM_MAXCHILD) { - fd = open(mc->mc_fnsem, O_WRONLY, MM_CORE_FILEMODE); - mc->mc_fdsem[i].pid = getpid(); - mc->mc_fdsem[i].fd = fd; - } - return fd; -} -#endif /* MM_SEMT_FLOCK */ - -/* - * Determine memory page size of OS - */ - -static size_t mm_core_pagesize(void) -{ - static int pagesize = 0; - if (pagesize == 0) -#if defined(MM_VMPS_GETPAGESIZE) - pagesize = getpagesize(); -#elif defined(MM_VMPS_SYSCONF) - pagesize = sysconf(_SC_PAGESIZE); -#elif defined(MM_VMPS_BEOS) - pagesize = B_PAGE_SIZE; -#else - pagesize = MM_CORE_DEFAULT_PAGESIZE; -#endif - return pagesize; -} - -/* - * Align a size to the next page or word boundary - */ - -size_t mm_core_align2page(size_t size) -{ - int psize = mm_core_pagesize(); - return ((size)%(psize) > 0 ? ((size)/(psize)+1)*(psize) : (size)); -} - -size_t mm_core_align2word(size_t size) -{ - return ((1+((size-1) / SIZEOF_mem_word)) * SIZEOF_mem_word); -} - -size_t mm_core_maxsegsize(void) -{ - return mm_core_align2page((MM_SHM_MAXSEGSIZE-SIZEOF_mem_core)-mm_core_pagesize()); -} - -/* - * Create a shared memory area - */ - -void *mm_core_create(size_t usersize, const char *file) -{ - mem_core *mc; - void *area = ((void *)-1); - int fdmem = 0; - int fdsem = 0; -#if defined(MM_SEMT_IPCSEM) - int fdsem_rd = 0; -#endif -#if defined(MM_SHMT_MMPOSX) || defined(MM_SHMT_MMFILE) - char *fnmem; -#endif -#if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL) - char *fnsem; -#endif - size_t size; -#if defined(MM_SHMT_MMZERO) || defined(MM_SHMT_MMPOSX) || defined(MM_SHMT_MMFILE) - int zero = 0; -#endif -#if defined(MM_SHMT_IPCSHM) - struct shmid_ds shmbuf; -#endif -#if defined(MM_SHMT_MMPOSX) || defined(MM_SHMT_MMFILE) - char shmfilename[MM_MAXPATH]; -#endif -#if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL) - char semfilename[MM_MAXPATH]; -#endif -#if defined(MM_SHMT_BEOS) - area_id temparea; -#endif - char filename[MM_MAXPATH]; - - if (usersize <= 0 || usersize > mm_core_maxsegsize()) { - errno = EINVAL; - return NULL; - } - if (file == NULL) { - sprintf(filename, MM_CORE_DEFAULT_FILE, (int)getpid()); - file = filename; - } - - mm_core_init(); - size = mm_core_align2page(usersize+SIZEOF_mem_core); - -#if defined(MM_SHMT_MMPOSX) || defined(MM_SHMT_MMFILE) - sprintf(shmfilename, "%s.mem", file); - fnmem = shmfilename; -#endif -#if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL) - sprintf(semfilename, "%s.sem", file); - fnsem = semfilename; -#endif - -#if defined(MM_SHMT_MMANON) - if ((area = (void *)mmap(NULL, size, PROT_READ|PROT_WRITE, - MAP_ANON|MAP_SHARED, -1, 0)) == (void *)MAP_FAILED) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to memory map anonymous area"); -#endif /* MM_SHMT_MMANON */ - -#if defined(MM_SHMT_BEOS) - if ((temparea = create_area("mm", (void*)&area, B_ANY_ADDRESS, - size, B_LAZY_LOCK, B_READ_AREA|B_WRITE_AREA)) < 0) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to create the memory area"); -#endif /* MM_SHMT_BEOS */ - -#if defined(MM_SHMT_MMPOSX) - shm_unlink(fnmem); /* Ok when it fails */ - if ((fdmem = shm_open(fnmem, O_RDWR|O_CREAT, MM_CORE_FILEMODE)) == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to open tempfile"); - if (ftruncate(fdmem, mm_core_mapoffset+size) == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to truncate tempfile"); - write(fdmem, &zero, sizeof(zero)); - if ((area = (void *)mmap(NULL, size, PROT_READ|PROT_WRITE, - MAP_SHARED, fdmem, mm_core_mapoffset)) == (void *)MAP_FAILED) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to memory map tempfile"); - shm_unlink(fnmem); - mm_core_mapoffset += size; -#endif /* MM_SHMT_MMPOSX */ - -#if defined(MM_SHMT_MMZERO) - if ((fdmem = open("/dev/zero", O_RDWR, MM_CORE_FILEMODE)) == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to open /dev/zero"); - if (lseek(fdmem, mm_core_mapoffset+size, SEEK_SET) == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to seek in /dev/zero"); - write(fdmem, &zero, sizeof(zero)); - if ((area = (void *)mmap(NULL, size, PROT_READ|PROT_WRITE, - MAP_SHARED, fdmem, mm_core_mapoffset)) == (void *)MAP_FAILED) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to memory map /dev/zero"); - mm_core_mapoffset += size; -#endif /* MM_SHMT_MMZERO */ - -#if defined(MM_SHMT_MMFILE) - unlink(fnmem); - if ((fdmem = open(fnmem, O_RDWR|O_CREAT, MM_CORE_FILEMODE)) == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to open memory file"); - if (ftruncate(fdmem, mm_core_mapoffset+size) == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to truncate memory file"); - write(fdmem, &zero, sizeof(zero)); - if ((area = (void *)mmap(NULL, size, PROT_READ|PROT_WRITE, - MAP_SHARED, fdmem, mm_core_mapoffset)) == (void *)MAP_FAILED) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to memory map memory file"); - mm_core_mapoffset += size; -#endif /* MM_SHMT_MMFILE */ - -#if defined(MM_SHMT_IPCSHM) - if ((fdmem = shmget(IPC_PRIVATE, size, (SHM_R|SHM_W|IPC_CREAT))) == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to acquire shared memory segment"); - if ((area = (void *)shmat(fdmem, NULL, 0)) == ((void *)-1)) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to attach shared memory"); - if (shmctl(fdmem, IPC_STAT, &shmbuf) == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to get status of shared memory"); - shmbuf.shm_perm.uid = getuid(); - shmbuf.shm_perm.gid = getgid(); - if (shmctl(fdmem, IPC_SET, &shmbuf) == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to set status of shared memory"); - if (shmctl(fdmem, IPC_RMID, NULL) == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to remove shared memory in advance"); -#endif /* MM_SHMT_IPCSHM */ - -#if defined(MM_SEMT_FLOCK) - unlink(fnsem); - if ((fdsem = open(fnsem, O_RDWR|O_CREAT, MM_CORE_FILEMODE)) == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to open semaphore file"); -#endif /* MM_SEMT_FLOCK */ - -#if defined(MM_SEMT_FCNTL) - unlink(fnsem); - if ((fdsem = open(fnsem, O_RDWR|O_CREAT, MM_CORE_FILEMODE)) == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to open semaphore file"); -#endif /* MM_SEMT_FCNTL */ - -#if defined(MM_SEMT_IPCSEM) - fdsem = semget(IPC_PRIVATE, 1, IPC_CREAT|IPC_EXCL|S_IRUSR|S_IWUSR); - if (fdsem == -1 && errno == EEXIST) - fdsem = semget(IPC_PRIVATE, 1, IPC_EXCL|S_IRUSR|S_IWUSR); - if (fdsem == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to acquire semaphore"); - mm_core_semctlarg.val = 0; - semctl(fdsem, 0, SETVAL, mm_core_semctlarg); - fdsem_rd = semget(IPC_PRIVATE, 1, IPC_CREAT|IPC_EXCL|S_IRUSR|S_IWUSR); - if (fdsem_rd == -1 && errno == EEXIST) - fdsem_rd = semget(IPC_PRIVATE, 1, IPC_EXCL|S_IRUSR|S_IWUSR); - if (fdsem_rd == -1) - FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to acquire semaphore"); - mm_core_semctlarg.val = 0; - semctl(fdsem_rd, 0, SETVAL, mm_core_semctlarg); -#endif /* MM_SEMT_IPCSEM */ - - /* - * Configure the memory core parameters - */ - mc = (mem_core *)area; - mc->mc_size = size; - mc->mc_usize = usersize; - mc->mc_pid = getpid(); - mc->mc_fdmem = fdmem; -#if defined(MM_SEMT_FLOCK) - mc->mc_fdsem[0].pid = getpid(); - mc->mc_fdsem[0].fd = fdsem; - mc->mc_fdsem[1].pid = 0; - mc->mc_fdsem[1].fd = -1; -#else - mc->mc_fdsem = fdsem; -#endif -#if defined(MM_SEMT_BEOS) - mc->mc_semid = create_sem(0, "mm_semid"); - mc->mc_ben = 0; -#endif -#if defined(MM_SHMT_BEOS) - mc->mc_areaid = temparea; -#endif -#if defined(MM_SEMT_IPCSEM) - mc->mc_fdsem_rd = fdsem_rd; - mc->mc_readers = 0; -#endif -#if defined(MM_SHMT_MMFILE) - memcpy(mc->mc_fnmem, fnmem, MM_MAXPATH); -#endif -#if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL) - memcpy(mc->mc_fnsem, fnsem, MM_MAXPATH); -#endif - - /* - * Return successfully established core - */ - return ((void *)&(mc->mc_base.mw_cp)); - - /* - * clean-up sequence (CUS) for error situation - */ - BEGIN_FAILURE -#if defined(MM_SHMT_MMANON) || defined(MM_SHMT_MMZERO) || defined(MM_SHMT_MMPOSX) || defined(MM_SHMT_MMFILE) - if (area != ((void *)-1)) - munmap((caddr_t)area, size); -#endif -#if defined(MM_SHMT_IPCSHM) - if (area != ((void *)-1)) - shmdt(area); -#endif -#if defined(MM_SHMT_MMPOSX) || defined(MM_SHMT_MMFILE) - if (fdmem != -1) - close(fdmem); -#endif -#if defined(MM_SEMT_BEOS) - delete_sem(mc->mc_semid); -#endif -#if defined(MM_SHMT_BEOS) - delete_area(mc->mc_areaid); -#endif -#if defined(MM_SHMT_IPCSHM) - if (fdmem != -1) - shmctl(fdmem, IPC_RMID, NULL); -#endif -#if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL) - if (fdsem != -1) - close(fdsem); -#endif -#if defined(MM_SEMT_IPCSEM) - if (fdsem != -1) - semctl(fdsem, 0, IPC_RMID, 0); - if (fdsem_rd != -1) - semctl(fdsem_rd, 0, IPC_RMID, 0); -#endif -#if defined(MM_SHMT_MMFILE) - unlink(fnmem); -#endif -#if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL) - unlink(fnsem); -#endif - return NULL; - END_FAILURE -} - -int mm_core_permission(void *core, mode_t mode, uid_t owner, gid_t group) -{ - int rc; - mem_core *mc; - - if (core == NULL) - return -1; - mc = (mem_core *)((char *)core-SIZEOF_mem_core); - rc = 0; -#if defined(MM_SHMT_MMFILE) - if (rc == 0 && chmod(mc->mc_fnmem, mode) < 0) - rc = -1; - if (rc == 0 && chown(mc->mc_fnmem, owner, group) < 0) - rc = -1; -#endif -#if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL) - if (rc == 0 && chmod(mc->mc_fnsem, mode) < 0) - rc = -1; - if (rc == 0 && chown(mc->mc_fnsem, owner, group) < 0) - rc = -1; -#endif - return rc; -} - -void mm_core_delete(void *core) -{ - mem_core *mc; - int fdmem; - int fdsem; -#if defined(MM_SEMT_IPCSEM) - int fdsem_rd; -#endif - size_t size; -#if defined(MM_SHMT_MMFILE) - char fnmem[MM_MAXPATH]; -#endif -#if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL) - char fnsem[MM_MAXPATH]; -#endif - - if (core == NULL) - return; - mc = (mem_core *)((char *)core-SIZEOF_mem_core); - size = mc->mc_size; - fdmem = mc->mc_fdmem; -#if !defined(MM_SEMT_FLOCK) - fdsem = mc->mc_fdsem; -#endif -#if defined(MM_SEMT_IPCSEM) - fdsem_rd = mc->mc_fdsem_rd; -#endif -#if defined(MM_SEMT_FLOCK) - fdsem = mm_core_getfdsem(mc); -#endif -#if defined(MM_SHMT_MMFILE) - memcpy(fnmem, mc->mc_fnmem, MM_MAXPATH); -#endif -#if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL) - memcpy(fnsem, mc->mc_fnsem, MM_MAXPATH); -#endif - -#if defined(MM_SHMT_MMANON) || defined(MM_SHMT_MMPOSX) || defined(MM_SHMT_MMZERO) || defined(MM_SHMT_MMFILE) - munmap((caddr_t)mc, size); -#endif -#if defined(MM_SHMT_IPCSHM) - shmdt((void *)mc); - shmctl(fdmem, IPC_RMID, NULL); -#endif -#if defined(MM_SHMT_MMPOSX) || defined(MM_SHMT_MMZERO) || defined(MM_SHMT_MMFILE) - close(fdmem); -#endif -#if defined(MM_SHMT_MMFILE) - unlink(fnmem); -#endif -#if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL) - close(fdsem); -#endif -#if defined(MM_SEMT_FLOCK) || defined(MM_SEMT_FCNTL) - unlink(fnsem); -#endif -#if defined(MM_SEMT_IPCSEM) - semctl(fdsem, 0, IPC_RMID, 0); - semctl(fdsem_rd, 0, IPC_RMID, 0); -#endif - return; -} - -size_t mm_core_size(const void *core) -{ - mem_core *mc; - - if (core == NULL) - return 0; - mc = (mem_core *)((char *)core-SIZEOF_mem_core); - return (mc->mc_usize); -} - -int mm_core_lock(const void *core, mm_lock_mode mode) -{ - mem_core *mc; - int rc; - int fdsem; - - if (core == NULL) - return FALSE; - mc = (mem_core *)((char *)core-SIZEOF_mem_core); -#if !defined(MM_SEMT_FLOCK) - fdsem = mc->mc_fdsem; -#endif -#if defined(MM_SEMT_FLOCK) - fdsem = mm_core_getfdsem(mc); -#endif - -#if defined(MM_SEMT_FCNTL) - if (mode == MM_LOCK_RD) - while (((rc = fcntl(fdsem, F_SETLKW, &mm_core_dolock_rd)) < 0) && (errno == EINTR)) ; - else - while (((rc = fcntl(fdsem, F_SETLKW, &mm_core_dolock_rw)) < 0) && (errno == EINTR)) ; -#endif -#if defined(MM_SEMT_FLOCK) - if (mode == MM_LOCK_RD) - while (((rc = flock(fdsem, LOCK_SH)) < 0) && (errno == EINTR)) ; - else - while (((rc = flock(fdsem, LOCK_EX)) < 0) && (errno == EINTR)) ; -#endif -#if defined(MM_SEMT_IPCSEM) - if (mode == MM_LOCK_RD) { - while (((rc = semop(mc->mc_fdsem_rd, mm_core_dolock, 2)) < 0) && (errno == EINTR)) ; - mc->mc_readers++; - if (mc->mc_readers == 1) - while (((rc = semop(fdsem, mm_core_dolock, 2)) < 0) && (errno == EINTR)) ; - while (((rc = semop(mc->mc_fdsem_rd, mm_core_dounlock, 1)) < 0) && (errno == EINTR)) ; - } - else { - while (((rc = semop(fdsem, mm_core_dolock, 2)) < 0) && (errno == EINTR)) ; - } - mc->mc_lockmode = mode; -#endif -#if defined(MM_SEMT_BEOS) - rc = 0; - if (atomic_add(&mc->mc_ben, 1) > 0) { - /* someone already in lock... acquire sem and wait */ - if (acquire_sem(mc->mc_semid) != B_NO_ERROR) { - atomic_add(&mc->mc_ben, -1); - rc = -1; - } - } -#endif - - if (rc < 0) { - ERR(MM_ERR_CORE|MM_ERR_SYSTEM, "Failed to lock"); - rc = FALSE; - } - else - rc = TRUE; - return rc; -} - -int mm_core_unlock(const void *core) -{ - mem_core *mc; - int rc; - int fdsem; - - if (core == NULL) - return FALSE; - mc = (mem_core *)((char *)core-SIZEOF_mem_core); -#if !defined(MM_SEMT_FLOCK) - fdsem = mc->mc_fdsem; -#endif -#if defined(MM_SEMT_FLOCK) - fdsem = mm_core_getfdsem(mc); -#endif - -#if defined(MM_SEMT_FCNTL) - while (((rc = fcntl(fdsem, F_SETLKW, &mm_core_dounlock)) < 0) && (errno == EINTR)) ; -#endif -#if defined(MM_SEMT_FLOCK) - while (((rc = flock(fdsem, LOCK_UN)) < 0) && (errno == EINTR)) ; -#endif -#if defined(MM_SEMT_IPCSEM) - if (mc->mc_lockmode == MM_LOCK_RD) { - while (((rc = semop(mc->mc_fdsem_rd, mm_core_dolock, 2)) < 0) && (errno == EINTR)) ; - mc->mc_readers--; - if (mc->mc_readers == 0) - while (((rc = semop(fdsem, mm_core_dounlock, 1)) < 0) && (errno == EINTR)) ; - while (((rc = semop(mc->mc_fdsem_rd, mm_core_dounlock, 1)) < 0) && (errno == EINTR)) ; - } - else { - while (((rc = semop(fdsem, mm_core_dounlock, 1)) < 0) && (errno == EINTR)) ; - } -#endif -#if defined(MM_SEMT_BEOS) - rc = 0; - if (atomic_add(&mc->mc_ben, -1) > 1) - release_sem(mc->mc_semid); -#endif - - if (rc < 0) { - ERR(MM_ERR_CORE|MM_ERR_SYSTEM, "Failed to unlock"); - rc = FALSE; - } - else - rc = TRUE; - return rc; -} - -/*EOF*/ diff --git a/shmem/unix/mm/mm_global.c b/shmem/unix/mm/mm_global.c deleted file mode 100644 index 6f9967fea10..00000000000 --- a/shmem/unix/mm/mm_global.c +++ /dev/null @@ -1,151 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by - * Ralf S. Engelschall ." - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by - * Ralf S. Engelschall ." - * - * THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - */ - -/* -** -** mm_global.c -- Global Malloc-Replacement API -** -*/ - -#define MM_PRIVATE -#include "mm.h" - -static MM *mm_global = NULL; - -int MM_create(size_t size, const char *file) -{ - if (mm_global != NULL) - return FALSE; - if ((mm_global = mm_create(size, file, MM_ALLOCATE_EXACT)) == NULL) - return FALSE; - return TRUE; -} - -int MM_permission(mode_t mode, uid_t owner, gid_t group) -{ - if (mm_global != NULL) - return -1; - return mm_permission(mm_global, mode, owner, group); -} - -void MM_destroy(void) -{ - if (mm_global == NULL) - return; - mm_destroy(mm_global); - mm_global = NULL; - return; -} - -int MM_lock(mm_lock_mode mode) -{ - if (mm_global == NULL) - return FALSE; - return mm_lock(mm_global, mode); -} - -int MM_unlock(void) -{ - if (mm_global == NULL) - return FALSE; - return mm_unlock(mm_global); -} - -void *MM_malloc(size_t size) -{ - if (mm_global == NULL) - return NULL; - return mm_malloc(mm_global, size); -} - -void *MM_realloc(void *ptr, size_t size) -{ - if (mm_global == NULL) - return NULL; - return mm_realloc(mm_global, ptr, size); -} - -void MM_free(void *ptr) -{ - if (mm_global == NULL) - return; - mm_free(mm_global, ptr); - return; -} - -void *MM_calloc(size_t number, size_t size) -{ - if (mm_global == NULL) - return NULL; - return mm_calloc(mm_global, number, size); -} - -char *MM_strdup(const char *str) -{ - if (mm_global == NULL) - return NULL; - return mm_strdup(mm_global, str); -} - -size_t MM_sizeof(const void *ptr) -{ - if (mm_global == NULL) - return -1; - return mm_sizeof(mm_global, ptr); -} - -size_t MM_maxsize(void) -{ - return mm_maxsize(); -} - -size_t MM_available(void) -{ - if (mm_global == NULL) - return -1; - return mm_available(mm_global); -} - -char *MM_error(void) -{ - return mm_lib_error_get(); -} - -/*EOF*/ diff --git a/shmem/unix/mm/mm_lib.c b/shmem/unix/mm/mm_lib.c deleted file mode 100644 index 967c336ff3a..00000000000 --- a/shmem/unix/mm/mm_lib.c +++ /dev/null @@ -1,114 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by - * Ralf S. Engelschall ." - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by - * Ralf S. Engelschall ." - * - * THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - */ - -/* -** -** mm_lib.c -- Internal Library API -** -*/ - -#define MM_PRIVATE -#include "mm.h" - -/* - * Error Handling - */ - -#define MM_LIB_ERROR_MAXLEN 1024 -static char mm_lib_error[MM_LIB_ERROR_MAXLEN+1] = { NUL }; - -void mm_lib_error_set(unsigned int type, const char *str) -{ - int l, n; - char *cp; - - if (str == NULL) { - mm_lib_error[0] = NUL; - return; - } - if (type & MM_ERR_ALLOC) - strcpy(mm_lib_error, "mm:alloc: "); - else if (type & MM_ERR_CORE) - strcpy(mm_lib_error, "mm:core: "); - l = strlen(mm_lib_error); - n = strlen(str); - if (n > MM_LIB_ERROR_MAXLEN-l) - n = MM_LIB_ERROR_MAXLEN-l; - memcpy(mm_lib_error+l, str, n+1); - l += n; - if (type & MM_ERR_SYSTEM && errno != 0) { - if (MM_LIB_ERROR_MAXLEN-l > 2) { - strcpy(mm_lib_error+l, " ("); - l += 2; - } - cp = strerror(errno); - n = strlen(cp); - if (n > MM_LIB_ERROR_MAXLEN-l) - n = MM_LIB_ERROR_MAXLEN-l; - memcpy(mm_lib_error+l, cp, n+1); - l += n; - if (MM_LIB_ERROR_MAXLEN-l > 1) { - strcpy(mm_lib_error+l, ")"); - l += 1; - } - } - *(mm_lib_error+l) = NUL; - return; -} - -char *mm_lib_error_get(void) -{ - if (mm_lib_error[0] == NUL) - return NULL; - return mm_lib_error; -} - -/* - * Version Information - */ - -#define _AS_HEADER -#include "mm_vers.c" - -int mm_lib_version(void) -{ - return MM_Version; -} - diff --git a/shmem/unix/mm/mm_test.c b/shmem/unix/mm/mm_test.c deleted file mode 100644 index 922529bf0b6..00000000000 --- a/shmem/unix/mm/mm_test.c +++ /dev/null @@ -1,265 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by - * Ralf S. Engelschall ." - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by - * Ralf S. Engelschall ." - * - * THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - */ - -/* -** -** mm_test.c -- Test Suite for MM Library -** -*/ - -#include -#include -#include -#include -#include - -#define MM_PRIVATE -#include "mm.h" - -#define FAILED_IF(expr) \ - if (expr) { \ - char *e; \ - e = mm_error(); \ - fprintf(stderr, "%s\n", e != NULL ? e : "Unknown Error"); \ - exit(1); \ - } - -int main(int argc, char *argv[]) -{ - char *core; - int i; - size_t s, s2; - pid_t pid; - int size; - MM *mm; - int n; - char *cp[1025]; - int version; - struct count_test { int count; int prev; } *ct; - - setbuf(stderr, NULL); - - /* - ** - ** Test Global Library API - ** - */ - - fprintf(stderr, "\n*** TESTING GLOBAL LIBRARY API ***\n\n"); - - fprintf(stderr, "Fetching library version\n"); - version = mm_lib_version(); - FAILED_IF(version == 0x0); - fprintf(stderr, "version = 0x%X\n", version); - - /* - ** - ** Test Low-Level Shared Memory API - ** - */ - - fprintf(stderr, "\n*** TESTING LOW-LEVEL SHARED MEMORY API ***\n"); - - fprintf(stderr, "\n=== Testing Memory Segment Access ===\n"); - - fprintf(stderr, "Creating 16KB shared memory core area\n"); - core = mm_core_create(1024*16, NULL); - FAILED_IF(core == NULL); - s = mm_core_size(core); - FAILED_IF(s == 0); - fprintf(stderr, "actually allocated core size = %d\n", s); - - fprintf(stderr, "Writing 0xF5 bytes to shared memory core area\n"); - for (i = 0; i < s; i++) { - fprintf(stderr, "write to core[%06d]\r", i); - core[i] = 0xF5; - } - fprintf(stderr, "\n"); - - fprintf(stderr, "Reading back 0xF5 bytes from shared memory core area\n"); - for (i = 0; i < s; i++) { - fprintf(stderr, "read from core[%06d]\r", i); - if (core[i] != (char)0xF5) { - fprintf(stderr, "Offset %d: 0xF5 not found (found 0x%X\n", i, core[i]); - exit(0); - } - } - fprintf(stderr, "\n"); - - fprintf(stderr, "Destroying shared memory core area\n"); - mm_core_delete(core); - - fprintf(stderr, "\n=== Testing Memory Locking ===\n"); - - fprintf(stderr, "Creating small shared memory core area\n"); - ct = mm_core_create(sizeof(struct count_test), NULL); - FAILED_IF(ct == NULL); - s = mm_core_size(ct); - FAILED_IF(s == 0); - fprintf(stderr, "actually allocated core size = %d\n", s); - - ct->prev = 0; - ct->count = 1; - if ((pid = fork()) == 0) { - /* child */ - while (ct->count < 32768) { - if (!mm_core_lock(ct, MM_LOCK_RW)) { - fprintf(stderr, "locking failed (child)\n"); - FAILED_IF(1); - } - if (ct->prev != (ct->count-1)) { - fprintf(stderr, "Failed, prev=%d != count=%d\n", ct->prev, ct->count); - exit(1); - } - ct->count += 1; - fprintf(stderr, "count=%06d (child )\r", ct->count); - ct->prev += 1; - if (!mm_core_unlock(ct)) { - fprintf(stderr, "locking failed (child)\n"); - FAILED_IF(1); - } - } - exit(0); - } - /* parent ... */ - while (ct->count < 32768) { - if (!mm_core_lock(ct, MM_LOCK_RW)) { - fprintf(stderr, "locking failed (parent)\n"); - FAILED_IF(1); - } - if (ct->prev != (ct->count-1)) { - fprintf(stderr, "Failed, prev=%d != count=%d\n", ct->prev, ct->count); - exit(1); - } - ct->count += 1; - fprintf(stderr, "count=%06d (parent)\r", ct->count); - ct->prev += 1; - if (!mm_core_unlock(ct)) { - fprintf(stderr, "locking failed (parent)\n"); - kill(pid, SIGTERM); - FAILED_IF(1); - } - } - waitpid(pid, NULL, 0); - fprintf(stderr, "\n"); - - fprintf(stderr, "Destroying shared memory core area\n"); - mm_core_delete(ct); - - /* - ** - ** Test Standard Malloc-style API - ** - */ - - fprintf(stderr, "\n*** TESTING STANDARD MALLOC-STYLE API ***\n"); - - fprintf(stderr, "\n=== Testing Allocation ===\n"); - - fprintf(stderr, "Creating MM object\n"); - size = mm_maxsize(); - if (size > 1024*1024*1) - size = 1024*1024*1; - mm = mm_create(size, NULL, MM_ALLOCATE_EXACT); - FAILED_IF(mm == NULL) - mm_display_info(mm); - s = mm_available(mm); - FAILED_IF(s == 0); - fprintf(stderr, "actually available bytes = %d\n", s); - - fprintf(stderr, "Allocating areas inside MM\n"); - n = 0; - for (i = 0; i < 1024; i++) - cp[i] = NULL; - for (i = 0; i < 1024; i++) { - fprintf(stderr, "total=%09d allocated=%09d add=%06d\r", s, n, (i+1)*(i+1)); - s2 = mm_available(mm); - if ((i+1)*(i+1) > s2) { - cp[i] = mm_malloc(mm, (i+1)*(i+1)); - if (cp[i] != NULL) { - fprintf(stderr, "\nExpected an out of memory situation. Hmmmmm\n"); - FAILED_IF(1); - } - break; - } - cp[i] = mm_malloc(mm, (i+1)*(i+1)); - n += (i+1)*(i+1); - FAILED_IF(cp[i] == NULL) - memset(cp[i], 0xF5, (i+1)*(i+1)); - } - mm_display_info(mm); - - fprintf(stderr, "\n=== Testing Defragmentation ===\n"); - - fprintf(stderr, "Fragmenting memory area by freeing some selected areas\n"); - for (i = 0; i < 1024; i++) { - if (i % 2 == 0) - continue; - if (cp[i] != NULL) - mm_free(mm, cp[i]); - cp[i] = NULL; - } - mm_display_info(mm); - - fprintf(stderr, "Freeing all areas\n"); - for (i = 0; i < 1024; i++) { - mm_free(mm, cp[i]); - } - mm_display_info(mm); - - fprintf(stderr, "Checking for memory leaks\n"); - s2 = mm_available(mm); - if (s != s2) { - fprintf(stderr, "Something is leaking, we've lost %d bytes\n", s - s2); - FAILED_IF(1); - } - else { - fprintf(stderr, "Fine, we have again %d bytes available\n", s2); - } - - fprintf(stderr, "Destroying MM object\n"); - mm_destroy(mm); - - /******/ - - fprintf(stderr, "\nOK - ALL TESTS SUCCESSFULLY PASSED.\n\n"); - exit(0); -} - diff --git a/shmem/unix/mm/mm_vers.c b/shmem/unix/mm/mm_vers.c deleted file mode 100644 index 706beb5478e..00000000000 --- a/shmem/unix/mm/mm_vers.c +++ /dev/null @@ -1,32 +0,0 @@ -/* -** mm_vers.c -- Version Information -** [automatically generated and maintained by GNU shtool] -*/ - -#ifdef _AS_HEADER - -#ifndef _MM_VERS_C -#define _MM_VERS_C -#define MM_VERSION 0x101201 -extern const int MM_Version; -extern const char MM_VersionStr[]; -extern const char MM_Hello[]; -extern const char MM_GNUVersion[]; -extern const char MM_WhatID[]; -extern const char MM_RCSIdentID[]; -extern const char MM_WebID[]; -extern const char MM_PlainID[]; -#endif /* _MM_VERS_C */ - -#else - -const int MM_Version = 0x101201; -const char MM_VersionStr[] = "1.1.1 (30-Apr-2000)"; -const char MM_Hello[] = "This is MM, Version 1.1.1 (30-Apr-2000)"; -const char MM_GNUVersion[] = "MM Version 1.1.1"; -const char MM_WhatID[] = "@(#)MM Version 1.1.1 (30-Apr-2000)"; -const char MM_RCSIdentID[] = "$Id: mm_vers.c,v 1.3 2000/05/03 17:15:49 rbb Exp $"; -const char MM_WebID[] = "MM/1.1.1"; -const char MM_PlainID[] = "1.1.1"; - -#endif diff --git a/shmem/unix/mm/shtool b/shmem/unix/mm/shtool deleted file mode 100755 index 183a3185bf6..00000000000 --- a/shmem/unix/mm/shtool +++ /dev/null @@ -1,1239 +0,0 @@ -#!/bin/sh -## -## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-2000 Ralf S. Engelschall -## -## See http://www.gnu.org/software/shtool/ for more information. -## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. -## -## Version 1.4.9 (16-Apr-2000) -## Ingredients: 6/17 available modules -## - -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -## USA, or contact Ralf S. Engelschall . -## -## Notice: Given that you include this file verbatim into your own -## source tree, you are justified in saying that it remains separate -## from your package, and that this way you are simply just using GNU -## shtool. So, in this situation, there is no requirement that your -## package itself is licensed under the GNU General Public License in -## order to take advantage of GNU shtool. -## - -## -## Usage: shtool [] [ [] []] -## -## Available commands: -## echo Print string with optional construct expansion -## install Install a program, script or datafile -## mkdir Make one or more directories -## fixperm Fix file permissions inside a source tree -## tarball Roll distribution tarballs -## version Generate and maintain a version information file -## -## Not available commands (because module was not built-in): -## mdate Pretty-print modification time of a file or dir -## table Pretty-print a field-separated list as a table -## prop Display progress with a running propeller -## move Move files with simultaneous substitution -## mkln Make link with calculation of relative paths -## mkshadow Make a shadow tree through symbolic links -## guessos Simple operating system guesser -## arx Extended archive command -## slo Separate linker options by library class -## scpp Sharing C Pre-Processor -## path Deal with program paths -## - -if [ $# -eq 0 ]; then - echo "$0:Error: invalid command line" 1>&2 - echo "$0:Hint: run \`$0 -h' for usage" 1>&2 - exit 1 -fi -if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.4.9 (16-Apr-2000)" - echo "Copyright (c) 1994-2000 Ralf S. Engelschall " - echo "Report bugs to " - echo '' - echo "Usage: shtool [] [ [] []]" - echo '' - echo 'Available global :' - echo ' -v, --version display shtool version information' - echo ' -h, --help display shtool usage help page (this one)' - echo ' -d, --debug display shell trace information' - echo '' - echo 'Available [] []:' - echo ' echo [-n] [-e] [ ...]' - echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] ' - echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' - echo ' fixperm [-v] [-t] [ ...]' - echo ' tarball [-t] [-v] [-o ] [-c ] [-d ] [-u' - echo ' ] [-g ] [-e ] [ ...]' - echo ' version [-l] [-n] [-p] [-s] [-i]' - echo ' [-d] ' - echo '' - echo 'Not available (because module was not built-in):' - echo ' mdate [-n] [-z] [-s] [-d] [-f] [-o] ' - echo ' table [-F] [-w] [-c] [-s] ...' - echo ' prop [-p]' - echo ' move [-v] [-t] [-e] [-p] ' - echo ' mkln [-t] [-f] [-s] [ ...] ' - echo ' mkshadow [-v] [-t] [-a] ' - echo ' guessos ' - echo ' arx [-t] [-C] [ ...]' - echo ' slo [-p] -- -L -l [-L -l ...]' - echo ' scpp [-v] [-p] [-f] [-o] [-t] [-M]' - echo ' [-D] [-C] [ ...]' - echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' - echo '' - exit 0 -fi -if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.4.9 (16-Apr-2000)" - exit 0 -fi -if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then - shift - set -x -fi -name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'` -case "$name" in - echo|install|mkdir|fixperm|tarball|version ) - # implicit tool command selection - tool="$name" - ;; - * ) - # explicit tool command selection - tool="$1" - shift - ;; -esac -arg_spec="" -opt_spec="" -gen_tmpfile=no - -## -## DISPATCH INTO SCRIPT PROLOG -## - -case $tool in - echo ) - str_tool="echo" - str_usage="[-n] [-e] [ ...]" - arg_spec="0+" - opt_spec="n.e." - opt_n=no - opt_e=no - ;; - install ) - str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] " - arg_spec="2=" - opt_spec="v.t.c.C.s.m:o:g:e:" - opt_v=no - opt_t=no - opt_c=no - opt_C=no - opt_s=no - opt_m="" - opt_o="" - opt_g="" - opt_e="" - ;; - mkdir ) - str_tool="mkdir" - str_usage="[-t] [-f] [-p] [-m] [ ...]" - arg_spec="1+" - opt_spec="t.f.p.m:" - opt_t=no - opt_f=no - opt_p=no - opt_m="" - ;; - fixperm ) - str_tool="fixperm" - str_usage="[-v] [-t] [ ...]" - arg_spec="1+" - opt_spec="v.t." - opt_v=no - opt_t=no - ;; - tarball ) - str_tool="tarball" - str_usage="[-t] [-v] [-o ] [-c ] [-d ] [-u ] [-g ] [-e ] [ ...]" - gen_tmpfile=yes - arg_spec="1+" - opt_spec="t.v.o:c:d:u:g:e:" - opt_t=no - opt_v=no - opt_o="" - opt_c="" - opt_d="" - opt_u="" - opt_g="" - opt_e="CVS,\\.cvsignore,\\.[oa]\$" - ;; - version ) - str_tool="version" - str_usage="[-l] [-n] [-p] [-s] [-i] [-d] " - arg_spec="1+" - opt_spec="l:n:p:s:i:d:" - opt_l="txt" - opt_n="unknown" - opt_p="unknown" - opt_s="unknown" - opt_i="P" - opt_d="NO" - gen_tmpfile=yes - ;; - -* ) - echo "$0:Error: unknown option \`$tool'" 2>&1 - echo "$0:Hint: run \`$0 -h' for usage" 2>&1 - exit 1 - ;; - * ) - echo "$0:Error: unknown command \`$tool'" 2>&1 - echo "$0:Hint: run \`$0 -h' for usage" 2>&1 - exit 1 - ;; -esac - -## -## COMMON UTILITY CODE -## - -# determine name of tool -if [ ".$tool" != . ]; then - # used inside shtool script - toolcmd="$0 $tool" - toolcmdhelp="shtool $tool" - msgprefix="shtool:$tool" -else - # used as standalone script - toolcmd="$0" - toolcmdhelp="sh $0" - msgprefix="$str_tool" -fi - -# parse argument specification string -eval `echo $arg_spec |\ - sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'` - -# parse option specification string -eval `echo h.$opt_spec |\ - sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'` - -# interate over argument line -opt_PREV='' -while [ $# -gt 0 ]; do - # special option stops processing - if [ ".$1" = ".--" ]; then - shift - break - fi - - # determine option and argument - opt_ARG_OK=no - if [ ".$opt_PREV" != . ]; then - # merge previous seen option with argument - opt_OPT="$opt_PREV" - opt_ARG="$1" - opt_ARG_OK=yes - opt_PREV='' - else - # split argument into option and argument - case "$1" in - -[a-zA-Z0-9]*) - eval `echo "x$1" |\ - sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \ - -e 's/";\(.*\)$/"; opt_ARG="\1"/'` - ;; - -[a-zA-Z0-9]) - opt_OPT=`echo "x$1" | cut -c3-` - opt_ARG='' - ;; - *) - break - ;; - esac - fi - - # eat up option - shift - - # determine whether option needs an argument - eval "opt_MODE=\$opt_MODE_${opt_OPT}" - if [ ".$opt_ARG" = . -a ".$opt_ARG_OK" != .yes ]; then - if [ ".$opt_MODE" = ".:" -o ".$opt_MODE" = ".+" ]; then - opt_PREV="$opt_OPT" - continue - fi - fi - - # process option - case $opt_MODE in - '.' ) - # boolean option - eval "opt_${opt_OPT}=yes" - ;; - ':' ) - # option with argument (multiple occurances override) - eval "opt_${opt_OPT}=\"\$opt_ARG\"" - ;; - '+' ) - # option with argument (multiple occurances append) - eval "opt_${opt_OPT}=\"\$opt_${opt_OPT} \$opt_ARG\"" - ;; - * ) - echo "$msgprefix:Error: unknown option: \`-$opt_OPT'" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 - exit 1 - ;; - esac -done -if [ ".$opt_PREV" != . ]; then - echo "$msgprefix:Error: missing argument to option \`-$opt_PREV'" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 - exit 1 -fi - -# process help option -if [ ".$opt_h" = .yes ]; then - echo "Usage: $toolcmdhelp $str_usage" - exit 0 -fi - -# complain about incorrect number of arguments -case $arg_MODE in - '=' ) - if [ $# -ne $arg_NUMS ]; then - echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 - exit 1 - fi - ;; - '+' ) - if [ $# -lt $arg_NUMS ]; then - echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 - exit 1 - fi - ;; -esac - -# establish a temporary file on request -if [ ".$gen_tmpfile" = .yes ]; then - if [ ".$TMPDIR" != . ]; then - tmpdir="$TMPDIR" - elif [ ".$TEMPDIR" != . ]; then - tmpdir="$TEMPDIR" - else - tmpdir="/tmp" - fi - tmpfile="$tmpdir/.shtool.$$" - rm -f $tmpfile >/dev/null 2>&1 - touch $tmpfile -fi - -## -## DISPATCH INTO SCRIPT BODY -## - -case $tool in - -echo ) - ## - ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-2000 Ralf S. Engelschall - ## Originally written for WML as buildinfo - ## - - text="$*" - - # check for broken escape sequence expansion - seo='' - bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" != .3 ]; then - bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - seo='-E' - fi - fi - - # check for existing -n option (to suppress newline) - minusn='' - bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - minusn='-n' - fi - - # determine terminal bold sequence - term_bold='' - term_norm='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then - case $TERM in - # for the most important terminal types we directly know the sequences - xterm|xterm*|vt220|vt220*) - term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' /dev/null` - ;; - vt100|vt100*) - term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' /dev/null` - ;; - # for all others, we try to use a possibly existing `tput' or `tcout' utility - * ) - paths=`echo $PATH | sed -e 's/:/ /g'` - for tool in tput tcout; do - for dir in $paths; do - if [ -r "$dir/$tool" ]; then - for seq in bold md smso; do # 'smso' is last - bold="`$dir/$tool $seq 2>/dev/null`" - if [ ".$bold" != . ]; then - term_bold="$bold" - break - fi - done - if [ ".$term_bold" != . ]; then - for seq in sgr0 me rmso reset; do # 'reset' is last - norm="`$dir/$tool $seq 2>/dev/null`" - if [ ".$norm" != . ]; then - term_norm="$norm" - break - fi - done - fi - break - fi - done - if [ ".$term_bold" != . -a ".$term_norm" != . ]; then - break; - fi - done - ;; - esac - if [ ".$term_bold" = . -o ".$term_norm" = . ]; then - echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2 - fi - fi - - # determine user name - username='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uU]'`" != . ]; then - username="$LOGNAME" - if [ ".$username" = . ]; then - username="$USER" - if [ ".$username" = . ]; then - username="`(whoami) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username="`(who am i) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username='unknown' - fi - fi - fi - fi - fi - - # determine user id - userid='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%U'`" != . ]; then - userid="`(id -u) 2>/dev/null`" - if [ ".$userid" = . ]; then - str="`(id) 2>/dev/null`" - if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then - userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*//'` - fi - if [ ".$userid" = . ]; then - userid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid=`(ypcat passwd) 2>/dev/null | - egrep "^${username}:" | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid='?' - fi - fi - fi - fi - fi - - # determine host name - hostname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then - hostname="`(uname -n) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname="`(hostname) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname='unknown' - fi - fi - case $hostname in - *.* ) - domainname=".`echo $hostname | cut -d. -f2-`" - hostname="`echo $hostname | cut -d. -f1`" - ;; - esac - fi - - # determine domain name - domainname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then - if [ ".$domainname" = . ]; then - if [ -f /etc/resolv.conf ]; then - domainname="`egrep '^[ ]*domain' /etc/resolv.conf | head -1 |\ - sed -e 's/.*domain//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - if [ ".$domainname" = . ]; then - domainname="`egrep '^[ ]*search' /etc/resolv.conf | head -1 |\ - sed -e 's/.*search//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/ .*//' -e 's/ .*//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - fi - fi - fi - fi - - # determine current time - time_day='' - time_month='' - time_year='' - time_monthname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[DMYm]'`" != . ]; then - time_day=`date '+%d'` - time_month=`date '+%m'` - time_year=`date '+%Y' 2>/dev/null` - if [ ".$time_year" = . ]; then - time_year=`date '+%y'` - case $time_year in - [5-9][0-9]) time_year="19$time_year" ;; - [0-4][0-9]) time_year="20$time_year" ;; - esac - fi - case $time_month in - 1|01) time_monthname='Jan' ;; - 2|02) time_monthname='Feb' ;; - 3|03) time_monthname='Mar' ;; - 4|04) time_monthname='Apr' ;; - 5|05) time_monthname='May' ;; - 6|06) time_monthname='Jun' ;; - 7|07) time_monthname='Jul' ;; - 8|08) time_monthname='Aug' ;; - 9|09) time_monthname='Sep' ;; - 10) time_monthname='Oct' ;; - 11) time_monthname='Nov' ;; - 12) time_monthname='Dec' ;; - esac - fi - - # expand special ``%x'' constructs - if [ ".$opt_e" = .yes ]; then - text=`echo $seo "$text" |\ - sed -e "s/%B/${term_bold}/g" \ - -e "s/%b/${term_norm}/g" \ - -e "s/%u/${username}/g" \ - -e "s/%U/${userid}/g" \ - -e "s/%h/${hostname}/g" \ - -e "s/%d/${domainname}/g" \ - -e "s/%D/${time_day}/g" \ - -e "s/%M/${time_month}/g" \ - -e "s/%Y/${time_year}/g" \ - -e "s/%m/${time_monthname}/g" 2>/dev/null` - fi - - # create output - if [ .$opt_n = .no ]; then - echo $seo "$text" - else - # the harder part: echo -n is best, because - # awk may complain about some \xx sequences. - if [ ".$minusn" != . ]; then - echo $seo $minusn "$text" - else - echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text" - fi - fi - ;; - -install ) - ## - ## install -- Install a program, script or datafile - ## Copyright (c) 1997-2000 Ralf S. Engelschall - ## Originally written for shtool - ## - - src="$1" - dst="$2" - - # If destination is a directory, append the input filename - if [ -d $dst ]; then - dst=`echo "$dst" | sed -e 's:/$::'` - dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` - dst="$dst/$dstfile" - fi - - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" - fi - - # Check for correct arguments - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: source and destination are the same" 1>&2 - exit 1 - fi - - # Make a temp file name in the destination directory - dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - dsttmp="$dstdir/#INST@$$#" - - # Verbosity - if [ ".$opt_v" = .yes ]; then - echo "$src -> $dst" 1>&2 - fi - - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) - if [ ".$opt_C" = .yes ]; then - opt_c=yes - fi - if [ ".$opt_c" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "cp $src $dsttmp" 1>&2 - fi - cp $src $dsttmp || exit $? - else - if [ ".$opt_t" = .yes ]; then - echo "mv $src $dsttmp" 1>&2 - fi - mv $src $dsttmp || exit $? - fi - - # Adjust the target file - # (we do chmod last to preserve setuid bits) - if [ ".$opt_s" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "strip $dsttmp" 1>&2 - fi - strip $dsttmp || exit $? - fi - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $dsttmp" 1>&2 - fi - chown $opt_o $dsttmp || exit $? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $dsttmp" 1>&2 - fi - chgrp $opt_g $dsttmp || exit $? - fi - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $dsttmp" 1>&2 - fi - chmod $opt_m $dsttmp || exit $? - fi - - # Determine whether to do a quick install - # (has to be done _after_ the strip was already done) - quick=no - if [ ".$opt_C" = .yes ]; then - if [ -r $dst ]; then - if cmp -s $src $dst; then - quick=yes - fi - fi - fi - - # Finally install the file to the real destination - if [ $quick = yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dsttmp" 1>&2 - fi - rm -f $dsttmp - else - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dst && mv $dsttmp $dst" 1>&2 - fi - rm -f $dst && mv $dsttmp $dst - fi - ;; - -mkdir ) - ## - ## mkdir -- Make one or more directories - ## Copyright (c) 1996-2000 Ralf S. Engelschall - ## Originally written for public domain by Noah Friedman - ## Cleaned up and enhanced for shtool - ## - - errstatus=0 - for p in ${1+"$@"}; do - # if the directory already exists... - if [ -d "$p" ]; then - if [ ".$opt_f" = .no ]; then - echo "$msgprefix:Error: directory already exists: $p" 1>&2 - errstatus=1 - break - else - continue - fi - fi - # if the directory has to be created... - if [ ".$opt_p" = .no ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $p" 1>&2 - fi - mkdir $p || errstatus=$? - else - # the smart situation - set fnord `echo ":$p" |\ - sed -e 's/^:\//%/' \ - -e 's/^://' \ - -e 's/\// /g' \ - -e 's/^%/\//'` - shift - pathcomp='' - for d in ${1+"$@"}; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp="./$pathcomp" ;; - esac - if [ ! -d "$pathcomp" ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $pathcomp" 1>&2 - fi - mkdir $pathcomp || errstatus=$? - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $pathcomp" 1>&2 - fi - chmod $opt_m $pathcomp || errstatus=$? - fi - fi - pathcomp="$pathcomp/" - done - fi - done - exit $errstatus - ;; - -fixperm ) - ## - ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-2000 Ralf S. Engelschall - ## Originally written for ePerl - ## - - paths="$*" - - # check whether the test command supports the -x option - if [ -x /bin/sh ] 2>/dev/null; then - minusx="-x" - else - minusx="-r" - fi - - # iterate over paths - for p in $paths; do - for file in `find $p -depth -print`; do - if [ -f $file ]; then - if [ $minusx $file ]; then - if [ ".$opt_v" = .yes ]; then - echo "-rwxrwxr-x $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 775 $file" 2>&1 - fi - chmod 775 $file - else - if [ ".$opt_v" = .yes ]; then - echo "-rw-rw-r-- $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 664 $file" 2>&1 - fi - chmod 664 $file - fi - continue - fi - if [ -d $file ]; then - if [ ".$opt_v" = .yes ]; then - echo "drwxrwxr-x $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 775 $file" 2>&1 - fi - chmod 775 $file - continue - fi - if [ ".$opt_v" = .yes ]; then - echo "?????????? $file" 2>&1 - fi - done - done - ;; - -tarball ) - ## - ## tarball -- Roll distribution tarballs - ## Copyright (c) 1999-2000 Ralf S. Engelschall - ## Originally written for shtool - ## - - srcs="$*" - - # check whether the test command supports the -x option - if [ -x /bin/sh ] 2>/dev/null; then - minusx="-x" - else - minusx="-r" - fi - - # find the tools - paths="`echo $PATH |\ - sed -e 's%/*:%:%g' -e 's%/*$%%' \ - -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \ - -e 's/:/ /g'`" - for spec in find:gfind,find tar:gtar,tar tardy:tardy,tarcust; do - prg=`echo $spec | sed -e 's/:.*$//'` - tools=`echo $spec | sed -e 's/^.*://'` - eval "prg_${prg}=''" - # iterate over tools - for tool in `echo $tools | sed -e 's/,/ /g'`; do - # iterate over paths - for path in $paths; do - if [ $minusx "$path/$tool" ] && [ ! -d "$path/$tool" ]; then - eval "prg_${prg}=\"$path/$tool\"" - break - fi - done - eval "val=\$prg_${prg}" - if [ ".$val" != . ]; then - break - fi - done - done - - # expand source paths - exclude='' - for pat in `echo $opt_e | sed 's/,/ /g'`; do - exclude="$exclude | grep -v '$pat'" - done - if [ ".$opt_t" = .yes ]; then - echo "cp /dev/null $tmpfile.lst" 1>&2 - fi - cp /dev/null $tmpfile.lst - for src in $srcs; do - if [ -d $src ]; then - if [ ".$opt_t" = .yes ]; then - echo "(cd $src && $prg_find . -type f -depth -print) | sed -e 's:^\\.\$::' -e 's:^\\./::' | cat $exclude >>$tmpfile.lst" 1>&2 - fi - (cd $src && find . -type f -depth -print) |\ - sed -e 's:^\.$::' -e 's:^\./::' | eval cat $exclude >>$tmpfile.lst - else - if [ ".$opt_t" = .yes ]; then - echo "echo $src >>$tmpfile.lst" 1>&2 - fi - echo $src >>$tmpfile.lst - fi - done - sort <$tmpfile.lst >$tmpfile.lst.n - mv $tmpfile.lst.n $tmpfile.lst - if [ ".$opt_v" = .yes ]; then - cat $tmpfile.lst | sed -e 's/^/ /' 1>&2 - fi - - # determine tarball file and directory name - if [ ".$opt_o" != . ]; then - tarfile="$opt_o" - if [ ".$opt_d" != . ]; then - tarname="$opt_d" - else - tarname=`echo $tarfile | sed -e 's/\.tar.*$//' -e 's;.*/\([^/]*\)$;\1;'` - fi - else - if [ ".$opt_d" != . ]; then - tarname="$opt_d" - elif [ -d "$from" ]; then - tarname=`echo $from | sed -e 's;.*/\([^/]*\)$;\1;'` - else - tarname="out" - fi - tarfile="$tarname.tar" - fi - - # roll the tarball - compress='' - if [ ".$opt_c" != . ]; then - compress="| $opt_c" - fi - if [ ".$prg_tardy" != . ]; then - # the elegant hackers way - tardy_opt="--prefix=$tarname" - tardy_opt="$tardy_opt --user_number=0 --group_number=0" # security! - if [ ".$opt_u" != . ]; then - tardy_opt="$tardy_opt --user_name=$opt_u" - fi - if [ ".$opt_g" != . ]; then - tardy_opt="$tardy_opt --group_name=$opt_g" - fi - if [ ".$opt_t" = .yes ]; then - echo "cat $tmpfile.lst | xargs $prg_tar cf - | $prg_tardy $tardy_opt | cat $compress >$tmpfile.out" 1>&2 - fi - cat $tmpfile.lst |\ - xargs $prg_tar cf - |\ - $prg_tardy $tardy_opt |\ - eval cat $compress >$tmpfile.out - if [ ".$opt_t" = .yes ]; then - echo "cp $tmpfile.out $tarfile" 1>&2 - fi - cp $tmpfile.out $tarfile - else - # the portable standard way - if [ ".$opt_t" = .yes ]; then - echo "mkdir $tmpdir/$tarname" 1>&2 - fi - mkdir $tmpdir/$tarname || exit 1 - if [ ".$opt_t" = .yes ]; then - echo "cat $tmpfile.lst | xargs $prg_tar cf - | (cd $tmpdir/$tarname && $prg_tar xf -)" 1>&2 - fi - cat $tmpfile.lst |\ - xargs $prg_tar cf - |\ - (cd $tmpdir/$tarname && $prg_tar xf -) - if [ ".$opt_u" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1" 2>&1 - fi - chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1 ||\ - echo "$msgprefix:Warning: cannot set user name \`$opt_u' (would require root priviledges)" - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1" 2>&1 - fi - chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1 ||\ - echo "$msgprefix:Warning: cannot set group name \`$opt_g' (would require root priviledges)" - fi - if [ ".$opt_t" = .yes ]; then - echo "(cd $tmpdir && $prg_find $tarname -type f -depth -print | sort | xargs $prg_tar cf -) | cat $compress >$tmpfile.out" 1>&2 - fi - (cd $tmpdir && $prg_find $tarname -type f -depth -print | sort | xargs $prg_tar cf -) |\ - eval cat $compress >$tmpfile.out - if [ ".$opt_t" = .yes ]; then - echo "cp $tmpfile.out $tarfile" 1>&2 - fi - cp $tmpfile.out $tarfile - if [ ".$opt_t" = .yes ]; then - echo "rm -rf $tmpdir/$tarname" 1>&2 - fi - rm -rf $tmpdir/$tarname - fi - - # cleanup - if [ ".$opt_t" = .yes ]; then - echo "rm -f $tmpfile.lst $tmpfile.out" 1>&2 - fi - rm -f $tmpfile.lst $tmpfile.out - ;; - -version ) - ## - ## version -- Generate and maintain a version information file - ## Copyright (c) 1994-2000 Ralf S. Engelschall - ## Originally written for ePerl - ## - - LANGUAGE="$opt_l" - NAME="$opt_n" - PREFIX="$opt_p" - FULLVERSION="$opt_s" - INCREASE="$opt_i" - REPORT="$opt_d" - FILE="$1" - - # determine language - if [ ".$LANGUAGE" = .unknown ]; then - case $FILE in - *.txt ) LANGUAGE=txt ;; - *.c ) LANGUAGE=c ;; - *.pl | *.pm ) LANGUAGE=perl ;; - * ) echo "$tool:Error: unknown language type" 1>&2; exit 1 ;; - esac - fi - - # determine prefix from name and vice versa - if [ ".$PREFIX" = . -o ".$PREFIX" = .unknown ]; then - if [ ".$NAME" != . -a ".$NAME" != .unknown ]; then - PREFIX="$NAME" - fi - fi - if [ ".$NAME" = . -o ".$NAME" = .unknown ]; then - if [ ".$PREFIX" != . -a ".$PREFIX" != .unknown ]; then - NAME="$PREFIX" - fi - fi - - # determine version - date=unknown - version=0 - revision=0 - bplevel=0 - if [ ".$FULLVERSION" = .unknown ]; then - if [ -r "$FILE" ]; then - # grep out current information - id=`grep 'Version [0-9]*.[0-9]*[.abps][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $FILE | \ - head -1 | \ - sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\1:\2:\3:\4:\5%'` - version=`echo $id | awk -F: '{ print $1 }'` - revision=`echo $id | awk -F: '{ print $2 }'` - bptype=`echo $id | awk -F: '{ print $3 }'` - bplevel=`echo $id | awk -F: '{ print $4 }'` - date=`echo $id | awk -F: '{ print $5 }'` - if [ .$REPORT = .NO ]; then - case $INCREASE in - b ) bplevel=`expr $bplevel + 1` - bptype=b - ;; - a ) bplevel=`expr $bplevel + 1` - bptype=a - ;; - s ) bplevel=`expr $bplevel + 1` - bptype=s - ;; - P ) bplevel=`expr $bplevel + 1` - bptype=. - ;; - p ) bplevel=`expr $bplevel + 1` - bptype=p - ;; - r ) revision=`expr $revision + 1` - bptype=. - bplevel=0 - ;; - v ) version=`expr $version + 1` - revision=0 - bptype=. - bplevel=0 - ;; - esac - date=calc - fi - FULLVERSION="$version.$revision$bptype$bplevel" - else - # intialise to first version - version=0 - revision=5 - bptype=b - bplevel=0 - date=calc - fi - else - # take given version - V=`echo $FULLVERSION | sed -e 's%\([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\).*%\1:\2:\3:\4%'` - version=`echo $V | awk -F: '{ print $1 }'` - revision=`echo $V | awk -F: '{ print $2 }'` - bptype=`echo $V | awk -F: '{ print $3 }'` - bplevel=`echo $V | awk -F: '{ print $4 }'` - date=calc - fi - - # determine hex value of version - case $FULLVERSION in - *.*a* ) - HEX=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*a//' | awk '{ printf("0%02d", $1); }'` - ;; - *.*b* ) - HEX=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*b//' | awk '{ printf("1%02d", $1); }'` - ;; - *.*.* ) - HEX=`echo "$FULLVERSION" | awk -F. '{ printf("%d%02d2%02d", $1, $2, $3); }'` - ;; - esac - - # determine libtool version - case $FULLVERSION in - *.*a* ) - LTV=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*b* ) - LTV=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*.* ) - LTV=`echo "$FULLVERSION" | awk -F. '{ printf("%d:%d", $1*10+$2, $3); }'` - ;; - esac - - # determine string out of filename - # (don't try to optimize this in any way - portability!) - FILESTR=`echo "$FILE" |\ - tr 'abcdefghijklmnopqrstuvwxyz./%+' \ - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` - - # determine date - if [ ".$date" = .calc ]; then - day=`date '+%d'` - month=`date '+%m'` - year=`date '+%Y' 2>/dev/null` - if [ ".$time_year" = . ]; then - year=`date '+%y'` - case $year in - [5-9][0-9]) year="19$year" ;; - [0-4][0-9]) year="20$year" ;; - esac - fi - case $month in - 1|01) month='Jan' ;; - 2|02) month='Feb' ;; - 3|03) month='Mar' ;; - 4|04) month='Apr' ;; - 5|05) month='May' ;; - 6|06) month='Jun' ;; - 7|07) month='Jul' ;; - 8|08) month='Aug' ;; - 9|09) month='Sep' ;; - 10) month='Oct' ;; - 11) month='Nov' ;; - 12) month='Dec' ;; - esac - date="${day}-${month}-${year}" - fi - - if [ .$REPORT != .NO ]; then - case $REPORT in - long ) - echo "$version.$revision$bptype$bplevel ($date)" - ;; - short ) - echo "$version.$revision$bptype$bplevel" - ;; - libtool ) - echo "$LTV" - ;; - hex ) - echo "0x$HEX" - ;; - esac - rm -f $tmpfile >/dev/null 2>&1 - exit 0 - fi - - # create the version file according the the selected language - echo "new version: $version.$revision$bptype$bplevel ($date)" - case $LANGUAGE in - txt ) - cat >$tmpfile <<'EOT' - - This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@) -EOT - ;; - c ) - cat >$tmpfile <<'EOT' -/* -** @FILE@ -- Version Information -** [automatically generated and maintained by GNU shtool] -*/ - -#ifdef _AS_HEADER - -#ifndef _@FILESTR@ -#define _@FILESTR@ -#define @PREFIX@_VERSION 0x@HEX@ -extern const int @PREFIX@_Version; -extern const char @PREFIX@_VersionStr[]; -extern const char @PREFIX@_Hello[]; -extern const char @PREFIX@_GNUVersion[]; -extern const char @PREFIX@_WhatID[]; -extern const char @PREFIX@_RCSIdentID[]; -extern const char @PREFIX@_WebID[]; -extern const char @PREFIX@_PlainID[]; -#endif /* _@FILESTR@ */ - -#else - -const int @PREFIX@_Version = 0x@HEX@; -const char @PREFIX@_VersionStr[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_Hello[] = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_GNUVersion[] = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_WhatID[] = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_RCSIdentID[] = "$Id: shtool,v 1.5 2000/05/03 17:15:49 rbb Exp $"; -const char @PREFIX@_WebID[] = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_PlainID[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -#endif -EOT - ;; - perl ) - cat >$tmpfile <<'EOT' -## -## @FILE@ -- Version Information -## [automatically generated and maintained by GNU shtool] -## - -$@PREFIX@_Version = 0x@HEX@; -$@PREFIX@_VersionStr = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_Hello = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_GNUVersion = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_WhatID = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_RCSIdentID = "\$Id: shtool,v 1.5 2000/05/03 17:15:49 rbb Exp $/"; -$@PREFIX@_WebID = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_PlainID = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -1; -EOT - ;; - esac - - # now create the version file - rm -f $FILE >/dev/null 2>&1 - sed \ - -e "s|@FILE@|$FILE|g" \ - -e "s|@FILESTR@|$FILESTR|g" \ - -e "s|@PREFIX@|$PREFIX|g" \ - -e "s|@NAME@|$NAME|g" \ - -e "s|@HEX@|$HEX|g" \ - -e "s|@VERSION@|$version|g" \ - -e "s|@REVISION@|$revision|g" \ - -e "s|@BPTYPE@|$bptype|g" \ - -e "s|@BPLEVEL@|$bplevel|g" \ - -e "s|@YEAR@|$year|g" \ - -e "s|@MONTH@|$month|g" \ - -e "s|@DAY@|$day|g" <$tmpfile >$FILE - rm -f $tmpfile >/dev/null 2>&1 - exit 0 - ;; - -esac - -exit 0 - -##EOF## From 90dc10fb6f8685fce804db6f1e5781e28a5ec1f9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 24 Aug 2001 01:45:39 +0000 Subject: [PATCH 2217/7878] The **dir should be advanced over the leading 'root' (/+). Returning a path is APR_SUCCESS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62215 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 22eb45ee455..a93291d3ead 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -102,8 +102,10 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, if (**inpath == '/') { *rootpath = apr_pstrdup(p, "/"); - ++*inpath; - return APR_EABSOLUTE; + do { + ++(*inpath); + } while (*inpath == '/'); + return APR_SUCCESS; } return APR_ERELATIVE; From 4cea71a50ad4f9865108eca9b229b612f99636cd Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Fri, 24 Aug 2001 01:53:45 +0000 Subject: [PATCH 2218/7878] Yep, httpd serves pages again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62216 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index a93291d3ead..c7ae8ca5ff5 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -104,7 +104,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, *rootpath = apr_pstrdup(p, "/"); do { ++(*inpath); - } while (*inpath == '/'); + } while (**inpath == '/'); return APR_SUCCESS; } From 59965f6ea93e3c037aaba663ae63e9204c0dde52 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 24 Aug 2001 03:28:49 +0000 Subject: [PATCH 2219/7878] Never used, now never useful git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62217 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 - libapr.dsp | 4 - misc/win32/names.c | 319 --------------------------------------------- 3 files changed, 327 deletions(-) delete mode 100644 misc/win32/names.c diff --git a/apr.dsp b/apr.dsp index f44df23527f..3c9362f14e1 100644 --- a/apr.dsp +++ b/apr.dsp @@ -210,10 +210,6 @@ SOURCE=.\misc\win32\misc.c # End Source File # Begin Source File -SOURCE=.\misc\win32\names.c -# End Source File -# Begin Source File - SOURCE=.\misc\unix\otherchild.c # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index 84f91d51372..1b2dad4a099 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -216,10 +216,6 @@ SOURCE=.\misc\win32\misc.c # End Source File # Begin Source File -SOURCE=.\misc\win32\names.c -# End Source File -# Begin Source File - SOURCE=.\misc\unix\otherchild.c # End Source File # Begin Source File diff --git a/misc/win32/names.c b/misc/win32/names.c deleted file mode 100644 index dab10984aae..00000000000 --- a/misc/win32/names.c +++ /dev/null @@ -1,319 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_private.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_lib.h" -#include -#include -#include - -/* Returns TRUE if the input string is a string - * of one or more '.' characters. - */ -static BOOL OnlyDots(char *pString) -{ - char *c; - - if (*pString == '\0') - return FALSE; - - for (c = pString;*c;c++) - if (*c != '.') - return FALSE; - - return TRUE; -} - -/* XXX: Should allow path strings to 32000 chars - * - * Accepts as input a pathname, and tries to match it to an - * existing path and return the pathname in the case that - * is present on the existing path. This routine also - * converts alias names to long names. - */ -static char * apr_os_systemcase_filename(apr_pool_t *pCont, - const char *szFile) -{ - char buf[HUGE_STRING_LEN]; - char *pInputName; - char *p, *q; - BOOL bDone = FALSE; - BOOL bFileExists = TRUE; - HANDLE hFind; - WIN32_FIND_DATA wfd; - - if (!szFile || strlen(szFile) == 0 || strlen(szFile) >= sizeof(buf)) - return apr_pstrdup(pCont, ""); - - buf[0] = '\0'; - pInputName = apr_pstrdup(pCont, szFile); - - /* First convert all slashes to \ so Win32 calls work OK */ - for (p = pInputName; *p; p++) { - if (*p == '/') - *p = '\\'; - } - - p = pInputName; - /* If there is drive information, copy it over. */ - if (pInputName[1] == ':') { - buf[0] = tolower(*p++); - buf[1] = *p++; - buf[2] = '\0'; - - /* If all we have is a drive letter, then we are done */ - if (strlen(pInputName) == 2) - bDone = TRUE; - } - - q = p; - if (*p == '\\') { - p++; - if (*p == '\\') /* Possible UNC name */ - { - p++; - /* Get past the machine name. FindFirstFile */ - /* will not find a machine name only */ - p = strchr(p, '\\'); - if (p) - { - p++; - /* Get past the share name. FindFirstFile */ - /* will not find a \\machine\share name only */ - p = strchr(p, '\\'); - if (p) { - strncat(buf,q,p-q); - q = p; - p++; - } - } - - if (!p) - p = q; - } - } - - p = strchr(p, '\\'); - - while (!bDone) { - if (p) - *p = '\0'; - - if (strchr(q, '*') || strchr(q, '?')) - bFileExists = FALSE; - - /* If the path exists so far, call FindFirstFile - * again. However, if this portion of the path contains - * only '.' charaters, skip the call to FindFirstFile - * since it will convert '.' and '..' to actual names. - * Note: in the call to OnlyDots, we may have to skip - * a leading slash. - */ - if (bFileExists && !OnlyDots((*q == '.' ? q : q+1))) { - hFind = FindFirstFile(pInputName, &wfd); - - if (hFind == INVALID_HANDLE_VALUE) { - bFileExists = FALSE; - } - else { - FindClose(hFind); - - if (*q == '\\') - strcat(buf,"\\"); - strcat(buf, wfd.cFileName); - } - } - - if (!bFileExists || OnlyDots((*q == '.' ? q : q+1))) { - strcat(buf, q); - } - - if (p) { - q = p; - *p++ = '\\'; - p = strchr(p, '\\'); - } - else { - bDone = TRUE; - } - } - - /* First convert all slashes to / so server code handles it ok */ - for (p = buf; *p; p++) { - if (*p == '\\') - *p = '/'; - } - - return apr_pstrdup(pCont, buf); -} - -/* Perform canonicalization with the exception that the - * input case is preserved. - */ -char * canonical_filename(apr_pool_t *pCont, const char *szFile) -{ - char *pNewStr; - char *s; - char *p; - char *q; - - if (szFile == NULL || strlen(szFile) == 0) - return apr_pstrdup(pCont, ""); - - pNewStr = apr_pstrdup(pCont, szFile); - - /* Change all '\' characters to '/' characters. - * While doing this, remove any trailing '.'. - * Also, blow away any directories with 3 or - * more '.' - */ - for (p = pNewStr,s = pNewStr; *s; s++,p++) { - if (*s == '\\' || *s == '/') { - - q = p; - while (p > pNewStr && *(p-1) == '.') - p--; - - if (p == pNewStr && q-p <= 2 && *p == '.') - p = q; - else if (p > pNewStr && p < q && *(p-1) == '/') { - if (q-p > 2) - p--; - else - p = q; - } - - *p = '/'; - } - else { - *p = *s; - } - } - *p = '\0'; - - /* Blow away any final trailing '.' since on Win32 - * foo.bat == foo.bat. == foo.bat... etc. - * Also blow away any trailing spaces since - * "filename" == "filename " - */ - q = p; - while (p > pNewStr && (*(p-1) == '.' || *(p-1) == ' ')) - p--; - if ((p > pNewStr) || - (p == pNewStr && q-p > 2)) - *p = '\0'; - - - /* One more security issue to deal with. Win32 allows - * you to create long filenames. However, alias filenames - * are always created so that the filename will - * conform to 8.3 rules. According to the Microsoft - * Developer's network CD (1/98) - * "Automatically generated aliases are composed of the - * first six characters of the filename plus ~n - * (where n is a number) and the first three characters - * after the last period." - * Here, we attempt to detect and decode these names. - */ - p = strchr(pNewStr, '~'); - if (p != NULL) { - char *pConvertedName, *pQstr, *pPstr; - char buf[HUGE_STRING_LEN]; - /* We potentially have a short name. Call - * apr_os_systemcase_filename to examine the filesystem - * and possibly extract the long name. - */ - pConvertedName = apr_os_systemcase_filename(pCont, pNewStr); - - /* Since we want to preserve the incoming case as much - * as we can, compare for differences in the string and - * only substitute in the path names that changed. - */ - if (stricmp(pNewStr, pConvertedName)) { - buf[0] = '\0'; - - q = pQstr = pConvertedName; - p = pPstr = pNewStr; - do { - q = strchr(q,'/'); - p = strchr(p,'/'); - - if (p != NULL) { - *q = '\0'; - *p = '\0'; - } - - if (stricmp(pQstr, pPstr)) - strcat(buf, pQstr); /* Converted name */ - else - strcat(buf, pPstr); /* Original name */ - - - if (p != NULL) { - pQstr = q; - pPstr = p; - *q++ = '/'; - *p++ = '/'; - } - - } while (p != NULL); - - pNewStr = apr_pstrdup(pCont, buf); - } - } - return pNewStr; -} From 4378d877e6e397da933d01cb20c5bc29fee867a4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 24 Aug 2001 12:19:01 +0000 Subject: [PATCH 2220/7878] get apr_file_ungetc() for unix working well enough with buffered files that the current testfile.c and mod_negotiation (.var files) are happy testfile could probably stand some more rigorous tests git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62218 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 6 ++++++ test/testfile.c | 24 ++++++++---------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index cda958e0b09..8751873f52d 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -129,6 +129,12 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } rv = 0; + if (thefile->ungetchar != -1) { + *pos = (char)thefile->ungetchar; + ++pos; + --size; + thefile->ungetchar = -1; + } while (rv == 0 && size > 0) { if (thefile->bufpos >= thefile->dataRead) { thefile->dataRead = read(thefile->filedes, thefile->buffer, APR_FILE_BUFSIZE); diff --git a/test/testfile.c b/test/testfile.c index 3db771677db..b37d93114ac 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -390,22 +390,14 @@ static int test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_fl assert(!rv); read_one(f, 'a'); read_one(f, 'b'); - if (extra_flags & APR_BUFFERED) { - printf("\n skipping apr_file_ungetc() for APR_BUFFERED as it " - "doesn't work yet\n"); - apr_file_close(f); - return (0); - } - else { - rv = apr_file_ungetc('b', f); - assert(!rv); - /* Note: some implementations move the file ptr back; - * others just save up to one char; it isn't - * portable to unget more than once. - */ - /* Don't do this: rv = apr_file_ungetc('a', f); */ - read_one(f, 'b'); - } + rv = apr_file_ungetc('b', f); + assert(!rv); + /* Note: some implementations move the file ptr back; + * others just save up to one char; it isn't + * portable to unget more than once. + */ + /* Don't do this: rv = apr_file_ungetc('a', f); */ + read_one(f, 'b'); read_one(f, 'c'); read_one(f, '\n'); for (i = 0; i < TESTREAD_BLKSIZE; i++) { From ebf5b235c2c91b59f64cb42e341db5301a456fb5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 24 Aug 2001 12:56:37 +0000 Subject: [PATCH 2221/7878] at least apr_ungetc() appears to work on Unix :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62219 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 33385494ea5..c459e393377 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Get apr_ungetc() to work with buffered files on Unix. + [Jeff Trawick] + *) Rename XtOffset to APR_XtOffset. This namespace protection is important to keep from conflicting with other packages. [Perl] From 4690a02489d2953f0b8257259fbad046b45645b6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 24 Aug 2001 14:36:26 +0000 Subject: [PATCH 2222/7878] Thanks for the help, Cliff :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62220 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index c459e393377..f94ff6e46f1 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,8 @@ Changes with APR b1 *) Get apr_ungetc() to work with buffered files on Unix. [Jeff Trawick] + *) Fixed apr_filepath_root on Unix [William Rowe, Cliff Woolley]. + *) Rename XtOffset to APR_XtOffset. This namespace protection is important to keep from conflicting with other packages. [Perl] From 228f28b952cfc2986ccaf2eb3cfc397d1d5119fd Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 24 Aug 2001 17:15:01 +0000 Subject: [PATCH 2223/7878] Doxygen updates git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62221 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 81 ++++++++++++++++++++++---------------- include/apr_signal.h | 17 ++++++-- include/apr_sms.h | 2 +- include/apr_sms_blocks.h | 11 ++++-- include/apr_sms_threads.h | 17 ++++---- include/apr_sms_tracking.h | 13 +++--- include/apr_sms_trivial.h | 18 ++++----- include/apr_thread_proc.h | 2 +- memory/unix/sms_private.h | 18 ++++----- 9 files changed, 104 insertions(+), 75 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index 0fda82e7612..bc1c2b60bb0 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -54,7 +54,10 @@ #ifndef APR_GENERAL_H #define APR_GENERAL_H - +/** + * @file apr_general.h + * @brief APR Misc routines + */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" @@ -67,6 +70,12 @@ extern "C" { #endif /* __cplusplus */ +/** + * @defgroup APR_Misc Misc routines + * @ingroup APR + * @{ + */ + #ifndef FALSE #define FALSE 0 #endif @@ -83,7 +92,8 @@ extern "C" { typedef int apr_signum_t; -/* Finding offsets of elements within structures. +/** + * Finding offsets of elements within structures. * Taken from the X code... they've sweated portability of this stuff * so we don't have to. Sigh... */ @@ -116,7 +126,8 @@ typedef int apr_signum_t; #endif -/* A couple of prototypes for functions in case some platform doesn't +/** + * A couple of prototypes for functions in case some platform doesn't * have it */ #if (!APR_HAVE_STRCASECMP) && (APR_HAVE_STRICMP) @@ -131,7 +142,7 @@ int strcasecmp(const char *a, const char *b); int strncasecmp(const char *a, const char *b, size_t n); #endif -/* +/** * String and memory functions */ @@ -143,24 +154,6 @@ int strncasecmp(const char *a, const char *b, size_t n); void *memchr(const void *s, int c, size_t n); #endif -/** - * @package APR Random Functions - */ - -#if APR_HAS_RANDOM - -/* TODO: I'm not sure this is the best place to put this prototype...*/ -/** - * Generate a string of random bytes. - * @param buf Random bytes go here - * @param length size of the buffer - * @deffunc apr_status_t apr_generate_random_bytes(unsigned char * buf, int length) - */ -APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, - int length); - -#endif - /** * Setup any APR internal data structures. This MUST be the first function * called for any APR program. @@ -171,27 +164,47 @@ APR_DECLARE(apr_status_t) apr_initialize(void); /** * Tear down any APR internal data structures which aren't torn down * automatically. - * @tip An APR program must call this function at termination once it - * has stopped using APR services. The APR developers suggest using - * atexit to ensure this is called. When using APR from a language - * other than C that has problems with the calling convention, use - * apr_terminate2() instead. - * @deffunc void apr_terminate(void) + * @remark An APR program must call this function at termination once it + * has stopped using APR services. The APR developers suggest using + * atexit to ensure this is called. When using APR from a language + * other than C that has problems with the calling convention, use + * apr_terminate2() instead. */ APR_DECLARE_NONSTD(void) apr_terminate(void); /** * Tear down any APR internal data structures which aren't torn down * automatically, same as apr_terminate - * @tip An APR program must call either the apr_terminate or apr_terminate2 - * function once it it has finished using APR services. The APR - * developers suggest using atexit(apr_terminate) to ensure this is done. - * apr_terminate2 exists to allow non-c language apps to tear down apr, - * while apr_terminate is recommended from c language applications. - * @deffunc void apr_terminate2(void) + * @remark An APR program must call either the apr_terminate or apr_terminate2 + * function once it it has finished using APR services. The APR + * developers suggest using atexit(apr_terminate) to ensure this is done. + * apr_terminate2 exists to allow non-c language apps to tear down apr, + * while apr_terminate is recommended from c language applications. */ APR_DECLARE(void) apr_terminate2(void); +/** @} */ + +/** + * @defgroup APR_Random Random Functions + * @ingroup APR + * @{ + */ + +#if APR_HAS_RANDOM + +/* TODO: I'm not sure this is the best place to put this prototype...*/ +/** + * Generate a string of random bytes. + * @param buf Random bytes go here + * @param length size of the buffer + */ +APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, + int length); + +#endif +/** @} */ + #ifdef __cplusplus } #endif diff --git a/include/apr_signal.h b/include/apr_signal.h index f6e43cb1e5e..fd7440a1d90 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -54,6 +54,10 @@ #ifndef APR_SIGNAL_H #define APR_SIGNAL_H +/** + * @file apr_signal.h + * @brief APR Signal Handling + */ #include "apr.h" #include "apr_pools.h" @@ -67,7 +71,9 @@ extern "C" { #endif /* __cplusplus */ /** - * @package APR signal handling + * @defgroup APR_Signal Signal Handling + * @ingroup APR + * @{ */ #if APR_HAVE_SIGACTION @@ -75,6 +81,11 @@ extern "C" { typedef void apr_sigfunc_t(int); /* ### how to doc this? */ +/** + * Set the signal handler function for a given signal + * @param signo The signal (eg... SIGWINCH) + * @parm the function to get called + */ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func); #if defined(SIG_IGN) && !defined(SIG_ERR) @@ -90,17 +101,17 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func); * Get the description for a specific signal number * @param signum The signal number * @return The description of the signal - * @deffunc const char *apr_signal_get_description(int signum) */ APR_DECLARE(const char *) apr_signal_get_description(int signum); /** * APR-private function for initializing the signal package + * @internal * @param pglobal The internal, global pool - * @deffunc apr_signal_init(apr_pool_t *pglobal) */ void apr_signal_init(apr_pool_t *pglobal); +/** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/include/apr_sms.h b/include/apr_sms.h index ce37ae59520..0bac01b1589 100644 --- a/include/apr_sms.h +++ b/include/apr_sms.h @@ -65,7 +65,7 @@ * @brief APR SMS Memory routines */ /** - * @defgroup SMS SMS Stackable Memory allocation system + * @defgroup APR_SMS SMS Stackable Memory allocation system * @ingroup APR * @{ */ diff --git a/include/apr_sms_blocks.h b/include/apr_sms_blocks.h index 03fe5005a56..84bd1e4451f 100644 --- a/include/apr_sms_blocks.h +++ b/include/apr_sms_blocks.h @@ -69,9 +69,14 @@ #ifdef __cplusplus extern "C" { #endif - /** - * @package APR blocks memory system + * @file apr_sms_blocks.h + * @brief APR SMS Blocks Memory System + */ +/** + * @defgroup APR_SMS_Blocks Blocks SMS + * @ingroup APR_SMS + * @{ */ /** @@ -86,7 +91,7 @@ APR_DECLARE(apr_status_t) apr_sms_blocks_create(apr_sms_t **sms, apr_size_t block_size); - +/** @} */ #ifdef __cplusplus } #endif diff --git a/include/apr_sms_threads.h b/include/apr_sms_threads.h index 974272835eb..e03bd317954 100644 --- a/include/apr_sms_threads.h +++ b/include/apr_sms_threads.h @@ -63,9 +63,14 @@ extern "C" { #endif #if APR_HAS_THREADS - + /** + * @file apr_sms_threads.h + * @brief APR SMS Threads Memory System + */ /** - * @package APR threads memory system + * @defgroup APR_SMS_Threads Threads SMS + * @ingroup APR_SMS + * @{ */ /** @@ -73,8 +78,6 @@ extern "C" { * @param mem_sys A pointer to the returned apr_sms_t* * @param pms The parent memory system, used to allocate the memory * that we will be threads. - * @deffunc apr_status_t apr_sms_threads_create(apr_sms_t **mem_sys, - * apr_sms_t *pms); */ APR_DECLARE(apr_status_t) apr_sms_threads_create(apr_sms_t **sms, apr_sms_t *pms); @@ -89,11 +92,6 @@ APR_DECLARE(apr_status_t) apr_sms_threads_create(apr_sms_t **sms, * @param min_free The minimal amount of memory to make sure is * free in an allocated block from the parent * @param max_free The amount of memory the sms may hold on to - * @deffunc apr_status_t apr_sms_threads_create_ex(apr_sms_t **mem_sys, - * apr_sms_t *pms, - * apr_size_t min_alloc, - * apr_size_t min_free, - * apr_size_t max_free); */ APR_DECLARE(apr_status_t) apr_sms_threads_create_ex(apr_sms_t **sms, apr_sms_t *pms, @@ -101,6 +99,7 @@ APR_DECLARE(apr_status_t) apr_sms_threads_create_ex(apr_sms_t **sms, apr_size_t min_free, apr_size_t max_free); +/** @} */ #endif /* APR_HAS_THREADS */ #ifdef __cplusplus diff --git a/include/apr_sms_tracking.h b/include/apr_sms_tracking.h index ec7a22c98fe..f73d477367d 100644 --- a/include/apr_sms_tracking.h +++ b/include/apr_sms_tracking.h @@ -69,9 +69,14 @@ #ifdef __cplusplus extern "C" { #endif - /** - * @package APR tracking memory system + * @file apr_sms_tracking.h + * @brief APR SMS Tracking Memory System + */ +/** + * @defgroup APR_SMS_Tracking Tracking SMS + * @ingroup APR_SMS + * @{ */ /** @@ -79,14 +84,12 @@ extern "C" { * @param mem_sys A pointer to the returned apr_sms_t* * @param pms The parent memory system, used to allocate the memory * that we will be tracking. - * @deffunc apr_status_t apr_sms_tracking_create(apr_sms_t **mem_sys, - * apr_sms_t *pms); */ APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys, apr_sms_t *pms); - +/** @} */ #ifdef __cplusplus } #endif diff --git a/include/apr_sms_trivial.h b/include/apr_sms_trivial.h index 03644e8809a..be560dd0727 100644 --- a/include/apr_sms_trivial.h +++ b/include/apr_sms_trivial.h @@ -61,9 +61,14 @@ #ifdef __cplusplus extern "C" { #endif - /** - * @package APR trivial memory system + * @file apr_sms_trivial.h + * @brief APR SMS Trivial Memory System + */ +/** + * @defgroup APR_SMS_Trivial Trivial SMS + * @ingroup APR_SMS + * @{ */ /** @@ -71,8 +76,6 @@ extern "C" { * @param mem_sys A pointer to the returned apr_sms_t* * @param pms The parent memory system, used to allocate the memory * that we will be trivial. - * @deffunc apr_status_t apr_sms_trivial_create(apr_sms_t **mem_sys, - * apr_sms_t *pms); */ APR_DECLARE(apr_status_t) apr_sms_trivial_create(apr_sms_t **sms, apr_sms_t *pms); @@ -87,18 +90,13 @@ APR_DECLARE(apr_status_t) apr_sms_trivial_create(apr_sms_t **sms, * @param min_free The minimal amount of memory to make sure is * free in an allocated block from the parent * @param max_free The amount of memory the sms may hold on to - * @deffunc apr_status_t apr_sms_trivial_create_ex(apr_sms_t **mem_sys, - * apr_sms_t *pms, - * apr_size_t min_alloc, - * apr_size_t min_free, - * apr_size_t max_free); */ APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, apr_sms_t *pms, apr_size_t min_alloc, apr_size_t min_free, apr_size_t max_free); - +/** @} */ #ifdef __cplusplus } #endif diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index b7ba4aa219f..b08af63ce79 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -71,7 +71,7 @@ extern "C" { #endif /* __cplusplus */ /** * @file apr_thread_proc.h - * @brief APR Thread Libraru + * @brief APR Thread Library */ /** * @defgroup APR_Thread Thread Library diff --git a/memory/unix/sms_private.h b/memory/unix/sms_private.h index 4adee8c1e1d..6542aec7dcb 100644 --- a/memory/unix/sms_private.h +++ b/memory/unix/sms_private.h @@ -58,8 +58,8 @@ */ /** * - * @defgroup SMS_Private Private routines - * @ingroup SMS + * @defgroup APR_SMS_Private Private routines + * @ingroup APR_SMS * @{ */ #ifndef SMS_PRIVATE_H @@ -85,14 +85,14 @@ struct apr_sms_t apr_sms_t *parent; /**< parent of the current SMS */ apr_sms_t *child; /**< children of the current SMS */ apr_sms_t *sibling; /**< next SMS at the same level */ - apr_sms_t **ref; - apr_sms_t *accounting; + apr_sms_t **ref; /**< a pointer to the pointer pointing to memory */ + apr_sms_t *accounting; /**< SMS for accounting type tasks */ const char *identity; /**< a string identifying the module */ - apr_pool_t *pool; - apr_lock_t *sms_lock; + apr_pool_t *pool; /**< pool to associate with this SMS */ + apr_lock_t *sms_lock; /**< lock to use when allocated memory in this SMS */ - struct apr_sms_cleanup *cleanups; + struct apr_sms_cleanup *cleanups; /**< stuff to call when the SMS is being freed */ void * (*malloc_fn) (apr_sms_t *sms, apr_size_t size); /**< malloc fn for this SMS */ void * (*calloc_fn) (apr_sms_t *sms, apr_size_t size); /**< calloc fn for this SMS */ @@ -106,8 +106,8 @@ the SMS */ apr_status_t (*lock_fn) (apr_sms_t *sms); /**< locking function */ apr_status_t (*unlock_fn) (apr_sms_t *sms); /**< unlocking function */ - apr_status_t (*apr_abort)(int retcode); - struct apr_hash_t *prog_data; + apr_status_t (*apr_abort)(int retcode); /**< function to call when a malloc fails */ + struct apr_hash_t *prog_data; /**< has to store userdata */ #ifdef APR_POOLS_ARE_SMS struct process_chain *subprocesses; From 79b9bd8ce7a0b56a8db5f9b4fbe59c3896903994 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 24 Aug 2001 17:55:45 +0000 Subject: [PATCH 2224/7878] ALL APR Include files (except for Arch specific stuff) now have Doxygen format headers git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62222 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 +- include/apr_hash.h | 2 +- include/apr_lib.h | 2 +- include/apr_strings.h | 41 +++++++--------- include/apr_tables.h | 109 +++++++++++++++++++----------------------- include/apr_time.h | 38 +++++++-------- include/apr_user.h | 48 +++++++++---------- include/apr_uuid.h | 2 +- include/apr_want.h | 9 ++-- include/apr_xlate.h | 50 ++++++++++++------- 10 files changed, 150 insertions(+), 153 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index f6cc6f3f786..eccbf5ad300 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -67,7 +67,7 @@ extern "C" { /** * @file apr_errno.h - * @brief Error Codes + * @brief APR Error Codes */ /** * @defgroup APR_Error_Codes Error Codes diff --git a/include/apr_hash.h b/include/apr_hash.h index 651f729bb9c..345a593b31b 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -64,7 +64,7 @@ extern "C" { #endif /** * @file apr_hash.h - * @brief Hash Tables + * @brief APR Hash Tables */ /** diff --git a/include/apr_lib.h b/include/apr_lib.h index cd7c948dd35..7e11045111c 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -56,7 +56,7 @@ #define APR_LIB_H /** * @file apr_lib.h - * @brief general purpose library routines + * @brief APR general purpose library routines */ #include "apr.h" diff --git a/include/apr_strings.h b/include/apr_strings.h index 11969a7eccf..e409896a293 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -89,11 +89,15 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ - /** - * @package APR strings library + * @file apr_strings.h + * @brief APR Strings library + */ +/** + * @defgroup APR_Strings String routines + * @ingroup APR + * @{ */ - /** * Do a natural order comparison of two strings. * @param a The first string to compare @@ -101,7 +105,6 @@ extern "C" { * @return Either <0, 0, or >0. If the first string is less than the second * this returns <0, if they are equivalent it returns 0, and if the * first string is greater than second string it retuns >0. - * @deffunc int apr_strnatcmp(char const *a, char const *b) */ APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b); @@ -113,7 +116,6 @@ APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b); * @return Either <0, 0, or >0. If the first string is less than the second * this returns <0, if they are equivalent it returns 0, and if the * first string is greater than second string it retuns >0. - * @deffunc int apr_strnatcasecmp(char const *a, char const *b) */ APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b); @@ -122,7 +124,6 @@ APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b); * @param p The pool to allocate out of * @param s The string to duplicate * @return The new string - * @deffunc char *apr_pstrdup(apr_pool_t *p, const char *s) */ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); @@ -133,7 +134,6 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); * @param s The string to duplicate * @param n The number of characters to duplicate * @return The new string - * @deffunc char *apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n) */ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); @@ -144,7 +144,6 @@ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); * @param m The memory to duplicate * @param n The number of bytes to duplicate * @return The new block of memory - * @deffunc void *apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n) */ APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n); @@ -153,7 +152,6 @@ APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n); * @param p The pool to allocate out of * @param ... The strings to concatenate. The final string must be NULL * @return The new string - * @deffunc char *apr_pstrcat(apr_pool_t *p, ...) */ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...); @@ -164,7 +162,6 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...); * @param fmt The format of the string * @param ap The arguments to use while printing the data * @return The new string - * @deffunc char *apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) */ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap); @@ -175,7 +172,6 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap); * @param fmt The format of the string * @param ... The arguments to use while printing the data * @return The new string - * @deffunc char *apr_psprintf(apr_pool_t *p, const char *fmt, ...) */ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) __attribute__((format(printf,2,3))); @@ -188,7 +184,7 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) * null-termination, so if src is longer than * dst_size, the actual number of characters copied is * dst_size - 1. - * @tip + * @remark *
      * We re-implement this function to implement these specific changes:
      *       1) strncpy() doesn't always null terminate and we want it to.
    @@ -198,7 +194,6 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...)
      *          destination string, we return a pointer to the terminating '\0'
      *          to allow us to check for truncation.
      * 
    - * @deffunc char *apr_cpystrn(char *dst, const char *src, apr_size_t dst_size) */ APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, apr_size_t dst_size); @@ -208,7 +203,6 @@ APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, * @param dest The destination string. It is okay to modify the string * in place. Namely dest == src * @param src The string to rid the spaces from. - * @deffunc char *apr_collapse_spaces(char *dest, const char *src) */ APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src); @@ -218,7 +212,6 @@ APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src); * @param str The arguments to convert * @param argv_out Output location. This is a pointer to an array of strings. * @param token_context Pool to use. - * @deffunc apr_status_t apr_tokenize_to_argv(const char *arg_str, char ***argv_out, apr_pool_t *token_context); */ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, char ***argv_out, @@ -234,11 +227,13 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, * @param sep The set of delimiters * @param last Internal state saved by apr_strtok() between calls. * @return The next token from the string - * @deffunc char *apr_strtok(char *str, const char *sep, char **last) */ APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last); -/* +/** + * @defgroup APR_Strings_Snprintf snprintf implementations + * + * @warning * These are snprintf implementations based on apr_vformatter(). * * Note that various standards and implementations disagree on the return @@ -253,6 +248,7 @@ APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last); * In no event does apr_snprintf return a negative number. It's not possible * to distinguish between an output which was truncated, and an output which * exactly filled the buffer. + * @{ */ /** @@ -262,7 +258,6 @@ APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last); * @param len The size of the buffer * @param format The format string * @param ... The arguments to use to fill out the format string. - * @deffunc int apr_snprintf(char *buf, apr_size_t len, const char *format, ...) */ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, const char *format, ...) @@ -275,17 +270,16 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, * @param len The size of the buffer * @param format The format string * @param ap The arguments to use to fill out the format string. - * @deffunc int apr_vsnprintf(char *buf, apr_size_t len, const char *format, va_list ap) */ APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format, va_list ap); +/** @} */ /** * create a string representation of an int, allocated from a pool * @param p The pool from which to allocate * @param n The number to format * @return The string representation of the number - * @deffunc int apr_itoa(apr_pool_t *p, int n) */ APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n); @@ -294,7 +288,6 @@ APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n); * @param p The pool from which to allocate * @param n The number to format * @return The string representation of the number - * @deffunc int apr_ltoa(apr_pool_t *p, long n) */ APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n); @@ -303,7 +296,6 @@ APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n); * @param p The pool from which to allocate * @param n The number to format * @return The string representation of the number - * @deffunc int apr_ltoa(apr_pool_t *p, apr_off_t n) */ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); @@ -313,11 +305,10 @@ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); * @param size The size to format * @param buf The 5 byte text buffer (counting the trailing null) * @return The buf passed to apr_strfsize() - * @deffunc char *apr_strfsize(apr_off_t size, char *buf) - * @tip All negative sizes report ' - ', apr_strfsize only formats positive values. + * @remark All negative sizes report ' - ', apr_strfsize only formats positive values. */ APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf); - +/** @} */ #ifdef __cplusplus } #endif diff --git a/include/apr_tables.h b/include/apr_tables.h index 1da77071c33..373c84dc4a3 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -71,18 +71,24 @@ extern "C" { */ /** - * @package APR Table library + * @file apr_tables.h + * @brief APR Table library */ - -/* +/** + * @defgroup APR_Table Table routines + * @ingroup APR + * * Memory allocation stuff, like pools, arrays, and tables. Pools * and tables are opaque structures to applications, but arrays are * published. + * @{ */ +/** the table abstract data type */ typedef struct apr_table_t apr_table_t; -typedef struct apr_array_header_t apr_array_header_t; /** An opaque array type */ +typedef struct apr_array_header_t apr_array_header_t; + struct apr_array_header_t { /** The pool the array is allocated out of */ apr_pool_t *pool; @@ -130,7 +136,6 @@ struct apr_table_entry_t { * Get the elements from a table * @param t The table * @return An array containing the contents of the table - * @deffunc apr_array_header_t *apr_table_elts(apr_table_t *t) */ #define apr_table_elts(t) ((apr_array_header_t *)(t)) @@ -138,7 +143,6 @@ struct apr_table_entry_t { * Determine if the table is empty * @param t The table to check * @return True if empty, Falso otherwise - * @deffunc int apr_is_empty_table(apr_table_t *t) */ #define apr_is_empty_table(t) (((t) == NULL) \ || (((apr_array_header_t *)(t))->nelts == 0)) @@ -149,7 +153,6 @@ struct apr_table_entry_t { * @param nelts the number of elements in the initial array * @param elt_size The size of each element in the array. * @return The new array - * @deffunc apr_array_header_t *apr_array_make(apr_pool_t *p, int nelts, int elt_size) */ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, int nelts, int elt_size); @@ -158,9 +161,8 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, * Add a new element to an array * @param arr The array to add an element to. * @return Location for the new element in the array. - * @tip If there are no free spots in the array, then this function will - * allocate new space for the new element. - * @deffunc void *apr_array_push(apr_array_header_t *arr) + * @remark If there are no free spots in the array, then this function will + * allocate new space for the new element. */ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr); @@ -169,7 +171,6 @@ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr); * @param dst The destination array, and the one to go first in the combined * array * @param src The source array to add to the destination array - * @deffunc void apr_array_cat(apr_array_header_t *dst, const apr_array_header_t *src) */ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, const apr_array_header_t *src); @@ -179,10 +180,9 @@ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, * @param p The pool to allocate the copy of the array out of * @param arr The array to copy * @return An exact copy of the array passed in - * @deffunc apr_array_header_t *apr_array_copy(apr_pool_t *p, const apr_array_header_t *arr) - * @tip The alternate apr_array_copy_hdr copies only the header, and arranges - * for the elements to be copied if (and only if) the code subsequently does - * a push or arraycat. + * @remark The alternate apr_array_copy_hdr copies only the header, and arranges + * for the elements to be copied if (and only if) the code subsequently + * does a push or arraycat. */ APR_DECLARE(apr_array_header_t *) apr_array_copy(apr_pool_t *p, const apr_array_header_t *arr); @@ -192,8 +192,7 @@ APR_DECLARE(apr_array_header_t *) apr_array_copy(apr_pool_t *p, * @param p The pool to allocate the copy of the array out of * @param arr The array to copy * @return An exact copy of the array passed in - * @deffunc apr_array_header_t *apr_array_copy_hdr(apr_pool_t *p, const apr_array_header_t *arr) - * @tip The alternate apr_array_copy copies the *entire* array. + * @remark The alternate apr_array_copy copies the *entire* array. */ APR_DECLARE(apr_array_header_t *) apr_array_copy_hdr(apr_pool_t *p, const apr_array_header_t *arr); @@ -204,7 +203,6 @@ APR_DECLARE(apr_array_header_t *) apr_array_copy_hdr(apr_pool_t *p, * @param first The array to put first in the new array. * @param second The array to put second in the new array. * @param return A new array containing the data from the two arrays passed in. - * @deffunc apr_array_header_t *apr_array_append(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second) */ APR_DECLARE(apr_array_header_t *) apr_array_append(apr_pool_t *p, const apr_array_header_t *first, @@ -220,7 +218,6 @@ APR_DECLARE(apr_array_header_t *) apr_array_append(apr_pool_t *p, * @param arr The array to generate the string from * @param sep The separator to use * @return A string containing all of the data in the array. - * @deffunc char *apr_array_pstrcat(apr_pool_t *p, const apr_array_header_t *arr, const char sep) */ APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, const apr_array_header_t *arr, @@ -232,7 +229,6 @@ APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, * @param nelts The number of elements in the initial table. * @return The new table. * @warning This table can only store text data - * @deffunc apr_table_t *apr_table_make(apr_pool_t *p, int nelts) */ APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts); @@ -241,7 +237,6 @@ APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts); * @param p The pool to allocate the new table out of * @param t The table to copy * @return A copy of the table passed in - * @deffunc apr_table_t *apr_table_copy(apr_pool_t *p, const apr_table_t *t) */ APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, const apr_table_t *t); @@ -249,7 +244,6 @@ APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, /** * Delete all of the elements from a table * @param t The table to clear - * @deffunc void apr_table_clear(apr_table_t *t) */ APR_DECLARE(void) apr_table_clear(apr_table_t *t); @@ -259,7 +253,6 @@ APR_DECLARE(void) apr_table_clear(apr_table_t *t); * @param t The table to search for the key * @param key The key to search for * @return The value associated with the key - * @deffunc const char *apr_table_get(const apr_table_t *t, const char *key) */ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); @@ -269,9 +262,8 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); * @param t The table to add the data to. * @param key The key fo use * @param val The value to add - * @tip When adding data, this function makes a copy of both the key and the - * value. - * @deffunc void apr_table_set(apr_table_t *t, const char *key, const char *val) + * @remark When adding data, this function makes a copy of both the key and the + * value. */ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, const char *val); @@ -282,10 +274,9 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, * @param t The table to add the data to. * @param key The key fo use * @param val The value to add - * @tip When adding data, this function does not make a copy of the key or the - * value, so care should be taken to ensure that the values will not - * change after they have been added.. - * @deffunc void apr_table_setn(apr_table_t *t, const char *key, const char *val) + * @warning When adding data, this function does not make a copy of the key or + * the value, so care should be taken to ensure that the values will + * not change after they have been added.. */ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, const char *val); @@ -294,7 +285,6 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, * Remove data from the table * @param t The table to remove data from * @param key The key of the data being removed - * @deffunc void apr_table_unset(apr_table_t *t, const char *key) */ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key); @@ -304,8 +294,7 @@ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key); * @param t The table to search for the data * @param key The key to merge data for * @param val The data to add - * @tip If the key is not found, then this function acts like apr_table_add - * @deffunc void apr_table_merge(apr_table_t *t, const char *key, const char *val) + * @remark If the key is not found, then this function acts like apr_table_add */ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, const char *val); @@ -316,8 +305,7 @@ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, * @param t The table to search for the data * @param key The key to merge data for * @param val The data to add - * @tip If the key is not found, then this function acts like apr_table_addn - * @deffunc void apr_table_mergen(apr_table_t *t, const char *key, const char *val) + * @remark If the key is not found, then this function acts like apr_table_addn */ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, const char *val); @@ -328,9 +316,8 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, * @param t The table to add to * @param key The key to use * @param val The value to add. - * @tip When adding data, this function makes a copy of both the key and the - * value. - * @deffunc void apr_table_add(apr_table_t *t, const char *key, const char *val) + * @remark When adding data, this function makes a copy of both the key and the + * value. */ APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, const char *val); @@ -341,10 +328,9 @@ APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, * @param t The table to add to * @param key The key to use * @param val The value to add. - * @tip When adding data, this function does not make a copy of the key or the - * value, so care should be taken to ensure that the values will not - * change after they have been added.. - * @deffunc void apr_table_addn(apr_table_t *t, const char *key, const char *val) + * @remark When adding data, this function does not make a copy of the key or the + * value, so care should be taken to ensure that the values will not + * change after they have been added.. */ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, const char *val); @@ -355,7 +341,6 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, * @param overlay The first table to put in the new table * @param base The table to add at the end of the new table * @return A new table containing all of the data from the two passed in - * @deffunc apr_table_t *apr_table_overlay(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); */ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, const apr_table_t *overlay, @@ -373,7 +358,6 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, * @param ... The vararg. If this is NULL, then all elements in the table are * run through the function, otherwise only those whose key matches * are run. - * @deffunc void apr_table_do(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, ...) */ APR_DECLARE_NONSTD(void) apr_table_do(int (*comp)(void *, const char *, const char *), void *rec, const apr_table_t *t, ...); @@ -390,12 +374,28 @@ APR_DECLARE_NONSTD(void) apr_table_do(int (*comp)(void *, const char *, const ch * @param vp The vararg table. If this is NULL, then all elements in the * table are run through the function, otherwise only those * whose key matches are run. - * @deffunc void apr_table_vdo(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, va_list vp) */ APR_DECLARE(void) apr_table_vdo(int (*comp)(void *, const char *, const char *), void *rec, const apr_table_t *t, va_list); -/* Conceptually, apr_table_overlap does this: +/** flag for overlap to use apr_table_setn */ +#define APR_OVERLAP_TABLES_SET (0) +/** flag for overlap to use apr_table_mergen */ +#define APR_OVERLAP_TABLES_MERGE (1) +/** + * For each element in table b, either use setn or mergen to add the data + * to table a. Which method is used is determined by the flags passed in. + * @param a The table to add the data to. + * @param b The table to iterate over, adding its data to table a + * @param flags How to add the table to table a. One of: + * APR_OVERLAP_TABLES_SET Use apr_table_setn + * APR_OVERLAP_TABLES_MERGE Use apr_table_mergen + * @remark This function is highly optimized, and uses less memory and CPU cycles + * than a function that just loops through table b calling other functions. + */ +/** + *
    + * Conceptually, apr_table_overlap does this:
      *
      *  apr_array_header_t *barr = apr_table_elts(b);
      *  apr_table_entry_t *belt = (apr_table_entry_t *)barr->elts;
    @@ -416,24 +416,13 @@ APR_DECLARE(void) apr_table_vdo(int (*comp)(void *, const char *, const char *),
      *  Notice the assumptions on the keys and values in b -- they must be
      *  in an ancestor of a's pool.  In practice b and a are usually from
      *  the same pool.
    + * 
    */ -#define APR_OVERLAP_TABLES_SET (0) -#define APR_OVERLAP_TABLES_MERGE (1) -/** - * For each element in table b, either use setn or mergen to add the data - * to table a. Which method is used is determined by the flags passed in. - * @param a The table to add the data to. - * @param b The table to iterate over, adding its data to table a - * @param flags How to add the table to table a. One of: - * APR_OVERLAP_TABLES_SET Use apr_table_setn - * APR_OVERLAP_TABLES_MERGE Use apr_table_mergen - * @tip This function is highly optimized, and uses less memory and CPU cycles - * than a function that just loops through table b calling other functions. - * @deffunc void apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags) - */ + APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags); +/** @} */ #ifdef __cplusplus } #endif diff --git a/include/apr_time.h b/include/apr_time.h index dccaa984d0a..99b9d1db430 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -62,26 +62,32 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ - /** - * @package APR Time library + * @file apr_time.h + * @brief APR Time Library */ - +/** + * @defgroup APR_Time Time Routines + * @ingroup APR + * @{ + */ +/** month names */ APR_DECLARE_DATA extern const char apr_month_snames[12][4]; +/** day names */ APR_DECLARE_DATA extern const char apr_day_snames[7][4]; -/* number of microseconds since 00:00:00 january 1, 1970 UTC */ +/** number of microseconds since 00:00:00 january 1, 1970 UTC */ typedef apr_int64_t apr_time_t; -/* mechanism to properly type apr_time_t literals */ +/** mechanism to properly type apr_time_t literals */ #define APR_TIME_C(val) APR_INT64_C(val) -/* mechanism to properly print apr_time_t values */ +/** mechanism to properly print apr_time_t values */ #define APR_TIME_T_FMT APR_INT64_T_FMT -/* intervals for I/O timeouts, in microseconds */ +/** intervals for I/O timeouts, in microseconds */ typedef apr_int64_t apr_interval_time_t; typedef apr_int32_t apr_short_interval_time_t; @@ -90,16 +96,16 @@ typedef apr_int32_t apr_short_interval_time_t; /** * return the current time - * @deffunc apr_time_t apr_time_now(void) */ APR_DECLARE(apr_time_t) apr_time_now(void); -typedef struct apr_exploded_time_t apr_exploded_time_t; /** * a structure similar to ANSI struct tm with the following differences: * - tm_usec isn't an ANSI field * - tm_gmtoff isn't an ANSI field (it's a bsdism) */ +typedef struct apr_exploded_time_t apr_exploded_time_t; + struct apr_exploded_time_t { /** microseconds past tm_sec */ apr_int32_t tm_usec; @@ -129,7 +135,6 @@ struct apr_exploded_time_t { * convert an ansi time_t to an apr_time_t * @param result the resulting apr_time_t * @param input the time_t to convert - * @deffunc apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input) */ APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, time_t input); @@ -141,7 +146,6 @@ APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, * @param input the time to explode * @param offs the number of seconds offset to apply * @param zone the zone description - * @deffunc apr_status_t apr_explode_time(apr_exploded_time_t *result, apr_time_t input, apr_int32_t offs) */ APR_DECLARE(apr_status_t) apr_explode_time(apr_exploded_time_t *result, apr_time_t input, @@ -151,7 +155,6 @@ APR_DECLARE(apr_status_t) apr_explode_time(apr_exploded_time_t *result, * convert a time to its human readable components in GMT timezone * @param result the exploded time * @param input the time to explode - * @deffunc apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input) */ APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input); @@ -160,7 +163,6 @@ APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, * convert a time to its human readable components in local timezone * @param result the exploded time * @param input the time to explode - * @deffunc apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) */ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input); @@ -170,7 +172,6 @@ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, * e.g. elapsed usec since epoch * @param result the resulting imploded time * @param input the input exploded time - * @deffunc apr_status_t apr_implode_time(apr_time_t *result, apr_exploded_time_t *input) */ APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *result, apr_exploded_time_t *input); @@ -180,7 +181,6 @@ APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *result, * always represents GMT * @param result the resulting imploded time * @param input the input exploded time - * @deffunc apr_status_t apr_implode_gmt(apr_time_t *result, apr_exploded_time_t *input) */ APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *result, apr_exploded_time_t *input); @@ -188,11 +188,11 @@ APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *result, /** * Sleep for the specified number of micro-seconds. * @param t desired amount of time to sleep. - * @deffunc void apr_sleep(apr_interval_time_t t) - * @tip May sleep for longer than the specified time. + * @warning May sleep for longer than the specified time. */ APR_DECLARE(void) apr_sleep(apr_interval_time_t t); +/** length of a RFC822 Date */ #define APR_RFC822_DATE_LEN (30) /** * apr_rfc822_date formats dates in the RFC822 @@ -201,10 +201,10 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t); * including trailing \0 * @param date_str String to write to. * @param t the time to convert - * @deffunc apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) */ APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t); +/** length of a CTIME date */ #define APR_CTIME_LEN (25) /** * apr_ctime formats dates in the ctime() format @@ -213,7 +213,6 @@ APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t); * including trailing \0 * @param date_str String to write to. * @param t the time to convert - * @deffunc apr_status_t apr_ctime(char *date_str, apr_time_t t) */ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t); @@ -224,7 +223,6 @@ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t); * @param max The maximum length of the string * @param format The format for the time string * @param tm The time to convert - * @deffunc apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, apr_exploded_time_t *tm) */ APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, diff --git a/include/apr_user.h b/include/apr_user.h index ac781bd6d8d..4fcf4ad3967 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -64,12 +64,17 @@ extern "C" { #endif /* __cplusplus */ /** - * @package APR user id services + * @file apr_user.h + * @brief APR User ID Services + */ +/** + * @defgroup APR_User User id services + * @ingroup APR + * @{ */ /** * Structure for determining user ownership. - * @defvar apr_uid_t */ #ifdef WIN32 typedef PSID apr_uid_t; @@ -79,7 +84,6 @@ typedef uid_t apr_uid_t; /** * Structure for determining group ownership. - * @defvar apr_gid_t */ #ifdef WIN32 typedef PSID apr_gid_t; @@ -87,60 +91,55 @@ typedef PSID apr_gid_t; typedef gid_t apr_gid_t; #endif -#if APR_HAS_USER +#if APR_HAS_USER -/*** +/** * Get the userid (and groupid) of the calling process * @param userid Returns the user id * @param groupid Returns the user's group id * @param p The pool from which to allocate working space - * @tip This function is available only if APR_HAS_USER is defined. - * @deffunc apr_status_t apr_current_userid(apr_uid_t *userid, apr_gid_t *groupid, apr_pool_t *p) + * @remark This function is available only if APR_HAS_USER is defined. */ APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *userid, apr_gid_t *groupid, apr_pool_t *p); -/*** +/** * Get the user name for a specified userid * @param username Pointer to new string containing user name (on output) * @param userid The userid * @param p The pool from which to allocate the string - * @tip This function is available only if APR_HAS_USER is defined. - * @deffunc apr_status_t apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) + * @remark This function is available only if APR_HAS_USER is defined. */ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p); -/*** +/** * Get the userid (and groupid) for the specified username * @param userid Returns the user id * @param groupid Returns the user's group id * @param username The username to lookup * @param p The pool from which to allocate working space - * @tip This function is available only if APR_HAS_USER is defined. - * @deffunc apr_status_t apr_get_userid(apr_uid_t *userid, apr_gid_t *groupid, const char *username, apr_pool_t *p) + * @remark This function is available only if APR_HAS_USER is defined. */ APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *userid, apr_gid_t *groupid, const char *username, apr_pool_t *p); -/*** +/** * Get the home directory for the named user * @param dirname Pointer to new string containing directory name (on output) * @param username The named user * @param p The pool from which to allocate the string - * @tip This function is available only if APR_HAS_USER is defined. - * @deffunc apr_status_t apr_get_home_directory(char **dirname, const char *username, apr_pool_t *p) + * @remark This function is available only if APR_HAS_USER is defined. */ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *username, apr_pool_t *p); -/*** +/** * Compare two user identifiers for equality. * @param left One uid to test * @param right Another uid to test * @return APR_SUCCESS if the apr_uid_t strutures identify the same user, * APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid. - * @tip This function is available only if APR_HAS_USER is defined. - * @deffunc apr_status_t apr_compare_users(apr_uid_t left, apr_uid_t right) + * @remark This function is available only if APR_HAS_USER is defined. */ #if defined(WIN32) APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right); @@ -148,24 +147,22 @@ APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right); #define apr_compare_users(left,right) ((left == right) ? APR_SUCCESS : APR_EMISMATCH) #endif -/*** +/** * Get the group name for a specified groupid * @param dirname Pointer to new string containing group name (on output) * @param userid The groupid * @param p The pool from which to allocate the string - * @tip This function is available only if APR_HAS_USER is defined. - * @deffunc apr_status_t apr_get_groupname(char **groupname, apr_gid_t userid, apr_pool_t *p); + * @remark This function is available only if APR_HAS_USER is defined. */ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p); -/*** +/** * Compare two group identifiers for equality. * @param left One gid to test * @param right Another gid to test * @return APR_SUCCESS if the apr_gid_t strutures identify the same group, * APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid. - * @tip This function is available only if APR_HAS_USER is defined. - * @deffunc apr_status_t apr_compare_groups(apr_gid_t left, apr_gid_t right) + * @remark This function is available only if APR_HAS_USER is defined. */ #if defined(WIN32) APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right); @@ -175,6 +172,7 @@ APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right); #endif /* ! APR_HAS_USER */ +/** @} */ #ifdef __cplusplus } #endif diff --git a/include/apr_uuid.h b/include/apr_uuid.h index 4185536972b..3fc11f68348 100644 --- a/include/apr_uuid.h +++ b/include/apr_uuid.h @@ -54,7 +54,7 @@ /** * @file apr_uuid.h - * @brief routines that maninpulate UUID's + * @brief APR UUID library */ #ifndef APR_UUID_H #define APR_UUID_H diff --git a/include/apr_want.h b/include/apr_want.h index e8a1c10ce1b..932b07a964c 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -53,8 +53,11 @@ */ #include "apr.h" /* configuration data */ - -/* +/** + * @file apr_want.h + * @brief APR_WANT_XXX documentation + * + *
      * Features:
      *
      *   APR_WANT_STRFUNC:  strcmp, strcat, strcpy, etc
    @@ -74,6 +77,7 @@
      *
      * Note: it is safe to use this in a header (it won't interfere with other
      *       headers' or source files' use of apr_want.h)
    + * 
    */ /* --------------------------------------------------------------------- */ @@ -154,4 +158,3 @@ #endif /* --------------------------------------------------------------------- */ - diff --git a/include/apr_xlate.h b/include/apr_xlate.h index 3a1d0c1d422..66217a91f97 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -64,10 +64,18 @@ extern "C" { #endif /* __cplusplus */ /** - * @package APR I18N translation library + * @file apr_xlate.h + * @brief APR I18N translation library */ -/* APR_HAS_XLATE determines whether or not useful implementations of +/** + * @defgroup APR_I18N I18N translation library + * @ingroup APR + * @{ + */ + +/** + * APR_HAS_XLATE determines whether or not useful implementations of * apr_xlate_open() et al are provided. * * If APR_HAS_XLATE is zero, apr_xlate_open() et al will all return @@ -83,9 +91,7 @@ typedef struct apr_xlate_t apr_xlate_t; * @param topage The name of the target charset * @param frompage The name of the source charset * @param pool The pool to use - * @deffunc apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, const char *frompage, apr_pool_t *pool) - * @tip - *
    + * @remark
      *  Specify APR_DEFAULT_CHARSET for one of the charset
      *  names to indicate the charset of the source code at
      *  compile time.  This is useful if there are literal
    @@ -95,6 +101,7 @@ typedef struct apr_xlate_t            apr_xlate_t;
      *  of the caller was not encoded in the same charset as
      *  APR at compile time.
      *
    + * @remark
      *  Specify APR_LOCALE_CHARSET for one of the charset
      *  names to indicate the charset of the current locale.
      * 
    @@ -104,7 +111,17 @@ APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, const char *frompage, apr_pool_t *pool); +/** + * This is to indicate the charset of the sourcecode at compile time + * names to indicate the charset of the source code at + * compile time. This is useful if there are literal + * strings in the source code which must be translated + * according to the charset of the source code. + */ #define APR_DEFAULT_CHARSET (const char *)0 +/** + * To indicate charset names of the current locale + */ #define APR_LOCALE_CHARSET (const char *)1 /** @@ -112,7 +129,6 @@ APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, * @param convset The handle allocated by apr_xlate_open, specifying the * parameters of conversion * @param onoff Output: whether or not the conversion is single-byte-only - * @deffunc apr_status_t apr_xlate_get_sb(apr_xlate_t *convset, int *onoff) */ APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff); @@ -126,7 +142,6 @@ APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff); * @param outbuf The address of the destination buffer * @param outbytes_left Input: the size of the output buffer * Output: the amount of the output buffer not yet used - * @deffunc apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, apr_size_t *inbytes_left, char *outbuf, apr_size_t *outbytes_left) */ APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, @@ -134,7 +149,7 @@ APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, char *outbuf, apr_size_t *outbytes_left); -/* See the comment in apr_file_io.h about this hack */ +/* @see apr_file_io.h the comment in apr_file_io.h about this hack */ #ifdef APR_NOT_DONE_YET /** * The purpose of apr_xlate_conv_char is to translate one character @@ -144,7 +159,6 @@ APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, * parameters of conversion * @param inchar The character to convert * @param outchar The converted character - * @deffunc apr_status_t apr_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar) */ APR_DECLARE(apr_status_t) apr_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar); @@ -155,9 +169,8 @@ APR_DECLARE(apr_status_t) apr_xlate_conv_char(apr_xlate_t *convset, * @param convset The handle allocated by apr_xlate_open, specifying the * parameters of conversion * @param inchar The single-byte character to convert. - * @deffunc apr_int32_t apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar) - * @tip This only works when converting between single-byte character sets. - * -1 will be returned if the conversion can't be performed. + * @warning This only works when converting between single-byte character sets. + * -1 will be returned if the conversion can't be performed. */ APR_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar); @@ -165,15 +178,18 @@ APR_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, /** * Close a codepage translation handle. * @param convset The codepage translation handle to close - * @deffunc apr_status_t apr_xlate_close(apr_xlate_t *convset) */ APR_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset); #else - +/** + * handle for the Translation routines + * (currently not implemented) + */ typedef void apr_xlate_t; -/* For platforms where we don't bother with translating between charsets, +/** + * For platforms where we don't bother with translating between charsets, * these are macros which always return failure. */ @@ -186,7 +202,8 @@ typedef void apr_xlate_t; #define apr_xlate_conv_byte(convset, inchar) (-1) -/* The purpose of apr_xlate_conv_char is to translate one character +/** + * The purpose of apr_xlate_conv_char is to translate one character * at a time. This needs to be written carefully so that it works * with double-byte character sets. */ @@ -196,6 +213,7 @@ typedef void apr_xlate_t; #endif /* ! APR_HAS_XLATE */ +/** @} */ #ifdef __cplusplus } #endif From b2b0dffc30f6672b7255953005d2d4aac3252888 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 24 Aug 2001 18:04:24 +0000 Subject: [PATCH 2225/7878] APR is now Doxygen'ed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62223 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ STATUS | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index f94ff6e46f1..894119a2818 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ Changes with APR b1 + *) APR Documentation is now in Doxygen format. + [Ian Holsman] *) Get apr_ungetc() to work with buffered files on Unix. [Jeff Trawick] diff --git a/STATUS b/STATUS index 0444e26e190..e0a42368cfa 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/08/23 04:03:37 $] +Last modified at [$Date: 2001/08/24 18:04:24 $] Release: @@ -188,6 +188,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Documentation that needs writing: * API documentation + Ian Says: APR Stuff in now in Doxygen format, which is the first step. Stuff waiting for code thawing after Beta 1: From cd32a5154ede77b65090ce0d749ddf960cf52d1e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 26 Aug 2001 05:15:45 +0000 Subject: [PATCH 2226/7878] Some notes I was taking git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62224 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_compat.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/apr_compat.h b/include/apr_compat.h index 471849ba8ff..93f8b20a201 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -88,6 +88,10 @@ #define ap_note_subprocess apr_pool_note_subprocess /** @deprecated @see apr_pool_cleanup_null */ #define ap_null_cleanup apr_pool_cleanup_null +/** @deprecated @see apr_filepath_merge */ +#define ap_os_canonical_filename apr_filepath_merge +/** @deprecated @see apr_filepath_merge */ +#define ap_os_case_canonical_filename apr_filepath_merge /** @deprecated @see apr_dso_load */ #define ap_os_dso_load apr_dso_load /** @deprecated @see apr_dso_unload */ @@ -96,8 +100,13 @@ #define ap_os_dso_sym apr_dso_sym /** @deprecated @see apr_dso_error */ #define ap_os_dso_error apr_dso_error +/** @deprecated @see apr_filepath_merge + * @tip apr_filepath_merge rejects invalid filenames */ +#define ap_os_is_filename_valid apr_filepath_merge /** @deprecated @see apr_proc_kill */ #define ap_os_kill apr_proc_kill +/** @deprecated @see apr_filepath_merge */ +#define ap_os_systemcase_canonical_filename apr_filepath_merge /** @deprecated @see apr_table_overlap */ #define ap_overlap_tables apr_table_overlap /** @deprecated @see apr_table_overlay */ From 4d97fa63ecd082d3f39ba698cf630ed8fed210ec Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 26 Aug 2001 05:21:49 +0000 Subject: [PATCH 2227/7878] Toggle the /Zi flag to allow all supportd versions of VC (5, 6, 7) to build 'out of the box' in debugging mode. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62225 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 2 +- libapr.dsp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apr.dsp b/apr.dsp index 3c9362f14e1..0a9969714e1 100644 --- a/apr.dsp +++ b/apr.dsp @@ -64,7 +64,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 diff --git a/libapr.dsp b/libapr.dsp index 1b2dad4a099..ab30ce46c8e 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -68,7 +68,7 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\apr" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" From b00daca2dc6f2c29df3ad44a5b8a96f118583e3a Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 26 Aug 2001 05:43:13 +0000 Subject: [PATCH 2228/7878] Drop hint that gethostby*() functions are thread safe on OS/2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62226 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 659f09b4a5f..5bcc3375c9a 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -93,6 +93,8 @@ if test "x$apr_preload_done" != "xyes" ; then ;; *os2_emx*) APR_SETVAR(SHELL, [sh]) + APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes]) + APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes]) ;; *-hi-hiux) APR_ADDTO(CPPFLAGS, [-DHIUX]) From 501f93caec9127e03bd7dd72e60272c9208d3351 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 27 Aug 2001 03:17:15 +0000 Subject: [PATCH 2229/7878] Add an apr_thread_once function to allow a program to make sure that a function is only called once. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62227 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ include/apr_thread_proc.h | 22 ++++++++++++++++++++++ include/arch/unix/threadproc.h | 5 +++++ threadproc/unix/thread.c | 13 +++++++++++++ 4 files changed, 45 insertions(+) diff --git a/CHANGES b/CHANGES index 894119a2818..d6879e543bc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ Changes with APR b1 + + *) Add an apr_thread_once function to APR. This allows a + program to ensure that a function is only called once. + [Ryan Bloom] + *) APR Documentation is now in Doxygen format. [Ian Holsman] diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index b08af63ce79..e4cfb33b2bb 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -129,6 +129,7 @@ struct apr_proc_t { typedef struct apr_thread_t apr_thread_t; typedef struct apr_threadattr_t apr_threadattr_t; typedef struct apr_procattr_t apr_procattr_t; +typedef struct apr_thread_once_t apr_thread_once_t; typedef struct apr_threadkey_t apr_threadkey_t; #if APR_HAS_OTHER_CHILD @@ -224,6 +225,27 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, */ APR_DECLARE(void) apr_thread_yield(void); +/** + * Initialize the control variable for apr_thread_once. If this isn't + * called, apr_initialize won't work. + * @param control The control variable to initialize + * @param p The pool to allocate data from. + */ +APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, + apr_pool_t *p); + +/** + * Run the specified function one time, regardless of how many threads + * call it. + * @param control The control variable. The same variable should + * be passed in each time the function is tried to be + * called. This is how the underlying functions determine + * if the function has ever been called before. + * @param func The function to call. + */ +APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, + void (*func)(void)); + /** * detach a thread * @param thd The thread to detach diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index 388b78aa6e2..31c26324043 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -103,6 +103,11 @@ struct apr_threadkey_t { apr_pool_t *cntxt; pthread_key_t key; }; + +struct apr_thread_once_t { + pthread_once_t once; +}; + #endif struct apr_procattr_t { diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index d360543ce28..7792d247b49 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -255,6 +255,19 @@ APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, + apr_pool_t *p) +{ + (*control)->once = PTHREAD_ONCE_INIT; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, + void (*func)(void)) +{ + return pthread_once(&control->once, func); +} + APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) #endif /* HAVE_PTHREAD_H */ From 19e48a72417ef8787f032e177905af145f63b7b0 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 27 Aug 2001 05:16:48 +0000 Subject: [PATCH 2230/7878] Add explanatory note about the EXTRA_LIBS="-lm -lcrypt -lnsl -ldl" bogosity due to autoconf lameness. I think we could do some things to work around it, but now that the problem is definitely autoconf's, I don't feel like hacking around something that is their problem and that they could fix in ~2 lines. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62228 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.in b/configure.in index 541d8a652cc..91412b4058b 100644 --- a/configure.in +++ b/configure.in @@ -261,6 +261,10 @@ case $host in esac dnl #----------------------------- Checks for Any required Libraries +dnl Note: Autoconf will always append LIBS with an extra " " in AC_CHECK_LIB. +dnl It should check for LIBS being empty and set LIBS equal to the new value +dnl without the extra " " in that case, but they didn't do that. So, we +dnl end up LIBS="-lm -lcrypt -lnsl -ldl" which is an annoyance. AC_CHECK_LIB(nsl, gethostbyname) AC_SEARCH_LIBS(gethostname, nsl) AC_CHECK_LIB(socket, socket) From f68aaac8b61e082513feacb45eb931df3bd37cbf Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 27 Aug 2001 10:48:05 +0000 Subject: [PATCH 2231/7878] PTHREAD_ONCE_INIT is for initialization, not arbitrary assignment (cc on Tru64 is happier now) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62229 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/thread.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 7792d247b49..193be85f599 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -258,7 +258,9 @@ APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, apr_pool_t *p) { - (*control)->once = PTHREAD_ONCE_INIT; + static const pthread_once_t once_init = PTHREAD_ONCE_INIT; + + (*control)->once = once_init; return APR_SUCCESS; } From e40f6afcffb6e80dccdf92f3fdfa11c5e753a821 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 27 Aug 2001 19:11:04 +0000 Subject: [PATCH 2232/7878] Added the NetWare version of networkio.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62230 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/networkio.h | 65 ++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 include/arch/netware/networkio.h diff --git a/include/arch/netware/networkio.h b/include/arch/netware/networkio.h new file mode 100644 index 00000000000..361ff965454 --- /dev/null +++ b/include/arch/netware/networkio.h @@ -0,0 +1,65 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef NETWORK_IO_H + +/* Making sure that we include the correct networkio.h since the + the project file is configured to first look for headers in + arch/netware and then arch/unix. But in this specific case we + want arch/win32. +*/ +#include <..\win32\networkio.h> + +#endif /* ! NETWORK_IO_H */ + From 7007074c3bf74b15384308056a88e014e40cd0ac Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 27 Aug 2001 19:14:20 +0000 Subject: [PATCH 2233/7878] Moved the #define's WSAHighByte and WSALowByte outside of the WIN32 exclusive #ifdef so that we could include them with the NETWARE build also. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62231 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/misc.h | 5 ++++- include/arch/win32/misc.h | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index e896f1224d1..e455f7b25ea 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -97,9 +97,12 @@ struct apr_other_child_rec_t { apr_os_file_t write_fd; }; -#ifdef WIN32 +#if defined(WIN32) || defined(NETWARE) #define WSAHighByte 2 #define WSALowByte 0 +#endif + +#ifdef WIN32 /* Platform specific designation of run time os version. * Gaps allow for specific service pack levels that * export new kernel or winsock functions or behavior. diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index e896f1224d1..e455f7b25ea 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -97,9 +97,12 @@ struct apr_other_child_rec_t { apr_os_file_t write_fd; }; -#ifdef WIN32 +#if defined(WIN32) || defined(NETWARE) #define WSAHighByte 2 #define WSALowByte 0 +#endif + +#ifdef WIN32 /* Platform specific designation of run time os version. * Gaps allow for specific service pack levels that * export new kernel or winsock functions or behavior. From bbf4d3f5fb3dfb6a6d18efe02e72f2e0f08bfe0c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 27 Aug 2001 20:02:31 +0000 Subject: [PATCH 2234/7878] Here is the near-completion of APR_FILEPATH_TRUENAME for Win32. It really needs a richer error reporting and 'additional path info' mechanism, I believe. Right now we simply stop parsing at a /path/file/more situation and return the /more string as given. This would be fine for /path/dir/more where more doesn't exist, but it's a little obscure for the /path/file/more example. Comments are welcome, especially from the OS2/Netware/OS-X folks who need similar behavior. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62232 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 128 +++++++++++++++++++++++++++++++++------ 1 file changed, 110 insertions(+), 18 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index b23c4d120d3..0f4a386d4ab 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -757,8 +757,9 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } else if (seglen == 2 && addpath[0] == '.' && addpath[1] == '.') { - /* NOTE: win32 _hates_ '/.. /' (yes, with a space in there) and - * '/..../' so eliminate all preconceptions that they are valid. + /* NOTE: win32 _hates_ '/.. /' (yes, with a space in there) + * and '/..../', some functions treat it as ".", and some + * fail! Eliminate all preconceptions that they are valid. */ if (seglen < segend && (seglen != 3 || addpath[2] != '.')) return APR_EBADPATH; @@ -830,7 +831,6 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, apr_status_t testtype; apr_size_t i = (addpath[segend] != '\0'); - /* This isn't legal unless the unc path is complete! */ if (seglen < segend) @@ -886,7 +886,6 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, addpath += segend; } - path[pathlen] = '\0'; /* keptlen will be the baselen unless the addpath contained * backpath elements. If so, and APR_FILEPATH_NOTABOVEROOT @@ -896,7 +895,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * segment is thoroughly tested prior to path parsing. */ if (flags & APR_FILEPATH_NOTABOVEROOT && (keptlen - rootlen) < baselen) { - if (strncmp(basepath, path + rootlen, baselen)) + if (memcmp(basepath, path + rootlen, baselen)) return APR_EABOVEROOT; /* Ahem... if we weren't given a trailing slash on the basepath, @@ -908,22 +907,115 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, return APR_EABOVEROOT; } -#if 0 - /* Just an idea - still don't know where it's headed */ - if (addpath && addpath[endseg - 1] != '/' - && (flags & APR_FILEPATH_TRUECASE)) { - apr_finfo_t finfo; - if (apr_stat(&finfo, path, APR_FINFO_TYPE, p) == APR_SUCCESS) { - if (addpath[endseg - 1] != finfo.filetype == APR_DIR) { - if (endseg + 1 >= sizeof(path)) - return APR_ENAMETOOLONG; - path[endseg++] = '/'; - path[endseg] = '\0'; + if (addpath && (flags & APR_FILEPATH_TRUENAME)) { + /* We can always skip the root, it's already true-named. */ + if (rootlen > keptlen) + keptlen = rootlen; + if ((path[keptlen] == '/') || (path[keptlen] == '\\')) { + /* By rights, keptlen may grown longer than pathlen. + * we wont' use it again (in that case) so we don't care. + */ + ++keptlen; + } + /* Go through all the new segments */ + while (keptlen < pathlen) { + apr_finfo_t finfo; + char saveslash = 0; + seglen = 0; + /* find any slash and set it aside for a minute. */ + for (seglen = 0; keptlen + seglen < pathlen; ++seglen) { + if ((path[keptlen + seglen] == '/') || + (path[keptlen + seglen] == '\\')) { + saveslash = path[keptlen + seglen]; + break; + } + } + /* Null term for stat! */ + path[keptlen + seglen] = '\0'; + if ((rv = apr_stat(&finfo, path, APR_FINFO_TYPE | APR_FINFO_NAME, p)) + == APR_SUCCESS) { + size_t namelen = strlen(finfo.name); + if ((namelen != seglen) || + (memcmp(finfo.name, path + keptlen, seglen) != 0)) + { + if (namelen <= seglen) { + memcpy(path + keptlen, finfo.name, namelen); + if ((namelen < seglen) && saveslash) { + memmove(path + keptlen + namelen + 1, + path + keptlen + seglen + 1, + pathlen - keptlen - seglen); + pathlen += namelen - seglen; + seglen = namelen; + } + } + else { /* namelen > seglen */ + if (pathlen + namelen - seglen >= sizeof(path)) + return APR_ENAMETOOLONG; + if ((namelen < seglen) && saveslash) { + memmove(path + keptlen + namelen + 1, + path + keptlen + seglen + 1, + pathlen - keptlen - seglen); + } + memcpy(path + keptlen, finfo.name, namelen); + pathlen += namelen - seglen; + seglen = namelen; + } + } + /* That's it, the rest is path info. + * I don't know how we aught to handle this. Should + * we define a new error to indicate 'more info'? + * Should we split out the rest of the path? + */ + if ((finfo.filetype != APR_DIR) && + (finfo.filetype != APR_LNK) && saveslash) + rv = APR_ENOTDIR; +#ifdef XXX_FIGURE_THIS_OUT + { + /* the example inserts a null between the end of + * the filename and the next segment, and increments + * the path length so we would return both segments. + */ + if (saveslash) { + keptlen += seglen; + path[keptlen] = saveslash; + if (pathlen + 1 >= sizeof(path)) + return APR_ENAMETOOLONG; + memmove(path + keptlen + 1, + path + keptlen, + pathlen - keptlen); + path[keptlen] = '\0'; + ++pathlen; + break; + } + } +#endif + } + + /* put back the '/' */ + if (saveslash) { + path[keptlen + seglen] = saveslash; + ++seglen; + } + keptlen += seglen; + + if (rv != APR_SUCCESS) { + if (APR_STATUS_IS_ENOENT(rv)) + break; + else if (APR_STATUS_IS_ENOENT(rv)) + /* This is a little more serious, we just added a name + * onto a filename (think http's CGI MORE_INFO) + * If the caller is foolish enough to do this, we expect + * the've already canonicalized the root) that they knew + * what they are doing :( + */ + break; + else + return rv; } } } -#endif - *newpath = apr_pstrdup(p, path); + *newpath = apr_pmemdup(p, path, pathlen + 1); + (*newpath)[pathlen] = '\0'; return APR_SUCCESS; } From fcf94e35ddf3fc1cc70227ad553663eb41619f70 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 28 Aug 2001 00:16:08 +0000 Subject: [PATCH 2235/7878] Basically added a call to apr_dso_load() to make sure that any module that is loaded by APR will be autounloaded by the OS when all references to the module are released git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62233 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 726034c78b1..6fe8b0f11c4 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -72,6 +72,13 @@ #include /* for strerror() on HP-UX */ #endif +#ifdef NETWARE +#include +#include + +static int setautounloadflag (const char *path); +#endif + APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, apr_os_dso_handle_t osdso, apr_pool_t *pool) @@ -163,6 +170,10 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, apr_pool_cleanup_register(pool, *res_handle, dso_cleanup, apr_pool_cleanup_null); +#ifdef NETWARE + setautounloadflag(path); +#endif + return APR_SUCCESS; } @@ -244,4 +255,14 @@ APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, return "No Error"; } +#ifdef NETWARE +static int setautounloadflag (const char *path) +{ + char name[256]; + + deconstruct(path, NULL, NULL, NULL, name, NULL, NULL, PATH_UNDEF); + SetAutoUnloadFlag(findnlmhandle(name, getaddressspace())); +} +#endif + #endif From f599919420672284331eec0fb72cc15bb2e16841 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 28 Aug 2001 00:30:45 +0000 Subject: [PATCH 2236/7878] Added some NetWare specific misc files git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62234 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/aprlib.def | 3 + misc/netware/aprlib.imp | 175 ++++++++++++++++++++++++++++++++++++++++ misc/netware/pre_nw.h | 43 ++++++++++ 3 files changed, 221 insertions(+) create mode 100644 misc/netware/aprlib.def create mode 100644 misc/netware/aprlib.imp create mode 100644 misc/netware/pre_nw.h diff --git a/misc/netware/aprlib.def b/misc/netware/aprlib.def new file mode 100644 index 00000000000..5661dc6b705 --- /dev/null +++ b/misc/netware/aprlib.def @@ -0,0 +1,3 @@ +MODULE LIBC.NLM +MODULE WS2_32.NLM +EXPORT @aprlib.imp \ No newline at end of file diff --git a/misc/netware/aprlib.imp b/misc/netware/aprlib.imp new file mode 100644 index 00000000000..6a51b710947 --- /dev/null +++ b/misc/netware/aprlib.imp @@ -0,0 +1,175 @@ + apr_stat, + apr_shutdown, + apr_bind, + apr_listen, + apr_accept, + apr_connect, + apr_gethostname, + apr_send, + apr_recv, + apr_setsocketopt, + apr_sendv, + apr_poll, + apr_thread_exit, + apr_thread_join, + apr_thread_detach, + apr_initialize, + apr_getopt_init, + apr_getopt, + apr_ansi_time_to_apr_time, + apr_time_now, + apr_implode_time, + apr_explode_gmt, + apr_explode_localtime, + apr_ctime, + apr_rfc822_date, + apr_strftime, + apr_strerror, + apr_cpystrn, + apr_fnmatch, + apr_is_fnmatch, + apr_palloc, + apr_pcalloc, + apr_pstrdup, + apr_pstrndup, + apr_pstrcat, + apr_pvsprintf, + apr_psprintf, + apr_array_cat, + apr_array_append, + apr_array_pstrcat, + apr_array_make, + apr_array_push, + apr_table_get, + apr_table_set, + apr_table_setn, + apr_table_unset, + apr_table_merge, + apr_table_mergen, + apr_table_add, + apr_table_addn, + apr_table_do, + apr_vformatter, + apr_snprintf, + apr_vsnprintf, + apr_tokenize_to_argv, + apr_filename_of_pathname, + apr_terminate, + apr_day_snames, + apr_month_snames, + apr_dso_load, + apr_dso_unload, + apr_dso_sym, + apr_pool_destroy, + apr_pool_create, + apr_pool_clear, + apr_pool_cleanup_null, + apr_pool_cleanup_register, + apr_pool_note_subprocess, + apr_sort_hooks, + apr_hook_deregister_all, + apr_hook_sort_register, + apr_socket_addr_get, + apr_getnameinfo, + apr_sockaddr_info_get, + apr_sockaddr_port_get, + apr_file_seek, + apr_file_read, + apr_file_open, + apr_file_close, + apr_file_open_stderr, + apr_file_flush, + apr_file_dup, + apr_file_puts, + apr_file_printf, + apr_brigade_create, + apr_brigade_split, + apr_brigade_destroy, + apr_bucket_file_create, + apr_bucket_eos_create, + apr_bucket_socket_create, + apr_bucket_type_eos, + apr_bucket_type_flush, + apr_bucket_type_file, + apr_procattr_create, + apr_procattr_io_set, + apr_proc_create, + apr_global_hook_pool, + apr_current_hooking_module, + apr_debug_module_hooks, + apr_show_hook, + apr_lstat, + apr_dir_open, + apr_dir_read, + apr_dir_close, + apr_sockaddr_ip_get, + apr_parse_addr_port, + apr_os_sock_get, + apr_socket_close, + apr_lock_acquire, + apr_lock_release, + apr_poll_setup, + apr_poll_socket_add, + apr_lock_acquire, + apr_poll_revents_get, + apr_lock_release, + apr_lock_child_init, + apr_setup_signal_thread, + apr_lock_create, + apr_threadattr_create, + apr_threadattr_detach_set, + apr_thread_create, + apr_thread_yield, + apr_file_write, + apr_file_pipe_create, + apr_file_pipe_timeout_set, + apr_file_getc, + apr_file_gets, + apr_file_info_get, + apr_proc_detach, + apr_pool_cleanup_kill, + apr_base64_decode_len, + apr_base64_decode, + apr_brigade_puts, + apr_brigade_length, + apr_brigade_partition, + apr_brigade_write, + apr_table_overlay, + apr_table_clear, + apr_table_make, + apr_table_overlap, + apr_table_copy, + apr_bucket_pool_create, + apr_bucket_flush_create, + apr_bucket_heap_create, + apr_bucket_transient_create, + apr_md5_final, + apr_md5_init, + apr_md5_update, + apr_sleep, + apr_proc_wait, + apr_proc_wait_all_procs, + apr_signal_get_description, + apr_socket_create, + apr_bucket_immortal_create, + apr_ipsubnet_create, + apr_ipsubnet_test, + apr_password_validate, + apr_file_eof, + apr_strnatcmp, + apr_procattr_dir_set, + apr_procattr_cmdtype_set, + apr_bucket_pipe_create, + apr_retrieve_optional_fn, + apr_get_username, + apr_hash_get, + apr_hash_make, + apr_hash_set, + apr_register_optional_fn, + apr_file_ungetc, + apr_dso_error, + apr_get_home_directory, + apr_bucket_setaside_notimpl, + apr_bucket_split_notimpl, + apr_bucket_copy_notimpl, + diff --git a/misc/netware/pre_nw.h b/misc/netware/pre_nw.h new file mode 100644 index 00000000000..6a3d99c45d9 --- /dev/null +++ b/misc/netware/pre_nw.h @@ -0,0 +1,43 @@ +#ifndef __pre_nw__ +#define __pre_nw__ + +#pragma precompile_target "precomp.mch" +#define NETWARE + + +#define N_PLAT_NLM + +/* hint for MSL C++ that we're on NetWare platform */ +#define __NETWARE__ + +/* the FAR keyword has no meaning in a 32-bit environment + but is used in the SDK headers so we take it out */ +#define FAR +#define far + +/* no-op for Codewarrior C compiler; a functions are cdecl + by default */ +#define cdecl + +/* if we have wchar_t enabled in C++, predefine this type to avoid + a conflict in Novell's header files */ +#if (__option(cplusplus) && __option(wchar_type)) +#define _WCHAR_T +#endif + +/* C9X defintion used by MSL C++ library */ +#define DECIMAL_DIG 17 + +/* define long long typedefs for Watcom compatiblity */ +typedef long long int64_t; +typedef unsigned long long uint64_t; + +/* some code may want to use the MS convention for long long */ +#ifndef __int64 +#define __int64 long long +#endif + +#endif + + + From dbc50178127f1727b1e812ed456e90f7ef6c961c Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 28 Aug 2001 00:31:58 +0000 Subject: [PATCH 2237/7878] Added the MP enabling file required during the link stage git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62235 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/apr.xdc | Bin 0 -> 128 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 misc/netware/apr.xdc diff --git a/misc/netware/apr.xdc b/misc/netware/apr.xdc new file mode 100644 index 0000000000000000000000000000000000000000..12a7f6ba2df41eccb047c2884088c022f9395540 GIT binary patch literal 128 zcmZ>Aba!K7U|?VbVr&2;2Lb{>% Date: Tue, 28 Aug 2001 01:56:09 +0000 Subject: [PATCH 2238/7878] Found a very ugly reaction to using apr_file_seek(APR_CUR, -value) in conjuction with buffered reads. Thank you for toggling that case Jeff, so I could shoot out this bug ;) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62236 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 15 +++++++++------ file_io/win32/seek.c | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 3b26821f304..f8e675fe0bd 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -159,7 +159,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *len) { - apr_size_t rv; + apr_status_t rv; DWORD bytes_read = 0; if (*len <= 0) { @@ -196,16 +196,19 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos >= thefile->dataRead) { + apr_size_t read; rv = read_with_timeout(thefile, thefile->buffer, - APR_FILE_BUFSIZE, &thefile->dataRead); - if (thefile->dataRead == 0) { + APR_FILE_BUFSIZE, &read); + if (read == 0) { if (rv == APR_EOF) thefile->eof_hit = TRUE; break; } - - thefile->filePtr += thefile->dataRead; - thefile->bufpos = 0; + else { + thefile->dataRead = read; + thefile->filePtr += thefile->dataRead; + thefile->bufpos = 0; + } } blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size; diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 5698c356970..431ba55fdbc 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -82,7 +82,7 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) else rc = APR_SUCCESS; if (rc == APR_SUCCESS) - thefile->bufpos = thefile->dataRead = 0; + thefile->eof_hit = thefile->bufpos = thefile->dataRead = 0; } return rc; From a576b619a58cbfe54944e32bc272376e6a4ae7f2 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 28 Aug 2001 14:37:14 +0000 Subject: [PATCH 2239/7878] Added an #ifdef for NetWare to rename to loadable module to MOD_TEST.NLM. This is only because NetWare expects the general purpose executibles to be named with a .NLM extension. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62237 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testdso.c b/test/testdso.c index 4283475970e..06f6d4a97e8 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -9,7 +9,11 @@ #include #endif +#ifdef NETWARE +#define LIB_NAME "mod_test.nlm" +#else #define LIB_NAME "mod_test.so" +#endif int main (int argc, char ** argv) { From 2537ea37928b9c0452e921e10be510d709a60637 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 28 Aug 2001 16:17:04 +0000 Subject: [PATCH 2240/7878] OS/2: Fix bug in buffered read where buffer control variables were left in an inconsistent state after a 0 length read (EOF). The amount of data in the buffer (dataRead) was being reset but the current position within the buffer (bufpos) was not. This changes it so that dataRead is not reset, allowing the buffer contents to be reused after a seek. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62238 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 4e4ce04ef0d..d2cea2e8f00 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -88,12 +88,17 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size while (rc == 0 && size > 0) { if (thefile->bufpos >= thefile->dataRead) { - rc = DosRead(thefile->filedes, thefile->buffer, APR_FILE_BUFSIZE, &thefile->dataRead ); - if (thefile->dataRead == 0) { + ULONG bytesread; + rc = DosRead(thefile->filedes, thefile->buffer, + APR_FILE_BUFSIZE, &bytesread); + + if (bytesread == 0) { if (rc == 0) thefile->eof_hit = TRUE; break; } + + thefile->dataRead = bytesread; thefile->filePtr += thefile->dataRead; thefile->bufpos = 0; } From 7d25f145c041e9274af5470b959b16d564c7f2d8 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 28 Aug 2001 16:41:14 +0000 Subject: [PATCH 2241/7878] Fix calculation of new offset after a seek on a buffered file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62239 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/seek.c | 2 +- file_io/unix/seek.c | 2 +- file_io/win32/seek.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index 17f21782381..659629125e0 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -111,7 +111,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh break; } - *offset = thefile->filePtr + thefile->bufpos; + *offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; return rc; } else { switch (where) { diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 872d4385c3c..050fca9fe4e 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -110,7 +110,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh break; } - *offset = thefile->filePtr + thefile->bufpos; + *offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; return rc; } else { diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 431ba55fdbc..fb8051d7de1 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -115,7 +115,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh return APR_EINVAL; } - *offset = thefile->filePtr + thefile->bufpos; + *offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; return rc; } else if (thefile->pOverlapped) { From 614d4f2fdeee1768365e304a82c34d5b63dc62e5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 28 Aug 2001 16:44:20 +0000 Subject: [PATCH 2242/7878] tweak a message to mention an APR error value instead of an errno value git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62240 13f79535-47bb-0310-9956-ffa450edef68 --- test/testflock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testflock.c b/test/testflock.c index 7e5537a7380..1097f279c6c 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -118,7 +118,7 @@ static void do_read(void) status = apr_file_lock(file, APR_FLOCK_EXCLUSIVE | APR_FLOCK_NONBLOCK); if (!APR_STATUS_IS_EAGAIN(status)) { char msg[200]; - errmsg(apr_psprintf(pool, "Expected EAGAIN. Got %d: %s.\n", + errmsg(apr_psprintf(pool, "Expected APR_EAGAIN. Got %d: %s.\n", status, apr_strerror(status, msg, sizeof(msg)))); } printf("First attempt: we were properly locked out.\nWaiting for lock..."); From 254eabe45ae842d2b77876d9bcbe4c89358f8ad6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 28 Aug 2001 16:48:25 +0000 Subject: [PATCH 2243/7878] on some Unix boxes (e.g., Tru64), a non-blocking fcntl() lock request returns EACCES instead of the usual EAGAIN when some other task holds the lock since APR_STATUS_IS_EAGAIN() in the caller can't reasonably check for EACCES (since that would break other things), map EACCES to EAGAIN in the error path from fcntl() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62241 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/flock.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c index f95df8a61de..d1ffddbec57 100644 --- a/file_io/unix/flock.c +++ b/file_io/unix/flock.c @@ -84,8 +84,16 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) while ((rc = fcntl(thefile->filedes, fc, &l)) < 0 && errno == EINTR) continue; - if (rc == -1) + if (rc == -1) { + /* on some Unix boxes (e.g., Tru64), we get EACCES instead + * of EAGAIN; we don't want APR_STATUS_IS_EAGAIN() matching EACCES + * since that breaks other things, so fix up the retcode here + */ + if (errno == EACCES) { + return EAGAIN; + } return errno; + } } #elif defined(HAVE_SYS_FILE_H) { From b9fdeb14d4ac28cd96e494a53462bc331af2cc6b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 28 Aug 2001 21:45:04 +0000 Subject: [PATCH 2244/7878] Split all win32 specific system calls from filepath.c into filesys.c I don't care whether filepath.c remains in file_io/win32 or moves to file_io/os2. This is now generic enough for both ports to build upon. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62242 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 + file_io/win32/filepath.c | 233 +++----------------------------- file_io/win32/filesys.c | 261 ++++++++++++++++++++++++++++++++++++ include/arch/win32/fileio.h | 32 +++++ libapr.dsp | 4 + 5 files changed, 321 insertions(+), 213 deletions(-) create mode 100644 file_io/win32/filesys.c diff --git a/apr.dsp b/apr.dsp index 0a9969714e1..54097a78f0e 100644 --- a/apr.dsp +++ b/apr.dsp @@ -117,6 +117,10 @@ SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File +SOURCE=.\file_io\win32\filesys.c +# End Source File +# Begin Source File + SOURCE=.\file_io\win32\flock.c # End Source File # Begin Source File diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 0f4a386d4ab..3e3096d33c9 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -54,222 +54,17 @@ #include "apr.h" #include "fileio.h" -#include "apr_file_io.h" #include "apr_strings.h" -/* Win32 Exceptions: - * - * Note that trailing spaces and trailing periods are never recorded - * in the file system, except by a very obscure bug where any file - * that is created with a trailing space or period, followed by the - * ':' stream designator on an NTFS volume can never be accessed again. - * In other words, don't ever accept them when designating a stream! - * - * An interesting side effect is that two or three periods are both - * treated as the parent directory, although the fourth and on are - * not [strongly suggest all trailing periods are trimmed off, or - * down to two if there are no other characters.] - * - * Leading spaces and periods are accepted, however. - */ -static int is_fnchar(char ch) -{ - /* No control code between 0 and 31 is allowed - * The * ? < > codes all have wildcard effects - * The " / \ : are exlusively separator tokens - * The system doesn't accept | for any purpose. - * Oddly, \x7f _is_ acceptable. - */ - if (ch >= 0 && ch < 32) - return 0; - - if (ch == '\"' || ch == '*' || ch == '/' - || ch == ':' || ch == '<' || ch == '>' - || ch == '?' || ch == '\\' || ch == '|') - return 0; - - return 1; -} - - -static apr_status_t filepath_root_test(char *path, - apr_pool_t *p) -{ - apr_status_t rv; -#if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) - { - apr_wchar_t wpath[APR_PATH_MAX]; - if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), path)) - return rv; - rv = GetDriveTypeW(wpath); - } - else -#endif - rv = GetDriveType(path); - - if (rv == DRIVE_UNKNOWN || rv == DRIVE_NO_ROOT_DIR) - return APR_EBADPATH; - return APR_SUCCESS; -} - - -APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, - apr_pool_t *p) -{ - char path[APR_PATH_MAX]; -#if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) - { - apr_wchar_t wpath[APR_PATH_MAX]; - apr_status_t rv; - if (!GetCurrentDirectoryW(sizeof(wpath) / sizeof(apr_wchar_t), wpath)) - return apr_get_os_error(); - if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) - return rv; - } - else -#endif - { - if (!GetCurrentDirectory(sizeof(path), path)) - return apr_get_os_error(); - } - /* ###: We really should consider adding a flag to allow the user - * to have the APR_FILEPATH_NATIVE result - */ - for (*rootpath = path; **rootpath; ++*rootpath) { - if (**rootpath == '\\') - **rootpath = '/'; - } - *rootpath = apr_pstrdup(p, path); - return APR_SUCCESS; -} - - -static apr_status_t filepath_drive_get(char **rootpath, - char drive, - apr_pool_t *p) -{ - char path[APR_PATH_MAX]; -#if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) - { - apr_wchar_t *ignored; - apr_wchar_t wdrive[8]; - apr_wchar_t wpath[APR_PATH_MAX]; - apr_status_t rv; - /* ???: This needs review, apparently "\\?\d:." returns "\\?\d:" - * as if that is useful for anything. - */ - wcscpy(wdrive, L"D:."); - wdrive[0] = (apr_wchar_t)(unsigned char)drive; - if (!GetFullPathNameW(wdrive, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored)) - return apr_get_os_error(); - if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) - return rv; - } - else -#endif - { - char *ignored; - char drivestr[4]; - drivestr[0] = drive; - drivestr[1] = ':'; - drivestr[2] = '.';; - drivestr[3] = '\0'; - if (!GetFullPathName(drivestr, sizeof(path), path, &ignored)) - return apr_get_os_error(); - } - /* ###: We really should consider adding a flag to allow the user - * to have the APR_FILEPATH_NATIVE result - */ - for (*rootpath = path; **rootpath; ++*rootpath) { - if (**rootpath == '\\') - **rootpath = '/'; - } - *rootpath = apr_pstrdup(p, path); - return APR_SUCCESS; -} - - -static apr_status_t filepath_root_case(char **rootpath, - char *root, - apr_pool_t *p) -{ -#if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) - { - apr_wchar_t *ignored; - apr_wchar_t wpath[APR_PATH_MAX]; - apr_status_t rv; - /* ???: This needs review, apparently "\\?\d:." returns "\\?\d:" - * as if that is useful for anything. - */ - { - apr_wchar_t wroot[APR_PATH_MAX]; - if (rv = utf8_to_unicode_path(wroot, sizeof(wroot) - / sizeof(apr_wchar_t), root)) - return rv; - if (!GetFullPathNameW(wroot, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored)) - return apr_get_os_error(); - } - { - char path[APR_PATH_MAX]; - if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) - return rv; - *rootpath = apr_pstrdup(p, path); - } - } - else -#endif - { - char path[APR_PATH_MAX]; - char *ignored; - if (!GetFullPathName(root, sizeof(path), path, &ignored)) - return apr_get_os_error(); - *rootpath = apr_pstrdup(p, path); - } - return APR_SUCCESS; -} - - -APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath, - apr_pool_t *p) -{ -#if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) - { - apr_wchar_t wpath[APR_PATH_MAX]; - apr_status_t rv; - if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), rootpath)) - return rv; - if (!SetCurrentDirectoryW(wpath)) - return apr_get_os_error(); - } - else -#endif - { - if (!SetCurrentDirectory(rootpath)) - return apr_get_os_error(); - } - return APR_SUCCESS; -} - - -/* WinNT accepts several odd forms of a 'root' path. Under Unicode + /* WinNT accepts several odd forms of a 'root' path. Under Unicode * calls (ApiFunctionW) the //?/C:/foo or //?/UNC/mach/share/foo forms * are accepted. Ansi and Unicode functions both accept the //./C:/foo * form under WinNT/2K. Since these forms are handled in the utf-8 to * unicode translation phase, we don't want the user confused by them, so * we will accept them but always return the canonical C:/ or //mach/share/ + * + * OS2 appears immune from the nonsense :) */ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, @@ -284,10 +79,11 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, if (testpath[0] == '/' || testpath[0] == '\\') { if (testpath[1] == '/' || testpath[1] == '\\') { - /* //server/share isn't the only // delimited syntax */ + +#ifdef WIN32 /* //server/share isn't the only // delimited syntax */ if ((testpath[2] == '?' || testpath[2] == '.') && (testpath[3] == '/' || testpath[3] == '\\')) { - if (is_fnchar(testpath[4]) && testpath[5] == ':') + if (IS_FNCHAR(testpath[4]) && testpath[5] == ':') { apr_status_t rv; testpath += 4; @@ -315,12 +111,13 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, */ return APR_EBADPATH; } +#endif /* WIN32 (non - //server/share syntax) */ /* Evaluate path of '//[machine/[share[/]]]' */ delim1 = testpath + 2; do { /* Protect against //X/ where X is illegal */ - if (*delim1 && !is_fnchar(*(delim1++))) + if (*delim1 && !IS_FNCHAR(*(delim1++))) return APR_EBADPATH; } while (*delim1 && *delim1 != '/' && *delim1 != '\\'); @@ -329,7 +126,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, delim2 = delim1 + 1; while (*delim2 && *delim2 != '/' && *delim2 != '\\') { /* Protect against //machine/X/ where X is illegal */ - if (!is_fnchar(*(delim2++))) + if (!IS_FNCHAR(*(delim2++))) return APR_EBADPATH; } @@ -418,7 +215,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, } /* Evaluate path of 'd:[/]' */ - if (is_fnchar(*testpath) && testpath[1] == ':') + if (IS_FNCHAR(*testpath) && testpath[1] == ':') { apr_status_t rv; /* Validate that D:\ drive exists, test must be rooted @@ -935,6 +732,14 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, if ((rv = apr_stat(&finfo, path, APR_FINFO_TYPE | APR_FINFO_NAME, p)) == APR_SUCCESS) { size_t namelen = strlen(finfo.name); + +#ifdef OS2 /* only has case folding, never aliases that change the length */ + + if (memcmp(finfo.name, path + keptlen, seglen) != 0) { + memcpy(path + keptlen, finfo.name, namelen); + } +#else /* WIN32; here there be aliases that gire and gimble and change length */ + if ((namelen != seglen) || (memcmp(finfo.name, path + keptlen, seglen) != 0)) { @@ -961,6 +766,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, seglen = namelen; } } +#endif /* !OS2 (Whatever that alias was we're over it) */ + /* That's it, the rest is path info. * I don't know how we aught to handle this. Should * we define a new error to indicate 'more info'? diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c new file mode 100644 index 00000000000..1e94b06242a --- /dev/null +++ b/file_io/win32/filesys.c @@ -0,0 +1,261 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "fileio.h" +#include "apr_strings.h" + +/* Win32 Exceptions: + * + * Note that trailing spaces and trailing periods are never recorded + * in the file system, except by a very obscure bug where any file + * that is created with a trailing space or period, followed by the + * ':' stream designator on an NTFS volume can never be accessed again. + * In other words, don't ever accept them when designating a stream! + * + * An interesting side effect is that two or three periods are both + * treated as the parent directory, although the fourth and on are + * not [strongly suggest all trailing periods are trimmed off, or + * down to two if there are no other characters.] + * + * Leading spaces and periods are accepted, however. + * The * ? < > codes all have wildcard side effects + * The " / \ : are exclusively component separator tokens + * The system doesn't accept | for any (known) purpose + * Oddly, \x7f _is_ acceptable ;) + */ + +const char c_is_fnchar[256] = +{/* Reject all ctrl codes... */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + /* " * / : < > ? */ + 1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0, + /* \ */ + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1, + /* : | */ + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1, + /* High bit codes are accepted (subject to utf-8->Unicode xlation) */ + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 +}; + + +apr_status_t filepath_root_test(char *path, apr_pool_t *p) +{ + apr_status_t rv; +#if APR_HAS_UNICODE_FS + apr_oslevel_e os_level; + if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t wpath[APR_PATH_MAX]; + if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) + / sizeof(apr_wchar_t), path)) + return rv; + rv = GetDriveTypeW(wpath); + } + else +#endif + rv = GetDriveType(path); + + if (rv == DRIVE_UNKNOWN || rv == DRIVE_NO_ROOT_DIR) + return APR_EBADPATH; + return APR_SUCCESS; +} + + +apr_status_t filepath_drive_get(char **rootpath, char drive, apr_pool_t *p) +{ + char path[APR_PATH_MAX]; +#if APR_HAS_UNICODE_FS + apr_oslevel_e os_level; + if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t *ignored; + apr_wchar_t wdrive[8]; + apr_wchar_t wpath[APR_PATH_MAX]; + apr_status_t rv; + /* ???: This needs review, apparently "\\?\d:." returns "\\?\d:" + * as if that is useful for anything. + */ + wcscpy(wdrive, L"D:."); + wdrive[0] = (apr_wchar_t)(unsigned char)drive; + if (!GetFullPathNameW(wdrive, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored)) + return apr_get_os_error(); + if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) + return rv; + } + else +#endif + { + char *ignored; + char drivestr[4]; + drivestr[0] = drive; + drivestr[1] = ':'; + drivestr[2] = '.';; + drivestr[3] = '\0'; + if (!GetFullPathName(drivestr, sizeof(path), path, &ignored)) + return apr_get_os_error(); + } + /* ###: We really should consider adding a flag to allow the user + * to have the APR_FILEPATH_NATIVE result + */ + for (*rootpath = path; **rootpath; ++*rootpath) { + if (**rootpath == '\\') + **rootpath = '/'; + } + *rootpath = apr_pstrdup(p, path); + return APR_SUCCESS; +} + + +apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) +{ +#if APR_HAS_UNICODE_FS + apr_oslevel_e os_level; + if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t *ignored; + apr_wchar_t wpath[APR_PATH_MAX]; + apr_status_t rv; + /* ???: This needs review, apparently "\\?\d:." returns "\\?\d:" + * as if that is useful for anything. + */ + { + apr_wchar_t wroot[APR_PATH_MAX]; + if (rv = utf8_to_unicode_path(wroot, sizeof(wroot) + / sizeof(apr_wchar_t), root)) + return rv; + if (!GetFullPathNameW(wroot, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored)) + return apr_get_os_error(); + } + { + char path[APR_PATH_MAX]; + if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) + return rv; + *rootpath = apr_pstrdup(p, path); + } + } + else +#endif + { + char path[APR_PATH_MAX]; + char *ignored; + if (!GetFullPathName(root, sizeof(path), path, &ignored)) + return apr_get_os_error(); + *rootpath = apr_pstrdup(p, path); + } + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, + apr_pool_t *p) +{ + char path[APR_PATH_MAX]; +#if APR_HAS_UNICODE_FS + apr_oslevel_e os_level; + if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t wpath[APR_PATH_MAX]; + apr_status_t rv; + if (!GetCurrentDirectoryW(sizeof(wpath) / sizeof(apr_wchar_t), wpath)) + return apr_get_os_error(); + if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) + return rv; + } + else +#endif + { + if (!GetCurrentDirectory(sizeof(path), path)) + return apr_get_os_error(); + } + /* ###: We really should consider adding a flag to allow the user + * to have the APR_FILEPATH_NATIVE result + */ + for (*rootpath = path; **rootpath; ++*rootpath) { + if (**rootpath == '\\') + **rootpath = '/'; + } + *rootpath = apr_pstrdup(p, path); + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath, + apr_pool_t *p) +{ +#if APR_HAS_UNICODE_FS + apr_oslevel_e os_level; + if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + { + apr_wchar_t wpath[APR_PATH_MAX]; + apr_status_t rv; + if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) + / sizeof(apr_wchar_t), rootpath)) + return rv; + if (!SetCurrentDirectoryW(wpath)) + return apr_get_os_error(); + } + else +#endif + { + if (!SetCurrentDirectory(rootpath)) + return apr_get_os_error(); + } + return APR_SUCCESS; +} + + diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 164651fd7c5..afb4ab905ca 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -212,6 +212,38 @@ struct apr_dir_t { }; }; +/* There are many goofy characters we can't accept. Here's the list. + */ +extern const char c_is_fnchar[256]; + +#define IS_FNCHAR(c) c_is_fnchar[(unsigned char)c] + + +/* If the user passes APR_FILEPATH_TRUENAME to either + * apr_filepath_root or apr_filepath_merge, this fn determines + * that the root really exists. It's expensive, wouldn't want + * to do this too frequenly. + */ +apr_status_t filepath_root_test(char *path, apr_pool_t *p); + + +/* The apr_filepath_merge wants to canonicalize the cwd to the + * addpath if the user passes NULL as the old root path (this + * isn't true of an empty string "", which won't be concatinated. + * + * But we need to figure out what the cwd of a given volume is, + * when the user passes D:foo. This fn will determine D:'s cwd. + */ +apr_status_t filepath_drive_get(char **rootpath, char drive, apr_pool_t *p); + + +/* If the user passes d: vs. D: (or //mach/share vs. //MACH/SHARE), + * we need to fold the case to canonical form. This function is + * supposed to do so. + */ +apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p); + + apr_status_t file_cleanup(void *); /** diff --git a/libapr.dsp b/libapr.dsp index ab30ce46c8e..b3aa21db9f8 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -123,6 +123,10 @@ SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File +SOURCE=.\file_io\win32\filesys.c +# End Source File +# Begin Source File + SOURCE=.\file_io\win32\flock.c # End Source File # Begin Source File From f4bc9287813b937ed3758c98869d904c35cdb80e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 29 Aug 2001 15:20:24 +0000 Subject: [PATCH 2245/7878] Error codes from getaddrinfo() need their own range within the apr_status_t layout. This is used to fix the bungling of these error codes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62243 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ build/apr_network.m4 | 28 ++++++++++++++++++++++++++++ configure.in | 1 + include/apr_errno.h | 7 ++++++- misc/unix/errorcodes.c | 11 +++++++++++ network_io/unix/sa_common.c | 15 ++++++++------- 6 files changed, 56 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index d6879e543bc..4fca7a695c9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Fix the bungling of getaddrinfo() error codes. [Jeff Trawick] + *) Add an apr_thread_once function to APR. This allows a program to ensure that a function is only called once. [Ryan Bloom] diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 2da1daf44a6..af3531fcd59 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -103,6 +103,34 @@ if test "$ac_cv_working_getnameinfo" = "yes"; then fi ]) +dnl +dnl check for negative error codes for getaddrinfo() +dnl +AC_DEFUN(APR_CHECK_NEGATIVE_EAI,[ + AC_CACHE_CHECK(for negative error codes for getaddrinfo, ac_cv_negative_eai,[ + AC_TRY_RUN( [ +#ifdef HAVE_NETDB_H +#include +#endif + +void main(void) { + if (EAI_ADDRFAMILY < 0) { + exit(0); + } + exit(1); +} +],[ + ac_cv_negative_eai="yes" +],[ + ac_cv_negative_eai="no" +],[ + ac_cv_negative_eai="no" +])]) +if test "$ac_cv_negative_eai" = "yes"; then + AC_DEFINE(NEGATIVE_EAI, 1, [Define if EAI_ error codes from getaddrinfo are negative]) +fi +]) + dnl dnl check for gethostbyname() which handles numeric address strings dnl diff --git a/configure.in b/configure.in index 91412b4058b..24cff3877fd 100644 --- a/configure.in +++ b/configure.in @@ -1327,6 +1327,7 @@ AC_ARG_ENABLE(ipv6, AC_SEARCH_LIBS(getaddrinfo, inet6) AC_SEARCH_LIBS(getnameinfo, inet6) APR_CHECK_WORKING_GETADDRINFO +APR_CHECK_NEGATIVE_EAI APR_CHECK_WORKING_GETNAMEINFO APR_CHECK_SOCKADDR_IN6 AC_MSG_CHECKING(if APR supports IPv6) diff --git a/include/apr_errno.h b/include/apr_errno.h index eccbf5ad300..75e3b7bc754 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -152,6 +152,10 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * APR_OS_START_CANONERR is where APR versions of errno values are defined * on systems which don't have the corresponding errno. */ +/** + * APR_OS_START_EAIERR folds EAI_ error codes from getaddrinfo() into + * apr_status_t values. + */ /** * APR_OS_START_SYSERR folds platform-specific system error values into * apr_status_t values. @@ -160,7 +164,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_OS_START_STATUS (APR_OS_START_ERROR + 500) #define APR_OS_START_USEERR (APR_OS_START_STATUS + 500) #define APR_OS_START_CANONERR (APR_OS_START_USEERR + 500) -#define APR_OS_START_SYSERR (APR_OS_START_CANONERR + 500) +#define APR_OS_START_EAIERR (APR_OS_START_CANONERR + 500) +#define APR_OS_START_SYSERR (APR_OS_START_EAIERR + 500) #define APR_SUCCESS 0 diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index caea40ca601..b33a0835ade 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -365,8 +365,19 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, else if (statcode < APR_OS_START_USEERR) { return stuffbuffer(buf, bufsize, apr_error_string(statcode)); } + else if (statcode < APR_OS_START_EAIERR) { + return stuffbuffer(buf, bufsize, "APR does not understand this error code"); + } else if (statcode < APR_OS_START_SYSERR) { +#if defined(HAVE_GETADDRINFO) + statcode -= APR_OS_START_EAIERR; +#if defined(NEGATIVE_EAI) + statcode = -statcode; +#endif + return stuffbuffer(buf, bufsize, gai_strerror(statcode)); +#else return stuffbuffer(buf, bufsize, "APR does not understand this error code"); +#endif } else { return apr_os_strerror(buf, bufsize, statcode - APR_OS_START_SYSERR); diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 1290b7983e5..c03706e9bcf 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -355,14 +355,15 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, return errno; } else { - /* XXX fixme! - * no current way to represent this with APR's error - * scheme... note that glibc uses negative values for these - * numbers, perhaps so they don't conflict with h_errno - * values... Tru64 uses positive values which conflict - * with h_errno values + /* issues with representing this with APR's error scheme: + * glibc uses negative values for these numbers, perhaps so + * they don't conflict with h_errno values... Tru64 uses + * positive values which conflict with h_errno values */ - return error + APR_OS_START_SYSERR; +#if defined(NEGATIVE_EAI) + error = -error; +#endif + return error + APR_OS_START_EAIERR; } } cursa = *sa; From ba11b46b312e756da0e7b142bacee9c61e25b6c7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 29 Aug 2001 20:36:30 +0000 Subject: [PATCH 2246/7878] add another testcase which tests the interaction between read, gets, seek, and buffered files we run the test without buffering too just for the heck of it this test bombs on Unix without Brian Havard's recent patch, which I am about to commit it works fine on Win32 at the moment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62245 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/test/testfile.c b/test/testfile.c index b37d93114ac..79681c5d7c6 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -88,6 +88,7 @@ struct view_fileinfo void test_filedel(apr_pool_t *); void testdirs(apr_pool_t *); static void test_read(apr_pool_t *); +static void test_read_seek(apr_int32_t, apr_pool_t *); int main(void) { @@ -509,9 +510,96 @@ static void test_read(apr_pool_t *p) printf("%-60s", " More unbuffered file tests"); test_bigread(p, fname, 0); printf("OK\n"); + printf("%-60s", " Even more buffered file tests"); + test_read_seek(APR_BUFFERED, p); + printf("OK\n"); + printf("%-60s", " Even more unbuffered file tests"); + test_read_seek(0, p); + printf("OK\n"); rv = apr_file_remove(fname, p); assert(!rv); printf("%-60s", " All read tests"); printf("OK\n"); } +static void test_read_seek(apr_int32_t moreflags, apr_pool_t *p) +{ + const char *fname = "readseek.dat"; + apr_status_t rv; + apr_file_t *f; + apr_size_t nbytes; + const char *str1, *str2, *str3; + char buf[8192]; + apr_off_t seek_amt; + + /* create the content */ + + rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); + assert(!rv); + + str1 = "abcdefghijklmnopqrstuvwxyz\n"; + str2 = "1234567890\n"; + str3 = "1234567890-=+_)(*&^%$#@!\n"; + + nbytes = strlen(str1); + rv = apr_file_write(f, str1, &nbytes); + assert(!rv && nbytes == strlen(str1)); + + nbytes = strlen(str2); + rv = apr_file_write(f, str2, &nbytes); + assert(!rv && nbytes == strlen(str2)); + + nbytes = strlen(str3); + rv = apr_file_write(f, str3, &nbytes); + assert(!rv && nbytes == strlen(str3)); + + nbytes = strlen(str1); + rv = apr_file_write(f, str1, &nbytes); + assert(!rv && nbytes == strlen(str1)); + + nbytes = strlen(str2); + rv = apr_file_write(f, str2, &nbytes); + assert(!rv && nbytes == strlen(str2)); + + nbytes = strlen(str3); + rv = apr_file_write(f, str3, &nbytes); + assert(!rv && nbytes == strlen(str3)); + + rv = apr_file_close(f); + assert(!rv); + + rv = apr_file_open(&f, fname, APR_READ | moreflags, 0, p); + assert(!rv); + + rv = apr_file_gets(buf, sizeof buf, f); + assert(!rv); + assert(!strcmp(buf, str1)); + + rv = apr_file_gets(buf, sizeof buf, f); + assert(!rv); + assert(!strcmp(buf, str2)); + + nbytes = sizeof buf; + rv = apr_file_read(f, buf, &nbytes); + assert(!rv); + assert(nbytes == strlen(str3) + strlen(str1) + strlen(str2) + strlen(str3)); + assert(!memcmp(buf, str3, strlen(str3))); + + seek_amt = -(apr_off_t)(nbytes - strlen(str3) - strlen(str1)); + rv = apr_file_seek(f, APR_CUR, &seek_amt); + assert(!rv); + + rv = apr_file_gets(buf, sizeof buf, f); + assert(!rv); + assert(!strcmp(buf, str2)); + + rv = apr_file_gets(buf, sizeof buf, f); + assert(!rv); + assert(!strcmp(buf, str3)); + + rv = apr_file_close(f); + assert(!rv); + + rv = apr_file_remove(fname, p); + assert(!rv); +} From 1739d3be877a59226cf22e3a06343ea723bb765f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 29 Aug 2001 20:38:38 +0000 Subject: [PATCH 2247/7878] fix a problem with buffered files on unix which was exposed when we read to the end of the file then seeked back a ways then did fgets Submitted by: Brian Havard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62246 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ file_io/unix/readwrite.c | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 4fca7a695c9..9b59a978d2f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Fix a problem with buffered files on Unix. [Brian Havard] + *) Fix the bungling of getaddrinfo() error codes. [Jeff Trawick] *) Add an apr_thread_once function to APR. This allows a diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 8751873f52d..21148f0fde6 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -137,16 +137,17 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } while (rv == 0 && size > 0) { if (thefile->bufpos >= thefile->dataRead) { - thefile->dataRead = read(thefile->filedes, thefile->buffer, APR_FILE_BUFSIZE); - if (thefile->dataRead == 0) { + int bytesread = read(thefile->filedes, thefile->buffer, APR_FILE_BUFSIZE); + if (bytesread == 0) { thefile->eof_hit = TRUE; rv = APR_EOF; break; } - else if (thefile->dataRead == -1) { + else if (bytesread == -1) { rv = errno; break; } + thefile->dataRead = bytesread; thefile->filePtr += thefile->dataRead; thefile->bufpos = 0; } From 8ebb5445d8a22a7899cd7a52560f1ab7eebe83b2 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 29 Aug 2001 23:32:07 +0000 Subject: [PATCH 2248/7878] NetWare specific file system functions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62247 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filesys.c | 128 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 file_io/netware/filesys.c diff --git a/file_io/netware/filesys.c b/file_io/netware/filesys.c new file mode 100644 index 00000000000..e3f23ac6349 --- /dev/null +++ b/file_io/netware/filesys.c @@ -0,0 +1,128 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "fileio.h" +#include "apr_strings.h" + +apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) +{ +/* See the Windows code to figure out what to do here. + It probably checks to make sure that the root exists + and case it correctly according to the file system. +*/ + *rootpath = apr_pstrdup(p, root); + return APR_SUCCESS; +} + +apr_status_t filepath_has_drive(char *rootpath, int only, apr_pool_t *p) +{ + char *s; + + if (rootpath) { + s = strchr (rootpath, ':'); + if (only) + /* Test if the path only has a drive/volume and nothing else + */ + return (s && (s != rootpath) && !s[1]); + else + /* Test if the path includes a drive/volume + */ + return (s && (s != rootpath)); + } + return 0; +} + +apr_status_t filepath_compare_drive(char *path1, char *path2, apr_pool_t *p) +{ + char *s1, *s2; + + if (path1 && path2) { + s1 = strchr (path1, ':'); + s2 = strchr (path2, ':'); + + /* Make sure that they both have a drive/volume delimiter + and are the same size. Then see if they match. + */ + if (s1 && s2 && ((s1-path1) == (s2-path2))) { + return strnicmp (s1, s2, s1-path1); + } + } + return -1; +} + +APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, + apr_pool_t *p) +{ + char path[APR_PATH_MAX]; + if (!getcwd(path, sizeof(path))) { + if (errno == ERANGE) + return APR_ENAMETOOLONG; + else + return errno; + } + *rootpath = apr_pstrdup(p, path); + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath, + apr_pool_t *p) +{ + if (chdir2(rootpath) != 0) + return errno; + return APR_SUCCESS; +} + + From ba1dc03cce67bcfb1776729be9d28396f73b93f2 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 29 Aug 2001 23:35:04 +0000 Subject: [PATCH 2249/7878] NetWare port of apr_filepath_root() and apr_filepath_merge() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62248 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 103 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 99 insertions(+), 4 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 3e3096d33c9..360e644bd35 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -56,6 +56,9 @@ #include "fileio.h" #include "apr_strings.h" +#ifdef NETWARE +#include +#endif /* WinNT accepts several odd forms of a 'root' path. Under Unicode * calls (ApiFunctionW) the //?/C:/foo or //?/UNC/mach/share/foo forms @@ -73,9 +76,71 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, apr_pool_t *p) { const char *testpath = *inpath; + char *newpath; +#ifdef NETWARE + char server[MAX_SERVER_NAME+1]; + char volume[MAX_VOLUME_NAME+1]; + char path[MAX_PATH_NAME+1]; + char file[MAX_FILE_NAME+1]; + int elements; + + /* Allocate and initialize each of the segment buffers + */ + server[0] = volume[0] = path[0] = file[0] = '\0'; + + /* Split the inpath into its separate parts. If it fails then + we know we have a bad path. + */ + if (deconstruct(testpath, server, volume, path, file, NULL, &elements, PATH_UNDEF)) + return APR_EBADPATH; + + /* If we got a volume part then continue splitting out the root. + Otherwise we either have an incomplete or relative path + */ + if (strlen(volume) > 0) { + newpath = apr_pcalloc(p, strlen(server)+strlen(volume)+5); + construct(newpath, server, volume, NULL, NULL, NULL, PATH_NETWARE); + + /* NetWare doesn't add the root slash so we need to add it manually. + */ + if (flags & APR_FILEPATH_NATIVE) + strcat(newpath, "\\"); + else + strcat(newpath, "/"); + *rootpath = newpath; + + /* Skip the inpath pointer down to the first non-root character + */ + newpath = strchr (*inpath, ':'); + if (newpath) { + do { + ++newpath; + } while (*newpath && ((*newpath == '/') || (*newpath == '\\'))); + *inpath = newpath; + } + +/* Need to handle APR_FILEPATH_TRUENAME checking here. */ + + return APR_SUCCESS; + } + else if ((**inpath == '/') || (**inpath == '\\')) { + /* if we have a root path without a volume then just split + in same manner as unix although this path will be + incomplete. + */ + *rootpath = apr_pstrdup(p, ((flags & APR_FILEPATH_NATIVE) ? "\\" : "/")); + do { + ++(*inpath); + } while ((**inpath == '/') || (**inpath == '\\')); + } + else + return APR_ERELATIVE; + + return APR_EINCOMPLETE; + +#else const char *delim1; const char *delim2; - char *newpath; if (testpath[0] == '/' || testpath[0] == '\\') { if (testpath[1] == '/' || testpath[1] == '\\') { @@ -255,6 +320,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, /* Nothing interesting */ return APR_ERELATIVE; +#endif } @@ -276,7 +342,9 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, apr_status_t basetype = 0; /* from parsing the basepath's baseroot */ apr_status_t addtype; /* from parsing the addpath's addroot */ apr_status_t rv; +#ifndef NETWARE int fixunc = 0; /* flag to complete an incomplete UNC basepath */ +#endif /* Treat null as an empty path, otherwise split addroot from the addpath */ @@ -346,9 +414,11 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * if addroot is given in drive-relative form (e.g. d:foo) */ char *getpath; +#ifndef NETWARE if (addtype == APR_EINCOMPLETE && addroot[1] == ':') rv = filepath_drive_get(&getpath, addroot[0], p); else +#endif rv = apr_filepath_get(&getpath, p); if (rv != APR_SUCCESS) return rv; @@ -402,6 +472,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * and simple roots (/ as in /foo). * Deal with these in significantly different manners... */ +#ifndef NETWARE if ((addroot[0] == '/' || addroot[0] == '\\') && (addroot[1] == '/' || addroot[1] == '\\')) { @@ -418,7 +489,9 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, rootlen = pathlen = strlen(addroot); memcpy(path, addroot, pathlen); } - else if ((addroot[0] == '/' || addroot[0] == '\\') && !addroot[1]) + else +#endif + if ((addroot[0] == '/' || addroot[0] == '\\') && !addroot[1]) { /* Bring together the drive or UNC root from the baseroot * if the addpath is a simple root and basepath is rooted, @@ -427,10 +500,12 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, if (basetype != APR_EABSOLUTE && (flags & APR_FILEPATH_NOTRELATIVE)) return basetype; if (basetype != APR_ERELATIVE) { +#ifndef NETWARE if (basetype == APR_INCOMPLETE && (baseroot[0] == '/' || baseroot[0] == '\\') && (baseroot[1] == '/' || baseroot[1] == '\\')) fixunc = 1; +#endif keptlen = rootlen = pathlen = strlen(baseroot); memcpy(path, baseroot, pathlen); } @@ -442,6 +517,16 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, memcpy(path, addroot, pathlen); } } +#ifdef NETWARE + else if (filepath_has_drive(addroot, DRIVE_ONLY, p)) + { + /* If the addroot is a drive (without a volume root) + * use the basepath _if_ it matches this drive letter! + * Otherwise we must discard the basepath. + */ + if (!filepath_compare_drive(addroot, baseroot, p) && + filepath_has_drive(baseroot, 0, p)) { +#else else if (addroot[0] && addroot[1] == ':' && !addroot[2]) { /* If the addroot is a drive (without a volume root) @@ -449,6 +534,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * Otherwise we must discard the basepath. */ if (addroot[0] == baseroot[0] && baseroot[1] == ':') { +#endif /* Base the result path on the basepath */ if (basetype != APR_EABSOLUTE && (flags & APR_FILEPATH_NOTRELATIVE)) @@ -483,12 +569,14 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, if (basetype != APR_EABSOLUTE && (flags & APR_FILEPATH_NOTRELATIVE)) return basetype; +#ifndef NETWARE /* An incomplete UNC path must be completed */ if (basetype == APR_INCOMPLETE && (baseroot[0] == '/' || baseroot[0] == '\\') && (baseroot[1] == '/' || baseroot[1] == '\\')) fixunc = 1; +#endif /* Base the result path on the basepath */ @@ -544,10 +632,12 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, if (seglen < segend) return APR_EBADPATH; +#ifndef NETWARE /* This isn't legal unless the unc path is completed */ if (fixunc) return APR_EBADPATH; +#endif /* Otherwise, this is a noop segment (/ or ./) so ignore it */ @@ -561,10 +651,12 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, if (seglen < segend && (seglen != 3 || addpath[2] != '.')) return APR_EBADPATH; +#ifndef NETWARE /* This isn't legal unless the unc path is completed */ if (fixunc) return APR_EBADPATH; +#endif /* backpath (../) */ if (pathlen <= rootlen) @@ -622,6 +714,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } else /* not empty or dots */ { +#ifndef NETWARE if (fixunc) { char *testpath = path; char *testroot; @@ -662,7 +755,9 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, return testtype; } } - else { + else +#endif + { /* An actual segment, append it to the destination path */ apr_size_t i = (addpath[segend] != '\0'); @@ -733,7 +828,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, == APR_SUCCESS) { size_t namelen = strlen(finfo.name); -#ifdef OS2 /* only has case folding, never aliases that change the length */ +#if defined(OS2) || defined(NETWARE) /* only has case folding, never aliases that change the length */ if (memcmp(finfo.name, path + keptlen, seglen) != 0) { memcpy(path + keptlen, finfo.name, namelen); From 1c6b329a15c038b0e0a4cbca73f860f96c0c4eb0 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 29 Aug 2001 23:35:39 +0000 Subject: [PATCH 2250/7878] NetWare specific version of fileio.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62249 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/fileio.h | 175 ++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 include/arch/netware/fileio.h diff --git a/include/arch/netware/fileio.h b/include/arch/netware/fileio.h new file mode 100644 index 00000000000..feb810a1021 --- /dev/null +++ b/include/arch/netware/fileio.h @@ -0,0 +1,175 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef FILE_IO_H +#define FILE_IO_H + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_tables.h" +#include "apr_file_io.h" +#include "apr_file_info.h" +#include "apr_errno.h" +#include "apr_lib.h" + +/* System headers the file I/O library needs */ +#if APR_HAVE_FCNTL_H +#include +#endif +#if APR_HAVE_SYS_TYPES_H +#include +#endif +#if APR_HAVE_ERRNO_H +#include +#endif +#if APR_HAVE_STRING_H +#include +#endif +#if APR_HAVE_STRINGS_H +#include +#endif +#if APR_HAVE_DIRENT_H +#include +#endif +#ifdef HAVE_SYS_STAT_H +#include +#endif +#if APR_HAVE_UNISTD_H +#include +#endif +#if APR_HAVE_STDIO_H +#include +#endif +#if APR_HAVE_STDLIB_H +#include +#endif +#if APR_HAVE_SYS_UIO_H +#include +#endif +#if APR_HAVE_SYS_TIME_H +#include +#endif +#ifdef BEOS +#include +#endif + +/* End System headers */ + +#define APR_FILE_BUFSIZE 4096 + +struct apr_file_t { + apr_pool_t *cntxt; + int filedes; + char *fname; + apr_int32_t flags; + int eof_hit; + int pipe; + apr_interval_time_t timeout; + int buffered; + enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; + int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ + + /* Stuff for buffered mode */ + char *buffer; + int bufpos; /* Read/Write position in buffer */ + unsigned long dataRead; /* amount of valid data read into buffer */ + int direction; /* buffer being used for 0 = read, 1 = write */ + unsigned long filePtr; /* position in file of handle */ +#if APR_HAS_THREADS + struct apr_lock_t *thlock; +#endif +}; + +struct apr_dir_t { + apr_pool_t *cntxt; + char *dirname; + DIR *dirstruct; + struct dirent *entry; +}; + +#define MAX_SERVER_NAME 64 +#define MAX_VOLUME_NAME 64 +#define MAX_PATH_NAME 256 +#define MAX_FILE_NAME 256 + +#define DRIVE_ONLY 1 + +/* If the user passes d: vs. D: (or //mach/share vs. //MACH/SHARE), + * we need to fold the case to canonical form. This function is + * supposed to do so. + */ +apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p); + +/* This function check to see of the given path includes a drive/volume + * specifier. If the _only_ parameter is set to DRIVE_ONLY then it + * check to see of the path only contains a drive/volume specifier and + * nothing else. + */ +apr_status_t filepath_has_drive(char *rootpath, int only, apr_pool_t *p); + +/* This function compares the drive/volume specifiers for each given path. + * It returns zero if they match or non-zero if not. + */ +apr_status_t filepath_compare_drive(char *path1, char *path2, apr_pool_t *p); + +apr_status_t apr_unix_file_cleanup(void *); + +//mode_t apr_unix_perms2mode(apr_fileperms_t perms); +//apr_fileperms_t apr_unix_mode2perms(mode_t mode); +// +//int apr_mkstemp(char *template); + +#endif /* ! FILE_IO_H */ + From 91fabb51ba3bc809f042964dc0999a055f85a21b Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 30 Aug 2001 02:30:48 +0000 Subject: [PATCH 2251/7878] Fix a segfault when we try to memset NULL (the user is out of memory in that shared memory segment). apr_shm_malloc will either return valid memory or NULL, so this is a useful check. When using libc's malloc(), that isn't necessarily the case. However, this patch requires the caller to check for a NULL return which they probably don't do anyway, so the segfault gets moved out of APR and into the caller. That's good enough for now... PR: Graham's posts to dev@apr git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62250 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index a66e1a137b3..74dcb8307c6 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -248,7 +248,8 @@ APR_DECLARE(void *) apr_shm_malloc(apr_shmem_t *m, apr_size_t reqsize) APR_DECLARE(void *) apr_shm_calloc(apr_shmem_t *m, apr_size_t reqsize) { void *new = apr_shm_malloc(m, reqsize); - memset(new, '\0', reqsize); + if (new) + memset(new, '\0', reqsize); return new; } From 052f5178e6f46d797b7a963d77998c140ad084a7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 30 Aug 2001 05:45:43 +0000 Subject: [PATCH 2252/7878] * srclib/apr/build/apr_hints.m4: added Cygwin specific APR_ADDTOs. * srclib/apr/configure.in: added Cygwin specific directives. $OSDIR will change to "cygwin" as soon as I clean things up. Submitted by: Stipe Tolj git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62251 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 4 ++++ configure.in | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 5bcc3375c9a..8788ebe3214 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -379,6 +379,10 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(CC, [cc]) APR_ADDTO(CPPFLAGS, [-U_NO_PROTO -DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR -DPTHREAD_SETS_ERRNO -DPTHREAD_DETACH_ARG1_ADDR -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1]) ;; + *cygwin*) + APR_ADDTO(CPPFLAGS, [-DCYGWIN]) + APR_ADDTO(LIBS, [-lcrypt]) + ;; esac fi diff --git a/configure.in b/configure.in index 24cff3877fd..4b8d2c610be 100644 --- a/configure.in +++ b/configure.in @@ -236,6 +236,11 @@ case $host in OSDIR="os390" eolstr="\\n" ;; + *cygwin*) + OSDIR="unix" + APR_ADDTO(CPPFLAGS,-DCYGWIN) + eolstr="\\n" + ;; *) OSDIR="unix" eolstr="\\n" From 54a6d6a167c0d5613b5e3c654a1d8dcab0792737 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 30 Aug 2001 05:47:26 +0000 Subject: [PATCH 2253/7878] It's warm tonight in the midwest git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62252 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 9b59a978d2f..870cde1231c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Initial support for cygwin. [Stipe Tolj ] + *) Fix a problem with buffered files on Unix. [Brian Havard] *) Fix the bungling of getaddrinfo() error codes. [Jeff Trawick] From 512cb4830dbc567f1c61662c65edc01930198cd1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 30 Aug 2001 15:44:09 +0000 Subject: [PATCH 2254/7878] Ugh... that was NOTDIR, not a second NOENT. We are very happy with any NOTDIR right here - directory_walk will catch them eventually. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62253 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 360e644bd35..3b79a5584d5 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -903,7 +903,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, if (rv != APR_SUCCESS) { if (APR_STATUS_IS_ENOENT(rv)) break; - else if (APR_STATUS_IS_ENOENT(rv)) + else if (APR_STATUS_IS_ENOTDIR(rv)) /* This is a little more serious, we just added a name * onto a filename (think http's CGI MORE_INFO) * If the caller is foolish enough to do this, we expect From bb80471b52c5a38cee74ab89ecdb8b103363dc77 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 30 Aug 2001 15:53:06 +0000 Subject: [PATCH 2255/7878] fix some bad retcodes (adding APR_OS_START_SYSERR to errno) in the shared memory code for unix there are still some unexpected uses of APR_EGENERAL and a general lack of cleanup of previous steps when something goes wrong (not always a reasonable thing to do with shared memory) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62254 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shmem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 74dcb8307c6..e0fdb568f5b 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -151,7 +151,7 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, /* FIXME: Is APR_OS_DEFAULT sufficient? */ tmpfd = shm_open(filename, O_RDWR | O_CREAT, APR_OS_DEFAULT); if (tmpfd == -1) - return errno + APR_OS_START_SYSERR; + return errno; apr_os_file_put(&new_m->file, &tmpfd, pool); status = apr_file_trunc(new_m->file, reqsize); @@ -175,7 +175,7 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, #elif APR_USE_SHMEM_SHMGET tmpfd = shmget(IPC_PRIVATE, reqsize, (SHM_R|SHM_W|IPC_CREAT)); if (tmpfd == -1) - return errno + APR_OS_START_SYSERR; + return errno; new_m->file = tmpfd; @@ -183,14 +183,14 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, /* FIXME: Handle errors. */ if (shmctl(new_m->file, IPC_STAT, &shmbuf) == -1) - return errno + APR_OS_START_SYSERR; + return errno; apr_current_userid(&uid, &gid, pool); shmbuf.shm_perm.uid = uid; shmbuf.shm_perm.gid = gid; if (shmctl(new_m->file, IPC_SET, &shmbuf) == -1) - return errno + APR_OS_START_SYSERR; + return errno; #elif APR_USE_SHMEM_BEOS new_m->area_id = create_area("mm", (void*)&mem, B_ANY_ADDRESS, reqsize, From 0133bd516b64e451b1682c98d895ef406757aaae Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 30 Aug 2001 16:26:22 +0000 Subject: [PATCH 2256/7878] OS/2: Add stubs for apr_thread_once functions to fix link. Will fill them in once I figure out WTF they do.... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62255 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/thread.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 9653edf5085..d21414447ea 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -239,3 +239,17 @@ APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, } APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) + + + +APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, + apr_pool_t *p) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, + void (*func)(void)) +{ + return APR_ENOTIMPL; +} From 1436894db3d6c36c6aeaa3b24b5a27277273cf2b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 30 Aug 2001 17:11:04 +0000 Subject: [PATCH 2257/7878] when creating a shared memory segment using SysV, be sure to specify that the segment will go away when the last user detaches This fixes a problem with Apache leaving behind a shared memory segments at termination. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62256 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shmem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index e0fdb568f5b..7cda4233220 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -192,6 +192,10 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, if (shmctl(new_m->file, IPC_SET, &shmbuf) == -1) return errno; + /* remove in future (once use count hits zero) */ + if (shmctl(new_m->file, IPC_RMID, NULL) == -1) + return errno; + #elif APR_USE_SHMEM_BEOS new_m->area_id = create_area("mm", (void*)&mem, B_ANY_ADDRESS, reqsize, B_LAZY_LOCK, B_READ_AREA|B_WRITE_AREA); From 562a3741b7119527ecaf1ee4d7261b24b4dc6197 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 30 Aug 2001 18:21:50 +0000 Subject: [PATCH 2258/7878] This solves a number of issues on cygwin, until Stipe or others have a chance to look at pthread support and library support for foo_r threadsafe calls. So for today, no threads [Stipe Tolj ] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62257 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index 4b8d2c610be..4f4af52e587 100644 --- a/configure.in +++ b/configure.in @@ -239,6 +239,7 @@ case $host in *cygwin*) OSDIR="unix" APR_ADDTO(CPPFLAGS,-DCYGWIN) + enable_threads="no" eolstr="\\n" ;; *) From e20a7c107a95232e30e718ea02002f99e9b5cedf Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 30 Aug 2001 20:33:17 +0000 Subject: [PATCH 2259/7878] Updated and cleaned up aprlib.imp for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62258 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/aprlib.imp | 463 +++++++++++++++++++++++++++------------- 1 file changed, 310 insertions(+), 153 deletions(-) diff --git a/misc/netware/aprlib.imp b/misc/netware/aprlib.imp index 6a51b710947..2f7fe619e86 100644 --- a/misc/netware/aprlib.imp +++ b/misc/netware/aprlib.imp @@ -1,175 +1,332 @@ - apr_stat, - apr_shutdown, - apr_bind, - apr_listen, apr_accept, - apr_connect, - apr_gethostname, - apr_send, - apr_recv, - apr_setsocketopt, - apr_sendv, - apr_poll, - apr_thread_exit, - apr_thread_join, - apr_thread_detach, - apr_initialize, - apr_getopt_init, - apr_getopt, apr_ansi_time_to_apr_time, - apr_time_now, - apr_implode_time, - apr_explode_gmt, - apr_explode_localtime, - apr_ctime, - apr_rfc822_date, - apr_strftime, - apr_strerror, - apr_cpystrn, - apr_fnmatch, - apr_is_fnmatch, - apr_palloc, - apr_pcalloc, - apr_pstrdup, - apr_pstrndup, - apr_pstrcat, - apr_pvsprintf, - apr_psprintf, - apr_array_cat, apr_array_append, - apr_array_pstrcat, + apr_array_cat, + apr_array_copy, + apr_array_copy_hdr, apr_array_make, + apr_array_pstrcat, apr_array_push, - apr_table_get, - apr_table_set, - apr_table_setn, - apr_table_unset, - apr_table_merge, - apr_table_mergen, - apr_table_add, - apr_table_addn, - apr_table_do, - apr_vformatter, - apr_snprintf, - apr_vsnprintf, - apr_tokenize_to_argv, - apr_filename_of_pathname, - apr_terminate, - apr_day_snames, - apr_month_snames, + apr_bind, + apr_collapse_spaces, + #apr_compare_groups, + #apr_compare_users, + apr_connect, + apr_cpystrn, + apr_ctime, + apr_current_userid, + apr_dir_close, + apr_dir_make, + apr_dir_open, + apr_dir_read, + apr_dir_remove, + apr_dir_rewind, + apr_dso_error, apr_dso_load, - apr_dso_unload, apr_dso_sym, - apr_pool_destroy, - apr_pool_create, - apr_pool_clear, - apr_pool_cleanup_null, - apr_pool_cleanup_register, - apr_pool_note_subprocess, - apr_sort_hooks, - apr_hook_deregister_all, - apr_hook_sort_register, - apr_socket_addr_get, - apr_getnameinfo, - apr_sockaddr_info_get, - apr_sockaddr_port_get, - apr_file_seek, - apr_file_read, - apr_file_open, + apr_dso_unload, + apr_explode_gmt, + apr_explode_localtime, + apr_explode_time, apr_file_close, - apr_file_open_stderr, - apr_file_flush, + apr_file_data_get, + apr_file_data_set, apr_file_dup, - apr_file_puts, + apr_file_eof, + apr_file_flags_get, + apr_file_flush, + apr_file_getc, + apr_file_gets, + apr_file_info_get, + apr_file_lock, + apr_file_name_get, + apr_file_namedpipe_create, + apr_file_open, + apr_file_open_stderr, + apr_file_open_stdin, + apr_file_open_stdout, + apr_file_perms_set, + apr_file_pipe_create, + apr_file_pipe_timeout_get, + apr_file_pipe_timeout_set, apr_file_printf, - apr_brigade_create, - apr_brigade_split, - apr_brigade_destroy, - apr_bucket_file_create, - apr_bucket_eos_create, - apr_bucket_socket_create, - apr_bucket_type_eos, - apr_bucket_type_flush, - apr_bucket_type_file, - apr_procattr_create, - apr_procattr_io_set, - apr_proc_create, - apr_global_hook_pool, - apr_current_hooking_module, - apr_debug_module_hooks, - apr_show_hook, - apr_lstat, - apr_dir_open, - apr_dir_read, - apr_dir_close, - apr_sockaddr_ip_get, - apr_parse_addr_port, - apr_os_sock_get, - apr_socket_close, - apr_lock_acquire, - apr_lock_release, - apr_poll_setup, - apr_poll_socket_add, + apr_file_putc, + apr_file_puts, + apr_file_read, + apr_file_read_full, + apr_file_remove, + apr_file_rename, + apr_file_seek, + apr_file_set_inherit, + apr_file_trunc, + apr_file_ungetc, + apr_file_unlock, + apr_file_unset_inherit, + apr_file_write, + apr_file_write_full, + apr_file_writev, + apr_filename_of_pathname, + apr_filepath_get, + apr_filepath_merge, + apr_filepath_root, + apr_filepath_set, + #apr_find_pool, + apr_fnmatch, + #apr_generate_random_bytes, + apr_get_groupname, + apr_get_home_directory, + apr_get_userid, + apr_get_username, + apr_gethostname, + apr_getnameinfo, + apr_getopt, + apr_getopt_init, + apr_getopt_long, + apr_getservbyname, + apr_getsocketopt, + apr_hash_count, + apr_hash_first, + apr_hash_get, + apr_hash_make, + apr_hash_next, + apr_hash_overlay, + apr_hash_pool_get, + apr_hash_set, + apr_hash_this, + apr_implode_gmt, + apr_implode_time, + apr_initialize, + apr_ipsubnet_create, + apr_ipsubnet_test, + apr_is_fnmatch, + apr_itoa, + apr_listen, apr_lock_acquire, - apr_poll_revents_get, - apr_lock_release, + apr_lock_acquire_rw, apr_lock_child_init, - apr_setup_signal_thread, apr_lock_create, - apr_threadattr_create, - apr_threadattr_detach_set, - apr_thread_create, - apr_thread_yield, - apr_file_write, - apr_file_pipe_create, - apr_file_pipe_timeout_set, - apr_file_getc, - apr_file_gets, - apr_file_info_get, - apr_proc_detach, - apr_pool_cleanup_kill, - apr_base64_decode_len, - apr_base64_decode, - apr_brigade_puts, - apr_brigade_length, - apr_brigade_partition, - apr_brigade_write, - apr_table_overlay, - apr_table_clear, - apr_table_make, - apr_table_overlap, - apr_table_copy, - apr_bucket_pool_create, - apr_bucket_flush_create, - apr_bucket_heap_create, - apr_bucket_transient_create, + #apr_lock_create_np, + apr_lock_data_get, + apr_lock_data_set, + apr_lock_destroy, + apr_lock_release, + apr_lock_tryacquire, + apr_lstat, + apr_ltoa, + apr_md5, + apr_md5_encode, apr_md5_final, apr_md5_init, + #apr_md5_set_xlate, apr_md5_update, - apr_sleep, + #apr_mmap_create, + #apr_mmap_delete, + #apr_mmap_offset, + apr_off_t_toa, + apr_os_dir_get, + apr_os_dir_put, + apr_os_dso_handle_get, + apr_os_dso_handle_put, + apr_os_exp_time_get, + apr_os_exp_time_put, + apr_os_file_get, + apr_os_file_put, + apr_os_imp_time_get, + apr_os_imp_time_put, + apr_os_lock_get, + apr_os_lock_put, + apr_os_sock_get, + apr_os_sock_make, + apr_os_sock_put, + apr_os_thread_current, + apr_os_thread_equal, + #apr_os_thread_get, + #apr_os_thread_put, + apr_os_threadkey_get, + apr_os_threadkey_put, + apr_palloc, + apr_parse_addr_port, + apr_password_get, + apr_password_validate, + apr_pcalloc, + apr_pmemdup, + apr_poll, + apr_poll_data_get, + apr_poll_data_set, + apr_poll_revents_get, + apr_poll_setup, + apr_poll_socket_add, + apr_poll_socket_clear, + apr_poll_socket_mask, + apr_poll_socket_remove, + apr_pool_alloc_init, + apr_pool_alloc_term, + apr_pool_child_cleanup_set, + apr_pool_cleanup_for_exec, + apr_pool_cleanup_kill, + apr_pool_cleanup_null, + apr_pool_cleanup_register, + apr_pool_cleanup_run, + apr_pool_clear, + apr_pool_create, + apr_pool_destroy, + #apr_pool_free_blocks_num_bytes, + apr_pool_get_abort, + apr_pool_get_parent, + apr_pool_is_ancestor, + #apr_pool_join, + apr_pool_note_subprocess, + #apr_pool_num_bytes, + apr_pool_set_abort, + apr_pool_sub_make, + apr_pool_userdata_get, + apr_pool_userdata_set, + apr_proc_create, + apr_proc_fork, + apr_proc_kill, + #apr_proc_other_child_check, + #apr_proc_other_child_read, + #apr_proc_other_child_register, + #apr_proc_other_child_unregister, apr_proc_wait, apr_proc_wait_all_procs, + apr_procattr_child_err_set, + apr_procattr_child_in_set, + apr_procattr_child_out_set, + apr_procattr_cmdtype_set, + apr_procattr_create, + apr_procattr_detach_set, + apr_procattr_dir_set, + apr_procattr_io_set, + apr_procattr_limit_set, + apr_psprintf, + apr_pstrcat, + apr_pstrdup, + apr_pstrndup, + apr_pvsprintf, + apr_recv, + apr_recvfrom, + apr_rfc822_date, + apr_send, + #apr_sendfile, + apr_sendto, + apr_sendv, + apr_setsocketopt, + apr_setup_signal_thread, + #apr_shm_avail, + #apr_shm_calloc, + #apr_shm_destroy, + #apr_shm_free, + #apr_shm_init, + #apr_shm_malloc, + #apr_shm_name_get, + #apr_shm_name_set, + #apr_shm_open, + apr_shutdown, + #apr_signal, apr_signal_get_description, + #apr_signal_thread, + apr_sleep, + #apr_sms_assert, + apr_sms_blocks_create, + apr_sms_calloc, + apr_sms_cleanup_register, + apr_sms_cleanup_run, + apr_sms_cleanup_run_type, + apr_sms_cleanup_unregister, + apr_sms_cleanup_unregister_type, + apr_sms_destroy, + #apr_sms_dump_stats, + apr_sms_free, + apr_sms_get_abort, + apr_sms_get_identity, + apr_sms_get_parent, + apr_sms_is_ancestor, + apr_sms_lock, + apr_sms_malloc, + apr_sms_realloc, + apr_sms_reset, + apr_sms_set_abort, + #apr_sms_show_structure, + apr_sms_std_create, + #apr_sms_tag, + apr_sms_thread_register, + apr_sms_thread_unregister, + apr_sms_threads_create, + apr_sms_threads_create_ex, + apr_sms_tracking_create, + apr_sms_trivial_create, + apr_sms_trivial_create_ex, + apr_sms_unlock, + apr_sms_userdata_get, + apr_sms_userdata_set, + apr_snprintf, + apr_sockaddr_info_get, + apr_sockaddr_ip_get, + apr_sockaddr_ip_set, + apr_sockaddr_port_get, + apr_sockaddr_port_set, + apr_socket_addr_get, + apr_socket_close, apr_socket_create, - apr_bucket_immortal_create, - apr_ipsubnet_create, - apr_ipsubnet_test, - apr_password_validate, - apr_file_eof, + apr_socket_data_get, + apr_socket_data_set, + #apr_socket_from_file, + apr_socket_set_inherit, + apr_socket_unset_inherit, + apr_stat, + apr_strerror, + apr_strfsize, + apr_strftime, + apr_strnatcasecmp, apr_strnatcmp, - apr_procattr_dir_set, - apr_procattr_cmdtype_set, - apr_bucket_pipe_create, - apr_retrieve_optional_fn, - apr_get_username, - apr_hash_get, - apr_hash_make, - apr_hash_set, - apr_register_optional_fn, - apr_file_ungetc, - apr_dso_error, - apr_get_home_directory, - apr_bucket_setaside_notimpl, - apr_bucket_split_notimpl, - apr_bucket_copy_notimpl, + apr_strtok, + apr_table_add, + apr_table_addn, + apr_table_clear, + apr_table_copy, + apr_table_do, + apr_table_get, + apr_table_make, + apr_table_merge, + apr_table_mergen, + apr_table_overlap, + apr_table_overlay, + apr_table_set, + apr_table_setn, + apr_table_unset, + apr_table_vdo, + apr_terminate, + apr_terminate2, + apr_thread_create, + apr_thread_data_get, + apr_thread_data_set, + apr_thread_detach, + apr_thread_exit, + apr_thread_join, + #apr_thread_once, + #apr_thread_once_init, + apr_thread_yield, + apr_threadattr_create, + apr_threadattr_detach_get, + apr_threadattr_detach_set, + apr_threadkey_data_get, + apr_threadkey_data_set, + apr_threadkey_private_create, + apr_threadkey_private_delete, + apr_threadkey_private_get, + apr_threadkey_private_set, + apr_time_now, + apr_tokenize_to_argv, + apr_uuid_format, + apr_uuid_get, + apr_uuid_parse, + apr_vformatter, + apr_vsnprintf, + #apr_xlate_close, + #apr_xlate_conv_buffer, + #apr_xlate_conv_byte, + #apr_xlate_conv_char, + #apr_xlate_get_sb, + #apr_xlate_open, From dc5711b34aa5ad7c51a5bfef764533cbb7052bf9 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 30 Aug 2001 21:07:21 +0000 Subject: [PATCH 2260/7878] Removed code for NetWare that is trying to free a lock handle as if it were a memory handle. The lock handle has already been destroyed on the line above the #ifdef. Why the source is trying to free it as if it were a memory handle causes a problem on NetWare. This area needs to be looked at on other platforms to determine if it is really a valid thing to do. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62259 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index 32fe5646d1b..bc4dcea4bb4 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -613,8 +613,10 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms) if (sms->sms_lock) { apr_lock_destroy(sms->sms_lock); +#ifndef NETWARE if (pms->free_fn) apr_sms_free(sms->parent, sms->sms_lock); +#endif } #ifndef APR_POOLS_ARE_SMS From 4e624ead0965ed9cf20e8a60bc6456489e5058b5 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 30 Aug 2001 22:00:15 +0000 Subject: [PATCH 2261/7878] That free statement is altogether stupid. I axed it a long time ago in my local tree, but never removed it because well, SMS wasn't going anywhere. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62260 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_sms.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c index bc4dcea4bb4..c05d6d6e265 100644 --- a/memory/unix/apr_sms.c +++ b/memory/unix/apr_sms.c @@ -613,10 +613,6 @@ APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms) if (sms->sms_lock) { apr_lock_destroy(sms->sms_lock); -#ifndef NETWARE - if (pms->free_fn) - apr_sms_free(sms->parent, sms->sms_lock); -#endif } #ifndef APR_POOLS_ARE_SMS From 73855871dfaf1b19fa342211e54252c555d484e3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 30 Aug 2001 23:09:20 +0000 Subject: [PATCH 2262/7878] allow the name of a lock file to be specified on the command line when the current directory is a mount which will not support a lock (e.g., some NFS), -f /tmp/mylock can be used to circumvent the problem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62261 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/test/testlock.c b/test/testlock.c index d4d8a8b7f8a..6d4f59dcfeb 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -57,6 +57,7 @@ #include "apr_lock.h" #include "apr_errno.h" #include "apr_general.h" +#include "apr_getopt.h" #include "errno.h" #include #include @@ -77,7 +78,7 @@ void * APR_THREAD_FUNC thread_rw_func(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_function(apr_thread_t *thd, void *data); apr_status_t test_exclusive(void); apr_status_t test_rw(void); -apr_status_t test_multiple_locking(void); +apr_status_t test_multiple_locking(const char *); apr_file_t *in, *out, *err; @@ -231,7 +232,7 @@ apr_status_t test_exclusive(void) return APR_SUCCESS; } -apr_status_t test_multiple_locking(void) +apr_status_t test_multiple_locking(const char *lockfile) { apr_lock_t *multi; int try = 0; @@ -239,7 +240,7 @@ apr_status_t test_multiple_locking(void) printf("Testing multiple locking\n"); printf("%-60s"," Creating the lock we'll use"); - if ((rv = apr_lock_create(&multi, APR_MUTEX, APR_LOCKALL,"multi.lock", + if ((rv = apr_lock_create(&multi, APR_MUTEX, APR_LOCKALL, lockfile, pool)) != APR_SUCCESS) { printf("Failed!\n"); return rv; @@ -277,10 +278,14 @@ apr_status_t test_multiple_locking(void) return APR_SUCCESS; } -int main(void) +int main(int argc, const char * const *argv) { apr_status_t rv; char errmsg[200]; + const char *lockname = "multi.lock"; + apr_getopt_t *opt; + char optchar; + const char *optarg; printf("APR Locks Test\n==============\n\n"); @@ -290,13 +295,31 @@ int main(void) if (apr_pool_create(&pool, NULL) != APR_SUCCESS) exit(-1); + if ((rv = apr_getopt_init(&opt, pool, argc, argv)) != APR_SUCCESS) { + fprintf(stderr, "Could not set up to parse options: [%d] %s\n", + rv, apr_strerror(rv, errmsg, sizeof errmsg)); + exit(-1); + } + + while ((rv = apr_getopt(opt, "f:", &optchar, &optarg)) == APR_SUCCESS) { + if (optchar == 'f') { + lockname = optarg; + } + } + + if (rv != APR_SUCCESS && rv != APR_EOF) { + fprintf(stderr, "Could not parse options: [%d] %s\n", + rv, apr_strerror(rv, errmsg, sizeof errmsg)); + exit(-1); + } + if ((rv = test_exclusive()) != APR_SUCCESS) { fprintf(stderr,"Exclusive Lock test failed : [%d] %s\n", rv, apr_strerror(rv, (char*)errmsg, 200)); exit(-2); } - if ((rv = test_multiple_locking()) != APR_SUCCESS) { + if ((rv = test_multiple_locking(lockname)) != APR_SUCCESS) { fprintf(stderr,"Multiple Locking test failed : [%d] %s\n", rv, apr_strerror(rv, (char*)errmsg, 200)); exit(-3); From 9ce685efd8ace366090060f330d8d621f401c6cd Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 31 Aug 2001 06:07:34 +0000 Subject: [PATCH 2263/7878] On platforms where neither HAVE_GMTOFF nor HAVE___OFFSET is defined, like Solaris, the function "get_offset" in apr/time/unix/time.c is a bottleneck in time formatting. On these platforms, get_offset ignores its argument; it really computes the server's offset from GMT, normalized so that it's independent of daylight savings. Here's a new version of the get_offset patch that initializes the TZ offset from apr_initialize. I've attached the new include file that it uses, apr/include/arch/unix/internal_time.h -- Justin added the missing call to apr_initialize in testtime.c so that testtime works on Solaris and produces the "right" output. Submitted by: Brian Pane Reviewed by: Justin Erenkrantz, Roy Fielding git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62262 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++ include/arch/unix/internal_time.h | 62 +++++++++++++++++++++++++ misc/unix/start.c | 2 + test/testtime.c | 2 + time/unix/time.c | 75 +++++++++++++++++++++---------- 5 files changed, 122 insertions(+), 23 deletions(-) create mode 100644 include/arch/unix/internal_time.h diff --git a/CHANGES b/CHANGES index 870cde1231c..33f67356050 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Cache GMT offset on platforms that don't store it in the tm struct. + This offset is normalized to be independent of daylight savings + time. [Brian Pane ] + *) Initial support for cygwin. [Stipe Tolj ] *) Fix a problem with buffered files on Unix. [Brian Havard] diff --git a/include/arch/unix/internal_time.h b/include/arch/unix/internal_time.h new file mode 100644 index 00000000000..9cdba8b1b98 --- /dev/null +++ b/include/arch/unix/internal_time.h @@ -0,0 +1,62 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef TIME_INTERNAL_H +#define TIME_INTERNAL_H + +#include "apr.h" + +void apr_unix_setup_time(void); + +#endif /* TIME_INTERNAL_H */ diff --git a/misc/unix/start.c b/misc/unix/start.c index 7fb2dfeab56..2e7ef27cb6d 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -59,6 +59,7 @@ #include "misc.h" /* for WSAHighByte / WSALowByte */ #include "locks.h" /* for apr_unix_setup_lock() */ +#include "internal_time.h" static int initialized = 0; @@ -83,6 +84,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) #if !defined(BEOS) && !defined(OS2) && !defined(WIN32) && !defined(NETWARE) apr_unix_setup_lock(); + apr_unix_setup_time(); #elif defined WIN32 || defined(NETWARE) iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); err = WSAStartup((WORD) iVersionRequested, &wsaData); diff --git a/test/testtime.c b/test/testtime.c index 9a6033a40a3..75500fb2856 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -73,6 +73,8 @@ int main(void) apr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */ apr_int64_t hr_off_64; + apr_initialize(); + printf("APR Time Functions\n==================\n\n"); STD_TEST_NEQ("Creating a pool to use", apr_pool_create(&p, NULL)) diff --git a/time/unix/time.c b/time/unix/time.c index 5f46b5ff199..edaa1f89394 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -70,6 +70,10 @@ #endif /* End System Headers */ +#if !defined(HAVE_GMTOFF) && !defined(HAVE___OFFSET) +static apr_int32_t server_gmt_offset; +#endif /* if !defined(HAVE_GMTOFF) && !defined(HAVE___OFFSET) */ + static apr_int32_t get_offset(struct tm *tm) { #ifdef HAVE_GMTOFF @@ -77,29 +81,7 @@ static apr_int32_t get_offset(struct tm *tm) #elif defined(HAVE___OFFSET) return tm->__tm_gmtoff; #else - /* We don't have an offset field to use, so calculate it. - mktime() is the inverse of localtime(); so, presumably, - passing in a struct tm made by gmtime() let's us calculate - the true GMT offset. However, there's a catch: if daylight - savings is in effect, gmtime()will set the tm_isdst field - and confuse mktime() into returning a time that's offset - by one hour. In that case, we must adjust the calculated GMT - offset. */ - { - time_t t1 = time(0), t2 = 0; - struct tm t; - int was_dst; - -#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) - gmtime_r(&t1, &t); -#else - t = *gmtime(&t1); -#endif - was_dst = (t.tm_isdst > 0); - t.tm_isdst = -1; - t2 = mktime(&t); - return (apr_int32_t) difftime(t1, t2) + (was_dst ? 3600 : 0); - } + return server_gmt_offset; #endif } @@ -308,3 +290,50 @@ APR_DECLARE(apr_status_t) apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2 return APR_SUCCESS; } #endif + +APR_DECLARE(void) apr_unix_setup_time(void) +{ +#if !defined(HAVE_GMTOFF) && !defined(HAVE___OFFSET) + /* Precompute the offset from GMT on systems where it's not + in struct tm. + + Note: This offset is normalized to be independent of daylight + savings time; if the calculation happens to be done in a + time/place where a daylight savings adjustment is in effect, + the returned offset has the same value that it would have + in the same location if daylight savings were not in effect. + The reason for this is that the returned offset can be + applied to a past or future timestamp in explode_time(), + so the DST adjustment obtained from the current time won't + necessarily be applicable. + + mktime() is the inverse of localtime(); so, presumably, + passing in a struct tm made by gmtime() let's us calculate + the true GMT offset. However, there's a catch: if daylight + savings is in effect, gmtime()will set the tm_isdst field + and confuse mktime() into returning a time that's offset + by one hour. In that case, we must adjust the calculated GMT + offset. + + */ + + struct timeval now; + time_t t1, t2; + struct tm t; + int was_dst; + + gettimeofday(&now, NULL); + t1 = now.tv_sec; + t2 = 0; + +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) + gmtime_r(&t1, &t); +#else + t = *gmtime(&t1); +#endif + was_dst = (t.tm_isdst > 0); + t.tm_isdst = -1; + t2 = mktime(&t); + server_gmt_offset = (apr_int32_t) difftime(t1, t2) + (was_dst ? 3600 : 0); +#endif +} From ced6d447121aad93e9f9dfaa5c8525bd25b6821f Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Fri, 31 Aug 2001 06:49:54 +0000 Subject: [PATCH 2264/7878] OS/2: Fix thread return value passing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62263 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/threadproc.h | 2 +- threadproc/os2/thread.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/threadproc.h index f33cde006f2..415d7c07af0 100644 --- a/include/arch/os2/threadproc.h +++ b/include/arch/os2/threadproc.h @@ -74,7 +74,7 @@ struct apr_thread_t { unsigned long tid; apr_thread_start_t func; void *data; - void *rv; + apr_status_t rv; }; struct apr_threadkey_t { diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index d21414447ea..2da904e0c1a 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -156,7 +156,7 @@ APR_DECLARE(apr_os_thread_t) apr_os_thread_current() APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { - thd->rv = retval; + thd->rv = *retval; _endthread(); return -1; /* If we get here something's wrong */ } From 5321a198d91648687bd540ba2c3f2ff063614c83 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Fri, 31 Aug 2001 09:54:49 +0000 Subject: [PATCH 2265/7878] bye bye git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62264 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/mm/.cvsignore | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 shmem/unix/mm/.cvsignore diff --git a/shmem/unix/mm/.cvsignore b/shmem/unix/mm/.cvsignore deleted file mode 100644 index c147a43f370..00000000000 --- a/shmem/unix/mm/.cvsignore +++ /dev/null @@ -1,11 +0,0 @@ -config.log -mm_conf.h -libtool -config.status -.libs -Makefile -mm-config -*.lo -*.la -mm_test -configure From 1ae85d92e4902aacc7ab79ba10d5f8ffe814149b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 31 Aug 2001 11:06:53 +0000 Subject: [PATCH 2266/7878] include the prototype for apr_unix_setup_time() in the file that defines apr_unix_setup_time() to ensure consistency (and to eliminate a gcc warning to that effect) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62265 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/time/unix/time.c b/time/unix/time.c index edaa1f89394..00e9b247a00 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -58,6 +58,9 @@ #include "apr_private.h" #include "apr_strings.h" +/* private APR headers */ +#include "internal_time.h" + /* System Headers required for time library */ #if APR_HAVE_SYS_TIME_H #include From c07dbf50a189ba80484e58508e92e01c400f087f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 31 Aug 2001 13:07:15 +0000 Subject: [PATCH 2267/7878] fix some return codes from apr lock create; we were looking at errno *after* calling the cleanup routine, which really sucks since the cleanup routine may have made a failing syscall; thus the real error wouldn't be reported to the user example: apr_lock_create() specifying a file which already exists old retcode: EBADF (errno from unnecessary close() in lock cleanup) new retcode: EEXIST (errno from open(O_CREATE|O_EXCL) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62266 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/crossproc.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index f48e84b3fb8..f555b2a219b 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -87,17 +87,20 @@ static apr_status_t sysv_cleanup(void *lock_) static apr_status_t sysv_create(apr_lock_t *new, const char *fname) { union semun ick; + apr_status_t stat; new->interproc = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600); if (new->interproc < 0) { + stat = errno; sysv_cleanup(new); - return errno; + return stat; } ick.val = 1; if (semctl(new->interproc, 0, SETVAL, ick) < 0) { + stat = errno; sysv_cleanup(new); - return errno; + return stat; } new->curr_locked = 0; apr_pool_cleanup_register(new->pool, (void *)new, sysv_cleanup, @@ -383,8 +386,10 @@ static apr_status_t fcntl_create(apr_lock_t *new, const char *fname) } if (new->interproc < 0) { + apr_status_t stat = errno; + fcntl_cleanup(new); - return errno; + return stat; } new->curr_locked=0; @@ -492,8 +497,10 @@ static apr_status_t flock_create(apr_lock_t *new, const char *fname) } if (new->interproc < 0) { + apr_status_t stat = errno; + flock_cleanup(new); - return errno; + return stat; } new->curr_locked = 0; apr_pool_cleanup_register(new->pool, (void *)new, flock_cleanup, @@ -551,8 +558,10 @@ static apr_status_t flock_child_init(apr_lock_t **lock, apr_pool_t *cont, new->fname = apr_pstrdup(cont, fname); new->interproc = open(new->fname, O_WRONLY, 0600); if (new->interproc == -1) { + apr_status_t stat = errno; + flock_destroy(new); - return errno; + return stat; } *lock = new; return APR_SUCCESS; From bad8e7954954feed0353c8a7752f71d9a6c0097a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 31 Aug 2001 16:28:05 +0000 Subject: [PATCH 2268/7878] NetWare user and group info functions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62267 13f79535-47bb-0310-9956-ffa450edef68 --- user/netware/groupinfo.c | 73 ++++++++++++++++++++++++++ user/netware/userinfo.c | 108 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 181 insertions(+) create mode 100644 user/netware/groupinfo.c create mode 100644 user/netware/userinfo.c diff --git a/user/netware/groupinfo.c b/user/netware/groupinfo.c new file mode 100644 index 00000000000..a5668299c24 --- /dev/null +++ b/user/netware/groupinfo.c @@ -0,0 +1,73 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_strings.h" +#include "apr_portable.h" +#include "apr_user.h" +#include "apr_private.h" +#ifdef HAVE_GRP_H +#include +#endif +#if APR_HAVE_SYS_TYPES_H +#include +#endif +#if APR_HAVE_UNISTD_H +#include /* for _POSIX_THREAD_SAFE_FUNCTIONS */ +#endif + +APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) +{ + return APR_SUCCESS; +} + diff --git a/user/netware/userinfo.c b/user/netware/userinfo.c new file mode 100644 index 00000000000..68b5c8eb34d --- /dev/null +++ b/user/netware/userinfo.c @@ -0,0 +1,108 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_strings.h" +#include "apr_portable.h" +#include "apr_user.h" +#include "apr_private.h" +#ifdef HAVE_PWD_H +#include +#endif +#if APR_HAVE_SYS_TYPES_H +#include +#endif +#if APR_HAVE_UNISTD_H +#include /* for _POSIX_THREAD_SAFE_FUNCTIONS */ +#endif + +#define PWBUF_SIZE 512 + +static apr_status_t getpwnam_safe(const char *username, + struct passwd *pw, + char pwbuf[PWBUF_SIZE]) +{ + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, + const char *username, + apr_pool_t *p) +{ + return APR_SUCCESS; +} + + + +APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, + apr_gid_t *gid, + apr_pool_t *p) +{ + return APR_SUCCESS; +} + + + + +APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, + const char *username, apr_pool_t *p) +{ + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) +{ + return APR_SUCCESS; +} + + From b5ef6b263237fd793c0427296478e97154826a8a Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Fri, 31 Aug 2001 17:55:31 +0000 Subject: [PATCH 2269/7878] OS/2: in apr_stat(), fill in finfo->name if it's asked for. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62268 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filestat.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index e9a7820adcf..4c67bdbecb7 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -58,6 +58,7 @@ #include "apr_file_io.h" #include "apr_lib.h" #include +#include "apr_strings.h" static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus) @@ -159,10 +160,25 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, finfo->protection = 0; finfo->filetype = APR_NOFILE; + finfo->name = NULL; rc = DosQueryPathInfo(fname, FIL_STANDARD, &fstatus, sizeof(fstatus)); if (rc == 0) { FS3_to_finfo(finfo, &fstatus); + + if (wanted & APR_FINFO_NAME) { + ULONG count = 1; + HDIR hDir = HDIR_SYSTEM; + FILEFINDBUF3 ffb; + rc = DosFindFirst(fname, &hDir, + FILE_DIRECTORY|FILE_HIDDEN|FILE_SYSTEM|FILE_ARCHIVED, + &ffb, sizeof(ffb), &count, FIL_STANDARD); + if (rc == 0 && count == 1) { + finfo->name = apr_pstrdup(cont, ffb.achName); + finfo->valid |= APR_FINFO_NAME; + } + } + return APR_SUCCESS; } else if (rc == ERROR_INVALID_ACCESS) { memset(finfo, 0, sizeof(apr_finfo_t)); From 427a8995a29ab36fa0c7e10ad5c5428d6ec7bd59 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 31 Aug 2001 21:45:53 +0000 Subject: [PATCH 2270/7878] Changed stub from returning APR_SUCCESS to APR_ENOTIMPL until we can figure out how to implement these functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62269 13f79535-47bb-0310-9956-ffa450edef68 --- user/netware/groupinfo.c | 2 +- user/netware/userinfo.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/user/netware/groupinfo.c b/user/netware/groupinfo.c index a5668299c24..ff7b1ca3476 100644 --- a/user/netware/groupinfo.c +++ b/user/netware/groupinfo.c @@ -68,6 +68,6 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) { - return APR_SUCCESS; + return APR_ENOTIMPL; } diff --git a/user/netware/userinfo.c b/user/netware/userinfo.c index 68b5c8eb34d..d251c5a6df7 100644 --- a/user/netware/userinfo.c +++ b/user/netware/userinfo.c @@ -72,14 +72,14 @@ static apr_status_t getpwnam_safe(const char *username, struct passwd *pw, char pwbuf[PWBUF_SIZE]) { - return APR_SUCCESS; + return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *username, apr_pool_t *p) { - return APR_SUCCESS; + return APR_ENOTIMPL; } @@ -88,7 +88,7 @@ APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, apr_gid_t *gid, apr_pool_t *p) { - return APR_SUCCESS; + return APR_ENOTIMPL; } @@ -97,12 +97,12 @@ APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, const char *username, apr_pool_t *p) { - return APR_SUCCESS; + return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) { - return APR_SUCCESS; + return APR_ENOTIMPL; } From 5c8f17e715af8b72d9d6595c8c9ad73fdd5fed66 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 1 Sep 2001 05:06:26 +0000 Subject: [PATCH 2271/7878] OS/2: Get apr_filepath_merge() & friends working, making use of the code in file_io/win32/filepath.c by Bill Rowe. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62270 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/Makefile.in | 3 +- file_io/os2/filepath.c | 5 +- file_io/os2/filesys.c | 174 ++++++++++++++++++++++++++++++++++++++ include/arch/os2/fileio.h | 9 ++ 4 files changed, 189 insertions(+), 2 deletions(-) create mode 100644 file_io/os2/filesys.c diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index 9cee45cbad6..6757e7fd935 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -11,7 +11,8 @@ TARGETS = \ flock.lo \ maperrorcode.lo \ fullrw.lo \ - filepath.lo + filepath.lo \ + filesys.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/file_io/os2/filepath.c b/file_io/os2/filepath.c index fc460e05e14..2abaaee33a1 100644 --- a/file_io/os2/filepath.c +++ b/file_io/os2/filepath.c @@ -1 +1,4 @@ -#include "../unix/filepath.c" +/* OS/2 & Win32 have much in common with regards to file names (both are + * DOSish) so it makes sense to share some code + */ +#include "../win32/filepath.c" diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c new file mode 100644 index 00000000000..5783a4a7794 --- /dev/null +++ b/file_io/os2/filesys.c @@ -0,0 +1,174 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "fileio.h" +#include "apr_strings.h" +#include + +/* OS/2 Exceptions: + * + * Note that trailing spaces and trailing periods are never recorded + * in the file system. + * + * Leading spaces and periods are accepted, however. + * The * ? < > codes all have wildcard side effects + * The " / \ : are exclusively component separator tokens + * The system doesn't accept | for any (known) purpose + * Oddly, \x7f _is_ acceptable ;) + */ + +const char c_is_fnchar[256] = +{/* Reject all ctrl codes... */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + /* " * / : < > ? */ + 1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0, + /* \ */ + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1, + /* : | */ + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1, + /* High bit codes are accepted (subject to utf-8->Unicode xlation) */ + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 +}; + + +#define IS_SLASH(c) (c == '/' || c == '\\') + + +apr_status_t filepath_root_test(char *path, apr_pool_t *p) +{ + char drive = toupper(path[0]); + + if (drive >= 'A' && drive <= 'Z' && path[1] == ':' && IS_SLASH(path[2])) + return APR_SUCCESS; + + return APR_EBADPATH; +} + + +apr_status_t filepath_drive_get(char **rootpath, char drive, apr_pool_t *p) +{ + char path[APR_PATH_MAX]; + char *pos; + ULONG rc; + ULONG bufsize = sizeof(path) - 3; + + path[0] = drive; + path[1] = ':'; + path[2] = '/'; + + rc = DosQueryCurrentDir(toupper(drive) - 'A', path+3, &bufsize); + + if (rc) { + return APR_FROM_OS_ERROR(rc); + } + + /* ###: We really should consider adding a flag to allow the user + * to have the APR_FILEPATH_NATIVE result + */ + for (pos=path; *pos; pos++) { + if (*pos == '\\') + *pos = '/'; + } + + *rootpath = apr_pstrdup(p, path); + return APR_SUCCESS; +} + + +apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) +{ + char path[APR_PATH_MAX]; + + strcpy(path, root); + if (path[1] == ':') + path[0] = toupper(path[0]); + *rootpath = apr_pstrdup(p, path); + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_pool_t *p) +{ + char path[APR_PATH_MAX]; + ULONG drive; + ULONG drivemap; + ULONG rv, pathlen = sizeof(path) - 3; + + DosQueryCurrentDisk(&drive, &drivemap); + path[0] = '@' + drive; + strcpy(path+1, ":\\"); + rv = DosQueryCurrentDir(drive, path+3, &pathlen); + + *defpath = apr_pstrdup(p, path); + return APR_SUCCESS; +} + + + +APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p) +{ + ULONG rv = 0; + + if (path[1] == ':') + rv = DosSetDefaultDisk(toupper(path[0]) - '@'); + + if (rv == 0) + rv = DosSetCurrentDir(path); + + return APR_FROM_OS_ERROR(rv); +} diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index 324f30595d7..61b65b219ef 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -98,5 +98,14 @@ apr_status_t apr_file_cleanup(void *); apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, FTIME os2time); +/* see win32/fileio.h for description of these */ +extern const char c_is_fnchar[256]; + +#define IS_FNCHAR(c) c_is_fnchar[(unsigned char)c] + +apr_status_t filepath_root_test(char *path, apr_pool_t *p); +apr_status_t filepath_drive_get(char **rootpath, char drive, apr_pool_t *p); +apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p); + #endif /* ! FILE_IO_H */ From cf59c16b3e9ec4ea2e240fe012b71450e9e65c90 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 1 Sep 2001 05:10:23 +0000 Subject: [PATCH 2272/7878] Implement apr_thread_once for Windows. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62271 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/threadproc.h | 4 ++++ threadproc/win32/thread.c | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/threadproc.h index deaf0e45b55..47951924c08 100644 --- a/include/arch/win32/threadproc.h +++ b/include/arch/win32/threadproc.h @@ -94,5 +94,9 @@ struct apr_procattr_t { apr_int32_t detached; }; +struct apr_thread_once_t { + long value; +}; + #endif /* ! THREAD_PROC_H */ diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 3e9c027f52b..3a27be8e408 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -221,4 +221,21 @@ APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, + apr_pool_t *p) +{ + control = apr_pcalloc(p, sizeof(**control)); + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, + void (*func)(void)) +{ + InterlockedIncrement(&control->value); + if (control->value == 1) { + func(); + } + return APR_SUCCESS; +} + APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) From a52f3324c8e58f140ab63e68692f778167939325 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 1 Sep 2001 05:11:46 +0000 Subject: [PATCH 2273/7878] Fix a few warnings. - Several 'incompatible pointer type' warnings due to missing const's. - Implicit declarations of strchr, strncmp & toupper. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62272 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 3b79a5584d5..cef981ff853 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -55,6 +55,8 @@ #include "apr.h" #include "fileio.h" #include "apr_strings.h" +#include +#include #ifdef NETWARE #include @@ -331,8 +333,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, apr_pool_t *p) { char path[APR_PATH_MAX]; /* isn't null term */ - char *baseroot = NULL; - char *addroot; + const char *baseroot = NULL; + const char *addroot; apr_size_t rootlen; /* the length of the root portion of path, d:/ is 3 */ apr_size_t baselen; /* the length of basepath (excluding baseroot) */ apr_size_t keptlen; /* the length of the retained basepath (incl root) */ @@ -716,8 +718,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, { #ifndef NETWARE if (fixunc) { - char *testpath = path; - char *testroot; + const char *testpath = path; + const char *testroot; apr_status_t testtype; apr_size_t i = (addpath[segend] != '\0'); From 670a27e183eb80facfd504ce4fdfa3abbb757f14 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 1 Sep 2001 07:10:25 +0000 Subject: [PATCH 2274/7878] It helps to assign it to the correct level of indirection git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62273 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 3a27be8e408..8195b6fe384 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -224,7 +224,7 @@ APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, apr_pool_t *p) { - control = apr_pcalloc(p, sizeof(**control)); + (*control) = apr_pcalloc(p, sizeof(**control)); return APR_SUCCESS; } From 4e58a0ceff8c98ddf4086303d01bd0a5c890f2f8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 1 Sep 2001 07:13:37 +0000 Subject: [PATCH 2275/7878] After fighting the test build system on Windows for a while, this is a test for apr_thread_once that works on Windows. I'll check it on Unix in a few minutes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62274 13f79535-47bb-0310-9956-ffa450edef68 --- test/testthread.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/testthread.c b/test/testthread.c index a916a1cd26c..2a64df7a295 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -81,12 +81,22 @@ void * APR_THREAD_FUNC thread_func4(apr_thread_t *thd, void *data); apr_lock_t *thread_lock; apr_pool_t *context; +apr_thread_once_t *control = NULL; int x = 0; +int value = 0; apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ +void init_func(void) +{ + value++; +} + void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data) { int i; + + apr_thread_once(control, init_func); + for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; @@ -99,6 +109,9 @@ void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data) void * APR_THREAD_FUNC thread_func2(apr_thread_t *thd, void *data) { int i; + + apr_thread_once(control, init_func); + for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; @@ -111,6 +124,9 @@ void * APR_THREAD_FUNC thread_func2(apr_thread_t *thd, void *data) void * APR_THREAD_FUNC thread_func3(apr_thread_t *thd, void *data) { int i; + + apr_thread_once(control, init_func); + for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; @@ -123,6 +139,9 @@ void * APR_THREAD_FUNC thread_func3(apr_thread_t *thd, void *data) void * APR_THREAD_FUNC thread_func4(apr_thread_t *thd, void *data) { int i; + + apr_thread_once(control, init_func); + for (i = 0; i < 10000; i++) { apr_lock_acquire(thread_lock); x++; @@ -153,6 +172,8 @@ int main(void) } fprintf(stdout, "OK\n"); + apr_thread_once_init(&control, context); + fprintf(stdout, "Initializing the lock......."); s1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); if (s1 != APR_SUCCESS) { @@ -202,6 +223,17 @@ int main(void) else { fprintf(stdout, "Everything is working!\n"); } + + fprintf(stdout, "Checking if apr_thread_once worked......."); + if (value != 1) { + fflush(stdout); + fprintf(stderr, "apr_thread_once must not have worked, " + "value is %d\n", value); + exit(-1); + } + else { + fprintf(stdout, "apr_thread_once worked\n"); + } return 0; } From 9ca51c5e55db7ad6ff86652f0aff86f096d87bb6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 1 Sep 2001 07:29:07 +0000 Subject: [PATCH 2276/7878] Avoid a rather nasty bug in the Windows apr_thread_once function. We basically, check the value before we increment, and after. By checking before, we take a hit of one if statement, but avoid a kernel call in most cases. Submitted by: Will Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62275 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/thread.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 8195b6fe384..1d0aa5d4a33 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -231,6 +231,17 @@ APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, void (*func)(void)) { + /* Quick escape hatch, and bug fix. The InterlockedIncrement + * call is just incrementing a long int, so it has the potential + * to wrap. Very unlikely, but still, that would be an almost + * impossible bug to hunt. With this, we might see one or two + * calls to InterlockedIncrement, but never enough to wrap the + * long int. This also saves us a kernel call for most calls to + * this function. + */ + if (control->value) { + return APR_SUCCESS; + } InterlockedIncrement(&control->value); if (control->value == 1) { func(); From 9c20855f430d463b9d81f04d76dc28efff04f965 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 1 Sep 2001 16:48:58 +0000 Subject: [PATCH 2277/7878] One more iteration on apr_thread_once on Windows. Now we use InterlockedExchange, and we don't have the wrapping problem, so we can also remove the quick escape hatch. Submitted by: Sander Striker git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62276 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/thread.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 1d0aa5d4a33..09ee593d9ed 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -231,19 +231,7 @@ APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, void (*func)(void)) { - /* Quick escape hatch, and bug fix. The InterlockedIncrement - * call is just incrementing a long int, so it has the potential - * to wrap. Very unlikely, but still, that would be an almost - * impossible bug to hunt. With this, we might see one or two - * calls to InterlockedIncrement, but never enough to wrap the - * long int. This also saves us a kernel call for most calls to - * this function. - */ - if (control->value) { - return APR_SUCCESS; - } - InterlockedIncrement(&control->value); - if (control->value == 1) { + if (!InterlockedExchange(&control->value, 1)) { func(); } return APR_SUCCESS; From 71c9131bdc62c0b3bd7c458e43ddf6e0f35d0df1 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 2 Sep 2001 03:41:17 +0000 Subject: [PATCH 2278/7878] Quiet a warning on Unix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62277 13f79535-47bb-0310-9956-ffa450edef68 --- test/testthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testthread.c b/test/testthread.c index 2a64df7a295..7a5aca23fc9 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -86,7 +86,7 @@ int x = 0; int value = 0; apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ -void init_func(void) +static void init_func(void) { value++; } From 115d646c4462285c24c3f8bb7bd63cafc282563a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 2 Sep 2001 03:44:37 +0000 Subject: [PATCH 2279/7878] Fix a seg-fault on Unix. It helps to allocate the structure before we try to use it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62278 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/thread.c | 1 + 1 file changed, 1 insertion(+) diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 193be85f599..fe0ea337af1 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -260,6 +260,7 @@ APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, { static const pthread_once_t once_init = PTHREAD_ONCE_INIT; + *control = apr_palloc(p, sizeof(**control)); (*control)->once = once_init; return APR_SUCCESS; } From 304fb273e64b55b6decfdf514f6ef39f2d10263d Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 2 Sep 2001 05:10:41 +0000 Subject: [PATCH 2280/7878] A couple of fixes for the c_is_fnchar map - " was off by 1 - / should be 0 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62279 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filesys.c | 8 ++++---- file_io/win32/filesys.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c index 5783a4a7794..af55fbe8d09 100644 --- a/file_io/os2/filesys.c +++ b/file_io/os2/filesys.c @@ -72,13 +72,13 @@ const char c_is_fnchar[256] = {/* Reject all ctrl codes... */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - /* " * / : < > ? */ - 1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0, + /* " * / : < > ? */ + 1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,0, 1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0, /* \ */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1, - /* : | */ + /* | */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1, - /* High bit codes are accepted (subject to utf-8->Unicode xlation) */ + /* High bit codes are accepted */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c index 1e94b06242a..0c741f7a00e 100644 --- a/file_io/win32/filesys.c +++ b/file_io/win32/filesys.c @@ -79,11 +79,11 @@ const char c_is_fnchar[256] = {/* Reject all ctrl codes... */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - /* " * / : < > ? */ - 1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0, + /* " * / : < > ? */ + 1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,0, 1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0, /* \ */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1, - /* : | */ + /* | */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1, /* High bit codes are accepted (subject to utf-8->Unicode xlation) */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, From 979bbf94a2879e79b02dedb66d2bd1928cce614c Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 2 Sep 2001 05:20:49 +0000 Subject: [PATCH 2281/7878] OS/2: Implement apr_thread_once(). Avoids a race condition by using an OS/2 event semaphore, created in the posted state so that the first (and only the first) thread to reset it receives a post count of 1. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62280 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/thread.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 2da904e0c1a..f65a9f1a4cd 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -245,11 +245,26 @@ APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, apr_pool_t *p) { - return APR_ENOTIMPL; + ULONG rc; + *control = (apr_thread_once_t *)apr_pcalloc(p, sizeof(apr_thread_once_t)); + rc = DosCreateEventSem(NULL, &(*control)->sem, 0, TRUE); + return APR_FROM_OS_ERROR(rc); } + + APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, void (*func)(void)) { - return APR_ENOTIMPL; + if (!control->hit) { + ULONG count, rc; + rc = DosResetEventSem(control->sem, &count); + + if (rc == 0 && count) { + control->hit = 1; + func(); + } + } + + return APR_SUCCESS; } From f39d82774231481ea5240e53954bd41cdfdb17eb Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 2 Sep 2001 05:34:55 +0000 Subject: [PATCH 2282/7878] Clean up the event sem in the apr_thread_once_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62281 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/thread.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index f65a9f1a4cd..70da428cb04 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -242,12 +242,26 @@ APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) +static apr_status_t thread_once_cleanup(void *vcontrol) +{ + apr_thread_once_t *control = (apr_thread_once_t *)vcontrol; + + if (control->sem) { + DosCloseEventSem(control->sem); + } + + return APR_SUCCESS; +} + + + APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, apr_pool_t *p) { ULONG rc; *control = (apr_thread_once_t *)apr_pcalloc(p, sizeof(apr_thread_once_t)); rc = DosCreateEventSem(NULL, &(*control)->sem, 0, TRUE); + apr_pool_cleanup_register(p, control, thread_once_cleanup, apr_pool_cleanup_null); return APR_FROM_OS_ERROR(rc); } From 4f94c2bf3a1a1d17ad94df46ab0df8875f01e68b Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 2 Sep 2001 05:44:43 +0000 Subject: [PATCH 2283/7878] OS/2: Define apr_thread_once_t git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62282 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/threadproc.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/threadproc.h index 415d7c07af0..7beca9f9d1c 100644 --- a/include/arch/os2/threadproc.h +++ b/include/arch/os2/threadproc.h @@ -95,5 +95,10 @@ struct apr_procattr_t { apr_int32_t detached; }; +struct apr_thread_once_t { + unsigned long sem; + char hit; +}; + #endif /* ! THREAD_PROC_H */ From d7566081da2a162a423e2d917de7fbbed59add74 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 2 Sep 2001 18:11:33 +0000 Subject: [PATCH 2284/7878] The spawn_mutex is a leftover from 1.3. Remove it. Justin thinks that the functionality that this did in 1.3 has been moved to threadproc. Submitted by: Aaron Bannert Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62283 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index c03f6c45948..7fd92d53ce9 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -252,7 +252,6 @@ static union block_hdr *block_freelist = NULL; #if APR_HAS_THREADS static apr_lock_t *alloc_mutex; -static apr_lock_t *spawn_mutex; #endif #ifdef APR_POOL_DEBUG @@ -830,11 +829,6 @@ APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *globalp) if (status != APR_SUCCESS) { return status; } - status = apr_lock_create(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, - NULL, globalp); - if (status != APR_SUCCESS) { - return status; - } #endif permanent_pool = globalp; @@ -849,9 +843,7 @@ APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp) { #if APR_HAS_THREADS apr_lock_destroy(alloc_mutex); - apr_lock_destroy(spawn_mutex); alloc_mutex = NULL; - spawn_mutex = NULL; #endif apr_pool_destroy(globalp); } From 3814862841564390d8428b32319195d78438a5ce Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 4 Sep 2001 21:20:57 +0000 Subject: [PATCH 2285/7878] Some message is better than no message. Modified the lookup to show %n substitutions untranslated, and return real (viewable) error code from DSO load failure, both for Win32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62284 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 29 ++++++++++++++++------------- misc/unix/errorcodes.c | 5 +++-- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index cdff9c29977..e9775766c79 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -75,6 +75,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { HINSTANCE os_handle; + apr_status_t rv; UINT em; #if APR_HAS_UNICODE_FS @@ -82,16 +83,19 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, if (!apr_get_oslevel(ctx, &os_level) && os_level >= APR_WIN_NT) { apr_wchar_t wpath[APR_PATH_MAX]; - apr_status_t rv; - if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), path)) { - return rv; + if ((rv = utf8_to_unicode_path(wpath, sizeof(wpath) + / sizeof(apr_wchar_t), path)) + != APR_SUCCESS) { + *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); + return ((*res_handle)->load_error = rv); } /* Prevent ugly popups from killing our app */ em = SetErrorMode(SEM_FAILCRITICALERRORS); os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (!os_handle) os_handle = LoadLibraryExW(wpath, NULL, 0); + if (!os_handle) + rv = apr_get_os_error(); SetErrorMode(em); } else @@ -105,7 +109,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, * that backslashes must be used for the LoadLibrary family of calls. */ apr_cpystrn(fspec, path, sizeof(fspec)); - while (p = strchr(p, '/')) + while ((p = strchr(p, '/')) != NULL) *p = '\\'; /* Prevent ugly popups from killing our app */ @@ -113,13 +117,14 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (!os_handle) os_handle = LoadLibraryEx(path, NULL, 0); + if (!os_handle) + rv = apr_get_os_error(); SetErrorMode(em); } *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); - if(os_handle == NULL) { - (*res_handle)->load_error = apr_get_os_error(); - return (*res_handle)->load_error; + if (rv) { + return ((*res_handle)->load_error = rv); } (*res_handle)->handle = (void*)os_handle; @@ -140,13 +145,11 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, struct apr_dso_handle_t *handle, const char *symname) { - FARPROC retval = GetProcAddress(handle->handle, symname); - if (!retval) { + *ressym = (apr_dso_handle_sym_t)GetProcAddress(handle->handle, symname); + + if (!*ressym) { return apr_get_os_error(); } - - *ressym = retval; - return APR_SUCCESS; } diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index b33a0835ade..029a2b25ccd 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -279,7 +279,8 @@ static char *apr_os_strerror(char *buf, apr_size_t bufsize, apr_status_t errcode apr_size_t len=0, i; #ifndef NETWARE - len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, + len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errcode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ @@ -315,7 +316,7 @@ static char *apr_os_strerror(char *buf, apr_size_t bufsize, apr_status_t errcode else { /* Windows didn't provide us with a message. Even stuff like * WSAECONNREFUSED won't get a message. */ - apr_cpystrn(buf, "Unrecognized error code", bufsize); + apr_snprintf(buf, bufsize, "Unrecognized Win32 error code %d", errcode); } return buf; From 167e8029d6a012e0ca6f34956ef767d133c227b0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 4 Sep 2001 22:54:58 +0000 Subject: [PATCH 2286/7878] apr_dir_read (with something like APR_FINFO_TYPE in wanted) will return APR_INCOMPLETE if it encounters a broken symlink... bug or feature? I say bug... the caller can quite happily cope with symlinks, broken or not, as they wish, they just wanted to know what is in the directory. Submitted by: Joe Orton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62285 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 013a9fcf5f3..cfd1ee90406 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -160,8 +160,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if (fspec[off - 1] != '/') fspec[off++] = '/'; apr_cpystrn(fspec + off, thedir->entry->d_name, sizeof(fspec) - off); - /* ??? Or lstat below? What is it we really want? */ - ret = apr_stat(finfo, fspec, wanted, thedir->cntxt); + ret = apr_lstat(finfo, fspec, wanted, thedir->cntxt); } if (wanted && (ret == APR_SUCCESS || ret == APR_INCOMPLETE)) { From e374bb6b8fe23a0132d782f6ea2271fb598b225d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 4 Sep 2001 23:28:51 +0000 Subject: [PATCH 2287/7878] Add the new thread_lock API to APR. This is the first step to breaking the locking API into separate APIs. Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62286 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_mutex.h | 119 +++++++++++++++ include/arch/beos/thread_mutex.h | 71 +++++++++ include/arch/netware/thread_mutex.h | 66 ++++++++ include/arch/os2/thread_mutex.h | 66 ++++++++ include/arch/unix/thread_mutex.h | 81 ++++++++++ include/arch/win32/thread_mutex.h | 65 ++++++++ locks/beos/Makefile.in | 3 +- locks/beos/thread_mutex.c | 93 ++++++++++++ locks/netware/thread_mutex.c | 92 ++++++++++++ locks/os2/Makefile.in | 3 +- locks/os2/thread_mutex.c | 88 +++++++++++ locks/unix/Makefile.in | 3 +- locks/unix/thread_mutex.c | 224 ++++++++++++++++++++++++++++ locks/win32/thread_mutex.c | 92 ++++++++++++ 14 files changed, 1063 insertions(+), 3 deletions(-) create mode 100644 include/apr_thread_mutex.h create mode 100644 include/arch/beos/thread_mutex.h create mode 100644 include/arch/netware/thread_mutex.h create mode 100644 include/arch/os2/thread_mutex.h create mode 100644 include/arch/unix/thread_mutex.h create mode 100644 include/arch/win32/thread_mutex.h create mode 100644 locks/beos/thread_mutex.c create mode 100644 locks/netware/thread_mutex.c create mode 100644 locks/os2/thread_mutex.c create mode 100644 locks/unix/thread_mutex.c create mode 100644 locks/win32/thread_mutex.c diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h new file mode 100644 index 00000000000..1dfccb38bad --- /dev/null +++ b/include/apr_thread_mutex.h @@ -0,0 +1,119 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_THREAD_MUTEX_H +#define APR_THREAD_MUTEX_H + +#include "apr.h" +#include "apr_pools.h" +#include "apr_errno.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @file apr_thread_mutex.h + * @brief APR Thread Mutex Routines + */ + +/** + * @defgroup APR_ThreadMutex Thread Mutex Routines + * @ingroup APR + * @{ + */ + +typedef struct apr_thread_mutex_t apr_thread_mutex_t; + +/** + * Create and initialize a mutex that can be used to synchronize threads. + * @param mutex the memory address where the newly created mutex will be + * stored. + * @param pool the pool from which to allocate the mutex. + */ +APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, + apr_pool_t *pool); +/** + * Acquire the lock for the given mutex. If the mutex is already locked, + * the current thread will be put to sleep until the lock becomes available. + * @param mutex the mutex on which to acquire the lock. + */ +APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex); + +/** + * Attempt to acquire the lock for the given mutex. If the mutex has already + * been acquired, the call returns immediately with APR_EBUSY. Note: it + * is important that the APR_STATUS_IS_EBUSY(s) macro be used to determine + * if the return value was APR_EBUSY, for portability reasons. + * @param mutex the mutex on which to attempt the lock acquiring. + */ +APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex); + +/** + * Release the lock for the given mutex. + * @param mutex the mutex from which to release the lock. + */ +APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex); + +/** + * Destroy the mutex and free the memory associated with the lock. + * @param mutex the mutex to destroy. + */ +APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex); + +#ifdef __cplusplus +} +#endif + +#endif /* ! APR_THREAD_MUTEX_H */ diff --git a/include/arch/beos/thread_mutex.h b/include/arch/beos/thread_mutex.h new file mode 100644 index 00000000000..cdfc4ebf34b --- /dev/null +++ b/include/arch/beos/thread_mutex.h @@ -0,0 +1,71 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_MUTEX_H +#define THREAD_MUTEX_H + +#include +#include "apr_pools.h" +#include "apr_thread_mutex.h" +#include "apr_file_io.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_portable.h" + +struct apr_thread_mutex_t { + apr_pool_t *pool; +}; + +#endif /* THREAD_MUTEX_H */ + diff --git a/include/arch/netware/thread_mutex.h b/include/arch/netware/thread_mutex.h new file mode 100644 index 00000000000..352d87973e0 --- /dev/null +++ b/include/arch/netware/thread_mutex.h @@ -0,0 +1,66 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_MUTEX_H +#define THREAD_MUTEX_H + +#include "apr_thread_mutex.h" +#include + +struct apr_thread_mutex_t { + apr_pool_t *pool; +}; + +#endif /* THREAD_MUTEX_H */ + diff --git a/include/arch/os2/thread_mutex.h b/include/arch/os2/thread_mutex.h new file mode 100644 index 00000000000..29d9ed733ef --- /dev/null +++ b/include/arch/os2/thread_mutex.h @@ -0,0 +1,66 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_MUTEX_H +#define THREAD_MUTEX_H + +#include "apr_thread_mutex.h" +#include "apr_file_io.h" + +struct apr_thread_mutex_t { + apr_pool_t *pool; +}; + +#endif /* THREAD_MUTEX_H */ + diff --git a/include/arch/unix/thread_mutex.h b/include/arch/unix/thread_mutex.h new file mode 100644 index 00000000000..349aabf8642 --- /dev/null +++ b/include/arch/unix/thread_mutex.h @@ -0,0 +1,81 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_MUTEX_H +#define THREAD_MUTEX_H + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_thread_mutex.h" +#include "apr_sms.h" +#include "apr_portable.h" + +#if APR_HAVE_PTHREAD_H +#include +#endif +/* End System Headers */ + +#if APR_HAS_THREADS +struct apr_thread_mutex_t { + apr_pool_t *pool; + pthread_mutex_t mutex; + apr_os_thread_t owner; + int owner_ref; +}; +#endif + +#endif /* THREAD_MUTEX_H */ + diff --git a/include/arch/win32/thread_mutex.h b/include/arch/win32/thread_mutex.h new file mode 100644 index 00000000000..ee7a0ecccec --- /dev/null +++ b/include/arch/win32/thread_mutex.h @@ -0,0 +1,65 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_MUTEX_H +#define THREAD_MUTEX_H + +#include "apr_lock.h" + +struct apr_thread_mutex_t { + apr_pool_t *pool; +}; + +#endif /* THREAD_MUTEX_H */ + diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in index d8d200cea74..b958d26f857 100644 --- a/locks/beos/Makefile.in +++ b/locks/beos/Makefile.in @@ -1,5 +1,6 @@ -TARGETS = locks.lo +TARGETS = locks.lo \ + thread_mutex.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c new file mode 100644 index 00000000000..0f3cc1d9c89 --- /dev/null +++ b/locks/beos/thread_mutex.c @@ -0,0 +1,93 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/*Read/Write locking implementation based on the MultiLock code from + * Stephen Beaulieu + */ + +#include "beos/thread_mutex.h" +#include "apr_strings.h" +#include "apr_portable.h" + +static apr_status_t thread_mutex_cleanup(void *data) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c new file mode 100644 index 00000000000..4a4666f8a0a --- /dev/null +++ b/locks/netware/thread_mutex.c @@ -0,0 +1,92 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_strings.h" +#include "thread_mutex.h" +#include "apr_portable.h" + +static apr_status_t thread_mutex_cleanup(void *data) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + diff --git a/locks/os2/Makefile.in b/locks/os2/Makefile.in index 93092897580..2369cebf211 100644 --- a/locks/os2/Makefile.in +++ b/locks/os2/Makefile.in @@ -1,5 +1,6 @@ -TARGETS = locks.lo +TARGETS = locks.lo \ + thread_mutex.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c new file mode 100644 index 00000000000..d47e3be1253 --- /dev/null +++ b/locks/os2/thread_mutex.c @@ -0,0 +1,88 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include "apr_portable.h" +#include "thread_mutex.h" +#include "fileio.h" +#include + +APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index d375b3a74bb..cddd5d18ccc 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -2,7 +2,8 @@ TARGETS = \ locks.lo \ crossproc.lo \ - intraproc.lo + intraproc.lo \ + thread_mutex.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c new file mode 100644 index 00000000000..7e4ee3ec965 --- /dev/null +++ b/locks/unix/thread_mutex.c @@ -0,0 +1,224 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "thread_mutex.h" + +#if APR_HAS_THREADS + +static apr_status_t thread_mutex_cleanup(void *data) +{ + apr_thread_mutex_t *mutex = (apr_thread_mutex_t *)data; + apr_status_t stat; + + pthread_mutex_unlock(&mutex->mutex); + stat = pthread_mutex_destroy(&mutex->mutex); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + return stat; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, + apr_pool_t *pool) +{ + apr_thread_mutex_t *new_mutex; + pthread_mutexattr_t mattr; + apr_status_t stat; + + new_mutex = (apr_thread_mutex_t *)apr_pcalloc(pool, + sizeof(apr_thread_mutex_t)); + + if (new_mutex == NULL) { + return APR_ENOMEM; + } + + new_mutex->pool = pool; + + if ((stat = pthread_mutexattr_init(&mattr))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + thread_mutex_cleanup(new_mutex); + return stat; + } + + if ((stat = pthread_mutex_init(&new_mutex->mutex, &mattr))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + thread_mutex_cleanup(new_mutex); + return stat; + } + + if ((stat = pthread_mutexattr_destroy(&mattr))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + thread_mutex_cleanup(new_mutex); + return stat; + } + + apr_pool_cleanup_register(new_mutex->pool, + (void *)new_mutex, thread_mutex_cleanup, + apr_pool_cleanup_null); + + *mutex = new_mutex; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) +{ + apr_status_t stat; + +#if APR_HAS_THREADS + apr_os_thread_t my_thrid; /* save one call to apr_os_thread_current() */ + + if (apr_os_thread_equal(mutex->owner, + (my_thrid = apr_os_thread_current()))) { + mutex->owner_ref++; + return APR_SUCCESS; + } +#endif + + stat = pthread_mutex_lock(&mutex->mutex); + if (stat) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + return stat; + } + +#if APR_HAS_THREADS + mutex->owner = my_thrid; + mutex->owner_ref = 1; +#endif + + return stat; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) +{ + apr_status_t stat; + +#if APR_HAS_THREADS + apr_os_thread_t my_thrid; /* save one call to apr_os_thread_current() */ + + if (apr_os_thread_equal(mutex->owner, + (my_thrid = apr_os_thread_current()))) { + mutex->owner_ref++; + return APR_SUCCESS; + } +#endif + + stat = pthread_mutex_trylock(&mutex->mutex); + if (stat) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + /* Normalize the return code. */ + if (stat == EBUSY) + stat = APR_EBUSY; + + return stat; + } + +#if APR_HAS_THREADS + mutex->owner = my_thrid; + mutex->owner_ref = 1; +#endif + + return stat; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) +{ + apr_status_t status; + +#if APR_HAS_THREADS + if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { + mutex->owner_ref--; + if (mutex->owner_ref > 0) + return APR_SUCCESS; + } +#endif + + status = pthread_mutex_unlock(&mutex->mutex); + if (status) { +#ifdef PTHREAD_SETS_ERRNO + status = errno; +#endif + return status; + } + +#if APR_HAS_THREADS + memset(&mutex->owner, 0, sizeof mutex->owner); + mutex->owner_ref = 0; +#endif + + return status; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) +{ + apr_status_t stat; + if ((stat = thread_mutex_cleanup(mutex)) == APR_SUCCESS) { + apr_pool_cleanup_kill(mutex->pool, mutex, thread_mutex_cleanup); + return APR_SUCCESS; + } + return stat; +} + +#endif /* APR_HAS_THREADS */ diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c new file mode 100644 index 00000000000..3e888509a14 --- /dev/null +++ b/locks/win32/thread_mutex.c @@ -0,0 +1,92 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_strings.h" +#include "win32/thread_mutex.h" +#include "apr_portable.h" + +static apr_status_t thread_mutex_cleanup(void *data) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + From fb73f8f0736ec68bd4f9c8c472f1cbe4d74f1641 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 5 Sep 2001 00:33:49 +0000 Subject: [PATCH 2288/7878] Fix the APR compile when --disable-threads is specified. Submitted by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62287 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_mutex.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 1dfccb38bad..3159bd8f3df 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -63,6 +63,8 @@ extern "C" { #endif /* __cplusplus */ +#if APR_HAS_THREADS + /** * @file apr_thread_mutex.h * @brief APR Thread Mutex Routines @@ -112,6 +114,8 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex); */ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex); +#endif + #ifdef __cplusplus } #endif From 500b83e41e9d217935574d881a72f430b30ade14 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 5 Sep 2001 04:43:28 +0000 Subject: [PATCH 2289/7878] Work around the fact that GetNamedSecurityInfoW for unicode pathnames is an odd beast that doesn't accept \\?\ notation. Submitted by: Mats Nilsson git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62288 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 88cd40cf252..19eb96655fe 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -226,13 +226,23 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, apr_int32_t wante sinf |= GROUP_SECURITY_INFORMATION; if (wanted & APR_FINFO_PROT) sinf |= DACL_SECURITY_INFORMATION; - if (whatfile == MORE_OF_WFSPEC) - rv = GetNamedSecurityInfoW((apr_wchar_t*)ufile, + if (whatfile == MORE_OF_WFSPEC) { + apr_wchar_t *wfile = (apr_wchar_t*) ufile; + int fix = 0; + if (wcsncmp(wfile, L"\\\\?\\", 4)) { + fix = 4; + if (wcsncmp(wfile + fix, L"UNC\\", 4)) + wfile[6] = L'\\', fix = 6; + } + rv = GetNamedSecurityInfoW(wfile + fix, SE_FILE_OBJECT, sinf, ((wanted & APR_FINFO_USER) ? &user : NULL), ((wanted & APR_FINFO_GROUP) ? &grp : NULL), ((wanted & APR_FINFO_PROT) ? &dacl : NULL), NULL, &pdesc); + if (fix == 6) + wfile[6] = L'C'; + } else if (whatfile == MORE_OF_FSPEC) rv = GetNamedSecurityInfoA((char*)ufile, SE_FILE_OBJECT, sinf, From 693dd092e1bebaa4816786e2956d157e13412b94 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 5 Sep 2001 04:49:08 +0000 Subject: [PATCH 2290/7878] Matt astutely observed that we were only long-pathing the filename iff the path was slash delimited. Provide for backslash delimiters. Note all our canonicalization refuses to speak \\?\ (and backs it out, if it's encountered) since this is entirely unportable even to Win9x. Therefore we don't have to worry about encountering it here. Submitted by: Mats Nilsson git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62289 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 05440654ef5..3b81b4116d7 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -84,12 +84,13 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, int retremains = srcremains; apr_wchar_t *t = retstr; apr_status_t rv; - if (srcstr[1] == ':' && srcstr[2] == '/') { + if (srcstr[1] == ':' && (srcstr[2] == '/' || srcstr[2] == '\\')) { wcscpy (retstr, L"\\\\?\\"); retlen -= 4; t += 4; } - else if (srcstr[0] == '/' && srcstr[1] == '/') { + else if ((srcstr[0] == '/' || srcstr[0] == '\\') + && (srcstr[1] == '/' || srcstr[1] == '\\')) { /* Skip the slashes */ srcstr += 2; wcscpy (retstr, L"\\\\?\\UNC\\"); From e311a3f33c2294fbdb330dd121eaebefcb21ee5c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 5 Sep 2001 04:50:30 +0000 Subject: [PATCH 2291/7878] Ok, strict in response, forgiving of the input. This assures we won't double-escape //? anything if it's passed in this notation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62290 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 3b81b4116d7..9dbb736b3b3 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -90,7 +90,8 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, t += 4; } else if ((srcstr[0] == '/' || srcstr[0] == '\\') - && (srcstr[1] == '/' || srcstr[1] == '\\')) { + && (srcstr[1] == '/' || srcstr[1] == '\\') + && (srcstr[2] != '?')) { /* Skip the slashes */ srcstr += 2; wcscpy (retstr, L"\\\\?\\UNC\\"); From 1556d0e9e15b68704ac5c56ad71d44d43ada1f3e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 5 Sep 2001 19:34:01 +0000 Subject: [PATCH 2292/7878] Cleanup some of the thread lock work. Remove some unnecessary header files, and add tell apr_want.h that we want mem functions. Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62291 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/thread_mutex.h | 3 --- locks/unix/thread_mutex.c | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/arch/unix/thread_mutex.h b/include/arch/unix/thread_mutex.h index 349aabf8642..71815e2677a 100644 --- a/include/arch/unix/thread_mutex.h +++ b/include/arch/unix/thread_mutex.h @@ -58,15 +58,12 @@ #include "apr.h" #include "apr_private.h" #include "apr_general.h" -#include "apr_lib.h" #include "apr_thread_mutex.h" -#include "apr_sms.h" #include "apr_portable.h" #if APR_HAVE_PTHREAD_H #include #endif -/* End System Headers */ #if APR_HAS_THREADS struct apr_thread_mutex_t { diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 7e4ee3ec965..40c6836433d 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -53,6 +53,8 @@ */ #include "thread_mutex.h" +#define APR_WANT_MEMFUNC +#include "apr_want.h" #if APR_HAS_THREADS From c2534b22ba056128c873715d488341cbfdcf1607 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 6 Sep 2001 06:34:59 +0000 Subject: [PATCH 2293/7878] The find_entry() function in apr_hash.c is responsible for over half the apr_pcalloc() calls in the httpd. The calloc call is somewhat wasteful in this context; 4 of the 5 fields in the allocated struct get overwritten immediately. Thus the following patch replaces the calloc with an alloc and sets the one necessary field to NULL. Submitted by: Brian Pane Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62292 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 49e11f5ef97..3e1678aebfc 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -278,7 +278,8 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, if (he || !val) return hep; /* add a new entry for non-NULL values */ - he = apr_pcalloc(ht->pool, sizeof(*he)); + he = apr_palloc(ht->pool, sizeof(*he)); + he->next = NULL; he->hash = hash; he->key = key; he->klen = klen; From e9552594ac645be7b6bb2ef985e45eff1fbdd3cb Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 7 Sep 2001 04:02:24 +0000 Subject: [PATCH 2294/7878] On platforms that have sigsuspend (such as Darwin) but not apr_sigwait, we don't need sig_func declared. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62293 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 1d905e058b3..0872ecc4afa 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -271,7 +271,9 @@ const char *apr_signal_get_description(int signum) APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)) { sigset_t sig_mask; +#if APR_HAVE_SIGWAIT int (*sig_func)(int signum) = (int (*)(int))signal_handler; +#endif /* This thread will be the one responsible for handling signals */ sigfillset(&sig_mask); From 26bd95f9d00979f36da8821ee9eda00784c11b33 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 8 Sep 2001 09:07:36 +0000 Subject: [PATCH 2295/7878] - Add note about fcntl() breakage seen on Solaris 8. This is just odd. Switching to pthread_mutex_t works just fine (that requires a patch to configure.in though)... =-) - While we don't think that the FreeBSD threads/sendfile thing is our problem (ktrace seems to confirm that we are doing the "right" thing), we *should* send a bug report to the FreeBSD people so that one of their people can take a look at it. Do we know any FreeBSD people? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62294 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index e0a42368cfa..98515dcdfe6 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/08/24 18:04:24 $] +Last modified at [$Date: 2001/09/08 09:07:36 $] Release: @@ -185,6 +185,36 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * apr_xlate.h generates a bunch of compiler warnings. + * fcntl() oddness on Solaris. Under high loads, fcntl() decides to + return error code 46 (ENOLCK). + + httpd (prefork MPM) error log says (predictably): + + (46)No record locks available: couldn't grab the accept mutex + + All of the children report this and subsequently exits. httpd is now + hosed. AFAICT, this does not look to be an out-of-fds error. + + Solaris's man page says: + ENOLCK + The cmd argument is F_SETLK, F_SETLK64, F_SETLKW, or + F_SETLKW64 and satisfying the lock or unlock request + would result in the number of locked regions in the + system exceeding a system-imposed limit. + + Justin says: What is this system-imposed limit and how do we change it? + This gives me more rationale for switching the default + interprocess lock mechanism to pthread (if available). + + * Generate a good bug report to send to the FreeBSD hackers that details + the problems we have seen with threads and system calls (specifically + sendfile data is corrupted). From our analysis so far, we don't think + that this is an APR issue, but rather a FreeBSD kernel issue. Our + current solution is to just disable threads across the board on + FreeBSD. + + MsgID: <20010828091959.D17570@ebuilt.com> + Documentation that needs writing: * API documentation From 7e805d29e1a08ac74ccda4a56bf043892d089657 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 8 Sep 2001 23:36:35 +0000 Subject: [PATCH 2296/7878] Add the new thread read/write API to APR. This doesn't change any API, just adds a new one. Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62295 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 + include/apr_thread_rwlock.h | 149 +++++++++++++++++++++ include/arch/beos/thread_rwlock.h | 71 ++++++++++ include/arch/netware/thread_rwlock.h | 66 +++++++++ include/arch/os2/thread_rwlock.h | 66 +++++++++ include/arch/unix/thread_rwlock.h | 77 +++++++++++ include/arch/win32/thread_rwlock.h | 65 +++++++++ locks/beos/Makefile.in | 3 +- locks/beos/thread_rwlock.c | 98 ++++++++++++++ locks/netware/thread_rwlock.c | 97 ++++++++++++++ locks/os2/Makefile.in | 3 +- locks/os2/thread_rwlock.c | 98 ++++++++++++++ locks/unix/Makefile.in | 3 +- locks/unix/thread_rwlock.c | 192 +++++++++++++++++++++++++++ locks/win32/thread_rwlock.c | 97 ++++++++++++++ 15 files changed, 1088 insertions(+), 3 deletions(-) create mode 100644 include/apr_thread_rwlock.h create mode 100644 include/arch/beos/thread_rwlock.h create mode 100644 include/arch/netware/thread_rwlock.h create mode 100644 include/arch/os2/thread_rwlock.h create mode 100644 include/arch/unix/thread_rwlock.h create mode 100644 include/arch/win32/thread_rwlock.h create mode 100644 locks/beos/thread_rwlock.c create mode 100644 locks/netware/thread_rwlock.c create mode 100644 locks/os2/thread_rwlock.c create mode 100644 locks/unix/thread_rwlock.c create mode 100644 locks/win32/thread_rwlock.c diff --git a/CHANGES b/CHANGES index 33f67356050..8600773592b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) Add the new thread read/write lock API to APR. + [Aaron Bannert ] + + *) Add the new thread mutex lock API to APR. + [Aaron Bannert ] + *) Cache GMT offset on platforms that don't store it in the tm struct. This offset is normalized to be independent of daylight savings time. [Brian Pane ] diff --git a/include/apr_thread_rwlock.h b/include/apr_thread_rwlock.h new file mode 100644 index 00000000000..d43a13e31dd --- /dev/null +++ b/include/apr_thread_rwlock.h @@ -0,0 +1,149 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_THREAD_RWLOCK_H +#define APR_THREAD_RWLOCK_H + +#include "apr.h" +#include "apr_pools.h" +#include "apr_errno.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#if APR_HAS_THREADS + +/** + * @file apr_lock.h + * @brief APR Thread RWLock Routines + */ + +/** + * @defgroup APR_ThreadRWLock Thread RWLock Routines + * @ingroup APR + * @{ + */ + +typedef struct apr_thread_rwlock_t apr_thread_rwlock_t; + +/** + * Create and initialize a read-write lock that can be used to synchronize + * threads. + * @param rwlock the memory address where the newly created readwrite lock + * will be stored. + * @param pool the pool from which to allocate the mutex. + */ +APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, + apr_pool_t *pool); +/** + * Acquire a shared-read lock on the given read-write lock. This will allow + * multiple threads to enter the same critical section while they have acquired + * the read lock. + * @param rwlock the read-write lock on which to acquire the shared read. + */ +APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock); + +/** + * Attempt to acquire the shread-read lock on the given read-write lock. This + * is the same as apr_thread_rwlock_rdlock(), only that the funtion fails + * if there is another thread holding the write lock, or if there are any + * write threads blocking on the lock. If the function failes for this case, + * APR_EBUSY will be returned. Note: it is important that the + * APR_STATUS_IS_EBUSY(s) macro be used to determine if the return value was + * APR_EBUSY, for portability reasons. + * @param rwlock the rwlock on which to attempt the shared read. + */ +APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock); + +/** + * Acquire an exclusive-write lock on the given read-write lock. This will + * allow only one single thread to enter the critical sections. If there + * are any threads currently holding thee read-lock, this thread is put to + * sleep until it can have exclusive access to the lock. + * @param rwlock the read-write lock on which to acquire the exclusive write. + */ +APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock); + +/** + * Attempt to acquire the exclusive-write lock on the given read-write lock. + * This is the same as apr_thread_rwlock_wrlock(), only that the funtion fails + * if there is any other thread holding the lock (for reading or writing), + * in which case the function will return APR_EBUSY. Note: it is important + * that the APR_STATUS_IS_EBUSY(s) macro be used to determine if the return + * value was APR_EBUSY, for portability reasons. + * @param rwlock the rwlock on which to attempt the exclusive write. + */ +APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock); + +/** + * Release either the read or write lock currently held by the calling thread + * associated with the given read-write lock. + * @param rwlock the read-write lock rom which to release the lock. + */ +APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock); + +/** + * Destroy the read-write lock and free the associated memory. + * @param rwlock the rwlock to destroy. + */ +APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock); + +#endif /* APR_HAS_THREADS */ + +#ifdef __cplusplus +} +#endif + +#endif /* ! APR_THREAD_RWLOCK_H */ diff --git a/include/arch/beos/thread_rwlock.h b/include/arch/beos/thread_rwlock.h new file mode 100644 index 00000000000..02f1c5d2299 --- /dev/null +++ b/include/arch/beos/thread_rwlock.h @@ -0,0 +1,71 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_RWLOCK_H +#define THREAD_RWLOCK_H + +#include +#include "apr_pools.h" +#include "apr_thread_rwlock.h" +#include "apr_file_io.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_portable.h" + +struct apr_thread_rwlock_t { + apr_pool_t *pool; +}; + +#endif /* THREAD_RWLOCK_H */ + diff --git a/include/arch/netware/thread_rwlock.h b/include/arch/netware/thread_rwlock.h new file mode 100644 index 00000000000..2652465108b --- /dev/null +++ b/include/arch/netware/thread_rwlock.h @@ -0,0 +1,66 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_RWLOCK_H +#define THREAD_RWLOCK_H + +#include "apr_thread_rwlock.h" +#include + +struct apr_thread_rwlock_t { + apr_pool_t *pool; +}; + +#endif /* THREAD_RWLOCK_H */ + diff --git a/include/arch/os2/thread_rwlock.h b/include/arch/os2/thread_rwlock.h new file mode 100644 index 00000000000..d8d153136d3 --- /dev/null +++ b/include/arch/os2/thread_rwlock.h @@ -0,0 +1,66 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_RWLOCK_H +#define THREAD_RWLOCK_H + +#include "apr_thread_rwlock.h" +#include "apr_file_io.h" + +struct apr_thread_rwlock_t { + apr_pool_t *pool; +}; + +#endif /* THREAD_RWLOCK_H */ + diff --git a/include/arch/unix/thread_rwlock.h b/include/arch/unix/thread_rwlock.h new file mode 100644 index 00000000000..2d8b0b7c136 --- /dev/null +++ b/include/arch/unix/thread_rwlock.h @@ -0,0 +1,77 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_RWLOCK_H +#define THREAD_RWLOCK_H + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_thread_rwlock.h" +#include "apr_pools.h" + +#if APR_HAVE_PTHREAD_H +/* this gives us pthread_rwlock_t */ +#include +#endif + +#if APR_HAS_THREADS +struct apr_thread_rwlock_t { + apr_pool_t *pool; + pthread_rwlock_t *rwlock; +}; +#endif + +#endif /* THREAD_RWLOCK_H */ + diff --git a/include/arch/win32/thread_rwlock.h b/include/arch/win32/thread_rwlock.h new file mode 100644 index 00000000000..db7ee73da0e --- /dev/null +++ b/include/arch/win32/thread_rwlock.h @@ -0,0 +1,65 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_RWLOCK_H +#define THREAD_RWLOCK_H + +#include "apr_thread_rwlock.h" + +struct apr_thread_rwlock_t { + apr_pool_t *pool; +}; + +#endif /* THREAD_RWLOCK_H */ + diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in index b958d26f857..d3eda157c72 100644 --- a/locks/beos/Makefile.in +++ b/locks/beos/Makefile.in @@ -1,6 +1,7 @@ TARGETS = locks.lo \ - thread_mutex.lo + thread_mutex.lo \ + thread_rwlock.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/beos/thread_rwlock.c b/locks/beos/thread_rwlock.c new file mode 100644 index 00000000000..98595e67f0d --- /dev/null +++ b/locks/beos/thread_rwlock.c @@ -0,0 +1,98 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/*Read/Write locking implementation based on the MultiLock code from + * Stephen Beaulieu + */ + +#include "beos/thread_rwlock.h" +#include "apr_strings.h" +#include "apr_portable.h" + +APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + diff --git a/locks/netware/thread_rwlock.c b/locks/netware/thread_rwlock.c new file mode 100644 index 00000000000..ba10eaf45ab --- /dev/null +++ b/locks/netware/thread_rwlock.c @@ -0,0 +1,97 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_strings.h" +#include "thread_rwlock.h" +#include "apr_portable.h" + +APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + diff --git a/locks/os2/Makefile.in b/locks/os2/Makefile.in index 2369cebf211..2552ac40fd0 100644 --- a/locks/os2/Makefile.in +++ b/locks/os2/Makefile.in @@ -1,6 +1,7 @@ TARGETS = locks.lo \ - thread_mutex.lo + thread_mutex.lo \ + thread_rwlock.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/os2/thread_rwlock.c b/locks/os2/thread_rwlock.c new file mode 100644 index 00000000000..e769f3f7fdd --- /dev/null +++ b/locks/os2/thread_rwlock.c @@ -0,0 +1,98 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include "apr_portable.h" +#include "thread_rwlock.h" +#include "fileio.h" +#include + +APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index cddd5d18ccc..46b40340b75 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -3,7 +3,8 @@ TARGETS = \ locks.lo \ crossproc.lo \ intraproc.lo \ - thread_mutex.lo + thread_mutex.lo \ + thread_rwlock.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c new file mode 100644 index 00000000000..95ef5e5421b --- /dev/null +++ b/locks/unix/thread_rwlock.c @@ -0,0 +1,192 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "thread_rwlock.h" + +#if APR_HAS_THREADS + +static apr_status_t thread_rwlock_cleanup(void *data) +{ + apr_thread_rwlock_t *rwlock = (apr_thread_rwlock_t *)data; + apr_status_t stat; + + pthread_rwlock_unlock(rwlock->rwlock); + stat = pthread_rwlock_destroy(rwlock->rwlock); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + return stat; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, + apr_pool_t *pool) +{ + apr_thread_rwlock_t *new_rwlock; + apr_status_t stat; + + new_rwlock = (apr_thread_rwlock_t *)apr_pcalloc(pool, + sizeof(apr_thread_rwlock_t)); + + if (new_rwlock == NULL) { + return APR_ENOMEM; + } + + new_rwlock->pool = pool; + new_rwlock->rwlock = (pthread_rwlock_t *)apr_palloc(pool, + sizeof(pthread_rwlock_t)); + + if (new_rwlock->rwlock == NULL) { + return APR_ENOMEM; + } + + if ((stat = pthread_rwlock_init(new_rwlock->rwlock, NULL))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + thread_rwlock_cleanup(new_rwlock); + return stat; + } + + apr_pool_cleanup_register(new_rwlock->pool, + (void *)new_rwlock, thread_rwlock_cleanup, + apr_pool_cleanup_null); + + *rwlock = new_rwlock; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) +{ + apr_status_t stat; + + stat = pthread_rwlock_rdlock(rwlock->rwlock); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + return stat; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) +{ + apr_status_t stat; + + stat = pthread_rwlock_tryrdlock(rwlock->rwlock); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + /* Normalize the return code. */ + if (stat == EBUSY) + stat = APR_EBUSY; + return stat; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) +{ + apr_status_t stat; + + stat = pthread_rwlock_wrlock(rwlock->rwlock); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + return stat; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) +{ + apr_status_t stat; + + stat = pthread_rwlock_trywrlock(rwlock->rwlock); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + /* Normalize the return code. */ + if (stat == EBUSY) + stat = APR_EBUSY; + return stat; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) +{ + apr_status_t stat; + + stat = pthread_rwlock_unlock(rwlock->rwlock); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + return stat; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) +{ + apr_status_t stat; + if ((stat = thread_rwlock_cleanup(rwlock)) == APR_SUCCESS) { + apr_pool_cleanup_kill(rwlock->pool, rwlock, thread_rwlock_cleanup); + return APR_SUCCESS; + } + return stat; +} + +#endif /* APR_HAS_THREADS */ diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c new file mode 100644 index 00000000000..4d875b5a776 --- /dev/null +++ b/locks/win32/thread_rwlock.c @@ -0,0 +1,97 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_strings.h" +#include "win32/thread_rwlock.h" +#include "apr_portable.h" + +APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + From 416729a8df2472ec516e02194c4e8c142f0b006e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 9 Sep 2001 06:03:05 +0000 Subject: [PATCH 2297/7878] Fix the apr_proc_create for win32. In order to do so, this patch introduces a flags arg for apr_filepath_get(), like apr_filepath_merge(), that allows the APR_FILEPATH_NATIVE result format. This launches win32 processes with the Unicode semantics (although it runs sbcs apps equally well) and changes the default to 'not detached', in sync with the unix default. Finally, assures apr_filepath_get() uses the '/' semantics on OS2 by default. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62296 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 18 +- file_io/netware/filesys.c | 2 +- file_io/os2/filesys.c | 26 ++- file_io/unix/filepath.c | 5 +- file_io/win32/filepath.c | 4 +- file_io/win32/filesys.c | 29 ++- include/apr_file_info.h | 7 +- include/apr_thread_proc.h | 6 + include/arch/os2/fileio.h | 3 +- include/arch/win32/fileio.h | 20 +- include/arch/win32/threadproc.h | 1 - test/testmmap.c | 2 +- threadproc/win32/proc.c | 339 ++++++++++++++++++-------------- threadproc/win32/signals.c | 2 +- 14 files changed, 273 insertions(+), 191 deletions(-) diff --git a/CHANGES b/CHANGES index 8600773592b..1fc9774ebd4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,10 +1,18 @@ Changes with APR b1 - *) Add the new thread read/write lock API to APR. - [Aaron Bannert ] - - *) Add the new thread mutex lock API to APR. - [Aaron Bannert ] + *) Fix the API for the apr_proc_create() call on Win32. Several + bad assumptions are gone, including a mismatch between unix and + win32, where win32 was defaulting to create detached. Also fixes + the apr_proc_t's pid member to a real pid (identity that works + across processes) instead of the handle (which is a new hproc + member value.) [William Rowe] + + *) Modify the external apr_filepath_get() fn to take a flags arg, + currently only for APR_FILEPATH_NATIVE. This returns c:\foo + format on Win32, and should do the same on OS2, or sys\vol:\foo + on Netware. Primarily for internals, but possibly useful to + others (and it mirrors some of the other apr_filepath_*() calls.) + [William Rowe] *) Cache GMT offset on platforms that don't store it in the tm struct. This offset is normalized to be independent of daylight savings diff --git a/file_io/netware/filesys.c b/file_io/netware/filesys.c index e3f23ac6349..a28d6f3f822 100644 --- a/file_io/netware/filesys.c +++ b/file_io/netware/filesys.c @@ -102,7 +102,7 @@ apr_status_t filepath_compare_drive(char *path1, char *path2, apr_pool_t *p) return -1; } -APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, +APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_int32_t flags, apr_pool_t *p) { char path[APR_PATH_MAX]; diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c index af55fbe8d09..4f99c4867c0 100644 --- a/file_io/os2/filesys.c +++ b/file_io/os2/filesys.c @@ -100,7 +100,8 @@ apr_status_t filepath_root_test(char *path, apr_pool_t *p) } -apr_status_t filepath_drive_get(char **rootpath, char drive, apr_pool_t *p) +apr_status_t filepath_drive_get(char **rootpath, char drive, + apr_int32_t flags, apr_pool_t *p) { char path[APR_PATH_MAX]; char *pos; @@ -117,12 +118,11 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, apr_pool_t *p) return APR_FROM_OS_ERROR(rc); } - /* ###: We really should consider adding a flag to allow the user - * to have the APR_FILEPATH_NATIVE result - */ - for (pos=path; *pos; pos++) { - if (*pos == '\\') - *pos = '/'; + if (!(flags & APR_FILEPATH_NATIVE)) { + for (pos=path; *pos; pos++) { + if (*pos == '\\') + *pos = '/'; + } } *rootpath = apr_pstrdup(p, path); @@ -142,12 +142,14 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) } -APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_int32_t flags, + apr_pool_t *p) { char path[APR_PATH_MAX]; ULONG drive; ULONG drivemap; ULONG rv, pathlen = sizeof(path) - 3; + char *pos; DosQueryCurrentDisk(&drive, &drivemap); path[0] = '@' + drive; @@ -155,6 +157,14 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_pool_t *p) rv = DosQueryCurrentDir(drive, path+3, &pathlen); *defpath = apr_pstrdup(p, path); + + if (!(flags & APR_FILEPATH_NATIVE)) { + for (pos=*defpath; *pos; pos++) { + if (*pos == '\\') + *pos = '/'; + } + } + return APR_SUCCESS; } diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index c7ae8ca5ff5..be4dd3b19ea 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -71,7 +71,8 @@ /* Any OS that requires/refuses trailing slashes should be dealt with here. */ -APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_int32_t flags, + apr_pool_t *p) { char path[APR_PATH_MAX]; if (!getcwd(path, sizeof(path))) { @@ -170,7 +171,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * passing the address of a char const* for a char** arg. */ char *getpath; - rv = apr_filepath_get(&getpath, p); + rv = apr_filepath_get(&getpath, apr_int32_t flags, p); rootpath = getpath; if (rv != APR_SUCCESS) return errno; diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index cef981ff853..8178757fe2d 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -418,10 +418,10 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, char *getpath; #ifndef NETWARE if (addtype == APR_EINCOMPLETE && addroot[1] == ':') - rv = filepath_drive_get(&getpath, addroot[0], p); + rv = filepath_drive_get(&getpath, addroot[0], flags, p); else #endif - rv = apr_filepath_get(&getpath, p); + rv = apr_filepath_get(&getpath, flags, p); if (rv != APR_SUCCESS) return rv; basepath = getpath; diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c index 0c741f7a00e..ba3d5b4806a 100644 --- a/file_io/win32/filesys.c +++ b/file_io/win32/filesys.c @@ -116,7 +116,8 @@ apr_status_t filepath_root_test(char *path, apr_pool_t *p) } -apr_status_t filepath_drive_get(char **rootpath, char drive, apr_pool_t *p) +apr_status_t filepath_drive_get(char **rootpath, char drive, + apr_int32_t flags, apr_pool_t *p) { char path[APR_PATH_MAX]; #if APR_HAS_UNICODE_FS @@ -149,12 +150,11 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, apr_pool_t *p) if (!GetFullPathName(drivestr, sizeof(path), path, &ignored)) return apr_get_os_error(); } - /* ###: We really should consider adding a flag to allow the user - * to have the APR_FILEPATH_NATIVE result - */ - for (*rootpath = path; **rootpath; ++*rootpath) { - if (**rootpath == '\\') - **rootpath = '/'; + if (!(flags & APR_FILEPATH_NATIVE)) { + for (*rootpath = path; **rootpath; ++*rootpath) { + if (**rootpath == '\\') + **rootpath = '/'; + } } *rootpath = apr_pstrdup(p, path); return APR_SUCCESS; @@ -201,7 +201,7 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) } -APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, +APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_int32_t flags, apr_pool_t *p) { char path[APR_PATH_MAX]; @@ -222,12 +222,11 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, if (!GetCurrentDirectory(sizeof(path), path)) return apr_get_os_error(); } - /* ###: We really should consider adding a flag to allow the user - * to have the APR_FILEPATH_NATIVE result - */ - for (*rootpath = path; **rootpath; ++*rootpath) { - if (**rootpath == '\\') - **rootpath = '/'; + if (!(flags & APR_FILEPATH_NATIVE)) { + for (*rootpath = path; **rootpath; ++*rootpath) { + if (**rootpath == '\\') + **rootpath = '/'; + } } *rootpath = apr_pstrdup(p, path); return APR_SUCCESS; @@ -257,5 +256,3 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath, } return APR_SUCCESS; } - - diff --git a/include/apr_file_info.h b/include/apr_file_info.h index efd2ec8a24b..f057b7013de 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -357,10 +357,13 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * Return the default file path (for relative file names) * @ingroup apr_filepath * @param path the default path string returned + * @param flags optional flag APR_FILEPATH_NATIVE to retrieve the + * default file path in os-native format. * @param p the pool to allocate the default path string from - * @deffunc apr_status_t apr_filepath_get(char **path, apr_pool_t *p) + * @deffunc apr_status_t apr_filepath_get(char **path, apr_int32_t flags, apr_pool_t *p) */ -APR_DECLARE(apr_status_t) apr_filepath_get(char **path, apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_filepath_get(char **path, apr_int32_t flags, + apr_pool_t *p); /** * Set the default file path (for relative file names) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index e4cfb33b2bb..23d2ca462ae 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -124,6 +124,12 @@ struct apr_proc_t { apr_file_t *out; /** Parent's side of pipe to child's stdouterr */ apr_file_t *err; +#ifdef WIN32 + /** Must retain the handle as any clone may not have the + * the same permissions + */ + HANDLE hproc; +#endif }; typedef struct apr_thread_t apr_thread_t; diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index 61b65b219ef..98d83ea1809 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -104,7 +104,8 @@ extern const char c_is_fnchar[256]; #define IS_FNCHAR(c) c_is_fnchar[(unsigned char)c] apr_status_t filepath_root_test(char *path, apr_pool_t *p); -apr_status_t filepath_drive_get(char **rootpath, char drive, apr_pool_t *p); +apr_status_t filepath_drive_get(char **rootpath, char drive, + apr_int32_t flags, apr_pool_t *p); apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p); #endif /* ! FILE_IO_H */ diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index afb4ab905ca..70ae740300c 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -91,11 +91,25 @@ typedef apr_uint16_t apr_wchar_t; +/* Helper functions for the WinNT ApiW() functions. APR treats all + * resource identifiers (files, etc) by their UTF-8 name, to provide + * access to all named identifiers. [UTF-8 completely maps Unicode + * into char type strings.] + * + * The _path flavors below provide us fast mappings of the + * Unicode filename //?/D:/path and //?/UNC/mach/share/path mappings, + * which allow unlimited (well, 32000 wide character) length names. + * These prefixes may appear in Unicode, but must not appear in the + * Ascii API calls. So we tack them on in utf8_to_unicode_path, and + * strip them right back off in unicode_to_utf8_path. + */ apr_status_t utf8_to_unicode_path(apr_wchar_t* dststr, apr_size_t dstchars, const char* srcstr); apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, const apr_wchar_t* srcstr); +/* XXX: ONE OF THESE IS WRONG, WHO CHANGED IT? + */ #define APR_FILE_MAX MAX_PATH #else /* !APR_HAS_UNICODE_FS */ #define APR_FILE_MAX MAX_PATH @@ -233,8 +247,12 @@ apr_status_t filepath_root_test(char *path, apr_pool_t *p); * * But we need to figure out what the cwd of a given volume is, * when the user passes D:foo. This fn will determine D:'s cwd. + * + * If flags includes the bit APR_FILEPATH_NATIVE, the path returned + * is in the os-native format. */ -apr_status_t filepath_drive_get(char **rootpath, char drive, apr_pool_t *p); +apr_status_t filepath_drive_get(char **rootpath, char drive, + apr_int32_t flags, apr_pool_t *p); /* If the user passes d: vs. D: (or //mach/share vs. //MACH/SHARE), diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/threadproc.h index 47951924c08..de3f1d0d0d0 100644 --- a/include/arch/win32/threadproc.h +++ b/include/arch/win32/threadproc.h @@ -82,7 +82,6 @@ struct apr_threadkey_t { struct apr_procattr_t { apr_pool_t *cntxt; - STARTUPINFO si; apr_file_t *parent_in; apr_file_t *child_in; apr_file_t *parent_out; diff --git a/test/testmmap.c b/test/testmmap.c index 0aafd43e689..c7111c3689f 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -99,7 +99,7 @@ int main(void) } fprintf(stdout,"OK\n"); - apr_filepath_get(&file1, context); + apr_filepath_get(&file1, 0, context); file1 = apr_pstrcat(context,file1,"/testmmap.c",NULL); fprintf(stdout, "Opening file........................"); diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 806720493a0..542490c68ab 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -74,24 +74,9 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { - (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); - - if ((*new) == NULL) { - return APR_ENOMEM; - } + (*new) = (apr_procattr_t *)apr_pcalloc(cont, sizeof(apr_procattr_t)); (*new)->cntxt = cont; - (*new)->parent_in = NULL; - (*new)->child_in = NULL; - (*new)->parent_out = NULL; - (*new)->child_out = NULL; - (*new)->parent_err = NULL; - (*new)->child_err = NULL; - (*new)->currdir = NULL; (*new)->cmdtype = APR_PROGRAM; - (*new)->detached = TRUE; - - memset(&(*new)->si, 0, sizeof((*new)->si)); - return APR_SUCCESS; } @@ -127,7 +112,7 @@ static apr_status_t open_nt_process_pipe(apr_file_t **read, apr_file_t **write, static apr_status_t make_handle_private(apr_file_t *file) { - HANDLE pid = GetCurrentProcess(); + HANDLE hproc = GetCurrentProcess(); HANDLE filehand = file->filehand; /* Create new non-inheritable versions of handles that @@ -135,8 +120,8 @@ static apr_status_t make_handle_private(apr_file_t *file) * inherits these handles; resulting in non-closeable handles * to the respective pipes. */ - if (!DuplicateHandle(pid, filehand, - pid, &file->filehand, 0, + if (!DuplicateHandle(hproc, filehand, + hproc, &file->filehand, 0, FALSE, DUPLICATE_SAME_ACCESS)) return apr_get_os_error(); /* @@ -160,9 +145,9 @@ static apr_status_t make_inheritable_duplicate(apr_file_t *original, return apr_get_os_error(); else { - HANDLE pid = GetCurrentProcess(); - if (!DuplicateHandle(pid, original->filehand, - pid, &duplicate->filehand, 0, + HANDLE hproc = GetCurrentProcess(); + if (!DuplicateHandle(hproc, original->filehand, + hproc, &duplicate->filehand, 0, TRUE, DUPLICATE_SAME_ACCESS)) return apr_get_os_error(); } @@ -276,25 +261,11 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { - char path[MAX_PATH]; - int length; - - if (dir[0] != '\\' && dir[0] != '/' && dir[1] != ':') { - length = GetCurrentDirectory(MAX_PATH, path); - - if (length == 0 || length + strlen(dir) + 1 >= MAX_PATH) - return APR_ENOMEM; - - attr->currdir = apr_pstrcat(attr->cntxt, path, "\\", dir, NULL); - } - else { - attr->currdir = apr_pstrdup(attr->cntxt, dir); - } - - if (attr->currdir) { - return APR_SUCCESS; - } - return APR_ENOMEM; + /* curr dir must be in native format, there are all sorts of bugs in + * the NT library loading code that flunk the '/' parsing test. + */ + return apr_filepath_merge(&attr->currdir, NULL, dir, + APR_FILEPATH_NATIVE, attr->cntxt); } APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, @@ -311,11 +282,6 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, return APR_SUCCESS; } -/* TODO: - * apr_proc_create with APR_SHELLCMD on Win9x won't work due to MS KB: - * Q150956 - */ - APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, @@ -323,11 +289,11 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_procattr_t *attr, apr_pool_t *cont) { - apr_size_t i, iEnvBlockLen; + apr_status_t rv; + apr_oslevel_e os_level; + apr_size_t i; char *cmdline; - char ppid[20]; - char *envstr; - char *pEnvBlock, *pNext; + char *pEnvBlock; PROCESS_INFORMATION pi; DWORD dwCreationFlags = 0; @@ -335,7 +301,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, new->err = attr->parent_err; new->out = attr->parent_out; - attr->si.cb = sizeof(attr->si); + (void) apr_get_oslevel(cont, &os_level); + if (attr->detached) { /* If we are creating ourselves detached, Then we should hide the * window we are starting in. And we had better redfine our @@ -344,68 +311,56 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * not manage the stdio handles properly when running old 16 * bit executables if the detached attribute is set. */ - apr_oslevel_e os_level; - if (apr_get_oslevel(cont, &os_level) == APR_SUCCESS) { - if (os_level >= APR_WIN_NT) { - dwCreationFlags |= DETACHED_PROCESS; - } - } - attr->si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; - attr->si.wShowWindow = SW_HIDE; - - if (attr->child_in) { - attr->si.hStdInput = attr->child_in->filehand; - } - - if (attr->child_out) { - attr->si.hStdOutput = attr->child_out->filehand; - } - - if (attr->child_err) { - attr->si.hStdError = attr->child_err->filehand; + if (os_level >= APR_WIN_NT) { + /* + * XXX DETACHED_PROCESS won't on Win9x at all; on NT/W2K + * 16 bit executables fail (MS KB: Q150956) + */ + dwCreationFlags |= DETACHED_PROCESS; } } - if (attr->cmdtype == APR_PROGRAM) { - const char *ptr = progname; - - if (*ptr =='"') { - ptr++; - } - - if (*ptr == '\\' || *ptr == '/' || *++ptr == ':') { - cmdline = apr_pstrdup(cont, progname); - } - else if (attr->currdir == NULL) { - cmdline = apr_pstrdup(cont, progname); - } - else { - char lastchar = attr->currdir[strlen(attr->currdir)-1]; - if ( lastchar == '\\' || lastchar == '/') { - cmdline = apr_pstrcat(cont, attr->currdir, progname, NULL); - } - else { - cmdline = apr_pstrcat(cont, attr->currdir, "\\", progname, NULL); - } - } - } - else { - char * shell_cmd = getenv("COMSPEC"); - if (!shell_cmd) - shell_cmd = SHELL_PATH; - shell_cmd = apr_pstrdup(cont, shell_cmd); - cmdline = apr_pstrcat(cont, shell_cmd, " /C ", progname, NULL); + /* progname must be the unquoted, actual name, or NULL if this is + * a 16 bit app running in the VDM or WOW context. + */ + if (progname[0] == '\"') { + progname = apr_pstrndup(cont, progname + 1, strlen(progname) - 2); } + + /* progname must be unquoted, in native format, as there are all sorts + * of bugs in the NT library loader code that fault when parsing '/'. + * We do not directly manipulate cmdline, and it will become a copy, + * so we've casted past the constness issue. + */ + if (strchr(progname, ' ')) + cmdline = apr_pstrcat(cont, "\"", progname, "\"", NULL); + else + cmdline = (char*)progname; i = 1; while (args && args[i]) { - cmdline = apr_pstrcat(cont, cmdline, " ", args[i], NULL); + if (strchr(args[i], ' ')) + cmdline = apr_pstrcat(cont, cmdline, " \"", args[i], "\"", NULL); + else + cmdline = apr_pstrcat(cont, cmdline, " ", args[i], NULL); i++; } - _itoa(_getpid(), ppid, 10); - if (env) { - envstr = apr_pstrcat(cont, "parentpid=", ppid, NULL); + if (attr->cmdtype == APR_SHELLCMD) { + char *shellcmd = getenv("COMSPEC"); + if (!shellcmd) + shellcmd = SHELL_PATH; + if (shellcmd[0] == '"') + progname = apr_pstrndup(cont, shellcmd + 1, strlen(shellcmd) - 1); + else if (strchr(shellcmd, ' ')) + shellcmd = apr_pstrcat(cont, "\"", shellcmd, "\"", NULL); + cmdline = apr_pstrcat(cont, shellcmd, " /C \"", cmdline, "\"", NULL); + } + + if (!env) + pEnvBlock = NULL; + else { + apr_size_t iEnvBlockLen; /* * Win32's CreateProcess call requires that the environment * be passed in an environment block, a null terminated block of @@ -417,58 +372,139 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, iEnvBlockLen += strlen(env[i]) + 1; i++; } - - pEnvBlock = (char *)apr_pcalloc(cont, iEnvBlockLen + strlen(envstr)); + if (!i) + ++iEnvBlockLen; + +#if APR_HAS_UNICODE_FS + if (os_level >= APR_WIN_NT) { + apr_wchar_t *pNext; + pEnvBlock = (char *)apr_palloc(cont, iEnvBlockLen * 2); + dwCreationFlags |= CREATE_UNICODE_ENVIRONMENT; + + i = 0; + pNext = (apr_wchar_t*)pEnvBlock; + while (env[i]) { + apr_size_t in = strlen(env[i]) + 1; + if ((rv = conv_utf8_to_ucs2(env[i], &in, + pNext, &iEnvBlockLen)) + != APR_SUCCESS) { + return rv; + } + pNext = wcschr(pNext, L'\0') + 1; + i++; + } + if (!i) + *(pNext++) = L'\0'; + *pNext = L'\0'; + } + else +#endif /* APR_HAS_UNICODE_FS */ + { + char *pNext; + pEnvBlock = (char *)apr_palloc(cont, iEnvBlockLen); - i = 0; - pNext = pEnvBlock; - while (env[i]) { - strcpy(pNext, env[i]); - pNext = pNext + strlen(pNext) + 1; - i++; + i = 0; + pNext = pEnvBlock; + while (env[i]) { + strcpy(pNext, env[i]); + pNext = strchr(pNext, '\0') + 1; + i++; + } + if (!i) + *(pNext++) = '\0'; + *pNext = '\0'; } - strcpy(pNext, envstr); - pNext = pNext + strlen(pNext) + 1; - *pNext = '\0'; - } - else { - SetEnvironmentVariable("parentpid", ppid); - pEnvBlock = NULL; } - - if (CreateProcess(NULL, cmdline, /* Command line */ - NULL, NULL, /* Proc & thread security attributes */ - TRUE, /* Inherit handles */ - dwCreationFlags, /* Creation flags */ - pEnvBlock, /* Environment block */ - attr->currdir, /* Current directory name */ - &attr->si, &pi)) { - - // TODO: THIS IS BADNESS - // The completion of the apr_proc_t type leaves us ill equiped to track both - // the pid (Process ID) and handle to the process, which are entirely - // different things and each useful in their own rights. - // - // Signals are broken since the hProcess varies from process to process, - // while the true process ID would not. - new->pid = (pid_t) pi.hProcess; - - if (attr->child_in) { - apr_file_close(attr->child_in); +#if APR_HAS_UNICODE_FS + if (os_level >= APR_WIN_NT) + { + STARTUPINFOW si; + apr_size_t nprg = strlen(progname) + 1; + apr_size_t ncmd = strlen(cmdline) + 1, nwcmd = ncmd; + apr_size_t ncwd = strlen(attr->currdir) + 1, nwcwd = ncwd; + apr_wchar_t *wprg = apr_palloc(cont, nprg * 2); + apr_wchar_t *wcmd = apr_palloc(cont, ncmd * 2); + apr_wchar_t *wcwd = apr_palloc(cont, ncwd * 2); + + if (((rv = utf8_to_unicode_path(wprg, &nprg, progname)) + != APR_SUCCESS) + || ((rv = conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd)) + != APR_SUCCESS) + || ((rv = conv_utf8_to_ucs2(attr->currdir, &ncwd, wcwd, &nwcwd)) + != APR_SUCCESS)) { + return rv; + } + + memset(&si, 0, sizeof(si)); + si.cb = sizeof(si); + if (attr->detached) { + si.dwFlags |= STARTF_USESHOWWINDOW; + si.wShowWindow = SW_HIDE; } - if (attr->child_out) { - apr_file_close(attr->child_out); + if (attr->child_in->filehand || attr->child_out->filehand + || attr->child_err->filehand) { + si.dwFlags |= STARTF_USESTDHANDLES; + si.hStdInput = attr->child_in->filehand; + si.hStdOutput = attr->child_out->filehand; + si.hStdError = attr->child_err->filehand; } - if (attr->child_err) { - apr_file_close(attr->child_err); + rv = CreateProcessW(wprg, wcmd, /* Command line */ + NULL, NULL, /* Proc & thread security attributes */ + TRUE, /* Inherit handles */ + dwCreationFlags, /* Creation flags */ + pEnvBlock, /* Environment block */ + wcwd, /* Current directory name */ + &si, &pi); + } + else { +#endif /* APR_HAS_UNICODE_FS */ + STARTUPINFOA si; + memset(&si, 0, sizeof(si)); + si.cb = sizeof(si); + if (attr->detached) { + si.dwFlags |= STARTF_USESHOWWINDOW; + si.wShowWindow = SW_HIDE; + } + if (attr->child_in->filehand || attr->child_out->filehand + || attr->child_err->filehand) { + si.dwFlags |= STARTF_USESTDHANDLES; + si.hStdInput = attr->child_in->filehand; + si.hStdOutput = attr->child_out->filehand; + si.hStdError = attr->child_err->filehand; } - CloseHandle(pi.hThread); - return APR_SUCCESS; + rv = CreateProcessA(progname, cmdline, /* Command line */ + NULL, NULL, /* Proc & thread security attributes */ + TRUE, /* Inherit handles */ + dwCreationFlags, /* Creation flags */ + pEnvBlock, /* Environment block */ + attr->currdir, /* Current directory name */ + &si, &pi); } - return apr_get_os_error(); + /* Check CreateProcess result + */ + if (!rv) + return apr_get_os_error(); + + /* XXX Orphaned handle warning - no fix due to broken apr_proc_t api. + */ + new->hproc = pi.hProcess; + new->pid = pi.dwProcessId; + + if (attr->child_in) { + apr_file_close(attr->child_in); + } + if (attr->child_out) { + apr_file_close(attr->child_out); + } + if (attr->child_err) { + apr_file_close(attr->child_err); + } + CloseHandle(pi.hThread); + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, apr_wait_how_e wait) @@ -477,21 +513,24 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, apr_wait_how_e wait) if (!proc) return APR_ENOPROC; if (wait == APR_WAIT) { - if ((stat = WaitForSingleObject((HANDLE)proc->pid, + if ((stat = WaitForSingleObject(proc->hproc, INFINITE)) == WAIT_OBJECT_0) { + CloseHandle(proc->hproc); + proc->hproc = NULL; return APR_CHILD_DONE; } else if (stat == WAIT_TIMEOUT) { return APR_CHILD_NOTDONE; } - return GetLastError(); + return apr_get_os_error(); } - if ((stat = WaitForSingleObject((HANDLE)proc->pid, 0)) == WAIT_OBJECT_0) { + if ((stat = WaitForSingleObject((HANDLE)proc->hproc, 0)) == WAIT_OBJECT_0) { + CloseHandle(proc->hproc); + proc->hproc = NULL; return APR_CHILD_DONE; } else if (stat == WAIT_TIMEOUT) { return APR_CHILD_NOTDONE; } - return GetLastError(); + return apr_get_os_error(); } - diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 308a59c51ca..ff0f941b80b 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -66,7 +66,7 @@ /* Windows only really support killing process, but that will do for now. */ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signal) { - if (TerminateProcess((HANDLE)proc->pid, signal) == 0) { + if (TerminateProcess((HANDLE)proc->hproc, signal) == 0) { return apr_get_os_error(); } return APR_SUCCESS; From c5461c38784ce80b34cde7cf83040743f48ba8dc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 9 Sep 2001 06:04:40 +0000 Subject: [PATCH 2298/7878] Undo comments lost in my update (!?!) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62297 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 1fc9774ebd4..2406bb24d46 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,5 @@ Changes with APR b1 - + *) Fix the API for the apr_proc_create() call on Win32. Several bad assumptions are gone, including a mismatch between unix and win32, where win32 was defaulting to create detached. Also fixes @@ -14,6 +14,12 @@ Changes with APR b1 others (and it mirrors some of the other apr_filepath_*() calls.) [William Rowe] + *) Add the new thread read/write lock API to APR. + [Aaron Bannert ] + + *) Add the new thread mutex lock API to APR. + [Aaron Bannert ] + *) Cache GMT offset on platforms that don't store it in the tm struct. This offset is normalized to be independent of daylight savings time. [Brian Pane ] From f14e7955587be112f2b486f3d3d152deaad37f83 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 9 Sep 2001 06:16:29 +0000 Subject: [PATCH 2299/7878] My bad - this was correct (APR_FILE_MAX, I read it as APR_PATH_MAX.) But it really isn't, the max filename (element) length is dependent on the filesystem itself. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62298 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/fileio.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 70ae740300c..ece1c397f6a 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -108,12 +108,9 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* dststr, apr_size_t dstchars, apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, const apr_wchar_t* srcstr); -/* XXX: ONE OF THESE IS WRONG, WHO CHANGED IT? - */ -#define APR_FILE_MAX MAX_PATH -#else /* !APR_HAS_UNICODE_FS */ +#endif /* APR_HAS_UNICODE_FS */ + #define APR_FILE_MAX MAX_PATH -#endif #define APR_FILE_BUFSIZE 4096 From 6a7ba0254f748d5bb6aafeda19d6f06012b9af57 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sun, 9 Sep 2001 16:04:59 +0000 Subject: [PATCH 2300/7878] fix breakage caused by last update git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62299 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index be4dd3b19ea..d11350719e2 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -171,7 +171,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * passing the address of a char const* for a char** arg. */ char *getpath; - rv = apr_filepath_get(&getpath, apr_int32_t flags, p); + rv = apr_filepath_get(&getpath, flags, p); rootpath = getpath; if (rv != APR_SUCCESS) return errno; From c83acc69021055ebfbf31241b9b8cf5b12e93548 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 10 Sep 2001 15:47:25 +0000 Subject: [PATCH 2301/7878] This test attempts to asses the performance characterists of various mutex strategies we use in APR. It resembles a test from W. Richard Stevens in his _UNIX Network Programming: Interprocess Communications_ Vol 2, Second Ed., Appendix A. In these tests a number of threads are created, and each thread iterates MAX_COUNTER times (currently 1 million). In each iteration through this loop, the thread will lock a mutex, increment a counter, and unlock. The total time taken (in usec) is then printed. I have some more optimizations that will be tested for efficacy using this test. Submitted by: Aaron Bannert Reviewed by: IanH@apache.org git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62300 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 2 + test/Makefile.in | 4 + test/testlockperf.c | 408 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 414 insertions(+) create mode 100644 test/testlockperf.c diff --git a/test/.cvsignore b/test/.cvsignore index dfbf89a9518..72eeeed7c4a 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -1,5 +1,6 @@ Makefile *.lo +*.swp .libs testmd5 testmmap @@ -41,6 +42,7 @@ testnames *.dbg testmem testlock +testlockperf *.core testsockets testuser diff --git a/test/Makefile.in b/test/Makefile.in index 3e97ad5e3a2..cbdb9dda534 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -11,6 +11,7 @@ PROGRAMS = \ testsock@EXEEXT@ \ testthread@EXEEXT@ \ testlock@EXEEXT@ \ + testlockperf@EXEEXT@ \ testtime@EXEEXT@ \ testargs@EXEEXT@ \ testud@EXEEXT@ \ @@ -83,6 +84,9 @@ testthread@EXEEXT@: testthread.lo $(LOCAL_LIBS) testlock@EXEEXT@: testlock.lo $(LOCAL_LIBS) $(LINK) testlock.lo $(LOCAL_LIBS) $(ALL_LIBS) +testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS) + $(LINK) testlockperf.lo $(LOCAL_LIBS) $(ALL_LIBS) + testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ $(LOCAL_LIBS) $(LINK) testsock.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/testlockperf.c b/test/testlockperf.c new file mode 100644 index 00000000000..a008fd0d498 --- /dev/null +++ b/test/testlockperf.c @@ -0,0 +1,408 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_thread_proc.h" +#include "apr_thread_mutex.h" +#include "apr_thread_rwlock.h" +#include "apr_file_io.h" +#include "apr_lock.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_getopt.h" +#include "errno.h" +#include +#include +#include "test_apr.h" +#include /* replace me with apr_time.h */ + +#if !APR_HAS_THREADS +int main(void) +{ + printf("This program won't work on this platform because there is no " + "support for threads.\n"); + return 0; +} +#else /* !APR_HAS_THREADS */ + +#define MAX_COUNTER 1000000 +#define MAX_ITER 40000 + +static long mutex_counter; + +static apr_lock_t *inter_lock; +static apr_thread_mutex_t *thread_lock; +void * APR_THREAD_FUNC inter_mutex_func(apr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_mutex_func(apr_thread_t *thd, void *data); +apr_status_t test_inter_mutex(void); /* apr_lock_t -- INTRAPROCESS */ +apr_status_t test_thread_mutex(void); /* apr_thread_mutex_t */ + +static apr_lock_t *inter_rwlock; +static apr_thread_rwlock_t *thread_rwlock; +void * APR_THREAD_FUNC inter_rwlock_func(apr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data); +apr_status_t test_inter_rwlock(void); /* apr_lock_t -- READWRITE */ +apr_status_t test_thread_rwlock(void); /* apr_thread_rwlock_t */ + +apr_pool_t *pool; +int i = 0, x = 0; + +void * APR_THREAD_FUNC inter_mutex_func(apr_thread_t *thd, void *data) +{ + int i; + + for (i = 0; i < MAX_COUNTER; i++) { + apr_lock_acquire(inter_lock); + mutex_counter++; + apr_lock_release(inter_lock); + } + return NULL; +} + +void * APR_THREAD_FUNC thread_mutex_func(apr_thread_t *thd, void *data) +{ + int i; + + for (i = 0; i < MAX_COUNTER; i++) { + apr_thread_mutex_lock(thread_lock); + mutex_counter++; + apr_thread_mutex_unlock(thread_lock); + } + return NULL; +} + +void * APR_THREAD_FUNC inter_rwlock_func(apr_thread_t *thd, void *data) +{ + int i; + + for (i = 0; i < MAX_COUNTER; i++) { + apr_lock_acquire_rw(inter_rwlock, APR_WRITER); + mutex_counter++; + apr_lock_release(inter_rwlock); + } + return NULL; +} + +void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data) +{ + int i; + + for (i = 0; i < MAX_COUNTER; i++) { + apr_thread_rwlock_wrlock(thread_rwlock); + mutex_counter++; + apr_thread_rwlock_unlock(thread_rwlock); + } + return NULL; +} + +int test_inter_mutex(void) +{ + apr_thread_t *t1, *t2, *t3, *t4; + apr_status_t s1, s2, s3, s4; + apr_time_t time_start, time_stop; + + mutex_counter = 0; + + printf("apr_lock(INTRAPROCESS, MUTEX) Lock Tests\n"); + printf("%-60s", " Initializing the apr_lock_t"); + s1 = apr_lock_create(&inter_lock, APR_MUTEX, APR_INTRAPROCESS, + "lock.file", pool); + if (s1 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + apr_lock_acquire(inter_lock); + /* set_concurrency(4)? -aaron */ + printf("%-60s"," Starting all the threads"); + s1 = apr_thread_create(&t1, NULL, inter_mutex_func, NULL, pool); + s2 = apr_thread_create(&t2, NULL, inter_mutex_func, NULL, pool); + s3 = apr_thread_create(&t3, NULL, inter_mutex_func, NULL, pool); + s4 = apr_thread_create(&t4, NULL, inter_mutex_func, NULL, pool); + if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || + s3 != APR_SUCCESS || s4 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + time_start = apr_time_now(); + apr_lock_release(inter_lock); + + /* printf("%-60s", " Waiting for threads to exit"); */ + apr_thread_join(&s1, t1); + apr_thread_join(&s2, t2); + apr_thread_join(&s3, t3); + apr_thread_join(&s4, t4); + /* printf("OK\n"); */ + + time_stop = apr_time_now(); + printf("microseconds: %" APR_INT64_T_FMT " usec\n", + (time_stop - time_start)); + if (mutex_counter != MAX_COUNTER * 4) + printf("error: counter = %ld\n", mutex_counter); + + return APR_SUCCESS; +} + +int test_thread_mutex(void) +{ + apr_thread_t *t1, *t2, *t3, *t4; + apr_status_t s1, s2, s3, s4; + apr_time_t time_start, time_stop; + + mutex_counter = 0; + + printf("apr_thread_mutex_t Tests\n"); + printf("%-60s", " Initializing the apr_thread_mutex_t"); + s1 = apr_thread_mutex_create(&thread_lock, pool); + if (s1 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + apr_thread_mutex_lock(thread_lock); + /* set_concurrency(4)? -aaron */ + printf("%-60s"," Starting all the threads"); + s1 = apr_thread_create(&t1, NULL, thread_mutex_func, NULL, pool); + s2 = apr_thread_create(&t2, NULL, thread_mutex_func, NULL, pool); + s3 = apr_thread_create(&t3, NULL, thread_mutex_func, NULL, pool); + s4 = apr_thread_create(&t4, NULL, thread_mutex_func, NULL, pool); + if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || + s3 != APR_SUCCESS || s4 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + time_start = apr_time_now(); + apr_thread_mutex_unlock(thread_lock); + + /* printf("%-60s", " Waiting for threads to exit"); */ + apr_thread_join(&s1, t1); + apr_thread_join(&s2, t2); + apr_thread_join(&s3, t3); + apr_thread_join(&s4, t4); + /* printf("OK\n"); */ + + time_stop = apr_time_now(); + printf("microseconds: %" APR_INT64_T_FMT " usec\n", + (time_stop - time_start)); + if (mutex_counter != MAX_COUNTER * 4) + printf("error: counter = %ld\n", mutex_counter); + + return APR_SUCCESS; +} + +int test_inter_rwlock(void) +{ + apr_thread_t *t1, *t2, *t3, *t4; + apr_status_t s1, s2, s3, s4; + apr_time_t time_start, time_stop; + + mutex_counter = 0; + + printf("apr_lock(INTRAPROCESS, READWRITE) Lock Tests\n"); + printf("%-60s", " Initializing the apr_lock_t"); + s1 = apr_lock_create(&inter_rwlock, APR_READWRITE, APR_INTRAPROCESS, + "lock.file", pool); + if (s1 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + apr_lock_acquire_rw(inter_rwlock, APR_WRITER); + /* set_concurrency(4)? -aaron */ + s1 = apr_thread_create(&t1, NULL, inter_rwlock_func, NULL, pool); + s2 = apr_thread_create(&t2, NULL, inter_rwlock_func, NULL, pool); + s3 = apr_thread_create(&t3, NULL, inter_rwlock_func, NULL, pool); + s4 = apr_thread_create(&t4, NULL, inter_rwlock_func, NULL, pool); + if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || + s3 != APR_SUCCESS || s4 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + + time_start = apr_time_now(); + apr_lock_release(inter_rwlock); + + /* printf("%-60s", " Waiting for threads to exit"); */ + apr_thread_join(&s1, t1); + apr_thread_join(&s2, t2); + apr_thread_join(&s3, t3); + apr_thread_join(&s4, t4); + /* printf("OK\n"); */ + + time_stop = apr_time_now(); + printf("microseconds: %" APR_INT64_T_FMT " usec\n", + (time_stop - time_start)); + if (mutex_counter != MAX_COUNTER * 4) + printf("error: counter = %ld\n", mutex_counter); + + return APR_SUCCESS; +} + +int test_thread_rwlock(void) +{ + apr_thread_t *t1, *t2, *t3, *t4; + apr_status_t s1, s2, s3, s4; + apr_time_t time_start, time_stop; + + mutex_counter = 0; + + printf("apr_thread_mutex_t Tests\n"); + printf("%-60s", " Initializing the apr_thread_mutex_t"); + s1 = apr_thread_rwlock_create(&thread_rwlock, pool); + if (s1 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + apr_thread_rwlock_wrlock(thread_rwlock); + /* set_concurrency(4)? -aaron */ + s1 = apr_thread_create(&t1, NULL, thread_rwlock_func, NULL, pool); + s2 = apr_thread_create(&t2, NULL, thread_rwlock_func, NULL, pool); + s3 = apr_thread_create(&t3, NULL, thread_rwlock_func, NULL, pool); + s4 = apr_thread_create(&t4, NULL, thread_rwlock_func, NULL, pool); + if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || + s3 != APR_SUCCESS || s4 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + + time_start = apr_time_now(); + apr_thread_rwlock_unlock(thread_rwlock); + + /* printf("%-60s", " Waiting for threads to exit"); */ + apr_thread_join(&s1, t1); + apr_thread_join(&s2, t2); + apr_thread_join(&s3, t3); + apr_thread_join(&s4, t4); + /* printf("OK\n"); */ + + time_stop = apr_time_now(); + printf("microseconds: %" APR_INT64_T_FMT " usec\n", + (time_stop - time_start)); + if (mutex_counter != MAX_COUNTER * 4) + printf("error: counter = %ld\n", mutex_counter); + + return APR_SUCCESS; +} + +int main(int argc, const char * const *argv) +{ + apr_status_t rv; + char errmsg[200]; + const char *lockname = "multi.lock"; + apr_getopt_t *opt; + char optchar; + const char *optarg; + + printf("APR Lock Performance Test\n==============\n\n"); + + apr_initialize(); + atexit(apr_terminate); + + if (apr_pool_create(&pool, NULL) != APR_SUCCESS) + exit(-1); + + if ((rv = apr_getopt_init(&opt, pool, argc, argv)) != APR_SUCCESS) { + fprintf(stderr, "Could not set up to parse options: [%d] %s\n", + rv, apr_strerror(rv, errmsg, sizeof errmsg)); + exit(-1); + } + + while ((rv = apr_getopt(opt, "f:", &optchar, &optarg)) == APR_SUCCESS) { + if (optchar == 'f') { + lockname = optarg; + } + } + + if (rv != APR_SUCCESS && rv != APR_EOF) { + fprintf(stderr, "Could not parse options: [%d] %s\n", + rv, apr_strerror(rv, errmsg, sizeof errmsg)); + exit(-1); + } + + if ((rv = test_inter_mutex()) != APR_SUCCESS) { + fprintf(stderr,"apr_lock(INTRAPROCESS, MUTEX) test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-2); + } + + if ((rv = test_thread_mutex()) != APR_SUCCESS) { + fprintf(stderr,"thread_mutex test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-3); + } + + if ((rv = test_inter_rwlock()) != APR_SUCCESS) { + fprintf(stderr,"apr_lock(INTRAPROCESS, READWRITE) test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-2); + } + + if ((rv = test_thread_rwlock()) != APR_SUCCESS) { + fprintf(stderr,"thread_rwlock test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-3); + } + + return 0; +} + +#endif /* !APR_HAS_THREADS */ From 5f1350b171112ea141a0af15dab67eeff327bf73 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 10 Sep 2001 18:17:07 +0000 Subject: [PATCH 2302/7878] Update the testlock program, to use the new locking API as well as the old one. This allows people porting platforms to the new API to easily determine when they get it right. Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62301 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 163 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) diff --git a/test/testlock.c b/test/testlock.c index 6d4f59dcfeb..522743e0ffa 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -55,6 +55,8 @@ #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_lock.h" +#include "apr_thread_mutex.h" +#include "apr_thread_rwlock.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_getopt.h" @@ -75,7 +77,9 @@ int main(void) #define MAX_ITER 40000 void * APR_THREAD_FUNC thread_rw_func(apr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_function(apr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data); apr_status_t test_exclusive(void); apr_status_t test_rw(void); apr_status_t test_multiple_locking(const char *); @@ -83,6 +87,8 @@ apr_status_t test_multiple_locking(const char *); apr_file_t *in, *out, *err; apr_lock_t *thread_rw_lock, *thread_lock; +apr_thread_mutex_t *thread_mutex; +apr_thread_rwlock_t *rwlock; apr_pool_t *pool; int i = 0, x = 0; @@ -111,6 +117,31 @@ void * APR_THREAD_FUNC thread_rw_func(apr_thread_t *thd, void *data) return NULL; } +void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data) +{ + int exitLoop = 1; + + while (1) + { + apr_thread_rwlock_rdlock(rwlock); + if (i == MAX_ITER) + exitLoop = 0; + apr_thread_rwlock_unlock(rwlock); + + if (!exitLoop) + break; + + apr_thread_rwlock_wrlock(rwlock); + if (i != MAX_ITER) + { + i++; + x++; + } + apr_thread_rwlock_unlock(rwlock); + } + return NULL; +} + void * APR_THREAD_FUNC thread_function(apr_thread_t *thd, void *data) { int exitLoop = 1; @@ -136,6 +167,31 @@ void * APR_THREAD_FUNC thread_function(apr_thread_t *thd, void *data) return NULL; } +void * APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data) +{ + int exitLoop = 1; + + /* slight delay to allow things to settle */ + apr_sleep (1); + + while (1) + { + apr_thread_mutex_lock(thread_mutex); + if (i == MAX_ITER) + exitLoop = 0; + else + { + i++; + x++; + } + apr_thread_mutex_unlock(thread_mutex); + + if (!exitLoop) + break; + } + return NULL; +} + int test_rw(void) { apr_thread_t *t1, *t2, *t3, *t4; @@ -278,6 +334,101 @@ apr_status_t test_multiple_locking(const char *lockfile) return APR_SUCCESS; } +apr_status_t test_thread_mutex(void) +{ + apr_thread_t *t1, *t2, *t3, *t4; + apr_status_t s1, s2, s3, s4; + + printf("thread_mutex test\n"); + printf("%-60s", " Initializing the mutex"); + s1 = apr_thread_mutex_create(&thread_mutex, pool); + + if (s1 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + i = 0; + x = 0; + + printf("%-60s", " Starting all the threads"); + s1 = apr_thread_create(&t1, NULL, thread_mutex_function, NULL, pool); + s2 = apr_thread_create(&t2, NULL, thread_mutex_function, NULL, pool); + s3 = apr_thread_create(&t3, NULL, thread_mutex_function, NULL, pool); + s4 = apr_thread_create(&t4, NULL, thread_mutex_function, NULL, pool); + if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || + s3 != APR_SUCCESS || s4 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + printf("%-60s", " Waiting for threads to exit"); + apr_thread_join(&s1, t1); + apr_thread_join(&s2, t2); + apr_thread_join(&s3, t3); + apr_thread_join(&s4, t4); + printf("OK\n"); + + if (x != MAX_ITER) { + fprintf(stderr, "pthread_mutex don't appear to work!" + " x = %d instead of %d\n", + x, MAX_ITER); + } + else { + printf("Test passed\n"); + } + return APR_SUCCESS; +} + +int test_thread_rwlock(void) +{ + apr_thread_t *t1, *t2, *t3, *t4; + apr_status_t s1, s2, s3, s4; + + printf("thread_rwlock Tests\n"); + printf("%-60s", " Initializing the apr_thread_rwlock_t"); + s1 = apr_thread_rwlock_create(&rwlock, pool); + if (s1 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + i = 0; + x = 0; + + printf("%-60s"," Starting all the threads"); + s1 = apr_thread_create(&t1, NULL, thread_rwlock_func, NULL, pool); + s2 = apr_thread_create(&t2, NULL, thread_rwlock_func, NULL, pool); + s3 = apr_thread_create(&t3, NULL, thread_rwlock_func, NULL, pool); + s4 = apr_thread_create(&t4, NULL, thread_rwlock_func, NULL, pool); + if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || + s3 != APR_SUCCESS || s4 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + printf("%-60s", " Waiting for threads to exit"); + apr_thread_join(&s1, t1); + apr_thread_join(&s2, t2); + apr_thread_join(&s3, t3); + apr_thread_join(&s4, t4); + printf("OK\n"); + + if (x != MAX_ITER) { + fprintf(stderr, "thread_rwlock didn't work as expected. x = %d instead of %d\n", + x, MAX_ITER); + } + else { + printf("Test passed\n"); + } + + return APR_SUCCESS; +} + int main(int argc, const char * const *argv) { apr_status_t rv; @@ -331,6 +482,18 @@ int main(int argc, const char * const *argv) exit(-4); } + if ((rv = test_thread_mutex()) != APR_SUCCESS) { + fprintf(stderr,"thread_mutex test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-5); + } + + if ((rv = test_thread_rwlock()) != APR_SUCCESS) { + fprintf(stderr,"thread_rwlock test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-6); + } + return 0; } From 10ab0ef7d2ca38ca55a774c732f3ed1cef993b59 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Mon, 10 Sep 2001 19:05:59 +0000 Subject: [PATCH 2303/7878] Fix typo in comment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62302 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/fileio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index ece1c397f6a..ddde31140d4 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -240,7 +240,7 @@ apr_status_t filepath_root_test(char *path, apr_pool_t *p); /* The apr_filepath_merge wants to canonicalize the cwd to the * addpath if the user passes NULL as the old root path (this - * isn't true of an empty string "", which won't be concatinated. + * isn't true of an empty string "", which won't be concatenated. * * But we need to figure out what the cwd of a given volume is, * when the user passes D:foo. This fn will determine D:'s cwd. From f8b68bedd2ce37d362400bfc233c1e7902302cf6 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Mon, 10 Sep 2001 19:08:35 +0000 Subject: [PATCH 2304/7878] (apr_filepath_merge): Pass the APR_FILEPATH_NATIVE flag to apr_filepath_root if it's set in flags. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62303 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 8178757fe2d..f48ecbcc3ea 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -358,7 +358,9 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* This call _should_ test the path */ addtype = apr_filepath_root(&addroot, &addpath, - APR_FILEPATH_TRUENAME, p); + APR_FILEPATH_TRUENAME + | (flags & APR_FILEPATH_NATIVE), + p); if (addtype == APR_SUCCESS) { addtype = APR_EABSOLUTE; } @@ -430,7 +432,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, if (!baseroot) { /* This call should _not_ test the path */ - basetype = apr_filepath_root(&baseroot, &basepath, 0, p); + basetype = apr_filepath_root(&baseroot, &basepath, + (flags & APR_FILEPATH_NATIVE), p); if (basetype == APR_SUCCESS) { basetype = APR_EABSOLUTE; } @@ -745,7 +748,9 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* This call _should_ test the path */ testtype = apr_filepath_root(&testroot, &testpath, - APR_FILEPATH_TRUENAME, p); + APR_FILEPATH_TRUENAME + | (flags & APR_FILEPATH_NATIVE), + p); if (testtype == APR_SUCCESS) { rootlen = pathlen = (testpath - path); memcpy(path, testroot, pathlen); From 342aa125ba2611da8e3febb40f1e02a1bb403b75 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Mon, 10 Sep 2001 19:45:05 +0000 Subject: [PATCH 2305/7878] (apr_proc_create): Fix bug in conversion of program name to Unicode on WinNT: utf8_to_unicode_path needs more space than just the program length. Use a fixed-size buffer for the program name, like everywhere else. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62304 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 542490c68ab..04a2b9cc700 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -420,14 +420,14 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (os_level >= APR_WIN_NT) { STARTUPINFOW si; - apr_size_t nprg = strlen(progname) + 1; + apr_wchar_t wprg[APR_PATH_MAX]; apr_size_t ncmd = strlen(cmdline) + 1, nwcmd = ncmd; apr_size_t ncwd = strlen(attr->currdir) + 1, nwcwd = ncwd; - apr_wchar_t *wprg = apr_palloc(cont, nprg * 2); apr_wchar_t *wcmd = apr_palloc(cont, ncmd * 2); apr_wchar_t *wcwd = apr_palloc(cont, ncwd * 2); - if (((rv = utf8_to_unicode_path(wprg, &nprg, progname)) + if (((rv = utf8_to_unicode_path(wprg, sizeof(wprg)/sizeof(wprg[0]), + progname)) != APR_SUCCESS) || ((rv = conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd)) != APR_SUCCESS) From 09cdca20d77598578d0acb1ab6df73e72f8a4b96 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 10 Sep 2001 22:39:37 +0000 Subject: [PATCH 2306/7878] Added thread_name to the apr_threadattr_t for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62305 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/threadproc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/arch/netware/threadproc.h b/include/arch/netware/threadproc.h index 94355a7722d..451111e66cf 100644 --- a/include/arch/netware/threadproc.h +++ b/include/arch/netware/threadproc.h @@ -73,6 +73,7 @@ struct apr_threadattr_t { apr_pool_t *cntxt; size_t stack_size; apr_int32_t detach; + char *thread_name; }; struct apr_threadkey_t { From d44b93fda49ad3a228b41125f9d8354e1a37f0ae Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 10 Sep 2001 22:42:22 +0000 Subject: [PATCH 2307/7878] Updated to generate a thread name if one is not specified and to default to either the system stack size or the APR default stack size if one is not specified git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62306 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/thread.c | 41 +++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 70909b0b7be..96b918c63b7 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -54,8 +54,10 @@ #include "apr.h" #include "apr_portable.h" +#include "apr_strings.h" #include "threadproc.h" +static int thread_count = 0; apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) @@ -68,6 +70,9 @@ apr_status_t apr_threadattr_create(apr_threadattr_t **new, } (*new)->cntxt = cont; + (*new)->stack_size = APR_DEFAULT_STACK_SIZE; + (*new)->detach = 0; + (*new)->thread_name = NULL; return APR_SUCCESS; } @@ -91,12 +96,27 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_pool_t *cont) { apr_status_t stat; - size_t stacksize; long flags = NX_THR_BIND_CONTEXT; char threadName[NX_MAX_OBJECT_NAME_LEN+1]; - //srj added for nks giving the threads names - - sprintf(threadName, "Apache-2.0 %003ld",data); + + if (!attr) + return APR_EINVAL; + + if (!attr->thread_name) { + char threadName[32]; + + sprintf(threadName, "APR_thread %0004ld", ++thread_count); + attr->thread_name = apr_pstrdup(cont, threadName); + } + + /* An original stack size of 0 will allow NXCreateThread() to + * assign a default system stack size. An original stack + * size of less than 0 will assign the APR default stack size. + * anything else will be taken as is. + */ + if (attr->stack_size < 0) { + attr->stack_size = APR_DEFAULT_STACK_SIZE; + } (*new) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); @@ -111,27 +131,22 @@ apr_status_t apr_thread_create(apr_thread_t **new, return stat; } - if (attr) { - stacksize = attr->stack_size; - if (attr->detach) - flags |= NX_THR_DETACHED; - } - else { - stacksize = APR_DEFAULT_STACK_SIZE; + if (attr && attr->detach) { + flags |= NX_THR_DETACHED; } (*new)->ctx = NXContextAlloc( /* void(*start_routine)(void *arg)*/(void (*)(void *)) func, /* void *arg */ data, /* int priority */ NX_PRIO_MED, - /* NXSize_t stackSize */ stacksize, + /* NXSize_t stackSize */ attr->stack_size, /* long flags */ NX_CTX_NORMAL, /* int *error */ &stat); stat = NXContextSetName( /* NXContext_t ctx */ (*new)->ctx, - /* const char *name */ threadName); + /* const char *name */ attr->thread_name); stat = NXThreadCreate( /* NXContext_t context */ (*new)->ctx, From dd05b4460f77ecdb349e7ea1545411914f10d036 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 10 Sep 2001 22:53:59 +0000 Subject: [PATCH 2308/7878] Add the new thread_mutex API to the Windows build. This works on my Windows box, but I am using MSVC 7, so my computer doesn't use project files anymore. The C code is good, but somebody may have to hack the project files to make it all compile. This passes the first half of the testlock test. The second half is for read/write locks, which I will be implementing next. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62307 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 24 ++++++++++++++++++++++++ include/arch/win32/thread_mutex.h | 1 + locks/win32/thread_mutex.c | 30 +++++++++++++++++++++++------- test/aprtest.dsp | 4 ++++ 4 files changed, 52 insertions(+), 7 deletions(-) diff --git a/apr.dsp b/apr.dsp index 54097a78f0e..0f75233609a 100644 --- a/apr.dsp +++ b/apr.dsp @@ -165,6 +165,14 @@ SOURCE=.\i18n\unix\xlate.c SOURCE=.\locks\win32\locks.c # End Source File # End Group + +SOURCE=.\locks\win32\thread_mutex.c +# End Source File +# End Group + +SOURCE=.\locks\win32\thread_rwlock.c +# End Source File +# End Group # Begin Group "memory" # PROP Default_Filter "" @@ -429,6 +437,14 @@ SOURCE=.\include\arch\win32\networkio.h # End Source File # Begin Source File +SOURCE=.\include\arch\win32\thread_mutex.h +# End Source File +# End Group + +SOURCE=.\include\arch\win32\thread_rwlock.h +# End Source File +# End Group + SOURCE=.\include\arch\win32\threadproc.h # End Source File # End Group @@ -563,10 +579,18 @@ SOURCE=.\include\apr_tables.h # End Source File # Begin Source File +SOURCE=.\include\apr_thread_mutex.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_thread_proc.h # End Source File # Begin Source File +SOURCE=.\include\apr_thread_rwlock.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_time.h # End Source File # Begin Source File diff --git a/include/arch/win32/thread_mutex.h b/include/arch/win32/thread_mutex.h index ee7a0ecccec..7233b49daee 100644 --- a/include/arch/win32/thread_mutex.h +++ b/include/arch/win32/thread_mutex.h @@ -59,6 +59,7 @@ struct apr_thread_mutex_t { apr_pool_t *pool; + CRITICAL_SECTION section; }; #endif /* THREAD_MUTEX_H */ diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 3e888509a14..972c464ec82 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -56,23 +56,39 @@ #include "apr_private.h" #include "apr_general.h" #include "apr_strings.h" -#include "win32/thread_mutex.h" +#include "thread_mutex.h" +#include "apr_thread_mutex.h" #include "apr_portable.h" static apr_status_t thread_mutex_cleanup(void *data) { - return APR_ENOTIMPL; + apr_thread_mutex_t *lock = data; + + DeleteCriticalSection(&lock->section); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, apr_pool_t *pool) { - return APR_ENOTIMPL; + SECURITY_ATTRIBUTES sec; + (*mutex) = (apr_thread_mutex_t *)apr_palloc(pool, sizeof(**mutex)); + + (*mutex)->pool = pool; + sec.nLength = sizeof(SECURITY_ATTRIBUTES); + sec.lpSecurityDescriptor = NULL; + sec.bInheritHandle = FALSE; + + InitializeCriticalSection(&(*mutex)->section); + apr_pool_cleanup_register((*mutex)->pool, (*mutex), thread_mutex_cleanup, + apr_pool_cleanup_null); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + EnterCriticalSection(&mutex->section); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) @@ -82,11 +98,11 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + LeaveCriticalSection(&mutex->section); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + return apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup); } - diff --git a/test/aprtest.dsp b/test/aprtest.dsp index 771a3b76b5d..f021de26ebd 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -124,6 +124,10 @@ SOURCE=.\testflock.c # End Source File # Begin Source File +SOURCE=.\testlock.c +# End Source File +# Begin Source File + SOURCE=.\testmmap.c # End Source File # Begin Source File From dac7266eace154b53b342071ad06ab2d7d0838e8 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Tue, 11 Sep 2001 00:38:50 +0000 Subject: [PATCH 2309/7878] (apr_proc_create): Sigh. Process attributes can remain undefined. Don't dereference pointers without checking. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62308 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 42 +++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 04a2b9cc700..3920d883364 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -422,16 +422,23 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, STARTUPINFOW si; apr_wchar_t wprg[APR_PATH_MAX]; apr_size_t ncmd = strlen(cmdline) + 1, nwcmd = ncmd; - apr_size_t ncwd = strlen(attr->currdir) + 1, nwcwd = ncwd; - apr_wchar_t *wcmd = apr_palloc(cont, ncmd * 2); - apr_wchar_t *wcwd = apr_palloc(cont, ncwd * 2); + apr_size_t ncwd = 0, nwcwd = 0; + apr_wchar_t *wcmd = apr_palloc(cont, ncmd * sizeof(wcmd[0])); + apr_wchar_t *wcwd = NULL; + + if (attr->currdir) + { + ncwd = nwcwd = strlen(attr->currdir) + 1; + wcwd = apr_palloc(cont, ncwd * sizeof(wcwd[0])); + } if (((rv = utf8_to_unicode_path(wprg, sizeof(wprg)/sizeof(wprg[0]), progname)) != APR_SUCCESS) || ((rv = conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd)) != APR_SUCCESS) - || ((rv = conv_utf8_to_ucs2(attr->currdir, &ncwd, wcwd, &nwcwd)) + || (attr->currdir && + (rv = conv_utf8_to_ucs2(attr->currdir, &ncwd, wcwd, &nwcwd)) != APR_SUCCESS)) { return rv; } @@ -442,13 +449,17 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, si.dwFlags |= STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; } - if (attr->child_in->filehand || attr->child_out->filehand - || attr->child_err->filehand) { + if (attr->child_in || attr->child_out || attr->child_err) + { si.dwFlags |= STARTF_USESTDHANDLES; - si.hStdInput = attr->child_in->filehand; - si.hStdOutput = attr->child_out->filehand; - si.hStdError = attr->child_err->filehand; + if (attr->child_in) + si.hStdInput = attr->child_in->filehand; + if (attr->child_out) + si.hStdOutput = attr->child_out->filehand; + if (attr->child_err) + si.hStdError = attr->child_err->filehand; } + rv = CreateProcessW(wprg, wcmd, /* Command line */ NULL, NULL, /* Proc & thread security attributes */ TRUE, /* Inherit handles */ @@ -466,12 +477,15 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, si.dwFlags |= STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; } - if (attr->child_in->filehand || attr->child_out->filehand - || attr->child_err->filehand) { + if (attr->child_in || attr->child_out || attr->child_err) + { si.dwFlags |= STARTF_USESTDHANDLES; - si.hStdInput = attr->child_in->filehand; - si.hStdOutput = attr->child_out->filehand; - si.hStdError = attr->child_err->filehand; + if (attr->child_in) + si.hStdInput = attr->child_in->filehand; + if (attr->child_out) + si.hStdOutput = attr->child_out->filehand; + if (attr->child_err) + si.hStdError = attr->child_err->filehand; } rv = CreateProcessA(progname, cmdline, /* Command line */ From a3318df21cc45b9187662eda426928d41dda5b0f Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Tue, 11 Sep 2001 01:03:07 +0000 Subject: [PATCH 2310/7878] (apr_proc_create): Check the attribute pointers, yes, but *don't* change the semantics while we're at it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62309 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 3920d883364..70adb0f05c3 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -449,14 +449,16 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, si.dwFlags |= STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; } - if (attr->child_in || attr->child_out || attr->child_err) + if ((attr->child_in && attr->child_in->filehand) + || (attr->child_out && attr->child_out->filehand) + || (attr->child_err && attr->child_err->filehand)) { si.dwFlags |= STARTF_USESTDHANDLES; - if (attr->child_in) + if (attr->child_in && attr->child_in->filehand) si.hStdInput = attr->child_in->filehand; - if (attr->child_out) + if (attr->child_out && attr->child_out->filehand) si.hStdOutput = attr->child_out->filehand; - if (attr->child_err) + if (attr->child_err && attr->child_err->filehand) si.hStdError = attr->child_err->filehand; } @@ -477,14 +479,16 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, si.dwFlags |= STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; } - if (attr->child_in || attr->child_out || attr->child_err) + if ((attr->child_in && attr->child_in->filehand) + || (attr->child_out && attr->child_out->filehand) + || (attr->child_err && attr->child_err->filehand)) { si.dwFlags |= STARTF_USESTDHANDLES; - if (attr->child_in) + if (attr->child_in && attr->child_in->filehand) si.hStdInput = attr->child_in->filehand; - if (attr->child_out) + if (attr->child_out && attr->child_out->filehand) si.hStdOutput = attr->child_out->filehand; - if (attr->child_err) + if (attr->child_err && attr->child_err->filehand) si.hStdError = attr->child_err->filehand; } From a367d18b0955b32fe8a8fb39c766bb9653990da5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 11 Sep 2001 01:03:49 +0000 Subject: [PATCH 2311/7878] Begin/End Source (not End Group :) Any patch to apr.dsp generally needs to be mirrored to libapr.dsp (and visa versa.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62310 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 8 ++++---- libapr.dsp | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/apr.dsp b/apr.dsp index 0f75233609a..c40355210b0 100644 --- a/apr.dsp +++ b/apr.dsp @@ -164,11 +164,11 @@ SOURCE=.\i18n\unix\xlate.c SOURCE=.\locks\win32\locks.c # End Source File -# End Group +# Begin Source File SOURCE=.\locks\win32\thread_mutex.c # End Source File -# End Group +# Begin Source File SOURCE=.\locks\win32\thread_rwlock.c # End Source File @@ -439,11 +439,11 @@ SOURCE=.\include\arch\win32\networkio.h SOURCE=.\include\arch\win32\thread_mutex.h # End Source File -# End Group +# Begin Source File SOURCE=.\include\arch\win32\thread_rwlock.h # End Source File -# End Group +# Begin Source File SOURCE=.\include\arch\win32\threadproc.h # End Source File diff --git a/libapr.dsp b/libapr.dsp index b3aa21db9f8..a6680fad7a6 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -170,6 +170,14 @@ SOURCE=.\i18n\unix\xlate.c SOURCE=.\locks\win32\locks.c # End Source File +# Begin Source File + +SOURCE=.\locks\win32\thread_mutex.c +# End Source File +# Begin Source File + +SOURCE=.\locks\win32\thread_rwlock.c +# End Source File # End Group # Begin Group "memory" @@ -435,6 +443,14 @@ SOURCE=.\include\arch\win32\networkio.h # End Source File # Begin Source File +SOURCE=.\include\arch\win32\thread_mutex.h +# End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\thread_rwlock.h +# End Source File +# Begin Source File + SOURCE=.\include\arch\win32\threadproc.h # End Source File # End Group @@ -569,10 +585,18 @@ SOURCE=.\include\apr_tables.h # End Source File # Begin Source File +SOURCE=.\include\apr_thread_mutex.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_thread_proc.h # End Source File # Begin Source File +SOURCE=.\include\apr_thread_rwlock.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_time.h # End Source File # Begin Source File From 94438fcde3dedaa8e1b3cd28f8ac19132d3f3071 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 11 Sep 2001 01:06:13 +0000 Subject: [PATCH 2312/7878] Big red warnings (even after Brane's efforts.) I will reapproach these issues by the beginning of next week, unless other beat me to it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62311 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/STATUS b/STATUS index 98515dcdfe6..f95f96eacd7 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/09/08 09:07:36 $] +Last modified at [$Date: 2001/09/11 01:06:13 $] Release: @@ -21,15 +21,24 @@ RELEASE SHOWSTOPPERS: DougM offered to complete the work with his nifty perl rename script at the hackathon. - * Win32 utf-8 filenames are broken by GetSecurityInfoByNameW() - which won't accept Win32's canonical \\?\D:\foo long naming - conventions. Convert to _ByHandle or add an arg to our utf-8 - name converter so we can handle this. + * When Win32 apr_proc_create was fixed, the apr_proc_t hproc + member was added for that platform. That's a problem (and + was when pid was abused as well) since nobody goes and cleans + up hproc after the process is dead. Can't do a pool cleanup, + since apr_proc_create didn't allocate the apr_proc_t storage. + (Aren't transparent types swell?) Suggestions? RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * Get OTHER_CHILD support into Win32 Status: Bill S. is looking into this + * Win32 apr_proc_create fails to create 16 bit apps detached + (a win32 bug.) The question - test in advance (slow) or + recover gracefully from failure and try again? Only the test + method will work on Win9x, since it will appear to work, only + to encounter mangled pipes. Win2K (NT?) simply fails. + * SysV semaphore support isn't usable by Apache when started as root because we don't have a way to allow the semaphore to be used by the configured User and Group. Current work-around: @@ -53,7 +62,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * FirstBill says we need a new procattr, APR_CREATE_SUSPENDED (or something similar) to direct ap_create_process to create the process suspended. We also need a call to wake up the suspended - process This may not be able to be implemented everywhere though. + process. This may not be able to be implemented everywhere though. Status: OtherBill asks, why? What is the benefit, how is it portably implemented? Unless this creates some tangible that mirrors another platform, then I'm -1. From db25a0aa779ea666b0ac4e5668304967de0747ae Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Tue, 11 Sep 2001 06:00:04 +0000 Subject: [PATCH 2313/7878] Since the original version of these blocks just set the si.hStdFoo's unconditionally, just testing attr->child_foo is sufficient to both maintain the original semantics and prevent a NULL pointer deref. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62312 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 70adb0f05c3..322f2603c89 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -454,11 +454,11 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, || (attr->child_err && attr->child_err->filehand)) { si.dwFlags |= STARTF_USESTDHANDLES; - if (attr->child_in && attr->child_in->filehand) + if (attr->child_in) si.hStdInput = attr->child_in->filehand; - if (attr->child_out && attr->child_out->filehand) + if (attr->child_out) si.hStdOutput = attr->child_out->filehand; - if (attr->child_err && attr->child_err->filehand) + if (attr->child_err) si.hStdError = attr->child_err->filehand; } @@ -484,11 +484,11 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, || (attr->child_err && attr->child_err->filehand)) { si.dwFlags |= STARTF_USESTDHANDLES; - if (attr->child_in && attr->child_in->filehand) + if (attr->child_in) si.hStdInput = attr->child_in->filehand; - if (attr->child_out && attr->child_out->filehand) + if (attr->child_out) si.hStdOutput = attr->child_out->filehand; - if (attr->child_err && attr->child_err->filehand) + if (attr->child_err) si.hStdError = attr->child_err->filehand; } From fdebe811e2685b12b3ef5b92273d9e014cde102a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 11 Sep 2001 06:29:45 +0000 Subject: [PATCH 2314/7878] We don't actually use this SECURITY_ATTRIBUTE, so it doesn't need to be there. Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62313 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/thread_mutex.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 972c464ec82..e78ab21f85c 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -71,14 +71,9 @@ static apr_status_t thread_mutex_cleanup(void *data) APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, apr_pool_t *pool) { - SECURITY_ATTRIBUTES sec; (*mutex) = (apr_thread_mutex_t *)apr_palloc(pool, sizeof(**mutex)); (*mutex)->pool = pool; - sec.nLength = sizeof(SECURITY_ATTRIBUTES); - sec.lpSecurityDescriptor = NULL; - sec.bInheritHandle = FALSE; - InitializeCriticalSection(&(*mutex)->section); apr_pool_cleanup_register((*mutex)->pool, (*mutex), thread_mutex_cleanup, apr_pool_cleanup_null); From d7968e5e3abf669f8e93a4a7cdde0998188584a3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 11 Sep 2001 13:33:39 +0000 Subject: [PATCH 2315/7878] Tidy up to get us working again... - add the thread_once stuff (cribbed from OS/2 - thanks Brian) - correct the return values we get from threads - change thread_join to return the correct value git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62314 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/threadproc.h | 5 ++++ threadproc/beos/proc.c | 1 + threadproc/beos/thread.c | 48 +++++++++++++++++++++++++++++++--- threadproc/beos/threadpriv.c | 2 +- 4 files changed, 52 insertions(+), 4 deletions(-) diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h index 145cf4a5b2f..76cb7de2dd2 100644 --- a/include/arch/beos/threadproc.h +++ b/include/arch/beos/threadproc.h @@ -123,5 +123,10 @@ struct apr_procattr_t { apr_int32_t detached; }; +struct apr_thread_once_t { + sem_id sem; + int hit; +}; + #endif /* ! THREAD_PROC_H */ diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 99ca78f0b78..4d527b42a18 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -256,6 +256,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, if ( newproc < B_NO_ERROR) { return errno; } + resume_thread(newproc); if (attr->child_in) { diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index c37fffec72f..398c6a43f80 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -144,17 +144,19 @@ int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { apr_pool_destroy(thd->cntxt); - exit_thread ((status_t)retval); + exit_thread ((status_t)(*retval)); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { - if (wait_for_thread(thd->td,(void *)&retval) == B_NO_ERROR) { + status_t rv = 0, ret; + if ((ret = wait_for_thread(thd->td,&rv)) == B_NO_ERROR) { + *retval = rv; return APR_SUCCESS; } else { - return errno; + return ret; } } @@ -204,4 +206,44 @@ APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t return APR_SUCCESS; } +static apr_status_t thread_once_cleanup(void *vcontrol) +{ + apr_thread_once_t *control = (apr_thread_once_t *)vcontrol; + + if (control->sem) { + release_sem(control->sem); + delete_sem(control->sem); + } + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, + apr_pool_t *p) +{ + int rc; + *control = (apr_thread_once_t *)apr_pcalloc(p, sizeof(apr_thread_once_t)); + (*control)->hit = 0; /* we haven't done it yet... */ + rc = ((*control)->sem = create_sem(1, "thread_once")); + if (rc != 0) { + return rc; + } + apr_pool_cleanup_register(p, control, thread_once_cleanup, apr_pool_cleanup_null); + return APR_SUCCESS; +} + + + +APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, + void (*func)(void)) +{ + if (!control->hit) { + if (acquire_sem(control->sem) == B_OK) { + control->hit = 1; + func(); + } + } + return APR_SUCCESS; +} + APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index 4ca030aa5e4..a929b357239 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -117,7 +117,7 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { thread_id tid; - int i,index = 0, ret; + int i,index = 0, ret = 0; tid = find_thread(NULL); for (i=0; i < BEOS_MAX_DATAKEYS; i++){ From c461f12b930e56fda3f49a414332a104ec0e9cc4 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 12 Sep 2001 14:25:05 +0000 Subject: [PATCH 2316/7878] OS/2: Implement apr_thread_mutex functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62315 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/thread_mutex.h | 1 + locks/os2/thread_mutex.c | 57 +++++++++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/include/arch/os2/thread_mutex.h b/include/arch/os2/thread_mutex.h index 29d9ed733ef..b8b9d1222be 100644 --- a/include/arch/os2/thread_mutex.h +++ b/include/arch/os2/thread_mutex.h @@ -60,6 +60,7 @@ struct apr_thread_mutex_t { apr_pool_t *pool; + HMTX hMutex; }; #endif /* THREAD_MUTEX_H */ diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index d47e3be1253..4464ec1a8be 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -59,30 +59,75 @@ #include "thread_mutex.h" #include "fileio.h" #include +#include + +static apr_status_t thread_mutex_cleanup(void *themutex) +{ + apr_thread_mutex_t *mutex = themutex; + return apr_thread_mutex_destroy(mutex); +} + + APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, apr_pool_t *pool) { - return APR_ENOTIMPL; + apr_thread_mutex_t *new_mutex; + ULONG rc; + + new_mutex = (apr_thread_mutex_t *)apr_palloc(pool, sizeof(apr_thread_mutex_t)); + new_mutex->pool = pool; + + rc = DosCreateMutexSem(NULL, &(new_mutex->hMutex), 0, FALSE); + *mutex = new_mutex; + + if (!rc) + apr_pool_cleanup_register(pool, new_mutex, thread_mutex_cleanup, apr_pool_cleanup_null); + + return APR_OS2_STATUS(rc); } + + APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + ULONG rc = DosRequestMutexSem(mutex->hMutex, SEM_INDEFINITE_WAIT); + return APR_OS2_STATUS(rc); } + + APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + ULONG rc = DosRequestMutexSem(mutex->hMutex, SEM_IMMEDIATE_RETURN); + return APR_OS2_STATUS(rc); } + + APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + ULONG rc = DosReleaseMutexSem(mutex->hMutex); + return APR_OS2_STATUS(rc); } + + APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; -} + ULONG rc; + if (mutex->hMutex == 0) + return APR_SUCCESS; + + while (DosReleaseMutexSem(mutex->hMutex) == 0); + + rc = DosCloseMutexSem(mutex->hMutex); + + if (!rc) { + mutex->hMutex = 0; + return APR_SUCCESS; + } + + return APR_FROM_OS_ERROR(rc); +} From c614d64213e9654ec9cbc328041eadb6454928f2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 12 Sep 2001 19:46:12 +0000 Subject: [PATCH 2317/7878] Don't search for IPv6 names in apr_sockaddr_info_get() if the application doesn't specify the family (i.e., the application passes in AF_UNSPEC) and APR isn't built with IPv6 support. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62316 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 ++++++- network_io/unix/sa_common.c | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 2406bb24d46..befac8114c9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 - + + *) Don't search for IPv6 names in apr_sockaddr_info_get() if the + application doesn't specify the family (i.e., the application + passes in AF_UNSPEC) and APR isn't built with IPv6 support. + [Jeff Trawick] + *) Fix the API for the apr_proc_create() call on Win32. Several bad assumptions are gone, including a mismatch between unix and win32, where win32 was defaulting to create detached. Also fixes diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index c03706e9bcf..ad176f7958d 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -345,7 +345,15 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, memset(&hints, 0, sizeof(hints)); hints.ai_flags = 0; /* XXX: might need a way to turn on AI_CANONNAME */ - hints.ai_family = family; +#if !APR_HAVE_IPV6 + /* we can't talk IPv6 so we might as well not search for IPv6 + * addresses + */ + if (family == AF_UNSPEC) + hints.ai_family = AF_INET; + else +#endif + hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; apr_snprintf(num, sizeof(num), "%d", port); From d3e8a5910bf2feab82091081088a7dda3bf24946 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 13 Sep 2001 01:04:23 +0000 Subject: [PATCH 2318/7878] Add condition variables to the APR set of locking functions. This does Unix, and provides stubs for all other platforms. Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62317 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 + include/apr_thread_cond.h | 136 ++++++++++++++++++++++++ include/arch/beos/thread_cond.h | 71 +++++++++++++ include/arch/netware/thread_cond.h | 66 ++++++++++++ include/arch/os2/thread_cond.h | 66 ++++++++++++ include/arch/unix/thread_cond.h | 80 ++++++++++++++ include/arch/win32/thread_cond.h | 65 ++++++++++++ locks/beos/Makefile.in | 3 +- locks/beos/thread_cond.c | 90 ++++++++++++++++ locks/netware/thread_cond.c | 88 ++++++++++++++++ locks/os2/Makefile.in | 3 +- locks/os2/thread_cond.c | 89 ++++++++++++++++ locks/unix/Makefile.in | 3 +- locks/unix/thread_cond.c | 163 +++++++++++++++++++++++++++++ locks/win32/thread_cond.c | 88 ++++++++++++++++ test/testlock.c | 145 ++++++++++++++++++++++++- 16 files changed, 1155 insertions(+), 5 deletions(-) create mode 100644 include/apr_thread_cond.h create mode 100644 include/arch/beos/thread_cond.h create mode 100644 include/arch/netware/thread_cond.h create mode 100644 include/arch/os2/thread_cond.h create mode 100644 include/arch/unix/thread_cond.h create mode 100644 include/arch/win32/thread_cond.h create mode 100644 locks/beos/thread_cond.c create mode 100644 locks/netware/thread_cond.c create mode 100644 locks/os2/thread_cond.c create mode 100644 locks/unix/thread_cond.c create mode 100644 locks/win32/thread_cond.c diff --git a/CHANGES b/CHANGES index befac8114c9..b161e4ced4f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Add condition variables to the APR set of locking functions. + This does Unix, and provides stubs for all other platforms. + [Aaron Bannert ] + *) Don't search for IPv6 names in apr_sockaddr_info_get() if the application doesn't specify the family (i.e., the application passes in AF_UNSPEC) and APR isn't built with IPv6 support. diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h new file mode 100644 index 00000000000..9a12e4f1aeb --- /dev/null +++ b/include/apr_thread_cond.h @@ -0,0 +1,136 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_THREAD_COND_H +#define APR_THREAD_COND_H + +#include "apr.h" +#include "apr_pools.h" +#include "apr_errno.h" +#include "apr_thread_mutex.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @file apr_thread_cond.h + * @brief APR Condition Variable Routines + */ + +/** + * @defgroup APR_Cond Condition Variable Routines + * @ingroup APR + * @{ + */ + +typedef struct apr_thread_cond_t apr_thread_cond_t; + +/* Function definitions */ + +/** + * Create and initialize a condition variable that can be used to signal + * and schedule threads in a single process. + * @param cond the memory address where the newly created condition variable + * will be stored. + * @param pool the pool from which to allocate the mutex. + */ +APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, + apr_pool_t *pool); +/** + * Put the active calling thread to sleep until signaled to wake up. Each + * condition variable must be associated with a mutex, and that mutex must + * be locked before calling this function, or the behavior will be + * undefined. As the calling thread is put to sleep, the given mutex + * will be simultaneously released; and as this thread wakes up the lock + * is again simultaneously acquired. + * @param cond the condition variable on which to block. + * @param mutex the mutex that must be locked upon entering this function, + * is released while the thread is asleep, and is again acquired before + * returning from this function. + */ +APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex); + +/* XXX: Should we add apr_thread_cond_timedwait()? Can it be done on all + * platforms? -aaron */ + +/** + * Signals a singla thread, if one exists, that is blocking on the given + * condition variable. That thread is then scheduled to wake up and acquire + * the associated mutex. Although it is not required, if predictible schedule + * is desired, that mutex must be locked while calling this function. + * @param cond the condition variable on which to produce the signal. + */ +APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond); +/** + * Signals all threads blocking on the given condition variable. + * Each thread that was signaled is then schedule to wake up and acquire + * the associated mutex. This will happen in a serialized manner. + * @param cond the condition variable on which to produce the broadcast. + */ +APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond); + +/** + * Destroy the condition variable and free the associated memory. + * @param cond the condition variable to destroy. + */ +APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond); + + +#ifdef __cplusplus +} +#endif + +#endif /* ! APR_THREAD_COND_H */ diff --git a/include/arch/beos/thread_cond.h b/include/arch/beos/thread_cond.h new file mode 100644 index 00000000000..05625c01154 --- /dev/null +++ b/include/arch/beos/thread_cond.h @@ -0,0 +1,71 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_COND_H +#define THREAD_COND_H + +#include +#include "apr_pools.h" +#include "apr_thread_cond.h" +#include "apr_file_io.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_portable.h" + +struct apr_thread_cond_t { + apr_pool_t *pool; +}; + +#endif /* THREAD_COND_H */ + diff --git a/include/arch/netware/thread_cond.h b/include/arch/netware/thread_cond.h new file mode 100644 index 00000000000..94e49d00b7e --- /dev/null +++ b/include/arch/netware/thread_cond.h @@ -0,0 +1,66 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_COND_H +#define THREAD_COND_H + +#include "apr_thread_cond.h" +#include + +struct apr_thread_cond_t { + apr_pool_t *pool; +}; + +#endif /* THREAD_COND_H */ + diff --git a/include/arch/os2/thread_cond.h b/include/arch/os2/thread_cond.h new file mode 100644 index 00000000000..e8eca2d5fe7 --- /dev/null +++ b/include/arch/os2/thread_cond.h @@ -0,0 +1,66 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_COND_H +#define THREAD_COND_H + +#include "apr_thread_cond.h" +#include "apr_file_io.h" + +struct apr_thread_cond_t { + apr_pool_t *pool; +}; + +#endif /* THREAD_COND_H */ + diff --git a/include/arch/unix/thread_cond.h b/include/arch/unix/thread_cond.h new file mode 100644 index 00000000000..57827f5033b --- /dev/null +++ b/include/arch/unix/thread_cond.h @@ -0,0 +1,80 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_COND_H +#define THREAD_COND_H + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_thread_mutex.h" +#include "apr_thread_cond.h" +#include "apr_pools.h" + +#if APR_HAVE_PTHREAD_H +#include +#endif + +/* XXX: Should we have a better autoconf search, something like + * APR_HAS_PTHREAD_COND? -aaron */ +#if APR_HAS_THREADS +struct apr_thread_cond_t { + apr_pool_t *pool; + pthread_cond_t *cond; +}; +#endif + +#endif /* THREAD_COND_H */ + diff --git a/include/arch/win32/thread_cond.h b/include/arch/win32/thread_cond.h new file mode 100644 index 00000000000..95c83cccdad --- /dev/null +++ b/include/arch/win32/thread_cond.h @@ -0,0 +1,65 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef THREAD_COND_H +#define THREAD_COND_H + +#include "apr_thread_cond.h" + +struct apr_thread_cond_t { + apr_pool_t *pool; +}; + +#endif /* THREAD_COND_H */ + diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in index d3eda157c72..e7751a9346c 100644 --- a/locks/beos/Makefile.in +++ b/locks/beos/Makefile.in @@ -1,7 +1,8 @@ TARGETS = locks.lo \ thread_mutex.lo \ - thread_rwlock.lo + thread_rwlock.lo \ + thread_cond.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c new file mode 100644 index 00000000000..e43e8b87696 --- /dev/null +++ b/locks/beos/thread_cond.c @@ -0,0 +1,90 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/*Read/Write locking implementation based on the MultiLock code from + * Stephen Beaulieu + */ + +#include "beos/thread_mutex.h" +#include "beos/thread_cond.h" +#include "apr_strings.h" +#include "apr_portable.h" + + +APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) +{ + return APR_ENOTIMPL; +} diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c new file mode 100644 index 00000000000..896543b3fa4 --- /dev/null +++ b/locks/netware/thread_cond.c @@ -0,0 +1,88 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_strings.h" +#include "thread_mutex.h" +#include "thread_cond.h" +#include "apr_portable.h" + +APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) +{ + return APR_ENOTIMPL; +} diff --git a/locks/os2/Makefile.in b/locks/os2/Makefile.in index 2552ac40fd0..89fbbf0e284 100644 --- a/locks/os2/Makefile.in +++ b/locks/os2/Makefile.in @@ -1,7 +1,8 @@ TARGETS = locks.lo \ thread_mutex.lo \ - thread_rwlock.lo + thread_rwlock.lo \ + thread_cond.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/os2/thread_cond.c b/locks/os2/thread_cond.c new file mode 100644 index 00000000000..eaf10f18c20 --- /dev/null +++ b/locks/os2/thread_cond.c @@ -0,0 +1,89 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include "apr_portable.h" +#include "thread_mutex.h" +#include "thread_cond.h" +#include "fileio.h" +#include + +APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) +{ + return APR_ENOTIMPL; +} diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index 46b40340b75..81820f0d5a5 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -4,7 +4,8 @@ TARGETS = \ crossproc.lo \ intraproc.lo \ thread_mutex.lo \ - thread_rwlock.lo + thread_rwlock.lo \ + thread_cond.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c new file mode 100644 index 00000000000..b03710fefe9 --- /dev/null +++ b/locks/unix/thread_cond.c @@ -0,0 +1,163 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "thread_mutex.h" +#include "thread_cond.h" + +#if APR_HAS_THREADS + + +static apr_status_t thread_cond_cleanup(void *data) +{ + apr_thread_cond_t *cond = (apr_thread_cond_t *)data; + apr_status_t stat; + + stat = pthread_cond_destroy(cond->cond); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + return stat; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, + apr_pool_t *pool) +{ + apr_thread_cond_t *new_cond; + apr_status_t stat; + + new_cond = (apr_thread_cond_t *)apr_pcalloc(pool, + sizeof(apr_thread_cond_t)); + + if (new_cond == NULL) { + return APR_ENOMEM; + } + + new_cond->pool = pool; + new_cond->cond = (pthread_cond_t *)apr_palloc(pool, + sizeof(pthread_cond_t)); + + if (new_cond->cond == NULL) { + return APR_ENOMEM; + } + + if ((stat = pthread_cond_init(new_cond->cond, NULL))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + thread_cond_cleanup(new_cond); + return stat; + } + + apr_pool_cleanup_register(new_cond->pool, + (void *)new_cond, thread_cond_cleanup, + apr_pool_cleanup_null); + + *cond = new_cond; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex) +{ + apr_status_t stat; + + stat = pthread_cond_wait(cond->cond, &mutex->mutex); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + return stat; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) +{ + apr_status_t stat; + + stat = pthread_cond_signal(cond->cond); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + return stat; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) +{ + apr_status_t stat; + + stat = pthread_cond_broadcast(cond->cond); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + return stat; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) +{ + apr_status_t stat; + if ((stat = thread_cond_cleanup(cond)) == APR_SUCCESS) { + apr_pool_cleanup_kill(cond->pool, cond, thread_cond_cleanup); + return APR_SUCCESS; + } + return stat; +} + + +#endif /* APR_HAS_THREADS */ diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c new file mode 100644 index 00000000000..3010df650c9 --- /dev/null +++ b/locks/win32/thread_cond.c @@ -0,0 +1,88 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_strings.h" +#include "win32/thread_mutex.h" +#include "win32/thread_cond.h" +#include "apr_portable.h" + +APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) +{ + return APR_ENOTIMPL; +} diff --git a/test/testlock.c b/test/testlock.c index 522743e0ffa..6fdad2d4420 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -57,6 +57,7 @@ #include "apr_lock.h" #include "apr_thread_mutex.h" #include "apr_thread_rwlock.h" +#include "apr_thread_cond.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_getopt.h" @@ -75,14 +76,18 @@ int main(void) #else /* !APR_HAS_THREADS */ #define MAX_ITER 40000 +#define MAX_COUNTER 100000 void * APR_THREAD_FUNC thread_rw_func(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_function(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_cond_producer(apr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data); apr_status_t test_exclusive(void); apr_status_t test_rw(void); apr_status_t test_multiple_locking(const char *); +apr_status_t test_cond(void); apr_file_t *in, *out, *err; @@ -92,6 +97,19 @@ apr_thread_rwlock_t *rwlock; apr_pool_t *pool; int i = 0, x = 0; +int buff[MAX_COUNTER]; +struct { + apr_thread_mutex_t *mutex; + int nput; + int nval; +} put; + +struct { + apr_thread_mutex_t *mutex; + apr_thread_cond_t *cond; + int nready; +} nready; + void * APR_THREAD_FUNC thread_rw_func(apr_thread_t *thd, void *data) { int exitLoop = 1; @@ -192,6 +210,49 @@ void * APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data) return NULL; } +void * APR_THREAD_FUNC thread_cond_producer(apr_thread_t *thd, void *data) +{ + for (;;) { + apr_thread_mutex_lock(put.mutex); + if (put.nput >= MAX_COUNTER) { + apr_thread_mutex_unlock(put.mutex); + return NULL; + } + buff[put.nput] = put.nval; + put.nput++; + put.nval++; + apr_thread_mutex_unlock(put.mutex); + + apr_thread_mutex_lock(nready.mutex); + if (nready.nready == 0) + apr_thread_cond_signal(nready.cond); + nready.nready++; + apr_thread_mutex_unlock(nready.mutex); + + *((int *) data) += 1; + } + + return NULL; +} + +void * APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data) +{ + int i; + + for (i = 0; i < MAX_COUNTER; i++) { + apr_thread_mutex_lock(nready.mutex); + while (nready.nready == 0) + apr_thread_cond_wait(nready.cond, nready.mutex); + nready.nready--; + apr_thread_mutex_unlock(nready.mutex); + + if (buff[i] != i) + printf("buff[%d] = %d\n", i, buff[i]); + } + + return NULL; +} + int test_rw(void) { apr_thread_t *t1, *t2, *t3, *t4; @@ -334,7 +395,7 @@ apr_status_t test_multiple_locking(const char *lockfile) return APR_SUCCESS; } -apr_status_t test_thread_mutex(void) +static apr_status_t test_thread_mutex(void) { apr_thread_t *t1, *t2, *t3, *t4; apr_status_t s1, s2, s3, s4; @@ -382,7 +443,7 @@ apr_status_t test_thread_mutex(void) return APR_SUCCESS; } -int test_thread_rwlock(void) +static int test_thread_rwlock(void) { apr_thread_t *t1, *t2, *t3, *t4; apr_status_t s1, s2, s3, s4; @@ -429,6 +490,80 @@ int test_thread_rwlock(void) return APR_SUCCESS; } +apr_status_t test_cond(void) +{ + apr_thread_t *p1, *p2, *p3, *p4, *c1; + apr_status_t s0, s1, s2, s3, s4; + int count1, count2, count3, count4; + int sum; + + printf("thread_cond Tests\n"); + printf("%-60s", " Initializing the first apr_thread_mutex_t"); + s1 = apr_thread_mutex_create(&put.mutex, pool); + if (s1 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + printf("%-60s", " Initializing the second apr_thread_mutex_t"); + s1 = apr_thread_mutex_create(&nready.mutex, pool); + if (s1 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + printf("%-60s", " Initializing the apr_thread_cond_t"); + s1 = apr_thread_cond_create(&nready.cond, pool); + if (s1 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + count1 = count2 = count3 = count4 = 0; + put.nput = put.nval = 0; + nready.nready = 0; + i = 0; + x = 0; + + printf("%-60s"," Starting all the threads"); + s0 = apr_thread_create(&p1, NULL, thread_cond_producer, &count1, pool); + s1 = apr_thread_create(&p2, NULL, thread_cond_producer, &count2, pool); + s2 = apr_thread_create(&p3, NULL, thread_cond_producer, &count3, pool); + s3 = apr_thread_create(&p4, NULL, thread_cond_producer, &count4, pool); + s4 = apr_thread_create(&c1, NULL, thread_cond_consumer, NULL, pool); + if (s0 != APR_SUCCESS || s1 != APR_SUCCESS || s2 != APR_SUCCESS || + s3 != APR_SUCCESS || s4 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + printf("%-60s", " Waiting for threads to exit"); + apr_thread_join(&s0, p1); + apr_thread_join(&s1, p2); + apr_thread_join(&s2, p3); + apr_thread_join(&s3, p4); + apr_thread_join(&s4, c1); + printf("OK\n"); + + sum = count1 + count2 + count3 + count4; + /* + printf("count1 = %d count2 = %d count3 = %d count4 = %d\n", + count1, count2, count3, count4); + */ + if (sum != MAX_COUNTER) { + fprintf(stderr, "thread_cond didn't work as expected. sum = %d, instead of %d\n", sum, MAX_COUNTER); + } + else { + printf("Test passed\n"); + } + + return APR_SUCCESS; +} + int main(int argc, const char * const *argv) { apr_status_t rv; @@ -494,6 +629,12 @@ int main(int argc, const char * const *argv) exit(-6); } + if ((rv = test_cond()) != APR_SUCCESS) { + fprintf(stderr,"thread_cond test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-7); + } + return 0; } From bbea6614e7b740225351b988b46bf26fc8fa8dfd Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 13 Sep 2001 02:50:07 +0000 Subject: [PATCH 2319/7878] Implement apr_thread_mutex_trylock on Windows git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62318 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/thread_mutex.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index e78ab21f85c..86360c36eff 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -88,7 +88,12 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + BOOL status; + status = TryEnterCriticalSection(&mutex->section); + if (status) { + return APR_SUCCESS; + } + return APR_EBUSY; } APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) From 9c85dd43217f620cd36983badbff830182ff496e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 13 Sep 2001 12:12:50 +0000 Subject: [PATCH 2320/7878] tweak the check for APR_HAS_THREADS so we pick up the symbol before including private APR header files which assume it git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62319 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_cond.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c index b03710fefe9..c8bb267637a 100644 --- a/locks/unix/thread_cond.c +++ b/locks/unix/thread_cond.c @@ -52,11 +52,12 @@ * . */ -#include "thread_mutex.h" -#include "thread_cond.h" +#include "apr.h" #if APR_HAS_THREADS +#include "thread_mutex.h" +#include "thread_cond.h" static apr_status_t thread_cond_cleanup(void *data) { From 4f317e5bdfa7ac10e645931e75c4f458d1f93eba Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 13 Sep 2001 17:52:23 +0000 Subject: [PATCH 2321/7878] thread condition stuff isn't available if !APR_HAS_THREADS... this gets Apache's exports.c to compile again when !APR_HAS_THREADS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62320 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_cond.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h index 9a12e4f1aeb..6d482284655 100644 --- a/include/apr_thread_cond.h +++ b/include/apr_thread_cond.h @@ -64,6 +64,8 @@ extern "C" { #endif /* __cplusplus */ +#if APR_HAS_THREADS + /** * @file apr_thread_cond.h * @brief APR Condition Variable Routines @@ -128,6 +130,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond); */ APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond); +#endif /* APR_HAS_THREADS */ #ifdef __cplusplus } From e305180c376d7a5681caf7cb0f7bc3f47cbfad77 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 13 Sep 2001 22:19:13 +0000 Subject: [PATCH 2322/7878] Allow make install to work when built with VPATH. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62321 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 5f06ffb7af7..bfa9095a75b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -51,11 +51,11 @@ delete-lib: install: $(TARGET_LIB) if [ ! -d $(includedir) ]; then \ - ./build/mkdir.sh $(includedir); \ + $(srcdir)/build/mkdir.sh $(includedir); \ fi; \ cp include/*.h $(includedir); \ if [ ! -d $(libdir) ]; then \ - ./build/mkdir.sh $(libdir); \ + $(srcdir)/build/mkdir.sh $(libdir); \ fi; \ $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(libdir) $(LIBTOOL) --mode=install cp APRVARS $(libdir) From 376016828ef561486a1540feacedb2026ea39ace Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 14 Sep 2001 14:10:05 +0000 Subject: [PATCH 2323/7878] get srcdir into apr/Makefile, as srcdir is now referenced during make install git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62322 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.in b/Makefile.in index bfa9095a75b..3b739cc7459 100644 --- a/Makefile.in +++ b/Makefile.in @@ -38,6 +38,7 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ +srcdir=@srcdir@ delete-lib: @if test -f $(TARGET_LIB); then \ From 1e203eac1acbed5864652ab77b3f73589a2e6bf5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 14 Sep 2001 15:39:38 +0000 Subject: [PATCH 2324/7878] Just because we have pthreads, that doesn't mean we have pthread_rwlock. This removes support for rwlock on platforms that don't have them. I will write an implementation of rwlocks that don't rely on pthreads later this weekend. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62323 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/thread_rwlock.h | 9 ++++++ locks/unix/thread_rwlock.c | 48 +++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/include/arch/unix/thread_rwlock.h b/include/arch/unix/thread_rwlock.h index 2d8b0b7c136..18a042a9b16 100644 --- a/include/arch/unix/thread_rwlock.h +++ b/include/arch/unix/thread_rwlock.h @@ -67,10 +67,19 @@ #endif #if APR_HAS_THREADS +#if HAVE_PTHREAD_RWLOCK_INIT + struct apr_thread_rwlock_t { apr_pool_t *pool; pthread_rwlock_t *rwlock; }; + +#else + +struct apr_thread_rwlock_t { +}; +#endif + #endif #endif /* THREAD_RWLOCK_H */ diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c index 95ef5e5421b..dc9377beb0f 100644 --- a/locks/unix/thread_rwlock.c +++ b/locks/unix/thread_rwlock.c @@ -53,9 +53,12 @@ */ #include "thread_rwlock.h" +#include "apr_private.h" #if APR_HAS_THREADS +#ifdef HAVE_PTHREAD_RWLOCK_INIT + static apr_status_t thread_rwlock_cleanup(void *data) { apr_thread_rwlock_t *rwlock = (apr_thread_rwlock_t *)data; @@ -189,4 +192,49 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) return stat; } +#else /* HAVE_PTHREAD_RWLOCK_INIT */ + +APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_lock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) +{ + return APR_ENOTIMPL; +} + +#endif /* HAVE_PTHREAD_RWLOCK_INIT */ + #endif /* APR_HAS_THREADS */ From cfae33aa70d686b1a2ba4f6b2f36179c3324a42c Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 14 Sep 2001 23:19:47 +0000 Subject: [PATCH 2325/7878] Changed the NetWare deconstruct() if statement to look for a specific error. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62324 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index f48ecbcc3ea..3250294b670 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -93,13 +93,15 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, /* Split the inpath into its separate parts. If it fails then we know we have a bad path. */ - if (deconstruct(testpath, server, volume, path, file, NULL, &elements, PATH_UNDEF)) - return APR_EBADPATH; + if (deconstruct(testpath, server, volume, path, file, NULL, &elements, PATH_UNDEF)) { + if (errno == EINVAL) + return APR_EBADPATH; + } /* If we got a volume part then continue splitting out the root. Otherwise we either have an incomplete or relative path */ - if (strlen(volume) > 0) { + if (volume && strlen(volume) > 0) { newpath = apr_pcalloc(p, strlen(server)+strlen(volume)+5); construct(newpath, server, volume, NULL, NULL, NULL, PATH_NETWARE); From ef961ad1d10b11bd1ca14b0a17575342a77fdf44 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 14 Sep 2001 23:21:37 +0000 Subject: [PATCH 2326/7878] Added the ability to extract the APR_FINFO_NAME data for NetWare in apr_stat() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62325 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 1f2f48df24d..820e8452755 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -150,6 +150,12 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, fill_out_finfo(finfo, &info, wanted); if (wanted & APR_FINFO_LINK) wanted &= ~APR_FINFO_LINK; +#ifdef NETWARE + if (wanted & APR_FINFO_NAME) { + finfo->name = apr_pstrdup(cont, info.st_name); + finfo->valid |= APR_FINFO_NAME; + } +#endif return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; } else { From d17241acaba5098c6f7d4ba41ab1b3b942558751 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 15 Sep 2001 00:57:13 +0000 Subject: [PATCH 2327/7878] This allows us to generate a valid Makefile on Visual C++ 7.0. This should work on versions of VC++ as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62326 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.pl | 2 +- test/testlock.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl index eaf58e6b5d4..96e94b2f3ab 100644 --- a/test/MakeWin32Make.pl +++ b/test/MakeWin32Make.pl @@ -11,7 +11,7 @@ . "LINK = link.exe /nologo /debug /machine:I386 /subsystem:console /incremental:no \n\n" . "CFLAGS = /nologo /c /MDd /W3 /Gm /GX /Zi /Od /D _DEBUG /D WIN32 /D APR_DECLARE_STATIC /FD \n\n" . ".c.obj::\n" - . "\t\$(CL) -c \$*.c \$(CFLAGS) \$(INCLUDES)\n"; + . "\t\$(CL) -c \$< \$(CFLAGS) \$(INCLUDES)\n"; } if ($t =~ m|^ALL_LIBS=|) { $t = ""; diff --git a/test/testlock.c b/test/testlock.c index 6fdad2d4420..78e806fafe7 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -610,12 +610,12 @@ int main(int argc, const char * const *argv) rv, apr_strerror(rv, (char*)errmsg, 200)); exit(-3); } - + /* if ((rv = test_rw()) != APR_SUCCESS) { fprintf(stderr,"RW Lock test failed : [%d] %s\n", rv, apr_strerror(rv, (char*)errmsg, 200)); exit(-4); - } + }*/ if ((rv = test_thread_mutex()) != APR_SUCCESS) { fprintf(stderr,"thread_mutex test failed : [%d] %s\n", From 3537dde389ba16aede434dc3a0453c7d1900d300 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 15 Sep 2001 00:58:38 +0000 Subject: [PATCH 2328/7878] Implement read/write locks on Windows. This passes the tests in CVS, but I'm not 100% convinced they are correct. Could people with more Windows experience look these over. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62327 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/thread_rwlock.h | 5 ++++ locks/win32/thread_rwlock.c | 44 ++++++++++++++++++++++++++---- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/include/arch/win32/thread_rwlock.h b/include/arch/win32/thread_rwlock.h index db7ee73da0e..dc53f58977b 100644 --- a/include/arch/win32/thread_rwlock.h +++ b/include/arch/win32/thread_rwlock.h @@ -59,6 +59,11 @@ struct apr_thread_rwlock_t { apr_pool_t *pool; + HANDLE readevent; + HANDLE mutex; + HANDLE writemutex; + int counter; + int wrcounter; }; #endif /* THREAD_RWLOCK_H */ diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c index 4d875b5a776..49e1486d2bc 100644 --- a/locks/win32/thread_rwlock.c +++ b/locks/win32/thread_rwlock.c @@ -59,15 +59,35 @@ #include "win32/thread_rwlock.h" #include "apr_portable.h" +static apr_status_t thread_rwlock_cleanup(void *data) +{ + apr_thread_rwlock_t *rwlock = data; + CloseHandle(rwlock->readevent); + CloseHandle(rwlock->mutex); + CloseHandle(rwlock->writemutex); + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, apr_pool_t *pool) { - return APR_ENOTIMPL; + (*rwlock) = apr_palloc(pool, sizeof(**rwlock)); + (*rwlock)->readevent=CreateEvent(NULL,TRUE,FALSE,NULL); + (*rwlock)->mutex = CreateEvent(NULL,FALSE,TRUE,NULL); + (*rwlock)->writemutex = CreateMutex(NULL,FALSE,NULL); + (*rwlock)->counter = -1; + (*rwlock)->wrcounter = 0; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + if (InterlockedIncrement(&rwlock->counter) == 0) { + WaitForSingleObject(rwlock->mutex, INFINITE); + SetEvent(rwlock->readevent); + } + WaitForSingleObject(rwlock->readevent,INFINITE); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) @@ -77,7 +97,10 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwloc APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + WaitForSingleObject(rwlock->writemutex,INFINITE); + WaitForSingleObject(rwlock->mutex, INFINITE); + rwlock->wrcounter++; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) @@ -87,11 +110,22 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwloc APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + if (rwlock->wrcounter) { + /* If wrcounter is > 0, then we must have a writer lock */ + SetEvent(rwlock->mutex); + ReleaseMutex(rwlock->writemutex); + } + else { + if (InterlockedDecrement(&rwlock->counter) < 0) { + ResetEvent(rwlock->readevent); + SetEvent(rwlock->mutex); + } + } + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + return apr_pool_cleanup_run(rwlock->pool, rwlock, thread_rwlock_cleanup); } From 0d38da1c9c9b3dc31c6fcb0b6aa66af8e9604597 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 15 Sep 2001 01:00:48 +0000 Subject: [PATCH 2329/7878] I accidentally commented out this function in my last commit. This puts it back in, but it also makes a failure non-terminal. Read/write locks were not implemented for the old API on Windows, but they are using the new API, so this failure can't be terminal, because if it is, the new API isn't tested. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62328 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/testlock.c b/test/testlock.c index 78e806fafe7..1fa77369090 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -610,12 +610,11 @@ int main(int argc, const char * const *argv) rv, apr_strerror(rv, (char*)errmsg, 200)); exit(-3); } - /* + if ((rv = test_rw()) != APR_SUCCESS) { fprintf(stderr,"RW Lock test failed : [%d] %s\n", rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-4); - }*/ + } if ((rv = test_thread_mutex()) != APR_SUCCESS) { fprintf(stderr,"thread_mutex test failed : [%d] %s\n", From f362ee1a6bde731e72b374e4a0a1ef24e81b371b Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 15 Sep 2001 03:27:32 +0000 Subject: [PATCH 2330/7878] OS/2: Implement read/write locks. As there's no native equivalent in OS/2 I've hacked up an implementation using a mutex/event semaphore pair. Not heavily verified but passes a few tests I put it through. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62329 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/thread_rwlock.h | 3 + locks/os2/thread_rwlock.c | 153 +++++++++++++++++++++++++++++-- 2 files changed, 148 insertions(+), 8 deletions(-) diff --git a/include/arch/os2/thread_rwlock.h b/include/arch/os2/thread_rwlock.h index d8d153136d3..c959ffc09ac 100644 --- a/include/arch/os2/thread_rwlock.h +++ b/include/arch/os2/thread_rwlock.h @@ -60,6 +60,9 @@ struct apr_thread_rwlock_t { apr_pool_t *pool; + int readers; + HMTX write_lock; + HEV read_done; }; #endif /* THREAD_RWLOCK_H */ diff --git a/locks/os2/thread_rwlock.c b/locks/os2/thread_rwlock.c index e769f3f7fdd..59cc5639aee 100644 --- a/locks/os2/thread_rwlock.c +++ b/locks/os2/thread_rwlock.c @@ -60,39 +60,176 @@ #include "fileio.h" #include +static apr_status_t thread_rwlock_cleanup(void *therwlock) +{ + apr_thread_rwlock_t *rwlock = therwlock; + return apr_thread_rwlock_destroy(rwlock); +} + + + APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, apr_pool_t *pool) { - return APR_ENOTIMPL; + apr_thread_rwlock_t *new_rwlock; + ULONG rc; + + new_rwlock = (apr_thread_rwlock_t *)apr_palloc(pool, sizeof(apr_thread_rwlock_t)); + new_rwlock->pool = pool; + new_rwlock->readers = 0; + + rc = DosCreateMutexSem(NULL, &(new_rwlock->write_lock), 0, FALSE); + + if (rc) + return APR_FROM_OS_ERROR(rc); + + rc = DosCreateEventSem(NULL, &(new_rwlock->read_done), 0, FALSE); + + if (rc) + return APR_FROM_OS_ERROR(rc); + + *rwlock = new_rwlock; + + if (!rc) + apr_pool_cleanup_register(pool, new_rwlock, thread_rwlock_cleanup, + apr_pool_cleanup_null); + + return APR_FROM_OS_ERROR(rc); } + + APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + ULONG rc, posts; + + rc = DosRequestMutexSem(rwlock->write_lock, SEM_INDEFINITE_WAIT); + + if (rc) + return APR_FROM_OS_ERROR(rc); + + /* We've successfully acquired the writer mutex so we can't be locked + * for write which means it's ok to add a reader lock. The writer mutex + * doubles as race condition protection for the readers counter. + */ + rwlock->readers++; + DosResetEventSem(rwlock->read_done, &posts); + rc = DosReleaseMutexSem(rwlock->write_lock); + return APR_FROM_OS_ERROR(rc); } + + APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + /* As above but with different wait time */ + ULONG rc, posts; + + rc = DosRequestMutexSem(rwlock->write_lock, SEM_IMMEDIATE_RETURN); + + if (rc) + return APR_FROM_OS_ERROR(rc); + + rwlock->readers++; + DosResetEventSem(rwlock->read_done, &posts); + rc = DosReleaseMutexSem(rwlock->write_lock); + return APR_FROM_OS_ERROR(rc); } + + APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + ULONG rc; + + rc = DosRequestMutexSem(rwlock->write_lock, SEM_INDEFINITE_WAIT); + + if (rc) + return APR_FROM_OS_ERROR(rc); + + /* We've got the writer lock but we have to wait for all readers to + * unlock before it's ok to use it + */ + + if (rwlock->readers) { + rc = DosWaitEventSem(rwlock->read_done, SEM_INDEFINITE_WAIT); + + if (rc) + DosReleaseMutexSem(rwlock->write_lock); + } + + return APR_FROM_OS_ERROR(rc); } + + APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + ULONG rc; + + rc = DosRequestMutexSem(rwlock->write_lock, SEM_IMMEDIATE_RETURN); + + if (rc) + return APR_FROM_OS_ERROR(rc); + + /* We've got the writer lock but we have to wait for all readers to + * unlock before it's ok to use it + */ + + if (rwlock->readers) { + /* There are readers active, give up */ + DosReleaseMutexSem(rwlock->write_lock); + rc = ERROR_TIMEOUT; + } + + return APR_FROM_OS_ERROR(rc); } + + APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + ULONG rc; + + /* First, guess that we're unlocking a writer */ + rc = DosReleaseMutexSem(rwlock->write_lock); + + if (rc == ERROR_NOT_OWNER) { + /* Nope, we must have a read lock */ + if (rwlock->readers) { + DosEnterCritSec(); + rwlock->readers--; + + if (rwlock->readers == 0) { + DosPostEventSem(rwlock->read_done); + } + + DosExitCritSec(); + rc = 0; + } + } + + return APR_FROM_OS_ERROR(rc); } + + APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; -} + ULONG rc; + + if (rwlock->write_lock == 0) + return APR_SUCCESS; + + while (DosReleaseMutexSem(rwlock->write_lock) == 0); + rc = DosCloseMutexSem(rwlock->write_lock); + + if (!rc) { + rwlock->write_lock = 0; + DosCloseEventSem(rwlock->read_done); + return APR_SUCCESS; + } + + return APR_FROM_OS_ERROR(rc); +} From 84d9b5e48e0da3646ec85e4cd4095b1a16a6885b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 15 Sep 2001 05:23:55 +0000 Subject: [PATCH 2331/7878] Protect including a header file that doesn't exist on Windows git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62330 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlockperf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/testlockperf.c b/test/testlockperf.c index a008fd0d498..488706eefe6 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -64,7 +64,9 @@ #include #include #include "test_apr.h" +#ifdef HAVE_SYS_TIME_h #include /* replace me with apr_time.h */ +#endif #if !APR_HAS_THREADS int main(void) From 8470a226ebddd04eed5973a20baae272e9de7555 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 15 Sep 2001 05:25:42 +0000 Subject: [PATCH 2332/7878] We have to decrement the writer count, or we will never be able to get a second writer git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62331 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/thread_rwlock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c index 49e1486d2bc..3c772553f95 100644 --- a/locks/win32/thread_rwlock.c +++ b/locks/win32/thread_rwlock.c @@ -112,6 +112,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) { if (rwlock->wrcounter) { /* If wrcounter is > 0, then we must have a writer lock */ + rwlock->wrcounter--; SetEvent(rwlock->mutex); ReleaseMutex(rwlock->writemutex); } From 81167df82761e07ecddfcc1690f19a7b145d14bb Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sun, 16 Sep 2001 00:10:50 +0000 Subject: [PATCH 2333/7878] don't need this header anymore at all, it was just a leftover Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62332 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlockperf.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/testlockperf.c b/test/testlockperf.c index 488706eefe6..0121f827218 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -64,9 +64,6 @@ #include #include #include "test_apr.h" -#ifdef HAVE_SYS_TIME_h -#include /* replace me with apr_time.h */ -#endif #if !APR_HAS_THREADS int main(void) From b17f18eadd1179de220e51e92da22308b93164cc Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 16 Sep 2001 17:15:39 +0000 Subject: [PATCH 2334/7878] That fourth test is the rwlock test not the mutex test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62333 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlockperf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testlockperf.c b/test/testlockperf.c index 0121f827218..a35175c97f3 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -302,8 +302,8 @@ int test_thread_rwlock(void) mutex_counter = 0; - printf("apr_thread_mutex_t Tests\n"); - printf("%-60s", " Initializing the apr_thread_mutex_t"); + printf("apr_thread_rwlock_t Tests\n"); + printf("%-60s", " Initializing the apr_thread_rwlock_t"); s1 = apr_thread_rwlock_create(&thread_rwlock, pool); if (s1 != APR_SUCCESS) { printf("Failed!\n"); From 6077fbab669f6d0e5a6449594510e4cca38df8bb Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sun, 16 Sep 2001 21:11:11 +0000 Subject: [PATCH 2335/7878] Doxygen fixes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62334 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_compat.h | 2 +- include/apr_thread_rwlock.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_compat.h b/include/apr_compat.h index 93f8b20a201..366c0cd5385 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -101,7 +101,7 @@ /** @deprecated @see apr_dso_error */ #define ap_os_dso_error apr_dso_error /** @deprecated @see apr_filepath_merge - * @tip apr_filepath_merge rejects invalid filenames */ + * @warning apr_filepath_merge rejects invalid filenames */ #define ap_os_is_filename_valid apr_filepath_merge /** @deprecated @see apr_proc_kill */ #define ap_os_kill apr_proc_kill diff --git a/include/apr_thread_rwlock.h b/include/apr_thread_rwlock.h index d43a13e31dd..176b9421b74 100644 --- a/include/apr_thread_rwlock.h +++ b/include/apr_thread_rwlock.h @@ -66,7 +66,7 @@ extern "C" { #if APR_HAS_THREADS /** - * @file apr_lock.h + * @file apr_thread_rwlock.h * @brief APR Thread RWLock Routines */ From 82ada76fd0320e2cee077376973593003cfead16 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 17 Sep 2001 17:31:35 +0000 Subject: [PATCH 2336/7878] When rbb's implementation is committed, make win32 ready for thread_cond.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62335 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++++ libapr.dsp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apr.dsp b/apr.dsp index c40355210b0..defa7c3d221 100644 --- a/apr.dsp +++ b/apr.dsp @@ -166,6 +166,10 @@ SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File +SOURCE=.\locks\win32\thread_cond.c +# End Source File +# Begin Source File + SOURCE=.\locks\win32\thread_mutex.c # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index a6680fad7a6..cc6259668a9 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -172,6 +172,10 @@ SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File +SOURCE=.\locks\win32\thread_cond.c +# End Source File +# Begin Source File + SOURCE=.\locks\win32\thread_mutex.c # End Source File # Begin Source File From 372aa197b1d426a27e2df86092c6064b0fd68f44 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 17 Sep 2001 20:00:07 +0000 Subject: [PATCH 2337/7878] Fix two odd bits of breakage. Don't you just -love- casts? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62336 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 8 ++++++-- threadproc/win32/proc.c | 43 +++++++++++++++++++++++++++-------------- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 7fd92d53ce9..58934046131 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1466,11 +1466,15 @@ static void free_proc_chain(struct process_chain *procs) } #ifdef WIN32 /* - * Do we need an APR function to clean-up a proc_t? + * XXX: Do we need an APR function to clean-up a proc_t? + * Well ... yeah ... but we can't since it's scope is ill defined. */ { for (p = procs; p; p = p->next) { - CloseHandle((HANDLE)p->pid->pid); + if (p->pid->hproc) { + CloseHandle(p->pid->hproc); + p->pid->hproc = NULL; + } } } #endif /* WIN32 */ diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 322f2603c89..99fbf800f3f 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -355,8 +355,19 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, else if (strchr(shellcmd, ' ')) shellcmd = apr_pstrcat(cont, "\"", shellcmd, "\"", NULL); cmdline = apr_pstrcat(cont, shellcmd, " /C \"", cmdline, "\"", NULL); + } + else { + /* Win32 is _different_ than unix. While unix will find the given + * program since it's already chdir'ed, Win32 cannot since the parent + * attempts to open the program with it's own path. + * ###: This solution isn't much better - it may defeat path searching + * when the path search was desired. Open to further discussion. + */ + apr_filepath_merge(&progname, attr->currdir, progname, + APR_FILEPATH_NATIVE, cont); } + if (!env) pEnvBlock = NULL; else { @@ -420,27 +431,29 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (os_level >= APR_WIN_NT) { STARTUPINFOW si; - apr_wchar_t wprg[APR_PATH_MAX]; + apr_size_t nprg = strlen(progname) + 1; + apr_size_t nwprg = nprg + 6; + apr_wchar_t *wprg = apr_palloc(cont, nwprg * sizeof(wprg[0])); apr_size_t ncmd = strlen(cmdline) + 1, nwcmd = ncmd; + apr_wchar_t *wcmd = apr_palloc(cont, nwcmd * sizeof(wcmd[0])); apr_size_t ncwd = 0, nwcwd = 0; - apr_wchar_t *wcmd = apr_palloc(cont, ncmd * sizeof(wcmd[0])); apr_wchar_t *wcwd = NULL; + if (((rv = utf8_to_unicode_path(wprg, nwprg, progname)) + != APR_SUCCESS) + || ((rv = conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd)) + != APR_SUCCESS)) { + return rv; + } + if (attr->currdir) { ncwd = nwcwd = strlen(attr->currdir) + 1; wcwd = apr_palloc(cont, ncwd * sizeof(wcwd[0])); - } - - if (((rv = utf8_to_unicode_path(wprg, sizeof(wprg)/sizeof(wprg[0]), - progname)) - != APR_SUCCESS) - || ((rv = conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd)) - != APR_SUCCESS) - || (attr->currdir && - (rv = conv_utf8_to_ucs2(attr->currdir, &ncwd, wcwd, &nwcwd)) - != APR_SUCCESS)) { - return rv; + if ((rv = conv_utf8_to_ucs2(attr->currdir, &ncwd, wcwd, &nwcwd)) + != APR_SUCCESS) { + return rv; + } } memset(&si, 0, sizeof(si)); @@ -462,12 +475,12 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, si.hStdError = attr->child_err->filehand; } - rv = CreateProcessW(wprg, wcmd, /* Command line */ + rv = CreateProcessW(wprg, wcmd, /* Executable & Command line */ NULL, NULL, /* Proc & thread security attributes */ TRUE, /* Inherit handles */ dwCreationFlags, /* Creation flags */ pEnvBlock, /* Environment block */ - wcwd, /* Current directory name */ + wcwd, /* Current directory name */ &si, &pi); } else { From 6a11fca49e653396020d62b86be0b78209745971 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 17 Sep 2001 20:02:34 +0000 Subject: [PATCH 2338/7878] Clean up an emit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62337 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 99fbf800f3f..31fec7fba83 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -363,8 +363,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * ###: This solution isn't much better - it may defeat path searching * when the path search was desired. Open to further discussion. */ - apr_filepath_merge(&progname, attr->currdir, progname, + char *progpath; + apr_filepath_merge(&progpath, attr->currdir, progname, APR_FILEPATH_NATIVE, cont); + progname = progpath; } From d182eef6e04bd896dcc5568c252f3ce8d07dd75b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 17 Sep 2001 20:12:23 +0000 Subject: [PATCH 2339/7878] Whoops - we want that hproc just a little while longer. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62338 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 58934046131..6abdd502b0f 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1464,10 +1464,18 @@ static void free_proc_chain(struct process_chain *procs) apr_proc_kill(p->pid, SIGKILL); } } + /* Now wait for all the signaled processes to die */ + for (p = procs; p; p = p->next) { + if (p->kill_how != kill_never) { + (void) apr_proc_wait(p->pid, APR_WAIT); + } + } #ifdef WIN32 /* * XXX: Do we need an APR function to clean-up a proc_t? * Well ... yeah ... but we can't since it's scope is ill defined. + * We can't dismiss the handle until the apr_proc_wait above is + * finished with the proc_t. */ { for (p = procs; p; p = p->next) { @@ -1479,11 +1487,5 @@ static void free_proc_chain(struct process_chain *procs) } #endif /* WIN32 */ - /* Now wait for all the signaled processes to die */ - for (p = procs; p; p = p->next) { - if (p->kill_how != kill_never) { - (void) apr_proc_wait(p->pid, APR_WAIT); - } - } } From b7f108e3552dee6d83cb73e8d8748a4709b5f9ee Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 17 Sep 2001 21:24:29 +0000 Subject: [PATCH 2340/7878] Eliminate the //?/ paths altogether from proc_create. This simply isn't that good an idea, too many user apps expect d:\ or \\mach\share\ from the args and GetModuleName calls (the later returns the true name as given by 'progname'.) Safer to simply ignore these. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62339 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 31fec7fba83..8a7848228a9 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -441,7 +441,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_size_t ncwd = 0, nwcwd = 0; apr_wchar_t *wcwd = NULL; - if (((rv = utf8_to_unicode_path(wprg, nwprg, progname)) + if (((rv = conv_utf8_to_ucs2(progname, &nprg, wprg, &nwprg)) != APR_SUCCESS) || ((rv = conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd)) != APR_SUCCESS)) { From 08717f670a504fe46749d3d1e74c2537ce6bc4eb Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 18 Sep 2001 21:38:03 +0000 Subject: [PATCH 2341/7878] An initial thread_condition variable implementation for Windows. This is kind of ugly, but I believe it works. It does pass all of the APR tests, and I don't see any race conditions, but other eyes are more than welcome on this code now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62340 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/thread_cond.h | 5 +++ locks/win32/thread_cond.c | 73 +++++++++++++++++++++++++++++--- 2 files changed, 73 insertions(+), 5 deletions(-) diff --git a/include/arch/win32/thread_cond.h b/include/arch/win32/thread_cond.h index 95c83cccdad..b0505044ca0 100644 --- a/include/arch/win32/thread_cond.h +++ b/include/arch/win32/thread_cond.h @@ -59,6 +59,11 @@ struct apr_thread_cond_t { apr_pool_t *pool; + HANDLE event; + HANDLE mutex; + int signal_all; + int num_waiting; + int signalled; }; #endif /* THREAD_COND_H */ diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index 3010df650c9..a1e6e01854f 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -60,29 +60,92 @@ #include "win32/thread_cond.h" #include "apr_portable.h" +static apr_status_t thread_cond_cleanup(void *data) +{ + apr_thread_cond_t *cond = data; + if (cond->num_waiting != 0) { + printf("somebody's waiting, but I'm closing it anyway.\n"); + } + CloseHandle(cond->mutex); + CloseHandle(cond->event); + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, apr_pool_t *pool) { - return APR_ENOTIMPL; + *cond = apr_palloc(pool, sizeof(**cond)); + (*cond)->pool = pool; + (*cond)->event = CreateEvent(NULL, TRUE, FALSE, NULL); + (*cond)->mutex = CreateMutex(NULL, FALSE, NULL); + (*cond)->signal_all = 0; + (*cond)->num_waiting = 0; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + DWORD rv; + + while (1) { + WaitForSingleObject(cond->mutex, INFINITE); + cond->num_waiting++; + ReleaseMutex(cond->mutex); + + apr_thread_mutex_unlock(mutex); + rv = WaitForSingleObject(cond->event, INFINITE); + cond->num_waiting--; + if (rv == WAIT_FAILED) { + return apr_get_os_error(); + } + if (cond->signal_all) { + if (cond->num_waiting == 0) { + ResetEvent(cond->event); + } + break; + } + if (cond->signalled) { + cond->signalled = 0; + ResetEvent(cond->event); + break; + } + ReleaseMutex(cond->mutex); + } + apr_thread_mutex_lock(mutex); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) { - return APR_ENOTIMPL; + DWORD rv; + + WaitForSingleObject(cond->mutex, INFINITE); + cond->signalled = 1; + rv = SetEvent(cond->event); + ReleaseMutex(cond->mutex); + if (rv == 0) { + return apr_get_os_error(); + } + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) { - return APR_ENOTIMPL; + DWORD rv; + + WaitForSingleObject(cond->mutex, INFINITE); + cond->signalled = 1; + cond->signal_all = 1; + rv = SetEvent(cond->event); + ReleaseMutex(cond->mutex); + if (rv == 0) { + return apr_get_os_error(); + } + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) { - return APR_ENOTIMPL; + return apr_pool_cleanup_run(cond->pool, cond, thread_cond_cleanup); } From dd3b33b95a99789a0a626975c3d35708196c68fd Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 18 Sep 2001 21:40:24 +0000 Subject: [PATCH 2342/7878] Forgot this CHANGES entry. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62341 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index b161e4ced4f..2df10e088bb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Add condition variables for Windows. + *) Add condition variables to the APR set of locking functions. This does Unix, and provides stubs for all other platforms. [Aaron Bannert ] From 4ab09251d33121399e45220c88bdc79e158a0147 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 19 Sep 2001 15:09:16 +0000 Subject: [PATCH 2343/7878] Remove some debugging logic that I forgot about. Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62342 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/thread_cond.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index a1e6e01854f..d2e45e8df09 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -63,9 +63,6 @@ static apr_status_t thread_cond_cleanup(void *data) { apr_thread_cond_t *cond = data; - if (cond->num_waiting != 0) { - printf("somebody's waiting, but I'm closing it anyway.\n"); - } CloseHandle(cond->mutex); CloseHandle(cond->event); return APR_SUCCESS; From c8fab584db6328e0dfb42d1f680cd8bf3d0a90be Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 19 Sep 2001 15:09:41 +0000 Subject: [PATCH 2344/7878] Add my name to this CHANGES entry git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62343 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 2df10e088bb..b63da7274d2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,6 @@ Changes with APR b1 - *) Add condition variables for Windows. + *) Add condition variables for Windows. [Ryan Bloom] *) Add condition variables to the APR set of locking functions. This does Unix, and provides stubs for all other platforms. From a44314b671456c965f046130ae2392f9b9810d2a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 19 Sep 2001 15:27:16 +0000 Subject: [PATCH 2345/7878] With the new locking API, this issue is solved. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62344 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/STATUS b/STATUS index f95f96eacd7..e46384e5b20 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/09/11 01:06:13 $] +Last modified at [$Date: 2001/09/19 15:27:16 $] Release: @@ -84,19 +84,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Status: Greg +1 (volunteers) - * apr_create_lock() changes: - - It ignores the "type" parameter, so toss it. - - The fname param is allowed to be NULL on the Unix platform. - Change it to always use the passed value, and check callers. - rbb says: The type parameter is supposed to be used to determine - if we are working with a read/write lock or a mutex. - The fname parameter is essentially required if you - want to be portable, but I dislike wasting cycles to - outsmart the programmer. - Justin says: The type parameter is now used. - Status: david +1 - rbb -1 - * configure.in does post-processing on the AC_OUTPUT files (for VPATH support). This means that config.status doesn't do the right thing when you re-run it. We ought to revamp the makefiles From a935b07c8565af033bee9e41a3168181b39a1490 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 19 Sep 2001 16:01:39 +0000 Subject: [PATCH 2346/7878] OS/2: Fix value of protection field so that it matches the definitions in apr_file_info.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62345 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filestat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 4c67bdbecb7..e8d6eef54b3 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -63,7 +63,7 @@ static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus) { - finfo->protection = (fstatus->attrFile & FILE_READONLY) ? 0555 : 0777; + finfo->protection = (fstatus->attrFile & FILE_READONLY) ? 0x555 : 0x777; if (fstatus->attrFile & FILE_DIRECTORY) finfo->filetype = APR_DIR; From 05a7fceafaf2e5d8cdbf5ea0e77e6944389cefc3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Sep 2001 18:43:51 +0000 Subject: [PATCH 2347/7878] As pointed out by Mladen Turk , the Win9x case never fixed the rv from apr_dso_load. Here's the leanest fix, along with assuring we have the pool context, even if all we return is an error result. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62346 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index e9775766c79..8d647074042 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -119,16 +119,18 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, os_handle = LoadLibraryEx(path, NULL, 0); if (!os_handle) rv = apr_get_os_error(); + else + rv = APR_SUCCESS; SetErrorMode(em); } *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); + (*res_handle)->cont = ctx; if (rv) { return ((*res_handle)->load_error = rv); } (*res_handle)->handle = (void*)os_handle; - (*res_handle)->cont = ctx; (*res_handle)->load_error = APR_SUCCESS; apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); From 2888b0db3d874b95578623098cacb6f4e2bcd543 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 19 Sep 2001 20:06:44 +0000 Subject: [PATCH 2348/7878] New process locking API for APR. Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62347 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_proc_mutex.h | 165 ++++++ include/arch/beos/proc_mutex.h | 71 +++ include/arch/netware/proc_mutex.h | 66 +++ include/arch/os2/proc_mutex.h | 66 +++ include/arch/unix/locks.h | 10 +- include/arch/unix/proc_mutex.h | 165 ++++++ include/arch/win32/proc_mutex.h | 65 +++ locks/beos/Makefile.in | 3 +- locks/beos/proc_mutex.c | 104 ++++ locks/netware/proc_mutex.c | 103 ++++ locks/os2/Makefile.in | 3 +- locks/os2/proc_mutex.c | 104 ++++ locks/unix/Makefile.in | 3 +- locks/unix/proc_mutex.c | 799 ++++++++++++++++++++++++++++++ locks/win32/proc_mutex.c | 103 ++++ 15 files changed, 1818 insertions(+), 12 deletions(-) create mode 100644 include/apr_proc_mutex.h create mode 100644 include/arch/beos/proc_mutex.h create mode 100644 include/arch/netware/proc_mutex.h create mode 100644 include/arch/os2/proc_mutex.h create mode 100644 include/arch/unix/proc_mutex.h create mode 100644 include/arch/win32/proc_mutex.h create mode 100644 locks/beos/proc_mutex.c create mode 100644 locks/netware/proc_mutex.c create mode 100644 locks/os2/proc_mutex.c create mode 100644 locks/unix/proc_mutex.c create mode 100644 locks/win32/proc_mutex.c diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h new file mode 100644 index 00000000000..b4d522dcba6 --- /dev/null +++ b/include/apr_proc_mutex.h @@ -0,0 +1,165 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_PROC_MUTEX_H +#define APR_PROC_MUTEX_H + +#include "apr.h" +#include "apr_lock.h" /* only for apr_lockmech_e_np */ +#include "apr_pools.h" +#include "apr_errno.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @file apr_proc_mutex.h + * @brief APR Process Locking Routines + */ + +/** + * @defgroup APR_ProcMutex Process Locking Routines + * @ingroup APR + * @{ + */ + +typedef struct apr_proc_mutex_t apr_proc_mutex_t; + +/* Function definitions */ + +/** + * Create and initialize a mutex that can be used to synchronize processes. + * @param mutex the memory address where the newly created mutex will be + * stored. + * @param fname A file name to use if the lock mechanism requires one. This + * argument should always be provided. The lock code itself will + * determine if it should be used. + * @param pool the pool from which to allocate the mutex. + */ +APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, + const char *fname, + apr_pool_t *pool); + +/** + * non-portable interface to apr_proc_mutex_create() + * + * Create and initialize a mutex that can be used to synchronize processes. + * @param mutex the memory address where the newly created mutex will be + * stored. + * @param fname A file name to use if the lock mechanism requires one. This + * argument should always be provided. The lock code itself will + * determine if it should be used. + * @param mech The mechanism to use for the interprocess lock, if any; one of + *
    + *            APR_LOCK_FCNTL
    + *            APR_LOCK_FLOCK
    + *            APR_LOCK_SYSVSEM
    + *            APR_LOCK_PROC_PTHREAD
    + *            APR_LOCK_DEFAULT     pick the default mechanism for the platform
    + * 
    + * @param pool the pool from which to allocate the mutex. + */ +APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, + const char *fname, + apr_lockmech_e_np mech, + apr_pool_t *pool); +/** + * Re-open a mutex in a child process. + * @param mutex The newly re-opened mutex structure. + * @param fname A file name to use if the mutex mechanism requires one. This + * argument should always be provided. The mutex code itself will + * determine if it should be used. This filename should be the + * same one that was passed to apr_proc_mutex_create(). + * @param pool The pool to operate on. + * @remark This function must be called to maintain portability, even + * if the underlying lock mechanism does not require it. + */ +APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, + const char *fname, + apr_pool_t *pool); + +/** + * Acquire the lock for the given mutex. If the mutex is already locked, + * the current thread will be put to sleep until the lock becomes available. + * @param mutex the mutex on which to acquire the lock. + */ +APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex); + +/** + * Attempt to acquire the lock for the given mutex. If the mutex has already + * been acquired, the call returns immediately with APR_EBUSY. Note: it + * is important that the APR_STATUS_IS_EBUSY(s) macro be used to determine + * if the return value was APR_EBUSY, for portability reasons. + * @param mutex the mutex on which to attempt the lock acquiring. + */ +APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex); + +/** + * Release the lock for the given mutex. + * @param mutex the mutex from which to release the lock. + */ +APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex); + +/** + * Destroy the mutex and free the memory associated with the lock. + * @param mutex the mutex to destroy. + */ +APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex); + +#ifdef __cplusplus +} +#endif + +#endif /* ! APR_PROC_MUTEX_H */ diff --git a/include/arch/beos/proc_mutex.h b/include/arch/beos/proc_mutex.h new file mode 100644 index 00000000000..104aa43bfc6 --- /dev/null +++ b/include/arch/beos/proc_mutex.h @@ -0,0 +1,71 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef PROC_MUTEX_H +#define PROC_MUTEX_H + +#include +#include "apr_pools.h" +#include "apr_proc_mutex.h" +#include "apr_file_io.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_portable.h" + +struct apr_proc_mutex_t { + apr_pool_t *pool; +}; + +#endif /* PROC_MUTEX_H */ + diff --git a/include/arch/netware/proc_mutex.h b/include/arch/netware/proc_mutex.h new file mode 100644 index 00000000000..9fbb808b4be --- /dev/null +++ b/include/arch/netware/proc_mutex.h @@ -0,0 +1,66 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef PROC_MUTEX_H +#define PROC_MUTEX_H + +#include "apr_proc_mutex.h" +#include + +struct apr_proc_mutex_t { + apr_pool_t *pool; +}; + +#endif /* PROC_MUTEX_H */ + diff --git a/include/arch/os2/proc_mutex.h b/include/arch/os2/proc_mutex.h new file mode 100644 index 00000000000..a30813cc66a --- /dev/null +++ b/include/arch/os2/proc_mutex.h @@ -0,0 +1,66 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef PROC_MUTEX_H +#define PROC_MUTEX_H + +#include "apr_proc_mutex.h" +#include "apr_file_io.h" + +struct apr_proc_mutex_t { + apr_pool_t *pool; +}; + +#endif /* PROC_MUTEX_H */ + diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index ed4fe1f9a71..c83e8d09c62 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -62,6 +62,7 @@ #include "apr_lock.h" #include "apr_sms.h" #include "apr_portable.h" +#include "proc_mutex.h" /* System headers required by Locks library */ #if APR_HAVE_SYS_TYPES_H @@ -129,15 +130,6 @@ extern const apr_unix_lock_methods_t apr_unix_proc_pthread_methods; extern const apr_unix_lock_methods_t apr_unix_rwlock_methods; #endif -#if !APR_HAVE_UNION_SEMUN && defined(APR_HAS_SYSVSEM_SERIALIZE) -/* it makes no sense, but this isn't defined on solaris */ -union semun { - long val; - struct semid_ds *buf; - ushort *array; -}; -#endif - struct apr_lock_t { apr_pool_t *pool; const apr_unix_lock_methods_t *meth; diff --git a/include/arch/unix/proc_mutex.h b/include/arch/unix/proc_mutex.h new file mode 100644 index 00000000000..cff88145aa0 --- /dev/null +++ b/include/arch/unix/proc_mutex.h @@ -0,0 +1,165 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef PROC_MUTEX_H +#define PROC_MUTEX_H + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_proc_mutex.h" +#include "apr_pools.h" +#include "apr_portable.h" + +/* System headers required by Locks library */ +#if APR_HAVE_SYS_TYPES_H +#include +#endif +#if APR_HAVE_STDIO_H +#include +#endif +#if APR_HAVE_FCNTL_H +#include +#endif + +#ifdef HAVE_SYS_SEM_H +#include +#endif +#ifdef HAVE_SYS_FILE_H +#include +#endif +#if APR_HAVE_STDLIB_H +#include +#endif +#if APR_HAVE_UNISTD_H +#include +#endif +#if APR_HAVE_STRING_H +#include +#endif +#ifdef HAVE_SYS_MMAN_H +#include +#endif +#if APR_HAVE_PTHREAD_H +#include +#endif +/* End System Headers */ + +struct apr_proc_mutex_unix_lock_methods_t { + unsigned int flags; + apr_status_t (*create)(apr_proc_mutex_t *, const char *); + apr_status_t (*acquire)(apr_proc_mutex_t *); + apr_status_t (*tryacquire)(apr_proc_mutex_t *); + apr_status_t (*release)(apr_proc_mutex_t *); + apr_status_t (*destroy)(apr_proc_mutex_t *); + apr_status_t (*child_init)(apr_proc_mutex_t **, apr_pool_t *, const char *); +}; +typedef struct apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_lock_methods_t; + +/* bit values for flags field in apr_unix_lock_methods_t */ +#define APR_PROCESS_LOCK_MECH_IS_GLOBAL 1 + +#if APR_HAS_SYSVSEM_SERIALIZE +extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods; +#endif +#if APR_HAS_FCNTL_SERIALIZE +extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods; +#endif +#if APR_HAS_FLOCK_SERIALIZE +extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_flock_methods; +#endif +#if APR_HAS_PROC_PTHREAD_SERIALIZE +extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_proc_pthread_methods; +#endif +#if APR_HAS_RWLOCK_SERIALIZE +extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_rwlock_methods; +#endif + + +#if !APR_HAVE_UNION_SEMUN && defined(APR_HAS_SYSVSEM_SERIALIZE) +/* it makes no sense, but this isn't defined on solaris */ +union semun { + long val; + struct semid_ds *buf; + ushort *array; +}; +#endif + +struct apr_proc_mutex_t { + apr_pool_t *pool; + const apr_proc_mutex_unix_lock_methods_t *meth; + const apr_proc_mutex_unix_lock_methods_t *inter_meth; + apr_lockscope_e scope; + int curr_locked; + char *fname; +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE + int interproc; +#endif +#if APR_HAS_PROC_PTHREAD_SERIALIZE + pthread_mutex_t *pthread_interproc; +#endif +#if APR_HAS_THREADS + /* APR doesn't have threads, no sense in having a thread lock mechanism. + */ + + apr_os_thread_t owner; + int owner_ref; +#endif +}; + +void apr_proc_mutex_unix_setup_lock(void); + +#endif /* PROC_MUTEX_H */ + diff --git a/include/arch/win32/proc_mutex.h b/include/arch/win32/proc_mutex.h new file mode 100644 index 00000000000..3e1bc42cc92 --- /dev/null +++ b/include/arch/win32/proc_mutex.h @@ -0,0 +1,65 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef PROC_MUTEX_H +#define PROC_MUTEX_H + +#include "apr_proc_mutex.h" + +struct apr_proc_mutex_t { + apr_pool_t *pool; +}; + +#endif /* PROC_MUTEX_H */ + diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in index e7751a9346c..634eb747424 100644 --- a/locks/beos/Makefile.in +++ b/locks/beos/Makefile.in @@ -2,7 +2,8 @@ TARGETS = locks.lo \ thread_mutex.lo \ thread_rwlock.lo \ - thread_cond.lo + thread_cond.lo \ + proc_mutex.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c new file mode 100644 index 00000000000..3bff70b742f --- /dev/null +++ b/locks/beos/proc_mutex.c @@ -0,0 +1,104 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/*Read/Write locking implementation based on the MultiLock code from + * Stephen Beaulieu + */ + +#include "beos/proc_mutex.h" +#include "apr_strings.h" +#include "apr_portable.h" + +APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, + const char *fname, + apr_lockmech_e_np mech, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c new file mode 100644 index 00000000000..9cff0f72fcd --- /dev/null +++ b/locks/netware/proc_mutex.c @@ -0,0 +1,103 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_strings.h" +#include "proc_mutex.h" +#include "apr_portable.h" + +APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, + const char *fname, + apr_lockmech_e_np mech, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + diff --git a/locks/os2/Makefile.in b/locks/os2/Makefile.in index 89fbbf0e284..8d5515014b5 100644 --- a/locks/os2/Makefile.in +++ b/locks/os2/Makefile.in @@ -2,7 +2,8 @@ TARGETS = locks.lo \ thread_mutex.lo \ thread_rwlock.lo \ - thread_cond.lo + thread_cond.lo \ + proc_mutex.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c new file mode 100644 index 00000000000..8cf331bdbf0 --- /dev/null +++ b/locks/os2/proc_mutex.c @@ -0,0 +1,104 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include "apr_portable.h" +#include "proc_mutex.h" +#include "fileio.h" +#include + +APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, + const char *fname, + apr_lockmech_e_np mech, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index 81820f0d5a5..9206e4b483e 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -5,7 +5,8 @@ TARGETS = \ intraproc.lo \ thread_mutex.lo \ thread_rwlock.lo \ - thread_cond.lo + thread_cond.lo \ + proc_mutex.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c new file mode 100644 index 00000000000..364043c91e6 --- /dev/null +++ b/locks/unix/proc_mutex.c @@ -0,0 +1,799 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_strings.h" +#include "proc_mutex.h" +#include "fileio.h" /* for apr_mkstemp() */ + +#if APR_HAS_SYSVSEM_SERIALIZE + +static struct sembuf proc_mutex_op_on; +static struct sembuf proc_mutex_op_off; + +static void proc_mutex_sysv_setup(void) +{ + proc_mutex_op_on.sem_num = 0; + proc_mutex_op_on.sem_op = -1; + proc_mutex_op_on.sem_flg = SEM_UNDO; + proc_mutex_op_off.sem_num = 0; + proc_mutex_op_off.sem_op = 1; + proc_mutex_op_off.sem_flg = SEM_UNDO; +} + +static apr_status_t proc_mutex_sysv_cleanup(void *mutex_) +{ + apr_proc_mutex_t *mutex=mutex_; + union semun ick; + + if (mutex->interproc != -1) { + ick.val = 0; + semctl(mutex->interproc, 0, IPC_RMID, ick); + } + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_sysv_create(apr_proc_mutex_t *new_mutex, + const char *fname) +{ + union semun ick; + apr_status_t stat; + + new_mutex->interproc = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600); + + if (new_mutex->interproc < 0) { + stat = errno; + proc_mutex_sysv_cleanup(new_mutex); + return stat; + } + ick.val = 1; + if (semctl(new_mutex->interproc, 0, SETVAL, ick) < 0) { + stat = errno; + proc_mutex_sysv_cleanup(new_mutex); + return stat; + } + new_mutex->curr_locked = 0; + apr_pool_cleanup_register(new_mutex->pool, + (void *)new_mutex, proc_mutex_sysv_cleanup, + apr_pool_cleanup_null); + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_sysv_acquire(apr_proc_mutex_t *mutex) +{ + int rc; + + do { + rc = semop(mutex->interproc, &proc_mutex_op_on, 1); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { + return errno; + } + mutex->curr_locked = 1; + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex) +{ + int rc; + + do { + rc = semop(mutex->interproc, &proc_mutex_op_off, 1); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { + return errno; + } + mutex->curr_locked = 0; + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_sysv_destroy(apr_proc_mutex_t *mutex) +{ + apr_status_t stat; + + if ((stat = proc_mutex_sysv_cleanup(mutex)) == APR_SUCCESS) { + apr_pool_cleanup_kill(mutex->pool, mutex, proc_mutex_sysv_cleanup); + return APR_SUCCESS; + } + return stat; +} + +static apr_status_t proc_mutex_sysv_child_init(apr_proc_mutex_t **mutex, apr_pool_t *cont, const char *fname) +{ + return APR_SUCCESS; +} + +const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods = +{ +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS + APR_PROCESS_LOCK_MECH_IS_GLOBAL, +#else + 0, +#endif + proc_mutex_sysv_create, + proc_mutex_sysv_acquire, + NULL, /* no tryacquire */ + proc_mutex_sysv_release, + proc_mutex_sysv_destroy, + proc_mutex_sysv_child_init +}; + +#endif /* SysV sem implementation */ + +#if APR_HAS_PROC_PTHREAD_SERIALIZE + +static void proc_mutex_proc_pthread_setup(void) +{ +} + +static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_) +{ + apr_proc_mutex_t *mutex=mutex_; + apr_status_t stat; + + if (mutex->curr_locked == 1) { + if ((stat = pthread_mutex_unlock(mutex->pthread_interproc))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + return stat; + } + if (munmap((caddr_t)mutex->pthread_interproc, sizeof(pthread_mutex_t))){ + return errno; + } + } + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, + const char *fname) +{ + apr_status_t stat; + int fd; + pthread_mutexattr_t mattr; + + fd = open("/dev/zero", O_RDWR); + if (fd < 0) { + return errno; + } + + new_mutex->pthread_interproc = (pthread_mutex_t *)mmap( + (caddr_t) 0, + sizeof(pthread_mutex_t), + PROT_READ | PROT_WRITE, MAP_SHARED, + fd, 0); + if (new_mutex->pthread_interproc == (pthread_mutex_t *) (caddr_t) -1) { + return errno; + } + close(fd); + if ((stat = pthread_mutexattr_init(&mattr))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + proc_pthread_cleanup(new_mutex); + return stat; + } + if ((stat = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + proc_pthread_cleanup(new_mutex); + return stat; + } + +#ifdef HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP + if ((stat = pthread_mutexattr_setrobust_np(&mattr, + PTHREAD_MUTEX_ROBUST_NP))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + proc_pthread_cleanup(new_mutex); + return stat; + } + if ((stat = pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + proc_pthread_cleanup(new_mutex); + return stat; + } +#endif + + if ((stat = pthread_mutex_init(new_mutex->pthread_interproc, &mattr))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + proc_pthread_cleanup(new_mutex); + return stat; + } + + if ((stat = pthread_mutexattr_destroy(&mattr))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + proc_pthread_cleanup(new_mutex); + return stat; + } + + new_mutex->curr_locked = 0; + apr_pool_cleanup_register(new_mutex->pool, + (void *)new_mutex, + proc_mutex_proc_pthread_cleanup, + apr_pool_cleanup_null); + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_proc_pthread_acquire(apr_proc_mutex_t *mutex) +{ + apr_status_t stat; + + if ((stat = pthread_mutex_lock(mutex->pthread_interproc))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif +#ifdef HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP + /* Okay, our owner died. Let's try to make it consistent again. */ + if (stat == EOWNERDEAD) { + pthread_mutex_consistent_np(mutex->pthread_interproc); + } + else + return stat; +#else + return stat; +#endif + } + mutex->curr_locked = 1; + return APR_SUCCESS; +} + +/* TODO: Add proc_mutex_proc_pthread_tryacquire(apr_proc_mutex_t *mutex) */ + +static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex) +{ + apr_status_t stat; + + if ((stat = pthread_mutex_unlock(mutex->pthread_interproc))) { +#ifdef PTHREAD_SETS_ERRNO + stat = errno; +#endif + return stat; + } + mutex->curr_locked = 0; + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_proc_pthread_destroy(apr_proc_mutex_t *mutex) +{ + apr_status_t stat; + if ((stat = proc_mutex_proc_pthread_cleanup(mutex)) == APR_SUCCESS) { + apr_pool_cleanup_kill(mutex->pool, + mutex, + proc_mutex_proc_pthread_cleanup); + return APR_SUCCESS; + } + return stat; +} + +static apr_status_t proc_mutex_proc_pthread_child_init(apr_proc_mutex_t **mutex, + apr_pool_t *cont, + const char *fname) +{ + return APR_SUCCESS; +} + +const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_proc_pthread_methods = +{ + APR_PROCESS_LOCK_MECH_IS_GLOBAL, + proc_mutex_proc_pthread_create, + proc_mutex_proc_pthread_acquire, + NULL, /* no tryacquire */ + proc_mutex_proc_pthread_release, + proc_mutex_proc_pthread_destroy, + proc_mutex_proc_pthread_child_init +}; + +#endif + +#if APR_HAS_FCNTL_SERIALIZE + +static struct flock proc_mutex_lock_it; +static struct flock proc_mutex_unlock_it; + +static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *); + +static void proc_mutex_fcntl_setup(void) +{ + proc_mutex_lock_it.l_whence = SEEK_SET; /* from current point */ + proc_mutex_lock_it.l_start = 0; /* -"- */ + proc_mutex_lock_it.l_len = 0; /* until end of file */ + proc_mutex_lock_it.l_type = F_WRLCK; /* set exclusive/write lock */ + proc_mutex_lock_it.l_pid = 0; /* pid not actually interesting */ + proc_mutex_unlock_it.l_whence = SEEK_SET; /* from current point */ + proc_mutex_unlock_it.l_start = 0; /* -"- */ + proc_mutex_unlock_it.l_len = 0; /* until end of file */ + proc_mutex_unlock_it.l_type = F_UNLCK; /* set exclusive/write lock */ + proc_mutex_unlock_it.l_pid = 0; /* pid not actually interesting */ +} + +static apr_status_t proc_mutex_fcntl_cleanup(void *mutex_) +{ + apr_status_t status; + apr_proc_mutex_t *mutex=mutex_; + + if (mutex->curr_locked == 1) { + status = proc_mutex_fcntl_release(mutex); + if (status != APR_SUCCESS) + return status; + } + close(mutex->interproc); + + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, + const char *fname) +{ + if (fname) { + new_mutex->fname = apr_pstrdup(new_mutex->pool, fname); + new_mutex->interproc = open(new_mutex->fname, + O_CREAT | O_WRONLY | O_EXCL, 0644); + } + else { + new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX"); + new_mutex->interproc = apr_mkstemp(new_mutex->fname); + } + + if (new_mutex->interproc < 0) { + proc_mutex_fcntl_cleanup(new_mutex); + return errno; + } + + new_mutex->curr_locked = 0; + unlink(new_mutex->fname); + apr_pool_cleanup_register(new_mutex->pool, + (void*)new_mutex, + proc_mutex_fcntl_cleanup, + apr_pool_cleanup_null); + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_fcntl_acquire(apr_proc_mutex_t *mutex) +{ + int rc; + + do { + rc = fcntl(mutex->interproc, F_SETLKW, &proc_mutex_lock_it); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { + return errno; + } + mutex->curr_locked=1; + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex) +{ + int rc; + + do { + rc = fcntl(mutex->interproc, F_SETLKW, &proc_mutex_unlock_it); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { + return errno; + } + mutex->curr_locked=0; + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_fcntl_destroy(apr_proc_mutex_t *mutex) +{ + apr_status_t stat; + if ((stat = proc_mutex_fcntl_cleanup(mutex)) == APR_SUCCESS) { + apr_pool_cleanup_kill(mutex->pool, mutex, proc_mutex_fcntl_cleanup); + return APR_SUCCESS; + } + return stat; +} + +static apr_status_t proc_mutex_fcntl_child_init(apr_proc_mutex_t **mutex, + apr_pool_t *pool, + const char *fname) +{ + return APR_SUCCESS; +} + +const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods = +{ +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS + APR_PROCESS_LOCK_MECH_IS_GLOBAL, +#else + 0, +#endif + proc_mutex_fcntl_create, + proc_mutex_fcntl_acquire, + NULL, /* no tryacquire */ + proc_mutex_fcntl_release, + proc_mutex_fcntl_destroy, + proc_mutex_fcntl_child_init +}; + +#endif /* fcntl implementation */ + +#if APR_HAS_FLOCK_SERIALIZE + +static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *); + +static void proc_mutex_flock_setup(void) +{ +} + +static apr_status_t proc_mutex_flock_cleanup(void *mutex_) +{ + apr_status_t status; + apr_proc_mutex_t *mutex=mutex_; + + if (mutex->curr_locked == 1) { + status = proc_mutex_flock_release(mutex); + if (status != APR_SUCCESS) + return status; + } + close(mutex->interproc); + unlink(mutex->fname); + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_flock_create(apr_proc_mutex_t *new_mutex, + const char *fname) +{ + if (fname) { + new_mutex->fname = apr_pstrdup(new_mutex->pool, fname); + new_mutex->interproc = open(new_mutex->fname, + O_CREAT | O_WRONLY | O_EXCL, 0600); + } + else { + new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX"); + new_mutex->interproc = apr_mkstemp(new_mutex->fname); + } + + if (new_mutex->interproc < 0) { + proc_mutex_flock_cleanup(new_mutex); + return errno; + } + new_mutex->curr_locked = 0; + apr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, + proc_mutex_flock_cleanup, + apr_pool_cleanup_null); + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_flock_acquire(apr_proc_mutex_t *mutex) +{ + int rc; + + do { + rc = flock(mutex->interproc, LOCK_EX); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { + return errno; + } + mutex->curr_locked = 1; + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *mutex) +{ + int rc; + + do { + rc = flock(mutex->interproc, LOCK_UN); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { + return errno; + } + mutex->curr_locked = 0; + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_flock_destroy(apr_proc_mutex_t *mutex) +{ + apr_status_t stat; + if ((stat = proc_mutex_flock_cleanup(mutex)) == APR_SUCCESS) { + apr_pool_cleanup_kill(mutex->pool, mutex, proc_mutex_flock_cleanup); + return APR_SUCCESS; + } + return stat; +} + +static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, + apr_pool_t *pool, + const char *fname) +{ + apr_proc_mutex_t *new_mutex; + + new_mutex = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); + + memcpy(new_mutex, *mutex, sizeof *new_mutex); + new_mutex->pool = pool; + new_mutex->fname = apr_pstrdup(pool, fname); + new_mutex->interproc = open(new_mutex->fname, O_WRONLY, 0600); + if (new_mutex->interproc == -1) { + proc_mutex_flock_destroy(new_mutex); + return errno; + } + *mutex = new_mutex; + return APR_SUCCESS; +} + +const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_flock_methods = +{ +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS + APR_PROCESS_LOCK_MECH_IS_GLOBAL, +#else + 0, +#endif + proc_mutex_flock_create, + proc_mutex_flock_acquire, + NULL, /* no tryacquire */ + proc_mutex_flock_release, + proc_mutex_flock_destroy, + proc_mutex_flock_child_init +}; + +#endif /* flock implementation */ + +void apr_proc_mutex_unix_setup_lock(void) +{ +#if APR_HAS_SYSVSEM_SERIALIZE + proc_mutex_sysv_setup(); +#endif +#if APR_HAS_PROC_PTHREAD_SERIALIZE + proc_mutex_proc_pthread_setup(); +#endif +#if APR_HAS_FCNTL_SERIALIZE + proc_mutex_fcntl_setup(); +#endif +#if APR_HAS_FLOCK_SERIALIZE + proc_mutex_flock_setup(); +#endif +} + + + + + + + + + +static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lockmech_e_np mech) +{ + switch (mech) { + case APR_LOCK_FCNTL: +#if APR_HAS_FCNTL_SERIALIZE + new_mutex->inter_meth = &apr_proc_mutex_unix_fcntl_methods; +#else + return APR_ENOTIMPL; +#endif + break; + case APR_LOCK_FLOCK: +#if APR_HAS_FLOCK_SERIALIZE + new_mutex->inter_meth = &apr_proc_mutex_unix_flock_methods; +#else + return APR_ENOTIMPL; +#endif + break; + case APR_LOCK_SYSVSEM: +#if APR_HAS_SYSVSEM_SERIALIZE + new_mutex->inter_meth = &apr_proc_mutex_unix_sysv_methods; +#else + return APR_ENOTIMPL; +#endif + break; + case APR_LOCK_PROC_PTHREAD: +#if APR_HAS_PROC_PTHREAD_SERIALIZE + new_mutex->inter_meth = &apr_proc_mutex_unix_proc_pthread_methods; +#else + return APR_ENOTIMPL; +#endif + break; + case APR_LOCK_DEFAULT: +#if APR_USE_FLOCK_SERIALIZE + new_mutex->inter_meth = &apr_proc_mutex_unix_flock_methods; +#elif APR_USE_SYSVSEM_SERIALIZE + new_mutex->inter_meth = &apr_proc_mutex_unix_sysv_methods; +#elif APR_USE_FCNTL_SERIALIZE + new_mutex->inter_meth = &apr_proc_mutex_unix_fcntl_methods; +#elif APR_USE_PROC_PTHREAD_SERIALIZE + new_mutex->inter_meth = &apr_proc_mutex_unix_proc_pthread_methods; +#else + return APR_ENOTIMPL; +#endif + break; + default: + return APR_ENOTIMPL; + } + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_create(apr_proc_mutex_t *new_mutex, apr_lockmech_e_np mech, const char *fname) +{ + apr_status_t stat; + + if (new_mutex->scope != APR_INTRAPROCESS) { + if ((stat = proc_mutex_choose_method(new_mutex, mech)) != APR_SUCCESS) { + return stat; + } + } + + new_mutex->meth = new_mutex->inter_meth; + + if ((stat = new_mutex->meth->create(new_mutex, fname)) != APR_SUCCESS) { + return stat; + } + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return apr_proc_mutex_create_np(mutex, fname, APR_LOCK_DEFAULT, pool); +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, + const char *fname, + apr_lockmech_e_np mech, + apr_pool_t *pool) +{ + apr_proc_mutex_t *new_mutex; + apr_status_t stat; + + new_mutex = (apr_proc_mutex_t *)apr_pcalloc(pool, + sizeof(apr_proc_mutex_t)); + + new_mutex->pool = pool; +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE + new_mutex->interproc = -1; +#endif + + if ((stat = proc_mutex_create(new_mutex, mech, fname)) != APR_SUCCESS) + return stat; + + *mutex = new_mutex; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return (*mutex)->meth->child_init(mutex, pool, fname); +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) +{ + apr_status_t stat; + +#if APR_HAS_THREADS + if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { + mutex->owner_ref++; + return APR_SUCCESS; + } +#endif + + if ((stat = mutex->meth->acquire(mutex)) != APR_SUCCESS) { + return stat; + } + +#if APR_HAS_THREADS + mutex->owner = apr_os_thread_current(); + mutex->owner_ref = 1; +#endif + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) +{ + apr_status_t stat; + +#if APR_HAS_THREADS + if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { + mutex->owner_ref++; + return APR_SUCCESS; + } +#endif + + if ((stat = mutex->meth->tryacquire(mutex)) != APR_SUCCESS) { + return stat; + } + +#if APR_HAS_THREADS + mutex->owner = apr_os_thread_current(); + mutex->owner_ref = 1; +#endif + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) +{ + apr_status_t stat; + +#if APR_HAS_THREADS + if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { + mutex->owner_ref--; + if (mutex->owner_ref > 0) + return APR_SUCCESS; + } +#endif + + if ((stat = mutex->meth->release(mutex)) != APR_SUCCESS) { + return stat; + } + +#if APR_HAS_THREADS + memset(&mutex->owner, 0, sizeof mutex->owner); + mutex->owner_ref = 0; +#endif + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) +{ + return mutex->meth->destroy(mutex); +} + diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c new file mode 100644 index 00000000000..fa99d67c211 --- /dev/null +++ b/locks/win32/proc_mutex.c @@ -0,0 +1,103 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_strings.h" +#include "win32/proc_mutex.h" +#include "apr_portable.h" + +APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, + const char *fname, + apr_lockmech_e_np mech, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + From e889b13ff63ed8680e38511b02aeaa2dcd2d54e8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 19 Sep 2001 20:08:05 +0000 Subject: [PATCH 2349/7878] Add a test for the new process mutex, and a CHANGES entry about the process locks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62348 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + test/Makefile.in | 6 +- test/testprocmutex.c | 193 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 test/testprocmutex.c diff --git a/CHANGES b/CHANGES index b63da7274d2..913a6af3a4e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Add process locking API to APR. [Aaron Bannert ] + *) Add condition variables for Windows. [Ryan Bloom] *) Add condition variables to the APR set of locking functions. diff --git a/test/Makefile.in b/test/Makefile.in index cbdb9dda534..767e952a5b1 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -29,7 +29,8 @@ PROGRAMS = \ occhild@EXEEXT@ \ teststr@EXEEXT@ \ testuser@EXEEXT@ \ - testsockets@EXEEXT@ + testsockets@EXEEXT@ \ + testprocmutex@EXEEXT@ TARGETS = $(PROGRAMS) @@ -141,4 +142,7 @@ testsockets@EXEEXT@: testsockets.lo $(LOCAL_LIBS) testuser@EXEEXT@: testuser.lo $(LOCAL_LIBS) $(LINK) testuser.lo $(LOCAL_LIBS) $(ALL_LIBS) +testprocmutex@EXEEXT@: testprocmutex.lo $(LOCAL_LIBS) + $(LINK) testprocmutex.lo $(LOCAL_LIBS) $(ALL_LIBS) + # DO NOT REMOVE diff --git a/test/testprocmutex.c b/test/testprocmutex.c new file mode 100644 index 00000000000..b014251d0ba --- /dev/null +++ b/test/testprocmutex.c @@ -0,0 +1,193 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_shmem.h" +#include "apr_thread_proc.h" +#include "apr_file_io.h" +#include "apr_lock.h" +#include "apr_proc_mutex.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_getopt.h" +#include "errno.h" +#include +#include +#include "test_apr.h" + + +#define MAX_ITER 40000 +#define MAX_COUNTER (MAX_ITER * 4) + +apr_proc_mutex_t *proc_lock; +apr_pool_t *pool; +int *x; + +static int make_child(apr_proc_t **proc, apr_pool_t *p) +{ + int i = 0; + *proc = apr_pcalloc(p, sizeof(**proc)); + + /* slight delay to allow things to settle */ + apr_sleep (1); + + if (apr_proc_fork(*proc, p) == APR_INCHILD) { + while (1) { + apr_proc_mutex_lock(proc_lock); + if (i == MAX_ITER) { + apr_proc_mutex_unlock(proc_lock); + exit(1); + } + i++; + (*x)++; + apr_proc_mutex_unlock(proc_lock); + } + exit(1); + } + return APR_SUCCESS; +} + +apr_status_t test_exclusive(const char *lockname) +{ + apr_proc_t *p1, *p2, *p3, *p4; + apr_status_t s1, s2, s3, s4; + + printf("Exclusive lock test\n"); + printf("%-60s", " Initializing the lock"); + s1 = apr_proc_mutex_create(&proc_lock, lockname, pool); + + if (s1 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + printf("%-60s", " Starting all of the processes"); + fflush(stdout); + s1 = make_child(&p1, pool); + s2 = make_child(&p2, pool); + s3 = make_child(&p3, pool); + s4 = make_child(&p4, pool); + if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || + s3 != APR_SUCCESS || s4 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + printf("%-60s", " Waiting for processes to exit"); + s1 = apr_proc_wait(p1, APR_WAIT); + s2 = apr_proc_wait(p2, APR_WAIT); + s3 = apr_proc_wait(p3, APR_WAIT); + s4 = apr_proc_wait(p4, APR_WAIT); + printf("OK\n"); + + if ((*x) != MAX_COUNTER) { + fprintf(stderr, "Locks don't appear to work! x = %d instead of %d\n", + (*x), MAX_COUNTER); + } + else { + printf("Test passed\n"); + } + return APR_SUCCESS; +} + +int main(int argc, const char * const *argv) +{ + apr_status_t rv; + char errmsg[200]; + const char *lockname = "multi.lock"; + const char *shmname = "shm.file"; + apr_getopt_t *opt; + char optchar; + const char *optarg; + apr_shmem_t *shm; + + printf("APR Proc Mutex Test\n==============\n\n"); + + apr_initialize(); + atexit(apr_terminate); + + if (apr_pool_create(&pool, NULL) != APR_SUCCESS) + exit(-1); + + if ((rv = apr_getopt_init(&opt, pool, argc, argv)) != APR_SUCCESS) { + fprintf(stderr, "Could not set up to parse options: [%d] %s\n", + rv, apr_strerror(rv, errmsg, sizeof errmsg)); + exit(-1); + } + + while ((rv = apr_getopt(opt, "f:", &optchar, &optarg)) == APR_SUCCESS) { + if (optchar == 'f') { + lockname = optarg; + } + } + + if (rv != APR_SUCCESS && rv != APR_EOF) { + fprintf(stderr, "Could not parse options: [%d] %s\n", + rv, apr_strerror(rv, errmsg, sizeof errmsg)); + exit(-1); + } + + apr_shm_init(&shm, sizeof(int), shmname, pool); + x = apr_shm_calloc(shm, sizeof(int)); + + if ((rv = test_exclusive(lockname)) != APR_SUCCESS) { + fprintf(stderr,"Exclusive Lock test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-2); + } + + return 0; +} + From fcae7fda0f888741f450aa2878e171fab84ef21d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 19 Sep 2001 22:10:44 +0000 Subject: [PATCH 2350/7878] fix some missed function renames (proc_pthread_cleanup -> proc_mutex_proc_pthread_cleanup) Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62349 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 364043c91e6..037b5a160e9 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -221,14 +221,14 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, #ifdef PTHREAD_SETS_ERRNO stat = errno; #endif - proc_pthread_cleanup(new_mutex); + proc_mutex_proc_pthread_cleanup(new_mutex); return stat; } if ((stat = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED))) { #ifdef PTHREAD_SETS_ERRNO stat = errno; #endif - proc_pthread_cleanup(new_mutex); + proc_mutex_proc_pthread_cleanup(new_mutex); return stat; } @@ -238,14 +238,14 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, #ifdef PTHREAD_SETS_ERRNO stat = errno; #endif - proc_pthread_cleanup(new_mutex); + proc_mutex_proc_pthread_cleanup(new_mutex); return stat; } if ((stat = pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT))) { #ifdef PTHREAD_SETS_ERRNO stat = errno; #endif - proc_pthread_cleanup(new_mutex); + proc_mutex_proc_pthread_cleanup(new_mutex); return stat; } #endif @@ -254,7 +254,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, #ifdef PTHREAD_SETS_ERRNO stat = errno; #endif - proc_pthread_cleanup(new_mutex); + proc_mutex_proc_pthread_cleanup(new_mutex); return stat; } @@ -262,7 +262,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, #ifdef PTHREAD_SETS_ERRNO stat = errno; #endif - proc_pthread_cleanup(new_mutex); + proc_mutex_proc_pthread_cleanup(new_mutex); return stat; } From bff49f414f4de282d1fa04c1580876a25e619403 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Thu, 20 Sep 2001 08:59:31 +0000 Subject: [PATCH 2351/7878] Return the exit code from apr_proc_wait(). This is a combination of a patch from Justin and Bill, plus a few additional tweaks. Submitted by: Justin Erenkrantz , Bill Tutt Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62350 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 6 ++++++ threadproc/beos/proc.c | 5 +++-- threadproc/netware/proc.c | 1 + threadproc/os2/proc.c | 3 +++ threadproc/unix/proc.c | 11 ++++++----- threadproc/win32/proc.c | 28 +++++++++++++++------------- 6 files changed, 34 insertions(+), 20 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 23d2ca462ae..4b6dcba585d 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -481,6 +481,11 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc, /** * Wait for a child process to die * @param proc The process handle that corresponds to the desired child process + * @param exitcode The returned exit status of the child, if a child process + * dies. On platforms that don't support obtaining this + * information, the exitcode parameter will be returned as + * APR_ENOTIMPL. This parameter may be NULL if the exit code + * is not needed. * @param waithow How should we wait. One of: *
      *            APR_WAIT   -- block until the child process dies.
    @@ -494,6 +499,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc,
      * 
    */ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, + apr_wait_t *exitcode, apr_wait_how_e waithow); /** diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 4d527b42a18..3f0476a7606 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -299,16 +299,17 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t * } APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, + apr_wait_t *exitcode, apr_wait_how_e wait) { - status_t exitval, rv; + status_t rv; if (!proc) return APR_ENOPROC; /* when we run processes we are actually running threads, so here we'll wait on the thread dying... */ if (wait == APR_WAIT) { - if ((rv = wait_for_thread(proc->pid, &exitval)) == B_OK) { + if ((rv = wait_for_thread(proc->pid, exitcode)) == B_OK) { return APR_CHILD_DONE; } return rv; diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 7124f8a17ed..a537f765165 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -393,6 +393,7 @@ apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, } apr_status_t apr_proc_wait(apr_proc_t *proc, + apr_wait_t *exitcode, apr_wait_how_e waithow) { #if 0 diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index f890986fb81..f092e671660 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -527,6 +527,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t * APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, + apr_wait_t *exitcode, apr_wait_how_e wait) { RESULTCODES codes; @@ -538,6 +539,8 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, rc = DosWaitChild(DCWA_PROCESS, wait == APR_WAIT ? DCWW_WAIT : DCWW_NOWAIT, &codes, &pid, proc->pid); + if (exitcode) + *exitcode = codes.codeResult; if (rc == 0) { return APR_CHILD_DONE; } else if (rc == ERROR_CHILD_NOT_COMPLETE) { diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 41f8007c96f..619b18d894c 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -380,23 +380,24 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t * } APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, + apr_wait_t *exitcode, apr_wait_how_e waithow) { - pid_t status; + pid_t pstatus; if (waithow == APR_WAIT) { - if ((status = waitpid(proc->pid, NULL, WUNTRACED)) > 0) { + if ((pstatus = waitpid(proc->pid, exitcode, WUNTRACED)) > 0) { return APR_CHILD_DONE; } - else if (status == 0) { + else if (pstatus == 0) { return APR_CHILD_NOTDONE; } return errno; } - if ((status = waitpid(proc->pid, NULL, WUNTRACED | WNOHANG)) > 0) { + if ((pstatus = waitpid(proc->pid, exitcode, WUNTRACED | WNOHANG)) > 0) { return APR_CHILD_DONE; } - else if (status == 0) { + else if (pstatus == 0) { return APR_CHILD_NOTDONE; } return errno; diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 8a7848228a9..c1b26f025e6 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -540,27 +540,29 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, apr_wait_how_e wait) +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, + apr_wait_t *exitcode, + apr_wait_how_e wait) { DWORD stat; + DWORD time; + if (!proc) return APR_ENOPROC; - if (wait == APR_WAIT) { - if ((stat = WaitForSingleObject(proc->hproc, - INFINITE)) == WAIT_OBJECT_0) { + + if (wait == APR_WAIT) + time = INFINITE; + else + time = 0; + + if ((stat = WaitForSingleObject(proc->hproc, time)) == WAIT_OBJECT_0) { + if (GetExitCodeProcess((HANDLE)proc->pid, &stat)) { + if (exitcode) + *exitcode = (apr_wait_t)stat; CloseHandle(proc->hproc); proc->hproc = NULL; return APR_CHILD_DONE; } - else if (stat == WAIT_TIMEOUT) { - return APR_CHILD_NOTDONE; - } - return apr_get_os_error(); - } - if ((stat = WaitForSingleObject((HANDLE)proc->hproc, 0)) == WAIT_OBJECT_0) { - CloseHandle(proc->hproc); - proc->hproc = NULL; - return APR_CHILD_DONE; } else if (stat == WAIT_TIMEOUT) { return APR_CHILD_NOTDONE; From 67245e8dc0755343b089747aaf18771b1c1c5de1 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Thu, 20 Sep 2001 09:03:25 +0000 Subject: [PATCH 2352/7878] Add an extra parameter to all apr_proc_wait() calls for the new "exitcode" parameter. Pass NULL because we aren't interested in the value. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62351 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 4 ++-- test/testproc.c | 3 ++- test/testsock.c | 16 ++++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 6abdd502b0f..9483e7a2a0e 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1422,7 +1422,7 @@ static void free_proc_chain(struct process_chain *procs) #ifndef NEED_WAITPID /* Pick up all defunct processes */ for (p = procs; p; p = p->next) { - if (apr_proc_wait(p->pid, APR_NOWAIT) != APR_CHILD_NOTDONE) { + if (apr_proc_wait(p->pid, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE) { p->kill_how = kill_never; } } @@ -1467,7 +1467,7 @@ static void free_proc_chain(struct process_chain *procs) /* Now wait for all the signaled processes to die */ for (p = procs; p; p = p->next) { if (p->kill_how != kill_never) { - (void) apr_proc_wait(p->pid, APR_WAIT); + (void) apr_proc_wait(p->pid, NULL, APR_WAIT); } } #ifdef WIN32 diff --git a/test/testproc.c b/test/testproc.c index 67abe5009d6..780ea0a092f 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -141,7 +141,8 @@ int main(int argc, char *argv[]) } else printf( "Read failed.\n"); - TEST_NEQ("Waiting for child to die", apr_proc_wait(&newproc, APR_WAIT), + TEST_NEQ("Waiting for child to die", + apr_proc_wait(&newproc, NULL, APR_WAIT), APR_CHILD_DONE, "OK", "Failed") STD_TEST_NEQ("Removing directory", apr_dir_remove("proctest", pool)) diff --git a/test/testsock.c b/test/testsock.c index 38237a56464..2e805926800 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -96,18 +96,18 @@ static int run_basic_test(apr_pool_t *context) exit(-1); } - while ((s1 = apr_proc_wait(&proc1, APR_NOWAIT)) == APR_CHILD_NOTDONE && - (s2 = apr_proc_wait(&proc2, APR_NOWAIT)) == APR_CHILD_NOTDONE) { + while ((s1 = apr_proc_wait(&proc1, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE && + (s2 = apr_proc_wait(&proc2, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE) { continue; } if (s1 == APR_SUCCESS) { apr_proc_kill(&proc2, SIGTERM); - while (apr_proc_wait(&proc2, APR_WAIT) == APR_CHILD_NOTDONE); + while (apr_proc_wait(&proc2, NULL, APR_WAIT) == APR_CHILD_NOTDONE); } else { apr_proc_kill(&proc1, SIGTERM); - while (apr_proc_wait(&proc1, APR_WAIT) == APR_CHILD_NOTDONE); + while (apr_proc_wait(&proc1, NULL, APR_WAIT) == APR_CHILD_NOTDONE); } fprintf(stdout, "Network test completed.\n"); @@ -163,18 +163,18 @@ static int run_sendfile(apr_pool_t *context, int number) exit(-1); } - while ((s1 = apr_proc_wait(&proc1, APR_NOWAIT)) == APR_CHILD_NOTDONE && - (s2 = apr_proc_wait(&proc2, APR_NOWAIT)) == APR_CHILD_NOTDONE) { + while ((s1 = apr_proc_wait(&proc1, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE && + (s2 = apr_proc_wait(&proc2, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE) { continue; } if (s1 == APR_SUCCESS) { apr_proc_kill(&proc2, SIGTERM); - while (apr_proc_wait(&proc2, APR_WAIT) == APR_CHILD_NOTDONE); + while (apr_proc_wait(&proc2, NULL, APR_WAIT) == APR_CHILD_NOTDONE); } else { apr_proc_kill(&proc1, SIGTERM); - while (apr_proc_wait(&proc1, APR_WAIT) == APR_CHILD_NOTDONE); + while (apr_proc_wait(&proc1, NULL, APR_WAIT) == APR_CHILD_NOTDONE); } fprintf(stdout, "Network test completed.\n"); From 63e5a4f5184633bb6dba07383d0cc30fb2aa5fb8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 20 Sep 2001 15:28:17 +0000 Subject: [PATCH 2353/7878] need hint to reproduce apr_xlate.h issue mentioned in STATUS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62352 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index e46384e5b20..81b5fad6d06 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/09/19 15:27:16 $] +Last modified at [$Date: 2001/09/20 15:28:17 $] Release: @@ -180,6 +180,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: before and at least added to STATUS. * apr_xlate.h generates a bunch of compiler warnings. + Jeff asks: which platform? * fcntl() oddness on Solaris. Under high loads, fcntl() decides to return error code 46 (ENOLCK). From 83b0f321c6b4b0e5c725c5f674ac70249714f9ad Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 20 Sep 2001 16:26:07 +0000 Subject: [PATCH 2354/7878] Blah. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62353 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 81b5fad6d06..0c08e575ad7 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/09/20 15:28:17 $] +Last modified at [$Date: 2001/09/20 16:26:07 $] Release: @@ -181,6 +181,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * apr_xlate.h generates a bunch of compiler warnings. Jeff asks: which platform? + Justin says: Solaris with Forte 6.1. * fcntl() oddness on Solaris. Under high loads, fcntl() decides to return error code 46 (ENOLCK). From 4ff4e6fe1ddeaee835cf9301260e0095dcacd811 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 20 Sep 2001 17:21:01 +0000 Subject: [PATCH 2355/7878] No longer... win32's pid is a _pid_, hproc is the process handle. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62354 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index c1b26f025e6..97d5e62128e 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -556,7 +556,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, time = 0; if ((stat = WaitForSingleObject(proc->hproc, time)) == WAIT_OBJECT_0) { - if (GetExitCodeProcess((HANDLE)proc->pid, &stat)) { + if (GetExitCodeProcess(proc->hproc, &stat)) { if (exitcode) *exitcode = (apr_wait_t)stat; CloseHandle(proc->hproc); From 7d49a2d92676c76a35961554541a806371bf733b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 20 Sep 2001 20:25:11 +0000 Subject: [PATCH 2356/7878] No cast needed here, but some NULL checking would be nice. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62355 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/signals.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index ff0f941b80b..efb0a5b5bff 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -66,8 +66,12 @@ /* Windows only really support killing process, but that will do for now. */ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signal) { - if (TerminateProcess((HANDLE)proc->hproc, signal) == 0) { - return apr_get_os_error(); + if (proc->hproc != NULL) { + if (TerminateProcess(proc->hproc, signal) == 0) { + return apr_get_os_error(); + } + CloseHandle(proc->hproc); + proc->hproc = NULL; } return APR_SUCCESS; } From 464e48e501582f62d918376952e400dbe7111963 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 20 Sep 2001 20:48:26 +0000 Subject: [PATCH 2357/7878] Use the apr_proc_t, rather than some goofy pid/tid/handle value, for the process reference in the OC type. Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62356 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/misc.h | 2 +- include/arch/win32/misc.h | 2 +- misc/unix/otherchild.c | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index e455f7b25ea..00e7504c295 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -91,7 +91,7 @@ struct apr_other_child_rec_t { apr_pool_t *p; struct apr_other_child_rec_t *next; - int id; /* This is either a pid or tid depending on the platform */ + apr_proc_t *proc; void (*maintenance) (int, void *, int); void *data; apr_os_file_t write_fd; diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index e455f7b25ea..00e7504c295 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -91,7 +91,7 @@ struct apr_other_child_rec_t { apr_pool_t *p; struct apr_other_child_rec_t *next; - int id; /* This is either a pid or tid depending on the platform */ + apr_proc_t *proc; void (*maintenance) (int, void *, int); void *data; apr_os_file_t write_fd; diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 62896b8cbee..e9867176b6d 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -98,7 +98,7 @@ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid, ocr = apr_palloc(p, sizeof(*ocr)); ocr->p = p; - ocr->id = pid->pid; + ocr->proc = pid; ocr->maintenance = maintenance; ocr->data = data; if (write_fd == NULL) { @@ -144,10 +144,10 @@ APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *pid, int status) for (ocr = other_children; ocr; ocr = nocr) { nocr = ocr->next; - if (ocr->id != pid->pid) + if (ocr->proc->pid != pid->pid) continue; - ocr->id = -1; + ocr->proc = NULL; (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status); return 0; } @@ -173,10 +173,10 @@ APR_DECLARE(void) apr_proc_other_child_check(void) for (ocr = other_children; ocr; ocr = nocr) { nocr = ocr->next; - if (ocr->id == -1) + if (ocr->proc == NULL) continue; - rv = WaitForSingleObject((HANDLE) ocr->id, 0); + rv = WaitForSingleObject(ocr->proc->hproc, 0); if (rv != WAIT_TIMEOUT) { (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1); } @@ -191,12 +191,12 @@ APR_DECLARE(void) apr_proc_other_child_check(void) for (ocr = other_children; ocr; ocr = nocr) { nocr = ocr->next; - if (ocr->id == -1) + if (ocr->proc == NULL) continue; - waitret = waitpid(ocr->id, &status, WNOHANG); - if (waitret == ocr->id) { - ocr->id = -1; + waitret = waitpid(ocr->proc, &status, WNOHANG); + if (waitret == ocr->proc) { + ocr->proc = NULL; (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status); } else if (waitret == 0) { @@ -204,7 +204,7 @@ APR_DECLARE(void) apr_proc_other_child_check(void) } else if (waitret == -1) { /* uh what the heck? they didn't call unregister? */ - ocr->id = -1; + ocr->proc = NULL; (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1); } } From ef6fa47ba3274716da939ecb19ade08f1420fec1 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 21 Sep 2001 02:59:37 +0000 Subject: [PATCH 2358/7878] We need to refer to the pid itself, not the apr_proc_t git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62357 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/otherchild.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index e9867176b6d..201f2468bb9 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -194,8 +194,8 @@ APR_DECLARE(void) apr_proc_other_child_check(void) if (ocr->proc == NULL) continue; - waitret = waitpid(ocr->proc, &status, WNOHANG); - if (waitret == ocr->proc) { + waitret = waitpid(ocr->proc->pid, &status, WNOHANG); + if (waitret == ocr->proc->pid) { ocr->proc = NULL; (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status); } From dcee65f4a012a79ad2f223202d5cf3d2c51d69a1 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 21 Sep 2001 16:14:50 +0000 Subject: [PATCH 2359/7878] Simplify apr_proc_wait_all_procs and consolidate apr_proc_wait. (I had a similar version in my tree. Kevin's wins out because of the WIF macros. Are there any platforms that don't have this? The Solaris man page seems to indicate that they must be called, so it seems correct. Please check on your favorite platform.) Submitted by: Kevin Pilch-Bisson Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62358 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ threadproc/unix/proc.c | 45 ++++++++++++++++++++---------------------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/CHANGES b/CHANGES index 913a6af3a4e..6029d74079a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Make the unix version of apr_proc_wait_all_procs a simple wrapper + around apr_proc_wait, and which extracts the exit code from the + status returned by waitpid. + [Kevin Pilch-Bisson ] + *) Add process locking API to APR. [Aaron Bannert ] *) Add condition variables for Windows. [Ryan Bloom] diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 619b18d894c..894f36ea307 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -361,22 +361,13 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, - apr_wait_how_e waithow, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, + apr_wait_t *status, + apr_wait_how_e waithow, + apr_pool_t *p) { - int waitpid_options = WUNTRACED; - - if (waithow != APR_WAIT) { - waitpid_options |= WNOHANG; - } - - if ((proc->pid = waitpid(-1, status, waitpid_options)) > 0) { - return APR_CHILD_DONE; - } - else if (proc->pid == 0) { - return APR_CHILD_NOTDONE; - } - return errno; + proc->pid = -1; + return apr_proc_wait(proc, status, waithow); } APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, @@ -384,18 +375,24 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, apr_wait_how_e waithow) { pid_t pstatus; + int waitpid_options = WUNTRACED; + int exit_int; - if (waithow == APR_WAIT) { - if ((pstatus = waitpid(proc->pid, exitcode, WUNTRACED)) > 0) { - return APR_CHILD_DONE; + if (waithow != APR_WAIT) { + waitpid_options |= WNOHANG; + } + + if ((pstatus = waitpid(proc->pid, &exit_int, waitpid_options)) > 0) { + if (proc->pid == -1) { + proc->pid = pstatus; } - else if (pstatus == 0) { - return APR_CHILD_NOTDONE; + if (WIFEXITED(exit_int)) { + if (exitcode != NULL) { + *exitcode = WEXITSTATUS(exit_int); + } + return APR_CHILD_DONE; } - return errno; - } - if ((pstatus = waitpid(proc->pid, exitcode, WUNTRACED | WNOHANG)) > 0) { - return APR_CHILD_DONE; + return APR_CHILD_NOTDONE; } else if (pstatus == 0) { return APR_CHILD_NOTDONE; From 2eeabd2604529dc4584f7803241f2059d33af224 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 22 Sep 2001 19:10:18 +0000 Subject: [PATCH 2360/7878] Use the proper m4 quoting. (Does this even need to be quoted?) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62359 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 4f4af52e587..206655a639c 100644 --- a/configure.in +++ b/configure.in @@ -1255,7 +1255,7 @@ msg=yes ] , [ have_in_addr="0" msg=no ]) AC_MSG_RESULT([$msg]) -AC_MSG_CHECKING("if fd == socket on this platform") +AC_MSG_CHECKING([if fd == socket on this platform]) if test "x$file_as_socket" = "x" ; then file_as_socket="1"; echo "yes" From 85b34a58016169fdf08bcef35f003d481a29cd17 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sat, 22 Sep 2001 20:23:21 +0000 Subject: [PATCH 2361/7878] AC_PROG_CC can only be used once within a configure script (at least with autoconf 2.52). Shift the invocation to a very early point in the process so that the preload logic can make choices based on the available compiler (as AIX needs to do). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62360 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 1 - configure.in | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 8788ebe3214..3d936990da7 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -78,7 +78,6 @@ if test "x$apr_preload_done" != "xyes" ; then esac dnl Must do a check for gcc or egcs here, to get the right options dnl to the compiler. - AC_PROG_CC if test "$GCC" != "yes"; then APR_ADDTO(CFLAGS, [-qHALT=E -qLANGLVL=extended]) fi diff --git a/configure.in b/configure.in index 206655a639c..96b69e07d42 100644 --- a/configure.in +++ b/configure.in @@ -36,6 +36,12 @@ echo "Platform: $host" dnl # Some initial steps for configuration. We setup the default directory dnl # and which files are to be configured. +dnl Do the various CC checks *before* preloading values. The preload code +dnl may need to use compiler characteristics to make decisions. This macro +dnl can only be used once within a configure script, so this prevents a +dnl preload section from invoking the macro to get compiler info. +AC_PROG_CC + dnl Preload APR_PRELOAD @@ -71,7 +77,6 @@ apr_modules="file_io network_io threadproc misc locks time mmap shmem i18n user dnl Checks for programs. AC_PROG_MAKE_SET -AC_PROG_CC AC_PROG_CPP AC_PROG_AWK AC_PROG_LN_S From 3f793b343d486e2989b9d748c0d17ac755d7afa2 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sun, 23 Sep 2001 02:30:56 +0000 Subject: [PATCH 2362/7878] Toss an old (commented out) reference to MM. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62361 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 3 --- 1 file changed, 3 deletions(-) diff --git a/buildconf b/buildconf index a301989efd3..ee05ac54023 100755 --- a/buildconf +++ b/buildconf @@ -101,7 +101,4 @@ echo "Creating configure ..." ### do some work to toss config.cache? autoconf -# We do not currently use MM -#(cd shmem/unix/mm && autoconf) - exit 0 From dd9ab1809fcfe8d8bc86e7d7d073bafe510304a3 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 24 Sep 2001 01:53:36 +0000 Subject: [PATCH 2363/7878] Tweak two of these so the list is in alpha order again git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62362 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index f4e297c5701..5baceee78ea 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -45,11 +45,11 @@ #define APR_HAVE_NETINET_IN_H @netinet_inh@ #define APR_HAVE_NETINET_TCP_H @netinet_tcph@ #define APR_HAVE_PTHREAD_H @pthreadh@ +#define APR_HAVE_SIGNAL_H @signalh@ #define APR_HAVE_STDARG_H @stdargh@ -#define APR_HAVE_STDIO_H @stdioh@ #define APR_HAVE_STDINT_H @stdint@ +#define APR_HAVE_STDIO_H @stdioh@ #define APR_HAVE_STDLIB_H @stdlibh@ -#define APR_HAVE_SIGNAL_H @signalh@ #define APR_HAVE_STRING_H @stringh@ #define APR_HAVE_STRINGS_H @stringsh@ #define APR_HAVE_SYS_SENDFILE_H @sys_sendfileh@ From a46f7a1bafbdd2824bd6f59f7c4f2cf03ee68441 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 24 Sep 2001 02:08:33 +0000 Subject: [PATCH 2364/7878] Sync apr.hw's list of defined feature macros back up with apr.h.in git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62363 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/apr.hw b/include/apr.hw index 742e827732e..ada69538e2e 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -145,13 +145,16 @@ #define APR_HAVE_LIMITS_H 1 #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 +#define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SIGNAL_H 1 #define APR_HAVE_STDARG_H 1 +#define APR_HAVE_STDINT_H 0 #define APR_HAVE_STDIO_H 1 #define APR_HAVE_STDLIB_H 1 #define APR_HAVE_STRING_H 1 #define APR_HAVE_STRINGS_H 0 +#define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 @@ -171,6 +174,7 @@ #define APR_HAS_SYSVSEM_SERIALIZE 0 #define APR_HAS_FCNTL_SERIALIZE 0 #define APR_HAS_PROC_PTHREAD_SERIALIZE 0 +#define APR_HAS_RWLOCK_SERIALIZE 0 #define APR_HAS_LOCK_CREATE_NP 0 @@ -192,6 +196,7 @@ #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 #define APR_HAVE_SIGACTION 0 +#define APR_HAVE_SIGWAIT 0 #define APR_HAVE_STRCASECMP 0 #define APR_HAVE_STRDUP 1 #define APR_HAVE_STRICMP 1 From ae770d31323daea133e8a285aedff3a4226ff489 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 24 Sep 2001 03:59:57 +0000 Subject: [PATCH 2365/7878] Cleanup some warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62364 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index b014251d0ba..b4d12ec0e4f 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -126,10 +126,10 @@ apr_status_t test_exclusive(const char *lockname) printf("OK\n"); printf("%-60s", " Waiting for processes to exit"); - s1 = apr_proc_wait(p1, APR_WAIT); - s2 = apr_proc_wait(p2, APR_WAIT); - s3 = apr_proc_wait(p3, APR_WAIT); - s4 = apr_proc_wait(p4, APR_WAIT); + s1 = apr_proc_wait(p1, NULL, APR_WAIT); + s2 = apr_proc_wait(p2, NULL, APR_WAIT); + s3 = apr_proc_wait(p3, NULL, APR_WAIT); + s4 = apr_proc_wait(p4, NULL, APR_WAIT); printf("OK\n"); if ((*x) != MAX_COUNTER) { From 9115320992b880e855a267134be9baf5d2133f3e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 24 Sep 2001 04:17:25 +0000 Subject: [PATCH 2366/7878] Ignore the new test program. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62365 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.cvsignore b/test/.cvsignore index 72eeeed7c4a..06292c72168 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -47,3 +47,4 @@ testlockperf testsockets testuser test.fil +testprocmutex From bc2741be0124ec4ca8d005ce5df909afa71e35bc Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 24 Sep 2001 04:41:04 +0000 Subject: [PATCH 2367/7878] Clean up a warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62366 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index b4d12ec0e4f..fb9e074182b 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -97,7 +97,7 @@ static int make_child(apr_proc_t **proc, apr_pool_t *p) return APR_SUCCESS; } -apr_status_t test_exclusive(const char *lockname) +static apr_status_t test_exclusive(const char *lockname) { apr_proc_t *p1, *p2, *p3, *p4; apr_status_t s1, s2, s3, s4; From 5f037b98f74dabddbab4a10b3978b82a4a76ce1d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 24 Sep 2001 05:37:28 +0000 Subject: [PATCH 2368/7878] Default the lock to NULL, so that we can test the soon-to-be-committed apr_file_mktemp function. Also, 160000 is too many iterations, this test was taking FAR too long to complete. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62367 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index fb9e074182b..bfe8739b8de 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -66,7 +66,7 @@ #include "test_apr.h" -#define MAX_ITER 40000 +#define MAX_ITER 4000 #define MAX_COUNTER (MAX_ITER * 4) apr_proc_mutex_t *proc_lock; @@ -146,7 +146,7 @@ int main(int argc, const char * const *argv) { apr_status_t rv; char errmsg[200]; - const char *lockname = "multi.lock"; + const char *lockname = NULL; const char *shmname = "shm.file"; apr_getopt_t *opt; char optchar; From 65c7a6f63ff49d5d27a211cfea6baeff99a9819f Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 24 Sep 2001 05:41:57 +0000 Subject: [PATCH 2369/7878] Add the apr_file_mktemp function. This creates and opens a temporary file, for use by the program. This file is created delete_on_close. The initial implementation only works on Unix, but Windows is coming soon. This also modifies all of the process lock functions that need a temporary file to use the new apr_file_mktemp function. Submitted by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62368 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++ file_io/unix/mktemp.c | 102 +++++++++++---------------------- include/apr_file_io.h | 10 ++++ include/arch/unix/fileio.h | 2 - include/arch/unix/locks.h | 2 +- include/arch/unix/proc_mutex.h | 4 +- locks/unix/crossproc.c | 51 ++++++++++------- locks/unix/locks.c | 6 +- locks/unix/proc_mutex.c | 65 ++++++++++++--------- 9 files changed, 123 insertions(+), 124 deletions(-) diff --git a/CHANGES b/CHANGES index 6029d74079a..79120d20631 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Add the apr_file_mktemp function. This creates and opens a + temporary file, for use by the program. This file is created + delete_on_close. The initial implementation only works on + Unix, but Windows is coming soon. [Ryan Bloom] + *) Make the unix version of apr_proc_wait_all_procs a simple wrapper around apr_proc_wait, and which extracts the exit code from the status returned by waitpid. diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 0376afc6474..b199e73f256 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -31,6 +31,9 @@ * SUCH DAMAGE. */ +#include "apr_private.h" +#include "apr_file_io.h" /* prototype of apr_mkstemp() */ +#include "apr_strings.h" /* prototype of apr_mkstemp() */ #include "fileio.h" /* prototype of apr_mkstemp() */ #ifndef HAVE_MKSTEMP @@ -49,13 +52,6 @@ #endif #define _open(a,b,c) open(a,b,c) -#if defined(LIBC_SCCS) && !defined(lint) -#if 0 -static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93"; -#endif -static const char rcsid[] = - "$FreeBSD: src/lib/libc/stdio/mktemp.c,v 1.19.2.1 2001/01/20 09:35:24 kris Exp $"; -#endif /* LIBC_SCCS and not lint */ #include #include @@ -66,70 +62,11 @@ static const char rcsid[] = #include #include -#ifdef SVR4 -/* arrange to compile it on my machine */ -char *_mktemp(char *); -#else -char *_mktemp __P((char *)); -static int _gettemp (char *, int *, int, int); -#endif - - static const unsigned char padchar[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; static uint32_t randseed=0; -#ifdef APR_STARTS_USING_IT -int -mkstemps(path, slen) - char *path; - int slen; -{ - int fd; - - return (_gettemp(path, &fd, 0, slen) ? fd : -1); -} -#endif /* APR_STARTS_USING_IT */ - -int apr_mkstemp(char *path) -{ - int fd; - - return (_gettemp(path, &fd, 0, 0) ? fd : -1); -} - -#ifdef APR_STARTS_USING_IT -char * -mkdtemp(path) - char *path; -{ - return(_gettemp(path, (int *)NULL, 1, 0) ? path : (char *)NULL); -} - -char * -_mktemp(path) - char *path; -{ - return(_gettemp(path, (int *)NULL, 0, 0) ? path : (char *)NULL); -} - -__warn_references(mktemp, - "warning: mktemp() possibly used unsafely; consider using mkstemp()"); - -char * -mktemp(path) - char *path; -{ - return(_mktemp(path)); -} -#endif /* APR_STARTS_USING_IT */ - -static int -_gettemp(path, doopen, domkdir, slen) - char *path; - register int *doopen; - int domkdir; - int slen; +static int gettemp(char *path, register int *doopen, int domkdir, int slen) { register char *start, *trv, *suffp; char *pad; @@ -226,9 +163,36 @@ _gettemp(path, doopen, domkdir, slen) #include /* for mkstemp() - FreeBSD */ #endif -int apr_mkstemp(char *template) +apr_status_t apr_file_mktemp(apr_file_t **fp, char *template, apr_pool_t *p) { - return mkstemp(template); + int fd; +#ifndef HAVE_MKSTEMP + int rv; +#endif + + (*fp) = apr_pcalloc(p, sizeof(**fp)); + (*fp)->cntxt = p; + (*fp)->timeout = -1; + (*fp)->blocking = BLK_ON; + (*fp)->flags = APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE; + +#ifndef HAVE_MKSTEMP + rv = gettemp(path, &fd, 0, 0); + if (rv == 0) { + return errno; + } +#else + fd = mkstemp(template); + if (fd == -1) { + return errno; + } +#endif + (*fp)->fname = apr_pstrdup(p, template); + (*fp)->filedes = fd; + unlink((*fp)->fname); + apr_pool_cleanup_register((*fp)->cntxt, (void *)(*fp), + apr_unix_file_cleanup, apr_unix_file_cleanup); + return APR_SUCCESS; } #endif /* !defined(HAVE_MKSTEMP) */ diff --git a/include/apr_file_io.h b/include/apr_file_io.h index d15f47fef95..de1b8c2db7e 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -575,6 +575,16 @@ APR_DECLARE(void) apr_file_set_inherit(apr_file_t *file); */ APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); +/** + * Open a temporary file + * @param fp The apr file to use as a temporary file. + * @param template The template to use when creating a temp file. + * @param p The pool to allocate the file out of. + * @ingroup apr_file_open + */ +APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *tmplt, + apr_pool_t *p); + #ifdef __cplusplus } #endif diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index cd3dd08485b..75daacaf599 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -153,7 +153,5 @@ apr_status_t apr_unix_file_cleanup(void *); mode_t apr_unix_perms2mode(apr_fileperms_t perms); apr_fileperms_t apr_unix_mode2perms(mode_t mode); -int apr_mkstemp(char *template); - #endif /* ! FILE_IO_H */ diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index c83e8d09c62..47f089c1433 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -139,7 +139,7 @@ struct apr_lock_t { int curr_locked; char *fname; #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE - int interproc; + apr_file_t *interproc; #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE pthread_mutex_t *pthread_interproc; diff --git a/include/arch/unix/proc_mutex.h b/include/arch/unix/proc_mutex.h index cff88145aa0..b401cd9dfe8 100644 --- a/include/arch/unix/proc_mutex.h +++ b/include/arch/unix/proc_mutex.h @@ -62,6 +62,8 @@ #include "apr_proc_mutex.h" #include "apr_pools.h" #include "apr_portable.h" +#include "apr_file_io.h" +#include "fileio.h" /* System headers required by Locks library */ #if APR_HAVE_SYS_TYPES_H @@ -145,7 +147,7 @@ struct apr_proc_mutex_t { int curr_locked; char *fname; #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE - int interproc; + apr_file_t *interproc; #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE pthread_mutex_t *pthread_interproc; diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index f555b2a219b..2ed15f3ad89 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -53,6 +53,7 @@ */ #include "apr.h" +#include "apr_file_io.h" #include "apr_strings.h" #include "locks.h" #include "fileio.h" /* for apr_mkstemp() */ @@ -77,9 +78,9 @@ static apr_status_t sysv_cleanup(void *lock_) apr_lock_t *lock=lock_; union semun ick; - if (lock->interproc != -1) { + if (lock->interproc->filedes != -1) { ick.val = 0; - semctl(lock->interproc, 0, IPC_RMID, ick); + semctl(lock->interproc->filedes, 0, IPC_RMID, ick); } return APR_SUCCESS; } @@ -89,15 +90,16 @@ static apr_status_t sysv_create(apr_lock_t *new, const char *fname) union semun ick; apr_status_t stat; - new->interproc = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600); + new->interproc = apr_palloc(new->pool, sizeof(*new->interproc)); + new->interproc->filedes = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600); - if (new->interproc < 0) { + if (new->interproc->filedes < 0) { stat = errno; sysv_cleanup(new); return stat; } ick.val = 1; - if (semctl(new->interproc, 0, SETVAL, ick) < 0) { + if (semctl(new->interproc->filedes, 0, SETVAL, ick) < 0) { stat = errno; sysv_cleanup(new); return stat; @@ -113,7 +115,7 @@ static apr_status_t sysv_acquire(apr_lock_t *lock) int rc; do { - rc = semop(lock->interproc, &op_on, 1); + rc = semop(lock->interproc->filedes, &op_on, 1); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -127,7 +129,7 @@ static apr_status_t sysv_release(apr_lock_t *lock) int rc; do { - rc = semop(lock->interproc, &op_off, 1); + rc = semop(lock->interproc->filedes, &op_off, 1); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -369,23 +371,25 @@ static apr_status_t fcntl_cleanup(void *lock_) if (status != APR_SUCCESS) return status; } - close(lock->interproc); return APR_SUCCESS; } static apr_status_t fcntl_create(apr_lock_t *new, const char *fname) { + int rv; + if (fname) { new->fname = apr_pstrdup(new->pool, fname); - new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644); + rv = apr_file_open(&new->interproc, new->fname, + APR_CREATE | APR_WRITE | APR_EXCL, 0644, new->pool); } else { new->fname = apr_pstrdup(new->pool, "/tmp/aprXXXXXX"); - new->interproc = apr_mkstemp(new->fname); + rv = apr_file_mktemp(&new->interproc, new->fname, new->pool); } - if (new->interproc < 0) { + if (rv != APR_SUCCESS) { apr_status_t stat = errno; fcntl_cleanup(new); @@ -404,7 +408,7 @@ static apr_status_t fcntl_acquire(apr_lock_t *lock) int rc; do { - rc = fcntl(lock->interproc, F_SETLKW, &lock_it); + rc = fcntl(lock->interproc->filedes, F_SETLKW, &lock_it); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -418,7 +422,7 @@ static apr_status_t fcntl_release(apr_lock_t *lock) int rc; do { - rc = fcntl(lock->interproc, F_SETLKW, &unlock_it); + rc = fcntl(lock->interproc->filedes, F_SETLKW, &unlock_it); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -480,23 +484,26 @@ static apr_status_t flock_cleanup(void *lock_) if (status != APR_SUCCESS) return status; } - close(lock->interproc); + apr_file_close(lock->interproc); unlink(lock->fname); return APR_SUCCESS; } static apr_status_t flock_create(apr_lock_t *new, const char *fname) { + int rv; + if (fname) { new->fname = apr_pstrdup(new->pool, fname); - new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600); + rv = apr_file_open(&new->interproc, new->fname, + APR_CREATE | APR_WRITE | APR_EXCL, 0644, new->pool); } else { new->fname = apr_pstrdup(new->pool, "/tmp/aprXXXXXX"); - new->interproc = apr_mkstemp(new->fname); + rv = apr_file_mktemp(&new->interproc, new->fname, new->pool); } - if (new->interproc < 0) { + if (rv != APR_SUCCESS) { apr_status_t stat = errno; flock_cleanup(new); @@ -513,7 +520,7 @@ static apr_status_t flock_acquire(apr_lock_t *lock) int rc; do { - rc = flock(lock->interproc, LOCK_EX); + rc = flock(lock->interproc->filedes, LOCK_EX); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -527,7 +534,7 @@ static apr_status_t flock_release(apr_lock_t *lock) int rc; do { - rc = flock(lock->interproc, LOCK_UN); + rc = flock(lock->interproc->filedes, LOCK_UN); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -550,14 +557,16 @@ static apr_status_t flock_child_init(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { apr_lock_t *new; + int rv; new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); memcpy(new, *lock, sizeof *new); new->pool = cont; new->fname = apr_pstrdup(cont, fname); - new->interproc = open(new->fname, O_WRONLY, 0600); - if (new->interproc == -1) { + rv = apr_file_open(&new->interproc, new->fname, + APR_CREATE | APR_WRITE, 0600, new->pool); + if (rv != APR_SUCCESS) { apr_status_t stat = errno; flock_destroy(new); diff --git a/locks/unix/locks.c b/locks/unix/locks.c index fe96abea631..7e5d3b69ea4 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -243,7 +243,7 @@ APR_DECLARE(apr_status_t) apr_lock_create_np(apr_lock_t **lock, apr_locktype_e t new->type = type; new->scope = scope; #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE - new->interproc = -1; + new->interproc = NULL; #endif if ((stat = create_lock(new, mech, fname)) != APR_SUCCESS) @@ -370,7 +370,7 @@ APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, const APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) { #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE - oslock->crossproc = lock->interproc; + oslock->crossproc = lock->interproc->filedes; #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE oslock->pthread_interproc = lock->pthread_interproc; @@ -395,7 +395,7 @@ APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thel (*lock)->pool = pool; } #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE - (*lock)->interproc = thelock->crossproc; + apr_os_file_put(&(*lock)->interproc, &thelock->crossproc, pool); #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE (*lock)->pthread_interproc = thelock->pthread_interproc; diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 037b5a160e9..125a9b26f86 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -77,9 +77,9 @@ static apr_status_t proc_mutex_sysv_cleanup(void *mutex_) apr_proc_mutex_t *mutex=mutex_; union semun ick; - if (mutex->interproc != -1) { + if (mutex->interproc->filedes != -1) { ick.val = 0; - semctl(mutex->interproc, 0, IPC_RMID, ick); + semctl(mutex->interproc->filedes, 0, IPC_RMID, ick); } return APR_SUCCESS; } @@ -90,15 +90,16 @@ static apr_status_t proc_mutex_sysv_create(apr_proc_mutex_t *new_mutex, union semun ick; apr_status_t stat; - new_mutex->interproc = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600); + new_mutex->interproc = apr_palloc(new_mutex->pool, sizeof(*new_mutex->interproc)); + new_mutex->interproc->filedes = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600); - if (new_mutex->interproc < 0) { + if (new_mutex->interproc->filedes < 0) { stat = errno; proc_mutex_sysv_cleanup(new_mutex); return stat; } ick.val = 1; - if (semctl(new_mutex->interproc, 0, SETVAL, ick) < 0) { + if (semctl(new_mutex->interproc->filedes, 0, SETVAL, ick) < 0) { stat = errno; proc_mutex_sysv_cleanup(new_mutex); return stat; @@ -115,7 +116,7 @@ static apr_status_t proc_mutex_sysv_acquire(apr_proc_mutex_t *mutex) int rc; do { - rc = semop(mutex->interproc, &proc_mutex_op_on, 1); + rc = semop(mutex->interproc->filedes, &proc_mutex_op_on, 1); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -129,7 +130,7 @@ static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex) int rc; do { - rc = semop(mutex->interproc, &proc_mutex_op_off, 1); + rc = semop(mutex->interproc->filedes, &proc_mutex_op_off, 1); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -376,7 +377,7 @@ static apr_status_t proc_mutex_fcntl_cleanup(void *mutex_) if (status != APR_SUCCESS) return status; } - close(mutex->interproc); + apr_file_close(mutex->interproc); return APR_SUCCESS; } @@ -384,23 +385,27 @@ static apr_status_t proc_mutex_fcntl_cleanup(void *mutex_) static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, const char *fname) { + int rv; + if (fname) { new_mutex->fname = apr_pstrdup(new_mutex->pool, fname); - new_mutex->interproc = open(new_mutex->fname, - O_CREAT | O_WRONLY | O_EXCL, 0644); + rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, + APR_CREATE | APR_WRITE | APR_EXCL, 0644, + new_mutex->pool); } else { new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX"); - new_mutex->interproc = apr_mkstemp(new_mutex->fname); + rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname, + new_mutex->pool); } - - if (new_mutex->interproc < 0) { + + if (rv != APR_SUCCESS) { proc_mutex_fcntl_cleanup(new_mutex); return errno; } new_mutex->curr_locked = 0; - unlink(new_mutex->fname); +/* unlink(new_mutex->fname); */ apr_pool_cleanup_register(new_mutex->pool, (void*)new_mutex, proc_mutex_fcntl_cleanup, @@ -413,7 +418,7 @@ static apr_status_t proc_mutex_fcntl_acquire(apr_proc_mutex_t *mutex) int rc; do { - rc = fcntl(mutex->interproc, F_SETLKW, &proc_mutex_lock_it); + rc = fcntl(mutex->interproc->filedes, F_SETLKW, &proc_mutex_lock_it); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -427,7 +432,7 @@ static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex) int rc; do { - rc = fcntl(mutex->interproc, F_SETLKW, &proc_mutex_unlock_it); + rc = fcntl(mutex->interproc->filedes, F_SETLKW, &proc_mutex_unlock_it); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -488,7 +493,7 @@ static apr_status_t proc_mutex_flock_cleanup(void *mutex_) if (status != APR_SUCCESS) return status; } - close(mutex->interproc); + apr_file_close(mutex->interproc); unlink(mutex->fname); return APR_SUCCESS; } @@ -496,17 +501,21 @@ static apr_status_t proc_mutex_flock_cleanup(void *mutex_) static apr_status_t proc_mutex_flock_create(apr_proc_mutex_t *new_mutex, const char *fname) { + int rv; + if (fname) { new_mutex->fname = apr_pstrdup(new_mutex->pool, fname); - new_mutex->interproc = open(new_mutex->fname, - O_CREAT | O_WRONLY | O_EXCL, 0600); + rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, + APR_CREATE | APR_WRITE | APR_EXCL, 0644, + new_mutex->pool); } else { new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX"); - new_mutex->interproc = apr_mkstemp(new_mutex->fname); + rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname, + new_mutex->pool); } - - if (new_mutex->interproc < 0) { + + if (rv != APR_SUCCESS) { proc_mutex_flock_cleanup(new_mutex); return errno; } @@ -522,7 +531,7 @@ static apr_status_t proc_mutex_flock_acquire(apr_proc_mutex_t *mutex) int rc; do { - rc = flock(mutex->interproc, LOCK_EX); + rc = flock(mutex->interproc->filedes, LOCK_EX); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -536,7 +545,7 @@ static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *mutex) int rc; do { - rc = flock(mutex->interproc, LOCK_UN); + rc = flock(mutex->interproc->filedes, LOCK_UN); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -560,14 +569,16 @@ static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, const char *fname) { apr_proc_mutex_t *new_mutex; + int rv; new_mutex = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); memcpy(new_mutex, *mutex, sizeof *new_mutex); new_mutex->pool = pool; new_mutex->fname = apr_pstrdup(pool, fname); - new_mutex->interproc = open(new_mutex->fname, O_WRONLY, 0600); - if (new_mutex->interproc == -1) { + rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, + APR_CREATE | APR_WRITE, 0600, new_mutex->pool); + if (rv != APR_SUCCESS) { proc_mutex_flock_destroy(new_mutex); return errno; } @@ -705,7 +716,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, new_mutex->pool = pool; #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE - new_mutex->interproc = -1; + new_mutex->interproc = NULL; #endif if ((stat = proc_mutex_create(new_mutex, mech, fname)) != APR_SUCCESS) From 9ff679f7ca8af13eb521116b5a05f57b09c41738 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 24 Sep 2001 06:35:22 +0000 Subject: [PATCH 2370/7878] Use the mktemp.c file from unix on Windows as well. This requires making it use APR functions. This compiles cleanly, but I can't easily test it on Windows. I will check it out on Unix and test it there in a few seconds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62369 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 +++ file_io/unix/mktemp.c | 64 +++++++++++++++++++++++++------------------ 2 files changed, 41 insertions(+), 27 deletions(-) diff --git a/apr.dsp b/apr.dsp index defa7c3d221..e5c7746d3e5 100644 --- a/apr.dsp +++ b/apr.dsp @@ -101,6 +101,10 @@ SOURCE=.\file_io\win32\dir.c # End Source File # Begin Source File +SOURCE=.\file_io\unix\mktemp.c +# End Source File +# Begin Source File + SOURCE=.\file_io\unix\fileacc.c # End Source File # Begin Source File diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index b199e73f256..f307bf04c92 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -41,17 +41,19 @@ #ifndef __warn_references #define __warn_references(a,b) #endif -#ifdef SVR4 +#if defined(SVR4) || defined(WIN32) +#ifdef SVR4 #include +#endif #define arc4random() rand() #define seedrandom(a) srand(a) #else +#ifdef APR_HAS_STDINT_H #include +#endif #define arc4random() random() #define seedrandom(a) srandom(a) #endif -#define _open(a,b,c) open(a,b,c) - #include #include @@ -64,15 +66,16 @@ static const unsigned char padchar[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; -static uint32_t randseed=0; +static apr_uint32_t randseed=0; -static int gettemp(char *path, register int *doopen, int domkdir, int slen) +static int gettemp(char *path, apr_file_t *doopen, int domkdir, int slen, + apr_pool_t *p) { register char *start, *trv, *suffp; char *pad; - struct stat sbuf; - int rval; - uint32_t randnum; + apr_finfo_t sbuf; + apr_status_t rv; + apr_uint32_t randnum; if (doopen && domkdir) { errno = EINVAL; @@ -109,11 +112,11 @@ static int gettemp(char *path, register int *doopen, int domkdir, int slen) break; if (*trv == '/') { *trv = '\0'; - rval = stat(path, &sbuf); + rv = apr_stat(&sbuf, path, APR_FINFO_TYPE, p); *trv = '/'; - if (rval != 0) + if (rv != APR_SUCCESS) return(0); - if (!S_ISDIR(sbuf.st_mode)) { + if (sbuf.filetype != APR_DIR) { errno = ENOTDIR; return(0); } @@ -125,18 +128,18 @@ static int gettemp(char *path, register int *doopen, int domkdir, int slen) for (;;) { errno = 0; if (doopen) { - if ((*doopen = - _open(path, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0) + if ((rv = apr_file_open(&doopen, path, APR_CREATE|APR_EXCL|APR_READ|APR_WRITE, + 0600, p)) == APR_SUCCESS) return(1); if (errno != EEXIST) return(0); } else if (domkdir) { - if (mkdir(path, 0700) == 0) + if (apr_dir_make(path, 0700, p) == 0) return(1); if (errno != EEXIST) return(0); - } else if (lstat(path, &sbuf)) - return(errno == ENOENT ? 1 : 0); + } else if ((rv = apr_lstat(&sbuf, path, APR_FINFO_TYPE, p)) != APR_SUCCESS) + return(rv == ENOENT ? 1 : 0); /* If we have a collision, cycle through the space of filenames */ for (trv = start;;) { @@ -162,37 +165,44 @@ static int gettemp(char *path, register int *doopen, int domkdir, int slen) #if APR_HAVE_UNISTD_H #include /* for mkstemp() - FreeBSD */ #endif +#endif /* !defined(HAVE_MKSTEMP) */ -apr_status_t apr_file_mktemp(apr_file_t **fp, char *template, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_pool_t *p) { - int fd; #ifndef HAVE_MKSTEMP int rv; +#else + int fd; #endif +#ifndef HAVE_MKSTEMP + rv = gettemp(template, (*fp), 0, 0, p); + if (rv == 0) { + return errno; + } +#else (*fp) = apr_pcalloc(p, sizeof(**fp)); (*fp)->cntxt = p; (*fp)->timeout = -1; (*fp)->blocking = BLK_ON; (*fp)->flags = APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE; -#ifndef HAVE_MKSTEMP - rv = gettemp(path, &fd, 0, 0); - if (rv == 0) { - return errno; - } -#else fd = mkstemp(template); if (fd == -1) { return errno; } -#endif (*fp)->fname = apr_pstrdup(p, template); (*fp)->filedes = fd; - unlink((*fp)->fname); + +#endif + apr_file_remove((*fp)->fname, p); +#ifdef WIN32 + apr_pool_cleanup_register((*fp)->cntxt, (void *)(*fp), + file_cleanup, file_cleanup); +#else apr_pool_cleanup_register((*fp)->cntxt, (void *)(*fp), apr_unix_file_cleanup, apr_unix_file_cleanup); +#endif return APR_SUCCESS; } -#endif /* !defined(HAVE_MKSTEMP) */ From 0931bdba0280a32bbbcabc7661e71a3d932b7c4c Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 24 Sep 2001 16:03:27 +0000 Subject: [PATCH 2371/7878] Convert from the hardcoded Unix file permissions to the APR file permissions Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62370 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/mktemp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index f307bf04c92..906d0a982df 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -129,12 +129,13 @@ static int gettemp(char *path, apr_file_t *doopen, int domkdir, int slen, errno = 0; if (doopen) { if ((rv = apr_file_open(&doopen, path, APR_CREATE|APR_EXCL|APR_READ|APR_WRITE, - 0600, p)) == APR_SUCCESS) + APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) return(1); if (errno != EEXIST) return(0); } else if (domkdir) { - if (apr_dir_make(path, 0700, p) == 0) + if (apr_dir_make(path, + APR_UREAD | APR_UWRITE | APR_UEXECUTE, p) == 0) return(1); if (errno != EEXIST) return(0); From 1c7bf48a70e5ada6642483396cb3510bbe27a06d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Sep 2001 20:33:49 +0000 Subject: [PATCH 2372/7878] Works in progress and a structure for my experiments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62371 13f79535-47bb-0310-9956-ffa450edef68 --- build/cvtdsp.pl | 307 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 288 insertions(+), 19 deletions(-) diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl index 536018bbda2..524ba90b2d8 100644 --- a/build/cvtdsp.pl +++ b/build/cvtdsp.pl @@ -19,6 +19,15 @@ elsif ($ARGV[0] eq '-d') { find(\&todebugpools, '.'); } +elsif ($ARGV[0] eq '-b') { + find(\&tobrowse, '.'); +} +elsif ($ARGV[0] eq '-m') { + ## 0 - conapp, 1 - dll lib, 2 - static lib + $dsptype = 2; + $name = "apr"; + onemake(); +} else { print "Specify -5 or -6 for Visual Studio 5 or 6 (98) .dsp format\n"; print "Specify -w3 or -w4 for .dsp build with warning level 3 or 4 (strict)\n\n"; @@ -29,7 +38,7 @@ sub tovc5 { - if (m|.dsp$|) { + if (m|\.dsp$|) { $oname = $_; $tname = '.#' . $_; $verchg = 0; @@ -66,7 +75,7 @@ sub tovc5 { sub tovc6 { - if (m|.dsp$|) { + if (m|\.dsp$|) { $oname = $_; $tname = '.#' . $_; $verchg = 0; @@ -101,17 +110,17 @@ sub tovc6 { sub tow3 { - if (m|.dsp$|) { + if (m|\.dsp$| || m|\.mak$|) { $oname = $_; $tname = '.#' . $_; - $verchg = 0; - $srcfl = new IO::File $oname, "r" || die; + $verchg = 0; + $srcfl = new IO::File $_, "r" || die; $dstfl = new IO::File $tname, "w" || die; while ($src = <$srcfl>) { - if ($src =~ s|^(# ADD CPP .*)/W4 (.*)|$1/W3 $2|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD BASE CPP .*)/W4 (.*)|$1/W3 $2|) { + while ($src =~ m|\\\n$|) { + $src = $src . <$srcfl> + } + if ($src =~ s|(\bCPP.*) /W4(.*)|$1 /W3$2|) { $verchg = -1; } print $dstfl $src; @@ -131,17 +140,17 @@ sub tow3 { sub tow4 { - if (m|.dsp$|) { + if (m|\.dsp$| || m|\.mak$|) { $oname = $_; $tname = '.#' . $_; - $verchg = 0; - $srcfl = new IO::File $oname, "r" || die; + $verchg = 0; + $srcfl = new IO::File $_, "r" || die; $dstfl = new IO::File $tname, "w" || die; while ($src = <$srcfl>) { - if ($src =~ s|^(# ADD CPP .*)/W3 (.*)|$1/W4 $2|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD BASE CPP .*)/W3 (.*)|$1/W4 $2|) { + while ($src =~ m|\\\n$|) { + $src = $src . <$srcfl> + } + if ($src =~ s|(\bCPP.*) /W3(.*)|$1 /W4$2|) { $verchg = -1; } print $dstfl $src; @@ -161,7 +170,7 @@ sub tow4 { sub tovc64 { - if (m|.dsp$| || m|.mak$|) { + if (m|\.dsp$| || m|\.mak$|) { $oname = $_; $tname = '.#' . $_; $verchg = 0; @@ -171,9 +180,32 @@ sub tovc64 { while ($src =~ m|\\\n$|) { $src = $src . <$srcfl> } - if ($src =~ s|(\bCPP.*)/FD (.*)|$1$2|s) { + if ($src =~ s|Win32 \(x86\) (Release)|Win32 (IA64) $1|s) { $verchg = -1; } + if ($src =~ s|Win32 \(x86\) (Debug)|Win32 (IA64) $1|s) { + $verchg = -1; + } + if ($src =~ s| - Win32 (Release)| - Win32 (IA64) $1|s) { + $verchg = -1; + } + if ($src =~ s| - Win32 (Debug)| - Win32 (IA64) $1|s) { + $verchg = -1; + } + # Cross compilation exceptions + if (!(m|gen[^/]*$| || m|dftables[^/]*$|)) { + if ($src =~ s|(\bCPP.* /W3)(.*) /FD(.*)|$1 /As64 /Wp64$2$3|s) { + $verchg = -1; + } + if ($src =~ s|(\bLINK.*/machine):I386(.*)|$1:IA64$2|s) { + $verchg = -1; + } + } + else { + if ($src =~ s|(\bCPP.* /W3)(.*) /FD(.*)|$1 /As32 /Wp64$2$3|s) { + $verchg = -1; + } + } print $dstfl $src; } undef $srcfl; @@ -191,7 +223,7 @@ sub tovc64 { sub todebugpools { - if (m|.dsp$|) { + if (m|\.dsp$|) { $oname = $_; $tname = '.#' . $_; $verchg = 0; @@ -219,3 +251,240 @@ sub todebugpools { } } +sub tobrowsesources { + + if (m|\.dsp$|) { + $oname = $_; + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $oname, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|^(# ADD CPP .*)( /Fd)|$1 /Fr "/httpd-2.0/srclib/apr"$2|) { + $verchg = -1; + } + print $dstfl $src; + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted project " . $oname . " to browse sources in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } + } +} + +sub frommakefiles { + + if (m|\.mak\.in$|) { + $oname = $_; + $dname = $_; + $_ =~ s/\.mak\.in/.dsp/; + $verchg = 0; + $srcfl = new IO::File $oname, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|^(# ADD CPP .*)( /Fd)|$1 /Fr "/httpd-2.0/srclib/apr"$2|) { + $verchg = -1; + } + print $dstfl $src; + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted project " . $oname . " to browse sources in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } + } +} + + +sub onemake { + + if ($dsptype == 0) { + $cdefs = qq{/D "WIN32" /D "_CONSOLE"}; + $lmodel = qq{/subsystem:console}; + $targname = "Win32 (x86) Console Application"; + $targid = "0x0103"; + $debpath = "Debug"; $relpath = "Release"; + } elsif ($dsptype == 1) { + $cdefs = qq{/D "WIN32" /D "_WINDOWS"}; + $lmodel = qq{/subsystem:windows /dll}; + $targname = "Win32 (x86) Dynamic-Link Library"; + $targid = "0x0102"; + $debpath = "Debug"; $relpath = "Release"; + } elsif($dsptype == 2) { + $cdefs = qq{/D "WIN32" /D "_CONSOLE"}; + $lmodel = qq{/subsystem:console}; + $targname = "Win32 (x86) Static Library"; + $targid = "0x0104"; + $debpath = "LibD"; $relpath = "LibR"; + } + $file = dspheader(); + + + $second = ""; + + $model = "Release"; + $usedebuglib = "0"; + $debugdef = "NDEBUG"; + $cflags = "/MD /W3 /O2"; + $cincl = qq{/I "./include" /I "./os/win32" /I "./srclib/apr/include" /I "./srclib/apr-util/include"}; + $lflags = qq{/map}; + $file .= dsponemodel(); + + $second = "ELSE"; + $model = "Debug"; + $usedebuglib = "1"; + $debugdef = "_DEBUG"; + $cflags = "/MDd /W3 /GX /Zi /Od"; + $cincl = qq{/I "./include" /I "./os/win32" /I "./srclib/apr/include" /I "./srclib/apr-util/include"}; + $lflags = qq{/incremental:no /debug}; + $file .= dsponemodel(); + + $file .= qq{ +!ENDIF + +# Begin Target + +# Name "$name - Win32 Release" +# Name "$name - Win32 Debug" +}; + + $toroot = "."; + +#HERE IS OUR FOREACH! + $file .= qq{# Begin Source File + +SOURCE=./server/main.c +# End Source File +}; + + if ($dsptype == 0) { + #HERE IS OUR ICON! + $icon="$toroot/build/win32/apache.ico"; + $file .= qq{# Begin Source File + +SOURCE=$icon +# End Source File +}; + $icon = "icon=" . $icon . " "; + } + if ($dsptype == 0 || $dsptype == 1) { + $file .= qq{ +# Begin Source File + +SOURCE=./$name.rc +# End Source File +# Begin Source File + +SOURCE=$toroot/include/ap_release.h +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=$toroot/include/ap_release.h $toroot/build/win32/win32ver.awk + +"./$name.rc" : \$(SOURCE) "\$(INTDIR)" "\$(OUTDIR)" + awk -f $toroot/build/win32/win32ver.awk $name "Apache HTTP Server" $toroot/include/ap_release.h $icon> ./Apache.rc + +# End Custom Build +# End Source File +}; + } + $file .= qq{ +# End Target +# End Project +}; + print $file; +} + +sub dspheader { + if ($dsptype == 1) { + $midl = "MTL=midl.exe\n"; + } else { + $midl = "" + } +qq{# Microsoft Developer Studio Project File - Name="$name" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "$targname" $targid + +CFG=$name - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "$name.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "$name.mak" CFG="$name - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "$name - Win32 Release" (based on "$targname") +!MESSAGE "$name - Win32 Debug" (based on "$targname") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +${midl}RSC=rc.exe +}; +} +sub dsponemodel { + if ($model eq "Release") { + $targpath = $relpath; + } else { + $targpath = $debpath; + } + if ($dsptype == 1) { + $midl = +qq{# ADD BASE MTL /nologo /D "$debugdef" /win32 +# ADD MTL /nologo /D "$debugdef" /mktyplib203 /win32 +}; } + if ($dsptype == 2) { + $linkop = qq{LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +}; + } else { + $linkop = qq{LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo $lmodel $lflags /machine:I386 +# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo $lmodel $lflags /machine:I386 +}; + } + +qq{ +!${second}IF "\$(CFG)" == "$name - Win32 $model" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries $usedebuglib +# PROP BASE Output_Dir "$targpath" +# PROP BASE Intermediate_Dir "$targpath" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries $usedebuglib +# PROP Output_Dir "$targpath" +# PROP Intermediate_Dir "$targpath" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo $cflags $cincl /D "$debugdef" $cdefs /FD /c +# ADD CPP /nologo $cflags $cincl /D "$debugdef" $cdefs /Fd"$targpath/$name" /FD /c +${midl}# ADD BASE RSC /l 0x409 /d "$debugdef" +# ADD RSC /l 0x409 /d "$debugdef" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +$linkop}; +} \ No newline at end of file From fe3c5011d5c6c152acf915ac551664614e44780f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Sep 2001 20:46:47 +0000 Subject: [PATCH 2373/7878] Let win32 get away with all sorts of abuse at /W4 or /Wall, by ignoring all errors > /W3 within Win32 header files. But not in _our_ code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62372 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index ada69538e2e..0a03170c781 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -70,6 +70,12 @@ #ifndef APR_H #define APR_H +/* Ignore most warnings (back down to /W3) for poorly constructed headers + */ +#if defined(_MSC_VER) && _MSC_VER >= 1200 +#pragma warning(push, 3) +#endif + /* Has windows.h already been included? If so, our preferences don't matter, * but we will still need the winsock things no matter what was included. * If not, include a restricted set of windows headers to our tastes. @@ -117,6 +123,12 @@ #include #include +/* Done with badly written headers + */ +#if defined(_MSC_VER) && _MSC_VER >= 1200 +#pragma warning(pop) +#endif + /* disable or reduce the frequency of... * C4057: indirection to slightly different base types * C4075: slight indirection changes (unsigned short* vs short[]) @@ -126,7 +138,7 @@ * C4244: int to char/short - precision loss * */ -#pragma warning(disable: 4100 4127 4201; once: 4057 4075 4244) +#pragma warning(disable: 4100 4127 4201 4514; once: 4057 4075 4244) #define APR_INLINE __inline #define APR_HAS_INLINE 1 From 9cc68d2803873e91c2cbf9bd3540711e2e706cdd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Sep 2001 21:34:09 +0000 Subject: [PATCH 2374/7878] Thanks Mr. GStein for pointing out the error of my ways. Document a disabled warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62373 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index 0a03170c781..ba373e110a7 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -136,7 +136,7 @@ * C4127: conditional expression is constant * C4201: nonstandard extension nameless struct/unions * C4244: int to char/short - precision loss - * + * C4514: unreferenced inline function removed */ #pragma warning(disable: 4100 4127 4201 4514; once: 4057 4075 4244) From 91b26bdb00ba1234dd662268c5263965e4ecf784 Mon Sep 17 00:00:00 2001 From: "Victor J. Orlikowski" Date: Tue, 25 Sep 2001 05:04:58 +0000 Subject: [PATCH 2375/7878] AIX emulated dlopen() cleanups... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62374 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + dso/aix/dso.c | 28 ++++++++++++++++++++++++---- include/arch/aix/dso.h | 2 +- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 96b69e07d42..87eb4c16b34 100644 --- a/configure.in +++ b/configure.in @@ -210,6 +210,7 @@ INSTALL_SUBDIRS="none" case $host in i386-ibm-aix* | *-ibm-aix[1-2].* | *-ibm-aix3.* | *-ibm-aix4.1 | *-ibm-aix4.1.* | *-ibm-aix4.2 | *-ibm-aix4.2.*) OSDIR="aix" + APR_ADDTO(LDFLAGS,-lld) eolstr="\\n" ;; *-os2*) diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 1ddd42d0c0c..7a9d950ffde 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -85,7 +85,8 @@ #include #include #include -#include "aix/dso.h" +#include "dso.h" +#include "apr_portable.h" #if APR_HAS_DSO @@ -132,6 +133,23 @@ struct dl_info { * add the basic "wrappers" here. */ +APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, + apr_os_dso_handle_t osdso, + apr_pool_t *pool) +{ + *aprdso = apr_pcalloc(pool, sizeof **aprdso); + (*aprdso)->handle = osdso; + (*aprdso)->pool = pool; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *osdso, + apr_dso_handle_t *aprdso) +{ + *osdso = aprdso->handle; + return APR_SUCCESS; +} + static apr_status_t dso_cleanup(void *thedso) { apr_dso_handle_t *dso = thedso; @@ -148,14 +166,16 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, { void *os_handle = dlopen((char *)path, RTLD_NOW | RTLD_GLOBAL); + *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); + if(os_handle == NULL) { (*res_handle)->errormsg = dlerror(); return APR_EDSOOPEN; } - *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = (void*)os_handle; - (*res_handle)->cont = ctx; + (*res_handle)->pool = ctx; + (*res_handle)->errormsg = NULL; apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); @@ -164,7 +184,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); + return apr_pool_cleanup_run(handle->pool, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, diff --git a/include/arch/aix/dso.h b/include/arch/aix/dso.h index d0002600596..ea8bf50ca4b 100644 --- a/include/arch/aix/dso.h +++ b/include/arch/aix/dso.h @@ -69,7 +69,7 @@ const char *dlerror(void); int dlclose(void *handle); struct apr_dso_handle_t { - apr_pool_t *cont; + apr_pool_t *pool; void *handle; const char *errormsg; }; From 98b7c1f0dc331de499e2d4466d047f0d3845fb0b Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 25 Sep 2001 11:42:46 +0000 Subject: [PATCH 2376/7878] Add suitable #if protection to non-portable function apr_proc_mutex_create_np() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62375 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_proc_mutex.h | 3 +++ locks/os2/proc_mutex.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index b4d522dcba6..8f4471d7f1d 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -111,10 +111,13 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, * * @param pool the pool from which to allocate the mutex. */ +#if APR_HAS_LOCK_CREATE_NP APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, const char *fname, apr_lockmech_e_np mech, apr_pool_t *pool); +#endif + /** * Re-open a mutex in a child process. * @param mutex The newly re-opened mutex structure. diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 8cf331bdbf0..d8a81e29dec 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -67,6 +67,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, return APR_ENOTIMPL; } +#if APR_HAS_LOCK_CREATE_NP APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, const char *fname, apr_lockmech_e_np mech, @@ -74,6 +75,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, { return APR_ENOTIMPL; } +#endif APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, const char *fname, From bd69dfd49bbe1d0263722235669b5e1f0ceadb0f Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 26 Sep 2001 18:25:04 +0000 Subject: [PATCH 2377/7878] More STATUS items to take care of. Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62376 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 0c08e575ad7..b9837a626d2 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/09/20 16:26:07 $] +Last modified at [$Date: 2001/09/26 18:25:04 $] Release: @@ -28,6 +28,13 @@ RELEASE SHOWSTOPPERS: since apr_proc_create didn't allocate the apr_proc_t storage. (Aren't transparent types swell?) Suggestions? + * The new lock API is a full replacement for the old API, save + for the apr_lock_data_get/apr_lock_data_set functions. These + should be translated into apr_proc_mutex_data_get and + apr_proc_mutex_data_set to be complete. + Status: This should be in place before we make an APR release. + Aaron will do it unless someone beats him to it. + RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Get OTHER_CHILD support into Win32 @@ -212,6 +219,28 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: FreeBSD. MsgID: <20010828091959.D17570@ebuilt.com> + + * Currently it is difficult if not impossible to return a proper + status code from a thread using apr_thread_exit(), since the + value must be a (apr_status_t*), but the pool where this would + normally be allocated is in that same function immediately + thereafter destroyed. Simply changing the type of this parameter + to (apr_status_t) should solve the problem (along with some + internal changes in apr_thread_join() to accomodate). + Status: Aaron is working on this. + + * There are some optimizations that can be done to the new + apr_proc_*() functions (on UNIX). One that may reduce pointer + indirection would be to make the apr_proc_mutex_unix_lock_methods_t + first-class members of the apr_proc_mutex_t structure. + + * Condition variables are tricky enough to use, and even trickier + to implement properly. We could really use a better test case + for those subtle quirks that sometimes creep into CV implementations. + + * Once we are fully satisfied with the new lock API, we can + begin to migrate the old API to be implemented on top of the + new one, or just decide to get rid of it altogether. Documentation that needs writing: From 6ac513ccfb894d91ca9152c30b74f51d13db8524 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 26 Sep 2001 20:55:33 +0000 Subject: [PATCH 2378/7878] Add pool accessors to the apr_thread_mutex_t datatype. Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62377 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_thread_mutex.h | 6 ++++++ locks/beos/thread_mutex.c | 2 ++ locks/netware/thread_mutex.c | 2 ++ locks/os2/thread_mutex.c | 3 +++ locks/unix/thread_mutex.c | 2 ++ locks/win32/thread_mutex.c | 3 +++ 7 files changed, 21 insertions(+) diff --git a/CHANGES b/CHANGES index 79120d20631..b334c16b993 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Add pool accessors to the apr_thread_mutex_t datatype. + [Aaron Bannert ] + *) Add the apr_file_mktemp function. This creates and opens a temporary file, for use by the program. This file is created delete_on_close. The initial implementation only works on diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 3159bd8f3df..6e7b434b381 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -114,6 +114,12 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex); */ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex); +/** + * Get the pool used by this thread_mutex. + * @return apr_pool_t the pool + */ +APR_POOL_DECLARE_ACCESSOR(thread_mutex); + #endif #ifdef __cplusplus diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index 0f3cc1d9c89..b99a0096c96 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -91,3 +91,5 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) return APR_ENOTIMPL; } +APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex) + diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index 4a4666f8a0a..466c6490713 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -90,3 +90,5 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) return APR_ENOTIMPL; } +APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex) + diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index 4464ec1a8be..3d46d2a55d3 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -131,3 +131,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) return APR_FROM_OS_ERROR(rc); } + +APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex) + diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 40c6836433d..4509ba3ee05 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -223,4 +223,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) return stat; } +APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex) + #endif /* APR_HAS_THREADS */ diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 86360c36eff..9246dbd6dfb 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -106,3 +106,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) { return apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup); } + +APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex) + From a1bbe27564d197131dccf1c34f6bfb10b96712eb Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Thu, 27 Sep 2001 16:44:13 +0000 Subject: [PATCH 2379/7878] added a remark to apr_file_mktemp, as I didn't realise the template gets overridden, so I'm sure others wouldn't either PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62378 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index de1b8c2db7e..ae2dcfb3f60 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -581,6 +581,13 @@ APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); * @param template The template to use when creating a temp file. * @param p The pool to allocate the file out of. * @ingroup apr_file_open + * @remark + * This function generates a unique temporary file name from template. + * The last six characters of template must be XXXXXX and these are replaced + * with a string that makes the filename unique. Since it will be modified, + * template must not be a string constant, but should be declared as a character + * array. + * */ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *tmplt, apr_pool_t *p); From da79cde37197c93648a760c5f9bc5ffa61a5cd14 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 28 Sep 2001 03:43:05 +0000 Subject: [PATCH 2380/7878] optimize apr_pstrcat by storing the lengths of the first 6 strings (changed const to #define as suggested, and so that it compiles on NT) Submitted by: Brian Pane Reviewed by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62379 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ strings/apr_strings.c | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index b334c16b993..72ddee38f3d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Optimize apr_pstrcat by caching lengths of first 6 strings + [Brian Pane ] + *) Add pool accessors to the apr_thread_mutex_t datatype. [Aaron Bannert ] diff --git a/strings/apr_strings.c b/strings/apr_strings.c index e8a1c2f2667..a516cc06b38 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -65,6 +65,9 @@ #include /* NULL */ #endif +/** this is used to cache lengths in apr_pstrcat */ +#define MAX_SAVED_LENGTHS 6 + APR_DECLARE(char *) apr_pstrdup(apr_pool_t *a, const char *s) { char *res; @@ -110,6 +113,8 @@ APR_DECLARE(void *) apr_pmemdup(apr_pool_t *a, const void *m, apr_size_t n) APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) { char *cp, *argp, *res; + apr_size_t saved_lengths[MAX_SAVED_LENGTHS]; + int nargs = 0; /* Pass one --- find length of required string */ @@ -119,7 +124,11 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) va_start(adummy, a); while ((cp = va_arg(adummy, char *)) != NULL) { - len += strlen(cp); + apr_size_t cplen = strlen(cp); + if (nargs < MAX_SAVED_LENGTHS) { + saved_lengths[nargs++] = cplen; + } + len += cplen; } va_end(adummy); @@ -133,8 +142,16 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) va_start(adummy, a); + nargs = 0; while ((argp = va_arg(adummy, char *)) != NULL) { len = strlen(argp); + if (nargs < MAX_SAVED_LENGTHS) { + len = saved_lengths[nargs++]; + } + else { + len = strlen(argp); + } + memcpy(cp, argp, len); cp += len; } From 87a437707895a8a53ed85682483e2be1ea39a633 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 28 Sep 2001 04:11:20 +0000 Subject: [PATCH 2381/7878] this time make it actually an optimization ;( git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62380 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strings.c | 1 - 1 file changed, 1 deletion(-) diff --git a/strings/apr_strings.c b/strings/apr_strings.c index a516cc06b38..b529c64ff94 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -144,7 +144,6 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) nargs = 0; while ((argp = va_arg(adummy, char *)) != NULL) { - len = strlen(argp); if (nargs < MAX_SAVED_LENGTHS) { len = saved_lengths[nargs++]; } From f697e63d96191f159455b7c1179741bb1b2a9dac Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 28 Sep 2001 14:05:23 +0000 Subject: [PATCH 2382/7878] Remove SMS and all references. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62381 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 45 +- apr.dsp | 28 - configure.in | 11 - include/apr.hw | 3 +- include/apr_pools.h | 41 -- include/apr_portable.h | 17 - include/apr_sms.h | 439 ----------- include/apr_sms_blocks.h | 99 --- include/apr_sms_threads.h | 109 --- include/apr_sms_tracking.h | 97 --- include/apr_sms_trivial.h | 104 --- include/arch/netware/apr_private.h | 41 -- include/arch/unix/inherit.h | 24 - include/arch/unix/locks.h | 1 - include/arch/win32/apr_private.h | 41 -- libapr.dsp | 28 - memory/unix/Makefile.in | 8 +- memory/unix/apr_sms.c | 1088 ---------------------------- memory/unix/apr_sms_blocks.c | 280 ------- memory/unix/apr_sms_pools.c | 220 ------ memory/unix/apr_sms_std.c | 159 ---- memory/unix/apr_sms_threads.c | 964 ------------------------ memory/unix/apr_sms_tracking.c | 291 -------- memory/unix/apr_sms_trivial.c | 531 -------------- memory/unix/sms_private.h | 159 ---- misc/netware/aprlib.imp | 33 - test/testmem.c | 82 +-- test/testud.c | 14 - 28 files changed, 15 insertions(+), 4942 deletions(-) delete mode 100644 include/apr_sms.h delete mode 100644 include/apr_sms_blocks.h delete mode 100644 include/apr_sms_threads.h delete mode 100644 include/apr_sms_tracking.h delete mode 100644 include/apr_sms_trivial.h delete mode 100644 memory/unix/apr_sms.c delete mode 100644 memory/unix/apr_sms_blocks.c delete mode 100644 memory/unix/apr_sms_pools.c delete mode 100644 memory/unix/apr_sms_std.c delete mode 100644 memory/unix/apr_sms_threads.c delete mode 100644 memory/unix/apr_sms_tracking.c delete mode 100644 memory/unix/apr_sms_trivial.c delete mode 100644 memory/unix/sms_private.h diff --git a/STATUS b/STATUS index b9837a626d2..ba7c003e84b 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/09/26 18:25:04 $] +Last modified at [$Date: 2001/09/28 14:05:22 $] Release: @@ -138,17 +138,13 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: -- note on Win32 we distinguish 'apache module' names from other 'loadable module' names, so be careful with Apache's directive. - * APR memory code - code has been added but we still need to - - decide on a better name for the code - - reformat to APR style (think this is now done, but some tabs left) - - test on more systems - - add more detailed tests to testmem.c - Status: Optionally enable it with --enable-sms. Still wildly - unproven. But, it actually works as a replacement for - pools now. It may even not segfault when running httpd - under high-loads. The performance impact/benefit still - needs to be examined. - + * APR memory code + The SMS code has been removed. The abstraction made it perform + far worse than pools. Pools need probably be revamped to take + a want_new_freelist parameter to get rid of the global locking + on block allocation. + Status: Sander volunteers + * In line with the new SMS code is the fact that threading and pools just are not working together well. This is due to the fact that the pool code has one global mutex (alloc_mutex) and one freelist @@ -171,6 +167,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: There are other possibilities. Any of those probably work as well. See the apr archives for more info. We're still debating this. + Sander: The SMS code has been removed (see above). * Possible gmtime_r replacement in explode_time On Solaris (and possibly others), the gmtime_r libc function obtains @@ -254,27 +251,3 @@ Stuff waiting for code thawing after Beta 1: usefulness, perhaps hidden, generic read-only [immutable], effective current user permissions, etc. -APR Stackable Memory Code -========================= - -This is just a small list of things yet to be done, or things -that we may want/need to consider. - -- add a shared memory module. - -- locking needs to be addressed. The scope of the locks needs - to be defined and it's likely we'll need some way of - varying the scope when locking. - -- given the problems that can occur when trying to find - alloc/free problems we should probably have a special debug - memory system that records everything it does and any - other information we think is useful. - -- in addition to the debugging system, we need to look at - methods of checking memory allocations to ensure we're - behaving when we have the ASSERT_MEMORY flag turned on. - The pools in 1.3 had code from dean and Roy, Greg has added - some special stuff for pools under Linux on 2.0, so we just - need some ideas - diff --git a/apr.dsp b/apr.dsp index e5c7746d3e5..c587d5cc969 100644 --- a/apr.dsp +++ b/apr.dsp @@ -188,26 +188,6 @@ SOURCE=.\locks\win32\thread_rwlock.c SOURCE=.\memory\unix\apr_pools.c # End Source File -# Begin Source File - -SOURCE=.\memory\unix\apr_sms.c -# End Source File -# Begin Source File - -SOURCE=.\memory\unix\apr_sms_blocks.c -# End Source File -# Begin Source File - -SOURCE=.\memory\unix\apr_sms_std.c -# End Source File -# Begin Source File - -SOURCE=.\memory\unix\apr_sms_tracking.c -# End Source File -# Begin Source File - -SOURCE=.\memory\unix\apr_sms_trivial.c -# End Source File # End Group # Begin Group "misc" @@ -571,14 +551,6 @@ SOURCE=.\include\apr_signal.h # End Source File # Begin Source File -SOURCE=.\include\apr_sms.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_sms_tracking.h -# End Source File -# Begin Source File - SOURCE=.\include\apr_strings.h # End Source File # Begin Source File diff --git a/configure.in b/configure.in index 87eb4c16b34..fd92f4088c9 100644 --- a/configure.in +++ b/configure.in @@ -179,17 +179,6 @@ if test "$host" = "i586-pc-beos"; then ) dnl fi -POOLS_TARGET=apr_pools.lo -AC_ARG_ENABLE(sms, [ --enable-sms Build APR to use sms emulating pools], - echo "************* WARNING ***************" - echo "You have switched ON using SMS to emulate pools. This is highly" - echo "experimental and so you may want to think about it!" - echo "Presently this option is only advised for people working on SMS" - APR_ADDTO(CPPFLAGS, -DAPR_POOLS_ARE_SMS) - POOLS_TARGET=apr_sms_pools.lo -)dnl -AC_SUBST(POOLS_TARGET) - dnl # this is the place to put specific options for platform/compiler dnl # combinations case "$host:$CC" in diff --git a/include/apr.hw b/include/apr.hw index ba373e110a7..5f175d070d6 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -270,9 +270,8 @@ typedef int pid_t; typedef int uid_t; typedef int gid_t; - typedef struct apr_lock_t apr_lock_t; -typedef struct apr_sms_t apr_sms_t; + /* Mechanisms to properly type numeric literals */ #define APR_INT64_C(val) (val##i64) diff --git a/include/apr_pools.h b/include/apr_pools.h index 4c1e1f317ef..13a340c9477 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -55,10 +55,6 @@ #ifndef APR_POOLS_H #define APR_POOLS_H -#ifdef APR_POOLS_ARE_SMS -#include "apr_sms.h" -#endif - #ifdef __cplusplus extern "C" { #endif @@ -99,13 +95,11 @@ extern "C" { #define APR_POOL_DEBUG */ -#ifndef APR_POOLS_ARE_SMS /** The fundamental pool type */ typedef struct apr_pool_t apr_pool_t; /** A function that is called when allocation fails. */ typedef int (*apr_abortfunc_t)(int retcode); -#endif /* !APR_POOLS_ARE_SMS */ /** * @defgroup PoolDebug Pool Debugging functions. @@ -238,7 +232,6 @@ APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp); APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, apr_pool_t *cont); -#if !defined(APR_POOLS_ARE_SMS) || defined(DOXYGEN) /** * Set the function to be called when an allocation failure occurs. * @tip If the program wants APR to exit on a memory allocation error, @@ -330,8 +323,6 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *c, apr_size_t reqsize); */ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); -#endif /* !APR_POOLS_ARE_SMS || DOXYGEN */ - /** * @param p The new sub-pool * @param parent The pool to use as a parent pool @@ -357,7 +348,6 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)); -#if !defined(APR_POOLS_ARE_SMS) || defined(DOXYGEN) /** * Remove a previously registered cleanup function * @param p The pool remove the cleanup from @@ -396,8 +386,6 @@ APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, */ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); -#endif /* !APR_POOLS_ARE_SMS || DOXYGEN */ - /* Preparing for exec() --- close files, etc., but *don't* flush I/O * buffers, *don't* wait for subprocesses, and *don't* free any memory. */ @@ -447,35 +435,6 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); # define apr_pool_join(a,b) #endif /* APR_POOL_DEBUG */ -#ifdef APR_POOLS_ARE_SMS -/* Add a number of defines where the sms equivalent is 1 to 1 */ -#define apr_pool_get_abort(p) apr_sms_get_abort(p) -#define apr_pool_set_abort(fn, p) apr_sms_set_abort(fn, p) - -#define apr_pool_get_parent(p) apr_sms_get_parent(p) - -#define apr_pool_userdata_set(d, k, c, p) \ - apr_sms_userdata_set(d, k, c, p) -#define apr_pool_userdata_get(d, k, p) \ - apr_sms_userdata_get(d, k, p) - -#define apr_pool_cleanup_kill(p, d, c) \ - apr_sms_cleanup_unregister(p, APR_ALL_CLEANUPS, d, c) -#define apr_pool_cleanup_run(p, d, c) \ - apr_sms_cleanup_run(p, APR_GENERAL_CLEANUP, d, c) - -/* we won't even bother to register these as they'll be ignored when - * we call the register fucntion - */ -#define apr_pool_cleanup_null NULL - -/* The parameters match exactly for these, so just define them directly */ -#define apr_palloc apr_sms_malloc -#define apr_pcalloc apr_sms_calloc -#define apr_pool_clear apr_sms_reset -#define apr_pool_destroy apr_sms_destroy - -#endif /* APR_POOLS_ARE_SMS */ /** @} */ #ifdef __cplusplus } diff --git a/include/apr_portable.h b/include/apr_portable.h index 548112839f7..4888a26dffb 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -77,7 +77,6 @@ #include "apr_lock.h" #include "apr_time.h" #include "apr_dso.h" -#include "apr_sms.h" #if APR_HAVE_DIRENT_H #include @@ -315,22 +314,6 @@ APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void); APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2); -/** - * Register the specified thread with an sms - * @param sms The SMS to register with - * @param thread The thread to register - */ -APR_DECLARE(apr_status_t) apr_sms_thread_register(apr_sms_t *sms, - apr_os_thread_t thread); - -/** - * Unregister a thread from an sms - * @param sms The sms to unregister from - * @param thread The thread to be unregistered - */ -APR_DECLARE(apr_status_t) apr_sms_thread_unregister(apr_sms_t *sms, - apr_os_thread_t thread); - /** @} */ #endif /* APR_HAS_THREADS */ diff --git a/include/apr_sms.h b/include/apr_sms.h deleted file mode 100644 index 0bac01b1589..00000000000 --- a/include/apr_sms.h +++ /dev/null @@ -1,439 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* This code kindly donated to APR by - * Elrond - * Luke Kenneth Casson Leighton - * Sander Striker - * - * May 2001 - */ - -/** - * @file apr_sms.h - * @brief APR SMS Memory routines - */ -/** - * @defgroup APR_SMS SMS Stackable Memory allocation system - * @ingroup APR - * @{ - */ - -#ifndef APR_SMS_H -#define APR_SMS_H - -/** - * @typedef apr_sms_t - * @brief holds the internal details required to implement a SMS - * @see sms_private.h - */ -typedef struct apr_sms_t apr_sms_t; - -#include "apr.h" -#include "apr_errno.h" -#ifndef APR_POOLS_ARE_SMS -#include "apr_pools.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef APR_POOLS_ARE_SMS -typedef struct apr_sms_t apr_pool_t; -typedef int (*apr_abortfunc_t)(int retcode); -#endif - -/********************************************************************** - ** Defines - **********************************************************************/ - -/* The various types of cleanup's we can offer */ -#define APR_ALL_CLEANUPS 0x0000 -#define APR_GENERAL_CLEANUP 0x0001 -#define APR_CHILD_CLEANUP 0x0002 - -/* Alignment macro's - * - * APR_ALIGN is only to be used to align on a power of 2 boundary - */ -#define APR_ALIGN(size, boundary) \ - (((size) + ((boundary) - 1)) & ~((boundary) - 1)) - -#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) - -/********************************************************************** - ** Debug options - **********************************************************************/ -/* - * One of the aims of SMS is to provide a large range of debugging - * options. - * - * The options are normally turned off by having the define commented out. - * To use, simply remove the define and rebuild! - * - * Function definitions are at the end of the file... - */ - -/* APR_DEBUG_TO_FILE - * This will put all debug output into a file, that you can name - * using the APR_DEBUG_FILE define. Normally this is set to setdout - * and the output is simply printed there. - */ -#define APR_DEBUG_TO_FILE 0 -#define APR_DEBUG_FILE "/tmp/sms_debug" - -/* APR_DEBUG_SHOW_STRUCTURE - * This turns on a print of the ancestory of the SMS when - * creating/destroying an SMS so its place in the world can be seen. - */ -#define APR_DEBUG_SHOW_STRUCTURE 0 - -/* APR_DEBUG_SHOW_FUNCTIONS - * This turns on debug printing of every call to - * apr_sms_create - * apr_sms_destroy - * apr_sms_reset - * - * Format of output is - * CREATE - sms 0x0000000 [STANDARD] has been created - */ -#define APR_DEBUG_SHOW_FUNCTIONS 0 - -/* APR_DEBUG_TAG_SMS - * Turn on the ability to give an SMS a "tag" that can be used to identify - * it. - */ -#define APR_DEBUG_TAG_SMS 0 - -/* APR_DEBUG_ALLOCATIONS - * This will record ALL calls made to - * apr_sms_malloc - * apr_sms_calloc - * apr_sms_realloc - * apr_sms_free - * Details are put into the file specified in the APR_DEBUG_ALLOC_FILE - * define - */ -#define APR_DEBUG_ALLOCATIONS 0 -#define APR_DEBUG_ALLOC_FILE "/tmp/sms_alloc" - -/** - * @package APR memory system - */ - -struct apr_sms_cleanup; - -/* - * memory allocation functions - */ - -/** - * Allocate a block of memory using a certain memory system - * @param sms The memory system to use - * @param size The (minimal required) size of the block to be allocated - * @return pointer to a newly allocated block of memory, NULL if insufficient - * memory available - */ -APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *sms, apr_size_t size); - -/** - * Allocate a block of zeroed memory using a certain memory system - * @param sms The memory system to use - * @param size The (minimal required) size of the block to be allocated - * @return pointer to a newly allocated block of memory, NULL if insufficient - * memory available - */ -APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *sms, apr_size_t size); - -/** - * Change the size of a previously allocated block of memory - * @param sms The memory system to use (should be the same as the - * one that returned the block) - * @param mem Pointer to the previously allocated block. If NULL, this - * function acts like apr_sms_malloc. - * @param size The (minimal required) size of the block to be allocated - * @return pointer to a newly allocated block of memory, NULL if insufficient - * memory available - */ -APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *sms, void *mem, apr_size_t size); - -/** - * Free a block of memory - * @param sms The memory system to use (should be the same as the - * one that returned the block) - * @param mem The block of memory to be freed - */ -APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *sms, void *mem); - -/* - * memory system functions - */ - -#ifdef APR_ASSERT_MEMORY - -/** - * Check if a memory system is obeying all rules. - * @caution Call this function as the last statement before returning a new - * memory system from your apr_xxx_sms_create. - */ -APR_DECLARE(void) apr_sms_assert(apr_sms_t *sms); -#else -#ifdef apr_sms_assert -#undef apr_sms_assert -#endif -#define apr_sms_assert(sms) -#endif /* APR_ASSERT_MEMORY */ - -/** - * Reset a memory system so it can be reused. - * This will also run all cleanup functions associated with the memory system - * @warning This function will fail if there is no reset function available - * for the given memory system (i.e. the memory system is non- - * tracking). - * @param sms The memory system to be reset - */ -APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *sms); - -/** - * Destroy a memory system, effectively freeing all of its memory, and itself. - * This will also run all cleanup functions associated with the memory system. - * @caution Be carefull when using this function with a non-tracking memory - * system - * @param sms The memory system to be destroyed - */ -APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms); - -/** - * Perform thread-safe locking required whilst this memory system is modified - * @param sms The memory system to be locked for thread-safety - */ -APR_DECLARE(apr_status_t) apr_sms_lock(apr_sms_t *sms); - -/** - * Release thread-safe locking required whilst this memory system was - * being modified - * @param sms The memory system to be released from thread-safety - */ -APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *sms); - -/** - * Determine if memory system a is an ancestor of memory system b - * @param a The memory system to search - * @param b The memory system to search for - * @return APR_SUCCESS if a is an ancestor of b, 1 if it isn't - */ -APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a, apr_sms_t *b); - -/** - * Get the memory_system identity - * @param sms The memory system to identify - */ -APR_DECLARE(const char *) apr_sms_get_identity(apr_sms_t *sms); - -/** - * Get the parent sms - * @param sms the memory system to get the parent from - */ -APR_DECLARE(apr_sms_t *) apr_sms_get_parent(apr_sms_t *sms); - -/** - * Set the abort function. This is called when we fail to - * fulfil an allocation request. - * @tip If an app wants APR to exit on a memory allocation error - * then this function can be called to set the callback to - * use. If this function is not called then APR will return an error - * and expect the app to deal with it. - * @param abortfunc The function to call - * @param sms The sms to register the function with - */ -APR_DECLARE(void) apr_sms_set_abort(apr_abortfunc_t abortfunc, - apr_sms_t *sms); - -/** - * Get the abort function registered with the sms. - * @param sms The sms to get the function for - * @return The abort function registered - */ -APR_DECLARE(apr_abortfunc_t) apr_sms_get_abort(apr_sms_t *sms); - -/** - * Set user data into the current sms. - * @param data The user data to insert - * @param key The key to assign to this data - * @param cleanup The cleanup program to use when cleaning up the data - * @param sms The sms to inert the data into - */ -APR_DECLARE(apr_status_t) apr_sms_userdata_set(const void *data, - const char *key, - apr_status_t (*cleanup)(void*), - apr_sms_t *sms); - -/** - * Get user data from an sms using the key it was registered with - * @param data A pointer to the returned data - * @param key The key to use to identify the data - * @param sms The sms to get the data from - */ -APR_DECLARE(apr_status_t) apr_sms_userdata_get(void **data, const char *key, - apr_sms_t *sms); - -/* - * memory system cleanup management functions - */ - -/** - * Register a function to be called when a memory system is reset or destroyed - * @param sms The memory system to register the cleanup function with - * @param type The type of cleanup to register - * @param data The data to pass to the cleanup function - * @param cleanup_fn The function to call when the memory system is reset or - * destroyed - */ -APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms, - apr_int32_t type, - const void *data, - apr_status_t (*cleanup_fn)(void *)); - -/** - * Unregister a previously registered cleanup function - * @param sms The memory system the cleanup function is registered - * with - * @param type The type of the cleanup to unregister - * @param type The type of cleanup to run - * @param data The data associated with the cleanup function - * @param cleanup_fn The registered cleanup function - */ -APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms, - apr_int32_t type, - const void *data, - apr_status_t (*cleanup)(void *)); - -/** - * Unregister all previously registered cleanup functions of the specified type - * @param sms The memory system the cleanup functions are registered with - * @param type The type associated with the cleanup function. Pass 0 to - * unregister all cleanup functions. - */ -APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *sms, - apr_int32_t type); - -/** - * Run the specified cleanup function immediately and unregister it - * @param sms The memory system the cleanup function is registered - * with - * @param sms The memory system the cleanup function is registered with - * @param type The type associated with the cleanup function. Pass 0 to ignore type. - * @param data The data associated with the cleanup function - * @param cleanup The registered cleanup function - */ -APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms, - apr_int32_t type, - const void *data, - apr_status_t (*cleanup)(void *)); - -/** - * Run the specified type of cleanup functions immediately and unregister them - * @param sms The memory system the cleanup functions are registered with - * @param type The category of cleanup functions to run. Pass 0 to run all - * cleanup functions. - */ -APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, - apr_int32_t type); - -/********************************************************************** - ** Standard SMS module - **********************************************************************/ - -/** - * Create a standard malloc/realloc/free memory system - * @param sms A pointer to the created apr_sms_t* - */ -APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms); - - -/********************************************************************** - ** Debug routines - **********************************************************************/ - -/* NB These are only available if the debugging option has been turned on. */ - -#if APR_DEBUG_SHOW_STRUCTURE -/** - * Show the heirachy of the sms - * @param sms The sms to show the information for - * @param direction Do we show up (to parent) or down (to children) - */ -APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction); -#endif /* APR_DEBUG_SHOW_STRUCTURE */ - -#if APR_DEBUG_TAG_SMS -/** - * Set the debugging tag for an sms - * @param tag The tag to give the sms - * @param sms The sms to apply the tag to - */ -APR_DECLARE(void) apr_sms_tag(apr_sms_t *sms, const char *tag); -#endif /* APR_DEBUG_TAG_SMS */ - -#if APR_SMS_ALLOC_STATS -APR_DECLARE(void) apr_sms_dump_stats(apr_sms_t *sms); -#endif - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif /* !APR_SMS_H */ - diff --git a/include/apr_sms_blocks.h b/include/apr_sms_blocks.h deleted file mode 100644 index 84bd1e4451f..00000000000 --- a/include/apr_sms_blocks.h +++ /dev/null @@ -1,99 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* This code kindly donated to APR by - * Elrond - * Luke Kenneth Casson Leighton - * Sander Striker - * - * May 2001 - */ - -#ifndef APR_BLOCKS_MEMORY_SYSTEM_H -#define APR_BLOCKS_MEMORY_SYSTEM_H - -#include "apr.h" -#include "apr_sms.h" - -#ifdef __cplusplus -extern "C" { -#endif -/** - * @file apr_sms_blocks.h - * @brief APR SMS Blocks Memory System - */ -/** - * @defgroup APR_SMS_Blocks Blocks SMS - * @ingroup APR_SMS - * @{ - */ - -/** - * Create an sms system that allocates blocks of a given size - * as fast as possible and tracks their free'ing - * @param sms A pointer to the returned apr_sms_t* - * @param pms The parent memory system, used to allocate the memory - * that we will be tracking. - */ -APR_DECLARE(apr_status_t) apr_sms_blocks_create(apr_sms_t **sms, - apr_sms_t *pms, - apr_size_t block_size); - - -/** @} */ -#ifdef __cplusplus -} -#endif - -#endif /* !APR_BLOCKS_MEMORY_SYSTEM_H */ diff --git a/include/apr_sms_threads.h b/include/apr_sms_threads.h deleted file mode 100644 index e03bd317954..00000000000 --- a/include/apr_sms_threads.h +++ /dev/null @@ -1,109 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_SMS_THREADS_H -#define APR_SMS_THREADS_H - -#include "apr.h" -#include "apr_sms.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if APR_HAS_THREADS - /** - * @file apr_sms_threads.h - * @brief APR SMS Threads Memory System - */ -/** - * @defgroup APR_SMS_Threads Threads SMS - * @ingroup APR_SMS - * @{ - */ - -/** - * Create a pool like malloc/free/reset memory system - * @param mem_sys A pointer to the returned apr_sms_t* - * @param pms The parent memory system, used to allocate the memory - * that we will be threads. - */ -APR_DECLARE(apr_status_t) apr_sms_threads_create(apr_sms_t **sms, - apr_sms_t *pms); - -/** - * Create a pool like malloc/free/reset memory system - * @param mem_sys A pointer to the returned apr_sms_t* - * @param pms The parent memory system, used to allocate the memory - * that we will be threads. - * @param min_alloc The minimal blocksize to allocate when getting - * memory from the parent - * @param min_free The minimal amount of memory to make sure is - * free in an allocated block from the parent - * @param max_free The amount of memory the sms may hold on to - */ -APR_DECLARE(apr_status_t) apr_sms_threads_create_ex(apr_sms_t **sms, - apr_sms_t *pms, - apr_size_t min_alloc, - apr_size_t min_free, - apr_size_t max_free); - -/** @} */ -#endif /* APR_HAS_THREADS */ - -#ifdef __cplusplus -} -#endif - -#endif /* !APR_SMS_THREADS_H */ diff --git a/include/apr_sms_tracking.h b/include/apr_sms_tracking.h deleted file mode 100644 index f73d477367d..00000000000 --- a/include/apr_sms_tracking.h +++ /dev/null @@ -1,97 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* This code kindly donated to APR by - * Elrond - * Luke Kenneth Casson Leighton - * Sander Striker - * - * May 2001 - */ - -#ifndef APR_TRACKING_MEMORY_SYSTEM_H -#define APR_TRACKING_MEMORY_SYSTEM_H - -#include "apr.h" -#include "apr_sms.h" - -#ifdef __cplusplus -extern "C" { -#endif -/** - * @file apr_sms_tracking.h - * @brief APR SMS Tracking Memory System - */ -/** - * @defgroup APR_SMS_Tracking Tracking SMS - * @ingroup APR_SMS - * @{ - */ - -/** - * Create a standard malloc/realloc/free memory system - * @param mem_sys A pointer to the returned apr_sms_t* - * @param pms The parent memory system, used to allocate the memory - * that we will be tracking. - */ -APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **mem_sys, - apr_sms_t *pms); - - -/** @} */ -#ifdef __cplusplus -} -#endif - -#endif /* !APR_TRACKING_MEMORY_SYSTEM_H */ diff --git a/include/apr_sms_trivial.h b/include/apr_sms_trivial.h deleted file mode 100644 index be560dd0727..00000000000 --- a/include/apr_sms_trivial.h +++ /dev/null @@ -1,104 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_SMS_TRIVIAL_H -#define APR_SMS_TRIVIAL_H - -#include "apr.h" -#include "apr_sms.h" - -#ifdef __cplusplus -extern "C" { -#endif -/** - * @file apr_sms_trivial.h - * @brief APR SMS Trivial Memory System - */ -/** - * @defgroup APR_SMS_Trivial Trivial SMS - * @ingroup APR_SMS - * @{ - */ - -/** - * Create a pool like malloc/free/reset memory system - * @param mem_sys A pointer to the returned apr_sms_t* - * @param pms The parent memory system, used to allocate the memory - * that we will be trivial. - */ -APR_DECLARE(apr_status_t) apr_sms_trivial_create(apr_sms_t **sms, - apr_sms_t *pms); - -/** - * Create a pool like malloc/free/reset memory system - * @param mem_sys A pointer to the returned apr_sms_t* - * @param pms The parent memory system, used to allocate the memory - * that we will be trivial. - * @param min_alloc The minimal blocksize to allocate when getting - * memory from the parent - * @param min_free The minimal amount of memory to make sure is - * free in an allocated block from the parent - * @param max_free The amount of memory the sms may hold on to - */ -APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, - apr_sms_t *pms, - apr_size_t min_alloc, - apr_size_t min_free, - apr_size_t max_free); -/** @} */ -#ifdef __cplusplus -} -#endif - -#endif /* !APR_SMS_TRIVIAL_H */ diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 460b13979d5..253b9c2b896 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -158,47 +158,6 @@ typedef void (Sigfunc)(int); //unsigned __stdcall SignalHandling(void *); //int thread_ready(void); -/* Macros to deal with using either a pool or an sms - * to do memory stuff... - */ -#define APR_CLEANUP_REGISTER(struct, data, func, scope) \ - if (struct->pool) { \ - apr_pool_cleanup_register(struct->pool, data, func, scope); \ - } else { \ - apr_sms_cleanup_register(struct->mem_sys, APR_CHILD_CLEANUP, \ - data, func); \ - } - -#define APR_CLEANUP_REMOVE(struct, data, func) \ - if (struct->pool) { \ - apr_pool_cleanup_kill(struct->pool, data, func); \ - } else { \ - apr_sms_cleanup_unregister(struct->mem_sys, APR_CHILD_CLEANUP, \ - data, func); \ - } - -#define APR_MEM_PSTRDUP(struct, ptr, str) \ - if (struct->pool) { \ - ptr = apr_pstrdup(struct->pool, str); \ - } else { \ - size_t len = strlen(str) + 1; \ - ptr = (char*) apr_sms_calloc(struct->mem_sys, len); \ - memcpy(ptr, str, len); \ - } - -#define APR_MEM_MALLOC(ptr, struct, type) \ - if (struct->pool) { \ - ptr = (type *)apr_palloc(struct->pool, sizeof(type)); \ - } else { \ - ptr = (type *)apr_sms_malloc(struct->mem_sys, sizeof(type)); \ - } - -#define APR_MEM_CALLOC(ptr, struct, type) \ - if (struct->pool) { \ - ptr = (type *)apr_pcalloc(struct->pool, sizeof(type)); \ - } else { \ - ptr = (type *)apr_sms_calloc(struct->mem_sys, sizeof(type)); \ - } #endif /*APR_PRIVATE_H*/ #endif /*NETWARE*/ diff --git a/include/arch/unix/inherit.h b/include/arch/unix/inherit.h index d268bfa2a41..394c2cd5b99 100644 --- a/include/arch/unix/inherit.h +++ b/include/arch/unix/inherit.h @@ -59,7 +59,6 @@ #define APR_INHERIT (2^24) /* Must not conflicts with other bits */ -#ifndef APR_POOLS_ARE_SMS #define APR_IMPLEMENT_SET_INHERIT(name, flag, pool, cleanup) \ void apr_##name##_set_inherit(apr_##name##_t *name) \ { \ @@ -69,19 +68,7 @@ void apr_##name##_set_inherit(apr_##name##_t *name) \ cleanup, apr_pool_cleanup_null); \ } \ } -#else -#define APR_IMPLEMENT_SET_INHERIT(name, flag, pool, cleanup) \ -void apr_##name##_set_inherit(apr_##name##_t *name) \ -{ \ - if (!(name->flag & APR_INHERIT)) { \ - name->flag |= APR_INHERIT; \ - apr_sms_cleanup_unregister(name->pool, APR_CHILD_CLEANUP, \ - (void *)name, cleanup); \ - } \ -} -#endif -#ifndef APR_POOLS_ARE_SMS #define APR_IMPLEMENT_UNSET_INHERIT(name, flag, pool, cleanup) \ void apr_##name##_unset_inherit(apr_##name##_t *name) \ { \ @@ -91,16 +78,5 @@ void apr_##name##_unset_inherit(apr_##name##_t *name) \ cleanup, cleanup); \ } \ } -#else -#define APR_IMPLEMENT_UNSET_INHERIT(name, flag, pool, cleanup) \ -void apr_##name##_unset_inherit(apr_##name##_t *name) \ -{ \ - if (name->flag & APR_INHERIT) { \ - name->flag &= ~APR_INHERIT; \ - apr_sms_cleanup_register(name->pool, APR_CHILD_CLEANUP, \ - (void *)name, cleanup); \ - } \ -} -#endif #endif /* ! INHERIT_H */ diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index 47f089c1433..6ef1c83d901 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -60,7 +60,6 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_lock.h" -#include "apr_sms.h" #include "apr_portable.h" #include "proc_mutex.h" diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index d3affa890ad..884bedcd062 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -149,47 +149,6 @@ typedef void (Sigfunc)(int); unsigned __stdcall SignalHandling(void *); int thread_ready(void); -/* Macros to deal with using either a pool or an sms - * to do memory stuff... - */ -#define APR_CLEANUP_REGISTER(struct, data, func, scope) \ - if (struct->pool) { \ - apr_pool_cleanup_register(struct->pool, data, func, scope); \ - } else { \ - apr_sms_cleanup_register(struct->mem_sys, APR_CHILD_CLEANUP, \ - data, func); \ - } - -#define APR_CLEANUP_REMOVE(struct, data, func) \ - if (struct->pool) { \ - apr_pool_cleanup_kill(struct->pool, data, func); \ - } else { \ - apr_sms_cleanup_unregister(struct->mem_sys, APR_CHILD_CLEANUP, \ - data, func); \ - } - -#define APR_MEM_PSTRDUP(struct, ptr, str) \ - if (struct->pool) { \ - ptr = apr_pstrdup(struct->pool, str); \ - } else { \ - size_t len = strlen(str) + 1; \ - ptr = (char*) apr_sms_calloc(struct->mem_sys, len); \ - memcpy(ptr, str, len); \ - } - -#define APR_MEM_MALLOC(ptr, struct, type) \ - if (struct->pool) { \ - ptr = (type *)apr_palloc(struct->pool, sizeof(type)); \ - } else { \ - ptr = (type *)apr_sms_malloc(struct->mem_sys, sizeof(type)); \ - } - -#define APR_MEM_CALLOC(ptr, struct, type) \ - if (struct->pool) { \ - ptr = (type *)apr_pcalloc(struct->pool, sizeof(type)); \ - } else { \ - ptr = (type *)apr_sms_calloc(struct->mem_sys, sizeof(type)); \ - } #endif /*APR_PRIVATE_H*/ #endif /*WIN32*/ diff --git a/libapr.dsp b/libapr.dsp index cc6259668a9..3a35e9e8118 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -190,26 +190,6 @@ SOURCE=.\locks\win32\thread_rwlock.c SOURCE=.\memory\unix\apr_pools.c # End Source File -# Begin Source File - -SOURCE=.\memory\unix\apr_sms.c -# End Source File -# Begin Source File - -SOURCE=.\memory\unix\apr_sms_blocks.c -# End Source File -# Begin Source File - -SOURCE=.\memory\unix\apr_sms_std.c -# End Source File -# Begin Source File - -SOURCE=.\memory\unix\apr_sms_tracking.c -# End Source File -# Begin Source File - -SOURCE=.\memory\unix\apr_sms_trivial.c -# End Source File # End Group # Begin Group "misc" @@ -573,14 +553,6 @@ SOURCE=.\include\apr_signal.h # End Source File # Begin Source File -SOURCE=.\include\apr_sms.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_sms_tracking.h -# End Source File -# Begin Source File - SOURCE=.\include\apr_strings.h # End Source File # Begin Source File diff --git a/memory/unix/Makefile.in b/memory/unix/Makefile.in index 7a122dc00fa..b390d746a5a 100644 --- a/memory/unix/Makefile.in +++ b/memory/unix/Makefile.in @@ -1,11 +1,5 @@ -TARGETS = apr_sms.lo \ - apr_sms_std.lo \ - apr_sms_tracking.lo \ - apr_sms_blocks.lo \ - apr_sms_trivial.lo \ - apr_sms_threads.lo \ - @POOLS_TARGET@ +TARGETS = apr_pools.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c deleted file mode 100644 index c05d6d6e265..00000000000 --- a/memory/unix/apr_sms.c +++ /dev/null @@ -1,1088 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* This code kindly donated to APR by - * Elrond - * Luke Kenneth Casson Leighton - * Sander Striker - * - * May 2001 - */ - -#include "apr.h" -#include "apr_general.h" -#include "apr_sms.h" -#include -#include "apr_hash.h" -#include "apr_strings.h" -#include "apr_portable.h" - -#include "sms_private.h" - -#ifdef APR_ASSERT_MEMORY -#include -#endif -#include - -#include /* strikerXXX: had to add this for windows to stop - * complaining, please autoconf the include stuff - */ - -FILE *dbg_file; - -/* - * private structure defenitions - */ -struct apr_sms_cleanup -{ - struct apr_sms_cleanup *next; - apr_int32_t type; - const void *data; - apr_status_t (*cleanup_fn)(void *); -}; - -#if APR_DEBUG_ALLOCATIONS -FILE *alloc_file = NULL; - -static void _record_(apr_sms_t *sms, const char *what, apr_size_t size, - void *ptr) -{ - if (!alloc_file) - return; - - if (ptr) { -#if APR_DEBUG_TAG_SMS - fprintf(alloc_file, "%10s %p '%9s' [%9s] @ %p\n", - what, sms, sms->tag, sms->identity, ptr); -#else - fprintf(alloc_file, "%10s %p [%9s] @ %p\n", - what, sms, sms->identity, ptr); -#endif - } else { -#if APR_DEBUG_TAG_SMS - fprintf(alloc_file, "%10s %p '%9s' [%9s] %6" APR_SIZE_T_FMT " bytes\n", - what, sms, sms->tag, sms->identity, size); -#else - fprintf(alloc_file, "%10s %p [%9s] %6" APR_SIZE_T_FMT " bytes\n", - what, sms, sms->identity, size); -#endif - } - fflush(alloc_file); -} -#endif - - -/* - * memory allocation functions - */ - -APR_DECLARE(void *) apr_sms_malloc(apr_sms_t *sms, - apr_size_t size) -{ - if (size == 0) - return NULL; - -#if APR_DEBUG_ALLOCATIONS - _record_(sms, "MALLOC", size, NULL); -#endif - - return sms->malloc_fn(sms, size); -} - -APR_DECLARE(void *) apr_sms_calloc(apr_sms_t *sms, - apr_size_t size) -{ - if (size == 0) - return NULL; - -#if APR_DEBUG_ALLOCATIONS - _record_(sms, "CALLOC", size, NULL); -#endif - - return sms->calloc_fn(sms, size); -} - -APR_DECLARE(void *) apr_sms_realloc(apr_sms_t *sms, void *mem, - apr_size_t size) -{ -#if APR_DEBUG_ALLOCATIONS - _record_(sms, "REALLOC", size, NULL); -#endif - - if (!mem) - return apr_sms_malloc(sms, size); - - if (size == 0) { - apr_sms_free(sms, mem); - return NULL; - } - - if (sms->realloc_fn) - return sms->realloc_fn(sms, mem, size); - - /* XXX - should we free the block passed in ??? */ - return NULL; -} - -APR_DECLARE(apr_status_t) apr_sms_free(apr_sms_t *sms, - void *mem) -{ - -#if APR_DEBUG_ALLOCATIONS - _record_(sms, "FREE", 0, mem); -#endif - - if (sms->free_fn) - return sms->free_fn(sms, mem); - - /* - * If there is no free_fn, this sms is a tracking memory - * system by definition. In other words, it is ok - * to return APR_SUCCESS because the memory will be - * free()d by the reset or destroy. - */ - return APR_SUCCESS; -} - -/* - * default allocation functions - */ - -static void *apr_sms_default_calloc(apr_sms_t *sms, - apr_size_t size) -{ - void *mem; - - mem = sms->malloc_fn(sms, size); - if (mem) - memset(mem, '\0', size); - - return mem; -} - -/* - * memory system functions - */ - -static int apr_sms_is_tracking(apr_sms_t *sms) -{ - /* - * The presense of a reset function gives us the clue that this is a - * tracking memory system. - */ - return sms->reset_fn != NULL; -} - -APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, - apr_sms_t *pms) -{ -#if APR_DEBUG_TO_FILE - if (!dbg_file) - dbg_file = fopen(APR_DEBUG_FILE, "w"); -#else - dbg_file = stdout; -#endif -#if APR_DEBUG_ALLOCATIONS - if (!alloc_file) - alloc_file = fopen(APR_DEBUG_ALLOC_FILE, "w"); -#endif - - /* XXX - I've assumed that memory passed in will be zeroed, - * i.e. calloc'd instead of malloc'd... - * This may well be a bogus assumption, and if so we either need - * to memset or have a series of =NULL's at the end. - * This function is only called by modules, so this isn't as crazy - * an assumption to make as it sounds :) - */ - - sms->parent = pms; - sms->accounting = sms; - sms->child = NULL; - - /* - * Child memory systems are always linked to their parents. This works - * as follows... - * - * parent - * | - * | - * child --- sibling --- sibling --- sibling - * - * To be able to remove a memory system from a list we also need to - * keep a ref pointer (a pointer to the pointer pointing to the memory - * system). To remove a memory system, basically... - * - * *ref = sibling; - * if (sibling) - * sibling->ref = ref; - */ - - if (pms) { - /* - * We only need to lock the parent as the only other function that - * touches the fields we're about to mess with is apr_sms_destroy - */ - if (pms->sms_lock) - apr_lock_acquire(pms->sms_lock); - - if ((sms->sibling = pms->child) != NULL) - sms->sibling->ref = &sms->sibling; - - sms->ref = &pms->child; - pms->child = sms; - - if (pms->sms_lock) - apr_lock_release(pms->sms_lock); - } - - /* Set default functions. These should NOT be altered by an sms - * module unless it implements them itself. - */ - sms->calloc_fn = apr_sms_default_calloc; - -#if APR_HAS_THREADS - sms->threads = 1; -#endif /* APR_HAS_THREADS */ - -#ifndef APR_POOLS_ARE_SMS - /* XXX - This should eventually be removed */ - apr_pool_create(&sms->pool, pms ? pms->pool : NULL); -#else - sms->pool = sms; -#endif - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms) -{ - /* We do things here as these may potentially make calls - * to the sms that we're creating, and if we make the calls - * in the sms_init phase we haven't yet added the function - * pointers so we'll segfault! - */ - apr_status_t rv; - - apr_sms_assert(sms); - - rv = APR_SUCCESS; - -#if APR_HAS_THREADS - apr_sms_thread_register(sms, apr_os_thread_current()); -#endif /* APR_HAS_THREADS */ - -#if APR_DEBUG_SHOW_FUNCTIONS - fprintf(dbg_file, "CREATE - sms %p [%s] has been created\n", - sms, sms->identity); -#endif -#if APR_DEBUG_SHOW_STRUCTURE - apr_sms_show_structure(sms, 1); -#endif /* APR_DEBUG_SHOW_STRUCTURE */ - - return rv; -} - - -#ifdef APR_ASSERT_MEMORY -APR_DECLARE(void) apr_sms_assert(apr_sms_t *sms) -{ - apr_sms_t *parent; - - /* - * A memory system without a malloc won't do us much good - */ - assert(sms->malloc_fn); - - /* - * Check to see if this is either a non-tracking or - * a tracking memory system. It has to have at least a free - * or destroy function. And to avoid half implementations - * we require reset to be present when destroy is. - */ - assert(sms->free_fn || (sms->destroy_fn && sms->reset_fn)); - - assert(!sms->destroy_fn || sms->reset_fn); - - assert(!sms->reset_fn || sms->destroy_fn); - - /* Has someone been stupid and NULL'd our default function without - * providing an implementation of their own... tsch, tsch - */ - assert(sms->calloc_fn); - - /* - * Make sure all accounting memory dies with the memory system. - * To be more specific, make sure the accounting memort system - * is either the memory system itself or a direct child. - */ - assert(sms->accounting == sms || - sms->accounting->parent == sms); - - /* - * A non-tracking memory system can be the child of - * another non-tracking memory system if there are no - * tracking ancestors, but in that specific case we issue a - * warning. - */ - if (!sms->parent) - return; - - parent = sms; - while (parent) { - if (apr_sms_is_tracking(parent)) - return; /* Tracking memory system found, return satisfied ;-) */ - - parent = parent->parent; - } - - /* issue a warning: - * WARNING: A non-tracking memory system was created without a tracking - * parent. - */ -} -#endif /* APR_ASSERT_MEMORY */ - -/* - * LOCAL FUNCTION used in: - * - apr_sms_do_child_cleanups - * - apr_sms_reset - * - apr_sms_destroy - * - * Call all the cleanup routines registered with a memory system. - */ -static void apr_sms_do_cleanups(struct apr_sms_cleanup *c) -{ - while (c) { - if (c->type == APR_ALL_CLEANUPS || c->type == APR_GENERAL_CLEANUP) { - c->cleanup_fn((void*)c->data); - } - c = c->next; - } -} - -/* - * LOCAL FUNCTION used in: - * - apr_sms_reset - * - apr_sms_destroy - * - * This not only calls do_cleanups, but also calls the pre_destroy(!) - */ -static void apr_sms_do_child_cleanups(apr_sms_t *sms) -{ - while (sms) { - apr_sms_do_child_cleanups(sms->child); - apr_sms_do_cleanups(sms->cleanups); - /* - * We assume that all of our children & their siblings are created - * from memory we've allocated, and as we're about to nuke it all - * we need to run the pre_destroy so things like locks can be - * cleaned up so we don't leak. - * However, we aren't going to call destroy on a reset as we're about - * to nuke them when we do the reset. This is why all "leakable" - * items created in an sms module MUST be cleaned up in the - * pre_destroy not the destroy. - */ - if (sms->pre_destroy_fn != NULL) - sms->pre_destroy_fn(sms); - sms = sms->sibling; - } -} - -APR_DECLARE(apr_status_t) apr_sms_reset(apr_sms_t *sms) -{ - apr_status_t rv; - - if (!sms->reset_fn) - return APR_ENOTIMPL; - -#if APR_DEBUG_SHOW_FUNCTIONS -# if APR_DEBUG_TAG_SMS - fprintf(dbg_file, "RESET - sms %p '%s' [%s] being reset\n", sms, - sms->tag, sms->identity); -# else - fprintf(dbg_file, "RESET - sms %p [%s] being reset\n", sms, sms->identity); -# endif -#endif - - if (sms->sms_lock) - apr_lock_acquire(sms->sms_lock); - - /* - * Run the cleanups of all child memory systems _including_ - * the accounting memory system. - */ - apr_sms_do_child_cleanups(sms->child); - - /* Run all cleanups, the memory will be freed by the reset */ - apr_sms_do_cleanups(sms->cleanups); - sms->cleanups = NULL; - - /* We don't have any child memory systems after the reset */ - sms->child = NULL; - - /* Reset the accounting memory system to ourselves, any - * child memory system _including_ the accounting memory - * system will be destroyed by the reset - * strikerXXX: Maybe this should be the responsibility of - * the reset function(?). - */ - sms->accounting = sms; - - /* Let the memory system handle the actual reset */ - rv = sms->reset_fn(sms); - - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - return rv; -} - -APR_DECLARE(apr_status_t) apr_sms_destroy(apr_sms_t *sms) -{ - apr_sms_t *child; - apr_sms_t *sibling; - apr_sms_t *pms; - struct apr_sms_cleanup *cleanup; - struct apr_sms_cleanup *next_cleanup; - -#if APR_DEBUG_SHOW_FUNCTIONS - fprintf(dbg_file, "DESTROY - sms %p [%s] being destroyed\n", - sms, sms->identity); -#endif /* APR_DEBUG_SHOW_FUNCTIONS */ -#if APR_DEBUG_SHOW_STRUCTURE - fprintf(dbg_file, "The following SMS will be destroyed by this action:\n"); - apr_sms_show_structure(sms, 0); -#endif /* APR_DEBUG_SHOW_STRUCTURE */ - - if (sms->sms_lock) - apr_lock_acquire(sms->sms_lock); - - if (apr_sms_is_tracking(sms)) { - /* - * Run the cleanups of all child memory systems _including_ - * the accounting memory system. - * This also does the pre_destroy functions in the children. - */ - apr_sms_do_child_cleanups(sms->child); - - /* Run all cleanups, the memory will be freed by the destroy */ - apr_sms_do_cleanups(sms->cleanups); - } - else { - if (sms->accounting != sms) { - child = sms->accounting; - - /* - * Remove the accounting memory system from the memory systems - * child list (we will explicitly destroy it later in this block). - */ - if (child->sibling != NULL) - child->sibling->ref = child->ref; - - *child->ref = child->sibling; - - /* Set this fields so destroy will work */ - child->ref = NULL; - child->sibling = NULL; - } - - /* Visit all children and destroy them */ - child = sms->child; - - while (child) { - sibling = child->sibling; - apr_sms_destroy(child); - child = sibling; - } - - /* - * If the accounting memory system _is_ tracking, we also know that - * it is not the memory system itself. - */ - if (apr_sms_is_tracking(sms->accounting)) { - /* - * Run all cleanups, the memory will be freed by the destroying - * of the accounting memory system. - */ - apr_sms_do_cleanups(sms->cleanups); - - /* Destroy the accounting memory system */ - apr_sms_destroy(sms->accounting); - - /* - * Set the accounting memory system back to the parent memory - * system just in case... - */ - sms->accounting = sms; - } - else { - /* Run all cleanups, free'ing memory as we go */ - cleanup = sms->cleanups; - - while (cleanup) { - if (cleanup->type == APR_GENERAL_CLEANUP) - cleanup->cleanup_fn((void*)cleanup->data); - - next_cleanup = cleanup->next; - apr_sms_free(sms->accounting, cleanup); - cleanup = next_cleanup; - } - - if (sms->accounting != sms) { - /* Destroy the accounting memory system */ - apr_sms_destroy(sms->accounting); - - /* - * Set the accounting memory system back to the parent memory - * system just in case... - */ - sms->accounting = sms; - } - } - } - - pms = sms->parent; - - /* Remove the memory system from the parent memory systems child list */ - if (pms) { - if (pms->sms_lock) - apr_lock_acquire(pms->sms_lock); - - if ((*sms->ref = sms->sibling) != NULL) - sms->sibling->ref = sms->ref; - - if (pms->sms_lock) - apr_lock_release(pms->sms_lock); - } - - /* Call the pre-destroy if present */ - if (sms->pre_destroy_fn) - sms->pre_destroy_fn(sms); - - if (sms->sms_lock) - { - apr_lock_destroy(sms->sms_lock); - } - -#ifndef APR_POOLS_ARE_SMS - /* XXX - This should eventually be removed */ - apr_pool_destroy(sms->pool); -#endif - - /* 1 - If we have a self destruct, use it */ - if (sms->destroy_fn) - return sms->destroy_fn(sms); - - /* 2 - If we don't have a parent, free using ourselves */ - if (!pms) - return sms->free_fn(sms, sms); - - /* 3 - If we do have a parent and it has a free function, use it */ - if (pms->free_fn) - return apr_sms_free(sms->parent, sms); - - /* 4 - Assume we are the child of a tracking memory system, do nothing */ -#ifdef APR_ASSERT_MEMORY - sms = pms; - while (sms) { - if (apr_sms_is_tracking(sms)) - return APR_SUCCESS; - - sms = sms->parent; - } - assert(0); /* Made the wrong assumption, so we assert */ -#endif /* APR_ASSERT_MEMORY */ - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_sms_is_ancestor(apr_sms_t *a, - apr_sms_t *b) -{ -#ifdef APR_ASSERT_MEMORY - assert(a); -#endif - - while (b && b != a) - b = b->parent; - - /* APR_SUCCESS = 0, so if they agree we should return that... */ - return !(b == a); -} - -APR_DECLARE(apr_status_t) apr_sms_lock(apr_sms_t *sms) -{ - /* If we don't have a lock_fn then we probably don't need one, - * so this is OK and we just return APR_SUCCESS - */ - if (!sms->lock_fn) - return APR_SUCCESS; - - return sms->lock_fn(sms); -} - -APR_DECLARE(apr_status_t) apr_sms_unlock(apr_sms_t *sms) -{ - /* If we don't have a lock_fn then we probably don't need one, - * so this is OK and we just return APR_SUCCESS - */ - if (!sms->unlock_fn) - return APR_SUCCESS; - - return sms->unlock_fn(sms); -} - -/* - * memory system cleanup management functions - */ - -APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms, - apr_int32_t type, - const void *data, - apr_status_t - (*cleanup_fn)(void *)) -{ - struct apr_sms_cleanup *cleanup; - - if (!cleanup_fn) - return APR_ENOTIMPL; - - if (sms->sms_lock) - apr_lock_acquire(sms->sms_lock); - - cleanup = apr_sms_malloc(sms->accounting, sizeof(struct apr_sms_cleanup)); - - if (!cleanup) { - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - return APR_ENOMEM; - } - - cleanup->data = data; - cleanup->type = type; - cleanup->cleanup_fn = cleanup_fn; - - cleanup->next = sms->cleanups; - sms->cleanups = cleanup; - - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms, - apr_int32_t type, - const void *data, - apr_status_t - (*cleanup_fn)(void *)) -{ - struct apr_sms_cleanup *cleanup; - struct apr_sms_cleanup **cleanup_ref; - apr_status_t rv = APR_EINVAL; - - if (sms->sms_lock) - apr_lock_acquire(sms->sms_lock); - - cleanup = sms->cleanups; - cleanup_ref = &sms->cleanups; - while (cleanup) { - if ((type == APR_ALL_CLEANUPS || cleanup->type == type) && - cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) { - *cleanup_ref = cleanup->next; - - sms = sms->accounting; - - if (sms->free_fn) - apr_sms_free(sms, cleanup); - - cleanup = *cleanup_ref; - rv = APR_SUCCESS; - } else { - cleanup_ref = &cleanup->next; - cleanup = cleanup->next; - } - } - - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - /* The cleanup function must have been registered previously */ - return rv; -} - -APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *sms, - apr_int32_t type) -{ - struct apr_sms_cleanup *cleanup; - struct apr_sms_cleanup **cleanup_ref; - apr_status_t rv = APR_EINVAL; - - if (sms->sms_lock) - apr_lock_acquire(sms->sms_lock); - - cleanup = sms->cleanups; - cleanup_ref = &sms->cleanups; - sms = sms->accounting; - while (cleanup) { - if (type == APR_ALL_CLEANUPS || cleanup->type == type) { - *cleanup_ref = cleanup->next; - - if (sms->free_fn) - apr_sms_free(sms, cleanup); - - cleanup = *cleanup_ref; - rv = APR_SUCCESS; - } - else { - cleanup_ref = &cleanup->next; - cleanup = cleanup->next; - } - } - - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - /* The cleanup function must have been registered previously */ - return rv; -} - -APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms, - apr_int32_t type, - const void *data, - apr_status_t - (*cleanup_fn)(void *)) -{ - apr_status_t rv; - - if ((rv = apr_sms_cleanup_unregister(sms, type, - data, cleanup_fn)) != APR_SUCCESS) - return rv; - - return cleanup_fn((void*)data); -} - -APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms, - apr_int32_t type) -{ - struct apr_sms_cleanup *cleanup; - struct apr_sms_cleanup **cleanup_ref; - apr_status_t rv = APR_EINVAL; - - if (sms->sms_lock) - apr_lock_acquire(sms->sms_lock); - - cleanup = sms->cleanups; - cleanup_ref = &sms->cleanups; - sms = sms->accounting; - while (cleanup) { - if (type == APR_ALL_CLEANUPS || cleanup->type == type) { - *cleanup_ref = cleanup->next; - - cleanup->cleanup_fn((void*)cleanup->data); - - if (sms->free_fn) - apr_sms_free(sms, cleanup); - - cleanup = *cleanup_ref; - rv = APR_SUCCESS; - } - else { - cleanup_ref = &cleanup->next; - cleanup = cleanup->next; - } - } - - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - /* The cleanup function should have been registered previously */ - return rv; -} - -#if APR_HAS_THREADS -APR_DECLARE(apr_status_t) apr_sms_thread_register(apr_sms_t *sms, - apr_os_thread_t thread) -{ - apr_status_t rv; - - /* Before attempting to acquire a lock for us, we must ensure that our - * parent is lock-safe. - */ - if (sms->parent) - { - apr_sms_thread_register(sms->parent, thread); - - if (!sms->sms_lock) { - /* Create the sms framework lock we'll use. */ - apr_lock_create(&sms->sms_lock, APR_MUTEX, APR_INTRAPROCESS, - NULL, sms->parent->pool); - } - } - - if (sms->sms_lock) - apr_lock_acquire(sms->sms_lock); - - sms->threads++; - - /* let the sms know about the thread if it is - * interested (so it can protect its private - * data with its own lock) - * - * if the sms is doesn't have a thread register - * function, or it wasn't able to register the - * thread, we should bomb out! - * XXX - not sure how to implement the bombing out - */ - rv = APR_ENOTIMPL; - if (sms->thread_register_fn) - rv = sms->thread_register_fn(sms, thread); - - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - if (rv != APR_SUCCESS) - return rv; - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_sms_thread_unregister(apr_sms_t *sms, - apr_os_thread_t thread) -{ - if (sms->sms_lock) - apr_lock_acquire(sms->sms_lock); - - sms->threads--; - - /* Even if the thread count hits one, we don't destroy the - * lock for now - */ - - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - return APR_SUCCESS; -} -#endif /* APR_HAS_THREADS */ - -APR_DECLARE(const char*) apr_sms_get_identity(apr_sms_t *sms) -{ - return sms->identity; -} - -APR_DECLARE(apr_sms_t *) apr_sms_get_parent(apr_sms_t *sms) -{ - return sms->parent; -} - -APR_DECLARE(void) apr_sms_set_abort(apr_abortfunc_t abort, apr_sms_t *sms) -{ - sms->apr_abort = abort; -} - -APR_DECLARE(apr_abortfunc_t) apr_sms_get_abort(apr_sms_t *sms) -{ - return sms->apr_abort; -} - -APR_DECLARE(apr_status_t) apr_sms_userdata_set(const void *data, - const char *key, - apr_status_t (*cleanup)(void*), - apr_sms_t *sms) -{ - apr_size_t keylen = strlen(key); - - if (sms->prog_data == NULL) - sms->prog_data = apr_hash_make(sms->pool); - - if (apr_hash_get(sms->prog_data, key, keylen) == NULL) { - char *new_key = apr_pstrdup(sms->pool, key); - apr_hash_set(sms->prog_data, new_key, keylen, data); - } else { - apr_hash_set(sms->prog_data, key, keylen, data); - } - - apr_sms_cleanup_register(sms, APR_GENERAL_CLEANUP, data, cleanup); - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_sms_userdata_get(void **data, const char *key, - apr_sms_t *sms) -{ - if (sms->prog_data == NULL) - *data = NULL; - else - *data = apr_hash_get(sms->prog_data, key, strlen(key)); - return APR_SUCCESS; -} - -#if APR_DEBUG_SHOW_STRUCTURE -static void add_sms(char *a, char *b, char *c, apr_sms_t *sms, - apr_sms_t *caller, int sib) -{ - char tmp[40]; - if (sib == 1) { - strcat(a, "="); - strcat(b, " "); - strcat(c, " "); - } - sprintf(tmp, sms == caller ? "**%9p**" : " [%9p] ", sms); - strcat(a, tmp); -#if APR_DEBUG_TAG_SMS - sprintf(tmp, " '%9s' ", sms->tag); -#else - sprintf(tmp, " "); -#endif - strcat(b, tmp); - sprintf(tmp, " [%9s] ", sms->identity); - strcat(c, tmp); -} - -static void add_tab(char *a, char *b, char *c, int level, apr_sms_t *sms) -{ - char buffer[100]; - int i; - for(i=0;i < level * 2;i++) - buffer[i] = ' '; - buffer[i] = '\0'; - strcpy(a, buffer); - strcpy(b, buffer); - strcpy(c, buffer); - if (sms->parent) - fprintf(dbg_file, "%s |\n", buffer); - fflush(dbg_file); -} - -static void print_structure(char *l1, char *l2, char *l3) -{ - fprintf(dbg_file, "%s\n%s\n%s\n", l1, l2, l3); - fflush(dbg_file); -} - -static void print_depth(int levels) -{ - fprintf(dbg_file, "Showing %d level%s of SMS\n", levels + 1, - levels == 0 ? "" : "s"); -} - -APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction) -{ - apr_sms_t *thesms, *sibling; - int levels = 0, i = 0; - char l1[256], l2[256], l3[256]; - - if (direction == 1) { - /* we're going up! */ - thesms = sms; - while (thesms->parent != NULL) { - levels++; - thesms = thesms->parent; - } - print_depth(levels); - /* thesms now eqauls the top level... so start showing them! */ - while (thesms) { - add_tab(l1, l2, l3, i++, thesms); - - add_sms(l1, l2, l3, thesms, sms, 0); - - sibling = thesms->sibling; - while (sibling) { - add_sms(l1, l2, l3, sibling, NULL, 1); - sibling = sibling->sibling; - } - print_structure(l1, l2, l3); - - thesms = thesms->child; - } - } else { - /* we go down! i.e. show our descendants */ - thesms = sms; - while (thesms->child) { - levels++; - thesms = thesms->child; - } - print_depth(levels); - thesms = sms; - while (thesms) { - add_tab(l1, l2, l3, i++, thesms); - - /* add the child... */ - add_sms(l1, l2, l3, thesms, sms, 0); - /* If we're destroying a sibling, then we won't be destroying - * the other siblings, just descendants of this SMS, so - * make sure what we show makes sense! - */ - if (thesms != sms && thesms->sibling) { - sibling = thesms->sibling; - while (sibling) { - add_sms(l1, l2, l3, sibling, NULL, 1); - sibling = sibling->sibling; - } - } - print_structure(l1, l2, l3); - thesms = thesms->child; - } - } -} -#endif /* APR_DEBUG_SHOW_STRUCTURE */ - -#if APR_DEBUG_TAG_SMS -APR_DECLARE(void) apr_sms_tag(apr_sms_t *sms, const char *tag) -{ - sms->tag = tag; -} -#endif - diff --git a/memory/unix/apr_sms_blocks.c b/memory/unix/apr_sms_blocks.c deleted file mode 100644 index e4a1f41c27f..00000000000 --- a/memory/unix/apr_sms_blocks.c +++ /dev/null @@ -1,280 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* This code kindly donated to APR by - * Elrond - * Luke Kenneth Casson Leighton - * Sander Striker - * - * May 2001 - */ - -#include "apr.h" -#include "apr_general.h" -#include "apr_private.h" -#include "apr_sms.h" -#include "apr_sms_blocks.h" -#include "apr_lock.h" -#include -#include "apr_portable.h" -#define APR_WANT_MEMFUNC -#include "apr_want.h" -#include "sms_private.h" - -static const char *module_identity = "BLOCKS"; -#define MIN_ALLOC 8 * 1024 /* don't allocate in smaller blocks than 8Kb */ - -/* - * Simple bucket memory system - */ - -/* INTERNALLY USED STRUCTURES */ -typedef struct block_t { - char *nxt; -} block_t; - -typedef struct apr_sms_blocks_t -{ - apr_sms_t header; - apr_size_t block_sz; - apr_size_t alloc_sz; - block_t *alloc_list; - block_t *free_list; - char *ptr; - char *endp; - char *self_endp; -} apr_sms_blocks_t; - -/* Various defines we'll use */ -#define SIZEOF_SMS_BLOCKS_T APR_ALIGN_DEFAULT(sizeof(apr_sms_blocks_t)) -#define SIZEOF_BLOCK_T APR_ALIGN_DEFAULT(sizeof(block_t)) - -#define SMS_BLOCKS_T(sms) ((apr_sms_blocks_t *)sms) -#define BLOCK_T(mem) ((block_t *)mem) - -static void *apr_sms_blocks_malloc(apr_sms_t *sms, - apr_size_t size) -{ - void *mem; - - if (size > SMS_BLOCKS_T(sms)->block_sz) - return NULL; - - if ((mem = SMS_BLOCKS_T(sms)->free_list) != NULL) { - SMS_BLOCKS_T(sms)->free_list = BLOCK_T(BLOCK_T(mem)->nxt); - return mem; - } - - mem = SMS_BLOCKS_T(sms)->ptr; - if ((SMS_BLOCKS_T(sms)->ptr = (char *)mem + SMS_BLOCKS_T(sms)->block_sz) - <= SMS_BLOCKS_T(sms)->endp) - return mem; - - /* OK, we've run out of memory. Let's get more :) */ - mem = apr_sms_malloc(sms->parent, SMS_BLOCKS_T(sms)->alloc_sz); - if (!mem) { - /* make safe and return */ - SMS_BLOCKS_T(sms)->ptr = SMS_BLOCKS_T(sms)->endp; - return NULL; - } - - /* Insert our new bit of memory at the start of the list */ - BLOCK_T(mem)->nxt = (char*)SMS_BLOCKS_T(sms)->alloc_list; - SMS_BLOCKS_T(sms)->alloc_list = mem; - SMS_BLOCKS_T(sms)->endp = (char *)mem + SMS_BLOCKS_T(sms)->alloc_sz; - mem = (char *)mem + SIZEOF_BLOCK_T; - SMS_BLOCKS_T(sms)->ptr = (char *)mem + SMS_BLOCKS_T(sms)->block_sz; - - if (SMS_BLOCKS_T(sms)->alloc_list->nxt) { - /* we're not the first block being added, so we increase our - * size. - */ - SMS_BLOCKS_T(sms)->alloc_sz <<= 1; - } - - - return mem; -} - -static void *apr_sms_blocks_calloc(apr_sms_t *sms, - apr_size_t size) -{ - void *mem; - - if (size > SMS_BLOCKS_T(sms)->block_sz) - return NULL; - - if ((mem = SMS_BLOCKS_T(sms)->free_list) != NULL) { - SMS_BLOCKS_T(sms)->free_list = BLOCK_T(BLOCK_T(mem)->nxt); - memset(mem, '\0', SMS_BLOCKS_T(sms)->block_sz); - return mem; - } - - mem = SMS_BLOCKS_T(sms)->ptr; - if ((SMS_BLOCKS_T(sms)->ptr = (char *)mem + - SMS_BLOCKS_T(sms)->block_sz) <= SMS_BLOCKS_T(sms)->endp) { - memset(mem, '\0', SMS_BLOCKS_T(sms)->block_sz); - return mem; - } - - /* probably quicker to just grab malloc memory, then memset as - * required. - */ - mem = apr_sms_malloc(sms->parent, SMS_BLOCKS_T(sms)->alloc_sz); - if (!mem) { - SMS_BLOCKS_T(sms)->ptr = SMS_BLOCKS_T(sms)->endp; - return NULL; - } - - /* Insert at the start of the list */ - BLOCK_T(mem)->nxt = (char*)SMS_BLOCKS_T(sms)->alloc_list; - SMS_BLOCKS_T(sms)->alloc_list = mem; - SMS_BLOCKS_T(sms)->endp = (char *)mem + SMS_BLOCKS_T(sms)->alloc_sz; - mem = (char *)mem + SIZEOF_BLOCK_T; - SMS_BLOCKS_T(sms)->ptr = (char *)mem + SMS_BLOCKS_T(sms)->block_sz; - - if (SMS_BLOCKS_T(sms)->alloc_list->nxt) { - /* we're not the first block being added, so we increase our - * size. - */ - SMS_BLOCKS_T(sms)->alloc_sz <<= 1; - } - - memset(mem, '\0', SMS_BLOCKS_T(sms)->block_sz); - - return mem; -} - -static apr_status_t apr_sms_blocks_free(apr_sms_t *sms, - void *mem) -{ - BLOCK_T(mem)->nxt = (char*)SMS_BLOCKS_T(sms)->free_list; - SMS_BLOCKS_T(sms)->free_list = mem; - return APR_SUCCESS; -} - -static apr_status_t apr_sms_blocks_reset(apr_sms_t *sms) -{ - block_t *block; - - SMS_BLOCKS_T(sms)->ptr = (char *)sms + SIZEOF_SMS_BLOCKS_T; - SMS_BLOCKS_T(sms)->endp = SMS_BLOCKS_T(sms)->self_endp; - SMS_BLOCKS_T(sms)->free_list = NULL; - - while ((block = SMS_BLOCKS_T(sms)->alloc_list) != NULL) { - SMS_BLOCKS_T(sms)->alloc_list = BLOCK_T(block->nxt); - apr_sms_free(sms->parent, block); - } - - return APR_SUCCESS; -} - -static apr_status_t apr_sms_blocks_destroy(apr_sms_t *sms) -{ - block_t *block; - - while ((block = SMS_BLOCKS_T(sms)->alloc_list) != NULL) { - SMS_BLOCKS_T(sms)->alloc_list = BLOCK_T(block->nxt); - apr_sms_free(sms->parent, block); - } - - return apr_sms_free(sms->parent, sms); -} - -APR_DECLARE(apr_status_t) apr_sms_blocks_create(apr_sms_t **sms, - apr_sms_t *parent, - apr_size_t block_size) -{ - apr_sms_t *new_sms; - apr_status_t rv; - apr_size_t alloc_size; - apr_sms_blocks_t *bms; - - *sms = NULL; - if (block_size == 0) - return APR_EINVAL; - - block_size = APR_ALIGN_DEFAULT(block_size); - alloc_size = block_size << 2; - if (alloc_size < MIN_ALLOC) - alloc_size = MIN_ALLOC; - - new_sms = apr_sms_calloc(parent, alloc_size); - - if (!new_sms) - return APR_ENOMEM; - - if ((rv = apr_sms_init(new_sms, parent)) != APR_SUCCESS) - return rv; - - new_sms->malloc_fn = apr_sms_blocks_malloc; - new_sms->calloc_fn = apr_sms_blocks_calloc; - new_sms->free_fn = apr_sms_blocks_free; - new_sms->reset_fn = apr_sms_blocks_reset; - new_sms->destroy_fn = apr_sms_blocks_destroy; - new_sms->identity = module_identity; - - bms = SMS_BLOCKS_T(new_sms); - bms->block_sz = block_size; - bms->alloc_sz = alloc_size; - bms->ptr = (char*)new_sms + SIZEOF_SMS_BLOCKS_T; - bms->endp = bms->self_endp = (char*)new_sms + alloc_size; - - /* We are normally single threaded so no lock */ - - apr_sms_post_init(new_sms); - - *sms = new_sms; - return APR_SUCCESS; -} diff --git a/memory/unix/apr_sms_pools.c b/memory/unix/apr_sms_pools.c deleted file mode 100644 index f2de23ca90a..00000000000 --- a/memory/unix/apr_sms_pools.c +++ /dev/null @@ -1,220 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr.h" -#include "apr_pools.h" /* includes apr_sms.h" */ -#include "apr_sms_trivial.h" -#include "apr_errno.h" -#include "apr_lock.h" -#include "apr_portable.h" -#include "apr_lib.h" /* for apr_vformatter */ - -#include "sms_private.h" - -static int initialized = 0; -static apr_pool_t *permanent_pool = NULL; - -APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, apr_pool_t *p) -{ - if (!initialized) - /* Hmm, if we are given a parent here, is this correct? - * It should never happen, so we're probably OK.... - */ - return apr_sms_std_create(newpool); - - return apr_sms_trivial_create_ex(newpool, p ? p : permanent_pool, - 0x2000, 0, 0x80000); -} - -APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **p, - apr_pool_t *pparent, - apr_abortfunc_t abort) -{ - if (apr_sms_trivial_create(p, pparent) != APR_SUCCESS) - return NULL; - - apr_sms_set_abort(abort, *p); - - return p; -} - -APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *pool, - const void *data, - apr_status_t (*plain_cleanup)(void*), - apr_status_t (*child_cleanup)(void*)) -{ - if (plain_cleanup == child_cleanup) { - /* we only need to register one as an ALL_CLEANUP */ - apr_sms_cleanup_register(pool, APR_ALL_CLEANUPS, data, plain_cleanup); - return; - } - if (plain_cleanup) - apr_sms_cleanup_register(pool, APR_GENERAL_CLEANUP, data, - plain_cleanup); - - if (child_cleanup) - apr_sms_cleanup_register(pool, APR_CHILD_CLEANUP, data, - child_cleanup); -} - -APR_DECLARE(void) apr_pool_cleanup_for_exec(void) -{ -#if !defined(WIN32) && !defined(OS2) - /* See note in apr_pools.c for why we do this :) */ - apr_sms_cleanup_run_type(permanent_pool, APR_CHILD_CLEANUP); -#endif -} - -APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *gp) -{ - apr_status_t rv; - - if ((rv = apr_sms_trivial_create_ex(&permanent_pool, gp, - 0x2000, 0, 0x80000)) != APR_SUCCESS) - return rv; - - initialized = 1; - - return APR_SUCCESS; -} - -APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *gp) -{ - if (initialized) - apr_sms_destroy(permanent_pool); - - initialized = 0; -} - -APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) -{ - while (b && b != a) - b = b->parent; - - return b == a; -} - -/* This stuff needs to be reviewed, but here it is :) */ - -struct psprintf_data { - apr_vformatter_buff_t vbuff; - char *base; - apr_sms_t *sms; -}; - -static int psprintf_flush(apr_vformatter_buff_t *vbuff) -{ - struct psprintf_data *ps = (struct psprintf_data*)vbuff; - apr_size_t size; - char *ptr; - - size = (char*) ps->vbuff.curpos - ps->base; - ptr = apr_sms_realloc(ps->sms, ps->base, 2*size); - if (ptr == NULL) { - fputs("[psprintf_flush] Ouch! Out of memory!\n", stderr); - exit(1); - } - ps->base = ptr; - ps->vbuff.curpos = ptr + size; - ps->vbuff.endpos = ptr + 2 * size - 1; - return 0; -} - -APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) -{ - struct psprintf_data ps; - void *ptr; - - ps.sms = (apr_sms_t*)p; - ps.base = apr_sms_malloc(ps.sms, 512); - if (ps.base == NULL) { - fputs("[apr_pvsprintf] Ouch! Out of memory!\n", stderr); - exit(1); - } - ps.vbuff.curpos = ps.base; - ps.vbuff.endpos = ps.base + 511; - apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); - *ps.vbuff.curpos++ = '\0'; - ptr = ps.base; - ptr = apr_sms_realloc(ps.sms, ptr, (char*)ps.vbuff.curpos - (char*)ptr); - if (ptr == NULL) { - fputs("[apr_pvsprintf #2] Ouch! Out of memory!\n", stderr); - exit(1); - } - return (char*)ptr; -} - -APR_DECLARE_NONSTD(char*) apr_psprintf(apr_pool_t *p, const char *fmt, ...) -{ - va_list ap; - char *res; - - va_start(ap,fmt); - res = apr_pvsprintf(p, fmt, ap); - va_end(ap); - return res; -} - -APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, - enum kill_conditions how) -{ - struct process_chain *newpc = (struct process_chain*) - apr_sms_malloc(a, sizeof(struct process_chain)); - - newpc->pid = pid; - newpc->kill_how = how; - newpc->next = a -> subprocesses; - a->subprocesses = newpc; -} - diff --git a/memory/unix/apr_sms_std.c b/memory/unix/apr_sms_std.c deleted file mode 100644 index 44145c5ae3f..00000000000 --- a/memory/unix/apr_sms_std.c +++ /dev/null @@ -1,159 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* This code kindly donated to APR by - * Elrond - * Luke Kenneth Casson Leighton - * Sander Striker - * - * May 2001 - */ - -#include "apr.h" -#include "apr_private.h" -#include "apr_sms.h" -#include -#include "sms_private.h" - -static const char *module_identity = "STANDARD"; - -/* - * standard memory system - */ - -static void *apr_sms_std_malloc(apr_sms_t *sms, - apr_size_t size) -{ - return malloc(size); -} - -static void *apr_sms_std_calloc(apr_sms_t *sms, - apr_size_t size) -{ -#if HAVE_CALLOC - return calloc(1, size); -#else - void *mem; - mem = malloc(size); - memset(mem, '\0', size); - return mem; -#endif -} - - -static void *apr_sms_std_realloc(apr_sms_t *sms, - void *mem, apr_size_t size) -{ - return realloc(mem, size); -} - -static apr_status_t apr_sms_std_free(apr_sms_t *sms, - void *mem) -{ - free(mem); - return APR_SUCCESS; -} - -#if APR_HAS_THREADS -static apr_status_t apr_sms_std_thread_register(apr_sms_t *sms, - apr_os_thread_t thread) -{ - return APR_SUCCESS; -} - -static apr_status_t apr_sms_std_thread_unregister(apr_sms_t *sms, - apr_os_thread_t thread) -{ - return APR_SUCCESS; -} -#endif /* APR_HAS_THREADS */ - -APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **sms) -{ - apr_sms_t *new_sms; - apr_status_t rv; - - *sms = NULL; - /* We don't have a parent so we allocate the memory - * for the structure ourselves... - */ - new_sms = apr_sms_std_calloc(NULL, sizeof(apr_sms_t)); - - if (!new_sms) - return APR_ENOMEM; - - if ((rv = apr_sms_init(new_sms, NULL)) != APR_SUCCESS) - return rv; - - new_sms->malloc_fn = apr_sms_std_malloc; - new_sms->calloc_fn = apr_sms_std_calloc; - new_sms->realloc_fn = apr_sms_std_realloc; - new_sms->free_fn = apr_sms_std_free; -#if APR_HAS_THREADS - new_sms->thread_register_fn = apr_sms_std_thread_register; - new_sms->thread_unregister_fn = apr_sms_std_thread_unregister; -#endif /* APR_HAS_THREADS */ - new_sms->identity = module_identity; - - /* as we're not a tracking memory module, i.e. we don't keep - * track of our allocations, we don't have apr_sms_reset or - * apr_sms_destroy functions. - */ - - apr_sms_post_init(new_sms); - - *sms = new_sms; - return APR_SUCCESS; -} - diff --git a/memory/unix/apr_sms_threads.c b/memory/unix/apr_sms_threads.c deleted file mode 100644 index 359a9a17727..00000000000 --- a/memory/unix/apr_sms_threads.c +++ /dev/null @@ -1,964 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr.h" -#include "apr_general.h" -#include "apr_private.h" -#include "apr_sms.h" -#include "apr_sms_threads.h" -#include "apr_lock.h" -#include "sms_private.h" - -#if APR_HAS_THREADS - -static const char *module_identity = "THREADS"; -static const char *module_acct_identity = "THREADS_ACCT"; - -/* - * Simple thread memory system - */ - -/* INTERNALLY USED STRUCTURES */ - -typedef struct block_t -{ - struct node_t *node; -} block_t; - -typedef struct node_t -{ - struct node_t *next; - struct node_t *prev; - char *first_avail; - apr_size_t avail_size; - apr_uint16_t count; -} node_t; - -typedef struct thread_node_t -{ - struct thread_node_t *next; - struct thread_node_t **ref; - apr_os_thread_t thread; - node_t used_sentinel; - node_t free_sentinel; - node_t *self; - apr_size_t max_free; -} thread_node_t; - -/* - * Primes just below a power of 2: - * 3, 7, 13, 31, 61, 127, 251, 509, 1021, - * 2039, 4093, 8191, 16381, 32749, 65521 - */ - -#define HASH_SIZE 1021 -#define SIZEOF_HASHTABLE APR_ALIGN_DEFAULT(HASH_SIZE) -#define THREAD_HASH(tid) \ -(*(int *)&(tid) % HASH_SIZE) - -typedef struct apr_sms_threads_t -{ - apr_sms_t sms_hdr; - node_t used_sentinel; - node_t free_sentinel; - node_t *self; - char *first_avail; - thread_node_t *hashtable[SIZEOF_HASHTABLE]; - apr_size_t min_free; - apr_size_t min_alloc; - apr_size_t max_free; - apr_size_t thread_max_free; - apr_lock_t *lock; -} apr_sms_threads_t; - -typedef struct apr_sms_threads_acct_t -{ - apr_sms_t sms_hdr; - apr_sms_threads_t *tms; -} apr_sms_threads_acct_t; - -#define SIZEOF_BLOCK_T APR_ALIGN_DEFAULT(sizeof(block_t)) -#define SIZEOF_NODE_T APR_ALIGN_DEFAULT(sizeof(node_t)) -#define SIZEOF_THREAD_NODE_T APR_ALIGN_DEFAULT(sizeof(thread_node_t)) -#define SIZEOF_SMS_THREADS_T APR_ALIGN_DEFAULT(sizeof(apr_sms_threads_t)) -#define SIZEOF_SMS_ACCT_T APR_ALIGN_DEFAULT(sizeof(apr_sms_threads_acct_t)) - -#define BLOCK_T(mem) ((block_t *)(mem)) -#define NODE_T(mem) ((node_t *)(mem)) -#define THREAD_NODE_T(mem) ((thread_node_t *)(mem)) -#define SMS_THREADS_T(sms) ((apr_sms_threads_t *)(sms)) -#define SMS_ACCT_T(sms) ((apr_sms_threads_acct_t *)(sms)) - -/* Magic numbers :) */ - -#define MIN_ALLOC 0x2000 -#define MIN_FREE 0x1000 -#define MAX_FREE 0x100000 -#define THREAD_MAX_FREE 0x80000 - -static void *apr_sms_threads_malloc(apr_sms_t *sms, - apr_size_t size) -{ - thread_node_t *thread_node; - apr_os_thread_t thread; - node_t *node, *sentinel; - apr_size_t node_size; - apr_uint16_t hash; - void *mem; - - /* Round up the size to the next 8 byte boundary */ - size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; - - thread = apr_os_thread_current(); - hash = THREAD_HASH(thread); - - /* If the thread wasn't registered before, we will segfault */ - thread_node = SMS_THREADS_T(sms)->hashtable[hash]; - while (!apr_os_thread_equal(thread_node->thread, thread)) - thread_node = thread_node->next; - - node = thread_node->used_sentinel.prev; - - if (node->avail_size >= size) { - mem = node->first_avail; - node->avail_size -= size; - node->first_avail += size; - node->count++; - - BLOCK_T(mem)->node = node; - mem = (char *)mem + SIZEOF_BLOCK_T; - - return mem; - } - - /* reset the 'last' block, it will be replaced soon */ - node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - - /* browse the free list for a useable block */ - sentinel = &thread_node->free_sentinel; - sentinel->avail_size = size; - - node = sentinel->next; - while (node->avail_size < size) - node = node->next; - - if (node != sentinel) { - node->prev->next = node->next; - node->next->prev = node->prev; - - sentinel = &thread_node->used_sentinel; - node->prev = sentinel->prev; - node->prev->next = node; - node->next = sentinel; - sentinel->prev = node; - - if (node != thread_node->self) - thread_node->max_free += node->avail_size; - - mem = node->first_avail; - node->avail_size -= size; - node->first_avail += size; - node->count = 1; - - BLOCK_T(mem)->node = node; - mem = (char *)mem + SIZEOF_BLOCK_T; - - return mem; - } - - if (SMS_THREADS_T(sms)->lock) - apr_lock_acquire(SMS_THREADS_T(sms)->lock); - - /* browse the shared free list for a useable block */ - sentinel = &SMS_THREADS_T(sms)->free_sentinel; - sentinel->avail_size = size; - - node = sentinel->next; - while (node->avail_size < size) - node = node->next; - - if (node != sentinel) { - node->prev->next = node->next; - node->next->prev = node->prev; - - if (SMS_THREADS_T(sms)->lock) - apr_lock_release(SMS_THREADS_T(sms)->lock); - - sentinel = &thread_node->used_sentinel; - node->prev = sentinel->prev; - node->prev->next = node; - node->next = sentinel; - sentinel->prev = node; - - SMS_THREADS_T(sms)->max_free += node->avail_size; - - mem = node->first_avail; - node->avail_size -= size; - node->first_avail += size; - node->count = 1; - - BLOCK_T(mem)->node = node; - mem = (char *)mem + SIZEOF_BLOCK_T; - - return mem; - } - - if (SMS_THREADS_T(sms)->lock) - apr_lock_release(SMS_THREADS_T(sms)->lock); - - /* we have to allocate a new block from our parent */ - node_size = size + SMS_THREADS_T(sms)->min_free; - if (node_size < SMS_THREADS_T(sms)->min_alloc) - node_size = SMS_THREADS_T(sms)->min_alloc; - - node = apr_sms_malloc(sms->parent, node_size); - if (!node) { - /* restore the 'last' node to prevent the - * next allocation from segfaulting - */ - node = thread_node->used_sentinel.prev; - node->first_avail += node->avail_size; - node->avail_size = 0; - - return NULL; - } - - sentinel = &thread_node->used_sentinel; - node->prev = sentinel->prev; - node->prev->next = node; - node->next = sentinel; - sentinel->prev = node; - - mem = node->first_avail = (char *)node + SIZEOF_NODE_T; - node->first_avail += size; - node->avail_size = node_size - (node->first_avail - (char *)node); - node->count = 1; - - BLOCK_T(mem)->node = node; - mem = (char *)mem + SIZEOF_BLOCK_T; - - return mem; -} - -static apr_status_t apr_sms_threads_free(apr_sms_t *sms, void *mem) -{ - node_t *node, *sentinel; - thread_node_t *thread_node; - apr_os_thread_t thread; - apr_uint16_t hash; - - node = BLOCK_T((char *)mem - SIZEOF_BLOCK_T)->node; - - node->count--; - if (node->count) - return APR_SUCCESS; - - thread = apr_os_thread_current(); - hash = THREAD_HASH(thread); - - thread_node = SMS_THREADS_T(sms)->hashtable[hash]; - while (!apr_os_thread_equal(thread_node->thread, thread)) - thread_node = thread_node->next; - - node->avail_size += node->first_avail - - ((char *)node + SIZEOF_NODE_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - - if (thread_node->used_sentinel.prev == node) - return APR_SUCCESS; - - node->next->prev = node->prev; - node->prev->next = node->next; - - if (thread_node->max_free >= node->avail_size || - node == thread_node->self) { - sentinel = &thread_node->free_sentinel; - node->prev = sentinel->prev; - node->prev->next = node; - node->next = sentinel; - sentinel->prev = node; - - if (node != thread_node->self) - thread_node->max_free -= node->avail_size; - - return APR_SUCCESS; - } - - if (sms->parent->free_fn && - node->avail_size > SMS_THREADS_T(sms)->max_free) - return apr_sms_free(sms->parent, node); - - if (SMS_THREADS_T(sms)->lock) - apr_lock_acquire(SMS_THREADS_T(sms)->lock); - - sentinel = &SMS_THREADS_T(sms)->free_sentinel; - node->prev = sentinel->prev; - node->prev->next = node; - node->next = sentinel; - sentinel->prev = node; - - SMS_THREADS_T(sms)->max_free -= node->avail_size; - - if (SMS_THREADS_T(sms)->lock) - apr_lock_release(SMS_THREADS_T(sms)->lock); - - return APR_SUCCESS; -} - -static apr_status_t apr_sms_threads_thread_register(apr_sms_t *sms, - apr_os_thread_t thread); - -static apr_status_t apr_sms_threads_reset(apr_sms_t *sms) -{ - node_t *node, *prev, *used_sentinel, *free_sentinel, *free_list; - thread_node_t *thread_node; - apr_uint16_t hash; - apr_size_t min_alloc, max_free; - - used_sentinel = &SMS_THREADS_T(sms)->used_sentinel; - free_sentinel = &SMS_THREADS_T(sms)->free_sentinel; - - free_list = NULL; - - if (SMS_THREADS_T(sms)->lock) - apr_lock_acquire(SMS_THREADS_T(sms)->lock); - - /* Actually, the thread creation function should have installed - * a cleanup which effectively kills all the threads created using - * this sms. Therefor it is not wise to call reset from another - * thread than the 'master' thread. - */ - for (hash = 0; hash < HASH_SIZE; hash++) { - while ((thread_node = SMS_THREADS_T(sms)->hashtable[hash]) != NULL) { - if ((*thread_node->ref = thread_node->next) != NULL) - thread_node->next->ref = thread_node->ref; - - node = thread_node->self; - node->prev->next = node->next; - node->next->prev = node->prev; - node->avail_size += node->first_avail - - ((char *)node + SIZEOF_NODE_T); - - node = thread_node->used_sentinel.prev; - node->avail_size += node->first_avail - - ((char *)node + SIZEOF_NODE_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - node->next = thread_node->free_sentinel.next; - node->next->prev = node; - - node = thread_node->free_sentinel.prev; - node->next = used_sentinel->next; - node->next->prev = node; - - used_sentinel->next = thread_node->used_sentinel.next; - used_sentinel->next->prev = used_sentinel; - - node = NODE_T(thread_node); - node->avail_size = thread_node->self->avail_size + - SIZEOF_THREAD_NODE_T; - node->first_avail = (char *)node + SIZEOF_NODE_T; - - node->next = used_sentinel->next; - node->next->prev = node; - used_sentinel->next = node; - node->prev = used_sentinel; - } - } - - node = SMS_THREADS_T(sms)->self; - node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - node->count = 0; - node->prev->next = node->next; - node->next->prev = node->prev; - - node = used_sentinel->prev; - node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - - if (sms->parent->free_fn) { - min_alloc = SMS_THREADS_T(sms)->min_alloc; - max_free = SMS_THREADS_T(sms)->max_free; - used_sentinel->avail_size = min_alloc; - while (max_free > min_alloc) { - if (node->avail_size <= max_free) { - if (node == used_sentinel) - break; - - max_free -= node->avail_size; - node->prev->next = node->next; - node->next->prev = node->prev; - - prev = node->prev; - - node->next = free_sentinel->next; - free_sentinel->next = node; - node->next->prev = node; - node->prev = free_sentinel; - - node = prev; - } - else - node = node->prev; - } - SMS_THREADS_T(sms)->max_free = max_free; - - used_sentinel->prev->next = NULL; - free_list = used_sentinel->next; - } - else { - node = used_sentinel->prev; - node->next = free_sentinel->next; - node->next->prev = node; - - node = used_sentinel->next; - node->prev = free_sentinel; - free_sentinel->next = node; - } - - node = SMS_THREADS_T(sms)->self; - node->next = node->prev = used_sentinel; - used_sentinel->next = used_sentinel->prev = node; - - sms->accounting = (apr_sms_t *)((char *)sms + SIZEOF_SMS_THREADS_T); - - apr_sms_threads_thread_register(sms, apr_os_thread_current()); - - if (SMS_THREADS_T(sms)->lock) - apr_lock_release(SMS_THREADS_T(sms)->lock); - - while ((node = free_list) != NULL) { - free_list = node->next; - apr_sms_free(sms->parent, node); - } - - return APR_SUCCESS; -} - -static apr_status_t apr_sms_threads_pre_destroy(apr_sms_t *sms) -{ - /* This function WILL always be called. However, be aware that the - * main sms destroy function knows that it's not wise to try and destroy - * the same piece of memory twice, so the destroy function in a child won't - * necessarily be called. To guarantee we destroy the lock it's therefore - * destroyed here. - */ - - if (SMS_THREADS_T(sms)->lock) { - apr_lock_acquire(SMS_THREADS_T(sms)->lock); - apr_lock_destroy(SMS_THREADS_T(sms)->lock); - SMS_THREADS_T(sms)->lock = NULL; - } - - return APR_SUCCESS; -} - -static apr_status_t apr_sms_threads_destroy(apr_sms_t *sms) -{ - node_t *node, *next, *used_sentinel, *free_sentinel; - thread_node_t *thread_node; - apr_uint16_t hash; - - for (hash = 0; hash < HASH_SIZE; hash++) { - while ((thread_node = SMS_THREADS_T(sms)->hashtable[hash]) != NULL) { - if ((*thread_node->ref = thread_node->next) != NULL) - thread_node->next->ref = thread_node->ref; - - node = thread_node->self; - node->prev->next = node->next; - node->next->prev = node->prev; - - used_sentinel = &thread_node->used_sentinel; - free_sentinel = &thread_node->free_sentinel; - - free_sentinel->prev->next = NULL; - used_sentinel->prev->next = free_sentinel->next; - - node = used_sentinel->next; - while (node) { - next = node->next; - apr_sms_free(sms->parent, node); - node = next; - } - - apr_sms_free(sms->parent, thread_node); - } - } - - node = SMS_THREADS_T(sms)->self; - node->prev->next = node->next; - node->next->prev = node->prev; - - used_sentinel = &SMS_THREADS_T(sms)->used_sentinel; - free_sentinel = &SMS_THREADS_T(sms)->free_sentinel; - - free_sentinel->prev->next = NULL; - used_sentinel->prev->next = free_sentinel->next; - - node = used_sentinel->next; - while (node) { - next = node->next; - apr_sms_free(sms->parent, node); - node = next; - } - - return apr_sms_free(sms->parent, sms); -} - -static apr_status_t apr_sms_threads_thread_register(apr_sms_t *sms, - apr_os_thread_t thread) -{ - thread_node_t *thread_node; - node_t *node, *sentinel; - apr_uint16_t hash; - - hash = THREAD_HASH(thread); - - if (sms->threads > 1 && !SMS_THREADS_T(sms)->lock) { - apr_lock_create(&SMS_THREADS_T(sms)->lock, - APR_MUTEX, APR_LOCKALL, - NULL, sms->pool); - } - - if (SMS_THREADS_T(sms)->lock) - apr_lock_acquire(SMS_THREADS_T(sms)->lock); - - sentinel = &SMS_THREADS_T(sms)->free_sentinel; - if ((node = sentinel->next) != sentinel) { - node->prev->next = node->next; - node->next->prev = node->prev; - - thread_node = THREAD_NODE_T(node); - node = NODE_T((char *)thread_node + SIZEOF_THREAD_NODE_T); - node->avail_size = NODE_T(thread_node)->avail_size - - SIZEOF_THREAD_NODE_T; - node->first_avail = (char *)node + SIZEOF_NODE_T; - } - else { - thread_node = apr_sms_malloc(sms->parent, SMS_THREADS_T(sms)->min_alloc); - if (!thread_node) { - if (SMS_THREADS_T(sms)->lock) - apr_lock_release(SMS_THREADS_T(sms)->lock); - - return APR_ENOMEM; - } - - node = NODE_T((char *)thread_node + SIZEOF_THREAD_NODE_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - node->avail_size = SMS_THREADS_T(sms)->min_alloc - - (node->first_avail - (char *)thread_node); - } - node->count = 0; - - thread_node->self = node; - thread_node->max_free = SMS_THREADS_T(sms)->thread_max_free; - - sentinel = &thread_node->used_sentinel; - node->prev = node->next = sentinel; - sentinel->prev = sentinel->next = node; - - sentinel = &thread_node->free_sentinel; - sentinel->prev = sentinel->next = sentinel; - - thread_node->thread = thread; - if ((thread_node->next = SMS_THREADS_T(sms)->hashtable[hash]) != NULL) - thread_node->next->ref = &thread_node->next; - thread_node->ref = &SMS_THREADS_T(sms)->hashtable[hash]; - SMS_THREADS_T(sms)->hashtable[hash] = thread_node; - - if (SMS_THREADS_T(sms)->lock) - apr_lock_release(SMS_THREADS_T(sms)->lock); - - return APR_SUCCESS; -} - -static apr_status_t apr_sms_threads_thread_unregister(apr_sms_t *sms, - apr_os_thread_t thread) -{ - thread_node_t *thread_node; - node_t *node, *prev, *free_list, *used_sentinel, *free_sentinel; - apr_uint16_t hash; - apr_size_t min_alloc, max_free; - - hash = THREAD_HASH(thread); - free_list = NULL; - - if (SMS_THREADS_T(sms)->lock) - apr_lock_acquire(SMS_THREADS_T(sms)->lock); - - thread_node = SMS_THREADS_T(sms)->hashtable[hash]; - while (!apr_os_thread_equal(thread_node->thread, thread)) - thread_node = thread_node->next; - - if ((*thread_node->ref = thread_node->next) != NULL) - thread_node->next->ref = thread_node->ref; - - node = thread_node->self; - node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); - node->prev->next = node->next; - node->next->prev = node->prev; - - used_sentinel = &thread_node->used_sentinel; - free_sentinel = &SMS_THREADS_T(sms)->free_sentinel; - - node = used_sentinel->prev; - node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - - node->next = thread_node->free_sentinel.next; - node->next->prev = node; - - node = thread_node->free_sentinel.prev; - node->next = used_sentinel; - used_sentinel->prev = node; - - min_alloc = SMS_THREADS_T(sms)->min_alloc; - max_free = SMS_THREADS_T(sms)->max_free; - used_sentinel->avail_size = min_alloc; - while (max_free > min_alloc) { - if (node->avail_size <= max_free) { - if (node == used_sentinel) - break; - - max_free -= node->avail_size; - node->prev->next = node->next; - node->next->prev = node->prev; - prev = node->prev; - - node->next = free_sentinel->next; - free_sentinel->next = node; - node->next->prev = node; - node->prev = free_sentinel; - - node = prev; - } - else - node = node->prev; - } - - used_sentinel->prev->next = NULL; - free_list = used_sentinel->next; - - node = NODE_T(thread_node); - node->avail_size = thread_node->self->avail_size + - SIZEOF_THREAD_NODE_T; - node->first_avail = (char *)node + SIZEOF_NODE_T; - - if (max_free >= node->avail_size) { - max_free -= node->avail_size; - - node->next = free_sentinel->next; - node->next->prev = node; - free_sentinel->next = node; - node->prev = free_sentinel; - } - else { - node->next = free_list; - free_list = node; - } - - SMS_THREADS_T(sms)->max_free = max_free; - - if (SMS_THREADS_T(sms)->lock) - apr_lock_release(SMS_THREADS_T(sms)->lock); - - while ((node = free_list) != NULL) { - free_list = node->next; - apr_sms_free(sms->parent, node); - } - - return APR_SUCCESS; -} - -static void *apr_sms_threads_acct_malloc(apr_sms_t *sms, apr_size_t size) -{ - apr_sms_threads_t *tms; - node_t *node, *sentinel; - apr_size_t node_size; - void *mem; - - tms = SMS_ACCT_T(sms)->tms; - - /* Round up the size to the next 8 byte boundary */ - size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; - - if (tms->lock) - apr_lock_acquire(tms->lock); - - node = tms->used_sentinel.prev; - - if (node->avail_size >= size) { - mem = node->first_avail; - node->avail_size -= size; - node->first_avail += size; - node->count++; - - if (tms->lock) - apr_lock_release(tms->lock); - - BLOCK_T(mem)->node = node; - mem = (char *)mem + SIZEOF_BLOCK_T; - - return mem; - } - - /* reset the 'last' block, it will be replaced soon */ - node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - - /* browse the free list for a useable block */ - sentinel = &tms->free_sentinel; - sentinel->avail_size = size; - - node = sentinel->next; - while (node->avail_size < size) - node = node->next; - - if (node != sentinel) { - node->prev->next = node->next; - node->next->prev = node->prev; - - sentinel = &tms->used_sentinel; - node->prev = sentinel->prev; - node->prev->next = node; - node->next = sentinel; - sentinel->prev = node; - - if (node != tms->self) - tms->max_free += node->avail_size; - - mem = node->first_avail; - node->avail_size -= size; - node->first_avail += size; - node->count = 1; - - if (tms->lock) - apr_lock_release(tms->lock); - - BLOCK_T(mem)->node = node; - mem = (char *)mem + SIZEOF_BLOCK_T; - - return mem; - } - - /* we have to allocate a new block from our parent */ - node_size = size + tms->min_free; - if (node_size < tms->min_alloc) - node_size = tms->min_alloc; - - node = apr_sms_malloc(sms->parent, node_size); - if (!node) { - /* restore the 'last' node, so the next allocation - * will not segfault - */ - node = tms->used_sentinel.prev; - node->first_avail += node->avail_size; - node->avail_size = 0; - - if (tms->lock) - apr_lock_release(tms->lock); - - return NULL; - } - - sentinel = &tms->used_sentinel; - node->prev = sentinel->prev; - node->prev->next = node; - node->next = sentinel; - sentinel->prev = node; - - mem = node->first_avail = (char *)node + SIZEOF_NODE_T; - node->first_avail += size; - node->avail_size = node_size - (node->first_avail - (char *)node); - node->count = 1; - - if (tms->lock) - apr_lock_release(tms->lock); - - BLOCK_T(mem)->node = node; - mem = (char *)mem + SIZEOF_BLOCK_T; - - return mem; -} - -static apr_status_t apr_sms_threads_acct_free(apr_sms_t *sms, void *mem) -{ - apr_sms_threads_t *tms; - node_t *node, *sentinel; - - tms = SMS_ACCT_T(sms)->tms; - node = BLOCK_T((char *)mem - SIZEOF_BLOCK_T)->node; - - if (tms->lock) - apr_lock_acquire(tms->lock); - - node->count--; - - if (node->count) { - if (tms->lock) - apr_lock_release(tms->lock); - - return APR_SUCCESS; - } - - node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - - if (tms->used_sentinel.prev != node) { - node->next->prev = node->prev; - node->prev->next = node->next; - - if (sms->parent->free_fn && - node->avail_size > tms->max_free && - node != tms->self) { - if (tms->lock) - apr_lock_release(tms->lock); - - return apr_sms_free(sms->parent, node); - } - - sentinel = &tms->free_sentinel; - node->prev = sentinel->prev; - node->prev->next = node; - node->next = sentinel; - sentinel->prev = node; - - if (node != tms->self) - tms->max_free -= node->avail_size; - } - - if (tms->lock) - apr_lock_release(tms->lock); - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_sms_threads_create(apr_sms_t **sms, - apr_sms_t *pms) -{ - return apr_sms_threads_create_ex(sms, pms, MIN_ALLOC, MIN_FREE, MAX_FREE); -} - -APR_DECLARE(apr_status_t) apr_sms_threads_create_ex(apr_sms_t **sms, - apr_sms_t *pms, - apr_size_t min_alloc, - apr_size_t min_free, - apr_size_t max_free) -{ - apr_sms_t *new_sms, *ams; - apr_sms_threads_t *tms; - node_t *node; - apr_status_t rv; - - *sms = NULL; - - min_alloc = APR_ALIGN_DEFAULT(min_alloc); - min_free = APR_ALIGN_DEFAULT(min_free); - - /* We're not a top level module, ie we have a parent, so - * we allocate the memory for the structure from our parent. - * This is safe as we shouldn't outlive our parent... - */ - new_sms = apr_sms_calloc(pms, min_alloc); - if (!new_sms) - return APR_ENOMEM; - - if ((rv = apr_sms_init(new_sms, pms)) != APR_SUCCESS) - return rv; - - new_sms->malloc_fn = apr_sms_threads_malloc; - new_sms->free_fn = apr_sms_threads_free; - new_sms->reset_fn = apr_sms_threads_reset; - new_sms->pre_destroy_fn = apr_sms_threads_pre_destroy; - new_sms->destroy_fn = apr_sms_threads_destroy; - new_sms->thread_register_fn = apr_sms_threads_thread_register; - new_sms->thread_unregister_fn = apr_sms_threads_thread_unregister; - new_sms->identity = module_identity; - - ams = (apr_sms_t *)((char *)new_sms + SIZEOF_SMS_THREADS_T); - - node = NODE_T((char *)ams + SIZEOF_SMS_ACCT_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - node->avail_size = min_alloc - (node->first_avail - (char *)new_sms); - node->count = 0; - - tms = SMS_THREADS_T(new_sms); - tms->min_alloc = min_alloc; - tms->min_free = min_free; - tms->max_free = max_free; - tms->thread_max_free = THREAD_MAX_FREE; - tms->self = node; - - node->next = node->prev = &tms->used_sentinel; - tms->used_sentinel.next = tms->used_sentinel.prev = node; - tms->free_sentinel.next = tms->free_sentinel.prev = &tms->free_sentinel; - - apr_sms_init(ams, new_sms); - ams->malloc_fn = apr_sms_threads_acct_malloc; - ams->free_fn = apr_sms_threads_acct_free; - ams->identity = module_acct_identity; - SMS_ACCT_T(ams)->tms = tms; - apr_sms_post_init(ams); - - new_sms->accounting = ams; - - apr_sms_post_init(new_sms); - - *sms = new_sms; - return APR_SUCCESS; -} - -#endif /* APR_HAS_THREADS */ - diff --git a/memory/unix/apr_sms_tracking.c b/memory/unix/apr_sms_tracking.c deleted file mode 100644 index 64ecbfbc400..00000000000 --- a/memory/unix/apr_sms_tracking.c +++ /dev/null @@ -1,291 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* This code kindly donated to APR by - * Elrond - * Luke Kenneth Casson Leighton - * Sander Striker - * - * May 2001 - */ - -#include "apr.h" -#include "apr_general.h" -#include "apr_private.h" -#include "apr_sms.h" -#include "apr_sms_tracking.h" -#include "apr_lock.h" -#include /* for NULL */ -#include "sms_private.h" - -static const char *module_identity = "TRACKING"; - -/* - * Simple tracking memory system - */ - -/* INTERNALLY USED STRUCTURES */ -typedef struct block_t -{ - struct block_t *next; - struct block_t **ref; -} block_t; - -typedef struct apr_sms_tracking_t -{ - apr_sms_t sms_hdr; - block_t *blocks; - apr_lock_t *lock; -} apr_sms_tracking_t; - -#define SIZEOF_BLOCK_T APR_ALIGN_DEFAULT(sizeof(block_t)) -#define SIZEOF_SMS_TRACKING_T APR_ALIGN_DEFAULT(sizeof(apr_sms_tracking_t)) - -#define BLOCK_T(mem) ((block_t *)(mem)) -#define SMS_TRACKING_T(sms) ((apr_sms_tracking_t *)(sms)) - -#define INSERT_BLOCK(block, tms) \ - if (tms->lock) \ - apr_lock_acquire(tms->lock); \ - \ - block->ref = &tms->blocks; \ - if ((block->next = tms->blocks) != NULL) \ - block->next->ref = &block->next; \ - tms->blocks = block; \ - \ - if (tms->lock) \ - apr_lock_release(tms->lock); - -#define REMOVE_BLOCK(block, tms) \ - if (tms->lock) \ - apr_lock_acquire(tms->lock); \ - \ - *block->ref = block->next; \ - if ((*block->ref = block->next) != NULL) \ - block->next->ref = block->ref; \ - \ - if (tms->lock) \ - apr_lock_release(tms->lock); - -static void *apr_sms_tracking_malloc(apr_sms_t *sms, - apr_size_t size) -{ - void *mem; - - size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; - mem = apr_sms_malloc(sms->parent, size); - if (!mem) - return NULL; - - INSERT_BLOCK(BLOCK_T(mem), SMS_TRACKING_T(sms)) - - mem = (char *)mem + SIZEOF_BLOCK_T; - - return mem; -} - -static void *apr_sms_tracking_calloc(apr_sms_t *sms, - apr_size_t size) -{ - void *mem; - - size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; - mem = apr_sms_calloc(sms->parent, size); - if (!mem) - return NULL; - - INSERT_BLOCK(BLOCK_T(mem), SMS_TRACKING_T(sms)) - - mem = (char *)mem + SIZEOF_BLOCK_T; - - return mem; -} - -static void *apr_sms_tracking_realloc(apr_sms_t *sms, - void *mem, apr_size_t size) -{ - block_t *block; - - block = BLOCK_T((char *)mem - SIZEOF_BLOCK_T); - - REMOVE_BLOCK(block, SMS_TRACKING_T(sms)) - - size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; - mem = apr_sms_realloc(sms->parent, block, size); - if (!mem) - return NULL; - - INSERT_BLOCK(BLOCK_T(mem), SMS_TRACKING_T(sms)) - - mem = (char *)mem + SIZEOF_BLOCK_T; - - return mem; -} - -static apr_status_t apr_sms_tracking_free(apr_sms_t *sms, - void *mem) -{ - mem = (char *)mem - SIZEOF_BLOCK_T; - - REMOVE_BLOCK(BLOCK_T(mem), SMS_TRACKING_T(sms)); - - return apr_sms_free(sms->parent, mem); -} - -static apr_status_t apr_sms_tracking_reset(apr_sms_t *sms) -{ - block_t *block; - apr_status_t rv = APR_SUCCESS; - - if (SMS_TRACKING_T(sms)->lock) - apr_lock_acquire(SMS_TRACKING_T(sms)->lock); - - while ((block = SMS_TRACKING_T(sms)->blocks) != NULL) { - if ((*block->ref = block->next) != NULL) - block->next->ref = block->ref; - - if ((rv = apr_sms_free(sms->parent, block)) != APR_SUCCESS) - break; - } - - if (SMS_TRACKING_T(sms)->lock) - apr_lock_release(SMS_TRACKING_T(sms)->lock); - - return rv; -} - -static apr_status_t apr_sms_tracking_pre_destroy(apr_sms_t *sms) -{ - /* This function WILL alwways be called. However, be aware that the - * main sms destroy function knows that it's not wise to try and destroy - * the same piece of memory twice, so the destroy function in a child won't - * necessarily be called. To guarantee we destroy the lock it's therefore - * destroyed here. - */ - - if (SMS_TRACKING_T(sms)->lock) { - apr_lock_acquire(SMS_TRACKING_T(sms)->lock); - apr_lock_destroy(SMS_TRACKING_T(sms)->lock); - SMS_TRACKING_T(sms)->lock = NULL; - } - - return APR_SUCCESS; -} - -static apr_status_t apr_sms_tracking_destroy(apr_sms_t *sms) -{ - apr_status_t rv; - - if ((rv = apr_sms_reset(sms)) != APR_SUCCESS) - return rv; - - return apr_sms_free(sms->parent, sms); -} - -#if APR_HAS_THREADS -static apr_status_t apr_sms_tracking_thread_register(apr_sms_t *sms, - apr_os_thread_t thread) -{ - if (!SMS_TRACKING_T(sms)->lock && sms->threads > 1) - return apr_lock_create(&SMS_TRACKING_T(sms)->lock, - APR_MUTEX, APR_LOCKALL, - NULL, sms->pool); - return APR_SUCCESS; -} - -static apr_status_t apr_sms_tracking_thread_unregister(apr_sms_t *sms, - apr_os_thread_t thread) -{ - return APR_SUCCESS; -} -#endif /* APR_HAS_THREADS */ - - -APR_DECLARE(apr_status_t) apr_sms_tracking_create(apr_sms_t **sms, - apr_sms_t *pms) -{ - apr_sms_t *new_sms; - apr_status_t rv; - - *sms = NULL; - /* We're not a top level module, ie we have a parent, so - * we allocate the memory for the structure from our parent. - * This is safe as we shouldn't outlive our parent... - */ - new_sms = apr_sms_calloc(pms, SIZEOF_SMS_TRACKING_T); - - if (!new_sms) - return APR_ENOMEM; - - if ((rv = apr_sms_init(new_sms, pms)) != APR_SUCCESS) - return rv; - - new_sms->malloc_fn = apr_sms_tracking_malloc; - new_sms->calloc_fn = apr_sms_tracking_calloc; - new_sms->realloc_fn = apr_sms_tracking_realloc; - new_sms->free_fn = apr_sms_tracking_free; - new_sms->reset_fn = apr_sms_tracking_reset; - new_sms->pre_destroy_fn = apr_sms_tracking_pre_destroy; - new_sms->destroy_fn = apr_sms_tracking_destroy; -#if APR_HAS_THREADS - new_sms->thread_register_fn = apr_sms_tracking_thread_register; - new_sms->thread_unregister_fn = apr_sms_tracking_thread_unregister; -#endif /* APR_HAS_THREADS */ - new_sms->identity = module_identity; - - apr_sms_post_init(new_sms); - - *sms = new_sms; - return APR_SUCCESS; -} diff --git a/memory/unix/apr_sms_trivial.c b/memory/unix/apr_sms_trivial.c deleted file mode 100644 index 800b219f7d2..00000000000 --- a/memory/unix/apr_sms_trivial.c +++ /dev/null @@ -1,531 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr.h" -#include "apr_general.h" -#include "apr_private.h" -#include "apr_sms.h" -#include "apr_sms_trivial.h" -#include "apr_lock.h" -#define APR_WANT_MEMFUNC -#include "apr_want.h" -#include "sms_private.h" -#include - -static const char *module_identity = "TRIVIAL"; - -/* - * Simple trivial memory system - * - * The goal of this SMS is to make malloc and reset operations as efficient - * as possible. - */ - -/* INTERNALLY USED STRUCTURES */ - -typedef struct block_t -{ - struct node_t *node; -} block_t; - -typedef struct node_t -{ - struct node_t *next; - struct node_t *prev; - char *first_avail; - apr_size_t avail_size; - apr_uint32_t count; -} node_t; - -typedef struct apr_sms_trivial_t -{ - apr_sms_t sms_hdr; - node_t used_sentinel; - node_t free_sentinel; - node_t *self; - apr_size_t min_alloc; - apr_size_t min_free; - apr_size_t max_free; -} apr_sms_trivial_t; - -#define SIZEOF_BLOCK_T APR_ALIGN_DEFAULT(sizeof(block_t)) -#define SIZEOF_NODE_T APR_ALIGN_DEFAULT(sizeof(node_t)) -#define SIZEOF_SMS_TRIVIAL_T APR_ALIGN_DEFAULT(sizeof(apr_sms_trivial_t)) - -#define BLOCK_T(mem) ((block_t *)(mem)) -#define NODE_T(mem) ((node_t *)(mem)) -#define SMS_TRIVIAL_T(sms) ((apr_sms_trivial_t *)(sms)) - -/* Magic numbers :) - * MIN_ALLOC defines the floor of how many bytes we will ask our parent for - * MIN_FREE defines how many extra bytes we will allocate when asking the - * the system for memory. - * MAX_FREE defines how many bytes the SMS may hold at one time. If it - * exceeds this value, it will return memory to the parent SMS. - * (note that this implementation counts down to 0) - */ -#define MIN_ALLOC 0x2000 -#define MIN_FREE 0x1000 -#define MAX_FREE 0x80000 - -static void *apr_sms_trivial_malloc(apr_sms_t *sms, - apr_size_t size) -{ - node_t *node, *sentinel; - apr_size_t node_size; - void *mem; - - /* Round up the size to the next 8 byte boundary */ - size = APR_ALIGN_DEFAULT(size) + SIZEOF_BLOCK_T; - - if (sms->sms_lock) - apr_lock_acquire(sms->sms_lock); - - node = SMS_TRIVIAL_T(sms)->used_sentinel.prev; - - if (node->avail_size >= size) { - mem = node->first_avail; - node->avail_size -= size; - node->first_avail += size; - node->count++; - - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - BLOCK_T(mem)->node = node; - mem = (char *)mem + SIZEOF_BLOCK_T; - - return mem; - } - - /* reset the 'last' block, it will be replaced soon */ - node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - - /* browse the free list for a useable block. Note that we set the - * sentinel to be the size we are looking for - so, we'll have to - * stop when we hit the sentinel again. - */ - sentinel = &SMS_TRIVIAL_T(sms)->free_sentinel; - sentinel->avail_size = size; - - node = sentinel->next; - while (node->avail_size < size) - node = node->next; - - if (node != sentinel) { - /* Remove from chain of free nodes and add it to used chain */ - node->prev->next = node->next; - node->next->prev = node->prev; - - sentinel = &SMS_TRIVIAL_T(sms)->used_sentinel; - node->prev = sentinel->prev; - node->prev->next = node; - node->next = sentinel; - sentinel->prev = node; - - /* We are no longer free, so increase available free mem. */ - if (node != SMS_TRIVIAL_T(sms)->self) - SMS_TRIVIAL_T(sms)->max_free += node->avail_size; - - mem = node->first_avail; - node->avail_size -= size; - node->first_avail += size; - node->count = 1; - - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - BLOCK_T(mem)->node = node; - mem = (char *)mem + SIZEOF_BLOCK_T; - - return mem; - } - - /* We couldn't find any used or free node that had enough space, - * so we have to allocate a new block from our parent. - */ - node_size = size + SMS_TRIVIAL_T(sms)->min_free; - if (node_size < SMS_TRIVIAL_T(sms)->min_alloc) - node_size = SMS_TRIVIAL_T(sms)->min_alloc; - - node = apr_sms_malloc(sms->parent, node_size); - if (!node) { - /* restore the 'last' node, so next allocation will not segfault */ - node = SMS_TRIVIAL_T(sms)->used_sentinel.prev; - node->first_avail += node->avail_size; - node->avail_size = 0; - - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - return NULL; - } - - /* Add the new node to the used chain. */ - sentinel = &SMS_TRIVIAL_T(sms)->used_sentinel; - node->prev = sentinel->prev; - node->prev->next = node; - node->next = sentinel; - sentinel->prev = node; - - mem = node->first_avail = (char *)node + SIZEOF_NODE_T; - node->first_avail += size; - node->avail_size = node_size - (node->first_avail - (char *)node); - node->count = 1; - - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - BLOCK_T(mem)->node = node; - mem = (char *)mem + SIZEOF_BLOCK_T; - - return mem; -} - -static apr_status_t apr_sms_trivial_free(apr_sms_t *sms, void *mem) -{ - node_t *node, *sentinel; - - node = BLOCK_T((char *)mem - SIZEOF_BLOCK_T)->node; - - if (sms->sms_lock) - apr_lock_acquire(sms->sms_lock); - - node->count--; - - if (node->count) { - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - return APR_SUCCESS; - } - - node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - - if (SMS_TRIVIAL_T(sms)->used_sentinel.prev != node) { - node->next->prev = node->prev; - node->prev->next = node->next; - - if (sms->parent->free_fn && - node->avail_size > SMS_TRIVIAL_T(sms)->max_free && - node != SMS_TRIVIAL_T(sms)->self) { - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - return apr_sms_free(sms->parent, node); - } - - sentinel = &SMS_TRIVIAL_T(sms)->free_sentinel; - node->prev = sentinel->prev; - node->prev->next = node; - node->next = sentinel; - sentinel->prev = node; - - if (node != SMS_TRIVIAL_T(sms)->self) - SMS_TRIVIAL_T(sms)->max_free -= node->avail_size; - } - - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - return APR_SUCCESS; -} - -static void *apr_sms_trivial_realloc(apr_sms_t *sms, void *mem, apr_size_t reqsize) -{ - void *new_mem; - apr_size_t size; - node_t *node; - char *endp; - - reqsize = APR_ALIGN_DEFAULT(reqsize); - - new_mem = apr_sms_trivial_malloc(sms, reqsize); - - if (new_mem) { - node = BLOCK_T((char *)mem - SIZEOF_BLOCK_T)->node; - - endp = node->first_avail; - if (endp == (char *)node + SIZEOF_NODE_T) - endp += node->avail_size; - - size = endp - (char *)mem; - if (size > reqsize) - size = reqsize; - - memcpy(new_mem, mem, size); - } - - apr_sms_trivial_free(sms, mem); - - return new_mem; -} - -static apr_status_t apr_sms_trivial_reset(apr_sms_t *sms) -{ - node_t *node, *prev, *used_sentinel, *free_sentinel, *free_list; - apr_size_t min_alloc, max_free; - - used_sentinel = &SMS_TRIVIAL_T(sms)->used_sentinel; - free_sentinel = &SMS_TRIVIAL_T(sms)->free_sentinel; - - free_list = NULL; - - if (sms->sms_lock) - apr_lock_acquire(sms->sms_lock); - - /* Always reset our base node as this can't be reclaimed. */ - node = SMS_TRIVIAL_T(sms)->self; - node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - node->count = 0; - node->prev->next = node->next; - node->next->prev = node->prev; - - /* used_sentinel->prev may be currently "active", so disable it. */ - node = used_sentinel->prev; - node->avail_size += node->first_avail - ((char *)node + SIZEOF_NODE_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - - if (sms->parent->free_fn) { - /* We only reserve max_free bytes. The rest will be passed to the - * parent SMS to be freed. - */ - min_alloc = SMS_TRIVIAL_T(sms)->min_alloc; - max_free = SMS_TRIVIAL_T(sms)->max_free; - - used_sentinel->avail_size = min_alloc; - - while (max_free > min_alloc) { - if (node->avail_size <= max_free) { - if (node == used_sentinel) - break; - /* These are the nodes that will NOT be freed, but - * placed on the free list for later reuse. - */ - max_free -= node->avail_size; - - node->prev->next = node->next; - node->next->prev = node->prev; - - prev = node->prev; - - node->next = free_sentinel->next; - free_sentinel->next = node; - node->next->prev = node; - node->prev = free_sentinel; - - node = prev; - } - else - node = node->prev; /* Will be reclaimed. */ - } - - /* Remember that when sms->max_free hits zero, we free everything. */ - SMS_TRIVIAL_T(sms)->max_free = max_free; - - /* Anything remaining on the used_sentinel list will be freed. */ - used_sentinel->prev->next = NULL; - free_list = used_sentinel->next; - } - else { - /* Everything we have allocated goes into free_sentinel. */ - node = used_sentinel->prev; - node->next = free_sentinel->next; - node->next->prev = node; - - node = used_sentinel->next; - node->prev = free_sentinel; - free_sentinel->next = node; - } - - /* Reset used_sentinel to just be the originally allocated node. */ - node = SMS_TRIVIAL_T(sms)->self; - node->next = node->prev = used_sentinel; - used_sentinel->next = used_sentinel->prev = node; - - if (sms->sms_lock) - apr_lock_release(sms->sms_lock); - - while ((node = free_list) != NULL) { - free_list = node->next; - apr_sms_free(sms->parent, node); - } - - return APR_SUCCESS; -} - -static apr_status_t apr_sms_trivial_pre_destroy(apr_sms_t *sms) -{ - /* This function WILL always be called. However, be aware that the - * main sms destroy function knows that it's not wise to try and destroy - * the same piece of memory twice, so the destroy function in a child won't - * neccesarily be called. - */ - - return APR_SUCCESS; -} - -static apr_status_t apr_sms_trivial_destroy(apr_sms_t *sms) -{ - apr_sms_trivial_t *tms; - node_t *node, *next; - - tms = SMS_TRIVIAL_T(sms); - node = tms->self; - node->next->prev = node->prev; - node->prev->next = node->next; - - tms->free_sentinel.prev->next = NULL; - tms->used_sentinel.prev->next = tms->free_sentinel.next; - - node = tms->used_sentinel.next; - while (node) { - next = node->next; - - apr_sms_free(sms->parent, node); - node = next; - } - - apr_sms_free(sms->parent, sms); - - return APR_SUCCESS; -} - -#if APR_HAS_THREADS -static apr_status_t apr_sms_trivial_thread_register(apr_sms_t *sms, - apr_os_thread_t thread) -{ - return APR_SUCCESS; -} - -static apr_status_t apr_sms_trivial_thread_unregister(apr_sms_t *sms, - apr_os_thread_t thread) -{ - return APR_SUCCESS; -} -#endif /* APR_HAS_THREADS */ - -APR_DECLARE(apr_status_t) apr_sms_trivial_create_ex(apr_sms_t **sms, - apr_sms_t *pms, - apr_size_t min_alloc, - apr_size_t min_free, - apr_size_t max_free) -{ - apr_sms_t *new_sms; - apr_sms_trivial_t *tms; - node_t *node; - apr_status_t rv; - - *sms = NULL; - - min_alloc = APR_ALIGN_DEFAULT(min_alloc); - min_free = APR_ALIGN_DEFAULT(min_free); - if (min_free < SIZEOF_NODE_T) - min_free = SIZEOF_NODE_T; - - /* We're not a top level module, ie we have a parent, so - * we allocate the memory for the structure from our parent. - * This is safe as we shouldn't outlive our parent... - */ - - new_sms = apr_sms_calloc(pms, min_alloc); - if (!new_sms) - return APR_ENOMEM; - - if ((rv = apr_sms_init(new_sms, pms)) != APR_SUCCESS) - return rv; - - new_sms->malloc_fn = apr_sms_trivial_malloc; - new_sms->realloc_fn = apr_sms_trivial_realloc; - new_sms->free_fn = apr_sms_trivial_free; - new_sms->reset_fn = apr_sms_trivial_reset; - new_sms->pre_destroy_fn = apr_sms_trivial_pre_destroy; - new_sms->destroy_fn = apr_sms_trivial_destroy; -#if APR_HAS_THREADS - new_sms->thread_register_fn = apr_sms_trivial_thread_register; - new_sms->thread_unregister_fn = apr_sms_trivial_thread_unregister; -#endif /* APR_HAS_THREADS */ - new_sms->identity = module_identity; - - node = NODE_T((char *)new_sms + SIZEOF_SMS_TRIVIAL_T); - node->first_avail = (char *)node + SIZEOF_NODE_T; - node->avail_size = min_alloc - SIZEOF_SMS_TRIVIAL_T - SIZEOF_NODE_T; - node->count = 0; - - tms = SMS_TRIVIAL_T(new_sms); - tms->min_alloc = min_alloc; - tms->min_free = min_free; - tms->max_free = max_free; - tms->self = node; - - node->next = node->prev = &tms->used_sentinel; - tms->used_sentinel.next = tms->used_sentinel.prev = node; - tms->free_sentinel.next = tms->free_sentinel.prev = &tms->free_sentinel; - - apr_sms_post_init(new_sms); - - *sms = new_sms; - return APR_SUCCESS; -} - - -APR_DECLARE(apr_status_t) apr_sms_trivial_create(apr_sms_t **sms, - apr_sms_t *pms) -{ - return apr_sms_trivial_create_ex(sms, pms, MIN_ALLOC, MIN_FREE, MAX_FREE); -} - diff --git a/memory/unix/sms_private.h b/memory/unix/sms_private.h deleted file mode 100644 index 6542aec7dcb..00000000000 --- a/memory/unix/sms_private.h +++ /dev/null @@ -1,159 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ -/** - * @file sms_private.h - * @brief SMS private definitions/routines - * @internal - */ -/** - * - * @defgroup APR_SMS_Private Private routines - * @ingroup APR_SMS - * @{ - */ -#ifndef SMS_PRIVATE_H -#define SMS_PRIVATE_H - -#include "apr.h" -#include "apr_errno.h" -#include "apr_pools.h" -#include "apr_lock.h" -#include "apr_portable.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @struct apr_sms_t - * @brief The SMS memory system structure - */ - -struct apr_sms_t -{ - apr_sms_t *parent; /**< parent of the current SMS */ - apr_sms_t *child; /**< children of the current SMS */ - apr_sms_t *sibling; /**< next SMS at the same level */ - apr_sms_t **ref; /**< a pointer to the pointer pointing to memory */ - apr_sms_t *accounting; /**< SMS for accounting type tasks */ - const char *identity; /**< a string identifying the module */ - - apr_pool_t *pool; /**< pool to associate with this SMS */ - apr_lock_t *sms_lock; /**< lock to use when allocated memory in this SMS */ - - struct apr_sms_cleanup *cleanups; /**< stuff to call when the SMS is being freed */ - - void * (*malloc_fn) (apr_sms_t *sms, apr_size_t size); /**< malloc fn for this SMS */ - void * (*calloc_fn) (apr_sms_t *sms, apr_size_t size); /**< calloc fn for this SMS */ - void * (*realloc_fn) (apr_sms_t *sms, void *memory, - apr_size_t size); /**< realloc fn for this SMS */ - apr_status_t (*free_fn) (apr_sms_t *sms, void *memory); /**< free fn */ - apr_status_t (*reset_fn) (apr_sms_t *sms); /**< reset fn */ - apr_status_t (*pre_destroy_fn) (apr_sms_t *sms); /**< called before destroying memory */ - apr_status_t (*destroy_fn) (apr_sms_t *sms); /**< function to destory -the SMS */ - apr_status_t (*lock_fn) (apr_sms_t *sms); /**< locking function */ - apr_status_t (*unlock_fn) (apr_sms_t *sms); /**< unlocking function */ - - apr_status_t (*apr_abort)(int retcode); /**< function to call when a malloc fails */ - struct apr_hash_t *prog_data; /**< has to store userdata */ - -#ifdef APR_POOLS_ARE_SMS - struct process_chain *subprocesses; -#endif - -#if APR_HAS_THREADS - apr_status_t (*thread_register_fn) (apr_sms_t *sms, - apr_os_thread_t thread); - apr_status_t (*thread_unregister_fn) (apr_sms_t *sms, - apr_os_thread_t thread); - apr_uint16_t threads; -#endif /* APR_HAS_THREADS */ - -#if APR_DEBUG_TAG_SMS - const char *tag; -#endif -}; - -/* - * private memory system functions - */ - -/** - * Initialize a memory system - * @warning Call this function as soon as you have obtained a block of memory - * to serve as a memory system structure from your - * apr_xxx_sms_create. Only use this function when you are - * implementing a memory system. - * @param sms The memory system created - * @param parent_sms The parent memory system - */ -APR_DECLARE(apr_status_t) apr_sms_init(apr_sms_t *sms, - apr_sms_t *parent_sms); - -/** - * Do post init work that needs the sms to have been fully - * initialised. - * @param sms The memory system to use - * @return apr_status_t - */ -APR_DECLARE(apr_status_t) apr_sms_post_init(apr_sms_t *sms); - - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif /* !SMS_PRIVATE_H */ - diff --git a/misc/netware/aprlib.imp b/misc/netware/aprlib.imp index 2f7fe619e86..6bbe7e43214 100644 --- a/misc/netware/aprlib.imp +++ b/misc/netware/aprlib.imp @@ -227,39 +227,6 @@ apr_signal_get_description, #apr_signal_thread, apr_sleep, - #apr_sms_assert, - apr_sms_blocks_create, - apr_sms_calloc, - apr_sms_cleanup_register, - apr_sms_cleanup_run, - apr_sms_cleanup_run_type, - apr_sms_cleanup_unregister, - apr_sms_cleanup_unregister_type, - apr_sms_destroy, - #apr_sms_dump_stats, - apr_sms_free, - apr_sms_get_abort, - apr_sms_get_identity, - apr_sms_get_parent, - apr_sms_is_ancestor, - apr_sms_lock, - apr_sms_malloc, - apr_sms_realloc, - apr_sms_reset, - apr_sms_set_abort, - #apr_sms_show_structure, - apr_sms_std_create, - #apr_sms_tag, - apr_sms_thread_register, - apr_sms_thread_unregister, - apr_sms_threads_create, - apr_sms_threads_create_ex, - apr_sms_tracking_create, - apr_sms_trivial_create, - apr_sms_trivial_create_ex, - apr_sms_unlock, - apr_sms_userdata_get, - apr_sms_userdata_set, apr_snprintf, apr_sockaddr_info_get, apr_sockaddr_ip_get, diff --git a/test/testmem.c b/test/testmem.c index 38e55be7d08..a2af1dae5aa 100644 --- a/test/testmem.c +++ b/test/testmem.c @@ -52,10 +52,6 @@ * . */ -#include "apr_sms.h" -#include "apr_sms_tracking.h" -#include "apr_sms_trivial.h" -#include "apr_sms_blocks.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" @@ -86,21 +82,9 @@ typedef struct _test_ { apr_time_t howlong; } _test_; -#define T_QTY 5 /* how many tests do we have?? */ +#define T_QTY 1 /* how many tests do we have?? */ static _test_ t[T_QTY]; -static void its_an_sms(apr_sms_t *ams, _test_ *t, char *name, int lt) -{ - t->malloc_fn = (void*)apr_sms_malloc; - t->calloc_fn = (void*)apr_sms_calloc; - t->free_fn = (void*)apr_sms_free; - t->reset_fn = (void*)apr_sms_reset; - t->memory = ams; - t->title = name; - t->large_tests = lt; - t->howlong = 0; -} - static void its_a_pool(apr_pool_t *pool, _test_ *t, char *name, int lt) { t->malloc_fn = (void*)apr_palloc; @@ -422,12 +406,11 @@ static int timed_test_64byte(_test_ *t, int small, int verbose) static void print_timed_results(void) { int i; - printf(" Percentage Results averages %% of pools %% of std sms\n"); + printf(" Percentage Results averages %% of pools\n"); for (i=0;i < T_QTY; i++) { float pa = (float)t[i].howlong / (float)t[0].howlong; - float pb = (float)t[i].howlong / (float)t[1].howlong; - printf(" %-20s %-8lld %7.02f %% %7.02f %%\n", t[i].title, t[i].howlong, - pa * 100, pb * 100); + printf(" %-20s %-8lld %7.02f %%\n", t[i].title, t[i].howlong, + pa * 100); } printf("\n"); for (i=0;i Date: Fri, 28 Sep 2001 15:22:35 +0000 Subject: [PATCH 2383/7878] Introduce apr_pool_lock for debugging, in combination with ALLOC_USE_MALLOC + DEBUG_WITH_MPROTECT. Only implemented on Win32 today, very effective for debugging pool constness. Fixed a double-reservation for the union block_hdr size in the unix mprotect_alloc mmap() call. I suspect the mmap can be modified to implement this on Unix, move the #define DO_LOCK() out of the win32 block if this is implemented. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62382 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++ include/apr_pools.h | 10 +++++ memory/unix/apr_pools.c | 85 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 99 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 72ddee38f3d..213dea7a52c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Introduce apr_pool_lock for debugging, in combination with + ALLOC_USE_MALLOC + DEBUG_WITH_MPROTECT. Only implemented + on Win32 today, very effective for debugging pool constness. + [William Rowe] + *) Optimize apr_pstrcat by caching lengths of first 6 strings [Brian Pane ] diff --git a/include/apr_pools.h b/include/apr_pools.h index 13a340c9477..d2075245c40 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -290,6 +290,16 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *cont); +/** + * Lock the pool. All the memory is write protected against changes. + * @param p The pool to lock + * @param writeprotect If true the pool's memory is locked read-only, + * otherwise the lock is released + * @remark This is a no-op if the program isn't built with appropriate flags + * on a platform that supports page locking. + */ +APR_DECLARE(void) apr_pool_lock(apr_pool_t *p, int writeprotect); + /** * Clear all memory in the pool and run all the cleanups. This also clears all * subpools. diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 9483e7a2a0e..4147ebdb6ef 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -168,8 +168,10 @@ #ifndef ALLOC_USE_MALLOC #error "ALLOC_USE_MALLOC must be enabled to use DEBUG_WITH_MPROTECT" #endif +#ifndef WIN32 #include #endif +#endif /** The memory allocation structure @@ -294,12 +296,15 @@ static APR_INLINE void debug_verify_filled(const char *ptr, const char *endp, #define SIZEOF_BLOCK(p) (((union block_hdr *)(p) - 1)->a.l) +#ifndef WIN32 + static void *mprotect_malloc(apr_size_t size) { union block_hdr * addr; size += sizeof(union block_hdr); - addr = mmap(NULL, size + sizeof(union block_hdr), + + addr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (addr == MAP_FAILED) @@ -318,6 +323,64 @@ static void mprotect_free(void *addr) } } +#else /* WIN32 */ + +/* return the number insignificant bits in size, e.g. the typical page + * size of 4096 on x86/WinNT will return 12, as the 12 low-order bits + * in the size aren't relevant to the number of pages. + */ +static int mprotect_pageshift() +{ + static int savesize = 0; + if (!savesize) { + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + --sysinfo.dwPageSize; + while (sysinfo.dwPageSize) { + ++savesize; + sysinfo.dwPageSize >>= 1; + } + } + return savesize; +} + +static void *mprotect_malloc(apr_size_t size) +{ + union block_hdr * addr; + int pageshift = mprotect_pageshift(); + size += sizeof(union block_hdr); + size = (((size - 1) >> pageshift) + 1) << pageshift; + addr = VirtualAlloc(NULL, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + if (!addr) + return NULL; + addr->a.l = size; + return addr + 1; +} + +static void mprotect_free(void *addr) +{ + apr_size_t size = SIZEOF_BLOCK(addr); + BOOL rv = VirtualFree((union block_hdr *)addr - 1, size, MEM_DECOMMIT); + if (!rv) { + fprintf(stderr, "could not protect. errno=%d\n", errno); + abort(); + } +} + +static void mprotect_lock(void *addr, int lock) +{ + size_t size = SIZEOF_BLOCK(addr); + DWORD prot = (lock ? PAGE_READONLY : PAGE_READWRITE); + BOOL rv = VirtualProtect((union block_hdr *)addr - 1, size, prot, &prot); + if (!rv) { + fprintf(stderr, "could not protect. errno=%d\n", errno); + abort(); + } +} + +#define DO_LOCK(p,l) mprotect_lock(p,l) +#endif + static void *mprotect_realloc(void *addr, apr_size_t size) { void *new_addr = mprotect_malloc(size); @@ -848,6 +911,26 @@ APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp) apr_pool_destroy(globalp); } +APR_DECLARE(void) apr_pool_lock(apr_pool_t *a, int l) +{ +#ifdef ALLOC_USE_MALLOC +#ifdef DO_LOCK + /* lock the subpools. */ + apr_pool_t *s; + void *c, *n; + + for (s = a->sub_pools; s; s = s->sub_next) { + apr_pool_lock(s, l); + } + + for (c = a->allocation_list; c; c = n) { + n = *(void **)c; + DO_LOCK(c, l); + } +#endif +#endif +} + /* We only want to lock the mutex if we are being called from apr_pool_clear. * This is because if we also call this function from apr_destroy_real_pool, * which also locks the same mutex, and recursive locks aren't portable. From 99bc035471a82e474001cb52a2b97089ef248efd Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 29 Sep 2001 05:03:37 +0000 Subject: [PATCH 2384/7878] Implement pool accessor functions for proc mutex's Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62383 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_proc_mutex.h | 6 ++++++ locks/beos/proc_mutex.c | 2 ++ locks/netware/proc_mutex.c | 2 ++ locks/os2/proc_mutex.c | 2 ++ locks/unix/proc_mutex.c | 2 ++ locks/win32/proc_mutex.c | 2 ++ 6 files changed, 16 insertions(+) diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index 8f4471d7f1d..5779c94b3df 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -161,6 +161,12 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex); */ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex); +/** + * Get the pool used by this proc_mutex. + * @return apr_pool_t the pool + */ +APR_POOL_DECLARE_ACCESSOR(proc_mutex); + #ifdef __cplusplus } #endif diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index 3bff70b742f..32ac2ee7f37 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -102,3 +102,5 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return APR_ENOTIMPL; } +APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) + diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 9cff0f72fcd..1d1143d529a 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -101,3 +101,5 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return APR_ENOTIMPL; } +APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) + diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index d8a81e29dec..0811d374603 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -104,3 +104,5 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return APR_ENOTIMPL; } +APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) + diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 125a9b26f86..80d9c664fc9 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -808,3 +808,5 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return mutex->meth->destroy(mutex); } +APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) + diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index fa99d67c211..3d8e2f20c1a 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -101,3 +101,5 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return APR_ENOTIMPL; } +APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) + From b07c89c4fe278b7cf4bb77621e5569cc5665276e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 29 Sep 2001 05:04:44 +0000 Subject: [PATCH 2385/7878] Implement pool accessor for rwlocks. Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62384 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_rwlock.h | 6 ++++++ locks/beos/thread_rwlock.c | 2 ++ locks/netware/thread_rwlock.c | 2 ++ locks/os2/thread_rwlock.c | 3 +++ locks/unix/thread_rwlock.c | 2 ++ locks/win32/thread_rwlock.c | 2 ++ 6 files changed, 17 insertions(+) diff --git a/include/apr_thread_rwlock.h b/include/apr_thread_rwlock.h index 176b9421b74..ff2ae6ac72e 100644 --- a/include/apr_thread_rwlock.h +++ b/include/apr_thread_rwlock.h @@ -140,6 +140,12 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock); */ APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock); +/** + * Get the pool used by this thread_rwlock. + * @return apr_pool_t the pool + */ +APR_POOL_DECLARE_ACCESSOR(thread_rwlock); + #endif /* APR_HAS_THREADS */ #ifdef __cplusplus diff --git a/locks/beos/thread_rwlock.c b/locks/beos/thread_rwlock.c index 98595e67f0d..59a93d0a781 100644 --- a/locks/beos/thread_rwlock.c +++ b/locks/beos/thread_rwlock.c @@ -96,3 +96,5 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) return APR_ENOTIMPL; } +APR_POOL_IMPLEMENT_ACCESSOR(thread_rwlock) + diff --git a/locks/netware/thread_rwlock.c b/locks/netware/thread_rwlock.c index ba10eaf45ab..04cf3d218b7 100644 --- a/locks/netware/thread_rwlock.c +++ b/locks/netware/thread_rwlock.c @@ -95,3 +95,5 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) return APR_ENOTIMPL; } +APR_POOL_IMPLEMENT_ACCESSOR(thread_rwlock) + diff --git a/locks/os2/thread_rwlock.c b/locks/os2/thread_rwlock.c index 59cc5639aee..1cc97032c85 100644 --- a/locks/os2/thread_rwlock.c +++ b/locks/os2/thread_rwlock.c @@ -233,3 +233,6 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) return APR_FROM_OS_ERROR(rc); } + +APR_POOL_IMPLEMENT_ACCESSOR(thread_rwlock) + diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c index dc9377beb0f..26adf08edfd 100644 --- a/locks/unix/thread_rwlock.c +++ b/locks/unix/thread_rwlock.c @@ -235,6 +235,8 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) return APR_ENOTIMPL; } +APR_POOL_IMPLEMENT_ACCESSOR(thread_rwlock) + #endif /* HAVE_PTHREAD_RWLOCK_INIT */ #endif /* APR_HAS_THREADS */ diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c index 3c772553f95..67708c85a2f 100644 --- a/locks/win32/thread_rwlock.c +++ b/locks/win32/thread_rwlock.c @@ -130,3 +130,5 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) return apr_pool_cleanup_run(rwlock->pool, rwlock, thread_rwlock_cleanup); } +APR_POOL_IMPLEMENT_ACCESSOR(thread_rwlock) + From 13ef8fd04d4284147625118f78422b11945c1c50 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 29 Sep 2001 05:05:41 +0000 Subject: [PATCH 2386/7878] Implement pool accessors for thread_condition variables. Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62385 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_cond.h | 6 ++++++ locks/beos/thread_cond.c | 3 +++ locks/netware/thread_cond.c | 3 +++ locks/os2/thread_cond.c | 3 +++ locks/unix/thread_cond.c | 1 + locks/win32/thread_cond.c | 3 +++ 6 files changed, 19 insertions(+) diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h index 6d482284655..65b6f8debcf 100644 --- a/include/apr_thread_cond.h +++ b/include/apr_thread_cond.h @@ -130,6 +130,12 @@ APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond); */ APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond); +/** + * Get the pool used by this thread_cond. + * @return apr_pool_t the pool + */ +APR_POOL_DECLARE_ACCESSOR(thread_cond); + #endif /* APR_HAS_THREADS */ #ifdef __cplusplus diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c index e43e8b87696..0d1de6cd7f4 100644 --- a/locks/beos/thread_cond.c +++ b/locks/beos/thread_cond.c @@ -88,3 +88,6 @@ APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) { return APR_ENOTIMPL; } + +APR_POOL_IMPLEMENT_ACCESSOR(thread_cond) + diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c index 896543b3fa4..ab704ca5762 100644 --- a/locks/netware/thread_cond.c +++ b/locks/netware/thread_cond.c @@ -86,3 +86,6 @@ APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) { return APR_ENOTIMPL; } + +APR_POOL_IMPLEMENT_ACCESSOR(thread_cond) + diff --git a/locks/os2/thread_cond.c b/locks/os2/thread_cond.c index eaf10f18c20..94d91e941ce 100644 --- a/locks/os2/thread_cond.c +++ b/locks/os2/thread_cond.c @@ -87,3 +87,6 @@ APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) { return APR_ENOTIMPL; } + +APR_POOL_IMPLEMENT_ACCESSOR(thread_cond) + diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c index c8bb267637a..3c7ad6fa744 100644 --- a/locks/unix/thread_cond.c +++ b/locks/unix/thread_cond.c @@ -160,5 +160,6 @@ APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) return stat; } +APR_POOL_IMPLEMENT_ACCESSOR(thread_cond) #endif /* APR_HAS_THREADS */ diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index d2e45e8df09..032c28da0d7 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -146,3 +146,6 @@ APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) { return apr_pool_cleanup_run(cond->pool, cond, thread_cond_cleanup); } + +APR_POOL_IMPLEMENT_ACCESSOR(thread_cond) + From 0be689128c8bd08264312565d0bda88f681aedb6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 29 Sep 2001 14:14:07 +0000 Subject: [PATCH 2387/7878] Make sure we declare the pool accessor for both kinds of rwlocks git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62386 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_rwlock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c index 26adf08edfd..8a11aba9323 100644 --- a/locks/unix/thread_rwlock.c +++ b/locks/unix/thread_rwlock.c @@ -235,8 +235,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) return APR_ENOTIMPL; } -APR_POOL_IMPLEMENT_ACCESSOR(thread_rwlock) - #endif /* HAVE_PTHREAD_RWLOCK_INIT */ +APR_POOL_IMPLEMENT_ACCESSOR(thread_rwlock) #endif /* APR_HAS_THREADS */ From 5673006bbaeed7e112ded7923efd9aa22adfe06f Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 29 Sep 2001 14:15:21 +0000 Subject: [PATCH 2388/7878] This structure needs a pool, or the pool accessors will fail PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62387 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/thread_rwlock.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/arch/unix/thread_rwlock.h b/include/arch/unix/thread_rwlock.h index 18a042a9b16..8e057322784 100644 --- a/include/arch/unix/thread_rwlock.h +++ b/include/arch/unix/thread_rwlock.h @@ -77,6 +77,7 @@ struct apr_thread_rwlock_t { #else struct apr_thread_rwlock_t { + apr_pool_t *pool; }; #endif From fee667b432c9a1e523691b76484bc9bebd5d7863 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 30 Sep 2001 08:13:51 +0000 Subject: [PATCH 2389/7878] Add unix mktemp to OS/2 build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62388 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/Makefile.in | 3 ++- file_io/os2/mktemp.c | 1 + file_io/unix/mktemp.c | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 file_io/os2/mktemp.c diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index 6757e7fd935..3bb85faeca5 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -12,7 +12,8 @@ TARGETS = \ maperrorcode.lo \ fullrw.lo \ filepath.lo \ - filesys.lo + filesys.lo \ + mktemp.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/file_io/os2/mktemp.c b/file_io/os2/mktemp.c new file mode 100644 index 00000000000..9e8523607f1 --- /dev/null +++ b/file_io/os2/mktemp.c @@ -0,0 +1 @@ +#include "../unix/mktemp.c" diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 906d0a982df..fac3cb4b664 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -200,6 +200,9 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_p #ifdef WIN32 apr_pool_cleanup_register((*fp)->cntxt, (void *)(*fp), file_cleanup, file_cleanup); +#elif defined(OS2) + apr_pool_cleanup_register((*fp)->cntxt, (void *)(*fp), + apr_file_cleanup, apr_file_cleanup); #else apr_pool_cleanup_register((*fp)->cntxt, (void *)(*fp), apr_unix_file_cleanup, apr_unix_file_cleanup); From e3a42e50f85c8a3f72364fc03ebc2840b0bd7299 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 1 Oct 2001 18:46:40 +0000 Subject: [PATCH 2390/7878] Fix a potential segfault on Unix when apr_file_close() is called and the file_cleanup fails. Previously in that situation the cleanup would not be deregistered and therefore it would get run again when the pool went away. Similar behavior in the directory cleanup logic caused segfaults at some point in the past. Reviewed by: Ryan Bloom, Bill Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62389 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ file_io/unix/open.c | 9 ++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 213dea7a52c..8f044d304bd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Fix potential segfault when closing a file on Unix. If + apr_file_close() was called and it failed, it would not + deregister the file cleanup. Therefore the cleanup would + be run again later on a now-invalid descriptor. [Cliff Woolley] + *) Introduce apr_pool_lock for debugging, in combination with ALLOC_USE_MALLOC + DEBUG_WITH_MPROTECT. Only implemented on Win32 today, very effective for debugging pool constness. diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 6fee1a7b902..1ecb363f074 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -174,13 +174,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) { - apr_status_t rv; - - if ((rv = apr_unix_file_cleanup(file)) == APR_SUCCESS) { - apr_pool_cleanup_kill(file->cntxt, file, apr_unix_file_cleanup); - return APR_SUCCESS; - } - return rv; + apr_pool_cleanup_kill(file->cntxt, file, apr_unix_file_cleanup); + return apr_unix_file_cleanup(file); } APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) From 31d4cd7bc3e9edf376f883a28c8b0c42fecbc01e Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 1 Oct 2001 19:12:49 +0000 Subject: [PATCH 2391/7878] Even though it's not unusual for temporary files to be unlinked as soon as they're open on Unix, it makes the use of those files harder in some cases. For example, the filename we were getting back from apr_file_mktemp() was useless because the file had already been unlinked. Now we defer the unlink until the file is actually closed. This also makes the behavior on Unix somewhat more consistent with other platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62390 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ file_io/unix/mktemp.c | 1 - file_io/unix/open.c | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 8f044d304bd..5f920a31ab3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Files opened on Unix with the flag APR_DELONCLOSE are now + not unlinked until they are actually closed, rather than as + soon as they're opened. The old approach worked but made + handling temp files harder. [Cliff Woolley] + *) Fix potential segfault when closing a file on Unix. If apr_file_close() was called and it failed, it would not deregister the file cleanup. Therefore the cleanup would diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index fac3cb4b664..447d97965c4 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -196,7 +196,6 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_p (*fp)->filedes = fd; #endif - apr_file_remove((*fp)->fname, p); #ifdef WIN32 apr_pool_cleanup_register((*fp)->cntxt, (void *)(*fp), file_cleanup, file_cleanup); diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 1ecb363f074..f61e2bf473a 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -69,6 +69,9 @@ apr_status_t apr_unix_file_cleanup(void *thefile) rc = close(file->filedes); if (rc == 0) { file->filedes = -1; + if (file->flags & APR_DELONCLOSE) { + unlink(file->fname); + } #if APR_HAS_THREADS if (file->thlock) { rv = apr_lock_destroy(file->thlock); @@ -156,9 +159,6 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr return errno; } - if (flag & APR_DELONCLOSE) { - unlink(fname); - } (*new)->pipe = 0; (*new)->timeout = -1; (*new)->ungetchar = -1; From a5a82e4c6965b3487c9fc58a1f6e629671a9424b Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Tue, 2 Oct 2001 00:55:45 +0000 Subject: [PATCH 2392/7878] Simple is nice. :) Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62391 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 3 +-- file_io/unix/open.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index cfd1ee90406..a1602a58a1b 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -103,8 +103,7 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont apr_status_t apr_dir_close(apr_dir_t *thedir) { - apr_pool_cleanup_kill(thedir->cntxt, thedir, dir_cleanup); - return dir_cleanup(thedir); + return apr_pool_cleanup_run(thedir->cntxt, thedir, dir_cleanup); } apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, diff --git a/file_io/unix/open.c b/file_io/unix/open.c index f61e2bf473a..9dc2eadc806 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -174,8 +174,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) { - apr_pool_cleanup_kill(file->cntxt, file, apr_unix_file_cleanup); - return apr_unix_file_cleanup(file); + return apr_pool_cleanup_run(file->cntxt, file, apr_unix_file_cleanup); } APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) From 60cd11bbdaa5bd6acfaa788a0ea0ac7eee56a1f8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 2 Oct 2001 18:51:17 +0000 Subject: [PATCH 2393/7878] Fix a segfault in apr_poll_clear on Unix. Also fix the logic for the case where there are multiple events ORed together in the events list. Submitted by: Jamshid Mahdavi git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62392 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ network_io/unix/poll.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 5f920a31ab3..8f64842aa7b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Fix a segfault in apr_poll_clear on Unix. Also fix the logic + for the case where there are multiple events ORed together in + the events list. [Jamshid Mahdavi ] + *) Files opened on Unix with the flag APR_DELONCLOSE are now not unlinked until they are actually closed, rather than as soon as they're opened. The old approach worked but made diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index 2bc753ddf07..9e0c27bf94b 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -212,8 +212,8 @@ apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) newevents = get_event(events); while (i < aprset->curpos) { - if (aprset->events[i] & newevents) { - aprset->events[i] ^= newevents; + if (aprset->pollset[i].events & newevents) { + aprset->pollset[i].events &= ~newevents; } i++; } From 258fd3ff45c251607300cf23519eb83c2c0fac22 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Wed, 3 Oct 2001 09:10:02 +0000 Subject: [PATCH 2394/7878] Remove the generated libtool files. This assists with switching between libtool 1.3 and libtool 1.4. Submitted by: Mo DeJong git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62393 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/buildconf b/buildconf index ee05ac54023..18706de643e 100755 --- a/buildconf +++ b/buildconf @@ -74,6 +74,10 @@ fi # echo "Copying libtool helper files ..." +# Remove any libtool files so one can switch between libtool 1.3 +# and libtool 1.4 by simply rerunning the buildconf script. +(cd build ; rm -f ltconfig ltmain.sh libtool.m4) + $libtoolize --copy --automake ltpath=`dirname $libtoolize` @@ -84,7 +88,6 @@ if [ ! -f $ltfile ]; then exit 1 fi -rm -f build/libtool.m4 cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 # This is just temporary until people's workspaces are cleared -- remove From 55c509e78d5af0250cda241775030058e9efbba9 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 4 Oct 2001 00:01:09 +0000 Subject: [PATCH 2395/7878] NetWare versions of pipe.c and filepath.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62394 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filepath.c | 4 + file_io/netware/pipe.c | 201 +++++++++++++++++++++++++++++++++++++ 2 files changed, 205 insertions(+) create mode 100644 file_io/netware/filepath.c create mode 100644 file_io/netware/pipe.c diff --git a/file_io/netware/filepath.c b/file_io/netware/filepath.c new file mode 100644 index 00000000000..e4bb3f36cb1 --- /dev/null +++ b/file_io/netware/filepath.c @@ -0,0 +1,4 @@ +/* NetWare & Win32 have much in common with regards to file names (both are + * DOSish) so it makes sense to share some code + */ +#include "../win32/filepath.c" diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c new file mode 100644 index 00000000000..fd4b3ea136a --- /dev/null +++ b/file_io/netware/pipe.c @@ -0,0 +1,201 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include +#include + +#include "fileio.h" +#include "apr_strings.h" + +static int convert_error (int err) +{ + switch (err) + { + default : break; + case NX_EINVAL: return APR_EINVAL; + case NX_EBADF: return APR_EBADF; + case NX_ENOENT: return APR_ENOENT; + case NX_ENAMETOOLONG:return APR_ENAMETOOLONG; + } + + return err; +} + +static apr_status_t pipeblock(apr_file_t *thepipe) +{ + int err; + unsigned long flags; + +#ifdef TBD + if (!(err = NXGetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, &flags))) + { + flags &= ~NX_O_NONBLOCK; + err = NXSetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, flags); + } +#endif + + if (err) + return convert_error (err); + + thepipe->blocking = BLK_ON; + return APR_SUCCESS; +} + +static apr_status_t pipenonblock(apr_file_t *thepipe) +{ + int err; + unsigned long flags; + +#ifdef TBD + if (!(err = NXGetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, &flags))) + { + flags |= NX_O_NONBLOCK; + err = NXSetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, flags); + } +#endif + + if (err) + return convert_error (err); + + thepipe->blocking = BLK_OFF; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) +{ + if (thepipe->pipe == 1) { + thepipe->timeout = timeout; + if (timeout >= 0) { + if (thepipe->blocking != BLK_OFF) { /* blocking or unknown state */ + return pipenonblock(thepipe); + } + } + else { + if (thepipe->blocking != BLK_ON) { /* non-blocking or unknown state */ + return pipeblock(thepipe); + } + } + return APR_SUCCESS; + } + return APR_EINVAL; +} + +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) +{ + if (thepipe->pipe == 1) { + *timeout = thepipe->timeout; + return APR_SUCCESS; + } + return APR_EINVAL; +} + +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) +{ + char tname[L_tmpnam+1]; + NXHandle_t filedes[2]; + int err; + + if (!tmpnam(tname)) + return errno; + + if ( !(err = NXFifoOpen(0, tname, NX_O_RDONLY, 0, &filedes[0])) + && !(err = NXFifoOpen(0, tname, NX_O_WRONLY, 0, &filedes[1]))) + { + (*in)->cntxt = + (*out)->cntxt = cont; + (*in)->filedes = filedes[0]; + (*out)->filedes = filedes[1]; + (*in)->pipe = + (*out)->pipe = 1; + (*out)->fname = + (*in)->fname = NULL; + (*in)->buffered = + (*out)->buffered = 0; + (*in)->blocking = + (*out)->blocking = BLK_ON; + (*in)->timeout = + (*out)->timeout = -1; + (*in)->ungetchar = -1; + (*in)->thlock = + (*out)->thlock = NULL; + } + else + { + if (filedes[0] != (NXHandle_t) -1) + NXClose(filedes[0]); + + if (err) + return convert_error (err); + + } + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, + apr_fileperms_t perm, apr_pool_t *cont) +{ + mode_t mode = apr_unix_perms2mode(perm); + NXHandle_t filedes; + int err; + + err = NXFifoOpen(0, filename, mode, 0, &filedes); + + if (err) + return convert_error (err); + + return APR_SUCCESS; +} + + + From f8bae3e791c3784a36fe52d46dbe46c01a3da169 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 4 Oct 2001 00:02:16 +0000 Subject: [PATCH 2396/7878] Updated parameter lists due to prototype changes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62395 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filesys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/netware/filesys.c b/file_io/netware/filesys.c index a28d6f3f822..29fd9804f91 100644 --- a/file_io/netware/filesys.c +++ b/file_io/netware/filesys.c @@ -66,7 +66,7 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) return APR_SUCCESS; } -apr_status_t filepath_has_drive(char *rootpath, int only, apr_pool_t *p) +apr_status_t filepath_has_drive(const char *rootpath, int only, apr_pool_t *p) { char *s; @@ -84,7 +84,7 @@ apr_status_t filepath_has_drive(char *rootpath, int only, apr_pool_t *p) return 0; } -apr_status_t filepath_compare_drive(char *path1, char *path2, apr_pool_t *p) +apr_status_t filepath_compare_drive(const char *path1, const char *path2, apr_pool_t *p) { char *s1, *s2; From f4ec7f22c8993565d1f42795e7fc244656b4545e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 4 Oct 2001 00:06:24 +0000 Subject: [PATCH 2397/7878] Fixed apr_thread_create() so that it doesn't require the caller to pass an apr_threadattr_t structure pointer git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62396 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/thread.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 96b918c63b7..d9b81c34a01 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -98,15 +98,13 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_status_t stat; long flags = NX_THR_BIND_CONTEXT; char threadName[NX_MAX_OBJECT_NAME_LEN+1]; + size_t stack_size = APR_DEFAULT_STACK_SIZE; - if (!attr) - return APR_EINVAL; - - if (!attr->thread_name) { - char threadName[32]; - + if (attr && attr->thread_name) { + strncpy (threadName, attr->thread_name, NX_MAX_OBJECT_NAME_LEN); + } + else { sprintf(threadName, "APR_thread %0004ld", ++thread_count); - attr->thread_name = apr_pstrdup(cont, threadName); } /* An original stack size of 0 will allow NXCreateThread() to @@ -114,8 +112,8 @@ apr_status_t apr_thread_create(apr_thread_t **new, * size of less than 0 will assign the APR default stack size. * anything else will be taken as is. */ - if (attr->stack_size < 0) { - attr->stack_size = APR_DEFAULT_STACK_SIZE; + if (attr && (attr->stack_size >= 0)) { + stack_size = attr->stack_size; } (*new) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); @@ -139,14 +137,14 @@ apr_status_t apr_thread_create(apr_thread_t **new, /* void(*start_routine)(void *arg)*/(void (*)(void *)) func, /* void *arg */ data, /* int priority */ NX_PRIO_MED, - /* NXSize_t stackSize */ attr->stack_size, + /* NXSize_t stackSize */ stack_size, /* long flags */ NX_CTX_NORMAL, /* int *error */ &stat); stat = NXContextSetName( /* NXContext_t ctx */ (*new)->ctx, - /* const char *name */ attr->thread_name); + /* const char *name */ threadName); stat = NXThreadCreate( /* NXContext_t context */ (*new)->ctx, From e35824c790be004439070cdd0b636f64d2a88091 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 4 Oct 2001 00:08:49 +0000 Subject: [PATCH 2398/7878] Updated the function prototypes to match the way it is being called. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62397 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/fileio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/arch/netware/fileio.h b/include/arch/netware/fileio.h index feb810a1021..eedc1c3d3b4 100644 --- a/include/arch/netware/fileio.h +++ b/include/arch/netware/fileio.h @@ -157,12 +157,12 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p); * check to see of the path only contains a drive/volume specifier and * nothing else. */ -apr_status_t filepath_has_drive(char *rootpath, int only, apr_pool_t *p); +apr_status_t filepath_has_drive(const char *rootpath, int only, apr_pool_t *p); /* This function compares the drive/volume specifiers for each given path. * It returns zero if they match or non-zero if not. */ -apr_status_t filepath_compare_drive(char *path1, char *path2, apr_pool_t *p); +apr_status_t filepath_compare_drive(const char *path1, const char *path2, apr_pool_t *p); apr_status_t apr_unix_file_cleanup(void *); From dc874141e59230207b7c4937ba0ec21ad13c3f41 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 4 Oct 2001 03:00:16 +0000 Subject: [PATCH 2399/7878] Quote library name in generated def file in case it turns out to be a reserved word. I hit this with mod_include as "include" is reserved. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62398 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/aplibtool.c b/build/aplibtool.c index 34cdce7b784..2800b553f96 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -671,7 +671,7 @@ void generate_def_file(cmd_data_t *cmd_data) hDef = fopen(def_file, "w"); if (hDef != NULL) { - fprintf(hDef, "LIBRARY %s INITINSTANCE\n", nameof(cmd_data->output_name)); + fprintf(hDef, "LIBRARY '%s' INITINSTANCE\n", nameof(cmd_data->output_name)); fprintf(hDef, "DATA NONSHARED\n"); fprintf(hDef, "EXPORTS\n"); fclose(hDef); From d5b1a3a61e6c68bc4deb44f828a5eb88c3284e0a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 4 Oct 2001 21:01:05 +0000 Subject: [PATCH 2400/7878] Implementation of the new locking routines git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62399 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/thread_cond.h | 1 + include/arch/netware/thread_mutex.h | 1 + include/arch/netware/thread_rwlock.h | 1 + locks/netware/thread_cond.c | 45 ++++++++++++++++++++--- locks/netware/thread_mutex.c | 42 ++++++++++++++++++--- locks/netware/thread_rwlock.c | 55 ++++++++++++++++++++++++---- 6 files changed, 127 insertions(+), 18 deletions(-) diff --git a/include/arch/netware/thread_cond.h b/include/arch/netware/thread_cond.h index 94e49d00b7e..d9e93d76374 100644 --- a/include/arch/netware/thread_cond.h +++ b/include/arch/netware/thread_cond.h @@ -60,6 +60,7 @@ struct apr_thread_cond_t { apr_pool_t *pool; + NXCond_t *cond; }; #endif /* THREAD_COND_H */ diff --git a/include/arch/netware/thread_mutex.h b/include/arch/netware/thread_mutex.h index 352d87973e0..99fbd99ea94 100644 --- a/include/arch/netware/thread_mutex.h +++ b/include/arch/netware/thread_mutex.h @@ -60,6 +60,7 @@ struct apr_thread_mutex_t { apr_pool_t *pool; + NXMutex_t *mutex; }; #endif /* THREAD_MUTEX_H */ diff --git a/include/arch/netware/thread_rwlock.h b/include/arch/netware/thread_rwlock.h index 2652465108b..fe6e1db65f4 100644 --- a/include/arch/netware/thread_rwlock.h +++ b/include/arch/netware/thread_rwlock.h @@ -60,6 +60,7 @@ struct apr_thread_rwlock_t { apr_pool_t *pool; + NXRwLock_t *rwlock; }; #endif /* THREAD_RWLOCK_H */ diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c index ab704ca5762..a57935beab6 100644 --- a/locks/netware/thread_cond.c +++ b/locks/netware/thread_cond.c @@ -60,31 +60,66 @@ #include "thread_cond.h" #include "apr_portable.h" +static apr_status_t thread_cond_cleanup(void *data) +{ + apr_thread_cond_t *cond = (apr_thread_cond_t *)data; + + NXCondFree(cond->cond); + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, apr_pool_t *pool) { - return APR_ENOTIMPL; + apr_thread_cond_t *new_cond = NULL; + + new_cond = (apr_thread_cond_t *)apr_pcalloc(pool, sizeof(apr_thread_cond_t)); + + if(new_cond ==NULL) { + return APR_ENOMEM; + } + new_cond->pool = pool; + + new_cond->cond = NXCondAlloc(NULL); + + if(new_cond->cond == NULL) + return APR_ENOMEM; + + apr_pool_cleanup_register(new_cond->pool, new_cond, + (void*)thread_cond_cleanup, + apr_pool_cleanup_null); + *cond = new_cond; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + if (NXCondWait(cond->cond, mutex->mutex) != 0) + return APR_EINTR; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) { - return APR_ENOTIMPL; + NXCondSignal(cond->cond); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) { - return APR_ENOTIMPL; + NXCondBroadcast(cond->cond); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) { - return APR_ENOTIMPL; + apr_status_t stat; + if ((stat = thread_cond_cleanup(cond)) == APR_SUCCESS) { + apr_pool_cleanup_kill(cond->pool, cond, thread_cond_cleanup); + return APR_SUCCESS; + } + return stat; } APR_POOL_IMPLEMENT_ACCESSOR(thread_cond) diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index 466c6490713..d672ac70fbc 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -61,33 +61,63 @@ static apr_status_t thread_mutex_cleanup(void *data) { - return APR_ENOTIMPL; + apr_thread_mutex_t *mutex = (apr_thread_mutex_t *)data; + + NXMutexFree(mutex->mutex); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, apr_pool_t *pool) { - return APR_ENOTIMPL; + apr_thread_mutex_t *new_mutex = NULL; + + new_mutex = (apr_thread_mutex_t *)apr_pcalloc(pool, sizeof(apr_thread_mutex_t)); + + if(new_mutex ==NULL) { + return APR_ENOMEM; + } + new_mutex->pool = pool; + + new_mutex->mutex = NXMutexAlloc(NX_MUTEX_RECURSIVE, NULL, NULL); + + if(new_mutex->mutex == NULL) + return APR_ENOMEM; + + apr_pool_cleanup_register(new_mutex->pool, new_mutex, + (void*)thread_mutex_cleanup, + apr_pool_cleanup_null); + *mutex = new_mutex; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + NXLock(mutex->mutex); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + if (!NXTryLock(mutex->mutex)) + return APR_EBUSY; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + NXUnlock(mutex->mutex); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + apr_status_t stat; + if ((stat = thread_mutex_cleanup(mutex)) == APR_SUCCESS) { + apr_pool_cleanup_kill(mutex->pool, mutex, thread_mutex_cleanup); + return APR_SUCCESS; + } + return stat; } APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex) diff --git a/locks/netware/thread_rwlock.c b/locks/netware/thread_rwlock.c index 04cf3d218b7..572946b61ec 100644 --- a/locks/netware/thread_rwlock.c +++ b/locks/netware/thread_rwlock.c @@ -59,40 +59,81 @@ #include "thread_rwlock.h" #include "apr_portable.h" +static apr_status_t thread_rwlock_cleanup(void *data) +{ + apr_thread_rwlock_t *rwlock = (apr_thread_rwlock_t *)data; + + NXRwLockFree (rwlock->rwlock); + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, apr_pool_t *pool) { - return APR_ENOTIMPL; + apr_thread_rwlock_t *new_rwlock = NULL; + + NXHierarchy_t hierarchy = 1; //for libc NKS NXRwLockAlloc + NXLockInfo_t *info; //for libc NKS NXRwLockAlloc + + new_rwlock = (apr_thread_rwlock_t *)apr_pcalloc(pool, sizeof(apr_thread_rwlock_t)); + + if(new_rwlock ==NULL) { + return APR_ENOMEM; + } + new_rwlock->pool = pool; + + info = (NXLockInfo_t *)apr_pcalloc(pool, sizeof(NXLockInfo_t)); + new_rwlock->rwlock = NXRwLockAlloc(hierarchy, info); + if(new_rwlock->rwlock == NULL) + return APR_ENOMEM; + + apr_pool_cleanup_register(new_rwlock->pool, new_rwlock, thread_rwlock_cleanup, + apr_pool_cleanup_null); + *rwlock = new_rwlock; + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + NXRdLock(rwlock->rwlock); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + if (!NXTryRdLock(rwlock->rwlock)) + return APR_EBUSY; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + NXWrLock(rwlock->rwlock); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + if (!NXTryWrLock(rwlock->rwlock)) + return APR_EBUSY; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + NXRwUnlock(rwlock->rwlock); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + apr_status_t stat; + if ((stat = thread_rwlock_cleanup(rwlock)) == APR_SUCCESS) { + apr_pool_cleanup_kill(rwlock->pool, rwlock, thread_rwlock_cleanup); + return APR_SUCCESS; + } + return stat; } APR_POOL_IMPLEMENT_ACCESSOR(thread_rwlock) From 0ba40e948acf2e3961f89b9cbc64c4c72992cf29 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 5 Oct 2001 16:56:21 +0000 Subject: [PATCH 2401/7878] Updated the thread info structure to handle multiple argument thread functions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62400 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/threadproc.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/arch/netware/threadproc.h b/include/arch/netware/threadproc.h index 451111e66cf..eabc481c68a 100644 --- a/include/arch/netware/threadproc.h +++ b/include/arch/netware/threadproc.h @@ -67,6 +67,11 @@ struct apr_thread_t { apr_pool_t *cntxt; NXContext_t ctx; NXThreadId_t td; + char *thread_name; + apr_int32_t cancel; + apr_int32_t cancel_how; + void *data; + apr_thread_start_t func; }; struct apr_threadattr_t { From 954b607a493137855e790a8f8c50672d53623b90 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 5 Oct 2001 16:57:40 +0000 Subject: [PATCH 2402/7878] Fixed NetWare thread handling so that it can deal with multiple argument thread functions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62401 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/thread.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index d9b81c34a01..c8d16529cd6 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -89,6 +89,12 @@ apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) return APR_NOTDETACH; } +static void *dummy_worker(void *opaque) +{ + apr_thread_t *thd = (apr_thread_t *)opaque; + return thd->func(thd, thd->data); +} + apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, @@ -123,6 +129,9 @@ apr_status_t apr_thread_create(apr_thread_t **new, } (*new)->cntxt = cont; + (*new)->data = data; + (*new)->func = func; + (*new)->thread_name = (char*)apr_pstrdup(cont, threadName); stat = apr_pool_create(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { @@ -134,8 +143,8 @@ apr_status_t apr_thread_create(apr_thread_t **new, } (*new)->ctx = NXContextAlloc( - /* void(*start_routine)(void *arg)*/(void (*)(void *)) func, - /* void *arg */ data, + /* void(*start_routine)(void *arg)*/(void (*)(void *)) dummy_worker, + /* void *arg */ (*new), /* int priority */ NX_PRIO_MED, /* NXSize_t stackSize */ stack_size, /* long flags */ NX_CTX_NORMAL, From 7962e11dbe900cfcbb05c13971fcefbb50e7222f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 5 Oct 2001 17:08:24 +0000 Subject: [PATCH 2403/7878] Updated with the new locking API's git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62402 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/aprlib.imp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/misc/netware/aprlib.imp b/misc/netware/aprlib.imp index 6bbe7e43214..8bb7a3bda3e 100644 --- a/misc/netware/aprlib.imp +++ b/misc/netware/aprlib.imp @@ -265,6 +265,11 @@ apr_table_vdo, apr_terminate, apr_terminate2, + apr_thread_cond_create, + apr_thread_cond_wait, + apr_thread_cond_signal, + apr_thread_cond_broadcast, + apr_thread_cond_destroy, apr_thread_create, apr_thread_data_get, apr_thread_data_set, @@ -274,6 +279,18 @@ #apr_thread_once, #apr_thread_once_init, apr_thread_yield, + apr_thread_mutex_create, + apr_thread_mutex_lock, + apr_thread_mutex_trylock, + apr_thread_mutex_unlock, + apr_thread_mutex_destroy, + apr_thread_rwlock_create, + apr_thread_rwlock_rdlock, + apr_thread_rwlock_tryrdlock, + apr_thread_rwlock_wrlock, + apr_thread_rwlock_trywrlock, + apr_thread_rwlock_unlock, + apr_thread_rwlock_destroy, apr_threadattr_create, apr_threadattr_detach_get, apr_threadattr_detach_set, From dcacab675116bd103944c4b0ab015cb48197eba7 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 5 Oct 2001 17:23:12 +0000 Subject: [PATCH 2404/7878] Updated for the latest source code git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62403 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/arch/netware/apr.h b/include/arch/netware/apr.h index 4fcadfeaf28..50a7f7072c4 100644 --- a/include/arch/netware/apr.h +++ b/include/arch/netware/apr.h @@ -109,13 +109,16 @@ #define APR_HAVE_LIMITS_H 1 #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 +#define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SIGNAL_H 1 #define APR_HAVE_STDARG_H 1 +#define APR_HAVE_STDINT_H 0 #define APR_HAVE_STDIO_H 1 #define APR_HAVE_STDLIB_H 1 #define APR_HAVE_STRING_H 1 #define APR_HAVE_STRINGS_H 0 +#define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 @@ -128,7 +131,8 @@ #define APR_USE_SYSVSEM_SERIALIZE 0 #define APR_USE_FCNTL_SERIALIZE 0 #define APR_USE_PROC_PTHREAD_SERIALIZE 0 -#define APR_USE_PTHREAD_SERIALIZE 0 +#define APR_USE_PTHREAD_SERIALIZE 0 +#define APR_HAS_RWLOCK_SERIALIZE 0 #define APR_PROCESS_LOCK_IS_GLOBAL 0 @@ -149,6 +153,7 @@ #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 #define APR_HAVE_SIGACTION 0 +#define APR_HAVE_SIGWAIT 0 #define APR_HAVE_STRCASECMP 1 #define APR_HAVE_STRDUP 1 #define APR_HAVE_STRICMP 1 From 9fa40466aa757bfb19c22d9349278aab96228daf Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sat, 6 Oct 2001 20:13:15 +0000 Subject: [PATCH 2405/7878] Add ASF license git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62404 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/mktemp.c | 53 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 447d97965c4..efe3b282be7 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -1,3 +1,56 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ /* * Copyright (c) 1987, 1993 * The Regents of the University of California. All rights reserved. From 802d4c52f9cecfdeb6f7dcd2b8a7435a59a661c5 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sat, 6 Oct 2001 21:31:10 +0000 Subject: [PATCH 2406/7878] Many fixes to apr_file_mktemp when !HAVE_MKSTEMP to (a) make it work and (b) be consistent with systems that do have mkstemp. - s/APR_HAS_STDINT_H/APR_HAVE_STDINT_H/ - dropped use of errno and just returned the apr status directly - fixed gettemp prototype to allow the apr_file_t* to actually be returned - set missing APR_DELONCLOSE flag in call to apr_file_open in gettemp - removed duplicate calls to apr_pool_cleanup_register for platforms that use gettemp because apr_file_open() already registers the cleanup for us - dropped support for a NULL apr_file_t** parameter (which only worked if !HAVE_MKSTEMP anyway) because using a temp filename that has been created that way is unsafe. Question: does OS/2 have mkstemp() or is it using gettemp()? If it has mkstemp, the OS/2 cleanup registration needs to be put back in. Submitted by: Mladen Turk, Cliff Woolley git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62405 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ file_io/unix/mktemp.c | 94 +++++++++++++------------------------------ 2 files changed, 32 insertions(+), 65 deletions(-) diff --git a/CHANGES b/CHANGES index 8f64842aa7b..862610e4639 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fixed apr_file_mktemp on systems without mkstemp (Win32, etc). + [Mladen Turk, Cliff Woolley] + *) Fix a segfault in apr_poll_clear on Unix. Also fix the logic for the case where there are multiple events ORed together in the events list. [Jamshid Mahdavi ] diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index efe3b282be7..b9fe15ff1a9 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -91,9 +91,6 @@ #ifndef HAVE_MKSTEMP -#ifndef __warn_references -#define __warn_references(a,b) -#endif #if defined(SVR4) || defined(WIN32) #ifdef SVR4 #include @@ -101,7 +98,7 @@ #define arc4random() rand() #define seedrandom(a) srand(a) #else -#ifdef APR_HAS_STDINT_H +#ifdef APR_HAVE_STDINT_H #include #endif #define arc4random() random() @@ -111,18 +108,19 @@ #include #include #include -#include #include #include #include #include +#ifdef HAVE_TIME_H +#include +#endif static const unsigned char padchar[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; static apr_uint32_t randseed=0; -static int gettemp(char *path, apr_file_t *doopen, int domkdir, int slen, - apr_pool_t *p) +static int gettemp(char *path, apr_file_t **doopen, apr_pool_t *p) { register char *start, *trv, *suffp; char *pad; @@ -130,10 +128,6 @@ static int gettemp(char *path, apr_file_t *doopen, int domkdir, int slen, apr_status_t rv; apr_uint32_t randnum; - if (doopen && domkdir) { - errno = EINVAL; - return(0); - } if (randseed==0) { randseed = time(NULL); seedrandom(randseed); @@ -141,12 +135,10 @@ static int gettemp(char *path, apr_file_t *doopen, int domkdir, int slen, for (trv = path; *trv; ++trv) ; - trv -= slen; suffp = trv; --trv; if (trv < path) { - errno = EINVAL; - return (0); + return APR_EINVAL; } /* Fill space with random characters */ @@ -159,46 +151,34 @@ static int gettemp(char *path, apr_file_t *doopen, int domkdir, int slen, /* * check the target directory. */ - if (doopen || domkdir) { - for (;; --trv) { - if (trv <= path) - break; - if (*trv == '/') { - *trv = '\0'; - rv = apr_stat(&sbuf, path, APR_FINFO_TYPE, p); - *trv = '/'; - if (rv != APR_SUCCESS) - return(0); - if (sbuf.filetype != APR_DIR) { - errno = ENOTDIR; - return(0); - } - break; - } - } - } + for (;; --trv) { + if (trv <= path) + break; + if (*trv == '/') { + *trv = '\0'; + rv = apr_stat(&sbuf, path, APR_FINFO_TYPE, p); + *trv = '/'; + if (rv != APR_SUCCESS) + return rv; + if (sbuf.filetype != APR_DIR) { + return APR_ENOTDIR; + } + break; + } + } for (;;) { - errno = 0; - if (doopen) { - if ((rv = apr_file_open(&doopen, path, APR_CREATE|APR_EXCL|APR_READ|APR_WRITE, - APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) - return(1); - if (errno != EEXIST) - return(0); - } else if (domkdir) { - if (apr_dir_make(path, - APR_UREAD | APR_UWRITE | APR_UEXECUTE, p) == 0) - return(1); - if (errno != EEXIST) - return(0); - } else if ((rv = apr_lstat(&sbuf, path, APR_FINFO_TYPE, p)) != APR_SUCCESS) - return(rv == ENOENT ? 1 : 0); + if ((rv = apr_file_open(doopen, path, APR_CREATE|APR_EXCL|APR_READ| + APR_WRITE|APR_DELONCLOSE, + APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) + return APR_SUCCESS; + if (rv != APR_EEXIST) + return rv; /* If we have a collision, cycle through the space of filenames */ for (trv = start;;) { if (*trv == '\0' || trv == suffp) - return(0); + return APR_EINVAL; /* XXX: is this the correct return code? */ pad = strchr((char *)padchar, *trv); if (pad == NULL || !*++pad) *trv++ = padchar[0]; @@ -224,17 +204,9 @@ static int gettemp(char *path, apr_file_t *doopen, int domkdir, int slen, APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_pool_t *p) { #ifndef HAVE_MKSTEMP - int rv; + return gettemp(template, fp, p); #else int fd; -#endif - -#ifndef HAVE_MKSTEMP - rv = gettemp(template, (*fp), 0, 0, p); - if (rv == 0) { - return errno; - } -#else (*fp) = apr_pcalloc(p, sizeof(**fp)); (*fp)->cntxt = p; (*fp)->timeout = -1; @@ -248,14 +220,6 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_p (*fp)->fname = apr_pstrdup(p, template); (*fp)->filedes = fd; -#endif -#ifdef WIN32 - apr_pool_cleanup_register((*fp)->cntxt, (void *)(*fp), - file_cleanup, file_cleanup); -#elif defined(OS2) - apr_pool_cleanup_register((*fp)->cntxt, (void *)(*fp), - apr_file_cleanup, apr_file_cleanup); -#else apr_pool_cleanup_register((*fp)->cntxt, (void *)(*fp), apr_unix_file_cleanup, apr_unix_file_cleanup); #endif From 1e2f57c4eaa0116de1d2c9a2a34fb57709166030 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 8 Oct 2001 17:33:14 +0000 Subject: [PATCH 2407/7878] Forgot to update chars to decode and used the wrong buffer remaining var git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62406 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 9dbb736b3b3..63986ce2e4a 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -81,7 +81,6 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, * \\?\UNC\ is needed UNC paths. */ int srcremains = strlen(srcstr) + 1; - int retremains = srcremains; apr_wchar_t *t = retstr; apr_status_t rv; if (srcstr[1] == ':' && (srcstr[2] == '/' || srcstr[2] == '\\')) { @@ -94,12 +93,13 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, && (srcstr[2] != '?')) { /* Skip the slashes */ srcstr += 2; + srcremains -= 2; wcscpy (retstr, L"\\\\?\\UNC\\"); retlen -= 8; t += 8; } - if (rv = conv_utf8_to_ucs2(srcstr, &srcremains, t, &retremains)) { + if (rv = conv_utf8_to_ucs2(srcstr, &srcremains, t, &retlen)) { return (rv == APR_INCOMPLETE) ? APR_EINVAL : rv; } if (srcremains) { From 70090db05f28eaa6d88570c99c8ee0a25120689c Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 8 Oct 2001 19:10:28 +0000 Subject: [PATCH 2408/7878] Remove a stray function stub Submitted by: Aaron git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62407 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_rwlock.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c index 8a11aba9323..5458266b46e 100644 --- a/locks/unix/thread_rwlock.c +++ b/locks/unix/thread_rwlock.c @@ -220,11 +220,6 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwloc return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_lock(apr_thread_rwlock_t *rwlock) -{ - return APR_ENOTIMPL; -} - APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) { return APR_ENOTIMPL; From 90d2f39993df64abcdd2db66abad5ccb3cca9a09 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 8 Oct 2001 20:18:08 +0000 Subject: [PATCH 2409/7878] This patch sets us up to call the initialization routines for the unix proc_mutex routines when APR is initialized. This will allow the new lock API to use fcntl and sysv proc_mutex types. Submitted by: Aaron Bannert Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62408 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/unix/start.c b/misc/unix/start.c index 2e7ef27cb6d..cc93bc1e1c3 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -59,6 +59,7 @@ #include "misc.h" /* for WSAHighByte / WSALowByte */ #include "locks.h" /* for apr_unix_setup_lock() */ +#include "proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ #include "internal_time.h" @@ -84,6 +85,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) #if !defined(BEOS) && !defined(OS2) && !defined(WIN32) && !defined(NETWARE) apr_unix_setup_lock(); + apr_proc_mutex_unix_setup_lock(); apr_unix_setup_time(); #elif defined WIN32 || defined(NETWARE) iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); From 9f65399235a6f18da9a52e5d9feaffa54b7532bc Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Mon, 8 Oct 2001 23:09:09 +0000 Subject: [PATCH 2410/7878] Get rid of warnings about redefinition of 'strcasecmp', as it's already defined in apr_general.h, and put 'sleep's parameter in parens in the macro expansion, for safety. Tested with a complete Win32 build of httpd-2.0; no warnings, no errors. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62409 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_private.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 884bedcd062..e3c49753936 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -138,8 +138,7 @@ */ typedef void (Sigfunc)(int); -#define strcasecmp(s1, s2) stricmp(s1, s2) -#define sleep(t) Sleep(t * 1000) +#define sleep(t) Sleep((t) * 1000) #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 From fd248a9475bcadbf969a2f2358b4ef04fe72fa27 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 9 Oct 2001 19:26:43 +0000 Subject: [PATCH 2411/7878] Allowed NetWare to take advantage of the system timezone variable git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62410 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/time/unix/time.c b/time/unix/time.c index 00e9b247a00..1c26f8704ad 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -156,7 +156,7 @@ APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, apr_time_ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) { -#if defined(__EMX__) +#if defined(__EMX__) || defined(NETWARE) /* EMX gcc (OS/2) has a timezone global we can use */ return apr_explode_time(result, input, -timezone); #else From 5fb482ae4ad24322b84a4954cef1ad30b17d564f Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 10 Oct 2001 13:59:08 +0000 Subject: [PATCH 2412/7878] Fix macro test (it's a 0/1 macro). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62411 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/mktemp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index b9fe15ff1a9..68156c3fc9c 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -98,7 +98,7 @@ #define arc4random() rand() #define seedrandom(a) srand(a) #else -#ifdef APR_HAVE_STDINT_H +#if APR_HAVE_STDINT_H #include #endif #define arc4random() random() From 1817d51bc818eabaafeb539130aae998058ad617 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 10 Oct 2001 14:19:00 +0000 Subject: [PATCH 2413/7878] OS/2: Suppress use of mkstemp(), our own gettemp() is better. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62412 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/fileio.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index 98d83ea1809..71ab018f3f8 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -62,6 +62,12 @@ #include "apr_file_info.h" #include "apr_errno.h" +/* We have an implementation of mkstemp but it's not very multi-threading + * friendly & is part of the POSIX emulation rather than native so don't + * use it. + */ +#undef HAVE_MKSTEMP + #define APR_FILE_BUFSIZE 4096 struct apr_file_t { From 82abe201e03a664efa613d6bc77fa58a4b8bf77f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 10 Oct 2001 17:36:12 +0000 Subject: [PATCH 2414/7878] Cleanup and speedup the UNC path through wchar->utf-8 filename translation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62413 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 63986ce2e4a..6ca74fae4fa 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -129,7 +129,8 @@ apr_status_t unicode_to_utf8_path(char* retstr, apr_size_t retlen, srcstr[6] == L'C' && srcstr[7] == L'\\') { srcremains -= 8; srcstr += 8; - strcpy(retstr, "//"); + retstr[0] = '\\'; + retstr[1] = '\\'; retlen -= 2; t += 2; } @@ -145,9 +146,6 @@ apr_status_t unicode_to_utf8_path(char* retstr, apr_size_t retlen, if (srcremains) { return APR_ENAMETOOLONG; } - for (; *t; ++t) - if (*t == L'/') - *t = L'\\'; return APR_SUCCESS; } #endif From dfbb11390ec054b17974555b22424888768f4f81 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 10 Oct 2001 18:03:07 +0000 Subject: [PATCH 2415/7878] Some extra slash correctness for Win32/OS2 (Netware likely needs a patch.) All slashes should be corrected if APR_FILEPATH_TRUENAME is given, otherwise the caller's string (choice of slashes) should be returned. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62414 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 64 ++++++++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 3250294b670..5d38e0ba475 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -79,6 +79,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, { const char *testpath = *inpath; char *newpath; + char seperator[2] = { (flags & APR_FILEPATH_NATIVE) ? '\\' : '/', 0}; #ifdef NETWARE char server[MAX_SERVER_NAME+1]; char volume[MAX_VOLUME_NAME+1]; @@ -107,10 +108,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, /* NetWare doesn't add the root slash so we need to add it manually. */ - if (flags & APR_FILEPATH_NATIVE) - strcat(newpath, "\\"); - else - strcat(newpath, "/"); + strcat(newpath, "/"); *rootpath = newpath; /* Skip the inpath pointer down to the first non-root character @@ -132,7 +130,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, in same manner as unix although this path will be incomplete. */ - *rootpath = apr_pstrdup(p, ((flags & APR_FILEPATH_NATIVE) ? "\\" : "/")); + *rootpath = apr_pstrdup(p, seperator); do { ++(*inpath); } while ((**inpath == '/') || (**inpath == '\\')); @@ -235,17 +233,30 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, rv = filepath_root_case(&newpath, newpath, p); if (rv) return rv; + newpath[0] = seperator[0]; + newpath[1] = seperator[0]; + newpath[delim1 - testpath] = seperator[0]; + } + else { + /* Give back the caller's own choice of delimiters + */ + newpath[0] = testpath[0]; + newpath[1] = testpath[1]; + newpath[delim1 - testpath] = *delim1; } + /* If this root included the trailing / or \ designation - * then lop off multiple trailing slashes + * then lop off multiple trailing slashes and give back + * appropriate delimiters. */ if (*delim2) { *inpath = delim2 + 1; while (**inpath == '/' || **inpath == '\\') ++*inpath; - /* Give back the caller's own trailing delimiter - */ - newpath[delim2 - testpath] = *delim2; + if (flags & APR_FILEPATH_TRUENAME) + newpath[delim2 - testpath] = seperator[0]; + else + newpath[delim2 - testpath] = *delim2; } else *inpath = delim2; @@ -255,18 +266,27 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, } /* Have path of '\\[machine]', if the machine is given, - * append the trailing \ + * append same trailing slash as the leading slash */ delim1 = strchr(testpath, '\0'); if (delim1 > testpath + 2) { newpath = apr_pstrndup(p, testpath, delim1 - testpath + 1); - newpath[delim1 - testpath] = '\\'; + if (flags & APR_FILEPATH_TRUENAME) + newpath[delim1 - testpath] = seperator[0]; + else + newpath[delim1 - testpath] = newpath[0]; newpath[delim1 - testpath + 1] = '\0'; } - else + else { newpath = apr_pstrndup(p, testpath, delim1 - testpath); - newpath[0] = '\\'; - newpath[1] = '\\'; + if (flags & APR_FILEPATH_TRUENAME) { + newpath[delim1 - testpath] = seperator[0]; + } + } + if (flags & APR_FILEPATH_TRUENAME) { + newpath[0] = seperator[0]; + newpath[1] = seperator[0]; + } *rootpath = newpath; *inpath = delim1; return APR_EINCOMPLETE; @@ -274,10 +294,12 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, /* Left with a path of '/', what drive are we asking about? */ - // ?? if (flags & APR_FILEPATH_TRUENAME) *inpath = ++testpath; newpath = apr_palloc(p, 2); - newpath[0] = ((flags & APR_FILEPATH_NATIVE) ? '\\' : '/'); + if (flags & APR_FILEPATH_TRUENAME) + newpath[0] = seperator[0]; + else + newpath[0] = testpath[0]; newpath[1] = '\0'; *rootpath = newpath; return APR_EINCOMPLETE; @@ -295,8 +317,8 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, */ newpath = apr_palloc(p, 4); newpath[0] = testpath[0]; - newpath[1] = ':'; - newpath[2] = ((flags & APR_FILEPATH_NATIVE) ? '\\' : '/'); + newpath[1] = testpath[1]; + newpath[2] = seperator[0]; newpath[3] = '\0'; if (flags & APR_FILEPATH_TRUENAME) { newpath[0] = toupper(newpath[0]); @@ -313,11 +335,15 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, return APR_EINCOMPLETE; } - /* strip off remaining slashes that designate the root. + /* strip off remaining slashes that designate the root, + * give the caller back their original choice of slash + * unless this is TRUENAME'ed */ *inpath = testpath + 3; while (**inpath == '/' || **inpath == '\\') ++*inpath; + if (!(flags & APR_FILEPATH_TRUENAME)) + newpath[2] = testpath[0]; *rootpath = newpath; return APR_SUCCESS; } From 8f9a4801e8735e140e7a1230ca1452cfae910c92 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 10 Oct 2001 18:09:41 +0000 Subject: [PATCH 2416/7878] Fix minor typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62415 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 5d38e0ba475..200313d92d6 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -343,7 +343,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, while (**inpath == '/' || **inpath == '\\') ++*inpath; if (!(flags & APR_FILEPATH_TRUENAME)) - newpath[2] = testpath[0]; + newpath[2] = testpath[2]; *rootpath = newpath; return APR_SUCCESS; } From cb94d96c1bb6b63ebba1638c7671bbecda58b3a5 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 10 Oct 2001 19:28:58 +0000 Subject: [PATCH 2417/7878] Fixed a compiler problem on NetWare. Metrowerks can't handle the inline initialization git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62416 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 200313d92d6..6ea7c8ac3d6 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -79,14 +79,16 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, { const char *testpath = *inpath; char *newpath; - char seperator[2] = { (flags & APR_FILEPATH_NATIVE) ? '\\' : '/', 0}; #ifdef NETWARE + char seperator[2] = { 0, 0}; char server[MAX_SERVER_NAME+1]; char volume[MAX_VOLUME_NAME+1]; char path[MAX_PATH_NAME+1]; char file[MAX_FILE_NAME+1]; int elements; + seperator[0] = (flags & APR_FILEPATH_NATIVE) ? '\\' : '/'; + /* Allocate and initialize each of the segment buffers */ server[0] = volume[0] = path[0] = file[0] = '\0'; @@ -108,7 +110,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, /* NetWare doesn't add the root slash so we need to add it manually. */ - strcat(newpath, "/"); + strcat(newpath, seperator); *rootpath = newpath; /* Skip the inpath pointer down to the first non-root character @@ -141,6 +143,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, return APR_EINCOMPLETE; #else + char seperator[2] = { (flags & APR_FILEPATH_NATIVE) ? '\\' : '/', 0}; const char *delim1; const char *delim2; From 58ef1da0626d0ee0da9fc838ab0821d8174dd42e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Oct 2001 13:48:59 +0000 Subject: [PATCH 2418/7878] More path parsing corrections, Win32 path code should now be stable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62417 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filesys.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c index ba3d5b4806a..464e0e0897d 100644 --- a/file_io/win32/filesys.c +++ b/file_io/win32/filesys.c @@ -170,23 +170,21 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) apr_wchar_t *ignored; apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; + apr_wchar_t wroot[APR_PATH_MAX]; /* ???: This needs review, apparently "\\?\d:." returns "\\?\d:" * as if that is useful for anything. */ - { - apr_wchar_t wroot[APR_PATH_MAX]; - if (rv = utf8_to_unicode_path(wroot, sizeof(wroot) - / sizeof(apr_wchar_t), root)) - return rv; - if (!GetFullPathNameW(wroot, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored)) - return apr_get_os_error(); - } - { - char path[APR_PATH_MAX]; - if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) - return rv; - *rootpath = apr_pstrdup(p, path); - } + if (rv = utf8_to_unicode_path(wroot, sizeof(wroot) + / sizeof(apr_wchar_t), root)) + return rv; + if (!GetFullPathNameW(wroot, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored)) + return apr_get_os_error(); + + /* Borrow wroot as a char buffer (twice as big as necessary) + */ + if ((rv = unicode_to_utf8_path((char*)wroot, sizeof(wroot), wpath))) + return rv; + *rootpath = apr_pstrdup(p, (char*)wroot); } else #endif From a3525d33f038edbf835152d679657aa600abd10c Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 11 Oct 2001 22:17:34 +0000 Subject: [PATCH 2419/7878] Added $(top_srcdir) and prefixed some of the files we reference with that variable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62418 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index 3b739cc7459..6e53bc96f3d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -39,6 +39,7 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ srcdir=@srcdir@ +top_srcdir=@top_srcdir@ delete-lib: @if test -f $(TARGET_LIB); then \ @@ -52,11 +53,11 @@ delete-lib: install: $(TARGET_LIB) if [ ! -d $(includedir) ]; then \ - $(srcdir)/build/mkdir.sh $(includedir); \ + $(top_srcdir)/build/mkdir.sh $(includedir); \ fi; \ - cp include/*.h $(includedir); \ + cp $(top_srcdir)/include/*.h $(includedir); \ if [ ! -d $(libdir) ]; then \ - $(srcdir)/build/mkdir.sh $(libdir); \ + $(top_srcdir)/build/mkdir.sh $(libdir); \ fi; \ $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(libdir) $(LIBTOOL) --mode=install cp APRVARS $(libdir) @@ -81,10 +82,10 @@ delete-exports: fi $(TARGET_EXPORTS): - $(MKEXPORT) include/*.h > $@ + $(MKEXPORT) $(top_srcdir)/include/*.h > $@ dox: - doxygen docs/doxygen.conf + doxygen $(top_srcdir)/docs/doxygen.conf test: $(TARGET_LIB) (cd test; make clean; make; \ From b2d6600c0d5e7c542c15ec90eeac2a880a7f8a82 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Fri, 12 Oct 2001 01:05:03 +0000 Subject: [PATCH 2420/7878] Adds apr_thread_cond_timedwait() interface to new lock API. Implements it for UNIX, stubs elsewhere. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62419 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_cond.h | 24 ++++++++++++++++++++++-- locks/beos/thread_cond.c | 6 ++++++ locks/netware/thread_cond.c | 6 ++++++ locks/os2/thread_cond.c | 6 ++++++ locks/unix/thread_cond.c | 25 +++++++++++++++++++++++++ locks/win32/thread_cond.c | 6 ++++++ 6 files changed, 71 insertions(+), 2 deletions(-) diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h index 65b6f8debcf..ea438babb47 100644 --- a/include/apr_thread_cond.h +++ b/include/apr_thread_cond.h @@ -58,6 +58,7 @@ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" +#include "apr_time.h" #include "apr_thread_mutex.h" #ifdef __cplusplus @@ -90,6 +91,7 @@ typedef struct apr_thread_cond_t apr_thread_cond_t; */ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, apr_pool_t *pool); + /** * Put the active calling thread to sleep until signaled to wake up. Each * condition variable must be associated with a mutex, and that mutex must @@ -105,8 +107,25 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex); -/* XXX: Should we add apr_thread_cond_timedwait()? Can it be done on all - * platforms? -aaron */ +/** + * Put the active calling thread to sleep until signaled to wake up or + * the timeout is reached. Each condition variable must be associated + * with a mutex, and that mutex must be locked before calling this + * function, or the behavior will be undefined. As the calling thread + * is put to sleep, the given mutex will be simultaneously released; + * and as this thread wakes up the lock is again simultaneously acquired. + * @param cond the condition variable on which to block. + * @param mutex the mutex that must be locked upon entering this function, + * is released while the thread is asleep, and is again acquired before + * returning from this function. + * @param timeout The amount of time in microseconds to wait. This is + * a maximum, not a minimum. If the condition is signaled, we + * will wake up before this time, otherwise the error APR_TIMEUP + * is returned. + */ +APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex, + apr_interval_time_t timeout); /** * Signals a singla thread, if one exists, that is blocking on the given @@ -116,6 +135,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, * @param cond the condition variable on which to produce the signal. */ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond); + /** * Signals all threads blocking on the given condition variable. * Each thread that was signaled is then schedule to wake up and acquire diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c index 0d1de6cd7f4..30a4a25c4d1 100644 --- a/locks/beos/thread_cond.c +++ b/locks/beos/thread_cond.c @@ -74,6 +74,12 @@ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, return APR_ENOTIMPL; } +APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex, + apr_interval_time_t timeout){ + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) { return APR_ENOTIMPL; diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c index a57935beab6..d5562311eaa 100644 --- a/locks/netware/thread_cond.c +++ b/locks/netware/thread_cond.c @@ -100,6 +100,12 @@ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex, + apr_interval_time_t timeout){ + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) { NXCondSignal(cond->cond); diff --git a/locks/os2/thread_cond.c b/locks/os2/thread_cond.c index 94d91e941ce..30800564658 100644 --- a/locks/os2/thread_cond.c +++ b/locks/os2/thread_cond.c @@ -73,6 +73,12 @@ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, return APR_ENOTIMPL; } +APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex, + apr_interval_time_t timeout){ + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) { return APR_ENOTIMPL; diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c index 3c7ad6fa744..0a107569a24 100644 --- a/locks/unix/thread_cond.c +++ b/locks/unix/thread_cond.c @@ -124,6 +124,31 @@ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, return stat; } +APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex, + apr_interval_time_t timeout) +{ + apr_status_t stat; + apr_time_t then; + struct timespec abstime; + + then = apr_time_now() + timeout; + abstime.tv_sec = then / APR_USEC_PER_SEC; + abstime.tv_nsec = (then % APR_USEC_PER_SEC) * 1000; /* nanoseconds */ + + stat = pthread_cond_timedwait(cond->cond, &mutex->mutex, &abstime); +#ifdef PTHREAD_SETS_ERRNO + if (stat) { + stat = errno; + } +#endif + if (ETIMEDOUT == stat) { + return APR_TIMEUP; + } + return stat; +} + + APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) { apr_status_t stat; diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index 032c28da0d7..3fa0eeead8f 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -113,6 +113,12 @@ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex, + apr_interval_time_t timeout){ + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) { DWORD rv; From bb3889b191472d1093f54e66fdfd445c811fcae7 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Fri, 12 Oct 2001 01:11:14 +0000 Subject: [PATCH 2421/7878] New test for apr_thread_cond_timedwait(). Sets the timer at 5 seconds. No signals are thrown. Measures the time that we were asleep. - If the timer comes back early with APR_TIMEUP, then it passes. - If it comes back more than 100ms late, it fails. (We may wish to fool with the timeout leeway, I think 100ms is pretty generous, especially since the timeout is supposed to be a maximum.) - If it comes back and there is no error, we try again (up to 5 times) since it was probably just a spurious wakeup. - If we get an error that is not APR_TIMEUP, it failed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62420 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/test/testlock.c b/test/testlock.c index 1fa77369090..37c0b6e3afd 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -77,6 +77,7 @@ int main(void) #define MAX_ITER 40000 #define MAX_COUNTER 100000 +#define MAX_RETRY 5 void * APR_THREAD_FUNC thread_rw_func(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data); @@ -110,6 +111,9 @@ struct { int nready; } nready; +apr_thread_mutex_t *timeout_mutex; +apr_thread_cond_t *timeout_cond; + void * APR_THREAD_FUNC thread_rw_func(apr_thread_t *thd, void *data) { int exitLoop = 1; @@ -564,6 +568,73 @@ apr_status_t test_cond(void) return APR_SUCCESS; } +apr_status_t test_timeoutcond(void) +{ + apr_status_t s; + apr_interval_time_t timeout; + apr_time_t begin, end; + int i; + + printf("thread_cond_timedwait Tests\n"); + printf("%-60s", " Initializing the first apr_thread_mutex_t"); + s = apr_thread_mutex_create(&timeout_mutex, pool); + if (s != APR_SUCCESS) { + printf("Failed!\n"); + return s; + } + printf("OK\n"); + + printf("%-60s", " Initializing the apr_thread_cond_t"); + s = apr_thread_cond_create(&timeout_cond, pool); + if (s != APR_SUCCESS) { + printf("Failed!\n"); + return s; + } + printf("OK\n"); + + timeout = 5 * APR_USEC_PER_SEC; + + for (i = 0; i < MAX_RETRY; i++) { + printf("%-60s"," Waiting for condition for 5 seconds"); + + begin = apr_time_now(); + s = apr_thread_cond_timedwait(timeout_cond, timeout_mutex, timeout); + end = apr_time_now(); + + /* If we slept for more than 100ms over the timeout. */ + if (end - begin - timeout > 100000) { + if (APR_STATUS_IS_TIMEUP(s)) { + printf("Failed (late TIMEUP)!\n"); + printf(" The timer returned in %" APR_TIME_T_FMT " usec!\n", + end - begin); + return s; + } + else if (s != APR_SUCCESS) { + printf("Failed!\n"); + return s; + } + } + /* else, everything is ok */ + else if (APR_STATUS_IS_TIMEUP(s)) { + printf("OK\n"); + return APR_SUCCESS; + } + /* else, we were within the time limit, and something broke. */ + else if (s != APR_SUCCESS) { + printf("Failed! (bad timer)\n"); + return s; + } + /* else, spurious wakeup, just try again. */ + else { + printf("Spurious wakeup...retrying\n"); + continue; + } + } + printf("Too many spurious wakeups, unable to complete test.\n"); + + return APR_EGENERAL; +} + int main(int argc, const char * const *argv) { apr_status_t rv; @@ -634,6 +705,12 @@ int main(int argc, const char * const *argv) exit(-7); } + if ((rv = test_timeoutcond()) != APR_SUCCESS) { + fprintf(stderr,"thread_cond_timedwait test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-8); + } + return 0; } From 75e2e05aa1e3a2882bcd9385ad0fd09e2cff51ef Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 12 Oct 2001 13:26:35 +0000 Subject: [PATCH 2422/7878] clean up some gcc warnings git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62421 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 2 +- test/testnames.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/testlock.c b/test/testlock.c index 37c0b6e3afd..44c34e6e617 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -568,7 +568,7 @@ apr_status_t test_cond(void) return APR_SUCCESS; } -apr_status_t test_timeoutcond(void) +static apr_status_t test_timeoutcond(void) { apr_status_t s; apr_interval_time_t timeout; diff --git a/test/testnames.c b/test/testnames.c index f77a8833771..1b3240df2aa 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -70,11 +70,12 @@ static void closeapr(void) apr_terminate(); } -static void root_result(char *path) +static void root_result(const char *path) { apr_status_t status; char errmsg[256]; - char *root = NULL; + const char *root = NULL; + status = apr_filepath_root(&root, &path, APR_FILEPATH_NATIVE, context); apr_strerror(status, errmsg, sizeof(errmsg)); if (root) From 538aff2878a287ad4b9671d8f7ff9eb8f3c22d46 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Fri, 12 Oct 2001 19:02:37 +0000 Subject: [PATCH 2423/7878] Let's just make these consistent. All have declared prototypes now, and they all return apr_status_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62422 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/testlock.c b/test/testlock.c index 44c34e6e617..cac60ce0f13 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -85,11 +85,13 @@ void * APR_THREAD_FUNC thread_function(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_cond_producer(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data); -apr_status_t test_exclusive(void); apr_status_t test_rw(void); -apr_status_t test_multiple_locking(const char *); +apr_status_t test_exclusive(void); +apr_status_t test_multiple_locking(const char *lockfile); +apr_status_t test_thread_mutex(void); +apr_status_t test_thread_rwlock(void); apr_status_t test_cond(void); - +apr_status_t test_timeoutcond(void); apr_file_t *in, *out, *err; apr_lock_t *thread_rw_lock, *thread_lock; @@ -257,7 +259,7 @@ void * APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data) return NULL; } -int test_rw(void) +apr_status_t test_rw(void) { apr_thread_t *t1, *t2, *t3, *t4; apr_status_t s1, s2, s3, s4; @@ -399,7 +401,7 @@ apr_status_t test_multiple_locking(const char *lockfile) return APR_SUCCESS; } -static apr_status_t test_thread_mutex(void) +apr_status_t test_thread_mutex(void) { apr_thread_t *t1, *t2, *t3, *t4; apr_status_t s1, s2, s3, s4; @@ -447,7 +449,7 @@ static apr_status_t test_thread_mutex(void) return APR_SUCCESS; } -static int test_thread_rwlock(void) +apr_status_t test_thread_rwlock(void) { apr_thread_t *t1, *t2, *t3, *t4; apr_status_t s1, s2, s3, s4; @@ -568,7 +570,7 @@ apr_status_t test_cond(void) return APR_SUCCESS; } -static apr_status_t test_timeoutcond(void) +apr_status_t test_timeoutcond(void) { apr_status_t s; apr_interval_time_t timeout; From 2348a3bf64419978e4380e1cb919b9dc822412da Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Fri, 12 Oct 2001 19:11:59 +0000 Subject: [PATCH 2424/7878] Added the cond_timedwait function (and a new test for it as well). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62423 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 862610e4639..5032f228da5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Add the apr_thread_cond_timedwait function to the condition + variable API. [Aaron Bannert] + *) Fixed apr_file_mktemp on systems without mkstemp (Win32, etc). [Mladen Turk, Cliff Woolley] From acbd1b2691b2e8172777a578ca872a4c66dd0c84 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 12 Oct 2001 21:44:21 +0000 Subject: [PATCH 2425/7878] yeah, I could just fix it, but everybody's hungry and I'll forget about this any minute git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62424 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index ba7c003e84b..9b03220e7ca 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/09/28 14:05:22 $] +Last modified at [$Date: 2001/10/12 21:44:21 $] Release: @@ -15,6 +15,10 @@ Release: RELEASE SHOWSTOPPERS: + * apr_proc_wait() and apr_proc_wait_all_procs() are broken + w.r.t. child processes which exit due to a signal. + Message-ID: + * complete the efforts started by DougM for cleaner fn naming conventions: see proposed name changes in renames_pending and offer up any additions/vetos/clarifications. From 6ce9fc5dd8ebde8031a3e15b43fb31711e7d5295 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Mon, 15 Oct 2001 22:56:55 +0000 Subject: [PATCH 2426/7878] Various changes toward the goal of AIX shared library builds: Scripts migrated from httpd-2.0 for building exports.c and export_vars.h (make_exports.awk and make_var_export.awk). Removed obsolete script (make_export.awk). Used Victor's CPP rules from httpd-2.0 to create apr.exp list of exported symbols (for AIX) from the export.c and export_vars.h files. export.lo is then created for programs (like httpd) that need to link against a stub library so that the symbols will be available to all DSOs. Reviewed by: Victor J. Orlikowski git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62425 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 4 +- Makefile.in | 36 +++-- build/make_exports.awk | 129 ++++++++++++++++++ .../{make_export.awk => make_var_export.awk} | 24 ++-- 4 files changed, 165 insertions(+), 28 deletions(-) create mode 100644 build/make_exports.awk rename build/{make_export.awk => make_var_export.awk} (58%) diff --git a/.cvsignore b/.cvsignore index d66bf90db56..5cb40de2ac5 100644 --- a/.cvsignore +++ b/.cvsignore @@ -12,7 +12,9 @@ Debug Release *.opt *.plg -apr.exports +apr.exp +exports.c +export_vars.h .libs *.la libapr.rc diff --git a/Makefile.in b/Makefile.in index 6e53bc96f3d..904d3115417 100644 --- a/Makefile.in +++ b/Makefile.in @@ -17,22 +17,22 @@ CLEAN_SUBDIRS= . test build INSTALL_SUBDIRS=@INSTALL_SUBDIRS@ TARGET_LIB = libapr.la -TARGET_EXPORTS = apr.exports # # Rules for building specific targets, starting with 'all' for # building the entire package. # -TARGETS = delete-lib $(TARGET_LIB) delete-exports $(TARGET_EXPORTS) +TARGETS = delete-lib $(TARGET_LIB) delete-exports export_vars.h apr.exp # bring in rules.mk for standard functionality @INCLUDE_RULES@ -CLEAN_TARGETS = $(TARGET_EXPORTS) +CLEAN_TARGETS = DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ - APRVARS libtool -EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in + APRVARS libtool apr.exp +EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in \ + exports.c export_vars.h prefix=@prefix@ exec_prefix=@exec_prefix@ @@ -41,6 +41,8 @@ includedir=@includedir@ srcdir=@srcdir@ top_srcdir=@top_srcdir@ +EXPORT_FILES = $(top_srcdir)/include/*.h + delete-lib: @if test -f $(TARGET_LIB); then \ for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \ @@ -72,17 +74,27 @@ $(TARGET_LIB): $(LINK) @lib_target@ delete-exports: - @if test -f $(TARGET_EXPORTS); then \ - headers="`find include/*.h -newer $(TARGET_EXPORTS)`" ; \ + @if test -f apr.exp; then \ + headers="`find include/*.h -newer apr.exp`" ; \ if test -n "$$headers"; then \ - echo Found newer headers. Will rebuild $(TARGET_EXPORTS). ; \ - echo $(RM) -f $(TARGET_EXPORTS) ; \ - $(RM) -f $(TARGET_EXPORTS) ; \ + echo Found newer headers. Will rebuild apr.exp. ; \ + echo $(RM) -f apr.exp ; \ + $(RM) -f apr.exp ; \ fi \ fi -$(TARGET_EXPORTS): - $(MKEXPORT) $(top_srcdir)/include/*.h > $@ +exports.c: + $(AWK) -f $(top_srcdir)/build/make_exports.awk $(EXPORT_FILES) > $@ + +export_vars.h: + $(AWK) -f $(top_srcdir)/build/make_var_export.awk $(EXPORT_FILES) > $@ + +apr.exp: exports.c export_vars.h + @echo "#! ." > $@ + @echo "* This file was AUTOGENERATED at build time." >> $@ + @echo "* Please do not edit by hand." >> $@ + $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@ + $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) export_vars.h | sed -e 's/^\#[^!]*//' | sed -e '/^$$/d' >> $@ dox: doxygen $(top_srcdir)/docs/doxygen.conf diff --git a/build/make_exports.awk b/build/make_exports.awk new file mode 100644 index 00000000000..b50768125d6 --- /dev/null +++ b/build/make_exports.awk @@ -0,0 +1,129 @@ + +BEGIN { + printf("/*\n") + printf(" * THIS FILE WAS AUTOGENERATED BY make_exports.awk\n") + printf(" *\n") + printf(" * This is an ugly hack that needs to be here, so\n") + printf(" * that libtool will link all of the APR functions\n") + printf(" * into server regardless of whether the base server\n") + printf(" * uses them.\n") + printf(" */\n") + printf("\n") + printf("#define CORE_PRIVATE\n") + printf("\n") + + for (i = 1; i < ARGC; i++) { + file = ARGV[i] + sub("([^/]*[/])*", "", file) + printf("#include \"%s\"\n", file) + } + + printf("\n") + printf("const void *ap_ugly_hack = NULL;\n") + printf("\n") + + TYPE_NORMAL = 0 + TYPE_HEADER = 1 + + stackptr = 0 +} + +function push(line) { + stack[stackptr] = line + stackptr++ +} + +function do_output() { + printf("/*\n") + printf(" * %s\n", FILENAME) + printf(" */\n") + + for (i = 0; i < stackptr; i++) { + printf("%s\n", stack[i]) + } + + stackptr = 0 + + printf("\n"); +} + +function enter_scope(type) { + scope++ + scope_type[scope] = type + scope_stack[scope] = stackptr + delete scope_used[scope] +} + +function leave_scope() { + used = scope_used[scope] + + if (!used) + stackptr = scope_stack[scope] + + scope-- + if (used) { + scope_used[scope] = 1 + + if (!scope) + do_output() + } +} + +function add_symbol(symbol) { + if (!index(symbol, "#")) { + push("const void *ap_hack_" symbol " = (const void *)" symbol ";") + scope_used[scope] = 1 + } +} + +/^[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ { + sub("[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)][ \t]*", "") + sub("[(].*", "") + sub("([^ ]* (^([ \t]*[(])))+", "") + + add_symbol($0) + next +} + +/^[ \t]*AP_DECLARE_HOOK[^(]*[(][^)]*[)]/ { + split($0, args, ",") + symbol = args[2] + sub("^[ \t]+", "", symbol) + sub("[ \t]+$", "", symbol) + + add_symbol("ap_hook_" symbol) + add_symbol("ap_hook_get_" symbol) + add_symbol("ap_run_" symbol) + next +} + +/^#[ \t]*if(ndef| !defined[(])([^_]*_)*H/ { + enter_scope(TYPE_HEADER) + next +} + +/^#[ \t]*if([n]?def)? / { + enter_scope(TYPE_NORMAL) + push($0) + next +} + +/^#[ \t]*endif/ { + if (scope_type[scope] == TYPE_NORMAL) + push($0) + + leave_scope() + next +} + +/^#[ \t]*else/ { + push($0) + next +} + +/^#[ \t]*elif/ { + push($0) + next +} + + diff --git a/build/make_export.awk b/build/make_var_export.awk similarity index 58% rename from build/make_export.awk rename to build/make_var_export.awk index a92136e772c..966e14ecc70 100644 --- a/build/make_export.awk +++ b/build/make_var_export.awk @@ -1,4 +1,5 @@ -# Based on Ryan Bloom's make_export.pl +# Based on apr's make_export.awk, which is +# based on Ryan Bloom's make_export.pl /^#[ \t]*if(def)? (AP[RU]?_|!?defined).*/ { if (old_filename != FILENAME) { @@ -12,14 +13,14 @@ macro_stack[macro_no++] = macro macro = substr($0, length($1)+2) count++ - line = line macro "\n" + line = line "#ifdef " macro "\n" next } /^#[ \t]*endif/ { if (count > 0) { count-- - line = line "/" macro "\n" + line = line "#endif /* " macro " */\n" macro = macro_stack[--macro_no] } if (count == 0) { @@ -46,18 +47,11 @@ function add_symbol (sym_name) { } } -/^[ \t]*(AP[RU]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?([A-Za-z0-9_]+)\(/ { - sub("^[ \t]*(AP[UR]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?", ""); - sub("[(].*", ""); - add_symbol($0); - next -} - -/^[ \t]*AP_DECLARE_HOOK[(][^,]+,[a-z_]+,.+[)]$/ { - split($0, args, ","); - add_symbol("ap_hook_" args[2]); - add_symbol("ap_hook_get_" args[2]); - add_symbol("ap_run_" args[2]); +/^[ \t]*AP[RU]?_DECLARE_DATA .*;$/ { + varname = $NF; + gsub( /[*;]/, "", varname); + gsub( /\[.*\]/, "", varname); + add_symbol(varname); } END { From 8ab1f57c4f783129ee60358f74dddd806943595b Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 16 Oct 2001 06:31:31 +0000 Subject: [PATCH 2427/7878] Almost forgot this... um...it hasn't rained in months, or something. :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62427 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 5032f228da5..b4474515373 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) We now create exports.c and export_vars.h, which in turn create + exports.c. From this we generate two more files with different + purposes: apr.exp - list of exported symbols; and exports.lo + (exports.o) - an object file that can be linked with an executable + to force resolution of all apr symbols. [Aaron Bannert] + *) Add the apr_thread_cond_timedwait function to the condition variable API. [Aaron Bannert] From 2de0f2e57d6efbd85757a8c97dba8e0aeedd99f4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 16 Oct 2001 12:07:57 +0000 Subject: [PATCH 2428/7878] Add support for QNX 6. (Jeff removed a bogus comment about systems without union semun defined.) Submitted by: J.T. Conklin Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62428 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ build/apr_hints.m4 | 2 ++ include/arch/unix/proc_mutex.h | 3 +-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index b4474515373..c0dae4c93c6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Add support for QNX 6. [J.T. Conklin ] + *) We now create exports.c and export_vars.h, which in turn create exports.c. From this we generate two more files with different purposes: apr.exp - list of exported symbols; and exports.lo diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 3d936990da7..43716e35582 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -168,6 +168,8 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-dec-osf*) APR_ADDTO(CPPFLAGS, [-DOSF1]) ;; + *-nto-qnx*) + ;; *-qnx) APR_ADDTO(CPPFLAGS, [-DQNX]) APR_ADDTO(LIBS, [-N128k -lunix]) diff --git a/include/arch/unix/proc_mutex.h b/include/arch/unix/proc_mutex.h index b401cd9dfe8..b99c2c7d1cd 100644 --- a/include/arch/unix/proc_mutex.h +++ b/include/arch/unix/proc_mutex.h @@ -131,11 +131,10 @@ extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_rwlock_metho #if !APR_HAVE_UNION_SEMUN && defined(APR_HAS_SYSVSEM_SERIALIZE) -/* it makes no sense, but this isn't defined on solaris */ union semun { long val; struct semid_ds *buf; - ushort *array; + unsigned short *array; }; #endif From 11b75b9c44b7f7ae521214dff4a2d4a4b6332e11 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 16 Oct 2001 12:21:53 +0000 Subject: [PATCH 2429/7878] The pipe creation code used by mod_cgi in Apache 2.0 doesn't register cleanups for either the read or the write ends of the pipe - so file handles (and event handles for pipes with asynchronous I/O mode set) are never closed. The function in question is called apr_create_nt_pipe, and the following patch fixes this (see also apr_file_pipe_create). Submitted by: Tim Costello Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62429 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ file_io/win32/pipe.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index c0dae4c93c6..940fa3c8023 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) Fix a problem in the Win32 pipe creation code called by + apr_proc_create(): It didn't register cleanups for either the + read or the write ends of the pipe, so file handles (and event + handles for pipes with asynchronous I/O mode set) are never + closed. [Tim Costello ] + *) Add support for QNX 6. [J.T. Conklin ] *) We now create exports.c and export_vars.h, which in turn create diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index a26b107eaf0..0faa5d632a0 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -230,5 +230,9 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, } } + apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), file_cleanup, + apr_pool_cleanup_null); + apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), file_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } From 9971afb93a178c2234f16f72131395a84c2cdbc2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 16 Oct 2001 12:24:33 +0000 Subject: [PATCH 2430/7878] read_with_timeout in apr/file_io/win32/readwrite.c incorrectly returned APR_SUCCESS instead of APR_EOF when PeekNamedPipe failed and the result from GetLastError() was ERROR_BROKEN_PIPE. Because of this, the pipe wasn't closed as soon as it could be. Submitted by: Tim Costello Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62430 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ file_io/win32/readwrite.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 940fa3c8023..b4058fab0d9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) read_with_timeout in apr/file_io/win32/readwrite.c incorrectly + returned APR_SUCCESS instead of APR_EOF when PeekNamedPipe failed + and the result from GetLastError() was ERROR_BROKEN_PIPE. Because + of this, the pipe wasn't closed as soon as it could be. + [Tim Costello ] + *) Fix a problem in the Win32 pipe creation code called by apr_proc_create(): It didn't register cleanups for either the read or the write ends of the pipe, so file handles (and event diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index f8e675fe0bd..c0d746d72b4 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -89,7 +89,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le &dwBytesLeftThisMsg)) { // pointer to unread bytes in this message rv = apr_get_os_error(); if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) - return APR_SUCCESS; + return APR_EOF; } else { if (dwBytesRead == 0) { From 72d2bdd7783cdbc5f92d38bbe21f3bca8687326a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 16 Oct 2001 23:13:59 +0000 Subject: [PATCH 2431/7878] Added a Winsock cleanup call required by NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62431 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/unix/start.c b/misc/unix/start.c index cc93bc1e1c3..65ee4bc2ff4 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -115,6 +115,9 @@ APR_DECLARE_NONSTD(void) apr_terminate(void) return; } apr_pool_alloc_term(global_apr_pool); +#if defined(NETWARE) + WSACleanup(); +#endif } APR_DECLARE(void) apr_terminate2(void) From 7f184788a11915235cb08a274ae6aacdf05272fb Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 16 Oct 2001 23:17:27 +0000 Subject: [PATCH 2432/7878] Apr.h for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62432 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 342 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 342 insertions(+) create mode 100644 include/apr.hnw diff --git a/include/apr.hnw b/include/apr.hnw new file mode 100644 index 00000000000..593fb794dcf --- /dev/null +++ b/include/apr.hnw @@ -0,0 +1,342 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/* + * Note: This is a NetWare specific version of apr.h. It is renamed to + * apr.h at the start of a Windows build. + */ +#ifdef NETWARE +/** + * @file netware/apr.h netware/apr.h + * @brief APR header for NetWare + */ + +/** + * @defgroup APR APR Functions + * @{ + */ + + +#ifndef APR_H +#define APR_H + + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include + + +#include + +#define _POSIX_THREAD_SAFE_FUNCTIONS 1 +#define READDIR_IS_THREAD_SAFE 1 + +#define APR_INLINE __inline +#define APR_HAS_INLINE 1 +#define __attribute__(__x) +#define ENUM_BITFIELD(e,n,w) signed int n : w + +#define APR_HAVE_ARPA_INET_H 0 +#define APR_HAVE_CONIO_H 0 +#define APR_HAVE_CRYPT_H 0 +#define APR_HAVE_CTYPE_H 1 +#define APR_HAVE_DIRENT_H 1 +#define APR_HAVE_ERRNO_H 1 +#define APR_HAVE_FCNTL_H 1 +#define APR_HAVE_IO_H 0 +#define APR_HAVE_LIMITS_H 1 +#define APR_HAVE_NETDB_H 0 +#define APR_HAVE_NETINET_IN_H 0 +#define APR_HAVE_NETINET_TCP_H 0 +#define APR_HAVE_PTHREAD_H 0 +#define APR_HAVE_SIGNAL_H 1 +#define APR_HAVE_STDARG_H 1 +#define APR_HAVE_STDINT_H 0 +#define APR_HAVE_STDIO_H 1 +#define APR_HAVE_STDLIB_H 1 +#define APR_HAVE_STRING_H 1 +#define APR_HAVE_STRINGS_H 0 +#define APR_HAVE_SYS_SENDFILE_H 0 +#define APR_HAVE_SYS_SIGNAL_H 0 +#define APR_HAVE_SYS_SOCKET_H 0 +#define APR_HAVE_SYS_SYSLIMITS_H 0 +#define APR_HAVE_SYS_TYPES_H 1 +#define APR_HAVE_SYS_UIO_H 1 +#define APR_HAVE_SYS_WAIT_H 0 +#define APR_HAVE_UNISTD_H 1 + +#define APR_USE_FLOCK_SERIALIZE 0 +#define APR_USE_SYSVSEM_SERIALIZE 0 +#define APR_USE_FCNTL_SERIALIZE 0 +#define APR_USE_PROC_PTHREAD_SERIALIZE 0 +#define APR_USE_PTHREAD_SERIALIZE 0 +#define APR_HAS_RWLOCK_SERIALIZE 0 + +#define APR_PROCESS_LOCK_IS_GLOBAL 0 + +#define APR_USES_ANONYMOUS_SHM 0 +#define APR_USES_FILEBASED_SHM 0 +#define APR_USES_KEYBASED_SHM 0 + +#define APR_FILE_BASED_SHM 0 +#define APR_MEM_BASED_SHM 0 + +#define APR_HAVE_CORKABLE_TCP 0 +#define APR_HAVE_GETRLIMIT 0 +#define APR_HAVE_IN_ADDR 1 +#define APR_HAVE_INET_ADDR 1 +#define APR_HAVE_INET_NETWORK 0 +#define APR_HAVE_IPV6 0 +#define APR_HAVE_MEMCHR 1 +#define APR_HAVE_MEMMOVE 1 +#define APR_HAVE_SETRLIMIT 0 +#define APR_HAVE_SIGACTION 0 +#define APR_HAVE_SIGWAIT 0 +#define APR_HAVE_STRCASECMP 1 +#define APR_HAVE_STRDUP 1 +#define APR_HAVE_STRICMP 1 +#define APR_HAVE_STRNCASECMP 0 +#define APR_HAVE_STRNICMP 1 +#define APR_HAVE_STRSTR 1 +#define APR_HAVE_STRUCT_RLIMIT 0 +#define APR_HAVE_UNION_SEMUN 0 + + +#if APR_HAVE_SYS_TYPES_H +#include +#endif + +/* APR Feature Macros */ +#define APR_HAS_SHARED_MEMORY 0 +#define APR_HAS_THREADS 1 +#define APR_HAS_SENDFILE 0 +#define APR_HAS_MMAP 0 +#define APR_HAS_FORK 0 +#define APR_HAS_RANDOM 0 +#define APR_HAS_XLATE 0 +#define APR_HAS_OTHER_CHILD 0 +#define APR_HAS_DSO 1 +#define APR_HAS_UNICODE_FS 0 +#define APR_HAS_USER 1 +#define APR_HAS_LARGE_FILES 1 + +/* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE + * on all platforms. + */ +#define APR_INADDR_NONE INADDR_NONE + +/* This macro indicates whether or not EBCDIC is the native character set. + */ +#define APR_CHARSET_EBCDIC 0 + +/* Typedefs that APR needs. */ + +typedef unsigned char apr_byte_t; + +typedef short apr_int16_t; +typedef unsigned short apr_uint16_t; + +typedef int apr_int32_t; +typedef unsigned int apr_uint32_t; + +typedef INT64 apr_int64_t; +typedef unsigned INT64 apr_uint64_t; + +typedef size_t apr_size_t; +typedef ssize_t apr_ssize_t; +typedef off_t apr_off_t; +typedef int apr_socklen_t; +//typedef int pid_t; +//typedef int uid_t; +//typedef int gid_t; + + +/* Mechanisms to properly type numeric literals */ + +#define APR_INT64_C(val) (val##i64) + +//srj added in here, libc c no longer takes care of these + +typedef unsigned char nuint8; +typedef unsigned short nuint16; + +#define NGetLo8(a16) ((nuint8)((nuint16)(a16) & 0xFF)) +#define NGetHi8(a16) ((nuint8)((nuint16)(a16) >> 8)) + + +#if !defined( HIBYTE ) + #define HIBYTE NGetHi8 + #endif + #if !defined( LOBYTE ) + #define LOBYTE NGetLo8 +#endif + + +/* Definitions that APR programs need to work properly. */ + +#define APR_THREAD_FUNC __stdcall + +/** + * APR_DECLARE_EXPORT is defined when building the APR dynamic library, + * so that all public symbols are exported. + * + * APR_DECLARE_STATIC is defined when including the APR public headers, + * to provide static linkage when the dynamic library may be unavailable. + * + * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when + * including the APR public headers, to import and link the symbols from the + * dynamic APR library and assure appropriate indirection and calling + * conventions at compile time. + */ + +#if !defined(WIN32) +/** + * The public APR functions are declared with APR_DECLARE(), so they may + * use the most appropriate calling convention. Public APR functions with + * variable arguments must use APR_DECLARE_NONSTD(). + * + * @deffunc APR_DECLARE(rettype) apr_func(args); + */ +#define APR_DECLARE(type) type +/** + * The public APR functions using variable arguments are declared with + * AP_DECLARE(), as they must use the C language calling convention. + * + * @deffunc APR_DECLARE_NONSTD(rettype) apr_func(args, ...); + */ +#define APR_DECLARE_NONSTD(type) type +/** + * The public APR variables are declared with AP_MODULE_DECLARE_DATA. + * This assures the appropriate indirection is invoked at compile time. + * + * @deffunc APR_DECLARE_DATA type apr_variable; + * @tip extern APR_DECLARE_DATA type apr_variable; syntax is required for + * declarations within headers to properly import the variable. + */ +#define APR_DECLARE_DATA +#elif defined(APR_DECLARE_STATIC) +#define APR_DECLARE(type) type __stdcall +#define APR_DECLARE_NONSTD(type) type +#define APR_DECLARE_DATA +#elif defined(APR_DECLARE_EXPORT) +#define APR_DECLARE(type) __declspec(dllexport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type +#define APR_DECLARE_DATA __declspec(dllexport) +#else +#define APR_DECLARE(type) __declspec(dllimport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type +#define APR_DECLARE_DATA __declspec(dllimport) +#endif + +#define APR_SSIZE_T_FMT "d" + +#define APR_SIZE_T_FMT "d" + +#define APR_OFF_T_FMT "ld" + +#define APR_OS_PROC_T_FMT "d" + +/* Local machine definition for console and log output. */ +#define APR_EOL_STR "\r\n" + +typedef int apr_wait_t; + +/* struct iovec is needed to emulate Unix writev */ +//struct iovec { +// char* iov_base; +// int iov_len; +//}; + +/* Nasty Win32 .h ommissions we really need */ +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 + +#if APR_HAS_UNICODE_FS +/* An arbitrary size that is digestable. True max is a bit less than 32000 */ +#define APR_PATH_MAX 8192 +#else /* !APR_HAS_UNICODE_FS */ +#define APR_PATH_MAX PATH_MAX +#endif + +///* These need to move into apr_compat.h when the symbol rename is complete +// */ +//#define APR_EXPORT(t) APR_DECLARE(t) +//#define APR_EXPORT_NONSTD(t) APR_DECLARE_NONSTD(t) +//#define APR_VAR_EXPORT APR_DECLARE_DATA +//#define APR_VAR_IMPORT APR_DECLARE_DATA + +#define APR_INT64_T_FMT "l64d" +#define APR_TIME_T_FMT APR_INT64_T_FMT + + +//#define apr_signal(a,b) signal(a,b) +// +//typedef int apr_wait_t; + +#endif /* APR_H */ +/** @} */ +#endif /* NETWARE */ + From 633252de146e8bfed789ecd6102ecee238d54ae6 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 16 Oct 2001 23:22:25 +0000 Subject: [PATCH 2433/7878] Moved to apr/include/apr.hnw git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62433 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr.h | 342 ------------------------------------- 1 file changed, 342 deletions(-) delete mode 100644 include/arch/netware/apr.h diff --git a/include/arch/netware/apr.h b/include/arch/netware/apr.h deleted file mode 100644 index 50a7f7072c4..00000000000 --- a/include/arch/netware/apr.h +++ /dev/null @@ -1,342 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* - * Note: This is a NetWare specific version of apr.h. It is renamed to - * apr.h at the start of a Windows build. - */ -#ifdef NETWARE -/** - * @file netware/apr.h netware/apr.h - * @brief APR header for NetWare - */ - -/** - * @defgroup APR APR Functions - * @{ - */ - - -#ifndef APR_H -#define APR_H - - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include -#include - - -#include - -#define _POSIX_THREAD_SAFE_FUNCTIONS 1 -#define READDIR_IS_THREAD_SAFE 1 - -#define APR_INLINE __inline -#define APR_HAS_INLINE 1 -#define __attribute__(__x) -#define ENUM_BITFIELD(e,n,w) signed int n : w - -#define APR_HAVE_ARPA_INET_H 0 -#define APR_HAVE_CONIO_H 0 -#define APR_HAVE_CRYPT_H 0 -#define APR_HAVE_CTYPE_H 1 -#define APR_HAVE_DIRENT_H 1 -#define APR_HAVE_ERRNO_H 1 -#define APR_HAVE_FCNTL_H 1 -#define APR_HAVE_IO_H 0 -#define APR_HAVE_LIMITS_H 1 -#define APR_HAVE_NETDB_H 0 -#define APR_HAVE_NETINET_IN_H 0 -#define APR_HAVE_NETINET_TCP_H 0 -#define APR_HAVE_PTHREAD_H 0 -#define APR_HAVE_SIGNAL_H 1 -#define APR_HAVE_STDARG_H 1 -#define APR_HAVE_STDINT_H 0 -#define APR_HAVE_STDIO_H 1 -#define APR_HAVE_STDLIB_H 1 -#define APR_HAVE_STRING_H 1 -#define APR_HAVE_STRINGS_H 0 -#define APR_HAVE_SYS_SENDFILE_H 0 -#define APR_HAVE_SYS_SIGNAL_H 0 -#define APR_HAVE_SYS_SOCKET_H 0 -#define APR_HAVE_SYS_SYSLIMITS_H 0 -#define APR_HAVE_SYS_TYPES_H 1 -#define APR_HAVE_SYS_UIO_H 1 -#define APR_HAVE_SYS_WAIT_H 0 -#define APR_HAVE_UNISTD_H 1 - -#define APR_USE_FLOCK_SERIALIZE 0 -#define APR_USE_SYSVSEM_SERIALIZE 0 -#define APR_USE_FCNTL_SERIALIZE 0 -#define APR_USE_PROC_PTHREAD_SERIALIZE 0 -#define APR_USE_PTHREAD_SERIALIZE 0 -#define APR_HAS_RWLOCK_SERIALIZE 0 - -#define APR_PROCESS_LOCK_IS_GLOBAL 0 - -#define APR_USES_ANONYMOUS_SHM 0 -#define APR_USES_FILEBASED_SHM 0 -#define APR_USES_KEYBASED_SHM 0 - -#define APR_FILE_BASED_SHM 0 -#define APR_MEM_BASED_SHM 0 - -#define APR_HAVE_CORKABLE_TCP 0 -#define APR_HAVE_GETRLIMIT 0 -#define APR_HAVE_IN_ADDR 1 -#define APR_HAVE_INET_ADDR 1 -#define APR_HAVE_INET_NETWORK 0 -#define APR_HAVE_IPV6 0 -#define APR_HAVE_MEMCHR 1 -#define APR_HAVE_MEMMOVE 1 -#define APR_HAVE_SETRLIMIT 0 -#define APR_HAVE_SIGACTION 0 -#define APR_HAVE_SIGWAIT 0 -#define APR_HAVE_STRCASECMP 1 -#define APR_HAVE_STRDUP 1 -#define APR_HAVE_STRICMP 1 -#define APR_HAVE_STRNCASECMP 0 -#define APR_HAVE_STRNICMP 1 -#define APR_HAVE_STRSTR 1 -#define APR_HAVE_STRUCT_RLIMIT 0 -#define APR_HAVE_UNION_SEMUN 0 - - -#if APR_HAVE_SYS_TYPES_H -#include -#endif - -/* APR Feature Macros */ -#define APR_HAS_SHARED_MEMORY 0 -#define APR_HAS_THREADS 1 -#define APR_HAS_SENDFILE 0 -#define APR_HAS_MMAP 0 -#define APR_HAS_FORK 0 -#define APR_HAS_RANDOM 0 -#define APR_HAS_XLATE 0 -#define APR_HAS_OTHER_CHILD 0 -#define APR_HAS_DSO 1 -#define APR_HAS_UNICODE_FS 1 -#define APR_HAS_USER 1 -#define APR_HAS_LARGE_FILES 1 - -/* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE - * on all platforms. - */ -#define APR_INADDR_NONE INADDR_NONE - -/* This macro indicates whether or not EBCDIC is the native character set. - */ -#define APR_CHARSET_EBCDIC 0 - -/* Typedefs that APR needs. */ - -typedef unsigned char apr_byte_t; - -typedef short apr_int16_t; -typedef unsigned short apr_uint16_t; - -typedef int apr_int32_t; -typedef unsigned int apr_uint32_t; - -typedef INT64 apr_int64_t; -typedef unsigned INT64 apr_uint64_t; - -typedef size_t apr_size_t; -typedef ssize_t apr_ssize_t; -typedef off_t apr_off_t; -typedef int apr_socklen_t; -//typedef int pid_t; -//typedef int uid_t; -//typedef int gid_t; - - -/* Mechanisms to properly type numeric literals */ - -#define APR_INT64_C(val) (val##i64) - -//srj added in here, libc c no longer takes care of these - -typedef unsigned char nuint8; -typedef unsigned short nuint16; - -#define NGetLo8(a16) ((nuint8)((nuint16)(a16) & 0xFF)) -#define NGetHi8(a16) ((nuint8)((nuint16)(a16) >> 8)) - - -#if !defined( HIBYTE ) - #define HIBYTE NGetHi8 - #endif - #if !defined( LOBYTE ) - #define LOBYTE NGetLo8 -#endif - - -/* Definitions that APR programs need to work properly. */ - -#define APR_THREAD_FUNC __stdcall - -/** - * APR_DECLARE_EXPORT is defined when building the APR dynamic library, - * so that all public symbols are exported. - * - * APR_DECLARE_STATIC is defined when including the APR public headers, - * to provide static linkage when the dynamic library may be unavailable. - * - * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when - * including the APR public headers, to import and link the symbols from the - * dynamic APR library and assure appropriate indirection and calling - * conventions at compile time. - */ - -#if !defined(WIN32) -/** - * The public APR functions are declared with APR_DECLARE(), so they may - * use the most appropriate calling convention. Public APR functions with - * variable arguments must use APR_DECLARE_NONSTD(). - * - * @deffunc APR_DECLARE(rettype) apr_func(args); - */ -#define APR_DECLARE(type) type -/** - * The public APR functions using variable arguments are declared with - * AP_DECLARE(), as they must use the C language calling convention. - * - * @deffunc APR_DECLARE_NONSTD(rettype) apr_func(args, ...); - */ -#define APR_DECLARE_NONSTD(type) type -/** - * The public APR variables are declared with AP_MODULE_DECLARE_DATA. - * This assures the appropriate indirection is invoked at compile time. - * - * @deffunc APR_DECLARE_DATA type apr_variable; - * @tip extern APR_DECLARE_DATA type apr_variable; syntax is required for - * declarations within headers to properly import the variable. - */ -#define APR_DECLARE_DATA -#elif defined(APR_DECLARE_STATIC) -#define APR_DECLARE(type) type __stdcall -#define APR_DECLARE_NONSTD(type) type -#define APR_DECLARE_DATA -#elif defined(APR_DECLARE_EXPORT) -#define APR_DECLARE(type) __declspec(dllexport) type __stdcall -#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type -#define APR_DECLARE_DATA __declspec(dllexport) -#else -#define APR_DECLARE(type) __declspec(dllimport) type __stdcall -#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type -#define APR_DECLARE_DATA __declspec(dllimport) -#endif - -#define APR_SSIZE_T_FMT "d" - -#define APR_SIZE_T_FMT "d" - -#define APR_OFF_T_FMT "ld" - -#define APR_OS_PROC_T_FMT "d" - -/* Local machine definition for console and log output. */ -#define APR_EOL_STR "\r\n" - -typedef int apr_wait_t; - -/* struct iovec is needed to emulate Unix writev */ -//struct iovec { -// char* iov_base; -// int iov_len; -//}; - -/* Nasty Win32 .h ommissions we really need */ -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 - -#if APR_HAS_UNICODE_FS -/* An arbitrary size that is digestable. True max is a bit less than 32000 */ -#define APR_PATH_MAX 8192 -#else /* !APR_HAS_UNICODE_FS */ -#define APR_PATH_MAX MAX_PATH -#endif - -///* These need to move into apr_compat.h when the symbol rename is complete -// */ -//#define APR_EXPORT(t) APR_DECLARE(t) -//#define APR_EXPORT_NONSTD(t) APR_DECLARE_NONSTD(t) -//#define APR_VAR_EXPORT APR_DECLARE_DATA -//#define APR_VAR_IMPORT APR_DECLARE_DATA - -#define APR_INT64_T_FMT "l64d" -#define APR_TIME_T_FMT APR_INT64_T_FMT - - -//#define apr_signal(a,b) signal(a,b) -// -//typedef int apr_wait_t; - -#endif /* APR_H */ -/** @} */ -#endif /* NETWARE */ - From 2057f2890363fd47740165ab625f620d08832ebb Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 16 Oct 2001 23:24:09 +0000 Subject: [PATCH 2434/7878] Added the default file attributes for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62434 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 820e8452755..b13f5b3c5ac 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -84,8 +84,12 @@ static apr_filetype_e filetype_from_mode(mode_t mode) static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, apr_int32_t wanted) { +#ifdef NETWARE + finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK; +#else finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK | APR_FINFO_OWNER | APR_FINFO_PROT; +#endif finfo->protection = apr_unix_mode2perms(info->st_mode); finfo->filetype = filetype_from_mode(info->st_mode); finfo->user = info->st_uid; From ef92e106278fe10db2194d019e184bb8a615ada1 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Wed, 17 Oct 2001 00:33:00 +0000 Subject: [PATCH 2435/7878] Added a new parameter to apr_thread_mutex_init(). Mutexes are now by default not nested, but an init flag can enable them. I added a new test to testlockperf to show how much faster non-nested mutexes are. I also updated calls to apr_thread_mutex_init() wherever I could find them. This patch only implements this for Unix (nested locks already existed on Unix, so this patch just optionally enables/disables them). I did my best to change the function declaration on other platforms, but someone will have to double check me. Those other platforms will also have to either enable nested locks (sometimes available in their thread library) or just do what Unix does. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62435 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++ include/apr_thread_mutex.h | 8 +++++ include/arch/unix/thread_mutex.h | 1 + locks/beos/thread_mutex.c | 1 + locks/netware/thread_mutex.c | 2 ++ locks/os2/thread_mutex.c | 2 ++ locks/unix/thread_mutex.c | 50 ++++++++++++++++---------- locks/win32/thread_mutex.c | 3 ++ test/testlock.c | 8 ++--- test/testlockperf.c | 61 ++++++++++++++++++++++++++++++-- 10 files changed, 117 insertions(+), 25 deletions(-) diff --git a/CHANGES b/CHANGES index b4058fab0d9..b5fed2c2770 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) Added a new parameter to apr_thread_mutex_init(). Now, by default, + thread mutexes are not nested (sometimes called "recursive"). To + enable nested mutexes, a flag must be passed to the init script. + Non-nested mutexes are much faster than nested ones. + [Aaron Bannert] + *) read_with_timeout in apr/file_io/win32/readwrite.c incorrectly returned APR_SUCCESS instead of APR_EOF when PeekNamedPipe failed and the result from GetLastError() was ERROR_BROKEN_PIPE. Because diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 6e7b434b381..2861ae0d624 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -78,13 +78,21 @@ extern "C" { typedef struct apr_thread_mutex_t apr_thread_mutex_t; +#define APR_THREAD_MUTEX_DEFAULT 0x0 +#define APR_THREAD_MUTEX_NESTED 0x1 + /** * Create and initialize a mutex that can be used to synchronize threads. * @param mutex the memory address where the newly created mutex will be * stored. + * @param flags Or'ed value of: + *
    + *           APR_THREAD_MUTEX_NESTED    enable nested (recursive) locks.
    + * 
    * @param pool the pool from which to allocate the mutex. */ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, + unsigned int flags, apr_pool_t *pool); /** * Acquire the lock for the given mutex. If the mutex is already locked, diff --git a/include/arch/unix/thread_mutex.h b/include/arch/unix/thread_mutex.h index 71815e2677a..8ce05a22ba3 100644 --- a/include/arch/unix/thread_mutex.h +++ b/include/arch/unix/thread_mutex.h @@ -71,6 +71,7 @@ struct apr_thread_mutex_t { pthread_mutex_t mutex; apr_os_thread_t owner; int owner_ref; + char nested; /* a boolean */ }; #endif diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index b99a0096c96..054464f05c4 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -66,6 +66,7 @@ static apr_status_t thread_mutex_cleanup(void *data) } APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, + unsigned int flags, apr_pool_t *pool) { return APR_ENOTIMPL; diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index d672ac70fbc..a38ce429ba8 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -68,6 +68,7 @@ static apr_status_t thread_mutex_cleanup(void *data) } APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, + unsigned int flags, apr_pool_t *pool) { apr_thread_mutex_t *new_mutex = NULL; @@ -79,6 +80,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, } new_mutex->pool = pool; + /* FIXME: only use recursive locks if (flags & APR_THREAD_MUTEX_NESTED) */ new_mutex->mutex = NXMutexAlloc(NX_MUTEX_RECURSIVE, NULL, NULL); if(new_mutex->mutex == NULL) diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index 3d46d2a55d3..6565afcd8e7 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -70,6 +70,7 @@ static apr_status_t thread_mutex_cleanup(void *themutex) APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, + unsigned int flags, apr_pool_t *pool) { apr_thread_mutex_t *new_mutex; @@ -78,6 +79,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, new_mutex = (apr_thread_mutex_t *)apr_palloc(pool, sizeof(apr_thread_mutex_t)); new_mutex->pool = pool; + /* FIXME: Can OS/2 do nested (aka recursive) locks natively? */ rc = DosCreateMutexSem(NULL, &(new_mutex->hMutex), 0, FALSE); *mutex = new_mutex; diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 4509ba3ee05..c58233a9fc7 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -74,6 +74,7 @@ static apr_status_t thread_mutex_cleanup(void *data) } APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, + unsigned int flags, apr_pool_t *pool) { apr_thread_mutex_t *new_mutex; @@ -88,6 +89,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, } new_mutex->pool = pool; + new_mutex->nested = flags & APR_THREAD_MUTEX_NESTED; if ((stat = pthread_mutexattr_init(&mattr))) { #ifdef PTHREAD_SETS_ERRNO @@ -128,10 +130,12 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) #if APR_HAS_THREADS apr_os_thread_t my_thrid; /* save one call to apr_os_thread_current() */ - if (apr_os_thread_equal(mutex->owner, - (my_thrid = apr_os_thread_current()))) { - mutex->owner_ref++; - return APR_SUCCESS; + if (mutex->nested) { + if (apr_os_thread_equal(mutex->owner, + (my_thrid = apr_os_thread_current()))) { + mutex->owner_ref++; + return APR_SUCCESS; + } } #endif @@ -144,8 +148,10 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) } #if APR_HAS_THREADS - mutex->owner = my_thrid; - mutex->owner_ref = 1; + if (mutex->nested) { + mutex->owner = my_thrid; + mutex->owner_ref = 1; + } #endif return stat; @@ -158,10 +164,12 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) #if APR_HAS_THREADS apr_os_thread_t my_thrid; /* save one call to apr_os_thread_current() */ - if (apr_os_thread_equal(mutex->owner, - (my_thrid = apr_os_thread_current()))) { - mutex->owner_ref++; - return APR_SUCCESS; + if (mutex->nested) { + if (apr_os_thread_equal(mutex->owner, + (my_thrid = apr_os_thread_current()))) { + mutex->owner_ref++; + return APR_SUCCESS; + } } #endif @@ -178,8 +186,10 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) } #if APR_HAS_THREADS - mutex->owner = my_thrid; - mutex->owner_ref = 1; + if (mutex->nested) { + mutex->owner = my_thrid; + mutex->owner_ref = 1; + } #endif return stat; @@ -190,10 +200,12 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) apr_status_t status; #if APR_HAS_THREADS - if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { - mutex->owner_ref--; - if (mutex->owner_ref > 0) - return APR_SUCCESS; + if (mutex->nested) { + if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { + mutex->owner_ref--; + if (mutex->owner_ref > 0) + return APR_SUCCESS; + } } #endif @@ -206,8 +218,10 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) } #if APR_HAS_THREADS - memset(&mutex->owner, 0, sizeof mutex->owner); - mutex->owner_ref = 0; + if (mutex->nested) { + memset(&mutex->owner, 0, sizeof mutex->owner); + mutex->owner_ref = 0; + } #endif return status; diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 9246dbd6dfb..386ea1de7ec 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -69,11 +69,14 @@ static apr_status_t thread_mutex_cleanup(void *data) } APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, + unsigned int flags, apr_pool_t *pool) { (*mutex) = (apr_thread_mutex_t *)apr_palloc(pool, sizeof(**mutex)); (*mutex)->pool = pool; + /* FIXME: Implement nested (aka recursive) locks or use a native + * win32 implementation if available. */ InitializeCriticalSection(&(*mutex)->section); apr_pool_cleanup_register((*mutex)->pool, (*mutex), thread_mutex_cleanup, apr_pool_cleanup_null); diff --git a/test/testlock.c b/test/testlock.c index cac60ce0f13..6d964f26616 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -408,7 +408,7 @@ apr_status_t test_thread_mutex(void) printf("thread_mutex test\n"); printf("%-60s", " Initializing the mutex"); - s1 = apr_thread_mutex_create(&thread_mutex, pool); + s1 = apr_thread_mutex_create(&thread_mutex, APR_THREAD_MUTEX_DEFAULT, pool); if (s1 != APR_SUCCESS) { printf("Failed!\n"); @@ -505,7 +505,7 @@ apr_status_t test_cond(void) printf("thread_cond Tests\n"); printf("%-60s", " Initializing the first apr_thread_mutex_t"); - s1 = apr_thread_mutex_create(&put.mutex, pool); + s1 = apr_thread_mutex_create(&put.mutex, APR_THREAD_MUTEX_DEFAULT, pool); if (s1 != APR_SUCCESS) { printf("Failed!\n"); return s1; @@ -513,7 +513,7 @@ apr_status_t test_cond(void) printf("OK\n"); printf("%-60s", " Initializing the second apr_thread_mutex_t"); - s1 = apr_thread_mutex_create(&nready.mutex, pool); + s1 = apr_thread_mutex_create(&nready.mutex, APR_THREAD_MUTEX_DEFAULT, pool); if (s1 != APR_SUCCESS) { printf("Failed!\n"); return s1; @@ -579,7 +579,7 @@ apr_status_t test_timeoutcond(void) printf("thread_cond_timedwait Tests\n"); printf("%-60s", " Initializing the first apr_thread_mutex_t"); - s = apr_thread_mutex_create(&timeout_mutex, pool); + s = apr_thread_mutex_create(&timeout_mutex, APR_THREAD_MUTEX_DEFAULT, pool); if (s != APR_SUCCESS) { printf("Failed!\n"); return s; diff --git a/test/testlockperf.c b/test/testlockperf.c index a35175c97f3..697977a3b00 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -205,7 +205,7 @@ int test_thread_mutex(void) printf("apr_thread_mutex_t Tests\n"); printf("%-60s", " Initializing the apr_thread_mutex_t"); - s1 = apr_thread_mutex_create(&thread_lock, pool); + s1 = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, pool); if (s1 != APR_SUCCESS) { printf("Failed!\n"); return s1; @@ -245,6 +245,55 @@ int test_thread_mutex(void) return APR_SUCCESS; } +int test_thread_mutex_nested(void) +{ + apr_thread_t *t1, *t2, *t3, *t4; + apr_status_t s1, s2, s3, s4; + apr_time_t time_start, time_stop; + + mutex_counter = 0; + + printf("apr_thread_mutex_t Tests\n"); + printf("%-60s", " Initializing the apr_thread_mutex_t (NESTED)"); + s1 = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_NESTED, pool); + if (s1 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + apr_thread_mutex_lock(thread_lock); + /* set_concurrency(4)? -aaron */ + printf("%-60s"," Starting all the threads"); + s1 = apr_thread_create(&t1, NULL, thread_mutex_func, NULL, pool); + s2 = apr_thread_create(&t2, NULL, thread_mutex_func, NULL, pool); + s3 = apr_thread_create(&t3, NULL, thread_mutex_func, NULL, pool); + s4 = apr_thread_create(&t4, NULL, thread_mutex_func, NULL, pool); + if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || + s3 != APR_SUCCESS || s4 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + time_start = apr_time_now(); + apr_thread_mutex_unlock(thread_lock); + + /* printf("%-60s", " Waiting for threads to exit"); */ + apr_thread_join(&s1, t1); + apr_thread_join(&s2, t2); + apr_thread_join(&s3, t3); + apr_thread_join(&s4, t4); + /* printf("OK\n"); */ + + time_stop = apr_time_now(); + printf("microseconds: %" APR_INT64_T_FMT " usec\n", + (time_stop - time_start)); + if (mutex_counter != MAX_COUNTER * 4) + printf("error: counter = %ld\n", mutex_counter); + + return APR_SUCCESS; +} int test_inter_rwlock(void) { apr_thread_t *t1, *t2, *t3, *t4; @@ -389,16 +438,22 @@ int main(int argc, const char * const *argv) exit(-3); } + if ((rv = test_thread_mutex_nested()) != APR_SUCCESS) { + fprintf(stderr,"thread_mutex (NESTED) test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-4); + } + if ((rv = test_inter_rwlock()) != APR_SUCCESS) { fprintf(stderr,"apr_lock(INTRAPROCESS, READWRITE) test failed : [%d] %s\n", rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-2); + exit(-5); } if ((rv = test_thread_rwlock()) != APR_SUCCESS) { fprintf(stderr,"thread_rwlock test failed : [%d] %s\n", rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-3); + exit(-6); } return 0; From 3fe339f457b46d44be6f07e7322732895de516da Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 17 Oct 2001 01:14:52 +0000 Subject: [PATCH 2436/7878] Remove FIXME comment. Yes, OS/2 native locks support nesting. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62436 13f79535-47bb-0310-9956-ffa450edef68 --- locks/os2/thread_mutex.c | 1 - 1 file changed, 1 deletion(-) diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index 6565afcd8e7..543b602dad5 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -79,7 +79,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, new_mutex = (apr_thread_mutex_t *)apr_palloc(pool, sizeof(apr_thread_mutex_t)); new_mutex->pool = pool; - /* FIXME: Can OS/2 do nested (aka recursive) locks natively? */ rc = DosCreateMutexSem(NULL, &(new_mutex->hMutex), 0, FALSE); *mutex = new_mutex; From 49fdaf40fd400ec7771d4b8f4cf099b54e1543f0 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 17 Oct 2001 22:47:17 +0000 Subject: [PATCH 2437/7878] Implemented two functions for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62437 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index fd4b3ea136a..b6a3805eff5 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -77,13 +77,11 @@ static apr_status_t pipeblock(apr_file_t *thepipe) int err; unsigned long flags; -#ifdef TBD if (!(err = NXGetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, &flags))) { flags &= ~NX_O_NONBLOCK; err = NXSetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, flags); } -#endif if (err) return convert_error (err); @@ -97,13 +95,11 @@ static apr_status_t pipenonblock(apr_file_t *thepipe) int err; unsigned long flags; -#ifdef TBD if (!(err = NXGetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, &flags))) { flags |= NX_O_NONBLOCK; err = NXSetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, flags); } -#endif if (err) return convert_error (err); From 38dacb87c302aa5a868571d2867191e72a32f4b5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 18 Oct 2001 15:44:02 +0000 Subject: [PATCH 2438/7878] If building with VPATH, then we have to install the headers from the build directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62438 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.in b/Makefile.in index 904d3115417..4638f7f801e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -40,6 +40,7 @@ libdir=@libdir@ includedir=@includedir@ srcdir=@srcdir@ top_srcdir=@top_srcdir@ +top_blddir=@top_builddir@ EXPORT_FILES = $(top_srcdir)/include/*.h @@ -58,6 +59,7 @@ install: $(TARGET_LIB) $(top_srcdir)/build/mkdir.sh $(includedir); \ fi; \ cp $(top_srcdir)/include/*.h $(includedir); \ + cp $(top_blddir)/include/*.h $(includedir); \ if [ ! -d $(libdir) ]; then \ $(top_srcdir)/build/mkdir.sh $(libdir); \ fi; \ From 19b8f612350372f068ed7fc5682f80b4043d38ac Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 18 Oct 2001 22:08:40 +0000 Subject: [PATCH 2439/7878] Added NETWARE to the #if defined list git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62439 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/mktemp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 68156c3fc9c..df83ece99ab 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -91,7 +91,7 @@ #ifndef HAVE_MKSTEMP -#if defined(SVR4) || defined(WIN32) +#if defined(SVR4) || defined(WIN32) || defined(NETWARE) #ifdef SVR4 #include #endif From 5e7d514f1f3dda33bdb01032e096284a144e1d6d Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 18 Oct 2001 22:10:09 +0000 Subject: [PATCH 2440/7878] Removed HAVE_MKSTEMP from the NetWare build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62440 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_private.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 253b9c2b896..61de0fdcee7 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -86,7 +86,6 @@ #define HAVE_STDLIB_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_FCNTL_H 1 -#define HAVE_MKSTEMP 1 #define HAVE_STRICMP 1 #define HAVE_STRNICMP 1 From 4f2e9588a52e63db937ce5805f3e852ca3c78aac Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 19 Oct 2001 13:36:59 +0000 Subject: [PATCH 2441/7878] Solve Win32 byteranges (horray!) Thank you httpd-test'ers --- your first Win32 'catch' :))) [And I was blaming the testbench ... it works rather well now, actually] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62441 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index 5f175d070d6..374f66334b0 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -337,7 +337,7 @@ typedef struct apr_lock_t apr_lock_t; #define APR_SIZE_T_FMT "d" -#define APR_OFF_T_FMT "ld" +#define APR_OFF_T_FMT "I64d" #define APR_OS_PROC_T_FMT "d" From c44dab33066feb35f051b2a82ba63b8ef43aef57 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 19 Oct 2001 19:25:03 +0000 Subject: [PATCH 2442/7878] Scripts for configuring the build environment on NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62442 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_nw_export.awk | 113 +++++++++++++++++++++++++++++++++++++++ build/prebuildNW.bat | 25 +++++++++ 2 files changed, 138 insertions(+) create mode 100644 build/make_nw_export.awk create mode 100755 build/prebuildNW.bat diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk new file mode 100644 index 00000000000..317e4bc7c36 --- /dev/null +++ b/build/make_nw_export.awk @@ -0,0 +1,113 @@ +# Based on apr's make_export.awk, which is +# based on Ryan Bloom's make_export.pl + +# List of functions that we don't support, yet?? +/apr_##name##_set_inherit/{next} +/apr_##name##_unset_inherit/{next} +/apr_compare_groups/{next} +/apr_compare_users/{next} +/apr_find_pool/{next} +/apr_generate_random_bytes/{next} +/apr_lock_create_np/{next} +/apr_md5_set_xlate/{next} +/apr_mmap_create/{next} +/apr_mmap_delete/{next} +/apr_mmap_offset/{next} +/apr_os_thread_get/{next} +/apr_os_thread_put/{next} +/apr_pool_free_blocks_num_bytes/{next} +/apr_pool_join/{next} +/apr_pool_num_bytes/{next} +/apr_proc_mutex_child_init/{next} +/apr_proc_mutex_create/{next} +/apr_proc_mutex_create_np/{next} +/apr_proc_mutex_destroy/{next} +/apr_proc_mutex_lock/{next} +/apr_proc_mutex_trylock/{next} +/apr_proc_mutex_unlock/{next} +/apr_proc_other_child_check/{next} +/apr_proc_other_child_read/{next} +/apr_proc_other_child_register/{next} +/apr_proc_other_child_unregister/{next} +/apr_sendfile/{next} +/apr_shm_avail/{next} +/apr_shm_calloc/{next} +/apr_shm_destroy/{next} +/apr_shm_free/{next} +/apr_shm_init/{next} +/apr_shm_malloc/{next} +/apr_shm_name_get/{next} +/apr_shm_name_set/{next} +/apr_shm_open/{next} +/apr_signal/{next} +/apr_signal_thread/{next} +/apr_socket_from_file/{next} +/apr_thread_once/{next} +/apr_thread_once_init/{next} +/apr_xlate_close/{next} +/apr_xlate_conv_buffer/{next} +/apr_xlate_conv_byte/{next} +/apr_xlate_conv_char/{next} +/apr_xlate_get_sb/{next} +/apr_xlate_open/{next} +/apr_brigade_consume/{next} +/apr_bucket_mmap_create/{next} +/apr_bucket_mmap_make/{next} +/apr_bucket_type_mmap/{next} +/apr_md4_set_xlate/{next} +#/XML_ParserFree/{next} +#/XML_ParserCreate/{next} +#/XML_SetUserData/{next} +#/XML_SetElementHandler/{next} +#/XML_SetCharacterDataHandler/{next} +#/XML_Parse/{next} +#/XML_GetErrorCode/{next} +#/XML_ErrorString/{next} + + +function add_symbol (sym_name) { + if (count) { + found++ + } +# for (i = 0; i < count; i++) { +# line = line "\t" +# } + line = line sym_name ",\n" + + if (count == 0) { + printf(" %s", line) + line = "" + } +} + +/^[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ { + sub("[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)][ \t]*", "") + sub("[(].*", "") + sub("([^ ]* (^([ \t]*[(])))+", "") + + add_symbol($0) + next +} + +/^[ \t]*AP_DECLARE_HOOK[^(]*[(][^)]*[)]/ { + split($0, args, ",") + symbol = args[2] + sub("^[ \t]+", "", symbol) + sub("[ \t]+$", "", symbol) + + add_symbol("ap_hook_" symbol) + add_symbol("ap_hook_get_" symbol) + add_symbol("ap_run_" symbol) + next +} + +/^[ \t]*AP[RU]?_DECLARE_DATA .*;$/ { + varname = $NF; + gsub( /[*;]/, "", varname); + gsub( /\[.*\]/, "", varname); + add_symbol(varname); +} + +#END { +# printf(" %s", line) +#} diff --git a/build/prebuildNW.bat b/build/prebuildNW.bat new file mode 100755 index 00000000000..9bdd3d56692 --- /dev/null +++ b/build/prebuildNW.bat @@ -0,0 +1,25 @@ +# As part of the pre-build process, the utility GenURI.NLM +# (Gen URI Delims) must be built, copied to a NetWare server +# and run using the following command: +# +# genuri >uri_delims.h +# +# The file "sys:\uri_delims.h" must then be copied to +# "apr-util\uri\uri_delims.h" on the build machine. + +# Fix up the APR headers +copy ..\include\apr.hnw ..\include\apr.h + +# Fix up the APR-Util headers +copy ..\..\apr-util\include\apu.h.in ..\..\apr-util\include\apu.h +copy ..\..\apr-util\include\private\apu_config.hw ..\..\apr-util\include\private\apu_config.h +copy ..\..\apr-util\xml\expat\lib\expat.h.in ..\..\apr-util\xml\expat\lib\expat.h +copy ..\..\apr-util\include\private\apu_select_dbm.hw ..\..\apr-util\include\private\apu_select_dbm.h + +# Fix up the pcre headers +copy ..\..\pcre\config.hw ..\..\pcre\config.h +copy ..\..\pcre\pcre.hw ..\..\pcre\pcre.h + +# Generate the import list +awk95 -f make_nw_export.awk ..\include\*.h |sort > ..\misc\netware\aprlib.imp +awk95 -f make_nw_export.awk ..\..\apr-util\include\*.h |sort > ..\misc\netware\aprutil.imp \ No newline at end of file From 5f150e5e760c228ee0c16828f4cc4e24f0315580 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 19 Oct 2001 19:26:26 +0000 Subject: [PATCH 2443/7878] Added the expat global defines git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62443 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/pre_nw.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/misc/netware/pre_nw.h b/misc/netware/pre_nw.h index 6a3d99c45d9..582ad42830f 100644 --- a/misc/netware/pre_nw.h +++ b/misc/netware/pre_nw.h @@ -37,6 +37,17 @@ typedef unsigned long long uint64_t; #define __int64 long long #endif +/* expat version */ +#define VERSION "expat_1.95.1" +#define EXPAT_MAJOR_VERSION 1 +#define EXPAT_MINOR_VERSION 95 +#define EXPAT_EDIT 2 + +#define XML_MAJOR_VERSION EXPAT_MAJOR_VERSION +#define XML_MINOR_VERSION EXPAT_MINOR_VERSION +#define XML_MICRO_VERSION EXPAT_EDIT + + #endif From deb2e3a41a9b6ff9b13e6bfa249f3d621e75b6fe Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 19 Oct 2001 19:27:43 +0000 Subject: [PATCH 2444/7878] Added the export definitions for the linker git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62444 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/aprlib.def | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/netware/aprlib.def b/misc/netware/aprlib.def index 5661dc6b705..f4ecbae5bc0 100644 --- a/misc/netware/aprlib.def +++ b/misc/netware/aprlib.def @@ -1,3 +1,4 @@ MODULE LIBC.NLM MODULE WS2_32.NLM -EXPORT @aprlib.imp \ No newline at end of file +EXPORT @aprlib.imp +EXPORT @aprutil.imp From 978653b25ef9cd49c7092377b77ad6808998f5fd Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 19 Oct 2001 19:28:55 +0000 Subject: [PATCH 2445/7878] No longer needed. This file is generated by make_nw_export.awk. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62445 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/aprlib.imp | 316 ---------------------------------------- 1 file changed, 316 deletions(-) delete mode 100644 misc/netware/aprlib.imp diff --git a/misc/netware/aprlib.imp b/misc/netware/aprlib.imp deleted file mode 100644 index 8bb7a3bda3e..00000000000 --- a/misc/netware/aprlib.imp +++ /dev/null @@ -1,316 +0,0 @@ - apr_accept, - apr_ansi_time_to_apr_time, - apr_array_append, - apr_array_cat, - apr_array_copy, - apr_array_copy_hdr, - apr_array_make, - apr_array_pstrcat, - apr_array_push, - apr_bind, - apr_collapse_spaces, - #apr_compare_groups, - #apr_compare_users, - apr_connect, - apr_cpystrn, - apr_ctime, - apr_current_userid, - apr_dir_close, - apr_dir_make, - apr_dir_open, - apr_dir_read, - apr_dir_remove, - apr_dir_rewind, - apr_dso_error, - apr_dso_load, - apr_dso_sym, - apr_dso_unload, - apr_explode_gmt, - apr_explode_localtime, - apr_explode_time, - apr_file_close, - apr_file_data_get, - apr_file_data_set, - apr_file_dup, - apr_file_eof, - apr_file_flags_get, - apr_file_flush, - apr_file_getc, - apr_file_gets, - apr_file_info_get, - apr_file_lock, - apr_file_name_get, - apr_file_namedpipe_create, - apr_file_open, - apr_file_open_stderr, - apr_file_open_stdin, - apr_file_open_stdout, - apr_file_perms_set, - apr_file_pipe_create, - apr_file_pipe_timeout_get, - apr_file_pipe_timeout_set, - apr_file_printf, - apr_file_putc, - apr_file_puts, - apr_file_read, - apr_file_read_full, - apr_file_remove, - apr_file_rename, - apr_file_seek, - apr_file_set_inherit, - apr_file_trunc, - apr_file_ungetc, - apr_file_unlock, - apr_file_unset_inherit, - apr_file_write, - apr_file_write_full, - apr_file_writev, - apr_filename_of_pathname, - apr_filepath_get, - apr_filepath_merge, - apr_filepath_root, - apr_filepath_set, - #apr_find_pool, - apr_fnmatch, - #apr_generate_random_bytes, - apr_get_groupname, - apr_get_home_directory, - apr_get_userid, - apr_get_username, - apr_gethostname, - apr_getnameinfo, - apr_getopt, - apr_getopt_init, - apr_getopt_long, - apr_getservbyname, - apr_getsocketopt, - apr_hash_count, - apr_hash_first, - apr_hash_get, - apr_hash_make, - apr_hash_next, - apr_hash_overlay, - apr_hash_pool_get, - apr_hash_set, - apr_hash_this, - apr_implode_gmt, - apr_implode_time, - apr_initialize, - apr_ipsubnet_create, - apr_ipsubnet_test, - apr_is_fnmatch, - apr_itoa, - apr_listen, - apr_lock_acquire, - apr_lock_acquire_rw, - apr_lock_child_init, - apr_lock_create, - #apr_lock_create_np, - apr_lock_data_get, - apr_lock_data_set, - apr_lock_destroy, - apr_lock_release, - apr_lock_tryacquire, - apr_lstat, - apr_ltoa, - apr_md5, - apr_md5_encode, - apr_md5_final, - apr_md5_init, - #apr_md5_set_xlate, - apr_md5_update, - #apr_mmap_create, - #apr_mmap_delete, - #apr_mmap_offset, - apr_off_t_toa, - apr_os_dir_get, - apr_os_dir_put, - apr_os_dso_handle_get, - apr_os_dso_handle_put, - apr_os_exp_time_get, - apr_os_exp_time_put, - apr_os_file_get, - apr_os_file_put, - apr_os_imp_time_get, - apr_os_imp_time_put, - apr_os_lock_get, - apr_os_lock_put, - apr_os_sock_get, - apr_os_sock_make, - apr_os_sock_put, - apr_os_thread_current, - apr_os_thread_equal, - #apr_os_thread_get, - #apr_os_thread_put, - apr_os_threadkey_get, - apr_os_threadkey_put, - apr_palloc, - apr_parse_addr_port, - apr_password_get, - apr_password_validate, - apr_pcalloc, - apr_pmemdup, - apr_poll, - apr_poll_data_get, - apr_poll_data_set, - apr_poll_revents_get, - apr_poll_setup, - apr_poll_socket_add, - apr_poll_socket_clear, - apr_poll_socket_mask, - apr_poll_socket_remove, - apr_pool_alloc_init, - apr_pool_alloc_term, - apr_pool_child_cleanup_set, - apr_pool_cleanup_for_exec, - apr_pool_cleanup_kill, - apr_pool_cleanup_null, - apr_pool_cleanup_register, - apr_pool_cleanup_run, - apr_pool_clear, - apr_pool_create, - apr_pool_destroy, - #apr_pool_free_blocks_num_bytes, - apr_pool_get_abort, - apr_pool_get_parent, - apr_pool_is_ancestor, - #apr_pool_join, - apr_pool_note_subprocess, - #apr_pool_num_bytes, - apr_pool_set_abort, - apr_pool_sub_make, - apr_pool_userdata_get, - apr_pool_userdata_set, - apr_proc_create, - apr_proc_fork, - apr_proc_kill, - #apr_proc_other_child_check, - #apr_proc_other_child_read, - #apr_proc_other_child_register, - #apr_proc_other_child_unregister, - apr_proc_wait, - apr_proc_wait_all_procs, - apr_procattr_child_err_set, - apr_procattr_child_in_set, - apr_procattr_child_out_set, - apr_procattr_cmdtype_set, - apr_procattr_create, - apr_procattr_detach_set, - apr_procattr_dir_set, - apr_procattr_io_set, - apr_procattr_limit_set, - apr_psprintf, - apr_pstrcat, - apr_pstrdup, - apr_pstrndup, - apr_pvsprintf, - apr_recv, - apr_recvfrom, - apr_rfc822_date, - apr_send, - #apr_sendfile, - apr_sendto, - apr_sendv, - apr_setsocketopt, - apr_setup_signal_thread, - #apr_shm_avail, - #apr_shm_calloc, - #apr_shm_destroy, - #apr_shm_free, - #apr_shm_init, - #apr_shm_malloc, - #apr_shm_name_get, - #apr_shm_name_set, - #apr_shm_open, - apr_shutdown, - #apr_signal, - apr_signal_get_description, - #apr_signal_thread, - apr_sleep, - apr_snprintf, - apr_sockaddr_info_get, - apr_sockaddr_ip_get, - apr_sockaddr_ip_set, - apr_sockaddr_port_get, - apr_sockaddr_port_set, - apr_socket_addr_get, - apr_socket_close, - apr_socket_create, - apr_socket_data_get, - apr_socket_data_set, - #apr_socket_from_file, - apr_socket_set_inherit, - apr_socket_unset_inherit, - apr_stat, - apr_strerror, - apr_strfsize, - apr_strftime, - apr_strnatcasecmp, - apr_strnatcmp, - apr_strtok, - apr_table_add, - apr_table_addn, - apr_table_clear, - apr_table_copy, - apr_table_do, - apr_table_get, - apr_table_make, - apr_table_merge, - apr_table_mergen, - apr_table_overlap, - apr_table_overlay, - apr_table_set, - apr_table_setn, - apr_table_unset, - apr_table_vdo, - apr_terminate, - apr_terminate2, - apr_thread_cond_create, - apr_thread_cond_wait, - apr_thread_cond_signal, - apr_thread_cond_broadcast, - apr_thread_cond_destroy, - apr_thread_create, - apr_thread_data_get, - apr_thread_data_set, - apr_thread_detach, - apr_thread_exit, - apr_thread_join, - #apr_thread_once, - #apr_thread_once_init, - apr_thread_yield, - apr_thread_mutex_create, - apr_thread_mutex_lock, - apr_thread_mutex_trylock, - apr_thread_mutex_unlock, - apr_thread_mutex_destroy, - apr_thread_rwlock_create, - apr_thread_rwlock_rdlock, - apr_thread_rwlock_tryrdlock, - apr_thread_rwlock_wrlock, - apr_thread_rwlock_trywrlock, - apr_thread_rwlock_unlock, - apr_thread_rwlock_destroy, - apr_threadattr_create, - apr_threadattr_detach_get, - apr_threadattr_detach_set, - apr_threadkey_data_get, - apr_threadkey_data_set, - apr_threadkey_private_create, - apr_threadkey_private_delete, - apr_threadkey_private_get, - apr_threadkey_private_set, - apr_time_now, - apr_tokenize_to_argv, - apr_uuid_format, - apr_uuid_get, - apr_uuid_parse, - apr_vformatter, - apr_vsnprintf, - #apr_xlate_close, - #apr_xlate_conv_buffer, - #apr_xlate_conv_byte, - #apr_xlate_conv_char, - #apr_xlate_get_sb, - #apr_xlate_open, - From c8d8660d73b59984086ec665cf9100671bee1d4a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 19 Oct 2001 19:42:14 +0000 Subject: [PATCH 2446/7878] NLM startup code git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62446 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/libprews.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 misc/netware/libprews.c diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c new file mode 100644 index 00000000000..100e2f30818 --- /dev/null +++ b/misc/netware/libprews.c @@ -0,0 +1,25 @@ +/*------------------------------------------------------------------ + These functions are to be called when the shared NLM starts and + stops. By using these functions instead of defining a main() + and calling ExitThread(TSR_THREAD, 0), the load time of the + shared NLM is faster and memory size reduced. + + You may also want to override these in your own Apache module + to do any cleanup other than the mechanism Apache modules + provide. +------------------------------------------------------------------*/ +#include "stddef.h" +#include "ws2nlm.h" + +int _lib_start_ws() +{ + WSADATA wsaData; + + return WSAStartup((WORD) MAKEWORD(2, 0), &wsaData); +} + +int _lib_stop_ws() +{ + WSACleanup(); + return 0; +} From 1f3525e9f9bacdb70a680925d6ce74e3890e4f75 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Fri, 19 Oct 2001 23:25:28 +0000 Subject: [PATCH 2447/7878] Implement portable accessors for proc mutex. These are equivalent to apr_os_lock_get/set, but they work for apr_proc_mutex_t types instead. I did my best to implement these on non-Unix platforms from how I saw them implemented for apr_os_lock_get/set, but on those platforms they are untested. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62447 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 37 +++++++++++++++++++++++++++++++++---- locks/beos/proc_mutex.c | 27 +++++++++++++++++++++++++++ locks/netware/proc_mutex.c | 25 +++++++++++++++++++++++++ locks/os2/proc_mutex.c | 25 +++++++++++++++++++++++++ locks/unix/proc_mutex.c | 35 +++++++++++++++++++++++++++++++++++ locks/win32/proc_mutex.c | 25 +++++++++++++++++++++++++ 6 files changed, 170 insertions(+), 4 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 4888a26dffb..e9dec39677b 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -75,6 +75,7 @@ #include "apr_network_io.h" #include "apr_errno.h" #include "apr_lock.h" +#include "apr_proc_mutex.h" #include "apr_time.h" #include "apr_dso.h" @@ -97,7 +98,9 @@ extern "C" { typedef HANDLE apr_os_file_t; typedef HANDLE apr_os_dir_t; typedef SOCKET apr_os_sock_t; +/* We're deprecating apr_lock_t, so apr_os_lock_t will be gone too. */ typedef HANDLE apr_os_lock_t; +typedef HANDLE apr_os_proc_mutex_t; typedef HANDLE apr_os_thread_t; typedef PROCESS_INFORMATION apr_os_proc_t; typedef DWORD apr_os_threadkey_t; @@ -109,7 +112,9 @@ typedef HANDLE apr_os_dso_handle_t; typedef HFILE apr_os_file_t; typedef HDIR apr_os_dir_t; typedef int apr_os_sock_t; +/* We're deprecating apr_lock_t, so apr_os_lock_t will be gone too. */ typedef HMTX apr_os_lock_t; +typedef HMTX apr_os_proc_mutex_t; typedef TID apr_os_thread_t; typedef PID apr_os_proc_t; typedef PULONG apr_os_threadkey_t; @@ -121,7 +126,7 @@ typedef HMODULE apr_os_dso_handle_t; #include #include -struct apr_os_lock_t { +struct apr_os_proc_mutex_t { sem_id sem; int32 ben; }; @@ -129,7 +134,9 @@ struct apr_os_lock_t { typedef int apr_os_file_t; typedef DIR apr_os_dir_t; typedef int apr_os_sock_t; -typedef struct apr_os_lock_t apr_os_lock_t; +/* We're deprecating apr_lock_t, so apr_os_lock_t will be gone too. */ +typedef struct apr_os_proc_mutex_t apr_os_lock_t; +typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_t; typedef thread_id apr_os_thread_t; typedef thread_id apr_os_proc_t; typedef int apr_os_threadkey_t; @@ -141,7 +148,9 @@ typedef image_id apr_os_dso_handle_t; typedef int apr_os_file_t; typedef DIR apr_os_dir_t; typedef int apr_os_sock_t; +/* We're deprecating apr_lock_t, so apr_os_lock_t will be gone too. */ typedef NXMutex_t apr_os_lock_t; +typedef NXMutex_t apr_os_proc_mutex_t; typedef NXThreadId_t apr_os_thread_t; typedef long apr_os_proc_t; typedef NXKey_t apr_os_threadkey_t; @@ -154,7 +163,7 @@ typedef void * apr_os_dso_handle_t; * denominator typedefs for all UNIX-like systems. :) */ -struct apr_os_lock_t { +struct apr_os_proc_mutex_t { #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE int crossproc; #endif @@ -172,7 +181,9 @@ struct apr_os_lock_t { typedef int apr_os_file_t; typedef DIR apr_os_dir_t; typedef int apr_os_sock_t; -typedef struct apr_os_lock_t apr_os_lock_t; +/* We're deprecating apr_lock_t, so apr_os_lock_t will be gone too. */ +typedef struct apr_os_proc_mutex_t apr_os_lock_t; +typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_t; #if APR_HAS_THREADS && APR_HAVE_PTHREAD_H typedef pthread_t apr_os_thread_t; typedef pthread_key_t apr_os_threadkey_t; @@ -245,6 +256,14 @@ APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock); +/** + * Convert the proc mutex from os specific type to apr type + * @param ospmutex The os specific proc mutex we are converting to. + * @param pmutex The apr proc mutex to convert. + */ +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex); + /** * Get the exploded time in the platforms native format. * @param ostime the native time format @@ -373,6 +392,16 @@ APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont); +/** + * Convert the proc mutex from os specific type to apr type + * @param pmutex The apr proc mutex we are converting to. + * @param ospmutex The os specific proc mutex to convert. + * @param cont The pool to use if it is needed. + */ +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, + apr_os_proc_mutex_t *ospmutex, + apr_pool_t *cont); + /** * Put the imploded time in the APR format. * @param aprtime the APR time format diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index 32ac2ee7f37..c5209831fef 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -104,3 +104,30 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) +/* Implement OS-specific accessors defined in apr_portable.h */ + +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex) +{ + ospmutex->sem = pmutex->Lock; + ospmutex->ben = pmutex->LockCount; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, + apr_os_proc_mutex_t *ospmutex, + apr_pool_t *pool) +{ + if (pool == NULL) { + return APR_ENOPOOL; + } + if ((*pmutex) == NULL) { + (*pmutex) = (apr_proc_mutex_t *)apr_pcalloc(pool, + sizeof(apr_proc_mutex_t)); + (*pmutex)->pool = pool; + } + (*pmutex)->Lock = ospmutex->sem; + (*pmutex)->LockCount = ospmutex->ben; + return APR_SUCCESS; +} + diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 1d1143d529a..b8d02663ca5 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -103,3 +103,28 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) +/* Implement OS-specific accessors defined in apr_portable.h */ + +apr_status_t apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex) +{ + ospmutex = pmutex->mutex; + return APR_SUCCESS; +} + +apr_status_t apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, + apr_os_proc_mutex_t *ospmutex, + apr_pool_t *pool) +{ + if (pool == NULL) { + return APR_ENOPOOL; + } + if ((*pmutex) == NULL) { + (*pmutex) = (apr_proc_mutex_t *)apr_palloc(pool, + sizeof(apr_proc_mutex_t)); + (*pmutex)->pool = pool; + } + (*pmutex)->mutex = ospmutex; + return APR_SUCCESS; +} + diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 0811d374603..a881181e645 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -106,3 +106,28 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) +/* Implement OS-specific accessors defined in apr_portable.h */ + +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex) +{ + *ospmutex = pmutex->hMutex; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, + apr_os_proc_mutex_t *ospmutex, + apr_pool_t *pool) +{ + if (pool == NULL) { + return APR_ENOPOOL; + } + if ((*pmutex) == NULL) { + (*pmutex) = (apr_proc_mutex_t *)apr_pcalloc(pool, + sizeof(apr_proc_mutex_t)); + (*pmutex)->pool = pool; + } + (*pmutex)->hMutex = *ospmutex; + return APR_SUCCESS; +} + diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 80d9c664fc9..c58e7148aad 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -810,3 +810,38 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) +/* Implement OS-specific accessors defined in apr_portable.h */ + +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex) +{ +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE + ospmutex->crossproc = pmutex->interproc->filedes; +#endif +#if APR_HAS_PROC_PTHREAD_SERIALIZE + ospmutex->pthread_interproc = pmutex->pthread_interproc; +#endif + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, + apr_os_proc_mutex_t *ospmutex, + apr_pool_t *pool) +{ + if (pool == NULL) { + return APR_ENOPOOL; + } + if ((*pmutex) == NULL) { + (*pmutex) = (apr_proc_mutex_t *)apr_pcalloc(pool, + sizeof(apr_proc_mutex_t)); + (*pmutex)->pool = pool; + } +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE + apr_os_file_put(&(*pmutex)->interproc, &ospmutex->crossproc, pool); +#endif +#if APR_HAS_PROC_PTHREAD_SERIALIZE + (*pmutex)->pthread_interproc = ospmutex->pthread_interproc; +#endif + return APR_SUCCESS; +} + diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 3d8e2f20c1a..54167e1d279 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -103,3 +103,28 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) +/* Implement OS-specific accessors defined in apr_portable.h */ + +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *lock) +{ + *ospmutex = pmutex->mutex; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, + apr_os_proc_mutex_t *ospmutex, + apr_pool_t *pool) +{ + if (pool == NULL) { + return APR_ENOPOOL; + } + if ((*pmutex) == NULL) { + (*pmutex) = (apr_proc_mutex_t *)apr_palloc(pool, + sizeof(apr_proc_mutex_t)); + (*pmutex)->pool = pool; + } + (*pmutex)->mutex = *ospmutex; + return APR_SUCCESS; +} + From 9609563e619b883f1c82a666762e5ed178c935bd Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Fri, 19 Oct 2001 23:27:57 +0000 Subject: [PATCH 2448/7878] Come on Aaron, you can think of a better commit log message than this! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62448 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index b5fed2c2770..228e8c7be5b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Implement portable accessors for proc mutex. These are equivalent + to apr_os_lock_get/set, but they work for apr_proc_mutex_t types + instead. [Aaron Bannert] + *) Added a new parameter to apr_thread_mutex_init(). Now, by default, thread mutexes are not nested (sometimes called "recursive"). To enable nested mutexes, a flag must be passed to the init script. From 31202bea2f7ab5cbfcf924eb7354df5d04d02cf3 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 20 Oct 2001 17:40:31 +0000 Subject: [PATCH 2449/7878] add apr_os_dso_handle_put for win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62449 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 8d647074042..d07cc0b43af 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -59,6 +59,16 @@ #if APR_HAS_DSO +APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, + apr_os_dso_handle_t osdso, + apr_pool_t *pool) +{ + *aprdso = apr_pcalloc(pool, sizeof **aprdso); + (*aprdso)->handle = osdso; + (*aprdso)->cont = pool; + return APR_SUCCESS; +} + static apr_status_t dso_cleanup(void *thedso) { apr_dso_handle_t *dso = thedso; From 4618d961fce445312b5ae77b40af5fc98a680bdd Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 21 Oct 2001 03:32:01 +0000 Subject: [PATCH 2450/7878] OS/2: need -lbsd to get random() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62450 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index fd92f4088c9..7e68b7243df 100644 --- a/configure.in +++ b/configure.in @@ -205,6 +205,7 @@ case $host in *-os2*) APR_ADDTO(CPPFLAGS,-DOS2) APR_ADDTO(CFLAGS,-Zmt) + AC_CHECK_LIB(bsd, random) OSDIR="os2" enable_threads="system_threads" eolstr="\\r\\n" From 4e5f78ab91795de9e5cc0463b06d0d68231d0d94 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 21 Oct 2001 03:48:15 +0000 Subject: [PATCH 2451/7878] OS/2: Return a proper error code from apr_dso_sym() & prevent NULL dereference in apr_dso_error() if called after a failure in apr_dso_sym(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62451 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os2/dso.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/dso/os2/dso.c b/dso/os2/dso.c index 2b0a1cde939..b6c53adf597 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -118,8 +118,10 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, if (symname == NULL || ressym == NULL) return APR_EINIT; - if ((rc = DosQueryProcAddr(handle->handle, 0, symname, &func)) != 0) - return APR_EINIT; + if ((rc = DosQueryProcAddr(handle->handle, 0, symname, &func)) != 0) { + handle->load_error = APR_FROM_OS_ERROR(rc); + return handle->load_error; + } *ressym = func; return APR_SUCCESS; @@ -131,9 +133,13 @@ APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr { char message[200]; apr_strerror(dso->load_error, message, sizeof(message)); - strcat(message, " ("); - strcat(message, dso->failed_module); - strcat(message, ")"); + + if (dso->failed_module != NULL) { + strcat(message, " ("); + strcat(message, dso->failed_module); + strcat(message, ")"); + } + apr_cpystrn(buffer, message, buflen); return buffer; } From 5647e9cc89ad0f875913011186ffb82e28e2d4d2 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Mon, 22 Oct 2001 08:30:08 +0000 Subject: [PATCH 2452/7878] Stop using the name of a standard system function for a variable. Remove minor optimizations that were causing compile warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62452 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_mutex.c | 92 +++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 52 deletions(-) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index c58233a9fc7..41d512ed172 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -61,16 +61,16 @@ static apr_status_t thread_mutex_cleanup(void *data) { apr_thread_mutex_t *mutex = (apr_thread_mutex_t *)data; - apr_status_t stat; + apr_status_t rv; pthread_mutex_unlock(&mutex->mutex); - stat = pthread_mutex_destroy(&mutex->mutex); + rv = pthread_mutex_destroy(&mutex->mutex); #ifdef PTHREAD_SETS_ERRNO - if (stat) { - stat = errno; + if (rv) { + rv = errno; } #endif - return stat; + return rv; } APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, @@ -79,7 +79,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, { apr_thread_mutex_t *new_mutex; pthread_mutexattr_t mattr; - apr_status_t stat; + apr_status_t rv; new_mutex = (apr_thread_mutex_t *)apr_pcalloc(pool, sizeof(apr_thread_mutex_t)); @@ -91,28 +91,28 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, new_mutex->pool = pool; new_mutex->nested = flags & APR_THREAD_MUTEX_NESTED; - if ((stat = pthread_mutexattr_init(&mattr))) { + if ((rv = pthread_mutexattr_init(&mattr))) { #ifdef PTHREAD_SETS_ERRNO - stat = errno; + rv = errno; #endif thread_mutex_cleanup(new_mutex); - return stat; + return rv; } - if ((stat = pthread_mutex_init(&new_mutex->mutex, &mattr))) { + if ((rv = pthread_mutex_init(&new_mutex->mutex, &mattr))) { #ifdef PTHREAD_SETS_ERRNO - stat = errno; + rv = errno; #endif thread_mutex_cleanup(new_mutex); - return stat; + return rv; } - if ((stat = pthread_mutexattr_destroy(&mattr))) { + if ((rv = pthread_mutexattr_destroy(&mattr))) { #ifdef PTHREAD_SETS_ERRNO - stat = errno; + rv = errno; #endif thread_mutex_cleanup(new_mutex); - return stat; + return rv; } apr_pool_cleanup_register(new_mutex->pool, @@ -125,74 +125,62 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { - apr_status_t stat; + apr_status_t rv; #if APR_HAS_THREADS - apr_os_thread_t my_thrid; /* save one call to apr_os_thread_current() */ - - if (mutex->nested) { - if (apr_os_thread_equal(mutex->owner, - (my_thrid = apr_os_thread_current()))) { - mutex->owner_ref++; - return APR_SUCCESS; - } + if (mutex->nested && apr_os_thread_equal(mutex->owner, + apr_os_thread_current())) { + mutex->owner_ref++; + return APR_SUCCESS; } #endif - stat = pthread_mutex_lock(&mutex->mutex); - if (stat) { + rv = pthread_mutex_lock(&mutex->mutex); + if (rv) { #ifdef PTHREAD_SETS_ERRNO - stat = errno; + rv = errno; #endif - return stat; + return rv; } #if APR_HAS_THREADS if (mutex->nested) { - mutex->owner = my_thrid; + mutex->owner = apr_os_thread_current(); mutex->owner_ref = 1; } #endif - return stat; + return rv; } APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { - apr_status_t stat; + apr_status_t rv; #if APR_HAS_THREADS - apr_os_thread_t my_thrid; /* save one call to apr_os_thread_current() */ - - if (mutex->nested) { - if (apr_os_thread_equal(mutex->owner, - (my_thrid = apr_os_thread_current()))) { - mutex->owner_ref++; - return APR_SUCCESS; - } + if (mutex->nested && apr_os_thread_equal(mutex->owner, + apr_os_thread_current())) { + mutex->owner_ref++; + return APR_SUCCESS; } #endif - stat = pthread_mutex_trylock(&mutex->mutex); - if (stat) { + rv = pthread_mutex_trylock(&mutex->mutex); + if (rv) { #ifdef PTHREAD_SETS_ERRNO - stat = errno; + rv = errno; #endif - /* Normalize the return code. */ - if (stat == EBUSY) - stat = APR_EBUSY; - - return stat; + return (rv == EBUSY) ? APR_EBUSY : rv; } #if APR_HAS_THREADS if (mutex->nested) { - mutex->owner = my_thrid; + mutex->owner = apr_os_thread_current(); mutex->owner_ref = 1; } #endif - return stat; + return rv; } APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) @@ -229,12 +217,12 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) { - apr_status_t stat; - if ((stat = thread_mutex_cleanup(mutex)) == APR_SUCCESS) { + apr_status_t rv; + if ((rv = thread_mutex_cleanup(mutex)) == APR_SUCCESS) { apr_pool_cleanup_kill(mutex->pool, mutex, thread_mutex_cleanup); return APR_SUCCESS; } - return stat; + return rv; } APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex) From 7e4fdcfc5feb191ca7925b5ff1813d1f3a708096 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 22 Oct 2001 15:17:39 +0000 Subject: [PATCH 2453/7878] Code Warrior project file for building APR for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62453 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 0 -> 120900 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 libaprnw.mcp.zip diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip new file mode 100644 index 0000000000000000000000000000000000000000..1959c1a80cd13ae7069e6c5fd7e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##p1Wu-Ev zyHN=URN);|k*y>;Z#Lp5_q=IK$H93t5%F^1qnf!-s}M{1^Le3{bNp>uPtv6VWimu} zD!;{`XK*j<`_y$z@GA)Vss?w?&(tV32l88J_|)EK9Gr-hOyizD8oKtZ+%ZW1@_5)Q zMYQ*q*{C;I({CymoMGtFfJa6Hrs(WMB@bb>4BSc(j3`%E+8s>*Q0f(7VSj@tm z*`mAb*h4D@8_E42%lg&c2ekPv;q7;gGtH?a7uLV$i-97kLf!-yW7-fK={gf0K5L-* zQ<-S_<+V-9cxc405h~OiiT^G9soj;GYm*T@K2?L>z`u%w)XDSVu*UdE=ZOpw->Bes z@dO`w!v-v}AG99?0__4Fd2X+x@qXXq@55k_LWewPkFfOrk3*ownEydOkMG|L2=WWl Z_w@+4VIwZ_zcR4!G! Date: Mon, 22 Oct 2001 15:56:51 +0000 Subject: [PATCH 2454/7878] Get the apr.exp target working under Solaris make. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62454 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.in b/Makefile.in index 4638f7f801e..e82af931e0a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,7 @@ # # APR (Apache Portable Runtime) library Makefile. # +CPP = @CPP@ # # Macros for supporting directories From 9f23fe9ea452b9bf800898095a23fbf6847bef57 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 23 Oct 2001 17:30:08 +0000 Subject: [PATCH 2455/7878] Fix the reporting for child processes that die. This removes all of the non-portable W* macros from Apache. Submitted by: Jeff Trawick and Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62455 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++++ include/apr_thread_proc.h | 52 +++++++++++++++++++++++++++++---------- memory/unix/apr_pools.c | 4 +-- test/testproc.c | 2 +- test/testprocmutex.c | 8 +++--- test/testsock.c | 16 ++++++------ threadproc/beos/proc.c | 10 +++++--- threadproc/netware/proc.c | 13 ++++++---- threadproc/os2/proc.c | 13 +++++----- threadproc/unix/proc.c | 39 +++++++++++++++++++++-------- threadproc/win32/proc.c | 4 +-- 11 files changed, 111 insertions(+), 55 deletions(-) diff --git a/CHANGES b/CHANGES index 228e8c7be5b..2d6d8856f48 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Re-vamp the apr_proc_wait and apr_proc_wait_all functions. We + now return the exit code from the program and a reason that the + program died, either normal exit or signalled. + [Jeff Trawick and Ryan Bloom] + *) Implement portable accessors for proc mutex. These are equivalent to apr_os_lock_get/set, but they work for apr_proc_mutex_t types instead. [Aaron Bannert] diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 4b6dcba585d..43590c897a3 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -81,6 +81,17 @@ extern "C" { typedef enum {APR_SHELLCMD, APR_PROGRAM} apr_cmdtype_e; typedef enum {APR_WAIT, APR_NOWAIT} apr_wait_how_e; +/* I am specifically calling out the values so that the macros below make + * more sense. Yes, I know I don't need to, but I am hoping this makes what + * I am doing more clear. If you want to add more reasons to exit, continue + * to use bitmasks. + */ +typedef enum {APR_PROC_EXIT = 1, APR_PROC_SIGNAL = 2, + APR_PROC_SIGNAL_CORE = 4} apr_exit_why_e; + +#define APR_PROC_CHECK_EXIT(x) (x & APR_PROC_EXIT) +#define APR_PROC_CHECK_SIGNALED(x) (x & APR_PROC_SIGNAL) +#define APR_PROC_CHECK_CORE_DUMP(x) (x & APR_PROC_SIGNAL_CORE) #define APR_NO_PIPE 0 #define APR_FULL_BLOCK 1 @@ -481,11 +492,17 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc, /** * Wait for a child process to die * @param proc The process handle that corresponds to the desired child process - * @param exitcode The returned exit status of the child, if a child process - * dies. On platforms that don't support obtaining this - * information, the exitcode parameter will be returned as - * APR_ENOTIMPL. This parameter may be NULL if the exit code - * is not needed. + * @param exitcode The returned exit status of the child, if a child process + * dies, or the signal that caused the child to die. + * On platforms that don't support obtaining this information, + * the status parameter will be returned as APR_ENOTIMPL. + * @param exitwhy Why the child died, the bitwise or of: + *
    + *            APR_PROC_EXIT         -- process terminated normally
    + *            APR_PROC_SIGNAL       -- process was killed by a signal
    + *            APR_PROC_SIGNAL_CORE  -- process was killed by a signal, and
    + *                                     generated a core dump.
    + * 
    * @param waithow How should we wait. One of: *
      *            APR_WAIT   -- block until the child process dies.
    @@ -498,8 +515,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc,
      *            APR_CHILD_NOTDONE  -- child is still running.
      * 
    */ -APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, - apr_wait_t *exitcode, +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, + int *exitcode, apr_exit_why_e *exitwhy, apr_wait_how_e waithow); /** @@ -507,9 +524,17 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, * about that child. * @param proc Pointer to NULL on entry, will be filled out with child's * information - * @param status The returned exit status of the child, if a child process dies - * On platforms that don't support obtaining this information, - * the status parameter will be returned as APR_ENOTIMPL. + * @param exitcode The returned exit status of the child, if a child process + * dies, or the signal that caused the child to die. + * On platforms that don't support obtaining this information, + * the status parameter will be returned as APR_ENOTIMPL. + * @param exitwhy Why the child died, the bitwise or of: + *
    + *            APR_PROC_EXIT         -- process terminated normally
    + *            APR_PROC_SIGNAL       -- process was killed by a signal
    + *            APR_PROC_SIGNAL_CORE  -- process was killed by a signal, and
    + *                                     generated a core dump.
    + * 
    * @param waithow How should we wait. One of: *
      *            APR_WAIT   -- block until the child process dies.
    @@ -519,9 +544,10 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
      * @param p Pool to allocate child information out of.
      */
     APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,
    -                                             apr_wait_t *status,
    -                                             apr_wait_how_e waithow,
    -                                             apr_pool_t *p);
    +                                                  int *exitcode,
    +                                                  apr_exit_why_e *exitwhy,
    +                                                  apr_wait_how_e waithow,
    +                                                  apr_pool_t *p);
     
     /**
      * Detach the process from the controlling terminal.
    diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
    index 4147ebdb6ef..fd0ba05cb25 100644
    --- a/memory/unix/apr_pools.c
    +++ b/memory/unix/apr_pools.c
    @@ -1505,7 +1505,7 @@ static void free_proc_chain(struct process_chain *procs)
     #ifndef NEED_WAITPID
         /* Pick up all defunct processes */
         for (p = procs; p; p = p->next) {
    -        if (apr_proc_wait(p->pid, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE) {
    +        if (apr_proc_wait(p->pid, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE) {
                 p->kill_how = kill_never;
             }
         }
    @@ -1550,7 +1550,7 @@ static void free_proc_chain(struct process_chain *procs)
         /* Now wait for all the signaled processes to die */
         for (p = procs; p; p = p->next) {
     	if (p->kill_how != kill_never) {
    -	    (void) apr_proc_wait(p->pid, NULL, APR_WAIT);
    +	    (void) apr_proc_wait(p->pid, NULL, NULL, APR_WAIT);
     	}
         }
     #ifdef WIN32
    diff --git a/test/testproc.c b/test/testproc.c
    index 780ea0a092f..d6f2e37cd88 100644
    --- a/test/testproc.c
    +++ b/test/testproc.c
    @@ -142,7 +142,7 @@ int main(int argc, char *argv[])
         else printf( "Read failed.\n");
     
         TEST_NEQ("Waiting for child to die",
    -             apr_proc_wait(&newproc, NULL, APR_WAIT),
    +             apr_proc_wait(&newproc, NULL, NULL, APR_WAIT),
                  APR_CHILD_DONE, "OK", "Failed")   
         STD_TEST_NEQ("Removing directory", apr_dir_remove("proctest", pool))
     
    diff --git a/test/testprocmutex.c b/test/testprocmutex.c
    index bfe8739b8de..92f62e2b328 100644
    --- a/test/testprocmutex.c
    +++ b/test/testprocmutex.c
    @@ -126,10 +126,10 @@ static apr_status_t test_exclusive(const char *lockname)
         printf("OK\n");
      
         printf("%-60s", "    Waiting for processes to exit");
    -    s1 = apr_proc_wait(p1, NULL, APR_WAIT);
    -    s2 = apr_proc_wait(p2, NULL, APR_WAIT);
    -    s3 = apr_proc_wait(p3, NULL, APR_WAIT);
    -    s4 = apr_proc_wait(p4, NULL, APR_WAIT);
    +    s1 = apr_proc_wait(p1, NULL, NULL, APR_WAIT);
    +    s2 = apr_proc_wait(p2, NULL, NULL, APR_WAIT);
    +    s3 = apr_proc_wait(p3, NULL, NULL, APR_WAIT);
    +    s4 = apr_proc_wait(p4, NULL, NULL, APR_WAIT);
         printf("OK\n");
      
         if ((*x) != MAX_COUNTER) {
    diff --git a/test/testsock.c b/test/testsock.c
    index 2e805926800..d5b177a97df 100644
    --- a/test/testsock.c
    +++ b/test/testsock.c
    @@ -96,18 +96,18 @@ static int run_basic_test(apr_pool_t *context)
             exit(-1);
         }
     
    -    while ((s1 = apr_proc_wait(&proc1, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE && 
    -           (s2 = apr_proc_wait(&proc2, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE) {
    +    while ((s1 = apr_proc_wait(&proc1, NULL, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE && 
    +           (s2 = apr_proc_wait(&proc2, NULL, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE) {
             continue;
         }
     
         if (s1 == APR_SUCCESS) {
             apr_proc_kill(&proc2, SIGTERM);
    -        while (apr_proc_wait(&proc2, NULL, APR_WAIT) == APR_CHILD_NOTDONE);
    +        while (apr_proc_wait(&proc2, NULL, NULL, APR_WAIT) == APR_CHILD_NOTDONE);
         }
         else {
             apr_proc_kill(&proc1, SIGTERM);
    -        while (apr_proc_wait(&proc1, NULL, APR_WAIT) == APR_CHILD_NOTDONE);
    +        while (apr_proc_wait(&proc1, NULL, NULL, APR_WAIT) == APR_CHILD_NOTDONE);
         }
         fprintf(stdout, "Network test completed.\n");   
     
    @@ -163,18 +163,18 @@ static int run_sendfile(apr_pool_t *context, int number)
             exit(-1);
         }
     
    -    while ((s1 = apr_proc_wait(&proc1, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE && 
    -           (s2 = apr_proc_wait(&proc2, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE) {
    +    while ((s1 = apr_proc_wait(&proc1, NULL, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE && 
    +           (s2 = apr_proc_wait(&proc2, NULL, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE) {
             continue;
         }
     
         if (s1 == APR_SUCCESS) {
             apr_proc_kill(&proc2, SIGTERM);
    -        while (apr_proc_wait(&proc2, NULL, APR_WAIT) == APR_CHILD_NOTDONE);
    +        while (apr_proc_wait(&proc2, NULL, NULL, APR_WAIT) == APR_CHILD_NOTDONE);
         }
         else {
             apr_proc_kill(&proc1, SIGTERM);
    -        while (apr_proc_wait(&proc1, NULL, APR_WAIT) == APR_CHILD_NOTDONE);
    +        while (apr_proc_wait(&proc1, NULL, NULL, APR_WAIT) == APR_CHILD_NOTDONE);
         }
         fprintf(stdout, "Network test completed.\n");   
     
    diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c
    index 3f0476a7606..6f58f24b74e 100644
    --- a/threadproc/beos/proc.c
    +++ b/threadproc/beos/proc.c
    @@ -280,7 +280,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
         return APR_SUCCESS;
     }
     
    -APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status,
    +APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,
    +                                                  int *exitcode,
    +                                                  apr_exit_why_e *exitwhy,
                                               apr_wait_how_e waithow, apr_pool_t *p)
     {
         int waitpid_options = WUNTRACED;
    @@ -298,9 +300,9 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *
         return errno;
     } 
     
    -APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, 
    -                                        apr_wait_t *exitcode,
    -                                        apr_wait_how_e wait)
    +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
    +                                        int *exitcode, apr_exit_why_e *exitwhy,
    +                                        apr_wait_how_e waithow)
     {
         status_t rv;
     
    diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c
    index a537f765165..494b2662024 100644
    --- a/threadproc/netware/proc.c
    +++ b/threadproc/netware/proc.c
    @@ -372,8 +372,11 @@ apr_status_t apr_proc_create(apr_proc_t *new,
         return APR_SUCCESS;
     }
     
    -apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status,
    -                              apr_wait_how_e waithow, apr_pool_t *p)
    +APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,
    +                                                  int *exitcode,
    +                                                  apr_exit_why_e *exitwhy,
    +                                                  apr_wait_how_e waithow,
    +                                                  apr_pool_t *p)
     {
     #if 0
         int waitpid_options = WUNTRACED;
    @@ -392,9 +395,9 @@ apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status,
         return errno;
     } 
     
    -apr_status_t apr_proc_wait(apr_proc_t *proc, 
    -                           apr_wait_t *exitcode,
    -                           apr_wait_how_e waithow)
    +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
    +                                        int *exitcode, apr_exit_why_e *exitwhy,
    +                                        apr_wait_how_e waithow)
     {
     #if 0
         pid_t status;
    diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c
    index f092e671660..1195506a356 100644
    --- a/threadproc/os2/proc.c
    +++ b/threadproc/os2/proc.c
    @@ -496,10 +496,11 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname
         return status;
     }
     
    -
    -
    -APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status,
    -                                                  apr_wait_how_e waithow, apr_pool_t *p)
    +APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,
    +                                                  int *exitcode,
    +                                                  apr_exit_why_e *exitwhy,
    +                                                  apr_wait_how_e waithow,
    +                                                  apr_pool_t *p)
     {
         RESULTCODES codes;
         ULONG rc;
    @@ -527,8 +528,8 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *
     
     
     APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
    -                                        apr_wait_t *exitcode,
    -                                        apr_wait_how_e wait)
    +                                        int *exitcode, apr_exit_why_e *exitwhy,
    +                                        apr_wait_how_e waithow)
     {
         RESULTCODES codes;
         ULONG rc;
    diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
    index 894f36ea307..736b7269690 100644
    --- a/threadproc/unix/proc.c
    +++ b/threadproc/unix/proc.c
    @@ -362,37 +362,56 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
     }
     
     APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, 
    -                                                  apr_wait_t *status,
    +                                                  int *exitcode,
    +                                                  apr_exit_why_e *exitwhy,
                                                       apr_wait_how_e waithow, 
                                                       apr_pool_t *p)
     {
         proc->pid = -1;
    -    return apr_proc_wait(proc, status, waithow);
    +    return apr_proc_wait(proc, exitcode, exitwhy, waithow);
     } 
     
     APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, 
    -                                        apr_wait_t *exitcode,
    +                                        int *exitcode, apr_exit_why_e *exitwhy,
                                             apr_wait_how_e waithow)
     {
         pid_t pstatus;
         int waitpid_options = WUNTRACED;
         int exit_int;
    +    int ignore;
    +    apr_exit_why_e ignorewhy;
    +
    +    if (exitcode == NULL) {
    +        exitcode = &ignore;
    +    }
    +    if (exitwhy == NULL) {
    +        exitwhy = &ignorewhy;
    +    }
     
         if (waithow != APR_WAIT) {
             waitpid_options |= WNOHANG;
         }
         
         if ((pstatus = waitpid(proc->pid, &exit_int, waitpid_options)) > 0) {
    -        if (proc->pid == -1) {
    -            proc->pid = pstatus;
    -        }
    +        proc->pid = pstatus;
             if (WIFEXITED(exit_int)) {
    -            if (exitcode != NULL) {
    -                *exitcode = WEXITSTATUS(exit_int);
    +            *exitwhy = APR_PROC_EXIT;
    +            *exitcode = WEXITSTATUS(exit_int);
    +        }
    +        else if (WIFSIGNALED(exit_int)) {
    +            *exitwhy = APR_PROC_SIGNAL;
    +#ifdef WCOREDUMP
    +            if (WCOREDUMP(exit_int)) {
    +                *exitwhy |= APR_PROC_SIGNAL_CORE;
                 }
    -            return APR_CHILD_DONE;
    +#endif
    +            *exitcode = WTERMSIG(exit_int);
             }
    -        return APR_CHILD_NOTDONE;
    +        else {
    +            /* unexpected condition */
    +            return APR_EGENERAL;
    +        }
    +        return APR_CHILD_DONE;
         }
         else if (pstatus == 0) {
             return APR_CHILD_NOTDONE;
    diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c
    index 97d5e62128e..ed53d1fbfb8 100644
    --- a/threadproc/win32/proc.c
    +++ b/threadproc/win32/proc.c
    @@ -541,8 +541,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
     }
     
     APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
    -                                        apr_wait_t *exitcode, 
    -                                        apr_wait_how_e wait)
    +                                        int *exitcode, apr_exit_why_e *exitwhy,
    +                                        apr_wait_how_e waithow)
     {
         DWORD stat;
         DWORD time;
    
    From 50044dcabffdf534a4f40c86caa814e4e924f719 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 23 Oct 2001 17:46:56 +0000
    Subject: [PATCH 2456/7878] return the error that caused the operation to fail,
     not the current errno, since that could have been set due to some cleanup
     which didn't work (like trying to close a file that was never opened in the
     first place)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62456 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/unix/proc_mutex.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c
    index c58e7148aad..d4396bb7d56 100644
    --- a/locks/unix/proc_mutex.c
    +++ b/locks/unix/proc_mutex.c
    @@ -401,7 +401,7 @@ static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex,
      
         if (rv != APR_SUCCESS) {
             proc_mutex_fcntl_cleanup(new_mutex);
    -        return errno;
    +        return rv;
         }
     
         new_mutex->curr_locked = 0;
    
    From 5550df985917dbc3dddd60b21788bfe622a72456 Mon Sep 17 00:00:00 2001
    From: Bill Stoddard 
    Date: Tue, 23 Oct 2001 17:56:42 +0000
    Subject: [PATCH 2457/7878] Win32: Fix compile break caused by last patch to
     proc.c
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62457 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/win32/proc.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c
    index ed53d1fbfb8..7749ad215d0 100644
    --- a/threadproc/win32/proc.c
    +++ b/threadproc/win32/proc.c
    @@ -550,7 +550,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
         if (!proc)
             return APR_ENOPROC;
     
    -    if (wait == APR_WAIT)
    +    if (waithow == APR_WAIT)
             time = INFINITE;
         else
             time = 0;
    
    From affb437c25e53474c03d4e6de08eaec0edef6f83 Mon Sep 17 00:00:00 2001
    From: Aaron Bannert 
    Date: Tue, 23 Oct 2001 19:48:29 +0000
    Subject: [PATCH 2458/7878] It is dangerous to use the identifier "stat" when
     there is a function of the same name. Renaming "stat" to "rv".
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62458 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/unix/proc_mutex.c | 134 ++++++++++++++++++++--------------------
     1 file changed, 67 insertions(+), 67 deletions(-)
    
    diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c
    index d4396bb7d56..9d1e8fe7418 100644
    --- a/locks/unix/proc_mutex.c
    +++ b/locks/unix/proc_mutex.c
    @@ -88,21 +88,21 @@ static apr_status_t proc_mutex_sysv_create(apr_proc_mutex_t *new_mutex,
                                                const char *fname)
     {
         union semun ick;
    -    apr_status_t stat;
    +    apr_status_t rv;
         
         new_mutex->interproc = apr_palloc(new_mutex->pool, sizeof(*new_mutex->interproc));
         new_mutex->interproc->filedes = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600);
     
         if (new_mutex->interproc->filedes < 0) {
    -        stat = errno;
    +        rv = errno;
             proc_mutex_sysv_cleanup(new_mutex);
    -        return stat;
    +        return rv;
         }
         ick.val = 1;
         if (semctl(new_mutex->interproc->filedes, 0, SETVAL, ick) < 0) {
    -        stat = errno;
    +        rv = errno;
             proc_mutex_sysv_cleanup(new_mutex);
    -        return stat;
    +        return rv;
         }
         new_mutex->curr_locked = 0;
         apr_pool_cleanup_register(new_mutex->pool,
    @@ -141,13 +141,13 @@ static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex)
     
     static apr_status_t proc_mutex_sysv_destroy(apr_proc_mutex_t *mutex)
     {
    -    apr_status_t stat;
    +    apr_status_t rv;
     
    -    if ((stat = proc_mutex_sysv_cleanup(mutex)) == APR_SUCCESS) {
    +    if ((rv = proc_mutex_sysv_cleanup(mutex)) == APR_SUCCESS) {
             apr_pool_cleanup_kill(mutex->pool, mutex, proc_mutex_sysv_cleanup);
             return APR_SUCCESS;
         }
    -    return stat;
    +    return rv;
     }
     
     static apr_status_t proc_mutex_sysv_child_init(apr_proc_mutex_t **mutex, apr_pool_t *cont, const char *fname)
    @@ -181,14 +181,14 @@ static void proc_mutex_proc_pthread_setup(void)
     static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_)
     {
         apr_proc_mutex_t *mutex=mutex_;
    -    apr_status_t stat;
    +    apr_status_t rv;
     
         if (mutex->curr_locked == 1) {
    -        if ((stat = pthread_mutex_unlock(mutex->pthread_interproc))) {
    +        if ((rv = pthread_mutex_unlock(mutex->pthread_interproc))) {
     #ifdef PTHREAD_SETS_ERRNO
    -            stat = errno;
    +            rv = errno;
     #endif
    -            return stat;
    +            return rv;
             } 
             if (munmap((caddr_t)mutex->pthread_interproc, sizeof(pthread_mutex_t))){
                 return errno;
    @@ -200,7 +200,7 @@ static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_)
     static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex,
                                                        const char *fname)
     {
    -    apr_status_t stat;
    +    apr_status_t rv;
         int fd;
         pthread_mutexattr_t mattr;
     
    @@ -218,53 +218,53 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex,
             return errno;
         }
         close(fd);
    -    if ((stat = pthread_mutexattr_init(&mattr))) {
    +    if ((rv = pthread_mutexattr_init(&mattr))) {
     #ifdef PTHREAD_SETS_ERRNO
    -        stat = errno;
    +        rv = errno;
     #endif
             proc_mutex_proc_pthread_cleanup(new_mutex);
    -        return stat;
    +        return rv;
         }
    -    if ((stat = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED))) {
    +    if ((rv = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED))) {
     #ifdef PTHREAD_SETS_ERRNO
    -        stat = errno;
    +        rv = errno;
     #endif
             proc_mutex_proc_pthread_cleanup(new_mutex);
    -        return stat;
    +        return rv;
         }
     
     #ifdef HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP
    -    if ((stat = pthread_mutexattr_setrobust_np(&mattr, 
    +    if ((rv = pthread_mutexattr_setrobust_np(&mattr, 
                                                    PTHREAD_MUTEX_ROBUST_NP))) {
     #ifdef PTHREAD_SETS_ERRNO
    -        stat = errno;
    +        rv = errno;
     #endif
             proc_mutex_proc_pthread_cleanup(new_mutex);
    -        return stat;
    +        return rv;
         }
    -    if ((stat = pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT))) {
    +    if ((rv = pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT))) {
     #ifdef PTHREAD_SETS_ERRNO
    -        stat = errno;
    +        rv = errno;
     #endif
             proc_mutex_proc_pthread_cleanup(new_mutex);
    -        return stat;
    +        return rv;
         }
     #endif
     
    -    if ((stat = pthread_mutex_init(new_mutex->pthread_interproc, &mattr))) {
    +    if ((rv = pthread_mutex_init(new_mutex->pthread_interproc, &mattr))) {
     #ifdef PTHREAD_SETS_ERRNO
    -        stat = errno;
    +        rv = errno;
     #endif
             proc_mutex_proc_pthread_cleanup(new_mutex);
    -        return stat;
    +        return rv;
         }
     
    -    if ((stat = pthread_mutexattr_destroy(&mattr))) {
    +    if ((rv = pthread_mutexattr_destroy(&mattr))) {
     #ifdef PTHREAD_SETS_ERRNO
    -        stat = errno;
    +        rv = errno;
     #endif
             proc_mutex_proc_pthread_cleanup(new_mutex);
    -        return stat;
    +        return rv;
         }
     
         new_mutex->curr_locked = 0;
    @@ -277,21 +277,21 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex,
     
     static apr_status_t proc_mutex_proc_pthread_acquire(apr_proc_mutex_t *mutex)
     {
    -    apr_status_t stat;
    +    apr_status_t rv;
     
    -    if ((stat = pthread_mutex_lock(mutex->pthread_interproc))) {
    +    if ((rv = pthread_mutex_lock(mutex->pthread_interproc))) {
     #ifdef PTHREAD_SETS_ERRNO
    -        stat = errno;
    +        rv = errno;
     #endif
     #ifdef HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP
             /* Okay, our owner died.  Let's try to make it consistent again. */
    -        if (stat == EOWNERDEAD) {
    +        if (rv == EOWNERDEAD) {
                 pthread_mutex_consistent_np(mutex->pthread_interproc);
             }
             else
    -            return stat;
    +            return rv;
     #else
    -        return stat;
    +        return rv;
     #endif
         }
         mutex->curr_locked = 1;
    @@ -302,13 +302,13 @@ static apr_status_t proc_mutex_proc_pthread_acquire(apr_proc_mutex_t *mutex)
     
     static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex)
     {
    -    apr_status_t stat;
    +    apr_status_t rv;
     
    -    if ((stat = pthread_mutex_unlock(mutex->pthread_interproc))) {
    +    if ((rv = pthread_mutex_unlock(mutex->pthread_interproc))) {
     #ifdef PTHREAD_SETS_ERRNO
    -        stat = errno;
    +        rv = errno;
     #endif
    -        return stat;
    +        return rv;
         }
         mutex->curr_locked = 0;
         return APR_SUCCESS;
    @@ -316,14 +316,14 @@ static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex)
     
     static apr_status_t proc_mutex_proc_pthread_destroy(apr_proc_mutex_t *mutex)
     {
    -    apr_status_t stat;
    -    if ((stat = proc_mutex_proc_pthread_cleanup(mutex)) == APR_SUCCESS) {
    +    apr_status_t rv;
    +    if ((rv = proc_mutex_proc_pthread_cleanup(mutex)) == APR_SUCCESS) {
             apr_pool_cleanup_kill(mutex->pool,
                                   mutex,
                                   proc_mutex_proc_pthread_cleanup);
             return APR_SUCCESS;
         }
    -    return stat;
    +    return rv;
     }
     
     static apr_status_t proc_mutex_proc_pthread_child_init(apr_proc_mutex_t **mutex,
    @@ -443,12 +443,12 @@ static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex)
     
     static apr_status_t proc_mutex_fcntl_destroy(apr_proc_mutex_t *mutex)
     {
    -    apr_status_t stat;
    -    if ((stat = proc_mutex_fcntl_cleanup(mutex)) == APR_SUCCESS) {
    +    apr_status_t rv;
    +    if ((rv = proc_mutex_fcntl_cleanup(mutex)) == APR_SUCCESS) {
             apr_pool_cleanup_kill(mutex->pool, mutex, proc_mutex_fcntl_cleanup);
             return APR_SUCCESS;
         }
    -    return stat;
    +    return rv;
     }
     
     static apr_status_t proc_mutex_fcntl_child_init(apr_proc_mutex_t **mutex,
    @@ -556,12 +556,12 @@ static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *mutex)
     
     static apr_status_t proc_mutex_flock_destroy(apr_proc_mutex_t *mutex)
     {
    -    apr_status_t stat;
    -    if ((stat = proc_mutex_flock_cleanup(mutex)) == APR_SUCCESS) {
    +    apr_status_t rv;
    +    if ((rv = proc_mutex_flock_cleanup(mutex)) == APR_SUCCESS) {
             apr_pool_cleanup_kill(mutex->pool, mutex, proc_mutex_flock_cleanup);
             return APR_SUCCESS;
         }
    -    return stat;
    +    return rv;
     }
     
     static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex,
    @@ -679,18 +679,18 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lo
     
     static apr_status_t proc_mutex_create(apr_proc_mutex_t *new_mutex, apr_lockmech_e_np mech, const char *fname)
     {
    -    apr_status_t stat;
    +    apr_status_t rv;
     
         if (new_mutex->scope != APR_INTRAPROCESS) {
    -        if ((stat = proc_mutex_choose_method(new_mutex, mech)) != APR_SUCCESS) {
    -            return stat;
    +        if ((rv = proc_mutex_choose_method(new_mutex, mech)) != APR_SUCCESS) {
    +            return rv;
             }
         }
     
         new_mutex->meth = new_mutex->inter_meth;
     
    -    if ((stat = new_mutex->meth->create(new_mutex, fname)) != APR_SUCCESS) {
    -        return stat;
    +    if ((rv = new_mutex->meth->create(new_mutex, fname)) != APR_SUCCESS) {
    +        return rv;
         }
     
         return APR_SUCCESS;
    @@ -709,7 +709,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex,
                                                        apr_pool_t *pool)
     {
         apr_proc_mutex_t *new_mutex;
    -    apr_status_t stat;
    +    apr_status_t rv;
     
         new_mutex = (apr_proc_mutex_t *)apr_pcalloc(pool,
                                                     sizeof(apr_proc_mutex_t));
    @@ -719,8 +719,8 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex,
         new_mutex->interproc = NULL;
     #endif
     
    -    if ((stat = proc_mutex_create(new_mutex, mech, fname)) != APR_SUCCESS)
    -        return stat;
    +    if ((rv = proc_mutex_create(new_mutex, mech, fname)) != APR_SUCCESS)
    +        return rv;
     
         *mutex = new_mutex;
         return APR_SUCCESS;
    @@ -735,7 +735,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex,
     
     APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex)
     {
    -    apr_status_t stat;
    +    apr_status_t rv;
     
     #if APR_HAS_THREADS
         if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) {
    @@ -744,8 +744,8 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex)
         }
     #endif
     
    -    if ((stat = mutex->meth->acquire(mutex)) != APR_SUCCESS) {
    -        return stat;
    +    if ((rv = mutex->meth->acquire(mutex)) != APR_SUCCESS) {
    +        return rv;
         }
     
     #if APR_HAS_THREADS
    @@ -758,7 +758,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex)
     
     APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex)
     {
    -    apr_status_t stat;
    +    apr_status_t rv;
     
     #if APR_HAS_THREADS
         if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) {
    @@ -767,8 +767,8 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex)
         }
     #endif
     
    -    if ((stat = mutex->meth->tryacquire(mutex)) != APR_SUCCESS) {
    -        return stat;
    +    if ((rv = mutex->meth->tryacquire(mutex)) != APR_SUCCESS) {
    +        return rv;
         }
     
     #if APR_HAS_THREADS
    @@ -781,7 +781,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex)
     
     APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex)
     {
    -    apr_status_t stat;
    +    apr_status_t rv;
     
     #if APR_HAS_THREADS
         if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) {
    @@ -791,8 +791,8 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex)
         }
     #endif
     
    -    if ((stat = mutex->meth->release(mutex)) != APR_SUCCESS) {
    -        return stat;
    +    if ((rv = mutex->meth->release(mutex)) != APR_SUCCESS) {
    +        return rv;
         }
     
     #if APR_HAS_THREADS
    
    From cad2ac73517201cdb67b2f7313e7850fb0e23e0c Mon Sep 17 00:00:00 2001
    From: Aaron Bannert 
    Date: Tue, 23 Oct 2001 19:51:32 +0000
    Subject: [PATCH 2459/7878] apr_file_mkstemp() already returned the error that
     we were interested in, so we don't have to depend on errno any longer.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62459 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/unix/crossproc.c | 4 +---
     1 file changed, 1 insertion(+), 3 deletions(-)
    
    diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c
    index 2ed15f3ad89..f5f1ab41f29 100644
    --- a/locks/unix/crossproc.c
    +++ b/locks/unix/crossproc.c
    @@ -390,10 +390,8 @@ static apr_status_t fcntl_create(apr_lock_t *new, const char *fname)
         }
     
         if (rv != APR_SUCCESS) {
    -        apr_status_t stat = errno;
    -
             fcntl_cleanup(new);
    -        return stat;
    +        return rv;
         }
     
         new->curr_locked=0;
    
    From 9dade487b753a0833325bbdab1ec75e593916c7d Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Tue, 23 Oct 2001 23:36:31 +0000
    Subject: [PATCH 2460/7878] Updated to match the build procedure
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62460 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/make_nw_export.awk | 10 ++--------
     build/prebuildNW.bat     |  4 ++--
     2 files changed, 4 insertions(+), 10 deletions(-)
    
    diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk
    index 317e4bc7c36..2b118e96782 100644
    --- a/build/make_nw_export.awk
    +++ b/build/make_nw_export.awk
    @@ -55,14 +55,8 @@
     /apr_bucket_mmap_make/{next}
     /apr_bucket_type_mmap/{next}
     /apr_md4_set_xlate/{next}
    -#/XML_ParserFree/{next}
    -#/XML_ParserCreate/{next}
    -#/XML_SetUserData/{next}
    -#/XML_SetElementHandler/{next}
    -#/XML_SetCharacterDataHandler/{next}
    -#/XML_Parse/{next}
    -#/XML_GetErrorCode/{next}
    -#/XML_ErrorString/{next}
    +/apr_os_proc_mutex_get/{next}
    +/apr_os_proc_mutex_put/{next}
     
     
     function add_symbol (sym_name) {
    diff --git a/build/prebuildNW.bat b/build/prebuildNW.bat
    index 9bdd3d56692..876ae4a38b9 100755
    --- a/build/prebuildNW.bat
    +++ b/build/prebuildNW.bat
    @@ -21,5 +21,5 @@ copy ..\..\pcre\config.hw ..\..\pcre\config.h
     copy ..\..\pcre\pcre.hw ..\..\pcre\pcre.h
     
     # Generate the import list
    -awk95 -f make_nw_export.awk ..\include\*.h |sort > ..\misc\netware\aprlib.imp
    -awk95 -f make_nw_export.awk ..\..\apr-util\include\*.h |sort > ..\misc\netware\aprutil.imp
    \ No newline at end of file
    +awk95 -f make_nw_export.awk ..\include\*.h |sort > ..\aprlib.imp
    +awk95 -f make_nw_export.awk ..\..\apr-util\include\*.h |sort > ..\aprutil.imp
    
    From 06d6c8ad7aa51b1eb9e9c08717ba94b3080835d6 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Tue, 23 Oct 2001 23:38:55 +0000
    Subject: [PATCH 2461/7878] Updated to the LibC NLM startup code
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62461 13f79535-47bb-0310-9956-ffa450edef68
    ---
     misc/netware/libprews.c | 37 +++++++++++++++++++++++++++++++++----
     1 file changed, 33 insertions(+), 4 deletions(-)
    
    diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c
    index 100e2f30818..efa475fc697 100644
    --- a/misc/netware/libprews.c
    +++ b/misc/netware/libprews.c
    @@ -8,18 +8,47 @@
       to do any cleanup other than the mechanism Apache modules
       provide.
     ------------------------------------------------------------------*/
    -#include "stddef.h"
    +#include 
    +//#include "stddef.h"
     #include "ws2nlm.h"
     
    -int _lib_start_ws()
    +int _NonAppStart
    +(
    +    void        *NLMHandle,
    +    void        *errorScreen,
    +    const char  *cmdLine,
    +    const char  *loadDirPath,
    +    size_t      uninitializedDataLength,
    +    void        *NLMFileHandle,
    +    int         (*readRoutineP)( int conn, void *fileHandle, size_t offset,
    +                    size_t nbytes, size_t *bytesRead, void *buffer ),
    +    size_t      customDataOffset,
    +    size_t      customDataSize,
    +    int         messageCount,
    +    const char  **messages
    +)
     {
    +#pragma unused(cmdLine)
    +#pragma unused(loadDirPath)
    +#pragma unused(uninitializedDataLength)
    +#pragma unused(NLMFileHandle)
    +#pragma unused(readRoutineP)
    +#pragma unused(customDataOffset)
    +#pragma unused(customDataSize)
    +#pragma unused(messageCount)
    +#pragma unused(messages)
    +
         WSADATA wsaData;
         
         return WSAStartup((WORD) MAKEWORD(2, 0), &wsaData);
     }
     
    -int _lib_stop_ws()
    +void _NonAppStop( void )
     {
         WSACleanup();
    -    return 0;
    +}
    +
    +int  _NonAppCheckUnload( void )
    +{
    +	return 0;
     }
    
    From 625c39a46cec0af3e185c621a6193b1b981f4f4e Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 25 Oct 2001 14:52:43 +0000
    Subject: [PATCH 2462/7878] Change proc_mutex_fcntl_create() to remove the lock
     file.  There was no logic to unlink() the lock file when the user specified
     the name, though when the APR temporary file facility was used it would be
     unlinked when closed.
    
    For an fcntl() lock we want to remove the file immediately (not
    necessary to open it again; don't want to leave it around if we
    die catastrophically).
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62462 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/unix/proc_mutex.c | 7 ++++++-
     1 file changed, 6 insertions(+), 1 deletion(-)
    
    diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c
    index 9d1e8fe7418..60569d9f7cf 100644
    --- a/locks/unix/proc_mutex.c
    +++ b/locks/unix/proc_mutex.c
    @@ -405,7 +405,12 @@ static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex,
         }
     
         new_mutex->curr_locked = 0;
    -/*    unlink(new_mutex->fname); */
    +    /* XXX currently, apr_file_mktemp() always specifies that the file should
    +     *     be removed when closed; that unlink() will fail since we're 
    +     *     removing it here; we want to remove it here since we don't need
    +     *     it visible and we want it cleaned up if we exit catastrophically
    +     */
    +    unlink(new_mutex->fname);
         apr_pool_cleanup_register(new_mutex->pool,
                                   (void*)new_mutex,
                                   proc_mutex_fcntl_cleanup, 
    
    From 46036acff6b31128aee6a468191ab131b74fd5c1 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Thu, 25 Oct 2001 15:37:16 +0000
    Subject: [PATCH 2463/7878] More cleanup on the pre-build scripts
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62463 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/prebuildNW.bat | 29 +++++++++++++++--------------
     1 file changed, 15 insertions(+), 14 deletions(-)
    
    diff --git a/build/prebuildNW.bat b/build/prebuildNW.bat
    index 876ae4a38b9..161e0b1b3d2 100755
    --- a/build/prebuildNW.bat
    +++ b/build/prebuildNW.bat
    @@ -1,25 +1,26 @@
    -# As part of the pre-build process, the utility GenURI.NLM
    -#  (Gen URI Delims) must be built, copied to a NetWare server 
    -#  and run using the following command:
    -#
    -# genuri >uri_delims.h
    -#
    -#  The file "sys:\uri_delims.h" must then be copied to
    -#  "apr-util\uri\uri_delims.h" on the build machine.
    +@echo off
    +@echo # As part of the pre-build process, the utility GenURI.NLM
    +@echo #  (Gen URI Delims) must be built, copied to a NetWare server 
    +@echo #  and run using the following command:
    +@echo #
    +@echo # "sys:\genuri >sys:\uri_delims.h"
    +@echo #
    +@echo #  The file "sys:\uri_delims.h" must then be copied to
    +@echo #  "apr-util\uri\uri_delims.h" on the build machine.
     
    -# Fix up the APR headers
    +@echo Fixing up the APR headers
     copy ..\include\apr.hnw ..\include\apr.h
     
    -# Fix up the APR-Util headers
    +@echo Fixing up the APR-Util headers
     copy ..\..\apr-util\include\apu.h.in ..\..\apr-util\include\apu.h
     copy ..\..\apr-util\include\private\apu_config.hw ..\..\apr-util\include\private\apu_config.h
     copy ..\..\apr-util\xml\expat\lib\expat.h.in ..\..\apr-util\xml\expat\lib\expat.h
     copy ..\..\apr-util\include\private\apu_select_dbm.hw ..\..\apr-util\include\private\apu_select_dbm.h
     
    -# Fix up the pcre headers
    +@echo Fixing up the pcre headers
     copy ..\..\pcre\config.hw ..\..\pcre\config.h
     copy ..\..\pcre\pcre.hw ..\..\pcre\pcre.h
     
    -# Generate the import list
    -awk95 -f make_nw_export.awk ..\include\*.h |sort > ..\aprlib.imp
    -awk95 -f make_nw_export.awk ..\..\apr-util\include\*.h |sort > ..\aprutil.imp
    +@echo Generating the import list...
    +awk -f make_nw_export.awk ..\include\*.h |sort > ..\aprlib.imp
    +awk -f make_nw_export.awk ..\..\apr-util\include\*.h |sort > ..\aprutil.imp
    
    From c7162b6561c946a98c0b15de1d2f2b9f6fc9a4d2 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Fri, 26 Oct 2001 02:31:04 +0000
    Subject: [PATCH 2464/7878] OS/2: Implement exitcode/exitwhy enhancements in
     apr_proc_wait*
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62464 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/os2/proc.c | 72 ++++++++++++++++++++++++++++++++++++++-----
     1 file changed, 64 insertions(+), 8 deletions(-)
    
    diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c
    index 1195506a356..927fd96ecb5 100644
    --- a/threadproc/os2/proc.c
    +++ b/threadproc/os2/proc.c
    @@ -496,6 +496,66 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname
         return status;
     }
     
    +
    +
    +static void proces_result_codes(RESULTCODES codes, 
    +                                int *exitcode, 
    +                                apr_exit_why_e *exitwhy)
    +{
    +    int result = 0;
    +    apr_exit_why_e why = APR_PROC_EXIT;
    +
    +    switch (codes.codeTerminate) {
    +    case TC_EXIT:        /* Normal exit */
    +        why = APR_PROC_EXIT;
    +        result = codes.codeResult;
    +        break;
    +
    +    case TC_HARDERROR:   /* Hard error halt */
    +        why = APR_PROC_SIGNAL;
    +        result = SIGSYS;
    +        break;
    +
    +    case TC_KILLPROCESS: /* Was killed by a DosKillProcess() */
    +        why = APR_PROC_SIGNAL;
    +        result = SIGKILL;
    +        break;
    +
    +    case TC_TRAP:        /* TRAP in 16 bit code */
    +    case TC_EXCEPTION:   /* Threw an exception (32 bit code) */
    +        why = APR_PROC_SIGNAL;
    +
    +        switch (codes.codeResult | XCPT_FATAL_EXCEPTION) {
    +        case XCPT_ACCESS_VIOLATION:
    +            result = SIGSEGV;
    +            break;
    +
    +        case XCPT_ILLEGAL_INSTRUCTION:
    +            result = SIGILL;
    +            break;
    +
    +        case XCPT_FLOAT_DIVIDE_BY_ZERO:
    +        case XCPT_INTEGER_DIVIDE_BY_ZERO:
    +            result = SIGFPE;
    +            break;
    +
    +        default:
    +            result = codes.codeResult;
    +            break;
    +        }
    +    }
    +
    +    if (exitcode) {
    +        *exitcode = result;
    +    }
    +
    +    if (exitwhy) {
    +        *exitwhy = why;
    +    }
    +}
    +
    +
    +
     APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,
                                                       int *exitcode,
                                                       apr_exit_why_e *exitwhy,
    @@ -509,14 +569,11 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,
         if (!proc)
             return APR_ENOPROC;
     
    -    rc = DosWaitChild(DCWA_PROCESSTREE, wait == APR_WAIT ? DCWW_WAIT : DCWW_NOWAIT, &codes, &pid, 0);
    +    rc = DosWaitChild(DCWA_PROCESSTREE, waithow == APR_WAIT ? DCWW_WAIT : DCWW_NOWAIT, &codes, &pid, 0);
     
         if (rc == 0) {
             proc->pid = pid;
    -
    -        if (status)
    -            *status = codes.codeResult;
    -
    +        proces_result_codes(codes, exitcode, exitwhy);
             return APR_CHILD_DONE;
         } else if (rc == ERROR_CHILD_NOT_COMPLETE) {
             return APR_CHILD_NOTDONE;
    @@ -538,11 +595,10 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
         if (!proc)
             return APR_ENOPROC;
     
    -    rc = DosWaitChild(DCWA_PROCESS, wait == APR_WAIT ? DCWW_WAIT : DCWW_NOWAIT, &codes, &pid, proc->pid);
    +    rc = DosWaitChild(DCWA_PROCESS, waithow == APR_WAIT ? DCWW_WAIT : DCWW_NOWAIT, &codes, &pid, proc->pid);
     
    -    if (exitcode)
    -        *exitcode = codes.codeResult;
         if (rc == 0) {
    +        proces_result_codes(codes, exitcode, exitwhy);
             return APR_CHILD_DONE;
         } else if (rc == ERROR_CHILD_NOT_COMPLETE) {
             return APR_CHILD_NOTDONE;
    
    From 1601ad7fe801041fe341e1585bc3b4beddd1ff0c Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 26 Oct 2001 18:13:02 +0000
    Subject: [PATCH 2465/7878] apr_proc_create(): do exec cleanup before duping
     pipes to fds 0-2; otherwise, any files cleaned up with those fds will hose
     our pipes; typical symptom is APR_EOF in the parent when trying to read child
     output
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62465 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/unix/proc.c | 8 ++++++--
     1 file changed, 6 insertions(+), 2 deletions(-)
    
    diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
    index 736b7269690..b260a3216c5 100644
    --- a/threadproc/unix/proc.c
    +++ b/threadproc/unix/proc.c
    @@ -289,6 +289,12 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
         else if (new->pid == 0) { 
             int status;
             /* child process */
    +
    +        /* do exec cleanup before duping pipes to fds 0-2; otherwise,
    +         * any files cleaned up with those fds will hose our pipes
    +         */
    +        apr_pool_cleanup_for_exec();
    +
             if (attr->child_in) {
                 apr_file_close(attr->parent_in);
                 dup2(attr->child_in->filedes, STDIN_FILENO);
    @@ -313,8 +319,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
                 }
             }
     
    -        apr_pool_cleanup_for_exec();
    -
             if ((status = limit_proc(attr)) != APR_SUCCESS) {
                 return status;
             }
    
    From f7f757d090e4985c62c48f2a784045ac71101b01 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 27 Oct 2001 00:48:19 +0000
    Subject: [PATCH 2466/7878] back out previous change so that mod_cgid works
     again; add comment with a litte information about the problem with file
     cleanup conflicting with our pipe setup
    
    Submitted by:	Justin Erenkrantz
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62466 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/unix/proc.c | 14 +++++++++++---
     1 file changed, 11 insertions(+), 3 deletions(-)
    
    diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
    index b260a3216c5..81a80b8719f 100644
    --- a/threadproc/unix/proc.c
    +++ b/threadproc/unix/proc.c
    @@ -290,10 +290,16 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
             int status;
             /* child process */
     
    -        /* do exec cleanup before duping pipes to fds 0-2; otherwise,
    -         * any files cleaned up with those fds will hose our pipes
    +        /* XXX major SNAFU
    +         *
    +         * If we do exec cleanup before the dup2() calls to set up pipes 
    +         * on 0-2, we accidentally close the pipes used by programs like 
    +         * mod_cgid.
    +         *
    +         * If we do exec cleanup after the dup2() calls, cleanup can accidentally
    +         * close our pipes which replaced any files which previously had
    +         * descriptors 0-2.
              */
    -        apr_pool_cleanup_for_exec();
     
             if (attr->child_in) {
                 apr_file_close(attr->parent_in);
    @@ -319,6 +325,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
                 }
             }
     
    +        apr_pool_cleanup_for_exec();
    +
             if ((status = limit_proc(attr)) != APR_SUCCESS) {
                 return status;
             }
    
    From e66e62ae96dd69edaeb23c35599055cec8a892fd Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sat, 27 Oct 2001 21:54:15 +0000
    Subject: [PATCH 2467/7878] Fix a small snafu in configure.in
    
    (Man, this still works!)
    
    Submitted by:	Pete Schultz 
    Reviewed by:	David Reid 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62467 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/configure.in b/configure.in
    index 7e68b7243df..3e33da86c36 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -1252,7 +1252,7 @@ msg=no ])
     AC_MSG_RESULT([$msg])
     
     AC_MSG_CHECKING([if fd == socket on this platform])
    -if test "x$file_as_socket" = "x" ; then
    +if test "x$file_as_socket" = "x1" ; then
         file_as_socket="1";
         echo "yes"
     else
    
    From a855e2bd11785afeed7e1364a2eb56b93d3bbcc0 Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Sat, 27 Oct 2001 23:48:25 +0000
    Subject: [PATCH 2468/7878] The previous patch was the wrong test. If
     file_as_socket was unset (empty string), then it would never get set to 0.
     That would result in a bad substitution in apr.h, and then a compile failure
     with #if statements because APR_FILES_AS_SOCKETS would be null (rather than 0
     or 1).
    
    Instead, the proper fix is if file_as_socket is not specifically set to 0,
    then we will turn it on.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62468 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/configure.in b/configure.in
    index 3e33da86c36..2ad5bc183a6 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -1252,7 +1252,7 @@ msg=no ])
     AC_MSG_RESULT([$msg])
     
     AC_MSG_CHECKING([if fd == socket on this platform])
    -if test "x$file_as_socket" = "x1" ; then
    +if test "x$file_as_socket" != "x0" ; then
         file_as_socket="1";
         echo "yes"
     else
    
    From a3d7930b0a1b88317227b3c44a5fd9537bedc773 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 28 Oct 2001 12:53:51 +0000
    Subject: [PATCH 2469/7878] Add the new lock structures...
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62469 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/beos/proc_mutex.h    |  5 ++++-
     include/arch/beos/thread_mutex.h  |  9 +++++++++
     include/arch/beos/thread_rwlock.h | 12 ++++++++++++
     3 files changed, 25 insertions(+), 1 deletion(-)
    
    diff --git a/include/arch/beos/proc_mutex.h b/include/arch/beos/proc_mutex.h
    index 104aa43bfc6..a7442ebf09b 100644
    --- a/include/arch/beos/proc_mutex.h
    +++ b/include/arch/beos/proc_mutex.h
    @@ -55,7 +55,6 @@
     #ifndef PROC_MUTEX_H
     #define PROC_MUTEX_H
     
    -#include 
     #include "apr_pools.h"
     #include "apr_proc_mutex.h"
     #include "apr_file_io.h"
    @@ -65,6 +64,10 @@
     
     struct apr_proc_mutex_t {
         apr_pool_t *pool;
    +    
    +    /* Our lock :) */
    +    sem_id Lock;
    +    int32  LockCount;
     };
     
     #endif  /* PROC_MUTEX_H */
    diff --git a/include/arch/beos/thread_mutex.h b/include/arch/beos/thread_mutex.h
    index cdfc4ebf34b..94cffa08ad9 100644
    --- a/include/arch/beos/thread_mutex.h
    +++ b/include/arch/beos/thread_mutex.h
    @@ -65,6 +65,15 @@
     
     struct apr_thread_mutex_t {
         apr_pool_t *pool;
    +    
    +    /* Our lock :) */
    +    sem_id Lock;
    +    int32  LockCount;
    +
    +    /* If we nest locks we need these... */
    +    int nested;  
    +    apr_os_thread_t owner;
    +    int owner_ref;
     };
     
     #endif  /* THREAD_MUTEX_H */
    diff --git a/include/arch/beos/thread_rwlock.h b/include/arch/beos/thread_rwlock.h
    index 02f1c5d2299..13da6eeb955 100644
    --- a/include/arch/beos/thread_rwlock.h
    +++ b/include/arch/beos/thread_rwlock.h
    @@ -65,6 +65,18 @@
     
     struct apr_thread_rwlock_t {
         apr_pool_t *pool;
    +
    +    /* Our lock :) */
    +    sem_id Lock;
    +    int32  LockCount;
    +    /* Read/Write lock stuff */
    +    sem_id Read;
    +    int32  ReadCount;
    +    sem_id Write;
    +    int32  WriteCount;
    +    int32  Nested;
    +
    +    thread_id writer;
     };
     
     #endif  /* THREAD_RWLOCK_H */
    
    From b3fa89a908e86772c42428d4a710240596910b07 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 28 Oct 2001 13:05:51 +0000
    Subject: [PATCH 2470/7878] Add the actual code for most of the new lock
     methods.  Just the conditional implementation to add at some point.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62470 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/beos/proc_mutex.c    |  71 +++++++++++++++++--
     locks/beos/thread_mutex.c  | 112 +++++++++++++++++++++++++++---
     locks/beos/thread_rwlock.c | 138 +++++++++++++++++++++++++++++++++++--
     3 files changed, 300 insertions(+), 21 deletions(-)
    
    diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c
    index c5209831fef..b9a1d31708f 100644
    --- a/locks/beos/proc_mutex.c
    +++ b/locks/beos/proc_mutex.c
    @@ -60,13 +60,51 @@
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    +static apr_status_t _proc_mutex_cleanup(void * data)
    +{
    +    apr_proc_mutex_t *lock = (apr_proc_mutex_t*)data;
    +    if (lock->LockCount != 0) {
    +        /* we're still locked... */
    +    	while (atomic_add(&lock->LockCount , -1) > 1){
    +    	    /* OK we had more than one person waiting on the lock so 
    +    	     * the sem is also locked. Release it until we have no more
    +    	     * locks left.
    +    	     */
    +            release_sem (lock->Lock);
    +    	}
    +    }
    +    delete_sem(lock->Lock);
    +    return APR_SUCCESS;
    +}    
    +
     APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
                                                     const char *fname,
                                                     apr_pool_t *pool)
     {
    -    return APR_ENOTIMPL;
    +    apr_proc_mutex_t *new;
    +    apr_status_t stat = APR_SUCCESS;
    +  
    +    new = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t));
    +    if (new == NULL){
    +        return APR_ENOMEM;
    +    }
    +    
    +    if ((stat = create_sem(0, "APR_Lock")) < B_NO_ERROR) {
    +        _proc_mutex_cleanup(new);
    +        return stat;
    +    }
    +    new->LockCount = 0;
    +    new->Lock = stat;  
    +    new->pool  = pool;
    +
    +    apr_pool_cleanup_register(new->pool, (void *)new, _proc_mutex_cleanup,
    +                              apr_pool_cleanup_null);
    +
    +    (*mutex) = new;
    +    return APR_SUCCESS;
     }
     
    +#if APR_HAS_CREATE_LOCKS_NP
     APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex,
                                                        const char *fname,
                                                        apr_lockmech_e_np mech,
    @@ -74,6 +112,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex,
     {
         return APR_ENOTIMPL;
     }       
    +#endif
     
     APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex,
                                                         const char *fname,
    @@ -84,7 +123,15 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex,
         
     APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex)
     {
    -    return APR_ENOTIMPL;
    +    int32 stat;
    +    
    +	if (atomic_add(&mutex->LockCount, 1) > 0) {
    +		if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) {
    +		    atomic_add(&mutex->LockCount, -1);
    +		    return stat;
    +		}
    +	}
    +    return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex)
    @@ -94,12 +141,25 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex)
     
     APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex)
     {
    -    return APR_ENOTIMPL;
    +    int32 stat;
    +    
    +	if (atomic_add(&mutex->LockCount, -1) > 1) {
    +        if ((stat = release_sem(mutex->Lock)) < B_NO_ERROR) {
    +            atomic_add(&mutex->LockCount, 1);
    +            return stat;
    +        }
    +    }
    +    return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex)
     {
    -    return APR_ENOTIMPL;
    +    apr_status_t stat;
    +    if ((stat = _proc_mutex_cleanup(mutex)) == APR_SUCCESS) {
    +        apr_pool_cleanup_kill(mutex->pool, mutex, _proc_mutex_cleanup);
    +        return APR_SUCCESS;
    +    }
    +    return stat;
     }
     
     APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex)
    @@ -122,8 +182,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex,
             return APR_ENOPOOL;
         }
         if ((*pmutex) == NULL) {
    -        (*pmutex) = (apr_proc_mutex_t *)apr_pcalloc(pool,
    -                                                    sizeof(apr_proc_mutex_t));
    +        (*pmutex) = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t));
             (*pmutex)->pool = pool;
         }
         (*pmutex)->Lock = ospmutex->sem;
    diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c
    index 054464f05c4..03d669885e4 100644
    --- a/locks/beos/thread_mutex.c
    +++ b/locks/beos/thread_mutex.c
    @@ -60,21 +60,91 @@
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    -static apr_status_t thread_mutex_cleanup(void *data)
    +static apr_status_t _thread_mutex_cleanup(void * data)
     {
    -    return APR_ENOTIMPL;
    -}
    +    apr_thread_mutex_t *lock = (apr_thread_mutex_t*)data;
    +    if (lock->LockCount != 0) {
    +        /* we're still locked... */
    +    	while (atomic_add(&lock->LockCount , -1) > 1){
    +    	    /* OK we had more than one person waiting on the lock so 
    +    	     * the sem is also locked. Release it until we have no more
    +    	     * locks left.
    +    	     */
    +            release_sem (lock->Lock);
    +    	}
    +    }
    +    delete_sem(lock->Lock);
    +    return APR_SUCCESS;
    +}    
     
     APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex,
                                                       unsigned int flags,
                                                       apr_pool_t *pool)
     {
    -    return APR_ENOTIMPL;
    +    apr_thread_mutex_t *new_m;
    +    apr_status_t stat = APR_SUCCESS;
    +  
    +    new_m = (apr_thread_mutex_t *)apr_pcalloc(pool, sizeof(apr_thread_mutex_t));
    +    if (new_m == NULL){
    +        return APR_ENOMEM;
    +    }
    +    
    +    if ((stat = create_sem(0, "APR_Lock")) < B_NO_ERROR) {
    +        _thread_mutex_cleanup(new_m);
    +        return stat;
    +    }
    +    new_m->LockCount = 0;
    +    new_m->Lock = stat;  
    +    new_m->pool  = pool;
    +    new_m->nested = flags & APR_THREAD_MUTEX_NESTED;
    +
    +    apr_pool_cleanup_register(new_m->pool, (void *)new_m, _thread_mutex_cleanup,
    +                              apr_pool_cleanup_null);
    +
    +    (*mutex) = new_m;
    +    return APR_SUCCESS;
     }
     
    -APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex)
    +#if APR_HAS_CREATE_LOCKS_NP
    +APR_DECLARE(apr_status_t) apr_thread_mutex_create_np(apr_thread_mutex_t **mutex,
    +                                                   const char *fname,
    +                                                   apr_lockmech_e_np mech,
    +                                                   apr_pool_t *pool)
     {
         return APR_ENOTIMPL;
    +}       
    +#endif
    +
    +APR_DECLARE(apr_status_t) apr_thread_mutex_child_init(apr_thread_mutex_t **mutex,
    +                                                    const char *fname,
    +                                                    apr_pool_t *pool)
    +{
    +    return APR_SUCCESS;
    +}
    +    
    +APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex)
    +{
    +    int32 stat;
    +    
    +    if (mutex->nested && mutex->owner == find_thread(NULL)) {
    +        mutex->owner_ref++;
    +        return APR_SUCCESS;
    +    }
    +    
    +	if (atomic_add(&mutex->LockCount, 1) > 0) {
    +		if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) {
    +            /* Oh dear, acquire_sem failed!!  */
    +		    atomic_add(&mutex->LockCount, -1);
    +		    return stat;
    +		}
    +	}
    +
    +    if (mutex->nested) {
    +        mutex->owner = find_thread(NULL);
    +        mutex->owner_ref = 1;
    +    }
    +    
    +    return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex)
    @@ -84,13 +154,35 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex)
     
     APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex)
     {
    -    return APR_ENOTIMPL;
    +    int32 stat;
    +    
    +    if (mutex->nested && mutex->owner == find_thread(NULL)) {
    +        mutex->owner_ref--;
    +        if (mutex->owner_ref > 0)
    +            return APR_SUCCESS;
    +    }
    +    
    +	if (atomic_add(&mutex->LockCount, -1) > 1) {
    +        if ((stat = release_sem(mutex->Lock)) < B_NO_ERROR) {
    +            atomic_add(&mutex->LockCount, 1);
    +            return stat;
    +        }
    +    }
    +
    +    if (mutex->nested) {
    +        mutex->owner = -1;
    +        mutex->owner_ref = 0;
    +    }
    +
    +    return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex)
     {
    -    return APR_ENOTIMPL;
    +    apr_status_t stat;
    +    if ((stat = _thread_mutex_cleanup(mutex)) == APR_SUCCESS) {
    +        apr_pool_cleanup_kill(mutex->pool, mutex, _thread_mutex_cleanup);
    +        return APR_SUCCESS;
    +    }
    +    return stat;
     }
    -
    -APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex)
    -
    diff --git a/locks/beos/thread_rwlock.c b/locks/beos/thread_rwlock.c
    index 59a93d0a781..fa5ac911e6f 100644
    --- a/locks/beos/thread_rwlock.c
    +++ b/locks/beos/thread_rwlock.c
    @@ -60,15 +60,82 @@
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    +#define BIG_NUM 100000
    +
    +static apr_status_t _thread_rw_cleanup(void * data)
    +{
    +    apr_thread_rwlock_t *mutex = (apr_thread_rwlock_t*)data;
    +
    +    if (mutex->ReadCount != 0) {
    +    	while (atomic_add(&mutex->ReadCount , -1) > 1){
    +            release_sem (mutex->Read);
    +    	}
    +    }
    +    if (mutex->WriteCount != 0) {
    +    	while (atomic_add(&mutex->WriteCount , -1) > 1){
    +            release_sem (mutex->Write);
    +    	}
    +    }
    +    if (mutex->LockCount != 0) {
    +    	while (atomic_add(&mutex->LockCount , -1) > 1){
    +            release_sem (mutex->Lock);
    +    	}
    +    }
    +    
    +    delete_sem(mutex->Read);
    +    delete_sem(mutex->Write);
    +    delete_sem(mutex->Lock);
    +    return APR_SUCCESS;
    +}    
    +
     APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock,
                                                        apr_pool_t *pool)
     {
    -    return APR_ENOTIMPL;
    +    apr_thread_rwlock_t *new;
    +  
    +    new = (apr_thread_rwlock_t *)apr_pcalloc(pool, sizeof(apr_thread_rwlock_t));
    +    if (new == NULL){
    +        return APR_ENOMEM;
    +    }
    +    
    +    new->pool  = pool;
    +    /* we need to make 3 locks... */
    +    new->ReadCount = 0;
    +    new->WriteCount = 0;
    +    new->LockCount = 0;
    +    new->Read  = create_sem(0, "APR_ReadLock");
    +    new->Write = create_sem(0, "APR_WriteLock");
    +    new->Lock  = create_sem(0, "APR_Lock");
    +    
    +    if (new->Lock < 0 || new->Read < 0 || new->Write < 0) {
    +        _thread_rw_cleanup(new);
    +        return -1;
    +    }
    +
    +    apr_pool_cleanup_register(new->pool, (void *)new, _thread_rw_cleanup,
    +                              apr_pool_cleanup_null);
    +    (*rwlock) = new;
    +    return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock)
     {
    -    return APR_ENOTIMPL;
    +    int32 rv = APR_SUCCESS;
    +
    +    if (find_thread(NULL) == rwlock->writer) {
    +        /* we're the writer - no problem */
    +        rwlock->Nested++;
    +    } else {
    +        /* we're not the writer */
    +        int32 r = atomic_add(&rwlock->ReadCount, 1);
    +        if (r < 0) {
    +            /* Oh dear, writer holds lock, wait for sem */
    +            rv = acquire_sem_etc(rwlock->Read, 1, B_DO_NOT_RESCHEDULE,
    +                                 B_INFINITE_TIMEOUT);
    +        }
    +    }
    +
    +    return rv;
     }
     
     APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock)
    @@ -78,7 +145,33 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwloc
     
     APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock)
     {
    -    return APR_ENOTIMPL;
    +    int rv = APR_SUCCESS;
    +
    +    if (find_thread(NULL) == rwlock->writer) {
    +        rwlock->Nested++;
    +    } else {
    +        /* we're not the writer... */
    +        if (atomic_add(&rwlock->LockCount, 1) >= 1) {
    +            /* we're locked - acquire the sem */
    +            rv = acquire_sem_etc(rwlock->Lock, 1, B_DO_NOT_RESCHEDULE,
    +                                 B_INFINITE_TIMEOUT);
    +        }
    +        if (rv == APR_SUCCESS) {
    +            /* decrement the ReadCount to a large -ve number so that
    +             * we block on new readers...
    +             */
    +            int32 readers = atomic_add(&rwlock->ReadCount, -BIG_NUM);
    +            if (readers > 0) {
    +                /* readers are holding the lock */
    +                rv = acquire_sem_etc(rwlock->Write, readers, B_DO_NOT_RESCHEDULE,
    +                                     B_INFINITE_TIMEOUT);
    +            }
    +            if (rv == APR_SUCCESS)
    +                rwlock->writer = find_thread(NULL);
    +        }
    +    }
    +    
    +    return rv;
     }
     
     APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock)
    @@ -88,12 +181,47 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwloc
     
     APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock)
     {
    -    return APR_ENOTIMPL;
    +    apr_status_t rv = APR_SUCCESS;
    +    int32 readers;
    +
    +    /* we know we hold the lock, so don't check it :) */
    +    if (find_thread(NULL) == rwlock->writer) {
    +    /* we know we hold the lock, so don't check it :) */
    +        if (rwlock->Nested > 1) {
    +            /* we're recursively locked */
    +            rwlock->Nested--;
    +            return APR_SUCCESS;
    +        }
    +        /* OK so we need to release the sem if we have it :) */
    +        readers = atomic_add(&rwlock->ReadCount, BIG_NUM) + BIG_NUM;
    +        if (readers > 0) {
    +            rv = release_sem_etc(rwlock->Read, readers, B_DO_NOT_RESCHEDULE);
    +        }
    +        if (rv == APR_SUCCESS) {
    +            rwlock->writer = -1;
    +            if (atomic_add(&rwlock->LockCount, -1) > 1) {
    +                rv = release_sem_etc(rwlock->Lock, 1, B_DO_NOT_RESCHEDULE);
    +            }
    +        }
    +    } else {
    +       /* We weren't the Writer, so just release the ReadCount... */
    +       if (atomic_add(&rwlock->ReadCount, -1) < 0) {
    +            /* we have a writer waiting for the lock, so release it */
    +            rv = release_sem_etc(rwlock->Write, 1, B_DO_NOT_RESCHEDULE);
    +        }
    +    }
    +
    +    return rv;
     }
     
     APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock)
     {
    -    return APR_ENOTIMPL;
    +    apr_status_t stat;
    +    if ((stat = _thread_rw_cleanup(rwlock)) == APR_SUCCESS) {
    +        apr_pool_cleanup_kill(rwlock->pool, rwlock, _thread_rw_cleanup);
    +        return APR_SUCCESS;
    +    }
    +    return stat;
     }
     
     APR_POOL_IMPLEMENT_ACCESSOR(thread_rwlock)
    
    From c22014397f56c44f9610575e32506de90c1de0c2 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 28 Oct 2001 13:46:15 +0000
    Subject: [PATCH 2471/7878] Some more tidying up for the beos code and get it
     building again.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62471 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/beos/proc.c   | 67 +++++++++++++++++++++++-----------------
     threadproc/beos/thread.c |  7 +++--
     2 files changed, 42 insertions(+), 32 deletions(-)
    
    diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c
    index 6f58f24b74e..ddf8349d4ab 100644
    --- a/threadproc/beos/proc.c
    +++ b/threadproc/beos/proc.c
    @@ -283,48 +283,57 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
     APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,
                                                       int *exitcode,
                                                       apr_exit_why_e *exitwhy,
    -                                          apr_wait_how_e waithow, apr_pool_t *p)
    +                                                  apr_wait_how_e waithow, 
    +                                                  apr_pool_t *p)
     {
    +    proc->pid = -1;
    +    return apr_proc_wait(proc, exitcode, exitwhy, waithow);
    +} 
    +
    +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
    +                                        int *exitcode, 
    +                                        apr_exit_why_e *exitwhy,
    +                                        apr_wait_how_e waithow)
    +{
    +    pid_t pstatus;
         int waitpid_options = WUNTRACED;
    +    int exit_int;
    +    int ignore;
    +    apr_exit_why_e ignorewhy;
    +
    +    if (exitcode == NULL) {
    +        exitcode = &ignore;
    +    }
    +    if (exitwhy == NULL) {
    +        exitwhy = &ignorewhy;
    +    }
     
         if (waithow != APR_WAIT) {
             waitpid_options |= WNOHANG;
         }
    -
    -    if ((proc->pid = waitpid(-1, status, waitpid_options)) > 0) {
    +    
    +    if ((pstatus = waitpid(proc->pid, &exit_int, waitpid_options)) > 0) {
    +        proc->pid = pstatus;
    +        if (WIFEXITED(exit_int)) {
    +            *exitwhy = APR_PROC_EXIT;
    +            *exitcode = WEXITSTATUS(exit_int);
    +        }
    +        else if (WIFSIGNALED(exit_int)) {
    +            *exitwhy = APR_PROC_SIGNAL;
    +            *exitcode = WTERMSIG(exit_int);
    +        }
    +        else {
    +            /* unexpected condition */
    +            return APR_EGENERAL;
    +        }
             return APR_CHILD_DONE;
         }
    -    else if (proc->pid == 0) {
    +    else if (pstatus == 0) {
             return APR_CHILD_NOTDONE;
         }
         return errno;
     } 
     
    -APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
    -                                        int *exitcode, apr_exit_why_e *exitwhy,
    -                                        apr_wait_how_e waithow)
    -{
    -    status_t rv;
    -
    -    if (!proc)
    -        return APR_ENOPROC;
    -    /* when we run processes we are actually running threads, so here
    -       we'll wait on the thread dying... */
    -    if (wait == APR_WAIT) {
    -        if ((rv = wait_for_thread(proc->pid, exitcode)) == B_OK) {
    -            return APR_CHILD_DONE;
    -        }
    -        return rv;
    -    }
    -    /* if the thread is still alive then it's not done...
    -       this won't hang or holdup the thread checking... */
    -    if (resume_thread(proc->pid) == B_BAD_THREAD_ID) {
    -        return APR_CHILD_DONE;
    -    }
    -    /* if we get this far it's still going... */
    -    return APR_CHILD_NOTDONE;
    -} 
    -
     APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in,
                                        apr_file_t *parent_in)
     {
    diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c
    index 398c6a43f80..ec9327e86e8 100644
    --- a/threadproc/beos/thread.c
    +++ b/threadproc/beos/thread.c
    @@ -144,14 +144,15 @@ int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2)
     APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t *retval)
     {
         apr_pool_destroy(thd->cntxt);
    -	exit_thread ((status_t)(*retval));
    -	return APR_SUCCESS;
    +    exit_thread ((status_t)(*retval));
    +    /* This will never be reached... */
    +    return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd)
     {
         status_t rv = 0, ret;
    -    if ((ret = wait_for_thread(thd->td,&rv)) == B_NO_ERROR) {
    +    if ((ret = wait_for_thread(thd->td, &rv)) == B_NO_ERROR) {
             *retval = rv;
             return APR_SUCCESS;
         }
    
    From 8fa1458fa46c18a994423f42f73575ff996bc661 Mon Sep 17 00:00:00 2001
    From: Sander Striker 
    Date: Mon, 29 Oct 2001 12:47:13 +0000
    Subject: [PATCH 2472/7878] autoconf 2.52 creates a temporary 'autom4te.cache'
     directory. Remove it after buildconf, or when someone runs autoconf manually,
     remove it on make clean.
    
    Submitted by:   Joe Orton  [buildconf]
    Suggestions by: Greg Stein [make clean]
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62472 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/rules.mk.in | 5 ++++-
     buildconf         | 3 +++
     2 files changed, 7 insertions(+), 1 deletion(-)
    
    diff --git a/build/rules.mk.in b/build/rules.mk.in
    index 2942dddca5e..c18b6353ce8 100644
    --- a/build/rules.mk.in
    +++ b/build/rules.mk.in
    @@ -176,9 +176,12 @@ clean-recursive distclean-recursive extraclean-recursive:
     	    $(MAKE) "local-$$otarget"; \
     	fi
     
    +# autoconf 2.5x is creating a 'autom4te.cache' directory
    +# In case someone ran autoconf by hand, get rid of that directory
    +# aswell.
     local-clean: x-local-clean
     	$(RM) -f *.o *.lo *.a *.la *.so *.obj $(CLEAN_TARGETS) $(PROGRAMS)
    -	$(RM) -rf .libs
    +	$(RM) -rf .libs autom4te.cache
     
     local-distclean: local-clean x-local-distclean
     	$(RM) -f Makefile $(DISTCLEAN_TARGETS)
    diff --git a/buildconf b/buildconf
    index 18706de643e..cb30626ce86 100755
    --- a/buildconf
    +++ b/buildconf
    @@ -104,4 +104,7 @@ echo "Creating configure ..."
     ### do some work to toss config.cache?
     autoconf
     
    +# Remove autoconf 2.5x's cache directory
    +rm -rf autom4te.cache
    +
     exit 0
    
    From 8ed7a0af5d2490c8dd8578658dabc8656064e67e Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 29 Oct 2001 14:54:19 +0000
    Subject: [PATCH 2473/7878]   Introduce the apr_pool_userdata_setn() variant
     that doesn't strdup the key.
    
      Support for passing NULL as the cleanup callback, so items that don't
      require a cleanup need not incur the overhead of registering a no-op.
    
    Submitted by:	Brian Pane 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62473 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                 |  4 ++++
     include/apr_pools.h     | 20 +++++++++++++++++++-
     memory/unix/apr_pools.c | 21 ++++++++++++++++++++-
     3 files changed, 43 insertions(+), 2 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 2d6d8856f48..d5e59273032 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,9 @@
     Changes with APR b1  
     
    +  *) Introduce the apr_pool_userdata_setn() variant that doesn't 
    +     strdup the key.  Allows both the _setn() and _set() variant to 
    +     accept NULL for the cleanup.  [Brian Pane prog_data, key, keylen, data);
         }
     
    -    apr_pool_cleanup_register(cont, data, cleanup, cleanup);
    +    if (cleanup) {
    +        apr_pool_cleanup_register(cont, data, cleanup, cleanup);
    +    }
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, const char *key,
    +       apr_status_t (*cleanup) (void *),
    +       apr_pool_t *cont)
    +{
    +    apr_size_t keylen = strlen(key);
    +
    +    if (cont->prog_data == NULL)
    +        cont->prog_data = apr_hash_make(cont);
    +
    +    apr_hash_set(cont->prog_data, key, keylen, data);
    +
    +    if (cleanup) {
    +        apr_pool_cleanup_register(cont, data, cleanup, cleanup);
    +    }
         return APR_SUCCESS;
     }
     
    
    From d165741803e36b1da9f6b575dd5af6a567a93945 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 29 Oct 2001 17:29:32 +0000
    Subject: [PATCH 2474/7878] BeOS threads can exit in strange orders, even in
     testthread they will often exit in an order different from that they were
     started in, so store the thread exitval and if we miss the death of a thread
     when calling thread_join we return the stored value.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62474 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/beos/threadproc.h |  1 +
     threadproc/beos/thread.c       | 11 ++++++++++-
     2 files changed, 11 insertions(+), 1 deletion(-)
    
    diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h
    index 76cb7de2dd2..90bc6db20e9 100644
    --- a/include/arch/beos/threadproc.h
    +++ b/include/arch/beos/threadproc.h
    @@ -82,6 +82,7 @@ struct apr_thread_t {
         thread_id td;
         void *data;
         apr_thread_start_t func;
    +    apr_status_t exitval;
     };
     
     struct apr_threadattr_t {
    diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c
    index ec9327e86e8..c5b69a9681c 100644
    --- a/threadproc/beos/thread.c
    +++ b/threadproc/beos/thread.c
    @@ -109,6 +109,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t
         (*new)->cntxt = pool;
         (*new)->data = data;
         (*new)->func = func;
    +    (*new)->exitval = -1;
     
         /* First we create the new thread...*/
     	if (attr)
    @@ -144,6 +145,7 @@ int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2)
     APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t *retval)
     {
         apr_pool_destroy(thd->cntxt);
    +    thd->exitval = *retval;
         exit_thread ((status_t)(*retval));
         /* This will never be reached... */
         return APR_SUCCESS;
    @@ -157,7 +159,14 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *th
             return APR_SUCCESS;
         }
         else {
    -        return ret;
    +        /* if we've missed the thread's death, did we set an exit value prior
    +         * to it's demise?  If we did return that.
    +         */
    +        if (thd->exitval != -1) {
    +            *retval = thd->exitval;
    +            return APR_SUCCESS;
    +        } else 
    +            return ret;
         }
     }
     
    
    From def6fc10a4641b36557ff91a96eea2da51bc28a6 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Mon, 29 Oct 2001 17:37:12 +0000
    Subject: [PATCH 2475/7878] Tidy up the thread test output and change to use a
     single thread function as they were all identical anyway!
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62475 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testthread.c | 122 ++++++++++++++--------------------------------
     1 file changed, 37 insertions(+), 85 deletions(-)
    
    diff --git a/test/testthread.c b/test/testthread.c
    index 7a5aca23fc9..d5374ae0cfc 100644
    --- a/test/testthread.c
    +++ b/test/testthread.c
    @@ -59,6 +59,7 @@
     #include "errno.h"
     #include 
     #include 
    +#include "apr_time.h"
     #if APR_HAVE_UNISTD_H
     #include 
     #endif
    @@ -78,7 +79,6 @@ void * APR_THREAD_FUNC thread_func2(apr_thread_t *thd, void *data);
     void * APR_THREAD_FUNC thread_func3(apr_thread_t *thd, void *data);
     void * APR_THREAD_FUNC thread_func4(apr_thread_t *thd, void *data);
     
    -
     apr_lock_t *thread_lock;
     apr_pool_t *context;
     apr_thread_once_t *control = NULL;
    @@ -106,134 +106,86 @@ void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data)
         return NULL;
     } 
     
    -void * APR_THREAD_FUNC thread_func2(apr_thread_t *thd, void *data)
    -{
    -    int i;
    -
    -    apr_thread_once(control, init_func);
    -
    -    for (i = 0; i < 10000; i++) {
    -        apr_lock_acquire(thread_lock);
    -        x++;
    -        apr_lock_release(thread_lock);
    -    }
    -    apr_thread_exit(thd, &exit_ret_val);
    -    return NULL;
    -} 
    -
    -void * APR_THREAD_FUNC thread_func3(apr_thread_t *thd, void *data)
    -{
    -    int i;
    -
    -    apr_thread_once(control, init_func);
    -
    -    for (i = 0; i < 10000; i++) {
    -        apr_lock_acquire(thread_lock);
    -        x++;
    -        apr_lock_release(thread_lock);
    -    }
    -    apr_thread_exit(thd, &exit_ret_val);
    -    return NULL;
    -} 
    -
    -void * APR_THREAD_FUNC thread_func4(apr_thread_t *thd, void *data)
    -{
    -    int i;
    -
    -    apr_thread_once(control, init_func);
    -
    -    for (i = 0; i < 10000; i++) {
    -        apr_lock_acquire(thread_lock);
    -        x++;
    -        apr_lock_release(thread_lock);
    -    }
    -    apr_thread_exit(thd, &exit_ret_val);
    -    return NULL;
    -} 
    -
     int main(void)
     {
         apr_thread_t *t1;
         apr_thread_t *t2;
         apr_thread_t *t3;
         apr_thread_t *t4;
    -    apr_status_t s1;
    -    apr_status_t s2;
    -    apr_status_t s3;
    -    apr_status_t s4;
    -
    +    apr_status_t r1, r2, r3, r4;
    +    apr_status_t s1, s2, s3, s4;
         apr_initialize();
     
    -    fprintf(stdout, "Initializing the context......."); 
    +    printf("APR Simple Thread Test\n======================\n\n");
    +    
    +    printf("%-60s", "Initializing the context"); 
         if (apr_pool_create(&context, NULL) != APR_SUCCESS) {
             fflush(stdout);
    -        fprintf(stderr, "could not initialize\n");
    +        fprintf(stderr, "Failed.\nCould not initialize\n");
             exit(-1);
         }
    -    fprintf(stdout, "OK\n");
    +    printf("OK\n");
     
         apr_thread_once_init(&control, context);
     
    -    fprintf(stdout, "Initializing the lock......."); 
    -    s1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); 
    -    if (s1 != APR_SUCCESS) {
    +    printf("%-60s", "Initializing the lock"); 
    +    r1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); 
    +    if (r1 != APR_SUCCESS) {
             fflush(stdout);
    -        fprintf(stderr, "Could not create lock\n");
    +        fprintf(stderr, "Failed\nCould not create lock\n");
             exit(-1);
         }
    -    fprintf(stdout, "OK\n");
    -
    -    fprintf(stdout, "Starting all the threads......."); 
    -    s1 = apr_thread_create(&t1, NULL, thread_func1, NULL, context);
    -    s2 = apr_thread_create(&t2, NULL, thread_func2, NULL, context);
    -    s3 = apr_thread_create(&t3, NULL, thread_func3, NULL, context);
    -    s4 = apr_thread_create(&t4, NULL, thread_func4, NULL, context);
    -    if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || 
    -        s3 != APR_SUCCESS || s4 != APR_SUCCESS) {
    +    printf("OK\n");
    +
    +    printf("%-60s", "Starting all the threads"); 
    +    r1 = apr_thread_create(&t1, NULL, thread_func1, NULL, context);
    +    r2 = apr_thread_create(&t2, NULL, thread_func1, NULL, context);
    +    r3 = apr_thread_create(&t3, NULL, thread_func1, NULL, context);
    +    r4 = apr_thread_create(&t4, NULL, thread_func1, NULL, context);
    +    if (r1 != APR_SUCCESS || r2 != APR_SUCCESS || 
    +        r3 != APR_SUCCESS || r4 != APR_SUCCESS) {
             fflush(stdout);
    -        fprintf(stderr, "Error starting thread\n");
    +        fprintf(stderr, "Failed\nError starting thread\n");
             exit(-1);
         }
    -    fprintf(stdout, "OK\n");
    +    printf("OK\n");
     
    -    fprintf(stdout, "Waiting for threads to exit.......");
    +    printf("%-60s", "Waiting for threads to exit");
    +    fflush(stdout);
         apr_thread_join(&s1, t1);
         apr_thread_join(&s2, t2);
         apr_thread_join(&s3, t3);
         apr_thread_join(&s4, t4);
    -    fprintf(stdout, "OK\n");
    +    printf("OK\n");
     
    -    fprintf(stdout, "Checking thread's returned value.......");
    +    printf("%-60s", "Checking thread's returned value");
         if (s1 != exit_ret_val || s2 != exit_ret_val ||
             s3 != exit_ret_val || s4 != exit_ret_val) {
             fflush(stdout);
             fprintf(stderr, 
    -                "Invalid return value %d/%d/%d/%d (not expected value %d)\n",
    +                "Invalid return value\nGot %d/%d/%d/%d, but expected %d for all 4\n",
                     s1, s2, s3, s4, exit_ret_val);
             exit(-1);
         }
    -    fprintf(stdout, "OK\n");
    +    printf("OK\n");
     
    -    fprintf(stdout, "Checking if locks worked......."); 
    +    printf("%-60s", "Checking if locks worked"); 
         if (x != 40000) {
             fflush(stdout);
    -        fprintf(stderr, "The locks didn't work????  %d\n", x);
    +        fprintf(stderr, "No!\nThe locks didn't work????  x = %d instead of 40,000\n", x);
             exit(-1);
         }
    -    else {
    -        fprintf(stdout, "Everything is working!\n");
    -    }
    +    printf("OK\n");
     
    -    fprintf(stdout, "Checking if apr_thread_once worked.......");
    +    printf("%-60s", "Checking if apr_thread_once worked");
         if (value != 1) {
             fflush(stdout);
    -        fprintf(stderr, "apr_thread_once must not have worked, "
    -                "value is %d\n", value);
    +        fprintf(stderr, "Failed!\napr_thread_once must not have worked, "
    +                "value is %d instead of 1\n", value);
             exit(-1);
         }
    -    else {
    -        fprintf(stdout, "apr_thread_once worked\n");
    -    }
    +    printf("OK\n");
    +
         return 0;
     }
     
    
    From f455c189777abf1883292c69798b750878cd855a Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Mon, 29 Oct 2001 23:04:08 +0000
    Subject: [PATCH 2476/7878] Added the NetWare delay() call to apr_sleep()
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62476 13f79535-47bb-0310-9956-ffa450edef68
    ---
     time/unix/time.c | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/time/unix/time.c b/time/unix/time.c
    index 1c26f8704ad..e5a06923623 100644
    --- a/time/unix/time.c
    +++ b/time/unix/time.c
    @@ -265,6 +265,8 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t)
         DosSleep(t/1000);
     #elif defined(BEOS)
         snooze(t);
    +#elif defined(NETWARE)
    +    delay(t);
     #else
         struct timeval tv;
         tv.tv_usec = t % APR_USEC_PER_SEC;
    
    From 00718bd19eb5db228008ec9bfa5e3b26524636b6 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Mon, 29 Oct 2001 23:07:42 +0000
    Subject: [PATCH 2477/7878] Updated NetWare project file
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62477 13f79535-47bb-0310-9956-ffa450edef68
    ---
     libaprnw.mcp.zip | Bin 120900 -> 115035 bytes
     1 file changed, 0 insertions(+), 0 deletions(-)
    
    diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip
    index 1959c1a80cd13ae7069e6c5fd7e1e0b688264fd3..fae1b0cb3a3f3c17b92a14e985b33cb5bbf93931 100644
    GIT binary patch
    literal 115035
    zcmafacT`isx3!9ZfPhk@cMy>#U0P@YL8SK*P*AFX(n}JQBGQ9MuS)1mqzOn6ktRJP
    zbO=ZdNKYt%z!%^9z4hLI-&%Lg%AL70lY3{*o;myMG1e!$&UEF5&tJk
    zKdxTU8DYM1la%|?-RapYU+*9ZFXvZ(^C+KkXwST}GR&pm(&;)RyZDx_4^Cb!T6Lcxa5%L}@suupYn0ulhA-FXyz{gtESvw0mDL}Q
    zM^Usjs95Cc>oaASs>zq+@O#DhE8Pv{&d~R39N0EB!W!l5a{Ll;oRq^14oDAjUY&^EO+_5h|ceN)PY$CbB0}&RGn}mRZ&tLhxCS`sEXgar>(WEael*Z?xkNo=hs+
    zRle&Hk!@wsWyx7weBvpQ^Gm_ERmJNttF~b%%qgGZuEVZa-h+(qmE!R&O@a6z^8sz5
    z<*Yznd~9f7!WJhnR%U{W!dX2o+7Waq8rZS%N1Bb#P?V4NFK>Jcpo=18oYxiXtI=7Cw4=|
    z(99AfNZ;AJhy71x`
    z!BtP8#E6L3`LD_G&%&#Iuu$EZ%9xzpa4isWeQ?Z`B_9%H@2YdU^5NMy*}hw_32!U!
    znk94J1!!A@rkiZcn0H44#OY40OO{uWH@a?u?*mw2T%NWy&HiX2`ylakCZ|F)>|^Tr
    z&@7jEIm_2DsN2!UgAatoYnSJ*P10Qwh0siXud{?BM>LdJ^zsvvX)vqUQqh$6$BK|w%3PSTQ3{ebEYm%qm<_x`)&FyG>lY5vxWwoM9pSRhf-TvD<-a@6S|H(S^V;hGv>dj
    zX2Za-J)z#HY}Jou0q%{jVxaWjzvNBCisThA_}=`>*K7Z#ffLIQk57@%Xl24m!v|7o
    z)LR*__u-W(H5#pVuu5SyGb237#mjg@Ll7m!19VM8$+}Lb{TK;=Z#t~!s<8kV@T$Fg)N*%v0aG(~=SyX?
    zX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-GGh~+U-MW))j4FJw$D5gY!>`1N)O0QJCt*(E5RokMnIV zpI1(aQN;8PS3)hlKOdMS7$)LW%}DmMzyr-fp9=>1u2OdUnusiagIDJL&q6xck} z57+R{ltI4j7>>8~R&EoeUZ0L=?LS`<2pD0_@>(3;;QLYRULPW^!2nTGrbXSh949@| z8)Jz1Fljj2)}l&D|7jmmgcO{@AGAw3t}GZ1a??V;y3#oU3)q*&z4LPDZxoxTsxPQ< zR@O@p?CUfcq;%nc5QHJV3iDKVtE6h;-35fMG!5^0j z_XU){lxa3<*K+%X4i=-li>N>MTm=j5IgdRs##p1Wu-Ev zyHN=URN);|k*y>;Z#Lp5_q=IK$H93t5%F^1qnf!-s}M{1^Le3{bNp>uPtv6VWimu} zD!;{`XK*j<`_y$z@GA)Vss?w?&(tV32l88J_|)EK9Gr-hOyizD8oKtZ+%ZW1@_5)Q zMYQ*q*{C;I({CymoMGtFfJa6Hrs(WMB@bb>4BSc(j3`%E+8s>*Q0f(7VSj@tm z*`mAb*h4D@8_E42%lg&c2ekPv;q7;gGtH?a7uLV$i-97kLf!-yW7-fK={gf0K5L-* zQ<-S_<+V-9cxc405h~OiiT^G9soj;GYm*T@K2?L>z`u%w)XDSVu*UdE=ZOpw->Bes z@dO`w!v-v}AG99?0__4Fd2X+x@qXXq@55k_LWewPkFfOrk3*ownEydOkMG|L2=WWl Z_w@+4VIwZ_zcR4!G! Date: Fri, 2 Nov 2001 18:10:59 +0000 Subject: [PATCH 2478/7878] Switched the project file to build APR as a single unit rather than multiple libraries git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62479 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 115035 -> 111022 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index fae1b0cb3a3f3c17b92a14e985b33cb5bbf93931..8c959c6d61f791e70a666661d828a6512e0805b4 100644 GIT binary patch literal 111022 zcmZs@cT`hBw>~T&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(y&yNTx^F~TD^5~eT=RSLd z?X`a@c7%o@ws$NXJ7qcc(wYN=YW=0dAysa~swEQaSup6$~1m>wSGh47SAA6e8 z^~E&!?~EEvAi1T?7K7bPy~h!O7aBaC0p~Q9vM$_Q+SSB0V6!iTH~RztE4giJp>{(x zzmQu`LM_CF9$$ct9tuAsJ0>7TfUX^lr-#ZAncHQJBFmj8re-%e%O`CxOG7sw-Z9_$ znq9s|th3s#P#h#!)>ce0rJ2DDT9QLdK!yN={sG<|jo;VPm9)Q>v&X0+?jlIgbH)WU zvu^(=vu!S>rV%n5nXsf_<9P5#iUoDFYI^Nw!Vq+0wQW4r3NaQTUYqW;-Pc26_by71 z2PQ_8==gty!Wrbd!-f=BUygUA*|(7~1CUzFO!||SIwSDrMHe^f>O&7PD;clwv!f;Q zW}Ai~Jd80qMhvmrL77Rm$2hgTT}&t9v@@qEE$u$?Q<9LE;`c8f`Q$L+30nqL85N@B zqu_BqZo(kvW}Cd^3b~Q1sPJRvBwoa)zAs$p8#n06sKPa9wn;}@g9O$@Nwl1eU*gso z0SIVI`k8gfJy->FXClK6FHP)fnS zf=4~#=@J?6LFlgiml9eh*$AjDs zW96h4r#Ox=*2)F8h5g+v_~o2&(`4j!_tahh-P272IJ+ z(Q5-4qFUgxKoB*BvB?gF>4PoL@Y!xihyV#Yd6y0~Lz#gMC2%qwnlAf1hB-!^o8O$s z<|}f^v28YxlrylZ3CZ~>3}mAU$N{>Fm2LbK9r$C1 zV0le5nMh;s0pIL2+*?)%OP`2@hzbm}a62KpD}|rgDy%wy!dNC%V2yHXJ41crU9suo zrD|?LO&q)pQQ2)5Bd$p_XM?_1+b#}k6n@UUEVxR9y%^eyx);+4I&Lx_KgzAzQUb6Z9#M{l_T-@X?)ApJ4vJD|eqWhF($xgK(wi#mW Date: Fri, 2 Nov 2001 18:14:37 +0000 Subject: [PATCH 2479/7878] Consolidated the APR imports into a single import file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62480 13f79535-47bb-0310-9956-ffa450edef68 --- build/prebuildNW.bat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/prebuildNW.bat b/build/prebuildNW.bat index 161e0b1b3d2..841a9f2597a 100755 --- a/build/prebuildNW.bat +++ b/build/prebuildNW.bat @@ -15,6 +15,7 @@ copy ..\include\apr.hnw ..\include\apr.h copy ..\..\apr-util\include\apu.h.in ..\..\apr-util\include\apu.h copy ..\..\apr-util\include\private\apu_config.hw ..\..\apr-util\include\private\apu_config.h copy ..\..\apr-util\xml\expat\lib\expat.h.in ..\..\apr-util\xml\expat\lib\expat.h +copy ..\..\apr-util\xml\expat\lib\config.hnw ..\..\apr-util\xml\expat\lib\config.h copy ..\..\apr-util\include\private\apu_select_dbm.hw ..\..\apr-util\include\private\apu_select_dbm.h @echo Fixing up the pcre headers @@ -23,4 +24,4 @@ copy ..\..\pcre\pcre.hw ..\..\pcre\pcre.h @echo Generating the import list... awk -f make_nw_export.awk ..\include\*.h |sort > ..\aprlib.imp -awk -f make_nw_export.awk ..\..\apr-util\include\*.h |sort > ..\aprutil.imp +awk -f make_nw_export.awk ..\..\apr-util\include\*.h |sort >> ..\aprlib.imp From a83531cce3c7487b0b78a9d6a82c1eacad9cdb12 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 2 Nov 2001 18:16:46 +0000 Subject: [PATCH 2480/7878] Added the XML #defines git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62481 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/pre_nw.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/arch/netware/pre_nw.h b/include/arch/netware/pre_nw.h index c75da3a5c72..1078b1f16c3 100644 --- a/include/arch/netware/pre_nw.h +++ b/include/arch/netware/pre_nw.h @@ -39,6 +39,16 @@ typedef unsigned long long uint64_t; #define __int64 long long #endif +/* expat version */ +#define VERSION "expat_1.95.1" +#define EXPAT_MAJOR_VERSION 1 +#define EXPAT_MINOR_VERSION 95 +#define EXPAT_EDIT 2 + +#define XML_MAJOR_VERSION EXPAT_MAJOR_VERSION +#define XML_MINOR_VERSION EXPAT_MINOR_VERSION +#define XML_MICRO_VERSION EXPAT_EDIT + #endif From 0cd7a90fb6536364a0bbee93d5d5e8e062083afe Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 2 Nov 2001 18:18:49 +0000 Subject: [PATCH 2481/7878] Removed a duplicate version of pre_nw.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62482 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/pre_nw.h | 54 ------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 misc/netware/pre_nw.h diff --git a/misc/netware/pre_nw.h b/misc/netware/pre_nw.h deleted file mode 100644 index 582ad42830f..00000000000 --- a/misc/netware/pre_nw.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef __pre_nw__ -#define __pre_nw__ - -#pragma precompile_target "precomp.mch" -#define NETWARE - - -#define N_PLAT_NLM - -/* hint for MSL C++ that we're on NetWare platform */ -#define __NETWARE__ - -/* the FAR keyword has no meaning in a 32-bit environment - but is used in the SDK headers so we take it out */ -#define FAR -#define far - -/* no-op for Codewarrior C compiler; a functions are cdecl - by default */ -#define cdecl - -/* if we have wchar_t enabled in C++, predefine this type to avoid - a conflict in Novell's header files */ -#if (__option(cplusplus) && __option(wchar_type)) -#define _WCHAR_T -#endif - -/* C9X defintion used by MSL C++ library */ -#define DECIMAL_DIG 17 - -/* define long long typedefs for Watcom compatiblity */ -typedef long long int64_t; -typedef unsigned long long uint64_t; - -/* some code may want to use the MS convention for long long */ -#ifndef __int64 -#define __int64 long long -#endif - -/* expat version */ -#define VERSION "expat_1.95.1" -#define EXPAT_MAJOR_VERSION 1 -#define EXPAT_MINOR_VERSION 95 -#define EXPAT_EDIT 2 - -#define XML_MAJOR_VERSION EXPAT_MAJOR_VERSION -#define XML_MINOR_VERSION EXPAT_MINOR_VERSION -#define XML_MICRO_VERSION EXPAT_EDIT - - -#endif - - - From 5ee312194c143683cf36f882058a0b281ee61e28 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 2 Nov 2001 18:22:35 +0000 Subject: [PATCH 2482/7878] Removed a reference to an obsolete import file git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62483 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/aprlib.def | 1 - 1 file changed, 1 deletion(-) diff --git a/misc/netware/aprlib.def b/misc/netware/aprlib.def index f4ecbae5bc0..0a2a01eb8f3 100644 --- a/misc/netware/aprlib.def +++ b/misc/netware/aprlib.def @@ -1,4 +1,3 @@ MODULE LIBC.NLM MODULE WS2_32.NLM EXPORT @aprlib.imp -EXPORT @aprutil.imp From 34c44fffd64ce5508a7eca9ffb1f4a554f508d30 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 2 Nov 2001 23:26:15 +0000 Subject: [PATCH 2483/7878] Turn off debug mode for the NetWare locking calls git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62484 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/locks.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/arch/netware/locks.h b/include/arch/netware/locks.h index 9a747e79d8c..b8ecaa83566 100644 --- a/include/arch/netware/locks.h +++ b/include/arch/netware/locks.h @@ -55,6 +55,8 @@ #ifndef LOCKS_H #define LOCKS_H +#define NDEBUG + #include "apr_lock.h" #include From d545c28378f353839aba9bb8d4c7c9f1bcf6cf9e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 2 Nov 2001 23:27:16 +0000 Subject: [PATCH 2484/7878] Implemented apr_cond_timedwait git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62485 13f79535-47bb-0310-9956-ffa450edef68 --- locks/netware/thread_cond.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c index d5562311eaa..ff0379e4a20 100644 --- a/locks/netware/thread_cond.c +++ b/locks/netware/thread_cond.c @@ -103,7 +103,11 @@ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, apr_interval_time_t timeout){ - return APR_ENOTIMPL; + if (NXCondTimedWait(cond->cond, mutex->mutex, + (timeout*1000)/NXGetSystemTick()) == NX_ETIMEDOUT) { + return APR_TIMEUP; + } + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) From 58258780f82a95e95e77c7136a438c4f395f0f45 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 2 Nov 2001 23:28:19 +0000 Subject: [PATCH 2485/7878] Adjusted to deal with microseconds git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62486 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/time/unix/time.c b/time/unix/time.c index e5a06923623..4631011277a 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -266,7 +266,7 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t) #elif defined(BEOS) snooze(t); #elif defined(NETWARE) - delay(t); + delay(t/1000); #else struct timeval tv; tv.tv_usec = t % APR_USEC_PER_SEC; From e4b3b91ec0030f44309151ed2bc9f116f3cca0c6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 3 Nov 2001 01:54:15 +0000 Subject: [PATCH 2486/7878] remove description of a problem which has been fixed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62487 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/STATUS b/STATUS index 9b03220e7ca..5aedbf4943c 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/10/12 21:44:21 $] +Last modified at [$Date: 2001/11/03 01:54:15 $] Release: @@ -15,10 +15,6 @@ Release: RELEASE SHOWSTOPPERS: - * apr_proc_wait() and apr_proc_wait_all_procs() are broken - w.r.t. child processes which exit due to a signal. - Message-ID: - * complete the efforts started by DougM for cleaner fn naming conventions: see proposed name changes in renames_pending and offer up any additions/vetos/clarifications. From 650e064a7f96dc297767a18b5dcf05c75d44b16b Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 5 Nov 2001 19:59:28 +0000 Subject: [PATCH 2487/7878] Header file for the time initialization function git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62488 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/internal_time.h | 62 ++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 include/arch/netware/internal_time.h diff --git a/include/arch/netware/internal_time.h b/include/arch/netware/internal_time.h new file mode 100644 index 00000000000..d4e13f4d7c1 --- /dev/null +++ b/include/arch/netware/internal_time.h @@ -0,0 +1,62 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef TIME_INTERNAL_H +#define TIME_INTERNAL_H + +#include "apr.h" + +void apr_netware_setup_time(void); + +#endif /* TIME_INTERNAL_H */ From d83eace24696249472b324908f1957536eb7410a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 5 Nov 2001 20:00:26 +0000 Subject: [PATCH 2488/7878] Added a call to initialize the time functions for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62489 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/unix/start.c b/misc/unix/start.c index 65ee4bc2ff4..6c67925a2cd 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -99,6 +99,9 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_EEXIST; } #endif +#if defined(NETWARE) + apr_netware_setup_time(); +#endif if ((status = apr_pool_alloc_init(global_apr_pool)) != APR_SUCCESS) return status; From 791f1e092652cd986292ae333f5aa394ab1e8c45 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 5 Nov 2001 20:02:58 +0000 Subject: [PATCH 2489/7878] Added an initialization routine for NetWare and daylight savings handling git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62490 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/time/unix/time.c b/time/unix/time.c index 4631011277a..f81d6268030 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -84,6 +84,15 @@ static apr_int32_t get_offset(struct tm *tm) #elif defined(HAVE___OFFSET) return tm->__tm_gmtoff; #else +#ifdef NETWARE + /* Need to adjust the global variable each time otherwise + the web server would have to be restarted when daylight + savings changes. + */ + if (daylightOnOff) { + return server_gmt_offset + daylightOffset; + } +#endif return server_gmt_offset; #endif } @@ -156,7 +165,7 @@ APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, apr_time_ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) { -#if defined(__EMX__) || defined(NETWARE) +#if defined(__EMX__) /* EMX gcc (OS/2) has a timezone global we can use */ return apr_explode_time(result, input, -timezone); #else @@ -342,3 +351,11 @@ APR_DECLARE(void) apr_unix_setup_time(void) server_gmt_offset = (apr_int32_t) difftime(t1, t2) + (was_dst ? 3600 : 0); #endif } + +#ifdef NETWARE +APR_DECLARE(void) apr_netware_setup_time(void) +{ + tzset(); + server_gmt_offset = -timezone; +} +#endif From 7db3eba44303edbf37bac412b49489d74123c452 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 8 Nov 2001 00:30:50 +0000 Subject: [PATCH 2490/7878] Pre-BONE BeOS doesn't have SO_ERROR so only call the code if we have SO_ERROR. Submitted by: Brad Froehle Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62491 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index e76b7954c2c..974ea626d0c 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -261,7 +261,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { - int rc; + int rc; do { rc = connect(sock->socketdes, @@ -273,19 +273,24 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) * socket; if called again, we can see EALREADY */ if (rc == -1 && (errno == EINPROGRESS || errno == EALREADY) && sock->timeout != 0) { - int error; - apr_socklen_t len = sizeof(error); - rc = apr_wait_for_io_or_timeout(sock, 0); if (rc != APR_SUCCESS) { return rc; } - if ((rc = getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR, (char *)&error, &len)) < 0) { - return errno; - } - if (error) { - return error; + +#ifdef SO_ERROR + { + int error; + apr_socklen_t len = sizeof(error); + if ((rc = getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR, + (char *)&error, &len)) < 0) { + return errno; + } + if (error) { + return error; + } } +#endif /* SO_ERROR */ } if (rc == -1) { From ea7e56fb2deea552ed265fb6be4f6152c3a9b03b Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Fri, 9 Nov 2001 17:50:48 +0000 Subject: [PATCH 2491/7878] Constify the pool accessor functions. Use the DECLARE_ACCESSOR macro for the apr_hash_t, rather than writing it out explicitly (and incorrectly). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62492 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 3 ++- include/apr_pools.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index 345a593b31b..2467886a8f8 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -198,7 +198,8 @@ APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p, * was created in * @param hash the hash table in question */ -APR_DECLARE(apr_pool_t *) apr_hash_pool_get(apr_hash_t *hash); +APR_POOL_DECLARE_ACCESSOR(hash); + /** @} */ #ifdef __cplusplus } diff --git a/include/apr_pools.h b/include/apr_pools.h index 6bd94e230ef..6e9a5d73f1b 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -446,13 +446,13 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); */ #define APR_POOL_DECLARE_ACCESSOR(typename) \ APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ - (apr_##typename##_t *ob) + (const apr_##typename##_t *ob) #define APR_POOL_IMPLEMENT_ACCESSOR(typename) \ APR_POOL_IMPLEMENT_ACCESSOR_X(typename, pool) #define APR_POOL_IMPLEMENT_ACCESSOR_X(typename, fieldname) \ APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ - (apr_##typename##_t *ob) { return ob->fieldname; } + (const apr_##typename##_t *ob) { return ob->fieldname; } /* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t * will not be destroyed before the parent pool */ From 2e41a1f539a224134095da3e0dce5da1abb62eb0 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 9 Nov 2001 22:59:00 +0000 Subject: [PATCH 2492/7878] Add 2 new hash functions. apr_hash_copy & apr_hash_merge. the merge function allows for a callback if both hash's have the same value this changes the overlay function so that it calls the 'merge' Submitted by: Brian Pane Reviewed by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62493 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++ include/apr_hash.h | 34 +++++++++++++ tables/apr_hash.c | 116 +++++++++++++++++++++++++++++++++++++-------- 3 files changed, 135 insertions(+), 19 deletions(-) diff --git a/CHANGES b/CHANGES index d5e59273032..f479a7b789a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) New functions apr_hash_[merge|copy], change to overlay fn + so that it calls merge, which does a inline iteration instead + of calling the iterator function. [Brian Pan array) * (orig->max + 1) + + sizeof(apr_hash_entry_t) * orig->count); + ht->pool = pool; + ht->count = orig->count; + ht->max = orig->max; + ht->array = (apr_hash_entry_t **)((char *)ht + sizeof(apr_hash_t)); + + new_vals = (apr_hash_entry_t *)((char *)(ht) + sizeof(apr_hash_t) + + sizeof(*ht->array) * (orig->max + 1)); + j = 0; + for (i = 0; i <= ht->max; i++) { + apr_hash_entry_t **new_entry = &(ht->array[i]); + apr_hash_entry_t *orig_entry = orig->array[i]; + while (orig_entry) { + *new_entry = &new_vals[j++]; + (*new_entry)->hash = orig_entry->hash; + (*new_entry)->key = orig_entry->key; + (*new_entry)->klen = orig_entry->klen; + (*new_entry)->val = orig_entry->val; + new_entry = &((*new_entry)->next); + orig_entry = orig_entry->next; + } + *new_entry = NULL; + } + return ht; +} + APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, apr_ssize_t klen) @@ -334,11 +369,26 @@ APR_DECLARE(int) apr_hash_count(apr_hash_t *ht) APR_DECLARE(apr_hash_t*) apr_hash_overlay(apr_pool_t *p, const apr_hash_t *overlay, const apr_hash_t *base) +{ + return apr_hash_merge(p, overlay, base, NULL, NULL); +} + +APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, + const apr_hash_t *overlay, + const apr_hash_t *base, + void * (*merger)(apr_pool_t *p, + const void *key, + apr_ssize_t klen, + const void *h1_val, + const void *h2_val, + const void *data), + const void *data) { apr_hash_t *res; - apr_hash_index_t *hi; apr_hash_entry_t *new_vals; - int i,j; + apr_hash_entry_t *iter; + apr_hash_entry_t *ent; + int i,j,k; #ifdef POOL_DEBUG /* we don't copy keys and values, so it's necessary that @@ -361,27 +411,55 @@ APR_DECLARE(apr_hash_t*) apr_hash_overlay(apr_pool_t *p, res->pool = p; res->count = base->count; res->max = (overlay->max > base->max) ? overlay->max : base->max; + if (base->count + overlay->count > res->max) { + res->max = res->max * 2 + 1; + } res->array = alloc_array(res, res->max); - new_vals = apr_palloc(p, sizeof(apr_hash_entry_t) * res->count); + if (base->count + overlay->count) { + new_vals = apr_palloc(p, sizeof(apr_hash_entry_t) * + (base->count + overlay->count)); + } j = 0; - for (hi = apr_hash_first(NULL, (apr_hash_t*)base); hi; hi = apr_hash_next(hi)) { - i = hi->this->hash & res->max; - - new_vals[j].klen = hi->this->klen; - new_vals[j].key = hi->this->key; - new_vals[j].val = hi->this->val; - new_vals[j].hash = hi->this->hash; - new_vals[j].next = res->array[i]; - res->array[i] = &new_vals[j]; - j++; + for (k = 0; k <= base->max; k++) { + for (iter = base->array[k]; iter; iter = iter->next) { + i = iter->hash & res->max; + new_vals[j].klen = iter->klen; + new_vals[j].key = iter->key; + new_vals[j].val = iter->val; + new_vals[j].hash = iter->hash; + new_vals[j].next = res->array[i]; + res->array[i] = &new_vals[j]; + j++; + } } - /* can't simply copy the stuff over, need to set each one so as to - * increment the counts/array properly - */ - for (hi = apr_hash_first(NULL, (apr_hash_t*)overlay); hi; - hi = apr_hash_next(hi)) { - apr_hash_set(res, hi->this->key, hi->this->klen, hi->this->val); + for (k = 0; k < overlay->max; k++) { + for (iter = overlay->array[k]; iter; iter = iter->next) { + i = iter->hash & res->max; + for (ent = res->array[i]; ent; ent = ent->next) { + if ((ent->klen == iter->klen) && + (memcmp(ent->key, iter->key, iter->klen) == 0)) { + if (merger) { + ent->val = (*merger)(p, iter->key, iter->klen, + iter->val, ent->val, data); + } + else { + ent->val = iter->val; + } + break; + } + } + if (!ent) { + new_vals[j].klen = iter->klen; + new_vals[j].key = iter->key; + new_vals[j].val = iter->val; + new_vals[j].hash = iter->hash; + new_vals[j].next = res->array[i]; + res->array[i] = &new_vals[j]; + res->count++; + j++; + } + } } return res; } From 9ef399fcecbdba57f0e7497937a37a3f732f6602 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 10 Nov 2001 01:12:52 +0000 Subject: [PATCH 2493/7878] Most platforms use gnu libtool which puts the .so into .libs/ so we should look there to complete the test. However, BeOS uses a version of libtool that puts the .so into the directory, so we adjust accordingly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62494 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/testdso.c b/test/testdso.c index 06f6d4a97e8..80644ca63f5 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -12,7 +12,11 @@ #ifdef NETWARE #define LIB_NAME "mod_test.nlm" #else -#define LIB_NAME "mod_test.so" + #ifndef BEOS + #define LIB_NAME ".libs/mod_test.so" + #else + #define LIB_NAME "mod_test.so" + #endif #endif int main (int argc, char ** argv) From 659e4f3ecf059937815a655e05018eb8a88ed5f5 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 10 Nov 2001 01:14:49 +0000 Subject: [PATCH 2494/7878] BSDi 4.1 needs to have the _REENTRANT flag set to get a correct build. Not sure about newer/older versions of BSDi, but ISTR that threads were not implemented correctly prior to 4.1 so it shouldn't be an issue with older versions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62495 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 43716e35582..aef22b6bad2 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -135,6 +135,13 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *486-*-bsdi*) APR_ADDTO(CFLAGS, [-m486]) ;; + *-*-bsdi*) + case $host in + *bsdi4.1) + APR_ADDTO(CFLAGS, [-D_REENTRANT]) + ;; + esac + ;; *-openbsd*) APR_ADDTO(CPPFLAGS, [-D_POSIX_THREADS]) ;; From 282d7fdd1269c1bdb2c2cc0580b67dc76c054c31 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 10 Nov 2001 17:58:36 +0000 Subject: [PATCH 2495/7878] Remove a compiler warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62496 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 25663dd50c9..8108b580f00 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -385,7 +385,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, const void *data) { apr_hash_t *res; - apr_hash_entry_t *new_vals; + apr_hash_entry_t *new_vals = NULL; apr_hash_entry_t *iter; apr_hash_entry_t *ent; int i,j,k; From 62a57e2554beb1f47d27aeacfa7cde99dc995068 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 11 Nov 2001 05:51:00 +0000 Subject: [PATCH 2496/7878] Fix some file cleanup problems in apr_proc_create() which could result in the pipes for stdin/stdout/stderr being closed immediately. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62497 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 +++++- threadproc/unix/proc.c | 23 +++++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index f479a7b789a..4f5e476a13d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,12 @@ Changes with APR b1 + *) Fix some file cleanup problems in apr_proc_create() which could + result in the pipes for stdin/stdout/stderr being closed + immediately. [Jeff Trawick] + *) New functions apr_hash_[merge|copy], change to overlay fn so that it calls merge, which does a inline iteration instead - of calling the iterator function. [Brian Pan child_in) { + apr_pool_cleanup_kill(apr_file_pool_get(attr->child_in), + attr->child_in, apr_unix_file_cleanup); + } + if (attr->child_out) { + apr_pool_cleanup_kill(apr_file_pool_get(attr->child_out), + attr->child_out, apr_unix_file_cleanup); + } + if (attr->child_err) { + apr_pool_cleanup_kill(apr_file_pool_get(attr->child_err), + attr->child_err, apr_unix_file_cleanup); + } + + apr_pool_cleanup_for_exec(); + if (attr->child_in) { apr_file_close(attr->parent_in); dup2(attr->child_in->filedes, STDIN_FILENO); @@ -325,8 +342,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, } } - apr_pool_cleanup_for_exec(); - if ((status = limit_proc(attr)) != APR_SUCCESS) { return status; } From b24557da9b1e3686a83dac3b9af5f9cfc106c989 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sun, 11 Nov 2001 07:23:57 +0000 Subject: [PATCH 2497/7878] Add versioning mechanisms/APIs to APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62498 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_version.h | 149 ++++++++++++++++++++++++++++++++++++++++++ misc/unix/Makefile.in | 2 +- misc/unix/version.c | 72 ++++++++++++++++++++ test/.cvsignore | 1 + test/Makefile.in | 6 +- test/testvsn.c | 80 +++++++++++++++++++++++ 6 files changed, 308 insertions(+), 2 deletions(-) create mode 100644 include/apr_version.h create mode 100644 misc/unix/version.c create mode 100644 test/testvsn.c diff --git a/include/apr_version.h b/include/apr_version.h new file mode 100644 index 00000000000..23b68a26c35 --- /dev/null +++ b/include/apr_version.h @@ -0,0 +1,149 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_VERSION_H +#define APR_VERSION_H + +#include "apr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + APR's Version + + There are several different mechanisms for accessing the version. There + is a string form, and a set of numbers; in addition, there are constants + which can be compiled into your application, and you can query the library + being used for its actual version. + + Note that it is possible for an application to detect that it has been + compiled against a different version of APR by use of the compile-time + constants and the use of the run-time query function. + + ### we have not defined source/binary compatibility guidelines yet and + ### how those map against these (release) version numbers. a strawman + ### would be the following text: + + APR is binary-compatible (an app compiled against one version does not + need to be recompiled to work against another version) for the same + MAJOR and MINOR versions. + + APR is source-compatible (an app needs to be recompiled, but will work + the same) for the same MAJOR version. + + If the MAJOR version changes, then an application may need source changes. + + Note that APR is defined to be forward compatible only, meaning that a + given application will be compatible with APR releases moving forward in + time. An application may not be compatible with earlier versions of an + APR library (even if the major and minor versions match). This restriction + is because a later version of APR can introduce new APIs. +*/ + +/* The numeric compile-time version constants. These constants are the + authoritative version numbers for APR. */ +#define APR_MAJOR_VERSION 0 +#define APR_MINOR_VERSION 9 +#define APR_PATCH_VERSION 0 + +/* This symbol is defined for internal, "development" copies of APR. This + symbol will be #undef'd for releases. */ +#define APR_IS_DEV_VERSION + +/* The formatted string of APR's version */ +#define APR_VERSION_STRING \ + APR_STRINGIFY(APR_MAJOR_VERSION) "." \ + APR_STRINGIFY(APR_MINOR_VERSION) "." \ + APR_STRINGIFY(APR_PATCH_VERSION) \ + APR_IS_DEV_STRING + + +/* The numeric version information is broken out into fields within this + structure. */ +typedef struct { + int major; + int minor; + int patch; + int is_dev; +} apr_version_t; + +/* Return APR's version information information in a numeric form. + + @param pvsn Pointer to a version structure for returning the version + information. +*/ +APR_DECLARE(void) apr_version(apr_version_t *pvsn); + +/* Return APR's version information as a string. */ +APR_DECLARE(const char *) apr_version_string(void); + + +/* Internal: helper macros for stringifying the version numbers */ +#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) +#define APR_STRINGIFY_HELPER(n) #n + +/* Internal: string form of the "is dev" flag */ +#ifdef APR_IS_DEV_VERSION +#define APR_IS_DEV_STRING "-dev" +#else +#define APR_IS_DEV_STRING "" +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* APR_VERSION_H */ diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index 729af2a6f86..f6c81bdb8c9 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -1,7 +1,7 @@ TARGETS = \ start.lo getopt.lo otherchild.lo errorcodes.lo rand.lo \ - uuid.lo getuuid.lo + uuid.lo getuuid.lo version.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/misc/unix/version.c b/misc/unix/version.c new file mode 100644 index 00000000000..621ea2f612f --- /dev/null +++ b/misc/unix/version.c @@ -0,0 +1,72 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_version.h" + +APR_DECLARE(void) apr_version(apr_version_t *pvsn) +{ + pvsn->major = APR_MAJOR_VERSION; + pvsn->minor = APR_MINOR_VERSION; + pvsn->patch = APR_PATCH_VERSION; +#ifdef APR_IS_DEV_VERSION + pvsn->is_dev = 1; +#else + pvsn->is_dev = 0; +#endif +} + +APR_DECLARE(const char *) apr_version_string(void) +{ + return APR_VERSION_STRING; +} diff --git a/test/.cvsignore b/test/.cvsignore index 06292c72168..4b3264feaa2 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -48,3 +48,4 @@ testsockets testuser test.fil testprocmutex +testvsn diff --git a/test/Makefile.in b/test/Makefile.in index 767e952a5b1..4019212d1b4 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -30,7 +30,8 @@ PROGRAMS = \ teststr@EXEEXT@ \ testuser@EXEEXT@ \ testsockets@EXEEXT@ \ - testprocmutex@EXEEXT@ + testprocmutex@EXEEXT@ \ + testvsn@EXEEXT@ TARGETS = $(PROGRAMS) @@ -145,4 +146,7 @@ testuser@EXEEXT@: testuser.lo $(LOCAL_LIBS) testprocmutex@EXEEXT@: testprocmutex.lo $(LOCAL_LIBS) $(LINK) testprocmutex.lo $(LOCAL_LIBS) $(ALL_LIBS) +testvsn@EXEEXT@: testvsn.lo $(LOCAL_LIBS) + $(LINK) testvsn.lo $(LOCAL_LIBS) $(ALL_LIBS) + # DO NOT REMOVE diff --git a/test/testvsn.c b/test/testvsn.c new file mode 100644 index 00000000000..1f0b9be59de --- /dev/null +++ b/test/testvsn.c @@ -0,0 +1,80 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include + +#include "apr_version.h" + + +int main(int argc, char **argv) +{ + apr_version_t vsn; + + printf("compiled integer form: %d.%d.%d%s\ncompiled string form: %s\n", + APR_MAJOR_VERSION, APR_MINOR_VERSION, APR_PATCH_VERSION, +#ifdef APR_IS_DEV_VERSION + "-dev", +#else + "", +#endif + APR_VERSION_STRING); + + apr_version(&vsn); + printf("runtime integer form: %d.%d.%d%s\nruntime string form: %s\n", + vsn.major, vsn.minor, vsn.patch, + vsn.is_dev ? "-dev" : "", + apr_version_string()); + + return 0; +} From 4828282489d27bde777e1a9d515ae5a0ed2cdf1f Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 11 Nov 2001 08:26:25 +0000 Subject: [PATCH 2498/7878] We need to import the declaration of memcpy. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62499 13f79535-47bb-0310-9956-ffa450edef68 --- user/unix/userinfo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 27445e4ee76..717b3dc7770 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -65,6 +65,8 @@ #if APR_HAVE_UNISTD_H #include /* for _POSIX_THREAD_SAFE_FUNCTIONS */ #endif +#define APR_WANT_MEMFUNC +#include "apr_want.h" #define PWBUF_SIZE 512 From c27ca30b15ff64a1eed3b7941d4086a36ea87b9d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 11 Nov 2001 16:11:12 +0000 Subject: [PATCH 2499/7878] The dll build of apr is misssing a mktemp.c in build. Submitted by: "Mladen Turk" Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62500 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libapr.dsp b/libapr.dsp index 3a35e9e8118..0cbcf2cb5b8 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -111,6 +111,10 @@ SOURCE=.\file_io\unix\fileacc.c # End Source File # Begin Source File +SOURCE=.\file_io\unix\mktemp.c +# End Source File +# Begin Source File + SOURCE=.\file_io\win32\filedup.c # End Source File # Begin Source File From edb8ccc9bbaf6576afe2cfa3e7c8b39af1314f23 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 11 Nov 2001 16:32:10 +0000 Subject: [PATCH 2500/7878] Don't mix tabs and spaces in the same code segment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62501 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 21148f0fde6..353f340df94 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -109,7 +109,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size if (*nbytes <= 0) { *nbytes = 0; - return APR_SUCCESS; + return APR_SUCCESS; } if (thefile->buffered) { @@ -128,7 +128,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size thefile->dataRead = 0; } - rv = 0; + rv = 0; if (thefile->ungetchar != -1) { *pos = (char)thefile->ungetchar; ++pos; @@ -177,8 +177,8 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size (*nbytes)--; thefile->ungetchar = -1; if (*nbytes == 0) { - *nbytes = bytes_read; - return APR_SUCCESS; + *nbytes = bytes_read; + return APR_SUCCESS; } } @@ -237,7 +237,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a thefile->direction = 1; } - rv = 0; + rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) /* write buffer is full*/ apr_file_flush(thefile); @@ -271,7 +271,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a else { do { rv = write(thefile->filedes, buf, *nbytes); - } while (rv == (apr_size_t)-1 && errno == EINTR); + } while (rv == (apr_size_t)-1 && errno == EINTR); } } #endif From f9f960cf98c8a17283f1b861c6e4684d744ca444 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sun, 11 Nov 2001 22:31:04 +0000 Subject: [PATCH 2501/7878] This patch changes the apr_table_elts macro so that it provides access to the internals of an apr_table_t via a const pointer instead of the current non-const pointer. Submitted by: Brian Pane Reviewed by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62502 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index 373c84dc4a3..27704b814d0 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -137,7 +137,7 @@ struct apr_table_entry_t { * @param t The table * @return An array containing the contents of the table */ -#define apr_table_elts(t) ((apr_array_header_t *)(t)) +#define apr_table_elts(t) ((const apr_array_header_t *)(t)) /** * Determine if the table is empty From 9caca9ef3e4103d15bbb96253b9a9d683b61d433 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 12 Nov 2001 01:16:00 +0000 Subject: [PATCH 2502/7878] Use strerror_r() where available, since strerror() isn't always thread-safe. Example systems where strerror() isn't thread-safe: Linux+glibc, AIX git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62503 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ acconfig.h | 1 + build/apr_common.m4 | 36 +++++++++++++++++++++++++++++++++++- configure.in | 4 ++++ misc/unix/errorcodes.c | 42 +++++++++++++++++++++++++++++++++++++++++- 5 files changed, 85 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 4f5e476a13d..a9268f092e7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Use strerror_r() where available, since strerror() isn't always + thread-safe. Example systems where strerror() isn't thread-safe: + Linux+glibc, AIX [Jeff Trawick] + *) Fix some file cleanup problems in apr_proc_create() which could result in the pipes for stdin/stdout/stderr being closed immediately. [Jeff Trawick] diff --git a/acconfig.h b/acconfig.h index d522cd90cde..cbce0a2fd63 100644 --- a/acconfig.h +++ b/acconfig.h @@ -26,6 +26,7 @@ #undef READDIR_IS_THREAD_SAFE #undef GETHOSTBYNAME_IS_THREAD_SAFE #undef GETHOSTBYADDR_IS_THREAD_SAFE +#undef STRERROR_R_RC_INT #undef NEED_RLIM_T #undef USEBCOPY diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 0bc9ec48fc1..99623fd407e 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -420,7 +420,41 @@ fi rm -f conftest* ])dnl - +dnl +dnl APR_CHECK_STRERROR_R_RC +dnl +dnl Decide which style of retcode is used by this system's +dnl strerror_r(). It either returns int (0 for success, -1 +dnl for failure), or it returns a pointer to the error +dnl string. +dnl +dnl +AC_DEFUN(APR_CHECK_STRERROR_R_RC,[ +AC_MSG_CHECKING(for type of return code from strerror_r) +AC_TRY_RUN([ +#include +#include +main() +{ + char buf[1024]; + if (strerror_r(ERANGE, buf, sizeof buf) < 1) { + exit(0); + } + else { + exit(1); + } +}], [ + ac_cv_strerror_r_rc_int=yes ], [ + ac_cv_strerror_r_rc_int=no ], [ + ac_cv_strerror_r_rc_int=no ] ) +if test "x$ac_cv_strerror_r_rc_int" = xyes; then + AC_DEFINE(STRERROR_R_RC_INT) + msg="int" +else + msg="pointer" +fi +AC_MSG_RESULT([$msg]) +] ) dnl dnl APR_CHECK_ICONV_INBUF dnl diff --git a/configure.in b/configure.in index 2ad5bc183a6..f18433eb221 100644 --- a/configure.in +++ b/configure.in @@ -588,6 +588,10 @@ APR_CHECK_INET_NETWORK AC_SUBST(apr_inaddr_none) AC_CHECK_FUNC(_getch) AC_CHECK_FUNCS(gmtime_r localtime_r) +AC_CHECK_FUNCS(strerror_r, [ strerror_r="1" ], [ strerror_r="0" ]) +if test "$strerror_r" = "1"; then + APR_CHECK_STRERROR_R_RC +fi AC_CHECK_FUNCS(iconv, [ iconv="1" ], [ iconv="0" ]) if test "$iconv" = "1"; then APR_CHECK_ICONV_INBUF diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 029a2b25ccd..8df92f5533c 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -357,11 +357,51 @@ static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) } #endif +#if defined(HAVE_STRERROR_R) && defined(STRERROR_R_RC_INT) +/* AIX and Tru64 style */ +static char *native_strerror(apr_status_t statcode, char *buf, + apr_size_t bufsize) +{ + if (strerror_r(statcode, buf, bufsize) < 0) { + return stuffbuffer(buf, bufsize, + "APR does not understand this error code"); + } + else { + return buf; + } +} +#elif defined(HAVE_STRERROR_R) +/* glibc style */ +static char *native_strerror(apr_status_t statcode, char *buf, + apr_size_t bufsize) +{ + const char *msg; + + buf[0] = '\0'; + msg = strerror_r(statcode, buf, bufsize); + if (buf[0] == '\0') { /* libc didn't use our buffer */ + return stuffbuffer(buf, bufsize, msg); + } + else { + return buf; + } +} +#else +/* plain old strerror(); + * thread-safe on some platforms (e.g., Solaris, OS/390) + */ +static char *native_strerror(apr_status_t statcode, char *buf, + apr_size_t bufsize) +{ + return stuffbuffer(buf, bufsize, strerror(statcode)); +} +#endif + APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize) { if (statcode < APR_OS_START_ERROR) { - return stuffbuffer(buf, bufsize, strerror(statcode)); + return native_strerror(statcode, buf, bufsize); } else if (statcode < APR_OS_START_USEERR) { return stuffbuffer(buf, bufsize, apr_error_string(statcode)); From f534bb2508413d738d2425b53bc671586b1e53ba Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 12 Nov 2001 04:06:51 +0000 Subject: [PATCH 2503/7878] Argh.. water damage all over our new building ;( git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62504 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index a9268f092e7..7b1c23a006c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) change the apr_table_elts macro so that it provides access via + a const pointer instead of a non-const pointer + [Brian Pane Date: Mon, 12 Nov 2001 16:58:37 +0000 Subject: [PATCH 2504/7878] This is a fix for the SymLink tests on Win2k, that is required by the recent fixes to request.c (probably required before that, as well.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62505 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 3 ++- file_io/win32/filestat.c | 19 ++++++++++++++----- include/arch/win32/fileio.h | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 33149933807..5f52ed88221 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -213,7 +213,8 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, fname = thedir->n.entry->cFileName; } - fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) thedir->w.entry, 0); + fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) thedir->w.entry, + 0, wanted); finfo->cntxt = thedir->cntxt; finfo->valid |= APR_FINFO_NAME; diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 19eb96655fe..f85a036c59a 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -297,7 +297,7 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, apr_int32_t wante */ int fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, - int byhandle) + int byhandle, apr_int32_t wanted) { DWORD *sizes = &wininfo->nFileSizeHigh + byhandle; int warn = 0; @@ -349,12 +349,19 @@ int fillin_fileinfo(apr_finfo_t *finfo, finfo->valid = APR_FINFO_ATIME | APR_FINFO_CTIME | APR_FINFO_MTIME | APR_FINFO_SIZE | APR_FINFO_TYPE; /* == APR_FINFO_MIN */ + + /* Only byhandle optionally tests link targets, so tell that caller + * what it wants to hear, otherwise the byattributes is never + * reporting anything but the link. + */ + if (!byhandle || (wanted & APR_FINFO_LINK)) + finfo->valid |= APR_FINFO_LINK; return warn; } APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, - apr_file_t *thefile) + apr_file_t *thefile) { BY_HANDLE_FILE_INFORMATION FileInfo; @@ -362,7 +369,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want return apr_get_os_error(); } - fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 1); + fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 1, wanted); if (finfo->filetype == APR_REG) { @@ -510,7 +517,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, finfo->protection |= APR_WREAD | APR_WEXECUTE | APR_WWRITE; finfo->protection |= (finfo->protection << prot_scope_group) | (finfo->protection << prot_scope_user); - finfo->valid |= APR_FINFO_TYPE | APR_FINFO_PROT | APR_FINFO_MTIME; + finfo->valid |= APR_FINFO_TYPE | APR_FINFO_PROT | APR_FINFO_MTIME + | (wanted & APR_FINFO_LINK); return (wanted &= ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; } else @@ -533,7 +541,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, } if (ident_rv != APR_INCOMPLETE) { - if (fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 0)) + if (fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, + 0, wanted)) { /* Go the extra mile to assure we have a file. WinNT/2000 seems * to reliably translate char devices to the path '\\.\device' diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index ddde31140d4..ee6f94eae61 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -156,7 +156,7 @@ apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, /* Private function for apr_stat/lstat/getfileinfo/dir_read */ int fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, - int byhandle); + int byhandle, apr_int32_t wanted); /* Private function that extends apr_stat/lstat/getfileinfo/dir_read */ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, From 7141fe4676d6b104760c5eb138d218a84f10b971 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Mon, 12 Nov 2001 17:42:56 +0000 Subject: [PATCH 2505/7878] Fix leak of NSObjectFileImage handle. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62507 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 6fe8b0f11c4..ab8fdc55df1 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -137,6 +137,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, #else os_handle = NSLinkModule(image, path, TRUE); #endif + NSDestroyObjectFileImage(image); } #elif defined(DSO_USE_DLFCN) From d3c3c57ff28973ef12852fea8481c6de07152a04 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 12 Nov 2001 17:44:33 +0000 Subject: [PATCH 2506/7878] display the error when pipe-read fails (it does on Unix right now because of the way the test is written; at least the next person won't have to wonder why :) ) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62508 13f79535-47bb-0310-9956-ffa450edef68 --- test/testproc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/testproc.c b/test/testproc.c index d6f2e37cd88..366d707fd75 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -78,8 +78,10 @@ int main(int argc, char *argv[]) apr_file_t *testfile = NULL; apr_size_t length; char *buf; + char msgbuf[120]; const char *args[3]; char *teststr; + apr_status_t rv; if (apr_initialize() != APR_SUCCESS){ printf("Failed to initialize APR\n"); @@ -131,7 +133,7 @@ int main(int argc, char *argv[]) length = 256; printf("%-60s", "Checking the data read from pipe to child"); buf = apr_pcalloc(pool, length); - if (apr_file_read(testfile, buf, &length) == APR_SUCCESS) { + if ((rv = apr_file_read(testfile, buf, &length)) == APR_SUCCESS) { if (!strcmp(buf, teststr)) printf("OK\n"); else { @@ -139,7 +141,10 @@ int main(int argc, char *argv[]) printf(" (I actually got %s_\n", buf); } } - else printf( "Read failed.\n"); + else { + printf("Read failed - (%d) %s\n", + rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); + } TEST_NEQ("Waiting for child to die", apr_proc_wait(&newproc, NULL, NULL, APR_WAIT), From 8280c9286d5a13f33f0d1632fa3c524df92af012 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 12 Nov 2001 19:47:31 +0000 Subject: [PATCH 2507/7878] Fix apr_setup_signal_thread() so that threads don't block synchronous signals (e.g., SIGSEGV). It is a programming error to do so, and some platforms (e.g., Solaris, AIX) don't call any registered signal handler when such signals are blocked. Thanks are due to Dick Dunbar , who pointed this out to me in the context of debugging a threaded module for Apache 1.3. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62509 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 10 ++++++-- threadproc/unix/signals.c | 49 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 7b1c23a006c..42b0d6de82c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,13 @@ Changes with APR b1 - *) change the apr_table_elts macro so that it provides access via - a const pointer instead of a non-const pointer + *) Fix apr_setup_signal_thread() so that threads don't block + synchronous signals (e.g., SIGSEGV). It is a programming error + to do so, and some platforms (e.g., Solaris, AIX) don't call any + registered signal handler when such signals are blocked. + [Jeff Trawick] + + *) Change the apr_table_elts macro so that it provides access via + a const pointer instead of a non-const pointer. [Brian Pane Date: Tue, 13 Nov 2001 19:35:15 +0000 Subject: [PATCH 2508/7878] fix some typos and small inaccuracies in the comments git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62510 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index acb39b4c31f..d905a2bed67 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -282,7 +282,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, apr_pool_t *cont); /** - * Shutdown either reading, writing, or both sides of a tcp socket. + * Shutdown either reading, writing, or both sides of a socket. * @param thesocket The socket to close * @param how How to shutdown the socket. One of: *

    @@ -297,7 +297,7 @@ APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket,
                                            apr_shutdown_how_e how);
     
     /**
    - * Close a tcp socket.
    + * Close a socket.
      * @param thesocket The socket to close 
      */
     APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket);
    @@ -680,7 +680,7 @@ APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset,
      * @param events The events to stop looking for during the poll.  One of:
      * 
      *            APR_POLLIN       signal if read will not block
    - *            APR_POLLPRI      signal if prioirty data is availble to be read
    + *            APR_POLLPRI      signal if priority data is available to be read
      *            APR_POLLOUT      signal if write will not block
      * 
    */ @@ -701,7 +701,7 @@ APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, * @param events The events to clear from all sockets. One of: *
      *            APR_POLLIN       signal if read will not block
    - *            APR_POLLPRI      signal if prioirty data is availble to be read
    + *            APR_POLLPRI      signal if priority data is available to be read
      *            APR_POLLOUT      signal if write will not block
      * 
    */ @@ -713,7 +713,7 @@ APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, * @param event The returned events for the socket. One of: *
      *            APR_POLLIN       Data is available to be read 
    - *            APR_POLLPRI      Prioirty data is availble to be read
    + *            APR_POLLPRI      Priority data is availble to be read
      *            APR_POLLOUT      Write will succeed
      *            APR_POLLERR      An error occurred on the socket
      *            APR_POLLHUP      The connection has been terminated
    @@ -730,7 +730,7 @@ APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event,
     /**
      * Return the data associated with the current poll.
      * @param pollfd The currently open pollfd.
    - * @param key The key to use for retreiving data associated with a poll struct.
    + * @param key The key to use for retrieving data associated with a poll struct.
      * @param data The user data associated with the pollfd.
      */
     APR_DECLARE(apr_status_t) apr_poll_data_get(apr_pollfd_t *pollfd, 
    
    From e8eff3690eef125bba4421d6b78459ffe93a17c6 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 13 Nov 2001 19:46:41 +0000
    Subject: [PATCH 2509/7878] Fix the Unix HAVE_POLL flavor of
     apr_poll_socket_mask() so that it doesn't segfault.  Avoid some wasted
     storage in a poll-related APR structure.
    
    Submitted by:	INOUE Seiichiro 
    Reviewed by:	Jeff Trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62511 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                       | 10 +++++++---
     include/arch/unix/networkio.h |  3 +--
     network_io/unix/poll.c        |  4 ++--
     3 files changed, 10 insertions(+), 7 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 42b0d6de82c..ee0a32173c4 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,9 @@
     Changes with APR b1  
     
    +  *) Fix the Unix HAVE_POLL flavor of apr_poll_socket_mask() so that
    +     it doesn't segfault.  Avoid some wasted storage in a poll-related
    +     APR structure.  [INOUE Seiichiro ]
    +
       *) Fix apr_setup_signal_thread() so that threads don't block
          synchronous signals (e.g., SIGSEGV).  It is a programming error
          to do so, and some platforms (e.g., Solaris, AIX) don't call any
    @@ -8,7 +12,7 @@ Changes with APR b1
     
       *) Change the apr_table_elts macro so that it provides access via
          a const pointer instead of a non-const pointer.
    -     [Brian Pane ]
     
       *) Use strerror_r() where available, since strerror() isn't always
          thread-safe.  Example systems where strerror() isn't thread-safe:
    @@ -20,11 +24,11 @@ Changes with APR b1
     
       *) New functions apr_hash_[merge|copy], change to overlay fn
          so that it calls merge, which does a inline iteration instead
    -     of calling the iterator function. [Brian Pane ]
     
       *) Introduce the apr_pool_userdata_setn() variant that doesn't 
          strdup the key.  Allows both the _setn() and _set() variant to 
    -     accept NULL for the cleanup.  [Brian Pane ]
     
       *) Re-vamp the apr_proc_wait and apr_proc_wait_all functions.  We
          now return the exit code from the program and a reason that the
    diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h
    index 58a1cd0b1bd..c8803e08ce0 100644
    --- a/include/arch/unix/networkio.h
    +++ b/include/arch/unix/networkio.h
    @@ -152,10 +152,9 @@ struct apr_pollfd_t {
         fd_set *read_set;
         fd_set *write_set;
         fd_set *except_set;
    -#endif
         apr_int16_t *events;
         apr_int16_t *revents;
    -
    +#endif
     };
     
     const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size);
    diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c
    index 9e0c27bf94b..5e832fdcd47 100644
    --- a/network_io/unix/poll.c
    +++ b/network_io/unix/poll.c
    @@ -180,8 +180,8 @@ apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset,
             return APR_NOTFOUND;
         } 
         newevents = get_event(events);
    -    if (aprset->events[i] & newevents) {
    -        aprset->events[i] ^= newevents;
    +    if (aprset->pollset[i].events & newevents) {
    +        aprset->pollset[i].events ^= newevents;
         }
     
         return APR_SUCCESS;
    
    From 42cc6a34d51a2f28da8f15e978775c6fad1967e5 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Tue, 13 Nov 2001 21:07:21 +0000
    Subject: [PATCH 2510/7878] NetWare DSO handling routines
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62512 13f79535-47bb-0310-9956-ffa450edef68
    ---
     dso/netware/dso.c | 166 ++++++++++++++++++++++++++++++++++++++++++++++
     1 file changed, 166 insertions(+)
     create mode 100644 dso/netware/dso.c
    
    diff --git a/dso/netware/dso.c b/dso/netware/dso.c
    new file mode 100644
    index 00000000000..66516cfeea4
    --- /dev/null
    +++ b/dso/netware/dso.c
    @@ -0,0 +1,166 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +#include "dso.h"
    +#include "apr_strings.h"
    +#include "apr_portable.h"
    +
    +#include 
    +#include 
    +
    +APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso,
    +                                                apr_os_dso_handle_t osdso,
    +                                                apr_pool_t *pool)
    +{
    +    *aprdso = apr_pcalloc(pool, sizeof **aprdso);
    +    (*aprdso)->handle = osdso;
    +    (*aprdso)->pool = pool;
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *osdso,
    +                                                apr_dso_handle_t *aprdso)
    +{
    +    *osdso = aprdso->handle;
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t dso_cleanup(void *thedso)
    +{
    +    apr_dso_handle_t *dso = thedso;
    +    sym_list *symbol = NULL;
    +    void *NLMHandle = getnlmhandle();
    +
    +    if (dso->handle == NULL)
    +        return APR_SUCCESS;
    +
    +    if (dso->symbols != NULL) {
    +        symbol = dso->symbols;
    +        while (symbol) {
    +            UnImportPublicObject(NLMHandle, symbol->symbol);
    +            symbol = symbol->next;
    +        }
    +    }
    +
    +    if (dlclose(dso->handle) != 0)
    +        return APR_EINIT;
    +
    +    dso->handle = NULL;
    +    dso->symbols = NULL;
    +    dso->path = NULL;
    +
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, 
    +                                       const char *path, apr_pool_t *pool)
    +{
    +
    +    void *os_handle = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
    +
    +    *res_handle = apr_pcalloc(pool, sizeof(**res_handle));
    +
    +    if(os_handle == NULL) {
    +        (*res_handle)->errormsg = dlerror();
    +        return APR_EDSOOPEN;
    +    }
    +
    +    (*res_handle)->handle = (void*)os_handle;
    +    (*res_handle)->pool = pool;
    +    (*res_handle)->errormsg = NULL;
    +    (*res_handle)->symbols = NULL;
    +    (*res_handle)->path = apr_pstrdup(pool, path);
    +
    +    apr_pool_cleanup_register(pool, *res_handle, dso_cleanup, apr_pool_cleanup_null);
    +
    +    return APR_SUCCESS;
    +}
    +    
    +APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle)
    +{
    +    return apr_pool_cleanup_run(handle->pool, handle, dso_cleanup);
    +}
    +
    +APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, 
    +                                      apr_dso_handle_t *handle, 
    +                                      const char *symname)
    +{
    +    sym_list *symbol = NULL;
    +    void *retval = dlsym(handle->handle, symname);
    +
    +    if (retval == NULL) {
    +        handle->errormsg = dlerror();
    +        return APR_EINIT;
    +    }
    +
    +    symbol = apr_pcalloc(handle->pool, sizeof(sym_list));
    +    symbol->next = handle->symbols;
    +    handle->symbols = symbol;
    +    symbol->symbol = apr_pstrdup(handle->pool, symname);
    +
    +    *ressym = retval;
    +    
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, 
    +                                        apr_size_t buflen)
    +{
    +    if (dso->errormsg) {
    +        apr_cpystrn(buffer, dso->errormsg, buflen);
    +        return dso->errormsg;
    +    }
    +    return "No Error";
    +}
    +
    
    From e3c505cfc1c0f80a86ac0333f22dbdb286a6a685 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Tue, 13 Nov 2001 21:09:59 +0000
    Subject: [PATCH 2511/7878] NetWare DSO header
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62513 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/netware/dso.h | 81 ++++++++++++++++++++++++++++++++++++++
     1 file changed, 81 insertions(+)
     create mode 100644 include/arch/netware/dso.h
    
    diff --git a/include/arch/netware/dso.h b/include/arch/netware/dso.h
    new file mode 100644
    index 00000000000..95079b048e6
    --- /dev/null
    +++ b/include/arch/netware/dso.h
    @@ -0,0 +1,81 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +#ifndef DSO_H
    +#define DSO_H
    +
    +#include "apr_private.h"
    +#include "apr_general.h"
    +#include "apr_pools.h"
    +#include "apr_dso.h"
    +#include "apr.h"
    +
    +#include 
    +
    +typedef struct sym_list sym_list;
    +
    +struct sym_list {
    +    sym_list *next;
    +    char *symbol;
    +};
    +
    +struct apr_dso_handle_t {
    +    apr_pool_t  *pool;
    +    void        *handle;
    +    const char  *errormsg;
    +    sym_list    *symbols;
    +    char        *path;
    +};
    +
    +#endif
    
    From d3a3de223fc3c4e2232a7fd453ddf741d8c33561 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Tue, 13 Nov 2001 21:15:33 +0000
    Subject: [PATCH 2512/7878] Removed NetWare from the DSO #ifdef confusion
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62514 13f79535-47bb-0310-9956-ffa450edef68
    ---
     dso/unix/dso.c | 21 ---------------------
     1 file changed, 21 deletions(-)
    
    diff --git a/dso/unix/dso.c b/dso/unix/dso.c
    index ab8fdc55df1..50d3bbe7b13 100644
    --- a/dso/unix/dso.c
    +++ b/dso/unix/dso.c
    @@ -72,13 +72,6 @@
     #include  /* for strerror() on HP-UX */
     #endif
     
    -#ifdef NETWARE
    -#include 
    -#include 
    -
    -static int setautounloadflag (const char *path);
    -#endif
    -
     APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso,
                                                     apr_os_dso_handle_t osdso,
                                                     apr_pool_t *pool)
    @@ -171,10 +164,6 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle,
     
         apr_pool_cleanup_register(pool, *res_handle, dso_cleanup, apr_pool_cleanup_null);
     
    -#ifdef NETWARE
    -    setautounloadflag(path);
    -#endif
    -
         return APR_SUCCESS;
     }
         
    @@ -256,14 +245,4 @@ APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer,
         return "No Error";
     }
     
    -#ifdef NETWARE
    -static int setautounloadflag (const char *path)
    -{
    -    char name[256];
    -
    -    deconstruct(path, NULL, NULL, NULL, name, NULL, NULL, PATH_UNDEF);
    -    SetAutoUnloadFlag(findnlmhandle(name, getaddressspace()));
    -}
    -#endif
    -
     #endif
    
    From f7cc80fcf4aa886da2ea7251f16803efc7726e8d Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Tue, 13 Nov 2001 21:17:46 +0000
    Subject: [PATCH 2513/7878] New NetWare project files.  Split APR from the
     tests
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62515 13f79535-47bb-0310-9956-ffa450edef68
    ---
     libaprnw.mcp.zip | Bin 111022 -> 191071 bytes
     1 file changed, 0 insertions(+), 0 deletions(-)
    
    diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip
    index 8c959c6d61f791e70a666661d828a6512e0805b4..a4a8cdf5acc5157ac858585d0a70d006155b33d6 100644
    GIT binary patch
    literal 191071
    zcma&NbyOTr^e>o%1PD$D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>lb@C)5|{yp(0 zDc&&4AI|gd)8Ch30DRXYo_}wy?yrGx%~o##SEU#PrzYIbS-L@rX!HEG@?SnA#bEdx zAI^u`%cK|rZ?c8g=S2S{#ZY+3P0oj#s+=+K%Z0qo`F@EMZ^9$0@I3gQ3@L`0^_<4} zaO7#F_PJ%Lm6+DdOQtZTY@CuiEVh_?<6>l@B#l zzKw*RtOcB$$u5#B6}^I?a&-zS>w`HHaep_M9U z61;L-+k9V+6qDe`t_dq2{-^RP8SdSk=fS-XN-^2IzImJvaZ-vY@FyDQLy5XCro!v> z@UrsZ6?OkkgKz7`?Yx0He+s-sKIcQ1AEiiz-!0{Qn5F7D4ZiV5&WEOpq?is5R{cz~ zzp+^T-E{bK|ML2rl5eG$0sl0d^Pz)kCo|!x-EH&8s+_anZ60$zj90lm8@@*8{R&Hq zrI-WHxX<}8ah4Qw&Ew-aAKtqm#XNY?4bBIz0x2@g^7P_*JFBi^Cj1`{=R=wLe=#4P z)r-sDai0`f@c#o)O928D02BZK00;mOg<&h&74=*+u>k-s&lLa+000000000003ZOi qfdBvi0BmVuVQ_M8cP?#Xa8OGH1^@s60096206G8w0A8^H0000OyO~P> From db245600b199077cd1c6143defc987719143e16e Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Wed, 14 Nov 2001 08:36:16 +0000 Subject: [PATCH 2514/7878] Some cleanups, keep track of how the locks are comming along. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62516 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/STATUS b/STATUS index 5aedbf4943c..0cd7fb12df1 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/11/03 01:54:15 $] +Last modified at [$Date: 2001/11/14 08:36:16 $] Release: @@ -28,12 +28,19 @@ RELEASE SHOWSTOPPERS: since apr_proc_create didn't allocate the apr_proc_t storage. (Aren't transparent types swell?) Suggestions? - * The new lock API is a full replacement for the old API, save - for the apr_lock_data_get/apr_lock_data_set functions. These - should be translated into apr_proc_mutex_data_get and - apr_proc_mutex_data_set to be complete. - Status: This should be in place before we make an APR release. - Aaron will do it unless someone beats him to it. + * The new lock API is a full replacement for the old API, but is + not yet complete on all platforms. Components that are incomplete + or missing include: + Beos: apr_thread_cond_*() + Netware: apr_proc_mutex_*() (Is proc_mutex unnecessary on Netware?) + OS/2: apr_thread_cond_*(), apr_proc_mutex_*() + + Less critical components that we may wish to add at some point: + Beos: apr_thread_rwlock_try*lock() + apr_proc_mutex_trylock() + Unix: apr_thread_rwlock_*() for platforms w/o rwlocks in pthread + Win32: apr_thread_rwlock_try*lock(), apr_thread_cond_timedwait(), + apr_proc_mutex_*() (Is proc_mutex unnecessary on Win32?) RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: @@ -224,7 +231,9 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: thereafter destroyed. Simply changing the type of this parameter to (apr_status_t) should solve the problem (along with some internal changes in apr_thread_join() to accomodate). - Status: Aaron is working on this. + Status: "I'll probably test and commit this soonish," says Aaron, + "Here's the patch:" + http://marc.theaimsgroup.com/?l=apr-dev&m=100137033309456&q=raw * There are some optimizations that can be done to the new apr_proc_*() functions (on UNIX). One that may reduce pointer From 99f426bd593fde9ccb782f6e140efcdfa29833fb Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 16 Nov 2001 12:14:09 +0000 Subject: [PATCH 2515/7878] Fix apr_setup_signal_thread() to grab the right error code from a sigprocmask() failure. This only affects platforms that use sigprocmask() in lieu of pthread_sigmask(). sigprocmask() reports error codes via errno, not via the return code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62517 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ threadproc/unix/signals.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index ee0a32173c4..ab6d433dbac 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Fix apr_setup_signal_thread() to grab the right error code from + a sigprocmask() failure. This only affects platforms that use + sigprocmask() in lieu of pthread_sigmask(). [Jeff Trawick] + *) Fix the Unix HAVE_POLL flavor of apr_poll_socket_mask() so that it doesn't segfault. Avoid some wasted storage in a poll-related APR structure. [INOUE Seiichiro ] diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 6d49cc218ba..5d7462d0f03 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -380,7 +380,9 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) remove_sync_sigs(&sig_mask); #if defined(SIGPROCMASK_SETS_THREAD_MASK) - rv = sigprocmask(SIG_SETMASK, &sig_mask, NULL); + if ((rv = sigprocmask(SIG_SETMASK, &sig_mask, NULL)) != 0) { + rv = errno; + } #else if ((rv = pthread_sigmask(SIG_SETMASK, &sig_mask, NULL)) != 0) { #ifdef PTHREAD_SETS_ERRNO From 5c947c120c594ef7ef7c7cf10d62afcb92e62a43 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 18 Nov 2001 02:25:46 +0000 Subject: [PATCH 2516/7878] Fix result of apr_filepath_root() when given a drive-less absolute path. Was returning the character AFTER the leading slash as the root component instead of the leading slash itself. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62518 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 6ea7c8ac3d6..2efe9821d84 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -297,7 +297,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, /* Left with a path of '/', what drive are we asking about? */ - *inpath = ++testpath; + *inpath = testpath + 1; newpath = apr_palloc(p, 2); if (flags & APR_FILEPATH_TRUENAME) newpath[0] = seperator[0]; From b73db701905804b4e5dc2aecb85ed331fa80f32b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 19 Nov 2001 11:11:37 +0000 Subject: [PATCH 2517/7878] apr md5 and apr xlate have different APIs w.r.t. the buffers they operate on, so fix it up at the interface between them to avoid unnecessary warnings git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62519 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_md5.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index e2fd57a602c..5d7132b1b48 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -272,8 +272,10 @@ APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context, if (inputLen >= partLen) { if (context->xlate) { inbytes_left = outbytes_left = partLen; - apr_xlate_conv_buffer(context->xlate, input, &inbytes_left, - &context->buffer[idx], &outbytes_left); + apr_xlate_conv_buffer(context->xlate, (const char *)input, + &inbytes_left, + (char *)&context->buffer[idx], + &outbytes_left); } else { memcpy(&context->buffer[idx], input, partLen); @@ -284,8 +286,9 @@ APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context, if (context->xlate) { unsigned char inp_tmp[64]; inbytes_left = outbytes_left = 64; - apr_xlate_conv_buffer(context->xlate, &input[i], &inbytes_left, - inp_tmp, &outbytes_left); + apr_xlate_conv_buffer(context->xlate, (const char *)&input[i], + &inbytes_left, (char *)inp_tmp, + &outbytes_left); MD5Transform(context->state, inp_tmp); } else { @@ -301,8 +304,9 @@ APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context, /* Buffer remaining input */ if (context->xlate) { inbytes_left = outbytes_left = inputLen - i; - apr_xlate_conv_buffer(context->xlate, &input[i], &inbytes_left, - &context->buffer[idx], &outbytes_left); + apr_xlate_conv_buffer(context->xlate, (const char *)&input[i], + &inbytes_left, (char *)&context->buffer[idx], + &outbytes_left); } else { memcpy(&context->buffer[idx], &input[i], inputLen - i); From 0aa1dd6b8f1389c6d690812788950a8988b5d5e0 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Mon, 19 Nov 2001 16:51:58 +0000 Subject: [PATCH 2518/7878] Remove the -Kthread for ReliantUnix. It is specific for threads. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62520 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/configure.in b/configure.in index f18433eb221..ebf43b21a63 100644 --- a/configure.in +++ b/configure.in @@ -190,9 +190,6 @@ case "$host:$CC" in APR_SETVAR(CC,mwcc) APR_SETVAR(AR,ar) ;; - mips-sni-sysv4:cc ) - APR_ADDTO(CFLAGS,-Kthread) - ;; esac config_subdirs="none" INSTALL_SUBDIRS="none" From 727477e30b07b3f53182bebe8abf275ef4dca77a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 19 Nov 2001 21:11:32 +0000 Subject: [PATCH 2519/7878] Resync'ed and cleanup the NetWare version of APR.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62521 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 69 ++++++++++++------------------------------------- 1 file changed, 17 insertions(+), 52 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index 593fb794dcf..04ec8d7a953 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -58,8 +58,10 @@ */ #ifdef NETWARE /** - * @file netware/apr.h netware/apr.h - * @brief APR header for NetWare + * @file include\apr.h + * @brief Basic APR header for NetWare + * @remark This is a NetWare specific version of apr.h. It is copied as + * apr.h at the start of a NetWare build through prebuildNW.bat. */ /** @@ -71,8 +73,6 @@ #ifndef APR_H #define APR_H - - #include #include #include @@ -84,7 +84,6 @@ #include #include #include -//#include #include @@ -122,6 +121,7 @@ #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 +#define APR_HAVE_SYS_TIME_H 0 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 1 #define APR_HAVE_SYS_WAIT_H 0 @@ -132,8 +132,15 @@ #define APR_USE_FCNTL_SERIALIZE 0 #define APR_USE_PROC_PTHREAD_SERIALIZE 0 #define APR_USE_PTHREAD_SERIALIZE 0 + +#define APR_HAS_FLOCK_SERIALIZE 0 +#define APR_HAS_SYSVSEM_SERIALIZE 0 +#define APR_HAS_FCNTL_SERIALIZE 0 +#define APR_HAS_PROC_PTHREAD_SERIALIZE 0 #define APR_HAS_RWLOCK_SERIALIZE 0 +#define APR_HAS_LOCK_CREATE_NP 0 + #define APR_PROCESS_LOCK_IS_GLOBAL 0 #define APR_USES_ANONYMOUS_SHM 0 @@ -157,7 +164,7 @@ #define APR_HAVE_STRCASECMP 1 #define APR_HAVE_STRDUP 1 #define APR_HAVE_STRICMP 1 -#define APR_HAVE_STRNCASECMP 0 +#define APR_HAVE_STRNCASECMP 1 #define APR_HAVE_STRNICMP 1 #define APR_HAVE_STRSTR 1 #define APR_HAVE_STRUCT_RLIMIT 0 @@ -178,9 +185,11 @@ #define APR_HAS_XLATE 0 #define APR_HAS_OTHER_CHILD 0 #define APR_HAS_DSO 1 +#define APR_HAS_SO_ACCEPTFILTER 0 #define APR_HAS_UNICODE_FS 0 #define APR_HAS_USER 1 -#define APR_HAS_LARGE_FILES 1 +#define APR_HAS_LARGE_FILES 0 +#define APR_HAS_XTHREAD_FILES 0 /* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE * on all platforms. @@ -208,9 +217,6 @@ typedef size_t apr_size_t; typedef ssize_t apr_ssize_t; typedef off_t apr_off_t; typedef int apr_socklen_t; -//typedef int pid_t; -//typedef int uid_t; -//typedef int gid_t; /* Mechanisms to properly type numeric literals */ @@ -236,7 +242,7 @@ typedef unsigned short nuint16; /* Definitions that APR programs need to work properly. */ -#define APR_THREAD_FUNC __stdcall +#define APR_THREAD_FUNC /** * APR_DECLARE_EXPORT is defined when building the APR dynamic library, @@ -251,7 +257,6 @@ typedef unsigned short nuint16; * conventions at compile time. */ -#if !defined(WIN32) /** * The public APR functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with @@ -276,19 +281,6 @@ typedef unsigned short nuint16; * declarations within headers to properly import the variable. */ #define APR_DECLARE_DATA -#elif defined(APR_DECLARE_STATIC) -#define APR_DECLARE(type) type __stdcall -#define APR_DECLARE_NONSTD(type) type -#define APR_DECLARE_DATA -#elif defined(APR_DECLARE_EXPORT) -#define APR_DECLARE(type) __declspec(dllexport) type __stdcall -#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type -#define APR_DECLARE_DATA __declspec(dllexport) -#else -#define APR_DECLARE(type) __declspec(dllimport) type __stdcall -#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type -#define APR_DECLARE_DATA __declspec(dllimport) -#endif #define APR_SSIZE_T_FMT "d" @@ -303,39 +295,12 @@ typedef unsigned short nuint16; typedef int apr_wait_t; -/* struct iovec is needed to emulate Unix writev */ -//struct iovec { -// char* iov_base; -// int iov_len; -//}; - -/* Nasty Win32 .h ommissions we really need */ -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 - -#if APR_HAS_UNICODE_FS -/* An arbitrary size that is digestable. True max is a bit less than 32000 */ -#define APR_PATH_MAX 8192 -#else /* !APR_HAS_UNICODE_FS */ #define APR_PATH_MAX PATH_MAX -#endif - -///* These need to move into apr_compat.h when the symbol rename is complete -// */ -//#define APR_EXPORT(t) APR_DECLARE(t) -//#define APR_EXPORT_NONSTD(t) APR_DECLARE_NONSTD(t) -//#define APR_VAR_EXPORT APR_DECLARE_DATA -//#define APR_VAR_IMPORT APR_DECLARE_DATA #define APR_INT64_T_FMT "l64d" #define APR_TIME_T_FMT APR_INT64_T_FMT -//#define apr_signal(a,b) signal(a,b) -// -//typedef int apr_wait_t; - #endif /* APR_H */ /** @} */ #endif /* NETWARE */ From 75af3fd3dbf81a3adab6b697f36beee3a657fa1f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 19 Nov 2001 23:33:33 +0000 Subject: [PATCH 2520/7878] Fixed the AWK script so that it will pick up functions that have been declared on multiple lines such as create_connection in connection.h. Otherwise multi-line declared functions are omitted from the export list. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62522 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_nw_export.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index 2b118e96782..620dec056c9 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -83,7 +83,7 @@ function add_symbol (sym_name) { next } -/^[ \t]*AP_DECLARE_HOOK[^(]*[(][^)]*[)]/ { +/^[ \t]*AP_DECLARE_HOOK[^(]*[(][^)]*/ { split($0, args, ",") symbol = args[2] sub("^[ \t]+", "", symbol) From 2fddd17c264d1318da2091fedf6ea92fb18844a4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 20 Nov 2001 02:52:22 +0000 Subject: [PATCH 2521/7878] I have _no_ fing idea why all this cruft accumulated in a unix/misc.h include, but I have no time tonight to refactor. This aught to allow Win95 to bind the .dlls by late-linking offensive fns [unlike most anticipated but unimplemented functions, these symbols don't have win95 linkage.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62523 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/misc.h | 14 ++++++++++++++ include/arch/win32/misc.h | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index 00e7504c295..c0ac46f4262 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -160,14 +160,28 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); * In the case of non-text functions, simply #define the original name */ +#ifdef GetFileAttributesExA +#undef GetFileAttributesExA +#endif APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( IN LPCSTR lpFileName, IN GET_FILEEX_INFO_LEVELS fInfoLevelId, OUT LPVOID lpFileInformation), (lpFileName, fInfoLevelId, lpFileInformation)); +#define GetFileAttributesExA apr_winapi_GetFileAttributesExA #undef GetFileAttributesEx #define GetFileAttributesEx apr_winapi_GetFileAttributesExA +#ifdef GetFileAttributesExW +#undef GetFileAttributesExW +#endif +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExW, 0, ( + IN LPCWSTR lpFileName, + IN GET_FILEEX_INFO_LEVELS fInfoLevelId, + OUT LPVOID lpFileInformation), + (lpFileName, fInfoLevelId, lpFileInformation)); +#define GetFileAttributesExW apr_winapi_GetFileAttributesExW + APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( IN HANDLE hFile), (hFile)); diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 00e7504c295..c0ac46f4262 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -160,14 +160,28 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); * In the case of non-text functions, simply #define the original name */ +#ifdef GetFileAttributesExA +#undef GetFileAttributesExA +#endif APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( IN LPCSTR lpFileName, IN GET_FILEEX_INFO_LEVELS fInfoLevelId, OUT LPVOID lpFileInformation), (lpFileName, fInfoLevelId, lpFileInformation)); +#define GetFileAttributesExA apr_winapi_GetFileAttributesExA #undef GetFileAttributesEx #define GetFileAttributesEx apr_winapi_GetFileAttributesExA +#ifdef GetFileAttributesExW +#undef GetFileAttributesExW +#endif +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExW, 0, ( + IN LPCWSTR lpFileName, + IN GET_FILEEX_INFO_LEVELS fInfoLevelId, + OUT LPVOID lpFileInformation), + (lpFileName, fInfoLevelId, lpFileInformation)); +#define GetFileAttributesExW apr_winapi_GetFileAttributesExW + APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( IN HANDLE hFile), (hFile)); From ec2a208a92694a511291b3268e29a08512ea359b Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 20 Nov 2001 08:18:38 +0000 Subject: [PATCH 2522/7878] Update *ressym on success in the Darwin DSO load path. Submitted by: Sander Temme Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62524 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ dso/unix/dso.c | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index ab6d433dbac..856f0bae78e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Fix bug in Darwin DSO code. [Sander Temme ] + *) Fix apr_setup_signal_thread() to grab the right error code from a sigprocmask() failure. This only affects platforms that use sigprocmask() in lieu of pthread_sigmask(). [Jeff Trawick] diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 50d3bbe7b13..4bf6ea3d8cf 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -209,6 +209,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, handle->errormsg = "cannot resolve symbol"; return APR_EINIT; } + *ressym = retval; return APR_SUCCESS; #elif defined(DSO_USE_DLFCN) From f4c902a8580356f5a9116772311b7f0870616215 Mon Sep 17 00:00:00 2001 From: Brian Fitzpatrick Date: Tue, 20 Nov 2001 16:31:25 +0000 Subject: [PATCH 2523/7878] (apr_dso_load) initialize os_handle to NULL to stop apr_dso_load from returning false positives. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62525 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 4bf6ea3d8cf..f9786454caf 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -117,7 +117,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, #elif defined(DSO_USE_DYLD) NSObjectFileImage image; - NSModule os_handle; + NSModule os_handle = NULL; char* err_msg = NULL; if (NSCreateObjectFileImageFromFile(path, &image) != NSObjectFileImageSuccess) { err_msg = "cannot create object file image"; From 47c4a7a2a26fd742c9239b0a8942aab49b913df8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 20 Nov 2001 19:00:40 +0000 Subject: [PATCH 2524/7878] Tweak apr_gethostname() so that it detects truncation of the name and returns an error. Such behavior varied between platforms before, since some systems returned an error if the buffer wasn't large enough while others just truncated the returned name and left it up to the app to detect truncation and/or '\0'-terminate it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62526 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_network_io.h | 3 ++- network_io/os2/sockopt.c | 11 ++++++++--- network_io/unix/sockopt.c | 14 +++++++++++--- network_io/win32/sockopt.c | 11 ++++++++--- 5 files changed, 32 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 856f0bae78e..f1c337b3b91 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Tweak apr_gethostname() so that it detects truncation of the + name and returns an error. [Jeff Trawick] + *) Fix bug in Darwin DSO code. [Sander Temme ] *) Fix apr_setup_signal_thread() to grab the right error code from diff --git a/include/apr_network_io.h b/include/apr_network_io.h index d905a2bed67..99484a3e167 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -407,8 +407,9 @@ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, * Get name of the current machine * @param buf A buffer to store the hostname in. * @param len The maximum length of the hostname that can be stored in the - * buffer provided. + * buffer provided. The suggested length is APRMAXHOSTLEN + 1. * @param cont The pool to use. + * @remark If the buffer was not large enough, an error will be returned. */ APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont); diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 4015852428e..6f163de6715 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -140,9 +140,14 @@ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, APR_DECLARE(apr_status_t) apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { - if (gethostname(buf, len) == -1) + if (gethostname(buf, len) == -1) { + buf[0] = '\0'; return APR_OS2_STATUS(sock_errno()); - else - return APR_SUCCESS; + } + else if (!memchr(buf, '\0', len)) { /* buffer too small */ + buf[0] = '\0'; + return APR_ENAMETOOLONG; + } + return APR_SUCCESS; } diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index db90aac863e..1c63f640c8a 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -293,10 +293,18 @@ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t * apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { - if (gethostname(buf, len) == -1) + if (gethostname(buf, len) == -1) { + buf[0] = '\0'; return errno; - else - return APR_SUCCESS; + } + else if (!memchr(buf, '\0', len)) { /* buffer too small */ + /* note... most platforms just truncate in this condition + * linux+glibc return an error + */ + buf[0] = '\0'; + return APR_ENAMETOOLONG; + } + return APR_SUCCESS; } #if APR_HAS_SO_ACCEPTFILTER diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 87000b260f4..be9f78f4d86 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -234,10 +234,15 @@ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont) { - if (gethostname(buf, len) == -1) + if (gethostname(buf, len) == -1) { + buf[0] = '\0'; return apr_get_netos_error(); - else - return APR_SUCCESS; + } + else if (!memchr(buf, '\0', len)) { /* buffer too small */ + buf[0] = '\0'; + return APR_ENAMETOOLONG; + } + return APR_SUCCESS; } From 0ec5b4cd5095fafb0c7b2978faad880d0b6f4e7e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 20 Nov 2001 20:57:04 +0000 Subject: [PATCH 2525/7878] add a comment mentioning the AIX levels for which this is intended git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62527 13f79535-47bb-0310-9956-ffa450edef68 --- dso/aix/dso.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 7a9d950ffde..50769b7c7de 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -54,6 +54,8 @@ /* * dso.c -- DSO system function emulation for AIX + * + * This is *only* intended for AIX < 4.3. */ /* From 777305a3b256e7d31e746408b6be672ba3c8fc4e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 20 Nov 2001 22:44:46 +0000 Subject: [PATCH 2526/7878] Implement apr_get_groupid [to mirror apr_get_userid] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62528 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_user.h | 17 +++++++++++++---- user/unix/groupinfo.c | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/include/apr_user.h b/include/apr_user.h index 4fcf4ad3967..7c41b0fc1ff 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -144,18 +144,27 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use #if defined(WIN32) APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right); #else -#define apr_compare_users(left,right) ((left == right) ? APR_SUCCESS : APR_EMISMATCH) +#define apr_compare_users(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) #endif /** * Get the group name for a specified groupid - * @param dirname Pointer to new string containing group name (on output) - * @param userid The groupid + * @param groupname Pointer to new string containing group name (on output) + * @param groupid The groupid * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p); +/** + * Get the groupid for a specified group name + * @param groupid Pointer to the group id (on output) + * @param groupname The group name to look up + * @param p The pool from which to allocate the string + * @remark This function is available only if APR_HAS_USER is defined. + */ +APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, const char *groupname, apr_pool_t *p); + /** * Compare two group identifiers for equality. * @param left One gid to test @@ -167,7 +176,7 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, #if defined(WIN32) APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right); #else -#define apr_compare_groups(left,right) ((left == right) ? APR_SUCCESS : APR_EMISMATCH) +#define apr_compare_groups(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) #endif #endif /* ! APR_HAS_USER */ diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 34f2e434579..bca6ac32bdd 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -86,3 +86,22 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, const char *groupname, apr_pool_t *p) +{ + struct group *gr; +#ifndef BEOS + +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) + struct group grp; + char grbuf[512]; + + if (getgrnam_r(&grpname, &gr, grbuf, sizeof(grbuf))) { +#else + if ((gr = getgrnam(groupname)) == NULL) { +#endif + return errno; + } + *groupid = gr->gr_gid; +#endif + return APR_SUCCESS; +} From ee34faf09894aef97f8afdebe8ff684da69bdaad Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 20 Nov 2001 23:18:04 +0000 Subject: [PATCH 2527/7878] get the getgrnam_r() logic to compile; no promises on correctness :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62529 13f79535-47bb-0310-9956-ffa450edef68 --- user/unix/groupinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index bca6ac32bdd..0b575a6273e 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -95,7 +95,7 @@ APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, const char *groupn struct group grp; char grbuf[512]; - if (getgrnam_r(&grpname, &gr, grbuf, sizeof(grbuf))) { + if (getgrnam_r(groupname, &grp, grbuf, sizeof(grbuf), &gr)) { #else if ((gr = getgrnam(groupname)) == NULL) { #endif From 58481cb090cb6ea2a45d0ca504327755a103b017 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Wed, 21 Nov 2001 04:18:27 +0000 Subject: [PATCH 2528/7878] For the sake of clarity. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62530 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_mutex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 2861ae0d624..cbfa5ba01e0 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -128,7 +128,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex); */ APR_POOL_DECLARE_ACCESSOR(thread_mutex); -#endif +#endif /* APR_HAS_THREADS */ #ifdef __cplusplus } From 28f12d188e8b232de2773abd21d18ae909942b2d Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Wed, 21 Nov 2001 04:21:04 +0000 Subject: [PATCH 2529/7878] Conversion of the file_io routines from INTRAPROCESS apr_lock_t types to the new apr_thread_mutex_t. All calls to the lock API are protected with APR_HAS_THREADS. Tested on each of Linux, Solaris, and most importantly in this case FreeBSD. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62531 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 5 +++-- file_io/unix/open.c | 7 ++++--- file_io/unix/readwrite.c | 10 +++++----- include/arch/unix/fileio.h | 3 ++- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 50235a3ac83..71a9bb16271 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -55,6 +55,7 @@ #include "fileio.h" #include "apr_strings.h" #include "apr_portable.h" +#include "apr_thread_mutex.h" #include "inherit.h" apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) @@ -81,8 +82,8 @@ apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_ (*new_file)->buffered = old_file->buffered; if ((*new_file)->buffered) { #if APR_HAS_THREADS - apr_lock_create(&((*new_file)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, - p); + apr_thread_mutex_create(&((*new_file)->thlock), + APR_THREAD_MUTEX_DEFAULT, p); #endif (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); } diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 9dc2eadc806..df42b527e81 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -55,6 +55,7 @@ #include "fileio.h" #include "apr_strings.h" #include "apr_portable.h" +#include "apr_thread_mutex.h" #include "inherit.h" apr_status_t apr_unix_file_cleanup(void *thefile) @@ -74,7 +75,7 @@ apr_status_t apr_unix_file_cleanup(void *thefile) } #if APR_HAS_THREADS if (file->thlock) { - rv = apr_lock_destroy(file->thlock); + rv = apr_thread_mutex_destroy(file->thlock); } #endif } @@ -118,8 +119,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr if ((*new)->buffered) { (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); #if APR_HAS_THREADS - rv = apr_lock_create(&((*new)->thlock), APR_MUTEX, APR_INTRAPROCESS, - NULL, cont); + rv = apr_thread_mutex_create(&((*new)->thlock), + APR_THREAD_MUTEX_DEFAULT, cont); if (rv) { return rv; } diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 353f340df94..7474f682fe7 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -54,7 +54,7 @@ #include "fileio.h" #include "apr_strings.h" -#include "apr_lock.h" +#include "apr_thread_mutex.h" /* The only case where we don't use wait_for_io_or_timeout is on * pre-BONE BeOS, so this check should be sufficient and simpler */ @@ -118,7 +118,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size apr_uint64_t size = *nbytes; #if APR_HAS_THREADS - apr_lock_acquire(thefile->thlock); + apr_thread_mutex_lock(thefile->thlock); #endif if (thefile->direction == 1) { @@ -164,7 +164,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size rv = 0; } #if APR_HAS_THREADS - apr_lock_release(thefile->thlock); + apr_thread_mutex_unlock(thefile->thlock); #endif return rv; } @@ -223,7 +223,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a int size = *nbytes; #if APR_HAS_THREADS - apr_lock_acquire(thefile->thlock); + apr_thread_mutex_lock(thefile->thlock); #endif if ( thefile->direction == 0 ) { @@ -251,7 +251,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } #if APR_HAS_THREADS - apr_lock_release(thefile->thlock); + apr_thread_mutex_unlock(thefile->thlock); #endif return rv; } diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 75daacaf599..4c955c23ab8 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -63,6 +63,7 @@ #include "apr_file_info.h" #include "apr_errno.h" #include "apr_lib.h" +#include "apr_thread_mutex.h" /* System headers the file I/O library needs */ #if APR_HAVE_FCNTL_H @@ -137,7 +138,7 @@ struct apr_file_t { int direction; /* buffer being used for 0 = read, 1 = write */ unsigned long filePtr; /* position in file of handle */ #if APR_HAS_THREADS - struct apr_lock_t *thlock; + struct apr_thread_mutex_t *thlock; #endif }; From d55558e0979eb819d54c55635b0954b281ff240e Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Wed, 21 Nov 2001 10:47:23 +0000 Subject: [PATCH 2530/7878] Add the first elements to support AS/400 Submitted by: Henri Gomez, hgomez@slib.fr git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62532 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 7 +++++++ build/config.guess | 3 +++ build/config.sub | 14 ++++++++++++-- configure.in | 6 +++++- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index aef22b6bad2..82234599dd8 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -387,6 +387,13 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(CC, [cc]) APR_ADDTO(CPPFLAGS, [-U_NO_PROTO -DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR -DPTHREAD_SETS_ERRNO -DPTHREAD_DETACH_ARG1_ADDR -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1]) ;; + *-ibm-as400) + APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE]) + APR_SETIFNULL(apr_process_lock_is_global, [yes]) + APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes]) + APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes]) + APR_SETIFNULL(CC, [icc]) + ;; *cygwin*) APR_ADDTO(CPPFLAGS, [-DCYGWIN]) APR_ADDTO(LIBS, [-lcrypt]) diff --git a/build/config.guess b/build/config.guess index a4d743520c6..32052b48977 100755 --- a/build/config.guess +++ b/build/config.guess @@ -213,6 +213,9 @@ EOF *:OS390:*:* | *:OS/390:*:*) echo s390-ibm-os390 exit 0 ;; + *:OS400:*:* | *:OS/400:*:*) + echo as400-ibm-os400 + exit 0 ;; *:OS/2:*:*) echo "i386-pc-os2_emx" exit 0;; diff --git a/build/config.sub b/build/config.sub index aef156adfb7..c2a0aaf1a72 100755 --- a/build/config.sub +++ b/build/config.sub @@ -89,6 +89,10 @@ case $maybe_os in os=-$maybe_os basic_machine=s390; ;; + os400) + os=-$maybe_os + basic_machine=as400; + ;; mvs) os=-mvs basic_machine=i370; @@ -240,7 +244,7 @@ case $basic_machine in | mips64el-* | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ | mipstx39-* | mipstx39el-* | mcore-* \ - | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ + | f301-* | armv*-* | s390-* | as400-* | sv1-* | t3e-* \ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ | bs2000-*) @@ -707,6 +711,9 @@ case $basic_machine in s390*) basic_machine=s390-ibm ;; + as400*) + basic_machine=as400-ibm + ;; # # end Apache changes ######################## @@ -954,7 +961,7 @@ case $os in ######################## # changes for Apache # - -os2_emx | -tpf* | -os390* | -vmcms* ) + -os2_emx | -tpf* | -os390* | -vmcms* | -os400* ) ;; # # end Apache changes @@ -1160,6 +1167,9 @@ case $basic_machine in i370*) os=-mvs; ;; + as400*) + os=-os400; + ;; *) os=-aix ;; diff --git a/configure.in b/configure.in index ebf43b21a63..b620941d2e1 100644 --- a/configure.in +++ b/configure.in @@ -229,6 +229,10 @@ case $host in OSDIR="os390" eolstr="\\n" ;; + *os400) + OSDIR="as400" + eolstr="\\n" + ;; *cygwin*) OSDIR="unix" APR_ADDTO(CPPFLAGS,-DCYGWIN) @@ -958,7 +962,7 @@ AC_ARG_ENABLE(dso, fi if test "$tempdso" = "no"; then case $host in - *os390|*-os2*) + *os390|*-os2*|*os400) tempdso="yes" ;; esac From c7f0d917b1427e8af150c5372f832a18463e7314 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 21 Nov 2001 12:58:28 +0000 Subject: [PATCH 2531/7878] make absolutely sure we have getgrnam_r() before calling it git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62533 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + user/unix/groupinfo.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index b620941d2e1..16b50e27522 100644 --- a/configure.in +++ b/configure.in @@ -398,6 +398,7 @@ AC_CHECK_FUNCS(poll) dnl #----------------------------- Checking for missing POSIX thread functions AC_CHECK_FUNCS(getpwnam_r) AC_CHECK_FUNCS(getpwuid_r) +AC_CHECK_FUNCS(getgrnam_r) AC_CHECK_FUNCS(getgrgid_r) dnl #----------------------------- Checking for Shared Memory Support diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 0b575a6273e..0386752705c 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -91,7 +91,7 @@ APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, const char *groupn struct group *gr; #ifndef BEOS -#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRNAM_R) struct group grp; char grbuf[512]; From 06b22951bc4b95a8bf5e3aebb8869e0d068e46e8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 21 Nov 2001 12:59:23 +0000 Subject: [PATCH 2532/7878] add some logic to sanity-check apr_get_groupid() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62534 13f79535-47bb-0310-9956-ffa450edef68 --- test/testuser.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/test/testuser.c b/test/testuser.c index e12457a1dca..db0a96cadd3 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -76,7 +76,7 @@ int main(int argc, char *argv[]) char *username; char *homedir; apr_uid_t userid; - apr_gid_t groupid; + apr_gid_t groupid, newgroupid; if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Something went wrong\n"); @@ -121,6 +121,24 @@ int main(int argc, char *argv[]) if (rv != APR_SUCCESS) groupname = "(none)"; + rv = apr_get_groupid(&newgroupid, groupname, p); + if (rv != APR_SUCCESS) { + fprintf(stderr, "apr_get_groupid(,%s,) failed: %s\n", + groupname, + apr_strerror(rv, msgbuf, sizeof msgbuf)); + exit(-1); + } + + if (groupid != newgroupid) { + fprintf(stderr, "oops, we got a different result for the " + "group name/id mapping\n"); + /* whoever hits this problem gets to figure out how to + * portably display groupid and newgroupid :) + */ + fprintf(stderr, "group: %s\n", + groupname); + } + printf("user/group ids for %s: %d/%d\n", username, (int)userid, (int)groupid); From b1ffe131bdddbab464b47fe1a47fa9ce68d1890b Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Wed, 21 Nov 2001 16:40:54 +0000 Subject: [PATCH 2533/7878] This patch speeds up the apr_hash_t implementation's handling of APR_HASH_KEY_STRING. The original logic was: call strlen to get the length of the key; then iterate through the key to compute the hash; This patch combines the two into a single pass. It also changes apr_pool_userdata_get() to take advantage of this optimization. Submitted by: Brian Pane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62535 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 +- tables/apr_hash.c | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 5f043f77eb5..4b5088d2e22 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1312,7 +1312,7 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, ap if (cont->prog_data == NULL) *data = NULL; else - *data = apr_hash_get(cont->prog_data, key, strlen(key)); + *data = apr_hash_get(cont->prog_data, key, APR_HASH_KEY_STRING); return APR_SUCCESS; } diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 8108b580f00..18baff85e32 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -222,9 +222,6 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, int hash; apr_ssize_t i; - if (klen == APR_HASH_KEY_STRING) - klen = strlen(key); - /* * This is the popular `times 33' hash algorithm which is used by * perl and also appears in Berkeley DB. This is one of the best @@ -263,8 +260,17 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, * -- Ralf S. Engelschall */ hash = 0; - for (p = key, i = klen; i; i--, p++) - hash = hash * 33 + *p; + if (klen == APR_HASH_KEY_STRING) { + for (p = key; *p; p++) { + hash = hash * 33 + *p; + } + klen = p - (const unsigned char *)key; + } + else { + for (p = key, i = klen; i; i--, p++) { + hash = hash * 33 + *p; + } + } /* scan linked list */ for (hep = &ht->array[hash & ht->max], he = *hep; From d34fe446db809d0ede158f3cdbf24d4fcf64bfb2 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Wed, 21 Nov 2001 17:00:51 +0000 Subject: [PATCH 2534/7878] New APR function apr_mmap_dup. this is used in the MMAP bucket setaside function for a performance win. Mod_file_cache will also use this Submitted by: Brian Pane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62536 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ include/apr_mmap.h | 15 +++++++++++++++ mmap/unix/mmap.c | 32 ++++++++++++++++++++++++++++++++ mmap/win32/mmap.c | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+) diff --git a/CHANGES b/CHANGES index f1c337b3b91..4560643d349 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ Changes with APR b1 + *) New function apr_mmap_dup. This is called in the mmap_setaside + [Brain Pane ] + + *) speed up the apr_hash_t implementation's handling of APR_HASH_KEY_STRING. + [Brain Pane ] *) Tweak apr_gethostname() so that it detects truncation of the name and returns an error. [Jeff Trawick] diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 6edceaa0d61..17cbab34368 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -111,6 +111,8 @@ struct apr_mmap_t { void *mm; /** The amount of data in the mmap */ apr_size_t size; + /** Whether this object is reponsible for doing the munmap */ + int is_owner; }; #if APR_HAS_MMAP || defined(DOXYGEN) @@ -135,6 +137,19 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap, apr_size_t size, apr_int32_t flag, apr_pool_t *cntxt); +/** + * Duplicate the specified MMAP. + * @param new_mmap The structure to duplicate into. + * @param old_mmap The file to duplicate. + * @param p The pool to use for the new file. + * @param transfer_ownership Whether responsibility for destroying + * the memory-mapped segment is transferred from old_mmap to new_mmap + */ +APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, + apr_mmap_t *old_mmap, + apr_pool_t *p, + int transfer_ownership); + /** * Remove a mmap'ed. * @param mmap The mmap'ed file. diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index ae8f22935a0..1f915bdb5d0 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -83,6 +83,11 @@ static apr_status_t mmap_cleanup(void *themmap) { apr_mmap_t *mm = themmap; int rv; + + if (!mm->is_owner) { + return APR_SUCCESS; + } + #ifdef BEOS rv = delete_area(mm->area); @@ -159,6 +164,7 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, (*new)->mm = mm; (*new)->size = size; (*new)->cntxt = cont; + (*new)->is_owner = 1; /* register the cleanup... */ apr_pool_cleanup_register((*new)->cntxt, (void*)(*new), mmap_cleanup, @@ -166,6 +172,32 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, + apr_mmap_t *old_mmap, + apr_pool_t *p, + int transfer_ownership) +{ + *new_mmap = (apr_mmap_t *)apr_pmemdup(p, old_mmap, sizeof(apr_mmap_t)); + (*new_mmap)->cntxt = p; + + /* The old_mmap can transfer ownership only if the old_mmap itself + * is an owner of the mmap'ed segment. + */ + if (old_mmap->is_owner) { + if (transfer_ownership) { + (*new_mmap)->is_owner = 1; + old_mmap->is_owner = 0; + apr_pool_cleanup_kill(old_mmap->cntxt, old_mmap, mmap_cleanup); + } + else { + (*new_mmap)->is_owner = 0; + } + apr_pool_cleanup_register(p, *new_mmap, mmap_cleanup, + apr_pool_cleanup_null); + } + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap) { apr_status_t rv; diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index 8a27618ee2b..428e4c91cb3 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -66,6 +66,11 @@ static apr_status_t mmap_cleanup(void *themmap) { apr_mmap_t *mm = themmap; apr_status_t rv = 0; + + if (!mm->is_owner) { + return APR_SUCCESS; + } + if (mm->mv) { if (!UnmapViewOfFile(mm->mv)) { @@ -155,6 +160,7 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, (*new)->mm = (char*)((*new)->mv) + offset; (*new)->size = size; (*new)->cntxt = cont; + (*new)->is_owner = 1; /* register the cleanup... */ apr_pool_cleanup_register((*new)->cntxt, (void*)(*new), mmap_cleanup, @@ -162,6 +168,32 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, + apr_mmap_t *old_mmap, + apr_pool_t *p, + int transfer_ownership) +{ + *new_mmap = (apr_mmap_t *)apr_pmemdup(p, old_mmap, sizeof(apr_mmap_t)); + (*new_mmap)->cntxt = p; + + /* The old_mmap can transfer ownership only if the old_mmap itself + * is an owner of the mmap'ed segment. + */ + if (old_mmap->is_owner) { + if (transfer_ownership) { + (*new_mmap)->is_owner = 1; + old_mmap->is_owner = 0; + apr_pool_cleanup_kill(old_mmap->cntxt, old_mmap, mmap_cleanup); + } + else { + (*new_mmap)->is_owner = 0; + } + apr_pool_cleanup_register(p, *new_mmap, mmap_cleanup, + apr_pool_cleanup_null); + } + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap) { apr_status_t rv; From 2d7053708e3243debb921024eb970edec77159bb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 21 Nov 2001 17:46:17 +0000 Subject: [PATCH 2535/7878] Clean up a _whole_ lot of win32 specific cruft here. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62537 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/misc.h | 88 --------------------------------------- include/arch/win32/misc.h | 4 -- 2 files changed, 92 deletions(-) diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index c0ac46f4262..93366129906 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -102,93 +102,5 @@ struct apr_other_child_rec_t { #define WSALowByte 0 #endif -#ifdef WIN32 -/* Platform specific designation of run time os version. - * Gaps allow for specific service pack levels that - * export new kernel or winsock functions or behavior. - */ -typedef enum { - APR_WIN_95 = 0, - APR_WIN_98 = 4, - APR_WIN_NT = 8, - APR_WIN_NT_4 = 12, - APR_WIN_NT_4_SP2 = 14, - APR_WIN_NT_4_SP3 = 15, - APR_WIN_NT_4_SP4 = 16, - APR_WIN_NT_4_SP6 = 18, - APR_WIN_2000 = 24 -} apr_oslevel_e; - - -typedef enum { - DLL_WINBASEAPI = 0, // kernel32 From WinBase.h - DLL_WINADVAPI = 1, // advapi32 From WinBase.h - DLL_WINSOCKAPI = 2, // mswsock From WinSock.h - DLL_WINSOCK2API = 3, // ws2_32 From WinSock2.h - DLL_defined = 4 // must define as last idx_ + 1 -} apr_dlltoken_e; - -FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); - -/* The apr_load_dll_func call WILL fault if the function cannot be loaded */ - -#define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ - typedef rettype (calltype *apr_winapi_fpt_##fn) args; \ - static apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \ - __inline rettype apr_winapi_##fn args \ - { if (!apr_winapi_pfn_##fn) \ - apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \ - apr_load_dll_func(lib, #fn, ord); \ - return (*(apr_winapi_pfn_##fn)) names; }; \ - -/* Provide late bound declarations of every API function missing from - * one or more supported releases of the Win32 API - * - * lib is the enumerated token from apr_dlltoken_e, and must correspond - * to the string table entry in start.c used by the apr_load_dll_func(). - * Token names (attempt to) follow Windows.h declarations prefixed by DLL_ - * in order to facilitate comparison. Use the exact declaration syntax - * and names from Windows.h to prevent ambigutity and bugs. - * - * rettype and calltype follow the original declaration in Windows.h - * fn is the true function name - beware Ansi/Unicode #defined macros - * ord is the ordinal within the library, use 0 if it varies between versions - * args is the parameter list following the original declaration, in parens - * names is the parameter list sans data types, enclosed in parens - * - * #undef/re#define the Ansi/Unicode generic name to abate confusion - * In the case of non-text functions, simply #define the original name - */ - -#ifdef GetFileAttributesExA -#undef GetFileAttributesExA -#endif -APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( - IN LPCSTR lpFileName, - IN GET_FILEEX_INFO_LEVELS fInfoLevelId, - OUT LPVOID lpFileInformation), - (lpFileName, fInfoLevelId, lpFileInformation)); -#define GetFileAttributesExA apr_winapi_GetFileAttributesExA -#undef GetFileAttributesEx -#define GetFileAttributesEx apr_winapi_GetFileAttributesExA - -#ifdef GetFileAttributesExW -#undef GetFileAttributesExW -#endif -APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExW, 0, ( - IN LPCWSTR lpFileName, - IN GET_FILEEX_INFO_LEVELS fInfoLevelId, - OUT LPVOID lpFileInformation), - (lpFileName, fInfoLevelId, lpFileInformation)); -#define GetFileAttributesExW apr_winapi_GetFileAttributesExW - -APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( - IN HANDLE hFile), - (hFile)); -#define CancelIo apr_winapi_CancelIo - -apr_status_t apr_get_oslevel(struct apr_pool_t *, apr_oslevel_e *); -#endif /* WIN32 */ - #endif /* ! MISC_H */ diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index c0ac46f4262..4e20dfb5530 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -84,10 +84,6 @@ #include #endif -#ifdef BEOS -#include -#endif - struct apr_other_child_rec_t { apr_pool_t *p; struct apr_other_child_rec_t *next; From 8f2bf6c8fd4b60c1c5919c091b425b5602cec8f7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 21 Nov 2001 17:48:38 +0000 Subject: [PATCH 2536/7878] Following comments early this week, add a whole list of 95-unsupported dynamic functions that need fixup. Of course, everywhere these functions are actually _USED_ still must be version-tested against 95 if not 98. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62538 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/misc.h | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 4e20dfb5530..233cc20d095 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -183,6 +183,73 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( (hFile)); #define CancelIo apr_winapi_CancelIo +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, TryEnterCriticalSection, 0, ( + LPCRITICAL_SECTION lpCriticalSection), + (lpCriticalSection)); +#define TryEnterCriticalSection apr_winapi_TryEnterCriticalSection + +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, SwitchToThread, 0, ( + void), + ()); +#define SwitchToThread apr_winapi_SwitchToThread + +#undef GetEffectiveRightsFromAcl +APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetEffectiveRightsFromAclA, 0, ( + IN PACL pacl, + IN PTRUSTEE_A pTrustee, + OUT PACCESS_MASK pAccessRights), + (pacl, pTrustee, pAccessRights)); +#define GetEffectiveRightsFromAclA apr_winapi_GetEffectiveRightsFromAclA +#define GetEffectiveRightsFromAcl apr_winapi_GetEffectiveRightsFromAclA + +APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetEffectiveRightsFromAclW, 0, ( + IN PACL pacl, + IN PTRUSTEE_W pTrustee, + OUT PACCESS_MASK pAccessRights), + (pacl, pTrustee, pAccessRights)); +#define GetEffectiveRightsFromAclW apr_winapi_GetEffectiveRightsFromAclW + +APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoW, 0, ( + IN LPWSTR pObjectName, + IN SE_OBJECT_TYPE ObjectType, + IN SECURITY_INFORMATION SecurityInfo, + OUT PSID *ppsidOwner, + OUT PSID *ppsidGroup, + OUT PACL *ppDacl, + OUT PACL *ppSacl, + OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor), + (pObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup, + ppDacl, ppSacl, ppSecurityDescriptor)); +#define GetNamedSecurityInfoW apr_winapi_GetNamedSecurityInfoW + +APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoA, 0, ( + IN LPSTR pObjectName, + IN SE_OBJECT_TYPE ObjectType, + IN SECURITY_INFORMATION SecurityInfo, + OUT PSID *ppsidOwner, + OUT PSID *ppsidGroup, + OUT PACL *ppDacl, + OUT PACL *ppSacl, + OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor), + (pObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup, + ppDacl, ppSacl, ppSecurityDescriptor)); +#define GetNamedSecurityInfoA apr_winapi_GetNamedSecurityInfoA +#undef GetNamedSecurityInfo +#define GetNamedSecurityInfo apr_winapi_GetNamedSecurityInfoA + +APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetSecurityInfo, 0, ( + IN HANDLE handle, + IN SE_OBJECT_TYPE ObjectType, + IN SECURITY_INFORMATION SecurityInfo, + OUT PSID *ppsidOwner, + OUT PSID *ppsidGroup, + OUT PACL *ppDacl, + OUT PACL *ppSacl, + OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor), + (handle, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup, + ppDacl, ppSacl, ppSecurityDescriptor)); +#define GetSecurityInfo apr_winapi_GetSecurityInfo + apr_status_t apr_get_oslevel(struct apr_pool_t *, apr_oslevel_e *); #endif /* WIN32 */ From 805c0ba16f2ae3d0b195188bde38afbca38416f7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 21 Nov 2001 17:56:24 +0000 Subject: [PATCH 2537/7878] Following the split, fix this for the IDE (really no effect on building.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62539 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 2 +- libapr.dsp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apr.dsp b/apr.dsp index c587d5cc969..a24af5d1c42 100644 --- a/apr.dsp +++ b/apr.dsp @@ -417,7 +417,7 @@ SOURCE=.\include\arch\win32\locks.h # End Source File # Begin Source File -SOURCE=.\include\arch\unix\misc.h +SOURCE=.\include\arch\win32\misc.h # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index 0cbcf2cb5b8..fd7fcc62484 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -423,7 +423,7 @@ SOURCE=.\include\arch\win32\locks.h # End Source File # Begin Source File -SOURCE=.\include\arch\unix\misc.h +SOURCE=.\include\arch\win32\misc.h # End Source File # Begin Source File From b8e2ea8fab0d26e5f44bf39abbcc48aa6bcf5c69 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 21 Nov 2001 18:03:59 +0000 Subject: [PATCH 2538/7878] Missing include git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62540 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/win32/mmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index 428e4c91cb3..1e944cbaeb3 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -59,6 +59,7 @@ #include "apr_errno.h" #include "fileio.h" #include "apr_portable.h" +#include "apr_strings.h" #if APR_HAS_MMAP From b5c519eab9716676dde53036bdb475a0fa76bd2a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 21 Nov 2001 18:08:47 +0000 Subject: [PATCH 2539/7878] Add an obscure include required for certain misc.h functions on win32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62541 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_private.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index e3c49753936..325e3403edb 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -77,6 +77,10 @@ #define SW_HIDE 0 #endif +/* For the misc.h late-loaded dynamic symbols, we need some obscure types + */ +#include + #include #include #include From c84b5360731e81ef758999803bc87d6162304eae Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 22 Nov 2001 17:51:27 +0000 Subject: [PATCH 2540/7878] Fix a compiler warning from an undeclared function. Submitted by: Joe Orton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62542 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/unix/mmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 1f915bdb5d0..147317cc62b 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -55,6 +55,7 @@ #include "apr.h" #include "apr_private.h" #include "apr_general.h" +#include "apr_strings.h" #include "apr_mmap.h" #include "apr_errno.h" #include "fileio.h" From 996d543156d846b8683b47c57c86481e2ed5818e Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 23 Nov 2001 16:47:52 +0000 Subject: [PATCH 2541/7878] Speed up apr_pool_userdata_set[n] by letting apr_hash_set/get figure out the string length Obtained from: Brain Pane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62543 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ memory/unix/apr_pools.c | 12 ++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 4560643d349..67b9444c3e5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR b1 + *) Speed up apr_pool_userdata_set[n] by letting hash_set figure out + the strings length + [Brain Pane ] + *) New function apr_mmap_dup. This is called in the mmap_setaside [Brain Pane ] diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 4b5088d2e22..b7b0b7e7ba8 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1271,17 +1271,15 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *ke apr_status_t (*cleanup) (void *), apr_pool_t *cont) { - apr_size_t keylen = strlen(key); - if (cont->prog_data == NULL) cont->prog_data = apr_hash_make(cont); - if (apr_hash_get(cont->prog_data, key, keylen) == NULL){ + if (apr_hash_get(cont->prog_data, key, APR_HASH_KEY_STRING) == NULL){ char *new_key = apr_pstrdup(cont, key); - apr_hash_set(cont->prog_data, new_key, keylen, data); + apr_hash_set(cont->prog_data, new_key, APR_HASH_KEY_STRING, data); } else { - apr_hash_set(cont->prog_data, key, keylen, data); + apr_hash_set(cont->prog_data, key, APR_HASH_KEY_STRING, data); } if (cleanup) { @@ -1294,12 +1292,10 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, const char *k apr_status_t (*cleanup) (void *), apr_pool_t *cont) { - apr_size_t keylen = strlen(key); - if (cont->prog_data == NULL) cont->prog_data = apr_hash_make(cont); - apr_hash_set(cont->prog_data, key, keylen, data); + apr_hash_set(cont->prog_data, key, APR_HASH_KEY_STRING, data); if (cleanup) { apr_pool_cleanup_register(cont, data, cleanup, cleanup); From 6a421b9388555d9bcc275ae444ba5d072f252edd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 24 Nov 2001 16:59:09 +0000 Subject: [PATCH 2542/7878] Take advantage of Krzysztof Kowalczyk's observation that wtypes.h can be foiled on VC98. This hadn't presented an issue on VC5.0/current Platform SDKs, however this should resolve problematic GUI symbols (which we've carefully avoided throughout APR) for all VC builders. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62544 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_private.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 325e3403edb..19bf128fc1f 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -78,8 +78,16 @@ #endif /* For the misc.h late-loaded dynamic symbols, we need some obscure types + * Avoid dragging in wtypes.h unless it's absolutely necessary [generally + * not with APR itself, until some GUI-related security is introduced.] */ +#ifdef __wtypes_h__ #include +#else +#define __wtypes_h__ +#include +#undef __wtypes_h__ +#endif #include #include From 5813edc3c50f6147cb04b98959c484a1ac401127 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 24 Nov 2001 21:15:43 +0000 Subject: [PATCH 2543/7878] The missing Win32 apr_get_groupid, brings Win32 back to par with Unix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62545 13f79535-47bb-0310-9956-ffa450edef68 --- user/win32/groupinfo.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index 6b8b74cff84..3d533a19ce5 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -60,6 +60,46 @@ #include #endif +APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *gid, + const char *groupname, apr_pool_t *p) +{ + SID_NAME_USE sidtype; + char anydomain[256]; + char *domain; + DWORD sidlen = 0; + DWORD domlen = sizeof(anydomain); + DWORD rv; + char *pos; + + if (pos = strchr(groupname, '/')) { + domain = apr_pstrndup(p, groupname, pos - groupname); + groupname = pos + 1; + } + else if (pos = strchr(groupname, '\\')) { + domain = apr_pstrndup(p, groupname, pos - groupname); + groupname = pos + 1; + } + else { + domain = NULL; + } + /* Get nothing on the first pass ... need to size the sid buffer + */ + rv = LookupAccountName(domain, groupname, domain, &sidlen, + anydomain, &domlen, &sidtype); + if (sidlen) { + /* Give it back on the second pass + */ + *gid = apr_palloc(p, sidlen); + domlen = sizeof(anydomain); + rv = LookupAccountName(domain, groupname, *gid, &sidlen, + anydomain, &domlen, &sidtype); + } + if (!sidlen || !rv) { + return apr_get_os_error(); + } + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) { SID_NAME_USE type; From c4f0b8ee5af6693153a35ab953fdbbf5642fa8c6 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 26 Nov 2001 15:53:37 +0000 Subject: [PATCH 2544/7878] Fixed a memory leak in apr_accept. Prevents memory from continually being allocated and never freed until the process goes down. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62546 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 7 +++++++ network_io/win32/sockets.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 974ea626d0c..72a16a019bb 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -220,6 +220,13 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return errno; } *(*new)->local_addr = *sock->local_addr; + + /* The above assignment just overwrote the pool entry. Setting the local_addr + pool for the accepted socket back to what it should be. Otherwise all + allocations for this socket will come from a server pool that is not + freed until the process goes down.*/ + (*new)->local_addr->pool = p; + /* fix up any pointers which are no longer valid */ if (sock->local_addr->sa.sin.sin_family == AF_INET) { (*new)->local_addr->ipaddr_ptr = &(*new)->local_addr->sa.sin.sin_addr; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 0e10006a5d1..d764e341807 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -245,6 +245,13 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, return apr_get_netos_error(); } *(*new)->local_addr = *sock->local_addr; + + /* The above assignment just overwrote the pool entry. Setting the local_addr + pool for the accepted socket back to what it should be. Otherwise all + allocations for this socket will come from a server pool that is not + freed until the process goes down.*/ + (*new)->local_addr->pool = p; + /* fix up any pointers which are no longer valid */ if (sock->local_addr->sa.sin.sin_family == AF_INET) { (*new)->local_addr->ipaddr_ptr = &(*new)->local_addr->sa.sin.sin_addr; From a8f5c3131ff3c88cbb71050637b06f8116285fb2 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 26 Nov 2001 16:25:52 +0000 Subject: [PATCH 2545/7878] Speed up table operations. This patch adds a cache to each element in an apr_table_t. The cache consists of a 32-bit int containing the first 4 bytes of the element's key, converted to uppercase. This makes it possible to replace strcasecmp calls with inline integer comparisons. If the integer comparison fails, we can skip the strcasecmp. If the integer comparison succeeds, we can at least skip the first 4 bytes of the strcmp. In the httpd, this roughly doubles the speed of the apr_table_get and apr_table_setn operations. * A rewrite of apr_table_overlap() that uses a red-black tree instead of qsort * Cliff's faster version of the prefix computation macro * apr_palloc instead of apr_pcalloc for creating the array inside a table an important note: * This patch increases the size of the apr_table_entry_t struct, so it requires a "make clean." Submitted by: Brian Pane Reviewed by: Ian Holsman, Cliff Woolley git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62547 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 + include/apr_tables.h | 3 + tables/apr_tables.c | 527 +++++++++++++++++++++++++++++++------------ 3 files changed, 384 insertions(+), 150 deletions(-) diff --git a/CHANGES b/CHANGES index 67b9444c3e5..9a469616868 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR b1 + *) Speed up apr_table operations by using a cache/checksum and a + red-black tree in the overlay + [Brain Pane , Cliff Woolley] + *) Speed up apr_pool_userdata_set[n] by letting hash_set figure out the strings length [Brain Pane ] diff --git a/include/apr_tables.h b/include/apr_tables.h index 27704b814d0..238605e169c 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -130,6 +130,9 @@ struct apr_table_entry_t { */ /** The value for the current table entry */ char *val; + + /** A checksum for the key, for use by the apr_table internals */ + apr_uint32_t key_checksum; }; /** diff --git a/tables/apr_tables.c b/tables/apr_tables.c index e6e29ee0f6f..7fbd53d7359 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -89,7 +89,7 @@ */ static void make_array_core(apr_array_header_t *res, apr_pool_t *p, - int nelts, int elt_size) + int nelts, int elt_size, int clear) { /* * Assure sanity if someone asks for @@ -99,7 +99,12 @@ static void make_array_core(apr_array_header_t *res, apr_pool_t *p, nelts = 1; } - res->elts = apr_pcalloc(p, nelts * elt_size); + if (clear) { + res->elts = apr_pcalloc(p, nelts * elt_size); + } + else { + res->elts = apr_palloc(p, nelts * elt_size); + } res->pool = p; res->elt_size = elt_size; @@ -113,7 +118,7 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, apr_array_header_t *res; res = (apr_array_header_t *) apr_palloc(p, sizeof(apr_array_header_t)); - make_array_core(res, p, nelts, elt_size); + make_array_core(res, p, nelts, elt_size, 1); return res; } @@ -277,6 +282,41 @@ APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, * The "table" functions. */ +#if APR_CHARSET_EBCDIC +#define CASE_MASK 0xbfbfbfbf +#else +#define CASE_MASK 0xdfdfdfdf +#endif + +/* Compute the "checksum" for a key, consisting of the first + * 4 bytes, normalized for case-insensitivity and packed into + * an int...this checksum allows us to do a single integer + * comparison as a fast check to determine whether we can + * skip a strcasecmp + */ +#define COMPUTE_KEY_CHECKSUM(key, checksum) \ +{ \ + const char *k = (key); \ + apr_uint32_t c = (apr_uint32_t)*k; \ + (checksum) = c; \ + (checksum) <<= 8; \ + if (c) { \ + c = (apr_uint32_t)*++k; \ + checksum |= c; \ + } \ + (checksum) <<= 8; \ + if (c) { \ + c = (apr_uint32_t)*++k; \ + checksum |= c; \ + } \ + (checksum) <<= 8; \ + if (c) { \ + c = (apr_uint32_t)*++k; \ + checksum |= c; \ + } \ + checksum &= CASE_MASK; \ +} + /* * XXX: if you tweak this you should look at is_empty_table() and table_elts() * in alloc.h @@ -298,7 +338,7 @@ APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts) { apr_table_t *t = apr_palloc(p, sizeof(apr_table_t)); - make_array_core(&t->a, p, nelts, sizeof(apr_table_entry_t)); + make_array_core(&t->a, p, nelts, sizeof(apr_table_entry_t), 0); #ifdef MAKE_TABLE_PROFILE t->creator = __builtin_return_address(0); #endif @@ -318,7 +358,7 @@ APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, const apr_table_t *t) abort(); } #endif - make_array_core(&new->a, p, t->a.nalloc, sizeof(apr_table_entry_t)); + make_array_core(&new->a, p, t->a.nalloc, sizeof(apr_table_entry_t), 0); memcpy(new->a.elts, t->a.elts, t->a.nelts * sizeof(apr_table_entry_t)); new->a.nelts = t->a.nelts; return new; @@ -333,13 +373,15 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key) { apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int i; + apr_uint32_t checksum; if (key == NULL) { return NULL; } + COMPUTE_KEY_CHECKSUM(key, checksum); for (i = 0; i < t->a.nelts; ++i) { - if (!strcasecmp(elts[i].key, key)) { + if ((checksum == elts[i].key_checksum) && !strcasecmp(elts[i].key, key)) { return elts[i].val; } } @@ -353,9 +395,11 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, register int i, j, k; apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int done = 0; + apr_uint32_t checksum; + COMPUTE_KEY_CHECKSUM(key, checksum); for (i = 0; i < t->a.nelts; ) { - if (!strcasecmp(elts[i].key, key)) { + if ((checksum == elts[i].key_checksum) && !strcasecmp(elts[i].key, key)) { if (!done) { elts[i].val = apr_pstrdup(t->a.pool, val); done = 1; @@ -365,6 +409,7 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, for (j = i, k = i + 1; k < t->a.nelts; ++j, ++k) { elts[j].key = elts[k].key; elts[j].val = elts[k].val; + elts[j].key_checksum = elts[k].key_checksum; } --t->a.nelts; } @@ -378,6 +423,7 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, elts = (apr_table_entry_t *) table_push(t); elts->key = apr_pstrdup(t->a.pool, key); elts->val = apr_pstrdup(t->a.pool, val); + elts->key_checksum = checksum; } } @@ -387,6 +433,7 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, register int i, j, k; apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int done = 0; + apr_uint32_t checksum; #ifdef POOL_DEBUG { @@ -401,8 +448,9 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, } #endif + COMPUTE_KEY_CHECKSUM(key, checksum); for (i = 0; i < t->a.nelts; ) { - if (!strcasecmp(elts[i].key, key)) { + if ((checksum == elts[i].key_checksum) && !strcasecmp(elts[i].key, key)) { if (!done) { elts[i].val = (char *)val; done = 1; @@ -412,6 +460,7 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, for (j = i, k = i + 1; k < t->a.nelts; ++j, ++k) { elts[j].key = elts[k].key; elts[j].val = elts[k].val; + elts[j].key_checksum = elts[k].key_checksum; } --t->a.nelts; } @@ -425,6 +474,7 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, elts = (apr_table_entry_t *) table_push(t); elts->key = (char *)key; elts->val = (char *)val; + elts->key_checksum = checksum; } } @@ -432,9 +482,11 @@ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) { register int i, j, k; apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; + apr_uint32_t checksum; + COMPUTE_KEY_CHECKSUM(key, checksum); for (i = 0; i < t->a.nelts; ) { - if (!strcasecmp(elts[i].key, key)) { + if ((checksum == elts[i].key_checksum) && !strcasecmp(elts[i].key, key)) { /* found an element to skip over * there are any number of ways to remove an element from @@ -444,6 +496,7 @@ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) for (j = i, k = i + 1; k < t->a.nelts; ++j, ++k) { elts[j].key = elts[k].key; elts[j].val = elts[k].val; + elts[j].key_checksum = elts[k].key_checksum; } --t->a.nelts; } @@ -458,9 +511,11 @@ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, { apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int i; + apr_uint32_t checksum; + COMPUTE_KEY_CHECKSUM(key, checksum); for (i = 0; i < t->a.nelts; ++i) { - if (!strcasecmp(elts[i].key, key)) { + if ((checksum == elts[i].key_checksum) && !strcasecmp(elts[i].key, key)) { elts[i].val = apr_pstrcat(t->a.pool, elts[i].val, ", ", val, NULL); return; } @@ -469,6 +524,7 @@ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, elts = (apr_table_entry_t *) table_push(t); elts->key = apr_pstrdup(t->a.pool, key); elts->val = apr_pstrdup(t->a.pool, val); + elts->key_checksum = checksum; } APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, @@ -476,6 +532,7 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, { apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int i; + apr_uint32_t checksum; #ifdef POOL_DEBUG { @@ -490,8 +547,9 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, } #endif + COMPUTE_KEY_CHECKSUM(key, checksum); for (i = 0; i < t->a.nelts; ++i) { - if (!strcasecmp(elts[i].key, key)) { + if ((checksum == elts[i].key_checksum) && !strcasecmp(elts[i].key, key)) { elts[i].val = apr_pstrcat(t->a.pool, elts[i].val, ", ", val, NULL); return; } @@ -500,22 +558,27 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, elts = (apr_table_entry_t *) table_push(t); elts->key = (char *)key; elts->val = (char *)val; + elts->key_checksum = checksum; } APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, const char *val) { - apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; + apr_table_entry_t *elts; + apr_uint32_t checksum; + COMPUTE_KEY_CHECKSUM(key, checksum); elts = (apr_table_entry_t *) table_push(t); elts->key = apr_pstrdup(t->a.pool, key); elts->val = apr_pstrdup(t->a.pool, val); + elts->key_checksum = checksum; } APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, const char *val) { - apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; + apr_table_entry_t *elts; + apr_uint32_t checksum; #ifdef POOL_DEBUG { @@ -530,9 +593,11 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, } #endif + COMPUTE_KEY_CHECKSUM(key, checksum); elts = (apr_table_entry_t *) table_push(t); elts->key = (char *)key; elts->val = (char *)val; + elts->key_checksum = checksum; } APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, @@ -626,171 +691,333 @@ APR_DECLARE(void) apr_table_vdo(int (*comp) (void *, const char *, const char *) int rv, i; argp = va_arg(vp, char *); do { + apr_uint32_t checksum = 0; + if (argp) { + COMPUTE_KEY_CHECKSUM(argp, checksum); + } for (rv = 1, i = 0; rv && (i < t->a.nelts); ++i) { - if (elts[i].key && (!argp || !strcasecmp(elts[i].key, argp))) { + if (elts[i].key && (!argp || + ((checksum == elts[i].key_checksum) && + !strcasecmp(elts[i].key, argp)))) { rv = (*comp) (rec, elts[i].key, elts[i].val); } } } while (argp && ((argp = va_arg(vp, char *)) != NULL)); } -/* Curse libc and the fact that it doesn't guarantee a stable sort. We - * have to enforce stability ourselves by using the order field. If it - * provided a stable sort then we wouldn't even need temporary storage to - * do the work below. -djg - * - * ("stable sort" means that equal keys retain their original relative - * ordering in the output.) +/* During apr_table_overlap(), we build an overlap key for + * each element in the two tables. */ -typedef struct { - char *key; - char *val; - int order; +#define RED 0 +#define BLACK 1 +typedef struct overlap_key { + /* The table element */ + apr_table_entry_t *elt; + + /* 0 if from table 'a', 1 if from table 'b' */ + int level; + + /* Whether to omit this element when building the result table */ + int skip; + + /* overlap_keys can be assembled into a red-black tree */ + int black; + struct overlap_key *tree_parent; + struct overlap_key *tree_left; + struct overlap_key *tree_right; + int color; + + /* List of multiple values for this key */ + struct overlap_key *merge_next; + struct overlap_key *merge_last; } overlap_key; -static int sort_overlap(const void *va, const void *vb) +/* Rotate a subtree of a red-black tree */ +static void rotate_counterclockwise(overlap_key **root, + overlap_key *rotate_node) { - const overlap_key *a = va; - const overlap_key *b = vb; - int r; + overlap_key *child = rotate_node->tree_right; + rotate_node->tree_right = child->tree_left; + if (rotate_node->tree_right) { + rotate_node->tree_right->tree_parent = rotate_node; + } + child->tree_parent = rotate_node->tree_parent; + if (child->tree_parent == NULL) { + *root = child; + } + else { + if (rotate_node == rotate_node->tree_parent->tree_left) { + rotate_node->tree_parent->tree_left = child; + } + else { + rotate_node->tree_parent->tree_right = child; + } + } + child->tree_left = rotate_node; + rotate_node->tree_parent = child; +} - r = strcasecmp(a->key, b->key); - if (r) { - return r; +static void rotate_clockwise(overlap_key **root, overlap_key *rotate_node) +{ + overlap_key *child = rotate_node->tree_left; + rotate_node->tree_left = child->tree_right; + if (rotate_node->tree_left) { + rotate_node->tree_left->tree_parent = rotate_node; } - return a->order - b->order; + child->tree_parent = rotate_node->tree_parent; + if (child->tree_parent == NULL) { + *root = child; + } + else { + if (rotate_node == rotate_node->tree_parent->tree_left) { + rotate_node->tree_parent->tree_left = child; + } + else { + rotate_node->tree_parent->tree_right = child; + } + } + child->tree_right = rotate_node; + rotate_node->tree_parent = child; } -/* prefer to use the stack for temp storage for overlaps smaller than this */ -#ifndef APR_OVERLAP_TABLES_ON_STACK -#define APR_OVERLAP_TABLES_ON_STACK (512) -#endif + +static void overlap_hash(overlap_key *elt, + overlap_key **hash_table, int nhash, + unsigned flags) +{ + /* Each bucket in the hash table holds a red-black tree + * containing the overlap_keys that hash into that bucket + */ + overlap_key **child = &(hash_table[elt->elt->key_checksum & (nhash - 1)]); + overlap_key **root = child; + overlap_key *parent = NULL; + overlap_key *next; + + /* Look for the element in the tree */ + while ((next = *child) != NULL) { + int direction = strcasecmp(elt->elt->key, next->elt->key); + if (direction < 0) { + parent = next; + child = &(next->tree_left); + } + else if (direction > 0) { + parent = next; + child = &(next->tree_right); + } + else { + /* This is the key we're looking for */ + if (flags == APR_OVERLAP_TABLES_MERGE) { + /* Just link this node at the end of the list + * of values for the key. It doesn't need to + * be linked into the tree, becaue the node at + * the head of this key's value list is in the + * tree already. + */ + elt->skip = 1; + elt->merge_next = NULL; + if (next->merge_last) { + next->merge_last->merge_next = elt; + } + else { + next->merge_next = elt; + } + next->merge_last = elt; + } + else { + /* In the "set" case, don't bother storing + * this value in the tree if it's already + * there, except if the previous value was + * from table 'a' (level==0) and this value + * is from table 'b' (level==1) + */ + if (elt->level > next->level) { + elt->tree_left = next->tree_left; + if (next->tree_left) { + next->tree_left->tree_parent = elt; + } + elt->tree_right = next->tree_right; + if (next->tree_right) { + next->tree_right->tree_parent = elt; + } + elt->tree_parent = next->tree_parent; + (*child) = elt; + elt->merge_next = NULL; + elt->merge_last = NULL; + elt->skip = 0; + next->skip = 1; + } + else { + elt->skip = 1; + } + } + return; + } + } + + /* The element wasn't in the tree, so add it */ + elt->tree_left = NULL; + elt->tree_right = NULL; + elt->tree_parent = parent; + (*child) = elt; + elt->merge_next = NULL; + elt->merge_last = NULL; + elt->skip = 0; + elt->color = RED; + + /* Shuffle the nodes to maintain the red-black tree's balanced + * shape property. (This is what guarantees O(n*log(n)) worst-case + * performance for apr_table_overlap().) + */ + next = elt; + while ((next->tree_parent) && (next->tree_parent->color == RED)) { + /* Note: Root is always black, and red and black nodes + * alternate on any path down the tree. So if we're inside + * this block, the grandparent node is non-NULL. + */ + overlap_key *grandparent = next->tree_parent->tree_parent; + if (next->tree_parent == grandparent->tree_left) { + overlap_key *parent_sibling = grandparent->tree_right; + if (parent_sibling && (parent_sibling->color == RED)) { + next->tree_parent->color = BLACK; + parent_sibling->color = BLACK; + grandparent->color = RED; + next = grandparent; + } + else { + if (next == next->tree_parent->tree_right) { + next = next->tree_parent; + rotate_counterclockwise(root, next); + } + next->tree_parent->color = BLACK; + next->tree_parent->tree_parent->color = RED; + rotate_clockwise(root, next->tree_parent->tree_parent); + } + } + else { + overlap_key *parent_sibling = grandparent->tree_left; + if (parent_sibling && (parent_sibling->color == RED)) { + next->tree_parent->color = BLACK; + parent_sibling->color = BLACK; + grandparent->color = RED; + next = grandparent; + } + else { + if (next == next->tree_parent->tree_left) { + next = next->tree_parent; + rotate_clockwise(root, next); + } + next->tree_parent->color = BLACK; + next->tree_parent->tree_parent->color = RED; + rotate_counterclockwise(root, next->tree_parent->tree_parent); + } + } + } + (*root)->color = BLACK; +} + +/* Must be a power of 2 */ +#define DEFAULT_HASH_SIZE 16 APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags) { - overlap_key cat_keys_buf[APR_OVERLAP_TABLES_ON_STACK]; - overlap_key *cat_keys; + int max_keys; int nkeys; - apr_table_entry_t *e; - apr_table_entry_t *last_e; - overlap_key *left; - overlap_key *right; - overlap_key *last; + overlap_key *cat_keys; /* concatenation of the keys of a and b */ + overlap_key *b_start; + overlap_key **hash_table; + int nhash; + int i; + apr_table_entry_t *elts; - nkeys = a->a.nelts + b->a.nelts; - if (nkeys < APR_OVERLAP_TABLES_ON_STACK) { - cat_keys = cat_keys_buf; - } - else { - /* XXX: could use scratch free space in a or b's pool instead... - * which could save an allocation in b's pool. - */ - cat_keys = apr_palloc(b->a.pool, sizeof(overlap_key) * nkeys); + max_keys = a->a.nelts + b->a.nelts; + cat_keys = apr_palloc(b->a.pool, sizeof(overlap_key) * max_keys); + nhash = DEFAULT_HASH_SIZE; + while (nhash < max_keys) { + nhash <<= 1; } + hash_table = (overlap_key **)apr_pcalloc(b->a.pool, + sizeof(overlap_key *) * nhash); + + /* The cat_keys array contains an element for each entry in a, + * followed by one for each in b. While populating this array, + * we also use it as: + * 1) a hash table, to detect matching keys, and + * 2) a linked list of multiple values for a given key (in the + * APR_OVERLAP_TABLES_MERGE case) + */ + /* First, the elements of a */ nkeys = 0; + elts = (apr_table_entry_t *)a->a.elts; + for (i = 0; i < a->a.nelts; i++, nkeys++) { + cat_keys[nkeys].elt = &(elts[i]); + cat_keys[nkeys].level = 0; + overlap_hash(&(cat_keys[nkeys]), hash_table, nhash, flags); + } - /* Create a list of the entries from a concatenated with the entries - * from b. - */ - e = (apr_table_entry_t *)a->a.elts; - last_e = e + a->a.nelts; - while (e < last_e) { - cat_keys[nkeys].key = e->key; - cat_keys[nkeys].val = e->val; - cat_keys[nkeys].order = nkeys; - ++nkeys; - ++e; - } - - e = (apr_table_entry_t *)b->a.elts; - last_e = e + b->a.nelts; - while (e < last_e) { - cat_keys[nkeys].key = e->key; - cat_keys[nkeys].val = e->val; - cat_keys[nkeys].order = nkeys; - ++nkeys; - ++e; - } - - qsort(cat_keys, nkeys, sizeof(overlap_key), sort_overlap); - - /* Now iterate over the sorted list and rebuild a. - * Start by making sure it has enough space. - */ - a->a.nelts = 0; - if (a->a.nalloc < nkeys) { - a->a.elts = apr_palloc(a->a.pool, a->a.elt_size * nkeys * 2); - a->a.nalloc = nkeys * 2; + /* Then the elements of b */ + elts = (apr_table_entry_t *)b->a.elts; + for (i = 0; i < b->a.nelts; i++, nkeys++) { + cat_keys[nkeys].elt = &(elts[i]); + cat_keys[nkeys].level = 1; + overlap_hash(&(cat_keys[nkeys]), hash_table, nhash, flags); } - /* - * In both the merge and set cases we retain the invariant: - * - * left->key, (left+1)->key, (left+2)->key, ..., (right-1)->key - * are all equal keys. (i.e. strcasecmp returns 0) - * - * We essentially need to find the maximal - * right for each key, then we can do a quick merge or set as - * appropriate. + /* Copy concatenated list of elements into table a to + * form the new table contents, but: + * 1) omit the ones marked "skip," and + * 2) merge values for the same key if needed */ - - if (flags & APR_OVERLAP_TABLES_MERGE) { - left = cat_keys; - last = left + nkeys; - while (left < last) { - right = left + 1; - if (right == last - || strcasecmp(left->key, right->key)) { - apr_table_addn(a, left->key, left->val); - left = right; - } - else { - char *strp; - char *value; - size_t len; - - /* Have to merge some headers. Let's re-use the order field, - * since it's handy... we'll store the length of val there. - */ - left->order = strlen(left->val); - len = left->order; - do { - right->order = strlen(right->val); - len += 2 + right->order; - ++right; - } while (right < last - && !strcasecmp(left->key, right->key)); - /* right points one past the last header to merge */ - value = apr_palloc(a->a.pool, len + 1); - strp = value; - for (;;) { - memcpy(strp, left->val, left->order); - strp += left->order; - ++left; - if (left == right) { - break; - } - *strp++ = ','; - *strp++ = ' '; - } - *strp = 0; - apr_table_addn(a, (left-1)->key, value); - } - } - } - else { - left = cat_keys; - last = left + nkeys; - while (left < last) { - right = left + 1; - while (right < last && !strcasecmp(left->key, right->key)) { - ++right; - } - apr_table_addn(a, (right-1)->key, (right-1)->val); - left = right; - } + make_array_core(&a->a, b->a.pool, max_keys, sizeof(apr_table_entry_t), 0); + nkeys = 0; + for (i = 0; i < max_keys; i++) { + if (cat_keys[i].skip) { + continue; + } + if (cat_keys[i].merge_next) { + apr_table_entry_t *elt; + char *new_val; + char *val_next; + overlap_key *next = cat_keys[i].merge_next; + int len = (cat_keys[i].elt->val ? + strlen(cat_keys[i].elt->val) : 0); + do { + len += 2; + if (next->elt->val) { + len += strlen(next->elt->val); + } + next = next->merge_next; + } while (next); + len++; + new_val = (char *)apr_palloc(b->a.pool, len); + val_next = new_val; + if (cat_keys[i].elt->val) { + strcpy(val_next, cat_keys[i].elt->val); + val_next += strlen(cat_keys[i].elt->val); + } + next = cat_keys[i].merge_next; + do { + *val_next++ = ','; + *val_next++ = ' '; + if (next->elt->val) { + strcpy(val_next, next->elt->val); + val_next += strlen(next->elt->val); + } + next = next->merge_next; + } while (next); + *val_next = 0; + elt = (apr_table_entry_t *)table_push(a); + elt->key = cat_keys[i].elt->key; + elt->val = new_val; + elt->key_checksum = cat_keys[i].elt->key_checksum; + } + else { + apr_table_entry_t *elt = (apr_table_entry_t *)table_push(a); + elt->key = cat_keys[i].elt->key; + elt->val = cat_keys[i].elt->val; + elt->key_checksum = cat_keys[i].elt->key_checksum; + } } } From 9b71d5e54435cd93e61a7e8eb52601ce1f13d89f Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Mon, 26 Nov 2001 16:34:36 +0000 Subject: [PATCH 2546/7878] Fix minor typo in last patch: the pool has a different name. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62548 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 72a16a019bb..45d1d704024 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -225,7 +225,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn pool for the accepted socket back to what it should be. Otherwise all allocations for this socket will come from a server pool that is not freed until the process goes down.*/ - (*new)->local_addr->pool = p; + (*new)->local_addr->pool = connection_context; /* fix up any pointers which are no longer valid */ if (sock->local_addr->sa.sin.sin_family == AF_INET) { From f02e94f399bf6ddb89d87f0c3ee240d6f1954813 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 26 Nov 2001 18:22:41 +0000 Subject: [PATCH 2547/7878] Um, Brain? :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62549 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 9a469616868..8264dd6bd50 100644 --- a/CHANGES +++ b/CHANGES @@ -1,17 +1,17 @@ Changes with APR b1 *) Speed up apr_table operations by using a cache/checksum and a red-black tree in the overlay - [Brain Pane , Cliff Woolley] + [Brian Pane , Cliff Woolley] *) Speed up apr_pool_userdata_set[n] by letting hash_set figure out the strings length - [Brain Pane ] + [Brian Pane ] *) New function apr_mmap_dup. This is called in the mmap_setaside - [Brain Pane ] + [Brian Pane ] *) speed up the apr_hash_t implementation's handling of APR_HASH_KEY_STRING. - [Brain Pane ] + [Brian Pane ] *) Tweak apr_gethostname() so that it detects truncation of the name and returns an error. [Jeff Trawick] From 2019ea1806df27b599c1207100d927a534fe5a1e Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 26 Nov 2001 18:24:16 +0000 Subject: [PATCH 2548/7878] Canonicalize the formatting of these entries. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62550 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 8264dd6bd50..97faa2e77aa 100644 --- a/CHANGES +++ b/CHANGES @@ -1,17 +1,16 @@ Changes with APR b1 - *) Speed up apr_table operations by using a cache/checksum and a - red-black tree in the overlay - [Brian Pane , Cliff Woolley] + *) Speed up apr_table operations by using a cache/checksum and a + red-black tree in the overlay. + [Brian Pane , Cliff Woolley] - *) Speed up apr_pool_userdata_set[n] by letting hash_set figure out - the strings length - [Brian Pane ] + *) Speed up apr_pool_userdata_set[n] by letting hash_set figure out + the strings length. [Brian Pane ] - *) New function apr_mmap_dup. This is called in the mmap_setaside - [Brian Pane ] + *) New function apr_mmap_dup. This is called in the mmap_setaside. + [Brian Pane ] - *) speed up the apr_hash_t implementation's handling of APR_HASH_KEY_STRING. - [Brian Pane ] + *) Speed up the apr_hash_t implementation's handling of APR_HASH_KEY_STRING. + [Brian Pane ] *) Tweak apr_gethostname() so that it detects truncation of the name and returns an error. [Jeff Trawick] From 3ce3132a3dac01b82984f281f8b1cbb16a440599 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 26 Nov 2001 19:06:00 +0000 Subject: [PATCH 2549/7878] Switched the file structure to use the new locking scheme git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62551 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/fileio.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/arch/netware/fileio.h b/include/arch/netware/fileio.h index eedc1c3d3b4..101e006cc4f 100644 --- a/include/arch/netware/fileio.h +++ b/include/arch/netware/fileio.h @@ -101,9 +101,6 @@ #if APR_HAVE_SYS_TIME_H #include #endif -#ifdef BEOS -#include -#endif /* End System headers */ @@ -128,7 +125,7 @@ struct apr_file_t { int direction; /* buffer being used for 0 = read, 1 = write */ unsigned long filePtr; /* position in file of handle */ #if APR_HAS_THREADS - struct apr_lock_t *thlock; + struct apr_thread_mutex_t *thlock; #endif }; From 4e8ea5385c4d528d28ef1e7ea63a2822193c8227 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 26 Nov 2001 19:06:52 +0000 Subject: [PATCH 2550/7878] Added the apr_get_groupid() stub git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62552 13f79535-47bb-0310-9956-ffa450edef68 --- user/netware/groupinfo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/user/netware/groupinfo.c b/user/netware/groupinfo.c index ff7b1ca3476..e0bd822ade2 100644 --- a/user/netware/groupinfo.c +++ b/user/netware/groupinfo.c @@ -71,3 +71,7 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, return APR_ENOTIMPL; } +APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, const char *groupname, apr_pool_t *p) +{ + return APR_ENOTIMPL; +} From 1b4f688ecdb2560ff32d0767c3b43341812cfba4 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 26 Nov 2001 19:39:10 +0000 Subject: [PATCH 2551/7878] Fixing up the exclusion list for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62553 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_nw_export.awk | 1 + 1 file changed, 1 insertion(+) diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index 620dec056c9..2653ef03890 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -12,6 +12,7 @@ /apr_md5_set_xlate/{next} /apr_mmap_create/{next} /apr_mmap_delete/{next} +/apr_mmap_dup/{next} /apr_mmap_offset/{next} /apr_os_thread_get/{next} /apr_os_thread_put/{next} From 4c162c9bb5e066821a187a4792f937ba71c12014 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Mon, 26 Nov 2001 23:17:09 +0000 Subject: [PATCH 2552/7878] Begone ye festering warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62554 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 7fbd53d7359..cbf5a0eeb4f 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -924,7 +924,6 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, int max_keys; int nkeys; overlap_key *cat_keys; /* concatenation of the keys of a and b */ - overlap_key *b_start; overlap_key **hash_table; int nhash; int i; From 4b1d9512b6e3912ef455472bcd161ce39778373a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 26 Nov 2001 23:36:02 +0000 Subject: [PATCH 2553/7878] Fix a buglet that caused APR_FILE_BASED_SHM to be set inadvertently on some platforms (e.g., Linux, AIX). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62555 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ configure.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 97faa2e77aa..cd7a7352dc6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR b1 + + *) Fix a buglet that caused APR_FILE_BASED_SHM to be set inadvertently + on some platforms (e.g., Linux, AIX). [Jeff Trawick] + *) Speed up apr_table operations by using a cache/checksum and a red-black tree in the overlay. [Brian Pane , Cliff Woolley] diff --git a/configure.in b/configure.in index 16b50e27522..d550b8e4514 100644 --- a/configure.in +++ b/configure.in @@ -459,7 +459,7 @@ usemmapanon="0" usebeosarea="0" useos2shm="0" mem_based="0" -file_based="1" +file_based="0" case $ac_decision in USE_SHMEM_MMAP_TMP ) From 685e06840917d4418e1200c8a8f07872836a5b58 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 27 Nov 2001 02:31:55 +0000 Subject: [PATCH 2554/7878] Introduce apr_os_level, an apr-private internal value for optimizing the resolution of os versions under Win32. Since so many APIs rely on this determination, this should improve the performance. Pre-determine the version within the apr_initialize() call. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62556 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/misc.h | 4 ++- misc/unix/start.c | 9 ++++++ misc/win32/misc.c | 68 +++++++++++++++++++++------------------ 3 files changed, 48 insertions(+), 33 deletions(-) diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 233cc20d095..834f0b09ed0 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -104,7 +104,8 @@ struct apr_other_child_rec_t { * export new kernel or winsock functions or behavior. */ typedef enum { - APR_WIN_95 = 0, + APR_WIN_UNK = 0, + APR_WIN_95 = 2, APR_WIN_98 = 4, APR_WIN_NT = 8, APR_WIN_NT_4 = 12, @@ -115,6 +116,7 @@ typedef enum { APR_WIN_2000 = 24 } apr_oslevel_e; +extern apr_oslevel_e apr_os_level; typedef enum { DLL_WINBASEAPI = 0, // kernel32 From WinBase.h diff --git a/misc/unix/start.c b/misc/unix/start.c index 6c67925a2cd..a1c441a86b8 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -74,6 +74,9 @@ APR_DECLARE(apr_status_t) apr_initialize(void) WSADATA wsaData; int err; #endif +#if defined WIN32 + apr_oslevel_e osver; +#endif if (initialized++) { return APR_SUCCESS; @@ -83,6 +86,12 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_ENOPOOL; } +#ifdef WIN32 + /* Initialize apr_os_level global */ + if (apr_get_oslevel(global_apr_pool, &osver) != APR_SUCCESS) { + return APR_EEXIST; + } +#endif #if !defined(BEOS) && !defined(OS2) && !defined(WIN32) && !defined(NETWARE) apr_unix_setup_lock(); apr_proc_mutex_unix_setup_lock(); diff --git a/misc/win32/misc.c b/misc/win32/misc.c index bb5535102c7..a2f9a40f2da 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -55,15 +55,15 @@ #include "apr_private.h" #include "misc.h" +apr_oslevel_e apr_os_level = APR_WIN_UNK; + apr_status_t apr_get_oslevel(apr_pool_t *cont, apr_oslevel_e *level) { static OSVERSIONINFO oslev; static unsigned int servpack = 0; - static BOOL first = TRUE; char *pservpack; - if (first) { - first = FALSE; + if (apr_os_level == APR_WIN_UNK) { oslev.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&oslev); if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) { @@ -73,43 +73,47 @@ apr_status_t apr_get_oslevel(apr_pool_t *cont, apr_oslevel_e *level) if (*pservpack) servpack = atoi(pservpack); } - } - if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) { - if (oslev.dwMajorVersion == 5) { - (*level) = APR_WIN_2000; - } - else if (oslev.dwMajorVersion == 4) { - if (servpack >= 6) { - (*level) = APR_WIN_NT_4_SP6; - } - else if (servpack >= 4) { - (*level) = APR_WIN_NT_4_SP4; - } - else if (servpack >= 3) { - (*level) = APR_WIN_NT_4_SP3; + if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) { + if (oslev.dwMajorVersion == 5) { + (*level) = APR_WIN_2000; } - else if (servpack >= 2) { - (*level) = APR_WIN_NT_4_SP2; + else if (oslev.dwMajorVersion == 4) { + if (servpack >= 6) { + (*level) = APR_WIN_NT_4_SP6; + } + else if (servpack >= 4) { + (*level) = APR_WIN_NT_4_SP4; + } + else if (servpack >= 3) { + (*level) = APR_WIN_NT_4_SP3; + } + else if (servpack >= 2) { + (*level) = APR_WIN_NT_4_SP2; + } + else { + (*level) = APR_WIN_NT_4; + } } else { - (*level) = APR_WIN_NT_4; + (*level) = APR_WIN_NT; } - } - else { - (*level) = APR_WIN_NT; - } - return APR_SUCCESS; - } - else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { - if (oslev.dwMinorVersion == 0) { - (*level) = APR_WIN_95; return APR_SUCCESS; } - else if (oslev.dwMinorVersion > 0) { - (*level) = APR_WIN_98; - return APR_SUCCESS; + else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { + if (oslev.dwMinorVersion == 0) { + (*level) = APR_WIN_95; + return APR_SUCCESS; + } + else if (oslev.dwMinorVersion > 0) { + (*level) = APR_WIN_98; + return APR_SUCCESS; + } } } + else { + *level = apr_os_level; + return APR_SUCCESS; + } return APR_EEXIST; } From 180a1c00d8cddaf0760cda74006c4eb3a26b2a34 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 27 Nov 2001 02:32:37 +0000 Subject: [PATCH 2555/7878] An example of why we needed a pool-less apr_os_level. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62557 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/thread.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 09ee593d9ed..37850ea7354 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -59,7 +59,7 @@ #include "apr_lib.h" #include "apr_portable.h" #include - +#include "misc.h" APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) @@ -175,7 +175,14 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) APR_DECLARE(void) apr_thread_yield() { - SwitchToThread(); + /* SwitchToThread is not supported on Win9x, but since it's + * primarily a noop (entering time consuming code, therefore + * providing more critical threads a bit larger timeslice) + * we won't worry too much if it's not available. + */ + if (apr_os_level >= APR_WIN_NT) { + SwitchToThread(); + } } APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, From 8db02052f8892edf316417001fe314550bd3cf05 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 27 Nov 2001 02:39:19 +0000 Subject: [PATCH 2556/7878] Convert Win32 to apr_thread_mutex locking, rather than apr_lock. [Aaron Bannert] This does _not_ work on win9x, but the CancelIo call right there doesn't work either, so why hold up progress? The right solution is to emulate thread_mutex locking on 9x, so this patch is ultimately correct on all Win flavors. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62558 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 8 +++++--- file_io/win32/readwrite.c | 10 ++++++---- include/arch/win32/fileio.h | 4 ++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 6ca74fae4fa..e4c6b76bb62 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -58,6 +58,7 @@ #include "apr_general.h" #include "apr_strings.h" #include "apr_portable.h" +#include "apr_thread_mutex.h" #include #include #include @@ -268,7 +269,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, if (flag & APR_BUFFERED) { (*new)->buffered = 1; (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); - rv = apr_lock_create(&(*new)->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cont); + rv = apr_thread_mutex_create(&(*new)->mutex, APR_THREAD_MUTEX_DEFAULT, + cont); if (rv) { if (file_cleanup(*new) == APR_SUCCESS) { @@ -314,7 +316,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) apr_pool_cleanup_kill(file->cntxt, file, file_cleanup); if (file->buffered) - apr_lock_destroy(file->mutex); + apr_thread_mutex_destroy(file->mutex); return APR_SUCCESS; } @@ -460,4 +462,4 @@ APR_DECLARE_SET_INHERIT(file) { APR_DECLARE_UNSET_INHERIT(file) { return; -} \ No newline at end of file +} diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index c0d746d72b4..48968af1c9e 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -137,6 +137,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le break; } if (rv != APR_SUCCESS) { + /* XXX CancelIo is not available on Win95 */ CancelIo(file->filehand); } } @@ -184,7 +185,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size apr_size_t blocksize; apr_size_t size = *len; - apr_lock_acquire(thefile->mutex); + apr_thread_mutex_lock(thefile->mutex); if (thefile->direction == 1) { apr_file_flush(thefile); @@ -222,7 +223,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size if (*len) { rv = APR_SUCCESS; } - apr_lock_release(thefile->mutex); + apr_thread_mutex_unlock(thefile->mutex); } else { /* Unbuffered i/o */ apr_size_t nbytes; @@ -243,7 +244,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a apr_size_t blocksize; apr_size_t size = *nbytes; - apr_lock_acquire(thefile->mutex); + apr_thread_mutex_lock(thefile->mutex); if (thefile->direction == 0) { // Position file pointer for writing at the offset we are logically reading from @@ -268,7 +269,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a size -= blocksize; } - apr_lock_release(thefile->mutex); + apr_thread_mutex_unlock(thefile->mutex); return rv; } else { if (thefile->pOverlapped && !thefile->pipe) { @@ -304,6 +305,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a break; } if (rv != APR_SUCCESS) { + /* XXX CancelIo is not available on Win95 */ CancelIo(thefile->filehand); } } diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index ee6f94eae61..ce98fc7f479 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -60,7 +60,7 @@ #include "apr_pools.h" #include "apr_general.h" #include "apr_tables.h" -#include "apr_lock.h" +#include "apr_thread_mutex.h" #include "apr_file_io.h" #include "apr_file_info.h" #include "apr_errno.h" @@ -200,7 +200,7 @@ struct apr_file_t { apr_size_t dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write apr_off_t filePtr; // position in file of handle - apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields + apr_thread_mutex_t *mutex; // mutex semaphore, must be owned to access the above fields /* Pipe specific info */ }; From 189cb1568ddca109ff2f0c6e49fcfc77e64857c2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 27 Nov 2001 03:08:58 +0000 Subject: [PATCH 2557/7878] Optimize the win32 code with the (apr-internal) global apr_os_level, and clean out an unneeded thunk (since all GetEffectiveRightsFromAcl calls are by SID, we can always use the W version, peeling away the A->W thunk in the WinNT kernel.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62559 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 20 +++++---------- file_io/win32/filestat.c | 51 +++++++++++++++++++++---------------- include/arch/win32/fileio.h | 3 +-- include/arch/win32/misc.h | 9 ------- 4 files changed, 37 insertions(+), 46 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 5f52ed88221..0c6a217526a 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -86,9 +86,6 @@ static apr_status_t dir_cleanup(void *thedir) APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont) { -#if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; -#endif int len = strlen(dirname); (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); /* Leave room here to add and pop the '*' wildcard for FindFirstFile @@ -103,7 +100,7 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, (*new)->dirname[len] = '\0'; #if APR_HAS_UNICODE_FS - if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) + if (apr_os_level >= APR_WIN_NT) { /* Create a buffer for the longest file name we will ever see */ @@ -148,10 +145,9 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, * we aren't reporting any files where their absolute paths are too long. */ #if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; apr_wchar_t wdirname[APR_PATH_MAX]; apr_wchar_t *eos = NULL; - if (!apr_get_oslevel(thedir->cntxt, &os_level) && os_level >= APR_WIN_NT) + if (apr_os_level >= APR_WIN_NT) { if (thedir->dirhand == INVALID_HANDLE_VALUE) { @@ -224,14 +220,14 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, /* Go back and get more_info if we can't answer the whole inquiry */ #if APR_HAS_UNICODE_FS - if (os_level >= APR_WIN_NT) { + if (apr_os_level >= APR_WIN_NT) { /* Almost all our work is done. Tack on the wide file name * to the end of the wdirname (already / delimited) */ if (!eos) eos = wcschr(wdirname, '\0'); wcscpy(eos, thedir->w.entry->cFileName); - rv = more_finfo(finfo, wdirname, wanted, MORE_OF_WFSPEC, os_level); + rv = more_finfo(finfo, wdirname, wanted, MORE_OF_WFSPEC); eos[0] = '\0'; return rv; } @@ -249,7 +245,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, dirlen = sizeof(fspec) - 1; apr_cpystrn(fspec, thedir->dirname, sizeof(fspec)); apr_cpystrn(fspec + dirlen, fname, sizeof(fspec) - dirlen); - return more_finfo(finfo, fspec, wanted, MORE_OF_FSPEC, os_level); + return more_finfo(finfo, fspec, wanted, MORE_OF_FSPEC); } } @@ -268,8 +264,7 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) + if (apr_os_level >= APR_WIN_NT) { apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; @@ -292,8 +287,7 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) + if (apr_os_level >= APR_WIN_NT) { apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index f85a036c59a..356af75817f 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -105,8 +105,12 @@ static apr_fileperms_t convert_prot(ACCESS_MASK acc, prot_scope_e scope) static void resolve_prot(apr_finfo_t *finfo, apr_int32_t wanted, PACL dacl) { - TRUSTEE ident = {NULL, NO_MULTIPLE_TRUSTEE, TRUSTEE_IS_SID}; + TRUSTEE_W ident = {NULL, NO_MULTIPLE_TRUSTEE, TRUSTEE_IS_SID}; ACCESS_MASK acc; + /* + * This function is only invoked for WinNT, + * there is no reason for os_level testing here. + */ if ((wanted & APR_FINFO_WPROT) && !worldid) { SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_WORLD_SID_AUTHORITY; if (AllocateAndInitializeSid(&SIDAuth, 1, SECURITY_WORLD_RID, @@ -118,15 +122,24 @@ static void resolve_prot(apr_finfo_t *finfo, apr_int32_t wanted, PACL dacl) if ((wanted & APR_FINFO_UPROT) && (finfo->valid & APR_FINFO_USER)) { ident.TrusteeType = TRUSTEE_IS_USER; ident.ptstrName = finfo->user; - if (GetEffectiveRightsFromAcl(dacl, &ident, &acc) == ERROR_SUCCESS) { + /* GetEffectiveRightsFromAcl isn't supported under Win9x, + * which shouldn't come as a surprize. Since we are passing + * TRUSTEE_IS_SID, always skip the A->W layer. + */ + if (GetEffectiveRightsFromAclW(dacl, &ident, &acc) == ERROR_SUCCESS) { finfo->protection |= convert_prot(acc, prot_scope_user); finfo->valid |= APR_FINFO_UPROT; } } + /* Windows NT: did not return group rights. + * Windows 2000 returns group rights information. + * Since WinNT kernels don't follow the unix model of + * group associations, this all all pretty mute. + */ if ((wanted & APR_FINFO_GPROT) && (finfo->valid & APR_FINFO_GROUP)) { ident.TrusteeType = TRUSTEE_IS_GROUP; ident.ptstrName = finfo->group; - if (GetEffectiveRightsFromAcl(dacl, &ident, &acc) == ERROR_SUCCESS) { + if (GetEffectiveRightsFromAclW(dacl, &ident, &acc) == ERROR_SUCCESS) { finfo->protection |= convert_prot(acc, prot_scope_group); finfo->valid |= APR_FINFO_GPROT; } @@ -134,7 +147,7 @@ static void resolve_prot(apr_finfo_t *finfo, apr_int32_t wanted, PACL dacl) if ((wanted & APR_FINFO_WPROT) && (worldid)) { ident.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP; ident.ptstrName = worldid; - if (GetEffectiveRightsFromAcl(dacl, &ident, &acc) == ERROR_SUCCESS) { + if (GetEffectiveRightsFromAclW(dacl, &ident, &acc) == ERROR_SUCCESS) { finfo->protection |= convert_prot(acc, prot_scope_world); finfo->valid |= APR_FINFO_WPROT; } @@ -190,14 +203,14 @@ static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname, return rv; } -apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, apr_int32_t wanted, - int whatfile, apr_oslevel_e os_level) +apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, + apr_int32_t wanted, int whatfile) { PSID user = NULL, grp = NULL; PACL dacl = NULL; apr_status_t rv; - if (os_level < APR_WIN_NT) + if (apr_os_level < APR_WIN_NT) { /* Read, write execute for owner. In the Win9x environment, any * readable file is executable (well, not entirely 100% true, but @@ -404,10 +417,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want /* If we still want something more (besides the name) go get it! */ if ((wanted &= ~finfo->valid) & ~APR_FINFO_NAME) { - apr_oslevel_e os_level; - if (apr_get_oslevel(thefile->cntxt, &os_level)) - os_level = APR_WIN_95; - return more_finfo(finfo, thefile->filehand, wanted, MORE_OF_HANDLE, os_level); + return more_finfo(finfo, thefile->filehand, wanted, MORE_OF_HANDLE); } return APR_SUCCESS; @@ -430,7 +440,6 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, apr_wchar_t wfname[APR_PATH_MAX]; #endif - apr_oslevel_e os_level; char *filename = NULL; /* These all share a common subset of this structure */ union { @@ -439,9 +448,6 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, WIN32_FILE_ATTRIBUTE_DATA i; } FileInfo; - if (apr_get_oslevel(cont, &os_level)) - os_level = APR_WIN_95; - /* Catch fname length == MAX_PATH since GetFileAttributesEx fails * with PATH_NOT_FOUND. We would rather indicate length error than * 'not found' @@ -450,7 +456,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, return APR_ENAMETOOLONG; } - if ((os_level >= APR_WIN_NT) + if ((apr_os_level >= APR_WIN_NT) && (wanted & (APR_FINFO_IDENT | APR_FINFO_NLINK))) { /* FindFirstFile and GetFileAttributesEx can't figure the inode, * device or number of links, so we need to resolve with an open @@ -466,7 +472,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, } #if APR_HAS_UNICODE_FS - if (os_level >= APR_WIN_NT) { + if (apr_os_level >= APR_WIN_NT) { if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) / sizeof(apr_wchar_t), fname)) return rv; @@ -497,9 +503,10 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, } else #endif - if ((os_level >= APR_WIN_98) && (!(wanted & APR_FINFO_NAME) || isroot)) + if ((apr_os_level >= APR_WIN_98) && (!(wanted & APR_FINFO_NAME) || isroot)) { /* cannot use FindFile on a Win98 root, it returns \* + * GetFileAttributesExA is not available on Win95 */ if (!GetFileAttributesExA(fname, GetFileExInfoStandard, &FileInfo.i)) { @@ -548,7 +555,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * to reliably translate char devices to the path '\\.\device' * so go ask for the full path. */ - if (os_level >= APR_WIN_NT) { + if (apr_os_level >= APR_WIN_NT) { #if APR_HAS_UNICODE_FS apr_wchar_t tmpname[APR_FILE_MAX]; apr_wchar_t *tmpoff; @@ -582,10 +589,10 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, if (wanted &= ~finfo->valid) { /* Caller wants more than APR_FINFO_MIN | APR_FINFO_NAME */ #if APR_HAS_UNICODE_FS - if (os_level >= APR_WIN_NT) - return more_finfo(finfo, wfname, wanted, MORE_OF_WFSPEC, os_level); + if (apr_os_level >= APR_WIN_NT) + return more_finfo(finfo, wfname, wanted, MORE_OF_WFSPEC); #endif - return more_finfo(finfo, fname, wanted, MORE_OF_FSPEC, os_level); + return more_finfo(finfo, fname, wanted, MORE_OF_FSPEC); } return APR_SUCCESS; diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index ce98fc7f479..c1acce617f0 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -160,8 +160,7 @@ int fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, /* Private function that extends apr_stat/lstat/getfileinfo/dir_read */ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, - apr_int32_t wanted, int whatfile, - apr_oslevel_e os_level); + apr_int32_t wanted, int whatfile); /* whatfile types for the ufile arg */ #define MORE_OF_HANDLE 0 diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 834f0b09ed0..463a4093d41 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -195,15 +195,6 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, SwitchToThread, 0, ( ()); #define SwitchToThread apr_winapi_SwitchToThread -#undef GetEffectiveRightsFromAcl -APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetEffectiveRightsFromAclA, 0, ( - IN PACL pacl, - IN PTRUSTEE_A pTrustee, - OUT PACCESS_MASK pAccessRights), - (pacl, pTrustee, pAccessRights)); -#define GetEffectiveRightsFromAclA apr_winapi_GetEffectiveRightsFromAclA -#define GetEffectiveRightsFromAcl apr_winapi_GetEffectiveRightsFromAclA - APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetEffectiveRightsFromAclW, 0, ( IN PACL pacl, IN PTRUSTEE_W pTrustee, From b9e64898990f629a4a89def3c2bf12305aa18c01 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 27 Nov 2001 03:19:48 +0000 Subject: [PATCH 2558/7878] Final comments r.e. Win9x unsupported functions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62560 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 356af75817f..758035d128d 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -230,6 +230,10 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, else if (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) { /* On NT this request is incredibly expensive, but accurate. + * Since the WinNT-only functions below are protected by the + * (apr_os_level < APR_WIN_NT) case above, we need no extra + * tests, but remember GetNamedSecurityInfo & GetSecurityInfo + * are not supported on 9x. */ SECURITY_INFORMATION sinf = 0; PSECURITY_DESCRIPTOR pdesc = NULL; From 7a52200d9546ad2b28fcd03b2f6687cd314c2265 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 27 Nov 2001 03:20:39 +0000 Subject: [PATCH 2559/7878] This one is serious - Win9x won't work till it's addressed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62561 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/thread_mutex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 386ea1de7ec..2ac52f8bda3 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -92,6 +92,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { BOOL status; + /* XXX TryEnterCriticalSection is not available under Win9x */ status = TryEnterCriticalSection(&mutex->section); if (status) { return APR_SUCCESS; From c191656c4b1bfec3de46db26471002c0974e90b8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 27 Nov 2001 03:50:49 +0000 Subject: [PATCH 2560/7878] we don't really need langlvl=extended for AIX+xlc, at least with this fix to the check for TCP_NODELAY inheritance git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62562 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- build/apr_network.m4 | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 82234599dd8..e06ed1bc7c0 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -79,7 +79,7 @@ if test "x$apr_preload_done" != "xyes" ; then dnl Must do a check for gcc or egcs here, to get the right options dnl to the compiler. if test "$GCC" != "yes"; then - APR_ADDTO(CFLAGS, [-qHALT=E -qLANGLVL=extended]) + APR_ADDTO(CFLAGS, [-qHALT=E]) fi APR_SETIFNULL(apr_iconv_inbuf_const, [1]) APR_ADDTO(CPPFLAGS, [-D_THREAD_SAFE]) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index af3531fcd59..ecaa405a5c4 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -256,12 +256,15 @@ AC_DEFUN(APR_CHECK_TCP_NODELAY_INHERITED,[ #ifdef HAVE_NETINET_TCP_H #include #endif +#ifndef HAVE_SOCKLEN_T +typedef int socklen_t; +#endif int main(void) { int listen_s, connected_s, client_s; int listen_port, rc; struct sockaddr_in sa; - int sa_len; - int option_len; + socklen_t sa_len; + socklen_t option_len; int option; listen_s = socket(AF_INET, SOCK_STREAM, 0); From 6fda86b06100524d414c4609fb0ffae8c296deea Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 27 Nov 2001 04:43:43 +0000 Subject: [PATCH 2561/7878] Fix locks for win32 terminal services, submitted by Mladen Turk . This is the cleaner of the two parts of his patch, which does _not_ change the initial locking state of the mutex, nor add a private owner flag. Those changes were invalid because no part of apr should rely on intimate knowledge of the internals of other parts of apr, whenever we can avoid it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62563 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/locks.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 079b5e2d576..79f30001485 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -100,7 +100,6 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, /* ToDo: How to handle the case when no pool is available? * How to cleanup the storage properly? */ - newlock->fname = apr_pstrdup(pool, fname); newlock->type = type; newlock->scope = scope; sec.nLength = sizeof(SECURITY_ATTRIBUTES); @@ -114,9 +113,24 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, } if (scope == APR_INTRAPROCESS) { + newlock->fname = apr_pstrdup(pool, fname); InitializeCriticalSection(&newlock->section); } else { - newlock->mutex = CreateMutex(&sec, FALSE, fname); + /* With Win2000 Terminal Services, the Mutex name can have a + * "Global\" or "Local\" prefix to explicitly create the object + * in the global or session name space. Without Terminal Service + * running on Win2000, Global\ and Local\ are ignored. These + * prefixes are only valid on Win2000+ + */ + if (apr_os_level >= APR_WIN_2000) + newlock->fname = apr_pstrcat(pool, "Global\\", fname, NULL); + else + newlock->fname = apr_pstrdup(pool, fname); + + newlock->mutex = CreateMutex(&sec, FALSE, newlock->fname); + if (!newlock->mutex) { + return apr_get_os_error(); + } } *lock = newlock; apr_pool_cleanup_register(newlock->pool, newlock, lock_cleanup, From 486b7e812dd63c61729be0638362f005c6ca9143 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 27 Nov 2001 05:22:34 +0000 Subject: [PATCH 2562/7878] Fix compile error introduced by the previous commit to this file. Need to include misc.h to prevent undefined variable errors for apr_os_level and APR_WIN_2000. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62564 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/locks.c | 1 + 1 file changed, 1 insertion(+) diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 79f30001485..7a845767644 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -58,6 +58,7 @@ #include "apr_strings.h" #include "win32/locks.h" #include "apr_portable.h" +#include "misc.h" static apr_status_t lock_cleanup(void *lock_) { From b7183f66c48d8983c9c5744ba26a11d782673d6f Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Tue, 27 Nov 2001 17:33:13 +0000 Subject: [PATCH 2563/7878] remove a big nasty strdup for apr_filepath_merge Submitted by: Brian Pane Reviewed by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62565 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index d11350719e2..77845f3d2b1 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -118,8 +118,9 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, apr_int32_t flags, apr_pool_t *p) { - char path[APR_PATH_MAX]; /* isn't null term */ + char *path; apr_size_t rootlen; /* is the length of the src rootpath */ + apr_size_t maxlen; /* maximum total path length */ apr_size_t keptlen; /* is the length of the retained rootpath */ apr_size_t pathlen; /* is the length of the result path */ apr_size_t seglen; /* is the end of the current segment */ @@ -184,6 +185,18 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } rootlen = strlen(rootpath); + maxlen = rootlen + strlen(addpath) + 4; /* 4 for slashes at start, after + * root, and at end, plus trailing + * null */ + if (maxlen > APR_PATH_MAX) { + if (rootlen >= APR_PATH_MAX) { + return APR_ENAMETOOLONG; + } + maxlen = APR_PATH_MAX; + } + path = (char *)apr_palloc(p, maxlen); + + if (addpath[0] == '/') { @@ -207,14 +220,12 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* Base the result path on the rootpath */ keptlen = rootlen; - if (rootlen >= sizeof(path)) - return APR_ENAMETOOLONG; memcpy(path, rootpath, rootlen); /* Always '/' terminate the given root path */ if (keptlen && path[keptlen - 1] != '/') { - if (keptlen + 1 >= sizeof(path)) + if (keptlen + 1 >= maxlen) return APR_ENAMETOOLONG; path[keptlen++] = '/'; } @@ -262,7 +273,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* Otherwise append another backpath. */ - if (pathlen + 3 >= sizeof(path)) + if (pathlen + 3 >= maxlen ) return APR_ENAMETOOLONG; memcpy(path + pathlen, "../", 3); pathlen += 3; @@ -291,7 +302,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* An actual segment, append it to the destination path */ apr_size_t i = (addpath[seglen] != '\0'); - if (pathlen + seglen + i >= sizeof(path)) + if (pathlen + seglen + i >= maxlen) return APR_ENAMETOOLONG; memcpy(path + pathlen, addpath, seglen + i); pathlen += seglen + i; @@ -320,6 +331,6 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, return APR_EABOVEROOT; } - *newpath = apr_pstrdup(p, path); + *newpath = path; return APR_SUCCESS; } From 18f137233cd5e4fca5a860441b543d5b74df8244 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Tue, 27 Nov 2001 18:54:59 +0000 Subject: [PATCH 2564/7878] Sorry Justin. (remove 2 blank lines) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62566 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 77845f3d2b1..2120a8d0a9b 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -196,8 +196,6 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } path = (char *)apr_palloc(p, maxlen); - - if (addpath[0] == '/') { /* Ignore the given root path, strip off leading From 25afe1249ee1d65057027c672a0097b7ea01a3f6 Mon Sep 17 00:00:00 2001 From: "Victor J. Orlikowski" Date: Tue, 27 Nov 2001 22:10:31 +0000 Subject: [PATCH 2565/7878] Fix up this declaration. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62568 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 43590c897a3..c31010c05c5 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -552,7 +552,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, /** * Detach the process from the controlling terminal. */ -apr_status_t apr_proc_detach(void); +APR_DECLARE(apr_status_t) apr_proc_detach(void); #if APR_HAS_OTHER_CHILD From f53614d7aeca10f6464496d6531cfa81e5c918a9 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Tue, 27 Nov 2001 23:50:47 +0000 Subject: [PATCH 2566/7878] move MMAP_{THRESHOLD,LIMIT} defines to apr_mmap.h so they can be used elsewhere git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62569 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_mmap.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 17cbab34368..e09e29fb538 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -117,6 +117,22 @@ struct apr_mmap_t { #if APR_HAS_MMAP || defined(DOXYGEN) +/* Files have to be at least this big before they're mmap()d. This is to deal + * with systems where the expense of doing an mmap() and an munmap() outweighs + * the benefit for small files. It shouldn't be set lower than 1. + */ +#ifndef MMAP_THRESHOLD +# ifdef SUNOS4 +# define MMAP_THRESHOLD (8*1024) +# else +# define MMAP_THRESHOLD 1 +# endif /* SUNOS4 */ +#endif /* MMAP_THRESHOLD */ + +#ifndef MMAP_LIMIT +# define MMAP_LIMIT (4*1024*1024) +#endif /* MMAP_LIMIT */ + /* Function definitions */ /** From e686e162bd8bbdacf2480668b1b19925ccc13a10 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 28 Nov 2001 00:30:04 +0000 Subject: [PATCH 2567/7878] namespace protect MMAP_{THRESHOLD,LIMIT} with APR_ prefix PR: Obtained from: Submitted by: Reviewed by: Cliff Woolley git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62570 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_mmap.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/include/apr_mmap.h b/include/apr_mmap.h index e09e29fb538..251f3fec1b4 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -121,16 +121,20 @@ struct apr_mmap_t { * with systems where the expense of doing an mmap() and an munmap() outweighs * the benefit for small files. It shouldn't be set lower than 1. */ -#ifndef MMAP_THRESHOLD +#ifdef MMAP_THRESHOLD +# define APR_MMAP_THRESHOLD MMAP_THRESHOLD +#else # ifdef SUNOS4 -# define MMAP_THRESHOLD (8*1024) +# define APR_MMAP_THRESHOLD (8*1024) # else -# define MMAP_THRESHOLD 1 +# define APR_MMAP_THRESHOLD 1 # endif /* SUNOS4 */ #endif /* MMAP_THRESHOLD */ -#ifndef MMAP_LIMIT -# define MMAP_LIMIT (4*1024*1024) +#ifdef MMAP_LIMIT +# define APR_MMAP_LIMIT MMAP_LIMIT +#else +# define APR_MMAP_LIMIT (4*1024*1024) #endif /* MMAP_LIMIT */ /* Function definitions */ From 12b45e5233cea3393f0be2d9dbb7a898d7e8b3b8 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 28 Nov 2001 00:36:53 +0000 Subject: [PATCH 2568/7878] add APR_MMAP_CANDIDATE macro to test if filelength is an mmap candidate (greater than or equal to APR_MMAP_THRESHOLD and less than APR_MMAP_LIMIT) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62571 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_mmap.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 251f3fec1b4..d4113c8dd49 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -137,6 +137,9 @@ struct apr_mmap_t { # define APR_MMAP_LIMIT (4*1024*1024) #endif /* MMAP_LIMIT */ +#define APR_MMAP_CANDIDATE(filelength) \ + ((filelength >= APR_MMAP_THRESHOLD) && (filelength < APR_MMAP_LIMIT)) + /* Function definitions */ /** From 06ec5e209e2faef3c9b5e66e546791a3f3e81859 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 28 Nov 2001 00:57:34 +0000 Subject: [PATCH 2569/7878] recognize the symbols generated by APR_POOL_DECLARE_ACCESSOR() so that exports.c and the .exp files have the necessary references git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62572 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_exports.awk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/make_exports.awk b/build/make_exports.awk index b50768125d6..f9ee2561f3b 100644 --- a/build/make_exports.awk +++ b/build/make_exports.awk @@ -97,6 +97,13 @@ function add_symbol(symbol) { next } +/^[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(][^)]*[)]/ { + sub("[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(]", "", $0) + sub("[)].*$", "", $0) + add_symbol("apr_" $0 "_pool_get") + next +} + /^#[ \t]*if(ndef| !defined[(])([^_]*_)*H/ { enter_scope(TYPE_HEADER) next From 3f4dbad9d13e421d4d06b7334622d62ec6cfc125 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 28 Nov 2001 14:40:26 +0000 Subject: [PATCH 2570/7878] Now that hurts... fix of my patch from Barry Pederson git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62573 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 758035d128d..8952f79d050 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -246,9 +246,9 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, if (whatfile == MORE_OF_WFSPEC) { apr_wchar_t *wfile = (apr_wchar_t*) ufile; int fix = 0; - if (wcsncmp(wfile, L"\\\\?\\", 4)) { + if (wcsncmp(wfile, L"\\\\?\\", 4) == 0) { fix = 4; - if (wcsncmp(wfile + fix, L"UNC\\", 4)) + if (wcsncmp(wfile + fix, L"UNC\\", 4) == 0) wfile[6] = L'\\', fix = 6; } rv = GetNamedSecurityInfoW(wfile + fix, From 4a5901562b58c1229d404d6944742ee4df6a863b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 29 Nov 2001 00:17:32 +0000 Subject: [PATCH 2571/7878] get errorcodes.c compiling on AIX 5L again we didn't recognize 5L, so we didn't define _USE_IRS, so we didn't get the prototype for hstrerror(), and I recently told xlc to be pickier, so the compiler bailed on a so-called misuse of hstrerror() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62574 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 3 +++ build/config.guess | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index e06ed1bc7c0..dfb300ea912 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -69,6 +69,9 @@ if test "x$apr_preload_done" != "xyes" ; then *-ibm-aix4.3) APR_ADDTO(CPPFLAGS, [-D_USE_IRS -U__STR__]) ;; + *-ibm-aix5*) + APR_ADDTO(CPPFLAGS, [-D_USE_IRS -U__STR__]) + ;; *-ibm-aix4.3.*) APR_ADDTO(CPPFLAGS, [-D_USE_IRS -U__STR__]) ;; diff --git a/build/config.guess b/build/config.guess index 32052b48977..f8ca267fa70 100755 --- a/build/config.guess +++ b/build/config.guess @@ -437,7 +437,8 @@ EOF echo rs6000-ibm-aix3.2 fi exit 0 ;; - *:AIX:*:4) + # next stanza updated from autoconf 2.52 to get support for 5L + *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -447,7 +448,7 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=4.${UNAME_RELEASE} + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; From e8fb516fb184651b4beb5eec7d6d9e6d4930ef2b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 29 Nov 2001 00:34:28 +0000 Subject: [PATCH 2572/7878] get rid of cruft associated with 1.3-era symbols USEBCOPY and NEED_RLIM_T iff anybody ever needs this we'll do some autodetection; but nobody ever uses these symbols git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62575 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 3 --- build/apr_hints.m4 | 14 +++++++------- configure.in | 3 --- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/acconfig.h b/acconfig.h index cbce0a2fd63..77e6e0f7150 100644 --- a/acconfig.h +++ b/acconfig.h @@ -28,9 +28,6 @@ #undef GETHOSTBYADDR_IS_THREAD_SAFE #undef STRERROR_R_RC_INT -#undef NEED_RLIM_T -#undef USEBCOPY - #undef HAVE_GMTOFF #undef USE_THREADS diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index dfb300ea912..605b1f1054b 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -46,19 +46,19 @@ if test "x$apr_preload_done" != "xyes" ; then *-ibm-aix*) case $host in i386-ibm-aix*) - APR_ADDTO(CPPFLAGS, [-U__STR__ -DUSEBCOPY]) + APR_ADDTO(CPPFLAGS, [-U__STR__]) ;; *-ibm-aix[1-2].*) - APR_ADDTO(CPPFLAGS, [-DNEED_RLIM_T -U__STR__]) + APR_ADDTO(CPPFLAGS, [-U__STR__]) ;; *-ibm-aix3.*) - APR_ADDTO(CPPFLAGS, [-DNEED_RLIM_T -U__STR__]) + APR_ADDTO(CPPFLAGS, [-U__STR__]) ;; *-ibm-aix4.1) - APR_ADDTO(CPPFLAGS, [-DNEED_RLIM_T -U__STR__]) + APR_ADDTO(CPPFLAGS, [-U__STR__]) ;; *-ibm-aix4.1.*) - APR_ADDTO(CPPFLAGS, [-DNEED_RLIM_T -U__STR__]) + APR_ADDTO(CPPFLAGS, [-U__STR__]) ;; *-ibm-aix4.2) APR_ADDTO(CPPFLAGS, [-U__STR__]) @@ -215,7 +215,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(apr_iconv_inbuf_const, [1]) ;; *-sunos4*) - APR_ADDTO(CPPFLAGS, [-DSUNOS4 -DUSEBCOPY]) + APR_ADDTO(CPPFLAGS, [-DSUNOS4]) ;; *-unixware1) APR_ADDTO(CPPFLAGS, [-DUW=100]) @@ -281,7 +281,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-uts*) PLATOSVERS=`echo $host | sed 's/^.*,//'` case $PLATOSVERS in - 2*) APR_ADDTO(CPPFLAGS, [-DUTS21 -DUSEBCOPY]) + 2*) APR_ADDTO(CPPFLAGS, [-DUTS21]) APR_ADDTO(CFLAGS, [-Xa -eft]) APR_ADDTO(LIBS, [-lbsd -la]) ;; diff --git a/configure.in b/configure.in index d550b8e4514..fb0092190d8 100644 --- a/configure.in +++ b/configure.in @@ -522,15 +522,12 @@ if test ".$SYS_SW" = ".AIX"; then APR_ADDTO(CPPFLAGS,-U__STR__) case "$SYS_KV" in [12]*) - AC_DEFINE(USEBCOPY) OSDIR="aix" ;; 3*) - AC_DEFINE(NEED_RLIM_T) OSDIR="aix" ;; 41*) - AC_DEFINE(NEED_RLIM_T) OSDIR="aix" ;; 42*) From 7056f551eeb7a0d46bde444aa9ba1eac569187c9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 29 Nov 2001 00:55:02 +0000 Subject: [PATCH 2573/7878] Get rid of some ancient pre-apr_hints.m4 AIX logic I don't think SYS_SW has been set since Spring '99... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62576 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/configure.in b/configure.in index fb0092190d8..8d3d7fbbac0 100644 --- a/configure.in +++ b/configure.in @@ -518,24 +518,6 @@ AC_SUBST(anonymous_shm) AC_SUBST(filebased_shm) AC_SUBST(keybased_shm) -if test ".$SYS_SW" = ".AIX"; then - APR_ADDTO(CPPFLAGS,-U__STR__) - case "$SYS_KV" in - [12]*) - OSDIR="aix" - ;; - 3*) - OSDIR="aix" - ;; - 41*) - OSDIR="aix" - ;; - 42*) - OSDIR="aix" - ;; - esac -fi - dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) AC_CHECK_FUNCS(calloc strcasecmp stricmp setsid nl_langinfo isinf isnan) From 94be6a02ac0229f8f4fbb65e79362885eb6c7ad3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 29 Nov 2001 02:08:11 +0000 Subject: [PATCH 2574/7878] simplify the setting of some magic symbols on AIX (it would be nice to autodetect the need for _USE_IRS) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62577 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 44 +++++++++++--------------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 605b1f1054b..cb5e5e3d0a0 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -44,40 +44,18 @@ if test "x$apr_preload_done" != "xyes" ; then APR_SETVAR(SHELL, [/bin/ksh]) ;; *-ibm-aix*) + APR_ADDTO(CPPFLAGS, [-U__STR__]) + dnl _USR_IRS gets us the hstrerror() proto in netdb.h case $host in - i386-ibm-aix*) - APR_ADDTO(CPPFLAGS, [-U__STR__]) - ;; - *-ibm-aix[1-2].*) - APR_ADDTO(CPPFLAGS, [-U__STR__]) - ;; - *-ibm-aix3.*) - APR_ADDTO(CPPFLAGS, [-U__STR__]) - ;; - *-ibm-aix4.1) - APR_ADDTO(CPPFLAGS, [-U__STR__]) - ;; - *-ibm-aix4.1.*) - APR_ADDTO(CPPFLAGS, [-U__STR__]) - ;; - *-ibm-aix4.2) - APR_ADDTO(CPPFLAGS, [-U__STR__]) - ;; - *-ibm-aix4.2.*) - APR_ADDTO(CPPFLAGS, [-U__STR__]) - ;; - *-ibm-aix4.3) - APR_ADDTO(CPPFLAGS, [-D_USE_IRS -U__STR__]) - ;; - *-ibm-aix5*) - APR_ADDTO(CPPFLAGS, [-D_USE_IRS -U__STR__]) - ;; - *-ibm-aix4.3.*) - APR_ADDTO(CPPFLAGS, [-D_USE_IRS -U__STR__]) - ;; - *-ibm-aix*) - APR_ADDTO(CPPFLAGS, [-U__STR__]) - ;; + *-ibm-aix4.3) + APR_ADDTO(CPPFLAGS, [-D_USE_IRS]) + ;; + *-ibm-aix5*) + APR_ADDTO(CPPFLAGS, [-D_USE_IRS]) + ;; + *-ibm-aix4.3.*) + APR_ADDTO(CPPFLAGS, [-D_USE_IRS]) + ;; esac dnl Must do a check for gcc or egcs here, to get the right options dnl to the compiler. From ce679a916ce6bf7788d65a79fa4e53e68b195e8d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 29 Nov 2001 02:33:24 +0000 Subject: [PATCH 2575/7878] add a simple program for sanity-checking APR_foo_FMT_T values (assuming you use a compiler such as gcc which knows when to complain) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62578 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 +++ test/testfmt.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 test/testfmt.c diff --git a/test/Makefile.in b/test/Makefile.in index 4019212d1b4..f7b7c75f920 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -7,6 +7,7 @@ PROGRAMS = \ testdir@EXEEXT@ \ testnames@EXEEXT@ \ testflock@EXEEXT@ \ + testfmt@EXEEXT@ \ testproc@EXEEXT@ \ testsock@EXEEXT@ \ testthread@EXEEXT@ \ @@ -58,6 +59,9 @@ testnames@EXEEXT@: testnames.lo $(LOCAL_LIBS) testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS) $(LINK) testflock.lo $(LOCAL_LIBS) $(ALL_LIBS) +testfmt@EXEEXT@: testfmt.lo $(LOCAL_LIBS) + $(LINK) testfmt.lo $(LOCAL_LIBS) $(ALL_LIBS) + ### why the export-dynamic? testdso@EXEEXT@: testdso.lo mod_test.so $(LOCAL_LIBS) $(LINK) -export-dynamic testdso.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/testfmt.c b/test/testfmt.c new file mode 100644 index 00000000000..c141f3394a8 --- /dev/null +++ b/test/testfmt.c @@ -0,0 +1,91 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include + +#include "apr.h" +#include "apr_portable.h" + +int main(int argc, char *argv[]) +{ + char buf[100]; + + { + apr_ssize_t var = 0; + sprintf(buf, "%" APR_SSIZE_T_FMT, var); + } + + { + apr_size_t var = 0; + sprintf(buf, "%" APR_SIZE_T_FMT, var); + } + + { + apr_off_t var = 0; + sprintf(buf, "%" APR_OFF_T_FMT, var); + } + + { + apr_os_proc_t var; + memset(&var, 0, sizeof var); + sprintf(buf, "%" APR_OS_PROC_T_FMT, var); + } + + { + apr_int64_t var = 0; + sprintf(buf, "%" APR_INT64_T_FMT, var); + } + + return 0; +} From 87dc980c3ed8afda1c4421fa488f8cd56016150f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 29 Nov 2001 02:45:59 +0000 Subject: [PATCH 2576/7878] fix some of the APR_foo_FMT_T values on AIX 5L git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62579 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 8d3d7fbbac0..be5840ebbcc 100644 --- a/configure.in +++ b/configure.in @@ -871,7 +871,7 @@ case $host in off_t_fmt='#define APR_OFF_T_FMT "ld"' os_proc_t_fmt='#define APR_OS_PROC_T_FMT "ld"' ;; - *aix4*) + *aix4*|*aix5*) ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' size_t_fmt='#define APR_SIZE_T_FMT "ld"' off_t_fmt='#define APR_OFF_T_FMT "ld"' From cdb798ec9c2b80a01fe52aafb5abc51a1eabff4b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 29 Nov 2001 06:45:35 +0000 Subject: [PATCH 2577/7878] Change getopt_t ->err flag to a real ->errfn that mirrors fprintf, introduce an ->errarg to pass the first void* (e.g. stderr by default), and change apr_getopt_init() to initialize those to fprintf(stderr, so the -default- behavior is unchanged. This is necessary to get away from unwise assumptions within library code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62580 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 9 +++++++-- misc/unix/getopt.c | 41 ++++++++++++++++------------------------- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 263635576e0..070bd72ed5f 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -71,6 +71,8 @@ extern "C" { * @{ */ +typedef void (apr_getopt_err_fn_t)(void *arg, const char *err, ...); + typedef struct apr_getopt_t apr_getopt_t; /** * Structure to store command line argument information. @@ -78,8 +80,10 @@ typedef struct apr_getopt_t apr_getopt_t; struct apr_getopt_t { /** context for processing */ apr_pool_t *cont; - /** if error message should be printed */ - int err; + /** function to print error message (NULL == no messages) */ + apr_getopt_err_fn_t *errfn; + /** user defined first arg to pass to error message */ + void *errarg; /** index into parent argv vector */ int ind; /** character checked for validity */ @@ -121,6 +125,7 @@ struct apr_getopt_option_t { * @param argc The number of arguments to parse * @param argv The array of arguments to parse * @remark Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) + * The errfn is initialized to fprintf(stderr... but may be overridden. */ APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, int argc, const char * const *argv); diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 4ed1d534985..922d152b836 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -33,21 +33,10 @@ #include "misc.h" #include "apr_strings.h" +#include "apr_lib.h" #define EMSG "" -/* Regardless of what we're invoked as, just print out the last part - * of the path */ -static const char *pretty_path (const char *name) -{ - const char *p; - - if (!(p = strrchr(name, '/'))) - return name; - else - return p + 1; -} - APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, int argc, const char *const *argv) { @@ -56,7 +45,9 @@ APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, *os = apr_palloc(cont, sizeof(apr_getopt_t)); (*os)->cont = cont; (*os)->reset = 0; - (*os)->err = 1; + (*os)->errfn = (apr_getopt_err_fn_t*)(fprintf); + (*os)->errarg = (void*)(stderr); + (*os)->place = EMSG; (*os)->argc = argc; @@ -108,10 +99,9 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, } if (!*os->place) ++os->ind; - if (os->err && *opts != ':') { - (void) fprintf(stderr, - "%s: illegal option -- %c\n", - pretty_path(*os->argv), os->opt); + if (os->errfn && *opts != ':') { + (os->errfn)(os->errarg, "%s: illegal option -- %c\n", + apr_filename_of_pathname(*os->argv), os->opt); } *optch = os->opt; return (APR_BADCH); @@ -130,10 +120,9 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, *optch = os->opt; return (APR_BADARG); } - if (os->err) { - (void) fprintf(stderr, - "%s: option requires an argument -- %c\n", - pretty_path(*os->argv), os->opt); + if (os->errfn) { + (os->errfn)(os->errarg, "%s: option requires an argument -- %c\n", + apr_filename_of_pathname(*os->argv), os->opt); } *optch = os->opt; return (APR_BADCH); @@ -191,8 +180,9 @@ static void permute(apr_getopt_t *os) static apr_status_t serr(apr_getopt_t *os, const char *err, const char *str, apr_status_t status) { - if (os->err) - fprintf(stderr, "%s: %s: %s\n", pretty_path(*os->argv), err, str); + if (os->errfn) + (os->errfn)(os->errarg, "%s: %s: %s\n", + apr_filename_of_pathname(*os->argv), err, str); return status; } @@ -200,8 +190,9 @@ static apr_status_t serr(apr_getopt_t *os, const char *err, const char *str, static apr_status_t cerr(apr_getopt_t *os, const char *err, int ch, apr_status_t status) { - if (os->err) - fprintf(stderr, "%s: %s: %c\n", pretty_path(*os->argv), err, ch); + if (os->errfn) + (os->errfn)(os->errarg, "%s: %s: %c\n", + apr_filename_of_pathname(*os->argv), err, ch); return status; } From 4789d64725a5d6f96f1874adee570b196ba9bf24 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 29 Nov 2001 16:25:10 +0000 Subject: [PATCH 2578/7878] re-implement an AIX-specific workaround for a sigwait() bug to work with 32-bit or 64-bit builds git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62581 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 5d7462d0f03..cb0fe05d52f 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -334,10 +334,25 @@ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)) * order bit of the second word of flags is turned on. sigdelset() * returns an error when trying to turn this off, so we'll turn it * off manually. + * + * Note that the private fields differ between 32-bit and 64-bit + * and even between _ALL_SOURCE and !_ALL_SOURCE. */ -#ifdef _AIX - sig_mask.hisigs &= 0x7FFFFFFF; +#if defined(_AIX) +#ifdef __64BIT__ +#ifdef _ALL_SOURCE + sig_mask.ss_set[3] &= 0x7FFFFFFF; +#else /* not _ALL_SOURCE */ + sig_mask.__ss_set[3] &= 0x7FFFFFFF; +#endif +#else /* not 64-bit build */ +#ifdef _ALL_SOURCE + sig_mask.hisigs &= 0x7FFFFFFF; +#else /* not _ALL_SOURCE */ + sig_mask.__hisigs &= 0x7FFFFFFF; +#endif #endif +#endif /* _AIX */ while (1) { #if APR_HAVE_SIGWAIT From c27f8d2b82efe5b64cffab14e48831e920b79d7f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 30 Nov 2001 04:04:48 +0000 Subject: [PATCH 2579/7878] Support a special pathname syntax for apr_dso_load()/dlopen() so that an APR app can open shared libraries that for whatever reason (e.g., libtool) have been stuffed in an archive. This special archive.a(dso.so) syntax is required for the way libtool likes to build shared libraries on AIX. dlopen() support for such a library requires that the RTLD_MEMBER flag be enabled. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62582 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index f9786454caf..a8a54be4823 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -139,7 +139,20 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, void *os_handle = dlopen((char *)path, RTLD_NOW | RTLD_GLOBAL); #else - void *os_handle = dlopen(path, RTLD_NOW | RTLD_GLOBAL); + int flags = RTLD_NOW | RTLD_GLOBAL; + void *os_handle; +#ifdef _AIX + if (strchr(path + 1, '(') && path[strlen(path) - 1] == ')') + { + /* This special archive.a(dso.so) syntax is required for + * the way libtool likes to build shared libraries on AIX. + * dlopen() support for such a library requires that the + * RTLD_MEMBER flag be enabled. + */ + flags |= RTLD_MEMBER; + } +#endif + os_handle = dlopen(path, flags); #endif #endif /* DSO_USE_x */ From 8a9305615f35077a23f3ae70d7a70ce919113556 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 30 Nov 2001 13:23:27 +0000 Subject: [PATCH 2580/7878] add some more commentary about a work-around for an AIX problem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62583 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index cb0fe05d52f..e656f0887e8 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -337,6 +337,11 @@ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)) * * Note that the private fields differ between 32-bit and 64-bit * and even between _ALL_SOURCE and !_ALL_SOURCE. + * + * Applicable AIX fixes such that this is no longer needed: + * + * APAR IY23096 for AIX 51B, fix included in AIX 51C, and + * APAR IY24162 for 43X. */ #if defined(_AIX) #ifdef __64BIT__ From d1a16f5221b79028169d77e614e43b4b7321a443 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 30 Nov 2001 19:03:57 +0000 Subject: [PATCH 2581/7878] Removed an unneeded header on NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62584 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getuuid.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index abd8ca7fcc5..a87d1b75c02 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -59,7 +59,10 @@ #include /* for getpid, gethostname */ #include /* for rand, srand */ + +#ifndef NETWARE #include /* for gettimeofday */ +#endif #include "apr.h" #include "apr_private.h" From b997e8c8f96a548934dcbe26dc2c1d04895c7eb3 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 30 Nov 2001 19:04:55 +0000 Subject: [PATCH 2582/7878] Switched to a NetWare version of APU.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62585 13f79535-47bb-0310-9956-ffa450edef68 --- build/prebuildNW.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/prebuildNW.bat b/build/prebuildNW.bat index 841a9f2597a..39297a35ade 100755 --- a/build/prebuildNW.bat +++ b/build/prebuildNW.bat @@ -12,7 +12,7 @@ copy ..\include\apr.hnw ..\include\apr.h @echo Fixing up the APR-Util headers -copy ..\..\apr-util\include\apu.h.in ..\..\apr-util\include\apu.h +copy ..\..\apr-util\include\apu.hnw ..\..\apr-util\include\apu.h copy ..\..\apr-util\include\private\apu_config.hw ..\..\apr-util\include\private\apu_config.h copy ..\..\apr-util\xml\expat\lib\expat.h.in ..\..\apr-util\xml\expat\lib\expat.h copy ..\..\apr-util\xml\expat\lib\config.hnw ..\..\apr-util\xml\expat\lib\config.h From 125dc29c6c5c2fc707035fa0a240bcd263459736 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 30 Nov 2001 21:22:38 +0000 Subject: [PATCH 2583/7878] Switched the #ifdef to APR_HAVE_SYS_TIME as it should be. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62586 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getuuid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index a87d1b75c02..03ac3656780 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -60,7 +60,7 @@ #include /* for getpid, gethostname */ #include /* for rand, srand */ -#ifndef NETWARE +#ifdef APR_HAVE_SYS_TIME #include /* for gettimeofday */ #endif From fcbd021b51656144a4687a2fe45a519bcbdb8eee Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 30 Nov 2001 22:26:54 +0000 Subject: [PATCH 2584/7878] moved APR_HAVE_SYS_TIME_H after include of apr.h so sys/time.h is included git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62587 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getuuid.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index 03ac3656780..60898ec194b 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -60,10 +60,6 @@ #include /* for getpid, gethostname */ #include /* for rand, srand */ -#ifdef APR_HAVE_SYS_TIME -#include /* for gettimeofday */ -#endif - #include "apr.h" #include "apr_private.h" #include "apr_uuid.h" @@ -78,6 +74,9 @@ #if APR_HAVE_NETDB_H #include #endif +#if APR_HAVE_SYS_TIME_H +#include /* for gettimeofday */ +#endif #define NODE_LENGTH 6 From 284b3b83f3c9df0ac3a4303b468785af21c7c1d9 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 30 Nov 2001 22:27:48 +0000 Subject: [PATCH 2585/7878] Added stubs for missing APIs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62588 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/thread.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index c8d16529cd6..6688a2c45ce 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -233,15 +233,13 @@ apr_status_t apr_thread_data_set(void *data, const char *key, } } - -/*SRJ Need to resolve - APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, +APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { if (thd == NULL) { return APR_ENOTHREAD; } - *thethd = thd->td; + *thethd = &(thd->td); return APR_SUCCESS; } @@ -256,8 +254,22 @@ APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, (*thd) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); (*thd)->cntxt = cont; } - (*thd)->td = thethd; + (*thd)->td = *thethd; return APR_SUCCESS; } -*/ \ No newline at end of file +APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, + apr_pool_t *p) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, + void (*func)(void)) +{ + return APR_ENOTIMPL; +} + +APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) + + From 90b7e8c1a6ed09f79d412a5594e14b8da1c0a05f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 30 Nov 2001 22:29:08 +0000 Subject: [PATCH 2586/7878] Sync'ed the NetWare export AWK script to the Unix scripts and did some cleanup git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62589 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_nw_export.awk | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index 2653ef03890..a8d35a6c9cd 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -14,8 +14,6 @@ /apr_mmap_delete/{next} /apr_mmap_dup/{next} /apr_mmap_offset/{next} -/apr_os_thread_get/{next} -/apr_os_thread_put/{next} /apr_pool_free_blocks_num_bytes/{next} /apr_pool_join/{next} /apr_pool_num_bytes/{next} @@ -43,8 +41,6 @@ /apr_signal/{next} /apr_signal_thread/{next} /apr_socket_from_file/{next} -/apr_thread_once/{next} -/apr_thread_once_init/{next} /apr_xlate_close/{next} /apr_xlate_conv_buffer/{next} /apr_xlate_conv_byte/{next} @@ -58,6 +54,7 @@ /apr_md4_set_xlate/{next} /apr_os_proc_mutex_get/{next} /apr_os_proc_mutex_put/{next} +/proc_mutex/{next} function add_symbol (sym_name) { @@ -96,6 +93,13 @@ function add_symbol (sym_name) { next } +/^[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(][^)]*[)]/ { + sub("[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(]", "", $0) + sub("[)].*$", "", $0) + add_symbol("apr_" $0 "_pool_get") + next +} + /^[ \t]*AP[RU]?_DECLARE_DATA .*;$/ { varname = $NF; gsub( /[*;]/, "", varname); From 38eb890109f1e38222a81a3eb3e204178df6a3d0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 1 Dec 2001 01:23:45 +0000 Subject: [PATCH 2587/7878] ignore a generated file (testfmt) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62590 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.cvsignore b/test/.cvsignore index 4b3264feaa2..17f11c85aaf 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -10,6 +10,7 @@ testud testargs testdir testdso +testfmt testhash testoc testpipe From 4c8550d3e07aebe94dabfbd5d8a0985588637211 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 1 Dec 2001 01:24:28 +0000 Subject: [PATCH 2588/7878] clarify a difference between the string built by ctime() and the string built by apr_ctime() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62591 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_time.h b/include/apr_time.h index 99b9d1db430..b9da57c6e08 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -210,6 +210,8 @@ APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t); * apr_ctime formats dates in the ctime() format * in an efficient manner. it is a fixed length format * and requires the indicated amount of storage + * Unlike ANSI/ISO C ctime(), apr_ctime() does not include + * a \n at the end of the string. * including trailing \0 * @param date_str String to write to. * @param t the time to convert From 7afb8cb8d7e8767648a4d22a427a9bf226bf7bc2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 1 Dec 2001 12:38:31 +0000 Subject: [PATCH 2589/7878] tweak apr.exp so that it can be used as an import file too git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62592 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index e82af931e0a..50e31b5dc1c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -93,7 +93,7 @@ export_vars.h: $(AWK) -f $(top_srcdir)/build/make_var_export.awk $(EXPORT_FILES) > $@ apr.exp: exports.c export_vars.h - @echo "#! ." > $@ + @echo "#! libapr.a(libapr.so.0)" > $@ @echo "* This file was AUTOGENERATED at build time." >> $@ @echo "* Please do not edit by hand." >> $@ $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@ From 436a55d06998258b2c81a4ad83ea1bbef63fa768 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 2 Dec 2001 01:07:02 +0000 Subject: [PATCH 2590/7878] fix a bogus cast so that testmem can compile with xlc (AIX) now that we have xlc running in a more anal mode than before (we removed -qlanglvl=extended recently) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62593 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testmem.c b/test/testmem.c index a2af1dae5aa..e2833952e34 100644 --- a/test/testmem.c +++ b/test/testmem.c @@ -87,10 +87,10 @@ static _test_ t[T_QTY]; static void its_a_pool(apr_pool_t *pool, _test_ *t, char *name, int lt) { - t->malloc_fn = (void*)apr_palloc; - t->calloc_fn = (void*)apr_pcalloc; + t->malloc_fn = (void *(*)(void *, apr_size_t))apr_palloc; + t->calloc_fn = (void *(*)(void *, apr_size_t))apr_pcalloc; t->free_fn = NULL; - t->reset_fn = (void*)apr_pool_clear; + t->reset_fn = (void *(*)(void *))apr_pool_clear; t->memory = pool; t->title = name; t->large_tests = lt; From f828eeac906cacdcb3734494ecd9c6aaecad7547 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 2 Dec 2001 09:20:23 +0000 Subject: [PATCH 2591/7878] This patch adds a function apr_strmemdup(), which works like apr_pstrndup() except that it's optimized for the case where the caller can guarantee that the length of the supplied string is >= 'n' Submitted by: Brian Pane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62594 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 14 ++++++++++++++ strings/apr_strings.c | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/include/apr_strings.h b/include/apr_strings.h index e409896a293..9c814eb0206 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -127,6 +127,20 @@ APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b); */ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); +/** + * Create a null-terminated string by making a copy of a sequence + * of characters and appending a null byte + * @param p The pool to allocate out of + * @param s The block of characters to duplicate + * @param n The number of characters to duplicate + * @return The new string + * @remark This is a faster alternative to apr_pstrndup, for use + * when you know that the string being duplicated really + * has 'n' or more characters. If the string might contain + * fewer characters, use apr_pstrndup. + */ +APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n); + /** * duplicate the first n characters of a string into memory allocated * out of a pool; the new string will be '\0'-terminated diff --git a/strings/apr_strings.c b/strings/apr_strings.c index b529c64ff94..2038d48bdb7 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -99,6 +99,19 @@ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *a, const char *s, apr_size_t n) return res; } +APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *a, const char *s, apr_size_t n) +{ + char *res; + + if (s == NULL) { + return NULL; + } + res = apr_palloc(a, n + 1); + memcpy(res, s, n); + res[n] = '\0'; + return res; +} + APR_DECLARE(void *) apr_pmemdup(apr_pool_t *a, const void *m, apr_size_t n) { void *res; From 2f5fef3386535cc13f620b588d6afae87dc164d5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 2 Dec 2001 14:02:16 +0000 Subject: [PATCH 2592/7878] while on some platforms you can get away with the bug of calling pthread_cond_timedwait() (and thus apr_thread_cond_timedwait()) without holding the mutex, you can't on AIX; the system recognizes the error and returns EINVAL so fix the testlock program to grab the mutex git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62595 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/testlock.c b/test/testlock.c index 6d964f26616..5b13eb5c27f 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -597,12 +597,14 @@ apr_status_t test_timeoutcond(void) timeout = 5 * APR_USEC_PER_SEC; for (i = 0; i < MAX_RETRY; i++) { + apr_thread_mutex_lock(timeout_mutex); printf("%-60s"," Waiting for condition for 5 seconds"); begin = apr_time_now(); s = apr_thread_cond_timedwait(timeout_cond, timeout_mutex, timeout); end = apr_time_now(); - + apr_thread_mutex_unlock(timeout_mutex); + /* If we slept for more than 100ms over the timeout. */ if (end - begin - timeout > 100000) { if (APR_STATUS_IS_TIMEUP(s)) { From 87e9999344bfbb67f99923cbe9eb17e6d41455fa Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Mon, 3 Dec 2001 18:00:04 +0000 Subject: [PATCH 2593/7878] get binbuild working when apr, apr-util, and expat are built shared in directories that are not well known to the loader. How it works: * libtool figures out the name of this system's library path environment variable (i.e. LD_LIBRARY_PATH, LIBPATH, DYLD_LIBRARY_PATH) at apr configure time (existing code) * save this variable name in SHLIBPATH_VAR in APRVARS * substitute this name when apachectl is created * uncomment the lines containing this variable during binbuild * install_bindist.sh updates the path to lib/ when the binary is installed (existing code) not done yet, but a good idea: * create a file or directory containing all environment variable settings for apachectl. Others env vars need to be tweaked, at least on AIX and OS/390, so keeping them separate should reduce headaches long term. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62596 13f79535-47bb-0310-9956-ffa450edef68 --- APRVARS.in | 1 + configure.in | 1 + 2 files changed, 2 insertions(+) diff --git a/APRVARS.in b/APRVARS.in index b91cda6552a..28cb3092c56 100644 --- a/APRVARS.in +++ b/APRVARS.in @@ -7,6 +7,7 @@ EXTRA_LDFLAGS="@EXTRA_LDFLAGS@" EXTRA_LIBS="@EXTRA_LIBS@" EXTRA_INCLUDES="@EXTRA_INCLUDES@" LIBTOOL_LIBS="@LIBTOOL_LIBS@" +SHLIBPATH_VAR="@shlibpath_var@" APR_SOURCE_DIR="@abs_srcdir@" APR_SO_EXT="@so_ext@" APR_LIB_TARGET="@export_lib_target@" diff --git a/configure.in b/configure.in index be5840ebbcc..f289970380f 100644 --- a/configure.in +++ b/configure.in @@ -1364,6 +1364,7 @@ AC_SUBST(OSDIR) AC_SUBST(DEFAULT_OSDIR) AC_SUBST(EXEEXT) AC_SUBST(LIBTOOL_LIBS) +AC_SUBST(shlibpath_var) echo "${nl}Construct Makefiles and header files." MAKEFILE1="Makefile strings/Makefile passwd/Makefile tables/Makefile build/Makefile" From 4e95a2ac7267ffac03b4f9597b75dbbc9125674c Mon Sep 17 00:00:00 2001 From: "Victor J. Orlikowski" Date: Mon, 3 Dec 2001 19:26:35 +0000 Subject: [PATCH 2594/7878] Add a proper check for xlc on AIX. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62597 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index cb5e5e3d0a0..a87dc34c64f 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -57,9 +57,9 @@ if test "x$apr_preload_done" != "xyes" ; then APR_ADDTO(CPPFLAGS, [-D_USE_IRS]) ;; esac - dnl Must do a check for gcc or egcs here, to get the right options - dnl to the compiler. - if test "$GCC" != "yes"; then + dnl If using xlc, remember it, and give it the right options. + if $CC 2>&1 | grep 'xlc' > /dev/null; then + APR_SETIFNULL(AIX_XLC, [yes]) APR_ADDTO(CFLAGS, [-qHALT=E]) fi APR_SETIFNULL(apr_iconv_inbuf_const, [1]) From 7af6dbd0c813e48a19418a2633e83a6062434dab Mon Sep 17 00:00:00 2001 From: "Victor J. Orlikowski" Date: Mon, 3 Dec 2001 19:28:40 +0000 Subject: [PATCH 2595/7878] AIX wants this set when using xlc, paths to source files are known. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62598 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.in b/configure.in index f289970380f..31ca06b83b9 100644 --- a/configure.in +++ b/configure.in @@ -145,6 +145,8 @@ AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile tim [APR_ADDTO(CFLAGS,-g) if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,-Wall) + elif test "$AIX_XLC" = "yes"; then + APR_ADDTO(CFLAGS,-qfullpath) fi ])dnl @@ -153,6 +155,8 @@ AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and APR_ADDTO(CFLAGS,-g) if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations]) + elif test "$AIX_XLC" = "yes"; then + APR_ADDTO(CFLAGS,-qfullpath) fi ])dnl From 5360d3d03b8f56e48388ac8a062737a117d804b7 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 4 Dec 2001 00:15:52 +0000 Subject: [PATCH 2596/7878] I am leaning towards Sander's code because it makes the pool code clean. However, I'm going to be majorly backed up this week by finals, so let's start a running commentary in STATUS so that when I have time next week, I can keep everything straight without having to dig through the archives. If you've reviewed the code and tested it, place your votes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62599 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 0cd7fb12df1..4f3a4ea84e2 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/11/14 08:36:16 $] +Last modified at [$Date: 2001/12/04 00:15:52 $] Release: @@ -44,6 +44,18 @@ RELEASE SHOWSTOPPERS: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * Enable pools to have thread-specific locking in it. + Status: There are two alternatives. More investigation/analysis + needs to be done to see if they can be merged + together. + Sander's submission: + + Brian's submission: + <3C064F49.8000908@pacbell.net> + Comparisons: + Ian: <3C083414.1080208@cnet.com> (performance) + Brian: <3C07D792.9070301@cnet.com> (code) + * Get OTHER_CHILD support into Win32 Status: Bill S. is looking into this From 3589eb04ae80968619b75d130a09d53873ec6fcf Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 4 Dec 2001 02:26:13 +0000 Subject: [PATCH 2597/7878] tweak the comment describing APR_FILES_AS_SOCKETS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62600 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 5baceee78ea..fe5dac3b69b 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -148,13 +148,10 @@ #define APR_HAS_LARGE_FILES 0 #define APR_HAS_XTHREAD_FILES 0 -/* This macro tells APR that it is safe to make a file masquerade as a - * socket. This is necessary, because some platforms support poll'ing - * on pipes/files, while some don't. APR only supports poll'ing on - * sockets to handle this inconsistensy. However, it is often useful to - * be able to poll on files/pipes on platforms that support it. This - * feature macro allows us to find those platforms and support the feature - * where available. +/* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible + * to poll on files/pipes. On such a system, the application can + * call apr_socket_from_file() to get an APR socket representation and + * then pass the socket representation to apr_poll_socket_add(). */ #define APR_FILES_AS_SOCKETS @file_as_socket@ From 2ead44a8fc2cff2538bc1c370fa31c566117aab1 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 4 Dec 2001 20:37:38 +0000 Subject: [PATCH 2598/7878] older versions of libtool don't generate the libtool script inline, so shlibpath_var isn't a local variable to apr's configure. But this variable is set in the libtool script itself, so get it from there. OS/2, BeOS, and any platforms which don't use libtool may need to tweak this if binbuild.sh needs to work and apr[-util] is built shared. For OS/390, Jeff added a line to his libtool script that says "shlibpath_var=LIBPATH" which will do the job. also, move the AC_SUBST for shlibpath_var closer to where it is set git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62601 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 31ca06b83b9..3108d9e48d6 100644 --- a/configure.in +++ b/configure.in @@ -108,6 +108,8 @@ AC_PROG_LIBTOOL if test "x$LTFLAGS" = "x"; then LTFLAGS='--silent' fi + dnl get libtool's setting of shlibpath_var + eval `grep "^shlibpath_var=[[A-Z_]]\+$" $srcdir/libtool` ;; esac @@ -133,6 +135,7 @@ AC_SUBST(link) AC_SUBST(so_ext) AC_SUBST(lib_target) AC_SUBST(export_lib_target) +AC_SUBST(shlibpath_var) AC_SUBST(LTFLAGS) AC_SUBST(LT_LDFLAGS) @@ -1368,7 +1371,6 @@ AC_SUBST(OSDIR) AC_SUBST(DEFAULT_OSDIR) AC_SUBST(EXEEXT) AC_SUBST(LIBTOOL_LIBS) -AC_SUBST(shlibpath_var) echo "${nl}Construct Makefiles and header files." MAKEFILE1="Makefile strings/Makefile passwd/Makefile tables/Makefile build/Makefile" From 6ac0757c5f516498313b156eae7d92b782417b73 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 5 Dec 2001 01:21:43 +0000 Subject: [PATCH 2599/7878] install apr.exp, for use on AIX when linking shared libraries (e.g., Apache DSO modules) that use APR git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62602 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.in b/Makefile.in index 50e31b5dc1c..de5f7ad8755 100644 --- a/Makefile.in +++ b/Makefile.in @@ -66,6 +66,7 @@ install: $(TARGET_LIB) fi; \ $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(libdir) $(LIBTOOL) --mode=install cp APRVARS $(libdir) + $(LIBTOOL) --mode=install cp apr.exp $(libdir) @if [ $(INSTALL_SUBDIRS) != "none" ]; then \ for i in $(INSTALL_SUBDIRS); do \ ( cd $$i ; $(MAKE) install ); \ From 2ecd3d6ab8dbb714c6404a57decaa3718dd2d9b9 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 5 Dec 2001 02:46:59 +0000 Subject: [PATCH 2600/7878] I've thrown my two cents in. I'll probably be +1 when I can test it and my issues are resolved. I won't be able to test it until next week at the earliest (finals!). If it gets the requisite 3 +1s before then, yea. I'm of the mind where I'd count Brian's vote since he has done performance analysis and tests on the code in question. It may not be binding, but it provides evidence that the code "works" - that is helpful to others and should be noted. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62603 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 4f3a4ea84e2..7535c422d1a 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/04 00:15:52 $] +Last modified at [$Date: 2001/12/05 02:46:59 $] Release: @@ -52,9 +52,16 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Brian's submission: <3C064F49.8000908@pacbell.net> - Comparisons: + Comparisons/reviews: Ian: <3C083414.1080208@cnet.com> (performance) Brian: <3C07D792.9070301@cnet.com> (code) + <3C0D6BB5.6010505@cnet.com> (performance) + Justin: <20011205025611.GB22835@ebuilt.com> (code) + Votes: + Sander's patch: + +1: Brian (non-binding) + 0: + -1: * Get OTHER_CHILD support into Win32 Status: Bill S. is looking into this From 5545faf547a12b7c2314036d6d34425b1b8c6b46 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Wed, 5 Dec 2001 16:54:23 +0000 Subject: [PATCH 2601/7878] +1 for sander's stuff, once the debug version of apr_palloc gets put back in git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62604 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 7535c422d1a..507974ef630 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/05 02:46:59 $] +Last modified at [$Date: 2001/12/05 16:54:23 $] Release: @@ -59,7 +59,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Justin: <20011205025611.GB22835@ebuilt.com> (code) Votes: Sander's patch: - +1: Brian (non-binding) + +1: Brian (non-binding), + Ian (once we have a debug version of palloc etc) 0: -1: From 5977336451688e28b9e85bc18f90d79f7557511e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 5 Dec 2001 20:39:59 +0000 Subject: [PATCH 2602/7878] show how we invoke libtool to create libapr.la git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62605 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index de5f7ad8755..37c03f8cc8d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -75,7 +75,9 @@ install: $(TARGET_LIB) $(TARGET_LIB): @for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \ - $(LINK) @lib_target@ + tmpcmd="$(LINK) @lib_target@"; \ + echo $$tmpcmd; \ + $$tmpcmd delete-exports: @if test -f apr.exp; then \ From ad09112f8727b4bb2ebc3a8729fa163e82259825 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 6 Dec 2001 03:00:16 +0000 Subject: [PATCH 2603/7878] simplify... get rid of warning for missing memset() decl... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62606 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfmt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/testfmt.c b/test/testfmt.c index c141f3394a8..72be708e059 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -77,8 +77,7 @@ int main(int argc, char *argv[]) } { - apr_os_proc_t var; - memset(&var, 0, sizeof var); + apr_os_proc_t var = 0; sprintf(buf, "%" APR_OS_PROC_T_FMT, var); } From 71cfb920ea3f35080c0fe4c32f04446f5637de17 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 6 Dec 2001 13:43:45 +0000 Subject: [PATCH 2604/7878] Fix a problem in Unix apr_file_dup() which caused 0 to be returned by the first read. Submitted by: Stas Bekman Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62607 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/unix/filedup.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index cd7a7352dc6..811a8a0cc7c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix a problem in Unix apr_file_dup() which caused 0 to be returned + by the first read. [Stas Bekman ] + *) Fix a buglet that caused APR_FILE_BASED_SHM to be set inadvertently on some platforms (e.g., Linux, AIX). [Jeff Trawick] diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 71a9bb16271..72243ba4878 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -89,6 +89,8 @@ apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_ } /* this is the way dup() works */ (*new_file)->blocking = old_file->blocking; + /* make sure unget behavior is consistent */ + (*new_file)->ungetchar = old_file->ungetchar; /* apr_file_dup() clears the inherit attribute, user must call * apr_file_set_inherit() again on the dupped handle, as necessary. */ From a52bc4769f13c6981b35f70ea587ef1cf6a1ce07 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 7 Dec 2001 15:48:06 +0000 Subject: [PATCH 2605/7878] don't try to use getaddrinfo() on systems without gai_strerror() this fixes a build error on RedHat 5.2 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62608 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ build/apr_network.m4 | 10 +++++++++- configure.in | 2 ++ misc/unix/errorcodes.c | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 811a8a0cc7c..e0edcd0056d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix build breakage on systems with getaddrinfo() but not + gai_strerror() (e.g., RedHat 5.2). [Jeff Trawick] + *) Fix a problem in Unix apr_file_dup() which caused 0 to be returned by the first read. [Stas Bekman ] diff --git a/build/apr_network.m4 b/build/apr_network.m4 index ecaa405a5c4..4645abd4f2b 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -5,6 +5,10 @@ dnl dnl dnl check for working getaddrinfo() dnl +dnl Note that if the system doesn't have gai_strerror(), we +dnl can't use getaddrinfo() because we can't get strings +dnl describing the error codes. +dnl AC_DEFUN(APR_CHECK_WORKING_GETADDRINFO,[ AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[ AC_TRY_RUN( [ @@ -44,7 +48,11 @@ void main(void) { ac_cv_working_getaddrinfo="yes" ])]) if test "$ac_cv_working_getaddrinfo" = "yes"; then - AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works well enough for APR]) + if test "$ac_cv_func_gai_strerror" != "yes"; then + ac_cv_working_getaddrinfo="no" + else + AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works well enough for APR]) + fi fi ]) diff --git a/configure.in b/configure.in index 3108d9e48d6..49fa19534af 100644 --- a/configure.in +++ b/configure.in @@ -1319,7 +1319,9 @@ AC_ARG_ENABLE(ipv6, [ user_disabled_ipv6=0 ] ) AC_SEARCH_LIBS(getaddrinfo, inet6) +AC_SEARCH_LIBS(gai_strerror, inet6) AC_SEARCH_LIBS(getnameinfo, inet6) +AC_CHECK_FUNCS(gai_strerror) APR_CHECK_WORKING_GETADDRINFO APR_CHECK_NEGATIVE_EAI APR_CHECK_WORKING_GETNAMEINFO diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 8df92f5533c..bf6b2614871 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -410,7 +410,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, return stuffbuffer(buf, bufsize, "APR does not understand this error code"); } else if (statcode < APR_OS_START_SYSERR) { -#if defined(HAVE_GETADDRINFO) +#if defined(HAVE_GAI_STRERROR) statcode -= APR_OS_START_EAIERR; #if defined(NEGATIVE_EAI) statcode = -statcode; From 7e365ab32481bf89f17c8c7f972962ec94774192 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 7 Dec 2001 23:14:18 +0000 Subject: [PATCH 2606/7878] APR DOES NOT simply support TCP STREAM sockets. We need to look at if IPPROTO_TCP is absolutely required, and if the correct proto will be inferred for things such as SOCK_DGRAM for udp. In any case, the existing code was certainly very ugly and not nice. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62609 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index d764e341807..d6635abdec2 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -121,6 +121,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, int type, apr_pool_t *cont) { int family = ofamily; + int downgrade = (family == AF_UNSPEC); if (family == AF_UNSPEC) { #if APR_HAVE_IPV6 @@ -145,19 +146,19 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, /* For right now, we are not using socket groups. We may later. * No flags to use when creating a socket, so use 0 for that parameter as well. */ - (*new)->sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + (*new)->sock = socket(family, type, /* IPPROTO_TCP */ 0); #endif #if APR_HAVE_IPV6 - if ((*new)->sock == INVALID_SOCKET && ofamily == AF_UNSPEC) { + if ((*new)->sock == INVALID_SOCKET && downgrade) { family = AF_INET; - (*new)->sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + (*new)->sock = socket(family, type, /* IPPROTO_TCP */ 0); } #endif if ((*new)->sock == INVALID_SOCKET) { return apr_get_netos_error(); } - set_socket_vars(*new, AF_INET, type); + set_socket_vars(*new, family, type); (*new)->timeout = -1; (*new)->disconnected = 0; From 8772fabe8cfd75931f15fa376f31ed3adfcb9f8d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 7 Dec 2001 23:29:07 +0000 Subject: [PATCH 2607/7878] Fix a bug in OS2 related to AF_UNSPEC, and drop a NETWARE section that duplicates the correct code. If we need to do something with proto, then _that_ can be hidden in an ifdef WIN32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62610 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 8 ++++---- network_io/win32/sockets.c | 11 +++-------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 895b778affd..1241e678f30 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -130,10 +130,10 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr->pool = p; } -APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, int type, +APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int type, apr_pool_t *cont) { - int family = ofamily; + int downgrade = (family == AF_UNSPEC); if (family == AF_UNSPEC) { #if APR_HAVE_IPV6 @@ -152,9 +152,9 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, int return APR_ENOMEM; } - (*new)->socketdes = socket(AF_INET, type, 0); + (*new)->socketdes = socket(family, type, 0); #if APR_HAVE_IPV6 - if ((*new)->socketdes < 0 && ofamily == AF_UNSPEC) { + if ((*new)->socketdes < 0 && downgrade) { family = AF_INET; (*new)->socketdes = socket(family, type, 0); } diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index d6635abdec2..fb233ad87b1 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -117,10 +117,9 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr->pool = p; } -APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, +APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int type, apr_pool_t *cont) { - int family = ofamily; int downgrade = (family == AF_UNSPEC); if (family == AF_UNSPEC) { @@ -140,18 +139,14 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily, return APR_ENOMEM; } -#ifdef NETWARE - (*new)->sock = socket(family, type, 0); -#else /* For right now, we are not using socket groups. We may later. * No flags to use when creating a socket, so use 0 for that parameter as well. */ - (*new)->sock = socket(family, type, /* IPPROTO_TCP */ 0); -#endif + (*new)->sock = socket(family, type, 0); #if APR_HAVE_IPV6 if ((*new)->sock == INVALID_SOCKET && downgrade) { family = AF_INET; - (*new)->sock = socket(family, type, /* IPPROTO_TCP */ 0); + (*new)->sock = socket(family, type, 0); } #endif From 079efa202d1d90ee4a18be1f945e5b4890a2987c Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sat, 8 Dec 2001 05:01:59 +0000 Subject: [PATCH 2608/7878] optimize the apr_array_copy call by remvoing the zero fill Thanks Brian! Obtained from: Brian Pane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62611 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ tables/apr_tables.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index e0edcd0056d..9ea978cbccd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) apr_array_copy speedup by removing the zero-fill [Brian Pane] + *) Fix build breakage on systems with getaddrinfo() but not gai_strerror() (e.g., RedHat 5.2). [Jeff Trawick] diff --git a/tables/apr_tables.c b/tables/apr_tables.c index cbf5a0eeb4f..7827b9964b7 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -167,10 +167,14 @@ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, APR_DECLARE(apr_array_header_t *) apr_array_copy(apr_pool_t *p, const apr_array_header_t *arr) { - apr_array_header_t *res = apr_array_make(p, arr->nalloc, arr->elt_size); + apr_array_header_t *res = + (apr_array_header_t *) apr_palloc(p, sizeof(apr_array_header_t)); + make_array_core(res, p, arr->nalloc, arr->elt_size, 0); memcpy(res->elts, arr->elts, arr->elt_size * arr->nelts); res->nelts = arr->nelts; + memset(res->elts + res->elt_size * res->nelts, 0, + res->elt_size * (res->nalloc - res->nelts)); return res; } From 8a3427053b940f4f8b6f78fe8676035a04d4dc9b Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sun, 9 Dec 2001 00:52:19 +0000 Subject: [PATCH 2609/7878] fix segv in apr_table_overlap This patch fixes a bug in apr_table_overlap: when using the APR_OVERLAP_TABLES_SET option, the red-black tree's shape properties were sometimes broken, which could cause a segfault if it happened at the root node of the tree. Obtained from: Brian Pane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62612 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ tables/apr_tables.c | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 9ea978cbccd..2300ce104fc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) SEGV in apr_table_overlap [Brian Pane] + *) apr_array_copy speedup by removing the zero-fill [Brian Pane] *) Fix build breakage on systems with getaddrinfo() but not diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 7827b9964b7..c8095a72372 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -844,6 +844,7 @@ static void overlap_hash(overlap_key *elt, next->tree_right->tree_parent = elt; } elt->tree_parent = next->tree_parent; + elt->color = next->color; (*child) = elt; elt->merge_next = NULL; elt->merge_last = NULL; From e546176b036fafbc24102b82fa11e964476bc5a8 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 9 Dec 2001 20:54:42 +0000 Subject: [PATCH 2610/7878] And, you thought there wasn't going to be anything happening with this item (FreeBSD and threading support)? Ha! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62613 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 507974ef630..87581f21454 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/05 16:54:23 $] +Last modified at [$Date: 2001/12/09 20:54:42 $] Release: @@ -243,6 +243,21 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: FreeBSD. MsgID: <20010828091959.D17570@ebuilt.com> + Status: Justin has tracked down a FreeBSD kernel hacker + (alfred@freebsd.org) and we've isolated some issues + within src/lib/libc_r/uthread/uthread_sendfile.c. There + are some problems in FreeBSD between libc_r and the + kernel implementation of sendfile. We've made some + progress (we now send the headers correctly, but we seem + to send the file twice now!). At this point, we are unsure + if we are seeing an APR bug or a FreeBSD bug. Alfred has + requested some time to look at the sendfile(2) code with + APR's test suite. Justin has gained enough knowledge in + his conversations that he may be able to continue this + work if no feedback comes. + + We have a preliminary patch at: + http://people.freebsd.org/~alfred/uthread_sf.diff * Currently it is difficult if not impossible to return a proper status code from a thread using apr_thread_exit(), since the From 03ca306e859a39705c77be37b2adf93471e625ae Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 10 Dec 2001 22:04:41 +0000 Subject: [PATCH 2611/7878] We have a PR now in FreeBSD land. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62614 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 87581f21454..e059e8494fb 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/09 20:54:42 $] +Last modified at [$Date: 2001/12/10 22:04:41 $] Release: @@ -258,6 +258,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: We have a preliminary patch at: http://people.freebsd.org/~alfred/uthread_sf.diff + FreeBSD PR kern/32684: + http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/32684 * Currently it is difficult if not impossible to return a proper status code from a thread using apr_thread_exit(), since the From 6098186ee600ed427998c089e2c9484fb56548a6 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 10 Dec 2001 23:01:46 +0000 Subject: [PATCH 2612/7878] There is zero correlation between my placing this in STATUS and my volunteering to do this. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62615 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index e059e8494fb..42b59e2da1f 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/10 22:04:41 $] +Last modified at [$Date: 2001/12/10 23:01:46 $] Release: @@ -290,6 +290,7 @@ Documentation that needs writing: * API documentation Ian Says: APR Stuff in now in Doxygen format, which is the first step. + * apr-site needs to be revamped with Anakia/XHTML. Stuff waiting for code thawing after Beta 1: From 01376a8327cb79f927683dce56abf6878b1a88ea Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 10 Dec 2001 23:53:47 +0000 Subject: [PATCH 2613/7878] Checkpointing a script that apps can use to find an installed or bundled copy of APR. If an app uses this from their ./configure, then they will have a consistent mechanism for locating APR. Note: this is incomplete work. Checkpointing into CVS. Justin is going to help out. Note #2: apr-util will also want a very similar script. TBD. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62616 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 124 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 build/find_apr.m4 diff --git a/build/find_apr.m4 b/build/find_apr.m4 new file mode 100644 index 00000000000..f19b38d4fc5 --- /dev/null +++ b/build/find_apr.m4 @@ -0,0 +1,124 @@ +dnl +dnl find_apr.m4 : locate the APR include files and libraries +dnl +dnl This macro file can be used by applications to find and use the APR +dnl library. It provides a standardized mechanism for using APR. It supports +dnl embedding APR into the application source, or locating an installed +dnl copy of APR. +dnl +dnl APR_FIND_APR([srcdir]) +dnl +dnl where srcdir is the location of the bundled APR source directory, or +dnl empty if source is not bundled. +dnl +dnl +dnl Sets the following variables on exit: +dnl +dnl apr_libdir : A custom directory to use for linking (the -L switch). +dnl If APR exists in a standard location, this variable +dnl will be empty +dnl +dnl apr_la_file : If a libtool .la file exists, this will refer to it. If +dnl there is no .la file, then this variable will be empty. +dnl +dnl apr_includes : Where the APR includes are located, if a non-standard +dnl location. This variable has the format "-Idir -Idir". +dnl It may specify more than one directory. +dnl +dnl apr_srcdir : If an APR source tree is available and needs to be +dnl (re)configured, this refers to it. +dnl +dnl apr_config : If the APR config file (APRVARS) exists, this refers to it. +dnl +dnl apr_found : "yes", "no", "reconfig" +dnl +dnl Note: At this time, we cannot find *both* a source dir and a build dir. +dnl If both are available, the build directory should be passed to +dnl the --with-apr switch (apr_srcdir will be empty). +dnl +dnl Note: the installation layout is presumed to follow the standard +dnl PREFIX/lib and PREFIX/include pattern. If the APR config file +dnl is available (and can be found), then non-standard layouts are +dnl possible, since it will be described in the config file. +dnl +dnl If apr_found is "yes" or "reconfig", then the caller should link using +dnl apr_la_file, if available; otherwise, -lapr should be used (and if +dnl apr_libdir is not null, then -L$apr_libdir). If apr_includes is not null, +dnl then it should be used during compilation. +dnl +dnl If a source directory is available and needs to be (re)configured, then +dnl apr_srcdir specifies the directory and apr_found is "reconfig". +dnl + +AC_DEFUN(APR_FIND_APR, [ + apr_found="no" + + preserve_LIBS="$LIBS" + preserve_LDFLAGS="$LDFLAGS" + + AC_MSG_CHECKING(for APR) + AC_ARG_WITH(apr, + [ --with-apr=DIR prefix for installed APR, or path to APR build tree], + [ + if test "$withval" = "no" || test "$withval" = "yes"; then + AC_MSG_ERROR([--with-apr requires a directory to be provided]) + fi + + LIBS="$LIBS -lapr" + LDFLAGS="$preserve_LDFLAGS -L$withval/lib" + AC_TRY_LINK_FUNC(apr_initialize, [ + if test -f "$withval/include/apr.h"; then + dnl found an installed version of APR + apr_found="yes" + apr_libdir="$withval/lib" + apr_includes="-I$withval/include" + fi + ], [ + dnl look for a build tree (note: already configured/built) + if test -f "$withval/libapr.la"; then + apr_found="yes" + apr_libdir="" + apr_la_file="$withval/libapr.la" + apr_config="$withval/APRVARS" + apr_includes="-I$withval/include" + if test ! -f "$withval/APRVARS.in"; then + dnl extract the APR source directory without polluting our + dnl shell variable space + apr_srcdir="`sed -n '/APR_SOURCE_DIR/s/.*"\(.*\)"/\1/p' $apr_config`" + apr_includes="$apr_includes -I$apr_srcdir/include" + fi + fi + ]) + + dnl if --with-apr is used, then the target prefix/directory must be valid + if test "$apr_found" != "yes"; then + AC_MSG_ERROR([ +The directory given to --with-apr does not specify a prefix for an installed +APR, nor an APR build directory.]) + fi + ],[ + dnl always look in the builtin/default places + LIBS="$LIBS -lapr" + AC_TRY_LINK_FUNC(apr_initialize, [apr_libdir=""], [ + dnl look in the some standard places (apparently not in builtin/default) + for lookdir in /usr /usr/local ; do + LDFLAGS="$preserve_LDFLAGS -L$lookdir/lib" + AC_TRY_LINK_FUNC(apr_initialize, [ + apr_libdir="$lookdir" ; break + ]) + done + ]) + ]) + + if test "$apr_found" != "no" && test "$apr_libdir" != ""; then + if test "$apr_config" = "" && test -f "$apr_libdir/APRVARS"; then + apr_config="$apr_libdir/APRVARS" + fi + if test "$apr_la_file" = "" && test -f "$apr_libdir/libapr.la"; then + apr_la_file="$apr_libdir/libapr.la" + fi + fi + + LIBS="$preserve_LIBS" + LDFLAGS="$preserve_LDFLAGS" +]) From 6d37e4966beaa1cd92972092d861bcc3b1dbc7b0 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 11 Dec 2001 00:44:22 +0000 Subject: [PATCH 2614/7878] I'm happy. Go, gadget, go... (My only issue with it was that apr_pool_lock wasn't defined. That's an easy fix.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62617 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 42b59e2da1f..75e1ff30799 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/10 23:01:46 $] +Last modified at [$Date: 2001/12/11 00:44:22 $] Release: @@ -60,7 +60,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Votes: Sander's patch: +1: Brian (non-binding), - Ian (once we have a debug version of palloc etc) + Ian (once we have a debug version of palloc etc), + Justin 0: -1: From 9cf7012d4fe6ce32c2c6c1a1a065bf47f080aabe Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 11 Dec 2001 01:42:10 +0000 Subject: [PATCH 2615/7878] If we tell libtool what our link dependencies are (by including them when we build libapr.la), it will remember the dependencies for us. So, if a third-party (say httpd, flood, SVN, etc.) want to link against libapr.la, they don't need to worry about the library dependencies that are currently stored in EXTRA_LIBS et al. This has been tested with libtool-1.4. Further testing and integration needs to be done. But, this could simplify our build system a bit w.r.t. library dependencies. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62618 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 37c03f8cc8d..2e18df61926 100644 --- a/Makefile.in +++ b/Makefile.in @@ -18,6 +18,7 @@ CLEAN_SUBDIRS= . test build INSTALL_SUBDIRS=@INSTALL_SUBDIRS@ TARGET_LIB = libapr.la +DEPEND_LIBS = @EXTRA_LIBS@ @LIBTOOL_LIBS@ # # Rules for building specific targets, starting with 'all' for @@ -75,7 +76,7 @@ install: $(TARGET_LIB) $(TARGET_LIB): @for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \ - tmpcmd="$(LINK) @lib_target@"; \ + tmpcmd="$(LINK) @lib_target@ $(DEPEND_LIBS)"; \ echo $$tmpcmd; \ $$tmpcmd From 2998502a7f50292369b7743b3e270e53563dc2f2 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 11 Dec 2001 02:29:18 +0000 Subject: [PATCH 2616/7878] Kind of an obscure bug. VPATH on a platform that builds exports.c (like AIX) would improperly build the INCLUDES macro. This sticks an extra '/' in there so the compiler can find all the include files properly. Without this patch, symptoms would include: - AIX would build and run, and even work with "GET /" requests, but would SEGV on anything more complicated ("GET / HTTP/1.1"...). - Include failures when trying to build exports.lo (but it would not halt the build and would be buried in the build output). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62619 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 49fa19534af..2829b484b25 100644 --- a/configure.in +++ b/configure.in @@ -1451,9 +1451,9 @@ VPATH = $abs_srcdir/$dir EOF ) | cat - $makefile | \ sed \ - -e 's#-I\($(INCDIR[0-9]*)\)#-I\1 -I$(srcdir)\1#g' \ - -e 's#-I\($(OSDIR[0-9]*)\)#-I\1 -I$(srcdir)\1#g' \ - -e 's#-I\($(DEFOSDIR[0-9]*)\)#-I\1 -I$(srcdir)\1#g' \ + -e 's#-I\($(INCDIR[0-9]*)\)#-I\1 -I$(srcdir)/\1#g' \ + -e 's#-I\($(OSDIR[0-9]*)\)#-I\1 -I$(srcdir)/\1#g' \ + -e 's#-I\($(DEFOSDIR[0-9]*)\)#-I\1 -I$(srcdir)/\1#g' \ > tmp cp tmp $makefile done From de5b689ad865e48f99c34fb85041902b5ceaaf91 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 11 Dec 2001 09:19:41 +0000 Subject: [PATCH 2617/7878] Okay, I've got flood building with this snippet and the about-to-be-posted apr-config patch. Since not all installations may have it, apr-config will be optional (for now). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62620 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index f19b38d4fc5..cab64635ffe 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -55,6 +55,7 @@ AC_DEFUN(APR_FIND_APR, [ preserve_LIBS="$LIBS" preserve_LDFLAGS="$LDFLAGS" + preserve_CFLAGS="$CFLAGS" AC_MSG_CHECKING(for APR) AC_ARG_WITH(apr, @@ -64,6 +65,11 @@ AC_DEFUN(APR_FIND_APR, [ AC_MSG_ERROR([--with-apr requires a directory to be provided]) fi + if test -x $withval/bin/apr-config; then + CFLAGS="$CFLAGS `$withval/bin/apr-config --cflags`" + LIBS="$LIBS `$withval/bin/apr-config --libs`" + LDFLAGS="$LDFLAGS `$withval/bin/apr-config --ldflags`" + fi LIBS="$LIBS -lapr" LDFLAGS="$preserve_LDFLAGS -L$withval/lib" AC_TRY_LINK_FUNC(apr_initialize, [ @@ -119,6 +125,8 @@ APR, nor an APR build directory.]) fi fi + AC_MSG_RESULT($apr_found) + CFLAGS="$preserve_CFLAGS" LIBS="$preserve_LIBS" LDFLAGS="$preserve_LDFLAGS" ]) From 068cf0ee4a5d67b0d225720d75e255b4177194c2 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 11 Dec 2001 10:05:19 +0000 Subject: [PATCH 2618/7878] Since apr-config is probably going to be added, let's rename the current apr_config variable to apr_vars (which is APRVARS) and add apr_config as the path to the apr-config bin. This eliminates any confusion. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62621 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index cab64635ffe..73135fab70a 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -28,7 +28,9 @@ dnl dnl apr_srcdir : If an APR source tree is available and needs to be dnl (re)configured, this refers to it. dnl -dnl apr_config : If the APR config file (APRVARS) exists, this refers to it. +dnl apr_config : If the apr-config tool exists, this refers to it. +dnl +dnl apr_vars : If the APR config file (APRVARS) exists, this refers to it. dnl dnl apr_found : "yes", "no", "reconfig" dnl @@ -66,10 +68,14 @@ AC_DEFUN(APR_FIND_APR, [ fi if test -x $withval/bin/apr-config; then + apr_config="$withval/bin/apr-config" CFLAGS="$CFLAGS `$withval/bin/apr-config --cflags`" LIBS="$LIBS `$withval/bin/apr-config --libs`" LDFLAGS="$LDFLAGS `$withval/bin/apr-config --ldflags`" + else + apr_config="" fi + LIBS="$LIBS -lapr" LDFLAGS="$preserve_LDFLAGS -L$withval/lib" AC_TRY_LINK_FUNC(apr_initialize, [ @@ -85,12 +91,17 @@ AC_DEFUN(APR_FIND_APR, [ apr_found="yes" apr_libdir="" apr_la_file="$withval/libapr.la" - apr_config="$withval/APRVARS" + apr_vars="$withval/APRVARS" + if test -x $withval/apr-config; then + apr_config="$withval/apr-config" + else + apr_config="" + fi apr_includes="-I$withval/include" if test ! -f "$withval/APRVARS.in"; then dnl extract the APR source directory without polluting our dnl shell variable space - apr_srcdir="`sed -n '/APR_SOURCE_DIR/s/.*"\(.*\)"/\1/p' $apr_config`" + apr_srcdir="`sed -n '/APR_SOURCE_DIR/s/.*"\(.*\)"/\1/p' $apr_vars`" apr_includes="$apr_includes -I$apr_srcdir/include" fi fi @@ -117,8 +128,8 @@ APR, nor an APR build directory.]) ]) if test "$apr_found" != "no" && test "$apr_libdir" != ""; then - if test "$apr_config" = "" && test -f "$apr_libdir/APRVARS"; then - apr_config="$apr_libdir/APRVARS" + if test "$apr_vars" = "" && test -f "$apr_libdir/APRVARS"; then + apr_vars="$apr_libdir/APRVARS" fi if test "$apr_la_file" = "" && test -f "$apr_libdir/libapr.la"; then apr_la_file="$apr_libdir/libapr.la" From 11430a863e32dbd1577b87eaef6e21e3087ca6e7 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 11 Dec 2001 10:27:55 +0000 Subject: [PATCH 2619/7878] Add preliminary srcdir support - call it with APR_FIND_APR(apr) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62622 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 73135fab70a..cce69c1a743 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -127,6 +127,23 @@ APR, nor an APR build directory.]) ]) ]) + dnl We attempt to guess what the data will be *after* configure is run. + dnl Note, if we don't see configure, but do have configure.in, it'd be + dnl nice to run buildconf, but that's for another day. + if test "$apr_found" = "no" && test -n "$1" && test -x "$1/configure"; then + apr_found="reconfig" + apr_srcdir="$1" + apr_libdir="" + apr_la_file="$apr_srcdir/libapr.la" + apr_vars="$apr_srcdir/APRVARS" + if test -f $apr_srcdir/apr-config.in; then + apr_config="$apr_srcdir/apr-config" + else + apr_config="" + fi + apr_includes="-I$apr_srcdir/include" + fi + if test "$apr_found" != "no" && test "$apr_libdir" != ""; then if test "$apr_vars" = "" && test -f "$apr_libdir/APRVARS"; then apr_vars="$apr_libdir/APRVARS" From 7b3b0ba7507fee594895424b111768424b283da9 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 11 Dec 2001 16:54:38 +0000 Subject: [PATCH 2620/7878] The first pass at adding conditionals for BeOS. These are heavily based on the email's between Victor and Aaron and the pseudo code that resulted. It's not perfect, but passes all the tests in testlock, so at least it's a start. Hopefully more eyes will see the problems. It'd also be good to try and improve the test suite for conditionals. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62623 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/thread_cond.h | 11 +++ locks/beos/thread_cond.c | 126 ++++++++++++++++++++++++++++++-- 2 files changed, 130 insertions(+), 7 deletions(-) diff --git a/include/arch/beos/thread_cond.h b/include/arch/beos/thread_cond.h index 05625c01154..00ceef44352 100644 --- a/include/arch/beos/thread_cond.h +++ b/include/arch/beos/thread_cond.h @@ -63,8 +63,19 @@ #include "apr_lib.h" #include "apr_portable.h" +struct waiter { + apr_pool_t *pool; + sem_id sem; + struct waiter *next; +}; + struct apr_thread_cond_t { apr_pool_t *pool; + sem_id lock; + apr_thread_mutex_t *condlock; + thread_id owner; + struct waiter *list; + struct waiter *tail; }; #endif /* THREAD_COND_H */ diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c index 30a4a25c4d1..daaac4e19ab 100644 --- a/locks/beos/thread_cond.c +++ b/locks/beos/thread_cond.c @@ -61,38 +61,150 @@ #include "apr_strings.h" #include "apr_portable.h" +static apr_status_t thread_cond_cleanup(void *data) +{ + struct waiter *w; + apr_thread_cond_t *cond = (apr_thread_cond_t *)data; + + acquire_sem(cond->lock); + /* Go through waiters list and delete the sem's so we don't leak. */ + while (cond->list) { + w = cond->list; + cond->list = w->next; + delete_sem(w->sem); + } + delete_sem(cond->lock); + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, apr_pool_t *pool) { - return APR_ENOTIMPL; + apr_thread_cond_t *new_cond; + sem_id rv; + + new_cond = (apr_thread_cond_t *)apr_palloc(pool, sizeof(apr_thread_cond_t)); + + if (new_cond == NULL) + return APR_ENOMEM; + + if ((rv = create_sem(1, "apr conditional lock")) < B_OK) + return rv; + + new_cond->lock = rv; + new_cond->pool = pool; + new_cond->list = NULL; + + apr_pool_cleanup_register(new_cond->pool, + (void *)new_cond, thread_cond_cleanup, + apr_pool_cleanup_null); + + *cond = new_cond; + return APR_SUCCESS; +} + +static apr_status_t do_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, + int timeout) +{ + struct waiter *wait = apr_palloc(cond->pool, sizeof(struct waiter)); + thread_id cth = find_thread(NULL); + apr_status_t rv; + + if (!wait) + return APR_ENOMEM; + + if (cond->owner > 0 && cth != cond->owner) { + /* What should we return??? */ + return APR_EINVAL; + } + + wait->sem = create_sem(0, "apr conditional waiter"); + wait->next = NULL; + wait->pool = cond->pool; + cond->condlock = mutex; + + acquire_sem(cond->lock); + cond->owner = -1; + + if (!cond->list) + cond->list = wait; + else + cond->tail->next = wait; + cond->tail = wait; + + release_sem(cond->lock); + + apr_thread_mutex_unlock(cond->condlock); + + rv = acquire_sem_etc(wait->sem, 1, B_RELATIVE_TIMEOUT, timeout); + if (rv != B_OK) + if (rv == B_TIMED_OUT) + return APR_TIMEUP; + return rv; + + apr_thread_mutex_lock(cond->condlock); + + acquire_sem(cond->lock); + cond->owner = find_thread(NULL); + release_sem(cond->lock); + + delete_sem(wait->sem); + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + return do_wait(cond, mutex, 0); } APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, - apr_interval_time_t timeout){ - return APR_ENOTIMPL; + apr_interval_time_t timeout) +{ + return do_wait(cond, mutex, timeout); } APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) { - return APR_ENOTIMPL; + struct waiter *wake; + + acquire_sem(cond->lock); + if (cond->list) { + wake = cond->list; + cond->list = wake->next; + release_sem(wake->sem); + } + release_sem(cond->lock); + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) { - return APR_ENOTIMPL; + struct waiter *wake; + + acquire_sem(cond->lock); + while (cond->list) { + wake = cond->list; + cond->list = wake->next; + release_sem(wake->sem); + } + release_sem(cond->lock); + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) { - return APR_ENOTIMPL; + apr_status_t stat; + if ((stat = thread_cond_cleanup(cond)) == APR_SUCCESS) { + apr_pool_cleanup_kill(cond->pool, cond, thread_cond_cleanup); + return APR_SUCCESS; + } + return stat; } APR_POOL_IMPLEMENT_ACCESSOR(thread_cond) From d818565bb01d6b66d58eea1cfc38b184bf1461f8 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 11 Dec 2001 17:08:16 +0000 Subject: [PATCH 2621/7878] Do the right thing when setting pipe timeouts for the latest BONE beta. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62624 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/pipe.c | 60 +++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 310ad91dd6b..db1182b8f02 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -55,9 +55,20 @@ #include "fileio.h" #include "apr_strings.h" +/* Figure out how to get pipe block/nonblock on BeOS... + * Basically, BONE7 changed things again so that ioctl didn't work, + * but now fcntl does, hence we need to do this extra checking. + * The joys of beta programs. :-) + */ +#if BEOS +#if !BONE7 +# define BEOS_BLOCKING +#endif +#endif + static apr_status_t pipeblock(apr_file_t *thepipe) { -#if !BEOS /* this code won't work on BeOS */ +#if !BEOS_BLOCKING int fd_flags; fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); @@ -71,21 +82,21 @@ static apr_status_t pipeblock(apr_file_t *thepipe) /* XXXX: this breaks things, but an alternative isn't obvious...*/ return APR_ENOTIMPL; # endif - if (fcntl(thepipe->filedes, F_SETFL, fd_flags) == -1) { - return errno; - } - -#else + if (fcntl(thepipe->filedes, F_SETFL, fd_flags) == -1) { + return errno; + } +#else /* BEOS_BLOCKING */ -# if BEOS_BONE /* This only works on BONE or beyond */ - int on = 0; - if (ioctl(thepipe->filedes, FIONBIO, &on, sizeof(on)) < 0) - return errno; -# else /* BEOS_BONE */ - return APR_ENOTIMPL; -# endif /* BEOS_BONE */ +# if BEOS_BONE /* This only works on BONE 0-6 */ + int on = 0; + if (ioctl(thepipe->filedes, FIONBIO, &on, sizeof(on)) < 0) { + return errno; + } +# else /* "classic" BeOS doesn't support this at all */ + return APR_ENOTIMPL; +# endif -#endif /* !BEOS_R5 */ +#endif /* !BEOS_BLOCKING */ thepipe->blocking = BLK_ON; return APR_SUCCESS; @@ -93,7 +104,7 @@ static apr_status_t pipeblock(apr_file_t *thepipe) static apr_status_t pipenonblock(apr_file_t *thepipe) { -#if !BEOS /* this code won't work on BeOS */ +#if !BEOS_BLOCKING int fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); # if defined(O_NONBLOCK) @@ -110,17 +121,18 @@ static apr_status_t pipenonblock(apr_file_t *thepipe) return errno; } -#else /* !BEOS */ +#else /* BEOS_BLOCKING */ -# if BEOS_BONE /* This only works on BONE and later...*/ - int on = 1; - if (ioctl(thepipe->filedes, FIONBIO, &on, sizeof(on)) < 0) - return errno; -# else /* BEOS_BONE */ - return APR_ENOTIMPL; -# endif /* BEOS_BONE */ +# if BEOS_BONE /* This only works on BONE 0-6 */ + int on = 1; + if (ioctl(thepipe->filedes, FIONBIO, &on, sizeof(on)) < 0) { + return errno; + } +# else /* "classic" BeOS doesn't support this at all */ + return APR_ENOTIMPL; +# endif -#endif /* !BEOS */ +#endif /* !BEOS_BLOCKING */ thepipe->blocking = BLK_OFF; return APR_SUCCESS; From f971a695a8108601bf7f67315b9c40bdb397efb9 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 11 Dec 2001 17:46:32 +0000 Subject: [PATCH 2622/7878] Okay, back out the libtool dependency stuff. We need to figure out what AIX can support or not. Since I don't have AIX, I have no way of doing any further research, so this needs to be reverted. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62625 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 2e18df61926..37c03f8cc8d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -18,7 +18,6 @@ CLEAN_SUBDIRS= . test build INSTALL_SUBDIRS=@INSTALL_SUBDIRS@ TARGET_LIB = libapr.la -DEPEND_LIBS = @EXTRA_LIBS@ @LIBTOOL_LIBS@ # # Rules for building specific targets, starting with 'all' for @@ -76,7 +75,7 @@ install: $(TARGET_LIB) $(TARGET_LIB): @for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \ - tmpcmd="$(LINK) @lib_target@ $(DEPEND_LIBS)"; \ + tmpcmd="$(LINK) @lib_target@"; \ echo $$tmpcmd; \ $$tmpcmd From 8f44829b61ee30ea5d1b8747cf47a1726655bd14 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 11 Dec 2001 19:40:50 +0000 Subject: [PATCH 2623/7878] Clean up GNU compiler issues on NetWare Submitted by: Pavel Novy git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62626 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 6 +++++- include/apr_general.h | 2 ++ include/arch/netware/networkio.h | 2 +- threadproc/netware/thread.c | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index 04ec8d7a953..70dcebd0283 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -87,7 +87,7 @@ #include -#include +#include #define _POSIX_THREAD_SAFE_FUNCTIONS 1 #define READDIR_IS_THREAD_SAFE 1 @@ -221,7 +221,11 @@ typedef int apr_socklen_t; /* Mechanisms to properly type numeric literals */ +#ifdef __GNUC__ +#define APR_INT64_C(val) (val) +#else #define APR_INT64_C(val) (val##i64) +#endif //srj added in here, libc c no longer takes care of these diff --git a/include/apr_general.h b/include/apr_general.h index bc1c2b60bb0..91f6ed734fb 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -83,7 +83,9 @@ extern "C" { #define TRUE (!FALSE) #endif +#ifndef MAXIMUM_WAIT_OBJECTS #define MAXIMUM_WAIT_OBJECTS 64 +#endif #define APR_ASCII_BLANK '\040' #define APR_ASCII_CR '\015' diff --git a/include/arch/netware/networkio.h b/include/arch/netware/networkio.h index 361ff965454..f7471dc688f 100644 --- a/include/arch/netware/networkio.h +++ b/include/arch/netware/networkio.h @@ -59,7 +59,7 @@ arch/netware and then arch/unix. But in this specific case we want arch/win32. */ -#include <..\win32\networkio.h> +#include <../win32/networkio.h> #endif /* ! NETWORK_IO_H */ diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 6688a2c45ce..926da0a2faa 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -110,7 +110,7 @@ apr_status_t apr_thread_create(apr_thread_t **new, strncpy (threadName, attr->thread_name, NX_MAX_OBJECT_NAME_LEN); } else { - sprintf(threadName, "APR_thread %0004ld", ++thread_count); + sprintf(threadName, "APR_thread %04ld", ++thread_count); } /* An original stack size of 0 will allow NXCreateThread() to From 0e7f78f1ce26fc15c9e2887a4ea50475d442b992 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Dec 2001 04:30:33 +0000 Subject: [PATCH 2624/7878] - Fix some potential quoting problems - Reorder the tests so that we only check $1 when --with-apr isn't specified. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62627 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 65 ++++++++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index cce69c1a743..8ec1f207d39 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -67,7 +67,7 @@ AC_DEFUN(APR_FIND_APR, [ AC_MSG_ERROR([--with-apr requires a directory to be provided]) fi - if test -x $withval/bin/apr-config; then + if test -x "$withval/bin/apr-config"; then apr_config="$withval/bin/apr-config" CFLAGS="$CFLAGS `$withval/bin/apr-config --cflags`" LIBS="$LIBS `$withval/bin/apr-config --libs`" @@ -116,33 +116,50 @@ APR, nor an APR build directory.]) ],[ dnl always look in the builtin/default places LIBS="$LIBS -lapr" - AC_TRY_LINK_FUNC(apr_initialize, [apr_libdir=""], [ + AC_TRY_LINK_FUNC(apr_initialize, [ + dnl We don't have to do anything. + apr_found="yes" + apr_srcdir="" + apr_libdir="" + apr_includes="" + apr_la_file="" + apr_config="" + apr_vars="" + ], [ dnl look in the some standard places (apparently not in builtin/default) - for lookdir in /usr /usr/local ; do - LDFLAGS="$preserve_LDFLAGS -L$lookdir/lib" - AC_TRY_LINK_FUNC(apr_initialize, [ - apr_libdir="$lookdir" ; break - ]) + for lookdir in /usr /usr/local /opt/apr ; do + if test "$apr_found" != "yes"; then + LDFLAGS="$preserve_LDFLAGS -L$lookdir/lib" + AC_TRY_LINK_FUNC(apr_initialize, [ + apr_found="yes" + apr_libdir="$lookdir/lib" + apr_includes="-I$lookdir/include" + if test -x "$withval/bin/apr-config"; then + apr_config="$withval/bin/apr-config" + else + apr_config="" + fi + ]) + fi done ]) - ]) - - dnl We attempt to guess what the data will be *after* configure is run. - dnl Note, if we don't see configure, but do have configure.in, it'd be - dnl nice to run buildconf, but that's for another day. - if test "$apr_found" = "no" && test -n "$1" && test -x "$1/configure"; then - apr_found="reconfig" - apr_srcdir="$1" - apr_libdir="" - apr_la_file="$apr_srcdir/libapr.la" - apr_vars="$apr_srcdir/APRVARS" - if test -f $apr_srcdir/apr-config.in; then - apr_config="$apr_srcdir/apr-config" - else - apr_config="" + dnl We attempt to guess what the data will be *after* configure is run. + dnl Note, if we don't see configure, but do have configure.in, it'd be + dnl nice to run buildconf, but that's for another day. + if test "$apr_found" = "no" && test -n "$1" && test -x "$1/configure"; then + apr_found="reconfig" + apr_srcdir="$1" + apr_libdir="" + apr_la_file="$apr_srcdir/libapr.la" + apr_vars="$apr_srcdir/APRVARS" + if test -f "$apr_srcdir/apr-config.in"; then + apr_config="$apr_srcdir/apr-config" + else + apr_config="" + fi + apr_includes="-I$apr_srcdir/include" fi - apr_includes="-I$apr_srcdir/include" - fi + ]) if test "$apr_found" != "no" && test "$apr_libdir" != ""; then if test "$apr_vars" = "" && test -f "$apr_libdir/APRVARS"; then From a4c3c450faaddb89102db02e3692f486ade48639 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Dec 2001 06:46:45 +0000 Subject: [PATCH 2625/7878] apr-config is a shell script modeled after glib-config et al that allows third-parties easy access to APR configuration parameters. Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62628 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 1 + CHANGES | 6 ++++ Makefile.in | 5 ++- apr-config.in | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 3 ++ 5 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 apr-config.in diff --git a/.cvsignore b/.cvsignore index 5cb40de2ac5..cb36264ecf7 100644 --- a/.cvsignore +++ b/.cvsignore @@ -6,6 +6,7 @@ config.status configure libtool APRVARS +apr-config LibD LibR Debug diff --git a/CHANGES b/CHANGES index 2300ce104fc..25bf4240357 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) Add apr-config - a shell script to allow third-party programs + easy access to APR configuration parameters. [Justin Erenkrantz] + + *) Add find_apr.m4 to allow third-party programs that use APR to + have a standard m4 macro for detection. [Greg Stein] + *) SEGV in apr_table_overlap [Brian Pane] *) apr_array_copy speedup by removing the zero-fill [Brian Pane] diff --git a/Makefile.in b/Makefile.in index 37c03f8cc8d..4ec8ef151a2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -31,12 +31,13 @@ TARGETS = delete-lib $(TARGET_LIB) delete-exports export_vars.h apr.exp CLEAN_TARGETS = DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ - APRVARS libtool apr.exp + APRVARS libtool apr.exp apr-config EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in \ exports.c export_vars.h prefix=@prefix@ exec_prefix=@exec_prefix@ +bindir=@bindir@ libdir=@libdir@ includedir=@includedir@ srcdir=@srcdir@ @@ -67,6 +68,8 @@ install: $(TARGET_LIB) $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(libdir) $(LIBTOOL) --mode=install cp APRVARS $(libdir) $(LIBTOOL) --mode=install cp apr.exp $(libdir) + $(LIBTOOL) --mode=install cp apr-config $(bindir) + chmod 755 $(bindir)/apr-config @if [ $(INSTALL_SUBDIRS) != "none" ]; then \ for i in $(INSTALL_SUBDIRS); do \ ( cd $$i ; $(MAKE) install ); \ diff --git a/apr-config.in b/apr-config.in new file mode 100644 index 00000000000..203fe78df4b --- /dev/null +++ b/apr-config.in @@ -0,0 +1,86 @@ +#!/bin/sh + +PREFIX="@prefix@" +EXEC_PREFIX="@exec_prefix@" +LIBDIR="@libdir@" +INCLUDEDIR="@includedir@" +CC="@CC@" +CPP="@CPP@" +SHELL="@SHELL@" +CPPFLAGS="@EXTRA_CPPFLAGS@" +CFLAGS="@EXTRA_CFLAGS@" +LDFLAGS="@EXTRA_LDFLAGS@" +LIBS="@EXTRA_LIBS@" +INCLUDES="@EXTRA_INCLUDES@" +LIBTOOL_LIBS="@LIBTOOL_LIBS@" +SHLIBPATH_VAR="@shlibpath_var@" +APR_SOURCE_DIR="@abs_srcdir@" +APR_SO_EXT="@so_ext@" +APR_LIB_TARGET="@export_lib_target@" + +show_usage() +{ + cat << EOF +Usage: apr-config [OPTION] + +Known values for OPTION are: + --prefix=DIR change prefix to DIR + --cflags print C compiler flags + --cppflags print cpp flags + --includes print include information + --ldflags print linker flags + --libs print library information + --help print this help +EOF +} + +if test $# -eq 0; then + show_usage + exit 1 +fi + +while test $# -gt 0; do + # Normalize the prefix. + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case "$1" in + # It is possible for the user to override our prefix. + --prefix=*) + prefix=$optarg + ;; + --prefix) + echo $PREFIX + ;; + --cflags) + echo $CFLAGS + ;; + --cppflags) + echo $CPPFLAGS + ;; + --libs) + echo $LIBS + ;; + --ldflags) + echo $LDFLAGS + ;; + --includes) + echo $INCLUDES + ;; + --help) + show_usage + exit 1 + ;; + *) + show_usage + exit 1 + ;; + esac + + # Next please. + shift +done + +exit 0 diff --git a/configure.in b/configure.in index 2829b484b25..4da89a4ef78 100644 --- a/configure.in +++ b/configure.in @@ -1427,6 +1427,7 @@ AC_OUTPUT([ include/apr.h APRVARS build/rules.mk + apr-config ],[ for i in $SAVE_FILES; do if cmp -s $i $i.save 2>/dev/null; then @@ -1437,6 +1438,8 @@ for i in $SAVE_FILES; do done ]) +chmod +x apr-config + dnl #----------------------------- Fixup Makefiles for VPATH support changequote({,}) From 16ac5add1e4f8078feba92c2ffc4ab4f4ce08c77 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Dec 2001 06:51:16 +0000 Subject: [PATCH 2626/7878] Add license info and brief description of this file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62629 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/apr-config.in b/apr-config.in index 203fe78df4b..4a3415584ee 100644 --- a/apr-config.in +++ b/apr-config.in @@ -1,4 +1,59 @@ #!/bin/sh +# ==================================================================== +# The Apache Software License, Version 1.1 +# +# Copyright (c) 2001 The Apache Software Foundation. All rights +# reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3. The end-user documentation included with the redistribution, +# if any, must include the following acknowledgment: +# "This product includes software developed by the +# Apache Software Foundation (http://www.apache.org/)." +# Alternately, this acknowledgment may appear in the software itself, +# if and wherever such third-party acknowledgments normally appear. +# +# 4. The names "Apache" and "Apache Software Foundation" must +# not be used to endorse or promote products derived from this +# software without prior written permission. For written +# permission, please contact apache@apache.org. +# +# 5. Products derived from this software may not be called "Apache", +# nor may "Apache" appear in their name, without prior written +# permission of the Apache Software Foundation. +# +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR +# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# ==================================================================== +# +# This software consists of voluntary contributions made by many +# individuals on behalf of the Apache Software Foundation. For more +# information on the Apache Software Foundation, please see +# . + +# APR script designed to allow easy command line access to APR configuration +# parameters. PREFIX="@prefix@" EXEC_PREFIX="@exec_prefix@" From e062d2fd8b8b11223c4379a50b430de7654a1873 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Dec 2001 06:52:06 +0000 Subject: [PATCH 2627/7878] Fix a nit pointed out by Greg Stein. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62630 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apr-config.in b/apr-config.in index 4a3415584ee..1fb81ef0724 100644 --- a/apr-config.in +++ b/apr-config.in @@ -79,7 +79,7 @@ show_usage() Usage: apr-config [OPTION] Known values for OPTION are: - --prefix=DIR change prefix to DIR + --prefix[=DIR] change prefix to DIR --cflags print C compiler flags --cppflags print cpp flags --includes print include information From af434639b9910d4962626a636133ea992803c558 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Dec 2001 08:33:39 +0000 Subject: [PATCH 2628/7878] Confirmed fix committed to FreeBSD's CVS repository! Expect it to be merged from current (MFC) into -STABLE in about a week. I will keep on playing with FreeBSD and threads. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62631 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/STATUS b/STATUS index 75e1ff30799..305d46ebd59 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/11 00:44:22 $] +Last modified at [$Date: 2001/12/12 08:33:39 $] Release: @@ -244,21 +244,9 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: FreeBSD. MsgID: <20010828091959.D17570@ebuilt.com> - Status: Justin has tracked down a FreeBSD kernel hacker - (alfred@freebsd.org) and we've isolated some issues - within src/lib/libc_r/uthread/uthread_sendfile.c. There - are some problems in FreeBSD between libc_r and the - kernel implementation of sendfile. We've made some - progress (we now send the headers correctly, but we seem - to send the file twice now!). At this point, we are unsure - if we are seeing an APR bug or a FreeBSD bug. Alfred has - requested some time to look at the sendfile(2) code with - APR's test suite. Justin has gained enough knowledge in - his conversations that he may be able to continue this - work if no feedback comes. - - We have a preliminary patch at: - http://people.freebsd.org/~alfred/uthread_sf.diff + Status: Fixed in -CURRENT. MFC in about a week. Continuing + testing with threads on FreeBSD. + FreeBSD PR kern/32684: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/32684 From ef67de098848eb78b98c71176f9a3c24473755b0 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Dec 2001 08:37:33 +0000 Subject: [PATCH 2629/7878] Add a third undocumented option that allows connection to remote servers. ./sendfile client blocking 192.168.0.2 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62632 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/test/sendfile.c b/test/sendfile.c index d333e1657ea..d7c7018be8b 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -201,7 +201,7 @@ static void create_testfile(apr_pool_t *p, const char *fname) } } -static int client(client_socket_mode_t socket_mode) +static int client(client_socket_mode_t socket_mode, char *host) { apr_status_t rv, tmprv; apr_socket_t *sock; @@ -233,7 +233,10 @@ static int client(client_socket_mode_t socket_mode) exit(1); } - rv = apr_sockaddr_info_get(&destsa, "127.0.0.1", family, TESTSF_PORT, 0, p); + if (!host) { + host = "127.0.0.1"; + } + rv = apr_sockaddr_info_get(&destsa, host, family, TESTSF_PORT, 0, p); if (rv != APR_SUCCESS) { fprintf(stderr, "apr_sockaddr_info_get()->%d/%s\n", rv, @@ -351,14 +354,14 @@ static int client(client_socket_mode_t socket_mode) tmplen = len; /* bytes remaining to send from the file */ printf("Calling apr_sendfile()...\n"); - printf("Headers:\n"); + printf("Headers (%d):\n", hdtr.numheaders); for (i = 0; i < hdtr.numheaders; i++) { - printf("\t%d bytes\n", - hdtr.headers[i].iov_len); + printf("\t%d bytes (%c)\n", + hdtr.headers[i].iov_len, hdtr.headers[i].iov_base[0]); } printf("File: %ld bytes from offset %ld\n", (long)tmplen, (long)current_file_offset); - printf("Trailers:\n"); + printf("Trailers (%d):\n", hdtr.numtrailers); for (i = 0; i < hdtr.numtrailers; i++) { printf("\t%d bytes\n", hdtr.trailers[i].iov_len); @@ -743,15 +746,19 @@ int main(int argc, char *argv[]) /* Gee whiz this is goofy logic but I wanna drive sendfile right now, * not dork around with the command line! */ - if (argc == 3 && !strcmp(argv[1], "client")) { + if (argc >= 3 && !strcmp(argv[1], "client")) { + char *host = 0; + if (argv[3]) { + host = argv[3]; + } if (!strcmp(argv[2], "blocking")) { - return client(BLK); + return client(BLK, host); } else if (!strcmp(argv[2], "timeout")) { - return client(TIMEOUT); + return client(TIMEOUT, host); } else if (!strcmp(argv[2], "nonblocking")) { - return client(NONBLK); + return client(NONBLK, host); } } else if (argc == 2 && !strcmp(argv[1], "server")) { From dcdb739e56a84a39a0e9ee09b33db9a372272a79 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Dec 2001 09:08:20 +0000 Subject: [PATCH 2630/7878] If bindir doesn't exist, create it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62633 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile.in b/Makefile.in index 4ec8ef151a2..9b4fda00457 100644 --- a/Makefile.in +++ b/Makefile.in @@ -68,6 +68,9 @@ install: $(TARGET_LIB) $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(libdir) $(LIBTOOL) --mode=install cp APRVARS $(libdir) $(LIBTOOL) --mode=install cp apr.exp $(libdir) + if [ ! -d $(bindir) ]; then \ + $(top_srcdir)/build/mkdir.sh $(bindir); \ + fi; $(LIBTOOL) --mode=install cp apr-config $(bindir) chmod 755 $(bindir)/apr-config @if [ $(INSTALL_SUBDIRS) != "none" ]; then \ From 150a4a939f81aea11cf08f5fae095b569c05bc0d Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Dec 2001 10:05:54 +0000 Subject: [PATCH 2631/7878] Not a big deal, but worth noting. If anyone has an idea on how to detect this, it'd be general goodness to error out when we create the lock rather than waiting to error out when acquiring the lock. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62634 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 305d46ebd59..75c9258be08 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/12 08:33:39 $] +Last modified at [$Date: 2001/12/12 10:05:54 $] Release: @@ -274,6 +274,11 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: begin to migrate the old API to be implemented on top of the new one, or just decide to get rid of it altogether. + * FreeBSD returns 45 (EOPNOTSUPP) when the lockfile is on a NFS + partition when you call fcntl(F_SETLKW). It may be good if we + can somehow detect this and error out when creating the lock + rather than waiting for the error to occur when acquiring lock. + Documentation that needs writing: * API documentation From 8996c448f95ef60df16ded214c6d7546ffe4cdc1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 12 Dec 2001 11:46:02 +0000 Subject: [PATCH 2632/7878] iov_base can't be dereferenced portably git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62635 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sendfile.c b/test/sendfile.c index d7c7018be8b..30797a12c7c 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -357,7 +357,7 @@ static int client(client_socket_mode_t socket_mode, char *host) printf("Headers (%d):\n", hdtr.numheaders); for (i = 0; i < hdtr.numheaders; i++) { printf("\t%d bytes (%c)\n", - hdtr.headers[i].iov_len, hdtr.headers[i].iov_base[0]); + hdtr.headers[i].iov_len, *(char *)hdtr.headers[i].iov_base); } printf("File: %ld bytes from offset %ld\n", (long)tmplen, (long)current_file_offset); From b4ce6d36ddc524b316eab62323e55fafec48a591 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 12 Dec 2001 13:28:17 +0000 Subject: [PATCH 2633/7878] maintainer mode with AIX xlc now initializes autodata to 0xFE git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62636 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 4da89a4ef78..7bc403bb127 100644 --- a/configure.in +++ b/configure.in @@ -159,7 +159,7 @@ AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations]) elif test "$AIX_XLC" = "yes"; then - APR_ADDTO(CFLAGS,-qfullpath) + APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE) fi ])dnl From 9f592b32e19f87ee7453cd17480f1a20f651b8b3 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Dec 2001 18:09:22 +0000 Subject: [PATCH 2634/7878] A segfault here, a segfault there. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62637 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 75c9258be08..2d22e75e53a 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/12 10:05:54 $] +Last modified at [$Date: 2001/12/12 18:09:22 $] Release: @@ -48,6 +48,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Status: There are two alternatives. More investigation/analysis needs to be done to see if they can be merged together. + SVN is segfaulting with Sander's pool code. Sander + and Justin are investigating. Sander's submission: Brian's submission: From 96574b388f156b0552ca510817a823ade487b87a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 12 Dec 2001 19:35:06 +0000 Subject: [PATCH 2635/7878] switch Apache/apr/apr-util to use run-time linking on AIX git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62638 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- build/apr_hints.m4 | 1 + configure.in | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 9b4fda00457..50d0b43f45e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -81,7 +81,7 @@ install: $(TARGET_LIB) $(TARGET_LIB): @for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \ - tmpcmd="$(LINK) @lib_target@"; \ + tmpcmd="$(LINK) @lib_target@ @lib_target_libs@"; \ echo $$tmpcmd; \ $$tmpcmd diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index a87dc34c64f..57da49ad4ed 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -64,6 +64,7 @@ if test "x$apr_preload_done" != "xyes" ; then fi APR_SETIFNULL(apr_iconv_inbuf_const, [1]) APR_ADDTO(CPPFLAGS, [-D_THREAD_SAFE]) + APR_ADDTO(LDFLAGS, [-Wl,-brtl]) ;; *-apollo-*) APR_ADDTO(CPPFLAGS, [-DAPOLLO]) diff --git a/configure.in b/configure.in index 7bc403bb127..6059573d7b1 100644 --- a/configure.in +++ b/configure.in @@ -130,6 +130,16 @@ else export_lib_target='' fi +dnl On AIX, libraries need to be specified on the link of lib_target +case $host in + *aix*) + lib_target_libs="\$(EXTRA_LIBS)"; + ;; + *) + lib_target_libs="" + ;; +esac + AC_SUBST(lt_compile) AC_SUBST(link) AC_SUBST(so_ext) @@ -138,6 +148,7 @@ AC_SUBST(export_lib_target) AC_SUBST(shlibpath_var) AC_SUBST(LTFLAGS) AC_SUBST(LT_LDFLAGS) +AC_SUBST(lib_target_libs) dnl #----------------------------- Checks for compiler flags nl=' From 29acd9a4fa86fab50090480d1f0a107c13e0c686 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 13 Dec 2001 09:27:35 +0000 Subject: [PATCH 2636/7878] Hallelujah! Fixed the SVN problems. Post to dev@apr with the new code is on the way. So, httpd and flood probably need to be reverified. Do we wait until the debug code is finished before committing? Votes please! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62639 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/STATUS b/STATUS index 2d22e75e53a..642bfdd4415 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/12 18:09:22 $] +Last modified at [$Date: 2001/12/13 09:27:35 $] Release: @@ -45,15 +45,12 @@ RELEASE SHOWSTOPPERS: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Enable pools to have thread-specific locking in it. - Status: There are two alternatives. More investigation/analysis - needs to be done to see if they can be merged - together. - SVN is segfaulting with Sander's pool code. Sander - and Justin are investigating. - Sander's submission: + Status: Sander's pool code has been tested with httpd, flood, + and SVN. It needs to be determined whether we will + wait for the debug code to be finished before + committing. + Patch: - Brian's submission: - <3C064F49.8000908@pacbell.net> Comparisons/reviews: Ian: <3C083414.1080208@cnet.com> (performance) Brian: <3C07D792.9070301@cnet.com> (code) From 236e2e52dba5f9a25385b1e67a64267c3ce3fa38 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 13 Dec 2001 17:26:15 +0000 Subject: [PATCH 2637/7878] When in Rome... or better put... eat our own dogfood. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62640 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filesys.c | 9 +++++---- file_io/win32/filepath.c | 3 ++- strings/apr_strnatcmp.c | 4 ++-- test/testucs.c | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c index 4f99c4867c0..7af4dc74389 100644 --- a/file_io/os2/filesys.c +++ b/file_io/os2/filesys.c @@ -55,6 +55,7 @@ #include "apr.h" #include "fileio.h" #include "apr_strings.h" +#include "apr_lib.h" #include /* OS/2 Exceptions: @@ -91,7 +92,7 @@ const char c_is_fnchar[256] = apr_status_t filepath_root_test(char *path, apr_pool_t *p) { - char drive = toupper(path[0]); + char drive = apr_toupper(path[0]); if (drive >= 'A' && drive <= 'Z' && path[1] == ':' && IS_SLASH(path[2])) return APR_SUCCESS; @@ -112,7 +113,7 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, path[1] = ':'; path[2] = '/'; - rc = DosQueryCurrentDir(toupper(drive) - 'A', path+3, &bufsize); + rc = DosQueryCurrentDir(apr_toupper(drive) - 'A', path+3, &bufsize); if (rc) { return APR_FROM_OS_ERROR(rc); @@ -136,7 +137,7 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) strcpy(path, root); if (path[1] == ':') - path[0] = toupper(path[0]); + path[0] = apr_toupper(path[0]); *rootpath = apr_pstrdup(p, path); return APR_SUCCESS; } @@ -175,7 +176,7 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p) ULONG rv = 0; if (path[1] == ':') - rv = DosSetDefaultDisk(toupper(path[0]) - '@'); + rv = DosSetDefaultDisk(apr_toupper(path[0]) - '@'); if (rv == 0) rv = DosSetCurrentDir(path); diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 2efe9821d84..f977fb822da 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -55,6 +55,7 @@ #include "apr.h" #include "fileio.h" #include "apr_strings.h" +#include "apr_lib.h" #include #include @@ -324,7 +325,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, newpath[2] = seperator[0]; newpath[3] = '\0'; if (flags & APR_FILEPATH_TRUENAME) { - newpath[0] = toupper(newpath[0]); + newpath[0] = apr_toupper(newpath[0]); rv = filepath_root_test(newpath, p); if (rv) return rv; diff --git a/strings/apr_strnatcmp.c b/strings/apr_strnatcmp.c index a69b0c7d6bd..51a94aa6605 100644 --- a/strings/apr_strnatcmp.c +++ b/strings/apr_strnatcmp.c @@ -125,8 +125,8 @@ static int strnatcmp0(char const *a, char const *b, int fold_case) } if (fold_case) { - ca = toupper(ca); - cb = toupper(cb); + ca = apr_toupper(ca); + cb = apr_toupper(cb); } if (ca < cb) diff --git a/test/testucs.c b/test/testucs.c index f9c4fc6469f..5051c821df5 100644 --- a/test/testucs.c +++ b/test/testucs.c @@ -148,11 +148,11 @@ int main(int argc, char **argv) struct testval s; memset (&s, 0, sizeof(s)); - if (argc < 2 || tolower(*argv[1]) != 'w') { + if (argc < 2 || apr_tolower(*argv[1]) != 'w') { printf ("\n\nTesting Narrow Char Ranges\n"); test_nrange(&s); } - if (argc < 2 || tolower(*argv[1]) != 'n') { + if (argc < 2 || apr_tolower(*argv[1]) != 'n') { printf ("\n\nTesting Wide Char Ranges\n"); test_wrange(&s); } From 85d2e8d983ebed6c1e6001426e87777b0d430124 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 13 Dec 2001 23:43:01 +0000 Subject: [PATCH 2638/7878] Remove an uneeded function and add the accessor thingy so we can build apache again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62641 13f79535-47bb-0310-9956-ffa450edef68 --- locks/beos/thread_mutex.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index 03d669885e4..b0b525565fc 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -114,14 +114,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create_np(apr_thread_mutex_t **mutex, return APR_ENOTIMPL; } #endif - -APR_DECLARE(apr_status_t) apr_thread_mutex_child_init(apr_thread_mutex_t **mutex, - const char *fname, - apr_pool_t *pool) -{ - return APR_SUCCESS; -} - + APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { int32 stat; @@ -186,3 +179,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) } return stat; } + +APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex) + From 20efabda3d9612fcafc27c8bccafd915d70fe427 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 14 Dec 2001 00:15:50 +0000 Subject: [PATCH 2639/7878] This correct error reporting on BeOS. The problem is autoconf, but despite a bit of time I can't isolate it. Added a note to STATUS to remind myself to get round to it and remove the hack this patch adds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62642 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 +++++++- misc/unix/errorcodes.c | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 642bfdd4415..bd8f734ff09 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/13 09:27:35 $] +Last modified at [$Date: 2001/12/14 00:15:50 $] Release: @@ -32,6 +32,8 @@ RELEASE SHOWSTOPPERS: not yet complete on all platforms. Components that are incomplete or missing include: Beos: apr_thread_cond_*() + Initial code committed. Aaron has some concerns, David agrees + and will find time to address the issues. Netware: apr_proc_mutex_*() (Is proc_mutex unnecessary on Netware?) OS/2: apr_thread_cond_*(), apr_proc_mutex_*() @@ -278,6 +280,10 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: can somehow detect this and error out when creating the lock rather than waiting for the error to occur when acquiring lock. + * Fix autoconf tests for strerror_r on BeOS and remove the hack in + misc/unix/errorcodes.c to get error reporting working. Committed as + the solution is elusive at present. + Documentation that needs writing: * API documentation diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index bf6b2614871..e48afa4b91f 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -357,7 +357,7 @@ static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) } #endif -#if defined(HAVE_STRERROR_R) && defined(STRERROR_R_RC_INT) +#if defined(HAVE_STRERROR_R) && defined(STRERROR_R_RC_INT) && !defined(BEOS) /* AIX and Tru64 style */ static char *native_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize) From 7770fcc007a87f1f0d6e0c236c1294c185eac890 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 14 Dec 2001 01:12:25 +0000 Subject: [PATCH 2640/7878] This gets pipe timeouts/blocking/non-blocking working correctly on BeOS. Small piece of tidying up as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62643 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/proc.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index ddf8349d4ab..7bfa25d6489 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -93,16 +93,17 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t } switch (in) { case APR_FULL_BLOCK: + apr_file_pipe_timeout_set(attr->child_in, -1); + apr_file_pipe_timeout_set(attr->parent_in, -1); break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->child_in, -1); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, -1); break; default: - apr_file_pipe_timeout_set(attr->child_in, 0); - apr_file_pipe_timeout_set(attr->parent_in, 0); + break; } } if (out) { @@ -112,16 +113,17 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t } switch (out) { case APR_FULL_BLOCK: + apr_file_pipe_timeout_set(attr->child_out, -1); + apr_file_pipe_timeout_set(attr->parent_out, -1); break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->child_out, -1); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, -1); break; default: - apr_file_pipe_timeout_set(attr->child_out, 0); - apr_file_pipe_timeout_set(attr->parent_out, 0); + break; } } if (err) { @@ -131,16 +133,17 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t } switch (err) { case APR_FULL_BLOCK: + apr_file_pipe_timeout_set(attr->child_err, -1); + apr_file_pipe_timeout_set(attr->parent_err, -1); break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->child_err, -1); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, -1); break; default: - apr_file_pipe_timeout_set(attr->child_err, 0); - apr_file_pipe_timeout_set(attr->parent_err, 0); + break; } } return APR_SUCCESS; @@ -217,9 +220,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, new->in = attr->parent_in; new->err = attr->parent_err; new->out = attr->parent_out; - sp->in = attr->child_in?attr->child_in->filedes:-1; - sp->out = attr->child_out?attr->child_out->filedes:-1; - sp->err = attr->child_err?attr->child_err->filedes:-1; + sp->in = attr->child_in ? attr->child_in->filedes : -1; + sp->out = attr->child_out ? attr->child_out->filedes : -1; + sp->err = attr->child_err ? attr->child_err->filedes : -1; i = 0; while (args && args[i]) { From d5e1eac5f49d0e8d7a9f2637d1cd6720ef909e65 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 14 Dec 2001 01:26:03 +0000 Subject: [PATCH 2641/7878] Add my vote. Feeling confident now that subversion worked without any trouble with the new pools. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62644 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index bd8f734ff09..1ba620de1ad 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/14 00:15:50 $] +Last modified at [$Date: 2001/12/14 01:26:03 $] Release: @@ -52,7 +52,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: wait for the debug code to be finished before committing. Patch: - + Comparisons/reviews: Ian: <3C083414.1080208@cnet.com> (performance) Brian: <3C07D792.9070301@cnet.com> (code) @@ -63,6 +63,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: +1: Brian (non-binding), Ian (once we have a debug version of palloc etc), Justin + Sander 0: -1: From 2ecd9ad1d70c4f6a4f7efd24cb92864a32cef186 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 14 Dec 2001 02:16:55 +0000 Subject: [PATCH 2642/7878] Move us over to the new pools code. The debug code isn't in place yet, so hold off on APR_POOL_DEBUG for a day. No API changes. Reviewed by: Justin Erenkrantz, Brian Pane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62645 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 236 +++--- memory/unix/apr_pools.c | 1754 ++++++++++++++------------------------- misc/unix/start.c | 39 +- 3 files changed, 806 insertions(+), 1223 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 6e9a5d73f1b..4e9d664c040 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -82,6 +82,8 @@ extern "C" { */ #include "apr.h" #include "apr_errno.h" +#define APR_WANT_MEMFUNC +#include "apr_want.h" /* Memory allocation/Pool debugging options... * @@ -90,11 +92,15 @@ extern "C" { * NB These should ALL normally be commented out unless you REALLY * need them!! */ - -/* +/* #define APR_POOL_DEBUG */ +#define APR_POOL_STRINGIZE(x) APR_POOL__STRINGIZE(x) +#define APR_POOL__STRINGIZE(x) #x +#define APR_POOL__FILELINE__ __FILE__ ":" APR_POOL_STRINGIZE(__LINE__) + + /** The fundamental pool type */ typedef struct apr_pool_t apr_pool_t; @@ -174,13 +180,37 @@ APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse); */ APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void); +/** + * Tag a pool (give it a name) + * @param pool The pool to tag + * @param tag The tag + */ +APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag); + +/** + * Lock a pool + * @param pool The pool to lock + * @param flag The flag + */ +APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); + /* @} */ #else -# ifdef apr_pool_join -# undef apr_pool_join -# endif -# define apr_pool_join(a,b) +# ifdef apr_pool_join +# undef apr_pool_join +# endif +# define apr_pool_join(a,b) + +# ifdef apr_pool_tag +# undef apr_pool_tag +# endif +# define apr_pool_tag(pool, tag) + +# ifdef apr_pool_lock +# undef apr_pool_lock +# endif +# define apr_pool_lock(pool, lock) #endif /** @@ -199,38 +229,112 @@ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); /** * Setup all of the internal structures required to use pools - * @param globalp The APR global pool, used to allocate APR structures - * before any other pools are created. This pool should not - * ever be used outside of APR. * @remark Programs do NOT need to call this directly. APR will call this * automatically from apr_initialize. * @internal */ -APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *globalp); +APR_DECLARE(apr_status_t) apr_pool_initialize(void); /** * Tear down all of the internal structures required to use pools - * @param globalp The APR global pool, used to allocate APR structures - * before any other pools are created. This pool should not - * ever be used outside of APR. * @remark Programs do NOT need to call this directly. APR will call this * automatically from apr_terminate. * @internal */ -APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp); +APR_DECLARE(void) apr_pool_terminate(void); /* pool functions */ +#define APR_POOL_FDEFAULT 0x0 +#define APR_POOL_FNEW_ALLOCATOR 0x1 +#define APR_POOL_FLOCK 0x2 + +/** + * Create a new pool. + * @param newpool The pool we have just created. + * @param parent The parent pool. If this is NULL, the new pool is a root + * pool. If it is non-NULL, the new pool will inherit all + * of its parent pool's attributes, except the apr_pool_t will + * be a sub-pool. + * @param apr_abort A function to use if the pool cannot allocate more memory. + * @param flags Flags indicating how the pool should be created: + * - POOL_FNEW_ALLOCATOR will create a new allocator for the pool + * instead of using the allocator of the parent. + * - POOL_FLOCK will create a mutex for the newly created allocator + * (this flag only makes sense in combination with POOL_FNEW_ALLOCATOR) + * + */ +APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_uint32_t flags); + /** * Create a new pool. - * @param newcont The pool we have just created. - * @param cont The parent pool. If this is NULL, the new pool is a root + * @param newpool The pool we have just created. + * @param parent The parent pool. If this is NULL, the new pool is a root * pool. If it is non-NULL, the new pool will inherit all * of its parent pool's attributes, except the apr_pool_t will * be a sub-pool. */ -APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newcont, - apr_pool_t *cont); +#if defined(DOXYGEN) +APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, + apr_pool_t *parent); +#else +#define apr_pool_create(newpool, parent) \ + apr_pool_create_ex(newpool, parent, NULL, APR_POOL_FDEFAULT) +#endif + +/** + * This function is deprecated. Use apr_pool_create_ex. + * @param newpool The new sub-pool + * @param parent The pool to use as a parent pool + * @param apr_abort A function to use if the pool cannot allocate more memory. + * @deffunc void apr_pool_sub_make(apr_pool_t **p, apr_pool_t *parent, int (*apr_abort)(int retcode), const char *created) + * @remark The @a apr_abort function provides a way to quit the program if the + * machine is out of memory. By default, APR will return on error. + */ +#if defined(DOXYGEN) +APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **newpool, + apr_pool_t *parent, + int (*apr_abort)(int retcode)); +#else +#define apr_pool_sub_make(newpool, parent, abort_fn) \ + (void)apr_pool_create_ex(newpool, parent, abort_fn, APR_POOL_FDEFAULT); +#endif + +/** + * Allocate a block of memory from a pool + * @param p The pool to allocate from + * @param reqsize The amount of memory to allocate + * @return The allocated memory + */ +APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t reqsize); + +/** + * Allocate a block of memory from a pool and set all of the memory to 0 + * @param p The pool to allocate from + * @param size The amount of memory to allocate + * @return The allocated memory + */ +APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); + +/** + * Clear all memory in the pool and run all the cleanups. This also clears all + * subpools. + * @param p The pool to clear + * @remark This does not actually free the memory, it just allows the pool + * to re-use this memory for the next allocation. + * @see apr_pool_destroy() + */ +APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); + +/** + * Destroy the pool. This runs apr_pool_clear() and then frees all the memory. + * @param p The pool to destroy + * @remark This will actually free the memory + */ +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); /** * Set the function to be called when an allocation failure occurs. @@ -265,7 +369,7 @@ APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool); * @param data The user data associated with the pool. * @param key The key to use for association * @param cleanup The cleanup program to use to cleanup the data (NULL if none) - * @param cont The current pool + * @param pool The current pool * @warning The data to be attached to the pool should have a life span * at least as long as the pool it is being attached to. * @@ -277,16 +381,16 @@ APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool); * @bug Specify how to ensure this uniqueness! */ APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, - const char *key, - apr_status_t (*cleanup)(void *), - apr_pool_t *cont); + const char *key, + apr_status_t (*cleanup)(void *), + apr_pool_t *pool); /** * Set the data associated with the current pool * @param data The user data associated with the pool. * @param key The key to use for association * @param cleanup The cleanup program to use to cleanup the data (NULL if none) - * @param cont The current pool + * @param pool The current pool * @note same as apr_pool_userdata_set(), except that this version doesn't * make a copy of the key (this function is useful, for example, when * the key is a string literal) @@ -297,71 +401,16 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, const char *key, apr_status_t (*cleanup)(void *), - apr_pool_t *cont); + apr_pool_t *pool); /** * Return the data associated with the current pool. * @param data The user data associated with the pool. * @param key The key for the data to retrieve - * @param cont The current pool. + * @param pool The current pool. */ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, - apr_pool_t *cont); - -/** - * Lock the pool. All the memory is write protected against changes. - * @param p The pool to lock - * @param writeprotect If true the pool's memory is locked read-only, - * otherwise the lock is released - * @remark This is a no-op if the program isn't built with appropriate flags - * on a platform that supports page locking. - */ -APR_DECLARE(void) apr_pool_lock(apr_pool_t *p, int writeprotect); - -/** - * Clear all memory in the pool and run all the cleanups. This also clears all - * subpools. - * @param p The pool to clear - * @remark This does not actually free the memory, it just allows the pool - * to re-use this memory for the next allocation. - * @see apr_pool_destroy() - */ -APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); - -/** - * Destroy the pool. This runs apr_pool_clear() and then frees all the memory. - * @param p The pool to destroy - * @remark This will actually free the memory - */ -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); - -/** - * Allocate a block of memory from a pool - * @param c The pool to allocate from - * @param reqsize The amount of memory to allocate - * @return The allocated memory - */ -APR_DECLARE(void *) apr_palloc(apr_pool_t *c, apr_size_t reqsize); - -/** - * Allocate a block of memory from a pool and set all of the memory to 0 - * @param p The pool to allocate from - * @param size The amount of memory to allocate - * @return The allocated memory - */ -APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); - -/** - * @param p The new sub-pool - * @param parent The pool to use as a parent pool - * @param apr_abort A function to use if the pool cannot allocate more memory. - * @deffunc void apr_pool_sub_make(apr_pool_t **p, apr_pool_t *parent, int (*apr_abort)(int retcode), const char *created) - * @remark The @a apr_abort function provides a way to quit the program if the - * machine is out of memory. By default, APR will return on error. - */ -APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **p, - apr_pool_t *pparent, - int (*apr_abort)(int retcode)); + apr_pool_t *pool); /** * Register a function to be called when a pool is cleared or destroyed @@ -395,8 +444,8 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, * @param child_cleanup The function to register as the child cleanup */ APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup) (void *), - apr_status_t (*child_cleanup) (void *)); + apr_status_t (*plain_cleanup)(void *), + apr_status_t (*child_cleanup)(void *)); /** * Run the specified cleanup function immediately and unregister it. Use @@ -445,27 +494,18 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); * the macros to support other linkages. */ #define APR_POOL_DECLARE_ACCESSOR(typename) \ - APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ - (const apr_##typename##_t *ob) + APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ + (const apr_##typename##_t *ob) #define APR_POOL_IMPLEMENT_ACCESSOR(typename) \ - APR_POOL_IMPLEMENT_ACCESSOR_X(typename, pool) + APR_POOL_IMPLEMENT_ACCESSOR_X(typename, pool) #define APR_POOL_IMPLEMENT_ACCESSOR_X(typename, fieldname) \ - APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ - (const apr_##typename##_t *ob) { return ob->fieldname; } - -/* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t - * will not be destroyed before the parent pool */ -#ifndef APR_POOL_DEBUG -# ifdef apr_pool_join -# undef apr_pool_join -# endif /* apr_pool_join */ -# define apr_pool_join(a,b) -#endif /* APR_POOL_DEBUG */ + APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ + (const apr_##typename##_t *ob) { return ob->fieldname; } /** @} */ #ifdef __cplusplus } #endif -#endif /* !APR_POOLS_H */ +#endif /* !APR_POOLS_H */ diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index b7b0b7e7ba8..76a72dabb59 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -52,23 +52,20 @@ * . */ -/* - * Resource allocation code... the code here is responsible for making - * sure that nothing leaks. - * - * rst --- 4/95 --- 6/95 - */ - #include "apr.h" #include "apr_private.h" +/* TODO: Clean out the #includes */ + #include "apr_portable.h" /* for get_os_proc */ #include "apr_strings.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_lib.h" -#include "apr_lock.h" +#include "apr_thread_mutex.h" #include "apr_hash.h" +#define APR_WANT_MEMFUNC +#include "apr_want.h" #if APR_HAVE_STDIO_H #include @@ -94,7 +91,6 @@ #if APR_HAVE_FCNTL_H #include #endif - #if APR_HAVE_STRING_H #include #endif @@ -105,693 +101,659 @@ #include #endif -/* Details of the debugging options can now be found in the developer - * section of the documentaion. - * ### gjs: where the hell is that? - * - * DEBUG_WITH_MPROTECT: - * This is known to work on Linux systems. It can only be used in - * conjunction with ALLOC_USE_MALLOC (for now). ALLOC_USE_MALLOC will - * use malloc() for *each* allocation, and then free it when the pool - * is cleared. When DEBUG_WITH_MPROTECT is used, the allocation is - * performed using an anonymous mmap() call to get page-aligned memory. - * Rather than free'ing the memory, an mprotect() call is made to make - * the memory non-accessible. Thus, if the memory is referred to *after* - * the pool is cleared, an immediate segfault occurs. :-) - * - * WARNING: Since every allocation creates a new mmap, aligned on a new - * page, this debugging option chews memory. A **LOT** of - * memory. Linux "recovered" the memory from my X Server process - * the first time I ran a "largish" sequence of operations. - * - * ### it should be possible to use this option without ALLOC_USE_MALLOC - * ### and simply mprotect the blocks at clear time (rather than put them - * ### into the free block list). + + +/* + * Magic numbers */ + +#define MIN_ALLOC 8192 +#define MAX_INDEX 20 + +#define BOUNDARY_INDEX 12 +#define BOUNDARY_SIZE (1 << BOUNDARY_INDEX) + /* -#define ALLOC_DEBUG -#define ALLOC_STATS -#define ALLOC_USE_MALLOC -#define DEBUG_WITH_MPROTECT -*/ + * Macros and defines + */ -/* magic numbers --- min free bytes to consider a free apr_pool_t block useable, - * and the min amount to allocate if we have to go to malloc() */ +/* ALIGN() is only to be used to align on a power of 2 boundary */ +#define ALIGN(size, boundary) \ + (((size) + ((boundary) - 1)) & ~((boundary) - 1)) -#ifndef BLOCK_MINFREE -#define BLOCK_MINFREE 4096 -#endif -#ifndef BLOCK_MINALLOC -#define BLOCK_MINALLOC 8192 -#endif - -#ifdef APR_POOL_DEBUG -/* first do some option checking... */ -#ifdef ALLOC_USE_MALLOC -#error "sorry, no support for ALLOC_USE_MALLOC and APR_POOL_DEBUG at the same time" -#endif /* ALLOC_USE_MALLOC */ - -#ifdef MULTITHREAD -# error "sorry, no support for MULTITHREAD and APR_POOL_DEBUG at the same time" -#endif /* MULTITHREAD */ - -#endif /* APR_POOL_DEBUG */ - -#ifdef ALLOC_USE_MALLOC -#undef BLOCK_MINFREE -#undef BLOCK_MINALLOC -#define BLOCK_MINFREE 0 -#define BLOCK_MINALLOC 0 -#endif /* ALLOC_USE_MALLOC */ - -#ifdef DEBUG_WITH_MPROTECT -#ifndef ALLOC_USE_MALLOC -#error "ALLOC_USE_MALLOC must be enabled to use DEBUG_WITH_MPROTECT" -#endif -#ifndef WIN32 -#include -#endif +#define ALIGN_DEFAULT(size) ALIGN(size, 8) + +#if APR_HAS_THREADS +#define LOCK(mutex) \ + do { \ + if (mutex) \ + apr_thread_mutex_lock(mutex); \ + } while(0) + +#define UNLOCK(mutex) \ + do { \ + if (mutex) \ + apr_thread_mutex_unlock(mutex); \ + } while(0) +#else +#define LOCK(mutex) +#define UNLOCK(mutex) #endif +/* + * Structures + */ + +typedef struct cleanup_t cleanup_t; +typedef struct allocator_t allocator_t; +typedef struct node_t node_t; -/** The memory allocation structure +struct node_t { + node_t *next; + apr_uint32_t index; + char *first_avail; + char *endp; +}; + +struct allocator_t { + apr_uint32_t max_index; + apr_thread_mutex_t *mutex; + apr_pool_t *owner; + node_t *free[MAX_INDEX]; +}; + +/* The ref field in the apr_pool_t struct holds a + * pointer to the pointer referencing this pool. + * It is used for parent, child, sibling management. + * Look at apr_pool_create_ex() and apr_pool_destroy() + * to see how it is used. */ struct apr_pool_t { - /** The first block in this pool. */ - union block_hdr *first; - /** The last block in this pool. */ - union block_hdr *last; - /** The list of cleanups to run on pool cleanup. */ - struct cleanup *cleanups; - /** A list of processes to kill when this pool is cleared */ + allocator_t *allocator; + node_t *active; + node_t *self; /* The node containing the pool itself */ + char *self_first_avail; + apr_pool_t *parent; + apr_pool_t *child; + apr_pool_t *sibling; + apr_pool_t **ref; + cleanup_t *cleanups; struct process_chain *subprocesses; - /** The first sub_pool of this pool */ - struct apr_pool_t *sub_pools; - /** The next sibling pool */ - struct apr_pool_t *sub_next; - /** The previous sibling pool */ - struct apr_pool_t *sub_prev; - /** The parent pool of this pool */ - struct apr_pool_t *parent; - /** The first free byte in this pool */ - char *free_first_avail; -#ifdef ALLOC_USE_MALLOC - /** The allocation list if using malloc */ - void *allocation_list; + apr_abortfunc_t abort_fn; + apr_hash_t *user_data; +#if defined(APR_POOL_DEBUG) + const char *tag; #endif -#ifdef APR_POOL_DEBUG - /** a list of joined pools */ - struct apr_pool_t *joined; -#endif - /** A function to control how pools behave when they receive ENOMEM */ - int (*apr_abort)(int retcode); - /** A place to hold user data associated with this pool */ - struct apr_hash_t *prog_data; }; +#define SIZEOF_NODE_T ALIGN_DEFAULT(sizeof(node_t)) +#define SIZEOF_ALLOCATOR_T ALIGN_DEFAULT(sizeof(allocator_t)) +#define SIZEOF_POOL_T ALIGN_DEFAULT(sizeof(apr_pool_t)) -/***************************************************************** - * - * Managing free storage blocks... +/* + * Variables */ -union align { - /* - * Types which are likely to have the longest RELEVANT alignment - * restrictions... - */ - - char *cp; - void (*f) (void); - long l; - FILE *fp; - double d; -}; - -#define CLICK_SZ (sizeof(union align)) - -union block_hdr { - union align a; - - /* Actual header... */ - - struct { - char *endp; - union block_hdr *next; - char *first_avail; -#ifdef APR_POOL_DEBUG - union block_hdr *global_next; - apr_pool_t *owning_pool; -#endif /* APR_POOL_DEBUG */ - } h; +static apr_pool_t *global_pool = NULL; +static apr_byte_t global_allocator_initialized = 0; +static allocator_t global_allocator = { + 0, /* max_index */ + NULL, /* mutex */ + NULL, /* owner */ + { NULL } /* free[0] */ }; - /* - * Static cells for managing our internal synchronisation. + * Memory allocation */ -static union block_hdr *block_freelist = NULL; - -#if APR_HAS_THREADS -static apr_lock_t *alloc_mutex; -#endif -#ifdef APR_POOL_DEBUG -static char *known_stack_point; -static int stack_direction; -static union block_hdr *global_block_list; -#define FREE_POOL ((apr_pool_t *)(-1)) -#endif /* APR_POOL_DEBUG */ - -#ifdef ALLOC_STATS -static apr_uint64_t num_free_blocks_calls; -static apr_uint64_t num_blocks_freed; -static unsigned max_blocks_in_one_free; -static unsigned num_malloc_calls; -static unsigned num_malloc_bytes; -#endif /* ALLOC_STATS */ - -#ifdef ALLOC_DEBUG -#define FILL_BYTE ((char)(0xa5)) -#define debug_fill(ptr,size) ((void)memset((ptr), FILL_BYTE, (size))) - -static APR_INLINE void debug_verify_filled(const char *ptr, const char *endp, - const char *error_msg) +static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) { - for ( ; ptr < endp; ++ptr) { - if (*ptr != FILL_BYTE) { - fputs(error_msg, stderr); - abort(); - exit(1); - } - } -} + node_t *node, **ref; + apr_uint32_t i, index, max_index; -#else /* ALLOC_DEBUG */ -#define debug_fill(a,b) -#define debug_verify_filled(a,b,c) -#endif /* ALLOC_DEBUG */ + /* Round up the block size to the next boundary, but always + * allocate at least a certain size (MIN_ALLOC). + */ + size = ALIGN(size + SIZEOF_NODE_T, BOUNDARY_SIZE); + if (size < MIN_ALLOC) + size = MIN_ALLOC; -#ifdef DEBUG_WITH_MPROTECT + /* Find the index for this node size by + * deviding its size by the boundary size + */ + index = (size >> BOUNDARY_INDEX) - 1; -#define SIZEOF_BLOCK(p) (((union block_hdr *)(p) - 1)->a.l) + /* First see if there are any nodes in the area we know + * our node will fit into. + */ + if (index <= allocator->max_index) { + LOCK(allocator->mutex); + + /* Walk the free list to see if there are + * any nodes on it of the requested size + * + * NOTE: an optimization would be to check + * allocator->free[index] first and if no + * node is present, directly use + * allocator->free[max_index]. This seems + * like overkill though and could cause + * memory waste. + */ + max_index = allocator->max_index; + ref = &allocator->free[index]; + i = index; + while (*ref == NULL && i < max_index) { + ref++; + i++; + } -#ifndef WIN32 + if ((node = *ref) != NULL) { + /* If we have found a node and it doesn't have any + * nodes waiting in line behind it _and_ we are on + * the highest available index, find the new highest + * available index + */ + if ((*ref = node->next) == NULL && i >= max_index) { + do { + ref--; + max_index--; + } + while (*ref == NULL && max_index > 0); + + allocator->max_index = max_index; + } + + node->next = NULL; -static void *mprotect_malloc(apr_size_t size) -{ - union block_hdr * addr; + UNLOCK(allocator->mutex); - size += sizeof(union block_hdr); - - addr = mmap(NULL, size, - PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, - -1, 0); - if (addr == MAP_FAILED) - return NULL; - addr->a.l = size; - return addr + 1; -} + return node; + } -static void mprotect_free(void *addr) -{ - apr_size_t size = SIZEOF_BLOCK(addr); - int rv = mprotect((union block_hdr *)addr - 1, size, PROT_NONE); - if (rv != 0) { - fprintf(stderr, "could not protect. errno=%d\n", errno); - abort(); + UNLOCK(allocator->mutex); } -} - -#else /* WIN32 */ -/* return the number insignificant bits in size, e.g. the typical page - * size of 4096 on x86/WinNT will return 12, as the 12 low-order bits - * in the size aren't relevant to the number of pages. - */ -static int mprotect_pageshift() -{ - static int savesize = 0; - if (!savesize) { - SYSTEM_INFO sysinfo; - GetSystemInfo(&sysinfo); - --sysinfo.dwPageSize; - while (sysinfo.dwPageSize) { - ++savesize; - sysinfo.dwPageSize >>= 1; + /* If we found nothing, seek the sink (at index 0), if + * it is not empty. + */ + else if (allocator->free[0]) { + LOCK(allocator->mutex); + + /* Walk the free list to see if there are + * any nodes on it of the requested size + */ + ref = &allocator->free[0]; + while ((node = *ref) != NULL && index > node->index) + ref = &node->next; + + if (node) { + *ref = node->next; + node->next = NULL; + + UNLOCK(allocator->mutex); + + return node; } + + UNLOCK(allocator->mutex); } - return savesize; -} - -static void *mprotect_malloc(apr_size_t size) -{ - union block_hdr * addr; - int pageshift = mprotect_pageshift(); - size += sizeof(union block_hdr); - size = (((size - 1) >> pageshift) + 1) << pageshift; - addr = VirtualAlloc(NULL, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); - if (!addr) + + /* If we haven't got a suitable node, malloc a new one + * and initialize it. + */ + if ((node = malloc(size)) == NULL) return NULL; - addr->a.l = size; - return addr + 1; -} -static void mprotect_free(void *addr) -{ - apr_size_t size = SIZEOF_BLOCK(addr); - BOOL rv = VirtualFree((union block_hdr *)addr - 1, size, MEM_DECOMMIT); - if (!rv) { - fprintf(stderr, "could not protect. errno=%d\n", errno); - abort(); - } -} + node->next = NULL; + node->index = index; + node->first_avail = (char *)node + SIZEOF_NODE_T; + node->endp = (char *)node + size; -static void mprotect_lock(void *addr, int lock) -{ - size_t size = SIZEOF_BLOCK(addr); - DWORD prot = (lock ? PAGE_READONLY : PAGE_READWRITE); - BOOL rv = VirtualProtect((union block_hdr *)addr - 1, size, prot, &prot); - if (!rv) { - fprintf(stderr, "could not protect. errno=%d\n", errno); - abort(); - } + return node; } -#define DO_LOCK(p,l) mprotect_lock(p,l) -#endif - -static void *mprotect_realloc(void *addr, apr_size_t size) +static APR_INLINE void node_free(allocator_t *allocator, node_t *node) { - void *new_addr = mprotect_malloc(size); - apr_size_t old_size = SIZEOF_BLOCK(addr); - - if (size < old_size) - old_size = size; - memcpy(new_addr, addr, old_size); - mprotect_free(addr); - return new_addr; -} - -#define DO_MALLOC(s) mprotect_malloc(s) -#define DO_FREE(p) mprotect_free(p) -#define DO_REALLOC(p,s) mprotect_realloc(p,s) + node_t *next; + apr_uint32_t index, max_index; -#else /* DEBUG_WITH_MPROTECT */ + LOCK(allocator->mutex); -#define DO_MALLOC(s) malloc(s) -#define DO_FREE(p) free(p) -#define DO_REALLOC(p,s) realloc(p,s) - -#endif /* DEBUG_WITH_MPROTECT */ - -/* - * Get a completely new block from the system pool. Note that we rely on - * malloc() to provide aligned memory. - */ -static union block_hdr *malloc_block(apr_size_t size, apr_abortfunc_t abortfunc) -{ - union block_hdr *blok; + max_index = allocator->max_index; -#ifdef ALLOC_DEBUG - /* make some room at the end which we'll fill and expect to be - * always filled + /* Walk the list of submitted nodes and free them one by one, + * shoving them in the right 'size' buckets as we go. */ - size += CLICK_SZ; -#endif /* ALLOC_DEBUG */ - -#ifdef ALLOC_STATS - ++num_malloc_calls; - num_malloc_bytes += size + sizeof(union block_hdr); -#endif /* ALLOC_STATS */ - - blok = (union block_hdr *) DO_MALLOC(size + sizeof(union block_hdr)); - if (blok == NULL) { - /* ### keep this fprintf here? */ - fprintf(stderr, "Ouch! malloc failed in malloc_block()\n"); - if (abortfunc != NULL) { - (void) (*abortfunc)(APR_ENOMEM); + do { + next = node->next; + index = node->index; + + if (index < MAX_INDEX) { + /* Add the node to the appropiate 'size' bucket. Adjust + * the max_index when appropiate. + */ + if ((node->next = allocator->free[index]) == NULL && index > max_index) { + max_index = index; + } + allocator->free[index] = node; + } + else { + /* This node is too large to keep in a specific size bucket, + * just add it to the sink (at index 0). + */ + node->next = allocator->free[0]; + allocator->free[0] = node; } - return NULL; } + while ((node = next) != NULL); - debug_fill(blok, size + sizeof(union block_hdr)); + allocator->max_index = max_index; - blok->h.next = NULL; - blok->h.first_avail = (char *) (blok + 1); - blok->h.endp = size + blok->h.first_avail; - -#ifdef ALLOC_DEBUG - blok->h.endp -= CLICK_SZ; -#endif /* ALLOC_DEBUG */ + UNLOCK(allocator->mutex); +} -#ifdef APR_POOL_DEBUG - blok->h.global_next = global_block_list; - global_block_list = blok; - blok->h.owning_pool = NULL; -#endif /* APR_POOL_DEBUG */ +APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) +{ + node_t *active, *node; + void *mem; + char *endp; + + size = ALIGN_DEFAULT(size); + active = pool->active; + + /* If the active node has enough bytes left, use it. */ + endp = active->first_avail + size; + if (endp < active->endp) { + mem = active->first_avail; + active->first_avail = endp; + + return mem; + } - return blok; -} + /* Reset the active node, get ourselves a new one and activate it. */ + active->first_avail = (char *)active + SIZEOF_NODE_T; + if ((node = node_malloc(pool->allocator, size)) == NULL) { + active->first_avail = active->endp; + if (pool->abort_fn) + pool->abort_fn(APR_ENOMEM); -#if defined(ALLOC_DEBUG) && !defined(ALLOC_USE_MALLOC) -static void chk_on_blk_list(union block_hdr *blok, union block_hdr *free_blk) -{ - debug_verify_filled(blok->h.endp, blok->h.endp + CLICK_SZ, - "[chk_on_blk_list] Ouch! Someone trounced the padding " - "at the end of a block!\n"); - while (free_blk) { - if (free_blk == blok) { - fprintf(stderr, "Ouch! Freeing free block\n"); - abort(); - exit(1); - } - free_blk = free_blk->h.next; + return NULL; } -} -#else /* defined(ALLOC_DEBUG) && !defined(ALLOC_USE_MALLOC) */ -#define chk_on_blk_list(_x, _y) -#endif /* defined(ALLOC_DEBUG) && !defined(ALLOC_USE_MALLOC) */ -/* Free a chain of blocks --- must be called with alarms blocked. */ + active->next = pool->active = node; -static void free_blocks(union block_hdr *blok) -{ -#ifdef ALLOC_USE_MALLOC - union block_hdr *next; + mem = node->first_avail; + node->first_avail += size; + + return mem; +} - for ( ; blok; blok = next) { - next = blok->h.next; - DO_FREE(blok); +APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) +{ + node_t *active, *node; + void *mem; + char *endp; + + size = ALIGN_DEFAULT(size); + active = pool->active; + + /* If the active node has enough bytes left, use it. */ + endp = active->first_avail + size; + if (endp < active->endp) { + mem = active->first_avail; + active->first_avail = endp; + + memset(mem, 0, size); + + return mem; } -#else /* ALLOC_USE_MALLOC */ -#ifdef ALLOC_STATS - unsigned num_blocks; -#endif /* ALLOC_STATS */ + /* Reset the active node, get ourselves a new one and activate it. */ + active->first_avail = (char *)active + SIZEOF_NODE_T; - /* - * First, put new blocks at the head of the free list --- - * we'll eventually bash the 'next' pointer of the last block - * in the chain to point to the free blocks we already had. - */ + if ((node = node_malloc(pool->allocator, size)) == NULL) { + active->first_avail = active->endp; - union block_hdr *old_free_list; + if (pool->abort_fn) + pool->abort_fn(APR_ENOMEM); - if (blok == NULL) { - return; /* Sanity check --- freeing empty pool? */ + return NULL; } -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_acquire(alloc_mutex); - } -#endif - old_free_list = block_freelist; - block_freelist = blok; + active->next = pool->active = node; - /* - * Next, adjust first_avail pointers of each block --- have to do it - * sooner or later, and it simplifies the search in new_block to do it - * now. - */ + mem = node->first_avail; + node->first_avail += size; + + memset(mem, 0, size); + + return mem; +} -#ifdef ALLOC_STATS - num_blocks = 1; -#endif /* ALLOC_STATS */ +/* + * Pool management + */ - while (blok->h.next != NULL) { +static void run_cleanups(cleanup_t *c); +static void free_proc_chain(struct process_chain *procs); -#ifdef ALLOC_STATS - ++num_blocks; -#endif /* ALLOC_STATS */ +APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) +{ + node_t *active; - chk_on_blk_list(blok, old_free_list); - blok->h.first_avail = (char *) (blok + 1); - debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#ifdef APR_POOL_DEBUG - blok->h.owning_pool = FREE_POOL; -#endif /* APR_POOL_DEBUG */ - blok = blok->h.next; - } + /* Destroy the subpools. The subpools will detach themselves from + * this pool thus this loop is safe and easy. + */ + while (pool->child) + apr_pool_destroy(pool->child); - chk_on_blk_list(blok, old_free_list); - blok->h.first_avail = (char *) (blok + 1); - debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#ifdef APR_POOL_DEBUG - blok->h.owning_pool = FREE_POOL; -#endif /* APR_POOL_DEBUG */ + /* Run cleanups */ + run_cleanups(pool->cleanups); + pool->cleanups = NULL; - /* Finally, reset next pointer to get the old free blocks back */ + /* Free subprocesses */ + free_proc_chain(pool->subprocesses); + pool->subprocesses = NULL; - blok->h.next = old_free_list; + /* Clear the user data. */ + pool->user_data = NULL; -#ifdef ALLOC_STATS - if (num_blocks > max_blocks_in_one_free) { - max_blocks_in_one_free = num_blocks; + /* Reset the active node */ + if ((active = pool->active) == pool->self) { + active->first_avail = pool->self_first_avail; + return; } - ++num_free_blocks_calls; - num_blocks_freed += num_blocks; -#endif /* ALLOC_STATS */ -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_release(alloc_mutex); - } -#endif /* APR_HAS_THREADS */ -#endif /* ALLOC_USE_MALLOC */ + active->first_avail = (char *)active + SIZEOF_NODE_T; + + /* Find the node attached to the pool structure, make + * it the active node and free the rest of the nodes. + */ + active = pool->active = pool->self; + active->first_avail = pool->self_first_avail; + node_free(pool->allocator, active->next); + active->next = NULL; } -/* - * Get a new block, from our own free list if possible, from the system - * if necessary. Must be called with alarms blocked. - */ -static union block_hdr *new_block(apr_size_t min_size, apr_abortfunc_t abortfunc) +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) { - union block_hdr **lastptr = &block_freelist; - union block_hdr *blok = block_freelist; + node_t *node, *active, **ref; + allocator_t *allocator; + apr_thread_mutex_t *mutex; + apr_uint32_t index; - /* First, see if we have anything of the required size - * on the free list... + /* Destroy the subpools. The subpools will detach themselve from + * this pool thus this loop is safe and easy. */ + while (pool->child) + apr_pool_destroy(pool->child); - while (blok != NULL) { - if ((apr_ssize_t)min_size + BLOCK_MINFREE <= blok->h.endp - blok->h.first_avail) { - *lastptr = blok->h.next; - blok->h.next = NULL; - debug_verify_filled(blok->h.first_avail, blok->h.endp, - "[new_block] Ouch! Someone trounced a block " - "on the free list!\n"); - return blok; - } - else { - lastptr = &blok->h.next; - blok = blok->h.next; - } - } + /* Run cleanups */ + run_cleanups(pool->cleanups); - /* Nope. */ + /* Free subprocesses */ + free_proc_chain(pool->subprocesses); - min_size += BLOCK_MINFREE; - blok = malloc_block((min_size > BLOCK_MINALLOC) - ? min_size : BLOCK_MINALLOC, abortfunc); - return blok; -} + /* Remove the pool from the parents child list */ + if (pool->parent) { + mutex = pool->parent->allocator->mutex; + LOCK(mutex); -/* Accounting */ -#ifdef APR_POOL_DEBUG -static apr_size_t bytes_in_block_list(union block_hdr *blok) -{ - apr_size_t size = 0; + if ((*pool->ref = pool->sibling) != NULL) + pool->sibling->ref = pool->ref; - while (blok) { - size += blok->h.endp - (char *) (blok + 1); - blok = blok->h.next; + UNLOCK(mutex); } + + /* Reset the active block */ + active = pool->active; + active->first_avail = (char *)active + SIZEOF_NODE_T; - return size; -} -#endif - -/***************************************************************** - * - * Pool internals and management... - * NB that subprocesses are not handled by the generic cleanup code, - * basically because we don't want cleanups for multiple subprocesses - * to result in multiple three-second pauses. - */ - -struct process_chain; -struct cleanup; - -static void run_cleanups(struct cleanup *c); -static void free_proc_chain(struct process_chain *p); + /* Find the block attached to the pool structure. Save a copy of the + * allocator pointer, because the pool struct soon will be no more. + */ + allocator = pool->allocator; + active = pool->self; + active->first_avail = (char *)active + SIZEOF_NODE_T; + + /* If this pool happens to be the owner of the allocator, free + * everything in the allocator (that includes the pool struct + * and the allocator). Don't worry about destroying the optional mutex + * in the allocator, it will have been destroyed by the cleanup function. + */ + if (allocator->owner == pool) { + for (index = 0; index < MAX_INDEX; index++) { + ref = &allocator->free[index]; + while ((node = *ref) != NULL) { + *ref = node->next; + free(node); + } + } + + ref = &active; + while ((node = *ref) != NULL) { + *ref = node->next; + free(node); + } + + return; + } -static apr_pool_t *permanent_pool; + /* Free all the nodes in the pool (including the node holding the + * pool struct), by giving them back to the allocator. + */ + node_free(allocator, active); +} -/* Each pool structure is allocated in the start of its own first block, - * so we need to know how many bytes that is (once properly aligned...). - * This also means that when a pool's sub-pool is destroyed, the storage - * associated with it is *completely* gone, so we have to make sure it - * gets taken off the parent's sub-pool list... - */ +APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_uint32_t flags) +{ + apr_pool_t *pool; + node_t *node; + allocator_t *allocator, *new_allocator; + apr_status_t rv; -#define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) -#define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) + *newpool = NULL; -APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **p, - apr_pool_t *parent, - apr_abortfunc_t abortfunc) -{ - union block_hdr *blok; - apr_pool_t *new_pool; + if (!parent) + parent = global_pool; + allocator = parent ? parent->allocator : &global_allocator; + if ((node = node_malloc(allocator, MIN_ALLOC - SIZEOF_NODE_T)) == NULL) { + if (abort_fn) + abort_fn(APR_ENOMEM); -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_acquire(alloc_mutex); + return APR_ENOMEM; } -#endif - blok = new_block(POOL_HDR_BYTES, abortfunc); - new_pool = (apr_pool_t *) blok->h.first_avail; - blok->h.first_avail += POOL_HDR_BYTES; -#ifdef APR_POOL_DEBUG - blok->h.owning_pool = new_pool; + if ((flags & APR_POOL_FNEW_ALLOCATOR) == APR_POOL_FNEW_ALLOCATOR) { + new_allocator = (allocator_t *)node->first_avail; + pool = (apr_pool_t *)((char *)new_allocator + SIZEOF_ALLOCATOR_T); + node->first_avail = pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; + + memset(new_allocator, 0, SIZEOF_ALLOCATOR_T); + new_allocator->owner = pool; + + pool->allocator = new_allocator; + pool->active = pool->self = node; + pool->abort_fn = abort_fn; + pool->child = NULL; + pool->cleanups = NULL; + pool->subprocesses = NULL; + pool->user_data = NULL; +#if defined(APR_POOL_DEBUG) + pool->tag = NULL; #endif - memset((char *) new_pool, '\0', sizeof(struct apr_pool_t)); - new_pool->free_first_avail = blok->h.first_avail; - new_pool->first = new_pool->last = blok; - - if (parent) { - new_pool->parent = parent; - new_pool->sub_next = parent->sub_pools; - if (new_pool->sub_next) { - new_pool->sub_next->sub_prev = new_pool; - } - parent->sub_pools = new_pool; - } - #if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_release(alloc_mutex); + if ((flags & APR_POOL_FLOCK) == APR_POOL_FLOCK) { + if ((rv = apr_thread_mutex_create(&allocator->mutex, + APR_THREAD_MUTEX_DEFAULT, pool)) != APR_SUCCESS) { + node_free(allocator, node); + return rv; + } + } +#endif } + else { + pool = (apr_pool_t *)node->first_avail; + node->first_avail = pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; + + pool->allocator = allocator; + pool->active = pool->self = node; + pool->abort_fn = abort_fn; + pool->child = NULL; + pool->cleanups = NULL; + pool->subprocesses = NULL; + pool->user_data = NULL; +#if defined(APR_POOL_DEBUG) + pool->tag = NULL; #endif + } - *p = new_pool; -} + if ((pool->parent = parent) != NULL) { + LOCK(allocator->mutex); -#ifdef APR_POOL_DEBUG -static void stack_var_init(char *s) -{ - char t; + if ((pool->sibling = parent->child) != NULL) + pool->sibling->ref = &pool->sibling; + + parent->child = pool; + pool->ref = &parent->child; - if (s < &t) { - stack_direction = 1; /* stack grows up */ + UNLOCK(allocator->mutex); } else { - stack_direction = -1; /* stack grows down */ + pool->sibling = NULL; + pool->ref = NULL; } + + *newpool = pool; + + return APR_SUCCESS; } -#endif -#ifdef ALLOC_STATS -static void dump_stats(void) +APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abort_fn, + apr_pool_t *pool) { - fprintf(stderr, - "alloc_stats: [%d] #free_blocks %" APR_INT64_T_FMT - " #blocks %" APR_INT64_T_FMT - " max %u #malloc %u #bytes %u\n", - (int) getpid(), - num_free_blocks_calls, - num_blocks_freed, - max_blocks_in_one_free, - num_malloc_calls, - num_malloc_bytes); + pool->abort_fn = abort_fn; } -#endif -/* ### why do we have this, in addition to apr_pool_sub_make? */ -APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, - apr_pool_t *parent_pool) +APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool) { - apr_abortfunc_t abortfunc; - apr_pool_t *ppool; + return pool->abort_fn; +} - abortfunc = parent_pool ? parent_pool->apr_abort : NULL; - ppool = parent_pool ? parent_pool : permanent_pool; +APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool) +{ + return pool->parent; +} - apr_pool_sub_make(newpool, ppool, abortfunc); - if (*newpool == NULL) { - return APR_ENOPOOL; - } +/* return TRUE if a is an ancestor of b + * NULL is considered an ancestor of all pools + */ +APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) +{ + if (a == NULL) + return 1; - (*newpool)->prog_data = NULL; - (*newpool)->apr_abort = abortfunc; + while (b) { + if (a == b) + return 1; - return APR_SUCCESS; -} + b = b->parent; + } -APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abortfunc, - apr_pool_t *pool) -{ - pool->apr_abort = abortfunc; + return 0; } -APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool) +/* + * Initialization + */ + +APR_DECLARE(apr_status_t) apr_pool_initialize(void) { - return pool->apr_abort; + apr_status_t rv; + + if (global_allocator_initialized++) + return APR_SUCCESS; + + memset(&global_allocator, 0, SIZEOF_ALLOCATOR_T); + + if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, APR_POOL_FDEFAULT)) != APR_SUCCESS) { + return rv; + } + +#if APR_HAS_THREADS + if ((rv = apr_thread_mutex_create(&global_allocator.mutex, + APR_THREAD_MUTEX_DEFAULT, global_pool)) != APR_SUCCESS) { + return rv; + } +#endif + + global_allocator.owner = global_pool; + global_allocator_initialized = 1; + + return APR_SUCCESS; } -APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool) +APR_DECLARE(void) apr_pool_terminate(void) { - return pool->parent; + if (!global_allocator_initialized) + return; + + global_allocator_initialized = 0; + + apr_pool_destroy(global_pool); /* This will also destroy the mutex */ + global_pool = NULL; + + memset(&global_allocator, 0, SIZEOF_ALLOCATOR_T); } -/***************************************************************** - * - * Managing generic cleanups. +/* + * Cleanup */ -struct cleanup { +struct cleanup_t { + struct cleanup_t *next; const void *data; - apr_status_t (*plain_cleanup) (void *); - apr_status_t (*child_cleanup) (void *); - struct cleanup *next; + apr_status_t (*plain_cleanup_fn)(void *data); + apr_status_t (*child_cleanup_fn)(void *data); }; APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup) (void *), - apr_status_t (*child_cleanup) (void *)) + apr_status_t (*plain_cleanup_fn)(void *data), + apr_status_t (*child_cleanup_fn)(void *data)) { - struct cleanup *c; + cleanup_t *c; if (p != NULL) { - c = (struct cleanup *) apr_palloc(p, sizeof(struct cleanup)); + c = (cleanup_t *) apr_palloc(p, sizeof(cleanup_t)); c->data = data; - c->plain_cleanup = plain_cleanup; - c->child_cleanup = child_cleanup; + c->plain_cleanup_fn = plain_cleanup_fn; + c->child_cleanup_fn = child_cleanup_fn; c->next = p->cleanups; p->cleanups = c; } } APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup) (void *)) + apr_status_t (*cleanup_fn)(void *)) { - struct cleanup *c; - struct cleanup **lastp; + cleanup_t *c, **lastp; if (p == NULL) return; + c = p->cleanups; lastp = &p->cleanups; while (c) { - if (c->data == data && c->plain_cleanup == cleanup) { + if (c->data == data && c->plain_cleanup_fn == cleanup_fn) { *lastp = c->next; break; } @@ -802,17 +764,18 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, } APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup) (void *), - apr_status_t (*child_cleanup) (void *)) + apr_status_t (*plain_cleanup_fn) (void *), + apr_status_t (*child_cleanup_fn) (void *)) { - struct cleanup *c; + cleanup_t *c; if (p == NULL) return; + c = p->cleanups; while (c) { - if (c->data == data && c->plain_cleanup == plain_cleanup) { - c->child_cleanup = child_cleanup; + if (c->data == data && c->plain_cleanup_fn == plain_cleanup_fn) { + c->child_cleanup_fn = child_cleanup_fn; break; } @@ -821,25 +784,25 @@ APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, } APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, - apr_status_t (*cleanup) (void *)) + apr_status_t (*cleanup_fn) (void *)) { - apr_pool_cleanup_kill(p, data, cleanup); - return (*cleanup) (data); + apr_pool_cleanup_kill(p, data, cleanup_fn); + return (*cleanup_fn)(data); } -static void run_cleanups(struct cleanup *c) +static void run_cleanups(cleanup_t *c) { while (c) { - (*c->plain_cleanup) ((void *)c->data); - c = c->next; + (*c->plain_cleanup_fn)((void *)c->data); + c = c->next; } } -static void run_child_cleanups(struct cleanup *c) +static void run_child_cleanups(cleanup_t *c) { while (c) { - (*c->child_cleanup) ((void *)c->data); - c = c->next; + (*c->child_cleanup_fn)((void *)c->data); + c = c->next; } } @@ -848,9 +811,8 @@ static void cleanup_pool_for_exec(apr_pool_t *p) run_child_cleanups(p->cleanups); p->cleanups = NULL; - for (p = p->sub_pools; p; p = p->sub_next) { - cleanup_pool_for_exec(p); - } + for (p = p->child; p; p = p->sibling) + cleanup_pool_for_exec(p); } APR_DECLARE(void) apr_pool_cleanup_for_exec(void) @@ -865,8 +827,8 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void) * I can do about that (except if the child decides * to go out and close them */ - cleanup_pool_for_exec(permanent_pool); -#endif /* ndef WIN32 */ + cleanup_pool_for_exec(global_pool); +#endif /* !defined(WIN32) && !defined(OS2) */ } APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) @@ -875,445 +837,74 @@ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pool_alloc_init(apr_pool_t *globalp) -{ -#if APR_HAS_THREADS - apr_status_t status; -#endif -#ifdef APR_POOL_DEBUG - char s; - - known_stack_point = &s; - stack_var_init(&s); -#endif -#if APR_HAS_THREADS - status = apr_lock_create(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, - NULL, globalp); - if (status != APR_SUCCESS) { - return status; - } -#endif - permanent_pool = globalp; - -#ifdef ALLOC_STATS - atexit(dump_stats); -#endif - - return APR_SUCCESS; -} - -APR_DECLARE(void) apr_pool_alloc_term(apr_pool_t *globalp) -{ -#if APR_HAS_THREADS - apr_lock_destroy(alloc_mutex); - alloc_mutex = NULL; -#endif - apr_pool_destroy(globalp); -} - -APR_DECLARE(void) apr_pool_lock(apr_pool_t *a, int l) -{ -#ifdef ALLOC_USE_MALLOC -#ifdef DO_LOCK - /* lock the subpools. */ - apr_pool_t *s; - void *c, *n; - - for (s = a->sub_pools; s; s = s->sub_next) { - apr_pool_lock(s, l); - } - - for (c = a->allocation_list; c; c = n) { - n = *(void **)c; - DO_LOCK(c, l); - } -#endif -#endif -} - -/* We only want to lock the mutex if we are being called from apr_pool_clear. - * This is because if we also call this function from apr_destroy_real_pool, - * which also locks the same mutex, and recursive locks aren't portable. - * This way, we are garaunteed that we only lock this mutex once when calling - * either one of these functions. +/* + * Debug functions */ -APR_DECLARE(void) apr_pool_clear(apr_pool_t *a) -{ - /* free the subpools. we can just loop -- the subpools will detach - themselve from us, so this is easy. */ - while (a->sub_pools) { - apr_pool_destroy(a->sub_pools); - } - /* run cleanups and free any subprocesses. */ - run_cleanups(a->cleanups); - a->cleanups = NULL; - free_proc_chain(a->subprocesses); - a->subprocesses = NULL; - - /* free the pool's blocks, *except* for the first one. the actual pool - structure is contained in the first block. this also gives us some - ready memory for reallocating within this pool. */ - free_blocks(a->first->h.next); - a->first->h.next = NULL; - - /* this was allocated in self, or a subpool of self. it simply - disappears, so forget the hash table. */ - a->prog_data = NULL; - - /* no other blocks, so the last block is the first. */ - a->last = a->first; - - /* "free_first_avail" is the original first_avail when the pool was - constructed. (kind of a misnomer, but it means "when freeing, use - this as the first available ptr) - - restore the first/only block avail pointer, effectively resetting - the block to empty (except for the pool structure). */ - a->first->h.first_avail = a->free_first_avail; - debug_fill(a->first->h.first_avail, - a->first->h.endp - a->first->h.first_avail); - -#ifdef ALLOC_USE_MALLOC - { - void *c, *n; - - for (c = a->allocation_list; c; c = n) { - n = *(void **)c; - DO_FREE(c); - } - a->allocation_list = NULL; - } -#endif -} - -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *a) +#if defined(APR_POOL_DEBUG) +APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag) { - union block_hdr *blok; - - /* toss everything in the pool. */ - apr_pool_clear(a); - -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_acquire(alloc_mutex); - } -#endif - - /* detach this pool from its parent. */ - if (a->parent) { - if (a->parent->sub_pools == a) { - a->parent->sub_pools = a->sub_next; - } - if (a->sub_prev) { - a->sub_prev->sub_next = a->sub_next; - } - if (a->sub_next) { - a->sub_next->sub_prev = a->sub_prev; - } - } - -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_release(alloc_mutex); - } -#endif - - /* freeing the first block will include the pool structure. to prevent - a double call to apr_pool_destroy, we want to fill a NULL into - a->first so that the second call (or any attempted usage of the - pool) will segfault on a deref. - - Note: when ALLOC_DEBUG is on, the free'd blocks are filled with - 0xa5. That will cause future use of this pool to die since the pool - structure resides within the block's 0xa5 overwrite area. However, - we want this to fail much more regularly, so stash the NULL. - */ - blok = a->first; - a->first = NULL; - free_blocks(blok); + pool->tag = tag; } - -/***************************************************************** - * APR_POOL_DEBUG support - */ -#ifdef APR_POOL_DEBUG - APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse) { - apr_size_t total_bytes = bytes_in_block_list(p->first); - - if (recurse) - for (p = p->sub_pools; p != NULL; p = p->sub_next) - total_bytes += apr_pool_num_bytes(p, 1); - - return total_bytes; -} - -APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void) -{ - return bytes_in_block_list(block_freelist); -} - -/* the unix linker defines this symbol as the last byte + 1 of - * the executable... so it includes TEXT, BSS, and DATA - */ -#ifdef HAVE__END -extern char _end; -#endif - -/* is ptr in the range [lo,hi) */ -#define is_ptr_in_range(ptr, lo, hi) \ - (((unsigned long)(ptr) - (unsigned long)(lo)) \ - < (unsigned long)(hi) - (unsigned long)(lo)) - -/* Find the pool that ts belongs to, return NULL if it doesn't - * belong to any pool. - */ -APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts) -{ - const char *s = ts; - union block_hdr **pb; - union block_hdr *b; - -#ifdef HAVE__END - /* short-circuit stuff which is in TEXT, BSS, or DATA */ - if (is_ptr_in_range(s, 0, &_end)) { - return NULL; - } -#endif - /* consider stuff on the stack to also be in the NULL pool... - * XXX: there's cases where we don't want to assume this - */ - if ((stack_direction == -1 && is_ptr_in_range(s, &ts, known_stack_point)) - || (stack_direction == 1 && is_ptr_in_range(s, known_stack_point, &ts))) { -#ifdef HAVE__END - abort(); -#endif - return NULL; - } - /* search the global_block_list */ - for (pb = &global_block_list; *pb; pb = &b->h.global_next) { - b = *pb; - if (is_ptr_in_range(s, b, b->h.endp)) { - if (b->h.owning_pool == FREE_POOL) { - fprintf(stderr, - "Ouch! find_pool() called on pointer in a free block\n"); - abort(); - exit(1); - } - if (b != global_block_list) { - /* - * promote b to front of list, this is a hack to speed - * up the lookup - */ - *pb = b->h.global_next; - b->h.global_next = global_block_list; - global_block_list = b; - } - return b->h.owning_pool; - } - } - return NULL; -} - -/* - * All blocks belonging to sub will be changed to point to p - * instead. This is a guarantee by the caller that sub will not - * be destroyed before p is. - */ -APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) -{ - union block_hdr *b; - - /* We could handle more general cases... but this is it for now. */ - if (sub->parent != p) { - fprintf(stderr, "pool_join: p is not parent of sub\n"); - abort(); - } - while (p->joined) { - p = p->joined; - } - sub->joined = p; - for (b = global_block_list; b; b = b->h.global_next) { - if (b->h.owning_pool == sub) { - b->h.owning_pool = p; - } - } -} -#endif - -/* return TRUE iff a is an ancestor of b - * NULL is considered an ancestor of all pools - */ -APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) -{ - if (a == NULL) { - return 1; - } -#ifdef APR_POOL_DEBUG - while (a && a->joined) { - a = a->joined; - } -#endif - while (b) { - if (a == b) { - return 1; - } - b = b->parent; - } return 0; } - -/***************************************************************** - * - * Allocating stuff... - */ - -APR_DECLARE(void*) apr_palloc(apr_pool_t *a, apr_size_t reqsize) -{ -#ifdef ALLOC_USE_MALLOC - apr_size_t size = reqsize + CLICK_SZ; - void *ptr; - - ptr = DO_MALLOC(size); - if (ptr == NULL) { - fputs("Ouch! Out of memory!\n", stderr); - exit(1); - } - debug_fill(ptr, size); /* might as well get uninitialized protection */ - *(void **)ptr = a->allocation_list; - a->allocation_list = ptr; - return (char *)ptr + CLICK_SZ; -#else - - /* - * Round up requested size to an even number of alignment units - * (core clicks) - */ - apr_size_t nclicks; - apr_size_t size; - - /* First, see if we have space in the block most recently - * allocated to this pool - */ - - union block_hdr *blok; - char *first_avail; - char *new_first_avail; - - nclicks = 1 + ((reqsize - 1) / CLICK_SZ); - size = nclicks * CLICK_SZ; - - /* First, see if we have space in the block most recently - * allocated to this pool - */ - - blok = a->last; - first_avail = blok->h.first_avail; - - if (reqsize <= 0) { - return NULL; - } - - new_first_avail = first_avail + size; - - if (new_first_avail <= blok->h.endp) { - debug_verify_filled(first_avail, blok->h.endp, - "[apr_palloc] Ouch! Someone trounced past the end " - "of their allocation!\n"); - blok->h.first_avail = new_first_avail; - return (void *) first_avail; - } - - /* Nope --- get a new one that's guaranteed to be big enough */ - -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_acquire(alloc_mutex); - } #endif - blok = new_block(size, a->apr_abort); - a->last->h.next = blok; - a->last = blok; -#ifdef APR_POOL_DEBUG - blok->h.owning_pool = a; -#endif - -#if APR_HAS_THREADS - if (alloc_mutex) { - apr_lock_release(alloc_mutex); - } -#endif - - first_avail = blok->h.first_avail; - blok->h.first_avail += size; - - return (void *) first_avail; -#endif -} - -APR_DECLARE(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) -{ - void *res = apr_palloc(a, size); - memset(res, '\0', size); - return res; -} - -/***************************************************************** - * - * User data management functions +/* + * User data management */ APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_pool_t *cont) + apr_status_t (*cleanup) (void *), + apr_pool_t *pool) { - if (cont->prog_data == NULL) - cont->prog_data = apr_hash_make(cont); + if (pool->user_data == NULL) + pool->user_data = apr_hash_make(pool); - if (apr_hash_get(cont->prog_data, key, APR_HASH_KEY_STRING) == NULL){ - char *new_key = apr_pstrdup(cont, key); - apr_hash_set(cont->prog_data, new_key, APR_HASH_KEY_STRING, data); + if (apr_hash_get(pool->user_data, key, APR_HASH_KEY_STRING) == NULL) { + char *new_key = apr_pstrdup(pool, key); + apr_hash_set(pool->user_data, new_key, APR_HASH_KEY_STRING, data); } else { - apr_hash_set(cont->prog_data, key, APR_HASH_KEY_STRING, data); + apr_hash_set(pool->user_data, key, APR_HASH_KEY_STRING, data); } - if (cleanup) { - apr_pool_cleanup_register(cont, data, cleanup, cleanup); - } + if (cleanup) + apr_pool_cleanup_register(pool, data, cleanup, cleanup); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_pool_t *cont) + apr_status_t (*cleanup) (void *), + apr_pool_t *pool) { - if (cont->prog_data == NULL) - cont->prog_data = apr_hash_make(cont); + if (pool->user_data == NULL) + pool->user_data = apr_hash_make(pool); - apr_hash_set(cont->prog_data, key, APR_HASH_KEY_STRING, data); + apr_hash_set(pool->user_data, key, APR_HASH_KEY_STRING, data); - if (cleanup) { - apr_pool_cleanup_register(cont, data, cleanup, cleanup); - } + if (cleanup) + apr_pool_cleanup_register(pool, data, cleanup, cleanup); + return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *pool) { - if (cont->prog_data == NULL) + if (pool->user_data == NULL) *data = NULL; else - *data = apr_hash_get(cont->prog_data, key, APR_HASH_KEY_STRING); + *data = apr_hash_get(pool->user_data, key, APR_HASH_KEY_STRING); + return APR_SUCCESS; } -/***************************************************************** - * + +/* * "Print" functions */ @@ -1333,133 +924,87 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, ap struct psprintf_data { apr_vformatter_buff_t vbuff; -#ifdef ALLOC_USE_MALLOC - char *base; -#else - union block_hdr *blok; - int got_a_new_block; -#endif + node_t *node; + allocator_t *allocator; + apr_byte_t got_a_new_node; + node_t *free; }; static int psprintf_flush(apr_vformatter_buff_t *vbuff) { struct psprintf_data *ps = (struct psprintf_data *)vbuff; -#ifdef ALLOC_USE_MALLOC - apr_size_t size; - char *ptr; - - size = (char *)ps->vbuff.curpos - ps->base; - ptr = DO_REALLOC(ps->base, 2*size); - if (ptr == NULL) { - fputs("Ouch! Out of memory!\n", stderr); - exit(1); - } - ps->base = ptr; - ps->vbuff.curpos = ptr + size; - ps->vbuff.endpos = ptr + 2*size - 1; - return 0; -#else - union block_hdr *blok; - union block_hdr *nblok; + node_t *node, *active; apr_size_t cur_len; char *strp; + allocator_t *allocator; - blok = ps->blok; + allocator = ps->allocator; + node = ps->node; strp = ps->vbuff.curpos; - cur_len = strp - blok->h.first_avail; + cur_len = strp - node->first_avail; - /* must try another blok */ -#if APR_HAS_THREADS - apr_lock_acquire(alloc_mutex); -#endif - nblok = new_block(2 * cur_len, NULL); -#if APR_HAS_THREADS - apr_lock_release(alloc_mutex); -#endif - memcpy(nblok->h.first_avail, blok->h.first_avail, cur_len); - ps->vbuff.curpos = nblok->h.first_avail + cur_len; - /* save a byte for the NUL terminator */ - ps->vbuff.endpos = nblok->h.endp - 1; - - /* did we allocate the current blok? if so free it up */ - if (ps->got_a_new_block) { - debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#if APR_HAS_THREADS - apr_lock_acquire(alloc_mutex); -#endif - blok->h.next = block_freelist; - block_freelist = blok; -#if APR_HAS_THREADS - apr_lock_release(alloc_mutex); -#endif + if ((active = node_malloc(allocator, cur_len << 1)) == NULL) + return -1; + + memcpy(active->first_avail, node->first_avail, cur_len); + + /* Reset the previous active node */ + node->first_avail = (char *)node + SIZEOF_NODE_T; + + if (ps->got_a_new_node) { + node->next = ps->free; + ps->free = node; } - ps->blok = nblok; - ps->got_a_new_block = 1; - /* note that we've deliberately not linked the new block onto - * the pool yet... because we may need to flush again later, and - * we'd have to spend more effort trying to unlink the block. - */ + + ps->node = active; + ps->vbuff.curpos = active->first_avail + cur_len; + ps->vbuff.endpos = active->endp - 1; /* Save a byte for NUL terminator */ + ps->got_a_new_node = 1; + return 0; -#endif } -APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) +APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) { -#ifdef ALLOC_USE_MALLOC - struct psprintf_data ps; - void *ptr; - - ps.base = DO_MALLOC(512); - if (ps.base == NULL) { - fputs("Ouch! Out of memory!\n", stderr); - exit(1); - } - /* need room at beginning for allocation_list */ - ps.vbuff.curpos = ps.base + CLICK_SZ; - ps.vbuff.endpos = ps.base + 511; - apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); - *ps.vbuff.curpos++ = '\0'; - ptr = ps.base; - /* shrink */ - ptr = DO_REALLOC(ptr, (char *)ps.vbuff.curpos - (char *)ptr); - if (ptr == NULL) { - fputs("Ouch! Out of memory!\n", stderr); - exit(1); - } - *(void **)ptr = p->allocation_list; - p->allocation_list = ptr; - return (char *)ptr + CLICK_SZ; -#else struct psprintf_data ps; char *strp; apr_size_t size; + node_t *active; - ps.blok = p->last; - ps.vbuff.curpos = ps.blok->h.first_avail; - ps.vbuff.endpos = ps.blok->h.endp - 1; /* save one for NUL */ - ps.got_a_new_block = 0; + ps.node = active = pool->active; + ps.allocator = pool->allocator; + ps.vbuff.curpos = ps.node->first_avail; + /* Save a byte for the NUL terminator */ + ps.vbuff.endpos = ps.node->endp - 1; + ps.got_a_new_node = 0; + ps.free = NULL; - apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); + if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) { + if (pool->abort_fn) + pool->abort_fn(APR_ENOMEM); + + return NULL; + } strp = ps.vbuff.curpos; *strp++ = '\0'; - size = strp - ps.blok->h.first_avail; - size = (1 + ((size - 1) / CLICK_SZ)) * CLICK_SZ; - strp = ps.blok->h.first_avail; /* save away result pointer */ - ps.blok->h.first_avail += size; - - /* have to link the block in if it's a new one */ - if (ps.got_a_new_block) { - p->last->h.next = ps.blok; - p->last = ps.blok; -#ifdef APR_POOL_DEBUG - ps.blok->h.owning_pool = p; -#endif + size = strp - ps.node->first_avail; + size = ALIGN_DEFAULT(size); + strp = ps.node->first_avail; + ps.node->first_avail += size; + + /* + * Link the node in if it's a new one + */ + if (ps.got_a_new_node) { + active->next = pool->active = ps.node; } + if (ps.free) + node_free(ps.allocator, ps.free); + return strp; -#endif } APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) @@ -1473,7 +1018,6 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) return res; } - /***************************************************************** * * More grotty system stuff... subprocesses. Frump. These don't use @@ -1485,16 +1029,15 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, +APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *pool, apr_proc_t *pid, enum kill_conditions how) { - struct process_chain *new = - (struct process_chain *) apr_palloc(a, sizeof(struct process_chain)); + struct process_chain *pc = apr_palloc(pool, sizeof(struct process_chain)); - new->pid = pid; - new->kill_how = how; - new->next = a->subprocesses; - a->subprocesses = new; + pc->pid = pid; + pc->kill_how = how; + pc->next = pool->subprocesses; + pool->subprocesses = pc; } static void free_proc_chain(struct process_chain *procs) @@ -1503,12 +1046,11 @@ static void free_proc_chain(struct process_chain *procs) * whatever it was we're cleaning up now. This may involve killing * some of them off... */ - struct process_chain *p; + struct process_chain *pc; int need_timeout = 0; - if (procs == NULL) { - return; /* No work. Whew! */ - } + if (!procs) + return; /* No work. Whew! */ /* First, check to see if we need to do the SIGTERM, sleep, SIGKILL * dance with any of the processes we're cleaning up. If we've got @@ -1519,16 +1061,15 @@ static void free_proc_chain(struct process_chain *procs) #ifndef NEED_WAITPID /* Pick up all defunct processes */ - for (p = procs; p; p = p->next) { - if (apr_proc_wait(p->pid, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE) { - p->kill_how = kill_never; - } + for (pc = procs; pc; pc = pc->next) { + if (apr_proc_wait(pc->pid, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE) + pc->kill_how = kill_never; } #endif - for (p = procs; p; p = p->next) { - if ((p->kill_how == kill_after_timeout) - || (p->kill_how == kill_only_once)) { + for (pc = procs; pc; pc = pc->next) { + if ((pc->kill_how == kill_after_timeout) || + (pc->kill_how == kill_only_once)) { /* * Subprocess may be dead already. Only need the timeout if not. * Note: apr_proc_kill on Windows is TerminateProcess(), which is @@ -1538,35 +1079,32 @@ static void free_proc_chain(struct process_chain *procs) #ifdef WIN32 need_timeout = 1; #else - if (apr_proc_kill(p->pid, SIGTERM) == APR_SUCCESS) { - need_timeout = 1; - } + if (apr_proc_kill(pc->pid, SIGTERM) == APR_SUCCESS) + need_timeout = 1; #endif - } - else if (p->kill_how == kill_always) { - apr_proc_kill(p->pid, SIGKILL); - } + } + else if (pc->kill_how == kill_always) { + apr_proc_kill(pc->pid, SIGKILL); + } } /* Sleep only if we have to... */ - if (need_timeout) { - sleep(3); - } + if (need_timeout) + sleep(3); /* OK, the scripts we just timed out for have had a chance to clean up * --- now, just get rid of them, and also clean up the system accounting * goop... */ - for (p = procs; p; p = p->next) { - if (p->kill_how == kill_after_timeout) { - apr_proc_kill(p->pid, SIGKILL); - } + for (pc = procs; pc; pc = pc->next) { + if (pc->kill_how == kill_after_timeout) + apr_proc_kill(pc->pid, SIGKILL); } + /* Now wait for all the signaled processes to die */ - for (p = procs; p; p = p->next) { - if (p->kill_how != kill_never) { - (void) apr_proc_wait(p->pid, NULL, NULL, APR_WAIT); - } + for (pc = procs; pc; pc = pc->next) { + if (pc->kill_how != kill_never) + (void)apr_proc_wait(pc->pid, NULL, NULL, APR_WAIT); } #ifdef WIN32 /* @@ -1583,7 +1121,7 @@ static void free_proc_chain(struct process_chain *procs) } } } -#endif /* WIN32 */ +#endif /* WIN32 */ } diff --git a/misc/unix/start.c b/misc/unix/start.c index a1c441a86b8..220a0afd1f5 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -64,10 +64,10 @@ static int initialized = 0; -static apr_pool_t *global_apr_pool; APR_DECLARE(apr_status_t) apr_initialize(void) { + apr_pool_t *pool; apr_status_t status; #if defined WIN32 || defined(NETWARE) int iVersionRequested; @@ -82,21 +82,31 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_SUCCESS; } - if (apr_pool_create(&global_apr_pool, NULL) != APR_SUCCESS) { +#if !defined(BEOS) && !defined(OS2) && !defined(WIN32) && !defined(NETWARE) + apr_unix_setup_lock(); + apr_proc_mutex_unix_setup_lock(); + apr_unix_setup_time(); +#endif + +#if defined(NETWARE) + apr_netware_setup_time(); +#endif + + if ((status = apr_pool_initialize()) != APR_SUCCESS) + return status; + + if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { return APR_ENOPOOL; } #ifdef WIN32 /* Initialize apr_os_level global */ - if (apr_get_oslevel(global_apr_pool, &osver) != APR_SUCCESS) { + if (apr_get_oslevel(pool, &osver) != APR_SUCCESS) { return APR_EEXIST; } #endif -#if !defined(BEOS) && !defined(OS2) && !defined(WIN32) && !defined(NETWARE) - apr_unix_setup_lock(); - apr_proc_mutex_unix_setup_lock(); - apr_unix_setup_time(); -#elif defined WIN32 || defined(NETWARE) + +#if defined WIN32 || defined(NETWARE) iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); err = WSAStartup((WORD) iVersionRequested, &wsaData); if (err) { @@ -108,14 +118,8 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_EEXIST; } #endif -#if defined(NETWARE) - apr_netware_setup_time(); -#endif - - if ((status = apr_pool_alloc_init(global_apr_pool)) != APR_SUCCESS) - return status; - - apr_signal_init(global_apr_pool); + + apr_signal_init(pool); return APR_SUCCESS; } @@ -126,7 +130,8 @@ APR_DECLARE_NONSTD(void) apr_terminate(void) if (initialized) { return; } - apr_pool_alloc_term(global_apr_pool); + apr_pool_terminate(); + #if defined(NETWARE) WSACleanup(); #endif From 9043fef309714e8fd5bca24930e033133d6ce849 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 14 Dec 2001 02:41:19 +0000 Subject: [PATCH 2643/7878] Get rid of --enable-assert-memory and -DAPR_ASSERT_MEMORY. These were left over from SMS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62646 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 ----- 1 file changed, 5 deletions(-) diff --git a/configure.in b/configure.in index 6059573d7b1..df76c56436f 100644 --- a/configure.in +++ b/configure.in @@ -165,7 +165,6 @@ AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile tim ])dnl AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and compile time warnings], - [APR_ADDTO(NOTEST_CPPFLAGS,-DAPR_ASSERT_MEMORY) APR_ADDTO(CFLAGS,-g) if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations]) @@ -174,10 +173,6 @@ AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and fi ])dnl -AC_ARG_ENABLE(assert-memory,[ --enable-assert-memory Turn on asserts in the APR memory code],[ - APR_ADDTO(NOTEST_CPPFLAGS,-DAPR_ASSERT_MEMORY) -])dnl - AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build (GCC)], if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS, -pg) From 292eb45770665f913d4030f38a24dc19e6104ce6 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 14 Dec 2001 02:45:15 +0000 Subject: [PATCH 2644/7878] Whoops, shouldn't be doing this at 3:45AM... Put back a character that was accidentally removed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62647 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index df76c56436f..c677938178d 100644 --- a/configure.in +++ b/configure.in @@ -165,7 +165,7 @@ AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile tim ])dnl AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and compile time warnings], - APR_ADDTO(CFLAGS,-g) + [APR_ADDTO(CFLAGS,-g) if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations]) elif test "$AIX_XLC" = "yes"; then From de885074a3f761cf8672e355c1ab9a46abf6d9bf Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 14 Dec 2001 04:35:21 +0000 Subject: [PATCH 2645/7878] remember us pool people working in evil-empire land (variable name was changed in previous commit) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62648 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 76a72dabb59..06e5020a122 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1114,10 +1114,10 @@ static void free_proc_chain(struct process_chain *procs) * finished with the proc_t. */ { - for (p = procs; p; p = p->next) { - if (p->pid->hproc) { - CloseHandle(p->pid->hproc); - p->pid->hproc = NULL; + for (pc = procs; pc; pc = pc->next) { + if (pc->pid->hproc) { + CloseHandle(pc->pid->hproc); + pc->pid->hproc = NULL; } } } From 0b7cdb5b448f3938da562a296b826aff6950ea56 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 14 Dec 2001 09:30:26 +0000 Subject: [PATCH 2646/7878] - Switch a sleep call to apr_sleep - Remove all unnecessary #includes (tested with FreeBSD and Linux gcc with -Wall - may miss other platforms/compilers - please add missing headers as necessary.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62649 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 39 +++------------------------------------ 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 06e5020a122..9a14653fe16 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -55,8 +55,6 @@ #include "apr.h" #include "apr_private.h" -/* TODO: Clean out the #includes */ - #include "apr_portable.h" /* for get_os_proc */ #include "apr_strings.h" #include "apr_general.h" @@ -64,44 +62,13 @@ #include "apr_lib.h" #include "apr_thread_mutex.h" #include "apr_hash.h" +#include "apr_time.h" #define APR_WANT_MEMFUNC #include "apr_want.h" -#if APR_HAVE_STDIO_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#if APR_HAVE_SYS_SIGNAL_H -#include -#endif -#if APR_HAVE_SIGNAL_H -#include -#endif -#if APR_HAVE_SYS_WAIT_H -#include -#endif -#if APR_HAVE_SYS_TYPES_H -#include -#endif -#if APR_HAVE_UNISTD_H -#include -#endif -#if APR_HAVE_FCNTL_H -#include -#endif -#if APR_HAVE_STRING_H -#include -#endif #if APR_HAVE_STDLIB_H -#include +#include /* for malloc and free */ #endif -#ifdef HAVE_MALLOC_H -#include -#endif - - /* * Magic numbers @@ -1090,7 +1057,7 @@ static void free_proc_chain(struct process_chain *procs) /* Sleep only if we have to... */ if (need_timeout) - sleep(3); + apr_sleep(3 * APR_USEC_PER_SEC); /* OK, the scripts we just timed out for have had a chance to clean up * --- now, just get rid of them, and also clean up the system accounting From bd1de029387c36fc675913ec238e6fdea65506ac Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 14 Dec 2001 10:06:19 +0000 Subject: [PATCH 2647/7878] Put new pools code in place which allows applications to switch off locking on pools operations in case a pool is guaranteed to never being used in more than one thread at the same time. We've seen a significant performance improvement over the old code. Reviewed by: Justin Erenkrantz, Brian Pane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62650 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 25bf4240357..57e79f37696 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) Put new pools code in place which allows applications to + switch off locking on pools operations in case a pool is + guaranteed to never being used in more than one thread + at the same time. We've seen a significant performance + improvement over the old code. [Sander Striker] + *) Add apr-config - a shell script to allow third-party programs easy access to APR configuration parameters. [Justin Erenkrantz] From 64b41fe2ede633659516c2572694fb10db9f063e Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 14 Dec 2001 10:43:00 +0000 Subject: [PATCH 2648/7878] Actualize with respect to pools and sms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62651 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 48 +++--------------------------------------------- 1 file changed, 3 insertions(+), 45 deletions(-) diff --git a/STATUS b/STATUS index 1ba620de1ad..698353c66cc 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/14 01:26:03 $] +Last modified at [$Date: 2001/12/14 10:43:00 $] Release: @@ -48,24 +48,13 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Enable pools to have thread-specific locking in it. Status: Sander's pool code has been tested with httpd, flood, - and SVN. It needs to be determined whether we will - wait for the debug code to be finished before - committing. - Patch: - + and SVN. It's in. The debug code needs to be added. + Comparisons/reviews: Ian: <3C083414.1080208@cnet.com> (performance) Brian: <3C07D792.9070301@cnet.com> (code) <3C0D6BB5.6010505@cnet.com> (performance) Justin: <20011205025611.GB22835@ebuilt.com> (code) - Votes: - Sander's patch: - +1: Brian (non-binding), - Ian (once we have a debug version of palloc etc), - Justin - Sander - 0: - -1: * Get OTHER_CHILD support into Win32 Status: Bill S. is looking into this @@ -168,37 +157,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: -- note on Win32 we distinguish 'apache module' names from other 'loadable module' names, so be careful with Apache's directive. - * APR memory code - The SMS code has been removed. The abstraction made it perform - far worse than pools. Pools need probably be revamped to take - a want_new_freelist parameter to get rid of the global locking - on block allocation. - Status: Sander volunteers - - * In line with the new SMS code is the fact that threading and pools - just are not working together well. This is due to the fact that - the pool code has one global mutex (alloc_mutex) and one freelist - (block_freelist) for all pools to share. This means that only - one worker can be allocating memory at any given time. This is - probably the reason why Apache 2.0 is faster with prefork MPM - (thread-disabled APR) than threaded MPM. The solution to this - is most likely to incorporate a rework of the pools to use the new - SMS code and allow certain pools (i.e. request pools in httpd-2.0) - to have an option for no locking (as they can't have contention - by definition). This would mean that the mutex and freelist - must be moved inside of apr_pool_t. Therefore, this is the - jumping-off point into SMS. - Justin: The SMS code has been checked into CVS (see above). - To solve this problem, we want only one trivial SMS - per thread which acts as the parent for all SMSs in - that thread (giving us thread-local allocation). - Each descendant SMS should be something along the - lines of a tracking SMS. That's how I see it anyway. - There are other possibilities. Any of those probably - work as well. See the apr archives for more info. - We're still debating this. - Sander: The SMS code has been removed (see above). - * Possible gmtime_r replacement in explode_time On Solaris (and possibly others), the gmtime_r libc function obtains a mutex. We have seen 21/25 threads being blocked in this mutex on From 6627445d14d229867169a0937c4ed2195298158e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 14 Dec 2001 12:06:59 +0000 Subject: [PATCH 2649/7878] AIX system header files define something called ALIGN(), so prefix our two ALIGN macros with APR_ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62652 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 9a14653fe16..24fa7c27d67 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -84,11 +84,11 @@ * Macros and defines */ -/* ALIGN() is only to be used to align on a power of 2 boundary */ -#define ALIGN(size, boundary) \ +/* APR_ALIGN() is only to be used to align on a power of 2 boundary */ +#define APR_ALIGN(size, boundary) \ (((size) + ((boundary) - 1)) & ~((boundary) - 1)) -#define ALIGN_DEFAULT(size) ALIGN(size, 8) +#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) #if APR_HAS_THREADS #define LOCK(mutex) \ @@ -153,9 +153,9 @@ struct apr_pool_t { #endif }; -#define SIZEOF_NODE_T ALIGN_DEFAULT(sizeof(node_t)) -#define SIZEOF_ALLOCATOR_T ALIGN_DEFAULT(sizeof(allocator_t)) -#define SIZEOF_POOL_T ALIGN_DEFAULT(sizeof(apr_pool_t)) +#define SIZEOF_NODE_T APR_ALIGN_DEFAULT(sizeof(node_t)) +#define SIZEOF_ALLOCATOR_T APR_ALIGN_DEFAULT(sizeof(allocator_t)) +#define SIZEOF_POOL_T APR_ALIGN_DEFAULT(sizeof(apr_pool_t)) /* * Variables @@ -182,7 +182,7 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) /* Round up the block size to the next boundary, but always * allocate at least a certain size (MIN_ALLOC). */ - size = ALIGN(size + SIZEOF_NODE_T, BOUNDARY_SIZE); + size = APR_ALIGN(size + SIZEOF_NODE_T, BOUNDARY_SIZE); if (size < MIN_ALLOC) size = MIN_ALLOC; @@ -326,7 +326,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) void *mem; char *endp; - size = ALIGN_DEFAULT(size); + size = APR_ALIGN_DEFAULT(size); active = pool->active; /* If the active node has enough bytes left, use it. */ @@ -364,7 +364,7 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) void *mem; char *endp; - size = ALIGN_DEFAULT(size); + size = APR_ALIGN_DEFAULT(size); active = pool->active; /* If the active node has enough bytes left, use it. */ @@ -957,7 +957,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) *strp++ = '\0'; size = strp - ps.node->first_avail; - size = ALIGN_DEFAULT(size); + size = APR_ALIGN_DEFAULT(size); strp = ps.node->first_avail; ps.node->first_avail += size; From d1efa919aed41df4c84c3a6666a97263b8acc0b9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 14 Dec 2001 20:14:09 +0000 Subject: [PATCH 2650/7878] get the new pools code to compile when !APR_HAS_THREADS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62653 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 24fa7c27d67..ebbe1dfa562 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -124,7 +124,11 @@ struct node_t { struct allocator_t { apr_uint32_t max_index; +#if APR_HAS_THREADS apr_thread_mutex_t *mutex; +#else + void *mutex; +#endif apr_pool_t *owner; node_t *free[MAX_INDEX]; }; @@ -449,7 +453,11 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) { node_t *node, *active, **ref; allocator_t *allocator; +#if APR_HAS_THREADS apr_thread_mutex_t *mutex; +#else + void *mutex; +#endif apr_uint32_t index; /* Destroy the subpools. The subpools will detach themselve from @@ -524,7 +532,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *pool; node_t *node; allocator_t *allocator, *new_allocator; - apr_status_t rv; *newpool = NULL; @@ -560,6 +567,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, #if APR_HAS_THREADS if ((flags & APR_POOL_FLOCK) == APR_POOL_FLOCK) { + apr_status_t rv; if ((rv = apr_thread_mutex_create(&allocator->mutex, APR_THREAD_MUTEX_DEFAULT, pool)) != APR_SUCCESS) { node_free(allocator, node); From be3386c8803f6a4447a213e08ae07c8d6b756ffa Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 14 Dec 2001 21:43:04 +0000 Subject: [PATCH 2651/7878] fix the name of the shared library for libapr on AIX once we switched to run-time linking, libtool decided we wanted to use a .so file instead of an archive git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62654 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 50d0b43f45e..0df0faf37c2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -102,7 +102,7 @@ export_vars.h: $(AWK) -f $(top_srcdir)/build/make_var_export.awk $(EXPORT_FILES) > $@ apr.exp: exports.c export_vars.h - @echo "#! libapr.a(libapr.so.0)" > $@ + @echo "#! libapr.so" > $@ @echo "* This file was AUTOGENERATED at build time." >> $@ @echo "* Please do not edit by hand." >> $@ $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@ From 5b8e429ac34d8cf41f144bacf78b7dc8474df8ad Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sat, 15 Dec 2001 11:13:45 +0000 Subject: [PATCH 2652/7878] Bring the code more into the style of the rest of APR. Replaced the LOCK/UNLOCK macros with actual code. Previously, with some of the extra #if APR_HAS_THREADS in place, it didn't feel right to use the macros anymore. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62655 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 93 +++++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index ebbe1dfa562..cd842ec693d 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -90,23 +90,6 @@ #define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) -#if APR_HAS_THREADS -#define LOCK(mutex) \ - do { \ - if (mutex) \ - apr_thread_mutex_lock(mutex); \ - } while(0) - -#define UNLOCK(mutex) \ - do { \ - if (mutex) \ - apr_thread_mutex_unlock(mutex); \ - } while(0) -#else -#define LOCK(mutex) -#define UNLOCK(mutex) -#endif - /* * Structures */ @@ -126,8 +109,6 @@ struct allocator_t { apr_uint32_t max_index; #if APR_HAS_THREADS apr_thread_mutex_t *mutex; -#else - void *mutex; #endif apr_pool_t *owner; node_t *free[MAX_INDEX]; @@ -169,7 +150,9 @@ static apr_pool_t *global_pool = NULL; static apr_byte_t global_allocator_initialized = 0; static allocator_t global_allocator = { 0, /* max_index */ +#if APR_HAS_THREADS NULL, /* mutex */ +#endif NULL, /* owner */ { NULL } /* free[0] */ }; @@ -199,8 +182,11 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) * our node will fit into. */ if (index <= allocator->max_index) { - LOCK(allocator->mutex); - +#if APR_HAS_THREADS + if (allocator->mutex) + apr_thread_mutex_lock(allocator->mutex); +#endif + /* Walk the free list to see if there are * any nodes on it of the requested size * @@ -237,19 +223,28 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) node->next = NULL; - UNLOCK(allocator->mutex); +#if APR_HAS_THREADS + if (allocator->mutex) + apr_thread_mutex_unlock(allocator->mutex); +#endif return node; } - UNLOCK(allocator->mutex); +#if APR_HAS_THREADS + if (allocator->mutex) + apr_thread_mutex_unlock(allocator->mutex); +#endif } /* If we found nothing, seek the sink (at index 0), if * it is not empty. */ else if (allocator->free[0]) { - LOCK(allocator->mutex); +#if APR_HAS_THREADS + if (allocator->mutex) + apr_thread_mutex_lock(allocator->mutex); +#endif /* Walk the free list to see if there are * any nodes on it of the requested size @@ -262,12 +257,18 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) *ref = node->next; node->next = NULL; - UNLOCK(allocator->mutex); +#if APR_HAS_THREADS + if (allocator->mutex) + apr_thread_mutex_unlock(allocator->mutex); +#endif return node; } - UNLOCK(allocator->mutex); +#if APR_HAS_THREADS + if (allocator->mutex) + apr_thread_mutex_unlock(allocator->mutex); +#endif } /* If we haven't got a suitable node, malloc a new one @@ -289,7 +290,10 @@ static APR_INLINE void node_free(allocator_t *allocator, node_t *node) node_t *next; apr_uint32_t index, max_index; - LOCK(allocator->mutex); +#if APR_HAS_THREADS + if (allocator->mutex) + apr_thread_mutex_lock(allocator->mutex); +#endif max_index = allocator->max_index; @@ -321,7 +325,10 @@ static APR_INLINE void node_free(allocator_t *allocator, node_t *node) allocator->max_index = max_index; - UNLOCK(allocator->mutex); +#if APR_HAS_THREADS + if (allocator->mutex) + apr_thread_mutex_unlock(allocator->mutex); +#endif } APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) @@ -453,11 +460,6 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) { node_t *node, *active, **ref; allocator_t *allocator; -#if APR_HAS_THREADS - apr_thread_mutex_t *mutex; -#else - void *mutex; -#endif apr_uint32_t index; /* Destroy the subpools. The subpools will detach themselve from @@ -474,14 +476,20 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) /* Remove the pool from the parents child list */ if (pool->parent) { - mutex = pool->parent->allocator->mutex; +#if APR_HAS_THREADS + apr_thread_mutex_t *mutex; - LOCK(mutex); + if ((mutex = pool->parent->allocator->mutex) != NULL) + apr_thread_mutex_lock(mutex); +#endif if ((*pool->ref = pool->sibling) != NULL) pool->sibling->ref = pool->ref; - UNLOCK(mutex); +#if APR_HAS_THREADS + if (mutex) + apr_thread_mutex_unlock(mutex); +#endif } /* Reset the active block */ @@ -568,6 +576,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, #if APR_HAS_THREADS if ((flags & APR_POOL_FLOCK) == APR_POOL_FLOCK) { apr_status_t rv; + if ((rv = apr_thread_mutex_create(&allocator->mutex, APR_THREAD_MUTEX_DEFAULT, pool)) != APR_SUCCESS) { node_free(allocator, node); @@ -593,15 +602,20 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, } if ((pool->parent = parent) != NULL) { - LOCK(allocator->mutex); - +#if APR_HAS_THREADS + if (allocator->mutex) + apr_thread_mutex_lock(allocator->mutex); +#endif if ((pool->sibling = parent->child) != NULL) pool->sibling->ref = &pool->sibling; parent->child = pool; pool->ref = &parent->child; - UNLOCK(allocator->mutex); +#if APR_HAS_THREADS + if (allocator->mutex) + apr_thread_mutex_unlock(allocator->mutex); +#endif } else { pool->sibling = NULL; @@ -1099,4 +1113,3 @@ static void free_proc_chain(struct process_chain *procs) #endif /* WIN32 */ } - From e32c770189026b816a708913e6684fa1e880350b Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 18 Dec 2001 00:43:22 +0000 Subject: [PATCH 2653/7878] We should really be setting the owner of the mutex when we have a thread_mutex, regardless of whether it's nested. This isn't a big performance headache on beos thankfully and does allow us to check the owner for things like conditionals... This came to light during my experimenting with conditionals for beos. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62656 13f79535-47bb-0310-9956-ffa450edef68 --- locks/beos/thread_mutex.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index b0b525565fc..b77c697bbdf 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -118,8 +118,9 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create_np(apr_thread_mutex_t **mutex, APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { int32 stat; + thread_id me = find_thread(NULL); - if (mutex->nested && mutex->owner == find_thread(NULL)) { + if (mutex->nested && mutex->owner == me) { mutex->owner_ref++; return APR_SUCCESS; } @@ -132,10 +133,8 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) } } - if (mutex->nested) { - mutex->owner = find_thread(NULL); - mutex->owner_ref = 1; - } + mutex->owner = me; + mutex->owner_ref = 1; return APR_SUCCESS; } @@ -148,7 +147,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { int32 stat; - + if (mutex->nested && mutex->owner == find_thread(NULL)) { mutex->owner_ref--; if (mutex->owner_ref > 0) @@ -162,10 +161,8 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) } } - if (mutex->nested) { - mutex->owner = -1; - mutex->owner_ref = 0; - } + mutex->owner = -1; + mutex->owner_ref = 0; return APR_SUCCESS; } From 7c0f533cf5a99ea47399ca5230a88ce55091bc25 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 18 Dec 2001 18:55:39 +0000 Subject: [PATCH 2654/7878] Enable apr_pool_tag by default, instead of only when APR_POOL_DEBUG is defined. Suggested by: Jeff Trawick, Brian Pane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62657 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 19 +++++++------------ memory/unix/apr_pools.c | 8 +------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 4e9d664c040..c7cc49ce0a0 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -180,13 +180,6 @@ APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse); */ APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void); -/** - * Tag a pool (give it a name) - * @param pool The pool to tag - * @param tag The tag - */ -APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag); - /** * Lock a pool * @param pool The pool to lock @@ -202,17 +195,19 @@ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); # endif # define apr_pool_join(a,b) -# ifdef apr_pool_tag -# undef apr_pool_tag -# endif -# define apr_pool_tag(pool, tag) - # ifdef apr_pool_lock # undef apr_pool_lock # endif # define apr_pool_lock(pool, lock) #endif +/** + * Tag a pool (give it a name) + * @param pool The pool to tag + * @param tag The tag + */ +APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag); + /** * Determine if pool a is an ancestor of pool b * @param a The pool to search diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index cd842ec693d..54440960a58 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -133,9 +133,7 @@ struct apr_pool_t { struct process_chain *subprocesses; apr_abortfunc_t abort_fn; apr_hash_t *user_data; -#if defined(APR_POOL_DEBUG) const char *tag; -#endif }; #define SIZEOF_NODE_T APR_ALIGN_DEFAULT(sizeof(node_t)) @@ -569,9 +567,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, pool->cleanups = NULL; pool->subprocesses = NULL; pool->user_data = NULL; -#if defined(APR_POOL_DEBUG) pool->tag = NULL; -#endif #if APR_HAS_THREADS if ((flags & APR_POOL_FLOCK) == APR_POOL_FLOCK) { @@ -596,9 +592,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, pool->cleanups = NULL; pool->subprocesses = NULL; pool->user_data = NULL; -#if defined(APR_POOL_DEBUG) pool->tag = NULL; -#endif } if ((pool->parent = parent) != NULL) { @@ -830,12 +824,12 @@ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) * Debug functions */ -#if defined(APR_POOL_DEBUG) APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag) { pool->tag = tag; } +#if defined(APR_POOL_DEBUG) APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse) { return 0; From 200a62dc6e2aa6f9464cd8e88b25cb8daf50fad1 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 19 Dec 2001 16:21:52 +0000 Subject: [PATCH 2655/7878] Fixed up the error definitions for NETWARE and split it into its own error definition section git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62658 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 78 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 75e3b7bc754..a750deac13c 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -711,7 +711,59 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \ || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE) -#else /* !def OS2 || WIN32 */ +#elif defined(NETWARE) /* !def OS2 || WIN32 */ + +#define APR_FROM_OS_ERROR(e) (e) +#define APR_TO_OS_ERROR(e) (e) +#define APR_TO_NETOS_ERROR(e) (e-APR_OS_START_SYSERR) + +#define apr_get_os_error() (errno) +#define apr_set_os_error(e) (errno = (e)) + +#define apr_get_netos_error() (WSAGetLastError()+APR_OS_START_SYSERR) + +#define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) + +/* APR CANONICAL ERROR TESTS */ +#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) +#define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) +#define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG) +#define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT) +#define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) +#define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC) +#define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) +#define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE) +#define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) +#define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF) +#define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL) +#define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE) + +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ + || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK) +#define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ + || (s) == APR_OS_START_SYSERR + WSAEINTR) +#define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ + || (s) == APR_OS_START_SYSERR + WSAENOTSOCK) +#define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ + || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED) +#define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ + || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS) +#define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ + || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) +#define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ + || (s) == APR_OS_START_SYSERR + WSAECONNRESET) +#define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ + || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT) \ + || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) +#define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ + || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) +#define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ + || (s) == APR_OS_START_SYSERR + WSAENETUNREACH) +#define APR_STATUS_IS_ENETDOWN(s) ((s) == APR_OS_START_SYSERR + WSAENETDOWN) + +#define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) +#define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE) +#else /* endif defined(NETWARE) */ /* * os error codes are clib error codes @@ -721,8 +773,32 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) + #ifdef NETWARE #define apr_get_netos_error() (WSAGetLastError()+APR_OS_START_SYSERR) + +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ + || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \ + || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK) +#define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ + || (s) == APR_OS_START_SYSERR + WSAEINTR) +#define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ + || (s) == APR_OS_START_SYSERR + WSAENOTSOCK) +#define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ + || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED) +#define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ + || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS) +#define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ + || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) +#define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ + || (s) == APR_OS_START_SYSERR + WSAECONNRESET) +#define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ + || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT) \ + || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) +#define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ + || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) +#define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ + || (s) == APR_OS_START_SYSERR + WSAENETUNREACH) #endif #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) From e91eb898bda437f48aec31328d45bb1fc90df996 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 19 Dec 2001 16:23:43 +0000 Subject: [PATCH 2656/7878] Fixed up the export AWK file to avoid exporting macros. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62659 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_nw_export.awk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index a8d35a6c9cd..922489bf518 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -14,9 +14,12 @@ /apr_mmap_delete/{next} /apr_mmap_dup/{next} /apr_mmap_offset/{next} +/apr_pool_create\(/{next} /apr_pool_free_blocks_num_bytes/{next} /apr_pool_join/{next} +/apr_pool_lock/{next} /apr_pool_num_bytes/{next} +/apr_pool_sub_make/{next} /apr_proc_mutex_child_init/{next} /apr_proc_mutex_create/{next} /apr_proc_mutex_create_np/{next} From 5c81d9cbabcc3d066a6885d94da24ce57942549a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 19 Dec 2001 16:24:40 +0000 Subject: [PATCH 2657/7878] Added a check to make sure we aren't trying to unlock and lock we don't have git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62660 13f79535-47bb-0310-9956-ffa450edef68 --- locks/netware/thread_mutex.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index a38ce429ba8..2747202f003 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -108,7 +108,10 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { - NXUnlock(mutex->mutex); + if (NXMutexDepth(mutex->mutex) > 0) { + NXUnlock(mutex->mutex); + } + return APR_SUCCESS; } From 133eba09a16e656fd7ca9173a7258629ab825be1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 20 Dec 2001 16:20:28 +0000 Subject: [PATCH 2658/7878] keep the APR make_exports.awk in sync with the httpd version git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62661 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_exports.awk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/make_exports.awk b/build/make_exports.awk index f9ee2561f3b..0cf75f02c22 100644 --- a/build/make_exports.awk +++ b/build/make_exports.awk @@ -76,8 +76,8 @@ function add_symbol(symbol) { } } -/^[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ { - sub("[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)][ \t]*", "") +/^[ \t]*AP[RU]?_(CORE_)?DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ { + sub("[ \t]*AP[RU]?_(CORE_)?DECLARE[^(]*[(][^)]*[)][ \t]*", "") sub("[(].*", "") sub("([^ ]* (^([ \t]*[(])))+", "") From 2df8bd82a2e19fccc2c07c8a1d022587590fd393 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Thu, 20 Dec 2001 20:22:20 +0000 Subject: [PATCH 2659/7878] Win32: apr_sendfile() should return APR_ENOTIMPL if oslevel < WINNT git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62662 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ network_io/win32/sendrecv.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index 57e79f37696..56235c94565 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ Changes with APR b1 + *) Win32: apr_sendfile() should return APR_ENOTIMPL if + oslevel < WINNT. [Bill Stoddard] *) Put new pools code in place which allows applications to switch off locking on pools operations in case a pool is diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 7a07961f44d..81e32605900 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -253,6 +253,11 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, TRANSMIT_FILE_BUFFERS tfb, *ptfb = NULL; int ptr = 0; int bytes_to_send = *len; /* Bytes to send out of the file (not including headers) */ + apr_oslevel_e os_level; + + if (!apr_get_oslevel(NULL, &os_level) && os_level < APR_WIN_NT) { + return APR_ENOTIMPL; + } /* Use len to keep track of number of total bytes sent (including headers) */ *len = 0; From 56019e37e7badf7005d91ac32fd655607cd1bec2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 21 Dec 2001 13:51:22 +0000 Subject: [PATCH 2660/7878] continue to keep APR's make_exports.awk in sync with Apache's version git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62663 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_exports.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/make_exports.awk b/build/make_exports.awk index 0cf75f02c22..09651f2af6a 100644 --- a/build/make_exports.awk +++ b/build/make_exports.awk @@ -85,7 +85,7 @@ function add_symbol(symbol) { next } -/^[ \t]*AP_DECLARE_HOOK[^(]*[(][^)]*[)]/ { +/^[ \t]*AP_DECLARE_HOOK[^(]*[(][^)]*/ { split($0, args, ",") symbol = args[2] sub("^[ \t]+", "", symbol) From dcfa054362c528412d92f1464dc7d3fef90b4795 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 23 Dec 2001 13:01:06 +0000 Subject: [PATCH 2661/7878] Add apr_ring.h to APR from it's original place in apr-util. This is being done so the ring macro's can be used in APR as well as in apr-util. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62664 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_ring.h | 478 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 478 insertions(+) create mode 100644 include/apr_ring.h diff --git a/include/apr_ring.h b/include/apr_ring.h new file mode 100644 index 00000000000..8002cdbbc01 --- /dev/null +++ b/include/apr_ring.h @@ -0,0 +1,478 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/* + * This code draws heavily from the 4.4BSD macros + * and Dean Gaudet's "splim/ring.h". + * + * + * + * We'd use Dean's code directly if we could guarantee the + * availability of inline functions. + */ +/** + * @file apr_ring.h + * @brief APR-Util Rings + */ +#ifndef APR_RING_H +#define APR_RING_H + +/* + * for offsetof() + */ +#include "apr_general.h" + +/** + * @defgroup APR_Util_Rings Rings + * @ingroup APR_Util + * @{ + */ + +/** + * A ring is a kind of doubly-linked list that can be manipulated + * without knowing where its head is. + */ + +/** + * The Ring Element + * + * A ring element struct is linked to the other elements in the ring + * through its ring entry field, e.g. + *

    + *      struct my_element_t {
    + *          APR_RING_ENTRY(my_element_t) link;
    + *          int foo;
    + *          char *bar;
    + *      };
    + * 
    + * An element struct may be put on more than one ring if it has + * more than one APR_RING_ENTRY field. + * + * @warning For strict C standards compliance you should put the APR_RING_ENTRY + * first in the element struct unless the head is always part of a larger + * object with enough earlier fields to accommodate the offsetof() used + * to compute the ring sentinel below. You can usually ignore this caveat. + */ +#define APR_RING_ENTRY(elem) \ + struct { \ + struct elem *next; \ + struct elem *prev; \ + } + +/** + * The Ring Head + * + * Each ring is managed via its head, which is a struct declared like this: + *
    + *      APR_RING_HEAD(my_ring_t, my_element_t);
    + *      struct my_ring_t ring, *ringp;
    + * 
    + * + * This struct looks just like the element link struct so that we can + * be sure that the typecasting games will work as expected. + * + * The first element in the ring is next after the head, and the last + * element is just before the head. + */ +#define APR_RING_HEAD(head, elem) \ + struct head { \ + struct elem *next; \ + struct elem *prev; \ + } + +/** + * The Ring Sentinel + * + * This is the magic pointer value that occurs before the first and + * after the last elements in the ring, computed from the address of + * the ring's head. The head itself isn't an element, but in order to + * get rid of all the special cases when dealing with the ends of the + * ring, we play typecasting games to make it look like one. + * + * @param hp The head of the ring + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_SENTINEL(hp, elem, link) \ + (struct elem *)((char *)(hp) - APR_XtOffsetOf(struct elem, link)) + +/** + * The first element of the ring + * @param hp The head of the ring + */ +#define APR_RING_FIRST(hp) (hp)->next +/** + * The last element of the ring + * @param hp The head of the ring + */ +#define APR_RING_LAST(hp) (hp)->prev +/** + * The next element in the ring + * @param ep The current element + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_NEXT(ep, link) (ep)->link.next +/** + * The previous element in the ring + * @param ep The current element + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_PREV(ep, link) (ep)->link.prev + + +/** + * Initialize a ring + * @param hp The head of the ring + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_INIT(hp, elem, link) do { \ + APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link); \ + APR_RING_LAST((hp)) = APR_RING_SENTINEL((hp), elem, link); \ + } while (0) + +/** + * Determine if a ring is empty + * @param hp The head of the ring + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + * @return true or false + */ +#define APR_RING_EMPTY(hp, elem, link) \ + (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link)) + +/** + * Initialize a singleton element + * @param ep The element + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_ELEM_INIT(ep, link) do { \ + APR_RING_NEXT((ep), link) = (ep); \ + APR_RING_PREV((ep), link) = (ep); \ + } while (0) + + +/** + * Splice the sequence ep1..epN into the ring before element lep + * (..lep.. becomes ..ep1..epN..lep..) + * @warning This doesn't work for splicing before the first element or on + * empty rings... see APR_RING_SPLICE_HEAD for one that does + * @param lep Element in the ring to splice before + * @param ep1 First element in the sequence to splice in + * @param epN Last element in the sequence to splice in + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_SPLICE_BEFORE(lep, ep1, epN, link) do { \ + APR_RING_NEXT((epN), link) = (lep); \ + APR_RING_PREV((ep1), link) = APR_RING_PREV((lep), link); \ + APR_RING_NEXT(APR_RING_PREV((lep), link), link) = (ep1); \ + APR_RING_PREV((lep), link) = (epN); \ + } while (0) + +/** + * Splice the sequence ep1..epN into the ring after element lep + * (..lep.. becomes ..lep..ep1..epN..) + * @warning This doesn't work for splicing after the last element or on + * empty rings... see APR_RING_SPLICE_TAIL for one that does + * @param lep Element in the ring to splice after + * @param ep1 First element in the sequence to splice in + * @param epN Last element in the sequence to splice in + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_SPLICE_AFTER(lep, ep1, epN, link) do { \ + APR_RING_PREV((ep1), link) = (lep); \ + APR_RING_NEXT((epN), link) = APR_RING_NEXT((lep), link); \ + APR_RING_PREV(APR_RING_NEXT((lep), link), link) = (epN); \ + APR_RING_NEXT((lep), link) = (ep1); \ + } while (0) + +/** + * Insert the element nep into the ring before element lep + * (..lep.. becomes ..nep..lep..) + * @warning This doesn't work for inserting before the first element or on + * empty rings... see APR_RING_INSERT_HEAD for one that does + * @param lep Element in the ring to insert before + * @param nep Element to insert + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_INSERT_BEFORE(lep, nep, link) \ + APR_RING_SPLICE_BEFORE((lep), (nep), (nep), link) + +/** + * Insert the element nep into the ring after element lep + * (..lep.. becomes ..lep..nep..) + * @warning This doesn't work for inserting after the last element or on + * empty rings... see APR_RING_INSERT_TAIL for one that does + * @param lep Element in the ring to insert after + * @param nep Element to insert + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_INSERT_AFTER(lep, nep, link) \ + APR_RING_SPLICE_AFTER((lep), (nep), (nep), link) + + +/** + * Splice the sequence ep1..epN into the ring before the first element + * (..hp.. becomes ..hp..ep1..epN..) + * @param hp Head of the ring + * @param ep1 First element in the sequence to splice in + * @param epN Last element in the sequence to splice in + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_SPLICE_HEAD(hp, ep1, epN, elem, link) \ + APR_RING_SPLICE_AFTER(APR_RING_SENTINEL((hp), elem, link), \ + (ep1), (epN), link) + +/** + * Splice the sequence ep1..epN into the ring after the last element + * (..hp.. becomes ..ep1..epN..hp..) + * @param hp Head of the ring + * @param ep1 First element in the sequence to splice in + * @param epN Last element in the sequence to splice in + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) \ + APR_RING_SPLICE_BEFORE(APR_RING_SENTINEL((hp), elem, link), \ + (ep1), (epN), link) + +/** + * Insert the element nep into the ring before the first element + * (..hp.. becomes ..hp..nep..) + * @param hp Head of the ring + * @param nep Element to insert + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_INSERT_HEAD(hp, nep, elem, link) \ + APR_RING_SPLICE_HEAD((hp), (nep), (nep), elem, link) + +/** + * Insert the element nep into the ring after the last element + * (..hp.. becomes ..nep..hp..) + * @param hp Head of the ring + * @param nep Element to insert + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_INSERT_TAIL(hp, nep, elem, link) \ + APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link) + +/** + * Concatenate ring h2 onto the end of ring h1, leaving h2 empty. + * @param h1 Head of the ring to concatenate onto + * @param h2 Head of the ring to concatenate + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_CONCAT(h1, h2, elem, link) do { \ + if (!APR_RING_EMPTY((h2), elem, link)) { \ + APR_RING_SPLICE_BEFORE(APR_RING_SENTINEL((h1), elem, link), \ + APR_RING_FIRST((h2)), \ + APR_RING_LAST((h2)), link); \ + APR_RING_INIT((h2), elem, link); \ + } \ + } while (0) + + +/** + * Unsplice a sequence of elements from a ring + * @warning The unspliced sequence is left with dangling pointers at either end + * @param ep1 First element in the sequence to unsplice + * @param epN Last element in the sequence to unsplice + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_UNSPLICE(ep1, epN, link) do { \ + APR_RING_NEXT(APR_RING_PREV((ep1), link), link) = \ + APR_RING_NEXT((epN), link); \ + APR_RING_PREV(APR_RING_NEXT((epN), link), link) = \ + APR_RING_PREV((ep1), link); \ + } while (0) + +/** + * Remove a single element from a ring + * @warning The unspliced element is left with dangling pointers at either end + * @param ep Element to remove + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_REMOVE(ep, link) \ + APR_RING_UNSPLICE((ep), (ep), link) + + +/** + * Iterate through a ring + * @param ep The current element + * @param hp The ring to iterate over + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + * @remark This is the same as either: + *
    + *	ep = APR_RING_FIRST(hp);
    + * 	while (ep != APR_RING_SENTINEL(hp, elem, link)) {
    + *	    ...
    + * 	    ep = APR_RING_NEXT(ep, link);
    + * 	}
    + *   OR
    + * 	for (ep = APR_RING_FIRST(hp);
    + *           ep != APR_RING_SENTINEL(hp, elem, link);
    + *           ep = APR_RING_NEXT(ep, link)) {
    + *	    ...
    + * 	}
    + * 
    + * @warning Be aware that you cannot change the value of ep within + * the foreach loop, nor can you destroy the ring element it points to. + * Modifying the prev and next pointers of the element is dangerous + * but can be done if you're careful. If you change ep's value or + * destroy the element it points to, then APR_RING_FOREACH + * will have no way to find out what element to use for its next + * iteration. The reason for this can be seen by looking closely + * at the equivalent loops given in the tip above. So, for example, + * if you are writing a loop that empties out a ring one element + * at a time, APR_RING_FOREACH just won't work for you. Do it + * by hand, like so: + *
    + *      while (!APR_RING_EMPTY(hp, elem, link)) {
    + *          ep = APR_RING_FIRST(hp);
    + *          ...
    + *          APR_RING_REMOVE(ep, link);
    + *      }
    + * 
    + */ +#define APR_RING_FOREACH(ep, hp, elem, link) \ + for ((ep) = APR_RING_FIRST((hp)); \ + (ep) != APR_RING_SENTINEL((hp), elem, link); \ + (ep) = APR_RING_NEXT((ep), link)) + +/** + * Iterate through a ring backwards + * @param ep The current element + * @param hp The ring to iterate over + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + * @see APR_RING_FOREACH + */ +#define APR_RING_FOREACH_REVERSE(ep, hp, elem, link) \ + for ((ep) = APR_RING_LAST((hp)); \ + (ep) != APR_RING_SENTINEL((hp), elem, link); \ + (ep) = APR_RING_PREV((ep), link)) + + +/* Debugging tools: */ + +#ifdef APR_RING_DEBUG +#include +#define APR_RING_CHECK_ONE(msg, ptr) \ + fprintf(stderr, "*** %s %p\n", msg, ptr) +#define APR_RING_CHECK(hp, elem, link, msg) \ + APR_RING_CHECK_ELEM(APR_RING_SENTINEL(hp, elem, link), elem, link, msg) +#define APR_RING_CHECK_ELEM(ep, elem, link, msg) do { \ + struct elem *start = (ep); \ + struct elem *this = start; \ + fprintf(stderr, "*** ring check start -- %s\n", msg); \ + do { \ + fprintf(stderr, "\telem %p\n", this); \ + fprintf(stderr, "\telem->next %p\n", \ + APR_RING_NEXT(this, link)); \ + fprintf(stderr, "\telem->prev %p\n", \ + APR_RING_PREV(this, link)); \ + fprintf(stderr, "\telem->next->prev %p\n", \ + APR_RING_PREV(APR_RING_NEXT(this, link), link)); \ + fprintf(stderr, "\telem->prev->next %p\n", \ + APR_RING_NEXT(APR_RING_PREV(this, link), link)); \ + if (APR_RING_PREV(APR_RING_NEXT(this, link), link) != this) { \ + fprintf(stderr, "\t*** this->next->prev != this\n"); \ + break; \ + } \ + if (APR_RING_NEXT(APR_RING_PREV(this, link), link) != this) { \ + fprintf(stderr, "\t*** this->prev->next != this\n"); \ + break; \ + } \ + this = APR_RING_NEXT(this, link); \ + } while (this != start); \ + fprintf(stderr, "*** ring check end\n"); \ + } while (0) +#else +/** + * Print a single pointer value to STDERR + * (This is a no-op unless APR_RING_DEBUG is defined.) + * @param msg Descriptive message + * @param ptr Pointer value to print + */ +#define APR_RING_CHECK_ONE(msg, ptr) +/** + * Dump all ring pointers to STDERR, starting with the head and looping all + * the way around the ring back to the head. Aborts if an inconsistency + * is found. + * (This is a no-op unless APR_RING_DEBUG is defined.) + * @param hp Head of the ring + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + * @param msg Descriptive message + */ +#define APR_RING_CHECK(hp, elem, link, msg) +/** + * Dump all ring pointers to STDERR, starting with the given element and + * looping all the way around the ring back to that element. Aborts if + * an inconsistency is found. + * (This is a no-op unless APR_RING_DEBUG is defined.) + * @param ep The element + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + * @param msg Descriptive message + */ +#define APR_RING_CHECK_ELEM(ep, elem, link, msg) +#endif +/** @} */ +#endif /* !APR_RING_H */ From 2401450ce6df64337a80406ee3425278ba84f911 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 23 Dec 2001 13:06:40 +0000 Subject: [PATCH 2662/7878] This small fix allows us to get code that needs this function working on BeOS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62665 13f79535-47bb-0310-9956-ffa450edef68 --- locks/beos/proc_mutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index b9a1d31708f..bb4d403f321 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -118,7 +118,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, const char *fname, apr_pool_t *pool) { - return APR_ENOTIMPL; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) From 49094f571569772ef21e25180ad31a5a25ca07e1 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 23 Dec 2001 13:10:23 +0000 Subject: [PATCH 2663/7878] Change the conditional code for BeOS, - move to using the ring macro's to allow us to keep lists of active and free waiters rather than creating them every time (suggested by Aaron) - fix a bug in the call to acquire_sem_etc The cleanup code still needs fixing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62666 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/thread_cond.h | 14 +++-- locks/beos/thread_cond.c | 107 ++++++++++++++++++-------------- 2 files changed, 70 insertions(+), 51 deletions(-) diff --git a/include/arch/beos/thread_cond.h b/include/arch/beos/thread_cond.h index 00ceef44352..75d77457e71 100644 --- a/include/arch/beos/thread_cond.h +++ b/include/arch/beos/thread_cond.h @@ -62,20 +62,22 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_portable.h" +#include "apr_ring.h" -struct waiter { - apr_pool_t *pool; +struct waiter_t { + APR_RING_ENTRY(waiter_t) link; sem_id sem; - struct waiter *next; }; - + struct apr_thread_cond_t { apr_pool_t *pool; sem_id lock; apr_thread_mutex_t *condlock; thread_id owner; - struct waiter *list; - struct waiter *tail; + /* active list */ + APR_RING_HEAD(active_list, waiter_t) alist; + /* free list */ + APR_RING_HEAD(free_list, waiter_t) flist; }; #endif /* THREAD_COND_H */ diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c index daaac4e19ab..29136d9a0d2 100644 --- a/locks/beos/thread_cond.c +++ b/locks/beos/thread_cond.c @@ -52,10 +52,6 @@ * . */ -/*Read/Write locking implementation based on the MultiLock code from - * Stephen Beaulieu - */ - #include "beos/thread_mutex.h" #include "beos/thread_cond.h" #include "apr_strings.h" @@ -67,22 +63,38 @@ static apr_status_t thread_cond_cleanup(void *data) apr_thread_cond_t *cond = (apr_thread_cond_t *)data; acquire_sem(cond->lock); - /* Go through waiters list and delete the sem's so we don't leak. */ - while (cond->list) { - w = cond->list; - cond->list = w->next; +/* + APR_RING_FOREACH(w, &cond->alist, waiter_t, link) { delete_sem(w->sem); } +*/ delete_sem(cond->lock); return APR_SUCCESS; } + +static struct waiter_t *make_waiter(apr_pool_t *pool) +{ + struct waiter_t *w = (struct waiter_t*) + apr_palloc(pool, sizeof(struct waiter_t)); + if (w == NULL) + return NULL; + + w->sem = create_sem(0, "apr conditional waiter"); + if (w->sem < 0) + return NULL; + + APR_RING_ELEM_INIT(w, link); + return w; +} + APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, apr_pool_t *pool) { apr_thread_cond_t *new_cond; sem_id rv; + int i; new_cond = (apr_thread_cond_t *)apr_palloc(pool, sizeof(apr_thread_cond_t)); @@ -94,8 +106,14 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, new_cond->lock = rv; new_cond->pool = pool; - new_cond->list = NULL; - + APR_RING_INIT(&new_cond->alist, waiter_t, link); + APR_RING_INIT(&new_cond->flist, waiter_t, link); + + for (i=0;i < 10 ;i++) { + struct waiter_t *nw = make_waiter(pool); + APR_RING_INSERT_TAIL(&new_cond->flist, nw, waiter_t, link); + } + apr_pool_cleanup_register(new_cond->pool, (void *)new_cond, thread_cond_cleanup, apr_pool_cleanup_null); @@ -104,52 +122,49 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, return APR_SUCCESS; } + static apr_status_t do_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, int timeout) { - struct waiter *wait = apr_palloc(cond->pool, sizeof(struct waiter)); + struct waiter_t *wait; thread_id cth = find_thread(NULL); apr_status_t rv; - - if (!wait) - return APR_ENOMEM; - - if (cond->owner > 0 && cth != cond->owner) { + int flags = B_RELATIVE_TIMEOUT; + + /* We must be the owner of the mutex or we can't do this... */ + if (mutex->owner != cth) { /* What should we return??? */ return APR_EINVAL; } - - wait->sem = create_sem(0, "apr conditional waiter"); - wait->next = NULL; - wait->pool = cond->pool; - cond->condlock = mutex; - - acquire_sem(cond->lock); - cond->owner = -1; - if (!cond->list) - cond->list = wait; + acquire_sem(cond->lock); + wait = APR_RING_FIRST(&cond->flist); + if (wait) + APR_RING_REMOVE(wait, link); else - cond->tail->next = wait; - cond->tail = wait; - + wait = make_waiter(cond->pool); + APR_RING_INSERT_TAIL(&cond->alist, wait, waiter_t, link); + cond->condlock = mutex; release_sem(cond->lock); - + apr_thread_mutex_unlock(cond->condlock); - rv = acquire_sem_etc(wait->sem, 1, B_RELATIVE_TIMEOUT, timeout); + if (timeout == 0) + flags = 0; + + rv = acquire_sem_etc(wait->sem, 1, flags, timeout); + + apr_thread_mutex_lock(cond->condlock); + if (rv != B_OK) if (rv == B_TIMED_OUT) return APR_TIMEUP; - return rv; - - apr_thread_mutex_lock(cond->condlock); + return rv; acquire_sem(cond->lock); - cond->owner = find_thread(NULL); + APR_RING_REMOVE(wait, link); + APR_RING_INSERT_TAIL(&cond->flist, wait, waiter_t, link); release_sem(cond->lock); - - delete_sem(wait->sem); return APR_SUCCESS; } @@ -169,13 +184,14 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) { - struct waiter *wake; + struct waiter_t *wake; acquire_sem(cond->lock); - if (cond->list) { - wake = cond->list; - cond->list = wake->next; + if (!APR_RING_EMPTY(&cond->alist, waiter_t, link)) { + wake = APR_RING_FIRST(&cond->alist); + APR_RING_REMOVE(wake, link); release_sem(wake->sem); + APR_RING_INSERT_TAIL(&cond->flist, wake, waiter_t, link); } release_sem(cond->lock); @@ -184,13 +200,14 @@ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) { - struct waiter *wake; + struct waiter_t *wake; acquire_sem(cond->lock); - while (cond->list) { - wake = cond->list; - cond->list = wake->next; + while (! APR_RING_EMPTY(&cond->alist, waiter_t, link)) { + wake = APR_RING_FIRST(&cond->alist); + APR_RING_REMOVE(wake, link); release_sem(wake->sem); + APR_RING_INSERT_TAIL(&cond->flist, wake, waiter_t, link); } release_sem(cond->lock); From 2736465f77f205799ee47e77608c769c55bf13c8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 25 Dec 2001 12:26:26 +0000 Subject: [PATCH 2664/7878] AIX 5L getaddrinfo() returns an error when "0" is passed for the service name parameter, so pass NULL when port is 0 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62667 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index ad176f7958d..c00e0089cc5 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -342,6 +342,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, apr_sockaddr_t *cursa; int error; char num[8]; + char *numptr; memset(&hints, 0, sizeof(hints)); hints.ai_flags = 0; /* XXX: might need a way to turn on AI_CANONNAME */ @@ -356,8 +357,14 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; - apr_snprintf(num, sizeof(num), "%d", port); - error = getaddrinfo(hostname, num, &hints, &ai_list); + if (port) { + apr_snprintf(num, sizeof(num), "%d", port); + numptr = num; + } + else { + numptr = NULL; + } + error = getaddrinfo(hostname, numptr, &hints, &ai_list); if (error) { if (error == EAI_SYSTEM) { return errno; From 4a69643259ee32ebe9295932e5d253c501d2ef8e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 26 Dec 2001 07:26:19 +0000 Subject: [PATCH 2665/7878] Ring-a-ling, time to move from util into apr git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62668 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++++ libapr.dsp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apr.dsp b/apr.dsp index a24af5d1c42..394e0437df7 100644 --- a/apr.dsp +++ b/apr.dsp @@ -543,6 +543,10 @@ SOURCE=.\include\apr_portable.h # End Source File # Begin Source File +SOURCE=.\include\apr_ring.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_shmem.h # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index fd7fcc62484..414d5c7b2c0 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -549,6 +549,10 @@ SOURCE=.\include\apr_portable.h # End Source File # Begin Source File +SOURCE=.\include\apr_ring.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_shmem.h # End Source File # Begin Source File From b39dedb128407fb9685ad0c49bb862eaeb4e8ae5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 26 Dec 2001 21:18:26 +0000 Subject: [PATCH 2666/7878] Add apr_sockaddr_equal() for comparing APR sockaddrs. This handles v4-mapped IPv6 addresses. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62669 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_network_io.h | 13 +++++++++++++ network_io/unix/sa_common.c | 26 ++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/CHANGES b/CHANGES index 56235c94565..7d5df8130cf 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR b1 + + *) Add apr_sockaddr_equal() for comparing APR sockaddrs. + [Jeff Trawick] + *) Win32: apr_sendfile() should return APR_ENOTIMPL if oslevel < WINNT. [Bill Stoddard] diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 99484a3e167..2d0313fbba2 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -630,6 +630,19 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr); +/** + * See if the IP addresses in two APR socket addresses are + * equivalent. Appropriate logic is present for comparing + * IPv4-mapped IPv6 addresses with IPv4 addresses. + * + * @param addr1 One of the APR socket addresses. + * @param addr2 The other APR socket address. + * @remark The return value will be non-zero if the addresses + * are equivalent. + */ +APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1, + const apr_sockaddr_t *addr2); + /** * Setup the memory required for poll to operate properly * @param new_poll The poll structure to be used. diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index c00e0089cc5..24bd622c2b9 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -606,6 +606,32 @@ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, return errno; } +#define V4MAPPED_EQUAL(a,b) \ +((a)->sa.sin.sin_family == AF_INET && \ + (b)->sa.sin.sin_family == AF_INET6 && \ + IN6_IS_ADDR_V4MAPPED((struct in6_addr *)(b)->ipaddr_ptr) && \ + !memcmp((a)->ipaddr_ptr, \ + &((struct in6_addr *)(b)->ipaddr_ptr)->s6_addr[12], \ + (a)->ipaddr_len)) + +APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1, + const apr_sockaddr_t *addr2) +{ + if (addr1->ipaddr_len == addr2->ipaddr_len && + !memcmp(addr1->ipaddr_ptr, addr2->ipaddr_ptr, addr1->ipaddr_len)) { + return 1; + } +#if APR_HAVE_IPV6 + if (V4MAPPED_EQUAL(addr1, addr2)) { + return 1; + } + if (V4MAPPED_EQUAL(addr2, addr1)) { + return 1; + } +#endif + return 0; /* not equal */ +} + static apr_status_t parse_network(apr_ipsubnet_t *ipsub, const char *network) { /* legacy syntax for ip addrs: a.b.c. ==> a.b.c.0/24 for example */ From 410e17e3bbe871b44e5a74d75e8a6e954bd0638e Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 27 Dec 2001 17:03:00 +0000 Subject: [PATCH 2667/7878] Convert apr_thread_exit(..., apr_status_t *retval) to apr_thread_exit(..., apr_status_t retval) so that status values can actually be returned back to apr_thread_join. This patch converts all platforms to store the returned status in the platform-specific opaque thread structure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62670 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- include/arch/netware/threadproc.h | 1 + include/arch/os2/threadproc.h | 2 +- include/arch/unix/threadproc.h | 1 + include/arch/win32/threadproc.h | 1 + test/testthread.c | 2 +- threadproc/beos/thread.c | 4 ++-- threadproc/netware/thread.c | 8 +++++--- threadproc/os2/thread.c | 6 +++--- threadproc/unix/thread.c | 7 ++++--- threadproc/win32/thread.c | 11 +++++------ 11 files changed, 25 insertions(+), 20 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index c31010c05c5..7a680971d8e 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -227,7 +227,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new_thread, * @param retval The return value to pass back to any thread that cares */ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, - apr_status_t *retval); + apr_status_t retval); /** * block until the desired thread stops executing. diff --git a/include/arch/netware/threadproc.h b/include/arch/netware/threadproc.h index eabc481c68a..2b6948f28fa 100644 --- a/include/arch/netware/threadproc.h +++ b/include/arch/netware/threadproc.h @@ -72,6 +72,7 @@ struct apr_thread_t { apr_int32_t cancel_how; void *data; apr_thread_start_t func; + apr_status_t exitval; }; struct apr_threadattr_t { diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/threadproc.h index 7beca9f9d1c..48f8e0a6527 100644 --- a/include/arch/os2/threadproc.h +++ b/include/arch/os2/threadproc.h @@ -74,7 +74,7 @@ struct apr_thread_t { unsigned long tid; apr_thread_start_t func; void *data; - apr_status_t rv; + apr_status_t exitval; }; struct apr_threadkey_t { diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index 31c26324043..9f45ea3df4d 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -92,6 +92,7 @@ struct apr_thread_t { pthread_t *td; void *data; apr_thread_start_t func; + apr_status_t exitval; }; struct apr_threadattr_t { diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/threadproc.h index de3f1d0d0d0..40036c371bc 100644 --- a/include/arch/win32/threadproc.h +++ b/include/arch/win32/threadproc.h @@ -68,6 +68,7 @@ struct apr_thread_t { apr_int32_t cancel_how; void *data; apr_thread_start_t func; + apr_status_t exitval; }; struct apr_threadattr_t { diff --git a/test/testthread.c b/test/testthread.c index d5374ae0cfc..f77a79f79d4 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -102,7 +102,7 @@ void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data) x++; apr_lock_release(thread_lock); } - apr_thread_exit(thd, &exit_ret_val); + apr_thread_exit(thd, exit_ret_val); return NULL; } diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index c5b69a9681c..68d73db7e83 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -142,10 +142,10 @@ int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) return tid1 == tid2; } -APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) +APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) { apr_pool_destroy(thd->cntxt); - thd->exitval = *retval; + thd->exitval = retval; exit_thread ((status_t)(*retval)); /* This will never be reached... */ return APR_SUCCESS; diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 926da0a2faa..3b88afa5c96 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -182,10 +182,11 @@ void apr_thread_yield() } apr_status_t apr_thread_exit(apr_thread_t *thd, - apr_status_t *retval) + apr_status_t retval) { + thd->exitval = retval; apr_pool_destroy(thd->cntxt); - NXThreadExit((void *)*retval); + NXThreadExit(NULL); return APR_SUCCESS; } @@ -195,7 +196,8 @@ apr_status_t apr_thread_join(apr_status_t *retval, apr_status_t stat; NXThreadId_t dthr; - if ((stat = NXThreadJoin(thd->td, &dthr, (void *)&retval)) == 0) { + if ((stat = NXThreadJoin(thd->td, &dthr, NULL)) == 0) { + *retval = thd->exitval; return APR_SUCCESS; } else { diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 70da428cb04..31fa00e2a01 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -154,9 +154,9 @@ APR_DECLARE(apr_os_thread_t) apr_os_thread_current() -APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) +APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) { - thd->rv = *retval; + thd->exitval = retval; _endthread(); return -1; /* If we get here something's wrong */ } @@ -176,7 +176,7 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *th if (rc == ERROR_INVALID_THREADID) rc = 0; /* Thread had already terminated */ - *retval = (apr_status_t)thd->rv; + *retval = thd->exitval; return APR_OS2_STATUS(rc); } diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index fe0ea337af1..13f3ec7afaa 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -176,10 +176,11 @@ APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) return pthread_equal(tid1, tid2); } -APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) +APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) { + thd->exitval = retval; apr_pool_destroy(thd->cntxt); - pthread_exit(retval); + pthread_exit(NULL); return APR_SUCCESS; } @@ -189,7 +190,7 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *th apr_status_t *thread_stat; if ((stat = pthread_join(*thd->td,(void *)&thread_stat)) == 0) { - *retval = thread_stat ? *thread_stat : APR_SUCCESS; + *retval = thd->exitval; return APR_SUCCESS; } else { diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 37850ea7354..642b40907af 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -140,10 +140,11 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, } APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, - apr_status_t *retval) + apr_status_t retval) { + thd->exitval = retval; apr_pool_destroy(thd->cntxt); - _endthreadex(*retval); + _endthreadex(0); return APR_SUCCESS; } @@ -153,10 +154,8 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_status_t stat; if ((stat = WaitForSingleObject(thd->td, INFINITE)) == WAIT_OBJECT_0) { - if (GetExitCodeThread(thd->td, retval) == 0) { - return APR_SUCCESS; - } - return apr_get_os_error(); + *retval = thd->exitval; + return APR_SUCCESS; } else { return stat; From 7111fe8875884b8dc2bff99dbff1e00a27100e17 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 27 Dec 2001 17:04:16 +0000 Subject: [PATCH 2668/7878] nonshowstoppers-- git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62671 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ STATUS | 13 +------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 7d5df8130cf..e67dd0c3be3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Change the prototype of apr_thread_exit() so that the apr_status_t + is no longer a pointer. It was difficult and sometimes hazardous + to return a apr_status_t* at times, and this allows us to return + the APR_* error codes directly. [Aaron Bannert] + *) Add apr_sockaddr_equal() for comparing APR sockaddrs. [Jeff Trawick] diff --git a/STATUS b/STATUS index 698353c66cc..0f4d890f8bc 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/14 10:43:00 $] +Last modified at [$Date: 2001/12/27 17:04:16 $] Release: @@ -210,17 +210,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: FreeBSD PR kern/32684: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/32684 - * Currently it is difficult if not impossible to return a proper - status code from a thread using apr_thread_exit(), since the - value must be a (apr_status_t*), but the pool where this would - normally be allocated is in that same function immediately - thereafter destroyed. Simply changing the type of this parameter - to (apr_status_t) should solve the problem (along with some - internal changes in apr_thread_join() to accomodate). - Status: "I'll probably test and commit this soonish," says Aaron, - "Here's the patch:" - http://marc.theaimsgroup.com/?l=apr-dev&m=100137033309456&q=raw - * There are some optimizations that can be done to the new apr_proc_*() functions (on UNIX). One that may reduce pointer indirection would be to make the apr_proc_mutex_unix_lock_methods_t From 39a0f65382ffec3c8483b3510f1a5d5f43777cd4 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 28 Dec 2001 19:03:48 +0000 Subject: [PATCH 2669/7878] Change from APR_HAVE_SETSID to HAVE_SETSID as the configure script only sets HAVE_SETSID. We will now call setsid() on platforms that have it. Two reasons for changing it here: - This is a private define. ISTR APR_ macros should only be for defines that will be exported via apr.h. This define lives in apr_private.h. - We're using HAVE_WAITPID a few lines down. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62672 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/procsup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index 5c1d12fd485..b96cb48ec6b 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -72,7 +72,7 @@ APR_DECLARE(apr_status_t) apr_proc_detach(void) } /* RAISE_SIGSTOP(DETACH);*/ #endif -#if APR_HAVE_SETSID +#ifdef HAVE_SETSID if ((pgrp = setsid()) == -1) { return errno; } From 585a5640245ecd2bd73d3a3db1a794ad468c4389 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Dec 2001 22:28:16 +0000 Subject: [PATCH 2670/7878] FS3_to_finfo already assigns the initial valid bits. It makes no sense to define that APR_FINFO_IDENT bits are there, when OS2 can't support them. Since the APR_INCOMPLETE result is _supposed_ to warn the program that some extra action might be required, it is safest to leave those bits unset, and let the program deal with things as it will. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62673 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filestat.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index e8d6eef54b3..3bde3358157 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -82,8 +82,9 @@ static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus) fstatus->ftimeLastWrite ); apr_os2_time_to_apr_time(&finfo->ctime, fstatus->fdateCreation, fstatus->ftimeCreation ); - finfo->valid |= APR_FINFO_TYPE | APR_FINFO_PROT | APR_FINFO_SIZE | - APR_FINFO_CSIZE | APR_FINFO_MTIME | APR_FINFO_CTIME | APR_FINFO_ATIME; + finfo->valid = APR_FINFO_TYPE | APR_FINFO_PROT | APR_FINFO_SIZE + | APR_FINFO_CSIZE | APR_FINFO_MTIME + | APR_FINFO_CTIME | APR_FINFO_ATIME; } @@ -129,8 +130,6 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want if (rc == 0) { FS3_to_finfo(finfo, &fstatus); - /* XXX: This is wrong, but it will work for today */ - finfo->valid = APR_FINFO_NORM; if (finfo->filetype == APR_REG) { if (thefile->isopen) { From c05251775e353f339b96b69a21b4617d9da4fa99 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Dec 2001 22:33:53 +0000 Subject: [PATCH 2671/7878] Tabs are evil, 4width doubly so git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62674 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/mktemp.c | 91 ++++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index df83ece99ab..c5cb10117a0 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -53,7 +53,7 @@ */ /* * Copyright (c) 1987, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -65,8 +65,8 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. + * This product includes software developed by the University of + * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -122,35 +122,35 @@ static apr_uint32_t randseed=0; static int gettemp(char *path, apr_file_t **doopen, apr_pool_t *p) { - register char *start, *trv, *suffp; - char *pad; - apr_finfo_t sbuf; + register char *start, *trv, *suffp; + char *pad; + apr_finfo_t sbuf; apr_status_t rv; - apr_uint32_t randnum; - - if (randseed==0) { - randseed = time(NULL); - seedrandom(randseed); - } - - for (trv = path; *trv; ++trv) - ; - suffp = trv; - --trv; - if (trv < path) { - return APR_EINVAL; - } - - /* Fill space with random characters */ - while (*trv == 'X') { - randnum = arc4random() % (sizeof(padchar) - 1); - *trv-- = padchar[randnum]; - } - start = trv + 1; - - /* - * check the target directory. - */ + apr_uint32_t randnum; + + if (randseed==0) { + randseed = time(NULL); + seedrandom(randseed); + } + + for (trv = path; *trv; ++trv) + ; + suffp = trv; + --trv; + if (trv < path) { + return APR_EINVAL; + } + + /* Fill space with random characters */ + while (*trv == 'X') { + randnum = arc4random() % (sizeof(padchar) - 1); + *trv-- = padchar[randnum]; + } + start = trv + 1; + + /* + * check the target directory. + */ for (;; --trv) { if (trv <= path) break; @@ -167,7 +167,7 @@ static int gettemp(char *path, apr_file_t **doopen, apr_pool_t *p) } } - for (;;) { + for (;;) { if ((rv = apr_file_open(doopen, path, APR_CREATE|APR_EXCL|APR_READ| APR_WRITE|APR_DELONCLOSE, APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) @@ -175,20 +175,21 @@ static int gettemp(char *path, apr_file_t **doopen, apr_pool_t *p) if (rv != APR_EEXIST) return rv; - /* If we have a collision, cycle through the space of filenames */ - for (trv = start;;) { - if (*trv == '\0' || trv == suffp) + /* If we have a collision, cycle through the space of filenames */ + for (trv = start;;) { + if (*trv == '\0' || trv == suffp) return APR_EINVAL; /* XXX: is this the correct return code? */ - pad = strchr((char *)padchar, *trv); - if (pad == NULL || !*++pad) - *trv++ = padchar[0]; - else { - *trv++ = *pad; - break; - } - } - } - /*NOTREACHED*/ + pad = strchr((char *)padchar, *trv); + if (pad == NULL || !*++pad) { + *trv++ = padchar[0]; + } + else { + *trv++ = *pad; + break; + } + } + } + /*NOTREACHED*/ } #else From 6173a42b2672c5cfb9c31cff67e3f6a2f440abd6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Dec 2001 23:50:49 +0000 Subject: [PATCH 2672/7878] Substantial optimization of the os_level semantic. Since this is entirely for internal consumption, and apr_initialize must be called, resolve the situation once and use the static, shared value for the remainder of the program execution. Next step is to allow conditional builds [excluding older 9x paths] if the user has no interest in 9x support. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62675 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 3 +-- file_io/win32/filesys.c | 15 +++++---------- file_io/win32/flock.c | 8 ++------ file_io/win32/open.c | 13 +++++-------- file_io/win32/pipe.c | 3 +-- file_io/win32/readwrite.c | 8 ++++---- misc/win32/misc.c | 11 ++++++----- network_io/win32/sendrecv.c | 3 +-- threadproc/win32/proc.c | 11 ++++------- user/win32/userinfo.c | 5 ++--- 10 files changed, 31 insertions(+), 49 deletions(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index d07cc0b43af..974bf977555 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -89,8 +89,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, UINT em; #if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(ctx, &os_level) && os_level >= APR_WIN_NT) + if (apr_os_level >= APR_WIN_NT) { apr_wchar_t wpath[APR_PATH_MAX]; if ((rv = utf8_to_unicode_path(wpath, sizeof(wpath) diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c index 464e0e0897d..09e1f9a72ba 100644 --- a/file_io/win32/filesys.c +++ b/file_io/win32/filesys.c @@ -97,8 +97,7 @@ apr_status_t filepath_root_test(char *path, apr_pool_t *p) { apr_status_t rv; #if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + if (apr_os_level >= APR_WIN_NT) { apr_wchar_t wpath[APR_PATH_MAX]; if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) @@ -121,8 +120,7 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, { char path[APR_PATH_MAX]; #if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + if (apr_os_level >= APR_WIN_NT) { apr_wchar_t *ignored; apr_wchar_t wdrive[8]; @@ -164,8 +162,7 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) { #if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + if (apr_os_level >= APR_WIN_NT) { apr_wchar_t *ignored; apr_wchar_t wpath[APR_PATH_MAX]; @@ -204,8 +201,7 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_int32_t flags, { char path[APR_PATH_MAX]; #if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + if (apr_os_level >= APR_WIN_NT) { apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; @@ -235,8 +231,7 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath, apr_pool_t *p) { #if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(p, &os_level) && os_level >= APR_WIN_NT) + if (apr_os_level >= APR_WIN_NT) { apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index d3bbe1da88a..1d0503ae55a 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -56,7 +56,6 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) { - apr_oslevel_e level; OVERLAPPED offset; DWORD flags, len = 0xffffffff; @@ -69,8 +68,7 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) * the lock; something needs to be done so an APR app can * recognize this as a try-again situation */ - apr_get_oslevel(NULL, &level); - if (level >= APR_WIN_NT) { + if (apr_os_level >= APR_WIN_NT) { /* Syntax is correct, len is passed for LengthLow and LengthHigh*/ if (!LockFileEx(thefile->filehand, flags, 0, len, len, &offset)) return apr_get_os_error(); @@ -85,14 +83,12 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) { - apr_oslevel_e level; OVERLAPPED offset; DWORD len = 0xffffffff; memset (&offset, 0, sizeof(offset)); - apr_get_oslevel(NULL, &level); - if (level >= APR_WIN_NT) { + if (apr_os_level >= APR_WIN_NT) { /* Syntax is correct, len is passed for LengthLow and LengthHigh*/ if (!UnlockFileEx(thefile->filehand, 0, len, len, &offset)) return apr_get_os_error(); diff --git a/file_io/win32/open.c b/file_io/win32/open.c index e4c6b76bb62..09ef76c9a4c 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -179,7 +179,6 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, DWORD createflags = 0; DWORD attributes = 0; DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE; - apr_oslevel_e os_level; apr_status_t rv; if (flag & APR_READ) { @@ -189,7 +188,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, oflags |= GENERIC_WRITE; } - if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) + if (apr_os_level >= APR_WIN_NT) sharemode |= FILE_SHARE_DELETE; if (flag & APR_CREATE) { @@ -221,7 +220,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, if (flag & APR_OPENLINK) { attributes |= FILE_FLAG_OPEN_REPARSE_POINT; } - if (!(flag & (APR_READ | APR_WRITE)) && (os_level >= APR_WIN_NT)) { + if (!(flag & (APR_READ | APR_WRITE)) && (apr_os_level >= APR_WIN_NT)) { /* We once failed here, but this is how one opens * a directory as a file under winnt */ @@ -235,7 +234,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, } #if APR_HAS_UNICODE_FS - if (os_level >= APR_WIN_NT) { + if (apr_os_level >= APR_WIN_NT) { apr_wchar_t wfname[APR_PATH_MAX]; if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) / sizeof(apr_wchar_t), fname)) @@ -326,8 +325,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS - apr_oslevel_e os_level; - if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) + if (apr_os_level >= APR_WIN_NT) { apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; @@ -349,8 +347,7 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, const char *topath, apr_pool_t *cont) { - apr_oslevel_e os_level; - if (!apr_get_oslevel(cont, &os_level) && os_level >= APR_WIN_NT) + if (apr_os_level >= APR_WIN_NT) { #if APR_HAS_UNICODE_FS apr_wchar_t wfrompath[APR_PATH_MAX], wtopath[APR_PATH_MAX]; diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 0faa5d632a0..6fbbfa7e00d 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -148,7 +148,6 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, apr_pool_t *p) { - apr_oslevel_e level; SECURITY_ATTRIBUTES sa; static unsigned long id = 0; DWORD dwPipeMode; @@ -185,7 +184,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, (*out)->direction = 0; (*out)->pOverlapped = NULL; - if (apr_get_oslevel(p, &level) == APR_SUCCESS && level >= APR_WIN_NT) { + if (apr_os_level >= APR_WIN_NT) { /* Create the read end of the pipe */ dwOpenMode = PIPE_ACCESS_INBOUND; if (bAsyncRead) { diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 48968af1c9e..d8c3c3fcf87 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -137,8 +137,8 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le break; } if (rv != APR_SUCCESS) { - /* XXX CancelIo is not available on Win95 */ - CancelIo(file->filehand); + if (apr_os_level >= APR_WIN_98) + CancelIo(file->filehand); } } else if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) { @@ -305,8 +305,8 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a break; } if (rv != APR_SUCCESS) { - /* XXX CancelIo is not available on Win95 */ - CancelIo(thefile->filehand); + if (apr_os_level >= APR_WIN_98) + CancelIo(thefile->filehand); } } } diff --git a/misc/win32/misc.c b/misc/win32/misc.c index a2f9a40f2da..ef3cd28a279 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -59,11 +59,12 @@ apr_oslevel_e apr_os_level = APR_WIN_UNK; apr_status_t apr_get_oslevel(apr_pool_t *cont, apr_oslevel_e *level) { - static OSVERSIONINFO oslev; - static unsigned int servpack = 0; - char *pservpack; + if (apr_os_level == APR_WIN_UNK) + { + static OSVERSIONINFO oslev; + static unsigned int servpack = 0; + char *pservpack; - if (apr_os_level == APR_WIN_UNK) { oslev.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&oslev); if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) { @@ -114,7 +115,7 @@ apr_status_t apr_get_oslevel(apr_pool_t *cont, apr_oslevel_e *level) *level = apr_os_level; return APR_SUCCESS; } - return APR_EEXIST; + return APR_EGENERAL; } diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 81e32605900..70f41882af0 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -253,9 +253,8 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, TRANSMIT_FILE_BUFFERS tfb, *ptfb = NULL; int ptr = 0; int bytes_to_send = *len; /* Bytes to send out of the file (not including headers) */ - apr_oslevel_e os_level; - if (!apr_get_oslevel(NULL, &os_level) && os_level < APR_WIN_NT) { + if (apr_os_level < APR_WIN_NT) { return APR_ENOTIMPL; } diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 7749ad215d0..bd831759bb9 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -137,7 +137,7 @@ static apr_status_t make_inheritable_duplicate(apr_file_t *original, if (original == NULL) return APR_SUCCESS; - /* Can't use apr_file_dup here because it creates a non-inhertible + /* XXX: Can't use apr_file_dup here because it creates a non-inhertible * handle, and apr_open_file'd apr_file_t's are non-inheritable, * so we must assume we need to make an inheritable handle. */ @@ -290,7 +290,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_pool_t *cont) { apr_status_t rv; - apr_oslevel_e os_level; apr_size_t i; char *cmdline; char *pEnvBlock; @@ -301,8 +300,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, new->err = attr->parent_err; new->out = attr->parent_out; - (void) apr_get_oslevel(cont, &os_level); - if (attr->detached) { /* If we are creating ourselves detached, Then we should hide the * window we are starting in. And we had better redfine our @@ -311,7 +308,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * not manage the stdio handles properly when running old 16 * bit executables if the detached attribute is set. */ - if (os_level >= APR_WIN_NT) { + if (apr_os_level >= APR_WIN_NT) { /* * XXX DETACHED_PROCESS won't on Win9x at all; on NT/W2K * 16 bit executables fail (MS KB: Q150956) @@ -389,7 +386,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, ++iEnvBlockLen; #if APR_HAS_UNICODE_FS - if (os_level >= APR_WIN_NT) { + if (apr_os_level >= APR_WIN_NT) { apr_wchar_t *pNext; pEnvBlock = (char *)apr_palloc(cont, iEnvBlockLen * 2); dwCreationFlags |= CREATE_UNICODE_ENVIRONMENT; @@ -430,7 +427,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } #if APR_HAS_UNICODE_FS - if (os_level >= APR_WIN_NT) + if (apr_os_level >= APR_WIN_NT) { STARTUPINFOW si; apr_size_t nprg = strlen(progname) + 1; diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 66f9abb4a12..10ced7d09e8 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -103,7 +103,6 @@ void get_sid_string(char *buf, int blen, apr_uid_t id) */ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *username, apr_pool_t *p) { - apr_oslevel_e os_level; apr_status_t rv; char regkey[MAX_PATH * 2]; char *fixch; @@ -111,7 +110,7 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use DWORD type; HKEY key; - if (apr_get_oslevel(p, &os_level) || os_level >= APR_WIN_NT) { + if (apr_os_level >= APR_WIN_NT) { apr_uid_t uid; apr_gid_t gid; @@ -136,7 +135,7 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use return APR_FROM_OS_ERROR(rv); #if APR_HAS_UNICODE_FS - if (apr_get_oslevel(p, &os_level) || os_level >= APR_WIN_NT) { + if (apr_os_level >= APR_WIN_NT) { keylen = sizeof(regkey); rv = RegQueryValueExW(key, L"ProfileImagePath", NULL, &type, From 0e3dc8bc781a0b0fc34f9e9a22b1ef47ab259892 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Dec 2001 23:58:39 +0000 Subject: [PATCH 2673/7878] MSVC Docs reflect that _beginthreadex will set doserrno, which is the most complete documentation of failure we can ask for. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62676 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/thread.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 642b40907af..2b9c850906c 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -102,8 +102,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, { apr_status_t stat; unsigned temp; - int lasterror; - + (*new) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); if ((*new) == NULL) { @@ -125,11 +124,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker, (*new), 0, &temp)) == 0) { - lasterror = apr_get_os_error(); - return APR_EEXIST; - /* MSVC++ doc doesn't mention any additional error info - * XXX: need to check the sources - */ + return APR_FROM_OS_ERROR(_doserrno); } if (attr && attr->detach) { From be0aacab5749d7745285f68536e1e59f25ff1f25 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 29 Dec 2001 02:09:04 +0000 Subject: [PATCH 2674/7878] More goodness {I hope} for Win32, and two extra common errors for all. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62677 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 62 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 7 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index a750deac13c..e2ae316302f 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -486,6 +486,17 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_EPIPE (APR_OS_START_CANONERR + 24) #endif +#ifdef EXDEV +#define APR_EXDEV EXDEV +#else +#define APR_EXDEV (APR_OS_START_CANONERR + 25) +#endif + +#ifdef EPIPE +#define APR_ENOTEMPTY ENOTEMPTY +#else +#define APR_ENOTEMPTY (APR_OS_START_CANONERR + 26) +#endif #if defined(OS2) @@ -602,6 +613,10 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \ || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE \ || (s) == APR_OS_START_SYSERR + SOCEPIPE) +#define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \ + || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE) +#define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \ + || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY) /* Sorry, too tired to wrap this up for OS2... feel free to @@ -651,6 +666,14 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \ + || (s) == APR_OS_START_SYSERR + ERROR_CANNOT_MAKE \ + || (s) == APR_OS_START_SYSERR + ERROR_CURRENT_DIRECTORY \ + || (s) == APR_OS_START_SYSERR + ERROR_DRIVE_LOCKED \ + || (s) == APR_OS_START_SYSERR + ERROR_FAIL_I24 \ + || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \ + || (s) == APR_OS_START_SYSERR + ERROR_LOCK_FAILED \ + || (s) == APR_OS_START_SYSERR + ERROR_NOT_LOCKED \ + || (s) == APR_OS_START_SYSERR + ERROR_NETWORK_ACCESS_DENIED \ || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION) #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \ @@ -660,26 +683,43 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + WSAENAMETOOLONG) #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \ - || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \ || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES) -#define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) +#define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR \ + || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ + || (s) == APR_OS_START_SYSERR + ERROR_BAD_NETPATH \ + || (s) == APR_OS_START_SYSERR + ERROR_BAD_NET_NAME \ + || (s) == APR_OS_START_SYSERR + ERROR_BAD_PATHNAME \ + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DRIVE) #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL) -#define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) +#define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM \ + || (s) == APR_OS_START_SYSERR + ERROR_ARENA_TRASHED \ + || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_MEMORY \ + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_BLOCK \ + || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_QUOTA \ + || (s) == APR_OS_START_SYSERR + ERROR_OUTOFMEMORY) #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \ || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES) #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \ - || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE) + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \ + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_TARGET_HANDLE) #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \ + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_ACCESS \ + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DATA \ + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION \ + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \ - || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION) + || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ || (s) == APR_OS_START_SYSERR + ERROR_SEEK_ON_DEVICE \ || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \ + || (s) == APR_OS_START_SYSERR + ERROR_NO_PROC_SLOTS \ + || (s) == APR_OS_START_SYSERR + ERROR_NESTING_NOT_ALLOWED \ + || (s) == APR_OS_START_SYSERR + ERROR_MAX_THRDS_REACHED \ || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK) #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ || (s) == APR_OS_START_SYSERR + WSAEINTR) @@ -710,6 +750,10 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + ERROR_BAD_FORMAT) #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \ || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE) +#define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \ + || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE) +#define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \ + || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY) #elif defined(NETWARE) /* !def OS2 || WIN32 */ @@ -760,9 +804,11 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ || (s) == APR_OS_START_SYSERR + WSAENETUNREACH) #define APR_STATUS_IS_ENETDOWN(s) ((s) == APR_OS_START_SYSERR + WSAENETDOWN) +#define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) +#define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE) +#define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV) +#define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY) -#define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) -#define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE) #else /* endif defined(NETWARE) */ /* @@ -852,6 +898,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH) #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE) +#define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV) +#define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY) #endif /* !def OS2 || WIN32 */ From d37164fdb61ea5ba14abb2a9f95f9abf553c9fa5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 29 Dec 2001 02:12:27 +0000 Subject: [PATCH 2675/7878] Whoops - fix small typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62678 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index e2ae316302f..1b859a345ab 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -492,7 +492,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_EXDEV (APR_OS_START_CANONERR + 25) #endif -#ifdef EPIPE +#ifdef ENOTEMPTY #define APR_ENOTEMPTY ENOTEMPTY #else #define APR_ENOTEMPTY (APR_OS_START_CANONERR + 26) From 3ee73068a85b15d01a6512600f1140839911f7ac Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 29 Dec 2001 03:33:49 +0000 Subject: [PATCH 2676/7878] Tickle the Win32 rand generator so it works on W2K git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62679 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/rand.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 38b79499855..6948d15bcee 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -62,10 +62,11 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, HCRYPTPROV hProv; apr_status_t res = APR_SUCCESS; - if (!CryptAcquireContext(&hProv,NULL,NULL,PROV_RSA_FULL,0)) { + if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) { return apr_get_os_error(); } - if (!CryptGenRandom(hProv,length,buf)) { + if (!CryptGenRandom(hProv, length, buf)) { res = apr_get_os_error(); } CryptReleaseContext(hProv, 0); From 773ec62788c1807cf40cceb85c6125df9ff3a1a9 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 29 Dec 2001 06:55:24 +0000 Subject: [PATCH 2677/7878] Fix some stray tabs and wrap long lines. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62680 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index df42b527e81..97a15073e70 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -80,13 +80,17 @@ apr_status_t apr_unix_file_cleanup(void *thefile) #endif } else { - /* Are there any error conditions other than EINTR or EBADF? */ + /* Are there any error conditions other than EINTR or EBADF? */ rv = errno; } return rv != APR_SUCCESS ? rv : flush_rv; } -APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, + const char *fname, + apr_int32_t flag, + apr_fileperms_t perm, + apr_pool_t *cont) { int oflags = 0; #if APR_HAS_THREADS @@ -132,9 +136,9 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr if (flag & APR_CREATE) { oflags |= O_CREAT; - if (flag & APR_EXCL) { - oflags |= O_EXCL; - } + if (flag & APR_EXCL) { + oflags |= O_EXCL; + } } if ((flag & APR_EXCL) && !(flag & APR_CREATE)) { return APR_EACCES; @@ -188,7 +192,8 @@ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) } } -APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_path, +APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, + const char *to_path, apr_pool_t *p) { if (rename(from_path, to_path) != 0) { @@ -197,13 +202,15 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) +APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, + apr_file_t *file) { *thefile = file->filedes; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, +APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, + apr_os_file_t *thefile, apr_pool_t *cont) { int *dafile = thefile; @@ -230,21 +237,24 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, + apr_pool_t *cont) { int fd = STDERR_FILENO; return apr_os_file_put(thefile, &fd, cont); } -APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, + apr_pool_t *cont) { int fd = STDOUT_FILENO; return apr_os_file_put(thefile, &fd, cont); } -APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, + apr_pool_t *cont) { int fd = STDIN_FILENO; From cfb3f1e556dec36c0581fac5731377a2bb119d44 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 29 Dec 2001 10:00:41 +0000 Subject: [PATCH 2678/7878] Fix handling of named shared memory Allocate some extra space for heap structures so that a block of the same size as the reqsize can be allocated later with apr_shm_malloc(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62681 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/os2/shmem.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shmem/os2/shmem.c b/shmem/os2/shmem.c index 672081f7cf7..e63ee0a63a9 100644 --- a/shmem/os2/shmem.c +++ b/shmem/os2/shmem.c @@ -72,11 +72,16 @@ APR_DECLARE(apr_status_t) apr_shm_init(struct shmem_t **m, apr_size_t reqsize, c int rc; struct shmem_t *newm = (struct shmem_t *)apr_palloc(cont, sizeof(struct shmem_t)); char *name = NULL; + ULONG flags = PAG_COMMIT|PAG_READ|PAG_WRITE; if (file) name = apr_pstrcat(cont, "\\SHAREMEM\\", file, NULL); - rc = DosAllocSharedMem(&(newm->memblock), name, reqsize, PAG_COMMIT|OBJ_GETTABLE|PAG_READ|PAG_WRITE); + if (name == NULL) + flags |= OBJ_GETTABLE; + + reqsize += 1024; /* Allow some overhead for heap structures */ + rc = DosAllocSharedMem(&(newm->memblock), name, reqsize, flags); if (rc) return APR_OS2_STATUS(rc); From ddf0de659849e700fe52685e65ecc1f0644e992c Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 29 Dec 2001 10:01:58 +0000 Subject: [PATCH 2679/7878] Fix missed reference to rv that was renamed to exitval. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62682 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 31fa00e2a01..9f34227fd65 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -95,7 +95,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) static void apr_thread_begin(void *arg) { apr_thread_t *thread = (apr_thread_t *)arg; - thread->rv = thread->func(thread, thread->data); + thread->exitval = thread->func(thread, thread->data); } From 4059898b365083094f04d2db71452263394bccb2 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 29 Dec 2001 10:03:39 +0000 Subject: [PATCH 2680/7878] Leave apr_os_proc_mutex_*() as unimplemented for now as the type of the native lock is still undecided. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62683 13f79535-47bb-0310-9956-ffa450edef68 --- locks/os2/proc_mutex.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index a881181e645..3612b7916d5 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -111,23 +111,13 @@ APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, apr_proc_mutex_t *pmutex) { - *ospmutex = pmutex->hMutex; - return APR_SUCCESS; + return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *pool) { - if (pool == NULL) { - return APR_ENOPOOL; - } - if ((*pmutex) == NULL) { - (*pmutex) = (apr_proc_mutex_t *)apr_pcalloc(pool, - sizeof(apr_proc_mutex_t)); - (*pmutex)->pool = pool; - } - (*pmutex)->hMutex = *ospmutex; - return APR_SUCCESS; + return APR_ENOTIMPL; } From 00b0e03ab70d8209145b19b9d4d6e195d56f2bc0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 29 Dec 2001 23:14:22 +0000 Subject: [PATCH 2681/7878] roll the extra apr_lock_create_np() functionality into apr_lock_create() and get rid of apr_lock_create_np(); apr_lock_create() has a new parameter for specifying the lock mechanism (or APR_LOCK_DEFAULT to let APR choose) (same for apr_proc_mutex_create_np() and apr_proc_mutex_create()) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62684 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++++ configure.in | 19 ------------ file_io/os2/open.c | 3 +- include/apr.h.in | 2 -- include/apr_lock.h | 60 +++++++++----------------------------- include/apr_proc_mutex.h | 27 ++++------------- locks/beos/locks.c | 10 +++++-- locks/beos/proc_mutex.c | 15 ++++------ locks/netware/locks.c | 6 +++- locks/netware/proc_mutex.c | 9 +----- locks/os2/locks.c | 8 +++-- locks/os2/proc_mutex.c | 11 +------ locks/unix/locks.c | 17 ++++------- locks/unix/proc_mutex.c | 21 ++----------- locks/win32/locks.c | 5 ++++ locks/win32/proc_mutex.c | 9 +----- shmem/unix/shmem.c | 3 +- test/testlock.c | 8 ++--- test/testlockperf.c | 6 ++-- test/testprocmutex.c | 2 +- test/testthread.c | 3 +- 21 files changed, 78 insertions(+), 171 deletions(-) diff --git a/CHANGES b/CHANGES index e67dd0c3be3..055d732f4f2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) apr_lock_create() and apr_proc_mutex_create() now have an + additional parameter for specifying the lock mechanism. + apr_lock_create_np() and apr_proc_mutex_create_np() have been + removed. [Jeff Trawick] + *) Change the prototype of apr_thread_exit() so that the apr_status_t is no longer a pointer. It was difficult and sometimes hazardous to return a apr_status_t* at times, and this allows us to return diff --git a/configure.in b/configure.in index c677938178d..f6c4b42054e 100644 --- a/configure.in +++ b/configure.in @@ -1152,24 +1152,6 @@ case $ac_decision in ;; esac -if test "$flockser$sysvser$fcntlser$procpthreadser" = "0000"; then - lockcreatenp="0" -else - lockcreatenp="1" -fi - -case $host in - *-os2*) - # The above tests detect a working flock on OS/2 - # but we don't want to use it when we have native locks - lockcreatenp="0" - ;; - *-beos*) - # This applies to beos as well - lockcreatenp="0" - ;; -esac - AC_SUBST(hasflockser) AC_SUBST(hassysvser) AC_SUBST(hasfcntlser) @@ -1180,7 +1162,6 @@ AC_SUBST(sysvser) AC_SUBST(fcntlser) AC_SUBST(procpthreadser) AC_SUBST(pthreadser) -AC_SUBST(lockcreatenp) AC_MSG_CHECKING(if interprocess lock affects threads) if test "x$apr_process_lock_is_global" = "xyes"; then diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 91a5d39226a..a80f4d56a48 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -99,7 +99,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr if (dafile->buffered) { dafile->buffer = apr_palloc(cntxt, APR_FILE_BUFSIZE); - rv = apr_lock_create(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cntxt); + rv = apr_lock_create(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, + APR_LOCK_DEFAULT, NULL, cntxt); if (rv) return rv; diff --git a/include/apr.h.in b/include/apr.h.in index fe5dac3b69b..a3d980fb13f 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -81,8 +81,6 @@ #define APR_HAS_PROC_PTHREAD_SERIALIZE @hasprocpthreadser@ #define APR_HAS_RWLOCK_SERIALIZE @hasrwlockser@ -#define APR_HAS_LOCK_CREATE_NP @lockcreatenp@ - #define APR_PROCESS_LOCK_IS_GLOBAL @proclockglobal@ #define APR_USES_ANONYMOUS_SHM @anonymous_shm@ diff --git a/include/apr_lock.h b/include/apr_lock.h index 82078b2824e..8c80f35d934 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -80,6 +80,9 @@ typedef enum {APR_MUTEX, APR_READWRITE} apr_locktype_e; typedef enum {APR_READER, APR_WRITER} apr_readerwriter_e; +typedef enum {APR_LOCK_FCNTL, APR_LOCK_FLOCK, APR_LOCK_SYSVSEM, APR_LOCK_PROC_PTHREAD, + APR_LOCK_DEFAULT} apr_lockmech_e; + typedef struct apr_lock_t apr_lock_t; /* Function definitions */ @@ -99,16 +102,27 @@ typedef struct apr_lock_t apr_lock_t; * APR_LOCKALL lock processes and threads from the * protected area. *
    + * @param mech The mechanism to use for the interprocess lock, if any; one of + *
    + *            APR_LOCK_FCNTL
    + *            APR_LOCK_FLOCK
    + *            APR_LOCK_SYSVSEM
    + *            APR_LOCK_PROC_PTHREAD
    + *            APR_LOCK_DEFAULT     pick the default mechanism for the platform
    + * 
    * @param fname A file name to use if the lock mechanism requires one. This * argument should always be provided. The lock code itself will * determine if it should be used. * @param pool The pool to operate on. * @warning APR_CROSS_PROCESS may lock both processes and threads, but it is * only guaranteed to lock processes. + * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports + * APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. */ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, + apr_lockmech_e mech, const char *fname, apr_pool_t *pool); @@ -184,52 +198,6 @@ APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup)(void *)); -#if APR_HAS_LOCK_CREATE_NP - -typedef enum {APR_LOCK_FCNTL, APR_LOCK_FLOCK, APR_LOCK_SYSVSEM, APR_LOCK_PROC_PTHREAD, - APR_LOCK_DEFAULT} apr_lockmech_e_np; - -/** - * non-portable interface to apr_lock_create() - * - * Create a new instance of a lock structure. This is like apr_lock_create() - * but has some non-portable parameters. This should be used sparingly. - * - * @param lock The newly created lock structure. - * @param type The type of lock to create, one of: - *
    - *            APR_MUTEX
    - *            APR_READWRITE
    - * 
    - * @param scope The scope of the lock to create, one of: - *
    - *            APR_CROSS_PROCESS    lock processes from the protected area.
    - *            APR_INTRAPROCESS     lock threads from the protected area.
    - *            APR_LOCKALL          lock processes and threads from the
    - *                                 protected area.
    - * 
    - * @param mech The mechanism to use for the interprocess lock, if any; one of - *
    - *            APR_LOCK_FCNTL
    - *            APR_LOCK_FLOCK
    - *            APR_LOCK_SYSVSEM
    - *            APR_LOCK_PROC_PTHREAD
    - *            APR_LOCK_DEFAULT     pick the default mechanism for the platform
    - * 
    - * @param fname A file name to use if the lock mechanism requires one. This - * argument should always be provided. The lock code itself will - * determine if it should be used. - * @param pool The pool to operate on. - * @warning APR_CROSS_PROCESS may lock both processes and threads, but it is - * only guaranteed to lock processes. - */ -APR_DECLARE(apr_status_t) apr_lock_create_np(apr_lock_t **lock, - apr_locktype_e type, - apr_lockscope_e scope, - apr_lockmech_e_np mech, - const char *fname, - apr_pool_t *pool); -#endif /* APR_HAS_LOCK_CREATE_NP */ /** @} */ #ifdef __cplusplus } diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index 5779c94b3df..fff7df5f432 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -80,21 +80,6 @@ typedef struct apr_proc_mutex_t apr_proc_mutex_t; /* Function definitions */ /** - * Create and initialize a mutex that can be used to synchronize processes. - * @param mutex the memory address where the newly created mutex will be - * stored. - * @param fname A file name to use if the lock mechanism requires one. This - * argument should always be provided. The lock code itself will - * determine if it should be used. - * @param pool the pool from which to allocate the mutex. - */ -APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, - const char *fname, - apr_pool_t *pool); - -/** - * non-portable interface to apr_proc_mutex_create() - * * Create and initialize a mutex that can be used to synchronize processes. * @param mutex the memory address where the newly created mutex will be * stored. @@ -110,13 +95,13 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, * APR_LOCK_DEFAULT pick the default mechanism for the platform *
    * @param pool the pool from which to allocate the mutex. + * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports + * APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. */ -#if APR_HAS_LOCK_CREATE_NP -APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, - const char *fname, - apr_lockmech_e_np mech, - apr_pool_t *pool); -#endif +APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, + const char *fname, + apr_lockmech_e mech, + apr_pool_t *pool); /** * Re-open a mutex in a child process. diff --git a/locks/beos/locks.c b/locks/beos/locks.c index 44366474207..2c29a50a405 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -274,12 +274,16 @@ static apr_status_t _destroy_lock(apr_lock_t *lock) } APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, - apr_lockscope_e scope, const char *fname, - apr_pool_t *pool) + apr_lockscope_e scope, apr_lockmech_e mech, + const char *fname, apr_pool_t *pool) { apr_lock_t *new; apr_status_t stat = APR_SUCCESS; - + + if (mech != APR_LOCK_DEFAULT) { + return APR_ENOTIMPL; + } + new = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t)); if (new == NULL){ return APR_ENOMEM; diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index bb4d403f321..94e6d889341 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -79,11 +79,16 @@ static apr_status_t _proc_mutex_cleanup(void * data) APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, const char *fname, + apr_lockmech_e mech, apr_pool_t *pool) { apr_proc_mutex_t *new; apr_status_t stat = APR_SUCCESS; + if (mech != APR_LOCK_DEFAULT) { + return APR_ENOTIMPL; + } + new = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); if (new == NULL){ return APR_ENOMEM; @@ -104,16 +109,6 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, return APR_SUCCESS; } -#if APR_HAS_CREATE_LOCKS_NP -APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, - const char *fname, - apr_lockmech_e_np mech, - apr_pool_t *pool) -{ - return APR_ENOTIMPL; -} -#endif - APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, const char *fname, apr_pool_t *pool) diff --git a/locks/netware/locks.c b/locks/netware/locks.c index 71bf356e788..0238761db55 100644 --- a/locks/netware/locks.c +++ b/locks/netware/locks.c @@ -76,7 +76,7 @@ static apr_status_t lock_cleanup(void *lock_) } apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, - const char *fname, apr_pool_t *pool) + apr_lockmech_e mech, const char *fname, apr_pool_t *pool) { apr_lock_t *newlock = NULL; @@ -95,6 +95,10 @@ apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_locksco apr_status_t status; long flags = 0; + if (mech != APR_LOCK_DEFAULT) { + return APR_ENOTIMPL; + } + newlock = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); if(newlock ==NULL) { diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index b8d02663ca5..1903328935a 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -61,19 +61,12 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, const char *fname, + apr_lockmech_e mech, apr_pool_t *pool) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, - const char *fname, - apr_lockmech_e_np mech, - apr_pool_t *pool) -{ - return APR_ENOTIMPL; -} - APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, const char *fname, apr_pool_t *pool) diff --git a/locks/os2/locks.c b/locks/os2/locks.c index 71f58a9b544..0d6abb19db7 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -72,8 +72,8 @@ static apr_status_t lock_cleanup(void *thelock) APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, - apr_lockscope_e scope, const char *fname, - apr_pool_t *pool) + apr_lockscope_e scope, apr_lockmech_e mech, + const char *fname, apr_pool_t *pool) { apr_lock_t *new; ULONG rc; @@ -84,6 +84,10 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type if (type == APR_READWRITE) return APR_ENOTIMPL; + if (mech != APR_LOCK_DEFAULT) { + return APR_ENOTIMPL; + } + new = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); new->pool = pool; diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 3612b7916d5..82714c30da3 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -62,21 +62,12 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, const char *fname, + apr_lockmech_e mech, apr_pool_t *pool) { return APR_ENOTIMPL; } -#if APR_HAS_LOCK_CREATE_NP -APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, - const char *fname, - apr_lockmech_e_np mech, - apr_pool_t *pool) -{ - return APR_ENOTIMPL; -} -#endif - APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, const char *fname, apr_pool_t *pool) diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 7e5d3b69ea4..ac2bc0d734e 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -128,7 +128,7 @@ static const struct apr_unix_lock_methods_t lockall_methods = lockall_child_init }; -static apr_status_t choose_method(apr_lock_t *new, apr_lockmech_e_np mech) +static apr_status_t choose_method(apr_lock_t *new, apr_lockmech_e mech) { switch (mech) { case APR_LOCK_FCNTL: @@ -178,7 +178,7 @@ static apr_status_t choose_method(apr_lock_t *new, apr_lockmech_e_np mech) return APR_SUCCESS; } -static apr_status_t create_lock(apr_lock_t *new, apr_lockmech_e_np mech, const char *fname) +static apr_status_t create_lock(apr_lock_t *new, apr_lockmech_e mech, const char *fname) { apr_status_t stat; @@ -230,9 +230,9 @@ static apr_status_t create_lock(apr_lock_t *new, apr_lockmech_e_np mech, const c return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_lock_create_np(apr_lock_t **lock, apr_locktype_e type, - apr_lockscope_e scope, apr_lockmech_e_np mech, - const char *fname, apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, apr_lockmech_e mech, + const char *fname, apr_pool_t *pool) { apr_lock_t *new; apr_status_t stat; @@ -253,13 +253,6 @@ APR_DECLARE(apr_status_t) apr_lock_create_np(apr_lock_t **lock, apr_locktype_e t return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, - apr_lockscope_e scope, const char *fname, - apr_pool_t *pool) -{ - return apr_lock_create_np(lock, type, scope, APR_LOCK_DEFAULT, fname, pool); -} - APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock) { apr_status_t stat; diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 60569d9f7cf..a9513506fca 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -624,15 +624,7 @@ void apr_proc_mutex_unix_setup_lock(void) #endif } - - - - - - - - -static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lockmech_e_np mech) +static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lockmech_e mech) { switch (mech) { case APR_LOCK_FCNTL: @@ -682,7 +674,7 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lo return APR_SUCCESS; } -static apr_status_t proc_mutex_create(apr_proc_mutex_t *new_mutex, apr_lockmech_e_np mech, const char *fname) +static apr_status_t proc_mutex_create(apr_proc_mutex_t *new_mutex, apr_lockmech_e mech, const char *fname) { apr_status_t rv; @@ -703,15 +695,8 @@ static apr_status_t proc_mutex_create(apr_proc_mutex_t *new_mutex, apr_lockmech_ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, const char *fname, + apr_lockmech_e mech, apr_pool_t *pool) -{ - return apr_proc_mutex_create_np(mutex, fname, APR_LOCK_DEFAULT, pool); -} - -APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, - const char *fname, - apr_lockmech_e_np mech, - apr_pool_t *pool) { apr_proc_mutex_t *new_mutex; apr_status_t rv; diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 7a845767644..1730a4a3477 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -85,6 +85,7 @@ static apr_status_t lock_cleanup(void *lock_) APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, + apr_lockmech_e mech, const char *fname, apr_pool_t *pool) { @@ -95,6 +96,10 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, if (type == APR_READWRITE) return APR_ENOTIMPL; + if (mech != APR_LOCK_DEFAULT) { + return APR_ENOTIMPL; + } + newlock = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); newlock->pool = pool; diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 54167e1d279..c37362eb7a3 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -61,19 +61,12 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, const char *fname, + apr_lockmech_e mech, apr_pool_t *pool) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex, - const char *fname, - apr_lockmech_e_np mech, - apr_pool_t *pool) -{ - return APR_ENOTIMPL; -} - APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, const char *fname, apr_pool_t *pool) diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 7cda4233220..0b1d9de5be7 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -209,7 +209,8 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, new_m->curmem = mem; new_m->length = reqsize; - apr_lock_create(&new_m->lock, APR_MUTEX, APR_CROSS_PROCESS, NULL, pool); + apr_lock_create(&new_m->lock, APR_MUTEX, APR_CROSS_PROCESS, + APR_LOCK_DEFAULT, NULL, pool); if (!new_m->lock) return APR_EGENERAL; diff --git a/test/testlock.c b/test/testlock.c index 5b13eb5c27f..f5e2b9b8110 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -267,7 +267,7 @@ apr_status_t test_rw(void) printf("RW Lock Tests\n"); printf("%-60s", " Initializing the RW lock"); s1 = apr_lock_create(&thread_rw_lock, APR_READWRITE, APR_INTRAPROCESS, - "lock.file", pool); + APR_LOCK_DEFAULT, "lock.file", pool); if (s1 != APR_SUCCESS) { printf("Failed!\n"); return s1; @@ -315,7 +315,7 @@ apr_status_t test_exclusive(void) printf("Exclusive lock test\n"); printf("%-60s", " Initializing the lock"); s1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, - "lock.file", pool); + APR_LOCK_DEFAULT, "lock.file", pool); if (s1 != APR_SUCCESS) { printf("Failed!\n"); @@ -363,8 +363,8 @@ apr_status_t test_multiple_locking(const char *lockfile) printf("Testing multiple locking\n"); printf("%-60s"," Creating the lock we'll use"); - if ((rv = apr_lock_create(&multi, APR_MUTEX, APR_LOCKALL, lockfile, - pool)) != APR_SUCCESS) { + if ((rv = apr_lock_create(&multi, APR_MUTEX, APR_LOCKALL, APR_LOCK_DEFAULT, + lockfile, pool)) != APR_SUCCESS) { printf("Failed!\n"); return rv; } diff --git a/test/testlockperf.c b/test/testlockperf.c index 697977a3b00..20f1681ef42 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -154,8 +154,8 @@ int test_inter_mutex(void) printf("apr_lock(INTRAPROCESS, MUTEX) Lock Tests\n"); printf("%-60s", " Initializing the apr_lock_t"); - s1 = apr_lock_create(&inter_lock, APR_MUTEX, APR_INTRAPROCESS, - "lock.file", pool); + s1 = apr_lock_create(&inter_lock, APR_MUTEX, APR_INTRAPROCESS, + APR_LOCK_DEFAULT, "lock.file", pool); if (s1 != APR_SUCCESS) { printf("Failed!\n"); return s1; @@ -305,7 +305,7 @@ int test_inter_rwlock(void) printf("apr_lock(INTRAPROCESS, READWRITE) Lock Tests\n"); printf("%-60s", " Initializing the apr_lock_t"); s1 = apr_lock_create(&inter_rwlock, APR_READWRITE, APR_INTRAPROCESS, - "lock.file", pool); + APR_LOCK_DEFAULT, "lock.file", pool); if (s1 != APR_SUCCESS) { printf("Failed!\n"); return s1; diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 92f62e2b328..64510022839 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -104,7 +104,7 @@ static apr_status_t test_exclusive(const char *lockname) printf("Exclusive lock test\n"); printf("%-60s", " Initializing the lock"); - s1 = apr_proc_mutex_create(&proc_lock, lockname, pool); + s1 = apr_proc_mutex_create(&proc_lock, lockname, APR_LOCK_DEFAULT, pool); if (s1 != APR_SUCCESS) { printf("Failed!\n"); diff --git a/test/testthread.c b/test/testthread.c index f77a79f79d4..9dfb1b61689 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -129,7 +129,8 @@ int main(void) apr_thread_once_init(&control, context); printf("%-60s", "Initializing the lock"); - r1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); + r1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, + APR_LOCK_DEFAULT, "lock.file", context); if (r1 != APR_SUCCESS) { fflush(stdout); fprintf(stderr, "Failed\nCould not create lock\n"); From 69f602048d463b0377765a85240aa84a255c2a0c Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 30 Dec 2001 14:30:58 +0000 Subject: [PATCH 2682/7878] OS/2: switch buffered file I/O over to using apr_thread_mutex_t instead of apr_lock_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62685 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 5 ++--- file_io/os2/readwrite.c | 8 ++++---- include/arch/os2/fileio.h | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index a80f4d56a48..6664da334e3 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -99,8 +99,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr if (dafile->buffered) { dafile->buffer = apr_palloc(cntxt, APR_FILE_BUFSIZE); - rv = apr_lock_create(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, - APR_LOCK_DEFAULT, NULL, cntxt); + rv = apr_thread_mutex_create(&dafile->mutex, 0, cntxt); if (rv) return rv; @@ -173,7 +172,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) } if (file->buffered) - apr_lock_destroy(file->mutex); + apr_thread_mutex_destroy(file->mutex); return APR_SUCCESS; } diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index d2cea2e8f00..8f521a4fed6 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -77,7 +77,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size ULONG blocksize; ULONG size = *nbytes; - apr_lock_acquire(thefile->mutex); + apr_thread_mutex_lock(thefile->mutex); if (thefile->direction == 1) { apr_file_flush(thefile); @@ -111,7 +111,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } *nbytes = rc == 0 ? pos - (char *)buf : 0; - apr_lock_release(thefile->mutex); + apr_thread_mutex_unlock(thefile->mutex); if (*nbytes == 0 && rc == 0) { return APR_EOF; @@ -164,7 +164,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a int blocksize; int size = *nbytes; - apr_lock_acquire(thefile->mutex); + apr_thread_mutex_lock(thefile->mutex); if ( thefile->direction == 0 ) { // Position file pointer for writing at the offset we are logically reading from @@ -186,7 +186,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a size -= blocksize; } - apr_lock_release(thefile->mutex); + apr_thread_mutex_unlock(thefile->mutex); return APR_OS2_STATUS(rc); } else { if (thefile->flags & APR_APPEND) { diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index 71ab018f3f8..9e81315bc96 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -57,7 +57,7 @@ #include "apr_private.h" #include "apr_general.h" -#include "apr_lock.h" +#include "apr_thread_mutex.h" #include "apr_file_io.h" #include "apr_file_info.h" #include "apr_errno.h" @@ -89,7 +89,7 @@ struct apr_file_t { unsigned long dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write unsigned long filePtr; // position in file of handle - apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields + apr_thread_mutex_t *mutex;// mutex semaphore, must be owned to access the above fields }; struct apr_dir_t { From 68501b0dc07554f2c928abc3e21963ba4fb10303 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 30 Dec 2001 19:50:46 +0000 Subject: [PATCH 2683/7878] Seems this symbol is simply too new, use it's hardcode value. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62686 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/rand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 6948d15bcee..609e98bd64d 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -62,8 +62,10 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, HCRYPTPROV hProv; apr_status_t res = APR_SUCCESS; + /* 0x40 bit = CRYPT_SILENT, only introduced in more recent PSDKs + */ if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) { + CRYPT_VERIFYCONTEXT | 0x40)) { return apr_get_os_error(); } if (!CryptGenRandom(hProv, length, buf)) { From 4a7516ffc170e83a40635f1014f2407823030a69 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 30 Dec 2001 20:46:22 +0000 Subject: [PATCH 2684/7878] Never had set the global apr_os_level (outch!) Also improve the versioning for several significant API events. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62687 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/misc.h | 30 ++++++---- misc/win32/misc.c | 113 ++++++++++++++++++++++++++------------ 2 files changed, 98 insertions(+), 45 deletions(-) diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 463a4093d41..2436f9360e1 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -104,16 +104,26 @@ struct apr_other_child_rec_t { * export new kernel or winsock functions or behavior. */ typedef enum { - APR_WIN_UNK = 0, - APR_WIN_95 = 2, - APR_WIN_98 = 4, - APR_WIN_NT = 8, - APR_WIN_NT_4 = 12, - APR_WIN_NT_4_SP2 = 14, - APR_WIN_NT_4_SP3 = 15, - APR_WIN_NT_4_SP4 = 16, - APR_WIN_NT_4_SP6 = 18, - APR_WIN_2000 = 24 + APR_WIN_UNK = 0, + APR_WIN_UNSUP = 1, + APR_WIN_95 = 10, + APR_WIN_95_B = 11, + APR_WIN_95_OSR2 = 12, + APR_WIN_98 = 14, + APR_WIN_98_SE = 16, + APR_WIN_ME = 18, + APR_WIN_NT_3_5 = 35, + APR_WIN_NT_3_51 = 36, + APR_WIN_NT_4 = 40, + APR_WIN_NT_4_SP2 = 42, + APR_WIN_NT_4_SP3 = 43, + APR_WIN_NT_4_SP4 = 44, + APR_WIN_NT_4_SP5 = 45, + APR_WIN_NT_4_SP6 = 46, + APR_WIN_2000 = 50, + APR_WIN_2000_SP1 = 51, + APR_WIN_2000_SP2 = 52, + APR_WIN_XP = 60 } apr_oslevel_e; extern apr_oslevel_e apr_os_level; diff --git a/misc/win32/misc.c b/misc/win32/misc.c index ef3cd28a279..102db5db8f6 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -62,60 +62,103 @@ apr_status_t apr_get_oslevel(apr_pool_t *cont, apr_oslevel_e *level) if (apr_os_level == APR_WIN_UNK) { static OSVERSIONINFO oslev; - static unsigned int servpack = 0; - char *pservpack; - oslev.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&oslev); - if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) { - for (pservpack = oslev.szCSDVersion; - *pservpack && !isdigit(*pservpack); pservpack++) - ; - if (*pservpack) - servpack = atoi(pservpack); - } - if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) { - if (oslev.dwMajorVersion == 5) { - (*level) = APR_WIN_2000; + + if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) + { + static unsigned int servpack = 0; + char *pservpack; + if (pservpack = oslev.szCSDVersion) { + while (*pservpack && !isdigit(*pservpack)) { + pservpack++; + } + if (*pservpack) + servpack = atoi(pservpack); } - else if (oslev.dwMajorVersion == 4) { - if (servpack >= 6) { - (*level) = APR_WIN_NT_4_SP6; + + if (oslev.dwMajorVersion < 3) { + apr_os_level = APR_WIN_UNSUP; + } + else if (oslev.dwMajorVersion == 3) { + if (oslev.dwMajorVersion < 50) { + apr_os_level = APR_WIN_UNSUP; } - else if (servpack >= 4) { - (*level) = APR_WIN_NT_4_SP4; + else if (oslev.dwMajorVersion == 50) { + apr_os_level = APR_WIN_NT_3_5; } - else if (servpack >= 3) { - (*level) = APR_WIN_NT_4_SP3; + else { + apr_os_level = APR_WIN_NT_3_51; } - else if (servpack >= 2) { - (*level) = APR_WIN_NT_4_SP2; + } + else if (oslev.dwMajorVersion == 4) { + if (servpack < 2) + apr_os_level = APR_WIN_NT_4; + else if (servpack <= 2) + apr_os_level = APR_WIN_NT_4_SP2; + else if (servpack <= 3) + apr_os_level = APR_WIN_NT_4_SP3; + else if (servpack <= 4) + apr_os_level = APR_WIN_NT_4_SP4; + else if (servpack <= 5) + apr_os_level = APR_WIN_NT_4_SP5; + else + apr_os_level = APR_WIN_NT_4_SP6; + } + else if (oslev.dwMajorVersion == 5) { + if (oslev.dwMinorVersion == 0) { + if (servpack == 0) + apr_os_level = APR_WIN_2000; + else if (servpack == 1) + apr_os_level = APR_WIN_2000_SP1; + else + apr_os_level = APR_WIN_2000_SP2; } else { - (*level) = APR_WIN_NT_4; + apr_os_level = APR_WIN_XP; } } else { - (*level) = APR_WIN_NT; + apr_os_level = APR_WIN_XP; } - return APR_SUCCESS; } else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { - if (oslev.dwMinorVersion == 0) { - (*level) = APR_WIN_95; - return APR_SUCCESS; + char *prevision; + if (prevision = oslev.szCSDVersion) { + while (*prevision && !isupper(*prevision)) { + prevision++; + } + } + else prevision = ""; + + if (oslev.dwMinorVersion < 10) { + if (*prevision < 'C') + apr_os_level = APR_WIN_95; + else + apr_os_level = APR_WIN_95_OSR2; + } + else if (oslev.dwMinorVersion < 90) { + if (*prevision < 'A') + apr_os_level = APR_WIN_98; + else + apr_os_level = APR_WIN_98_SE; } - else if (oslev.dwMinorVersion > 0) { - (*level) = APR_WIN_98; - return APR_SUCCESS; + else { + apr_os_level = APR_WIN_ME; } } + else { + apr_os_level = APR_WIN_UNSUP; + } } - else { - *level = apr_os_level; - return APR_SUCCESS; + + *level = apr_os_level; + + if (apr_os_level < APR_WIN_UNSUP) { + return APR_EGENERAL; } - return APR_EGENERAL; + + return APR_SUCCESS; } From bfb84c87cc8f56f4c8418cb495c1aff1792ab6fe Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 30 Dec 2001 20:54:38 +0000 Subject: [PATCH 2685/7878] Outch, dropped the most essential test for Unicodeness git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62688 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/misc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 2436f9360e1..454deb5cf0c 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -112,6 +112,7 @@ typedef enum { APR_WIN_98 = 14, APR_WIN_98_SE = 16, APR_WIN_ME = 18, + APR_WIN_NT = 30, APR_WIN_NT_3_5 = 35, APR_WIN_NT_3_51 = 36, APR_WIN_NT_4 = 40, From 98b8105a12bdb4e9da1f3c2125cd6cc2b05a38c9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 30 Dec 2001 22:25:49 +0000 Subject: [PATCH 2686/7878] Doug MacEachern commented to me that perl, and some other apps, are calling GetModuleName or other Win32 APIs to retrieve the relative or working path. Since some of these app authors have never observed an '\\?\D\Somepath" style unlimited-length filename, and retrieve as much when we spawn a process with that format, it's probably much safer to drop the extra decoration when we don't need it (because our filename is smaller than the Win32 MAX_PATH length.) So this patch does just that, and only uses "\\?\" notation when the filename is quite huge. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62689 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 09ef76c9a4c..aad54853ebe 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -84,20 +84,34 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, int srcremains = strlen(srcstr) + 1; apr_wchar_t *t = retstr; apr_status_t rv; - if (srcstr[1] == ':' && (srcstr[2] == '/' || srcstr[2] == '\\')) { - wcscpy (retstr, L"\\\\?\\"); - retlen -= 4; - t += 4; - } - else if ((srcstr[0] == '/' || srcstr[0] == '\\') - && (srcstr[1] == '/' || srcstr[1] == '\\') - && (srcstr[2] != '?')) { - /* Skip the slashes */ - srcstr += 2; - srcremains -= 2; - wcscpy (retstr, L"\\\\?\\UNC\\"); - retlen -= 8; - t += 8; + + /* This is correct, we don't twist the filename if it is will + * definately be shorter than MAX_PATH. It merits some + * performance testing to see if this has any effect, but there + * seem to be applications that get confused by the resulting + * Unicode \\?\ style file names, especially if they use argv[0] + * or call the Win32 API functions such as GetModuleName, etc. + * Not every application is prepared to handle such names. + * + * Note that a utf-8 name can never result in more wide chars + * than the original number of utf-8 narrow chars. + */ + if (srcremains > MAX_PATH) { + if (srcstr[1] == ':' && (srcstr[2] == '/' || srcstr[2] == '\\')) { + wcscpy (retstr, L"\\\\?\\"); + retlen -= 4; + t += 4; + } + else if ((srcstr[0] == '/' || srcstr[0] == '\\') + && (srcstr[1] == '/' || srcstr[1] == '\\') + && (srcstr[2] != '?')) { + /* Skip the slashes */ + srcstr += 2; + srcremains -= 2; + wcscpy (retstr, L"\\\\?\\UNC\\"); + retlen -= 8; + t += 8; + } } if (rv = conv_utf8_to_ucs2(srcstr, &srcremains, t, &retlen)) { From 787a3d68cbd5092a031c1add7fd00ceb656eb37d Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 1 Jan 2002 22:46:48 +0000 Subject: [PATCH 2687/7878] * memory/unix/apr_pools.c (apr_pool_create_ex): Properly inherit abort_fn if NULL is passed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62690 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 54440960a58..3a37a821f7c 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -544,6 +544,9 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, if (!parent) parent = global_pool; + if (!abort_fn) + abort_fn = parent ? parent->abort_fn : NULL; + allocator = parent ? parent->allocator : &global_allocator; if ((node = node_malloc(allocator, MIN_ALLOC - SIZEOF_NODE_T)) == NULL) { if (abort_fn) From ad27277cd6e23b43ae90cec410efc3f4ba2b3ca4 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 1 Jan 2002 23:49:23 +0000 Subject: [PATCH 2688/7878] Fill in code that is to be used when APR_POOL_DEBUG is defined. Every apr_p[c]alloc is hereby effectively turned into a malloc. apr_pool_clear free()s all memory in a pool. This will make using third party tools like electric fence a lot more helpfull. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62691 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 266 ++++++------ memory/unix/apr_pools.c | 890 +++++++++++++++++++++++++++++----------- 2 files changed, 806 insertions(+), 350 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index c7cc49ce0a0..c9528267f48 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -107,119 +107,19 @@ typedef struct apr_pool_t apr_pool_t; /** A function that is called when allocation fails. */ typedef int (*apr_abortfunc_t)(int retcode); -/** - * @defgroup PoolDebug Pool Debugging functions. - * - * pools have nested lifetimes -- sub_pools are destroyed when the - * parent pool is cleared. We allow certain liberties with operations - * on things such as tables (and on other structures in a more general - * sense) where we allow the caller to insert values into a table which - * were not allocated from the table's pool. The table's data will - * remain valid as long as all the pools from which its values are - * allocated remain valid. - * - * For example, if B is a sub pool of A, and you build a table T in - * pool B, then it's safe to insert data allocated in A or B into T - * (because B lives at most as long as A does, and T is destroyed when - * B is cleared/destroyed). On the other hand, if S is a table in - * pool A, it is safe to insert data allocated in A into S, but it - * is *not safe* to insert data allocated from B into S... because - * B can be cleared/destroyed before A is (which would leave dangling - * pointers in T's data structures). - * - * In general we say that it is safe to insert data into a table T - * if the data is allocated in any ancestor of T's pool. This is the - * basis on which the APR_POOL_DEBUG code works -- it tests these ancestor - * relationships for all data inserted into tables. APR_POOL_DEBUG also - * provides tools (apr_find_pool, and apr_pool_is_ancestor) for other - * folks to implement similar restrictions for their own data - * structures. - * - * However, sometimes this ancestor requirement is inconvenient -- - * sometimes we're forced to create a sub pool (such as through - * apr_sub_req_lookup_uri), and the sub pool is guaranteed to have - * the same lifetime as the parent pool. This is a guarantee implemented - * by the *caller*, not by the pool code. That is, the caller guarantees - * they won't destroy the sub pool individually prior to destroying the - * parent pool. - * - * In this case the caller must call apr_pool_join() to indicate this - * guarantee to the APR_POOL_DEBUG code. There are a few examples spread - * through the standard modules. - * - * These functions are only implemented when #APR_POOL_DEBUG is set. - * - * @{ - */ -#if defined(APR_POOL_DEBUG) || defined(DOXYGEN) -/** - * Guarantee that a subpool has the same lifetime as the parent. - * @param p The parent pool - * @param sub The subpool - */ -APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub); - -/** - * Find a pool from something allocated in it. - * @param ts The thing allocated in the pool - * @return The pool it is allocated in - */ -APR_DECLARE(apr_pool_t *) apr_find_pool(const void *ts); +/** Pool creation flags */ -/** - * Report the number of bytes currently in the pool - * @param p The pool to inspect - * @param recurse Recurse/include the subpools' sizes - * @return The number of bytes - */ -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse); - -/** - * Report the number of bytes currently in the list of free blocks - * @return The number of bytes - */ -APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void); - -/** - * Lock a pool - * @param pool The pool to lock - * @param flag The flag - */ -APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); - -/* @} */ - -#else -# ifdef apr_pool_join -# undef apr_pool_join -# endif -# define apr_pool_join(a,b) - -# ifdef apr_pool_lock -# undef apr_pool_lock -# endif -# define apr_pool_lock(pool, lock) -#endif +#define APR_POOL_FDEFAULT 0x0 +#define APR_POOL_FNEW_ALLOCATOR 0x1 +#define APR_POOL_FLOCK 0x2 -/** - * Tag a pool (give it a name) - * @param pool The pool to tag - * @param tag The tag - */ -APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag); -/** - * Determine if pool a is an ancestor of pool b - * @param a The pool to search - * @param b The pool to search for - * @return True if a is an ancestor of b, NULL is considered an ancestor - * of all pools. +/* + * APR memory structure manipulators (pools, tables, and arrays). */ -APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); - /* - * APR memory structure manipulators (pools, tables, and arrays). + * Initialization */ /** @@ -237,12 +137,11 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void); * @internal */ APR_DECLARE(void) apr_pool_terminate(void); - -/* pool functions */ -#define APR_POOL_FDEFAULT 0x0 -#define APR_POOL_FNEW_ALLOCATOR 0x1 -#define APR_POOL_FLOCK 0x2 + +/* + * Pool creation/destruction + */ /** * Create a new pool. @@ -298,6 +197,19 @@ APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **newpool, (void)apr_pool_create_ex(newpool, parent, abort_fn, APR_POOL_FDEFAULT); #endif +/** + * Destroy the pool. This takes similar action as apr_pool_clear() and then + * frees all the memory. + * @param p The pool to destroy + * @remark This will actually free the memory + */ +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); + + +/* + * Memory allocation + */ + /** * Allocate a block of memory from a pool * @param p The pool to allocate from @@ -324,12 +236,10 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); */ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); -/** - * Destroy the pool. This runs apr_pool_clear() and then frees all the memory. - * @param p The pool to destroy - * @remark This will actually free the memory + +/* + * Pool Properties */ -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); /** * Set the function to be called when an allocation failure occurs. @@ -359,6 +269,27 @@ APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool); */ APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool); +/** + * Determine if pool a is an ancestor of pool b + * @param a The pool to search + * @param b The pool to search for + * @return True if a is an ancestor of b, NULL is considered an ancestor + * of all pools. + */ +APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); + +/** + * Tag a pool (give it a name) + * @param pool The pool to tag + * @param tag The tag + */ +APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag); + + +/* + * User data management + */ + /** * Set the data associated with the current pool * @param data The user data associated with the pool. @@ -407,6 +338,11 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *pool); + +/* + * Cleanup + */ + /** * Register a function to be called when a pool is cleared or destroyed * @param p The pool register the cleanup with @@ -467,6 +403,102 @@ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); */ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); + +/** + * @defgroup PoolDebug Pool Debugging functions. + * + * pools have nested lifetimes -- sub_pools are destroyed when the + * parent pool is cleared. We allow certain liberties with operations + * on things such as tables (and on other structures in a more general + * sense) where we allow the caller to insert values into a table which + * were not allocated from the table's pool. The table's data will + * remain valid as long as all the pools from which its values are + * allocated remain valid. + * + * For example, if B is a sub pool of A, and you build a table T in + * pool B, then it's safe to insert data allocated in A or B into T + * (because B lives at most as long as A does, and T is destroyed when + * B is cleared/destroyed). On the other hand, if S is a table in + * pool A, it is safe to insert data allocated in A into S, but it + * is *not safe* to insert data allocated from B into S... because + * B can be cleared/destroyed before A is (which would leave dangling + * pointers in T's data structures). + * + * In general we say that it is safe to insert data into a table T + * if the data is allocated in any ancestor of T's pool. This is the + * basis on which the APR_POOL_DEBUG code works -- it tests these ancestor + * relationships for all data inserted into tables. APR_POOL_DEBUG also + * provides tools (apr_find_pool, and apr_pool_is_ancestor) for other + * folks to implement similar restrictions for their own data + * structures. + * + * However, sometimes this ancestor requirement is inconvenient -- + * sometimes we're forced to create a sub pool (such as through + * apr_sub_req_lookup_uri), and the sub pool is guaranteed to have + * the same lifetime as the parent pool. This is a guarantee implemented + * by the *caller*, not by the pool code. That is, the caller guarantees + * they won't destroy the sub pool individually prior to destroying the + * parent pool. + * + * In this case the caller must call apr_pool_join() to indicate this + * guarantee to the APR_POOL_DEBUG code. There are a few examples spread + * through the standard modules. + * + * These functions are only implemented when #APR_POOL_DEBUG is set. + * + * @{ + */ +#if defined(APR_POOL_DEBUG) || defined(DOXYGEN) +/** + * Guarantee that a subpool has the same lifetime as the parent. + * @param p The parent pool + * @param sub The subpool + */ +APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub); + +/** + * Find a pool from something allocated in it. + * @param mem The thing allocated in the pool + * @return The pool it is allocated in + */ +APR_DECLARE(apr_pool_t *) apr_find_pool(const void *mem); + +/** + * Report the number of bytes currently in the pool + * @param p The pool to inspect + * @param recurse Recurse/include the subpools' sizes + * @return The number of bytes + */ +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse); + +/** + * Report the number of bytes currently in the list of free blocks + * @return The number of bytes + */ +APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void); + +/** + * Lock a pool + * @param pool The pool to lock + * @param flag The flag + */ +APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); + +/* @} */ + +#else +# ifdef apr_pool_join +# undef apr_pool_join +# endif +# define apr_pool_join(a,b) + +# ifdef apr_pool_lock +# undef apr_pool_lock +# endif +# define apr_pool_lock(pool, lock) +#endif + + /* * Pool accessor functions. * diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 3a37a821f7c..d075f92a809 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -80,6 +80,7 @@ #define BOUNDARY_INDEX 12 #define BOUNDARY_SIZE (1 << BOUNDARY_INDEX) + /* * Macros and defines */ @@ -90,11 +91,14 @@ #define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) + /* * Structures */ typedef struct cleanup_t cleanup_t; + +#if !defined(APR_POOL_DEBUG) typedef struct allocator_t allocator_t; typedef struct node_t node_t; @@ -114,6 +118,24 @@ struct allocator_t { node_t *free[MAX_INDEX]; }; +#define SIZEOF_NODE_T APR_ALIGN_DEFAULT(sizeof(node_t)) +#define SIZEOF_ALLOCATOR_T APR_ALIGN_DEFAULT(sizeof(allocator_t)) + +#else /* !defined(APR_POOL_DEBUG) */ + +typedef struct debug_node_t debug_node_t; + +struct debug_node_t { + debug_node_t *next; + apr_uint32_t index; + void *beginp[64]; + void *endp[64]; +}; + +#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t)) + +#endif /* !defined(APR_POOL_DEBUG) */ + /* The ref field in the apr_pool_t struct holds a * pointer to the pointer referencing this pool. * It is used for parent, child, sibling management. @@ -121,10 +143,6 @@ struct allocator_t { * to see how it is used. */ struct apr_pool_t { - allocator_t *allocator; - node_t *active; - node_t *self; /* The node containing the pool itself */ - char *self_first_avail; apr_pool_t *parent; apr_pool_t *child; apr_pool_t *sibling; @@ -134,18 +152,32 @@ struct apr_pool_t { apr_abortfunc_t abort_fn; apr_hash_t *user_data; const char *tag; + +#if !defined(APR_POOL_DEBUG) + allocator_t *allocator; + node_t *active; + node_t *self; /* The node containing the pool itself */ + char *self_first_avail; + +#else /* !defined(APR_POOL_DEBUG) */ + debug_node_t *nodes; +#if APR_HAS_THREADS + apr_thread_mutex_t *mutex; +#endif +#endif /* !defined(APR_POOL_DEBUG) */ }; -#define SIZEOF_NODE_T APR_ALIGN_DEFAULT(sizeof(node_t)) -#define SIZEOF_ALLOCATOR_T APR_ALIGN_DEFAULT(sizeof(allocator_t)) #define SIZEOF_POOL_T APR_ALIGN_DEFAULT(sizeof(apr_pool_t)) + /* * Variables */ +static apr_byte_t apr_pools_initialized = 0; static apr_pool_t *global_pool = NULL; -static apr_byte_t global_allocator_initialized = 0; + +#if !defined(APR_POOL_DEBUG) static allocator_t global_allocator = { 0, /* max_index */ #if APR_HAS_THREADS @@ -154,6 +186,62 @@ static allocator_t global_allocator = { NULL, /* owner */ { NULL } /* free[0] */ }; +#endif /* !defined(APR_POOL_DEBUG) */ + + +/* + * Local functions + */ + +static void run_cleanups(cleanup_t *c); +static void run_child_cleanups(cleanup_t *c); +static void free_proc_chain(struct process_chain *procs); + + +#if !defined(APR_POOL_DEBUG) +/* + * Initialization + */ + +APR_DECLARE(apr_status_t) apr_pool_initialize(void) +{ + apr_status_t rv; + + if (apr_pools_initialized++) + return APR_SUCCESS; + + memset(&global_allocator, 0, SIZEOF_ALLOCATOR_T); + + if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, APR_POOL_FDEFAULT)) != APR_SUCCESS) { + return rv; + } + +#if APR_HAS_THREADS + if ((rv = apr_thread_mutex_create(&global_allocator.mutex, + APR_THREAD_MUTEX_DEFAULT, global_pool)) != APR_SUCCESS) { + return rv; + } +#endif + + global_allocator.owner = global_pool; + apr_pools_initialized = 1; + + return APR_SUCCESS; +} + +APR_DECLARE(void) apr_pool_terminate(void) +{ + if (!apr_pools_initialized) + return; + + apr_pools_initialized = 0; + + apr_pool_destroy(global_pool); /* This will also destroy the mutex */ + global_pool = NULL; + + memset(&global_allocator, 0, SIZEOF_ALLOCATOR_T); +} + /* * Memory allocation @@ -409,13 +497,11 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) return mem; } + /* - * Pool management + * Pool creation/destruction */ -static void run_cleanups(cleanup_t *c); -static void free_proc_chain(struct process_chain *procs); - APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) { node_t *active; @@ -544,8 +630,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, if (!parent) parent = global_pool; - if (!abort_fn) - abort_fn = parent ? parent->abort_fn : NULL; + if (!abort_fn && parent) + abort_fn = parent->abort_fn; allocator = parent ? parent->allocator : &global_allocator; if ((node = node_malloc(allocator, MIN_ALLOC - SIZEOF_NODE_T)) == NULL) { @@ -624,220 +710,554 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, return APR_SUCCESS; } -APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abort_fn, - apr_pool_t *pool) -{ - pool->abort_fn = abort_fn; -} -APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool) -{ - return pool->abort_fn; -} +/* + * "Print" functions + */ -APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool) +/* + * apr_psprintf is implemented by writing directly into the current + * block of the pool, starting right at first_avail. If there's + * insufficient room, then a new block is allocated and the earlier + * output is copied over. The new block isn't linked into the pool + * until all the output is done. + * + * Note that this is completely safe because nothing else can + * allocate in this apr_pool_t while apr_psprintf is running. alarms are + * blocked, and the only thing outside of apr_pools.c that's invoked + * is apr_vformatter -- which was purposefully written to be + * self-contained with no callouts. + */ + +struct psprintf_data { + apr_vformatter_buff_t vbuff; + node_t *node; + allocator_t *allocator; + apr_byte_t got_a_new_node; + node_t *free; +}; + +static int psprintf_flush(apr_vformatter_buff_t *vbuff) { - return pool->parent; + struct psprintf_data *ps = (struct psprintf_data *)vbuff; + node_t *node, *active; + apr_size_t cur_len; + char *strp; + allocator_t *allocator; + + allocator = ps->allocator; + node = ps->node; + strp = ps->vbuff.curpos; + cur_len = strp - node->first_avail; + + if ((active = node_malloc(allocator, cur_len << 1)) == NULL) + return -1; + + memcpy(active->first_avail, node->first_avail, cur_len); + + /* Reset the previous active node */ + node->first_avail = (char *)node + SIZEOF_NODE_T; + + if (ps->got_a_new_node) { + node->next = ps->free; + ps->free = node; + } + + ps->node = active; + ps->vbuff.curpos = active->first_avail + cur_len; + ps->vbuff.endpos = active->endp - 1; /* Save a byte for NUL terminator */ + ps->got_a_new_node = 1; + + return 0; } -/* return TRUE if a is an ancestor of b - * NULL is considered an ancestor of all pools - */ -APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) +APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) { - if (a == NULL) - return 1; + struct psprintf_data ps; + char *strp; + apr_size_t size; + node_t *active; - while (b) { - if (a == b) - return 1; + ps.node = active = pool->active; + ps.allocator = pool->allocator; + ps.vbuff.curpos = ps.node->first_avail; - b = b->parent; + /* Save a byte for the NUL terminator */ + ps.vbuff.endpos = ps.node->endp - 1; + ps.got_a_new_node = 0; + ps.free = NULL; + + if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) { + if (pool->abort_fn) + pool->abort_fn(APR_ENOMEM); + + return NULL; } - return 0; + strp = ps.vbuff.curpos; + *strp++ = '\0'; + + size = strp - ps.node->first_avail; + size = APR_ALIGN_DEFAULT(size); + strp = ps.node->first_avail; + ps.node->first_avail += size; + + /* + * Link the node in if it's a new one + */ + if (ps.got_a_new_node) { + active->next = pool->active = ps.node; + } + + if (ps.free) + node_free(ps.allocator, ps.free); + + return strp; } + +#else /* !defined(APR_POOL_DEBUG) */ /* - * Initialization + * Initialization (debug) */ APR_DECLARE(apr_status_t) apr_pool_initialize(void) { apr_status_t rv; - if (global_allocator_initialized++) + if (apr_pools_initialized++) return APR_SUCCESS; - memset(&global_allocator, 0, SIZEOF_ALLOCATOR_T); - - if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, APR_POOL_FDEFAULT)) != APR_SUCCESS) { + if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, + APR_POOL_FNEW_ALLOCATOR|APR_POOL_FLOCK)) != APR_SUCCESS) { return rv; } -#if APR_HAS_THREADS - if ((rv = apr_thread_mutex_create(&global_allocator.mutex, - APR_THREAD_MUTEX_DEFAULT, global_pool)) != APR_SUCCESS) { - return rv; - } -#endif - - global_allocator.owner = global_pool; - global_allocator_initialized = 1; + apr_pools_initialized = 1; return APR_SUCCESS; } APR_DECLARE(void) apr_pool_terminate(void) { - if (!global_allocator_initialized) + if (!apr_pools_initialized) return; - global_allocator_initialized = 0; + apr_pools_initialized = 0; apr_pool_destroy(global_pool); /* This will also destroy the mutex */ global_pool = NULL; - - memset(&global_allocator, 0, SIZEOF_ALLOCATOR_T); } + /* - * Cleanup + * Memory allocation (debug) */ -struct cleanup_t { - struct cleanup_t *next; - const void *data; - apr_status_t (*plain_cleanup_fn)(void *data); - apr_status_t (*child_cleanup_fn)(void *data); -}; - -APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup_fn)(void *data), - apr_status_t (*child_cleanup_fn)(void *data)) +APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) { - cleanup_t *c; + debug_node_t *node; + void *mem; - if (p != NULL) { - c = (cleanup_t *) apr_palloc(p, sizeof(cleanup_t)); - c->data = data; - c->plain_cleanup_fn = plain_cleanup_fn; - c->child_cleanup_fn = child_cleanup_fn; - c->next = p->cleanups; - p->cleanups = c; - } -} + if ((mem = malloc(size)) == NULL) { + if (pool->abort_fn) + pool->abort_fn(APR_ENOMEM); -APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup_fn)(void *)) -{ - cleanup_t *c, **lastp; + return NULL; + } - if (p == NULL) - return; + node = pool->nodes; + if (node == NULL || node->index == 64) { + if ((node = malloc(SIZEOF_DEBUG_NODE_T)) == NULL) { + if (pool->abort_fn) + pool->abort_fn(APR_ENOMEM); - c = p->cleanups; - lastp = &p->cleanups; - while (c) { - if (c->data == data && c->plain_cleanup_fn == cleanup_fn) { - *lastp = c->next; - break; + return NULL; } - lastp = &c->next; - c = c->next; + node->next = pool->nodes; + pool->nodes = node; + node->index = 0; } + + node->beginp[node->index] = mem; + node->endp[node->index] = (char *)mem + size; + node->index++; + + return mem; } -APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup_fn) (void *), - apr_status_t (*child_cleanup_fn) (void *)) +APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) { - cleanup_t *c; + void *mem; + + mem = apr_palloc(pool, size); + memset(mem, 0, size); - if (p == NULL) - return; + return mem; +} - c = p->cleanups; - while (c) { - if (c->data == data && c->plain_cleanup_fn == plain_cleanup_fn) { - c->child_cleanup_fn = child_cleanup_fn; - break; + +/* + * Pool creation/destruction (debug) + */ + +APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) +{ + debug_node_t *node; + apr_uint32_t index; + + /* Destroy the subpools. The subpools will detach themselves from + * this pool thus this loop is safe and easy. + */ + while (pool->child) + apr_pool_destroy(pool->child); + + /* Run cleanups */ + run_cleanups(pool->cleanups); + pool->cleanups = NULL; + + /* Free subprocesses */ + free_proc_chain(pool->subprocesses); + pool->subprocesses = NULL; + + /* Clear the user data. */ + pool->user_data = NULL; + + /* Free the blocks */ + while ((node = pool->nodes) != NULL) { + pool->nodes = node->next; + + for (index = 0; index < node->index; index++) + free(node->beginp[index]); + + free(node); + } +} + +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) +{ + apr_pool_clear(pool); + + /* Remove the pool from the parents child list */ + if (pool->parent) { +#if APR_HAS_THREADS + apr_thread_mutex_t *mutex; + + if ((mutex = pool->parent->mutex) != NULL) + apr_thread_mutex_lock(mutex); +#endif + + if ((*pool->ref = pool->sibling) != NULL) + pool->sibling->ref = pool->ref; + +#if APR_HAS_THREADS + if (mutex) + apr_thread_mutex_unlock(mutex); +#endif + } + + /* Free the pool itself */ + free(pool); +} + +APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_uint32_t flags) +{ + apr_pool_t *pool; + + *newpool = NULL; + + if (!parent) + parent = global_pool; + + if (!abort_fn && parent) + abort_fn = parent->abort_fn; + + if ((pool = malloc(SIZEOF_POOL_T)) == NULL) { + if (abort_fn) + abort_fn(APR_ENOMEM); + + return APR_ENOMEM; + } + + pool->abort_fn = abort_fn; + pool->child = NULL; + pool->cleanups = NULL; + pool->subprocesses = NULL; + pool->user_data = NULL; + pool->tag = NULL; + pool->nodes = NULL; + + if ((flags & APR_POOL_FNEW_ALLOCATOR) == APR_POOL_FNEW_ALLOCATOR) { +#if APR_HAS_THREADS + if ((flags & APR_POOL_FLOCK) == APR_POOL_FLOCK) { + apr_status_t rv; + + if ((rv = apr_thread_mutex_create(&pool->mutex, + APR_THREAD_MUTEX_DEFAULT, pool)) != APR_SUCCESS) { + free(pool); + return rv; + } } +#endif + } + else { + if (parent) + pool->mutex = parent->mutex; + } - c = c->next; + if ((pool->parent = parent) != NULL) { +#if APR_HAS_THREADS + if (parent->mutex) + apr_thread_mutex_lock(parent->mutex); +#endif + if ((pool->sibling = parent->child) != NULL) + pool->sibling->ref = &pool->sibling; + + parent->child = pool; + pool->ref = &parent->child; + +#if APR_HAS_THREADS + if (parent->mutex) + apr_thread_mutex_unlock(parent->mutex); +#endif + } + else { + pool->sibling = NULL; + pool->ref = NULL; } + + *newpool = pool; + + return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, - apr_status_t (*cleanup_fn) (void *)) + +/* + * "Print" functions (debug) + */ + +struct psprintf_data { + apr_vformatter_buff_t vbuff; + char *mem; + apr_size_t size; +}; + +static int psprintf_flush(apr_vformatter_buff_t *vbuff) { - apr_pool_cleanup_kill(p, data, cleanup_fn); - return (*cleanup_fn)(data); + struct psprintf_data *ps = (struct psprintf_data *)vbuff; + apr_size_t size; + + size = ps->vbuff.curpos - ps->mem; + + ps->size <<= 1; + if ((ps->mem = realloc(ps->mem, ps->size)) == NULL) + return -1; + + ps->vbuff.curpos = ps->mem + size; + ps->vbuff.endpos = ps->mem + ps->size - 1; + + return 0; } -static void run_cleanups(cleanup_t *c) +APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) { - while (c) { - (*c->plain_cleanup_fn)((void *)c->data); - c = c->next; + struct psprintf_data ps; + debug_node_t *node; + + ps.size = 64; + ps.mem = malloc(ps.size); + ps.vbuff.curpos = ps.mem; + + /* Save a byte for the NUL terminator */ + ps.vbuff.endpos = ps.mem + ps.size - 1; + + if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) { + if (pool->abort_fn) + pool->abort_fn(APR_ENOMEM); + + return NULL; } + + *ps.vbuff.curpos++ = '\0'; + + /* + * Link the node in + */ + node = pool->nodes; + if (node == NULL || node->index == 64) { + if ((node = malloc(SIZEOF_DEBUG_NODE_T)) == NULL) { + if (pool->abort_fn) + pool->abort_fn(APR_ENOMEM); + + return NULL; + } + + node->next = pool->nodes; + pool->nodes = node; + node->index = 0; + } + + node->beginp[node->index] = ps.mem; + node->endp[node->index] = ps.mem + ps.size; + node->index++; + + return ps.mem; } -static void run_child_cleanups(cleanup_t *c) + +/* + * Debug functions + */ + +APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) { - while (c) { - (*c->child_cleanup_fn)((void *)c->data); - c = c->next; +} + +static apr_pool_t *find_pool(apr_pool_t *pool, const void *mem) +{ + apr_pool_t *found; + debug_node_t *node; + apr_uint32_t index; + + while (pool) { + node = pool->nodes; + + while (node) { + for (index = 0; index < node->index; index++) { + if (node->beginp[index] <= mem && + node->endp[index] > mem) + return pool; + } + + node = node->next; + } + + if ((found = find_pool(pool->child, mem)) != NULL) + return found; + + pool = pool->sibling; } + + return NULL; } -static void cleanup_pool_for_exec(apr_pool_t *p) +APR_DECLARE(apr_pool_t *) apr_find_pool(const void *mem) { - run_child_cleanups(p->cleanups); - p->cleanups = NULL; + return find_pool(global_pool, mem); +} - for (p = p->child; p; p = p->sibling) - cleanup_pool_for_exec(p); +static apr_size_t pool_num_bytes(apr_pool_t *pool) +{ + apr_size_t size = 0; + debug_node_t *node; + apr_uint32_t index; + + node = pool->nodes; + + while (node) { + for (index = 0; index < node->index; index++) { + size += node->endp[index] - node->beginp[index]; + } + + node = node->next; + } + + return size; } -APR_DECLARE(void) apr_pool_cleanup_for_exec(void) +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *pool, int recurse) { -#if !defined(WIN32) && !defined(OS2) - /* - * Don't need to do anything on NT or OS/2, because I - * am actually going to spawn the new process - not - * exec it. All handles that are not inheritable, will - * be automajically closed. The only problem is with - * file handles that are open, but there isn't much - * I can do about that (except if the child decides - * to go out and close them - */ - cleanup_pool_for_exec(global_pool); -#endif /* !defined(WIN32) && !defined(OS2) */ + apr_size_t size; + + size = pool_num_bytes(pool); + + if (recurse) { + pool = pool->child; + + while (pool) { + size += apr_pool_num_bytes(pool, 1); + + pool = pool->sibling; + } + } + + return size; } -APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) +APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void) +{ + /* This really doesn't apply with our current debug code, so: */ + return 0; +} + +APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag) { - /* do nothing cleanup routine */ - return APR_SUCCESS; } +#endif /* !defined(APR_POOL_DEBUG) */ + /* - * Debug functions + * "Print" functions (common) */ -APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag) +APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) { - pool->tag = tag; + va_list ap; + char *res; + + va_start(ap, fmt); + res = apr_pvsprintf(p, fmt, ap); + va_end(ap); + return res; +} + +/* + * Pool Properties + */ + +APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abort_fn, + apr_pool_t *pool) +{ + pool->abort_fn = abort_fn; +} + +APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool) +{ + return pool->abort_fn; +} + +APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool) +{ + return pool->parent; } -#if defined(APR_POOL_DEBUG) -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse) +/* return TRUE if a is an ancestor of b + * NULL is considered an ancestor of all pools + */ +APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) { + if (a == NULL) + return 1; + + while (b) { + if (a == b) + return 1; + + b = b->parent; + } + return 0; } -#endif + +APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag) +{ + pool->tag = tag; +} + /* * User data management @@ -891,130 +1311,134 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, ap /* - * "Print" functions - */ - -/* - * apr_psprintf is implemented by writing directly into the current - * block of the pool, starting right at first_avail. If there's - * insufficient room, then a new block is allocated and the earlier - * output is copied over. The new block isn't linked into the pool - * until all the output is done. - * - * Note that this is completely safe because nothing else can - * allocate in this apr_pool_t while apr_psprintf is running. alarms are - * blocked, and the only thing outside of alloc.c that's invoked - * is apr_vformatter -- which was purposefully written to be - * self-contained with no callouts. + * Cleanup */ -struct psprintf_data { - apr_vformatter_buff_t vbuff; - node_t *node; - allocator_t *allocator; - apr_byte_t got_a_new_node; - node_t *free; +struct cleanup_t { + struct cleanup_t *next; + const void *data; + apr_status_t (*plain_cleanup_fn)(void *data); + apr_status_t (*child_cleanup_fn)(void *data); }; -static int psprintf_flush(apr_vformatter_buff_t *vbuff) +APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup_fn)(void *data), + apr_status_t (*child_cleanup_fn)(void *data)) { - struct psprintf_data *ps = (struct psprintf_data *)vbuff; - node_t *node, *active; - apr_size_t cur_len; - char *strp; - allocator_t *allocator; + cleanup_t *c; - allocator = ps->allocator; - node = ps->node; - strp = ps->vbuff.curpos; - cur_len = strp - node->first_avail; + if (p != NULL) { + c = (cleanup_t *) apr_palloc(p, sizeof(cleanup_t)); + c->data = data; + c->plain_cleanup_fn = plain_cleanup_fn; + c->child_cleanup_fn = child_cleanup_fn; + c->next = p->cleanups; + p->cleanups = c; + } +} - if ((active = node_malloc(allocator, cur_len << 1)) == NULL) - return -1; +APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, + apr_status_t (*cleanup_fn)(void *)) +{ + cleanup_t *c, **lastp; - memcpy(active->first_avail, node->first_avail, cur_len); + if (p == NULL) + return; - /* Reset the previous active node */ - node->first_avail = (char *)node + SIZEOF_NODE_T; + c = p->cleanups; + lastp = &p->cleanups; + while (c) { + if (c->data == data && c->plain_cleanup_fn == cleanup_fn) { + *lastp = c->next; + break; + } - if (ps->got_a_new_node) { - node->next = ps->free; - ps->free = node; + lastp = &c->next; + c = c->next; } - - ps->node = active; - ps->vbuff.curpos = active->first_avail + cur_len; - ps->vbuff.endpos = active->endp - 1; /* Save a byte for NUL terminator */ - ps->got_a_new_node = 1; - - return 0; } -APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) +APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup_fn) (void *), + apr_status_t (*child_cleanup_fn) (void *)) { - struct psprintf_data ps; - char *strp; - apr_size_t size; - node_t *active; + cleanup_t *c; - ps.node = active = pool->active; - ps.allocator = pool->allocator; - ps.vbuff.curpos = ps.node->first_avail; - /* Save a byte for the NUL terminator */ - ps.vbuff.endpos = ps.node->endp - 1; - ps.got_a_new_node = 0; - ps.free = NULL; + if (p == NULL) + return; - if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) { - if (pool->abort_fn) - pool->abort_fn(APR_ENOMEM); + c = p->cleanups; + while (c) { + if (c->data == data && c->plain_cleanup_fn == plain_cleanup_fn) { + c->child_cleanup_fn = child_cleanup_fn; + break; + } - return NULL; + c = c->next; } +} - strp = ps.vbuff.curpos; - *strp++ = '\0'; +APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, + apr_status_t (*cleanup_fn) (void *)) +{ + apr_pool_cleanup_kill(p, data, cleanup_fn); + return (*cleanup_fn)(data); +} - size = strp - ps.node->first_avail; - size = APR_ALIGN_DEFAULT(size); - strp = ps.node->first_avail; - ps.node->first_avail += size; +static void run_cleanups(cleanup_t *c) +{ + while (c) { + (*c->plain_cleanup_fn)((void *)c->data); + c = c->next; + } +} - /* - * Link the node in if it's a new one - */ - if (ps.got_a_new_node) { - active->next = pool->active = ps.node; +static void run_child_cleanups(cleanup_t *c) +{ + while (c) { + (*c->child_cleanup_fn)((void *)c->data); + c = c->next; } +} - if (ps.free) - node_free(ps.allocator, ps.free); +static void cleanup_pool_for_exec(apr_pool_t *p) +{ + run_child_cleanups(p->cleanups); + p->cleanups = NULL; - return strp; + for (p = p->child; p; p = p->sibling) + cleanup_pool_for_exec(p); } -APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) +APR_DECLARE(void) apr_pool_cleanup_for_exec(void) { - va_list ap; - char *res; +#if !defined(WIN32) && !defined(OS2) + /* + * Don't need to do anything on NT or OS/2, because I + * am actually going to spawn the new process - not + * exec it. All handles that are not inheritable, will + * be automajically closed. The only problem is with + * file handles that are open, but there isn't much + * I can do about that (except if the child decides + * to go out and close them + */ + cleanup_pool_for_exec(global_pool); +#endif /* !defined(WIN32) && !defined(OS2) */ +} - va_start(ap, fmt); - res = apr_pvsprintf(p, fmt, ap); - va_end(ap); - return res; +APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) +{ + /* do nothing cleanup routine */ + return APR_SUCCESS; } -/***************************************************************** - * - * More grotty system stuff... subprocesses. Frump. These don't use - * the generic cleanup interface because I don't want multiple - * subprocesses to result in multiple three-second pauses; the - * subprocesses have to be "freed" all at once. If someone comes - * along with another resource they want to allocate which has the - * same property, we might want to fold support for that into the - * generic interface, but for now, it's a special case +/* Subprocesses don't use the generic cleanup interface because + * we don't want multiple subprocesses to result in multiple + * three-second pauses; the subprocesses have to be "freed" all + * at once. If other resources are introduced with the same property, + * we might want to fold support for that into the generic interface. + * For now, it's a special case. */ - APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *pool, apr_proc_t *pid, enum kill_conditions how) { @@ -1092,6 +1516,7 @@ static void free_proc_chain(struct process_chain *procs) if (pc->kill_how != kill_never) (void)apr_proc_wait(pc->pid, NULL, NULL, APR_WAIT); } + #ifdef WIN32 /* * XXX: Do we need an APR function to clean-up a proc_t? @@ -1107,6 +1532,5 @@ static void free_proc_chain(struct process_chain *procs) } } } - #endif /* WIN32 */ } From 6046cd03a9d639f69995febf02122d696bc57ef8 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 2 Jan 2002 09:12:37 +0000 Subject: [PATCH 2689/7878] Generated libtool goes in $abs_builddir. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62692 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index f6c4b42054e..389872706a0 100644 --- a/configure.in +++ b/configure.in @@ -109,7 +109,7 @@ AC_PROG_LIBTOOL LTFLAGS='--silent' fi dnl get libtool's setting of shlibpath_var - eval `grep "^shlibpath_var=[[A-Z_]]\+$" $srcdir/libtool` + eval `grep "^shlibpath_var=[[A-Z_]]\+$" $abs_builddir/libtool` ;; esac From fc0e2f6eb1dae5d8663c71b90b63ba6a1fb06bc3 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 2 Jan 2002 09:34:49 +0000 Subject: [PATCH 2690/7878] In a VPATH build, we don't know where testmmap.c is, but we have a fighting shot to find testmmap. *grin* git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62693 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testmmap.c b/test/testmmap.c index c7111c3689f..c4ba842eddf 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -100,7 +100,7 @@ int main(void) fprintf(stdout,"OK\n"); apr_filepath_get(&file1, 0, context); - file1 = apr_pstrcat(context,file1,"/testmmap.c",NULL); + file1 = apr_pstrcat(context,file1,"/testmmap",NULL); fprintf(stdout, "Opening file........................"); rv = apr_file_open(&thefile, file1, flag, APR_UREAD | APR_GREAD, context); From e862d9aa94e39481a1bf2ee7bfd6e5a9d111af41 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 2 Jan 2002 19:35:59 +0000 Subject: [PATCH 2691/7878] apr_sleep seems to be the potential cause of a few problems, so here is a quick try at a simple test app. It needs looking at for threaded vs non threaded, but the issues were on a threaded FreeBSD build so I wasn't worried about non threaded initially. If noone lese fixs it, I'll do it later tonight. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62694 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 6 ++- test/testsleep.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 test/testsleep.c diff --git a/test/Makefile.in b/test/Makefile.in index f7b7c75f920..0b12dff8e4c 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -32,7 +32,8 @@ PROGRAMS = \ testuser@EXEEXT@ \ testsockets@EXEEXT@ \ testprocmutex@EXEEXT@ \ - testvsn@EXEEXT@ + testvsn@EXEEXT@ \ + testsleep@EXEEXT@ TARGETS = $(PROGRAMS) @@ -153,4 +154,7 @@ testprocmutex@EXEEXT@: testprocmutex.lo $(LOCAL_LIBS) testvsn@EXEEXT@: testvsn.lo $(LOCAL_LIBS) $(LINK) testvsn.lo $(LOCAL_LIBS) $(ALL_LIBS) +testsleep@EXEEXT@: testsleep.lo $(LOCAL_LIBS) + $(LINK) testsleep.lo $(LOCAL_LIBS) $(ALL_LIBS) + # DO NOT REMOVE diff --git a/test/testsleep.c b/test/testsleep.c new file mode 100644 index 00000000000..fecd68546c2 --- /dev/null +++ b/test/testsleep.c @@ -0,0 +1,120 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_time.h" +#include "apr_thread_proc.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_lib.h" +#include +#include +#include "test_apr.h" + + +static void do_sleep(int howlong) +{ + apr_time_t then, now, diff; + apr_time_t interval = howlong * APR_USEC_PER_SEC; + + printf(" I'm about to go to sleep!\n"); + + then = apr_time_now(); + apr_sleep(interval); + now = apr_time_now(); + + diff = now - then; + + printf("%-60s"," Just woken up, checking how long I've been asleep"); + if (diff < interval || diff > interval * 1.01) { + printf("Failed!\n"); + } else { + printf("OK\n"); + } +} + +void * APR_THREAD_FUNC time_a_thread(apr_thread_t *thd, void *data) +{ + do_sleep(15); + + return NULL; +} + +int main(void) +{ + apr_pool_t *p; + apr_thread_t *t1, *t2, *t3; + apr_status_t rv; + + apr_initialize(); + + printf("Testing apr_sleep()\n===================\n\n"); + + STD_TEST_NEQ("Creating a pool to use", apr_pool_create(&p, NULL)) + + printf("\nI will now start 3 threads, each of which should sleep for\n" + "15 seconds, then exit. The main thread will sleep for a\n" + "45 seconds then wake up.\n" + "All tests will check how long they've been in the land of nod.\n\n"); + printf("If all is working you should see 8 lines below within 45 seconds.\n\n"); + + rv = apr_thread_create(&t1, NULL, time_a_thread, NULL, p); + rv = apr_thread_create(&t2, NULL, time_a_thread, NULL, p); + rv = apr_thread_create(&t3, NULL, time_a_thread, NULL, p); + + + do_sleep(45); + + return 0; +} + From 0059501bedf0c3215baf13017c7917b5cb375818 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 2 Jan 2002 19:47:07 +0000 Subject: [PATCH 2692/7878] Make testsleep safe for non threaded platforms :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62695 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsleep.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/test/testsleep.c b/test/testsleep.c index fecd68546c2..beb7d1d91db 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -83,12 +83,17 @@ static void do_sleep(int howlong) } } +#if APR_HAS_THREADS void * APR_THREAD_FUNC time_a_thread(apr_thread_t *thd, void *data) { do_sleep(15); return NULL; } +#define OUTPUT_LINES 8 +#else +#define OUTPUT_LINES 2 +#endif /* APR_HAS_THREADS */ int main(void) { @@ -102,16 +107,21 @@ int main(void) STD_TEST_NEQ("Creating a pool to use", apr_pool_create(&p, NULL)) +#if APR_HAS_THREADS printf("\nI will now start 3 threads, each of which should sleep for\n" - "15 seconds, then exit. The main thread will sleep for a\n" - "45 seconds then wake up.\n" - "All tests will check how long they've been in the land of nod.\n\n"); - printf("If all is working you should see 8 lines below within 45 seconds.\n\n"); + "15 seconds, then exit.\n"); +#endif + printf("The main app will sleep for 45 seconds then wake up.\n"); + printf("All tests will check how long they've been in the land of nod.\n\n"); + printf("If all is working you should see %d lines below within 45 seconds.\n\n", + OUTPUT_LINES); + +#if APR_HAS_THREADS rv = apr_thread_create(&t1, NULL, time_a_thread, NULL, p); rv = apr_thread_create(&t2, NULL, time_a_thread, NULL, p); rv = apr_thread_create(&t3, NULL, time_a_thread, NULL, p); - +#endif do_sleep(45); From 5dba3f646f116a8765d8bf2e530636c6dc086ccd Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 2 Jan 2002 20:12:34 +0000 Subject: [PATCH 2693/7878] Fixing up a linker issue since NetWare does not have a gettimeofday() function git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62696 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/time/unix/time.c b/time/unix/time.c index f81d6268030..8eb9aba6717 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -305,6 +305,13 @@ APR_DECLARE(apr_status_t) apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2 } #endif +#ifdef NETWARE +APR_DECLARE(void) apr_netware_setup_time(void) +{ + tzset(); + server_gmt_offset = -timezone; +} +#else APR_DECLARE(void) apr_unix_setup_time(void) { #if !defined(HAVE_GMTOFF) && !defined(HAVE___OFFSET) @@ -352,10 +359,4 @@ APR_DECLARE(void) apr_unix_setup_time(void) #endif } -#ifdef NETWARE -APR_DECLARE(void) apr_netware_setup_time(void) -{ - tzset(); - server_gmt_offset = -timezone; -} #endif From ca231ee171e39cb34128b90059a06ac9b97d00b2 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 2 Jan 2002 22:47:56 +0000 Subject: [PATCH 2694/7878] Add stdlib.h for exit. Print out the time information if we fail. On my Linux SMP box, we sleep for less than the time requested. Is this permissible? (I'd suggest doing 0.99*interval<->1.01*interval.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62697 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsleep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/testsleep.c b/test/testsleep.c index beb7d1d91db..4fe99cc5944 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -59,6 +59,7 @@ #include "apr_lib.h" #include #include +#include #include "test_apr.h" @@ -77,7 +78,8 @@ static void do_sleep(int howlong) printf("%-60s"," Just woken up, checking how long I've been asleep"); if (diff < interval || diff > interval * 1.01) { - printf("Failed!\n"); + printf("Failed!\n\t(actual: %" APR_TIME_T_FMT + ", wanted: %" APR_TIME_T_FMT")\n", diff, interval); } else { printf("OK\n"); } From 38d683741ed41d2ad6448936e41ac2d3d1067df1 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 2 Jan 2002 23:04:29 +0000 Subject: [PATCH 2695/7878] Make the time checking be in the 0.99*interval-1.01*interval range as apr_sleep is not guaranteed to be exact. Reviewed by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62698 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testsleep.c b/test/testsleep.c index 4fe99cc5944..adc0f3fb516 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -77,7 +77,7 @@ static void do_sleep(int howlong) diff = now - then; printf("%-60s"," Just woken up, checking how long I've been asleep"); - if (diff < interval || diff > interval * 1.01) { + if (diff < interval * 0.99 || diff > interval * 1.01) { printf("Failed!\n\t(actual: %" APR_TIME_T_FMT ", wanted: %" APR_TIME_T_FMT")\n", diff, interval); } else { From 65a6ea9bcfd4af3cc4bf869ca6aca8d2c141c49d Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 4 Jan 2002 08:50:12 +0000 Subject: [PATCH 2696/7878] Add this so I don't forget about it. I'm focusing on a bunch of different things and this may get forgotten. I don't want anything that doesn't handle largefiles properly to be called a GA release. This really just needs autoconf macros to twiddle the compiler and some testing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62699 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 0f4d890f8bc..a02f879d085 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2001/12/27 17:04:16 $] +Last modified at [$Date: 2002/01/04 08:50:12 $] Release: @@ -44,6 +44,14 @@ RELEASE SHOWSTOPPERS: Win32: apr_thread_rwlock_try*lock(), apr_thread_cond_timedwait(), apr_proc_mutex_*() (Is proc_mutex unnecessary on Win32?) + * Deal with largefiles properly on those platforms that support + it. + Justin says: We may be able to get away with setting + FILE_OFFSET_BITS=64 on most current Unices. + The other question remains if this should be turned + on by default (i.e. pass O_LARGEFILE or whatnot on + that platform). I think so. + RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Enable pools to have thread-specific locking in it. From 18f00b8094fa650636b111fb6bbd8020de957dc9 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 4 Jan 2002 17:25:49 +0000 Subject: [PATCH 2697/7878] Deferred the memory allocation for the new apr_socket_t until after the accept() call so that we don't chew up huge chunks of memory when using non-blocking sockets and also avoiding unnecessary memory allocations on error conditions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62700 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index fb233ad87b1..b9a3fc6ce79 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -226,20 +226,26 @@ APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *p) { + SOCKET s; + struct sockaddr sa; + int salen = sizeof(sock->remote_addr->sa); + + // Don't allocate the memory until after we call accept. This allows + // us to work with nonblocking sockets. + s = accept(sock->sock, (struct sockaddr *)&sa, &salen); + if (s == INVALID_SOCKET) { + return apr_get_netos_error(); + } + alloc_socket(new, p); set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM); (*new)->timeout = -1; (*new)->disconnected = 0; + (*new)->sock = s; (*new)->remote_addr->salen = sizeof((*new)->remote_addr->sa); - (*new)->sock = accept(sock->sock, - (struct sockaddr *)&(*new)->remote_addr->sa, - &(*new)->remote_addr->salen); - - if ((*new)->sock == INVALID_SOCKET) { - return apr_get_netos_error(); - } + memcpy (&(*new)->remote_addr->sa, &sa, salen); *(*new)->local_addr = *sock->local_addr; /* The above assignment just overwrote the pool entry. Setting the local_addr From 9c69433140bd2df79d32f2296f3fdf08ee058c14 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 4 Jan 2002 17:36:51 +0000 Subject: [PATCH 2698/7878] fix an IPv6 hole in apr_accept(); the bug prevented the proper sockaddr from being returned in some cases git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62701 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 45d1d704024..5b8817c0344 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -203,6 +203,7 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { + static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */ alloc_socket(new, connection_context); set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM); @@ -249,8 +250,9 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn #endif /* TCP_NODELAY_INHERITED */ if (sock->local_interface_unknown || - /* XXX IPv6 issue */ - sock->local_addr->sa.sin.sin_addr.s_addr == 0) { + !memcmp(sock->local_addr->ipaddr_ptr, + generic_inaddr_any, + sock->local_addr->ipaddr_len)) { /* If the interface address inside the listening socket's local_addr wasn't * up-to-date, we don't know local interface of the connected socket either. * From 57be0b8de3cae0873683054b595117796a89b7bb Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 4 Jan 2002 18:44:40 +0000 Subject: [PATCH 2699/7878] Changed to 4 byte packing git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62702 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 191071 -> 189944 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index a4a8cdf5acc5157ac858585d0a70d006155b33d6..9036db21cb5a5cd076c75c3cd1db976759613aef 100644 GIT binary patch delta 86742 zcmaI72UJttw=eoBA|eW(1rVuC!t0NN*ZyXj@Q3>Ae?`CS7_<5s+RY z5PFjmI)sE02qe7V|J?J=y>Hw%M#f%y&pFpzHFN&fT64{#XpZ`5-q&8xO`^T{&y|0= zbsz96TvMai(@L>Qx^M@ee0^J)@ja+@cJ_JjP5wq{>VG+6|1jLW&j^lP9##t({VIq` zy6>ert7cw2l6+NvV`r!B43;MG;PM>fWp!+*t8aalFi*jBa~>#q!NZkoBs4C+GcuLxeSEV_JWpGz-IA zUb_e4oH4b_9+R52O_NTsd1}47DxI)}ms-+gEb6o?T3J2WvtcOw9#r(xY`nLt9cnVxivF_Ia%-Oq`6m}%f?Y%%f2ZP2zMpsLaXdU>5FC!P8E$KBuG zHdyYdoOv&z-s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5As zM^_j;2atp>MMpKQcR2t2HR~EQIC7?nz0f*cwzw;bLVJ*uWhS=!tA6EB^+%9uv#pMf zIW0+4_0mXR9N8)4GZ#tRdG`b2CQwvT;4H*${O9Ra0V$noIAU0*Ne);R!fND5N}g>y zaaUBJ{dOCOeo&ht$Q`TCA|x{M&Pj4Rb0p}A4^FfGF}R-tRg34GWMP*=IsR}*Xbeh| zwQ91(Oq5oQ&#Qj@&jHR;v7bAF-RN%u7}m369=vFFa}<~<05Q}`%ZA}XoZfBk95MEB z#>KmVGS(7%ZtH^G+gV}5@~4i zcKstT8P28TNk2Z|6VAbSIVjR)Ib*v%dxK;>61kE(w{keAR+IHnZSG^3$WB~#N!Ww| zbL%i5%{edJq7`nlp%-uHzI8UrU(vKwK%{EY@<0wJIKDyxiQDGKItuBKgSey;x5%!6V2& zPnI`ARM4Dv)GxKuh|?wHxfqlT`|Lm*2Qiv*JH!=}7G#W=A$~mCVr^VT-P}P-mEeV1 zlo0XGpt&8GGr%bvd?IIqQ~>!mw}=gm$f<=mZ){z`CH?`=vL68JXGmSmpux&Yu+o;h zeN%|g{6(@o3ezG-ZWkh?bfO&~27$(`3fJc?N7&fx&Q6-Y!)RIDl)KxkjN&BXhUG>8-6HZ55I(KZ`kn zoV$*rd;RE&XdFR=Ak2GD{yqJ5AApF;mybjn#s6`|rgKr) zujdfL2`47?ef4T1mHghL6fZ{*W+yc=BBr67ynhN!1F6QdLpdBUslv#$$SmtFM9shR zZqJxO{c Date: Fri, 4 Jan 2002 21:28:56 +0000 Subject: [PATCH 2700/7878] Sorry, too many years of C++ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62703 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index b9a3fc6ce79..389eccd613b 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -230,8 +230,8 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, struct sockaddr sa; int salen = sizeof(sock->remote_addr->sa); - // Don't allocate the memory until after we call accept. This allows - // us to work with nonblocking sockets. + /* Don't allocate the memory until after we call accept. This allows + us to work with nonblocking sockets. */ s = accept(sock->sock, (struct sockaddr *)&sa, &salen); if (s == INVALID_SOCKET) { return apr_get_netos_error(); From c255871e51c8d45e5219269ab5edc7c326fb6a71 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 5 Jan 2002 00:41:21 +0000 Subject: [PATCH 2701/7878] Add testrand program to exercise apr_generate_random_bytes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62704 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 6 +++- test/testrand.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 test/testrand.c diff --git a/test/Makefile.in b/test/Makefile.in index 0b12dff8e4c..38bfb7368a7 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -33,7 +33,8 @@ PROGRAMS = \ testsockets@EXEEXT@ \ testprocmutex@EXEEXT@ \ testvsn@EXEEXT@ \ - testsleep@EXEEXT@ + testsleep@EXEEXT@ \ + testrand@EXEEXT@ TARGETS = $(PROGRAMS) @@ -157,4 +158,7 @@ testvsn@EXEEXT@: testvsn.lo $(LOCAL_LIBS) testsleep@EXEEXT@: testsleep.lo $(LOCAL_LIBS) $(LINK) testsleep.lo $(LOCAL_LIBS) $(ALL_LIBS) +testrand@EXEEXT@: testrand.lo $(LOCAL_LIBS) + $(LINK) testrand.lo $(LOCAL_LIBS) $(ALL_LIBS) + # DO NOT REMOVE diff --git a/test/testrand.c b/test/testrand.c new file mode 100644 index 00000000000..bfe240b06f9 --- /dev/null +++ b/test/testrand.c @@ -0,0 +1,91 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_general.h" +#include +#include +#include +#include "test_apr.h" + +#if !APR_HAS_RANDOM +#error Random support is not available. Go punt. +#endif + +int main(void) +{ + apr_pool_t *p; + apr_status_t rv; + unsigned char c[2048]; + int i; + + apr_initialize(); + + printf("Testing apr_generate_random_bytes()\n===================\n\n"); + + if (apr_pool_create(&p, NULL) != APR_SUCCESS) { + exit(-1); + } + + for (i = 1; i <= 8; i++) { + printf("%-5d %-55s", i * 255, "bytes"); + rv = apr_generate_random_bytes(c, i * 255); + if (rv != APR_SUCCESS) { + printf("Failed: %d\n", rv); + } + printf("OK\n"); + } + + return 0; +} + From 79d95ef05993bfad9fe3b541c8c95ad84a9b0b49 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 5 Jan 2002 08:02:39 +0000 Subject: [PATCH 2702/7878] Tighter localization of some variables... found experimenting in other bits of the server [looking at shmem locks a while back.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62705 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/flock.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index 1d0503ae55a..27aa7af6f1d 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -56,13 +56,12 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) { - OVERLAPPED offset; - DWORD flags, len = 0xffffffff; + const DWORD len = 0xffffffff; + DWORD flags; flags = ((type & APR_FLOCK_NONBLOCK) ? LOCKFILE_FAIL_IMMEDIATELY : 0) + (((type & APR_FLOCK_TYPEMASK) == APR_FLOCK_SHARED) ? 0 : LOCKFILE_EXCLUSIVE_LOCK); - memset (&offset, 0, sizeof(offset)); /* XXX on NT 4.0 we get ERROR_LOCK_VIOLATION when we specify * LOCKFILE_FAIL_IMMEDIATELY and another process is holding * the lock; something needs to be done so an APR app can @@ -70,6 +69,8 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) */ if (apr_os_level >= APR_WIN_NT) { /* Syntax is correct, len is passed for LengthLow and LengthHigh*/ + OVERLAPPED offset; + memset (&offset, 0, sizeof(offset)); if (!LockFileEx(thefile->filehand, flags, 0, len, len, &offset)) return apr_get_os_error(); } @@ -83,13 +84,12 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) { - OVERLAPPED offset; DWORD len = 0xffffffff; - memset (&offset, 0, sizeof(offset)); - if (apr_os_level >= APR_WIN_NT) { /* Syntax is correct, len is passed for LengthLow and LengthHigh*/ + OVERLAPPED offset; + memset (&offset, 0, sizeof(offset)); if (!UnlockFileEx(thefile->filehand, 0, len, len, &offset)) return apr_get_os_error(); } From 862215207f2d7709b9b6a200fcb97b847ad70ed2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 5 Jan 2002 08:03:53 +0000 Subject: [PATCH 2703/7878] Normalize an opaque type to our current conventions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62706 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_shmem.h | 2 +- shmem/beos/shmem.c | 24 ++++++++++++------------ shmem/os2/shmem.c | 20 ++++++++++---------- shmem/unix/shmem.c | 4 ++-- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/include/apr_shmem.h b/include/apr_shmem.h index 31e0c5f411e..696c2d09cae 100644 --- a/include/apr_shmem.h +++ b/include/apr_shmem.h @@ -83,7 +83,7 @@ typedef key_t apr_shm_name_t; typedef void apr_shm_name_t; #endif -typedef struct shmem_t apr_shmem_t; +typedef struct apr_shmem_t apr_shmem_t; /** * Create a pool of shared memory for use later. diff --git a/shmem/beos/shmem.c b/shmem/beos/shmem.c index 740b44bf9f8..c2e013e20d1 100644 --- a/shmem/beos/shmem.c +++ b/shmem/beos/shmem.c @@ -69,7 +69,7 @@ struct block_t { void *prev; }; -struct shmem_t { +typedef struct apr_shmem_t { apr_pool_t *p; void *memblock; void *ptr; @@ -77,7 +77,7 @@ struct shmem_t { area_id aid; struct block_t *uselist; struct block_t *freelist; -}; +} apr_shmem_t; #define MIN_BLK_SIZE 128 @@ -173,7 +173,7 @@ static void remove_block(struct block_t **list, struct block_t *blk) } /* puts a used block onto the free list for it to be reused... */ -static void free_block(struct shmem_t *m, void *entity) +static void free_block(apr_shmem_t *m, void *entity) { struct block_t *b; if ((b = find_block_by_addr(m->uselist, entity)) != NULL){ @@ -184,7 +184,7 @@ static void free_block(struct shmem_t *m, void *entity) } /* assigns a block of our memory and puts an entry on the uselist */ -static struct block_t *alloc_block(struct shmem_t *m, apr_size_t size) +static struct block_t *alloc_block(apr_shmem_t *m, apr_size_t size) { struct block_t *b = NULL; if (m->avail < size) @@ -205,14 +205,14 @@ static struct block_t *alloc_block(struct shmem_t *m, apr_size_t size) return b; } -APR_DECLARE(apr_status_t) apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, +APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *p) { apr_size_t pagesize; area_id newid; char *addr; - (*m) = (struct shmem_t *)apr_pcalloc(p, sizeof(struct shmem_t)); + (*m) = (apr_shmem_t *)apr_pcalloc(p, sizeof(apr_shmem_t)); /* we MUST allocate in pages, so calculate how big an area we need... */ pagesize = ((reqsize + B_PAGE_SIZE - 1) / B_PAGE_SIZE) * B_PAGE_SIZE; @@ -232,7 +232,7 @@ APR_DECLARE(apr_status_t) apr_shm_init(struct shmem_t **m, apr_size_t reqsize, c return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_destroy(struct shmem_t *m) +APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m) { delete_area(m->aid); m->avail = 0; @@ -242,7 +242,7 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(struct shmem_t *m) return APR_SUCCESS; } -APR_DECLARE(void *) apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize) +APR_DECLARE(void *) apr_shm_malloc(apr_shmem_t *m, apr_size_t reqsize) { struct block_t *b; if ((b = alloc_block(m, reqsize)) != NULL) @@ -250,7 +250,7 @@ APR_DECLARE(void *) apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize) return NULL; } -APR_DECLARE(void *) apr_shm_calloc(struct shmem_t *m, apr_size_t reqsize) +APR_DECLARE(void *) apr_shm_calloc(apr_shmem_t *m, apr_size_t reqsize) { struct block_t *b; if ((b = alloc_block(m, reqsize)) != NULL){ @@ -260,7 +260,7 @@ APR_DECLARE(void *) apr_shm_calloc(struct shmem_t *m, apr_size_t reqsize) return NULL; } -APR_DECLARE(apr_status_t) apr_shm_free(struct shmem_t *m, void *entity) +APR_DECLARE(apr_status_t) apr_shm_free(apr_shmem_t *m, void *entity) { free_block(m, entity); return APR_SUCCESS; @@ -277,7 +277,7 @@ APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) return APR_ANONYMOUS; } -APR_DECLARE(apr_status_t) apr_shm_open(struct shmem_t *m) +APR_DECLARE(apr_status_t) apr_shm_open(apr_shmem_t *m) { /* If we've forked we need a clone of the original area or we * will only have access to a one time copy of the data made when @@ -311,7 +311,7 @@ APR_DECLARE(apr_status_t) apr_shm_open(struct shmem_t *m) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_avail(struct shmem_t *m, apr_size_t *size) +APR_DECLARE(apr_status_t) apr_shm_avail(apr_shmem_t *m, apr_size_t *size) { *size = m->avail; if (m->avail == 0) diff --git a/shmem/os2/shmem.c b/shmem/os2/shmem.c index e63ee0a63a9..d364a2f43bc 100644 --- a/shmem/os2/shmem.c +++ b/shmem/os2/shmem.c @@ -60,17 +60,17 @@ #include #include -struct shmem_t { +typedef struct apr_shmem_t { void *memblock; Heap_t heap; -}; +} apr_shmem_t; -APR_DECLARE(apr_status_t) apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) { int rc; - struct shmem_t *newm = (struct shmem_t *)apr_palloc(cont, sizeof(struct shmem_t)); + apr_shmem_t *newm = (apr_shmem_t *)apr_palloc(cont, sizeof(apr_shmem_t)); char *name = NULL; ULONG flags = PAG_COMMIT|PAG_READ|PAG_WRITE; @@ -94,7 +94,7 @@ APR_DECLARE(apr_status_t) apr_shm_init(struct shmem_t **m, apr_size_t reqsize, c -APR_DECLARE(apr_status_t) apr_shm_destroy(struct shmem_t *m) +APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m) { _uclose(m->heap); _udestroy(m->heap, _FORCE); @@ -104,21 +104,21 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(struct shmem_t *m) -APR_DECLARE(void *) apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize) +APR_DECLARE(void *) apr_shm_malloc(apr_shmem_t *m, apr_size_t reqsize) { return _umalloc(m->heap, reqsize); } -APR_DECLARE(void *) apr_shm_calloc(struct shmem_t *m, apr_size_t size) +APR_DECLARE(void *) apr_shm_calloc(apr_shmem_t *m, apr_size_t size) { return _ucalloc(m->heap, size, 1); } -APR_DECLARE(apr_status_t) apr_shm_free(struct shmem_t *m, void *entity) +APR_DECLARE(apr_status_t) apr_shm_free(apr_shmem_t *m, void *entity) { free(entity); return APR_SUCCESS; @@ -141,7 +141,7 @@ APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) -APR_DECLARE(apr_status_t) apr_shm_open(struct shmem_t *m) +APR_DECLARE(apr_status_t) apr_shm_open(apr_shmem_t *m) { int rc; @@ -156,7 +156,7 @@ APR_DECLARE(apr_status_t) apr_shm_open(struct shmem_t *m) -APR_DECLARE(apr_status_t) apr_shm_avail(struct shmem_t *c, apr_size_t *size) +APR_DECLARE(apr_status_t) apr_shm_avail(apr_shmem_t *c, apr_size_t *size) { return APR_ENOTIMPL; diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 0b1d9de5be7..f1afe907af7 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -89,7 +89,7 @@ #include #endif -struct shmem_t { +typedef struct apr_shmem_t { void *mem; void *curmem; apr_size_t length; @@ -104,7 +104,7 @@ struct shmem_t { #elif APR_USE_SHMEM_BEOS area_id areaid; #endif -}; +} apr_shmem_t; APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *filename, apr_pool_t *pool) From 55dd7bad6c6128ba9c02b0013f40f93c9e84dc84 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 5 Jan 2002 13:38:44 +0000 Subject: [PATCH 2704/7878] get shmem.c to compile again after changes to apr_shmem.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62707 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index f1afe907af7..c30595d3c49 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -89,7 +89,7 @@ #include #endif -typedef struct apr_shmem_t { +struct apr_shmem_t { void *mem; void *curmem; apr_size_t length; @@ -104,7 +104,7 @@ typedef struct apr_shmem_t { #elif APR_USE_SHMEM_BEOS area_id areaid; #endif -} apr_shmem_t; +}; APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *filename, apr_pool_t *pool) From 14e4edccc4a2ca48fd260cc09daefe0ff50f1784 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 5 Jan 2002 15:43:10 +0000 Subject: [PATCH 2705/7878] Agree with Jeff [thanks] ... completion doesn't need to be so wordy. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62708 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/beos/shmem.c | 4 ++-- shmem/os2/shmem.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shmem/beos/shmem.c b/shmem/beos/shmem.c index c2e013e20d1..faa8f07b92d 100644 --- a/shmem/beos/shmem.c +++ b/shmem/beos/shmem.c @@ -69,7 +69,7 @@ struct block_t { void *prev; }; -typedef struct apr_shmem_t { +struct apr_shmem_t { apr_pool_t *p; void *memblock; void *ptr; @@ -77,7 +77,7 @@ typedef struct apr_shmem_t { area_id aid; struct block_t *uselist; struct block_t *freelist; -} apr_shmem_t; +}; #define MIN_BLK_SIZE 128 diff --git a/shmem/os2/shmem.c b/shmem/os2/shmem.c index d364a2f43bc..009b5a96818 100644 --- a/shmem/os2/shmem.c +++ b/shmem/os2/shmem.c @@ -60,10 +60,10 @@ #include #include -typedef struct apr_shmem_t { +struct apr_shmem_t { void *memblock; Heap_t heap; -} apr_shmem_t; +}; From 4d8ab5c398265d51e0de1996f2a6afa08dc286cb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 8 Jan 2002 03:45:09 +0000 Subject: [PATCH 2706/7878] We cannot close-on-fork any fd 0 through 2 (stdin, stdout, stderr)!!! This patch is possibly still borked, we probably should remove any existing cleanup registered again (*new_file) if it was given. This api really is dirty, should really have an apr_file_dup2() with different conventions (passing apr_file_t* for both left and right args.) I can see users 'forgetting' to null the target apr_file_t** destination. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62709 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 72243ba4878..25fdae26b17 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -92,11 +92,20 @@ apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_ /* make sure unget behavior is consistent */ (*new_file)->ungetchar = old_file->ungetchar; /* apr_file_dup() clears the inherit attribute, user must call - * apr_file_set_inherit() again on the dupped handle, as necessary. + * apr_file_set_inherit() again on the dupped handle, as necessary, + * unless you have dup2'ed fd 0-2 (stdin, stdout or stderr) which + * should never, never, never close on fork() */ - (*new_file)->flags = old_file->flags & ~APR_INHERIT; - apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), - apr_unix_file_cleanup, apr_unix_file_cleanup); + if (have_file && old_file->filedes >= 0 and old_file->filedes <= 2) { + (*new_file)->flags = old_file->flags | APR_INHERIT; + apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*in), + apr_unix_file_cleanup, apr_pool_cleanup_null); + } + else { + (*new_file)->flags = old_file->flags & ~APR_INHERIT; + apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), + apr_unix_file_cleanup, apr_unix_file_cleanup); + } return APR_SUCCESS; } From 348a9f80aff22e7150268f0fcd40044ed6f28688 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 8 Jan 2002 03:48:18 +0000 Subject: [PATCH 2707/7878] Ok, that was borked... here should compile :-/ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62710 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 25fdae26b17..732c9355b80 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -96,7 +96,7 @@ apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_ * unless you have dup2'ed fd 0-2 (stdin, stdout or stderr) which * should never, never, never close on fork() */ - if (have_file && old_file->filedes >= 0 and old_file->filedes <= 2) { + if (have_file && ((*new_file)->filedes >= 0) && ((*new_file)->filedes <= 2)) { (*new_file)->flags = old_file->flags | APR_INHERIT; apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*in), apr_unix_file_cleanup, apr_pool_cleanup_null); From 371a3ec0c5f0487ca8253f3f98cacd529aa3661a Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 8 Jan 2002 04:17:15 +0000 Subject: [PATCH 2708/7878] Missed one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62711 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 732c9355b80..2d2512015f3 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -98,7 +98,7 @@ apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_ */ if (have_file && ((*new_file)->filedes >= 0) && ((*new_file)->filedes <= 2)) { (*new_file)->flags = old_file->flags | APR_INHERIT; - apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*in), + apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), apr_unix_file_cleanup, apr_pool_cleanup_null); } else { From 3a96afba13956b64668170d35db55ef501a4b212 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 8 Jan 2002 04:24:24 +0000 Subject: [PATCH 2709/7878] Still, the problem lingers. There is nothing wrong, AFAICT, with leaving fd 0..2 open always. Otherwise, another process that forks ends up with 'something else' in fd 2 (or 1, or 0) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62712 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 2d2512015f3..04105a54a22 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -92,14 +92,14 @@ apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_ /* make sure unget behavior is consistent */ (*new_file)->ungetchar = old_file->ungetchar; /* apr_file_dup() clears the inherit attribute, user must call - * apr_file_set_inherit() again on the dupped handle, as necessary, - * unless you have dup2'ed fd 0-2 (stdin, stdout or stderr) which - * should never, never, never close on fork() + * apr_file_set_inherit() again on the dupped handle, as necessary. + * If the user has dup2'ed fd 0-2 (stdin, stdout or stderr) we will + * never, never, never close the handle, under any circumstance. */ if (have_file && ((*new_file)->filedes >= 0) && ((*new_file)->filedes <= 2)) { (*new_file)->flags = old_file->flags | APR_INHERIT; apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), - apr_unix_file_cleanup, apr_pool_cleanup_null); + apr_pool_cleanup_null, apr_pool_cleanup_null); } else { (*new_file)->flags = old_file->flags & ~APR_INHERIT; From ed43630bb4980c28db60f1cee5310ce6decb0515 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 8 Jan 2002 05:57:21 +0000 Subject: [PATCH 2710/7878] Implement proc_mutex for win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62713 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/proc_mutex.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/arch/win32/proc_mutex.h b/include/arch/win32/proc_mutex.h index 3e1bc42cc92..3678b42e23d 100644 --- a/include/arch/win32/proc_mutex.h +++ b/include/arch/win32/proc_mutex.h @@ -59,6 +59,8 @@ struct apr_proc_mutex_t { apr_pool_t *pool; + HANDLE handle; + const char *fname; }; #endif /* PROC_MUTEX_H */ From 7cf64d0c4c090553869d2a2902308a6fb6b097ea Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 8 Jan 2002 05:58:38 +0000 Subject: [PATCH 2711/7878] Fix thread_mutex trylock for Win9x (returns APR_ENOTIMPL) and introduce proc_mutex for Win32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62714 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/proc_mutex.c | 106 +++++++++++++++++++++++++++++++++---- locks/win32/thread_mutex.c | 9 ++-- 2 files changed, 101 insertions(+), 14 deletions(-) diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index c37362eb7a3..05682f18c47 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -56,42 +56,128 @@ #include "apr_private.h" #include "apr_general.h" #include "apr_strings.h" -#include "win32/proc_mutex.h" #include "apr_portable.h" +#include "proc_mutex.h" +#include "misc.h" + +static apr_status_t proc_mutex_cleanup(void *mutex_) +{ + apr_proc_mutex_t *mutex = mutex_; + + if (CloseHandle(mutex->handle) == 0) { + return apr_get_os_error(); + } + return APR_SUCCESS; +} APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, const char *fname, apr_lockmech_e mech, apr_pool_t *pool) { - return APR_ENOTIMPL; + HANDLE hMutex; + SECURITY_ATTRIBUTES sec; + sec.nLength = sizeof(SECURITY_ATTRIBUTES); + sec.lpSecurityDescriptor = NULL; + sec.bInheritHandle = TRUE; + + /* With Win2000 Terminal Services, the Mutex name can have a + * "Global\" or "Local\" prefix to explicitly create the object + * in the global or session name space. Without Terminal Service + * running on Win2000, Global\ and Local\ are ignored. These + * prefixes are only valid on Win2000+ + */ + if (apr_os_level >= APR_WIN_2000) + fname = apr_pstrcat(pool, "Global\\", fname, NULL); + else + fname = apr_pstrdup(pool, fname); + + hMutex = CreateMutex(&sec, FALSE, fname); + if (!hMutex) { + return apr_get_os_error(); + } + + *mutex = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); + (*mutex)->pool = pool; + (*mutex)->handle = hMutex; + (*mutex)->fname = fname; + apr_pool_cleanup_register((*mutex)->pool, *mutex, + proc_mutex_cleanup, apr_pool_cleanup_null); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, const char *fname, apr_pool_t *pool) { - return APR_ENOTIMPL; + HANDLE hMutex; + + if (apr_os_level >= APR_WIN_2000) + fname = apr_pstrcat(pool, "Global\\", fname, NULL); + else + fname = apr_pstrdup(pool, fname); + + hMutex = OpenMutex(MUTEX_ALL_ACCESS, TRUE, fname); + if (!hMutex) { + return apr_get_os_error(); + } + + *mutex = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); + (*mutex)->pool = pool; + (*mutex)->handle = hMutex; + (*mutex)->fname = fname; + apr_pool_cleanup_register((*mutex)->pool, *mutex, + proc_mutex_cleanup, apr_pool_cleanup_null); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) { - return APR_ENOTIMPL; + DWORD rv; + + rv = WaitForSingleObject(mutex->handle, INFINITE); + + if (rv == WAIT_OBJECT_0) { + return APR_SUCCESS; + } + else if (rv == WAIT_ABANDONED) { + return APR_EBUSY; + } + return apr_get_os_error(); } APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) { - return APR_ENOTIMPL; + DWORD rv; + + rv = WaitForSingleObject(mutex->handle, 0); + + if (rv == WAIT_OBJECT_0) { + return APR_SUCCESS; + } + else if (rv == WAIT_ABANDONED) { + return APR_EBUSY; + } + return apr_get_os_error(); } APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) { - return APR_ENOTIMPL; + if (ReleaseMutex(mutex->handle) == 0) { + return apr_get_os_error(); + } + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) { - return APR_ENOTIMPL; + apr_status_t stat; + + stat = proc_mutex_cleanup(mutex); + if (stat == APR_SUCCESS) { + apr_pool_cleanup_kill(mutex->pool, mutex, proc_mutex_cleanup); + } + return stat; } APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) @@ -99,9 +185,9 @@ APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, - apr_proc_mutex_t *lock) + apr_proc_mutex_t *mutex) { - *ospmutex = pmutex->mutex; + *ospmutex = mutex->handle; return APR_SUCCESS; } @@ -117,7 +203,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, sizeof(apr_proc_mutex_t)); (*pmutex)->pool = pool; } - (*pmutex)->mutex = *ospmutex; + (*pmutex)->handle = *ospmutex; return APR_SUCCESS; } diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 2ac52f8bda3..59c99d38389 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -59,6 +59,7 @@ #include "thread_mutex.h" #include "apr_thread_mutex.h" #include "apr_portable.h" +#include "misc.h" static apr_status_t thread_mutex_cleanup(void *data) { @@ -91,10 +92,10 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { - BOOL status; - /* XXX TryEnterCriticalSection is not available under Win9x */ - status = TryEnterCriticalSection(&mutex->section); - if (status) { + if (apr_os_level < APR_WIN_NT) { + return APR_ENOTIMPL; + } + if (TryEnterCriticalSection(&mutex->section)) { return APR_SUCCESS; } return APR_EBUSY; From 5bd6d91ec94d9167642dba7fca97bf1e5f6bbe03 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 8 Jan 2002 06:22:26 +0000 Subject: [PATCH 2712/7878] Add support for EGD-compatible entropy gatherers (such as EGD or PRNGd). At configure-time, specify --with-egd=/path/to/egd/socket. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62715 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ acconfig.h | 2 + configure.in | 25 +++++++++--- include/apr.h.in | 1 + misc/unix/rand.c | 103 +++++++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 126 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 055d732f4f2..875215fa15d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Add --with-egd to support EGD-compatible entropy gatherers for + those platforms without native support. [Justin Erenkrantz] + *) apr_lock_create() and apr_proc_mutex_create() now have an additional parameter for specifying the lock mechanism. apr_lock_create_np() and apr_proc_mutex_create_np() have been diff --git a/acconfig.h b/acconfig.h index 77e6e0f7150..c2a8fbd2a28 100644 --- a/acconfig.h +++ b/acconfig.h @@ -10,6 +10,8 @@ #undef HAVE_CODESET #undef HAVE_PTHREAD_PROCESS_SHARED #undef DEV_RANDOM +#undef HAVE_EGD +#undef EGD_DEFAULT_SOCKET #undef HAVE_TRUERAND #undef HAVE_POLLIN #undef HAVE_isascii diff --git a/configure.in b/configure.in index 389872706a0..0716920c64e 100644 --- a/configure.in +++ b/configure.in @@ -671,6 +671,7 @@ APR_FLAG_HEADERS( sys/time.h \ sys/types.h \ sys/uio.h \ + sys/un.h \ sys/wait.h) dnl IRIX 6.5 has a problem in which prevents it from @@ -714,6 +715,7 @@ AC_SUBST(sys_socketh) AC_SUBST(sys_typesh) AC_SUBST(sys_timeh) AC_SUBST(sys_uioh) +AC_SUBST(sys_unh) AC_SUBST(unistdh) AC_SUBST(signalh) AC_SUBST(sys_waith) @@ -1186,19 +1188,32 @@ elif test -r "/dev/urandom"; then AC_MSG_RESULT(/dev/urandom) rand="1" else - AC_MSG_RESULT(not found); - case $host in # we have built in support for OS/2 *-os2*) + AC_MSG_RESULT([Using OS/2 builtin random]) rand="1" ;; - # no other choice, try for truerand *) - if test "$ac_cv_lib_truerand_main" = "yes"; then + AC_ARG_WITH(egd, + [ --with-egd= use egd-compatible socket], + [ if test "$withval" = "yes"; then + AC_ERROR([You must specify a default EGD socket path.]) + fi + AC_DEFINE(HAVE_EGD) + AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, [$withval]) + AC_MSG_RESULT(EGD-compatible daemon) rand="1" - else + ]) + if test "$rand" != "1"; then + if test "$ac_cv_lib_truerand_main" = "yes"; then + AC_DEFINE(HAVE_TRUERAND) + AC_MSG_RESULT(truerand) + rand="1" + else + AC_MSG_RESULT(not found) rand="0" + fi fi ;; esac diff --git a/include/apr.h.in b/include/apr.h.in index a3d980fb13f..f3747757796 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -59,6 +59,7 @@ #define APR_HAVE_SYS_TIME_H @sys_timeh@ #define APR_HAVE_SYS_TYPES_H @sys_typesh@ #define APR_HAVE_SYS_UIO_H @sys_uioh@ +#define APR_HAVE_SYS_UN_H @sys_unh@ #define APR_HAVE_SYS_WAIT_H @sys_waith@ #define APR_HAVE_UNISTD_H @unistdh@ diff --git a/misc/unix/rand.c b/misc/unix/rand.c index fc0f3950794..93818401cc6 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -52,23 +52,38 @@ * . */ +#define APR_WANT_MEMFUNC +#include "apr_want.h" +#include "apr_general.h" + #include "misc.h" -#include #include +#if APR_HAVE_SYS_TYPES_H +#include +#endif +#if APR_HAVE_SYS_SOCKET_H +#include +#endif +#if APR_HAVE_FCNTL_H #include +#endif #if APR_HAVE_UNISTD_H #include #endif +#if APR_HAVE_SYS_UN_H +#include +#endif #if APR_HAS_RANDOM +/* This tells the preprocessor to put quotes around the value. */ #define XSTR(x) #x #define STR(x) XSTR(x) APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, int length) { -#ifdef DEV_RANDOM +#ifdef DEV_RANDOM int rnd; size_t got, tot; @@ -89,7 +104,89 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, for (idx=0; idx sizeof(addr.sun_path)) { + return APR_EINVAL; + } + + memset(&addr, 0, sizeof(struct sockaddr_un)); + addr.sun_family = AF_UNIX; + memcpy(addr.sun_path, STR(EGD_DEFAULT_SOCKET), egd_path_len); + egd_addr_len = APR_XtOffsetOf(struct sockaddr_un, sun_path) + + egd_path_len; + + egd_socket = socket(PF_UNIX, SOCK_STREAM, 0); + + if (egd_socket == -1) { + /* Does socket set errno? */ + return APR_EGENERAL; + } + + rv = connect(egd_socket, (struct sockaddr*)&addr, egd_addr_len); + + if (rv == -1) { + return errno; + } + + /* EGD can only return 255 bytes of data at a time. Silly. */ + while (length > 0) { + ssize_t srv; + req[0] = 2; /* We'll block for now. */ + req[1] = length > 255 ? 255: length; + + srv = write(egd_socket, req, 2); + if (srv == -1) { + shutdown(egd_socket, SHUT_RDWR); + close(egd_socket); + return errno; + } + + if (srv != 2) { + shutdown(egd_socket, SHUT_RDWR); + close(egd_socket); + return APR_EGENERAL; /* Try again. */ + } + + resp_expected = req[1]; + srv = read(egd_socket, resp, resp_expected); + if (srv == -1) { + shutdown(egd_socket, SHUT_RDWR); + close(egd_socket); + return errno; + } + + memcpy(curbuf, resp, srv); + curbuf += srv; + length -= srv; + } + + shutdown(egd_socket, SHUT_RDWR); + close(egd_socket); + +#elif defined(HAVE_TRUERAND) /* use truerand */ extern int randbyte(void); /* from the truerand library */ unsigned int idx; From 58df9225cd4228b5c5c77af2fd796f2899445654 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 8 Jan 2002 06:26:09 +0000 Subject: [PATCH 2713/7878] Add the ability to pass flags to both apr_file_open and apr_mktemp. The reason for this, is that it is very possible to want a temp file that isn't deleted when the file is closed. It also makes sense to have the flags in the apr_file_t if possible. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62716 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 10 +++++----- file_io/unix/mktemp.c | 17 ++++++----------- file_io/unix/open.c | 9 +++++---- file_io/win32/open.c | 8 +++++--- include/apr_file_io.h | 5 ++++- include/apr_portable.h | 3 ++- locks/unix/locks.c | 2 +- locks/unix/proc_mutex.c | 2 +- shmem/unix/shmem.c | 2 +- 9 files changed, 30 insertions(+), 28 deletions(-) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 6664da334e3..8c569098e4e 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -213,7 +213,7 @@ APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *fi -APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_int32_t flags, apr_pool_t *cont) { apr_os_file_t *dafile = thefile; @@ -223,7 +223,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thef (*file)->isopen = TRUE; (*file)->buffered = FALSE; (*file)->eof_hit = FALSE; - (*file)->flags = 0; + (*file)->flags = flags; (*file)->pipe = FALSE; return APR_SUCCESS; } @@ -242,7 +242,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t { apr_os_file_t fd = 2; - return apr_os_file_put(thefile, &fd, cont); + return apr_os_file_put(thefile, &fd, 0, cont); } @@ -251,7 +251,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t { apr_os_file_t fd = 1; - return apr_os_file_put(thefile, &fd, cont); + return apr_os_file_put(thefile, &fd, 0, cont); } @@ -259,7 +259,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t * { apr_os_file_t fd = 0; - return apr_os_file_put(thefile, &fd, cont); + return apr_os_file_put(thefile, &fd, 0, cont); } APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index c5cb10117a0..aa87c329385 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -120,7 +120,7 @@ static const unsigned char padchar[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; static apr_uint32_t randseed=0; -static int gettemp(char *path, apr_file_t **doopen, apr_pool_t *p) +static int gettemp(char *path, apr_file_t **doopen, apr_int32_t flags, apr_pool_t *p) { register char *start, *trv, *suffp; char *pad; @@ -168,8 +168,7 @@ static int gettemp(char *path, apr_file_t **doopen, apr_pool_t *p) } for (;;) { - if ((rv = apr_file_open(doopen, path, APR_CREATE|APR_EXCL|APR_READ| - APR_WRITE|APR_DELONCLOSE, + if ((rv = apr_file_open(doopen, path, flags, APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) return APR_SUCCESS; if (rv != APR_EEXIST) @@ -202,24 +201,20 @@ static int gettemp(char *path, apr_file_t **doopen, apr_pool_t *p) #endif #endif /* !defined(HAVE_MKSTEMP) */ -APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_int32_t flags, apr_pool_t *p) { + flags = (!flags) ? APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE : flags; #ifndef HAVE_MKSTEMP - return gettemp(template, fp, p); + return gettemp(template, fp, flags, p); #else int fd; - (*fp) = apr_pcalloc(p, sizeof(**fp)); - (*fp)->cntxt = p; - (*fp)->timeout = -1; - (*fp)->blocking = BLK_ON; - (*fp)->flags = APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE; fd = mkstemp(template); if (fd == -1) { return errno; } + apr_os_file_put(fp, &fd, flags, p); (*fp)->fname = apr_pstrdup(p, template); - (*fp)->filedes = fd; apr_pool_cleanup_register((*fp)->cntxt, (void *)(*fp), apr_unix_file_cleanup, apr_unix_file_cleanup); diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 97a15073e70..0ba47f48297 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -211,7 +211,7 @@ APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, - apr_pool_t *cont) + apr_int32_t flags, apr_pool_t *cont) { int *dafile = thefile; @@ -223,6 +223,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file)->timeout = -1; (*file)->ungetchar = -1; /* no char avail */ (*file)->filedes = *dafile; + (*file)->flags = flags; /* buffer already NULL; * don't get a lock (only for buffered files) */ @@ -242,7 +243,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, { int fd = STDERR_FILENO; - return apr_os_file_put(thefile, &fd, cont); + return apr_os_file_put(thefile, &fd, 0, cont); } APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, @@ -250,7 +251,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, { int fd = STDOUT_FILENO; - return apr_os_file_put(thefile, &fd, cont); + return apr_os_file_put(thefile, &fd, 0, cont); } APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, @@ -258,7 +259,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, { int fd = STDIN_FILENO; - return apr_os_file_put(thefile, &fd, cont); + return apr_os_file_put(thefile, &fd, 0, cont); } APR_IMPLEMENT_SET_INHERIT(file, flags, cntxt, apr_unix_file_cleanup) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index aad54853ebe..2cf6fb0bd40 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -415,12 +415,14 @@ APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, + apr_int32_t flags, apr_pool_t *cont) { (*file) = apr_pcalloc(cont, sizeof(apr_file_t)); (*file)->cntxt = cont; (*file)->filehand = *thefile; (*file)->ungetchar = -1; /* no char avail */ + (*file)->flags; return APR_SUCCESS; } @@ -440,7 +442,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t if (file_handle == INVALID_HANDLE_VALUE) return apr_get_os_error(); - return apr_os_file_put(thefile, &file_handle, cont); + return apr_os_file_put(thefile, &file_handle, 0, cont); } APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) @@ -451,7 +453,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t if (file_handle == INVALID_HANDLE_VALUE) return apr_get_os_error(); - return apr_os_file_put(thefile, &file_handle, cont); + return apr_os_file_put(thefile, &file_handle, 0, cont); } APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) @@ -462,7 +464,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t * if (file_handle == INVALID_HANDLE_VALUE) return apr_get_os_error(); - return apr_os_file_put(thefile, &file_handle, cont); + return apr_os_file_put(thefile, &file_handle, 0, cont); } APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); diff --git a/include/apr_file_io.h b/include/apr_file_io.h index ae2dcfb3f60..19e481ecfc5 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -579,6 +579,9 @@ APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); * Open a temporary file * @param fp The apr file to use as a temporary file. * @param template The template to use when creating a temp file. + * @param flags The flags to open the file with. If this is zero, + * the file is opened with + * APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE * @param p The pool to allocate the file out of. * @ingroup apr_file_open * @remark @@ -590,7 +593,7 @@ APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); * */ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *tmplt, - apr_pool_t *p); + apr_int32_t flags, apr_pool_t *p); #ifdef __cplusplus } diff --git a/include/apr_portable.h b/include/apr_portable.h index e9dec39677b..11ef5d91d03 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -340,13 +340,14 @@ APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, * convert the file from os specific type to apr type. * @param file The apr file we are converting to. * @param thefile The os specific file to convert + * @param flags The flags that were used to open this file. * @param cont The pool to use if it is needed. * @remark On Unix, it is only possible to put a file descriptor into * an apr file type. */ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, - apr_pool_t *cont); + apr_int32_t flags, apr_pool_t *cont); /** * convert the dir from os specific type to apr type. diff --git a/locks/unix/locks.c b/locks/unix/locks.c index ac2bc0d734e..5f876bef5fb 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -388,7 +388,7 @@ APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thel (*lock)->pool = pool; } #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE - apr_os_file_put(&(*lock)->interproc, &thelock->crossproc, pool); + apr_os_file_put(&(*lock)->interproc, &thelock->crossproc, 0, pool); #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE (*lock)->pthread_interproc = thelock->pthread_interproc; diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index a9513506fca..08be4ad1c2e 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -827,7 +827,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, (*pmutex)->pool = pool; } #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE - apr_os_file_put(&(*pmutex)->interproc, &ospmutex->crossproc, pool); + apr_os_file_put(&(*pmutex)->interproc, &ospmutex->crossproc, 0, pool); #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE (*pmutex)->pthread_interproc = ospmutex->pthread_interproc; diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index c30595d3c49..a4b09c82f8a 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -153,7 +153,7 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, if (tmpfd == -1) return errno; - apr_os_file_put(&new_m->file, &tmpfd, pool); + apr_os_file_put(&new_m->file, &tmpfd, O_READ | O_WRITE | O_CREATE, pool); status = apr_file_trunc(new_m->file, reqsize); if (status != APR_SUCCESS) { From 08bf82309c63cac4042c80c634df2b0790e5028e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 8 Jan 2002 06:33:00 +0000 Subject: [PATCH 2714/7878] Fix a compile break that I just committed. Having multiple OSes is a good thing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62717 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/mktemp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index aa87c329385..2ca90d2d590 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -203,11 +203,13 @@ static int gettemp(char *path, apr_file_t **doopen, apr_int32_t flags, apr_pool_ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_int32_t flags, apr_pool_t *p) { +#ifdef HAVE_MKSTEMP + int fd; +#endif flags = (!flags) ? APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE : flags; #ifndef HAVE_MKSTEMP return gettemp(template, fp, flags, p); #else - int fd; fd = mkstemp(template); if (fd == -1) { From 9d6de3a84d31f57528934f22bac6e77f88cbd033 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 8 Jan 2002 06:33:34 +0000 Subject: [PATCH 2715/7878] Fix another couple of bugs I introduced with the flags parameter to apr_mktemp. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62718 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 08be4ad1c2e..313ba811a59 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -395,7 +395,7 @@ static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, } else { new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX"); - rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname, + rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname, 0, new_mutex->pool); } @@ -516,7 +516,7 @@ static apr_status_t proc_mutex_flock_create(apr_proc_mutex_t *new_mutex, } else { new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX"); - rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname, + rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname, 0, new_mutex->pool); } From 667a66b176508e27db21ef88a14205d192a1ef8e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 8 Jan 2002 06:44:24 +0000 Subject: [PATCH 2716/7878] more apr_file_mktemp brokeness that I missed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62719 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/crossproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index f5f1ab41f29..55947572280 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -386,7 +386,7 @@ static apr_status_t fcntl_create(apr_lock_t *new, const char *fname) } else { new->fname = apr_pstrdup(new->pool, "/tmp/aprXXXXXX"); - rv = apr_file_mktemp(&new->interproc, new->fname, new->pool); + rv = apr_file_mktemp(&new->interproc, new->fname, 0, new->pool); } if (rv != APR_SUCCESS) { @@ -498,7 +498,7 @@ static apr_status_t flock_create(apr_lock_t *new, const char *fname) } else { new->fname = apr_pstrdup(new->pool, "/tmp/aprXXXXXX"); - rv = apr_file_mktemp(&new->interproc, new->fname, new->pool); + rv = apr_file_mktemp(&new->interproc, new->fname, 0, new->pool); } if (rv != APR_SUCCESS) { From 66bd7a65164ebf2c3da34e5c0113c6d2668a2249 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 8 Jan 2002 06:45:53 +0000 Subject: [PATCH 2717/7878] Doesn't do much good if the win32 projects aren't committed to include the new win32 sources git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62720 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 12 ++++++++++++ libapr.dsp | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/apr.dsp b/apr.dsp index 394e0437df7..4cf42b40938 100644 --- a/apr.dsp +++ b/apr.dsp @@ -170,6 +170,10 @@ SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File +SOURCE=.\locks\win32\proc_mutex.c +# End Source File +# Begin Source File + SOURCE=.\locks\win32\thread_cond.c # End Source File # Begin Source File @@ -543,6 +547,10 @@ SOURCE=.\include\apr_portable.h # End Source File # Begin Source File +SOURCE=.\include\apr_proc_mutex.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_ring.h # End Source File # Begin Source File @@ -563,6 +571,10 @@ SOURCE=.\include\apr_tables.h # End Source File # Begin Source File +SOURCE=.\include\apr_thread_cond.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_thread_mutex.h # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index 414d5c7b2c0..9afda48757c 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -176,6 +176,10 @@ SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File +SOURCE=.\locks\win32\proc_mutex.c +# End Source File +# Begin Source File + SOURCE=.\locks\win32\thread_cond.c # End Source File # Begin Source File @@ -549,6 +553,10 @@ SOURCE=.\include\apr_portable.h # End Source File # Begin Source File +SOURCE=.\include\apr_proc_mutex.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_ring.h # End Source File # Begin Source File @@ -569,6 +577,10 @@ SOURCE=.\include\apr_tables.h # End Source File # Begin Source File +SOURCE=.\include\apr_thread_cond.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_thread_mutex.h # End Source File # Begin Source File From bf69e1828c5d1cf8c62e91d1e0e5386bc7721f86 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 8 Jan 2002 12:29:38 +0000 Subject: [PATCH 2718/7878] get the prototype for apr_os_file_put() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62721 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/mktemp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 2ca90d2d590..70c28d88dfd 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -88,6 +88,7 @@ #include "apr_file_io.h" /* prototype of apr_mkstemp() */ #include "apr_strings.h" /* prototype of apr_mkstemp() */ #include "fileio.h" /* prototype of apr_mkstemp() */ +#include "apr_portable.h" /* for apr_os_file_put() */ #ifndef HAVE_MKSTEMP From 633c1959bc809649a5153155cd70027d7e26cf42 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 8 Jan 2002 19:48:09 +0000 Subject: [PATCH 2719/7878] Add the licence to testdso.c :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62722 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/test/testdso.c b/test/testdso.c index 80644ca63f5..240264d26a8 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -1,3 +1,58 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + #include "apr_general.h" #include "apr_pools.h" #include "apr_errno.h" From 3ffac9a4457822f0e48e168f651d5089df97229c Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 8 Jan 2002 21:00:37 +0000 Subject: [PATCH 2720/7878] Cleanup work on the proc stubs that are unused in NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62723 13f79535-47bb-0310-9956-ffa450edef68 --- locks/netware/proc_mutex.c | 14 ++----------- threadproc/netware/proc.c | 38 +++++++++++++++++++++--------------- threadproc/netware/signals.c | 17 +++------------- 3 files changed, 27 insertions(+), 42 deletions(-) diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 1903328935a..77022122ab1 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -101,23 +101,13 @@ APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) apr_status_t apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, apr_proc_mutex_t *pmutex) { - ospmutex = pmutex->mutex; - return APR_SUCCESS; + return APR_ENOTIMPL; } apr_status_t apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *pool) { - if (pool == NULL) { - return APR_ENOPOOL; - } - if ((*pmutex) == NULL) { - (*pmutex) = (apr_proc_mutex_t *)apr_palloc(pool, - sizeof(apr_proc_mutex_t)); - (*pmutex)->pool = pool; - } - (*pmutex)->mutex = ospmutex; - return APR_SUCCESS; + return APR_ENOTIMPL; } diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 494b2662024..7052669b6a2 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -62,7 +62,7 @@ * Knowledge Base article: Q190351 * */ -apr_status_t apr_procattr_create(apr_procattr_t **new,apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new,apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_pcalloc(cont, sizeof(apr_procattr_t)); @@ -75,7 +75,7 @@ apr_status_t apr_procattr_create(apr_procattr_t **new,apr_pool_t *cont) } -apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) { apr_status_t status; @@ -140,7 +140,7 @@ apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, } -apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, +APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) @@ -156,7 +156,7 @@ apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_i } -apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, +APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) @@ -172,7 +172,7 @@ apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_ } -apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, +APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) @@ -188,7 +188,7 @@ apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_ } -apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { attr->currdir = apr_pstrdup(attr->cntxt, dir); @@ -198,22 +198,22 @@ apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, return APR_ENOMEM; } -apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) +APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) +#if APR_HAS_FORK +APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) { -#if 0 int pid; if ((pid = fork()) < 0) { @@ -230,9 +230,9 @@ apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) proc->in = NULL; proc->out = NULL; proc->err = NULL; -#endif return APR_INPARENT; } +#endif static apr_status_t limit_proc(apr_procattr_t *attr) { @@ -279,7 +279,7 @@ static apr_status_t limit_proc(apr_procattr_t *attr) return APR_SUCCESS; } -apr_status_t apr_proc_create(apr_proc_t *new, +APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, const char * const *env, @@ -368,8 +368,10 @@ apr_status_t apr_proc_create(apr_proc_t *new, if (attr->child_err) { apr_file_close(attr->child_err); } -#endif return APR_SUCCESS; +#else + return APR_ENOTIMPL; +#endif } APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, @@ -391,8 +393,10 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, else if (proc->pid == 0) { return APR_CHILD_NOTDONE; } -#endif return errno; +#else + return APR_ENOTIMPL; +#endif } APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, @@ -417,11 +421,13 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, else if (status == 0) { return APR_CHILD_NOTDONE; } -#endif return errno; +#else + return APR_ENOTIMPL; +#endif } -apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, +APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, struct rlimit *limit) { switch(what) { diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c index e46fc3c8259..87e2cdb2316 100644 --- a/threadproc/netware/signals.c +++ b/threadproc/netware/signals.c @@ -67,20 +67,9 @@ #include #endif -apr_status_t apr_proc_kill(apr_proc_t *proc, int signum) +APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signum) { -#ifndef NETWARE - if (kill(proc->pid, signum) == -1) { - return errno; - } -#endif - - //srj need to find equal to kill or use sigterm in nks - //srj windows is using TerminateProcess here - //srj if ( NXThreadExit(proc->pid) != 0) { - //srj return errno; - //srj } - return APR_SUCCESS; + return APR_ENOTIMPL; } @@ -116,7 +105,7 @@ static void *signal_thread_func(void *signal_handler) return NULL; } -apr_status_t apr_setup_signal_thread(void) +APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) { int rv = 0; From 80c3c8e0dcd7bd47abaad8c25b370c9aa0000664 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 8 Jan 2002 21:39:42 +0000 Subject: [PATCH 2721/7878] Fixed the export list generation for NetWare to make sure that only real APIs are being exported git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62724 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_nw_export.awk | 62 ++---------------------------------- build/nw_export.inc | 68 ++++++++++++++++++++++++++++++++++++++++ build/prebuildNW.bat | 23 ++++++++++++-- 3 files changed, 92 insertions(+), 61 deletions(-) create mode 100644 build/nw_export.inc diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index 922489bf518..1e270de2a64 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -2,71 +2,15 @@ # based on Ryan Bloom's make_export.pl # List of functions that we don't support, yet?? -/apr_##name##_set_inherit/{next} -/apr_##name##_unset_inherit/{next} -/apr_compare_groups/{next} -/apr_compare_users/{next} -/apr_find_pool/{next} -/apr_generate_random_bytes/{next} -/apr_lock_create_np/{next} -/apr_md5_set_xlate/{next} -/apr_mmap_create/{next} -/apr_mmap_delete/{next} -/apr_mmap_dup/{next} -/apr_mmap_offset/{next} -/apr_pool_create\(/{next} -/apr_pool_free_blocks_num_bytes/{next} -/apr_pool_join/{next} -/apr_pool_lock/{next} -/apr_pool_num_bytes/{next} -/apr_pool_sub_make/{next} -/apr_proc_mutex_child_init/{next} -/apr_proc_mutex_create/{next} -/apr_proc_mutex_create_np/{next} -/apr_proc_mutex_destroy/{next} -/apr_proc_mutex_lock/{next} -/apr_proc_mutex_trylock/{next} -/apr_proc_mutex_unlock/{next} -/apr_proc_other_child_check/{next} -/apr_proc_other_child_read/{next} -/apr_proc_other_child_register/{next} -/apr_proc_other_child_unregister/{next} -/apr_sendfile/{next} -/apr_shm_avail/{next} -/apr_shm_calloc/{next} -/apr_shm_destroy/{next} -/apr_shm_free/{next} -/apr_shm_init/{next} -/apr_shm_malloc/{next} -/apr_shm_name_get/{next} -/apr_shm_name_set/{next} -/apr_shm_open/{next} -/apr_signal/{next} -/apr_signal_thread/{next} -/apr_socket_from_file/{next} -/apr_xlate_close/{next} -/apr_xlate_conv_buffer/{next} -/apr_xlate_conv_byte/{next} -/apr_xlate_conv_char/{next} -/apr_xlate_get_sb/{next} -/apr_xlate_open/{next} -/apr_brigade_consume/{next} -/apr_bucket_mmap_create/{next} -/apr_bucket_mmap_make/{next} -/apr_bucket_type_mmap/{next} -/apr_md4_set_xlate/{next} -/apr_os_proc_mutex_get/{next} -/apr_os_proc_mutex_put/{next} -/proc_mutex/{next} +#/apr_##name##_set_inherit/{next} +#/apr_##name##_unset_inherit/{next} function add_symbol (sym_name) { if (count) { found++ } -# for (i = 0; i < count; i++) { -# line = line "\t" -# } + gsub (/ /, "", sym_name) line = line sym_name ",\n" if (count == 0) { diff --git a/build/nw_export.inc b/build/nw_export.inc new file mode 100644 index 00000000000..6a446ac4fac --- /dev/null +++ b/build/nw_export.inc @@ -0,0 +1,68 @@ +/* Must include apr.h first so that we can undefine + the standard prototypes macros after it messes with + them. */ +#include "apr.h" + +#undef APR_DECLARE +#undef APR_DECLARE_NONSTD +#undef APR_DECLARE_HOOK +#undef APR_POOL_DECLARE_ACCESSOR +#undef APR_DECLARE_DATA + +/* Preprocess all of the standard APR headers. */ +#include "apr_compat.h" +#include "apr_dso.h" +#include "apr_errno.h" +#include "apr_file_info.h" +#include "apr_fnmatch.h" +#include "apr_general.h" +#include "apr_getopt.h" +#include "apr_hash.h" +#include "apr_inherit.h" +#include "apr_lib.h" +#include "apr_lock.h" +#include "apr_md5.h" +#include "apr_mmap.h" +#include "apr_network_io.h" +#include "apr_pools.h" +#include "apr_portable.h" +#include "apr_proc_mutex.h" +#include "apr_ring.h" +/*#include "apr_shmem.h"*/ +#include "apr_signal.h" +#include "apr_strings.h" +#include "apr_tables.h" +#include "apr_thread_cond.h" +#include "apr_thread_mutex.h" +#include "apr_thread_proc.h" +#include "apr_thread_rwlock.h" +#include "apr_time.h" +#include "apr_user.h" +#include "apr_uuid.h" +#include "apr_version.h" +#include "apr_want.h" +#include "apr_xlate.h" + +/* Must include apu.h first so that we can undefine + the standard prototypes macros after it messes with + them. */ +#include "apu.h" + +#undef APU_DECLARE +#undef APU_DECLARE_NONSTD +#undef APU_DECLARE_DATA + +/* Preprocess all of the standard APR headers. */ +#include "apr_base64.h" +#include "apr_buckets.h" +#include "apr_date.h" +#include "apr_dbm.h" +#include "apr_hooks.h" +#include "apr_md4.h" +#include "apr_optional.h" +#include "apr_optional_hooks.h" +#include "apr_sdbm.h" +#include "apr_sha1.h" +#include "apr_uri.h" +#include "apr_xml.h" +#include "apr_compat.h" diff --git a/build/prebuildNW.bat b/build/prebuildNW.bat index 39297a35ade..e45047bd2a3 100755 --- a/build/prebuildNW.bat +++ b/build/prebuildNW.bat @@ -1,4 +1,19 @@ @echo off + +if not "%NovellNDK%" == "" goto CheckNDK +set NovellNDK=\novell\ndk\libc +@echo Could not find the NovellNDK environment variable +@echo Setting NovellNDK = %NovellNDK% +@echo --------------------- + +:CheckNDK +if exist %NovellNDK%\include\netware.h goto NDKOK +@echo The path to the NDK "%NovellNDK%" is invalid. +@echo Please set then NovellNDK environment variable to the location of the NDK +@echo --------------------- +goto Done + +:NDKOK @echo # As part of the pre-build process, the utility GenURI.NLM @echo # (Gen URI Delims) must be built, copied to a NetWare server @echo # and run using the following command: @@ -23,5 +38,9 @@ copy ..\..\pcre\config.hw ..\..\pcre\config.h copy ..\..\pcre\pcre.hw ..\..\pcre\pcre.h @echo Generating the import list... -awk -f make_nw_export.awk ..\include\*.h |sort > ..\aprlib.imp -awk -f make_nw_export.awk ..\..\apr-util\include\*.h |sort >> ..\aprlib.imp +set MWCIncludes=..\include;..\include\arch\netware;..\include\arch\unix;..\..\apr-util\include;+%NovellNDK% +mwccnlm -P nw_export.inc -d NETWARE -EP +awk -f make_nw_export.awk nw_export.i |sort >..\aprlib.imp + +:Done +pause From e3c6b0a4fb47ecec55bbfa1311d902c0b577130c Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 8 Jan 2002 21:52:57 +0000 Subject: [PATCH 2722/7878] Changed the project file to use the NDK (NovellNDK) environment variable to locate the LibC SDK headers and libraries git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62725 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 189944 -> 197060 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 9036db21cb5a5cd076c75c3cd1db976759613aef..981db2b8f86e3299391c53937a5eb94231493eb5 100644 GIT binary patch delta 93907 zcmbTd1yCHp(>RKg;1b*d1h?Q0!5up)4r%5oh$Mi? z%a0WOZPddGj?P(lNGNzMFC%3vUTl4ev>c@Et=D1tp4{$kMfLNuN!8z_Ei46=WRzbz zZ&63^nO_-t*$Ml+XD)6k=0u_X!m^X%e0h)YP1?INb>Zy6_Bp}Is9|9`QRR{ew70sR z4%pg0-`PH;PpdPNUlYHiWu=sc9VWW~7DsTY_W$UTzeY5Ko?kw_+-doKg zT;|8~%*4gP^aZoG>90g9@OGi!-QS{2a99vhm6ph_#l=Ufj>DW$F zRe5#l$WShauP_z51h&|^U-WGDMXU&igwtX6U!R{>9frVz%w}u$WH|MPQZ{!210Qk#WY31^y_xu?vslbTUbE({Dm*O9cTT92GP^ zoop)EERTbRe#~o8_RsbjZ!DO`GUgFyjmXZTw0#P<47lkJk1iPhG>Z6TH`?e;9&w>&vsSw zx;sbxdyE4OB{8$5%ceF_>+%ccg^h!M?J#$`#p>y*mhBnxMFK}f;1-Pbl}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xnKyR(3j0hk#gS96UggJ%OPR?b-8ePEQw;azORh8L*&XbP;V-q))JJQlmE)0 zc_UszK!IO(G%Iv0$ubK92z!yzN09)qt!N!LDD#3n7Rw-xNMDSg@SJ#AvtoGNtFgAm z05Fpx?-(GfieUh4M%Th*M@-}sF%OJFdSYbzu}{T37so{$M#c?W*5fH6jF-e%by%g> zP=L`*5+k)K(wVGVOTx&i1Di&7cXvI=gEwpDtQq+m(-aV-S>u2)G+U?3s3_HrrVH6kM)$9JwW6|Z(==6mv~#U}Z^Ov5<}E3wQ> znEtr6WCy^P;7iSfzsrJWytNitE-8U`nStDBdmGu##qCXG5Flhc0+ck8B?h3xHV(Hs z`${9hC8;NSVZ5;3pwcf;jK|$uRa3ur#28&{J9pqENLg2;(T!MUy+NWyJQgRokXvck z1mGVG=VsFz^-(}Tif3?KYz#H1)f^zY(Fy@WMeSVQZBIw1T)3?qE|bL=ZKd!y;EUxK zC0+{V^K@FLkTvQGfgAjrHQ#Q_FY)BdKG@8sMx8kn&iX1V5}wrP9_L*E_NY~qUlPT~ zW!+YVT&oD~@s#KD<}7u*&PbS>&9MiRWTe& zvd&s^v@x|(!9u!+#Mq!-)*t0(t_ut^#DCQKc$j_y%ilvk9(6twsDIP}NjVfLOiP0C z4Pp4RwNkj&)#DFC&su9R=~uDnR6DoSb8M*;DjQ3XWtK#agu9|h` zu4)S4{}1WAM1=pQRmbw|Wy6mYj&--h_zH*`@tq(SyfQE?Ygb6e<*q=V!5fP_kAx

      - *            APR_SHELLCMD --  Shell script
      - *            APR_PROGRAM  --  Executable program   (default) 
      + *            APR_SHELLCMD     --  Shell script
      + *            APR_PROGRAM      --  Executable program   (default) 
      + *            APR_PROGRAM_ENV  --  Executable program, copy environment
      + *            APR_PROGRAM_PATH --  Executable program on PATH, copy env
        * 
      */ APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, @@ -477,7 +492,9 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont); * @param const_args the arguments to pass to the new program. The first * one should be the program name. * @param env The new environment table for the new process. This - * should be a list of NULL-terminated strings. + * should be a list of NULL-terminated strings. This argument + * is ignored for APR_PROGRAM_ENV and APR_PROGRAM_PATH types + * of commands. * @param attr the procattr we should use to determine how to create the new * process * @param cont The pool to use. diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 7bfa25d6489..edd36de6090 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -249,6 +249,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, } newargs[nargs] = NULL; + /* ### we should be looking at attr->cmdtype in here... */ + newproc = load_image(nargs, (const char**)newargs, (const char**)env); /* load_image copies the data so now we can free it... */ diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 7052669b6a2..69c1aab51dc 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -349,12 +349,25 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } execve(SHELL_PATH, (char * const *) newargs, (char * const *)env); } - else { + else if (attr->cmdtype == APR_PROGRAM) { if (attr->detached) { apr_proc_detach(); } execve(progname, (char * const *)args, (char * const *)env); } + else if (attr->cmdtype == APR_PROGRAM_ENV) { + if (attr->detached) { + apr_proc_detach(); + } + execv(progname, (char * const *)args); + } + else { + /* APR_PROGRAM_PATH */ + if (attr->detached) { + apr_proc_detach(); + } + execvp(progname, (char * const *)args); + } exit(-1); /* if we get here, there is a problem, so exit with an */ /* error code. */ } diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 927fd96ecb5..08af08794d8 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -345,6 +345,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname if (extension == NULL || strchr(extension, '/') || strchr(extension, '\\')) extension = ""; + /* ### how to handle APR_PROGRAM_ENV and APR_PROGRAM_PATH? */ + if (attr->cmdtype == APR_SHELLCMD || strcasecmp(extension, ".cmd") == 0) { strcpy(interpreter, "#!" SHELL_PATH); extra_arg = "/C"; diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 4872f7508af..ff80f2cfea4 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -366,12 +366,25 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, } execve(SHELL_PATH, (char * const *) newargs, (char * const *)env); } - else { + else if (attr->cmdtype == APR_PROGRAM) { if (attr->detached) { apr_proc_detach(); } execve(progname, (char * const *)args, (char * const *)env); } + else if (attr->cmdtype == APR_PROGRAM_ENV) { + if (attr->detached) { + apr_proc_detach(); + } + execv(progname, (char * const *)args); + } + else { + /* APR_PROGRAM_PATH */ + if (attr->detached) { + apr_proc_detach(); + } + execvp(progname, (char * const *)args); + } exit(-1); /* if we get here, there is a problem, so exit with an */ /* error code. */ } diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 10ea0f85072..400d7ab2301 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -343,6 +343,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, i++; } + /* ### how to handle APR_PROGRAM_ENV and APR_PROGRAM_PATH? */ + if (attr->cmdtype == APR_SHELLCMD) { char *shellcmd = getenv("COMSPEC"); if (!shellcmd) From 18fe122ea05cd9f38241fb2fe035ae83df9ba69d Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 28 Jan 2002 23:37:42 +0000 Subject: [PATCH 2837/7878] Added testrand.c to the test build project and added rand.c to the APR project git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62841 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 196740 -> 178980 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 253644ca912874bc13f4d19ae9f269c8aca5bcfb..3af90ba7039e5bee46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ky*^m*p%&$%CVF5CUFH+{|ix1IaG-0%iDw)^{$@5hXN znrzsAbj`HLpFaC5u!+Lf93B6w8W`c672faPZ*pII+kxn6E^0Zca&P-M&CGA-Z8YS=m4en1HYXNPqj!1SA1kaGt~f From 447d91ab3ebd652ef7426ba648c7804723095c81 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 28 Jan 2002 23:39:28 +0000 Subject: [PATCH 2838/7878] Removed the obsolete flag statements and added a reference to APRLIB so that it will autoload git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62842 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.def | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/aprtest.def b/test/aprtest.def index 72c158a0fb3..bfea210d864 100644 --- a/test/aprtest.def +++ b/test/aprtest.def @@ -1,3 +1,3 @@ -FLAG_ON 3 -#FLAG_ON 29 MODULE LIBC.NLM +MODULE APRLIB.NLM + From afb0391621460fee5824b1d9ce155f0e4b287a0c Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 28 Jan 2002 23:40:59 +0000 Subject: [PATCH 2839/7878] Added the implementation of apr_generate_random_bytes() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62843 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 2 +- misc/netware/rand.c | 69 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 misc/netware/rand.c diff --git a/include/apr.hnw b/include/apr.hnw index 70dcebd0283..09e4aa6e613 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -181,7 +181,7 @@ #define APR_HAS_SENDFILE 0 #define APR_HAS_MMAP 0 #define APR_HAS_FORK 0 -#define APR_HAS_RANDOM 0 +#define APR_HAS_RANDOM 1 #define APR_HAS_XLATE 0 #define APR_HAS_OTHER_CHILD 0 #define APR_HAS_DSO 1 diff --git a/misc/netware/rand.c b/misc/netware/rand.c new file mode 100644 index 00000000000..01329d114a5 --- /dev/null +++ b/misc/netware/rand.c @@ -0,0 +1,69 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#define APR_WANT_MEMFUNC +#include "apr_want.h" +#include "apr_general.h" + +#if APR_HAS_RANDOM + +#include + +APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, + int length) +{ + return NXGetRandom(length, buf); +} + +#endif /* APR_HAS_RANDOM */ From f9f9c6b467f4e08049b334565743795a4ca791dc Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 29 Jan 2002 00:17:38 +0000 Subject: [PATCH 2840/7878] Added the apr_shm and apr_rmm API to the export list processing git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62844 13f79535-47bb-0310-9956-ffa450edef68 --- build/nw_export.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/nw_export.inc b/build/nw_export.inc index 6a446ac4fac..e7121aa7f53 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -28,7 +28,7 @@ #include "apr_portable.h" #include "apr_proc_mutex.h" #include "apr_ring.h" -/*#include "apr_shmem.h"*/ +#include "apr_shm.h" #include "apr_signal.h" #include "apr_strings.h" #include "apr_tables.h" @@ -61,6 +61,7 @@ #include "apr_md4.h" #include "apr_optional.h" #include "apr_optional_hooks.h" +#include "apr_rmm.h" #include "apr_sdbm.h" #include "apr_sha1.h" #include "apr_uri.h" From 0f9d86501fb9ca4d627e9c33768f7a45c3290e5e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 29 Jan 2002 00:18:13 +0000 Subject: [PATCH 2841/7878] Added apr_rmm.c to the APRLib build project git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62845 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 178980 -> 178848 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprn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17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 29 Jan 2002 00:36:22 +0000 Subject: [PATCH 2842/7878] First cut at implementing fork/exec like functionality in NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62846 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 195 +++++++++++++++++++------------------- 1 file changed, 95 insertions(+), 100 deletions(-) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 69c1aab51dc..08ceede31c2 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -57,11 +57,16 @@ #include "apr_strings.h" #include "apr_portable.h" -/* - * some of the ideas expressed herein are based off of Microsoft - * Knowledge Base article: Q190351 - * - */ +#include + +apr_status_t apr_netware_proc_cleanup(void *theproc) +{ + apr_proc_t *proc = theproc; + + NXVmDestroy(proc->pid); + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new,apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_pcalloc(cont, sizeof(apr_procattr_t)); @@ -147,10 +152,10 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_fi apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); if (child_in != NULL) - apr_file_dup(&attr->child_in, child_in, attr->cntxt); + apr_file_dup2(attr->child_in, child_in, attr->cntxt); if (parent_in != NULL) - apr_file_dup(&attr->parent_in, parent_in, attr->cntxt); + apr_file_dup2(attr->parent_in, parent_in, attr->cntxt); return APR_SUCCESS; } @@ -163,10 +168,10 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_f apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - apr_file_dup(&attr->child_out, child_out, attr->cntxt); + apr_file_dup2(attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - apr_file_dup(&attr->parent_out, parent_out, attr->cntxt); + apr_file_dup2(attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } @@ -179,10 +184,10 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - apr_file_dup(&attr->child_err, child_err, attr->cntxt); + apr_file_dup2(attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - apr_file_dup(&attr->parent_err, parent_err, attr->cntxt); + apr_file_dup2(attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } @@ -201,6 +206,8 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) { + if (cmd != APR_PROGRAM) + return APR_ENOTIMPL; attr->cmdtype = cmd; return APR_SUCCESS; } @@ -279,112 +286,100 @@ static apr_status_t limit_proc(apr_procattr_t *attr) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, +APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *cont) { -#if 0 - int i; + int i, envCount; const char **newargs; - - new->in = attr->parent_in; - new->err = attr->parent_err; - new->out = attr->parent_out; - if ((new->pid = fork()) < 0) { - return errno; - } - else if (new->pid == 0) { - int status; - /* child process */ - if (attr->child_in) { - apr_file_close(attr->parent_in); - dup2(attr->child_in->filedes, STDIN_FILENO); - apr_file_close(attr->child_in); - } - if (attr->child_out) { - apr_file_close(attr->parent_out); - dup2(attr->child_out->filedes, STDOUT_FILENO); - apr_file_close(attr->child_out); + char **newenv; + NXVmId_t newVM; + unsigned long flags = 0; + + NXNameSpec_t nameSpec; + NXExecEnvSpec_t envSpec; + + /* Set up the info for the NLM to be started */ + nameSpec.ssType = NX_OBJ_FILE; + nameSpec.ssPathCtx = NULL; + nameSpec.ssPath = (void*)progname; + + /* Count how many arguments there are and assign them + to the environent */ + for (i=0;args && args[i];i++); + envSpec.esArgc = i; + envSpec.esArgv = (void**)args; + + /* Count how many environment variables there are in the + system, add any new environment variables and place + them in the environment. */ + for (i=0;env && env[i];i++); + envCount = NXGetEnvCount(); + if ((envCount + i) > 0) { + newenv = (char **) NXMemAlloc(sizeof(char *) * (envCount+i+1), 0); + if (!newenv) + return APR_ENOMEM; + NXCopyEnv(newenv, envCount); + for (i=0;env && env[i];i++) { + newenv[envCount+i-1] = (char*)env[i]; } - if (attr->child_err) { - apr_file_close(attr->parent_err); - dup2(attr->child_err->filedes, STDERR_FILENO); - apr_file_close(attr->child_err); - } - - apr_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ + newenv[envCount+i] = NULL; - if (attr->currdir != NULL) { - if (chdir(attr->currdir) == -1) { - exit(-1); /* We have big problems, the child should exit. */ - } - } - - apr_pool_cleanup_for_exec(); - - if ((status = limit_proc(attr)) != APR_SUCCESS) { - return status; - } - - if (attr->cmdtype == APR_SHELLCMD) { - i = 0; - while (args[i]) { - i++; - } - newargs = - (const char **) apr_palloc(cont, sizeof (char *) * (i + 3)); - newargs[0] = SHELL_PATH; - newargs[1] = "-c"; - i = 0; - while (args[i]) { - newargs[i + 2] = args[i]; - i++; - } - newargs[i + 2] = NULL; - if (attr->detached) { - apr_proc_detach(); - } - execve(SHELL_PATH, (char * const *) newargs, (char * const *)env); - } - else if (attr->cmdtype == APR_PROGRAM) { - if (attr->detached) { - apr_proc_detach(); - } - execve(progname, (char * const *)args, (char * const *)env); - } - else if (attr->cmdtype == APR_PROGRAM_ENV) { - if (attr->detached) { - apr_proc_detach(); - } - execv(progname, (char * const *)args); - } - else { - /* APR_PROGRAM_PATH */ - if (attr->detached) { - apr_proc_detach(); - } - execvp(progname, (char * const *)args); - } - exit(-1); /* if we get here, there is a problem, so exit with an */ - /* error code. */ + envSpec.esEnv = (void**)newenv; } - /* Parent process */ + else + envSpec.esEnv = NULL; + if (attr->child_in) { - apr_file_close(attr->child_in); + envSpec.esStdin.ssType = NX_OBJ_FIFO; + envSpec.esStdin.ssHandle = attr->child_in->filedes; + } + else { + envSpec.esStdin.ssType = NX_OBJ_DEFAULT; + envSpec.esStdin.ssHandle = -1; } + envSpec.esStdin.ssPathCtx = NULL; + envSpec.esStdin.ssPath = NULL; if (attr->child_out) { - apr_file_close(attr->child_out); + envSpec.esStdout.ssType = NX_OBJ_FIFO; + envSpec.esStdout.ssHandle = attr->child_out->filedes; } + else { + envSpec.esStdout.ssType = NX_OBJ_DEFAULT; + envSpec.esStdout.ssHandle = -1; + } + envSpec.esStdout.ssPathCtx = NULL; + envSpec.esStdout.ssPath = NULL; if (attr->child_err) { - apr_file_close(attr->child_err); + envSpec.esStderr.ssType = NX_OBJ_FIFO; + envSpec.esStderr.ssHandle = attr->child_err->filedes; + } + else { + envSpec.esStderr.ssType = NX_OBJ_DEFAULT; + envSpec.esStderr.ssHandle = -1; + } + envSpec.esStderr.ssPathCtx = NULL; + envSpec.esStderr.ssPath = NULL; + + if (attr->detached) { + flags = NX_VM_CREATE_DETACHED; + } + + newproc->in = attr->parent_in; + newproc->err = attr->parent_err; + newproc->out = attr->parent_out; + if (NXVmSpawn(&nameSpec, &envSpec, flags, &newVM) != 0) { + return errno; + } + else { + newproc->pid = newVM; + apr_pool_cleanup_register(cont, (void *)newproc, apr_netware_proc_cleanup, + apr_pool_cleanup_null); } return APR_SUCCESS; -#else - return APR_ENOTIMPL; -#endif } APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, From c46202a94347809e3d0bc1f59fbbe30512982769 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 29 Jan 2002 00:38:26 +0000 Subject: [PATCH 2843/7878] Fixed the way the FIFOs are being cleaned up for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62847 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index b6a3805eff5..bb86788ab74 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -72,6 +72,26 @@ static int convert_error (int err) return err; } +apr_status_t apr_netware_pipe_cleanup(void *thefile) +{ + apr_file_t *file = thefile; + apr_status_t rv = APR_SUCCESS; + int rc; + + rc = NXClose(file->filedes); + if (rc == 0) { + file->filedes = -1; + if (file->thlock) { + rv = apr_thread_mutex_destroy(file->thlock); + } + } + else { + /* Are there any error conditions other than EINTR or EBADF? */ + rv = errno; + } + return rv; +} + static apr_status_t pipeblock(apr_file_t *thepipe) { int err; @@ -148,14 +168,17 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out if ( !(err = NXFifoOpen(0, tname, NX_O_RDONLY, 0, &filedes[0])) && !(err = NXFifoOpen(0, tname, NX_O_WRONLY, 0, &filedes[1]))) { + (*in) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); + (*out) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); + (*in)->cntxt = (*out)->cntxt = cont; (*in)->filedes = filedes[0]; (*out)->filedes = filedes[1]; (*in)->pipe = (*out)->pipe = 1; - (*out)->fname = - (*in)->fname = NULL; + (*out)->fname = apr_pstrdup(cont, tname); + (*in)->fname = apr_pstrdup(cont, tname);; (*in)->buffered = (*out)->buffered = 0; (*in)->blocking = @@ -175,6 +198,12 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return convert_error (err); } + + apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), apr_netware_pipe_cleanup, + apr_pool_cleanup_null); + apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), apr_netware_pipe_cleanup, + apr_pool_cleanup_null); + return APR_SUCCESS; } From d96b71e0ec1d343028b2e0c913fcc79d55b0c8ba Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 29 Jan 2002 01:16:11 +0000 Subject: [PATCH 2844/7878] Implement shared memory cleanup handlers on Unix for both the original creating process' pool (cleans up after apr_shm_create) and an attaching process' pool (cleans up after apr_shm_attach). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62848 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 164 ++++++++++++++++++++++++++++------------------- 1 file changed, 98 insertions(+), 66 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index f965e9daeea..c493bdc7c5e 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -59,6 +59,74 @@ #include "apr_user.h" #include "apr_strings.h" +static apr_status_t shm_cleanup_owner(void *m_) +{ + apr_shm_t *m = (apr_shm_t *)m_; + + /* anonymous shared memory */ + if (m->filename == NULL) { +#if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_MMAP_ANON + if (munmap(m->base, m->realsize) == -1) { + return errno; + } + return APR_SUCCESS; +#endif +#if APR_USE_SHMEM_SHMGET_ANON + if (shmdt(m->base) == -1) { + return errno; + } + /* This segment will automatically remove itself after all + * references have detached. */ + return APR_SUCCESS; +#endif + } + + /* name-based shared memory */ + else { +#if APR_USE_SHMEM_MMAP_TMP + apr_status_t rv; + + if (munmap(m->base, m->realsize) == -1) { + return errno; + } + rv = apr_file_remove(m->filename, m->pool); + if (rv != APR_SUCCESS) { + return rv; + } + return APR_SUCCESS; +#endif +#if APR_USE_SHMEM_MMAP_SHM + if (munmap(m->base, m->realsize) == -1) { + return errno; + } + if (shm_unlink(m->filename) == -1) { + return errno; + } + return APR_SUCCESS; +#endif +#if APR_USE_SHMEM_SHMGET + apr_status_t rv; + + /* Indicate that the segment is to be destroyed as soon + * as all processes have detached. This also disallows any + * new attachments to the segment. */ + if (shmctl(m->shmid, IPC_RMID, NULL) == -1) { + return errno; + } + if (shmdt(m->base) == -1) { + return errno; + } + rv = apr_file_remove(m->filename, m->pool); + if (rv != APR_SUCCESS) { + return rv; + } + return APR_SUCCESS; +#endif + } + + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, apr_size_t reqsize, const char *filename, @@ -126,6 +194,8 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* metadata isn't usable */ new_m->usable = new_m->base + sizeof(apr_size_t); + apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, + apr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; @@ -141,6 +211,8 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* metadata isn't usable */ new_m->usable = (char *)new_m->base + sizeof(apr_size_t); + apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, + apr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; @@ -185,6 +257,8 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return errno; } + apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, + apr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; #endif /* APR_USE_SHMEM_SHMGET_ANON */ @@ -276,6 +350,8 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* metadata isn't usable */ new_m->usable = new_m->base + sizeof(apr_size_t); + apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, + apr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; @@ -330,6 +406,8 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return status; } + apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, + apr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; @@ -341,63 +419,30 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) { - /* anonymous shared memory */ + apr_status_t rv = shm_cleanup_owner(m); + apr_pool_cleanup_kill(m->pool, m, shm_cleanup_owner); + return rv; +} + +static apr_status_t shm_cleanup_attach(void *m_) +{ + apr_shm_t *m = (apr_shm_t *)m_; + if (m->filename == NULL) { -#if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_MMAP_ANON - if (munmap(m->base, m->realsize) == -1) { - return errno; - } - return APR_SUCCESS; -#endif -#if APR_USE_SHMEM_SHMGET_ANON - if (shmdt(m->base) == -1) { - return errno; - } - /* This segment will automatically remove itself after all - * references have detached. */ - return APR_SUCCESS; -#endif + /* It doesn't make sense to detach from an anonymous memory segment. */ + return APR_EINVAL; } - - /* name-based shared memory */ else { -#if APR_USE_SHMEM_MMAP_TMP - apr_status_t rv; - - if (munmap(m->base, m->realsize) == -1) { - return errno; - } - rv = apr_file_remove(m->filename, m->pool); - if (rv != APR_SUCCESS) { - return rv; - } - return APR_SUCCESS; -#endif -#if APR_USE_SHMEM_MMAP_SHM +#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM if (munmap(m->base, m->realsize) == -1) { return errno; } - if (shm_unlink(m->filename) == -1) { - return errno; - } return APR_SUCCESS; -#endif +#endif /* APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM */ #if APR_USE_SHMEM_SHMGET - apr_status_t rv; - - /* Indicate that the segment is to be destroyed as soon - * as all processes have detached. This also disallows any - * new attachments to the segment. */ - if (shmctl(m->shmid, IPC_RMID, NULL) == -1) { - return errno; - } if (shmdt(m->base) == -1) { return errno; } - rv = apr_file_remove(m->filename, m->pool); - if (rv != APR_SUCCESS) { - return rv; - } return APR_SUCCESS; #endif } @@ -470,6 +515,8 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, /* metadata isn't usable */ new_m->usable = new_m->base + sizeof(apr_size_t); + apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_attach, + apr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; @@ -519,6 +566,8 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, new_m->usable = new_m->base; new_m->realsize = new_m->reqsize; + apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_attach, + apr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; @@ -530,26 +579,9 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) { - if (m->filename == NULL) { - /* It doesn't make sense to detach from an anonymous memory segment. */ - return APR_EINVAL; - } - else { -#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM - if (munmap(m->base, m->realsize) == -1) { - return errno; - } - return APR_SUCCESS; -#endif /* APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM */ -#if APR_USE_SHMEM_SHMGET - if (shmdt(m->base) == -1) { - return errno; - } - return APR_SUCCESS; -#endif - } - - return APR_ENOTIMPL; + apr_status_t rv = shm_cleanup_attach(m); + apr_pool_cleanup_kill(m->pool, m, shm_cleanup_attach); + return rv; } APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) From 6ec05f66461a5a4eb41075742a9f74afde465d5c Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Tue, 29 Jan 2002 02:03:55 +0000 Subject: [PATCH 2845/7878] rainy. dark. bleh... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62849 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ STATUS | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index af90f7d7574..ae7d90c7413 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) added APR_PROGRAM_ENV and APR_PROGRAM_PATH options for starting + processes via apr_proc_create() [Greg Stein] + *) Changed the apr_file_dup2() function prototype. It can only take and reuse an apr_file_t*, and will no longer create one if *new_file == NULL (use apr_file_dup() for that). [Aaron Bannert] diff --git a/STATUS b/STATUS index ab3958da3c3..26380f6d8c9 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/01/23 06:10:30 $] +Last modified at [$Date: 2002/01/29 02:03:55 $] Release: @@ -259,6 +259,9 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: misc/unix/errorcodes.c to get error reporting working. Committed as the solution is elusive at present. + * implement APR_PROGRAM_ENV and APR_PROGRAM_PATH on BeOS, OS/2, + Netware, and Win32. + Documentation that needs writing: * API documentation From c4d95b198388f47c325ce38ae85b904f97d74d37 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 05:49:21 +0000 Subject: [PATCH 2846/7878] In respect to Jeff's earlier comments, these fns will never be publicly exported. However, with some patches I'm working up, they will be bound inside the core executable, so clashes could become possible [inevitable] since they aren't (and should not become) static functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62850 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 6 +++--- i18n/unix/utf8_ucs2.c | 12 ++++++------ include/arch/unix/i18n.h | 8 ++++---- test/testucs.c | 6 +++--- threadproc/win32/proc.c | 11 ++++++----- 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index af821c17cd8..4cd802813cb 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -114,7 +114,7 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, } } - if (rv = conv_utf8_to_ucs2(srcstr, &srcremains, t, &retlen)) { + if (rv = apr_conv_utf8_to_ucs2(srcstr, &srcremains, t, &retlen)) { return (rv == APR_INCOMPLETE) ? APR_EINVAL : rv; } if (srcremains) { @@ -155,7 +155,7 @@ apr_status_t unicode_to_utf8_path(char* retstr, apr_size_t retlen, } } - if (rv = conv_ucs2_to_utf8(srcstr, &srcremains, t, &retlen)) { + if (rv = apr_conv_ucs2_to_utf8(srcstr, &srcremains, t, &retlen)) { return rv; } if (srcremains) { @@ -197,7 +197,7 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) wfile = apr_palloc(pool, (r + n) * sizeof(apr_wchar_t)); wcscpy(wfile, wpre); d = n; - if (rv = conv_utf8_to_ucs2(file, &n, wfile + r, &d)) { + if (rv = apr_conv_utf8_to_ucs2(file, &n, wfile + r, &d)) { return NULL; } for (ch = wfile + r; *ch; ++ch) { diff --git a/i18n/unix/utf8_ucs2.c b/i18n/unix/utf8_ucs2.c index 15cb411a5ef..c58acc75a29 100644 --- a/i18n/unix/utf8_ucs2.c +++ b/i18n/unix/utf8_ucs2.c @@ -93,13 +93,13 @@ * W1 = 110110yyyyyyyyyy * W2 = 110111xxxxxxxxxx * - * conv_utf8_to_ucs2 out bytes: sizeof(in) * 1 <= Req <= sizeof(in) * 2 + * apr_conv_utf8_to_ucs2 out bytes:sizeof(in) * 1 <= Req <= sizeof(in) * 2 * - * conv_ucs2_to_utf8 out words: sizeof(in) / 2 <= Req <= sizeof(in) * 3 / 2 + * apr_conv_ucs2_to_utf8 out words:sizeof(in) / 2 <= Req <= sizeof(in) * 3 / 2 */ -apr_status_t conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, - apr_wchar_t *out, apr_size_t *outwords) +apr_status_t apr_conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, + apr_wchar_t *out, apr_size_t *outwords) { apr_int64_t newch, mask; apr_size_t expect, eating; @@ -207,8 +207,8 @@ apr_status_t conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, return APR_SUCCESS; } -apr_status_t conv_ucs2_to_utf8(const apr_wchar_t *in, apr_size_t *inwords, - char *out, apr_size_t *outbytes) +apr_status_t apr_conv_ucs2_to_utf8(const apr_wchar_t *in, apr_size_t *inwords, + char *out, apr_size_t *outbytes) { apr_int64_t newch, require; apr_size_t need; diff --git a/include/arch/unix/i18n.h b/include/arch/unix/i18n.h index 728ff23b1ff..0952dd4c6f2 100644 --- a/include/arch/unix/i18n.h +++ b/include/arch/unix/i18n.h @@ -71,8 +71,8 @@ typedef apr_uint16_t apr_wchar_t; * when the character code is invalid (in or out of context) and the later * when more characters were expected, but insufficient characters remain. */ -apr_status_t conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, - apr_wchar_t *out, apr_size_t *outwords); +apr_status_t apr_conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, + apr_wchar_t *out, apr_size_t *outwords); /** * An APR internal function for fast ucs-2 wide Unicode format conversion to @@ -83,7 +83,7 @@ apr_status_t conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, * when the character code is invalid (in or out of context) and the later * when more words were expected, but insufficient words remain. */ -apr_status_t conv_ucs2_to_utf8(const apr_wchar_t *in, apr_size_t *inwords, - char *out, apr_size_t *outbytes); +apr_status_t apr_conv_ucs2_to_utf8(const apr_wchar_t *in, apr_size_t *inwords, + char *out, apr_size_t *outbytes); #endif /* def I18N_H */ diff --git a/test/testucs.c b/test/testucs.c index 5051c821df5..070d456d9cf 100644 --- a/test/testucs.c +++ b/test/testucs.c @@ -46,7 +46,7 @@ void test_nrange(struct testval *p) do { apr_size_t nl = s.nl, wl = sizeof(s.w) / 2; - rc = conv_utf8_to_ucs2(s.n, &nl, s.w, &wl); + rc = apr_conv_utf8_to_ucs2(s.n, &nl, s.w, &wl); s.wl = (sizeof(s.w) / 2) - wl; if (!nl && rc == APR_SUCCESS) { if (!success) { @@ -98,7 +98,7 @@ void test_wrange(struct testval *p) do { apr_size_t nl = sizeof(s.n), wl = s.wl; - rc = conv_ucs2_to_utf8(s.w, &wl, s.n, &nl); + rc = apr_conv_ucs2_to_utf8(s.w, &wl, s.n, &nl); s.nl = sizeof(s.n) - nl; if (!wl && rc == APR_SUCCESS) { if (!success) { @@ -130,7 +130,7 @@ void test_wrange(struct testval *p) do { int wl = s.wl, nl = sizeof(s.n); - rc = conv_ucs2_to_utf8(s.w, &wl, s.n, &nl); + rc = apr_conv_ucs2_to_utf8(s.w, &wl, s.n, &nl); s.nl = sizeof(s.n) - s.nl; if (rc == APR_INCOMPLETE) { test_wrange(&s); diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 400d7ab2301..18f02c84f23 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -398,8 +398,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, pNext = (apr_wchar_t*)pEnvBlock; while (env[i]) { apr_size_t in = strlen(env[i]) + 1; - if ((rv = conv_utf8_to_ucs2(env[i], &in, - pNext, &iEnvBlockLen)) + if ((rv = apr_conv_utf8_to_ucs2(env[i], &in, + pNext, &iEnvBlockLen)) != APR_SUCCESS) { return rv; } @@ -443,9 +443,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_size_t ncwd = 0, nwcwd = 0; apr_wchar_t *wcwd = NULL; - if (((rv = conv_utf8_to_ucs2(progname, &nprg, wprg, &nwprg)) + if (((rv = apr_conv_utf8_to_ucs2(progname, &nprg, wprg, &nwprg)) != APR_SUCCESS) - || ((rv = conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd)) + || ((rv = apr_conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd)) != APR_SUCCESS)) { return rv; } @@ -454,7 +454,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, { ncwd = nwcwd = strlen(attr->currdir) + 1; wcwd = apr_palloc(cont, ncwd * sizeof(wcwd[0])); - if ((rv = conv_utf8_to_ucs2(attr->currdir, &ncwd, wcwd, &nwcwd)) + if ((rv = apr_conv_utf8_to_ucs2(attr->currdir, &ncwd, + wcwd, &nwcwd)) != APR_SUCCESS) { return rv; } From 6947558ed254725145e35a5654c0fb3d07cceacd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 06:27:19 +0000 Subject: [PATCH 2847/7878] Start from the outside in. This little applet, combined with the /i18n/unix/ucs2_utf8.c both built APR_EXPORT_STATIC and linked to any app with the /entry:wmainCRTStartup flag will produce a Win32 binary with utf-8 symbols, consistent with our API. However, it will load only on WinNT, making it 'impractical' for a general Apache distro. It is the perfect solution, however, for Mladen's code. For Win9x+WinNT compatable binaries, we need to implement this inside-out as well. The next chunk of code will build an accessor that will change the args based on GetCommandLineW or env based on GetEnvironmentStringsW. Both of these models will soon grow the intellegence to figure out that they are playing the binary-as-a-service game. This is the other reason this is so critical, as a Win32 service, your args are also provided by the Service Control Manager (SCM). So when we implement the daemonize function, we will know we are already a daemon. Finally, the last piece of intellegence to add to these two models are Win32 'signals' with the apr signal API. The service control manager, console mode and as-a-GUI-window modes all offer the signals that APR is trying to provide. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62851 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/apr_app.c | 136 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 misc/win32/apr_app.c diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c new file mode 100644 index 00000000000..99da38fc6f8 --- /dev/null +++ b/misc/win32/apr_app.c @@ -0,0 +1,136 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_private.h" +#include "apr_general.h" +#include "wchar.h" +#include "fileio.h" +#include "assert.h" + +extern int main(int argc, char **argv, char **env); + +static int wastrtoastr(char ***retarr, int args, wchar_t **arr) +{ + size_t elesize = 0; + char **newarr; + char *elements; + char *ele; + int arg; + + if (args < 0) { + for (args = 0; arr[args]; ++args) + ; + } + + newarr = malloc(arg * sizeof(char *)); + + for (arg = 0; arg < args; ++arg) { + newarr[arg] = (void*)(wcslen(arr[arg]) + 1); + elesize += (size_t)newarr[arg]; + } + + /* This is a safe max allocation, we will realloc after + * processing and return the excess to the free store. + * 3 ucs bytes hold any single wchar_t value (16 bits) + * 4 ucs bytes will hold a wchar_t pair value (20 bits) + */ + elesize = elesize * 3 + 1; + ele = elements = malloc(elesize * sizeof(char)); + + for (arg = 0; arg < args; ++arg) { + size_t len = (size_t)newarr[arg]; + size_t newlen = elesize; + + newarr[arg] = ele; + (void)apr_conv_ucs2_to_utf8(arr[arg], &len, + newarr[arg], &elesize); + + newlen -= elesize; + ele += newlen; + assert(elesize); + } + + newarr[arg] = NULL; + *ele = '\0'; + + /* Return to the free store, we hope, if the heap + * realloc is at all optimized. + */ + ele = realloc(elements, ele - elements); + + if (ele != elements) { + size_t diff = ele - elements; + DebugBreak(); + for (arg = 0; arg < args; ++arg) { + newarr[arg] += diff; + } + } + + *retarr = newarr; + return args; +} + +int wmain(int argc, wchar_t **wargv, wchar_t **wenv) +{ + char **argv; + char **env; + int dupenv; + + (void)wastrtoastr(&argv, wargv, argc); + dupenv = wastrtoastr(&env, wenv, -1); + _environ = malloc((dupenv + 1) * sizeof (char *)); + memcpy(_environ, env, (dupenv + 1) * sizeof (char *)); + + return main(argc, argv, env); +} From e6f4b695094d944cb0ac0c2bb6726a77b7fa21c6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 06:43:22 +0000 Subject: [PATCH 2848/7878] Not ready for it's own prime time slot in any build - note the purpose and some hints already for folks wondering where this module is going. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62852 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/apr_app.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index 99da38fc6f8..f42eab717de 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -52,6 +52,19 @@ * . */ +/* Usage Notes: + * + * this module, and the i18n/unix/ucs2_utf8.c modules must be + * compiled APR_EXPORT_STATIC and linked to an application with + * the /entry:wmainCRTStartup flag. This module becomes the true + * wmain entry point, and passes utf-8 reformatted argv and env + * arrays to the application's main function. + * + * This module is only compatible with Unicode-only executables. + * Mixed (Win9x backwards compatible) binaries should refer instead + * to the apr_startup.c module. + */ + #include "apr_private.h" #include "apr_general.h" #include "wchar.h" @@ -104,14 +117,12 @@ static int wastrtoastr(char ***retarr, int args, wchar_t **arr) newarr[arg] = NULL; *ele = '\0'; - /* Return to the free store, we hope, if the heap - * realloc is at all optimized. + /* Return to the free store if the heap realloc is the least bit optimized */ ele = realloc(elements, ele - elements); if (ele != elements) { size_t diff = ele - elements; - DebugBreak(); for (arg = 0; arg < args; ++arg) { newarr[arg] += diff; } @@ -128,7 +139,10 @@ int wmain(int argc, wchar_t **wargv, wchar_t **wenv) int dupenv; (void)wastrtoastr(&argv, wargv, argc); + + _wenviron = wenv; dupenv = wastrtoastr(&env, wenv, -1); + _environ = malloc((dupenv + 1) * sizeof (char *)); memcpy(_environ, env, (dupenv + 1) * sizeof (char *)); From 8024320bbaf846a35cc92ce255dda1a82401bddd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 06:50:50 +0000 Subject: [PATCH 2849/7878] Improve matters on Win32 with time string formats. Submitted by: John K. Sterling CVS: ----------------------------------------------------------------------CVS: PR:CVS: If this change addresses a PR in the problem report trackingCVS: database, then enter the PR number(s) here.CVS: Obtained from:CVS: If this change has been taken from another system, such as NCSA,CVS: then name the system in this line, otherwise delete it.CVS: Submitted by:CVS: If this code has been contributed to Apache by someone else; i.e.,CVS: they sent us a patch or a new module, then include their name/emailCVS: address here. If this is your work then delete this line.CVS: Reviewed by:CVS: If we are doing pre-commit code reviews and someone else hasCVS: reviewed your changes, include their name(s) here.CVS: If you have not had it reviewed then delete this line.CVS: ---------------------------------------------------------------------- git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62853 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/timestr.c | 66 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 7c70dec1ce9..b30440e4b99 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -54,6 +54,7 @@ #include "win32/atime.h" #include "apr_portable.h" +#include "apr_strings.h" APR_DECLARE_DATA const char apr_month_snames[12][4] = { @@ -154,6 +155,69 @@ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t) return APR_SUCCESS; } +int win32_strftime_extra(char *s, size_t max, const char *format, + const struct tm *tm) { + /* If the new format string is bigger than max, the result string won't fit + * anyway. If format strings are added, made sure the padding below is + * enough */ + char *new_format = (char *) malloc(max + 11); + size_t i, j, format_length = strlen(format); + int return_value; + int length_written; + + for (i = 0, j = 0; (i < format_length && j < max);) { + if (format[i] != '%') { + new_format[j++] = format[i++]; + continue; + } + switch (format[i+1]) { + case 'C': + length_written = apr_snprintf(new_format + j, max - j, "%2d", + (tm->tm_year + 1970)/100); + j = (length_written == -1) ? max : (j + length_written); + i += 2; + break; + case 'D': + /* Is this locale dependent? Shouldn't be... + Also note the year 2000 exposure here */ + memcpy(new_format + j, "%m/%d/%y", 8); + i += 2; + j += 8; + break; + case 'r': + memcpy(new_format + j, "%I:%M:%S %p", 11); + i += 2; + j += 11; + break; + case 'T': + memcpy(new_format + j, "%H:%M:%S", 8); + i += 2; + j += 8; + break; + case 'e': + length_written = apr_snprintf(new_format + j, max - j, "%2d", + tm->tm_mday); + j = (length_written == -1) ? max : (j + length_written); + i += 2; + break; + default: + /* We know we can advance two characters forward here. Also + * makes sure that %% is preserved. */ + new_format[j++] = format[i++]; + new_format[j++] = format[i++]; + } + } + if (j >= max) { + *s = '\0'; /* Defensive programming, okay since output is undefined*/ + return_value = 0; + } else { + new_format[j] = '\0'; + return_value = strftime(s, max, new_format, tm); + } + free(new_format); + return return_value; + } + APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, apr_exploded_time_t *xt) @@ -169,6 +233,6 @@ APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, tm.tm_wday = xt->tm_wday; tm.tm_yday = xt->tm_yday; tm.tm_isdst = xt->tm_isdst; - (*retsize) = strftime(s, max, format, &tm); + (*retsize) = win32_strftime_extra(s, max, format, &tm); return APR_SUCCESS; } From 0b684b4ea1734a838e0b4f2ec60cf4b8f3bf8e56 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 06:59:52 +0000 Subject: [PATCH 2850/7878] Adding this project as a dependency of a WinNT-only project, and adding the LINK option /entry:wmainCRTStartup will create you an APR-ready app. The sad part is, it works only on NT. See the original checkin message of the misc/win32/apr_app.c code for gory details. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62854 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_app.dsp | 93 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 build/apr_app.dsp diff --git a/build/apr_app.dsp b/build/apr_app.dsp new file mode 100644 index 00000000000..2dde3a73764 --- /dev/null +++ b/build/apr_app.dsp @@ -0,0 +1,93 @@ +# Microsoft Developer Studio Project File - Name="apr_app" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=apr_app - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr_app.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr_app.mak" CFG="apr_app - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr_app - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "apr_app - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "apr_app - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "LibR" +# PROP BASE Intermediate_Dir "LibR" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "LibR" +# PROP Intermediate_Dir "LibR" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr_app" /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "apr_app - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "LibD" +# PROP BASE Intermediate_Dir "LibD" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "LibD" +# PROP Intermediate_Dir "LibD" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "APR_EXPORT_STATIC" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr_app" /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "apr_app - Win32 Release" +# Name "apr_app - Win32 Debug" +# Begin Source File + +SOURCE=..\misc\win32\apr_app.c +# End Source File +# Begin Source File + +SOURCE=..\i18n\unix\utf8_ucs2.c +# End Source File +# End Target +# End Project From a88b8d5b6cafffc2bed75fffcda6fb41c2b17afb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 07:11:25 +0000 Subject: [PATCH 2851/7878] Continued WinCE porting efforts Submitted by: Mladen Turk CVS: ----------------------------------------------------------------------CVS: PR:CVS: If this change addresses a PR in the problem report trackingCVS: database, then enter the PR number(s) here.CVS: Obtained from:CVS: If this change has been taken from another system, such as NCSA,CVS: then name the system in this line, otherwise delete it.CVS: Submitted by:CVS: If this code has been contributed to Apache by someone else; i.e.,CVS: they sent us a patch or a new module, then include their name/emailCVS: address here. If this is your work then delete this line.CVS: Reviewed by:CVS: If we are doing pre-commit code reviews and someone else hasCVS: reviewed your changes, include their name(s) here.CVS: If you have not had it reviewed then delete this line.CVS: ---------------------------------------------------------------------- git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62855 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 69 ++++++++++++++++++++++++++++++-- include/arch/win32/apr_private.h | 8 ++++ 2 files changed, 73 insertions(+), 4 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index ab67501bb40..3ed9ef77e9a 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -87,11 +87,12 @@ #pragma warning(disable: 4100 4127 4201 4514; once: 4057 4075 4244) #define APR_INLINE __inline -#define APR_HAS_INLINE 1 +#define APR_HAS_INLINE 1 #define __attribute__(__x) #define NO_USE_SIGACTION +#ifndef _WIN32_WCE #define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_CONIO_H 1 #define APR_HAVE_CRYPT_H 0 @@ -121,6 +122,43 @@ #define APR_HAVE_SYS_UIO_H 0 #define APR_HAVE_SYS_WAIT_H 0 #define APR_HAVE_UNISTD_H 0 +#define APR_HAVE_STDDEF_H 1 +#define APR_HAVE_PROCESS_H 1 +#define APR_HAVE_TIME_H 1 +#else +#define APR_HAVE_ARPA_INET_H 0 +#define APR_HAVE_CONIO_H 1 +#define APR_HAVE_CRYPT_H 0 +#define APR_HAVE_CTYPE_H 0 +#define APR_HAVE_DIRENT_H 0 +#define APR_HAVE_ERRNO_H 0 +#define APR_HAVE_FCNTL_H 0 +#define APR_HAVE_IO_H 0 +#define APR_HAVE_LIMITS_H 0 +#define APR_HAVE_NETDB_H 0 +#define APR_HAVE_NETINET_IN_H 0 +#define APR_HAVE_NETINET_TCP_H 0 +#define APR_HAVE_PTHREAD_H 0 +#define APR_HAVE_SIGNAL_H 0 +#define APR_HAVE_STDARG_H 0 +#define APR_HAVE_STDINT_H 0 +#define APR_HAVE_STDIO_H 1 +#define APR_HAVE_STDLIB_H 1 +#define APR_HAVE_STRING_H 1 +#define APR_HAVE_STRINGS_H 0 +#define APR_HAVE_SYS_SENDFILE_H 0 +#define APR_HAVE_SYS_SIGNAL_H 0 +#define APR_HAVE_SYS_SOCKET_H 0 +#define APR_HAVE_SYS_SYSLIMITS_H 0 +#define APR_HAVE_SYS_TIME_H 0 +#define APR_HAVE_SYS_TYPES_H 0 +#define APR_HAVE_SYS_UIO_H 0 +#define APR_HAVE_SYS_WAIT_H 0 +#define APR_HAVE_UNISTD_H 0 +#define APR_HAVE_STDDEF_H 0 +#define APR_HAVE_PROCESS_H 0 +#define APR_HAVE_TIME_H 0 +#endif #define APR_USE_FLOCK_SERIALIZE 0 #define APR_USE_SYSVSEM_SERIALIZE 0 @@ -145,10 +183,10 @@ #define APR_FILE_BASED_SHM 0 #define APR_MEM_BASED_SHM 0 -#define APR_HAVE_CORKABLE_TCP 0 +#define APR_HAVE_CORKABLE_TCP 0 #define APR_HAVE_GETRLIMIT 0 #define APR_HAVE_IN_ADDR 1 -#define APR_HAVE_INET_ADDR 1 +#define APR_HAVE_INET_ADDR 1 #define APR_HAVE_INET_NETWORK 0 #define APR_HAVE_IPV6 0 #define APR_HAVE_MEMMOVE 1 @@ -199,8 +237,12 @@ * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now */ #define SW_HIDE 0 +#ifndef _WIN32_WCE #include #include +#else +#include +#endif #endif /* !_WINDOWS_ */ #if APR_HAVE_STDLIB_H @@ -212,10 +254,15 @@ #if APR_HAVE_SYS_TYPES_H #include #endif - +#if APR_HAVE_STDDEF_H #include +#endif +#if APR_HAVE_TIME_H #include +#endif +#if APR_HAVE_PROCESS_H #include +#endif /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY 1 @@ -229,9 +276,15 @@ #define APR_HAS_DSO 1 #define APR_HAS_SO_ACCEPTFILTER 0 #define APR_HAS_UNICODE_FS 1 +#ifndef _WIN32_WCE #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 1 #define APR_HAS_XTHREAD_FILES 1 +#else +#define APR_HAS_USER 0 +#define APR_HAS_LARGE_FILES 0 +#define APR_HAS_XTHREAD_FILES 0 +#endif /* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE * on all platforms. @@ -256,8 +309,16 @@ typedef __int64 apr_int64_t; typedef unsigned __int64 apr_uint64_t; typedef size_t apr_size_t; +#if APR_HAVE_STDDEF_H typedef ptrdiff_t apr_ssize_t; +#else +typedef int apr_ssize_t; +#endif +#if APR_HAS_LARGE_FILES typedef __int64 apr_off_t; +#else +typedef int apr_off_t; +#endif typedef int apr_socklen_t; typedef int pid_t; typedef int uid_t; diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 19bf128fc1f..a16ce214cd9 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -81,6 +81,7 @@ * Avoid dragging in wtypes.h unless it's absolutely necessary [generally * not with APR itself, until some GUI-related security is introduced.] */ +#ifndef _WIN32_WCE #ifdef __wtypes_h__ #include #else @@ -88,11 +89,18 @@ #include #undef __wtypes_h__ #endif +#endif +#if APR_HAVE_SYS_TYPES_H #include +#endif +#if APR_HAVE_STDDEF_H #include +#endif #include +#if APR_HAVE_TIME_H #include +#endif /* Use this section to define all of the HAVE_FOO_H * that are required to build properly. From 39f2c5e7b2182fb7c20f799b82e2275e6ccfcf63 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 07:24:10 +0000 Subject: [PATCH 2852/7878] More goodness for both WinNT and WinCE builds ... none of this matters if you aren't building for 9x/ME binary compatibility. [Mladen Turk, William Rowe] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62856 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/misc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 5f5f6762e8f..cdf163c1eeb 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -206,6 +206,8 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); * In the case of non-text functions, simply #define the original name */ +#if !defined(_WIN32_WCE) && !defined(WINNT) + #ifdef GetFileAttributesExA #undef GetFileAttributesExA #endif @@ -291,6 +293,8 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetSecurityInfo, 0, ( ppDacl, ppSacl, ppSecurityDescriptor)); #define GetSecurityInfo apr_winapi_GetSecurityInfo +#endif /* !defined(_WIN32_WCE) && !defined(WINNT) */ + #endif /* WIN32 */ #endif /* ! MISC_H */ From 69ae360c6a66b3141ba907a410b9cd8b8df9cd1d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 07:30:50 +0000 Subject: [PATCH 2853/7878] Submitted by Mladen Turk , one last bit of WinCE goodness for this evening. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62857 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/atime.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/arch/win32/atime.h b/include/arch/win32/atime.h index b3b288a9163..79264ee7be3 100644 --- a/include/arch/win32/atime.h +++ b/include/arch/win32/atime.h @@ -57,7 +57,9 @@ #include "apr_private.h" #include "apr_time.h" +#if APR_HAVE_TIME_H #include +#endif struct atime_t { apr_pool_t *cntxt; From b19a080adef9966b452be1792b5987e6a2f8a0d0 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Tue, 29 Jan 2002 08:37:45 +0000 Subject: [PATCH 2854/7878] De facto implementations of getnameinfo() return the error code in their return value. See isc.org's bind9, or FreeBSD's lib/libc/net/getnameinfo.c Implementations that set h_errno a simply broken. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62858 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 24bd622c2b9..0833c6f5150 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -524,6 +524,16 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, flags != 0 ? flags : NI_NAMEREQD); if (rc != 0) { *hostname = NULL; +#if 1 + /* De facto implementations return the error code in their + * return value. See isc.org's bind9, or + * FreeBSD's lib/libc/net/getnameinfo.c + * Implementations that set h_errno a simply broken. + * @@ if you encounter one, replace the #if 1 by an + * @@ appropriate #ifdef and delete these lines. + */ + return rc + APR_OS_START_SYSERR; +#else /* XXX I have no idea if this is okay. I don't see any info * about getnameinfo() returning anything other than good or bad. */ @@ -533,6 +543,7 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, else { return APR_NOTFOUND; } +#endif } *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, tmphostname); From c2d1d2442320de2adf025867cd3a8a130fd6cecf Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 14:28:42 +0000 Subject: [PATCH 2855/7878] Had rethought the args for clarity but hadn't brought them into sync git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62859 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/apr_app.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index f42eab717de..fa4065b9839 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -73,7 +73,7 @@ extern int main(int argc, char **argv, char **env); -static int wastrtoastr(char ***retarr, int args, wchar_t **arr) +static int wastrtoastr(char ***retarr, wchar_t **arr, int args) { size_t elesize = 0; char **newarr; From d62d04fb571c1b1b1f3d0e1280d17a7e4eb5a725 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 14:43:52 +0000 Subject: [PATCH 2856/7878] Allocate the correct number of elements git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62860 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/apr_app.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index fa4065b9839..7ed3c97da89 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -86,7 +86,7 @@ static int wastrtoastr(char ***retarr, wchar_t **arr, int args) ; } - newarr = malloc(arg * sizeof(char *)); + newarr = malloc(args * sizeof(char *)); for (arg = 0; arg < args; ++arg) { newarr[arg] = (void*)(wcslen(arr[arg]) + 1); From 46cd7e379289f8fa3e0bc1f7968b0fa56a2dc660 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 15:18:48 +0000 Subject: [PATCH 2857/7878] Rejigger the API so we pass _DEBUG mode in Win32. MSVCRT believes it is the master of it's own _environ, so let it continue to believe so. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62861 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/apr_app.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index 7ed3c97da89..d1365f5862a 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -63,6 +63,12 @@ * This module is only compatible with Unicode-only executables. * Mixed (Win9x backwards compatible) binaries should refer instead * to the apr_startup.c module. + * + * _dbg_malloc/realloc is used in place of the usual API, in order + * to convince the MSVCRT that they created these entities. If we + * do not create them as _CRT_BLOCK entities, the crt will fault + * on an assert. We are not worrying about the crt's locks here, + * since we are single threaded [so far]. */ #include "apr_private.h" @@ -70,6 +76,7 @@ #include "wchar.h" #include "fileio.h" #include "assert.h" +#include extern int main(int argc, char **argv, char **env); @@ -86,7 +93,8 @@ static int wastrtoastr(char ***retarr, wchar_t **arr, int args) ; } - newarr = malloc(args * sizeof(char *)); + newarr = _malloc_dbg(args * sizeof(char *), + _CRT_BLOCK, __FILE__, __LINE__); for (arg = 0; arg < args; ++arg) { newarr[arg] = (void*)(wcslen(arr[arg]) + 1); @@ -99,7 +107,8 @@ static int wastrtoastr(char ***retarr, wchar_t **arr, int args) * 4 ucs bytes will hold a wchar_t pair value (20 bits) */ elesize = elesize * 3 + 1; - ele = elements = malloc(elesize * sizeof(char)); + ele = elements = _malloc_dbg(elesize * sizeof(char), + _CRT_BLOCK, __FILE__, __LINE__); for (arg = 0; arg < args; ++arg) { size_t len = (size_t)newarr[arg]; @@ -119,7 +128,8 @@ static int wastrtoastr(char ***retarr, wchar_t **arr, int args) /* Return to the free store if the heap realloc is the least bit optimized */ - ele = realloc(elements, ele - elements); + ele = _realloc_dbg(elements, ele - elements, + _CRT_BLOCK, __FILE__, __LINE__); if (ele != elements) { size_t diff = ele - elements; @@ -140,11 +150,24 @@ int wmain(int argc, wchar_t **wargv, wchar_t **wenv) (void)wastrtoastr(&argv, wargv, argc); - _wenviron = wenv; dupenv = wastrtoastr(&env, wenv, -1); - _environ = malloc((dupenv + 1) * sizeof (char *)); + _environ = _malloc_dbg((dupenv + 1) * sizeof (char *), + _CRT_BLOCK, __FILE__, __LINE__ ); memcpy(_environ, env, (dupenv + 1) * sizeof (char *)); + /* MSVCRT will attempt to maintain the wide environment calls + * on _putenv(), which is bogus if we've passed a non-ascii + * string to _putenv(), since they use MultiByteToWideChar + * and breaking the implicit utf-8 assumption we've built. + * + * Reset _wenviron for good measure. + */ + if (_wenviron) { + wenv = _wenviron; + _wenviron = NULL; + free(wenv); + } + return main(argc, argv, env); } From b51ca12b340d45b9d861cc6b914bddda2e5f678e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 16:10:14 +0000 Subject: [PATCH 2858/7878] 60 degrees last Saturday, and they suggest inches of snow by tommorow. Mother Nature's release schedule changes almost as often as ours :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62862 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 26380f6d8c9..1993c5259e9 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/01/29 02:03:55 $] +Last modified at [$Date: 2002/01/29 16:10:14 $] Release: @@ -15,6 +15,10 @@ Release: RELEASE SHOWSTOPPERS: + * Must namespace protect all include/apr_foo.h headers. Jon Travis + has especially observed these including apr and Apache-1.3. + Message-ID: <20020128100116.A4288@covalent.net> + * complete the efforts started by DougM for cleaner fn naming conventions: see proposed name changes in renames_pending and offer up any additions/vetos/clarifications. @@ -46,6 +50,15 @@ RELEASE SHOWSTOPPERS: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * Need to contemplate apr_strftime... platforms vary. OtherBill + suggested this solution (but has no time to implement): + Document our list of 'supported' escapes. + Run some autoconf/m4 magic against the complete list we support. + Move the strftime re-implementation from time/win32 to time/unix. + Add some APR_HAVE_STRFTIME magic to use the system fn, or fail + over to time/unix/strftime.c. + Message-ID: <025e01c1a891$bf41f660$94c0b0d0@v505> + * Using reentrant libraries with non-threaded APR - Anecdotal evidence exists that suggests it is bad to mix reentrant and non-reentrant libraries and therefore From 717d061942341fe725e3405b7d8ac488e9b14b1b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 18:25:33 +0000 Subject: [PATCH 2859/7878] Change 'External' since some suspect this could cause Win32 to consider those header files Immortal and never rebuild based on changes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62863 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++-- libapr.dsp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apr.dsp b/apr.dsp index 26fc0b232b3..4ee18caaa6e 100644 --- a/apr.dsp +++ b/apr.dsp @@ -387,7 +387,7 @@ SOURCE=.\user\win32\userinfo.c # End Source File # End Group # End Group -# Begin Group "Internal Header Files" +# Begin Group "Private Header Files" # PROP Default_Filter "" # Begin Source File @@ -439,7 +439,7 @@ SOURCE=.\include\arch\win32\thread_rwlock.h SOURCE=.\include\arch\win32\threadproc.h # End Source File # End Group -# Begin Group "External Header Files" +# Begin Group "Public Header Files" # PROP Default_Filter "" # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index 0b07380760f..f00fcd63b1e 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -393,7 +393,7 @@ SOURCE=.\user\win32\userinfo.c # End Source File # End Group # End Group -# Begin Group "Internal Header Files" +# Begin Group "Private Header Files" # PROP Default_Filter "" # Begin Source File @@ -445,7 +445,7 @@ SOURCE=.\include\arch\win32\thread_rwlock.h SOURCE=.\include\arch\win32\threadproc.h # End Source File # End Group -# Begin Group "External Header Files" +# Begin Group "Public Header Files" # PROP Default_Filter "" # Begin Source File From 9fb21bac7dd8c5254e2b319e7dfa40e81c05a098 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 18:31:15 +0000 Subject: [PATCH 2860/7878] Alpha order, same order between apr.dsp and libapr.dsp git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62864 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apr.dsp b/apr.dsp index 4ee18caaa6e..305ad5ca43e 100644 --- a/apr.dsp +++ b/apr.dsp @@ -101,10 +101,6 @@ SOURCE=.\file_io\win32\dir.c # End Source File # Begin Source File -SOURCE=.\file_io\unix\mktemp.c -# End Source File -# Begin Source File - SOURCE=.\file_io\unix\fileacc.c # End Source File # Begin Source File @@ -133,6 +129,10 @@ SOURCE=.\file_io\unix\fullrw.c # End Source File # Begin Source File +SOURCE=.\file_io\unix\mktemp.c +# End Source File +# Begin Source File + SOURCE=.\file_io\win32\open.c # End Source File # Begin Source File From ee83cad8e3cef2e5bae48cfcf20ec9a54da21fb8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Jan 2002 18:49:40 +0000 Subject: [PATCH 2861/7878] Hard to follow a dirty tree. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62865 13f79535-47bb-0310-9956-ffa450edef68 --- build/.cvsignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/.cvsignore b/build/.cvsignore index 2531063d20d..397247c1c22 100644 --- a/build/.cvsignore +++ b/build/.cvsignore @@ -3,3 +3,9 @@ libtool.m4 ltconfig ltmain.sh rules.mk +LibD +LibR +*.aps +*.plg +*.dep +*.mak From 9ddea318099b460808eabd6f42f32114f9612f2f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 30 Jan 2002 03:07:40 +0000 Subject: [PATCH 2862/7878] Add APR_APP as a symbol, so we may use apr_app.c in two different contexts (either a starting point, or as a 'fixup' after a binary compatible win9x/nt main() function has been invoked.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62866 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_app.dsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/apr_app.dsp b/build/apr_app.dsp index 2dde3a73764..9c2c62492f2 100644 --- a/build/apr_app.dsp +++ b/build/apr_app.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr_app" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"LibR\apr_app" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "APR_EXPORT_STATIC" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr_app" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "APR_EXPORT_STATIC" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"LibD\apr_app" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe From 201a423a2b35ed8fc0abaaa93672087a325fe138 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 30 Jan 2002 03:12:38 +0000 Subject: [PATCH 2863/7878] A some-platforms-symbol required for apr_app.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62867 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/misc.h | 9 ++++++++- misc/win32/misc.c | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index cdf163c1eeb..a9a00271b36 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -171,7 +171,8 @@ typedef enum { DLL_WINADVAPI = 1, // advapi32 From WinBase.h DLL_WINSOCKAPI = 2, // mswsock From WinSock.h DLL_WINSOCK2API = 3, // ws2_32 From WinSock2.h - DLL_defined = 4 // must define as last idx_ + 1 + DLL_SHSTDAPI = 4, // shell32 From ShellAPI.h + DLL_defined = 5 // must define as last idx_ + 1 } apr_dlltoken_e; FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); @@ -293,6 +294,12 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetSecurityInfo, 0, ( ppDacl, ppSacl, ppSecurityDescriptor)); #define GetSecurityInfo apr_winapi_GetSecurityInfo +APR_DECLARE_LATE_DLL_FUNC(DLL_SHSTDAPI, LPWSTR *, WINAPI, CommandLineToArgvW, 0, ( + LPCWSTR lpCmdLine, + int *pNumArgs), + (lpCmdLine, pNumArgs)); +#define CommandLineToArgvW apr_winapi_CommandLineToArgvW + #endif /* !defined(_WIN32_WCE) && !defined(WINNT) */ #endif /* WIN32 */ diff --git a/misc/win32/misc.c b/misc/win32/misc.c index fdcfd450579..fab7c7df132 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -180,9 +180,9 @@ apr_status_t apr_get_oslevel(apr_pool_t *cont, apr_oslevel_e *level) */ static const char* const lateDllName[DLL_defined] = { - "kernel32", "advapi32", "mswsock", "ws2_32" }; + "kernel32", "advapi32", "mswsock", "ws2_32", "shell32" }; static HMODULE lateDllHandle[DLL_defined] = { - NULL, NULL, NULL, NULL }; + NULL, NULL, NULL, NULL, NULL }; FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) { From b97b15f7b5c5030ffe5cd4b479f5d31ac9fdf63a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 30 Jan 2002 03:15:32 +0000 Subject: [PATCH 2864/7878] The 'second way' - not yet published in a .h file. This would allow a win32 app to fix up the environment and args to our apr-adopted utf-8, allowing absolutely any input, in any local codepage, to be handled by Apache [even though we did _not_ use a wmainCRTStartup entry point.] Not tested - next fix is to prevent people from coding to both methods [or provide a quick fix so it becomes a noop.] Find a place a write a dummy for unix (simply return APR_SUCCESS is sufficient.) Then this module can be extended first for services, then for signals. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62868 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/apr_app.c | 98 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 91 insertions(+), 7 deletions(-) diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index d1365f5862a..bd39990eaaa 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -71,14 +71,13 @@ * since we are single threaded [so far]. */ -#include "apr_private.h" #include "apr_general.h" +#include "ShellAPI.h" +#include "crtdbg.h" #include "wchar.h" #include "fileio.h" #include "assert.h" -#include - -extern int main(int argc, char **argv, char **env); +#include "apr_private.h" static int wastrtoastr(char ***retarr, wchar_t **arr, int args) { @@ -93,7 +92,7 @@ static int wastrtoastr(char ***retarr, wchar_t **arr, int args) ; } - newarr = _malloc_dbg(args * sizeof(char *), + newarr = _malloc_dbg((args + 1) * sizeof(char *), _CRT_BLOCK, __FILE__, __LINE__); for (arg = 0; arg < args; ++arg) { @@ -120,11 +119,11 @@ static int wastrtoastr(char ***retarr, wchar_t **arr, int args) newlen -= elesize; ele += newlen; - assert(elesize); + assert(elesize && (len == 0)); } newarr[arg] = NULL; - *ele = '\0'; + *(ele++) = '\0'; /* Return to the free store if the heap realloc is the least bit optimized */ @@ -142,6 +141,10 @@ static int wastrtoastr(char ***retarr, wchar_t **arr, int args) return args; } +#ifdef APR_APP + +extern int main(int argc, char **argv, char **env); + int wmain(int argc, wchar_t **wargv, wchar_t **wenv) { char **argv; @@ -171,3 +174,84 @@ int wmain(int argc, wchar_t **wargv, wchar_t **wenv) return main(argc, argv, env); } + +#else + +static int warrsztoastr(char ***retarr, wchar_t *arrsz, int args) +{ + apr_wchar_t *wch; + size_t totlen; + size_t newlen; + size_t wsize; + char **newarr; + int arg; + + if (args < 0) { + for (args = 1, wch = arrsz; wch[0] || wch[1]; ++wch) + if (!*wch) + ++args; + } + wsize = 1 + wch - arrsz; + + newarr = _malloc_dbg((args + 1) * sizeof(char *), + _CRT_BLOCK, __FILE__, __LINE__); + + /* This is a safe max allocation, we will realloc after + * processing and return the excess to the free store. + * 3 ucs bytes hold any single wchar_t value (16 bits) + * 4 ucs bytes will hold a wchar_t pair value (20 bits) + */ + newlen = totlen = wsize * 3 + 1; + newarr[0] = _malloc_dbg(newlen * sizeof(char), + _CRT_BLOCK, __FILE__, __LINE__); + + (void)apr_conv_ucs2_to_utf8(arrsz, &wsize, + newarr[0], &newlen); + + assert(newlen && !wsize); + /* Return to the free store if the heap realloc is the least bit optimized + */ + newarr[0] = _realloc_dbg(newarr[0], totlen - newlen, + _CRT_BLOCK, __FILE__, __LINE__); + + for (arg = 1; arg < args; ++arg) { + newarr[arg] = newarr[arg - 1] + 2; + while (*(newarr[arg]++)) { + ; + } + } + + newarr[arg] = NULL; + + *retarr = newarr; + return args; +} + +/* Reprocess the arguments to main() for a completely apr-ized application + */ + +APR_DECLARE(apr_status_t) apr_main(int *argc, char ***argv, char ***env) +{ +#if APR_HAS_UNICODE_FS + IF_WIN_OS_IS_UNICODE + { + apr_wchar_t **wstrs; + apr_wchar_t *sysstr; + int wstrc; + + sysstr = GetCommandLineW(); + if (sysstr) { + wstrs = CommandLineToArgvW(sysstr, &wstrc); + if (wstrs) { + *argc = wastrtoastr(argv, wstrs, wstrc); + GlobalFree(wstrs); + } + } + + sysstr = GetEnvironmentStringsW(); + } +#endif + return APR_SUCCESS; +} + +#endif \ No newline at end of file From aaa9e6a43f96de0095c82342d0054f35bcaaacbe Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 30 Jan 2002 03:16:13 +0000 Subject: [PATCH 2865/7878] Build new goodies. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62869 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++++ libapr.dsp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apr.dsp b/apr.dsp index 305ad5ca43e..be527098f2f 100644 --- a/apr.dsp +++ b/apr.dsp @@ -198,6 +198,10 @@ SOURCE=.\memory\unix\apr_pools.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\misc\win32\apr_app.c +# End Source File +# Begin Source File + SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index f00fcd63b1e..3adf21cd74f 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -204,6 +204,10 @@ SOURCE=.\memory\unix\apr_pools.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\misc\win32\apr_app.c +# End Source File +# Begin Source File + SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File From 262697279aace59bb76da119c9d83c406f05a74e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 30 Jan 2002 05:25:53 +0000 Subject: [PATCH 2866/7878] Final tests still required, but here goes the basic concept. The init will never run more than once [no test is needed in the wmain() stub, only for callers into apr_app_main().] So the NT-only [WinCE, etc] builder can depend upon the apr_app.dsp's apr_app.lib to stub wmain(), or the Win9x+NT builder can simply stub in apr_app_main(). Since authors are likely to do the last step always, they needed this interlock to determine that apr_app_main() activity is already complete. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62870 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/apr_app.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index bd39990eaaa..5531cd1ce46 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -143,6 +143,8 @@ static int wastrtoastr(char ***retarr, wchar_t **arr, int args) #ifdef APR_APP +extern int APR_DECLARE_DATA apr_app_init_complete; + extern int main(int argc, char **argv, char **env); int wmain(int argc, wchar_t **wargv, wchar_t **wenv) @@ -172,11 +174,15 @@ int wmain(int argc, wchar_t **wargv, wchar_t **wenv) free(wenv); } + apr_app_init_complete = 1; + return main(argc, argv, env); } #else +int APR_DECLARE_DATA apr_app_init_complete = 0; + static int warrsztoastr(char ***retarr, wchar_t *arrsz, int args) { apr_wchar_t *wch; @@ -238,6 +244,11 @@ APR_DECLARE(apr_status_t) apr_main(int *argc, char ***argv, char ***env) apr_wchar_t **wstrs; apr_wchar_t *sysstr; int wstrc; + int dupenv; + + if (apr_app_init_complete) { + return APR_SUCCESS; + } sysstr = GetCommandLineW(); if (sysstr) { @@ -249,6 +260,26 @@ APR_DECLARE(apr_status_t) apr_main(int *argc, char ***argv, char ***env) } sysstr = GetEnvironmentStringsW(); + dupenv = warrsztoastr(env, sysstr, -1); + + _environ = _malloc_dbg((dupenv + 1) * sizeof (char *), + _CRT_BLOCK, __FILE__, __LINE__ ); + memcpy(_environ, env, (dupenv + 1) * sizeof (char *)); + + /* MSVCRT will attempt to maintain the wide environment calls + * on _putenv(), which is bogus if we've passed a non-ascii + * string to _putenv(), since they use MultiByteToWideChar + * and breaking the implicit utf-8 assumption we've built. + * + * Reset _wenviron for good measure. + */ + if (_wenviron) { + apr_wchar_t **wenv = _wenviron; + _wenviron = NULL; + free(wenv); + } + + apr_app_init_complete = 1; } #endif return APR_SUCCESS; From 4bec1c833804713e2c2e04af765703251937e8c3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 30 Jan 2002 05:26:43 +0000 Subject: [PATCH 2867/7878] apr_app_main() seems like a decent enough re-entry point, but this is certainly open to debate :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62871 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/apr_app.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index 5531cd1ce46..f7d29a4ef49 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -236,7 +236,7 @@ static int warrsztoastr(char ***retarr, wchar_t *arrsz, int args) /* Reprocess the arguments to main() for a completely apr-ized application */ -APR_DECLARE(apr_status_t) apr_main(int *argc, char ***argv, char ***env) +APR_DECLARE(apr_status_t) apr_app_main(int *argc, char ***argv, char ***env) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE From d57295754cc631c7960d0551795f136a45d55dcc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 30 Jan 2002 06:42:55 +0000 Subject: [PATCH 2868/7878] Introduce apr_app_main() for global consumption. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62872 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 10 ++++++++++ misc/unix/start.c | 18 ++++++++++++++++-- misc/win32/apr_app.c | 16 ++++++++++++---- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index 91f6ed734fb..d3030d0c902 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -185,6 +185,16 @@ APR_DECLARE_NONSTD(void) apr_terminate(void); */ APR_DECLARE(void) apr_terminate2(void); +/** + * Set up an application with normalized argc, argv (and optionally env) in + * order to deal with platform-specific oddities, such as Win32 services, + * code pages and signals. + * @remark An APR program should invoke apr_app_main immediately following + * apr_initialize, so it behaves properly as a service on Win32 with respect + * to its Unicode (utf-8) code page, services and signals. + */ +APR_DECLARE(apr_status_t) apr_app_main(int *argc, char ***argv, char ***env); + /** @} */ /** diff --git a/misc/unix/start.c b/misc/unix/start.c index bb8b05c1dc3..b0d8f99326a 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -63,6 +63,20 @@ #include "internal_time.h" +#ifndef WIN32 +APR_DECLARE(apr_status_t) apr_app_main(int *argc, char ***argv, char ***env) +{ + /* An absolute noop. At present, only Win32 requires this stub, but it's + * required in order to move command arguments passed through the service + * control manager into the process, and it's required to fix the char* + * data passed in from local/wide codepage into utf-8, our internal fmt. + * + * Win32 declares it's implementation in misc/win32/apr_app.c + */ + return APR_SUCCESS; +} +#endif + static int initialized = 0; APR_DECLARE(apr_status_t) apr_initialize(void) @@ -108,7 +122,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) } #endif -#if defined WIN32 || defined(NETWARE) +#if defined(NETWARE) || defined(WIN32) iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); err = WSAStartup((WORD) iVersionRequested, &wsaData); if (err) { @@ -134,7 +148,7 @@ APR_DECLARE_NONSTD(void) apr_terminate(void) } apr_pool_terminate(); -#if defined(NETWARE) +#if defined(NETWARE) || defined(WIN32) WSACleanup(); #endif } diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index f7d29a4ef49..1c691af5970 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -143,6 +143,8 @@ static int wastrtoastr(char ***retarr, wchar_t **arr, int args) #ifdef APR_APP +/* This symbol is _private_, although it must be exported. + */ extern int APR_DECLARE_DATA apr_app_init_complete; extern int main(int argc, char **argv, char **env); @@ -181,6 +183,8 @@ int wmain(int argc, wchar_t **wargv, wchar_t **wenv) #else +/* This symbol is _private_, although it must be exported. + */ int APR_DECLARE_DATA apr_app_init_complete = 0; static int warrsztoastr(char ***retarr, wchar_t *arrsz, int args) @@ -260,11 +264,15 @@ APR_DECLARE(apr_status_t) apr_app_main(int *argc, char ***argv, char ***env) } sysstr = GetEnvironmentStringsW(); - dupenv = warrsztoastr(env, sysstr, -1); + dupenv = warrsztoastr(&_environ, sysstr, -1); - _environ = _malloc_dbg((dupenv + 1) * sizeof (char *), - _CRT_BLOCK, __FILE__, __LINE__ ); - memcpy(_environ, env, (dupenv + 1) * sizeof (char *)); + if (env) { + env = _malloc_dbg((dupenv + 1) * sizeof (char *), + _CRT_BLOCK, __FILE__, __LINE__ ); + memcpy(*env, _environ, (dupenv + 1) * sizeof (char *)); + } + else { + } /* MSVCRT will attempt to maintain the wide environment calls * on _putenv(), which is bogus if we've passed a non-ascii From d09026b61d47ae9d5789b4edfe6815931e7ae2f7 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 30 Jan 2002 13:10:16 +0000 Subject: [PATCH 2869/7878] Get rid of the getpid warning. Cast void * to char * before doing pointer arithmetic. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62873 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index f624c453644..76302b29886 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -56,7 +56,6 @@ #include "apr_private.h" #include "apr_portable.h" /* for get_os_proc */ -#include "apr_thread_proc.h" /* for getpid */ #include "apr_strings.h" #include "apr_general.h" #include "apr_pools.h" @@ -71,6 +70,10 @@ #include /* for malloc, free and abort */ #endif +#if APR_HAVE_UNISTD_H +#include /* for getpid */ +#endif + /* * Debug level @@ -1467,7 +1470,7 @@ static apr_size_t pool_num_bytes(apr_pool_t *pool) while (node) { for (index = 0; index < node->index; index++) { - size += node->endp[index] - node->beginp[index]; + size += (char *)node->endp[index] - (char *)node->beginp[index]; } node = node->next; From 097bf991ba6940eb920a26658a31c593dc1ce925 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 30 Jan 2002 13:30:31 +0000 Subject: [PATCH 2870/7878] Mention the changes with respect to the pools code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62874 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index ae7d90c7413..5bfee3e332a 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,12 @@ Changes with APR b1 *) added APR_PROGRAM_ENV and APR_PROGRAM_PATH options for starting processes via apr_proc_create() [Greg Stein] + *) Deprecated apr_pool_free_blocks_num_bytes() [Sander Striker] + + *) Add --enable-pool-debug to make it easier for people to + enable pool debug mode. Removed the APR_POOL_DEBUG_VERBOSE + define that was previously being used. [Sander Striker] + *) Changed the apr_file_dup2() function prototype. It can only take and reuse an apr_file_t*, and will no longer create one if *new_file == NULL (use apr_file_dup() for that). [Aaron Bannert] From 61d6e1046d45b8c1cd094931c914b59f6c3ed7e0 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Wed, 30 Jan 2002 15:33:14 +0000 Subject: [PATCH 2871/7878] Fixed up some comments -- got rid of FIXMEs that have been fixed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62875 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index c493bdc7c5e..7a2dd9cf308 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -152,9 +152,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, apr_file_t *file; /* file where metadata is stored */ #endif - /* FIXME: associate this thing with a pool and set up a destructor - * to call detach. */ - /* Check if they want anonymous or name-based shared memory */ if (filename == NULL) { #if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_MMAP_ANON @@ -474,8 +471,6 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, new_m->pool = pool; new_m->filename = apr_pstrdup(pool, filename); - /* FIXME: open the file, read the length, mmap the segment, - * close the file, reconstruct the apr_shm_t. */ status = apr_file_open(&file, filename, APR_READ | APR_WRITE, APR_OS_DEFAULT, pool); @@ -512,7 +507,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, return status; } - /* metadata isn't usable */ + /* metadata isn't part of the usable segment */ new_m->usable = new_m->base + sizeof(apr_size_t); apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_attach, From ae582055be3a38fa6a1feb47ab3545a7028f9ff8 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Thu, 31 Jan 2002 13:21:32 +0000 Subject: [PATCH 2872/7878] Be a bit more conservative regarding all those broken implementations out there. Not everyone has FreeBSD or Linux. getnameinfo() should return a rc containing 0 (success) or some EAI_ value. This rc can be used as a mapped APR_ error (+APR_OS_START_EAIERR). Only if the rc == EAI_SYSTEM, errno should be inspected (I see no reason whatsoever to look at h_errno, as (like for apr_sockaddr_info_get()'s call of getaddrinfo()) the error is supposed to be in errno. However, and because h_errno has been zeroed out before the call, I added another test for nonzero h_errno. Everone happy? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62876 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 0833c6f5150..036c42a7de3 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -524,26 +524,24 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, flags != 0 ? flags : NI_NAMEREQD); if (rc != 0) { *hostname = NULL; -#if 1 - /* De facto implementations return the error code in their - * return value. See isc.org's bind9, or - * FreeBSD's lib/libc/net/getnameinfo.c - * Implementations that set h_errno a simply broken. - * @@ if you encounter one, replace the #if 1 by an - * @@ appropriate #ifdef and delete these lines. - */ - return rc + APR_OS_START_SYSERR; -#else - /* XXX I have no idea if this is okay. I don't see any info - * about getnameinfo() returning anything other than good or bad. - */ - if (h_errno) { - return h_errno + APR_OS_START_SYSERR; + + /* something went wrong. Look at the EAI_ error code */ + if (rc != EAI_SYSTEM) { +#if defined(NEGATIVE_EAI) + if (rc < 0) rc = -rc; +#endif + return rc + APR_OS_START_EAIERR; /* return the EAI_ error */ } else { - return APR_NOTFOUND; + /* EAI_SYSTEM System error returned in errno. */ + /* IMHO, Implementations that set h_errno a simply broken. */ + if (h_errno) { /* for broken implementations which set h_errno */ + return h_errno + APR_OS_START_SYSERR; + } + else { /* "normal" case */ + return errno + APR_OS_START_SYSERR; + } } -#endif } *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, tmphostname); From e32437961488de22d59a81b71c750c8df91c0c0c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 31 Jan 2002 17:29:09 +0000 Subject: [PATCH 2873/7878] Not critical - this patch is only required if libapr is built with /D WINNT (which we did not attempt in 2.0.31). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62877 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libapr.dsp b/libapr.dsp index 3adf21cd74f..f9ecad3b2b0 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -52,8 +52,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF !ELSEIF "$(CFG)" == "libapr - Win32 Debug" @@ -78,8 +78,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF !ENDIF From cc1422e75473d9667aa88128293e6dbc83b7ba62 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 31 Jan 2002 18:49:51 +0000 Subject: [PATCH 2874/7878] Added the necessary code to make APRLib into a real library NLM. Also added support for application instance data since library NLMs do not support this by default. This allows us to get global variables separated by application instance. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62878 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/libprews.c | 99 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index efa475fc697..c1181d4706a 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -9,9 +9,24 @@ provide. ------------------------------------------------------------------*/ #include -//#include "stddef.h" +#include +#include #include "ws2nlm.h" +#include "apr_pools.h" + +typedef struct app_data { + int initialized; +} APP_DATA; + +/* library-private data...*/ +int gLibId = -1; +void *gLibHandle = (void *) NULL; +NXMutex_t *gLibLock = (NXMutex_t *) NULL; + +/* internal library function prototypes...*/ +int DisposeLibraryData(void *); + int _NonAppStart ( void *NLMHandle, @@ -28,6 +43,8 @@ int _NonAppStart const char **messages ) { + NX_LOCK_INFO_ALLOC(liblock, "Per-Application Data Lock", 0); + #pragma unused(cmdLine) #pragma unused(loadDirPath) #pragma unused(uninitializedDataLength) @@ -39,16 +56,94 @@ int _NonAppStart #pragma unused(messages) WSADATA wsaData; + apr_status_t status; + gLibId = register_library(DisposeLibraryData); + + if (gLibId < -1) + { + OutputToScreen(errorScreen, "Unable to register library with kernel.\n"); + return -1; + } + + gLibHandle = NLMHandle; + + gLibLock = NXMutexAlloc(0, 0, &liblock); + + if (!gLibLock) + { + OutputToScreen(errorScreen, "Unable to allocate library data lock.\n"); + return -1; + } + + apr_netware_setup_time(); + + if ((status = apr_pool_initialize()) != APR_SUCCESS) + return status; + return WSAStartup((WORD) MAKEWORD(2, 0), &wsaData); } void _NonAppStop( void ) { + apr_pool_terminate(); + WSACleanup(); + + unregister_library(gLibId); + NXMutexFree(gLibLock); } int _NonAppCheckUnload( void ) { - return 0; + return 0; +} + +int register_NLM(void *NLMHandle) +{ + APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); + + NXLock(gLibLock); + if (!app_data) { + app_data = (APP_DATA*)library_malloc(gLibHandle, sizeof(APP_DATA)); + + if (app_data) { + memset (app_data, 0, sizeof(APP_DATA)); + set_app_data(gLibId, app_data); + } + } + + if (app_data && (!app_data->initialized)) { + app_data->initialized = 1; + NXUnlock(gLibLock); + return 0; + } + + NXUnlock(gLibLock); + return 1; } + +int unregister_NLM(void *NLMHandle) +{ + APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); + + NXLock(gLibLock); + if (app_data) { + app_data->initialized = 0; + NXUnlock(gLibLock); + return 0; + } + NXUnlock(gLibLock); + return 1; +} + +int DisposeLibraryData(void *data) +{ + if (data) + { + library_free(data); + } + + return 0; +} + From 7dc180e2f2980cc75db9b7e2f6f5c7b56d966263 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 31 Jan 2002 18:56:35 +0000 Subject: [PATCH 2875/7878] Added the APIs for handling application NLM registration with the APR library NLM git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62879 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_private.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 61de0fdcee7..d3b6dca01b2 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -71,7 +71,9 @@ #include #include #include +#include #include +#include //#include "memcheck.h" @@ -155,8 +157,22 @@ typedef void (Sigfunc)(int); #define SIZEOF_CHAR 1 #define SIZEOF_SSIZE_T SIZEOF_INT -//unsigned __stdcall SignalHandling(void *); -//int thread_ready(void); +void netware_pool_proc_cleanup (); + +// library-private data... +extern int gLibId; +extern void *gLibHandle; + +/* NLM registration routines for managing which NLMs + are using the library. */ +int register_NLM(void *NLMHandle); +int unregister_NLM(void *NLMHandle); + +/* Redefine malloc to use the library malloc call so + that all of the memory resources will be owned + and can be shared by the library. */ +#undef malloc +#define malloc(x) library_malloc(gLibHandle,x) #endif /*APR_PRIVATE_H*/ #endif /*NETWARE*/ From 4711ced78653f74191fe6c77e5b8e288873c43cd Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 31 Jan 2002 18:59:58 +0000 Subject: [PATCH 2876/7878] NetWare version of start.c for handling initialization of application NLMs with the APR library NLM, allocating the application specific pools and starting Winsock. It also handle deregistering the application NLM and freeing any memory back to the shared memory pool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62880 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/start.c | 129 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 misc/netware/start.c diff --git a/misc/netware/start.c b/misc/netware/start.c new file mode 100644 index 00000000000..9b29876e3d7 --- /dev/null +++ b/misc/netware/start.c @@ -0,0 +1,129 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_signal.h" + +#include "misc.h" /* for WSAHighByte / WSALowByte */ +#include "locks.h" /* for apr_unix_setup_lock() */ +#include "proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ +#include "internal_time.h" + + +//static int initialized = 0; + +APR_DECLARE(apr_status_t) apr_initialize(void) +{ + apr_pool_t *pool; + apr_status_t status; + int iVersionRequested; + WSADATA wsaData; + int err; + + /* Register the NLM as using APR. If it is already + registered then just return. */ + if (register_NLM(getnlmhandle()) != 0) { + return APR_SUCCESS; + } + + /* apr_pool_initialize() is being called from the library + startup code since all of the memory resources belong + to the library rather than the application. */ + + if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { + return APR_ENOPOOL; + } + + apr_pool_tag(pool, "apr_initilialize"); + + iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); + err = WSAStartup((WORD) iVersionRequested, &wsaData); + if (err) { + return err; + } + if (LOBYTE(wsaData.wVersion) != WSAHighByte || + HIBYTE(wsaData.wVersion) != WSALowByte) { + WSACleanup(); + return APR_EEXIST; + } + + apr_signal_init(pool); + + return APR_SUCCESS; +} + +APR_DECLARE_NONSTD(void) apr_terminate(void) +{ + /* Unregister the NLM. If it is not registered + then just return. */ + if (unregister_NLM(getnlmhandle()) != 0) { + return; + } + + /* apr_pool_terminate() is being called from the + library shutdown code since the memory resources + belong to the library rather than the application */ + + /* Just clean up the memory for the app that is going + away. */ + netware_pool_proc_cleanup (); + WSACleanup(); +} + +APR_DECLARE(void) apr_terminate2(void) +{ + apr_terminate(); +} From 3b3eb2c7050f7ba4b612cba7dd9664202d53920b Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 31 Jan 2002 19:00:36 +0000 Subject: [PATCH 2877/7878] Switched the project to build the NetWare version of start.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62881 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 178848 -> 178283 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 14b850391f943b236c5460052e0b6bf9ab2e7eb0..8c977ec827e237b539e908340e73d2fbd43b0cd0 100644 GIT binary patch delta 92029 zcma%iWmH^Cv?fmQ5Q5tc8r@UEeNn|G;rW>rqFv0a6QT&g$C={Szxx6y8KU6nqpE z6es)l7H%FczTD21ZU<&K?{xdF^Mb{m_~L&ecYq7OdYT{piE5td$p zkp^zLCI7tC_|nqP7Bm%`=l0c6-dS+_4Ex3tXS8b;L!bPR5v{TxsLRf?Fa z;R@I1f~HMJ^R164QB#>l$8Ol+K^MGgVk}Hk~3^SjsAI-QU9ZJ>=J(|Fcj7 zT3v<`oCgFj@TE;R*qBKl`;sA;_9M{f_nwZaBn>qElJVn5ysOr=osf+nf}UY(uMq%< ze+WxF{lsM!UTBkk@JpusrObKk))7J$b^BB2*M}PFtSgD!YM(iU8(dBN)F_jaGol(E zQ!S<3Zrf*`%emdKV!)nKjkETk1%0__2`1H1GO3`V7Zs0Mc*pHG+ESvd?N&F|I z5AskLSb%mzv|^8XITO zOsu;ek$^@|AdMBonFfP>TsV}bmc*7MH^nO+OC|y1fxUws`v+MaRTgpUPFhWYwEhjY zgp493$dSrIz3KkcP^W%{F5$ey=I%hV@s1}uwzjdfPfpdmq7>{m$&ti(eN(fprDvLV zPTTS9;Blj6X}|L27)hwU=u=u%hGnD@(~+%KA^W zc!*&dskcE+ubDn;xJF0~9XpjE@MW7%xGoPc>X+sbbK=@;4KrCdF(0$G#q=vuQu7y$3AW0F{J?4>3ldHb zpc-2kJx)FK+hs`Hat*ln0*mRaf4%&Z=xLnu4?m~VGk+ooZ^AoYgO7{UlZDDUKXu~u zh^QVv%S0v$ld{CD^zK3MOsbKyOe2(}5jRwO78$h{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-Bv>VKkJ0aWzq7s zh{b{s$6j=1%d((u4YmxVZh_rNfeBf93dfrEV7ar-0K25VB5Yqy{{m#$dJm}YXi-tj z+XVTiGP$d*-1$4^8eO+cCz2vqdE`~*ZztxEuGOvlFnTc_R6y2p*Y8Xq!gCoQD~g`? z@B-EBx58w6JX>Bu0HRZV#b(~z}K9|X%4HqI20Rl zT}T~xKm-%_0YeGgHhvgxI#x1D&F}aAKZ^gn1hMN`+%8LLVNM<|;&v%b{vW+V@PhYd zV%>?W)Nn5+Z)*M@eo>tnskUW;9OLl Date: Thu, 31 Jan 2002 19:15:44 +0000 Subject: [PATCH 2878/7878] All memory resources are shared with all NLMs running on NetWare. This requires us to have to track each applications use of memory and make sure that the memory is freed back to the global pool when the application terminates. Added code to help track which application owns each pool and a cleanup routine for making sure that all memory is freed when the application terminates. Also redefined the malloc() call for NetWare to library_malloc() so that the library actually owns all memory allocated and can distribute it how it sees fit. This prevents an application from terminating and invalidating half of the memory in the global memory pool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62882 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 76302b29886..b318e686b5f 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -186,6 +186,9 @@ struct apr_pool_t { apr_thread_mutex_t *mutex; #endif /* APR_HAS_THREADS */ #endif /* APR_POOL_DEBUG */ +#ifdef NETWARE + apr_os_proc_t owner_proc; +#endif }; #define SIZEOF_POOL_T APR_ALIGN_DEFAULT(sizeof(apr_pool_t)) @@ -266,6 +269,24 @@ APR_DECLARE(void) apr_pool_terminate(void) memset(&global_allocator, 0, SIZEOF_ALLOCATOR_T); } +#ifdef NETWARE +void netware_pool_proc_cleanup () +{ + apr_pool_t *pool = global_pool->child; + apr_os_proc_t owner_proc = (apr_os_proc_t)getnlmhandle(); + + while (pool) { + if (pool->owner_proc == owner_proc) { + apr_pool_destroy (pool); + pool = global_pool->child; + } + else { + pool = pool->sibling; + } + } + return; +} +#endif /* * Memory allocation @@ -707,6 +728,9 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, pool->user_data = NULL; pool->tag = NULL; } +#ifdef NETWARE + pool->owner_proc = (apr_os_proc_t)getnlmhandle(); +#endif if ((pool->parent = parent) != NULL) { #if APR_HAS_THREADS From e027af65fcd216b80eff8c37e3e0830e2ab00b36 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 31 Jan 2002 23:34:04 +0000 Subject: [PATCH 2879/7878] To be useful, these right helper library must be used based on the application's choice of static apr.lib or dynamic libapr.dll. This became a problem once the helper started registering sucess against the shared variable, to prevent apr_app_main logic (or whatever that call is renamed to) from running more than once. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62883 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_app.dsp | 4 +- build/libapr_app.dsp | 93 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 build/libapr_app.dsp diff --git a/build/apr_app.dsp b/build/apr_app.dsp index 9c2c62492f2..4d3a898297a 100644 --- a/build/apr_app.dsp +++ b/build/apr_app.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"LibR\apr_app" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fd"LibR\apr_app" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "APR_EXPORT_STATIC" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"LibD\apr_app" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fd"LibD\apr_app" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe diff --git a/build/libapr_app.dsp b/build/libapr_app.dsp new file mode 100644 index 00000000000..f512caa6b77 --- /dev/null +++ b/build/libapr_app.dsp @@ -0,0 +1,93 @@ +# Microsoft Developer Studio Project File - Name="libapr_app" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libapr_app - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libapr_app.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libapr_app.mak" CFG="libapr_app - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libapr_app - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libapr_app - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libapr_app - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"Debug\libapr_app" /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libapr_app - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"Debug\libapr_app" /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libapr_app - Win32 Release" +# Name "libapr_app - Win32 Debug" +# Begin Source File + +SOURCE=..\misc\win32\apr_app.c +# End Source File +# Begin Source File + +SOURCE=..\i18n\unix\utf8_ucs2.c +# End Source File +# End Target +# End Project From 29a4b6fe7a12850abe05c7f4dc1abed5b2a53f7c Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Fri, 1 Feb 2002 01:15:01 +0000 Subject: [PATCH 2880/7878] get rid of the apr_shmem.h include file -- it messes up dependencies. some minor tweaks to make it compile a bit better, but the use of shared memory in here is just borken. needs to be updated to the latest shm APIs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62884 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 64510022839..8ba213d5e15 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -52,7 +52,7 @@ * . */ -#include "apr_shmem.h" +#include "apr_shm.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_lock.h" @@ -151,7 +151,7 @@ int main(int argc, const char * const *argv) apr_getopt_t *opt; char optchar; const char *optarg; - apr_shmem_t *shm; + apr_shm_t *shm; printf("APR Proc Mutex Test\n==============\n\n"); From 00b11615882a1f65dc9964143cb0f39b70a24134 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Fri, 1 Feb 2002 01:18:53 +0000 Subject: [PATCH 2881/7878] Bring this up to date with the new shared memory API. This should get us compiling again (and the test seems to work, too). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62885 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 8ba213d5e15..9fba59993f6 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -179,8 +179,8 @@ int main(int argc, const char * const *argv) exit(-1); } - apr_shm_init(&shm, sizeof(int), shmname, pool); - x = apr_shm_calloc(shm, sizeof(int)); + apr_shm_create(&shm, sizeof(int), shmname, pool); + x = apr_shm_baseaddr_get(shm); if ((rv = test_exclusive(lockname)) != APR_SUCCESS) { fprintf(stderr,"Exclusive Lock test failed : [%d] %s\n", From c7afbcbee258e3121fdcb215a64ebff312f1b2ca Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Fri, 1 Feb 2002 01:40:38 +0000 Subject: [PATCH 2882/7878] Add apr_file_copy() and apr_file_append() functions. These are written in terms of APR itself, so each platform just uses the one function. A future improvement would use CopyFile(Ex) on Windows and sendfile() on sendfile-capable systems. Also add apr_file_attrs_set() for setting file attributes in a logical fashion, rather than based on (Posix) permission bits. This is not (yet) implemented for Windows, and still needs a way to turn *off* the readonly and executable modes. Submitted by: Philip Martin git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62886 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/Makefile.in | 1 + file_io/unix/filestat.c | 26 ++++++++++++++++ file_io/win32/filestat.c | 7 +++++ include/apr_file_info.h | 25 +++++++++------ include/apr_file_io.h | 66 ++++++++++++++++++++++++++++++++++++++++ libapr.dsp | 4 +++ 6 files changed, 119 insertions(+), 10 deletions(-) diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index 975864f8ef2..4b3f3fcf851 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -1,5 +1,6 @@ TARGETS = \ + copy.lo \ dir.lo \ fileacc.lo \ filedup.lo \ diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index b13f5b3c5ac..29bf16e500b 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -136,6 +136,32 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, + apr_fileattrs_t attributes, + apr_pool_t *cont) +{ + apr_status_t status; + apr_finfo_t finfo; + + status = apr_stat(&finfo, fname, APR_FINFO_PROT, cont); + if (!APR_STATUS_IS_SUCCESS(status)) + return status; + + if (attributes & APR_FILE_ATTR_READONLY) { + finfo.protection &= ~APR_UWRITE; + finfo.protection &= ~APR_GWRITE; + finfo.protection &= ~APR_WWRITE; + } + if (attributes & APR_FILE_ATTR_EXECUTABLE) { + /* ### TODO: should this be umask'd? */ + finfo.protection |= APR_UEXECUTE; + finfo.protection |= APR_GEXECUTE; + finfo.protection |= APR_WEXECUTE; + } + + return apr_file_perms_set(fname, finfo.protection); +} + APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *cont) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 0f2fe43e48a..a50d534b39d 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -611,3 +611,10 @@ APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, { return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, cont); } + +APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, + apr_fileattrs_t attributes, + apr_pool_t *cont) +{ + return APR_ENOTIMPL; +} diff --git a/include/apr_file_info.h b/include/apr_file_info.h index f057b7013de..ed6924bea89 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -94,21 +94,26 @@ typedef enum { * @{ */ -#define APR_UREAD 0x400 /**< Read by user */ -#define APR_UWRITE 0x200 /**< Write by user */ -#define APR_UEXECUTE 0x100 /**< Execute by user */ +#define APR_UREAD 0x4000 /**< Read by user */ +#define APR_UWRITE 0x2000 /**< Write by user */ +#define APR_UEXECUTE 0x1000 /**< Execute by user */ -#define APR_GREAD 0x040 /**< Read by group */ -#define APR_GWRITE 0x020 /**< Write by group */ -#define APR_GEXECUTE 0x010 /**< Execute by group */ +#define APR_GREAD 0x0040 /**< Read by group */ +#define APR_GWRITE 0x0020 /**< Write by group */ +#define APR_GEXECUTE 0x0010 /**< Execute by group */ -#define APR_WREAD 0x004 /**< Read by others */ -#define APR_WWRITE 0x002 /**< Write by others */ -#define APR_WEXECUTE 0x001 /**< Execute by others */ +#define APR_WREAD 0x0004 /**< Read by others */ +#define APR_WWRITE 0x0002 /**< Write by others */ +#define APR_WEXECUTE 0x0001 /**< Execute by others */ + +#define APR_OS_DEFAULT 0x0FFF /**< use OS's default permissions */ + +/* additional permission flags for apr_file_copy and apr_file_append */ +#define APR_FILE_SOURCE_PERMS 0x1000 /**< Copy source file's permissions */ -#define APR_OS_DEFAULT 0xFFF /**< use default permissions of Underlying Operating System*/ /** @} */ + /** * Structure for referencing directories. * @defvar apr_dir_t diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 0c2e843e5df..ae1320cc245 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -115,6 +115,19 @@ extern "C" { #define APR_END SEEK_END /** @} */ +/** + * @defgroup APR_file_set_attributes File Attribute Flags + * @{ + */ + +/* flags for apr_file_set_attributes */ +#define APR_FILE_ATTR_READONLY 0x01 /**< File is read-only */ +#define APR_FILE_ATTR_EXECUTABLE 0x02 /**< File is executable */ +/** @} */ + +/** File attributes */ +typedef apr_int32_t apr_fileattrs_t; + /** should be same as whence type in lseek, POSIX defines this as int */ typedef int apr_seek_where_t; @@ -204,6 +217,39 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_path, apr_pool_t *pool); +/** + * copy the specified file to another file. + * @param from_path The full path to the original file (using / on all systems) + * @param to_path The full path to the new file (using / on all systems) + * @param perms Access permissions for the new file if it is created. + * In place of the usual or'd combination of file permissions, the + * value APR_FILE_SOURCE_PERMS may be given, in which case the source + * file's permissions are copied. + * @param pool The pool to use. + * @remark The new file does not need to exist, it will be created if required. + * @warning If the new file already exists, its contents will be overwritten. + */ +APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path, + const char *to_path, + apr_fileperms_t perms, + apr_pool_t *pool); + +/** + * append the specified file to another file. + * @param from_path The full path to the source file (using / on all systems) + * @param to_path The full path to the destination file (using / on all systems) + * @param perms Access permissions for the destination file if it is created. + * In place of the usual or'd combination of file permissions, the + * value APR_FILE_SOURCE_PERMS may be given, in which case the source + * file's permissions are copied. + * @param pool The pool to use. + * @remark The new file does not need to exist, it will be created if required. + */ +APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, + const char *to_path, + apr_fileperms_t perms, + apr_pool_t *pool); + /** * Are we at the end of the file * @param fptr The apr file we are testing. @@ -529,6 +575,26 @@ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, const char *format, .. APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, apr_fileperms_t perms); +/** + * Set attributes of the specified file. + * @param fname The full path to the file (using / on all systems) + * @param attributes Or'd combination of + *

      + *            APR_FILE_ATTR_READONLY   - make the file readonly
      + *            APR_FILE_ATTR_EXECUTABLE - make the file executable
      + * 
      + * @param cont the pool to use. + * @remark This function should be used in preference to explict manipulation + * of the file permissions, because the operations to provide these + * attributes are platform specific and may involve more than simply + * setting permission bits. + * @warning Platforms which do not implement this feature will return + * APR_ENOTIMPL. + */ +APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, + apr_fileattrs_t attributes, + apr_pool_t *cont); + /** * Create a new directory on the file system. * @param path the path for the directory to be created. (use / on all systems) diff --git a/libapr.dsp b/libapr.dsp index f9ecad3b2b0..776acf08420 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -103,6 +103,10 @@ SOURCE=.\dso\win32\dso.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\file_io\unix\copy.c +# End Source File +# Begin Source File + SOURCE=.\file_io\win32\dir.c # End Source File # Begin Source File From ec81ae403b9c46e289d9f6e11efe9621f6f2d6bb Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 1 Feb 2002 03:11:16 +0000 Subject: [PATCH 2883/7878] Add a path argument that makes it easier for programs (such as SVN) that require absolute paths instead of relative ones. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62887 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 8ec1f207d39..ce3b11635b7 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -6,10 +6,12 @@ dnl library. It provides a standardized mechanism for using APR. It supports dnl embedding APR into the application source, or locating an installed dnl copy of APR. dnl -dnl APR_FIND_APR([srcdir]) +dnl APR_FIND_APR([srcdir, path]) dnl dnl where srcdir is the location of the bundled APR source directory, or dnl empty if source is not bundled. +dnl where path is the prefix to the location where the bundled APR will +dnl will be built. dnl dnl dnl Sets the following variables on exit: @@ -149,15 +151,20 @@ APR, nor an APR build directory.]) if test "$apr_found" = "no" && test -n "$1" && test -x "$1/configure"; then apr_found="reconfig" apr_srcdir="$1" + if test -n "$2"; then + apr_builddir="$2/" + else + apr_builddir="" + fi apr_libdir="" - apr_la_file="$apr_srcdir/libapr.la" - apr_vars="$apr_srcdir/APRVARS" - if test -f "$apr_srcdir/apr-config.in"; then - apr_config="$apr_srcdir/apr-config" + apr_la_file="$apr_builddir$apr_srcdir/libapr.la" + apr_vars="$apr_builddir$apr_srcdir/APRVARS" + if test -f "$apr_builddir$apr_srcdir/apr-config.in"; then + apr_config="$apr_builddir$apr_srcdir/apr-config" else apr_config="" fi - apr_includes="-I$apr_srcdir/include" + apr_includes="-I$apr_builddir$apr_srcdir/include" fi ]) From 68e36b531d3b2d96070f0c5c57cfca390129bc35 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Feb 2002 04:23:06 +0000 Subject: [PATCH 2884/7878] Sync up to gstein's last commit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62888 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apr.dsp b/apr.dsp index be527098f2f..658f01de668 100644 --- a/apr.dsp +++ b/apr.dsp @@ -97,6 +97,10 @@ SOURCE=.\dso\win32\dso.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\file_io\unix\copy.c +# End Source File +# Begin Source File + SOURCE=.\file_io\win32\dir.c # End Source File # Begin Source File From cfebda7b6de18601d079485537bc6e57cd3297cd Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 1 Feb 2002 04:43:22 +0000 Subject: [PATCH 2885/7878] Add apr_file_copy() and apr_file_append() functions. These are written in terms of APR itself, so each platform just uses the one function. A future improvement would use CopyFile(Ex) on Windows and sendfile() on sendfile-capable systems. Also add apr_file_attrs_set() for setting file attributes in a logical fashion, rather than based on (Posix) permission bits. This is not (yet) implemented for Windows, and still needs a way to turn *off* the readonly and executable modes. Submitted by: Philip Martin git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62889 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/copy.c | 153 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 file_io/unix/copy.c diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c new file mode 100644 index 00000000000..a3ad66cd8b8 --- /dev/null +++ b/file_io/unix/copy.c @@ -0,0 +1,153 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "fileio.h" +#include "apr_file_io.h" + +static apr_status_t +apr_file_transfer_contents(const char *from_path, + const char *to_path, + apr_int32_t flags, + apr_fileperms_t to_perms, + apr_pool_t *pool) +{ + apr_file_t *s = NULL, *d = NULL; /* init to null important for APR */ + apr_status_t status; + apr_status_t read_err, write_err; + apr_finfo_t finfo; + apr_fileperms_t perms; + char buf[BUFSIZ]; + + /* Open source file. */ + status = apr_file_open(&s, from_path, APR_READ, APR_OS_DEFAULT, pool); + if (status) + return status; + + /* Get its size. */ + if (to_perms == APR_FILE_SOURCE_PERMS) { + status = apr_file_info_get(&finfo, APR_FINFO_PROT, s); + if (status) { + apr_file_close(s); /* toss any error */ + return status; + } + perms = finfo.protection; + } + else + perms = to_perms; + + /* Open dest file. */ + status = apr_file_open(&d, to_path, flags, perms, pool); + if (status) { + apr_file_close(s); /* toss any error */ + return status; + } + + /* Copy bytes till the cows come home. */ + read_err = 0; + while (!APR_STATUS_IS_EOF(read_err)) { + apr_size_t bytes_this_time = sizeof (buf); + + /* Read 'em. */ + read_err = apr_file_read(s, buf, &bytes_this_time); + if (read_err && !APR_STATUS_IS_EOF(read_err)) { + apr_file_close(s); /* toss any error */ + apr_file_close(d); /* toss any error */ + return read_err; + } + + /* Write 'em. */ + write_err = apr_file_write_full(d, buf, bytes_this_time, NULL); + if (write_err) { + apr_file_close(s); /* toss any error */ + apr_file_close(d); /* toss any error */ + return write_err; + } + + if (read_err && APR_STATUS_IS_EOF(read_err)) { + status = apr_file_close (s); + if (status) { + apr_file_close(d); /* toss any error */ + return status; + } + + status = apr_file_close (d); + if (status) + return status; + } + } + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path, + const char *to_path, + apr_fileperms_t perms, + apr_pool_t *pool) +{ + return apr_file_transfer_contents(from_path, to_path, + (APR_WRITE | APR_CREATE | APR_TRUNCATE), + perms, + pool); +} + +APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, + const char *to_path, + apr_fileperms_t perms, + apr_pool_t *pool) +{ + return apr_file_transfer_contents(from_path, to_path, + (APR_WRITE | APR_CREATE | APR_APPEND), + perms, + pool); +} From 970760ddb77827a9b4450381fcb18d59987fdf3a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Feb 2002 06:21:34 +0000 Subject: [PATCH 2886/7878] Win32 mod_rewrite was broken by the implicit assumption that fname would have a value. Of course, fname may be NULL, in which case this patch from 1.46 broke any NULL locking. Correct the Local/Global fix for NULL lock names. Oh most excelent RM of .31, please consider this patch, without which mod_rewrite will not load. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62890 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/locks.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 1730a4a3477..62abb6962f2 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -119,7 +119,12 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, } if (scope == APR_INTRAPROCESS) { - newlock->fname = apr_pstrdup(pool, fname); + if (fname) { + newlock->fname = apr_pstrdup(pool, fname); + } + else { + newlock->fname = NULL; + } InitializeCriticalSection(&newlock->section); } else { /* With Win2000 Terminal Services, the Mutex name can have a @@ -128,10 +133,17 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, * running on Win2000, Global\ and Local\ are ignored. These * prefixes are only valid on Win2000+ */ - if (apr_os_level >= APR_WIN_2000) - newlock->fname = apr_pstrcat(pool, "Global\\", fname, NULL); - else - newlock->fname = apr_pstrdup(pool, fname); + if (fname) { + if (apr_os_level >= APR_WIN_2000) { + newlock->fname = apr_pstrcat(pool, "Global\\", fname, NULL); + } + else { + newlock->fname = apr_pstrdup(pool, fname); + } + } + else { + newlock->fname = NULL; + } newlock->mutex = CreateMutex(&sec, FALSE, newlock->fname); if (!newlock->mutex) { @@ -156,7 +168,18 @@ APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, if ((*lock) == NULL) { return APR_ENOMEM; } - (*lock)->fname = apr_pstrdup(pool, fname); + if (fname) { + if (apr_os_level >= APR_WIN_2000) { + (*lock)->fname = apr_pstrcat(pool, "Global\\", fname, NULL); + } + else { + (*lock)->fname = apr_pstrdup(pool, fname); + } + } + else { + return APR_EINVAL; + } + (*lock)->mutex = OpenMutex(MUTEX_ALL_ACCESS, TRUE, fname); if ((*lock)->mutex == NULL) { From 1de3ba2b82a141fa0d484066c192f179d754eb26 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Fri, 1 Feb 2002 06:31:20 +0000 Subject: [PATCH 2887/7878] some style changes. other tweaks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62892 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/copy.c | 57 +++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index a3ad66cd8b8..c4b87b4c69a 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -55,25 +55,22 @@ #include "fileio.h" #include "apr_file_io.h" -static apr_status_t -apr_file_transfer_contents(const char *from_path, - const char *to_path, - apr_int32_t flags, - apr_fileperms_t to_perms, - apr_pool_t *pool) +static apr_status_t apr_file_transfer_contents(const char *from_path, + const char *to_path, + apr_int32_t flags, + apr_fileperms_t to_perms, + apr_pool_t *pool) { apr_file_t *s = NULL, *d = NULL; /* init to null important for APR */ apr_status_t status; - apr_status_t read_err, write_err; apr_finfo_t finfo; apr_fileperms_t perms; - char buf[BUFSIZ]; /* Open source file. */ status = apr_file_open(&s, from_path, APR_READ, APR_OS_DEFAULT, pool); if (status) return status; - + /* Get its size. */ if (to_perms == APR_FILE_SOURCE_PERMS) { status = apr_file_info_get(&finfo, APR_FINFO_PROT, s); @@ -92,11 +89,13 @@ apr_file_transfer_contents(const char *from_path, apr_file_close(s); /* toss any error */ return status; } - + /* Copy bytes till the cows come home. */ - read_err = 0; - while (!APR_STATUS_IS_EOF(read_err)) { - apr_size_t bytes_this_time = sizeof (buf); + while (1) { + char buf[BUFSIZ]; + apr_size_t bytes_this_time = sizeof(buf); + apr_status_t read_err; + apr_status_t write_err; /* Read 'em. */ read_err = apr_file_read(s, buf, &bytes_this_time); @@ -115,39 +114,37 @@ apr_file_transfer_contents(const char *from_path, } if (read_err && APR_STATUS_IS_EOF(read_err)) { - status = apr_file_close (s); + status = apr_file_close(s); if (status) { apr_file_close(d); /* toss any error */ return status; } - - status = apr_file_close (d); - if (status) - return status; + + /* return the results of this close: an error, or success */ + return apr_file_close(d); } } - - return APR_SUCCESS; + /* NOTREACHED */ } -APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path, +APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path, const char *to_path, apr_fileperms_t perms, apr_pool_t *pool) { - return apr_file_transfer_contents(from_path, to_path, - (APR_WRITE | APR_CREATE | APR_TRUNCATE), - perms, - pool); + return apr_file_transfer_contents(from_path, to_path, + (APR_WRITE | APR_CREATE | APR_TRUNCATE), + perms, + pool); } -APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, +APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, const char *to_path, apr_fileperms_t perms, apr_pool_t *pool) { - return apr_file_transfer_contents(from_path, to_path, - (APR_WRITE | APR_CREATE | APR_APPEND), - perms, - pool); + return apr_file_transfer_contents(from_path, to_path, + (APR_WRITE | APR_CREATE | APR_APPEND), + perms, + pool); } From 3c9d82243b603c0d2748af24e1ec91697ec51026 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 1 Feb 2002 14:56:30 +0000 Subject: [PATCH 2888/7878] change APR_OS_DEFAULT to coincide with recent changes to the permission flags git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62893 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index ed6924bea89..02ce8a890cb 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -106,7 +106,7 @@ typedef enum { #define APR_WWRITE 0x0002 /**< Write by others */ #define APR_WEXECUTE 0x0001 /**< Execute by others */ -#define APR_OS_DEFAULT 0x0FFF /**< use OS's default permissions */ +#define APR_OS_DEFAULT 0xFFFF /**< use OS's default permissions */ /* additional permission flags for apr_file_copy and apr_file_append */ #define APR_FILE_SOURCE_PERMS 0x1000 /**< Copy source file's permissions */ From fe664ea70d4daefa9fcd0b4980be6f3d577422ed Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 1 Feb 2002 17:26:46 +0000 Subject: [PATCH 2889/7878] Fixed up a misplaced shm.c file in the APR build project and added \file_io\unix\copy.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62894 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 178283 -> 178863 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 8c977ec827e237b539e908340e73d2fbd43b0cd0..a749d81870c7a3290da0af3f41ffb55c303886a6 100644 GIT binary patch delta 92567 zcmb5V1yoeg*EmW@D5)qN3P>p+-Gd6!B`MtvlG1SLkO8EnrBk|ds6o2B1_lJAh8|&n z|M>g_oeo;m02oOAZsd+xsbh(}cyj{@s4N7Ml^^>?qEKk-2XtT8d( z#1mi;Vqjo6*qWI-yMFfMax`~7FeETB_%NHjDt<$3o2&NdwbMc)yQ5c<`tw7Uy+-9k z0Y}>~o7P3yy1~wsRetuTC4u7lY>^72@u`nG)wW7YB9XD`s1G=Qw_n8F;XlHU+`Qkp zA6wzO8T#xx{krfF7_(LV-R8D4HkRf4dqjlKZ3ma>v1%0Qrf@W=q^An0)9Z}qe^MTu zWNYEu%a^KcMSA($uhx8e{-mzOES@We^~KjH4mAcr=c{hv@3yo%dDbihC$z|Lr@Z%F zmhl5EB}DCyl@>E?A8SWfGmpzV)ZoL7^YaN@WLnPGyG~9OmWXW#*yJN}WC-`pdbbk6hg1VZ{FZ{#8&(kP9Ui`H#zzN+U|6uI(D3@z};oDZ)T5hD$ zXrCINSDk&^TBv-n_O_|`)e|=ngYvo9ty_9bP!#kBL{>jE|Euek*%3+hgY53CKbY>* zusy%Kw{Jw80X!Gsm|i~Q7;#G8^So3V)#DEj$3LC;ll?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_mBs3l-SL8PP@)NI(Gn~k>Z+NiSMP8{ Date: Fri, 1 Feb 2002 17:27:38 +0000 Subject: [PATCH 2890/7878] Removed the NetWare #ifdefs since NetWare now has its own version of start.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62895 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/misc/unix/start.c b/misc/unix/start.c index b0d8f99326a..91271dbdd2e 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -83,7 +83,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) { apr_pool_t *pool; apr_status_t status; -#if defined WIN32 || defined(NETWARE) +#if defined WIN32 int iVersionRequested; WSADATA wsaData; int err; @@ -96,16 +96,12 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_SUCCESS; } -#if !defined(BEOS) && !defined(OS2) && !defined(WIN32) && !defined(NETWARE) +#if !defined(BEOS) && !defined(OS2) && !defined(WIN32) apr_unix_setup_lock(); apr_proc_mutex_unix_setup_lock(); apr_unix_setup_time(); #endif -#if defined(NETWARE) - apr_netware_setup_time(); -#endif - if ((status = apr_pool_initialize()) != APR_SUCCESS) return status; @@ -122,7 +118,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) } #endif -#if defined(NETWARE) || defined(WIN32) +#if defined(WIN32) iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); err = WSAStartup((WORD) iVersionRequested, &wsaData); if (err) { @@ -148,7 +144,7 @@ APR_DECLARE_NONSTD(void) apr_terminate(void) } apr_pool_terminate(); -#if defined(NETWARE) || defined(WIN32) +#if defined(WIN32) WSACleanup(); #endif } From cfe5f5b2279d24285c5a93ec2ba3032b17389d74 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 1 Feb 2002 18:27:53 +0000 Subject: [PATCH 2891/7878] Added the apr_app_main() stub git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62896 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/start.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/misc/netware/start.c b/misc/netware/start.c index 9b29876e3d7..dc8c627dec7 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -63,7 +63,17 @@ #include "internal_time.h" -//static int initialized = 0; +APR_DECLARE(apr_status_t) apr_app_main(int *argc, char ***argv, char ***env) +{ + /* An absolute noop. At present, only Win32 requires this stub, but it's + * required in order to move command arguments passed through the service + * control manager into the process, and it's required to fix the char* + * data passed in from local/wide codepage into utf-8, our internal fmt. + * + * Win32 declares it's implementation in misc/win32/apr_app.c + */ + return APR_SUCCESS; +} APR_DECLARE(apr_status_t) apr_initialize(void) { From 0ef9b6d933d32e8755aa586254d3fe5f0e81f815 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Fri, 1 Feb 2002 22:11:38 +0000 Subject: [PATCH 2892/7878] I mangled the APR_U* permission bits the other day, when I folded in Philip's patch. This puts them back to their original values (which matches the OS_DEFAULT mask, and does not conflict with the FILE_SOURCE_PERMS flag). Also corrected the change to APR_OS_DEFAULT -- it should not have been changed to 0xFFFF. That fixed the symptom, not the cause. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62897 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 02ce8a890cb..42f123b28f7 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -94,9 +94,9 @@ typedef enum { * @{ */ -#define APR_UREAD 0x4000 /**< Read by user */ -#define APR_UWRITE 0x2000 /**< Write by user */ -#define APR_UEXECUTE 0x1000 /**< Execute by user */ +#define APR_UREAD 0x0400 /**< Read by user */ +#define APR_UWRITE 0x0200 /**< Write by user */ +#define APR_UEXECUTE 0x0100 /**< Execute by user */ #define APR_GREAD 0x0040 /**< Read by group */ #define APR_GWRITE 0x0020 /**< Write by group */ @@ -106,7 +106,7 @@ typedef enum { #define APR_WWRITE 0x0002 /**< Write by others */ #define APR_WEXECUTE 0x0001 /**< Execute by others */ -#define APR_OS_DEFAULT 0xFFFF /**< use OS's default permissions */ +#define APR_OS_DEFAULT 0x0FFF /**< use OS's default permissions */ /* additional permission flags for apr_file_copy and apr_file_append */ #define APR_FILE_SOURCE_PERMS 0x1000 /**< Copy source file's permissions */ From 0107bc1298c3703db3830e9916c9f1def049b773 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 2 Feb 2002 06:12:34 +0000 Subject: [PATCH 2893/7878] OS/2: Implement apr_file_attrs_set() & other minor build fixes for the addition of apr_file_copy() & friends. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62898 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/Makefile.in | 3 ++- file_io/os2/copy.c | 1 + file_io/os2/filestat.c | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 file_io/os2/copy.c diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index 3bb85faeca5..6bb10b45f2d 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -13,7 +13,8 @@ TARGETS = \ fullrw.lo \ filepath.lo \ filesys.lo \ - mktemp.lo + mktemp.lo \ + copy.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/file_io/os2/copy.c b/file_io/os2/copy.c new file mode 100644 index 00000000000..f4ce010f8f7 --- /dev/null +++ b/file_io/os2/copy.c @@ -0,0 +1 @@ +#include "../unix/copy.c" diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 3bde3358157..f7ffcacbd58 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -197,3 +197,29 @@ APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, { return apr_stat(finfo, fname, wanted, cont); } + + + +APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, + apr_fileattrs_t attributes, + apr_pool_t *cont) +{ + FILESTATUS3 fs3; + ULONG rc = DosQueryPathInfo(fname, FIL_STANDARD, &fs3, sizeof(fs3)); + + if (rc == 0) { + ULONG old_attr = fs3.attrFile; + + if (attributes & APR_FILE_ATTR_READONLY) { + fs3.attrFile |= FILE_READONLY; + } else { + fs3.attrFile &= ~FILE_READONLY; + } + + if (fs3.attrFile != old_attr) { + rc = DosSetPathInfo(fname, FIL_STANDARD, &fs3, sizeof(fs3), 0); + } + } + + return APR_FROM_OS_ERROR(rc); +} From a20338a22beb86848624565a0ba970bae11aee32 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sun, 3 Feb 2002 00:02:27 +0000 Subject: [PATCH 2894/7878] No functional change. If apr_pool_sub_make() is deprecated, then don't document it in DOXYGEN. Fix some indentation; ensure columns don't extend past 80, add some comments to #if/#else/#endif logic. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62899 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 56 ++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index c1f3fcb68f1..e7989a688bb 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -250,11 +250,6 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, * @remark The @a apr_abort function provides a way to quit the program if the * machine is out of memory. By default, APR will return on error. */ -#if defined(DOXYGEN) -APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **newpool, - apr_pool_t *parent, - int (*apr_abort)(int retcode)); -#else #if APR_POOL_DEBUG #define apr_pool_sub_make(newpool, parent, abort_fn) \ (void)apr_pool_create_ex_debug(newpool, parent, abort_fn, \ @@ -264,7 +259,6 @@ APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **newpool, #define apr_pool_sub_make(newpool, parent, abort_fn) \ (void)apr_pool_create_ex(newpool, parent, abort_fn, APR_POOL_FDEFAULT) #endif -#endif /** * Clear all memory in the pool and run all the cleanups. This also destroys all @@ -414,10 +408,11 @@ APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag); * key is used at all times. * @bug Specify how to ensure this uniqueness! */ -APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, - const char *key, - apr_status_t (*cleanup)(void *), - apr_pool_t *pool); +APR_DECLARE(apr_status_t) apr_pool_userdata_set( + const void *data, + const char *key, + apr_status_t (*cleanup)(void *), + apr_pool_t *pool); /** * Set the data associated with the current pool @@ -432,10 +427,11 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, * a life span at least as long as the pool itself. * */ -APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, - const char *key, - apr_status_t (*cleanup)(void *), - apr_pool_t *pool); +APR_DECLARE(apr_status_t) apr_pool_userdata_setn( + const void *data, + const char *key, + apr_status_t (*cleanup)(void *), + apr_pool_t *pool); /** * Return the data associated with the current pool. @@ -444,7 +440,7 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, * @param pool The current pool. */ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, - apr_pool_t *pool); + apr_pool_t *pool); /* @@ -460,9 +456,11 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, * @param child_cleanup The function to call when a child process is created - * this function is called in the child, obviously! */ -APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup)(void *), - apr_status_t (*child_cleanup)(void *)); +APR_DECLARE(void) apr_pool_cleanup_register( + apr_pool_t *p, + const void *data, + apr_status_t (*plain_cleanup)(void *), + apr_status_t (*child_cleanup)(void *)); /** * Remove a previously registered cleanup function @@ -473,7 +471,7 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, * function */ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup)(void *)); + apr_status_t (*cleanup)(void *)); /** * Replace the child cleanup of a previously registered cleanup @@ -482,9 +480,11 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, * @param plain_cleanup The plain cleanup function of the registered cleanup * @param child_cleanup The function to register as the child cleanup */ -APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup)(void *), - apr_status_t (*child_cleanup)(void *)); +APR_DECLARE(void) apr_pool_child_cleanup_set( + apr_pool_t *p, + const void *data, + apr_status_t (*plain_cleanup)(void *), + apr_status_t (*child_cleanup)(void *)); /** * Run the specified cleanup function immediately and unregister it. Use @@ -493,8 +493,10 @@ APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup */ -APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, - apr_status_t (*cleanup)(void *)); +APR_DECLARE(apr_status_t) apr_pool_cleanup_run( + apr_pool_t *p, + void *data, + apr_status_t (*cleanup)(void *)); /** * An empty cleanup function @@ -588,7 +590,8 @@ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); /* @} */ -#else +#else /* APR_POOL_DEBUG or DOXYGEN */ + #ifdef apr_pool_join #undef apr_pool_join #endif @@ -598,7 +601,8 @@ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); #undef apr_pool_lock #endif #define apr_pool_lock(pool, lock) -#endif + +#endif /* APR_POOL_DEBUG or DOXYGEN */ /* From 8ba26ad51be204c3d26fdeb2ee590b5f65736a3f Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sun, 3 Feb 2002 13:39:47 +0000 Subject: [PATCH 2895/7878] Provide more outputs for the apr-config file. Corrected some handling of the prefix, and the exit code for the --help switch. Make the chmod +x for apr-config part of the "config commands" so that it will occur every time that config.status is run. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62900 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 81 ++++++++++++++++++++++++++++++++++++++++++++------- configure.in | 3 +- 2 files changed, 72 insertions(+), 12 deletions(-) diff --git a/apr-config.in b/apr-config.in index 1fb81ef0724..edb5cc57ab9 100644 --- a/apr-config.in +++ b/apr-config.in @@ -55,10 +55,12 @@ # APR script designed to allow easy command line access to APR configuration # parameters. -PREFIX="@prefix@" -EXEC_PREFIX="@exec_prefix@" -LIBDIR="@libdir@" -INCLUDEDIR="@includedir@" +prefix="@prefix@" +exec_prefix="@exec_prefix@" +bindir="@bindir@" +libdir="@libdir@" +includedir="@includedir@" + CC="@CC@" CPP="@CPP@" SHELL="@SHELL@" @@ -66,8 +68,7 @@ CPPFLAGS="@EXTRA_CPPFLAGS@" CFLAGS="@EXTRA_CFLAGS@" LDFLAGS="@EXTRA_LDFLAGS@" LIBS="@EXTRA_LIBS@" -INCLUDES="@EXTRA_INCLUDES@" -LIBTOOL_LIBS="@LIBTOOL_LIBS@" +EXTRA_INCLUDES="@EXTRA_INCLUDES@" SHLIBPATH_VAR="@shlibpath_var@" APR_SOURCE_DIR="@abs_srcdir@" APR_SO_EXT="@so_ext@" @@ -84,8 +85,20 @@ Known values for OPTION are: --cppflags print cpp flags --includes print include information --ldflags print linker flags - --libs print library information + --libs print additional libraries to link against + --srcdir print APR source directory + --apr-ld print link switch(es) for linking to APR + --apr-libtool print the libtool inputs for linking to APR + --apr-la-file print the path to the .la file, if available --help print this help + +When linking with libtool, an application should do something like: + APR_LIBS="\`apr-config --apr-libtool --libs\`" +or when linking directly: + APR_LIBS="\`apr-config --apr-ld --libs\`" + +An application should use the results of --cflags, --cppflags, --includes, +and --ldflags in their build process. EOF } @@ -94,6 +107,22 @@ if test $# -eq 0; then exit 1 fi +thisdir="`dirname $0`" +thisdir="`cd $thisdir && pwd`" +if test "$BINDIR" = "$thisdir"; then + location=installed +elif test "$APR_SOURCE_DIR" = "$thisdir"; then + location=source +else + location=build +fi + +if test "$location" = "installed"; then + LA_FILE="$libdir/libapr.la" +else + LA_FILE="$thisdir/libapr.la" +fi + while test $# -gt 0; do # Normalize the prefix. case "$1" in @@ -107,7 +136,7 @@ while test $# -gt 0; do prefix=$optarg ;; --prefix) - echo $PREFIX + echo $prefix ;; --cflags) echo $CFLAGS @@ -122,11 +151,43 @@ while test $# -gt 0; do echo $LDFLAGS ;; --includes) - echo $INCLUDES + if test "$location" = "installed"; then + echo "-I$includedir $EXTRA_INCLUDES" + elif test "$location" = "source"; then + echo "-I$APR_SOURCE_DIR/include $EXTRA_INCLUDES" + else + echo "-I$thisdir/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES" + fi + ;; + --srcdir) + echo $APR_SOURCE_DIR + ;; + --apr-ld) + if test "$location" = "installed"; then + ### avoid using -L if libdir is a "standard" location like /usr/lib + echo "-L$libdir -lapr" + else + echo "-L$thisdir -lapr" + fi + ;; + --apr-libtool) + if test -f "$LA_FILE"; then + echo $LA_FILE + elif test "$location" = "installed"; then + ### avoid using -L if libdir is a "standard" location like /usr/lib + echo "-L$libdir -lapr" + else + echo "-L$thisdir -lapr" + fi + ;; + --apr-la-file) + if test -f "$LA_FILE"; then + echo $LA_FILE + fi ;; --help) show_usage - exit 1 + exit 0 ;; *) show_usage diff --git a/configure.in b/configure.in index 105261c8a9f..5569b626a5d 100644 --- a/configure.in +++ b/configure.in @@ -1546,9 +1546,8 @@ for i in $SAVE_FILES; do fi rm -f $i.save done -]) - chmod +x apr-config +]) dnl #----------------------------- Fixup Makefiles for VPATH support From 2bf94a8f03b8db8a049619817f982cd626c5f2eb Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 3 Feb 2002 17:17:31 +0000 Subject: [PATCH 2896/7878] Export whether we have time.h or not. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62901 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + include/apr.h.in | 1 + 2 files changed, 2 insertions(+) diff --git a/configure.in b/configure.in index 5569b626a5d..b94af5b2d03 100644 --- a/configure.in +++ b/configure.in @@ -824,6 +824,7 @@ AC_SUBST(sys_typesh) AC_SUBST(sys_timeh) AC_SUBST(sys_uioh) AC_SUBST(sys_unh) +AC_SUBST(timeh) AC_SUBST(unistdh) AC_SUBST(signalh) AC_SUBST(sys_waith) diff --git a/include/apr.h.in b/include/apr.h.in index ade01bd450c..46aa0f3a9c2 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -61,6 +61,7 @@ #define APR_HAVE_SYS_UIO_H @sys_uioh@ #define APR_HAVE_SYS_UN_H @sys_unh@ #define APR_HAVE_SYS_WAIT_H @sys_waith@ +#define APR_HAVE_TIME_H @timeh@ #define APR_HAVE_UNISTD_H @unistdh@ #define APR_HAVE_SHMEM_MMAP_TMP @havemmaptmp@ From 1cec98af6e423d3fb561bbe3045e12ae861788d7 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sun, 3 Feb 2002 20:30:57 +0000 Subject: [PATCH 2897/7878] don't complain about Debug/Release dirs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62902 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/.cvsignore b/test/.cvsignore index 4ca3a686f72..94f579eb8db 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -1,4 +1,6 @@ Makefile +Debug +Release *.lo *.swp .libs From 88fe6ab9a0471f7cc13f1740028cebd44197a608 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 4 Feb 2002 00:05:18 +0000 Subject: [PATCH 2898/7878] Rename the link options so we can standardize the name across our different *-config scripts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62903 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apr-config.in b/apr-config.in index edb5cc57ab9..6851efd530d 100644 --- a/apr-config.in +++ b/apr-config.in @@ -87,15 +87,15 @@ Known values for OPTION are: --ldflags print linker flags --libs print additional libraries to link against --srcdir print APR source directory - --apr-ld print link switch(es) for linking to APR - --apr-libtool print the libtool inputs for linking to APR + --link-ld print link switch(es) for linking to APR + --link-libtool print the libtool inputs for linking to APR --apr-la-file print the path to the .la file, if available --help print this help When linking with libtool, an application should do something like: - APR_LIBS="\`apr-config --apr-libtool --libs\`" + APR_LIBS="\`apr-config --link-libtool --libs\`" or when linking directly: - APR_LIBS="\`apr-config --apr-ld --libs\`" + APR_LIBS="\`apr-config --link-ld --libs\`" An application should use the results of --cflags, --cppflags, --includes, and --ldflags in their build process. @@ -162,7 +162,7 @@ while test $# -gt 0; do --srcdir) echo $APR_SOURCE_DIR ;; - --apr-ld) + --link-ld) if test "$location" = "installed"; then ### avoid using -L if libdir is a "standard" location like /usr/lib echo "-L$libdir -lapr" @@ -170,7 +170,7 @@ while test $# -gt 0; do echo "-L$thisdir -lapr" fi ;; - --apr-libtool) + --link-libtool) if test -f "$LA_FILE"; then echo $LA_FILE elif test "$location" = "installed"; then From 5d259b95985b15df47a7c039c60d78264909662c Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 4 Feb 2002 01:05:17 +0000 Subject: [PATCH 2899/7878] fix detection of the "installed" case git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62904 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apr-config.in b/apr-config.in index 6851efd530d..065851058c9 100644 --- a/apr-config.in +++ b/apr-config.in @@ -109,7 +109,7 @@ fi thisdir="`dirname $0`" thisdir="`cd $thisdir && pwd`" -if test "$BINDIR" = "$thisdir"; then +if test "$bindir" = "$thisdir"; then location=installed elif test "$APR_SOURCE_DIR" = "$thisdir"; then location=source From ba48366e87d1c4bcd83191c9a99110152e0c56f7 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 4 Feb 2002 06:16:08 +0000 Subject: [PATCH 2900/7878] more DOxygenization of the file git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62905 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 262 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 242 insertions(+), 20 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 1b859a345ab..175cedce6b5 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -89,6 +89,7 @@ typedef int apr_status_t; APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); +#if defined(DOXYGEN) /** * @def APR_FROM_OS_ERROR(os_err_type syserr) * Fold a platform specific error into an apr_status_t code. @@ -97,6 +98,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * @warning macro implementation; the syserr argument may be evaluated * multiple times. */ +#define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) /** * @def APR_TO_OS_ERROR(apr_status_t statcode) @@ -107,6 +109,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * multiple times. If the statcode was not created by apr_get_os_error * or APR_FROM_OS_ERROR, the results are undefined. */ +#define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) /** * @def apr_get_os_error() @@ -117,6 +120,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * require the alternate apr_get_netos_error() to retrieve the last * socket error. */ +#define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) /** * Return the last socket error, folded into apr_status_t, on some platforms @@ -126,6 +130,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * as OS2) have no such mechanism, so this call may be unsupported. */ +#define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) /** * Reset the last platform error, unfolded from an apr_status_t, on some platforms * @param statcode The OS error folded in a prior call to APR_FROM_OS_ERROR() @@ -137,39 +142,43 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * with APR_TO_OS_ERROR. Some platforms (such as OS2) have no such * mechanism, so this call may be unsupported. */ - +#define apr_set_os_error() (APR_FROM_OS_ERROR(WSAGetLastError())) +#endif /** * APR_OS_START_ERROR is where the APR specific error values start. */ +#define APR_OS_START_ERROR 20000 /** * APR_OS_START_STATUS is where the APR specific status codes start. */ +#define APR_OS_START_STATUS (APR_OS_START_ERROR + 500) /** * APR_OS_START_USEERR are reserved for applications that use APR that * layer their own error codes along with APR's. */ +#define APR_OS_START_USEERR (APR_OS_START_STATUS + 500) /** * APR_OS_START_CANONERR is where APR versions of errno values are defined * on systems which don't have the corresponding errno. */ +#define APR_OS_START_CANONERR (APR_OS_START_USEERR + 500) /** * APR_OS_START_EAIERR folds EAI_ error codes from getaddrinfo() into * apr_status_t values. */ +#define APR_OS_START_EAIERR (APR_OS_START_CANONERR + 500) /** * APR_OS_START_SYSERR folds platform-specific system error values into * apr_status_t values. */ -#define APR_OS_START_ERROR 20000 -#define APR_OS_START_STATUS (APR_OS_START_ERROR + 500) -#define APR_OS_START_USEERR (APR_OS_START_STATUS + 500) -#define APR_OS_START_CANONERR (APR_OS_START_USEERR + 500) -#define APR_OS_START_EAIERR (APR_OS_START_CANONERR + 500) #define APR_OS_START_SYSERR (APR_OS_START_EAIERR + 500) +/** no error */ #define APR_SUCCESS 0 -/** +/* APR ERROR VALUES */ +/** + * @defgroup APRErrorValues Error Values *

        * APR ERROR VALUES
        * APR_ENOSTAT      APR was unable to perform a stat on the file 
      @@ -206,7 +215,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
        *                    of the input buffer.
        * APR_BADCH          Getopt found an option not in the option string
        * APR_BADARG         Getopt found an option that is missing an argument 
      - *                    and and argument was specified in the option string
      + *                    and an argument was specified in the option string
        * APR_EOF            APR has encountered the end of the file
        * APR_NOTFOUND       APR was unable to find the socket in the poll structure
        * APR_ANONYMOUS      APR is using anonymous shared memory
      @@ -224,194 +233,404 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
        * APR_EABOVEROOT     The given path was above the root path.
        * APR_EBUSY          The given lock was busy.
        * 
      - * - * @param status The APR_status code to check. - * @param statcode The apr status code to test. - * @deffunc int APR_STATUS_IS_status(apr_status_t statcode) - * @tip Warning: macro implementations; the statcode argument may be - * evaluated multiple times. To test for APR_EOF, always test - * APR_STATUS_IS_EOF(statcode) because platform-specific codes are - * not necessarily translated into the corresponding APR_Estatus code. + * @{ */ - -/* APR ERROR VALUES */ +/** @see APR_STATUS_IS_ENOSTAT */ #define APR_ENOSTAT (APR_OS_START_ERROR + 1) +/** @see APR_STATUS_IS_ENOPOOL */ #define APR_ENOPOOL (APR_OS_START_ERROR + 2) /* empty slot: +3 */ +/** @see APR_STATUS_IS_EBADDATE */ #define APR_EBADDATE (APR_OS_START_ERROR + 4) +/** @see APR_STATUS_IS_EINVALSOCK */ #define APR_EINVALSOCK (APR_OS_START_ERROR + 5) +/** @see APR_STATUS_IS_ENOPROC */ #define APR_ENOPROC (APR_OS_START_ERROR + 6) +/** @see APR_STATUS_IS_ENOTIME */ #define APR_ENOTIME (APR_OS_START_ERROR + 7) +/** @see APR_STATUS_IS_ENODIR */ #define APR_ENODIR (APR_OS_START_ERROR + 8) +/** @see APR_STATUS_IS_ENOLOCK */ #define APR_ENOLOCK (APR_OS_START_ERROR + 9) +/** @see APR_STATUS_IS_ENOPOLL */ #define APR_ENOPOLL (APR_OS_START_ERROR + 10) +/** @see APR_STATUS_IS_ENOSOCKET */ #define APR_ENOSOCKET (APR_OS_START_ERROR + 11) +/** @see APR_STATUS_IS_ENOTHREAD */ #define APR_ENOTHREAD (APR_OS_START_ERROR + 12) +/** @see APR_STATUS_IS_ENOTHDKEY */ #define APR_ENOTHDKEY (APR_OS_START_ERROR + 13) +/** @see APR_STATUS_IS_EGENERAL */ #define APR_EGENERAL (APR_OS_START_ERROR + 14) +/** @see APR_STATUS_IS_ENOSHMAVAIL */ #define APR_ENOSHMAVAIL (APR_OS_START_ERROR + 15) +/** @see APR_STATUS_IS_EBADIP */ #define APR_EBADIP (APR_OS_START_ERROR + 16) +/** @see APR_STATUS_IS_EBADMASK */ #define APR_EBADMASK (APR_OS_START_ERROR + 17) /* empty slot: +18 */ +/** @see APR_STATUS_IS_EDSOPEN */ #define APR_EDSOOPEN (APR_OS_START_ERROR + 19) +/** @see APR_STATUS_IS_EABSOLUTE */ #define APR_EABSOLUTE (APR_OS_START_ERROR + 20) +/** @see APR_STATUS_IS_ERELATIVE */ #define APR_ERELATIVE (APR_OS_START_ERROR + 21) +/** @see APR_STATUS_IS_EINCOMPLETE */ #define APR_EINCOMPLETE (APR_OS_START_ERROR + 22) +/** @see APR_STATUS_IS_EABOVEROOT */ #define APR_EABOVEROOT (APR_OS_START_ERROR + 23) +/** @see APR_STATUS_IS_EBADPATH */ #define APR_EBADPATH (APR_OS_START_ERROR + 24) /* APR ERROR VALUE TESTS */ +/** + * APR was unable to perform a stat on the file + * @warning always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_ENOSTAT(s) ((s) == APR_ENOSTAT) +/** + * APR was not provided a pool with which to allocate memory + * @warning always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_ENOPOOL(s) ((s) == APR_ENOPOOL) +/** APR was given an invalid date */ #define APR_STATUS_IS_EBADDATE(s) ((s) == APR_EBADDATE) +/** APR was given an invalid socket */ #define APR_STATUS_IS_EINVALSOCK(s) ((s) == APR_EINVALSOCK) +/** APR was not given a process structure */ #define APR_STATUS_IS_ENOPROC(s) ((s) == APR_ENOPROC) +/** APR was not given a time structure */ #define APR_STATUS_IS_ENOTIME(s) ((s) == APR_ENOTIME) +/** APR was not given a directory structure */ #define APR_STATUS_IS_ENODIR(s) ((s) == APR_ENODIR) +/** APR was not given a lock structure */ #define APR_STATUS_IS_ENOLOCK(s) ((s) == APR_ENOLOCK) +/** APR was not given a poll structure */ #define APR_STATUS_IS_ENOPOLL(s) ((s) == APR_ENOPOLL) +/** APR was not given a socket */ #define APR_STATUS_IS_ENOSOCKET(s) ((s) == APR_ENOSOCKET) +/** APR was not given a thread structure */ #define APR_STATUS_IS_ENOTHREAD(s) ((s) == APR_ENOTHREAD) +/** APR was not given a thread key structure */ #define APR_STATUS_IS_ENOTHDKEY(s) ((s) == APR_ENOTHDKEY) +/** Generic Error which can not be put into another spot */ #define APR_STATUS_IS_EGENERAL(s) ((s) == APR_EGENERAL) +/** There is no more shared memory available */ #define APR_STATUS_IS_ENOSHMAVAIL(s) ((s) == APR_ENOSHMAVAIL) +/** The specified IP address is invalid */ #define APR_STATUS_IS_EBADIP(s) ((s) == APR_EBADIP) +/** The specified netmask is invalid */ #define APR_STATUS_IS_EBADMASK(s) ((s) == APR_EBADMASK) /* empty slot: +18 */ +/** + * APR was unable to open the dso object. + * For more information call apr_dso_error(). + */ #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN) +/** The given path was absolute. */ #define APR_STATUS_IS_EABSOLUTE(s) ((s) == APR_EABSOLUTE) +/** The given path was relative. */ #define APR_STATUS_IS_ERELATIVE(s) ((s) == APR_ERELATIVE) +/** The given path was neither relative nor absolute. */ #define APR_STATUS_IS_EINCOMPLETE(s) ((s) == APR_EINCOMPLETE) +/** The given path was above the root path. */ #define APR_STATUS_IS_EABOVEROOT(s) ((s) == APR_EABOVEROOT) +/** The given path was bad. */ #define APR_STATUS_IS_EBADPATH(s) ((s) == APR_EBADPATH) /* APR STATUS VALUES */ +/** @see APR_STATUS_IS_INCHILD */ #define APR_INCHILD (APR_OS_START_STATUS + 1) +/** @see APR_STATUS_IS_INPARENT */ #define APR_INPARENT (APR_OS_START_STATUS + 2) +/** @see APR_STATUS_IS_DETACH */ #define APR_DETACH (APR_OS_START_STATUS + 3) +/** @see APR_STATUS_IS_NOTDETACH */ #define APR_NOTDETACH (APR_OS_START_STATUS + 4) +/** @see APR_STATUS_IS_CHILD_DONE */ #define APR_CHILD_DONE (APR_OS_START_STATUS + 5) +/** @see APR_STATUS_IS_CHILD_NOTDONE */ #define APR_CHILD_NOTDONE (APR_OS_START_STATUS + 6) +/** @see APR_STATUS_IS_TIMEUP */ #define APR_TIMEUP (APR_OS_START_STATUS + 7) +/** @see APR_STATUS_IS_INCOMPLETE */ #define APR_INCOMPLETE (APR_OS_START_STATUS + 8) /* empty slot: +9 */ /* empty slot: +10 */ /* empty slot: +11 */ +/** @see APR_STATUS_IS_BADCH */ #define APR_BADCH (APR_OS_START_STATUS + 12) +/** @see APR_STATUS_IS_BADARG */ #define APR_BADARG (APR_OS_START_STATUS + 13) +/** @see APR_STATUS_IS_EOF */ #define APR_EOF (APR_OS_START_STATUS + 14) +/** @see APR_STATUS_IS_NOTFOUND */ #define APR_NOTFOUND (APR_OS_START_STATUS + 15) /* empty slot: +16 */ /* empty slot: +17 */ /* empty slot: +18 */ +/** @see APR_STATUS_IS_ANONYMOUS */ #define APR_ANONYMOUS (APR_OS_START_STATUS + 19) +/** @see APR_STATUS_IS_FILEBASED */ #define APR_FILEBASED (APR_OS_START_STATUS + 20) +/** @see APR_STATUS_IS_KEYBASED */ #define APR_KEYBASED (APR_OS_START_STATUS + 21) +/** @see APR_STATUS_IS_EINIT */ #define APR_EINIT (APR_OS_START_STATUS + 22) +/** @see APR_STATUS_IS_ENOTIMPL */ #define APR_ENOTIMPL (APR_OS_START_STATUS + 23) +/** @see APR_STATUS_IS_EMISMATCH */ #define APR_EMISMATCH (APR_OS_START_STATUS + 24) +/** @see APR_STATUS_IS_EBUSY */ #define APR_EBUSY (APR_OS_START_STATUS + 25) -/* APR STATUS VALUE TESTS */ +/** + * @defgroup aprerr_status Status Value Tests + * @{ + */ +/** + * @param status The APR_status code to check. + * @param statcode The apr status code to test. + * @tip Warning: macro implementations; the statcode argument may be + * evaluated multiple times. To test for APR_EOF, always test + * APR_STATUS_IS_EOF(statcode) because platform-specific codes are + * not necessarily translated into the corresponding APR_Estatus code. + */ +/** + * Program is currently executing in the child + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code */ #define APR_STATUS_IS_INCHILD(s) ((s) == APR_INCHILD) +/** + * Program is currently executing in the parent + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_INPARENT(s) ((s) == APR_INPARENT) +/** + * The thread is detached + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_DETACH(s) ((s) == APR_DETACH) +/** + * The thread is not detached + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_NOTDETACH(s) ((s) == APR_NOTDETACH) +/** + * The child has finished executing + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_CHILD_DONE(s) ((s) == APR_CHILD_DONE) +/** + * The child has not finished executing + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_CHILD_NOTDONE(s) ((s) == APR_CHILD_NOTDONE) +/** + * The operation did not finish before the timeout + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP) +/** + * The character conversion stopped because of an incomplete character or + * shift sequence at the end of the input buffer. + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_INCOMPLETE(s) ((s) == APR_INCOMPLETE) /* empty slot: +9 */ /* empty slot: +10 */ /* empty slot: +11 */ +/** + * Getopt found an option not in the option string + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_BADCH(s) ((s) == APR_BADCH) +/** + * Getopt found an option not in the option string and an argument was + * specified in the option string + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_BADARG(s) ((s) == APR_BADARG) +/** + * APR has encountered the end of the file + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_EOF(s) ((s) == APR_EOF) +/** + * APR was unable to find the socket in the poll structure + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_NOTFOUND(s) ((s) == APR_NOTFOUND) /* empty slot: +16 */ /* empty slot: +17 */ /* empty slot: +18 */ +/** + * APR is using anonymous shared memory + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_ANONYMOUS(s) ((s) == APR_ANONYMOUS) +/** + * APR is using a file name as the key to the shared memory + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_FILEBASED(s) ((s) == APR_FILEBASED) +/** + * APR is using a shared key as the key to the shared memory + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_KEYBASED(s) ((s) == APR_KEYBASED) +/** + * Ininitalizer value. If no option has been found, but + * the status variable requires a value, this should be used + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_EINIT(s) ((s) == APR_EINIT) +/** + * The APR function has not been implemented on this + * platform, either because nobody has gotten to it yet, + * or the function is impossible on this platform. + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_ENOTIMPL(s) ((s) == APR_ENOTIMPL) +/** + * Two passwords do not match. + * @warning + * always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_EMISMATCH(s) ((s) == APR_EMISMATCH) +/** + * The given lock was busy + * @warning always use this test, as platform-specific variances may meet this + * more than one error code + */ #define APR_STATUS_IS_EBUSY(s) ((s) == APR_EBUSY) - +/** @} */ +/** + * @defgroup aprerrcanonical APR Canonical Error Values + * @{ + */ /* APR CANONICAL ERROR VALUES */ +/** permission denied */ #ifdef EACCES #define APR_EACCES EACCES #else #define APR_EACCES (APR_OS_START_CANONERR + 1) #endif +/** file exists */ #ifdef EEXIST #define APR_EEXIST EEXIST #else #define APR_EEXIST (APR_OS_START_CANONERR + 2) #endif +/** path name is too long */ #ifdef ENAMETOOLONG #define APR_ENAMETOOLONG ENAMETOOLONG #else #define APR_ENAMETOOLONG (APR_OS_START_CANONERR + 3) #endif +/** no such file or directory */ #ifdef ENOENT #define APR_ENOENT ENOENT #else #define APR_ENOENT (APR_OS_START_CANONERR + 4) #endif +/** not a directory */ #ifdef ENOTDIR #define APR_ENOTDIR ENOTDIR #else #define APR_ENOTDIR (APR_OS_START_CANONERR + 5) #endif +/** no space left on device */ #ifdef ENOSPC #define APR_ENOSPC ENOSPC #else #define APR_ENOSPC (APR_OS_START_CANONERR + 6) #endif +/** not enough memory */ #ifdef ENOMEM #define APR_ENOMEM ENOMEM #else #define APR_ENOMEM (APR_OS_START_CANONERR + 7) #endif +/** too many open files */ #ifdef EMFILE #define APR_EMFILE EMFILE #else #define APR_EMFILE (APR_OS_START_CANONERR + 8) #endif +/** file table overflow */ #ifdef ENFILE #define APR_ENFILE ENFILE #else #define APR_ENFILE (APR_OS_START_CANONERR + 9) #endif +/** bad file # */ #ifdef EBADF #define APR_EBADF EBADF #else #define APR_EBADF (APR_OS_START_CANONERR + 10) #endif +/** invalid argument */ #ifdef EINVAL #define APR_EINVAL EINVAL #else #define APR_EINVAL (APR_OS_START_CANONERR + 11) #endif +/** illegal seek */ #ifdef ESPIPE #define APR_ESPIPE ESPIPE #else #define APR_ESPIPE (APR_OS_START_CANONERR + 12) #endif +/** operation would block */ #ifdef EAGAIN #define APR_EAGAIN EAGAIN #elif defined(EWOULDBLOCK) @@ -420,6 +639,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_EAGAIN (APR_OS_START_CANONERR + 13) #endif +/** interrupted system call */ #ifdef EINTR #define APR_EINTR EINTR #else @@ -498,6 +718,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_ENOTEMPTY (APR_OS_START_CANONERR + 26) #endif +/** @} */ +/** @} */ #if defined(OS2) #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) From 692def0d5664cd7a6fb3cc9936ca795a9b39be1a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 4 Feb 2002 18:54:00 +0000 Subject: [PATCH 2901/7878] A slighly more inventive method of cleaning up abs paths from .mak files I worked up before the machines went down [yup - data is recovered.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62906 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl index c3f6acf86b8..fa2d1b4ebdb 100644 --- a/build/fixwin32mak.pl +++ b/build/fixwin32mak.pl @@ -12,28 +12,36 @@ $root = cwd; # ignore our own direcory (allowing us to move into any parallel tree) -$root =~ s|^.:(.*)/.*?$|cd "$1|; +$root =~ s|^.:(.*)?$|cd "$1|; $root =~ s|/|\\\\|g; print "Testing " . $root . "\n"; find(\&fixcwd, '.'); sub fixcwd { if (m|.mak$|) { -# note repl is broken... isn't freindly to directories with periods. - $repl = $File::Find::dir; -# replace ./ with the parent (moving into any parallel tree) - $repl =~ s|^\./|../|; -# replace each directory in this path with .. to get back to our root - $repl =~ s|[^/]+|..|g; - $repl =~ s|/|\\|; + $thisroot = $File::Find::dir; + $thisroot =~ s|^./(.*)$|$1|; + $thisroot =~ s|/|\\\\|g; + $thisroot = $root . "\\\\" . $thisroot; $oname = $_; $tname = '.#' . $_; $verchg = 0; -print "Processing " . $_ . "\n"; +#print "Processing " . $thisroot . " of " . $_ . "\n"; $srcfl = new IO::File $_, "r" || die; $dstfl = new IO::File $tname, "w" || die; while ($src = <$srcfl>) { - if ($src =~ s|^(\s*)$root|$1cd "$repl|) { + if ($src =~ m|^\s*($root[^\"]*)\".*$|) { +#print "Found " . $1 . "\"\n"; + $orig = $thisroot; + $repl = "cd \"."; + while (!($src =~ s|$orig|$repl|)) { +#print "Tried replacing " . $orig . " with " . $repl . "\n"; + if (!($orig =~ s|^(.*)\\\\[^\\]+$|$1|)) { + break; + } + $repl .= "\\.."; + } +#print "Replaced " . $orig . " with " . $repl . "\n"; $verchg = -1; } print $dstfl $src; From 2f6fded6a9c22c68e8515ee3bf2ba3ccbae7f343 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 4 Feb 2002 19:07:46 +0000 Subject: [PATCH 2902/7878] all the errors are now Doxygenized git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62907 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 82 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 65 insertions(+), 17 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 175cedce6b5..f8c47479c7d 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -173,7 +173,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, */ #define APR_OS_START_SYSERR (APR_OS_START_EAIERR + 500) -/** no error */ +/** no error. @see APR_STATUS_IS_SUCCESS */ #define APR_SUCCESS 0 /* APR ERROR VALUES */ @@ -542,95 +542,98 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_EBUSY(s) ((s) == APR_EBUSY) /** @} */ /** - * @defgroup aprerrcanonical APR Canonical Error Values + * @defgroup aprerrcanonical Canonical Errors * @{ */ /* APR CANONICAL ERROR VALUES */ -/** permission denied */ +/** @see APR_STATUS_IS_EACCES */ #ifdef EACCES #define APR_EACCES EACCES #else #define APR_EACCES (APR_OS_START_CANONERR + 1) #endif -/** file exists */ +/** @see APR_STATUS_IS_EXIST */ #ifdef EEXIST #define APR_EEXIST EEXIST #else #define APR_EEXIST (APR_OS_START_CANONERR + 2) #endif -/** path name is too long */ +/** @see APR_STATUS_IS_ENAMETOOLONG */ #ifdef ENAMETOOLONG #define APR_ENAMETOOLONG ENAMETOOLONG #else #define APR_ENAMETOOLONG (APR_OS_START_CANONERR + 3) #endif -/** no such file or directory */ +/** @see APR_STATUS_IS_ENOENT */ #ifdef ENOENT #define APR_ENOENT ENOENT #else #define APR_ENOENT (APR_OS_START_CANONERR + 4) #endif -/** not a directory */ +/** @see APR_STATUS_IS_ENOTDIR */ #ifdef ENOTDIR #define APR_ENOTDIR ENOTDIR #else #define APR_ENOTDIR (APR_OS_START_CANONERR + 5) #endif -/** no space left on device */ +/** @see APR_STATUS_IS_ENOSPC */ #ifdef ENOSPC #define APR_ENOSPC ENOSPC #else #define APR_ENOSPC (APR_OS_START_CANONERR + 6) #endif -/** not enough memory */ +/** @see APR_STATUS_IS_ENOMEM */ #ifdef ENOMEM #define APR_ENOMEM ENOMEM #else #define APR_ENOMEM (APR_OS_START_CANONERR + 7) #endif -/** too many open files */ +/** @see APR_STATUS_IS_EMFILE */ #ifdef EMFILE #define APR_EMFILE EMFILE #else #define APR_EMFILE (APR_OS_START_CANONERR + 8) #endif -/** file table overflow */ +/** @see APR_STATUS_IS_ENFILE */ #ifdef ENFILE #define APR_ENFILE ENFILE #else #define APR_ENFILE (APR_OS_START_CANONERR + 9) #endif -/** bad file # */ +/** @see APR_STATUS_IS_EBADF */ #ifdef EBADF #define APR_EBADF EBADF #else #define APR_EBADF (APR_OS_START_CANONERR + 10) #endif -/** invalid argument */ +/** @see APR_STATUS_IS_EINVAL */ #ifdef EINVAL #define APR_EINVAL EINVAL #else #define APR_EINVAL (APR_OS_START_CANONERR + 11) #endif -/** illegal seek */ +/** @see APR_STATUS_IS_ESPIPE */ #ifdef ESPIPE #define APR_ESPIPE ESPIPE #else #define APR_ESPIPE (APR_OS_START_CANONERR + 12) #endif -/** operation would block */ +/** + * @see APR_STATUS_IS_EAGAIN + * @warning use APR_STATUS_IS_EAGAIN instead of just testing this value + */ #ifdef EAGAIN #define APR_EAGAIN EAGAIN #elif defined(EWOULDBLOCK) @@ -639,79 +642,95 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_EAGAIN (APR_OS_START_CANONERR + 13) #endif -/** interrupted system call */ +/** @see APR_STATUS_IS_EINTR */ #ifdef EINTR #define APR_EINTR EINTR #else #define APR_EINTR (APR_OS_START_CANONERR + 14) #endif +/** @see APR_STATUS_IS_ENOTSOCK */ #ifdef ENOTSOCK #define APR_ENOTSOCK ENOTSOCK #else #define APR_ENOTSOCK (APR_OS_START_CANONERR + 15) #endif +/** @see APR_STATUS_IS_ECONNREFUSED */ #ifdef ECONNREFUSED #define APR_ECONNREFUSED ECONNREFUSED #else #define APR_ECONNREFUSED (APR_OS_START_CANONERR + 16) #endif +/** @see APR_STATUS_IS_EINPROGRESS */ #ifdef EINPROGRESS #define APR_EINPROGRESS EINPROGRESS #else #define APR_EINPROGRESS (APR_OS_START_CANONERR + 17) #endif +/** + * @see APR_STATUS_IS_ECONNABORTED + * @warning use APR_STATUS_IS_ECONNABORTED instead of just testing this value + */ + #ifdef ECONNABORTED #define APR_ECONNABORTED ECONNABORTED #else #define APR_ECONNABORTED (APR_OS_START_CANONERR + 18) #endif +/** @see APR_STATUS_IS_ECONNRESET */ #ifdef ECONNRESET #define APR_ECONNRESET ECONNRESET #else #define APR_ECONNRESET (APR_OS_START_CANONERR + 19) #endif +/** @see APR_STATUS_IS_ETIMEDOUT */ #ifdef ETIMEDOUT #define APR_ETIMEDOUT ETIMEDOUT #else #define APR_ETIMEDOUT (APR_OS_START_CANONERR + 20) #endif +/** @see APR_STATUS_IS_EHOSTUNREACH */ #ifdef EHOSTUNREACH #define APR_EHOSTUNREACH EHOSTUNREACH #else #define APR_EHOSTUNREACH (APR_OS_START_CANONERR + 21) #endif +/** @see APR_STATUS_IS_ENETUNREACH */ #ifdef ENETUNREACH #define APR_ENETUNREACH ENETUNREACH #else #define APR_ENETUNREACH (APR_OS_START_CANONERR + 22) #endif +/** @see APR_STATUS_IS_EFTYPE */ #ifdef EFTYPE #define APR_EFTYPE EFTYPE #else #define APR_EFTYPE (APR_OS_START_CANONERR + 23) #endif +/** @see APR_STATUS_IS_EPIPE */ #ifdef EPIPE #define APR_EPIPE EPIPE #else #define APR_EPIPE (APR_OS_START_CANONERR + 24) #endif +/** @see APR_STATUS_IS_EXDEV */ #ifdef EXDEV #define APR_EXDEV EXDEV #else #define APR_EXDEV (APR_OS_START_CANONERR + 25) #endif +/** @see APR_STATUS_IS_ENOTEMPTY */ #ifdef ENOTEMPTY #define APR_ENOTEMPTY ENOTEMPTY #else @@ -1069,22 +1088,36 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + WSAENETUNREACH) #endif +/** no error */ #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) /* APR CANONICAL ERROR TESTS */ +/** permission denied */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) +/** file exists */ #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) +/** path name is too long */ #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG) +/** no such file or directory */ #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT) +/** not a directory */ #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) +/** no space left on device */ #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC) +/** not enough memory */ #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) +/** too many open files */ #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE) +/** file table overflow */ #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) +/** bad file # */ #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF) +/** invalid argument */ #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL) +/** illegal seek */ #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE) +/** operation would block */ #if !defined(EWOULDBLOCK) || !defined(EAGAIN) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) #elif (EWOULDBLOCK == EAGAIN) @@ -1094,12 +1127,19 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == EWOULDBLOCK) #endif +/** interrupted system call */ #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR) +/** socket operation on a non-socket */ #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK) +/** Connection Refused */ #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED) +/** operation now in progress */ #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS) -/* EPROTO on certain older kernels really means ECONNABORTED, so we need to +/** + * Software caused connection abort + * @remark + * EPROTO on certain older kernels really means ECONNABORTED, so we need to * ignore it for them. See discussion in new-httpd archives nh.9701 & nh.9603 * * There is potentially a bug in Solaris 2.x x<6, and other boxes that @@ -1114,13 +1154,21 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED) #endif +/** Connection Reset by peer */ #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET) +/** Operation timed out */ #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT) +/** no route to host */ #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH) +/** network is unreachable */ #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH) +/** inappropiate file type or format */ #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) +/** broken pipe */ #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE) +/** cross device link */ #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV) +/** Directory Not Empty */ #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY) #endif /* !def OS2 || WIN32 */ From ed5d32b055687d5b1c2c7ddb81e46a35ea8a0b71 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 4 Feb 2002 19:10:20 +0000 Subject: [PATCH 2903/7878] document ino_t & dev_t for Doxygen PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62908 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 42f123b28f7..073fdc94a2b 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -132,11 +132,14 @@ typedef apr_int32_t apr_fileperms_t; typedef apr_uint64_t apr_ino_t; /** * Structure for determining the device the file is on. - * @defvar apr_dev_t */ typedef apr_uint32_t apr_dev_t; #else +/** The inode of the file. */ typedef ino_t apr_ino_t; +/** + * Structure for determining the device the file is on. + */ typedef dev_t apr_dev_t; #endif From 91c893094538d9e05ef25e3a30c72c76c1aba56d Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Mon, 4 Feb 2002 19:15:20 +0000 Subject: [PATCH 2904/7878] The major parts of the new lock API are complete, AFAICT. Move the less critical (or perhaps not implementable) pieces down to non-showstopper status. Left a note that we must not make a release of APR with both lock APIs, or we may have to support both lock APIs forever, which would be unfortunate. Also, it appears that Beos' apr_thread_cond now works, thanks to David. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62909 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/STATUS b/STATUS index 1993c5259e9..a034ff57890 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/01/29 16:10:14 $] +Last modified at [$Date: 2002/02/04 19:15:20 $] Release: @@ -32,12 +32,15 @@ RELEASE SHOWSTOPPERS: since apr_proc_create didn't allocate the apr_proc_t storage. (Aren't transparent types swell?) Suggestions? + * The new lock API is a full replacement for the old API. Before + we do a major APR release, we must deprecate the old locks API, + lest we support 2 lock APIs in perpetuity. + +RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * The new lock API is a full replacement for the old API, but is not yet complete on all platforms. Components that are incomplete or missing include: - Beos: apr_thread_cond_*() - Initial code committed. Aaron has some concerns, David agrees - and will find time to address the issues. Netware: apr_proc_mutex_*() (Is proc_mutex unnecessary on Netware?) OS/2: apr_thread_cond_*(), apr_proc_mutex_*() @@ -48,8 +51,6 @@ RELEASE SHOWSTOPPERS: Win32: apr_thread_rwlock_try*lock(), apr_thread_cond_timedwait(), apr_proc_mutex_*() (Is proc_mutex unnecessary on Win32?) -RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: - * Need to contemplate apr_strftime... platforms vary. OtherBill suggested this solution (but has no time to implement): Document our list of 'supported' escapes. From e5f567bcad54d04b4650a9a0b689e9f19e846117 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 4 Feb 2002 19:21:17 +0000 Subject: [PATCH 2905/7878] In the Linux apr_sendfile(), fix the types of some parameters to apr_send() and apr_recv(). Breakage was seen in 64-bit mode on s/390. PR: 9712 Submitted by: Neale.Ferguson@SoftwareAG-usa.coom Reviewed by: Jeff Trawick, who added the fix to the apr_send() parameter git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62910 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ network_io/unix/sendrecv.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 5bfee3e332a..5715364ff9d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) In the Linux apr_sendfile(), fix the types of some parameters + to apr_send() and apr_recv(). Breakage was seen in 64-bit mode + on s/390. [Neale.Ferguson@SoftwareAG-usa.coom] + *) added APR_PROGRAM_ENV and APR_PROGRAM_PATH options for starting processes via apr_proc_create() [Greg Stein] diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index a0f617e9a20..baf994cf8d6 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -293,7 +293,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, flags = 0; if (hdtr->numheaders > 0) { - apr_int32_t hdrbytes; + apr_size_t hdrbytes; /* cork before writing headers */ rv = apr_setsocketopt(sock, APR_TCP_NOPUSH, 1); @@ -369,7 +369,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, /* Now write the footers */ if (hdtr->numtrailers > 0) { - apr_int32_t trbytes; + apr_size_t trbytes; arv = apr_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trbytes); nbytes += trbytes; if (arv != APR_SUCCESS) { From 6d45461dba82cf9d06059ebdfedda5df9731a51f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 4 Feb 2002 19:33:38 +0000 Subject: [PATCH 2906/7878] Fix a few attempts to add to a void *ptr in the Unix shared memory code. PR: 9710 Submitted by: Per Ekman [pek@pdc.kth.se] Reviewed by: Jeff Trawick, who expanded Per's fix to a couple of more places (so all breakage is mine :) ) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62911 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++++- shmem/unix/shm.c | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 5715364ff9d..2365c66568c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,11 @@ Changes with APR b1 + *) Fix a few attempts to add to a void * ptr in the Unix shared + memory support code. PR #9710 Per Ekman [pek@pdc.kth.se] + *) In the Linux apr_sendfile(), fix the types of some parameters to apr_send() and apr_recv(). Breakage was seen in 64-bit mode - on s/390. [Neale.Ferguson@SoftwareAG-usa.coom] + on s/390. PR #9712 [Neale.Ferguson@SoftwareAG-usa.coom] *) added APR_PROGRAM_ENV and APR_PROGRAM_PATH options for starting processes via apr_proc_create() [Greg Stein] diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 7a2dd9cf308..284622f27c7 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -189,7 +189,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* store the real size in the metadata */ *(apr_size_t*)(new_m->base) = new_m->realsize; /* metadata isn't usable */ - new_m->usable = new_m->base + sizeof(apr_size_t); + new_m->usable = (char *)new_m->base + sizeof(apr_size_t); apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, apr_pool_cleanup_null); @@ -345,7 +345,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* store the real size in the metadata */ *(apr_size_t*)(new_m->base) = new_m->realsize; /* metadata isn't usable */ - new_m->usable = new_m->base + sizeof(apr_size_t); + new_m->usable = (char *)new_m->base + sizeof(apr_size_t); apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, apr_pool_cleanup_null); @@ -508,7 +508,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, } /* metadata isn't part of the usable segment */ - new_m->usable = new_m->base + sizeof(apr_size_t); + new_m->usable = (char *)new_m->base + sizeof(apr_size_t); apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_attach, apr_pool_cleanup_null); From 91fb55192691445380a5198388fb926c1e3c2679 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Tue, 5 Feb 2002 04:32:52 +0000 Subject: [PATCH 2907/7878] not allocating memory for the metadata.. Thanks Jin. Submitted by: Jin Hong git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62912 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 284622f27c7..54310a8b70d 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -197,7 +197,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return APR_SUCCESS; #elif APR_USE_SHMEM_MMAP_ANON - new_m->base = mmap(NULL, reqsize, PROT_READ|PROT_WRITE, + new_m->base = mmap(NULL, new_m->realsize, PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0); if (new_m->base == MAP_FAILED) { return errno; From 097c4d2f285d5f3c666fa3e61834bb8664a39946 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 5 Feb 2002 05:56:01 +0000 Subject: [PATCH 2908/7878] Style changes - tabs to spaces primarily. No functional changes. (This file is a stylistic nightmare to read. We're seeing an OS/X stack smash with SVN. We need a reformat so we can understand it.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62913 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 1362 ++++++++++++++++++++-------------------- 1 file changed, 683 insertions(+), 679 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 2973191bfc5..733d4dbf77c 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -87,13 +87,13 @@ typedef enum { } boolean_e; #ifndef FALSE -#define FALSE 0 +#define FALSE 0 #endif #ifndef TRUE -#define TRUE 1 +#define TRUE 1 #endif -#define NUL '\0' -#define WIDE_INT long +#define NUL '\0' +#define WIDE_INT long typedef WIDE_INT wide_int; typedef unsigned WIDE_INT u_wide_int; @@ -106,18 +106,18 @@ typedef apr_uint64_t u_widest_int; #endif typedef int bool_int; -#define S_NULL "(null)" -#define S_NULL_LEN 6 +#define S_NULL "(null)" +#define S_NULL_LEN 6 -#define FLOAT_DIGITS 6 -#define EXPONENT_LENGTH 10 +#define FLOAT_DIGITS 6 +#define EXPONENT_LENGTH 10 /* * NUM_BUF_SIZE is the size of the buffer used for arithmetic conversions * * XXX: this is a magic number; do not decrease it */ -#define NUM_BUF_SIZE 512 +#define NUM_BUF_SIZE 512 /* * cvt.c - IEEE floating point formatting routines for FreeBSD @@ -131,7 +131,7 @@ typedef int bool_int; * sign is set to 0 for positive, 1 for negative */ -#define NDIG 80 +#define NDIG 80 /* buf must have at least NDIG bytes */ static char *apr_cvt(double arg, int ndigits, int *decpt, int *sign, @@ -142,13 +142,13 @@ static char *apr_cvt(double arg, int ndigits, int *decpt, int *sign, register char *p, *p1; if (ndigits >= NDIG - 1) - ndigits = NDIG - 2; + ndigits = NDIG - 2; r2 = 0; *sign = 0; p = &buf[0]; if (arg < 0) { - *sign = 1; - arg = -arg; + *sign = 1; + arg = -arg; } arg = modf(arg, &fi); p1 = &buf[NDIG]; @@ -156,53 +156,53 @@ static char *apr_cvt(double arg, int ndigits, int *decpt, int *sign, * Do integer part */ if (fi != 0) { - p1 = &buf[NDIG]; - while (p1 > &buf[0] && fi != 0) { - fj = modf(fi / 10, &fi); - *--p1 = (int) ((fj + .03) * 10) + '0'; - r2++; - } - while (p1 < &buf[NDIG]) - *p++ = *p1++; + p1 = &buf[NDIG]; + while (p1 > &buf[0] && fi != 0) { + fj = modf(fi / 10, &fi); + *--p1 = (int) ((fj + .03) * 10) + '0'; + r2++; + } + while (p1 < &buf[NDIG]) + *p++ = *p1++; } else if (arg > 0) { - while ((fj = arg * 10) < 1) { - arg = fj; - r2--; - } + while ((fj = arg * 10) < 1) { + arg = fj; + r2--; + } } p1 = &buf[ndigits]; if (eflag == 0) - p1 += r2; + p1 += r2; *decpt = r2; if (p1 < &buf[0]) { - buf[0] = '\0'; - return (buf); + buf[0] = '\0'; + return (buf); } while (p <= p1 && p < &buf[NDIG]) { - arg *= 10; - arg = modf(arg, &fj); - *p++ = (int) fj + '0'; + arg *= 10; + arg = modf(arg, &fj); + *p++ = (int) fj + '0'; } if (p1 >= &buf[NDIG]) { - buf[NDIG - 1] = '\0'; - return (buf); + buf[NDIG - 1] = '\0'; + return (buf); } p = p1; *p1 += 5; while (*p1 > '9') { - *p1 = '0'; - if (p1 > buf) - ++ * --p1; - else { - *p1 = '1'; - (*decpt)++; - if (eflag == 0) { - if (p > buf) - *p = '0'; - p++; - } - } + *p1 = '0'; + if (p1 > buf) + ++ * --p1; + else { + *p1 = '1'; + (*decpt)++; + if (eflag == 0) { + if (p > buf) + *p = '0'; + p++; + } + } } *p = '\0'; return (buf); @@ -233,51 +233,51 @@ static char *apr_gcvt(double number, int ndigit, char *buf, boolean_e altform) p1 = apr_ecvt(number, ndigit, &decpt, &sign, buf1); p2 = buf; if (sign) - *p2++ = '-'; + *p2++ = '-'; for (i = ndigit - 1; i > 0 && p1[i] == '0'; i--) - ndigit--; + ndigit--; if ((decpt >= 0 && decpt - ndigit > 4) - || (decpt < 0 && decpt < -3)) { /* use E-style */ - decpt--; - *p2++ = *p1++; - *p2++ = '.'; - for (i = 1; i < ndigit; i++) - *p2++ = *p1++; - *p2++ = 'e'; - if (decpt < 0) { - decpt = -decpt; - *p2++ = '-'; - } - else - *p2++ = '+'; - if (decpt / 100 > 0) - *p2++ = decpt / 100 + '0'; - if (decpt / 10 > 0) - *p2++ = (decpt % 100) / 10 + '0'; - *p2++ = decpt % 10 + '0'; + || (decpt < 0 && decpt < -3)) { /* use E-style */ + decpt--; + *p2++ = *p1++; + *p2++ = '.'; + for (i = 1; i < ndigit; i++) + *p2++ = *p1++; + *p2++ = 'e'; + if (decpt < 0) { + decpt = -decpt; + *p2++ = '-'; + } + else + *p2++ = '+'; + if (decpt / 100 > 0) + *p2++ = decpt / 100 + '0'; + if (decpt / 10 > 0) + *p2++ = (decpt % 100) / 10 + '0'; + *p2++ = decpt % 10 + '0'; } else { - if (decpt <= 0) { - if (*p1 != '0') - *p2++ = '.'; - while (decpt < 0) { - decpt++; - *p2++ = '0'; - } - } - for (i = 1; i <= ndigit; i++) { - *p2++ = *p1++; - if (i == decpt) - *p2++ = '.'; - } - if (ndigit < decpt) { - while (ndigit++ < decpt) - *p2++ = '0'; - *p2++ = '.'; - } + if (decpt <= 0) { + if (*p1 != '0') + *p2++ = '.'; + while (decpt < 0) { + decpt++; + *p2++ = '0'; + } + } + for (i = 1; i <= ndigit; i++) { + *p2++ = *p1++; + if (i == decpt) + *p2++ = '.'; + } + if (ndigit < decpt) { + while (ndigit++ < decpt) + *p2++ = '0'; + *p2++ = '.'; + } } if (p2[-1] == '.' && !altform) - p2--; + p2--; *p2 = '\0'; return (buf); } @@ -292,27 +292,27 @@ static char *apr_gcvt(double number, int ndigit, char *buf, boolean_e altform) * * NOTE: Evaluation of the c argument should not have any side-effects */ -#define INS_CHAR(c, sp, bep, cc) \ - { \ - if (sp >= bep) { \ - vbuff->curpos = sp; \ - if (flush_func(vbuff)) \ - return -1; \ - sp = vbuff->curpos; \ - bep = vbuff->endpos; \ - } \ - *sp++ = (c); \ - cc++; \ - } - -#define NUM( c ) ( c - '0' ) - -#define STR_TO_DEC( str, num ) \ - num = NUM( *str++ ) ; \ - while ( apr_isdigit( *str ) ) \ - { \ - num *= 10 ; \ - num += NUM( *str++ ) ; \ +#define INS_CHAR(c, sp, bep, cc) \ +{ \ + if (sp >= bep) { \ + vbuff->curpos = sp; \ + if (flush_func(vbuff)) \ + return -1; \ + sp = vbuff->curpos; \ + bep = vbuff->endpos; \ + } \ + *sp++ = (c); \ + cc++; \ +} + +#define NUM(c) (c - '0') + +#define STR_TO_DEC(str, num) \ + num = NUM(*str++); \ + while (apr_isdigit(*str)) \ + { \ + num *= 10 ; \ + num += NUM(*str++); \ } /* @@ -321,31 +321,35 @@ static char *apr_gcvt(double number, int ndigit, char *buf, boolean_e altform) * adding '0's to the left of the string that is going * to be printed. */ -#define FIX_PRECISION( adjust, precision, s, s_len ) \ - if ( adjust ) \ - while ( s_len < precision ) \ - { \ - *--s = '0' ; \ - s_len++ ; \ - } +#define FIX_PRECISION(adjust, precision, s, s_len) \ + if (adjust) \ + while (s_len < precision) \ + { \ + *--s = '0'; \ + s_len++; \ + } /* * Macro that does padding. The padding is done by printing * the character ch. */ -#define PAD( width, len, ch ) do \ - { \ - INS_CHAR( ch, sp, bep, cc ) ; \ - width-- ; \ - } \ - while ( width > len ) +#define PAD(width, len, ch) \ +do \ +{ \ + INS_CHAR(ch, sp, bep, cc); \ + width--; \ +} \ +while (width > len) /* * Prefix the character ch to the string str * Increase length * Set the has_prefix flag */ -#define PREFIX( str, length, ch ) *--str = ch ; length++ ; has_prefix = YES +#define PREFIX(str, length, ch) \ + *--str = ch; \ + length++; \ + has_prefix=YES; /* @@ -365,45 +369,45 @@ static char *apr_gcvt(double number, int ndigit, char *buf, boolean_e altform) * latter is faster. */ static char *conv_10(register wide_int num, register bool_int is_unsigned, - register bool_int *is_negative, char *buf_end, - register int *len) + register bool_int *is_negative, char *buf_end, + register int *len) { register char *p = buf_end; register u_wide_int magnitude; if (is_unsigned) { - magnitude = (u_wide_int) num; - *is_negative = FALSE; + magnitude = (u_wide_int) num; + *is_negative = FALSE; } else { - *is_negative = (num < 0); - - /* - * On a 2's complement machine, negating the most negative integer - * results in a number that cannot be represented as a signed integer. - * Here is what we do to obtain the number's magnitude: - * a. add 1 to the number - * b. negate it (becomes positive) - * c. convert it to unsigned - * d. add 1 - */ - if (*is_negative) { - wide_int t = num + 1; - - magnitude = ((u_wide_int) -t) + 1; - } - else - magnitude = (u_wide_int) num; + *is_negative = (num < 0); + + /* + * On a 2's complement machine, negating the most negative integer + * results in a number that cannot be represented as a signed integer. + * Here is what we do to obtain the number's magnitude: + * a. add 1 to the number + * b. negate it (becomes positive) + * c. convert it to unsigned + * d. add 1 + */ + if (*is_negative) { + wide_int t = num + 1; + + magnitude = ((u_wide_int) -t) + 1; + } + else + magnitude = (u_wide_int) num; } /* * We use a do-while loop so that we write at least 1 digit */ do { - register u_wide_int new_magnitude = magnitude / 10; + register u_wide_int new_magnitude = magnitude / 10; - *--p = (char) (magnitude - new_magnitude * 10 + '0'); - magnitude = new_magnitude; + *--p = (char) (magnitude - new_magnitude * 10 + '0'); + magnitude = new_magnitude; } while (magnitude); @@ -412,8 +416,8 @@ static char *conv_10(register wide_int num, register bool_int is_unsigned, } static char *conv_10_quad(widest_int num, register bool_int is_unsigned, - register bool_int *is_negative, char *buf_end, - register int *len) + register bool_int *is_negative, char *buf_end, + register int *len) { register char *p = buf_end; u_widest_int magnitude; @@ -424,42 +428,42 @@ static char *conv_10_quad(widest_int num, register bool_int is_unsigned, * punt to the quicker version. */ if ((num <= ULONG_MAX && is_unsigned) || (num <= LONG_MAX && !is_unsigned)) - return(conv_10( (wide_int)num, is_unsigned, is_negative, - buf_end, len)); + return(conv_10( (wide_int)num, is_unsigned, is_negative, + buf_end, len)); if (is_unsigned) { - magnitude = (u_widest_int) num; - *is_negative = FALSE; + magnitude = (u_widest_int) num; + *is_negative = FALSE; } else { - *is_negative = (num < 0); - - /* - * On a 2's complement machine, negating the most negative integer - * results in a number that cannot be represented as a signed integer. - * Here is what we do to obtain the number's magnitude: - * a. add 1 to the number - * b. negate it (becomes positive) - * c. convert it to unsigned - * d. add 1 - */ - if (*is_negative) { - widest_int t = num + 1; - - magnitude = ((u_widest_int) -t) + 1; - } - else - magnitude = (u_widest_int) num; + *is_negative = (num < 0); + + /* + * On a 2's complement machine, negating the most negative integer + * results in a number that cannot be represented as a signed integer. + * Here is what we do to obtain the number's magnitude: + * a. add 1 to the number + * b. negate it (becomes positive) + * c. convert it to unsigned + * d. add 1 + */ + if (*is_negative) { + widest_int t = num + 1; + + magnitude = ((u_widest_int) -t) + 1; + } + else + magnitude = (u_widest_int) num; } /* * We use a do-while loop so that we write at least 1 digit */ do { - u_widest_int new_magnitude = magnitude / 10; + u_widest_int new_magnitude = magnitude / 10; - *--p = (char) (magnitude - new_magnitude * 10 + '0'); - magnitude = new_magnitude; + *--p = (char) (magnitude - new_magnitude * 10 + '0'); + magnitude = new_magnitude; } while (magnitude); @@ -539,74 +543,74 @@ static char *conv_fp(register char format, register double num, char buf1[NDIG]; if (format == 'f') - p = apr_fcvt(num, precision, &decimal_point, is_negative, buf1); - else /* either e or E format */ - p = apr_ecvt(num, precision + 1, &decimal_point, is_negative, buf1); + p = apr_fcvt(num, precision, &decimal_point, is_negative, buf1); + else /* either e or E format */ + p = apr_ecvt(num, precision + 1, &decimal_point, is_negative, buf1); /* * Check for Infinity and NaN */ if (apr_isalpha(*p)) { - *len = strlen(strcpy(buf, p)); - *is_negative = FALSE; - return (buf); + *len = strlen(strcpy(buf, p)); + *is_negative = FALSE; + return (buf); } if (format == 'f') { - if (decimal_point <= 0) { - *s++ = '0'; - if (precision > 0) { - *s++ = '.'; - while (decimal_point++ < 0) - *s++ = '0'; - } - else if (add_dp) - *s++ = '.'; - } - else { - while (decimal_point-- > 0) - *s++ = *p++; - if (precision > 0 || add_dp) - *s++ = '.'; - } + if (decimal_point <= 0) { + *s++ = '0'; + if (precision > 0) { + *s++ = '.'; + while (decimal_point++ < 0) + *s++ = '0'; + } + else if (add_dp) + *s++ = '.'; + } + else { + while (decimal_point-- > 0) + *s++ = *p++; + if (precision > 0 || add_dp) + *s++ = '.'; + } } else { - *s++ = *p++; - if (precision > 0 || add_dp) - *s++ = '.'; + *s++ = *p++; + if (precision > 0 || add_dp) + *s++ = '.'; } /* * copy the rest of p, the NUL is NOT copied */ while (*p) - *s++ = *p++; + *s++ = *p++; if (format != 'f') { - char temp[EXPONENT_LENGTH]; /* for exponent conversion */ - int t_len; - bool_int exponent_is_negative; - - *s++ = format; /* either e or E */ - decimal_point--; - if (decimal_point != 0) { - p = conv_10((wide_int) decimal_point, FALSE, &exponent_is_negative, - &temp[EXPONENT_LENGTH], &t_len); - *s++ = exponent_is_negative ? '-' : '+'; - - /* - * Make sure the exponent has at least 2 digits - */ - if (t_len == 1) - *s++ = '0'; - while (t_len--) - *s++ = *p++; - } - else { - *s++ = '+'; - *s++ = '0'; - *s++ = '0'; - } + char temp[EXPONENT_LENGTH]; /* for exponent conversion */ + int t_len; + bool_int exponent_is_negative; + + *s++ = format; /* either e or E */ + decimal_point--; + if (decimal_point != 0) { + p = conv_10((wide_int) decimal_point, FALSE, &exponent_is_negative, + &temp[EXPONENT_LENGTH], &t_len); + *s++ = exponent_is_negative ? '-' : '+'; + + /* + * Make sure the exponent has at least 2 digits + */ + if (t_len == 1) + *s++ = '0'; + while (t_len--) + *s++ = *p++; + } + else { + *s++ = '+'; + *s++ = '0'; + *s++ = '0'; + } } *len = s - buf; @@ -628,7 +632,7 @@ static char *conv_fp(register char format, register double num, * the number isn't quad size. */ static char *conv_p2(register u_wide_int num, register int nbits, - char format, char *buf_end, register int *len) + char format, char *buf_end, register int *len) { register int mask = (1 << nbits) - 1; register char *p = buf_end; @@ -637,8 +641,8 @@ static char *conv_p2(register u_wide_int num, register int nbits, register const char *digits = (format == 'X') ? upper_digits : low_digits; do { - *--p = digits[num & mask]; - num >>= nbits; + *--p = digits[num & mask]; + num >>= nbits; } while (num); @@ -647,7 +651,7 @@ static char *conv_p2(register u_wide_int num, register int nbits, } static char *conv_p2_quad(u_widest_int num, register int nbits, - char format, char *buf_end, register int *len) + char format, char *buf_end, register int *len) { register int mask = (1 << nbits) - 1; register char *p = buf_end; @@ -656,11 +660,11 @@ static char *conv_p2_quad(u_widest_int num, register int nbits, register const char *digits = (format == 'X') ? upper_digits : low_digits; if (num <= ULONG_MAX) - return(conv_p2( (u_wide_int)num, nbits, format, buf_end, len)); + return(conv_p2((u_wide_int)num, nbits, format, buf_end, len)); do { - *--p = digits[num & mask]; - num >>= nbits; + *--p = digits[num & mask]; + num >>= nbits; } while (num); @@ -687,7 +691,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), register int min_width = 0; int precision = 0; enum { - LEFT, RIGHT + LEFT, RIGHT } adjust; char pad_char; char prefix_char; @@ -699,10 +703,10 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), u_wide_int ui_num; char num_buf[NUM_BUF_SIZE]; - char char_buf[2]; /* for printing %% and % */ + char char_buf[2]; /* for printing %% and % */ enum var_type_enum { - IS_QUAD, IS_LONG, IS_SHORT, IS_INT + IS_QUAD, IS_LONG, IS_SHORT, IS_INT }; enum var_type_enum var_type = IS_INT; @@ -720,470 +724,470 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), bep = vbuff->endpos; while (*fmt) { - if (*fmt != '%') { - INS_CHAR(*fmt, sp, bep, cc); - } - else { - /* - * Default variable settings - */ + if (*fmt != '%') { + INS_CHAR(*fmt, sp, bep, cc); + } + else { + /* + * Default variable settings + */ boolean_e print_something = YES; - adjust = RIGHT; - alternate_form = print_sign = print_blank = NO; - pad_char = ' '; - prefix_char = NUL; - - fmt++; - - /* - * Try to avoid checking for flags, width or precision - */ - if (!apr_islower(*fmt)) { - /* - * Recognize flags: -, #, BLANK, + - */ - for (;; fmt++) { - if (*fmt == '-') - adjust = LEFT; - else if (*fmt == '+') - print_sign = YES; - else if (*fmt == '#') - alternate_form = YES; - else if (*fmt == ' ') - print_blank = YES; - else if (*fmt == '0') - pad_char = '0'; - else - break; - } - - /* - * Check if a width was specified - */ - if (apr_isdigit(*fmt)) { - STR_TO_DEC(fmt, min_width); - adjust_width = YES; - } - else if (*fmt == '*') { - min_width = va_arg(ap, int); - fmt++; - adjust_width = YES; - if (min_width < 0) { - adjust = LEFT; - min_width = -min_width; - } - } - else - adjust_width = NO; - - /* - * Check if a precision was specified - * - * XXX: an unreasonable amount of precision may be specified - * resulting in overflow of num_buf. Currently we - * ignore this possibility. - */ - if (*fmt == '.') { - adjust_precision = YES; - fmt++; - if (apr_isdigit(*fmt)) { - STR_TO_DEC(fmt, precision); - } - else if (*fmt == '*') { - precision = va_arg(ap, int); - fmt++; - if (precision < 0) - precision = 0; - } - else - precision = 0; - } - else - adjust_precision = NO; - } - else - adjust_precision = adjust_width = NO; - - /* - * Modifier check - */ + adjust = RIGHT; + alternate_form = print_sign = print_blank = NO; + pad_char = ' '; + prefix_char = NUL; + + fmt++; + + /* + * Try to avoid checking for flags, width or precision + */ + if (!apr_islower(*fmt)) { + /* + * Recognize flags: -, #, BLANK, + + */ + for (;; fmt++) { + if (*fmt == '-') + adjust = LEFT; + else if (*fmt == '+') + print_sign = YES; + else if (*fmt == '#') + alternate_form = YES; + else if (*fmt == ' ') + print_blank = YES; + else if (*fmt == '0') + pad_char = '0'; + else + break; + } + + /* + * Check if a width was specified + */ + if (apr_isdigit(*fmt)) { + STR_TO_DEC(fmt, min_width); + adjust_width = YES; + } + else if (*fmt == '*') { + min_width = va_arg(ap, int); + fmt++; + adjust_width = YES; + if (min_width < 0) { + adjust = LEFT; + min_width = -min_width; + } + } + else + adjust_width = NO; + + /* + * Check if a precision was specified + * + * XXX: an unreasonable amount of precision may be specified + * resulting in overflow of num_buf. Currently we + * ignore this possibility. + */ + if (*fmt == '.') { + adjust_precision = YES; + fmt++; + if (apr_isdigit(*fmt)) { + STR_TO_DEC(fmt, precision); + } + else if (*fmt == '*') { + precision = va_arg(ap, int); + fmt++; + if (precision < 0) + precision = 0; + } + else + precision = 0; + } + else + adjust_precision = NO; + } + else + adjust_precision = adjust_width = NO; + + /* + * Modifier check + */ if (strncmp(fmt, APR_INT64_T_FMT, sizeof(APR_INT64_T_FMT) - 2) == 0) { /* Need to account for trailing 'd' and null in sizeof() */ - var_type = IS_QUAD; - fmt += (sizeof(APR_INT64_T_FMT) - 2); + var_type = IS_QUAD; + fmt += (sizeof(APR_INT64_T_FMT) - 2); + } + else if (*fmt == 'q') { + var_type = IS_QUAD; + fmt++; + } + else if (*fmt == 'l') { + var_type = IS_LONG; + fmt++; } - else if (*fmt == 'q') { - var_type = IS_QUAD; - fmt++; - } - else if (*fmt == 'l') { - var_type = IS_LONG; - fmt++; - } - else if (*fmt == 'h') { - var_type = IS_SHORT; - fmt++; - } - else { - var_type = IS_INT; - } - - /* - * Argument extraction and printing. - * First we determine the argument type. - * Then, we convert the argument to a string. - * On exit from the switch, s points to the string that - * must be printed, s_len has the length of the string - * The precision requirements, if any, are reflected in s_len. - * - * NOTE: pad_char may be set to '0' because of the 0 flag. - * It is reset to ' ' by non-numeric formats - */ - switch (*fmt) { - case 'u': - if (var_type == IS_QUAD) { - i_quad = va_arg(ap, u_widest_int); - s = conv_10_quad(i_quad, 1, &is_negative, - &num_buf[NUM_BUF_SIZE], &s_len); - } - else { - if (var_type == IS_LONG) - i_num = (wide_int) va_arg(ap, u_wide_int); - else if (var_type == IS_SHORT) - i_num = (wide_int) (unsigned short) va_arg(ap, unsigned int); - else - i_num = (wide_int) va_arg(ap, unsigned int); - s = conv_10(i_num, 1, &is_negative, - &num_buf[NUM_BUF_SIZE], &s_len); - } - FIX_PRECISION(adjust_precision, precision, s, s_len); - break; - - case 'd': - case 'i': - if (var_type == IS_QUAD) { - i_quad = va_arg(ap, widest_int); - s = conv_10_quad(i_quad, 0, &is_negative, - &num_buf[NUM_BUF_SIZE], &s_len); - } - else { - if (var_type == IS_LONG) - i_num = (wide_int) va_arg(ap, wide_int); - else if (var_type == IS_SHORT) - i_num = (wide_int) (short) va_arg(ap, int); - else - i_num = (wide_int) va_arg(ap, int); - s = conv_10(i_num, 0, &is_negative, - &num_buf[NUM_BUF_SIZE], &s_len); - } - FIX_PRECISION(adjust_precision, precision, s, s_len); - - if (is_negative) - prefix_char = '-'; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; - break; - - - case 'o': - if (var_type == IS_QUAD) { - ui_quad = va_arg(ap, u_widest_int); - s = conv_p2_quad(ui_quad, 3, *fmt, - &num_buf[NUM_BUF_SIZE], &s_len); - } - else { - if (var_type == IS_LONG) - ui_num = (u_wide_int) va_arg(ap, u_wide_int); - else if (var_type == IS_SHORT) - ui_num = (u_wide_int) (unsigned short) va_arg(ap, unsigned int); - else - ui_num = (u_wide_int) va_arg(ap, unsigned int); - s = conv_p2(ui_num, 3, *fmt, - &num_buf[NUM_BUF_SIZE], &s_len); - } - FIX_PRECISION(adjust_precision, precision, s, s_len); - if (alternate_form && *s != '0') { - *--s = '0'; - s_len++; - } - break; - - - case 'x': - case 'X': - if (var_type == IS_QUAD) { - ui_quad = va_arg(ap, u_widest_int); - s = conv_p2_quad(ui_quad, 4, *fmt, - &num_buf[NUM_BUF_SIZE], &s_len); - } - else { - if (var_type == IS_LONG) - ui_num = (u_wide_int) va_arg(ap, u_wide_int); - else if (var_type == IS_SHORT) - ui_num = (u_wide_int) (unsigned short) va_arg(ap, unsigned int); - else - ui_num = (u_wide_int) va_arg(ap, unsigned int); - s = conv_p2(ui_num, 4, *fmt, - &num_buf[NUM_BUF_SIZE], &s_len); - } - FIX_PRECISION(adjust_precision, precision, s, s_len); - if (alternate_form && i_num != 0) { - *--s = *fmt; /* 'x' or 'X' */ - *--s = '0'; - s_len += 2; - } - break; - - - case 's': - s = va_arg(ap, char *); - if (s != NULL) { - s_len = strlen(s); - if (adjust_precision && precision < s_len) - s_len = precision; - } - else { - s = S_NULL; - s_len = S_NULL_LEN; - } - pad_char = ' '; - break; - - - case 'f': - case 'e': - case 'E': - fp_num = va_arg(ap, double); - /* - * We use &num_buf[ 1 ], so that we have room for the sign - */ + else if (*fmt == 'h') { + var_type = IS_SHORT; + fmt++; + } + else { + var_type = IS_INT; + } + + /* + * Argument extraction and printing. + * First we determine the argument type. + * Then, we convert the argument to a string. + * On exit from the switch, s points to the string that + * must be printed, s_len has the length of the string + * The precision requirements, if any, are reflected in s_len. + * + * NOTE: pad_char may be set to '0' because of the 0 flag. + * It is reset to ' ' by non-numeric formats + */ + switch (*fmt) { + case 'u': + if (var_type == IS_QUAD) { + i_quad = va_arg(ap, u_widest_int); + s = conv_10_quad(i_quad, 1, &is_negative, + &num_buf[NUM_BUF_SIZE], &s_len); + } + else { + if (var_type == IS_LONG) + i_num = (wide_int) va_arg(ap, u_wide_int); + else if (var_type == IS_SHORT) + i_num = (wide_int) (unsigned short) va_arg(ap, unsigned int); + else + i_num = (wide_int) va_arg(ap, unsigned int); + s = conv_10(i_num, 1, &is_negative, + &num_buf[NUM_BUF_SIZE], &s_len); + } + FIX_PRECISION(adjust_precision, precision, s, s_len); + break; + + case 'd': + case 'i': + if (var_type == IS_QUAD) { + i_quad = va_arg(ap, widest_int); + s = conv_10_quad(i_quad, 0, &is_negative, + &num_buf[NUM_BUF_SIZE], &s_len); + } + else { + if (var_type == IS_LONG) + i_num = (wide_int) va_arg(ap, wide_int); + else if (var_type == IS_SHORT) + i_num = (wide_int) (short) va_arg(ap, int); + else + i_num = (wide_int) va_arg(ap, int); + s = conv_10(i_num, 0, &is_negative, + &num_buf[NUM_BUF_SIZE], &s_len); + } + FIX_PRECISION(adjust_precision, precision, s, s_len); + + if (is_negative) + prefix_char = '-'; + else if (print_sign) + prefix_char = '+'; + else if (print_blank) + prefix_char = ' '; + break; + + + case 'o': + if (var_type == IS_QUAD) { + ui_quad = va_arg(ap, u_widest_int); + s = conv_p2_quad(ui_quad, 3, *fmt, + &num_buf[NUM_BUF_SIZE], &s_len); + } + else { + if (var_type == IS_LONG) + ui_num = (u_wide_int) va_arg(ap, u_wide_int); + else if (var_type == IS_SHORT) + ui_num = (u_wide_int) (unsigned short) va_arg(ap, unsigned int); + else + ui_num = (u_wide_int) va_arg(ap, unsigned int); + s = conv_p2(ui_num, 3, *fmt, + &num_buf[NUM_BUF_SIZE], &s_len); + } + FIX_PRECISION(adjust_precision, precision, s, s_len); + if (alternate_form && *s != '0') { + *--s = '0'; + s_len++; + } + break; + + + case 'x': + case 'X': + if (var_type == IS_QUAD) { + ui_quad = va_arg(ap, u_widest_int); + s = conv_p2_quad(ui_quad, 4, *fmt, + &num_buf[NUM_BUF_SIZE], &s_len); + } + else { + if (var_type == IS_LONG) + ui_num = (u_wide_int) va_arg(ap, u_wide_int); + else if (var_type == IS_SHORT) + ui_num = (u_wide_int) (unsigned short) va_arg(ap, unsigned int); + else + ui_num = (u_wide_int) va_arg(ap, unsigned int); + s = conv_p2(ui_num, 4, *fmt, + &num_buf[NUM_BUF_SIZE], &s_len); + } + FIX_PRECISION(adjust_precision, precision, s, s_len); + if (alternate_form && i_num != 0) { + *--s = *fmt; /* 'x' or 'X' */ + *--s = '0'; + s_len += 2; + } + break; + + + case 's': + s = va_arg(ap, char *); + if (s != NULL) { + s_len = strlen(s); + if (adjust_precision && precision < s_len) + s_len = precision; + } + else { + s = S_NULL; + s_len = S_NULL_LEN; + } + pad_char = ' '; + break; + + + case 'f': + case 'e': + case 'E': + fp_num = va_arg(ap, double); + /* + * We use &num_buf[ 1 ], so that we have room for the sign + */ s = NULL; #ifdef HAVE_ISNAN - if (isnan(fp_num)) { - s = "nan"; - s_len = 3; - } + if (isnan(fp_num)) { + s = "nan"; + s_len = 3; + } #endif #ifdef HAVE_ISINF - if (!s && isinf(fp_num)) { - s = "inf"; - s_len = 3; - } + if (!s && isinf(fp_num)) { + s = "inf"; + s_len = 3; + } #endif - if (!s) { - s = conv_fp(*fmt, fp_num, alternate_form, - (adjust_precision == NO) ? FLOAT_DIGITS : precision, - &is_negative, &num_buf[1], &s_len); - if (is_negative) - prefix_char = '-'; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; - } - break; - - - case 'g': - case 'G': - if (adjust_precision == NO) - precision = FLOAT_DIGITS; - else if (precision == 0) - precision = 1; - /* - * * We use &num_buf[ 1 ], so that we have room for the sign - */ - s = apr_gcvt(va_arg(ap, double), precision, &num_buf[1], - alternate_form); - if (*s == '-') - prefix_char = *s++; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; - - s_len = strlen(s); - - if (alternate_form && (q = strchr(s, '.')) == NULL) { - s[s_len++] = '.'; - s[s_len] = '\0'; /* delimit for following strchr() */ - } - if (*fmt == 'G' && (q = strchr(s, 'e')) != NULL) - *q = 'E'; - break; - - - case 'c': - char_buf[0] = (char) (va_arg(ap, int)); - s = &char_buf[0]; - s_len = 1; - pad_char = ' '; - break; - - - case '%': - char_buf[0] = '%'; - s = &char_buf[0]; - s_len = 1; - pad_char = ' '; - break; - - - case 'n': - if (var_type == IS_QUAD) - *(va_arg(ap, widest_int *)) = cc; - else if (var_type == IS_LONG) - *(va_arg(ap, long *)) = cc; - else if (var_type == IS_SHORT) - *(va_arg(ap, short *)) = cc; - else - *(va_arg(ap, int *)) = cc; + if (!s) { + s = conv_fp(*fmt, fp_num, alternate_form, + (adjust_precision == NO) ? FLOAT_DIGITS : precision, + &is_negative, &num_buf[1], &s_len); + if (is_negative) + prefix_char = '-'; + else if (print_sign) + prefix_char = '+'; + else if (print_blank) + prefix_char = ' '; + } + break; + + + case 'g': + case 'G': + if (adjust_precision == NO) + precision = FLOAT_DIGITS; + else if (precision == 0) + precision = 1; + /* + * * We use &num_buf[ 1 ], so that we have room for the sign + */ + s = apr_gcvt(va_arg(ap, double), precision, &num_buf[1], + alternate_form); + if (*s == '-') + prefix_char = *s++; + else if (print_sign) + prefix_char = '+'; + else if (print_blank) + prefix_char = ' '; + + s_len = strlen(s); + + if (alternate_form && (q = strchr(s, '.')) == NULL) { + s[s_len++] = '.'; + s[s_len] = '\0'; /* delimit for following strchr() */ + } + if (*fmt == 'G' && (q = strchr(s, 'e')) != NULL) + *q = 'E'; + break; + + + case 'c': + char_buf[0] = (char) (va_arg(ap, int)); + s = &char_buf[0]; + s_len = 1; + pad_char = ' '; + break; + + + case '%': + char_buf[0] = '%'; + s = &char_buf[0]; + s_len = 1; + pad_char = ' '; + break; + + + case 'n': + if (var_type == IS_QUAD) + *(va_arg(ap, widest_int *)) = cc; + else if (var_type == IS_LONG) + *(va_arg(ap, long *)) = cc; + else if (var_type == IS_SHORT) + *(va_arg(ap, short *)) = cc; + else + *(va_arg(ap, int *)) = cc; print_something = NO; - break; - - /* - * This is where we extend the printf format, with a second - * type specifier - */ - case 'p': - switch(*++fmt) { - /* - * If the pointer size is equal to or smaller than the size - * of the largest unsigned int, we convert the pointer to a - * hex number, otherwise we print "%p" to indicate that we - * don't handle "%p". - */ - case 'p': + break; + + /* + * This is where we extend the printf format, with a second + * type specifier + */ + case 'p': + switch(*++fmt) { + /* + * If the pointer size is equal to or smaller than the size + * of the largest unsigned int, we convert the pointer to a + * hex number, otherwise we print "%p" to indicate that we + * don't handle "%p". + */ + case 'p': #ifdef APR_VOID_P_IS_QUAD - if (sizeof(void *) <= sizeof(u_widest_int)) { - ui_quad = (u_widest_int) va_arg(ap, void *); - s = conv_p2_quad(ui_quad, 4, 'x', - &num_buf[NUM_BUF_SIZE], &s_len); - } + if (sizeof(void *) <= sizeof(u_widest_int)) { + ui_quad = (u_widest_int) va_arg(ap, void *); + s = conv_p2_quad(ui_quad, 4, 'x', + &num_buf[NUM_BUF_SIZE], &s_len); + } #else - if (sizeof(void *) <= sizeof(u_wide_int)) { - ui_num = (u_wide_int) va_arg(ap, void *); - s = conv_p2(ui_num, 4, 'x', - &num_buf[NUM_BUF_SIZE], &s_len); - } + if (sizeof(void *) <= sizeof(u_wide_int)) { + ui_num = (u_wide_int) va_arg(ap, void *); + s = conv_p2(ui_num, 4, 'x', + &num_buf[NUM_BUF_SIZE], &s_len); + } #endif - else { - s = "%p"; - s_len = 2; - prefix_char = NUL; - } - pad_char = ' '; - break; - - /* print an apr_sockaddr_t as a.b.c.d:port */ - case 'I': - { - apr_sockaddr_t *sa; - - sa = va_arg(ap, apr_sockaddr_t *); - if (sa != NULL) { - s = conv_apr_sockaddr(sa, &num_buf[NUM_BUF_SIZE], &s_len); - if (adjust_precision && precision < s_len) - s_len = precision; - } - else { - s = S_NULL; - s_len = S_NULL_LEN; - } - pad_char = ' '; - } - break; - - /* print a struct in_addr as a.b.c.d */ - case 'A': - { - struct in_addr *ia; - - ia = va_arg(ap, struct in_addr *); - if (ia != NULL) { - s = conv_in_addr(ia, &num_buf[NUM_BUF_SIZE], &s_len); - if (adjust_precision && precision < s_len) - s_len = precision; - } - else { - s = S_NULL; - s_len = S_NULL_LEN; - } - pad_char = ' '; - } - break; - - case NUL: - /* if %p ends the string, oh well ignore it */ - continue; - - default: - s = "bogus %p"; - s_len = 8; - prefix_char = NUL; - break; - } - break; - - case NUL: - /* - * The last character of the format string was %. - * We ignore it. - */ - continue; - - - /* - * The default case is for unrecognized %'s. - * We print % to help the user identify what - * option is not understood. - * This is also useful in case the user wants to pass - * the output of format_converter to another function - * that understands some other % (like syslog). - * Note that we can't point s inside fmt because the - * unknown could be preceded by width etc. - */ - default: - char_buf[0] = '%'; - char_buf[1] = *fmt; - s = char_buf; - s_len = 2; - pad_char = ' '; - break; - } - - if (prefix_char != NUL && s != S_NULL && s != char_buf) { - *--s = prefix_char; - s_len++; - } - - if (adjust_width && adjust == RIGHT && min_width > s_len) { - if (pad_char == '0' && prefix_char != NUL) { - INS_CHAR(*s, sp, bep, cc); - s++; - s_len--; - min_width--; - } - PAD(min_width, s_len, pad_char); - } - - /* - * Print the string s. - */ + else { + s = "%p"; + s_len = 2; + prefix_char = NUL; + } + pad_char = ' '; + break; + + /* print an apr_sockaddr_t as a.b.c.d:port */ + case 'I': + { + apr_sockaddr_t *sa; + + sa = va_arg(ap, apr_sockaddr_t *); + if (sa != NULL) { + s = conv_apr_sockaddr(sa, &num_buf[NUM_BUF_SIZE], &s_len); + if (adjust_precision && precision < s_len) + s_len = precision; + } + else { + s = S_NULL; + s_len = S_NULL_LEN; + } + pad_char = ' '; + } + break; + + /* print a struct in_addr as a.b.c.d */ + case 'A': + { + struct in_addr *ia; + + ia = va_arg(ap, struct in_addr *); + if (ia != NULL) { + s = conv_in_addr(ia, &num_buf[NUM_BUF_SIZE], &s_len); + if (adjust_precision && precision < s_len) + s_len = precision; + } + else { + s = S_NULL; + s_len = S_NULL_LEN; + } + pad_char = ' '; + } + break; + + case NUL: + /* if %p ends the string, oh well ignore it */ + continue; + + default: + s = "bogus %p"; + s_len = 8; + prefix_char = NUL; + break; + } + break; + + case NUL: + /* + * The last character of the format string was %. + * We ignore it. + */ + continue; + + + /* + * The default case is for unrecognized %'s. + * We print % to help the user identify what + * option is not understood. + * This is also useful in case the user wants to pass + * the output of format_converter to another function + * that understands some other % (like syslog). + * Note that we can't point s inside fmt because the + * unknown could be preceded by width etc. + */ + default: + char_buf[0] = '%'; + char_buf[1] = *fmt; + s = char_buf; + s_len = 2; + pad_char = ' '; + break; + } + + if (prefix_char != NUL && s != S_NULL && s != char_buf) { + *--s = prefix_char; + s_len++; + } + + if (adjust_width && adjust == RIGHT && min_width > s_len) { + if (pad_char == '0' && prefix_char != NUL) { + INS_CHAR(*s, sp, bep, cc); + s++; + s_len--; + min_width--; + } + PAD(min_width, s_len, pad_char); + } + + /* + * Print the string s. + */ if (print_something == YES) { for (i = s_len; i != 0; i--) { - INS_CHAR(*s, sp, bep, cc); - s++; + INS_CHAR(*s, sp, bep, cc); + s++; } } - if (adjust_width && adjust == LEFT && min_width > s_len) - PAD(min_width, s_len, pad_char); - } - fmt++; + if (adjust_width && adjust == LEFT && min_width > s_len) + PAD(min_width, s_len, pad_char); + } + fmt++; } vbuff->curpos = sp; return cc; @@ -1207,7 +1211,7 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, apr_vformatter_buff_t vbuff; if (len == 0) - return 0; + return 0; /* save one byte for nul terminator */ vbuff.curpos = buf; @@ -1221,13 +1225,13 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format, - va_list ap) + va_list ap) { int cc; apr_vformatter_buff_t vbuff; if (len == 0) - return 0; + return 0; /* save one byte for nul terminator */ vbuff.curpos = buf; From d1054f4f4a2245f53ddbb1da4343a405488c6e8e Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 5 Feb 2002 06:07:14 +0000 Subject: [PATCH 2909/7878] You know the style was horrendous when it requires *two* passes to get a decent style. Sorry. No functional changes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62914 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 86 +++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 733d4dbf77c..99053b647ef 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -846,7 +846,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), */ switch (*fmt) { case 'u': - if (var_type == IS_QUAD) { + if (var_type == IS_QUAD) { i_quad = va_arg(ap, u_widest_int); s = conv_10_quad(i_quad, 1, &is_negative, &num_buf[NUM_BUF_SIZE], &s_len); @@ -866,7 +866,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), case 'd': case 'i': - if (var_type == IS_QUAD) { + if (var_type == IS_QUAD) { i_quad = va_arg(ap, widest_int); s = conv_10_quad(i_quad, 0, &is_negative, &num_buf[NUM_BUF_SIZE], &s_len); @@ -964,7 +964,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * We use &num_buf[ 1 ], so that we have room for the sign */ - s = NULL; + s = NULL; #ifdef HAVE_ISNAN if (isnan(fp_num)) { s = "nan"; @@ -977,7 +977,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), s_len = 3; } #endif - if (!s) { + if (!s) { s = conv_fp(*fmt, fp_num, alternate_form, (adjust_precision == NO) ? FLOAT_DIGITS : precision, &is_negative, &num_buf[1], &s_len); @@ -1037,7 +1037,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), case 'n': - if (var_type == IS_QUAD) + if (var_type == IS_QUAD) *(va_arg(ap, widest_int *)) = cc; else if (var_type == IS_LONG) *(va_arg(ap, long *)) = cc; @@ -1054,12 +1054,12 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), */ case 'p': switch(*++fmt) { - /* - * If the pointer size is equal to or smaller than the size - * of the largest unsigned int, we convert the pointer to a - * hex number, otherwise we print "%p" to indicate that we - * don't handle "%p". - */ + /* + * If the pointer size is equal to or smaller than the size + * of the largest unsigned int, we convert the pointer to a + * hex number, otherwise we print "%p" to indicate that we + * don't handle "%p". + */ case 'p': #ifdef APR_VOID_P_IS_QUAD if (sizeof(void *) <= sizeof(u_widest_int)) { @@ -1082,43 +1082,43 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), pad_char = ' '; break; - /* print an apr_sockaddr_t as a.b.c.d:port */ + /* print an apr_sockaddr_t as a.b.c.d:port */ case 'I': - { - apr_sockaddr_t *sa; - - sa = va_arg(ap, apr_sockaddr_t *); - if (sa != NULL) { - s = conv_apr_sockaddr(sa, &num_buf[NUM_BUF_SIZE], &s_len); - if (adjust_precision && precision < s_len) - s_len = precision; - } - else { - s = S_NULL; - s_len = S_NULL_LEN; - } - pad_char = ' '; + { + apr_sockaddr_t *sa; + + sa = va_arg(ap, apr_sockaddr_t *); + if (sa != NULL) { + s = conv_apr_sockaddr(sa, &num_buf[NUM_BUF_SIZE], &s_len); + if (adjust_precision && precision < s_len) + s_len = precision; } - break; + else { + s = S_NULL; + s_len = S_NULL_LEN; + } + pad_char = ' '; + } + break; - /* print a struct in_addr as a.b.c.d */ + /* print a struct in_addr as a.b.c.d */ case 'A': - { - struct in_addr *ia; - - ia = va_arg(ap, struct in_addr *); - if (ia != NULL) { - s = conv_in_addr(ia, &num_buf[NUM_BUF_SIZE], &s_len); - if (adjust_precision && precision < s_len) - s_len = precision; - } - else { - s = S_NULL; - s_len = S_NULL_LEN; - } - pad_char = ' '; + { + struct in_addr *ia; + + ia = va_arg(ap, struct in_addr *); + if (ia != NULL) { + s = conv_in_addr(ia, &num_buf[NUM_BUF_SIZE], &s_len); + if (adjust_precision && precision < s_len) + s_len = precision; } - break; + else { + s = S_NULL; + s_len = S_NULL_LEN; + } + pad_char = ' '; + } + break; case NUL: /* if %p ends the string, oh well ignore it */ From 506e7e785d040f6062397723b6fe6c559314bf9a Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 5 Feb 2002 09:27:38 +0000 Subject: [PATCH 2910/7878] Move around some logic to make abstraction of the allocator a bit easier. Node resetting now only happens in the node_malloc function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62915 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 65 +++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 41 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index b318e686b5f..fc2daf7eb31 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -316,7 +316,7 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_lock(allocator->mutex); -#endif +#endif /* APR_HAS_THREADS */ /* Walk the free list to see if there are * any nodes on it of the requested size @@ -351,13 +351,14 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) allocator->max_index = max_index; } - - node->next = NULL; #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_unlock(allocator->mutex); -#endif +#endif /* APR_HAS_THREADS */ + + node->next = NULL; + node->first_avail = (char *)node + SIZEOF_NODE_T; return node; } @@ -365,7 +366,7 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_unlock(allocator->mutex); -#endif +#endif /* APR_HAS_THREADS */ } /* If we found nothing, seek the sink (at index 0), if @@ -375,7 +376,7 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_lock(allocator->mutex); -#endif +#endif /* APR_HAS_THREADS */ /* Walk the free list to see if there are * any nodes on it of the requested size @@ -386,12 +387,14 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) if (node) { *ref = node->next; - node->next = NULL; - + #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_unlock(allocator->mutex); -#endif +#endif /* APR_HAS_THREADS */ + + node->next = NULL; + node->first_avail = (char *)node + SIZEOF_NODE_T; return node; } @@ -399,7 +402,7 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_unlock(allocator->mutex); -#endif +#endif /* APR_HAS_THREADS */ } /* If we haven't got a suitable node, malloc a new one @@ -480,12 +483,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) return mem; } - /* Reset the active node, get ourselves a new one and activate it. */ - active->first_avail = (char *)active + SIZEOF_NODE_T; - if ((node = node_malloc(pool->allocator, size)) == NULL) { - active->first_avail = active->endp; - if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); @@ -496,7 +494,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) mem = node->first_avail; node->first_avail += size; - + return mem; } @@ -520,9 +518,6 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) return mem; } - /* Reset the active node, get ourselves a new one and activate it. */ - active->first_avail = (char *)active + SIZEOF_NODE_T; - if ((node = node_malloc(pool->allocator, size)) == NULL) { active->first_avail = active->endp; @@ -536,9 +531,9 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) mem = node->first_avail; node->first_avail += size; - + memset(mem, 0, size); - + return mem; } @@ -568,19 +563,15 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) /* Clear the user data. */ pool->user_data = NULL; - /* Reset the active node */ - if ((active = pool->active) == pool->self) { - active->first_avail = pool->self_first_avail; - return; - } - - active->first_avail = (char *)active + SIZEOF_NODE_T; - - /* Find the node attached to the pool structure, make + /* Find the node attached to the pool structure, reset it, make * it the active node and free the rest of the nodes. */ active = pool->active = pool->self; active->first_avail = pool->self_first_avail; + + if (active->next == NULL) + return; + node_free(pool->allocator, active->next); active->next = NULL; } @@ -620,17 +611,12 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) apr_thread_mutex_unlock(mutex); #endif } - - /* Reset the active block */ - active = pool->active; - active->first_avail = (char *)active + SIZEOF_NODE_T; - + /* Find the block attached to the pool structure. Save a copy of the * allocator pointer, because the pool struct soon will be no more. */ allocator = pool->allocator; active = pool->self; - active->first_avail = (char *)active + SIZEOF_NODE_T; /* If this pool happens to be the owner of the allocator, free * everything in the allocator (that includes the pool struct @@ -645,13 +631,13 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) free(node); } } - + ref = &active; while ((node = *ref) != NULL) { *ref = node->next; free(node); } - + return; } @@ -829,9 +815,6 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) memcpy(active->first_avail, node->first_avail, cur_len); - /* Reset the previous active node */ - node->first_avail = (char *)node + SIZEOF_NODE_T; - if (ps->got_a_new_node) { node->next = ps->free; ps->free = node; From 7c951c934934ec8410361c84bf9a2328fb8d4364 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 5 Feb 2002 12:09:43 +0000 Subject: [PATCH 2911/7878] Add a means to track where allocations are done. Show each and every allocation with --enable-pool-debug=verbose-alloc. Know that this gives you very verbose output on stderr. Move the wrappers to the bottom of the file, since the functions are called withing apr_pools.c itself (which means showed up as the location). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62916 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 7 +- include/apr_pools.h | 39 +++++++- memory/unix/apr_pools.c | 212 +++++++++++++++++++++++++--------------- 3 files changed, 177 insertions(+), 81 deletions(-) diff --git a/configure.in b/configure.in index b94af5b2d03..6eb49487a98 100644 --- a/configure.in +++ b/configure.in @@ -189,7 +189,7 @@ AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build )dnl AC_ARG_ENABLE(pool-debug, - [ --enable-pool-debug[[=yes|no|verbose|lifetime|owner|all]] Turn on pools debugging], + [ --enable-pool-debug[[=yes|no|verbose|verbose-alloc|lifetime|owner|all]] Turn on pools debugging], [ if test -z "$enableval"; then APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG=1) elif test ! "$enableval" = "no"; then @@ -212,8 +212,11 @@ AC_ARG_ENABLE(pool-debug, owner) flag=8 ;; + verbose-alloc) + flag=16 + ;; all) - apr_pool_debug=15 + apr_pool_debug=31 ;; *) ;; diff --git a/include/apr_pools.h b/include/apr_pools.h index e7989a688bb..ebb802f0963 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -97,6 +97,9 @@ extern "C" { * | | | | | | | x | | Verbose output on stderr (report * CREATE, CLEAR, DESTROY). * + * | | | | x | | | | | Verbose output on stderr (report + * PALLOC, PCALLOC). + * * | | | | | | x | | | Lifetime checking. On each use of a * pool, check its lifetime. If the pool * is out of scope, abort(). @@ -328,11 +331,27 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, /** * Allocate a block of memory from a pool * @param p The pool to allocate from - * @param reqsize The amount of memory to allocate + * @param size The amount of memory to allocate * @return The allocated memory */ -APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t reqsize); +APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size); +/** + * Debug version of apr_palloc + * @param p See: apr_palloc + * @param size See: apr_palloc + * @param file_line Where the function is called from. + * This is usually APR_POOL__FILE_LINE__. + * @return See: apr_palloc + */ +APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size, + const char *file_line); + +#if APR_POOL_DEBUG +#define apr_palloc(p, size) \ + apr_palloc_debug(p, size, APR_POOL__FILE_LINE__) +#endif + /** * Allocate a block of memory from a pool and set all of the memory to 0 * @param p The pool to allocate from @@ -341,6 +360,22 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t reqsize); */ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); +/** + * Debug version of apr_pcalloc + * @param p See: apr_pcalloc + * @param size See: apr_pcalloc + * @param file_line Where the function is called from. + * This is usually APR_POOL__FILE_LINE__. + * @return See: apr_pcalloc + */ +APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size, + const char *file_line); + +#if APR_POOL_DEBUG +#define apr_pcalloc(p, size) \ + apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__) +#endif + /* * Pool Properties diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index fc2daf7eb31..4e51cd38c9c 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -83,8 +83,11 @@ #define APR_POOL_DEBUG_VERBOSE 0x02 #define APR_POOL_DEBUG_LIFETIME 0x04 #define APR_POOL_DEBUG_OWNER 0x08 +#define APR_POOL_DEBUG_VERBOSE_ALLOC 0x10 + +#define APR_POOL_DEBUG_VERBOSE_ALL (APR_POOL_DEBUG_VERBOSE \ + | APR_POOL_DEBUG_VERBOSE_ALLOC) - /* * Magic numbers */ @@ -212,7 +215,7 @@ static allocator_t global_allocator = { }; #endif /* !APR_POOL_DEBUG */ -#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) static apr_file_t *file_stderr = NULL; #endif @@ -714,6 +717,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, pool->user_data = NULL; pool->tag = NULL; } + #ifdef NETWARE pool->owner_proc = (apr_os_proc_t)getnlmhandle(); #endif @@ -744,32 +748,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, return APR_SUCCESS; } -/* - * Pool creation/destruction stubs, for people who are running - * mixed release/debug enviroments. - */ - -APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, - const char *file_line) -{ - apr_pool_clear(pool); -} - -APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, - const char *file_line) -{ - apr_pool_destroy(pool); -} - -APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_uint32_t flags, - const char *file_line) -{ - return apr_pool_create_ex(newpool, parent, abort_fn, flags); -} - /* * "Print" functions @@ -881,7 +859,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) static void apr_pool_log_event(apr_pool_t *pool, const char *event, const char *file_line, int deref) { -#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) if (file_stderr) { if (deref) { apr_file_printf(file_stderr, @@ -931,7 +909,7 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, file_line); } } -#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ } #if APR_HAS_THREADS @@ -1049,7 +1027,7 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) apr_pools_initialized = 1; -#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) apr_file_open_stderr(&file_stderr, global_pool); if (file_stderr) { apr_file_printf(file_stderr, @@ -1062,7 +1040,7 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) apr_pool_log_event(global_pool, "GLOBAL", __FILE__ ":apr_pool_initialize", 0); } -#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ return APR_SUCCESS; } @@ -1077,7 +1055,7 @@ APR_DECLARE(void) apr_pool_terminate(void) apr_pool_destroy(global_pool); /* This will also destroy the mutex */ global_pool = NULL; -#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) file_stderr = NULL; #endif } @@ -1087,12 +1065,10 @@ APR_DECLARE(void) apr_pool_terminate(void) * Memory allocation (debug) */ -APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) +static void *pool_alloc(apr_pool_t *pool, apr_size_t size) { debug_node_t *node; void *mem; - - apr_pool_check_integrity(pool); if ((mem = malloc(size)) == NULL) { if (pool->abort_fn) @@ -1127,15 +1103,36 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) return mem; } -APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) +APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *pool, apr_size_t size, + const char *file_line) +{ + void *mem; + + apr_pool_check_integrity(pool); + + mem = pool_alloc(pool, size); + +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC) + apr_pool_log_event(pool, "PALLOC", file_line, 1); +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC) */ + + return mem; +} + +APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *pool, apr_size_t size, + const char *file_line) { void *mem; apr_pool_check_integrity(pool); - mem = apr_palloc(pool, size); + mem = pool_alloc(pool, size); memset(mem, 0, size); +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC) + apr_pool_log_event(pool, "PCALLOC", file_line, 1); +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC) */ + return mem; } @@ -1184,7 +1181,10 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, const char *file_line) { apr_pool_check_integrity(pool); + +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) apr_pool_log_event(pool, "CLEAR", file_line, 1); +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ pool_clear_debug(pool, file_line); } @@ -1193,7 +1193,10 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, const char *file_line) { apr_pool_check_integrity(pool); + +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) apr_pool_log_event(pool, "DESTROY", file_line, 1); +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ pool_clear_debug(pool, file_line); @@ -1306,50 +1309,13 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, *newpool = pool; +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) apr_pool_log_event(pool, "CREATE", file_line, 1); +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ return APR_SUCCESS; } -/* - * Pool creation/destruction stubs, for people who want - * APR_POOL_DEBUG, but didn't recompile their entire application. - * The prototypes are here to keep compilers picky about - * prototypes happy. - */ - -#undef apr_pool_clear -APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool); - -APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) -{ - apr_pool_clear_debug(pool, ""); -} - -#undef apr_pool_destroy -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool); - -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) -{ - apr_pool_destroy_debug(pool, ""); -} - -#undef apr_pool_create_ex -APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_uint32_t flags); - -APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_uint32_t flags) -{ - return apr_pool_create_ex_debug(newpool, parent, - abort_fn, flags, - ""); -} - /* * "Print" functions (debug) @@ -1907,3 +1873,95 @@ static void free_proc_chain(struct process_chain *procs) } #endif /* WIN32 */ } + + +/* + * Pool creation/destruction stubs, for people who are running + * mixed release/debug enviroments. + */ + +#if !APR_POOL_DEBUG +APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *pool, apr_size_t size, + const char *file_line) +{ + return apr_palloc(pool, size); +} + +APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *pool, apr_size_t size, + const char *file_line) +{ + return apr_pcalloc(pool, size); +} + +APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, + const char *file_line) +{ + apr_pool_clear(pool); +} + +APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, + const char *file_line) +{ + apr_pool_destroy(pool); +} + +APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_uint32_t flags, + const char *file_line) +{ + return apr_pool_create_ex(newpool, parent, abort_fn, flags); +} + +#else /* APR_POOL_DEBUG */ + +#undef apr_palloc +APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size); + +APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) +{ + return apr_palloc_debug(pool, size, "undefined"); +} + +#undef apr_pcalloc +APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size); + +APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) +{ + return apr_pcalloc_debug(pool, size, "undefined"); +} + +#undef apr_pool_clear +APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool); + +APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) +{ + apr_pool_clear_debug(pool, "undefined"); +} + +#undef apr_pool_destroy +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool); + +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) +{ + apr_pool_destroy_debug(pool, "undefined"); +} + +#undef apr_pool_create_ex +APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_uint32_t flags); + +APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_uint32_t flags) +{ + return apr_pool_create_ex_debug(newpool, parent, + abort_fn, flags, + "undefined"); +} + +#endif /* APR_POOL_DEBUG */ From 572225168daeb14c082cde3af254b974df75731c Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 5 Feb 2002 14:39:45 +0000 Subject: [PATCH 2912/7878] Replace autoconf 1.x macro calls with 2.x macro calls. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62917 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 6eb49487a98..ed2e4fb51cb 100644 --- a/configure.in +++ b/configure.in @@ -487,15 +487,15 @@ AC_CHECK_FUNCS(getgrgid_r) dnl #----------------------------- Checking for Shared Memory Support echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" -AC_HAVE_HEADERS(sys/mman.h) +AC_CHECK_HEADERS(sys/mman.h) APR_CHECK_DEFINE(MAP_ANON, sys/mman.h) -AC_HAVE_FUNCS(mmap munmap shm_open shm_unlink) +AC_CHECK_FUNCS(mmap munmap shm_open shm_unlink) APR_CHECK_FILE(/dev/zero) -AC_HAVE_HEADERS(sys/ipc.h sys/shm.h sys/file.h) -AC_HAVE_FUNCS(shmget shmat shmdt shmctl) -AC_HAVE_HEADERS(kernel/OS.h) -AC_HAVE_FUNCS(create_area) -AC_HAVE_HEADERS(os2.h) +AC_CHECK_HEADERS(sys/ipc.h sys/shm.h sys/file.h) +AC_CHECK_FUNCS(shmget shmat shmdt shmctl) +AC_CHECK_HEADERS(kernel/OS.h) +AC_CHECK_FUNCS(create_area) +AC_CHECK_HEADERS(os2.h) dnl Now we determine which one is our anonymous shmem preference. haveshmgetanon="0" From 8715c0a9226fa9779630b92cd657fa43c8b1615f Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Wed, 6 Feb 2002 11:41:57 +0000 Subject: [PATCH 2913/7878] Big revamp of the find_apr.m4 script for locating an installed/bundled copy of APR. Some associated changes in apr-config to better support the concept, and to fix some issues with apps using it for flags. * find_apr.m4: dramatic simplification. if we can find apr-config, then we can get all the possible information we might need: libraries, includes, linker flags, etc. So, most of the code was cut and we now just look for apr-config. The parameters to APR_FIND_APR have been clarified and cleand up to better support VPATH builds. * apr-config.in: glom all flags together to prevent newlines from getting in there. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62918 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 34 +++++---- build/find_apr.m4 | 187 +++++++++++++--------------------------------- 2 files changed, 74 insertions(+), 147 deletions(-) diff --git a/apr-config.in b/apr-config.in index 065851058c9..e3c31c0508e 100644 --- a/apr-config.in +++ b/apr-config.in @@ -123,6 +123,8 @@ else LA_FILE="$thisdir/libapr.la" fi +flags="" + while test $# -gt 0; do # Normalize the prefix. case "$1" in @@ -137,52 +139,54 @@ while test $# -gt 0; do ;; --prefix) echo $prefix + exit 0 ;; --cflags) - echo $CFLAGS + flags="$flags $CFLAGS" ;; --cppflags) - echo $CPPFLAGS + flags="$flags $CPPFLAGS" ;; --libs) - echo $LIBS + flags="$flags $LIBS" ;; --ldflags) - echo $LDFLAGS + flags="$flags $LDFLAGS" ;; --includes) if test "$location" = "installed"; then - echo "-I$includedir $EXTRA_INCLUDES" + flags="$flags -I$includedir $EXTRA_INCLUDES" elif test "$location" = "source"; then - echo "-I$APR_SOURCE_DIR/include $EXTRA_INCLUDES" + flags="$flags -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES" else - echo "-I$thisdir/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES" + flags="$flags -I$thisdir/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES" fi ;; --srcdir) echo $APR_SOURCE_DIR + exit 0 ;; --link-ld) if test "$location" = "installed"; then ### avoid using -L if libdir is a "standard" location like /usr/lib - echo "-L$libdir -lapr" + flags="$flags -L$libdir -lapr" else - echo "-L$thisdir -lapr" + flags="$flags -L$thisdir -lapr" fi ;; --link-libtool) if test -f "$LA_FILE"; then - echo $LA_FILE + flags="$flags $LA_FILE" elif test "$location" = "installed"; then ### avoid using -L if libdir is a "standard" location like /usr/lib - echo "-L$libdir -lapr" + flags="$flags -L$libdir -lapr" else - echo "-L$thisdir -lapr" + flags="$flags-L$thisdir -lapr" fi ;; --apr-la-file) if test -f "$LA_FILE"; then - echo $LA_FILE + flags="$flags $LA_FILE" fi ;; --help) @@ -199,4 +203,8 @@ while test $# -gt 0; do shift done +if test -n "$flags"; then + echo "$flags" +fi + exit 0 diff --git a/build/find_apr.m4 b/build/find_apr.m4 index ce3b11635b7..86dabcceaf0 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -6,179 +6,98 @@ dnl library. It provides a standardized mechanism for using APR. It supports dnl embedding APR into the application source, or locating an installed dnl copy of APR. dnl -dnl APR_FIND_APR([srcdir, path]) +dnl APR_FIND_APR([srcdir [, builddir]]) dnl dnl where srcdir is the location of the bundled APR source directory, or dnl empty if source is not bundled. -dnl where path is the prefix to the location where the bundled APR will -dnl will be built. dnl +dnl where blddir is the location where the bundled APR will will be built, +dnl or empty if the build will occur in the srcdir. dnl -dnl Sets the following variables on exit: -dnl -dnl apr_libdir : A custom directory to use for linking (the -L switch). -dnl If APR exists in a standard location, this variable -dnl will be empty -dnl -dnl apr_la_file : If a libtool .la file exists, this will refer to it. If -dnl there is no .la file, then this variable will be empty. -dnl -dnl apr_includes : Where the APR includes are located, if a non-standard -dnl location. This variable has the format "-Idir -Idir". -dnl It may specify more than one directory. -dnl -dnl apr_srcdir : If an APR source tree is available and needs to be -dnl (re)configured, this refers to it. -dnl -dnl apr_config : If the apr-config tool exists, this refers to it. dnl -dnl apr_vars : If the APR config file (APRVARS) exists, this refers to it. +dnl Sets the following variables on exit: dnl dnl apr_found : "yes", "no", "reconfig" dnl -dnl Note: At this time, we cannot find *both* a source dir and a build dir. -dnl If both are available, the build directory should be passed to -dnl the --with-apr switch (apr_srcdir will be empty). +dnl apr_config : If the apr-config tool exists, this refers to it. If +dnl apr_found is "reconfig", then the bundled directory +dnl should be reconfigured *before* using apr_config. dnl -dnl Note: the installation layout is presumed to follow the standard -dnl PREFIX/lib and PREFIX/include pattern. If the APR config file -dnl is available (and can be found), then non-standard layouts are -dnl possible, since it will be described in the config file. +dnl Note: this macro file assumes that apr-config has been installed; it +dnl is normally considered a required part of an APR installation. dnl -dnl If apr_found is "yes" or "reconfig", then the caller should link using -dnl apr_la_file, if available; otherwise, -lapr should be used (and if -dnl apr_libdir is not null, then -L$apr_libdir). If apr_includes is not null, -dnl then it should be used during compilation. +dnl If a bundled source directory is available and needs to be (re)configured, +dnl then apr_found is set to "reconfig". The caller should reconfigure the +dnl (passed-in) source directory, placing the result in the build directory, +dnl as appropriate. dnl -dnl If a source directory is available and needs to be (re)configured, then -dnl apr_srcdir specifies the directory and apr_found is "reconfig". +dnl If apr_found is "yes" or "reconfig", then the caller should use the +dnl value of apr_config to fetch any necessary build/link information. dnl AC_DEFUN(APR_FIND_APR, [ apr_found="no" - preserve_LIBS="$LIBS" - preserve_LDFLAGS="$LDFLAGS" - preserve_CFLAGS="$CFLAGS" - AC_MSG_CHECKING(for APR) AC_ARG_WITH(apr, - [ --with-apr=DIR prefix for installed APR, or path to APR build tree], + [ --with-apr=DIR|FILE prefix for installed APR, path to APR build tree, + or the full path to apr-config], [ if test "$withval" = "no" || test "$withval" = "yes"; then AC_MSG_ERROR([--with-apr requires a directory to be provided]) fi if test -x "$withval/bin/apr-config"; then - apr_config="$withval/bin/apr-config" - CFLAGS="$CFLAGS `$withval/bin/apr-config --cflags`" - LIBS="$LIBS `$withval/bin/apr-config --libs`" - LDFLAGS="$LDFLAGS `$withval/bin/apr-config --ldflags`" - else - apr_config="" + apr_found="yes" + apr_config="$withval/bin/apr-config" + elif test -f "$withval/apr-config"; then + apr_found="yes" + apr_config="$withval/apr-config" + elif test -x "$withval" && $withval --help > /dev/null 2>&1 ; then + apr_found="yes" + apr_config="$withval" fi - LIBS="$LIBS -lapr" - LDFLAGS="$preserve_LDFLAGS -L$withval/lib" - AC_TRY_LINK_FUNC(apr_initialize, [ - if test -f "$withval/include/apr.h"; then - dnl found an installed version of APR - apr_found="yes" - apr_libdir="$withval/lib" - apr_includes="-I$withval/include" - fi - ], [ - dnl look for a build tree (note: already configured/built) - if test -f "$withval/libapr.la"; then - apr_found="yes" - apr_libdir="" - apr_la_file="$withval/libapr.la" - apr_vars="$withval/APRVARS" - if test -x $withval/apr-config; then - apr_config="$withval/apr-config" - else - apr_config="" - fi - apr_includes="-I$withval/include" - if test ! -f "$withval/APRVARS.in"; then - dnl extract the APR source directory without polluting our - dnl shell variable space - apr_srcdir="`sed -n '/APR_SOURCE_DIR/s/.*"\(.*\)"/\1/p' $apr_vars`" - apr_includes="$apr_includes -I$apr_srcdir/include" - fi - fi - ]) - dnl if --with-apr is used, then the target prefix/directory must be valid if test "$apr_found" != "yes"; then - AC_MSG_ERROR([ -The directory given to --with-apr does not specify a prefix for an installed -APR, nor an APR build directory.]) + AC_MSG_ERROR([the --with-apr parameter is incorrect. It must specify an install prefix, a +build directory, or an apr-config file.]) fi ],[ dnl always look in the builtin/default places - LIBS="$LIBS -lapr" - AC_TRY_LINK_FUNC(apr_initialize, [ - dnl We don't have to do anything. - apr_found="yes" - apr_srcdir="" - apr_libdir="" - apr_includes="" - apr_la_file="" - apr_config="" - apr_vars="" - ], [ - dnl look in the some standard places (apparently not in builtin/default) + if apr-config --help > /dev/null 2>&1 ; then + apr_found="yes" + apr_config="apr-config" + else + dnl look in some standard places (apparently not in builtin/default) for lookdir in /usr /usr/local /opt/apr ; do - if test "$apr_found" != "yes"; then - LDFLAGS="$preserve_LDFLAGS -L$lookdir/lib" - AC_TRY_LINK_FUNC(apr_initialize, [ - apr_found="yes" - apr_libdir="$lookdir/lib" - apr_includes="-I$lookdir/include" - if test -x "$withval/bin/apr-config"; then - apr_config="$withval/bin/apr-config" - else - apr_config="" - fi - ]) + if test -x "$lookdir/bin/apr-config"; then + apr_found="yes" + apr_config="$lookdir/bin/apr-config" + break fi done - ]) - dnl We attempt to guess what the data will be *after* configure is run. - dnl Note, if we don't see configure, but do have configure.in, it'd be - dnl nice to run buildconf, but that's for another day. - if test "$apr_found" = "no" && test -n "$1" && test -x "$1/configure"; then - apr_found="reconfig" - apr_srcdir="$1" - if test -n "$2"; then - apr_builddir="$2/" - else - apr_builddir="" + fi + dnl if we have a bundled source directory, then we may have more work + if test -n "$1"; then + apr_temp_abs_srcdir="`cd $1 && pwd`" + if test "$apr_found" = "yes" \ + -a "`$apr_config --srcdir`" = "$apr_temp_abs_srcdir"; then + dnl the installed apr-config represents our source directory, so + dnl pretend we didn't see it and just use our bundled source + apr_found="no" fi - apr_libdir="" - apr_la_file="$apr_builddir$apr_srcdir/libapr.la" - apr_vars="$apr_builddir$apr_srcdir/APRVARS" - if test -f "$apr_builddir$apr_srcdir/apr-config.in"; then - apr_config="$apr_builddir$apr_srcdir/apr-config" - else - apr_config="" + dnl We could not find an apr-config; use the bundled one + if test "$apr_found" = "no"; then + apr_found="reconfig" + if test -n "$2"; then + apr_config="$2/apr-config" + else + apr_config="$1/apr-config" + fi fi - apr_includes="-I$apr_builddir$apr_srcdir/include" fi ]) - if test "$apr_found" != "no" && test "$apr_libdir" != ""; then - if test "$apr_vars" = "" && test -f "$apr_libdir/APRVARS"; then - apr_vars="$apr_libdir/APRVARS" - fi - if test "$apr_la_file" = "" && test -f "$apr_libdir/libapr.la"; then - apr_la_file="$apr_libdir/libapr.la" - fi - fi - AC_MSG_RESULT($apr_found) - CFLAGS="$preserve_CFLAGS" - LIBS="$preserve_LIBS" - LDFLAGS="$preserve_LDFLAGS" ]) From bc0d5d3b5e9e1bbf828e11778d447d873a6e7a2c Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 6 Feb 2002 21:01:36 +0000 Subject: [PATCH 2914/7878] Fix a bug where we are NULL'ing too many bytes. Submitted by: William A. Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62919 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 4e51cd38c9c..575855a53d3 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -240,7 +240,7 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) if (apr_pools_initialized++) return APR_SUCCESS; - memset(&global_allocator, 0, SIZEOF_ALLOCATOR_T); + memset(&global_allocator, 0, sizeof(global_allocator)); if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, APR_POOL_FDEFAULT)) != APR_SUCCESS) { return rv; @@ -269,7 +269,7 @@ APR_DECLARE(void) apr_pool_terminate(void) apr_pool_destroy(global_pool); /* This will also destroy the mutex */ global_pool = NULL; - memset(&global_allocator, 0, SIZEOF_ALLOCATOR_T); + memset(&global_allocator, 0, sizeof(global_allocator)); } #ifdef NETWARE From d62dea9b950f72b34bf11baaa62d9969b2a7e587 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Wed, 6 Feb 2002 21:12:08 +0000 Subject: [PATCH 2915/7878] Fix a typo in the construction of $flags. Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62920 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apr-config.in b/apr-config.in index e3c31c0508e..56c5d9aed72 100644 --- a/apr-config.in +++ b/apr-config.in @@ -181,7 +181,7 @@ while test $# -gt 0; do ### avoid using -L if libdir is a "standard" location like /usr/lib flags="$flags -L$libdir -lapr" else - flags="$flags-L$thisdir -lapr" + flags="$flags -L$thisdir -lapr" fi ;; --apr-la-file) From 44bdae0ecd9de6c1fefcae61af25ee532e8c39dc Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 6 Feb 2002 21:55:40 +0000 Subject: [PATCH 2916/7878] Fixed a dead reference in the project git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62921 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 178863 -> 178950 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index a749d81870c7a3290da0af3f41ffb55c303886a6..868c5f32bd127d9586d7d3dfaac2ae8b41c8fcad 100644 GIT binary patch delta 91102 zcmaI71z1}_*C&n?XwepmTXBct9$F}FrC4#d;%@!{YU|c1c;5EcTu%zC5crqMjbdOT1R285yF2B#~axAuszDLf{#; z*^tTqSVajv%-Kk3(o{gXAxkm^jYuVAJU0r!B8)_b+#Jv zWL5!0t;?}r^?sDw>eu~UB!ne4RO{^3G!A`Ip}zQ1)yQ+^OWvMK6rdfPv#sv7utm_Q z*SdA#ygH$6=D?%#@J^?CnoOn66Abgai~Z`DU{1KY)*-Q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#-%v z{V)0Qv<0nHn?V@=VJ6&_+o)R#Rcaq#t&6?eqm7#TBa=mr!1sJ{=Nj2Sx~%j3t>(`c z$=HmTR01NB$9K=3;0d!nKJZk$F2{F&6j}6EP8{cA(6e}KiOMs#Sz^rQU^0@405?+j zpYcO`Vyg*tYm+h48#Geudh~npW3V{S=D& z2ahF`bJ)a1G~TdbxJcV| zrW=g}kLZU1Bg&CCx!(8)yeGJf`7B_fX#y?%j{7~x#60Nr_lHp$eW9of@A!i9hPDG(DCx&uCU*7@ zLNY=?yZlObFZxuYD2&1vT9_cAAhu4SqAJ!u66CXki!yHZ;1 m-a}1LROS74voI@*t0CLF4)mK9U#R@iZnk?luFDJpf&3qeA9m#c From c935da0e72c7e509b3759dbf0734fceb41006efc Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Thu, 7 Feb 2002 00:38:18 +0000 Subject: [PATCH 2919/7878] be a bit more restrictive: look for an exectuable apr-config, rather than just an existing file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62924 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 86dabcceaf0..ef73caca88f 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -50,7 +50,7 @@ AC_DEFUN(APR_FIND_APR, [ if test -x "$withval/bin/apr-config"; then apr_found="yes" apr_config="$withval/bin/apr-config" - elif test -f "$withval/apr-config"; then + elif test -x "$withval/apr-config"; then apr_found="yes" apr_config="$withval/apr-config" elif test -x "$withval" && $withval --help > /dev/null 2>&1 ; then From 2e3abff098679d637fbdfb76de5c6a3f29953fce Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Thu, 7 Feb 2002 00:57:21 +0000 Subject: [PATCH 2920/7878] Even on NT, a file can be without a DACL -- for example, if it's in a FAT volume. In that case, the access rights are effectively 0777, modulo the readonly bit -- just like they're computed for Win9x. Before this change, apr_file_info_get would return APR_INCOMPLETE if APR_FILE_PROT was requested for such files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62925 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index a50d534b39d..fca7e1b4639 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -203,6 +203,25 @@ static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname, return rv; } +static void guess_protection_bits(apr_finfo_t *finfo) +{ + /* Read, write execute for owner. In the Win9x environment, any + * readable file is executable (well, not entirely 100% true, but + * still looking for some cheap logic that would help us here.) + * The same holds on NT if a file doesn't have a DACL (e.g., on FAT) + */ + if (finfo->protection & APR_FREADONLY) { + finfo->protection |= APR_WREAD | APR_WEXECUTE; + } + else { + finfo->protection |= APR_WREAD | APR_WEXECUTE | APR_WWRITE; + } + finfo->protection |= (finfo->protection << prot_scope_group) + | (finfo->protection << prot_scope_user); + + finfo->valid |= APR_FINFO_UPROT | APR_FINFO_GPROT | APR_FINFO_WPROT; +} + apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, apr_int32_t wanted, int whatfile) { @@ -210,23 +229,8 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, PACL dacl = NULL; apr_status_t rv; - if (apr_os_level < APR_WIN_NT) - { - /* Read, write execute for owner. In the Win9x environment, any - * readable file is executable (well, not entirely 100% true, but - * still looking for some cheap logic that would help us here.) - */ - if (finfo->protection & APR_FREADONLY) { - finfo->protection |= APR_WREAD | APR_WEXECUTE; - } - else { - finfo->protection |= APR_WREAD | APR_WEXECUTE | APR_WWRITE; - } - finfo->protection |= (finfo->protection << prot_scope_group) - | (finfo->protection << prot_scope_user); - - finfo->valid |= APR_FINFO_UPROT | APR_FINFO_GPROT | APR_FINFO_WPROT; - } + if (apr_os_level < APR_WIN_NT) + guess_protection_bits(finfo); else if (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) { /* On NT this request is incredibly expensive, but accurate. @@ -296,6 +300,8 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, /* Retrieved the discresionary access list */ resolve_prot(finfo, wanted, dacl); } + else if (wanted & APR_FINFO_PROT) + guess_protection_bits(finfo); } return ((wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS); From efea4c10425edf2992486235b4966bd283f5b48d Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 7 Feb 2002 22:48:17 +0000 Subject: [PATCH 2921/7878] HPUX 11.0 doesn't have /dev/null, but HPUX 11i does, so it tries to enable MMAP_ZERO which isn't supported. This is a workaround to fall back to SHMGET_ANON on hpux11. Submitted by: Aaron Bannert Reviewed by: Madhu Mathihalli git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62926 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.in b/configure.in index ed2e4fb51cb..f914ad75a16 100644 --- a/configure.in +++ b/configure.in @@ -531,6 +531,9 @@ case $host in APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_ZERO USE_SHMEM_SHMGET_ANON) fi ;; + *hpux11* ) + APR_DECISION_OVERRIDE(USE_SHMEM_SHMGET_ANON) + ;; esac APR_END_DECISION AC_DEFINE_UNQUOTED($ac_decision) From cbfec699ab5197b599aa81b28e88ae85e2e4aaeb Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 7 Feb 2002 22:49:18 +0000 Subject: [PATCH 2922/7878] Trailing whitespace is evil. This gets rids of it. Add some comments to #endif lines. No code changes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62927 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 224 ++++++++++++++++++++-------------------- 1 file changed, 112 insertions(+), 112 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 575855a53d3..075ee281370 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -73,7 +73,7 @@ #if APR_HAVE_UNISTD_H #include /* for getpid */ #endif - + /* * Debug level @@ -98,7 +98,7 @@ #define BOUNDARY_INDEX 12 #define BOUNDARY_SIZE (1 << BOUNDARY_INDEX) - + /* * Macros and defines */ @@ -109,7 +109,7 @@ #define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) - + /* * Structures */ @@ -131,7 +131,7 @@ struct allocator_t { apr_uint32_t max_index; #if APR_HAS_THREADS apr_thread_mutex_t *mutex; -#endif +#endif /* APR_HAS_THREADS */ apr_pool_t *owner; node_t *free[MAX_INDEX]; }; @@ -191,7 +191,7 @@ struct apr_pool_t { #endif /* APR_POOL_DEBUG */ #ifdef NETWARE apr_os_proc_t owner_proc; -#endif +#endif /* defined(NETWARE) */ }; #define SIZEOF_POOL_T APR_ALIGN_DEFAULT(sizeof(apr_pool_t)) @@ -205,11 +205,11 @@ static apr_byte_t apr_pools_initialized = 0; static apr_pool_t *global_pool = NULL; #if !APR_POOL_DEBUG -static allocator_t global_allocator = { +static allocator_t global_allocator = { 0, /* max_index */ #if APR_HAS_THREADS NULL, /* mutex */ -#endif +#endif /* APR_HAS_THREADS */ NULL, /* owner */ { NULL } /* free[0] */ }; @@ -217,7 +217,7 @@ static allocator_t global_allocator = { #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) static apr_file_t *file_stderr = NULL; -#endif +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ /* * Local functions @@ -239,23 +239,23 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) if (apr_pools_initialized++) return APR_SUCCESS; - + memset(&global_allocator, 0, sizeof(global_allocator)); if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, APR_POOL_FDEFAULT)) != APR_SUCCESS) { return rv; } - -#if APR_HAS_THREADS - if ((rv = apr_thread_mutex_create(&global_allocator.mutex, + +#if APR_HAS_THREADS + if ((rv = apr_thread_mutex_create(&global_allocator.mutex, APR_THREAD_MUTEX_DEFAULT, global_pool)) != APR_SUCCESS) { return rv; } -#endif +#endif /* APR_HAS_THREADS */ global_allocator.owner = global_pool; apr_pools_initialized = 1; - + return APR_SUCCESS; } @@ -265,7 +265,7 @@ APR_DECLARE(void) apr_pool_terminate(void) return; apr_pools_initialized = 0; - + apr_pool_destroy(global_pool); /* This will also destroy the mutex */ global_pool = NULL; @@ -289,7 +289,7 @@ void netware_pool_proc_cleanup () } return; } -#endif +#endif /* defined(NETWARE) */ /* * Memory allocation @@ -298,7 +298,7 @@ void netware_pool_proc_cleanup () static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) { node_t *node, **ref; - apr_uint32_t i, index, max_index; + apr_uint32_t i, index, max_index; /* Round up the block size to the next boundary, but always * allocate at least a certain size (MIN_ALLOC). @@ -320,13 +320,13 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) if (allocator->mutex) apr_thread_mutex_lock(allocator->mutex); #endif /* APR_HAS_THREADS */ - + /* Walk the free list to see if there are * any nodes on it of the requested size * * NOTE: an optimization would be to check * allocator->free[index] first and if no - * node is present, directly use + * node is present, directly use * allocator->free[max_index]. This seems * like overkill though and could cause * memory waste. @@ -401,13 +401,13 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) return node; } - + #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_unlock(allocator->mutex); #endif /* APR_HAS_THREADS */ } - + /* If we haven't got a suitable node, malloc a new one * and initialize it. */ @@ -430,7 +430,7 @@ static APR_INLINE void node_free(allocator_t *allocator, node_t *node) #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_lock(allocator->mutex); -#endif +#endif /* APR_HAS_THREADS */ max_index = allocator->max_index; @@ -465,7 +465,7 @@ static APR_INLINE void node_free(allocator_t *allocator, node_t *node) #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_unlock(allocator->mutex); -#endif +#endif /* APR_HAS_THREADS */ } APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) @@ -482,7 +482,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) if (endp < active->endp) { mem = active->first_avail; active->first_avail = endp; - + return mem; } @@ -493,7 +493,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) return NULL; } - active->next = pool->active = node; + active->next = pool->active = node; mem = node->first_avail; node->first_avail += size; @@ -517,7 +517,7 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) active->first_avail = endp; memset(mem, 0, size); - + return mem; } @@ -530,13 +530,13 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) return NULL; } - active->next = pool->active = node; + active->next = pool->active = node; mem = node->first_avail; node->first_avail += size; - + memset(mem, 0, size); - + return mem; } @@ -549,7 +549,7 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) { node_t *active; - /* Destroy the subpools. The subpools will detach themselves from + /* Destroy the subpools. The subpools will detach themselves from * this pool thus this loop is safe and easy. */ while (pool->child) @@ -569,12 +569,12 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) /* Find the node attached to the pool structure, reset it, make * it the active node and free the rest of the nodes. */ - active = pool->active = pool->self; + active = pool->active = pool->self; active->first_avail = pool->self_first_avail; - + if (active->next == NULL) return; - + node_free(pool->allocator, active->next); active->next = NULL; } @@ -585,7 +585,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) allocator_t *allocator; apr_uint32_t index; - /* Destroy the subpools. The subpools will detach themselve from + /* Destroy the subpools. The subpools will detach themselve from * this pool thus this loop is safe and easy. */ while (pool->child) @@ -604,7 +604,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) if ((mutex = pool->parent->allocator->mutex) != NULL) apr_thread_mutex_lock(mutex); -#endif +#endif /* APR_HAS_THREADS */ if ((*pool->ref = pool->sibling) != NULL) pool->sibling->ref = pool->ref; @@ -612,16 +612,16 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) #if APR_HAS_THREADS if (mutex) apr_thread_mutex_unlock(mutex); -#endif +#endif /* APR_HAS_THREADS */ } - + /* Find the block attached to the pool structure. Save a copy of the * allocator pointer, because the pool struct soon will be no more. */ allocator = pool->allocator; active = pool->self; - /* If this pool happens to be the owner of the allocator, free + /* If this pool happens to be the owner of the allocator, free * everything in the allocator (that includes the pool struct * and the allocator). Don't worry about destroying the optional mutex * in the allocator, it will have been destroyed by the cleanup function. @@ -650,7 +650,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) node_free(allocator, active); } -APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, +APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, apr_uint32_t flags) @@ -679,7 +679,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, new_allocator = (allocator_t *)node->first_avail; pool = (apr_pool_t *)((char *)new_allocator + SIZEOF_ALLOCATOR_T); node->first_avail = pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; - + memset(new_allocator, 0, SIZEOF_ALLOCATOR_T); new_allocator->owner = pool; @@ -696,18 +696,18 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, if ((flags & APR_POOL_FLOCK) == APR_POOL_FLOCK) { apr_status_t rv; - if ((rv = apr_thread_mutex_create(&allocator->mutex, + if ((rv = apr_thread_mutex_create(&allocator->mutex, APR_THREAD_MUTEX_DEFAULT, pool)) != APR_SUCCESS) { node_free(allocator, node); return rv; } } -#endif +#endif /* APR_HAS_THREADS */ } else { pool = (apr_pool_t *)node->first_avail; node->first_avail = pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; - + pool->allocator = allocator; pool->active = pool->self = node; pool->abort_fn = abort_fn; @@ -720,13 +720,13 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, #ifdef NETWARE pool->owner_proc = (apr_os_proc_t)getnlmhandle(); -#endif +#endif /* defined(NETWARE) */ if ((pool->parent = parent) != NULL) { #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_lock(allocator->mutex); -#endif +#endif /* APR_HAS_THREADS */ if ((pool->sibling = parent->child) != NULL) pool->sibling->ref = &pool->sibling; @@ -736,7 +736,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_unlock(allocator->mutex); -#endif +#endif /* APR_HAS_THREADS */ } else { pool->sibling = NULL; @@ -795,7 +795,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) if (ps->got_a_new_node) { node->next = ps->free; - ps->free = node; + ps->free = node; } ps->node = active; @@ -837,8 +837,8 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) strp = ps.node->first_avail; ps.node->first_avail += size; - /* - * Link the node in if it's a new one + /* + * Link the node in if it's a new one */ if (ps.got_a_new_node) { active->next = pool->active = ps.node; @@ -867,7 +867,7 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, "[%lu" #if APR_HAS_THREADS "/%lu" -#endif +#endif /* APR_HAS_THREADS */ "] " "%7s " "(%10lu/%10lu/%10lu) " @@ -878,7 +878,7 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, (unsigned long)getpid(), #if APR_HAS_THREADS (unsigned long)apr_os_thread_current(), -#endif +#endif /* APR_HAS_THREADS */ event, (unsigned long)apr_pool_num_bytes(pool, 0), (unsigned long)apr_pool_num_bytes(pool, 1), @@ -893,7 +893,7 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, "[%lu" #if APR_HAS_THREADS "/%lu" -#endif +#endif /* APR_HAS_THREADS */ "] " "%7s " " " @@ -903,7 +903,7 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, (unsigned long)getpid(), #if APR_HAS_THREADS (unsigned long)apr_os_thread_current(), -#endif +#endif /* APR_HAS_THREADS */ event, (unsigned int)pool, file_line); @@ -933,7 +933,7 @@ static int apr_pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent, return 1; } - + child = child->sibling; } @@ -958,7 +958,7 @@ static int apr_pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent, if (pool == child || apr_pool_is_child_of(pool, child, NULL)) { return 1; } - + child = child->sibling; } @@ -983,7 +983,7 @@ static void apr_pool_check_integrity(apr_pool_t *pool) */ #if (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) if (!apr_pool_is_child_of(pool, global_pool, NULL)) { - apr_pool_log_event(pool, "LIFE", + apr_pool_log_event(pool, "LIFE", __FILE__ ":apr_pool_integrity check", 0); abort(); @@ -1012,13 +1012,13 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) if (apr_pools_initialized++) return APR_SUCCESS; - + /* Since the debug code works a bit differently then the * regular pools code, we ask for a lock here. The regular * pools code has got this lock embedded in the global * allocator, a concept unknown to debug mode. */ - if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, + if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, APR_POOL_FNEW_ALLOCATOR|APR_POOL_FLOCK)) != APR_SUCCESS) { return rv; } @@ -1034,14 +1034,14 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) "POOL DEBUG: [PID" #if APR_HAS_THREADS "/TID" -#endif +#endif /* APR_HAS_THREADS */ "] ACTION (SIZE /POOL SIZE /TOTAL SIZE) " "POOL \"TAG\" <__FILE__:__LINE__> (ALLOCS/TOTAL ALLOCS/CLEARS)\n"); - apr_pool_log_event(global_pool, "GLOBAL", __FILE__ ":apr_pool_initialize", 0); + apr_pool_log_event(global_pool, "GLOBAL", __FILE__ ":apr_pool_initialize", 0); } #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ - + return APR_SUCCESS; } @@ -1051,13 +1051,13 @@ APR_DECLARE(void) apr_pool_terminate(void) return; apr_pools_initialized = 0; - + apr_pool_destroy(global_pool); /* This will also destroy the mutex */ global_pool = NULL; #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) file_stderr = NULL; -#endif +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ } @@ -1069,7 +1069,7 @@ static void *pool_alloc(apr_pool_t *pool, apr_size_t size) { debug_node_t *node; void *mem; - + if ((mem = malloc(size)) == NULL) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); @@ -1099,7 +1099,7 @@ static void *pool_alloc(apr_pool_t *pool, apr_size_t size) pool->stat_alloc++; pool->stat_total_alloc++; - + return mem; } @@ -1118,14 +1118,14 @@ APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *pool, apr_size_t size, return mem; } - + APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *pool, apr_size_t size, const char *file_line) { void *mem; apr_pool_check_integrity(pool); - + mem = pool_alloc(pool, size); memset(mem, 0, size); @@ -1177,7 +1177,7 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) pool->stat_clear++; } -APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, +APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, const char *file_line) { apr_pool_check_integrity(pool); @@ -1189,7 +1189,7 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, pool_clear_debug(pool, file_line); } -APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, +APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, const char *file_line) { apr_pool_check_integrity(pool); @@ -1197,7 +1197,7 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) apr_pool_log_event(pool, "DESTROY", file_line, 1); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ - + pool_clear_debug(pool, file_line); /* Remove the pool from the parents child list */ @@ -1207,7 +1207,7 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, if ((mutex = pool->parent->mutex) != NULL) apr_thread_mutex_lock(mutex); -#endif +#endif /* APR_HAS_THREADS */ if ((*pool->ref = pool->sibling) != NULL) pool->sibling->ref = pool->ref; @@ -1215,17 +1215,17 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, #if APR_HAS_THREADS if (mutex) apr_thread_mutex_unlock(mutex); -#endif +#endif /* APR_HAS_THREADS */ } /* Free the pool itself */ free(pool); } -APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, +APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, - apr_uint32_t flags, + apr_uint32_t flags, const char *file_line) { apr_pool_t *pool; @@ -1250,7 +1250,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, } memset(pool, 0, SIZEOF_POOL_T); - + pool->abort_fn = abort_fn; pool->tag = file_line; pool->file_line = file_line; @@ -1260,7 +1260,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, #if APR_HAS_THREADS if (parent->mutex) apr_thread_mutex_lock(parent->mutex); -#endif +#endif /* APR_HAS_THREADS */ if ((pool->sibling = parent->child) != NULL) pool->sibling->ref = &pool->sibling; @@ -1270,7 +1270,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, #if APR_HAS_THREADS if (parent->mutex) apr_thread_mutex_unlock(parent->mutex); -#endif +#endif /* APR_HAS_THREADS */ } else { pool->sibling = NULL; @@ -1279,7 +1279,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, #if APR_HAS_THREADS pool->owner = apr_os_thread_current(); -#endif +#endif /* APR_HAS_THREADS */ if ((flags & APR_POOL_FNEW_ALLOCATOR) == APR_POOL_FNEW_ALLOCATOR) { #if APR_HAS_THREADS @@ -1293,18 +1293,18 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, * hide problems like creating a child pool of a pool * belonging to another thread. */ - if ((rv = apr_thread_mutex_create(&pool->mutex, + if ((rv = apr_thread_mutex_create(&pool->mutex, APR_THREAD_MUTEX_DEFAULT, pool)) != APR_SUCCESS) { free(pool); return rv; } -#endif +#endif /* APR_HAS_THREADS */ } else { #if APR_HAS_THREADS if (parent) pool->mutex = parent->mutex; -#endif +#endif /* APR_HAS_THREADS */ } *newpool = pool; @@ -1350,7 +1350,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) debug_node_t *node; apr_pool_check_integrity(pool); - + ps.size = 64; ps.mem = malloc(ps.size); ps.vbuff.curpos = ps.mem; @@ -1367,7 +1367,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) *ps.vbuff.curpos++ = '\0'; - /* + /* * Link the node in */ node = pool->nodes; @@ -1453,7 +1453,7 @@ static apr_size_t pool_num_bytes(apr_pool_t *pool) } #if APR_HAS_THREADS -static apr_size_t pool_num_bytes_recursive(apr_pool_t *pool, +static apr_size_t pool_num_bytes_recursive(apr_pool_t *pool, apr_thread_mutex_t *mutex) { apr_size_t size; @@ -1478,7 +1478,7 @@ static apr_size_t pool_num_bytes_recursive(apr_pool_t *pool, return size; } -#else +#else /* !APR_HAS_THREADS */ static apr_size_t pool_num_bytes_recursive(apr_pool_t *pool) { apr_size_t size; @@ -1493,8 +1493,8 @@ static apr_size_t pool_num_bytes_recursive(apr_pool_t *pool) } return size; -} -#endif +} +#endif /* !APR_HAS_THREADS */ APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *pool, int recurse) { @@ -1503,9 +1503,9 @@ APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *pool, int recurse) #if APR_HAS_THREADS return pool_num_bytes_recursive(pool, NULL); -#else +#else /* !APR_HAS_THREADS */ return pool_num_bytes_recursive(pool); -#endif +#endif /* !APR_HAS_THREADS */ } APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag) @@ -1584,22 +1584,22 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *ke { #if APR_POOL_DEBUG apr_pool_check_integrity(pool); -#endif - +#endif /* APR_POOL_DEBUG */ + if (pool->user_data == NULL) pool->user_data = apr_hash_make(pool); if (apr_hash_get(pool->user_data, key, APR_HASH_KEY_STRING) == NULL) { char *new_key = apr_pstrdup(pool, key); apr_hash_set(pool->user_data, new_key, APR_HASH_KEY_STRING, data); - } + } else { apr_hash_set(pool->user_data, key, APR_HASH_KEY_STRING, data); } if (cleanup) apr_pool_cleanup_register(pool, data, cleanup, cleanup); - + return APR_SUCCESS; } @@ -1609,8 +1609,8 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, const char *k { #if APR_POOL_DEBUG apr_pool_check_integrity(pool); -#endif - +#endif /* APR_POOL_DEBUG */ + if (pool->user_data == NULL) pool->user_data = apr_hash_make(pool); @@ -1618,7 +1618,7 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, const char *k if (cleanup) apr_pool_cleanup_register(pool, data, cleanup, cleanup); - + return APR_SUCCESS; } @@ -1626,8 +1626,8 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, ap { #if APR_POOL_DEBUG apr_pool_check_integrity(pool); -#endif - +#endif /* APR_POOL_DEBUG */ + if (pool->user_data == NULL) *data = NULL; else @@ -1653,11 +1653,11 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, apr_status_t (*child_cleanup_fn)(void *data)) { cleanup_t *c; - + #if APR_POOL_DEBUG apr_pool_check_integrity(p); -#endif - +#endif /* APR_POOL_DEBUG */ + if (p != NULL) { c = (cleanup_t *)apr_palloc(p, sizeof(cleanup_t)); c->data = data; @@ -1675,8 +1675,8 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, #if APR_POOL_DEBUG apr_pool_check_integrity(p); -#endif - +#endif /* APR_POOL_DEBUG */ + if (p == NULL) return; @@ -1701,7 +1701,7 @@ APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, #if APR_POOL_DEBUG apr_pool_check_integrity(p); -#endif +#endif /* APR_POOL_DEBUG */ if (p == NULL) return; @@ -1814,23 +1814,23 @@ static void free_proc_chain(struct process_chain *procs) if (apr_proc_wait(pc->pid, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE) pc->kill_how = kill_never; } -#endif +#endif /* !defined(NEED_WAITPID) */ for (pc = procs; pc; pc = pc->next) { if ((pc->kill_how == kill_after_timeout) || (pc->kill_how == kill_only_once)) { /* * Subprocess may be dead already. Only need the timeout if not. - * Note: apr_proc_kill on Windows is TerminateProcess(), which is + * Note: apr_proc_kill on Windows is TerminateProcess(), which is * similar to a SIGKILL, so always give the process a timeout * under Windows before killing it. */ #ifdef WIN32 need_timeout = 1; -#else +#else /* !defined(WIN32) */ if (apr_proc_kill(pc->pid, SIGTERM) == APR_SUCCESS) need_timeout = 1; -#endif +#endif /* !defined(WIN32) */ } else if (pc->kill_how == kill_always) { apr_proc_kill(pc->pid, SIGKILL); @@ -1857,7 +1857,7 @@ static void free_proc_chain(struct process_chain *procs) } #ifdef WIN32 - /* + /* * XXX: Do we need an APR function to clean-up a proc_t? * Well ... yeah ... but we can't since it's scope is ill defined. * We can't dismiss the handle until the apr_proc_wait above is @@ -1871,12 +1871,12 @@ static void free_proc_chain(struct process_chain *procs) } } } -#endif /* WIN32 */ +#endif /* defined(WIN32) */ } /* - * Pool creation/destruction stubs, for people who are running + * Pool creation/destruction stubs, for people who are running * mixed release/debug enviroments. */ @@ -1959,7 +1959,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_uint32_t flags) { - return apr_pool_create_ex_debug(newpool, parent, + return apr_pool_create_ex_debug(newpool, parent, abort_fn, flags, "undefined"); } From feec6fee653408cd69b8bfae1063c747eb5ff421 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 7 Feb 2002 22:51:25 +0000 Subject: [PATCH 2923/7878] HPUX 11.0 doesn't have /dev/null, but HPUX 11i does, so it tries to enable MMAP_ZERO which isn't supported. This is a workaround to fall back to SHMGET_ANON on hpux11. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62928 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 2365c66568c..f97ee719f01 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Disable SHMEM_MMAP_ZERO on HPUX 11.x where it is not supported. + Use SHMEM_SHMGET_ANON instead. [Aaron Bannert] + *) Fix a few attempts to add to a void * ptr in the Unix shared memory support code. PR #9710 Per Ekman [pek@pdc.kth.se] From 4189cc5eaf5ca7e1845977e3dea5bcda6ff6b303 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 8 Feb 2002 18:38:15 +0000 Subject: [PATCH 2924/7878] Simplify some logic in the pools debug code by using a 'nested' lock. Factor out the code for walking the pools tree. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62929 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 157 +++++++++++++++------------------------- 1 file changed, 59 insertions(+), 98 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 075ee281370..6828ade51f6 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -856,6 +856,47 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) * Debug helper functions */ + +/* + * Walk the pool tree rooted at pool, depth first. When fn returns + * anything other than 0, abort the traversal and return the value + * returned by fn. + */ +static int apr_pool_walk_tree(apr_pool_t *pool, + int (*fn)(apr_pool_t *pool, void *data), + void *data) +{ + int rv; + apr_pool_t *child; + + rv = fn(pool, data); + if (rv) + return rv; + +#if APR_HAS_THREADS + if (pool->mutex) { + apr_thread_mutex_lock(pool->mutex); + } +#endif /* APR_HAS_THREADS */ + + child = pool->child; + while (child) { + rv = apr_pool_walk_tree(child, fn, data); + if (rv) + break; + + child = child->sibling; + } + +#if APR_HAS_THREADS + if (pool->mutex) { + apr_thread_mutex_unlock(pool->mutex); + } +#endif /* APR_HAS_THREADS */ + + return rv; +} + static void apr_pool_log_event(apr_pool_t *pool, const char *event, const char *file_line, int deref) { @@ -912,64 +953,25 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ } -#if APR_HAS_THREADS -static int apr_pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent, - apr_thread_mutex_t *mutex) +static int pool_is_child_of(apr_pool_t *parent, void *data) { - apr_pool_t *child; - - if (parent == NULL) - return 0; - - if (parent->mutex && parent->mutex != mutex) - apr_thread_mutex_lock(parent->mutex); - - child = parent->child; + apr_pool_t *pool = (apr_pool_t *)data; - while (child) { - if (pool == child || apr_pool_is_child_of(pool, child, parent->mutex)) { - if (parent->mutex && parent->mutex != mutex) - apr_thread_mutex_unlock(parent->mutex); - - return 1; - } - - child = child->sibling; - } - - if (parent->mutex && parent->mutex != mutex) - apr_thread_mutex_unlock(parent->mutex); - - return 0; + return (pool == parent); } -#else /* !APR_HAS_THREADS */ -static int apr_pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent, - void *dummy) +static int apr_pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent) { - apr_pool_t *child; - if (parent == NULL) return 0; - child = parent->child; - - while (child) { - if (pool == child || apr_pool_is_child_of(pool, child, NULL)) { - return 1; - } - - child = child->sibling; - } - - return 0; + return apr_pool_walk_tree(parent, pool_is_child_of, pool); } -#endif /* !APR_HAS_THREADS */ static void apr_pool_check_integrity(apr_pool_t *pool) { /* Rule of thumb: use of the global pool is always - * ok, since the only user this apr_pools.c. Unless + * ok, since the only user is apr_pools.c. Unless * people have searched for the top level parent and * started to use that... */ @@ -982,7 +984,7 @@ static void apr_pool_check_integrity(apr_pool_t *pool) * destroyed, in which case we abort(). */ #if (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) - if (!apr_pool_is_child_of(pool, global_pool, NULL)) { + if (!apr_pool_is_child_of(pool, global_pool)) { apr_pool_log_event(pool, "LIFE", __FILE__ ":apr_pool_integrity check", 0); @@ -1294,7 +1296,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, * belonging to another thread. */ if ((rv = apr_thread_mutex_create(&pool->mutex, - APR_THREAD_MUTEX_DEFAULT, pool)) != APR_SUCCESS) { + APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) { free(pool); return rv; } @@ -1433,9 +1435,9 @@ APR_DECLARE(apr_pool_t *) apr_find_pool(const void *mem) return find_pool(global_pool, mem); } -static apr_size_t pool_num_bytes(apr_pool_t *pool) +static int pool_num_bytes(apr_pool_t *pool, void *data) { - apr_size_t size = 0; + apr_size_t *psize = (apr_size_t *)data; debug_node_t *node; apr_uint32_t index; @@ -1443,70 +1445,29 @@ static apr_size_t pool_num_bytes(apr_pool_t *pool) while (node) { for (index = 0; index < node->index; index++) { - size += (char *)node->endp[index] - (char *)node->beginp[index]; + *psize += (char *)node->endp[index] - (char *)node->beginp[index]; } node = node->next; } - return size; + return 0; } -#if APR_HAS_THREADS -static apr_size_t pool_num_bytes_recursive(apr_pool_t *pool, - apr_thread_mutex_t *mutex) +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *pool, int recurse) { - apr_size_t size; - apr_pool_t *child; - - size = pool_num_bytes(pool); - - if (pool->mutex && pool->mutex != mutex) { - apr_thread_mutex_lock(pool->mutex); - } - - child = pool->child; - while (child) { - size += pool_num_bytes_recursive(child, pool->mutex); + apr_size_t size = 0; - child = child->sibling; - } + if (!recurse) { + pool_num_bytes(pool, &size); - if (pool->mutex && pool->mutex != mutex) { - apr_thread_mutex_unlock(pool->mutex); + return size; } - return size; -} -#else /* !APR_HAS_THREADS */ -static apr_size_t pool_num_bytes_recursive(apr_pool_t *pool) -{ - apr_size_t size; - - size = pool_num_bytes(pool); - - pool = pool->child; - while (pool) { - size += pool_num_bytes_recursive(pool); - - pool = pool->sibling; - } + apr_pool_walk_tree(pool, pool_num_bytes, &size); return size; } -#endif /* !APR_HAS_THREADS */ - -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *pool, int recurse) -{ - if (!recurse) - return pool_num_bytes(pool); - -#if APR_HAS_THREADS - return pool_num_bytes_recursive(pool, NULL); -#else /* !APR_HAS_THREADS */ - return pool_num_bytes_recursive(pool); -#endif /* !APR_HAS_THREADS */ -} APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag) { From 47f76493b6d87e63a9c969699c21c5276440093a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 8 Feb 2002 19:09:19 +0000 Subject: [PATCH 2925/7878] Directly included the NKS/errno.h header git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62930 13f79535-47bb-0310-9956-ffa450edef68 --- locks/netware/thread_cond.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c index ff0379e4a20..19ec40d5bab 100644 --- a/locks/netware/thread_cond.c +++ b/locks/netware/thread_cond.c @@ -52,6 +52,8 @@ * . */ +#include + #include "apr.h" #include "apr_private.h" #include "apr_general.h" From 22641d7928fd4dfdd56abfdf9fada596fec4fe6d Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 8 Feb 2002 19:11:13 +0000 Subject: [PATCH 2926/7878] Removed a workaround for a bug that has been fixed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62931 13f79535-47bb-0310-9956-ffa450edef68 --- locks/netware/thread_mutex.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index 2747202f003..a38ce429ba8 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -108,10 +108,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { - if (NXMutexDepth(mutex->mutex) > 0) { - NXUnlock(mutex->mutex); - } - + NXUnlock(mutex->mutex); return APR_SUCCESS; } From c484782f8ab568a932d26931a40cf66c27fc32e6 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 8 Feb 2002 19:14:30 +0000 Subject: [PATCH 2927/7878] Getting ready for some API name changes in the NetWare libraries git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62932 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 17 +++++++++++++++++ include/apr.hnw | 4 ++-- include/arch/netware/apr_private.h | 3 +++ include/arch/netware/internal_time.h | 5 +++++ misc/netware/aprlib.def | 3 +++ misc/netware/rand.c | 9 +++++++++ 6 files changed, 39 insertions(+), 2 deletions(-) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index bb86788ab74..f69b88aea93 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -54,6 +54,7 @@ #include #include +#include #include "fileio.h" #include "apr_strings.h" @@ -92,9 +93,18 @@ apr_status_t apr_netware_pipe_cleanup(void *thefile) return rv; } +#ifdef WAITING_FOR_UPDATE +#ifndef NX_CTL_FLAGS +#define NX_CTL_FLAGS 0x00000001 +int NXGetCtlInfo(NXHandle_t handle, unsigned long command, ...); +int NXSetCtlInfo(NXHandle_t handle, unsigned long command, ...); +#endif +#endif + static apr_status_t pipeblock(apr_file_t *thepipe) { int err; +#ifdef WAITING_FOR_UPDATE unsigned long flags; if (!(err = NXGetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, &flags))) @@ -102,6 +112,9 @@ static apr_status_t pipeblock(apr_file_t *thepipe) flags &= ~NX_O_NONBLOCK; err = NXSetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, flags); } +#else + err = NXIoSetBlockingState(thepipe->filedes, 1); +#endif if (err) return convert_error (err); @@ -113,6 +126,7 @@ static apr_status_t pipeblock(apr_file_t *thepipe) static apr_status_t pipenonblock(apr_file_t *thepipe) { int err; +#ifdef WAITING_FOR_UPDATE unsigned long flags; if (!(err = NXGetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, &flags))) @@ -120,6 +134,9 @@ static apr_status_t pipenonblock(apr_file_t *thepipe) flags |= NX_O_NONBLOCK; err = NXSetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, flags); } +#else + err = NXIoSetBlockingState(thepipe->filedes, 0); +#endif if (err) return convert_error (err); diff --git a/include/apr.hnw b/include/apr.hnw index e36acfdf1af..882cf0c328a 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -223,8 +223,8 @@ typedef unsigned short apr_uint16_t; typedef int apr_int32_t; typedef unsigned int apr_uint32_t; -typedef INT64 apr_int64_t; -typedef unsigned INT64 apr_uint64_t; +typedef long long apr_int64_t; +typedef unsigned long long apr_uint64_t; typedef size_t apr_size_t; typedef ssize_t apr_ssize_t; diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index d3b6dca01b2..66483d312ae 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -174,5 +174,8 @@ int unregister_NLM(void *NLMHandle); #undef malloc #define malloc(x) library_malloc(gLibHandle,x) +/* Changes that are waiting for an updated runtime library. */ +#define WAITING_FOR_UPDATE + #endif /*APR_PRIVATE_H*/ #endif /*NETWARE*/ diff --git a/include/arch/netware/internal_time.h b/include/arch/netware/internal_time.h index d4e13f4d7c1..9f1ea739886 100644 --- a/include/arch/netware/internal_time.h +++ b/include/arch/netware/internal_time.h @@ -57,6 +57,11 @@ #include "apr.h" +#ifdef WAITING_FOR_UPDATE +#undef timezone +# define timezone (*___timezone()) +#endif + void apr_netware_setup_time(void); #endif /* TIME_INTERNAL_H */ diff --git a/misc/netware/aprlib.def b/misc/netware/aprlib.def index 0a2a01eb8f3..ed42c9350a7 100644 --- a/misc/netware/aprlib.def +++ b/misc/netware/aprlib.def @@ -1,3 +1,6 @@ MODULE LIBC.NLM MODULE WS2_32.NLM +IMPORT NXGetRandom +IMPORT NXGetCtlInfo +IMPORT NXSetCtlInfo EXPORT @aprlib.imp diff --git a/misc/netware/rand.c b/misc/netware/rand.c index 01329d114a5..7c4544c2417 100644 --- a/misc/netware/rand.c +++ b/misc/netware/rand.c @@ -55,15 +55,24 @@ #define APR_WANT_MEMFUNC #include "apr_want.h" #include "apr_general.h" +#include "apr_private.h" #if APR_HAS_RANDOM #include +#ifdef WAITING_FOR_UPDATE +int NXGetRandom( size_t width, void *result ); +#endif + APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, int length) { +#ifdef WAITING_FOR_UPDATE return NXGetRandom(length, buf); +#else + return NXSeedRandom(length, buf); +#endif } #endif /* APR_HAS_RANDOM */ From 1d4003ba36c253744f21513f589b9bab01c36607 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 8 Feb 2002 19:15:15 +0000 Subject: [PATCH 2928/7878] Added the renaming of apr_ldap.hnw to the prebuild for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62933 13f79535-47bb-0310-9956-ffa450edef68 --- build/prebuildNW.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/build/prebuildNW.bat b/build/prebuildNW.bat index 6702672b915..427aa25ece6 100755 --- a/build/prebuildNW.bat +++ b/build/prebuildNW.bat @@ -28,6 +28,7 @@ copy ..\include\apr.hnw ..\include\apr.h @echo Fixing up the APR-Util headers copy ..\..\apr-util\include\apu.hnw ..\..\apr-util\include\apu.h +copy ..\..\apr-util\include\apr_ldap.hnw ..\..\apr-util\include\apr_ldap.h copy ..\..\apr-util\include\private\apu_config.hw ..\..\apr-util\include\private\apu_config.h copy ..\..\apr-util\xml\expat\lib\expat.h.in ..\..\apr-util\xml\expat\lib\expat.h copy ..\..\apr-util\xml\expat\lib\config.hnw ..\..\apr-util\xml\expat\lib\config.h From 0b0ce3d0a637908af67a3af6fe10081b11f5ee7f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 8 Feb 2002 19:16:34 +0000 Subject: [PATCH 2929/7878] Renamed the internal environment variable reference from NDK to LIBC and added apr-util/LDAP to the build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62934 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 177702 -> 176721 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index b5088168455d71c20d2fd44b9a00127bccd19c8a..68a5054ed59e6a8559c3d005c7420451a07415ef 100644 GIT binary patch delta 89978 zcmZ^~1yCG8*EWi80s%sB2%g{)JUGDv!6m`nHMs5|0fIxY0KpxCyDtRS;0}vBECkuW z0(bMi-*@Z3RsXG;ot@U{?$hTv{q&qJI>w&d#ty7U9n}DS8Y-|)k1gh9Y>4A;AUoUD=5x6kRv$`&%^oMU*vR6To8&bus<>RBJ1xZ~ zH$8T$Tsw5ScD1(3*oUSa-=szqN=uJ+8kqZ=d`$DR zGG4TBPA>%NSB3s&jy{h65b?4)P2-Id;iVLamW(K}bu&o6j+$n)ajy80!=ayR`{-_; z-d3QMsAZ0Ebp@V&MqV^vO=0LuTS-h9Bk$u4A*Bk8(!KWJ^!2PQ62tG@)o1=KVz4Pp z+7Kuh#FB28y6b6MY4IJxnQHY|__y}v)92(%(rR|Vr&!7NX9zr~azGPPnf-_42}qxb2Q%?kWn zc)pK^`F?q>>T0%Gmem^9r)gS)+-EI}vzQQ49MX~Go4V@}C3xuheSJn`D7ERbSQxkq zS@)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si#A7mM)KWy;Paz{+q!L(($K$B!d(#tGKSSGsG%S=7&46mV3zJi{x_@XSU{ujtYC z${VT~yU>*wYR50vokF3AJvIUnr4FVERzx-B7HW#ZH1>+&swtXIHvIV&w{RY@S7>Od zCI{*r)a{&QbSg*nufrehhvnLFQtpmSOS8P6t`n+&t-CFKudf(7Y3?|*``Bh;BVl#w zFUC{6eObV>6Gp?8nTerU;8o##cPxW(>Y569GydUm8%px!gUqPwRRCioS6-w-X0-kB z4b}#wYz4~;e7%mFkCoALE901vzyxx+ax?MyxgRR5hO5rvI z(3+T@;uULR)Emxml4&1mWPVUw=EO~D*FJZ3Z*M3_b+dxYrB4=Vo^sp88he2iHq5(A)hX4)7FtPLsQz@ z!gpc2VESL-xgKO|JqQ9g2f@Dan0tdRQkdv@dEpMH4+RRQ{uI^^a`whl-af zFP!xeXhlx4n;)6$l!8uIFZL3K$^#ogvhfQ-U6m(}4GsZ83%`^9R~XhG{G!9bG#2Y1 z882e+5+93MVMvuf)O2^TBPWxapYEezpnXwl*uY2u~8pj zN6E0I>Gsx?lerS*bd#>?Vj)KCRAWje%1w67sw h(-keS9qX?ZV*Gn8P`{=#bl0b_U2E??gFzsW{|9Kb;A;Q? From 42691e1d9a08e0827d2d792c97bdfaec47030816 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 8 Feb 2002 20:27:27 +0000 Subject: [PATCH 2930/7878] Add apr-so-ext and apr-lib-target which the APR-util build system depends on. (It was previously getting them from APRVARS, but let's remove that dependency from apr-util.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62935 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apr-config.in b/apr-config.in index 56c5d9aed72..8314546344d 100644 --- a/apr-config.in +++ b/apr-config.in @@ -90,6 +90,8 @@ Known values for OPTION are: --link-ld print link switch(es) for linking to APR --link-libtool print the libtool inputs for linking to APR --apr-la-file print the path to the .la file, if available + --apr-so-ext print the extensions of shared objects on this platform + --apr-lib-target print the libtool target information --help print this help When linking with libtool, an application should do something like: @@ -189,6 +191,12 @@ while test $# -gt 0; do flags="$flags $LA_FILE" fi ;; + --apr-so-ext) + flags="$flags $APR_SO_EXT" + ;; + --apr-lib-target) + flags="$flags $APR_LIB_TARGET" + ;; --help) show_usage exit 0 From a6a62e52acb34b0c483d2e75ab6159fb416bb5fe Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 8 Feb 2002 21:03:25 +0000 Subject: [PATCH 2931/7878] Like --srcdir, these flags can *not* be part of a series of flags. If you want this, you get it by itself. (The leading spaces killed the apr-util build.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62936 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apr-config.in b/apr-config.in index 8314546344d..51d2070315f 100644 --- a/apr-config.in +++ b/apr-config.in @@ -192,10 +192,12 @@ while test $# -gt 0; do fi ;; --apr-so-ext) - flags="$flags $APR_SO_EXT" + echo "$APR_SO_EXT" + exit 0 ;; --apr-lib-target) - flags="$flags $APR_LIB_TARGET" + echo "$APR_LIB_TARGET" + exit 0 ;; --help) show_usage From d1406c962ea9ff978ead995921f05e993f9b776b Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 8 Feb 2002 22:12:31 +0000 Subject: [PATCH 2932/7878] Piggy-backed the proc_mutexes on the thread_mutexes since all resources are shared on NetWare. There is no difference between a thread mutex and a proc mutex. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62937 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/proc_mutex.h | 3 ++- locks/netware/proc_mutex.c | 43 ++++++++++++++++++++++++------- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/include/arch/netware/proc_mutex.h b/include/arch/netware/proc_mutex.h index 9fbb808b4be..7077f7b5497 100644 --- a/include/arch/netware/proc_mutex.h +++ b/include/arch/netware/proc_mutex.h @@ -56,10 +56,11 @@ #define PROC_MUTEX_H #include "apr_proc_mutex.h" -#include +#include "apr_thread_mutex.h" struct apr_proc_mutex_t { apr_pool_t *pool; + apr_thread_mutex_t *mutex; }; #endif /* PROC_MUTEX_H */ diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 77022122ab1..fd7b270cf3f 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -54,44 +54,65 @@ #include "apr.h" #include "apr_private.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "proc_mutex.h" #include "apr_portable.h" +#include "proc_mutex.h" +#include "thread_mutex.h" APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, const char *fname, apr_lockmech_e mech, apr_pool_t *pool) { - return APR_ENOTIMPL; + apr_status_t ret; + apr_proc_mutex_t *new_mutex = NULL; + new_mutex = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); + + if(new_mutex ==NULL) { + return APR_ENOMEM; + } + + new_mutex->pool = pool; + ret = apr_thread_mutex_create(&(new_mutex->mutex), APR_THREAD_MUTEX_DEFAULT, pool); + + if (ret == APR_SUCCESS) + *mutex = new_mutex; + + return ret; } APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, const char *fname, apr_pool_t *pool) { - return APR_ENOTIMPL; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) { - return APR_ENOTIMPL; + if (mutex) + return apr_thread_mutex_lock(mutex->mutex); + return APR_ENOLOCK; } APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) { - return APR_ENOTIMPL; + if (mutex) + return apr_thread_mutex_trylock(mutex->mutex); + return APR_ENOLOCK; } APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) { - return APR_ENOTIMPL; + if (mutex) + return apr_thread_mutex_unlock(mutex->mutex); + return APR_ENOLOCK; } APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) { - return APR_ENOTIMPL; + if (mutex) + return apr_thread_mutex_destroy(mutex->mutex); + return APR_ENOLOCK; } APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) @@ -101,7 +122,9 @@ APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) apr_status_t apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, apr_proc_mutex_t *pmutex) { - return APR_ENOTIMPL; + if (pmutex) + ospmutex = pmutex->mutex->mutex; + return APR_ENOLOCK; } apr_status_t apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, From 691b81bd175a2231bb96a734604c9562a1eb27c3 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sat, 9 Feb 2002 00:04:50 +0000 Subject: [PATCH 2933/7878] Fix how we do "and" tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62938 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index ef73caca88f..e87818638c5 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -82,7 +82,7 @@ build directory, or an apr-config file.]) if test -n "$1"; then apr_temp_abs_srcdir="`cd $1 && pwd`" if test "$apr_found" = "yes" \ - -a "`$apr_config --srcdir`" = "$apr_temp_abs_srcdir"; then + && test "`$apr_config --srcdir`" = "$apr_temp_abs_srcdir"; then dnl the installed apr-config represents our source directory, so dnl pretend we didn't see it and just use our bundled source apr_found="no" From 48ea468478f3206ff03137456fc3b2569eab30a3 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sat, 9 Feb 2002 14:08:39 +0000 Subject: [PATCH 2934/7878] Rename apr_find_pool to apr_pool_find. Implement it in terms of apr_pool_walk_tree (which makes it thread safe). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62939 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 4 ++-- memory/unix/apr_pools.c | 38 +++++++++++++++++++------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index ebb802f0963..8a8faac1718 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -573,7 +573,7 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); * if the data is allocated in any ancestor of T's pool. This is the * basis on which the APR_POOL_DEBUG code works -- it tests these ancestor * relationships for all data inserted into tables. APR_POOL_DEBUG also - * provides tools (apr_find_pool, and apr_pool_is_ancestor) for other + * provides tools (apr_pool_find, and apr_pool_is_ancestor) for other * folks to implement similar restrictions for their own data * structures. * @@ -606,7 +606,7 @@ APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub); * @param mem The thing allocated in the pool * @return The pool it is allocated in */ -APR_DECLARE(apr_pool_t *) apr_find_pool(const void *mem); +APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem); /** * Report the number of bytes currently in the pool diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 6828ade51f6..7be2fff1eb3 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1402,37 +1402,37 @@ APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) { } -static apr_pool_t *find_pool(apr_pool_t *pool, const void *mem) +static int pool_find(apr_pool_t *pool, void *data) { - apr_pool_t *found; + void **pmem = (void **)data; debug_node_t *node; apr_uint32_t index; - while (pool) { - node = pool->nodes; - - while (node) { - for (index = 0; index < node->index; index++) { - if (node->beginp[index] <= mem && - node->endp[index] > mem) - return pool; - } + node = pool->nodes; - node = node->next; + while (node) { + for (index = 0; index < node->index; index++) { + if (node->beginp[index] <= *pmem && + node->endp[index] > *pmem) { + *pmem = pool; + return 1; + } } - if ((found = find_pool(pool->child, mem)) != NULL) - return found; - - pool = pool->sibling; + node = node->next; } - return NULL; + return 0; } -APR_DECLARE(apr_pool_t *) apr_find_pool(const void *mem) +APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem) { - return find_pool(global_pool, mem); + void *pool = mem; + + if (apr_pool_walk_tree(global_pool, pool_find, &pool)) + return pool; + + return NULL; } static int pool_num_bytes(apr_pool_t *pool, void *data) From 3f329e5f182deed07bdbbd5d48a1d76cf6d0bfef Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sat, 9 Feb 2002 14:49:16 +0000 Subject: [PATCH 2935/7878] Implement apr_pcalloc in terms of apr_palloc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62940 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 7be2fff1eb3..029ea73aace 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -503,40 +503,13 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) { - node_t *active, *node; void *mem; - char *endp; size = APR_ALIGN_DEFAULT(size); - active = pool->active; - - /* If the active node has enough bytes left, use it. */ - endp = active->first_avail + size; - if (endp < active->endp) { - mem = active->first_avail; - active->first_avail = endp; - + if ((mem = apr_palloc(pool, size)) != NULL) { memset(mem, 0, size); - - return mem; } - if ((node = node_malloc(pool->allocator, size)) == NULL) { - active->first_avail = active->endp; - - if (pool->abort_fn) - pool->abort_fn(APR_ENOMEM); - - return NULL; - } - - active->next = pool->active = node; - - mem = node->first_avail; - node->first_avail += size; - - memset(mem, 0, size); - return mem; } @@ -1427,7 +1400,7 @@ static int pool_find(apr_pool_t *pool, void *data) APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem) { - void *pool = mem; + void *pool = (void *)mem; if (apr_pool_walk_tree(global_pool, pool_find, &pool)) return pool; From da8f5ee72926189c79fce746da158eff12f5f6d0 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Sun, 10 Feb 2002 22:36:41 +0000 Subject: [PATCH 2936/7878] Added Win32 implementation of apr_file_attrs_set. Contributed by Jay Freeman (saurik) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62941 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 49 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index fca7e1b4639..43a2a73cb69 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -622,5 +622,52 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, apr_pool_t *cont) { - return APR_ENOTIMPL; + DWORD flags; + apr_status_t rv; +#if APR_HAS_UNICODE_FS + apr_wchar_t wfname[APR_PATH_MAX]; +#endif + +#if APR_HAS_UNICODE_FS + IF_WIN_OS_IS_UNICODE + { + if (rv = utf8_to_unicode_path(wfname, + sizeof(wfname) / sizeof(wfname[0]), + fname)) + return rv; + flags = GetFileAttributesW(wfname); + } +#endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI + { + flags = GetFileAttributesA(fname); + } +#endif + + if (flags == 0xFFFFFFFF) + return apr_get_os_error(); + + if (attributes & APR_FILE_ATTR_READONLY) + flags |= FILE_ATTRIBUTE_READONLY; + else + flags &= !FILE_ATTRIBUTE_READONLY; + +#if APR_HAS_UNICODE_FS + IF_WIN_OS_IS_UNICODE + { + rv = SetFileAttributesW(wfname, flags); + } +#endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI + { + rv = SetFileAttributesA(fname, flags); + } +#endif + + if (rv == 0) + return apr_get_os_error(); + + return APR_SUCCESS; } From f9ff9f93a030d8a172a977e1fbab54072f17d4dd Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 11 Feb 2002 12:56:13 +0000 Subject: [PATCH 2937/7878] OS/2: Implement apr_proc_mutex*() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62942 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/proc_mutex.h | 3 + locks/os2/proc_mutex.c | 160 ++++++++++++++++++++++++++++++++-- 2 files changed, 155 insertions(+), 8 deletions(-) diff --git a/include/arch/os2/proc_mutex.h b/include/arch/os2/proc_mutex.h index a30813cc66a..1c8b5cd2ab5 100644 --- a/include/arch/os2/proc_mutex.h +++ b/include/arch/os2/proc_mutex.h @@ -60,6 +60,9 @@ struct apr_proc_mutex_t { apr_pool_t *pool; + HMTX hMutex; + TID owner; + int lock_count; }; #endif /* PROC_MUTEX_H */ diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 82714c30da3..f6b45980169 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -59,56 +59,200 @@ #include "proc_mutex.h" #include "fileio.h" #include +#include + +#define CurrentTid (*_threadid) + +static char *fixed_name(const char *fname, apr_pool_t *pool) +{ + char *semname; + + if (fname == NULL) + semname = NULL; + else { + // Semaphores don't live in the file system, fix up the name + while (*fname == '/' || *fname == '\\') { + fname++; + } + + semname = apr_pstrcat(pool, "/SEM32/", fname, NULL); + + if (semname[8] == ':') { + semname[8] = '$'; + } + } + + return semname; +} + + + +static apr_status_t proc_mutex_cleanup(void *vmutex) +{ + apr_proc_mutex_t *mutex = vmutex; + return apr_proc_mutex_destroy(mutex); +} + + APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, const char *fname, apr_lockmech_e mech, apr_pool_t *pool) { - return APR_ENOTIMPL; + apr_proc_mutex_t *new; + ULONG rc; + char *semname; + + if (mech != APR_LOCK_DEFAULT) { + return APR_ENOTIMPL; + } + + new = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); + new->pool = pool; + new->owner = 0; + new->lock_count = 0; + *mutex = new; + + semname = fixed_name(fname, pool); + rc = DosCreateMutexSem(semname, &(new->hMutex), DC_SEM_SHARED, FALSE); + + if (!rc) { + apr_pool_cleanup_register(pool, new, proc_mutex_cleanup, apr_pool_cleanup_null); + } + + return APR_FROM_OS_ERROR(rc); } + + APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, const char *fname, apr_pool_t *pool) { - return APR_ENOTIMPL; + apr_proc_mutex_t *new; + ULONG rc; + char *semname; + + new = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); + new->pool = pool; + new->owner = 0; + new->lock_count = 0; + + semname = fixed_name(fname, pool); + rc = DosOpenMutexSem(semname, &(new->hMutex)); + *mutex = new; + + if (!rc) { + apr_pool_cleanup_register(pool, new, proc_mutex_cleanup, apr_pool_cleanup_null); + } + + return APR_FROM_OS_ERROR(rc); } - + + + APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) { - return APR_ENOTIMPL; + ULONG rc = DosRequestMutexSem(mutex->hMutex, SEM_INDEFINITE_WAIT); + + if (rc == 0) { + mutex->owner = CurrentTid; + mutex->lock_count++; + } + + return APR_FROM_OS_ERROR(rc); } + + APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) { - return APR_ENOTIMPL; + ULONG rc = DosRequestMutexSem(mutex->hMutex, SEM_IMMEDIATE_RETURN); + + if (rc == 0) { + mutex->owner = CurrentTid; + mutex->lock_count++; + } + + return APR_FROM_OS_ERROR(rc); } + + APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) { - return APR_ENOTIMPL; + ULONG rc; + + if (mutex->owner == CurrentTid && mutex->lock_count > 0) { + mutex->lock_count--; + rc = DosReleaseMutexSem(mutex->hMutex); + return APR_FROM_OS_ERROR(rc); + } + + return APR_SUCCESS; } + + APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) { - return APR_ENOTIMPL; + ULONG rc; + apr_status_t status = APR_SUCCESS; + + if (mutex->owner == CurrentTid) { + while (mutex->lock_count > 0 && status == APR_SUCCESS) { + status = apr_proc_mutex_unlock(mutex); + } + } + + if (status != APR_SUCCESS) { + return status; + } + + if (mutex->hMutex == 0) { + return APR_SUCCESS; + } + + rc = DosCloseMutexSem(mutex->hMutex); + + if (!rc) { + mutex->hMutex = 0; + } + + return APR_FROM_OS_ERROR(rc); } + + APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) + + /* Implement OS-specific accessors defined in apr_portable.h */ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, apr_proc_mutex_t *pmutex) { + *ospmutex = pmutex->hMutex; return APR_ENOTIMPL; } + + APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *pool) { - return APR_ENOTIMPL; + apr_proc_mutex_t *new; + + new = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); + new->pool = pool; + new->owner = 0; + new->lock_count = 0; + new->hMutex = *ospmutex; + *pmutex = new; + + return APR_SUCCESS; } From 5a607da31d0fe80ef5c7e377c706abf5f06f7f82 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Mon, 11 Feb 2002 21:03:44 +0000 Subject: [PATCH 2938/7878] apr_file_attrs_set takes a new parameter, attr_mask, that defines which bits in the attributes are valid. Changed Unix, OS/2 and Win32 implementation to match. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62943 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filestat.c | 12 +++++++---- file_io/unix/filestat.c | 46 ++++++++++++++++++++++++++++++---------- file_io/win32/filestat.c | 12 +++++++---- include/apr_file_io.h | 4 +++- 4 files changed, 54 insertions(+), 20 deletions(-) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index f7ffcacbd58..8e7f50ec98f 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -202,6 +202,7 @@ APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, + apr_fileattrs_t attr_mask, apr_pool_t *cont) { FILESTATUS3 fs3; @@ -210,10 +211,13 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, if (rc == 0) { ULONG old_attr = fs3.attrFile; - if (attributes & APR_FILE_ATTR_READONLY) { - fs3.attrFile |= FILE_READONLY; - } else { - fs3.attrFile &= ~FILE_READONLY; + if (attr_mask & APR_FILE_ATTR_READONLY) + { + if (attributes & APR_FILE_ATTR_READONLY) { + fs3.attrFile |= FILE_READONLY; + } else { + fs3.attrFile &= ~FILE_READONLY; + } } if (fs3.attrFile != old_attr) { diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 29bf16e500b..d46640e40fd 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -138,6 +138,7 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, + apr_fileattrs_t attr_mask, apr_pool_t *cont) { apr_status_t status; @@ -147,21 +148,44 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, if (!APR_STATUS_IS_SUCCESS(status)) return status; - if (attributes & APR_FILE_ATTR_READONLY) { - finfo.protection &= ~APR_UWRITE; - finfo.protection &= ~APR_GWRITE; - finfo.protection &= ~APR_WWRITE; + /* ### TODO: should added bits be umask'd? */ + if (attr_mask & APR_FILE_ATTR_READONLY) + { + if (attributes & APR_FILE_ATTR_READONLY) + { + finfo.protection &= ~APR_UWRITE; + finfo.protection &= ~APR_GWRITE; + finfo.protection &= ~APR_WWRITE; + } + else + { + /* ### umask this! */ + finfo.protection |= APR_UWRITE; + finfo.protection |= APR_GWRITE; + finfo.protection |= APR_WWRITE; + } } - if (attributes & APR_FILE_ATTR_EXECUTABLE) { - /* ### TODO: should this be umask'd? */ - finfo.protection |= APR_UEXECUTE; - finfo.protection |= APR_GEXECUTE; - finfo.protection |= APR_WEXECUTE; + + if (attr_mask & APR_FILE_ATTR_EXECUTABLE) + { + if (attributes & APR_FILE_ATTR_EXECUTABLE) + { + /* ### umask this! */ + finfo.protection |= APR_UEXECUTE; + finfo.protection |= APR_GEXECUTE; + finfo.protection |= APR_WEXECUTE; + } + else + { + finfo.protection &= ~APR_UEXECUTE; + finfo.protection &= ~APR_GEXECUTE; + finfo.protection &= ~APR_WEXECUTE; + } } - return apr_file_perms_set(fname, finfo.protection); + return apr_file_perms_set(fname, finfo.protection); } - + APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *cont) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 43a2a73cb69..322517f3a99 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -620,6 +620,7 @@ APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, + apr_fileattrs_t attr_mask, apr_pool_t *cont) { DWORD flags; @@ -648,10 +649,13 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, if (flags == 0xFFFFFFFF) return apr_get_os_error(); - if (attributes & APR_FILE_ATTR_READONLY) - flags |= FILE_ATTRIBUTE_READONLY; - else - flags &= !FILE_ATTRIBUTE_READONLY; + if (attr_mask & APR_FILE_ATTR_READONLY) + { + if (attributes & APR_FILE_ATTR_READONLY) + flags |= FILE_ATTRIBUTE_READONLY; + else + flags &= ~FILE_ATTRIBUTE_READONLY; + } #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE diff --git a/include/apr_file_io.h b/include/apr_file_io.h index ae1320cc245..166a2b67d54 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -126,7 +126,7 @@ extern "C" { /** @} */ /** File attributes */ -typedef apr_int32_t apr_fileattrs_t; +typedef apr_uint32_t apr_fileattrs_t; /** should be same as whence type in lseek, POSIX defines this as int */ typedef int apr_seek_where_t; @@ -583,6 +583,7 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, * APR_FILE_ATTR_READONLY - make the file readonly * APR_FILE_ATTR_EXECUTABLE - make the file executable *

      YWtc8>U-2N-QitD|0!P0p&kKKW8JLUrn)4%~k^ zng1wPH6TtPFChuGWL}h}nr8He_Jv zSAnPzK<=oM8hHov%o%0}JS_!8Sv!Fd&l86>1G^cpPGPC22o2KDgicB|~g`L99L5e2A49V72= zXTXo0uTUEj+Xn&Nb8kVuLGmGzb$I^gnfKVLU%*0)Np|_q4~x?7iFpZqh)~@eX_48` zhMhtt&(~xcUXX~S3p2g?i!Q2EVC#^vv#py=<4Ht1KLQSzdXo-of$H=#$t%0Bz+j5? zg$h(y7oNSPaDJO9WoLx-_hpLh0jB$o?7x8}|eXv;T`c;Iqi97k0-2Eh%hu6fE z^t|3uO&`!C#;ltWIfdAHVk|6X#n@#4^&o(60a6TJRT`z`X z1}wn*S~Uk&sm$sHSTF(|6{$0BuC@MloL1fr5k+jZ%)(ex8I;ifP^>C5psdI~C}wR? z^#)iDu1n1BJN6~u*;e#j=fqU#Y6+~a%eN`_(M&-kuro=zcq)Q1H4NYS=9lX+5c0>a z1z0Vq{(8r2GGd)zN>c6~<4>Zecz6PD)W^4*VB(D%E?I~2zK#;wTl*LBqS1jK&YR*h zce~>rs<*UnFJxp%RzmuL6?boJD?L(2s;?FuT1T4Cp2PWc+TLB^J}PhHBv5b-)#?`~ z$hcudxD!d1$r6l&)w&E*5s7+Os9e(xCCPqaIx|uHGExP1f2wS8M_M438Q6Ie=9dWp zEQhtMR;6E)%?@$kiq0BWoSNB*%ZtIv?|&i(i;vYyNCtq}mOdyW#QiD=KiMAC6D=xF zHhj|*vc^BXiZP%0%wcgf4lv$S@k~%!|c_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Q5TPU)v z4vP_*{}s7&;hp<)&7Ya7D@X;}IC;kmP2ha%ZrBTRZkElwoTCA-2D8i-pOoE0Z5KZp z(Kam9jym;g22Eu8nagU&_czVac$a={M1t5k!((;U5$LtD+4*oYT#>pRf_r7t3N#!n z_DK;S@3~W9oms%GzqCDp{i>Hu*;1q*UwR9VcAv$&J&JlFfe64)_J*L%N=%4vr?3WZDbP85bL_@VI zJfz&6Zi*hZrdLy=2cOY2=#@e*_gb|yjbyr`rgq$q76u@+%+0CD_p0RKw8}+^#|#>1 zs#g!+(s569VFHh{6Q&6!Bwc^W9*78tGLIWwC-j=Lf9nAG!1?`aa>s!hNyu7!^#?8X zS&+1SrD9dz6z81kQC585#I0ffK`yR=T(w#;h7_mu3#1@-4@2dV)5~LJw7c;%x0|rQYQ)FTOAkp o>>oMQ{DZ;-XJ&HDL#%gW_j Date: Wed, 6 Feb 2002 21:56:29 +0000 Subject: [PATCH 2917/7878] Sync'ed up the #define's with other platforms git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62922 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index 09e4aa6e613..e36acfdf1af 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -124,9 +124,27 @@ #define APR_HAVE_SYS_TIME_H 0 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 1 +#define APR_HAVE_SYS_UN_H 0 #define APR_HAVE_SYS_WAIT_H 0 +#define APR_HAVE_TIME_H 1 #define APR_HAVE_UNISTD_H 1 +#define APR_HAVE_SHMEM_MMAP_TMP 0 +#define APR_HAVE_SHMEM_MMAP_SHM 0 +#define APR_HAVE_SHMEM_MMAP_ZERO 0 +#define APR_HAVE_SHMEM_SHMGET_ANON 0 +#define APR_HAVE_SHMEM_SHMGET 0 +#define APR_HAVE_SHMEM_MMAP_ANON 0 +#define APR_HAVE_SHMEM_BEOS 0 + +#define APR_USE_SHMEM_MMAP_TMP 0 +#define APR_USE_SHMEM_MMAP_SHM 0 +#define APR_USE_SHMEM_MMAP_ZERO 0 +#define APR_USE_SHMEM_SHMGET_ANON 0 +#define APR_USE_SHMEM_SHMGET 0 +#define APR_USE_SHMEM_MMAP_ANON 0 +#define APR_USE_SHMEM_BEOS 0 + #define APR_USE_FLOCK_SERIALIZE 0 #define APR_USE_SYSVSEM_SERIALIZE 0 #define APR_USE_FCNTL_SERIALIZE 0 @@ -143,12 +161,7 @@ #define APR_PROCESS_LOCK_IS_GLOBAL 0 -#define APR_USES_ANONYMOUS_SHM 0 -#define APR_USES_FILEBASED_SHM 0 -#define APR_USES_KEYBASED_SHM 0 - #define APR_FILE_BASED_SHM 0 -#define APR_MEM_BASED_SHM 0 #define APR_HAVE_CORKABLE_TCP 0 #define APR_HAVE_GETRLIMIT 0 From 1e8b969a1377ccbc0d991e668d341e35ebcb2a54 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 6 Feb 2002 22:52:12 +0000 Subject: [PATCH 2918/7878] Second try at fixing the dead reference. Hopefully I got it right this time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62923 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 178950 -> 177702 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 868c5f32bd127d9586d7d3dfaac2ae8b41c8fcad..b5088168455d71c20d2fd44b9a00127bccd19c8a 100644 GIT binary patch delta 91583 zcmb@t1yCHp_b!SPAV7cwmjnVN1PSgC+}+)SyX!y*5}aVcgIjR-CBWkDz6rYM;tMQr z$?yK}tN*RK?^WHZS2f!`(&zN-=`&w{r{_%g6?X9#2&NJvNyw&rFoZcg5;jutM5Mp&kXQa8D4S)CI4aj7Tw1RXDpR) zDoJrO*P4eI{7=1RidBE2xHYN1NO?`0_RRR58xs?)F=M`|o zXNm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et?JKCU+?<3I2%o$PBkZQE~4Yl=X{d=klRg(lORPMKh; zaZXhwV9zDj@mn)T=~+J~4L_ICc8p%>;#cRNl_BMfbSQ+m!C@lH(vP}cOcHpD^| z1V_v{w=+1zJ|A6?NPm+8K3H2P%qi>!c7OlJNDU?weB8$D)M7~Q%o*@AB=q^YLSv0|iH1bS8N;vKk_ z*5dj&vh`nAC_4zCtw+v>Kw3Fbn=RyiKt#{^BjRYP(&`RvSDS&ZW@tYfrq!<0DJV;V z4Qa=G_d3#lTCd?>8L<&uWA2!@?B^Gu!XYq{+`MH~TL_`23kKL=svXvoDhqT9Yn4^u2m+%~+jLTfy e7Kb_=WG)!;TXIuuGhT3UtMdB(+q-Aap8o@DneXEO From 18f7bad972a9480cd68a2df0fbe324864800de66 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 8 Jan 2002 22:48:25 +0000 Subject: [PATCH 2723/7878] This helper stub will get us the appropriate Win32 wchar* or char*, allocated from pool [no big stack vars], no longer than 255 characters, and with no 'path decoration' so we can turn a filename into a faux resource name string. This function fixes resource names into the Global\ or Local\ namespace on Windows 2000 or later, since this is a requirement on Win2K Terminal Server, where we have multiple VMs. Oh, we don't fail on long names, we will truncate off the left, so as much unique info as possible is preserved. We also shorten to 255 or fewer chars, so we don't have multiple utf8->unicode calls. We aren't caring that we loose a few more wchars, as long as it's less than 255. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62726 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 83 +++++++++++++++++++++++++++++++++++++ include/arch/win32/fileio.h | 9 ++++ 2 files changed, 92 insertions(+) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 2cf6fb0bd40..9de4525cc2b 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -165,6 +165,89 @@ apr_status_t unicode_to_utf8_path(char* retstr, apr_size_t retlen, } #endif +void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) +{ +#if APR_HAS_UNICODE_FS + if (apr_os_level >= APR_WIN_NT) { + apr_wchar_t *wpre, *wfile, *ch; + apr_size_t n = strlen(file) + 1; + apr_size_t r, d; + apr_status_t rv; + + if (apr_os_level >= APR_WIN_2000) { + if (global) + wpre = L"Global\\"; + else + wpre = L"Local\\"; + } + else + wpre = L""; + r = wcslen(wpre); + + if (n > 256 - r) { + file += n - 256 - r; + n = 256; + /* skip utf8 continuation bytes */ + while ((*file & 0xC0) == 0x80) { + ++file; + --n; + } + } + wfile = apr_palloc(pool, (r + n) * sizeof(apr_wchar_t)); + wcscpy(wfile, wpre); + d = n; + if (rv = conv_utf8_to_ucs2(file, &n, wfile + r, &d)) { + return NULL; + } + for (ch = wfile + r; *ch; ++ch) { + if (*ch == ':' || *ch == '/' || *ch == '\\') + *ch = '_'; + } + } + else +#endif + { + char *nfile, *ch; + apr_size_t n = strlen(file) + 1; + +#if !APR_HAS_UNICODE_FS + apr_status_t rv; + apr_size_t r, d; + char *pre; + + if (apr_os_level >= APR_WIN_2000) { + if (global) + pre = "Global\\"; + else + pre = "Local\\"; + } + else + pre = ""; + r = strlen(pre); + + if (n > 256 - r) { + file += n - 256 - r; + n = 256; + } + nfile = apr_palloc(pool, (r + n) * sizeof(apr_wchar_t)); + memcpy(nfile, pre, r); + memcpy(nfile + r, file, n); +#else + const apr_size_t r = 0; + if (n > 256) { + file += n - 256; + n = 256; + } + nfile = apr_pmemdup(pool, file, n); +#endif + for (ch = nfile + r; *ch; ++ch) { + if (*ch == ':' || *ch == '/' || *ch == '\\') + *ch = '_'; + } + } +} + + apr_status_t file_cleanup(void *thefile) { apr_file_t *file = thefile; diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index c1acce617f0..77d4979378d 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -110,6 +110,15 @@ apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, #endif /* APR_HAS_UNICODE_FS */ +/* Another Helper functions for the WinNT ApiW() functions. We need to + * derive some 'resource' names (max length 255 characters, prefixed with + * Global/ or Local/ on WinNT) from something that looks like a filename. + * Since 'resource' names never contain slashes, convert these to '_'s + * and return the appropriate char* or wchar* for ApiA or ApiW calls. + */ + +void *res_name_from_filename(const char *file, int global, apr_pool_t *pool); + #define APR_FILE_MAX MAX_PATH #define APR_FILE_BUFSIZE 4096 From ef8bdaaeae4a0f8dc6d32d9c95ce78ce86754913 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Jan 2002 00:33:28 +0000 Subject: [PATCH 2724/7878] This now builds with Aaron's new apr_shm.h header. I'll not drop it into the libapr/apr.dsp files until that header is committed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62728 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 259 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 shmem/win32/shm.c diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c new file mode 100644 index 00000000000..cd8910d4a4f --- /dev/null +++ b/shmem/win32/shm.c @@ -0,0 +1,259 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_general.h" +#include "apr_errno.h" +#include "apr_file_io.h" +#include "apr_shm.h" +#include "fileio.h" + +typedef struct memblock_t { + apr_size_t length; +} memblock_t; + +struct apr_shm_t { + apr_pool_t *pool; + memblock_t *mem; + apr_size_t size; + HANDLE hMap; +}; + +static apr_status_t shm_cleanup(void* shm) +{ + apr_status_t rv = APR_SUCCESS; + apr_shm_t *m = shm; + + if (UnmapViewOfFile(m->mem)) { + rv = apr_get_os_error(); + } + if (CloseHandle(m->hMap)) { + return (rv != APR_SUCCESS) ? rv : apr_get_os_error(); + } + return rv; +} + +APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, + apr_size_t reqsize, + const char *file, + apr_pool_t *pool) +{ + static apr_size_t memblock = 0; + SECURITY_ATTRIBUTES sec, *psec; + HANDLE hMap, hFile; + apr_status_t rv; + apr_size_t size; + apr_file_t *f; + void *base; + void *mapkey; + + reqsize += sizeof(memblock_t); + + if (!memblock) + { + SYSTEM_INFO si; + GetSystemInfo(&si); + memblock = si.dwAllocationGranularity; + } + + /* Compute the granualar multiple of the pagesize */ + size = memblock * (1 + (reqsize - 1) / memblock); + + if (!file) { + /* Do Anonymous, which will be an inherited handle */ + hFile = INVALID_HANDLE_VALUE; + sec.nLength = sizeof(SECURITY_ATTRIBUTES); + sec.lpSecurityDescriptor = NULL; + sec.bInheritHandle = TRUE; + mapkey = NULL; + psec = &sec; + } + else { + /* Do file backed, which is not an inherited handle + * While we could open APR_EXCL, it doesn't seem that Unix + * ever did. Ignore that error here, but fail later when + * we discover we aren't the creator of the file map object. + */ + rv = apr_file_open(&f, file, + APR_READ | APR_WRITE | APR_BINARY, + APR_UREAD | APR_UWRITE, pool); + if ((rv != APR_SUCCESS) + || ((rv = apr_os_file_get(&hFile, f)) != APR_SUCCESS)) { + return rv; + } + mapkey = res_name_from_filename(file, 1, pool); + psec = NULL; + } + +#if APR_HAS_UNICODE_FS + if (apr_os_level >= APR_WIN_NT) + { + hMap = CreateFileMappingW(hFile, + psec, + PAGE_READWRITE, + (DWORD)(size >> 32), + (DWORD)size, + mapkey); + } + else +#endif + { + hMap = CreateFileMappingA(hFile, + psec, + PAGE_READWRITE, + (DWORD)(size >> 32), + (DWORD)size, + mapkey); + } + apr_file_close(f); + if (hMap && GetLastError() == ERROR_ALREADY_EXISTS) { + CloseHandle(hMap); + return APR_EEXIST; + } + if (!hMap) { + return apr_get_os_error(); + } + + base = MapViewOfFile(hMap, FILE_MAP_READ | FILE_MAP_WRITE, + 0, 0, size); + if (!base) { + apr_file_close(f); + CloseHandle(hMap); + return apr_get_os_error(); + } + + *m = (apr_shm_t *) apr_palloc(pool, sizeof(apr_shm_t)); + (*m)->pool = pool; + (*m)->hMap = hMap; + (*m)->mem = base; + (*m)->size = size; + + (*m)->mem->length = reqsize; + + apr_pool_cleanup_register((*m)->pool, *m, + shm_cleanup, apr_pool_cleanup_null); + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) +{ + apr_status_t rv = shm_cleanup(m); + apr_pool_cleanup_kill(m->pool, m, shm_cleanup); + return rv; +} + +APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, + apr_size_t sz, + const char *file, + apr_pool_t *pool) +{ + HANDLE hMap; + void *mapkey; + void *base; + + if (!file) { + return APR_EINVAL; + } + else { + mapkey = res_name_from_filename(file, 1, pool); + } + +#if APR_HAS_UNICODE_FS + if (apr_os_level >= APR_WIN_NT) + { + hMap = OpenFileMappingW(FILE_MAP_READ | FILE_MAP_WRITE, FALSE, mapkey); + } + else +#endif + { + hMap = OpenFileMappingA(FILE_MAP_READ | FILE_MAP_WRITE, FALSE, mapkey); + } + + if (!hMap) { + return apr_get_os_error(); + } + + base = MapViewOfFile(hMap, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0); + if (!base) { + CloseHandle(hMap); + return apr_get_os_error(); + } + + *m = (apr_shm_t *) apr_palloc(pool, sizeof(apr_shm_t)); + (*m)->pool = pool; + (*m)->hMap = hMap; + (*m)->mem = base; + /* Real (*m)->mem->size could be recovered with VirtualQuery */ + (*m)->size = (*m)->mem->length; + + apr_pool_cleanup_register((*m)->pool, *m, + shm_cleanup, apr_pool_cleanup_null); + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) +{ + apr_status_t rv = shm_cleanup(m); + apr_pool_cleanup_kill(m->pool, m, shm_cleanup); + return rv; +} + +APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) +{ + return (char*)m->mem + sizeof(memblock_t); +} + +APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) +{ + return m->mem->length - sizeof(memblock_t); +} From 16d0bf999c48f17a61b3413f45a6214cff566aa5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Jan 2002 01:47:04 +0000 Subject: [PATCH 2725/7878] Some modest improvements pointed out by Aaron. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62729 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index cd8910d4a4f..29408194fe3 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -59,14 +59,17 @@ #include "fileio.h" typedef struct memblock_t { + apr_size_t size; apr_size_t length; } memblock_t; struct apr_shm_t { apr_pool_t *pool; - memblock_t *mem; - apr_size_t size; - HANDLE hMap; + memblock_t *memblk; + void *usrmem; + apr_size_t size; + apr_size_t length; + HANDLE hMap; }; static apr_status_t shm_cleanup(void* shm) @@ -74,7 +77,7 @@ static apr_status_t shm_cleanup(void* shm) apr_status_t rv = APR_SUCCESS; apr_shm_t *m = shm; - if (UnmapViewOfFile(m->mem)) { + if (UnmapViewOfFile(m->memblk)) { rv = apr_get_os_error(); } if (CloseHandle(m->hMap)) { @@ -175,10 +178,13 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, *m = (apr_shm_t *) apr_palloc(pool, sizeof(apr_shm_t)); (*m)->pool = pool; (*m)->hMap = hMap; - (*m)->mem = base; + (*m)->memblk = base; + (*m)->usrmem = (char*)base + sizeof(memblock_t); (*m)->size = size; + (*m)->length = reqsize; - (*m)->mem->length = reqsize; + (*m)->memblk->length = reqsize; + (*m)->memblk->size = size; apr_pool_cleanup_register((*m)->pool, *m, shm_cleanup, apr_pool_cleanup_null); @@ -232,9 +238,11 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, *m = (apr_shm_t *) apr_palloc(pool, sizeof(apr_shm_t)); (*m)->pool = pool; (*m)->hMap = hMap; - (*m)->mem = base; + (*m)->memblk = base; + (*m)->usrmem = (char*)base + sizeof(memblock_t); /* Real (*m)->mem->size could be recovered with VirtualQuery */ - (*m)->size = (*m)->mem->length; + (*m)->size = (*m)->memblk->size; + (*m)->length = (*m)->memblk->length; apr_pool_cleanup_register((*m)->pool, *m, shm_cleanup, apr_pool_cleanup_null); @@ -250,10 +258,10 @@ APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) { - return (char*)m->mem + sizeof(memblock_t); + return m->usrmem; } APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) { - return m->mem->length - sizeof(memblock_t); + return m->length; } From 83ea0746a735538195335c6cefe9f5443c6121c8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Jan 2002 04:35:10 +0000 Subject: [PATCH 2726/7878] Correct the shm length returned based on the original reqsize git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62730 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 29408194fe3..3b9f66cb40e 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -179,12 +179,13 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, (*m)->pool = pool; (*m)->hMap = hMap; (*m)->memblk = base; - (*m)->usrmem = (char*)base + sizeof(memblock_t); (*m)->size = size; - (*m)->length = reqsize; + + (*m)->usrmem = (char*)base + sizeof(memblock_t); + (*m)->length = reqsize - sizeof(memblock_t);; - (*m)->memblk->length = reqsize; - (*m)->memblk->size = size; + (*m)->memblk->length = (*m)->length; + (*m)->memblk->size = (*m)->size; apr_pool_cleanup_register((*m)->pool, *m, shm_cleanup, apr_pool_cleanup_null); From 8e2c1ec59d04d733bc9915446614d9f6ebd1b309 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Wed, 9 Jan 2002 18:14:33 +0000 Subject: [PATCH 2727/7878] While breaking my autoconf output, I ran across this missing semicolon. If nobody noticed this before then it's probably not getting used anyway. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62731 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 2d0313fbba2..f3c03e2be92 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -141,7 +141,7 @@ typedef enum {APR_SHUTDOWN_READ, APR_SHUTDOWN_WRITE, */ struct in_addr { apr_uint32_t s_addr; /**< storage to hold the IP# */ -} +}; #endif /** From b89d5573a342d294672e308de343d8c929def30d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Jan 2002 22:05:09 +0000 Subject: [PATCH 2728/7878] We went to the trouble of assembling the name ... why not return it :-? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62732 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 9de4525cc2b..cbc57950afc 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -203,6 +203,7 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) if (*ch == ':' || *ch == '/' || *ch == '\\') *ch = '_'; } + return wfile; } else #endif @@ -244,6 +245,7 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) if (*ch == ':' || *ch == '/' || *ch == '\\') *ch = '_'; } + return nfile; } } From 464dce303d7988e1623c0aad63db2d3835d8dc47 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 10 Jan 2002 00:09:17 +0000 Subject: [PATCH 2729/7878] Fix a bug that appears when specifying the length [inherit the physical length after apr_file_trunc] and change the api a bit for Aaron's new apr_shm.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62733 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 3b9f66cb40e..c13de77a7df 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -99,6 +99,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, apr_file_t *f; void *base; void *mapkey; + DWORD err; reqsize += sizeof(memblock_t); @@ -128,12 +129,13 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, * we discover we aren't the creator of the file map object. */ rv = apr_file_open(&f, file, - APR_READ | APR_WRITE | APR_BINARY, + APR_READ | APR_WRITE | APR_BINARY | APR_CREATE, APR_UREAD | APR_UWRITE, pool); if ((rv != APR_SUCCESS) || ((rv = apr_os_file_get(&hFile, f)) != APR_SUCCESS)) { return rv; } + rv = apr_file_trunc(f, size); mapkey = res_name_from_filename(file, 1, pool); psec = NULL; } @@ -141,30 +143,21 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #if APR_HAS_UNICODE_FS if (apr_os_level >= APR_WIN_NT) { - hMap = CreateFileMappingW(hFile, - psec, - PAGE_READWRITE, - (DWORD)(size >> 32), - (DWORD)size, - mapkey); + hMap = CreateFileMappingW(hFile, psec, PAGE_READWRITE, 0, 0, mapkey); } else #endif { - hMap = CreateFileMappingA(hFile, - psec, - PAGE_READWRITE, - (DWORD)(size >> 32), - (DWORD)size, - mapkey); + hMap = CreateFileMappingA(hFile, psec, PAGE_READWRITE, 0, 0, mapkey); } + err = apr_get_os_error(); apr_file_close(f); - if (hMap && GetLastError() == ERROR_ALREADY_EXISTS) { + if (hMap && err == ERROR_ALREADY_EXISTS) { CloseHandle(hMap); return APR_EEXIST; } if (!hMap) { - return apr_get_os_error(); + return err; } base = MapViewOfFile(hMap, FILE_MAP_READ | FILE_MAP_WRITE, @@ -200,7 +193,6 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) } APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, - apr_size_t sz, const char *file, apr_pool_t *pool) { From e408196f79c2766da93cb0caec4f4c711f537e30 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 10 Jan 2002 00:15:22 +0000 Subject: [PATCH 2730/7878] New rules for detecting Anonymous vs. Name-based shared memory. These work with the new apr_shm_t API. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62734 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 126 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 80 insertions(+), 46 deletions(-) diff --git a/configure.in b/configure.in index 0716920c64e..6b8039172a2 100644 --- a/configure.in +++ b/configure.in @@ -427,28 +427,86 @@ AC_HAVE_HEADERS(kernel/OS.h) AC_HAVE_FUNCS(create_area) AC_HAVE_HEADERS(os2.h) -dnl Now we determine which one is our preference. -APR_BEGIN_DECISION([shared memory allocation method]) +dnl Now we determine which one is our anonymous shmem preference. +haveshmgetanon="0" +havemmapzero="0" +havemmapanon="0" +APR_BEGIN_DECISION([anonymous shared memory allocation method]) +APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl + func:shmget func:shmat func:shmdt func:shmctl, + [haveshmgetanon="1" + APR_DECIDE(USE_SHMEM_SHMGET_ANON, [SysV IPC shmget()])]) +APR_IFALLYES(header:sys/mman.h func:mmap func:munmap file:/dev/zero, + [havemmapzero="1" + APR_DECIDE(USE_SHMEM_MMAP_ZERO, + [SVR4-style mmap() on /dev/zero])]) +APR_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON, + [havemmapanon="1" + APR_DECIDE(USE_SHMEM_MMAP_ANON, + [4.4BSD-style mmap() via MAP_ANON])]) +case $host in + *linux* ) + dnl Linux has problems with MM_SHMT_MMANON even though it reports + dnl that it has it. + dnl FIXME - find exact 2.3 version that MMANON was fixed in. It is + dnl confirmed fixed in 2.4 series. + if test $os_version -le "240"; then + APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_ZERO USE_SHMEM_SHMGET_ANON) + fi + ;; +esac +APR_END_DECISION +AC_DEFINE_UNQUOTED($ac_decision) + +useshmgetanon="0" +usemmapzero="0" +usemmapanon="0" + +case $ac_decision in + USE_SHMEM_SHMGET_ANON ) + useshmgetanon="1" + ;; + USE_SHMEM_MMAP_ZERO ) + usemmapzero="1" + ;; + USE_SHMEM_MMAP_ANON ) + usemmapanon="1" + ;; +esac + +AC_SUBST(useshmgetanon) +AC_SUBST(usemmapzero) +AC_SUBST(usemmapanon) +AC_SUBST(haveshmgetanon) +AC_SUBST(havemmapzero) +AC_SUBST(havemmapanon) + +dnl Now we determine which one is our name-based shmem preference. +havemmaptmp="0" +havemmapshm="0" +haveshmget="0" +havebeosarea="0" +haveos2shm="0" +APR_BEGIN_DECISION([namebased memory allocation method]) APR_IFALLYES(header:sys/mman.h func:mmap func:munmap, - APR_DECIDE(USE_SHMEM_MMAP_TMP, - [Classical mmap() on temporary file])) + [havemmaptmp="1" + APR_DECIDE(USE_SHMEM_MMAP_TMP, + [Classical mmap() on temporary file])]) APR_IFALLYES(header:sys/mman.h func:mmap func:munmap func:shm_open dnl func:shm_unlink, - APR_DECIDE(USE_SHMEM_MMAP_SHM, - [mmap() via POSIX.1 shm_open() on temporary file])) -APR_IFALLYES(header:sys/mman.h func:mmap func:munmap file:/dev/zero, - APR_DECIDE(USE_SHMEM_MMAP_ZERO, - [SVR4-style mmap() on /dev/zero])) + [havemmapshm="1" + APR_DECIDE(USE_SHMEM_MMAP_SHM, + [mmap() via POSIX.1 shm_open() on temporary file])]) APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl func:shmget func:shmat func:shmdt func:shmctl, - APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()])) -APR_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON, - APR_DECIDE(USE_SHMEM_MMAP_ANON, - [4.4BSD-style mmap() via MAP_ANON])) + [haveshmget="1" + APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()])]) APR_IFALLYES(header:kernel/OS.h func:create_area, - APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])) + [havebeosshm="1" + APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])]) APR_IFALLYES(header:os2.h, - APR_DECIDE(USE_SHMEM_OS2, [OS/2 DosAllocSharedMem()])) + [haveos2shm="1" + APR_DECIDE(USE_SHMEM_OS2, [OS/2 DosAllocSharedMem()])]) case $host in *linux* ) dnl Linux has problems with MM_SHMT_MMANON even though it reports @@ -457,7 +515,7 @@ case $host in dnl confirmed fixed in 2.4 series. if test $os_version -le "240"; then APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_TMP USE_SHMEM_MMAP_SHM dnl - USE_SHMEM_MMAP_ZERO USE_SHMEM_SHMGET) + USE_SHMEM_SHMGET) fi ;; esac @@ -466,42 +524,25 @@ AC_DEFINE_UNQUOTED($ac_decision) usemmaptmp="0" usemmapshm="0" -usemmapzero="0" useshmget="0" -usemmapanon="0" usebeosarea="0" useos2shm="0" -mem_based="0" -file_based="0" case $ac_decision in USE_SHMEM_MMAP_TMP ) usemmaptmp="1" - file_based="1" ;; USE_SHMEM_MMAP_SHM ) usemmapshm="1" - mem_based="1" - ;; - USE_SHMEM_MMAP_ZERO ) - usemmapzero="1" - mem_based="1" ;; USE_SHMEM_SHMGET ) useshmget="1" - mem_based="1" - ;; - USE_SHMEM_MMAP_ANON ) - usemmapanon="1" - mem_based="1" ;; USE_SHMEM_BEOS ) usebeosarea="1" - mem_based="1" ;; USE_SHMEM_OS2 ) useos2shm="1" - file_based="0" ;; esac @@ -514,22 +555,15 @@ fi AC_SUBST(usemmaptmp) AC_SUBST(usemmapshm) -AC_SUBST(usemmapzero) AC_SUBST(useshmget) -AC_SUBST(usemmapanon) AC_SUBST(usebeosarea) +AC_SUBST(useos2shm) +AC_SUBST(havemmaptmp) +AC_SUBST(havemmapshm) +AC_SUBST(haveshmget) +AC_SUBST(havebeosarea) +AC_SUBST(haveos2shm) AC_SUBST(sharedmem) -AC_SUBST(file_based) -AC_SUBST(mem_based) - -dnl We only support anonymous shared memory in Unix currently. -anonymous_shm="1" -filebased_shm="0" -keybased_shm="0" - -AC_SUBST(anonymous_shm) -AC_SUBST(filebased_shm) -AC_SUBST(keybased_shm) dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) From 0ab9e54e36e66d6c4f4c25255f6acc00125d589d Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 10 Jan 2002 00:20:06 +0000 Subject: [PATCH 2731/7878] This is the new apr_shm_t API. It completely replaces the old shared memory API, which was unusable on Win32 and other platforms that do not have inherited shared memory segments since it only supported anonymous memory. We now support both anonymous and name-based shared memory. Anonymous shmem tested to work on the following platforms: Linux 2.2, Linux 2.4, Solaris 8, FreeBSD 5.0-CURRENT Name-based shmem is _not_ fully functional on UNIX, but this API replaces all of the preexisting apr_shmem_t functionality. Stubs were provided for Beos and OS/2, and as much relevant code as possible was preserved, but no guarantees of correctness. Reviewed by: Justin Erenkrantz, Will Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62735 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 36 ++- include/apr_shm.h | 163 +++++++++++++ include/apr_shmem.h | 173 ------------- shmem/beos/shm.c | 128 ++++++++++ shmem/beos/shmem.c | 321 ------------------------ shmem/os2/{shmem.c => shm.c} | 64 +---- shmem/unix/Makefile.in | 6 +- shmem/unix/shm.c | 459 +++++++++++++++++++++++++++++++++++ shmem/unix/shmem.c | 331 ------------------------- test/Makefile.in | 12 + 10 files changed, 792 insertions(+), 901 deletions(-) create mode 100644 include/apr_shm.h delete mode 100644 include/apr_shmem.h create mode 100644 shmem/beos/shm.c delete mode 100644 shmem/beos/shmem.c rename shmem/os2/{shmem.c => shm.c} (80%) create mode 100644 shmem/unix/shm.c delete mode 100644 shmem/unix/shmem.c diff --git a/include/apr.h.in b/include/apr.h.in index f3747757796..ade01bd450c 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -63,12 +63,21 @@ #define APR_HAVE_SYS_WAIT_H @sys_waith@ #define APR_HAVE_UNISTD_H @unistdh@ -#define APR_USE_SHMEM_MMAP_TMP @usemmaptmp@ -#define APR_USE_SHMEM_MMAP_SHM @usemmapshm@ -#define APR_USE_SHMEM_MMAP_ZERO @usemmapzero@ -#define APR_USE_SHMEM_SHMGET @useshmget@ -#define APR_USE_SHMEM_MMAP_ANON @usemmapanon@ -#define APR_USE_SHMEM_BEOS @usebeosarea@ +#define APR_HAVE_SHMEM_MMAP_TMP @havemmaptmp@ +#define APR_HAVE_SHMEM_MMAP_SHM @havemmapshm@ +#define APR_HAVE_SHMEM_MMAP_ZERO @havemmapzero@ +#define APR_HAVE_SHMEM_SHMGET_ANON @haveshmgetanon@ +#define APR_HAVE_SHMEM_SHMGET @haveshmget@ +#define APR_HAVE_SHMEM_MMAP_ANON @havemmapanon@ +#define APR_HAVE_SHMEM_BEOS @havebeosarea@ + +#define APR_USE_SHMEM_MMAP_TMP @usemmaptmp@ +#define APR_USE_SHMEM_MMAP_SHM @usemmapshm@ +#define APR_USE_SHMEM_MMAP_ZERO @usemmapzero@ +#define APR_USE_SHMEM_SHMGET_ANON @useshmgetanon@ +#define APR_USE_SHMEM_SHMGET @useshmget@ +#define APR_USE_SHMEM_MMAP_ANON @usemmapanon@ +#define APR_USE_SHMEM_BEOS @usebeosarea@ #define APR_USE_FLOCK_SERIALIZE @flockser@ #define APR_USE_SYSVSEM_SERIALIZE @sysvser@ @@ -84,21 +93,6 @@ #define APR_PROCESS_LOCK_IS_GLOBAL @proclockglobal@ -#define APR_USES_ANONYMOUS_SHM @anonymous_shm@ -#define APR_USES_FILEBASED_SHM @filebased_shm@ -#define APR_USES_KEYBASED_SHM @keybased_shm@ - -/* These look VERY similar to the macro's above. They aren't. The - * difference is in implementation. The above macros describe how to - * access the shared memory, either anonymously, through a key or through - * a file. The macros defined below describe actually how the shared - * memory is actually implemented. Is it actually a file that has been - * opened by multiple processes, or it is stored in memory somehow. This - * is important for some optimizations in Apache. - */ -#define APR_FILE_BASED_SHM @file_based@ -#define APR_MEM_BASED_SHM @mem_based@ - #define APR_HAVE_CORKABLE_TCP @have_corkable_tcp@ #define APR_HAVE_GETRLIMIT @have_getrlimit@ #define APR_HAVE_IN_ADDR @have_in_addr@ diff --git a/include/apr_shm.h b/include/apr_shm.h new file mode 100644 index 00000000000..c48ea3913e0 --- /dev/null +++ b/include/apr_shm.h @@ -0,0 +1,163 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_SHM_H +#define APR_SHM_H + +#include "apr.h" +#include "apr_pools.h" +#include "apr_errno.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @file apr_shm.h + * @brief APR Shared Memory Routines + */ + +/** + * @defgroup APR_SHM Shared Memory Routines + * @ingroup APR + * @{ + */ + +/** + * Private, platform-specific data struture representing a shared memory + * segment. + */ +typedef struct apr_shm_t apr_shm_t; + +/** + * Create and make accessable a shared memory segment. + * @param m The shared memory structure to create. + * @param reqsize The desired size of the segment. + * @param file The file to use for shared memory on platforms that + * require it. + * @param pool the pool from which to allocate the shared memory + * structure. + * @remark A note about Anonymous vs. Named shared memory segments: + * Not all plaforms support anonymous shared memory segments, but in + * some cases it is prefered over other types of shared memory + * implementations. Passing a NULL 'file' parameter to this function + * will cause the subsystem to use anonymous shared memory segments. + * If such a system is not available, APR_ENOTIMPL is returned. + * @remark A note about allocation sizes: + * On some platforms it is necessary to store some metainformation + * about the segment within the actual segment. In order to supply + * the caller with the requested size it may be necessary for the + * implementation to request a slightly greater segment length + * from the subsystem. In all cases, the apr_shm_baseaddr_get() + * function will return the first usable byte of memory. + * + */ +APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, + apr_size_t reqsize, + const char *filename, + apr_pool_t *pool); + +/** + * Destroy a shared memory segment and associated memory. + * @param m The shared memory segment structure to destroy. + */ +APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m); + +/** + * Attach to a shared memory segment that was created + * by another process. + * @param m The shared memory structure to create. + * @param file The file used to create the original segment. + * (This MUST match the original filename.) + * @param pool the pool from which to allocate the shared memory + * structure for this process. + */ +APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, + const char *filename, + apr_pool_t *pool); + +/** + * Detach from a shared memory segment without destroying it. + * @param m The shared memory structure representing the segment + * to detach from. + */ +APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m); + +/** + * Retrieve the base address of the shared memory segment. + * NOTE: This address is only usable within the callers address + * space, since this API does not guarantee that other attaching + * processes will maintain the same address mapping. + * @param m The shared memory segment from which to retrieve + * the base address. + */ +APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m); + +/** + * Retrieve the length of a shared memory segment in bytes. + * @param m The shared memory segment from which to retrieve + * the segment length. + */ +APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m); + +/** + * Get the pool used by this shared memory segment. + */ +APR_POOL_DECLARE_ACCESSOR(shm); + +#ifdef __cplusplus +} +#endif + +#endif /* APR_SHM_T */ diff --git a/include/apr_shmem.h b/include/apr_shmem.h deleted file mode 100644 index 696c2d09cae..00000000000 --- a/include/apr_shmem.h +++ /dev/null @@ -1,173 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_SHMEM_H -#define APR_SHMEM_H -/** - * @file apr_shmem.h - * @brief APR Shared Memory Routines - */ -/** - * @defgroup APR_shmem Shared Memory Routines - * @ingroup APR - * @{ - */ - -#include "apr.h" -#include "apr_pools.h" -#include "apr_errno.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#if APR_USES_FILEBASED_SHM -typedef char * apr_shm_name_t; -#elif APR_USES_KEYBASED_SHM -typedef key_t apr_shm_name_t; -#else -/* If APR_USES_ANONYMOUS_SHM or any other case... - * we can't leave apr_shm_name_t entirely undefined. - */ -typedef void apr_shm_name_t; -#endif - -typedef struct apr_shmem_t apr_shmem_t; - -/** - * Create a pool of shared memory for use later. - * @param m The shared memory block. - * @param reqsize The size of the shared memory pool. - * @param file The file to use for the shared memory on platforms - * that require it. - * @param cont The pool to use - */ -APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, - const char *file, apr_pool_t *cont); - -/** - * Destroy the shared memory block. - * @param m The shared memory block to destroy. - */ -APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m); - -/** - * allocate memory from the block of shared memory. - * @param c The shared memory block to destroy. - * @param reqsize How much memory to allocate - */ -APR_DECLARE(void *) apr_shm_malloc(apr_shmem_t *c, apr_size_t reqsize); - -/** - * allocate memory from the block of shared memory and initialize it to zero. - * @param shared The shared memory block to destroy. - * @param size How much memory to allocate - */ -APR_DECLARE(void *) apr_shm_calloc(apr_shmem_t *shared, apr_size_t size); - -/** - * free shared memory previously allocated. - * @param shared The shared memory block to destroy. - * @param entity The actual data to free. - */ -APR_DECLARE(apr_status_t) apr_shm_free(apr_shmem_t *shared, void *entity); - -/** - * Get the name of the shared memory segment if not using anonymous - * shared memory. - * @param c The shared memory block to destroy. - * @param name The name of the shared memory block, NULL if anonymous - * shared memory. - * @return APR_USES_ANONYMOUS_SHM if we are using anonymous shared - * memory. APR_USES_FILEBASED_SHM if our shared memory is - * based on file access. APR_USES_KEYBASED_SHM if shared - * memory is based on a key value such as shmctl. If the - * shared memory is anonymous, the name is NULL. - */ -APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, - apr_shm_name_t **name); - -/** - * Set the name of the shared memory segment if not using anonymous - * shared memory. This is to allow processes to open shared memory - * created by another process. - * @param c The shared memory block to destroy. - * @param name The name of the shared memory block, NULL if anonymous - * shared memory. - * @return APR_USES_ANONYMOUS_SHM if we are using anonymous shared - * memory. APR_SUCCESS if we are using named shared memory - * and we were able to assign the name correctly. - */ -APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, - apr_shm_name_t *name); - -/** - * Open the shared memory block in a child process. - * @param The shared memory block to open in the child. - */ -APR_DECLARE(apr_status_t) apr_shm_open(apr_shmem_t *c); - -/** - * Determine how much memory is available in the specified shared memory block - * @param c The shared memory block to open in the child. - * @param avail The amount of space available in the shared memory block. - */ -APR_DECLARE(apr_status_t) apr_shm_avail(apr_shmem_t *c, apr_size_t *avail); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif /* ! APR_SHMEM_H */ - diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c new file mode 100644 index 00000000000..a73d3620626 --- /dev/null +++ b/shmem/beos/shm.c @@ -0,0 +1,128 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_general.h" +#include "apr_shmem.h" +#include "apr_errno.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include +#include +#include + +struct apr_shm_t { + apr_pool_t *p; + void *memblock; + void *ptr; + apr_size_t avail; + area_id aid; +}; + +APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, + apr_pool_t *p) +{ + apr_size_t pagesize; + area_id newid; + char *addr; + + (*m) = (apr_shmem_t *)apr_pcalloc(p, sizeof(apr_shmem_t)); + /* we MUST allocate in pages, so calculate how big an area we need... */ + pagesize = ((reqsize + B_PAGE_SIZE - 1) / B_PAGE_SIZE) * B_PAGE_SIZE; + + newid = create_area("apr_shm", (void*)&addr, B_ANY_ADDRESS, + pagesize, B_CONTIGUOUS, B_READ_AREA|B_WRITE_AREA); + + if (newid < 0) + return errno; + + (*m)->p = p; + (*m)->aid = newid; + (*m)->memblock = addr; + (*m)->ptr = (void*)addr; + (*m)->avail = pagesize; /* record how big an area we actually created... */ + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m) +{ + delete_area(m->aid); + m->avail = 0; + m->memblock = NULL; + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_shm_attach(apr_shmem_t **m, + const char *filename, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_shm_detach(apr_shmem_t *m) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) +{ + return APR_ENOTIMPL; +} + diff --git a/shmem/beos/shmem.c b/shmem/beos/shmem.c deleted file mode 100644 index faa8f07b92d..00000000000 --- a/shmem/beos/shmem.c +++ /dev/null @@ -1,321 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_general.h" -#include "apr_shmem.h" -#include "apr_errno.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include -#include -#include - -struct block_t { - apr_pool_t *p; - void *addr; - apr_size_t size; - void *nxt; - void *prev; -}; - -struct apr_shmem_t { - apr_pool_t *p; - void *memblock; - void *ptr; - apr_size_t avail; - area_id aid; - struct block_t *uselist; - struct block_t *freelist; -}; - -#define MIN_BLK_SIZE 128 - - -void add_block(struct block_t **list, struct block_t *blk); -void split_block(struct block_t **list, struct block_t *blk, apr_size_t size); - -static struct block_t * find_block_by_addr(struct block_t *list, void *addr) -{ - struct block_t *b = list; - do { - if (b->addr == addr) - return b; - } - while ((b = b->nxt) != NULL); - - return NULL; -} - -static struct block_t *find_block_of_size(struct block_t *list, apr_size_t size) -{ - struct block_t *b = list, *rv = NULL; - apr_ssize_t diff = -1; - - if (!list) - return NULL; - - do { - if (b->size == size) - return b; - if (b->size > size){ - if (diff == -1) - diff = b->size; - if ((b->size - size) < diff){ - diff = b->size - size; - rv = b; - } - } - } - while ((b = b->nxt) != list); - - if (diff > MIN_BLK_SIZE) { - split_block(&list, rv, size); - } - - if (rv) - return rv; - - return NULL; -} - -void add_block(struct block_t **list, struct block_t *blk) -{ - if ((*list) == NULL) - *list = blk; - - if (blk == (*list)){ - blk->prev = blk; - blk->nxt = blk; - } else { - ((struct block_t*)(*list)->prev)->nxt = blk; - blk->prev = ((struct block_t *)(*list))->prev; - blk->nxt = (*list); - (*list)->prev = blk; - } -} - -void split_block(struct block_t **list, struct block_t *blk, apr_size_t size) -{ - apr_size_t nsz = blk->size - size; - struct block_t *b = (struct block_t*)apr_pcalloc(blk->p, sizeof(struct block_t)); - b->p = blk->p; - b->size = nsz; - blk->size = size; - b->addr = blk->addr + size; - add_block(list, b); -} - -static void remove_block(struct block_t **list, struct block_t *blk) -{ - if (((*list) == blk) && (blk->nxt == blk) && (blk == blk->prev)){ - *list = NULL; - blk->nxt = NULL; - blk->prev = NULL; - } else { - ((struct block_t*)(blk->nxt))->prev = blk->prev; - ((struct block_t*)(blk->prev))->nxt = blk->nxt; - if (*list == blk) - *list = blk->nxt; - blk->nxt = NULL; - blk->prev = NULL; - } -} - -/* puts a used block onto the free list for it to be reused... */ -static void free_block(apr_shmem_t *m, void *entity) -{ - struct block_t *b; - if ((b = find_block_by_addr(m->uselist, entity)) != NULL){ - remove_block(&(m->uselist), b); - add_block(&(m->freelist), b); - m->avail += b->size; - } -} - -/* assigns a block of our memory and puts an entry on the uselist */ -static struct block_t *alloc_block(apr_shmem_t *m, apr_size_t size) -{ - struct block_t *b = NULL; - if (m->avail < size) - return NULL; - - if ((b = find_block_of_size(m->freelist, size)) != NULL){ - remove_block(&(m->freelist), b); - } else { - b = (struct block_t*)apr_pcalloc(m->p, sizeof(struct block_t)); - b->p = m->p; - b->addr = m->ptr; - b->size = size; - m->ptr += size; - } - m->avail -= b->size; /* actual size may be different if we're reusing a block */ - add_block(&(m->uselist), b); - - return b; -} - -APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, - apr_pool_t *p) -{ - apr_size_t pagesize; - area_id newid; - char *addr; - - (*m) = (apr_shmem_t *)apr_pcalloc(p, sizeof(apr_shmem_t)); - /* we MUST allocate in pages, so calculate how big an area we need... */ - pagesize = ((reqsize + B_PAGE_SIZE - 1) / B_PAGE_SIZE) * B_PAGE_SIZE; - - newid = create_area("apr_shm", (void*)&addr, B_ANY_ADDRESS, - pagesize, B_CONTIGUOUS, B_READ_AREA|B_WRITE_AREA); - - if (newid < 0) - return errno; - - (*m)->p = p; - (*m)->aid = newid; - (*m)->memblock = addr; - (*m)->ptr = (void*)addr; - (*m)->avail = pagesize; /* record how big an area we actually created... */ - (*m)->uselist = NULL; - (*m)->freelist = NULL; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m) -{ - delete_area(m->aid); - m->avail = 0; - m->freelist = NULL; - m->uselist = NULL; - m->memblock = NULL; - return APR_SUCCESS; -} - -APR_DECLARE(void *) apr_shm_malloc(apr_shmem_t *m, apr_size_t reqsize) -{ - struct block_t *b; - if ((b = alloc_block(m, reqsize)) != NULL) - return b->addr; - return NULL; -} - -APR_DECLARE(void *) apr_shm_calloc(apr_shmem_t *m, apr_size_t reqsize) -{ - struct block_t *b; - if ((b = alloc_block(m, reqsize)) != NULL){ - memset(b->addr, 0, reqsize); - return b->addr; - } - return NULL; -} - -APR_DECLARE(apr_status_t) apr_shm_free(apr_shmem_t *m, void *entity) -{ - free_block(m, entity); - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) -{ - *name = NULL; - return APR_ANONYMOUS; -} - -APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) -{ - return APR_ANONYMOUS; -} - -APR_DECLARE(apr_status_t) apr_shm_open(apr_shmem_t *m) -{ - /* If we've forked we need a clone of the original area or we - * will only have access to a one time copy of the data made when - * the fork occurred. This strange bit of code fixes that problem! - */ - thread_info ti; - area_info ai; - area_id deleteme = area_for(m->memblock); - - /* we need to check which team we're in, so we need to get - * the appropriate info structures for the current thread and - * the area we're using. - */ - get_area_info(m->aid, &ai); - get_thread_info(find_thread(NULL), &ti); - - if (ti.team != ai.team){ - area_id nai; - /* if we are in a child then we need to delete the system - * created area as it's a one time copy and won't be a clone - * which is not good. - */ - delete_area(deleteme); - /* now we make our own clone and use that from now on! */ - nai = clone_area(ai.name, &(ai.address), B_CLONE_ADDRESS, - B_READ_AREA | B_WRITE_AREA, ai.area); - get_area_info(nai, &ai); - m->memblock = ai.address; - } - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_shm_avail(apr_shmem_t *m, apr_size_t *size) -{ - *size = m->avail; - if (m->avail == 0) - return APR_ENOSHMAVAIL; - return APR_SUCCESS; - -} diff --git a/shmem/os2/shmem.c b/shmem/os2/shm.c similarity index 80% rename from shmem/os2/shmem.c rename to shmem/os2/shm.c index 009b5a96818..9adf4035850 100644 --- a/shmem/os2/shmem.c +++ b/shmem/os2/shm.c @@ -65,9 +65,7 @@ struct apr_shmem_t { Heap_t heap; }; - - -APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *filename, apr_pool_t *cont) { int rc; apr_shmem_t *newm = (apr_shmem_t *)apr_palloc(cont, sizeof(apr_shmem_t)); @@ -92,8 +90,6 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, cons return APR_SUCCESS; } - - APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m) { _uclose(m->heap); @@ -102,62 +98,24 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m) return APR_SUCCESS; } - - -APR_DECLARE(void *) apr_shm_malloc(apr_shmem_t *m, apr_size_t reqsize) -{ - return _umalloc(m->heap, reqsize); -} - - - -APR_DECLARE(void *) apr_shm_calloc(apr_shmem_t *m, apr_size_t size) +APR_DECLARE(apr_status_t) apr_shm_attach(apr_shmem_t **m, + const char *filename, + apr_pool_t *pool) { - return _ucalloc(m->heap, size, 1); -} - - - -APR_DECLARE(apr_status_t) apr_shm_free(apr_shmem_t *m, void *entity) -{ - free(entity); - return APR_SUCCESS; -} - - - -APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name) -{ - *name = NULL; - return APR_ANONYMOUS; + return APR_ENOTIMPL; } - - -APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name) +APR_DECLARE(apr_status_t) apr_shm_detach(apr_shmem_t *m) { - return APR_ANONYMOUS; + return APR_ENOTIMPL; } - - -APR_DECLARE(apr_status_t) apr_shm_open(apr_shmem_t *m) +APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) { - int rc; - - rc = DosGetSharedMem(m->memblock, PAG_READ|PAG_WRITE); - - if (rc) - return APR_OS2_STATUS(rc); - - _uopen(m->heap); - return APR_SUCCESS; + return APR_ENOTIMPL; } - - -APR_DECLARE(apr_status_t) apr_shm_avail(apr_shmem_t *c, apr_size_t *size) +APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) { - return APR_ENOTIMPL; -} + diff --git a/shmem/unix/Makefile.in b/shmem/unix/Makefile.in index 7b8e9622322..fdf5956c7e7 100644 --- a/shmem/unix/Makefile.in +++ b/shmem/unix/Makefile.in @@ -1,10 +1,12 @@ -TARGETS = shmem.lo +TARGETS = shm.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ INCDIR=../../include -INCLUDES=-I$(INCDIR) +INCDIR2=$(INCDIR)/arch +INCDIR3=$(INCDIR)/arch/unix +INCLUDES=-I$(INCDIR) -I$(INCDIR2) -I$(INCDIR3) # DO NOT REMOVE diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c new file mode 100644 index 00000000000..0b21449d88a --- /dev/null +++ b/shmem/unix/shm.c @@ -0,0 +1,459 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "shm.h" + +#include "apr_general.h" +#include "apr_errno.h" +#include "apr_user.h" +#include "apr_strings.h" + +/* +#define APR_WANT_MEMFUNC +#include "apr_want.h" +*/ + +/* +#include "apr_portable.h" +*/ + +#if 0 +#if APR_HAVE_SHMEM_SHMGET +/* The metadata that is stored in the file that we use to rendevous + * with the segment in unrelated processes. */ +struct apr_shm_shmget_metadata { + apr_size_t reqsize; /* requested size of the segment */ +}; +#endif /* APR_HAVE_SHMEM_SHMGET */ +#endif + +APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, + apr_size_t reqsize, + const char *filename, + apr_pool_t *pool) +{ + apr_shm_t *new_m; + apr_status_t status; +#if APR_USE_SHMEM_SHMGET + struct shmid_ds shmbuf; + apr_uid_t uid; + apr_gid_t gid; +#endif +#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || \ + APR_USE_SHMEM_MMAP_ZERO + int tmpfd; +#endif +#if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON + apr_size_t nbytes; + apr_file_t *file; /* file where metadata is stored */ + int shmid; +#endif + + /* FIXME: associate this thing with a pool and set up a destructor + * to call detach. */ + + /* Check if they want anonymous or name-based shared memory */ + if (filename == NULL) { +#if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_MMAP_ANON + new_m = apr_palloc(pool, sizeof(apr_shm_t)); + if (!new_m) { + return APR_ENOMEM; + } + new_m->pool = pool; + new_m->reqsize = reqsize; + new_m->realsize = reqsize + sizeof(apr_size_t); /* room for metadata */ + new_m->filename = NULL; + +#if APR_USE_SHMEM_MMAP_ZERO + status = apr_file_open(&new_m->file, "/dev/zero", APR_READ | APR_WRITE, + APR_OS_DEFAULT, pool); + if (status != APR_SUCCESS) { + return status; + } + status = apr_os_file_get(&tmpfd, new_m->file); + if (status != APR_SUCCESS) { + return status; + } + + new_m->base = mmap(NULL, new_m->realsize, PROT_READ|PROT_WRITE, + MAP_SHARED, tmpfd, 0); + if (new_m->base == MAP_FAILED) { + return errno; + } + + /* No need to keep the file open after we map it. */ + close(tmpfd); + + /* store the real size in the metadata */ + *(apr_size_t*)(new_m->base) = new_m->realsize; + /* metadata isn't usable */ + new_m->usable = new_m->base + sizeof(apr_size_t); + + *m = new_m; + return APR_SUCCESS; + +#elif APR_USE_SHMEM_MMAP_ANON + new_m->base = mmap(NULL, reqsize, PROT_READ|PROT_WRITE, + MAP_ANON|MAP_SHARED, -1, 0); + if (new_m->base == MAP_FAILED) { + return errno; + } + + /* store the real size in the metadata */ + *(apr_size_t*)(new_m->base) = new_m->realsize; + /* metadata isn't usable */ + new_m->usable = new_m->base + sizeof(apr_size_t); + + *m = new_m; + return APR_SUCCESS; + +#endif /* APR_USE_SHMEM_MMAP_ZERO */ +#endif /* APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_MMAP_ANON */ +#if APR_USE_SHMEM_SHMGET_ANON + + new_m = apr_palloc(pool, sizeof(apr_shm_t)); + if (!new_m) { + return APR_ENOMEM; + } + new_m->pool = pool; + new_m->reqsize = reqsize; + new_m->realsize = reqsize; + new_m->filename = NULL; + + if ((shmid = shmget(IPC_PRIVATE, new_m->realsize, + SHM_R | SHM_W | IPC_CREAT)) < 0) { + return errno; + } + + if ((new_m->base = shmat(shmid, NULL, 0)) < 0) { + return errno; + } + + new_m->usable = new_m->base; + + if (shmctl(shmid, IPC_STAT, &shmbuf) == -1) { + return errno; + } + apr_current_userid(&uid, &gid, pool); + shmbuf.shm_perm.uid = uid; + shmbuf.shm_perm.gid = gid; + if (shmctl(shmid, IPC_SET, &shmbuf) == -1) { + return errno; + } + + new_m->shmid = shmid; + + *m = new_m; + return APR_SUCCESS; +#endif /* APR_USE_SHMEM_SHMGET_ANON */ + /* It is an error if they want anonymous memory but we don't have it. */ + return APR_ENOTIMPL; /* requested anonymous but we don't have it */ + } + + /* Name-based shared memory */ + else { + new_m = apr_palloc(pool, sizeof(apr_shm_t)); + if (!new_m) { + return APR_ENOMEM; + } + new_m->pool = pool; + new_m->reqsize = reqsize; + new_m->filename = apr_pstrdup(pool, filename); + +#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM + new_m->realsize = reqsize + sizeof(apr_size_t); /* room for metadata */ + /* FIXME: Ignore error for now. * + * status = apr_file_remove(file, pool);*/ + status = APR_SUCCESS; + +#if APR_USE_SHMEM_MMAP_TMP + /* FIXME: Is APR_OS_DEFAULT sufficient? */ + status = apr_file_open(&new_m->file, filename, + APR_READ | APR_WRITE | APR_CREATE, + APR_OS_DEFAULT, pool); + if (status != APR_SUCCESS) { + return status; + } + if ((status = apr_os_file_get(&tmpfd, new_m->file)) != APR_SUCCESS) { + return status; + } + status = apr_file_trunc(new_m->file, new_m->realsize); + if (status != APR_SUCCESS) { + /* FIXME: should we unlink the file here? */ + /* FIXME: should we close the file here? */ + return status; + } +#elif APR_USE_SHMEM_MMAP_SHM + /* FIXME: Is APR_OS_DEFAULT sufficient? */ + tmpfd = shm_open(filename, O_RDWR | O_CREAT, APR_OS_DEFAULT); + if (tmpfd == -1) { + return errno; + } + + apr_os_file_put(&new_m->file, &tmpfd, pool); + /* FIXME: check for errors */ + + status = apr_file_trunc(new_m->file, new_m->realsize); + if (status != APR_SUCCESS) { + shm_unlink(filename); /* we're failing, remove the object */ + return status; + } +#endif /* APR_USE_SHMEM_MMAP_SHM */ + new_m->base = mmap(NULL, reqsize, PROT_READ|PROT_WRITE, + MAP_SHARED, tmpfd, 0); + + /* FIXME: check for error */ + + /* FIXME: close the file (can we close the file if we're using + * shm_open? */ + + /* store the real size in the metadata */ + *(apr_size_t*)(new_m->base) = new_m->realsize; + /* metadata isn't usable */ + new_m->usable = new_m->base + sizeof(apr_size_t); + + *m = new_m; + return APR_SUCCESS; + +#endif /* APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM */ + +#if APR_USE_SHMEM_SHMGET + new_m->realsize = reqsize; + + if ((shmid = shmget(ftok(filename, 1), new_m->realsize, + SHM_R | SHM_W | IPC_CREAT)) < 0) { + return errno; + } + + new_m->base = shmat(shmid, NULL, 0); + /* FIXME: Handle errors. */ + new_m->usable = new_m->base; + + if (shmctl(shmid, IPC_STAT, &shmbuf) == -1) { + return errno; + } + apr_current_userid(&uid, &gid, pool); + shmbuf.shm_perm.uid = uid; + shmbuf.shm_perm.gid = gid; + if (shmctl(shmid, IPC_SET, &shmbuf) == -1) { + return errno; + } + + new_m->shmid = shmid; + + /* FIXME: APR_OS_DEFAULT is too permissive, switch to 600 I think. */ + status = apr_file_open(&file, filename, + APR_WRITE | APR_CREATE, + APR_OS_DEFAULT, pool); + if (status != APR_SUCCESS) { + return status; + } + + nbytes = sizeof(reqsize); + status = apr_file_write(file, (const void *)&reqsize, + &nbytes); + if (status != APR_SUCCESS) { + return status; + } + status = apr_file_close(file); + if (status != APR_SUCCESS) { + return status; + } + + /* Remove the segment once use count hits zero. */ + if (shmctl(shmid, IPC_RMID, NULL) == -1) { + return errno; + } + + *m = new_m; + return APR_SUCCESS; + +#endif /* APR_USE_SHMEM_SHMGET */ + } + + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) +{ + /* FIXME: do cleanups based on what was allocated, not what was + * defined at runtime. */ +#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO + munmap(m->base, m->realsize); + apr_file_close(m->file); +#elif APR_USE_SHMEM_MMAP_ANON + munmap(m->base, m->realsize); +#elif APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON + shmdt(m->base); +#endif + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, + const char *filename, + apr_pool_t *pool) +{ + apr_status_t status; + + if (filename == NULL) { +#if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_MMAP_ANON + /* If they want anonymous memory they shouldn't call attach. */ + return APR_EGENERAL; +#else + return APR_ENOTIMPL; +#endif + } + else { +#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM + int tmpfd; + struct stat buf; + apr_shm_t *new_m; + + new_m = apr_palloc(pool, sizeof(apr_shm_t)); + if (!new_m) { + return APR_ENOMEM; + } + new_m->pool = pool; + new_m->reqsize = reqsize; + new_m->realsize = reqsize + sizeof(apr_size_t); /* room for metadata */ + new_m->filename = apr_pstrdup(pool, filename); + + /* FIXME: open the file, read the length, mmap the segment, + * close the file, reconstruct the apr_shm_t. */ + status = apr_file_open(&new_m->file, filename, + APR_READ | APR_WRITE | APR_CREATE, + APR_OS_DEFAULT, pool); + if (status != APR_SUCCESS) { + return status; + } + if ((status = apr_os_file_get(&tmpfd, new_m->file)) != APR_SUCCESS) { + return status; + } + + + return APR_ENOTIMPL; + +#elif APR_USE_SHMEM_SHMGET + apr_shm_t *new_m; + apr_file_t *file; /* file where metadata is stored */ + apr_size_t nbytes; + + new_m = apr_palloc(pool, sizeof(apr_shm_t)); + if (!new_m) { + return APR_ENOMEM; + } + + /* FIXME: does APR_OS_DEFAULT matter for reading? */ + status = apr_file_open(&file, filename, + APR_READ, APR_OS_DEFAULT, pool); + if (status != APR_SUCCESS) { + return status; + } + + nbytes = sizeof(new_m->reqsize); + status = apr_file_read(file, (void *)&(new_m->reqsize), + &nbytes); + if (status != APR_SUCCESS) { + return status; + } + status = apr_file_close(file); + if (status != APR_SUCCESS) { + return status; + } + + new_m->pool = pool; + if ((new_m->shmid = shmget(ftok(filename, 1), 0, + SHM_R | SHM_W)) < 0) { + return errno; + } + new_m->base = shmat(new_m->shmid, NULL, 0); + /* FIXME: handle errors */ + new_m->usable = new_m->base; + new_m->realsize = new_m->reqsize; + + *m = new_m; + return APR_SUCCESS; + +#else + return APR_ENOTIMPL; +#endif + } +} + +APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) +{ +#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM + /* FIXME: munmap the segment. */ + return APR_ENOTIMPL; +#elif APR_USE_SHMEM_SHMGET + /* FIXME: shmdt. */ + return APR_ENOTIMPL; +#else + return APR_ENOTIMPL; +#endif +} + +APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) +{ + return m->usable; +} + +APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) +{ + return m->reqsize; +} + +APR_POOL_IMPLEMENT_ACCESSOR(shm) + diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c deleted file mode 100644 index a4b09c82f8a..00000000000 --- a/shmem/unix/shmem.c +++ /dev/null @@ -1,331 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_general.h" -#include "apr_shmem.h" -#include "apr_lock.h" -#include "apr_portable.h" -#include "apr_errno.h" -#define APR_WANT_MEMFUNC -#include "apr_want.h" - -/* - * This is the Unix implementation of shared memory. - * - * Currently, this code supports the following shared memory techniques: - * - * - mmap on a temporary file - * - mmap/shm_open on a temporary file (POSIX.1) - * - mmap with MAP_ANON (4.4BSD) - * - mmap /dev/zero (SVR4) - * - shmget (SysV) - * - create_area (BeOS) - */ - -#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_MMAP_ANON -#include -#elif APR_USE_SHMEM_SHMGET -#include -#include -#if !defined(SHM_R) -#define SHM_R 0400 -#endif -#if !defined(SHM_W) -#define SHM_W 0200 -#endif -#include -#elif APR_USE_SHMEM_BEOS -#include -#endif - -struct apr_shmem_t { - void *mem; - void *curmem; - apr_size_t length; - apr_lock_t *lock; - char *filename; -#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO - apr_file_t *file; -#elif APR_USE_SHMEM_MMAP_ANON - /* Nothing else. */ -#elif APR_USE_SHMEM_SHMGET - apr_os_file_t file; -#elif APR_USE_SHMEM_BEOS - area_id areaid; -#endif -}; - -APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, - const char *filename, apr_pool_t *pool) -{ - apr_shmem_t *new_m; - void *mem; -#if APR_USE_SHMEM_SHMGET - struct shmid_ds shmbuf; - apr_uid_t uid; - apr_gid_t gid; -#endif -#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO - apr_status_t status; -#endif -#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || \ - APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_SHMGET - int tmpfd; -#endif - - new_m = apr_palloc(pool, sizeof(apr_shmem_t)); - if (!new_m) - return APR_ENOMEM; - -/* These implementations are very similar except for opening the file. */ -#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO - /* FIXME: Ignore error for now. * - * status = apr_file_remove(filename, pool);*/ - status = APR_SUCCESS; - -#if APR_USE_SHMEM_MMAP_TMP - /* FIXME: Is APR_OS_DEFAULT sufficient? */ - status = apr_file_open(&new_m->file, filename, - APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, - pool); - if (status != APR_SUCCESS) - return APR_EGENERAL; - - status = apr_os_file_get(&tmpfd, new_m->file); - status = apr_file_trunc(new_m->file, reqsize); - if (status != APR_SUCCESS) - return APR_EGENERAL; - -#elif APR_USE_SHMEM_MMAP_SHM - /* FIXME: Is APR_OS_DEFAULT sufficient? */ - tmpfd = shm_open(filename, O_RDWR | O_CREAT, APR_OS_DEFAULT); - if (tmpfd == -1) - return errno; - - apr_os_file_put(&new_m->file, &tmpfd, O_READ | O_WRITE | O_CREATE, pool); - status = apr_file_trunc(new_m->file, reqsize); - if (status != APR_SUCCESS) - { - shm_unlink(filename); - return APR_EGENERAL; - } -#elif APR_USE_SHMEM_MMAP_ZERO - status = apr_file_open(&new_m->file, "/dev/zero", APR_READ | APR_WRITE, - APR_OS_DEFAULT, pool); - if (status != APR_SUCCESS) - return APR_EGENERAL; - status = apr_os_file_get(&tmpfd, new_m->file); -#endif - - mem = mmap(NULL, reqsize, PROT_READ|PROT_WRITE, MAP_SHARED, tmpfd, 0); - -#elif APR_USE_SHMEM_MMAP_ANON - mem = mmap(NULL, reqsize, PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0); -#elif APR_USE_SHMEM_SHMGET - tmpfd = shmget(IPC_PRIVATE, reqsize, (SHM_R|SHM_W|IPC_CREAT)); - if (tmpfd == -1) - return errno; - - new_m->file = tmpfd; - - mem = shmat(new_m->file, NULL, 0); - - /* FIXME: Handle errors. */ - if (shmctl(new_m->file, IPC_STAT, &shmbuf) == -1) - return errno; - - apr_current_userid(&uid, &gid, pool); - shmbuf.shm_perm.uid = uid; - shmbuf.shm_perm.gid = gid; - - if (shmctl(new_m->file, IPC_SET, &shmbuf) == -1) - return errno; - - /* remove in future (once use count hits zero) */ - if (shmctl(new_m->file, IPC_RMID, NULL) == -1) - return errno; - -#elif APR_USE_SHMEM_BEOS - new_m->area_id = create_area("mm", (void*)&mem, B_ANY_ADDRESS, reqsize, - B_LAZY_LOCK, B_READ_AREA|B_WRITE_AREA); - /* FIXME: error code? */ - if (new_m->area_id < 0) - return APR_EGENERAL; - -#endif - - new_m->mem = mem; - new_m->curmem = mem; - new_m->length = reqsize; - - apr_lock_create(&new_m->lock, APR_MUTEX, APR_CROSS_PROCESS, - APR_LOCK_DEFAULT, NULL, pool); - if (!new_m->lock) - return APR_EGENERAL; - - *m = new_m; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m) -{ -#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO - munmap(m->mem, m->length); - apr_file_close(m->file); -#elif APR_USE_SHMEM_MMAP_ANON - munmap(m->mem, m->length); -#elif APR_USE_SHMEM_SHMGET - shmdt(m->mem); -#elif APR_USE_SHMEM_BEOS - delete_area(new_m->area_id); -#endif - - return APR_SUCCESS; -} - -APR_DECLARE(void *) apr_shm_malloc(apr_shmem_t *m, apr_size_t reqsize) -{ - void *new; - new = NULL; - - apr_lock_acquire(m->lock); - /* Do we have enough space? */ - if (((char *)m->curmem - (char *)m->mem + reqsize) <= m->length) - { - new = m->curmem; - m->curmem = (char *)m->curmem + reqsize; - } - apr_lock_release(m->lock); - return new; -} - -APR_DECLARE(void *) apr_shm_calloc(apr_shmem_t *m, apr_size_t reqsize) -{ - void *new = apr_shm_malloc(m, reqsize); - if (new) - memset(new, '\0', reqsize); - return new; -} - -APR_DECLARE(apr_status_t) apr_shm_free(apr_shmem_t *shared, void *entity) -{ - /* Without a memory management scheme within our shared memory, it - * is impossible to implement free. */ - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, - apr_shm_name_t **name) -{ -#if APR_USES_ANONYMOUS_SHM - *name = NULL; - return APR_ANONYMOUS; -/* Currently, we are not supporting name based shared memory on Unix - * systems. This may change in the future however, so I will leave - * this in here for now. Plus, this gives other platforms a good idea - * of how to proceed. - */ -#elif APR_USES_FILEBASED_SHM -#elif APR_USES_KEYBASED_SHM -#endif -} - -APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, - apr_shm_name_t *name) -{ -#if APR_USES_ANONYMOUS_SHM - return APR_ANONYMOUS; -/* Currently, we are not supporting name based shared memory on Unix - * systems. This may change in the future however, so I will leave - * this in here for now. Plus, this gives other platforms a good idea - * of how to proceed. - */ -#elif APR_USES_FILEBASED_SHM -#elif APR_USES_KEYBASED_SHM -#endif -} - -APR_DECLARE(apr_status_t) apr_shm_open(apr_shmem_t *c) -{ -#if APR_USES_ANONYMOUS_SHM - -/* we don't need to open shared memory segments in child segments, so - * just return immediately. - */ - return APR_SUCCESS; -/* Currently, we are not supporting name based shared memory on Unix - * systems. This may change in the future however, so I will leave - * this in here for now. Plus, this gives other platforms a good idea - * of how to proceed. - */ -#elif APR_USES_FILEBASED_SHM -#elif APR_USES_KEYBASED_SHM -#endif -} - -APR_DECLARE(apr_status_t) apr_shm_avail(apr_shmem_t *m, apr_size_t *size) -{ - apr_status_t status; - - status = APR_ENOSHMAVAIL; - - apr_lock_acquire(m->lock); - - *size = m->length - ((char *)m->curmem - (char *)m->mem); - if (*size) - status = APR_SUCCESS; - - apr_lock_release(m->lock); - return status; -} diff --git a/test/Makefile.in b/test/Makefile.in index 38bfb7368a7..9f4d9fa686a 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -18,6 +18,9 @@ PROGRAMS = \ testud@EXEEXT@ \ testmmap@EXEEXT@ \ testshmem@EXEEXT@ \ + testshm@EXEEXT@ \ + testshmproducer@EXEEXT@ \ + testshmconsumer@EXEEXT@ \ testpipe@EXEEXT@ \ testoc@EXEEXT@ \ testuuid@EXEEXT@ \ @@ -116,6 +119,15 @@ testmmap@EXEEXT@: testmmap.lo $(LOCAL_LIBS) testshmem@EXEEXT@: testshmem.lo $(LOCAL_LIBS) $(LINK) testshmem.lo $(LOCAL_LIBS) $(ALL_LIBS) +testshm@EXEEXT@: testshm.lo $(LOCAL_LIBS) testshmproducer@EXEEXT@ testshmconsumer@EXEEXT@ + $(LINK) testshm.lo $(LOCAL_LIBS) $(ALL_LIBS) + +testshmproducer@EXEEXT@: testshmproducer.lo $(LOCAL_LIBS) + $(LINK) testshmproducer.lo $(LOCAL_LIBS) $(ALL_LIBS) + +testshmconsumer@EXEEXT@: testshmconsumer.lo $(LOCAL_LIBS) + $(LINK) testshmconsumer.lo $(LOCAL_LIBS) $(ALL_LIBS) + testpipe@EXEEXT@: testpipe.lo $(LOCAL_LIBS) $(LINK) testpipe.lo $(LOCAL_LIBS) $(ALL_LIBS) From e37696dbebf8438553161fe037d407242dffc611 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 10 Jan 2002 00:20:18 +0000 Subject: [PATCH 2732/7878] Changes for Win32 to build with shm. [and a little bit of alpha ordering] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62736 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 5 ++--- include/apr.hw | 2 +- libapr.dsp | 13 ++++++------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/apr.dsp b/apr.dsp index 4cf42b40938..26fc0b232b3 100644 --- a/apr.dsp +++ b/apr.dsp @@ -295,8 +295,7 @@ SOURCE=.\passwd\apr_md5.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\shmem\win32\shmem.c -# PROP Exclude_From_Build 1 +SOURCE=.\shmem\win32\shm.c # End Source File # End Group # Begin Group "strings" @@ -555,7 +554,7 @@ SOURCE=.\include\apr_ring.h # End Source File # Begin Source File -SOURCE=.\include\apr_shmem.h +SOURCE=.\include\apr_shm.h # End Source File # Begin Source File diff --git a/include/apr.hw b/include/apr.hw index 374f66334b0..5de59ccf378 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -225,7 +225,7 @@ #endif /* APR Feature Macros */ -#define APR_HAS_SHARED_MEMORY 0 +#define APR_HAS_SHARED_MEMORY 1 #define APR_HAS_THREADS 1 #define APR_HAS_SENDFILE 1 #define APR_HAS_MMAP 1 diff --git a/libapr.dsp b/libapr.dsp index 9afda48757c..0b07380760f 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -111,10 +111,6 @@ SOURCE=.\file_io\unix\fileacc.c # End Source File # Begin Source File -SOURCE=.\file_io\unix\mktemp.c -# End Source File -# Begin Source File - SOURCE=.\file_io\win32\filedup.c # End Source File # Begin Source File @@ -139,6 +135,10 @@ SOURCE=.\file_io\unix\fullrw.c # End Source File # Begin Source File +SOURCE=.\file_io\unix\mktemp.c +# End Source File +# Begin Source File + SOURCE=.\file_io\win32\open.c # End Source File # Begin Source File @@ -301,8 +301,7 @@ SOURCE=.\passwd\apr_md5.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\shmem\win32\shmem.c -# PROP Exclude_From_Build 1 +SOURCE=.\shmem\win32\shm.c # End Source File # End Group # Begin Group "strings" @@ -561,7 +560,7 @@ SOURCE=.\include\apr_ring.h # End Source File # Begin Source File -SOURCE=.\include\apr_shmem.h +SOURCE=.\include\apr_shm.h # End Source File # Begin Source File From e7e414673085932a41e0cc3748b08de2d1cdf0c7 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 10 Jan 2002 00:28:14 +0000 Subject: [PATCH 2733/7878] Can't forget this one! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62737 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/shm.h | 105 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 include/arch/unix/shm.h diff --git a/include/arch/unix/shm.h b/include/arch/unix/shm.h new file mode 100644 index 00000000000..b1e2c5421e3 --- /dev/null +++ b/include/arch/unix/shm.h @@ -0,0 +1,105 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef SHM_H +#define SHM_H + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_shm.h" +#include "apr_pools.h" +#include "apr_file_io.h" +#include "apr_network_io.h" +#include "apr_portable.h" + +#ifdef HAVE_SYS_MMAN_H +#include +#endif +#ifdef HAVE_SYS_IPC_H +#include +#endif +#ifdef HAVE_SYS_SHM_H +#include +#endif +#if !defined(SHM_R) +#define SHM_R 0400 +#endif +#if !defined(SHM_W) +#define SHM_W 0200 +#endif +#ifdef HAVE_SYS_FILE_H +#include +#endif + +struct apr_shm_t { + apr_pool_t *pool; + void *base; /* base real address */ + void *usable; /* base usable address */ + apr_size_t reqsize; /* requested segment size */ + apr_size_t realsize; /* actual segment size */ + const char *filename; /* NULL if anonymous */ +#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO + apr_file_t *file; +#endif +#if APR_USE_SHMEM_MMAP_ANON + /* Nothing else. */ +#endif +#if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON + int shmid; /* shmem ID returned from shmget() */ +#endif +}; + +#endif /* SHM_H */ From 6c023bbe7cd32c18ef7656a1980e4171827d4aff Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 10 Jan 2002 01:19:24 +0000 Subject: [PATCH 2734/7878] This should take care of this STATUS entry. We now have a unified shared memory system that can be implemented and used on all platforms including Win32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62738 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++++++ STATUS | 12 +----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index 875215fa15d..0a75a40344f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,12 @@ Changes with APR b1 + *) Add new apr_shm_t API and remove old apr_shmem_t API. The new + API handles both anonymous and name-based shared memory. Anonymous + shared memory segments are only usable on systems with process + inheritance, and so the new API with name-based segments is + usable on platforms like Win32. [Aaron Bannert and William Rowe + with much help from Justin Erenkrantz and Sander Striker] + *) Add --with-egd to support EGD-compatible entropy gatherers for those platforms without native support. [Justin Erenkrantz] diff --git a/STATUS b/STATUS index a02f879d085..fd662747746 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/01/04 08:50:12 $] +Last modified at [$Date: 2002/01/10 01:19:24 $] Release: @@ -83,16 +83,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Build scripts do not recognise AIX 4.2.1 pthreads Justin says: "Is this still true?" - * Win32: Implement apr_shm_ functions - Status: rbb insists he has thoughts about splitting apr_shm_* - mechanisms to support muliple models (some sort of 'keyed' - schema as well as anonymous inheritable shmem), and has a - possible solution to the 'ask for 1MB, then ask for 4x256kb - bogosity, so we are waiting on this. - Justin says: "That problem should be fixed now because we ignore memory - management with shared memory on Unix (at least). So, - the Win32 guys should be able to go ahead if they want." - * FirstBill says we need a new procattr, APR_CREATE_SUSPENDED (or something similar) to direct ap_create_process to create the process suspended. We also need a call to wake up the suspended From 10cd741cea9b024531dd4f3edd1c1775ab1329ab Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 10 Jan 2002 02:09:20 +0000 Subject: [PATCH 2735/7878] OS/2: Pound the new shm code into some kind of working order. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62739 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/os2/Makefile.in | 2 +- shmem/os2/shm.c | 72 ++++++++++++++++++++++++++++--------------- 2 files changed, 49 insertions(+), 25 deletions(-) diff --git a/shmem/os2/Makefile.in b/shmem/os2/Makefile.in index 2c8d436407a..97214ff5a8d 100644 --- a/shmem/os2/Makefile.in +++ b/shmem/os2/Makefile.in @@ -1,5 +1,5 @@ -TARGETS = shmem.lo +TARGETS = shm.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c index 9adf4035850..c8d5a9e683a 100644 --- a/shmem/os2/shm.c +++ b/shmem/os2/shm.c @@ -53,69 +53,93 @@ */ #include "apr_general.h" -#include "apr_shmem.h" +#include "apr_shm.h" #include "apr_errno.h" #include "apr_lib.h" #include "apr_strings.h" -#include -#include -struct apr_shmem_t { +struct apr_shm_t { + apr_pool_t *pool; void *memblock; - Heap_t heap; }; -APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *filename, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, + apr_size_t reqsize, + const char *filename, + apr_pool_t *pool) { int rc; - apr_shmem_t *newm = (apr_shmem_t *)apr_palloc(cont, sizeof(apr_shmem_t)); + apr_shm_t *newm = (apr_shm_t *)apr_palloc(pool, sizeof(apr_shm_t)); char *name = NULL; ULONG flags = PAG_COMMIT|PAG_READ|PAG_WRITE; - if (file) - name = apr_pstrcat(cont, "\\SHAREMEM\\", file, NULL); + newm->pool = pool; - if (name == NULL) + if (filename) { + name = apr_pstrcat(pool, "\\SHAREMEM\\", filename, NULL); + } + + if (name == NULL) { flags |= OBJ_GETTABLE; + } - reqsize += 1024; /* Allow some overhead for heap structures */ rc = DosAllocSharedMem(&(newm->memblock), name, reqsize, flags); - if (rc) + if (rc) { return APR_OS2_STATUS(rc); + } - newm->heap = _ucreate(newm->memblock, reqsize, !_BLOCK_CLEAN, _HEAP_REGULAR|_HEAP_SHARED, NULL, NULL); - _uopen(newm->heap); *m = newm; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m) +APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) { - _uclose(m->heap); - _udestroy(m->heap, _FORCE); DosFreeMem(m->memblock); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_attach(apr_shmem_t **m, +APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, const char *filename, apr_pool_t *pool) { - return APR_ENOTIMPL; + int rc; + apr_shm_t *newm = (apr_shm_t *)apr_palloc(pool, sizeof(apr_shm_t)); + char *name = NULL; + ULONG flags = PAG_COMMIT|PAG_READ|PAG_WRITE; + + newm->pool = pool; + name = apr_pstrcat(pool, "\\SHAREMEM\\", filename, NULL); + + rc = DosGetNamedSharedMem(&(newm->memblock), name, flags); + + if (rc) { + return APR_FROM_OS_ERROR(rc); + } + + *m = newm; + return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_detach(apr_shmem_t *m) +APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) { - return APR_ENOTIMPL; + int rc = 0; + + if (m->memblock) { + rc = DosFreeMem(m->memblock); + } + + return APR_FROM_OS_ERROR(rc); } APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) { - return APR_ENOTIMPL; + return m->memblock; } APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) { - return APR_ENOTIMPL; - + ULONG flags, size = 0x1000000; + DosQueryMem(m->memblock, &size, &flags); + return size; +} From 21b632af0f0ccba18948360e357f83c9a0c10fb7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 10 Jan 2002 02:10:13 +0000 Subject: [PATCH 2736/7878] get some pointer arithmetic to compile on picky compilers git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62740 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 0b21449d88a..149488d97cf 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -153,7 +153,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* store the real size in the metadata */ *(apr_size_t*)(new_m->base) = new_m->realsize; /* metadata isn't usable */ - new_m->usable = new_m->base + sizeof(apr_size_t); + new_m->usable = (char *)new_m->base + sizeof(apr_size_t); *m = new_m; return APR_SUCCESS; From 75ef91b7d1d0ecbd310fc6253b46887b23c48651 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 10 Jan 2002 06:39:09 +0000 Subject: [PATCH 2737/7878] Obsoleted by testshm.c (as the old apr_shmem_t API is removed and replaced now with apr_shm_t). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62741 13f79535-47bb-0310-9956-ffa450edef68 --- test/testshmem.c | 260 ----------------------------------------------- 1 file changed, 260 deletions(-) delete mode 100644 test/testshmem.c diff --git a/test/testshmem.c b/test/testshmem.c deleted file mode 100644 index 5c705451c34..00000000000 --- a/test/testshmem.c +++ /dev/null @@ -1,260 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_shmem.h" -#include "apr_lock.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_time.h" -#include -#include -#include -#if APR_HAVE_UNISTD_H -#include -#endif - -typedef struct mbox { - char msg[1024]; - int msgavail; -} mbox; -apr_pool_t *context; -mbox *boxes; - -#define SIZE 256 -#define CYCLES 40 -#define TESTSIZE (apr_size_t)(4096 * SIZE) -#define TEST2SIZE (apr_size_t)(CYCLES * SIZE) - -static void msgwait(int boxnum) -{ - volatile int test = 0; - while (test == 0) { - apr_sleep(0); - test = boxes[boxnum].msgavail; - } - fprintf(stdout, "received a message in box %d, message was: %s\n", - boxnum, boxes[boxnum].msg); -} - -static void msgput(int boxnum, char *msg) -{ - fprintf(stdout, "Sending message to box %d\n", boxnum); - apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg)); - boxes[boxnum].msgavail = 1; -} - -int main(void) -{ -#if APR_HAS_SHARED_MEMORY - apr_shmem_t *shm; - pid_t pid; - int cntr; - apr_size_t size; - char *ptrs[CYCLES]; - apr_size_t psize[CYCLES]; - apr_status_t rv; - apr_size_t cksize; - apr_initialize(); - - - for (size = 0;size < CYCLES;size++){ - ptrs[size] = NULL; - psize[size] = sizeof(mbox) * (size + 1); - } - - printf("APR Shared Memory Test\n"); - printf("======================\n\n"); - printf("Initializing the context............................"); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - printf("could not initialize\n"); - exit(-1); - } - printf("OK\n"); - - printf("Creating shared memory block (%" APR_SIZE_T_FMT " bytes)........", - TESTSIZE); - if (apr_shm_init(&shm, TESTSIZE, NULL, context) != APR_SUCCESS) { - fprintf(stderr, "Error allocating shared memory block\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - - printf("Allocating shared mbox memory......................."); - size = sizeof(mbox) * 2; - boxes = apr_shm_calloc(shm, size); - if (boxes == NULL) { - fprintf(stderr, "Error creating message boxes.\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - - printf("\nAbout to stress the alloc/free cycle.\n"); - printf("Smallest allocation will be %" APR_SIZE_T_FMT " bytes\n", - psize[0]); - printf("Largest allocation will be %" APR_SIZE_T_FMT " bytes\n", - psize[CYCLES - 1]); - printf("I will be doing it in %d steps\n", CYCLES); - - printf("\tAllocating via apr_shm_malloc..............."); - for (cntr = 0;cntr < CYCLES;cntr++){ - ptrs[cntr] = apr_shm_malloc(shm, psize[cntr]); - if (ptrs[cntr] == NULL){ - printf("Failed at step %d, %" APR_SIZE_T_FMT " bytes\n", - cntr, psize[cntr]); - exit (-1); - } - } - printf("OK\n\tFreeing....................................."); - for (cntr = 0;cntr < CYCLES;cntr++){ - if (apr_shm_free(shm, ptrs[cntr]) != APR_SUCCESS){ - printf("Failed at step %d, %" APR_SIZE_T_FMT " bytes\n", - cntr, psize[cntr]); - exit (-1); - } - } - printf("OK\n"); - - printf("\tDetermining how much space is remaining....."); - rv = apr_shm_avail(shm, &cksize); - if (rv == APR_ENOTIMPL){ - printf("Not Impl."); - } else { - if (rv != APR_SUCCESS){ - printf("Failed!\n"); - exit (-1); - } - printf("%" APR_SIZE_T_FMT, cksize); - } - printf("\n\t%d cycles of malloc and calloc passed.", CYCLES); - - printf("\n\nClearing shmem segment.............................."); - rv = apr_shm_destroy(shm); - if (rv != APR_SUCCESS) - { - printf("Failed\n"); - exit(-1); - } - printf("OK\n"); - - printf("Recreating shared memory block (%" APR_SIZE_T_FMT " bytes)......", - TESTSIZE); - if (apr_shm_init(&shm, TESTSIZE, NULL, context) != APR_SUCCESS) { - fprintf(stderr, "Error allocating shared memory block\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - - printf("Block test.\n"); - printf("\tI am about to allocate %" APR_SIZE_T_FMT - " bytes..........", TEST2SIZE); - if ((ptrs[0] = apr_shm_malloc(shm, TEST2SIZE)) == NULL){ - printf("Failed.\n"); - exit (-1); - } - printf ("OK\n"); - printf("\tFreeing the block of %" APR_SIZE_T_FMT - " bytes............", TEST2SIZE); - if ((rv = apr_shm_free(shm, ptrs[0])) != APR_SUCCESS){ - printf("Failed!\n"); - exit(-1); - } - printf ("OK\n"); - - printf("Clearing shmem segment.............................."); - rv = apr_shm_destroy(shm); - if (rv != APR_SUCCESS) - { - printf("Failed\n"); - exit(-1); - } - printf("OK\n"); - - printf("Recreating shared memory block (%" APR_SIZE_T_FMT " bytes)......", - TESTSIZE); - if (apr_shm_init(&shm, TESTSIZE, NULL, context) != APR_SUCCESS) { - fprintf(stderr, "Error allocating shared memory block\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - - printf("Shared Process Test (child/parent)\n"); - pid = fork(); - if (pid == 0) { - apr_sleep(1); - if (apr_shm_open(shm) == APR_SUCCESS) { - msgwait(1); - msgput(0, "Msg received\n"); - } else { - puts( "Child: unable to get access to shared memory" ); - } - exit(1); - } - else if (pid > 0) { - msgput(1, "Sending a message\n"); - apr_sleep(1); - msgwait(0); - exit(1); - } - else { - printf("Error creating a child process\n"); - exit(1); - } -#else - printf("APR SHMEM test not run!\n"); - printf("shmem is not supported on this platform\n"); - return (-1); -#endif -} From fccbff185ad622aa8c48107c08382122fcc67930 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 10 Jan 2002 18:52:49 +0000 Subject: [PATCH 2738/7878] Clear the pool struct when APR_POOL_DEBUG is defined. Also, protect the pool->mutex field with #if APR_HAS_THREADS. Submitted by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62742 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index d075f92a809..836e85618d6 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -983,13 +983,9 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, return APR_ENOMEM; } + memset(pool, 0, SIZEOF_POOL_T); + pool->abort_fn = abort_fn; - pool->child = NULL; - pool->cleanups = NULL; - pool->subprocesses = NULL; - pool->user_data = NULL; - pool->tag = NULL; - pool->nodes = NULL; if ((flags & APR_POOL_FNEW_ALLOCATOR) == APR_POOL_FNEW_ALLOCATOR) { #if APR_HAS_THREADS @@ -1005,8 +1001,10 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, #endif } else { +#if APR_HAS_THREADS if (parent) pool->mutex = parent->mutex; +#endif } if ((pool->parent = parent) != NULL) { From c5ac8826b264e2b0ec475486c9df201ae160b897 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 10 Jan 2002 22:28:34 +0000 Subject: [PATCH 2739/7878] Reflect the current state of the pools code better in STATUS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62743 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/STATUS b/STATUS index fd662747746..d8807fe290e 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/01/10 01:19:24 $] +Last modified at [$Date: 2002/01/10 22:28:34 $] Release: @@ -54,15 +54,15 @@ RELEASE SHOWSTOPPERS: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: - * Enable pools to have thread-specific locking in it. - Status: Sander's pool code has been tested with httpd, flood, - and SVN. It's in. The debug code needs to be added. - - Comparisons/reviews: - Ian: <3C083414.1080208@cnet.com> (performance) - Brian: <3C07D792.9070301@cnet.com> (code) - <3C0D6BB5.6010505@cnet.com> (performance) - Justin: <20011205025611.GB22835@ebuilt.com> (code) + * Add pool lifetime tracking/checking to the pools debug code. + It would be nice to generate some output on at what line(s) a + pool was created, cleared and/or destroyed. Maybe introduce + an APR_POOL_LIFETIME_VERBOSE define for this? + We should check if a pool is still existent when passed into + any apr_pool_xxx function. We could do this by recursively + checking if the pool is in a child list, starting at + global_pool. If it is not, bail out and report sourcefile + linenumber (or cause a segv). * Get OTHER_CHILD support into Win32 Status: Bill S. is looking into this From b7d25542301c845bb40b003f621beec1d6bcfb79 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 10 Jan 2002 23:46:43 +0000 Subject: [PATCH 2740/7878] Fix GMT offset calculations for platforms that do not have native GMT offsets. Submitted by: Jon Travis Reviewed by: Justin, Brian, David git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62744 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ time/unix/time.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 0a75a40344f..0213f3ce8c4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix GMT offset adjustments for platforms that do not have native + GMT offset adjustments. [Jon Travis ] + *) Add new apr_shm_t API and remove old apr_shmem_t API. The new API handles both anonymous and name-based shared memory. Anonymous shared memory segments are only usable on systems with process diff --git a/time/unix/time.c b/time/unix/time.c index 8eb9aba6717..92a3eece0da 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -92,6 +92,9 @@ static apr_int32_t get_offset(struct tm *tm) if (daylightOnOff) { return server_gmt_offset + daylightOffset; } +#else + if(tm->tm_isdst) + return server_gmt_offset + 3600; #endif return server_gmt_offset; #endif @@ -341,7 +344,6 @@ APR_DECLARE(void) apr_unix_setup_time(void) struct timeval now; time_t t1, t2; struct tm t; - int was_dst; gettimeofday(&now, NULL); t1 = now.tv_sec; @@ -352,10 +354,9 @@ APR_DECLARE(void) apr_unix_setup_time(void) #else t = *gmtime(&t1); #endif - was_dst = (t.tm_isdst > 0); t.tm_isdst = -1; t2 = mktime(&t); - server_gmt_offset = (apr_int32_t) difftime(t1, t2) + (was_dst ? 3600 : 0); + server_gmt_offset = (apr_int32_t) difftime(t1, t2); #endif } From 3131244461232d23114aa5935ed02811d08c8172 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 11 Jan 2002 03:17:58 +0000 Subject: [PATCH 2741/7878] HP compiler doesn't like using < operator with pointer and scalar git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62745 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 149488d97cf..1ae3cfc3d83 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -176,7 +176,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return errno; } - if ((new_m->base = shmat(shmid, NULL, 0)) < 0) { + if ((new_m->base = shmat(shmid, NULL, 0)) == (void *)-1) { return errno; } From e84e4a20382e4ef1caf6c29db34609bda6872621 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 11 Jan 2002 07:54:03 +0000 Subject: [PATCH 2742/7878] Improve performance about 10% by optimizing the code path Submitted by: Brian Pane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62746 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_mutex.c | 62 ++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 24 deletions(-) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 41d512ed172..8462bc46cd1 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -128,26 +128,35 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) apr_status_t rv; #if APR_HAS_THREADS - if (mutex->nested && apr_os_thread_equal(mutex->owner, - apr_os_thread_current())) { - mutex->owner_ref++; - return APR_SUCCESS; - } -#endif + if (mutex->nested) { + if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { + mutex->owner_ref++; + return APR_SUCCESS; + } - rv = pthread_mutex_lock(&mutex->mutex); - if (rv) { + rv = pthread_mutex_lock(&mutex->mutex); + if (rv) { #ifdef PTHREAD_SETS_ERRNO - rv = errno; + rv = errno; #endif - return rv; - } + return rv; + } -#if APR_HAS_THREADS - if (mutex->nested) { mutex->owner = apr_os_thread_current(); mutex->owner_ref = 1; } + else { +#endif + rv = pthread_mutex_lock(&mutex->mutex); + if (rv) { +#ifdef PTHREAD_SETS_ERRNO + rv = errno; +#endif + return rv; + } + +#if APR_HAS_THREADS + } #endif return rv; @@ -194,24 +203,29 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) if (mutex->owner_ref > 0) return APR_SUCCESS; } - } -#endif - - status = pthread_mutex_unlock(&mutex->mutex); - if (status) { + status = pthread_mutex_unlock(&mutex->mutex); + if (status) { #ifdef PTHREAD_SETS_ERRNO - status = errno; + status = errno; #endif - return status; - } + return status; + } -#if APR_HAS_THREADS - if (mutex->nested) { memset(&mutex->owner, 0, sizeof mutex->owner); mutex->owner_ref = 0; } + else { +#endif + status = pthread_mutex_unlock(&mutex->mutex); + if (status) { +#ifdef PTHREAD_SETS_ERRNO + status = errno; +#endif + return status; + } +#if APR_HAS_THREADS + } #endif - return status; } From 109b5a32b4190555285e3c08247882f1bb10b430 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 11 Jan 2002 08:30:55 +0000 Subject: [PATCH 2743/7878] Simple solutions? No, but document some observations. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62747 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index c13de77a7df..2fe26a0d9e8 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -83,6 +83,9 @@ static apr_status_t shm_cleanup(void* shm) if (CloseHandle(m->hMap)) { return (rv != APR_SUCCESS) ? rv : apr_get_os_error(); } + /* ### Do we want to make a point of unlinking m->file here? + * Need to add the fname to the apr_shm_t, in that case. + */ return rv; } @@ -140,6 +143,20 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, psec = NULL; } + /* XXX: I had nothing but utter failure on WinNT attempting to specify + * the size of the CreateFileMapping() calls below (given in DWORDs + * as hi-DWORD, lo-DWORD where you see the 0, 0 args.) Consistently, + * Win2K reported insufficient disk space, when that is obviously not + * the case. I'm suspecting size should have been in pages (???) but + * there was no docs in the PSDK that made that implication. + * + * The XXX above is due to the fact that anon allocation dies right now, + * since we can't create a filemapping with size zero, when we don't + * back it with a file. Since I clearly don't understand what Win32 + * has done with this size arg, I'm loath to make the obvious fix. + * Let it fail until I, or someone with time on their hands, wants to + * research, experiment and fix this for good. + */ #if APR_HAS_UNICODE_FS if (apr_os_level >= APR_WIN_NT) { @@ -151,7 +168,11 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, hMap = CreateFileMappingA(hFile, psec, PAGE_READWRITE, 0, 0, mapkey); } err = apr_get_os_error(); - apr_file_close(f); + + if (file) { + apr_file_close(f); + } + if (hMap && err == ERROR_ALREADY_EXISTS) { CloseHandle(hMap); return APR_EEXIST; @@ -163,7 +184,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, base = MapViewOfFile(hMap, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, size); if (!base) { - apr_file_close(f); CloseHandle(hMap); return apr_get_os_error(); } From 6e405c1682bd0bb9fe9822dc01c52f4e6ba86ddc Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 11 Jan 2002 09:04:51 +0000 Subject: [PATCH 2744/7878] Add apr_file_dup2. This has implications in that we now only do dup2 when we call apr_file_dup2 and this will potentially cause problems for code using apr_file_dup. The changes attempt to follow posix more closely. Will Rowe is going to tackle Win32 and OS/2 today. Changes to apache on the way. Issues: what should we do for dup2 when we have differing pools being used? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62748 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 82 ++++++++++++++++++++++++++++-------------- include/apr_file_io.h | 12 +++++++ 2 files changed, 68 insertions(+), 26 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 04105a54a22..8219d0247c7 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -58,54 +58,84 @@ #include "apr_thread_mutex.h" #include "inherit.h" -apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) +static apr_status_t _file_dup(apr_file_t **new_file, + apr_file_t *old_file, apr_pool_t *p, + int which_dup) { - int have_file = 0; - if ((*new_file) == NULL) { - (*new_file) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); - if ((*new_file) == NULL) { - return APR_ENOMEM; + if (which_dup == 1) { + (*new_file) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); + if ((*new_file) == NULL) { + return APR_ENOMEM; + } + (*new_file)->cntxt = p; + } else { + /* We can't dup2 unless we have a valid new_file */ + return APR_EINVAL; } - } else { - have_file = 1; } - - (*new_file)->cntxt = p; - if (have_file) { + + if (which_dup == 2) { dup2(old_file->filedes, (*new_file)->filedes); - } - else { + } else { (*new_file)->filedes = dup(old_file->filedes); } + (*new_file)->fname = apr_pstrdup(p, old_file->fname); (*new_file)->buffered = old_file->buffered; - if ((*new_file)->buffered) { + + /* If the existing socket in a dup2 is already buffered, we + * have an existing and valid (hopefully) mutex, so we don't + * want to create it again as we could leak! + */ #if APR_HAS_THREADS + if ((*new_file)->buffered && !(*new_file)->thlock) { apr_thread_mutex_create(&((*new_file)->thlock), APR_THREAD_MUTEX_DEFAULT, p); + } #endif + /* As above, only create the buffer if we haven't already + * got one. + */ + if ((*new_file)->buffered && !(*new_file)->buffer) { (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); } + /* this is the way dup() works */ (*new_file)->blocking = old_file->blocking; + /* make sure unget behavior is consistent */ (*new_file)->ungetchar = old_file->ungetchar; + /* apr_file_dup() clears the inherit attribute, user must call * apr_file_set_inherit() again on the dupped handle, as necessary. - * If the user has dup2'ed fd 0-2 (stdin, stdout or stderr) we will - * never, never, never close the handle, under any circumstance. */ - if (have_file && ((*new_file)->filedes >= 0) && ((*new_file)->filedes <= 2)) { - (*new_file)->flags = old_file->flags | APR_INHERIT; - apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), - apr_pool_cleanup_null, apr_pool_cleanup_null); - } - else { - (*new_file)->flags = old_file->flags & ~APR_INHERIT; - apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), - apr_unix_file_cleanup, apr_unix_file_cleanup); - } + (*new_file)->flags = old_file->flags & ~APR_INHERIT; + return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, + apr_file_t *old_file, apr_pool_t *p) +{ + apr_status_t rv; + + rv = _file_dup(new_file, old_file, p, 1); + if (rv != APR_SUCCESS) + return rv; + + /* we do this here as we don't want to double register an existing + * apr_file_t for cleanup + */ + apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), + apr_unix_file_cleanup, apr_unix_file_cleanup); + return rv; + +} + +APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t **new_file, + apr_file_t *old_file, apr_pool_t *p) +{ + return _file_dup(new_file, old_file, p, 2); +} + diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 19e481ecfc5..bd042443a7c 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -390,6 +390,18 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p); +/** + * duplicate the specified file descriptor and close the original + * @param new_file The structure to duplicate into + * @param old_file The file to duplicate + * @param p The pool to use for the new file + * + * @remark *arg1 MUST point at a valid apr_file_t. It cannot point at NULL + */ +APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t **new_file, + apr_file_t *old_file, + apr_pool_t *p); + /** * Move the read/write file offset to a specified byte within a file. * @param thefile The file descriptor From 2578718edc89dfe9720c6893e2e4e5f30f567780 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 11 Jan 2002 09:51:23 +0000 Subject: [PATCH 2745/7878] Implement apr_file_dup2() for win32. Don't understand precisely why we didn't change new_file to a simple apr_file_t* (???) Change a number of errors in the existing code, and make no guarentee that the new os_handle (if not a std handle) will ever be the same if its dup2'ed. However, for posix similarity, succeed and close the original file, if the handle was open. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62749 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 110 ++++++++++++++++++++++++---------------- 1 file changed, 65 insertions(+), 45 deletions(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 7ddbb3ad92e..7f9c6edb61c 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -62,62 +62,82 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { - BOOLEAN isStdHandle = FALSE; - HANDLE hCurrentProcess = GetCurrentProcess(); + HANDLE hproc = GetCurrentProcess(); + HANDLE newhand = NULL; + + if (!DuplicateHandle(hproc, old_file->filehand, + hproc, newhand, 0, FALSE, + DUPLICATE_SAME_ACCESS)) { + return apr_get_os_error(); + } - if ((*new_file) == NULL) { - if (p == NULL) { - p = old_file->cntxt; - } - - (*new_file) = (apr_file_t *) apr_pcalloc(p, sizeof(apr_file_t)); - if ((*new_file) == NULL) { - return APR_ENOMEM; - } - if (!DuplicateHandle(hCurrentProcess, old_file->filehand, - hCurrentProcess, - &(*new_file)->filehand, 0, FALSE, - DUPLICATE_SAME_ACCESS)) { + (*new_file) = (apr_file_t *) apr_pcalloc(p, sizeof(apr_file_t)); + (*new_file)->filehand = newhand; + (*new_file)->flags = old_file->flags & ~APR_INHERIT; + (*new_file)->cntxt = p; + (*new_file)->fname = apr_pstrdup(p, old_file->fname); + (*new_file)->append = old_file->append; + (*new_file)->buffered = FALSE; + + apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), file_cleanup, + apr_pool_cleanup_null); + + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t **new_file, + apr_file_t *old_file, apr_pool_t *p) +{ + DWORD stdhandle = -1; + HANDLE hproc = GetCurrentProcess(); + HANDLE newhand = NULL; + apr_int32_t newflags; + + /* dup2 is not supported literaly with native Windows handles. + * We can, however, emulate dup2 for the standard i/o handles, + * and close and replace other handles with duped handles. + * The os_handle will change, however. + */ + if (old_file->filehand == GetStdHandle(STD_ERROR_HANDLE)) { + stdhandle = STD_ERROR_HANDLE; + } + else if (old_file->filehand == GetStdHandle(STD_OUTPUT_HANDLE)) { + stdhandle = STD_OUTPUT_HANDLE; + } + else if (old_file->filehand == GetStdHandle(STD_INPUT_HANDLE)) { + stdhandle = STD_INPUT_HANDLE; + } + + if (stdhandle != -1) { + if (!DuplicateHandle(hproc, old_file->filehand, + hproc, newhand, 0, + TRUE, DUPLICATE_SAME_ACCESS)) { return apr_get_os_error(); } - } else { - HANDLE hFile = (*new_file)->filehand; - /* XXX: need to dup the handle!!! - */ - /* dup2 is not supported with native Windows handles. We - * can, however, emulate dup2 for the standard i/o handles. - */ - if (hFile == GetStdHandle(STD_ERROR_HANDLE)) { - isStdHandle = TRUE; - if (!SetStdHandle(STD_ERROR_HANDLE, old_file->filehand)) - return apr_get_os_error(); + if (!SetStdHandle(stdhandle, newhand)) { + return apr_get_os_error(); } - else if (hFile == GetStdHandle(STD_OUTPUT_HANDLE)) { - isStdHandle = TRUE; - if (!SetStdHandle(STD_OUTPUT_HANDLE, old_file->filehand)) - return apr_get_os_error(); + newflags = old_file->flags | APR_INHERIT; + } + else { + if (!DuplicateHandle(hproc, old_file->filehand, + hproc, newhand, 0, + FALSE, DUPLICATE_SAME_ACCESS)) { + return apr_get_os_error(); } - else if (hFile == GetStdHandle(STD_INPUT_HANDLE)) { - isStdHandle = TRUE; - if (!SetStdHandle(STD_INPUT_HANDLE, old_file->filehand)) - return apr_get_os_error(); + if ((*new_file)->filehand) { + CloseHandle((*new_file)->filehand); } - else - return APR_ENOTIMPL; + newflags = old_file->flags & ~APR_INHERIT; } - (*new_file)->flags = old_file->flags & ~APR_INHERIT; - (*new_file)->cntxt = old_file->cntxt; - (*new_file)->fname = apr_pstrdup(old_file->cntxt, old_file->fname); + (*new_file)->flags = newflags; + (*new_file)->filehand = newhand; + (*new_file)->fname = apr_pstrdup((*new_file)->cntxt, old_file->fname); (*new_file)->append = old_file->append; (*new_file)->buffered = FALSE; - if (!isStdHandle) { - apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), file_cleanup, - apr_pool_cleanup_null); - } - return APR_SUCCESS; } - From 1a9769aee6d6cefa3aef280b55247eb19f812266 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 11 Jan 2002 09:53:21 +0000 Subject: [PATCH 2746/7878] Compiler doesn't distinguish between void** and void*, apparently. It didn't notice this, I did. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62750 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 7f9c6edb61c..be2966e9ee6 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -66,7 +66,7 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, HANDLE newhand = NULL; if (!DuplicateHandle(hproc, old_file->filehand, - hproc, newhand, 0, FALSE, + hproc, &newhand, 0, FALSE, DUPLICATE_SAME_ACCESS)) { return apr_get_os_error(); } @@ -111,7 +111,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t **new_file, if (stdhandle != -1) { if (!DuplicateHandle(hproc, old_file->filehand, - hproc, newhand, 0, + hproc, &newhand, 0, TRUE, DUPLICATE_SAME_ACCESS)) { return apr_get_os_error(); } @@ -122,7 +122,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t **new_file, } else { if (!DuplicateHandle(hproc, old_file->filehand, - hproc, newhand, 0, + hproc, &newhand, 0, FALSE, DUPLICATE_SAME_ACCESS)) { return apr_get_os_error(); } From 78916d14dcda91b21a531119e0257a983583b47b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 11 Jan 2002 10:19:03 +0000 Subject: [PATCH 2747/7878] Allow apr_file_dup() to behave as before, for a while longer git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62751 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index be2966e9ee6..22a728d8fc4 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -64,6 +64,14 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, { HANDLE hproc = GetCurrentProcess(); HANDLE newhand = NULL; + + /* XXX Dirty, ugly backward compatibility hack + * This is the reason that dup2 was introduced, + * need to remove this thunk on short order! + */ + if (*new_file) { + return apr_file_dup2(new_file, old_file, p); + } if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand, 0, FALSE, From 70015bb770f5d5834aaf1bf1df093227191a9f57 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 11 Jan 2002 11:20:00 +0000 Subject: [PATCH 2748/7878] Test for file duplication. Not perfect but at least this gets us started. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62752 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 6 ++- test/testdup.c | 127 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 test/testdup.c diff --git a/test/Makefile.in b/test/Makefile.in index 9f4d9fa686a..ab891a87514 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -37,7 +37,8 @@ PROGRAMS = \ testprocmutex@EXEEXT@ \ testvsn@EXEEXT@ \ testsleep@EXEEXT@ \ - testrand@EXEEXT@ + testrand@EXEEXT@ \ + testdup@EXEEXT@ TARGETS = $(PROGRAMS) @@ -170,6 +171,9 @@ testvsn@EXEEXT@: testvsn.lo $(LOCAL_LIBS) testsleep@EXEEXT@: testsleep.lo $(LOCAL_LIBS) $(LINK) testsleep.lo $(LOCAL_LIBS) $(ALL_LIBS) +testdup@EXEEXT@: testdup.lo $(LOCAL_LIBS) + $(LINK) testdup.lo $(LOCAL_LIBS) $(ALL_LIBS) + testrand@EXEEXT@: testrand.lo $(LOCAL_LIBS) $(LINK) testrand.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/testdup.c b/test/testdup.c new file mode 100644 index 00000000000..5858f92dba0 --- /dev/null +++ b/test/testdup.c @@ -0,0 +1,127 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_errno.h" +#include "apr_file_io.h" +#include +#include +#include +#if APR_HAVE_UNISTD_H +#include +#endif +#include "test_apr.h" + +#define TEST "Testing\n" +#define TEST2 "Testing again\n" + +int main (int argc, char ** argv) +{ + apr_file_t *file1 = NULL; + apr_file_t *file2 = NULL; + apr_file_t *file3 = NULL; + + apr_status_t status; + apr_pool_t *p; + int *retval; + char filename[256]; + apr_size_t txtlen = sizeof(TEST); + char buff[50]; + apr_off_t fpos; + + apr_initialize(); + atexit(apr_terminate); + + fprintf(stdout, "APR File Duplication Test\n=========================\n\n"); + STD_TEST_NEQ("Creating a pool", apr_pool_create(&p, NULL)) + + /* First, create a new file, empty... */ + STD_TEST_NEQ("Open a new, empty file", apr_file_open(&file1, "./testdup.file", + APR_READ | APR_WRITE | APR_CREATE, + APR_OS_DEFAULT, p)) + + STD_TEST_NEQ("Simple dup", apr_file_dup(&file3, file1, p)) + + STD_TEST_NEQ("Write to dup'd file", apr_file_write(file3, TEST, &txtlen)) + + STD_TEST_NEQ("Rewind original file pos", apr_file_seek(file1, APR_SET, &fpos)) + + txtlen = sizeof(buff); + STD_TEST_NEQ("Read from original file handle", + apr_file_read(file1, buff, &txtlen)) + + printf("%s\n", buff); + + STD_TEST_NEQ("Open another new, empty file", + apr_file_open(&file2, "./testdup2.file", + APR_READ | APR_WRITE | APR_CREATE, + APR_OS_DEFAULT, p)) + + STD_TEST_NEQ("Dup2 test", apr_file_dup2(&file3, file2, p)) + + txtlen = sizeof(TEST2); + STD_TEST_NEQ("Write to dup'd file", apr_file_write(file3, TEST2, &txtlen)) + + STD_TEST_NEQ("Rewind original file pos", apr_file_seek(file1, APR_SET, &fpos)) + + STD_TEST_NEQ("Read from original file handle", + apr_file_read(file1, buff, &txtlen)) + + printf("%s\n", buff); + + return (0); +} + From 6f7e1451cb42e1fa575eb7df2c17601bc69a3610 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 11 Jan 2002 12:16:40 +0000 Subject: [PATCH 2749/7878] First step to getting shmem building on beos. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62753 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/beos/Makefile.in | 2 +- shmem/beos/shm.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/shmem/beos/Makefile.in b/shmem/beos/Makefile.in index 2c8d436407a..97214ff5a8d 100644 --- a/shmem/beos/Makefile.in +++ b/shmem/beos/Makefile.in @@ -1,5 +1,5 @@ -TARGETS = shmem.lo +TARGETS = shm.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index a73d3620626..2e4928e1525 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -53,7 +53,7 @@ */ #include "apr_general.h" -#include "apr_shmem.h" +#include "apr_shm.h" #include "apr_errno.h" #include "apr_lib.h" #include "apr_strings.h" @@ -69,14 +69,14 @@ struct apr_shm_t { area_id aid; }; -APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, +APR_DECLARE(apr_status_t) apr_shm_init(apr_shm_t **m, apr_size_t reqsize, const char *file, apr_pool_t *p) { apr_size_t pagesize; area_id newid; char *addr; - (*m) = (apr_shmem_t *)apr_pcalloc(p, sizeof(apr_shmem_t)); + (*m) = (apr_shm_t *)apr_pcalloc(p, sizeof(apr_shm_t)); /* we MUST allocate in pages, so calculate how big an area we need... */ pagesize = ((reqsize + B_PAGE_SIZE - 1) / B_PAGE_SIZE) * B_PAGE_SIZE; @@ -95,7 +95,7 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, cons return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m) +APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) { delete_area(m->aid); m->avail = 0; @@ -104,14 +104,14 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m) } -APR_DECLARE(apr_status_t) apr_shm_attach(apr_shmem_t **m, +APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, const char *filename, apr_pool_t *pool) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_shm_detach(apr_shmem_t *m) +APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) { return APR_ENOTIMPL; } From 0729c3cbe95765a2e979fe60fd67ce2c03c7552f Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 11 Jan 2002 12:40:20 +0000 Subject: [PATCH 2750/7878] Few changes that actually get us building well enough for apache. More to follow. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62754 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/beos/shm.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index 2e4928e1525..16f292d6100 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -65,12 +65,15 @@ struct apr_shm_t { apr_pool_t *p; void *memblock; void *ptr; + apr_size_t reqsize; apr_size_t avail; area_id aid; }; -APR_DECLARE(apr_status_t) apr_shm_init(apr_shm_t **m, apr_size_t reqsize, const char *file, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, + apr_size_t reqsize, + const char *file, + apr_pool_t *p) { apr_size_t pagesize; area_id newid; @@ -91,6 +94,7 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shm_t **m, apr_size_t reqsize, const (*m)->memblock = addr; (*m)->ptr = (void*)addr; (*m)->avail = pagesize; /* record how big an area we actually created... */ + (*m)->reqsize = reqsize; return APR_SUCCESS; } @@ -118,11 +122,11 @@ APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) { - return APR_ENOTIMPL; + return m->memblock; } APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) { - return APR_ENOTIMPL; + return m->reqsize; } From a0a491660621f3265ac6035f25d713427f4e28e3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 11 Jan 2002 12:41:35 +0000 Subject: [PATCH 2751/7878] BeOS really only has one way of creating shared memory, so we'll be using it for both anonymous and named. Without this we fail to complete configure and so can't build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62755 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.in b/configure.in index 6b8039172a2..892df04de9b 100644 --- a/configure.in +++ b/configure.in @@ -444,6 +444,10 @@ APR_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON, [havemmapanon="1" APR_DECIDE(USE_SHMEM_MMAP_ANON, [4.4BSD-style mmap() via MAP_ANON])]) +APR_IFALLYES(header:kernel/OS.h func:create_area, + [havebeosshm="1" + APR_DECIDE(USE_SHMEM_BEOS_ANON, + [BeOS areas])]) case $host in *linux* ) dnl Linux has problems with MM_SHMT_MMANON even though it reports From bf291afd663b10af6768650d278914a04cb97787 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Fri, 11 Jan 2002 15:04:34 +0000 Subject: [PATCH 2752/7878] Add Brian Pane's 10% performance improvement logic to trylock() also. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62756 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_mutex.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 8462bc46cd1..7db03a2a9a3 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -167,26 +167,34 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) apr_status_t rv; #if APR_HAS_THREADS - if (mutex->nested && apr_os_thread_equal(mutex->owner, - apr_os_thread_current())) { - mutex->owner_ref++; - return APR_SUCCESS; - } -#endif + if (mutex->nested) { + if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { + mutex->owner_ref++; + return APR_SUCCESS; + } - rv = pthread_mutex_trylock(&mutex->mutex); - if (rv) { + rv = pthread_mutex_trylock(&mutex->mutex); + if (rv) { #ifdef PTHREAD_SETS_ERRNO - rv = errno; + rv = errno; #endif - return (rv == EBUSY) ? APR_EBUSY : rv; - } + return (rv == EBUSY) ? APR_EBUSY : rv; + } -#if APR_HAS_THREADS - if (mutex->nested) { mutex->owner = apr_os_thread_current(); mutex->owner_ref = 1; } + else { +#endif + rv = pthread_mutex_trylock(&mutex->mutex); + if (rv) { +#ifdef PTHREAD_SETS_ERRNO + rv = errno; +#endif + return (rv == EBUSY) ? APR_EBUSY : rv; + } +#if APR_HAS_THREADS + } #endif return rv; From f64f5085ebc3c934eb6603ddaea115c345bab80a Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 11 Jan 2002 21:01:20 +0000 Subject: [PATCH 2753/7878] add a new define APR_POOL_DEBUG_VERBOSE which will print out where pools are created and their children in the destroy function PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62757 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ STATUS | 8 ++---- include/apr_pools.h | 40 +++++++++++++++++++++++++--- memory/unix/apr_pools.c | 58 ++++++++++++++++++++++++++++++++++++----- 4 files changed, 93 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index 0213f3ce8c4..6d7ce67c291 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ Changes with APR b1 + *) Add new define APR_POOL_DEBUG_VERBOSE which spits out info + about pool creation/destruction [Ian Holsman] *) Fix GMT offset adjustments for platforms that do not have native GMT offset adjustments. [Jon Travis ] diff --git a/STATUS b/STATUS index d8807fe290e..4f5e0549794 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/01/10 22:28:34 $] +Last modified at [$Date: 2002/01/11 21:01:20 $] Release: @@ -54,11 +54,7 @@ RELEASE SHOWSTOPPERS: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: - * Add pool lifetime tracking/checking to the pools debug code. - It would be nice to generate some output on at what line(s) a - pool was created, cleared and/or destroyed. Maybe introduce - an APR_POOL_LIFETIME_VERBOSE define for this? - We should check if a pool is still existent when passed into + * We should check if a pool is still existent when passed into any apr_pool_xxx function. We could do this by recursively checking if the pool is in a child list, starting at global_pool. If it is not, bail out and report sourcefile diff --git a/include/apr_pools.h b/include/apr_pools.h index c9528267f48..5e8e8b22f7c 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -158,11 +158,23 @@ APR_DECLARE(void) apr_pool_terminate(void); * (this flag only makes sense in combination with POOL_FNEW_ALLOCATOR) * */ +#if defined(APR_POOL_DEBUG) +#define apr_pool_create_ex( newpool, parent, abort_fn, flag) \ + apr_pool_create_ex_dbg( newpool, parent, abort_fn, flag,__FILE__,__LINE__) + +APR_DECLARE(apr_status_t) apr_pool_create_ex_dbg(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_uint32_t flags, + const char *file, + int line); +# +#else APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, apr_uint32_t flags); - +#endif /** * Create a new pool. * @param newpool The pool we have just created. @@ -175,9 +187,14 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, apr_pool_t *parent); #else +#if defined(APR_POOL_DEBUG) +#define apr_pool_create(newpool, parent) \ + apr_pool_create_ex_dbg(newpool, parent, NULL, APR_POOL_FDEFAULT,__FILE__,__LINE__) +#else #define apr_pool_create(newpool, parent) \ apr_pool_create_ex(newpool, parent, NULL, APR_POOL_FDEFAULT) #endif +#endif /** * This function is deprecated. Use apr_pool_create_ex. @@ -193,9 +210,14 @@ APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **newpool, apr_pool_t *parent, int (*apr_abort)(int retcode)); #else +#if defined(APR_POOL_DEBUG) +#define apr_pool_sub_make(newpool, parent, abort_fn) \ + (void)apr_pool_create_ex_dbg(newpool, parent, abort_fn, APR_POOL_FDEFAULT,__FILE__,__LINE__); +#else #define apr_pool_sub_make(newpool, parent, abort_fn) \ (void)apr_pool_create_ex(newpool, parent, abort_fn, APR_POOL_FDEFAULT); #endif +#endif /** * Destroy the pool. This takes similar action as apr_pool_clear() and then @@ -203,8 +225,14 @@ APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **newpool, * @param p The pool to destroy * @remark This will actually free the memory */ -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); +#if defined(APR_POOL_DEBUG) +#define apr_pool_destroy(p) \ + apr_pool_destroy_dbg(p, __FILE__,__LINE__) +APR_DECLARE(void) apr_pool_destroy_dbg(apr_pool_t *p, const char *file, int line); +#else +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); +#endif /* * Memory allocation @@ -234,8 +262,14 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); * to re-use this memory for the next allocation. * @see apr_pool_destroy() */ -APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); +#if defined(APR_POOL_DEBUG) +#define apr_pool_clear(p) \ + apr_pool_clear_dbg(p, __FILE__,__LINE__) +APR_DECLARE(void) apr_pool_clear_dbg(apr_pool_t *p, const char*file, int line); +#else +APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); +#endif /* * Pool Properties diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 836e85618d6..7e19625c86c 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -91,6 +91,14 @@ #define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) +/* + * This option prints out the pool creation info + * (and info about its children) + * when the pool is destroyed. + */ +/* +#define APR_POOL_DEBUG_VERBOSE +*/ /* * Structures @@ -161,6 +169,8 @@ struct apr_pool_t { #else /* !defined(APR_POOL_DEBUG) */ debug_node_t *nodes; + const char *file; + int line; #if APR_HAS_THREADS apr_thread_mutex_t *mutex; #endif @@ -887,6 +897,9 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) return mem; } +/* + * (debug) + */ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) { void *mem; @@ -900,9 +913,10 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) /* * Pool creation/destruction (debug) + * TODO: printout a line if _VERBOSE is on */ -APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) +APR_DECLARE(void) apr_pool_clear_dbg(apr_pool_t *pool,const char*file, int line) { debug_node_t *node; apr_uint32_t index; @@ -911,7 +925,7 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) * this pool thus this loop is safe and easy. */ while (pool->child) - apr_pool_destroy(pool->child); + apr_pool_destroy_dbg(pool->child,file,line); /* Run cleanups */ run_cleanups(pool->cleanups); @@ -935,9 +949,32 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) } } -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) +/* + * destroy (debug) + */ +APR_DECLARE(void) apr_pool_destroy_dbg(apr_pool_t *pool,const char*file, int line) { - apr_pool_clear(pool); +#if defined APR_POOL_DEBUG_VERBOSE + apr_file_t *stderr_log = NULL; + apr_pool_t *child; + + apr_file_open_stderr(&stderr_log,pool); /* XXX not sure about this one */ + if (stderr_log) { + apr_file_printf(stderr_log, + "DEBUG: %s:%d destroy pool tagged %s created %s:%d\n", + file, line, pool->tag, pool->file, pool->line); + child= pool->child; + while (child) { + apr_file_printf(stderr_log, + "DEBUG:\tpool child tagged %s created %s:%d\n", + child->tag, child->file, child->line); + child = child->sibling; + } + apr_file_close(stderr_log); + } +#endif + + apr_pool_clear_dbg(pool,file,line); /* Remove the pool from the parents child list */ if (pool->parent) { @@ -961,10 +998,16 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) free(pool); } -APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, +/* + * create (debug) + * there is a macro which adds the file/line # + */ +APR_DECLARE(apr_status_t) apr_pool_create_ex_dbg(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, - apr_uint32_t flags) + apr_uint32_t flags, + const char *file, + int line) { apr_pool_t *pool; @@ -1028,6 +1071,9 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, pool->ref = NULL; } + pool->file = file; + pool->line = line; + *newpool = pool; return APR_SUCCESS; From cc315bfeb7963ce4db1fad179652b68169c0a968 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 12 Jan 2002 13:43:44 +0000 Subject: [PATCH 2754/7878] OS/2: Add shm pool accessor. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62758 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/os2/shm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c index c8d5a9e683a..8c3c5bc77af 100644 --- a/shmem/os2/shm.c +++ b/shmem/os2/shm.c @@ -143,3 +143,5 @@ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) DosQueryMem(m->memblock, &size, &flags); return size; } + +APR_POOL_IMPLEMENT_ACCESSOR(shm) From d45324912594904082106e3ce25da87060a0d214 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 12 Jan 2002 14:02:20 +0000 Subject: [PATCH 2755/7878] OS/2: Fix failure to reach a successful decision on anon shared memory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62759 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.in b/configure.in index 892df04de9b..2c2af03a5f3 100644 --- a/configure.in +++ b/configure.in @@ -444,6 +444,9 @@ APR_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON, [havemmapanon="1" APR_DECIDE(USE_SHMEM_MMAP_ANON, [4.4BSD-style mmap() via MAP_ANON])]) +APR_IFALLYES(header:os2.h, + [haveos2shm="1" + APR_DECIDE(USE_SHMEM_OS2_ANON, [OS/2 DosAllocSharedMem()])]) APR_IFALLYES(header:kernel/OS.h func:create_area, [havebeosshm="1" APR_DECIDE(USE_SHMEM_BEOS_ANON, From 7b90fdf74de0ab3651fcb9fbee63f276135a13df Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 12 Jan 2002 15:05:18 +0000 Subject: [PATCH 2756/7878] Next stage in getting testdup to work better and show better output :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62760 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdup.c | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/test/testdup.c b/test/testdup.c index 5858f92dba0..ca1e35963fe 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -74,10 +74,7 @@ int main (int argc, char ** argv) apr_file_t *file2 = NULL; apr_file_t *file3 = NULL; - apr_status_t status; apr_pool_t *p; - int *retval; - char filename[256]; apr_size_t txtlen = sizeof(TEST); char buff[50]; apr_off_t fpos; @@ -88,39 +85,53 @@ int main (int argc, char ** argv) fprintf(stdout, "APR File Duplication Test\n=========================\n\n"); STD_TEST_NEQ("Creating a pool", apr_pool_create(&p, NULL)) + printf("\nTesting apr_file_dup\n"); /* First, create a new file, empty... */ - STD_TEST_NEQ("Open a new, empty file", apr_file_open(&file1, "./testdup.file", + STD_TEST_NEQ(" Open a new, empty file (#1)", apr_file_open(&file1, "./testdup.file", APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, p)) - STD_TEST_NEQ("Simple dup", apr_file_dup(&file3, file1, p)) + STD_TEST_NEQ(" Simple dup", apr_file_dup(&file3, file1, p)) - STD_TEST_NEQ("Write to dup'd file", apr_file_write(file3, TEST, &txtlen)) + STD_TEST_NEQ(" Write to dup'd file (#3)", apr_file_write(file3, TEST, &txtlen)) - STD_TEST_NEQ("Rewind original file pos", apr_file_seek(file1, APR_SET, &fpos)) + STD_TEST_NEQ(" Rewind file #1 to start", apr_file_seek(file1, APR_SET, &fpos)) - txtlen = sizeof(buff); - STD_TEST_NEQ("Read from original file handle", + txtlen = 50; + STD_TEST_NEQ(" Read from file #1", apr_file_read(file1, buff, &txtlen)) - printf("%s\n", buff); + TEST_NEQ(" Checking what we read from #1", strcmp(buff, TEST), 0, "OK", "Failed") - STD_TEST_NEQ("Open another new, empty file", + + printf("\nTesting apr_file_dup2\n"); + STD_TEST_NEQ(" Open another new, empty file (#2)", apr_file_open(&file2, "./testdup2.file", APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, p)) - STD_TEST_NEQ("Dup2 test", apr_file_dup2(&file3, file2, p)) + STD_TEST_NEQ(" Dup2 test", apr_file_dup2(&file3, file2, p)) txtlen = sizeof(TEST2); - STD_TEST_NEQ("Write to dup'd file", apr_file_write(file3, TEST2, &txtlen)) + STD_TEST_NEQ(" Write to dup'd file #3", apr_file_write(file3, TEST2, &txtlen)) - STD_TEST_NEQ("Rewind original file pos", apr_file_seek(file1, APR_SET, &fpos)) + STD_TEST_NEQ(" Rewind file #2 to start", apr_file_seek(file2, APR_SET, &fpos)) - STD_TEST_NEQ("Read from original file handle", - apr_file_read(file1, buff, &txtlen)) + txtlen = 50; + STD_TEST_NEQ(" Read from file #2", + apr_file_read(file2, buff, &txtlen)) + + TEST_NEQ(" Checking what we read from #2", strcmp(buff, TEST2), 0, "OK", "Failed") + + printf("\nCleaning up\n"); + STD_TEST_NEQ(" Closing file #3", apr_file_close(file3)) + STD_TEST_NEQ(" Closing file #2", apr_file_close(file2)) + STD_TEST_NEQ(" Closing file #1", apr_file_close(file1)) + + STD_TEST_NEQ(" Removing first test file", apr_file_remove("./testdup.file", p)) + STD_TEST_NEQ(" Removing first test file", apr_file_remove("./testdup2.file", p)) - printf("%s\n", buff); + printf("\nAll Tests completed - OK!\n"); return (0); } From 594772dc215e5d672b02ff702e6dd0ae2f9f99d0 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 12 Jan 2002 15:07:17 +0000 Subject: [PATCH 2757/7878] I don't like missing errors, so we'll now actually return the error if we have one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62761 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 8219d0247c7..f61245176b8 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -62,6 +62,8 @@ static apr_status_t _file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p, int which_dup) { + int rv; + if ((*new_file) == NULL) { if (which_dup == 1) { (*new_file) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); @@ -76,11 +78,14 @@ static apr_status_t _file_dup(apr_file_t **new_file, } if (which_dup == 2) { - dup2(old_file->filedes, (*new_file)->filedes); + rv = dup2(old_file->filedes, (*new_file)->filedes); } else { - (*new_file)->filedes = dup(old_file->filedes); + rv = ((*new_file)->filedes = dup(old_file->filedes)); } + if (rv == -1) + return errno; + (*new_file)->fname = apr_pstrdup(p, old_file->fname); (*new_file)->buffered = old_file->buffered; From 624e1f2c04f385b63476e34215333a81f9b4266c Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 12 Jan 2002 15:08:57 +0000 Subject: [PATCH 2758/7878] More shmem fixes... - change the p -> pool and add a pool accessor - add the attach/detach code - adjust the name we give an area so it's more descriptive git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62762 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/beos/shm.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index 16f292d6100..cfbe486ce69 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -62,7 +62,7 @@ #include struct apr_shm_t { - apr_pool_t *p; + apr_pool_t *pool; void *memblock; void *ptr; apr_size_t reqsize; @@ -78,18 +78,20 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, apr_size_t pagesize; area_id newid; char *addr; - + char area_name[32]; + (*m) = (apr_shm_t *)apr_pcalloc(p, sizeof(apr_shm_t)); /* we MUST allocate in pages, so calculate how big an area we need... */ pagesize = ((reqsize + B_PAGE_SIZE - 1) / B_PAGE_SIZE) * B_PAGE_SIZE; - - newid = create_area("apr_shm", (void*)&addr, B_ANY_ADDRESS, + sprintf(area_name, "apr_shm:%ld:%ld",find_thread(NULL), pagesize); + + newid = create_area(area_name, (void*)&addr, B_ANY_ADDRESS, pagesize, B_CONTIGUOUS, B_READ_AREA|B_WRITE_AREA); if (newid < 0) return errno; - (*m)->p = p; + (*m)->pool = p; (*m)->aid = newid; (*m)->memblock = addr; (*m)->ptr = (void*)addr; @@ -112,12 +114,29 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, const char *filename, apr_pool_t *pool) { - return APR_ENOTIMPL; + area_info ai; + thread_info ti; + area_id deleteme = (*m)->aid; + int offs = ((char*)(*m)->ptr) - ((char*)(*m)->memblock); + + get_area_info(deleteme, &ai); + get_thread_info(find_thread(NULL), &ti); + + if (ti.team != ai.team) { + delete_area(deleteme); + (*m)->aid = clone_area(ai.name, &(ai.address), B_CLONE_ADDRESS, + B_READ_AREA | B_WRITE_AREA, ai.area); + get_area_info((*m)->aid, &ai); + (*m)->memblock = ai.address; + (*m)->ptr = (void*)ai.address + offs; + } + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) { - return APR_ENOTIMPL; + delete_area(m->aid); + return APR_SUCCESS; } APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) @@ -130,3 +149,4 @@ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) return m->reqsize; } +APR_POOL_IMPLEMENT_ACCESSOR(shm) From c01d7937f2212536d9b8e2c8cd4bfa96af6c8260 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sat, 12 Jan 2002 16:15:07 +0000 Subject: [PATCH 2759/7878] The new APR_POOL_DEBUG and APR_POOL_DEBUG_VERBOSE code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62763 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 26 ++--- memory/unix/apr_pools.c | 228 +++++++++++++++++++++++++++++++--------- 2 files changed, 194 insertions(+), 60 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 5e8e8b22f7c..1ec5b8273d2 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -94,12 +94,12 @@ extern "C" { */ /* #define APR_POOL_DEBUG +#define APR_POOL_DEBUG_VERBOSE */ -#define APR_POOL_STRINGIZE(x) APR_POOL__STRINGIZE(x) -#define APR_POOL__STRINGIZE(x) #x -#define APR_POOL__FILELINE__ __FILE__ ":" APR_POOL_STRINGIZE(__LINE__) - +#if defined(APR_POOL_DEBUG_VERBOSE) && !defined(APR_POOL_DEBUG) +#define APR_POOL_DEBUG +#endif /** The fundamental pool type */ typedef struct apr_pool_t apr_pool_t; @@ -159,8 +159,8 @@ APR_DECLARE(void) apr_pool_terminate(void); * */ #if defined(APR_POOL_DEBUG) -#define apr_pool_create_ex( newpool, parent, abort_fn, flag) \ - apr_pool_create_ex_dbg( newpool, parent, abort_fn, flag,__FILE__,__LINE__) +#define apr_pool_create_ex(newpool, parent, abort_fn, flag) \ + apr_pool_create_ex_dbg(newpool, parent, abort_fn, flag, __FILE__, __LINE__) APR_DECLARE(apr_status_t) apr_pool_create_ex_dbg(apr_pool_t **newpool, apr_pool_t *parent, @@ -189,7 +189,8 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, #else #if defined(APR_POOL_DEBUG) #define apr_pool_create(newpool, parent) \ - apr_pool_create_ex_dbg(newpool, parent, NULL, APR_POOL_FDEFAULT,__FILE__,__LINE__) + apr_pool_create_ex_dbg(newpool, parent, NULL, APR_POOL_FDEFAULT, \ + __FILE__, __LINE__) #else #define apr_pool_create(newpool, parent) \ apr_pool_create_ex(newpool, parent, NULL, APR_POOL_FDEFAULT) @@ -212,10 +213,11 @@ APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **newpool, #else #if defined(APR_POOL_DEBUG) #define apr_pool_sub_make(newpool, parent, abort_fn) \ - (void)apr_pool_create_ex_dbg(newpool, parent, abort_fn, APR_POOL_FDEFAULT,__FILE__,__LINE__); + (void)apr_pool_create_ex_dbg(newpool, parent, abort_fn, APR_POOL_FDEFAULT, \ + __FILE__, __LINE__) #else #define apr_pool_sub_make(newpool, parent, abort_fn) \ - (void)apr_pool_create_ex(newpool, parent, abort_fn, APR_POOL_FDEFAULT); + (void)apr_pool_create_ex(newpool, parent, abort_fn, APR_POOL_FDEFAULT) #endif #endif @@ -227,7 +229,7 @@ APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **newpool, */ #if defined(APR_POOL_DEBUG) #define apr_pool_destroy(p) \ - apr_pool_destroy_dbg(p, __FILE__,__LINE__) + apr_pool_destroy_dbg(p, __FILE__, __LINE__) APR_DECLARE(void) apr_pool_destroy_dbg(apr_pool_t *p, const char *file, int line); #else @@ -264,9 +266,9 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); */ #if defined(APR_POOL_DEBUG) #define apr_pool_clear(p) \ - apr_pool_clear_dbg(p, __FILE__,__LINE__) + apr_pool_clear_dbg(p, __FILE__, __LINE__) -APR_DECLARE(void) apr_pool_clear_dbg(apr_pool_t *p, const char*file, int line); +APR_DECLARE(void) apr_pool_clear_dbg(apr_pool_t *p, const char *file, int line); #else APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); #endif diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 7e19625c86c..65cce344e8c 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -67,7 +67,7 @@ #include "apr_want.h" #if APR_HAVE_STDLIB_H -#include /* for malloc and free */ +#include /* for malloc, free and abort */ #endif /* @@ -91,14 +91,6 @@ #define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) -/* - * This option prints out the pool creation info - * (and info about its children) - * when the pool is destroyed. - */ -/* -#define APR_POOL_DEBUG_VERBOSE -*/ /* * Structures @@ -198,6 +190,9 @@ static allocator_t global_allocator = { }; #endif /* !defined(APR_POOL_DEBUG) */ +#if defined(APR_POOL_DEBUG_VERBOSE) +static apr_file_t *file_stderr = NULL; +#endif /* * Local functions @@ -235,7 +230,7 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) global_allocator.owner = global_pool; apr_pools_initialized = 1; - + return APR_SUCCESS; } @@ -842,9 +837,20 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) APR_POOL_FNEW_ALLOCATOR|APR_POOL_FLOCK)) != APR_SUCCESS) { return rv; } - + + apr_pool_tag(global_pool, "APR global pool"); + apr_pools_initialized = 1; +#if APR_POOL_DEBUG_VERBOSE + apr_file_open_stderr(&file_stderr, global_pool); + if (file_stderr) { + apr_file_printf(file_stderr, + "POOL DEBUG: GLOBAL 0x%08X(%s)\n", + (unsigned int)global_pool, global_pool->tag); + } +#endif + return APR_SUCCESS; } @@ -857,8 +863,55 @@ APR_DECLARE(void) apr_pool_terminate(void) apr_pool_destroy(global_pool); /* This will also destroy the mutex */ global_pool = NULL; + +#if APR_POOL_DEBUG_VERBOSE + file_stderr = NULL; +#endif } +/* + * Integrity checking + * This basically checks to see if the pool being used is still + * a relative to the global pool. If not it was previously + * destroyed, in which case we abort(). + */ + +static int pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent) +{ + apr_pool_t *child; + + if (parent == NULL) + return 0; + + child = parent->child; + + while (child) { + if (pool == child || pool_is_child_of(pool, child)) + return 1; + + child = child->sibling; + } + + return 0; +} + +static void check_integrity(apr_pool_t *pool) +{ + if (pool == global_pool || global_pool == NULL) + return; + + if (!pool_is_child_of(pool, global_pool)) + { +#if defined(APR_POOL_DEBUG_VERBOSE) + if (file_stderr) { + apr_file_printf(file_stderr, + "POOL DEBUG: INVALID 0x%08X, abort().\n", (unsigned int)pool); + } +#endif + + abort(); + } +} /* * Memory allocation (debug) @@ -869,6 +922,8 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) debug_node_t *node; void *mem; + check_integrity(pool); + if ((mem = malloc(size)) == NULL) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); @@ -897,13 +952,12 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) return mem; } -/* - * (debug) - */ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) { void *mem; - + + check_integrity(pool); + mem = apr_palloc(pool, size); memset(mem, 0, size); @@ -913,10 +967,9 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) /* * Pool creation/destruction (debug) - * TODO: printout a line if _VERBOSE is on */ -APR_DECLARE(void) apr_pool_clear_dbg(apr_pool_t *pool,const char*file, int line) +static void pool_clear_dbg(apr_pool_t *pool, const char *file, int line) { debug_node_t *node; apr_uint32_t index; @@ -925,7 +978,7 @@ APR_DECLARE(void) apr_pool_clear_dbg(apr_pool_t *pool,const char*file, int line) * this pool thus this loop is safe and easy. */ while (pool->child) - apr_pool_destroy_dbg(pool->child,file,line); + apr_pool_destroy_dbg(pool->child, file, line); /* Run cleanups */ run_cleanups(pool->cleanups); @@ -949,32 +1002,38 @@ APR_DECLARE(void) apr_pool_clear_dbg(apr_pool_t *pool,const char*file, int line) } } -/* - * destroy (debug) - */ -APR_DECLARE(void) apr_pool_destroy_dbg(apr_pool_t *pool,const char*file, int line) +APR_DECLARE(void) apr_pool_clear_dbg(apr_pool_t *pool, + const char *file, int line) { -#if defined APR_POOL_DEBUG_VERBOSE - apr_file_t *stderr_log = NULL; - apr_pool_t *child; + check_integrity(pool); + +#if defined(APR_POOL_DEBUG_VERBOSE) + if (file_stderr) { + apr_file_printf(file_stderr, + "POOL DEBUG: CLEAR 0x%08X(%s) [%s:%d]\n", + (unsigned int)pool, pool->tag, + file, line); + } +#endif - apr_file_open_stderr(&stderr_log,pool); /* XXX not sure about this one */ - if (stderr_log) { - apr_file_printf(stderr_log, - "DEBUG: %s:%d destroy pool tagged %s created %s:%d\n", - file, line, pool->tag, pool->file, pool->line); - child= pool->child; - while (child) { - apr_file_printf(stderr_log, - "DEBUG:\tpool child tagged %s created %s:%d\n", - child->tag, child->file, child->line); - child = child->sibling; - } - apr_file_close(stderr_log); + pool_clear_dbg(pool, file, line); +} + +APR_DECLARE(void) apr_pool_destroy_dbg(apr_pool_t *pool, + const char *file, int line) +{ + check_integrity(pool); + +#if defined(APR_POOL_DEBUG_VERBOSE) + if (file_stderr) { + apr_file_printf(file_stderr, + "POOL DEBUG: DESTROY 0x%08X(%s) [%s:%u]\n", + (unsigned int)pool, pool->tag, + file, line); } #endif - apr_pool_clear_dbg(pool,file,line); + pool_clear_dbg(pool, file, line); /* Remove the pool from the parents child list */ if (pool->parent) { @@ -998,10 +1057,6 @@ APR_DECLARE(void) apr_pool_destroy_dbg(apr_pool_t *pool,const char*file, int lin free(pool); } -/* - * create (debug) - * there is a macro which adds the file/line # - */ APR_DECLARE(apr_status_t) apr_pool_create_ex_dbg(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, @@ -1015,6 +1070,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_dbg(apr_pool_t **newpool, if (!parent) parent = global_pool; + else + check_integrity(parent); if (!abort_fn && parent) abort_fn = parent->abort_fn; @@ -1029,6 +1086,9 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_dbg(apr_pool_t **newpool, memset(pool, 0, SIZEOF_POOL_T); pool->abort_fn = abort_fn; + pool->tag = ""; + pool->file = file; + pool->line = line; if ((flags & APR_POOL_FNEW_ALLOCATOR) == APR_POOL_FNEW_ALLOCATOR) { #if APR_HAS_THREADS @@ -1071,14 +1131,60 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_dbg(apr_pool_t **newpool, pool->ref = NULL; } - pool->file = file; - pool->line = line; - *newpool = pool; +#if defined(APR_POOL_DEBUG_VERBOSE) + if (file_stderr) { + apr_file_printf(file_stderr, + "POOL DEBUG: CREATE 0x%08X(%s) parent = 0x%08X(%s) [%s:%u]\n", + (unsigned int)pool, pool->tag, + (unsigned int)parent, parent ? parent->tag : "", + file, line); + } +#endif + return APR_SUCCESS; } +/* + * Pool creation/destruction stubs, for people who want + * APR_POOL_DEBUG, but didn't recompile their entire application. + * The prototypes are here to keep compilers picky about + * prototypes happy. + */ + +#undef apr_pool_clear +APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool); + +APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) +{ + apr_pool_clear_dbg(pool, "", 0); +} + +#undef apr_pool_destroy +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool); + +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) +{ + apr_pool_destroy_dbg(pool, "", 0); +} + +#undef apr_pool_create_ex +APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_uint32_t flags); + +APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_uint32_t flags) +{ + return apr_pool_create_ex_dbg(newpool, parent, + abort_fn, flags, + "", 0); +} + /* * "Print" functions (debug) @@ -1112,6 +1218,8 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) struct psprintf_data ps; debug_node_t *node; + check_integrity(pool); + ps.size = 64; ps.mem = malloc(ps.size); ps.vbuff.curpos = ps.mem; @@ -1311,6 +1419,10 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *ke apr_status_t (*cleanup) (void *), apr_pool_t *pool) { +#if defined(APR_POOL_DEBUG) + check_integrity(pool); +#endif + if (pool->user_data == NULL) pool->user_data = apr_hash_make(pool); @@ -1332,6 +1444,10 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, const char *k apr_status_t (*cleanup) (void *), apr_pool_t *pool) { +#if defined(APR_POOL_DEBUG) + check_integrity(pool); +#endif + if (pool->user_data == NULL) pool->user_data = apr_hash_make(pool); @@ -1345,6 +1461,10 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, const char *k APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *pool) { +#if defined(APR_POOL_DEBUG) + check_integrity(pool); +#endif + if (pool->user_data == NULL) *data = NULL; else @@ -1370,9 +1490,13 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, apr_status_t (*child_cleanup_fn)(void *data)) { cleanup_t *c; - + +#if defined(APR_POOL_DEBUG) + check_integrity(p); +#endif + if (p != NULL) { - c = (cleanup_t *) apr_palloc(p, sizeof(cleanup_t)); + c = (cleanup_t *)apr_palloc(p, sizeof(cleanup_t)); c->data = data; c->plain_cleanup_fn = plain_cleanup_fn; c->child_cleanup_fn = child_cleanup_fn; @@ -1386,6 +1510,10 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, { cleanup_t *c, **lastp; +#if defined(APR_POOL_DEBUG) + check_integrity(p); +#endif + if (p == NULL) return; @@ -1408,6 +1536,10 @@ APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, { cleanup_t *c; +#if defined(APR_POOL_DEBUG) + check_integrity(p); +#endif + if (p == NULL) return; From 50152ef393bb22d53ebc08e912b60d726d03aa6e Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sat, 12 Jan 2002 17:18:37 +0000 Subject: [PATCH 2760/7878] Update CHANGES and STATUS to reflect the current state of the pools code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62764 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ STATUS | 8 +------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 6d7ce67c291..a081a24a4a0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ Changes with APR b1 + *) Updated the pools debug code. Check if a pool is still + valid on the most common apr_pool_xxx functions. + Fix the way APR_POOL_DEBUG_VERBOSE was using stderr. + Make the output somewhat nicer in this debug mode. [Sander Striker] + *) Add new define APR_POOL_DEBUG_VERBOSE which spits out info about pool creation/destruction [Ian Holsman] diff --git a/STATUS b/STATUS index 4f5e0549794..357de8e6b7a 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/01/11 21:01:20 $] +Last modified at [$Date: 2002/01/12 17:18:37 $] Release: @@ -54,12 +54,6 @@ RELEASE SHOWSTOPPERS: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: - * We should check if a pool is still existent when passed into - any apr_pool_xxx function. We could do this by recursively - checking if the pool is in a child list, starting at - global_pool. If it is not, bail out and report sourcefile - linenumber (or cause a segv). - * Get OTHER_CHILD support into Win32 Status: Bill S. is looking into this From 76c1955ee1cba6c0101c76472229e35374f6dbd2 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 12 Jan 2002 18:04:13 +0000 Subject: [PATCH 2761/7878] Tidy up the Makefile.in (why were testshmem references left???!!) Remove testmem.c and references as it's no longer useful. Test for pools on the way. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62765 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 10 +- test/testmem.c | 474 ----------------------------------------------- 2 files changed, 1 insertion(+), 483 deletions(-) delete mode 100644 test/testmem.c diff --git a/test/Makefile.in b/test/Makefile.in index ab891a87514..52a3ae60620 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -17,7 +17,6 @@ PROGRAMS = \ testargs@EXEEXT@ \ testud@EXEEXT@ \ testmmap@EXEEXT@ \ - testshmem@EXEEXT@ \ testshm@EXEEXT@ \ testshmproducer@EXEEXT@ \ testshmconsumer@EXEEXT@ \ @@ -28,12 +27,11 @@ PROGRAMS = \ testipsub@EXEEXT@ \ testmd5@EXEEXT@ \ testpoll@EXEEXT@ \ - testmem@EXEEXT@ \ testhash@EXEEXT@ \ occhild@EXEEXT@ \ teststr@EXEEXT@ \ testuser@EXEEXT@ \ - testsockets@EXEEXT@ \ + testsockets@EXEEXT@ \ testprocmutex@EXEEXT@ \ testvsn@EXEEXT@ \ testsleep@EXEEXT@ \ @@ -117,9 +115,6 @@ testtime@EXEEXT@: testtime.lo $(LOCAL_LIBS) testmmap@EXEEXT@: testmmap.lo $(LOCAL_LIBS) $(LINK) testmmap.lo $(LOCAL_LIBS) $(ALL_LIBS) -testshmem@EXEEXT@: testshmem.lo $(LOCAL_LIBS) - $(LINK) testshmem.lo $(LOCAL_LIBS) $(ALL_LIBS) - testshm@EXEEXT@: testshm.lo $(LOCAL_LIBS) testshmproducer@EXEEXT@ testshmconsumer@EXEEXT@ $(LINK) testshm.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -147,9 +142,6 @@ testmd5@EXEEXT@: testmd5.lo $(LOCAL_LIBS) testpoll@EXEEXT@: testpoll.lo $(LOCAL_LIBS) $(LINK) testpoll.lo $(LOCAL_LIBS) $(ALL_LIBS) -testmem@EXEEXT@: testmem.lo $(LOCAL_LIBS) - $(LINK) testmem.lo $(LOCAL_LIBS) $(ALL_LIBS) - testhash@EXEEXT@: testhash.lo $(LOCAL_LIBS) $(LINK) testhash.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/testmem.c b/test/testmem.c deleted file mode 100644 index e2833952e34..00000000000 --- a/test/testmem.c +++ /dev/null @@ -1,474 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_time.h" -#include "test_apr.h" -#include -#include -#include -#define APR_WANT_MEMFUNC -#include "apr_want.h" -#include "test_apr.h" - -#define LUMPS 10 -#define LUMP_SIZE 1024 -#define TIMED_RUNS 10 -#define TIMED_LOOPS 50 -char *ptrs[1000]; - -typedef struct _test_ { - void * (*malloc_fn) (void *memsys, apr_size_t size); - void * (*calloc_fn) (void *memsys, apr_size_t size); - void * (*free_fn) (void *memsys, void *memptr); - void * (*reset_fn) (void *memsys); - void * memory; - char * title; - int large_tests; - apr_time_t howlong; -} _test_; - -#define T_QTY 1 /* how many tests do we have?? */ -static _test_ t[T_QTY]; - -static void its_a_pool(apr_pool_t *pool, _test_ *t, char *name, int lt) -{ - t->malloc_fn = (void *(*)(void *, apr_size_t))apr_palloc; - t->calloc_fn = (void *(*)(void *, apr_size_t))apr_pcalloc; - t->free_fn = NULL; - t->reset_fn = (void *(*)(void *))apr_pool_clear; - t->memory = pool; - t->title = name; - t->large_tests = lt; - t->howlong = 0; -} - -static int malloc_test(_test_ *t, apr_size_t size, int howmany, int verbose) -{ - int cntr; - - if (verbose) - printf(" Malloc'ing %d lumps of memory, each of %" APR_SIZE_T_FMT " bytes ", - howmany, size); - for (cntr = 0;cntr < howmany;cntr ++){ - ptrs[cntr] = t->malloc_fn(t->memory, size); - if (!ptrs[cntr]){ - printf("Failed\n"); - fprintf(stderr,"Failed @ lump %d of %d\n", cntr + 1, howmany); - return 1; - } - } - if (verbose) - printf ("OK\n"); - - return 0; -} - -static int calloc_test(_test_ *t, apr_size_t size, int howmany, int verbose) -{ - int cntr, cntr2; - - if (verbose) - printf(" Calloc'ing %d lumps of memory, each %" APR_SIZE_T_FMT " bytes ", - howmany, size); - for (cntr = 0;cntr < howmany;cntr ++){ - ptrs[cntr] = t->calloc_fn(t->memory, size); - if (!ptrs[cntr]){ - printf("Failed\n"); - fprintf(stderr, "Failed @ lump %d of %d\n", cntr + 1, howmany); - return 1; - } - } - if (verbose) { - printf ("OK\n"); - printf(" (checking that memory is zeroed "); - } - for (cntr = 0;cntr < howmany;cntr++){ - for (cntr2 = 0;cntr2 < size; cntr2 ++){ - if (*(ptrs[cntr] + cntr2) != 0){ - printf("Failed\n"); - fprintf(stderr, "Failed!\nGot %d instead of 0 at byte %d of chunk %d [%p]\n", - *(ptrs[cntr] + cntr2), cntr2 + 1, cntr + 1, ptrs[cntr] + cntr2); - return 1; - } - } - } - if (verbose) - printf("OK)\n"); - - return 0; -} - -static int write_test(apr_size_t size, int howmany, int verbose) -{ - int cntr,cntr2; - int val; - - if (verbose) - printf("%-60s", " Writing to the lumps of memory"); - - for (cntr = 0;cntr < howmany;cntr ++){ - if (size == 64) { - /* we go past 256 in our tests, so use a different value :) */ - val = 99; - } else { - val = cntr; - } - if (memset(ptrs[cntr], val, size) != ptrs[cntr]){ - printf("Failed\n"); - fprintf(stderr,"Failed to write into lump %d\n", cntr + 1); - return 1; - } - } - - if (verbose) { - printf("OK\n"); - - printf("%-60s", " Check what we wrote"); - } - - for (cntr = 0;cntr < howmany;cntr++){ - if (size == 64) { - val = 99; - } else { - val = cntr; - } - for (cntr2 = 0;cntr2 < size; cntr2 ++){ - if (*(ptrs[cntr] + cntr2) != val){ - printf("Failed\n"); - fprintf(stderr,"Got %d instead of %d at byte %d\n", - *(ptrs[cntr] + cntr2), val, cntr2 + 1); - return 1; - } - } - } - if (verbose) - printf("OK\n"); - return 0; -} - -static int free_memory(_test_ *t, int qty, int verbose) -{ - int cntr; - - if (verbose) - printf(" Freeing the memory we created "); - /* pools don't really do free... */ - if (t->free_fn) { - for (cntr = 0;cntr < qty;cntr ++){ - if (t->free_fn(t->memory, ptrs[cntr]) != APR_SUCCESS){ - printf("Failed\n"); - fprintf(stderr,"Failed to free block %d\n", cntr + 1); - return 1; - } - } - } - - if (verbose) - printf("OK\n"); - return 0; -} - -static int reset_memory(_test_ *t, int loops, int verbose) -{ - if (verbose) - printf(" Resetting the memory we created "); - if (!t->reset_fn) { - free_memory(t, loops, verbose); - } else { - t->reset_fn(t->memory); - } - - if (verbose) - printf("OK\n"); - return 0; -} - -static int simple_test(_test_ *t, int verbose) -{ - char msg[60]; - if (t->large_tests == 0) - return 0; - - sprintf(msg, " Big allocation test for %s", t->title); - printf("%-60s", msg); - if (malloc_test(t, 4096, 100, verbose)) - return 1; - if (write_test(4096, 100, verbose)) - return 1; - if (free_memory(t, 100, verbose)) - return 1; - if (calloc_test(t, 4096, 100, verbose)) - return 1; - if (write_test(4096, 100, verbose)) - return 1; - if (free_memory(t, 100, verbose)) - return 1; - printf("OK\n"); - return 0; -} - -static int small_test(_test_ *t, int verbose) -{ - char msg[60]; - sprintf(msg, " Small allocation test for %s", t->title); - printf("%-60s", msg); - if (malloc_test(t, 64, 100, verbose)) - return 1; - if (write_test(64, 100, verbose)) - return 1; - if (free_memory(t, 100, verbose)) - return 1; - printf("OK\n"); - return 0; -} - -static int timed_test(_test_ *t, int verbose) -{ - int iloop, oloop, ooloop, rv; - apr_time_t t1=0, t2=0, t3=0, t4 = 0, tmp = 0, total = 0; - char msg[60]; - apr_size_t sz[5] = {1024, 4096, 256, 8 * 1024, 1024}; - - if (t->large_tests == 0) - return 0; - - sprintf(msg, " Timed alloc test (%d - %d) for %s", LUMPS, LUMPS + ( 3 * LUMPS), - t->title); - if (verbose) { - printf("%s\n", msg); - printf(" alloc <-------- timings (usecs) -------->\n"); - printf(" size malloc / calloc / reset / total\n"); - } else { - printf("%-60s", msg); - } - - for (ooloop = 0; ooloop < 5; ooloop ++) { - for (oloop = 0; oloop < TIMED_LOOPS;oloop ++) { - for (iloop = 0; iloop < TIMED_RUNS; iloop ++) { - TIME_FUNCTION(tmp, (rv = malloc_test(t, sz[ooloop], 100, 0))) - t1 += tmp; - if (rv) - return 1; - TIME_FUNCTION(tmp, (rv = write_test(sz[ooloop], 100, 0))) - if (rv) - return 1; - TIME_FUNCTION(tmp, (rv = reset_memory(t, 100, 0))) - t2 += tmp; - if (rv) - return 1; - } - for (iloop = 0; iloop < TIMED_RUNS; iloop++) { - TIME_FUNCTION(tmp, (rv = calloc_test(t, sz[ooloop], 100, 0))) - t3 += tmp; - if (rv) - return 1; - TIME_FUNCTION(tmp, (rv = write_test(sz[ooloop], 100, 0))) - if (rv) - return 1; - TIME_FUNCTION(tmp, (rv = reset_memory(t, 100, 0))) - t4 += tmp; - if (rv) - return 1; - } - } - if (verbose) - printf(" %4" APR_SIZE_T_FMT " %10lld / %10lld / %10lld / %10lld\n", - sz[ooloop], t1, t3, t2 + t4, t1 + t2 + t3 + t4); - total += (t1 + t2 + t3 + t4); - t1=0;t2=0;t3=0;t4=0; - } - if (verbose) { - printf(" average = %lld\n", - (total / TIMED_LOOPS)); - } else { - printf("OK\n"); - } - t->howlong = (total / TIMED_LOOPS); - return 0; -} - -static int timed_test_64byte(_test_ *t, int small, int verbose) -{ - apr_size_t sz[4] = {100,300,600,1000}; - int iloop, oloop, ooloop, rv; - apr_time_t t1=0, t2=0, t3=0, tmp = 0, total = 0; - apr_time_t tt1=0, tt2=0, tt3=0; - char msg[80]; - - if (small) { - sz[0] = 100; - sz[1] = 100; - sz[2] = 100; - sz[3] = 100; - } - - sprintf(msg, " 64 byte alloc test (%" APR_SIZE_T_FMT " - %" APR_SIZE_T_FMT " loops) %s", - sz[0], sz[3], t->title); - if (verbose) { - printf("%s\n", msg); - printf(" <------ timings (usecs) ------>\n"); - printf(" allocations alloc / reset / total\n"); - } else { - printf("%-60s", msg); - } - - for (ooloop = 0; ooloop < 4; ooloop ++) { - t1=0;t2=0;t3=0; - for (oloop = 0; oloop < TIMED_LOOPS * 2;oloop ++) { - for (iloop = 0; iloop < TIMED_RUNS; iloop ++) { - TIME_FUNCTION(tmp, (rv = malloc_test(t, 64, sz[ooloop], 0))) - t1 += tmp; - if (rv) - return 1; - tmp = apr_time_now(); - if (write_test(64, sz[ooloop], 0)) - return 1; - t2 += (apr_time_now() - tmp); - tmp = apr_time_now(); - if (reset_memory(t, sz[ooloop], 0)) - return 1; - t3 += (apr_time_now() - tmp); - } - } - if (verbose) { - printf(" %4" APR_SIZE_T_FMT " %10lld / %10lld / %10lld\n", - sz[ooloop], t1, t2, t1 + t2); - } - tt1 += t1;tt2 += t2;tt3 += t3; - total += (t1 + t2 + t3); - t1 = 0; t2 = 0; - } - if (verbose) - printf(" average over 4 runs = %lld\n\n", total / 4); - else - printf("OK\n"); - - t->howlong = total / 4; - - return 0; -} - -static void print_timed_results(void) -{ - int i; - printf(" Percentage Results averages %% of pools\n"); - for (i=0;i < T_QTY; i++) { - float pa = (float)t[i].howlong / (float)t[0].howlong; - printf(" %-20s %-8lld %7.02f %%\n", t[i].title, t[i].howlong, - pa * 100); - } - printf("\n"); - for (i=0;i Date: Sat, 12 Jan 2002 18:08:37 +0000 Subject: [PATCH 2762/7878] Change the way we set the BEOS_BLOCKING define so that the picky compiler allows it to build on classic BeOS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62766 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/pipe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index db1182b8f02..da3959e230e 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -62,7 +62,9 @@ */ #if BEOS #if !BONE7 -# define BEOS_BLOCKING +# define BEOS_BLOCKING 1 +#else +# define BEOS_BLOCKING 0 #endif #endif From 4e12a215e97e50c8fcdeeff1055936f42d291154 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 12 Jan 2002 18:12:33 +0000 Subject: [PATCH 2763/7878] Thought I committed this a whiole back, but guess I didn't... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62767 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 68d73db7e83..2dc96859e78 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -146,7 +146,7 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval { apr_pool_destroy(thd->cntxt); thd->exitval = retval; - exit_thread ((status_t)(*retval)); + exit_thread ((status_t)(retval)); /* This will never be reached... */ return APR_SUCCESS; } From 0cfc3a84f1b19fcd21cee0912eb3f0912a8c3b8a Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 12 Jan 2002 18:32:07 +0000 Subject: [PATCH 2764/7878] Add testshm.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62768 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 3 + test/testshm.c | 306 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 309 insertions(+) create mode 100644 test/testshm.c diff --git a/test/Makefile.in b/test/Makefile.in index 52a3ae60620..bad32789ccb 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -169,4 +169,7 @@ testdup@EXEEXT@: testdup.lo $(LOCAL_LIBS) testrand@EXEEXT@: testrand.lo $(LOCAL_LIBS) $(LINK) testrand.lo $(LOCAL_LIBS) $(ALL_LIBS) +testshm@EXEEXT@: testshm.lo $(LOCAL_LIBS) + $(LINK) testshm.lo $(LOCAL_LIBS) $(ALL_LIBS) + # DO NOT REMOVE diff --git a/test/testshm.c b/test/testshm.c new file mode 100644 index 00000000000..7b50ef59479 --- /dev/null +++ b/test/testshm.c @@ -0,0 +1,306 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_shm.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include "apr_time.h" +#include +#include +#include +#if APR_HAVE_UNISTD_H +#include +#endif + +#if APR_HAS_SHARED_MEMORY + +typedef struct mbox { + char msg[1024]; + int msgavail; +} mbox; +mbox *boxes; + +#define N_BOXES 10 +#define N_MESSAGES 100 +#define SHARED_SIZE (apr_size_t)(N_BOXES * sizeof(mbox)) +#define SHARED_FILENAME "/tmp/apr.testshm.shm" + +static void msgwait(int sleep_sec, int first_box, int last_box) +{ + int i; + apr_time_t start = apr_time_now(); + while (apr_time_now() - start < sleep_sec * APR_USEC_PER_SEC) { + for (i = first_box; i < last_box; i++) { + if (boxes[i].msgavail) { + fprintf(stdout, "received a message in box %d, message was: %s\n", + i, boxes[i].msg); + boxes[i].msgavail = 0; /* reset back to 0 */ + } + } + apr_sleep(1*APR_USEC_PER_SEC/100); + } + fprintf(stdout, "done waiting on mailboxes...\n"); +} + +static void msgput(int boxnum, char *msg) +{ + fprintf(stdout, "Sending message to box %d\n", boxnum); + apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg)); + boxes[boxnum].msgavail = 1; +} + +static apr_status_t test_anon(apr_pool_t *parpool) +{ + apr_status_t rv; + apr_pool_t *pool; + apr_shm_t *shm; + apr_size_t retsize; + pid_t pid; + int cnt, i, exit_int; + + rv = apr_pool_create(&pool, parpool); + if (rv != APR_SUCCESS) { + fprintf(stderr, "Error creating child pool\n"); + return rv; + } + + printf("Creating anonymous shared memory block (%" + APR_SIZE_T_FMT " bytes)........", SHARED_SIZE); + rv = apr_shm_create(&shm, SHARED_SIZE, NULL, pool); + if (rv != APR_SUCCESS) { + fprintf(stderr, "Error allocating shared memory block\n"); + return rv; + } + fprintf(stdout, "OK\n"); + + printf("Checking size...%" APR_SIZE_T_FMT " bytes...", + retsize = apr_shm_size_get(shm)); + if (retsize != SHARED_SIZE) { + fprintf(stderr, "Error allocating shared memory block\n"); + return rv; + } + fprintf(stdout, "OK\n"); + + printf("Allocating shared mbox memory for %d boxes ..............", + N_BOXES); + boxes = apr_shm_baseaddr_get(shm); + if (boxes == NULL) { + fprintf(stderr, "Error creating message boxes.\n"); + return rv; + } + fprintf(stdout, "OK\n"); + + printf("Shared Process Test (child/parent)\n"); + pid = fork(); + if (pid == 0) { /* child */ + msgwait(5, 0, N_BOXES); + exit(0); + } + else if (pid > 0) { /* parent */ + i = N_BOXES; + cnt = N_MESSAGES; + while (--cnt > 0) { + if ((i-=3) < 0) { + i += N_BOXES; /* start over at the top */ + } + msgput(i, "Sending a message\n"); + apr_sleep(1*APR_USEC_PER_SEC/100); + } + } + else { + printf("Error creating a child process\n"); + return errno; + } + /* wait for the child */ + printf("Waiting for child to exit.\n"); + if (waitpid(pid, &exit_int, 0) < 0) { + return errno; + } + + apr_pool_destroy(pool); + + return APR_SUCCESS; +} + +static apr_status_t test_named(apr_pool_t *parpool) +{ + apr_status_t rv; + apr_pool_t *pool; + apr_shm_t *shm; + apr_size_t retsize; + pid_t pidproducer, pidconsumer; + int exit_int; + + rv = apr_pool_create(&pool, parpool); + if (rv != APR_SUCCESS) { + fprintf(stderr, "Error creating child pool\n"); + return rv; + } + + printf("Creating named shared memory block (%" + APR_SIZE_T_FMT " bytes)........", SHARED_SIZE); + rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, pool); + if (rv != APR_SUCCESS) { + fprintf(stderr, "Error allocating shared memory block\n"); + return rv; + } + fprintf(stdout, "OK\n"); + + printf("Checking size...%" APR_SIZE_T_FMT " bytes...", + retsize = apr_shm_size_get(shm)); + if (retsize != SHARED_SIZE) { + fprintf(stderr, "Error allocating shared memory block\n"); + return rv; + } + fprintf(stdout, "OK\n"); + + printf("Allocating shared mbox memory for %d boxes ..............", + N_BOXES); + boxes = apr_shm_baseaddr_get(shm); + if (boxes == NULL) { + fprintf(stderr, "Error creating message boxes.\n"); + return rv; + } + fprintf(stdout, "OK\n"); + + printf("Non-related Processes Test\n"); + pidproducer = fork(); + if (pidproducer == 0) { /* child */ + /* FIXME: exec a producer */ + printf("starting consumer\n"); + if (execlp("testshmconsumer", "testshmconsumer", (char*)0) < 0) { + return errno; + } + } + else if (pidproducer > 0) { /* parent */ + /* fork another child */ + pidconsumer = fork(); + if (pidconsumer == 0) { /* child */ + /* FIXME: exec a producer */ + printf("starting producer\n"); + if (execlp("testshmproducer", "testshmproducer", (char*)0) < 0) { + return errno; + } + } + else if (pidconsumer < 0) { /* parent */ + printf("Error creating a child process\n"); + return errno; + } + } + else { + printf("Error creating a child process\n"); + return errno; + } + /* wait for the child */ + printf("Waiting for producer to exit.\n"); + if (waitpid(pidconsumer, &exit_int, 0) < 0) { + return errno; + } + printf("Waiting for consumer to exit.\n"); + if (waitpid(pidproducer, &exit_int, 0) < 0) { + return errno; + } + + apr_pool_destroy(pool); + + return APR_SUCCESS; +} + +int main(void) +{ + apr_status_t rv; + apr_pool_t *pool; + char errmsg[200]; + + apr_initialize(); + + printf("APR Shared Memory Test\n"); + printf("======================\n\n"); + + printf("Initializing the pool............................"); + if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { + printf("could not initialize pool\n"); + exit(-1); + } + printf("OK\n"); + + rv = test_anon(pool); + if (rv != APR_SUCCESS) { + if (rv == APR_ENOTIMPL) { + printf("Anonymous shared memory unavailable on this platform.\n"); + } + else { + printf("Anonymous shared memory test FAILED: [%d] %s\n", + rv, apr_strerror(rv, errmsg, sizeof(errmsg))); + exit(-2); + } + } + printf("Anonymous shared memory test passed!\n"); + + if (test_named(pool) != APR_SUCCESS) { + printf("Name-based shared memory test FAILED: [%d] %s \n", + rv, apr_strerror(rv, errmsg, sizeof(errmsg))); + exit(-3); + } + printf("Named shared memory test passed!\n"); + + return 0; +} + +#else /* APR_HAS_SHARED_MEMORY */ +#error shmem is not supported on this platform +#endif /* APR_HAS_SHARED_MEMORY */ + From e324f9ddf1496e4639cd74f144566342a944752c Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 12 Jan 2002 19:18:12 +0000 Subject: [PATCH 2765/7878] Add a quick 5 minute "incredibly simple" pools test app. Tidy up Makefile.in by removing suplicate references and references to files not in the tree! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62769 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 18 ++---- test/testpools.c | 157 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 163 insertions(+), 12 deletions(-) create mode 100644 test/testpools.c diff --git a/test/Makefile.in b/test/Makefile.in index bad32789ccb..4aab043b1a7 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -18,8 +18,6 @@ PROGRAMS = \ testud@EXEEXT@ \ testmmap@EXEEXT@ \ testshm@EXEEXT@ \ - testshmproducer@EXEEXT@ \ - testshmconsumer@EXEEXT@ \ testpipe@EXEEXT@ \ testoc@EXEEXT@ \ testuuid@EXEEXT@ \ @@ -36,7 +34,9 @@ PROGRAMS = \ testvsn@EXEEXT@ \ testsleep@EXEEXT@ \ testrand@EXEEXT@ \ - testdup@EXEEXT@ + testdup@EXEEXT@ \ + testpools@EXEEXT@ + TARGETS = $(PROGRAMS) @@ -115,15 +115,9 @@ testtime@EXEEXT@: testtime.lo $(LOCAL_LIBS) testmmap@EXEEXT@: testmmap.lo $(LOCAL_LIBS) $(LINK) testmmap.lo $(LOCAL_LIBS) $(ALL_LIBS) -testshm@EXEEXT@: testshm.lo $(LOCAL_LIBS) testshmproducer@EXEEXT@ testshmconsumer@EXEEXT@ +testshm@EXEEXT@: testshm.lo $(LOCAL_LIBS) $(LINK) testshm.lo $(LOCAL_LIBS) $(ALL_LIBS) -testshmproducer@EXEEXT@: testshmproducer.lo $(LOCAL_LIBS) - $(LINK) testshmproducer.lo $(LOCAL_LIBS) $(ALL_LIBS) - -testshmconsumer@EXEEXT@: testshmconsumer.lo $(LOCAL_LIBS) - $(LINK) testshmconsumer.lo $(LOCAL_LIBS) $(ALL_LIBS) - testpipe@EXEEXT@: testpipe.lo $(LOCAL_LIBS) $(LINK) testpipe.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -169,7 +163,7 @@ testdup@EXEEXT@: testdup.lo $(LOCAL_LIBS) testrand@EXEEXT@: testrand.lo $(LOCAL_LIBS) $(LINK) testrand.lo $(LOCAL_LIBS) $(ALL_LIBS) -testshm@EXEEXT@: testshm.lo $(LOCAL_LIBS) - $(LINK) testshm.lo $(LOCAL_LIBS) $(ALL_LIBS) +testpools@EXEEXT@: testpools.lo $(LOCAL_LIBS) + $(LINK) testpools.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/testpools.c b/test/testpools.c new file mode 100644 index 00000000000..cbca43b7f53 --- /dev/null +++ b/test/testpools.c @@ -0,0 +1,157 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_errno.h" +#include "apr_file_io.h" +#include +#include +#include +#if APR_HAVE_UNISTD_H +#include +#endif +#include "test_apr.h" + +void alloc_bytes(apr_pool_t *p, int bytes) +{ + int i; + char *alloc; + + printf("apr_palloc for %d bytes\n", bytes); + printf("%-60s", " apr_palloc"); + alloc = apr_palloc(p, bytes); + if (!alloc) { + printf("Failed\n"); + exit(-1); + } + printf("OK\n"); + + printf("%-60s", " Checking entire allocation is writable"); + for (i=0;i Date: Sat, 12 Jan 2002 19:58:42 +0000 Subject: [PATCH 2766/7878] Add testshmproducer and testshmconsumer git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62770 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 10 ++- test/testshmconsumer.c | 154 +++++++++++++++++++++++++++++++++++++++ test/testshmproducer.c | 158 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 321 insertions(+), 1 deletion(-) create mode 100644 test/testshmconsumer.c create mode 100644 test/testshmproducer.c diff --git a/test/Makefile.in b/test/Makefile.in index 4aab043b1a7..cb0e3a44890 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -18,6 +18,8 @@ PROGRAMS = \ testud@EXEEXT@ \ testmmap@EXEEXT@ \ testshm@EXEEXT@ \ + testshmproducer@EXEEXT@ \ + testshmconsumer@EXEEXT@ \ testpipe@EXEEXT@ \ testoc@EXEEXT@ \ testuuid@EXEEXT@ \ @@ -115,9 +117,15 @@ testtime@EXEEXT@: testtime.lo $(LOCAL_LIBS) testmmap@EXEEXT@: testmmap.lo $(LOCAL_LIBS) $(LINK) testmmap.lo $(LOCAL_LIBS) $(ALL_LIBS) -testshm@EXEEXT@: testshm.lo $(LOCAL_LIBS) +testshm@EXEEXT@: testshm.lo $(LOCAL_LIBS) testshmproducer@EXEEXT@ testshmconsumer@EXEEXT@ $(LINK) testshm.lo $(LOCAL_LIBS) $(ALL_LIBS) +testshmproducer@EXEEXT@: testshmproducer.lo $(LOCAL_LIBS) + $(LINK) testshmproducer.lo $(LOCAL_LIBS) $(ALL_LIBS) + +testshmconsumer@EXEEXT@: testshmconsumer.lo $(LOCAL_LIBS) + $(LINK) testshmconsumer.lo $(LOCAL_LIBS) $(ALL_LIBS) + testpipe@EXEEXT@: testpipe.lo $(LOCAL_LIBS) $(LINK) testpipe.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/testshmconsumer.c b/test/testshmconsumer.c new file mode 100644 index 00000000000..a0b8758f1d6 --- /dev/null +++ b/test/testshmconsumer.c @@ -0,0 +1,154 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_shm.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include "apr_time.h" +#include +#include +#include +#if APR_HAVE_UNISTD_H +#include +#endif + +#if APR_HAS_SHARED_MEMORY + +typedef struct mbox { + char msg[1024]; + int msgavail; +} mbox; +mbox *boxes; + +#define N_BOXES 10 +#define SHARED_SIZE (apr_size_t)(N_BOXES * sizeof(mbox)) +#define SHARED_FILENAME "/tmp/apr.testshm.shm" + +static void msgwait(int sleep_sec, int first_box, int last_box) +{ + int i; + apr_time_t start = apr_time_now(); + while (apr_time_now() - start < sleep_sec * APR_USEC_PER_SEC) { + for (i = first_box; i < last_box; i++) { + if (boxes[i].msgavail) { + fprintf(stdout, "received a message in box %d, message was: %s\n", + i, boxes[i].msg); + boxes[i].msgavail = 0; /* reset back to 0 */ + } + } + apr_sleep(1*APR_USEC_PER_SEC); + } + fprintf(stdout, "done waiting on mailboxes...\n"); +} + +static void msgput(int boxnum, char *msg) +{ + fprintf(stdout, "Sending message to box %d\n", boxnum); + apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg)); + boxes[boxnum].msgavail = 1; +} + +int main(void) +{ + apr_status_t rv; + apr_pool_t *pool; + apr_shm_t *shm; + char errmsg[200]; + + apr_initialize(); + + printf("APR Shared Memory Test: CONSUMER\n"); + + printf("Initializing the pool............................"); + if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { + printf("could not initialize pool\n"); + exit(-1); + } + printf("OK\n"); + + rv = apr_shm_attach(&shm, SHARED_FILENAME, pool); + if (rv != APR_SUCCESS) { + printf("Unable to attach to name-based shared memory segment: " + "[%d] %s \n", rv, apr_strerror(rv, errmsg, sizeof(errmsg))); + exit(-2); + } + + boxes = apr_shm_baseaddr_get(shm); + + /* consume messages on all of the boxes */ + msgwait(30, 0, N_BOXES); /* wait for 30 seconds for messages */ + + rv = apr_shm_detach(shm); + if (rv != APR_SUCCESS) { + printf("Unable to detach from name-based shared memory segment: " + "[%d] %s \n", rv, apr_strerror(rv, errmsg, sizeof(errmsg))); + exit(-3); + } + + return 0; +} + +#else /* APR_HAS_SHARED_MEMORY */ + +int main(void) +{ + printf("APR SHMEM test not run!\n"); + printf("shmem is not supported on this platform\n"); + return -1; +} + +#endif /* APR_HAS_SHARED_MEMORY */ + diff --git a/test/testshmproducer.c b/test/testshmproducer.c new file mode 100644 index 00000000000..bf0295659cf --- /dev/null +++ b/test/testshmproducer.c @@ -0,0 +1,158 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_shm.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include "apr_time.h" +#include +#include +#include +#if APR_HAVE_UNISTD_H +#include +#endif + +#if APR_HAS_SHARED_MEMORY + +typedef struct mbox { + char msg[1024]; + int msgavail; +} mbox; +mbox *boxes; + +#define N_BOXES 10 +#define SHARED_SIZE (apr_size_t)(N_BOXES * sizeof(mbox)) +#define SHARED_FILENAME "/tmp/apr.testshm.shm" + +static void msgwait(int sleep_sec, int first_box, int last_box) +{ + int i; + apr_time_t start = apr_time_now(); + while (apr_time_now() - start < sleep_sec * APR_USEC_PER_SEC) { + for (i = first_box; i < last_box; i++) { + if (boxes[i].msgavail) { + fprintf(stdout, "received a message in box %d, message was: %s\n", + i, boxes[i].msg); + boxes[i].msgavail = 0; /* reset back to 0 */ + } + } + apr_sleep(1*APR_USEC_PER_SEC); + } + fprintf(stdout, "done waiting on mailboxes...\n"); +} + +static void msgput(int boxnum, char *msg) +{ + fprintf(stdout, "Sending message to box %d\n", boxnum); + apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg)); + boxes[boxnum].msgavail = 1; +} + +int main(void) +{ + apr_status_t rv; + apr_pool_t *pool; + apr_shm_t *shm; + int i; + char errmsg[200]; + + apr_initialize(); + + printf("APR Shared Memory Test: PRODUCER\n"); + + printf("Initializing the pool............................"); + if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { + printf("could not initialize pool\n"); + exit(-1); + } + printf("OK\n"); + + rv = apr_shm_attach(&shm, SHARED_FILENAME, pool); + if (rv != APR_SUCCESS) { + printf("Unable to attach to name-based shared memory segment: " + "[%d] %s \n", rv, apr_strerror(rv, errmsg, sizeof(errmsg))); + exit(-2); + } + + boxes = apr_shm_baseaddr_get(shm); + + /* produce messages on all of the boxes, in descending order */ + for (i = N_BOXES - 1; i > 0; i--) { + msgput(i, "Sending a message\n"); + apr_sleep(1*APR_USEC_PER_SEC); + } + + rv = apr_shm_detach(shm); + if (rv != APR_SUCCESS) { + printf("Unable to detach from name-based shared memory segment: " + "[%d] %s \n", rv, apr_strerror(rv, errmsg, sizeof(errmsg))); + exit(-3); + } + + return 0; +} + +#else /* APR_HAS_SHARED_MEMORY */ + +int main(void) +{ + printf("APR SHMEM test not run!\n"); + printf("shmem is not supported on this platform\n"); + return -1; +} + +#endif /* APR_HAS_SHARED_MEMORY */ + From 9a356c023550a44d61a7029e19f1d04bfc5c7cc7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 12 Jan 2002 20:34:07 +0000 Subject: [PATCH 2767/7878] get the seek position initialized so that the rewind works git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62771 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testdup.c b/test/testdup.c index ca1e35963fe..4649b30a0a3 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -95,6 +95,7 @@ int main (int argc, char ** argv) STD_TEST_NEQ(" Write to dup'd file (#3)", apr_file_write(file3, TEST, &txtlen)) + fpos = 0; STD_TEST_NEQ(" Rewind file #1 to start", apr_file_seek(file1, APR_SET, &fpos)) txtlen = 50; From 98c06c51d4c8da61c6f08debd346aca6e2ec6403 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 12 Jan 2002 20:42:01 +0000 Subject: [PATCH 2768/7878] account for some recent additions and a recent deletion (but I suspect there is other extra stuff in here) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62772 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/.cvsignore b/test/.cvsignore index 17f11c85aaf..bb18a3fecc4 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -10,12 +10,17 @@ testud testargs testdir testdso +testdup testfmt testhash testoc testpipe testpoll -testshmem +testpools +testshm +testshmconsumer +testshmproducer +testsleep teststr testtime testthread From 8fa92d183a2a618ed7a77a2a9755e88e2455d340 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 13 Jan 2002 02:12:25 +0000 Subject: [PATCH 2769/7878] Another update of the pools debug code. Stats are added. Unlike the old situation, stats are always on in APR_POOL_DEBUG mode, no need to seperately activate them. Debug output formatting is improved (IMHO). I actually got the concept from subversion for this. We now show (in _VERBOSE mode): - action (CREATE, CLEAR, DESTROY) - memory in the current pool - memory in the current pool and its children - total used memory - address of the pool - pools tag - file and line number the action takes place - stats for the pool - allocs since last clear - total allocs - clears (number of times apr_pool_clear is called on the pool). Moved the declaration of apr_pool_clear up so it sits in the same group it sits in in the .c file. Renamed the apr_pool_xxx_dbg functions to apr_pool_xxx_debug. It wasn't really worth shortening the names in the first place. The user will (in general) never call apr_pool_xxx_debug directly. Removed some stale @deffunc lines. Doxygen doesn't need them anyway. Tag the pool created in apr_initialize(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62773 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 72 +++++++++++++++++---------------- memory/unix/apr_pools.c | 88 ++++++++++++++++++++++++++++------------- misc/unix/start.c | 2 + 3 files changed, 99 insertions(+), 63 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 1ec5b8273d2..b552684d7a9 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -160,21 +160,22 @@ APR_DECLARE(void) apr_pool_terminate(void); */ #if defined(APR_POOL_DEBUG) #define apr_pool_create_ex(newpool, parent, abort_fn, flag) \ - apr_pool_create_ex_dbg(newpool, parent, abort_fn, flag, __FILE__, __LINE__) - -APR_DECLARE(apr_status_t) apr_pool_create_ex_dbg(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_uint32_t flags, - const char *file, - int line); -# + apr_pool_create_ex_debug(newpool, parent, abort_fn, flag, \ + __FILE__, __LINE__) + +APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_uint32_t flags, + const char *file, + int line); #else APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, apr_uint32_t flags); #endif + /** * Create a new pool. * @param newpool The pool we have just created. @@ -189,8 +190,8 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, #else #if defined(APR_POOL_DEBUG) #define apr_pool_create(newpool, parent) \ - apr_pool_create_ex_dbg(newpool, parent, NULL, APR_POOL_FDEFAULT, \ - __FILE__, __LINE__) + apr_pool_create_ex_debug(newpool, parent, NULL, APR_POOL_FDEFAULT, \ + __FILE__, __LINE__) #else #define apr_pool_create(newpool, parent) \ apr_pool_create_ex(newpool, parent, NULL, APR_POOL_FDEFAULT) @@ -202,7 +203,6 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, * @param newpool The new sub-pool * @param parent The pool to use as a parent pool * @param apr_abort A function to use if the pool cannot allocate more memory. - * @deffunc void apr_pool_sub_make(apr_pool_t **p, apr_pool_t *parent, int (*apr_abort)(int retcode), const char *created) * @remark The @a apr_abort function provides a way to quit the program if the * machine is out of memory. By default, APR will return on error. */ @@ -213,14 +213,33 @@ APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **newpool, #else #if defined(APR_POOL_DEBUG) #define apr_pool_sub_make(newpool, parent, abort_fn) \ - (void)apr_pool_create_ex_dbg(newpool, parent, abort_fn, APR_POOL_FDEFAULT, \ - __FILE__, __LINE__) + (void)apr_pool_create_ex_debug(newpool, parent, abort_fn, \ + APR_POOL_FDEFAULT, \ + __FILE__, __LINE__) #else #define apr_pool_sub_make(newpool, parent, abort_fn) \ (void)apr_pool_create_ex(newpool, parent, abort_fn, APR_POOL_FDEFAULT) #endif #endif +/** + * Clear all memory in the pool and run all the cleanups. This also destroys all + * subpools. + * @param p The pool to clear + * @remark This does not actually free the memory, it just allows the pool + * to re-use this memory for the next allocation. + * @see apr_pool_destroy() + */ +#if defined(APR_POOL_DEBUG) +#define apr_pool_clear(p) \ + apr_pool_clear_debug(p, __FILE__, __LINE__) + +APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p, + const char *file, int line); +#else +APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); +#endif + /** * Destroy the pool. This takes similar action as apr_pool_clear() and then * frees all the memory. @@ -229,13 +248,15 @@ APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **newpool, */ #if defined(APR_POOL_DEBUG) #define apr_pool_destroy(p) \ - apr_pool_destroy_dbg(p, __FILE__, __LINE__) + apr_pool_destroy_debug(p, __FILE__, __LINE__) -APR_DECLARE(void) apr_pool_destroy_dbg(apr_pool_t *p, const char *file, int line); +APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, + const char *file, int line); #else APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); #endif + /* * Memory allocation */ @@ -256,22 +277,6 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t reqsize); */ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); -/** - * Clear all memory in the pool and run all the cleanups. This also clears all - * subpools. - * @param p The pool to clear - * @remark This does not actually free the memory, it just allows the pool - * to re-use this memory for the next allocation. - * @see apr_pool_destroy() - */ -#if defined(APR_POOL_DEBUG) -#define apr_pool_clear(p) \ - apr_pool_clear_dbg(p, __FILE__, __LINE__) - -APR_DECLARE(void) apr_pool_clear_dbg(apr_pool_t *p, const char *file, int line); -#else -APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); -#endif /* * Pool Properties @@ -284,7 +289,6 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); * performing cleanup and then exiting). If this function is not called, * then APR will return an error and expect the calling program to * deal with the error accordingly. - * @deffunc apr_status_t apr_pool_set_abort(apr_abortfunc_t abortfunc, apr_pool_t *pool) */ APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abortfunc, apr_pool_t *pool); @@ -293,7 +297,6 @@ APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abortfunc, * Get the abort function associated with the specified pool. * @param pool The pool for retrieving the abort function. * @return The abort function for the given pool. - * @deffunc apr_abortfunc_t apr_pool_get_abort(apr_pool_t *pool) */ APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool); @@ -301,7 +304,6 @@ APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool); * Get the parent pool of the specified pool. * @param pool The pool for retrieving the parent pool. * @return The parent of the given pool. - * @deffunc apr_pool_t * apr_pool_get_parent(apr_pool_t *pool) */ APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool); diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 65cce344e8c..3330d3ed643 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -163,6 +163,9 @@ struct apr_pool_t { debug_node_t *nodes; const char *file; int line; + unsigned int stat_alloc; + unsigned int stat_total_alloc; + unsigned int stat_clear; #if APR_HAS_THREADS apr_thread_mutex_t *mutex; #endif @@ -833,6 +836,11 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) if (apr_pools_initialized++) return APR_SUCCESS; + /* Since the debug code works a bit differently then the + * regular pools code, we ask for a lock here. The regular + * pools code has got this lock embedded in the global + * allocator, a concept unknown to debug mode. + */ if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, APR_POOL_FNEW_ALLOCATOR|APR_POOL_FLOCK)) != APR_SUCCESS) { return rv; @@ -846,7 +854,12 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) apr_file_open_stderr(&file_stderr, global_pool); if (file_stderr) { apr_file_printf(file_stderr, - "POOL DEBUG: GLOBAL 0x%08X(%s)\n", + "POOL DEBUG: ACTION [SIZE /POOL SIZE /TOTAL SIZE] " + "POOL TAG [__FILE__:__LINE__] (ALLOCS/TOTAL ALLOCS/CLEARS)\n"); + + apr_file_printf(file_stderr, + "POOL DEBUG: GLOBAL " + "0x%08X \"%s\"\n", (unsigned int)global_pool, global_pool->tag); } #endif @@ -905,7 +918,9 @@ static void check_integrity(apr_pool_t *pool) #if defined(APR_POOL_DEBUG_VERBOSE) if (file_stderr) { apr_file_printf(file_stderr, - "POOL DEBUG: INVALID 0x%08X, abort().\n", (unsigned int)pool); + "POOL DEBUG: INVALID " + "0x%08X, abort().\n", + (unsigned int)pool); } #endif @@ -949,6 +964,9 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) node->endp[node->index] = (char *)mem + size; node->index++; + pool->stat_alloc++; + pool->stat_total_alloc++; + return mem; } @@ -969,7 +987,7 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) * Pool creation/destruction (debug) */ -static void pool_clear_dbg(apr_pool_t *pool, const char *file, int line) +static void pool_clear_debug(apr_pool_t *pool, const char *file, int line) { debug_node_t *node; apr_uint32_t index; @@ -978,7 +996,7 @@ static void pool_clear_dbg(apr_pool_t *pool, const char *file, int line) * this pool thus this loop is safe and easy. */ while (pool->child) - apr_pool_destroy_dbg(pool->child, file, line); + apr_pool_destroy_debug(pool->child, file, line); /* Run cleanups */ run_cleanups(pool->cleanups); @@ -1000,40 +1018,51 @@ static void pool_clear_dbg(apr_pool_t *pool, const char *file, int line) free(node); } + + pool->stat_alloc = 0; + pool->stat_clear++; } -APR_DECLARE(void) apr_pool_clear_dbg(apr_pool_t *pool, - const char *file, int line) +APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, + const char *file, int line) { check_integrity(pool); #if defined(APR_POOL_DEBUG_VERBOSE) if (file_stderr) { apr_file_printf(file_stderr, - "POOL DEBUG: CLEAR 0x%08X(%s) [%s:%d]\n", + "POOL DEBUG: CLEAR [%10lu/%10lu/%10lu] 0x%08X \"%s\" [%s:%d] (%u/%u/%u)\n", + (unsigned long)apr_pool_num_bytes(pool, 0), + (unsigned long)apr_pool_num_bytes(pool, 1), + (unsigned long)apr_pool_num_bytes(global_pool, 1), (unsigned int)pool, pool->tag, - file, line); + file, line, + pool->stat_alloc, pool->stat_total_alloc, pool->stat_clear); } #endif - pool_clear_dbg(pool, file, line); + pool_clear_debug(pool, file, line); } -APR_DECLARE(void) apr_pool_destroy_dbg(apr_pool_t *pool, - const char *file, int line) +APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, + const char *file, int line) { check_integrity(pool); #if defined(APR_POOL_DEBUG_VERBOSE) if (file_stderr) { apr_file_printf(file_stderr, - "POOL DEBUG: DESTROY 0x%08X(%s) [%s:%u]\n", + "POOL DEBUG: DESTROY [%10lu/%10lu/%10lu] 0x%08X \"%s\" [%s:%d] (%u/%u/%u)\n", + (unsigned long)apr_pool_num_bytes(pool, 0), + (unsigned long)apr_pool_num_bytes(pool, 1), + (unsigned long)apr_pool_num_bytes(global_pool, 1), (unsigned int)pool, pool->tag, - file, line); + file, line, + pool->stat_alloc, pool->stat_total_alloc, pool->stat_clear); } #endif - pool_clear_dbg(pool, file, line); + pool_clear_debug(pool, file, line); /* Remove the pool from the parents child list */ if (pool->parent) { @@ -1057,12 +1086,12 @@ APR_DECLARE(void) apr_pool_destroy_dbg(apr_pool_t *pool, free(pool); } -APR_DECLARE(apr_status_t) apr_pool_create_ex_dbg(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_uint32_t flags, - const char *file, - int line) +APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_uint32_t flags, + const char *file, + int line) { apr_pool_t *pool; @@ -1136,10 +1165,13 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_dbg(apr_pool_t **newpool, #if defined(APR_POOL_DEBUG_VERBOSE) if (file_stderr) { apr_file_printf(file_stderr, - "POOL DEBUG: CREATE 0x%08X(%s) parent = 0x%08X(%s) [%s:%u]\n", + "POOL DEBUG: CREATE [%10lu/%10lu/%10lu] 0x%08X \"%s\" [%s:%u] parent: 0x%08X \"%s\"\n", + (unsigned long)0, + (unsigned long)0, + (unsigned long)apr_pool_num_bytes(global_pool, 1), (unsigned int)pool, pool->tag, - (unsigned int)parent, parent ? parent->tag : "", - file, line); + file, line, + (unsigned int)parent, parent ? parent->tag : ""); } #endif @@ -1158,7 +1190,7 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool); APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) { - apr_pool_clear_dbg(pool, "", 0); + apr_pool_clear_debug(pool, "", 0); } #undef apr_pool_destroy @@ -1166,7 +1198,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool); APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) { - apr_pool_destroy_dbg(pool, "", 0); + apr_pool_destroy_debug(pool, "", 0); } #undef apr_pool_create_ex @@ -1180,9 +1212,9 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_uint32_t flags) { - return apr_pool_create_ex_dbg(newpool, parent, - abort_fn, flags, - "", 0); + return apr_pool_create_ex_debug(newpool, parent, + abort_fn, flags, + "", 0); } diff --git a/misc/unix/start.c b/misc/unix/start.c index 220a0afd1f5..bb8b05c1dc3 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -99,6 +99,8 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_ENOPOOL; } + apr_pool_tag(pool, "apr_initilialize"); + #ifdef WIN32 /* Initialize apr_os_level global */ if (apr_get_oslevel(pool, &osver) != APR_SUCCESS) { From d81823d77266a96e6b9c651981a9cd2b783f1edd Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 13 Jan 2002 04:15:50 +0000 Subject: [PATCH 2770/7878] Add --with-efence to allow usage of Electric Fence. Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62774 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ configure.in | 22 +++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index a081a24a4a0..cb72365aaf7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR b1 + + *) Add --with-efence to allow usage of Electric Fence. + [Justin Erenkrantz] + *) Updated the pools debug code. Check if a pool is still valid on the most common apr_pool_xxx functions. Fix the way APR_POOL_DEBUG_VERBOSE was using stderr. diff --git a/configure.in b/configure.in index 2c2af03a5f3..5a494c0403e 100644 --- a/configure.in +++ b/configure.in @@ -131,12 +131,15 @@ else fi dnl On AIX, libraries need to be specified on the link of lib_target +lib_target_libs="" case $host in *aix*) lib_target_libs="\$(EXTRA_LIBS)"; ;; + *-solaris2*) + apr_platform_runtime_link_flag="-R" + ;; *) - lib_target_libs="" ;; esac @@ -185,6 +188,23 @@ AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build fi )dnl +dnl Electric Fence malloc checker. +dnl --with-efence specifies the path to Electric Fence +AC_ARG_WITH(efence, + [ --with-efence[[=DIR]] path to Electric Fence installation], + [ apr_efence_dir="$withval" + if test "$apr_efence_dir" != "yes"; then + APR_ADDTO(LDFLAGS,[-L$apr_efence_dir/lib]) + if test "x$apr_platform_runtime_link_flag" != "x"; then + APR_ADDTO(LDFLAGS, + [$apr_platform_runtime_link_flag$apr_efence_dir/lib]) + fi + fi + AC_CHECK_LIB(efence, malloc, + [ APR_ADDTO(LIBS,-lefence) ], + [ AC_MSG_ERROR(Electric Fence requested but not detected) ]) + ]) + if test "$host" = "i586-pc-beos"; then AC_ARG_ENABLE(malloc-debug,[ --enable-malloc-debug Switch on malloc_debug for BeOS], APR_REMOVEFROM(CFLAGS, -O2) From ff8483f68c67ddc2e67017fae820a89c55addbb3 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 13 Jan 2002 04:20:10 +0000 Subject: [PATCH 2771/7878] Fix egd help string format. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62775 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 5a494c0403e..ee2d7d95763 100644 --- a/configure.in +++ b/configure.in @@ -1257,7 +1257,7 @@ else ;; *) AC_ARG_WITH(egd, - [ --with-egd= use egd-compatible socket], + [ --with-egd= use egd-compatible socket], [ if test "$withval" = "yes"; then AC_ERROR([You must specify a default EGD socket path.]) fi From d1359a2d59b2303a7038bdf435ec89f3795d2ad6 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 13 Jan 2002 04:58:44 +0000 Subject: [PATCH 2772/7878] Since I actually spent the time to gather the autoconf magic, it turns out that Linux/glibc doesn't support largefiles/sendfile together, so downgrade it from a release showstopper to a "nice to have" issue. Include a link to apr_largefile.m4 in case someone feels like taking this on. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62776 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/STATUS b/STATUS index 357de8e6b7a..7894f8c6165 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/01/12 17:18:37 $] +Last modified at [$Date: 2002/01/13 04:58:44 $] Release: @@ -44,16 +44,14 @@ RELEASE SHOWSTOPPERS: Win32: apr_thread_rwlock_try*lock(), apr_thread_cond_timedwait(), apr_proc_mutex_*() (Is proc_mutex unnecessary on Win32?) - * Deal with largefiles properly on those platforms that support - it. - Justin says: We may be able to get away with setting - FILE_OFFSET_BITS=64 on most current Unices. - The other question remains if this should be turned - on by default (i.e. pass O_LARGEFILE or whatnot on - that platform). I think so. - RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * Deal with largefiles properly on those platforms that support it. + + Justin says: Linux refuses to have largefile support and largefiles + at the sametime. Largefile autoconf patch: + http://www.apache.org/~jerenkrantz/apr_largefile.m4 + * Get OTHER_CHILD support into Win32 Status: Bill S. is looking into this From 5cae2cb78d8a2846fed5ce63eaa22aef4856ad9d Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 13 Jan 2002 14:03:27 +0000 Subject: [PATCH 2773/7878] After running testshm, this commit gets us passing all the tests OK. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62777 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/beos/shm.c | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index cfbe486ce69..94c8b28b2ef 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -78,14 +78,12 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, apr_size_t pagesize; area_id newid; char *addr; - char area_name[32]; (*m) = (apr_shm_t *)apr_pcalloc(p, sizeof(apr_shm_t)); /* we MUST allocate in pages, so calculate how big an area we need... */ pagesize = ((reqsize + B_PAGE_SIZE - 1) / B_PAGE_SIZE) * B_PAGE_SIZE; - sprintf(area_name, "apr_shm:%ld:%ld",find_thread(NULL), pagesize); - newid = create_area(area_name, (void*)&addr, B_ANY_ADDRESS, + newid = create_area(file, (void*)&addr, B_ANY_ADDRESS, pagesize, B_CONTIGUOUS, B_READ_AREA|B_WRITE_AREA); if (newid < 0) @@ -116,20 +114,40 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, { area_info ai; thread_info ti; - area_id deleteme = (*m)->aid; - int offs = ((char*)(*m)->ptr) - ((char*)(*m)->memblock); + area_id deleteme; + apr_shm_t *new_m; + deleteme = find_area(filename); + if (deleteme == B_NAME_NOT_FOUND) + return APR_EINVAL; + + new_m = (apr_shm_t*)apr_palloc(pool, sizeof(apr_shm_t*)); + if (new_m == NULL) + return APR_ENOMEM; + new_m->pool = pool; + get_area_info(deleteme, &ai); get_thread_info(find_thread(NULL), &ti); - + if (ti.team != ai.team) { - delete_area(deleteme); - (*m)->aid = clone_area(ai.name, &(ai.address), B_CLONE_ADDRESS, - B_READ_AREA | B_WRITE_AREA, ai.area); - get_area_info((*m)->aid, &ai); - (*m)->memblock = ai.address; - (*m)->ptr = (void*)ai.address + offs; + area_id narea; + + narea = clone_area(ai.name, &(ai.address), B_CLONE_ADDRESS, + B_READ_AREA|B_WRITE_AREA, ai.area); + + if (narea < B_OK) + return narea; + + get_area_info(narea, &ai); + new_m->aid = narea; + new_m->memblock = ai.address; + new_m->ptr = (void*)ai.address; + new_m->avail = ai.size; + new_m->reqsize = ai.size; } + + (*m) = new_m; + return APR_SUCCESS; } From 2dbe1398c18910b1307dea9645667eaaab2789f7 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 13 Jan 2002 14:38:38 +0000 Subject: [PATCH 2774/7878] No point in using apr_pcalloc when we then go on to use FD_ZERO is there? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62778 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/poll.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index 3cc2e2b7baa..7812bbb203d 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -70,16 +70,18 @@ APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num); + if ((*new) == NULL) { return APR_ENOMEM; } + (*new)->cntxt = cont; - (*new)->read = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); - (*new)->except = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); - (*new)->read_set = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); - (*new)->write_set = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); - (*new)->except_set = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); + (*new)->read = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->write = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->except = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->read_set = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->write_set = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->except_set = (fd_set *)apr_palloc(cont, sizeof(fd_set)); FD_ZERO((*new)->read); FD_ZERO((*new)->write); FD_ZERO((*new)->except); @@ -87,6 +89,7 @@ APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, ap FD_ZERO((*new)->write_set); FD_ZERO((*new)->except_set); (*new)->highsock = -1; + return APR_SUCCESS; } From 87e5e380eebacf357473fced760b4cb2b236fa73 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 13 Jan 2002 15:08:12 +0000 Subject: [PATCH 2775/7878] Again, no need to use apr_pcalloc as we then do FD_ZERO, so change to use the cheaper call to apr_palloc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62779 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/poll.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index 5e832fdcd47..b956a0d2195 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -229,12 +229,12 @@ apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->read = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); - (*new)->except = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); - (*new)->read_set = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); - (*new)->write_set = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); - (*new)->except_set = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); + (*new)->read = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->write = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->except = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->read_set = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->write_set = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->except_set = (fd_set *)apr_palloc(cont, sizeof(fd_set)); FD_ZERO((*new)->read); FD_ZERO((*new)->write); FD_ZERO((*new)->except); From 6c1739aee1f01fcc76115c00be524d697e6a5d27 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 13 Jan 2002 18:46:24 +0000 Subject: [PATCH 2776/7878] Supply a default tag in debug mode. The tag is the location where the pool was created. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62780 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 22 +++++++++++++--------- memory/unix/apr_pools.c | 41 +++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index b552684d7a9..078820e1b29 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -100,6 +100,11 @@ extern "C" { #if defined(APR_POOL_DEBUG_VERBOSE) && !defined(APR_POOL_DEBUG) #define APR_POOL_DEBUG #endif + +#define APR_POOL_STRINGIZE(x) APR_POOL__STRINGIZE(x) +#define APR_POOL__STRINGIZE(x) #x +#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_POOL_STRINGIZE(__LINE__) + /** The fundamental pool type */ typedef struct apr_pool_t apr_pool_t; @@ -161,14 +166,13 @@ APR_DECLARE(void) apr_pool_terminate(void); #if defined(APR_POOL_DEBUG) #define apr_pool_create_ex(newpool, parent, abort_fn, flag) \ apr_pool_create_ex_debug(newpool, parent, abort_fn, flag, \ - __FILE__, __LINE__) + APR_POOL__FILE_LINE__) APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, apr_uint32_t flags, - const char *file, - int line); + const char *file_line); #else APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *parent, @@ -191,7 +195,7 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, #if defined(APR_POOL_DEBUG) #define apr_pool_create(newpool, parent) \ apr_pool_create_ex_debug(newpool, parent, NULL, APR_POOL_FDEFAULT, \ - __FILE__, __LINE__) + APR_POOL__FILE_LINE__) #else #define apr_pool_create(newpool, parent) \ apr_pool_create_ex(newpool, parent, NULL, APR_POOL_FDEFAULT) @@ -215,7 +219,7 @@ APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **newpool, #define apr_pool_sub_make(newpool, parent, abort_fn) \ (void)apr_pool_create_ex_debug(newpool, parent, abort_fn, \ APR_POOL_FDEFAULT, \ - __FILE__, __LINE__) + APR_POOL__FILE_LINE__) #else #define apr_pool_sub_make(newpool, parent, abort_fn) \ (void)apr_pool_create_ex(newpool, parent, abort_fn, APR_POOL_FDEFAULT) @@ -232,10 +236,10 @@ APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **newpool, */ #if defined(APR_POOL_DEBUG) #define apr_pool_clear(p) \ - apr_pool_clear_debug(p, __FILE__, __LINE__) + apr_pool_clear_debug(p, APR_POOL__FILE_LINE__) APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p, - const char *file, int line); + const char *file_line); #else APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); #endif @@ -248,10 +252,10 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); */ #if defined(APR_POOL_DEBUG) #define apr_pool_destroy(p) \ - apr_pool_destroy_debug(p, __FILE__, __LINE__) + apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__) APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, - const char *file, int line); + const char *file_line); #else APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); #endif diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 3330d3ed643..fb3e347ca8a 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -161,8 +161,7 @@ struct apr_pool_t { #else /* !defined(APR_POOL_DEBUG) */ debug_node_t *nodes; - const char *file; - int line; + const char *file_line; unsigned int stat_alloc; unsigned int stat_total_alloc; unsigned int stat_clear; @@ -987,7 +986,7 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) * Pool creation/destruction (debug) */ -static void pool_clear_debug(apr_pool_t *pool, const char *file, int line) +static void pool_clear_debug(apr_pool_t *pool, const char *file_line) { debug_node_t *node; apr_uint32_t index; @@ -996,7 +995,7 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file, int line) * this pool thus this loop is safe and easy. */ while (pool->child) - apr_pool_destroy_debug(pool->child, file, line); + apr_pool_destroy_debug(pool->child, file_line); /* Run cleanups */ run_cleanups(pool->cleanups); @@ -1024,45 +1023,45 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file, int line) } APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, - const char *file, int line) + const char *file_line) { check_integrity(pool); #if defined(APR_POOL_DEBUG_VERBOSE) if (file_stderr) { apr_file_printf(file_stderr, - "POOL DEBUG: CLEAR [%10lu/%10lu/%10lu] 0x%08X \"%s\" [%s:%d] (%u/%u/%u)\n", + "POOL DEBUG: CLEAR [%10lu/%10lu/%10lu] 0x%08X \"%s\" [%s] (%u/%u/%u)\n", (unsigned long)apr_pool_num_bytes(pool, 0), (unsigned long)apr_pool_num_bytes(pool, 1), (unsigned long)apr_pool_num_bytes(global_pool, 1), (unsigned int)pool, pool->tag, - file, line, + file_line, pool->stat_alloc, pool->stat_total_alloc, pool->stat_clear); } #endif - pool_clear_debug(pool, file, line); + pool_clear_debug(pool, file_line); } APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, - const char *file, int line) + const char *file_line) { check_integrity(pool); #if defined(APR_POOL_DEBUG_VERBOSE) if (file_stderr) { apr_file_printf(file_stderr, - "POOL DEBUG: DESTROY [%10lu/%10lu/%10lu] 0x%08X \"%s\" [%s:%d] (%u/%u/%u)\n", + "POOL DEBUG: DESTROY [%10lu/%10lu/%10lu] 0x%08X \"%s\" [%s] (%u/%u/%u)\n", (unsigned long)apr_pool_num_bytes(pool, 0), (unsigned long)apr_pool_num_bytes(pool, 1), (unsigned long)apr_pool_num_bytes(global_pool, 1), (unsigned int)pool, pool->tag, - file, line, + file_line, pool->stat_alloc, pool->stat_total_alloc, pool->stat_clear); } #endif - pool_clear_debug(pool, file, line); + pool_clear_debug(pool, file_line); /* Remove the pool from the parents child list */ if (pool->parent) { @@ -1090,8 +1089,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, apr_uint32_t flags, - const char *file, - int line) + const char *file_line) { apr_pool_t *pool; @@ -1115,9 +1113,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, memset(pool, 0, SIZEOF_POOL_T); pool->abort_fn = abort_fn; - pool->tag = ""; - pool->file = file; - pool->line = line; + pool->tag = file_line; + pool->file_line = file_line; if ((flags & APR_POOL_FNEW_ALLOCATOR) == APR_POOL_FNEW_ALLOCATOR) { #if APR_HAS_THREADS @@ -1165,12 +1162,12 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, #if defined(APR_POOL_DEBUG_VERBOSE) if (file_stderr) { apr_file_printf(file_stderr, - "POOL DEBUG: CREATE [%10lu/%10lu/%10lu] 0x%08X \"%s\" [%s:%u] parent: 0x%08X \"%s\"\n", + "POOL DEBUG: CREATE [%10lu/%10lu/%10lu] 0x%08X \"%s\" [%s] parent: 0x%08X \"%s\"\n", (unsigned long)0, (unsigned long)0, (unsigned long)apr_pool_num_bytes(global_pool, 1), (unsigned int)pool, pool->tag, - file, line, + file_line, (unsigned int)parent, parent ? parent->tag : ""); } #endif @@ -1190,7 +1187,7 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool); APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) { - apr_pool_clear_debug(pool, "", 0); + apr_pool_clear_debug(pool, ""); } #undef apr_pool_destroy @@ -1198,7 +1195,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool); APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) { - apr_pool_destroy_debug(pool, "", 0); + apr_pool_destroy_debug(pool, ""); } #undef apr_pool_create_ex @@ -1214,7 +1211,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, { return apr_pool_create_ex_debug(newpool, parent, abort_fn, flags, - "", 0); + ""); } From 2e0ead141ea01c13773352a4a5883f4977a4af55 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 14 Jan 2002 02:21:40 +0000 Subject: [PATCH 2777/7878] This patch basically allows BeOS R5's apr_poll to work like it should do! Essentially R5 is very fast to return if you have a socket available, but if you have more than one you'll only get the first one! hence, we now track how many socket/checks we're trying for and if we don't have all of them (which let's face it seems unlikely) we quickly see if any more sockets are available for us. Messy, but it works :) I've added checking for the lowsocket to reduce the range of sockets we check. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62781 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/networkio.h | 4 ++ network_io/beos/poll.c | 95 +++++++++++++++++++++++++++++++++-- 2 files changed, 95 insertions(+), 4 deletions(-) diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index c8803e08ce0..b0ca969b57a 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -154,6 +154,10 @@ struct apr_pollfd_t { fd_set *except_set; apr_int16_t *events; apr_int16_t *revents; +#ifdef BEOS + int lowsock; + int ncks; +#endif #endif }; diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index 7812bbb203d..62bf6700ab9 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -67,6 +67,25 @@ * select for R4.5 of BeOS. So here we use code that uses the write * bits. */ + +static void ck_ncks(apr_pollfd_t *pfd) +{ + int i; + + pfd->ncks = 0; + for (i=pfd->lowsock;i <= pfd->highsock;i++) { + if (FD_ISSET(i, pfd->read_set)) { + pfd->ncks++; + } + if (FD_ISSET(i, pfd->write_set)) { + pfd->ncks++; + } + if (FD_ISSET(i, pfd->except_set)) { + pfd->ncks++; + } + } +} + APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num); @@ -89,7 +108,8 @@ APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, ap FD_ZERO((*new)->write_set); FD_ZERO((*new)->except_set); (*new)->highsock = -1; - + (*new)->ncks = 0; + (*new)->lowsock = -1; return APR_SUCCESS; } @@ -98,16 +118,22 @@ APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, { if (event & APR_POLLIN) { FD_SET(sock->socketdes, aprset->read_set); + aprset->ncks++; } if (event & APR_POLLPRI) { FD_SET(sock->socketdes, aprset->read_set); + aprset->ncks++; } if (event & APR_POLLOUT) { FD_SET(sock->socketdes, aprset->write_set); + aprset->ncks++; } if (sock->socketdes > aprset->highsock) { aprset->highsock = sock->socketdes; } + if (sock->socketdes < aprset->lowsock || aprset->lowsock == -1) { + aprset->lowsock = sock->socketdes; + } return APR_SUCCESS; } @@ -117,12 +143,15 @@ APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, { if (events & APR_POLLIN) { FD_CLR(sock->socketdes, aprset->read_set); + aprset->ncks--; } if (events & APR_POLLPRI) { FD_CLR(sock->socketdes, aprset->except_set); + aprset->ncks--; } if (events & APR_POLLOUT) { FD_CLR(sock->socketdes, aprset->write_set); + aprset->ncks--; } return APR_SUCCESS; } @@ -142,13 +171,64 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, tvptr = &tv; } - memcpy(aprset->read, aprset->read_set, sizeof(fd_set)); - memcpy(aprset->write, aprset->write_set, sizeof(fd_set)); + memcpy(aprset->read, aprset->read_set, sizeof(fd_set)); + memcpy(aprset->write, aprset->write_set, sizeof(fd_set)); memcpy(aprset->except, aprset->except_set, sizeof(fd_set)); rv = select(aprset->highsock + 1, aprset->read, aprset->write, aprset->except, tvptr); - + + /* Often we won't see anything beyond the first socket that's + * available, so here we check for any more... Without this we + * really do what we want to with this call - annoying isn't it? + */ + if (rv > 0 && rv < aprset->ncks) { + while (1) { + fd_set ckr, ckw, cke; + int i; + FD_ZERO(&ckr); + FD_ZERO(&ckw); + FD_ZERO(&cke); + for (i=aprset->lowsock;i <= aprset->highsock;i++) { + if (FD_ISSET(i, aprset->read_set) && + !FD_ISSET(i, aprset->read)) { + FD_SET(i, &ckr); + } + if (FD_ISSET(i, aprset->write_set) && + !FD_ISSET(i, aprset->write)) { + FD_SET(i, &ckw); + } + if (FD_ISSET(i, aprset->except_set) && + !FD_ISSET(i, aprset->except)) { + FD_SET(i, &cke); + } + + } + /* set these to zero for an immeadiate return */ + tv.tv_sec = 0; + tv.tv_usec = 0; + i = select(aprset->highsock + 1, &ckr, &ckw, &cke, tvptr); + if (i > 0) { + for (i=aprset->lowsock;i <= aprset->highsock;i++) { + if (FD_ISSET(i, &ckr)) { + FD_SET(i, aprset->read); + rv++; + } + if (FD_ISSET(i, &ckw)) { + FD_SET(i, aprset->write); + rv++; + } + if (FD_ISSET(i, &cke)) { + FD_SET(i, aprset->except); + rv++; + } + } + } else { + break; + } + } + } + (*nsds) = rv; if ((*nsds) == 0) { return APR_TIMEUP; @@ -205,8 +285,14 @@ APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { + if (FD_ISSET(sock->socketdes, aprset->read_set)) + aprset->ncks--; FD_CLR(sock->socketdes, aprset->read_set); + if (FD_ISSET(sock->socketdes, aprset->except_set)) + aprset->ncks--; FD_CLR(sock->socketdes, aprset->except_set); + if (FD_ISSET(sock->socketdes, aprset->write_set)) + aprset->ncks--; FD_CLR(sock->socketdes, aprset->write_set); return APR_SUCCESS; } @@ -223,6 +309,7 @@ APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_ FD_ZERO(aprset->write_set); } aprset->highsock = 0; + ck_ncks(aprset); return APR_SUCCESS; } From 470c3150a80b6f24d54f879b44328dbcfe47c702 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 14 Jan 2002 09:18:40 +0000 Subject: [PATCH 2778/7878] Fix the lifetime checking by locking the childlist before traversing it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62782 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 50 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index fb3e347ca8a..8f5657690d3 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -888,31 +888,75 @@ APR_DECLARE(void) apr_pool_terminate(void) * destroyed, in which case we abort(). */ +#if APR_HAS_THREADS +static int pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent, + apr_thread_mutex_t *mutex) +{ + apr_pool_t *child; + + if (parent == NULL) + return 0; + +#if APR_HAS_THREADS + if (parent->mutex && parent->mutex != mutex) + apr_thread_mutex_lock(parent->mutex); +#endif + + child = parent->child; + + while (child) { + if (pool == child || pool_is_child_of(pool, child, parent->mutex)) { +#if APR_HAS_THREADS + if (parent->mutex && parent->mutex != mutex) + apr_thread_mutex_unlock(parent->mutex); +#endif + + return 1; + } + + child = child->sibling; + } + +#if APR_HAS_THREADS + if (parent->mutex && parent->mutex != mutex) + apr_thread_mutex_unlock(parent->mutex); +#endif + + return 0; +} + +#else static int pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent) { apr_pool_t *child; - + if (parent == NULL) return 0; child = parent->child; while (child) { - if (pool == child || pool_is_child_of(pool, child)) + if (pool == child || pool_is_child_of(pool, child)) { return 1; - + } + child = child->sibling; } return 0; } +#endif static void check_integrity(apr_pool_t *pool) { if (pool == global_pool || global_pool == NULL) return; +#if APR_HAS_THREADS + if (!pool_is_child_of(pool, global_pool, NULL)) +#else if (!pool_is_child_of(pool, global_pool)) +#endif { #if defined(APR_POOL_DEBUG_VERBOSE) if (file_stderr) { From 77ef6a277af7e44681392375083f71d7ab50dd4b Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 14 Jan 2002 09:31:57 +0000 Subject: [PATCH 2779/7878] Remove some redundant #if APR_HAS_THREADS. Meant to remove them, but forgot. Spotted by Greg Stein. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62783 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 8f5657690d3..1b13051e633 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -897,19 +897,15 @@ static int pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent, if (parent == NULL) return 0; -#if APR_HAS_THREADS if (parent->mutex && parent->mutex != mutex) apr_thread_mutex_lock(parent->mutex); -#endif child = parent->child; while (child) { if (pool == child || pool_is_child_of(pool, child, parent->mutex)) { -#if APR_HAS_THREADS if (parent->mutex && parent->mutex != mutex) apr_thread_mutex_unlock(parent->mutex); -#endif return 1; } @@ -917,10 +913,8 @@ static int pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent, child = child->sibling; } -#if APR_HAS_THREADS if (parent->mutex && parent->mutex != mutex) apr_thread_mutex_unlock(parent->mutex); -#endif return 0; } From 38943d7c0f2f012cc89a09eb21ec6ddac5d95074 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 14 Jan 2002 10:05:15 +0000 Subject: [PATCH 2780/7878] Some more pools thoughts... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62784 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 7894f8c6165..b590e81fe29 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/01/13 04:58:44 $] +Last modified at [$Date: 2002/01/14 10:05:15 $] Release: @@ -46,6 +46,14 @@ RELEASE SHOWSTOPPERS: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * Implement apr_pool_join and apr_pool_lock. Those functions + are noops at the moment. + + * Add stats to the pools code. We already have basic stats + in debug mode. Stats that tell us about wasted memory + in the production code require more thought. + Status: Sander Striker is looking into this (low priority) + * Deal with largefiles properly on those platforms that support it. Justin says: Linux refuses to have largefile support and largefiles From 007e4cab389378aa41e679c6f3537b22b1a3b680 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 14 Jan 2002 11:13:52 +0000 Subject: [PATCH 2781/7878] Fix some preprocessor logic. Ie. change #if APR_POOL_DEBUG_VERBOSE to #if defined(APR_POOL_DEBUG_VERBOSE). Submitted by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62785 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 1b13051e633..0323129d9ec 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -849,7 +849,7 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) apr_pools_initialized = 1; -#if APR_POOL_DEBUG_VERBOSE +#if defined(APR_POOL_DEBUG_VERBOSE) apr_file_open_stderr(&file_stderr, global_pool); if (file_stderr) { apr_file_printf(file_stderr, @@ -876,7 +876,7 @@ APR_DECLARE(void) apr_pool_terminate(void) apr_pool_destroy(global_pool); /* This will also destroy the mutex */ global_pool = NULL; -#if APR_POOL_DEBUG_VERBOSE +#if defined(APR_POOL_DEBUG_VERBOSE) file_stderr = NULL; #endif } From 581a6a469ae26598f2b403a19384bd9a06bd2e6e Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 14 Jan 2002 12:13:53 +0000 Subject: [PATCH 2782/7878] Fix for the simple stats in debug mode. This was the same problem as with the integrity check; we were traversing the hierarchy without doing proper locking. Now we are. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62786 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 53 ++++++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 0323129d9ec..02e8de457b6 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1388,23 +1388,60 @@ static apr_size_t pool_num_bytes(apr_pool_t *pool) return size; } -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *pool, int recurse) +#if APR_HAS_THREADS +static apr_size_t pool_num_bytes_recursive(apr_pool_t *pool, + apr_thread_mutex_t *mutex) { apr_size_t size; + apr_pool_t *child; size = pool_num_bytes(pool); - if (recurse) { - pool = pool->child; - - while (pool) { - size += apr_pool_num_bytes(pool, 1); + if (pool->mutex && pool->mutex != mutex) { + apr_thread_mutex_lock(pool->mutex); + } - pool = pool->sibling; - } + child = pool->child; + while (child) { + size += pool_num_bytes_recursive(child, pool->mutex); + + child = child->sibling; + } + + if (pool->mutex && pool->mutex != mutex) { + apr_thread_mutex_unlock(pool->mutex); + } + + return size; +} +#else +static apr_size_t pool_num_bytes_recursive(apr_pool_t *pool) +{ + apr_size_t size; + + size = pool_num_bytes(pool); + + pool = pool->child; + while (pool) { + size += pool_num_bytes_recursive(pool); + + pool = pool->sibling; } return size; +} +#endif + +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *pool, int recurse) +{ + if (!recurse) + return pool_num_bytes(pool); + +#if APR_HAS_THREADS + return pool_num_bytes_recursive(pool, pool->mutex); +#else + return pool_num_bytes_recursive(pool); +#endif } APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void) From 2441ea5037a6511de98bbd2aa3d54896febc4f6c Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 14 Jan 2002 12:16:59 +0000 Subject: [PATCH 2783/7878] Fix for the recent fix. Don't tell the recurse function that it doesn't need to lock... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62787 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 02e8de457b6..414c463daf0 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1438,7 +1438,7 @@ APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *pool, int recurse) return pool_num_bytes(pool); #if APR_HAS_THREADS - return pool_num_bytes_recursive(pool, pool->mutex); + return pool_num_bytes_recursive(pool, NULL); #else return pool_num_bytes_recursive(pool); #endif From 281c3ec67e0551eca12c41a931396b4ce3c1a198 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 14 Jan 2002 13:45:19 +0000 Subject: [PATCH 2784/7878] In debug, no matter what the creation flags say, always create a lock. Without it integrity_check and apr_pool_num_bytes blow up (because they traverse pools child lists that possibly belong to another thread, in combination with the pool having no lock). However, this might actually hide problems like creating a child pool of a pool belonging to another thread. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62788 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 34 ++++++++++++++++++++++++++-------- memory/unix/apr_pools.c | 34 +++++++++++++++++++++++----------- 2 files changed, 49 insertions(+), 19 deletions(-) diff --git a/STATUS b/STATUS index b590e81fe29..8fb0e6a7a9f 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/01/14 10:05:15 $] +Last modified at [$Date: 2002/01/14 13:45:19 $] Release: @@ -46,13 +46,31 @@ RELEASE SHOWSTOPPERS: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: - * Implement apr_pool_join and apr_pool_lock. Those functions - are noops at the moment. - - * Add stats to the pools code. We already have basic stats - in debug mode. Stats that tell us about wasted memory - in the production code require more thought. - Status: Sander Striker is looking into this (low priority) + * Pools debugging + - Find a way to do check if a pool is used in multiple + threads, while the creation flags say it isn't. IOW, + when the pool was created with APR_POOL_FNEWALLOCATOR, + but without APR_POOL_FLOCK. + Currently, no matter what the creation flags say, we always + create a lock. Without it integrity_check() and + apr_pool_num_bytes() blow up (because they traverse pools + child lists that possibly belong to another thread, in + combination with the pool having no lock). However, + this might actually hide problems like creating a child pool + of a pool belonging to another thread. + Maybe a debug function apr_pool_set_owner(apr_thread_t *) in + combination with extra checks in integrity_check() will point + out these problems. apr_pool_set_owner() would need to be called + everytime the owner(the thread the pool is being used in) of + the pool changes. + + - Implement apr_pool_join and apr_pool_lock. Those functions + are noops at the moment. + + - Add stats to the pools code. We already have basic stats + in debug mode. Stats that tell us about wasted memory + in the production code require more thought. + Status: Sander Striker is looking into this (low priority) * Deal with largefiles properly on those platforms that support it. diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 414c463daf0..26276eba26e 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -162,6 +162,7 @@ struct apr_pool_t { #else /* !defined(APR_POOL_DEBUG) */ debug_node_t *nodes; const char *file_line; + apr_uint32_t creation_flags; unsigned int stat_alloc; unsigned int stat_total_alloc; unsigned int stat_clear; @@ -1068,7 +1069,8 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, #if defined(APR_POOL_DEBUG_VERBOSE) if (file_stderr) { apr_file_printf(file_stderr, - "POOL DEBUG: CLEAR [%10lu/%10lu/%10lu] 0x%08X \"%s\" [%s] (%u/%u/%u)\n", + "POOL DEBUG: CLEAR [%10lu/%10lu/%10lu] " + "0x%08X \"%s\" [%s] (%u/%u/%u)\n", (unsigned long)apr_pool_num_bytes(pool, 0), (unsigned long)apr_pool_num_bytes(pool, 1), (unsigned long)apr_pool_num_bytes(global_pool, 1), @@ -1089,7 +1091,8 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, #if defined(APR_POOL_DEBUG_VERBOSE) if (file_stderr) { apr_file_printf(file_stderr, - "POOL DEBUG: DESTROY [%10lu/%10lu/%10lu] 0x%08X \"%s\" [%s] (%u/%u/%u)\n", + "POOL DEBUG: DESTROY [%10lu/%10lu/%10lu] " + "0x%08X \"%s\" [%s] (%u/%u/%u)\n", (unsigned long)apr_pool_num_bytes(pool, 0), (unsigned long)apr_pool_num_bytes(pool, 1), (unsigned long)apr_pool_num_bytes(global_pool, 1), @@ -1153,17 +1156,24 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, pool->abort_fn = abort_fn; pool->tag = file_line; pool->file_line = file_line; + pool->creation_flags = flags; if ((flags & APR_POOL_FNEW_ALLOCATOR) == APR_POOL_FNEW_ALLOCATOR) { #if APR_HAS_THREADS - if ((flags & APR_POOL_FLOCK) == APR_POOL_FLOCK) { - apr_status_t rv; - - if ((rv = apr_thread_mutex_create(&pool->mutex, - APR_THREAD_MUTEX_DEFAULT, pool)) != APR_SUCCESS) { - free(pool); - return rv; - } + apr_status_t rv; + + /* No matter what the creation flags say, always create + * a lock. Without it integrity_check and apr_pool_num_bytes + * blow up (because they traverse pools child lists that + * possibly belong to another thread, in combination with + * the pool having no lock). However, this might actually + * hide problems like creating a child pool of a pool + * belonging to another thread. + */ + if ((rv = apr_thread_mutex_create(&pool->mutex, + APR_THREAD_MUTEX_DEFAULT, pool)) != APR_SUCCESS) { + free(pool); + return rv; } #endif } @@ -1200,12 +1210,14 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, #if defined(APR_POOL_DEBUG_VERBOSE) if (file_stderr) { apr_file_printf(file_stderr, - "POOL DEBUG: CREATE [%10lu/%10lu/%10lu] 0x%08X \"%s\" [%s] parent: 0x%08X \"%s\"\n", + "POOL DEBUG: CREATE [%10lu/%10lu/%10lu] " + "0x%08X \"%s\" [%s] flags=0x%X, parent=0x%08X \"%s\"\n", (unsigned long)0, (unsigned long)0, (unsigned long)apr_pool_num_bytes(global_pool, 1), (unsigned int)pool, pool->tag, file_line, + flags, (unsigned int)parent, parent ? parent->tag : ""); } #endif From 821f3f85a56c992fa3934dfecb041a2f08a8c731 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 14 Jan 2002 22:33:21 +0000 Subject: [PATCH 2785/7878] dup2() appears to be broken. Sticking with dup() until we can fix it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62789 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index f61245176b8..7cda84fd346 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -141,6 +141,10 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { +#ifdef NETWARE + return _file_dup(new_file, old_file, p, 1); +#else return _file_dup(new_file, old_file, p, 2); +#endif } From dcc68c7080a645fb491ed6bcad75608d0a8284c1 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 15 Jan 2002 08:29:35 +0000 Subject: [PATCH 2786/7878] Move around the creation of the lock and adding the pool to the parent pools child list. This gets us a working APR_POOL_DEBUG. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62790 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 44 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 26276eba26e..946fc20de1f 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1069,7 +1069,7 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, #if defined(APR_POOL_DEBUG_VERBOSE) if (file_stderr) { apr_file_printf(file_stderr, - "POOL DEBUG: CLEAR [%10lu/%10lu/%10lu] " + "POOL DEBUG: CLEAR [%10lu/%10lu/%10lu] " "0x%08X \"%s\" [%s] (%u/%u/%u)\n", (unsigned long)apr_pool_num_bytes(pool, 0), (unsigned long)apr_pool_num_bytes(pool, 1), @@ -1158,6 +1158,27 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, pool->file_line = file_line; pool->creation_flags = flags; + if ((pool->parent = parent) != NULL) { +#if APR_HAS_THREADS + if (parent->mutex) + apr_thread_mutex_lock(parent->mutex); +#endif + if ((pool->sibling = parent->child) != NULL) + pool->sibling->ref = &pool->sibling; + + parent->child = pool; + pool->ref = &parent->child; + +#if APR_HAS_THREADS + if (parent->mutex) + apr_thread_mutex_unlock(parent->mutex); +#endif + } + else { + pool->sibling = NULL; + pool->ref = NULL; + } + if ((flags & APR_POOL_FNEW_ALLOCATOR) == APR_POOL_FNEW_ALLOCATOR) { #if APR_HAS_THREADS apr_status_t rv; @@ -1184,27 +1205,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, #endif } - if ((pool->parent = parent) != NULL) { -#if APR_HAS_THREADS - if (parent->mutex) - apr_thread_mutex_lock(parent->mutex); -#endif - if ((pool->sibling = parent->child) != NULL) - pool->sibling->ref = &pool->sibling; - - parent->child = pool; - pool->ref = &parent->child; - -#if APR_HAS_THREADS - if (parent->mutex) - apr_thread_mutex_unlock(parent->mutex); -#endif - } - else { - pool->sibling = NULL; - pool->ref = NULL; - } - *newpool = pool; #if defined(APR_POOL_DEBUG_VERBOSE) From 335fe071c17d31f5ad6692df25d3a1917ba1a81d Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 15 Jan 2002 12:16:20 +0000 Subject: [PATCH 2787/7878] In verbose debug mode, also output the parent pool on CLEAR and DESTROY. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62791 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 946fc20de1f..fcb75df6eb6 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1070,13 +1070,15 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, if (file_stderr) { apr_file_printf(file_stderr, "POOL DEBUG: CLEAR [%10lu/%10lu/%10lu] " - "0x%08X \"%s\" [%s] (%u/%u/%u)\n", + "0x%08X \"%s\" [%s] (%u/%u/%u) " + "parent=0x%08X\n", (unsigned long)apr_pool_num_bytes(pool, 0), (unsigned long)apr_pool_num_bytes(pool, 1), (unsigned long)apr_pool_num_bytes(global_pool, 1), (unsigned int)pool, pool->tag, file_line, - pool->stat_alloc, pool->stat_total_alloc, pool->stat_clear); + pool->stat_alloc, pool->stat_total_alloc, pool->stat_clear, + (unsigned int)pool->parent); } #endif @@ -1092,13 +1094,15 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, if (file_stderr) { apr_file_printf(file_stderr, "POOL DEBUG: DESTROY [%10lu/%10lu/%10lu] " - "0x%08X \"%s\" [%s] (%u/%u/%u)\n", + "0x%08X \"%s\" [%s] (%u/%u/%u) " + "parent=0x%08X\n", (unsigned long)apr_pool_num_bytes(pool, 0), (unsigned long)apr_pool_num_bytes(pool, 1), (unsigned long)apr_pool_num_bytes(global_pool, 1), (unsigned int)pool, pool->tag, file_line, - pool->stat_alloc, pool->stat_total_alloc, pool->stat_clear); + pool->stat_alloc, pool->stat_total_alloc, pool->stat_clear, + (unsigned int)pool->parent); } #endif From dc664c9d06f64da0151c9155f69a638cbf11e1ca Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 15 Jan 2002 14:24:51 +0000 Subject: [PATCH 2788/7878] Mark SysV anon shared memory segments for deletion, so if we crash, they are removed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62792 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ shmem/unix/shm.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CHANGES b/CHANGES index cb72365aaf7..42752e625a1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Make sure to pre-mark anon SysV shared memory segments as + removed. [Jim Jagielski] + *) Add --with-efence to allow usage of Electric Fence. [Justin Erenkrantz] diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 1ae3cfc3d83..5041b30bd6c 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -194,6 +194,11 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, new_m->shmid = shmid; + /* Remove the segment once use count hits zero. */ + if (shmctl(shmid, IPC_RMID, NULL) == -1) { + return errno; + } + *m = new_m; return APR_SUCCESS; #endif /* APR_USE_SHMEM_SHMGET_ANON */ From bd9617509d6919fc568394de6c08f78928b5d904 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 15 Jan 2002 23:05:30 +0000 Subject: [PATCH 2789/7878] Changed the build environment variable to NovellLibC to avoid a conflict with CLib git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62793 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 197060 -> 196740 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 981db2b8f86e3299391c53937a5eb94231493eb5..253644ca912874bc13f4d19ae9f269c8aca5bcfb 100644 GIT binary patch delta 85305 zcmcF~1ymf*w`TC*5JGTBa3{D!f(H#AJi#Tn57H2VTL|vKJp?D{00Dx#+l0Y&@WFpgYvOpZ9Ix6$vu_b=b|k)tm| zUxJY|1RoG8qC+M9g9X2Qv4@^`i%qjpY`YLlSu$@Z9Vi)V5J_IKRjg#LT)g(?+=`y@ zXa!=2sk0gebsM~T48B{^_f=g`WOtOOteWV=PQ4m3{?7bWkDW3@&*}Uey{*uZYWC+| zHeWKo`>JDujzVtJ@}|cVI3BEKOIu==Ew^;aJTP&L(QH)!&%;O?Rp|xnQn#Dmb=UH7s6S)Nz{$V7e7Ed)Fo4Kf?6F43(2aJEn;5#JlSherff~uva9+Amd}mVOHpQUrpm_8#3_1*{jQtbdZfdVw ztQpW|CSJ}&8Y{6JdpT0Sh?SUonb z*qfs>k-O&k)8UDIRRY}SftN8H4W~7&YuQ%odpXv;#mRB#vKss18=<=X`h$3iS`uTVlEtT*@J?w zW{c=j82;ri=ddQl9(xNY;IfkPoS)3bdbn0snOj?EqRm3 ztmYT^*?Me|NwBu#ljC;e!9{|;dsEN()*|>2f(2dzo6#Q=%}K@mAp5}5%?+~w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AC?89};Y|}PDSr5o_Sp`}IN&lAdg#0B@BK+Kl^Bq%? z_T)vY(}rN-kuFc@Jc!tkHl{ohX$%hs1$G*(5*O$~gb6|zd|>=VQ0#sh9z=q=9Sz7Z zUVs1$m9joSI9IRHqK1qPj|um^J3POHwX0iz7AI;=Y`Vb{O@p*Y=LMxFC1Jw9`OjSn z3>xi0&ASO_ku$tSz-2<)Y?-!H$eg418W4SyNM27UvjIW7nb%o(NL9Kqo@Xaqc+!#L zC|e1Y^Bm9lg3E_2d5X@}(7&XR0if{|V8=Fg>@lO?MV?*8)~dhPhPdvUBWNMmwRM)< ze4;&5L;EUScD8jS|MPva(v`P>lN%Q>BU))+)dQE>TmN~d(m$<*0_<0lcn<3=Pt!E zJJ4dPAYn5E){!0{j47@^$mKsDr6FRYj!Nom^VW>vAuQUXj>>^_kb#!@X!ek~&YpCV z;oroDS1sTU4s6caqDtGlv(`30lBdS+++BO0VwoD@5nXW9-@o8FH@s;ip>Gws>Wpl= zBHV!ZdIJ1w{e;1SR$+}2+yd`_J|v#N&_f{~cSxZCB=B$JhsauLV!h&ii|5KeTs{a~ z{&aK3*FM4!C9=OH@yxLEHVRL-L;Tvi_U`5CMUV()&TBzye9e@2kGv|Z^(1CP>O)T= zsHByCSNm_TMurAuMBT?> Date: Tue, 15 Jan 2002 23:38:07 +0000 Subject: [PATCH 2790/7878] Updated to reference the NovellLibC environment variable git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62794 13f79535-47bb-0310-9956-ffa450edef68 --- build/prebuildNW.bat | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build/prebuildNW.bat b/build/prebuildNW.bat index e45047bd2a3..6702672b915 100755 --- a/build/prebuildNW.bat +++ b/build/prebuildNW.bat @@ -1,15 +1,15 @@ @echo off -if not "%NovellNDK%" == "" goto CheckNDK -set NovellNDK=\novell\ndk\libc -@echo Could not find the NovellNDK environment variable -@echo Setting NovellNDK = %NovellNDK% +if not "%NovellLibC%" == "" goto CheckNDK +set NovellLibC=\novell\ndk\libc +@echo Could not find the NovellLibC environment variable +@echo Setting NovellLibC = %NovellLibC% @echo --------------------- :CheckNDK -if exist %NovellNDK%\include\netware.h goto NDKOK -@echo The path to the NDK "%NovellNDK%" is invalid. -@echo Please set then NovellNDK environment variable to the location of the NDK +if exist %NovellLibC%\include\netware.h goto NDKOK +@echo The path to the NDK "%NovellLibC%" is invalid. +@echo Please set then NovellLibC environment variable to the location of the NDK @echo --------------------- goto Done @@ -38,7 +38,7 @@ copy ..\..\pcre\config.hw ..\..\pcre\config.h copy ..\..\pcre\pcre.hw ..\..\pcre\pcre.h @echo Generating the import list... -set MWCIncludes=..\include;..\include\arch\netware;..\include\arch\unix;..\..\apr-util\include;+%NovellNDK% +set MWCIncludes=..\include;..\include\arch\netware;..\include\arch\unix;..\..\apr-util\include;+%NovellLibC% mwccnlm -P nw_export.inc -d NETWARE -EP awk -f make_nw_export.awk nw_export.i |sort >..\aprlib.imp From b4d1a990661aa84f4d829c6f09b183c09c3f73c5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 16 Jan 2002 20:53:00 +0000 Subject: [PATCH 2791/7878] get rid of warnings about unused functions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62795 13f79535-47bb-0310-9956-ffa450edef68 --- test/testshmconsumer.c | 7 ------- test/testshmproducer.c | 17 ----------------- 2 files changed, 24 deletions(-) diff --git a/test/testshmconsumer.c b/test/testshmconsumer.c index a0b8758f1d6..045ce7e66ec 100644 --- a/test/testshmconsumer.c +++ b/test/testshmconsumer.c @@ -94,13 +94,6 @@ static void msgwait(int sleep_sec, int first_box, int last_box) fprintf(stdout, "done waiting on mailboxes...\n"); } -static void msgput(int boxnum, char *msg) -{ - fprintf(stdout, "Sending message to box %d\n", boxnum); - apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg)); - boxes[boxnum].msgavail = 1; -} - int main(void) { apr_status_t rv; diff --git a/test/testshmproducer.c b/test/testshmproducer.c index bf0295659cf..afb4f26abe6 100644 --- a/test/testshmproducer.c +++ b/test/testshmproducer.c @@ -77,23 +77,6 @@ mbox *boxes; #define SHARED_SIZE (apr_size_t)(N_BOXES * sizeof(mbox)) #define SHARED_FILENAME "/tmp/apr.testshm.shm" -static void msgwait(int sleep_sec, int first_box, int last_box) -{ - int i; - apr_time_t start = apr_time_now(); - while (apr_time_now() - start < sleep_sec * APR_USEC_PER_SEC) { - for (i = first_box; i < last_box; i++) { - if (boxes[i].msgavail) { - fprintf(stdout, "received a message in box %d, message was: %s\n", - i, boxes[i].msg); - boxes[i].msgavail = 0; /* reset back to 0 */ - } - } - apr_sleep(1*APR_USEC_PER_SEC); - } - fprintf(stdout, "done waiting on mailboxes...\n"); -} - static void msgput(int boxnum, char *msg) { fprintf(stdout, "Sending message to box %d\n", boxnum); From 4d267a3ff2852767f07fe57ba2e5bab54bc636e7 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Wed, 16 Jan 2002 21:37:19 +0000 Subject: [PATCH 2792/7878] Remove some cruft from the Unix shm implementation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62796 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 5041b30bd6c..06bb977d3b7 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -59,25 +59,6 @@ #include "apr_user.h" #include "apr_strings.h" -/* -#define APR_WANT_MEMFUNC -#include "apr_want.h" -*/ - -/* -#include "apr_portable.h" -*/ - -#if 0 -#if APR_HAVE_SHMEM_SHMGET -/* The metadata that is stored in the file that we use to rendevous - * with the segment in unrelated processes. */ -struct apr_shm_shmget_metadata { - apr_size_t reqsize; /* requested size of the segment */ -}; -#endif /* APR_HAVE_SHMEM_SHMGET */ -#endif - APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, apr_size_t reqsize, const char *filename, From 6db46993c03e14eb147964543ebed26da8c58059 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Wed, 16 Jan 2002 22:08:06 +0000 Subject: [PATCH 2793/7878] Fix up some of the status messages. Detect if either the producer or consumer child processes exited with non-zero status, which is the basis for the success of the name-based shm test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62797 13f79535-47bb-0310-9956-ffa450edef68 --- test/testshm.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/testshm.c b/test/testshm.c index 7b50ef59479..f13d00dcef5 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -216,11 +216,11 @@ static apr_status_t test_named(apr_pool_t *parpool) } fprintf(stdout, "OK\n"); - printf("Non-related Processes Test\n"); + printf("fork()ing and exec()ing children:\n"); pidproducer = fork(); if (pidproducer == 0) { /* child */ /* FIXME: exec a producer */ - printf("starting consumer\n"); + printf("starting consumer.....\n"); if (execlp("testshmconsumer", "testshmconsumer", (char*)0) < 0) { return errno; } @@ -230,7 +230,7 @@ static apr_status_t test_named(apr_pool_t *parpool) pidconsumer = fork(); if (pidconsumer == 0) { /* child */ /* FIXME: exec a producer */ - printf("starting producer\n"); + printf("starting producer.....\n"); if (execlp("testshmproducer", "testshmproducer", (char*)0) < 0) { return errno; } @@ -249,10 +249,18 @@ static apr_status_t test_named(apr_pool_t *parpool) if (waitpid(pidconsumer, &exit_int, 0) < 0) { return errno; } + if (WIFEXITED(exit_int)) { + printf("Producer was unsuccessful.\n"); + return APR_EGENERAL; + } printf("Waiting for consumer to exit.\n"); if (waitpid(pidproducer, &exit_int, 0) < 0) { return errno; } + if (WIFEXITED(exit_int)) { + printf("Consumer was unsuccessful.\n"); + return APR_EGENERAL; + } apr_pool_destroy(pool); From cf031dcc83a701ed64eb4d2601ec615fb461a539 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Wed, 16 Jan 2002 22:16:30 +0000 Subject: [PATCH 2794/7878] Fix a bug in the APR_USE_SHMEM_SHMGET type of name-based shared memory. When a segment has been marked for deletion, other processes are not allowed to attach to that segment. This also fixes the problem with the name-based portion of the testshm.c test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62798 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 06bb977d3b7..21dfdd58a8d 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -78,7 +78,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON apr_size_t nbytes; apr_file_t *file; /* file where metadata is stored */ - int shmid; #endif /* FIXME: associate this thing with a pool and set up a destructor @@ -152,31 +151,32 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, new_m->realsize = reqsize; new_m->filename = NULL; - if ((shmid = shmget(IPC_PRIVATE, new_m->realsize, - SHM_R | SHM_W | IPC_CREAT)) < 0) { + if ((new_m->shmid = shmget(IPC_PRIVATE, new_m->realsize, + SHM_R | SHM_W | IPC_CREAT)) < 0) { return errno; } - if ((new_m->base = shmat(shmid, NULL, 0)) == (void *)-1) { + if ((new_m->base = shmat(new_m->shmid, NULL, 0)) == (void *)-1) { return errno; } new_m->usable = new_m->base; - if (shmctl(shmid, IPC_STAT, &shmbuf) == -1) { + if (shmctl(new_m->shmid, IPC_STAT, &shmbuf) == -1) { return errno; } apr_current_userid(&uid, &gid, pool); shmbuf.shm_perm.uid = uid; shmbuf.shm_perm.gid = gid; - if (shmctl(shmid, IPC_SET, &shmbuf) == -1) { + if (shmctl(new_m->shmid, IPC_SET, &shmbuf) == -1) { return errno; } - new_m->shmid = shmid; - - /* Remove the segment once use count hits zero. */ - if (shmctl(shmid, IPC_RMID, NULL) == -1) { + /* Remove the segment once use count hits zero. + * We will not attach to this segment again, since it is + * anonymous memory, so it is ok to mark it for deletion. + */ + if (shmctl(new_m->shmid, IPC_RMID, NULL) == -1) { return errno; } @@ -257,27 +257,25 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #if APR_USE_SHMEM_SHMGET new_m->realsize = reqsize; - if ((shmid = shmget(ftok(filename, 1), new_m->realsize, - SHM_R | SHM_W | IPC_CREAT)) < 0) { + if ((new_m->shmid = shmget(ftok(filename, 1), new_m->realsize, + SHM_R | SHM_W | IPC_CREAT)) < 0) { return errno; } - new_m->base = shmat(shmid, NULL, 0); + new_m->base = shmat(new_m->shmid, NULL, 0); /* FIXME: Handle errors. */ new_m->usable = new_m->base; - if (shmctl(shmid, IPC_STAT, &shmbuf) == -1) { + if (shmctl(new_m->shmid, IPC_STAT, &shmbuf) == -1) { return errno; } apr_current_userid(&uid, &gid, pool); shmbuf.shm_perm.uid = uid; shmbuf.shm_perm.gid = gid; - if (shmctl(shmid, IPC_SET, &shmbuf) == -1) { + if (shmctl(new_m->shmid, IPC_SET, &shmbuf) == -1) { return errno; } - new_m->shmid = shmid; - /* FIXME: APR_OS_DEFAULT is too permissive, switch to 600 I think. */ status = apr_file_open(&file, filename, APR_WRITE | APR_CREATE, @@ -297,11 +295,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return status; } - /* Remove the segment once use count hits zero. */ - if (shmctl(shmid, IPC_RMID, NULL) == -1) { - return errno; - } - *m = new_m; return APR_SUCCESS; @@ -321,6 +314,9 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) #elif APR_USE_SHMEM_MMAP_ANON munmap(m->base, m->realsize); #elif APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON + if (shmctl(m->shmid, IPC_RMID, NULL) == -1) { + return errno; + } shmdt(m->base); #endif From e01179f660337d48e5da8c3f2d9befca7ee71e6e Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 17 Jan 2002 00:30:47 +0000 Subject: [PATCH 2795/7878] I had that exit status check backwards -- it wasn't working when I thought it was. No bother, it works now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62799 13f79535-47bb-0310-9956-ffa450edef68 --- test/testshm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testshm.c b/test/testshm.c index f13d00dcef5..107ae390aa2 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -249,7 +249,7 @@ static apr_status_t test_named(apr_pool_t *parpool) if (waitpid(pidconsumer, &exit_int, 0) < 0) { return errno; } - if (WIFEXITED(exit_int)) { + if (!WIFEXITED(exit_int)) { printf("Producer was unsuccessful.\n"); return APR_EGENERAL; } @@ -257,7 +257,7 @@ static apr_status_t test_named(apr_pool_t *parpool) if (waitpid(pidproducer, &exit_int, 0) < 0) { return errno; } - if (WIFEXITED(exit_int)) { + if (!WIFEXITED(exit_int)) { printf("Consumer was unsuccessful.\n"); return APR_EGENERAL; } From e185c288c0a2d4c28d13f62472c38aca700b04cc Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 17 Jan 2002 00:32:22 +0000 Subject: [PATCH 2796/7878] Implement apr_shm_detach for name-based shmget(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62800 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 21dfdd58a8d..0985f68b940 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -420,8 +420,10 @@ APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) /* FIXME: munmap the segment. */ return APR_ENOTIMPL; #elif APR_USE_SHMEM_SHMGET - /* FIXME: shmdt. */ - return APR_ENOTIMPL; + if (shmdt(m->base) < 0) { + return errno; + } + return APR_SUCCESS; #else return APR_ENOTIMPL; #endif From b05edfc8cc64d48bb9d9b8a369278f22bbbd56f2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 17 Jan 2002 01:42:31 +0000 Subject: [PATCH 2797/7878] clean up some warnings (unused variables, unprototyped exported functions) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62801 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpools.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/testpools.c b/test/testpools.c index cbca43b7f53..abe3e8c4924 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -65,7 +65,7 @@ #endif #include "test_apr.h" -void alloc_bytes(apr_pool_t *p, int bytes) +static void alloc_bytes(apr_pool_t *p, int bytes) { int i; char *alloc; @@ -87,7 +87,7 @@ void alloc_bytes(apr_pool_t *p, int bytes) printf("OK\n"); } -void calloc_bytes(apr_pool_t *p, int bytes) +static void calloc_bytes(apr_pool_t *p, int bytes) { int i; char *alloc; @@ -116,9 +116,6 @@ void calloc_bytes(apr_pool_t *p, int bytes) int main (int argc, char ** argv) { apr_pool_t *pmain, *pchild; - char buff[50]; - char *bytes, *zbytes; - int i; apr_initialize(); atexit(apr_terminate); From 6e559945e49f5845cdb296182879e743679151b8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 17 Jan 2002 02:11:52 +0000 Subject: [PATCH 2798/7878] ignore generated file testrand git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62802 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.cvsignore b/test/.cvsignore index bb18a3fecc4..4ca3a686f72 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -17,6 +17,7 @@ testoc testpipe testpoll testpools +testrand testshm testshmconsumer testshmproducer From 0ab8da9971aaf5c5948cc68c1e7716275090b87e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 17 Jan 2002 03:17:30 +0000 Subject: [PATCH 2799/7878] get rid of some warnings in a non-threaded build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62803 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsleep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/testsleep.c b/test/testsleep.c index adc0f3fb516..3d8cbf10bb4 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -100,8 +100,10 @@ void * APR_THREAD_FUNC time_a_thread(apr_thread_t *thd, void *data) int main(void) { apr_pool_t *p; +#if APR_HAS_THREADS apr_thread_t *t1, *t2, *t3; apr_status_t rv; +#endif apr_initialize(); From eb7c5f1a5f520e8329fcf769760f504f6c82bafe Mon Sep 17 00:00:00 2001 From: Ben Collins-Sussman Date: Thu, 17 Jan 2002 17:26:35 +0000 Subject: [PATCH 2800/7878] Small change that will allow Subversion to better document its command-line switches. Shouldn't break any existing users of this structure. Reviewed by Greg Stein * apr_getopt.h (apr_getopt_option_t): add a new 'description' field to the end of the structure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62804 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 070bd72ed5f..4c771e8c3db 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -116,6 +116,8 @@ struct apr_getopt_option_t { int optch; /** nonzero if option takes an argument */ int has_arg; + /** a description of the option */ + const char *description; }; /** From 20945ebc4728ad9b91d6f55617d6cbf0d5cc1f8d Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 18 Jan 2002 02:57:23 +0000 Subject: [PATCH 2801/7878] Provide stubs for apr_pool_xxx_debug in release builds. This gives us binary compatibility between debug and release builds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62805 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 80 +++++++++++++++++++++++++++++++---------- memory/unix/apr_pools.c | 26 ++++++++++++++ 2 files changed, 87 insertions(+), 19 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 078820e1b29..037afc70e74 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -163,21 +163,37 @@ APR_DECLARE(void) apr_pool_terminate(void); * (this flag only makes sense in combination with POOL_FNEW_ALLOCATOR) * */ -#if defined(APR_POOL_DEBUG) -#define apr_pool_create_ex(newpool, parent, abort_fn, flag) \ - apr_pool_create_ex_debug(newpool, parent, abort_fn, flag, \ - APR_POOL__FILE_LINE__) +APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_uint32_t flags); +/** + * Debug version of apr_pool_create_ex. + * @param newpool See: apr_pool_create. + * @param parent See: apr_pool_create. + * @param abort_fn See: apr_pool_create. + * @param flags See: apr_pool_create. + * @param file_line Where the function is called from. + * This is usually APR_POOL__FILE_LINE__. + * @remark Only available when APR_POOL_DEBUG is defined. + * Call this directly if you have you apr_pool_create_ex + * calls in a wrapper function and wish to override + * the file_line argument to reflect the caller of + * your wrapper function. If you do not have + * apr_pool_create_ex in a wrapper, trust the macro + * and don't call apr_pool_create_ex_debug directly. + */ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, apr_uint32_t flags, const char *file_line); -#else -APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_uint32_t flags); + +#if defined(APR_POOL_DEBUG) +#define apr_pool_create_ex(newpool, parent, abort_fn, flag) \ + apr_pool_create_ex_debug(newpool, parent, abort_fn, flag, \ + APR_POOL__FILE_LINE__) #endif /** @@ -234,14 +250,27 @@ APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **newpool, * to re-use this memory for the next allocation. * @see apr_pool_destroy() */ -#if defined(APR_POOL_DEBUG) -#define apr_pool_clear(p) \ - apr_pool_clear_debug(p, APR_POOL__FILE_LINE__) +APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); +/** + * Debug version of apr_pool_clear. + * @param p See: apr_pool_clear. + * @param file_line Where the function is called from. + * This is usually APR_POOL__FILE_LINE__. + * @remark Only available when APR_POOL_DEBUG is defined. + * Call this directly if you have you apr_pool_clear + * calls in a wrapper function and wish to override + * the file_line argument to reflect the caller of + * your wrapper function. If you do not have + * apr_pool_clear in a wrapper, trust the macro + * and don't call apr_pool_destroy_clear directly. + */ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p, const char *file_line); -#else -APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); + +#if defined(APR_POOL_DEBUG) +#define apr_pool_clear(p) \ + apr_pool_clear_debug(p, APR_POOL__FILE_LINE__) #endif /** @@ -250,14 +279,27 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); * @param p The pool to destroy * @remark This will actually free the memory */ -#if defined(APR_POOL_DEBUG) -#define apr_pool_destroy(p) \ - apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__) +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); +/** + * Debug version of apr_pool_destroy. + * @param p See: apr_pool_destroy. + * @param file_line Where the function is called from. + * This is usually APR_POOL__FILE_LINE__. + * @remark Only available when APR_POOL_DEBUG is defined. + * Call this directly if you have you apr_pool_destroy + * calls in a wrapper function and wish to override + * the file_line argument to reflect the caller of + * your wrapper function. If you do not have + * apr_pool_destroy in a wrapper, trust the macro + * and don't call apr_pool_destroy_debug directly. + */ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, const char *file_line); -#else -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); + +#if defined(APR_POOL_DEBUG) +#define apr_pool_destroy(p) \ + apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__) #endif diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index fcb75df6eb6..d99710b31f0 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -718,6 +718,32 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, return APR_SUCCESS; } +/* + * Pool creation/destruction stubs, for people who are running + * mixed release/debug enviroments. + */ + +APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, + const char *file_line) +{ + apr_pool_clear(pool); +} + +APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, + const char *file_line) +{ + apr_pool_destroy(pool); +} + +APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_uint32_t flags, + const char *file_line) +{ + return apr_pool_create_ex(newpool, parent, abort_fn, flags); +} + /* * "Print" functions From a5d20a8a9e19e54260ab8eeb044ea14b5907d700 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 18 Jan 2002 19:16:29 +0000 Subject: [PATCH 2802/7878] apr_file_mktemp should APR_CREATE the tmp file Submitted by: John Sterling Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62806 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/unix/mktemp.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 42752e625a1..52efb717175 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Ensure that apr_file_mktemp creates the temp file if it isn't there. + [John Sterling ] + *) Make sure to pre-mark anon SysV shared memory segments as removed. [Jim Jagielski] diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 70c28d88dfd..3e73a655f14 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -207,7 +207,8 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i #ifdef HAVE_MKSTEMP int fd; #endif - flags = (!flags) ? APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE : flags; + flags = (!flags) ? APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | + APR_DELONCLOSE : flags; #ifndef HAVE_MKSTEMP return gettemp(template, fp, flags, p); #else From 2cdb02d52871c1e55baeb02ed7de4161fbd25e22 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 18 Jan 2002 19:24:09 +0000 Subject: [PATCH 2803/7878] docco update git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62807 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index bd042443a7c..c370bec48b2 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -593,7 +593,7 @@ APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); * @param template The template to use when creating a temp file. * @param flags The flags to open the file with. If this is zero, * the file is opened with - * APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE + * APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE * @param p The pool to allocate the file out of. * @ingroup apr_file_open * @remark From 756dda637b4f3c741bbf895379d466fb06825dfb Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Jan 2002 21:57:35 +0000 Subject: [PATCH 2804/7878] for the call to apr_table_overlap where it has no work to do: avoid some logic in apr_table_overlap which dies with APR_POOL_DEBUG+ElectricFence since it tries to alloc zero bytes it is useful to bail out early anyway to avoid some needless function calls and other Requesting CGI scripts through Apache causes such a call (maybe just for HTTP/0.9? I dunno.). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62808 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index c8095a72372..0f571a0fe4e 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -935,6 +935,18 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, apr_table_entry_t *elts; max_keys = a->a.nelts + b->a.nelts; + if (!max_keys) { + /* The following logic won't do anything harmful if we keep + * going in this situation, but + * + * 1) certain memory debuggers don't like an alloc size of 0 + * so we'd like to avoid that... + * 2) this isn't all that rare a call anyway, so it is useful + * to skip the storage allocation and other checks in the + * following logic + */ + return; + } cat_keys = apr_palloc(b->a.pool, sizeof(overlap_key) * max_keys); nhash = DEFAULT_HASH_SIZE; while (nhash < max_keys) { From c5e2e9020076343b03eea2bd6060dfb017a661fb Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 19 Jan 2002 00:18:12 +0000 Subject: [PATCH 2805/7878] The spelling police are a year late. Submitted by: Blair Zajac Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62809 13f79535-47bb-0310-9956-ffa450edef68 --- APRDesign | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/APRDesign b/APRDesign index 70472d2f508..8db21f9b889 100644 --- a/APRDesign +++ b/APRDesign @@ -11,7 +11,7 @@ APR's place is now to combine any code that can be safely combined without sacrificing performance. To this end we have created a set of operations that are required for cross -platfrom development. There may be other types that are desired and those +platform development. There may be other types that are desired and those will be implemented in the future. The first version of APR will focus on what Apache 2.0 needs. Of course, anything that is submitted will be considered for inclusion. @@ -42,7 +42,7 @@ and apr.h are created from apr_private.hw and apr.hw respectively. APR Features One of the goals of APR is to provide a common set of features across all -platforms. This is an admirable goal, it is also not realisitic. We cannot +platforms. This is an admirable goal, it is also not realistic. We cannot expect to be able to implement ALL features on ALL platforms. So we are going to do the next best thing. Provide a common interface to ALL APR features on MOST platforms. @@ -104,7 +104,7 @@ apr Obviously, BeOS does not have a directory. This is because BeOS is currently using the Unix directory for it's file_io. In the near future, it will be -possible to use indiviual files from the Unix directory. +possible to use individual files from the Unix directory. There are a few special top level directories. These are test, inc, include, and libs. Test is a directory which stores all test programs. It is expected @@ -138,7 +138,7 @@ In include/apr_file_io.h: typedef struct ap_file_t ap_file_t; This will cause a compiler error if somebody tries to access the filedes field -in this strcture. Windows does not have a filedes field, so obviously, it is +in this structure. Windows does not have a filedes field, so obviously, it is important that programs not be able to access these. The only exception to the incomplete type rule can be found in apr_portable.h. @@ -150,7 +150,7 @@ type is used to allocate memory within APR. Any APR type that has this field should place this field first. If it is important to retrieve the pool from an APR variable, it is possible to use the macro APR_GET_POOL to accomplish this. This macro will only work on types that actually have -a pool in them as the first field. On any other type, this Macro will cause +a pool in them as the first field. On any other type, this macro will cause a seg fault as soon as the pool is used. New Function @@ -193,13 +193,13 @@ hasn't been done yet). APR Error reporting Most APR functions should return an ap_status_t type. The only time an -APR function does not return an ap_status_t is if it absolutly CAN NOT +APR function does not return an ap_status_t is if it absolutely CAN NOT fail. Examples of this would be filling out an array when you know you are not beyond the array's range. If it cannot fail on your platform, but it could conceivably fail on another platform, it should return an ap_status_t. Unless you are sure, return an ap_status_t. :-) -All platform return errno values unchanged. Each platform can also have +All platforms return errno values unchanged. Each platform can also have one system error type, which can be returned after an offset is added. There are five types of error values in APR, each with it's own offset. @@ -207,16 +207,16 @@ There are five types of error values in APR, each with it's own offset. 0) This is 0 for all platforms and isn't really defined anywhere, but it is the offset for errno values. (This has no name because it isn't actually defined, - but completeness we are discussing it here). -1) APR_OS_START_ERROR This is platform dependant, and is the offset at which + but for completeness we are discussing it here). +1) APR_OS_START_ERROR This is platform dependent, and is the offset at which APR errors start to be defined. (Canonical error values are also defined in this section. [Canonical error values are discussed later]). -2) APR_OS_START_STATUS This is platform dependant, and is the offset at which +2) APR_OS_START_STATUS This is platform dependent, and is the offset at which APR status values start. -4) APR_OS_START_USEERR This is platform dependant, and is the offset at which +4) APR_OS_START_USEERR This is platform dependent, and is the offset at which APR apps can begin to add their own error codes. -3) APR_OS_START_SYSERR This is platform dependant, and is the offset at which +3) APR_OS_START_SYSERR This is platform dependent, and is the offset at which system error values begin. All of these definitions can be found in apr_errno.h for all platforms. When @@ -233,7 +233,7 @@ other than the primary error value on a platform. This can also be handled by APR applications. For example: if (CreateFile(fname, oflags, sharemod, NULL, - createflags, attributes,0) == INVALID_HANDLE_VALUE + createflags, attributes, 0) == INVALID_HANDLE_VALUE return (GetLAstError() + APR_OS_START_SYSERR); These two examples implement the same function for two different platforms. @@ -298,7 +298,7 @@ For example, using option 1: make syscall that fails convert to common error code return common error code - decide execution basd on common error code + decide execution based on common error code Using option 2: @@ -316,9 +316,9 @@ On all platforms ap_strerror takes the form: char *ap_strerror(ap_status_t err) { if (err < APR_OS_START_ERRNO2) - return (platform dependant error string generator) + return (platform dependent error string generator) if (err < APR_OS_START_ERROR) - return (platform dependant error string generator for + return (platform dependent error string generator for supplemental error values) if (err < APR_OS_SYSERR) return (APR generated error or status string) From 7482636c5e835b1e6f7b23e0cdaa4c74d86b6797 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 19 Jan 2002 00:22:56 +0000 Subject: [PATCH 2806/7878] Forgot to add Blair to the CHANGES. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62810 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 52efb717175..d87c4d195a2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix spelling mistakes in APRDesign. + [Blair Zajac ] + *) Ensure that apr_file_mktemp creates the temp file if it isn't there. [John Sterling ] From 9a88765e60262b093f2e40bd8ac7ff71c4ef9d41 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 20 Jan 2002 06:41:50 +0000 Subject: [PATCH 2807/7878] OS/2: Add apr_file_dup2(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62811 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filedup.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 6a3acf3ef34..eec3229e6da 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -59,7 +59,7 @@ #include #include "inherit.h" -APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) +static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { int rv; apr_file_t *dup_file; @@ -98,3 +98,26 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_fi return APR_SUCCESS; } + + + +APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) +{ + if (*new_file) { + apr_file_close(*new_file); + (*new_file)->filedes = -1; + } + + return file_dup(new_file, old_file, p); +} + + + +APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) +{ + if (*new_file == NULL) { + return APR_EINVAL; + } + + return file_dup(new_file, old_file, p); +} From ad32c4fd101a39d01a46b3132ba92f4222c5d5ce Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 21 Jan 2002 18:28:52 +0000 Subject: [PATCH 2808/7878] fix a typo in a comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62812 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index d99710b31f0..a8d9612676b 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -268,7 +268,7 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) size = MIN_ALLOC; /* Find the index for this node size by - * deviding its size by the boundary size + * dividing its size by the boundary size */ index = (size >> BOUNDARY_INDEX) - 1; From b713a6a0b9076b197f7faa1d5b701849be6fb09d Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 22 Jan 2002 18:06:15 +0000 Subject: [PATCH 2809/7878] AIX does not define MAP_FAILED, but it's just a (void *)-1. Submitted by: Elrond Reviewed by: Sander Striker , Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62813 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/shm.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/arch/unix/shm.h b/include/arch/unix/shm.h index b1e2c5421e3..e065ad1b9f3 100644 --- a/include/arch/unix/shm.h +++ b/include/arch/unix/shm.h @@ -84,6 +84,12 @@ #include #endif +/* Not all systems seem to have MAP_FAILED defined, but it should always + * just be (void *)-1. */ +#ifndef MAP_FAILED +#define MAP_FAILED ((void *)-1) +#endif + struct apr_shm_t { apr_pool_t *pool; void *base; /* base real address */ From 677e99834edad7d219069534f04b4bee428a6182 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 22 Jan 2002 19:31:41 +0000 Subject: [PATCH 2810/7878] Add some more comments and more robust error checking. Changed the return error from apr_shm_attach if filename == NULL. Normally in APR input parameters are not explicitly checked, but since in apr_shm a NULL filename has a special meaning (anonymous memory) it will now return APR_EINVAL in that case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62814 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 0985f68b940..639afd7ddb6 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -311,13 +311,19 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) #if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO munmap(m->base, m->realsize); apr_file_close(m->file); + /* FIXME: unlink the file */ #elif APR_USE_SHMEM_MMAP_ANON munmap(m->base, m->realsize); #elif APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON + /* Indicate that the segment is to be destroyed as soon + * as all processes have detached. This also disallows any + * new attachments to the segment. */ if (shmctl(m->shmid, IPC_RMID, NULL) == -1) { return errno; } - shmdt(m->base); + if (shmdt(m->base) == -1) { + return errno; + } #endif return APR_SUCCESS; @@ -330,12 +336,9 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, apr_status_t status; if (filename == NULL) { -#if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_MMAP_ANON - /* If they want anonymous memory they shouldn't call attach. */ - return APR_EGENERAL; -#else - return APR_ENOTIMPL; -#endif + /* It doesn't make sense to attach to a segment if you don't know + * the filename. */ + return APR_EINVAL; } else { #if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM @@ -420,7 +423,7 @@ APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) /* FIXME: munmap the segment. */ return APR_ENOTIMPL; #elif APR_USE_SHMEM_SHMGET - if (shmdt(m->base) < 0) { + if (shmdt(m->base) == -1) { return errno; } return APR_SUCCESS; From 463fbddb21a4a6db17d45bb174bda5e35d32525a Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 22 Jan 2002 23:56:23 +0000 Subject: [PATCH 2811/7878] Delete the apr_shm_t when we're done with it. (This didn't work before, but I'm about to commit the implementation.) Add more verbose status/error messages -- most importantly making it obvious from which child (consumer or producer) the messages are comming from. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62815 13f79535-47bb-0310-9956-ffa450edef68 --- test/testshm.c | 16 ++++++++++++++++ test/testshmconsumer.c | 18 ++++++++++++------ test/testshmproducer.c | 16 +++++++++++----- 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/test/testshm.c b/test/testshm.c index 107ae390aa2..4592897c7ba 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -170,6 +170,14 @@ static apr_status_t test_anon(apr_pool_t *parpool) return errno; } + printf("Destroying shared memory segment..."); + rv = apr_shm_destroy(shm); + if (rv != APR_SUCCESS) { + printf("FAILED\n"); + return rv; + } + printf("OK\n"); + apr_pool_destroy(pool); return APR_SUCCESS; @@ -262,6 +270,14 @@ static apr_status_t test_named(apr_pool_t *parpool) return APR_EGENERAL; } + printf("Destroying shared memory segment..."); + rv = apr_shm_destroy(shm); + if (rv != APR_SUCCESS) { + printf("FAILED\n"); + return rv; + } + printf("OK\n"); + apr_pool_destroy(pool); return APR_SUCCESS; diff --git a/test/testshmconsumer.c b/test/testshmconsumer.c index 045ce7e66ec..6fcf4b72f17 100644 --- a/test/testshmconsumer.c +++ b/test/testshmconsumer.c @@ -84,14 +84,14 @@ static void msgwait(int sleep_sec, int first_box, int last_box) while (apr_time_now() - start < sleep_sec * APR_USEC_PER_SEC) { for (i = first_box; i < last_box; i++) { if (boxes[i].msgavail) { - fprintf(stdout, "received a message in box %d, message was: %s\n", + fprintf(stdout, "Consumer: received a message in box %d, message was: %s\n", i, boxes[i].msg); boxes[i].msgavail = 0; /* reset back to 0 */ } } apr_sleep(1*APR_USEC_PER_SEC); } - fprintf(stdout, "done waiting on mailboxes...\n"); + fprintf(stdout, "Consumer: done waiting on mailboxes...\n"); } int main(void) @@ -112,24 +112,30 @@ int main(void) } printf("OK\n"); + printf("Consumer attaching to name-based shared memory...."); rv = apr_shm_attach(&shm, SHARED_FILENAME, pool); if (rv != APR_SUCCESS) { - printf("Unable to attach to name-based shared memory segment: " - "[%d] %s \n", rv, apr_strerror(rv, errmsg, sizeof(errmsg))); + printf("Consumer unable to attach to name-based shared memory " + "segment: [%d] %s \n", rv, + apr_strerror(rv, errmsg, sizeof(errmsg))); exit(-2); } + printf("OK\n"); boxes = apr_shm_baseaddr_get(shm); /* consume messages on all of the boxes */ msgwait(30, 0, N_BOXES); /* wait for 30 seconds for messages */ + printf("Consumer detaching from name-based shared memory...."); rv = apr_shm_detach(shm); if (rv != APR_SUCCESS) { - printf("Unable to detach from name-based shared memory segment: " - "[%d] %s \n", rv, apr_strerror(rv, errmsg, sizeof(errmsg))); + printf("Consumer unable to detach from name-based shared memory " + "segment: [%d] %s \n", rv, + apr_strerror(rv, errmsg, sizeof(errmsg))); exit(-3); } + printf("OK\n"); return 0; } diff --git a/test/testshmproducer.c b/test/testshmproducer.c index afb4f26abe6..162eca19cc6 100644 --- a/test/testshmproducer.c +++ b/test/testshmproducer.c @@ -79,7 +79,7 @@ mbox *boxes; static void msgput(int boxnum, char *msg) { - fprintf(stdout, "Sending message to box %d\n", boxnum); + fprintf(stdout, "Producer: Sending message to box %d\n", boxnum); apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg)); boxes[boxnum].msgavail = 1; } @@ -103,12 +103,15 @@ int main(void) } printf("OK\n"); + printf("Producer attaching to name-based shared memory...."); rv = apr_shm_attach(&shm, SHARED_FILENAME, pool); if (rv != APR_SUCCESS) { - printf("Unable to attach to name-based shared memory segment: " - "[%d] %s \n", rv, apr_strerror(rv, errmsg, sizeof(errmsg))); + printf("Producer unable to attach to name-based shared memory " + "segment: [%d] %s \n", rv, + apr_strerror(rv, errmsg, sizeof(errmsg))); exit(-2); } + printf("OK\n"); boxes = apr_shm_baseaddr_get(shm); @@ -118,12 +121,15 @@ int main(void) apr_sleep(1*APR_USEC_PER_SEC); } + printf("Producer detaching from name-based shared memory...."); rv = apr_shm_detach(shm); if (rv != APR_SUCCESS) { - printf("Unable to detach from name-based shared memory segment: " - "[%d] %s \n", rv, apr_strerror(rv, errmsg, sizeof(errmsg))); + printf("Producer unable to detach from name-based shared memory " + "segment: [%d] %s \n", rv, + apr_strerror(rv, errmsg, sizeof(errmsg))); exit(-3); } + printf("OK\n"); return 0; } From b06e527c27e003fd3453ec98abb2f827d7fecc74 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Wed, 23 Jan 2002 00:03:40 +0000 Subject: [PATCH 2812/7878] Major updates to the Unix shmem implementation: - Name-based shmem now works on all tested platforms (linux, solaris) and on all shmem flavors. - All critical FIXMEs are now fixed. - Much more robust error checking. - Properly implemented attach/detach and destroy routines. - Fixed a couple bugs having to do with the segment length. - Temp files/mmaped files are now removed after use. - mmaped files, temp files, and segments are now created exclusively, meaning that the create function will fail if the file already exists (this has important security implications). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62816 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/shm.h | 6 - shmem/unix/shm.c | 278 ++++++++++++++++++++++++++++------------ 2 files changed, 199 insertions(+), 85 deletions(-) diff --git a/include/arch/unix/shm.h b/include/arch/unix/shm.h index e065ad1b9f3..84afc5b9875 100644 --- a/include/arch/unix/shm.h +++ b/include/arch/unix/shm.h @@ -97,12 +97,6 @@ struct apr_shm_t { apr_size_t reqsize; /* requested segment size */ apr_size_t realsize; /* actual segment size */ const char *filename; /* NULL if anonymous */ -#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO - apr_file_t *file; -#endif -#if APR_USE_SHMEM_MMAP_ANON - /* Nothing else. */ -#endif #if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON int shmid; /* shmem ID returned from shmget() */ #endif diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 639afd7ddb6..d7508cff3e9 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -66,7 +66,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, { apr_shm_t *new_m; apr_status_t status; -#if APR_USE_SHMEM_SHMGET +#if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON struct shmid_ds shmbuf; apr_uid_t uid; apr_gid_t gid; @@ -75,8 +75,12 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, APR_USE_SHMEM_MMAP_ZERO int tmpfd; #endif -#if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON +#if APR_USE_SHMEM_SHMGET apr_size_t nbytes; + key_t shmkey; +#endif +#if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_SHMGET || \ + APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM apr_file_t *file; /* file where metadata is stored */ #endif @@ -96,12 +100,12 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, new_m->filename = NULL; #if APR_USE_SHMEM_MMAP_ZERO - status = apr_file_open(&new_m->file, "/dev/zero", APR_READ | APR_WRITE, + status = apr_file_open(&file, "/dev/zero", APR_READ | APR_WRITE, APR_OS_DEFAULT, pool); if (status != APR_SUCCESS) { return status; } - status = apr_os_file_get(&tmpfd, new_m->file); + status = apr_os_file_get(&tmpfd, file); if (status != APR_SUCCESS) { return status; } @@ -112,8 +116,10 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return errno; } - /* No need to keep the file open after we map it. */ - close(tmpfd); + status = apr_file_close(file); + if (status != APR_SUCCESS) { + return status; + } /* store the real size in the metadata */ *(apr_size_t*)(new_m->base) = new_m->realsize; @@ -159,7 +165,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, if ((new_m->base = shmat(new_m->shmid, NULL, 0)) == (void *)-1) { return errno; } - new_m->usable = new_m->base; if (shmctl(new_m->shmid, IPC_STAT, &shmbuf) == -1) { @@ -205,44 +210,66 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #if APR_USE_SHMEM_MMAP_TMP /* FIXME: Is APR_OS_DEFAULT sufficient? */ - status = apr_file_open(&new_m->file, filename, - APR_READ | APR_WRITE | APR_CREATE, + status = apr_file_open(&file, filename, + APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, APR_OS_DEFAULT, pool); if (status != APR_SUCCESS) { return status; } - if ((status = apr_os_file_get(&tmpfd, new_m->file)) != APR_SUCCESS) { + + status = apr_os_file_get(&tmpfd, file); + if (status != APR_SUCCESS) { + apr_file_close(file); /* ignore errors, we're failing */ + apr_file_remove(new_m->filename, new_m->pool); return status; } - status = apr_file_trunc(new_m->file, new_m->realsize); + + status = apr_file_trunc(file, new_m->realsize); + if (status != APR_SUCCESS) { + apr_file_close(file); /* ignore errors, we're failing */ + apr_file_remove(new_m->filename, new_m->pool); + return status; + } + + new_m->base = mmap(NULL, new_m->realsize, PROT_READ | PROT_WRITE, + MAP_SHARED, tmpfd, 0); + /* FIXME: check for errors */ + + status = apr_file_close(file); if (status != APR_SUCCESS) { - /* FIXME: should we unlink the file here? */ - /* FIXME: should we close the file here? */ return status; } -#elif APR_USE_SHMEM_MMAP_SHM +#endif /* APR_USE_SHMEM_MMAP_TMP */ +#if APR_USE_SHMEM_MMAP_SHM /* FIXME: Is APR_OS_DEFAULT sufficient? */ - tmpfd = shm_open(filename, O_RDWR | O_CREAT, APR_OS_DEFAULT); + tmpfd = shm_open(filename, O_RDWR | O_CREAT | O_EXCL, APR_OS_DEFAULT); if (tmpfd == -1) { return errno; } - apr_os_file_put(&new_m->file, &tmpfd, pool); - /* FIXME: check for errors */ + status = apr_os_file_put(&file, &tmpfd, + APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, + pool); + if (status != APR_SUCCESS) { + return status; + } - status = apr_file_trunc(new_m->file, new_m->realsize); + status = apr_file_trunc(file, new_m->realsize); if (status != APR_SUCCESS) { shm_unlink(filename); /* we're failing, remove the object */ return status; } -#endif /* APR_USE_SHMEM_MMAP_SHM */ - new_m->base = mmap(NULL, reqsize, PROT_READ|PROT_WRITE, + new_m->base = mmap(NULL, reqsize, PROT_READ | PROT_WRITE, MAP_SHARED, tmpfd, 0); - /* FIXME: check for error */ + /* FIXME: check for errors */ - /* FIXME: close the file (can we close the file if we're using - * shm_open? */ + /* FIXME: Is it ok to close this file when using shm_open?? */ + status = apr_file_close(file); + if (status != APR_SUCCESS) { + return status; + } +#endif /* APR_USE_SHMEM_MMAP_SHM */ /* store the real size in the metadata */ *(apr_size_t*)(new_m->base) = new_m->realsize; @@ -257,13 +284,29 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #if APR_USE_SHMEM_SHMGET new_m->realsize = reqsize; - if ((new_m->shmid = shmget(ftok(filename, 1), new_m->realsize, - SHM_R | SHM_W | IPC_CREAT)) < 0) { + /* FIXME: APR_OS_DEFAULT is too permissive, switch to 600 I think. */ + status = apr_file_open(&file, filename, + APR_WRITE | APR_CREATE | APR_EXCL, + APR_OS_DEFAULT, pool); + if (status != APR_SUCCESS) { + return status; + } + + /* ftok() (on solaris at least) requires that the file actually + * exist before calling ftok(). */ + shmkey = ftok(filename, 1); + if (shmkey == (key_t)-1) { + return errno; + } + + if ((new_m->shmid = shmget(shmkey, new_m->realsize, + SHM_R | SHM_W | IPC_CREAT | IPC_EXCL)) < 0) { return errno; } - new_m->base = shmat(new_m->shmid, NULL, 0); - /* FIXME: Handle errors. */ + if ((new_m->base = shmat(new_m->shmid, NULL, 0)) == (void *)-1) { + return errno; + } new_m->usable = new_m->base; if (shmctl(new_m->shmid, IPC_STAT, &shmbuf) == -1) { @@ -276,14 +319,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return errno; } - /* FIXME: APR_OS_DEFAULT is too permissive, switch to 600 I think. */ - status = apr_file_open(&file, filename, - APR_WRITE | APR_CREATE, - APR_OS_DEFAULT, pool); - if (status != APR_SUCCESS) { - return status; - } - nbytes = sizeof(reqsize); status = apr_file_write(file, (const void *)&reqsize, &nbytes); @@ -306,35 +341,74 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) { - /* FIXME: do cleanups based on what was allocated, not what was - * defined at runtime. */ -#if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || APR_USE_SHMEM_MMAP_ZERO - munmap(m->base, m->realsize); - apr_file_close(m->file); - /* FIXME: unlink the file */ -#elif APR_USE_SHMEM_MMAP_ANON - munmap(m->base, m->realsize); -#elif APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON - /* Indicate that the segment is to be destroyed as soon - * as all processes have detached. This also disallows any - * new attachments to the segment. */ - if (shmctl(m->shmid, IPC_RMID, NULL) == -1) { - return errno; - } - if (shmdt(m->base) == -1) { - return errno; + /* anonymous shared memory */ + if (m->filename == NULL) { +#if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_MMAP_ANON + if (munmap(m->base, m->realsize) == -1) { + return errno; + } + return APR_SUCCESS; +#endif +#if APR_USE_SHMEM_SHMGET_ANON + if (shmdt(m->base) == -1) { + return errno; + } + /* This segment will automatically remove itself after all + * references have detached. */ + return APR_SUCCESS; +#endif } + + /* name-based shared memory */ + else { +#if APR_USE_SHMEM_MMAP_TMP + apr_status_t rv; + + if (munmap(m->base, m->realsize) == -1) { + return errno; + } + rv = apr_file_remove(m->filename, m->pool); + if (rv != APR_SUCCESS) { + return rv; + } + return APR_SUCCESS; #endif +#if APR_USE_SHMEM_MMAP_SHM + if (munmap(m->base, m->realsize) == -1) { + return errno; + } + if (shm_unlink(m->filename) == -1) { + return errno; + } + return APR_SUCCESS; +#endif +#if APR_USE_SHMEM_SHMGET + apr_status_t rv; - return APR_SUCCESS; + /* Indicate that the segment is to be destroyed as soon + * as all processes have detached. This also disallows any + * new attachments to the segment. */ + if (shmctl(m->shmid, IPC_RMID, NULL) == -1) { + return errno; + } + if (shmdt(m->base) == -1) { + return errno; + } + rv = apr_file_remove(m->filename, m->pool); + if (rv != APR_SUCCESS) { + return rv; + } + return APR_SUCCESS; +#endif + } + + return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, const char *filename, apr_pool_t *pool) { - apr_status_t status; - if (filename == NULL) { /* It doesn't make sense to attach to a segment if you don't know * the filename. */ @@ -342,38 +416,70 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, } else { #if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM - int tmpfd; - struct stat buf; apr_shm_t *new_m; + apr_status_t status; + int tmpfd; + apr_file_t *file; /* file where metadata is stored */ + apr_size_t nbytes; new_m = apr_palloc(pool, sizeof(apr_shm_t)); if (!new_m) { return APR_ENOMEM; } new_m->pool = pool; - new_m->reqsize = reqsize; - new_m->realsize = reqsize + sizeof(apr_size_t); /* room for metadata */ new_m->filename = apr_pstrdup(pool, filename); /* FIXME: open the file, read the length, mmap the segment, * close the file, reconstruct the apr_shm_t. */ - status = apr_file_open(&new_m->file, filename, - APR_READ | APR_WRITE | APR_CREATE, + status = apr_file_open(&file, filename, + APR_READ | APR_WRITE, APR_OS_DEFAULT, pool); if (status != APR_SUCCESS) { return status; } - if ((status = apr_os_file_get(&tmpfd, new_m->file)) != APR_SUCCESS) { + status = apr_os_file_get(&tmpfd, file); + if (status != APR_SUCCESS) { return status; } + + nbytes = sizeof(new_m->realsize); + status = apr_file_read(file, (void *)&(new_m->realsize), + &nbytes); + if (status != APR_SUCCESS) { + return status; + } + + status = apr_os_file_get(&tmpfd, file); + if (status != APR_SUCCESS) { + apr_file_close(file); /* ignore errors, we're failing */ + apr_file_remove(new_m->filename, new_m->pool); + return status; + } + + new_m->reqsize = new_m->realsize - sizeof(apr_size_t); + + new_m->base = mmap(NULL, new_m->realsize, PROT_READ | PROT_WRITE, + MAP_SHARED, tmpfd, 0); + /* FIXME: check for errors */ + status = apr_file_close(file); + if (status != APR_SUCCESS) { + return status; + } - return APR_ENOTIMPL; + /* metadata isn't usable */ + new_m->usable = new_m->base + sizeof(apr_size_t); + + *m = new_m; + return APR_SUCCESS; -#elif APR_USE_SHMEM_SHMGET +#endif /* APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM */ +#if APR_USE_SHMEM_SHMGET apr_shm_t *new_m; + apr_status_t status; apr_file_t *file; /* file where metadata is stored */ apr_size_t nbytes; + key_t shmkey; new_m = apr_palloc(pool, sizeof(apr_shm_t)); if (!new_m) { @@ -398,38 +504,52 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, return status; } + new_m->filename = apr_pstrdup(pool, filename); new_m->pool = pool; - if ((new_m->shmid = shmget(ftok(filename, 1), 0, - SHM_R | SHM_W)) < 0) { + shmkey = ftok(filename, 1); + if (shmkey == (key_t)-1) { + return errno; + } + if ((new_m->shmid = shmget(shmkey, 0, SHM_R | SHM_W)) == -1) { + return errno; + } + if ((new_m->base = shmat(new_m->shmid, NULL, 0)) == (void *)-1) { return errno; } - new_m->base = shmat(new_m->shmid, NULL, 0); - /* FIXME: handle errors */ new_m->usable = new_m->base; new_m->realsize = new_m->reqsize; *m = new_m; return APR_SUCCESS; -#else - return APR_ENOTIMPL; -#endif +#endif /* APR_USE_SHMEM_SHMGET */ } + + return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) { + if (m->filename == NULL) { + /* It doesn't make sense to detach from an anonymous memory segment. */ + return APR_EINVAL; + } + else { #if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM - /* FIXME: munmap the segment. */ - return APR_ENOTIMPL; -#elif APR_USE_SHMEM_SHMGET - if (shmdt(m->base) == -1) { - return errno; + if (munmap(m->base, m->realsize) == -1) { + return errno; + } + return APR_SUCCESS; +#endif /* APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM */ +#if APR_USE_SHMEM_SHMGET + if (shmdt(m->base) == -1) { + return errno; + } + return APR_SUCCESS; +#endif } - return APR_SUCCESS; -#else + return APR_ENOTIMPL; -#endif } APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) From d46d59bc17051ded2b885e2405be7b13b6818ea7 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Wed, 23 Jan 2002 02:15:44 +0000 Subject: [PATCH 2813/7878] That big of a change should be documented. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62817 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index d87c4d195a2..56dc0ab5903 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Implemented name-based shared memory on Unix. [Aaron Bannert] + *) Fix spelling mistakes in APRDesign. [Blair Zajac ] From aa4c6c7fa1f93629c1e5d46baa51484bb737840d Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Wed, 23 Jan 2002 06:10:30 +0000 Subject: [PATCH 2814/7878] The rest of this issue is undecided, but this patch gets us working on AIX again. On versions where -D_THREAD_SAFE will break the build, passing --disable-threads to configure should get things moving again. Reviewed by: Elrond git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62818 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 17 ++++++++++++++++- build/apr_hints.m4 | 1 - configure.in | 6 ++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 8fb0e6a7a9f..ab3958da3c3 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/01/14 13:45:19 $] +Last modified at [$Date: 2002/01/23 06:10:30 $] Release: @@ -46,6 +46,21 @@ RELEASE SHOWSTOPPERS: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * Using reentrant libraries with non-threaded APR + - Anecdotal evidence exists that suggests it is bad to + mix reentrant and non-reentrant libraries and therefore + we should always use the reentrant versions. + - Unfortunately, on some platforms (AIX 4.2.1) defining + the reentrant flag (-D_THREAD_SAFE) causes builds to fail, + and so one would expect --disable-threads to fix this. + Although this has been fixed for that particular version + of AIX, it may be useful to only enable the reentrant + versions when threads are enabled. + How will we deal with this issue once APR becomes a standalone + library? It is perfectly legitimate to have apps needing + both versions (threaded/reentrant and non-threaded/non-reentrant) + on the same machine. + * Pools debugging - Find a way to do check if a pool is used in multiple threads, while the creation flags say it isn't. IOW, diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 57da49ad4ed..bf4f6ed63c4 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -63,7 +63,6 @@ if test "x$apr_preload_done" != "xyes" ; then APR_ADDTO(CFLAGS, [-qHALT=E]) fi APR_SETIFNULL(apr_iconv_inbuf_const, [1]) - APR_ADDTO(CPPFLAGS, [-D_THREAD_SAFE]) APR_ADDTO(LDFLAGS, [-Wl,-brtl]) ;; *-apollo-*) diff --git a/configure.in b/configure.in index ee2d7d95763..fdb409adaf9 100644 --- a/configure.in +++ b/configure.in @@ -409,6 +409,12 @@ if test "$threads" = "1"; then AC_DEFINE(GETHOSTBYADDR_IS_THREAD_SAFE) fi AC_CHECK_FUNCS(gethostbyname_r gethostbyaddr_r) + + case "$host" in + *-ibm-aix*) + APR_ADDTO(CPPFLAGS, [-D_THREAD_SAFE]) + ;; + esac else echo "APR will be non-threaded" fi From 25101e2045486c97741fc5f0dbb7036ccfd950a9 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 24 Jan 2002 04:28:09 +0000 Subject: [PATCH 2815/7878] Change the new_file parameter of apr_file_dup2() so that it is perfectly clear that it takes an old apr_file_t* object and doesn't create a new one. This makes the function signatures of apr_file_dup() and apr_file_dup2() distinct. Reviewed by: William Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62819 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filedup.c | 8 ++------ file_io/unix/filedup.c | 6 +++--- file_io/win32/filedup.c | 16 ++++++++-------- include/apr_file_io.h | 4 ++-- test/testdup.c | 2 +- 5 files changed, 16 insertions(+), 20 deletions(-) diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index eec3229e6da..940657c231e 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -113,11 +113,7 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_fi -APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p) { - if (*new_file == NULL) { - return APR_EINVAL; - } - - return file_dup(new_file, old_file, p); + return file_dup(&new_file, old_file, p); } diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 7cda84fd346..4b7fb76da16 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -138,13 +138,13 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, } -APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t **new_file, +APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p) { #ifdef NETWARE - return _file_dup(new_file, old_file, p, 1); + return _file_dup(&new_file, old_file, p, 1); #else - return _file_dup(new_file, old_file, p, 2); + return _file_dup(&new_file, old_file, p, 2); #endif } diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 22a728d8fc4..c4717d8cc3e 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -94,7 +94,7 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, } -APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t **new_file, +APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p) { DWORD stdhandle = -1; @@ -134,17 +134,17 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t **new_file, FALSE, DUPLICATE_SAME_ACCESS)) { return apr_get_os_error(); } - if ((*new_file)->filehand) { - CloseHandle((*new_file)->filehand); + if (new_file->filehand) { + CloseHandle(new_file->filehand); } newflags = old_file->flags & ~APR_INHERIT; } - (*new_file)->flags = newflags; - (*new_file)->filehand = newhand; - (*new_file)->fname = apr_pstrdup((*new_file)->cntxt, old_file->fname); - (*new_file)->append = old_file->append; - (*new_file)->buffered = FALSE; + new_file->flags = newflags; + new_file->filehand = newhand; + new_file->fname = apr_pstrdup(new_file->cntxt, old_file->fname); + new_file->append = old_file->append; + new_file->buffered = FALSE; return APR_SUCCESS; } diff --git a/include/apr_file_io.h b/include/apr_file_io.h index c370bec48b2..37d10cd87ab 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -392,13 +392,13 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, /** * duplicate the specified file descriptor and close the original - * @param new_file The structure to duplicate into + * @param new_file The old file that is to be closed and reused * @param old_file The file to duplicate * @param p The pool to use for the new file * * @remark *arg1 MUST point at a valid apr_file_t. It cannot point at NULL */ -APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t **new_file, +APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p); diff --git a/test/testdup.c b/test/testdup.c index 4649b30a0a3..3d1daad043c 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -111,7 +111,7 @@ int main (int argc, char ** argv) APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, p)) - STD_TEST_NEQ(" Dup2 test", apr_file_dup2(&file3, file2, p)) + STD_TEST_NEQ(" Dup2 test", apr_file_dup2(file3, file2, p)) txtlen = sizeof(TEST2); STD_TEST_NEQ(" Write to dup'd file #3", apr_file_write(file3, TEST2, &txtlen)) From 89788165ee7baf1f747c751099ced3dd0af9f741 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 24 Jan 2002 04:30:03 +0000 Subject: [PATCH 2816/7878] apr_file_dup2() prototype change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62820 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 56dc0ab5903..af90f7d7574 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ Changes with APR b1 - *) Implemented name-based shared memory on Unix. [Aaron Bannert] + *) Changed the apr_file_dup2() function prototype. It can only + take and reuse an apr_file_t*, and will no longer create one + if *new_file == NULL (use apr_file_dup() for that). [Aaron Bannert] + + *) Implemented name-based shared memory on Unix. [Aaron Bannert] *) Fix spelling mistakes in APRDesign. [Blair Zajac ] From 630d63220227085b1411dcdd4cc093367f05aded Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 24 Jan 2002 06:12:24 +0000 Subject: [PATCH 2817/7878] Thank you for applying, Aaron! Notice that threadproc/*/proc.c files seem to require a bit more effort yet, to port to the _dup2() flavor. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62821 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index c4717d8cc3e..f607dc8fa36 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -65,14 +65,6 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, HANDLE hproc = GetCurrentProcess(); HANDLE newhand = NULL; - /* XXX Dirty, ugly backward compatibility hack - * This is the reason that dup2 was introduced, - * need to remove this thunk on short order! - */ - if (*new_file) { - return apr_file_dup2(new_file, old_file, p); - } - if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand, 0, FALSE, DUPLICATE_SAME_ACCESS)) { From f0b5b083cd547c366cac4397cf9dd9edcd0f0dea Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 24 Jan 2002 07:45:36 +0000 Subject: [PATCH 2818/7878] Problem resolved; how exactly I'm not certain, but we have no faults creating either anon or named memory now. Of course, reattaching a detached processes anon handle requires some further efforts. An apr_shm_os_get/put should help. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62822 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 2fe26a0d9e8..75404906747 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -143,29 +143,15 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, psec = NULL; } - /* XXX: I had nothing but utter failure on WinNT attempting to specify - * the size of the CreateFileMapping() calls below (given in DWORDs - * as hi-DWORD, lo-DWORD where you see the 0, 0 args.) Consistently, - * Win2K reported insufficient disk space, when that is obviously not - * the case. I'm suspecting size should have been in pages (???) but - * there was no docs in the PSDK that made that implication. - * - * The XXX above is due to the fact that anon allocation dies right now, - * since we can't create a filemapping with size zero, when we don't - * back it with a file. Since I clearly don't understand what Win32 - * has done with this size arg, I'm loath to make the obvious fix. - * Let it fail until I, or someone with time on their hands, wants to - * research, experiment and fix this for good. - */ #if APR_HAS_UNICODE_FS if (apr_os_level >= APR_WIN_NT) { - hMap = CreateFileMappingW(hFile, psec, PAGE_READWRITE, 0, 0, mapkey); + hMap = CreateFileMappingW(hFile, psec, PAGE_READWRITE, 0, size, mapkey); } else #endif { - hMap = CreateFileMappingA(hFile, psec, PAGE_READWRITE, 0, 0, mapkey); + hMap = CreateFileMappingA(hFile, psec, PAGE_READWRITE, 0, size, mapkey); } err = apr_get_os_error(); From 4e8881840d9e82ddd6d828331dbfad4bc0109ac1 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 24 Jan 2002 12:18:18 +0000 Subject: [PATCH 2819/7878] Introduce a new configure option: --enable-pool-debug This allows us to select the pools debug mode at configure time without messing about in source files. At the same time we switch to a flag system, so different debug features can be switched on or off. e.g.: --enable-pool-debug="verbose lifetime" git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62823 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 41 +++++ memory/unix/apr_pools.c | 370 +++++++++++++++++++++++----------------- 2 files changed, 256 insertions(+), 155 deletions(-) diff --git a/configure.in b/configure.in index fdb409adaf9..105261c8a9f 100644 --- a/configure.in +++ b/configure.in @@ -188,6 +188,47 @@ AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build fi )dnl +AC_ARG_ENABLE(pool-debug, + [ --enable-pool-debug[[=yes|no|verbose|lifetime|owner|all]] Turn on pools debugging], + [ if test -z "$enableval"; then + APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG=1) + elif test ! "$enableval" = "no"; then + apr_pool_debug=1 + + for i in $enableval + do + flag=0 + + case $i in + yes) + flag=1 + ;; + verbose) + flag=2 + ;; + lifetime) + flag=4 + ;; + owner) + flag=8 + ;; + all) + apr_pool_debug=15 + ;; + *) + ;; + esac + + if test $flag -gt 0; then + apr_pool_debug=`expr '(' $apr_pool_debug - $apr_pool_debug % \ + '(' $flag '*' 2 ')' ')' + $flag + $apr_pool_debug % $flag` + fi + done + + APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG=$apr_pool_debug) + fi + ]) + dnl Electric Fence malloc checker. dnl --with-efence specifies the path to Electric Fence AC_ARG_WITH(efence, diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index a8d9612676b..5c205570c6f 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -70,6 +70,31 @@ #include /* for malloc, free and abort */ #endif +#include /* for getpid */ + + +/* + * Debug level + */ + +#define APR_POOL_DEBUG_GENERAL 0x01 +#define APR_POOL_DEBUG_VERBOSE 0x02 +#define APR_POOL_DEBUG_LIFETIME 0x04 +#define APR_POOL_DEBUG_OWNER 0x08 + +/* When no level was specified, assume APR_POOL_DEBUG_GENERAL */ +#if defined(APR_POOL_DEBUG) && (APR_POOL_DEBUG != 0) && (APR_POOL_DEBUG - 0 == 0) +#undef APR_POOL_DEBUG +#define APR_POOL_DEBUG APR_POOL_DEBUG_GENERAL +#endif + +/* We don't have debug level 0, assume APR_POOL_DEBUG_GENERAL. */ +#if APR_POOL_DEBUG == 0 +#undef APR_POOL_DEBUG +#define APR_POOL_DEBUG APR_POOL_DEBUG_GENERAL +#endif + + /* * Magic numbers */ @@ -98,7 +123,7 @@ typedef struct cleanup_t cleanup_t; -#if !defined(APR_POOL_DEBUG) +#if !APR_POOL_DEBUG typedef struct allocator_t allocator_t; typedef struct node_t node_t; @@ -121,7 +146,7 @@ struct allocator_t { #define SIZEOF_NODE_T APR_ALIGN_DEFAULT(sizeof(node_t)) #define SIZEOF_ALLOCATOR_T APR_ALIGN_DEFAULT(sizeof(allocator_t)) -#else /* !defined(APR_POOL_DEBUG) */ +#else /* APR_POOL_DEBUG */ typedef struct debug_node_t debug_node_t; @@ -134,7 +159,7 @@ struct debug_node_t { #define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t)) -#endif /* !defined(APR_POOL_DEBUG) */ +#endif /* APR_POOL_DEBUG */ /* The ref field in the apr_pool_t struct holds a * pointer to the pointer referencing this pool. @@ -153,13 +178,13 @@ struct apr_pool_t { apr_hash_t *user_data; const char *tag; -#if !defined(APR_POOL_DEBUG) +#if !APR_POOL_DEBUG allocator_t *allocator; node_t *active; node_t *self; /* The node containing the pool itself */ char *self_first_avail; -#else /* !defined(APR_POOL_DEBUG) */ +#else /* APR_POOL_DEBUG */ debug_node_t *nodes; const char *file_line; apr_uint32_t creation_flags; @@ -167,9 +192,10 @@ struct apr_pool_t { unsigned int stat_total_alloc; unsigned int stat_clear; #if APR_HAS_THREADS - apr_thread_mutex_t *mutex; -#endif -#endif /* !defined(APR_POOL_DEBUG) */ + apr_os_thread_t owner; + apr_thread_mutex_t *mutex; +#endif /* APR_HAS_THREADS */ +#endif /* APR_POOL_DEBUG */ }; #define SIZEOF_POOL_T APR_ALIGN_DEFAULT(sizeof(apr_pool_t)) @@ -182,7 +208,7 @@ struct apr_pool_t { static apr_byte_t apr_pools_initialized = 0; static apr_pool_t *global_pool = NULL; -#if !defined(APR_POOL_DEBUG) +#if !APR_POOL_DEBUG static allocator_t global_allocator = { 0, /* max_index */ #if APR_HAS_THREADS @@ -191,9 +217,9 @@ static allocator_t global_allocator = { NULL, /* owner */ { NULL } /* free[0] */ }; -#endif /* !defined(APR_POOL_DEBUG) */ +#endif /* !APR_POOL_DEBUG */ -#if defined(APR_POOL_DEBUG_VERBOSE) +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) static apr_file_t *file_stderr = NULL; #endif @@ -206,7 +232,7 @@ static void run_child_cleanups(cleanup_t *c); static void free_proc_chain(struct process_chain *procs); -#if !defined(APR_POOL_DEBUG) +#if !APR_POOL_DEBUG /* * Initialization */ @@ -850,73 +876,69 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) } -#else /* !defined(APR_POOL_DEBUG) */ +#else /* APR_POOL_DEBUG */ /* - * Initialization (debug) + * Debug helper functions */ -APR_DECLARE(apr_status_t) apr_pool_initialize(void) +static void apr_pool_log_event(apr_pool_t *pool, const char *event, + const char *file_line, int deref) { - apr_status_t rv; - - if (apr_pools_initialized++) - return APR_SUCCESS; - - /* Since the debug code works a bit differently then the - * regular pools code, we ask for a lock here. The regular - * pools code has got this lock embedded in the global - * allocator, a concept unknown to debug mode. - */ - if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, - APR_POOL_FNEW_ALLOCATOR|APR_POOL_FLOCK)) != APR_SUCCESS) { - return rv; - } - - apr_pool_tag(global_pool, "APR global pool"); - - apr_pools_initialized = 1; - -#if defined(APR_POOL_DEBUG_VERBOSE) - apr_file_open_stderr(&file_stderr, global_pool); +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) if (file_stderr) { - apr_file_printf(file_stderr, - "POOL DEBUG: ACTION [SIZE /POOL SIZE /TOTAL SIZE] " - "POOL TAG [__FILE__:__LINE__] (ALLOCS/TOTAL ALLOCS/CLEARS)\n"); - - apr_file_printf(file_stderr, - "POOL DEBUG: GLOBAL " - "0x%08X \"%s\"\n", - (unsigned int)global_pool, global_pool->tag); - } + if (deref) { + apr_file_printf(file_stderr, + "POOL DEBUG: " + "[%lu" +#if APR_HAS_THREADS + "/%lu" #endif - - return APR_SUCCESS; -} - -APR_DECLARE(void) apr_pool_terminate(void) -{ - if (!apr_pools_initialized) - return; - - apr_pools_initialized = 0; - - apr_pool_destroy(global_pool); /* This will also destroy the mutex */ - global_pool = NULL; - -#if defined(APR_POOL_DEBUG_VERBOSE) - file_stderr = NULL; + "] " + "%7s " + "(%10lu/%10lu/%10lu) " + "0x%08X \"%s\" " + "<%s> " + "(%u/%u/%u) " + "\n", + (unsigned long)getpid(), +#if APR_HAS_THREADS + (unsigned long)apr_os_thread_current(), +#endif + event, + (unsigned long)apr_pool_num_bytes(pool, 0), + (unsigned long)apr_pool_num_bytes(pool, 1), + (unsigned long)apr_pool_num_bytes(global_pool, 1), + (unsigned int)pool, pool->tag, + file_line, + pool->stat_alloc, pool->stat_total_alloc, pool->stat_clear); + } + else { + apr_file_printf(file_stderr, + "POOL DEBUG: " + "[%lu" +#if APR_HAS_THREADS + "/%lu" #endif + "] " + "%7s " + " " + "0x%08X " + "<%s> " + "\n", + (unsigned long)getpid(), +#if APR_HAS_THREADS + (unsigned long)apr_os_thread_current(), +#endif + event, + (unsigned int)pool, + file_line); + } + } +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ } -/* - * Integrity checking - * This basically checks to see if the pool being used is still - * a relative to the global pool. If not it was previously - * destroyed, in which case we abort(). - */ - #if APR_HAS_THREADS -static int pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent, +static int apr_pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent, apr_thread_mutex_t *mutex) { apr_pool_t *child; @@ -930,7 +952,7 @@ static int pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent, child = parent->child; while (child) { - if (pool == child || pool_is_child_of(pool, child, parent->mutex)) { + if (pool == child || apr_pool_is_child_of(pool, child, parent->mutex)) { if (parent->mutex && parent->mutex != mutex) apr_thread_mutex_unlock(parent->mutex); @@ -946,8 +968,9 @@ static int pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent, return 0; } -#else -static int pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent) +#else /* !APR_HAS_THREADS */ +static int apr_pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent, + void *dummy) { apr_pool_t *child; @@ -966,32 +989,103 @@ static int pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent) return 0; } -#endif +#endif /* !APR_HAS_THREADS */ -static void check_integrity(apr_pool_t *pool) +static void apr_pool_check_integrity(apr_pool_t *pool) { + /* Rule of thumb: use of the global pool is always + * ok, since the only user this apr_pools.c. Unless + * people have searched for the top level parent and + * started to use that... + */ if (pool == global_pool || global_pool == NULL) return; -#if APR_HAS_THREADS - if (!pool_is_child_of(pool, global_pool, NULL)) -#else - if (!pool_is_child_of(pool, global_pool)) -#endif - { -#if defined(APR_POOL_DEBUG_VERBOSE) - if (file_stderr) { - apr_file_printf(file_stderr, - "POOL DEBUG: INVALID " - "0x%08X, abort().\n", - (unsigned int)pool); - } -#endif + /* Lifetime + * This basically checks to see if the pool being used is still + * a relative to the global pool. If not it was previously + * destroyed, in which case we abort(). + */ +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) + if (!apr_pool_is_child_of(pool, global_pool, NULL)) { + apr_pool_log_event(pool, "LIFE", + __FILE__ ":apr_pool_integrity check", 0); abort(); } +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) */ + +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER) +#if APR_HAS_THREADS + if (!apr_os_thread_equal(pool->owner, apr_os_thread_current())) { + apr_pool_log_event(pool, "THREAD", + __FILE__ ":apr_pool_integrity check", 0); + abort(); + } +#endif /* APR_HAS_THREADS */ +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER) */ } + +/* + * Initialization (debug) + */ + +APR_DECLARE(apr_status_t) apr_pool_initialize(void) +{ + apr_status_t rv; + + if (apr_pools_initialized++) + return APR_SUCCESS; + + /* Since the debug code works a bit differently then the + * regular pools code, we ask for a lock here. The regular + * pools code has got this lock embedded in the global + * allocator, a concept unknown to debug mode. + */ + if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, + APR_POOL_FNEW_ALLOCATOR|APR_POOL_FLOCK)) != APR_SUCCESS) { + return rv; + } + + apr_pool_tag(global_pool, "APR global pool"); + + apr_pools_initialized = 1; + +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) + apr_file_open_stderr(&file_stderr, global_pool); + if (file_stderr) { + apr_file_printf(file_stderr, + "POOL DEBUG: [PID" +#if APR_HAS_THREADS + "/TID" +#endif + "] ACTION (SIZE /POOL SIZE /TOTAL SIZE) " + "POOL \"TAG\" <__FILE__:__LINE__> (ALLOCS/TOTAL ALLOCS/CLEARS)\n"); + + apr_pool_log_event(global_pool, "GLOBAL", __FILE__ ":apr_pool_initialize", 0); + } +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ + + return APR_SUCCESS; +} + +APR_DECLARE(void) apr_pool_terminate(void) +{ + if (!apr_pools_initialized) + return; + + apr_pools_initialized = 0; + + apr_pool_destroy(global_pool); /* This will also destroy the mutex */ + global_pool = NULL; + +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) + file_stderr = NULL; +#endif +} + + /* * Memory allocation (debug) */ @@ -1001,7 +1095,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) debug_node_t *node; void *mem; - check_integrity(pool); + apr_pool_check_integrity(pool); if ((mem = malloc(size)) == NULL) { if (pool->abort_fn) @@ -1019,6 +1113,8 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) return NULL; } + memset(node, 0, SIZEOF_DEBUG_NODE_T); + node->next = pool->nodes; pool->nodes = node; node->index = 0; @@ -1038,7 +1134,7 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) { void *mem; - check_integrity(pool); + apr_pool_check_integrity(pool); mem = apr_palloc(pool, size); memset(mem, 0, size); @@ -1090,23 +1186,8 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, const char *file_line) { - check_integrity(pool); - -#if defined(APR_POOL_DEBUG_VERBOSE) - if (file_stderr) { - apr_file_printf(file_stderr, - "POOL DEBUG: CLEAR [%10lu/%10lu/%10lu] " - "0x%08X \"%s\" [%s] (%u/%u/%u) " - "parent=0x%08X\n", - (unsigned long)apr_pool_num_bytes(pool, 0), - (unsigned long)apr_pool_num_bytes(pool, 1), - (unsigned long)apr_pool_num_bytes(global_pool, 1), - (unsigned int)pool, pool->tag, - file_line, - pool->stat_alloc, pool->stat_total_alloc, pool->stat_clear, - (unsigned int)pool->parent); - } -#endif + apr_pool_check_integrity(pool); + apr_pool_log_event(pool, "CLEAR", file_line, 1); pool_clear_debug(pool, file_line); } @@ -1114,24 +1195,9 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, const char *file_line) { - check_integrity(pool); + apr_pool_check_integrity(pool); + apr_pool_log_event(pool, "DESTROY", file_line, 1); -#if defined(APR_POOL_DEBUG_VERBOSE) - if (file_stderr) { - apr_file_printf(file_stderr, - "POOL DEBUG: DESTROY [%10lu/%10lu/%10lu] " - "0x%08X \"%s\" [%s] (%u/%u/%u) " - "parent=0x%08X\n", - (unsigned long)apr_pool_num_bytes(pool, 0), - (unsigned long)apr_pool_num_bytes(pool, 1), - (unsigned long)apr_pool_num_bytes(global_pool, 1), - (unsigned int)pool, pool->tag, - file_line, - pool->stat_alloc, pool->stat_total_alloc, pool->stat_clear, - (unsigned int)pool->parent); - } -#endif - pool_clear_debug(pool, file_line); /* Remove the pool from the parents child list */ @@ -1166,10 +1232,12 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, *newpool = NULL; - if (!parent) + if (!parent) { parent = global_pool; - else - check_integrity(parent); + } + else { + apr_pool_check_integrity(parent); + } if (!abort_fn && parent) abort_fn = parent->abort_fn; @@ -1209,6 +1277,10 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, pool->ref = NULL; } +#if APR_HAS_THREADS + pool->owner = apr_os_thread_current(); +#endif + if ((flags & APR_POOL_FNEW_ALLOCATOR) == APR_POOL_FNEW_ALLOCATOR) { #if APR_HAS_THREADS apr_status_t rv; @@ -1237,20 +1309,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, *newpool = pool; -#if defined(APR_POOL_DEBUG_VERBOSE) - if (file_stderr) { - apr_file_printf(file_stderr, - "POOL DEBUG: CREATE [%10lu/%10lu/%10lu] " - "0x%08X \"%s\" [%s] flags=0x%X, parent=0x%08X \"%s\"\n", - (unsigned long)0, - (unsigned long)0, - (unsigned long)apr_pool_num_bytes(global_pool, 1), - (unsigned int)pool, pool->tag, - file_line, - flags, - (unsigned int)parent, parent ? parent->tag : ""); - } -#endif + apr_pool_log_event(pool, "CREATE", file_line, 1); return APR_SUCCESS; } @@ -1327,7 +1386,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) struct psprintf_data ps; debug_node_t *node; - check_integrity(pool); + apr_pool_check_integrity(pool); ps.size = 64; ps.mem = malloc(ps.size); @@ -1495,7 +1554,8 @@ APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void) APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag) { } -#endif /* !defined(APR_POOL_DEBUG) */ + +#endif /* !APR_POOL_DEBUG */ /* @@ -1565,8 +1625,8 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *ke apr_status_t (*cleanup) (void *), apr_pool_t *pool) { -#if defined(APR_POOL_DEBUG) - check_integrity(pool); +#if APR_POOL_DEBUG + apr_pool_check_integrity(pool); #endif if (pool->user_data == NULL) @@ -1590,8 +1650,8 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, const char *k apr_status_t (*cleanup) (void *), apr_pool_t *pool) { -#if defined(APR_POOL_DEBUG) - check_integrity(pool); +#if APR_POOL_DEBUG + apr_pool_check_integrity(pool); #endif if (pool->user_data == NULL) @@ -1607,8 +1667,8 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, const char *k APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *pool) { -#if defined(APR_POOL_DEBUG) - check_integrity(pool); +#if APR_POOL_DEBUG + apr_pool_check_integrity(pool); #endif if (pool->user_data == NULL) @@ -1637,8 +1697,8 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, { cleanup_t *c; -#if defined(APR_POOL_DEBUG) - check_integrity(p); +#if APR_POOL_DEBUG + apr_pool_check_integrity(p); #endif if (p != NULL) { @@ -1656,8 +1716,8 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, { cleanup_t *c, **lastp; -#if defined(APR_POOL_DEBUG) - check_integrity(p); +#if APR_POOL_DEBUG + apr_pool_check_integrity(p); #endif if (p == NULL) @@ -1682,8 +1742,8 @@ APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, { cleanup_t *c; -#if defined(APR_POOL_DEBUG) - check_integrity(p); +#if APR_POOL_DEBUG + apr_pool_check_integrity(p); #endif if (p == NULL) From 2f144b9c9dad0b68bea77ba97c058c34b937761e Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 24 Jan 2002 13:41:17 +0000 Subject: [PATCH 2820/7878] Never consider a commit when you have limited time... Fix for when not in debug mode. Use the correct include file for getpid(). Comment the debug mode layout in the header. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62824 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 60 ++++++++++++++++++++++++++++------------- memory/unix/apr_pools.c | 15 +---------- 2 files changed, 42 insertions(+), 33 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 037afc70e74..231a83e9222 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -59,6 +59,8 @@ extern "C" { #endif + + /** * @file apr_pools.h * @brief APR memory allocation @@ -85,22 +87,42 @@ extern "C" { #define APR_WANT_MEMFUNC #include "apr_want.h" -/* Memory allocation/Pool debugging options... +/** + * Pool debug levels + * + * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + * --------------------------------- + * | | | | | | | | x | General debug code enabled (good for --with-efence) + * + * | | | | | | | x | | Verbose output on stderr (report CREATE, CLEAR, DESTROY) * - * Look in the developer documentation for details of what these do. + * | | | | | | x | | | Lifetime checking. On each use of a pool, check its lifetime. + * If the pool is out of scope, abort(). In combination with + * the verbose flag above, it will output LIFE in such an event + * prior to aborting. * - * NB These should ALL normally be commented out unless you REALLY - * need them!! + * | | | | | x | | | | Pool owner checking. On each use of a pool, check if the + * current thread is the pools owner. If not, abort(). In + * combination with the verbose flag above, it will output OWNER + * in such an event prior to aborting. Use the debug function + * apr_pool_set_owner() to switch a pools ownership. + * + * When no debug level was specified, assume general debug mode. + * If level 0 was specified, debugging is switched off */ -/* -#define APR_POOL_DEBUG -#define APR_POOL_DEBUG_VERBOSE -*/ - -#if defined(APR_POOL_DEBUG_VERBOSE) && !defined(APR_POOL_DEBUG) -#define APR_POOL_DEBUG -#endif - +#if defined(APR_POOL_DEBUG) +# if (APR_POOL_DEBUG != 0) && (APR_POOL_DEBUG - 0 == 0) +# undef APR_POOL_DEBUG +# define APR_POOL_DEBUG 1 +# endif +# if APR_POOL_DEBUG == 0 +# undef APR_POOL_DEBUG +# define APR_POOL_DEBUG 1 +# endif +#else +# define APR_POOL_DEBUG 0 +#endif + #define APR_POOL_STRINGIZE(x) APR_POOL__STRINGIZE(x) #define APR_POOL__STRINGIZE(x) #x #define APR_POOL__FILE_LINE__ __FILE__ ":" APR_POOL_STRINGIZE(__LINE__) @@ -190,7 +212,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_uint32_t flags, const char *file_line); -#if defined(APR_POOL_DEBUG) +#if APR_POOL_DEBUG #define apr_pool_create_ex(newpool, parent, abort_fn, flag) \ apr_pool_create_ex_debug(newpool, parent, abort_fn, flag, \ APR_POOL__FILE_LINE__) @@ -208,7 +230,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, apr_pool_t *parent); #else -#if defined(APR_POOL_DEBUG) +#if APR_POOL_DEBUG #define apr_pool_create(newpool, parent) \ apr_pool_create_ex_debug(newpool, parent, NULL, APR_POOL_FDEFAULT, \ APR_POOL__FILE_LINE__) @@ -231,7 +253,7 @@ APR_DECLARE(void) apr_pool_sub_make(apr_pool_t **newpool, apr_pool_t *parent, int (*apr_abort)(int retcode)); #else -#if defined(APR_POOL_DEBUG) +#if APR_POOL_DEBUG #define apr_pool_sub_make(newpool, parent, abort_fn) \ (void)apr_pool_create_ex_debug(newpool, parent, abort_fn, \ APR_POOL_FDEFAULT, \ @@ -268,7 +290,7 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p, const char *file_line); -#if defined(APR_POOL_DEBUG) +#if APR_POOL_DEBUG #define apr_pool_clear(p) \ apr_pool_clear_debug(p, APR_POOL__FILE_LINE__) #endif @@ -297,7 +319,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, const char *file_line); -#if defined(APR_POOL_DEBUG) +#if APR_POOL_DEBUG #define apr_pool_destroy(p) \ apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__) #endif @@ -532,7 +554,7 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); * * @{ */ -#if defined(APR_POOL_DEBUG) || defined(DOXYGEN) +#if APR_POOL_DEBUG || defined(DOXYGEN) /** * Guarantee that a subpool has the same lifetime as the parent. * @param p The parent pool diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 5c205570c6f..192a1df71ba 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -56,6 +56,7 @@ #include "apr_private.h" #include "apr_portable.h" /* for get_os_proc */ +#include "apr_thread_proc.h" /* for getpid */ #include "apr_strings.h" #include "apr_general.h" #include "apr_pools.h" @@ -70,8 +71,6 @@ #include /* for malloc, free and abort */ #endif -#include /* for getpid */ - /* * Debug level @@ -82,18 +81,6 @@ #define APR_POOL_DEBUG_LIFETIME 0x04 #define APR_POOL_DEBUG_OWNER 0x08 -/* When no level was specified, assume APR_POOL_DEBUG_GENERAL */ -#if defined(APR_POOL_DEBUG) && (APR_POOL_DEBUG != 0) && (APR_POOL_DEBUG - 0 == 0) -#undef APR_POOL_DEBUG -#define APR_POOL_DEBUG APR_POOL_DEBUG_GENERAL -#endif - -/* We don't have debug level 0, assume APR_POOL_DEBUG_GENERAL. */ -#if APR_POOL_DEBUG == 0 -#undef APR_POOL_DEBUG -#define APR_POOL_DEBUG APR_POOL_DEBUG_GENERAL -#endif - /* * Magic numbers From 7093289312498e003da7ae6cd24aaf3a832e84dd Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 24 Jan 2002 13:51:50 +0000 Subject: [PATCH 2821/7878] And that's three... Sheesh, this just isn't my day. Bring the preprocessor code in line with the comment above. Leave APR_POOL_DEBUG alone when it's 0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62825 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 231a83e9222..6fe024d39b7 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -60,7 +60,6 @@ extern "C" { #endif - /** * @file apr_pools.h * @brief APR memory allocation @@ -115,10 +114,6 @@ extern "C" { # undef APR_POOL_DEBUG # define APR_POOL_DEBUG 1 # endif -# if APR_POOL_DEBUG == 0 -# undef APR_POOL_DEBUG -# define APR_POOL_DEBUG 1 -# endif #else # define APR_POOL_DEBUG 0 #endif From 25361b3fcad471788daa2a4e1523f59ca47a7d03 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 24 Jan 2002 22:02:07 +0000 Subject: [PATCH 2822/7878] Fix a small problem with the name of the area we create. This is temporary but gets the server running again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62826 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/beos/shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index 94c8b28b2ef..65de9e102c5 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -83,7 +83,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* we MUST allocate in pages, so calculate how big an area we need... */ pagesize = ((reqsize + B_PAGE_SIZE - 1) / B_PAGE_SIZE) * B_PAGE_SIZE; - newid = create_area(file, (void*)&addr, B_ANY_ADDRESS, + newid = create_area("apr_shmem", (void*)&addr, B_ANY_ADDRESS, pagesize, B_CONTIGUOUS, B_READ_AREA|B_WRITE_AREA); if (newid < 0) From fb14f225eebd39fb3a55c06a9f90268f48a0ebd1 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 24 Jan 2002 23:52:41 +0000 Subject: [PATCH 2823/7878] Deprecate apr_pool_free_blocks_num_bytes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62827 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 6 ------ memory/unix/apr_pools.c | 6 ------ 2 files changed, 12 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 6fe024d39b7..b9b1750eff4 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -572,12 +572,6 @@ APR_DECLARE(apr_pool_t *) apr_find_pool(const void *mem); */ APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse); -/** - * Report the number of bytes currently in the list of free blocks - * @return The number of bytes - */ -APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void); - /** * Lock a pool * @param pool The pool to lock diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 192a1df71ba..90a60972a9b 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1532,12 +1532,6 @@ APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *pool, int recurse) #endif } -APR_DECLARE(apr_size_t) apr_pool_free_blocks_num_bytes(void) -{ - /* This really doesn't apply with our current debug code, so: */ - return 0; -} - APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag) { } From cc20fba82ef8ba6ae3e7dfc86b7469b9ed1dc6bc Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 25 Jan 2002 01:12:09 +0000 Subject: [PATCH 2824/7878] Remove evil spaces following #. Line wrap comments. Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62828 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 63 +++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index b9b1750eff4..c1f3fcb68f1 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -91,31 +91,38 @@ extern "C" { * * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | * --------------------------------- - * | | | | | | | | x | General debug code enabled (good for --with-efence) - * - * | | | | | | | x | | Verbose output on stderr (report CREATE, CLEAR, DESTROY) - * - * | | | | | | x | | | Lifetime checking. On each use of a pool, check its lifetime. - * If the pool is out of scope, abort(). In combination with - * the verbose flag above, it will output LIFE in such an event - * prior to aborting. - * - * | | | | | x | | | | Pool owner checking. On each use of a pool, check if the - * current thread is the pools owner. If not, abort(). In - * combination with the verbose flag above, it will output OWNER - * in such an event prior to aborting. Use the debug function - * apr_pool_set_owner() to switch a pools ownership. + * | | | | | | | | x | General debug code enabled (usefull in + * combination with --with-efence). + * + * | | | | | | | x | | Verbose output on stderr (report + * CREATE, CLEAR, DESTROY). + * + * | | | | | | x | | | Lifetime checking. On each use of a + * pool, check its lifetime. If the pool + * is out of scope, abort(). + * In combination with the verbose flag + * above, it will output LIFE in such an + * event prior to aborting. + * + * | | | | | x | | | | Pool owner checking. On each use of a + * pool, check if the current thread is the + * pools owner. If not, abort(). In + * combination with the verbose flag above, + * it will output OWNER in such an event + * prior to aborting. Use the debug + * function apr_pool_set_owner() to switch + * a pools ownership. * * When no debug level was specified, assume general debug mode. * If level 0 was specified, debugging is switched off */ #if defined(APR_POOL_DEBUG) -# if (APR_POOL_DEBUG != 0) && (APR_POOL_DEBUG - 0 == 0) -# undef APR_POOL_DEBUG -# define APR_POOL_DEBUG 1 -# endif +#if (APR_POOL_DEBUG != 0) && (APR_POOL_DEBUG - 0 == 0) +#undef APR_POOL_DEBUG +#define APR_POOL_DEBUG 1 +#endif #else -# define APR_POOL_DEBUG 0 +#define APR_POOL_DEBUG 0 #endif #define APR_POOL_STRINGIZE(x) APR_POOL__STRINGIZE(x) @@ -582,15 +589,15 @@ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); /* @} */ #else -# ifdef apr_pool_join -# undef apr_pool_join -# endif -# define apr_pool_join(a,b) - -# ifdef apr_pool_lock -# undef apr_pool_lock -# endif -# define apr_pool_lock(pool, lock) +#ifdef apr_pool_join +#undef apr_pool_join +#endif +#define apr_pool_join(a,b) + +#ifdef apr_pool_lock +#undef apr_pool_lock +#endif +#define apr_pool_lock(pool, lock) #endif From a7b14f58fbb1443b1c4e5a639deabd1e44edbf87 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 25 Jan 2002 02:21:43 +0000 Subject: [PATCH 2825/7878] Fix leakage with fds with respect to pipes. dup2() should close the old file descriptor and this new one will be closed when we clean up the pipe. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62829 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 0ee409bbf33..4872f7508af 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -141,10 +141,10 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_fi apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); if (child_in != NULL) - apr_file_dup(&attr->child_in, child_in, attr->cntxt); + apr_file_dup2(attr->child_in, child_in, attr->cntxt); if (parent_in != NULL) - apr_file_dup(&attr->parent_in, parent_in, attr->cntxt); + apr_file_dup2(attr->parent_in, parent_in, attr->cntxt); return APR_SUCCESS; } @@ -157,10 +157,10 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_f apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - apr_file_dup(&attr->child_out, child_out, attr->cntxt); + apr_file_dup2(attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - apr_file_dup(&attr->parent_out, parent_out, attr->cntxt); + apr_file_dup2(attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } @@ -173,10 +173,10 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - apr_file_dup(&attr->child_err, child_err, attr->cntxt); + apr_file_dup2(attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - apr_file_dup(&attr->parent_err, parent_err, attr->cntxt); + apr_file_dup2(attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } From 395ba93e7d7e4795424a3a1d5951a294fcdc6ab7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 25 Jan 2002 07:12:37 +0000 Subject: [PATCH 2826/7878] Win32 requires an apr_os accessor for shm regions. This allows us to take the handle and do interesting things, such as passing it (after duping it) into the child. Unix implementation is simply the address of the shm region, AFAICT, but Aaron is reviewing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62830 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 28 ++++++++++++++++++++++++++++ shmem/win32/shm.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/include/apr_portable.h b/include/apr_portable.h index 11ef5d91d03..bda6aec73b4 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -78,6 +78,7 @@ #include "apr_proc_mutex.h" #include "apr_time.h" #include "apr_dso.h" +#include "apr_shm.h" #if APR_HAVE_DIRENT_H #include @@ -107,6 +108,7 @@ typedef DWORD apr_os_threadkey_t; typedef FILETIME apr_os_imp_time_t; typedef SYSTEMTIME apr_os_exp_time_t; typedef HANDLE apr_os_dso_handle_t; +typedef HANDLE apr_os_shm_t; #elif defined(OS2) typedef HFILE apr_os_file_t; @@ -121,6 +123,7 @@ typedef PULONG apr_os_threadkey_t; typedef struct timeval apr_os_imp_time_t; typedef struct tm apr_os_exp_time_t; typedef HMODULE apr_os_dso_handle_t; +typedef void* apr_os_shm_t; #elif defined(__BEOS__) #include @@ -143,6 +146,7 @@ typedef int apr_os_threadkey_t; typedef struct timeval apr_os_imp_time_t; typedef struct tm apr_os_exp_time_t; typedef image_id apr_os_dso_handle_t; +typedef void* apr_os_shm_t; #elif defined(NETWARE) typedef int apr_os_file_t; @@ -157,6 +161,7 @@ typedef NXKey_t apr_os_threadkey_t; typedef struct timeval apr_os_imp_time_t; typedef struct tm apr_os_exp_time_t; typedef void * apr_os_dso_handle_t; +typedef void* apr_os_shm_t; #else /* Any other OS should go above this one. This is the lowest common @@ -201,6 +206,7 @@ typedef NSModule apr_os_dso_handle_t; #else typedef void * apr_os_dso_handle_t; #endif +typedef void* apr_os_shm_t; #endif @@ -280,6 +286,14 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime); +/** + * convert the shm from apr type to os specific type. + * @param osshm The os specific shm representation + * @param shm The apr shm to convert. + */ +APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, + apr_shm_t *shm); + #if APR_HAS_THREADS || defined(DOXYGEN) /** * @defgroup APR_PORT_Thread Thread portability Routines @@ -423,6 +437,19 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont); +/** + * convert the shared memory from os specific type to apr type. + * @param shm The apr shm representation of osshm + * @param osshm The os specific shm identity + * @param cont The pool to use if it is needed. + * @remark On fork()ed architectures, this is typically nothing more than + * the memory block mapped. On non-fork architectures, this is typically + * some internal handle to pass the mapping from process to process. + */ +APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **shm, + apr_os_shm_t *osshm, + apr_pool_t *cont); + #if APR_HAS_DSO || defined(DOXYGEN) /** @@ -449,6 +476,7 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso, /** @} */ #endif /* APR_HAS_DSO */ + #ifdef __cplusplus } #endif diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 75404906747..8f9b2b7aaf6 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -264,3 +264,35 @@ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) { return m->length; } + +APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, + apr_shm_t *shm) +{ + *osshm = shm->hMap; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **m, + apr_os_shm_t *osshm, + apr_pool_t *pool) +{ + void* base; + base = MapViewOfFile(*osshm, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0); + if (!base) { + return apr_get_os_error(); + } + + *m = (apr_shm_t *) apr_palloc(pool, sizeof(apr_shm_t)); + (*m)->pool = pool; + (*m)->hMap = *osshm; + (*m)->memblk = base; + (*m)->usrmem = (char*)base + sizeof(memblock_t); + /* Real (*m)->mem->size could be recovered with VirtualQuery */ + (*m)->size = (*m)->memblk->size; + (*m)->length = (*m)->memblk->length; + + apr_pool_cleanup_register((*m)->pool, *m, + shm_cleanup, apr_pool_cleanup_null); + return APR_SUCCESS; +} + From 405dbfbede08d310719c09feed30330fa4381928 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 25 Jan 2002 07:16:01 +0000 Subject: [PATCH 2827/7878] Simple workaround, for now. Aaron is researching, but if something obscure is already obvious to OS2/BeOS folks, feel free to round out. I suspect it's simply the pointer to the phys mem, filling out the internals of apr_shm_t, but I'm not certain. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62831 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/beos/shm.c | 14 ++++++++++++++ shmem/os2/shm.c | 14 ++++++++++++++ shmem/unix/shm.c | 13 +++++++++++++ shmem/win32/shm.c | 2 ++ 4 files changed, 43 insertions(+) diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index 65de9e102c5..274a4a04975 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -168,3 +168,17 @@ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) } APR_POOL_IMPLEMENT_ACCESSOR(shm) + +APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, + apr_shm_t *shm) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **m, + apr_os_shm_t *osshm, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c index 8c3c5bc77af..cb922e7d7f3 100644 --- a/shmem/os2/shm.c +++ b/shmem/os2/shm.c @@ -145,3 +145,17 @@ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) } APR_POOL_IMPLEMENT_ACCESSOR(shm) + +APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, + apr_shm_t *shm) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **m, + apr_os_shm_t *osshm, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index d7508cff3e9..f965e9daeea 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -564,3 +564,16 @@ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) APR_POOL_IMPLEMENT_ACCESSOR(shm) +APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, + apr_shm_t *shm) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **m, + apr_os_shm_t *osshm, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 8f9b2b7aaf6..3d619f6d824 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -265,6 +265,8 @@ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) return m->length; } +APR_POOL_IMPLEMENT_ACCESSOR(shm) + APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, apr_shm_t *shm) { From 214b3ab95afc22199a8b121ab8128cab40654977 Mon Sep 17 00:00:00 2001 From: Ben Collins-Sussman Date: Fri, 25 Jan 2002 20:50:32 +0000 Subject: [PATCH 2828/7878] I've been getting compile warnings on FreeBSD 4.4/4.5 for months: "warning: declaration of `mmap' shadows global declaration" This should fix the problem. * apr_mmap.h (apr_mmap_delete, apr_mmap_offset): rename argument to 'mm'. * mmap/unix/mmap/mmap.c (apr_mmap_delete): same. * mmap/unix/mmap/common.c (apr_mmap_offset): same. * mmap/win32/mmap/mmap.c (apr_mmap_delete): same. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62832 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_mmap.h | 4 ++-- mmap/unix/mmap.c | 8 ++++---- mmap/win32/mmap.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/apr_mmap.h b/include/apr_mmap.h index d4113c8dd49..83bba6a47a8 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -177,7 +177,7 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, * Remove a mmap'ed. * @param mmap The mmap'ed file. */ -APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap); +APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm); /** * Move the pointer into the mmap'ed file to the specified offset. @@ -185,7 +185,7 @@ APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap); * @param mmap The mmap'ed file. * @param offset The offset to move to. */ -APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mmap, +APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mm, apr_off_t offset); #endif /* APR_HAS_MMAP */ diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 147317cc62b..99aae562ba1 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -199,15 +199,15 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap) +APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm) { apr_status_t rv; - if (mmap->mm == (void *)-1) + if (mm->mm == (void *)-1) return APR_ENOENT; - if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { - apr_pool_cleanup_kill(mmap->cntxt, mmap, mmap_cleanup); + if ((rv = mmap_cleanup(mm)) == APR_SUCCESS) { + apr_pool_cleanup_kill(mm->cntxt, mm, mmap_cleanup); return APR_SUCCESS; } return rv; diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index 1e944cbaeb3..a410390b763 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -195,12 +195,12 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap) +APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm) { apr_status_t rv; - if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { - apr_pool_cleanup_kill(mmap->cntxt, mmap, mmap_cleanup); + if ((rv = mmap_cleanup(mm)) == APR_SUCCESS) { + apr_pool_cleanup_kill(mm->cntxt, mm, mmap_cleanup); return APR_SUCCESS; } return rv; From 4c25b9a1e3843c5dcde20c8729fac9d53a7da7fe Mon Sep 17 00:00:00 2001 From: Karl Fogel Date: Fri, 25 Jan 2002 21:07:49 +0000 Subject: [PATCH 2829/7878] (apr_file_write_full): Clarify documentation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62833 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 37d10cd87ab..0c2e843e5df 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -329,7 +329,9 @@ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, * will block until they can be written. Exceptional error such as * "out of space" or "pipe closed" will terminate with an error. * - * It is possible for both bytes to be written and an error to be returned. + * It is possible for both bytes to be written and an error to be + * returned. And if *bytes_written is less than nbytes, an + * accompanying error is _always_ returned. * * APR_EINTR is never returned. */ From f35b56af7b07ca9148a43b5ae9ad20e74754e3f1 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 25 Jan 2002 23:37:28 +0000 Subject: [PATCH 2830/7878] Added symbol prefixing to the export list git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62834 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_nw_export.awk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index 1e270de2a64..1d848105139 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -1,6 +1,10 @@ # Based on apr's make_export.awk, which is # based on Ryan Bloom's make_export.pl +BEGIN { + printf(" (APRLIB)\n") +} + # List of functions that we don't support, yet?? #/apr_##name##_set_inherit/{next} #/apr_##name##_unset_inherit/{next} @@ -54,6 +58,7 @@ function add_symbol (sym_name) { add_symbol(varname); } + #END { # printf(" %s", line) #} From 0ffa1aed5e22684a5747c02523e549176ca51704 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 26 Jan 2002 23:02:32 +0000 Subject: [PATCH 2831/7878] get a --disable-threads --enable-pool-debug built to compile again git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62835 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 90a60972a9b..f624c453644 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -967,7 +967,7 @@ static int apr_pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent, child = parent->child; while (child) { - if (pool == child || pool_is_child_of(pool, child)) { + if (pool == child || apr_pool_is_child_of(pool, child, NULL)) { return 1; } From d6ec2adce9ad88799de6d4bd406daa899567dcbd Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 28 Jan 2002 05:32:32 +0000 Subject: [PATCH 2832/7878] OS/2: Implement apr_os_shm_get/put. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62836 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/os2/shm.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c index cb922e7d7f3..9830ba2054e 100644 --- a/shmem/os2/shm.c +++ b/shmem/os2/shm.c @@ -57,6 +57,7 @@ #include "apr_errno.h" #include "apr_lib.h" #include "apr_strings.h" +#include "apr_portable.h" struct apr_shm_t { apr_pool_t *pool; @@ -149,13 +150,27 @@ APR_POOL_IMPLEMENT_ACCESSOR(shm) APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, apr_shm_t *shm) { - return APR_ENOTIMPL; + *osshm = shm->memblock; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **m, apr_os_shm_t *osshm, apr_pool_t *pool) { - return APR_ENOTIMPL; + int rc; + apr_shm_t *newm = (apr_shm_t *)apr_palloc(pool, sizeof(apr_shm_t)); + ULONG flags = PAG_COMMIT|PAG_READ|PAG_WRITE; + + newm->pool = pool; + + rc = DosGetSharedMem(&(newm->memblock), flags); + + if (rc) { + return APR_FROM_OS_ERROR(rc); + } + + *m = newm; + return APR_SUCCESS; } From 2a133ffda15abefda2912b2bd5a39b12d2b6baa1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 28 Jan 2002 15:56:08 +0000 Subject: [PATCH 2833/7878] Mladen Turk's WinCE port. Nearly, the apr.hw patch needs some review. In short, several quite standard ansi headers (e.g. time.h) aren't present in the WinCT port, but these changes require corresponding changes to apr.h.in. I changed Mladen's #define'd symbol names for the macro blocks to IF_WIN_OS_IS_UNICODE and ELSE_WIN_OS_IS_ANSI to make the code a bit more readable, and drop the global apr_os_level from each macro invocation. Also, I changed the scope of his APR_HAS_ANSI_FS to local scope, since it has no application in the public headers. Mladen's patch helps NT as well, allowing the /D WINNT flag to define NT-only compilations. With WINNT defined, all UNICODE/ANSI os version tests drop out entirely. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62837 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 6 ++++-- file_io/win32/dir.c | 37 +++++++++++++++++++++----------- file_io/win32/filestat.c | 10 ++++++--- file_io/win32/filesys.c | 24 ++++++++++++++------- file_io/win32/open.c | 27 ++++++++++++++++-------- include/arch/win32/fileio.h | 2 ++ include/arch/win32/misc.h | 42 ++++++++++++++++++++++++++++++++++--- misc/win32/misc.c | 13 ++++++++++++ shmem/win32/shm.c | 12 +++++++---- threadproc/win32/proc.c | 14 +++++++++---- user/win32/userinfo.c | 9 +++++--- 11 files changed, 148 insertions(+), 48 deletions(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 974bf977555..56b31beaac9 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -89,7 +89,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, UINT em; #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) + IF_WIN_OS_IS_UNICODE { apr_wchar_t wpath[APR_PATH_MAX]; if ((rv = utf8_to_unicode_path(wpath, sizeof(wpath) @@ -107,8 +107,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, rv = apr_get_os_error(); SetErrorMode(em); } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { char fspec[APR_PATH_MAX], *p = fspec; /* Must convert path from / to \ notation. @@ -132,6 +133,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, rv = APR_SUCCESS; SetErrorMode(em); } +#endif *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); (*res_handle)->cont = ctx; diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 0c6a217526a..96484b57472 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -100,15 +100,16 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, (*new)->dirname[len] = '\0'; #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) + IF_WIN_OS_IS_UNICODE { /* Create a buffer for the longest file name we will ever see */ (*new)->w.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); (*new)->name = apr_pcalloc(cont, APR_FILE_MAX * 3 + 1); } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { /* Note that we won't open a directory that is greater than MAX_PATH, * including the trailing /* wildcard suffix. If a * won't fit, then @@ -122,6 +123,7 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, } (*new)->n.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); } +#endif (*new)->rootlen = len - 1; (*new)->cntxt = cont; (*new)->dirhand = INVALID_HANDLE_VALUE; @@ -147,7 +149,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, #if APR_HAS_UNICODE_FS apr_wchar_t wdirname[APR_PATH_MAX]; apr_wchar_t *eos = NULL; - if (apr_os_level >= APR_WIN_NT) + IF_WIN_OS_IS_UNICODE { if (thedir->dirhand == INVALID_HANDLE_VALUE) { @@ -181,8 +183,9 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, return rv; fname = thedir->name; } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { char *eop = strchr(thedir->dirname, '\0'); if (thedir->dirhand == INVALID_HANDLE_VALUE) { @@ -208,6 +211,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, } fname = thedir->n.entry->cFileName; } +#endif fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) thedir->w.entry, 0, wanted); @@ -220,7 +224,8 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, /* Go back and get more_info if we can't answer the whole inquiry */ #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) { + IF_WIN_OS_IS_UNICODE + { /* Almost all our work is done. Tack on the wide file name * to the end of the wdirname (already / delimited) */ @@ -231,13 +236,16 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, eos[0] = '\0'; return rv; } - else { +#endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI + { +#if APR_HAS_UNICODE_FS /* Don't waste stack space on a second buffer, the one we set * aside for the wide directory name is twice what we need. */ char *fspec = (char*)wdirname; -#else /* !APR_HAS_UNICODE_FS */ - { +#else char fspec[APR_PATH_MAX]; #endif int dirlen = strlen(thedir->dirname); @@ -247,6 +255,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_cpystrn(fspec + dirlen, fname, sizeof(fspec) - dirlen); return more_finfo(finfo, fspec, wanted, MORE_OF_FSPEC); } +#endif } return APR_SUCCESS; @@ -264,7 +273,7 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) + IF_WIN_OS_IS_UNICODE { apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; @@ -276,18 +285,20 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, return apr_get_os_error(); } } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI if (!CreateDirectory(path, NULL)) { return apr_get_os_error(); } +#endif return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) + IF_WIN_OS_IS_UNICODE { apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; @@ -299,11 +310,13 @@ APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont) return apr_get_os_error(); } } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI if (!RemoveDirectory(path)) { return apr_get_os_error(); } +#endif return APR_SUCCESS; } diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 8952f79d050..0f2fe43e48a 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -476,7 +476,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, } #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) { + IF_WIN_OS_IS_UNICODE + { if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) / sizeof(apr_wchar_t), fname)) return rv; @@ -505,8 +506,9 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, filename = apr_pstrdup(cont, tmpname); } } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI if ((apr_os_level >= APR_WIN_98) && (!(wanted & APR_FINFO_NAME) || isroot)) { /* cannot use FindFile on a Win98 root, it returns \* @@ -550,6 +552,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, FindClose(hFind); filename = apr_pstrdup(cont, FileInfo.n.cFileName); } +#endif if (ident_rv != APR_INCOMPLETE) { if (fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, @@ -559,7 +562,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * to reliably translate char devices to the path '\\.\device' * so go ask for the full path. */ - if (apr_os_level >= APR_WIN_NT) { + IF_WIN_OS_IS_UNICODE + { #if APR_HAS_UNICODE_FS apr_wchar_t tmpname[APR_FILE_MAX]; apr_wchar_t *tmpoff; diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c index 09e1f9a72ba..9158472c7e2 100644 --- a/file_io/win32/filesys.c +++ b/file_io/win32/filesys.c @@ -120,7 +120,7 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, { char path[APR_PATH_MAX]; #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) + IF_WIN_OS_IS_UNICODE { apr_wchar_t *ignored; apr_wchar_t wdrive[8]; @@ -136,8 +136,9 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) return rv; } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { char *ignored; char drivestr[4]; @@ -148,6 +149,7 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, if (!GetFullPathName(drivestr, sizeof(path), path, &ignored)) return apr_get_os_error(); } +#endif if (!(flags & APR_FILEPATH_NATIVE)) { for (*rootpath = path; **rootpath; ++*rootpath) { if (**rootpath == '\\') @@ -162,7 +164,7 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) { #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) + IF_WIN_OS_IS_UNICODE { apr_wchar_t *ignored; apr_wchar_t wpath[APR_PATH_MAX]; @@ -183,8 +185,9 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) return rv; *rootpath = apr_pstrdup(p, (char*)wroot); } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { char path[APR_PATH_MAX]; char *ignored; @@ -192,6 +195,7 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) return apr_get_os_error(); *rootpath = apr_pstrdup(p, path); } +#endif return APR_SUCCESS; } @@ -201,7 +205,7 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_int32_t flags, { char path[APR_PATH_MAX]; #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) + IF_WIN_OS_IS_UNICODE { apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; @@ -210,12 +214,14 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_int32_t flags, if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) return rv; } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { if (!GetCurrentDirectory(sizeof(path), path)) return apr_get_os_error(); } +#endif if (!(flags & APR_FILEPATH_NATIVE)) { for (*rootpath = path; **rootpath; ++*rootpath) { if (**rootpath == '\\') @@ -231,7 +237,7 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath, apr_pool_t *p) { #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) + IF_WIN_OS_IS_UNICODE { apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; @@ -241,11 +247,13 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath, if (!SetCurrentDirectoryW(wpath)) return apr_get_os_error(); } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { if (!SetCurrentDirectory(rootpath)) return apr_get_os_error(); } +#endif return APR_SUCCESS; } diff --git a/file_io/win32/open.c b/file_io/win32/open.c index cbc57950afc..af821c17cd8 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -168,7 +168,8 @@ apr_status_t unicode_to_utf8_path(char* retstr, apr_size_t retlen, void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) { #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) { + IF_WIN_OS_IS_UNICODE + { apr_wchar_t *wpre, *wfile, *ch; apr_size_t n = strlen(file) + 1; apr_size_t r, d; @@ -205,8 +206,9 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) } return wfile; } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { char *nfile, *ch; apr_size_t n = strlen(file) + 1; @@ -247,6 +249,7 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) } return nfile; } +#endif } @@ -333,7 +336,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, } #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) { + IF_WIN_OS_IS_UNICODE + { apr_wchar_t wfname[APR_PATH_MAX]; if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) / sizeof(apr_wchar_t), fname)) @@ -341,11 +345,12 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, handle = CreateFileW(wfname, oflags, sharemode, NULL, createflags, attributes, 0); } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI handle = CreateFileA(fname, oflags, sharemode, NULL, createflags, attributes, 0); - +#endif if (handle == INVALID_HANDLE_VALUE) { return apr_get_os_error(); } @@ -424,7 +429,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) { #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) + IF_WIN_OS_IS_UNICODE { apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; @@ -435,10 +440,12 @@ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) if (DeleteFileW(wpath)) return APR_SUCCESS; } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI if (DeleteFile(path)) return APR_SUCCESS; +#endif return apr_get_os_error(); } @@ -446,7 +453,7 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, const char *topath, apr_pool_t *cont) { - if (apr_os_level >= APR_WIN_NT) + IF_WIN_OS_IS_UNICODE { #if APR_HAS_UNICODE_FS apr_wchar_t wfrompath[APR_PATH_MAX], wtopath[APR_PATH_MAX]; @@ -468,7 +475,8 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, return APR_SUCCESS; #endif } - else +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { /* Windows 95 and 98 do not support MoveFileEx, so we'll use * the old MoveFile function. However, MoveFile requires that @@ -488,6 +496,7 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, if (MoveFile(frompath, topath)) return APR_SUCCESS; } +#endif return apr_get_os_error(); } diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 77d4979378d..01f761e3c63 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -225,9 +225,11 @@ struct apr_dir_t { WIN32_FIND_DATAW *entry; } w; #endif +#if APR_HAS_ANSI_FS struct { WIN32_FIND_DATAA *entry; } n; +#endif }; }; diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 454deb5cf0c..5f5f6762e8f 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -112,15 +112,22 @@ typedef enum { APR_WIN_98 = 14, APR_WIN_98_SE = 16, APR_WIN_ME = 18, - APR_WIN_NT = 30, - APR_WIN_NT_3_5 = 35, + + APR_WIN_UNICODE = 20, /* Prior versions support only narrow chars */ + + APR_WIN_CE_3 = 23, /* CE is an odd beast, not supporting */ + /* some pre-NT features, such as the */ + APR_WIN_NT = 30, /* narrow charset APIs (fooA fns), while */ + APR_WIN_NT_3_5 = 35, /* not supporting some NT-family features. */ APR_WIN_NT_3_51 = 36, + APR_WIN_NT_4 = 40, APR_WIN_NT_4_SP2 = 42, APR_WIN_NT_4_SP3 = 43, APR_WIN_NT_4_SP4 = 44, APR_WIN_NT_4_SP5 = 45, APR_WIN_NT_4_SP6 = 46, + APR_WIN_2000 = 50, APR_WIN_2000_SP1 = 51, APR_WIN_2000_SP2 = 52, @@ -129,6 +136,36 @@ typedef enum { extern apr_oslevel_e apr_os_level; +apr_status_t apr_get_oslevel(struct apr_pool_t *, apr_oslevel_e *); + +/* The APR_HAS_ANSI_FS symbol is PRIVATE, and internal to APR. + * APR only supports char data for filenames. Like most applications, + * characters >127 are essentially undefined. APR_HAS_UNICODE_FS lets + * the application know that utf-8 is the encoding method of APR, and + * only incidently hints that we have Wide OS calls. + * + * APR_HAS_ANSI_FS is simply an OS flag to tell us all calls must be + * the unicode eqivilant. + */ + +#if defined(_WIN32_WCE) || defined(WINNT) +#define APR_HAS_ANSI_FS 0 +#else +#define APR_HAS_ANSI_FS 1 +#endif + +/* IF_WIN_OS_IS_UNICODE / ELSE_WIN_OS_IS_ANSI help us keep the code trivial + * where have runtime tests for unicode-ness, that aren't needed in any + * build which supports only WINNT or WCE. + */ +#if APR_HAS_ANSI_FS && APR_HAS_UNICODE_FS +#define IF_WIN_OS_IS_UNICODE if (apr_os_level >= APR_WIN_UNICODE) +#define ELSE_WIN_OS_IS_ANSI else +#else APR_HAS_UNICODE_FS +#define IF_WIN_OS_IS_UNICODE +#define ELSE_WIN_OS_IS_ANSI +#endif /* WINNT */ + typedef enum { DLL_WINBASEAPI = 0, // kernel32 From WinBase.h DLL_WINADVAPI = 1, // advapi32 From WinBase.h @@ -254,7 +291,6 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetSecurityInfo, 0, ( ppDacl, ppSacl, ppSecurityDescriptor)); #define GetSecurityInfo apr_winapi_GetSecurityInfo -apr_status_t apr_get_oslevel(struct apr_pool_t *, apr_oslevel_e *); #endif /* WIN32 */ #endif /* ! MISC_H */ diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 102db5db8f6..fdcfd450579 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -122,6 +122,7 @@ apr_status_t apr_get_oslevel(apr_pool_t *cont, apr_oslevel_e *level) apr_os_level = APR_WIN_XP; } } +#ifndef WINNT else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { char *prevision; if (prevision = oslev.szCSDVersion) { @@ -147,6 +148,18 @@ apr_status_t apr_get_oslevel(apr_pool_t *cont, apr_oslevel_e *level) apr_os_level = APR_WIN_ME; } } +#endif +#ifdef _WIN32_WCE + else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_CE) + { + if (oslev.dwMajorVersion < 3) { + apr_os_level = APR_WIN_UNSUP; + } + else { + apr_os_level = APR_WIN_CE_3; + } + } +#endif else { apr_os_level = APR_WIN_UNSUP; } diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 3d619f6d824..41919ab4f83 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -144,15 +144,17 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, } #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) + IF_WIN_OS_IS_UNICODE { hMap = CreateFileMappingW(hFile, psec, PAGE_READWRITE, 0, size, mapkey); } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { hMap = CreateFileMappingA(hFile, psec, PAGE_READWRITE, 0, size, mapkey); } +#endif err = apr_get_os_error(); if (file) { @@ -214,15 +216,17 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, } #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) + IF_WIN_OS_IS_UNICODE { hMap = OpenFileMappingW(FILE_MAP_READ | FILE_MAP_WRITE, FALSE, mapkey); } - else #endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { hMap = OpenFileMappingA(FILE_MAP_READ | FILE_MAP_WRITE, FALSE, mapkey); } +#endif if (!hMap) { return apr_get_os_error(); diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index bd831759bb9..10ea0f85072 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -386,7 +386,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, ++iEnvBlockLen; #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) { + IF_WIN_OS_IS_UNICODE + { apr_wchar_t *pNext; pEnvBlock = (char *)apr_palloc(cont, iEnvBlockLen * 2); dwCreationFlags |= CREATE_UNICODE_ENVIRONMENT; @@ -407,8 +408,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, *(pNext++) = L'\0'; *pNext = L'\0'; } - else #endif /* APR_HAS_UNICODE_FS */ +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { char *pNext; pEnvBlock = (char *)apr_palloc(cont, iEnvBlockLen); @@ -424,10 +426,11 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, *(pNext++) = '\0'; *pNext = '\0'; } +#endif /* APR_HAS_ANSI_FS */ } #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) + IF_WIN_OS_IS_UNICODE { STARTUPINFOW si; apr_size_t nprg = strlen(progname) + 1; @@ -482,8 +485,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, wcwd, /* Current directory name */ &si, &pi); } - else { #endif /* APR_HAS_UNICODE_FS */ +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI + { STARTUPINFOA si; memset(&si, 0, sizeof(si)); si.cb = sizeof(si); @@ -512,6 +517,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, attr->currdir, /* Current directory name */ &si, &pi); } +#endif /* APR_HAS_ANSI_FS */ /* Check CreateProcess result */ diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 10ced7d09e8..54ba7e9cbdc 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -135,7 +135,8 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use return APR_FROM_OS_ERROR(rv); #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) { + IF_WIN_OS_IS_UNICODE + { keylen = sizeof(regkey); rv = RegQueryValueExW(key, L"ProfileImagePath", NULL, &type, @@ -162,8 +163,9 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use else return APR_ENOENT; } - else -#endif /* APR_HAS_UNICODE_FS */ +#endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { keylen = sizeof(regkey); rv = RegQueryValueEx(key, "ProfileImagePath", NULL, &type, @@ -182,6 +184,7 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use else return APR_ENOENT; } +#endif /* APR_HAS_ANSI_FS */ for (fixch = *dirname; *fixch; ++fixch) if (*fixch == '\\') *fixch = '/'; From 61ac10025e449f3a783ae0712a586a1d7ba4fe65 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 28 Jan 2002 19:34:10 +0000 Subject: [PATCH 2834/7878] Some changes proposed by Mladen Turk that simplify the Windows CE port, this patch does little, on it's own, other than to respect the APR_HAVE_FOO_H headers we already defined. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62838 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 110 +++++++++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 54 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 5de59ccf378..ed68bbc9707 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -65,7 +65,6 @@ * @{ */ - #ifdef WIN32 #ifndef APR_H #define APR_H @@ -76,59 +75,6 @@ #pragma warning(push, 3) #endif -/* Has windows.h already been included? If so, our preferences don't matter, - * but we will still need the winsock things no matter what was included. - * If not, include a restricted set of windows headers to our tastes. - */ -#ifndef _WINDOWS_ -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#ifndef _WIN32_WINNT - -/* Restrict the server to a subset of Windows NT 4.0 header files by default - */ -#define _WIN32_WINNT 0x0400 -#endif -#ifndef NOUSER -#define NOUSER -#endif -#ifndef NOGDI -#define NOGDI -#endif -#ifndef NONLS -#define NONLS -#endif -#ifndef NOMCX -#define NOMCX -#endif -#ifndef NOIME -#define NOIME -#endif -#include -/* - * Add a _very_few_ declarations missing from the restricted set of headers - * (If this list becomes extensive, re-enable the required headers above!) - * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now - */ -#define SW_HIDE 0 -#include -#include -#endif /* !_WINDOWS_ */ - -#include -#include -#include -#include -#include -#include - -/* Done with badly written headers - */ -#if defined(_MSC_VER) && _MSC_VER >= 1200 -#pragma warning(pop) -#endif - /* disable or reduce the frequency of... * C4057: indirection to slightly different base types * C4075: slight indirection changes (unsigned short* vs short[]) @@ -220,10 +166,60 @@ #define APR_HAVE_UNION_SEMUN 0 +/* Has windows.h already been included? If so, our preferences don't matter, + * but we will still need the winsock things no matter what was included. + * If not, include a restricted set of windows headers to our tastes. + */ +#ifndef _WINDOWS_ +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#ifndef _WIN32_WINNT + +/* Restrict the server to a subset of Windows NT 4.0 header files by default + */ +#define _WIN32_WINNT 0x0400 +#endif +#ifndef NOUSER +#define NOUSER +#endif +#ifndef NOGDI +#define NOGDI +#endif +#ifndef NONLS +#define NONLS +#endif +#ifndef NOMCX +#define NOMCX +#endif +#ifndef NOIME +#define NOIME +#endif +#include +/* + * Add a _very_few_ declarations missing from the restricted set of headers + * (If this list becomes extensive, re-enable the required headers above!) + * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now + */ +#define SW_HIDE 0 +#include +#include +#endif /* !_WINDOWS_ */ + +#if APR_HAVE_STDLIB_H +#include +#endif +#if APR_HAVE_STDIO_H +#include +#endif #if APR_HAVE_SYS_TYPES_H #include #endif +#include +#include +#include + /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY 1 #define APR_HAS_THREADS 1 @@ -366,6 +362,12 @@ struct iovec { #define APR_PATH_MAX MAX_PATH #endif +/* Done with badly written headers + */ +#if defined(_MSC_VER) && _MSC_VER >= 1200 +#pragma warning(pop) +#endif + #endif /* APR_H */ #endif /* WIN32 */ /** @} */ From a37b1b5edfb03169ecbc8051e2b0b77cc1fa184f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 28 Jan 2002 19:35:25 +0000 Subject: [PATCH 2835/7878] Mladen's patch for WinCE compatibility indicated we might need the Win32 National Language support. Re-introduce it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62839 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index ed68bbc9707..ab67501bb40 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -186,9 +186,6 @@ #ifndef NOGDI #define NOGDI #endif -#ifndef NONLS -#define NONLS -#endif #ifndef NOMCX #define NOMCX #endif From 7c9e5ea9029af750450bd8358cb3f117d1db6ac1 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 28 Jan 2002 21:58:16 +0000 Subject: [PATCH 2836/7878] Add a couple new command types to process creation: APR_PROGRAM_ENV: start the program using the caller's environment APR_PROGRAM_PATH: search PATH for the program, use caller's env (the normal APR_PROGRAM isolates the env and does not use PATH) The BeOS, OS/2, and Win32 implementations are incomplete. These two new forms just default back to APR_PROGRAM for now. (although BeOS doesn't even distinguish between APR_SHELLCMD and APR_PROGRAM!) On Unix and Netware, these map into execv() and execvp() calls. Also clarified some doc for the enums in apr_thread_proc.h a bit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62840 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 33 +++++++++++++++++++++++++-------- threadproc/beos/proc.c | 2 ++ threadproc/netware/proc.c | 15 ++++++++++++++- threadproc/os2/proc.c | 2 ++ threadproc/unix/proc.c | 15 ++++++++++++++- threadproc/win32/proc.c | 2 ++ 6 files changed, 59 insertions(+), 10 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 7a680971d8e..dcc9cec32ee 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -71,7 +71,7 @@ extern "C" { #endif /* __cplusplus */ /** * @file apr_thread_proc.h - * @brief APR Thread Library + * @brief APR Thread and Process Library */ /** * @defgroup APR_Thread Thread Library @@ -79,15 +79,28 @@ extern "C" { * @{ */ -typedef enum {APR_SHELLCMD, APR_PROGRAM} apr_cmdtype_e; -typedef enum {APR_WAIT, APR_NOWAIT} apr_wait_how_e; +typedef enum { + APR_SHELLCMD, /**< use the shell to invoke the program */ + APR_PROGRAM, /**< invoke the program directly, no copied env */ + APR_PROGRAM_ENV, /**< invoke the program, replicating our environment */ + APR_PROGRAM_PATH /**< find program on PATH, use our environment */ +} apr_cmdtype_e; + +typedef enum { + APR_WAIT, /**< wait for the specified process to finish */ + APR_NOWAIT /**< do not wait -- just see if it has finished */ +} apr_wait_how_e; + /* I am specifically calling out the values so that the macros below make * more sense. Yes, I know I don't need to, but I am hoping this makes what * I am doing more clear. If you want to add more reasons to exit, continue * to use bitmasks. */ -typedef enum {APR_PROC_EXIT = 1, APR_PROC_SIGNAL = 2, - APR_PROC_SIGNAL_CORE = 4} apr_exit_why_e; +typedef enum { + APR_PROC_EXIT = 1, /**< process exited normally */ + APR_PROC_SIGNAL = 2, /**< process exited due to a signal */ + APR_PROC_SIGNAL_CORE = 4 /**< process exited and dumped a core file */ +} apr_exit_why_e; #define APR_PROC_CHECK_EXIT(x) (x & APR_PROC_EXIT) #define APR_PROC_CHECK_SIGNALED(x) (x & APR_PROC_SIGNAL) @@ -428,8 +441,10 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, * @param attr The procattr we care about. * @param cmd The type of command. One of: *

    + * @param attr_mask Mask of valid bits in attributes. * @param cont the pool to use. * @remark This function should be used in preference to explict manipulation * of the file permissions, because the operations to provide these @@ -593,6 +594,7 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, */ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, + apr_fileattrs_t attr_mask, apr_pool_t *cont); /** From b0ee21bd7eaa4c2b8e05103e369020731ef4c26a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 00:06:04 +0000 Subject: [PATCH 2939/7878] Symbolic rather than explicit value - no need to push into .32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62944 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index f607dc8fa36..af8dd2f083f 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -109,7 +109,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, stdhandle = STD_INPUT_HANDLE; } - if (stdhandle != -1) { + if (stdhandle != INVALID_HANDLE_VALUE) { if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand, 0, TRUE, DUPLICATE_SAME_ACCESS)) { From 2b44bd160f11a4cefc9a448615817ab303e42111 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 00:07:34 +0000 Subject: [PATCH 2940/7878] I don't trust that the OS is even returning an error - if the handle is an invalid handle - I'm not certain that's an error. Certainly this code is safer - merits pushing into .32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62945 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 4cd802813cb..db89eae89a5 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -534,7 +534,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t file_handle = GetStdHandle(STD_ERROR_HANDLE); if (file_handle == INVALID_HANDLE_VALUE) - return apr_get_os_error(); + return APR_EINVAL; return apr_os_file_put(thefile, &file_handle, 0, cont); } @@ -545,7 +545,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t file_handle = GetStdHandle(STD_OUTPUT_HANDLE); if (file_handle == INVALID_HANDLE_VALUE) - return apr_get_os_error(); + return APR_EINVAL; return apr_os_file_put(thefile, &file_handle, 0, cont); } @@ -556,7 +556,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t * file_handle = GetStdHandle(STD_INPUT_HANDLE); if (file_handle == INVALID_HANDLE_VALUE) - return apr_get_os_error(); + return APR_EINVAL; return apr_os_file_put(thefile, &file_handle, 0, cont); } From 19588b5e45252fd6f5edc706be1cde1ddeafe1e4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 00:09:10 +0000 Subject: [PATCH 2941/7878] My misinterpretation. -1 is our interal flag for a invalid handle - it is not a win32 HANDLE value. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62946 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index af8dd2f083f..f607dc8fa36 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -109,7 +109,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, stdhandle = STD_INPUT_HANDLE; } - if (stdhandle != INVALID_HANDLE_VALUE) { + if (stdhandle != -1) { if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand, 0, TRUE, DUPLICATE_SAME_ACCESS)) { From 433a5e9d4b97910bfcf16df582cf578fbd0071b1 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 12 Feb 2002 00:35:21 +0000 Subject: [PATCH 2942/7878] OS/2: Fix option flags attaching to an existing shared memory block. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62947 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/os2/shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c index 9830ba2054e..0dc05fae287 100644 --- a/shmem/os2/shm.c +++ b/shmem/os2/shm.c @@ -107,7 +107,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, int rc; apr_shm_t *newm = (apr_shm_t *)apr_palloc(pool, sizeof(apr_shm_t)); char *name = NULL; - ULONG flags = PAG_COMMIT|PAG_READ|PAG_WRITE; + ULONG flags = PAG_READ|PAG_WRITE; newm->pool = pool; name = apr_pstrcat(pool, "\\SHAREMEM\\", filename, NULL); From 1afa205bacc6f570097bde05ef43b5181b6dacbb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 01:02:41 +0000 Subject: [PATCH 2943/7878] Formatting cleanup only - I'm now convince this code is clean - but some products may identify the va_args from apr_Xsprintf() calls as living on another fn's stack [true] and toss up memory violations [not true.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62948 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 99053b647ef..20fb44326ca 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -1204,7 +1204,7 @@ static int snprintf_flush(apr_vformatter_buff_t *vbuff) APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, - const char *format, ...) + const char *format, ...) { int cc; va_list ap; @@ -1225,7 +1225,7 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format, - va_list ap) + va_list ap) { int cc; apr_vformatter_buff_t vbuff; From b1dd91ace8f2240e4029b0eac18a0abc7cce0a6a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 01:14:15 +0000 Subject: [PATCH 2944/7878] I'm still drudging through the 36 files for WCE... sorry they are slow in coming :) Submitted by: Mladen Turk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62949 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 56b31beaac9..ab50d353c7e 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -56,6 +56,7 @@ #include "apr_strings.h" #include "apr_private.h" #include "fileio.h" +#include "i18n.h" #if APR_HAS_DSO @@ -86,7 +87,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, { HINSTANCE os_handle; apr_status_t rv; +#ifndef _WIN32_WCE UINT em; +#endif #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE @@ -99,15 +102,19 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, return ((*res_handle)->load_error = rv); } /* Prevent ugly popups from killing our app */ +#ifndef _WIN32_WCE em = SetErrorMode(SEM_FAILCRITICALERRORS); +#endif os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (!os_handle) os_handle = LoadLibraryExW(wpath, NULL, 0); if (!os_handle) rv = apr_get_os_error(); +#ifndef _WIN32_WCE SetErrorMode(em); - } #endif + } +#endif /* APR_HAS_UNICODE_FS */ #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI { @@ -134,6 +141,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, SetErrorMode(em); } #endif + *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); (*res_handle)->cont = ctx; @@ -158,8 +166,24 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, struct apr_dso_handle_t *handle, const char *symname) { - *ressym = (apr_dso_handle_sym_t)GetProcAddress(handle->handle, symname); +#ifdef _WIN32_WCE + apr_size_t symlen = strlen(symname) + 1; + apr_size_t wsymlen = 256; + apr_wchar_t wsymname[256]; + apr_status_t rv; + + rv = apr_conv_utf8_to_ucs2(wsymname, &wsymlen, symname, &symlen); + if (rv != APR_SUCCESS) { + return rv; + } + else if (symlen) { + return APR_ENAMETOOLONG; + } + *ressym = (apr_dso_handle_sym_t)GetProcAddressW(handle->handle, wsymname); +#else + *ressym = (apr_dso_handle_sym_t)GetProcAddress(handle->handle, symname); +#endif if (!*ressym) { return apr_get_os_error(); } From 4b9608cbee67850d6ec8d38b0d53849c6f6dc4cc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 01:18:13 +0000 Subject: [PATCH 2945/7878] GetSystemTimeAsFileTime is great! Unfortuantely, WCE's designers didn't agree. Submitted by Mladen Turk for his WinCE port. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62950 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/time.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/time/win32/time.c b/time/win32/time.c index a8237491824..5f3d5da5f30 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -131,7 +131,13 @@ APR_DECLARE(apr_time_t) apr_time_now(void) { LONGLONG aprtime = 0; FILETIME time; +#ifndef _WIN32_WCE GetSystemTimeAsFileTime(&time); +#else + SYSTEMTIME st; + GetSystemTime(&st); + SystemTimeToFileTime(&st, &time); +#endif FileTimeToAprTime(&aprtime, &time); return aprtime; } From f2d59a8d1211b73ffc8e1d0283aac85c43234513 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 01:24:12 +0000 Subject: [PATCH 2946/7878] Another fine patch from Mladen Turk , since WinCE doesn't use the same clib conventions as the rest of the Win32 platforms, we can't protect the clib space with the _beginthreadex/_endthread conventions - fall back on the native API. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62951 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/thread.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 2b9c850906c..f7af499851f 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -58,7 +58,9 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_portable.h" +#if APR_HAVE_PROCESS_H #include +#endif #include "misc.h" APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, @@ -121,12 +123,19 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, /* Use 0 for Thread Stack Size, because that will default the stack to the * same size as the calling thread. */ +#ifndef _WIN32_WCE if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker, (*new), 0, &temp)) == 0) { return APR_FROM_OS_ERROR(_doserrno); } - +#else + if (((*new)->td = (HANDLE *)CreateThread(NULL, 0, + (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker, + (*new), 0, &temp)) == 0) { + return apr_get_os_error(); + } +#endif if (attr && attr->detach) { CloseHandle((*new)->td); } @@ -139,8 +148,12 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, { thd->exitval = retval; apr_pool_destroy(thd->cntxt); +#ifndef _WIN32_WCE _endthreadex(0); - return APR_SUCCESS; +#else + ExitThread(0); +#endif + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, @@ -174,9 +187,11 @@ APR_DECLARE(void) apr_thread_yield() * providing more critical threads a bit larger timeslice) * we won't worry too much if it's not available. */ +#ifndef _WIN32_WCE if (apr_os_level >= APR_WIN_NT) { SwitchToThread(); } +#endif } APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, From 27bc284e1ff6afd06e01222bcbe8a2fbdc4731ce Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 01:27:09 +0000 Subject: [PATCH 2947/7878] I hope the clocks have sufficient resolution to make this randomization useful. Comments? We may need to divide, not necessarily by USEC_PER_SEC but perhaps by a nice binary value. Submitted by: Mladen Turk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62952 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/mktemp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 3e73a655f14..99a712a4fb7 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -106,9 +106,15 @@ #define seedrandom(a) srandom(a) #endif +#if APR_HAVE_SYS_TYPES_H #include +#endif +#if APR_HAVE_SYS_STAT_H #include +#endif +#if APR_HAVE_FCNTL_H #include +#endif #include #include #include @@ -130,7 +136,7 @@ static int gettemp(char *path, apr_file_t **doopen, apr_int32_t flags, apr_pool_ apr_uint32_t randnum; if (randseed==0) { - randseed = time(NULL); + randseed = (int)apr_time_now(); seedrandom(randseed); } From b68ed4f410b683e49ef5db12607f270ab03fd7d2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 01:28:17 +0000 Subject: [PATCH 2948/7878] WinCE doesn't have the concept of 'duplicating' file handles - it lacks stdfoo handles entirely. From Mladen Turk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62953 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index f607dc8fa36..e962bc0afac 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -62,6 +62,9 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else HANDLE hproc = GetCurrentProcess(); HANDLE newhand = NULL; @@ -83,12 +86,16 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_pool_cleanup_null); return APR_SUCCESS; +#endif /* !defined(_WIN32_WCE) */ } APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p) { +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else DWORD stdhandle = -1; HANDLE hproc = GetCurrentProcess(); HANDLE newhand = NULL; @@ -139,5 +146,6 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, new_file->buffered = FALSE; return APR_SUCCESS; +#endif /* !defined(_WIN32_WCE) */ } From 8c93108b99336e353c1a01849359b80be8bfc7dd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 01:29:26 +0000 Subject: [PATCH 2949/7878] Filelocks are unsupported on WinCE. Submitted by Mladen Turk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62954 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/flock.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index 27aa7af6f1d..ec95f712a1b 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -56,6 +56,10 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) { +#ifdef _WIN32_WCE + /* The File locking is unsuported on WCE */ + return APR_ENOTIMPL; +#else const DWORD len = 0xffffffff; DWORD flags; @@ -80,10 +84,14 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) } return APR_SUCCESS; +#endif /* !defined(_WIN32_WCE) */ } APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) { +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else DWORD len = 0xffffffff; if (apr_os_level >= APR_WIN_NT) { @@ -99,4 +107,5 @@ APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) } return APR_SUCCESS; +#endif /* !defined(_WIN32_WCE) */ } From daf018e8868559ec9865619d4b237999d430c915 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 01:32:55 +0000 Subject: [PATCH 2950/7878] stdfoo handles are unsupported on WinCE. Submitted by Mladen Turk . I believe the patch for CE is wrong is one respect, IIRC we should fall over from MoveFile to CopyFile if the file device varied. Confirmation? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62955 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index db89eae89a5..78f8bd94f06 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -59,10 +59,14 @@ #include "apr_strings.h" #include "apr_portable.h" #include "apr_thread_mutex.h" +#if APR_HAVE_ERRNO_H #include +#endif #include #include +#if APR_HAVE_SYS_STAT_H #include +#endif #include "misc.h" #if APR_HAS_UNICODE_FS @@ -466,8 +470,12 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, / sizeof(apr_wchar_t), topath)) { return rv; } +#ifndef _WIN32_WCE if (MoveFileExW(wfrompath, wtopath, MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED)) +#else + if (MoveFileW(wfrompath, wtopath)) +#endif return APR_SUCCESS; #else if (MoveFileEx(frompath, topath, MOVEFILE_REPLACE_EXISTING | @@ -530,6 +538,9 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else apr_os_file_t file_handle; file_handle = GetStdHandle(STD_ERROR_HANDLE); @@ -537,10 +548,14 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t return APR_EINVAL; return apr_os_file_put(thefile, &file_handle, 0, cont); +#endif } APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) { +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else apr_os_file_t file_handle; file_handle = GetStdHandle(STD_OUTPUT_HANDLE); @@ -548,10 +563,14 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t return APR_EINVAL; return apr_os_file_put(thefile, &file_handle, 0, cont); +#endif } APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) { +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else apr_os_file_t file_handle; file_handle = GetStdHandle(STD_INPUT_HANDLE); @@ -559,6 +578,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t * return APR_EINVAL; return apr_os_file_put(thefile, &file_handle, 0, cont); +#endif } APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); From 47ecd6dc8e0bc0307f89b3b89ce535ef997bb6d0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 01:37:47 +0000 Subject: [PATCH 2951/7878] Another unfortunate shortcoming of WinCE - no pipe support yet. Submitted by Mladen Turk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62956 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 6fbbfa7e00d..89cf9e57908 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -56,11 +56,17 @@ #include "apr_file_io.h" #include "apr_general.h" #include "apr_strings.h" +#if APR_HAVE_ERRNO_H #include +#endif #include #include +#if APR_HAVE_SYS_TYPES_H #include +#endif +#if APR_HAVE_SYS_STAT_H #include +#endif #include "misc.h" APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) @@ -83,6 +89,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *p) { +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else SECURITY_ATTRIBUTES sa; sa.nLength = sizeof(sa); @@ -122,6 +131,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; +#endif } /* apr_create_nt_pipe() @@ -148,6 +158,9 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, apr_pool_t *p) { +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else SECURITY_ATTRIBUTES sa; static unsigned long id = 0; DWORD dwPipeMode; @@ -234,4 +247,5 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; +#endif /* _WIN32_WCE */ } From 70bb52d5fb6ef23afc823e1dcfd71a708c58fc23 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 01:41:57 +0000 Subject: [PATCH 2952/7878] More WinCE disparities from Mladen Turk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62957 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 3ed9ef77e9a..6341f8f5f8c 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -195,14 +195,19 @@ #define APR_HAVE_SIGWAIT 0 #define APR_HAVE_STRCASECMP 0 #define APR_HAVE_STRDUP 1 -#define APR_HAVE_STRICMP 1 #define APR_HAVE_STRNCASECMP 0 -#define APR_HAVE_STRNICMP 1 #define APR_HAVE_STRSTR 1 #define APR_HAVE_MEMCHR 1 #define APR_HAVE_STRUCT_RLIMIT 0 #define APR_HAVE_UNION_SEMUN 0 +#ifndef _WIN32_WCE +#define APR_HAVE_STRICMP 1 +#define APR_HAVE_STRNICMP 1 +#else +#define APR_HAVE_STRICMP 0 +#define APR_HAVE_STRNICMP 0 +#endif /* Has windows.h already been included? If so, our preferences don't matter, * but we will still need the winsock things no matter what was included. @@ -267,7 +272,6 @@ /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY 1 #define APR_HAS_THREADS 1 -#define APR_HAS_SENDFILE 1 #define APR_HAS_MMAP 1 #define APR_HAS_FORK 0 #define APR_HAS_RANDOM 1 @@ -277,10 +281,12 @@ #define APR_HAS_SO_ACCEPTFILTER 0 #define APR_HAS_UNICODE_FS 1 #ifndef _WIN32_WCE +#define APR_HAS_SENDFILE 1 #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 1 #define APR_HAS_XTHREAD_FILES 1 #else +#define APR_HAS_SENDFILE 0 #define APR_HAS_USER 0 #define APR_HAS_LARGE_FILES 0 #define APR_HAS_XTHREAD_FILES 0 From d6763ac8b579aecf6f0b125cec0a67271f653132 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 01:44:45 +0000 Subject: [PATCH 2953/7878] Another few WinCE disparities, there is no ACLAPI (security), nor does CE support errno. I'm not sure I care for the later fixup, but can see where it causes headaches in Unix-shared code. Submitted by Mladen Turk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62958 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_private.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index a16ce214cd9..ec9b67b4fef 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -82,6 +82,7 @@ * not with APR itself, until some GUI-related security is introduced.] */ #ifndef _WIN32_WCE +#define HAVE_ACLAPI 1 #ifdef __wtypes_h__ #include #else @@ -89,6 +90,8 @@ #include #undef __wtypes_h__ #endif +#else +#define HAVE_ACLAPI 0 #endif #if APR_HAVE_SYS_TYPES_H @@ -169,5 +172,10 @@ typedef void (Sigfunc)(int); unsigned __stdcall SignalHandling(void *); int thread_ready(void); +#if !APR_HAVE_ERRNO_H +APR_DECLARE_DATA int errno; +#define ENOSPC 1 +#endif + #endif /*APR_PRIVATE_H*/ #endif /*WIN32*/ From bec8817c66294e5e200f40b53b2eb1c9b627737a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 01:52:35 +0000 Subject: [PATCH 2954/7878] WinCE port from Mladen Turk I think this question deserves an answer - is this assert legit???????? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62959 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strnatcmp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/strings/apr_strnatcmp.c b/strings/apr_strnatcmp.c index 51a94aa6605..a2ff5ab9e24 100644 --- a/strings/apr_strnatcmp.c +++ b/strings/apr_strnatcmp.c @@ -22,10 +22,12 @@ #include #include -#include - #include "apr_strings.h" #include "apr_lib.h" /* for apr_is*() */ +#if APR_HAVE_ERRNO_H +/* Do we realy need the assert here ? */ +#include +#endif #if defined(__GNUC__) # define UNUSED __attribute__((__unused__)) @@ -92,8 +94,9 @@ static int strnatcmp0(char const *a, char const *b, int fold_case) int ai, bi; char ca, cb; int fractional, result; - +#if APR_HAVE_ERRNO_H assert(a && b); +#endif ai = bi = 0; while (1) { ca = a[ai]; cb = b[bi]; From 72e028f7171bfba9123ba618e81e0be7880e6dec Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 12 Feb 2002 06:04:13 +0000 Subject: [PATCH 2955/7878] Toss an assert call that only checks input parameters validity which is not our style. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62960 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strnatcmp.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/strings/apr_strnatcmp.c b/strings/apr_strnatcmp.c index a2ff5ab9e24..73ce516d9f7 100644 --- a/strings/apr_strnatcmp.c +++ b/strings/apr_strnatcmp.c @@ -24,10 +24,6 @@ #include #include "apr_strings.h" #include "apr_lib.h" /* for apr_is*() */ -#if APR_HAVE_ERRNO_H -/* Do we realy need the assert here ? */ -#include -#endif #if defined(__GNUC__) # define UNUSED __attribute__((__unused__)) @@ -94,9 +90,6 @@ static int strnatcmp0(char const *a, char const *b, int fold_case) int ai, bi; char ca, cb; int fractional, result; -#if APR_HAVE_ERRNO_H - assert(a && b); -#endif ai = bi = 0; while (1) { ca = a[ai]; cb = b[bi]; From fe4edca48539ea94dc625cd6bd43beea2e37e1da Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 12 Feb 2002 14:12:58 +0000 Subject: [PATCH 2956/7878] clean up a warning - functions should be static or have prototypes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62961 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testsleep.c b/test/testsleep.c index 3d8cbf10bb4..04685c38002 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -86,7 +86,7 @@ static void do_sleep(int howlong) } #if APR_HAS_THREADS -void * APR_THREAD_FUNC time_a_thread(apr_thread_t *thd, void *data) +static void * APR_THREAD_FUNC time_a_thread(apr_thread_t *thd, void *data) { do_sleep(15); From f265efc8907f7c58476d53830a388ceec316b418 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Tue, 12 Feb 2002 21:49:15 +0000 Subject: [PATCH 2957/7878] atomic operation. still expermental PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62962 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 95 ++++++++++++++++++++++++++++++++++++++++ include/apr_atomic.h | 89 +++++++++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+) create mode 100644 atomic/unix/apr_atomic.c create mode 100644 include/apr_atomic.h diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c new file mode 100644 index 00000000000..d85d60ddfe2 --- /dev/null +++ b/atomic/unix/apr_atomic.c @@ -0,0 +1,95 @@ +#include "apr.h" +#include "apr_lock.h" +#include "apr_thread_mutex.h" +#include "apr_atomic.h" + +#ifdef WIN32 +/* win32 implementation is all macros */ +#else + +#define NUM_ATOMIC_HASH 7 +/* shift by 2 to get rid of alignment issues */ +#define ATOMIC_HASH(x) (int)(((long)x>>2)%NUM_ATOMIC_HASH) +static apr_thread_mutex_t **hash_mutex; + +apr_status_t apr_atomic_init(apr_pool_t *p ) +{ + int i; + apr_status_t rv; + hash_mutex =apr_palloc(p,sizeof(apr_thread_mutex_t*) * NUM_ATOMIC_HASH); + for (i=0;i. + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + +#ifndef APR_ATOMIC_H +#define APR_ATOMIC_H + +#ifdef __cplusplus +extern "C" { +#endif +#ifdef WIN32 + +#define apr_atomic_add(mem, val) InterlockedExchangeAdd(mem,val) +#define apr_atomic_dec(mem) InterlockedDecrement(mem) +#define apr_atomic_inc(mem) InterlockedIncrement(mem) +#define apr_atomic_set(mem, val) InterlockedExchange(mem, val) +#define apr_atomic_read(mem) *mem +#define apr_atomic_cas(mem,with,cmp) InterlockedCompareExchange(mem,with,cmp) +#define apr_atomic_init(pool) APR_SUCCESS + +#else +#define apr_atomic_read(p) *p +apr_status_t apr_atomic_init(apr_pool_t *p); +long apr_atomic_set(volatile long*mem, long val); +long apr_atomic_add(volatile long*mem, long val); +long apr_atomic_inc( volatile long *mem); +long apr_atomic_dec(volatile long *mem); +long apr_atomic_cas(volatile long *mem,long with,long cmp); + +#endif +#ifdef __cplusplus +} +#endif + +#endif /* !APR_ATOMIC_H */ From 96680dc5a375bf01f68f1e23395ba24ba3dec7d4 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Tue, 12 Feb 2002 21:49:32 +0000 Subject: [PATCH 2958/7878] tester for apr_atomic PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62963 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 + test/testatomic.c | 247 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 251 insertions(+) create mode 100644 test/testatomic.c diff --git a/test/Makefile.in b/test/Makefile.in index cb0e3a44890..ffcfe8766ff 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -37,6 +37,7 @@ PROGRAMS = \ testsleep@EXEEXT@ \ testrand@EXEEXT@ \ testdup@EXEEXT@ \ + testatomic@EXEEXT@ \ testpools@EXEEXT@ @@ -165,6 +166,9 @@ testvsn@EXEEXT@: testvsn.lo $(LOCAL_LIBS) testsleep@EXEEXT@: testsleep.lo $(LOCAL_LIBS) $(LINK) testsleep.lo $(LOCAL_LIBS) $(ALL_LIBS) +testatomic@EXEEXT@: testatomic.lo $(LOCAL_LIBS) + $(LINK) testatomic.lo $(LOCAL_LIBS) $(ALL_LIBS) + testdup@EXEEXT@: testdup.lo $(LOCAL_LIBS) $(LINK) testdup.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/testatomic.c b/test/testatomic.c new file mode 100644 index 00000000000..8c554911edf --- /dev/null +++ b/test/testatomic.c @@ -0,0 +1,247 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_thread_proc.h" +#include "apr_lock.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_atomic.h" +#include "errno.h" +#include +#include +#include "apr_time.h" +#if APR_HAVE_UNISTD_H +#include +#endif + +#ifndef WIN32 +#include +#endif +#if !APR_HAS_THREADS +int main(void) +{ + fprintf(stderr, + "This program won't work on this platform because there is no " + "support for threads.\n"); + return 0; +} +#else /* !APR_HAS_THREADS */ + +void * APR_THREAD_FUNC thread_func_traditional(apr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data); + +apr_lock_t *thread_lock; +apr_pool_t *context; +apr_thread_once_t *control = NULL; +volatile long x = 0; /* traditional locks */ +volatile long y = 0; /* atomic locks */ +volatile long z = 0; /* no locks */ +int value = 0; +apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ + +#define NUM_THREADS 10 +#define NUM_ITERATIONS 20000 +static void init_func(void) +{ + value++; +} + +void * APR_THREAD_FUNC thread_func_traditional(apr_thread_t *thd, void *data) +{ + int i; + + apr_thread_once(control, init_func); + + for (i = 0; i < NUM_ITERATIONS; i++) { + apr_lock_acquire(thread_lock); + x++; + apr_lock_release(thread_lock); + } + apr_thread_exit(thd, exit_ret_val); + return NULL; +} +void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data) +{ + int i; + + apr_thread_once(control, init_func); + + for (i = 0; i < NUM_ITERATIONS ; i++) { + apr_atomic_inc( &y ); + } + apr_thread_exit(thd, exit_ret_val); + return NULL; +} +void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data) +{ + int i; + + apr_thread_once(control, init_func); + + for (i = 0; i < NUM_ITERATIONS ; i++) { + z++; + } + apr_thread_exit(thd, exit_ret_val); + return NULL; +} +int main(void) +{ + apr_thread_t *t1[NUM_THREADS]; + apr_thread_t *t2[NUM_THREADS]; + apr_thread_t *t3[NUM_THREADS]; + apr_status_t r1[NUM_THREADS]; + apr_status_t r2[NUM_THREADS]; + apr_status_t r3[NUM_THREADS]; + apr_status_t s1[NUM_THREADS]; + apr_status_t s2[NUM_THREADS]; + apr_status_t s3[NUM_THREADS]; + apr_status_t rv; + int i; + + apr_initialize(); + + printf("APR Simple Thread Test\n======================\n\n"); + +#ifndef WIN32 + pthread_setconcurrency(8); +#endif + printf("%-60s", "Initializing the context"); + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { + fflush(stdout); + fprintf(stderr, "Failed.\nCould not initialize\n"); + exit(-1); + } + printf("OK\n"); + + apr_thread_once_init(&control, context); + + printf("%-60s", "Initializing the lock"); + rv = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, + APR_LOCK_DEFAULT, "lock.file", context); + if (rv != APR_SUCCESS) { + fflush(stdout); + fprintf(stderr, "Failed\nCould not create lock\n"); + exit(-1); + } + rv = apr_atomic_init( context); + + printf("OK\n"); + + printf("%-60s", "Starting all the threads"); + for (i=0;i Date: Tue, 12 Feb 2002 21:51:30 +0000 Subject: [PATCH 2959/7878] support files for unix I don't have MSVC6 so I can't modify dsp's ;( PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62964 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/Makefile.in | 11 +++++++++++ configure.in | 2 +- test/.cvsignore | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 atomic/unix/Makefile.in diff --git a/atomic/unix/Makefile.in b/atomic/unix/Makefile.in new file mode 100644 index 00000000000..91cf22f14f5 --- /dev/null +++ b/atomic/unix/Makefile.in @@ -0,0 +1,11 @@ + +TARGETS = apr_atomic.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) + +# DO NOT REMOVE diff --git a/configure.in b/configure.in index f914ad75a16..07eebc060c2 100644 --- a/configure.in +++ b/configure.in @@ -73,7 +73,7 @@ dnl These added to allow default directories to be used... DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" -apr_modules="file_io network_io threadproc misc locks time mmap shmem i18n user memory" +apr_modules="file_io network_io threadproc misc locks time mmap shmem i18n user memory atomic" dnl Checks for programs. AC_PROG_MAKE_SET diff --git a/test/.cvsignore b/test/.cvsignore index 94f579eb8db..721d6d95fc7 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -8,6 +8,7 @@ testmd5 testmmap htdigest proctest +testatomic testud testargs testdir From c39df020a0e6162158136fe7b937a36244a29e31 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 21:55:08 +0000 Subject: [PATCH 2960/7878] Place a trailing newline git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62965 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/apr_app.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index 1c691af5970..b7edf08c148 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -293,4 +293,4 @@ APR_DECLARE(apr_status_t) apr_app_main(int *argc, char ***argv, char ***env) return APR_SUCCESS; } -#endif \ No newline at end of file +#endif From 2c5a1b3efa7febc9594714a7d8943e6435d908f8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 21:56:13 +0000 Subject: [PATCH 2961/7878] We can't use strerror() or CoCreateGuid() on WinCE. Submitted by Mladen Turk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62966 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 6 ++++++ misc/win32/getuuid.c | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index e48afa4b91f..a5af06ed826 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -393,7 +393,13 @@ static char *native_strerror(apr_status_t statcode, char *buf, static char *native_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize) { +#ifdef _WIN32_WCE + static char err[32]; + sprintf(err, "Native Error #%d", statcode); + return stuffbuffer(buf, bufsize, err); +#else return stuffbuffer(buf, bufsize, strerror(statcode)); +#endif } #endif diff --git a/misc/win32/getuuid.c b/misc/win32/getuuid.c index f6fb999dfe9..78141eba7b0 100644 --- a/misc/win32/getuuid.c +++ b/misc/win32/getuuid.c @@ -76,6 +76,16 @@ APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid) * is therefore not only a uniqifier, but an identity (which might not * be appropriate in all cases. */ +#ifndef _WIN32_WCE (void) CoCreateGuid(&guid); +#else + /* WCE lacks CoCreateGuid. So make something simple + * for now. + */ + guid.Data1 = rand(); + guid.Data2 = rand(); + guid.Data3 = rand(); + sprintf(guid.Data4, "%08X", rand()); +#endif memcpy(uuid->data, &guid, sizeof(uuid->data)); } From c972285f427fe5939eeffcc401ebb3a7c821c44a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 21:57:13 +0000 Subject: [PATCH 2962/7878] Two very safe have-header tests for the WinCE port, submitted by Mladen Turk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62967 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_ntop.c | 2 ++ network_io/unix/inet_pton.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index 51dbebbca4b..e9ad747208f 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -31,7 +31,9 @@ #include #endif #include +#if APR_HAVE_ERRNO_H #include +#endif #include #ifndef IN6ADDRSZ diff --git a/network_io/unix/inet_pton.c b/network_io/unix/inet_pton.c index 9524e87cd5b..39aa7204c2c 100644 --- a/network_io/unix/inet_pton.c +++ b/network_io/unix/inet_pton.c @@ -30,7 +30,9 @@ #include #endif #include +#if APR_HAVE_ERRNO_H #include +#endif #ifndef IN6ADDRSZ #define IN6ADDRSZ 16 From 2248b91a4599e529fac362f905a95f960eb64010 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 21:59:01 +0000 Subject: [PATCH 2963/7878] More safe header exclusions from Mladen Turk for the WinCE port. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62968 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_getpass.c | 12 ++++++++++++ threadproc/win32/signals.c | 2 ++ time/win32/time.c | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index c6dfb5c5bdd..588724cefb9 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -61,8 +61,12 @@ #include "apr_strings.h" #include "apr_lib.h" #include "apr_errno.h" +#if APR_HAVE_SYS_TYPES_H #include +#endif +#if APR_HAVE_ERRNO_H #include +#endif #if APR_HAVE_UNISTD_H #include @@ -165,6 +169,13 @@ static char *getpass(const char *prompt) static char *getpass(const char *prompt) { +/* WCE lacks console. So the getpass is unsuported + * The only way is to use the GUI so the getpass should be implemented + * on per-application basis. +*/ +#ifdef _WIN32_WCE + return NULL; +#else static char password[MAX_STRING_LEN]; int n = 0; @@ -190,6 +201,7 @@ static char *getpass(const char *prompt) } return (char *) &password; +#endif } #endif /* no getchar or _getch */ diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index efb0a5b5bff..7e9d14fa74b 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -57,7 +57,9 @@ #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_general.h" +#if APR_HAVE_SIGNAL_H #include +#endif #include #if APR_HAVE_SYS_WAIT #include diff --git a/time/win32/time.c b/time/win32/time.c index 5f3d5da5f30..9d46ecccf87 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -57,8 +57,12 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_portable.h" +#if APR_HAVE_TIME_H #include +#endif +#if APR_HAVE_ERRNO_H #include +#endif #include #include From 7fa5ec5e974bbcebadd94a03e39fedb8d1f0ebcb Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Tue, 12 Feb 2002 22:16:39 +0000 Subject: [PATCH 2964/7878] atomic fn's added any volunteers for arch/os specific versions? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62969 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ STATUS | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index f97ee719f01..022fb1a0fa9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ Changes with APR b1 + *) added new functions for atomic operations. These are experimental + at the moment, so use in apps is discouraged [Ian Holsman] *) Disable SHMEM_MMAP_ZERO on HPUX 11.x where it is not supported. Use SHMEM_SHMGET_ANON instead. [Aaron Bannert] diff --git a/STATUS b/STATUS index a034ff57890..db61b7f49ec 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/02/04 19:15:20 $] +Last modified at [$Date: 2002/02/12 22:16:39 $] Release: @@ -37,6 +37,8 @@ RELEASE SHOWSTOPPERS: lest we support 2 lock APIs in perpetuity. RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * Need some architecture/OS specific versions of the atomic operations. + Ian Volunteers for the x86 & sparc versions * The new lock API is a full replacement for the old API, but is not yet complete on all platforms. Components that are incomplete From 1ff8dcebcf83a82624d7423c0ac94b466450cc7a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 12 Feb 2002 22:46:48 +0000 Subject: [PATCH 2965/7878] Nary a complaint, since MSVC isn't distinguishing between void* and void**, but this is the correct syntax. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62970 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index f7af499851f..4890419eacc 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -124,13 +124,13 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, * same size as the calling thread. */ #ifndef _WIN32_WCE - if (((*new)->td = (HANDLE *)_beginthreadex(NULL, 0, + if (((*new)->td = (HANDLE)_beginthreadex(NULL, 0, (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker, (*new), 0, &temp)) == 0) { return APR_FROM_OS_ERROR(_doserrno); } #else - if (((*new)->td = (HANDLE *)CreateThread(NULL, 0, + if (((*new)->td = (HANDLE)CreateThread(NULL, 0, (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker, (*new), 0, &temp)) == 0) { return apr_get_os_error(); From 24025dcbcae503565f58ba9d03804b671ee85816 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 13 Feb 2002 01:22:18 +0000 Subject: [PATCH 2966/7878] get APR to build with --disable-threads... there is no implementation of apr atomic stuff for Unix unless APR_HAS_THREADS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62971 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 5 +++++ include/apr_atomic.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index d85d60ddfe2..cedcb9fd586 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -7,6 +7,8 @@ /* win32 implementation is all macros */ #else +#if APR_HAS_THREADS + #define NUM_ATOMIC_HASH 7 /* shift by 2 to get rid of alignment issues */ #define ATOMIC_HASH(x) (int)(((long)x>>2)%NUM_ATOMIC_HASH) @@ -92,4 +94,7 @@ long apr_atomic_cas(volatile long *mem,long with,long cmp) } return *mem; } + +#endif /* APR_HAS_THREADS */ + #endif /* default implementation */ diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 35f88355aa4..2d32e62ce28 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -73,6 +73,9 @@ extern "C" { #define apr_atomic_init(pool) APR_SUCCESS #else + +#if APR_HAS_THREADS + #define apr_atomic_read(p) *p apr_status_t apr_atomic_init(apr_pool_t *p); long apr_atomic_set(volatile long*mem, long val); @@ -81,6 +84,8 @@ long apr_atomic_inc( volatile long *mem); long apr_atomic_dec(volatile long *mem); long apr_atomic_cas(volatile long *mem,long with,long cmp); +#endif /* APR_HAS_THREADS */ + #endif #ifdef __cplusplus } From 83e44bd029f087c05d8829363f463fb30148bfa4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 13 Feb 2002 02:10:07 +0000 Subject: [PATCH 2967/7878] Vetoed by GStein, there is a better 'alternate' implementation available in misc/unix/getuuid.c. CE's build files should be updated to reflect that version instead. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62972 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/getuuid.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/misc/win32/getuuid.c b/misc/win32/getuuid.c index 78141eba7b0..f6fb999dfe9 100644 --- a/misc/win32/getuuid.c +++ b/misc/win32/getuuid.c @@ -76,16 +76,6 @@ APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid) * is therefore not only a uniqifier, but an identity (which might not * be appropriate in all cases. */ -#ifndef _WIN32_WCE (void) CoCreateGuid(&guid); -#else - /* WCE lacks CoCreateGuid. So make something simple - * for now. - */ - guid.Data1 = rand(); - guid.Data2 = rand(); - guid.Data3 = rand(); - sprintf(guid.Data4, "%08X", rand()); -#endif memcpy(uuid->data, &guid, sizeof(uuid->data)); } From 3e503a2922deb65b24df885cbcae3c6665a77d47 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 13 Feb 2002 02:28:00 +0000 Subject: [PATCH 2968/7878] Protect us from both NULL and INVALID_FILE_HANDLE results. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62973 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 78f8bd94f06..cf91d106c9a 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -543,9 +543,15 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t #else apr_os_file_t file_handle; + apr_set_os_error(APR_SUCCESS); file_handle = GetStdHandle(STD_ERROR_HANDLE); - if (file_handle == INVALID_HANDLE_VALUE) - return APR_EINVAL; + if (!file_handle || (file_handle == INVALID_HANDLE_VALUE)) { + apr_status_t rv = apr_get_os_error(); + if (rv == APR_SUCCESS) { + return APR_EINVAL; + } + return rv; + } return apr_os_file_put(thefile, &file_handle, 0, cont); #endif @@ -558,9 +564,15 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t #else apr_os_file_t file_handle; + apr_set_os_error(APR_SUCCESS); file_handle = GetStdHandle(STD_OUTPUT_HANDLE); - if (file_handle == INVALID_HANDLE_VALUE) - return APR_EINVAL; + if (!file_handle || (file_handle == INVALID_HANDLE_VALUE)) { + apr_status_t rv = apr_get_os_error(); + if (rv == APR_SUCCESS) { + return APR_EINVAL; + } + return rv; + } return apr_os_file_put(thefile, &file_handle, 0, cont); #endif @@ -573,9 +585,15 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t * #else apr_os_file_t file_handle; + apr_set_os_error(APR_SUCCESS); file_handle = GetStdHandle(STD_INPUT_HANDLE); - if (file_handle == INVALID_HANDLE_VALUE) - return APR_EINVAL; + if (!file_handle || (file_handle == INVALID_HANDLE_VALUE)) { + apr_status_t rv = apr_get_os_error(); + if (rv == APR_SUCCESS) { + return APR_EINVAL; + } + return rv; + } return apr_os_file_put(thefile, &file_handle, 0, cont); #endif From eef44b2280709d24e5e48469e3d9dd05b188730e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 13 Feb 2002 02:28:56 +0000 Subject: [PATCH 2969/7878] Outch. Compare the appropriate file handle! Then close the target if it is valid, in any case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62974 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index e962bc0afac..a5ef11c740f 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -106,13 +106,13 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, * and close and replace other handles with duped handles. * The os_handle will change, however. */ - if (old_file->filehand == GetStdHandle(STD_ERROR_HANDLE)) { + if (new_file->filehand == GetStdHandle(STD_ERROR_HANDLE)) { stdhandle = STD_ERROR_HANDLE; } - else if (old_file->filehand == GetStdHandle(STD_OUTPUT_HANDLE)) { + else if (new_file->filehand == GetStdHandle(STD_OUTPUT_HANDLE)) { stdhandle = STD_OUTPUT_HANDLE; } - else if (old_file->filehand == GetStdHandle(STD_INPUT_HANDLE)) { + else if (new_file->filehand == GetStdHandle(STD_INPUT_HANDLE)) { stdhandle = STD_INPUT_HANDLE; } @@ -133,12 +133,13 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, FALSE, DUPLICATE_SAME_ACCESS)) { return apr_get_os_error(); } - if (new_file->filehand) { - CloseHandle(new_file->filehand); - } newflags = old_file->flags & ~APR_INHERIT; } + if (new_file->filehand && (new_file->filehand != INVALID_HANDLE_VALUE)) { + CloseHandle(new_file->filehand); + } + new_file->flags = newflags; new_file->filehand = newhand; new_file->fname = apr_pstrdup(new_file->cntxt, old_file->fname); From 94e1b3f30186ad75fe55d4f90a4cf76dd9046c9c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 13 Feb 2002 02:31:01 +0000 Subject: [PATCH 2970/7878] Note goodness. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62975 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index 022fb1a0fa9..382ce14005f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,11 @@ Changes with APR b1 + + *) Correct serious problems with the Win32 apr_file_dup2 + and apr_file_open_stdxxx() fns. [William Rowe] + + *) Begin implementation of the WinCE port. + [Mladen Turk ] + *) added new functions for atomic operations. These are experimental at the moment, so use in apps is discouraged [Ian Holsman] From 7bf3f21edfd1c5cb5904ae4ab5df50e21b0d2c06 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 13 Feb 2002 02:34:26 +0000 Subject: [PATCH 2971/7878] Correct the CONIO_H flag for WinCE git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62976 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index 6341f8f5f8c..dc18178aafa 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -127,7 +127,7 @@ #define APR_HAVE_TIME_H 1 #else #define APR_HAVE_ARPA_INET_H 0 -#define APR_HAVE_CONIO_H 1 +#define APR_HAVE_CONIO_H 0 #define APR_HAVE_CRYPT_H 0 #define APR_HAVE_CTYPE_H 0 #define APR_HAVE_DIRENT_H 0 From 1bdf71a0e0e0820cbcb5eb8749f5a7a6c39155f8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 13 Feb 2002 03:17:53 +0000 Subject: [PATCH 2972/7878] Eliminate an unnecessary cast git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62977 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 4890419eacc..2e5be27572d 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -130,7 +130,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, return APR_FROM_OS_ERROR(_doserrno); } #else - if (((*new)->td = (HANDLE)CreateThread(NULL, 0, + if (((*new)->td = CreateThread(NULL, 0, (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker, (*new), 0, &temp)) == 0) { return apr_get_os_error(); From 14816cee1d9ee38320a654725e8d148d93ab1cd3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 13 Feb 2002 12:12:11 +0000 Subject: [PATCH 2973/7878] fix a typo in a comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62979 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index f3c03e2be92..b1ccdb78fc5 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -248,7 +248,7 @@ struct apr_hdtr_t { struct iovec* headers; /** number of headers in the iovec */ int numheaders; - /** An iovec to store the trailers sent before the file. + /** An iovec to store the trailers sent after the file. * @defvar iovec *trailers */ struct iovec* trailers; /** number of trailers in the iovec */ From 8605e6bf279dc353d515daf70ccb8d908fc29602 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 13 Feb 2002 16:39:05 +0000 Subject: [PATCH 2974/7878] CHANGES effective for .32 tag, catch Justin :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62980 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGES b/CHANGES index 382ce14005f..648f1dd747a 100644 --- a/CHANGES +++ b/CHANGES @@ -6,9 +6,6 @@ Changes with APR b1 *) Begin implementation of the WinCE port. [Mladen Turk ] - *) added new functions for atomic operations. These are experimental - at the moment, so use in apps is discouraged [Ian Holsman] - *) Disable SHMEM_MMAP_ZERO on HPUX 11.x where it is not supported. Use SHMEM_SHMGET_ANON instead. [Aaron Bannert] From ebe0095f1da590bd396abea3553948899bf1e5fc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 13 Feb 2002 16:39:28 +0000 Subject: [PATCH 2975/7878] Back to our regular program git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62981 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 648f1dd747a..eb6f3693015 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) added new functions for atomic operations. These are experimental + at the moment, so use in apps is discouraged [Ian Holsman] + *) Correct serious problems with the Win32 apr_file_dup2 and apr_file_open_stdxxx() fns. [William Rowe] From d41147ee3ded07b52e384da138e01049ce1d70ec Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 13 Feb 2002 17:57:12 +0000 Subject: [PATCH 2976/7878] Update debug-only code (with invalid #ifdefs anyway) to use apr_pool_find. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62982 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 0f571a0fe4e..de75dc158fc 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -441,11 +441,11 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.pool)) { + if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.pool)) { + if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) { fprintf(stderr, "table_set: val not in ancestor pool of t\n"); abort(); } @@ -540,11 +540,11 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.pool)) { + if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.pool)) { + if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } @@ -586,11 +586,11 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, #ifdef POOL_DEBUG { - if (!apr_pool_is_ancestor(apr_find_pool(key), t->a.pool)) { + if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!apr_pool_is_ancestor(apr_find_pool(val), t->a.pool)) { + if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } From efdcb2eff37359815246bf848d97c5ad30db1926 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 13 Feb 2002 20:47:15 +0000 Subject: [PATCH 2977/7878] This wasn't used in 2.0.31, so no fault, no foul; but we must be putting Release stuff in Release paths. Also adds misc.c since my reorganization of some code in a bit will make more things tightly private and shared from misc.c. The misc.c code never includes exports, and the libapr_app code needs some of these private bits. An apr_app, on the other hand, does build with internal symbols exposed, so we don't need a recompile of the utf8_ucs2.c file - we can share. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62983 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_app.dsp | 4 ---- build/libapr_app.dsp | 14 +++++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/apr_app.dsp b/build/apr_app.dsp index 4d3a898297a..65ef758b393 100644 --- a/build/apr_app.dsp +++ b/build/apr_app.dsp @@ -85,9 +85,5 @@ LIB32=link.exe -lib SOURCE=..\misc\win32\apr_app.c # End Source File -# Begin Source File - -SOURCE=..\i18n\unix\utf8_ucs2.c -# End Source File # End Target # End Project diff --git a/build/libapr_app.dsp b/build/libapr_app.dsp index f512caa6b77..e60b5854058 100644 --- a/build/libapr_app.dsp +++ b/build/libapr_app.dsp @@ -32,16 +32,16 @@ RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"Debug\libapr_app" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"Release\libapr_app" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -87,6 +87,10 @@ SOURCE=..\misc\win32\apr_app.c # End Source File # Begin Source File +SOURCE=..\misc\win32\misc.c +# End Source File +# Begin Source File + SOURCE=..\i18n\unix\utf8_ucs2.c # End Source File # End Target From 9650e75119dbefe2c389387808d45f5d1a0d5d8b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 14 Feb 2002 01:30:09 +0000 Subject: [PATCH 2978/7878] ignore generated files git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62984 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/.cvsignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 atomic/unix/.cvsignore diff --git a/atomic/unix/.cvsignore b/atomic/unix/.cvsignore new file mode 100755 index 00000000000..06e18a7aafb --- /dev/null +++ b/atomic/unix/.cvsignore @@ -0,0 +1,3 @@ +Makefile +*.lo +.libs From 9bfd0161e8a849d5f39821586f395fb4aff72be3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 14 Feb 2002 18:07:34 +0000 Subject: [PATCH 2979/7878] Get the shmem code building again on beos. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62985 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/beos/shm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index 274a4a04975..bc741cd9b9e 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -60,6 +60,7 @@ #include #include #include +#include "apr_portable.h" struct apr_shm_t { apr_pool_t *pool; From 0098adfb5938e5b51a11ad9c84294031a67f553c Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 15 Feb 2002 00:18:49 +0000 Subject: [PATCH 2980/7878] Check for a directory not a non-empty string. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62986 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index e87818638c5..17e6b80d4f1 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -79,7 +79,7 @@ build directory, or an apr-config file.]) done fi dnl if we have a bundled source directory, then we may have more work - if test -n "$1"; then + if test -d "$1"; then apr_temp_abs_srcdir="`cd $1 && pwd`" if test "$apr_found" = "yes" \ && test "`$apr_config --srcdir`" = "$apr_temp_abs_srcdir"; then From 365d54b313f45049701cf7b765a6ae94c47fa3a1 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 15 Feb 2002 07:55:10 +0000 Subject: [PATCH 2981/7878] Who knew what I was saying? I didn't. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62987 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index db61b7f49ec..64a9c4281ca 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/02/12 22:16:39 $] +Last modified at [$Date: 2002/02/15 07:55:10 $] Release: @@ -105,7 +105,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Deal with largefiles properly on those platforms that support it. - Justin says: Linux refuses to have largefile support and largefiles + Justin says: Linux refuses to have sendfile support and largefiles at the sametime. Largefile autoconf patch: http://www.apache.org/~jerenkrantz/apr_largefile.m4 From e215235dc46259b44b141694324a140d11f9b3c8 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 15 Feb 2002 08:43:46 +0000 Subject: [PATCH 2982/7878] Add autoconf-2.52f+ support. (It sets abs_builddir to be relative not absolute!) Submitted by: Blair Zajac Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62988 13f79535-47bb-0310-9956-ffa450edef68 --- APRVARS.in | 2 +- CHANGES | 7 +++++-- apr-config.in | 2 +- build/rules.mk.in | 2 +- configure.in | 21 +++++++++++---------- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/APRVARS.in b/APRVARS.in index 28cb3092c56..2e933a51727 100644 --- a/APRVARS.in +++ b/APRVARS.in @@ -8,7 +8,7 @@ EXTRA_LIBS="@EXTRA_LIBS@" EXTRA_INCLUDES="@EXTRA_INCLUDES@" LIBTOOL_LIBS="@LIBTOOL_LIBS@" SHLIBPATH_VAR="@shlibpath_var@" -APR_SOURCE_DIR="@abs_srcdir@" +APR_SOURCE_DIR="@apr_srcdir@" APR_SO_EXT="@so_ext@" APR_LIB_TARGET="@export_lib_target@" diff --git a/CHANGES b/CHANGES index eb6f3693015..1dc412caf4d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -Changes with APR b1 +Changes with APR b1 - *) added new functions for atomic operations. These are experimental + *) Enable autoconf 2.52{f,g} build support. + [Blair Zajac ] + + *) Added new functions for atomic operations. These are experimental at the moment, so use in apps is discouraged [Ian Holsman] *) Correct serious problems with the Win32 apr_file_dup2 diff --git a/apr-config.in b/apr-config.in index 51d2070315f..0f87a414a10 100644 --- a/apr-config.in +++ b/apr-config.in @@ -70,7 +70,7 @@ LDFLAGS="@EXTRA_LDFLAGS@" LIBS="@EXTRA_LIBS@" EXTRA_INCLUDES="@EXTRA_INCLUDES@" SHLIBPATH_VAR="@shlibpath_var@" -APR_SOURCE_DIR="@abs_srcdir@" +APR_SOURCE_DIR="@apr_srcdir@" APR_SO_EXT="@so_ext@" APR_LIB_TARGET="@export_lib_target@" diff --git a/build/rules.mk.in b/build/rules.mk.in index c18b6353ce8..3d1ce894732 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -61,7 +61,7 @@ # # Configuration variables # -apr_builddir=@top_builddir@ +apr_builddir=@apr_builddir@ apr_builders=@apr_builders@ CC=@CC@ diff --git a/configure.in b/configure.in index 07eebc060c2..aea8e4dd281 100644 --- a/configure.in +++ b/configure.in @@ -46,25 +46,26 @@ dnl Preload APR_PRELOAD dnl Absolute source/build directory -abs_srcdir=`(cd $srcdir && pwd)` -abs_builddir=`pwd` +apr_srcdir=`(cd $srcdir && pwd)` +apr_builddir=`pwd` +AC_SUBST(apr_srcdir) +AC_SUBST(apr_builddir) -if test "$abs_builddir" != "$abs_srcdir"; then +if test "$apr_builddir" != "$apr_srcdir"; then USE_VPATH=1 fi dnl Libtool might need this symbol -- it must point to the location of dnl the generated libtool script (not necessarily the "top" build dir). dnl -top_builddir="$abs_builddir" +top_builddir="$apr_builddir" AC_SUBST(top_builddir) -AC_SUBST(abs_srcdir) dnl Directory containing apr build macros, helpers, and make rules dnl NOTE: make rules (rules.mk) will be in the builddir for vpath dnl -apr_buildout=$abs_builddir/build -apr_builders=$abs_srcdir/build +apr_buildout=$apr_builddir/build +apr_builders=$apr_srcdir/build AC_SUBST(apr_builders) MKDIR=$apr_builders/mkdir.sh @@ -109,7 +110,7 @@ AC_PROG_LIBTOOL LTFLAGS='--silent' fi dnl get libtool's setting of shlibpath_var - eval `grep "^shlibpath_var=[[A-Z_]]\+$" $abs_builddir/libtool` + eval `grep "^shlibpath_var=[[A-Z_]]\+$" $apr_builddir/libtool` ;; esac @@ -1564,8 +1565,8 @@ if test -n "$USE_VPATH"; then for makefile in $MAKEFILE1 $MAKEFILE2 $MAKEFILE3; do dir=`echo $makefile|sed 's%[^/][^/]*$%%'` (cat < Date: Fri, 15 Feb 2002 20:10:55 +0000 Subject: [PATCH 2983/7878] Make a note of our intent to deprecate the apr_lock.h API in the CHANGES file, for the sake of APR users who don't keep up with dev@apr. Also make a similiar note in the doxygen comment for each function call in the old lock API. Thanks to Ian Holsman for pointing me to the doxygen syntax. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62989 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ include/apr_lock.h | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/CHANGES b/CHANGES index 1dc412caf4d..0fa2c504d53 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Note: We are in the process of deprecating the apr_lock.h API. + The new and improved lock/synchronization APIs now reside + in apr_thread_mutex.h, apr_proc_mutex.h, apr_thread_rwlock.h, + and apr_thread_cond.h. [Aaron Bannert] + *) Enable autoconf 2.52{f,g} build support. [Blair Zajac ] diff --git a/include/apr_lock.h b/include/apr_lock.h index 8c80f35d934..ec98b11b36d 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -118,6 +118,9 @@ typedef struct apr_lock_t apr_lock_t; * only guaranteed to lock processes. * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports * APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. + * @deprecated CAUTION: This API has been deprecated. The new and expanded + * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, + * apr_thread_rwlock.h, and apr_thread_cond.h. */ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, @@ -129,6 +132,9 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, /** * Lock a protected region. * @param lock The lock to set. + * @deprecated CAUTION: This API has been deprecated. The new and expanded + * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, + * apr_thread_rwlock.h, and apr_thread_cond.h. */ APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock); @@ -136,6 +142,9 @@ APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock); * Tries to lock a protected region. * @param lock The lock to set. * @return If it fails, returns APR_EBUSY. Otherwise, it returns APR_SUCCESS. + * @deprecated CAUTION: This API has been deprecated. The new and expanded + * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, + * apr_thread_rwlock.h, and apr_thread_cond.h. */ APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock); @@ -143,6 +152,9 @@ APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock); * Lock a region with either a reader or writer lock. * @param lock The lock to set. * @param type The type of lock to acquire. + * @deprecated CAUTION: This API has been deprecated. The new and expanded + * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, + * apr_thread_rwlock.h, and apr_thread_cond.h. */ APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e type); @@ -150,6 +162,9 @@ APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock, /** * Unlock a protected region. * @param lock The lock to reset. + * @deprecated CAUTION: This API has been deprecated. The new and expanded + * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, + * apr_thread_rwlock.h, and apr_thread_cond.h. */ APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock); @@ -158,6 +173,9 @@ APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock); * @param lock The lock to free. * @remark If the lock is currently active when it is destroyed, it * will be unlocked first. + * @deprecated CAUTION: This API has been deprecated. The new and expanded + * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, + * apr_thread_rwlock.h, and apr_thread_cond.h. */ APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock); @@ -173,6 +191,9 @@ APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock); * locking mechanism chosen for the platform, but it is a good * idea to call it regardless, because it makes the code more * portable. + * @deprecated CAUTION: This API has been deprecated. The new and expanded + * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, + * apr_thread_rwlock.h, and apr_thread_cond.h. */ APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, const char *fname, @@ -183,6 +204,9 @@ APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, * @param lock The currently open lock. * @param key The key to use when retreiving data associated with this lock * @param data The user data associated with the lock. + * @deprecated CAUTION: This API has been deprecated. The new and expanded + * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, + * apr_thread_rwlock.h, and apr_thread_cond.h. */ APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key, void *data); @@ -193,6 +217,9 @@ APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key, * @param data The user data to associate with the lock. * @param key The key to use when associating data with this lock * @param cleanup The cleanup to use when the lock is destroyed. + * @deprecated CAUTION: This API has been deprecated. The new and expanded + * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, + * apr_thread_rwlock.h, and apr_thread_cond.h. */ APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, From 2ca05b30b1e1e1385d48b55f1241920cf583d7f7 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 15 Feb 2002 21:15:44 +0000 Subject: [PATCH 2984/7878] some more Doxygen goodness still alot more #defines to go git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62990 13f79535-47bb-0310-9956-ffa450edef68 --- docs/doxygen.conf | 1 + include/apr_file_info.h | 10 +++++----- include/apr_general.h | 14 ++++++++++++++ include/apr_getopt.h | 3 +++ include/apr_thread_proc.h | 12 ++++++++++++ include/apr_time.h | 2 ++ include/apr_uuid.h | 2 +- 7 files changed, 38 insertions(+), 6 deletions(-) diff --git a/docs/doxygen.conf b/docs/doxygen.conf index d05be9c0da9..f38d3e3d544 100644 --- a/docs/doxygen.conf +++ b/docs/doxygen.conf @@ -13,6 +13,7 @@ EXPAND_ONLY_PREDEF=YES # not sure why this doesn't work as EXPAND_AS_DEFINED, it should! PREDEFINED="APR_DECLARE(x)=x" \ "APR_DECLARE_NONSTD(x)=x" \ + "APR_HAS_XLATE" \ DOXYGEN= OPTIMIZE_OUTPUT_FOR_C=YES diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 073fdc94a2b..377f3c89012 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -150,11 +150,11 @@ typedef dev_t apr_dev_t; typedef struct apr_finfo_t apr_finfo_t; #define APR_FINFO_LINK 0x00000001 /**< Stat the link not the file itself if it is a link */ -#define APR_FINFO_MTIME 0x00000010 -#define APR_FINFO_CTIME 0x00000020 -#define APR_FINFO_ATIME 0x00000040 -#define APR_FINFO_SIZE 0x00000100 -#define APR_FINFO_CSIZE 0x00000200 +#define APR_FINFO_MTIME 0x00000010 /**< Modification Time */ +#define APR_FINFO_CTIME 0x00000020 /**< Creation Time */ +#define APR_FINFO_ATIME 0x00000040 /**< Access Time */ +#define APR_FINFO_SIZE 0x00000100 /**< Size of the file */ +#define APR_FINFO_CSIZE 0x00000200 /**< Storage size consumed by the file */ #define APR_FINFO_DEV 0x00001000 #define APR_FINFO_INODE 0x00002000 #define APR_FINFO_NLINK 0x00004000 diff --git a/include/apr_general.h b/include/apr_general.h index d3030d0c902..6d3664640fa 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -76,20 +76,34 @@ extern "C" { * @{ */ +/** FALSE */ #ifndef FALSE #define FALSE 0 #endif +/** TRUE */ #ifndef TRUE #define TRUE (!FALSE) #endif +/** + * The Win32 call WaitForMultipleObjects will only allow you to wait for + * a maximum of MAXIMUM_WAIT_OBJECTS (current 64). Since the threading + * model in the multithreaded version of apache wants to use this call, + * we are restricted to a maximum of 64 threads. + * @see wait_for_many_objects for a way to increase this size + */ + #ifndef MAXIMUM_WAIT_OBJECTS #define MAXIMUM_WAIT_OBJECTS 64 #endif +/** a space */ #define APR_ASCII_BLANK '\040' +/** a carrige return */ #define APR_ASCII_CR '\015' +/** a line feed */ #define APR_ASCII_LF '\012' +/** a tab */ #define APR_ASCII_TAB '\011' typedef int apr_signum_t; diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 4c771e8c3db..24114d81b9b 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -71,6 +71,9 @@ extern "C" { * @{ */ +/** + * defintion of a error function + */ typedef void (apr_getopt_err_fn_t)(void *arg, const char *err, ...); typedef struct apr_getopt_t apr_getopt_t; diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index dcc9cec32ee..d8598e0f37e 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -102,18 +102,30 @@ typedef enum { APR_PROC_SIGNAL_CORE = 4 /**< process exited and dumped a core file */ } apr_exit_why_e; +/** did we exit the process */ #define APR_PROC_CHECK_EXIT(x) (x & APR_PROC_EXIT) +/** did we get a signal */ #define APR_PROC_CHECK_SIGNALED(x) (x & APR_PROC_SIGNAL) +/** did we get core */ #define APR_PROC_CHECK_CORE_DUMP(x) (x & APR_PROC_SIGNAL_CORE) +/** @see apr_procattr_io_set */ #define APR_NO_PIPE 0 + +/** @see apr_procattr_io_set */ #define APR_FULL_BLOCK 1 +/** @see apr_procattr_io_set */ #define APR_FULL_NONBLOCK 2 +/** @see apr_procattr_io_set */ #define APR_PARENT_BLOCK 3 +/** @see apr_procattr_io_set */ #define APR_CHILD_BLOCK 4 +/** @see apr_procattr_limit_set */ #define APR_LIMIT_CPU 0 +/** @see apr_procattr_limit_set */ #define APR_LIMIT_MEM 1 +/** @see apr_procattr_limit_set */ #define APR_LIMIT_NPROC 2 #if APR_HAS_OTHER_CHILD || defined(DOXYGEN) diff --git a/include/apr_time.h b/include/apr_time.h index b9da57c6e08..5fe80028e51 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -89,8 +89,10 @@ typedef apr_int64_t apr_time_t; /** intervals for I/O timeouts, in microseconds */ typedef apr_int64_t apr_interval_time_t; +/** short interval for I/O timeouts, in microseconds */ typedef apr_int32_t apr_short_interval_time_t; +/** number of microseconds per second */ #define APR_USEC_PER_SEC APR_TIME_C(1000000) diff --git a/include/apr_uuid.h b/include/apr_uuid.h index 3fc11f68348..a5324221329 100644 --- a/include/apr_uuid.h +++ b/include/apr_uuid.h @@ -80,7 +80,7 @@ typedef struct { unsigned char data[16]; /**< the actual UUID */ } apr_uuid_t; -/* UUIDs are formatted as: 00112233-4455-6677-8899-AABBCCDDEEFF */ +/** UUIDs are formatted as: 00112233-4455-6677-8899-AABBCCDDEEFF */ #define APR_UUID_FORMATTED_LENGTH 36 From b03aa800a0a8da31bf4792963f4bf2ab46edbd8e Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 15 Feb 2002 22:36:40 +0000 Subject: [PATCH 2985/7878] provide APR_CC_HINTS. This allows us to specify a default compiler which the user can override externally (i.e., the compiler choice isn't forced). Then AC_PROG_CC can verify that the compiler works, and logic in APR_PRELOAD can make decisions based on the compiler choice. This is most useful when AC_PROG_CC picks a compiler which exists but which isn't appropriate for APR's needs. On os390, AC_PROG_CC chose c89 which doesn't support long long by default. This caused problems with apr_int64_t in apr.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62991 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 18 ++++++++++++++++-- configure.in | 5 +++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index bf4f6ed63c4..7d2dffd80d6 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -365,7 +365,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(apr_process_lock_is_global, [yes]) APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes]) APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes]) - APR_SETIFNULL(CC, [cc]) APR_ADDTO(CPPFLAGS, [-U_NO_PROTO -DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR -DPTHREAD_SETS_ERRNO -DPTHREAD_DETACH_ARG1_ADDR -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1]) ;; *-ibm-as400) @@ -373,7 +372,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(apr_process_lock_is_global, [yes]) APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes]) APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes]) - APR_SETIFNULL(CC, [icc]) ;; *cygwin*) APR_ADDTO(CPPFLAGS, [-DCYGWIN]) @@ -383,3 +381,19 @@ dnl # Not a problem in 10.20. Otherwise, who knows? fi ]) + +dnl +dnl APR_CC_HINTS +dnl +dnl Allows us to provide a default choice of compiler which +dnl the user can override. +AC_DEFUN(APR_CC_HINTS, [ +case "$host" in + *-ibm-os390) + APR_SETIFNULL(CC, [cc]) + ;; + *-ibm-as400) + APR_SETIFNULL(CC, [icc]) + ;; +esac +]) diff --git a/configure.in b/configure.in index aea8e4dd281..c4bc1508cba 100644 --- a/configure.in +++ b/configure.in @@ -36,6 +36,11 @@ echo "Platform: $host" dnl # Some initial steps for configuration. We setup the default directory dnl # and which files are to be configured. +dnl Set optional CC hints here in case autoconf make an inappropriate choice. +dnl This allows us to suggest what the compiler should be, but still +dnl allows the user to override CC externally. +APR_CC_HINTS + dnl Do the various CC checks *before* preloading values. The preload code dnl may need to use compiler characteristics to make decisions. This macro dnl can only be used once within a configure script, so this prevents a From 79dd66c2ac95c2fc567819010f761da075ad676a Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sat, 16 Feb 2002 16:34:32 +0000 Subject: [PATCH 2986/7878] remove CAS option as linux doesn't support it out of the box (needs to be there, but getting native versions working on the add/dec is more important) get a 'linux-only' version running newtype apr_atomic_t test program can switch between mutex/atomic (so you can see the speed difference easily) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62992 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 19 +++++++--- include/apr_atomic.h | 26 ++++++++++--- test/testatomic.c | 81 +++++++++++++++++++++++----------------- 3 files changed, 80 insertions(+), 46 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index cedcb9fd586..63def1cc739 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -5,6 +5,8 @@ #ifdef WIN32 /* win32 implementation is all macros */ +#elif defined(__linux) +/* linux implementation is all macros */ #else #if APR_HAS_THREADS @@ -26,7 +28,7 @@ apr_status_t apr_atomic_init(apr_pool_t *p ) } return APR_SUCCESS; } -long apr_atomic_add(volatile long*mem, long val) +apr_uint32_t apr_atomic_add(volatile apr_atomic_t *mem, long val) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; long prev; @@ -39,7 +41,7 @@ long apr_atomic_add(volatile long*mem, long val) } return *mem; } -long apr_atomic_set(volatile long*mem, long val) +apr_uint32_t apr_atomic_set(volatile apr_atomic_t *mem, long val) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; long prev; @@ -53,7 +55,7 @@ long apr_atomic_set(volatile long*mem, long val) return *mem; } -long apr_atomic_inc( volatile long *mem) +apr_uint32_t apr_atomic_inc( volatile apr_uint32_t *mem) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; long prev; @@ -66,7 +68,7 @@ long apr_atomic_inc( volatile long *mem) } return *mem; } -long apr_atomic_dec(volatile long *mem) +apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; long prev; @@ -79,7 +81,12 @@ long apr_atomic_dec(volatile long *mem) } return *mem; } -long apr_atomic_cas(volatile long *mem,long with,long cmp) +#if 0 +/* + * linux doesn't have a easy to do this + * so comment it out for the moment + */ +apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem,apr_uint32_t with, apr_uint32_t cmp) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; long prev; @@ -94,7 +101,7 @@ long apr_atomic_cas(volatile long *mem,long with,long cmp) } return *mem; } - +#endif #endif /* APR_HAS_THREADS */ #endif /* default implementation */ diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 2d32e62ce28..0cae926290a 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -63,26 +63,40 @@ extern "C" { #endif #ifdef WIN32 +#define apr_atomic_t LONG; #define apr_atomic_add(mem, val) InterlockedExchangeAdd(mem,val) #define apr_atomic_dec(mem) InterlockedDecrement(mem) #define apr_atomic_inc(mem) InterlockedIncrement(mem) #define apr_atomic_set(mem, val) InterlockedExchange(mem, val) #define apr_atomic_read(mem) *mem -#define apr_atomic_cas(mem,with,cmp) InterlockedCompareExchange(mem,with,cmp) +/* #define apr_atomic_cas(mem,with,cmp) InterlockedCompareExchange(mem,with,cmp)*/ #define apr_atomic_init(pool) APR_SUCCESS +#elif defined(__linux) +#include +#define apr_atomic_t atomic_t + +#define apr_atomic_add(mem, val) atomic_add(val,mem) +#define apr_atomic_dec(mem) atomic_dec(mem) +#define apr_atomic_inc(mem) atomic_inc(mem) +#define apr_atomic_set(mem, val) atomic_set(mem, val) +#define apr_atomic_read(mem) atomic_read(mem) +#define apr_atomic_init(pool) APR_SUCCESS + + #else #if APR_HAS_THREADS +#define apr_atomic_t apr_uint32_t #define apr_atomic_read(p) *p apr_status_t apr_atomic_init(apr_pool_t *p); -long apr_atomic_set(volatile long*mem, long val); -long apr_atomic_add(volatile long*mem, long val); -long apr_atomic_inc( volatile long *mem); -long apr_atomic_dec(volatile long *mem); -long apr_atomic_cas(volatile long *mem,long with,long cmp); +apr_uint32_t apr_atomic_set(volatile apr_atomic_t *mem, long val); +apr_uint32_t apr_atomic_add(volatile apr_atomic_t *mem, long val); +apr_uint32_t apr_atomic_inc(volatile apr_atomic_t *mem); +apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem); +/*long apr_atomic_cas(volatile apr_atomic_t *mem,long with,long cmp);*/ #endif /* APR_HAS_THREADS */ diff --git a/test/testatomic.c b/test/testatomic.c index 8c554911edf..d10adabc8f4 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -78,27 +78,27 @@ int main(void) } #else /* !APR_HAS_THREADS */ -void * APR_THREAD_FUNC thread_func_traditional(apr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data); apr_lock_t *thread_lock; apr_pool_t *context; apr_thread_once_t *control = NULL; -volatile long x = 0; /* traditional locks */ -volatile long y = 0; /* atomic locks */ +volatile long x = 0; /* mutex locks */ +apr_atomic_t y; /* atomic locks */ volatile long z = 0; /* no locks */ int value = 0; apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ -#define NUM_THREADS 10 +#define NUM_THREADS 50 #define NUM_ITERATIONS 20000 static void init_func(void) { value++; } -void * APR_THREAD_FUNC thread_func_traditional(apr_thread_t *thd, void *data) +void * APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data) { int i; @@ -112,6 +112,7 @@ void * APR_THREAD_FUNC thread_func_traditional(apr_thread_t *thd, void *data) apr_thread_exit(thd, exit_ret_val); return NULL; } + void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data) { int i; @@ -136,22 +137,23 @@ void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data) apr_thread_exit(thd, exit_ret_val); return NULL; } -int main(void) +int main(int argc, char**argv) { apr_thread_t *t1[NUM_THREADS]; apr_thread_t *t2[NUM_THREADS]; - apr_thread_t *t3[NUM_THREADS]; apr_status_t r1[NUM_THREADS]; apr_status_t r2[NUM_THREADS]; - apr_status_t r3[NUM_THREADS]; apr_status_t s1[NUM_THREADS]; apr_status_t s2[NUM_THREADS]; - apr_status_t s3[NUM_THREADS]; apr_status_t rv; int i; + int mutex=0; apr_initialize(); + if (argc==2 && argv[1][0]=='m') + mutex=1; + printf("APR Simple Thread Test\n======================\n\n"); #ifndef WIN32 @@ -176,16 +178,18 @@ int main(void) exit(-1); } rv = apr_atomic_init( context); + apr_atomic_set(&y,0); printf("OK\n"); printf("%-60s", "Starting all the threads"); for (i=0;i Date: Sat, 16 Feb 2002 18:34:54 +0000 Subject: [PATCH 2987/7878] Just for clarity git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62993 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 0cae926290a..1a86b5d62c4 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -62,7 +62,9 @@ #ifdef __cplusplus extern "C" { #endif + #ifdef WIN32 + #define apr_atomic_t LONG; #define apr_atomic_add(mem, val) InterlockedExchangeAdd(mem,val) @@ -74,6 +76,7 @@ extern "C" { #define apr_atomic_init(pool) APR_SUCCESS #elif defined(__linux) + #include #define apr_atomic_t atomic_t @@ -84,8 +87,7 @@ extern "C" { #define apr_atomic_read(mem) atomic_read(mem) #define apr_atomic_init(pool) APR_SUCCESS - -#else +#else /* !defined(WIN32) && !defined(__linux) */ #if APR_HAS_THREADS @@ -100,7 +102,8 @@ apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem); #endif /* APR_HAS_THREADS */ -#endif +#endif /* !defined(WIN32) && !defined(__linux) */ + #ifdef __cplusplus } #endif From 2314526218f93f046cc9faad9abe0d1afd88f611 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 16 Feb 2002 19:10:05 +0000 Subject: [PATCH 2988/7878] We don't look for palloc to fail git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62994 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/locks.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 62abb6962f2..b5a5196056c 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -165,9 +165,6 @@ APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, */ (*lock) = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); - if ((*lock) == NULL) { - return APR_ENOMEM; - } if (fname) { if (apr_os_level >= APR_WIN_2000) { (*lock)->fname = apr_pstrcat(pool, "Global\\", fname, NULL); From 81632ca412bb5fd7b2bb1e9e8f678112b2ae7b22 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 17 Feb 2002 04:11:53 +0000 Subject: [PATCH 2989/7878] By request, some handle debugging code to use, internally or externally. Docs enclosed, I'm sure we will be tilting at these windmills a few more times before APR hits 1.0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62995 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_dbg_win32_handles.h | 216 +++++++++++++++++++++ 1 file changed, 216 insertions(+) create mode 100644 include/arch/win32/apr_dbg_win32_handles.h diff --git a/include/arch/win32/apr_dbg_win32_handles.h b/include/arch/win32/apr_dbg_win32_handles.h new file mode 100644 index 00000000000..175f3fd7605 --- /dev/null +++ b/include/arch/win32/apr_dbg_win32_handles.h @@ -0,0 +1,216 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_DBG_WIN32_HANDLES_H +#define APR_DBG_WIN32_HANDLES_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* USAGE: + * + * Add the following include to apr_private.h for internal debugging, + * or copy this header into apr/include add the include below to apr.h + * for really global debugging; + * + * #include "apr_dbg_win32_handles.h" + * + * apr_dbg_log is the crux of this function ... it uses Win32 API and + * no apr calls itself to log all activity to a file named for the + * executing application with a .pid suffix. Ergo several instances + * may be executing and logged at once. + * + * HANDLE apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, int nh + * [, HANDLE *hv, char *dsc...]) + * + * returns: the handle passed in ha, which is cast back to the real return type. + * + * formats one line into the debug log file if nh is zero; + * ha (hex) seq(hex) tid(hex) fn fl ln + * xxxxxxxx xxxxxxxx xxxxxxxx func() sourcefile:lineno + * The macro apr_dbg_rv makes this simple to implement for many APIs + * that simply take args that don't interest us, and return a handle. + * + * formats multiple lines (nh) into the debug log file for each hv/dsc pair + * (nh must correspond to the number of pairs); + * hv (hex) seq(hex) tid(hex) fn dsc fl ln + * xxxxxxxx xxxxxxxx xxxxxxxx func(arg) sourcefile:lineno + * In this later usage, hv is the still the return value but is not + * treated as a handle. + */ + +APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, + int nh,/* HANDLE *hv, char *dsc */...); + +#define apr_dbg_rv(fn, args) (apr_dbg_log(#fn,(fn) args,__FILE__,__LINE__,0)) + +#define CloseHandle(h) \ + ((BOOL)apr_dbg_log("CloseHandle", \ + (HANDLE)(CloseHandle)(h), \ + __FILE__,__LINE__,1, \ + &(h),"")) + +#define CreateEventA(sd,b1,b2,nm) apr_dbg_rv(CreateEventA,(sd,b1,b2,nm)) +#define CreateEventW(sd,b1,b2,nm) apr_dbg_rv(CreateEventW,(sd,b1,b2,nm)) + +#define CreateFileA(nm,d1,d2,sd,d3,d4,h) apr_dbg_rv(CreateFileA,(nm,d1,d2,sd,d3,d4,h)) +#define CreateFileW(nm,d1,d2,sd,d3,d4,h) apr_dbg_rv(CreateFileW,(nm,d1,d2,sd,d3,d4,h)) + +#define CreateFileMappingA(fh,sd,d1,d2,d3,nm) apr_dbg_rv(CreateFileMappingA,(fh,sd,d1,d2,d3,nm)) +#define CreateFileMappingW(fh,sd,d1,d2,d3,nm) apr_dbg_rv(CreateFileMappingW,(fh,sd,d1,d2,d3,nm)) + +#define CreateMutexA(sd,b,nm) apr_dbg_rv(CreateMutexA,(sd,b,nm)) +#define CreateMutexW(sd,b,nm) apr_dbg_rv(CreateMutexW,(sd,b,nm)) + +#define CreateIoCompletionPort(h1,h2,pd1,d2) apr_dbg_rv(CreateIoCompletionPort,(h1,h2,pd1,d2)) + +#define CreateNamedPipeA(nm,d1,d2,d3,d4,d5,d6,sd) apr_dbg_rv(CreateNamedPipeA,(nm,d1,d2,d3,d4,d5,d6,sd)) +#define CreateNamedPipeW(nm,d1,d2,d3,d4,d5,d6,sd) apr_dbg_rv(CreateNamedPipeW,(nm,d1,d2,d3,d4,d5,d6,sd)) + +#define CreatePipe(ph1,ph2,sd,d) \ + ((BOOL)apr_dbg_log("CreatePipe", \ + (HANDLE)(CreatePipe)(ph1,ph2,sd,d), \ + __FILE__,__LINE__,2, \ + (ph1),"hRead", \ + (ph2),"hWrite")) + +#define CreateProcessA(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr) \ + ((BOOL)apr_dbg_log("CreateProcessA", \ + (HANDLE)(CreateProcessA)(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr), \ + __FILE__,__LINE__,2, \ + &((hr)->hProcess),"hProcess", \ + &((hr)->hThread),"hThread")) +#define CreateProcessW(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr) \ + ((BOOL)apr_dbg_log("CreateProcessW", \ + (HANDLE)(CreateProcessW)(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr), \ + __FILE__,__LINE__,2, \ + &((hr)->hProcess),"hProcess", \ + &((hr)->hThread),"hThread")) + +#define CreateSemaphoreA(sd,d1,d2,nm) apr_dbg_rv(CreateSemaphoreA,(sd,d1,d2,nm)) +#define CreateSemaphoreW(sd,d1,d2,nm) apr_dbg_rv(CreateSemaphoreW,(sd,d1,d2,nm)) + +#define CreateThread(sd,d1,fn,pv,d2,pd3) apr_dbg_rv(CreateThread,(sd,d1,fn,pv,d2,pd3)) + +#define DuplicateHandle(h1,h2,h3,ph4,d1,b,d2) \ + ((BOOL)apr_dbg_log("DuplicateHandle", \ + (HANDLE)(DuplicateHandle)(h1,h2,h3,ph4,d1,b,d2), \ + __FILE__,__LINE__,2, \ + (ph4),((h3)==GetCurrentProcess()) \ + ? "Target" : "EXTERN Target", \ + &(h2),((h1)==GetCurrentProcess()) \ + ? "Source" : "EXTERN Source")) + +#define GetCurrentProcess() (apr_dbg_log("GetCurrentProcess",(GetCurrentProcess)(),__FILE__,__LINE__,0)) + +#define GetCurrentThread() (apr_dbg_log("GetCurrentThread",(GetCurrentThread)(),__FILE__,__LINE__,0)) + +#define GetModuleHandleA(nm) apr_dbg_rv(GetModuleHandleA,(nm)) +#define GetModuleHandleW(nm) apr_dbg_rv(GetModuleHandleW,(nm)) + +#define GetStdHandle(d) apr_dbg_rv(GetStdHandle,(d)) + +#define LoadLibraryA(nm) apr_dbg_rv(LoadLibraryA,(nm)) +#define LoadLibraryW(nm) apr_dbg_rv(LoadLibraryW,(nm)) + +#define LoadLibraryExA(nm,h,d) apr_dbg_rv(LoadLibraryExA,(nm,h,d)) +#define LoadLibraryExW(nm,h,d) apr_dbg_rv(LoadLibraryExW,(nm,h,d)) + +#define OpenEventA(d,b,nm) apr_dbg_rv(OpenEventA,(d,b,nm)) +#define OpenEventW(d,b,nm) apr_dbg_rv(OpenEventW,(d,b,nm)) + +#define OpenFileMappingA(d,b,nm) apr_dbg_rv(OpenFileMappingA,(d,b,nm)) +#define OpenFileMappingW(d,b,nm) apr_dbg_rv(OpenFileMappingW,(d,b,nm)) + +#define SetStdHandle(d,h) \ + ((BOOL)apr_dbg_log("SetStdHandle", \ + (HANDLE)(SetStdHandle)(d,h), \ + __FILE__,__LINE__,1,&(h),"")) + +#define socket(i1,i2,i3) \ + ((SOCKET)apr_dbg_log("socket", \ + (HANDLE)(socket)(i1,i2,i3), \ + __FILE__,__LINE__,0)) + +#define WSASocketA(i1,i2,i3,pi,g,dw) \ + ((SOCKET)apr_dbg_log("WSASocketA", \ + (HANDLE)(WSASocketA)(i1,i2,i3,pi,g,dw), \ + __FILE__,__LINE__,0)) + +#define WSASocketW(i1,i2,i3,pi,g,dw) \ + ((SOCKET)apr_dbg_log("WSASocketW", \ + (HANDLE)(WSASocketW)(i1,i2,i3,pi,g,dw), \ + __FILE__,__LINE__,0)) + +#define closesocket(sh) \ + ((int)apr_dbg_log("closesocket", \ + (HANDLE)(closesocket)(sh), \ + __FILE__,__LINE__,1,&(sh),"")) + +#define _beginthread(fn,d,pv) \ + ((unsigned long)apr_dbg_log("_beginthread", \ + (HANDLE)(_beginthread)(fn,d,pv), \ + __FILE__,__LINE__,0)) + +#define _beginthreadex(sd,d1,fn,pv,d2,pd3) \ + ((unsigned long)apr_dbg_log("_beginthreadex", \ + (HANDLE)(_beginthreadex)(sd,d1,fn,pv,d2,pd3), \ + __FILE__,__LINE__,0)) + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(APR_DBG_WIN32_HANDLES_H) */ From 36a89f78588974956a69650e58e2fe4c85e62dc4 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 17 Feb 2002 15:06:57 +0000 Subject: [PATCH 2990/7878] Dig up old issue that was never resolved. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62996 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 64a9c4281ca..9e303f5fc95 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/02/15 07:55:10 $] +Last modified at [$Date: 2002/02/17 15:06:57 $] Release: @@ -37,6 +37,17 @@ RELEASE SHOWSTOPPERS: lest we support 2 lock APIs in perpetuity. RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + + * The return type of a thread function (void *) is inconsistent with + the type used in apr_thread_exit()/apr_thread_join() (apr_status_t). + The thread function's return type should be changed to apr_status_t + so that a return from the thread main function has the same effect + as apr_thread_exit(). + See Message-Id: for thread + discussing this. + +1: BrianH + -0: Aaron + * Need some architecture/OS specific versions of the atomic operations. Ian Volunteers for the x86 & sparc versions From a6c7120f72ea39e7caeb45c80bf723ece4255fad Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sun, 17 Feb 2002 19:54:03 +0000 Subject: [PATCH 2991/7878] preperation for solaris sparc addition just need to figure out a) where to put it b) how to build it in a apr-nice way git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62997 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 8 ++------ include/apr_atomic.h | 14 +++++++++++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 63def1cc739..bba9b033d13 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -3,11 +3,7 @@ #include "apr_thread_mutex.h" #include "apr_atomic.h" -#ifdef WIN32 -/* win32 implementation is all macros */ -#elif defined(__linux) -/* linux implementation is all macros */ -#else +#if defined(APR_ATOMIC_NEED_DEFAULT) #if APR_HAS_THREADS @@ -104,4 +100,4 @@ apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem,apr_uint32_t with, apr_ui #endif #endif /* APR_HAS_THREADS */ -#endif /* default implementation */ +#endif /* APR_ATOMIC_NEED_DEFAULT */ diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 1a86b5d62c4..76bf36c7af6 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -87,8 +87,19 @@ extern "C" { #define apr_atomic_read(mem) atomic_read(mem) #define apr_atomic_init(pool) APR_SUCCESS -#else /* !defined(WIN32) && !defined(__linux) */ +#elif defined(__sparc__not_ready_yet) +#define apr_atomic_t apr_uint32_t +#define apr_atomic_read(p) *p + +#define apr_atomic_add(mem, val) apr_atomic_add_sparc(mem,val) +#define apr_atomic_dec(mem) apr_atomic_sub_sparc(mem,1) +#define apr_atomic_inc(mem) apr_atomic_add_sparc(mem,1) +#define apr_atomic_set(mem, val) *mem= val +#define apr_atomic_init(pool) APR_SUCCESS +apr_uint32_t apr_atomic_add_sparc( volatile apr_atomic_t* mem, apr_uint32_t add); +apr_uint32_t apr_atomic_sub_sparc( volatile apr_atomic_t* mem, apr_uint32_t sub); +#else #if APR_HAS_THREADS #define apr_atomic_t apr_uint32_t @@ -100,6 +111,7 @@ apr_uint32_t apr_atomic_inc(volatile apr_atomic_t *mem); apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem); /*long apr_atomic_cas(volatile apr_atomic_t *mem,long with,long cmp);*/ +#define APR_ATOMIC_NEED_DEFAULT 1 #endif /* APR_HAS_THREADS */ #endif /* !defined(WIN32) && !defined(__linux) */ From dce43a0f7f70ab009c39d97005a1f00e50928c49 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sun, 17 Feb 2002 19:57:07 +0000 Subject: [PATCH 2992/7878] The assembly for atomic_add/dec for sun solaris still need to figure out how to linkcleanly so it's not 'built' by default git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62998 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/apr_atomic_sparc.s | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 atomic/solaris_sparc/apr_atomic_sparc.s diff --git a/atomic/solaris_sparc/apr_atomic_sparc.s b/atomic/solaris_sparc/apr_atomic_sparc.s new file mode 100644 index 00000000000..60413a88f76 --- /dev/null +++ b/atomic/solaris_sparc/apr_atomic_sparc.s @@ -0,0 +1,46 @@ +!* +!* +!* This code is based on the UltraSPARC atomics library by Mike Bennett +!* The Initial Developer of the Original Code is Mike Bennett, +!* mbennett@netcom.com, Copyright (C) 1999. All Rights Reserved. +!* This code is based on the sparc architecture Manual version 9 +!* section J.11 (page 333) +! +#include +! %o0 [input] - the address of the value to increment +! %o1 [input] - the increment delta value +! %o2 [local] - work register (was %l0 in book) +! %o3 [local] - work register (was %l1 in book) +! %o0 [output] - contains return value +! +! +! + ENTRY(apr_atomic_add_sparc) + + ld [%o0], %o2 +_apr_atomic_add_sparc_loop: + add %o2, %o1, %o3 + cas [%o0], %o2, %o3 + cmp %o2, %o3 + bne,a _apr_atomic_add_sparc_loop + ld [%o0], %o2 + retl + mov %o3, %o0 + + SET_SIZE(apr_atomic_add_sparc) +! +! + ENTRY(apr_atomic_sub_sparc) + + ld [%o0], %o2 +_apr_atomic_sub_sparc_loop: + sub %o2, %o1, %o3 + cas [%o0], %o2, %o3 + cmp %o2, %o3 + bne,a _apr_atomic_sub_sparc_loop + ld [%o0], %o2 + retl + mov %o3, %o0 + + SET_SIZE(apr_atomic_sub_sparc) + From a1057f740b29af97a0fa040089a25cb94b1063c4 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sun, 17 Feb 2002 20:17:54 +0000 Subject: [PATCH 2993/7878] add copyright and missing sparc makefile git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62999 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/Makefile.in | 19 +++++++++ atomic/solaris_sparc/apr_atomic_sparc.s | 54 ++++++++++++++++++++++++ atomic/unix/apr_atomic.c | 55 +++++++++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 atomic/solaris_sparc/Makefile.in diff --git a/atomic/solaris_sparc/Makefile.in b/atomic/solaris_sparc/Makefile.in new file mode 100644 index 00000000000..a5537371d03 --- /dev/null +++ b/atomic/solaris_sparc/Makefile.in @@ -0,0 +1,19 @@ + +TARGETS = apr_atomic_sparc.lo + +ASFLAGS += -K pic +ASFLAGS += -P -D_ASM -D__STDC__=0 +ASFLAGS += -xarch=v8plus + +apr_atomic_sparc.lo: apr_atomic_sparc.s + $(AS) -P -D_ASM -D__STDC__=0 -K PIC -q -o $@ $< + + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) + +# DO NOT REMOVE diff --git a/atomic/solaris_sparc/apr_atomic_sparc.s b/atomic/solaris_sparc/apr_atomic_sparc.s index 60413a88f76..f17cb2bbe41 100644 --- a/atomic/solaris_sparc/apr_atomic_sparc.s +++ b/atomic/solaris_sparc/apr_atomic_sparc.s @@ -1,3 +1,57 @@ +!* ==================================================================== +!* The Apache Software License, Version 1.1 +!* +!* Copyright (c) 2000-2001 The Apache Software Foundation. All rights +!* reserved. +!* +!* Redistribution and use in source and binary forms, with or without +!* modification, are permitted provided that the following conditions +!* are met: +!* +!* 1. Redistributions of source code must retain the above copyright +!* notice, this list of conditions and the following disclaimer. +!* +!* 2. Redistributions in binary form must reproduce the above copyright +!* notice, this list of conditions and the following disclaimer in +!* the documentation and/or other materials provided with the +!* distribution. +!* +!* 3. The end-user documentation included with the redistribution, +!* if any, must include the following acknowledgment: +!* "This product includes software developed by the +!* Apache Software Foundation (http://www.apache.org/)." +!* Alternately, this acknowledgment may appear in the software itself, +!* if and wherever such third-party acknowledgments normally appear. +!* +!* 4. The names "Apache" and "Apache Software Foundation" must +!* not be used to endorse or promote products derived from this +!* software without prior written permission. For written +!* permission, please contact apache@apache.org. +!* +!* 5. Products derived from this software may not be called "Apache", +!* nor may "Apache" appear in their name, without prior written +!* permission of the Apache Software Foundation. +!* +!* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +!* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +!* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +!* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR +!* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +!* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +!* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +!* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +!* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +!* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +!* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +!* SUCH DAMAGE. +!* ==================================================================== +!* +!* This software consists of voluntary contributions made by many +!* individuals on behalf of the Apache Software Foundation. For more +!* information on the Apache Software Foundation, please see +!* . +!* + !* !* !* This code is based on the UltraSPARC atomics library by Mike Bennett diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index bba9b033d13..3f6be50e10a 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -1,3 +1,58 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + #include "apr.h" #include "apr_lock.h" #include "apr_thread_mutex.h" From ccc0c1ea66f96300a315825be159bed97c004488 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Sun, 17 Feb 2002 20:51:58 +0000 Subject: [PATCH 2994/7878] Actually, I came to agree with this and even had intended to post a patch, but I just haven't gotten around to it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63000 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 9e303f5fc95..5454fb4868f 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/02/17 15:06:57 $] +Last modified at [$Date: 2002/02/17 20:51:58 $] Release: @@ -45,8 +45,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: as apr_thread_exit(). See Message-Id: for thread discussing this. - +1: BrianH - -0: Aaron + +1: BrianH, Aaron * Need some architecture/OS specific versions of the atomic operations. Ian Volunteers for the x86 & sparc versions From 2088bef70a2294c229c841448325c95dd4aa9b48 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Mon, 18 Feb 2002 01:16:04 +0000 Subject: [PATCH 2995/7878] Add a new lock API: apr_global_mutex_t This is analog to the APR_LOCKALL method of apr_lock_t, and provides cross-process AND cross-thread mutual exclusion. I have provided a simple test (based on testprocmutex.c) and stubs for non-Unix platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63001 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_global_mutex.h | 164 ++++++++++++++++++++++++++ include/arch/unix/global_mutex.h | 73 ++++++++++++ locks/beos/Makefile.in | 3 +- locks/beos/global_mutex.c | 95 +++++++++++++++ locks/netware/global_mutex.c | 95 +++++++++++++++ locks/os2/Makefile.in | 3 +- locks/os2/global_mutex.c | 95 +++++++++++++++ locks/unix/Makefile.in | 3 +- locks/unix/global_mutex.c | 178 ++++++++++++++++++++++++++++ locks/win32/global_mutex.c | 95 +++++++++++++++ test/Makefile.in | 4 + test/testglobalmutex.c | 193 +++++++++++++++++++++++++++++++ 12 files changed, 998 insertions(+), 3 deletions(-) create mode 100644 include/apr_global_mutex.h create mode 100644 include/arch/unix/global_mutex.h create mode 100644 locks/beos/global_mutex.c create mode 100644 locks/netware/global_mutex.c create mode 100644 locks/os2/global_mutex.c create mode 100644 locks/unix/global_mutex.c create mode 100644 locks/win32/global_mutex.c create mode 100644 test/testglobalmutex.c diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h new file mode 100644 index 00000000000..56e39bad407 --- /dev/null +++ b/include/apr_global_mutex.h @@ -0,0 +1,164 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_GLOBAL_MUTEX_H +#define APR_GLOBAL_MUTEX_H + +#include "apr.h" +#include "apr_lock.h" /* only for apr_lockmech_e_np */ +#include "apr_pools.h" +#include "apr_errno.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @file apr_global_mutex.h + * @brief APR Global Locking Routines + */ + +/** + * @defgroup APR_GlobalMutex Global Locking Routines + * @ingroup APR + * @{ + */ + +typedef struct apr_global_mutex_t apr_global_mutex_t; + +/* Function definitions */ + +/** + * Create and initialize a mutex that can be used to synchronize both + * processes and threads. Note: There is considerable overhead in using + * this API if only cross-process or cross-thread mutual exclusion is + * required. See apr_proc_mutex.h and apr_thread_mutex.h for more + * specialized lock routines. + * @param mutex the memory address where the newly created mutex will be + * stored. + * @param fname A file name to use if the lock mechanism requires one. This + * argument should always be provided. The lock code itself will + * determine if it should be used. + * @param mech The mechanism to use for the interprocess lock, if any; one of + *
    + *            APR_LOCK_FCNTL
    + *            APR_LOCK_FLOCK
    + *            APR_LOCK_SYSVSEM
    + *            APR_LOCK_PROC_PTHREAD
    + *            APR_LOCK_DEFAULT     pick the default mechanism for the platform
    + * 
    + * @param pool the pool from which to allocate the mutex. + * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports + * APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. + */ +APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, + const char *fname, + apr_lockmech_e mech, + apr_pool_t *pool); + +/** + * Re-open a mutex in a child process. + * @param mutex The newly re-opened mutex structure. + * @param fname A file name to use if the mutex mechanism requires one. This + * argument should always be provided. The mutex code itself will + * determine if it should be used. This filename should be the + * same one that was passed to apr_global_mutex_create(). + * @param pool The pool to operate on. + * @remark This function must be called to maintain portability, even + * if the underlying lock mechanism does not require it. + */ +APR_DECLARE(apr_status_t) apr_global_mutex_child_init( + apr_global_mutex_t **mutex, + const char *fname, + apr_pool_t *pool); + +/** + * Acquire the lock for the given mutex. If the mutex is already locked, + * the current thread will be put to sleep until the lock becomes available. + * @param mutex the mutex on which to acquire the lock. + */ +APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex); + +/** + * Attempt to acquire the lock for the given mutex. If the mutex has already + * been acquired, the call returns immediately with APR_EBUSY. Note: it + * is important that the APR_STATUS_IS_EBUSY(s) macro be used to determine + * if the return value was APR_EBUSY, for portability reasons. + * @param mutex the mutex on which to attempt the lock acquiring. + */ +APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex); + +/** + * Release the lock for the given mutex. + * @param mutex the mutex from which to release the lock. + */ +APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex); + +/** + * Destroy the mutex and free the memory associated with the lock. + * @param mutex the mutex to destroy. + */ +APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex); + +/** + * Get the pool used by this global_mutex. + * @return apr_pool_t the pool + */ +APR_POOL_DECLARE_ACCESSOR(global_mutex); + +#ifdef __cplusplus +} +#endif + +#endif /* ndef APR_GLOBAL_MUTEX_H */ diff --git a/include/arch/unix/global_mutex.h b/include/arch/unix/global_mutex.h new file mode 100644 index 00000000000..e1a79bd5dfb --- /dev/null +++ b/include/arch/unix/global_mutex.h @@ -0,0 +1,73 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef GLOBAL_MUTEX_H +#define GLOBAL_MUTEX_H + +#include "apr.h" +#include "apr_private.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_global_mutex.h" +#include "proc_mutex.h" +#include "thread_mutex.h" + +struct apr_global_mutex_t { + apr_pool_t *pool; + apr_proc_mutex_t *proc_mutex; + apr_thread_mutex_t *thread_mutex; +}; + +#endif /* GLOBAL_MUTEX_H */ + diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in index 634eb747424..fa2d5bdb9d5 100644 --- a/locks/beos/Makefile.in +++ b/locks/beos/Makefile.in @@ -3,7 +3,8 @@ TARGETS = locks.lo \ thread_mutex.lo \ thread_rwlock.lo \ thread_cond.lo \ - proc_mutex.lo + proc_mutex.lo \ + global_mutex.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/beos/global_mutex.c b/locks/beos/global_mutex.c new file mode 100644 index 00000000000..879d2b28994 --- /dev/null +++ b/locks/beos/global_mutex.c @@ -0,0 +1,95 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_strings.h" + +APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, + const char *fname, + apr_lockmech_e mech, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_child_init( + apr_global_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_POOL_IMPLEMENT_ACCESSOR(global_mutex); + diff --git a/locks/netware/global_mutex.c b/locks/netware/global_mutex.c new file mode 100644 index 00000000000..879d2b28994 --- /dev/null +++ b/locks/netware/global_mutex.c @@ -0,0 +1,95 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_strings.h" + +APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, + const char *fname, + apr_lockmech_e mech, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_child_init( + apr_global_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_POOL_IMPLEMENT_ACCESSOR(global_mutex); + diff --git a/locks/os2/Makefile.in b/locks/os2/Makefile.in index 8d5515014b5..3d63592cf2c 100644 --- a/locks/os2/Makefile.in +++ b/locks/os2/Makefile.in @@ -3,7 +3,8 @@ TARGETS = locks.lo \ thread_mutex.lo \ thread_rwlock.lo \ thread_cond.lo \ - proc_mutex.lo + proc_mutex.lo \ + global_mutex.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/os2/global_mutex.c b/locks/os2/global_mutex.c new file mode 100644 index 00000000000..879d2b28994 --- /dev/null +++ b/locks/os2/global_mutex.c @@ -0,0 +1,95 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_strings.h" + +APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, + const char *fname, + apr_lockmech_e mech, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_child_init( + apr_global_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_POOL_IMPLEMENT_ACCESSOR(global_mutex); + diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index 9206e4b483e..2ca8f735dee 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -6,7 +6,8 @@ TARGETS = \ thread_mutex.lo \ thread_rwlock.lo \ thread_cond.lo \ - proc_mutex.lo + proc_mutex.lo \ + global_mutex.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c new file mode 100644 index 00000000000..fcd6d6937b6 --- /dev/null +++ b/locks/unix/global_mutex.c @@ -0,0 +1,178 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_strings.h" +#include "global_mutex.h" +#include "apr_proc_mutex.h" +#include "apr_thread_mutex.h" + + +static apr_status_t global_mutex_cleanup(void *data) +{ + apr_global_mutex_t *m = (apr_global_mutex_t *)data; + apr_status_t rv; + + if (m->thread_mutex) { + rv = apr_thread_mutex_destroy(m->thread_mutex); + if (rv != APR_SUCCESS) { + return rv; + } + } + rv = apr_proc_mutex_destroy(m->proc_mutex); + if (rv != APR_SUCCESS) { + return rv; + } + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, + const char *fname, + apr_lockmech_e mech, + apr_pool_t *pool) +{ + apr_status_t rv; + apr_global_mutex_t *m; + + m = (apr_global_mutex_t *)apr_palloc(pool, sizeof(*m)); + m->pool = pool; + + rv = apr_proc_mutex_create(&m->proc_mutex, fname, mech, m->pool); + if (rv != APR_SUCCESS) { + return rv; + } + + if (m->proc_mutex->inter_meth->flags & APR_PROCESS_LOCK_MECH_IS_GLOBAL) { + m->thread_mutex = NULL; /* We don't need a thread lock. */ + } + else { + rv = apr_thread_mutex_create(&m->thread_mutex, + APR_THREAD_MUTEX_DEFAULT, m->pool); + if (rv != APR_SUCCESS) { + return rv; + } + } + + apr_pool_cleanup_register(m->pool, (void *)m, + global_mutex_cleanup, apr_pool_cleanup_null); + *mutex = m; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_child_init( + apr_global_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) +{ + apr_status_t rv; + + if (mutex->thread_mutex) { + rv = apr_thread_mutex_lock(mutex->thread_mutex); + if (rv != APR_SUCCESS) { + return rv; + } + } + rv = apr_proc_mutex_lock(mutex->proc_mutex); + if (rv != APR_SUCCESS) { + return rv; + } + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) +{ + apr_status_t rv; + + if (mutex->thread_mutex) { + rv = apr_thread_mutex_trylock(mutex->thread_mutex); + if (rv != APR_SUCCESS) { + return rv; + } + } + rv = apr_proc_mutex_trylock(mutex->proc_mutex); + if (rv != APR_SUCCESS) { + return rv; + } + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) +{ + apr_status_t rv; + + rv = apr_proc_mutex_unlock(mutex->proc_mutex); + if (rv != APR_SUCCESS) { + return rv; + } + if (mutex->thread_mutex) { + rv = apr_thread_mutex_unlock(mutex->thread_mutex); + if (rv != APR_SUCCESS) { + return rv; + } + } + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) +{ + return apr_pool_cleanup_run(mutex->pool, mutex, global_mutex_cleanup); +} + +APR_POOL_IMPLEMENT_ACCESSOR(global_mutex); + diff --git a/locks/win32/global_mutex.c b/locks/win32/global_mutex.c new file mode 100644 index 00000000000..879d2b28994 --- /dev/null +++ b/locks/win32/global_mutex.c @@ -0,0 +1,95 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_strings.h" + +APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, + const char *fname, + apr_lockmech_e mech, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_child_init( + apr_global_mutex_t **mutex, + const char *fname, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) +{ + return APR_ENOTIMPL; +} + +APR_POOL_IMPLEMENT_ACCESSOR(global_mutex); + diff --git a/test/Makefile.in b/test/Makefile.in index ffcfe8766ff..f72048669a7 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -33,6 +33,7 @@ PROGRAMS = \ testuser@EXEEXT@ \ testsockets@EXEEXT@ \ testprocmutex@EXEEXT@ \ + testglobalmutex@EXEEXT@ \ testvsn@EXEEXT@ \ testsleep@EXEEXT@ \ testrand@EXEEXT@ \ @@ -160,6 +161,9 @@ testuser@EXEEXT@: testuser.lo $(LOCAL_LIBS) testprocmutex@EXEEXT@: testprocmutex.lo $(LOCAL_LIBS) $(LINK) testprocmutex.lo $(LOCAL_LIBS) $(ALL_LIBS) +testglobalmutex@EXEEXT@: testglobalmutex.lo $(LOCAL_LIBS) + $(LINK) testglobalmutex.lo $(LOCAL_LIBS) $(ALL_LIBS) + testvsn@EXEEXT@: testvsn.lo $(LOCAL_LIBS) $(LINK) testvsn.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c new file mode 100644 index 00000000000..0a15c382d4b --- /dev/null +++ b/test/testglobalmutex.c @@ -0,0 +1,193 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_shm.h" +#include "apr_thread_proc.h" +#include "apr_file_io.h" +#include "apr_lock.h" +#include "apr_global_mutex.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_getopt.h" +#include "errno.h" +#include +#include +#include "test_apr.h" + + +#define MAX_ITER 4000 +#define MAX_COUNTER (MAX_ITER * 4) + +apr_global_mutex_t *global_lock; +apr_pool_t *pool; +int *x; + +static int make_child(apr_proc_t **proc, apr_pool_t *p) +{ + int i = 0; + *proc = apr_pcalloc(p, sizeof(**proc)); + + /* slight delay to allow things to settle */ + apr_sleep (1); + + if (apr_proc_fork(*proc, p) == APR_INCHILD) { + while (1) { + apr_global_mutex_lock(global_lock); + if (i == MAX_ITER) { + apr_global_mutex_unlock(global_lock); + exit(1); + } + i++; + (*x)++; + apr_global_mutex_unlock(global_lock); + } + exit(1); + } + return APR_SUCCESS; +} + +static apr_status_t test_exclusive(const char *lockname) +{ + apr_proc_t *p1, *p2, *p3, *p4; + apr_status_t s1, s2, s3, s4; + + printf("Exclusive lock test\n"); + printf("%-60s", " Initializing the lock"); + s1 = apr_global_mutex_create(&global_lock, lockname, APR_LOCK_DEFAULT, pool); + + if (s1 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + printf("%-60s", " Starting all of the processes"); + fflush(stdout); + s1 = make_child(&p1, pool); + s2 = make_child(&p2, pool); + s3 = make_child(&p3, pool); + s4 = make_child(&p4, pool); + if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || + s3 != APR_SUCCESS || s4 != APR_SUCCESS) { + printf("Failed!\n"); + return s1; + } + printf("OK\n"); + + printf("%-60s", " Waiting for processes to exit"); + s1 = apr_proc_wait(p1, NULL, NULL, APR_WAIT); + s2 = apr_proc_wait(p2, NULL, NULL, APR_WAIT); + s3 = apr_proc_wait(p3, NULL, NULL, APR_WAIT); + s4 = apr_proc_wait(p4, NULL, NULL, APR_WAIT); + printf("OK\n"); + + if ((*x) != MAX_COUNTER) { + fprintf(stderr, "Locks don't appear to work! x = %d instead of %d\n", + (*x), MAX_COUNTER); + } + else { + printf("Test passed\n"); + } + return APR_SUCCESS; +} + +int main(int argc, const char * const *argv) +{ + apr_status_t rv; + char errmsg[200]; + const char *lockname = NULL; + const char *shmname = "shm.file"; + apr_getopt_t *opt; + char optchar; + const char *optarg; + apr_shm_t *shm; + + printf("APR Proc Mutex Test\n==============\n\n"); + + apr_initialize(); + atexit(apr_terminate); + + if (apr_pool_create(&pool, NULL) != APR_SUCCESS) + exit(-1); + + if ((rv = apr_getopt_init(&opt, pool, argc, argv)) != APR_SUCCESS) { + fprintf(stderr, "Could not set up to parse options: [%d] %s\n", + rv, apr_strerror(rv, errmsg, sizeof errmsg)); + exit(-1); + } + + while ((rv = apr_getopt(opt, "f:", &optchar, &optarg)) == APR_SUCCESS) { + if (optchar == 'f') { + lockname = optarg; + } + } + + if (rv != APR_SUCCESS && rv != APR_EOF) { + fprintf(stderr, "Could not parse options: [%d] %s\n", + rv, apr_strerror(rv, errmsg, sizeof errmsg)); + exit(-1); + } + + apr_shm_create(&shm, sizeof(int), shmname, pool); + x = apr_shm_baseaddr_get(shm); + + if ((rv = test_exclusive(lockname)) != APR_SUCCESS) { + fprintf(stderr,"Exclusive Lock test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-2); + } + + return 0; +} + From d1bcb1b7721c0e7c57cc7663a3300c917f9930aa Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Mon, 18 Feb 2002 01:21:19 +0000 Subject: [PATCH 2996/7878] Change the name of the 'stat' variable so we don't shadow the libc symbol. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63002 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_cond.c | 66 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c index 0a107569a24..963f185cfc3 100644 --- a/locks/unix/thread_cond.c +++ b/locks/unix/thread_cond.c @@ -62,22 +62,22 @@ static apr_status_t thread_cond_cleanup(void *data) { apr_thread_cond_t *cond = (apr_thread_cond_t *)data; - apr_status_t stat; + apr_status_t rv; - stat = pthread_cond_destroy(cond->cond); + rv = pthread_cond_destroy(cond->cond); #ifdef PTHREAD_SETS_ERRNO - if (stat) { - stat = errno; + if (rv) { + rv = errno; } #endif - return stat; + return rv; } APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, apr_pool_t *pool) { apr_thread_cond_t *new_cond; - apr_status_t stat; + apr_status_t rv; new_cond = (apr_thread_cond_t *)apr_pcalloc(pool, sizeof(apr_thread_cond_t)); @@ -94,12 +94,12 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, return APR_ENOMEM; } - if ((stat = pthread_cond_init(new_cond->cond, NULL))) { + if ((rv = pthread_cond_init(new_cond->cond, NULL))) { #ifdef PTHREAD_SETS_ERRNO - stat = errno; + rv = errno; #endif thread_cond_cleanup(new_cond); - return stat; + return rv; } apr_pool_cleanup_register(new_cond->pool, @@ -113,22 +113,22 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex) { - apr_status_t stat; + apr_status_t rv; - stat = pthread_cond_wait(cond->cond, &mutex->mutex); + rv = pthread_cond_wait(cond->cond, &mutex->mutex); #ifdef PTHREAD_SETS_ERRNO - if (stat) { - stat = errno; + if (rv) { + rv = errno; } #endif - return stat; + return rv; } APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, apr_interval_time_t timeout) { - apr_status_t stat; + apr_status_t rv; apr_time_t then; struct timespec abstime; @@ -136,53 +136,53 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, abstime.tv_sec = then / APR_USEC_PER_SEC; abstime.tv_nsec = (then % APR_USEC_PER_SEC) * 1000; /* nanoseconds */ - stat = pthread_cond_timedwait(cond->cond, &mutex->mutex, &abstime); + rv = pthread_cond_timedwait(cond->cond, &mutex->mutex, &abstime); #ifdef PTHREAD_SETS_ERRNO - if (stat) { - stat = errno; + if (rv) { + rv = errno; } #endif - if (ETIMEDOUT == stat) { + if (ETIMEDOUT == rv) { return APR_TIMEUP; } - return stat; + return rv; } APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) { - apr_status_t stat; + apr_status_t rv; - stat = pthread_cond_signal(cond->cond); + rv = pthread_cond_signal(cond->cond); #ifdef PTHREAD_SETS_ERRNO - if (stat) { - stat = errno; + if (rv) { + rv = errno; } #endif - return stat; + return rv; } APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) { - apr_status_t stat; + apr_status_t rv; - stat = pthread_cond_broadcast(cond->cond); + rv = pthread_cond_broadcast(cond->cond); #ifdef PTHREAD_SETS_ERRNO - if (stat) { - stat = errno; + if (rv) { + rv = errno; } #endif - return stat; + return rv; } APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) { - apr_status_t stat; - if ((stat = thread_cond_cleanup(cond)) == APR_SUCCESS) { + apr_status_t rv; + if ((rv = thread_cond_cleanup(cond)) == APR_SUCCESS) { apr_pool_cleanup_kill(cond->pool, cond, thread_cond_cleanup); return APR_SUCCESS; } - return stat; + return rv; } APR_POOL_IMPLEMENT_ACCESSOR(thread_cond) From 6db0bf082b4f39a88ad37f124bcf90acf9d6fedf Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Mon, 18 Feb 2002 01:23:13 +0000 Subject: [PATCH 2997/7878] Mention the new lock API apr_global_mutex_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63003 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 0fa2c504d53..803ff6dd9ba 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Add a new lock API (apr_global_mutex_t) to provide guaranteed + cross-process AND cross-thread mutual exclusion. [Aaron Bannert] + *) Note: We are in the process of deprecating the apr_lock.h API. The new and improved lock/synchronization APIs now reside in apr_thread_mutex.h, apr_proc_mutex.h, apr_thread_rwlock.h, From c15cb96170b6594da91dd4bc835b6ab656999638 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Mon, 18 Feb 2002 01:24:21 +0000 Subject: [PATCH 2998/7878] Clarify a flag parameter for the default case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63004 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_mutex.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index cbfa5ba01e0..25af69d3995 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -87,6 +87,7 @@ typedef struct apr_thread_mutex_t apr_thread_mutex_t; * stored. * @param flags Or'ed value of: *
    + *           APR_THREAD_MUTEX_DEFAULT   normal lock behavior (non-recursive).
      *           APR_THREAD_MUTEX_NESTED    enable nested (recursive) locks.
      * 
    * @param pool the pool from which to allocate the mutex. From ae104fd8172d9bef55c14028984e649b5cd7561f Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Mon, 18 Feb 2002 01:28:13 +0000 Subject: [PATCH 2999/7878] New binary to ignore: testglobalmutex git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63005 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.cvsignore b/test/.cvsignore index 721d6d95fc7..e667a8e5657 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -58,4 +58,5 @@ testsockets testuser test.fil testprocmutex +testglobalmutex testvsn From 64ab20d73ab29b061d47cfb47524c491b469dab3 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Mon, 18 Feb 2002 01:41:10 +0000 Subject: [PATCH 3000/7878] Latest and greatest API needs to be implemented everywhere. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63006 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 5454fb4868f..dc51091cc47 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/02/17 20:51:58 $] +Last modified at [$Date: 2002/02/18 01:41:10 $] Release: @@ -36,6 +36,9 @@ RELEASE SHOWSTOPPERS: we do a major APR release, we must deprecate the old locks API, lest we support 2 lock APIs in perpetuity. + * The new apr_global_mutex_t lock type must be implemented on + all platforms. + RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * The return type of a thread function (void *) is inconsistent with From 4204a76cee9a0418c3298fbce6f0f9f5bba35138 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Mon, 18 Feb 2002 02:20:07 +0000 Subject: [PATCH 3001/7878] Make apr_global_mutex_t work on systems w/o APR_HAS_THREADS. If you don't have threads, you don't need to use cross-thread mutual exclusion, so this becomes essentially apr_proc_mutex_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63007 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/global_mutex.h | 2 ++ locks/unix/global_mutex.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/arch/unix/global_mutex.h b/include/arch/unix/global_mutex.h index e1a79bd5dfb..dfafcb1fd99 100644 --- a/include/arch/unix/global_mutex.h +++ b/include/arch/unix/global_mutex.h @@ -66,7 +66,9 @@ struct apr_global_mutex_t { apr_pool_t *pool; apr_proc_mutex_t *proc_mutex; +#if APR_HAS_THREADS apr_thread_mutex_t *thread_mutex; +#endif /* APR_HAS_THREADS */ }; #endif /* GLOBAL_MUTEX_H */ diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index fcd6d6937b6..c3b1ed3e182 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -58,18 +58,19 @@ #include "apr_proc_mutex.h" #include "apr_thread_mutex.h" - static apr_status_t global_mutex_cleanup(void *data) { apr_global_mutex_t *m = (apr_global_mutex_t *)data; apr_status_t rv; +#if APR_HAS_THREADS if (m->thread_mutex) { rv = apr_thread_mutex_destroy(m->thread_mutex); if (rv != APR_SUCCESS) { return rv; } } +#endif /* APR_HAS_THREADS */ rv = apr_proc_mutex_destroy(m->proc_mutex); if (rv != APR_SUCCESS) { return rv; @@ -93,6 +94,7 @@ APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, return rv; } +#if APR_HAS_THREADS if (m->proc_mutex->inter_meth->flags & APR_PROCESS_LOCK_MECH_IS_GLOBAL) { m->thread_mutex = NULL; /* We don't need a thread lock. */ } @@ -103,6 +105,7 @@ APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, return rv; } } +#endif /* APR_HAS_THREADS */ apr_pool_cleanup_register(m->pool, (void *)m, global_mutex_cleanup, apr_pool_cleanup_null); @@ -122,12 +125,14 @@ APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) { apr_status_t rv; +#if APR_HAS_THREADS if (mutex->thread_mutex) { rv = apr_thread_mutex_lock(mutex->thread_mutex); if (rv != APR_SUCCESS) { return rv; } } +#endif /* APR_HAS_THREADS */ rv = apr_proc_mutex_lock(mutex->proc_mutex); if (rv != APR_SUCCESS) { return rv; @@ -139,12 +144,14 @@ APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) { apr_status_t rv; +#if APR_HAS_THREADS if (mutex->thread_mutex) { rv = apr_thread_mutex_trylock(mutex->thread_mutex); if (rv != APR_SUCCESS) { return rv; } } +#endif /* APR_HAS_THREADS */ rv = apr_proc_mutex_trylock(mutex->proc_mutex); if (rv != APR_SUCCESS) { return rv; @@ -160,12 +167,14 @@ APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) if (rv != APR_SUCCESS) { return rv; } +#if APR_HAS_THREADS if (mutex->thread_mutex) { rv = apr_thread_mutex_unlock(mutex->thread_mutex); if (rv != APR_SUCCESS) { return rv; } } +#endif /* APR_HAS_THREADS */ return APR_SUCCESS; } @@ -175,4 +184,3 @@ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) } APR_POOL_IMPLEMENT_ACCESSOR(global_mutex); - From c3cbf0af1587f3e00ecc92cdab95e747f3bdfb42 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 18 Feb 2002 05:21:36 +0000 Subject: [PATCH 3002/7878] A companion patch to apr_dbg_file_handles.h so we can log them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63008 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/misc.c | 68 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/misc/win32/misc.c b/misc/win32/misc.c index fab7c7df132..a5f358bbfa3 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -54,6 +54,9 @@ #include "apr_private.h" #include "misc.h" +#include "crtdbg.h" +#include "fileio.h" +#include "assert.h" apr_oslevel_e apr_os_level = APR_WIN_UNK; @@ -180,9 +183,9 @@ apr_status_t apr_get_oslevel(apr_pool_t *cont, apr_oslevel_e *level) */ static const char* const lateDllName[DLL_defined] = { - "kernel32", "advapi32", "mswsock", "ws2_32", "shell32" }; + "kernel32", "advapi32", "mswsock", "ws2_32", "shell32", "ntdll.dll" }; static HMODULE lateDllHandle[DLL_defined] = { - NULL, NULL, NULL, NULL, NULL }; + NULL, NULL, NULL, NULL, NULL, NULL }; FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) { @@ -196,3 +199,64 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) else return GetProcAddress(lateDllHandle[fnLib], fnName); } + +/* Declared in include/arch/win32/apr_dbg_win32_handles.h + * + * apr_dbg_log is a Win32 specific helper to debug handle activity, logging + * either the HANDLE ha argument +APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, + int nh, /* HANDLE hv, char *dsc */...) +{ + static DWORD tlsid = 0xFFFFFFFF; + static HANDLE fh = NULL; + static long ctr = 0; + static CRITICAL_SECTION cs; + long seq; + DWORD wrote; + char *sbuf; + + seq = (InterlockedIncrement)(&ctr); + + if (tlsid == 0xFFFFFFFF) { + tlsid = (TlsAlloc)(); + } + + sbuf = (TlsGetValue)(tlsid); + if (!fh || !sbuf) { + sbuf = (malloc)(1024); + (TlsSetValue)(tlsid, sbuf); + sbuf[1023] = '\0'; + if (!fh) { + (GetModuleFileName)(NULL, sbuf, 250); + sprintf(strchr(sbuf, '\0'), ".%d", + (GetCurrentProcessId)()); + fh = (CreateFile)(sbuf, GENERIC_WRITE, 0, NULL, + CREATE_ALWAYS, 0, NULL); + (InitializeCriticalSection)(&cs); + } + } + + if (!nh) { + (sprintf)(sbuf, "%08x %08x %08x %s() %s:%d\n", + ha, seq, GetCurrentThreadId(), fn, fl, ln); + (EnterCriticalSection)(&cs); + (WriteFile)(fh, sbuf, strlen(sbuf), &wrote, NULL); + (LeaveCriticalSection)(&cs); + } + else { + va_list a; + va_start(a,nh); + (EnterCriticalSection)(&cs); + do { + HANDLE *hv = va_arg(a, HANDLE*); + char *dsc = va_arg(a, char*); + (sprintf)(sbuf, "%08x %08x %08x %s(%s) %s:%d\n", + *hv, seq, GetCurrentThreadId(), + fn, dsc, fl, ln); + (WriteFile)(fh, sbuf, strlen(sbuf), &wrote, NULL); + } while (--nh); + (LeaveCriticalSection)(&cs); + va_end(a); + } + return ha; +} From ec7deaa2d7ef670f37843e05247607fc1d834a04 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 18 Feb 2002 05:26:16 +0000 Subject: [PATCH 3003/7878] A new source to hide statics on Win32 that are purely internal. They may be bound to the libapr.lib but not exported, or in the static apr.lib, but they are entirely for internal consumption. This i18n fn is a helper to the startup code I'm hacking for libapr_app, the static apr_app, and for apr's forthcoming apr_app_initialize() fn. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63009 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/internal.c | 137 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 misc/win32/internal.c diff --git a/misc/win32/internal.c b/misc/win32/internal.c new file mode 100644 index 00000000000..c533f647499 --- /dev/null +++ b/misc/win32/internal.c @@ -0,0 +1,137 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_private.h" + +#include "misc.h" + + +/* This module is the source of -static- helper functions that are + * entirely internal to apr. If the fn is exported - it does not + * belong here. + * + * Namespace decoration is still required to protect us from symbol + * clashes in static linkages. + */ + + +/* Shared by apr_app.c and start.c + * + * An internal apr function to convert an array of strings (either + * a counted or NULL terminated list, such as an argv[argc] or env[] + * list respectively) from wide Unicode strings to narrow utf-8 strings. + * These are allocated from the MSVCRT's _CRT_BLOCK to trick the system + * into trusting our store. + */ +int apr_wastrtoastr(char ***retarr, const wchar_t **arr, int args) +{ + size_t elesize = 0; + char **newarr; + char *elements; + char *ele; + int arg; + + if (args < 0) { + for (args = 0; arr[args]; ++args) + ; + } + + newarr = _malloc_dbg((args + 1) * sizeof(char *), + _CRT_BLOCK, __FILE__, __LINE__); + + for (arg = 0; arg < args; ++arg) { + newarr[arg] = (void*)(wcslen(arr[arg]) + 1); + elesize += (size_t)newarr[arg]; + } + + /* This is a safe max allocation, we will realloc after + * processing and return the excess to the free store. + * 3 ucs bytes hold any single wchar_t value (16 bits) + * 4 ucs bytes will hold a wchar_t pair value (20 bits) + */ + elesize = elesize * 3 + 1; + ele = elements = _malloc_dbg(elesize * sizeof(char), + _CRT_BLOCK, __FILE__, __LINE__); + + for (arg = 0; arg < args; ++arg) { + size_t len = (size_t)newarr[arg]; + size_t newlen = elesize; + + newarr[arg] = ele; + (void)apr_conv_ucs2_to_utf8(arr[arg], &len, + newarr[arg], &elesize); + + newlen -= elesize; + ele += newlen; + assert(elesize && (len == 0)); + } + + newarr[arg] = NULL; + *(ele++) = '\0'; + + /* Return to the free store if the heap realloc is the least bit optimized + */ + ele = _realloc_dbg(elements, ele - elements, + _CRT_BLOCK, __FILE__, __LINE__); + + if (ele != elements) { + size_t diff = ele - elements; + for (arg = 0; arg < args; ++arg) { + newarr[arg] += diff; + } + } + + *retarr = newarr; + return args; +} From c9c460a2d19b55b9c6e7ccec7c22362454735f1c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 18 Feb 2002 05:31:47 +0000 Subject: [PATCH 3004/7878] Simplification - code moving to internal.c for sharing, and misc.c for cross-platform apr_app_initialize. This stub will only handle the wmain() entry point for Unicode arguments in a _native_ NT-only build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63010 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/apr_app.c | 190 ++----------------------------------------- 1 file changed, 6 insertions(+), 184 deletions(-) diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index b7edf08c148..614f1fdffcc 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -78,86 +78,22 @@ #include "fileio.h" #include "assert.h" #include "apr_private.h" - -static int wastrtoastr(char ***retarr, wchar_t **arr, int args) -{ - size_t elesize = 0; - char **newarr; - char *elements; - char *ele; - int arg; - - if (args < 0) { - for (args = 0; arr[args]; ++args) - ; - } - - newarr = _malloc_dbg((args + 1) * sizeof(char *), - _CRT_BLOCK, __FILE__, __LINE__); - - for (arg = 0; arg < args; ++arg) { - newarr[arg] = (void*)(wcslen(arr[arg]) + 1); - elesize += (size_t)newarr[arg]; - } - - /* This is a safe max allocation, we will realloc after - * processing and return the excess to the free store. - * 3 ucs bytes hold any single wchar_t value (16 bits) - * 4 ucs bytes will hold a wchar_t pair value (20 bits) - */ - elesize = elesize * 3 + 1; - ele = elements = _malloc_dbg(elesize * sizeof(char), - _CRT_BLOCK, __FILE__, __LINE__); - - for (arg = 0; arg < args; ++arg) { - size_t len = (size_t)newarr[arg]; - size_t newlen = elesize; - - newarr[arg] = ele; - (void)apr_conv_ucs2_to_utf8(arr[arg], &len, - newarr[arg], &elesize); - - newlen -= elesize; - ele += newlen; - assert(elesize && (len == 0)); - } - - newarr[arg] = NULL; - *(ele++) = '\0'; - - /* Return to the free store if the heap realloc is the least bit optimized - */ - ele = _realloc_dbg(elements, ele - elements, - _CRT_BLOCK, __FILE__, __LINE__); - - if (ele != elements) { - size_t diff = ele - elements; - for (arg = 0; arg < args; ++arg) { - newarr[arg] += diff; - } - } - - *retarr = newarr; - return args; -} - -#ifdef APR_APP +#include "misc.h" /* This symbol is _private_, although it must be exported. */ -extern int APR_DECLARE_DATA apr_app_init_complete; -extern int main(int argc, char **argv, char **env); +extern int main(int argc, const char **argv, const char **env); -int wmain(int argc, wchar_t **wargv, wchar_t **wenv) +int wmain(int argc, const wchar_t **wargv, const wchar_t **wenv) { char **argv; char **env; int dupenv; - (void)wastrtoastr(&argv, wargv, argc); + (void)apr_wastrtoastr(&argv, wargv, argc); - dupenv = wastrtoastr(&env, wenv, -1); + dupenv = apr_wastrtoastr(&env, wenv, -1); _environ = _malloc_dbg((dupenv + 1) * sizeof (char *), _CRT_BLOCK, __FILE__, __LINE__ ); @@ -173,124 +109,10 @@ int wmain(int argc, wchar_t **wargv, wchar_t **wenv) if (_wenviron) { wenv = _wenviron; _wenviron = NULL; - free(wenv); + free((wchar_t **)wenv); } apr_app_init_complete = 1; return main(argc, argv, env); } - -#else - -/* This symbol is _private_, although it must be exported. - */ -int APR_DECLARE_DATA apr_app_init_complete = 0; - -static int warrsztoastr(char ***retarr, wchar_t *arrsz, int args) -{ - apr_wchar_t *wch; - size_t totlen; - size_t newlen; - size_t wsize; - char **newarr; - int arg; - - if (args < 0) { - for (args = 1, wch = arrsz; wch[0] || wch[1]; ++wch) - if (!*wch) - ++args; - } - wsize = 1 + wch - arrsz; - - newarr = _malloc_dbg((args + 1) * sizeof(char *), - _CRT_BLOCK, __FILE__, __LINE__); - - /* This is a safe max allocation, we will realloc after - * processing and return the excess to the free store. - * 3 ucs bytes hold any single wchar_t value (16 bits) - * 4 ucs bytes will hold a wchar_t pair value (20 bits) - */ - newlen = totlen = wsize * 3 + 1; - newarr[0] = _malloc_dbg(newlen * sizeof(char), - _CRT_BLOCK, __FILE__, __LINE__); - - (void)apr_conv_ucs2_to_utf8(arrsz, &wsize, - newarr[0], &newlen); - - assert(newlen && !wsize); - /* Return to the free store if the heap realloc is the least bit optimized - */ - newarr[0] = _realloc_dbg(newarr[0], totlen - newlen, - _CRT_BLOCK, __FILE__, __LINE__); - - for (arg = 1; arg < args; ++arg) { - newarr[arg] = newarr[arg - 1] + 2; - while (*(newarr[arg]++)) { - ; - } - } - - newarr[arg] = NULL; - - *retarr = newarr; - return args; -} - -/* Reprocess the arguments to main() for a completely apr-ized application - */ - -APR_DECLARE(apr_status_t) apr_app_main(int *argc, char ***argv, char ***env) -{ -#if APR_HAS_UNICODE_FS - IF_WIN_OS_IS_UNICODE - { - apr_wchar_t **wstrs; - apr_wchar_t *sysstr; - int wstrc; - int dupenv; - - if (apr_app_init_complete) { - return APR_SUCCESS; - } - - sysstr = GetCommandLineW(); - if (sysstr) { - wstrs = CommandLineToArgvW(sysstr, &wstrc); - if (wstrs) { - *argc = wastrtoastr(argv, wstrs, wstrc); - GlobalFree(wstrs); - } - } - - sysstr = GetEnvironmentStringsW(); - dupenv = warrsztoastr(&_environ, sysstr, -1); - - if (env) { - env = _malloc_dbg((dupenv + 1) * sizeof (char *), - _CRT_BLOCK, __FILE__, __LINE__ ); - memcpy(*env, _environ, (dupenv + 1) * sizeof (char *)); - } - else { - } - - /* MSVCRT will attempt to maintain the wide environment calls - * on _putenv(), which is bogus if we've passed a non-ascii - * string to _putenv(), since they use MultiByteToWideChar - * and breaking the implicit utf-8 assumption we've built. - * - * Reset _wenviron for good measure. - */ - if (_wenviron) { - apr_wchar_t **wenv = _wenviron; - _wenviron = NULL; - free(wenv); - } - - apr_app_init_complete = 1; - } -#endif - return APR_SUCCESS; -} - -#endif From 6f1f31961eee681517d78f874937e6d81adc9a3b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 18 Feb 2002 05:35:31 +0000 Subject: [PATCH 3005/7878] Ok, unix users should be pleased, we are eliminating start.c win32 cruft from the misc/unix branch. This also relocates apr_app_initialize() from the apr_app.c win32 specific code into a 'common' module. That same stub (an effective noop) shall soon appear in other apps. The difference between apr_app_initialize and apr_initialize is this; the former addresses command arguments and is used -only- for an app. The later is still required if apr will be used by a library that is potentially consumed by a non-apr app. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63011 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/start.c | 242 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 misc/win32/start.c diff --git a/misc/win32/start.c b/misc/win32/start.c new file mode 100644 index 00000000000..05f6a887a67 --- /dev/null +++ b/misc/win32/start.c @@ -0,0 +1,242 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_private.h" +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_signal.h" + +#include "misc.h" /* for WSAHighByte / WSALowByte */ +#include "wchar.h" +#include "fileio.h" +#include "crtdbg.h" +#include "assert.h" + +/* This symbol is _private_, although it must be exported. + */ +int APR_DECLARE_DATA apr_app_init_complete = 0; + +/* Used by apr_app_initialize to reprocess the environment + * + * An internal apr function to convert a double-null terminated set + * of single-null terminated strings from wide Unicode to narrow utf-8 + * as a list of strings. These are allocated from the MSVCRT's + * _CRT_BLOCK to trick the system into trusting our store. + */ +static int warrsztoastr(char ***retarr, wchar_t *arrsz, int args) +{ + apr_wchar_t *wch; + size_t totlen; + size_t newlen; + size_t wsize; + char **newarr; + int arg; + + if (args < 0) { + for (args = 1, wch = arrsz; wch[0] || wch[1]; ++wch) + if (!*wch) + ++args; + } + wsize = 1 + wch - arrsz; + + newarr = _malloc_dbg((args + 1) * sizeof(char *), + _CRT_BLOCK, __FILE__, __LINE__); + + /* This is a safe max allocation, we will realloc after + * processing and return the excess to the free store. + * 3 ucs bytes hold any single wchar_t value (16 bits) + * 4 ucs bytes will hold a wchar_t pair value (20 bits) + */ + newlen = totlen = wsize * 3 + 1; + newarr[0] = _malloc_dbg(newlen * sizeof(char), + _CRT_BLOCK, __FILE__, __LINE__); + + (void)apr_conv_ucs2_to_utf8(arrsz, &wsize, + newarr[0], &newlen); + + assert(newlen && !wsize); + /* Return to the free store if the heap realloc is the least bit optimized + */ + newarr[0] = _realloc_dbg(newarr[0], totlen - newlen, + _CRT_BLOCK, __FILE__, __LINE__); + + for (arg = 1; arg < args; ++arg) { + newarr[arg] = newarr[arg - 1] + 2; + while (*(newarr[arg]++)) { + /* continue */; + } + } + + newarr[arg] = NULL; + + *retarr = newarr; + return args; +} + +/* Reprocess the arguments to main() for a completely apr-ized application + */ + +APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***env) +{ +#if APR_HAS_UNICODE_FS + IF_WIN_OS_IS_UNICODE + { + apr_wchar_t **wstrs; + apr_wchar_t *sysstr; + int wstrc; + int dupenv; + + if (apr_app_init_complete) { + return apr_initialize(); + } + + sysstr = GetCommandLineW(); + if (sysstr) { + wstrs = CommandLineToArgvW(sysstr, &wstrc); + if (wstrs) { + *argc = apr_wastrtoastr(argv, wstrs, wstrc); + GlobalFree(wstrs); + } + } + + sysstr = GetEnvironmentStringsW(); + dupenv = warrsztoastr(&_environ, sysstr, -1); + + if (env) { + env = _malloc_dbg((dupenv + 1) * sizeof (char *), + _CRT_BLOCK, __FILE__, __LINE__ ); + memcpy(*env, _environ, (dupenv + 1) * sizeof (char *)); + } + else { + } + + /* MSVCRT will attempt to maintain the wide environment calls + * on _putenv(), which is bogus if we've passed a non-ascii + * string to _putenv(), since they use MultiByteToWideChar + * and breaking the implicit utf-8 assumption we've built. + * + * Reset _wenviron for good measure. + */ + if (_wenviron) { + apr_wchar_t **wenv = _wenviron; + _wenviron = NULL; + free(wenv); + } + + apr_app_init_complete = 1; + } +#endif + return apr_initialize(); +} + +static int initialized = 0; + +APR_DECLARE(apr_status_t) apr_initialize(void) +{ + apr_pool_t *pool; + apr_status_t status; + int iVersionRequested; + WSADATA wsaData; + int err; + apr_oslevel_e osver; + + if (initialized++) { + return APR_SUCCESS; + } + + if ((status = apr_pool_initialize()) != APR_SUCCESS) + return status; + + if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { + return APR_ENOPOOL; + } + + apr_pool_tag(pool, "apr_initilialize"); + + /* Initialize apr_os_level global */ + if (apr_get_oslevel(pool, &osver) != APR_SUCCESS) { + return APR_EEXIST; + } + + iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); + err = WSAStartup((WORD) iVersionRequested, &wsaData); + if (err) { + return err; + } + if (LOBYTE(wsaData.wVersion) != WSAHighByte || + HIBYTE(wsaData.wVersion) != WSALowByte) { + WSACleanup(); + return APR_EEXIST; + } + + apr_signal_init(pool); + + return APR_SUCCESS; +} + +APR_DECLARE_NONSTD(void) apr_terminate(void) +{ + initialized--; + if (initialized) { + return; + } + apr_pool_terminate(); + + WSACleanup(); +} + +APR_DECLARE(void) apr_terminate2(void) +{ + apr_terminate(); +} From cdb9aba9fdbb78f621c91088de82abfc303111e9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 18 Feb 2002 05:38:32 +0000 Subject: [PATCH 3006/7878] Changed apr_app_main to apr_app_initialize git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63012 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/start.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/misc/netware/start.c b/misc/netware/start.c index dc8c627dec7..dfef0740389 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -63,16 +63,14 @@ #include "internal_time.h" -APR_DECLARE(apr_status_t) apr_app_main(int *argc, char ***argv, char ***env) +APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***env) { /* An absolute noop. At present, only Win32 requires this stub, but it's * required in order to move command arguments passed through the service * control manager into the process, and it's required to fix the char* - * data passed in from local/wide codepage into utf-8, our internal fmt. - * - * Win32 declares it's implementation in misc/win32/apr_app.c + * data passed in from win32 unicode into utf-8, win32's apr internal fmt. */ - return APR_SUCCESS; + return apr_initialize(); } APR_DECLARE(apr_status_t) apr_initialize(void) From 67a37ac5acf01840785f1ef574c5edae593105b0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 18 Feb 2002 05:39:07 +0000 Subject: [PATCH 3007/7878] Changed apr_app_main to apr_app_initialize, but better yet - dropped all the illegible multiple-path fooness. See misc/win32/start.c for the same with lots of extra decoration. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63013 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 44 ++++---------------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/misc/unix/start.c b/misc/unix/start.c index 91271dbdd2e..f31eb917fc9 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -57,25 +57,20 @@ #include "apr_pools.h" #include "apr_signal.h" -#include "misc.h" /* for WSAHighByte / WSALowByte */ #include "locks.h" /* for apr_unix_setup_lock() */ #include "proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ #include "internal_time.h" -#ifndef WIN32 -APR_DECLARE(apr_status_t) apr_app_main(int *argc, char ***argv, char ***env) +APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***env) { /* An absolute noop. At present, only Win32 requires this stub, but it's * required in order to move command arguments passed through the service * control manager into the process, and it's required to fix the char* - * data passed in from local/wide codepage into utf-8, our internal fmt. - * - * Win32 declares it's implementation in misc/win32/apr_app.c + * data passed in from win32 unicode into utf-8, win32's apr internal fmt. */ - return APR_SUCCESS; + return apr_initialize(); } -#endif static int initialized = 0; @@ -83,20 +78,12 @@ APR_DECLARE(apr_status_t) apr_initialize(void) { apr_pool_t *pool; apr_status_t status; -#if defined WIN32 - int iVersionRequested; - WSADATA wsaData; - int err; -#endif -#if defined WIN32 - apr_oslevel_e osver; -#endif if (initialized++) { return APR_SUCCESS; } -#if !defined(BEOS) && !defined(OS2) && !defined(WIN32) +#if !defined(BEOS) && !defined(OS2) apr_unix_setup_lock(); apr_proc_mutex_unix_setup_lock(); apr_unix_setup_time(); @@ -111,26 +98,6 @@ APR_DECLARE(apr_status_t) apr_initialize(void) apr_pool_tag(pool, "apr_initilialize"); -#ifdef WIN32 - /* Initialize apr_os_level global */ - if (apr_get_oslevel(pool, &osver) != APR_SUCCESS) { - return APR_EEXIST; - } -#endif - -#if defined(WIN32) - iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); - err = WSAStartup((WORD) iVersionRequested, &wsaData); - if (err) { - return err; - } - if (LOBYTE(wsaData.wVersion) != WSAHighByte || - HIBYTE(wsaData.wVersion) != WSALowByte) { - WSACleanup(); - return APR_EEXIST; - } -#endif - apr_signal_init(pool); return APR_SUCCESS; @@ -144,9 +111,6 @@ APR_DECLARE_NONSTD(void) apr_terminate(void) } apr_pool_terminate(); -#if defined(WIN32) - WSACleanup(); -#endif } APR_DECLARE(void) apr_terminate2(void) From 86266d4d04f72b79709cdc835c44d8b3a55b370c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 18 Feb 2002 05:44:23 +0000 Subject: [PATCH 3008/7878] Realign internal.c as the required apr_app static fn's, and removed common code from apr_app into misc.c and internal.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63014 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 10 +++++----- build/libapr_app.dsp | 2 +- libapr.dsp | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apr.dsp b/apr.dsp index 658f01de668..83148fa9229 100644 --- a/apr.dsp +++ b/apr.dsp @@ -202,10 +202,6 @@ SOURCE=.\memory\unix\apr_pools.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\misc\win32\apr_app.c -# End Source File -# Begin Source File - SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File @@ -218,6 +214,10 @@ SOURCE=.\misc\win32\getuuid.c # End Source File # Begin Source File +SOURCE=.\misc\win32\internal.c +# End Source File +# Begin Source File + SOURCE=.\misc\win32\misc.c # End Source File # Begin Source File @@ -230,7 +230,7 @@ SOURCE=.\misc\win32\rand.c # End Source File # Begin Source File -SOURCE=.\misc\unix\start.c +SOURCE=.\misc\win32\start.c # End Source File # Begin Source File diff --git a/build/libapr_app.dsp b/build/libapr_app.dsp index e60b5854058..25fb253edd4 100644 --- a/build/libapr_app.dsp +++ b/build/libapr_app.dsp @@ -87,7 +87,7 @@ SOURCE=..\misc\win32\apr_app.c # End Source File # Begin Source File -SOURCE=..\misc\win32\misc.c +SOURCE=..\misc\win32\internal.c # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index 776acf08420..fc9b386d53d 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -208,10 +208,6 @@ SOURCE=.\memory\unix\apr_pools.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\misc\win32\apr_app.c -# End Source File -# Begin Source File - SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File @@ -224,6 +220,10 @@ SOURCE=.\misc\win32\getuuid.c # End Source File # Begin Source File +SOURCE=.\misc\win32\internal.c +# End Source File +# Begin Source File + SOURCE=.\misc\win32\misc.c # End Source File # Begin Source File @@ -236,7 +236,7 @@ SOURCE=.\misc\win32\rand.c # End Source File # Begin Source File -SOURCE=.\misc\unix\start.c +SOURCE=.\misc\win32\start.c # End Source File # Begin Source File From 382fe1b99cd11df20bc59d4b0efd19cfda3d666b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 18 Feb 2002 05:45:45 +0000 Subject: [PATCH 3009/7878] How this escaped c++ namespace prot is beyond me. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63015 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/apr.hw b/include/apr.hw index dc18178aafa..82f3d20f48e 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -75,6 +75,10 @@ #pragma warning(push, 3) #endif +#ifdef __cplusplus +extern "C" { +#endif + /* disable or reduce the frequency of... * C4057: indirection to slightly different base types * C4075: slight indirection changes (unsigned short* vs short[]) @@ -426,6 +430,10 @@ struct iovec { #define APR_PATH_MAX MAX_PATH #endif +#ifdef __cplusplus +} +#endif + /* Done with badly written headers */ #if defined(_MSC_VER) && _MSC_VER >= 1200 @@ -433,5 +441,6 @@ struct iovec { #endif #endif /* APR_H */ + #endif /* WIN32 */ /** @} */ From 44ebb11c07dd89521cc87e38fbcba6de5528c952 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 18 Feb 2002 05:50:06 +0000 Subject: [PATCH 3010/7878] This code _is_ win32, less decoration required. Add the new apr_app and start.c declarations (internal) and fix up some good bits of NtApi that will come in handy for lowering [conditionally] the timer resolution to single ms granularity [benchmarking apps, especially], and resolving the names of Win32 object handles. Because they are late-bound, dynamic load fns, we don't have terrible problems with NT version discrepancies nor Win9x conflicts [returns simply NULL on those platforms.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63016 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/misc.h | 60 +++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 5 deletions(-) diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index a9a00271b36..f5ccdfc1ed0 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -93,12 +93,18 @@ struct apr_other_child_rec_t { apr_os_file_t write_fd; }; -#if defined(WIN32) || defined(NETWARE) #define WSAHighByte 2 #define WSALowByte 0 -#endif -#ifdef WIN32 +/* start.c and apr_app.c helpers and communication within misc.c + * + * They are not for public consumption, although apr_app_init_complete + * must be an exported symbol to avoid reinitialization. + */ +extern int APR_DECLARE_DATA apr_app_init_complete; + +int apr_wastrtoastr(char ***retarr, const wchar_t **arr, int args); + /* Platform specific designation of run time os version. * Gaps allow for specific service pack levels that * export new kernel or winsock functions or behavior. @@ -172,7 +178,8 @@ typedef enum { DLL_WINSOCKAPI = 2, // mswsock From WinSock.h DLL_WINSOCK2API = 3, // ws2_32 From WinSock2.h DLL_SHSTDAPI = 4, // shell32 From ShellAPI.h - DLL_defined = 5 // must define as last idx_ + 1 + DLL_NTDLL = 5, // shell32 From our real kernel + DLL_defined = 6 // must define as last idx_ + 1 } apr_dlltoken_e; FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); @@ -302,7 +309,50 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_SHSTDAPI, LPWSTR *, WINAPI, CommandLineToArgvW, 0, #endif /* !defined(_WIN32_WCE) && !defined(WINNT) */ -#endif /* WIN32 */ +#if !defined(_WIN32_WCE) + +APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryTimerResolution, 0, ( + ULONG *pMaxRes, /* Minimum NS Resolution */ + ULONG *pMinRes, /* Maximum NS Resolution */ + ULONG *pCurRes), /* Current NS Resolution */ + (pMaxRes, pMinRes, pCurRes)); +#define QueryTimerResolution apr_winapi_NtQueryTimerResolution + +APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtSetTimerResolution, 0, ( + ULONG ReqRes, /* Requested NS Clock Resolution */ + BOOL Acquire, /* Aquire (1) or Release (0) our interest */ + ULONG *pNewRes), /* The NS Clock Resolution granted */ + (ReqRes, Acquire, pNewRes)); +#define SetTimerResolution apr_winapi_NtSetTimerResolution + +typedef struct PBI { + DWORD ExitStatus; + PVOID PebBaseAddress; + ULONG_PTR AffinityMask; + LONG BasePriority; + ULONG_PTR UniqueProcessId; + ULONG_PTR InheritedFromUniqueProcessId; +} PBI, *PPBI; + +APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryInformationProcess, 0, ( + HANDLE hProcess, /* Obvious */ + INT info, /* Use 0 for PBI documented above */ + PVOID pPI, /* The PIB buffer */ + ULONG LenPI, /* Use sizeof(PBI) */ + ULONG *pSizePI), /* returns pPI buffer used (may pass NULL) */ + (hProcess, info, pPI, LenPI, pSizePI)); +#define QueryInformationProcess apr_winapi_NtQueryInformationProcess + +APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryObject, 0, ( + HANDLE hObject, /* Obvious */ + INT info, /* Use 0 for PBI documented above */ + PVOID pOI, /* The PIB buffer */ + ULONG LenOI, /* Use sizeof(PBI) */ + ULONG *pSizeOI), /* returns pPI buffer used (may pass NULL) */ + (hObject, info, pOI, LenOI, pSizeOI)); +#define QueryObject apr_winapi_NtQueryObject + +#endif /* !defined(_WIN32_WCE) */ #endif /* ! MISC_H */ From fbdd3dd53ec7036b02821d9fe66ab93c8d8af597 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 18 Feb 2002 06:00:23 +0000 Subject: [PATCH 3011/7878] Needed to test-build, here's my test-build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63017 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.dsw | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/test/aprtest.dsw b/test/aprtest.dsw index a4e26943f3b..e9e79dde08c 100644 --- a/test/aprtest.dsw +++ b/test/aprtest.dsw @@ -15,6 +15,48 @@ Package=<4> ############################################################################### +Project: "apr_app"="..\build\apr_app.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name apr + End Project Dependency +}}} + +############################################################################### + +Project: "libapr"="..\libapr.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "libapr_app"="..\build\libapr_app.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libapr + End Project Dependency +}}} + +############################################################################### + Project: "aprtest"=".\aprtest.dsp" - Package Owner=<4> Package=<5> From 473ce15a672f7baf7f64418a3445c21e16dca5f1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 18 Feb 2002 06:01:27 +0000 Subject: [PATCH 3012/7878] My typos - all builds once again git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63018 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/internal.c | 4 +++- misc/win32/misc.c | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/misc/win32/internal.c b/misc/win32/internal.c index c533f647499..d2b9753b54b 100644 --- a/misc/win32/internal.c +++ b/misc/win32/internal.c @@ -55,7 +55,9 @@ #include "apr_private.h" #include "misc.h" - +#include "fileio.h" +#include +#include /* This module is the source of -static- helper functions that are * entirely internal to apr. If the fn is exported - it does not diff --git a/misc/win32/misc.c b/misc/win32/misc.c index a5f358bbfa3..cb0ad85c12c 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -201,9 +201,7 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) } /* Declared in include/arch/win32/apr_dbg_win32_handles.h - * - * apr_dbg_log is a Win32 specific helper to debug handle activity, logging - * either the HANDLE ha argument + */ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, int nh, /* HANDLE hv, char *dsc */...) { From 8da1879f86783bdcc421dd92287ecf37b103b5e9 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 18 Feb 2002 06:08:53 +0000 Subject: [PATCH 3013/7878] Replace FD_SETSIZE with the bare minimum we need to call select() with which is file->filedes + 1. PR: 9674 Submitted by: David MacKenzie Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63019 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/unix/readwrite.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 803ff6dd9ba..bf661084bf8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix select() argument call when waiting for IO. PR 9674. + [David MacKenzie ] + *) Add a new lock API (apr_global_mutex_t) to provide guaranteed cross-process AND cross-thread mutual exclusion. [Aaron Bannert] diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 7474f682fe7..1b08189a2e7 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -82,7 +82,7 @@ static apr_status_t wait_for_io_or_timeout(apr_file_t *file, int for_read) else { tvptr = NULL; } - srv = select(FD_SETSIZE, + srv = select(file->filedes + 1, for_read ? &fdset : NULL, for_read ? NULL : &fdset, NULL, From cf3e7b83dbcc94e344c364bd9af9a33df1ccb76b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 18 Feb 2002 06:12:09 +0000 Subject: [PATCH 3014/7878] Drop the idea of a two-pass init, apr_app_initialize can handle it all. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63020 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index 6d3664640fa..8849ec27c88 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -172,11 +172,25 @@ void *memchr(const void *s, int c, size_t n); /** * Setup any APR internal data structures. This MUST be the first function - * called for any APR program. + * called for any APR library. * @deffunc apr_status_t apr_initialize(void) + * @remark See apr_app_initialize if this is an application, rather than + * a library consumer of apr. */ APR_DECLARE(apr_status_t) apr_initialize(void); +/** + * Set up an application with normalized argc, argv (and optionally env) in + * order to deal with platform-specific oddities, such as Win32 services, + * code pages and signals. This must be the first function called for any + * APR program. + * @deffunc apr_status_t apr_app_initialize(int *argc, char ***argv, char ***env) + * @remark See apr_initialize if this is a library consumer of apr. + * Otherwise, this call is identical to apr_initialize, and must be closed + * with a call to apr_terminate at the end of program execution. + */ +APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***env); + /** * Tear down any APR internal data structures which aren't torn down * automatically. @@ -185,6 +199,8 @@ APR_DECLARE(apr_status_t) apr_initialize(void); * atexit to ensure this is called. When using APR from a language * other than C that has problems with the calling convention, use * apr_terminate2() instead. + * Otherwise, this call is identical to apr_app_initialize, and must be + * closed with a call to apr_terminate at the end of program execution. */ APR_DECLARE_NONSTD(void) apr_terminate(void); @@ -199,16 +215,6 @@ APR_DECLARE_NONSTD(void) apr_terminate(void); */ APR_DECLARE(void) apr_terminate2(void); -/** - * Set up an application with normalized argc, argv (and optionally env) in - * order to deal with platform-specific oddities, such as Win32 services, - * code pages and signals. - * @remark An APR program should invoke apr_app_main immediately following - * apr_initialize, so it behaves properly as a service on Win32 with respect - * to its Unicode (utf-8) code page, services and signals. - */ -APR_DECLARE(apr_status_t) apr_app_main(int *argc, char ***argv, char ***env); - /** @} */ /** From 1e508a106dc7755e718581f0cdcb7f52d44efc13 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 18 Feb 2002 06:23:40 +0000 Subject: [PATCH 3015/7878] basic test for non-threaded machines git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63021 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index d10adabc8f4..4d4c98d427d 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -68,12 +68,35 @@ #ifndef WIN32 #include #endif -#if !APR_HAS_THREADS + +apr_pool_t *context; +apr_atomic_t y; /* atomic locks */ +#if !APR_HAS_HREADS int main(void) { + apr_status_t rv; fprintf(stderr, "This program won't work on this platform because there is no " "support for threads.\n"); + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { + fflush(stdout); + fprintf(stderr, "Failed.\nCould not initialize\n"); + exit(-1); + } + rv = apr_atomic_init(context); + if (rv != APR_SUCCESS) { + fprintf(stderr, "Failed.\nCould not initialize atomics\n"); + } + apr_atomic_set(&y,0); + apr_atomic_add(&y,20); + apr_atomic_inc(&y); + if (apr_atomic_read(&y) != 21) { + fprintf(stderr, "Failed.\natomics do not add up\n"); + } + else { + fprintf(stdout, "no threads .. OK\n"); + } + return 0; } #else /* !APR_HAS_THREADS */ @@ -83,10 +106,8 @@ void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data); apr_lock_t *thread_lock; -apr_pool_t *context; apr_thread_once_t *control = NULL; volatile long x = 0; /* mutex locks */ -apr_atomic_t y; /* atomic locks */ volatile long z = 0; /* no locks */ int value = 0; apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ From c24eb8f9dfe5f9d9923bd06f1e42b1d1f831435f Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 18 Feb 2002 06:24:13 +0000 Subject: [PATCH 3016/7878] use FreeBSD (4+) atomic functions instead of generic ones git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63022 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 76bf36c7af6..4c76380db90 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -87,6 +87,18 @@ extern "C" { #define apr_atomic_read(mem) atomic_read(mem) #define apr_atomic_init(pool) APR_SUCCESS +#elif defined(__FreeBSD__) && (__FreeBSD__ >= 4) +#include + +#define apr_atomic_t apr_uint32_t +#define apr_atomic_add(mem, val) atomic_add_int(mem,val) +#define apr_atomic_dec(mem) atomic_subtract_int(mem,1) +#define apr_atomic_inc(mem) atomic_add_int(mem,1) +#define apr_atomic_set(mem, val) atomic_set_int(mem, val) +#define apr_atomic_read(mem) *mem +#define apr_atomic_init(pool) APR_SUCCESS + + #elif defined(__sparc__not_ready_yet) #define apr_atomic_t apr_uint32_t #define apr_atomic_read(p) *p From 9f9ff9353f1deec22b1f2fb3bb0a869cbdd9269f Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 18 Feb 2002 06:25:59 +0000 Subject: [PATCH 3017/7878] update to reflect sparc/linux/freebsd versions up& running git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63023 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index dc51091cc47..b802124a300 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/02/18 01:41:10 $] +Last modified at [$Date: 2002/02/18 06:25:59 $] Release: @@ -51,7 +51,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: +1: BrianH, Aaron * Need some architecture/OS specific versions of the atomic operations. - Ian Volunteers for the x86 & sparc versions + progress: generic, solaris Sparc, FreeBSD4, and linux done + need: AIX, AS400, HPUX, OS/390 * The new lock API is a full replacement for the old API, but is not yet complete on all platforms. Components that are incomplete From 7462318cef2c6849dc6dc51f53a55abb5c526d5d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 18 Feb 2002 13:06:43 +0000 Subject: [PATCH 3018/7878] get rid of a stray ';' after APR_IMPLEMENT_POOL_ACCESSOR() AIX xlc really got upset, though I didn't unravel the macro to see what the fuss was about > "global_mutex.c", line 177.42: 1506-137 (E) Declaration > must declare at least one declarator, tag, or the members > of an enumeration. I changed the other new invocations to match the normal pattern. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63024 13f79535-47bb-0310-9956-ffa450edef68 --- locks/beos/global_mutex.c | 2 +- locks/netware/global_mutex.c | 2 +- locks/os2/global_mutex.c | 2 +- locks/unix/global_mutex.c | 2 +- locks/win32/global_mutex.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/locks/beos/global_mutex.c b/locks/beos/global_mutex.c index 879d2b28994..24f73b1c230 100644 --- a/locks/beos/global_mutex.c +++ b/locks/beos/global_mutex.c @@ -91,5 +91,5 @@ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) return APR_ENOTIMPL; } -APR_POOL_IMPLEMENT_ACCESSOR(global_mutex); +APR_POOL_IMPLEMENT_ACCESSOR(global_mutex) diff --git a/locks/netware/global_mutex.c b/locks/netware/global_mutex.c index 879d2b28994..24f73b1c230 100644 --- a/locks/netware/global_mutex.c +++ b/locks/netware/global_mutex.c @@ -91,5 +91,5 @@ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) return APR_ENOTIMPL; } -APR_POOL_IMPLEMENT_ACCESSOR(global_mutex); +APR_POOL_IMPLEMENT_ACCESSOR(global_mutex) diff --git a/locks/os2/global_mutex.c b/locks/os2/global_mutex.c index 879d2b28994..24f73b1c230 100644 --- a/locks/os2/global_mutex.c +++ b/locks/os2/global_mutex.c @@ -91,5 +91,5 @@ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) return APR_ENOTIMPL; } -APR_POOL_IMPLEMENT_ACCESSOR(global_mutex); +APR_POOL_IMPLEMENT_ACCESSOR(global_mutex) diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index c3b1ed3e182..733d08db0b6 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -183,4 +183,4 @@ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) return apr_pool_cleanup_run(mutex->pool, mutex, global_mutex_cleanup); } -APR_POOL_IMPLEMENT_ACCESSOR(global_mutex); +APR_POOL_IMPLEMENT_ACCESSOR(global_mutex) diff --git a/locks/win32/global_mutex.c b/locks/win32/global_mutex.c index 879d2b28994..24f73b1c230 100644 --- a/locks/win32/global_mutex.c +++ b/locks/win32/global_mutex.c @@ -91,5 +91,5 @@ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) return APR_ENOTIMPL; } -APR_POOL_IMPLEMENT_ACCESSOR(global_mutex); +APR_POOL_IMPLEMENT_ACCESSOR(global_mutex) From 7d613186c5074a6240f4c85e37a5e7d5531ef300 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Mon, 18 Feb 2002 17:36:55 +0000 Subject: [PATCH 3019/7878] move all setting of CC to the APR_CC_HINTS mechanism. Suggested by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63025 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 7d2dffd80d6..3c1601d8c47 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -37,7 +37,6 @@ if test "x$apr_preload_done" != "xyes" ; then APR_ADDTO(LDFLAGS, [-Xlinker \"-WL,cap=ia,ba,ph;nmstack=1024000\"]) ;; *-apple-aux3*) - APR_SETVAR(CC, [gcc]) APR_ADDTO(CPPFLAGS, [-DAUX3 -D_POSIX_SOURCE]) APR_ADDTO(LIBS, [-lposix -lbsd]) APR_ADDTO(LDFLAGS, [-s]) @@ -143,7 +142,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DNEXT]) ;; *-next-openstep*) - APR_SETVAR(CC, [cc]) APR_SETIFNULL(CFLAGS, [-O]) APR_ADDTO(CPPFLAGS, [-DNEXT]) ;; @@ -163,13 +161,11 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(LIBS, [-N128k -lunix]) ;; *-qnx32) - APR_SETVAR(CC, [cc -F]) APR_ADDTO(CPPFLAGS, [-DQNX]) APR_ADDTO(CFLAGS, [-mf -3]) APR_ADDTO(LIBS, [-N128k -lunix]) ;; *-isc4*) - APR_SETVAR(CC, [gcc]) APR_ADDTO(CPPFLAGS, [-posix -DISC]) APR_ADDTO(LDFLAGS, [-posix]) APR_ADDTO(LIBS, [-linet]) @@ -223,11 +219,9 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(LIBS, [-lgen]) ;; TPF) - APR_SETVAR(CC, [c89]) APR_ADDTO(CPPFLAGS, [-DTPF -D_POSIX_SOURCE]) ;; BS2000*-siemens-sysv4*) - APR_SETVAR(CC, [c89 -XLLML -XLLMK -XL -Kno_integer_overflow]) APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV]) ;; *-siemens-sysv4*) @@ -282,7 +276,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DCONVEXOS11]) APR_SETIFNULL(CFLAGS, [-O1]) APR_ADDTO(CFLAGS, [-ext]) - APR_SETVAR(CC, [cc]) ;; i860-intel-osf1) APR_ADDTO(CPPFLAGS, [-DPARAGON]) @@ -354,11 +347,9 @@ dnl # Not a problem in 10.20. Otherwise, who knows? m88k-*-CX/SX|CYBER) APR_ADDTO(CPPFLAGS, [-D_CX_SX]) APR_ADDTO(CFLAGS, [-Xa]) - APR_SETVAR(CC, [cc]) ;; *-tandem-oss) APR_ADDTO(CPPFLAGS, [-D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED=1]) - APR_SETVAR(CC, [c89]) ;; *-ibm-os390) APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE]) @@ -389,11 +380,38 @@ dnl Allows us to provide a default choice of compiler which dnl the user can override. AC_DEFUN(APR_CC_HINTS, [ case "$host" in + *-apple-aux3*) + APR_SETIFNULL(CC, [gcc]) + ;; + BS2000*-siemens-sysv4*) + APR_SETIFNULL(CC, [c89 -XLLML -XLLMK -XL -Kno_integer_overflow]) + ;; + *convex-v11*) + APR_SETIFNULL(CC, [cc]) + ;; *-ibm-os390) APR_SETIFNULL(CC, [cc]) ;; *-ibm-as400) APR_SETIFNULL(CC, [icc]) ;; + *-isc4*) + APR_SETIFNULL(CC, [gcc]) + ;; + m88k-*-CX/SX|CYBER) + APR_SETIFNULL(CC, [cc]) + ;; + *-next-openstep*) + APR_SETIFNULL(CC, [cc]) + ;; + *-qnx32) + APR_SETIFNULL(CC, [cc -F]) + ;; + *-tandem-oss) + APR_SETIFNULL(CC, [c89]) + ;; + TPF) + APR_SETIFNULL(CC, [c89]) + ;; esac ]) From b422f73ec8e8fec154245ef485806b0e2ac4fcd0 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 19 Feb 2002 20:51:34 +0000 Subject: [PATCH 3020/7878] Implement apr_global_mutex_foo() on Windows. This is basically identical to apr_proc_lock as a Windows MUTEX locks threads as well as processes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63026 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ apr.dsp | 8 ++++++++ libapr.dsp | 8 ++++++++ locks/win32/global_mutex.c | 21 ++++++++++++++------- 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index bf661084bf8..357c4b7f90c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ Changes with APR b1 + *) Implement apr_global_lock_foo() on Win32 + [Bill Stoddard] *) Fix select() argument call when waiting for IO. PR 9674. [David MacKenzie ] diff --git a/apr.dsp b/apr.dsp index 83148fa9229..af7a1b242ed 100644 --- a/apr.dsp +++ b/apr.dsp @@ -170,6 +170,10 @@ SOURCE=.\i18n\unix\xlate.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\locks\win32\global_mutex.c +# End Source File +# Begin Source File + SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File @@ -518,6 +522,10 @@ SOURCE=.\include\apr_getopt.h # End Source File # Begin Source File +SOURCE=.\include\apr_global_mutex.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_hash.h # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index fc9b386d53d..8827878e98e 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -176,6 +176,10 @@ SOURCE=.\i18n\unix\xlate.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\locks\win32\global_mutex.c +# End Source File +# Begin Source File + SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File @@ -524,6 +528,10 @@ SOURCE=.\include\apr_getopt.h # End Source File # Begin Source File +SOURCE=.\include\apr_global_mutex.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_hash.h # End Source File # Begin Source File diff --git a/locks/win32/global_mutex.c b/locks/win32/global_mutex.c index 24f73b1c230..95e6e461cec 100644 --- a/locks/win32/global_mutex.c +++ b/locks/win32/global_mutex.c @@ -53,14 +53,17 @@ */ #include "apr.h" +#include "apr_lock.h" #include "apr_strings.h" +#include "apr_global_mutex.h" +#include "proc_mutex.h" APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, const char *fname, apr_lockmech_e mech, apr_pool_t *pool) { - return APR_ENOTIMPL; + return apr_proc_mutex_create((apr_proc_mutex_t **) mutex, fname, mech, pool); } APR_DECLARE(apr_status_t) apr_global_mutex_child_init( @@ -68,28 +71,32 @@ APR_DECLARE(apr_status_t) apr_global_mutex_child_init( const char *fname, apr_pool_t *pool) { - return APR_ENOTIMPL; + return apr_proc_mutex_child_init((apr_proc_mutex_t**) mutex, fname, pool); } APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) { - return APR_ENOTIMPL; + return apr_proc_mutex_lock((apr_proc_mutex_t*) mutex); } APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) { - return APR_ENOTIMPL; + return apr_proc_mutex_trylock((apr_proc_mutex_t* )mutex); } APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) { - return APR_ENOTIMPL; + return apr_proc_mutex_unlock((apr_proc_mutex_t*) mutex); } APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) { - return APR_ENOTIMPL; + return apr_proc_mutex_destroy((apr_proc_mutex_t*) mutex); +} + +APR_DECLARE(apr_pool_t*) apr_global_mutex_pool_get(const apr_global_mutex_t *mutex) +{ + return apr_proc_mutex_pool_get((apr_proc_mutex_t*) mutex); } -APR_POOL_IMPLEMENT_ACCESSOR(global_mutex) From 30b29003ec2a2d6665dedacff2f18395138165e6 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Tue, 19 Feb 2002 23:15:40 +0000 Subject: [PATCH 3021/7878] re-introduce the CAS apr call. doxygenize the header testing is now harder PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63027 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 34 ++++++------- include/apr_atomic.h | 94 +++++++++++++++++++++++++++++++++-- test/testatomic.c | 104 +++++++++++++++++++++++++++++++-------- 3 files changed, 190 insertions(+), 42 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 3f6be50e10a..2cae91b93ba 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -58,10 +58,10 @@ #include "apr_thread_mutex.h" #include "apr_atomic.h" -#if defined(APR_ATOMIC_NEED_DEFAULT) - #if APR_HAS_THREADS +#if defined(APR_ATOMIC_NEED_DEFAULT) + #define NUM_ATOMIC_HASH 7 /* shift by 2 to get rid of alignment issues */ #define ATOMIC_HASH(x) (int)(((long)x>>2)%NUM_ATOMIC_HASH) @@ -79,10 +79,10 @@ apr_status_t apr_atomic_init(apr_pool_t *p ) } return APR_SUCCESS; } -apr_uint32_t apr_atomic_add(volatile apr_atomic_t *mem, long val) +apr_uint32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - long prev; + apr_uint32_t prev; if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { prev = *mem; @@ -90,12 +90,13 @@ apr_uint32_t apr_atomic_add(volatile apr_atomic_t *mem, long val) apr_thread_mutex_unlock(lock); return prev; } + printf("debug no workee\n"); return *mem; } -apr_uint32_t apr_atomic_set(volatile apr_atomic_t *mem, long val) +apr_uint32_t apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - long prev; + apr_uint32_t prev; if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { prev = *mem; @@ -109,7 +110,7 @@ apr_uint32_t apr_atomic_set(volatile apr_atomic_t *mem, long val) apr_uint32_t apr_atomic_inc( volatile apr_uint32_t *mem) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - long prev; + apr_uint32_t prev; if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { prev = *mem; @@ -122,7 +123,7 @@ apr_uint32_t apr_atomic_inc( volatile apr_uint32_t *mem) apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - long prev; + apr_uint32_t prev; if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { prev = *mem; @@ -132,15 +133,13 @@ apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem) } return *mem; } -#if 0 -/* - * linux doesn't have a easy to do this - * so comment it out for the moment - */ -apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem,apr_uint32_t with, apr_uint32_t cmp) + +#if defined(APR_ATOMIC_NEED_CAS_DEFAULT) + +long apr_atomic_cas(volatile apr_atomic_t *mem,long with, long cmp) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - long prev; + apr_uint32_t prev; if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { prev = *mem; @@ -152,7 +151,8 @@ apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem,apr_uint32_t with, apr_ui } return *mem; } -#endif -#endif /* APR_HAS_THREADS */ +#endif /* APR_ATOMIC_NEED_CAS_DEFAULT */ #endif /* APR_ATOMIC_NEED_DEFAULT */ + +#endif /* APR_HAS_THREADS */ diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 4c76380db90..2dd0ceb1dce 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -63,6 +63,78 @@ extern "C" { #endif +/** + * @file apr_atomic.h + * @brief APR Atomic Operations + */ +/** + * @defgroup APR_Atomic Atomic operations + * @ingroup APR + * @{ + */ + +/* easiest way to get these documented for the moment */ +#if defined(DOXYGEN) +/** + * structure for holding a atomic value. + * this number >only< has a 24 bit size on some platforms + */ +typedef apr_atomic_t; + +/** + * @param pool + * this function is required on some platforms to initiliaze the + * atomic operation's internal structures + * returns APR_SUCCESS on successfull completion + */ +apr_status_t apr_atomic_init(apr_pool_t *p); +/** + * read the value stored in a atomic variable + * @param the pointer + * @warning on certain platforms (linux) this number is not + * stored directly in the pointer. in others it is + */ +apr_uint32_t apr_atomic_read(volatile apr_atomic_t *mem); +/** + * set the value for atomic. + * @param the pointer + * @param the value + * @warning the return value is undefined at the moment + */ +apr_uint32_t apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val); +/** + * Add 'val' to the atomic variable + * @param mem pointer to the atomic value + * @param val the addition + * @return the old value of the atomic + */ +apr_uint32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val); + +/** + * increment the atomic variable by 1 + * @param mem pointer to the atomic value + * @return the old value of the atomic + */ +apr_uint32_t apr_atomic_inc(volatile apr_atomic_t *mem); + +/** + * decrement the atomic variable by 1 + * @param mem pointer to the atomic value + * @return the old value of the atomic + */ +apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem); + +/** + * compare the atomic's value with cmp. + * If they are the same swap the value with 'with' + * @param mem pointer to the atomic value + * @param with what to swap it with + * @param the value to compare it to + * @return the old value of the atomic + */ +long apr_atomic_cas(volatile apr_atomic_t *mem,long with,long cmp); +#else /* !DOXYGEN */ + #ifdef WIN32 #define apr_atomic_t LONG; @@ -72,7 +144,7 @@ extern "C" { #define apr_atomic_inc(mem) InterlockedIncrement(mem) #define apr_atomic_set(mem, val) InterlockedExchange(mem, val) #define apr_atomic_read(mem) *mem -/* #define apr_atomic_cas(mem,with,cmp) InterlockedCompareExchange(mem,with,cmp)*/ +#define apr_atomic_cas(mem,with,cmp) InterlockedCompareExchange(mem,with,cmp) #define apr_atomic_init(pool) APR_SUCCESS #elif defined(__linux) @@ -86,6 +158,7 @@ extern "C" { #define apr_atomic_set(mem, val) atomic_set(mem, val) #define apr_atomic_read(mem) atomic_read(mem) #define apr_atomic_init(pool) APR_SUCCESS +#define APR_ATOMIC_NEED_CAS_DEFAULT 1 #elif defined(__FreeBSD__) && (__FreeBSD__ >= 4) #include @@ -98,36 +171,47 @@ extern "C" { #define apr_atomic_read(mem) *mem #define apr_atomic_init(pool) APR_SUCCESS +#define APR_ATOMIC_NEED_CAS_DEFAULT 1 -#elif defined(__sparc__not_ready_yet) +#elif defined(__sparc__not_yet) #define apr_atomic_t apr_uint32_t #define apr_atomic_read(p) *p #define apr_atomic_add(mem, val) apr_atomic_add_sparc(mem,val) #define apr_atomic_dec(mem) apr_atomic_sub_sparc(mem,1) #define apr_atomic_inc(mem) apr_atomic_add_sparc(mem,1) +#define apr_atomic_cas(mem,val,cond) apr_atomic_cas_sparc(mem,val,cond) +#define apr_atomic_casptr(mem,val,cond) apr_atomic_casptr_sparc(mem,val,cond) #define apr_atomic_set(mem, val) *mem= val #define apr_atomic_init(pool) APR_SUCCESS apr_uint32_t apr_atomic_add_sparc( volatile apr_atomic_t* mem, apr_uint32_t add); apr_uint32_t apr_atomic_sub_sparc( volatile apr_atomic_t* mem, apr_uint32_t sub); +long apr_atomic_cas_sparc(volatile apr_atomic_t *mem,long with,long cmp); + #else #if APR_HAS_THREADS #define apr_atomic_t apr_uint32_t #define apr_atomic_read(p) *p apr_status_t apr_atomic_init(apr_pool_t *p); -apr_uint32_t apr_atomic_set(volatile apr_atomic_t *mem, long val); -apr_uint32_t apr_atomic_add(volatile apr_atomic_t *mem, long val); +apr_uint32_t apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val); +apr_uint32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val); apr_uint32_t apr_atomic_inc(volatile apr_atomic_t *mem); apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem); -/*long apr_atomic_cas(volatile apr_atomic_t *mem,long with,long cmp);*/ #define APR_ATOMIC_NEED_DEFAULT 1 +#define APR_ATOMIC_NEED_CAS_DEFAULT 1 + #endif /* APR_HAS_THREADS */ #endif /* !defined(WIN32) && !defined(__linux) */ +#if defined(APR_ATOMIC_NEED_CAS_DEFAULT) +long apr_atomic_cas(volatile apr_atomic_t *mem,long with,long cmp); +#endif + +#endif /* DOXYGEN */ #ifdef __cplusplus } #endif diff --git a/test/testatomic.c b/test/testatomic.c index 4d4c98d427d..7f985d701cf 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -71,12 +71,72 @@ apr_pool_t *context; apr_atomic_t y; /* atomic locks */ -#if !APR_HAS_HREADS + +static apr_status_t check_basic_atomics(volatile apr_atomic_t*p) +{ + apr_uint32_t oldval; + apr_atomic_set(&y,0); + printf("%-60s", "testing CAS"); + oldval = apr_atomic_cas(&y,12,0); + if (oldval != 0) { + fprintf(stderr, "Failed\noldval =%d should be zero\n",oldval); + return APR_EGENERAL; + } + printf("OK\n"); + printf("debug\n y=%d\n",y); + printf("%-60s", "testing CAS - match non-null"); + oldval = apr_atomic_cas(&y,23,12); + if (oldval != 12) { + fprintf(stderr, "Failed\noldval =%d should be 12 y=%d\n", + oldval, + apr_atomic_read(&y)); + return APR_EGENERAL; + } + printf("OK\n"); + printf("%-60s", "testing CAS - no match"); + oldval = apr_atomic_cas(&y,23,12); + if (oldval != 23 ) { + fprintf(stderr, "Failed\noldval =%d should be 23 y=%d\n", + oldval, + apr_atomic_read(&y)); + return APR_EGENERAL; + } + printf("OK\n"); + + printf("%-60s", "testing add"); + oldval = apr_atomic_add(&y,4); + if (oldval != 23) { + fprintf(stderr, "Failed\nAtomic Add should return the old value expecting 23 got %d\n", + oldval); + exit(-1); + } + if (apr_atomic_read(&y) != 27) { + fprintf(stderr, "Failed\nAtomic Add doesn't add up ;( expected 27 got %d\n", + oldval); + exit(-1); + } + + printf("OK\n"); + printf("%-60s", "testing add/inc"); + apr_atomic_set(&y,0); + apr_atomic_add(&y,20); + apr_atomic_inc(&y); + if (apr_atomic_read(&y) != 21) { + fprintf(stderr, "Failed.\natomics do not add up\n"); + return APR_EGENERAL; + } + fprintf(stdout, "OK\n"); + + return APR_SUCCESS; +} + +#if !APR_HAS_THREADS int main(void) { apr_status_t rv; + fprintf(stderr, - "This program won't work on this platform because there is no " + "This program won't work fully on this platform because there is no " "support for threads.\n"); if (apr_pool_create(&context, NULL) != APR_SUCCESS) { fflush(stdout); @@ -86,17 +146,13 @@ int main(void) rv = apr_atomic_init(context); if (rv != APR_SUCCESS) { fprintf(stderr, "Failed.\nCould not initialize atomics\n"); + exit(-1); } - apr_atomic_set(&y,0); - apr_atomic_add(&y,20); - apr_atomic_inc(&y); - if (apr_atomic_read(&y) != 21) { - fprintf(stderr, "Failed.\natomics do not add up\n"); - } - else { - fprintf(stdout, "no threads .. OK\n"); + rv = check_basic_atomics(&y); + if (rv != APR_SUCCESS) { + fprintf(stderr, "Failed.\n"); + exit(-1); } - return 0; } #else /* !APR_HAS_THREADS */ @@ -158,6 +214,7 @@ void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data) apr_thread_exit(thd, exit_ret_val); return NULL; } + int main(int argc, char**argv) { apr_thread_t *t1[NUM_THREADS]; @@ -190,19 +247,26 @@ int main(int argc, char**argv) apr_thread_once_init(&control, context); - printf("%-60s", "Initializing the lock"); - rv = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, - APR_LOCK_DEFAULT, "lock.file", context); + if (mutex==1) { + printf("%-60s", "Initializing the lock"); + rv = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, + APR_LOCK_DEFAULT, "lock.file", context); + if (rv != APR_SUCCESS) { + fflush(stdout); + fprintf(stderr, "Failed\nCould not create lock\n"); + exit(-1); + } + printf("OK\n"); + } + rv = apr_atomic_init( context); + + rv = check_basic_atomics(&y); if (rv != APR_SUCCESS) { - fflush(stdout); - fprintf(stderr, "Failed\nCould not create lock\n"); + fprintf(stderr, "Failed.\n"); exit(-1); } - rv = apr_atomic_init( context); apr_atomic_set(&y,0); - printf("OK\n"); - printf("%-60s", "Starting all the threads"); for (i=0;i Date: Tue, 19 Feb 2002 23:45:06 +0000 Subject: [PATCH 3022/7878] enable sun-sparc specific code git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63028 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/apr_atomic_sparc.s | 37 ++++++++++++++++++++----- configure.in | 12 ++++++++ include/apr_atomic.h | 2 +- test/testatomic.c | 1 - 4 files changed, 43 insertions(+), 9 deletions(-) diff --git a/atomic/solaris_sparc/apr_atomic_sparc.s b/atomic/solaris_sparc/apr_atomic_sparc.s index f17cb2bbe41..95f438d8167 100644 --- a/atomic/solaris_sparc/apr_atomic_sparc.s +++ b/atomic/solaris_sparc/apr_atomic_sparc.s @@ -71,19 +71,20 @@ ! ENTRY(apr_atomic_add_sparc) - ld [%o0], %o2 + ld [%o0], %o2 ! set o2 to current value _apr_atomic_add_sparc_loop: - add %o2, %o1, %o3 - cas [%o0], %o2, %o3 - cmp %o2, %o3 - bne,a _apr_atomic_add_sparc_loop - ld [%o0], %o2 + add %o2, %o1, %o3 ! o3 = o2 + o1 + cas [%o0], %o2, %o3 ! if cur-val==o2 then cur-val=03 + cmp %o2, %o3 ! see if the CAS worked + bne,a _apr_atomic_add_sparc_loop ! if not try again + ld [%o0], %o2 ! return the previous value retl mov %o3, %o0 SET_SIZE(apr_atomic_add_sparc) ! ! +! ENTRY(apr_atomic_sub_sparc) ld [%o0], %o2 @@ -96,5 +97,27 @@ _apr_atomic_sub_sparc_loop: retl mov %o3, %o0 - SET_SIZE(apr_atomic_sub_sparc) + SET_SIZE(apr_atomic_sub_sparc) +! +! +! +! %o0 [input] - the address of the value to compare +! %o1 [input] - the new value +! %o2 [input] - value to compare against +! %o0 [output] - the return value +! + ENTRY(apr_atomic_cas_sparc) + ENTRY(apr_atomic_casptr_sparc) + + cas [%o0], %o2, %o1 + cmp %o1, %o2 ! if o1 == o2 values weren't swapped + bne,a _apr_atomic_cas_ne + mov %o2, %o0 + retl + mov %o2, %o0 +_apr_atomic_cas_ne: + retl + mov %o1, %o0 + + SET_SIZE(apr_atomic_cas_sparc) diff --git a/configure.in b/configure.in index c4bc1508cba..6800ab517c0 100644 --- a/configure.in +++ b/configure.in @@ -322,6 +322,18 @@ case $host in enable_threads="no" eolstr="\\n" ;; + *sun*) + case $host_cpu in + *sparc*) + OSDIR="solaris_sparc" + eolstr="\\n" + ;; + *) + OSDIR="unix" + eolstr="\\n" + ;; + esac + ;; *) OSDIR="unix" eolstr="\\n" diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 2dd0ceb1dce..b4fd2521965 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -173,7 +173,7 @@ long apr_atomic_cas(volatile apr_atomic_t *mem,long with,long cmp); #define APR_ATOMIC_NEED_CAS_DEFAULT 1 -#elif defined(__sparc__not_yet) +#elif defined(__sparc__) #define apr_atomic_t apr_uint32_t #define apr_atomic_read(p) *p diff --git a/test/testatomic.c b/test/testatomic.c index 7f985d701cf..00e6f727869 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -83,7 +83,6 @@ static apr_status_t check_basic_atomics(volatile apr_atomic_t*p) return APR_EGENERAL; } printf("OK\n"); - printf("debug\n y=%d\n",y); printf("%-60s", "testing CAS - match non-null"); oldval = apr_atomic_cas(&y,23,12); if (oldval != 12) { From f1fef19e98d8f3bae8641cc6e279e2b051859f5f Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Wed, 20 Feb 2002 05:52:04 +0000 Subject: [PATCH 3023/7878] linux compatibility checks use linux macro cmpxchg if available. now.. to retest solaris ;) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63029 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 27 +++++++++++++++------------ include/apr_atomic.h | 32 ++++++++++++++++++-------------- test/testatomic.c | 19 ++++++++----------- 3 files changed, 41 insertions(+), 37 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 2cae91b93ba..c733a45af2f 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -60,7 +60,7 @@ #if APR_HAS_THREADS -#if defined(APR_ATOMIC_NEED_DEFAULT) +#if defined(APR_ATOMIC_NEED_DEFAULT) || defined(APR_ATOMIC_NEED_CAS_DEFAULT) #define NUM_ATOMIC_HASH 7 /* shift by 2 to get rid of alignment issues */ @@ -79,7 +79,10 @@ apr_status_t apr_atomic_init(apr_pool_t *p ) } return APR_SUCCESS; } -apr_uint32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val) +#endif /* APR_ATOMIC_NEED_DEFAULT || APR_ATOMIC_NEED_CAS_DEFAULT */ + +#if defined(APR_ATOMIC_NEED_DEFAULT) +void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; apr_uint32_t prev; @@ -93,7 +96,7 @@ apr_uint32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val) printf("debug no workee\n"); return *mem; } -apr_uint32_t apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val) +void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; apr_uint32_t prev; @@ -107,7 +110,7 @@ apr_uint32_t apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val) return *mem; } -apr_uint32_t apr_atomic_inc( volatile apr_uint32_t *mem) +void apr_atomic_inc( volatile apr_uint32_t *mem) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; apr_uint32_t prev; @@ -120,7 +123,7 @@ apr_uint32_t apr_atomic_inc( volatile apr_uint32_t *mem) } return *mem; } -apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem) +void apr_atomic_dec(volatile apr_atomic_t *mem) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; apr_uint32_t prev; @@ -134,25 +137,25 @@ apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem) return *mem; } +#endif /* APR_ATOMIC_NEED_DEFAULT */ #if defined(APR_ATOMIC_NEED_CAS_DEFAULT) -long apr_atomic_cas(volatile apr_atomic_t *mem,long with, long cmp) +long apr_atomic_cas(volatile void *mem,long with, long cmp) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - apr_uint32_t prev; + long prev; if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - prev = *mem; - if ( *mem == cmp) { - *mem = with; + prev = *(long*)mem; + if ( prev == cmp) { + *(long*)mem = with; } apr_thread_mutex_unlock(lock); return prev; } - return *mem; + return *(long*)mem; } #endif /* APR_ATOMIC_NEED_CAS_DEFAULT */ -#endif /* APR_ATOMIC_NEED_DEFAULT */ #endif /* APR_HAS_THREADS */ diff --git a/include/apr_atomic.h b/include/apr_atomic.h index b4fd2521965..d1a08a1a9a8 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -99,30 +99,26 @@ apr_uint32_t apr_atomic_read(volatile apr_atomic_t *mem); * set the value for atomic. * @param the pointer * @param the value - * @warning the return value is undefined at the moment */ -apr_uint32_t apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val); +void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val); /** * Add 'val' to the atomic variable * @param mem pointer to the atomic value * @param val the addition - * @return the old value of the atomic */ -apr_uint32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val); +void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val); /** * increment the atomic variable by 1 * @param mem pointer to the atomic value - * @return the old value of the atomic */ -apr_uint32_t apr_atomic_inc(volatile apr_atomic_t *mem); +void apr_atomic_inc(volatile apr_atomic_t *mem); /** * decrement the atomic variable by 1 * @param mem pointer to the atomic value - * @return the old value of the atomic */ -apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem); +void apr_atomic_dec(volatile apr_atomic_t *mem); /** * compare the atomic's value with cmp. @@ -131,8 +127,10 @@ apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem); * @param with what to swap it with * @param the value to compare it to * @return the old value of the atomic + * @warning do not mix apr_atomic's with the CAS function. + * on some platforms they may be implemented by different mechanisms */ -long apr_atomic_cas(volatile apr_atomic_t *mem,long with,long cmp); +apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #else /* !DOXYGEN */ #ifdef WIN32 @@ -150,6 +148,7 @@ long apr_atomic_cas(volatile apr_atomic_t *mem,long with,long cmp); #elif defined(__linux) #include +#include #define apr_atomic_t atomic_t #define apr_atomic_add(mem, val) atomic_add(val,mem) @@ -157,8 +156,12 @@ long apr_atomic_cas(volatile apr_atomic_t *mem,long with,long cmp); #define apr_atomic_inc(mem) atomic_inc(mem) #define apr_atomic_set(mem, val) atomic_set(mem, val) #define apr_atomic_read(mem) atomic_read(mem) +#if defined(cmpxchg) #define apr_atomic_init(pool) APR_SUCCESS +#define apr_atomic_cas(mem,with,cmp) cmpxchg(mem,cmp,with) +#else #define APR_ATOMIC_NEED_CAS_DEFAULT 1 +#endif #elif defined(__FreeBSD__) && (__FreeBSD__ >= 4) #include @@ -195,10 +198,10 @@ long apr_atomic_cas_sparc(volatile apr_atomic_t *mem,long with,long cmp); #define apr_atomic_t apr_uint32_t #define apr_atomic_read(p) *p apr_status_t apr_atomic_init(apr_pool_t *p); -apr_uint32_t apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val); -apr_uint32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val); -apr_uint32_t apr_atomic_inc(volatile apr_atomic_t *mem); -apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem); +void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val); +void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val); +void apr_atomic_inc(volatile apr_atomic_t *mem); +void apr_atomic_dec(volatile apr_atomic_t *mem); #define APR_ATOMIC_NEED_DEFAULT 1 #define APR_ATOMIC_NEED_CAS_DEFAULT 1 @@ -208,7 +211,8 @@ apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem); #endif /* !defined(WIN32) && !defined(__linux) */ #if defined(APR_ATOMIC_NEED_CAS_DEFAULT) -long apr_atomic_cas(volatile apr_atomic_t *mem,long with,long cmp); +apr_status_t apr_atomic_init(apr_pool_t *p); +apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #endif #endif /* DOXYGEN */ diff --git a/test/testatomic.c b/test/testatomic.c index 00e6f727869..8c7edd9a19e 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -75,40 +75,37 @@ apr_atomic_t y; /* atomic locks */ static apr_status_t check_basic_atomics(volatile apr_atomic_t*p) { apr_uint32_t oldval; + apr_uint32_t casval=0; apr_atomic_set(&y,0); printf("%-60s", "testing CAS"); - oldval = apr_atomic_cas(&y,12,0); + oldval = apr_atomic_cas(&casval,12,0); if (oldval != 0) { fprintf(stderr, "Failed\noldval =%d should be zero\n",oldval); return APR_EGENERAL; } printf("OK\n"); printf("%-60s", "testing CAS - match non-null"); - oldval = apr_atomic_cas(&y,23,12); + oldval = apr_atomic_cas(&casval,23,12); if (oldval != 12) { fprintf(stderr, "Failed\noldval =%d should be 12 y=%d\n", oldval, - apr_atomic_read(&y)); + casval); return APR_EGENERAL; } printf("OK\n"); printf("%-60s", "testing CAS - no match"); - oldval = apr_atomic_cas(&y,23,12); + oldval = apr_atomic_cas(&casval,23,12); if (oldval != 23 ) { fprintf(stderr, "Failed\noldval =%d should be 23 y=%d\n", oldval, - apr_atomic_read(&y)); + casval); return APR_EGENERAL; } printf("OK\n"); printf("%-60s", "testing add"); - oldval = apr_atomic_add(&y,4); - if (oldval != 23) { - fprintf(stderr, "Failed\nAtomic Add should return the old value expecting 23 got %d\n", - oldval); - exit(-1); - } + apr_atomic_set(&y,23); + apr_atomic_add(&y,4); if (apr_atomic_read(&y) != 27) { fprintf(stderr, "Failed\nAtomic Add doesn't add up ;( expected 27 got %d\n", oldval); From 762bd4d541f1ec0865cbf0f3312866b8cda0b1ec Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Wed, 20 Feb 2002 06:06:11 +0000 Subject: [PATCH 3024/7878] minor fix for solaris get freebsd fixes in there as well .. sorry.. but need to build this on multiple platforms PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63030 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/.cvsignore | 3 +++ include/apr_atomic.h | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 atomic/solaris_sparc/.cvsignore diff --git a/atomic/solaris_sparc/.cvsignore b/atomic/solaris_sparc/.cvsignore new file mode 100644 index 00000000000..06e18a7aafb --- /dev/null +++ b/atomic/solaris_sparc/.cvsignore @@ -0,0 +1,3 @@ +Makefile +*.lo +.libs diff --git a/include/apr_atomic.h b/include/apr_atomic.h index d1a08a1a9a8..5f726b6c344 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -172,7 +172,6 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #define apr_atomic_inc(mem) atomic_add_int(mem,1) #define apr_atomic_set(mem, val) atomic_set_int(mem, val) #define apr_atomic_read(mem) *mem -#define apr_atomic_init(pool) APR_SUCCESS #define APR_ATOMIC_NEED_CAS_DEFAULT 1 @@ -184,13 +183,12 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #define apr_atomic_dec(mem) apr_atomic_sub_sparc(mem,1) #define apr_atomic_inc(mem) apr_atomic_add_sparc(mem,1) #define apr_atomic_cas(mem,val,cond) apr_atomic_cas_sparc(mem,val,cond) -#define apr_atomic_casptr(mem,val,cond) apr_atomic_casptr_sparc(mem,val,cond) #define apr_atomic_set(mem, val) *mem= val #define apr_atomic_init(pool) APR_SUCCESS -apr_uint32_t apr_atomic_add_sparc( volatile apr_atomic_t* mem, apr_uint32_t add); -apr_uint32_t apr_atomic_sub_sparc( volatile apr_atomic_t* mem, apr_uint32_t sub); -long apr_atomic_cas_sparc(volatile apr_atomic_t *mem,long with,long cmp); +apr_uint32_t apr_atomic_add_sparc(volatile apr_atomic_t *mem, apr_uint32_t add); +apr_uint32_t apr_atomic_sub_sparc(volatile apr_atomic_t *mem, apr_uint32_t sub); +apr_uint32_t apr_atomic_cas_sparc(volatile apr_uint32_t *mem, long with, long cmp); #else #if APR_HAS_THREADS From 70129499dafa5fc617f9d9b666c43479ef11db54 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 20 Feb 2002 12:23:12 +0000 Subject: [PATCH 3025/7878] get apr_atomic.c to compile (multiple failures seen with gcc and AIX's xlc) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63031 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index c733a45af2f..a4310cc3c5b 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -91,10 +91,10 @@ void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val) prev = *mem; *mem += val; apr_thread_mutex_unlock(lock); - return prev; +/* return prev; */ } printf("debug no workee\n"); - return *mem; +/* return *mem; */ } void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val) { @@ -105,9 +105,9 @@ void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val) prev = *mem; *mem = val; apr_thread_mutex_unlock(lock); - return prev; +/* return prev; */ } - return *mem; +/* return *mem; */ } void apr_atomic_inc( volatile apr_uint32_t *mem) @@ -119,9 +119,9 @@ void apr_atomic_inc( volatile apr_uint32_t *mem) prev = *mem; (*mem)++; apr_thread_mutex_unlock(lock); - return prev; +/* return prev; */ } - return *mem; +/* return *mem; */ } void apr_atomic_dec(volatile apr_atomic_t *mem) { @@ -132,15 +132,15 @@ void apr_atomic_dec(volatile apr_atomic_t *mem) prev = *mem; (*mem)--; apr_thread_mutex_unlock(lock); - return prev; +/* return prev; */ } - return *mem; +/* return *mem; */ } #endif /* APR_ATOMIC_NEED_DEFAULT */ #if defined(APR_ATOMIC_NEED_CAS_DEFAULT) -long apr_atomic_cas(volatile void *mem,long with, long cmp) +apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with, long cmp) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; long prev; From 74f11c4f39f9c93523109622198b195dfdef8094 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 20 Feb 2002 19:57:49 +0000 Subject: [PATCH 3026/7878] Added the global mutex stuff into the project git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63032 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 176721 -> 177515 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 68a5054ed59e6a8559c3d005c7420451a07415ef..9dd7ab99f771a890999758d955dd4449df19542b 100644 GIT binary patch delta 91335 zcmZ^~1ymGY6hBTcAt2H%prmxSfCxxQOLupNz)*@bNJ$9N%?e6L?V_?YNH?r3ol7tM zU%$UNzu)hi|2Z>vX70Q1-WT_M-kmpZ#?}aTcL*cCV-D#83YPlM4uj)7kE}5<1k#8w z9$;W#xH;Qcd--?-^10i3?U@r<>Gw<(EV(^ej=|vm(Ds3o?;(@U3uOW~jL3(&&lNO@ z^TJY}Uhf>d$5Ae$q|D@QHcV=oHZpZ~Z<+=*&zrcKHdWcw)PW6=n9el@rcKS~o_B{s zvfsdNAL$!efv>)ByDsUA#ksee1(L#>L!G|Zf4{ar#~18o{hjXkfZ~vsfs>mG|ER$L z-!)Q`)91bHa%R2LBy;k-Yw_PEi$JqAa^e?Zv)$qh$w`8+0I?AN4-cig#qTgEL%_-& zjwPefGm%xFeo$FA;j7ye{-#P0xGP)p36TGh*_ZuQz#Ax4wpYtxlhou9)=B=I_4^KI zER4CWuW4lcL930RXRTWuPi`>o=Cj%ce&b**&EqFm{6{Zmg7($(&UHl{qBkZd^>v)Z zbc~y#3bikZ59VN>LONOUk9fIq2L+FSL)aqhg=2_X_tTQ&{b}X;SZg0=) z0#i3jhoL~PZ}9$G@46*3g=28_$X*CgG+Dv=V?|?uA=>c zm)EN&bmt;J5Di?evPpX7nVNa41nstZW@Psn(TBhl(RV_>9qEt-GS`7X6CF{A&(aP?w#) zJzu7_HvP@A=}YxE!qX2-tm2w4I%sshc3VIwN4|$)^d_bx=GEE+0|C=efrNi`>>uT5 z()C*)HnKmGzGoX>OM8{B(@3%eu=V8s~Gg9WkF#ByUO$$^1>pDsHrJ^5vN^v)F!T#T4|8 zj#%T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+0000 Subject: [PATCH 3027/7878] Implementation of the global mutex APIs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63033 13f79535-47bb-0310-9956-ffa450edef68 --- build/nw_export.inc | 1 + locks/netware/global_mutex.c | 36 ++++++++++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/build/nw_export.inc b/build/nw_export.inc index e7121aa7f53..d5cc3dff6a5 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -17,6 +17,7 @@ #include "apr_fnmatch.h" #include "apr_general.h" #include "apr_getopt.h" +#include "apr_global_mutex.h" #include "apr_hash.h" #include "apr_inherit.h" #include "apr_lib.h" diff --git a/locks/netware/global_mutex.c b/locks/netware/global_mutex.c index 24f73b1c230..ef385bb8149 100644 --- a/locks/netware/global_mutex.c +++ b/locks/netware/global_mutex.c @@ -54,13 +54,29 @@ #include "apr.h" #include "apr_strings.h" +#include "global_mutex.h" +#include "apr_thread_mutex.h" APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, const char *fname, apr_lockmech_e mech, apr_pool_t *pool) { - return APR_ENOTIMPL; + apr_status_t ret; + apr_global_mutex_t *new_mutex = NULL; + new_mutex = (apr_global_mutex_t *)apr_pcalloc(pool, sizeof(apr_global_mutex_t)); + + if(new_mutex ==NULL) { + return APR_ENOMEM; + } + + new_mutex->pool = pool; + ret = apr_thread_mutex_create(&(new_mutex->mutex), APR_THREAD_MUTEX_DEFAULT, pool); + + if (ret == APR_SUCCESS) + *mutex = new_mutex; + + return ret; } APR_DECLARE(apr_status_t) apr_global_mutex_child_init( @@ -68,27 +84,35 @@ APR_DECLARE(apr_status_t) apr_global_mutex_child_init( const char *fname, apr_pool_t *pool) { - return APR_ENOTIMPL; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) { - return APR_ENOTIMPL; + if (mutex) + return apr_thread_mutex_lock(mutex->mutex); + return APR_ENOLOCK; } APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) { - return APR_ENOTIMPL; + if (mutex) + return apr_thread_mutex_trylock(mutex->mutex); + return APR_ENOLOCK; } APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) { - return APR_ENOTIMPL; + if (mutex) + return apr_thread_mutex_unlock(mutex->mutex); + return APR_ENOLOCK; } APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) { - return APR_ENOTIMPL; + if (mutex) + return apr_thread_mutex_destroy(mutex->mutex); + return APR_ENOLOCK; } APR_POOL_IMPLEMENT_ACCESSOR(global_mutex) From 2d0cb39bf9da10b4764be8f28fbefed0933a5961 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 20 Feb 2002 20:00:28 +0000 Subject: [PATCH 3028/7878] NetWare implementation of the APR atomic APIs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63034 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 5f726b6c344..ec84048406a 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -163,6 +163,23 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #define APR_ATOMIC_NEED_CAS_DEFAULT 1 #endif +#elif defined(NETWARE) + +#include +#define apr_atomic_t apr_uint32_t + +#define apr_atomic_add(mem, val) atomic_add(mem,val) +#define apr_atomic_dec(mem) atomic_dec(mem) +#define apr_atomic_inc(mem) atomic_inc(mem) +#define apr_atomic_set(mem, val) (*mem = val) +#define apr_atomic_read(mem) (*mem) +#if defined(cmpxchg) +#define apr_atomic_init(pool) APR_SUCCESS +#define apr_atomic_cas(mem,with,cmp) cmpxchg(mem,cmp,with) +#else +#define APR_ATOMIC_NEED_CAS_DEFAULT 1 +#endif + #elif defined(__FreeBSD__) && (__FreeBSD__ >= 4) #include From a2fe96ae8f6329f03a3c016700cb30c6b89caf08 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 20 Feb 2002 20:23:22 +0000 Subject: [PATCH 3029/7878] Netware Global mutex private header git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63035 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/global_mutex.h | 67 +++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 include/arch/netware/global_mutex.h diff --git a/include/arch/netware/global_mutex.h b/include/arch/netware/global_mutex.h new file mode 100644 index 00000000000..d04807351cf --- /dev/null +++ b/include/arch/netware/global_mutex.h @@ -0,0 +1,67 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef GLOBAL_MUTEX_H +#define GLOBAL_MUTEX_H + +#include "apr_global_mutex.h" +#include "apr_thread_mutex.h" + +struct apr_global_mutex_t { + apr_pool_t *pool; + apr_thread_mutex_t *mutex; +}; + +#endif /* GLOBAL_MUTEX_H */ + From fe1d19debe0ee9b9dbad86b45ffb291e6db0609e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 20 Feb 2002 20:24:27 +0000 Subject: [PATCH 3030/7878] NetWare implementation of the file locking APR APIs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63036 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/flock.c | 77 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 file_io/netware/flock.c diff --git a/file_io/netware/flock.c b/file_io/netware/flock.c new file mode 100644 index 00000000000..e58e420f652 --- /dev/null +++ b/file_io/netware/flock.c @@ -0,0 +1,77 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include +#include "fileio.h" + + +apr_status_t apr_file_lock(apr_file_t *thefile, int type) +{ + int fc; + + fc = (type & APR_FLOCK_NONBLOCK) ? NX_RANGE_LOCK_TRYLOCK : NX_RANGE_LOCK_CHECK; + + if(NXFileRangeLock(thefile->filedes,fc, 0, 0) == -1) + return errno; + + return APR_SUCCESS; +} + +apr_status_t apr_file_unlock(apr_file_t *thefile) +{ + if(NXFileRangeUnlock(thefile->filedes,NX_RANGE_LOCK_CANCEL,0 , 0) == -1) + return errno; + + return APR_SUCCESS; +} From e5054f37d2832258a5d43cb07b9d0fd037766a4b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 20 Feb 2002 23:59:07 +0000 Subject: [PATCH 3031/7878] Nothing serious, just DoxyGenatation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63037 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index b1ccdb78fc5..ae224efae55 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -494,7 +494,7 @@ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, apr_int32_t flags, char *buf, apr_size_t *len); -#if APR_HAS_SENDFILE +#if APR_HAS_SENDFILE || defined(DOXYGEN) /** * Send a file from an open file descriptor to a socket, along with @@ -761,7 +761,7 @@ APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup)(void *)); -#if APR_FILES_AS_SOCKETS +#if APR_FILES_AS_SOCKETS || defined(DOXYGEN) /** * Convert a File type to a socket so that it can be used in a poll operation. @@ -804,7 +804,7 @@ APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char */ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa); -#if APR_HAS_SO_ACCEPTFILTER +#if APR_HAS_SO_ACCEPTFILTER || defined(DOXYGEN) /** * Set an OS level accept filter. * @param sock The socket to put the accept filter on. From efe87236613db39c661d355014d1c8211c56cfd5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 21 Feb 2002 00:01:15 +0000 Subject: [PATCH 3032/7878] Fix a Win32 segfault in mod_ssl, since ssl used file bucket to mmap transformation to process input. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63038 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/win32/mmap.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index a410390b763..9c0b0a74ccf 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -130,24 +130,23 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, *new = apr_pcalloc(cont, sizeof(apr_mmap_t)); (*new)->pstart = (offset / memblock) * memblock; - (*new)->psize = (apr_size_t)(offset % memblock) + size; (*new)->poffset = offset - (*new)->pstart; - /* XXX: psize below should be the MAXIMUM size of the mmap object, - * (e.g. file size) not the size of the mapped region! - * Since apr doesn't seem to acknowledge the discrepancy (the mmap - * size/view/off concepts are pretty horked) this will have to wait. + (*new)->psize = (apr_size_t)((*new)->poffset) + size; + /* The size of the CreateFileMapping object is the current size + * of the size of the mmap object (e.g. file size), not the size + * of the mapped region! */ (*new)->mhandle = CreateFileMapping(file->filehand, NULL, fmaccess, - 0, (*new)->psize, NULL); + 0, 0, NULL); if (!(*new)->mhandle || (*new)->mhandle == INVALID_HANDLE_VALUE) { *new = NULL; return apr_get_os_error(); } - offlo = (DWORD)(*new)->poffset; - offhi = (DWORD)((*new)->poffset << 32); + offlo = (DWORD)(*new)->pstart; + offhi = (DWORD)((*new)->pstart >> 32); (*new)->mv = MapViewOfFile((*new)->mhandle, mvaccess, offhi, offlo, (*new)->psize); if (!(*new)->mv) @@ -158,7 +157,7 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, return rv; } - (*new)->mm = (char*)((*new)->mv) + offset; + (*new)->mm = (char*)((*new)->mv) + (*new)->poffset; (*new)->size = size; (*new)->cntxt = cont; (*new)->is_owner = 1; From ca0f36b3ac4fdf7f2a17c89f8e8eab83c1a6efb2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 21 Feb 2002 00:04:10 +0000 Subject: [PATCH 3033/7878] Solve ULONG_PTR issues until we revisit the Win64 port git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63039 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/misc.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index f5ccdfc1ed0..68141e292d0 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -325,13 +325,16 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtSetTimerResolution, 0, ( (ReqRes, Acquire, pNewRes)); #define SetTimerResolution apr_winapi_NtSetTimerResolution +/* ### These are ULONG_PTR values, but that's int32 for all we care + * until the Win64 port is prepared. + */ typedef struct PBI { DWORD ExitStatus; PVOID PebBaseAddress; - ULONG_PTR AffinityMask; + ULONG AffinityMask; LONG BasePriority; - ULONG_PTR UniqueProcessId; - ULONG_PTR InheritedFromUniqueProcessId; + ULONG UniqueProcessId; + ULONG InheritedFromUniqueProcessId; } PBI, *PPBI; APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryInformationProcess, 0, ( From 0dd1de0e39b730dac7e3587eb722919d92f967a6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 21 Feb 2002 05:36:44 +0000 Subject: [PATCH 3034/7878] Ok... couldn't have gone so far without this script, so here it is. In fact, the Win32 .zip packages have been nothing more than lineends.pl converted Unix tarballs for several revisions now, although I regularly check out on Win32, expand the .html docs, and then diff to the tar converted package - to prove they are identical. Your results may vary, all reservations righted, void if detached. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63040 13f79535-47bb-0310-9956-ffa450edef68 --- build/lineends.pl | 149 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 build/lineends.pl diff --git a/build/lineends.pl b/build/lineends.pl new file mode 100644 index 00000000000..f91a9d30c58 --- /dev/null +++ b/build/lineends.pl @@ -0,0 +1,149 @@ +#!/usr/local/bin/perl +# +# Heuristically converts line endings to the current OS's preferred format +# +# All existing line endings must be identical (e.g. lf's only, or even +# the accedental cr.cr.lf sequence.) If some lines end lf, and others as +# cr.lf, the file is presumed binary. If the cr character appears anywhere +# except prefixed to an lf, the file is presumed binary. If there is no +# change in the resulting file size, or the file is binary, the conversion +# is discarded. +# +# Todo: Handle NULL stdin characters gracefully. +# + +use IO::File; +use File::Find; + +# The ignore list is '-' seperated, with this leading hyphen and +# trailing hyphens in ever concatinated list below. +$ignore = "-"; + +# Image formats +$ignore .= "gif-jpg-jpeg-png-ico-bmp-"; + +# Archive formats +$ignore .= "tar-gz-z-zip-jar-war-"; + +# Many document formats +$ignore .= "eps-psd-pdf-ai-"; + +# Some encodings +$ignore .= "ucs2-ucs4-"; + +# Some binary objects +$ignore .= "class-so-dll-exe-obj-"; + +# Some build env files in NW/Win32 +$ignore .= "mcp-xdc-ncb-opt-pdb-ilk-sbr-"; + +$preservedate = 1; + +$forceending = 0; + +$givenpaths = 0; + +$notnative = 0; + +while (defined @ARGV[0]) { + if (@ARGV[0] eq '--touch') { + $preservedate = 0; + } + elsif (@ARGV[0] eq '--nocr') { + $notnative = -1; + } + elsif (@ARGV[0] eq '--cr') { + $notnative = 1; + } + elsif (@ARGV[0] eq '--force') { + $forceending = 1; + } + elsif (@ARGV[0] eq '--FORCE') { + $forceending = 2; + } + elsif (@ARGV[0] =~ m/^-/) { + die "What is " . @ARGV[0] . " supposed to mean?\n\n" + . "Syntax:\t$0 [option()s] [path(s)]\n\n" . <<'OUTCH' +Where: paths specifies the top level directory to convert (default of '.') + options are; + + --cr keep/add one ^M + --nocr remove ^M's + --touch the datestamp (default: keeps date/attribs) + --force mismatched corrections (unbalanced ^M's) + --FORCE all files regardless of file name! + +OUTCH + } + else { + find(\&totxt, @ARGV[0]); + print "scanned " . @ARGV[0] . "\n"; + $givenpaths = 1; + } + shift @ARGV; +} + +if (!$givenpaths) { + find(\&totxt, '.'); + print "did .\n"; +} + +sub totxt { + $oname = $_; + $tname = '.#' . $_; + if (!-f) { + return; + } + @exts = split /\./; + if ($forceending < 2) { + while ($#exts && ($ext = pop(@exts))) { + if ($ignore =~ m|-$ext-|i) { + return; + } + } + } + @ostat = stat($oname); + $srcfl = new IO::File $oname, "r" or die; + $dstfl = new IO::File $tname, "w" or die; + binmode $srcfl; + if ($notnative) { + binmode $dstfl; + } + undef $t; + while (<$srcfl>) { + if (s/(\r*)\n$/\n/) { + $n = length $1; + if (!defined $t) { + $t = $n; + } + if (!$forceending && (($n != $t) || m/\r/)) { + print "mismatch in " .$oname. ":" .$n. " expected " .$t. "\n"; + undef $t; + last; + } + elsif ($notnative > 0) { + s/\n$/\r\n/; + } + } + print $dstfl $_; + } + if (defined $t && (tell $srcfl == tell $dstfl)) { + undef $t; + } + undef $srcfl; + undef $dstfl; + if (defined $t) { + unlink $oname or die; + rename $tname, $oname or die; + @anames = ($oname); + if ($preservedate) { + utime $ostat[9], $ostat[9], @anames; + } + chmod $ostat[2] & 07777, @anames; + chown $ostat[5], $ostat[6], @anames; + print "Converted file " . $oname . " to text in " . $File::Find::dir . "\n"; + } + else { + unlink $tname or die; + } +} From d623de8cf747eea4f2c8ed0b2d12b369371f14b4 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Thu, 21 Feb 2002 15:48:18 +0000 Subject: [PATCH 3035/7878] Allow assembly of atomic/solaris_sparc/apr_atomic_sparc.s with the gnu as. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63041 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/Makefile.in | 10 ++++++---- configure.in | 18 ++++++++++++++++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/atomic/solaris_sparc/Makefile.in b/atomic/solaris_sparc/Makefile.in index a5537371d03..8aac673c224 100644 --- a/atomic/solaris_sparc/Makefile.in +++ b/atomic/solaris_sparc/Makefile.in @@ -1,12 +1,14 @@ TARGETS = apr_atomic_sparc.lo -ASFLAGS += -K pic -ASFLAGS += -P -D_ASM -D__STDC__=0 -ASFLAGS += -xarch=v8plus +ASFLAGS += @ASFLAGS@ +ASCPPFLAGS = @ASCPPFLAGS@ +AS = @AS@ +ASCPP = @ASCPP@ apr_atomic_sparc.lo: apr_atomic_sparc.s - $(AS) -P -D_ASM -D__STDC__=0 -K PIC -q -o $@ $< + $(ASCPP) $(ASCPPFLAGS) $*.s > $*.S + $(AS) $(ASFLAGS) -o $@ $*.S # bring in rules.mk for standard functionality diff --git a/configure.in b/configure.in index 6800ab517c0..7b853d984c9 100644 --- a/configure.in +++ b/configure.in @@ -89,6 +89,8 @@ AC_PROG_LN_S AC_PROG_RANLIB AC_PROG_INSTALL AC_CHECK_PROG(RM, rm, rm) +AC_CHECK_PROG(AS, as, as) +AC_CHECK_PROG(ASCPP, cpp, cpp) AC_CHECK_TOOL(AR, ar, ar) dnl Various OS checks that apparently set required flags @@ -325,8 +327,20 @@ case $host in *sun*) case $host_cpu in *sparc*) - OSDIR="solaris_sparc" - eolstr="\\n" + OSDIR="solaris_sparc" + eolstr="\\n" + is_gnu_as=`${AS} --help | grep gnu.org` + if [ -z "$is_gnu_as" ] + then + ASFLAGS="-xarch=v8plus -KPIC -q" + ASCPPFLAGS="-D_ASM -D__STDC__=0" + else + ASFLAGS="-K pic -P -D_ASM -D__STDC__=0 -xarch=v8plus" + ASCPPFLAGS="" + ASCPP="cat" + fi + AC_SUBST(ASCPPFLAGS) + AC_SUBST(ASFLAGS) ;; *) OSDIR="unix" From b2780f2c765587c1495f9f5f3f454fe68741760d Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Thu, 21 Feb 2002 17:10:55 +0000 Subject: [PATCH 3036/7878] simple test to time regex and hash gets PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63042 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + test/Makefile.in | 4 ++ test/testregex.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 test/testregex.c diff --git a/test/.cvsignore b/test/.cvsignore index e667a8e5657..9c8a78e5a85 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -60,3 +60,4 @@ test.fil testprocmutex testglobalmutex testvsn +testregex diff --git a/test/Makefile.in b/test/Makefile.in index f72048669a7..3a06fd40038 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -39,6 +39,7 @@ PROGRAMS = \ testrand@EXEEXT@ \ testdup@EXEEXT@ \ testatomic@EXEEXT@ \ + testregex@EXEEXT@ \ testpools@EXEEXT@ @@ -173,6 +174,9 @@ testsleep@EXEEXT@: testsleep.lo $(LOCAL_LIBS) testatomic@EXEEXT@: testatomic.lo $(LOCAL_LIBS) $(LINK) testatomic.lo $(LOCAL_LIBS) $(ALL_LIBS) +testregex@EXEEXT@: testregex.lo $(LOCAL_LIBS) + $(LINK) testregex.lo $(LOCAL_LIBS) $(ALL_LIBS) + testdup@EXEEXT@: testdup.lo $(LOCAL_LIBS) $(LINK) testdup.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/testregex.c b/test/testregex.c new file mode 100644 index 00000000000..7fb3a3bfac6 --- /dev/null +++ b/test/testregex.c @@ -0,0 +1,129 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +#include "apr_strings.h" +#include "apr_pools.h" +#include "apr_general.h" +#include "apr_hash.h" +#include "apr_lib.h" +#include "apr_time.h" +#include +#include +#include + +int main( int argc, char** argv) { + apr_pool_t *context; + regex_t regex; + int rc; + int i; + int iters; + apr_time_t now; + apr_time_t end; + apr_hash_t *h; + + + if (argc !=4 ) { + fprintf(stderr, "Usage %s match string #iterations\n",argv[0]); + return -1; + } + iters = atoi( argv[3]); + + apr_initialize() ; + atexit(apr_terminate); + if (apr_pool_create(&context, NULL) != APR_SUCCESS) { + fprintf(stderr, "Something went wrong\n"); + exit(-1); + } + rc = regcomp( ®ex, argv[1], REG_EXTENDED|REG_NOSUB); + + + if (rc) { + char errbuf[2000]; + regerror(rc, ®ex,errbuf,2000); + fprintf(stderr,"Couldn't compile regex ;(\n%s\n ",errbuf); + return -1; + } + if ( regexec( ®ex, argv[2], 0, NULL,0) == 0 ) { + fprintf(stderr,"Match\n"); + } + else { + fprintf(stderr,"No Match\n"); + } + now = apr_time_now(); + for (i=0;i Date: Thu, 21 Feb 2002 17:30:43 +0000 Subject: [PATCH 3037/7878] prevent any annoying stderr from leaking through to the screen (native as). Submitted by: Dale Ghent, daleg@elemental.org git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63043 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 7b853d984c9..a7241816302 100644 --- a/configure.in +++ b/configure.in @@ -329,7 +329,7 @@ case $host in *sparc*) OSDIR="solaris_sparc" eolstr="\\n" - is_gnu_as=`${AS} --help | grep gnu.org` + is_gnu_as=`${AS} --help 2>/dev/null | grep gnu.org` if [ -z "$is_gnu_as" ] then ASFLAGS="-xarch=v8plus -KPIC -q" From 0752a462977be355852688de72466ed09aacfe7a Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 21 Feb 2002 18:45:07 +0000 Subject: [PATCH 3038/7878] Change apr_proc_detach to take a parameter that can enable/disable automatic forking (aka, to "daemonize"). Detailed explanation: If we are only interested in detaching from the controlling terminal, then we are only interested in creating a new process group (or creating a new session, which implicitly creates a new process group). In order to do so, we must _NOT_ already be a process group leader. The only way to ensure that is true, we normally will call fork() and allow the parent to exit, ensuring that the child is at least a child of a process group leader (and not one itself). Doing this by default prevents some process-watching tools from working with Apache. Therefore, when calling apr_proc_detach with APR_PROC_DETACH_FOREGROUND, the caller is taking responsibility for _NOT_ being a process group leader, which is guaranteed by such process management tools. [A similiar patch was originally submitted Jos and later modifed by Aaron.] Obtained from: Jos Backus Submitted by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63044 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 8 +++++++- threadproc/netware/procsup.c | 2 +- threadproc/os2/proc.c | 2 +- threadproc/unix/proc.c | 8 ++++---- threadproc/unix/procsup.c | 24 ++++++++++++++---------- 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index d8598e0f37e..d6e01aab9b9 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -578,10 +578,16 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_how_e waithow, apr_pool_t *p); +#define APR_PROC_DETACH_FOREGROUND 0 +#define APR_PROC_DETACH_DAEMONIZE 1 + /** * Detach the process from the controlling terminal. + * @param daemonize set to non-zero if the process should daemonize + * and become a background process, else it will + * stay in the foreground. */ -APR_DECLARE(apr_status_t) apr_proc_detach(void); +APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize); #if APR_HAS_OTHER_CHILD diff --git a/threadproc/netware/procsup.c b/threadproc/netware/procsup.c index e7a3d69a410..daa1b8dc76e 100644 --- a/threadproc/netware/procsup.c +++ b/threadproc/netware/procsup.c @@ -54,7 +54,7 @@ #include "threadproc.h" -apr_status_t apr_proc_detach(void) +apr_status_t apr_proc_detach(int daemonize) { #if 0 int x; diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 08af08794d8..fdb2841ca74 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -622,7 +622,7 @@ APR_DECLARE(apr_status_t) apr_get_os_proc(apr_os_proc_t *theproc, apr_proc_t *pr -APR_DECLARE(apr_status_t) apr_proc_detach() +APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) { return APR_ENOTIMPL; } diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index ff80f2cfea4..deb188a58c7 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -362,26 +362,26 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, } newargs[i + 2] = NULL; if (attr->detached) { - apr_proc_detach(); + apr_proc_detach(APR_PROC_DETACH_DAEMONIZE); } execve(SHELL_PATH, (char * const *) newargs, (char * const *)env); } else if (attr->cmdtype == APR_PROGRAM) { if (attr->detached) { - apr_proc_detach(); + apr_proc_detach(APR_PROC_DETACH_DAEMONIZE); } execve(progname, (char * const *)args, (char * const *)env); } else if (attr->cmdtype == APR_PROGRAM_ENV) { if (attr->detached) { - apr_proc_detach(); + apr_proc_detach(APR_PROC_DETACH_DAEMONIZE); } execv(progname, (char * const *)args); } else { /* APR_PROGRAM_PATH */ if (attr->detached) { - apr_proc_detach(); + apr_proc_detach(APR_PROC_DETACH_DAEMONIZE); } execvp(progname, (char * const *)args); } diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index b96cb48ec6b..391f803bdcf 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -54,24 +54,28 @@ #include "threadproc.h" -APR_DECLARE(apr_status_t) apr_proc_detach(void) +APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) { int x; pid_t pgrp; chdir("/"); #if !defined(MPE) && !defined(OS2) && !defined(TPF) && !defined(BEOS) -/* Don't detach for MPE because child processes can't survive the death of - the parent. */ - if ((x = fork()) > 0) - exit(0); - else if (x == -1) { - perror("fork"); - fprintf(stderr, "unable to fork new process\n"); - exit(1); /* we can't do anything here, so just exit. */ + /* Don't detach for MPE because child processes can't survive the death of + * the parent. */ + if (daemonize) { + if ((x = fork()) > 0) { + exit(0); + } + else if (x == -1) { + perror("fork"); + fprintf(stderr, "unable to fork new process\n"); + exit(1); /* we can't do anything here, so just exit. */ + } + /* RAISE_SIGSTOP(DETACH); */ } -/* RAISE_SIGSTOP(DETACH);*/ #endif + #ifdef HAVE_SETSID if ((pgrp = setsid()) == -1) { return errno; From 61e99642b09440051d99247dbfbe6f63a35fbc6b Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 21 Feb 2002 18:46:22 +0000 Subject: [PATCH 3039/7878] Change apr_proc_detach to take a parameter that can enable/disable automatic forking (aka, to "daemonize"). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63045 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 357c4b7f90c..009c5c9aab9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ Changes with APR b1 + + *) Change apr_proc_detach to take a parameter that can enable/disable + automatic forking (aka, to "daemonize"). + [Jos Backus , Aaron Bannert] + *) Implement apr_global_lock_foo() on Win32 [Bill Stoddard] From d4a38e67ec295f3e0b554faf2b833f879db02e56 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Thu, 21 Feb 2002 23:34:10 +0000 Subject: [PATCH 3040/7878] deal with the case where some processors in a product line are ancient and don't have all the support we would like for atomic operations. this is intended for the sparc v7's out there which don't do CAS PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63046 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/.cvsignore | 1 + atomic/solaris_sparc/Makefile.in | 8 ++-- .../apr_atomic_sparc_no_support.c | 5 +++ configure.in | 38 ++++++++++++++++--- include/apr.h.in | 3 ++ include/apr_atomic.h | 22 +++++++---- 6 files changed, 60 insertions(+), 17 deletions(-) create mode 100644 atomic/solaris_sparc/apr_atomic_sparc_no_support.c diff --git a/atomic/solaris_sparc/.cvsignore b/atomic/solaris_sparc/.cvsignore index 06e18a7aafb..1c875e8e26d 100644 --- a/atomic/solaris_sparc/.cvsignore +++ b/atomic/solaris_sparc/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo +*.S .libs diff --git a/atomic/solaris_sparc/Makefile.in b/atomic/solaris_sparc/Makefile.in index 8aac673c224..b0bc31de3b2 100644 --- a/atomic/solaris_sparc/Makefile.in +++ b/atomic/solaris_sparc/Makefile.in @@ -1,19 +1,19 @@ -TARGETS = apr_atomic_sparc.lo +TARGETS = @apr_atomic_sparc_compile@ ASFLAGS += @ASFLAGS@ ASCPPFLAGS = @ASCPPFLAGS@ AS = @AS@ ASCPP = @ASCPP@ +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + apr_atomic_sparc.lo: apr_atomic_sparc.s $(ASCPP) $(ASCPPFLAGS) $*.s > $*.S $(AS) $(ASFLAGS) -o $@ $*.S -# bring in rules.mk for standard functionality -@INCLUDE_RULES@ - DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCDIR=../../include INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) diff --git a/atomic/solaris_sparc/apr_atomic_sparc_no_support.c b/atomic/solaris_sparc/apr_atomic_sparc_no_support.c new file mode 100644 index 00000000000..97b95b139c0 --- /dev/null +++ b/atomic/solaris_sparc/apr_atomic_sparc_no_support.c @@ -0,0 +1,5 @@ +#include "apr.h" +#if APR_FORCE_ATOMIC_GENERIC +#include "../unix/apr_atomic.c" +#else +#endif diff --git a/configure.in b/configure.in index a7241816302..3ec18550485 100644 --- a/configure.in +++ b/configure.in @@ -276,6 +276,14 @@ case "$host:$CC" in APR_SETVAR(AR,ar) ;; esac + +dnl force_atomic_generic flag +dnl this will be set we find a cpu/OS combo +dnl which is historical and doesn't work with the method +dnl we are using for the more up to date cpu/OS +dnl (ie.. old sparcs) +apr_force_atomic_generic=0 + config_subdirs="none" INSTALL_SUBDIRS="none" case $host in @@ -329,18 +337,37 @@ case $host in *sparc*) OSDIR="solaris_sparc" eolstr="\\n" + apr_atomic_sparc_compile=apr_atomic_sparc.lo + sparc_arch=`uname -m` is_gnu_as=`${AS} --help 2>/dev/null | grep gnu.org` if [ -z "$is_gnu_as" ] then - ASFLAGS="-xarch=v8plus -KPIC -q" - ASCPPFLAGS="-D_ASM -D__STDC__=0" + case "$sparc_arch" in + sun4c|sun4m|sun4d|sun4t|sun4) + apr_force_atomic_generic=1 + apr_atomic_sparc_compile=apr_atomic_sparc_no_support.lo + ;; + *) + ASFLAGS="-xarch=v8plus -K PIC" + ASCPPFLAGS="-D_ASM -D__STDC__=0" + ;; + esac else - ASFLAGS="-K pic -P -D_ASM -D__STDC__=0 -xarch=v8plus" - ASCPPFLAGS="" - ASCPP="cat" + case "$sparc_arch" in + sun4c|sun4m|sun4d|sun4t|sun4) + apr_force_atomic_generic=1 + apr_atomic_sparc_compile=apr_atomic_sparc_no_support.lo + ;; + *) + ASFLAGS="-K pic -P -D_ASM -D__STDC__=0 -xarch=v8plus" + ASCPPFLAGS="" + ASCPP="cat" + ;; + esac fi AC_SUBST(ASCPPFLAGS) AC_SUBST(ASFLAGS) + AC_SUBST(apr_atomic_sparc_compile) ;; *) OSDIR="unix" @@ -354,6 +381,7 @@ case $host in ;; esac +AC_SUBST(apr_force_atomic_generic) AC_SUBST(eolstr) AC_SUBST(INSTALL_SUBDIRS) diff --git a/include/apr.h.in b/include/apr.h.in index 46aa0f3a9c2..98a7cccd670 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -255,6 +255,9 @@ typedef @socklen_t_value@ apr_socklen_t; /* And APR_INT64_T_FMT */ @int64_t_fmt@ +/* are we going to force the generic atomic operations */ +#define APR_FORCE_ATOMIC_GENERIC @apr_force_atomic_generic@ + /* Local machine definition for console and log output. */ #define APR_EOL_STR "@eolstr@" diff --git a/include/apr_atomic.h b/include/apr_atomic.h index ec84048406a..e0dbabe2754 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -133,7 +133,13 @@ void apr_atomic_dec(volatile apr_atomic_t *mem); apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #else /* !DOXYGEN */ -#ifdef WIN32 +#if APR_FORCE_ATOMIC_GENERIC +#if APR_HAS_THREADS +#define APR_ATOMIC_NEED_DEFAULT 1 +#define APR_ATOMIC_NEED_CAS_DEFAULT 1 +#endif /* APR_HAS_THREADS */ + +#elif defined(WIN32) #define apr_atomic_t LONG; @@ -209,7 +215,13 @@ apr_uint32_t apr_atomic_cas_sparc(volatile apr_uint32_t *mem, long with, long cm #else #if APR_HAS_THREADS +#define APR_ATOMIC_NEED_DEFAULT 1 +#define APR_ATOMIC_NEED_CAS_DEFAULT 1 +#endif /* APR_HAS_THREADS */ + +#endif /* !defined(WIN32) && !defined(__linux) */ +#if defined(APR_ATOMIC_NEED_DEFAULT) #define apr_atomic_t apr_uint32_t #define apr_atomic_read(p) *p apr_status_t apr_atomic_init(apr_pool_t *p); @@ -217,13 +229,7 @@ void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val); void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val); void apr_atomic_inc(volatile apr_atomic_t *mem); void apr_atomic_dec(volatile apr_atomic_t *mem); - -#define APR_ATOMIC_NEED_DEFAULT 1 -#define APR_ATOMIC_NEED_CAS_DEFAULT 1 - -#endif /* APR_HAS_THREADS */ - -#endif /* !defined(WIN32) && !defined(__linux) */ +#endif #if defined(APR_ATOMIC_NEED_CAS_DEFAULT) apr_status_t apr_atomic_init(apr_pool_t *p); From 1e4cacb5fbab5e1f3f86cd50a4f4fac21a7c1f77 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Thu, 21 Feb 2002 23:44:03 +0000 Subject: [PATCH 3041/7878] all this hard work on atomics should get some credit PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63047 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 009c5c9aab9..3a976e26f2a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) apr-atomic support for old-sparc's and gas on solaris + [Dale Ghent , jean-frederic clere, Ian Holsman] + *) Change apr_proc_detach to take a parameter that can enable/disable automatic forking (aka, to "daemonize"). [Jos Backus , Aaron Bannert] From 259a6620d41d7dcc04164059989d14945a0feed3 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 22 Feb 2002 03:56:03 +0000 Subject: [PATCH 3042/7878] stop autoconf complaining PR: Obtained from: Submitted by: Dale Ghent Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63048 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 3ec18550485..d579f3548b0 100644 --- a/configure.in +++ b/configure.in @@ -340,7 +340,7 @@ case $host in apr_atomic_sparc_compile=apr_atomic_sparc.lo sparc_arch=`uname -m` is_gnu_as=`${AS} --help 2>/dev/null | grep gnu.org` - if [ -z "$is_gnu_as" ] + if test -z "$is_gnu_as" then case "$sparc_arch" in sun4c|sun4m|sun4d|sun4t|sun4) From e3f1c7ec2b0661b3ac902895829f8fe5652f6aa4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 22 Feb 2002 07:05:11 +0000 Subject: [PATCH 3043/7878] Can't be playing in apr.hw without keeping apr.h.in and apr.hnw up to date. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63049 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 5 +++++ libapr.dsp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/apr.dsp b/apr.dsp index af7a1b242ed..605ce58eebd 100644 --- a/apr.dsp +++ b/apr.dsp @@ -461,6 +461,11 @@ SOURCE=.\include\apr.h.in # End Source File # Begin Source File +SOURCE=.\include\apr.hnw +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + SOURCE=.\include\apr.hw !IF "$(CFG)" == "apr - Win32 Release" diff --git a/libapr.dsp b/libapr.dsp index 8827878e98e..ea0c83686df 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -467,6 +467,11 @@ SOURCE=.\include\apr.h.in # End Source File # Begin Source File +SOURCE=.\include\apr.hnw +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + SOURCE=.\include\apr.hw !IF "$(CFG)" == "libapr - Win32 Release" From c21f8c93f02be81aaeae5685d262c7b3eda39d4a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 22 Feb 2002 07:09:26 +0000 Subject: [PATCH 3044/7878] Per Aaron's consent that there is no more rational way to optimize this relationship - allow Win32/Netware [and perhaps, some unix-ish platforms that don't have a 'proc lock not typesafe' construct] to 'borrow' the proc_mutex code. Because the apr_thread_lock_create call differs so significantly, global locks can never be implemented in terms of thread locks [as well as the converse.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63050 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 3 +++ include/apr.hnw | 2 ++ include/apr.hw | 3 +++ include/apr_global_mutex.h | 20 ++++++++++++++++++++ 4 files changed, 28 insertions(+) diff --git a/include/apr.h.in b/include/apr.h.in index 98a7cccd670..22aa40dfa0e 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -258,6 +258,9 @@ typedef @socklen_t_value@ apr_socklen_t; /* are we going to force the generic atomic operations */ #define APR_FORCE_ATOMIC_GENERIC @apr_force_atomic_generic@ +/* ### aught to actual deploy this for OS2? */ +#define APR_PROC_MUTEX_IS_GLOBAL 0 + /* Local machine definition for console and log output. */ #define APR_EOL_STR "@eolstr@" diff --git a/include/apr.hnw b/include/apr.hnw index 882cf0c328a..1fa3e2b2f6b 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -256,6 +256,8 @@ typedef unsigned short nuint16; #define LOBYTE NGetLo8 #endif +/* PROC mutex is a GLOBAL mutex on Netware */ +#define APR_PROC_MUTEX_IS_GLOBAL 1 /* Definitions that APR programs need to work properly. */ diff --git a/include/apr.hw b/include/apr.hw index 82f3d20f48e..2935f37d181 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -410,6 +410,9 @@ typedef struct apr_lock_t apr_lock_t; /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" +/* No difference between PROC and GLOBAL mutex */ +#define APR_PROC_MUTEX_IS_GLOBAL 1 + typedef int apr_wait_t; /* struct iovec is needed to emulate Unix writev */ diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index 56e39bad407..fc5a0b3b681 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -75,6 +75,8 @@ extern "C" { * @{ */ +#if !APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN) + typedef struct apr_global_mutex_t apr_global_mutex_t; /* Function definitions */ @@ -157,6 +159,24 @@ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex); */ APR_POOL_DECLARE_ACCESSOR(global_mutex); +#else /* APR_PROC_MUTEX_IS_GLOBAL */ + +/* Some platforms [e.g. Win32] have cross process locks that are truly + * global locks, since there isn't the concept of cross-process locks. + * Define these platforms in terms of an apr_proc_mutex_t. + */ + +#define apr_global_mutex_t apr_proc_mutex_t +#define apr_global_mutex_create apr_proc_mutex_create +#define apr_global_mutex_child_init apr_proc_mutex_child_init +#define apr_global_mutex_lock apr_proc_mutex_lock +#define apr_global_mutex_trylock apr_proc_mutex_trylock +#define apr_global_mutex_unlock apr_proc_mutex_unlock +#define apr_global_mutex_destroy apr_proc_mutex_destroy +#define apr_global_mutex_pool_get apr_proc_mutex_pool_get + +#endif + #ifdef __cplusplus } #endif From 24b5c6d5aefff79004271769fe1f07238fe61ca9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 22 Feb 2002 07:11:29 +0000 Subject: [PATCH 3045/7878] No actual global_mutex implementation on Win32, it's simply a proc_lock. Same commit needed for Netware - though I don't that build structure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63051 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 -- libapr.dsp | 4 -- locks/win32/global_mutex.c | 102 ------------------------------------- 3 files changed, 110 deletions(-) delete mode 100644 locks/win32/global_mutex.c diff --git a/apr.dsp b/apr.dsp index 605ce58eebd..eb251b9d836 100644 --- a/apr.dsp +++ b/apr.dsp @@ -170,10 +170,6 @@ SOURCE=.\i18n\unix\xlate.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\locks\win32\global_mutex.c -# End Source File -# Begin Source File - SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index ea0c83686df..abffb763f7e 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -176,10 +176,6 @@ SOURCE=.\i18n\unix\xlate.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\locks\win32\global_mutex.c -# End Source File -# Begin Source File - SOURCE=.\locks\win32\locks.c # End Source File # Begin Source File diff --git a/locks/win32/global_mutex.c b/locks/win32/global_mutex.c deleted file mode 100644 index 95e6e461cec..00000000000 --- a/locks/win32/global_mutex.c +++ /dev/null @@ -1,102 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr.h" -#include "apr_lock.h" -#include "apr_strings.h" -#include "apr_global_mutex.h" -#include "proc_mutex.h" - -APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, - const char *fname, - apr_lockmech_e mech, - apr_pool_t *pool) -{ - return apr_proc_mutex_create((apr_proc_mutex_t **) mutex, fname, mech, pool); -} - -APR_DECLARE(apr_status_t) apr_global_mutex_child_init( - apr_global_mutex_t **mutex, - const char *fname, - apr_pool_t *pool) -{ - return apr_proc_mutex_child_init((apr_proc_mutex_t**) mutex, fname, pool); -} - -APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) -{ - return apr_proc_mutex_lock((apr_proc_mutex_t*) mutex); -} - -APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) -{ - return apr_proc_mutex_trylock((apr_proc_mutex_t* )mutex); -} - -APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) -{ - return apr_proc_mutex_unlock((apr_proc_mutex_t*) mutex); -} - -APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) -{ - return apr_proc_mutex_destroy((apr_proc_mutex_t*) mutex); -} - -APR_DECLARE(apr_pool_t*) apr_global_mutex_pool_get(const apr_global_mutex_t *mutex) -{ - return apr_proc_mutex_pool_get((apr_proc_mutex_t*) mutex); -} - - From 8240d917867ee4ad001731ad37d538f251ffac54 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 22 Feb 2002 15:47:24 +0000 Subject: [PATCH 3046/7878] Removed global_mutex.c and added netware/filestat.c to the project git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63052 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 177515 -> 177460 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 9dd7ab99f771a890999758d955dd4449df19542b..99eb16cadf9009354680398be59a1b49259032cc 100644 GIT binary patch delta 91338 zcmY(q1ymeO6E+$=I0OqGAPMfS8-fORcXxLiTta{l+%0&3;2Kzh23-OKhsE7>VS&5v zcmH$lfA{oO_jK1&HQifPT{Am#c!1S(fEC(=G^PPC$mp;Y()lEGm?OR5O2&SH^Wwz| zCwmKXHxCzI4rfcZqdd$Y;#uk;TR{xLNH>N9`of0Fvk>H^x61+V_T?h z%t1N*hfP9K(;8c0r>;&|V^KZZ@-HC1#-K(Aj8ai^-J;{XfBL-od_3VI@Xb!me63(I z2{w@f2sZM%u0HfQ+Pr!h^GiS49LM|hAQ7)9Iqleil~RuR>jF{SzN|E7CRVJ6F&U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h9V-Qey^u-FKr5v{=tn&C}Rp1rUUQyQ> zMF>Wh3wVZ7!za;C8YP_03!L5|`Z$G|6#in7Cm*Slngg zq5f+}K`6yf-h=r3FZnM=Ll<8gbDif57+Y1~yh?Chz{kQ8*>CIX74dh{fItyIhH;*n zy>^q>t#iPLH&=54h$Dv6|55r0z>|K2ImIo0{UH30J^5=4)7(#~S(E4rm`w3JTkk%G z2^ZxUOherYDB_trKKlC!UFIue?%`o}%34(@;S)Uw7nPJd!>2B%SKj`T!DHq{=-tuv zVWON-7C}bu@elu3JrX(_e}LRvY4Q;JG%rN1yHw3_OBz&!U5AijT!XdBg3K#xw8pJE ZL<-xjOlFhSc}tDfdu_%Wtq};s{{f+CJxBlm From c62165a2b53f4ee827f6058c52f679a7091ad04d Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 22 Feb 2002 15:51:17 +0000 Subject: [PATCH 3047/7878] Added APIs for storing the global memory pool and the stat cache git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63053 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_private.h | 6 ++++ misc/netware/libprews.c | 51 ++++++++++++++++++++++++++++++ misc/netware/start.c | 1 + 3 files changed, 58 insertions(+) diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 66483d312ae..43575521b65 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -168,6 +168,12 @@ extern void *gLibHandle; int register_NLM(void *NLMHandle); int unregister_NLM(void *NLMHandle); +/* Application global data management */ +int setGlobalPool(void *data); +void* getGlobalPool(); +int setStatCache(void *data); +void* getStatCache(); + /* Redefine malloc to use the library malloc call so that all of the memory resources will be owned and can be shared by the library. */ diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index c1181d4706a..342ff2aea7a 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -17,6 +17,8 @@ typedef struct app_data { int initialized; + void* gPool; + void* statCache; } APP_DATA; /* library-private data...*/ @@ -147,3 +149,52 @@ int DisposeLibraryData(void *data) return 0; } +int setGlobalPool(void *data) +{ + APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); + + NXLock(gLibLock); + + if (app_data && !app_data->gPool) { + app_data->gPool = data; + } + + NXUnlock(gLibLock); + return 1; +} + +void* getGlobalPool() +{ + APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); + + if (app_data) { + return app_data->gPool; + } + + return NULL; +} + +int setStatCache(void *data) +{ + APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); + + NXLock(gLibLock); + + if (app_data && !app_data->statCache) { + app_data->statCache = data; + } + + NXUnlock(gLibLock); + return 1; +} + +void* getStatCache() +{ + APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); + + if (app_data) { + return app_data->statCache; + } + + return NULL; +} diff --git a/misc/netware/start.c b/misc/netware/start.c index dfef0740389..1b92fae2ff6 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -109,6 +109,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) } apr_signal_init(pool); + setGlobalPool((void*)pool); return APR_SUCCESS; } From c1b373df6ae1467facc7cf1cad2c72d74783b265 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 22 Feb 2002 15:51:49 +0000 Subject: [PATCH 3048/7878] NetWare version of filestat.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63054 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 300 +++++++++++++++++++++++++++++++++++++ 1 file changed, 300 insertions(+) create mode 100644 file_io/netware/filestat.c diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c new file mode 100644 index 00000000000..2d0a74b6361 --- /dev/null +++ b/file_io/netware/filestat.c @@ -0,0 +1,300 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "fileio.h" +#include "apr_file_io.h" +#include "apr_general.h" +#include "apr_strings.h" +#include "apr_errno.h" +#include "apr_hash.h" + +static apr_filetype_e filetype_from_mode(mode_t mode) +{ + apr_filetype_e type = APR_NOFILE; + + if (S_ISREG(mode)) + type = APR_REG; + if (S_ISDIR(mode)) + type = APR_DIR; + if (S_ISCHR(mode)) + type = APR_CHR; + if (S_ISBLK(mode)) + type = APR_BLK; + if (S_ISFIFO(mode)) + type = APR_PIPE; + if (S_ISLNK(mode)) + type = APR_LNK; + if (S_ISSOCK(mode)) + type = APR_SOCK; + return type; +} + +static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, + apr_int32_t wanted) +{ + finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK; + finfo->protection = apr_unix_mode2perms(info->st_mode); + finfo->filetype = filetype_from_mode(info->st_mode); + finfo->user = info->st_uid; + finfo->group = info->st_gid; + finfo->size = info->st_size; + finfo->inode = info->st_ino; + finfo->device = info->st_dev; + finfo->nlink = info->st_nlink; + apr_ansi_time_to_apr_time(&finfo->atime, info->st_atime); + apr_ansi_time_to_apr_time(&finfo->mtime, info->st_mtime); + apr_ansi_time_to_apr_time(&finfo->ctime, info->st_ctime); + /* ### needs to be revisited + * if (wanted & APR_FINFO_CSIZE) { + * finfo->csize = info->st_blocks * 512; + * finfo->valid |= APR_FINFO_CSIZE; + * } + */ +} + +APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, + apr_int32_t wanted, + apr_file_t *thefile) +{ + struct stat info; + + if (fstat(thefile->filedes, &info) == 0) { + finfo->cntxt = thefile->cntxt; + finfo->fname = thefile->fname; + fill_out_finfo(finfo, &info, wanted); + return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; + } + else { + return errno; + } +} + +APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, + apr_fileperms_t perms) +{ + mode_t mode = apr_unix_perms2mode(perms); + + if (chmod(fname, mode) == -1) + return errno; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, + apr_fileattrs_t attributes, + apr_fileattrs_t attr_mask, + apr_pool_t *cont) +{ + apr_status_t status; + apr_finfo_t finfo; + + status = apr_stat(&finfo, fname, APR_FINFO_PROT, cont); + if (!APR_STATUS_IS_SUCCESS(status)) + return status; + + /* ### TODO: should added bits be umask'd? */ + if (attr_mask & APR_FILE_ATTR_READONLY) + { + if (attributes & APR_FILE_ATTR_READONLY) + { + finfo.protection &= ~APR_UWRITE; + finfo.protection &= ~APR_GWRITE; + finfo.protection &= ~APR_WWRITE; + } + else + { + /* ### umask this! */ + finfo.protection |= APR_UWRITE; + finfo.protection |= APR_GWRITE; + finfo.protection |= APR_WWRITE; + } + } + + if (attr_mask & APR_FILE_ATTR_EXECUTABLE) + { + if (attributes & APR_FILE_ATTR_EXECUTABLE) + { + /* ### umask this! */ + finfo.protection |= APR_UEXECUTE; + finfo.protection |= APR_GEXECUTE; + finfo.protection |= APR_WEXECUTE; + } + else + { + finfo.protection &= ~APR_UEXECUTE; + finfo.protection &= ~APR_GEXECUTE; + finfo.protection &= ~APR_WEXECUTE; + } + } + + return apr_file_perms_set(fname, finfo.protection); +} + +typedef struct apr_stat_entry_t apr_stat_entry_t; + +struct apr_stat_entry_t { + struct stat info; + apr_time_t expire; +}; + +int cstat (const char *path, struct stat *buf) +{ + apr_hash_t *statCache = (apr_hash_t *)getStatCache(); + apr_pool_t *gPool = (apr_pool_t *)getGlobalPool(); + apr_stat_entry_t *stat_entry; + struct stat *info; + apr_time_t now = apr_time_now(); + char *key; + int ret; + int found = 0; + + if (!statCache && gPool) { + statCache = apr_hash_make(gPool); + setStatCache((void*)statCache); + } + + if (statCache) { + stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, path, APR_HASH_KEY_STRING); + if (stat_entry) { + if ((now - stat_entry->expire) > APR_USEC_PER_SEC) { + apr_hash_set(statCache, path, APR_HASH_KEY_STRING, NULL); + } + else { + memcpy (buf, &(stat_entry->info), sizeof(struct stat)); + found = 1; + } + } + + if (!found) { + ret = stat(path, buf); + if (ret == 0) { + key = apr_pstrdup (gPool, path); + stat_entry = apr_palloc (gPool, sizeof(apr_stat_entry_t)); + memcpy (&(stat_entry->info), buf, sizeof(struct stat)); + stat_entry->expire = now; + apr_hash_set(statCache, key, APR_HASH_KEY_STRING, stat_entry); + } + else + return ret; + } + } + else { + return stat(path, buf); + } + return 0; +} + +APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, + const char *fname, + apr_int32_t wanted, apr_pool_t *cont) +{ + struct stat info; + int srv; + + srv = cstat(fname, &info); + + if (srv == 0) { + finfo->cntxt = cont; + finfo->fname = fname; + fill_out_finfo(finfo, &info, wanted); + if (wanted & APR_FINFO_LINK) + wanted &= ~APR_FINFO_LINK; + if (wanted & APR_FINFO_NAME) { + finfo->name = apr_pstrdup(cont, info.st_name); + finfo->valid |= APR_FINFO_NAME; + } + return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; + } + else { +#if !defined(ENOENT) || !defined(ENOTDIR) +#error ENOENT || ENOTDIR not defined; please see the +#error comments at this line in the source for a workaround. + /* + * If ENOENT || ENOTDIR is not defined in one of the your OS's + * include files, APR cannot report a good reason why the stat() + * of the file failed; there are cases where it can fail even though + * the file exists. This opens holes in Apache, for example, because + * it becomes possible for someone to get a directory listing of a + * directory even though there is an index (eg. index.html) file in + * it. If you do not have a problem with this, delete the above + * #error lines and start the compile again. If you need to do this, + * please submit a bug report to http://www.apache.org/bug_report.html + * letting us know that you needed to do this. Please be sure to + * include the operating system you are using. + */ + /* WARNING: All errors will be handled as not found + */ +#if !defined(ENOENT) + return APR_ENOENT; +#else + /* WARNING: All errors but not found will be handled as not directory + */ + if (errno != ENOENT) + return APR_ENOENT; + else + return errno; +#endif +#else /* All was defined well, report the usual: */ + return errno; +#endif + } +} + +/* Perhaps this becomes nothing but a macro? + */ +APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, + apr_int32_t wanted, apr_pool_t *cont) +{ + return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, cont); +} + From 246911cb878a0da51ed35f221e3e4383f6a5dda3 Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" Date: Fri, 22 Feb 2002 15:55:23 +0000 Subject: [PATCH 3049/7878] Set the port values in apr_os_sock_make git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63055 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 2 ++ network_io/unix/sockets.c | 2 ++ network_io/win32/sockets.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 1241e678f30..f0e183dba60 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -278,6 +278,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, memcpy(&(*apr_sock)->local_addr->sa.sin, os_sock_info->local, (*apr_sock)->local_addr->salen); + (*apr_sock)->local_addr->port = ntohs((*apr_sock)->local_addr->sa.sin.sin_port); } else { (*apr_sock)->local_port_unknown = (*apr_sock)->local_interface_unknown = 1; @@ -286,6 +287,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, memcpy(&(*apr_sock)->remote_addr->sa.sin, os_sock_info->remote, (*apr_sock)->remote_addr->salen); + (*apr_sock)->remote_addr->port = ntohs((*apr_sock)->remote_addr->sa.sin.sin_port); } apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 5b8817c0344..46415f6045d 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -358,6 +358,7 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, memcpy(&(*apr_sock)->local_addr->sa.sin, os_sock_info->local, (*apr_sock)->local_addr->salen); + (*apr_sock)->local_addr->port = ntohs((*apr_sock)->local_addr->sa.sin.sin_port); } else { (*apr_sock)->local_port_unknown = (*apr_sock)->local_interface_unknown = 1; @@ -369,6 +370,7 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, memcpy(&(*apr_sock)->remote_addr->sa.sin, os_sock_info->remote, (*apr_sock)->remote_addr->salen); + (*apr_sock)->remote_addr->port = ntohs((*apr_sock)->remote_addr->sa.sin.sin_port); } (*apr_sock)->inherit = 0; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 389eccd613b..63c238402a8 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -390,6 +390,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, os_sock_info->local, (*apr_sock)->local_addr->salen); (*apr_sock)->local_addr->pool = cont; + (*apr_sock)->local_addr->port = ntohs((*apr_sock)->local_addr->sa.sin.sin_port); } else { (*apr_sock)->local_port_unknown = (*apr_sock)->local_interface_unknown = 1; @@ -399,6 +400,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, os_sock_info->remote, (*apr_sock)->remote_addr->salen); (*apr_sock)->remote_addr->pool = cont; + (*apr_sock)->remote_addr->port = ntohs((*apr_sock)->remote_addr->sa.sin.sin_port); } apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), From d0936e1075401136b3ded033b1e01f94846a030f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 22 Feb 2002 16:34:11 +0000 Subject: [PATCH 3050/7878] Removed global_mutex.c since global mutexes on NetWare have been mapped to proc mutexes in apr_global_mutex.h. Global mutexes on NetWare are the same as proc mutexes and thread mutexes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63056 13f79535-47bb-0310-9956-ffa450edef68 --- locks/netware/global_mutex.c | 119 ----------------------------------- 1 file changed, 119 deletions(-) delete mode 100644 locks/netware/global_mutex.c diff --git a/locks/netware/global_mutex.c b/locks/netware/global_mutex.c deleted file mode 100644 index ef385bb8149..00000000000 --- a/locks/netware/global_mutex.c +++ /dev/null @@ -1,119 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr.h" -#include "apr_strings.h" -#include "global_mutex.h" -#include "apr_thread_mutex.h" - -APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, - const char *fname, - apr_lockmech_e mech, - apr_pool_t *pool) -{ - apr_status_t ret; - apr_global_mutex_t *new_mutex = NULL; - new_mutex = (apr_global_mutex_t *)apr_pcalloc(pool, sizeof(apr_global_mutex_t)); - - if(new_mutex ==NULL) { - return APR_ENOMEM; - } - - new_mutex->pool = pool; - ret = apr_thread_mutex_create(&(new_mutex->mutex), APR_THREAD_MUTEX_DEFAULT, pool); - - if (ret == APR_SUCCESS) - *mutex = new_mutex; - - return ret; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_child_init( - apr_global_mutex_t **mutex, - const char *fname, - apr_pool_t *pool) -{ - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) -{ - if (mutex) - return apr_thread_mutex_lock(mutex->mutex); - return APR_ENOLOCK; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) -{ - if (mutex) - return apr_thread_mutex_trylock(mutex->mutex); - return APR_ENOLOCK; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) -{ - if (mutex) - return apr_thread_mutex_unlock(mutex->mutex); - return APR_ENOLOCK; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) -{ - if (mutex) - return apr_thread_mutex_destroy(mutex->mutex); - return APR_ENOLOCK; -} - -APR_POOL_IMPLEMENT_ACCESSOR(global_mutex) - From ab2683f5310a0c1713e28f6d3dca94d9bf8bd69e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 22 Feb 2002 20:04:21 +0000 Subject: [PATCH 3051/7878] Removed the NetWare #ifdef's. NetWare has its own version of filestat.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63057 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index d46640e40fd..f42b9b64f1a 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -84,12 +84,8 @@ static apr_filetype_e filetype_from_mode(mode_t mode) static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, apr_int32_t wanted) { -#ifdef NETWARE - finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK; -#else finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK | APR_FINFO_OWNER | APR_FINFO_PROT; -#endif finfo->protection = apr_unix_mode2perms(info->st_mode); finfo->filetype = filetype_from_mode(info->st_mode); finfo->user = info->st_uid; @@ -204,12 +200,6 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, fill_out_finfo(finfo, &info, wanted); if (wanted & APR_FINFO_LINK) wanted &= ~APR_FINFO_LINK; -#ifdef NETWARE - if (wanted & APR_FINFO_NAME) { - finfo->name = apr_pstrdup(cont, info.st_name); - finfo->valid |= APR_FINFO_NAME; - } -#endif return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; } else { From de567ab68e2af6f4b94db9b2d359c06551b16be8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 22 Feb 2002 20:12:27 +0000 Subject: [PATCH 3052/7878] add a little reminder that in this new code, as in existing code, we assume that sin_port and sin6_port are at the same offset git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63058 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 2 ++ network_io/unix/sockets.c | 2 ++ network_io/win32/sockets.c | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index f0e183dba60..5a421ab2f81 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -278,6 +278,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, memcpy(&(*apr_sock)->local_addr->sa.sin, os_sock_info->local, (*apr_sock)->local_addr->salen); + /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ (*apr_sock)->local_addr->port = ntohs((*apr_sock)->local_addr->sa.sin.sin_port); } else { @@ -287,6 +288,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, memcpy(&(*apr_sock)->remote_addr->sa.sin, os_sock_info->remote, (*apr_sock)->remote_addr->salen); + /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ (*apr_sock)->remote_addr->port = ntohs((*apr_sock)->remote_addr->sa.sin.sin_port); } diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 46415f6045d..ecda7c7a6dd 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -358,6 +358,7 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, memcpy(&(*apr_sock)->local_addr->sa.sin, os_sock_info->local, (*apr_sock)->local_addr->salen); + /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ (*apr_sock)->local_addr->port = ntohs((*apr_sock)->local_addr->sa.sin.sin_port); } else { @@ -370,6 +371,7 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, memcpy(&(*apr_sock)->remote_addr->sa.sin, os_sock_info->remote, (*apr_sock)->remote_addr->salen); + /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ (*apr_sock)->remote_addr->port = ntohs((*apr_sock)->remote_addr->sa.sin.sin_port); } diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 63c238402a8..45eb6aaac3d 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -390,6 +390,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, os_sock_info->local, (*apr_sock)->local_addr->salen); (*apr_sock)->local_addr->pool = cont; + /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ (*apr_sock)->local_addr->port = ntohs((*apr_sock)->local_addr->sa.sin.sin_port); } else { @@ -400,6 +401,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, os_sock_info->remote, (*apr_sock)->remote_addr->salen); (*apr_sock)->remote_addr->pool = cont; + /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ (*apr_sock)->remote_addr->port = ntohs((*apr_sock)->remote_addr->sa.sin.sin_port); } @@ -432,4 +434,4 @@ APR_DECLARE_SET_INHERIT(socket) { APR_DECLARE_UNSET_INHERIT(socket) { return; -} \ No newline at end of file +} From 7a0e25475ba33fd18f76510bd8489ef4b5b34344 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 23 Feb 2002 12:00:48 +0000 Subject: [PATCH 3053/7878] OS/2: Use APR_PROC_MUTEX_IS_GLOBAL to provide global mutex as an alias for proc mutex. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63059 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 ++ include/apr.h.in | 4 +- locks/os2/Makefile.in | 3 +- locks/os2/global_mutex.c | 95 ---------------------------------------- 4 files changed, 6 insertions(+), 99 deletions(-) delete mode 100644 locks/os2/global_mutex.c diff --git a/configure.in b/configure.in index d579f3548b0..24241bf1911 100644 --- a/configure.in +++ b/configure.in @@ -283,6 +283,7 @@ dnl which is historical and doesn't work with the method dnl we are using for the more up to date cpu/OS dnl (ie.. old sparcs) apr_force_atomic_generic=0 +proc_mutex_is_global=0 config_subdirs="none" INSTALL_SUBDIRS="none" @@ -300,6 +301,7 @@ case $host in enable_threads="system_threads" eolstr="\\r\\n" file_as_socket="0" + proc_mutex_is_global=1 ;; *beos*) OSDIR="beos" @@ -382,6 +384,7 @@ case $host in esac AC_SUBST(apr_force_atomic_generic) +AC_SUBST(proc_mutex_is_global) AC_SUBST(eolstr) AC_SUBST(INSTALL_SUBDIRS) diff --git a/include/apr.h.in b/include/apr.h.in index 22aa40dfa0e..303988d5487 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -258,8 +258,8 @@ typedef @socklen_t_value@ apr_socklen_t; /* are we going to force the generic atomic operations */ #define APR_FORCE_ATOMIC_GENERIC @apr_force_atomic_generic@ -/* ### aught to actual deploy this for OS2? */ -#define APR_PROC_MUTEX_IS_GLOBAL 0 +/* Does the proc mutex lock threads too */ +#define APR_PROC_MUTEX_IS_GLOBAL @proc_mutex_is_global@ /* Local machine definition for console and log output. */ #define APR_EOL_STR "@eolstr@" diff --git a/locks/os2/Makefile.in b/locks/os2/Makefile.in index 3d63592cf2c..590514d76b6 100644 --- a/locks/os2/Makefile.in +++ b/locks/os2/Makefile.in @@ -3,8 +3,7 @@ TARGETS = locks.lo \ thread_mutex.lo \ thread_rwlock.lo \ thread_cond.lo \ - proc_mutex.lo \ - global_mutex.lo + proc_mutex.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/os2/global_mutex.c b/locks/os2/global_mutex.c deleted file mode 100644 index 24f73b1c230..00000000000 --- a/locks/os2/global_mutex.c +++ /dev/null @@ -1,95 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr.h" -#include "apr_strings.h" - -APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, - const char *fname, - apr_lockmech_e mech, - apr_pool_t *pool) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_child_init( - apr_global_mutex_t **mutex, - const char *fname, - apr_pool_t *pool) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) -{ - return APR_ENOTIMPL; -} - -APR_POOL_IMPLEMENT_ACCESSOR(global_mutex) - From 83d90a45e907e7666cabb790935aa0c8136f5686 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 23 Feb 2002 12:04:42 +0000 Subject: [PATCH 3054/7878] OS/2: Fix APR locating script to take into account that scripts don't pass test -x on OS/2 as there's no x attribute to distinguish them from plain text files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63060 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 17e6b80d4f1..ee3b175a912 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -38,6 +38,13 @@ dnl AC_DEFUN(APR_FIND_APR, [ apr_found="no" + if test "$ac_cv_emxos2" = "yes"; then + # Scripts don't pass test -x on OS/2 + TEST_X="test -f" + else + TEST_X="test -x" + fi + AC_MSG_CHECKING(for APR) AC_ARG_WITH(apr, [ --with-apr=DIR|FILE prefix for installed APR, path to APR build tree, @@ -47,13 +54,13 @@ AC_DEFUN(APR_FIND_APR, [ AC_MSG_ERROR([--with-apr requires a directory to be provided]) fi - if test -x "$withval/bin/apr-config"; then + if $TEST_X "$withval/bin/apr-config"; then apr_found="yes" apr_config="$withval/bin/apr-config" - elif test -x "$withval/apr-config"; then + elif $TEST_X "$withval/apr-config"; then apr_found="yes" apr_config="$withval/apr-config" - elif test -x "$withval" && $withval --help > /dev/null 2>&1 ; then + elif $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then apr_found="yes" apr_config="$withval" fi @@ -71,7 +78,7 @@ build directory, or an apr-config file.]) else dnl look in some standard places (apparently not in builtin/default) for lookdir in /usr /usr/local /opt/apr ; do - if test -x "$lookdir/bin/apr-config"; then + if $TEST_X "$lookdir/bin/apr-config"; then apr_found="yes" apr_config="$lookdir/bin/apr-config" break From ee7cd74e610ee74d5fecfeade4b1608a6c1dbb39 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Mon, 25 Feb 2002 16:55:10 +0000 Subject: [PATCH 3055/7878] The test was reverted but I did not noticed it until I remove cpp for my path. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63061 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 24241bf1911..08be0290380 100644 --- a/configure.in +++ b/configure.in @@ -342,7 +342,7 @@ case $host in apr_atomic_sparc_compile=apr_atomic_sparc.lo sparc_arch=`uname -m` is_gnu_as=`${AS} --help 2>/dev/null | grep gnu.org` - if test -z "$is_gnu_as" + if test -n "$is_gnu_as" then case "$sparc_arch" in sun4c|sun4m|sun4d|sun4t|sun4) From 84b1f6153069b8c6717997d2306ce32177778aa0 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 25 Feb 2002 22:36:28 +0000 Subject: [PATCH 3056/7878] Fixed a memory leak in the stat caching function so that it reuses the stat cache structure rather than allocating a new one each time the structure expires. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63062 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 62 ++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 2d0a74b6361..93de042863b 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -58,6 +58,9 @@ #include "apr_strings.h" #include "apr_errno.h" #include "apr_hash.h" +#ifdef USE_CSTAT_MUTEX +#include "apr_thread_mutex.h" +#endif static apr_filetype_e filetype_from_mode(mode_t mode) { @@ -187,9 +190,22 @@ struct apr_stat_entry_t { apr_time_t expire; }; +typedef struct apr_stat_cache_t apr_stat_cache_t; + +struct apr_stat_cache_t { + apr_hash_t *statCache; +#ifdef USE_CSTAT_MUTEX + apr_thread_mutex_t *statcache_mutex; +#endif +}; + int cstat (const char *path, struct stat *buf) { - apr_hash_t *statCache = (apr_hash_t *)getStatCache(); + apr_stat_cache_t *statCacheData = (apr_stat_cache_t *)getStatCache(); + apr_hash_t *statCache = NULL; +#ifdef USE_CSTAT_MUTEX + apr_thread_mutex_t *statcache_mutex; +#endif apr_pool_t *gPool = (apr_pool_t *)getGlobalPool(); apr_stat_entry_t *stat_entry; struct stat *info; @@ -198,18 +214,36 @@ int cstat (const char *path, struct stat *buf) int ret; int found = 0; - if (!statCache && gPool) { + if (!gPool) + return stat(path, buf); + + if (!statCacheData) { + statCacheData = (apr_stat_cache_t *)apr_palloc (gPool, sizeof(apr_stat_cache_t)); statCache = apr_hash_make(gPool); - setStatCache((void*)statCache); +#ifdef USE_CSTAT_MUTEX + apr_thread_mutex_create(&statcache_mutex, APR_THREAD_MUTEX_DEFAULT, gPool); + statCacheData->statcache_mutex = statcache_mutex; +#endif + statCacheData->statCache = statCache; + setStatCache((void*)statCacheData); + } + else { + statCache = statCacheData->statCache; +#ifdef USE_CSTAT_MUTEX + statcache_mutex = statCacheData->statcache_mutex; +#endif } if (statCache) { +#ifdef USE_CSTAT_MUTEX + apr_thread_mutex_lock(statcache_mutex); +#endif stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, path, APR_HASH_KEY_STRING); +#ifdef USE_CSTAT_MUTEX + apr_thread_mutex_unlock(statcache_mutex); +#endif if (stat_entry) { - if ((now - stat_entry->expire) > APR_USEC_PER_SEC) { - apr_hash_set(statCache, path, APR_HASH_KEY_STRING, NULL); - } - else { + if ((now - stat_entry->expire) <= APR_USEC_PER_SEC) { memcpy (buf, &(stat_entry->info), sizeof(struct stat)); found = 1; } @@ -218,11 +252,19 @@ int cstat (const char *path, struct stat *buf) if (!found) { ret = stat(path, buf); if (ret == 0) { - key = apr_pstrdup (gPool, path); - stat_entry = apr_palloc (gPool, sizeof(apr_stat_entry_t)); + if (!stat_entry) { + key = apr_pstrdup (gPool, path); + stat_entry = apr_palloc (gPool, sizeof(apr_stat_entry_t)); +#ifdef USE_CSTAT_MUTEX + apr_thread_mutex_lock(statcache_mutex); +#endif + apr_hash_set(statCache, key, APR_HASH_KEY_STRING, stat_entry); +#ifdef USE_CSTAT_MUTEX + apr_thread_mutex_unlock(statcache_mutex); +#endif + } memcpy (&(stat_entry->info), buf, sizeof(struct stat)); stat_entry->expire = now; - apr_hash_set(statCache, key, APR_HASH_KEY_STRING, stat_entry); } else return ret; From 5da06e870163a026c787b8616577ec2ce5bd9e2f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 26 Feb 2002 21:08:43 +0000 Subject: [PATCH 3057/7878] Updated the test projects to 4 byte alignment and added some new tests git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63063 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 177460 -> 199488 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 99eb16cadf9009354680398be59a1b49259032cc..cb39479a949a822358ccb95c8c1981ece53e85f8 100644 GIT binary patch delta 109653 zcma&Nby!qg)HrG(3IZYm(yt;Q9Yd#zG>C|R5d_WzT^9T_qpG5|M~sSGjsMi>#V)b?7i1sJr(ODO>y@a-l*NY_3+w_Yj>{gIvMbQ z1!q6}%)5RqjgR`;{rI7Z8&tsNG_fhwC=2nf8mFK5HEN;=s{4-mH!^Ny^OCrC(-htx zj=4R_&d%8yN<}Pmi~4xRZ>OOe@3qr#+=RH=nT7z4lkB#Wfj9bgj<3@E6HUNQ^?p0k z({)};vT1d(W{)6D!Gh~>r;cQcI=WUQC_-kEUeTb?UH-|G-k*eJl3PGM>Qni%xugx3 zkcf9-X12kC^cYCP-dD_}#M{ksiRIRJmk&f&xyd(Hl!xe}6Gpb-{Y`T4sgI8$*JpF} z<;Kus6d0~^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BYIUn=o0Br+sOzx8A0$L^cX#zs%HZ@@{elD_UoyBsB*zY}-jI`5?n@B6+& z!oGGLr#Q8>9y^C?G+Qjso}-zhw6|vNA7HIF35rF%+lAT(gz>IiXenb^+Q|L03-w^- zkso|lBQ`p+@`*Jw5j&pLXs6_yx=f1>miN5;)VJr5v5qu1e97JWXk8o-a+G_%(EZ-g z;P$%jF@dP0M6DFev>R=@@XFWoDSGX;sID!1)(I<5_*{+=!$4FEbtWHS*cWUQwx&Ih ztwu~ju9WcL{r9yOnwV!$<5^v*>M1p`I^p@_@}U#wCHL9>Z8GV~Dfc~lh&1_$Dsn!h zvpr3hH{N0GnYdi0V-$!|8XY>HxsNRKB)C*gGsSC@-C-y6R@F+Wi4%s<>eunLhJCY9 zIHgDQyuhQ%vC(le(XV#8l-Al~rcL3?Ed*$!IJN_i$35i?)2(Nur#UrzM#Lh<*m*xH zyjzMXYHzJ@5kr;JjX#G;^L;BOxTf28+{(@OXkxpLVA`K=|MBL))kDU{GGU=$Z)vU5 z;>nSL^%D99M{z%Z+fEvcBKQ{H!%nSGxNoBKy7Z?tJA#9z1@{K7N_Z&HM%GKzjI~qN z+I^$1FeWaoA0GH|3<_$RnYg4jz;nVR$CDb>ywcQDQrgFjR~oRsz)Roaz4AmkY#y9W zNPDl)cprDH;ecjJZ@aYdS_8I%t~>DKM2yYJx$2llzA=ax(~~4;1Es$6jWE&^LDT`A z6n1=f`8Gm#`CpvdB0C=&o-JbNR=>30_P=JFXjbpO?bd&_+h@t_-!8YSwEnOE{qKMO E2V`IZxBvhE From cac7855bc1d4886e6baaae0c4f17c35a5684b6be Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 26 Feb 2002 21:09:16 +0000 Subject: [PATCH 3058/7878] Added NETWARE to the WIN32 #ifdef git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63064 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index 8c7edd9a19e..67c87788589 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -65,7 +65,7 @@ #include #endif -#ifndef WIN32 +#if !(defined WIN32) && !(defined NETWARE) #include #endif @@ -230,7 +230,7 @@ int main(int argc, char**argv) printf("APR Simple Thread Test\n======================\n\n"); -#ifndef WIN32 +#if !(defined WIN32) && !(defined NETWARE) pthread_setconcurrency(8); #endif printf("%-60s", "Initializing the context"); From c7c7db7f26fe7f9c7fc552fff0baa1d3f8e511a4 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 26 Feb 2002 21:10:31 +0000 Subject: [PATCH 3059/7878] Added the include of apr_proc_mutex.h if the global mutex is proc mutex git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63065 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_global_mutex.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index fc5a0b3b681..6bc0abfd79b 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -166,6 +166,8 @@ APR_POOL_DECLARE_ACCESSOR(global_mutex); * Define these platforms in terms of an apr_proc_mutex_t. */ +#include "apr_proc_mutex.h" + #define apr_global_mutex_t apr_proc_mutex_t #define apr_global_mutex_create apr_proc_mutex_create #define apr_global_mutex_child_init apr_proc_mutex_child_init From ab4906e48c93fe65c7fa2ec4fc81941b8be80f04 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 26 Feb 2002 21:11:08 +0000 Subject: [PATCH 3060/7878] Switched the NetWare definition of apr_atomic_t to an unsigned long git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63066 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index e0dbabe2754..63deeca3bd8 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -172,7 +172,7 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #elif defined(NETWARE) #include -#define apr_atomic_t apr_uint32_t +#define apr_atomic_t unsigned long #define apr_atomic_add(mem, val) atomic_add(mem,val) #define apr_atomic_dec(mem) atomic_dec(mem) From 855cd9d68070c6dbb19b5a496bdb120a2d699fbd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 27 Feb 2002 17:37:00 +0000 Subject: [PATCH 3061/7878] Someone wasn't minding the p's and q's ... forgot to advance over a trailing quote - so we always bombed by allocating too few entries in the char* vector. Also, many use cases will presume a trailing NULL entry in the argv, need to put one there. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63067 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_cpystrn.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index 85aa3f3ecdb..1966eee4afe 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -125,8 +125,8 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, apr_pool_t *token_context) { const char *cp; - const char *tmpCnt; - int isquoted, numargs = 0, rc = APR_SUCCESS; + const char *ct; + int isquoted, numargs = 0; #define SKIP_WHITESPACE(cp) \ for ( ; *cp == ' ' || *cp == '\t'; ) { \ @@ -159,44 +159,39 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, cp = arg_str; SKIP_WHITESPACE(cp); - tmpCnt = cp; + ct = cp; /* This is ugly and expensive, but if anyone wants to figure a * way to support any number of args without counting and * allocating, please go ahead and change the code. + * + * Must account for the trailing NULL arg. */ - while (*tmpCnt != '\0') { - CHECK_QUOTATION(tmpCnt, isquoted); - DETERMINE_NEXTSTRING(tmpCnt, isquoted); + numargs = 1; + while (*ct != '\0') { + CHECK_QUOTATION(ct, isquoted); + DETERMINE_NEXTSTRING(ct, isquoted); + ct++; numargs++; - SKIP_WHITESPACE(tmpCnt); - } - - *argv_out = apr_palloc(token_context, (numargs + 1)*sizeof(char*)); - if (*argv_out == NULL) { - return (APR_ENOMEM); + SKIP_WHITESPACE(ct); } + *argv_out = apr_palloc(token_context, numargs * sizeof(char*)); /* determine first argument */ numargs = 0; while (*cp != '\0') { CHECK_QUOTATION(cp, isquoted); - tmpCnt = cp; + ct = cp; DETERMINE_NEXTSTRING(cp, isquoted); cp++; - (*argv_out)[numargs] = apr_palloc(token_context, cp - tmpCnt); - apr_cpystrn((*argv_out)[numargs], tmpCnt, cp - tmpCnt); + (*argv_out)[numargs] = apr_palloc(token_context, cp - ct); + apr_cpystrn((*argv_out)[numargs], ct, cp - ct); numargs++; - /* This needs to be -1 because we move past the end above. */ - if (*(cp - 1) == '\0') { - (*argv_out)[numargs] = '\0'; - break; - } - SKIP_WHITESPACE(cp); } + (*argv_out)[numargs] = NULL; - return(rc); + return APR_SUCCESS; } /* Filename_of_pathname returns the final element of the pathname. From d5ed0e35ae10b74d7f6116b87eb230528a5344c4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 27 Feb 2002 17:39:06 +0000 Subject: [PATCH 3062/7878] Unnamed cross proc locks are quite legal on win32, thank you. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63068 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/proc_mutex.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 05682f18c47..50524a6ee12 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -87,10 +87,12 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, * running on Win2000, Global\ and Local\ are ignored. These * prefixes are only valid on Win2000+ */ - if (apr_os_level >= APR_WIN_2000) - fname = apr_pstrcat(pool, "Global\\", fname, NULL); - else - fname = apr_pstrdup(pool, fname); + if (fname) { + if (apr_os_level >= APR_WIN_2000) + fname = apr_pstrcat(pool, "Global\\", fname, NULL); + else + fname = apr_pstrdup(pool, fname); + } hMutex = CreateMutex(&sec, FALSE, fname); if (!hMutex) { From ad0af2ccbd2213571c7129adbcf2da6ec7aaa742 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 28 Feb 2002 02:54:01 +0000 Subject: [PATCH 3063/7878] Add a new m4 function APR_EXPAND_VAR that will iteratively interpolate the contents of a variable, such as $sysconfdir, for use in a borne script. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63069 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 99623fd407e..363d357970a 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -554,4 +554,26 @@ do done ]) +dnl Iteratively interpolate the contents of the second argument +dnl until interpolation offers no new result. Then assign the +dnl final result to $1. +dnl +dnl Example: +dnl +dnl foo=1 +dnl bar='${foo}/2' +dnl baz='${bar}/3' +dnl APR_EXPAND_VAR(fraz, $baz) +dnl $fraz is now "1/2/3" +dnl +AC_DEFUN(APR_EXPAND_VAR,[ +last= +cur=$2 +while test "x$cur" != "x$last"; +do + last=$cur + cur=`eval "echo $cur"` +done +$1=$cur +]) From 6f12df0a0ec70909f6466e8309023d23d0c32358 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 28 Feb 2002 02:57:30 +0000 Subject: [PATCH 3064/7878] Mention the new APR_EXPAND_VAR m4 function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63070 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 3a976e26f2a..ca9eb612b21 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Added a new m4 function APR_EXPAND_VAR that will iteratively + interpolate the contents of a variable, such as $sysconfdir, + for use in a borne script. [Aaron Bannert] + *) apr-atomic support for old-sparc's and gas on solaris [Dale Ghent , jean-frederic clere, Ian Holsman] From cabad1908663d4c3cbe3c2a908d68a26aff33e94 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Thu, 28 Feb 2002 03:33:37 +0000 Subject: [PATCH 3065/7878] Win32: Fix apr_proc_mutex_lock/trylock. Getting WAIT_ABANDONED is not a failure condition when calling WaitForSingleObject on a mutex. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63071 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++++++ locks/win32/proc_mutex.c | 10 ++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index ca9eb612b21..f7a3dd1fe58 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,12 @@ Changes with APR b1 + *) Win32: apr_proc_mutex_trylock and apr_proc_mutex_lock were + incorrectly returning APR_BUSY if the lock was previously + held by a thread that exited before releasing the lock + (ie, if the process holding the lock segfaults). The MSDN + doc says when WaitForSingleObject returns WAIT_ABANDONED, + the calling thread takes ownership of the mutex, so these + two routines should return APR_SUCCESS in this case, not + APR_BUSY. [Bill Stoddard] *) Added a new m4 function APR_EXPAND_VAR that will iteratively interpolate the contents of a variable, such as $sysconfdir, diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 50524a6ee12..219362db2c0 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -139,12 +139,9 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) rv = WaitForSingleObject(mutex->handle, INFINITE); - if (rv == WAIT_OBJECT_0) { + if (rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) { return APR_SUCCESS; } - else if (rv == WAIT_ABANDONED) { - return APR_EBUSY; - } return apr_get_os_error(); } @@ -154,12 +151,9 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) rv = WaitForSingleObject(mutex->handle, 0); - if (rv == WAIT_OBJECT_0) { + if (rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) { return APR_SUCCESS; } - else if (rv == WAIT_ABANDONED) { - return APR_EBUSY; - } return apr_get_os_error(); } From e02cf1ca203adfe3817030b261d83718e19cb157 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Thu, 28 Feb 2002 23:23:29 +0000 Subject: [PATCH 3066/7878] Add APR_RING_PREPEND() and APR_BRIGADE_PREPEND() as companions to _CONCAT() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63072 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_ring.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/apr_ring.h b/include/apr_ring.h index 8002cdbbc01..ebc1f3d781c 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -326,6 +326,21 @@ } \ } while (0) +/** + * Prepend ring h2 onto the beginning of ring h1, leaving h2 empty. + * @param h1 Head of the ring to prepend onto + * @param h2 Head of the ring to prepend + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_PREPEND(h1, h2, elem, link) do { \ + if (!APR_RING_EMPTY((h2), elem, link)) { \ + APR_RING_SPLICE_AFTER(APR_RING_SENTINEL((h1), elem, link), \ + APR_RING_FIRST((h2)), \ + APR_RING_LAST((h2)), link); \ + APR_RING_INIT((h2), elem, link); \ + } \ + } while (0) /** * Unsplice a sequence of elements from a ring From d481686b8507003230898a57b25880681266c175 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Mar 2002 05:53:23 +0000 Subject: [PATCH 3067/7878] Another test to 'flunk'. If the path is backslashed-terminated, we don't know how applications might react. Convention is no trailing backslash on Win32 cwd paths - so strip it back off when it occurs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63073 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 18f02c84f23..725ca615a4b 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -264,8 +264,13 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, /* curr dir must be in native format, there are all sorts of bugs in * the NT library loading code that flunk the '/' parsing test. */ - return apr_filepath_merge(&attr->currdir, NULL, dir, - APR_FILEPATH_NATIVE, attr->cntxt); + apr_status_t rv = apr_filepath_merge(&attr->currdir, NULL, dir, + APR_FILEPATH_NATIVE, attr->cntxt); + if (rv == APR_SUCCESS) { + if (attr->currdir[strlen(attr->currdir) - 1] == '\\') + attr->currdir[strlen(attr->currdir) - 1] = '\0'; + } + return rv; } APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, From 0564b61ae6d306b4006ff0c782f4dcaeb2c80dbc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Mar 2002 05:56:26 +0000 Subject: [PATCH 3068/7878] Oh ... yea, there is a reason I never committed this months-old code to CVS - reverting to 1.63. Although the theory is right - we could end up in a case of d:\ or \\unc\path\ where stripping off the trailing slash of a root will introduce erratic behavior or fail entirely. Needs to be conditional on not-a-root-path, and I don't have time to hack that tonight. Better to leave working code in CVS. [sorry] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63074 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 725ca615a4b..18f02c84f23 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -264,13 +264,8 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, /* curr dir must be in native format, there are all sorts of bugs in * the NT library loading code that flunk the '/' parsing test. */ - apr_status_t rv = apr_filepath_merge(&attr->currdir, NULL, dir, - APR_FILEPATH_NATIVE, attr->cntxt); - if (rv == APR_SUCCESS) { - if (attr->currdir[strlen(attr->currdir) - 1] == '\\') - attr->currdir[strlen(attr->currdir) - 1] = '\0'; - } - return rv; + return apr_filepath_merge(&attr->currdir, NULL, dir, + APR_FILEPATH_NATIVE, attr->cntxt); } APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, From fddf257cb256508dea6668702199765fb67e9838 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 1 Mar 2002 22:25:26 +0000 Subject: [PATCH 3069/7878] Switching from a project build file to GNU make files git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63075 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 404 +++++++++++++++++++++++++++++++++++++ build/NWGNUenvironment.inc | 253 +++++++++++++++++++++++ build/NWGNUhead.inc | 103 ++++++++++ build/NWGNUmakefile | 89 ++++++++ build/NWGNUtail.inc | 282 ++++++++++++++++++++++++++ 5 files changed, 1131 insertions(+) create mode 100644 NWGNUmakefile create mode 100644 build/NWGNUenvironment.inc create mode 100644 build/NWGNUhead.inc create mode 100644 build/NWGNUmakefile create mode 100644 build/NWGNUtail.inc diff --git a/NWGNUmakefile b/NWGNUmakefile new file mode 100644 index 00000000000..c43193cfe18 --- /dev/null +++ b/NWGNUmakefile @@ -0,0 +1,404 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + build \ + ..\apr-util \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(APR_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR_WORK)/include \ + $(APR_WORK)/include/arch/NetWare \ + $(APR_WORK)/include/arch/unix \ + $(APR_WORK)/memory/unix \ + $(APRUTIL)/xml \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = aprlib + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Apache Portability Runtime Library + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = +# +# If this is specified, it will override VERSION value in +# $(APR_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If this is specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can +# be disabled by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# Declare all target files (you must add your files here) +# + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/aprlib.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(OBJDIR)/aprlib.lib \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/libprews.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(APRLIB) \ + $(APRUTLIB) \ + $(XMLLIB) \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + Libc \ + ws2_32 \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @libc.imp \ + @ws2nlm.imp \ + @netware.imp \ + NXGetRandom \ + NXGetCtlInfo \ + NXSetCtlInfo \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + @aprlib.imp \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(OBJDIR)/apr_cpystrn.o \ + $(OBJDIR)/apr_fnmatch.o \ + $(OBJDIR)/apr_getpass.o \ + $(OBJDIR)/apr_hash.o \ + $(OBJDIR)/apr_md5.o \ + $(OBJDIR)/apr_pools.o \ + $(OBJDIR)/apr_snprintf.o \ + $(OBJDIR)/apr_strings.o \ + $(OBJDIR)/apr_strnatcmp.o \ + $(OBJDIR)/apr_strtok.o \ + $(OBJDIR)/apr_tables.o \ + $(OBJDIR)/copy.o \ + $(OBJDIR)/dir.o \ + $(OBJDIR)/dso.o \ + $(OBJDIR)/errorcodes.o \ + $(OBJDIR)/fileacc.o \ + $(OBJDIR)/filedup.o \ + $(OBJDIR)/filepath.o \ + $(OBJDIR)/filestat.o \ + $(OBJDIR)/filesys.o \ + $(OBJDIR)/flock.o \ + $(OBJDIR)/fullrw.o \ + $(OBJDIR)/getopt.o \ + $(OBJDIR)/getuuid.o \ + $(OBJDIR)/groupinfo.o \ + $(OBJDIR)/inet_pton.o \ + $(OBJDIR)/inet_ntop.o \ + $(OBJDIR)/libprews.o \ + $(OBJDIR)/locks.o \ + $(OBJDIR)/mktemp.o \ + $(OBJDIR)/open.o \ + $(OBJDIR)/pipe.o \ + $(OBJDIR)/poll.o \ + $(OBJDIR)/proc.o \ + $(OBJDIR)/procsup.o \ + $(OBJDIR)/proc_mutex.o \ + $(OBJDIR)/rand.o \ + $(OBJDIR)/readwrite.o \ + $(OBJDIR)/seek.o \ + $(OBJDIR)/sendrecv.o \ + $(OBJDIR)/shm.o \ + $(OBJDIR)/signals.o \ + $(OBJDIR)/sockaddr.o \ + $(OBJDIR)/sockets.o \ + $(OBJDIR)/sockopt.o \ + $(OBJDIR)/start.o \ + $(OBJDIR)/thread.o \ + $(OBJDIR)/thread_cond.o \ + $(OBJDIR)/thread_mutex.o \ + $(OBJDIR)/thread_rwlock.o \ + $(OBJDIR)/threadpriv.o \ + $(OBJDIR)/time.o \ + $(OBJDIR)/timestr.o \ + $(OBJDIR)/userinfo.o \ + $(OBJDIR)/utf8_ucs2.o \ + $(OBJDIR)/uuid.o \ + $(OBJDIR)/version.o \ + $(OBJDIR)/xlate.o \ + $(EOLIST) + + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + copy $(OBJDIR)\aprlib.nlm $(INSTALL)\Apache2\*.* + +# +# Any specialized rules here +# + +$(OBJDIR)/%.o: strings/%.c $(OBJDIR)\cc.opt + @echo Compiling $< + $(CC) strings\$( like #include "..." +# -Cpp_exceptions off disable C++ exceptions +# -RTTI off disable C++ run-time typing information +# -align 4 align on 4 byte bounderies +# -w nocmdline disable command-line driver/parser warnings +# -proc PII generate code base on Pentium II instruction set +# -inst mmx use MMX extensions + +CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII -inst mmx + +# -g generate debugging information +# -O1 level 1 optimizations + +ifeq "$(RELEASE)" "debug" +CFLAGS += -g -O1 +endif + +# -O4,p level 4 optimizations, optimize for speed +ifeq "$(RELEASE)" "optimized" +CFLAGS += -O4,p +endif + +# -prefix pre_nw.h #include pre_nw.h for all files + +CFLAGS += -prefix pre_nw.h + + +PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools + +# +# Declare major project deliverables output directories here +# + +ifdef DEST +INSTALL = $(DEST) +ifeq (\, $(findstring \,$(INSTALL))) +INSTDIRS = $(DEST) +endif +endif + +ifdef dest +INSTALL = $(dest) +ifeq (\, $(findstring \,$(INSTALL))) +INSTDIRS = $(dest) +endif +endif + +ifndef INSTALL +INSTALL = $(APR_WORK)\..\Dist +INSTDIRS = $(APR_WORK)\..\Dist +endif + +INSTDEVDIRS := \ + $(INSTDIRS) \ + $(INSTALL)\Apache2 \ + $(INSTALL)\Apache2\include \ + $(INSTALL)\Apache2\lib \ + +INSTDIRS += \ + $(INSTALL)\Apache2 \ + +# +# Declare Command and tool macros here +# + +# Os2LibPath is an extra check to see if we are on NT +ifdef Os2LibPath +OS = Windows_NT +endif + +ifeq "$(OS)" "Windows_NT" +CMD=cmd /C +CHK=cmd /C if exist +CHKNOT=cmd /C if not exist +DEL = del /F +DELTREE = cmd /C rd /s/q +WINNT=1 +else +CMD=command /C +CHK=command /C if exist +CHKNOT=command /C if not exist +DEL = del +DELTREE = deltree /y +endif + + +# +# Setup base C compiler flags +# + +# +# Common directories +# + +APR = $(APR_WORK) +APRTEST = $(APR_WORK)/test +APRUTIL = $(APR_WORK)/../apr-util +XML = $(APRUTIL)/xml + +# +# Internal Libraries +# + +APRLIB = $(APR)/$(OBJDIR)/aprlib.lib +APRUTLIB = $(APRUTIL)/$(OBJDIR)/aprutil.lib +XMLLIB = $(XML)/$(OBJDIR)/xmllib.lib + +# +# Additional general defines +# +VERSION = 2,0,0 + +EnvironmentDefined = 1 +endif # ifndef EnvironmentDefined + +# This is always set so that it will show up in lower directories + +ifdef Path +Path = $(PATH) +endif + diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc new file mode 100644 index 00000000000..ac084d02b8b --- /dev/null +++ b/build/NWGNUhead.inc @@ -0,0 +1,103 @@ +# +# Obtain the global build environment +# + +include $(APR_WORK)\build\NWGNUenvironment.inc + +# +# Define base targets and rules +# + +TARGETS = libs nlms install clobber_libs clobber_nlms clean installdev + +.PHONY : $(TARGETS) default all help $(NO_LICENSE_FILE) + +# Here is where we will use the NO_LICENSE_FILE variable to see if we need to +# restart the make with it defined + +ifdef NO_LICENSE_FILE + +default: NO_LICENSE_FILE + +all: NO_LICENSE_FILE + +install :: NO_LICENSE_FILE + +installdev :: NO_LICENSE_FILE + +NO_LICENSE_FILE : + $(MAKE) $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(METROWERKS)\license.dat" + +else # LM_LICENSE_FILE must be defined so use the real targets + +default: $(SUBDIRS) libs nlms + +all: $(SUBDIRS) libs nlms install + +$(TARGETS) :: $(SUBDIRS) + +install :: nlms $(INSTDIRS) + +installdev :: $(INSTDEVDIRS) + +$(INSTDIRS) :: + $(CHKNOT) $@\NUL mkdir $@ + +$(INSTDEVDIRS) :: + $(CHKNOT) $@\NUL mkdir $@ + +endif #NO_LICENSE_FILE check + +help : + @echo targets for RELEASE=$(RELEASE): + @echo (default) . . . . libs nlms + @echo all . . . . . . . does everything (libs nlms install) + @echo libs. . . . . . . builds all libs + @echo nlms. . . . . . . builds all nlms + @echo install . . . . . builds libs and nlms and copies install files to + @echo "$(INSTALL)" + @echo clean . . . . . . deletes $(OBJDIR) dirs, *.err, and *.map + @echo clobber_all . . . deletes all possible output from the make + @echo clobber_install . deletes all files in $(INSTALL) + @$(CMD) echo. + @echo Multiple targets can be used on a single nmake command line - + @echo (i.e. $(MAKE) clean all) + @$(CMD) echo. + @echo You can also specify RELEASE=debug, RELEASE=noopt, or RELEASE=optimized + @echo The default is RELEASE=optimized + +clobber_all :: clean clobber_install + +clobber_install :: + -$(DELTREE) $(INSTALL) 2>NUL + +# +# build recursive targets +# + +$(SUBDIRS) : FORCE +ifneq "$(MAKECMDGOALS)" "clean" + $(CMD) echo. + @echo Building $(CURDIR)/$@ +endif + $(MAKE) -C $@ $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(LM_LICENSE_FILE)" + $(CMD) echo. + +FORCE: + +# +# Standard targets +# + +clean :: $(SUBDIRS) + @echo Cleaning up $(CURDIR) + -$(DELTREE) $(OBJDIR) 2> NUL + $(CHK) *.err $(DEL) *.err + $(CHK) *.map $(DEL) *.map + $(CHK) *.d $(DEL) *.d + $(CHK) *.tmp $(DEL) *.tmp + -$(DELTREE) $(OBJDIR) 2> NUL + +$(OBJDIR) :: + $(CHKNOT) $(OBJDIR)\nul mkdir $(OBJDIR) + diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile new file mode 100644 index 00000000000..eaa230c7e10 --- /dev/null +++ b/build/NWGNUmakefile @@ -0,0 +1,89 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(APR_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +FILES_prebuild_headers = \ + $(APR)/include/apr.h \ + $(APRUTIL)/include/apu.h \ + $(APRUTIL)/include/apr_ldap.h \ + $(APRUTIL)/include/private/apu_config.h \ + $(APRUTIL)/include/private/apu_select_dbm.h \ + $(APRUTIL)/xml/expat/lib/expat.h \ + $(APRUTIL)/xml/expat/lib/config.h \ + $(EOLIST) + +nlms :: $(APR)/aprlib.imp + +$(APR)/aprlib.imp : make_nw_export.awk nw_export.i + @echo Generating $(subst /,\,$@) + awk -f make_nw_export.awk nw_export.i | sort >$(APR)/aprlib.imp + +nw_export.i : nw_export.inc $(FILES_prebuild_headers) cc.opt + @echo Generating $(subst /,\,$@) + $(CC) $< @cc.opt + +cc.opt : NWGNUmakefile $(APR_WORK)\build\NWGNUenvironment.inc $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUtail.inc $(CUSTOM_INI) + $(CHK) $@ $(DEL) $@ + @echo -P >> $@ + @echo -EP >> $@ + @echo -nosyspath >> $@ + @echo -w nocmdline >> $@ + @echo -DNETWARE >> $@ + @echo -I..\include >> $@ + @echo -I..\include\arch\netware >> $@ + @echo -I..\include\arch\unix >> $@ + @echo -I..\..\apr-util\include >> $@ + @echo -ir $(NOVELLLIBC) >> $@ + +$(APR)/include/%.h: $(subst /,\,$(APR))\include\%.hnw + @echo Creating $(subst /,\,$@) + copy $< $(subst /,\,$(APR))\include\$(@F) + +$(APRUTIL)/include/%.h: $(subst /,\,$(APRUTIL))\include\%.hnw + @echo Creating $(subst /,\,$@) + copy $< $(subst /,\,$(APRUTIL))\include\$(@F) + +$(APRUTIL)/include/private/%.h: $(subst /,\,$(APRUTIL))\include\private\%.hw + @echo Creating $(subst /,\,$@) + copy $< $(subst /,\,$(APRUTIL))\include\private\$(@F) + +$(APRUTIL)/xml/expat/lib/%.h: $(subst /,\,$(APRUTIL))\xml\expat\lib\%.hnw + @echo Creating $(subst /,\,$@) + copy $< $(subst /,\,$(APRUTIL))\xml\expat\lib\$(@F) + +$(APRUTIL)/xml/expat/lib/%.h: $(subst /,\,$(APRUTIL))\xml\expat\lib\%.h.in + @echo Creating $(subst /,\,$@) + copy $< $(subst /,\,$(APRUTIL))\xml\expat\lib\$(@F) + +# +# You can use this target if all that is needed is to copy files to the +# installation area +# +install :: nlms FORCE + + +clean :: + $(CHK) nw_export.i $(DEL) nw_export.i + $(CHK) cc.opt $(DEL) cc.opt + $(CHK) $(subst /,\,$(APR))\include\apr.h $(DEL) $(subst /,\,$(APR))\include\apr.h + $(CHK) $(subst /,\,$(APRUTIL))\include\apu.h $(DEL) $(subst /,\,$(APRUTIL))\include\apu.h + $(CHK) $(subst /,\,$(APRUTIL))\include\apr_ldap.h $(DEL) $(subst /,\,$(APRUTIL))\include\apr_ldap.h + $(CHK) $(subst /,\,$(APRUTIL))\include\private\apu_config.h $(DEL) $(subst /,\,$(APRUTIL))\include\private\apu_config.h + $(CHK) $(subst /,\,$(APRUTIL))\include\private\apu_select_dbm.h $(DEL) $(subst /,\,$(APRUTIL))\include\private\apu_select_dbm.h + $(CHK) $(subst /,\,$(APRUTIL))\xml\expat\lib\expat.h $(DEL) $(subst /,\,$(APRUTIL))\xml\expat\lib\expat.h + $(CHK) $(subst /,\,$(APRUTIL))\xml\expat\lib\config.h $(DEL) $(subst /,\,$(APRUTIL))\xml\expat\lib\config.h + $(CHK) $(subst /,\,$(APR))\aprlib.imp $(DEL) $(subst /,\,$(APR))\aprlib.imp + diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc new file mode 100644 index 00000000000..86fc5ae0cd3 --- /dev/null +++ b/build/NWGNUtail.inc @@ -0,0 +1,282 @@ +# +# This contains final targets and should be included at the end of any +# NWGNUmakefile file +# + +# +# If we are going to create an nlm, make sure we have assigned variables to +# use during the link. +# +echo NLM_NAME=$(NLM_NAME) +ifndef NLM_NAME +NLM_NAME = $(TARGET_nlm) +endif + +ifndef NLM_DESCRIPTION +NLM_DESCRIPTION = $(NLM_NAME) +endif + +ifndef NLM_THREAD_NAME +NLM_THREAD_NAME = $(NLM_NAME) Thread +endif + +# +# Create dependency lists based on the files available +# + + +CCOPT_DEPENDS = \ + $(APR_WORK)\build\NWGNUhead.inc \ + $(APR_WORK)\build\NWGNUenvironment.inc \ + $(APR_WORK)\build\NWGNUtail.inc \ + NWGNUmakefile \ + $(CUSTOM_INI) \ + $(EOLIST) + +CPPOPT_DEPENDS = \ + $(APR_WORK)\build\NWGNUhead.inc \ + $(APR_WORK)\build\NWGNUenvironment.inc \ + $(APR_WORK)\build\NWGNUtail.inc \ + NWGNUmakefile \ + $(CUSTOM_INI) \ + $(EOLIST) + +$(NLM_NAME)_LINKOPT_DEPENDS = \ + $(TARGET_lib) \ + $(APR_WORK)\build\NWGNUenvironment.inc \ + NWGNUmakefile \ + $(APR_WORK)\build\NWGNUtail.inc \ + $(CUSTOM_INI) \ + $(EOLIST) + +ifeq "$(words $(strip $(TARGET_lib)))" "1" +LIB_NAME = $(basename $(notdir $(TARGET_lib))) +$(LIB_NAME)_LIBLST_DEPENDS = \ + $(FILES_lib_objs) \ + $(APR_WORK)\build\NWGNUenvironment.inc \ + NWGNUmakefile \ + $(APR_WORK)\build\NWGNUtail.inc \ + $(CUSTOM_INI) \ + $(EOLIST) +endif + +ifeq "$(wildcard NWGNU$(LIB_NAME))" "NWGNU$(LIB_NAME)" +$(LIB_NAME)_LIBLST_DEPENDS += NWGNU$(LIB_NAME) +endif + +ifeq "$(wildcard NWGNU$(NLM_NAME))" "NWGNU$(NLM_NAME)" +$(NLM_NAME)_LINKOPT_DEPENDS += NWGNU$(NLM_NAME) +CCOPT_DEPENDS += NWGNU$(NLM_NAME) +CPPOPT_DEPENDS += NWGNU$(NLM_NAME) +endif + +# +# Generic compiler rules +# + +$(OBJDIR)/%.o: %.c $(OBJDIR)\cc.opt + @echo Compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +$(OBJDIR)\cc.opt: $(CCOPT_DEPENDS) + @echo CCOPT_DEPENDS=$(CCOPT_DEPENDS) + $(CHK) $@ $(DEL) $@ + @echo Generating $@ +ifneq "$(strip $(CFLAGS))" "" + @echo $(CFLAGS) >> $@ +endif +ifneq "$(strip $(XCFLAGS))" "" + @echo $(XCFLAGS) >> $@ +endif +ifneq "$(strip $(XINCDIRS))" "" + @echo $(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir)) >> $@ +endif +ifneq "$(strip $(INCDIRS))" "" + @echo $(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir)) >> $@ +endif +ifneq "$(strip $(DEFINES))" "" + @echo $(DEFINES) >> $@ +endif +ifneq "$(strip $(XDEFINES))" "" + @echo $(XDEFINES) >> $@ +endif + +$(OBJDIR)/%.o: %.cpp $(OBJDIR)\cpp.opt + @echo Compiling $< + $(CPP) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cpp.opt + +$(OBJDIR)\cpp.opt: $(CPPOPT_DEPENDS) + $(CHK) $@ $(DEL) $@ + @echo Generating $@ +ifneq "$(strip $(CFLAGS))" "" + @echo $(CFLAGS) >> $@ +endif +ifneq "$(strip $(XCFLAGS))" "" + @echo $(XCFLAGS) >> $@ +endif +ifneq "$(strip $(XINCDIRS))" "" + @echo $(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir)) >> $@ +endif +ifneq "$(strip $(INCDIRS))" "" + @echo $(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir)) >> $@ +endif +ifneq "$(strip $(DEFINES))" "" + @echo $(DEFINES) >> $@ +endif +ifneq "$(strip $(XDEFINES))" "" + @echo $(XDEFINES) >> $@ +endif + +# +# Rules to build libraries +# + +# If we only have one target library then build it + +ifeq "$(words $(strip $(TARGET_lib)))" "1" + +$(TARGET_lib) : $(OBJDIR)\$(LIB_NAME)_lib.lst + @echo Generating $@ + $(CHK) $(OBJDIR)\$(@F) $(DEL) $(OBJDIR)\$(@F) + $(LIB) -o $(OBJDIR)\$(@F) @$? + +$(OBJDIR)\$(LIB_NAME)_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS) + $(CHK) $@ $(DEL) $@ + @echo Generating $@ +ifneq "$(strip $(FILES_lib_objs))" "" + @echo $(foreach objfile,$(FILES_lib_objs),$(subst /,\,$(objfile)) ) >> $@ +endif + +else # We must have more than one target library so load the individual makefiles + +$(OBJDIR)/%.lib: NWGNU% $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUtail.inc $(APR_WORK)\build\NWGNUenvironment.inc FORCE + @echo Calling $< + $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE) + +endif + +# +# Rules to build nlms. +# + +vpath libcpre.o $(NOVELLLIBC)\imports + +# If we only have one target NLM then build it +ifeq "$(words $(strip $(TARGET_nlm)))" "1" + +$(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)\$(NLM_NAME)_link.opt + @echo Linking $@ + $(LINK) @$(OBJDIR)\$(NLM_NAME)_link.opt + +# This will force the link option file to be rebuilt if we change the +# corresponding makefile + +$(OBJDIR)\$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) + $(CHK) $(OBJDIR)\$(@F) $(DEL) $(OBJDIR)\$(@F) + $(CHK) $(OBJDIR)\$(NLM_NAME)_link.def $(DEL) $(OBJDIR)\$(NLM_NAME)_link.def + @echo Generating $@ + @echo -warnings off >> $@ + @echo -zerobss >> $@ + @echo -desc "$(NLM_DESCRIPTION)" >> $@ + @echo -o $(TARGET_nlm) >> $@ +ifneq "$(FILE_nlm_copyright)" "" + @-type $(FILE_nlm_copyright) >> $@ +endif +ifeq "$(RELEASE)" "debug" + @echo -g >> $@ + @echo -sym internal >> $@ + @echo -sym codeview4 >> $@ + @echo -osym $(OBJDIR)\$(NLM_NAME).sym >> $@ +else + @echo -sym internal >> $@ +endif + @echo -screenname "Apache for NetWare" >> $@ +ifneq "$(NLM_VERSION)" "" + @echo -nlmversion=$(NLM_VERSION) >> $@ +else + @echo -nlmversion=$(VERSION) >> $@ +endif + @echo -l $(APR)/$(OBJDIR) >> $@ + @echo -l $(APRUTIL)/$(OBJDIR) >> $@ + @echo -l $(XML)/$(OBJDIR) >> $@ + @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime" >> $@ + @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++" >> $@ + @echo -l $(NOVELLLIBC)/imports >> $@ +ifneq "$(LDAPSDK)" "" + @echo -l $(LDAPSDK)/lib/nlm >> $@ +endif + @echo -nodefaults >> $@ + @echo -map $(OBJDIR)\$(NLM_NAME).map>> $@ + @echo -threadname "$(NLM_THREAD_NAME)" >> $@ +ifneq "$(NLM_STACK_SIZE)" "" + @echo -stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE)))) >> $@ +else + @echo -stacksize 64000 >> $@ +endif +ifneq "$(NLM_ENTRY_SYM)" "" + @echo -entry $(NLM_ENTRY_SYM) >> $@ +endif +ifneq "$(NLM_EXIT_SYM)" "" + @echo -exit $(NLM_EXIT_SYM) >> $@ +endif +ifneq "$(NLM_CHECK_SYM)" "" + @echo -check $(NLM_CHECK_SYM) >> $@ +endif +ifneq "$(NLM_FLAGS)" "" + @echo -flags $(NLM_FLAGS) >> $@ +endif +ifneq "$(strip $(FILES_nlm_objs))" "" + @echo $(foreach objfile,$(strip $(FILES_nlm_objs)),$(subst /,\,$(objfile))) >> $@ +endif +ifneq "$(FILES_nlm_libs)" "" + @echo $(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(subst /,\,$(libfile))) >> $@ +endif + @echo -commandfile $(OBJDIR)\$(NLM_NAME)_link.def >> $@ +ifneq "$(FILE_nlm_msg)" "" + @echo Messages $(FILE_nlm_msg) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +ifneq "$(FILE_nlm_hlp)" "" + @echo Help $(FILE_nlm_hlp) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +ifneq "$(FILES_nlm_modules)" "" + @echo module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(subst /,\,$(module))) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +ifneq "$(FILES_nlm_Ximports)" "" + @echo Import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(subst /,\,$(import))) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +ifneq "$(FILES_nlm_exports)" "" + @echo Export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(subst /,\,$(export))) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +ifneq "$(strip $(XLFLAGS))" "" + @echo $(XLFLAGS) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif + +# if APACHE_UNIPROC is defined, don't include XDCData +ifndef APACHE_UNIPROC +ifneq "$(string $(XDCDATA))" "" + @echo XDCData $(XDCDATA) >> $(OBJDIR)\$(NLM_NAME)_link.def +else + @echo XDCData $(APR)\misc\netware\apr.xdc >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +endif + +else # more than one target so look for individual makefiles. + +# Only include these if NO_LICENSE_FILE isn't set to prevent excessive +# recursion + +ifndef NO_LICENSE_FILE + +$(OBJDIR)/%.nlm: NWGNU% $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUtail.inc $(APR_WORK)\build\NWGNUenvironment.inc $(CUSTOM_INI) FORCE + @echo Calling $< + $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE) + $(CMD) echo. + +else + +$(TARGET_nlm): + +endif # NO_LICENSE_FILE + +endif # multiple targets + From 749f496bb9389f476e68eab0ec217974e37f72db Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sat, 2 Mar 2002 09:26:07 +0000 Subject: [PATCH 3070/7878] Export the APR_ALIGN macros. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63076 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 11 +++++++++++ memory/unix/apr_pools.c | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index 8849ec27c88..85b0011a14e 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -158,6 +158,17 @@ int strcasecmp(const char *a, const char *b); int strncasecmp(const char *a, const char *b, size_t n); #endif +/** + * Allignment macros + */ + +/* APR_ALIGN() is only to be used to align on a power of 2 boundary */ +#define APR_ALIGN(size, boundary) \ + (((size) + ((boundary) - 1)) & ~((boundary) - 1)) + +#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) + + /** * String and memory functions */ diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 029ea73aace..f100a338185 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -99,17 +99,6 @@ #define BOUNDARY_SIZE (1 << BOUNDARY_INDEX) -/* - * Macros and defines - */ - -/* APR_ALIGN() is only to be used to align on a power of 2 boundary */ -#define APR_ALIGN(size, boundary) \ - (((size) + ((boundary) - 1)) & ~((boundary) - 1)) - -#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) - - /* * Structures */ From d073fda5b2677224e416fe9c0af4992c9f46db2d Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 2 Mar 2002 22:16:13 +0000 Subject: [PATCH 3071/7878] Spelling police. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63077 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_general.h b/include/apr_general.h index 85b0011a14e..7ec188d0720 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -159,7 +159,7 @@ int strncasecmp(const char *a, const char *b, size_t n); #endif /** - * Allignment macros + * Alignment macros */ /* APR_ALIGN() is only to be used to align on a power of 2 boundary */ From 226b37430ee116569e16b2df12d73cb34194ef7e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 4 Mar 2002 16:40:58 +0000 Subject: [PATCH 3072/7878] preserve the proper alignment when we use the start of the shared memory for metadata git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63078 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 54310a8b70d..37a1f1f3b30 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -161,7 +161,8 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, } new_m->pool = pool; new_m->reqsize = reqsize; - new_m->realsize = reqsize + sizeof(apr_size_t); /* room for metadata */ + new_m->realsize = reqsize + + APR_ALIGN_DEFAULT(sizeof(apr_size_t)); /* room for metadata */ new_m->filename = NULL; #if APR_USE_SHMEM_MMAP_ZERO @@ -189,7 +190,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* store the real size in the metadata */ *(apr_size_t*)(new_m->base) = new_m->realsize; /* metadata isn't usable */ - new_m->usable = (char *)new_m->base + sizeof(apr_size_t); + new_m->usable = (char *)new_m->base + APR_ALIGN_DEFAULT(sizeof(apr_size_t)); apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, apr_pool_cleanup_null); @@ -206,7 +207,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* store the real size in the metadata */ *(apr_size_t*)(new_m->base) = new_m->realsize; /* metadata isn't usable */ - new_m->usable = (char *)new_m->base + sizeof(apr_size_t); + new_m->usable = (char *)new_m->base + APR_ALIGN_DEFAULT(sizeof(apr_size_t)); apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, apr_pool_cleanup_null); @@ -274,7 +275,8 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, new_m->filename = apr_pstrdup(pool, filename); #if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM - new_m->realsize = reqsize + sizeof(apr_size_t); /* room for metadata */ + new_m->realsize = reqsize + + APR_ALIGN_DEFAULT(sizeof(apr_size_t)); /* room for metadata */ /* FIXME: Ignore error for now. * * status = apr_file_remove(file, pool);*/ status = APR_SUCCESS; @@ -345,7 +347,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* store the real size in the metadata */ *(apr_size_t*)(new_m->base) = new_m->realsize; /* metadata isn't usable */ - new_m->usable = (char *)new_m->base + sizeof(apr_size_t); + new_m->usable = (char *)new_m->base + APR_ALIGN_DEFAULT(sizeof(apr_size_t)); apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, apr_pool_cleanup_null); @@ -482,6 +484,11 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, return status; } +/* + XXX use APR_ALIGN_DEFAULT() somewhere here? + XXX do we need to seek() prior to the mmap()? +*/ + nbytes = sizeof(new_m->realsize); status = apr_file_read(file, (void *)&(new_m->realsize), &nbytes); @@ -508,7 +515,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, } /* metadata isn't part of the usable segment */ - new_m->usable = (char *)new_m->base + sizeof(apr_size_t); + new_m->usable = (char *)new_m->base + APR_ALIGN_DEFAULT(sizeof(apr_size_t)); apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_attach, apr_pool_cleanup_null); From 701edb9578c242db258f015e02c7978bac43704e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 4 Mar 2002 17:00:21 +0000 Subject: [PATCH 3073/7878] get rid of some questions now that Aaron has checked it over git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63079 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 37a1f1f3b30..0eb73cc8da7 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -484,11 +484,6 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, return status; } -/* - XXX use APR_ALIGN_DEFAULT() somewhere here? - XXX do we need to seek() prior to the mmap()? -*/ - nbytes = sizeof(new_m->realsize); status = apr_file_read(file, (void *)&(new_m->realsize), &nbytes); From 58a0a9b171e2679f2a3db6d7aa47068eb890e176 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 5 Mar 2002 19:43:35 +0000 Subject: [PATCH 3074/7878] Removed the special implementation of the apr_time_now() API since we now have gettimeofday() on NetWare. Also added a redefinition of the timezone macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63080 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/time/unix/time.c b/time/unix/time.c index 92a3eece0da..87c54e08e9d 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -110,16 +110,9 @@ APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, /* NB NB NB NB This returns GMT!!!!!!!!!! */ APR_DECLARE(apr_time_t) apr_time_now(void) { -#ifdef NETWARE - uint64_t usec; - - NXGetTime(NX_SINCE_1970, NX_USECONDS, &usec); - return usec; -#else struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec; -#endif } static void explode_time(apr_exploded_time_t *xt, apr_time_t t, @@ -312,7 +305,7 @@ APR_DECLARE(apr_status_t) apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2 APR_DECLARE(void) apr_netware_setup_time(void) { tzset(); - server_gmt_offset = -timezone; + server_gmt_offset = -TZONE; } #else APR_DECLARE(void) apr_unix_setup_time(void) From 144bc5a294033b6a57a5a92b59f61ceea58ec55e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 5 Mar 2002 19:44:31 +0000 Subject: [PATCH 3075/7878] NetWare LibC API change for getting random bytes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63081 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/rand.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/misc/netware/rand.c b/misc/netware/rand.c index 7c4544c2417..b2eda208725 100644 --- a/misc/netware/rand.c +++ b/misc/netware/rand.c @@ -61,18 +61,10 @@ #include -#ifdef WAITING_FOR_UPDATE -int NXGetRandom( size_t width, void *result ); -#endif - APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, int length) { -#ifdef WAITING_FOR_UPDATE - return NXGetRandom(length, buf); -#else return NXSeedRandom(length, buf); -#endif } #endif /* APR_HAS_RANDOM */ From b17b165b3beca1934f3f2e0487666caa33e71f42 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 5 Mar 2002 19:46:22 +0000 Subject: [PATCH 3076/7878] Due to other changes in NetWare LibC, had to redefine the timezone macro git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63082 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/internal_time.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/arch/netware/internal_time.h b/include/arch/netware/internal_time.h index 9f1ea739886..d37926c5699 100644 --- a/include/arch/netware/internal_time.h +++ b/include/arch/netware/internal_time.h @@ -57,10 +57,7 @@ #include "apr.h" -#ifdef WAITING_FOR_UPDATE -#undef timezone -# define timezone (*___timezone()) -#endif +#define TZONE (*___timezone()) void apr_netware_setup_time(void); From ce2742407722080372039b2b6d754afa5910bebe Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 5 Mar 2002 19:48:55 +0000 Subject: [PATCH 3077/7878] Second cut at fork/exec and pipe functionality on NetWare. Still a work in progress. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63083 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 79 +++++++++-------------------------- include/arch/netware/fileio.h | 6 +-- misc/netware/aprlib.def | 3 -- threadproc/netware/proc.c | 75 +++++++++++++++++++++++++-------- 4 files changed, 77 insertions(+), 86 deletions(-) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index f69b88aea93..1f4be15f971 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -59,27 +59,13 @@ #include "fileio.h" #include "apr_strings.h" -static int convert_error (int err) -{ - switch (err) - { - default : break; - case NX_EINVAL: return APR_EINVAL; - case NX_EBADF: return APR_EBADF; - case NX_ENOENT: return APR_ENOENT; - case NX_ENAMETOOLONG:return APR_ENAMETOOLONG; - } - - return err; -} - apr_status_t apr_netware_pipe_cleanup(void *thefile) { apr_file_t *file = thefile; apr_status_t rv = APR_SUCCESS; int rc; - rc = NXClose(file->filedes); + rc = close(file->filedes); if (rc == 0) { file->filedes = -1; if (file->thlock) { @@ -93,31 +79,19 @@ apr_status_t apr_netware_pipe_cleanup(void *thefile) return rv; } -#ifdef WAITING_FOR_UPDATE -#ifndef NX_CTL_FLAGS -#define NX_CTL_FLAGS 0x00000001 -int NXGetCtlInfo(NXHandle_t handle, unsigned long command, ...); -int NXSetCtlInfo(NXHandle_t handle, unsigned long command, ...); -#endif -#endif - static apr_status_t pipeblock(apr_file_t *thepipe) { int err; -#ifdef WAITING_FOR_UPDATE unsigned long flags; - if (!(err = NXGetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, &flags))) + if (fcntl(thepipe->filedes, F_GETFL, &flags) != -1) { - flags &= ~NX_O_NONBLOCK; - err = NXSetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, flags); + flags &= ~FNDELAY; + fcntl(thepipe->filedes, F_SETFL, flags); } -#else - err = NXIoSetBlockingState(thepipe->filedes, 1); -#endif - if (err) - return convert_error (err); + if (errno) + return errno; thepipe->blocking = BLK_ON; return APR_SUCCESS; @@ -126,20 +100,17 @@ static apr_status_t pipeblock(apr_file_t *thepipe) static apr_status_t pipenonblock(apr_file_t *thepipe) { int err; -#ifdef WAITING_FOR_UPDATE unsigned long flags; - if (!(err = NXGetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, &flags))) + errno = 0; + if (fcntl(thepipe->filedes, F_GETFL, &flags) != -1) { - flags |= NX_O_NONBLOCK; - err = NXSetCtlInfo(thepipe->filedes, NX_CTL_FLAGS, flags); + flags |= FNDELAY; + fcntl(thepipe->filedes, F_SETFL, flags); } -#else - err = NXIoSetBlockingState(thepipe->filedes, 0); -#endif - if (err) - return convert_error (err); + if (errno) + return errno; thepipe->blocking = BLK_OFF; return APR_SUCCESS; @@ -176,14 +147,14 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) { char tname[L_tmpnam+1]; - NXHandle_t filedes[2]; + int filedes[2]; int err; if (!tmpnam(tname)) return errno; - if ( !(err = NXFifoOpen(0, tname, NX_O_RDONLY, 0, &filedes[0])) - && !(err = NXFifoOpen(0, tname, NX_O_WRONLY, 0, &filedes[1]))) + if ((filedes[0] = pipe_open(tname, O_RDONLY) != -1) + && (filedes[1] = pipe_open(tname, O_WRONLY) != -1)) { (*in) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); (*out) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); @@ -208,12 +179,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out } else { - if (filedes[0] != (NXHandle_t) -1) - NXClose(filedes[0]); - - if (err) - return convert_error (err); - + if (filedes[0] != -1) + close(filedes[0]); + return errno; } apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), apr_netware_pipe_cleanup, @@ -227,16 +195,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) { - mode_t mode = apr_unix_perms2mode(perm); - NXHandle_t filedes; - int err; - - err = NXFifoOpen(0, filename, mode, 0, &filedes); - - if (err) - return convert_error (err); - - return APR_SUCCESS; + return APR_ENOTIMPL; } diff --git a/include/arch/netware/fileio.h b/include/arch/netware/fileio.h index 101e006cc4f..4da34e37a21 100644 --- a/include/arch/netware/fileio.h +++ b/include/arch/netware/fileio.h @@ -162,11 +162,7 @@ apr_status_t filepath_has_drive(const char *rootpath, int only, apr_pool_t *p); apr_status_t filepath_compare_drive(const char *path1, const char *path2, apr_pool_t *p); apr_status_t apr_unix_file_cleanup(void *); - -//mode_t apr_unix_perms2mode(apr_fileperms_t perms); -//apr_fileperms_t apr_unix_mode2perms(mode_t mode); -// -//int apr_mkstemp(char *template); +apr_status_t apr_netware_pipe_cleanup(void *thefile); #endif /* ! FILE_IO_H */ diff --git a/misc/netware/aprlib.def b/misc/netware/aprlib.def index ed42c9350a7..0a2a01eb8f3 100644 --- a/misc/netware/aprlib.def +++ b/misc/netware/aprlib.def @@ -1,6 +1,3 @@ MODULE LIBC.NLM MODULE WS2_32.NLM -IMPORT NXGetRandom -IMPORT NXGetCtlInfo -IMPORT NXSetCtlInfo EXPORT @aprlib.imp diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 08ceede31c2..541e52bd008 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -333,36 +333,65 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, else envSpec.esEnv = NULL; + envSpec.esStdin.ssType = NX_OBJ_FIFO; + envSpec.esStdin.ssHandle = -1; + envSpec.esStdin.ssPathCtx = 0; if (attr->child_in) { - envSpec.esStdin.ssType = NX_OBJ_FIFO; - envSpec.esStdin.ssHandle = attr->child_in->filedes; + apr_pool_cleanup_kill(apr_file_pool_get(attr->child_in), + attr->child_in, apr_netware_pipe_cleanup); + envSpec.esStdin.ssPath = attr->child_in->fname; + apr_file_close(attr->child_in); + if (attr->parent_in) { + apr_file_close(attr->parent_in); + } + } + else if (attr->parent_in) { + envSpec.esStdin.ssPath = attr->parent_in->fname; + apr_file_close(attr->parent_in); } else { - envSpec.esStdin.ssType = NX_OBJ_DEFAULT; - envSpec.esStdin.ssHandle = -1; + envSpec.esStdin.ssPath = NULL; } - envSpec.esStdin.ssPathCtx = NULL; - envSpec.esStdin.ssPath = NULL; + + envSpec.esStdout.ssType = NX_OBJ_FIFO; + envSpec.esStdout.ssHandle = -1; + envSpec.esStdout.ssPathCtx = 0; if (attr->child_out) { - envSpec.esStdout.ssType = NX_OBJ_FIFO; - envSpec.esStdout.ssHandle = attr->child_out->filedes; + apr_pool_cleanup_kill(apr_file_pool_get(attr->child_out), + attr->child_out, apr_netware_pipe_cleanup); + envSpec.esStdout.ssPath = attr->child_out->fname; + apr_file_close(attr->child_out); + if (attr->parent_out) { + apr_file_close(attr->parent_out); + } + } + else if (attr->parent_out) { + envSpec.esStdout.ssPath = attr->parent_out->fname; + apr_file_close(attr->parent_out); } else { - envSpec.esStdout.ssType = NX_OBJ_DEFAULT; - envSpec.esStdout.ssHandle = -1; + envSpec.esStdout.ssPath = NULL; } - envSpec.esStdout.ssPathCtx = NULL; - envSpec.esStdout.ssPath = NULL; + + envSpec.esStderr.ssType = NX_OBJ_FIFO; + envSpec.esStderr.ssHandle = -1; + envSpec.esStderr.ssPathCtx = 0; if (attr->child_err) { - envSpec.esStderr.ssType = NX_OBJ_FIFO; - envSpec.esStderr.ssHandle = attr->child_err->filedes; + apr_pool_cleanup_kill(apr_file_pool_get(attr->child_err), + attr->child_err, apr_netware_pipe_cleanup); + envSpec.esStderr.ssPath = attr->child_err->fname; + apr_file_close(attr->child_err); + if (attr->parent_err) { + apr_file_close(attr->parent_err); + } + } + else if (attr->parent_err) { + envSpec.esStderr.ssPath = attr->parent_err->fname; + apr_file_close(attr->parent_err); } else { - envSpec.esStderr.ssType = NX_OBJ_DEFAULT; - envSpec.esStderr.ssHandle = -1; + envSpec.esStderr.ssPath = NULL; } - envSpec.esStderr.ssPathCtx = NULL; - envSpec.esStderr.ssPath = NULL; if (attr->detached) { flags = NX_VM_CREATE_DETACHED; @@ -376,6 +405,16 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, } else { newproc->pid = newVM; + if (attr->parent_out) { + attr->parent_out->filedes = pipe_open(attr->parent_out->fname, O_WRONLY); + } + if (attr->parent_in) { + attr->parent_in->filedes = pipe_open(attr->parent_in->fname, O_RDONLY); + } + if (attr->parent_err) { + attr->parent_err->filedes = pipe_open(attr->parent_err->fname, O_RDONLY); + } + apr_pool_cleanup_register(cont, (void *)newproc, apr_netware_proc_cleanup, apr_pool_cleanup_null); } From 3bfa61b7d25ac46f47fae7ef7c63406eb290638d Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 5 Mar 2002 19:53:05 +0000 Subject: [PATCH 3078/7878] Added NetWare to the WIN32 definition of types used in the apr_stat and other file_io areas. Also removed the #define of sleep since it is now included in LibC git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63084 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 2 +- include/arch/netware/apr_private.h | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 377f3c89012..1f5d08d020f 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -124,7 +124,7 @@ typedef struct apr_dir_t apr_dir_t; * @defvar apr_fileperms_t */ typedef apr_int32_t apr_fileperms_t; -#ifdef WIN32 +#if (defined WIN32) || (defined NETWARE) /** * Structure for determining the inode of the file. * @defvar apr_ino_t diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 43575521b65..d5bc80c4e68 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -147,7 +147,6 @@ typedef void (Sigfunc)(int); #endif #define strcasecmp(s1, s2) stricmp(s1, s2) -#define sleep(t) delay(t * 1000) #define Sleep(t) delay(t) #define lstat(a,b) stat(a,b) @@ -180,8 +179,5 @@ void* getStatCache(); #undef malloc #define malloc(x) library_malloc(gLibHandle,x) -/* Changes that are waiting for an updated runtime library. */ -#define WAITING_FOR_UPDATE - #endif /*APR_PRIVATE_H*/ #endif /*NETWARE*/ From 7db841c6c46336ede3da7ece0a52700133b9a0ee Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 5 Mar 2002 22:08:39 +0000 Subject: [PATCH 3079/7878] Moved the memcpy() ahead of the hash table set to avoid a race condition. This makes sure that there is valid data in the entry when it is set in the hash table. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63085 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 93de042863b..e3ca272cb99 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -255,6 +255,8 @@ int cstat (const char *path, struct stat *buf) if (!stat_entry) { key = apr_pstrdup (gPool, path); stat_entry = apr_palloc (gPool, sizeof(apr_stat_entry_t)); + memcpy (&(stat_entry->info), buf, sizeof(struct stat)); + stat_entry->expire = now; #ifdef USE_CSTAT_MUTEX apr_thread_mutex_lock(statcache_mutex); #endif @@ -263,8 +265,10 @@ int cstat (const char *path, struct stat *buf) apr_thread_mutex_unlock(statcache_mutex); #endif } - memcpy (&(stat_entry->info), buf, sizeof(struct stat)); - stat_entry->expire = now; + else { + memcpy (&(stat_entry->info), buf, sizeof(struct stat)); + stat_entry->expire = now; + } } else return ret; From 04557c70017e3f79d0e47aff89bf8d70b6a2440a Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 6 Mar 2002 02:47:34 +0000 Subject: [PATCH 3080/7878] Win32: Fix APR_XTHREAD support. A thread should have its own unique apr_file_t structure (and its own io event and overlapped structure) when doing cross thread overlapped i/o. The only application using this support that I am aware of is the Apache 2.0 file handle cache. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63086 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ file_io/win32/open.c | 8 -------- file_io/win32/readwrite.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index f7a3dd1fe58..5222599dec4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,10 @@ Changes with APR b1 + *) Win32: Fix APR_XTHREAD problems in apr_file_read() + and apr_file_write(). Multiple threads were using the + same overlapped structure and io event handle created + in the open call, which could cause unpredictable + file i/o results. [Bill Stoddard] + *) Win32: apr_proc_mutex_trylock and apr_proc_mutex_lock were incorrectly returning APR_BUSY if the lock was previously held by a thread that exited before releasing the lock diff --git a/file_io/win32/open.c b/file_io/win32/open.c index cf91d106c9a..6281a3d6ee1 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -392,14 +392,6 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, (*new)->mutex = NULL; } - if (flag & APR_XTHREAD) { - /* This win32 specific feature is required to pass - * the current offset for an overlaped file handle. - */ - (*new)->pOverlapped = (OVERLAPPED*) apr_pcalloc(cont, sizeof(OVERLAPPED)); - (*new)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - } - (*new)->pipe = 0; (*new)->timeout = -1; (*new)->ungetchar = -1; diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index d8c3c3fcf87..0ee980466e5 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -168,6 +168,20 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size return APR_SUCCESS; } + /* If the file is open for xthread support, allocate and + * initialize the overlapped and io completion event (hEvent). + * Threads should NOT share an apr_file_t or its hEvent. + */ + if ((thefile->flags & APR_XTHREAD) && !thefile->pOverlapped ) { + thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->cntxt, + sizeof(OVERLAPPED)); + thefile->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + if (!thefile->pOverlapped->hEvent) { + rv = apr_get_os_error(); + return rv; + } + } + /* Handle the ungetchar if there is one */ if (thefile->ungetchar != -1) { bytes_read = 1; @@ -239,6 +253,20 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a apr_status_t rv; DWORD bwrote; + /* If the file is open for xthread support, allocate and + * initialize the overlapped and io completion event (hEvent). + * Threads should NOT share an apr_file_t or its hEvent. + */ + if ((thefile->flags & APR_XTHREAD) && !thefile->pOverlapped ) { + thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->cntxt, + sizeof(OVERLAPPED)); + thefile->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + if (!thefile->pOverlapped->hEvent) { + rv = apr_get_os_error(); + return rv; + } + } + if (thefile->buffered) { char *pos = (char *)buf; apr_size_t blocksize; From e0fcf2ab319098d662036c1733a5349a58654a98 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 6 Mar 2002 03:23:23 +0000 Subject: [PATCH 3081/7878] Add the APR_FILE_NOCLEANUP flag to apr_file_open(). Adding the flag will prevent the file from being closed when the pool passed in on apr_file_open() is destroyed. This feature is useful when using apr_os_file_get|put() to manage the apr_os_file_t in apr_file_t (ie, file handle caching in the HTTP server) [Bill Stoddard] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63087 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++++++ file_io/os2/open.c | 5 ++++- file_io/unix/open.c | 7 +++++-- file_io/win32/open.c | 6 ++++-- include/apr_file_io.h | 6 ++++++ 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 5222599dec4..bfbee5fd1f9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,11 @@ Changes with APR b1 + *) Add the APR_FILE_NOCLEANUP flag to apr_file_open(). + Adding the flag will prevent the file from being closed + when the pool passed in on apr_file_open() is destroyed. + This feature is useful when using apr_os_file_get|put() + to manage the apr_os_file_t in apr_file_t (ie, file handle + caching in the HTTP server) [Bill Stoddard] + *) Win32: Fix APR_XTHREAD problems in apr_file_read() and apr_file_write(). Multiple threads were using the same overlapped structure and io event handle created diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 8c569098e4e..b7aea95609b 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -144,7 +144,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->dataRead = 0; dafile->direction = 0; dafile->pipe = FALSE; - apr_pool_cleanup_register(dafile->cntxt, dafile, apr_file_cleanup, apr_file_cleanup); + + if (!(flag & APR_FILE_NOCLEANUP)) { + apr_pool_cleanup_register(dafile->cntxt, dafile, apr_file_cleanup, apr_file_cleanup); + } return APR_SUCCESS; } diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 0ba47f48297..8cb700ced38 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -172,8 +172,11 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, (*new)->bufpos = 0; (*new)->dataRead = 0; (*new)->direction = 0; - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), - apr_unix_file_cleanup, apr_unix_file_cleanup); + + if (!(flag & APR_FILE_NOCLEANUP)) { + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + apr_unix_file_cleanup, apr_unix_file_cleanup); + } return APR_SUCCESS; } diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 6281a3d6ee1..465ae6448aa 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -403,8 +403,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, (*new)->direction = 0; (*new)->filePtr = 0; - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), file_cleanup, - apr_pool_cleanup_null); + if (!(flag & APR_FILE_NOCLEANUP)) { + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), file_cleanup, + apr_pool_cleanup_null); + } return APR_SUCCESS; } diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 166a2b67d54..fe512edcbc2 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -101,6 +101,8 @@ extern "C" { #define APR_SHARELOCK 1024 /**< Platform dependent support for higher level locked read/write access to support writes across process/machines */ +#define APR_FILE_NOCLEANUP 2048 /**< Do not register a cleanup when the file + is opened */ /** @} */ @@ -179,6 +181,10 @@ typedef struct apr_file_t apr_file_t; * APR_SHARELOCK Platform dependent support for higher * level locked read/write access to support * writes across process/machines + * APR_FILE_NOCLEANUP Do not register a cleanup with the pool + * passed in on the cont argument (see below). + * The apr_os_file_t handle in apr_file_t will not + & be closed when the pool is destroyed. * * @param perm Access permissions for file. * @param cont The pool to use. From 20d15b36bb6e02a5505d321340b231247a3d8c37 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 6 Mar 2002 03:35:33 +0000 Subject: [PATCH 3082/7878] Warming up tomorrow... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63088 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 465ae6448aa..841ac4dee25 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -511,7 +511,7 @@ APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, - apr_int32_t flags, + apr_int32_t flags, apr_pool_t *cont) { (*file) = apr_pcalloc(cont, sizeof(apr_file_t)); From 85c06b192f01c547be580d1169cd0f8ee6f62ceb Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 6 Mar 2002 13:05:11 +0000 Subject: [PATCH 3083/7878] These are redundant redundancies. We already wrap the whole file with APR_HAS_THREADS. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63089 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_mutex.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 7db03a2a9a3..ff7d44142cf 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -127,7 +127,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { apr_status_t rv; -#if APR_HAS_THREADS if (mutex->nested) { if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { mutex->owner_ref++; @@ -146,7 +145,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) mutex->owner_ref = 1; } else { -#endif rv = pthread_mutex_lock(&mutex->mutex); if (rv) { #ifdef PTHREAD_SETS_ERRNO @@ -155,9 +153,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) return rv; } -#if APR_HAS_THREADS } -#endif return rv; } @@ -166,7 +162,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { apr_status_t rv; -#if APR_HAS_THREADS if (mutex->nested) { if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { mutex->owner_ref++; @@ -185,7 +180,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) mutex->owner_ref = 1; } else { -#endif rv = pthread_mutex_trylock(&mutex->mutex); if (rv) { #ifdef PTHREAD_SETS_ERRNO @@ -193,9 +187,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) #endif return (rv == EBUSY) ? APR_EBUSY : rv; } -#if APR_HAS_THREADS } -#endif return rv; } @@ -204,7 +196,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { apr_status_t status; -#if APR_HAS_THREADS if (mutex->nested) { if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { mutex->owner_ref--; @@ -223,7 +214,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) mutex->owner_ref = 0; } else { -#endif status = pthread_mutex_unlock(&mutex->mutex); if (status) { #ifdef PTHREAD_SETS_ERRNO @@ -231,9 +221,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) #endif return status; } -#if APR_HAS_THREADS } -#endif return status; } From 4dc135c2526740e2df34b6c5cac1c8735fdeac44 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Wed, 6 Mar 2002 17:50:02 +0000 Subject: [PATCH 3084/7878] patches for apr to rename apr_ansi_time_to_apr_time and apr_exploded_time_t. PR: Obtained from: Submitted by: Thom May Reviewed by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63090 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ file_io/netware/filestat.c | 6 +++--- file_io/unix/filestat.c | 6 +++--- include/apr_compat.h | 4 ++-- include/apr_portable.h | 4 ++-- include/apr_time.h | 18 +++++++++--------- test/testtime.c | 2 +- time/unix/time.c | 18 +++++++++--------- time/unix/timestr.c | 6 +++--- time/win32/time.c | 18 +++++++++--------- time/win32/timestr.c | 6 +++--- 11 files changed, 48 insertions(+), 44 deletions(-) diff --git a/CHANGES b/CHANGES index bfbee5fd1f9..06609c11cb8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR b1 + *) renames: apr_ansi_time_to_apr_time becomes apr_time_ansi_put + ap_exploded_time_t becomes apr_time_exp_t + [Thom May ] + *) Add the APR_FILE_NOCLEANUP flag to apr_file_open(). Adding the flag will prevent the file from being closed when the pool passed in on apr_file_open() is destroyed. diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index e3ca272cb99..330c6e0173d 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -95,9 +95,9 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, finfo->inode = info->st_ino; finfo->device = info->st_dev; finfo->nlink = info->st_nlink; - apr_ansi_time_to_apr_time(&finfo->atime, info->st_atime); - apr_ansi_time_to_apr_time(&finfo->mtime, info->st_mtime); - apr_ansi_time_to_apr_time(&finfo->ctime, info->st_ctime); + apr_time_ansi_put(&finfo->atime, info->st_atime); + apr_time_ansi_put(&finfo->mtime, info->st_mtime); + apr_time_ansi_put(&finfo->ctime, info->st_ctime); /* ### needs to be revisited * if (wanted & APR_FINFO_CSIZE) { * finfo->csize = info->st_blocks * 512; diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index f42b9b64f1a..3f901db514d 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -94,9 +94,9 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, finfo->inode = info->st_ino; finfo->device = info->st_dev; finfo->nlink = info->st_nlink; - apr_ansi_time_to_apr_time(&finfo->atime, info->st_atime); - apr_ansi_time_to_apr_time(&finfo->mtime, info->st_mtime); - apr_ansi_time_to_apr_time(&finfo->ctime, info->st_ctime); + apr_time_ansi_put(&finfo->atime, info->st_atime); + apr_time_ansi_put(&finfo->mtime, info->st_mtime); + apr_time_ansi_put(&finfo->ctime, info->st_ctime); /* ### needs to be revisited * if (wanted & APR_FINFO_CSIZE) { * finfo->csize = info->st_blocks * 512; diff --git a/include/apr_compat.h b/include/apr_compat.h index 366c0cd5385..23a307ae09d 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -60,8 +60,8 @@ #define ap_day_snames apr_day_snames /** @deprecated @see apr_pool_destroy */ #define ap_destroy_pool apr_pool_destroy -/** @deprecated @see apr_exploded_time_t */ -#define ap_exploded_time_t apr_exploded_time_t +/** @deprecated @see apr_time_exp_t */ +#define ap_exploded_time_t apr_time_exp_t /** @deprecated @see apr_fnmatch */ #define ap_fnmatch apr_fnmatch /** @deprecated @see apr_getopt */ diff --git a/include/apr_portable.h b/include/apr_portable.h index bda6aec73b4..d28f0faa530 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -276,7 +276,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, * @param aprtime the time to convert */ APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, - apr_exploded_time_t *aprtime); + apr_time_exp_t *aprtime); /** * Get the imploded time in the platforms native format. @@ -433,7 +433,7 @@ APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, * @param ostime the time to convert * @param cont the pool to use if necessary */ -APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_exploded_time_t *aprtime, +APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont); diff --git a/include/apr_time.h b/include/apr_time.h index 5fe80028e51..0d667570133 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -106,9 +106,9 @@ APR_DECLARE(apr_time_t) apr_time_now(void); * - tm_usec isn't an ANSI field * - tm_gmtoff isn't an ANSI field (it's a bsdism) */ -typedef struct apr_exploded_time_t apr_exploded_time_t; +typedef struct apr_time_exp_t apr_time_exp_t; -struct apr_exploded_time_t { +struct apr_time_exp_t { /** microseconds past tm_sec */ apr_int32_t tm_usec; /** (0-61) seconds past tm_min */ @@ -138,7 +138,7 @@ struct apr_exploded_time_t { * @param result the resulting apr_time_t * @param input the time_t to convert */ -APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, +APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, time_t input); /** @@ -149,7 +149,7 @@ APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, * @param offs the number of seconds offset to apply * @param zone the zone description */ -APR_DECLARE(apr_status_t) apr_explode_time(apr_exploded_time_t *result, +APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, apr_time_t input, apr_int32_t offs); @@ -158,7 +158,7 @@ APR_DECLARE(apr_status_t) apr_explode_time(apr_exploded_time_t *result, * @param result the exploded time * @param input the time to explode */ -APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, +APR_DECLARE(apr_status_t) apr_explode_gmt(apr_time_exp_t *result, apr_time_t input); /** @@ -166,7 +166,7 @@ APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, * @param result the exploded time * @param input the time to explode */ -APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, +APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, apr_time_t input); /** @@ -176,7 +176,7 @@ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, * @param input the input exploded time */ APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *result, - apr_exploded_time_t *input); + apr_time_exp_t *input); /** * Convert time value from human readable format to a numeric apr_time_t that @@ -185,7 +185,7 @@ APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *result, * @param input the input exploded time */ APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *result, - apr_exploded_time_t *input); + apr_time_exp_t *input); /** * Sleep for the specified number of micro-seconds. @@ -230,7 +230,7 @@ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t); */ APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, - apr_exploded_time_t *tm); + apr_time_exp_t *tm); #ifdef __cplusplus } diff --git a/test/testtime.c b/test/testtime.c index 75500fb2856..e29b1b8d0ae 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -65,7 +65,7 @@ int main(void) { apr_time_t now; - apr_exploded_time_t xt, xt2; + apr_time_exp_t xt, xt2; apr_time_t imp; apr_pool_t *p; char *str, *str2; diff --git a/time/unix/time.c b/time/unix/time.c index 87c54e08e9d..13f69d266d8 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -100,7 +100,7 @@ static apr_int32_t get_offset(struct tm *tm) #endif } -APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, +APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, time_t input) { *result = (apr_time_t)input * APR_USEC_PER_SEC; @@ -115,7 +115,7 @@ APR_DECLARE(apr_time_t) apr_time_now(void) return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec; } -static void explode_time(apr_exploded_time_t *xt, apr_time_t t, +static void explode_time(apr_time_exp_t *xt, apr_time_t t, apr_int32_t offset, int use_localtime) { struct tm tm; @@ -146,7 +146,7 @@ static void explode_time(apr_exploded_time_t *xt, apr_time_t t, xt->tm_gmtoff = get_offset(&tm); } -APR_DECLARE(apr_status_t) apr_explode_time(apr_exploded_time_t *result, apr_time_t input, +APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, apr_time_t input, apr_int32_t offs) { explode_time(result, input, offs, 0); @@ -154,12 +154,12 @@ APR_DECLARE(apr_status_t) apr_explode_time(apr_exploded_time_t *result, apr_time return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input) +APR_DECLARE(apr_status_t) apr_explode_gmt(apr_time_exp_t *result, apr_time_t input) { return apr_explode_time(result, input, 0); } -APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input) +APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, apr_time_t input) { #if defined(__EMX__) /* EMX gcc (OS/2) has a timezone global we can use */ @@ -170,7 +170,7 @@ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, apr #endif /* __EMX__ */ } -APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt) +APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, apr_time_exp_t *xt) { int year; time_t days; @@ -201,7 +201,7 @@ APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, apr_exploded_time_t *x return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, apr_exploded_time_t *xt) +APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, apr_time_exp_t *xt) { apr_status_t status = apr_implode_time(t, xt); if (status == APR_SUCCESS) @@ -218,7 +218,7 @@ APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, } APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, - apr_exploded_time_t *aprtime) + apr_time_exp_t *aprtime) { (*ostime)->tm_sec = aprtime->tm_sec; (*ostime)->tm_min = aprtime->tm_min; @@ -244,7 +244,7 @@ APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_ti return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_exploded_time_t *aprtime, +APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) { aprtime->tm_sec = (*ostime)->tm_sec; diff --git a/time/unix/timestr.c b/time/unix/timestr.c index c41d876b1a8..2af9ab54308 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -79,7 +79,7 @@ APR_DECLARE_DATA const char apr_day_snames[7][4] = apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) { - apr_exploded_time_t xt; + apr_time_exp_t xt; const char *s; int real_year; @@ -127,7 +127,7 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) apr_status_t apr_ctime(char *date_str, apr_time_t t) { - apr_exploded_time_t xt; + apr_time_exp_t xt; const char *s; int real_year; @@ -168,7 +168,7 @@ apr_status_t apr_ctime(char *date_str, apr_time_t t) } apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, - const char *format, apr_exploded_time_t *xt) + const char *format, apr_time_exp_t *xt) { struct tm tm; memset(&tm, 0, sizeof tm); diff --git a/time/win32/time.c b/time/win32/time.c index 9d46ecccf87..b43449c5eaa 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -71,7 +71,7 @@ */ #define IsLeapYear(y) ((!(y % 4)) ? (((!(y % 400)) && (y % 100)) ? 1 : 0) : 0) -static void SystemTimeToAprExpTime(apr_exploded_time_t *xt, SYSTEMTIME *tm, BOOL lt) +static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm, BOOL lt) { TIME_ZONE_INFORMATION tz; DWORD rc; @@ -123,7 +123,7 @@ static void SystemTimeToAprExpTime(apr_exploded_time_t *xt, SYSTEMTIME *tm, BOOL return; } -APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result, +APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, time_t input) { *result = (apr_time_t) input * APR_USEC_PER_SEC; @@ -146,7 +146,7 @@ APR_DECLARE(apr_time_t) apr_time_now(void) return aprtime; } -APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, +APR_DECLARE(apr_status_t) apr_explode_gmt(apr_time_exp_t *result, apr_time_t input) { FILETIME ft; @@ -158,7 +158,7 @@ APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_explode_time(apr_exploded_time_t *result, +APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, apr_time_t input, apr_int32_t offs) { FILETIME ft; @@ -171,7 +171,7 @@ APR_DECLARE(apr_status_t) apr_explode_time(apr_exploded_time_t *result, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, +APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, apr_time_t input) { SYSTEMTIME st; @@ -186,7 +186,7 @@ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, } APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, - apr_exploded_time_t *xt) + apr_time_exp_t *xt) { int year; time_t days; @@ -221,7 +221,7 @@ APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, } APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, - apr_exploded_time_t *xt) + apr_time_exp_t *xt) { apr_status_t status = apr_implode_time(t, xt); if (status == APR_SUCCESS) @@ -238,7 +238,7 @@ APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, } APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, - apr_exploded_time_t *aprexptime) + apr_time_exp_t *aprexptime) { (*ostime)->wYear = aprexptime->tm_year + 1900; (*ostime)->wMonth = aprexptime->tm_mon + 1; @@ -261,7 +261,7 @@ APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_exploded_time_t *aprtime, +APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont) { diff --git a/time/win32/timestr.c b/time/win32/timestr.c index b30440e4b99..7b6969fa29b 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -67,7 +67,7 @@ APR_DECLARE_DATA const char apr_day_snames[7][4] = APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t) { - apr_exploded_time_t xt; + apr_time_exp_t xt; const char *s; int real_year; @@ -115,7 +115,7 @@ APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t) APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t) { - apr_exploded_time_t xt; + apr_time_exp_t xt; const char *s; int real_year; @@ -220,7 +220,7 @@ int win32_strftime_extra(char *s, size_t max, const char *format, APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, - apr_exploded_time_t *xt) + apr_time_exp_t *xt) { struct tm tm; memset(&tm, 0, sizeof tm); From 41f3fdd2dd17dc859a4b42e9fbce23f862e5b26f Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 6 Mar 2002 20:29:39 +0000 Subject: [PATCH 3085/7878] Reflect the current status of the pending renames. Submitted by: Thom May git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63092 13f79535-47bb-0310-9956-ffa450edef68 --- renames_pending | 4 ---- 1 file changed, 4 deletions(-) diff --git a/renames_pending b/renames_pending index a84eceb1f1c..39f96d14087 100644 --- a/renames_pending +++ b/renames_pending @@ -1,9 +1,5 @@ Symbol renames for APR -apr_time_ansi_put from apr_ansi_time_to_apr_time - -apr_time_exp_t from apr_exploded_time_t - apr_time_exp_get from apr_implode_time apr_time_exp_gmt from apr_explode_gmt apr_time_exp_lt from apr_explode_localtime From 16ccce09bd7945970bc0d45d43fff009f946eef2 Mon Sep 17 00:00:00 2001 From: Brian Fitzpatrick Date: Thu, 7 Mar 2002 15:37:09 +0000 Subject: [PATCH 3086/7878] update for Mac OS X. -traditional-cpp is no longer recommended. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63093 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 3c1601d8c47..31d1613ff01 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -149,7 +149,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DRHAPSODY]) ;; *-apple-darwin*) - APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -traditional-cpp]) + APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp]) ;; *-dec-osf*) APR_ADDTO(CPPFLAGS, [-DOSF1]) From b538c15c928d5b19255525242b84fcb331fb5a1f Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Thu, 7 Mar 2002 16:58:02 +0000 Subject: [PATCH 3087/7878] Make include inttypes.h conditional to HAVE_INTTYPES_H. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63094 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/mktemp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 99a712a4fb7..bde27cbca07 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -94,8 +94,10 @@ #if defined(SVR4) || defined(WIN32) || defined(NETWARE) #ifdef SVR4 +#if HAVE_INTTYPES_H #include #endif +#endif #define arc4random() rand() #define seedrandom(a) srand(a) #else From 7e8a82ee656cddce54ad64c4ca15c235070eab64 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 7 Mar 2002 19:10:31 +0000 Subject: [PATCH 3088/7878] This is an ugly patch, but fixes a bug when subdir's are actually symlinks to the real locations. For example, let's assume we have something like this: $ pwd /disk2/jim/src/CVS $ ls apr apr-util httpd-2.0 and httpd-2.0/srclib/apr is actually a symlink to ../../apr. Under Solaris, 'sh' (and maybe others) have this behavior: $ cd httpd-2.0 $ pwd /disk2/jim/src/CVS/httpd-2.0 $ cd srclib/apr $ pwd /disk2/jim/src/CVS/apr Thus, when APR_SUBDIR_CONFIG makes the cache-file pathname relative, we point someplace else. Ensuring that cache-file is absolute fixes this problem and means there's little restriction on the layouts of your httpd-2.0 tree. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63095 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 363d357970a..5b42ce49484 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -68,11 +68,14 @@ changequote(, )dnl ac_dots=`echo $apr_config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` changequote([, ])dnl - # Make the cache file name correct relative to the subdirectory. + # Make the cache file pathname absolute for the subdirs + # required to correctly handle subdirs that might actually + # be symlinks case "$cache_file" in - /*) ac_sub_cache_file=$cache_file ;; - *) # Relative path. - ac_sub_cache_file="$ac_dots$cache_file" ;; + /*) # already absolute + ac_sub_cache_file=$cache_file ;; + *) # Was relative path. + ac_sub_cache_file="$ac_popdir/$cache_file" ;; esac # The eval makes quoting arguments work. From 1b9c898b165f65f2330ab3ed81b791b264f7624c Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 8 Mar 2002 01:50:05 +0000 Subject: [PATCH 3089/7878] We actually need to bubble up errno for this... can't assume that it always succeeds hence sysv_destroy is bogus. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63096 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/crossproc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 55947572280..8280a94c990 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -77,12 +77,15 @@ static apr_status_t sysv_cleanup(void *lock_) { apr_lock_t *lock=lock_; union semun ick; + apr_status_t stat = APR_SUCCESS; if (lock->interproc->filedes != -1) { ick.val = 0; - semctl(lock->interproc->filedes, 0, IPC_RMID, ick); + if (semctl(lock->interproc->filedes, 0, IPC_RMID, ick) < 0) { + stat = errno; + } } - return APR_SUCCESS; + return stat; } static apr_status_t sysv_create(apr_lock_t *new, const char *fname) From 32b866e0b77d43daeb0e0bc36363aaeeccc5f1cc Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Fri, 8 Mar 2002 17:56:14 +0000 Subject: [PATCH 3090/7878] Add a new m4 function, APR_PATH_RELATIVE, which takes a path variable and a prefix path to strip, and will only strip if they are relative. It also ensures that any additional /'s on the front of the stripped path are removed. Submitted by: Thom May , Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63097 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 5b42ce49484..f6e32b7dc3c 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -580,3 +580,23 @@ done $1=$cur ]) +dnl +dnl Removes the value of $3 from the string in $2, strips of any leading +dnl slashes, and returns the value in $1. +dnl +dnl Example: +dnl orig_path="${prefix}/bar" +dnl APR_PATH_RELATIVE(final_path, $orig_path, $prefix) +dnl $final_path now contains "bar" +AC_DEFUN(APR_PATH_RELATIVE,[ +stripped=`echo $2 | sed -e "s#^$3##"` +# check if the stripping was successful +if test "x$2" != "x$stripped"; then + # it was, so strip of any leading slashes + $1=`echo $stripped | sed -e 's#^/*##'` +else + # it wasn't so return the original + $1=$2 +fi +]) + From 8bca7bc1258b7784ceab76abc9af8c502b3ac6a4 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 9 Mar 2002 19:26:13 +0000 Subject: [PATCH 3091/7878] Allow APR to install its own libtool into an installbuilddir. Add --with-installbuilddir to configure. Add --apr-libtool option to apr-config so that third-parties can figure out where this generated libtool is. (Previously, httpd-2.0 would copy libtool for APR which isn't very nice.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63098 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ Makefile.in | 20 +++++++++++++++----- apr-config.in | 11 +++++++++++ configure.in | 4 ++++ 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 06609c11cb8..5aacb27a75b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ Changes with APR b1 + + *) Allow APR to install its generated libtool(s) via the + --with-installbuilddir option (defaults to ${datadir}/build). + [Justin Erenkrantz] + *) renames: apr_ansi_time_to_apr_time becomes apr_time_ansi_put ap_exploded_time_t becomes apr_time_exp_t [Thom May ] diff --git a/Makefile.in b/Makefile.in index 0df0faf37c2..25209241bac 100644 --- a/Makefile.in +++ b/Makefile.in @@ -40,6 +40,7 @@ exec_prefix=@exec_prefix@ bindir=@bindir@ libdir=@libdir@ includedir=@includedir@ +installbuilddir=@installbuilddir@ srcdir=@srcdir@ top_srcdir=@top_srcdir@ top_blddir=@top_builddir@ @@ -59,15 +60,24 @@ delete-lib: install: $(TARGET_LIB) if [ ! -d $(includedir) ]; then \ $(top_srcdir)/build/mkdir.sh $(includedir); \ - fi; \ - cp $(top_srcdir)/include/*.h $(includedir); \ - cp $(top_blddir)/include/*.h $(includedir); \ + fi; + cp $(top_srcdir)/include/*.h $(includedir); + cp $(top_blddir)/include/*.h $(includedir); if [ ! -d $(libdir) ]; then \ $(top_srcdir)/build/mkdir.sh $(libdir); \ - fi; \ + fi; $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(libdir) $(LIBTOOL) --mode=install cp APRVARS $(libdir) $(LIBTOOL) --mode=install cp apr.exp $(libdir) + if [ ! -d $(installbuilddir) ]; then \ + $(top_srcdir)/build/mkdir.sh $(installbuilddir); \ + fi; + if [ -f libtool ]; then \ + $(LIBTOOL) --mode=install cp libtool $(installbuilddir); \ + fi; + if [ -f shlibtool ]; then \ + $(LIBTOOL) --mode=install cp shlibtool $(installbuilddir); \ + fi; if [ ! -d $(bindir) ]; then \ $(top_srcdir)/build/mkdir.sh $(bindir); \ fi; @@ -77,7 +87,7 @@ install: $(TARGET_LIB) for i in $(INSTALL_SUBDIRS); do \ ( cd $$i ; $(MAKE) install ); \ done \ - fi + fi $(TARGET_LIB): @for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \ diff --git a/apr-config.in b/apr-config.in index 0f87a414a10..6d829cdc5be 100644 --- a/apr-config.in +++ b/apr-config.in @@ -59,6 +59,8 @@ prefix="@prefix@" exec_prefix="@exec_prefix@" bindir="@bindir@" libdir="@libdir@" +datadir="@datadir@" +installbuilddir="@installbuilddir@" includedir="@includedir@" CC="@CC@" @@ -92,6 +94,7 @@ Known values for OPTION are: --apr-la-file print the path to the .la file, if available --apr-so-ext print the extensions of shared objects on this platform --apr-lib-target print the libtool target information + --apr-libtool print the path to APR's libtool --help print this help When linking with libtool, an application should do something like: @@ -199,6 +202,14 @@ while test $# -gt 0; do echo "$APR_LIB_TARGET" exit 0 ;; + --apr-libtool) + if test "$location" = "installed"; then + echo "${SHELL} ${installbuilddir}/libtool" + else + echo "${SHELL} $thisdir/libtool" + fi + exit 0 + ;; --help) show_usage exit 0 diff --git a/configure.in b/configure.in index 08be0290380..4f454d532c7 100644 --- a/configure.in +++ b/configure.in @@ -121,6 +121,10 @@ AC_PROG_LIBTOOL ;; esac +AC_ARG_WITH(installbuilddir, [ --with-installbuilddir= location to store APR build files (defaults to '${datadir}/build')], + [ installbuilddir=$withval ], [ installbuilddir="${datadir}/build" ] ) +AC_SUBST(installbuilddir) + AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the library], [ use_libtool=$withval ], [ use_libtool="yes" ] ) From 9cb7cd50834084bce35abb2f076440adab7fa41a Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 10 Mar 2002 17:20:26 +0000 Subject: [PATCH 3092/7878] Optimized away the initialization of newly allocated table elements to NULL in table_push(), because this data always gets overwritten immediately after the table_push() call. Also eliminated the zero-fill of bytes that are immediately overwritten in the branch of apr_array_push() that resizes the array. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63099 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ tables/apr_tables.c | 25 ++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 5aacb27a75b..90f4a456a16 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Small table performance optimization: eliminate the + zero-fill of newly allocated elements when expanding + a table's size. [Brian Pane] + *) Allow APR to install its generated libtool(s) via the --with-installbuilddir option (defaults to ${datadir}/build). [Justin Erenkrantz] diff --git a/tables/apr_tables.c b/tables/apr_tables.c index de75dc158fc..b634d4a9a97 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -128,7 +128,26 @@ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr) int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2; char *new_data; - new_data = apr_pcalloc(arr->pool, arr->elt_size * new_size); + new_data = apr_palloc(arr->pool, arr->elt_size * new_size); + + memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size); + memset(new_data + arr->nalloc * arr->elt_size, 0, + arr->elt_size * (new_size - arr->nalloc)); + arr->elts = new_data; + arr->nalloc = new_size; + } + + ++arr->nelts; + return arr->elts + (arr->elt_size * (arr->nelts - 1)); +} + +static void *apr_array_push_noclear(apr_array_header_t *arr) +{ + if (arr->nelts == arr->nalloc) { + int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2; + char *new_data; + + new_data = apr_palloc(arr->pool, arr->elt_size * new_size); memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size); arr->elts = new_data; @@ -331,10 +350,10 @@ static apr_table_entry_t *table_push(apr_table_t *t) if (t->a.nelts == t->a.nalloc) { return NULL; } - return (apr_table_entry_t *) apr_array_push(&t->a); + return (apr_table_entry_t *) apr_array_push_noclear(&t->a); } #else /* MAKE_TABLE_PROFILE */ -#define table_push(t) ((apr_table_entry_t *) apr_array_push(&(t)->a)) +#define table_push(t) ((apr_table_entry_t *) apr_array_push_noclear(&(t)->a)) #endif /* MAKE_TABLE_PROFILE */ From 7aa05ef6d9166ea069bf275ae7182df5a304bf47 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 11 Mar 2002 17:22:32 +0000 Subject: [PATCH 3093/7878] configure now sets APR_RESOLV_RETRANSRETRY is the dns's timeout/retry settings can be changed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63100 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ build/apr_network.m4 | 28 ++++++++++++++++++++++++++++ configure.in | 3 +++ 3 files changed, 34 insertions(+) diff --git a/CHANGES b/CHANGES index 90f4a456a16..563e6dc59fd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ Changes with APR b1 + + *) configure now checks to see if we can change timeout values + [Ian Holsman] *) Small table performance optimization: eliminate the zero-fill of newly allocated elements when expanding diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 4645abd4f2b..4e279af7ccd 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -139,6 +139,34 @@ if test "$ac_cv_negative_eai" = "yes"; then fi ]) +dnl +dnl check for presence of retrans/retry variables in the res_state structure +dnl +AC_DEFUN(APR_CHECK_RESOLV_RETRANS,[ + AC_CACHE_CHECK(for presence of retrans/retry fields in res_state/resolv.h , ac_cv_retransretry,[ + AC_TRY_RUN( [ +#include +#include +#include +/* _res is a global defined in resolv.h */ +void main(void) { + _res.retrans = 2; + _res.retry = 1; + exit(0); +} +],[ + ac_cv_retransretry="yes" +],[ + ac_cv_retransretry="no" +],[ + ac_cv_retransretry="no" +])]) +if test "$ac_cv_retransretry" = "yes"; then + AC_DEFINE(RESOLV_RETRANSRETRY, 1, [Define if resolv.h's res_state has the fields retrans/rety]) +fi +]) + + dnl dnl check for gethostbyname() which handles numeric address strings dnl diff --git a/configure.in b/configure.in index 4f454d532c7..e4e038f346b 100644 --- a/configure.in +++ b/configure.in @@ -412,6 +412,7 @@ dnl Note: Autoconf will always append LIBS with an extra " " in AC_CHECK_LIB. dnl It should check for LIBS being empty and set LIBS equal to the new value dnl without the extra " " in that case, but they didn't do that. So, we dnl end up LIBS="-lm -lcrypt -lnsl -ldl" which is an annoyance. +AC_CHECK_LIB(resolv, res_init) AC_CHECK_LIB(nsl, gethostbyname) AC_SEARCH_LIBS(gethostname, nsl) AC_CHECK_LIB(socket, socket) @@ -1491,6 +1492,7 @@ AC_SUBST(have_corkable_tcp) AC_SUBST(acceptfilter) AC_CHECK_FUNCS(set_h_errno) +APR_CHECK_RESOLV_RETRANS echo $ac_n "${nl}Checking for IPv6 Networking support...${nl}" dnl # Start of checking for IPv6 support... @@ -1510,6 +1512,7 @@ APR_CHECK_WORKING_GETADDRINFO APR_CHECK_NEGATIVE_EAI APR_CHECK_WORKING_GETNAMEINFO APR_CHECK_SOCKADDR_IN6 + AC_MSG_CHECKING(if APR supports IPv6) have_ipv6="0" if test "$user_disabled_ipv6" = 1; then From ebdd507c82a63628b8d08d3f7477c7c7db6ea0c9 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Mon, 11 Mar 2002 17:29:06 +0000 Subject: [PATCH 3094/7878] Blow stuff away more thoroughly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63101 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 25209241bac..ad5b6b7c058 100644 --- a/Makefile.in +++ b/Makefile.in @@ -100,8 +100,8 @@ delete-exports: headers="`find include/*.h -newer apr.exp`" ; \ if test -n "$$headers"; then \ echo Found newer headers. Will rebuild apr.exp. ; \ - echo $(RM) -f apr.exp ; \ - $(RM) -f apr.exp ; \ + echo $(RM) -f apr.exp exports.c export_vars.h ; \ + $(RM) -f apr.exp exports.c export_vars.h ; \ fi \ fi From 33fc83ec9691496e93e12353fddf62a7ba7621f1 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 11 Mar 2002 17:33:39 +0000 Subject: [PATCH 3095/7878] make it work on linux git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63102 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 4e279af7ccd..927adeb8be1 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -146,13 +146,16 @@ AC_DEFUN(APR_CHECK_RESOLV_RETRANS,[ AC_CACHE_CHECK(for presence of retrans/retry fields in res_state/resolv.h , ac_cv_retransretry,[ AC_TRY_RUN( [ #include +#if defined(__sun__) #include +#endif #include /* _res is a global defined in resolv.h */ -void main(void) { +int main(void) { _res.retrans = 2; _res.retry = 1; exit(0); + return 0; } ],[ ac_cv_retransretry="yes" From d3fb87fa7a73b05f362057b9eecc6029c397209c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 11 Mar 2002 21:16:22 +0000 Subject: [PATCH 3096/7878] add a testcase for the type of problem seen in Apache PR 10003 (mod_negotiation) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63103 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/test/testfile.c b/test/testfile.c index 79681c5d7c6..32b2f131942 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -89,6 +89,7 @@ void test_filedel(apr_pool_t *); void testdirs(apr_pool_t *); static void test_read(apr_pool_t *); static void test_read_seek(apr_int32_t, apr_pool_t *); +static void test_mod_neg(apr_pool_t *, apr_int32_t); int main(void) { @@ -240,6 +241,8 @@ int main(void) testdirs(pool); test_filedel(pool); test_read(pool); + test_mod_neg(pool, 0); /* unbuffered */ + test_mod_neg(pool, APR_BUFFERED); apr_pool_destroy(pool); @@ -585,9 +588,12 @@ static void test_read_seek(apr_int32_t moreflags, apr_pool_t *p) assert(nbytes == strlen(str3) + strlen(str1) + strlen(str2) + strlen(str3)); assert(!memcmp(buf, str3, strlen(str3))); + /* seek back a couple of strings */ seek_amt = -(apr_off_t)(nbytes - strlen(str3) - strlen(str1)); rv = apr_file_seek(f, APR_CUR, &seek_amt); assert(!rv); + /* seek_amt should be updated with the current offset into the file */ + assert(seek_amt == strlen(str1) + strlen(str2) + strlen(str3) + strlen(str1)); rv = apr_file_gets(buf, sizeof buf, f); assert(!rv); @@ -603,3 +609,81 @@ static void test_read_seek(apr_int32_t moreflags, apr_pool_t *p) rv = apr_file_remove(fname, p); assert(!rv); } + +static void test_mod_neg(apr_pool_t *p, apr_int32_t flags) +{ + apr_status_t rv; + apr_file_t *f; + const char *s; + int i; + apr_ssize_t nbytes; + char buf[8192]; + apr_off_t cur; + const char *fname = "modneg.dat"; + + printf(" Testing mod_negotiation-style file access (%sbuffered)...\n", + !flags ? "un" : ""); + + rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); + assert(!rv); + + s = "body56789\n"; + nbytes = strlen(s); + rv = apr_file_write(f, s, &nbytes); + assert(!rv); + assert(nbytes == strlen(s)); + + for (i = 0; i < 7980; i++) { + s = "0"; + nbytes = strlen(s); + rv = apr_file_write(f, s, &nbytes); + assert(!rv); + assert(nbytes == strlen(s)); + } + + s = "end456789\n"; + nbytes = strlen(s); + rv = apr_file_write(f, s, &nbytes); + assert(!rv); + assert(nbytes == strlen(s)); + + for (i = 0; i < 10000; i++) { + s = "1"; + nbytes = strlen(s); + rv = apr_file_write(f, s, &nbytes); + assert(!rv); + assert(nbytes == strlen(s)); + } + + rv = apr_file_close(f); + assert(!rv); + + rv = apr_file_open(&f, fname, APR_READ | flags, 0, p); + assert(!rv); + + rv = apr_file_gets(buf, 11, f); + assert(!rv); + assert(!strcmp(buf, "body56789\n")); + + cur = 0; + rv = apr_file_seek(f, APR_CUR, &cur); + assert(!rv); + assert(cur == 10); + + nbytes = sizeof(buf); + rv = apr_file_read(f, buf, &nbytes); + assert(!rv); + assert(nbytes == sizeof(buf)); + + cur = -(nbytes - 7980); + rv = apr_file_seek(f, APR_CUR, &cur); + assert(!rv); + assert(cur == 7990); + + rv = apr_file_gets(buf, 11, f); + assert(!rv); + assert(!strcmp(buf, "end456789\n")); + + rv = apr_file_remove(fname, p); + assert(!rv); +} From 798ef040a49ec4c0bce86f632b31629dc878becc Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 11 Mar 2002 22:05:51 +0000 Subject: [PATCH 3097/7878] fix the type of the nbytes parm to apr_file_read and apr_file_write git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63104 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testfile.c b/test/testfile.c index 32b2f131942..821c2d9a3e3 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -616,7 +616,7 @@ static void test_mod_neg(apr_pool_t *p, apr_int32_t flags) apr_file_t *f; const char *s; int i; - apr_ssize_t nbytes; + apr_size_t nbytes; char buf[8192]; apr_off_t cur; const char *fname = "modneg.dat"; From 7ca7bf2fbbf5b3b92c5dbd3676521cdb5e910ae0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 11 Mar 2002 22:17:29 +0000 Subject: [PATCH 3098/7878] fix a problem in apr_file_seek on Unix for buffered files PR: 10003 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63105 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/unix/seek.c | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 563e6dc59fd..75defd18176 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,9 @@ Changes with APR b1 *) configure now checks to see if we can change timeout values [Ian Holsman] + *) Fix a bug in apr_file_seek() on Unix when using buffered + files. PR 10003 [Jeff Trawick] + *) Small table performance optimization: eliminate the zero-fill of newly allocated elements when expanding a table's size. [Brian Pane] diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 050fca9fe4e..572a16378fb 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -74,6 +74,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) if (rc != -1 ) { thefile->bufpos = thefile->dataRead = 0; + thefile->filePtr = pos; rc = 0; } else { From a969f721ed54aa6a8166e054e906a5776b971e47 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 12 Mar 2002 13:22:39 +0000 Subject: [PATCH 3099/7878] add a cast so that gcc 2.7.2.3 on FreeBSD 3.4 generates the right code git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63106 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testfile.c b/test/testfile.c index 821c2d9a3e3..e096603e379 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -675,7 +675,7 @@ static void test_mod_neg(apr_pool_t *p, apr_int32_t flags) assert(!rv); assert(nbytes == sizeof(buf)); - cur = -(nbytes - 7980); + cur = -((apr_off_t)nbytes - 7980); rv = apr_file_seek(f, APR_CUR, &cur); assert(!rv); assert(cur == 7990); From 8e3e087b3ffdfbc8357633ad4b3e2d106148dff6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 12 Mar 2002 15:30:15 +0000 Subject: [PATCH 3100/7878] Fix a segfault in apr_thread_rwlock_destroy() on Win32. The pool field in the lock was uninitialized. Submitted by: INOUE Seiichiro Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63107 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ locks/win32/thread_rwlock.c | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 75defd18176..b0171653a1a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ Changes with APR b1 + + *) Fix a segfault in apr_thread_rwlock_destroy() on Win32. + [INOUE Seiichiro ] *) configure now checks to see if we can change timeout values [Ian Holsman] diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c index 67708c85a2f..128cfd15e83 100644 --- a/locks/win32/thread_rwlock.c +++ b/locks/win32/thread_rwlock.c @@ -72,6 +72,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, apr_pool_t *pool) { (*rwlock) = apr_palloc(pool, sizeof(**rwlock)); + (*rwlock)->pool = pool; (*rwlock)->readevent=CreateEvent(NULL,TRUE,FALSE,NULL); (*rwlock)->mutex = CreateEvent(NULL,FALSE,TRUE,NULL); (*rwlock)->writemutex = CreateMutex(NULL,FALSE,NULL); From 1779c14eb50c31060a38bf94c7e8b2be4db880aa Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Tue, 12 Mar 2002 17:03:40 +0000 Subject: [PATCH 3101/7878] gcc defines __sparc__ but Sun compilers define sparc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63108 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 63deeca3bd8..36c484bc829 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -198,7 +198,7 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #define APR_ATOMIC_NEED_CAS_DEFAULT 1 -#elif defined(__sparc__) +#elif defined(__sparc__) || defined(sparc) #define apr_atomic_t apr_uint32_t #define apr_atomic_read(p) *p From 1c134660b24b76ed5ff3aadb6db11c6e4ee36381 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Tue, 12 Mar 2002 17:30:27 +0000 Subject: [PATCH 3102/7878] make test fails because there is no subdirectory test in test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63109 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index ad5b6b7c058..9014fbc9ebd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -123,7 +123,6 @@ dox: test: $(TARGET_LIB) (cd test; make clean; make; \ - cd test; \ for prog in `find . -type f -perm +u+x -name "test*" -print`; do \ ./$$prog; \ if [ $$? -eq 255 ]; then \ From 9df9bc7afa93ae77f71d739a81e3e61b6e82e2a9 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Tue, 12 Mar 2002 17:56:02 +0000 Subject: [PATCH 3103/7878] Typo. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63110 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 9014fbc9ebd..84bce00a922 100644 --- a/Makefile.in +++ b/Makefile.in @@ -123,7 +123,7 @@ dox: test: $(TARGET_LIB) (cd test; make clean; make; \ - for prog in `find . -type f -perm +u+x -name "test*" -print`; do \ + for prog in `find . -type f -perm -u+x -name "test*" -print`; do \ ./$$prog; \ if [ $$? -eq 255 ]; then \ echo "$$prog failed"; \ From 83372f77422b6a8bd2154bf8ab5ceb9a54a0950e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 12 Mar 2002 18:39:47 +0000 Subject: [PATCH 3104/7878] There is no apparent need to expose the guts of apr_ipsubnet_t, so move the definition to sa_common.c, the only file that needs to have that information. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63111 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 15 ++------------- network_io/unix/sa_common.c | 11 +++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index ae224efae55..f3303078f10 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -191,6 +191,8 @@ typedef struct apr_pollfd_t apr_pollfd_t; */ typedef struct apr_hdtr_t apr_hdtr_t; typedef struct in_addr apr_in_addr_t; +/** A structure to represent an IP subnet */ +typedef struct apr_ipsubnet_t apr_ipsubnet_t; /** @remark use apr_uint16_t just in case some system has a short that isn't 16 bits... */ typedef apr_uint16_t apr_port_t; @@ -255,19 +257,6 @@ struct apr_hdtr_t { int numtrailers; }; -/** A structure to represent an IP subnet */ -typedef struct apr_ipsubnet_t apr_ipsubnet_t; -struct apr_ipsubnet_t { - int family; -#if APR_HAVE_IPV6 - apr_uint32_t sub[4]; /* big enough for IPv4 and IPv6 addresses */ - apr_uint32_t mask[4]; -#else - apr_uint32_t sub[1]; - apr_uint32_t mask[1]; -#endif -}; - /* function definitions */ /** diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 036c42a7de3..77070be89c3 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -74,6 +74,17 @@ #define APR_WANT_STRFUNC #include "apr_want.h" +struct apr_ipsubnet_t { + int family; +#if APR_HAVE_IPV6 + apr_uint32_t sub[4]; /* big enough for IPv4 and IPv6 addresses */ + apr_uint32_t mask[4]; +#else + apr_uint32_t sub[1]; + apr_uint32_t mask[1]; +#endif +}; + #ifdef HAVE_SET_H_ERRNO #define SET_H_ERRNO(newval) set_h_errno(newval) #else From 7006463d3b3bf2870c462039ab380f86a0f0322b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 12 Mar 2002 23:10:38 +0000 Subject: [PATCH 3105/7878] clean up the way we look at the family of an apr_sockaddr_t git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63112 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 2 +- test/server.c | 2 +- test/testpoll.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/sendfile.c b/test/sendfile.c index 30797a12c7c..4ce4bb6188c 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -132,7 +132,7 @@ static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family) apr_strerror(rv, buf, sizeof buf)); exit(1); } - *family = localsa->sa.sin.sin_family; + *family = localsa->family; } } diff --git a/test/server.c b/test/server.c index 539da10ff85..86fa9cea009 100644 --- a/test/server.c +++ b/test/server.c @@ -108,7 +108,7 @@ int main(int argc, const char * const argv[]) */ APR_TEST_SUCCESS(rv, "Preparing sockaddr", apr_sockaddr_info_get(&localsa, bind_to_ipaddr, APR_UNSPEC, 8021, 0, context)) - family = localsa->sa.sin.sin_family; + family = localsa->family; } APR_TEST_SUCCESS(rv, "Creating new socket", diff --git a/test/testpoll.c b/test/testpoll.c index 0f12b293673..a6247d332a5 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -72,7 +72,7 @@ static int make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, apr_port_t port printf("couldn't create control socket information, shutting down"); return 1; } - if (apr_socket_create(sock, (*sa)->sa.sin.sin_family, SOCK_DGRAM, p) + if (apr_socket_create(sock, (*sa)->family, SOCK_DGRAM, p) != APR_SUCCESS){ printf("couldn't create UDP socket, shutting down"); return 1; From fbfb2cb1cd265d478d55c8e32c14ea6f1ec1b5fe Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 12 Mar 2002 23:40:10 +0000 Subject: [PATCH 3106/7878] Make it obvious what is now configurable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63113 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index b0171653a1a..67a95e276f7 100644 --- a/CHANGES +++ b/CHANGES @@ -3,7 +3,7 @@ Changes with APR b1 *) Fix a segfault in apr_thread_rwlock_destroy() on Win32. [INOUE Seiichiro ] - *) configure now checks to see if we can change timeout values + *) configure now checks to see if we can change DNS timeout values [Ian Holsman] *) Fix a bug in apr_file_seek() on Unix when using buffered From 7ae103787ebf2f288825e1a72042d56b4e2b4bbb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 13 Mar 2002 02:28:09 +0000 Subject: [PATCH 3107/7878] Some extra diagnostics I'm using, thought others might enjoy. This patch helps us dump WaitForsomanyObjects calls. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63114 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/misc.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/misc/win32/misc.c b/misc/win32/misc.c index cb0ad85c12c..466174bca6a 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -236,7 +236,7 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, if (!nh) { (sprintf)(sbuf, "%08x %08x %08x %s() %s:%d\n", - ha, seq, GetCurrentThreadId(), fn, fl, ln); + (DWORD)ha, seq, GetCurrentThreadId(), fn, fl, ln); (EnterCriticalSection)(&cs); (WriteFile)(fh, sbuf, strlen(sbuf), &wrote, NULL); (LeaveCriticalSection)(&cs); @@ -248,8 +248,22 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, do { HANDLE *hv = va_arg(a, HANDLE*); char *dsc = va_arg(a, char*); + if (strcmp(dsc, "Signaled") == 0) { + if ((DWORD)ha >= STATUS_WAIT_0 + && (DWORD)ha < STATUS_ABANDONED_WAIT_0) { + hv += (DWORD)ha; + } + else if ((DWORD)ha >= STATUS_ABANDONED_WAIT_0 + && (DWORD)ha < STATUS_USER_APC) { + hv += (DWORD)ha - STATUS_ABANDONED_WAIT_0; + dsc = "Abandoned"; + } + else if ((DWORD)ha == WAIT_TIMEOUT) { + dsc = "Timed Out"; + } + } (sprintf)(sbuf, "%08x %08x %08x %s(%s) %s:%d\n", - *hv, seq, GetCurrentThreadId(), + (DWORD*)*hv, seq, GetCurrentThreadId(), fn, dsc, fl, ln); (WriteFile)(fh, sbuf, strlen(sbuf), &wrote, NULL); } while (--nh); From db7abdfcc1de7e9209485de75a879a99100ae755 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 13 Mar 2002 02:29:22 +0000 Subject: [PATCH 3108/7878] Waiting on object handles and event source handles. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63115 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_dbg_win32_handles.h | 43 +++++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/include/arch/win32/apr_dbg_win32_handles.h b/include/arch/win32/apr_dbg_win32_handles.h index 175f3fd7605..09611821559 100644 --- a/include/arch/win32/apr_dbg_win32_handles.h +++ b/include/arch/win32/apr_dbg_win32_handles.h @@ -144,6 +144,12 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, #define CreateThread(sd,d1,fn,pv,d2,pd3) apr_dbg_rv(CreateThread,(sd,d1,fn,pv,d2,pd3)) +#define DeregisterEventSource(h) \ + ((BOOL)apr_dbg_log("DeregisterEventSource", \ + (HANDLE)(DeregisterEventSource)(h), \ + __FILE__,__LINE__,1, \ + &(h),"")) + #define DuplicateHandle(h1,h2,h3,ph4,d1,b,d2) \ ((BOOL)apr_dbg_log("DuplicateHandle", \ (HANDLE)(DuplicateHandle)(h1,h2,h3,ph4,d1,b,d2), \ @@ -153,9 +159,13 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, &(h2),((h1)==GetCurrentProcess()) \ ? "Source" : "EXTERN Source")) -#define GetCurrentProcess() (apr_dbg_log("GetCurrentProcess",(GetCurrentProcess)(),__FILE__,__LINE__,0)) +#define GetCurrentProcess() \ + (apr_dbg_log("GetCurrentProcess", \ + (GetCurrentProcess)(),__FILE__,__LINE__,0)) -#define GetCurrentThread() (apr_dbg_log("GetCurrentThread",(GetCurrentThread)(),__FILE__,__LINE__,0)) +#define GetCurrentThread() \ + (apr_dbg_log("GetCurrentThread", \ + (GetCurrentThread)(),__FILE__,__LINE__,0)) #define GetModuleHandleA(nm) apr_dbg_rv(GetModuleHandleA,(nm)) #define GetModuleHandleW(nm) apr_dbg_rv(GetModuleHandleW,(nm)) @@ -174,6 +184,15 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, #define OpenFileMappingA(d,b,nm) apr_dbg_rv(OpenFileMappingA,(d,b,nm)) #define OpenFileMappingW(d,b,nm) apr_dbg_rv(OpenFileMappingW,(d,b,nm)) +#define RegisterEventSourceA(s1,s2) apr_dbg_rv(RegisterEventSourceA,(s1,s2)) +#define RegisterEventSourceW(s1,s2) apr_dbg_rv(RegisterEventSourceW,(s1,s2)) + +#define SetEvent(h) \ + ((BOOL)apr_dbg_log("SetEvent", \ + (HANDLE)(SetEvent)(h), \ + __FILE__,__LINE__,1, \ + &(h),"")) + #define SetStdHandle(d,h) \ ((BOOL)apr_dbg_log("SetStdHandle", \ (HANDLE)(SetStdHandle)(d,h), \ @@ -184,6 +203,26 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, (HANDLE)(socket)(i1,i2,i3), \ __FILE__,__LINE__,0)) +#define WaitForSingleObject(h,d) \ + ((DWORD)apr_dbg_log("WaitForSingleObject", \ + (HANDLE)(WaitForSingleObject)(h,d), \ + __FILE__,__LINE__,1,&(h),"Signaled")) + +#define WaitForSingleObjectEx(h,d,b) \ + ((DWORD)apr_dbg_log("WaitForSingleObjectEx", \ + (HANDLE)(WaitForSingleObjectEx)(h,d,b), \ + __FILE__,__LINE__,1,&(h),"Signaled")) + +#define WaitForMultipleObjects(d1,ah,b,d2) \ + ((DWORD)apr_dbg_log("WaitForMultipleObjects", \ + (HANDLE)(WaitForMultipleObjects)(d1,ah,b,d2), \ + __FILE__,__LINE__,1,ah,"Signaled")) + +#define WaitForMultipleObjectsEx(d1,ah,b1,d2,b2) \ + ((DWORD)apr_dbg_log("WaitForMultipleObjectsEx", \ + (HANDLE)(WaitForMultipleObjectsEx)(d1,ah,b1,d2,b2), \ + __FILE__,__LINE__,1,ah,"Signaled")) + #define WSASocketA(i1,i2,i3,pi,g,dw) \ ((SOCKET)apr_dbg_log("WSASocketA", \ (HANDLE)(WSASocketA)(i1,i2,i3,pi,g,dw), \ From 60a064b34064f80d43b8de46adbb6c068faa868e Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 13 Mar 2002 18:13:02 +0000 Subject: [PATCH 3109/7878] Fix weird error report... not sure what brain damaged shell would misinterpret the current method, but this safes it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63116 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index f6e32b7dc3c..7bdbf84d610 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -589,7 +589,7 @@ dnl orig_path="${prefix}/bar" dnl APR_PATH_RELATIVE(final_path, $orig_path, $prefix) dnl $final_path now contains "bar" AC_DEFUN(APR_PATH_RELATIVE,[ -stripped=`echo $2 | sed -e "s#^$3##"` +stripped=`echo $2 | sed -e "s#^${3}##"` # check if the stripping was successful if test "x$2" != "x$stripped"; then # it was, so strip of any leading slashes From 0029ebfe93655ee1c7aa495a1c4281fc830be690 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Wed, 13 Mar 2002 20:39:32 +0000 Subject: [PATCH 3110/7878] Update our copyright for this year. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63117 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 2 +- atomic/solaris_sparc/apr_atomic_sparc.s | 2 +- atomic/unix/apr_atomic.c | 2 +- build/aplibtool.c | 2 +- build/rules.mk.in | 2 +- build/win32ver.awk | 4 ++-- buildconf | 2 +- dso/aix/dso.c | 2 +- dso/beos/dso.c | 2 +- dso/netware/dso.c | 2 +- dso/os2/dso.c | 2 +- dso/os390/dso.c | 2 +- dso/unix/dso.c | 2 +- dso/win32/dso.c | 2 +- file_io/netware/filestat.c | 2 +- file_io/netware/filesys.c | 2 +- file_io/netware/flock.c | 2 +- file_io/netware/pipe.c | 2 +- file_io/os2/dir.c | 2 +- file_io/os2/fileacc.c | 2 +- file_io/os2/filedup.c | 2 +- file_io/os2/filestat.c | 2 +- file_io/os2/filesys.c | 2 +- file_io/os2/flock.c | 2 +- file_io/os2/maperrorcode.c | 2 +- file_io/os2/open.c | 2 +- file_io/os2/pipe.c | 2 +- file_io/os2/readwrite.c | 2 +- file_io/os2/seek.c | 2 +- file_io/unix/dir.c | 2 +- file_io/unix/fileacc.c | 2 +- file_io/unix/filedup.c | 2 +- file_io/unix/filepath.c | 2 +- file_io/unix/filestat.c | 2 +- file_io/unix/flock.c | 2 +- file_io/unix/fullrw.c | 2 +- file_io/unix/mktemp.c | 2 +- file_io/unix/open.c | 2 +- file_io/unix/pipe.c | 2 +- file_io/unix/readwrite.c | 2 +- file_io/unix/seek.c | 2 +- file_io/win32/dir.c | 2 +- file_io/win32/filedup.c | 2 +- file_io/win32/filepath.c | 2 +- file_io/win32/filestat.c | 2 +- file_io/win32/filesys.c | 2 +- file_io/win32/flock.c | 2 +- file_io/win32/open.c | 2 +- file_io/win32/pipe.c | 2 +- file_io/win32/readwrite.c | 2 +- file_io/win32/seek.c | 2 +- i18n/unix/utf8_ucs2.c | 2 +- i18n/unix/xlate.c | 2 +- include/apr.hnw | 2 +- include/apr.hw | 2 +- include/apr_atomic.h | 2 +- include/apr_dso.h | 2 +- include/apr_errno.h | 2 +- include/apr_file_info.h | 2 +- include/apr_file_io.h | 2 +- include/apr_general.h | 2 +- include/apr_getopt.h | 2 +- include/apr_global_mutex.h | 2 +- include/apr_hash.h | 2 +- include/apr_inherit.h | 2 +- include/apr_lib.h | 2 +- include/apr_lock.h | 2 +- include/apr_md5.h | 2 +- include/apr_mmap.h | 2 +- include/apr_network_io.h | 2 +- include/apr_pools.h | 2 +- include/apr_portable.h | 2 +- include/apr_proc_mutex.h | 2 +- include/apr_ring.h | 2 +- include/apr_shm.h | 2 +- include/apr_signal.h | 2 +- include/apr_strings.h | 2 +- include/apr_tables.h | 2 +- include/apr_thread_cond.h | 2 +- include/apr_thread_mutex.h | 2 +- include/apr_thread_proc.h | 2 +- include/apr_thread_rwlock.h | 2 +- include/apr_time.h | 2 +- include/apr_user.h | 2 +- include/apr_uuid.h | 2 +- include/apr_version.h | 2 +- include/apr_want.h | 2 +- include/apr_xlate.h | 2 +- include/arch/aix/dso.h | 2 +- include/arch/beos/dso.h | 2 +- include/arch/beos/locks.h | 2 +- include/arch/beos/proc_mutex.h | 2 +- include/arch/beos/thread_cond.h | 2 +- include/arch/beos/thread_mutex.h | 2 +- include/arch/beos/thread_rwlock.h | 2 +- include/arch/beos/threadproc.h | 2 +- include/arch/netware/apr_private.h | 2 +- include/arch/netware/dso.h | 2 +- include/arch/netware/fileio.h | 2 +- include/arch/netware/global_mutex.h | 2 +- include/arch/netware/internal_time.h | 2 +- include/arch/netware/locks.h | 2 +- include/arch/netware/networkio.h | 2 +- include/arch/netware/proc_mutex.h | 2 +- include/arch/netware/thread_cond.h | 2 +- include/arch/netware/thread_mutex.h | 2 +- include/arch/netware/thread_rwlock.h | 2 +- include/arch/netware/threadproc.h | 2 +- include/arch/os2/dso.h | 2 +- include/arch/os2/fileio.h | 2 +- include/arch/os2/locks.h | 2 +- include/arch/os2/networkio.h | 2 +- include/arch/os2/os2calls.h | 2 +- include/arch/os2/proc_mutex.h | 2 +- include/arch/os2/thread_cond.h | 2 +- include/arch/os2/thread_mutex.h | 2 +- include/arch/os2/thread_rwlock.h | 2 +- include/arch/os2/threadproc.h | 2 +- include/arch/os390/dso.h | 2 +- include/arch/unix/dso.h | 2 +- include/arch/unix/fileio.h | 2 +- include/arch/unix/global_mutex.h | 2 +- include/arch/unix/i18n.h | 2 +- include/arch/unix/inherit.h | 2 +- include/arch/unix/internal_time.h | 2 +- include/arch/unix/locks.h | 2 +- include/arch/unix/misc.h | 2 +- include/arch/unix/networkio.h | 2 +- include/arch/unix/proc_mutex.h | 2 +- include/arch/unix/shm.h | 2 +- include/arch/unix/thread_cond.h | 2 +- include/arch/unix/thread_mutex.h | 2 +- include/arch/unix/thread_rwlock.h | 2 +- include/arch/unix/threadproc.h | 2 +- include/arch/win32/apr_dbg_win32_handles.h | 2 +- include/arch/win32/apr_private.h | 2 +- include/arch/win32/atime.h | 2 +- include/arch/win32/dso.h | 2 +- include/arch/win32/fileio.h | 2 +- include/arch/win32/locks.h | 2 +- include/arch/win32/misc.h | 2 +- include/arch/win32/networkio.h | 2 +- include/arch/win32/proc_mutex.h | 2 +- include/arch/win32/thread_cond.h | 2 +- include/arch/win32/thread_mutex.h | 2 +- include/arch/win32/thread_rwlock.h | 2 +- include/arch/win32/threadproc.h | 2 +- locks/beos/global_mutex.c | 2 +- locks/beos/locks.c | 2 +- locks/beos/proc_mutex.c | 2 +- locks/beos/thread_cond.c | 2 +- locks/beos/thread_mutex.c | 2 +- locks/beos/thread_rwlock.c | 2 +- locks/netware/locks.c | 2 +- locks/netware/proc_mutex.c | 2 +- locks/netware/thread_cond.c | 2 +- locks/netware/thread_mutex.c | 2 +- locks/netware/thread_rwlock.c | 2 +- locks/os2/locks.c | 2 +- locks/os2/proc_mutex.c | 2 +- locks/os2/thread_cond.c | 2 +- locks/os2/thread_mutex.c | 2 +- locks/os2/thread_rwlock.c | 2 +- locks/unix/crossproc.c | 2 +- locks/unix/global_mutex.c | 2 +- locks/unix/intraproc.c | 2 +- locks/unix/locks.c | 2 +- locks/unix/proc_mutex.c | 2 +- locks/unix/thread_cond.c | 2 +- locks/unix/thread_mutex.c | 2 +- locks/unix/thread_rwlock.c | 2 +- locks/win32/locks.c | 2 +- locks/win32/proc_mutex.c | 2 +- locks/win32/thread_cond.c | 2 +- locks/win32/thread_mutex.c | 2 +- locks/win32/thread_rwlock.c | 2 +- memory/unix/apr_pools.c | 2 +- misc/netware/rand.c | 2 +- misc/netware/start.c | 2 +- misc/os2/randbyte.c | 2 +- misc/unix/errorcodes.c | 2 +- misc/unix/getuuid.c | 2 +- misc/unix/otherchild.c | 2 +- misc/unix/rand.c | 2 +- misc/unix/start.c | 2 +- misc/unix/uuid.c | 2 +- misc/unix/version.c | 2 +- misc/win32/apr_app.c | 2 +- misc/win32/getuuid.c | 2 +- misc/win32/internal.c | 2 +- misc/win32/misc.c | 2 +- misc/win32/rand.c | 2 +- misc/win32/start.c | 2 +- mmap/unix/common.c | 2 +- mmap/unix/mmap.c | 2 +- mmap/win32/mmap.c | 2 +- network_io/beos/poll.c | 2 +- network_io/beos/sendrecv.c | 2 +- network_io/os2/os2calls.c | 2 +- network_io/os2/poll.c | 2 +- network_io/os2/sendrecv.c | 2 +- network_io/os2/sendrecv_udp.c | 2 +- network_io/os2/sockets.c | 2 +- network_io/os2/sockopt.c | 2 +- network_io/unix/poll.c | 2 +- network_io/unix/sa_common.c | 2 +- network_io/unix/sendrecv.c | 2 +- network_io/unix/sockaddr.c | 2 +- network_io/unix/sockets.c | 2 +- network_io/unix/sockopt.c | 2 +- network_io/win32/poll.c | 2 +- network_io/win32/sendrecv.c | 2 +- network_io/win32/sockaddr.c | 2 +- network_io/win32/sockets.c | 2 +- network_io/win32/sockopt.c | 2 +- passwd/apr_getpass.c | 2 +- passwd/apr_md5.c | 2 +- shmem/beos/shm.c | 2 +- shmem/os2/shm.c | 2 +- shmem/unix/shm.c | 2 +- shmem/win32/shm.c | 2 +- strings/apr_cpystrn.c | 2 +- strings/apr_snprintf.c | 2 +- strings/apr_strings.c | 2 +- strings/apr_strtok.c | 2 +- tables/apr_hash.c | 2 +- tables/apr_tables.c | 2 +- test/aprtest.h | 2 +- test/client.c | 2 +- test/sendfile.c | 2 +- test/server.c | 2 +- test/test_apr.h | 2 +- test/testargs.c | 2 +- test/testatomic.c | 2 +- test/testdir.c | 2 +- test/testdso.c | 2 +- test/testdup.c | 2 +- test/testfile.c | 2 +- test/testflock.c | 2 +- test/testfmt.c | 2 +- test/testglobalmutex.c | 2 +- test/testhash.c | 2 +- test/testipsub.c | 2 +- test/testlock.c | 2 +- test/testlockperf.c | 2 +- test/testmd5.c | 2 +- test/testmmap.c | 2 +- test/testnames.c | 2 +- test/testoc.c | 2 +- test/testpipe.c | 2 +- test/testpoll.c | 2 +- test/testpools.c | 2 +- test/testproc.c | 2 +- test/testproc.rbb | 2 +- test/testprocmutex.c | 2 +- test/testrand.c | 2 +- test/testregex.c | 2 +- test/testshm.c | 2 +- test/testshmconsumer.c | 2 +- test/testshmproducer.c | 2 +- test/testsleep.c | 2 +- test/testsock.c | 2 +- test/testsockets.c | 2 +- test/testsockopt.c | 2 +- test/teststr.c | 2 +- test/testthread.c | 2 +- test/testtime.c | 2 +- test/testud.c | 2 +- test/testuser.c | 2 +- test/testuuid.c | 2 +- test/testvsn.c | 2 +- threadproc/beos/apr_proc_stub.c | 2 +- threadproc/beos/proc.c | 2 +- threadproc/beos/thread.c | 2 +- threadproc/beos/threadpriv.c | 2 +- threadproc/beos/threadproc_common.c | 2 +- threadproc/netware/proc.c | 2 +- threadproc/netware/procsup.c | 2 +- threadproc/netware/signals.c | 2 +- threadproc/netware/thread.c | 2 +- threadproc/netware/threadpriv.c | 2 +- threadproc/os2/proc.c | 2 +- threadproc/os2/thread.c | 2 +- threadproc/os2/threadpriv.c | 2 +- threadproc/unix/proc.c | 2 +- threadproc/unix/procsup.c | 2 +- threadproc/unix/signals.c | 2 +- threadproc/unix/thread.c | 2 +- threadproc/unix/threadpriv.c | 2 +- threadproc/win32/proc.c | 2 +- threadproc/win32/signals.c | 2 +- threadproc/win32/thread.c | 2 +- threadproc/win32/threadpriv.c | 2 +- time/unix/time.c | 2 +- time/unix/timestr.c | 2 +- time/win32/access.c | 2 +- time/win32/time.c | 2 +- time/win32/timestr.c | 2 +- user/netware/groupinfo.c | 2 +- user/netware/userinfo.c | 2 +- user/unix/groupinfo.c | 2 +- user/unix/userinfo.c | 2 +- user/win32/groupinfo.c | 2 +- user/win32/userinfo.c | 2 +- 304 files changed, 305 insertions(+), 305 deletions(-) diff --git a/apr-config.in b/apr-config.in index 6d829cdc5be..8637d63ca76 100644 --- a/apr-config.in +++ b/apr-config.in @@ -2,7 +2,7 @@ # ==================================================================== # The Apache Software License, Version 1.1 # -# Copyright (c) 2001 The Apache Software Foundation. All rights +# Copyright (c) 2001-2002 The Apache Software Foundation. All rights # reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/atomic/solaris_sparc/apr_atomic_sparc.s b/atomic/solaris_sparc/apr_atomic_sparc.s index 95f438d8167..3f7b794f4cb 100644 --- a/atomic/solaris_sparc/apr_atomic_sparc.s +++ b/atomic/solaris_sparc/apr_atomic_sparc.s @@ -1,7 +1,7 @@ !* ==================================================================== !* The Apache Software License, Version 1.1 !* -!* Copyright (c) 2000-2001 The Apache Software Foundation. All rights +!* Copyright (c) 2000-2002 The Apache Software Foundation. All rights !* reserved. !* !* Redistribution and use in source and binary forms, with or without diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index a4310cc3c5b..e6ba671fdac 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/build/aplibtool.c b/build/aplibtool.c index 2800b553f96..7412a5671ea 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/build/rules.mk.in b/build/rules.mk.in index 3d1ce894732..26e5241b050 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -1,7 +1,7 @@ # ==================================================================== # The Apache Software License, Version 1.1 # -# Copyright (c) 2000-2001 The Apache Software Foundation. All rights +# Copyright (c) 2000-2002 The Apache Software Foundation. All rights # reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/build/win32ver.awk b/build/win32ver.awk index 0089c0b5102..175b4a7b250 100644 --- a/build/win32ver.awk +++ b/build/win32ver.awk @@ -91,7 +91,7 @@ BEGIN { print " VALUE \"FileDescription\", \"" desc "\\0\""; print " VALUE \"FileVersion\", \"" ver "\\0\""; print " VALUE \"InternalName\", \"" file "\\0\""; - print " VALUE \"LegalCopyright\", \"Copyright © 2001 "\ + print " VALUE \"LegalCopyright\", \"Copyright © 2000-2002 "\ "The Apache Software Foundation.\\0\""; print " VALUE \"OriginalFilename\", \"" file ".exe\\0\""; if (vendor) { @@ -109,4 +109,4 @@ BEGIN { print " VALUE \"Translation\", 0x409, 1200"; print " END"; print "END"; -} \ No newline at end of file +} diff --git a/buildconf b/buildconf index cb30626ce86..506b02ac6a8 100755 --- a/buildconf +++ b/buildconf @@ -2,7 +2,7 @@ # ==================================================================== # The Apache Software License, Version 1.1 # -# Copyright (c) 2000-2001 The Apache Software Foundation. All rights +# Copyright (c) 2000-2002 The Apache Software Foundation. All rights # reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 50769b7c7de..1870a42d785 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 5ded23b15e3..1cfe6bae144 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/dso/netware/dso.c b/dso/netware/dso.c index 66516cfeea4..99eabde2cfe 100644 --- a/dso/netware/dso.c +++ b/dso/netware/dso.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/dso/os2/dso.c b/dso/os2/dso.c index b6c53adf597..3a663100eaf 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/dso/os390/dso.c b/dso/os390/dso.c index feeeaa0d2f8..19934d1b7b0 100644 --- a/dso/os390/dso.c +++ b/dso/os390/dso.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/dso/unix/dso.c b/dso/unix/dso.c index a8a54be4823..69fd8c4013e 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/dso/win32/dso.c b/dso/win32/dso.c index ab50d353c7e..ddb33b09c49 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 330c6e0173d..2cd2c255c44 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/netware/filesys.c b/file_io/netware/filesys.c index 29fd9804f91..722d4e5c188 100644 --- a/file_io/netware/filesys.c +++ b/file_io/netware/filesys.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/netware/flock.c b/file_io/netware/flock.c index e58e420f652..5b54c2f083a 100644 --- a/file_io/netware/flock.c +++ b/file_io/netware/flock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 1f4be15f971..7b86c7d87ce 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 3281d7a4bed..fbc6f56ae4e 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/fileacc.c b/file_io/os2/fileacc.c index 9e9d05f782f..c3bb5d9d5b0 100644 --- a/file_io/os2/fileacc.c +++ b/file_io/os2/fileacc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 940657c231e..ddce0d1cf08 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 8e7f50ec98f..75b15074d9f 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c index 7af4dc74389..89fd53ab858 100644 --- a/file_io/os2/filesys.c +++ b/file_io/os2/filesys.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/flock.c b/file_io/os2/flock.c index 697f2cc846b..ff3c59ee000 100644 --- a/file_io/os2/flock.c +++ b/file_io/os2/flock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c index eeaf8fccd4f..4f6603f0833 100644 --- a/file_io/os2/maperrorcode.c +++ b/file_io/os2/maperrorcode.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/open.c b/file_io/os2/open.c index b7aea95609b..45a28606fd3 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 6219c34e49c..42025f5c752 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 8f521a4fed6..351eb5245a1 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index 659629125e0..670eb0729cd 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index a1602a58a1b..2e02d78a7d9 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 0a6dfcd7da2..6b5d4677ad4 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 4b7fb76da16..cbad4589cbd 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 2120a8d0a9b..22e3f79a64c 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 3f901db514d..15d029d09a6 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c index d1ffddbec57..c57d158b379 100644 --- a/file_io/unix/flock.c +++ b/file_io/unix/flock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index 829dc10efa7..638ccfc506d 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index bde27cbca07..2acf6043662 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 8cb700ced38..610c8820b64 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index da3959e230e..d00e4adf846 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 1b08189a2e7..2f05183d6d4 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 572a16378fb..a74cd55d7f2 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 96484b57472..50a9f3666f4 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index a5ef11c740f..7970f8ba645 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index f977fb822da..53c689bfbbe 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 322517f3a99..686c7faa475 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c index 9158472c7e2..d837379f338 100644 --- a/file_io/win32/filesys.c +++ b/file_io/win32/filesys.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index ec95f712a1b..d57b0923765 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 841ac4dee25..f50501b10aa 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 89cf9e57908..1f1fd5ca406 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 0ee980466e5..b93fd60356a 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index fb8051d7de1..326dae0663f 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/i18n/unix/utf8_ucs2.c b/i18n/unix/utf8_ucs2.c index c58acc75a29..568da5a6dc5 100644 --- a/i18n/unix/utf8_ucs2.c +++ b/i18n/unix/utf8_ucs2.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 07ea14650a7..c403838a70c 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr.hnw b/include/apr.hnw index 1fa3e2b2f6b..c84d39c6aaa 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr.hw b/include/apr.hw index 2935f37d181..551f23fc11f 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 36c484bc829..40b42187d28 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_dso.h b/include/apr_dso.h index 01c0fc30d2c..8c113fc5619 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_errno.h b/include/apr_errno.h index f8c47479c7d..e89382587e8 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 1f5d08d020f..7e5e1f8f341 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_file_io.h b/include/apr_file_io.h index fe512edcbc2..e78c7a32229 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_general.h b/include/apr_general.h index 7ec188d0720..6f26131a612 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 24114d81b9b..24e27244e17 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index 6bc0abfd79b..9f7e5533190 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_hash.h b/include/apr_hash.h index 40d4b635dba..e75cf30b28d 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_inherit.h b/include/apr_inherit.h index 76c80a9bd95..07b1d210319 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_lib.h b/include/apr_lib.h index 7e11045111c..5685e8c30ef 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_lock.h b/include/apr_lock.h index ec98b11b36d..5794a56da16 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_md5.h b/include/apr_md5.h index fa9b1b9ae89..cc2242cfcd2 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -31,7 +31,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 83bba6a47a8..e54db8d58e3 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_network_io.h b/include/apr_network_io.h index f3303078f10..e9d68d839bc 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_pools.h b/include/apr_pools.h index 8a8faac1718..6a094dd0551 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_portable.h b/include/apr_portable.h index d28f0faa530..7121a3009ed 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index fff7df5f432..5441216a62f 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_ring.h b/include/apr_ring.h index ebc1f3d781c..6d8f9bd9fec 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_shm.h b/include/apr_shm.h index c48ea3913e0..3a1dee3a036 100644 --- a/include/apr_shm.h +++ b/include/apr_shm.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_signal.h b/include/apr_signal.h index fd7440a1d90..e490d2f38dd 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_strings.h b/include/apr_strings.h index 9c814eb0206..33f1c49fdc1 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_tables.h b/include/apr_tables.h index 238605e169c..914e311d8fb 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h index ea438babb47..982780f3afe 100644 --- a/include/apr_thread_cond.h +++ b/include/apr_thread_cond.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 25af69d3995..7b67f50ea72 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index d6e01aab9b9..78aba2864b7 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_thread_rwlock.h b/include/apr_thread_rwlock.h index ff2ae6ac72e..9ee005b0f48 100644 --- a/include/apr_thread_rwlock.h +++ b/include/apr_thread_rwlock.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_time.h b/include/apr_time.h index 0d667570133..38145daad1c 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_user.h b/include/apr_user.h index 7c41b0fc1ff..23b03bb061a 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_uuid.h b/include/apr_uuid.h index a5324221329..48fe2c41f2a 100644 --- a/include/apr_uuid.h +++ b/include/apr_uuid.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_version.h b/include/apr_version.h index 23b68a26c35..78db8f48371 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_want.h b/include/apr_want.h index 932b07a964c..5da3d9061fb 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/apr_xlate.h b/include/apr_xlate.h index 66217a91f97..8fcb39cfa51 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/aix/dso.h b/include/arch/aix/dso.h index ea8bf50ca4b..6b3630f4a30 100644 --- a/include/arch/aix/dso.h +++ b/include/arch/aix/dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/beos/dso.h b/include/arch/beos/dso.h index 4f1560315d1..52e21fdad60 100644 --- a/include/arch/beos/dso.h +++ b/include/arch/beos/dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h index 26f1f03e50c..192274eceef 100644 --- a/include/arch/beos/locks.h +++ b/include/arch/beos/locks.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/beos/proc_mutex.h b/include/arch/beos/proc_mutex.h index a7442ebf09b..712bb88e79f 100644 --- a/include/arch/beos/proc_mutex.h +++ b/include/arch/beos/proc_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/beos/thread_cond.h b/include/arch/beos/thread_cond.h index 75d77457e71..fcccdc20899 100644 --- a/include/arch/beos/thread_cond.h +++ b/include/arch/beos/thread_cond.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/beos/thread_mutex.h b/include/arch/beos/thread_mutex.h index 94cffa08ad9..4170957da7b 100644 --- a/include/arch/beos/thread_mutex.h +++ b/include/arch/beos/thread_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/beos/thread_rwlock.h b/include/arch/beos/thread_rwlock.h index 13da6eeb955..a83704a2483 100644 --- a/include/arch/beos/thread_rwlock.h +++ b/include/arch/beos/thread_rwlock.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h index 90bc6db20e9..63cec9fb7b1 100644 --- a/include/arch/beos/threadproc.h +++ b/include/arch/beos/threadproc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index d5bc80c4e68..da6916313dd 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/netware/dso.h b/include/arch/netware/dso.h index 95079b048e6..b1679d0172d 100644 --- a/include/arch/netware/dso.h +++ b/include/arch/netware/dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/netware/fileio.h b/include/arch/netware/fileio.h index 4da34e37a21..96f1fe307c1 100644 --- a/include/arch/netware/fileio.h +++ b/include/arch/netware/fileio.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/netware/global_mutex.h b/include/arch/netware/global_mutex.h index d04807351cf..132cf0df3da 100644 --- a/include/arch/netware/global_mutex.h +++ b/include/arch/netware/global_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/netware/internal_time.h b/include/arch/netware/internal_time.h index d37926c5699..55362b02b8a 100644 --- a/include/arch/netware/internal_time.h +++ b/include/arch/netware/internal_time.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2001 The Apache Software Foundation. All rights + * Copyright (c) 2001-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/netware/locks.h b/include/arch/netware/locks.h index b8ecaa83566..f52a814a388 100644 --- a/include/arch/netware/locks.h +++ b/include/arch/netware/locks.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/netware/networkio.h b/include/arch/netware/networkio.h index f7471dc688f..522f5150181 100644 --- a/include/arch/netware/networkio.h +++ b/include/arch/netware/networkio.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/netware/proc_mutex.h b/include/arch/netware/proc_mutex.h index 7077f7b5497..b69c17cf6f0 100644 --- a/include/arch/netware/proc_mutex.h +++ b/include/arch/netware/proc_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/netware/thread_cond.h b/include/arch/netware/thread_cond.h index d9e93d76374..395ff610550 100644 --- a/include/arch/netware/thread_cond.h +++ b/include/arch/netware/thread_cond.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/netware/thread_mutex.h b/include/arch/netware/thread_mutex.h index 99fbd99ea94..71e3b67fe5e 100644 --- a/include/arch/netware/thread_mutex.h +++ b/include/arch/netware/thread_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/netware/thread_rwlock.h b/include/arch/netware/thread_rwlock.h index fe6e1db65f4..9a3b746faeb 100644 --- a/include/arch/netware/thread_rwlock.h +++ b/include/arch/netware/thread_rwlock.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/netware/threadproc.h b/include/arch/netware/threadproc.h index 2b6948f28fa..5783e40ec14 100644 --- a/include/arch/netware/threadproc.h +++ b/include/arch/netware/threadproc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/dso.h b/include/arch/os2/dso.h index 474cf8aefa0..4d49ac4cb98 100644 --- a/include/arch/os2/dso.h +++ b/include/arch/os2/dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index 9e81315bc96..61e54cfba97 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/locks.h b/include/arch/os2/locks.h index 716dfa2a569..49f60ff3ff2 100644 --- a/include/arch/os2/locks.h +++ b/include/arch/os2/locks.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index 3f1a336a900..95c7c1f03e0 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/os2calls.h b/include/arch/os2/os2calls.h index c1397c5c758..9ec583262bd 100644 --- a/include/arch/os2/os2calls.h +++ b/include/arch/os2/os2calls.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/proc_mutex.h b/include/arch/os2/proc_mutex.h index 1c8b5cd2ab5..e197279fb12 100644 --- a/include/arch/os2/proc_mutex.h +++ b/include/arch/os2/proc_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/thread_cond.h b/include/arch/os2/thread_cond.h index e8eca2d5fe7..ed30755e07a 100644 --- a/include/arch/os2/thread_cond.h +++ b/include/arch/os2/thread_cond.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/thread_mutex.h b/include/arch/os2/thread_mutex.h index b8b9d1222be..7c901836963 100644 --- a/include/arch/os2/thread_mutex.h +++ b/include/arch/os2/thread_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/thread_rwlock.h b/include/arch/os2/thread_rwlock.h index c959ffc09ac..c5036c3e582 100644 --- a/include/arch/os2/thread_rwlock.h +++ b/include/arch/os2/thread_rwlock.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/threadproc.h index 48f8e0a6527..8419f2d6fa8 100644 --- a/include/arch/os2/threadproc.h +++ b/include/arch/os2/threadproc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/os390/dso.h b/include/arch/os390/dso.h index 62defa84fcc..618bb6821db 100644 --- a/include/arch/os390/dso.h +++ b/include/arch/os390/dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/dso.h b/include/arch/unix/dso.h index a5395052c68..c1b14b3e004 100644 --- a/include/arch/unix/dso.h +++ b/include/arch/unix/dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 4c955c23ab8..6579e260785 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/global_mutex.h b/include/arch/unix/global_mutex.h index dfafcb1fd99..ffaa45d57f1 100644 --- a/include/arch/unix/global_mutex.h +++ b/include/arch/unix/global_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/i18n.h b/include/arch/unix/i18n.h index 0952dd4c6f2..81820c7c5eb 100644 --- a/include/arch/unix/i18n.h +++ b/include/arch/unix/i18n.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/inherit.h b/include/arch/unix/inherit.h index 394c2cd5b99..503daf61091 100644 --- a/include/arch/unix/inherit.h +++ b/include/arch/unix/inherit.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/internal_time.h b/include/arch/unix/internal_time.h index 9cdba8b1b98..a82383cf05f 100644 --- a/include/arch/unix/internal_time.h +++ b/include/arch/unix/internal_time.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2001 The Apache Software Foundation. All rights + * Copyright (c) 2001-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index 6ef1c83d901..0a1b8d57e4b 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index 93366129906..e5926b5b335 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index b0ca969b57a..aa9e3853a14 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/proc_mutex.h b/include/arch/unix/proc_mutex.h index b99c2c7d1cd..b54bfacee6e 100644 --- a/include/arch/unix/proc_mutex.h +++ b/include/arch/unix/proc_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/shm.h b/include/arch/unix/shm.h index 84afc5b9875..66a50ca99e9 100644 --- a/include/arch/unix/shm.h +++ b/include/arch/unix/shm.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/thread_cond.h b/include/arch/unix/thread_cond.h index 57827f5033b..59e7cf710f2 100644 --- a/include/arch/unix/thread_cond.h +++ b/include/arch/unix/thread_cond.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/thread_mutex.h b/include/arch/unix/thread_mutex.h index 8ce05a22ba3..f834e803a47 100644 --- a/include/arch/unix/thread_mutex.h +++ b/include/arch/unix/thread_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/thread_rwlock.h b/include/arch/unix/thread_rwlock.h index 8e057322784..db50c529644 100644 --- a/include/arch/unix/thread_rwlock.h +++ b/include/arch/unix/thread_rwlock.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index 9f45ea3df4d..69f260bd6ef 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/apr_dbg_win32_handles.h b/include/arch/win32/apr_dbg_win32_handles.h index 09611821559..072a1d90759 100644 --- a/include/arch/win32/apr_dbg_win32_handles.h +++ b/include/arch/win32/apr_dbg_win32_handles.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index ec9b67b4fef..cea7b97efc1 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/atime.h b/include/arch/win32/atime.h index 79264ee7be3..78d099ddead 100644 --- a/include/arch/win32/atime.h +++ b/include/arch/win32/atime.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/dso.h b/include/arch/win32/dso.h index 645e24547fc..909cb65bd8a 100644 --- a/include/arch/win32/dso.h +++ b/include/arch/win32/dso.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 01f761e3c63..63bc66a51f3 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/locks.h b/include/arch/win32/locks.h index 4d0562b8c81..8165c40f3e0 100644 --- a/include/arch/win32/locks.h +++ b/include/arch/win32/locks.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 68141e292d0..feb72c6bf59 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 90a7c658c50..a678139eec1 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/proc_mutex.h b/include/arch/win32/proc_mutex.h index 3678b42e23d..a7d80632a9e 100644 --- a/include/arch/win32/proc_mutex.h +++ b/include/arch/win32/proc_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/thread_cond.h b/include/arch/win32/thread_cond.h index b0505044ca0..667c5248be4 100644 --- a/include/arch/win32/thread_cond.h +++ b/include/arch/win32/thread_cond.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/thread_mutex.h b/include/arch/win32/thread_mutex.h index 7233b49daee..19524f5cbc9 100644 --- a/include/arch/win32/thread_mutex.h +++ b/include/arch/win32/thread_mutex.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/thread_rwlock.h b/include/arch/win32/thread_rwlock.h index dc53f58977b..62e3335ece3 100644 --- a/include/arch/win32/thread_rwlock.h +++ b/include/arch/win32/thread_rwlock.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/threadproc.h index 40036c371bc..f18b73b6041 100644 --- a/include/arch/win32/threadproc.h +++ b/include/arch/win32/threadproc.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/beos/global_mutex.c b/locks/beos/global_mutex.c index 24f73b1c230..fc67750eaad 100644 --- a/locks/beos/global_mutex.c +++ b/locks/beos/global_mutex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/beos/locks.c b/locks/beos/locks.c index 2c29a50a405..4ac75cf96bb 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index 94e6d889341..a5c68c8676b 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c index 29136d9a0d2..a1102df83bf 100644 --- a/locks/beos/thread_cond.c +++ b/locks/beos/thread_cond.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index b77c697bbdf..33b89b90d03 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/beos/thread_rwlock.c b/locks/beos/thread_rwlock.c index fa5ac911e6f..48a60a44e91 100644 --- a/locks/beos/thread_rwlock.c +++ b/locks/beos/thread_rwlock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/netware/locks.c b/locks/netware/locks.c index 0238761db55..b7aa2a7645e 100644 --- a/locks/netware/locks.c +++ b/locks/netware/locks.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index fd7b270cf3f..113c875cd02 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c index 19ec40d5bab..3701c44c542 100644 --- a/locks/netware/thread_cond.c +++ b/locks/netware/thread_cond.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index a38ce429ba8..22b5bff4e50 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/netware/thread_rwlock.c b/locks/netware/thread_rwlock.c index 572946b61ec..dd1aa9a0d80 100644 --- a/locks/netware/thread_rwlock.c +++ b/locks/netware/thread_rwlock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/os2/locks.c b/locks/os2/locks.c index 0d6abb19db7..222a8e6f515 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index f6b45980169..7cc329cc527 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/os2/thread_cond.c b/locks/os2/thread_cond.c index 30800564658..57126e578d3 100644 --- a/locks/os2/thread_cond.c +++ b/locks/os2/thread_cond.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index 543b602dad5..25774128a33 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/os2/thread_rwlock.c b/locks/os2/thread_rwlock.c index 1cc97032c85..bda0ccb9877 100644 --- a/locks/os2/thread_rwlock.c +++ b/locks/os2/thread_rwlock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 8280a94c990..3d19500f5c8 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index 733d08db0b6..15fab9481aa 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index 5a45cbe0a04..a559e456230 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 5f876bef5fb..ff4c38ff1ff 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 313ba811a59..77eaccf8c98 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c index 963f185cfc3..d0ebe7c42d7 100644 --- a/locks/unix/thread_cond.c +++ b/locks/unix/thread_cond.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index ff7d44142cf..78a7d8181c3 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c index 5458266b46e..daa1ed607d2 100644 --- a/locks/unix/thread_rwlock.c +++ b/locks/unix/thread_rwlock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/win32/locks.c b/locks/win32/locks.c index b5a5196056c..c23906f056a 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 219362db2c0..92638211dda 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index 3fa0eeead8f..61f995c971c 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 59c99d38389..96480925907 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c index 128cfd15e83..72ecbc0f585 100644 --- a/locks/win32/thread_rwlock.c +++ b/locks/win32/thread_rwlock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index f100a338185..8f1e521ec6a 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/netware/rand.c b/misc/netware/rand.c index b2eda208725..ea38026c61c 100644 --- a/misc/netware/rand.c +++ b/misc/netware/rand.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/netware/start.c b/misc/netware/start.c index 1b92fae2ff6..55ea736a96a 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/os2/randbyte.c b/misc/os2/randbyte.c index 58314028b9d..0102f96bf37 100644 --- a/misc/os2/randbyte.c +++ b/misc/os2/randbyte.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index a5af06ed826..cd9b82c1964 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c index 60898ec194b..97c3a9d236e 100644 --- a/misc/unix/getuuid.c +++ b/misc/unix/getuuid.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 201f2468bb9..75d47857949 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 93818401cc6..24e9b863ccc 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/unix/start.c b/misc/unix/start.c index f31eb917fc9..2ec8dd47cd8 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/unix/uuid.c b/misc/unix/uuid.c index afccc5e5b1b..48ed48a8d1d 100644 --- a/misc/unix/uuid.c +++ b/misc/unix/uuid.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/unix/version.c b/misc/unix/version.c index 621ea2f612f..3457cc461d6 100644 --- a/misc/unix/version.c +++ b/misc/unix/version.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index 614f1fdffcc..e4116feb0f2 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/win32/getuuid.c b/misc/win32/getuuid.c index f6fb999dfe9..f04e128f7ce 100644 --- a/misc/win32/getuuid.c +++ b/misc/win32/getuuid.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/win32/internal.c b/misc/win32/internal.c index d2b9753b54b..771be2eac85 100644 --- a/misc/win32/internal.c +++ b/misc/win32/internal.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 466174bca6a..a60907a55f1 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 609e98bd64d..3bf8c31ca74 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/misc/win32/start.c b/misc/win32/start.c index 05f6a887a67..0cf13abb2a6 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/mmap/unix/common.c b/mmap/unix/common.c index df873c3a720..dd33fb628bd 100644 --- a/mmap/unix/common.c +++ b/mmap/unix/common.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 99aae562ba1..449aa78d3ef 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index 9c0b0a74ccf..4a65cff7e7e 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index 62bf6700ab9..2d12bab6dcf 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 486148ce40c..b520b3ae1b1 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/os2/os2calls.c b/network_io/os2/os2calls.c index 3042118a838..b2708e69b9f 100644 --- a/network_io/os2/os2calls.c +++ b/network_io/os2/os2calls.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/os2/poll.c b/network_io/os2/poll.c index 2ce51860a2a..3ecdbcec88f 100644 --- a/network_io/os2/poll.c +++ b/network_io/os2/poll.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index 891fda294e8..527ed8593ff 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c index 9f2f438f806..1cf97b1b487 100644 --- a/network_io/os2/sendrecv_udp.c +++ b/network_io/os2/sendrecv_udp.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 5a421ab2f81..aab2d2edc0b 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 6f163de6715..776927509eb 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index b956a0d2195..29c70572d8d 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 77070be89c3..d0c607495c4 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index baf994cf8d6..4df1cf124c9 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index c3161c45ae2..7149a25bf5e 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index ecda7c7a6dd..f77e2dcb90f 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 1c63f640c8a..d860fa4c032 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 45100d69575..234bf6364eb 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 70f41882af0..696ef9f297a 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index db4f18afbe8..37613a3dca5 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 45eb6aaac3d..f329fda3f82 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index be9f78f4d86..2d3f01c7395 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 588724cefb9..199f4fc266a 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index 5d7132b1b48..2c21eee8e6f 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -34,7 +34,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index bc741cd9b9e..2622a282b7c 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c index 0dc05fae287..27f5113ef5b 100644 --- a/shmem/os2/shm.c +++ b/shmem/os2/shm.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 0eb73cc8da7..6c41dd59a20 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 41919ab4f83..ec0befa79b9 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index 1966eee4afe..eb057111ef9 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 20fb44326ca..412368c8697 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 2038d48bdb7..c5f79b545c0 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/strings/apr_strtok.c b/strings/apr_strtok.c index 6b569cc2db9..aa398656ccc 100644 --- a/strings/apr_strtok.c +++ b/strings/apr_strtok.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 18baff85e32..5199b532edd 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/tables/apr_tables.c b/tables/apr_tables.c index b634d4a9a97..da076058b62 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/aprtest.h b/test/aprtest.h index 7a0e559ceb9..4e565fcd199 100644 --- a/test/aprtest.h +++ b/test/aprtest.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/client.c b/test/client.c index 5ae27378230..c1a2fe46b35 100644 --- a/test/client.c +++ b/test/client.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/sendfile.c b/test/sendfile.c index 4ce4bb6188c..c39fb4583e2 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/server.c b/test/server.c index 86fa9cea009..7ca7f9a7fde 100644 --- a/test/server.c +++ b/test/server.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/test_apr.h b/test/test_apr.h index 717b5514f9a..3cd81fde50b 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testargs.c b/test/testargs.c index 11b17996293..1eb96a881e7 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testatomic.c b/test/testatomic.c index 67c87788589..0fc19101ad2 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testdir.c b/test/testdir.c index c499554c50a..cbd21ceeece 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testdso.c b/test/testdso.c index 240264d26a8..1562602903e 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testdup.c b/test/testdup.c index 3d1daad043c..19ae1c9216d 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testfile.c b/test/testfile.c index e096603e379..ccc3d2ea02c 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testflock.c b/test/testflock.c index 1097f279c6c..4f9ffe069c8 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testfmt.c b/test/testfmt.c index 72be708e059..15e06b8214d 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index 0a15c382d4b..2507b72eae6 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testhash.c b/test/testhash.c index fa9d60dfbc8..7c3ff6c29b9 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testipsub.c b/test/testipsub.c index 68510167f14..bd63d251619 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testlock.c b/test/testlock.c index f5e2b9b8110..f1e2a92e085 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testlockperf.c b/test/testlockperf.c index 20f1681ef42..e7c8f1f43b2 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testmd5.c b/test/testmd5.c index 84735ca6adb..1803ddab4f8 100644 --- a/test/testmd5.c +++ b/test/testmd5.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testmmap.c b/test/testmmap.c index c4ba842eddf..72e252d0f56 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testnames.c b/test/testnames.c index 1b3240df2aa..1740c42baeb 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testoc.c b/test/testoc.c index fa486afd231..af228d36b92 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testpipe.c b/test/testpipe.c index e3cf491784d..7b5e8bdaf96 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testpoll.c b/test/testpoll.c index a6247d332a5..ddbc781d45c 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testpools.c b/test/testpools.c index abe3e8c4924..631c06aa062 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testproc.c b/test/testproc.c index 366d707fd75..091aceb59ce 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testproc.rbb b/test/testproc.rbb index 1ebafee120f..befddc9e663 100644 --- a/test/testproc.rbb +++ b/test/testproc.rbb @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights reserved. + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 9fba59993f6..128dbe8bad6 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testrand.c b/test/testrand.c index bfe240b06f9..19bb16ea7e5 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testregex.c b/test/testregex.c index 7fb3a3bfac6..1a8374e9b3e 100644 --- a/test/testregex.c +++ b/test/testregex.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testshm.c b/test/testshm.c index 4592897c7ba..50cd31c44b7 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testshmconsumer.c b/test/testshmconsumer.c index 6fcf4b72f17..d01467faaaa 100644 --- a/test/testshmconsumer.c +++ b/test/testshmconsumer.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testshmproducer.c b/test/testshmproducer.c index 162eca19cc6..94e11e41b98 100644 --- a/test/testshmproducer.c +++ b/test/testshmproducer.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testsleep.c b/test/testsleep.c index 04685c38002..5d29fbb60e4 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testsock.c b/test/testsock.c index d5b177a97df..430b2f8f3ca 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testsockets.c b/test/testsockets.c index 2573da85ec5..80cedd201a2 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testsockopt.c b/test/testsockopt.c index 94eb721904f..81836e85fb7 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/teststr.c b/test/teststr.c index c6bf416c526..29279aa2139 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testthread.c b/test/testthread.c index 9dfb1b61689..11749f32953 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testtime.c b/test/testtime.c index e29b1b8d0ae..3869ff4f063 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testud.c b/test/testud.c index 443051b7e74..2393c3a2e62 100644 --- a/test/testud.c +++ b/test/testud.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testuser.c b/test/testuser.c index db0a96cadd3..bc0f4c3c78a 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testuuid.c b/test/testuuid.c index 43ae980ab7a..cc19a7dc367 100644 --- a/test/testuuid.c +++ b/test/testuuid.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/testvsn.c b/test/testvsn.c index 1f0b9be59de..adf97eeb614 100644 --- a/test/testvsn.c +++ b/test/testvsn.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/beos/apr_proc_stub.c b/threadproc/beos/apr_proc_stub.c index 7a3726b379f..7ba9712cb4e 100644 --- a/threadproc/beos/apr_proc_stub.c +++ b/threadproc/beos/apr_proc_stub.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index edd36de6090..a34470a42d2 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 2dc96859e78..5b6fb4c7214 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index a929b357239..3bc1aadc3fe 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/beos/threadproc_common.c b/threadproc/beos/threadproc_common.c index 369bd03e739..df31d89b6f9 100644 --- a/threadproc/beos/threadproc_common.c +++ b/threadproc/beos/threadproc_common.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 541e52bd008..5f3d6da08fa 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/netware/procsup.c b/threadproc/netware/procsup.c index daa1b8dc76e..d894fcc9581 100644 --- a/threadproc/netware/procsup.c +++ b/threadproc/netware/procsup.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c index 87e2cdb2316..b6aaefdfbbb 100644 --- a/threadproc/netware/signals.c +++ b/threadproc/netware/signals.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 3b88afa5c96..a9ad8c9fd05 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/netware/threadpriv.c b/threadproc/netware/threadpriv.c index 8964deb4a72..30b3b47c36a 100644 --- a/threadproc/netware/threadpriv.c +++ b/threadproc/netware/threadpriv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index fdb2841ca74..a9f8a4fa875 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 9f34227fd65..6c3e18a973b 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index e04dc6a88a5..7d1bd68e2ae 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index deb188a58c7..aa7c255a54c 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index 391f803bdcf..649f670d5e9 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index e656f0887e8..6d2a1249536 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 13f3ec7afaa..cbf5842d5ac 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 64e6aa5d002..c220b4f869d 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 18f02c84f23..f90400a4928 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 7e9d14fa74b..ac62c94b122 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 2e5be27572d..14ba8a388c7 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 06d5a4a9ee3..ad438c28af7 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/time/unix/time.c b/time/unix/time.c index 13f69d266d8..e6ef85b9fda 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/time/unix/timestr.c b/time/unix/timestr.c index 2af9ab54308..f056b9c6f16 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/time/win32/access.c b/time/win32/access.c index 59ad20665f3..043db594854 100644 --- a/time/win32/access.c +++ b/time/win32/access.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/time/win32/time.c b/time/win32/time.c index b43449c5eaa..98cfffd8a3a 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 7b6969fa29b..1ba9f1b1d71 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/user/netware/groupinfo.c b/user/netware/groupinfo.c index e0bd822ade2..bd209434eed 100644 --- a/user/netware/groupinfo.c +++ b/user/netware/groupinfo.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/user/netware/userinfo.c b/user/netware/userinfo.c index d251c5a6df7..2f88a225d83 100644 --- a/user/netware/userinfo.c +++ b/user/netware/userinfo.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 0386752705c..97c245a0a73 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 717b3dc7770..603e4fa6850 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index 3d533a19ce5..611f744e76f 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 54ba7e9cbdc..f96117d73bd 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without From 5eb840fce88eaac9340b5da778919d0de2fbff9f Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 14 Mar 2002 01:41:32 +0000 Subject: [PATCH 3111/7878] Lesser of 2 evils :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63118 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 7bdbf84d610..f6e32b7dc3c 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -589,7 +589,7 @@ dnl orig_path="${prefix}/bar" dnl APR_PATH_RELATIVE(final_path, $orig_path, $prefix) dnl $final_path now contains "bar" AC_DEFUN(APR_PATH_RELATIVE,[ -stripped=`echo $2 | sed -e "s#^${3}##"` +stripped=`echo $2 | sed -e "s#^$3##"` # check if the stripping was successful if test "x$2" != "x$stripped"; then # it was, so strip of any leading slashes From 06b50a322d249154b9e76748db6a142f3bc57ba8 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Thu, 14 Mar 2002 02:18:47 +0000 Subject: [PATCH 3112/7878] Fix the install detection code in case the install area uses a symbolic link. Submitted by: Garrett Rooney git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63119 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apr-config.in b/apr-config.in index 8637d63ca76..8644321c9c0 100644 --- a/apr-config.in +++ b/apr-config.in @@ -114,7 +114,8 @@ fi thisdir="`dirname $0`" thisdir="`cd $thisdir && pwd`" -if test "$bindir" = "$thisdir"; then +tmpbindir="`cd $bindir && pwd`" +if test "$tmpbindir" = "$thisdir"; then location=installed elif test "$APR_SOURCE_DIR" = "$thisdir"; then location=source From ba13502521746575b5afb63b3ffe9c4373ee0d3b Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Thu, 14 Mar 2002 14:58:33 +0000 Subject: [PATCH 3113/7878] Since atomic_t isn't available on FreeBSD < 4, don't test it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63120 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/testatomic.c b/test/testatomic.c index 0fc19101ad2..80020b00010 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -69,6 +69,15 @@ #include #endif +#if defined(__FreeBSD__) && (__FreeBSD__ < 4) + +int main(void) +{ + printf("atomic test skipped\n"); +} + +#else + apr_pool_t *context; apr_atomic_t y; /* atomic locks */ @@ -339,3 +348,4 @@ int main(int argc, char**argv) } #endif /* !APR_HAS_THREADS */ +#endif /* !(defined(__FreeBSD) && (__FreeBSD__ < 4)) */ From e3e922c53cc136cef8edeb7a39f907b7f8b48954 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 14 Mar 2002 16:29:51 +0000 Subject: [PATCH 3114/7878] PR: 9932 (apache 1.3) Obtained from: Submitted by: Joshua Colvin Reviewed by: Martin Kraemer, Jim Jagielski Bring up fix from 1.3 patch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63121 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 412368c8697..888d13054fe 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -1190,6 +1190,10 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), fmt++; } vbuff->curpos = sp; + if (sp >= bep) { + if (flush_func(vbuff)) + return -1; + } return cc; } From fb06303d767007db3c64ef755e2567e1158e3213 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 14 Mar 2002 16:50:11 +0000 Subject: [PATCH 3115/7878] Switched to the new winsock header for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63122 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 2 +- misc/netware/libprews.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index c84d39c6aaa..f7cab828946 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -87,7 +87,7 @@ #include -#include +#include #define _POSIX_THREAD_SAFE_FUNCTIONS 1 #define READDIR_IS_THREAD_SAFE 1 diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index 342ff2aea7a..fa17427fad3 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -11,7 +11,7 @@ #include #include #include -#include "ws2nlm.h" +#include "novsock2.h" #include "apr_pools.h" From 30f160404ad5be816c9c7329ce9b46198120ab3a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 14 Mar 2002 16:52:58 +0000 Subject: [PATCH 3116/7878] Updated to match the changes that occured in the stat structure git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63123 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 2cd2c255c44..ce186452304 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -95,9 +95,9 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, finfo->inode = info->st_ino; finfo->device = info->st_dev; finfo->nlink = info->st_nlink; - apr_time_ansi_put(&finfo->atime, info->st_atime); - apr_time_ansi_put(&finfo->mtime, info->st_mtime); - apr_time_ansi_put(&finfo->ctime, info->st_ctime); + apr_time_ansi_put(&finfo->atime, info->st_atime.tv_sec); + apr_time_ansi_put(&finfo->mtime, info->st_mtime.tv_sec); + apr_time_ansi_put(&finfo->ctime, info->st_ctime.tv_sec); /* ### needs to be revisited * if (wanted & APR_FINFO_CSIZE) { * finfo->csize = info->st_blocks * 512; @@ -106,6 +106,12 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, */ } +char *case_filename(apr_pool_t *pPool, const char *szFile) +{ + return (char*)szFile; +} + + APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) @@ -286,6 +292,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, { struct stat info; int srv; + char *s; srv = cstat(fname, &info); @@ -296,8 +303,11 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, if (wanted & APR_FINFO_LINK) wanted &= ~APR_FINFO_LINK; if (wanted & APR_FINFO_NAME) { - finfo->name = apr_pstrdup(cont, info.st_name); - finfo->valid |= APR_FINFO_NAME; + s = strrchr(case_filename(cont, fname), '/'); + if (s) { + finfo->name = apr_pstrdup(cont, &s[1]); + finfo->valid |= APR_FINFO_NAME; + } } return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; } From 8c2574d2a3b6c466f6b1e52ad6033622857f6b97 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 14 Mar 2002 17:19:02 +0000 Subject: [PATCH 3117/7878] Changed the way environment variables are handle on NetWare while spawning an external NLM git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63124 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 5f3d6da08fa..56cd25fafa2 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -293,11 +293,12 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, apr_procattr_t *attr, apr_pool_t *cont) { - int i, envCount; + int i, envCount=0; const char **newargs; char **newenv; NXVmId_t newVM; unsigned long flags = 0; + char **sysenv = NULL; NXNameSpec_t nameSpec; NXExecEnvSpec_t envSpec; @@ -313,16 +314,20 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, envSpec.esArgc = i; envSpec.esArgv = (void**)args; + getenv("ENV"); /* just needs to be here for now */ + sysenv = nxGetEnviron(); /* Count how many environment variables there are in the system, add any new environment variables and place them in the environment. */ for (i=0;env && env[i];i++); - envCount = NXGetEnvCount(); + for (envCount=0;sysenv && sysenv[envCount];envCount++); if ((envCount + i) > 0) { newenv = (char **) NXMemAlloc(sizeof(char *) * (envCount+i+1), 0); if (!newenv) return APR_ENOMEM; - NXCopyEnv(newenv, envCount); + for (i=0;sysenv && sysenv[i];i++) { + newenv[i] = (char*)sysenv[i]; + } for (i=0;env && env[i];i++) { newenv[envCount+i-1] = (char*)env[i]; } @@ -418,6 +423,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, apr_pool_cleanup_register(cont, (void *)newproc, apr_netware_proc_cleanup, apr_pool_cleanup_null); } + /*if (sysenv) + free(sysenv); + */ return APR_SUCCESS; } From 77da338dd23a8776c8fa891efd74c209a87343ea Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 14 Mar 2002 19:28:15 +0000 Subject: [PATCH 3118/7878] slight apr_sockaddr_info_get() simplification/speed-up: in the getaddrinfo() flavor we were needlessly building a string form of the port number to pass to getaddrinfo() so it would put it in the sockaddrs it built... but then we stuffed the port number in the sockaddrs anyway given that we no longer need getaddrinfo() to be able to handle port numbers properly, there is no sense checking for that ability at configure time suddenly we think that AIX 4.3.3.no-fixes has a working getaddrinfo() (it previously failed the pass-the-port-number- to-getaddrinfo check) but that level of AIX doesn't fill in the family field in the sockaddrs built by getaddrinfo()... rather than kludge around it in apr_sockaddr_info_get(), it is better to change the configure test to refuse to use getaddrinfo() on such a system git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63125 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 7 ++++--- network_io/unix/sa_common.c | 11 +---------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 927adeb8be1..fc04de96014 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -32,13 +32,14 @@ void main(void) { memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; - error = getaddrinfo("127.0.0.1", "8080", &hints, &ai); + error = getaddrinfo("127.0.0.1", NULL, &hints, &ai); if (error) { exit(1); } - else { - exit(0); + if (ai->ai_addr->sa_family != AF_INET) { + exit(1); } + exit(0); } ],[ ac_cv_working_getaddrinfo="yes" diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index d0c607495c4..2f62d612a9d 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -352,8 +352,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, struct addrinfo hints, *ai, *ai_list; apr_sockaddr_t *cursa; int error; - char num[8]; - char *numptr; memset(&hints, 0, sizeof(hints)); hints.ai_flags = 0; /* XXX: might need a way to turn on AI_CANONNAME */ @@ -368,14 +366,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; - if (port) { - apr_snprintf(num, sizeof(num), "%d", port); - numptr = num; - } - else { - numptr = NULL; - } - error = getaddrinfo(hostname, numptr, &hints, &ai_list); + error = getaddrinfo(hostname, NULL, &hints, &ai_list); if (error) { if (error == EAI_SYSTEM) { return errno; From a34e588668354f6a02cbeb2cf565af57f4f6c012 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 14 Mar 2002 21:42:07 +0000 Subject: [PATCH 3119/7878] struct process_chain is not part of the API, so get it out of apr_thread_proc.h and instead move it to the one file that needs it git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63126 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 16 ---------------- memory/unix/apr_pools.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 78aba2864b7..4cf4269c84a 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -191,22 +191,6 @@ enum kill_conditions { kill_only_once /**< send SIGTERM and then wait */ }; -/** A list of processes */ -struct process_chain { - /** The process ID */ - apr_proc_t *pid; - /** When the process should be sent a signal.

    -     *           kill_never   -- process is never sent any signals
    -     *           kill_always  -- process is sent SIGKILL on apr_pool_t cleanup
    -     *           kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL
    -     *           just_wait    -- wait forever for the process to complete
    -     *           kill_only_once -- send SIGTERM and then wait 
    - */ - enum kill_conditions kill_how; - /** The next process in the list */ - struct process_chain *next; -}; - /* Thread Function definitions */ #if APR_HAS_THREADS diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 8f1e521ec6a..5185efddd5a 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -105,6 +105,22 @@ typedef struct cleanup_t cleanup_t; +/** A list of processes */ +struct process_chain { + /** The process ID */ + apr_proc_t *pid; + /** When the process should be sent a signal.
    +     *           kill_never   -- process is never sent any signals
    +     *           kill_always  -- process is sent SIGKILL on apr_pool_t cleanup
    +     *           kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL
    +     *           just_wait    -- wait forever for the process to complete
    +     *           kill_only_once -- send SIGTERM and then wait 
    + */ + enum kill_conditions kill_how; + /** The next process in the list */ + struct process_chain *next; +}; + #if !APR_POOL_DEBUG typedef struct allocator_t allocator_t; typedef struct node_t node_t; From 0fd87956af1ffb140404fcbac50ef00b0c77b168 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 14 Mar 2002 22:18:16 +0000 Subject: [PATCH 3120/7878] Move the kill_conditions enum in apr_thread_proc.h into the APR namespace. kill_after_timeout et al have been renamed appropriately (e.g., APR_KILL_AFTER_TIMEOUT). Jon Travis pointed this out some weeks ago on dev@apr.apache.org. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63127 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_thread_proc.h | 26 +++++++++++++------------- memory/unix/apr_pools.c | 23 ++++++++--------------- 3 files changed, 25 insertions(+), 28 deletions(-) diff --git a/CHANGES b/CHANGES index 67a95e276f7..cacf0a91d74 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Move the kill_conditions enum in apr_thread_proc.h into the + APR namespace. kill_after_timeout et al have been renamed + appropriately (e.g., APR_KILL_AFTER_TIMEOUT). [Jeff Trawick] + *) Fix a segfault in apr_thread_rwlock_destroy() on Win32. [INOUE Seiichiro ] diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 4cf4269c84a..5bbc0ede396 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -183,13 +183,13 @@ typedef struct apr_other_child_rec_t apr_other_child_rec_t; */ typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(apr_thread_t*, void*); -enum kill_conditions { - kill_never, /**< process is never sent any signals */ - kill_always, /**< process is sent SIGKILL on apr_pool_t cleanup */ - kill_after_timeout, /**< SIGTERM, wait 3 seconds, SIGKILL */ - just_wait, /**< wait forever for the process to complete */ - kill_only_once /**< send SIGTERM and then wait */ -}; +typedef enum { + APR_KILL_NEVER, /**< process is never sent any signals */ + APR_KILL_ALWAYS, /**< process is sent SIGKILL on apr_pool_t cleanup */ + APR_KILL_AFTER_TIMEOUT, /**< SIGTERM, wait 3 seconds, SIGKILL */ + APR_JUST_WAIT, /**< wait forever for the process to complete */ + APR_KILL_ONLY_ONCE /**< send SIGTERM and then wait */ +} apr_kill_conditions_e; /* Thread Function definitions */ @@ -634,15 +634,15 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); * @param pid The process to register * @param how How to kill the process, one of: *
    - *         kill_never   	   -- process is never sent any signals
    - *         kill_always 	   -- process is sent SIGKILL on apr_pool_t cleanup	
    - *         kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL
    - *         just_wait          -- wait forever for the process to complete
    - *         kill_only_once     -- send SIGTERM and then wait
    + *         APR_KILL_NEVER         -- process is never sent any signals
    + *         APR_KILL_ALWAYS        -- process is sent SIGKILL on apr_pool_t cleanup
    + *         APR_KILL_AFTER_TIMEOUT -- SIGTERM, wait 3 seconds, SIGKILL
    + *         APR_JUST_WAIT          -- wait forever for the process to complete
    + *         APR_KILL_ONLY_ONCE     -- send SIGTERM and then wait
      * 
    */ APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, - enum kill_conditions how); + apr_kill_conditions_e how); #if APR_HAS_THREADS diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 5185efddd5a..9f717b81994 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -109,14 +109,7 @@ typedef struct cleanup_t cleanup_t; struct process_chain { /** The process ID */ apr_proc_t *pid; - /** When the process should be sent a signal.
    -     *           kill_never   -- process is never sent any signals
    -     *           kill_always  -- process is sent SIGKILL on apr_pool_t cleanup
    -     *           kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL
    -     *           just_wait    -- wait forever for the process to complete
    -     *           kill_only_once -- send SIGTERM and then wait 
    - */ - enum kill_conditions kill_how; + apr_kill_conditions_e kill_how; /** The next process in the list */ struct process_chain *next; }; @@ -1718,7 +1711,7 @@ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) * For now, it's a special case. */ APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *pool, apr_proc_t *pid, - enum kill_conditions how) + apr_kill_conditions_e how) { struct process_chain *pc = apr_palloc(pool, sizeof(struct process_chain)); @@ -1751,13 +1744,13 @@ static void free_proc_chain(struct process_chain *procs) /* Pick up all defunct processes */ for (pc = procs; pc; pc = pc->next) { if (apr_proc_wait(pc->pid, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE) - pc->kill_how = kill_never; + pc->kill_how = APR_KILL_NEVER; } #endif /* !defined(NEED_WAITPID) */ for (pc = procs; pc; pc = pc->next) { - if ((pc->kill_how == kill_after_timeout) || - (pc->kill_how == kill_only_once)) { + if ((pc->kill_how == APR_KILL_AFTER_TIMEOUT) || + (pc->kill_how == APR_KILL_ONLY_ONCE)) { /* * Subprocess may be dead already. Only need the timeout if not. * Note: apr_proc_kill on Windows is TerminateProcess(), which is @@ -1771,7 +1764,7 @@ static void free_proc_chain(struct process_chain *procs) need_timeout = 1; #endif /* !defined(WIN32) */ } - else if (pc->kill_how == kill_always) { + else if (pc->kill_how == APR_KILL_ALWAYS) { apr_proc_kill(pc->pid, SIGKILL); } } @@ -1785,13 +1778,13 @@ static void free_proc_chain(struct process_chain *procs) * goop... */ for (pc = procs; pc; pc = pc->next) { - if (pc->kill_how == kill_after_timeout) + if (pc->kill_how == APR_KILL_AFTER_TIMEOUT) apr_proc_kill(pc->pid, SIGKILL); } /* Now wait for all the signaled processes to die */ for (pc = procs; pc; pc = pc->next) { - if (pc->kill_how != kill_never) + if (pc->kill_how != APR_KILL_NEVER) (void)apr_proc_wait(pc->pid, NULL, NULL, APR_WAIT); } From 51246983f3a15c68049520ee78b2115fe514cf00 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 14 Mar 2002 22:21:38 +0000 Subject: [PATCH 3121/7878] Win32 doesn't support remove-open-file semantics. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63128 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/testfile.c b/test/testfile.c index ccc3d2ea02c..4e81381db69 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -684,6 +684,9 @@ static void test_mod_neg(apr_pool_t *p, apr_int32_t flags) assert(!rv); assert(!strcmp(buf, "end456789\n")); + rv = apr_file_close(f); + assert(!rv); + rv = apr_file_remove(fname, p); assert(!rv); } From 2f30fd2ed399a52ff9556ac101a8a0a858156f5d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 14 Mar 2002 22:22:32 +0000 Subject: [PATCH 3122/7878] Jeff Trawick's seek-bug-fix (fixes and now passes test/filetest.c) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63129 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/seek.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 326dae0663f..2ebbc16e7ba 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -81,8 +81,10 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) rc = apr_get_os_error(); else rc = APR_SUCCESS; - if (rc == APR_SUCCESS) + if (rc == APR_SUCCESS) { thefile->eof_hit = thefile->bufpos = thefile->dataRead = 0; + thefile->filePtr = pos; + } } return rc; From b1e407460cf1b617c38ed462765c1c33b0b32171 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 15 Mar 2002 00:33:59 +0000 Subject: [PATCH 3123/7878] add a #define for apr_exploded_time_t in here as well this will stop people's current work from breaking PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63130 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_compat.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_compat.h b/include/apr_compat.h index 23a307ae09d..e6d9045f0b3 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -62,6 +62,8 @@ #define ap_destroy_pool apr_pool_destroy /** @deprecated @see apr_time_exp_t */ #define ap_exploded_time_t apr_time_exp_t +/** @deprecated @see apr_time_exp_t */ +#define apr_exploded_time_t apr_time_exp_t /** @deprecated @see apr_fnmatch */ #define ap_fnmatch apr_fnmatch /** @deprecated @see apr_getopt */ From 0f0678160b59640778d476be5357f2a156b65dab Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 15 Mar 2002 00:38:05 +0000 Subject: [PATCH 3124/7878] freebsd atomic support will only be available in 5 as the functionality is just not there in 4.5, and cripples the api PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63131 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 2 +- test/testatomic.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 40b42187d28..1e6bf528ca4 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -186,7 +186,7 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #define APR_ATOMIC_NEED_CAS_DEFAULT 1 #endif -#elif defined(__FreeBSD__) && (__FreeBSD__ >= 4) +#elif defined(__FreeBSD__) && (__FreeBSD__ >= 5) #include #define apr_atomic_t apr_uint32_t diff --git a/test/testatomic.c b/test/testatomic.c index 80020b00010..084e749cf6a 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -69,7 +69,7 @@ #include #endif -#if defined(__FreeBSD__) && (__FreeBSD__ < 4) +#if defined(__FreeBSD__) && (__FreeBSD__ < 5) int main(void) { From ed7306ebf296a538800c07711f774b75a34c51af Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 15 Mar 2002 00:48:24 +0000 Subject: [PATCH 3125/7878] Factor out the allocators from pools. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63132 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 160 ++++++++++ include/apr_pools.h | 36 +-- include/apr_thread_mutex.h | 12 +- memory/unix/apr_pools.c | 597 ++++++++++++++++++++----------------- 4 files changed, 510 insertions(+), 295 deletions(-) create mode 100644 include/apr_allocator.h diff --git a/include/apr_allocator.h b/include/apr_allocator.h new file mode 100644 index 00000000000..eb9eabc7be2 --- /dev/null +++ b/include/apr_allocator.h @@ -0,0 +1,160 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_ALLOCATOR_H +#define APR_ALLOCATOR_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file apr_allocator.h + * @brief APR memory allocation + * + */ + +#include "apr.h" +#include "apr_errno.h" +#define APR_WANT_MEMFUNC +#include "apr_want.h" + +#include "apr_thread_mutex.h" +#include "apr_pools.h" + + +typedef struct apr_allocator_t apr_allocator_t; +typedef struct apr_memnode_t apr_memnode_t; + +/** + * Create a new allocator + * @param allocator The allocator we have just created. + * + */ +APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator); + +/** + * Destroy an allocator + * @param allocator The allocator to be destroyed + * @remark Any memnodes not given back to the allocator prior to destroying + * will _not_ be free()d. + */ +APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator); + +/** + * Allocate a block of mem from the allocator + * @param allocator The allocator to allocate from + * @param size The size of the mem to allocate (excluding the + * memnode structure) + */ +/* + * XXX: Move this to a private header file + */ +APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, + apr_size_t size); + +/** + * Free a block of mem, giving it back to the allocator + * @param allocator The allocator to give the mem back to + * @param memnode The memory node to return + */ +/* + * XXX: Move this to a private header file + */ +APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, + apr_memnode_t *memnode); + +/** + * Set the owner of the allocator + * @param allocator The allocator to set the owner for + * @param pool The pool that is to own the allocator + * @remark Typically pool is the highest level pool using the allocator + */ +/* + * XXX: see if we can come up with something a bit better. Currently + * you can make a pool an owner, but if the pool doesn't use the allocator + * the allocator will never be destroyed. + */ +APR_DECLARE(void) apr_allocator_set_owner(apr_allocator_t *allocator, + apr_pool_t *pool); + +/** + * Get the current owner of the allocator + * @param allocator The allocator to get the owner from + */ +APR_DECLARE(apr_pool_t *) apr_allocator_get_owner(apr_allocator_t *allocator); + +#if APR_HAS_THREADS +/** + * Set a mutex for the allocator to use + * @param allocator The allocator to set the mutex for + * @param mutex The mutex + */ +APR_DECLARE(void) apr_allocator_set_mutex(apr_allocator_t *allocator, + apr_thread_mutex_t *mutex); + +/** + * Get the mutex currently set for the allocator + * @param allocator The allocator + */ +APR_DECLARE(apr_thread_mutex_t *) apr_allocator_get_mutex( + apr_allocator_t *allocator); +#endif /* APR_HAS_THREADS */ + + +#ifdef __cplusplus +} +#endif + +#endif /* !APR_ALLOCATOR_H */ diff --git a/include/apr_pools.h b/include/apr_pools.h index 6a094dd0551..630fd364f87 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -86,6 +86,11 @@ extern "C" { #define APR_WANT_MEMFUNC #include "apr_want.h" +/** The fundamental pool type */ +typedef struct apr_pool_t apr_pool_t; + +#include "apr_allocator.h" + /** * Pool debug levels * @@ -127,24 +132,15 @@ extern "C" { #else #define APR_POOL_DEBUG 0 #endif - + #define APR_POOL_STRINGIZE(x) APR_POOL__STRINGIZE(x) #define APR_POOL__STRINGIZE(x) #x #define APR_POOL__FILE_LINE__ __FILE__ ":" APR_POOL_STRINGIZE(__LINE__) - - -/** The fundamental pool type */ -typedef struct apr_pool_t apr_pool_t; -/** A function that is called when allocation fails. */ -typedef int (*apr_abortfunc_t)(int retcode); -/** Pool creation flags */ - -#define APR_POOL_FDEFAULT 0x0 -#define APR_POOL_FNEW_ALLOCATOR 0x1 -#define APR_POOL_FLOCK 0x2 +/** A function that is called when allocation fails. */ +typedef int (*apr_abortfunc_t)(int retcode); /* * APR memory structure manipulators (pools, tables, and arrays). @@ -193,7 +189,7 @@ APR_DECLARE(void) apr_pool_terminate(void); APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, - apr_uint32_t flags); + apr_allocator_t *allocator); /** * Debug version of apr_pool_create_ex. @@ -214,12 +210,12 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, - apr_uint32_t flags, + apr_allocator_t *allocator, const char *file_line); #if APR_POOL_DEBUG -#define apr_pool_create_ex(newpool, parent, abort_fn, flag) \ - apr_pool_create_ex_debug(newpool, parent, abort_fn, flag, \ +#define apr_pool_create_ex(newpool, parent, abort_fn, allocator) \ + apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \ APR_POOL__FILE_LINE__) #endif @@ -237,11 +233,11 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, #else #if APR_POOL_DEBUG #define apr_pool_create(newpool, parent) \ - apr_pool_create_ex_debug(newpool, parent, NULL, APR_POOL_FDEFAULT, \ + apr_pool_create_ex_debug(newpool, parent, NULL, NULL, \ APR_POOL__FILE_LINE__) #else #define apr_pool_create(newpool, parent) \ - apr_pool_create_ex(newpool, parent, NULL, APR_POOL_FDEFAULT) + apr_pool_create_ex(newpool, parent, NULL, NULL) #endif #endif @@ -256,11 +252,11 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, #if APR_POOL_DEBUG #define apr_pool_sub_make(newpool, parent, abort_fn) \ (void)apr_pool_create_ex_debug(newpool, parent, abort_fn, \ - APR_POOL_FDEFAULT, \ + NULL, \ APR_POOL__FILE_LINE__) #else #define apr_pool_sub_make(newpool, parent, abort_fn) \ - (void)apr_pool_create_ex(newpool, parent, abort_fn, APR_POOL_FDEFAULT) + (void)apr_pool_create_ex(newpool, parent, abort_fn, NULL) #endif /** diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 7b67f50ea72..5d4358dcfca 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -127,7 +127,17 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex); * Get the pool used by this thread_mutex. * @return apr_pool_t the pool */ -APR_POOL_DECLARE_ACCESSOR(thread_mutex); +/* + * XXX: We should do: + * + * APR_POOL_DECLARE_ACCESSOR(thread_mutex); + * + * But since there is a dependency between apr_thread_mutex.h, apr_pools.h + * and apr_allocator.h, this won't work without lots of warnings. Spelling + * it out resolves the problem. + */ +APR_DECLARE(apr_pool_t *) apr_thread_mutex_pool_get (const apr_thread_mutex_t *ob); + #endif /* APR_HAS_THREADS */ diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 9f717b81994..8c681a1199a 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -59,6 +59,7 @@ #include "apr_strings.h" #include "apr_general.h" #include "apr_pools.h" +#include "apr_allocator.h" #include "apr_lib.h" #include "apr_thread_mutex.h" #include "apr_hash.h" @@ -76,17 +77,17 @@ /* - * Debug level + * XXX: Memory node struct, move to private header file */ +struct apr_memnode_t { + apr_memnode_t *next; + apr_uint32_t index; + char *first_avail; + char *endp; +}; -#define APR_POOL_DEBUG_GENERAL 0x01 -#define APR_POOL_DEBUG_VERBOSE 0x02 -#define APR_POOL_DEBUG_LIFETIME 0x04 -#define APR_POOL_DEBUG_OWNER 0x08 -#define APR_POOL_DEBUG_VERBOSE_ALLOC 0x10 +#define SIZEOF_MEMNODE_T APR_ALIGN_DEFAULT(sizeof(apr_memnode_t)) -#define APR_POOL_DEBUG_VERBOSE_ALL (APR_POOL_DEBUG_VERBOSE \ - | APR_POOL_DEBUG_VERBOSE_ALLOC) /* * Magic numbers @@ -100,208 +101,95 @@ /* - * Structures + * Allocator */ -typedef struct cleanup_t cleanup_t; - -/** A list of processes */ -struct process_chain { - /** The process ID */ - apr_proc_t *pid; - apr_kill_conditions_e kill_how; - /** The next process in the list */ - struct process_chain *next; -}; - -#if !APR_POOL_DEBUG -typedef struct allocator_t allocator_t; -typedef struct node_t node_t; - -struct node_t { - node_t *next; - apr_uint32_t index; - char *first_avail; - char *endp; -}; - -struct allocator_t { +struct apr_allocator_t { apr_uint32_t max_index; #if APR_HAS_THREADS apr_thread_mutex_t *mutex; #endif /* APR_HAS_THREADS */ apr_pool_t *owner; - node_t *free[MAX_INDEX]; -}; - -#define SIZEOF_NODE_T APR_ALIGN_DEFAULT(sizeof(node_t)) -#define SIZEOF_ALLOCATOR_T APR_ALIGN_DEFAULT(sizeof(allocator_t)) - -#else /* APR_POOL_DEBUG */ - -typedef struct debug_node_t debug_node_t; - -struct debug_node_t { - debug_node_t *next; - apr_uint32_t index; - void *beginp[64]; - void *endp[64]; + apr_memnode_t *free[MAX_INDEX]; }; -#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t)) - -#endif /* APR_POOL_DEBUG */ - -/* The ref field in the apr_pool_t struct holds a - * pointer to the pointer referencing this pool. - * It is used for parent, child, sibling management. - * Look at apr_pool_create_ex() and apr_pool_destroy() - * to see how it is used. - */ -struct apr_pool_t { - apr_pool_t *parent; - apr_pool_t *child; - apr_pool_t *sibling; - apr_pool_t **ref; - cleanup_t *cleanups; - struct process_chain *subprocesses; - apr_abortfunc_t abort_fn; - apr_hash_t *user_data; - const char *tag; - -#if !APR_POOL_DEBUG - allocator_t *allocator; - node_t *active; - node_t *self; /* The node containing the pool itself */ - char *self_first_avail; - -#else /* APR_POOL_DEBUG */ - debug_node_t *nodes; - const char *file_line; - apr_uint32_t creation_flags; - unsigned int stat_alloc; - unsigned int stat_total_alloc; - unsigned int stat_clear; -#if APR_HAS_THREADS - apr_os_thread_t owner; - apr_thread_mutex_t *mutex; -#endif /* APR_HAS_THREADS */ -#endif /* APR_POOL_DEBUG */ -#ifdef NETWARE - apr_os_proc_t owner_proc; -#endif /* defined(NETWARE) */ -}; - -#define SIZEOF_POOL_T APR_ALIGN_DEFAULT(sizeof(apr_pool_t)) - - -/* - * Variables - */ - -static apr_byte_t apr_pools_initialized = 0; -static apr_pool_t *global_pool = NULL; - -#if !APR_POOL_DEBUG -static allocator_t global_allocator = { - 0, /* max_index */ -#if APR_HAS_THREADS - NULL, /* mutex */ -#endif /* APR_HAS_THREADS */ - NULL, /* owner */ - { NULL } /* free[0] */ -}; -#endif /* !APR_POOL_DEBUG */ - -#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) -static apr_file_t *file_stderr = NULL; -#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ - -/* - * Local functions - */ - -static void run_cleanups(cleanup_t *c); -static void run_child_cleanups(cleanup_t *c); -static void free_proc_chain(struct process_chain *procs); +#define SIZEOF_ALLOCATOR_T APR_ALIGN_DEFAULT(sizeof(apr_allocator_t)) -#if !APR_POOL_DEBUG /* - * Initialization + * Allocator */ -APR_DECLARE(apr_status_t) apr_pool_initialize(void) +APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator) { - apr_status_t rv; + apr_allocator_t *new_allocator; - if (apr_pools_initialized++) - return APR_SUCCESS; - - memset(&global_allocator, 0, sizeof(global_allocator)); + *allocator = NULL; - if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, APR_POOL_FDEFAULT)) != APR_SUCCESS) { - return rv; - } + if ((new_allocator = malloc(SIZEOF_ALLOCATOR_T)) == NULL) + return APR_ENOMEM; -#if APR_HAS_THREADS - if ((rv = apr_thread_mutex_create(&global_allocator.mutex, - APR_THREAD_MUTEX_DEFAULT, global_pool)) != APR_SUCCESS) { - return rv; - } -#endif /* APR_HAS_THREADS */ + memset(new_allocator, 0, SIZEOF_ALLOCATOR_T); - global_allocator.owner = global_pool; - apr_pools_initialized = 1; + *allocator = new_allocator; return APR_SUCCESS; } -APR_DECLARE(void) apr_pool_terminate(void) +APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) { - if (!apr_pools_initialized) - return; + apr_uint32_t index; + apr_memnode_t *node, **ref; - apr_pools_initialized = 0; + for (index = 0; index < MAX_INDEX; index++) { + ref = &allocator->free[index]; + while ((node = *ref) != NULL) { + *ref = node->next; + free(node); + } + } - apr_pool_destroy(global_pool); /* This will also destroy the mutex */ - global_pool = NULL; + free(allocator); +} - memset(&global_allocator, 0, sizeof(global_allocator)); +#if APR_HAS_THREADS +APR_INLINE +APR_DECLARE(void) apr_allocator_set_mutex(apr_allocator_t *allocator, + apr_thread_mutex_t *mutex) +{ + allocator->mutex = mutex; } -#ifdef NETWARE -void netware_pool_proc_cleanup () +APR_INLINE +APR_DECLARE(apr_thread_mutex_t *) apr_allocator_get_mutex( + apr_allocator_t *allocator) { - apr_pool_t *pool = global_pool->child; - apr_os_proc_t owner_proc = (apr_os_proc_t)getnlmhandle(); + return allocator->mutex; +} +#endif /* APR_HAS_THREADS */ - while (pool) { - if (pool->owner_proc == owner_proc) { - apr_pool_destroy (pool); - pool = global_pool->child; - } - else { - pool = pool->sibling; - } - } - return; +APR_DECLARE(void) apr_allocator_set_owner(apr_allocator_t *allocator, + apr_pool_t *pool) +{ + allocator->owner = pool; } -#endif /* defined(NETWARE) */ -/* - * Memory allocation - */ +APR_DECLARE(apr_pool_t *) apr_allocator_get_owner(apr_allocator_t *allocator) +{ + return allocator->owner; +} -static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) +APR_INLINE +APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, + apr_size_t size) { - node_t *node, **ref; + apr_memnode_t *node, **ref; apr_uint32_t i, index, max_index; /* Round up the block size to the next boundary, but always * allocate at least a certain size (MIN_ALLOC). */ - size = APR_ALIGN(size + SIZEOF_NODE_T, BOUNDARY_SIZE); + size = APR_ALIGN(size + SIZEOF_MEMNODE_T, BOUNDARY_SIZE); if (size < MIN_ALLOC) size = MIN_ALLOC; @@ -359,7 +247,7 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) #endif /* APR_HAS_THREADS */ node->next = NULL; - node->first_avail = (char *)node + SIZEOF_NODE_T; + node->first_avail = (char *)node + SIZEOF_MEMNODE_T; return node; } @@ -395,7 +283,7 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) #endif /* APR_HAS_THREADS */ node->next = NULL; - node->first_avail = (char *)node + SIZEOF_NODE_T; + node->first_avail = (char *)node + SIZEOF_MEMNODE_T; return node; } @@ -414,15 +302,16 @@ static APR_INLINE node_t *node_malloc(allocator_t *allocator, apr_size_t size) node->next = NULL; node->index = index; - node->first_avail = (char *)node + SIZEOF_NODE_T; + node->first_avail = (char *)node + SIZEOF_MEMNODE_T; node->endp = (char *)node + size; return node; } -static APR_INLINE void node_free(allocator_t *allocator, node_t *node) +APR_INLINE +APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) { - node_t *next; + apr_memnode_t *next; apr_uint32_t index, max_index; #if APR_HAS_THREADS @@ -466,9 +355,203 @@ static APR_INLINE void node_free(allocator_t *allocator, node_t *node) #endif /* APR_HAS_THREADS */ } + +/* + * Debug level + */ + +#define APR_POOL_DEBUG_GENERAL 0x01 +#define APR_POOL_DEBUG_VERBOSE 0x02 +#define APR_POOL_DEBUG_LIFETIME 0x04 +#define APR_POOL_DEBUG_OWNER 0x08 +#define APR_POOL_DEBUG_VERBOSE_ALLOC 0x10 + +#define APR_POOL_DEBUG_VERBOSE_ALL (APR_POOL_DEBUG_VERBOSE \ + | APR_POOL_DEBUG_VERBOSE_ALLOC) + + +/* + * Structures + */ + +typedef struct cleanup_t cleanup_t; + +/** A list of processes */ +struct process_chain { + /** The process ID */ + apr_proc_t *pid; + apr_kill_conditions_e kill_how; + /** The next process in the list */ + struct process_chain *next; +}; + + +#if APR_POOL_DEBUG + +typedef struct debug_node_t debug_node_t; + +struct debug_node_t { + debug_node_t *next; + apr_uint32_t index; + void *beginp[64]; + void *endp[64]; +}; + +#define SIZEOF_DEBUG_NODE_T APR_ALIGN_DEFAULT(sizeof(debug_node_t)) + +#endif /* APR_POOL_DEBUG */ + +/* The ref field in the apr_pool_t struct holds a + * pointer to the pointer referencing this pool. + * It is used for parent, child, sibling management. + * Look at apr_pool_create_ex() and apr_pool_destroy() + * to see how it is used. + */ +struct apr_pool_t { + apr_pool_t *parent; + apr_pool_t *child; + apr_pool_t *sibling; + apr_pool_t **ref; + cleanup_t *cleanups; + apr_allocator_t *allocator; + struct process_chain *subprocesses; + apr_abortfunc_t abort_fn; + apr_hash_t *user_data; + const char *tag; + +#if !APR_POOL_DEBUG + apr_memnode_t *active; + apr_memnode_t *self; /* The node containing the pool itself */ + char *self_first_avail; + +#else /* APR_POOL_DEBUG */ + debug_node_t *nodes; + const char *file_line; + apr_uint32_t creation_flags; + unsigned int stat_alloc; + unsigned int stat_total_alloc; + unsigned int stat_clear; +#if APR_HAS_THREADS + apr_os_thread_t owner; + apr_thread_mutex_t *mutex; +#endif /* APR_HAS_THREADS */ +#endif /* APR_POOL_DEBUG */ +#ifdef NETWARE + apr_os_proc_t owner_proc; +#endif /* defined(NETWARE) */ +}; + +#define SIZEOF_POOL_T APR_ALIGN_DEFAULT(sizeof(apr_pool_t)) + + +/* + * Variables + */ + +static apr_byte_t apr_pools_initialized = 0; +static apr_pool_t *global_pool = NULL; + +#if !APR_POOL_DEBUG +static apr_allocator_t *global_allocator = NULL; +#endif /* !APR_POOL_DEBUG */ + +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) +static apr_file_t *file_stderr = NULL; +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ + +/* + * Local functions + */ + +static void run_cleanups(cleanup_t *c); +static void run_child_cleanups(cleanup_t *c); +static void free_proc_chain(struct process_chain *procs); + + +#if !APR_POOL_DEBUG +/* + * Initialization + */ + +APR_DECLARE(apr_status_t) apr_pool_initialize(void) +{ + apr_status_t rv; + + if (apr_pools_initialized++) + return APR_SUCCESS; + + if ((rv = apr_allocator_create(&global_allocator)) != APR_SUCCESS) { + apr_pools_initialized = 0; + return rv; + } + + if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, + global_allocator)) != APR_SUCCESS) { + apr_allocator_destroy(global_allocator); + global_allocator = NULL; + apr_pools_initialized = 0; + return rv; + } + +#if APR_HAS_THREADS + { + apr_thread_mutex_t *mutex; + + if ((rv = apr_thread_mutex_create(&mutex, + APR_THREAD_MUTEX_DEFAULT, + global_pool)) != APR_SUCCESS) { + return rv; + } + + apr_allocator_set_mutex(global_allocator, mutex); + } +#endif /* APR_HAS_THREADS */ + + apr_allocator_set_owner(global_allocator, global_pool); + + return APR_SUCCESS; +} + +APR_DECLARE(void) apr_pool_terminate(void) +{ + if (!apr_pools_initialized) + return; + + if (--apr_pools_initialized) + return; + + apr_pool_destroy(global_pool); /* This will also destroy the mutex */ + global_pool = NULL; + + global_allocator = NULL; +} + +#ifdef NETWARE +void netware_pool_proc_cleanup () +{ + apr_pool_t *pool = global_pool->child; + apr_os_proc_t owner_proc = (apr_os_proc_t)getnlmhandle(); + + while (pool) { + if (pool->owner_proc == owner_proc) { + apr_pool_destroy (pool); + pool = global_pool->child; + } + else { + pool = pool->sibling; + } + } + return; +} +#endif /* defined(NETWARE) */ + +/* + * Memory allocation + */ + APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) { - node_t *active, *node; + apr_memnode_t *active, *node; void *mem; char *endp; @@ -484,7 +567,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) return mem; } - if ((node = node_malloc(pool->allocator, size)) == NULL) { + if ((node = apr_allocator_alloc(pool->allocator, size)) == NULL) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); @@ -518,7 +601,7 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) { - node_t *active; + apr_memnode_t *active; /* Destroy the subpools. The subpools will detach themselves from * this pool thus this loop is safe and easy. @@ -546,15 +629,14 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) if (active->next == NULL) return; - node_free(pool->allocator, active->next); + apr_allocator_free(pool->allocator, active->next); active->next = NULL; } APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) { - node_t *node, *active, **ref; - allocator_t *allocator; - apr_uint32_t index; + apr_memnode_t *active; + apr_allocator_t *allocator; /* Destroy the subpools. The subpools will detach themselve from * this pool thus this loop is safe and easy. @@ -573,7 +655,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) #if APR_HAS_THREADS apr_thread_mutex_t *mutex; - if ((mutex = pool->parent->allocator->mutex) != NULL) + if ((mutex = apr_allocator_get_mutex(pool->parent->allocator)) != NULL) apr_thread_mutex_lock(mutex); #endif /* APR_HAS_THREADS */ @@ -592,43 +674,28 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) allocator = pool->allocator; active = pool->self; + /* Free all the nodes in the pool (including the node holding the + * pool struct), by giving them back to the allocator. + */ + apr_allocator_free(allocator, active); + /* If this pool happens to be the owner of the allocator, free * everything in the allocator (that includes the pool struct * and the allocator). Don't worry about destroying the optional mutex * in the allocator, it will have been destroyed by the cleanup function. */ - if (allocator->owner == pool) { - for (index = 0; index < MAX_INDEX; index++) { - ref = &allocator->free[index]; - while ((node = *ref) != NULL) { - *ref = node->next; - free(node); - } - } - - ref = &active; - while ((node = *ref) != NULL) { - *ref = node->next; - free(node); - } - - return; + if (apr_allocator_get_owner(allocator) == pool) { + apr_allocator_destroy(allocator); } - - /* Free all the nodes in the pool (including the node holding the - * pool struct), by giving them back to the allocator. - */ - node_free(allocator, active); } APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, - apr_uint32_t flags) + apr_allocator_t *allocator) { apr_pool_t *pool; - node_t *node; - allocator_t *allocator, *new_allocator; + apr_memnode_t *node; *newpool = NULL; @@ -638,56 +705,27 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, if (!abort_fn && parent) abort_fn = parent->abort_fn; - allocator = parent ? parent->allocator : &global_allocator; - if ((node = node_malloc(allocator, MIN_ALLOC - SIZEOF_NODE_T)) == NULL) { + if (allocator == NULL) + allocator = parent->allocator; + + if ((node = apr_allocator_alloc(allocator, MIN_ALLOC - SIZEOF_MEMNODE_T)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); return APR_ENOMEM; } - if ((flags & APR_POOL_FNEW_ALLOCATOR) == APR_POOL_FNEW_ALLOCATOR) { - new_allocator = (allocator_t *)node->first_avail; - pool = (apr_pool_t *)((char *)new_allocator + SIZEOF_ALLOCATOR_T); - node->first_avail = pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; - - memset(new_allocator, 0, SIZEOF_ALLOCATOR_T); - new_allocator->owner = pool; + pool = (apr_pool_t *)node->first_avail; + node->first_avail = pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; - pool->allocator = new_allocator; - pool->active = pool->self = node; - pool->abort_fn = abort_fn; - pool->child = NULL; - pool->cleanups = NULL; - pool->subprocesses = NULL; - pool->user_data = NULL; - pool->tag = NULL; - -#if APR_HAS_THREADS - if ((flags & APR_POOL_FLOCK) == APR_POOL_FLOCK) { - apr_status_t rv; - - if ((rv = apr_thread_mutex_create(&allocator->mutex, - APR_THREAD_MUTEX_DEFAULT, pool)) != APR_SUCCESS) { - node_free(allocator, node); - return rv; - } - } -#endif /* APR_HAS_THREADS */ - } - else { - pool = (apr_pool_t *)node->first_avail; - node->first_avail = pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; - - pool->allocator = allocator; - pool->active = pool->self = node; - pool->abort_fn = abort_fn; - pool->child = NULL; - pool->cleanups = NULL; - pool->subprocesses = NULL; - pool->user_data = NULL; - pool->tag = NULL; - } + pool->allocator = allocator; + pool->active = pool->self = node; + pool->abort_fn = abort_fn; + pool->child = NULL; + pool->cleanups = NULL; + pool->subprocesses = NULL; + pool->user_data = NULL; + pool->tag = NULL; #ifdef NETWARE pool->owner_proc = (apr_os_proc_t)getnlmhandle(); @@ -695,9 +733,12 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, if ((pool->parent = parent) != NULL) { #if APR_HAS_THREADS - if (allocator->mutex) - apr_thread_mutex_lock(allocator->mutex); + apr_thread_mutex_t *mutex; + + if ((mutex = apr_allocator_get_mutex(allocator)) != NULL) + apr_thread_mutex_lock(mutex); #endif /* APR_HAS_THREADS */ + if ((pool->sibling = parent->child) != NULL) pool->sibling->ref = &pool->sibling; @@ -705,8 +746,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, pool->ref = &parent->child; #if APR_HAS_THREADS - if (allocator->mutex) - apr_thread_mutex_unlock(allocator->mutex); + if (mutex) + apr_thread_mutex_unlock(mutex); #endif /* APR_HAS_THREADS */ } else { @@ -740,26 +781,26 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, struct psprintf_data { apr_vformatter_buff_t vbuff; - node_t *node; - allocator_t *allocator; - apr_byte_t got_a_new_node; - node_t *free; + apr_memnode_t *node; + apr_allocator_t *allocator; + apr_byte_t got_a_new_node; + apr_memnode_t *free; }; static int psprintf_flush(apr_vformatter_buff_t *vbuff) { struct psprintf_data *ps = (struct psprintf_data *)vbuff; - node_t *node, *active; + apr_memnode_t *node, *active; apr_size_t cur_len; char *strp; - allocator_t *allocator; + apr_allocator_t *allocator; allocator = ps->allocator; node = ps->node; strp = ps->vbuff.curpos; cur_len = strp - node->first_avail; - if ((active = node_malloc(allocator, cur_len << 1)) == NULL) + if ((active = apr_allocator_alloc(allocator, cur_len << 1)) == NULL) return -1; memcpy(active->first_avail, node->first_avail, cur_len); @@ -782,7 +823,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) struct psprintf_data ps; char *strp; apr_size_t size; - node_t *active; + apr_memnode_t *active; ps.node = active = pool->active; ps.allocator = pool->allocator; @@ -816,7 +857,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) } if (ps.free) - node_free(ps.allocator, ps.free); + apr_allocator_free(ps.allocator, ps.free); return strp; } @@ -868,10 +909,10 @@ static int apr_pool_walk_tree(apr_pool_t *pool, return rv; } +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) static void apr_pool_log_event(apr_pool_t *pool, const char *event, const char *file_line, int deref) { -#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) if (file_stderr) { if (deref) { apr_file_printf(file_stderr, @@ -921,8 +962,8 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, file_line); } } -#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ } +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ static int pool_is_child_of(apr_pool_t *parent, void *data) { @@ -992,7 +1033,7 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) * allocator, a concept unknown to debug mode. */ if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, - APR_POOL_FNEW_ALLOCATOR|APR_POOL_FLOCK)) != APR_SUCCESS) { + NULL)) != APR_SUCCESS) { return rv; } @@ -1191,6 +1232,11 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, #endif /* APR_HAS_THREADS */ } + if (pool->allocator != NULL + && apr_allocator_get_owner(pool->allocator) == pool) { + apr_allocator_destroy(pool->allocator); + } + /* Free the pool itself */ free(pool); } @@ -1198,7 +1244,7 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, - apr_uint32_t flags, + apr_allocator_t *allocator, const char *file_line) { apr_pool_t *pool; @@ -1210,6 +1256,9 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, } else { apr_pool_check_integrity(parent); + + if (!allocator) + allocator = parent->allocator; } if (!abort_fn && parent) @@ -1224,10 +1273,10 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, memset(pool, 0, SIZEOF_POOL_T); + pool->allocator = allocator; pool->abort_fn = abort_fn; pool->tag = file_line; pool->file_line = file_line; - pool->creation_flags = flags; if ((pool->parent = parent) != NULL) { #if APR_HAS_THREADS @@ -1254,7 +1303,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, pool->owner = apr_os_thread_current(); #endif /* APR_HAS_THREADS */ - if ((flags & APR_POOL_FNEW_ALLOCATOR) == APR_POOL_FNEW_ALLOCATOR) { + if (parent != NULL || parent->allocator != allocator) { #if APR_HAS_THREADS apr_status_t rv; @@ -1840,10 +1889,10 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, - apr_uint32_t flags, + apr_allocator_t *allocator, const char *file_line) { - return apr_pool_create_ex(newpool, parent, abort_fn, flags); + return apr_pool_create_ex(newpool, parent, abort_fn, allocator); } #else /* APR_POOL_DEBUG */ @@ -1884,15 +1933,15 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, - apr_uint32_t flags); + apr_allocator_t *allocator); APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, - apr_uint32_t flags) + apr_allocator_t *allocator) { return apr_pool_create_ex_debug(newpool, parent, - abort_fn, flags, + abort_fn, allocator, "undefined"); } From da1b79faec1a7de59b4478d50828ede576868139 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 15 Mar 2002 02:25:00 +0000 Subject: [PATCH 3126/7878] CHANGES git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63133 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 2 +- file_io/unix/open.c | 10 ++++++---- file_io/unix/readwrite.c | 16 ++++++++++++---- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index cbad4589cbd..87b76fdbb39 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -94,7 +94,7 @@ static apr_status_t _file_dup(apr_file_t **new_file, * want to create it again as we could leak! */ #if APR_HAS_THREADS - if ((*new_file)->buffered && !(*new_file)->thlock) { + if ((*new_file)->buffered && !(*new_file)->thlock && old_file->thlock) { apr_thread_mutex_create(&((*new_file)->thlock), APR_THREAD_MUTEX_DEFAULT, p); } diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 610c8820b64..ff2d4071b38 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -123,10 +123,12 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, if ((*new)->buffered) { (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); #if APR_HAS_THREADS - rv = apr_thread_mutex_create(&((*new)->thlock), - APR_THREAD_MUTEX_DEFAULT, cont); - if (rv) { - return rv; + if ((*new)->flags & APR_XTHREAD) { + rv = apr_thread_mutex_create(&((*new)->thlock), + APR_THREAD_MUTEX_DEFAULT, cont); + if (rv) { + return rv; + } } #endif } diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 2f05183d6d4..6b3ab52ace9 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -118,7 +118,9 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size apr_uint64_t size = *nbytes; #if APR_HAS_THREADS - apr_thread_mutex_lock(thefile->thlock); + if (thefile->thlock) { + apr_thread_mutex_lock(thefile->thlock); + } #endif if (thefile->direction == 1) { @@ -164,7 +166,9 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size rv = 0; } #if APR_HAS_THREADS - apr_thread_mutex_unlock(thefile->thlock); + if (thefile->thlock) { + apr_thread_mutex_unlock(thefile->thlock); + } #endif return rv; } @@ -223,7 +227,9 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a int size = *nbytes; #if APR_HAS_THREADS - apr_thread_mutex_lock(thefile->thlock); + if (thefile->thlock) { + apr_thread_mutex_lock(thefile->thlock); + } #endif if ( thefile->direction == 0 ) { @@ -251,7 +257,9 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } #if APR_HAS_THREADS - apr_thread_mutex_unlock(thefile->thlock); + if (thefile->thlock) { + apr_thread_mutex_unlock(thefile->thlock); + } #endif return rv; } From dc0b695f847bef210d210a77fbc14990927f4089 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 15 Mar 2002 02:26:10 +0000 Subject: [PATCH 3127/7878] Only create a thread mutex with apr_file_open if the flags include APR_XTHREAD. (This keeps us from doing a mutex lock/unlock on every read/write of a buffered file that's only used by a single thread.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63134 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index cacf0a91d74..41da02bb62d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) When opening a file, only create an internal thread mutex + if APR_XTHREAD is set. [Brian Pane] + *) Move the kill_conditions enum in apr_thread_proc.h into the APR namespace. kill_after_timeout et al have been renamed appropriately (e.g., APR_KILL_AFTER_TIMEOUT). [Jeff Trawick] From 0a6f9657de5a24917cd3d58f9372d7f1991aae43 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 15 Mar 2002 15:40:18 +0000 Subject: [PATCH 3128/7878] Many broken tests these days [fork() and missing stuff], but at least this makes it easier to get them fixed. More files missing from this list, but we use Makefile.in - so this list is for 'handy reference', not really a list of build targets. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63135 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.dsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/aprtest.dsp b/test/aprtest.dsp index f021de26ebd..ea36c878fc6 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -148,7 +148,7 @@ SOURCE=.\testproc.c # End Source File # Begin Source File -SOURCE=.\testshmem.c +SOURCE=.\testshm.c # End Source File # Begin Source File From 5e63167f4bb0908d3eb6c839cd0b97e5ce7cdd33 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 15 Mar 2002 15:51:23 +0000 Subject: [PATCH 3129/7878] add a new suggestion -- letting apr_stat() et al fail requests for info on non-dirs when the name has trailing '/' tweak some existing entries git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63136 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index b802124a300..3abb6ffa890 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/02/18 06:25:59 $] +Last modified at [$Date: 2002/03/15 15:51:23 $] Release: @@ -18,6 +18,8 @@ RELEASE SHOWSTOPPERS: * Must namespace protect all include/apr_foo.h headers. Jon Travis has especially observed these including apr and Apache-1.3. Message-ID: <20020128100116.A4288@covalent.net> + (Those problems have been fixed, but it is a good example of + what to look for.) * complete the efforts started by DougM for cleaner fn naming conventions: see proposed name changes in renames_pending @@ -51,7 +53,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: +1: BrianH, Aaron * Need some architecture/OS specific versions of the atomic operations. - progress: generic, solaris Sparc, FreeBSD4, and linux done + progress: generic, solaris Sparc, FreeBSD5, and linux done need: AIX, AS400, HPUX, OS/390 * The new lock API is a full replacement for the old API, but is @@ -120,7 +122,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Deal with largefiles properly on those platforms that support it. Justin says: Linux refuses to have sendfile support and largefiles - at the sametime. Largefile autoconf patch: + at the same time. Largefile autoconf patch: http://www.apache.org/~jerenkrantz/apr_largefile.m4 * Get OTHER_CHILD support into Win32 @@ -138,6 +140,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: change the initial permissions to 0666. Needed code: See 1.3's http_main.c, SysV sem flavor of accept_mutex_init(). Status: Jim will look into this + Update: Apache deals with this itself, though it might be nice + if APR could do something. * Build scripts do not recognise AIX 4.2.1 pthreads Justin says: "Is this still true?" @@ -292,6 +296,14 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * implement APR_PROGRAM_ENV and APR_PROGRAM_PATH on BeOS, OS/2, Netware, and Win32. + * stat() on a few platforms (notably Solaris and AIX) succeeds for + a non-directory even if a trailing '/' was specified in the + name. APR should perhaps simulate the normal -1/ENOTDIR + behavior in APR routines which retrieve information about the + file. Note: Win2K fails GetFileAttributesEx in this scenario. + See OtherBill's comments in this message to dev@httpd.apache.org: + Message-Id: <5.1.0.14.2.20020315080852.00bce168@localhost> + Documentation that needs writing: * API documentation From 44edd76639eb464fb563a9f556abecc6e758d557 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 15 Mar 2002 17:42:05 +0000 Subject: [PATCH 3130/7878] clean up the use of apr_sockaddr_t (stay out of family-specific struct sockaddr* as much as possible) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63137 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 888d13054fe..d9ceb345480 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -501,13 +501,12 @@ static char *conv_apr_sockaddr(apr_sockaddr_t *sa, char *buf_end, int *len) int sub_len; char *ipaddr_str; - /* XXX IPv6: this assumes sin_port and sin6_port are at same offset */ - p = conv_10(ntohs(sa->sa.sin.sin_port), TRUE, &is_negative, p, &sub_len); + p = conv_10(sa->port, TRUE, &is_negative, p, &sub_len); *--p = ':'; apr_sockaddr_ip_get(&ipaddr_str, sa); sub_len = strlen(ipaddr_str); #if APR_HAVE_IPV6 - if (sa->sa.sin.sin_family == APR_INET6 && + if (sa->family == APR_INET6 && !IN6_IS_ADDR_V4MAPPED(&sa->sa.sin6.sin6_addr)) { *(p - 1) = ']'; p -= sub_len + 2; From 33f9ceadd77f4ea77a61d23bb4cecfafa94f0f38 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 15 Mar 2002 20:13:34 +0000 Subject: [PATCH 3131/7878] note some possible namespace protection issues found with a casual browse of public header files git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63138 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 3abb6ffa890..a6159a3a504 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/03/15 15:51:23 $] +Last modified at [$Date: 2002/03/15 20:13:34 $] Release: @@ -20,6 +20,16 @@ RELEASE SHOWSTOPPERS: Message-ID: <20020128100116.A4288@covalent.net> (Those problems have been fixed, but it is a good example of what to look for.) + Some headers with issues: + apr_fnmatch.h (FNM_foo) + apr_general.h (MAXIMUM_WAIT_OBJECTS) + apr_md5.h (MD5_DIGESTSIZE) + apr_network_io.h (MAX_SECONDS_TO_LINGER) + apr.hnw (READDIR_IS_THREAD_SAFE, ENUM_BITFIELD, + _POSIX_THREAD_SAFE_FUNCTIONS (?), + nuint8, nuint16, NGetLo8, NGetHi8, + HIBYTE, LOBYTE) + apr.hw (NO_USE_SIGACTION) * complete the efforts started by DougM for cleaner fn naming conventions: see proposed name changes in renames_pending From 1b8c91122b1072c3092d7c7903a03e761ccc1c35 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sat, 16 Mar 2002 03:54:00 +0000 Subject: [PATCH 3132/7878] apr_atomic_dec now returns zero if the value is zero. PR: Obtained from: Submitted by: Greg Ames Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63139 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ atomic/unix/apr_atomic.c | 6 +++--- include/apr_atomic.h | 7 ++++--- test/testatomic.c | 13 ++++++++++++- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 41da02bb62d..e960cf70a68 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) apr_atomic_dec now returns a zero value if the value of + the atomic is zero, non-zero otherwise [Ian Holsman] + *) When opening a file, only create an internal thread mutex if APR_XTHREAD is set. [Brian Pane] diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index e6ba671fdac..686b19bf644 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -123,7 +123,7 @@ void apr_atomic_inc( volatile apr_uint32_t *mem) } /* return *mem; */ } -void apr_atomic_dec(volatile apr_atomic_t *mem) +int apr_atomic_dec(volatile apr_atomic_t *mem) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; apr_uint32_t prev; @@ -132,9 +132,9 @@ void apr_atomic_dec(volatile apr_atomic_t *mem) prev = *mem; (*mem)--; apr_thread_mutex_unlock(lock); -/* return prev; */ + return prev; } -/* return *mem; */ + return *mem; } #endif /* APR_ATOMIC_NEED_DEFAULT */ diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 1e6bf528ca4..299829be75f 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -117,8 +117,9 @@ void apr_atomic_inc(volatile apr_atomic_t *mem); /** * decrement the atomic variable by 1 * @param mem pointer to the atomic value + * @returns zero if the value is zero, otherwise non-zero */ -void apr_atomic_dec(volatile apr_atomic_t *mem); +int apr_atomic_dec(volatile apr_atomic_t *mem); /** * compare the atomic's value with cmp. @@ -158,7 +159,7 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #define apr_atomic_t atomic_t #define apr_atomic_add(mem, val) atomic_add(val,mem) -#define apr_atomic_dec(mem) atomic_dec(mem) +#define apr_atomic_dec(mem) !atomic_dec_and_test(mem) #define apr_atomic_inc(mem) atomic_inc(mem) #define apr_atomic_set(mem, val) atomic_set(mem, val) #define apr_atomic_read(mem) atomic_read(mem) @@ -228,7 +229,7 @@ apr_status_t apr_atomic_init(apr_pool_t *p); void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val); void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val); void apr_atomic_inc(volatile apr_atomic_t *mem); -void apr_atomic_dec(volatile apr_atomic_t *mem); +int apr_atomic_dec(volatile apr_atomic_t *mem); #endif #if defined(APR_ATOMIC_NEED_CAS_DEFAULT) diff --git a/test/testatomic.c b/test/testatomic.c index 084e749cf6a..13f1fbd95d9 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -85,7 +85,18 @@ static apr_status_t check_basic_atomics(volatile apr_atomic_t*p) { apr_uint32_t oldval; apr_uint32_t casval=0; - apr_atomic_set(&y,0); + apr_atomic_set(&y,2); + printf("%-60s", "testing apr_atomic_dec"); + if ( apr_atomic_dec(&y) == 0 ) { + fprintf(stderr, "Failed\noldval =%d should not be zero\n",apr_atomic_read(&y)); + return APR_EGENERAL; + } + if ( apr_atomic_dec(&y) != 0 ) { + fprintf(stderr, "Failed\noldval =%d should be zero\n",apr_atomic_read(&y)); + return APR_EGENERAL; + } + printf("OK\n"); + printf("%-60s", "testing CAS"); oldval = apr_atomic_cas(&casval,12,0); if (oldval != 0) { From 26fed4802d563b1f4345856d90949c4d939191a6 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sat, 16 Mar 2002 06:19:55 +0000 Subject: [PATCH 3133/7878] revert change now people are going to get alot of failures when upgrading from current beta.. oh well git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63140 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_compat.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/apr_compat.h b/include/apr_compat.h index e6d9045f0b3..23a307ae09d 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -62,8 +62,6 @@ #define ap_destroy_pool apr_pool_destroy /** @deprecated @see apr_time_exp_t */ #define ap_exploded_time_t apr_time_exp_t -/** @deprecated @see apr_time_exp_t */ -#define apr_exploded_time_t apr_time_exp_t /** @deprecated @see apr_fnmatch */ #define ap_fnmatch apr_fnmatch /** @deprecated @see apr_getopt */ From 882b6e2e610213c40caa7c288d3f3a2f7e312e2e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 16 Mar 2002 18:36:13 +0000 Subject: [PATCH 3134/7878] The apr_get_os_proc accessor is no longer supported [better or worse]. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63141 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/proc.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index a9f8a4fa875..4ae5e73e9e6 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -611,17 +611,6 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, -APR_DECLARE(apr_status_t) apr_get_os_proc(apr_os_proc_t *theproc, apr_proc_t *proc) -{ - if (proc == NULL) { - return APR_ENOPROC; - } - *theproc = proc->pid; - return APR_SUCCESS; -} - - - APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) { return APR_ENOTIMPL; From 81c4fdc32d76648f7219820abc6d37800b033213 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 16 Mar 2002 18:42:00 +0000 Subject: [PATCH 3135/7878] Back out some over-engineering. We use pid_t throughout - and this 'well known identifier' is entirely distict from an apr_os_proc_t [on some, they are equivialant, on Win32, os_proc_t is a proc handle.] Simplify s/APR_OS_PROC_T_FMT/APR_PID_T_FMT/, apr_os_foo types should never be represented as display entities. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63142 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 12 ++++++------ include/apr.h.in | 4 ++-- include/apr.hnw | 2 +- include/apr.hw | 3 ++- test/testfmt.c | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/configure.in b/configure.in index e4e038f346b..40a6cef1368 100644 --- a/configure.in +++ b/configure.in @@ -1044,13 +1044,13 @@ fi APR_CHECK_SIZEOF_EXTENDED([#include ], pid_t, 8) if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_int"; then - os_proc_t_fmt='#define APR_OS_PROC_T_FMT "d"' + pid_t_fmt='#define APR_PID_T_FMT "d"' elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long"; then - os_proc_t_fmt='#define APR_OS_PROC_T_FMT "ld"' + pid_t_fmt='#define APR_PID_T_FMT "ld"' elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long_long"; then - os_proc_t_fmt='#define APR_OS_PROC_T_FMT "qd"' + pid_t_fmt='#define APR_PID_T_FMT "qd"' else - os_proc_t_fmt='#error Can not determine the proper size for pid_t' + pid_t_fmt='#error Can not determine the proper size for pid_t' fi # Basically, we have tried to figure out the correct format strings @@ -1067,7 +1067,7 @@ case $host in ;; *-solaris*) off_t_fmt='#define APR_OFF_T_FMT "ld"' - os_proc_t_fmt='#define APR_OS_PROC_T_FMT "ld"' + pid_t_fmt='#define APR_PID_T_FMT "ld"' ;; *aix4*|*aix5*) ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' @@ -1096,7 +1096,7 @@ AC_SUBST(int64_t_fmt) AC_SUBST(ssize_t_fmt) AC_SUBST(size_t_fmt) AC_SUBST(off_t_fmt) -AC_SUBST(os_proc_t_fmt) +AC_SUBST(pid_t_fmt) AC_SUBST(int64_literal) AC_SUBST(stdint) diff --git a/include/apr.h.in b/include/apr.h.in index 303988d5487..1f60001040d 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -249,8 +249,8 @@ typedef @socklen_t_value@ apr_socklen_t; /* And APR_OFF_T_FMT */ @off_t_fmt@ -/* And APR_OS_PROC_T_FMT */ -@os_proc_t_fmt@ +/* And APR_PID_T_FMT */ +@pid_t_fmt@ /* And APR_INT64_T_FMT */ @int64_t_fmt@ diff --git a/include/apr.hnw b/include/apr.hnw index f7cab828946..1b552f0c8d1 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -307,7 +307,7 @@ typedef unsigned short nuint16; #define APR_OFF_T_FMT "ld" -#define APR_OS_PROC_T_FMT "d" +#define APR_PID_T_FMT "d" /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" diff --git a/include/apr.hw b/include/apr.hw index 551f23fc11f..d4ca73b7122 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -403,7 +403,8 @@ typedef struct apr_lock_t apr_lock_t; #define APR_OFF_T_FMT "I64d" -#define APR_OS_PROC_T_FMT "d" +/* XXX: Win64 portability problem? */ +#define APR_PID_T_FMT "d" #define APR_INT64_T_FMT "I64d" diff --git a/test/testfmt.c b/test/testfmt.c index 15e06b8214d..ad794c17bef 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -77,8 +77,8 @@ int main(int argc, char *argv[]) } { - apr_os_proc_t var = 0; - sprintf(buf, "%" APR_OS_PROC_T_FMT, var); + pid_t var = 0; + sprintf(buf, "%" APR_PID_T_FMT, var); } { From a4b58c98bd038d47b2babe9e442d8281d5d47be4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 16 Mar 2002 19:07:38 +0000 Subject: [PATCH 3136/7878] If I had the energy, I'd change the Win32 apr_proc_t type to use this correct definition. I don't, so I'm not [try including apr_portable.h in apr_threadproc.h and discover for yourself.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63143 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 7121a3009ed..6e661192426 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -103,7 +103,7 @@ typedef SOCKET apr_os_sock_t; typedef HANDLE apr_os_lock_t; typedef HANDLE apr_os_proc_mutex_t; typedef HANDLE apr_os_thread_t; -typedef PROCESS_INFORMATION apr_os_proc_t; +typedef HANDLE apr_os_proc_t; typedef DWORD apr_os_threadkey_t; typedef FILETIME apr_os_imp_time_t; typedef SYSTEMTIME apr_os_exp_time_t; From 0101a5f8d0b7d0b2aced04d8cf308541a828a6ba Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 17 Mar 2002 03:02:32 +0000 Subject: [PATCH 3137/7878] Style cleanups only git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63144 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 22e3f79a64c..4173dcaa428 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -235,25 +235,24 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* Parse each segment, find the closing '/' */ seglen = 0; - while (addpath[seglen] && addpath[seglen] != '/') + while (addpath[seglen] && addpath[seglen] != '/') { ++seglen; + } - if (seglen == 0 || (seglen == 1 && addpath[0] == '.')) - { + if (seglen == 0 || (seglen == 1 && addpath[0] == '.')) { /* noop segment (/ or ./) so skip it */ } - else if (seglen == 2 && addpath[0] == '.' && addpath[1] == '.') - { + else if (seglen == 2 && addpath[0] == '.' && addpath[1] == '.') { /* backpath (../) */ - if (pathlen == 1 && path[0] == '/') - { + if (pathlen == 1 && path[0] == '/') { /* Attempt to move above root. Always die if the * APR_FILEPATH_SECUREROOTTEST flag is specified. */ - if (flags & APR_FILEPATH_SECUREROOTTEST) + if (flags & APR_FILEPATH_SECUREROOTTEST) { return APR_EABOVEROOT; - + } + /* Otherwise this is simply a noop, above root is root. * Flag that rootpath was entirely replaced. */ @@ -261,18 +260,19 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } else if (pathlen == 0 || (pathlen == 3 && !memcmp(path + pathlen - 3, "../", 3)) - || (pathlen > 3 && !memcmp(path + pathlen - 4, "/../", 4))) - { + || (pathlen > 3 && !memcmp(path + pathlen - 4, "/../", 4))) { /* Path is already backpathed or empty, if the * APR_FILEPATH_SECUREROOTTEST.was given die now. */ - if (flags & APR_FILEPATH_SECUREROOTTEST) + if (flags & APR_FILEPATH_SECUREROOTTEST) { return APR_EABOVEROOT; + } /* Otherwise append another backpath. */ - if (pathlen + 3 >= maxlen ) + if (pathlen + 3 >= maxlen ) { return APR_ENAMETOOLONG; + } memcpy(path + pathlen, "../", 3); pathlen += 3; } @@ -290,8 +290,9 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, */ if (pathlen < keptlen) { - if (flags & APR_FILEPATH_SECUREROOTTEST) + if (flags & APR_FILEPATH_SECUREROOTTEST) { return APR_EABOVEROOT; + } keptlen = pathlen; } } @@ -300,16 +301,18 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* An actual segment, append it to the destination path */ apr_size_t i = (addpath[seglen] != '\0'); - if (pathlen + seglen + i >= maxlen) + if (pathlen + seglen + i >= maxlen) { return APR_ENAMETOOLONG; + } memcpy(path + pathlen, addpath, seglen + i); pathlen += seglen + i; } /* Skip over trailing slash to the next segment */ - if (addpath[seglen]) + if (addpath[seglen]) { ++seglen; + } addpath += seglen; } @@ -322,11 +325,13 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * still within given root path. */ if ((flags & APR_FILEPATH_NOTABOVEROOT) && keptlen < rootlen) { - if (strncmp(rootpath, path, rootlen)) + if (strncmp(rootpath, path, rootlen)) { return APR_EABOVEROOT; + } if (rootpath[rootlen - 1] != '/' - && path[rootlen] && path[rootlen] != '/') + && path[rootlen] && path[rootlen] != '/') { return APR_EABOVEROOT; + } } *newpath = path; From 36687305af08f5b7550bc9f285ef486c10231da7 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 17 Mar 2002 03:24:15 +0000 Subject: [PATCH 3138/7878] Performance improvement for apr_filepath_merge() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63145 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 4173dcaa428..d84c4769432 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -234,10 +234,11 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, { /* Parse each segment, find the closing '/' */ - seglen = 0; - while (addpath[seglen] && addpath[seglen] != '/') { - ++seglen; + const char *next = addpath; + while (*next && (*next != '/')) { + ++next; } + seglen = next - addpath; if (seglen == 0 || (seglen == 1 && addpath[0] == '.')) { /* noop segment (/ or ./) so skip it @@ -300,21 +301,23 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, { /* An actual segment, append it to the destination path */ - apr_size_t i = (addpath[seglen] != '\0'); - if (pathlen + seglen + i >= maxlen) { + if (*next) { + seglen++; + } + if (pathlen + seglen >= maxlen) { return APR_ENAMETOOLONG; } - memcpy(path + pathlen, addpath, seglen + i); - pathlen += seglen + i; + memcpy(path + pathlen, addpath, seglen); + pathlen += seglen; } /* Skip over trailing slash to the next segment */ - if (addpath[seglen]) { - ++seglen; + if (*next) { + ++next; } - addpath += seglen; + addpath = next; } path[pathlen] = '\0'; From d21a12a83c98f60fe39b2596e442bd49817a598f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 17 Mar 2002 13:21:26 +0000 Subject: [PATCH 3139/7878] update an old comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63146 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_global_mutex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index 9f7e5533190..f80dbe8c146 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -56,7 +56,7 @@ #define APR_GLOBAL_MUTEX_H #include "apr.h" -#include "apr_lock.h" /* only for apr_lockmech_e_np */ +#include "apr_lock.h" /* only for apr_lockmech_e */ #include "apr_pools.h" #include "apr_errno.h" From 307e3410f38f57a6b06960390c86e9eccb731c93 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 17 Mar 2002 22:38:25 +0000 Subject: [PATCH 3140/7878] Rename apr_implode_time to apr_time_exp_get. Submitted by: Thom May git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63147 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 2 +- renames_pending | 1 - test/testtime.c | 6 +++--- time/unix/time.c | 4 ++-- time/win32/time.c | 4 ++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/apr_time.h b/include/apr_time.h index 38145daad1c..ef4901557dc 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -175,7 +175,7 @@ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, * @param result the resulting imploded time * @param input the input exploded time */ -APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *result, +APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *result, apr_time_exp_t *input); /** diff --git a/renames_pending b/renames_pending index 39f96d14087..66b70daed8a 100644 --- a/renames_pending +++ b/renames_pending @@ -1,6 +1,5 @@ Symbol renames for APR -apr_time_exp_get from apr_implode_time apr_time_exp_gmt from apr_explode_gmt apr_time_exp_lt from apr_explode_localtime apr_time_exp_tz from apr_explode_time diff --git a/test/testtime.c b/test/testtime.c index 3869ff4f063..784f7c40345 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -87,7 +87,7 @@ int main(void) STD_TEST_NEQ(" apr_explode_localtime", apr_explode_localtime(&xt2, now)) - STD_TEST_NEQ(" apr_implode_time (GMT)", apr_implode_time(&imp, &xt)) + STD_TEST_NEQ(" apr_time_exp_get (GMT)", apr_time_exp_get(&imp, &xt)) printf("%-60s", " checking GMT explode == implode"); if (imp != now) { @@ -166,8 +166,8 @@ int main(void) strcmp(str, str2), 0, "OK", "Failed") printf(" ( %s != %s )\n", str, str2); - STD_TEST_NEQ(" apr_implode_time (offset)", - apr_implode_time(&imp, &xt2)) + STD_TEST_NEQ(" apr_time_exp_get (offset)", + apr_time_exp_get(&imp, &xt2)) hr_off_64 = (apr_int64_t) hr_off * APR_USEC_PER_SEC; /* microseconds */ printf("%-60s"," Checking offset is correct"); diff --git a/time/unix/time.c b/time/unix/time.c index e6ef85b9fda..c12ecb93569 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -170,7 +170,7 @@ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, apr_time #endif /* __EMX__ */ } -APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, apr_time_exp_t *xt) +APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt) { int year; time_t days; @@ -203,7 +203,7 @@ APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, apr_time_exp_t *xt) APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, apr_time_exp_t *xt) { - apr_status_t status = apr_implode_time(t, xt); + apr_status_t status = apr_time_exp_get(t, xt); if (status == APR_SUCCESS) *t -= (apr_time_t) xt->tm_gmtoff * APR_USEC_PER_SEC; return status; diff --git a/time/win32/time.c b/time/win32/time.c index 98cfffd8a3a..2286281150b 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -185,7 +185,7 @@ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, +APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt) { int year; @@ -223,7 +223,7 @@ APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t, APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, apr_time_exp_t *xt) { - apr_status_t status = apr_implode_time(t, xt); + apr_status_t status = apr_time_exp_get(t, xt); if (status == APR_SUCCESS) *t -= (apr_time_t) xt->tm_gmtoff * APR_USEC_PER_SEC; return status; From d20a19f4c27c499bb00643940531342f561c052f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 17 Mar 2002 23:16:46 +0000 Subject: [PATCH 3141/7878] For CommandLineFromArgvW() if WinNT is defined. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63148 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/start.c | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/win32/start.c b/misc/win32/start.c index 0cf13abb2a6..36fc7ac6c5f 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -56,6 +56,7 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_signal.h" +#include "ShellAPI.h" #include "misc.h" /* for WSAHighByte / WSALowByte */ #include "wchar.h" From edaeed83dcd790f8050ec02b27e710b42d673a8e Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 18 Mar 2002 15:01:42 +0000 Subject: [PATCH 3142/7878] Style Police patrols in the backyard... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63149 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 56 ++++++++++++++++++++--------------------- memory/unix/apr_pools.c | 40 ++++++++++++++++------------- 2 files changed, 50 insertions(+), 46 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 630fd364f87..8fc0ff71e8d 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -73,13 +73,13 @@ extern "C" { * Instead, we maintain pools, and allocate items (both memory and I/O * handlers) from the pools --- currently there are two, one for per * transaction info, and one for config info. When a transaction is over, - * we can delete everything in the per-transaction apr_pool_t without fear, + * we can delete everything in the per-transaction apr_pool_t without fear, * and without thinking too hard about it either. */ -/** +/** * @defgroup APR_Pool Pool Allocation Functions * @ingroup APR - * @{ + * @{ */ #include "apr.h" #include "apr_errno.h" @@ -153,7 +153,7 @@ typedef int (*apr_abortfunc_t)(int retcode); /** * Setup all of the internal structures required to use pools * @remark Programs do NOT need to call this directly. APR will call this - * automatically from apr_initialize. + * automatically from apr_initialize. * @internal */ APR_DECLARE(apr_status_t) apr_pool_initialize(void); @@ -161,10 +161,10 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void); /** * Tear down all of the internal structures required to use pools * @remark Programs do NOT need to call this directly. APR will call this - * automatically from apr_terminate. + * automatically from apr_terminate. * @internal */ -APR_DECLARE(void) apr_pool_terminate(void); +APR_DECLARE(void) apr_pool_terminate(void); /* @@ -176,7 +176,7 @@ APR_DECLARE(void) apr_pool_terminate(void); * @param newpool The pool we have just created. * @param parent The parent pool. If this is NULL, the new pool is a root * pool. If it is non-NULL, the new pool will inherit all - * of its parent pool's attributes, except the apr_pool_t will + * of its parent pool's attributes, except the apr_pool_t will * be a sub-pool. * @param apr_abort A function to use if the pool cannot allocate more memory. * @param flags Flags indicating how the pool should be created: @@ -224,7 +224,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, * @param newpool The pool we have just created. * @param parent The parent pool. If this is NULL, the new pool is a root * pool. If it is non-NULL, the new pool will inherit all - * of its parent pool's attributes, except the apr_pool_t will + * of its parent pool's attributes, except the apr_pool_t will * be a sub-pool. */ #if defined(DOXYGEN) @@ -263,8 +263,8 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, * Clear all memory in the pool and run all the cleanups. This also destroys all * subpools. * @param p The pool to clear - * @remark This does not actually free the memory, it just allows the pool - * to re-use this memory for the next allocation. + * @remark This does not actually free the memory, it just allows the pool + * to re-use this memory for the next allocation. * @see apr_pool_destroy() */ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); @@ -326,19 +326,19 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, /** * Allocate a block of memory from a pool - * @param p The pool to allocate from - * @param size The amount of memory to allocate + * @param p The pool to allocate from + * @param size The amount of memory to allocate * @return The allocated memory */ APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size); /** * Debug version of apr_palloc - * @param p See: apr_palloc - * @param size See: apr_palloc + * @param p See: apr_palloc + * @param size See: apr_palloc * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. - * @return See: apr_palloc + * @return See: apr_palloc */ APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size, const char *file_line); @@ -347,22 +347,22 @@ APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size, #define apr_palloc(p, size) \ apr_palloc_debug(p, size, APR_POOL__FILE_LINE__) #endif - + /** * Allocate a block of memory from a pool and set all of the memory to 0 - * @param p The pool to allocate from - * @param size The amount of memory to allocate + * @param p The pool to allocate from + * @param size The amount of memory to allocate * @return The allocated memory */ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); /** * Debug version of apr_pcalloc - * @param p See: apr_pcalloc - * @param size See: apr_pcalloc + * @param p See: apr_pcalloc + * @param size See: apr_pcalloc * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. - * @return See: apr_pcalloc + * @return See: apr_pcalloc */ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size, const char *file_line); @@ -404,7 +404,7 @@ APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool); /** * Determine if pool a is an ancestor of pool b - * @param a The pool to search + * @param a The pool to search * @param b The pool to search for * @return True if a is an ancestor of b, NULL is considered an ancestor * of all pools. @@ -480,9 +480,9 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, /** * Register a function to be called when a pool is cleared or destroyed - * @param p The pool register the cleanup with + * @param p The pool register the cleanup with * @param data The data to pass to the cleanup function. - * @param plain_cleanup The function to call when the pool is cleared + * @param plain_cleanup The function to call when the pool is cleared * or destroyed * @param child_cleanup The function to call when a child process is created - * this function is called in the child, obviously! @@ -495,7 +495,7 @@ APR_DECLARE(void) apr_pool_cleanup_register( /** * Remove a previously registered cleanup function - * @param p The pool remove the cleanup from + * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup * @remarks For some strange reason only the plain_cleanup is handled by this @@ -520,7 +520,7 @@ APR_DECLARE(void) apr_pool_child_cleanup_set( /** * Run the specified cleanup function immediately and unregister it. Use * @a data instead of the data that was registered with the cleanup. - * @param p The pool remove the cleanup from + * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup */ @@ -530,7 +530,7 @@ APR_DECLARE(apr_status_t) apr_pool_cleanup_run( apr_status_t (*cleanup)(void *)); /** - * An empty cleanup function + * An empty cleanup function * @param data The data to cleanup */ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); @@ -539,7 +539,7 @@ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); * buffers, *don't* wait for subprocesses, and *don't* free any memory. */ /** - * Run all of the child_cleanups, so that any unnecessary files are + * Run all of the child_cleanups, so that any unnecessary files are * closed because we are about to exec a new program */ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 8c681a1199a..63b320d0e90 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -309,7 +309,8 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, } APR_INLINE -APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) +APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, + apr_memnode_t *node) { apr_memnode_t *next; apr_uint32_t index, max_index; @@ -332,8 +333,9 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, apr_memnode_t * /* Add the node to the appropiate 'size' bucket. Adjust * the max_index when appropiate. */ - if ((node->next = allocator->free[index]) == NULL && index > max_index) { - max_index = index; + if ((node->next = allocator->free[index]) == NULL + && index > max_index) { + max_index = index; } allocator->free[index] = node; } @@ -344,8 +346,7 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, apr_memnode_t * node->next = allocator->free[0]; allocator->free[0] = node; } - } - while ((node = next) != NULL); + } while ((node = next) != NULL); allocator->max_index = max_index; @@ -708,7 +709,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, if (allocator == NULL) allocator = parent->allocator; - if ((node = apr_allocator_alloc(allocator, MIN_ALLOC - SIZEOF_MEMNODE_T)) == NULL) { + if ((node = apr_allocator_alloc(allocator, + MIN_ALLOC - SIZEOF_MEMNODE_T)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -1432,8 +1434,8 @@ static int pool_find(apr_pool_t *pool, void *data) while (node) { for (index = 0; index < node->index; index++) { - if (node->beginp[index] <= *pmem && - node->endp[index] > *pmem) { + if (node->beginp[index] <= *pmem + && node->endp[index] > *pmem) { *pmem = pool; return 1; } @@ -1584,9 +1586,10 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *ke return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, + const char *key, + apr_status_t (*cleanup)(void *), + apr_pool_t *pool) { #if APR_POOL_DEBUG apr_pool_check_integrity(pool); @@ -1603,7 +1606,8 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, const char *k return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, + apr_pool_t *pool) { #if APR_POOL_DEBUG apr_pool_check_integrity(pool); @@ -1650,7 +1654,7 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, } APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup_fn)(void *)) + apr_status_t (*cleanup_fn)(void *)) { cleanup_t *c, **lastp; @@ -1675,8 +1679,8 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, } APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup_fn) (void *), - apr_status_t (*child_cleanup_fn) (void *)) + apr_status_t (*plain_cleanup_fn)(void *), + apr_status_t (*child_cleanup_fn)(void *)) { cleanup_t *c; @@ -1699,7 +1703,7 @@ APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, } APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, - apr_status_t (*cleanup_fn) (void *)) + apr_status_t (*cleanup_fn)(void *)) { apr_pool_cleanup_kill(p, data, cleanup_fn); return (*cleanup_fn)(data); @@ -1798,8 +1802,8 @@ static void free_proc_chain(struct process_chain *procs) #endif /* !defined(NEED_WAITPID) */ for (pc = procs; pc; pc = pc->next) { - if ((pc->kill_how == APR_KILL_AFTER_TIMEOUT) || - (pc->kill_how == APR_KILL_ONLY_ONCE)) { + if ((pc->kill_how == APR_KILL_AFTER_TIMEOUT) + || (pc->kill_how == APR_KILL_ONLY_ONCE)) { /* * Subprocess may be dead already. Only need the timeout if not. * Note: apr_proc_kill on Windows is TerminateProcess(), which is From 28ed27d4fd6b51b69eb879b39290340c9b465a32 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 18 Mar 2002 15:04:18 +0000 Subject: [PATCH 3143/7878] Update the doxygen docs to reflect the recent API change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63150 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 8fc0ff71e8d..ed3b81eb39b 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -179,12 +179,8 @@ APR_DECLARE(void) apr_pool_terminate(void); * of its parent pool's attributes, except the apr_pool_t will * be a sub-pool. * @param apr_abort A function to use if the pool cannot allocate more memory. - * @param flags Flags indicating how the pool should be created: - * - POOL_FNEW_ALLOCATOR will create a new allocator for the pool - * instead of using the allocator of the parent. - * - POOL_FLOCK will create a mutex for the newly created allocator - * (this flag only makes sense in combination with POOL_FNEW_ALLOCATOR) - * + * @param allocator The allocator to use with the new pool. If NULL the + * allocator of the parent pool will be used. */ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *parent, @@ -196,7 +192,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, * @param newpool See: apr_pool_create. * @param parent See: apr_pool_create. * @param abort_fn See: apr_pool_create. - * @param flags See: apr_pool_create. + * @param allocator See: apr_pool_create. * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. From 6ef898f8abdbd35d1e10324b3bfeaeb714c6a5a7 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 18 Mar 2002 15:42:56 +0000 Subject: [PATCH 3144/7878] Fix win32 compile breakage in apr_atomic_t git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63151 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 299829be75f..48e027d29a6 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -142,7 +142,7 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #elif defined(WIN32) -#define apr_atomic_t LONG; +#define apr_atomic_t LONG #define apr_atomic_add(mem, val) InterlockedExchangeAdd(mem,val) #define apr_atomic_dec(mem) InterlockedDecrement(mem) From b02e4eaf77c84a53a71381906c1620bda84af457 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 18 Mar 2002 16:24:54 +0000 Subject: [PATCH 3145/7878] fix the doxygenization of these 2 files PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63152 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 10 +++++++++- include/apr_pools.h | 19 +++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index eb9eabc7be2..934c7c8b22c 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -64,6 +64,12 @@ extern "C" { * @brief APR memory allocation * */ +/** + * @defgroup APR_Pool_allocator Allocator + * @ingroup APR_Pool + * @{ + */ + #include "apr.h" #include "apr_errno.h" @@ -74,7 +80,9 @@ extern "C" { #include "apr_pools.h" +/** the allocator structure */ typedef struct apr_allocator_t apr_allocator_t; +/** the structure which holds information about the allocation */ typedef struct apr_memnode_t apr_memnode_t; /** @@ -152,7 +160,7 @@ APR_DECLARE(apr_thread_mutex_t *) apr_allocator_get_mutex( apr_allocator_t *allocator); #endif /* APR_HAS_THREADS */ - +/** @} */ #ifdef __cplusplus } #endif diff --git a/include/apr_pools.h b/include/apr_pools.h index ed3b81eb39b..ad6d4c12ae7 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -77,7 +77,7 @@ extern "C" { * and without thinking too hard about it either. */ /** - * @defgroup APR_Pool Pool Allocation Functions + * @defgroup APR_Pool Memory Pool Functions * @ingroup APR * @{ */ @@ -133,8 +133,11 @@ typedef struct apr_pool_t apr_pool_t; #define APR_POOL_DEBUG 0 #endif +/** String to number */ #define APR_POOL_STRINGIZE(x) APR_POOL__STRINGIZE(x) +/** String to number */ #define APR_POOL__STRINGIZE(x) #x +/** the place in the code where the particular function was called */ #define APR_POOL__FILE_LINE__ __FILE__ ":" APR_POOL_STRINGIZE(__LINE__) @@ -189,10 +192,10 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, /** * Debug version of apr_pool_create_ex. - * @param newpool See: apr_pool_create. - * @param parent See: apr_pool_create. - * @param abort_fn See: apr_pool_create. - * @param allocator See: apr_pool_create. + * @param newpool @see apr_pool_create. + * @param parent @see apr_pool_create. + * @param abort_fn @see apr_pool_create. + * @param allocator @see apr_pool_create. * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. @@ -632,7 +635,7 @@ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); #endif /* APR_POOL_DEBUG or DOXYGEN */ -/* +/** * Pool accessor functions. * * These standardized function are used by opaque (APR) data types to return @@ -653,12 +656,16 @@ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); * Note: the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ + #define APR_POOL_DECLARE_ACCESSOR(typename) \ APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ (const apr_##typename##_t *ob) +/** used to implement the pool accessor */ #define APR_POOL_IMPLEMENT_ACCESSOR(typename) \ APR_POOL_IMPLEMENT_ACCESSOR_X(typename, pool) + +/** used to implement the pool accessor */ #define APR_POOL_IMPLEMENT_ACCESSOR_X(typename, fieldname) \ APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ (const apr_##typename##_t *ob) { return ob->fieldname; } From 5a0f2620a1a3d63d9e6371a7512aa78422d8d828 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 18 Mar 2002 16:46:41 +0000 Subject: [PATCH 3146/7878] small minor fixes to Doxygen PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63153 13f79535-47bb-0310-9956-ffa450edef68 --- docs/doxygen.conf | 1 + include/apr_pools.h | 2 + include/apr_version.h | 111 +++++++++++++++++++++++++----------------- 3 files changed, 69 insertions(+), 45 deletions(-) diff --git a/docs/doxygen.conf b/docs/doxygen.conf index f38d3e3d544..70cff3eb754 100644 --- a/docs/doxygen.conf +++ b/docs/doxygen.conf @@ -14,6 +14,7 @@ EXPAND_ONLY_PREDEF=YES PREDEFINED="APR_DECLARE(x)=x" \ "APR_DECLARE_NONSTD(x)=x" \ "APR_HAS_XLATE" \ + "APR_HAS_THREADS" \ DOXYGEN= OPTIMIZE_OUTPUT_FOR_C=YES diff --git a/include/apr_pools.h b/include/apr_pools.h index ad6d4c12ae7..41806e1f2d8 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -94,6 +94,7 @@ typedef struct apr_pool_t apr_pool_t; /** * Pool debug levels * + *
      * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
      * ---------------------------------
      * |   |   |   |   |   |   |   | x |  General debug code enabled (usefull in
    @@ -123,6 +124,7 @@ typedef struct apr_pool_t apr_pool_t;
      *
      * When no debug level was specified, assume general debug mode.
      * If level 0 was specified, debugging is switched off
    + * 
    */ #if defined(APR_POOL_DEBUG) #if (APR_POOL_DEBUG != 0) && (APR_POOL_DEBUG - 0 == 0) diff --git a/include/apr_version.h b/include/apr_version.h index 78db8f48371..bf85a785c3c 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -61,49 +61,66 @@ extern "C" { #endif -/* - APR's Version - - There are several different mechanisms for accessing the version. There - is a string form, and a set of numbers; in addition, there are constants - which can be compiled into your application, and you can query the library - being used for its actual version. - - Note that it is possible for an application to detect that it has been - compiled against a different version of APR by use of the compile-time - constants and the use of the run-time query function. - - ### we have not defined source/binary compatibility guidelines yet and - ### how those map against these (release) version numbers. a strawman - ### would be the following text: - - APR is binary-compatible (an app compiled against one version does not - need to be recompiled to work against another version) for the same - MAJOR and MINOR versions. - - APR is source-compatible (an app needs to be recompiled, but will work - the same) for the same MAJOR version. - - If the MAJOR version changes, then an application may need source changes. - - Note that APR is defined to be forward compatible only, meaning that a - given application will be compatible with APR releases moving forward in - time. An application may not be compatible with earlier versions of an - APR library (even if the major and minor versions match). This restriction - is because a later version of APR can introduce new APIs. -*/ +/** + * @file apr_version.h + * @brief + * + * APR's Version + * + * There are several different mechanisms for accessing the version. There + * is a string form, and a set of numbers; in addition, there are constants + * which can be compiled into your application, and you can query the library + * being used for its actual version. + * + * Note that it is possible for an application to detect that it has been + * compiled against a different version of APR by use of the compile-time + * constants and the use of the run-time query function. + * + * ### we have not defined source/binary compatibility guidelines yet and + * ### how those map against these (release) version numbers. a strawman + * ### would be the following text: + * + * APR is binary-compatible (an app compiled against one version does not + * need to be recompiled to work against another version) for the same + * MAJOR and MINOR versions. + * + * APR is source-compatible (an app needs to be recompiled, but will work + * the same) for the same MAJOR version. + * + * If the MAJOR version changes, then an application may need source changes. + * + * Note that APR is defined to be forward compatible only, meaning that a + * given application will be compatible with APR releases moving forward in + * time. An application may not be compatible with earlier versions of an + * APR library (even if the major and minor versions match). This restriction + * is because a later version of APR can introduce new APIs. + */ /* The numeric compile-time version constants. These constants are the - authoritative version numbers for APR. */ + * authoritative version numbers for APR. + */ +/** major version + * Major API changes that could cause compatibility problems for older programs + * such as structure size changes. No binary compatibility is possible across + * a change in the major version. + */ #define APR_MAJOR_VERSION 0 +/** + * Minor API changes that do not cause binary compatibility problems. + * Should be reset to 0 when upgrading APR_MAJOR_VERSION + */ #define APR_MINOR_VERSION 9 +/** patch level */ #define APR_PATCH_VERSION 0 -/* This symbol is defined for internal, "development" copies of APR. This - symbol will be #undef'd for releases. */ + +/** + * This symbol is defined for internal, "development" copies of APR. This + * symbol will be #undef'd for releases. + */ #define APR_IS_DEV_VERSION -/* The formatted string of APR's version */ +/** The formatted string of APR's version */ #define APR_VERSION_STRING \ APR_STRINGIFY(APR_MAJOR_VERSION) "." \ APR_STRINGIFY(APR_MINOR_VERSION) "." \ @@ -111,8 +128,10 @@ extern "C" { APR_IS_DEV_STRING -/* The numeric version information is broken out into fields within this - structure. */ +/** + * The numeric version information is broken out into fields within this + * structure. + */ typedef struct { int major; int minor; @@ -120,22 +139,24 @@ typedef struct { int is_dev; } apr_version_t; -/* Return APR's version information information in a numeric form. - - @param pvsn Pointer to a version structure for returning the version - information. -*/ +/** + * Return APR's version information information in a numeric form. + * + * @param pvsn Pointer to a version structure for returning the version + * information. + */ APR_DECLARE(void) apr_version(apr_version_t *pvsn); -/* Return APR's version information as a string. */ +/** Return APR's version information as a string. */ APR_DECLARE(const char *) apr_version_string(void); -/* Internal: helper macros for stringifying the version numbers */ +/** Internal: helper macro for stringifying the version numbers */ #define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) +/** Internal: helper macro for stringifying the version numbers */ #define APR_STRINGIFY_HELPER(n) #n -/* Internal: string form of the "is dev" flag */ +/** Internal: string form of the "is dev" flag */ #ifdef APR_IS_DEV_VERSION #define APR_IS_DEV_STRING "-dev" #else From e5c293c5f91c4224b80d5da84c85e4cdc5d40ad4 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Tue, 19 Mar 2002 01:41:53 +0000 Subject: [PATCH 3147/7878] Add a little note about passing a NULL pool to apr_hash_first(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63154 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index e75cf30b28d..bedd62cc783 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -137,7 +137,8 @@ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, /** * Start iterating over the entries in a hash table. - * @param p The pool to allocate the apr_hash_index_t iterator + * @param p The pool to allocate the apr_hash_index_t iterator. If this + * pool is NULL, then an internal, non-thread-safe iterator is used. * @param ht The hash table * @example */ From 00b273c3ac60841ecccaa05ba4152bee8def6e69 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 19 Mar 2002 08:27:30 +0000 Subject: [PATCH 3148/7878] Don't try to obtain a mutex if it was already destroyed... Submitted by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63155 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 63b320d0e90..f2e0979e071 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -686,6 +686,13 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) * in the allocator, it will have been destroyed by the cleanup function. */ if (apr_allocator_get_owner(allocator) == pool) { +#if APR_HAS_THREADS + /* Make sure to remove the lock, since it is highly likely to + * be invalid now. + */ + apr_allocator_set_mutex(allocator, NULL); +#endif /* APR_HAS_THREADS */ + apr_allocator_destroy(allocator); } } From 80e7016cf3d0e9a5e4f9b80ac9450d8b6db2f71a Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 19 Mar 2002 10:03:45 +0000 Subject: [PATCH 3149/7878] Tag the apr global pool git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63156 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index f2e0979e071..8ef86debc0c 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -494,6 +494,8 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) return rv; } + apr_pool_tag(global_pool, "apr_global_pool"); + #if APR_HAS_THREADS { apr_thread_mutex_t *mutex; From 9bc900f60b724e201acba112f9aa4068e51e20eb Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 19 Mar 2002 15:30:07 +0000 Subject: [PATCH 3150/7878] Fix the fix... apr_allocator_destroy wasn't the one using the invalid lock, it was apr_allocator_free, which was being called a few lines above my previous fix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63157 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 8ef86debc0c..a0b48025def 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -677,6 +677,15 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) allocator = pool->allocator; active = pool->self; +#if APR_HAS_THREADS + if (apr_allocator_get_owner(allocator) == pool) { + /* Make sure to remove the lock, since it is highly likely to + * be invalid now. + */ + apr_allocator_set_mutex(allocator, NULL); + } +#endif /* APR_HAS_THREADS */ + /* Free all the nodes in the pool (including the node holding the * pool struct), by giving them back to the allocator. */ @@ -688,13 +697,6 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) * in the allocator, it will have been destroyed by the cleanup function. */ if (apr_allocator_get_owner(allocator) == pool) { -#if APR_HAS_THREADS - /* Make sure to remove the lock, since it is highly likely to - * be invalid now. - */ - apr_allocator_set_mutex(allocator, NULL); -#endif /* APR_HAS_THREADS */ - apr_allocator_destroy(allocator); } } From 2d788bc41c902b2bb2dc0255b8e9141c43f9b4c1 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 19 Mar 2002 17:54:00 +0000 Subject: [PATCH 3151/7878] Rename all the "cntxt" members of the thread and proc structures to "pool". git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63158 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/beos/threadproc.h | 8 ++--- include/arch/netware/threadproc.h | 10 +++--- include/arch/os2/threadproc.h | 6 ++-- include/arch/unix/threadproc.h | 8 ++--- include/arch/win32/threadproc.h | 8 ++--- threadproc/beos/proc.c | 40 +++++++++++------------ threadproc/beos/thread.c | 26 +++++++-------- threadproc/beos/threadpriv.c | 18 +++++------ threadproc/netware/proc.c | 38 +++++++++++----------- threadproc/netware/thread.c | 32 +++++++++--------- threadproc/netware/threadpriv.c | 18 +++++------ threadproc/os2/proc.c | 54 +++++++++++++++---------------- threadproc/os2/thread.c | 28 ++++++++-------- threadproc/os2/threadpriv.c | 18 +++++------ threadproc/unix/proc.c | 38 +++++++++++----------- threadproc/unix/thread.c | 34 +++++++++---------- threadproc/unix/threadpriv.c | 18 +++++------ threadproc/win32/proc.c | 52 ++++++++++++++--------------- threadproc/win32/thread.c | 30 ++++++++--------- threadproc/win32/threadpriv.c | 18 +++++------ 20 files changed, 251 insertions(+), 251 deletions(-) diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h index 63cec9fb7b1..759fc54c7aa 100644 --- a/include/arch/beos/threadproc.h +++ b/include/arch/beos/threadproc.h @@ -78,7 +78,7 @@ #define BEOS_MAX_DATAKEYS 128 struct apr_thread_t { - apr_pool_t *cntxt; + apr_pool_t *pool; thread_id td; void *data; apr_thread_start_t func; @@ -86,14 +86,14 @@ struct apr_thread_t { }; struct apr_threadattr_t { - apr_pool_t *cntxt; + apr_pool_t *pool; int32 attr; int detached; int joinable; }; struct apr_threadkey_t { - apr_pool_t *cntxt; + apr_pool_t *pool; int32 key; }; @@ -112,7 +112,7 @@ struct beos_key { }; struct apr_procattr_t { - apr_pool_t *cntxt; + apr_pool_t *pool; apr_file_t *parent_in; apr_file_t *child_in; apr_file_t *parent_out; diff --git a/include/arch/netware/threadproc.h b/include/arch/netware/threadproc.h index 5783e40ec14..9323ae5bd5d 100644 --- a/include/arch/netware/threadproc.h +++ b/include/arch/netware/threadproc.h @@ -64,7 +64,7 @@ #define APR_DEFAULT_STACK_SIZE 65536 struct apr_thread_t { - apr_pool_t *cntxt; + apr_pool_t *pool; NXContext_t ctx; NXThreadId_t td; char *thread_name; @@ -76,19 +76,19 @@ struct apr_thread_t { }; struct apr_threadattr_t { - apr_pool_t *cntxt; + apr_pool_t *pool; size_t stack_size; apr_int32_t detach; char *thread_name; }; struct apr_threadkey_t { - apr_pool_t *cntxt; + apr_pool_t *pool; NXKey_t key; }; struct apr_procattr_t { - apr_pool_t *cntxt; + apr_pool_t *pool; apr_file_t *parent_in; apr_file_t *child_in; apr_file_t *parent_out; @@ -101,7 +101,7 @@ struct apr_procattr_t { }; //struct apr_proc_t { -// apr_pool_t *cntxt; +// apr_pool_t *pool; // pid_t pid; // apr_procattr_t *attr; //}; diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/threadproc.h index 8419f2d6fa8..12db303b055 100644 --- a/include/arch/os2/threadproc.h +++ b/include/arch/os2/threadproc.h @@ -64,12 +64,12 @@ #define APR_THREAD_STACKSIZE 65536 struct apr_threadattr_t { - apr_pool_t *cntxt; + apr_pool_t *pool; unsigned long attr; }; struct apr_thread_t { - apr_pool_t *cntxt; + apr_pool_t *pool; struct apr_threadattr_t *attr; unsigned long tid; apr_thread_start_t func; @@ -83,7 +83,7 @@ struct apr_threadkey_t { }; struct apr_procattr_t { - apr_pool_t *cntxt; + apr_pool_t *pool; apr_file_t *parent_in; apr_file_t *child_in; apr_file_t *parent_out; diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index 69f260bd6ef..c93c1909b69 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -88,7 +88,7 @@ #if APR_HAS_THREADS struct apr_thread_t { - apr_pool_t *cntxt; + apr_pool_t *pool; pthread_t *td; void *data; apr_thread_start_t func; @@ -96,12 +96,12 @@ struct apr_thread_t { }; struct apr_threadattr_t { - apr_pool_t *cntxt; + apr_pool_t *pool; pthread_attr_t *attr; }; struct apr_threadkey_t { - apr_pool_t *cntxt; + apr_pool_t *pool; pthread_key_t key; }; @@ -112,7 +112,7 @@ struct apr_thread_once_t { #endif struct apr_procattr_t { - apr_pool_t *cntxt; + apr_pool_t *pool; apr_file_t *parent_in; apr_file_t *child_in; apr_file_t *parent_out; diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/threadproc.h index f18b73b6041..23c795a19f6 100644 --- a/include/arch/win32/threadproc.h +++ b/include/arch/win32/threadproc.h @@ -62,7 +62,7 @@ #define SHELL_PATH "cmd.exe" struct apr_thread_t { - apr_pool_t *cntxt; + apr_pool_t *pool; HANDLE td; apr_int32_t cancel; apr_int32_t cancel_how; @@ -72,17 +72,17 @@ struct apr_thread_t { }; struct apr_threadattr_t { - apr_pool_t *cntxt; + apr_pool_t *pool; apr_int32_t detach; }; struct apr_threadkey_t { - apr_pool_t *cntxt; + apr_pool_t *pool; DWORD key; }; struct apr_procattr_t { - apr_pool_t *cntxt; + apr_pool_t *pool; apr_file_t *parent_in; apr_file_t *child_in; apr_file_t *parent_out; diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index a34470a42d2..80d554892a5 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -61,15 +61,15 @@ struct send_pipe { int err; }; -APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *pool) { - (*new) = (apr_procattr_t *)apr_palloc(cont, + (*new) = (apr_procattr_t *)apr_palloc(pool, sizeof(apr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; + (*new)->pool = pool; (*new)->parent_in = NULL; (*new)->child_in = NULL; (*new)->parent_out = NULL; @@ -88,7 +88,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t apr_status_t status; if (in != 0) { if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, - attr->cntxt)) != APR_SUCCESS) { + attr->pool)) != APR_SUCCESS) { return status; } switch (in) { @@ -108,7 +108,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t } if (out) { if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, - attr->cntxt)) != APR_SUCCESS) { + attr->pool)) != APR_SUCCESS) { return status; } switch (out) { @@ -128,7 +128,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t } if (err) { if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, - attr->cntxt)) != APR_SUCCESS) { + attr->pool)) != APR_SUCCESS) { return status; } switch (err) { @@ -158,10 +158,10 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, getcwd(cwd, PATH_MAX); strncat(cwd,"/\0",2); strcat(cwd,dir); - attr->currdir = (char *)apr_pstrdup(attr->cntxt, cwd); + attr->currdir = (char *)apr_pstrdup(attr->pool, cwd); free(cwd); } else { - attr->currdir = (char *)apr_pstrdup(attr->cntxt, dir); + attr->currdir = (char *)apr_pstrdup(attr->pool, dir); } if (attr->currdir) { return APR_SUCCESS; @@ -182,7 +182,7 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int3 return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) { int pid; @@ -207,7 +207,7 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, const char * const *env, - apr_procattr_t *attr, apr_pool_t *cont) + apr_procattr_t *attr, apr_pool_t *pool) { int i=0,nargs=0; char **newargs = NULL; @@ -215,7 +215,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, struct send_pipe *sp; char * dir = NULL; - sp = (struct send_pipe *)apr_palloc(cont, sizeof(struct send_pipe)); + sp = (struct send_pipe *)apr_palloc(pool, sizeof(struct send_pipe)); new->in = attr->parent_in; new->err = attr->parent_err; @@ -343,13 +343,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_fi apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); if (child_in != NULL) - apr_file_dup(&attr->child_in, child_in, attr->cntxt); + apr_file_dup(&attr->child_in, child_in, attr->pool); if (parent_in != NULL) - apr_file_dup(&attr->parent_in, parent_in, attr->cntxt); + apr_file_dup(&attr->parent_in, parent_in, attr->pool); return APR_SUCCESS; } @@ -358,13 +358,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_f apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); if (child_out != NULL) - apr_file_dup(&attr->child_out, child_out, attr->cntxt); + apr_file_dup(&attr->child_out, child_out, attr->pool); if (parent_out != NULL) - apr_file_dup(&attr->parent_out, parent_out, attr->cntxt); + apr_file_dup(&attr->parent_out, parent_out, attr->pool); return APR_SUCCESS; } @@ -373,13 +373,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); if (child_err != NULL) - apr_file_dup(&attr->child_err, child_err, attr->cntxt); + apr_file_dup(&attr->child_err, child_err, attr->pool); if (parent_err != NULL) - apr_file_dup(&attr->parent_err, parent_err, attr->cntxt); + apr_file_dup(&attr->parent_err, parent_err, attr->pool); return APR_SUCCESS; } diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 5b6fb4c7214..12a83a29687 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -55,16 +55,16 @@ #include "threadproc.h" #include "apr_portable.h" -APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *pool) { - (*new) = (apr_threadattr_t *)apr_palloc(cont, + (*new) = (apr_threadattr_t *)apr_palloc(pool, sizeof(apr_threadattr_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; + (*new)->pool = pool; (*new)->attr = (int32)B_NORMAL_PRIORITY; return APR_SUCCESS; @@ -106,7 +106,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t return APR_ENOMEM; } - (*new)->cntxt = pool; + (*new)->pool = pool; (*new)->data = data; (*new)->func = func; (*new)->exitval = -1; @@ -117,7 +117,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t else temp = B_NORMAL_PRIORITY; - stat = apr_pool_create(&(*new)->cntxt, pool); + stat = apr_pool_create(&(*new)->pool, pool); if (stat != APR_SUCCESS) { return stat; } @@ -144,7 +144,7 @@ int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) { - apr_pool_destroy(thd->cntxt); + apr_pool_destroy(thd->pool); thd->exitval = retval; exit_thread ((status_t)(retval)); /* This will never be reached... */ @@ -186,14 +186,14 @@ void apr_thread_yield() APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { - return apr_pool_userdata_get(data, key, thread->cntxt); + return apr_pool_userdata_get(data, key, thread->pool); } APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) { - return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); + return apr_pool_userdata_set(data, key, cleanup, thread->pool); } APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) @@ -203,14 +203,14 @@ APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread } APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *cont) + apr_pool_t *pool) { - if (cont == NULL) { + if (pool == NULL) { return APR_ENOPOOL; } if ((*thd) == NULL) { - (*thd) = (apr_thread_t *)apr_pcalloc(cont, sizeof(apr_thread_t)); - (*thd)->cntxt = cont; + (*thd) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t)); + (*thd)->pool = pool; } (*thd)->td = *thethd; return APR_SUCCESS; @@ -256,4 +256,4 @@ APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, return APR_SUCCESS; } -APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) +APR_POOL_IMPLEMENT_ACCESSOR(thread) diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index 3bc1aadc3fe..60333868af2 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -59,14 +59,14 @@ static struct beos_private_data *beos_data[BEOS_MAX_DATAKEYS]; static sem_id lock; APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, - void (*dest)(void *), apr_pool_t *cont) + void (*dest)(void *), apr_pool_t *pool) { - (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); + (*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; } - (*key)->cntxt = cont; + (*key)->pool = pool; acquire_sem(lock); for ((*key)->key=0; (*key)->key < BEOS_MAX_DATAKEYS; (*key)->key++){ @@ -187,14 +187,14 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { - return apr_pool_userdata_get(data, key, threadkey->cntxt); + return apr_pool_userdata_get(data, key, threadkey->pool); } APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) { - return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); + return apr_pool_userdata_set(data, key, cleanup, threadkey->pool); } APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) @@ -204,14 +204,14 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_t } APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, apr_pool_t *cont) + apr_os_threadkey_t *thekey, apr_pool_t *pool) { - if (cont == NULL) { + if (pool == NULL) { return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (apr_threadkey_t *)apr_pcalloc(cont, sizeof(apr_threadkey_t)); - (*key)->cntxt = cont; + (*key) = (apr_threadkey_t *)apr_pcalloc(pool, sizeof(apr_threadkey_t)); + (*key)->pool = pool; } (*key)->key = *thekey; return APR_SUCCESS; diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 56cd25fafa2..d10b76f516f 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -67,14 +67,14 @@ apr_status_t apr_netware_proc_cleanup(void *theproc) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new,apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new,apr_pool_t *pool) { - (*new) = (apr_procattr_t *)apr_pcalloc(cont, sizeof(apr_procattr_t)); + (*new) = (apr_procattr_t *)apr_pcalloc(pool, sizeof(apr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; + (*new)->pool = pool; (*new)->cmdtype = APR_PROGRAM; return APR_SUCCESS; @@ -86,7 +86,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t apr_status_t status; if (in != 0) { if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, - attr->cntxt)) != APR_SUCCESS) { + attr->pool)) != APR_SUCCESS) { return status; } switch (in) { @@ -105,7 +105,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t } if (out) { if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, - attr->cntxt)) != APR_SUCCESS) { + attr->pool)) != APR_SUCCESS) { return status; } switch (out) { @@ -124,7 +124,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t } if (err) { if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, - attr->cntxt)) != APR_SUCCESS) { + attr->pool)) != APR_SUCCESS) { return status; } switch (err) { @@ -149,13 +149,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_fi apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); if (child_in != NULL) - apr_file_dup2(attr->child_in, child_in, attr->cntxt); + apr_file_dup2(attr->child_in, child_in, attr->pool); if (parent_in != NULL) - apr_file_dup2(attr->parent_in, parent_in, attr->cntxt); + apr_file_dup2(attr->parent_in, parent_in, attr->pool); return APR_SUCCESS; } @@ -165,13 +165,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_f apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); if (child_out != NULL) - apr_file_dup2(attr->child_out, child_out, attr->cntxt); + apr_file_dup2(attr->child_out, child_out, attr->pool); if (parent_out != NULL) - apr_file_dup2(attr->parent_out, parent_out, attr->cntxt); + apr_file_dup2(attr->parent_out, parent_out, attr->pool); return APR_SUCCESS; } @@ -181,13 +181,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); if (child_err != NULL) - apr_file_dup2(attr->child_err, child_err, attr->cntxt); + apr_file_dup2(attr->child_err, child_err, attr->pool); if (parent_err != NULL) - apr_file_dup2(attr->parent_err, parent_err, attr->cntxt); + apr_file_dup2(attr->parent_err, parent_err, attr->pool); return APR_SUCCESS; } @@ -196,7 +196,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { - attr->currdir = apr_pstrdup(attr->cntxt, dir); + attr->currdir = apr_pstrdup(attr->pool, dir); if (attr->currdir) { return APR_SUCCESS; } @@ -219,7 +219,7 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int3 } #if APR_HAS_FORK -APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) { int pid; @@ -291,7 +291,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, const char * const *args, const char * const *env, apr_procattr_t *attr, - apr_pool_t *cont) + apr_pool_t *pool) { int i, envCount=0; const char **newargs; @@ -420,7 +420,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, attr->parent_err->filedes = pipe_open(attr->parent_err->fname, O_RDONLY); } - apr_pool_cleanup_register(cont, (void *)newproc, apr_netware_proc_cleanup, + apr_pool_cleanup_register(pool, (void *)newproc, apr_netware_proc_cleanup, apr_pool_cleanup_null); } /*if (sysenv) diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index a9ad8c9fd05..119bba9dc4a 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -60,16 +60,16 @@ static int thread_count = 0; apr_status_t apr_threadattr_create(apr_threadattr_t **new, - apr_pool_t *cont) + apr_pool_t *pool) { - (*new) = (apr_threadattr_t *)apr_palloc(cont, + (*new) = (apr_threadattr_t *)apr_palloc(pool, sizeof(apr_threadattr_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; + (*new)->pool = pool; (*new)->stack_size = APR_DEFAULT_STACK_SIZE; (*new)->detach = 0; (*new)->thread_name = NULL; @@ -99,7 +99,7 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, - apr_pool_t *cont) + apr_pool_t *pool) { apr_status_t stat; long flags = NX_THR_BIND_CONTEXT; @@ -122,18 +122,18 @@ apr_status_t apr_thread_create(apr_thread_t **new, stack_size = attr->stack_size; } - (*new) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); + (*new) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; + (*new)->pool = pool; (*new)->data = data; (*new)->func = func; - (*new)->thread_name = (char*)apr_pstrdup(cont, threadName); + (*new)->thread_name = (char*)apr_pstrdup(pool, threadName); - stat = apr_pool_create(&(*new)->cntxt, cont); + stat = apr_pool_create(&(*new)->pool, pool); if (stat != APR_SUCCESS) { return stat; } @@ -185,7 +185,7 @@ apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t retval) { thd->exitval = retval; - apr_pool_destroy(thd->cntxt); + apr_pool_destroy(thd->pool); NXThreadExit(NULL); return APR_SUCCESS; } @@ -214,7 +214,7 @@ apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { if (thread != NULL) { - return apr_pool_userdata_get(data, key, thread->cntxt); + return apr_pool_userdata_get(data, key, thread->pool); } else { data = NULL; @@ -227,7 +227,7 @@ apr_status_t apr_thread_data_set(void *data, const char *key, apr_thread_t *thread) { if (thread != NULL) { - return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); + return apr_pool_userdata_set(data, key, cleanup, thread->pool); } else { data = NULL; @@ -247,14 +247,14 @@ APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *cont) + apr_pool_t *pool) { - if (cont == NULL) { + if (pool == NULL) { return APR_ENOPOOL; } if ((*thd) == NULL) { - (*thd) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); - (*thd)->cntxt = cont; + (*thd) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t)); + (*thd)->pool = pool; } (*thd)->td = *thethd; return APR_SUCCESS; @@ -272,6 +272,6 @@ APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, return APR_ENOTIMPL; } -APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) +APR_POOL_IMPLEMENT_ACCESSOR(thread) diff --git a/threadproc/netware/threadpriv.c b/threadproc/netware/threadpriv.c index 30b3b47c36a..d5ff659ce1a 100644 --- a/threadproc/netware/threadpriv.c +++ b/threadproc/netware/threadpriv.c @@ -56,16 +56,16 @@ #include "threadproc.h" apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, - void (*dest)(void *), apr_pool_t *cont) + void (*dest)(void *), apr_pool_t *pool) { apr_status_t stat; - (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); + (*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; } - (*key)->cntxt = cont; + (*key)->pool = pool; if ((stat = NXKeyCreate(NULL, dest, &(*key)->key)) == 0) { return stat; @@ -107,14 +107,14 @@ apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { - return apr_pool_userdata_get(data, key, threadkey->cntxt); + return apr_pool_userdata_get(data, key, threadkey->pool); } apr_status_t apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) { - return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); + return apr_pool_userdata_set(data, key, cleanup, threadkey->pool); } apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, @@ -125,14 +125,14 @@ apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, } apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, apr_pool_t *cont) + apr_os_threadkey_t *thekey, apr_pool_t *pool) { - if (cont == NULL) { + if (pool == NULL) { return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); - (*key)->cntxt = cont; + (*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t)); + (*key)->pool = pool; } (*key)->key = *thekey; return APR_SUCCESS; diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 4ae5e73e9e6..1ef853dbd4d 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -72,15 +72,15 @@ #include #include -APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *pool) { - (*new) = (apr_procattr_t *)apr_palloc(cont, + (*new) = (apr_procattr_t *)apr_palloc(pool, sizeof(apr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; + (*new)->pool = pool; (*new)->parent_in = NULL; (*new)->child_in = NULL; (*new)->parent_out = NULL; @@ -99,7 +99,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t apr_status_t stat; if (in) { if ((stat = apr_file_pipe_create(&attr->child_in, &attr->parent_in, - attr->cntxt)) != APR_SUCCESS) { + attr->pool)) != APR_SUCCESS) { return stat; } switch (in) { @@ -118,7 +118,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t } if (out) { if ((stat = apr_file_pipe_create(&attr->parent_out, &attr->child_out, - attr->cntxt)) != APR_SUCCESS) { + attr->pool)) != APR_SUCCESS) { return stat; } switch (out) { @@ -137,7 +137,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t } if (err) { if ((stat = apr_file_pipe_create(&attr->parent_err, &attr->child_err, - attr->cntxt)) != APR_SUCCESS) { + attr->pool)) != APR_SUCCESS) { return stat; } switch (err) { @@ -161,13 +161,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_fi apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); if (child_in != NULL) - apr_file_dup(&attr->child_in, child_in, attr->cntxt); + apr_file_dup(&attr->child_in, child_in, attr->pool); if (parent_in != NULL) - apr_file_dup(&attr->parent_in, parent_in, attr->cntxt); + apr_file_dup(&attr->parent_in, parent_in, attr->pool); return APR_SUCCESS; } @@ -177,13 +177,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_f apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); if (child_out != NULL) - apr_file_dup(&attr->child_out, child_out, attr->cntxt); + apr_file_dup(&attr->child_out, child_out, attr->pool); if (parent_out != NULL) - apr_file_dup(&attr->parent_out, parent_out, attr->cntxt); + apr_file_dup(&attr->parent_out, parent_out, attr->pool); return APR_SUCCESS; } @@ -193,13 +193,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); if (child_err != NULL) - apr_file_dup(&attr->child_err, child_err, attr->cntxt); + apr_file_dup(&attr->child_err, child_err, attr->pool); if (parent_err != NULL) - apr_file_dup(&attr->parent_err, parent_err, attr->cntxt); + apr_file_dup(&attr->parent_err, parent_err, attr->pool); return APR_SUCCESS; } @@ -207,7 +207,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { - attr->currdir = apr_pstrdup(attr->cntxt, dir); + attr->currdir = apr_pstrdup(attr->pool, dir); if (attr->currdir) { return APR_SUCCESS; } @@ -227,7 +227,7 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int3 return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) { int pid; @@ -253,7 +253,7 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) /* quotes in the string are doubled up. * Used to escape quotes in args passed to OS/2's cmd.exe */ -static char *double_quotes(apr_pool_t *cntxt, const char *str) +static char *double_quotes(apr_pool_t *pool, const char *str) { int num_quotes = 0; int len = 0; @@ -263,7 +263,7 @@ static char *double_quotes(apr_pool_t *cntxt, const char *str) num_quotes += str[len++] == '\"'; } - quote_doubled_str = apr_palloc(cntxt, len + num_quotes + 1); + quote_doubled_str = apr_palloc(pool, len + num_quotes + 1); dest = quote_doubled_str; while (*str) { @@ -281,7 +281,7 @@ static char *double_quotes(apr_pool_t *cntxt, const char *str) APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname, const char * const *args, const char * const *env, - apr_procattr_t *attr, apr_pool_t *cont) + apr_procattr_t *attr, apr_pool_t *pool) { int i, arg, numargs, cmdlen; apr_status_t status; @@ -351,10 +351,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname strcpy(interpreter, "#!" SHELL_PATH); extra_arg = "/C"; } else if (stricmp(extension, ".exe") != 0) { - status = apr_file_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, cont); + status = apr_file_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, pool); if (status != APR_SUCCESS && APR_STATUS_IS_ENOENT(status)) { - progname = apr_pstrcat(cont, progname, ".exe", NULL); + progname = apr_pstrcat(pool, progname, ".exe", NULL); } if (status == APR_SUCCESS) { @@ -391,7 +391,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname i++; } - newargs = (const char **)apr_palloc(cont, sizeof (char *) * (i + 4)); + newargs = (const char **)apr_palloc(pool, sizeof (char *) * (i + 4)); numargs = 0; if (interpreter[0]) @@ -399,7 +399,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname if (extra_arg) newargs[numargs++] = "/c"; - newargs[numargs++] = newprogname = apr_pstrdup(cont, progname); + newargs[numargs++] = newprogname = apr_pstrdup(pool, progname); arg = 1; while (args && args[arg]) { @@ -417,14 +417,14 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname for (i=0; i\" ")) - a = apr_pstrcat(cont, "\"", double_quotes(cont, a), "\"", NULL); + a = apr_pstrcat(pool, "\"", double_quotes(pool, a), "\"", NULL); if (i) *(cmdline_pos++) = ' '; @@ -446,7 +446,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname for (env_len=1, e=0; env[e]; e++) env_len += strlen(env[e]) + 1; - env_block = apr_palloc(cont, env_len); + env_block = apr_palloc(pool, env_len); env_block_pos = env_block; for (e=0; env[e]; e++) { diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 6c3e18a973b..808b9938b1e 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -62,15 +62,15 @@ #include "fileio.h" #include -APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *pool) { - (*new) = (apr_threadattr_t *)apr_palloc(cont, sizeof(apr_threadattr_t)); + (*new) = (apr_threadattr_t *)apr_palloc(pool, sizeof(apr_threadattr_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; + (*new)->pool = pool; (*new)->attr = 0; return APR_SUCCESS; } @@ -102,30 +102,30 @@ static void apr_thread_begin(void *arg) APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, - apr_pool_t *cont) + apr_pool_t *pool) { apr_status_t stat; apr_thread_t *thread; - thread = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); + thread = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t)); *new = thread; if (thread == NULL) { return APR_ENOMEM; } - thread->cntxt = cont; + thread->pool = pool; thread->attr = attr; thread->func = func; thread->data = data; - stat = apr_pool_create(&thread->cntxt, cont); + stat = apr_pool_create(&thread->pool, pool); if (stat != APR_SUCCESS) { return stat; } if (attr == NULL) { - stat = apr_threadattr_create(&thread->attr, thread->cntxt); + stat = apr_threadattr_create(&thread->attr, thread->pool); if (stat != APR_SUCCESS) { return stat; @@ -205,11 +205,11 @@ APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *cont) + apr_pool_t *pool) { if ((*thd) == NULL) { - (*thd) = (apr_thread_t *)apr_pcalloc(cont, sizeof(apr_thread_t)); - (*thd)->cntxt = cont; + (*thd) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t)); + (*thd)->pool = pool; } (*thd)->tid = *thethd; return APR_SUCCESS; @@ -226,7 +226,7 @@ int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { - return apr_pool_userdata_get(data, key, thread->cntxt); + return apr_pool_userdata_get(data, key, thread->pool); } @@ -235,10 +235,10 @@ APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) { - return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); + return apr_pool_userdata_set(data, key, cleanup, thread->pool); } -APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) +APR_POOL_IMPLEMENT_ACCESSOR(thread) diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index 7d1bd68e2ae..685268f9fe8 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -62,15 +62,15 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), - apr_pool_t *cont) + apr_pool_t *pool) { - (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); + (*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; } - (*key)->cntxt = cont; + (*key)->pool = pool; return APR_OS2_STATUS(DosAllocThreadLocalMemory(1, &((*key)->key))); } @@ -94,14 +94,14 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { - return apr_pool_userdata_get(data, key, threadkey->cntxt); + return apr_pool_userdata_get(data, key, threadkey->pool); } APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) { - return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); + return apr_pool_userdata_set(data, key, cleanup, threadkey->pool); } APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) @@ -112,14 +112,14 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_t APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, - apr_pool_t *cont) + apr_pool_t *pool) { - if (cont == NULL) { + if (pool == NULL) { return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (apr_threadkey_t *)apr_pcalloc(cont, sizeof(apr_threadkey_t)); - (*key)->cntxt = cont; + (*key) = (apr_threadkey_t *)apr_pcalloc(pool, sizeof(apr_threadkey_t)); + (*key)->pool = pool; } (*key)->key = *thekey; return APR_SUCCESS; diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index aa7c255a54c..3c71c4e23ad 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -57,14 +57,14 @@ #include "apr_portable.h" #include "apr_signal.h" -APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *pool) { - (*new) = (apr_procattr_t *)apr_pcalloc(cont, sizeof(apr_procattr_t)); + (*new) = (apr_procattr_t *)apr_pcalloc(pool, sizeof(apr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; + (*new)->pool = pool; (*new)->cmdtype = APR_PROGRAM; return APR_SUCCESS; } @@ -75,7 +75,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t apr_status_t status; if (in != 0) { if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, - attr->cntxt)) != APR_SUCCESS) { + attr->pool)) != APR_SUCCESS) { return status; } switch (in) { @@ -94,7 +94,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t } if (out) { if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, - attr->cntxt)) != APR_SUCCESS) { + attr->pool)) != APR_SUCCESS) { return status; } switch (out) { @@ -113,7 +113,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t } if (err) { if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, - attr->cntxt)) != APR_SUCCESS) { + attr->pool)) != APR_SUCCESS) { return status; } switch (err) { @@ -138,13 +138,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_fi apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); if (child_in != NULL) - apr_file_dup2(attr->child_in, child_in, attr->cntxt); + apr_file_dup2(attr->child_in, child_in, attr->pool); if (parent_in != NULL) - apr_file_dup2(attr->parent_in, parent_in, attr->cntxt); + apr_file_dup2(attr->parent_in, parent_in, attr->pool); return APR_SUCCESS; } @@ -154,13 +154,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_f apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); if (child_out != NULL) - apr_file_dup2(attr->child_out, child_out, attr->cntxt); + apr_file_dup2(attr->child_out, child_out, attr->pool); if (parent_out != NULL) - apr_file_dup2(attr->parent_out, parent_out, attr->cntxt); + apr_file_dup2(attr->parent_out, parent_out, attr->pool); return APR_SUCCESS; } @@ -170,13 +170,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); if (child_err != NULL) - apr_file_dup2(attr->child_err, child_err, attr->cntxt); + apr_file_dup2(attr->child_err, child_err, attr->pool); if (parent_err != NULL) - apr_file_dup2(attr->parent_err, parent_err, attr->cntxt); + apr_file_dup2(attr->parent_err, parent_err, attr->pool); return APR_SUCCESS; } @@ -185,7 +185,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { - attr->currdir = apr_pstrdup(attr->cntxt, dir); + attr->currdir = apr_pstrdup(attr->pool, dir); if (attr->currdir) { return APR_SUCCESS; } @@ -206,7 +206,7 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) { int pid; @@ -275,7 +275,7 @@ static apr_status_t limit_proc(apr_procattr_t *attr) APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, const char * const *env, - apr_procattr_t *attr, apr_pool_t *cont) + apr_procattr_t *attr, apr_pool_t *pool) { int i; const char **newargs; @@ -352,7 +352,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, i++; } newargs = - (const char **) apr_palloc(cont, sizeof (char *) * (i + 3)); + (const char **) apr_palloc(pool, sizeof (char *) * (i + 3)); newargs[0] = SHELL_PATH; newargs[1] = "-c"; i = 0; diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index cbf5842d5ac..1c5df14cbda 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -59,18 +59,18 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *pool) { apr_status_t stat; - (*new) = (apr_threadattr_t *)apr_pcalloc(cont, sizeof(apr_threadattr_t)); - (*new)->attr = (pthread_attr_t *)apr_pcalloc(cont, sizeof(pthread_attr_t)); + (*new) = (apr_threadattr_t *)apr_pcalloc(pool, sizeof(apr_threadattr_t)); + (*new)->attr = (pthread_attr_t *)apr_pcalloc(pool, sizeof(pthread_attr_t)); if ((*new) == NULL || (*new)->attr == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; + (*new)->pool = pool; stat = pthread_attr_init((*new)->attr); if (stat == 0) { @@ -124,24 +124,24 @@ static void *dummy_worker(void *opaque) APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, - apr_pool_t *cont) + apr_pool_t *pool) { apr_status_t stat; pthread_attr_t *temp; - (*new) = (apr_thread_t *)apr_pcalloc(cont, sizeof(apr_thread_t)); + (*new) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->td = (pthread_t *)apr_pcalloc(cont, sizeof(pthread_t)); + (*new)->td = (pthread_t *)apr_pcalloc(pool, sizeof(pthread_t)); if ((*new)->td == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; + (*new)->pool = pool; (*new)->data = data; (*new)->func = func; @@ -150,7 +150,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t else temp = NULL; - stat = apr_pool_create(&(*new)->cntxt, cont); + stat = apr_pool_create(&(*new)->pool, pool); if (stat != APR_SUCCESS) { return stat; } @@ -179,7 +179,7 @@ APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) { thd->exitval = retval; - apr_pool_destroy(thd->cntxt); + apr_pool_destroy(thd->pool); pthread_exit(NULL); return APR_SUCCESS; } @@ -226,14 +226,14 @@ void apr_thread_yield() APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { - return apr_pool_userdata_get(data, key, thread->cntxt); + return apr_pool_userdata_get(data, key, thread->pool); } APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) { - return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); + return apr_pool_userdata_set(data, key, cleanup, thread->pool); } APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) @@ -243,14 +243,14 @@ APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread } APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *cont) + apr_pool_t *pool) { - if (cont == NULL) { + if (pool == NULL) { return APR_ENOPOOL; } if ((*thd) == NULL) { - (*thd) = (apr_thread_t *)apr_pcalloc(cont, sizeof(apr_thread_t)); - (*thd)->cntxt = cont; + (*thd) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t)); + (*thd)->pool = pool; } (*thd)->td = thethd; return APR_SUCCESS; @@ -272,7 +272,7 @@ APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, return pthread_once(&control->once, func); } -APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) +APR_POOL_IMPLEMENT_ACCESSOR(thread) #endif /* HAVE_PTHREAD_H */ #endif /* APR_HAS_THREADS */ diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index c220b4f869d..2e11bfcb7a1 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -60,15 +60,15 @@ #if APR_HAVE_PTHREAD_H APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, - void (*dest)(void *), apr_pool_t *cont) + void (*dest)(void *), apr_pool_t *pool) { - (*key) = (apr_threadkey_t *)apr_pcalloc(cont, sizeof(apr_threadkey_t)); + (*key) = (apr_threadkey_t *)apr_pcalloc(pool, sizeof(apr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; } - (*key)->cntxt = cont; + (*key)->pool = pool; return pthread_key_create(&(*key)->key, dest); @@ -110,14 +110,14 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { - return apr_pool_userdata_get(data, key, threadkey->cntxt); + return apr_pool_userdata_get(data, key, threadkey->pool); } APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey) { - return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); + return apr_pool_userdata_set(data, key, cleanup, threadkey->pool); } APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) @@ -127,14 +127,14 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_t } APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, apr_pool_t *cont) + apr_os_threadkey_t *thekey, apr_pool_t *pool) { - if (cont == NULL) { + if (pool == NULL) { return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (apr_threadkey_t *)apr_pcalloc(cont, sizeof(apr_threadkey_t)); - (*key)->cntxt = cont; + (*key) = (apr_threadkey_t *)apr_pcalloc(pool, sizeof(apr_threadkey_t)); + (*key)->pool = pool; } (*key)->key = *thekey; return APR_SUCCESS; diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index f90400a4928..c67958ba3ea 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -72,17 +72,17 @@ */ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, - apr_pool_t *cont) + apr_pool_t *pool) { - (*new) = (apr_procattr_t *)apr_pcalloc(cont, sizeof(apr_procattr_t)); - (*new)->cntxt = cont; + (*new) = (apr_procattr_t *)apr_pcalloc(pool, sizeof(apr_procattr_t)); + (*new)->pool = pool; (*new)->cmdtype = APR_PROGRAM; return APR_SUCCESS; } static apr_status_t open_nt_process_pipe(apr_file_t **read, apr_file_t **write, apr_int32_t iBlockingMode, - apr_pool_t *cntxt) + apr_pool_t *pool) { apr_status_t stat; BOOLEAN bAsyncRead, bAsyncWrite; @@ -104,7 +104,7 @@ static apr_status_t open_nt_process_pipe(apr_file_t **read, apr_file_t **write, bAsyncWrite = TRUE; } if ((stat = apr_create_nt_pipe(read, write, bAsyncRead, bAsyncWrite, - cntxt)) != APR_SUCCESS) + pool)) != APR_SUCCESS) return stat; return APR_SUCCESS; @@ -164,7 +164,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, if (in) { stat = open_nt_process_pipe(&attr->child_in, &attr->parent_in, in, - attr->cntxt); + attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_in); if (stat != APR_SUCCESS) @@ -172,7 +172,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, } if (out) { stat = open_nt_process_pipe(&attr->parent_out, &attr->child_out, out, - attr->cntxt); + attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_out); if (stat != APR_SUCCESS) @@ -180,7 +180,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, } if (err) { stat = open_nt_process_pipe(&attr->parent_err, &attr->child_err, err, - attr->cntxt); + attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_err); if (stat != APR_SUCCESS) @@ -198,7 +198,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, if (attr->child_in == NULL && attr->parent_in == NULL) { stat = open_nt_process_pipe(&attr->child_in, &attr->parent_in, APR_FULL_BLOCK, - attr->cntxt); + attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_in); if (stat != APR_SUCCESS) @@ -221,7 +221,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, if (attr->child_out == NULL && attr->parent_out == NULL) { stat = open_nt_process_pipe(&attr->child_out, &attr->parent_out, APR_FULL_BLOCK, - attr->cntxt); + attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_out); if (stat != APR_SUCCESS) @@ -244,7 +244,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, if (attr->child_err == NULL && attr->parent_err == NULL) { stat = open_nt_process_pipe(&attr->child_err, &attr->parent_err, APR_FULL_BLOCK, - attr->cntxt); + attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_err); if (stat != APR_SUCCESS) @@ -265,7 +265,7 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, * the NT library loading code that flunk the '/' parsing test. */ return apr_filepath_merge(&attr->currdir, NULL, dir, - APR_FILEPATH_NATIVE, attr->cntxt); + APR_FILEPATH_NATIVE, attr->pool); } APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, @@ -287,7 +287,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char * const *args, const char * const *env, apr_procattr_t *attr, - apr_pool_t *cont) + apr_pool_t *pool) { apr_status_t rv; apr_size_t i; @@ -321,7 +321,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * a 16 bit app running in the VDM or WOW context. */ if (progname[0] == '\"') { - progname = apr_pstrndup(cont, progname + 1, strlen(progname) - 2); + progname = apr_pstrndup(pool, progname + 1, strlen(progname) - 2); } /* progname must be unquoted, in native format, as there are all sorts @@ -330,16 +330,16 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * so we've casted past the constness issue. */ if (strchr(progname, ' ')) - cmdline = apr_pstrcat(cont, "\"", progname, "\"", NULL); + cmdline = apr_pstrcat(pool, "\"", progname, "\"", NULL); else cmdline = (char*)progname; i = 1; while (args && args[i]) { if (strchr(args[i], ' ')) - cmdline = apr_pstrcat(cont, cmdline, " \"", args[i], "\"", NULL); + cmdline = apr_pstrcat(pool, cmdline, " \"", args[i], "\"", NULL); else - cmdline = apr_pstrcat(cont, cmdline, " ", args[i], NULL); + cmdline = apr_pstrcat(pool, cmdline, " ", args[i], NULL); i++; } @@ -350,10 +350,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (!shellcmd) shellcmd = SHELL_PATH; if (shellcmd[0] == '"') - progname = apr_pstrndup(cont, shellcmd + 1, strlen(shellcmd) - 1); + progname = apr_pstrndup(pool, shellcmd + 1, strlen(shellcmd) - 1); else if (strchr(shellcmd, ' ')) - shellcmd = apr_pstrcat(cont, "\"", shellcmd, "\"", NULL); - cmdline = apr_pstrcat(cont, shellcmd, " /C \"", cmdline, "\"", NULL); + shellcmd = apr_pstrcat(pool, "\"", shellcmd, "\"", NULL); + cmdline = apr_pstrcat(pool, shellcmd, " /C \"", cmdline, "\"", NULL); } else { /* Win32 is _different_ than unix. While unix will find the given @@ -364,7 +364,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, */ char *progpath; apr_filepath_merge(&progpath, attr->currdir, progname, - APR_FILEPATH_NATIVE, cont); + APR_FILEPATH_NATIVE, pool); progname = progpath; } @@ -391,7 +391,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, IF_WIN_OS_IS_UNICODE { apr_wchar_t *pNext; - pEnvBlock = (char *)apr_palloc(cont, iEnvBlockLen * 2); + pEnvBlock = (char *)apr_palloc(pool, iEnvBlockLen * 2); dwCreationFlags |= CREATE_UNICODE_ENVIRONMENT; i = 0; @@ -415,7 +415,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, ELSE_WIN_OS_IS_ANSI { char *pNext; - pEnvBlock = (char *)apr_palloc(cont, iEnvBlockLen); + pEnvBlock = (char *)apr_palloc(pool, iEnvBlockLen); i = 0; pNext = pEnvBlock; @@ -437,9 +437,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, STARTUPINFOW si; apr_size_t nprg = strlen(progname) + 1; apr_size_t nwprg = nprg + 6; - apr_wchar_t *wprg = apr_palloc(cont, nwprg * sizeof(wprg[0])); + apr_wchar_t *wprg = apr_palloc(pool, nwprg * sizeof(wprg[0])); apr_size_t ncmd = strlen(cmdline) + 1, nwcmd = ncmd; - apr_wchar_t *wcmd = apr_palloc(cont, nwcmd * sizeof(wcmd[0])); + apr_wchar_t *wcmd = apr_palloc(pool, nwcmd * sizeof(wcmd[0])); apr_size_t ncwd = 0, nwcwd = 0; apr_wchar_t *wcwd = NULL; @@ -453,7 +453,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->currdir) { ncwd = nwcwd = strlen(attr->currdir) + 1; - wcwd = apr_palloc(cont, ncwd * sizeof(wcwd[0])); + wcwd = apr_palloc(pool, ncwd * sizeof(wcwd[0])); if ((rv = apr_conv_utf8_to_ucs2(attr->currdir, &ncwd, wcwd, &nwcwd)) != APR_SUCCESS) { diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 14ba8a388c7..da7b5a72193 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -64,16 +64,16 @@ #include "misc.h" APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, - apr_pool_t *cont) + apr_pool_t *pool) { - (*new) = (apr_threadattr_t *)apr_palloc(cont, + (*new) = (apr_threadattr_t *)apr_palloc(pool, sizeof(apr_threadattr_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; + (*new)->pool = pool; return APR_SUCCESS; } @@ -100,22 +100,22 @@ static void *dummy_worker(void *opaque) APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, - void *data, apr_pool_t *cont) + void *data, apr_pool_t *pool) { apr_status_t stat; unsigned temp; - (*new) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); + (*new) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->cntxt = cont; + (*new)->pool = pool; (*new)->data = data; (*new)->func = func; - stat = apr_pool_create(&(*new)->cntxt, cont); + stat = apr_pool_create(&(*new)->pool, pool); if (stat != APR_SUCCESS) { return stat; } @@ -147,7 +147,7 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) { thd->exitval = retval; - apr_pool_destroy(thd->cntxt); + apr_pool_destroy(thd->pool); #ifndef _WIN32_WCE _endthreadex(0); #else @@ -197,14 +197,14 @@ APR_DECLARE(void) apr_thread_yield() APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { - return apr_pool_userdata_get(data, key, thread->cntxt); + return apr_pool_userdata_get(data, key, thread->pool); } APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) { - return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); + return apr_pool_userdata_set(data, key, cleanup, thread->pool); } APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) @@ -224,14 +224,14 @@ APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *cont) + apr_pool_t *pool) { - if (cont == NULL) { + if (pool == NULL) { return APR_ENOPOOL; } if ((*thd) == NULL) { - (*thd) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); - (*thd)->cntxt = cont; + (*thd) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t)); + (*thd)->pool = pool; } (*thd)->td = thethd; return APR_SUCCESS; @@ -253,4 +253,4 @@ APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, return APR_SUCCESS; } -APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) +APR_POOL_IMPLEMENT_ACCESSOR(thread) diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index ad438c28af7..9d9a88a3700 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -61,14 +61,14 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), - apr_pool_t *cont) + apr_pool_t *pool) { - (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); + (*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; } - (*key)->cntxt = cont; + (*key)->pool = pool; if (((*key)->key = TlsAlloc()) != 0xFFFFFFFF) { return APR_SUCCESS; @@ -105,14 +105,14 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { - return apr_pool_userdata_get(data, key, threadkey->cntxt); + return apr_pool_userdata_get(data, key, threadkey->pool); } APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup)(void *), apr_threadkey_t *threadkey) { - return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); + return apr_pool_userdata_set(data, key, cleanup, threadkey->pool); } APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, @@ -124,14 +124,14 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, - apr_pool_t *cont) + apr_pool_t *pool) { - if (cont == NULL) { + if (pool == NULL) { return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); - (*key)->cntxt = cont; + (*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t)); + (*key)->pool = pool; } (*key)->key = *thekey; return APR_SUCCESS; From 22fbac32b2fd9fa305a369a3a61088740677e116 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 19 Mar 2002 18:31:08 +0000 Subject: [PATCH 3152/7878] Style Police writes some more tickets... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63159 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 139 +++++++++++++++++++++++------------ threadproc/unix/thread.c | 58 ++++++++++----- threadproc/unix/threadpriv.c | 41 +++++++---- 3 files changed, 158 insertions(+), 80 deletions(-) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 3c71c4e23ad..b0f41fd1f96 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -57,7 +57,8 @@ #include "apr_portable.h" #include "apr_signal.h" -APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, + apr_pool_t *pool) { (*new) = (apr_procattr_t *)apr_pcalloc(pool, sizeof(apr_procattr_t)); @@ -69,15 +70,18 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t * return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, - apr_int32_t out, apr_int32_t err) +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, + apr_int32_t in, + apr_int32_t out, + apr_int32_t err) { apr_status_t status; if (in != 0) { - if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, - attr->pool)) != APR_SUCCESS) { + if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, + attr->pool)) != APR_SUCCESS) { return status; } + switch (in) { case APR_FULL_BLOCK: break; @@ -91,12 +95,14 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t apr_file_pipe_timeout_set(attr->child_in, 0); apr_file_pipe_timeout_set(attr->parent_in, 0); } - } + } + if (out) { - if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, - attr->pool)) != APR_SUCCESS) { + if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, + attr->pool)) != APR_SUCCESS) { return status; } + switch (out) { case APR_FULL_BLOCK: break; @@ -110,12 +116,14 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t apr_file_pipe_timeout_set(attr->child_out, 0); apr_file_pipe_timeout_set(attr->parent_out, 0); } - } + } + if (err) { - if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, - attr->pool)) != APR_SUCCESS) { + if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, + attr->pool)) != APR_SUCCESS) { return status; } + switch (err) { case APR_FULL_BLOCK: break; @@ -129,12 +137,14 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t apr_file_pipe_timeout_set(attr->child_err, 0); apr_file_pipe_timeout_set(attr->parent_err, 0); } - } + } + return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, +APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, + apr_file_t *child_in, apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) @@ -150,7 +160,8 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_fi } -APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, +APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, + apr_file_t *child_out, apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) @@ -166,7 +177,8 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_f } -APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, +APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, + apr_file_t *child_err, apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) @@ -182,25 +194,26 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f } -APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, - const char *dir) +APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, + const char *dir) { attr->currdir = apr_pstrdup(attr->pool, dir); if (attr->currdir) { return APR_SUCCESS; } + return APR_ENOMEM; } APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, - apr_cmdtype_e cmd) + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, - apr_int32_t detach) +APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, + apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; @@ -209,21 +222,24 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) { int pid; - + if ((pid = fork()) < 0) { return errno; } else if (pid == 0) { proc->pid = pid; - proc->in = NULL; - proc->out = NULL; - proc->err = NULL; + proc->in = NULL; + proc->out = NULL; + proc->err = NULL; + return APR_INCHILD; } + proc->pid = pid; - proc->in = NULL; - proc->out = NULL; - proc->err = NULL; + proc->in = NULL; + proc->out = NULL; + proc->err = NULL; + return APR_INPARENT; } @@ -272,10 +288,12 @@ static apr_status_t limit_proc(apr_procattr_t *attr) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, +APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, + const char *progname, const char * const *args, const char * const *env, - apr_procattr_t *attr, apr_pool_t *pool) + apr_procattr_t *attr, + apr_pool_t *pool) { int i; const char **newargs; @@ -283,16 +301,17 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, new->in = attr->parent_in; new->err = attr->parent_err; new->out = attr->parent_out; + if ((new->pid = fork()) < 0) { return errno; } - else if (new->pid == 0) { + else if (new->pid == 0) { int status; /* child process */ /* - * If we do exec cleanup before the dup2() calls to set up pipes - * on 0-2, we accidentally close the pipes used by programs like + * If we do exec cleanup before the dup2() calls to set up pipes + * on 0-2, we accidentally close the pipes used by programs like * mod_cgid. * * If we do exec cleanup after the dup2() calls, cleanup can accidentally @@ -304,13 +323,15 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, */ if (attr->child_in) { - apr_pool_cleanup_kill(apr_file_pool_get(attr->child_in), + apr_pool_cleanup_kill(apr_file_pool_get(attr->child_in), attr->child_in, apr_unix_file_cleanup); } + if (attr->child_out) { apr_pool_cleanup_kill(apr_file_pool_get(attr->child_out), attr->child_out, apr_unix_file_cleanup); } + if (attr->child_err) { apr_pool_cleanup_kill(apr_file_pool_get(attr->child_err), attr->child_err, apr_unix_file_cleanup); @@ -323,18 +344,20 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, dup2(attr->child_in->filedes, STDIN_FILENO); apr_file_close(attr->child_in); } + if (attr->child_out) { apr_file_close(attr->parent_out); dup2(attr->child_out->filedes, STDOUT_FILENO); apr_file_close(attr->child_out); } + if (attr->child_err) { apr_file_close(attr->parent_err); dup2(attr->child_err->filedes, STDERR_FILENO); apr_file_close(attr->child_err); } - - apr_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ + + apr_signal(SIGCHLD, SIG_DFL); /* not sure if this is needed or not */ if (attr->currdir != NULL) { if (chdir(attr->currdir) == -1) { @@ -351,31 +374,37 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, while (args[i]) { i++; } - newargs = - (const char **) apr_palloc(pool, sizeof (char *) * (i + 3)); + + newargs = (const char **)apr_palloc(pool, sizeof (char *) * (i + 3)); newargs[0] = SHELL_PATH; newargs[1] = "-c"; + i = 0; while (args[i]) { - newargs[i + 2] = args[i]; + newargs[i + 2] = args[i]; i++; } + newargs[i + 2] = NULL; + if (attr->detached) { apr_proc_detach(APR_PROC_DETACH_DAEMONIZE); } + execve(SHELL_PATH, (char * const *) newargs, (char * const *)env); } else if (attr->cmdtype == APR_PROGRAM) { if (attr->detached) { apr_proc_detach(APR_PROC_DETACH_DAEMONIZE); } + execve(progname, (char * const *)args, (char * const *)env); } else if (attr->cmdtype == APR_PROGRAM_ENV) { if (attr->detached) { apr_proc_detach(APR_PROC_DETACH_DAEMONIZE); } + execv(progname, (char * const *)args); } else { @@ -383,35 +412,40 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, if (attr->detached) { apr_proc_detach(APR_PROC_DETACH_DAEMONIZE); } + execvp(progname, (char * const *)args); } - exit(-1); /* if we get here, there is a problem, so exit with an */ - /* error code. */ + exit(-1); /* if we get here, there is a problem, so exit with an + * error code. */ } + /* Parent process */ if (attr->child_in) { apr_file_close(attr->child_in); } + if (attr->child_out) { apr_file_close(attr->child_out); } + if (attr->child_err) { apr_file_close(attr->child_err); } + return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, +APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, int *exitcode, apr_exit_why_e *exitwhy, - apr_wait_how_e waithow, + apr_wait_how_e waithow, apr_pool_t *p) { proc->pid = -1; return apr_proc_wait(proc, exitcode, exitwhy, waithow); -} +} -APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, int *exitcode, apr_exit_why_e *exitwhy, apr_wait_how_e waithow) { @@ -424,6 +458,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, if (exitcode == NULL) { exitcode = &ignore; } + if (exitwhy == NULL) { exitwhy = &ignorewhy; } @@ -431,35 +466,41 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, if (waithow != APR_WAIT) { waitpid_options |= WNOHANG; } - + if ((pstatus = waitpid(proc->pid, &exit_int, waitpid_options)) > 0) { proc->pid = pstatus; + if (WIFEXITED(exit_int)) { *exitwhy = APR_PROC_EXIT; *exitcode = WEXITSTATUS(exit_int); } else if (WIFSIGNALED(exit_int)) { *exitwhy = APR_PROC_SIGNAL; + #ifdef WCOREDUMP if (WCOREDUMP(exit_int)) { *exitwhy |= APR_PROC_SIGNAL_CORE; } #endif + *exitcode = WTERMSIG(exit_int); } else { /* unexpected condition */ return APR_EGENERAL; } + return APR_CHILD_DONE; } else if (pstatus == 0) { return APR_CHILD_NOTDONE; } + return errno; -} +} -APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, +APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, + apr_int32_t what, struct rlimit *limit) { switch(what) { @@ -470,6 +511,7 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32 #else return APR_ENOTIMPL; #endif + case APR_LIMIT_MEM: #if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS) attr->limit_mem = limit; @@ -477,6 +519,7 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32 #else return APR_ENOTIMPL; #endif + case APR_LIMIT_NPROC: #ifdef RLIMIT_NPROC attr->limit_nproc = limit; @@ -484,6 +527,8 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32 #else return APR_ENOTIMPL; #endif + } + return APR_SUCCESS; } diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 1c5df14cbda..693396d9954 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -59,10 +59,11 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, + apr_pool_t *pool) { apr_status_t stat; - + (*new) = (apr_threadattr_t *)apr_pcalloc(pool, sizeof(apr_threadattr_t)); (*new)->attr = (pthread_attr_t *)apr_pcalloc(pool, sizeof(pthread_attr_t)); @@ -79,10 +80,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool #ifdef PTHREAD_SETS_ERRNO stat = errno; #endif + return stat; } -APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) +APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, + apr_int32_t on) { apr_status_t stat; #ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR @@ -92,12 +95,14 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_ #else if ((stat = pthread_attr_setdetachstate(attr->attr, on)) == 0) { #endif + return APR_SUCCESS; } else { #ifdef PTHREAD_SETS_ERRNO stat = errno; #endif + return stat; } } @@ -122,13 +127,15 @@ static void *dummy_worker(void *opaque) return thread->func(thread, thread->data); } -APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, - apr_thread_start_t func, void *data, +APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, + apr_threadattr_t *attr, + apr_thread_start_t func, + void *data, apr_pool_t *pool) { apr_status_t stat; pthread_attr_t *temp; - + (*new) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t)); if ((*new) == NULL) { @@ -144,7 +151,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t (*new)->pool = pool; (*new)->data = data; (*new)->func = func; - + if (attr) temp = attr->attr; else @@ -162,8 +169,9 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t #ifdef PTHREAD_SETS_ERRNO stat = errno; #endif + return stat; - } + } } APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) @@ -171,12 +179,14 @@ APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) return pthread_self(); } -APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) +APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, + apr_os_thread_t tid2) { return pthread_equal(tid1, tid2); } -APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) +APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, + apr_status_t retval) { thd->exitval = retval; apr_pool_destroy(thd->pool); @@ -184,7 +194,8 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, + apr_thread_t *thd) { apr_status_t stat; apr_status_t *thread_stat; @@ -197,6 +208,7 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *th #ifdef PTHREAD_SETS_ERRNO stat = errno; #endif + return stat; } } @@ -210,12 +222,14 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) #else if ((stat = pthread_detach(*thd->td)) == 0) { #endif + return APR_SUCCESS; } else { #ifdef PTHREAD_SETS_ERRNO stat = errno; #endif + return stat; } } @@ -224,34 +238,39 @@ void apr_thread_yield() { } -APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) +APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, + apr_thread_t *thread) { return apr_pool_userdata_get(data, key, thread->pool); } APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), + apr_status_t (*cleanup)(void *), apr_thread_t *thread) { return apr_pool_userdata_set(data, key, cleanup, thread->pool); } -APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, + apr_thread_t *thd) { *thethd = thd->td; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, + apr_os_thread_t *thethd, + apr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } + if ((*thd) == NULL) { (*thd) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t)); (*thd)->pool = pool; } + (*thd)->td = thethd; return APR_SUCCESS; } @@ -266,7 +285,7 @@ APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, +APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, void (*func)(void)) { return pthread_once(&control->once, func); @@ -279,9 +298,10 @@ APR_POOL_IMPLEMENT_ACCESSOR(thread) #if !APR_HAS_THREADS -APR_DECLARE(apr_status_t) apr_os_thread_get(void); /* avoid warning for no prototype */ +/* avoid warning for no prototype */ +APR_DECLARE(apr_status_t) apr_os_thread_get(void); -APR_DECLARE(apr_status_t) apr_os_thread_get(void) +APR_DECLARE(apr_status_t) apr_os_thread_get(void) { return APR_ENOTIMPL; } diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 2e11bfcb7a1..e1d9287017d 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -59,8 +59,9 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, - void (*dest)(void *), apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, + void (*dest)(void *), + apr_pool_t *pool) { (*key) = (apr_threadkey_t *)apr_pcalloc(pool, sizeof(apr_threadkey_t)); @@ -74,20 +75,23 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, } -APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, + apr_threadkey_t *key) { #ifdef PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS if (pthread_getspecific(key->key,new)) *new = NULL; -#else +#else (*new) = pthread_getspecific(key->key); #endif return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, + apr_threadkey_t *key) { apr_status_t stat; + if ((stat = pthread_setspecific(key->key, priv)) == 0) { return APR_SUCCESS; } @@ -100,53 +104,62 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) { apr_status_t stat; + if ((stat = pthread_key_delete(key->key)) == 0) { - return APR_SUCCESS; + return APR_SUCCESS; } + return stat; } #endif APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, - apr_threadkey_t *threadkey) + apr_threadkey_t *threadkey) { return apr_pool_userdata_get(data, key, threadkey->pool); } APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_threadkey_t *threadkey) + apr_status_t (*cleanup)(void *), + apr_threadkey_t *threadkey) { return apr_pool_userdata_set(data, key, cleanup, threadkey->pool); } -APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, + apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, + apr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } + if ((*key) == NULL) { (*key) = (apr_threadkey_t *)apr_pcalloc(pool, sizeof(apr_threadkey_t)); (*key)->pool = pool; } + (*key)->key = *thekey; return APR_SUCCESS; -} +} #endif /* APR_HAVE_PTHREAD_H */ #endif /* APR_HAS_THREADS */ #if !APR_HAS_THREADS -APR_DECLARE(apr_status_t) apr_os_threadkey_get(void); /* avoid warning for no prototype */ + +/* avoid warning for no prototype */ +APR_DECLARE(apr_status_t) apr_os_threadkey_get(void); APR_DECLARE(apr_status_t) apr_os_threadkey_get(void) { return APR_ENOTIMPL; } + #endif From fa0018653dc6ed58ef9a7e4e7b88b22129a20db5 Mon Sep 17 00:00:00 2001 From: Karl Fogel Date: Tue, 19 Mar 2002 19:55:51 +0000 Subject: [PATCH 3153/7878] * include/apr_fnmatch.h (apr_fnmatch): Document return values. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63160 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_fnmatch.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index 033deab9f7e..0e2f4db9be0 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -62,7 +62,8 @@ extern "C" { #define FNM_CASE_BLIND 0x08 /**< Compare characters case-insensitively. @remark This flag is an Apache addition */ /** - * Try to match the string to the given pattern. + * Try to match the string to the given pattern, return APR_SUCCESS if + * match, else return FNM_NOMATCH. * @param pattern The pattern to match to * @param strings The string we are trying to match * @param flags flags to use in the match. Bitwise OR of: From 36c9c04005ef34c8a950d4a63d0a72a4d0e0d28c Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 19 Mar 2002 22:42:30 +0000 Subject: [PATCH 3154/7878] apr_atomic_dec: change the fallback version to return the new value of the memory variable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63161 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 686b19bf644..aa35a0d9155 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -126,13 +126,13 @@ void apr_atomic_inc( volatile apr_uint32_t *mem) int apr_atomic_dec(volatile apr_atomic_t *mem) { apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - apr_uint32_t prev; + apr_uint32_t new; if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - prev = *mem; (*mem)--; + new = *mem; apr_thread_mutex_unlock(lock); - return prev; + return new; } return *mem; } From 5933306bb63c0453747348950546ca3e46971066 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 20 Mar 2002 04:25:15 +0000 Subject: [PATCH 3155/7878] Win32 was missing the apr_os_dso_handle_get() accessor. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63162 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index ddb33b09c49..98c18878afb 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -70,6 +70,13 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *osdso, + apr_dso_handle_t *aprdso) +{ + *osdso = aprdso->handle; + return APR_SUCCESS; +} + static apr_status_t dso_cleanup(void *thedso) { apr_dso_handle_t *dso = thedso; From 0f7ba4b802a198a875d59b110630bbfb72db3e1a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 20 Mar 2002 04:25:45 +0000 Subject: [PATCH 3156/7878] Credit where credit's due - missing apr_os_dso_handle_get() identified by Aaron Bannert. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63163 13f79535-47bb-0310-9956-ffa450edef68 From d6a13e829012898ddb379ada68a835f98a30f7ae Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 20 Mar 2002 08:54:43 +0000 Subject: [PATCH 3157/7878] Rename the "cntxt" members of the fileio structures to "pool". git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63164 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 18 +++++++-------- file_io/netware/pipe.c | 20 ++++++++--------- file_io/os2/dir.c | 24 ++++++++++---------- file_io/os2/filedup.c | 6 ++--- file_io/os2/open.c | 40 ++++++++++++++++----------------- file_io/os2/pipe.c | 20 ++++++++--------- file_io/unix/dir.c | 28 +++++++++++------------ file_io/unix/fileacc.c | 4 ++-- file_io/unix/filedup.c | 4 ++-- file_io/unix/filestat.c | 14 ++++++------ file_io/unix/mktemp.c | 2 +- file_io/unix/open.c | 42 +++++++++++++++++------------------ file_io/unix/pipe.c | 16 ++++++------- file_io/win32/dir.c | 26 +++++++++++----------- file_io/win32/filedup.c | 6 ++--- file_io/win32/filestat.c | 28 +++++++++++------------ file_io/win32/open.c | 42 +++++++++++++++++------------------ file_io/win32/pipe.c | 16 ++++++------- file_io/win32/readwrite.c | 4 ++-- include/apr_file_info.h | 2 +- include/arch/netware/fileio.h | 4 ++-- include/arch/os2/fileio.h | 4 ++-- include/arch/unix/fileio.h | 4 ++-- include/arch/win32/fileio.h | 4 ++-- network_io/unix/poll.c | 4 ++-- 25 files changed, 191 insertions(+), 191 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index ce186452304..6a54ae2f59f 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -119,7 +119,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, struct stat info; if (fstat(thefile->filedes, &info) == 0) { - finfo->cntxt = thefile->cntxt; + finfo->pool = thefile->pool; finfo->fname = thefile->fname; fill_out_finfo(finfo, &info, wanted); return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; @@ -142,12 +142,12 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, apr_fileattrs_t attr_mask, - apr_pool_t *cont) + apr_pool_t *pool) { apr_status_t status; apr_finfo_t finfo; - status = apr_stat(&finfo, fname, APR_FINFO_PROT, cont); + status = apr_stat(&finfo, fname, APR_FINFO_PROT, pool); if (!APR_STATUS_IS_SUCCESS(status)) return status; @@ -288,7 +288,7 @@ int cstat (const char *path, struct stat *buf) APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *pool) { struct stat info; int srv; @@ -297,15 +297,15 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, srv = cstat(fname, &info); if (srv == 0) { - finfo->cntxt = cont; + finfo->pool = pool; finfo->fname = fname; fill_out_finfo(finfo, &info, wanted); if (wanted & APR_FINFO_LINK) wanted &= ~APR_FINFO_LINK; if (wanted & APR_FINFO_NAME) { - s = strrchr(case_filename(cont, fname), '/'); + s = strrchr(case_filename(pool, fname), '/'); if (s) { - finfo->name = apr_pstrdup(cont, &s[1]); + finfo->name = apr_pstrdup(pool, &s[1]); finfo->valid |= APR_FINFO_NAME; } } @@ -349,8 +349,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, /* Perhaps this becomes nothing but a macro? */ APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *pool) { - return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, cont); + return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, pool); } diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 7b86c7d87ce..46ae051d904 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -144,7 +144,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int return APR_EINVAL; } -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) { char tname[L_tmpnam+1]; int filedes[2]; @@ -156,17 +156,17 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out if ((filedes[0] = pipe_open(tname, O_RDONLY) != -1) && (filedes[1] = pipe_open(tname, O_WRONLY) != -1)) { - (*in) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); - (*out) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); + (*in) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); - (*in)->cntxt = - (*out)->cntxt = cont; + (*in)->pool = + (*out)->pool = pool; (*in)->filedes = filedes[0]; (*out)->filedes = filedes[1]; (*in)->pipe = (*out)->pipe = 1; - (*out)->fname = apr_pstrdup(cont, tname); - (*in)->fname = apr_pstrdup(cont, tname);; + (*out)->fname = apr_pstrdup(pool, tname); + (*in)->fname = apr_pstrdup(pool, tname);; (*in)->buffered = (*out)->buffered = 0; (*in)->blocking = @@ -184,16 +184,16 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return errno; } - apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), apr_netware_pipe_cleanup, + apr_pool_cleanup_register((*in)->pool, (void *)(*in), apr_netware_pipe_cleanup, apr_pool_cleanup_null); - apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), apr_netware_pipe_cleanup, + apr_pool_cleanup_register((*out)->pool, (void *)(*out), apr_netware_pipe_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, - apr_fileperms_t perm, apr_pool_t *cont) + apr_fileperms_t perm, apr_pool_t *pool) { return APR_ENOTIMPL; } diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index fbc6f56ae4e..7c1bfe74824 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -67,15 +67,15 @@ static apr_status_t dir_cleanup(void *thedir) -APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cntxt) +APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *pool) { - apr_dir_t *thedir = (apr_dir_t *)apr_palloc(cntxt, sizeof(apr_dir_t)); + apr_dir_t *thedir = (apr_dir_t *)apr_palloc(pool, sizeof(apr_dir_t)); if (thedir == NULL) return APR_ENOMEM; - thedir->cntxt = cntxt; - thedir->dirname = apr_pstrdup(cntxt, dirname); + thedir->pool = pool; + thedir->dirname = apr_pstrdup(pool, dirname); if (thedir->dirname == NULL) return APR_ENOMEM; @@ -83,7 +83,7 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, apr thedir->handle = 0; thedir->validentry = FALSE; *new = thedir; - apr_pool_cleanup_register(cntxt, thedir, dir_cleanup, apr_pool_cleanup_null); + apr_pool_cleanup_register(pool, thedir, dir_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -114,14 +114,14 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if (thedir->handle == 0) { thedir->handle = HDIR_CREATE; - rv = DosFindFirst(apr_pstrcat(thedir->cntxt, thedir->dirname, "/*", NULL), &thedir->handle, + rv = DosFindFirst(apr_pstrcat(thedir->pool, thedir->dirname, "/*", NULL), &thedir->handle, FILE_ARCHIVED|FILE_DIRECTORY|FILE_SYSTEM|FILE_HIDDEN|FILE_READONLY, &thedir->entry, sizeof(thedir->entry), &entries, FIL_STANDARD); } else { rv = DosFindNext(thedir->handle, &thedir->entry, sizeof(thedir->entry), &entries); } - finfo->cntxt = thedir->cntxt; + finfo->pool = thedir->pool; finfo->fname = NULL; finfo->valid = 0; @@ -168,14 +168,14 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir) -APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *pool) { return APR_OS2_STATUS(DosCreateDir(path, NULL)); } -APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool) { return APR_OS2_STATUS(DosDeleteDir(path)); } @@ -194,11 +194,11 @@ APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, - apr_pool_t *cont) + apr_pool_t *pool) { if ((*dir) == NULL) { - (*dir) = (apr_dir_t *)apr_pcalloc(cont, sizeof(apr_dir_t)); - (*dir)->cntxt = cont; + (*dir) = (apr_dir_t *)apr_pcalloc(pool, sizeof(apr_dir_t)); + (*dir)->pool = pool; } (*dir)->handle = *thedir; return APR_SUCCESS; diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index ddce0d1cf08..678f2dcc77b 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -76,14 +76,14 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_po dup_file = *new_file; } - dup_file->cntxt = p; + dup_file->pool = p; rv = DosDupHandle(old_file->filedes, &dup_file->filedes); if (rv) { return APR_OS2_STATUS(rv); } - dup_file->fname = apr_pstrdup(dup_file->cntxt, old_file->fname); + dup_file->fname = apr_pstrdup(dup_file->pool, old_file->fname); dup_file->buffered = old_file->buffered; dup_file->isopen = old_file->isopen; dup_file->flags = old_file->flags & ~APR_INHERIT; @@ -91,7 +91,7 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_po dup_file->pipe = old_file->pipe; if (*new_file == NULL) { - apr_pool_cleanup_register(dup_file->cntxt, dup_file, apr_file_cleanup, + apr_pool_cleanup_register(dup_file->pool, dup_file, apr_file_cleanup, apr_pool_cleanup_null); *new_file = dup_file; } diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 45a28606fd3..cef62e53b0b 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -68,16 +68,16 @@ apr_status_t apr_file_cleanup(void *thefile) -APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cntxt) +APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *pool) { int oflags = 0; int mflags = OPEN_FLAGS_FAIL_ON_ERROR|OPEN_SHARE_DENYNONE; int rv; ULONG action; - apr_file_t *dafile = (apr_file_t *)apr_palloc(cntxt, sizeof(apr_file_t)); + apr_file_t *dafile = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); *new = dafile; - dafile->cntxt = cntxt; + dafile->pool = pool; dafile->isopen = FALSE; dafile->eof_hit = FALSE; dafile->buffer = NULL; @@ -98,8 +98,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->buffered = (flag & APR_BUFFERED) > 0; if (dafile->buffered) { - dafile->buffer = apr_palloc(cntxt, APR_FILE_BUFSIZE); - rv = apr_thread_mutex_create(&dafile->mutex, 0, cntxt); + dafile->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); + rv = apr_thread_mutex_create(&dafile->mutex, 0, pool); if (rv) return rv; @@ -138,7 +138,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr return APR_OS2_STATUS(rv); dafile->isopen = TRUE; - dafile->fname = apr_pstrdup(cntxt, fname); + dafile->fname = apr_pstrdup(pool, fname); dafile->filePtr = 0; dafile->bufpos = 0; dafile->dataRead = 0; @@ -146,7 +146,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->pipe = FALSE; if (!(flag & APR_FILE_NOCLEANUP)) { - apr_pool_cleanup_register(dafile->cntxt, dafile, apr_file_cleanup, apr_file_cleanup); + apr_pool_cleanup_register(dafile->pool, dafile, apr_file_cleanup, apr_file_cleanup); } return APR_SUCCESS; } @@ -182,7 +182,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) -APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cntxt) +APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool) { ULONG rc = DosDelete(path); return APR_OS2_STATUS(rc); @@ -216,12 +216,12 @@ APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *fi -APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_int32_t flags, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_int32_t flags, apr_pool_t *pool) { apr_os_file_t *dafile = thefile; - (*file) = apr_palloc(cont, sizeof(apr_file_t)); - (*file)->cntxt = cont; + (*file) = apr_palloc(pool, sizeof(apr_file_t)); + (*file)->pool = pool; (*file)->filedes = *dafile; (*file)->isopen = TRUE; (*file)->buffered = FALSE; @@ -241,33 +241,33 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) } -APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *pool) { apr_os_file_t fd = 2; - return apr_os_file_put(thefile, &fd, 0, cont); + return apr_os_file_put(thefile, &fd, 0, pool); } -APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *pool) { apr_os_file_t fd = 1; - return apr_os_file_put(thefile, &fd, 0, cont); + return apr_os_file_put(thefile, &fd, 0, pool); } -APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool) { apr_os_file_t fd = 0; - return apr_os_file_put(thefile, &fd, 0, cont); + return apr_os_file_put(thefile, &fd, 0, pool); } -APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); +APR_POOL_IMPLEMENT_ACCESSOR(file); -APR_IMPLEMENT_SET_INHERIT(file, flags, cntxt, apr_file_cleanup) +APR_IMPLEMENT_SET_INHERIT(file, flags, pool, apr_file_cleanup) -APR_IMPLEMENT_UNSET_INHERIT(file, flags, cntxt, apr_file_cleanup) +APR_IMPLEMENT_UNSET_INHERIT(file, flags, pool, apr_file_cleanup) diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 42025f5c752..33e14cf5751 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -61,7 +61,7 @@ #include #include -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) { ULONG filedes[2]; ULONG rc, action; @@ -91,7 +91,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return APR_OS2_STATUS(rc); } - (*in) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); + (*in) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); rc = DosCreateEventSem(NULL, &(*in)->pipeSem, DC_SEM_SHARED, FALSE); if (rc) { @@ -113,35 +113,35 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return APR_OS2_STATUS(rc); } - (*in)->cntxt = cont; + (*in)->pool = pool; (*in)->filedes = filedes[0]; - (*in)->fname = apr_pstrdup(cont, pipename); + (*in)->fname = apr_pstrdup(pool, pipename); (*in)->isopen = TRUE; (*in)->buffered = FALSE; (*in)->flags = 0; (*in)->pipe = 1; (*in)->timeout = -1; (*in)->blocking = BLK_ON; - apr_pool_cleanup_register(cont, *in, apr_file_cleanup, apr_pool_cleanup_null); + apr_pool_cleanup_register(pool, *in, apr_file_cleanup, apr_pool_cleanup_null); - (*out) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); - (*out)->cntxt = cont; + (*out) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); + (*out)->pool = pool; (*out)->filedes = filedes[1]; - (*out)->fname = apr_pstrdup(cont, pipename); + (*out)->fname = apr_pstrdup(pool, pipename); (*out)->isopen = TRUE; (*out)->buffered = FALSE; (*out)->flags = 0; (*out)->pipe = 1; (*out)->timeout = -1; (*out)->blocking = BLK_ON; - apr_pool_cleanup_register(cont, *out, apr_file_cleanup, apr_pool_cleanup_null); + apr_pool_cleanup_register(pool, *out, apr_file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *pool) { /* Not yet implemented, interface not suitable */ return APR_ENOTIMPL; diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 2e02d78a7d9..fe8003ed675 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -73,7 +73,7 @@ static apr_status_t dir_cleanup(void *thedir) } } -apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont) +apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *pool) { /* On some platforms (e.g., Linux+GNU libc), d_name[] in struct * dirent is declared with enough storage for the name. On other @@ -84,18 +84,18 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont (sizeof((*new)->entry->d_name) > 1 ? sizeof(struct dirent) : sizeof (struct dirent) + 255); - (*new) = (apr_dir_t *)apr_palloc(cont, sizeof(apr_dir_t)); + (*new) = (apr_dir_t *)apr_palloc(pool, sizeof(apr_dir_t)); - (*new)->cntxt = cont; - (*new)->dirname = apr_pstrdup(cont, dirname); + (*new)->pool = pool; + (*new)->dirname = apr_pstrdup(pool, dirname); (*new)->dirstruct = opendir(dirname); - (*new)->entry = apr_pcalloc(cont, dirent_size); + (*new)->entry = apr_pcalloc(pool, dirent_size); if ((*new)->dirstruct == NULL) { return errno; } else { - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), dir_cleanup, + apr_pool_cleanup_register((*new)->pool, (void *)(*new), dir_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -103,7 +103,7 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont apr_status_t apr_dir_close(apr_dir_t *thedir) { - return apr_pool_cleanup_run(thedir->cntxt, thedir, dir_cleanup); + return apr_pool_cleanup_run(thedir->pool, thedir, dir_cleanup); } apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, @@ -159,7 +159,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if (fspec[off - 1] != '/') fspec[off++] = '/'; apr_cpystrn(fspec + off, thedir->entry->d_name, sizeof(fspec) - off); - ret = apr_lstat(finfo, fspec, wanted, thedir->cntxt); + ret = apr_lstat(finfo, fspec, wanted, thedir->pool); } if (wanted && (ret == APR_SUCCESS || ret == APR_INCOMPLETE)) { @@ -170,7 +170,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, /* We don't bail because we fail to stat, when we are only -required- * to readdir... but the result will be APR_INCOMPLETE */ - finfo->cntxt = thedir->cntxt; + finfo->pool = thedir->pool; finfo->valid = 0; } @@ -192,7 +192,7 @@ apr_status_t apr_dir_rewind(apr_dir_t *thedir) return APR_SUCCESS; } -apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont) +apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *pool) { mode_t mode = apr_unix_perms2mode(perm); @@ -204,7 +204,7 @@ apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *co } } -apr_status_t apr_dir_remove(const char *path, apr_pool_t *cont) +apr_status_t apr_dir_remove(const char *path, apr_pool_t *pool) { if (rmdir(path) == 0) { return APR_SUCCESS; @@ -224,11 +224,11 @@ apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) } apr_status_t apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, - apr_pool_t *cont) + apr_pool_t *pool) { if ((*dir) == NULL) { - (*dir) = (apr_dir_t *)apr_pcalloc(cont, sizeof(apr_dir_t)); - (*dir)->cntxt = cont; + (*dir) = (apr_dir_t *)apr_pcalloc(pool, sizeof(apr_dir_t)); + (*dir)->pool = pool; } (*dir)->dirstruct = thedir; return APR_SUCCESS; diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 6b5d4677ad4..8b50488bf95 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -130,12 +130,12 @@ apr_fileperms_t apr_unix_mode2perms(mode_t mode) APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, apr_file_t *file) { - return apr_pool_userdata_get(data, key, file->cntxt); + return apr_pool_userdata_get(data, key, file->pool); } APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)) { - return apr_pool_userdata_set(data, key, cleanup, file->cntxt); + return apr_pool_userdata_set(data, key, cleanup, file->pool); } diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 87b76fdbb39..8c43de810c8 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -70,7 +70,7 @@ static apr_status_t _file_dup(apr_file_t **new_file, if ((*new_file) == NULL) { return APR_ENOMEM; } - (*new_file)->cntxt = p; + (*new_file)->pool = p; } else { /* We can't dup2 unless we have a valid new_file */ return APR_EINVAL; @@ -132,7 +132,7 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, /* we do this here as we don't want to double register an existing * apr_file_t for cleanup */ - apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), + apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), apr_unix_file_cleanup, apr_unix_file_cleanup); return rv; diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 15d029d09a6..1ca88bbb9ef 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -112,7 +112,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, struct stat info; if (fstat(thefile->filedes, &info) == 0) { - finfo->cntxt = thefile->cntxt; + finfo->pool = thefile->pool; finfo->fname = thefile->fname; fill_out_finfo(finfo, &info, wanted); return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; @@ -135,12 +135,12 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, apr_fileattrs_t attr_mask, - apr_pool_t *cont) + apr_pool_t *pool) { apr_status_t status; apr_finfo_t finfo; - status = apr_stat(&finfo, fname, APR_FINFO_PROT, cont); + status = apr_stat(&finfo, fname, APR_FINFO_PROT, pool); if (!APR_STATUS_IS_SUCCESS(status)) return status; @@ -184,7 +184,7 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *pool) { struct stat info; int srv; @@ -195,7 +195,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, srv = stat(fname, &info); if (srv == 0) { - finfo->cntxt = cont; + finfo->pool = pool; finfo->fname = fname; fill_out_finfo(finfo, &info, wanted); if (wanted & APR_FINFO_LINK) @@ -240,8 +240,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, /* Perhaps this becomes nothing but a macro? */ APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *pool) { - return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, cont); + return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, pool); } diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 2acf6043662..20cd1d1ba71 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -228,7 +228,7 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i apr_os_file_put(fp, &fd, flags, p); (*fp)->fname = apr_pstrdup(p, template); - apr_pool_cleanup_register((*fp)->cntxt, (void *)(*fp), + apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), apr_unix_file_cleanup, apr_unix_file_cleanup); #endif return APR_SUCCESS; diff --git a/file_io/unix/open.c b/file_io/unix/open.c index ff2d4071b38..95cbea085d9 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -90,15 +90,15 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, - apr_pool_t *cont) + apr_pool_t *pool) { int oflags = 0; #if APR_HAS_THREADS apr_status_t rv; #endif - (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); - (*new)->cntxt = cont; + (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*new)->pool = pool; (*new)->flags = flag; (*new)->filedes = -1; @@ -115,17 +115,17 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, return APR_EACCES; } - (*new)->fname = apr_pstrdup(cont, fname); + (*new)->fname = apr_pstrdup(pool, fname); (*new)->blocking = BLK_ON; (*new)->buffered = (flag & APR_BUFFERED) > 0; if ((*new)->buffered) { - (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); + (*new)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); #if APR_HAS_THREADS if ((*new)->flags & APR_XTHREAD) { rv = apr_thread_mutex_create(&((*new)->thlock), - APR_THREAD_MUTEX_DEFAULT, cont); + APR_THREAD_MUTEX_DEFAULT, pool); if (rv) { return rv; } @@ -176,7 +176,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, (*new)->direction = 0; if (!(flag & APR_FILE_NOCLEANUP)) { - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + apr_pool_cleanup_register((*new)->pool, (void *)(*new), apr_unix_file_cleanup, apr_unix_file_cleanup); } return APR_SUCCESS; @@ -184,10 +184,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) { - return apr_pool_cleanup_run(file->cntxt, file, apr_unix_file_cleanup); + return apr_pool_cleanup_run(file->pool, file, apr_unix_file_cleanup); } -APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool) { if (unlink(path) == 0) { return APR_SUCCESS; @@ -216,12 +216,12 @@ APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, - apr_int32_t flags, apr_pool_t *cont) + apr_int32_t flags, apr_pool_t *pool) { int *dafile = thefile; - (*file) = apr_pcalloc(cont, sizeof(apr_file_t)); - (*file)->cntxt = cont; + (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file)->pool = pool; (*file)->eof_hit = 0; (*file)->buffered = 0; (*file)->blocking = BLK_UNKNOWN; /* in case it is a pipe */ @@ -244,31 +244,31 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) } APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, - apr_pool_t *cont) + apr_pool_t *pool) { int fd = STDERR_FILENO; - return apr_os_file_put(thefile, &fd, 0, cont); + return apr_os_file_put(thefile, &fd, 0, pool); } APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, - apr_pool_t *cont) + apr_pool_t *pool) { int fd = STDOUT_FILENO; - return apr_os_file_put(thefile, &fd, 0, cont); + return apr_os_file_put(thefile, &fd, 0, pool); } APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, - apr_pool_t *cont) + apr_pool_t *pool) { int fd = STDIN_FILENO; - return apr_os_file_put(thefile, &fd, 0, cont); + return apr_os_file_put(thefile, &fd, 0, pool); } -APR_IMPLEMENT_SET_INHERIT(file, flags, cntxt, apr_unix_file_cleanup) +APR_IMPLEMENT_SET_INHERIT(file, flags, pool, apr_unix_file_cleanup) -APR_IMPLEMENT_UNSET_INHERIT(file, flags, cntxt, apr_unix_file_cleanup) +APR_IMPLEMENT_UNSET_INHERIT(file, flags, pool, apr_unix_file_cleanup) -APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt) +APR_POOL_IMPLEMENT_ACCESSOR(file) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index d00e4adf846..8672c632d4a 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -168,7 +168,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int return APR_EINVAL; } -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) { int filedes[2]; @@ -176,8 +176,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return errno; } - (*in) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); - (*in)->cntxt = cont; + (*in) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*in)->pool = pool; (*in)->filedes = filedes[0]; (*in)->pipe = 1; (*in)->fname = NULL; @@ -189,8 +189,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->thlock = NULL; #endif - (*out) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); - (*out)->cntxt = cont; + (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*out)->pool = pool; (*out)->filedes = filedes[1]; (*out)->pipe = 1; (*out)->fname = NULL; @@ -201,15 +201,15 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->thlock = NULL; #endif - apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), apr_unix_file_cleanup, + apr_pool_cleanup_register((*in)->pool, (void *)(*in), apr_unix_file_cleanup, apr_pool_cleanup_null); - apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), apr_unix_file_cleanup, + apr_pool_cleanup_register((*out)->pool, (void *)(*out), apr_unix_file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, - apr_fileperms_t perm, apr_pool_t *cont) + apr_fileperms_t perm, apr_pool_t *pool) { mode_t mode = apr_unix_perms2mode(perm); diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 50a9f3666f4..39e23f6bd7d 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -84,14 +84,14 @@ static apr_status_t dir_cleanup(void *thedir) } APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, - apr_pool_t *cont) + apr_pool_t *pool) { int len = strlen(dirname); - (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); + (*new) = apr_pcalloc(pool, sizeof(apr_dir_t)); /* Leave room here to add and pop the '*' wildcard for FindFirstFile * and double-null terminate so we have one character to change. */ - (*new)->dirname = apr_palloc(cont, len + 3); + (*new)->dirname = apr_palloc(pool, len + 3); memcpy((*new)->dirname, dirname, len); if (len && (*new)->dirname[len - 1] != '/') { (*new)->dirname[len++] = '/'; @@ -104,8 +104,8 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, { /* Create a buffer for the longest file name we will ever see */ - (*new)->w.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); - (*new)->name = apr_pcalloc(cont, APR_FILE_MAX * 3 + 1); + (*new)->w.entry = apr_pcalloc(pool, sizeof(WIN32_FIND_DATAW)); + (*new)->name = apr_pcalloc(pool, APR_FILE_MAX * 3 + 1); } #endif #if APR_HAS_ANSI_FS @@ -121,20 +121,20 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, (*new) = NULL; return APR_ENAMETOOLONG; } - (*new)->n.entry = apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW)); + (*new)->n.entry = apr_pcalloc(pool, sizeof(WIN32_FIND_DATAW)); } #endif (*new)->rootlen = len - 1; - (*new)->cntxt = cont; + (*new)->pool = pool; (*new)->dirhand = INVALID_HANDLE_VALUE; - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), dir_cleanup, + apr_pool_cleanup_register((*new)->pool, (void *)(*new), dir_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *dir) { - apr_pool_cleanup_kill(dir->cntxt, dir, dir_cleanup); + apr_pool_cleanup_kill(dir->pool, dir, dir_cleanup); return dir_cleanup(dir); } @@ -215,7 +215,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) thedir->w.entry, 0, wanted); - finfo->cntxt = thedir->cntxt; + finfo->pool = thedir->pool; finfo->valid |= APR_FINFO_NAME; finfo->name = fname; @@ -270,7 +270,7 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *dir) } APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, - apr_pool_t *cont) + apr_pool_t *pool) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE @@ -295,7 +295,7 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE @@ -332,7 +332,7 @@ APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, - apr_pool_t *cont) + apr_pool_t *pool) { return APR_ENOTIMPL; } diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 7970f8ba645..524d1139479 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -77,12 +77,12 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, (*new_file) = (apr_file_t *) apr_pcalloc(p, sizeof(apr_file_t)); (*new_file)->filehand = newhand; (*new_file)->flags = old_file->flags & ~APR_INHERIT; - (*new_file)->cntxt = p; + (*new_file)->pool = p; (*new_file)->fname = apr_pstrdup(p, old_file->fname); (*new_file)->append = old_file->append; (*new_file)->buffered = FALSE; - apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), file_cleanup, + apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; @@ -142,7 +142,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, new_file->flags = newflags; new_file->filehand = newhand; - new_file->fname = apr_pstrdup(new_file->cntxt, old_file->fname); + new_file->fname = apr_pstrdup(new_file->pool, old_file->fname); new_file->append = old_file->append; new_file->buffered = FALSE; diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 686c7faa475..0dadf4bb7f0 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -155,7 +155,7 @@ static void resolve_prot(apr_finfo_t *finfo, apr_int32_t wanted, PACL dacl) } static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *pool) { apr_file_t *thefile = NULL; apr_status_t rv; @@ -172,7 +172,7 @@ static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname, ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0) | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) ? APR_READCONTROL : 0), - APR_OS_DEFAULT, cont)) == APR_SUCCESS) { + APR_OS_DEFAULT, pool)) == APR_SUCCESS) { rv = apr_file_info_get(finfo, wanted, thefile); finfo->filehand = NULL; apr_file_close(thefile); @@ -184,7 +184,7 @@ static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname, */ if ((rv = apr_file_open(&thefile, fname, ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0), - APR_OS_DEFAULT, cont)) == APR_SUCCESS) { + APR_OS_DEFAULT, pool)) == APR_SUCCESS) { rv = apr_file_info_get(finfo, wanted & ~(APR_FINFO_PROT | APR_FINFO_OWNER), thefile); @@ -281,7 +281,7 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, else return APR_INCOMPLETE; if (rv == ERROR_SUCCESS) - apr_pool_cleanup_register(finfo->cntxt, pdesc, free_localheap, + apr_pool_cleanup_register(finfo->pool, pdesc, free_localheap, apr_pool_cleanup_null); else user = grp = dacl = NULL; @@ -414,7 +414,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want } } - finfo->cntxt = thefile->cntxt; + finfo->pool = thefile->pool; /* Extra goodies known only by GetFileInformationByHandle() */ finfo->inode = (apr_ino_t)FileInfo.nFileIndexLow @@ -440,7 +440,7 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, } APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *pool) { /* XXX: is constant - needs testing - which requires a lighter-weight root test fn */ int isroot = 0; @@ -474,7 +474,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * to the get file info by handle method. If we fail, or the user * also asks for the file name, continue by our usual means. */ - if ((ident_rv = resolve_ident(finfo, fname, wanted, cont)) + if ((ident_rv = resolve_ident(finfo, fname, wanted, pool)) == APR_SUCCESS) return ident_rv; else if (ident_rv == APR_INCOMPLETE) @@ -509,7 +509,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, FileInfo.w.cFileName)) { return APR_ENAMETOOLONG; } - filename = apr_pstrdup(cont, tmpname); + filename = apr_pstrdup(pool, tmpname); } } #endif @@ -530,7 +530,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, */ if (GetDriveType(fname) != DRIVE_UNKNOWN) { - finfo->cntxt = cont; + finfo->pool = pool; finfo->filetype = 0; finfo->mtime = apr_time_now(); finfo->protection |= APR_WREAD | APR_WEXECUTE | APR_WWRITE; @@ -556,7 +556,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, return apr_get_os_error(); } FindClose(hFind); - filename = apr_pstrdup(cont, FileInfo.n.cFileName); + filename = apr_pstrdup(pool, FileInfo.n.cFileName); } #endif @@ -592,7 +592,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, #endif } } - finfo->cntxt = cont; + finfo->pool = pool; } if (filename && !isroot) { @@ -613,15 +613,15 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, } APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) + apr_int32_t wanted, apr_pool_t *pool) { - return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, cont); + return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, pool); } APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, apr_fileattrs_t attr_mask, - apr_pool_t *cont) + apr_pool_t *pool) { DWORD flags; apr_status_t rv; diff --git a/file_io/win32/open.c b/file_io/win32/open.c index f50501b10aa..e0615076b0c 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -278,7 +278,7 @@ apr_status_t file_cleanup(void *thefile) APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, - apr_pool_t *cont) + apr_pool_t *pool) { HANDLE handle = INVALID_HANDLE_VALUE; DWORD oflags = 0; @@ -359,10 +359,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, return apr_get_os_error(); } - (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); - (*new)->cntxt = cont; + (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*new)->pool = pool; (*new)->filehand = handle; - (*new)->fname = apr_pstrdup(cont, fname); + (*new)->fname = apr_pstrdup(pool, fname); (*new)->flags = flag; if (flag & APR_APPEND) { @@ -375,13 +375,13 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, if (flag & APR_BUFFERED) { (*new)->buffered = 1; - (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); + (*new)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); rv = apr_thread_mutex_create(&(*new)->mutex, APR_THREAD_MUTEX_DEFAULT, - cont); + pool); if (rv) { if (file_cleanup(*new) == APR_SUCCESS) { - apr_pool_cleanup_kill(cont, *new, file_cleanup); + apr_pool_cleanup_kill(pool, *new, file_cleanup); } return rv; } @@ -404,7 +404,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, (*new)->filePtr = 0; if (!(flag & APR_FILE_NOCLEANUP)) { - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), file_cleanup, + apr_pool_cleanup_register((*new)->pool, (void *)(*new), file_cleanup, apr_pool_cleanup_null); } return APR_SUCCESS; @@ -414,7 +414,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) { apr_status_t stat; if ((stat = file_cleanup(file)) == APR_SUCCESS) { - apr_pool_cleanup_kill(file->cntxt, file, file_cleanup); + apr_pool_cleanup_kill(file->pool, file, file_cleanup); if (file->buffered) apr_thread_mutex_destroy(file->mutex); @@ -424,7 +424,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) return stat; } -APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE @@ -449,7 +449,7 @@ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont) APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, const char *topath, - apr_pool_t *cont) + apr_pool_t *pool) { IF_WIN_OS_IS_UNICODE { @@ -512,10 +512,10 @@ APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_int32_t flags, - apr_pool_t *cont) + apr_pool_t *pool) { - (*file) = apr_pcalloc(cont, sizeof(apr_file_t)); - (*file)->cntxt = cont; + (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file)->pool = pool; (*file)->filehand = *thefile; (*file)->ungetchar = -1; /* no char avail */ (*file)->flags; @@ -530,7 +530,7 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *pool) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -547,11 +547,11 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t return rv; } - return apr_os_file_put(thefile, &file_handle, 0, cont); + return apr_os_file_put(thefile, &file_handle, 0, pool); #endif } -APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *pool) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -568,11 +568,11 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t return rv; } - return apr_os_file_put(thefile, &file_handle, 0, cont); + return apr_os_file_put(thefile, &file_handle, 0, pool); #endif } -APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -589,11 +589,11 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t * return rv; } - return apr_os_file_put(thefile, &file_handle, 0, cont); + return apr_os_file_put(thefile, &file_handle, 0, pool); #endif } -APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt); +APR_POOL_IMPLEMENT_ACCESSOR(file); APR_DECLARE_SET_INHERIT(file) { return; diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 1f1fd5ca406..9d1a1284126 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -99,7 +99,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out sa.lpSecurityDescriptor = NULL; (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); - (*in)->cntxt = p; + (*in)->pool = p; (*in)->fname = NULL; (*in)->pipe = 1; (*in)->timeout = -1; @@ -111,7 +111,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->direction = 0; (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); - (*out)->cntxt = p; + (*out)->pool = p; (*in)->fname = NULL; (*out)->pipe = 1; (*out)->timeout = -1; @@ -126,9 +126,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return apr_get_os_error(); } - apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), file_cleanup, + apr_pool_cleanup_register((*in)->pool, (void *)(*in), file_cleanup, apr_pool_cleanup_null); - apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), file_cleanup, + apr_pool_cleanup_register((*out)->pool, (void *)(*out), file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; #endif @@ -172,7 +172,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, sa.lpSecurityDescriptor = NULL; (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); - (*in)->cntxt = p; + (*in)->pool = p; (*in)->fname = NULL; (*in)->pipe = 1; (*in)->timeout = -1; @@ -185,7 +185,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, (*in)->pOverlapped = NULL; (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); - (*out)->cntxt = p; + (*out)->pool = p; (*out)->fname = NULL; (*out)->pipe = 1; (*out)->timeout = -1; @@ -242,9 +242,9 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, } } - apr_pool_cleanup_register((*in)->cntxt, (void *)(*in), file_cleanup, + apr_pool_cleanup_register((*in)->pool, (void *)(*in), file_cleanup, apr_pool_cleanup_null); - apr_pool_cleanup_register((*out)->cntxt, (void *)(*out), file_cleanup, + apr_pool_cleanup_register((*out)->pool, (void *)(*out), file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; #endif /* _WIN32_WCE */ diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index b93fd60356a..fa29734e760 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -173,7 +173,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size * Threads should NOT share an apr_file_t or its hEvent. */ if ((thefile->flags & APR_XTHREAD) && !thefile->pOverlapped ) { - thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->cntxt, + thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->pool, sizeof(OVERLAPPED)); thefile->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); if (!thefile->pOverlapped->hEvent) { @@ -258,7 +258,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a * Threads should NOT share an apr_file_t or its hEvent. */ if ((thefile->flags & APR_XTHREAD) && !thefile->pOverlapped ) { - thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->cntxt, + thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->pool, sizeof(OVERLAPPED)); thefile->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); if (!thefile->pOverlapped->hEvent) { diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 7e5e1f8f341..8ccb407cf39 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -180,7 +180,7 @@ typedef struct apr_finfo_t apr_finfo_t; */ struct apr_finfo_t { /** Allocates memory and closes lingering handles in the specified pool */ - apr_pool_t *cntxt; + apr_pool_t *pool; /** The bitmask describing valid fields of this apr_finfo_t structure * including all available 'wanted' fields and potentially more */ apr_int32_t valid; diff --git a/include/arch/netware/fileio.h b/include/arch/netware/fileio.h index 96f1fe307c1..93a112b0a76 100644 --- a/include/arch/netware/fileio.h +++ b/include/arch/netware/fileio.h @@ -107,7 +107,7 @@ #define APR_FILE_BUFSIZE 4096 struct apr_file_t { - apr_pool_t *cntxt; + apr_pool_t *pool; int filedes; char *fname; apr_int32_t flags; @@ -130,7 +130,7 @@ struct apr_file_t { }; struct apr_dir_t { - apr_pool_t *cntxt; + apr_pool_t *pool; char *dirname; DIR *dirstruct; struct dirent *entry; diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index 61e54cfba97..6ecfea9e7f6 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -71,7 +71,7 @@ #define APR_FILE_BUFSIZE 4096 struct apr_file_t { - apr_pool_t *cntxt; + apr_pool_t *pool; HFILE filedes; char * fname; int isopen; @@ -93,7 +93,7 @@ struct apr_file_t { }; struct apr_dir_t { - apr_pool_t *cntxt; + apr_pool_t *pool; char *dirname; ULONG handle; FILEFINDBUF3 entry; diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 6579e260785..14348084f1c 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -120,7 +120,7 @@ #define APR_FILE_BUFSIZE 4096 struct apr_file_t { - apr_pool_t *cntxt; + apr_pool_t *pool; int filedes; char *fname; apr_int32_t flags; @@ -143,7 +143,7 @@ struct apr_file_t { }; struct apr_dir_t { - apr_pool_t *cntxt; + apr_pool_t *pool; char *dirname; DIR *dirstruct; struct dirent *entry; diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 63bc66a51f3..99443c8d1aa 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -186,7 +186,7 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, */ struct apr_file_t { - apr_pool_t *cntxt; + apr_pool_t *pool; HANDLE filehand; BOOLEAN pipe; // Is this a pipe of a file? OVERLAPPED *pOverlapped; @@ -214,7 +214,7 @@ struct apr_file_t { }; struct apr_dir_t { - apr_pool_t *cntxt; + apr_pool_t *pool; HANDLE dirhand; apr_size_t rootlen; char *dirname; diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index 29c70572d8d..99be46fb886 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -401,9 +401,9 @@ apr_status_t apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key */ apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file) { - (*newsock) = apr_pcalloc(file->cntxt, sizeof(**newsock)); + (*newsock) = apr_pcalloc(file->pool, sizeof(**newsock)); (*newsock)->socketdes = file->filedes; - (*newsock)->cntxt = file->cntxt; + (*newsock)->cntxt = file->pool; (*newsock)->timeout = file->timeout; return APR_SUCCESS; } From d08b8264f6935c6fd625ba4f7fe34a0f59824cb0 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 20 Mar 2002 09:01:24 +0000 Subject: [PATCH 3158/7878] Move the pool accessor macros to before we do any includes that depend on pools. This allows us to use APR_POOL_DECLARE_ACCESSOR in apr_thread_mutex.h again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63165 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 72 ++++++++++++++++++++------------------ include/apr_thread_mutex.h | 11 +----- 2 files changed, 38 insertions(+), 45 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 41806e1f2d8..ec82b1eea98 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -89,6 +89,43 @@ extern "C" { /** The fundamental pool type */ typedef struct apr_pool_t apr_pool_t; + +/** + * Pool accessor functions. + * + * These standardized function are used by opaque (APR) data types to return + * the apr_pool_t that is associated with the data type. + * + * APR_POOL_DECLARE_ACCESSOR() is used in a header file to declare the + * accessor function. A typical usage and result would be: + * + * APR_POOL_DECLARE_ACCESSOR(file); + * becomes: + * APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob); + * + * In the implementation, the APR_POOL_IMPLEMENT_ACCESSOR() is used to + * actually define the function. It assumes the field is named "pool". For + * data types with a different field name (e.g. "cont" or "cntxt") the + * APR_POOL_IMPLEMENT_ACCESSOR_X() macro should be used. + * + * Note: the linkage is specified for APR. It would be possible to expand + * the macros to support other linkages. + */ + +#define APR_POOL_DECLARE_ACCESSOR(typename) \ + APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ + (const apr_##typename##_t *ob) + +/** used to implement the pool accessor */ +#define APR_POOL_IMPLEMENT_ACCESSOR(typename) \ + APR_POOL_IMPLEMENT_ACCESSOR_X(typename, pool) + +/** used to implement the pool accessor */ +#define APR_POOL_IMPLEMENT_ACCESSOR_X(typename, fieldname) \ + APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ + (const apr_##typename##_t *ob) { return ob->fieldname; } + + #include "apr_allocator.h" /** @@ -637,41 +674,6 @@ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); #endif /* APR_POOL_DEBUG or DOXYGEN */ -/** - * Pool accessor functions. - * - * These standardized function are used by opaque (APR) data types to return - * the apr_pool_t that is associated with the data type. - * - * APR_POOL_DECLARE_ACCESSOR() is used in a header file to declare the - * accessor function. A typical usage and result would be: - * - * APR_POOL_DECLARE_ACCESSOR(file); - * becomes: - * APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob); - * - * In the implementation, the APR_POOL_IMPLEMENT_ACCESSOR() is used to - * actually define the function. It assumes the field is named "pool". For - * data types with a different field name (e.g. "cont" or "cntxt") the - * APR_POOL_IMPLEMENT_ACCESSOR_X() macro should be used. - * - * Note: the linkage is specified for APR. It would be possible to expand - * the macros to support other linkages. - */ - -#define APR_POOL_DECLARE_ACCESSOR(typename) \ - APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ - (const apr_##typename##_t *ob) - -/** used to implement the pool accessor */ -#define APR_POOL_IMPLEMENT_ACCESSOR(typename) \ - APR_POOL_IMPLEMENT_ACCESSOR_X(typename, pool) - -/** used to implement the pool accessor */ -#define APR_POOL_IMPLEMENT_ACCESSOR_X(typename, fieldname) \ - APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ - (const apr_##typename##_t *ob) { return ob->fieldname; } - /** @} */ #ifdef __cplusplus } diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 5d4358dcfca..e7fdb1ba5a7 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -127,16 +127,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex); * Get the pool used by this thread_mutex. * @return apr_pool_t the pool */ -/* - * XXX: We should do: - * - * APR_POOL_DECLARE_ACCESSOR(thread_mutex); - * - * But since there is a dependency between apr_thread_mutex.h, apr_pools.h - * and apr_allocator.h, this won't work without lots of warnings. Spelling - * it out resolves the problem. - */ -APR_DECLARE(apr_pool_t *) apr_thread_mutex_pool_get (const apr_thread_mutex_t *ob); +APR_POOL_DECLARE_ACCESSOR(thread_mutex); #endif /* APR_HAS_THREADS */ From c141cbe5bdfbb0a4e767b4dca298a44005bd49fc Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 20 Mar 2002 19:45:02 +0000 Subject: [PATCH 3159/7878] Load libraries if they not MH_BUNDLE, but if they are not, it just attempts to link them as shared libs. This is required to get the JVM loaded through APR. Submitted by: Pier Fumagalli Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63166 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ dso/unix/dso.c | 36 +++++++++++++++++++++++++----------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index e960cf70a68..1cb488d8abf 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Load libraries if they not MH_BUNDLE, but if they are not, it + just attempts to link them as shared libs. + [Pier Fumagalli ] + + *) apr_atomic_dec now returns a zero value if the value of the atomic is zero, non-zero otherwise [Ian Holsman] diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 69fd8c4013e..944fafe152d 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -72,6 +72,10 @@ #include /* for strerror() on HP-UX */ #endif +#if defined(DSO_USE_DYLD) +#define DYLD_LIBRARY_HANDLE (void *)-1 +#endif + APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, apr_os_dso_handle_t osdso, apr_pool_t *pool) @@ -99,7 +103,9 @@ static apr_status_t dso_cleanup(void *thedso) #if defined(DSO_USE_SHL) shl_unload((shl_t)dso->handle); #elif defined(DSO_USE_DYLD) - NSUnLinkModule(dso->handle, FALSE); + if (dso->handle != DYLD_LIBRARY_HANDLE) { + NSUnLinkModule(dso->handle, FALSE); + } #elif defined(DSO_USE_DLFCN) if (dlclose(dso->handle) != 0) return APR_EINIT; @@ -119,18 +125,21 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, NSObjectFileImage image; NSModule os_handle = NULL; char* err_msg = NULL; - if (NSCreateObjectFileImageFromFile(path, &image) != NSObjectFileImageSuccess) { - err_msg = "cannot create object file image"; - } - else { + if (NSCreateObjectFileImageFromFile(path, &image) == NSObjectFileImageSuccess) { #ifdef NSLINKMODULE_OPTION_PRIVATE - os_handle = NSLinkModule(image, path, - NSLINKMODULE_OPTION_PRIVATE | - NSLINKMODULE_OPTION_RETURN_ON_ERROR); + os_handle = NSLinkModule(image, path, + NSLINKMODULE_OPTION_PRIVATE | + NSLINKMODULE_OPTION_RETURN_ON_ERROR); #else - os_handle = NSLinkModule(image, path, TRUE); + os_handle = NSLinkModule(image, path, TRUE); #endif - NSDestroyObjectFileImage(image); + NSDestroyObjectFileImage(image); + } + else if (NSAddLibrary(path) == TRUE) { + os_handle = (NSModule)DYLD_LIBRARY_HANDLE; + } + else { + err_msg = "cannot create object file image or add library"; } #elif defined(DSO_USE_DLFCN) @@ -208,7 +217,12 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, char *symname2 = (char*)malloc(sizeof(char)*(strlen(symname)+2)); sprintf(symname2, "_%s", symname); #ifdef NSLINKMODULE_OPTION_PRIVATE - symbol = NSLookupSymbolInModule((NSModule)handle->handle, symname2); + if (handle->handle == DYLD_LIBRARY_HANDLE) { + symbol = NSLookupAndBindSymbol(symname2); + } + else { + symbol = NSLookupSymbolInModule((NSModule)handle->handle, symname2); + } #else symbol = NSLookupAndBindSymbol(symname2); #endif From 3434fbe3485e2903e430f64e17a91dd00ac22940 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 20 Mar 2002 19:50:20 +0000 Subject: [PATCH 3160/7878] Added an extra blank line by mistake. Submitted by: Justin Erenkrantz. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63167 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGES b/CHANGES index 1cb488d8abf..b6c3d9849fa 100644 --- a/CHANGES +++ b/CHANGES @@ -4,7 +4,6 @@ Changes with APR b1 just attempts to link them as shared libs. [Pier Fumagalli ] - *) apr_atomic_dec now returns a zero value if the value of the atomic is zero, non-zero otherwise [Ian Holsman] From 6fe70242a5b8513e1e452dde4d223fb7330986f5 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Wed, 20 Mar 2002 21:19:55 +0000 Subject: [PATCH 3161/7878] don't mask SIGUSR2. some debuggers (purify) use it PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63168 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 6d2a1249536..e20cd93391d 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -301,6 +301,9 @@ static void remove_sync_sigs(sigset_t *sig_mask) #ifdef SIGTRAP sigdelset(sig_mask, SIGTRAP); #endif +#ifdef SIGUSR2 + sigdelset(sig_mask, SIGUSR2); +#endif } APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)) From 0f6a120810fbd691c3002e415ff694e7d48a1950 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Wed, 20 Mar 2002 21:30:08 +0000 Subject: [PATCH 3162/7878] dont mask SIGUSR2. it is required by purify PR: Obtained from: Submitted by: Jin Hong Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63169 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES b/CHANGES index b6c3d9849fa..62411fcd97f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,5 @@ Changes with APR b1 + *) Don't mask SIGUSR2 [Jin Hong ] *) Load libraries if they not MH_BUNDLE, but if they are not, it just attempts to link them as shared libs. From 46a0ed4ca02ec8679728a0753228fb3a85bc38de Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 20 Mar 2002 21:47:55 +0000 Subject: [PATCH 3163/7878] add a comment distinguishing between SIGUSR2 and the synchronous signals which we absolutely must avoid blocking git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63170 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index e20cd93391d..d53e604763c 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -301,6 +301,14 @@ static void remove_sync_sigs(sigset_t *sig_mask) #ifdef SIGTRAP sigdelset(sig_mask, SIGTRAP); #endif + +/* the rest of the signals removed from the mask in this function + * absolutely must be removed; you cannot block synchronous signals + * (requirement of pthreads API) + * + * SIGUSR2 is being removed from the mask for the convenience of + * Purify users (Solaris, HP-UX, SGI) since Purify uses SIGUSR2 + */ #ifdef SIGUSR2 sigdelset(sig_mask, SIGUSR2); #endif From b16a6e41b57d93cfd980cd90c510e00db8152967 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 21 Mar 2002 01:29:55 +0000 Subject: [PATCH 3164/7878] Fix a missed cntxt -> pool change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63171 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/threadproc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/threadproc.h index 12db303b055..d152a848444 100644 --- a/include/arch/os2/threadproc.h +++ b/include/arch/os2/threadproc.h @@ -78,7 +78,7 @@ struct apr_thread_t { }; struct apr_threadkey_t { - apr_pool_t *cntxt; + apr_pool_t *pool; unsigned long *key; }; From 5351b39ae1227d06a7e8a5867b8a25bf09b2b15e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 21 Mar 2002 05:48:26 +0000 Subject: [PATCH 3165/7878] Fix several bugs in proc.c, especially around command.com which behaves differently than cmd.exe with respect to the /c command arg. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63172 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index c67958ba3ea..f4ea334839c 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -295,6 +295,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, char *pEnvBlock; PROCESS_INFORMATION pi; DWORD dwCreationFlags = 0; + char *ch; new->in = attr->parent_in; new->err = attr->parent_err; @@ -336,7 +337,11 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, i = 1; while (args && args[i]) { - if (strchr(args[i], ' ')) + for (ch = args[i]; *ch; ++ch) { + if (apr_iswhite(*ch)) { + break; + } + if (*ch) cmdline = apr_pstrcat(pool, cmdline, " \"", args[i], "\"", NULL); else cmdline = apr_pstrcat(pool, cmdline, " ", args[i], NULL); @@ -347,13 +352,31 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->cmdtype == APR_SHELLCMD) { char *shellcmd = getenv("COMSPEC"); - if (!shellcmd) - shellcmd = SHELL_PATH; - if (shellcmd[0] == '"') - progname = apr_pstrndup(pool, shellcmd + 1, strlen(shellcmd) - 1); - else if (strchr(shellcmd, ' ')) - shellcmd = apr_pstrcat(pool, "\"", shellcmd, "\"", NULL); - cmdline = apr_pstrcat(pool, shellcmd, " /C \"", cmdline, "\"", NULL); + if (!shellcmd) { + return APR_EINVAL; + } + if (shellcmd[0] == '"') { + progname = apr_pstrndup(pool, shellcmd + 1, strlen(shellcmd) - 2); + } + else { + progname = shellcmd; + for (ch = shellcmd; *ch; ++ch) { + if (apr_iswhite(*ch)) { + break; + } + if (*ch) + shellcmd = apr_pstrcat(pool, "\"", shellcmd, "\"", NULL); + } + } + /* Command.com does not support a quoted command, while cmd.exe demands one. + */ + i = strlen(progname); + if (i >= 11 && strcasecmp(progname + i - 11, "command.com") == 0) { + cmdline = apr_pstrcat(pool, shellcmd, " /C ", cmdline, NULL); + } + else { + cmdline = apr_pstrcat(pool, shellcmd, " /C \"", cmdline, "\"", NULL); + } } else { /* Win32 is _different_ than unix. While unix will find the given From fc5c701971437a29bc7c9f83dc73bafd8532decd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 21 Mar 2002 05:52:14 +0000 Subject: [PATCH 3166/7878] Now fix my typos ... teach me to trust my typing at midnight without compiling at least once. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63173 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index f4ea334839c..40fb5a70a02 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -295,7 +295,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, char *pEnvBlock; PROCESS_INFORMATION pi; DWORD dwCreationFlags = 0; - char *ch; + const char *ch; new->in = attr->parent_in; new->err = attr->parent_err; @@ -338,13 +338,16 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, i = 1; while (args && args[i]) { for (ch = args[i]; *ch; ++ch) { - if (apr_iswhite(*ch)) { + if (isspace(*ch)) { break; + } } - if (*ch) + if (*ch) { cmdline = apr_pstrcat(pool, cmdline, " \"", args[i], "\"", NULL); - else + } + else { cmdline = apr_pstrcat(pool, cmdline, " ", args[i], NULL); + } i++; } @@ -361,10 +364,11 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, else { progname = shellcmd; for (ch = shellcmd; *ch; ++ch) { - if (apr_iswhite(*ch)) { + if (isspace(*ch)) { break; + } } - if (*ch) + if (*ch) { shellcmd = apr_pstrcat(pool, "\"", shellcmd, "\"", NULL); } } From 273b011d53805812088922f4654dd6ea5c93561e Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 21 Mar 2002 08:38:37 +0000 Subject: [PATCH 3167/7878] Remove the APR_POOL_IMPLEMENT_ACCESSOR_X macro, since it isn't used anywhere anymore. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63174 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index ec82b1eea98..b7b5b09c05f 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -104,9 +104,7 @@ typedef struct apr_pool_t apr_pool_t; * APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob); * * In the implementation, the APR_POOL_IMPLEMENT_ACCESSOR() is used to - * actually define the function. It assumes the field is named "pool". For - * data types with a different field name (e.g. "cont" or "cntxt") the - * APR_POOL_IMPLEMENT_ACCESSOR_X() macro should be used. + * actually define the function. It assumes the field is named "pool". * * Note: the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. @@ -118,12 +116,8 @@ typedef struct apr_pool_t apr_pool_t; /** used to implement the pool accessor */ #define APR_POOL_IMPLEMENT_ACCESSOR(typename) \ - APR_POOL_IMPLEMENT_ACCESSOR_X(typename, pool) - -/** used to implement the pool accessor */ -#define APR_POOL_IMPLEMENT_ACCESSOR_X(typename, fieldname) \ APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ - (const apr_##typename##_t *ob) { return ob->fieldname; } + (const apr_##typename##_t *ob) { return ob->pool; } #include "apr_allocator.h" From 7ad5487db918e710d9d4ed7349068cfc9fb04b30 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 21 Mar 2002 10:03:39 +0000 Subject: [PATCH 3168/7878] Rename apr_explode_gmt to apr_time_exp_gmt. Submitted by: Thom May git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63175 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 4 ++-- renames_pending | 1 - test/testtime.c | 2 +- time/unix/time.c | 7 ++++--- time/unix/timestr.c | 2 +- time/win32/time.c | 4 ++-- time/win32/timestr.c | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/apr_time.h b/include/apr_time.h index ef4901557dc..9aaf188dc57 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -158,8 +158,8 @@ APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, * @param result the exploded time * @param input the time to explode */ -APR_DECLARE(apr_status_t) apr_explode_gmt(apr_time_exp_t *result, - apr_time_t input); +APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, + apr_time_t input); /** * convert a time to its human readable components in local timezone diff --git a/renames_pending b/renames_pending index 66b70daed8a..8d93f2657ba 100644 --- a/renames_pending +++ b/renames_pending @@ -1,6 +1,5 @@ Symbol renames for APR -apr_time_exp_gmt from apr_explode_gmt apr_time_exp_lt from apr_explode_localtime apr_time_exp_tz from apr_explode_time diff --git a/test/testtime.c b/test/testtime.c index 784f7c40345..095ad9da591 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -83,7 +83,7 @@ int main(void) now = apr_time_now(); printf("OK\n"); - STD_TEST_NEQ(" apr_explode_gmt", apr_explode_gmt(&xt, now)) + STD_TEST_NEQ(" apr_time_exp_gmt", apr_time_exp_gmt(&xt, now)) STD_TEST_NEQ(" apr_explode_localtime", apr_explode_localtime(&xt2, now)) diff --git a/time/unix/time.c b/time/unix/time.c index c12ecb93569..96cf8a009d2 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -146,15 +146,16 @@ static void explode_time(apr_time_exp_t *xt, apr_time_t t, xt->tm_gmtoff = get_offset(&tm); } -APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, apr_time_t input, - apr_int32_t offs) +APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, + apr_time_t input, apr_int32_t offs) { explode_time(result, input, offs, 0); result->tm_gmtoff = offs; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_explode_gmt(apr_time_exp_t *result, apr_time_t input) +APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, + apr_time_t input) { return apr_explode_time(result, input, 0); } diff --git a/time/unix/timestr.c b/time/unix/timestr.c index f056b9c6f16..989f4836914 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -83,7 +83,7 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) const char *s; int real_year; - apr_explode_gmt(&xt, t); + apr_time_exp_gmt(&xt, t); /* example: "Sat, 08 Jan 2000 18:31:41 GMT" */ /* 12345678901234567890123456789 */ diff --git a/time/win32/time.c b/time/win32/time.c index 2286281150b..31fe28ffd4e 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -146,8 +146,8 @@ APR_DECLARE(apr_time_t) apr_time_now(void) return aprtime; } -APR_DECLARE(apr_status_t) apr_explode_gmt(apr_time_exp_t *result, - apr_time_t input) +APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, + apr_time_t input) { FILETIME ft; SYSTEMTIME st; diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 1ba9f1b1d71..8bfcd84e99f 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -71,7 +71,7 @@ APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t) const char *s; int real_year; - apr_explode_gmt(&xt, t); + apr_time_exp_gmt(&xt, t); /* example: "Sat, 08 Jan 2000 18:31:41 GMT" */ /* 12345678901234567890123456789 */ From 483d9df9f9a5cc58f67609f4d38defeca7a30017 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 21 Mar 2002 10:16:45 +0000 Subject: [PATCH 3169/7878] Style Polices moved through quickly. Surely not all offenders were caught ;) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63176 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/time/unix/time.c b/time/unix/time.c index 96cf8a009d2..de74cfd27d8 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -100,8 +100,8 @@ static apr_int32_t get_offset(struct tm *tm) #endif } -APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, - time_t input) +APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, + time_t input) { *result = (apr_time_t)input * APR_USEC_PER_SEC; return APR_SUCCESS; @@ -146,21 +146,22 @@ static void explode_time(apr_time_exp_t *xt, apr_time_t t, xt->tm_gmtoff = get_offset(&tm); } -APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, - apr_time_t input, apr_int32_t offs) +APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, + apr_time_t input, apr_int32_t offs) { explode_time(result, input, offs, 0); result->tm_gmtoff = offs; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, - apr_time_t input) +APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, + apr_time_t input) { return apr_explode_time(result, input, 0); } -APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, apr_time_t input) +APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, + apr_time_t input) { #if defined(__EMX__) /* EMX gcc (OS/2) has a timezone global we can use */ @@ -210,7 +211,7 @@ APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, apr_time_exp_t *xt) return status; } -APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, +APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime) { (*ostime)->tv_usec = *aprtime % APR_USEC_PER_SEC; @@ -218,7 +219,7 @@ APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, +APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, apr_time_exp_t *aprtime) { (*ostime)->tm_sec = aprtime->tm_sec; @@ -230,15 +231,18 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, (*ostime)->tm_wday = aprtime->tm_wday; (*ostime)->tm_yday = aprtime->tm_yday; (*ostime)->tm_isdst = aprtime->tm_isdst; + #if HAVE_GMTOFF (*ostime)->tm_gmtoff = aprtime->tm_gmtoff; #elif defined(HAVE__OFFSET) (*ostime)->__tm_gmtoff = aprtime->tm_gmtoff; #endif + return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, +APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, + apr_os_imp_time_t **ostime, apr_pool_t *cont) { *aprtime = (*ostime)->tv_sec * APR_USEC_PER_SEC + (*ostime)->tv_usec; @@ -246,7 +250,8 @@ APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_ti } APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, - apr_os_exp_time_t **ostime, apr_pool_t *cont) + apr_os_exp_time_t **ostime, + apr_pool_t *cont) { aprtime->tm_sec = (*ostime)->tm_sec; aprtime->tm_min = (*ostime)->tm_min; @@ -257,11 +262,13 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, aprtime->tm_wday = (*ostime)->tm_wday; aprtime->tm_yday = (*ostime)->tm_yday; aprtime->tm_isdst = (*ostime)->tm_isdst; + #if HAVE_GMTOFF aprtime->tm_gmtoff = (*ostime)->tm_gmtoff; #elif defined(HAVE__OFFSET) aprtime->tm_gmtoff = (*ostime)->__tm_gmtoff; #endif + return APR_SUCCESS; } @@ -282,7 +289,8 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t) } #ifdef OS2 -APR_DECLARE(apr_status_t) apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, +APR_DECLARE(apr_status_t) apr_os2_time_to_apr_time(apr_time_t *result, + FDATE os2date, FTIME os2time) { struct tm tmpdate; From 1d02e8497fa5de3b6f71cc4824b3ff009ef1b7db Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 21 Mar 2002 19:31:41 +0000 Subject: [PATCH 3170/7878] Namespace protect the "local" variables in this m4/autoconf macro. Also, to satisfy the pedant in me, put {} delimiters around all the variables, and "" around the RHS of all assignments (in case of spaces). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63177 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index f6e32b7dc3c..e49b667ab96 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -570,14 +570,14 @@ dnl APR_EXPAND_VAR(fraz, $baz) dnl $fraz is now "1/2/3" dnl AC_DEFUN(APR_EXPAND_VAR,[ -last= -cur=$2 -while test "x$cur" != "x$last"; +ap_last= +ap_cur="$2" +while test "x${ap_cur}" != "x${ap_last}"; do - last=$cur - cur=`eval "echo $cur"` + ap_last="${ap_cur}" + ap_cur=`eval "echo ${ap_cur}"` done -$1=$cur +$1="${ap_cur}" ]) dnl @@ -589,14 +589,14 @@ dnl orig_path="${prefix}/bar" dnl APR_PATH_RELATIVE(final_path, $orig_path, $prefix) dnl $final_path now contains "bar" AC_DEFUN(APR_PATH_RELATIVE,[ -stripped=`echo $2 | sed -e "s#^$3##"` +ap_stripped="`echo $2 | sed -e "s#^$3##"`" # check if the stripping was successful -if test "x$2" != "x$stripped"; then +if test "x$2" != "x${ap_stripped}"; then # it was, so strip of any leading slashes - $1=`echo $stripped | sed -e 's#^/*##'` + $1="`echo ${ap_stripped} | sed -e 's#^/*##'`" else # it wasn't so return the original - $1=$2 + $1="$2" fi ]) From 0834d1ce68cdeba0b9fb618d774d59f86e744bb0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 22 Mar 2002 06:06:26 +0000 Subject: [PATCH 3171/7878] Address several issues. c_is_fnchar must be namespace protected [for linkage, not for external use], and this patch expands its use to include IS_SHCHAR() tests for apr_thread_proc.c in Win32. Also introduce apr_proc_t ->invoked member --- for logging or audit purposes alone, for platforms that create a single 'command' string. This doesn't adversly impact portability [have APR_HAS_PROC_INVOKED feature macro to assure other platforms don't struggle with it] but helps us measure portability when attempting to emulate execxx() behavior on Win32 [and perhaps OS2 at some point.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63178 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filesys.c | 26 +++++++++++++++++--------- include/apr.h.in | 1 + include/apr.hnw | 1 + include/apr.hw | 1 + include/apr_thread_proc.h | 12 +++++++++--- include/arch/win32/fileio.h | 9 ++++++--- 6 files changed, 35 insertions(+), 15 deletions(-) diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c index d837379f338..31689b40211 100644 --- a/file_io/win32/filesys.c +++ b/file_io/win32/filesys.c @@ -76,15 +76,23 @@ * Oddly, \x7f _is_ acceptable ;) */ -const char c_is_fnchar[256] = -{/* Reject all ctrl codes... */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - /* " * / : < > ? */ - 1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,0, 1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0, - /* \ */ - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1, - /* | */ - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1, +/* apr_c_is_fnchar[] maps Win32's file name and shell escape symbols + * + * element & 1 == valid file name character [excluding delimiters] + * element & 2 == character should be shell (caret) escaped from cmd.exe + * + * this must be in-sync with Apache httpd's gen_test_char.c for cgi escaping. + */ + +const char apr_c_is_fnchar[256] = +{/* Reject all ctrl codes... Escape \n and \r (ascii 10 and 13) */ + 0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + /* ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ + 1,1,2,1,3,3,3,3,3,3,2,1,1,1,1,0, 1,1,1,1,1,1,1,1,1,1,0,3,2,1,2,2, + /* @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ */ + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,3,2,3,3,1, + /* ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ */ + 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,3,2,3,3,1, /* High bit codes are accepted (subject to utf-8->Unicode xlation) */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, diff --git a/include/apr.h.in b/include/apr.h.in index 1f60001040d..3b00b43901c 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -138,6 +138,7 @@ #define APR_HAS_DSO @aprdso@ #define APR_HAS_SO_ACCEPTFILTER @acceptfilter@ #define APR_HAS_UNICODE_FS 0 +#define APR_HAS_PROC_INVOKED 0 #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 0 #define APR_HAS_XTHREAD_FILES 0 diff --git a/include/apr.hnw b/include/apr.hnw index 1b552f0c8d1..57a8da01c35 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -200,6 +200,7 @@ #define APR_HAS_DSO 1 #define APR_HAS_SO_ACCEPTFILTER 0 #define APR_HAS_UNICODE_FS 0 +#define APR_HAS_PROC_INVOKED 0 #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 0 #define APR_HAS_XTHREAD_FILES 0 diff --git a/include/apr.hw b/include/apr.hw index d4ca73b7122..a8905aa08e1 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -284,6 +284,7 @@ extern "C" { #define APR_HAS_DSO 1 #define APR_HAS_SO_ACCEPTFILTER 0 #define APR_HAS_UNICODE_FS 1 +#define APR_HAS_PROC_INVOKED 1 #ifndef _WIN32_WCE #define APR_HAS_SENDFILE 1 #define APR_HAS_USER 1 diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 5bbc0ede396..a722756a4b7 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -160,9 +160,15 @@ struct apr_proc_t { apr_file_t *out; /** Parent's side of pipe to child's stdouterr */ apr_file_t *err; -#ifdef WIN32 - /** Must retain the handle as any clone may not have the - * the same permissions +#if APR_HAS_PROC_INVOKED || defined(DOXYGEN) + /** Diagnositics/debugging string of the command invoked for + * this process [only present if APR_HAS_PROC_INVOKED is true] + */ + char *invoked; +#endif +#if defined(WIN32) || defined(DOXYGEN) + /** Win32 specific: Must retain the creator's handle granting + * access, as a new copy may not grant the same permissions */ HANDLE hproc; #endif diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 99443c8d1aa..c8a8747c094 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -233,11 +233,14 @@ struct apr_dir_t { }; }; -/* There are many goofy characters we can't accept. Here's the list. +/* There are many goofy characters the filesystem can't accept + * or can confound the cmd.exe shell. Here's the list + * [declared in filesys.c] */ -extern const char c_is_fnchar[256]; +extern const char apr_c_is_fnchar[256]; -#define IS_FNCHAR(c) c_is_fnchar[(unsigned char)c] +#define IS_FNCHAR(c) (apr_c_is_fnchar[(unsigned char)(c)] & 1) +#define IS_SHCHAR(c) (apr_c_is_fnchar[(unsigned char)(c)] & 2 == 2) /* If the user passes APR_FILEPATH_TRUENAME to either From a616125758e0135676697f985f1c24985fd8bec1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 22 Mar 2002 07:53:03 +0000 Subject: [PATCH 3172/7878] This appears correct, but I need at least three more pairs of eyes that the cmd.exe path is secure before I'd remove my -1 on beta. The command.com path gets even more tangled - I don't have the focus for that this morning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63179 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 150 +++++++++++++++++++++++++++++++--------- 1 file changed, 116 insertions(+), 34 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 40fb5a70a02..434158d884f 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -282,6 +282,48 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, return APR_SUCCESS; } +static const char* has_space(const char *str) +{ + const char *ch; + for (ch = str; *ch; ++ch) { + if (isspace(*ch)) { + return ch; + } + } + return NULL; +} + +static char *apr_caret_escape_args(apr_pool_t *p, const char *str) +{ + char *cmd; + unsigned char *d; + const unsigned char *s; + + cmd = apr_palloc(p, 2 * strlen(str) + 1); /* Be safe */ + d = (unsigned char *)cmd; + s = (const unsigned char *)str; + for (; *s; ++s) { + + /* + * Newlines to Win32/OS2 CreateProcess() are ill advised. + * Convert them to spaces since they are effectively white + * space to most applications + */ + if (*s == '\r' || *s == '\n') { + *d++ = ' '; + continue; + } + + if (IS_SHCHAR(*s)) { + *d++ = '^'; + } + *d++ = *s; + } + *d = '\0'; + + return cmd; +} + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, @@ -291,11 +333,11 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, { apr_status_t rv; apr_size_t i; + const char *argv0; char *cmdline; char *pEnvBlock; PROCESS_INFORMATION pi; DWORD dwCreationFlags = 0; - const char *ch; new->in = attr->parent_in; new->err = attr->parent_err; @@ -318,37 +360,38 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } } - /* progname must be the unquoted, actual name, or NULL if this is - * a 16 bit app running in the VDM or WOW context. - */ - if (progname[0] == '\"') { - progname = apr_pstrndup(pool, progname + 1, strlen(progname) - 2); - } - /* progname must be unquoted, in native format, as there are all sorts * of bugs in the NT library loader code that fault when parsing '/'. * We do not directly manipulate cmdline, and it will become a copy, * so we've casted past the constness issue. + * XXX progname must be NULL if this is a 16 bit app running in WOW */ - if (strchr(progname, ' ')) - cmdline = apr_pstrcat(pool, "\"", progname, "\"", NULL); - else - cmdline = (char*)progname; + if (progname[0] == '\"') { + progname = apr_pstrndup(pool, progname + 1, strlen(progname) - 2); + } - i = 1; - while (args && args[i]) { - for (ch = args[i]; *ch; ++ch) { - if (isspace(*ch)) { - break; - } - } - if (*ch) { + if ((rv = apr_filepath_merge(&cmdline, attr->currdir, progname, + APR_FILEPATH_NATIVE, pool)) != APR_SUCCESS) { + return rv; + } + progname = cmdline; + + if (has_space(progname)) { + argv0 = apr_pstrcat(pool, "\"", progname, "\"", NULL); + } + else { + argv0 = progname; + } + + /* Handle the args, seperate from argv0 */ + cmdline = ""; + for (i = 1; args && args[i]; ++i) { + if (has_space(args[i])) { cmdline = apr_pstrcat(pool, cmdline, " \"", args[i], "\"", NULL); } else { cmdline = apr_pstrcat(pool, cmdline, " ", args[i], NULL); } - i++; } /* ### how to handle APR_PROGRAM_ENV and APR_PROGRAM_PATH? */ @@ -363,12 +406,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } else { progname = shellcmd; - for (ch = shellcmd; *ch; ++ch) { - if (isspace(*ch)) { - break; - } - } - if (*ch) { + if (has_space(shellcmd)) { shellcmd = apr_pstrcat(pool, "\"", shellcmd, "\"", NULL); } } @@ -376,10 +414,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, */ i = strlen(progname); if (i >= 11 && strcasecmp(progname + i - 11, "command.com") == 0) { - cmdline = apr_pstrcat(pool, shellcmd, " /C ", cmdline, NULL); + cmdline = apr_pstrcat(pool, shellcmd, " /C ", argv0, cmdline, NULL); } else { - cmdline = apr_pstrcat(pool, shellcmd, " /C \"", cmdline, "\"", NULL); + cmdline = apr_pstrcat(pool, shellcmd, " /C \"", argv0, cmdline, "\"", NULL); } } else { @@ -389,13 +427,55 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * ###: This solution isn't much better - it may defeat path searching * when the path search was desired. Open to further discussion. */ - char *progpath; - apr_filepath_merge(&progpath, attr->currdir, progname, - APR_FILEPATH_NATIVE, pool); - progname = progpath; + i = strlen(progname); + if (i >= 4 && (strcasecmp(progname + i - 4, ".bat") == 0 + || strcasecmp(progname + i - 4, ".cmd") == 0)) + { + char *shellcmd = getenv("COMSPEC"); + if (!shellcmd) { + return APR_EINVAL; + } + if (shellcmd[0] == '"') { + progname = apr_pstrndup(pool, shellcmd + 1, strlen(shellcmd) - 2); + } + else { + progname = shellcmd; + if (has_space(shellcmd)) { + shellcmd = apr_pstrcat(pool, "\"", shellcmd, "\"", NULL); + } + } + i = strlen(progname); + if (i >= 11 && strcasecmp(progname + i - 11, "command.com") == 0) { + cmdline = apr_pstrcat(pool, shellcmd, " /C ", argv0, cmdline, NULL); + } + else { + /* We must protect the cmdline args from any interpolation - this + * is not a shellcmd, and the source of argv[] is untrusted. + * Notice we escape ALL the cmdline args, including the quotes + * around the individual args themselves. No sense in allowing + * the shift-state to be toggled, and the application will + * not see the caret escapes. + */ + cmdline = apr_caret_escape_args(pool, cmdline); + /* + * Our app name must always be quoted so the quotes surrounding + * the entire /c "command args" are unambigious. + */ + if (*argv0 != '"') { + cmdline = apr_pstrcat(pool, shellcmd, " /C \"\"", argv0, "\"", cmdline, "\"", NULL); + } + else { + cmdline = apr_pstrcat(pool, shellcmd, " /C \"", argv0, cmdline, "\"", NULL); + } + } + } + else { + /* A simple command we are directly invoking + */ + cmdline = apr_pstrcat(pool, argv0, cmdline, NULL); + } } - if (!env) pEnvBlock = NULL; else { @@ -458,6 +538,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, #endif /* APR_HAS_ANSI_FS */ } + new->invoked = cmdline; + #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { From b210b332944eae847379efca902c9b9f9c861fbb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 22 Mar 2002 07:55:00 +0000 Subject: [PATCH 3173/7878] Stub in the warning and observations. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63180 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 434158d884f..36f952d1ccf 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -446,6 +446,11 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } i = strlen(progname); if (i >= 11 && strcasecmp(progname + i - 11, "command.com") == 0) { + /* XXX: Still insecure - need doubled-quotes on each individual + * arg of cmdline. Suspect we need to postpone cmdline parsing + * until this moment in all four code paths, with some flags + * to toggle 'which flavor' is needed. + */ cmdline = apr_pstrcat(pool, shellcmd, " /C ", argv0, cmdline, NULL); } else { From 83e3a854494beed38c9ebd263b71a9fb5e11f830 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 22 Mar 2002 17:05:27 +0000 Subject: [PATCH 3174/7878] get this working on OS/390. (MVS == ancient name for OS/390) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63181 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testatomic.c b/test/testatomic.c index 13f1fbd95d9..aefbfb00681 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -250,7 +250,7 @@ int main(int argc, char**argv) printf("APR Simple Thread Test\n======================\n\n"); -#if !(defined WIN32) && !(defined NETWARE) +#if !(defined WIN32) && !(defined NETWARE) && !(defined __MVS__) pthread_setconcurrency(8); #endif printf("%-60s", "Initializing the context"); From 53d43716d5e1d673eedc5acb5c5942620144df22 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 22 Mar 2002 18:04:47 +0000 Subject: [PATCH 3175/7878] add apr atomic support for OS/390 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63182 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/os390/atomic.c | 82 +++++++++++++++++++++++++++++++++++++++++++ include/apr_atomic.h | 24 +++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 atomic/os390/atomic.c diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c new file mode 100644 index 00000000000..b6f41b242c5 --- /dev/null +++ b/atomic/os390/atomic.c @@ -0,0 +1,82 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +#include "apr.h" +#include "apr_atomic.h" + +#if APR_HAS_THREADS + +apr_atomic_t apr_atomic_add(apr_atomic_t *mem, apr_uint32_t val) +{ + apr_atomic_t old, new_val; + + old = *mem; /* old is automatically updated on cs failure */ + do { + new_val = old + val; + } while (__cs(&old, mem, new_val)); + + return new_val; +} + +apr_uint32_t apr_atomic_cas(apr_atomic_t *mem, apr_uint32_t swap, + apr_uint32_t cmp) +{ + apr_uint32_t old = cmp; + + __cs(&old, mem, swap); + return old; /* old is automatically updated from mem on cs failure */ +} + +#endif /* APR_HAS_THREADS */ diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 48e027d29a6..ec39e9c3ebc 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -214,6 +214,30 @@ apr_uint32_t apr_atomic_add_sparc(volatile apr_atomic_t *mem, apr_uint32_t add); apr_uint32_t apr_atomic_sub_sparc(volatile apr_atomic_t *mem, apr_uint32_t sub); apr_uint32_t apr_atomic_cas_sparc(volatile apr_uint32_t *mem, long with, long cmp); +#elif defined(__MVS__) /* OS/390 */ +#include +#define apr_atomic_t cs_t + +apr_int32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_int32_t val); +apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem, apr_uint32_t swap, + apr_uint32_t cmp); + +#define apr_atomic_inc(mem) apr_atomic_add(mem, 1) +#define apr_atomic_dec(mem) apr_atomic_add(mem, -1) +#define apr_atomic_init(pool) APR_SUCCESS + +/* warning: the following two operations, _read and _set, are atomic + * if the memory variables are aligned (the usual case). + * + * If you try really hard and manage to mis-align them, they are not + * guaranteed to be atomic on S/390. But then your program will blow up + * with SIGBUS on a sparc, or with a S0C6 abend if you use the mis-aligned + * variables with other apr_atomic_* operations on OS/390. + */ + +#define apr_atomic_read(p) *p +#define apr_atomic_set(mem, val) *mem= val + #else #if APR_HAS_THREADS #define APR_ATOMIC_NEED_DEFAULT 1 From 0fd3bafb491d5087c32b422711781246329dac9c Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 22 Mar 2002 18:08:23 +0000 Subject: [PATCH 3176/7878] nippy today git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63183 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index a6159a3a504..43de24c7a1e 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/03/15 20:13:34 $] +Last modified at [$Date: 2002/03/22 18:08:23 $] Release: @@ -63,8 +63,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: +1: BrianH, Aaron * Need some architecture/OS specific versions of the atomic operations. - progress: generic, solaris Sparc, FreeBSD5, and linux done - need: AIX, AS400, HPUX, OS/390 + progress: generic, solaris Sparc, FreeBSD5, linux, and OS/390 done + need: AIX, AS400, HPUX * The new lock API is a full replacement for the old API, but is not yet complete on all platforms. Components that are incomplete From a84f5fe4977c75e297fd6044a9ab79290b831920 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 22 Mar 2002 18:29:16 +0000 Subject: [PATCH 3177/7878] apr_atomic_add: sync up parameter types with header file git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63184 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/os390/atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c index b6f41b242c5..bd130abb2b2 100644 --- a/atomic/os390/atomic.c +++ b/atomic/os390/atomic.c @@ -58,7 +58,7 @@ #if APR_HAS_THREADS -apr_atomic_t apr_atomic_add(apr_atomic_t *mem, apr_uint32_t val) +apr_int32_t apr_atomic_add(apr_atomic_t *mem, apr_int32_t val) { apr_atomic_t old, new_val; From b9fa07a4551d60e4db660d2aac52fbed72b1f763 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 22 Mar 2002 18:51:07 +0000 Subject: [PATCH 3178/7878] spell-check a comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63185 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index ec39e9c3ebc..fc77f8de3a8 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -83,7 +83,7 @@ typedef apr_atomic_t; /** * @param pool - * this function is required on some platforms to initiliaze the + * this function is required on some platforms to initialize the * atomic operation's internal structures * returns APR_SUCCESS on successfull completion */ From 6e30345f42c8792fe49a7fc0b54220495e8e3533 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 22 Mar 2002 19:01:03 +0000 Subject: [PATCH 3179/7878] adding Makefile.in git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63186 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/os390/Makefile.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 atomic/os390/Makefile.in diff --git a/atomic/os390/Makefile.in b/atomic/os390/Makefile.in new file mode 100644 index 00000000000..db26a7617d5 --- /dev/null +++ b/atomic/os390/Makefile.in @@ -0,0 +1,12 @@ + +TARGETS = atomic.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + +INCDIR=../../include +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) + +# DO NOT REMOVE From 42eb771ae21c60c539ab9cbd247fdfb1d8e3412e Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 22 Mar 2002 21:41:47 +0000 Subject: [PATCH 3180/7878] get rid of the -g compiler flag on OS/390, unless this is a debug or maintainer mode build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63187 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure.in b/configure.in index 40a6cef1368..d061b465bfc 100644 --- a/configure.in +++ b/configure.in @@ -170,6 +170,17 @@ nl=' ' echo $ac_n "${nl}Check for compiler flags...${nl}" +dnl AC_PROG_CC unconditionally sets -g in CFLAGS. +dnl On OS/390 (at least), this causes the compiler to insert extra debugger +dnl hook instructions. That's fine for debug/maintainer builds, not fine +dnl otherwise. + +case $host in + *os390) + APR_REMOVEFROM(CFLAGS,-g) + ;; +esac + AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile time warnings], [APR_ADDTO(CFLAGS,-g) if test "$GCC" = "yes"; then From 4b141af03e64b45cf1500540558fb6f897a0445a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 23 Mar 2002 16:18:35 +0000 Subject: [PATCH 3181/7878] get APR_PATH_RELATIVE() to work on Tru64 and Solaris 8 again (it still works on Linux) I think this is a shell issue dealing with nested double quotes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63188 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index e49b667ab96..5ebf77d7906 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -589,7 +589,7 @@ dnl orig_path="${prefix}/bar" dnl APR_PATH_RELATIVE(final_path, $orig_path, $prefix) dnl $final_path now contains "bar" AC_DEFUN(APR_PATH_RELATIVE,[ -ap_stripped="`echo $2 | sed -e "s#^$3##"`" +ap_stripped=`echo $2 | sed -e "s#^$3##"` # check if the stripping was successful if test "x$2" != "x${ap_stripped}"; then # it was, so strip of any leading slashes From 0e99cca59048ae53c3f2f7e74c4c69d99be3e44c Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Sat, 23 Mar 2002 20:52:51 +0000 Subject: [PATCH 3182/7878] OS/390: only remove -g if CFLAGS wasn't set on entry to configure. It turns out that AC_PROG_CC only sets -g (and -O2 for gcc) in CFLAGS by default. Any CFLAGS explicitly set by the user are preserved. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63189 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index d061b465bfc..ce5fb969815 100644 --- a/configure.in +++ b/configure.in @@ -170,14 +170,16 @@ nl=' ' echo $ac_n "${nl}Check for compiler flags...${nl}" -dnl AC_PROG_CC unconditionally sets -g in CFLAGS. -dnl On OS/390 (at least), this causes the compiler to insert extra debugger +dnl AC_PROG_CC sets -g in CFLAGS (and -O2 for gcc) by default. +dnl On OS/390 this causes the compiler to insert extra debugger dnl hook instructions. That's fine for debug/maintainer builds, not fine dnl otherwise. case $host in *os390) - APR_REMOVEFROM(CFLAGS,-g) + if test "$ac_test_CFLAGS" != set; then + APR_REMOVEFROM(CFLAGS,-g) + fi ;; esac From 2c8bdef833f960d70c39d27b2c378c4b77847712 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 24 Mar 2002 16:01:33 +0000 Subject: [PATCH 3183/7878] Make sure gethostbyname() can handle 255.255.255.255. Otherwise, we won't trust it to deal with numeric address strings properly and will use our own logic in apr_sockaddr_info_get(). This fixes an assertion failure at Apache startup when using vhosts on HP-UX. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63190 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++++++ build/apr_network.m4 | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/CHANGES b/CHANGES index 62411fcd97f..ff8c3e1298a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,11 @@ Changes with APR b1 + + *) Make sure gethostbyname() can handle 255.255.255.255 if we + are to trust it to handle numeric address strings in + apr_sockaddr_info_get(). This fixes a problem on HP-UX + which led to an assertion failure at Apache startup when + using vhosts. [Jeff Trawick] + *) Don't mask SIGUSR2 [Jin Hong ] *) Load libraries if they not MH_BUNDLE, but if they are not, it diff --git a/build/apr_network.m4 b/build/apr_network.m4 index fc04de96014..635f127fb5e 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -197,6 +197,10 @@ void main(void) { if (he == NULL) { exit(1); } + he = gethostbyname("255.255.255.255"); + if (he == NULL) { + exit(1); + } else { exit(0); } From 18b86bc330d9cb4fd28c73f62c0c21b1dcabbf0a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 25 Mar 2002 20:15:58 +0000 Subject: [PATCH 3184/7878] Not certain this patch is strictly necessary, but I recall some abnormal behavior that was fixed at the time I changed this code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63191 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/fileio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index c8a8747c094..2cf398995b5 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -240,7 +240,7 @@ struct apr_dir_t { extern const char apr_c_is_fnchar[256]; #define IS_FNCHAR(c) (apr_c_is_fnchar[(unsigned char)(c)] & 1) -#define IS_SHCHAR(c) (apr_c_is_fnchar[(unsigned char)(c)] & 2 == 2) +#define IS_SHCHAR(c) ((apr_c_is_fnchar[(unsigned char)(c)] & 2) == 2) /* If the user passes APR_FILEPATH_TRUENAME to either From b0c02aa66e1a01dfe8e15a44b0ce5221e2af0d35 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 26 Mar 2002 16:50:00 +0000 Subject: [PATCH 3185/7878] Fixed the inlining for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63192 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index 57a8da01c35..d4aaf17454b 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -92,8 +92,8 @@ #define _POSIX_THREAD_SAFE_FUNCTIONS 1 #define READDIR_IS_THREAD_SAFE 1 -#define APR_INLINE __inline -#define APR_HAS_INLINE 1 +#define APR_INLINE +#define APR_HAS_INLINE 0 #define __attribute__(__x) #define ENUM_BITFIELD(e,n,w) signed int n : w From b4ac8145da5717ede8990156ee17a37e174027f6 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 26 Mar 2002 16:53:08 +0000 Subject: [PATCH 3186/7878] Fixed up the access paths for building the code generation utilities git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63193 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 199488 -> 199685 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index cb39479a949a822358ccb95c8c1981ece53e85f8..be6652b6cc23081857291b2e6835a82390345bb3 100644 GIT binary patch delta 86466 zcmZs?1z1$U_cu<1QXbqn){#tGlx|r;~;2k@b)MGmKj%%i=4$lKm#RCgE!#VkHE=H4J5)Fs<(V58GBsc81JD&kM+XlKt^( zHTmL~_~Gh-wqdg9+g|lHK5FA#&jA^UA<3;Ux|{Vsi&$ zn0FV9ZUWeDIPGol^1vSQpdA&9zCjj=Q6$Oc8E1Djlzq_?IaaQ<8th~?ob4OO_`p^N zu~d*zs`}L_LGCRBns_{5J{-avS@-oztWm4^R6rmx%z%3HY*1mQup;!3BU&I#aqSPJ zUY`HR&TGJ8X5KfwaEvvRXN=Tqps?j7(k^WMk^-5>OEb5Wp5m2w>O09&aXim5MJTeEQF^yLGIX?D zV7Jw1)8%KTk~FZfWlRwx%9hEdb2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FV!wH}L;XDJbOvv& zY8TfW$3!pySZ?~=U0k!i8=r1*OQsyIL-jc_eKcA(!ygY-<{5lQg7*Kn2*VHG7DOj4 zcnrCXh&QLzvt6!Wki(c*wUOQQ;(~O}MXlx|32)~9sh;e&(`oqa>fzXX!IZyjhna4 zpZNPMvuN*B^$ zgHjsDiYu`-Ae3?p69H9wfe%RP-Y2%pYRB~t(ZfcAtg= zzM9&rZFwgZRC@{gP&_N8qW8Cx9(GC3UV241V*Re{6v{A6Z9}=ItB|Ao&Sj|#gyZKv zd!??xXt$P*!#vrlDh#ONPSC%1KO++QHOw=HR-JQqi&Ki37qwup`E%~yyLRjYQ-{p2 lupc%vAt|puf`)CsQc`s6wXH`(FvV#*)Y}5_5flP}{105^%W(hz From 09ebd7d76eff9b3da97752fbb88a1f4b446f699f Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 29 Mar 2002 17:03:19 +0000 Subject: [PATCH 3197/7878] srcdir is bogus at present... this, at least, allows it to compile and build under Solaris8 PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63204 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/Makefile.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/atomic/solaris_sparc/Makefile.in b/atomic/solaris_sparc/Makefile.in index f88161f8995..5fe5bd4e149 100644 --- a/atomic/solaris_sparc/Makefile.in +++ b/atomic/solaris_sparc/Makefile.in @@ -9,13 +9,13 @@ ASCPP = @ASCPP@ # bring in rules.mk for standard functionality @INCLUDE_RULES@ -apr_atomic_sparc.lo: $(srcdir)/apr_atomic_sparc.s - $(ASCPP) $(ASCPPFLAGS) $(srcdir)/$*.s > $*.S +apr_atomic_sparc.lo: apr_atomic_sparc.s + $(ASCPP) $(ASCPPFLAGS) $*.s > $*.S $(AS) $(ASFLAGS) -o $@ $*.S DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) +INCLUDES=-I$(INCDIR) -I$(DEFOSDIRi # DO NOT REMOVE From e9bd5c2e43cacb63f3dd7157502a4588f047e502 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 29 Mar 2002 18:06:13 +0000 Subject: [PATCH 3198/7878] Typo - thanks RM git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63205 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic/solaris_sparc/Makefile.in b/atomic/solaris_sparc/Makefile.in index 5fe5bd4e149..b0bc31de3b2 100644 --- a/atomic/solaris_sparc/Makefile.in +++ b/atomic/solaris_sparc/Makefile.in @@ -16,6 +16,6 @@ apr_atomic_sparc.lo: apr_atomic_sparc.s DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(DEFOSDIRi +INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) # DO NOT REMOVE From 83418dea6f578f2362d22c0da6815e11c3c2ac7c Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 29 Mar 2002 18:20:57 +0000 Subject: [PATCH 3199/7878] Hmmm... this forces srcdir to exist here git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63206 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/Makefile.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/atomic/solaris_sparc/Makefile.in b/atomic/solaris_sparc/Makefile.in index b0bc31de3b2..a2d8dbae405 100644 --- a/atomic/solaris_sparc/Makefile.in +++ b/atomic/solaris_sparc/Makefile.in @@ -8,9 +8,10 @@ ASCPP = @ASCPP@ # bring in rules.mk for standard functionality @INCLUDE_RULES@ +srcdir=@srcdir@ -apr_atomic_sparc.lo: apr_atomic_sparc.s - $(ASCPP) $(ASCPPFLAGS) $*.s > $*.S +apr_atomic_sparc.lo: $(srcdir)/apr_atomic_sparc.s + $(ASCPP) $(ASCPPFLAGS) $(srcdir)/$*.s > $*.S $(AS) $(ASFLAGS) -o $@ $*.S From 69da5a5908ffee0cbfdb09b52bed55150cbd75bc Mon Sep 17 00:00:00 2001 From: Dirk-Willem van Gulik Date: Fri, 29 Mar 2002 19:20:40 +0000 Subject: [PATCH 3200/7878] Removed email address on request - as obviscation was slammed down on the list - and Google is your friend in any case git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63207 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 9bb19a13c3d..69b68763e33 100644 --- a/CHANGES +++ b/CHANGES @@ -225,7 +225,7 @@ Changes with APR b1 *) Tweak apr_gethostname() so that it detects truncation of the name and returns an error. [Jeff Trawick] - *) Fix bug in Darwin DSO code. [Sander Temme ] + *) Fix bug in Darwin DSO code. [Sander Temme] *) Fix apr_setup_signal_thread() to grab the right error code from a sigprocmask() failure. This only affects platforms that use From d296cd269ca06cde435481b0aa91050e4d8535d4 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 31 Mar 2002 10:12:21 +0000 Subject: [PATCH 3201/7878] Fix a logic bug. Submitted by: Cliff Woolley git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63208 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index a0b48025def..18fc8f2db1c 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1316,7 +1316,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, pool->owner = apr_os_thread_current(); #endif /* APR_HAS_THREADS */ - if (parent != NULL || parent->allocator != allocator) { + if (parent == NULL || parent->allocator != allocator) { #if APR_HAS_THREADS apr_status_t rv; From 8798f169dba7e1dd09600de0bef1ba88b04d55f2 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 1 Apr 2002 05:42:38 +0000 Subject: [PATCH 3202/7878] Minor tweaks to expose things in the apr_allocator API needed to implement the bucket allocator in apr-util git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63209 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 9 +++++++++ memory/unix/apr_pools.c | 23 +++++------------------ 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 934c7c8b22c..a2d2aa1bbf1 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -85,6 +85,15 @@ typedef struct apr_allocator_t apr_allocator_t; /** the structure which holds information about the allocation */ typedef struct apr_memnode_t apr_memnode_t; +struct apr_memnode_t { + apr_memnode_t *next; + apr_uint32_t index; + char *first_avail; + char *endp; +}; + +#define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t)) + /** * Create a new allocator * @param allocator The allocator we have just created. diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 18fc8f2db1c..35bf4b775c1 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -76,19 +76,6 @@ #endif -/* - * XXX: Memory node struct, move to private header file - */ -struct apr_memnode_t { - apr_memnode_t *next; - apr_uint32_t index; - char *first_avail; - char *endp; -}; - -#define SIZEOF_MEMNODE_T APR_ALIGN_DEFAULT(sizeof(apr_memnode_t)) - - /* * Magic numbers */ @@ -189,7 +176,7 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, /* Round up the block size to the next boundary, but always * allocate at least a certain size (MIN_ALLOC). */ - size = APR_ALIGN(size + SIZEOF_MEMNODE_T, BOUNDARY_SIZE); + size = APR_ALIGN(size + APR_MEMNODE_T_SIZE, BOUNDARY_SIZE); if (size < MIN_ALLOC) size = MIN_ALLOC; @@ -247,7 +234,7 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, #endif /* APR_HAS_THREADS */ node->next = NULL; - node->first_avail = (char *)node + SIZEOF_MEMNODE_T; + node->first_avail = (char *)node + APR_MEMNODE_T_SIZE; return node; } @@ -283,7 +270,7 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, #endif /* APR_HAS_THREADS */ node->next = NULL; - node->first_avail = (char *)node + SIZEOF_MEMNODE_T; + node->first_avail = (char *)node + APR_MEMNODE_T_SIZE; return node; } @@ -302,7 +289,7 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, node->next = NULL; node->index = index; - node->first_avail = (char *)node + SIZEOF_MEMNODE_T; + node->first_avail = (char *)node + APR_MEMNODE_T_SIZE; node->endp = (char *)node + size; return node; @@ -721,7 +708,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, allocator = parent->allocator; if ((node = apr_allocator_alloc(allocator, - MIN_ALLOC - SIZEOF_MEMNODE_T)) == NULL) { + MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); From 74a50a86da7beee851c7f79b95a92b49b3cd0d38 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 1 Apr 2002 14:13:45 +0000 Subject: [PATCH 3203/7878] rename internal function apr_set_sockaddr_vars() to apr_sockaddr_vars_set() Submitted by: Kevin Pilch-Bisson git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63210 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/networkio.h | 2 +- include/arch/unix/networkio.h | 2 +- include/arch/win32/networkio.h | 2 +- network_io/unix/sa_common.c | 10 +++++----- network_io/unix/sockets.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index 9434183e203..d1895e9c3a3 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -103,7 +103,7 @@ struct apr_pollfd_t { const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); -void apr_set_sockaddr_vars(apr_sockaddr_t *, int, apr_port_t); +void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); #endif /* ! NETWORK_IO_H */ diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index d557cd9cd58..f6615a2f67a 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -164,7 +164,7 @@ struct apr_pollfd_t { const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read); -void apr_set_sockaddr_vars(apr_sockaddr_t *, int, apr_port_t); +void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); #define apr_is_option_set(mask, option) ((mask & option) ==option) diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 3014510680b..370946c134b 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -86,7 +86,7 @@ apr_status_t status_from_res_error(int); const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); -void apr_set_sockaddr_vars(apr_sockaddr_t *, int, apr_port_t); +void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); #endif /* ! NETWORK_IO_H */ diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 234b1661d4d..0f4bec73305 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -164,7 +164,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, return APR_SUCCESS; } -void apr_set_sockaddr_vars(apr_sockaddr_t *addr, int family, apr_port_t port) +void apr_sockaddr_vars_set(apr_sockaddr_t *addr, int family, apr_port_t port) { addr->family = family; addr->sa.sin.sin_family = family; @@ -322,7 +322,7 @@ static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa, { sa->pool = p; memcpy(&sa->sa, ai->ai_addr, ai->ai_addrlen); - apr_set_sockaddr_vars(sa, ai->ai_family, port); + apr_sockaddr_vars_set(sa, ai->ai_family, port); } #else static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa, @@ -330,7 +330,7 @@ static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa, { sa->pool = p; sa->sa.sin.sin_addr = ipaddr; - apr_set_sockaddr_vars(sa, AF_INET, port); + apr_sockaddr_vars_set(sa, AF_INET, port); } #endif @@ -393,7 +393,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, } else { (*sa)->pool = p; - apr_set_sockaddr_vars(*sa, + apr_sockaddr_vars_set(*sa, family == APR_UNSPEC ? APR_INET : family, port); } @@ -480,7 +480,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, } else { (*sa)->pool = p; - apr_set_sockaddr_vars(*sa, + apr_sockaddr_vars_set(*sa, family == APR_UNSPEC ? APR_INET : family, port); } diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index b0ca95183b8..88dcd4a79d4 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -79,8 +79,8 @@ static apr_status_t socket_cleanup(void *sock) static void set_socket_vars(apr_socket_t *sock, int family, int type) { sock->type = type; - apr_set_sockaddr_vars(sock->local_addr, family, 0); - apr_set_sockaddr_vars(sock->remote_addr, family, 0); + apr_sockaddr_vars_set(sock->local_addr, family, 0); + apr_sockaddr_vars_set(sock->remote_addr, family, 0); sock->netmask = 0; #if defined(BEOS) && !defined(BEOS_BONE) /* BeOS pre-BONE has TCP_NODELAY on by default and it can't be From 73aa3ccfb458b503ab9605bc7b3c2ea91e842fb4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 1 Apr 2002 14:18:22 +0000 Subject: [PATCH 3204/7878] simplify sockaddr manipulation code a little bit point out some possible bugs (see "XXX" comments) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63211 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 33 ++++----------------------- network_io/win32/sockets.c | 46 ++++++++++++-------------------------- 2 files changed, 18 insertions(+), 61 deletions(-) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index aab2d2edc0b..96eb1cef095 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -87,35 +87,8 @@ static apr_status_t socket_cleanup(void *sock) static void set_socket_vars(apr_socket_t *sock, int family, int type) { sock->type = type; - sock->local_addr->family = family; - sock->local_addr->sa.sin.sin_family = family; - sock->remote_addr->family = family; - sock->remote_addr->sa.sin.sin_family = family; - - if (family == AF_INET) { - sock->local_addr->salen = sizeof(struct sockaddr_in); - sock->local_addr->addr_str_len = 16; - sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin.sin_addr); - sock->local_addr->ipaddr_len = sizeof(struct in_addr); - - sock->remote_addr->salen = sizeof(struct sockaddr_in); - sock->remote_addr->addr_str_len = 16; - sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin.sin_addr); - sock->remote_addr->ipaddr_len = sizeof(struct in_addr); - } -#if APR_HAVE_IPV6 - else if (family == AF_INET6) { - sock->local_addr->salen = sizeof(struct sockaddr_in6); - sock->local_addr->addr_str_len = 46; - sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin6.sin6_addr); - sock->local_addr->ipaddr_len = sizeof(struct in6_addr); - - sock->remote_addr->salen = sizeof(struct sockaddr_in6); - sock->remote_addr->addr_str_len = 46; - sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin6.sin6_addr); - sock->remote_addr->ipaddr_len = sizeof(struct in6_addr); - } -#endif + apr_sockaddr_vars_set(sock->local_addr, family, 0); + apr_sockaddr_vars_set(sock->remote_addr, family, 0); } static void alloc_socket(apr_socket_t **new, apr_pool_t *p) @@ -223,6 +196,8 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, apr if ((*new)->socketdes < 0) { return APR_OS2_STATUS(sock_errno()); } + /* XXX fix up any pointers which are no longer valid (or just call + * apr_sockaddr_vars_set() to do it */ (*new)->remote_addr->port = ntohs((*new)->remote_addr->sa.sin.sin_port); apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, apr_pool_cleanup_null); diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index f329fda3f82..c1db154e917 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -59,6 +59,8 @@ #include "apr_portable.h" #include +static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */ + static apr_status_t socket_cleanup(void *sock) { apr_socket_t *thesocket = sock; @@ -75,35 +77,8 @@ static apr_status_t socket_cleanup(void *sock) static void set_socket_vars(apr_socket_t *sock, int family, int type) { sock->type = type; - sock->local_addr->family = family; - sock->local_addr->sa.sin.sin_family = family; - sock->remote_addr->family = family; - sock->remote_addr->sa.sin.sin_family = family; - - if (family == AF_INET) { - sock->local_addr->salen = sizeof(struct sockaddr_in); - sock->local_addr->addr_str_len = 16; - sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin.sin_addr); - sock->local_addr->ipaddr_len = sizeof(struct in_addr); - - sock->remote_addr->salen = sizeof(struct sockaddr_in); - sock->remote_addr->addr_str_len = 16; - sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin.sin_addr); - sock->remote_addr->ipaddr_len = sizeof(struct in_addr); - } -#if APR_HAVE_IPV6 - else if (family == AF_INET6) { - sock->local_addr->salen = sizeof(struct sockaddr_in6); - sock->local_addr->addr_str_len = 46; - sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin6.sin6_addr); - sock->local_addr->ipaddr_len = sizeof(struct in6_addr); - - sock->remote_addr->salen = sizeof(struct sockaddr_in6); - sock->remote_addr->addr_str_len = 46; - sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin6.sin6_addr); - sock->remote_addr->ipaddr_len = sizeof(struct in6_addr); - } -#endif + apr_sockaddr_vars_set(sock->local_addr, family, 0); + apr_sockaddr_vars_set(sock->remote_addr, family, 0); } static void alloc_socket(apr_socket_t **new, apr_pool_t *p) { @@ -244,6 +219,7 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, (*new)->disconnected = 0; (*new)->sock = s; + /* XXX next line looks bogus w.r.t. AF_INET6 support */ (*new)->remote_addr->salen = sizeof((*new)->remote_addr->sa); memcpy (&(*new)->remote_addr->sa, &sa, salen); *(*new)->local_addr = *sock->local_addr; @@ -270,7 +246,9 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, } if (sock->local_interface_unknown || - sock->local_addr->sa.sin.sin_addr.s_addr == 0) { + !memcmp(sock->local_addr->ipaddr_ptr, + generic_inaddr_any, + sock->local_addr->ipaddr_len)) { /* If the interface address inside the listening socket's local_addr wasn't * up-to-date, we don't know local interface of the connected socket either. * @@ -349,8 +327,12 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) if (sock->local_addr->sa.sin.sin_port == 0) { sock->local_port_unknown = 1; } - if (sock->local_addr->sa.sin.sin_addr.s_addr == 0) { - /* must be using free-range port */ + if (!memcmp(sock->local_addr->ipaddr_ptr, + generic_inaddr_any, + sock->local_addr->ipaddr_len) { + /* not bound to specific local interface; connect() had to assign + * one for the socket + */ sock->local_interface_unknown = 1; } return APR_SUCCESS; From aa87c52b558cb5c184554c04f55b50b8324e832a Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 1 Apr 2002 17:52:05 +0000 Subject: [PATCH 3205/7878] Fix win32 compile break git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63212 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index c1db154e917..b0dc99eb662 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -329,7 +329,7 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) } if (!memcmp(sock->local_addr->ipaddr_ptr, generic_inaddr_any, - sock->local_addr->ipaddr_len) { + sock->local_addr->ipaddr_len)) { /* not bound to specific local interface; connect() had to assign * one for the socket */ From 0d7fad0f256982c87d4a23549d5c1ad26c91af69 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 1 Apr 2002 19:30:27 +0000 Subject: [PATCH 3206/7878] Fix apr-config so that it will not attempt to cd to bindir if it doesn't exist yet. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63213 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ apr-config.in | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 69b68763e33..fc8f40c3346 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix apr-config so that it will not attempt to cd to a non-existent + directory. [Justin Erenkrantz] + *) Change the ordering of the apr_lock implementation method to better match what's done in Apache 1.3. The ordering is now (highest to lowest): pthread -> sysvsem -> fcntl -> flock. diff --git a/apr-config.in b/apr-config.in index 8644321c9c0..a87cd34216a 100644 --- a/apr-config.in +++ b/apr-config.in @@ -114,7 +114,11 @@ fi thisdir="`dirname $0`" thisdir="`cd $thisdir && pwd`" -tmpbindir="`cd $bindir && pwd`" +if test -d $bindir; then + tmpbindir="`cd $bindir && pwd`" +else + tmpbindir="" +fi if test "$tmpbindir" = "$thisdir"; then location=installed elif test "$APR_SOURCE_DIR" = "$thisdir"; then From e8131e643e0ce55e85dd79b715ef8387a5042e7f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 1 Apr 2002 21:03:04 +0000 Subject: [PATCH 3207/7878] Get flock-based mutexes to work in apps like Apache. Use the same permissions on flock- and fcntl-based mutexes as Apache 1.3. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63214 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ locks/unix/proc_mutex.c | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index fc8f40c3346..7e7e94ca297 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Get flock-based mutexes to work in apps like Apache. Use the + same permissions on flock- and fcntl-based mutexes as Apache + 1.3. [Jeff Trawick] + *) Fix apr-config so that it will not attempt to cd to a non-existent directory. [Justin Erenkrantz] diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 77eaccf8c98..b855d00e6c8 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -390,7 +390,8 @@ static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, if (fname) { new_mutex->fname = apr_pstrdup(new_mutex->pool, fname); rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, - APR_CREATE | APR_WRITE | APR_EXCL, 0644, + APR_CREATE | APR_WRITE | APR_EXCL, + APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD, new_mutex->pool); } else { @@ -511,7 +512,8 @@ static apr_status_t proc_mutex_flock_create(apr_proc_mutex_t *new_mutex, if (fname) { new_mutex->fname = apr_pstrdup(new_mutex->pool, fname); rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, - APR_CREATE | APR_WRITE | APR_EXCL, 0644, + APR_CREATE | APR_WRITE | APR_EXCL, + APR_UREAD | APR_UWRITE, new_mutex->pool); } else { @@ -582,10 +584,10 @@ static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, new_mutex->pool = pool; new_mutex->fname = apr_pstrdup(pool, fname); rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, - APR_CREATE | APR_WRITE, 0600, new_mutex->pool); + APR_WRITE, 0, new_mutex->pool); if (rv != APR_SUCCESS) { proc_mutex_flock_destroy(new_mutex); - return errno; + return rv; } *mutex = new_mutex; return APR_SUCCESS; From 2ae2034eb9b101de4de8de07a8bd172daffeccb8 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Mon, 1 Apr 2002 21:07:13 +0000 Subject: [PATCH 3208/7878] FreeBSD: use fcntl cross-process locks by default. Make note of problems experienced with flock and SysV sems. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63215 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ++++++- build/apr_hints.m4 | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 43de24c7a1e..d08432d28e8 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/03/22 18:08:23 $] +Last modified at [$Date: 2002/04/01 21:07:13 $] Release: @@ -314,6 +314,11 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: See OtherBill's comments in this message to dev@httpd.apache.org: Message-Id: <5.1.0.14.2.20020315080852.00bce168@localhost> + * FreeBSD: flock cross-process locks fail in apr_proc_mutex_child_init + with EBADF. flock was the default accept serialization method in + Apache 1.3. SysV sems fail with ENOSPC during apr_lock_create on + daedalus. + Documentation that needs writing: * API documentation diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 38386120785..ce2c7914de5 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -135,6 +135,11 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; esac APR_SETIFNULL(enable_threads, [no]) + +dnl XXX Fix me - Apache 1.3 used FLOCK serialization by default on FreeBSD, +dnl but that doesn't work any more. + + APR_SETIFNULL(apr_lock_method, [USE_FCNTL_SERIALIZE]) APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_THREAD_SAFE]) ;; *-next-nextstep*) From 7589e6dd1a396546a48b7786860ff4ecb775c1a3 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Mon, 1 Apr 2002 21:50:45 +0000 Subject: [PATCH 3209/7878] FreeBSD: switch to FLOCK serialization by default (thanks, Jeff!) and clean up the STATUS file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63216 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 +------ build/apr_hints.m4 | 6 +----- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/STATUS b/STATUS index d08432d28e8..8bf6ff9b124 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/04/01 21:07:13 $] +Last modified at [$Date: 2002/04/01 21:50:45 $] Release: @@ -314,11 +314,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: See OtherBill's comments in this message to dev@httpd.apache.org: Message-Id: <5.1.0.14.2.20020315080852.00bce168@localhost> - * FreeBSD: flock cross-process locks fail in apr_proc_mutex_child_init - with EBADF. flock was the default accept serialization method in - Apache 1.3. SysV sems fail with ENOSPC during apr_lock_create on - daedalus. - Documentation that needs writing: * API documentation diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index ce2c7914de5..604a41f90a9 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -135,11 +135,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; esac APR_SETIFNULL(enable_threads, [no]) - -dnl XXX Fix me - Apache 1.3 used FLOCK serialization by default on FreeBSD, -dnl but that doesn't work any more. - - APR_SETIFNULL(apr_lock_method, [USE_FCNTL_SERIALIZE]) + APR_SETIFNULL(apr_lock_method, [USE_FLOCK_SERIALIZE]) APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_THREAD_SAFE]) ;; *-next-nextstep*) From a68dbd8a283cb335d7de9359a69d12b9ec0b56f4 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 2 Apr 2002 00:28:23 +0000 Subject: [PATCH 3210/7878] Make the loaded module local to the address space so that it can resolve the symbols correctly git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63218 13f79535-47bb-0310-9956-ffa450edef68 --- dso/netware/dso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dso/netware/dso.c b/dso/netware/dso.c index 99eabde2cfe..1c562489bd1 100644 --- a/dso/netware/dso.c +++ b/dso/netware/dso.c @@ -107,7 +107,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *pool) { - void *os_handle = dlopen(path, RTLD_NOW | RTLD_GLOBAL); + void *os_handle = dlopen(path, RTLD_NOW | RTLD_LOCAL); *res_handle = apr_pcalloc(pool, sizeof(**res_handle)); From 3a04f8d0b5626acebff99769f26c69dbead4a817 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 4 Apr 2002 16:38:59 +0000 Subject: [PATCH 3211/7878] A better explanation of APR_INCOMPLETE as used today. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63219 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 5 ++--- misc/unix/errorcodes.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index e89382587e8..d02b0da5579 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -210,9 +210,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * APR_CHILD_DONE The child has finished executing * APR_CHILD_NOTDONE The child has not finished executing * APR_TIMEUP The operation did not finish before the timeout - * APR_INCOMPLETE The character conversion stopped because of an - * incomplete character or shift sequence at the end - * of the input buffer. + * APR_INCOMPLETE The operation was incomplete although some processing + * was performed and the results are partially valid * APR_BADCH Getopt found an option not in the option string * APR_BADARG Getopt found an option that is missing an argument * and an argument was specified in the option string diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index cd9b82c1964..74c0aedb220 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -131,7 +131,7 @@ static char *apr_error_string(apr_status_t statcode) case APR_TIMEUP: return "The timeout specified has expired"; case APR_INCOMPLETE: - return "The input data is incomplete"; + return "Partial results are valid but processing is incomplete"; case APR_BADCH: return "Bad character specified on command line"; case APR_BADARG: From 7dda93ed2f5e17bda76293e51890184fdc811fed Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 4 Apr 2002 16:55:19 +0000 Subject: [PATCH 3212/7878] Force the spawned NLM into the same address space git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63220 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index d10b76f516f..e466108bc9f 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -297,7 +297,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, const char **newargs; char **newenv; NXVmId_t newVM; - unsigned long flags = 0; + unsigned long flags = NX_VM_SAME_ADDRSPACE; char **sysenv = NULL; NXNameSpec_t nameSpec; From 8c61ead58ab7abda65acbb0d77d5e3a3e802143e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 4 Apr 2002 16:55:50 +0000 Subject: [PATCH 3213/7878] Fixed a precedence problem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63221 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 46ae051d904..d28c12b16c5 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -153,8 +153,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out if (!tmpnam(tname)) return errno; - if ((filedes[0] = pipe_open(tname, O_RDONLY) != -1) - && (filedes[1] = pipe_open(tname, O_WRONLY) != -1)) + if (((filedes[0] = pipe_open(tname, O_RDONLY)) != -1) + && ((filedes[1] = pipe_open(tname, O_WRONLY)) != -1)) { (*in) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); From a6a8160b63524a2c688b28e0ea2fe67dfdda1e33 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 4 Apr 2002 18:33:56 +0000 Subject: [PATCH 3214/7878] Support for Posix semaphores for locking has been added. This uses named semaphores (sem_open). Because there are a few different implementations around, this uses the lowest common denominator in creating the semaphore name. As far as its location in DEFAULT priority, it's placed between pthread and sysvsem. Tested on Darwin (in which it's the new default) and Solaris. As part of the discovery of sem_open under Solaris, APR is now aware of shm_open (Posix shared memory) under Solaris as well, if someone wants to monkey with that :) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63222 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++ configure.in | 26 +++++- include/apr.h.in | 3 + include/apr_global_mutex.h | 1 + include/apr_lock.h | 4 +- include/apr_proc_mutex.h | 1 + include/arch/unix/locks.h | 6 ++ include/arch/unix/proc_mutex.h | 6 ++ locks/unix/crossproc.c | 121 ++++++++++++++++++++++++++++ locks/unix/locks.c | 15 +++- locks/unix/proc_mutex.c | 139 ++++++++++++++++++++++++++++++++- 11 files changed, 319 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 7e7e94ca297..9ccb3024ab8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Added support for Posix semaphores (sem_open, et.al.) for mutex + locking. We use named semaphores in this implementation. The + default priority is between pthread and sysvsem. + [Jim Jagielski] + *) Get flock-based mutexes to work in apps like Apache. Use the same permissions on flock- and fcntl-based mutexes as Apache 1.3. [Jeff Trawick] diff --git a/configure.in b/configure.in index 46dfc802044..9484bd0b2d2 100644 --- a/configure.in +++ b/configure.in @@ -568,6 +568,14 @@ AC_CHECK_FUNCS(getgrgid_r) dnl #----------------------------- Checking for Shared Memory Support echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" +dnl The Posix function are in librt on Solaris. This will +dnl also help us find sem_open when doing locking below +case $host in + *-solaris*) + AC_CHECK_LIB(rt, shm_open) + ;; +esac + AC_CHECK_HEADERS(sys/mman.h) APR_CHECK_DEFINE(MAP_ANON, sys/mman.h) AC_CHECK_FUNCS(mmap munmap shm_open shm_unlink) @@ -833,6 +841,7 @@ APR_FLAG_HEADERS( poll.h \ process.h \ pwd.h \ + semaphore.h \ signal.h \ stdarg.h \ stddef.h \ @@ -916,6 +925,7 @@ AC_SUBST(unistdh) AC_SUBST(signalh) AC_SUBST(sys_waith) AC_SUBST(pthreadh) +AC_SUBST(semaphoreh) dnl #----------------------------- Checking for h_errno in if test "$netdbh" = "1"; then @@ -1230,6 +1240,8 @@ echo $ac_n "${nl}Checking for Locking...${nl}" AC_CHECK_FUNCS(semget semctl flock) APR_CHECK_FILE(/dev/zero) +AC_CHECK_HEADERS(semaphore.h) +AC_CHECK_FUNCS(sem_open sem_close sem_unlink sem_post sem_wait) # It's stupid, but not all platforms have union semun, even those that need it. AC_MSG_CHECKING(for union semun in sys/sem.h) @@ -1316,6 +1328,9 @@ if test "$threads" = "1"; then fi # See which lock mechanisms we can support on this system. +APR_IFALLYES(header:semaphore.h func:sem_open func_sem_close dnl + func_sem_unlink func:sem_post func_sem_wait, + hasposixser="1", hasposixser="0") APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, hassysvser="1", hassysvser="0") APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1", hasflockser="0") @@ -1330,7 +1345,7 @@ APR_IFALLYES(struct:pthread_rw, hasrwlockser="1", hasrwlockser="0") # See which lock mechanism we'll select by default on this system. # The last APR_DECIDE to execute sets the default. # At this stage, we match the ordering in Apache 1.3 -# which is (highest to lowest): pthread -> sysvsem -> fcntl -> flock +# which is (highest to lowest): pthread -> posixsem -> sysvsem -> fcntl -> flock # APR_BEGIN_DECISION([apr_lock implementation method]) APR_IFALLYES(func:flock define:LOCK_EX, @@ -1339,6 +1354,9 @@ APR_IFALLYES(header:fcntl.h define:F_SETLK, APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) +APR_IFALLYES(header:semaphore.h func:sem_open func_sem_close dnl + func_sem_unlink func:sem_post func_sem_wait, + APR_DECIDE(USE_POSIXSEM_SERIALIZE, [Posix sem_open()])) # note: the current APR use of shared mutex requires /dev/zero APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl func:pthread_mutexattr_setpshared dnl @@ -1352,6 +1370,7 @@ AC_DEFINE_UNQUOTED($ac_decision) flockser="0" sysvser="0" +posixser="0" procpthreadser="0" fcntlser="0" case $ac_decision in @@ -1364,6 +1383,9 @@ case $ac_decision in USE_SYSVSEM_SERIALIZE ) sysvser="1" ;; + USE_POSIXSEM_SERIALIZE ) + posixser="1" + ;; USE_PROC_PTHREAD_SERIALIZE ) procpthreadser="1" ;; @@ -1371,11 +1393,13 @@ esac AC_SUBST(hasflockser) AC_SUBST(hassysvser) +AC_SUBST(hasposixser) AC_SUBST(hasfcntlser) AC_SUBST(hasprocpthreadser) AC_SUBST(hasrwlockser) AC_SUBST(flockser) AC_SUBST(sysvser) +AC_SUBST(posixser) AC_SUBST(fcntlser) AC_SUBST(procpthreadser) AC_SUBST(pthreadser) diff --git a/include/apr.h.in b/include/apr.h.in index 3b00b43901c..7703809e92c 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -45,6 +45,7 @@ #define APR_HAVE_NETINET_IN_H @netinet_inh@ #define APR_HAVE_NETINET_TCP_H @netinet_tcph@ #define APR_HAVE_PTHREAD_H @pthreadh@ +#define APR_HAVE_SEMAPHORE_H @semaphoreh@ #define APR_HAVE_SIGNAL_H @signalh@ #define APR_HAVE_STDARG_H @stdargh@ #define APR_HAVE_STDINT_H @stdint@ @@ -82,12 +83,14 @@ #define APR_USE_FLOCK_SERIALIZE @flockser@ #define APR_USE_SYSVSEM_SERIALIZE @sysvser@ +#define APR_USE_POSIXSEM_SERIALIZE @posixser@ #define APR_USE_FCNTL_SERIALIZE @fcntlser@ #define APR_USE_PROC_PTHREAD_SERIALIZE @procpthreadser@ #define APR_USE_PTHREAD_SERIALIZE @pthreadser@ #define APR_HAS_FLOCK_SERIALIZE @hasflockser@ #define APR_HAS_SYSVSEM_SERIALIZE @hassysvser@ +#define APR_HAS_POSIXSEM_SERIALIZE @hasposixser@ #define APR_HAS_FCNTL_SERIALIZE @hasfcntlser@ #define APR_HAS_PROC_PTHREAD_SERIALIZE @hasprocpthreadser@ #define APR_HAS_RWLOCK_SERIALIZE @hasrwlockser@ diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index f80dbe8c146..b51388a6386 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -97,6 +97,7 @@ typedef struct apr_global_mutex_t apr_global_mutex_t; * APR_LOCK_FCNTL * APR_LOCK_FLOCK * APR_LOCK_SYSVSEM + * APR_LOCK_POSIXSEM * APR_LOCK_PROC_PTHREAD * APR_LOCK_DEFAULT pick the default mechanism for the platform * diff --git a/include/apr_lock.h b/include/apr_lock.h index 5794a56da16..052adf979e4 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -80,7 +80,8 @@ typedef enum {APR_MUTEX, APR_READWRITE} apr_locktype_e; typedef enum {APR_READER, APR_WRITER} apr_readerwriter_e; -typedef enum {APR_LOCK_FCNTL, APR_LOCK_FLOCK, APR_LOCK_SYSVSEM, APR_LOCK_PROC_PTHREAD, +typedef enum {APR_LOCK_FCNTL, APR_LOCK_FLOCK, APR_LOCK_SYSVSEM, + APR_LOCK_PROC_PTHREAD, APR_LOCK_POSIXSEM, APR_LOCK_DEFAULT} apr_lockmech_e; typedef struct apr_lock_t apr_lock_t; @@ -107,6 +108,7 @@ typedef struct apr_lock_t apr_lock_t; * APR_LOCK_FCNTL * APR_LOCK_FLOCK * APR_LOCK_SYSVSEM + * APR_LOCK_POSIXSEM * APR_LOCK_PROC_PTHREAD * APR_LOCK_DEFAULT pick the default mechanism for the platform * diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index 5441216a62f..a883f8d19e5 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -91,6 +91,7 @@ typedef struct apr_proc_mutex_t apr_proc_mutex_t; * APR_LOCK_FCNTL * APR_LOCK_FLOCK * APR_LOCK_SYSVSEM + * APR_LOCK_POSIXSEM * APR_LOCK_PROC_PTHREAD * APR_LOCK_DEFAULT pick the default mechanism for the platform * diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index 0a1b8d57e4b..2c422a27399 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -95,6 +95,9 @@ #if APR_HAVE_PTHREAD_H #include #endif +#if APR_HAVE_SEMAPHORE_H +#include +#endif /* End System Headers */ struct apr_unix_lock_methods_t { @@ -113,6 +116,9 @@ typedef struct apr_unix_lock_methods_t apr_unix_lock_methods_t; /* bit values for flags field in apr_unix_lock_methods_t */ #define APR_PROCESS_LOCK_MECH_IS_GLOBAL 1 +#if APR_HAS_POSIXSEM_SERIALIZE +extern const apr_unix_lock_methods_t apr_unix_posix_methods; +#endif #if APR_HAS_SYSVSEM_SERIALIZE extern const apr_unix_lock_methods_t apr_unix_sysv_methods; #endif diff --git a/include/arch/unix/proc_mutex.h b/include/arch/unix/proc_mutex.h index b54bfacee6e..f3375b2cf24 100644 --- a/include/arch/unix/proc_mutex.h +++ b/include/arch/unix/proc_mutex.h @@ -97,6 +97,9 @@ #if APR_HAVE_PTHREAD_H #include #endif +#if APR_HAVE_SEMAPHORE_H +#include +#endif /* End System Headers */ struct apr_proc_mutex_unix_lock_methods_t { @@ -113,6 +116,9 @@ typedef struct apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_lock_metho /* bit values for flags field in apr_unix_lock_methods_t */ #define APR_PROCESS_LOCK_MECH_IS_GLOBAL 1 +#if APR_HAS_POSIXSEM_SERIALIZE +extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_posix_methods; +#endif #if APR_HAS_SYSVSEM_SERIALIZE extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods; #endif diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 3d19500f5c8..e7988cd4a5c 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -58,6 +58,124 @@ #include "locks.h" #include "fileio.h" /* for apr_mkstemp() */ +#if APR_HAS_POSIXSEM_SERIALIZE + +#ifndef SEM_FAILED +#define SEM_FAILED (-1) +#endif + +static void posix_setup(void) +{ +} + +static apr_status_t posix_cleanup(void *lock_) +{ + apr_lock_t *lock=lock_; + apr_status_t stat = APR_SUCCESS; + + if (lock->interproc->filedes != -1) { + if (sem_close((sem_t *)lock->interproc->filedes) < 0) { + stat = errno; + } + } + return stat; +} + +static apr_status_t posix_create(apr_lock_t *new, const char *fname) +{ + sem_t *psem; + apr_status_t stat; + char semname[14]; + unsigned long epoch; + + new->interproc = apr_palloc(new->pool, sizeof(*new->interproc)); + /* + * This bogusness is to follow what appears to be the + * lowest common denominator in Posix semaphore naming: + * - start with '/' + * - be at most 14 chars + * - be unique and not match anything on the filesystem + * + * Because of this, we ignore fname and craft our own. + * + * FIXME: if we try to create another semaphore within a second + * of creating this on, we won't get a new one but another + * reference to this one. + */ + epoch = apr_time_now() / APR_USEC_PER_SEC; + apr_snprintf(semname, sizeof(semname), "/ApR.%lx", epoch); + psem = sem_open((const char *) semname, O_CREAT, 0644, 1); + + if (psem == (sem_t *)SEM_FAILED) { + stat = errno; + posix_cleanup(new); + return stat; + } + /* Ahhh. The joys of Posix sems. Predelete it... */ + sem_unlink((const char *) semname); + new->interproc->filedes = (int)psem; /* Ugg */ + apr_pool_cleanup_register(new->pool, (void *)new, posix_cleanup, + apr_pool_cleanup_null); + return APR_SUCCESS; +} + +static apr_status_t posix_acquire(apr_lock_t *lock) +{ + int rc; + + if ((rc = sem_wait((sem_t *)lock->interproc->filedes)) < 0) { + return errno; + } + lock->curr_locked = 1; + return APR_SUCCESS; +} + +static apr_status_t posix_release(apr_lock_t *lock) +{ + int rc; + + if ((rc = sem_post((sem_t *)lock->interproc->filedes)) < 0) { + return errno; + } + lock->curr_locked = 0; + return APR_SUCCESS; +} + +static apr_status_t posix_destroy(apr_lock_t *lock) +{ + apr_status_t stat; + + if ((stat = posix_cleanup(lock)) == APR_SUCCESS) { + apr_pool_cleanup_kill(lock->pool, lock, posix_cleanup); + return APR_SUCCESS; + } + return stat; +} + +static apr_status_t posix_child_init(apr_lock_t **lock, apr_pool_t *cont, const char *fname) +{ + return APR_SUCCESS; +} + +const apr_unix_lock_methods_t apr_unix_posix_methods = +{ +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS + APR_PROCESS_LOCK_MECH_IS_GLOBAL, +#else + 0, +#endif + posix_create, + posix_acquire, + NULL, /* no tryacquire */ + NULL, /* no rw lock */ + NULL, /* no rw lock */ + posix_release, + posix_destroy, + posix_child_init +}; + +#endif /* Posix sem implementation */ + #if APR_HAS_SYSVSEM_SERIALIZE static struct sembuf op_on; @@ -598,6 +716,9 @@ const apr_unix_lock_methods_t apr_unix_flock_methods = void apr_unix_setup_lock(void) { +#if APR_HAS_POSIXSEM_SERIALIZE + posix_setup(); +#endif #if APR_HAS_SYSVSEM_SERIALIZE sysv_setup(); #endif diff --git a/locks/unix/locks.c b/locks/unix/locks.c index ff4c38ff1ff..b6b3a1ba414 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -150,6 +150,13 @@ static apr_status_t choose_method(apr_lock_t *new, apr_lockmech_e mech) new->inter_meth = &apr_unix_sysv_methods; #else return APR_ENOTIMPL; +#endif + break; + case APR_LOCK_POSIXSEM: +#if APR_HAS_POSIXSEM_SERIALIZE + new->inter_meth = &apr_unix_posix_methods; +#else + return APR_ENOTIMPL; #endif break; case APR_LOCK_PROC_PTHREAD: @@ -162,6 +169,8 @@ static apr_status_t choose_method(apr_lock_t *new, apr_lockmech_e mech) case APR_LOCK_DEFAULT: #if APR_USE_FLOCK_SERIALIZE new->inter_meth = &apr_unix_flock_methods; +#elif APR_USE_POSIXSEM_SERIALIZE + new->inter_meth = &apr_unix_posix_methods; #elif APR_USE_SYSVSEM_SERIALIZE new->inter_meth = &apr_unix_sysv_methods; #elif APR_USE_FCNTL_SERIALIZE @@ -242,7 +251,7 @@ APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type new->pool = pool; new->type = type; new->scope = scope; -#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE new->interproc = NULL; #endif @@ -362,7 +371,7 @@ APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, const APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) { -#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE oslock->crossproc = lock->interproc->filedes; #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE @@ -387,7 +396,7 @@ APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thel (*lock) = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t)); (*lock)->pool = pool; } -#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE apr_os_file_put(&(*lock)->interproc, &thelock->crossproc, 0, pool); #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index b855d00e6c8..ae7000e3c9b 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -57,6 +57,127 @@ #include "proc_mutex.h" #include "fileio.h" /* for apr_mkstemp() */ +#if APR_HAS_POSIXSEM_SERIALIZE + +#ifndef SEM_FAILED +#define SEM_FAILED (-1) +#endif + +static void proc_mutex_posix_setup(void) +{ +} + +static apr_status_t proc_mutex_posix_cleanup(void *mutex_) +{ + apr_proc_mutex_t *mutex=mutex_; + apr_status_t stat = APR_SUCCESS; + + if (mutex->interproc->filedes != -1) { + if (sem_close((sem_t *)mutex->interproc->filedes) < 0) { + stat = errno; + } + } + return stat; +} + +static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, + const char *fname) +{ + sem_t *psem; + apr_status_t stat; + char semname[14]; + unsigned long epoch; + + new_mutex->interproc = apr_palloc(new_mutex->pool, + sizeof(*new_mutex->interproc)); + /* + * This bogusness is to follow what appears to be the + * lowest common denominator in Posix semaphore naming: + * - start with '/' + * - be at most 14 chars + * - be unique and not match anything on the filesystem + * + * Because of this, we ignore fname and craft our own. + * + * FIXME: if we try to create another semaphore within a second + * of creating this on, we won't get a new one but another + * reference to this one. + */ + epoch = apr_time_now() / APR_USEC_PER_SEC; + apr_snprintf(semname, sizeof(semname), "/ApR.%lx", epoch); + psem = sem_open((const char *) semname, O_CREAT, 0644, 1); + + if (psem == (sem_t *)SEM_FAILED) { + stat = errno; + proc_mutex_posix_cleanup(new_mutex); + return stat; + } + /* Ahhh. The joys of Posix sems. Predelete it... */ + sem_unlink((const char *) semname); + new_mutex->interproc->filedes = (int)psem; /* Ugg */ + apr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, + proc_mutex_posix_cleanup, + apr_pool_cleanup_null); + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_posix_acquire(apr_proc_mutex_t *mutex) +{ + int rc; + + if ((rc = sem_wait((sem_t *)mutex->interproc->filedes)) < 0) { + return errno; + } + mutex->curr_locked = 1; + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) +{ + int rc; + + if ((rc = sem_post((sem_t *)mutex->interproc->filedes)) < 0) { + return errno; + } + mutex->curr_locked = 0; + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_posix_destroy(apr_proc_mutex_t *mutex) +{ + apr_status_t stat; + + if ((stat = proc_mutex_posix_cleanup(mutex)) == APR_SUCCESS) { + apr_pool_cleanup_kill(mutex->pool, mutex, proc_mutex_posix_cleanup); + return APR_SUCCESS; + } + return stat; +} + +static apr_status_t proc_mutex_posix_child_init(apr_proc_mutex_t **mutex, + apr_pool_t *cont, + const char *fname) +{ + return APR_SUCCESS; +} + +const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_posix_methods = +{ +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS + APR_PROCESS_LOCK_MECH_IS_GLOBAL, +#else + 0, +#endif + proc_mutex_posix_create, + proc_mutex_posix_acquire, + NULL, /* no tryacquire */ + proc_mutex_posix_release, + proc_mutex_posix_destroy, + proc_mutex_posix_child_init +}; + +#endif /* Posix sem implementation */ + #if APR_HAS_SYSVSEM_SERIALIZE static struct sembuf proc_mutex_op_on; @@ -612,6 +733,9 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_flock_methods = void apr_proc_mutex_unix_setup_lock(void) { +#if APR_HAS_POSIXSEM_SERIALIZE + proc_mutex_posix_setup(); +#endif #if APR_HAS_SYSVSEM_SERIALIZE proc_mutex_sysv_setup(); #endif @@ -648,6 +772,13 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lo new_mutex->inter_meth = &apr_proc_mutex_unix_sysv_methods; #else return APR_ENOTIMPL; +#endif + break; + case APR_LOCK_POSIXSEM: +#if APR_HAS_POSIXSEM_SERIALIZE + new_mutex->inter_meth = &apr_proc_mutex_unix_posix_methods; +#else + return APR_ENOTIMPL; #endif break; case APR_LOCK_PROC_PTHREAD: @@ -666,6 +797,8 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lo new_mutex->inter_meth = &apr_proc_mutex_unix_fcntl_methods; #elif APR_USE_PROC_PTHREAD_SERIALIZE new_mutex->inter_meth = &apr_proc_mutex_unix_proc_pthread_methods; +#elif APR_USE_POSIXSEM_SERIALIZE + new_mutex->inter_meth = &apr_proc_mutex_unix_posix_methods; #else return APR_ENOTIMPL; #endif @@ -707,7 +840,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, sizeof(apr_proc_mutex_t)); new_mutex->pool = pool; -#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE new_mutex->interproc = NULL; #endif @@ -807,7 +940,7 @@ APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, apr_proc_mutex_t *pmutex) { -#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE ospmutex->crossproc = pmutex->interproc->filedes; #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE @@ -828,7 +961,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, sizeof(apr_proc_mutex_t)); (*pmutex)->pool = pool; } -#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE apr_os_file_put(&(*pmutex)->interproc, &ospmutex->crossproc, 0, pool); #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE From 8a50c6ba817a1ad2b437b209a036a916f1b0f6b8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 4 Apr 2002 21:25:05 +0000 Subject: [PATCH 3215/7878] fix some typos in existing posixsem logic make sure sem_open actually works before deciding that we can use it; some popular levels of Linux have a stub sem_open that returns ENOSYS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63223 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 9484bd0b2d2..1551a1cc517 100644 --- a/configure.in +++ b/configure.in @@ -1241,7 +1241,29 @@ echo $ac_n "${nl}Checking for Locking...${nl}" AC_CHECK_FUNCS(semget semctl flock) APR_CHECK_FILE(/dev/zero) AC_CHECK_HEADERS(semaphore.h) -AC_CHECK_FUNCS(sem_open sem_close sem_unlink sem_post sem_wait) +AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait) + +dnl Some systems return ENOSYS from sem_open. +AC_CACHE_CHECK(for working sem_open,ac_cv_func_sem_open,[ +AC_TRY_RUN([ +#include +#include +#include +#include +main() +{ + sem_t *psem; + const char *sem_name = "/apr_autoconf"; + + psem = sem_open(sem_name, O_CREAT, 0644, 1); + if (psem == (sem_t *)SEM_FAILED) { + exit(1); + } + sem_close(psem); + sem_unlink(sem_name); + exit(0); +}], [ac_cv_func_sem_open=yes], [ac_cv_func_sem_open=no], +[ac_cv_func_sem_open=no])]) # It's stupid, but not all platforms have union semun, even those that need it. AC_MSG_CHECKING(for union semun in sys/sem.h) @@ -1328,8 +1350,8 @@ if test "$threads" = "1"; then fi # See which lock mechanisms we can support on this system. -APR_IFALLYES(header:semaphore.h func:sem_open func_sem_close dnl - func_sem_unlink func:sem_post func_sem_wait, +APR_IFALLYES(header:semaphore.h func:sem_open func:sem_close dnl + func_sem_unlink func:sem_post func:sem_wait, hasposixser="1", hasposixser="0") APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, hassysvser="1", hassysvser="0") From 3e458cf2fff07b16cef1d0039b5ee25f3ba176ca Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 4 Apr 2002 21:35:43 +0000 Subject: [PATCH 3216/7878] Typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63224 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 1551a1cc517..38dabe6c343 100644 --- a/configure.in +++ b/configure.in @@ -1351,7 +1351,7 @@ fi # See which lock mechanisms we can support on this system. APR_IFALLYES(header:semaphore.h func:sem_open func:sem_close dnl - func_sem_unlink func:sem_post func:sem_wait, + func:sem_unlink func:sem_post func:sem_wait, hasposixser="1", hasposixser="0") APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, hassysvser="1", hassysvser="0") From e835b91d3aada003eb244bb41126ccdc612aabcb Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 5 Apr 2002 13:49:45 +0000 Subject: [PATCH 3217/7878] Be a bit more clear about the FIXME statement and the exact window we're concerned about. When oh when will we depreciate the old locking stuff :) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63225 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/crossproc.c | 10 +++++++--- locks/unix/proc_mutex.c | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index e7988cd4a5c..78af3f1c5c0 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -98,9 +98,13 @@ static apr_status_t posix_create(apr_lock_t *new, const char *fname) * * Because of this, we ignore fname and craft our own. * - * FIXME: if we try to create another semaphore within a second - * of creating this on, we won't get a new one but another - * reference to this one. + * FIXME: There is a small window of opportunity where + * instead of getting a new semaphore descriptor, we get + * a previously obtained one. This can happen if the requests + * are made at the "same time" (within a second, due to the + * apr_time_now() call) and in the small span of time between + * the sem_open and the sem_unlink. Use of O_EXCL does not + * help here however... */ epoch = apr_time_now() / APR_USEC_PER_SEC; apr_snprintf(semname, sizeof(semname), "/ApR.%lx", epoch); diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index ae7000e3c9b..e1a548598ed 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -99,9 +99,13 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, * * Because of this, we ignore fname and craft our own. * - * FIXME: if we try to create another semaphore within a second - * of creating this on, we won't get a new one but another - * reference to this one. + * FIXME: There is a small window of opportunity where + * instead of getting a new semaphore descriptor, we get + * a previously obtained one. This can happen if the requests + * are made at the "same time" (within a second, due to the + * apr_time_now() call) and in the small span of time between + * the sem_open and the sem_unlink. Use of O_EXCL does not + * help here however... */ epoch = apr_time_now() / APR_USEC_PER_SEC; apr_snprintf(semname, sizeof(semname), "/ApR.%lx", epoch); From 23dd30d589da8be6d46835b7fb80674f1c99aa94 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Fri, 5 Apr 2002 19:46:43 +0000 Subject: [PATCH 3218/7878] Fix a problem where we were walking off the end of the string. Discovered by: Brad Nicholes Submitted by: Cliff Woolley, Jim Jagielski git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63226 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_cpystrn.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index eb057111ef9..aba64ef095b 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -126,7 +126,7 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, { const char *cp; const char *ct; - int isquoted, numargs = 0; + int isquoted, numargs = 0, argnum; #define SKIP_WHITESPACE(cp) \ for ( ; *cp == ' ' || *cp == '\t'; ) { \ @@ -171,25 +171,25 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, while (*ct != '\0') { CHECK_QUOTATION(ct, isquoted); DETERMINE_NEXTSTRING(ct, isquoted); - ct++; + if (*ct != '\0') { + ct++; + } numargs++; SKIP_WHITESPACE(ct); } *argv_out = apr_palloc(token_context, numargs * sizeof(char*)); /* determine first argument */ - numargs = 0; - while (*cp != '\0') { + for (argnum = 0; argnum < (numargs-1); argnum++) { CHECK_QUOTATION(cp, isquoted); ct = cp; DETERMINE_NEXTSTRING(cp, isquoted); cp++; - (*argv_out)[numargs] = apr_palloc(token_context, cp - ct); - apr_cpystrn((*argv_out)[numargs], ct, cp - ct); - numargs++; + (*argv_out)[argnum] = apr_palloc(token_context, cp - ct); + apr_cpystrn((*argv_out)[argnum], ct, cp - ct); SKIP_WHITESPACE(cp); } - (*argv_out)[numargs] = NULL; + (*argv_out)[argnum] = NULL; return APR_SUCCESS; } From 08b7d2536e221e653c9520883ca4b5097f7948e7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 5 Apr 2002 22:15:05 +0000 Subject: [PATCH 3219/7878] make sure apr_sockaddr_t->port gets filled in after the kernel assigns an ephemeral port and the app calls apr_socket_addr_get() to get the local socket address git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63228 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 2 ++ network_io/win32/sockaddr.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 7149a25bf5e..a65a7bbc49f 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -64,6 +64,8 @@ static apr_status_t get_local_addr(apr_socket_t *sock) } else { sock->local_port_unknown = sock->local_interface_unknown = 0; + /* XXX assumes sin_port and sin6_port at same offset */ + sock->local_addr->port = ntohs(sock->local_addr->sa.sin.sin_port); return APR_SUCCESS; } } diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index 37613a3dca5..2e9304d3808 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -68,6 +68,8 @@ static apr_status_t get_local_addr(apr_socket_t *sock) } else { sock->local_port_unknown = sock->local_interface_unknown = 0; + /* XXX assumes sin_port and sin6_port at same offset */ + sock->local_addr->port = ntohs(sock->local_addr->sa.sin.sin_port); return APR_SUCCESS; } } From 8b4e19cfe4fc432ceba333cf789ff5cafe67ce70 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 8 Apr 2002 13:08:18 +0000 Subject: [PATCH 3220/7878] apr_proc_detach(): stop working so hard to figure out the process group id; we don't use that information (logic was inherited from Apache 1.3, which does use the information) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63229 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/procsup.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index 649f670d5e9..50aa5075b3d 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -57,7 +57,6 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) { int x; - pid_t pgrp; chdir("/"); #if !defined(MPE) && !defined(OS2) && !defined(TPF) && !defined(BEOS) @@ -77,21 +76,17 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) #endif #ifdef HAVE_SETSID - if ((pgrp = setsid()) == -1) { + if (setsid() == -1) { return errno; } #elif defined(NEXT) || defined(NEWSOS) - if (setpgrp(0, getpid()) == -1 || (pgrp = getpgrp(0)) == -1) { + if (setpgrp(0, getpid()) == -1) { return errno; } -#elif defined(OS2) || defined(TPF) - /* OS/2 don't support process group IDs */ - pgrp = getpid(); -#elif defined(MPE) - /* MPE uses negative pid for process group */ - pgrp = -getpid(); +#elif defined(OS2) || defined(TPF) || defined(MPE) + /* do nothing */ #else - if ((pgrp = setpgid(0, 0)) == -1) { + if (setpgid(0, 0) == -1) { return errno; } #endif From a02ca0db55dcfffda2e188689fa7f8e712bdb80d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 8 Apr 2002 15:21:54 +0000 Subject: [PATCH 3221/7878] Fix some daylight savings time breakage on (at least) AIX, Solaris, and HP-UX. It still seems to work fine on Linux and FreeBSD :) When we calculated server_gmt_offset at startup, we left it vague about whether or not the GMT time passed to mktime() was in d.s.t. mode. Since it is GMT it clearly is not d.s.t. Apparently libc was trying to be clever and figuring out whether or not it was d.s.t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63230 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ time/unix/time.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 9ccb3024ab8..28d415e85f2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix some daylight savings time breakage on (at least) AIX, + Solaris, and HP-UX. [Jeff Trawick] + *) Added support for Posix semaphores (sem_open, et.al.) for mutex locking. We use named semaphores in this implementation. The default priority is between pthread and sysvsem. diff --git a/time/unix/time.c b/time/unix/time.c index de74cfd27d8..8e6e448b2bb 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -356,7 +356,7 @@ APR_DECLARE(void) apr_unix_setup_time(void) #else t = *gmtime(&t1); #endif - t.tm_isdst = -1; + t.tm_isdst = 0; /* we know this GMT time isn't daylight-savings */ t2 = mktime(&t); server_gmt_offset = (apr_int32_t) difftime(t1, t2); #endif From 6fffa4f00d625f4abb33a0ade573f7caf64cd907 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 8 Apr 2002 22:43:33 +0000 Subject: [PATCH 3222/7878] pick up Brian Havard's fix to the Apache copy of this file (from Apache 2.0.36-dev) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63231 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_var_export.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/make_var_export.awk b/build/make_var_export.awk index 966e14ecc70..1d6f76d8ff1 100644 --- a/build/make_var_export.awk +++ b/build/make_var_export.awk @@ -47,7 +47,7 @@ function add_symbol (sym_name) { } } -/^[ \t]*AP[RU]?_DECLARE_DATA .*;$/ { +/^[ \t]*(extern[ \t]+)?AP[RU]?_DECLARE_DATA .*;$/ { varname = $NF; gsub( /[*;]/, "", varname); gsub( /\[.*\]/, "", varname); From 7d945fe9ce5a57b24e34877b3edb5bb86f9225d5 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 9 Apr 2002 06:45:06 +0000 Subject: [PATCH 3223/7878] Remove all uses of the apr_lock.h API from the tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63232 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 11 +-- test/testglobalmutex.c | 1 - test/testlock.c | 216 ----------------------------------------- test/testlockperf.c | 144 +-------------------------- test/testprocmutex.c | 1 - test/testthread.c | 11 +-- 6 files changed, 12 insertions(+), 372 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index aefbfb00681..ab929c51063 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -53,7 +53,6 @@ */ #include "apr_thread_proc.h" -#include "apr_lock.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_atomic.h" @@ -177,7 +176,7 @@ void * APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data); -apr_lock_t *thread_lock; +apr_thread_mutex_t *thread_lock; apr_thread_once_t *control = NULL; volatile long x = 0; /* mutex locks */ volatile long z = 0; /* no locks */ @@ -198,9 +197,9 @@ void * APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data) apr_thread_once(control, init_func); for (i = 0; i < NUM_ITERATIONS; i++) { - apr_lock_acquire(thread_lock); + apr_thread_mutex_lock(thread_lock); x++; - apr_lock_release(thread_lock); + apr_thread_mutex_unlock(thread_lock); } apr_thread_exit(thd, exit_ret_val); return NULL; @@ -265,8 +264,8 @@ int main(int argc, char**argv) if (mutex==1) { printf("%-60s", "Initializing the lock"); - rv = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, - APR_LOCK_DEFAULT, "lock.file", context); + rv = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, + context); if (rv != APR_SUCCESS) { fflush(stdout); fprintf(stderr, "Failed\nCould not create lock\n"); diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index 2507b72eae6..53681f9b16b 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -55,7 +55,6 @@ #include "apr_shm.h" #include "apr_thread_proc.h" #include "apr_file_io.h" -#include "apr_lock.h" #include "apr_global_mutex.h" #include "apr_errno.h" #include "apr_general.h" diff --git a/test/testlock.c b/test/testlock.c index f1e2a92e085..2daddf4ab72 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -54,7 +54,6 @@ #include "apr_thread_proc.h" #include "apr_file_io.h" -#include "apr_lock.h" #include "apr_thread_mutex.h" #include "apr_thread_rwlock.h" #include "apr_thread_cond.h" @@ -79,22 +78,16 @@ int main(void) #define MAX_COUNTER 100000 #define MAX_RETRY 5 -void * APR_THREAD_FUNC thread_rw_func(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data); -void * APR_THREAD_FUNC thread_function(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_cond_producer(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data); -apr_status_t test_rw(void); -apr_status_t test_exclusive(void); -apr_status_t test_multiple_locking(const char *lockfile); apr_status_t test_thread_mutex(void); apr_status_t test_thread_rwlock(void); apr_status_t test_cond(void); apr_status_t test_timeoutcond(void); apr_file_t *in, *out, *err; -apr_lock_t *thread_rw_lock, *thread_lock; apr_thread_mutex_t *thread_mutex; apr_thread_rwlock_t *rwlock; apr_pool_t *pool; @@ -116,31 +109,6 @@ struct { apr_thread_mutex_t *timeout_mutex; apr_thread_cond_t *timeout_cond; -void * APR_THREAD_FUNC thread_rw_func(apr_thread_t *thd, void *data) -{ - int exitLoop = 1; - - while (1) - { - apr_lock_acquire_rw(thread_rw_lock, APR_READER); - if (i == MAX_ITER) - exitLoop = 0; - apr_lock_release(thread_rw_lock); - - if (!exitLoop) - break; - - apr_lock_acquire_rw(thread_rw_lock, APR_WRITER); - if (i != MAX_ITER) - { - i++; - x++; - } - apr_lock_release(thread_rw_lock); - } - return NULL; -} - void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data) { int exitLoop = 1; @@ -166,31 +134,6 @@ void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data) return NULL; } -void * APR_THREAD_FUNC thread_function(apr_thread_t *thd, void *data) -{ - int exitLoop = 1; - - /* slight delay to allow things to settle */ - apr_sleep (1); - - while (1) - { - apr_lock_acquire(thread_lock); - if (i == MAX_ITER) - exitLoop = 0; - else - { - i++; - x++; - } - apr_lock_release(thread_lock); - - if (!exitLoop) - break; - } - return NULL; -} - void * APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data) { int exitLoop = 1; @@ -259,148 +202,6 @@ void * APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data) return NULL; } -apr_status_t test_rw(void) -{ - apr_thread_t *t1, *t2, *t3, *t4; - apr_status_t s1, s2, s3, s4; - - printf("RW Lock Tests\n"); - printf("%-60s", " Initializing the RW lock"); - s1 = apr_lock_create(&thread_rw_lock, APR_READWRITE, APR_INTRAPROCESS, - APR_LOCK_DEFAULT, "lock.file", pool); - if (s1 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); - - i = 0; - x = 0; - - printf("%-60s"," Starting all the threads"); - s1 = apr_thread_create(&t1, NULL, thread_rw_func, NULL, pool); - s2 = apr_thread_create(&t2, NULL, thread_rw_func, NULL, pool); - s3 = apr_thread_create(&t3, NULL, thread_rw_func, NULL, pool); - s4 = apr_thread_create(&t4, NULL, thread_rw_func, NULL, pool); - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || - s3 != APR_SUCCESS || s4 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); - - printf("%-60s", " Waiting for threads to exit"); - apr_thread_join(&s1, t1); - apr_thread_join(&s2, t2); - apr_thread_join(&s3, t3); - apr_thread_join(&s4, t4); - printf("OK\n"); - - if (x != MAX_ITER) { - fprintf(stderr, "RW locks didn't work as expected. x = %d instead of %d\n", - x, MAX_ITER); - } - else { - printf("Test passed\n"); - } - - return APR_SUCCESS; -} - -apr_status_t test_exclusive(void) -{ - apr_thread_t *t1, *t2, *t3, *t4; - apr_status_t s1, s2, s3, s4; - - printf("Exclusive lock test\n"); - printf("%-60s", " Initializing the lock"); - s1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, - APR_LOCK_DEFAULT, "lock.file", pool); - - if (s1 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); - - i = 0; - x = 0; - - printf("%-60s", " Starting all the threads"); - s1 = apr_thread_create(&t1, NULL, thread_function, NULL, pool); - s2 = apr_thread_create(&t2, NULL, thread_function, NULL, pool); - s3 = apr_thread_create(&t3, NULL, thread_function, NULL, pool); - s4 = apr_thread_create(&t4, NULL, thread_function, NULL, pool); - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || - s3 != APR_SUCCESS || s4 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); - - printf("%-60s", " Waiting for threads to exit"); - apr_thread_join(&s1, t1); - apr_thread_join(&s2, t2); - apr_thread_join(&s3, t3); - apr_thread_join(&s4, t4); - printf("OK\n"); - - if (x != MAX_ITER) { - fprintf(stderr, "Locks don't appear to work! x = %d instead of %d\n", - x, MAX_ITER); - } - else { - printf("Test passed\n"); - } - return APR_SUCCESS; -} - -apr_status_t test_multiple_locking(const char *lockfile) -{ - apr_lock_t *multi; - int try = 0; - apr_status_t rv; - - printf("Testing multiple locking\n"); - printf("%-60s"," Creating the lock we'll use"); - if ((rv = apr_lock_create(&multi, APR_MUTEX, APR_LOCKALL, APR_LOCK_DEFAULT, - lockfile, pool)) != APR_SUCCESS) { - printf("Failed!\n"); - return rv; - } - printf("OK\n"); - - printf("%-60s", " Trying to lock 10 times"); - for (try = 0; try < 10; try++) { - if ((rv = apr_lock_acquire(multi)) != APR_SUCCESS) { - printf("Failed!\n"); - printf("Error at try %d\n", try); - return rv; - } - } - printf("OK\n"); - - printf("%-60s", " Trying to unlock 10 times"); - for (try = 0; try < 10; try++) { - if ((rv = apr_lock_release(multi)) != APR_SUCCESS) { - printf("Failed!\n"); - printf("Error at try %d\n", try); - return rv; - } - } - printf("OK\n"); - - printf("%-60s", " Destroying the lock we've been using"); - if ((rv = apr_lock_destroy(multi)) != APR_SUCCESS) { - printf("Failed!\n"); - return rv; - } - printf("OK\n"); - - printf("Test passed\n"); - return APR_SUCCESS; -} - apr_status_t test_thread_mutex(void) { apr_thread_t *t1, *t2, *t3, *t4; @@ -674,23 +475,6 @@ int main(int argc, const char * const *argv) exit(-1); } - if ((rv = test_exclusive()) != APR_SUCCESS) { - fprintf(stderr,"Exclusive Lock test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-2); - } - - if ((rv = test_multiple_locking(lockname)) != APR_SUCCESS) { - fprintf(stderr,"Multiple Locking test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-3); - } - - if ((rv = test_rw()) != APR_SUCCESS) { - fprintf(stderr,"RW Lock test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - } - if ((rv = test_thread_mutex()) != APR_SUCCESS) { fprintf(stderr,"thread_mutex test failed : [%d] %s\n", rv, apr_strerror(rv, (char*)errmsg, 200)); diff --git a/test/testlockperf.c b/test/testlockperf.c index e7c8f1f43b2..c9515365bbe 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -56,7 +56,6 @@ #include "apr_thread_mutex.h" #include "apr_thread_rwlock.h" #include "apr_file_io.h" -#include "apr_lock.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_getopt.h" @@ -79,35 +78,19 @@ int main(void) static long mutex_counter; -static apr_lock_t *inter_lock; static apr_thread_mutex_t *thread_lock; -void * APR_THREAD_FUNC inter_mutex_func(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_mutex_func(apr_thread_t *thd, void *data); -apr_status_t test_inter_mutex(void); /* apr_lock_t -- INTRAPROCESS */ apr_status_t test_thread_mutex(void); /* apr_thread_mutex_t */ -static apr_lock_t *inter_rwlock; static apr_thread_rwlock_t *thread_rwlock; -void * APR_THREAD_FUNC inter_rwlock_func(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data); -apr_status_t test_inter_rwlock(void); /* apr_lock_t -- READWRITE */ apr_status_t test_thread_rwlock(void); /* apr_thread_rwlock_t */ +int test_thread_mutex_nested(void); + apr_pool_t *pool; int i = 0, x = 0; -void * APR_THREAD_FUNC inter_mutex_func(apr_thread_t *thd, void *data) -{ - int i; - - for (i = 0; i < MAX_COUNTER; i++) { - apr_lock_acquire(inter_lock); - mutex_counter++; - apr_lock_release(inter_lock); - } - return NULL; -} - void * APR_THREAD_FUNC thread_mutex_func(apr_thread_t *thd, void *data) { int i; @@ -120,18 +103,6 @@ void * APR_THREAD_FUNC thread_mutex_func(apr_thread_t *thd, void *data) return NULL; } -void * APR_THREAD_FUNC inter_rwlock_func(apr_thread_t *thd, void *data) -{ - int i; - - for (i = 0; i < MAX_COUNTER; i++) { - apr_lock_acquire_rw(inter_rwlock, APR_WRITER); - mutex_counter++; - apr_lock_release(inter_rwlock); - } - return NULL; -} - void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data) { int i; @@ -144,57 +115,6 @@ void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data) return NULL; } -int test_inter_mutex(void) -{ - apr_thread_t *t1, *t2, *t3, *t4; - apr_status_t s1, s2, s3, s4; - apr_time_t time_start, time_stop; - - mutex_counter = 0; - - printf("apr_lock(INTRAPROCESS, MUTEX) Lock Tests\n"); - printf("%-60s", " Initializing the apr_lock_t"); - s1 = apr_lock_create(&inter_lock, APR_MUTEX, APR_INTRAPROCESS, - APR_LOCK_DEFAULT, "lock.file", pool); - if (s1 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); - - apr_lock_acquire(inter_lock); - /* set_concurrency(4)? -aaron */ - printf("%-60s"," Starting all the threads"); - s1 = apr_thread_create(&t1, NULL, inter_mutex_func, NULL, pool); - s2 = apr_thread_create(&t2, NULL, inter_mutex_func, NULL, pool); - s3 = apr_thread_create(&t3, NULL, inter_mutex_func, NULL, pool); - s4 = apr_thread_create(&t4, NULL, inter_mutex_func, NULL, pool); - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || - s3 != APR_SUCCESS || s4 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); - - time_start = apr_time_now(); - apr_lock_release(inter_lock); - - /* printf("%-60s", " Waiting for threads to exit"); */ - apr_thread_join(&s1, t1); - apr_thread_join(&s2, t2); - apr_thread_join(&s3, t3); - apr_thread_join(&s4, t4); - /* printf("OK\n"); */ - - time_stop = apr_time_now(); - printf("microseconds: %" APR_INT64_T_FMT " usec\n", - (time_stop - time_start)); - if (mutex_counter != MAX_COUNTER * 4) - printf("error: counter = %ld\n", mutex_counter); - - return APR_SUCCESS; -} - int test_thread_mutex(void) { apr_thread_t *t1, *t2, *t3, *t4; @@ -294,54 +214,6 @@ int test_thread_mutex_nested(void) return APR_SUCCESS; } -int test_inter_rwlock(void) -{ - apr_thread_t *t1, *t2, *t3, *t4; - apr_status_t s1, s2, s3, s4; - apr_time_t time_start, time_stop; - - mutex_counter = 0; - - printf("apr_lock(INTRAPROCESS, READWRITE) Lock Tests\n"); - printf("%-60s", " Initializing the apr_lock_t"); - s1 = apr_lock_create(&inter_rwlock, APR_READWRITE, APR_INTRAPROCESS, - APR_LOCK_DEFAULT, "lock.file", pool); - if (s1 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); - - apr_lock_acquire_rw(inter_rwlock, APR_WRITER); - /* set_concurrency(4)? -aaron */ - s1 = apr_thread_create(&t1, NULL, inter_rwlock_func, NULL, pool); - s2 = apr_thread_create(&t2, NULL, inter_rwlock_func, NULL, pool); - s3 = apr_thread_create(&t3, NULL, inter_rwlock_func, NULL, pool); - s4 = apr_thread_create(&t4, NULL, inter_rwlock_func, NULL, pool); - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || - s3 != APR_SUCCESS || s4 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - - time_start = apr_time_now(); - apr_lock_release(inter_rwlock); - - /* printf("%-60s", " Waiting for threads to exit"); */ - apr_thread_join(&s1, t1); - apr_thread_join(&s2, t2); - apr_thread_join(&s3, t3); - apr_thread_join(&s4, t4); - /* printf("OK\n"); */ - - time_stop = apr_time_now(); - printf("microseconds: %" APR_INT64_T_FMT " usec\n", - (time_stop - time_start)); - if (mutex_counter != MAX_COUNTER * 4) - printf("error: counter = %ld\n", mutex_counter); - - return APR_SUCCESS; -} int test_thread_rwlock(void) { @@ -426,12 +298,6 @@ int main(int argc, const char * const *argv) exit(-1); } - if ((rv = test_inter_mutex()) != APR_SUCCESS) { - fprintf(stderr,"apr_lock(INTRAPROCESS, MUTEX) test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-2); - } - if ((rv = test_thread_mutex()) != APR_SUCCESS) { fprintf(stderr,"thread_mutex test failed : [%d] %s\n", rv, apr_strerror(rv, (char*)errmsg, 200)); @@ -444,12 +310,6 @@ int main(int argc, const char * const *argv) exit(-4); } - if ((rv = test_inter_rwlock()) != APR_SUCCESS) { - fprintf(stderr,"apr_lock(INTRAPROCESS, READWRITE) test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-5); - } - if ((rv = test_thread_rwlock()) != APR_SUCCESS) { fprintf(stderr,"thread_rwlock test failed : [%d] %s\n", rv, apr_strerror(rv, (char*)errmsg, 200)); diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 128dbe8bad6..72806837e6d 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -55,7 +55,6 @@ #include "apr_shm.h" #include "apr_thread_proc.h" #include "apr_file_io.h" -#include "apr_lock.h" #include "apr_proc_mutex.h" #include "apr_errno.h" #include "apr_general.h" diff --git a/test/testthread.c b/test/testthread.c index 11749f32953..f59cb3a5d05 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -53,7 +53,6 @@ */ #include "apr_thread_proc.h" -#include "apr_lock.h" #include "apr_errno.h" #include "apr_general.h" #include "errno.h" @@ -79,7 +78,7 @@ void * APR_THREAD_FUNC thread_func2(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_func3(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_func4(apr_thread_t *thd, void *data); -apr_lock_t *thread_lock; +apr_thread_mutex_t *thread_lock; apr_pool_t *context; apr_thread_once_t *control = NULL; int x = 0; @@ -98,9 +97,9 @@ void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data) apr_thread_once(control, init_func); for (i = 0; i < 10000; i++) { - apr_lock_acquire(thread_lock); + apr_thread_mutex_lock(thread_lock); x++; - apr_lock_release(thread_lock); + apr_thread_mutex_unlock(thread_lock); } apr_thread_exit(thd, exit_ret_val); return NULL; @@ -129,8 +128,8 @@ int main(void) apr_thread_once_init(&control, context); printf("%-60s", "Initializing the lock"); - r1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, - APR_LOCK_DEFAULT, "lock.file", context); + r1 = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, + context); if (r1 != APR_SUCCESS) { fflush(stdout); fprintf(stderr, "Failed\nCould not create lock\n"); From bc688a8717126ba541807c84e93ff82e1e381401 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 9 Apr 2002 06:50:12 +0000 Subject: [PATCH 3224/7878] Remove unnecessary include of apr_lock.h (untested patch). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63233 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/netware/apr_atomic.c | 1 - 1 file changed, 1 deletion(-) diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index 5eecd079ad6..7687a126d52 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -54,7 +54,6 @@ #include "apr.h" -#include "apr_lock.h" #include "apr_thread_mutex.h" #include "apr_atomic.h" From 57e14d400ae1d87379256a68eb59bc995f065045 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 9 Apr 2002 06:56:56 +0000 Subject: [PATCH 3225/7878] ** DEPRECATE old lock API: apr_lock.h ** Resolve some circular includes (apr_thread_mutex.h needs apr_pools.h needs apr_allocator.h needs apr_thread_mutex.h ...). Remove all apr_lock.h related files (incl. arch-specific headers and implementations). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63234 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 3 +- include/apr_allocator.h | 9 +- include/apr_global_mutex.h | 2 +- include/apr_lock.h | 235 ---------- include/apr_pools.h | 3 +- include/apr_portable.h | 29 -- include/apr_proc_mutex.h | 5 +- include/apr_thread_mutex.h | 4 +- include/arch/beos/locks.h | 88 ---- include/arch/netware/locks.h | 73 --- include/arch/os2/locks.h | 73 --- include/arch/unix/locks.h | 178 ------- include/arch/unix/proc_mutex.h | 1 - include/arch/win32/locks.h | 70 --- include/arch/win32/thread_mutex.h | 2 +- locks/beos/locks.c | 459 ------------------- locks/netware/locks.c | 317 ------------- locks/os2/locks.c | 288 ------------ locks/unix/Makefile.in | 3 - locks/unix/crossproc.c | 738 ------------------------------ locks/unix/intraproc.c | 229 --------- locks/unix/locks.c | 412 ----------------- locks/unix/proc_mutex.c | 6 +- locks/win32/locks.c | 303 ------------ misc/unix/start.c | 2 - 25 files changed, 19 insertions(+), 3513 deletions(-) delete mode 100644 include/apr_lock.h delete mode 100644 include/arch/beos/locks.h delete mode 100644 include/arch/netware/locks.h delete mode 100644 include/arch/os2/locks.h delete mode 100644 include/arch/unix/locks.h delete mode 100644 include/arch/win32/locks.h delete mode 100644 locks/beos/locks.c delete mode 100644 locks/netware/locks.c delete mode 100644 locks/os2/locks.c delete mode 100644 locks/unix/crossproc.c delete mode 100644 locks/unix/intraproc.c delete mode 100644 locks/unix/locks.c delete mode 100644 locks/win32/locks.c diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index aa35a0d9155..5dba3c4b353 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -54,9 +54,8 @@ #include "apr.h" -#include "apr_lock.h" -#include "apr_thread_mutex.h" #include "apr_atomic.h" +#include "apr_thread_mutex.h" #if APR_HAS_THREADS diff --git a/include/apr_allocator.h b/include/apr_allocator.h index a2d2aa1bbf1..079dee778eb 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -76,10 +76,6 @@ extern "C" { #define APR_WANT_MEMFUNC #include "apr_want.h" -#include "apr_thread_mutex.h" -#include "apr_pools.h" - - /** the allocator structure */ typedef struct apr_allocator_t apr_allocator_t; /** the structure which holds information about the allocation */ @@ -132,6 +128,9 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, apr_memnode_t *memnode); + +#include "apr_pools.h" + /** * Set the owner of the allocator * @param allocator The allocator to set the owner for @@ -152,6 +151,8 @@ APR_DECLARE(void) apr_allocator_set_owner(apr_allocator_t *allocator, */ APR_DECLARE(apr_pool_t *) apr_allocator_get_owner(apr_allocator_t *allocator); +#include "apr_thread_mutex.h" + #if APR_HAS_THREADS /** * Set a mutex for the allocator to use diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index b51388a6386..4ef988a0a08 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -56,7 +56,7 @@ #define APR_GLOBAL_MUTEX_H #include "apr.h" -#include "apr_lock.h" /* only for apr_lockmech_e */ +#include "apr_proc_mutex.h" /* only for apr_lockmech_e */ #include "apr_pools.h" #include "apr_errno.h" diff --git a/include/apr_lock.h b/include/apr_lock.h deleted file mode 100644 index 052adf979e4..00000000000 --- a/include/apr_lock.h +++ /dev/null @@ -1,235 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_LOCKS_H -#define APR_LOCKS_H - -#include "apr.h" -#include "apr_pools.h" -#include "apr_errno.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** - * @file apr_lock.h - * @brief APR Locking Routines - */ - -/** - * @defgroup APR_Lock Locking Routines - * @ingroup APR - * @{ - */ - -typedef enum {APR_CROSS_PROCESS, APR_INTRAPROCESS, APR_LOCKALL} apr_lockscope_e; - -typedef enum {APR_MUTEX, APR_READWRITE} apr_locktype_e; - -typedef enum {APR_READER, APR_WRITER} apr_readerwriter_e; - -typedef enum {APR_LOCK_FCNTL, APR_LOCK_FLOCK, APR_LOCK_SYSVSEM, - APR_LOCK_PROC_PTHREAD, APR_LOCK_POSIXSEM, - APR_LOCK_DEFAULT} apr_lockmech_e; - -typedef struct apr_lock_t apr_lock_t; - -/* Function definitions */ - -/** - * Create a new instance of a lock structure. - * @param lock The newly created lock structure. - * @param type The type of lock to create, one of: - *

    - *            APR_MUTEX
    - *            APR_READWRITE
    - * 
    - * @param scope The scope of the lock to create, one of: - *
    - *            APR_CROSS_PROCESS    lock processes from the protected area.
    - *            APR_INTRAPROCESS     lock threads from the protected area.
    - *            APR_LOCKALL          lock processes and threads from the
    - *                                 protected area.
    - * 
    - * @param mech The mechanism to use for the interprocess lock, if any; one of - *
    - *            APR_LOCK_FCNTL
    - *            APR_LOCK_FLOCK
    - *            APR_LOCK_SYSVSEM
    - *            APR_LOCK_POSIXSEM
    - *            APR_LOCK_PROC_PTHREAD
    - *            APR_LOCK_DEFAULT     pick the default mechanism for the platform
    - * 
    - * @param fname A file name to use if the lock mechanism requires one. This - * argument should always be provided. The lock code itself will - * determine if it should be used. - * @param pool The pool to operate on. - * @warning APR_CROSS_PROCESS may lock both processes and threads, but it is - * only guaranteed to lock processes. - * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports - * APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. - * @deprecated CAUTION: This API has been deprecated. The new and expanded - * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, - * apr_thread_rwlock.h, and apr_thread_cond.h. - */ -APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, - apr_locktype_e type, - apr_lockscope_e scope, - apr_lockmech_e mech, - const char *fname, - apr_pool_t *pool); - -/** - * Lock a protected region. - * @param lock The lock to set. - * @deprecated CAUTION: This API has been deprecated. The new and expanded - * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, - * apr_thread_rwlock.h, and apr_thread_cond.h. - */ -APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock); - -/** - * Tries to lock a protected region. - * @param lock The lock to set. - * @return If it fails, returns APR_EBUSY. Otherwise, it returns APR_SUCCESS. - * @deprecated CAUTION: This API has been deprecated. The new and expanded - * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, - * apr_thread_rwlock.h, and apr_thread_cond.h. - */ -APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock); - -/** - * Lock a region with either a reader or writer lock. - * @param lock The lock to set. - * @param type The type of lock to acquire. - * @deprecated CAUTION: This API has been deprecated. The new and expanded - * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, - * apr_thread_rwlock.h, and apr_thread_cond.h. - */ -APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock, - apr_readerwriter_e type); - -/** - * Unlock a protected region. - * @param lock The lock to reset. - * @deprecated CAUTION: This API has been deprecated. The new and expanded - * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, - * apr_thread_rwlock.h, and apr_thread_cond.h. - */ -APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock); - -/** - * Free the memory associated with a lock. - * @param lock The lock to free. - * @remark If the lock is currently active when it is destroyed, it - * will be unlocked first. - * @deprecated CAUTION: This API has been deprecated. The new and expanded - * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, - * apr_thread_rwlock.h, and apr_thread_cond.h. - */ -APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock); - -/** - * Re-open a lock in a child process. - * @param lock The newly re-opened lock structure. - * @param fname A file name to use if the lock mechanism requires one. This - * argument should always be provided. The lock code itself will - * determine if it should be used. This filename should be the - * same one that was passed to apr_lock_create - * @param pool The pool to operate on. - * @remark This function doesn't always do something, it depends on the - * locking mechanism chosen for the platform, but it is a good - * idea to call it regardless, because it makes the code more - * portable. - * @deprecated CAUTION: This API has been deprecated. The new and expanded - * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, - * apr_thread_rwlock.h, and apr_thread_cond.h. - */ -APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, - const char *fname, - apr_pool_t *pool); - -/** - * Return the pool associated with the current lock. - * @param lock The currently open lock. - * @param key The key to use when retreiving data associated with this lock - * @param data The user data associated with the lock. - * @deprecated CAUTION: This API has been deprecated. The new and expanded - * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, - * apr_thread_rwlock.h, and apr_thread_cond.h. - */ -APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key, - void *data); - -/** - * Return the pool associated with the current lock. - * @param lock The currently open lock. - * @param data The user data to associate with the lock. - * @param key The key to use when associating data with this lock - * @param cleanup The cleanup to use when the lock is destroyed. - * @deprecated CAUTION: This API has been deprecated. The new and expanded - * synchronization routines reside in apr_thread_mutex.h, apr_proc_mutex.h, - * apr_thread_rwlock.h, and apr_thread_cond.h. - */ -APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, - const char *key, - apr_status_t (*cleanup)(void *)); - -/** @} */ -#ifdef __cplusplus -} -#endif - -#endif /* ! APR_LOCKS_H */ diff --git a/include/apr_pools.h b/include/apr_pools.h index b7b5b09c05f..220407d2061 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -120,7 +120,6 @@ typedef struct apr_pool_t apr_pool_t; (const apr_##typename##_t *ob) { return ob->pool; } -#include "apr_allocator.h" /** * Pool debug levels @@ -207,6 +206,8 @@ APR_DECLARE(void) apr_pool_terminate(void); * Pool creation/destruction */ +#include "apr_allocator.h" + /** * Create a new pool. * @param newpool The pool we have just created. diff --git a/include/apr_portable.h b/include/apr_portable.h index 6e661192426..35648dc0645 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -74,7 +74,6 @@ #include "apr_file_io.h" #include "apr_network_io.h" #include "apr_errno.h" -#include "apr_lock.h" #include "apr_proc_mutex.h" #include "apr_time.h" #include "apr_dso.h" @@ -99,8 +98,6 @@ extern "C" { typedef HANDLE apr_os_file_t; typedef HANDLE apr_os_dir_t; typedef SOCKET apr_os_sock_t; -/* We're deprecating apr_lock_t, so apr_os_lock_t will be gone too. */ -typedef HANDLE apr_os_lock_t; typedef HANDLE apr_os_proc_mutex_t; typedef HANDLE apr_os_thread_t; typedef HANDLE apr_os_proc_t; @@ -114,8 +111,6 @@ typedef HANDLE apr_os_shm_t; typedef HFILE apr_os_file_t; typedef HDIR apr_os_dir_t; typedef int apr_os_sock_t; -/* We're deprecating apr_lock_t, so apr_os_lock_t will be gone too. */ -typedef HMTX apr_os_lock_t; typedef HMTX apr_os_proc_mutex_t; typedef TID apr_os_thread_t; typedef PID apr_os_proc_t; @@ -137,8 +132,6 @@ struct apr_os_proc_mutex_t { typedef int apr_os_file_t; typedef DIR apr_os_dir_t; typedef int apr_os_sock_t; -/* We're deprecating apr_lock_t, so apr_os_lock_t will be gone too. */ -typedef struct apr_os_proc_mutex_t apr_os_lock_t; typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_t; typedef thread_id apr_os_thread_t; typedef thread_id apr_os_proc_t; @@ -152,8 +145,6 @@ typedef void* apr_os_shm_t; typedef int apr_os_file_t; typedef DIR apr_os_dir_t; typedef int apr_os_sock_t; -/* We're deprecating apr_lock_t, so apr_os_lock_t will be gone too. */ -typedef NXMutex_t apr_os_lock_t; typedef NXMutex_t apr_os_proc_mutex_t; typedef NXThreadId_t apr_os_thread_t; typedef long apr_os_proc_t; @@ -186,8 +177,6 @@ struct apr_os_proc_mutex_t { typedef int apr_os_file_t; typedef DIR apr_os_dir_t; typedef int apr_os_sock_t; -/* We're deprecating apr_lock_t, so apr_os_lock_t will be gone too. */ -typedef struct apr_os_proc_mutex_t apr_os_lock_t; typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_t; #if APR_HAS_THREADS && APR_HAVE_PTHREAD_H typedef pthread_t apr_os_thread_t; @@ -254,14 +243,6 @@ APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock); -/** - * Convert the lock from os specific type to apr type - * @param oslock The os specific lock we are converting to. - * @param lock The apr lock to convert. - */ -APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *oslock, - apr_lock_t *lock); - /** * Convert the proc mutex from os specific type to apr type * @param ospmutex The os specific proc mutex we are converting to. @@ -397,16 +378,6 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont); -/** - * Convert the lock from os specific type to apr type - * @param lock The apr lock we are converting to. - * @param thelock The os specific lock to convert. - * @param cont The pool to use if it is needed. - */ -APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, - apr_os_lock_t *thelock, - apr_pool_t *cont); - /** * Convert the proc mutex from os specific type to apr type * @param pmutex The apr proc mutex we are converting to. diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index a883f8d19e5..ea5225b5f5a 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -56,7 +56,6 @@ #define APR_PROC_MUTEX_H #include "apr.h" -#include "apr_lock.h" /* only for apr_lockmech_e_np */ #include "apr_pools.h" #include "apr_errno.h" @@ -75,6 +74,10 @@ extern "C" { * @{ */ +typedef enum {APR_LOCK_FCNTL, APR_LOCK_FLOCK, APR_LOCK_SYSVSEM, + APR_LOCK_PROC_PTHREAD, APR_LOCK_POSIXSEM, + APR_LOCK_DEFAULT} apr_lockmech_e; + typedef struct apr_proc_mutex_t apr_proc_mutex_t; /* Function definitions */ diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index e7fdb1ba5a7..4e9381570cf 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -56,7 +56,6 @@ #define APR_THREAD_MUTEX_H #include "apr.h" -#include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus @@ -81,6 +80,9 @@ typedef struct apr_thread_mutex_t apr_thread_mutex_t; #define APR_THREAD_MUTEX_DEFAULT 0x0 #define APR_THREAD_MUTEX_NESTED 0x1 +/* Delayed the include to avoid a circular reference */ +#include "apr_pools.h" + /** * Create and initialize a mutex that can be used to synchronize threads. * @param mutex the memory address where the newly created mutex will be diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h deleted file mode 100644 index 192274eceef..00000000000 --- a/include/arch/beos/locks.h +++ /dev/null @@ -1,88 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef LOCKS_H -#define LOCKS_H - -#include -#include "apr_pools.h" -#include "apr_lock.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_portable.h" - -struct apr_lock_t { - apr_pool_t *pool; - apr_locktype_e type; - apr_lockscope_e scope; - apr_os_thread_t owner; - int owner_ref; - - /* Our lock :) */ - sem_id Lock; - int32 LockCount; - - /* Read/Write lock stuff */ - sem_id Read; - int32 ReadCount; - sem_id Write; - int32 WriteCount; - int32 Nested; - - thread_id writer; -}; - -#endif /* LOCKS_H */ - diff --git a/include/arch/netware/locks.h b/include/arch/netware/locks.h deleted file mode 100644 index f52a814a388..00000000000 --- a/include/arch/netware/locks.h +++ /dev/null @@ -1,73 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef LOCKS_H -#define LOCKS_H - -#define NDEBUG - -#include "apr_lock.h" -#include - -struct apr_lock_t { - apr_pool_t *pool; - apr_locktype_e type; - apr_lockscope_e scope; - NXMutex_t *mutex; - NXRwLock_t *rwlock; - char *fname; -}; - -#endif /* LOCKS_H */ - diff --git a/include/arch/os2/locks.h b/include/arch/os2/locks.h deleted file mode 100644 index 49f60ff3ff2..00000000000 --- a/include/arch/os2/locks.h +++ /dev/null @@ -1,73 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef LOCKS_H -#define LOCKS_H - -#include "apr_lock.h" -#include "apr_file_io.h" - -struct apr_lock_t { - apr_pool_t *pool; - apr_locktype_e type; - apr_lockscope_e scope; - char *fname; - HMTX hMutex; - TID owner; - int lock_count; - TIB *tib; -}; - -#endif /* LOCKS_H */ - diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h deleted file mode 100644 index 2c422a27399..00000000000 --- a/include/arch/unix/locks.h +++ /dev/null @@ -1,178 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef LOCKS_H -#define LOCKS_H - -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_lock.h" -#include "apr_portable.h" -#include "proc_mutex.h" - -/* System headers required by Locks library */ -#if APR_HAVE_SYS_TYPES_H -#include -#endif -#if APR_HAVE_STDIO_H -#include -#endif -#if APR_HAVE_FCNTL_H -#include -#endif - -#ifdef HAVE_SYS_SEM_H -#include -#endif -#ifdef HAVE_SYS_FILE_H -#include -#endif -#if APR_HAVE_STDLIB_H -#include -#endif -#if APR_HAVE_UNISTD_H -#include -#endif -#if APR_HAVE_STRING_H -#include -#endif -#ifdef HAVE_SYS_MMAN_H -#include -#endif -#if APR_HAVE_PTHREAD_H -#include -#endif -#if APR_HAVE_SEMAPHORE_H -#include -#endif -/* End System Headers */ - -struct apr_unix_lock_methods_t { - unsigned int flags; - apr_status_t (*create)(apr_lock_t *, const char *); - apr_status_t (*acquire)(apr_lock_t *); - apr_status_t (*tryacquire)(apr_lock_t *); - apr_status_t (*acquire_read)(apr_lock_t *); - apr_status_t (*acquire_write)(apr_lock_t *); - apr_status_t (*release)(apr_lock_t *); - apr_status_t (*destroy)(apr_lock_t *); - apr_status_t (*child_init)(apr_lock_t **, apr_pool_t *, const char *); -}; -typedef struct apr_unix_lock_methods_t apr_unix_lock_methods_t; - -/* bit values for flags field in apr_unix_lock_methods_t */ -#define APR_PROCESS_LOCK_MECH_IS_GLOBAL 1 - -#if APR_HAS_POSIXSEM_SERIALIZE -extern const apr_unix_lock_methods_t apr_unix_posix_methods; -#endif -#if APR_HAS_SYSVSEM_SERIALIZE -extern const apr_unix_lock_methods_t apr_unix_sysv_methods; -#endif -#if APR_HAS_FCNTL_SERIALIZE -extern const apr_unix_lock_methods_t apr_unix_fcntl_methods; -#endif -#if APR_HAS_FLOCK_SERIALIZE -extern const apr_unix_lock_methods_t apr_unix_flock_methods; -#endif -#if APR_HAS_PROC_PTHREAD_SERIALIZE -extern const apr_unix_lock_methods_t apr_unix_proc_pthread_methods; -#endif -#if APR_HAS_RWLOCK_SERIALIZE -extern const apr_unix_lock_methods_t apr_unix_rwlock_methods; -#endif - -struct apr_lock_t { - apr_pool_t *pool; - const apr_unix_lock_methods_t *meth; - const apr_unix_lock_methods_t *inter_meth, *intra_meth; /* for APR_LOCK_ALL */ - apr_locktype_e type; - apr_lockscope_e scope; - int curr_locked; - char *fname; -#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE - apr_file_t *interproc; -#endif -#if APR_HAS_PROC_PTHREAD_SERIALIZE - pthread_mutex_t *pthread_interproc; -#endif -#if APR_HAS_THREADS - /* APR doesn't have threads, no sense in having an thread lock mechanism. - */ - - apr_os_thread_t owner; - int owner_ref; - -#if APR_USE_PTHREAD_SERIALIZE - pthread_mutex_t *intraproc; -#endif -#ifdef HAVE_PTHREAD_RWLOCK_INIT - pthread_rwlock_t rwlock; -#endif -#endif - /* At some point, we should do a scope for both inter and intra process - * locking here. Something like pthread_mutex with PTHREAD_PROCESS_SHARED - */ -}; - -#if APR_HAS_THREADS -extern const apr_unix_lock_methods_t apr_unix_intra_methods; -#endif - -void apr_unix_setup_lock(void); - -#endif /* LOCKS_H */ - diff --git a/include/arch/unix/proc_mutex.h b/include/arch/unix/proc_mutex.h index f3375b2cf24..563d6098829 100644 --- a/include/arch/unix/proc_mutex.h +++ b/include/arch/unix/proc_mutex.h @@ -148,7 +148,6 @@ struct apr_proc_mutex_t { apr_pool_t *pool; const apr_proc_mutex_unix_lock_methods_t *meth; const apr_proc_mutex_unix_lock_methods_t *inter_meth; - apr_lockscope_e scope; int curr_locked; char *fname; #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE diff --git a/include/arch/win32/locks.h b/include/arch/win32/locks.h deleted file mode 100644 index 8165c40f3e0..00000000000 --- a/include/arch/win32/locks.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef LOCKS_H -#define LOCKS_H - -#include "apr_lock.h" - -struct apr_lock_t { - apr_pool_t *pool; - apr_locktype_e type; - apr_lockscope_e scope; - HANDLE mutex; - CRITICAL_SECTION section; - char *fname; -}; - -#endif /* LOCKS_H */ - diff --git a/include/arch/win32/thread_mutex.h b/include/arch/win32/thread_mutex.h index 19524f5cbc9..9744bf9c5a2 100644 --- a/include/arch/win32/thread_mutex.h +++ b/include/arch/win32/thread_mutex.h @@ -55,7 +55,7 @@ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H -#include "apr_lock.h" +#include "apr_pools.h" struct apr_thread_mutex_t { apr_pool_t *pool; diff --git a/locks/beos/locks.c b/locks/beos/locks.c deleted file mode 100644 index 4ac75cf96bb..00000000000 --- a/locks/beos/locks.c +++ /dev/null @@ -1,459 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/*Read/Write locking implementation based on the MultiLock code from - * Stephen Beaulieu - */ - -#include "beos/locks.h" -#include "apr_strings.h" -#include "apr_portable.h" - -#define BIG_NUM 100000 - -static apr_status_t _lock_cleanup(void * data) -{ - apr_lock_t *lock = (apr_lock_t*)data; - if (lock->LockCount != 0) { - /* we're still locked... */ - while (atomic_add(&lock->LockCount , -1) > 1){ - /* OK we had more than one person waiting on the lock so - * the sem is also locked. Release it until we have no more - * locks left. - */ - release_sem (lock->Lock); - } - } - delete_sem(lock->Lock); - return APR_SUCCESS; -} - -static apr_status_t _lock_rw_cleanup(void * data) -{ - apr_lock_t *lock = (apr_lock_t*)data; - - if (lock->ReadCount != 0) { - while (atomic_add(&lock->ReadCount , -1) > 1){ - release_sem (lock->Read); - } - } - if (lock->WriteCount != 0) { - while (atomic_add(&lock->WriteCount , -1) > 1){ - release_sem (lock->Write); - } - } - if (lock->LockCount != 0) { - while (atomic_add(&lock->LockCount , -1) > 1){ - release_sem (lock->Lock); - } - } - - delete_sem(lock->Read); - delete_sem(lock->Write); - delete_sem(lock->Lock); - return APR_SUCCESS; -} - -static apr_status_t _create_lock(apr_lock_t *new) -{ - int32 stat; - - if ((stat = create_sem(0, "APR_Lock")) < B_NO_ERROR) { - _lock_cleanup(new); - return stat; - } - new->LockCount = 0; - new->Lock = stat; - apr_pool_cleanup_register(new->pool, (void *)new, _lock_cleanup, - apr_pool_cleanup_null); - return APR_SUCCESS; -} - -static apr_status_t _create_rw_lock(apr_lock_t *new) -{ - /* we need to make 3 locks... */ - new->ReadCount = 0; - new->WriteCount = 0; - new->LockCount = 0; - new->Read = create_sem(0, "APR_ReadLock"); - new->Write = create_sem(0, "APR_WriteLock"); - new->Lock = create_sem(0, "APR_Lock"); - - if (new->Lock < 0 || new->Read < 0 || new->Write < 0) { - _lock_rw_cleanup(new); - return -1; - } - - apr_pool_cleanup_register(new->pool, (void *)new, _lock_rw_cleanup, - apr_pool_cleanup_null); - return APR_SUCCESS; -} - -static apr_status_t _lock(apr_lock_t *lock) -{ - int32 stat; - - if (atomic_add(&lock->LockCount, 1) > 0) { - if ((stat = acquire_sem(lock->Lock)) < B_NO_ERROR) { - atomic_add(&lock->LockCount, -1); - return stat; - } - } - return APR_SUCCESS; -} - -static apr_status_t _unlock(apr_lock_t *lock) -{ - int32 stat; - - if (atomic_add(&lock->LockCount, -1) > 1) { - if ((stat = release_sem(lock->Lock)) < B_NO_ERROR) { - atomic_add(&lock->LockCount, 1); - return stat; - } - } - return APR_SUCCESS; -} - -static apr_status_t _read_lock(apr_lock_t *lock) -{ - int32 rv = APR_SUCCESS; - - if (find_thread(NULL) == lock->writer) { - /* we're the writer - no problem */ - lock->Nested++; - } else { - /* we're not the writer */ - int32 r = atomic_add(&lock->ReadCount, 1); - if (r < 0) { - /* Oh dear, writer holds lock, wait for sem */ - rv = acquire_sem_etc(lock->Read, 1, B_DO_NOT_RESCHEDULE, - B_INFINITE_TIMEOUT); - } - } - - return rv; -} - -static apr_status_t _write_lock(apr_lock_t *lock) -{ - int rv = APR_SUCCESS; - - if (find_thread(NULL) == lock->writer) { - lock->Nested++; - } else { - /* we're not the writer... */ - if (atomic_add(&lock->LockCount, 1) >= 1) { - /* we're locked - acquire the sem */ - rv = acquire_sem_etc(lock->Lock, 1, B_DO_NOT_RESCHEDULE, - B_INFINITE_TIMEOUT); - } - if (rv == APR_SUCCESS) { - /* decrement the ReadCount to a large -ve number so that - * we block on new readers... - */ - int32 readers = atomic_add(&lock->ReadCount, -BIG_NUM); - if (readers > 0) { - /* readers are holding the lock */ - rv = acquire_sem_etc(lock->Write, readers, B_DO_NOT_RESCHEDULE, - B_INFINITE_TIMEOUT); - } - if (rv == APR_SUCCESS) - lock->writer = find_thread(NULL); - } - } - - return rv; -} - - -static apr_status_t _read_unlock(apr_lock_t *lock) -{ - apr_status_t rv = APR_SUCCESS; - - /* we know we hold the lock, so don't check it :) */ - if (find_thread(NULL) == lock->writer) { - /* we're recursively locked */ - lock->Nested--; - return APR_SUCCESS; - } - /* OK so we need to release the sem if we have it :) */ - if (atomic_add(&lock->ReadCount, -1) < 0) { - /* we have a writer waiting for the lock, so release it */ - rv = release_sem_etc(lock->Write, 1, B_DO_NOT_RESCHEDULE); - } - - return rv; -} - -static apr_status_t _write_unlock(apr_lock_t *lock) -{ - apr_status_t rv = APR_SUCCESS; - int32 readers; - - /* we know we hold the lock, so don't check it :) */ - if (lock->Nested > 1) { - /* we're recursively locked */ - lock->Nested--; - return APR_SUCCESS; - } - /* OK so we need to release the sem if we have it :) */ - readers = atomic_add(&lock->ReadCount, BIG_NUM) + BIG_NUM; - if (readers > 0) { - rv = release_sem_etc(lock->Read, readers, B_DO_NOT_RESCHEDULE); - } - if (rv == APR_SUCCESS) { - lock->writer = -1; - if (atomic_add(&lock->LockCount, -1) > 1) { - rv = release_sem_etc(lock->Lock, 1, B_DO_NOT_RESCHEDULE); - } - } - - return rv; -} - -static apr_status_t _destroy_lock(apr_lock_t *lock) -{ - apr_status_t stat; - if ((stat = _lock_cleanup(lock)) == APR_SUCCESS) { - apr_pool_cleanup_kill(lock->pool, lock, _lock_cleanup); - return APR_SUCCESS; - } - return stat; -} - -APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, - apr_lockscope_e scope, apr_lockmech_e mech, - const char *fname, apr_pool_t *pool) -{ - apr_lock_t *new; - apr_status_t stat = APR_SUCCESS; - - if (mech != APR_LOCK_DEFAULT) { - return APR_ENOTIMPL; - } - - new = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t)); - if (new == NULL){ - return APR_ENOMEM; - } - - new->pool = pool; - new->type = type; - new->scope = scope; - - if (type == APR_MUTEX) { - stat = _create_lock(new); - } else if (type == APR_READWRITE) { - stat = _create_rw_lock(new); - } - - if (stat != APR_SUCCESS) - return stat; - - (*lock) = new; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock) -{ - apr_status_t stat; - - if (lock->owner == apr_os_thread_current()) { - lock->owner_ref++; - return APR_SUCCESS; - } - - switch (lock->type) - { - case APR_MUTEX: - if ((stat = _lock(lock)) != APR_SUCCESS) - return stat; - break; - - case APR_READWRITE: - return APR_ENOTIMPL; - } - - lock->owner = apr_os_thread_current(); - lock->owner_ref = 1; - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) -{ - switch (lock->type) - { - case APR_MUTEX: - return APR_ENOTIMPL; - case APR_READWRITE: - switch (e) - { - case APR_READER: - _read_lock(lock); - break; - case APR_WRITER: - _write_lock(lock); - break; - } - } - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock) -{ - apr_status_t stat = APR_SUCCESS; - - if (lock->owner_ref > 0 && lock->owner == apr_os_thread_current()) { - lock->owner_ref--; - if (lock->owner_ref > 0) - return APR_SUCCESS; - } - - switch (lock->type) - { - case APR_MUTEX: - stat = _unlock(lock); - break; - case APR_READWRITE: - { - thread_id me = find_thread(NULL); - if (me == lock->writer) - stat = _write_unlock(lock); - else - stat = _read_unlock(lock); - } - /* if we don't hold the read or write lock then why are - * we calling release??? - * - * Just return success. - */ - break; - } - - if (stat != APR_SUCCESS) - return stat; - - lock->owner = -1; - lock->owner_ref = 0; - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock) -{ - apr_status_t stat; - - switch (lock->type) - { - case APR_MUTEX: - if ((stat = _destroy_lock(lock)) != APR_SUCCESS) - return stat; - break; - case APR_READWRITE: - return APR_ENOTIMPL; - } - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, const char *fname, - apr_pool_t *pool) -{ - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, - const char *key, void *data) -{ - return apr_pool_userdata_get(data, key, lock->pool); -} - -APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, - void *data, const char *key, - apr_status_t (*cleanup) (void *)) -{ - return apr_pool_userdata_set(data, key, cleanup, lock->pool); -} - -APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) -{ - oslock->sem = lock->Lock; - oslock->ben = lock->LockCount; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, - apr_pool_t *pool) -{ - if (pool == NULL) { - return APR_ENOPOOL; - } - if ((*lock) == NULL) { - (*lock) = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t)); - (*lock)->pool = pool; - } - (*lock)->Lock = thelock->sem; - (*lock)->LockCount = thelock->ben; - - return APR_SUCCESS; -} - diff --git a/locks/netware/locks.c b/locks/netware/locks.c deleted file mode 100644 index b7aa2a7645e..00000000000 --- a/locks/netware/locks.c +++ /dev/null @@ -1,317 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "locks.h" -#include "apr_portable.h" - -static apr_status_t lock_cleanup(void *lock_) -{ - apr_lock_t *lock = lock_; - - switch (lock->type) - { - case APR_MUTEX: - NXMutexFree(lock->mutex); - break; - case APR_READWRITE: - NXRwLockFree (lock->rwlock); - break; - } - return APR_SUCCESS; -} - -apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, - apr_lockmech_e mech, const char *fname, apr_pool_t *pool) -{ - - apr_lock_t *newlock = NULL; - - /* struct apr_lock_t { - apr_pool_t *pool; - apr_locktype_e type; - apr_lockscope_e scope; - NXMutex_t *mutex; - NXRwLock_t *rwlock; - char *fname; - }; - */ - NXHierarchy_t hierarchy=0; //for libc NKS NXRwLockAlloc - NXLockInfo_t *info; //for libc NKS NXRwLockAlloc - apr_status_t status; - long flags = 0; - - if (mech != APR_LOCK_DEFAULT) { - return APR_ENOTIMPL; - } - - newlock = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); - - if(newlock ==NULL) { - return APR_ENOMEM; - } - newlock->pool = pool; - /* ToDo: How to handle the case when no pool is available? - * How to cleanup the storage properly? - */ - newlock->fname = apr_pstrdup(pool, fname); - newlock->type = type; - newlock->scope = scope; - -//srj fill in scope later -//srj if (scope == APR_INTRAPROCESS) { -//srj InitializeCriticalSection(&newlock->section); -//srj } else { - - switch (type) - { - case APR_MUTEX: - flags=NX_MUTEX_RECURSIVE; - newlock->mutex = NXMutexAlloc(flags,NULL, NULL); - - if(newlock->mutex == NULL) - return APR_ENOMEM; - break; - case APR_READWRITE: - - info = (NXLockInfo_t *)apr_palloc(pool, sizeof(NXLockInfo_t)); - hierarchy=1; - //srj NXRwLockAlloc Allocates and initializes a reader/writer lock - //srj RWLocks are not recursive - newlock->rwlock = NXRwLockAlloc(hierarchy,info); - if(newlock->rwlock == NULL) - return APR_ENOMEM; - break; - } - -// } end of else for scope - - *lock = newlock; - apr_pool_cleanup_register(newlock->pool, newlock, lock_cleanup, - apr_pool_cleanup_null); - return APR_SUCCESS; -} - -apr_status_t apr_lock_child_init(apr_lock_t **lock, - const char *fname, - apr_pool_t *pool) -{ - /* This routine should not be called ( OpenMutex will fail if called) - * on a INTRAPROCESS lock - */ - (*lock) = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); - - if ((*lock) == NULL) { - return APR_ENOMEM; - } - (*lock)->fname = apr_pstrdup(pool, fname); - - if ((*lock)->mutex == NULL) { - return apr_get_os_error(); - } - return APR_SUCCESS; -} - -apr_status_t apr_lock_acquire(apr_lock_t *lock) -{ - DWORD rv; - switch (lock->type) - { - case APR_MUTEX: - if(NXLock(lock->mutex)==0) - return APR_SUCCESS; - break; - //srj APR_READWRITE should not be called here. Not Needed - //srj since we have apr_lock_acquire_rw function - - case APR_READWRITE: - return APR_ENOTIMPL; - default: - return APR_EINVAL; - } - - return apr_get_os_error(); -} - -APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock) -{ - return APR_ENOTIMPL; -} - -apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, - apr_readerwriter_e e) -{ - switch (lock->type) - { - case APR_MUTEX: - return APR_ENOTIMPL; - - case APR_READWRITE: - - switch (e) - { - case APR_READER: -#if 0 - //srj NXRdLock specifies the reader/writer lock in the read mode - //No return values - NXRdLock (lock->rwlock); -#endif - break; - case APR_WRITER: -#if 0 - //srj NXWrLock specifies the reader/writer lock in the write mode - //No return values - NXWrLock (lock->rwlock); -#endif - break; - } - - default: - return APR_EINVAL; - } - - return APR_SUCCESS; -} - -apr_status_t apr_lock_release(apr_lock_t *lock) -{ - switch (lock->type) - { - case APR_MUTEX: -//srj will work on scope later -// -// if (lock->scope == APR_INTRAPROCESS) { -// LeaveCriticalSection(&lock->section); -// return APR_SUCCESS; -// } else { - if(NXUnlock(lock->mutex)==0); - return APR_SUCCESS; -// } - break; - - case APR_READWRITE: - return APR_ENOTIMPL; - /*NXRwUnlock (lock->rwlock);*/ - } - - return apr_get_os_error(); -} - -apr_status_t apr_lock_destroy(apr_lock_t *lock) -{ - apr_status_t stat; - - stat = lock_cleanup(lock); - if (stat == APR_SUCCESS) { - apr_pool_cleanup_kill(lock->pool, lock, lock_cleanup); - } - return stat; -} - -apr_status_t apr_lock_data_get(apr_lock_t *lock, const char *key, - void *data) -{ - return apr_pool_userdata_get(data, key, lock->pool); -} - -apr_status_t apr_lock_data_set(apr_lock_t *lock, void *data, - const char *key, - apr_status_t (*cleanup) (void *)) -{ - return apr_pool_userdata_set(data, key, cleanup, lock->pool); -} - -apr_status_t apr_os_lock_get(apr_os_lock_t *thelock, - apr_lock_t *lock) -{ - switch (lock->type) - { - case APR_MUTEX: - thelock = lock->mutex; - break; - case APR_READWRITE: - return APR_ENOTIMPL; - /* thelock = lock->rwlock;*/ - break; - } - - return APR_SUCCESS; -} - -apr_status_t apr_os_lock_put(apr_lock_t **lock, - apr_os_lock_t *thelock, - apr_pool_t *pool) -{ - if (pool == NULL) { - return APR_ENOPOOL; - } - if ((*lock) == NULL) { - (*lock) = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); - (*lock)->pool = pool; - } - switch ((*lock)->type) - { - case APR_MUTEX: - (*lock)->mutex = thelock; - break; - case APR_READWRITE: - return APR_ENOTIMPL; - /*(*lock)->rwlock = *thelock;*/ - break; - } - return APR_SUCCESS; -} diff --git a/locks/os2/locks.c b/locks/os2/locks.c deleted file mode 100644 index 222a8e6f515..00000000000 --- a/locks/os2/locks.c +++ /dev/null @@ -1,288 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_portable.h" -#include "locks.h" -#include "fileio.h" -#include - -#define CurrentTid (lock->tib->tib_ptib2->tib2_ultid) - - -static apr_status_t lock_cleanup(void *thelock) -{ - apr_lock_t *lock = thelock; - return apr_lock_destroy(lock); -} - - - -APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, - apr_lockscope_e scope, apr_lockmech_e mech, - const char *fname, apr_pool_t *pool) -{ - apr_lock_t *new; - ULONG rc; - char *semname; - PIB *ppib; - - /* FIXME: Remove when read write locks implemented. */ - if (type == APR_READWRITE) - return APR_ENOTIMPL; - - if (mech != APR_LOCK_DEFAULT) { - return APR_ENOTIMPL; - } - - new = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); - - new->pool = pool; - new->type = type; - new->scope = scope; - new->owner = 0; - new->lock_count = 0; - new->fname = apr_pstrdup(pool, fname); - - DosGetInfoBlocks(&(new->tib), &ppib); - - if (fname == NULL) - semname = NULL; - else - semname = apr_pstrcat(pool, "/SEM32/", fname, NULL); - - rc = DosCreateMutexSem(semname, &(new->hMutex), scope == APR_CROSS_PROCESS ? DC_SEM_SHARED : 0, FALSE); - *lock = new; - - if (!rc) - apr_pool_cleanup_register(pool, new, lock_cleanup, apr_pool_cleanup_null); - - return APR_OS2_STATUS(rc); -} - - - -APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, const char *fname, - apr_pool_t *pool) -{ - int rc; - PIB *ppib; - - *lock = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); - - if (lock == NULL) - return APR_ENOMEM; - - DosGetInfoBlocks(&((*lock)->tib), &ppib); - (*lock)->owner = 0; - (*lock)->lock_count = 0; - rc = DosOpenMutexSem( (char *)fname, &(*lock)->hMutex ); - - if (!rc) - apr_pool_cleanup_register(pool, *lock, lock_cleanup, apr_pool_cleanup_null); - - return APR_OS2_STATUS(rc); -} - - - -// blocks for no more than ms_timeout milliseconds -static apr_status_t os2_lock_acquire(apr_lock_t *lock, int ms_timeout) -{ - ULONG rc; - - switch (lock->type) { - case APR_MUTEX: - rc = DosRequestMutexSem(lock->hMutex, ms_timeout); - - if (rc == 0) { - lock->owner = CurrentTid; - lock->lock_count++; - } - break; - case APR_READWRITE: - return APR_ENOTIMPL; - default: - return APR_EINVAL; - } - - return APR_OS2_STATUS(rc); -} - - - -APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock) -{ - return os2_lock_acquire(lock, SEM_INDEFINITE_WAIT); -} - - - -APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock) -{ - return os2_lock_acquire(lock, SEM_IMMEDIATE_RETURN); -} - - - -APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) -{ - switch (lock->type) { - case APR_MUTEX: - return APR_ENOTIMPL; - case APR_READWRITE: - switch (e) { - case APR_READER: - break; - case APR_WRITER: - break; - } - return APR_ENOTIMPL; - } - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock) -{ - ULONG rc; - - switch (lock->type) { - case APR_MUTEX: - if (lock->owner == CurrentTid && lock->lock_count > 0) { - lock->lock_count--; - rc = DosReleaseMutexSem(lock->hMutex); - return APR_OS2_STATUS(rc); - } - break; - case APR_READWRITE: - return APR_ENOTIMPL; - } - - return APR_SUCCESS; -} - - - -APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock) -{ - ULONG rc; - apr_status_t stat = APR_SUCCESS; - - switch (lock->type) { - case APR_MUTEX: - if (lock->owner == CurrentTid) { - while (lock->lock_count > 0 && stat == APR_SUCCESS) - stat = apr_lock_release(lock); - } - - if (stat != APR_SUCCESS) - return stat; - - if (lock->hMutex == 0) - return APR_SUCCESS; - - rc = DosCloseMutexSem(lock->hMutex); - - if (!rc) - lock->hMutex = 0; - break; - case APR_READWRITE: - return APR_ENOTIMPL; - default: - return APR_EINVAL; - } - - return APR_OS2_STATUS(rc); -} - - - -APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) -{ - *oslock = lock->hMutex; - return APR_SUCCESS; -} - - - -APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, - apr_pool_t *pool) -{ - if (pool == NULL) { - return APR_ENOPOOL; - } - if ((*lock) == NULL) { - (*lock) = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t)); - (*lock)->pool = pool; - } - (*lock)->hMutex = *thelock; - return APR_SUCCESS; -} - - - -APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) -{ - return apr_pool_userdata_get(data, key, lock->pool); -} - - - -APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, - apr_status_t (*cleanup) (void *)) -{ - return apr_pool_userdata_set(data, key, cleanup, lock->pool); -} diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in index 2ca8f735dee..ab1b91d9211 100644 --- a/locks/unix/Makefile.in +++ b/locks/unix/Makefile.in @@ -1,8 +1,5 @@ TARGETS = \ - locks.lo \ - crossproc.lo \ - intraproc.lo \ thread_mutex.lo \ thread_rwlock.lo \ thread_cond.lo \ diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c deleted file mode 100644 index 78af3f1c5c0..00000000000 --- a/locks/unix/crossproc.c +++ /dev/null @@ -1,738 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr.h" -#include "apr_file_io.h" -#include "apr_strings.h" -#include "locks.h" -#include "fileio.h" /* for apr_mkstemp() */ - -#if APR_HAS_POSIXSEM_SERIALIZE - -#ifndef SEM_FAILED -#define SEM_FAILED (-1) -#endif - -static void posix_setup(void) -{ -} - -static apr_status_t posix_cleanup(void *lock_) -{ - apr_lock_t *lock=lock_; - apr_status_t stat = APR_SUCCESS; - - if (lock->interproc->filedes != -1) { - if (sem_close((sem_t *)lock->interproc->filedes) < 0) { - stat = errno; - } - } - return stat; -} - -static apr_status_t posix_create(apr_lock_t *new, const char *fname) -{ - sem_t *psem; - apr_status_t stat; - char semname[14]; - unsigned long epoch; - - new->interproc = apr_palloc(new->pool, sizeof(*new->interproc)); - /* - * This bogusness is to follow what appears to be the - * lowest common denominator in Posix semaphore naming: - * - start with '/' - * - be at most 14 chars - * - be unique and not match anything on the filesystem - * - * Because of this, we ignore fname and craft our own. - * - * FIXME: There is a small window of opportunity where - * instead of getting a new semaphore descriptor, we get - * a previously obtained one. This can happen if the requests - * are made at the "same time" (within a second, due to the - * apr_time_now() call) and in the small span of time between - * the sem_open and the sem_unlink. Use of O_EXCL does not - * help here however... - */ - epoch = apr_time_now() / APR_USEC_PER_SEC; - apr_snprintf(semname, sizeof(semname), "/ApR.%lx", epoch); - psem = sem_open((const char *) semname, O_CREAT, 0644, 1); - - if (psem == (sem_t *)SEM_FAILED) { - stat = errno; - posix_cleanup(new); - return stat; - } - /* Ahhh. The joys of Posix sems. Predelete it... */ - sem_unlink((const char *) semname); - new->interproc->filedes = (int)psem; /* Ugg */ - apr_pool_cleanup_register(new->pool, (void *)new, posix_cleanup, - apr_pool_cleanup_null); - return APR_SUCCESS; -} - -static apr_status_t posix_acquire(apr_lock_t *lock) -{ - int rc; - - if ((rc = sem_wait((sem_t *)lock->interproc->filedes)) < 0) { - return errno; - } - lock->curr_locked = 1; - return APR_SUCCESS; -} - -static apr_status_t posix_release(apr_lock_t *lock) -{ - int rc; - - if ((rc = sem_post((sem_t *)lock->interproc->filedes)) < 0) { - return errno; - } - lock->curr_locked = 0; - return APR_SUCCESS; -} - -static apr_status_t posix_destroy(apr_lock_t *lock) -{ - apr_status_t stat; - - if ((stat = posix_cleanup(lock)) == APR_SUCCESS) { - apr_pool_cleanup_kill(lock->pool, lock, posix_cleanup); - return APR_SUCCESS; - } - return stat; -} - -static apr_status_t posix_child_init(apr_lock_t **lock, apr_pool_t *cont, const char *fname) -{ - return APR_SUCCESS; -} - -const apr_unix_lock_methods_t apr_unix_posix_methods = -{ -#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS - APR_PROCESS_LOCK_MECH_IS_GLOBAL, -#else - 0, -#endif - posix_create, - posix_acquire, - NULL, /* no tryacquire */ - NULL, /* no rw lock */ - NULL, /* no rw lock */ - posix_release, - posix_destroy, - posix_child_init -}; - -#endif /* Posix sem implementation */ - -#if APR_HAS_SYSVSEM_SERIALIZE - -static struct sembuf op_on; -static struct sembuf op_off; - -static void sysv_setup(void) -{ - op_on.sem_num = 0; - op_on.sem_op = -1; - op_on.sem_flg = SEM_UNDO; - op_off.sem_num = 0; - op_off.sem_op = 1; - op_off.sem_flg = SEM_UNDO; -} - -static apr_status_t sysv_cleanup(void *lock_) -{ - apr_lock_t *lock=lock_; - union semun ick; - apr_status_t stat = APR_SUCCESS; - - if (lock->interproc->filedes != -1) { - ick.val = 0; - if (semctl(lock->interproc->filedes, 0, IPC_RMID, ick) < 0) { - stat = errno; - } - } - return stat; -} - -static apr_status_t sysv_create(apr_lock_t *new, const char *fname) -{ - union semun ick; - apr_status_t stat; - - new->interproc = apr_palloc(new->pool, sizeof(*new->interproc)); - new->interproc->filedes = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600); - - if (new->interproc->filedes < 0) { - stat = errno; - sysv_cleanup(new); - return stat; - } - ick.val = 1; - if (semctl(new->interproc->filedes, 0, SETVAL, ick) < 0) { - stat = errno; - sysv_cleanup(new); - return stat; - } - new->curr_locked = 0; - apr_pool_cleanup_register(new->pool, (void *)new, sysv_cleanup, - apr_pool_cleanup_null); - return APR_SUCCESS; -} - -static apr_status_t sysv_acquire(apr_lock_t *lock) -{ - int rc; - - do { - rc = semop(lock->interproc->filedes, &op_on, 1); - } while (rc < 0 && errno == EINTR); - if (rc < 0) { - return errno; - } - lock->curr_locked = 1; - return APR_SUCCESS; -} - -static apr_status_t sysv_release(apr_lock_t *lock) -{ - int rc; - - do { - rc = semop(lock->interproc->filedes, &op_off, 1); - } while (rc < 0 && errno == EINTR); - if (rc < 0) { - return errno; - } - lock->curr_locked = 0; - return APR_SUCCESS; -} - -static apr_status_t sysv_destroy(apr_lock_t *lock) -{ - apr_status_t stat; - - if ((stat = sysv_cleanup(lock)) == APR_SUCCESS) { - apr_pool_cleanup_kill(lock->pool, lock, sysv_cleanup); - return APR_SUCCESS; - } - return stat; -} - -static apr_status_t sysv_child_init(apr_lock_t **lock, apr_pool_t *cont, const char *fname) -{ - return APR_SUCCESS; -} - -const apr_unix_lock_methods_t apr_unix_sysv_methods = -{ -#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS - APR_PROCESS_LOCK_MECH_IS_GLOBAL, -#else - 0, -#endif - sysv_create, - sysv_acquire, - NULL, /* no tryacquire */ - NULL, /* no rw lock */ - NULL, /* no rw lock */ - sysv_release, - sysv_destroy, - sysv_child_init -}; - -#endif /* SysV sem implementation */ - -#if APR_HAS_PROC_PTHREAD_SERIALIZE - -static void proc_pthread_setup(void) -{ -} - -static apr_status_t proc_pthread_cleanup(void *lock_) -{ - apr_lock_t *lock=lock_; - apr_status_t stat; - - if (lock->curr_locked == 1) { - if ((stat = pthread_mutex_unlock(lock->pthread_interproc))) { -#ifdef PTHREAD_SETS_ERRNO - stat = errno; -#endif - return stat; - } - if (munmap((caddr_t)lock->pthread_interproc, sizeof(pthread_mutex_t))){ - return errno; - } - } - return APR_SUCCESS; -} - -static apr_status_t proc_pthread_create(apr_lock_t *new, const char *fname) -{ - apr_status_t stat; - int fd; - pthread_mutexattr_t mattr; - - fd = open("/dev/zero", O_RDWR); - if (fd < 0) { - return errno; - } - - new->pthread_interproc = (pthread_mutex_t *)mmap((caddr_t) 0, - sizeof(pthread_mutex_t), - PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); - if (new->pthread_interproc == (pthread_mutex_t *) (caddr_t) -1) { - return errno; - } - close(fd); - if ((stat = pthread_mutexattr_init(&mattr))) { -#ifdef PTHREAD_SETS_ERRNO - stat = errno; -#endif - proc_pthread_cleanup(new); - return stat; - } - if ((stat = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED))) { -#ifdef PTHREAD_SETS_ERRNO - stat = errno; -#endif - proc_pthread_cleanup(new); - return stat; - } - -#ifdef HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP - if ((stat = pthread_mutexattr_setrobust_np(&mattr, - PTHREAD_MUTEX_ROBUST_NP))) { -#ifdef PTHREAD_SETS_ERRNO - stat = errno; -#endif - proc_pthread_cleanup(new); - return stat; - } - if ((stat = pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT))) { -#ifdef PTHREAD_SETS_ERRNO - stat = errno; -#endif - proc_pthread_cleanup(new); - return stat; - } -#endif - - if ((stat = pthread_mutex_init(new->pthread_interproc, &mattr))) { -#ifdef PTHREAD_SETS_ERRNO - stat = errno; -#endif - proc_pthread_cleanup(new); - return stat; - } - - if ((stat = pthread_mutexattr_destroy(&mattr))) { -#ifdef PTHREAD_SETS_ERRNO - stat = errno; -#endif - proc_pthread_cleanup(new); - return stat; - } - - new->curr_locked = 0; - apr_pool_cleanup_register(new->pool, (void *)new, proc_pthread_cleanup, - apr_pool_cleanup_null); - return APR_SUCCESS; -} - -static apr_status_t proc_pthread_acquire(apr_lock_t *lock) -{ - apr_status_t stat; - - if ((stat = pthread_mutex_lock(lock->pthread_interproc))) { -#ifdef PTHREAD_SETS_ERRNO - stat = errno; -#endif -#ifdef HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP - /* Okay, our owner died. Let's try to make it consistent again. */ - if (stat == EOWNERDEAD) { - pthread_mutex_consistent_np(lock->pthread_interproc); - } - else - return stat; -#else - return stat; -#endif - } - lock->curr_locked = 1; - return APR_SUCCESS; -} - -static apr_status_t proc_pthread_release(apr_lock_t *lock) -{ - apr_status_t stat; - - if ((stat = pthread_mutex_unlock(lock->pthread_interproc))) { -#ifdef PTHREAD_SETS_ERRNO - stat = errno; -#endif - return stat; - } - lock->curr_locked = 0; - return APR_SUCCESS; -} - -static apr_status_t proc_pthread_destroy(apr_lock_t *lock) -{ - apr_status_t stat; - if ((stat = proc_pthread_cleanup(lock)) == APR_SUCCESS) { - apr_pool_cleanup_kill(lock->pool, lock, proc_pthread_cleanup); - return APR_SUCCESS; - } - return stat; -} - -static apr_status_t proc_pthread_child_init(apr_lock_t **lock, - apr_pool_t *cont, - const char *fname) -{ - return APR_SUCCESS; -} - -const apr_unix_lock_methods_t apr_unix_proc_pthread_methods = -{ - APR_PROCESS_LOCK_MECH_IS_GLOBAL, - proc_pthread_create, - proc_pthread_acquire, - NULL, /* no tryacquire */ - NULL, /* no rw lock */ - NULL, /* no rw lock */ - proc_pthread_release, - proc_pthread_destroy, - proc_pthread_child_init -}; - -#endif - -#if APR_HAS_FCNTL_SERIALIZE - -static struct flock lock_it; -static struct flock unlock_it; - -static apr_status_t fcntl_release(apr_lock_t *); - -static void fcntl_setup(void) -{ - lock_it.l_whence = SEEK_SET; /* from current point */ - lock_it.l_start = 0; /* -"- */ - lock_it.l_len = 0; /* until end of file */ - lock_it.l_type = F_WRLCK; /* set exclusive/write lock */ - lock_it.l_pid = 0; /* pid not actually interesting */ - unlock_it.l_whence = SEEK_SET; /* from current point */ - unlock_it.l_start = 0; /* -"- */ - unlock_it.l_len = 0; /* until end of file */ - unlock_it.l_type = F_UNLCK; /* set exclusive/write lock */ - unlock_it.l_pid = 0; /* pid not actually interesting */ -} - -static apr_status_t fcntl_cleanup(void *lock_) -{ - apr_status_t status; - apr_lock_t *lock=lock_; - - if (lock->curr_locked == 1) { - status = fcntl_release(lock); - if (status != APR_SUCCESS) - return status; - } - - return APR_SUCCESS; -} - -static apr_status_t fcntl_create(apr_lock_t *new, const char *fname) -{ - int rv; - - if (fname) { - new->fname = apr_pstrdup(new->pool, fname); - rv = apr_file_open(&new->interproc, new->fname, - APR_CREATE | APR_WRITE | APR_EXCL, 0644, new->pool); - } - else { - new->fname = apr_pstrdup(new->pool, "/tmp/aprXXXXXX"); - rv = apr_file_mktemp(&new->interproc, new->fname, 0, new->pool); - } - - if (rv != APR_SUCCESS) { - fcntl_cleanup(new); - return rv; - } - - new->curr_locked=0; - unlink(new->fname); - apr_pool_cleanup_register(new->pool, (void*)new, fcntl_cleanup, - apr_pool_cleanup_null); - return APR_SUCCESS; -} - -static apr_status_t fcntl_acquire(apr_lock_t *lock) -{ - int rc; - - do { - rc = fcntl(lock->interproc->filedes, F_SETLKW, &lock_it); - } while (rc < 0 && errno == EINTR); - if (rc < 0) { - return errno; - } - lock->curr_locked=1; - return APR_SUCCESS; -} - -static apr_status_t fcntl_release(apr_lock_t *lock) -{ - int rc; - - do { - rc = fcntl(lock->interproc->filedes, F_SETLKW, &unlock_it); - } while (rc < 0 && errno == EINTR); - if (rc < 0) { - return errno; - } - lock->curr_locked=0; - return APR_SUCCESS; -} - -static apr_status_t fcntl_destroy(apr_lock_t *lock) -{ - apr_status_t stat; - if ((stat = fcntl_cleanup(lock)) == APR_SUCCESS) { - apr_pool_cleanup_kill(lock->pool, lock, fcntl_cleanup); - return APR_SUCCESS; - } - return stat; -} - -static apr_status_t fcntl_child_init(apr_lock_t **lock, apr_pool_t *cont, - const char *fname) -{ - return APR_SUCCESS; -} - -const apr_unix_lock_methods_t apr_unix_fcntl_methods = -{ -#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS - APR_PROCESS_LOCK_MECH_IS_GLOBAL, -#else - 0, -#endif - fcntl_create, - fcntl_acquire, - NULL, /* no tryacquire */ - NULL, /* no rw lock */ - NULL, /* no rw lock */ - fcntl_release, - fcntl_destroy, - fcntl_child_init -}; - -#endif /* fcntl implementation */ - -#if APR_HAS_FLOCK_SERIALIZE - -static apr_status_t flock_release(apr_lock_t *); - -static void flock_setup(void) -{ -} - -static apr_status_t flock_cleanup(void *lock_) -{ - apr_status_t status; - apr_lock_t *lock=lock_; - - if (lock->curr_locked == 1) { - status = flock_release(lock); - if (status != APR_SUCCESS) - return status; - } - apr_file_close(lock->interproc); - unlink(lock->fname); - return APR_SUCCESS; -} - -static apr_status_t flock_create(apr_lock_t *new, const char *fname) -{ - int rv; - - if (fname) { - new->fname = apr_pstrdup(new->pool, fname); - rv = apr_file_open(&new->interproc, new->fname, - APR_CREATE | APR_WRITE | APR_EXCL, 0644, new->pool); - } - else { - new->fname = apr_pstrdup(new->pool, "/tmp/aprXXXXXX"); - rv = apr_file_mktemp(&new->interproc, new->fname, 0, new->pool); - } - - if (rv != APR_SUCCESS) { - apr_status_t stat = errno; - - flock_cleanup(new); - return stat; - } - new->curr_locked = 0; - apr_pool_cleanup_register(new->pool, (void *)new, flock_cleanup, - apr_pool_cleanup_null); - return APR_SUCCESS; -} - -static apr_status_t flock_acquire(apr_lock_t *lock) -{ - int rc; - - do { - rc = flock(lock->interproc->filedes, LOCK_EX); - } while (rc < 0 && errno == EINTR); - if (rc < 0) { - return errno; - } - lock->curr_locked = 1; - return APR_SUCCESS; -} - -static apr_status_t flock_release(apr_lock_t *lock) -{ - int rc; - - do { - rc = flock(lock->interproc->filedes, LOCK_UN); - } while (rc < 0 && errno == EINTR); - if (rc < 0) { - return errno; - } - lock->curr_locked = 0; - return APR_SUCCESS; -} - -static apr_status_t flock_destroy(apr_lock_t *lock) -{ - apr_status_t stat; - if ((stat = flock_cleanup(lock)) == APR_SUCCESS) { - apr_pool_cleanup_kill(lock->pool, lock, flock_cleanup); - return APR_SUCCESS; - } - return stat; -} - -static apr_status_t flock_child_init(apr_lock_t **lock, apr_pool_t *cont, - const char *fname) -{ - apr_lock_t *new; - int rv; - - new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); - - memcpy(new, *lock, sizeof *new); - new->pool = cont; - new->fname = apr_pstrdup(cont, fname); - rv = apr_file_open(&new->interproc, new->fname, - APR_CREATE | APR_WRITE, 0600, new->pool); - if (rv != APR_SUCCESS) { - apr_status_t stat = errno; - - flock_destroy(new); - return stat; - } - *lock = new; - return APR_SUCCESS; -} - -const apr_unix_lock_methods_t apr_unix_flock_methods = -{ -#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS - APR_PROCESS_LOCK_MECH_IS_GLOBAL, -#else - 0, -#endif - flock_create, - flock_acquire, - NULL, /* no tryacquire */ - NULL, /* no rw lock */ - NULL, /* no rw lock */ - flock_release, - flock_destroy, - flock_child_init -}; - -#endif /* flock implementation */ - -void apr_unix_setup_lock(void) -{ -#if APR_HAS_POSIXSEM_SERIALIZE - posix_setup(); -#endif -#if APR_HAS_SYSVSEM_SERIALIZE - sysv_setup(); -#endif -#if APR_HAS_PROC_PTHREAD_SERIALIZE - proc_pthread_setup(); -#endif -#if APR_HAS_FCNTL_SERIALIZE - fcntl_setup(); -#endif -#if APR_HAS_FLOCK_SERIALIZE - flock_setup(); -#endif -} diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c deleted file mode 100644 index a559e456230..00000000000 --- a/locks/unix/intraproc.c +++ /dev/null @@ -1,229 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "locks.h" - -#if APR_HAS_THREADS - -#if (APR_USE_PTHREAD_SERIALIZE) - -static apr_status_t lock_intra_cleanup(void *data) -{ - apr_lock_t *lock = (apr_lock_t *) data; - apr_status_t stat; - - pthread_mutex_unlock(lock->intraproc); - stat = pthread_mutex_destroy(lock->intraproc); -#ifdef PTHREAD_SETS_ERRNO - if (stat) { - stat = errno; - } -#endif - return stat; -} - -static apr_status_t intra_create(apr_lock_t *new, const char *fname) -{ - apr_status_t stat; - pthread_mutexattr_t mattr; - - new->intraproc = (pthread_mutex_t *)apr_palloc(new->pool, - sizeof(pthread_mutex_t)); - if (new->intraproc == NULL) { - return errno; - } - if ((stat = pthread_mutexattr_init(&mattr))) { -#ifdef PTHREAD_SETS_ERRNO - stat = errno; -#endif - lock_intra_cleanup(new); - return stat; - } - - if ((stat = pthread_mutex_init(new->intraproc, &mattr))) { -#ifdef PTHREAD_SETS_ERRNO - stat = errno; -#endif - lock_intra_cleanup(new); - return stat; - } - - if ((stat = pthread_mutexattr_destroy(&mattr))) { -#ifdef PTHREAD_SETS_ERRNO - stat = errno; -#endif - lock_intra_cleanup(new); - return stat; - } - - new->curr_locked = 0; - apr_pool_cleanup_register(new->pool, (void *)new, lock_intra_cleanup, - apr_pool_cleanup_null); - return APR_SUCCESS; -} - -static apr_status_t intra_acquire(apr_lock_t *lock) -{ - apr_status_t stat; - - stat = pthread_mutex_lock(lock->intraproc); -#ifdef PTHREAD_SETS_ERRNO - if (stat) { - stat = errno; - } -#endif - return stat; -} - -static apr_status_t intra_tryacquire(apr_lock_t *lock) -{ - apr_status_t stat; - - stat = pthread_mutex_trylock(lock->intraproc); -#ifdef PTHREAD_SETS_ERRNO - if (stat) { - stat = errno; - } -#endif - /* Normalize the return code. */ - if (stat == EBUSY) - stat = APR_EBUSY; - return stat; -} - -static apr_status_t intra_release(apr_lock_t *lock) -{ - apr_status_t status; - - status = pthread_mutex_unlock(lock->intraproc); -#ifdef PTHREAD_SETS_ERRNO - if (status) { - status = errno; - } -#endif - return status; -} - -static apr_status_t intra_destroy(apr_lock_t *lock) -{ - apr_status_t stat; - if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) { - apr_pool_cleanup_kill(lock->pool, lock, lock_intra_cleanup); - return APR_SUCCESS; - } - return stat; -} - -#endif /* APR_USE_PTHREAD_SERIALIZE */ - -const apr_unix_lock_methods_t apr_unix_intra_methods = -{ - 0, - intra_create, - intra_acquire, - intra_tryacquire, - NULL, /* no read lock concept */ - NULL, /* no write lock concept */ - intra_release, - intra_destroy, - NULL /* no child init */ -}; - -#if APR_HAS_RWLOCK_SERIALIZE -static apr_status_t rwlock_create(apr_lock_t *new, const char *fname) -{ - /* XXX check retcode */ - pthread_rwlock_init(&new->rwlock, NULL); - return APR_SUCCESS; -} - -static apr_status_t rwlock_acquire_read(apr_lock_t *lock) -{ - /* XXX PTHREAD_SETS_ERRNO crap? */ - return pthread_rwlock_rdlock(&lock->rwlock); -} - -static apr_status_t rwlock_acquire_write(apr_lock_t *lock) -{ - /* XXX PTHREAD_SETS_ERRNO crap? */ - return pthread_rwlock_wrlock(&lock->rwlock); -} - -static apr_status_t rwlock_release(apr_lock_t *lock) -{ - /* XXX PTHREAD_SETS_ERRNO crap? */ - return pthread_rwlock_unlock(&lock->rwlock); -} - -static apr_status_t rwlock_destroy(apr_lock_t *lock) -{ - /* XXX PTHREAD_SETS_ERRNO crap? */ - return pthread_rwlock_destroy(&lock->rwlock); -} - -const apr_unix_lock_methods_t apr_unix_rwlock_methods = -{ - 0, - rwlock_create, - NULL, /* no standard acquire method; app better not call :) */ - NULL, /* no standard tryacquire method; app better not call :) */ - rwlock_acquire_read, - rwlock_acquire_write, - rwlock_release, - rwlock_destroy, - NULL /* no child init method */ -}; -#endif - -#endif /* APR_HAS_THREADS */ diff --git a/locks/unix/locks.c b/locks/unix/locks.c deleted file mode 100644 index b6b3a1ba414..00000000000 --- a/locks/unix/locks.c +++ /dev/null @@ -1,412 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "locks.h" -#include "apr_strings.h" -#include "apr_portable.h" - -static apr_status_t lockall_create(apr_lock_t *new, const char *fname) -{ - apr_status_t rv; - - if ((rv = new->inter_meth->create(new, fname)) != APR_SUCCESS) { - return rv; - } - if ((rv = new->intra_meth->create(new, fname)) != APR_SUCCESS) { - return rv; - } - return APR_SUCCESS; -} - -static apr_status_t lockall_acquire(apr_lock_t *lock) -{ - apr_status_t rv; - - if ((rv = lock->intra_meth->acquire(lock)) != APR_SUCCESS) { - return rv; - } - if ((rv = lock->inter_meth->acquire(lock)) != APR_SUCCESS) { - return rv; - } - return APR_SUCCESS; -} - -static apr_status_t lockall_release(apr_lock_t *lock) -{ - apr_status_t rv; - - if ((rv = lock->intra_meth->release(lock)) != APR_SUCCESS) { - return rv; - } - if ((rv = lock->inter_meth->release(lock)) != APR_SUCCESS) { - return rv; - } - return APR_SUCCESS; -} - -static apr_status_t lockall_destroy(apr_lock_t *lock) -{ - apr_status_t rv; - - if ((rv = lock->intra_meth->destroy(lock)) != APR_SUCCESS) { - return rv; - } - if ((rv = lock->inter_meth->destroy(lock)) != APR_SUCCESS) { - return rv; - } - return APR_SUCCESS; -} - -static apr_status_t lockall_child_init(apr_lock_t **lock, apr_pool_t *pool, - const char *fname) -{ - /* no child init for intra lock */ - return (*lock)->inter_meth->child_init(lock, pool, fname); -} - -static const struct apr_unix_lock_methods_t lockall_methods = -{ - 0, - lockall_create, - lockall_acquire, - NULL, /* no tryacquire concept */ - NULL, /* no read lock concept */ - NULL, /* no write lock concept */ - lockall_release, - lockall_destroy, - lockall_child_init -}; - -static apr_status_t choose_method(apr_lock_t *new, apr_lockmech_e mech) -{ - switch (mech) { - case APR_LOCK_FCNTL: -#if APR_HAS_FCNTL_SERIALIZE - new->inter_meth = &apr_unix_fcntl_methods; -#else - return APR_ENOTIMPL; -#endif - break; - case APR_LOCK_FLOCK: -#if APR_HAS_FLOCK_SERIALIZE - new->inter_meth = &apr_unix_flock_methods; -#else - return APR_ENOTIMPL; -#endif - break; - case APR_LOCK_SYSVSEM: -#if APR_HAS_SYSVSEM_SERIALIZE - new->inter_meth = &apr_unix_sysv_methods; -#else - return APR_ENOTIMPL; -#endif - break; - case APR_LOCK_POSIXSEM: -#if APR_HAS_POSIXSEM_SERIALIZE - new->inter_meth = &apr_unix_posix_methods; -#else - return APR_ENOTIMPL; -#endif - break; - case APR_LOCK_PROC_PTHREAD: -#if APR_HAS_PROC_PTHREAD_SERIALIZE - new->inter_meth = &apr_unix_proc_pthread_methods; -#else - return APR_ENOTIMPL; -#endif - break; - case APR_LOCK_DEFAULT: -#if APR_USE_FLOCK_SERIALIZE - new->inter_meth = &apr_unix_flock_methods; -#elif APR_USE_POSIXSEM_SERIALIZE - new->inter_meth = &apr_unix_posix_methods; -#elif APR_USE_SYSVSEM_SERIALIZE - new->inter_meth = &apr_unix_sysv_methods; -#elif APR_USE_FCNTL_SERIALIZE - new->inter_meth = &apr_unix_fcntl_methods; -#elif APR_USE_PROC_PTHREAD_SERIALIZE - new->inter_meth = &apr_unix_proc_pthread_methods; -#else - return APR_ENOTIMPL; -#endif - break; - default: - return APR_ENOTIMPL; - } - return APR_SUCCESS; -} - -static apr_status_t create_lock(apr_lock_t *new, apr_lockmech_e mech, const char *fname) -{ - apr_status_t stat; - - if (new->scope != APR_INTRAPROCESS) { - if ((stat = choose_method(new, mech)) != APR_SUCCESS) { - return stat; - } - } - - if (new->scope != APR_CROSS_PROCESS) { -#if APR_HAS_THREADS - if (new->type == APR_READWRITE) { -#if APR_HAS_RWLOCK_SERIALIZE - new->intra_meth = &apr_unix_rwlock_methods; -#else - return APR_ENOTIMPL; /* 'cause we don't have rwlocks */ -#endif - } - else { - new->intra_meth = &apr_unix_intra_methods; - } -#else - if (new->scope == APR_INTRAPROCESS) { - return APR_ENOTIMPL; /* 'cause we don't have threads */ - } -#endif - } - - switch (new->scope) { - case APR_LOCKALL: - if (new->inter_meth->flags & APR_PROCESS_LOCK_MECH_IS_GLOBAL) { - new->meth = new->inter_meth; - } - else { - new->meth = &lockall_methods; - } - break; - case APR_CROSS_PROCESS: - new->meth = new->inter_meth; - break; - case APR_INTRAPROCESS: - new->meth = new->intra_meth; - } - - if ((stat = new->meth->create(new, fname)) != APR_SUCCESS) { - return stat; - } - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, - apr_lockscope_e scope, apr_lockmech_e mech, - const char *fname, apr_pool_t *pool) -{ - apr_lock_t *new; - apr_status_t stat; - - new = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t)); - - new->pool = pool; - new->type = type; - new->scope = scope; -#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE - new->interproc = NULL; -#endif - - if ((stat = create_lock(new, mech, fname)) != APR_SUCCESS) - return stat; - - *lock = new; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock) -{ - apr_status_t stat; - -#if APR_HAS_THREADS - if (apr_os_thread_equal(lock->owner, apr_os_thread_current())) { - lock->owner_ref++; - return APR_SUCCESS; - } -#endif - - if ((stat = lock->meth->acquire(lock)) != APR_SUCCESS) { - return stat; - } - -#if APR_HAS_THREADS - lock->owner = apr_os_thread_current(); - lock->owner_ref = 1; -#endif - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock) -{ - apr_status_t stat; - -#if APR_HAS_THREADS - if (apr_os_thread_equal(lock->owner, apr_os_thread_current())) { - lock->owner_ref++; - return APR_SUCCESS; - } -#endif - - if ((stat = lock->meth->tryacquire(lock)) != APR_SUCCESS) { - return stat; - } - -#if APR_HAS_THREADS - lock->owner = apr_os_thread_current(); - lock->owner_ref = 1; -#endif - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock, - apr_readerwriter_e e) -{ - switch (e) - { - case APR_READER: - return lock->meth->acquire_read(lock); - case APR_WRITER: - return lock->meth->acquire_write(lock); - } - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock) -{ - apr_status_t stat; - -#if APR_HAS_THREADS - if (apr_os_thread_equal(lock->owner, apr_os_thread_current())) { - lock->owner_ref--; - if (lock->owner_ref > 0) - return APR_SUCCESS; - } -#endif - - if ((stat = lock->meth->release(lock)) != APR_SUCCESS) { - return stat; - } - -#if APR_HAS_THREADS - memset(&lock->owner, 0, sizeof lock->owner); - lock->owner_ref = 0; -#endif - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock) -{ - return lock->meth->destroy(lock); -} - -APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, const char *fname, - apr_pool_t *cont) -{ - if ((*lock)->scope != APR_INTRAPROCESS) - return (*lock)->meth->child_init(lock, cont, fname); - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key, void *data) -{ - return apr_pool_userdata_get(data, key, lock->pool); -} - -APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, const char *key, - apr_status_t (*cleanup) (void *)) -{ - return apr_pool_userdata_set(data, key, cleanup, lock->pool); -} - -APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *oslock, apr_lock_t *lock) -{ -#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE - oslock->crossproc = lock->interproc->filedes; -#endif -#if APR_HAS_PROC_PTHREAD_SERIALIZE - oslock->pthread_interproc = lock->pthread_interproc; -#endif -#if APR_HAS_THREADS -#if APR_USE_PTHREAD_SERIALIZE - oslock->intraproc = lock->intraproc; -#endif -#endif - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, apr_os_lock_t *thelock, - apr_pool_t *pool) -{ - if (pool == NULL) { - return APR_ENOPOOL; - } - if ((*lock) == NULL) { - (*lock) = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t)); - (*lock)->pool = pool; - } -#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE - apr_os_file_put(&(*lock)->interproc, &thelock->crossproc, 0, pool); -#endif -#if APR_HAS_PROC_PTHREAD_SERIALIZE - (*lock)->pthread_interproc = thelock->pthread_interproc; -#endif -#if APR_HAS_THREADS -#if (APR_USE_PTHREAD_SERIALIZE) - (*lock)->intraproc = thelock->intraproc; -#endif -#endif - return APR_SUCCESS; -} - diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index e1a548598ed..5808e7e3955 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -817,10 +817,8 @@ static apr_status_t proc_mutex_create(apr_proc_mutex_t *new_mutex, apr_lockmech_ { apr_status_t rv; - if (new_mutex->scope != APR_INTRAPROCESS) { - if ((rv = proc_mutex_choose_method(new_mutex, mech)) != APR_SUCCESS) { - return rv; - } + if ((rv = proc_mutex_choose_method(new_mutex, mech)) != APR_SUCCESS) { + return rv; } new_mutex->meth = new_mutex->inter_meth; diff --git a/locks/win32/locks.c b/locks/win32/locks.c deleted file mode 100644 index c23906f056a..00000000000 --- a/locks/win32/locks.c +++ /dev/null @@ -1,303 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "win32/locks.h" -#include "apr_portable.h" -#include "misc.h" - -static apr_status_t lock_cleanup(void *lock_) -{ - apr_lock_t *lock = lock_; - - switch (lock->type) - { - case APR_MUTEX: - if (lock->scope == APR_INTRAPROCESS) { - DeleteCriticalSection(&lock->section); - return APR_SUCCESS; - } else { - if (CloseHandle(lock->mutex) == 0) { - return apr_get_os_error(); - } - } - break; - case APR_READWRITE: - return APR_ENOTIMPL; - } - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, - apr_locktype_e type, - apr_lockscope_e scope, - apr_lockmech_e mech, - const char *fname, - apr_pool_t *pool) -{ - apr_lock_t *newlock; - SECURITY_ATTRIBUTES sec; - - /* FIXME: Remove when read write locks implemented. */ - if (type == APR_READWRITE) - return APR_ENOTIMPL; - - if (mech != APR_LOCK_DEFAULT) { - return APR_ENOTIMPL; - } - - newlock = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); - - newlock->pool = pool; - /* ToDo: How to handle the case when no pool is available? - * How to cleanup the storage properly? - */ - newlock->type = type; - newlock->scope = scope; - sec.nLength = sizeof(SECURITY_ATTRIBUTES); - sec.lpSecurityDescriptor = NULL; - - if (scope == APR_CROSS_PROCESS || scope == APR_LOCKALL) { - sec.bInheritHandle = TRUE; - } - else { - sec.bInheritHandle = FALSE; - } - - if (scope == APR_INTRAPROCESS) { - if (fname) { - newlock->fname = apr_pstrdup(pool, fname); - } - else { - newlock->fname = NULL; - } - InitializeCriticalSection(&newlock->section); - } else { - /* With Win2000 Terminal Services, the Mutex name can have a - * "Global\" or "Local\" prefix to explicitly create the object - * in the global or session name space. Without Terminal Service - * running on Win2000, Global\ and Local\ are ignored. These - * prefixes are only valid on Win2000+ - */ - if (fname) { - if (apr_os_level >= APR_WIN_2000) { - newlock->fname = apr_pstrcat(pool, "Global\\", fname, NULL); - } - else { - newlock->fname = apr_pstrdup(pool, fname); - } - } - else { - newlock->fname = NULL; - } - - newlock->mutex = CreateMutex(&sec, FALSE, newlock->fname); - if (!newlock->mutex) { - return apr_get_os_error(); - } - } - *lock = newlock; - apr_pool_cleanup_register(newlock->pool, newlock, lock_cleanup, - apr_pool_cleanup_null); - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_child_init(apr_lock_t **lock, - const char *fname, - apr_pool_t *pool) -{ - /* This routine should not be called (and OpenMutex will fail if called) - * on a INTRAPROCESS lock - */ - (*lock) = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); - - if (fname) { - if (apr_os_level >= APR_WIN_2000) { - (*lock)->fname = apr_pstrcat(pool, "Global\\", fname, NULL); - } - else { - (*lock)->fname = apr_pstrdup(pool, fname); - } - } - else { - return APR_EINVAL; - } - - (*lock)->mutex = OpenMutex(MUTEX_ALL_ACCESS, TRUE, fname); - - if ((*lock)->mutex == NULL) { - return apr_get_os_error(); - } - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock) -{ - DWORD rv; - switch (lock->type) - { - case APR_MUTEX: - if (lock->scope == APR_INTRAPROCESS) { - EnterCriticalSection(&lock->section); - return APR_SUCCESS; - } else { - rv = WaitForSingleObject(lock->mutex, INFINITE); - - if (rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) { - return APR_SUCCESS; - } - } - break; - case APR_READWRITE: - return APR_ENOTIMPL; - } - - return apr_get_os_error(); -} - -APR_DECLARE(apr_status_t) apr_lock_tryacquire(apr_lock_t *lock) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_lock_acquire_rw(apr_lock_t *lock, - apr_readerwriter_e e) -{ - switch (lock->type) - { - case APR_MUTEX: - return APR_ENOTIMPL; - case APR_READWRITE: - switch (e) - { - case APR_READER: - break; - case APR_WRITER: - break; - } - return APR_ENOTIMPL; - } - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_release(apr_lock_t *lock) -{ - switch (lock->type) - { - case APR_MUTEX: - if (lock->scope == APR_INTRAPROCESS) { - LeaveCriticalSection(&lock->section); - return APR_SUCCESS; - } else { - if (ReleaseMutex(lock->mutex) == 0) { - return apr_get_os_error(); - } - } - break; - case APR_READWRITE: - return APR_ENOTIMPL; - } - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_lock_destroy(apr_lock_t *lock) -{ - apr_status_t stat; - - stat = lock_cleanup(lock); - if (stat == APR_SUCCESS) { - apr_pool_cleanup_kill(lock->pool, lock, lock_cleanup); - } - return stat; -} - -APR_DECLARE(apr_status_t) apr_lock_data_get(apr_lock_t *lock, const char *key, - void *data) -{ - return apr_pool_userdata_get(data, key, lock->pool); -} - -APR_DECLARE(apr_status_t) apr_lock_data_set(apr_lock_t *lock, void *data, - const char *key, - apr_status_t (*cleanup) (void *)) -{ - return apr_pool_userdata_set(data, key, cleanup, lock->pool); -} - -APR_DECLARE(apr_status_t) apr_os_lock_get(apr_os_lock_t *thelock, - apr_lock_t *lock) -{ - *thelock = lock->mutex; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_os_lock_put(apr_lock_t **lock, - apr_os_lock_t *thelock, - apr_pool_t *pool) -{ - if (pool == NULL) { - return APR_ENOPOOL; - } - if ((*lock) == NULL) { - (*lock) = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t)); - (*lock)->pool = pool; - } - (*lock)->mutex = *thelock; - return APR_SUCCESS; -} diff --git a/misc/unix/start.c b/misc/unix/start.c index 2ec8dd47cd8..5bfa8dc3a41 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -57,7 +57,6 @@ #include "apr_pools.h" #include "apr_signal.h" -#include "locks.h" /* for apr_unix_setup_lock() */ #include "proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ #include "internal_time.h" @@ -84,7 +83,6 @@ APR_DECLARE(apr_status_t) apr_initialize(void) } #if !defined(BEOS) && !defined(OS2) - apr_unix_setup_lock(); apr_proc_mutex_unix_setup_lock(); apr_unix_setup_time(); #endif From f6e54af90545e8842eea5d6fd385b5e0eeb2263b Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 9 Apr 2002 07:05:29 +0000 Subject: [PATCH 3226/7878] Don't build locks.lo anymore. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63235 13f79535-47bb-0310-9956-ffa450edef68 --- locks/beos/Makefile.in | 2 +- locks/os2/Makefile.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in index fa2d5bdb9d5..c1f07c137b7 100644 --- a/locks/beos/Makefile.in +++ b/locks/beos/Makefile.in @@ -1,5 +1,5 @@ -TARGETS = locks.lo \ +TARGETS = \ thread_mutex.lo \ thread_rwlock.lo \ thread_cond.lo \ diff --git a/locks/os2/Makefile.in b/locks/os2/Makefile.in index 590514d76b6..18d7b9405e9 100644 --- a/locks/os2/Makefile.in +++ b/locks/os2/Makefile.in @@ -1,5 +1,5 @@ -TARGETS = locks.lo \ +TARGETS = \ thread_mutex.lo \ thread_rwlock.lo \ thread_cond.lo \ From c09f9b3c4ddc5b170e43361840a0ef6290b84644 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 9 Apr 2002 07:42:27 +0000 Subject: [PATCH 3227/7878] Deprecated the apr_lock.h API. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63236 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 28d415e85f2..606782b0f3c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Deprecated the apr_lock.h API. Please see the following files + for the improved thread and process locking and signaling: + apr_proc_mutex.h, apr_thread_mutex.h, apr_thread_rwlock.h, + apr_thread_cond.h, and apr_global_mutex.h. [Aaron Bannert] + *) Fix some daylight savings time breakage on (at least) AIX, Solaris, and HP-UX. [Jeff Trawick] From 80ae161c598384940d38d2bb54ab95f4557c02b7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 9 Apr 2002 11:13:00 +0000 Subject: [PATCH 3228/7878] get apr_atomic.h to compile again; decls for some APR types were needed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63237 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 2db1c7db49f..6cb0a7f7d3f 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -63,6 +63,8 @@ extern "C" { #endif +#include "apr_pools.h" + /** * @file apr_atomic.h * @brief APR Atomic Operations From ede221986abb719a4707ac3945691f24d41a722b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 9 Apr 2002 14:48:52 +0000 Subject: [PATCH 3229/7878] Thanks to Aaron for the proposed patch, thanks to Sebastian for validating. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63238 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 12 ------------ libapr.dsp | 12 ------------ 2 files changed, 24 deletions(-) diff --git a/apr.dsp b/apr.dsp index eb251b9d836..5976c9c529e 100644 --- a/apr.dsp +++ b/apr.dsp @@ -170,10 +170,6 @@ SOURCE=.\i18n\unix\xlate.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\locks\win32\locks.c -# End Source File -# Begin Source File - SOURCE=.\locks\win32\proc_mutex.c # End Source File # Begin Source File @@ -424,10 +420,6 @@ SOURCE=.\include\arch\unix\inherit.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\locks.h -# End Source File -# Begin Source File - SOURCE=.\include\arch\win32\misc.h # End Source File # Begin Source File @@ -539,10 +531,6 @@ SOURCE=.\include\apr_lib.h # End Source File # Begin Source File -SOURCE=.\include\apr_lock.h -# End Source File -# Begin Source File - SOURCE=.\include\apr_md5.h # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index abffb763f7e..0f4ef994bf3 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -176,10 +176,6 @@ SOURCE=.\i18n\unix\xlate.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\locks\win32\locks.c -# End Source File -# Begin Source File - SOURCE=.\locks\win32\proc_mutex.c # End Source File # Begin Source File @@ -430,10 +426,6 @@ SOURCE=.\include\arch\unix\inherit.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\locks.h -# End Source File -# Begin Source File - SOURCE=.\include\arch\win32\misc.h # End Source File # Begin Source File @@ -545,10 +537,6 @@ SOURCE=.\include\apr_lib.h # End Source File # Begin Source File -SOURCE=.\include\apr_lock.h -# End Source File -# Begin Source File - SOURCE=.\include\apr_md5.h # End Source File # Begin Source File From dc7185848820f9a98a742a368a8fe70fa135136f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 9 Apr 2002 15:56:15 +0000 Subject: [PATCH 3230/7878] Removed locks.c from the project build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63239 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 198998 -> 199057 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 68b309ad0505eba05cd301bfa876fe8e340a3db2..dd8a209820f3282465bf4f5b18bf8addc55587b6 100644 GIT binary patch delta 81783 zcmZ^~1yozXw=WC?DP9UK4lNXScWH4bP>O4CDelfeid&(D;!@n*EtDcfi#vo;+=2%P z@Y4Ui_giOv_Hry9-v6Awoi*Ax|nI|&yB z4+RCq!Oq;w#m&i^)6v4^&=}j)NP9MjPpO^Du3cIsgr%sl(6PNxT0hexS&+j{v^o4m zT*NQ-G5&@d>#5?Q;+GvUluxfz(d9HOwO3qGLxW?2zq8kC$ypI=TueM>-;HN;eED0H zp4#lLcDEG-oOGQZclxil-JSiYORM?G9VbH22bb%!-Hg{Rh|frgIL(>n&SEHvc;P)t zyRa)T_I}jEcXS~&n9GjjOPowVYcQB9IBajuRnpff%d8W{=muYQSBQFFI5z-&0q3(2 z8&$-#nec~s5^rI=1Mq;pq{Lh5qH#8Z)b{Cob(ZWfU}5ZxZ!7Un!p!B@-~O~cOC7TZ z1pdU)(%(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r6YB=QU~Q7H%<|&>%P&un~(oD z1tJI@=B~Z$l$}$+tc>^5yVrGO<~%V9d%yAGFJVQez`*b%|JQI5^wT!*>^Z9)sT2{J z@Qve(&Z2~;U_WoD*bxczDW-3;h5**QpIDRrmjXo#p~#>shU&fCDnreG zFDSm~K@)7*C{EV!jNe?wWlWCWD}h2(^@D^xR2tslAUw(460nqF7P#A!99@5>0A|E` z?=A!PM%sf3U^WTicg!QSK@mmBby9>o1ea)o;Wri*{L1++Q8}-loV22mH0VAO2^2b$ zqknbASg@hHVhMXiJ`_s;c2grmpY`QuUtSrn0Q0ZbHpjvWt7B(QdBFq_0G@QCD5*}Q zgLyuLL*C!ml_W(i{r=!9!+qr?xiRN^0Lf9j>-~#e!Wsgmovts5{09Zn%)1p8nb5rB zC09YrP0NfdXt*nb@i3{l_^E!^m-DsK3jf$e2gNPX9+gamFHU%Cc-xhKcl3yoy60!( zv2g_GA-_`a6j-w? zKJLdJQ#U+=|7rDpv#x*5D37p!s(0hnr2Hes{eM{g9`|Da172DlARdq}EFtW$TiQA0 Y#3SmPy+7gko)W?aVgtK`K_Jlo0H6HPkN^Mx From a1b1a67787944c4ec3fa46e12ef3c4c58576cd75 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 9 Apr 2002 15:58:36 +0000 Subject: [PATCH 3231/7878] Finished removing the locks API on NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63240 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 - build/nw_export.inc | 1 - misc/netware/start.c | 1 - 3 files changed, 3 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 4a674a844ab..f154aaa1673 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -267,7 +267,6 @@ FILES_lib_objs = \ $(OBJDIR)/inet_pton.o \ $(OBJDIR)/inet_ntop.o \ $(OBJDIR)/libprews.o \ - $(OBJDIR)/locks.o \ $(OBJDIR)/mktemp.o \ $(OBJDIR)/open.o \ $(OBJDIR)/pipe.o \ diff --git a/build/nw_export.inc b/build/nw_export.inc index 8208d136d29..83af8bf7268 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -22,7 +22,6 @@ #include "apr_hash.h" #include "apr_inherit.h" #include "apr_lib.h" -#include "apr_lock.h" #include "apr_md5.h" #include "apr_mmap.h" #include "apr_network_io.h" diff --git a/misc/netware/start.c b/misc/netware/start.c index 55ea736a96a..a49c1e589a7 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -58,7 +58,6 @@ #include "apr_signal.h" #include "misc.h" /* for WSAHighByte / WSALowByte */ -#include "locks.h" /* for apr_unix_setup_lock() */ #include "proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ #include "internal_time.h" From b8fa597a35e96279afd1160e10aecce0e66c796a Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 10 Apr 2002 04:31:10 +0000 Subject: [PATCH 3232/7878] Fix a problem with the is_owner handling in the Unix and MMAP code that would cause a cleanup to be killed that didn't exist in a certain set of circumstances (create, dup but don't transfer ownership, dup again, delete the second dup, boom). Also fix a potential problem in the Unix code where the ->mm pointer would not be set to NULL if munmap failed. Logic like that caused us headaches a while back in the directory cleanups. Reviewed by: Greg Ames, William Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63241 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/unix/mmap.c | 25 +++++++++---------------- mmap/win32/mmap.c | 13 +++++++------ 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 449aa78d3ef..21996add8a9 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -85,25 +85,21 @@ static apr_status_t mmap_cleanup(void *themmap) apr_mmap_t *mm = themmap; int rv; - if (!mm->is_owner) { - return APR_SUCCESS; + if ((!mm->is_owner) || (mm->mm == (void *)-1)) { + /* XXX: we shouldn't ever get here */ + return APR_ENOENT; } #ifdef BEOS rv = delete_area(mm->area); - - if (rv == 0) { - mm->mm = (void *)-1; - return APR_SUCCESS; - } #else rv = munmap(mm->mm, mm->size); +#endif + mm->mm = (void *)-1; if (rv == 0) { - mm->mm = (void *)-1; return APR_SUCCESS; } -#endif return errno; } @@ -189,24 +185,21 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, (*new_mmap)->is_owner = 1; old_mmap->is_owner = 0; apr_pool_cleanup_kill(old_mmap->cntxt, old_mmap, mmap_cleanup); + apr_pool_cleanup_register(p, *new_mmap, mmap_cleanup, + apr_pool_cleanup_null); } else { (*new_mmap)->is_owner = 0; } - apr_pool_cleanup_register(p, *new_mmap, mmap_cleanup, - apr_pool_cleanup_null); } return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm) { - apr_status_t rv; + apr_status_t rv = APR_SUCCESS; - if (mm->mm == (void *)-1) - return APR_ENOENT; - - if ((rv = mmap_cleanup(mm)) == APR_SUCCESS) { + if (mm->is_owner && ((rv = mmap_cleanup(mm)) == APR_SUCCESS)) { apr_pool_cleanup_kill(mm->cntxt, mm, mmap_cleanup); return APR_SUCCESS; } diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index 4a65cff7e7e..836c6d92dac 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -68,8 +68,9 @@ static apr_status_t mmap_cleanup(void *themmap) apr_mmap_t *mm = themmap; apr_status_t rv = 0; - if (!mm->is_owner) { - return APR_SUCCESS; + if (!mm->is_owner || !mm->mhandle) { + /* XXX: we shouldn't ever get here */ + return APR_ENOENT; } if (mm->mv) { @@ -184,21 +185,21 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, (*new_mmap)->is_owner = 1; old_mmap->is_owner = 0; apr_pool_cleanup_kill(old_mmap->cntxt, old_mmap, mmap_cleanup); + apr_pool_cleanup_register(p, *new_mmap, mmap_cleanup, + apr_pool_cleanup_null); } else { (*new_mmap)->is_owner = 0; } - apr_pool_cleanup_register(p, *new_mmap, mmap_cleanup, - apr_pool_cleanup_null); } return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm) { - apr_status_t rv; + apr_status_t rv = APR_SUCCESS; - if ((rv = mmap_cleanup(mm)) == APR_SUCCESS) { + if (mm->is_owner && ((rv = mmap_cleanup(mm)) == APR_SUCCESS)) { apr_pool_cleanup_kill(mm->cntxt, mm, mmap_cleanup); return APR_SUCCESS; } From 4103e7c46929678e8c6856332d80697c3553821d Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 10 Apr 2002 04:54:21 +0000 Subject: [PATCH 3233/7878] Sanitize some return types. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63242 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/unix/mmap.c | 10 ++++++---- mmap/win32/mmap.c | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 21996add8a9..3f081308e74 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -85,8 +85,10 @@ static apr_status_t mmap_cleanup(void *themmap) apr_mmap_t *mm = themmap; int rv; - if ((!mm->is_owner) || (mm->mm == (void *)-1)) { - /* XXX: we shouldn't ever get here */ + if (!mm->is_owner) { + return APR_EINVAL; + } + else if (mm->mm == (void *)-1) { return APR_ENOENT; } @@ -197,9 +199,9 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm) { - apr_status_t rv = APR_SUCCESS; + apr_status_t rv; - if (mm->is_owner && ((rv = mmap_cleanup(mm)) == APR_SUCCESS)) { + if ((rv = mmap_cleanup(mm)) == APR_SUCCESS) { apr_pool_cleanup_kill(mm->cntxt, mm, mmap_cleanup); return APR_SUCCESS; } diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index 836c6d92dac..2d3d61a4ceb 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -68,8 +68,10 @@ static apr_status_t mmap_cleanup(void *themmap) apr_mmap_t *mm = themmap; apr_status_t rv = 0; - if (!mm->is_owner || !mm->mhandle) { - /* XXX: we shouldn't ever get here */ + if (!mm->is_owner) { + return APR_EINVAL; + } + else if (!mm->mhandle) { return APR_ENOENT; } @@ -197,9 +199,9 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm) { - apr_status_t rv = APR_SUCCESS; + apr_status_t rv; - if (mm->is_owner && ((rv = mmap_cleanup(mm)) == APR_SUCCESS)) { + if ((rv = mmap_cleanup(mm)) == APR_SUCCESS) { apr_pool_cleanup_kill(mm->cntxt, mm, mmap_cleanup); return APR_SUCCESS; } From 7ad5f121a62c543e16fd4a127eaf10ee72380b43 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 10 Apr 2002 18:58:47 +0000 Subject: [PATCH 3234/7878] get the setting of the shared library environment variable name working on HP-UX HP-UX grep didn't handle the previous expression so we ended up with a null string which in turn resulted in a broken Apache envvars file git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63243 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 38dabe6c343..119ef2d6949 100644 --- a/configure.in +++ b/configure.in @@ -117,7 +117,10 @@ AC_PROG_LIBTOOL LTFLAGS='--silent' fi dnl get libtool's setting of shlibpath_var - eval `grep "^shlibpath_var=[[A-Z_]]\+$" $apr_builddir/libtool` + eval `grep "^shlibpath_var=[[A-Z_]]*$" $apr_builddir/libtool` + if test "x$shlibpath_var" = "x"; then + shlibpath_var=REPLACE_WITH_YOUR_SHLIBPATH_VAR + fi ;; esac From 863b001d31382b0c5b071190257309e43301eb0d Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Thu, 11 Apr 2002 01:05:39 +0000 Subject: [PATCH 3235/7878] If a socket write or sendfile call writes less than the requested amount of data, do a select to wait for writability on the socket before attempting the next write. Obtained from: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63244 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ network_io/unix/sendrecv.c | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 606782b0f3c..3e2888b0c19 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) On socket write functions (apr_sendfile, apr_send, apr_sendv), + added a select to wait for writability on the socket if the + previous write was incomplete. [Jeff Trawick, Brian Pane] + *) Deprecated the apr_lock.h API. Please see the following files for the improved thread and process locking and signaling: apr_proc_mutex.h, apr_thread_mutex.h, apr_thread_rwlock.h, diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 4df1cf124c9..8700c930ec7 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -97,13 +97,19 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { ssize_t rv; + if (sock->netmask & APR_INCOMPLETE_WRITE) { + goto do_select; + } + do { rv = write(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); + apr_status_t arv; +do_select: + arv = apr_wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -118,6 +124,9 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) *len = 0; return errno; } + if (sock->timeout && rv < *len) { + sock->netmask |= APR_INCOMPLETE_WRITE; + } (*len) = rv; return APR_SUCCESS; } @@ -238,6 +247,16 @@ apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len) { apr_ssize_t rv; + apr_size_t requested_len = 0; + apr_int32_t i; + + for (i = 0; i < nvec; i++) { + requested_len += vec[i].iov_len; + } + + if (sock->netmask & APR_INCOMPLETE_WRITE) { + goto do_select; + } do { rv = writev(sock->socketdes, vec, nvec); @@ -245,7 +264,9 @@ apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); + apr_status_t arv; +do_select: + arv = apr_wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -260,6 +281,9 @@ apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, *len = 0; return errno; } + if (sock->timeout && rv < requested_len) { + sock->netmask |= APR_INCOMPLETE_WRITE; + } (*len) = rv; return APR_SUCCESS; } @@ -323,6 +347,11 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, } } + if (sock->netmask & APR_INCOMPLETE_WRITE) { + sock->netmask &= ~APR_INCOMPLETE_WRITE; + goto do_select; + } + do { rv = sendfile(sock->socketdes, /* socket */ file->filedes, /* open file descriptor of the file to be sent */ @@ -334,6 +363,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { +do_select: arv = apr_wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -364,6 +394,9 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (rv < *len) { *len = nbytes; + if (sock->timeout) { + sock->netmask |= APR_INCOMPLETE_WRITE; + } return apr_setsocketopt(sock, APR_TCP_NOPUSH, 0); } From 5cc881b6a0c20f7a93bec311fc5885d26d883ece Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Thu, 11 Apr 2002 01:30:45 +0000 Subject: [PATCH 3236/7878] Added APR_INCOMPLETE_WRITE git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63245 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index e9d68d839bc..44e379221b9 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -122,6 +122,8 @@ extern "C" { * read, in cases where the app expects * that an immediate read would fail.) */ +#define APR_INCOMPLETE_WRITE 8192 /* like APR_INCOMPLETE_READ, but for write + */ #define APR_POLLIN 0x001 #define APR_POLLPRI 0x002 From b44aea2c97f29f82cfab68d14bd790b0259f5139 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Thu, 11 Apr 2002 03:15:47 +0000 Subject: [PATCH 3237/7878] Solaris version of the code that inserts a select before the next sendfilev call if the last one returned EAGAIN, plus a fix for a bug in the apr_send() and apr_sendv() logic (I was never unsetting the APR_INCOMPLETE_WRITE flag) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63246 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 8700c930ec7..65df39670a1 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -98,6 +98,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) ssize_t rv; if (sock->netmask & APR_INCOMPLETE_WRITE) { + sock->netmask &= ~APR_INCOMPLETE_WRITE; goto do_select; } @@ -255,6 +256,7 @@ apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, } if (sock->netmask & APR_INCOMPLETE_WRITE) { + sock->netmask &= ~APR_INCOMPLETE_WRITE; goto do_select; } @@ -799,6 +801,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, size_t nbytes; sendfilevec_t *sfv; int vecs, curvec, i, repeat; + apr_size_t requested_len = 0; if (!hdtr) { hdtr = &no_hdtr; @@ -819,6 +822,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, sfv[curvec].sfv_flag = 0; sfv[curvec].sfv_off = (off_t)hdtr->headers[i].iov_base; sfv[curvec].sfv_len = hdtr->headers[i].iov_len; + requested_len += sfv[curvec].sfv_len; } /* If the len is 0, we skip the file. */ @@ -828,6 +832,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, sfv[curvec].sfv_flag = 0; sfv[curvec].sfv_off = *offset; sfv[curvec].sfv_len = *len; + requested_len += sfv[curvec].sfv_len; curvec++; } @@ -840,6 +845,19 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, sfv[curvec].sfv_flag = 0; sfv[curvec].sfv_off = (off_t)hdtr->trailers[i].iov_base; sfv[curvec].sfv_len = hdtr->trailers[i].iov_len; + requested_len += sfv[curvec].sfv_len; + } + + /* If the last write couldn't send all the requested data, + * wait for the socket to become writable before proceeding + */ + if (sock->netmask & APR_INCOMPLETE_WRITE) { + sock->netmask &= ~APR_INCOMPLETE_WRITE; + arv = apr_wait_for_io_or_timeout(sock, 0); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } } /* Actually do the sendfilev @@ -889,6 +907,9 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, /* Update how much we sent */ *len = nbytes; + if (sock->timeout && (*len < requested_len)) { + sock->netmask |= APR_INCOMPLETE_WRITE; + } return APR_SUCCESS; } #else From 721ede6d504ecb464ebbaa18fd43fa02ea7a29a7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 11 Apr 2002 04:36:54 +0000 Subject: [PATCH 3238/7878] systems where sigsuspend() is used in lieu of sigwait() need the declarations of apr_setup_signal_thread() and apr_signal_thread() too; this fixes some worker MPM warnings on Darwin git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63247 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 ++- include/apr.h.in | 1 + include/apr.hnw | 1 + include/apr.hw | 1 + include/apr_thread_proc.h | 4 ++-- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 119ef2d6949..9c032c537e9 100644 --- a/configure.in +++ b/configure.in @@ -547,7 +547,7 @@ else echo "APR will be non-threaded" fi -AC_CHECK_FUNCS(sigsuspend) +AC_CHECK_FUNCS(sigsuspend, [ have_sigsuspend="1" ], [ have_sigsuspend="0" ]) AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ]) dnl AC_CHECK_FUNCS doesn't work for this on Tru64 since the function dnl is renamed in signal.h. Todo: Autodetect @@ -558,6 +558,7 @@ case $host in esac AC_SUBST(threads) +AC_SUBST(have_sigsuspend) AC_SUBST(have_sigwait) AC_CHECK_FUNCS(poll) diff --git a/include/apr.h.in b/include/apr.h.in index 7703809e92c..2c8d87bce20 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -106,6 +106,7 @@ #define APR_HAVE_MEMMOVE @have_memmove@ #define APR_HAVE_SETRLIMIT @have_setrlimit@ #define APR_HAVE_SIGACTION @have_sigaction@ +#define APR_HAVE_SIGSUSPEND @have_sigsuspend@ #define APR_HAVE_SIGWAIT @have_sigwait@ #define APR_HAVE_STRCASECMP @have_strcasecmp@ #define APR_HAVE_STRDUP @have_strdup@ diff --git a/include/apr.hnw b/include/apr.hnw index d4aaf17454b..b55a12db186 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -173,6 +173,7 @@ #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 #define APR_HAVE_SIGACTION 0 +#define APR_HAVE_SIGSUSPEND 0 #define APR_HAVE_SIGWAIT 0 #define APR_HAVE_STRCASECMP 1 #define APR_HAVE_STRDUP 1 diff --git a/include/apr.hw b/include/apr.hw index a8905aa08e1..102b45fc279 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -196,6 +196,7 @@ extern "C" { #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 #define APR_HAVE_SIGACTION 0 +#define APR_HAVE_SIGSUSPEND 0 #define APR_HAVE_SIGWAIT 0 #define APR_HAVE_STRCASECMP 0 #define APR_HAVE_STRDUP 1 diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index a722756a4b7..27e09f59675 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -652,7 +652,7 @@ APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, #if APR_HAS_THREADS -#if APR_HAVE_SIGWAIT && !defined(OS2) +#if (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) && !defined(OS2) /** * Setup the process for a single thread to be used for all signal handling. @@ -669,7 +669,7 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void); */ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)); -#endif /* !defined(OS2) && APR_HAVE_SIGWAIT */ +#endif /* (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) && !defined(OS2) */ /** * Get the child-pool used by the thread from the thread info. From 9afaa4b8810558b1d3b0a371dcad52d6f4ede307 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 11 Apr 2002 14:37:34 +0000 Subject: [PATCH 3239/7878] AIX: Fix breakage with 64-bit builds on versions of AIX prior to 5L. The 64-bit definitions for sigset_t changed between 4.X and 5L. PR: 7957 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63248 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ threadproc/unix/signals.c | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 3e2888b0c19..160cab45766 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) AIX: Fix breakage with 64-bit builds on versions of AIX prior + to 5L. PR 7957 [Jeff Trawick] + *) On socket write functions (apr_sendfile, apr_send, apr_sendv), added a select to wait for writability on the socket if the previous write was incomplete. [Jeff Trawick, Brian Pane] diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index d53e604763c..304e50aed3f 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -347,21 +347,22 @@ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)) * off manually. * * Note that the private fields differ between 32-bit and 64-bit - * and even between _ALL_SOURCE and !_ALL_SOURCE. + * and even between _ALL_SOURCE and !_ALL_SOURCE. Except that on + * AIX 4.3 32-bit builds and 64-bit builds use the same definition. * * Applicable AIX fixes such that this is no longer needed: * - * APAR IY23096 for AIX 51B, fix included in AIX 51C, and + * APAR IY23096 for AIX 51B, fix included in AIX 51C, and * APAR IY24162 for 43X. */ #if defined(_AIX) -#ifdef __64BIT__ +#if defined(__64BIT__) && defined(_AIXVERSION_510) #ifdef _ALL_SOURCE sig_mask.ss_set[3] &= 0x7FFFFFFF; #else /* not _ALL_SOURCE */ sig_mask.__ss_set[3] &= 0x7FFFFFFF; #endif -#else /* not 64-bit build */ +#else /* not 64-bit build, or 64-bit build on 4.3 */ #ifdef _ALL_SOURCE sig_mask.hisigs &= 0x7FFFFFFF; #else /* not _ALL_SOURCE */ From 0c2c55b8c61fa385177b35a886b150ffea30ca54 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 11 Apr 2002 20:47:00 +0000 Subject: [PATCH 3240/7878] Added mmap APIs to the NetWare build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63249 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 6 ++++++ libaprnw.mcp.zip | Bin 199057 -> 198909 bytes 2 files changed, 6 insertions(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index f154aaa1673..df06d8db63f 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -251,6 +251,7 @@ FILES_lib_objs = \ $(OBJDIR)/apr_strtok.o \ $(OBJDIR)/apr_tables.o \ $(OBJDIR)/copy.o \ + $(OBJDIR)/common.o \ $(OBJDIR)/dir.o \ $(OBJDIR)/dso.o \ $(OBJDIR)/errorcodes.o \ @@ -268,6 +269,7 @@ FILES_lib_objs = \ $(OBJDIR)/inet_ntop.o \ $(OBJDIR)/libprews.o \ $(OBJDIR)/mktemp.o \ + $(OBJDIR)/mmap.o \ $(OBJDIR)/open.o \ $(OBJDIR)/pipe.o \ $(OBJDIR)/poll.o \ @@ -374,6 +376,10 @@ $(OBJDIR)/%.o: memory/unix/%.c $(OBJDIR)\cc.opt @echo Compiling $< $(CC) memory\unix\$(5Tq$hL?CpKUPJE*y+{v%&)y4#S;;wP=FIGwbM~I+?7e4?n&SNj&+pv3^Uob}*C-Cl5pA8< z1$Xa=x02m?a_7z+M>}&fS9eb<4^L+Rmy?C-&H}zE=_EZqT9MUXqFay6C^pdA;DjFX@W9@dqGH(&|5@3gx^#y12Sw z$tsviZUO8sLR$P!E9N&m8u%XP#&z*ji+l2~19q%iJrm4m<`F#O`uWt)W}weTJ#}6# z9pj~cyo;2G6SvG$kCx|;hJm1)Vf5)Iqw&8TJ-T#5wuW?mrKg!7x_cxU+(c(%rbQZc{N{u9=g*lb`pxkP!p`CT(1z}L zjRIA!fu!HIt^Q!&z;{?RL*jM$*@vhknfHi7+Ag<<7pXXMVb z+I!k7^l}-`VCd5iYh3D~+Oe>s=+(oiRok*%Qt{vWN3lf)@9OP?lpN3`Nu|ifTSO+r)P z+xyRtOMS%G3Iac-y=imosomE8^x5M>?l)csZJt#E$NtyJOch-6a)O{@%5$e`?^7{48?r;P;~GU;oMUivvY=oblTS*C3;7}Anm_d z;m#S|S@&c09axe4{guw7k4rqh4veb@+^~X@EcAo_7-!B>T%b(a!3}FnB8yR%ep>Fp z?p{AFzLbWZRP|XZs5+bf@RP3QE#AD7@`6o8_;(_(wqsF-#NKYpxGZ8c`Kr#fAV9z~ z?QR3e|z~m#4G=R>Z@;do$=6P;u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c308022b8e30bbfc Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 11 Apr 2002 20:49:29 +0000 Subject: [PATCH 3241/7878] Still working on the spawning process and wiring up the pipes. Changed apr_proc_create so that the parent side of the pipes are opened first. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63250 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 10 ++++++++- threadproc/netware/proc.c | 43 ++++++++++++++++++++++++--------------- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index d28c12b16c5..82c190bb225 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -81,7 +81,8 @@ apr_status_t apr_netware_pipe_cleanup(void *thefile) static apr_status_t pipeblock(apr_file_t *thepipe) { - int err; +#ifdef USE_FLAGS + int err; unsigned long flags; if (fcntl(thepipe->filedes, F_GETFL, &flags) != -1) @@ -89,6 +90,9 @@ static apr_status_t pipeblock(apr_file_t *thepipe) flags &= ~FNDELAY; fcntl(thepipe->filedes, F_SETFL, flags); } +#else + fcntl(thepipe->filedes, F_SETFL, FNDELAY); +#endif if (errno) return errno; @@ -99,6 +103,7 @@ static apr_status_t pipeblock(apr_file_t *thepipe) static apr_status_t pipenonblock(apr_file_t *thepipe) { +#ifdef USE_FLAGS int err; unsigned long flags; @@ -108,6 +113,9 @@ static apr_status_t pipenonblock(apr_file_t *thepipe) flags |= FNDELAY; fcntl(thepipe->filedes, F_SETFL, flags); } +#else + fcntl(thepipe->filedes, F_SETFL, 0); +#endif if (errno) return errno; diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index e466108bc9f..a83e93e5078 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -347,12 +347,18 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, envSpec.esStdin.ssPath = attr->child_in->fname; apr_file_close(attr->child_in); if (attr->parent_in) { - apr_file_close(attr->parent_in); + close(attr->parent_in->filedes); + attr->parent_in->filedes = pipe_open(attr->parent_in->fname, O_WRONLY); + /* XXX take this out when pipe blocking is fixed */ + fcntl(attr->parent_in->filedes, F_SETFL, 0); } } else if (attr->parent_in) { envSpec.esStdin.ssPath = attr->parent_in->fname; - apr_file_close(attr->parent_in); + close(attr->parent_in->filedes); + attr->parent_in->filedes = pipe_open(attr->parent_in->fname, O_WRONLY); + /* XXX take this out when pipe blocking is fixed */ + fcntl(attr->parent_in->filedes, F_SETFL, 0); } else { envSpec.esStdin.ssPath = NULL; @@ -367,12 +373,18 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, envSpec.esStdout.ssPath = attr->child_out->fname; apr_file_close(attr->child_out); if (attr->parent_out) { - apr_file_close(attr->parent_out); + close(attr->parent_out->filedes); + attr->parent_out->filedes = pipe_open(attr->parent_out->fname, O_RDONLY); + /* XXX take this out when pipe blocking is fixed */ + fcntl(attr->parent_out->filedes, F_SETFL, 0); } } else if (attr->parent_out) { envSpec.esStdout.ssPath = attr->parent_out->fname; - apr_file_close(attr->parent_out); + close(attr->parent_out->filedes); + attr->parent_out->filedes = pipe_open(attr->parent_out->fname, O_RDONLY); + /* XXX take this out when pipe blocking is fixed */ + fcntl(attr->parent_out->filedes, F_SETFL, 0); } else { envSpec.esStdout.ssPath = NULL; @@ -387,12 +399,18 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, envSpec.esStderr.ssPath = attr->child_err->fname; apr_file_close(attr->child_err); if (attr->parent_err) { - apr_file_close(attr->parent_err); + close(attr->parent_err->filedes); + attr->parent_err->filedes = pipe_open(attr->parent_err->fname, O_RDONLY); + /* XXX take this out when pipe blocking is fixed */ + fcntl(attr->parent_err->filedes, F_SETFL, 0); } } else if (attr->parent_err) { envSpec.esStderr.ssPath = attr->parent_err->fname; - apr_file_close(attr->parent_err); + close(attr->parent_err->filedes); + attr->parent_err->filedes = pipe_open(attr->parent_err->fname, O_RDONLY); + /* XXX take this out when pipe blocking is fixed */ + fcntl(attr->parent_err->filedes, F_SETFL, 0); } else { envSpec.esStderr.ssPath = NULL; @@ -406,20 +424,13 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, newproc->err = attr->parent_err; newproc->out = attr->parent_out; if (NXVmSpawn(&nameSpec, &envSpec, flags, &newVM) != 0) { + apr_file_close(attr->parent_in); + apr_file_close(attr->parent_out); + apr_file_close(attr->parent_err); return errno; } else { newproc->pid = newVM; - if (attr->parent_out) { - attr->parent_out->filedes = pipe_open(attr->parent_out->fname, O_WRONLY); - } - if (attr->parent_in) { - attr->parent_in->filedes = pipe_open(attr->parent_in->fname, O_RDONLY); - } - if (attr->parent_err) { - attr->parent_err->filedes = pipe_open(attr->parent_err->fname, O_RDONLY); - } - apr_pool_cleanup_register(pool, (void *)newproc, apr_netware_proc_cleanup, apr_pool_cleanup_null); } From d762f918702a7d25d33028729b7b3911b431cc3f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 11 Apr 2002 22:55:41 +0000 Subject: [PATCH 3242/7878] allow the testlock program to continue on systems where read/write locks aren't implemented (e.g., Darwin); there is still useful stuff to test git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63251 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/testlock.c b/test/testlock.c index 2daddf4ab72..30a2257598c 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -482,9 +482,15 @@ int main(int argc, const char * const *argv) } if ((rv = test_thread_rwlock()) != APR_SUCCESS) { - fprintf(stderr,"thread_rwlock test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-6); + if (rv == APR_ENOTIMPL) { + fprintf(stderr, "read/write locks aren't implemented on this " + "platform... skipping those tests...\n"); + } + else { + fprintf(stderr,"thread_rwlock test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-6); + } } if ((rv = test_cond()) != APR_SUCCESS) { From f4b03addf496e5bce16dfd5a91df8afb46107139 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 12 Apr 2002 01:19:44 +0000 Subject: [PATCH 3243/7878] Set precompiler for Solaris atomics when using GNU binutils. (Fix whitespace issue a line earlier while I'm at it.) PR: 7876 Submitted by: Marvin Solomon Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63252 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 160cab45766..3c88519e1ca 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Set precompiler for Solaris atomics when using GNU binutils. + PR 7876. [solomon@conceptshopping.com (Marvin Solomon)] + *) AIX: Fix breakage with 64-bit builds on versions of AIX prior to 5L. PR 7957 [Jeff Trawick] diff --git a/configure.in b/configure.in index 9c032c537e9..2f584d1b0d7 100644 --- a/configure.in +++ b/configure.in @@ -362,7 +362,7 @@ case $host in apr_atomic_sparc_compile=apr_atomic_sparc.lo sparc_arch=`uname -m` is_gnu_as=`${AS} --help 2>/dev/null | grep gnu.org` - if test -n "$is_gnu_as" + if test -n "$is_gnu_as" then case "$sparc_arch" in sun4c|sun4m|sun4d|sun4t|sun4) @@ -372,6 +372,7 @@ case $host in *) ASFLAGS="-xarch=v8plus -K PIC" ASCPPFLAGS="-D_ASM -D__STDC__=0" + ASCPP="gcc -E" ;; esac else From b0c3ab406fa489b38cd0ab8ab8be8fc91459b51b Mon Sep 17 00:00:00 2001 From: Karl Fogel Date: Sat, 13 Apr 2002 06:12:33 +0000 Subject: [PATCH 3244/7878] * STATUS: Add an item about the apr_md5* api discussion. I may not be up on all the proper conventions for noting this sort of thing in the STATUS file; please educate me if necessary, thanks. -kff git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63253 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 8bf6ff9b124..4761c5bd9be 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/04/01 21:50:45 $] +Last modified at [$Date: 2002/04/13 06:12:33 $] Release: @@ -327,3 +327,27 @@ Stuff waiting for code thawing after Beta 1: usefulness, perhaps hidden, generic read-only [immutable], effective current user permissions, etc. + * Maybe make the following functions return void instead of + apr_status_t, as they cannot ever error: + + apr_md5_init() + apr_md5_update() + apr_md5_final() + apr_md5_encode() + apr_md5() /* plus make the obvious code tweak in this one */ + + (Volunteer: Karl Fogel .) + + However, don't do this until after apr and apr-util offer + library version numbers, and httpd uses those numbers to + indicate which version it needs. Until the libraries are + versioned, this api change is [somewhat] painful for httpd. + Status: Still in discussion, current leanings appear to be + Bill Stoddard -0.5 (?) + Justin Erenkrantz -1 + Sander Striker -1 or -0.5 (?) + Greg Stein +1 + Karl Fogel +1 + (Not sure if the negatives would stay negative given that the + change would now wait for the library versioning thing described + above, though.) From e65d7cb66c9029c83c0372a112d20ade0818f189 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 13 Apr 2002 06:34:08 +0000 Subject: [PATCH 3245/7878] My comment has nothing to do with versioning but rather a tendency to be conservative about things that could possibly fail - given an unknown implementation. Our implementation can't fail, but a theoretical MD5 implementation could. I've just been bit by too many locations in httpd where no return code was ever thought possible and we had to change the API to handle a return code when we did need it. Note that our md5 implementation has no business being in APR - it should be in apr-util with our "crypto" stuff there. The overall goal of providing random bytes on all platforms (i.e. APR_HAS_RANDOM is always defined) would mean that we can kick md5 to its appropriate place - see note about where the fix needs to be. So, if you "fix" the API, it might be goodness to move it to apr-util at the same time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63254 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 4761c5bd9be..1cb80c45659 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/04/13 06:12:33 $] +Last modified at [$Date: 2002/04/13 06:34:08 $] Release: @@ -344,10 +344,12 @@ Stuff waiting for code thawing after Beta 1: versioned, this api change is [somewhat] painful for httpd. Status: Still in discussion, current leanings appear to be Bill Stoddard -0.5 (?) - Justin Erenkrantz -1 Sander Striker -1 or -0.5 (?) Greg Stein +1 Karl Fogel +1 (Not sure if the negatives would stay negative given that the change would now wait for the library versioning thing described above, though.) + Justin says: If you do this, please move it into apr-util where md5 + belongs! You'll have to address the random issue in + misc/unix/getuuid.c that forces md5 to be in APR. From dea7c94cf65d446c91051c6062df1cdfcd45abc9 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sat, 13 Apr 2002 07:46:58 +0000 Subject: [PATCH 3246/7878] Change wrongly assumed vote. Presented in a different context sheds a different light on things. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63255 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 1cb80c45659..cc088a91902 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/04/13 06:34:08 $] +Last modified at [$Date: 2002/04/13 07:46:58 $] Release: @@ -344,7 +344,7 @@ Stuff waiting for code thawing after Beta 1: versioned, this api change is [somewhat] painful for httpd. Status: Still in discussion, current leanings appear to be Bill Stoddard -0.5 (?) - Sander Striker -1 or -0.5 (?) + Sander Striker +1 Greg Stein +1 Karl Fogel +1 (Not sure if the negatives would stay negative given that the @@ -353,3 +353,5 @@ Stuff waiting for code thawing after Beta 1: Justin says: If you do this, please move it into apr-util where md5 belongs! You'll have to address the random issue in misc/unix/getuuid.c that forces md5 to be in APR. + Sander: +1 for the move. + From 057299a49343fd457cde130ad76d0f8c79b77c38 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sat, 13 Apr 2002 12:00:07 +0000 Subject: [PATCH 3247/7878] Rename apr_explode_localtime to apr_time_exp_lt. Submitted by: Thom May git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63256 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 2 +- renames_pending | 1 - test/testtime.c | 2 +- time/unix/time.c | 2 +- time/unix/timestr.c | 2 +- time/win32/time.c | 2 +- time/win32/timestr.c | 2 +- 7 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/apr_time.h b/include/apr_time.h index 9aaf188dc57..213175231e4 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -166,7 +166,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, * @param result the exploded time * @param input the time to explode */ -APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, +APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, apr_time_t input); /** diff --git a/renames_pending b/renames_pending index 8d93f2657ba..2615e860222 100644 --- a/renames_pending +++ b/renames_pending @@ -1,6 +1,5 @@ Symbol renames for APR -apr_time_exp_lt from apr_explode_localtime apr_time_exp_tz from apr_explode_time apr_group_name_get from apr_get_groupname diff --git a/test/testtime.c b/test/testtime.c index 095ad9da591..1a96449e986 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -85,7 +85,7 @@ int main(void) STD_TEST_NEQ(" apr_time_exp_gmt", apr_time_exp_gmt(&xt, now)) - STD_TEST_NEQ(" apr_explode_localtime", apr_explode_localtime(&xt2, now)) + STD_TEST_NEQ(" apr_time_exp_lt", apr_time_exp_lt(&xt2, now)) STD_TEST_NEQ(" apr_time_exp_get (GMT)", apr_time_exp_get(&imp, &xt)) diff --git a/time/unix/time.c b/time/unix/time.c index 8e6e448b2bb..70a24df71b4 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -160,7 +160,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, return apr_explode_time(result, input, 0); } -APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, +APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, apr_time_t input) { #if defined(__EMX__) diff --git a/time/unix/timestr.c b/time/unix/timestr.c index 989f4836914..a3ff324c984 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -134,7 +134,7 @@ apr_status_t apr_ctime(char *date_str, apr_time_t t) /* example: "Wed Jun 30 21:49:08 1993" */ /* 123456789012345678901234 */ - apr_explode_localtime(&xt, t); + apr_time_exp_lt(&xt, t); s = &apr_day_snames[xt.tm_wday][0]; *date_str++ = *s++; *date_str++ = *s++; diff --git a/time/win32/time.c b/time/win32/time.c index 31fe28ffd4e..8a777a176e1 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -171,7 +171,7 @@ APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, +APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, apr_time_t input) { SYSTEMTIME st; diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 8bfcd84e99f..c78e6a1d91f 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -122,7 +122,7 @@ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t) /* example: "Wed Jun 30 21:49:08 1993" */ /* 123456789012345678901234 */ - apr_explode_localtime(&xt, t); + apr_time_exp_lt(&xt, t); s = &apr_day_snames[xt.tm_wday][0]; *date_str++ = *s++; *date_str++ = *s++; From 974dd36b9a0c3a8050d84cc29cc9d80ba4e0647d Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 13 Apr 2002 13:51:26 +0000 Subject: [PATCH 3248/7878] Beos locks are global. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63257 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 604a41f90a9..e7f4b036e39 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -324,6 +324,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *beos*) APR_ADDTO(CPPFLAGS, [-DBEOS]) PLATOSVERS=`uname -r` + APR_SETIFNULL(apr_process_lock_is_global, [yes]) case $PLATOSVERS in 5.0.4) APR_ADDTO(LDFLAGS, [-L/boot/develop/lib/x86 -L/boot/beos/system/lib -lbind -lsocket]) From 3c1784011ca95df9153dc9af782bcb3c2265296c Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 13 Apr 2002 13:52:25 +0000 Subject: [PATCH 3249/7878] We don't need seperate global_mutex's. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63258 13f79535-47bb-0310-9956-ffa450edef68 --- locks/beos/Makefile.in | 3 +- locks/beos/global_mutex.c | 95 --------------------------------------- 2 files changed, 1 insertion(+), 97 deletions(-) delete mode 100644 locks/beos/global_mutex.c diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in index c1f07c137b7..993cc464378 100644 --- a/locks/beos/Makefile.in +++ b/locks/beos/Makefile.in @@ -3,8 +3,7 @@ TARGETS = \ thread_mutex.lo \ thread_rwlock.lo \ thread_cond.lo \ - proc_mutex.lo \ - global_mutex.lo + proc_mutex.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/locks/beos/global_mutex.c b/locks/beos/global_mutex.c deleted file mode 100644 index fc67750eaad..00000000000 --- a/locks/beos/global_mutex.c +++ /dev/null @@ -1,95 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr.h" -#include "apr_strings.h" - -APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, - const char *fname, - apr_lockmech_e mech, - apr_pool_t *pool) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_child_init( - apr_global_mutex_t **mutex, - const char *fname, - apr_pool_t *pool) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) -{ - return APR_ENOTIMPL; -} - -APR_POOL_IMPLEMENT_ACCESSOR(global_mutex) - From 4223ecb1cc0adeb959db392c1a241c00422153b6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 13 Apr 2002 18:17:05 +0000 Subject: [PATCH 3250/7878] A comment that made no sense. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63259 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index 6f26131a612..531dff1af4f 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -210,8 +210,6 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***en * atexit to ensure this is called. When using APR from a language * other than C that has problems with the calling convention, use * apr_terminate2() instead. - * Otherwise, this call is identical to apr_app_initialize, and must be - * closed with a call to apr_terminate at the end of program execution. */ APR_DECLARE_NONSTD(void) apr_terminate(void); From acc04f0c6c6b81cd6ab288d2608dfce9bbf4654c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 13 Apr 2002 19:27:24 +0000 Subject: [PATCH 3251/7878] Correct const'ification of apr_app_initialize and internal related functions, as pointed out by GStein. Also fix a -very- significant bug in win32/apr_app_initialize() where we misassigned the new env memory to env rather than *env as required. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63260 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 8 ++++++-- include/arch/win32/misc.h | 3 ++- misc/netware/start.c | 4 +++- misc/unix/start.c | 4 +++- misc/win32/internal.c | 3 ++- misc/win32/start.c | 15 +++++++++------ 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index 531dff1af4f..c474676917f 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -195,12 +195,16 @@ APR_DECLARE(apr_status_t) apr_initialize(void); * order to deal with platform-specific oddities, such as Win32 services, * code pages and signals. This must be the first function called for any * APR program. - * @deffunc apr_status_t apr_app_initialize(int *argc, char ***argv, char ***env) + * @param argc Pointer to the argc that may be corrected + * @param argv Pointer to the argv that may be corrected + * @param env Pointer to the env that may be corrected, may be NULL * @remark See apr_initialize if this is a library consumer of apr. * Otherwise, this call is identical to apr_initialize, and must be closed * with a call to apr_terminate at the end of program execution. */ -APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***env); +APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, + char const * const * *argv, + char const * const * *env); /** * Tear down any APR internal data structures which aren't torn down diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index feb72c6bf59..072dad16b57 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -103,7 +103,8 @@ struct apr_other_child_rec_t { */ extern int APR_DECLARE_DATA apr_app_init_complete; -int apr_wastrtoastr(char ***retarr, const wchar_t **arr, int args); +int apr_wastrtoastr(char const * const * *retarr, + wchar_t const * const *arr, int args); /* Platform specific designation of run time os version. * Gaps allow for specific service pack levels that diff --git a/misc/netware/start.c b/misc/netware/start.c index a49c1e589a7..64c6c0a9d9e 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -62,7 +62,9 @@ #include "internal_time.h" -APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***env) +APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, + const char * const * *argv, + const char * const * *env) { /* An absolute noop. At present, only Win32 requires this stub, but it's * required in order to move command arguments passed through the service diff --git a/misc/unix/start.c b/misc/unix/start.c index 5bfa8dc3a41..b1ad87528b0 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -61,7 +61,9 @@ #include "internal_time.h" -APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***env) +APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, + const char * const * *argv, + const char * const * *env) { /* An absolute noop. At present, only Win32 requires this stub, but it's * required in order to move command arguments passed through the service diff --git a/misc/win32/internal.c b/misc/win32/internal.c index 771be2eac85..4ba6f70ba6d 100644 --- a/misc/win32/internal.c +++ b/misc/win32/internal.c @@ -76,7 +76,8 @@ * These are allocated from the MSVCRT's _CRT_BLOCK to trick the system * into trusting our store. */ -int apr_wastrtoastr(char ***retarr, const wchar_t **arr, int args) +int apr_wastrtoastr(char const * const * *retarr, + wchar_t const * const *arr, int args) { size_t elesize = 0; char **newarr; diff --git a/misc/win32/start.c b/misc/win32/start.c index 36fc7ac6c5f..340c62960ed 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -75,9 +75,10 @@ int APR_DECLARE_DATA apr_app_init_complete = 0; * as a list of strings. These are allocated from the MSVCRT's * _CRT_BLOCK to trick the system into trusting our store. */ -static int warrsztoastr(char ***retarr, wchar_t *arrsz, int args) +static int warrsztoastr(const char * const * *retarr, + const wchar_t * arrsz, int args) { - apr_wchar_t *wch; + const apr_wchar_t *wch; size_t totlen; size_t newlen; size_t wsize; @@ -128,7 +129,9 @@ static int warrsztoastr(char ***retarr, wchar_t *arrsz, int args) /* Reprocess the arguments to main() for a completely apr-ized application */ -APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***env) +APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, + const char * const * *argv, + const char * const * *env) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE @@ -155,9 +158,9 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***en dupenv = warrsztoastr(&_environ, sysstr, -1); if (env) { - env = _malloc_dbg((dupenv + 1) * sizeof (char *), - _CRT_BLOCK, __FILE__, __LINE__ ); - memcpy(*env, _environ, (dupenv + 1) * sizeof (char *)); + *env = _malloc_dbg((dupenv + 1) * sizeof (char *), + _CRT_BLOCK, __FILE__, __LINE__ ); + memcpy((void*)*env, _environ, (dupenv + 1) * sizeof (char *)); } else { } From 0c8caa275ff636525893fcebd38cae545c948380 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 13 Apr 2002 22:34:55 +0000 Subject: [PATCH 3252/7878] Significant overhaul to respect all four flavors of APR_PROCESS, _ENV, _PATH, and APR_SHELLCMD git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63261 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 76 +++++++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 22 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 36f952d1ccf..1eb5ba9fe36 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -362,19 +362,34 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, /* progname must be unquoted, in native format, as there are all sorts * of bugs in the NT library loader code that fault when parsing '/'. - * We do not directly manipulate cmdline, and it will become a copy, - * so we've casted past the constness issue. * XXX progname must be NULL if this is a 16 bit app running in WOW */ if (progname[0] == '\"') { progname = apr_pstrndup(pool, progname + 1, strlen(progname) - 2); } - if ((rv = apr_filepath_merge(&cmdline, attr->currdir, progname, - APR_FILEPATH_NATIVE, pool)) != APR_SUCCESS) { - return rv; + if (attr->cmdtype == APR_PROGRAM || attr->cmdtype == APR_PROGRAM_ENV) { + char *fullpath = NULL; + if ((rv = apr_filepath_merge(&fullpath, attr->currdir, progname, + APR_FILEPATH_NATIVE, pool)) != APR_SUCCESS) { + return rv; + } + progname = fullpath; + } + else { + /* Do not fail if the path isn't parseable for APR_PROGRAM_PATH + * or APR_SHELLCMD. We only invoke apr_filepath_merge (with no + * left hand side expression) in order to correct the path slash + * delimiters. But the filename doesn't need to be in the CWD, + * nor does it need to be a filename at all (it could be a + * built-in shell command.) + */ + char *fullpath = NULL; + if ((rv = apr_filepath_merge(&fullpath, "", progname, + APR_FILEPATH_NATIVE, pool)) == APR_SUCCESS) { + progname = fullpath; + } } - progname = cmdline; if (has_space(progname)) { argv0 = apr_pstrcat(pool, "\"", progname, "\"", NULL); @@ -394,8 +409,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } } - /* ### how to handle APR_PROGRAM_ENV and APR_PROGRAM_PATH? */ - if (attr->cmdtype == APR_SHELLCMD) { char *shellcmd = getenv("COMSPEC"); if (!shellcmd) { @@ -475,13 +488,22 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } } else { - /* A simple command we are directly invoking + /* A simple command we are directly invoking. Do not pass + * the first arg to CreateProc() for APR_PROGRAM_PATH + * invocation, since it would need to be a literal and + * complete file path. That is; "c:\bin\aprtest.exe" + * would succeed, but "c:\bin\aprtest" or "aprtest.exe" + * can fail. */ cmdline = apr_pstrcat(pool, argv0, cmdline, NULL); + + if (attr->cmdtype == APR_PROGRAM_PATH) { + progname = NULL; + } } } - if (!env) + if (!env || attr->cmdtype == APR_PROGRAM_ENV) pEnvBlock = NULL; else { apr_size_t iEnvBlockLen; @@ -549,24 +571,34 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, IF_WIN_OS_IS_UNICODE { STARTUPINFOW si; - apr_size_t nprg = strlen(progname) + 1; - apr_size_t nwprg = nprg + 6; - apr_wchar_t *wprg = apr_palloc(pool, nwprg * sizeof(wprg[0])); - apr_size_t ncmd = strlen(cmdline) + 1, nwcmd = ncmd; - apr_wchar_t *wcmd = apr_palloc(pool, nwcmd * sizeof(wcmd[0])); - apr_size_t ncwd = 0, nwcwd = 0; + apr_wchar_t *wprg = NULL; + apr_wchar_t *wcmd = NULL; apr_wchar_t *wcwd = NULL; - if (((rv = apr_conv_utf8_to_ucs2(progname, &nprg, wprg, &nwprg)) - != APR_SUCCESS) - || ((rv = apr_conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd)) - != APR_SUCCESS)) { - return rv; + if (progname) { + apr_size_t nprg = strlen(progname) + 1; + apr_size_t nwprg = nprg + 6; + wprg = apr_palloc(pool, nwprg * sizeof(wprg[0])); + if ((rv = apr_conv_utf8_to_ucs2(progname, &nprg, wprg, &nwprg)) + != APR_SUCCESS) { + return rv; + } + } + + if (cmdline) { + apr_size_t ncmd = strlen(cmdline) + 1; + apr_size_t nwcmd = ncmd; + wcmd = apr_palloc(pool, nwcmd * sizeof(wcmd[0])); + if ((rv = apr_conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd)) + != APR_SUCCESS) { + return rv; + } } if (attr->currdir) { - ncwd = nwcwd = strlen(attr->currdir) + 1; + apr_size_t ncwd = strlen(attr->currdir) + 1; + apr_size_t nwcwd = ncwd; wcwd = apr_palloc(pool, ncwd * sizeof(wcwd[0])); if ((rv = apr_conv_utf8_to_ucs2(attr->currdir, &ncwd, wcwd, &nwcwd)) From 517634210c3ae829f78f7fd59388c88938a73181 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 14 Apr 2002 08:04:17 +0000 Subject: [PATCH 3253/7878] OS/2: Set up local_addr of accepted socket git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63262 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 96eb1cef095..676291c618a 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -196,9 +196,16 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, apr if ((*new)->socketdes < 0) { return APR_OS2_STATUS(sock_errno()); } - /* XXX fix up any pointers which are no longer valid (or just call - * apr_sockaddr_vars_set() to do it */ + + *(*new)->local_addr = *sock->local_addr; + (*new)->local_addr->pool = connection_context; (*new)->remote_addr->port = ntohs((*new)->remote_addr->sa.sin.sin_port); + + /* fix up any pointers which are no longer valid */ + if (sock->local_addr->sa.sin.sin_family == AF_INET) { + (*new)->local_addr->ipaddr_ptr = &(*new)->local_addr->sa.sin.sin_addr; + } + apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; From 7d9e01b91e1c6fbe3f6d5e358a9e76100c5092b9 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 14 Apr 2002 08:33:52 +0000 Subject: [PATCH 3254/7878] OS/2: Fix apr_os_put_sock() to set local address as unknown & timeout to -1. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63263 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 676291c618a..c8109945aac 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -288,7 +288,10 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *th if ((*sock) == NULL) { alloc_socket(sock, cont); set_socket_vars(*sock, AF_INET, SOCK_STREAM); + (*sock)->timeout = -1; } + + (*sock)->local_port_unknown = (*sock)->local_interface_unknown = 1; (*sock)->socketdes = *thesock; return APR_SUCCESS; } From 96765695124c7c789c9a0fe7cf29a94c3fa2ef1d Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 15 Apr 2002 00:01:09 +0000 Subject: [PATCH 3255/7878] Per rename_pendings, rename apr_explode_time to apr_time_exp_tz. (Justin made a few whitespace corrections.) Submitted by: Thom May Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63264 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_time.h | 6 +++--- renames_pending | 2 -- test/testtime.c | 4 ++-- time/unix/time.c | 8 ++++---- time/win32/time.c | 4 ++-- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index 3c88519e1ca..1547deaf99c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Rename apr_explode_time to apr_time_exp_tz. + [Thom May ] + *) Set precompiler for Solaris atomics when using GNU binutils. PR 7876. [solomon@conceptshopping.com (Marvin Solomon)] diff --git a/include/apr_time.h b/include/apr_time.h index 213175231e4..8b60133ea4a 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -149,9 +149,9 @@ APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, * @param offs the number of seconds offset to apply * @param zone the zone description */ -APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, - apr_time_t input, - apr_int32_t offs); +APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, + apr_time_t input, + apr_int32_t offs); /** * convert a time to its human readable components in GMT timezone diff --git a/renames_pending b/renames_pending index 2615e860222..d7e3a0fae6e 100644 --- a/renames_pending +++ b/renames_pending @@ -1,7 +1,5 @@ Symbol renames for APR -apr_time_exp_tz from apr_explode_time - apr_group_name_get from apr_get_groupname apr_user_homedir_get from apr_get_home_directory diff --git a/test/testtime.c b/test/testtime.c index 1a96449e986..39fcc5d6162 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -155,8 +155,8 @@ int main(void) apr_strftime(str, &sz, STR_SIZE, "%T", &xt)) printf (" ( %s )\n", str); - STD_TEST_NEQ(" apr_explode_time (GMT -5 hours)", - apr_explode_time(&xt2, now, hr_off)) + STD_TEST_NEQ(" apr_time_exp_tz (GMT -5 hours)", + apr_time_exp_tz(&xt2, now, hr_off)) STD_TEST_NEQ(" apr_strftime (offset) (HH:MM:SS)", apr_strftime(str2, &sz, STR_SIZE, "%T", &xt2)) diff --git a/time/unix/time.c b/time/unix/time.c index 70a24df71b4..9415b98a4b6 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -146,8 +146,8 @@ static void explode_time(apr_time_exp_t *xt, apr_time_t t, xt->tm_gmtoff = get_offset(&tm); } -APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, - apr_time_t input, apr_int32_t offs) +APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, + apr_time_t input, apr_int32_t offs) { explode_time(result, input, offs, 0); result->tm_gmtoff = offs; @@ -157,7 +157,7 @@ APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, apr_time_t input) { - return apr_explode_time(result, input, 0); + return apr_time_exp_tz(result, input, 0); } APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, @@ -165,7 +165,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, { #if defined(__EMX__) /* EMX gcc (OS/2) has a timezone global we can use */ - return apr_explode_time(result, input, -timezone); + return apr_time_exp_tz(result, input, -timezone); #else explode_time(result, input, 0, 1); return APR_SUCCESS; diff --git a/time/win32/time.c b/time/win32/time.c index 8a777a176e1..e188b8a4adf 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -158,8 +158,8 @@ APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, - apr_time_t input, apr_int32_t offs) +APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, + apr_time_t input, apr_int32_t offs) { FILETIME ft; SYSTEMTIME st; From fa03dadbcfc94767c39098c8153e2d9ca8844fee Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Mon, 15 Apr 2002 05:55:24 +0000 Subject: [PATCH 3256/7878] Added a test to determine whether the O_NONBLOCK socket flag is inherited across an accept(2). (Solaris 8, at least, has this property.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63265 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 113 +++++++++++++++++++++++++++++++++++++++++++ configure.in | 2 + include/apr.h.in | 4 ++ 3 files changed, 119 insertions(+) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 635f127fb5e..2e506a6a321 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -395,6 +395,119 @@ else fi ]) +dnl +dnl see if O_NONBLOCK setting is inherited from listening sockets +dnl +AC_DEFUN(APR_CHECK_O_NONBLOCK_INHERITED,[ + AC_CACHE_CHECK(if O_NONBLOCK setting is inherited from listening sockets, ac_cv_o_nonblock_inherited,[ + AC_TRY_RUN( [ +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_TCP_H +#include +#endif +#ifndef HAVE_SOCKLEN_T +typedef int socklen_t; +#endif +#ifdef HAVE_FCNTL_H +#include +#endif +int main(void) { + int listen_s, connected_s, client_s; + int listen_port, rc; + struct sockaddr_in sa; + socklen_t sa_len; + + listen_s = socket(AF_INET, SOCK_STREAM, 0); + if (listen_s < 0) { + perror("socket"); + exit(1); + } + memset(&sa, 0, sizeof sa); + sa.sin_family = AF_INET; +#ifdef BEOS + sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); +#endif + /* leave port 0 to get ephemeral */ + rc = bind(listen_s, (struct sockaddr *)&sa, sizeof sa); + if (rc < 0) { + perror("bind for ephemeral port"); + exit(1); + } + /* find ephemeral port */ + sa_len = sizeof(sa); + rc = getsockname(listen_s, (struct sockaddr *)&sa, &sa_len); + if (rc < 0) { + perror("getsockname"); + exit(1); + } + listen_port = sa.sin_port; + rc = listen(listen_s, 5); + if (rc < 0) { + perror("listen"); + exit(1); + } + rc = fcntl(listen_s, F_SETFL, O_NONBLOCK); + if (rc < 0) { + perror("fcntl(F_SETFL)"); + exit(1); + } + client_s = socket(AF_INET, SOCK_STREAM, 0); + if (client_s < 0) { + perror("socket"); + exit(1); + } + memset(&sa, 0, sizeof sa); + sa.sin_family = AF_INET; + sa.sin_port = listen_port; +#ifdef BEOS + sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); +#endif + /* leave sin_addr all zeros to use loopback */ + rc = connect(client_s, (struct sockaddr *)&sa, sizeof sa); + if (rc < 0) { + perror("connect"); + exit(1); + } + sa_len = sizeof sa; + connected_s = accept(listen_s, (struct sockaddr *)&sa, &sa_len); + if (connected_s < 0) { + perror("accept"); + exit(1); + } + rc = fcntl(connected_s, F_GETFL, 0); + if (rc < 0) { + perror("fcntl(F_GETFL)"); + exit(1); + } + if (!(rc & O_NONBLOCK)) { + fprintf(stderr, "O_NONBLOCK is not set in the child.\n"); + exit(1); + } + return 0; +} +],[ + ac_cv_o_nonblock_inherited="yes" +],[ + ac_cv_o_nonblock_inherited="no" +],[ + ac_cv_o_nonblock_inherited="yes" +])]) +if test "$ac_cv_o_nonblock_inherited" = "yes"; then + o_nonblock_inherited=1 +else + o_nonblock_inherited=0 +fi +]) + dnl dnl check for socklen_t, fall back to unsigned int dnl diff --git a/configure.in b/configure.in index 2f584d1b0d7..b2f308befcb 100644 --- a/configure.in +++ b/configure.in @@ -809,6 +809,7 @@ AC_CHECK_FUNCS(mkstemp) AC_SUBST(fork) AC_SUBST(have_inet_addr) AC_SUBST(tcp_nodelay_inherited) +AC_SUBST(o_nonblock_inherited) AC_SUBST(have_inet_network) AC_SUBST(have_sigaction) AC_SUBST(have_setrlimit) @@ -1532,6 +1533,7 @@ if test "$ac_cv_func_gethostbyname_r" = "yes"; then fi APR_CHECK_TCP_NODELAY_INHERITED +APR_CHECK_O_NONBLOCK_INHERITED dnl # Look for a way of corking TCP... APR_CHECK_DEFINE(TCP_CORK, netinet/tcp.h) diff --git a/include/apr.h.in b/include/apr.h.in index 2c8d87bce20..f3367f95396 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -172,6 +172,10 @@ */ #define APR_TCP_NODELAY_INHERITED @tcp_nodelay_inherited@ +/* Is the O_NONBLOCK flag inherited from listening sockets? +*/ +#define APR_O_NONBLOCK_INHERITED @o_nonblock_inherited@ + /* Typedefs that APR needs. */ typedef unsigned char apr_byte_t; From 10f06aeb3bd07ddf9fca5200a4dce435a3d26365 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Mon, 15 Apr 2002 06:09:10 +0000 Subject: [PATCH 3257/7878] On platforms where the nonblocking flag on a listener socket is inherited upon accept, set the APR_SO_NONBLOCK flag in the newly accepted connection. (The motivation for this, by the way, is Solaris 8, where putting a socket in nonblocking mode is expensive (fcntl(F_SETFL) on a socket does 4 syscalls internally) but the nonblocking flag is inherited across accept.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63266 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 88dcd4a79d4..aa3cccce066 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -222,6 +222,11 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn apr_set_option(&(*new)->netmask, APR_TCP_NODELAY, 1); } #endif /* TCP_NODELAY_INHERITED */ +#if APR_O_NONBLOCK_INHERITED + if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) == 1) { + apr_set_option(&(*new)->netmask, APR_SO_NONBLOCK, 1); + } +#endif /* APR_O_NONBLOCK_INHERITED */ if (sock->local_interface_unknown || !memcmp(sock->local_addr->ipaddr_ptr, From f632874978263d9ed63e29b957650d545462cd37 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 15 Apr 2002 14:05:07 +0000 Subject: [PATCH 3258/7878] Fix doc. The child cleanup is called when the child is being taken down git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63267 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 220407d2061..5aae8030a3c 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -517,8 +517,8 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, * @param data The data to pass to the cleanup function. * @param plain_cleanup The function to call when the pool is cleared * or destroyed - * @param child_cleanup The function to call when a child process is created - - * this function is called in the child, obviously! + * @param child_cleanup The function to call when a child process is being + * shutdown - this function is called in the child, obviously! */ APR_DECLARE(void) apr_pool_cleanup_register( apr_pool_t *p, From 4167a855f89e3e25292c99f48926395dd7dc3703 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 15 Apr 2002 22:01:39 +0000 Subject: [PATCH 3259/7878] Get us installing with autoconf 2.53 when builddir == srcdir. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63268 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 84bce00a922..9a42039a956 100644 --- a/Makefile.in +++ b/Makefile.in @@ -62,7 +62,10 @@ install: $(TARGET_LIB) $(top_srcdir)/build/mkdir.sh $(includedir); \ fi; cp $(top_srcdir)/include/*.h $(includedir); - cp $(top_blddir)/include/*.h $(includedir); + + if test -n "$(top_blddir)"; then \ + cp $(top_blddir)/include/*.h $(includedir); \ + fi; if [ ! -d $(libdir) ]; then \ $(top_srcdir)/build/mkdir.sh $(libdir); \ fi; From 85f6cd617d9338ffdc6b6e5bd864907071f3c0bf Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 16 Apr 2002 08:49:03 +0000 Subject: [PATCH 3260/7878] Merge in latest GNU config.guess and config.sub files. Synchronize all config.guess/config.sub files to be identical. Previously, we had three different versions of the guess files - now they are the same. I attempted to merge in ASF changes that were marked and still needed. Please verify that these work on your platform. (Particular attention is required for the IBM platforms.) Part of PR 7818 stems from the fact that the bundled expat did not have an included config.guess/config.sub. Therefore, it would take the config.guess from the system. Icarus's autoconf/libtool is very old (2.13/1.3.5). The machine that was used to roll 2.0.32 had a recent autoconf/libtool which explains the behavior that Sander saw in the PR. Therefore, we now explicitly provide a config.guess/.sub for the bundled expat so that all of the versions are in sync. This should minimize configuration problems. pcre was using a config.guess that was imported when Brian made the 3.9 import. It did not have the Apache modifications, but seems to have had the Darwin changes. Go figure. Sync it up as well. PR: 7818 Obtained from: GNU FSF - ftp.gnu.org/gnu/config git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63269 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 858 ++++++++++++++++++++++++++------------------- build/config.sub | 459 ++++++++++++++++-------- 2 files changed, 814 insertions(+), 503 deletions(-) diff --git a/build/config.guess b/build/config.guess index f8ca267fa70..6cfac28c854 100755 --- a/build/config.guess +++ b/build/config.guess @@ -1,8 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 -# Free Software Foundation, Inc. -# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-03-20' + # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -27,81 +29,148 @@ # These changes are hereby donated to the public domain. ##################################################################### -# Written by Per Bothner . -# Please send patches to . +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you -# don't specify an explicit system type (host/target name). -# -# Only a few systems have been added to this list; please add others -# (but try to keep the structure clean). -# +# don't specify an explicit build system type. -# Use $HOST_CC if defined. $CC may point to a cross-compiler -if test x"$CC_FOR_BUILD" = x; then - if test x"$HOST_CC" != x; then - CC_FOR_BUILD="$HOST_CC" - else - if test x"$CC" != x; then - CC_FOR_BUILD="$CC" - else - CC_FOR_BUILD=cc - fi - fi +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 fi +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c ; + for c in cc gcc c89 c99 ; do + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; + if test $? = 0 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $dummy.c $dummy.o $dummy.rel ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac' + # This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) +# (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 - # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) - # Netbsd (nbsd) targets should (where applicable) match one or + # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. - # Determine the machine/vendor (is the vendor relevant). - case "${UNAME_MACHINE}" in - amiga) machine=m68k-cbm ;; - arm32) machine=arm-unknown ;; - atari*) machine=m68k-atari ;; - sun3*) machine=m68k-sun ;; - mac68k) machine=m68k-apple ;; - macppc) machine=powerpc-apple ;; - hp3[0-9][05]) machine=m68k-hp ;; - ibmrt|romp-ibm) machine=romp-ibm ;; - *) machine=${UNAME_MACHINE}-unknown ;; + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; esac - # The Operating System including object format. - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: @@ -109,6 +178,45 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -142,6 +250,7 @@ main: jsr \$26,exit .end main EOF + eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in @@ -163,6 +272,9 @@ EOF 2-307) UNAME_MACHINE="alphaev67" ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; esac fi rm -f $dummy.s $dummy @@ -178,54 +290,39 @@ EOF echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-cbm-sysv4 + echo m68k-unknown-sysv4 exit 0;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; - arc64:OpenBSD:*:*) - echo mips64el-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hkmips:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; ######################### # Apache changes # # *:OS/390:*:*) -# echo i370-ibm-openedition -# exit 0 ;; +# echo i370-ibm-openedition +# exit 0 ;; *:OS390:*:* | *:OS/390:*:*) - echo s390-ibm-os390 - exit 0 ;; + echo s390-ibm-os390 + exit 0 ;; *:OS400:*:* | *:OS/400:*:*) - echo as400-ibm-os400 - exit 0 ;; + echo as400-ibm-os400 + exit 0 ;; *:OS/2:*:*) - echo "i386-pc-os2_emx" - exit 0;; + echo "i386-pc-os2_emx" + exit 0;; # # end Apache changes ######################### + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; - SR2?01:HI-UX/MPP:*:*) + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) @@ -267,7 +364,7 @@ EOF echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) - UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) @@ -281,9 +378,6 @@ EOF aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; - atari*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -310,18 +404,6 @@ EOF *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; - sun3*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; @@ -338,6 +420,7 @@ EOF echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ @@ -361,10 +444,13 @@ EOF EOF $CC_FOR_BUILD $dummy.c -o $dummy \ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm $dummy.c $dummy && exit 0 + && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; @@ -412,11 +498,20 @@ EOF ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i?86:AIX:*:*) + i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include @@ -428,7 +523,7 @@ EOF exit(0); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then @@ -437,10 +532,9 @@ EOF echo rs6000-ibm-aix3.2 fi exit 0 ;; - # next stanza updated from autoconf 2.52 to get support for 5L *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` - if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -474,11 +568,28 @@ EOF echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - sed 's/^ //' << EOF >$dummy.c + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include @@ -511,13 +622,19 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` - rm -f $dummy.c $dummy + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy + fi ;; esac - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; 3050*:HI-UX:*:*) + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int @@ -543,7 +660,7 @@ EOF exit (0); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; @@ -553,7 +670,7 @@ EOF 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; - *9??*:MPE/iX:*:*) + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) @@ -562,7 +679,7 @@ EOF hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; - i?86:OSF1:*:*) + i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else @@ -572,9 +689,6 @@ EOF parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; - hppa*:OpenBSD:*:*) - echo hppa-unknown-openbsd - exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; @@ -593,41 +707,34 @@ EOF C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; - CRAY*X-MP:*:*:*) - echo xmp-cray-unicos - exit 0 ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; - CRAY*T3E:*:*:*) + CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; - CRAY-2:*:*:*) - echo cray2-cray-unicos - exit 0 ;; - F300:UNIX_System_V:*:*) + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; - F301:UNIX_System_V:*:*) - echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) @@ -639,15 +746,18 @@ EOF *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -666,219 +776,142 @@ EOF *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; - *:Linux:*:*) - + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. - ld_help_string=`cd /; ld --help 2>&1` - ld_supported_emulations=`echo $ld_help_string \ - | sed -ne '/supported emulations:/!d + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g - s/.*supported emulations: *// + s/.*supported targets: *// s/ .*// p'` - case "$ld_supported_emulations" in - *ia64) - echo "${UNAME_MACHINE}-unknown-linux" - exit 0 + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; - i?86linux) + a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 - ;; - elf_i?86) - echo "${UNAME_MACHINE}-pc-linux" - exit 0 - ;; - i?86coff) + exit 0 ;; + coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 - ;; - sparclinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - armlinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - elf32arm*) - echo "${UNAME_MACHINE}-unknown-linux-gnuoldld" - exit 0 - ;; - armelf_linux*) - echo "${UNAME_MACHINE}-unknown-linux-gnu" - exit 0 - ;; - m68klinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - elf32ppc | elf32ppclinux) - # Determine Lib Version - cat >$dummy.c < -#if defined(__GLIBC__) -extern char __libc_version[]; -extern char __libc_release[]; -#endif -main(argc, argv) - int argc; - char *argv[]; -{ -#if defined(__GLIBC__) - printf("%s %s\n", __libc_version, __libc_release); -#else - printf("unkown\n"); -#endif - return 0; -} -EOF - LIBC="" - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy | grep 1\.99 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.c $dummy - echo powerpc-unknown-linux-gnu${LIBC} - exit 0 - ;; + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; esac - - if test "${UNAME_MACHINE}" = "alpha" ; then - cat <$dummy.s - .data - \$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main - main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - LIBC="" - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - esac - - objdump --private-headers $dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 - elif test "${UNAME_MACHINE}" = "mips" ; then - cat >$dummy.c < /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __MIPSEB__ - printf ("%s-unknown-linux-gnu\n", argv[1]); -#endif -#ifdef __MIPSEL__ - printf ("%sel-unknown-linux-gnu\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - elif test "${UNAME_MACHINE}" = "s390"; then - echo s390-ibm-linux && exit 0 - else - # Either a pre-BFD a.out linker (linux-gnuoldld) - # or one that does not give us useful --help. - # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. - # If ld does not provide *any* "supported emulations:" - # that means it is gnuoldld. - echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" - test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 - - case "${UNAME_MACHINE}" in - i?86) - VENDOR=pc; - ;; - *) - VENDOR=unknown; - ;; - esac - # Determine whether the default compiler is a.out or elf - cat >$dummy.c < -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __ELF__ -# ifdef __GLIBC__ -# if __GLIBC__ >= 2 - printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -#else - printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); -#endif - return 0; -} + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - fi ;; -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions -# are messed up and put the nodename in both sysname and nodename. - i?86:DYNIX/ptx:4*:*) + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; - i?86:UNIX_SV:4.2MP:2.*) + i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, @@ -886,7 +919,7 @@ EOF # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; - i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} @@ -894,16 +927,15 @@ EOF echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; - i?86:*:5:7*) - # Fixed at (any) Pentium or better - UNAME_MACHINE=i586 - if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then - echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} - fi + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; - i?86:*:3.2:*) + i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:*) + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; - rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; @@ -992,8 +1027,8 @@ EOF echo ns32k-sni-sysv fi exit 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) @@ -1005,10 +1040,14 @@ EOF # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; - news*:NEWS-OS:*:6*) + news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) @@ -1043,28 +1082,74 @@ EOF echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) - if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo `uname -p`-${UNAME_MACHINE}-nto-qnx + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-W:NONSTOP_KERNEL:*:*) + NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 +eval $set_cc_for_build cat >$dummy.c < @@ -1151,11 +1236,24 @@ main () #endif #if defined (vax) -#if !defined (ultrix) - printf ("vax-dec-bsd\n"); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif #endif #if defined (alliant) && defined (i860) @@ -1166,7 +1264,7 @@ main () } EOF -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy # Apollos put the system type in the environment. @@ -1199,6 +1297,48 @@ then esac fi -#echo '(Unable to guess system type)' 1>&2 +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/build/config.sub b/build/config.sub index c2a0aaf1a72..043d45b3982 100755 --- a/build/config.sub +++ b/build/config.sub @@ -1,8 +1,10 @@ #! /bin/sh -# Configuration validation subroutine script, version 1.1. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 -# Free Software Foundation, Inc. -# +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-03-07' + # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. @@ -32,8 +34,8 @@ # These changes are hereby donated to the public domain. ##################################################################### -# Written by Per Bothner . -# Please send patches to . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -55,30 +57,73 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. -if [ x$1 = x ] -then - echo Configuration name missing. 1>&2 - echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 - echo "or $0 ALIAS" 1>&2 - echo where ALIAS is a recognized configuration type. 1>&2 - exit 1 -fi +me=`echo "$0" | sed -e 's,.*/,,'` -# First pass through any local machine types. -case $1 in - *local*) - echo $1 - exit 0 - ;; - *) - ;; +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu*) + nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -122,7 +167,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple) + -apple | -axis) os= basic_machine=$1 ;; @@ -136,6 +181,14 @@ case $os in os=-vxworks basic_machine=$1 ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; -hiux*) os=-hiuxwe2 ;; @@ -194,30 +247,50 @@ esac case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ - | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ - | 580 | i960 | h8300 \ - | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \ - | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | hppa64 \ - | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ - | alphaev6[78] \ - | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ - | mips64orion | mips64orionel | mipstx39 | mipstx39el \ - | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ - | mips64vr5000 | miprs64vr5000el | mcore \ - | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v | fr30 | avr) + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dsp16xx \ + | fr30 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el | mips64vr4300 \ + | mips64vr4300el | mips64vr5000 | mips64vr5000el \ + | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ + | mipsisa32 | mipsisa64 \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. basic_machine=$basic_machine-unknown + os=-none ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. - i[34567]86) + i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -226,28 +299,45 @@ case $basic_machine in exit 1 ;; # Recognize the basic CPU types with company name. - # FIXME: clean up the formatting here. - vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ - | xmp-* | ymp-* \ - | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ - | hppa2.0n-* | hppa64-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ - | alphaev6[78]-* \ - | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ - | clipper-* | orion-* \ - | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ - | mipstx39-* | mipstx39el-* | mcore-* \ - | f301-* | armv*-* | s390-* | as400-* | sv1-* | t3e-* \ - | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ - | bs2000-*) + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ + | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ + | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -284,14 +374,14 @@ case $basic_machine in os=-sysv ;; amiga | amiga-*) - basic_machine=m68k-cbm + basic_machine=m68k-unknown ;; amigaos | amigados) - basic_machine=m68k-cbm + basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) - basic_machine=m68k-cbm + basic_machine=m68k-unknown os=-sysv4 ;; apollo68) @@ -310,6 +400,10 @@ case $basic_machine in basic_machine=ns32k-sequent os=-dynix ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -330,27 +424,30 @@ case $basic_machine in basic_machine=c38-convex os=-bsd ;; - cray | ymp) - basic_machine=ymp-cray - os=-unicos - ;; - cray2) - basic_machine=cray2-cray - os=-unicos - ;; - [ctj]90-cray) - basic_machine=c90-cray + cray | j90) + basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola @@ -392,6 +489,10 @@ case $basic_machine in basic_machine=tron-gmicro os=-sysv ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 @@ -465,23 +566,21 @@ case $basic_machine in ;; i370-ibm* | ibm*) basic_machine=i370-ibm -# next line added by Apache (not sure why) - os=-mvs ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[34567]86v32) + i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; - i[34567]86v4*) + i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; - i[34567]86v) + i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; - i[34567]86sol2) + i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; @@ -493,14 +592,6 @@ case $basic_machine in basic_machine=i386-unknown os=-vsta ;; - i386-go32 | go32) - basic_machine=i386-unknown - os=-go32 - ;; - i386-mingw32 | mingw32) - basic_machine=i386-unknown - os=-mingw32 - ;; iris | iris4d) basic_machine=mips-sgi case $os in @@ -526,6 +617,10 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; miniframe) basic_machine=m68000-convergent ;; @@ -533,14 +628,6 @@ case $basic_machine in basic_machine=m68k-atari os=-mint ;; - mipsel*-linux*) - basic_machine=mipsel-unknown - os=-linux-gnu - ;; - mips*-linux*) - basic_machine=mips-unknown - os=-linux-gnu - ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; @@ -555,8 +642,12 @@ case $basic_machine in basic_machine=m68k-rom68k os=-coff ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; msdos) - basic_machine=i386-unknown + basic_machine=i386-pc os=-msdos ;; mvs) @@ -620,6 +711,10 @@ case $basic_machine in basic_machine=i960-intel os=-mon960 ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; np1) basic_machine=np1-gould ;; @@ -630,6 +725,10 @@ case $basic_machine in basic_machine=hppa1.1-oki os=-proelf ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose @@ -655,28 +754,28 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5 | k5 | k6 | nexen) + pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; - pentiumpro | p6 | 6x86) + pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) - basic_machine=i786-pc + basic_machine=i686-pc ;; - pentium-* | p5-* | k5-* | k6-* | nexen-*) + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumpro-* | p6-* | 6x86-*) + pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; - power) basic_machine=rs6000-ibm + power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; @@ -688,9 +787,23 @@ case $basic_machine in ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; ps2) basic_machine=i386-ibm ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -701,6 +814,12 @@ case $basic_machine in rtpc | rtpc-*) basic_machine=romp-ibm ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; sa29200) basic_machine=a29k-amd os=-udi @@ -708,10 +827,7 @@ case $basic_machine in ######################## # changes for Apache # - s390*) - basic_machine=s390-ibm - ;; - as400*) + as400*) basic_machine=as400-ibm ;; # @@ -724,7 +840,7 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; - sparclite-wrs) + sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; @@ -782,7 +898,7 @@ case $basic_machine in sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; - sv1) + sv1) basic_machine=sv1-cray os=-unicos ;; @@ -790,16 +906,32 @@ case $basic_machine in basic_machine=i386-sequent os=-dynix ;; + t3d) + basic_machine=alpha-cray + os=-unicos + ;; t3e) - basic_machine=t3e-cray + basic_machine=alphaev5-cray os=-unicos ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; tower | tower-32) basic_machine=m68k-ncr ;; @@ -846,13 +978,17 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; - xmp) - basic_machine=xmp-cray - os=-unicos + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt ;; xps | xps100) basic_machine=xps100-honeywell ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim @@ -873,13 +1009,6 @@ case $basic_machine in op60c) basic_machine=hppa1.1-oki ;; - mips) - if [ x$os = x-linux-gnu ]; then - basic_machine=mips-unknown - else - basic_machine=mips-mips - fi - ;; romp) basic_machine=romp-ibm ;; @@ -889,13 +1018,23 @@ case $basic_machine in vax) basic_machine=vax-dec ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; - sparc | sparcv9) + sh3 | sh4 | sh3eb | sh4eb) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) @@ -917,6 +1056,9 @@ case $basic_machine in basic_machine=c4x-none os=-coff ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 @@ -962,7 +1104,7 @@ case $os in # changes for Apache # -os2_emx | -tpf* | -os390* | -vmcms* | -os400* ) - ;; + ;; # # end Apache changes ######################## @@ -981,15 +1123,19 @@ case $os in | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit*) + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in - x86-* | i[34567]86-*) + x86-* | i*86-*) ;; *) os=-nto$os @@ -1036,16 +1182,22 @@ case $os in -acis*) os=-aos ;; + -atheos*) + os=-atheos + ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; + -nova*) + os=-rtmk-nova + ;; -ns2 ) os=-nextstep2 ;; - -nsk) + -nsk*) os=-nsk ;; # Preserve the version number of sinix5. @@ -1082,7 +1234,7 @@ case $os in -xenix) os=-xenix ;; - -*mint | -*MiNT) + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -none) @@ -1116,6 +1268,10 @@ case $basic_machine in arm*-semi) os=-aout ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; pdp11-*) os=-none ;; @@ -1143,6 +1299,9 @@ case $basic_machine in mips*-*) os=-elf ;; + or32-*) + os=-coff + ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; @@ -1161,23 +1320,24 @@ case $basic_machine in # *-ibm) case $basic_machine in - s390*) - os=-os390; - ;; - i370*) - os=-mvs; - ;; - as400*) - os=-os400; - ;; - *) - os=-aix - ;; + s390*) + os=-os390; + ;; + i370*) + os=-mvs; + ;; + as400*) + os=-os400; + ;; + *) + os=-aix + ;; esac - ;; + ;; # # end Apache changes ######################## + *-wec) os=-proelf ;; @@ -1247,7 +1407,7 @@ case $basic_machine in *-masscomp) os=-rtu ;; - f301-fujitsu) + f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) @@ -1325,12 +1485,23 @@ case $basic_machine in -mpw* | -macos*) vendor=apple ;; - -*mint | -*MiNT) + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; + -vos*) + vendor=stratus + ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: From 429e9a731fc0a5c80764d24767867f74b86d8ff1 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Tue, 16 Apr 2002 14:32:03 +0000 Subject: [PATCH 3261/7878] On Windows, ERROR_PATH_NOT_FOUND is an ENOENT, not an ENOTDIR -- same as OS/2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63270 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index d02b0da5579..6af045267f5 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -923,10 +923,10 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + WSAENAMETOOLONG) #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \ + || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \ || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES) #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR \ - || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_NETPATH \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_NET_NAME \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_PATHNAME \ From 5e05a977763ad943c70ac1c524c61d944aa6fd55 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 16 Apr 2002 15:40:38 +0000 Subject: [PATCH 3262/7878] Match the declaration in the .c file and the doc, which is "template". Submitted by: Stas Bekman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63271 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index e78c7a32229..4b02d85881c 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -680,7 +680,7 @@ APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); * array. * */ -APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *tmplt, +APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_int32_t flags, apr_pool_t *p); #ifdef __cplusplus From 20f68b3b54f2163319b0e683af23a1df324469e6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 16 Apr 2002 20:25:57 +0000 Subject: [PATCH 3263/7878] standardize some apr_foo_close() functions (call apr_pool_cleanup_run()) a couple of these functions didn't kill the cleanup if it failed; we might as well; the error isn't going to magically disappear next time we try git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63272 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/xlate.c | 8 +------- mmap/unix/mmap.c | 8 +------- network_io/unix/sockets.c | 3 +-- shmem/unix/shm.c | 4 +--- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index c403838a70c..7d1a61cb92c 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -357,13 +357,7 @@ apr_int32_t apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar) apr_status_t apr_xlate_close(apr_xlate_t *convset) { - apr_status_t status; - - if ((status = apr_xlate_cleanup(convset)) == APR_SUCCESS) { - apr_pool_cleanup_kill(convset->pool, convset, apr_xlate_cleanup); - } - - return status; + return apr_pool_cleanup_run(convset->pool, convset, apr_xlate_cleanup); } #endif /* APR_HAS_XLATE */ diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 3f081308e74..4a54b860eb4 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -199,13 +199,7 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm) { - apr_status_t rv; - - if ((rv = mmap_cleanup(mm)) == APR_SUCCESS) { - apr_pool_cleanup_kill(mm->cntxt, mm, mmap_cleanup); - return APR_SUCCESS; - } - return rv; + return apr_pool_cleanup_run(mm->cntxt, mm, mmap_cleanup); } #endif diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index aa3cccce066..38426be8887 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -149,8 +149,7 @@ apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) apr_status_t apr_socket_close(apr_socket_t *thesocket) { - apr_pool_cleanup_kill(thesocket->cntxt, thesocket, socket_cleanup); - return socket_cleanup(thesocket); + return apr_pool_cleanup_run(thesocket->cntxt, thesocket, socket_cleanup); } apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 6c41dd59a20..a190ef5cace 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -418,9 +418,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) { - apr_status_t rv = shm_cleanup_owner(m); - apr_pool_cleanup_kill(m->pool, m, shm_cleanup_owner); - return rv; + return apr_pool_cleanup_run(m->pool, m, shm_cleanup_owner); } static apr_status_t shm_cleanup_attach(void *m_) From a9b77e884e3252f294a4564404f4b89b209c3314 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Wed, 17 Apr 2002 20:22:16 +0000 Subject: [PATCH 3264/7878] Reverting the 1.88 commit. We have to think about this a bit more. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63273 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 6af045267f5..d02b0da5579 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -923,10 +923,10 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + WSAENAMETOOLONG) #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \ - || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \ || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES) #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR \ + || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_NETPATH \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_NET_NAME \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_PATHNAME \ From e22329a8777d9bd14edfc4f7d406cfe6d34a8760 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 18 Apr 2002 09:01:32 +0000 Subject: [PATCH 3265/7878] Allow VPATH builds to succeed when configured from an empty directory. (Justin removed some unneeded changes in Makefile.in.) Submitted by: Thom May Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63274 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 5ebf77d7906..7ec02223aa5 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -58,9 +58,9 @@ AC_DEFUN(APR_SUBDIR_CONFIG, [ echo "configuring package in $1 now" ac_popdir=`pwd` - ac_abs_srcdir=`(cd $srcdir/$1 && pwd)` apr_config_subdirs="$1" - test -d $1 || $MKDIR $1 + test -d $1 || $mkdir_p $1 + ac_abs_srcdir=`(cd $srcdir/$1 && pwd)` cd $1 changequote(, )dnl From 0edbfca19e1e3c8a9d087c3fc7a14c51b83225aa Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 18 Apr 2002 09:14:53 +0000 Subject: [PATCH 3266/7878] Fix a bad sed script - previously would leave the trailing slash on which is annoying. Match the fix in httpd-2.0. Why can't we use dirname? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63275 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index b2f308befcb..4a494172772 100644 --- a/configure.in +++ b/configure.in @@ -1717,7 +1717,7 @@ changequote({,}) if test -n "$USE_VPATH"; then for makefile in $MAKEFILE1 $MAKEFILE2 $MAKEFILE3; do - dir=`echo $makefile|sed 's%[^/][^/]*$%%'` + dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'` (cat < Date: Thu, 18 Apr 2002 14:24:17 +0000 Subject: [PATCH 3267/7878] Fix a problem with eof reporting with Unix file I/O on unbuffered files. Submitted by: Stas Bekman Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63276 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/unix/readwrite.c | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 1547deaf99c..680b50b27bc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix a problem with eof reporting with Unix file I/O on + unbuffered files. [Stas Bekman ] + *) Rename apr_explode_time to apr_time_exp_tz. [Thom May ] diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 6b3ab52ace9..2dede525046 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -207,6 +207,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size #endif *nbytes = bytes_read; if (rv == 0) { + thefile->eof_hit = TRUE; return APR_EOF; } if (rv > 0) { From a92baa0f5ba28e5a44b0b1e0a5565ce85c38d6eb Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 18 Apr 2002 17:15:27 +0000 Subject: [PATCH 3268/7878] Ensure that the ATOMIC_HASH can not be negative. Submitted by: Joe Orton Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63277 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ atomic/unix/apr_atomic.c | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 680b50b27bc..aeac99cd0a1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Ensure that the ATOMIC_HASH can not be negative. + [Joe Orton ] + *) Fix a problem with eof reporting with Unix file I/O on unbuffered files. [Stas Bekman ] diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 5dba3c4b353..ca547808f91 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -63,7 +63,7 @@ #define NUM_ATOMIC_HASH 7 /* shift by 2 to get rid of alignment issues */ -#define ATOMIC_HASH(x) (int)(((long)x>>2)%NUM_ATOMIC_HASH) +#define ATOMIC_HASH(x) (unsigned int)(((unsigned long)(x))%(unsigned int)NUM_ATOMIC_HASH) static apr_thread_mutex_t **hash_mutex; apr_status_t apr_atomic_init(apr_pool_t *p ) @@ -92,7 +92,6 @@ void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val) apr_thread_mutex_unlock(lock); /* return prev; */ } - printf("debug no workee\n"); /* return *mem; */ } void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val) From 4f53dc763855b6d877061ce2db2ec7a0ccbffefa Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Thu, 18 Apr 2002 17:17:13 +0000 Subject: [PATCH 3269/7878] Fix a compile break: In file included from testatomic.c:61: /usr/include/stdlib.h:485: parse error before `;' make[1]: *** [testatomic.lo] Error 1 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63278 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index ab929c51063..0d15c31a180 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -52,13 +52,13 @@ * . */ +#include +#include #include "apr_thread_proc.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_atomic.h" #include "errno.h" -#include -#include #include "apr_time.h" #if APR_HAVE_UNISTD_H #include From 796f7ae6988a8ef02cd1bbab8ad178c7b594f855 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Thu, 18 Apr 2002 20:26:40 +0000 Subject: [PATCH 3270/7878] Make this match the new unix version. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63279 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/win32/mmap.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index 2d3d61a4ceb..a113ecfcf2a 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -199,13 +199,7 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm) { - apr_status_t rv; - - if ((rv = mmap_cleanup(mm)) == APR_SUCCESS) { - apr_pool_cleanup_kill(mm->cntxt, mm, mmap_cleanup); - return APR_SUCCESS; - } - return rv; + return apr_pool_cleanup_run(mm->cntxt, mm, mmap_cleanup); } #endif From ad82dc4eadf986514aa33e7041d4d9f36dd1dd96 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 19 Apr 2002 11:30:45 +0000 Subject: [PATCH 3271/7878] template is a reserved word in C++, so don't use it Submitted by: Christian Gross Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63280 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 4b02d85881c..8c8d4ab0a24 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -666,7 +666,7 @@ APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); /** * Open a temporary file * @param fp The apr file to use as a temporary file. - * @param template The template to use when creating a temp file. + * @param templ The template to use when creating a temp file. * @param flags The flags to open the file with. If this is zero, * the file is opened with * APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE @@ -680,7 +680,7 @@ APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); * array. * */ -APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, +APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *templ, apr_int32_t flags, apr_pool_t *p); #ifdef __cplusplus From 21a712ec24dfaf3ae889d7a35a6ef257314b75a1 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 19 Apr 2002 16:16:21 +0000 Subject: [PATCH 3272/7878] Add back >>2 that was unintentionally removed in previous commit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63281 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index ca547808f91..cdcc6a5d657 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -63,7 +63,7 @@ #define NUM_ATOMIC_HASH 7 /* shift by 2 to get rid of alignment issues */ -#define ATOMIC_HASH(x) (unsigned int)(((unsigned long)(x))%(unsigned int)NUM_ATOMIC_HASH) +#define ATOMIC_HASH(x) (unsigned int)(((unsigned long)(x)>>2)%(unsigned int)NUM_ATOMIC_HASH) static apr_thread_mutex_t **hash_mutex; apr_status_t apr_atomic_init(apr_pool_t *p ) From 9dcb8cbee30b84dd1f0da28cc3d6a7b9178105bc Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 19 Apr 2002 17:21:05 +0000 Subject: [PATCH 3273/7878] Tru64: Stop leaving zombies in APR apps like mod_cgid which tell APR to ignore SIGCHLD. Submitted by: Dave Hill Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63282 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ threadproc/unix/signals.c | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGES b/CHANGES index aeac99cd0a1..d783ed540f4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Tru64: Stop leaving zombies in APR apps like mod_cgid which + tell APR to ignore SIGCHLD. + [Dave Hill ] + *) Ensure that the ATOMIC_HASH can not be negative. [Joe Orton ] diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 304e50aed3f..5659c920086 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -105,6 +105,16 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func) #ifdef SA_INTERRUPT /* SunOS */ act.sa_flags |= SA_INTERRUPT; #endif +#if defined(__osf__) && defined(__alpha) + /* XXX jeff thinks this should be enabled whenever SA_NOCLDWAIT is defined */ + + /* this is required on Tru64 to cause child processes to + * disappear gracefully - XPG4 compatible + */ + if ((signo == SIGCHLD) && (func == SIG_IGN)) { + act.sa_flags |= SA_NOCLDWAIT; + } + #endif if (sigaction(signo, &act, &oact) < 0) return SIG_ERR; return oact.sa_handler; From c128acf9ecd769cd00eeeab1c94ab3dfeee67ac3 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 20 Apr 2002 06:22:50 +0000 Subject: [PATCH 3274/7878] When compiling on an UltraSparc, ask the assembler to support v8plus instructions. (The point of this is to enable us to use the atomic compare-and-swap instruction in inline assembly code.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63283 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index 4a494172772..fe93df2a693 100644 --- a/configure.in +++ b/configure.in @@ -373,6 +373,7 @@ case $host in ASFLAGS="-xarch=v8plus -K PIC" ASCPPFLAGS="-D_ASM -D__STDC__=0" ASCPP="gcc -E" + APR_ADDTO(CFLAGS, [-Wa,-xarch=v8plus]) ;; esac else @@ -385,6 +386,7 @@ case $host in ASFLAGS="-K pic -P -D_ASM -D__STDC__=0 -xarch=v8plus" ASCPPFLAGS="" ASCPP="cat" + APR_ADDTO(CFLAGS, [-Wa,-xarch=v8plus]) ;; esac fi From f1a19de62b135b09cb973aba9ac0c5c10a6cb02e Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 20 Apr 2002 08:28:49 +0000 Subject: [PATCH 3275/7878] Reverting the Sparc v8plus check because it broke other things git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63284 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure.in b/configure.in index fe93df2a693..4a494172772 100644 --- a/configure.in +++ b/configure.in @@ -373,7 +373,6 @@ case $host in ASFLAGS="-xarch=v8plus -K PIC" ASCPPFLAGS="-D_ASM -D__STDC__=0" ASCPP="gcc -E" - APR_ADDTO(CFLAGS, [-Wa,-xarch=v8plus]) ;; esac else @@ -386,7 +385,6 @@ case $host in ASFLAGS="-K pic -P -D_ASM -D__STDC__=0 -xarch=v8plus" ASCPPFLAGS="" ASCPP="cat" - APR_ADDTO(CFLAGS, [-Wa,-xarch=v8plus]) ;; esac fi From eac2edce178091fbcf3ca76a42d28166adaaa0c5 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sat, 20 Apr 2002 22:06:38 +0000 Subject: [PATCH 3276/7878] Workaround for Linux header snafu git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63285 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 6cb0a7f7d3f..4ecd19e32ba 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -156,6 +156,7 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #elif defined(__linux) +#include #include #include #define apr_atomic_t atomic_t From 3c34bc196301629ad7c6a141489d60fcd69002f4 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 22 Apr 2002 01:24:51 +0000 Subject: [PATCH 3277/7878] Allow VPATH builds to properly generate build dependencies. This requires srcdir to always be available in a Makefile, so we need to stop adding this only when we use VPATH. Change the dependency generation to use .deps instead of appending to the Makefile. This makes us consistent with the dependency style of httpd-2.0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63286 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ Makefile.in | 1 + atomic/os390/Makefile.in | 2 ++ atomic/solaris_sparc/Makefile.in | 3 ++- atomic/unix/Makefile.in | 2 ++ build/Makefile.in | 3 +++ build/rules.mk.in | 7 +++---- configure.in | 8 +------- dso/aix/Makefile.in | 2 ++ dso/beos/Makefile.in | 2 ++ dso/os2/Makefile.in | 2 ++ dso/os390/Makefile.in | 2 ++ dso/unix/Makefile.in | 2 ++ file_io/os2/Makefile.in | 2 ++ file_io/unix/Makefile.in | 2 ++ i18n/unix/Makefile.in | 2 ++ locks/beos/Makefile.in | 2 ++ locks/os2/Makefile.in | 2 ++ locks/unix/Makefile.in | 2 ++ memory/unix/Makefile.in | 2 ++ misc/unix/Makefile.in | 2 ++ mmap/unix/Makefile.in | 2 ++ network_io/beos/Makefile.in | 2 ++ network_io/os2/Makefile.in | 2 ++ network_io/unix/Makefile.in | 2 ++ passwd/Makefile.in | 2 ++ shmem/beos/Makefile.in | 2 ++ shmem/os2/Makefile.in | 2 ++ shmem/unix/Makefile.in | 2 ++ strings/Makefile.in | 2 ++ tables/Makefile.in | 2 ++ test/Makefile.in | 2 ++ threadproc/beos/Makefile.in | 2 ++ threadproc/os2/Makefile.in | 2 ++ threadproc/unix/Makefile.in | 2 ++ time/unix/Makefile.in | 2 ++ user/unix/Makefile.in | 2 ++ 37 files changed, 75 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index d783ed540f4..064162322eb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Allow VPATH builds to properly build dependencies and switch to + a .deps dependency model to mimic httpd-2.0. [Justin Erenkrantz] + *) Tru64: Stop leaving zombies in APR apps like mod_cgid which tell APR to ignore SIGCHLD. [Dave Hill ] diff --git a/Makefile.in b/Makefile.in index 9a42039a956..a8411293d9e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -42,6 +42,7 @@ libdir=@libdir@ includedir=@includedir@ installbuilddir=@installbuilddir@ srcdir=@srcdir@ +VPATH=@srcdir@ top_srcdir=@top_srcdir@ top_blddir=@top_builddir@ diff --git a/atomic/os390/Makefile.in b/atomic/os390/Makefile.in index db26a7617d5..28cc1b6d8bc 100644 --- a/atomic/os390/Makefile.in +++ b/atomic/os390/Makefile.in @@ -1,3 +1,5 @@ +srcdir = @srcdir@ +VPATH = @srcdir@ TARGETS = atomic.lo diff --git a/atomic/solaris_sparc/Makefile.in b/atomic/solaris_sparc/Makefile.in index a2d8dbae405..f2435cd883d 100644 --- a/atomic/solaris_sparc/Makefile.in +++ b/atomic/solaris_sparc/Makefile.in @@ -1,3 +1,5 @@ +srcdir = @srcdir@ +VPATH = @srcdir@ TARGETS = @apr_atomic_sparc_compile@ @@ -8,7 +10,6 @@ ASCPP = @ASCPP@ # bring in rules.mk for standard functionality @INCLUDE_RULES@ -srcdir=@srcdir@ apr_atomic_sparc.lo: $(srcdir)/apr_atomic_sparc.s $(ASCPP) $(ASCPPFLAGS) $(srcdir)/$*.s > $*.S diff --git a/atomic/unix/Makefile.in b/atomic/unix/Makefile.in index 91cf22f14f5..188d0d242b9 100644 --- a/atomic/unix/Makefile.in +++ b/atomic/unix/Makefile.in @@ -1,3 +1,5 @@ +srcdir = @srcdir@ +VPATH = @srcdir@ TARGETS = apr_atomic.lo diff --git a/build/Makefile.in b/build/Makefile.in index c486d6941b3..ee1e6b58d38 100644 --- a/build/Makefile.in +++ b/build/Makefile.in @@ -1,3 +1,6 @@ +srcdir = @srcdir@ +VPATH = @srcdir@ + TARGETS= INCLUDES= DISTCLEAN_TARGETS = rules.mk diff --git a/build/rules.mk.in b/build/rules.mk.in index 26e5241b050..7a670160e21 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -195,10 +195,9 @@ local-extraclean: local-distclean x-local-extraclean local-all: $(TARGETS) local-depend: x-local-depend - @if test -n "`ls *.c 2> /dev/null`"; then \ - echo $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c ; \ - CC=${CC} $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c ; \ - fi + @if test -n "`ls $(srcdir)/*.c 2> /dev/null`"; then \ + $(CC) -MM $(ALL_CPPFLAGS) $(ALL_INCLUDES) $(srcdir)/*.c | sed 's/\.o:/.lo:/' > .deps || true; \ + fi # to be filled in by the actual Makefile x-local-depend x-local-clean x-local-distclean x-local-extraclean: diff --git a/configure.in b/configure.in index 4a494172772..d70c9ecf95f 100644 --- a/configure.in +++ b/configure.in @@ -1717,13 +1717,7 @@ changequote({,}) if test -n "$USE_VPATH"; then for makefile in $MAKEFILE1 $MAKEFILE2 $MAKEFILE3; do - dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'` - (cat < Date: Mon, 22 Apr 2002 01:25:53 +0000 Subject: [PATCH 3278/7878] Add .deps to cvsignore since APR may now generate .deps files. (somehow CVS ignored updating these on the last commit.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63287 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 1 + atomic/solaris_sparc/.cvsignore | 1 + atomic/unix/.cvsignore | 1 + dso/aix/.cvsignore | 1 + dso/beos/.cvsignore | 1 + dso/os2/.cvsignore | 1 + dso/os390/.cvsignore | 1 + dso/unix/.cvsignore | 1 + file_io/os2/.cvsignore | 1 + file_io/unix/.cvsignore | 1 + i18n/unix/.cvsignore | 1 + locks/beos/.cvsignore | 1 + locks/os2/.cvsignore | 1 + locks/unix/.cvsignore | 1 + memory/unix/.cvsignore | 1 + misc/unix/.cvsignore | 1 + mmap/unix/.cvsignore | 1 + network_io/beos/.cvsignore | 1 + network_io/os2/.cvsignore | 1 + network_io/unix/.cvsignore | 1 + passwd/.cvsignore | 1 + shmem/beos/.cvsignore | 1 + shmem/os2/.cvsignore | 1 + shmem/unix/.cvsignore | 1 + strings/.cvsignore | 1 + tables/.cvsignore | 1 + test/.cvsignore | 1 + threadproc/beos/.cvsignore | 1 + threadproc/os2/.cvsignore | 1 + threadproc/unix/.cvsignore | 1 + time/unix/.cvsignore | 1 + user/unix/.cvsignore | 1 + 32 files changed, 32 insertions(+) diff --git a/.cvsignore b/.cvsignore index cb36264ecf7..d638d3bea17 100644 --- a/.cvsignore +++ b/.cvsignore @@ -17,6 +17,7 @@ apr.exp exports.c export_vars.h .libs +.deps *.la libapr.rc *.aps diff --git a/atomic/solaris_sparc/.cvsignore b/atomic/solaris_sparc/.cvsignore index 1c875e8e26d..4e18126ffb1 100644 --- a/atomic/solaris_sparc/.cvsignore +++ b/atomic/solaris_sparc/.cvsignore @@ -2,3 +2,4 @@ Makefile *.lo *.S .libs +.deps diff --git a/atomic/unix/.cvsignore b/atomic/unix/.cvsignore index 06e18a7aafb..2ebd06d3517 100755 --- a/atomic/unix/.cvsignore +++ b/atomic/unix/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/dso/aix/.cvsignore b/dso/aix/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/dso/aix/.cvsignore +++ b/dso/aix/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/dso/beos/.cvsignore b/dso/beos/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/dso/beos/.cvsignore +++ b/dso/beos/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/dso/os2/.cvsignore b/dso/os2/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/dso/os2/.cvsignore +++ b/dso/os2/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/dso/os390/.cvsignore b/dso/os390/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/dso/os390/.cvsignore +++ b/dso/os390/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/dso/unix/.cvsignore b/dso/unix/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/dso/unix/.cvsignore +++ b/dso/unix/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/file_io/os2/.cvsignore b/file_io/os2/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/file_io/os2/.cvsignore +++ b/file_io/os2/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/file_io/unix/.cvsignore b/file_io/unix/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/file_io/unix/.cvsignore +++ b/file_io/unix/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/i18n/unix/.cvsignore b/i18n/unix/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/i18n/unix/.cvsignore +++ b/i18n/unix/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/locks/beos/.cvsignore b/locks/beos/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/locks/beos/.cvsignore +++ b/locks/beos/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/locks/os2/.cvsignore b/locks/os2/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/locks/os2/.cvsignore +++ b/locks/os2/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/locks/unix/.cvsignore b/locks/unix/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/locks/unix/.cvsignore +++ b/locks/unix/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/memory/unix/.cvsignore b/memory/unix/.cvsignore index aaaad72bcdb..f89ccf3789f 100644 --- a/memory/unix/.cvsignore +++ b/memory/unix/.cvsignore @@ -1,4 +1,5 @@ Makefile *.lo .libs +.deps *.o diff --git a/misc/unix/.cvsignore b/misc/unix/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/misc/unix/.cvsignore +++ b/misc/unix/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/mmap/unix/.cvsignore b/mmap/unix/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/mmap/unix/.cvsignore +++ b/mmap/unix/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/network_io/beos/.cvsignore b/network_io/beos/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/network_io/beos/.cvsignore +++ b/network_io/beos/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/network_io/os2/.cvsignore b/network_io/os2/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/network_io/os2/.cvsignore +++ b/network_io/os2/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/network_io/unix/.cvsignore b/network_io/unix/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/network_io/unix/.cvsignore +++ b/network_io/unix/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/passwd/.cvsignore b/passwd/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/passwd/.cvsignore +++ b/passwd/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/shmem/beos/.cvsignore b/shmem/beos/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/shmem/beos/.cvsignore +++ b/shmem/beos/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/shmem/os2/.cvsignore b/shmem/os2/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/shmem/os2/.cvsignore +++ b/shmem/os2/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/shmem/unix/.cvsignore b/shmem/unix/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/shmem/unix/.cvsignore +++ b/shmem/unix/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/strings/.cvsignore b/strings/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/strings/.cvsignore +++ b/strings/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/tables/.cvsignore b/tables/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/tables/.cvsignore +++ b/tables/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/test/.cvsignore b/test/.cvsignore index 9c8a78e5a85..bae1d73096a 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -4,6 +4,7 @@ Release *.lo *.swp .libs +.deps testmd5 testmmap htdigest diff --git a/threadproc/beos/.cvsignore b/threadproc/beos/.cvsignore index 3bc2847e3a3..11f54a84329 100644 --- a/threadproc/beos/.cvsignore +++ b/threadproc/beos/.cvsignore @@ -2,3 +2,4 @@ Makefile apr_proc_stub *.lo .libs +.deps diff --git a/threadproc/os2/.cvsignore b/threadproc/os2/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/threadproc/os2/.cvsignore +++ b/threadproc/os2/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/threadproc/unix/.cvsignore b/threadproc/unix/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/threadproc/unix/.cvsignore +++ b/threadproc/unix/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/time/unix/.cvsignore b/time/unix/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/time/unix/.cvsignore +++ b/time/unix/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps diff --git a/user/unix/.cvsignore b/user/unix/.cvsignore index 06e18a7aafb..2ebd06d3517 100644 --- a/user/unix/.cvsignore +++ b/user/unix/.cvsignore @@ -1,3 +1,4 @@ Makefile *.lo .libs +.deps From 8f2f5bfbf7820b55986add065ed51cde55699951 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 22 Apr 2002 01:49:46 +0000 Subject: [PATCH 3279/7878] Style police are on the prowl. (No code changes) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63288 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index cdcc6a5d657..9c27bf10f56 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -52,29 +52,31 @@ * . */ - #include "apr.h" #include "apr_atomic.h" #include "apr_thread_mutex.h" #if APR_HAS_THREADS -#if defined(APR_ATOMIC_NEED_DEFAULT) || defined(APR_ATOMIC_NEED_CAS_DEFAULT) +#if defined(APR_ATOMIC_NEED_DEFAULT) || defined(APR_ATOMIC_NEED_CAS_DEFAULT) #define NUM_ATOMIC_HASH 7 /* shift by 2 to get rid of alignment issues */ #define ATOMIC_HASH(x) (unsigned int)(((unsigned long)(x)>>2)%(unsigned int)NUM_ATOMIC_HASH) static apr_thread_mutex_t **hash_mutex; -apr_status_t apr_atomic_init(apr_pool_t *p ) +apr_status_t apr_atomic_init(apr_pool_t *p) { int i; apr_status_t rv; - hash_mutex =apr_palloc(p,sizeof(apr_thread_mutex_t*) * NUM_ATOMIC_HASH); - for (i=0;i Date: Mon, 22 Apr 2002 03:09:07 +0000 Subject: [PATCH 3280/7878] Removed some extraneous code from the apr_atomic_cas function Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63289 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/apr_atomic_sparc.s | 6 ------ 1 file changed, 6 deletions(-) diff --git a/atomic/solaris_sparc/apr_atomic_sparc.s b/atomic/solaris_sparc/apr_atomic_sparc.s index 3f7b794f4cb..3057b3238d2 100644 --- a/atomic/solaris_sparc/apr_atomic_sparc.s +++ b/atomic/solaris_sparc/apr_atomic_sparc.s @@ -110,12 +110,6 @@ _apr_atomic_sub_sparc_loop: ENTRY(apr_atomic_casptr_sparc) cas [%o0], %o2, %o1 - cmp %o1, %o2 ! if o1 == o2 values weren't swapped - bne,a _apr_atomic_cas_ne - mov %o2, %o0 - retl - mov %o2, %o0 -_apr_atomic_cas_ne: retl mov %o1, %o0 From f56dc8abb35504dc5ba327d4b23f9cb2dfd71cf9 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 22 Apr 2002 08:44:23 +0000 Subject: [PATCH 3281/7878] Move APR_STRINGIFY to a common place (apr_general.h). Remove the macro from apr_version.h. Remove the APR_POOL_STRINGIZE macro form apr_pools.h and use APR_STRINGIZE instead. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63290 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 3 +++ include/apr_pools.h | 7 ++----- include/apr_version.h | 5 ----- misc/unix/version.c | 1 + 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index c474676917f..ec9ff5fbb8b 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -173,6 +173,9 @@ int strncasecmp(const char *a, const char *b, size_t n); * String and memory functions */ +#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) +#define APR_STRINGIFY_HELPER(n) #n + #if (!APR_HAVE_MEMMOVE) #define memmove(a,b,c) bcopy(b,a,c) #endif diff --git a/include/apr_pools.h b/include/apr_pools.h index 5aae8030a3c..4d95dcd9172 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -83,6 +83,7 @@ extern "C" { */ #include "apr.h" #include "apr_errno.h" +#include "apr_general.h" /* for APR_STRINGIFY */ #define APR_WANT_MEMFUNC #include "apr_want.h" @@ -165,12 +166,8 @@ typedef struct apr_pool_t apr_pool_t; #define APR_POOL_DEBUG 0 #endif -/** String to number */ -#define APR_POOL_STRINGIZE(x) APR_POOL__STRINGIZE(x) -/** String to number */ -#define APR_POOL__STRINGIZE(x) #x /** the place in the code where the particular function was called */ -#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_POOL_STRINGIZE(__LINE__) +#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_POOL_STRINGIFY(__LINE__) diff --git a/include/apr_version.h b/include/apr_version.h index bf85a785c3c..e4a5905a593 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -151,11 +151,6 @@ APR_DECLARE(void) apr_version(apr_version_t *pvsn); APR_DECLARE(const char *) apr_version_string(void); -/** Internal: helper macro for stringifying the version numbers */ -#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) -/** Internal: helper macro for stringifying the version numbers */ -#define APR_STRINGIFY_HELPER(n) #n - /** Internal: string form of the "is dev" flag */ #ifdef APR_IS_DEV_VERSION #define APR_IS_DEV_STRING "-dev" diff --git a/misc/unix/version.c b/misc/unix/version.c index 3457cc461d6..cac4dbc8bda 100644 --- a/misc/unix/version.c +++ b/misc/unix/version.c @@ -53,6 +53,7 @@ */ #include "apr_version.h" +#include "apr_general.h" /* for APR_STRINGIFY */ APR_DECLARE(void) apr_version(apr_version_t *pvsn) { From cab5e32d65994ec431f2fec210552db71e7a52c3 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 22 Apr 2002 09:05:18 +0000 Subject: [PATCH 3282/7878] Fix a macro call (should have cut the POOL part out in last commit). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63291 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 4d95dcd9172..620578bd696 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -167,7 +167,7 @@ typedef struct apr_pool_t apr_pool_t; #endif /** the place in the code where the particular function was called */ -#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_POOL_STRINGIFY(__LINE__) +#define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__) From b6d569dd65cfa365717470bee196ab4d01da1815 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 22 Apr 2002 10:24:41 +0000 Subject: [PATCH 3283/7878] Rename apr_get_groupname to apr_group_name_get. Submitted by: Thom May git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63292 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_user.h | 2 +- renames_pending | 2 -- test/testfile.c | 2 +- test/testuser.c | 2 +- user/netware/groupinfo.c | 2 +- user/unix/groupinfo.c | 2 +- user/win32/groupinfo.c | 2 +- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 064162322eb..1b81a10a01c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Rename apr_get_groupname to apr_group_name_get. + [Thom May ] + *) Allow VPATH builds to properly build dependencies and switch to a .deps dependency model to mimic httpd-2.0. [Justin Erenkrantz] diff --git a/include/apr_user.h b/include/apr_user.h index 23b03bb061a..3cc99e0db10 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -154,7 +154,7 @@ APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right); * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ -APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p); /** * Get the groupid for a specified group name diff --git a/renames_pending b/renames_pending index d7e3a0fae6e..108f0025073 100644 --- a/renames_pending +++ b/renames_pending @@ -1,7 +1,5 @@ Symbol renames for APR -apr_group_name_get from apr_get_groupname - apr_user_homedir_get from apr_get_home_directory apr_user_id_get from apr_get_userid apr_user_name_get from apr_get_username diff --git a/test/testfile.c b/test/testfile.c index 4e81381db69..a189dfd6c4b 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -218,7 +218,7 @@ int main(void) if (finfo.valid & APR_FINFO_GROUP) { STD_TEST_NEQ(" Getting groupname", - apr_get_groupname(&buf, finfo.group, pool)) + apr_group_name_get(&buf, finfo.group, pool)) STD_TEST_NEQ(" Comparing group ID's", apr_compare_groups(finfo.group, gid)) printf(" (gid's for %s match)\n", buf); diff --git a/test/testuser.c b/test/testuser.c index bc0f4c3c78a..cfda620c0cd 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -117,7 +117,7 @@ int main(int argc, char *argv[]) } } - rv = apr_get_groupname(&groupname, groupid, p); + rv = apr_group_name_get(&groupname, groupid, p); if (rv != APR_SUCCESS) groupname = "(none)"; diff --git a/user/netware/groupinfo.c b/user/netware/groupinfo.c index bd209434eed..530f2588198 100644 --- a/user/netware/groupinfo.c +++ b/user/netware/groupinfo.c @@ -66,7 +66,7 @@ #include /* for _POSIX_THREAD_SAFE_FUNCTIONS */ #endif -APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p) { return APR_ENOTIMPL; } diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 97c245a0a73..a393a911a75 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -66,7 +66,7 @@ #include /* for _POSIX_THREAD_SAFE_FUNCTIONS */ #endif -APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p) { struct group *gr; #ifndef BEOS diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index 611f744e76f..edc2feb54d4 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -100,7 +100,7 @@ APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *gid, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p) { SID_NAME_USE type; char name[MAX_PATH], domain[MAX_PATH]; From db453d0c38a8ce713ffcf92d0792ea05adb29bec Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 22 Apr 2002 10:28:58 +0000 Subject: [PATCH 3284/7878] Failed to update CHANGES on a previous rename. Insert it at the correct spot. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63293 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 1b81a10a01c..7c1cca56d41 100644 --- a/CHANGES +++ b/CHANGES @@ -19,6 +19,9 @@ Changes with APR b1 *) Rename apr_explode_time to apr_time_exp_tz. [Thom May ] + *) Rename apr_explode_localtime to apr_time_exp_lt. + [Thom May ] + *) Set precompiler for Solaris atomics when using GNU binutils. PR 7876. [solomon@conceptshopping.com (Marvin Solomon)] From a03953216e3181d5353a30b94619c2c5a2555380 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 22 Apr 2002 13:15:48 +0000 Subject: [PATCH 3285/7878] To support modules like PHP, which implement their own loaded extensions, Darwin needs to place their public symbols in the global table. In Rhapsody, we simply set bindNow to False to achieve the same goal. PR: Obtained from: Submitted by: Marko Karppinen Reviewed by: Jim Jagielski, Fred Sanchez git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63294 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ dso/unix/dso.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 7c1cca56d41..59dbf003f4f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) To support modules like PHP, which implement their own + loaded extensions, Darwin needs to place their public + symbols in the global table. [Marko Karppinen , + Jim Jagielski] + *) Rename apr_get_groupname to apr_group_name_get. [Thom May ] diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 944fafe152d..a9b22b28ea3 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -126,12 +126,18 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, NSModule os_handle = NULL; char* err_msg = NULL; if (NSCreateObjectFileImageFromFile(path, &image) == NSObjectFileImageSuccess) { -#ifdef NSLINKMODULE_OPTION_PRIVATE + +/* + * Under Darwin, we want/need to place dynamically loaded extensions' + * public symbols into the global symbol table. As long as modules + * don't have overlapping symbols, we're golden. + */ +#if defined(NSLINKMODULE_OPTION_NONE) os_handle = NSLinkModule(image, path, - NSLINKMODULE_OPTION_PRIVATE | + NSLINKMODULE_OPTION_NONE | NSLINKMODULE_OPTION_RETURN_ON_ERROR); #else - os_handle = NSLinkModule(image, path, TRUE); + os_handle = NSLinkModule(image, path, FALSE); #endif NSDestroyObjectFileImage(image); } From 4e870bfd1fe82790e8a143fe369cb4cbbf09cd7b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 22 Apr 2002 16:41:50 +0000 Subject: [PATCH 3286/7878] Correct two huge Win32 bugs. One failed to terminate the path (we also failed to allocate for the terminator) of UNC root paths, so they would usually be determined invalid. The other failed to expand the path (shrinking worked correctly) when dealing with aliases in the file path. PR: 8009, other 'UNC not accepted' reports git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63295 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 49 ++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 53c689bfbbe..6dac7cc6d44 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -201,36 +201,32 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, return APR_EBADPATH; } - if (!*delim2) { - /* Have path of '//machine/[share]' so we must have - * an extra byte for the trailing slash + /* Copy the '//machine/[share[/]]' path, always providing + * an extra byte for the trailing slash. */ - newpath = apr_pstrndup(p, testpath, delim2 - testpath + 1); - newpath[delim2 - testpath + 1] = '\0'; - } - else - newpath = apr_pstrndup(p, testpath, delim2 - testpath); - - /* Win32 will argue about slashed in UNC paths, so use - * backslashes till we finish testing - */ - newpath[0] = '\\'; - newpath[1] = '\\'; - newpath[delim1 - testpath] = '\\'; + newpath = apr_pstrmemdup(p, testpath, delim2 - testpath + 1); if (delim2 == delim1 + 1) { - /* We simply \\machine\, so give up already + /* We found simply \\machine\, so give up already */ *rootpath = newpath; *inpath = delim2; return APR_EINCOMPLETE; } - /* Validate the \\Machine\Share\ designation, must - * root this designation! - */ - newpath[delim2 - testpath] = '\\'; if (flags & APR_FILEPATH_TRUENAME) { + /* Validate the \\Machine\Share\ designation, + * Win32 will argue about slashed in UNC paths, + * so use backslashes till we finish testing, + * and add the trailing backslash [required]. + * apr_pstrmemdup above guarentees us the new + * trailing null character. + */ + newpath[0] = '\\'; + newpath[1] = '\\'; + newpath[delim1 - testpath] = '\\'; + newpath[delim2 - testpath] = '\\'; + rv = filepath_root_test(newpath, p); if (rv) return rv; @@ -240,6 +236,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, newpath[0] = seperator[0]; newpath[1] = seperator[0]; newpath[delim1 - testpath] = seperator[0]; + newpath[delim2 - testpath] = (*delim2 ? seperator[0] : '\0'); } else { /* Give back the caller's own choice of delimiters @@ -247,6 +244,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, newpath[0] = testpath[0]; newpath[1] = testpath[1]; newpath[delim1 - testpath] = *delim1; + newpath[delim2 - testpath] = *delim2; } /* If this root included the trailing / or \ designation @@ -257,14 +255,11 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, *inpath = delim2 + 1; while (**inpath == '/' || **inpath == '\\') ++*inpath; - if (flags & APR_FILEPATH_TRUENAME) - newpath[delim2 - testpath] = seperator[0]; - else - newpath[delim2 - testpath] = *delim2; } - else + else { *inpath = delim2; - + } + *rootpath = newpath; return APR_SUCCESS; } @@ -890,7 +885,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, else { /* namelen > seglen */ if (pathlen + namelen - seglen >= sizeof(path)) return APR_ENAMETOOLONG; - if ((namelen < seglen) && saveslash) { + if (saveslash) { memmove(path + keptlen + namelen + 1, path + keptlen + seglen + 1, pathlen - keptlen - seglen); From ef8215830257cdd32761d16a71394fa6880e3d3b Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 22 Apr 2002 21:22:21 +0000 Subject: [PATCH 3287/7878] Implemented the case matching to disk of the file and directory names. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63296 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 6a54ae2f59f..d6d788e81f4 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -53,6 +53,7 @@ */ #include "fileio.h" +#include "nks/dirio.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_strings.h" @@ -108,7 +109,29 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, char *case_filename(apr_pool_t *pPool, const char *szFile) { - return (char*)szFile; + char *casedFileName = NULL; +#ifdef WAIT_TO_IMPLEMENT + char buf[1024]; + NXDirAttrWithName_t *attrBuf; + int rc; + + attrBuf = (NXDirAttrWithName_t *) &buf; + rc =NXGetAttr(NULL, szFile, NX_DELEVEL_NAME_ONLY, attrBuf, 1024, 0); + if (rc == 0) { + casedFileName = apr_pstrdup(pPool, attrBuf->deName); + } + else +#endif + { + char *s; + s = strrchr(szFile, '/'); + if (!s) + s = strrchr(szFile, ':'); + if (s) { + casedFileName = apr_pstrdup(pPool, &s[1]); + } + } + return casedFileName; } @@ -303,9 +326,9 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, if (wanted & APR_FINFO_LINK) wanted &= ~APR_FINFO_LINK; if (wanted & APR_FINFO_NAME) { - s = strrchr(case_filename(pool, fname), '/'); + s = case_filename(pool, fname); if (s) { - finfo->name = apr_pstrdup(pool, &s[1]); + finfo->name = s; finfo->valid |= APR_FINFO_NAME; } } From 3fea5565616f7094d65d26749b709f101a9048f2 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 23 Apr 2002 19:01:35 +0000 Subject: [PATCH 3288/7878] Hopefully close the build problems with atomic on Solaris systems with GNUas. It looks like 'gcc -E' is ignoring the apr_atomic_sparc.s file (due to the suffix... a apr_atomic_sparc.c file would be read in fine) causing apr_atomic_sparc.S to be empty for GNUas users. Soooooo we force it to read from stdin. For non-GNUas users, we work as normal, though a but weirdly (instead of cat ... > it's cat - < ... > ) PR: Obtained from: Submitted by: Reviewed by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63297 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic/solaris_sparc/Makefile.in b/atomic/solaris_sparc/Makefile.in index f2435cd883d..571440781ac 100644 --- a/atomic/solaris_sparc/Makefile.in +++ b/atomic/solaris_sparc/Makefile.in @@ -12,7 +12,7 @@ ASCPP = @ASCPP@ @INCLUDE_RULES@ apr_atomic_sparc.lo: $(srcdir)/apr_atomic_sparc.s - $(ASCPP) $(ASCPPFLAGS) $(srcdir)/$*.s > $*.S + $(ASCPP) $(ASCPPFLAGS) - < $(srcdir)/$*.s > $*.S $(AS) $(ASFLAGS) -o $@ $*.S From b8479310e78ff79af018eeed8603152092659033 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 24 Apr 2002 03:31:46 +0000 Subject: [PATCH 3289/7878] That's an LSTAT, not a stat. Think about it, if you are trying to figure the proper case (or alias) you are asking for the info about the name you provided (even if it's a link), never the info about the -target- (which fails anyway in my fix-in-progress for Win2k Junctions). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63298 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 6dac7cc6d44..0edfd25b1be 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -858,7 +858,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } /* Null term for stat! */ path[keptlen + seglen] = '\0'; - if ((rv = apr_stat(&finfo, path, APR_FINFO_TYPE | APR_FINFO_NAME, p)) + if ((rv = apr_lstat(&finfo, path, APR_FINFO_TYPE | APR_FINFO_NAME, p)) == APR_SUCCESS) { size_t namelen = strlen(finfo.name); From 152ff849f4df298e4f676a063c59180f1e7bb683 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 24 Apr 2002 04:17:44 +0000 Subject: [PATCH 3290/7878] Half of a fix. We were inappropriately using GetFileInformationEx and friends to attempt to get the details of a Junction (NTFS symlink.) This was entirely invalid, we now use the open->getfileinfo->close on such an entity. The faster methods exist only within the NT kernel, an option I'll be exploring but haven't had time to address. Bugz report 8014, identified by Sam Morris git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63299 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 0dadf4bb7f0..696ba3307c7 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -466,24 +466,29 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, return APR_ENAMETOOLONG; } - if ((apr_os_level >= APR_WIN_NT) - && (wanted & (APR_FINFO_IDENT | APR_FINFO_NLINK))) { - /* FindFirstFile and GetFileAttributesEx can't figure the inode, - * device or number of links, so we need to resolve with an open - * file handle. If the user has asked for these fields, fall over - * to the get file info by handle method. If we fail, or the user - * also asks for the file name, continue by our usual means. - */ - if ((ident_rv = resolve_ident(finfo, fname, wanted, pool)) - == APR_SUCCESS) - return ident_rv; - else if (ident_rv == APR_INCOMPLETE) - wanted &= ~finfo->valid; - } - #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { + if ((wanted & (APR_FINFO_IDENT | APR_FINFO_NLINK)) + || (~wanted & APR_FINFO_LINK)) { + /* FindFirstFile and GetFileAttributesEx can't figure the inode, + * device or number of links, so we need to resolve with an open + * file handle. If the user has asked for these fields, fall over + * to the get file info by handle method. If we fail, or the user + * also asks for the file name, continue by our usual means. + * + * We also must use this method for a 'true' stat, that resolves + * a symlink (NTFS Junction) target. This is because all fileinfo + * on a Junction always returns the junction, opening the target + * is the only way to resolve the target's attributes. + */ + if ((ident_rv = resolve_ident(finfo, fname, wanted, pool)) + == APR_SUCCESS) + return ident_rv; + else if (ident_rv == APR_INCOMPLETE) + wanted &= ~finfo->valid; + } + if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) / sizeof(apr_wchar_t), fname)) return rv; From 80d7f4eeafb00d91f2d24b3c43e6008fd101ab85 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 24 Apr 2002 16:39:40 +0000 Subject: [PATCH 3291/7878] handle some bogus error messages and output, esp. when using gcc3, when preprocessing the apr_atomic_sparc.s file when using GNUas. Should allow a clean and valid compile of the atomic code now. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63300 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index d70c9ecf95f..e31fbc9170f 100644 --- a/configure.in +++ b/configure.in @@ -371,7 +371,7 @@ case $host in ;; *) ASFLAGS="-xarch=v8plus -K PIC" - ASCPPFLAGS="-D_ASM -D__STDC__=0" + ASCPPFLAGS="-traditional-cpp -D_ASM -D__STDC__=0" ASCPP="gcc -E" ;; esac From d360efb2527ab41a0ec0d7e2a253896b021e08c7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 24 Apr 2002 20:13:52 +0000 Subject: [PATCH 3292/7878] for the gethostbyname() path in apr_sockaddr_info_get(), always handle numeric address strings... this solved a weird binary compatibility problem Submitted by: Jon Travis Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63301 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 47 ------------------------------------- configure.in | 2 -- network_io/unix/sa_common.c | 4 ---- 3 files changed, 53 deletions(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 2e506a6a321..1f282e563fd 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -170,53 +170,6 @@ if test "$ac_cv_retransretry" = "yes"; then fi ]) - -dnl -dnl check for gethostbyname() which handles numeric address strings -dnl -AC_DEFUN(APR_CHECK_GETHOSTBYNAME_NAS,[ - AC_CACHE_CHECK(for gethostbyname() which handles numeric address strings, ac_cv_gethostbyname_nas,[ - AC_TRY_RUN( [ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -void main(void) { - struct hostent *he = gethostbyname("127.0.0.1"); - if (he == NULL) { - exit(1); - } - he = gethostbyname("255.255.255.255"); - if (he == NULL) { - exit(1); - } - else { - exit(0); - } -} -],[ - ac_cv_gethostbyname_nas="yes" -],[ - ac_cv_gethostbyname_nas="no" -],[ - ac_cv_gethostbyname_nas="yes" -])]) -if test "$ac_cv_gethostbyname_nas" = "yes"; then - AC_DEFINE(GETHOSTBYNAME_HANDLES_NAS, 1, [Define if gethostbyname() handles nnn.nnn.nnn.nnn]) -fi -]) - dnl dnl Checks the definition of gethostbyname_r and gethostbyaddr_r dnl which are different for glibc, solaris and assorted other operating diff --git a/configure.in b/configure.in index e31fbc9170f..c582f539990 100644 --- a/configure.in +++ b/configure.in @@ -1525,8 +1525,6 @@ AC_SUBST(file_as_socket) APR_CHECK_SOCKADDR_SA_LEN -APR_CHECK_GETHOSTBYNAME_NAS - dnl Check the types only if we have gethostbyname_r if test "$ac_cv_func_gethostbyname_r" = "yes"; then APR_CHECK_GETHOSTBYNAME_R_STYLE diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 0f4bec73305..fd3af244efc 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -417,7 +417,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, family = APR_INET; /* we don't support IPv6 here */ } -#ifndef GETHOSTBYNAME_HANDLES_NAS if (*hostname >= '0' && *hostname <= '9' && strspn(hostname, "0123456789.") == strlen(hostname)) { struct in_addr ipaddr; @@ -426,7 +425,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, save_addrinfo(p, *sa, ipaddr, port); } else { -#endif #if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) #if defined(GETHOSTBYNAME_R_HOSTENT_DATA) @@ -474,9 +472,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, port); ++curaddr; } -#ifndef GETHOSTBYNAME_HANDLES_NAS } -#endif } else { (*sa)->pool = p; From 29bf527f2306ae082c110a00c6c6b5a938f6a9d7 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Wed, 24 Apr 2002 21:39:24 +0000 Subject: [PATCH 3293/7878] apr_sendfile: implement APR_INCOMPLETE_WRITE semantics for FreeBSD. This cuts the number of sendfile syscalls in half for big files. Also, bail out early in the normal case to reduce i-cache pollution. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63302 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ network_io/unix/sendrecv.c | 34 +++++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index 59dbf003f4f..b2569593247 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Reduce the number of apr_sendfile calls on FreeBSD by remembering + when the kernel tells us the next one will block. [Greg Ames] + *) To support modules like PHP, which implement their own loaded extensions, Darwin needs to place their public symbols in the global table. [Marko Karppinen , diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 65df39670a1..4f0e238388b 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -456,6 +456,15 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, /* FreeBSD can send the headers/footers as part of the system call */ do { + if (sock->netmask & APR_INCOMPLETE_WRITE) { + apr_status_t arv; + sock->netmask &= ~APR_INCOMPLETE_WRITE; + arv = apr_wait_for_io_or_timeout(sock, 0); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } + } if (bytes_to_send) { /* We won't dare call sendfile() if we don't have * header or file bytes to send because bytes_to_send == 0 @@ -468,18 +477,21 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, &headerstruct, /* Headers/footers */ &nbytes, /* number of bytes written */ flags); /* undefined, set to 0 */ - /* FreeBSD's sendfile can return -1/EAGAIN even if it - * sent bytes. Sanitize the result so we get normal EAGAIN - * semantics w.r.t. bytes sent. - */ - if (rv == -1 && errno == EAGAIN && nbytes) { - rv = 0; + + if (rv == -1 && errno == EAGAIN) { + if (sock->timeout) { + sock->netmask |= APR_INCOMPLETE_WRITE; + } + /* FreeBSD's sendfile can return -1/EAGAIN even if it + * sent bytes. Sanitize the result so we get normal EAGAIN + * semantics w.r.t. bytes sent. + */ + if (nbytes) { + /* normal exit for a big file & non-blocking io */ + (*len) = nbytes; + return APR_SUCCESS; + } } - - /* ??? performance: if rv == 0 is the most common case, - * we may want to return here and avoid a potential - * i-cache miss. - */ } else { /* just trailer bytes... use writev() From 24b537657117f548b20fa61a1df355dbaffbd06e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 25 Apr 2002 18:27:31 +0000 Subject: [PATCH 3294/7878] Reduce the number of apr_sendfile calls on AIX and OS/390 by remembering when the kernel tells us the next one will block. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63303 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ network_io/unix/sendrecv.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGES b/CHANGES index b2569593247..e5414a43b24 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Reduce the number of apr_sendfile calls on AIX and OS/390 by + remembering when the kernel tells us the next one will block. + [Jeff Trawick] + *) Reduce the number of apr_sendfile calls on FreeBSD by remembering when the kernel tells us the next one will block. [Greg Ames] diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 4f0e238388b..f9229c8feee 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -752,6 +752,11 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, /* O.K. All set up now. Let's go to town */ + if (sock->netmask & APR_INCOMPLETE_WRITE) { + sock->netmask &= ~APR_INCOMPLETE_WRITE; + goto do_select; + } + do { rv = send_file(&(sock->socketdes), /* socket */ &(parms), /* all data */ @@ -761,6 +766,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { +do_select: arv = apr_wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -786,6 +792,12 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, if (rv == -1) { return errno; } + + if (sock->timeout && + (parms.bytes_sent < (parms.file_bytes + parms.header_length + parms.trailer_length))) { + sock->netmask |= APR_INCOMPLETE_WRITE; + } + return APR_SUCCESS; } #elif defined(__osf__) && defined (__alpha) From 9eafecf9a0fdf18751b590e1e8634e04e017c6b7 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Fri, 26 Apr 2002 17:28:20 +0000 Subject: [PATCH 3295/7878] I hate calling votes like this, but I think we need a consensus. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63304 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index cc088a91902..ccbf9f32432 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/04/13 07:46:58 $] +Last modified at [$Date: 2002/04/26 17:28:20 $] Release: @@ -51,6 +51,19 @@ RELEASE SHOWSTOPPERS: * The new apr_global_mutex_t lock type must be implemented on all platforms. +CURRENT VOTES: + + * For the atomics code to be efficient it depends on instructions + in newer sparc models. Unfortunately this means that binaries + optimized at build-time for these architectures will not work + on older hardware, regardless of the version of Solaris running. + The same is likely happening on the various x86 implementations. + Although I had high hopes for the atomics code, I think we can + not support it in a way that is compatible with the portability + goals of APR, and I hereby propose that we remove it from APR. + + +1: Aaron + RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * The return type of a thread function (void *) is inconsistent with From dce77dee77adb1020e26402223b6b0f34e1f7057 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 27 Apr 2002 05:43:05 +0000 Subject: [PATCH 3296/7878] Avoid warnings on Darwin by working around a bug in sys/include.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63305 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_signal.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/apr_signal.h b/include/apr_signal.h index e490d2f38dd..000542aed25 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -78,6 +78,18 @@ extern "C" { #if APR_HAVE_SIGACTION +#if defined(DARWIN) && !defined(__cplusplus) && !defined(_ANSI_SOURCE) +/* work around Darwin header file bugs + * http://www.opensource.apple.com/bugs/X/BSD%20Kernel/2657228.html + */ +#undef SIG_DFL +#undef SIG_IGN +#undef SIG_ERR +#define SIG_DFL (void (*)(int))0 +#define SIG_IGN (void (*)(int))1 +#define SIG_ERR (void (*)(int))-1 +#endif + typedef void apr_sigfunc_t(int); /* ### how to doc this? */ From bfbdc2cad9cf796972421215db02977c3492d88a Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Sat, 27 Apr 2002 20:47:57 +0000 Subject: [PATCH 3297/7878] A read with 0 bytes is an APR_EOF. Found this running ab. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63306 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 696ef9f297a..227e604ca50 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -114,8 +114,7 @@ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, } *len = dwBytes; - return APR_SUCCESS; - + return dwBytes == 0 ? APR_EOF : APR_SUCCESS; } From fbe5c35f3846e14fa51b7ff5c67c8de44196c74d Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 28 Apr 2002 03:21:24 +0000 Subject: [PATCH 3298/7878] Optimization: rearranged the mutex lock/unlock code to eliminate a conditional branch on platforms where PTHREAD_SETS_ERRNO is not defined (at present, this means everything except OS/390) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63307 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_mutex.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 78a7d8181c3..170e0b70a7b 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -143,19 +143,17 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) mutex->owner = apr_os_thread_current(); mutex->owner_ref = 1; + return rv; } else { rv = pthread_mutex_lock(&mutex->mutex); - if (rv) { #ifdef PTHREAD_SETS_ERRNO + if (rv) { rv = errno; -#endif - return rv; } - +#endif + return rv; } - - return rv; } APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) @@ -212,17 +210,17 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) memset(&mutex->owner, 0, sizeof mutex->owner); mutex->owner_ref = 0; + return status; } else { status = pthread_mutex_unlock(&mutex->mutex); - if (status) { #ifdef PTHREAD_SETS_ERRNO + if (status) { status = errno; -#endif - return status; } +#endif + return status; } - return status; } APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) From 652ae5f5e7372beefd643e536a17365c610c462f Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 28 Apr 2002 07:49:34 +0000 Subject: [PATCH 3299/7878] Not all platforms can mmap /dev/zero, so we need to do an explicit check for that. If that were to fail, then make it appear as /dev/zero never existed in the first place. PR: 8537 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63308 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index e5414a43b24..3e44f79573f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Don't try to use /dev/zero and mmap on platforms that don't + support that (such as HP-UX). PR 8537. [Justin Erenkrantz] + *) Reduce the number of apr_sendfile calls on AIX and OS/390 by remembering when the kernel tells us the next one will block. [Jeff Trawick] diff --git a/configure.in b/configure.in index c582f539990..3e2fd3800c1 100644 --- a/configure.in +++ b/configure.in @@ -591,6 +591,38 @@ AC_CHECK_HEADERS(kernel/OS.h) AC_CHECK_FUNCS(create_area) AC_CHECK_HEADERS(os2.h) +dnl Not all systems can mmap /dev/zero (such as HP-UX). Check for that. +if test "$ac_cv_func_mmap" = "yes" && + test "$ac_cv_file__dev_zero" = "yes"; then + AC_MSG_CHECKING(for mmap that can map /dev/zero) + AC_TRY_RUN([ +#include +#include +#include +#ifdef HAVE_SYS_MMAN_H +#include +#endif + int main() + { + int fd; + void *m; + fd = open("/dev/zero", O_RDWR); + if (fd < 0) { + return 1; + } + m = mmap(0, sizeof(void*), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); + if (m < 0) { /* aka MAP_FAILED */ + return 2; + } + if (munmap(m, sizeof(void*)) < 0) { + return 3; + } + return 0; + }], [], [ac_cv_file__dev_zero=no]) + + AC_MSG_RESULT($ac_cv_file__dev_zero) +fi + dnl Now we determine which one is our anonymous shmem preference. haveshmgetanon="0" havemmapzero="0" @@ -1245,7 +1277,6 @@ dnl #----------------------------- Checking for Locking Characteristics echo $ac_n "${nl}Checking for Locking...${nl}" AC_CHECK_FUNCS(semget semctl flock) -APR_CHECK_FILE(/dev/zero) AC_CHECK_HEADERS(semaphore.h) AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait) From da4e2141436219734beca76535ca55ebef7fa13f Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 29 Apr 2002 08:36:33 +0000 Subject: [PATCH 3300/7878] Manipulation to bump a tag git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63309 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGES b/CHANGES index 3e44f79573f..e5414a43b24 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,5 @@ Changes with APR b1 - *) Don't try to use /dev/zero and mmap on platforms that don't - support that (such as HP-UX). PR 8537. [Justin Erenkrantz] - *) Reduce the number of apr_sendfile calls on AIX and OS/390 by remembering when the kernel tells us the next one will block. [Jeff Trawick] From ac391f524a6256911c90d4e8460d18dbd1345c57 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 29 Apr 2002 08:39:42 +0000 Subject: [PATCH 3301/7878] Restore after bumping the tag git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63310 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index e5414a43b24..8b36eaa6915 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Don't try to use /dev/zero and mmap on platforms that don't + support that (such as HP-UX). PR 8537. [Justin Erenkrantz] + *) Reduce the number of apr_sendfile calls on AIX and OS/390 by remembering when the kernel tells us the next one will block. [Jeff Trawick] From 01e94a7cd26eae78ed920bb75c63d197d0a99980 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 29 Apr 2002 08:45:12 +0000 Subject: [PATCH 3302/7878] Sigh, introduced some whitespace when restoring this file... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63311 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8b36eaa6915..3e44f79573f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,7 @@ Changes with APR b1 *) Don't try to use /dev/zero and mmap on platforms that don't - support that (such as HP-UX). PR 8537. [Justin Erenkrantz] + support that (such as HP-UX). PR 8537. [Justin Erenkrantz] *) Reduce the number of apr_sendfile calls on AIX and OS/390 by remembering when the kernel tells us the next one will block. From aacbde8ddebb89f89bab2c644a466d4ceb8ff71a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 29 Apr 2002 11:03:14 +0000 Subject: [PATCH 3303/7878] provide a cross-compilation default in the /dev/zero check to avoid an autoconf warning git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63312 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 3e2fd3800c1..32fb13b8829 100644 --- a/configure.in +++ b/configure.in @@ -618,7 +618,7 @@ if test "$ac_cv_func_mmap" = "yes" && return 3; } return 0; - }], [], [ac_cv_file__dev_zero=no]) + }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no]) AC_MSG_RESULT($ac_cv_file__dev_zero) fi From cb0d042b6f8ee79f2d887e81aa2d8fb5bad6f8b8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 29 Apr 2002 12:49:57 +0000 Subject: [PATCH 3304/7878] Ummm, has anyone even considered maintaining this since GA? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63313 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_compat.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/apr_compat.h b/include/apr_compat.h index 23a307ae09d..c545b50c94c 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -11,6 +11,15 @@ * @{ */ +/* changes between APACHE_2_0_35 and APACHE_2_0_36 + +/** @deprecated @see apr_time_exp_tz */ +#define apr_explode_time apr_time_exp_tz +/** @deprecated @see apr_time_exp_lt */ +#define apr_explode_localtime apr_time_exp_lt +/** @deprecated @see apr_group_name_get */ +#define apr_get_groupname apr_group_name_get + /* redefine 1.3.x symbols to those that now live in libapr */ /** @see APR_INLINE */ From d38c7e52ed4d47bb223906927e5f3b734d745e14 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 29 Apr 2002 13:40:18 +0000 Subject: [PATCH 3305/7878] It's just a jump to the left... and a step to the right... Some things are easier to follow when you leave them in the natural order of things. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63314 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 1eb5ba9fe36..fdce23856db 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -340,8 +340,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, DWORD dwCreationFlags = 0; new->in = attr->parent_in; - new->err = attr->parent_err; new->out = attr->parent_out; + new->err = attr->parent_err; if (attr->detached) { /* If we are creating ourselves detached, Then we should hide the From d1d57ea4ed9a0b65298d7ef76af4521bc9a542ad Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 29 Apr 2002 14:41:14 +0000 Subject: [PATCH 3306/7878] add a missing comment delimiter git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63315 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_compat.h b/include/apr_compat.h index c545b50c94c..a82cdc239bd 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -11,7 +11,7 @@ * @{ */ -/* changes between APACHE_2_0_35 and APACHE_2_0_36 +/* changes between APACHE_2_0_35 and APACHE_2_0_36 */ /** @deprecated @see apr_time_exp_tz */ #define apr_explode_time apr_time_exp_tz From 8cc85ea386d2ca67f5d2a8cc629eb2d4eca8b5e8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 29 Apr 2002 15:51:11 +0000 Subject: [PATCH 3307/7878] Doesn't fix anything. Just makes it more convienent to maintain apr_app.c (the alternative to apr_app_initialize -only- for WINNT app builds.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63316 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 5 +++++ libapr.dsp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/apr.dsp b/apr.dsp index 5976c9c529e..83625e58237 100644 --- a/apr.dsp +++ b/apr.dsp @@ -198,6 +198,11 @@ SOURCE=.\memory\unix\apr_pools.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\misc\win32\apr_app.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index 0f4ef994bf3..c0b39f16ae8 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -204,6 +204,11 @@ SOURCE=.\memory\unix\apr_pools.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\misc\win32\apr_app.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File From 0d069dbd4d7ddeaf92ae99b754329cf532ab393e Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 30 Apr 2002 01:25:38 +0000 Subject: [PATCH 3308/7878] Remove APR_WANT_SIGNAL from apr_want.h because code must include apr_signal.h in order to get consistent definitions. In general, apr_want.h is a bad idea and should be replaced with topic-specific header files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63317 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_signal.h | 6 +++--- include/apr_want.h | 13 ------------- threadproc/netware/signals.c | 3 --- threadproc/unix/signals.c | 3 --- 5 files changed, 6 insertions(+), 22 deletions(-) diff --git a/CHANGES b/CHANGES index 3e44f79573f..3534ce635f7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Remove APR_WANT_SIGNAL from apr_want.h because code must include + apr_signal.h in order to get consistent definitions. [Roy Fielding] + *) Don't try to use /dev/zero and mmap on platforms that don't support that (such as HP-UX). PR 8537. [Justin Erenkrantz] diff --git a/include/apr_signal.h b/include/apr_signal.h index 000542aed25..9eaca111c39 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -62,9 +62,9 @@ #include "apr.h" #include "apr_pools.h" -#define APR_WANT_SIGNAL -#include "apr_want.h" - +#if APR_HAVE_SIGNAL_H +#include +#endif #ifdef __cplusplus extern "C" { diff --git a/include/apr_want.h b/include/apr_want.h index 5da3d9061fb..5d62846b1ab 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -64,7 +64,6 @@ * APR_WANT_MEMFUNC: memcmp, memcpy, etc * APR_WANT_STDIO: and related bits * APR_WANT_IOVEC: struct iovec - * APR_WANT_SIGNAL: signal numbers, functions, and types * APR_WANT_BYTEFUNC: htons, htonl, ntohl, ntohs * * Typical usage: @@ -129,18 +128,6 @@ /* --------------------------------------------------------------------- */ -#ifdef APR_WANT_SIGNAL - -#if APR_HAVE_SIGNAL_H -#include -#endif -/* ### some platforms may put this into unistd.h ?? */ - -#undef APR_WANT_SIGNAL -#endif - -/* --------------------------------------------------------------------- */ - #ifdef APR_WANT_BYTEFUNC /* Single Unix says they are in arpa/inet.h. Linux has them in diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c index b6aaefdfbbb..20f94641a3a 100644 --- a/threadproc/netware/signals.c +++ b/threadproc/netware/signals.c @@ -59,9 +59,6 @@ #include "apr_signal.h" #include "apr_strings.h" -#define APR_WANT_SIGNAL -#include "apr_want.h" - #include #if APR_HAS_THREADS && APR_HAVE_PTHREAD_H #include diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 5659c920086..f42e82b5fd2 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -59,9 +59,6 @@ #include "apr_signal.h" #include "apr_strings.h" -#define APR_WANT_SIGNAL -#include "apr_want.h" - #include #if APR_HAS_THREADS && APR_HAVE_PTHREAD_H #include From 5e40bfc29faa1e98750b4574f44d4f840939a889 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Tue, 30 Apr 2002 05:07:03 +0000 Subject: [PATCH 3309/7878] fix compile break git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63318 13f79535-47bb-0310-9956-ffa450edef68 --- test/testvsn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testvsn.c b/test/testvsn.c index adf97eeb614..ad4b7d722db 100644 --- a/test/testvsn.c +++ b/test/testvsn.c @@ -55,6 +55,7 @@ #include #include "apr_version.h" +#include "apr_general.h" int main(int argc, char **argv) From 559ad341c1709c4b7dd90419d4a6bcf0c3e8c66e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 30 Apr 2002 10:57:40 +0000 Subject: [PATCH 3310/7878] don't require that the DNS can map 127.0.0.1 when checking for the presence/usability of getnameinfo() PR: 7642 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63319 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ build/apr_network.m4 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 3534ce635f7..adff3f6dd0a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Don't require that the DNS can map 127.0.0.1 when checking for + the presence/usability of getnameinfo(). PR 7642. [Jeff Trawick] + *) Remove APR_WANT_SIGNAL from apr_want.h because code must include apr_signal.h in order to get consistent definitions. [Roy Fielding] diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 1f282e563fd..406c15b6350 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -93,7 +93,7 @@ void main(void) { error = getnameinfo((const struct sockaddr *)&sa, sizeof(sa), hbuf, 256, NULL, 0, - NI_NAMEREQD); + NI_NUMERICHOST); if (error) { exit(1); } else { From 87ffd11cd49f06eec9d6851f4dbe479f9c48ef56 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 30 Apr 2002 13:37:27 +0000 Subject: [PATCH 3311/7878] ignore generated files git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63320 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/os390/.cvsignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 atomic/os390/.cvsignore diff --git a/atomic/os390/.cvsignore b/atomic/os390/.cvsignore new file mode 100755 index 00000000000..2ebd06d3517 --- /dev/null +++ b/atomic/os390/.cvsignore @@ -0,0 +1,4 @@ +Makefile +*.lo +.libs +.deps From 7fd93b3e651bb0b50cefa7056c17319602d87bed Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 30 Apr 2002 23:43:28 +0000 Subject: [PATCH 3312/7878] Remove Linux atomic support as this is most definitely not meant for userspace applications. We will have to come up with processor-specific implementations, but we can not rely on Linux to help us here. So, remove this. Linux will now use the fallback atomic implementation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63321 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 4ecd19e32ba..4bee92df987 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -154,25 +154,6 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #define apr_atomic_cas(mem,with,cmp) InterlockedCompareExchange(mem,with,cmp) #define apr_atomic_init(pool) APR_SUCCESS -#elif defined(__linux) - -#include -#include -#include -#define apr_atomic_t atomic_t - -#define apr_atomic_add(mem, val) atomic_add(val,mem) -#define apr_atomic_dec(mem) !atomic_dec_and_test(mem) -#define apr_atomic_inc(mem) atomic_inc(mem) -#define apr_atomic_set(mem, val) atomic_set(mem, val) -#define apr_atomic_read(mem) atomic_read(mem) -#if defined(cmpxchg) -#define apr_atomic_init(pool) APR_SUCCESS -#define apr_atomic_cas(mem,with,cmp) cmpxchg(mem,cmp,with) -#else -#define APR_ATOMIC_NEED_CAS_DEFAULT 1 -#endif - #elif defined(NETWARE) #include From 92b4de5e76e92e84b7ab4eb9f25ac0cc2d75f337 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 30 Apr 2002 23:45:27 +0000 Subject: [PATCH 3313/7878] Make the () style consistent for read and set macros. This should resolve potential problems using complicated expressions in read/set. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63322 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 4bee92df987..0848e481f08 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -150,7 +150,7 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #define apr_atomic_dec(mem) InterlockedDecrement(mem) #define apr_atomic_inc(mem) InterlockedIncrement(mem) #define apr_atomic_set(mem, val) InterlockedExchange(mem, val) -#define apr_atomic_read(mem) *mem +#define apr_atomic_read(mem) (*mem) #define apr_atomic_cas(mem,with,cmp) InterlockedCompareExchange(mem,with,cmp) #define apr_atomic_init(pool) APR_SUCCESS @@ -179,7 +179,7 @@ APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); #define apr_atomic_dec(mem) atomic_subtract_int(mem,1) #define apr_atomic_inc(mem) atomic_add_int(mem,1) #define apr_atomic_set(mem, val) atomic_set_int(mem, val) -#define apr_atomic_read(mem) *mem +#define apr_atomic_read(mem) (*mem) #define APR_ATOMIC_NEED_CAS_DEFAULT 1 @@ -191,7 +191,7 @@ APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); #define apr_atomic_dec(mem) apr_atomic_sub_sparc(mem,1) #define apr_atomic_inc(mem) apr_atomic_add_sparc(mem,1) #define apr_atomic_cas(mem,val,cond) apr_atomic_cas_sparc(mem,val,cond) -#define apr_atomic_set(mem, val) *mem= val +#define apr_atomic_set(mem, val) (*mem = val) #define apr_atomic_init(pool) APR_SUCCESS apr_uint32_t apr_atomic_add_sparc(volatile apr_atomic_t *mem, apr_uint32_t add); @@ -219,8 +219,8 @@ apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem, apr_uint32_t swap, * variables with other apr_atomic_* operations on OS/390. */ -#define apr_atomic_read(p) *p -#define apr_atomic_set(mem, val) *mem= val +#define apr_atomic_read(p) (*p) +#define apr_atomic_set(mem, val) (*mem = val) #else #if APR_HAS_THREADS From bdae55aa3016e2c35d843df8164bba27e5a39fb8 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 30 Apr 2002 23:49:41 +0000 Subject: [PATCH 3314/7878] Add --disable-atomics flag which will prevent APR from using its *own* optimized code. On those OSes that properly support atomics from userspace, we will use those no matter what the user specifies. Therefore, this change only affects Solaris/Sparc - if --disable-atomics is passed, we will use APR's generic code. Rewrite/simplify Sparc CPU m4 test to make more sense. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63323 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 50 +++++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/configure.in b/configure.in index 32fb13b8829..8a251d7dcb4 100644 --- a/configure.in +++ b/configure.in @@ -304,6 +304,14 @@ dnl we are using for the more up to date cpu/OS dnl (ie.. old sparcs) apr_force_atomic_generic=0 proc_mutex_is_global=0 +user_disabled_atomics=0 + +AC_ARG_ENABLE(atomics, + [ --disable-atomics Turn off optimized atomic code], + [ if test "$enableval" = "no"; then + user_disabled_atomics=1 + fi ], [] ) + config_subdirs="none" INSTALL_SUBDIRS="none" @@ -356,43 +364,39 @@ case $host in ;; *sun*) case $host_cpu in - *sparc*) + *sparc*) OSDIR="solaris_sparc" eolstr="\\n" - apr_atomic_sparc_compile=apr_atomic_sparc.lo - sparc_arch=`uname -m` - is_gnu_as=`${AS} --help 2>/dev/null | grep gnu.org` - if test -n "$is_gnu_as" - then - case "$sparc_arch" in - sun4c|sun4m|sun4d|sun4t|sun4) - apr_force_atomic_generic=1 - apr_atomic_sparc_compile=apr_atomic_sparc_no_support.lo - ;; - *) + if test "$user_disabled_atomics" = 0; then + apr_atomic_sparc_compile=apr_atomic_sparc.lo + sparc_arch=`uname -m` + is_gnu_as=`${AS} --help 2>/dev/null | grep gnu.org` + case "$sparc_arch" in + sun4c|sun4m|sun4d|sun4t|sun4) + apr_force_atomic_generic=1 + apr_atomic_sparc_compile=apr_atomic_sparc_no_support.lo + ;; + *) + if test -n "$is_gnu_as"; then ASFLAGS="-xarch=v8plus -K PIC" ASCPPFLAGS="-traditional-cpp -D_ASM -D__STDC__=0" ASCPP="gcc -E" - ;; - esac - else - case "$sparc_arch" in - sun4c|sun4m|sun4d|sun4t|sun4) - apr_force_atomic_generic=1 - apr_atomic_sparc_compile=apr_atomic_sparc_no_support.lo - ;; - *) + else ASFLAGS="-K pic -P -D_ASM -D__STDC__=0 -xarch=v8plus" ASCPPFLAGS="" ASCPP="cat" - ;; + fi + ;; esac + else + apr_force_atomic_generic=1 + apr_atomic_sparc_compile=apr_atomic_sparc_no_support.lo fi AC_SUBST(ASCPPFLAGS) AC_SUBST(ASFLAGS) AC_SUBST(apr_atomic_sparc_compile) ;; - *) + *) OSDIR="unix" eolstr="\\n" ;; From de8436f8c5f018ee253cbbfeecf52df8d4296f93 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 1 May 2002 00:00:02 +0000 Subject: [PATCH 3315/7878] Fix brain damage from last commit (remove bogus [] and blank line) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63324 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 8a251d7dcb4..7a86ac878d6 100644 --- a/configure.in +++ b/configure.in @@ -310,8 +310,7 @@ AC_ARG_ENABLE(atomics, [ --disable-atomics Turn off optimized atomic code], [ if test "$enableval" = "no"; then user_disabled_atomics=1 - fi ], [] ) - + fi ] ) config_subdirs="none" INSTALL_SUBDIRS="none" From d0af8c12ad78f179c283d801beb411b2b6ccf576 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 1 May 2002 00:22:42 +0000 Subject: [PATCH 3316/7878] - Make this more legible (style police) - Modify output to indicate that the threads may take a while to complete (No compelling functional changes.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63325 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 124 ++++++++++++++++++++++++++-------------------- 1 file changed, 71 insertions(+), 53 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index 0d15c31a180..a85fed6e7ae 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -83,58 +83,59 @@ apr_atomic_t y; /* atomic locks */ static apr_status_t check_basic_atomics(volatile apr_atomic_t*p) { apr_uint32_t oldval; - apr_uint32_t casval=0; - apr_atomic_set(&y,2); + apr_uint32_t casval = 0; + apr_atomic_set(&y, 2); printf("%-60s", "testing apr_atomic_dec"); - if ( apr_atomic_dec(&y) == 0 ) { - fprintf(stderr, "Failed\noldval =%d should not be zero\n",apr_atomic_read(&y)); + if (apr_atomic_dec(&y) == 0) { + fprintf(stderr, "Failed\noldval =%d should not be zero\n", + apr_atomic_read(&y)); return APR_EGENERAL; } - if ( apr_atomic_dec(&y) != 0 ) { - fprintf(stderr, "Failed\noldval =%d should be zero\n",apr_atomic_read(&y)); + if (apr_atomic_dec(&y) != 0) { + fprintf(stderr, "Failed\noldval =%d should be zero\n", + apr_atomic_read(&y)); return APR_EGENERAL; } printf("OK\n"); printf("%-60s", "testing CAS"); - oldval = apr_atomic_cas(&casval,12,0); + oldval = apr_atomic_cas(&casval, 12, 0); if (oldval != 0) { - fprintf(stderr, "Failed\noldval =%d should be zero\n",oldval); + fprintf(stderr, "Failed\noldval =%d should be zero\n", oldval); return APR_EGENERAL; } printf("OK\n"); printf("%-60s", "testing CAS - match non-null"); - oldval = apr_atomic_cas(&casval,23,12); + oldval = apr_atomic_cas(&casval, 23, 12); if (oldval != 12) { fprintf(stderr, "Failed\noldval =%d should be 12 y=%d\n", - oldval, - casval); + oldval, casval); return APR_EGENERAL; } printf("OK\n"); printf("%-60s", "testing CAS - no match"); - oldval = apr_atomic_cas(&casval,23,12); - if (oldval != 23 ) { + oldval = apr_atomic_cas(&casval, 23, 12); + if (oldval != 23) { fprintf(stderr, "Failed\noldval =%d should be 23 y=%d\n", - oldval, - casval); + oldval, casval); return APR_EGENERAL; } printf("OK\n"); printf("%-60s", "testing add"); - apr_atomic_set(&y,23); - apr_atomic_add(&y,4); + apr_atomic_set(&y, 23); + apr_atomic_add(&y, 4); if (apr_atomic_read(&y) != 27) { - fprintf(stderr, "Failed\nAtomic Add doesn't add up ;( expected 27 got %d\n", - oldval); - exit(-1); + fprintf(stderr, + "Failed\nAtomic Add doesn't add up ;( expected 27 got %d\n", + oldval); + return APR_EGENERAL; } printf("OK\n"); printf("%-60s", "testing add/inc"); - apr_atomic_set(&y,0); - apr_atomic_add(&y,20); + apr_atomic_set(&y, 0); + apr_atomic_add(&y, 20); apr_atomic_inc(&y); if (apr_atomic_read(&y) != 21) { fprintf(stderr, "Failed.\natomics do not add up\n"); @@ -217,6 +218,7 @@ void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data) apr_thread_exit(thd, exit_ret_val); return NULL; } + void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data) { int i; @@ -240,15 +242,18 @@ int main(int argc, char**argv) apr_status_t s2[NUM_THREADS]; apr_status_t rv; int i; - int mutex=0; + int mutex; apr_initialize(); - if (argc==2 && argv[1][0]=='m') - mutex=1; + if (argc == 2 && argv[1][0] == 'm') { + mutex = 1; + } + else { + mutex = 0; + } - printf("APR Simple Thread Test\n======================\n\n"); - + printf("APR Atomic Test\n===============\n\n"); #if !(defined WIN32) && !(defined NETWARE) && !(defined __MVS__) pthread_setconcurrency(8); #endif @@ -262,7 +267,7 @@ int main(int argc, char**argv) apr_thread_once_init(&control, context); - if (mutex==1) { + if (mutex == 1) { printf("%-60s", "Initializing the lock"); rv = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, context); @@ -273,22 +278,28 @@ int main(int argc, char**argv) } printf("OK\n"); } - rv = apr_atomic_init( context); + printf("%-60s", "Initializing the atomics"); + rv = apr_atomic_init(context); + if (rv != APR_SUCCESS) { + fprintf(stderr, "Failed.\n"); + exit(-1); + } + printf("OK\n"); rv = check_basic_atomics(&y); if (rv != APR_SUCCESS) { fprintf(stderr, "Failed.\n"); exit(-1); } - apr_atomic_set(&y,0); + apr_atomic_set(&y, 0); printf("%-60s", "Starting all the threads"); - for (i=0;i Date: Wed, 1 May 2002 00:25:26 +0000 Subject: [PATCH 3317/7878] Crazy Love git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63326 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index adff3f6dd0a..2e5f6fe7119 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,12 @@ Changes with APR b1 + *) Add --disable-atomics switch to override our handcoded assembly + optimizations. Note that this has no effect if your operating + system has a userspace atomic interface. [Justin Erenkrantz] + + *) Remove Linux atomic support since it does not have a usable + userspace atomic interface. [Justin Erenkrantz] + *) Don't require that the DNS can map 127.0.0.1 when checking for the presence/usability of getnameinfo(). PR 7642. [Jeff Trawick] From 786178938943300cb6265d8c71601396945e6879 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 1 May 2002 00:29:16 +0000 Subject: [PATCH 3318/7878] My thoughts on the atomics. I'm on the fence. But, I don't buy the binary argument as compelling reason to remove it. IMHO, non-maintainership *is*. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63327 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index ccbf9f32432..17ffc9d541c 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/04/26 17:28:20 $] +Last modified at [$Date: 2002/05/01 00:29:16 $] Release: @@ -63,6 +63,11 @@ CURRENT VOTES: goals of APR, and I hereby propose that we remove it from APR. +1: Aaron + -0: Justin (I think it's warranted and fits with our portability + goals, but I'm not going to spend my time supporting it - + although I have spent more time on this than I'd like. + If someone wants to maintain it, more power to them. If + no one maintains it, this gets changed to a +1.) RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From a90beb9cfa11a8a0d2d43dbd3bfa7dcdd3e57c26 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 1 May 2002 10:39:05 +0000 Subject: [PATCH 3319/7878] Update prior to bumping the tag git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63328 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CHANGES b/CHANGES index 2e5f6fe7119..3ad702b3f52 100644 --- a/CHANGES +++ b/CHANGES @@ -10,12 +10,6 @@ Changes with APR b1 *) Don't require that the DNS can map 127.0.0.1 when checking for the presence/usability of getnameinfo(). PR 7642. [Jeff Trawick] - *) Remove APR_WANT_SIGNAL from apr_want.h because code must include - apr_signal.h in order to get consistent definitions. [Roy Fielding] - - *) Don't try to use /dev/zero and mmap on platforms that don't - support that (such as HP-UX). PR 8537. [Justin Erenkrantz] - *) Reduce the number of apr_sendfile calls on AIX and OS/390 by remembering when the kernel tells us the next one will block. [Jeff Trawick] From 5cc45a008fec4cff805d15b9f2982593f730db76 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 1 May 2002 10:40:44 +0000 Subject: [PATCH 3320/7878] Temporarily revert change prior to bumping the tag. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63329 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/configure.in b/configure.in index 7a86ac878d6..677b3ede82d 100644 --- a/configure.in +++ b/configure.in @@ -594,38 +594,6 @@ AC_CHECK_HEADERS(kernel/OS.h) AC_CHECK_FUNCS(create_area) AC_CHECK_HEADERS(os2.h) -dnl Not all systems can mmap /dev/zero (such as HP-UX). Check for that. -if test "$ac_cv_func_mmap" = "yes" && - test "$ac_cv_file__dev_zero" = "yes"; then - AC_MSG_CHECKING(for mmap that can map /dev/zero) - AC_TRY_RUN([ -#include -#include -#include -#ifdef HAVE_SYS_MMAN_H -#include -#endif - int main() - { - int fd; - void *m; - fd = open("/dev/zero", O_RDWR); - if (fd < 0) { - return 1; - } - m = mmap(0, sizeof(void*), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); - if (m < 0) { /* aka MAP_FAILED */ - return 2; - } - if (munmap(m, sizeof(void*)) < 0) { - return 3; - } - return 0; - }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no]) - - AC_MSG_RESULT($ac_cv_file__dev_zero) -fi - dnl Now we determine which one is our anonymous shmem preference. haveshmgetanon="0" havemmapzero="0" @@ -1280,6 +1248,7 @@ dnl #----------------------------- Checking for Locking Characteristics echo $ac_n "${nl}Checking for Locking...${nl}" AC_CHECK_FUNCS(semget semctl flock) +APR_CHECK_FILE(/dev/zero) AC_CHECK_HEADERS(semaphore.h) AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait) From fdffd6547de22ea20457ec1fd62010bb8554c520 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 1 May 2002 10:41:59 +0000 Subject: [PATCH 3321/7878] remove some linux comments Submitted by: Joe Orton Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63330 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 0848e481f08..b94b8aa7194 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -93,8 +93,8 @@ apr_status_t apr_atomic_init(apr_pool_t *p); /** * read the value stored in a atomic variable * @param the pointer - * @warning on certain platforms (linux) this number is not - * stored directly in the pointer. in others it is + * @warning on certain platforms this number is not stored + * directly in the pointer. in others it is */ apr_uint32_t apr_atomic_read(volatile apr_atomic_t *mem); /** @@ -228,7 +228,7 @@ apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem, apr_uint32_t swap, #define APR_ATOMIC_NEED_CAS_DEFAULT 1 #endif /* APR_HAS_THREADS */ -#endif /* !defined(WIN32) && !defined(__linux) */ +#endif /* !defined(WIN32) */ #if defined(APR_ATOMIC_NEED_DEFAULT) #define apr_atomic_t apr_uint32_t From 1b41ca2e107512ee7d029446e1e774ba445f21c3 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 1 May 2002 10:47:03 +0000 Subject: [PATCH 3322/7878] Restore after the tag git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63331 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 3ad702b3f52..2e5f6fe7119 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,12 @@ Changes with APR b1 *) Don't require that the DNS can map 127.0.0.1 when checking for the presence/usability of getnameinfo(). PR 7642. [Jeff Trawick] + *) Remove APR_WANT_SIGNAL from apr_want.h because code must include + apr_signal.h in order to get consistent definitions. [Roy Fielding] + + *) Don't try to use /dev/zero and mmap on platforms that don't + support that (such as HP-UX). PR 8537. [Justin Erenkrantz] + *) Reduce the number of apr_sendfile calls on AIX and OS/390 by remembering when the kernel tells us the next one will block. [Jeff Trawick] From e218a106baa43e515c05938e069433ec534d9e97 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 1 May 2002 10:47:37 +0000 Subject: [PATCH 3323/7878] Restore after the tag. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63332 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 677b3ede82d..7a86ac878d6 100644 --- a/configure.in +++ b/configure.in @@ -594,6 +594,38 @@ AC_CHECK_HEADERS(kernel/OS.h) AC_CHECK_FUNCS(create_area) AC_CHECK_HEADERS(os2.h) +dnl Not all systems can mmap /dev/zero (such as HP-UX). Check for that. +if test "$ac_cv_func_mmap" = "yes" && + test "$ac_cv_file__dev_zero" = "yes"; then + AC_MSG_CHECKING(for mmap that can map /dev/zero) + AC_TRY_RUN([ +#include +#include +#include +#ifdef HAVE_SYS_MMAN_H +#include +#endif + int main() + { + int fd; + void *m; + fd = open("/dev/zero", O_RDWR); + if (fd < 0) { + return 1; + } + m = mmap(0, sizeof(void*), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); + if (m < 0) { /* aka MAP_FAILED */ + return 2; + } + if (munmap(m, sizeof(void*)) < 0) { + return 3; + } + return 0; + }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no]) + + AC_MSG_RESULT($ac_cv_file__dev_zero) +fi + dnl Now we determine which one is our anonymous shmem preference. haveshmgetanon="0" havemmapzero="0" @@ -1248,7 +1280,6 @@ dnl #----------------------------- Checking for Locking Characteristics echo $ac_n "${nl}Checking for Locking...${nl}" AC_CHECK_FUNCS(semget semctl flock) -APR_CHECK_FILE(/dev/zero) AC_CHECK_HEADERS(semaphore.h) AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait) From 6765b1deb3a94884b4f87e30e756f880b6f418c3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 1 May 2002 17:26:31 +0000 Subject: [PATCH 3324/7878] Small fix for beos networking. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63333 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/poll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index 2d12bab6dcf..96515612251 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -234,7 +234,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, return APR_TIMEUP; } if ((*nsds) < 0) { - return APR_EEXIST; + return errno; } return APR_SUCCESS; } From 233213e247f3498fff9e41026d748343fbb68d72 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Wed, 1 May 2002 19:06:23 +0000 Subject: [PATCH 3325/7878] Added a call for votes on turning apr_pcalloc into a macro, plus my thoughts on the atomic API git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63334 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 17ffc9d541c..26aac7e0b29 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/01 00:29:16 $] +Last modified at [$Date: 2002/05/01 19:06:23 $] Release: @@ -67,7 +67,22 @@ CURRENT VOTES: goals, but I'm not going to spend my time supporting it - although I have spent more time on this than I'd like. If someone wants to maintain it, more power to them. If - no one maintains it, this gets changed to a +1.) + no one maintains it, this gets changed to a +1.), + BrianP (All the reasons why we don't want the processor-specific + code in APR are also reasons why I don't want to push + that code up into the apps that use APR. I'd rather + spend some more time searching for a workable solution + before we give up on atomics. Perhaps we should let + apps using the atomic API set a preprocessor flag to + choose an "optimal" or "portable" version of the atomic + ops?) + + * Turn apr_pcalloc into a macro that does apr_palloc+memset, to take + advantage of compiler optimizations when the size of the block being + passed to memset is known at compile time. + + +1: BrianP + RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From c41ca15eff2a792357a7cc8a4a6a4360bc0db619 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 1 May 2002 19:22:23 +0000 Subject: [PATCH 3326/7878] Well, yeah. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63335 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 26aac7e0b29..59a5216983f 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/01 19:06:23 $] +Last modified at [$Date: 2002/05/01 19:22:23 $] Release: @@ -81,7 +81,7 @@ CURRENT VOTES: advantage of compiler optimizations when the size of the block being passed to memset is known at compile time. - +1: BrianP + +1: BrianP, Justin RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From 971fb65bfd6ee6c5f6d231df51bce64bf31b9b54 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 1 May 2002 20:09:30 +0000 Subject: [PATCH 3327/7878] My vote on apr_pcalloc. And my opinion on atomics. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63336 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 59a5216983f..68eaeb8e1c8 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/01 19:22:23 $] +Last modified at [$Date: 2002/05/01 20:09:30 $] Release: @@ -76,12 +76,16 @@ CURRENT VOTES: apps using the atomic API set a preprocessor flag to choose an "optimal" or "portable" version of the atomic ops?) + Sander (The positive sides of the atomics outweigh the negative + in my opinion. That said, I am not going to be the + one spending time on this, since asm on various + processors isn't really my game) * Turn apr_pcalloc into a macro that does apr_palloc+memset, to take advantage of compiler optimizations when the size of the block being passed to memset is known at compile time. - +1: BrianP, Justin + +1: BrianP, Justin, Sander RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From f6752122da724ac0bd86d35e58d150ee72afcf93 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 1 May 2002 20:27:11 +0000 Subject: [PATCH 3328/7878] Allow the build to succeed on beos by setting this correctly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63337 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index 7a86ac878d6..a9836c2c770 100644 --- a/configure.in +++ b/configure.in @@ -338,6 +338,7 @@ case $host in APR_CHECK_DEFINE(BONE_VERSION, sys/socket.h) eolstr="\\n" osver=`uname -r` + proc_mutex_is_global=1 case $osver in 5.0.4) file_as_socket="1" From 71c0c3f47c45daa2fa1010d9db01d53497810f18 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 1 May 2002 20:43:13 +0000 Subject: [PATCH 3329/7878] Temporarily revert this change to get another change in the roll. /me wants subversion... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63338 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/configure.in b/configure.in index a9836c2c770..2458995077b 100644 --- a/configure.in +++ b/configure.in @@ -595,38 +595,6 @@ AC_CHECK_HEADERS(kernel/OS.h) AC_CHECK_FUNCS(create_area) AC_CHECK_HEADERS(os2.h) -dnl Not all systems can mmap /dev/zero (such as HP-UX). Check for that. -if test "$ac_cv_func_mmap" = "yes" && - test "$ac_cv_file__dev_zero" = "yes"; then - AC_MSG_CHECKING(for mmap that can map /dev/zero) - AC_TRY_RUN([ -#include -#include -#include -#ifdef HAVE_SYS_MMAN_H -#include -#endif - int main() - { - int fd; - void *m; - fd = open("/dev/zero", O_RDWR); - if (fd < 0) { - return 1; - } - m = mmap(0, sizeof(void*), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); - if (m < 0) { /* aka MAP_FAILED */ - return 2; - } - if (munmap(m, sizeof(void*)) < 0) { - return 3; - } - return 0; - }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no]) - - AC_MSG_RESULT($ac_cv_file__dev_zero) -fi - dnl Now we determine which one is our anonymous shmem preference. haveshmgetanon="0" havemmapzero="0" @@ -1281,6 +1249,7 @@ dnl #----------------------------- Checking for Locking Characteristics echo $ac_n "${nl}Checking for Locking...${nl}" AC_CHECK_FUNCS(semget semctl flock) +APR_CHECK_FILE(/dev/zero) AC_CHECK_HEADERS(semaphore.h) AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait) From 28a4df2f06c81b6fb21245f01f9f35e01e104fdc Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 1 May 2002 20:44:58 +0000 Subject: [PATCH 3330/7878] And restore it again... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63340 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 2458995077b..a9836c2c770 100644 --- a/configure.in +++ b/configure.in @@ -595,6 +595,38 @@ AC_CHECK_HEADERS(kernel/OS.h) AC_CHECK_FUNCS(create_area) AC_CHECK_HEADERS(os2.h) +dnl Not all systems can mmap /dev/zero (such as HP-UX). Check for that. +if test "$ac_cv_func_mmap" = "yes" && + test "$ac_cv_file__dev_zero" = "yes"; then + AC_MSG_CHECKING(for mmap that can map /dev/zero) + AC_TRY_RUN([ +#include +#include +#include +#ifdef HAVE_SYS_MMAN_H +#include +#endif + int main() + { + int fd; + void *m; + fd = open("/dev/zero", O_RDWR); + if (fd < 0) { + return 1; + } + m = mmap(0, sizeof(void*), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); + if (m < 0) { /* aka MAP_FAILED */ + return 2; + } + if (munmap(m, sizeof(void*)) < 0) { + return 3; + } + return 0; + }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no]) + + AC_MSG_RESULT($ac_cv_file__dev_zero) +fi + dnl Now we determine which one is our anonymous shmem preference. haveshmgetanon="0" havemmapzero="0" @@ -1249,7 +1281,6 @@ dnl #----------------------------- Checking for Locking Characteristics echo $ac_n "${nl}Checking for Locking...${nl}" AC_CHECK_FUNCS(semget semctl flock) -APR_CHECK_FILE(/dev/zero) AC_CHECK_HEADERS(semaphore.h) AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait) From 3e0f36716050cbc163f7b3990db4fc19f9363808 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Wed, 1 May 2002 22:50:45 +0000 Subject: [PATCH 3331/7878] Or'ing NSLINKMODULE_OPTION_NONE is verbose. Darwin comment is true on all platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63341 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index a9b22b28ea3..b92ae669d5c 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -126,18 +126,10 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, NSModule os_handle = NULL; char* err_msg = NULL; if (NSCreateObjectFileImageFromFile(path, &image) == NSObjectFileImageSuccess) { - -/* - * Under Darwin, we want/need to place dynamically loaded extensions' - * public symbols into the global symbol table. As long as modules - * don't have overlapping symbols, we're golden. - */ -#if defined(NSLINKMODULE_OPTION_NONE) - os_handle = NSLinkModule(image, path, - NSLINKMODULE_OPTION_NONE | - NSLINKMODULE_OPTION_RETURN_ON_ERROR); +#if defined(NSLINKMODULE_OPTION_RETURN_ON_ERROR) + handle = NSLinkModule(image, path, NSLINKMODULE_OPTION_RETURN_ON_ERROR); #else - os_handle = NSLinkModule(image, path, FALSE); + handle = NSLinkModule(image, path, FALSE); #endif NSDestroyObjectFileImage(image); } From 5e06719148ad5a47c4f3bc2870bcd79b48faaa4a Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 1 May 2002 23:08:26 +0000 Subject: [PATCH 3332/7878] Fix compile breakage PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63342 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index b92ae669d5c..b32dbafc703 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -127,9 +127,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, char* err_msg = NULL; if (NSCreateObjectFileImageFromFile(path, &image) == NSObjectFileImageSuccess) { #if defined(NSLINKMODULE_OPTION_RETURN_ON_ERROR) - handle = NSLinkModule(image, path, NSLINKMODULE_OPTION_RETURN_ON_ERROR); + os_handle = NSLinkModule(image, path, NSLINKMODULE_OPTION_RETURN_ON_ERROR); #else - handle = NSLinkModule(image, path, FALSE); + os_handle = NSLinkModule(image, path, FALSE); #endif NSDestroyObjectFileImage(image); } From 859c76dc8acd7a5deb271ab3cecc151548f4ae2b Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 1 May 2002 23:08:45 +0000 Subject: [PATCH 3333/7878] temperature's a'risin git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63343 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 68eaeb8e1c8..a67c13c0e4e 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/01 20:09:30 $] +Last modified at [$Date: 2002/05/01 23:08:45 $] Release: @@ -76,6 +76,7 @@ CURRENT VOTES: apps using the atomic API set a preprocessor flag to choose an "optimal" or "portable" version of the atomic ops?) + Cliff (Agrees with BrianP) Sander (The positive sides of the atomics outweigh the negative in my opinion. That said, I am not going to be the one spending time on this, since asm on various @@ -85,7 +86,7 @@ CURRENT VOTES: advantage of compiler optimizations when the size of the block being passed to memset is known at compile time. - +1: BrianP, Justin, Sander + +1: BrianP, Justin, Sander, Cliff RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From 3b88c6d7711286647eebee045e5b50f642f66f96 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 1 May 2002 23:23:02 +0000 Subject: [PATCH 3334/7878] Minor formatting git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63344 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index b32dbafc703..bb3d0b6850e 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -127,7 +127,8 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, char* err_msg = NULL; if (NSCreateObjectFileImageFromFile(path, &image) == NSObjectFileImageSuccess) { #if defined(NSLINKMODULE_OPTION_RETURN_ON_ERROR) - os_handle = NSLinkModule(image, path, NSLINKMODULE_OPTION_RETURN_ON_ERROR); + os_handle = NSLinkModule(image, path, + NSLINKMODULE_OPTION_RETURN_ON_ERROR); #else os_handle = NSLinkModule(image, path, FALSE); #endif From 9b8b147bbbfe76be64440b14bbc4199ef10754db Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Wed, 1 May 2002 23:42:33 +0000 Subject: [PATCH 3335/7878] nice & sunny and able to spend time playing outside ! YAY PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63345 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index a67c13c0e4e..63b82115350 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/01 23:08:45 $] +Last modified at [$Date: 2002/05/01 23:42:33 $] Release: @@ -81,12 +81,22 @@ CURRENT VOTES: in my opinion. That said, I am not going to be the one spending time on this, since asm on various processors isn't really my game) + -1: IanH I don't agree. I think APR is the perfect place this kind of thing. + For platforms that support it is a big win, for ones which don't + they are no worse off than the alternative. + I can't maintain every asm implementation, but I am volunteering + for sparc/x86. (we could also grab the FreeBSD + implementations for HW they support) + Unfortunatly I was out of action for a month when half the + hubub was going on. + The other alternative for non-native support is maybe to turn + it into a spin lock * Turn apr_pcalloc into a macro that does apr_palloc+memset, to take advantage of compiler optimizations when the size of the block being passed to memset is known at compile time. - +1: BrianP, Justin, Sander, Cliff + +1: BrianP, Justin, Sander, Cliff, Ian RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From eb48dc6dea8c9894bf06de05f0d6fd2b9ca416ee Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 2 May 2002 00:52:01 +0000 Subject: [PATCH 3336/7878] Add apr_os_get function for global_mutexes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63346 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 19 +++++++++++++++++++ locks/unix/global_mutex.c | 12 ++++++++++++ 2 files changed, 31 insertions(+) diff --git a/include/apr_portable.h b/include/apr_portable.h index 35648dc0645..9252f4d2b2f 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -74,6 +74,7 @@ #include "apr_file_io.h" #include "apr_network_io.h" #include "apr_errno.h" +#include "apr_global_mutex.h" #include "apr_proc_mutex.h" #include "apr_time.h" #include "apr_dso.h" @@ -217,6 +218,24 @@ struct apr_os_sock_info_t { typedef struct apr_os_sock_info_t apr_os_sock_info_t; +#if APR_PROCESS_LOCK_IS_GLOBAL +#define apr_os_global_mutex_t apr_os_proc_mutex_t +#define apr_os_global_mutex_get apr_os_proc_mutex_get +#else + struct apr_os_global_mutex_t { + apr_pool_t *pool; + apr_proc_mutex_t *proc_mutex; +#if APR_HAS_THREADS + apr_thread_mutex_t *thread_mutex; +#endif /* APR_HAS_THREADS */ + }; + typedef struct apr_os_global_mutex_t apr_os_global_mutex_t; + +APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmutex, + apr_global_mutex_t *pmutex); +#endif + + /** * convert the file from apr type to os specific type. * @param thefile The os specific file we are converting to diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index 15fab9481aa..763d0b0b5a2 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -57,6 +57,7 @@ #include "global_mutex.h" #include "apr_proc_mutex.h" #include "apr_thread_mutex.h" +#include "apr_portable.h" static apr_status_t global_mutex_cleanup(void *data) { @@ -178,6 +179,17 @@ APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmutex, + apr_global_mutex_t *pmutex) +{ + ospmutex->pool = pmutex->pool; + ospmutex->proc_mutex = pmutex->proc_mutex; +#if APR_HAS_THREADS + ospmutex->thread_mutex = pmutex->thread_mutex; +#endif + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) { return apr_pool_cleanup_run(mutex->pool, mutex, global_mutex_cleanup); From fdae7720b6424c8e9100b3e7687c8011777ec681 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 2 May 2002 13:28:24 +0000 Subject: [PATCH 3337/7878] OK. This is admittedly anal. But the whole idea behind cpp macros is to avoid things like "we know NSLINKMODULE_OPTION_NONE is 0" and making such shortcuts as this. This makes it clear what exactly we are setting, and though admittedly verbose, the tradeoff of a few bytes of source is worth it :) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63347 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index bb3d0b6850e..a6d3860e203 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -126,9 +126,10 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, NSModule os_handle = NULL; char* err_msg = NULL; if (NSCreateObjectFileImageFromFile(path, &image) == NSObjectFileImageSuccess) { -#if defined(NSLINKMODULE_OPTION_RETURN_ON_ERROR) +#if defined(NSLINKMODULE_OPTION_RETURN_ON_ERROR) && defined(NSLINKMODULE_OPTION_NONE) os_handle = NSLinkModule(image, path, - NSLINKMODULE_OPTION_RETURN_ON_ERROR); + NSLINKMODULE_OPTION_RETURN_ON_ERROR | + NSLINKMODULE_OPTION_NONE); #else os_handle = NSLinkModule(image, path, FALSE); #endif From 87daa0911921e0d5516c79a6c39d0814cff47eaa Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 2 May 2002 13:45:34 +0000 Subject: [PATCH 3338/7878] Cast me vote on atomics... back from one traveling adventure to another (N+I next week) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63348 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 63b82115350..e12c7f5d602 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/01 23:42:33 $] +Last modified at [$Date: 2002/05/02 13:45:34 $] Release: @@ -81,6 +81,13 @@ CURRENT VOTES: in my opinion. That said, I am not going to be the one spending time on this, since asm on various processors isn't really my game) + Jim (who thinks we'll need to reformat this vote) Any time + you make use of processor specific code for optimizations + or capability, you run into portability concerns. The + real option is to make atomics a compile-time option. + YES means you use the atomics code, based on the *build* + machine (and therefore carries some dependencies) or + NO which maintains "universal" portabiity. -1: IanH I don't agree. I think APR is the perfect place this kind of thing. For platforms that support it is a big win, for ones which don't they are no worse off than the alternative. From 086aaf753969cce27c4edb2159a906b309e7e002 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 2 May 2002 13:50:38 +0000 Subject: [PATCH 3339/7878] Missed the most important point of my ramble git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63349 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index e12c7f5d602..e9822c66079 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/02 13:45:34 $] +Last modified at [$Date: 2002/05/02 13:50:38 $] Release: @@ -87,7 +87,8 @@ CURRENT VOTES: real option is to make atomics a compile-time option. YES means you use the atomics code, based on the *build* machine (and therefore carries some dependencies) or - NO which maintains "universal" portabiity. + NO which maintains "universal" portabiity, which is + what we have (but the default being NO atomics). -1: IanH I don't agree. I think APR is the perfect place this kind of thing. For platforms that support it is a big win, for ones which don't they are no worse off than the alternative. From 56fe8c351820a4201c6724096643d80c71f282f2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 2 May 2002 14:02:42 +0000 Subject: [PATCH 3340/7878] Small reformatting to make the votes easier to see (hopefully). Also I agree 100% with Jim, I was going to type it later today, Jim made it so I didn't have to. :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63350 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/STATUS b/STATUS index e9822c66079..fb1b91ded80 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/02 13:50:38 $] +Last modified at [$Date: 2002/05/02 14:02:42 $] Release: @@ -68,7 +68,8 @@ CURRENT VOTES: although I have spent more time on this than I'd like. If someone wants to maintain it, more power to them. If no one maintains it, this gets changed to a +1.), - BrianP (All the reasons why we don't want the processor-specific + BrianP,cliff: + (All the reasons why we don't want the processor-specific code in APR are also reasons why I don't want to push that code up into the apps that use APR. I'd rather spend some more time searching for a workable solution @@ -76,12 +77,12 @@ CURRENT VOTES: apps using the atomic API set a preprocessor flag to choose an "optimal" or "portable" version of the atomic ops?) - Cliff (Agrees with BrianP) Sander (The positive sides of the atomics outweigh the negative in my opinion. That said, I am not going to be the one spending time on this, since asm on various processors isn't really my game) - Jim (who thinks we'll need to reformat this vote) Any time + Jim,rbb: + (who thinks we'll need to reformat this vote) Any time you make use of processor specific code for optimizations or capability, you run into portability concerns. The real option is to make atomics a compile-time option. From 5598333869075cbf1071e7a1bba5e9ee501bbfa9 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 2 May 2002 15:22:40 +0000 Subject: [PATCH 3341/7878] add my vote about atomics. I agree with what Jim wrote, and most of what Ian wrote too, but don't think it would be kosher to vote multiple times. I can't help with sparc, have contributed the OS/390 atomics, and have already volunteered to help with x86. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63351 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index fb1b91ded80..e31c7c09d1a 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/02 14:02:42 $] +Last modified at [$Date: 2002/05/02 15:22:40 $] Release: @@ -68,7 +68,7 @@ CURRENT VOTES: although I have spent more time on this than I'd like. If someone wants to maintain it, more power to them. If no one maintains it, this gets changed to a +1.), - BrianP,cliff: + BrianP,cliff,gregames: (All the reasons why we don't want the processor-specific code in APR are also reasons why I don't want to push that code up into the apps that use APR. I'd rather From dbdb0ca51f88db50035daac35776629da87a7480 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Thu, 2 May 2002 19:38:17 +0000 Subject: [PATCH 3342/7878] Fix APR_STATUS_IS_ETIMEDOUT() macro, which had a stray close-paren on several platforms. Submitted by: Dagfinn Aarvaag git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63352 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_errno.h | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 2e5f6fe7119..4a5d1e78d50 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fixed APR_STATUS_IS_ETIMEDOUT macro. + [Dagfinn Aarvaag ] + *) Add --disable-atomics switch to override our handcoded assembly optimizations. Note that this has no effect if your operating system has a userspace atomic interface. [Justin Erenkrantz] diff --git a/include/apr_errno.h b/include/apr_errno.h index d02b0da5579..b4fe5d1bc5d 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -974,7 +974,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + WSAECONNRESET) #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ - || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT) \ + || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) @@ -1037,7 +1037,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + WSAECONNRESET) #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ - || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT) \ + || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) @@ -1079,7 +1079,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + WSAECONNRESET) #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ - || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT) \ + || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) From 5e982d4ad84a3b37b3e01a92fe912f41716049a1 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 2 May 2002 23:35:35 +0000 Subject: [PATCH 3343/7878] All of NetWare's locks are global git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63353 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.hnw b/include/apr.hnw index b55a12db186..fd3fee22862 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -159,7 +159,7 @@ #define APR_HAS_LOCK_CREATE_NP 0 -#define APR_PROCESS_LOCK_IS_GLOBAL 0 +#define APR_PROCESS_LOCK_IS_GLOBAL 1 #define APR_FILE_BASED_SHM 0 From f58d053aba1b4ce147c92100881c041c708234a6 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 3 May 2002 13:00:19 +0000 Subject: [PATCH 3344/7878] Don't throw the baby out with the bath water... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63354 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/STATUS b/STATUS index e31c7c09d1a..405f7a110a6 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/02 15:22:40 $] +Last modified at [$Date: 2002/05/03 13:00:19 $] Release: @@ -89,8 +89,9 @@ CURRENT VOTES: YES means you use the atomics code, based on the *build* machine (and therefore carries some dependencies) or NO which maintains "universal" portabiity, which is - what we have (but the default being NO atomics). - -1: IanH I don't agree. I think APR is the perfect place this kind of thing. + what we have (but the default being NO atomics) + -1: IanH, BillS: + I don't agree. I think APR is the perfect place this kind of thing. For platforms that support it is a big win, for ones which don't they are no worse off than the alternative. I can't maintain every asm implementation, but I am volunteering @@ -105,7 +106,7 @@ CURRENT VOTES: advantage of compiler optimizations when the size of the block being passed to memset is known at compile time. - +1: BrianP, Justin, Sander, Cliff, Ian + +1: BrianP, Justin, Sander, Cliff, Ian, BillS RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From cc80322c2a6817f749183326d2557e881d39b20f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 3 May 2002 15:34:45 +0000 Subject: [PATCH 3345/7878] For NetWare first check to make sure that we have a path before trying to use it. Then only deconstruct the path if we need to. Otherwise figure out the relative path and return the appropriate response. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63355 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 57 ++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 0edfd25b1be..42dfbe5ce58 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -86,47 +86,58 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, char volume[MAX_VOLUME_NAME+1]; char path[MAX_PATH_NAME+1]; char file[MAX_FILE_NAME+1]; + char *volsep = NULL; int elements; + if (inpath && *inpath) + volsep = strchr (*inpath, ':'); + else + return APR_EBADPATH; + seperator[0] = (flags & APR_FILEPATH_NATIVE) ? '\\' : '/'; /* Allocate and initialize each of the segment buffers */ server[0] = volume[0] = path[0] = file[0] = '\0'; - /* Split the inpath into its separate parts. If it fails then - we know we have a bad path. + /* If we don't have a volume separator then don't bother deconstructing + the path since we won't use the deconstructed information anyway. */ - if (deconstruct(testpath, server, volume, path, file, NULL, &elements, PATH_UNDEF)) { - if (errno == EINVAL) - return APR_EBADPATH; - } + if (volsep) { + /* Split the inpath into its separate parts. If it fails then + we know we have a bad path. + */ + if (deconstruct(testpath, server, volume, path, file, NULL, &elements, PATH_UNDEF)) { + if (errno == EINVAL) + return APR_EBADPATH; + } - /* If we got a volume part then continue splitting out the root. - Otherwise we either have an incomplete or relative path - */ - if (volume && strlen(volume) > 0) { - newpath = apr_pcalloc(p, strlen(server)+strlen(volume)+5); - construct(newpath, server, volume, NULL, NULL, NULL, PATH_NETWARE); - - /* NetWare doesn't add the root slash so we need to add it manually. + /* If we got a volume part then continue splitting out the root. + Otherwise we either have an incomplete or relative path */ - strcat(newpath, seperator); - *rootpath = newpath; + if (volume && strlen(volume) > 0) { + newpath = apr_pcalloc(p, strlen(server)+strlen(volume)+5); + construct(newpath, server, volume, NULL, NULL, NULL, PATH_NETWARE); - /* Skip the inpath pointer down to the first non-root character - */ - newpath = strchr (*inpath, ':'); - if (newpath) { + /* NetWare doesn't add the root slash so we need to add it manually. + */ + strcat(newpath, seperator); + *rootpath = newpath; + + /* Skip the inpath pointer down to the first non-root character + */ + newpath = volsep; do { ++newpath; } while (*newpath && ((*newpath == '/') || (*newpath == '\\'))); *inpath = newpath; - } -/* Need to handle APR_FILEPATH_TRUENAME checking here. */ + /* Need to handle APR_FILEPATH_TRUENAME checking here. */ - return APR_SUCCESS; + return APR_SUCCESS; + } + else + return APR_EBADPATH; } else if ((**inpath == '/') || (**inpath == '\\')) { /* if we have a root path without a volume then just split From eff139931e649d7db1b66113daf2c5a22ad174d5 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 3 May 2002 17:00:18 +0000 Subject: [PATCH 3346/7878] Turned on the mutex locking around the hash table manipulation calls. This prevents a fault under high load on a multiprocessor machine. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63356 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index d6d788e81f4..cf65f3ea475 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -59,6 +59,7 @@ #include "apr_strings.h" #include "apr_errno.h" #include "apr_hash.h" +#define USE_CSTAT_MUTEX #ifdef USE_CSTAT_MUTEX #include "apr_thread_mutex.h" #endif @@ -246,7 +247,13 @@ int cstat (const char *path, struct stat *buf) if (!gPool) return stat(path, buf); - if (!statCacheData) { + if (statCacheData) { + statCache = statCacheData->statCache; +#ifdef USE_CSTAT_MUTEX + statcache_mutex = statCacheData->statcache_mutex; +#endif + } + else { statCacheData = (apr_stat_cache_t *)apr_palloc (gPool, sizeof(apr_stat_cache_t)); statCache = apr_hash_make(gPool); #ifdef USE_CSTAT_MUTEX @@ -256,12 +263,6 @@ int cstat (const char *path, struct stat *buf) statCacheData->statCache = statCache; setStatCache((void*)statCacheData); } - else { - statCache = statCacheData->statCache; -#ifdef USE_CSTAT_MUTEX - statcache_mutex = statCacheData->statcache_mutex; -#endif - } if (statCache) { #ifdef USE_CSTAT_MUTEX @@ -282,16 +283,16 @@ int cstat (const char *path, struct stat *buf) ret = stat(path, buf); if (ret == 0) { if (!stat_entry) { +#ifdef USE_CSTAT_MUTEX + apr_thread_mutex_lock(statcache_mutex); +#endif key = apr_pstrdup (gPool, path); stat_entry = apr_palloc (gPool, sizeof(apr_stat_entry_t)); memcpy (&(stat_entry->info), buf, sizeof(struct stat)); stat_entry->expire = now; -#ifdef USE_CSTAT_MUTEX - apr_thread_mutex_lock(statcache_mutex); -#endif apr_hash_set(statCache, key, APR_HASH_KEY_STRING, stat_entry); #ifdef USE_CSTAT_MUTEX - apr_thread_mutex_unlock(statcache_mutex); + apr_thread_mutex_unlock(statcache_mutex); #endif } else { From 5bbec8352ec765e848d7cf4cc5ad8fbde0c38c3e Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 5 May 2002 02:06:49 +0000 Subject: [PATCH 3347/7878] Convert apr_pcalloc to a macro to take advantage of compiler optimization of fixed-size memset calls git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63357 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ STATUS | 8 +------- include/apr_pools.h | 4 ++++ memory/unix/apr_pools.c | 8 ++++++++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 4a5d1e78d50..938166abd39 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Converted apr_pcalloc to a macro [Brian Pane] + *) Fixed APR_STATUS_IS_ETIMEDOUT macro. [Dagfinn Aarvaag ] diff --git a/STATUS b/STATUS index 405f7a110a6..94d03097ecb 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/03 13:00:19 $] +Last modified at [$Date: 2002/05/05 02:06:48 $] Release: @@ -102,12 +102,6 @@ CURRENT VOTES: The other alternative for non-native support is maybe to turn it into a spin lock - * Turn apr_pcalloc into a macro that does apr_palloc+memset, to take - advantage of compiler optimizations when the size of the block being - passed to memset is known at compile time. - - +1: BrianP, Justin, Sander, Cliff, Ian, BillS - RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: diff --git a/include/apr_pools.h b/include/apr_pools.h index 620578bd696..7165cdce992 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -384,7 +384,11 @@ APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size, * @param size The amount of memory to allocate * @return The allocated memory */ +#if defined(DOXYGEN) APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); +#else +#define apr_pcalloc(p, size) memset(apr_palloc(p, size), 0, size) +#endif /** * Debug version of apr_pcalloc diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 35bf4b775c1..00d04ec3564 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -572,6 +572,14 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) return mem; } +/* Provide an implementation of apr_pcalloc for backward compatibility + * with code built before apr_pcalloc was a macro + */ + +#ifdef apr_pcalloc +#undef apr_pcalloc +#endif + APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) { void *mem; From 078232802ba95c5af2fed3066fe7d484529d7ba4 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 5 May 2002 05:48:28 +0000 Subject: [PATCH 3348/7878] Some performance fixes for inet_ntop6() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63358 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_ntop.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index e9ad747208f..59e9cac0775 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -150,15 +150,23 @@ inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) struct { int base, len; } best, cur; unsigned int words[IN6ADDRSZ / INT16SZ]; int i; + const unsigned char *next_src, *src_end; + unsigned int *next_dest; /* * Preprocess: * Copy the input (bytewise) array into a wordwise array. * Find the longest run of 0x00's in src[] for :: shorthanding. */ - memset(words, '\0', sizeof words); - for (i = 0; i < IN6ADDRSZ; i++) - words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); + next_src = src; + src_end = src + IN6ADDRSZ; + next_dest = words; + do { + unsigned int next_word = (unsigned int)*next_src++; + next_word <<= 8; + next_word |= (unsigned int)*next_src++; + *next_dest++ = next_word; + } while (next_src < src_end); best.base = -1; cur.base = -1; for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { From 988e7931edf1e6af0c479720d1ede030377ea3e6 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 5 May 2002 05:54:51 +0000 Subject: [PATCH 3349/7878] Formatting fixes only git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63359 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_ntop.c | 184 +++++++++++++++++++----------------- 1 file changed, 97 insertions(+), 87 deletions(-) diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index 59e9cac0775..a44c1645cd3 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -139,95 +139,105 @@ inet_ntop4(const unsigned char *src, char *dst, apr_size_t size) static const char * inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) { - /* - * Note that int32_t and int16_t need only be "at least" large enough - * to contain a value of the specified size. On some systems, like - * Crays, there is no such thing as an integer variable with 16 bits. - * Keep this in mind if you think this function should have been coded - * to use pointer overlays. All the world's not a VAX. - */ - char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp; - struct { int base, len; } best, cur; - unsigned int words[IN6ADDRSZ / INT16SZ]; - int i; - const unsigned char *next_src, *src_end; - unsigned int *next_dest; + /* + * Note that int32_t and int16_t need only be "at least" large enough + * to contain a value of the specified size. On some systems, like + * Crays, there is no such thing as an integer variable with 16 bits. + * Keep this in mind if you think this function should have been coded + * to use pointer overlays. All the world's not a VAX. + */ + char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp; + struct { int base, len; } best, cur; + unsigned int words[IN6ADDRSZ / INT16SZ]; + int i; + const unsigned char *next_src, *src_end; + unsigned int *next_dest; - /* - * Preprocess: - * Copy the input (bytewise) array into a wordwise array. - * Find the longest run of 0x00's in src[] for :: shorthanding. - */ - next_src = src; - src_end = src + IN6ADDRSZ; - next_dest = words; - do { - unsigned int next_word = (unsigned int)*next_src++; - next_word <<= 8; - next_word |= (unsigned int)*next_src++; - *next_dest++ = next_word; - } while (next_src < src_end); - best.base = -1; - cur.base = -1; - for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { - if (words[i] == 0) { - if (cur.base == -1) - cur.base = i, cur.len = 1; - else - cur.len++; - } else { - if (cur.base != -1) { - if (best.base == -1 || cur.len > best.len) - best = cur; - cur.base = -1; - } - } - } - if (cur.base != -1) { - if (best.base == -1 || cur.len > best.len) - best = cur; - } - if (best.base != -1 && best.len < 2) - best.base = -1; + /* + * Preprocess: + * Copy the input (bytewise) array into a wordwise array. + * Find the longest run of 0x00's in src[] for :: shorthanding. + */ + next_src = src; + src_end = src + IN6ADDRSZ; + next_dest = words; + do { + unsigned int next_word = (unsigned int)*next_src++; + next_word <<= 8; + next_word |= (unsigned int)*next_src++; + *next_dest++ = next_word; + } while (next_src < src_end); + best.base = -1; + cur.base = -1; + for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { + if (words[i] == 0) { + if (cur.base == -1) { + cur.base = i; + cur.len = 1; + } + else { + cur.len++; + } + } else { + if (cur.base != -1) { + if (best.base == -1 || cur.len > best.len) { + best = cur; + } + cur.base = -1; + } + } + } + if (cur.base != -1) { + if (best.base == -1 || cur.len > best.len) { + best = cur; + } + } + if (best.base != -1 && best.len < 2) { + best.base = -1; + } - /* - * Format the result. - */ - tp = tmp; - for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { - /* Are we inside the best run of 0x00's? */ - if (best.base != -1 && i >= best.base && - i < (best.base + best.len)) { - if (i == best.base) - *tp++ = ':'; - continue; - } - /* Are we following an initial run of 0x00s or any real hex? */ - if (i != 0) - *tp++ = ':'; - /* Is this address an encapsulated IPv4? */ - if (i == 6 && best.base == 0 && - (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { - if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) - return (NULL); - tp += strlen(tp); - break; - } - tp += apr_snprintf(tp, sizeof tmp - (tp - tmp), "%x", words[i]); - } - /* Was it a trailing run of 0x00's? */ - if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) - *tp++ = ':'; - *tp++ = '\0'; + /* + * Format the result. + */ + tp = tmp; + for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { + /* Are we inside the best run of 0x00's? */ + if (best.base != -1 && i >= best.base && + i < (best.base + best.len)) { + if (i == best.base) { + *tp++ = ':'; + } + continue; + } + /* Are we following an initial run of 0x00s or any real hex? */ + if (i != 0) { + *tp++ = ':'; + } + /* Is this address an encapsulated IPv4? */ + if (i == 6 && best.base == 0 && + (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { + if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) { + return (NULL); + } + tp += strlen(tp); + break; + } + tp += apr_snprintf(tp, sizeof tmp - (tp - tmp), "%x", words[i]); + } + /* Was it a trailing run of 0x00's? */ + if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) { + *tp++ = ':'; + } + *tp++ = '\0'; - /* - * Check for overflow, copy, and we're done. - */ - if ((size_t)(tp - tmp) > size) { - errno = ENOSPC; - return (NULL); - } - strcpy(dst, tmp); - return (dst); + /* + * Check for overflow, copy, and we're done. + */ + if ((size_t)(tp - tmp) > size) { + errno = ENOSPC; + return (NULL); + } + strcpy(dst, tmp); + return (dst); } #endif From 1ad571376625b1b7fff697c284fc90af4a42c1f0 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 5 May 2002 06:19:42 +0000 Subject: [PATCH 3350/7878] inet_ntop6() optimization: collapse two passes through the input address into one git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63360 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_ntop.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index a44c1645cd3..c0011deee61 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -161,16 +161,16 @@ inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) next_src = src; src_end = src + IN6ADDRSZ; next_dest = words; + best.base = -1; + cur.base = -1; + i = 0; do { unsigned int next_word = (unsigned int)*next_src++; next_word <<= 8; next_word |= (unsigned int)*next_src++; *next_dest++ = next_word; - } while (next_src < src_end); - best.base = -1; - cur.base = -1; - for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { - if (words[i] == 0) { + + if (next_word == 0) { if (cur.base == -1) { cur.base = i; cur.len = 1; @@ -186,7 +186,10 @@ inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) cur.base = -1; } } - } + + i++; + } while (next_src < src_end); + if (cur.base != -1) { if (best.base == -1 || cur.len > best.len) { best = cur; From 1bf03e91f2d5bd42d6f71ca3c3250236aa42e5a8 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 5 May 2002 06:33:37 +0000 Subject: [PATCH 3351/7878] optimized away some loop iterations in inet_ntop6() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63361 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_ntop.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index c0011deee61..15e2c452116 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -203,13 +203,11 @@ inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) * Format the result. */ tp = tmp; - for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { + for (i = 0; i < (IN6ADDRSZ / INT16SZ);) { /* Are we inside the best run of 0x00's? */ - if (best.base != -1 && i >= best.base && - i < (best.base + best.len)) { - if (i == best.base) { - *tp++ = ':'; - } + if (i == best.base) { + *tp++ = ':'; + i += best.len; continue; } /* Are we following an initial run of 0x00s or any real hex? */ @@ -226,6 +224,7 @@ inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) break; } tp += apr_snprintf(tp, sizeof tmp - (tp - tmp), "%x", words[i]); + i++; } /* Was it a trailing run of 0x00's? */ if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) { From c40ee5f53f4157d0713d119a62d4e09e10877e6a Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sun, 5 May 2002 22:24:41 +0000 Subject: [PATCH 3352/7878] Since we're using -Wmissing-prototypes, we were getting this warning: apr_pools.c:584: warning: no previous prototype for `apr_pcalloc' Normally this prototype would go in the header, but it was explicitly removed from the header because code built today should not use this function. Its non-macro implementation only exists for binary backward compatibility. So as long as we export the symbol correctly, the pre-built code already knows how to pull it in (because this prototype WAS in the header when that code was built), so all is well with the world. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63362 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 1 + 1 file changed, 1 insertion(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 00d04ec3564..568664f7cf1 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -580,6 +580,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) #undef apr_pcalloc #endif +APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size); APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) { void *mem; From e1fa3429ae75114af62f446393bf2cc9d6b7f4d3 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Mon, 6 May 2002 04:44:54 +0000 Subject: [PATCH 3353/7878] Rename --disable-atomics as --disable-optimized-atomics, since it doesn't really disable the atomics. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63363 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 938166abd39..eafddb4f100 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Renamed --disable-atomics as --disable-optimized-atomics, + since it doesn't really disable the atomics. [Aaron Bannert] + *) Converted apr_pcalloc to a macro [Brian Pane] *) Fixed APR_STATUS_IS_ETIMEDOUT macro. diff --git a/configure.in b/configure.in index a9836c2c770..53de8b612b8 100644 --- a/configure.in +++ b/configure.in @@ -304,12 +304,12 @@ dnl we are using for the more up to date cpu/OS dnl (ie.. old sparcs) apr_force_atomic_generic=0 proc_mutex_is_global=0 -user_disabled_atomics=0 +user_disabled_optimized_atomics=0 AC_ARG_ENABLE(atomics, - [ --disable-atomics Turn off optimized atomic code], + [ --disable-optimized-atomics Turn off optimized atomic code], [ if test "$enableval" = "no"; then - user_disabled_atomics=1 + user_disabled_optimized_atomics=1 fi ] ) config_subdirs="none" @@ -367,7 +367,7 @@ case $host in *sparc*) OSDIR="solaris_sparc" eolstr="\\n" - if test "$user_disabled_atomics" = 0; then + if test "$user_disabled_optimized_atomics" = 0; then apr_atomic_sparc_compile=apr_atomic_sparc.lo sparc_arch=`uname -m` is_gnu_as=`${AS} --help 2>/dev/null | grep gnu.org` From 873c8fcf2cafdcd407e6e02018e8b4e4ac44ac1d Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Mon, 6 May 2002 11:42:34 +0000 Subject: [PATCH 3354/7878] FreeBSD down to 3 has atomic... PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63364 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index b94b8aa7194..a47dfc7555e 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -171,7 +171,8 @@ APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); #define APR_ATOMIC_NEED_CAS_DEFAULT 1 #endif -#elif defined(__FreeBSD__) && (__FreeBSD__ >= 5) +#elif defined(__FreeBSD__) + #include #define apr_atomic_t apr_uint32_t From f0518541b7a1090a6ecbd6369e5c357d9b791fc8 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 6 May 2002 15:35:20 +0000 Subject: [PATCH 3355/7878] apr_lock_t is no more. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63365 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 1 - 1 file changed, 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index 102b45fc279..cbdacbf00c1 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -336,7 +336,6 @@ typedef int pid_t; typedef int uid_t; typedef int gid_t; -typedef struct apr_lock_t apr_lock_t; /* Mechanisms to properly type numeric literals */ From e7a7c00e867db51d57eee0e3663c01d1ef1031da Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 6 May 2002 20:02:28 +0000 Subject: [PATCH 3356/7878] get global_mutex.c to compile when APR_PROCESS_LOCK_IS_GLOBAL git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63366 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/global_mutex.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index 763d0b0b5a2..de3f435414e 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -179,6 +179,7 @@ APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) return APR_SUCCESS; } +#if !APR_PROCESS_LOCK_IS_GLOBAL APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmutex, apr_global_mutex_t *pmutex) { @@ -189,6 +190,7 @@ APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmute #endif return APR_SUCCESS; } +#endif APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) { From 971d834d284faac409a9bfb2f3661bcf6179dba5 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Tue, 7 May 2002 03:35:34 +0000 Subject: [PATCH 3357/7878] I *think* "polymorphically" is a word... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63367 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 94d03097ecb..6b54e86a715 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/05 02:06:48 $] +Last modified at [$Date: 2002/05/07 03:35:34 $] Release: @@ -51,6 +51,11 @@ RELEASE SHOWSTOPPERS: * The new apr_global_mutex_t lock type must be implemented on all platforms. + * Almost every API in APR depends on pools, but pool semantics + aren't a good match for a lot of applications. We need to find + a way to support alternate allocators polymorphically without + a significant performance penalty. + CURRENT VOTES: * For the atomics code to be efficient it depends on instructions From 3ffb44b97eefa444a636b2ea06468d872122cc11 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Tue, 7 May 2002 04:12:44 +0000 Subject: [PATCH 3358/7878] Optimize away a strncmp that accounted for 10% of the run time of apr_vformatter() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63368 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 7 +++++++ include/apr.h.in | 1 + strings/apr_snprintf.c | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/configure.in b/configure.in index 53de8b612b8..17e9d0f9aec 100644 --- a/configure.in +++ b/configure.in @@ -1011,11 +1011,13 @@ dnl # The first match is our preference. if test "$ac_cv_sizeof_int" = "8"; then int64_literal='#define APR_INT64_C(val) (val)' int64_t_fmt='#define APR_INT64_T_FMT "d"' + int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 1' int64_value="int" long_value=int elif test "$ac_cv_sizeof_long" = "8"; then int64_literal='#define APR_INT64_C(val) (val##L)' int64_t_fmt='#define APR_INT64_T_FMT "ld"' + int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' int64_value="long" long_value=long elif test "$ac_cv_sizeof_long_long" = "8"; then @@ -1025,16 +1027,19 @@ elif test "$ac_cv_sizeof_long_long" = "8"; then dnl doesn't support 'q'. Solaris wins. Exceptions can dnl go to the OS-dependent section. int64_t_fmt='#define APR_INT64_T_FMT "lld"' + int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 3' int64_value="long long" long_value="long long" elif test "$ac_cv_sizeof_long_double" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LD)' int64_t_fmt='#define APR_INT64_T_FMT "Ld"' + int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' int64_value="long double" long_value="long double" elif test "$ac_cv_sizeof_longlong" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LL)' int64_t_fmt='#define APR_INT64_T_FMT "qd"' + int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' int64_value="__int64" long_value="__int64" else @@ -1042,6 +1047,7 @@ else dnl # a 64-bit value but APR does not agree. int64_literal='#error Can not determine the proper size for apr_int64_t' int64_t_fmt='#error Can not determine the proper size for apr_int64_t' + int64_t_fmt_len='#error Can not determine the proper size for apr_int64_t' fi dnl # If present, allow the C99 macro INT64_C to override our conversion. @@ -1174,6 +1180,7 @@ AC_SUBST(size_t_value) AC_SUBST(ssize_t_value) AC_SUBST(socklen_t_value) AC_SUBST(int64_t_fmt) +AC_SUBST(int64_t_fmt_len) AC_SUBST(ssize_t_fmt) AC_SUBST(size_t_fmt) AC_SUBST(off_t_fmt) diff --git a/include/apr.h.in b/include/apr.h.in index f3367f95396..432f1cb7eee 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -263,6 +263,7 @@ typedef @socklen_t_value@ apr_socklen_t; /* And APR_INT64_T_FMT */ @int64_t_fmt@ +@int64_t_fmt_len@ /* are we going to force the generic atomic operations */ #define APR_FORCE_ATOMIC_GENERIC @apr_force_atomic_generic@ diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index d9ceb345480..8883a68dbae 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -810,8 +810,15 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * Modifier check */ +#if defined(APR_INT64_T_FMT_LEN) && (APR_INT64_T_FMT_LEN == 3) + if ((*fmt == APR_INT64_T_FMT[0]) && + (fmt[1] == APR_INT64_T_FMT[1])) { +#elif defined(APR_INT64_T_FMT_LEN) && (APR_INT64_T_FMT_LEN == 2) + if (*fmt == APR_INT64_T_FMT[0]) { +#else if (strncmp(fmt, APR_INT64_T_FMT, sizeof(APR_INT64_T_FMT) - 2) == 0) { +#endif /* Need to account for trailing 'd' and null in sizeof() */ var_type = IS_QUAD; fmt += (sizeof(APR_INT64_T_FMT) - 2); From e8b8253b3719a015e11cfc228d53b9304be85360 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Tue, 7 May 2002 05:20:55 +0000 Subject: [PATCH 3359/7878] A simple memcpy is sufficient here, because we know the length of the string. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63369 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 8883a68dbae..f73bb32c6b1 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -550,7 +550,8 @@ static char *conv_fp(register char format, register double num, * Check for Infinity and NaN */ if (apr_isalpha(*p)) { - *len = strlen(strcpy(buf, p)); + *len = strlen(p); + memcpy(buf, p, *len + 1); *is_negative = FALSE; return (buf); } From a4e8439b09e79d8b3410906c5e6e4717cb687b18 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Wed, 8 May 2002 05:22:04 +0000 Subject: [PATCH 3360/7878] Fixed apr_strfsize formatting of values over 1 gig Submitted by: Matsuzaki Yoshinobu Reviewed by: Brian Pane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63370 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ strings/apr_strings.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index eafddb4f100..1dd98a685f1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fixed apr_strfsize formatting of values over 1 gig + [Matsuzaki Yoshinobu ] + *) Renamed --disable-atomics as --disable-optimized-atomics, since it doesn't really disable the atomics. [Aaron Bannert] diff --git a/strings/apr_strings.c b/strings/apr_strings.c index c5f79b545c0..2bce20e38f0 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -265,7 +265,7 @@ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n) APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf) { - const char ord[] = "KMTPE"; + const char ord[] = "KMGTPE"; const char *o = ord; int remain; From 094aeaea9878544912f099b1651186480f2e80b5 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 8 May 2002 08:33:10 +0000 Subject: [PATCH 3361/7878] OS/2: Fix apr_recv() when timeout == 0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63371 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sendrecv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index 527ed8593ff..a059fb3b0ae 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -104,7 +104,7 @@ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, apr_size_t *le int fds, err = 0; do { - if (!sock->nonblock || err == SOCEWOULDBLOCK) { + if (!sock->nonblock || (err == SOCEWOULDBLOCK && sock->timeout != 0)) { fds = sock->socketdes; rv = select(&fds, 1, 0, 0, sock->timeout >= 0 ? sock->timeout/1000 : -1); @@ -124,7 +124,7 @@ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, apr_size_t *le rv = recv(sock->socketdes, buf, (*len), 0); err = rv < 0 ? sock_errno() : 0; - } while (err == SOCEINTR || err == SOCEWOULDBLOCK); + } while (err == SOCEINTR || (err == SOCEWOULDBLOCK && sock->timeout != 0)); if (err) { *len = 0; From 36cdcecee6b89c9be810a06a066e514a7e29ea08 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 8 May 2002 13:30:11 +0000 Subject: [PATCH 3362/7878] APR_PROC_MUTEX_IS_GLOBAL is the condition where apr_global_mutex_t and apr_proc_mutex_t are interchangeable currently there aren't any Unix systems with APR_PROC_MUTEX_IS_GLOBAL is defined... if/when there is, the entire global_mutex.c should be ignored git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63372 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 2 +- locks/unix/global_mutex.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 9252f4d2b2f..d4388d63352 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -218,7 +218,7 @@ struct apr_os_sock_info_t { typedef struct apr_os_sock_info_t apr_os_sock_info_t; -#if APR_PROCESS_LOCK_IS_GLOBAL +#if APR_PROC_MUTEX_IS_GLOBAL #define apr_os_global_mutex_t apr_os_proc_mutex_t #define apr_os_global_mutex_get apr_os_proc_mutex_get #else diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index de3f435414e..763d0b0b5a2 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -179,7 +179,6 @@ APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) return APR_SUCCESS; } -#if !APR_PROCESS_LOCK_IS_GLOBAL APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmutex, apr_global_mutex_t *pmutex) { @@ -190,7 +189,6 @@ APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmute #endif return APR_SUCCESS; } -#endif APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) { From 78d6bf3f5c91f4fc8bb46c0c4920abc159e191b8 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 8 May 2002 19:29:33 +0000 Subject: [PATCH 3363/7878] Added the properly cased file name to the cached stat information. This cuts down on the number of times we need to ask the file system for the same information. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63373 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 63 +++++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 14 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index cf65f3ea475..a4d746cd1d3 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -217,6 +217,7 @@ typedef struct apr_stat_entry_t apr_stat_entry_t; struct apr_stat_entry_t { struct stat info; + char *casedName; apr_time_t expire; }; @@ -229,7 +230,7 @@ struct apr_stat_cache_t { #endif }; -int cstat (const char *path, struct stat *buf) +int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *pool) { apr_stat_cache_t *statCacheData = (apr_stat_cache_t *)getStatCache(); apr_hash_t *statCache = NULL; @@ -244,9 +245,20 @@ int cstat (const char *path, struct stat *buf) int ret; int found = 0; - if (!gPool) - return stat(path, buf); + *casedName = NULL; + /* If there isn't a global pool then just stat the file + and return */ + if (!gPool) { + ret = stat(path, buf); + if (ret == 0) + *casedName = case_filename(pool, path); + return ret; + } + + /* If we have a statCacheData structure then use it. + Otherwise we need to create it and initialized it + with a new mutex lock. */ if (statCacheData) { statCache = statCacheData->statCache; #ifdef USE_CSTAT_MUTEX @@ -264,6 +276,8 @@ int cstat (const char *path, struct stat *buf) setStatCache((void*)statCacheData); } + /* If we have a statCache then try to pull the information + from the cache. Otherwise just stat the file and return.*/ if (statCache) { #ifdef USE_CSTAT_MUTEX apr_thread_mutex_lock(statcache_mutex); @@ -272,9 +286,15 @@ int cstat (const char *path, struct stat *buf) #ifdef USE_CSTAT_MUTEX apr_thread_mutex_unlock(statcache_mutex); #endif + /* If we got an entry then check the expiration time. If the entry + hasn't expired yet then copy the information and return. */ if (stat_entry) { if ((now - stat_entry->expire) <= APR_USEC_PER_SEC) { memcpy (buf, &(stat_entry->info), sizeof(struct stat)); + if (stat_entry->casedName) + *casedName = apr_pstrdup (pool, stat_entry->casedName); + else + *casedName = case_filename(pool, path); found = 1; } } @@ -282,30 +302,46 @@ int cstat (const char *path, struct stat *buf) if (!found) { ret = stat(path, buf); if (ret == 0) { - if (!stat_entry) { + *casedName = case_filename(pool, path); #ifdef USE_CSTAT_MUTEX - apr_thread_mutex_lock(statcache_mutex); + apr_thread_mutex_lock(statcache_mutex); #endif + /* If we don't have a stat_entry then create one, copy + the data and add it to the hash table. */ + if (!stat_entry) { key = apr_pstrdup (gPool, path); stat_entry = apr_palloc (gPool, sizeof(apr_stat_entry_t)); memcpy (&(stat_entry->info), buf, sizeof(struct stat)); + if (*casedName) + stat_entry->casedName = apr_pstrdup (gPool, *casedName); stat_entry->expire = now; apr_hash_set(statCache, key, APR_HASH_KEY_STRING, stat_entry); -#ifdef USE_CSTAT_MUTEX - apr_thread_mutex_unlock(statcache_mutex); -#endif } else { + /* If we do have a stat_entry then it must have expired. Just + copy the data and reset the expiration. */ memcpy (&(stat_entry->info), buf, sizeof(struct stat)); + + /* If we have a casedName and don't have a cached name or the names don't + compare, then cache the name. */ + if (*casedName && (!stat_entry->casedName || strcmp(*casedName, stat_entry->casedName))) { + stat_entry->casedName = apr_pstrdup (gPool, *casedName); + } stat_entry->expire = now; } +#ifdef USE_CSTAT_MUTEX + apr_thread_mutex_unlock(statcache_mutex); +#endif } else return ret; } } else { - return stat(path, buf); + ret = stat(path, buf); + if (ret == 0) + *casedName = case_filename(pool, path); + return ret; } return 0; } @@ -316,9 +352,9 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, { struct stat info; int srv; - char *s; + char *casedName = NULL; - srv = cstat(fname, &info); + srv = cstat(fname, &info, &casedName, pool); if (srv == 0) { finfo->pool = pool; @@ -327,9 +363,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, if (wanted & APR_FINFO_LINK) wanted &= ~APR_FINFO_LINK; if (wanted & APR_FINFO_NAME) { - s = case_filename(pool, fname); - if (s) { - finfo->name = s; + if (casedName) { + finfo->name = casedName; finfo->valid |= APR_FINFO_NAME; } } From c986b8b7157915eecad732dc7639e43566b52c48 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 8 May 2002 20:58:01 +0000 Subject: [PATCH 3364/7878] get our right name in there git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63374 13f79535-47bb-0310-9956-ffa450edef68 --- docs/doxygen.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/doxygen.conf b/docs/doxygen.conf index 70cff3eb754..9388af2f9b8 100644 --- a/docs/doxygen.conf +++ b/docs/doxygen.conf @@ -1,4 +1,4 @@ -PROJECT_NAME="Apache Portable Run-Time" +PROJECT_NAME="Apache Portable Runtime" INPUT=. QUIET=YES From 7b314073b4b21cd157455d1f2864546b175dfde0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 9 May 2002 16:42:21 +0000 Subject: [PATCH 3365/7878] add a new test program to 1) verify that APR global mutexes block out threads within the same process 2) discover whether or not APR proc mutexes block out threads within the same process git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63375 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + test/Makefile.in | 6 +- test/testmutexscope.c | 256 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 262 insertions(+), 1 deletion(-) create mode 100644 test/testmutexscope.c diff --git a/test/.cvsignore b/test/.cvsignore index bae1d73096a..1423951986d 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -62,3 +62,4 @@ testprocmutex testglobalmutex testvsn testregex +testmutexscope diff --git a/test/Makefile.in b/test/Makefile.in index e959fa22823..6657474863c 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -42,7 +42,8 @@ PROGRAMS = \ testdup@EXEEXT@ \ testatomic@EXEEXT@ \ testregex@EXEEXT@ \ - testpools@EXEEXT@ + testpools@EXEEXT@ \ + testmutexscope@EXEEXT@ TARGETS = $(PROGRAMS) @@ -188,4 +189,7 @@ testrand@EXEEXT@: testrand.lo $(LOCAL_LIBS) testpools@EXEEXT@: testpools.lo $(LOCAL_LIBS) $(LINK) testpools.lo $(LOCAL_LIBS) $(ALL_LIBS) +testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) + $(LINK) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) + # DO NOT REMOVE diff --git a/test/testmutexscope.c b/test/testmutexscope.c new file mode 100644 index 00000000000..78c2068dd6a --- /dev/null +++ b/test/testmutexscope.c @@ -0,0 +1,256 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include +#include +#include +#include + +#include "apr.h" +#include "apr_general.h" +#include "apr_proc_mutex.h" +#include "apr_global_mutex.h" +#include "apr_thread_proc.h" + +#if !APR_HAS_THREADS +static int main(void) +{ + printf("This test requires APR thread support.\n"); + return 0; +} + +#else /* APR_HAS_THREADS */ + +static apr_thread_mutex_t *thread_mutex; +static apr_proc_mutex_t *proc_mutex; +static apr_global_mutex_t *global_mutex; +static apr_pool_t *p; +static volatile int counter; +typedef enum {TEST_GLOBAL, TEST_PROC} test_mode_e; + +static void lock_init(apr_lockmech_e mech, test_mode_e test_mode) +{ + if (test_mode == TEST_PROC) { + assert(apr_proc_mutex_create(&proc_mutex, + NULL, + mech, + p) == APR_SUCCESS); + } + else { + assert(apr_global_mutex_create(&global_mutex, + NULL, + mech, + p) == APR_SUCCESS); + } +} + +static void lock_destroy(test_mode_e test_mode) +{ + if (test_mode == TEST_PROC) { + assert(apr_proc_mutex_destroy(proc_mutex) == APR_SUCCESS); + } + else { + assert(apr_global_mutex_destroy(global_mutex) == APR_SUCCESS); + } +} + +static void lock_grab(test_mode_e test_mode) +{ + if (test_mode == TEST_PROC) { + assert(apr_proc_mutex_lock(proc_mutex) == APR_SUCCESS); + } + else { + assert(apr_global_mutex_lock(global_mutex) == APR_SUCCESS); + } +} + +static void lock_release(test_mode_e test_mode) +{ + if (test_mode == TEST_PROC) { + assert(apr_proc_mutex_unlock(proc_mutex) == APR_SUCCESS); + } + else { + assert(apr_global_mutex_unlock(global_mutex) == APR_SUCCESS); + } +} + +static void *eachThread(apr_thread_t *id, void *p) +{ + test_mode_e test_mode = (test_mode_e)p; + + lock_grab(test_mode); + ++counter; + assert(apr_thread_mutex_lock(thread_mutex) == APR_SUCCESS); + assert(apr_thread_mutex_unlock(thread_mutex) == APR_SUCCESS); + lock_release(test_mode); + return NULL; +} + +static void test_mech_mode(apr_lockmech_e mech, const char *mech_name, + test_mode_e test_mode) +{ + apr_thread_t *threads[20]; + int numThreads = 5; + int i; + apr_status_t rv; + + printf("Trying %s mutexes with mechanism `%s'...\n", + test_mode == TEST_GLOBAL ? "global" : "proc", mech_name); + + assert(numThreads <= sizeof(threads) / sizeof(threads[0])); + + assert(apr_pool_create(&p, NULL) == APR_SUCCESS); + + assert(apr_thread_mutex_create(&thread_mutex, 0, p) == APR_SUCCESS); + assert(apr_thread_mutex_lock(thread_mutex) == APR_SUCCESS); + + lock_init(mech, test_mode); + + counter = 0; + + i = 0; + while (i < numThreads) + { + rv = apr_thread_create(&threads[i], + NULL, + eachThread, + (void *)test_mode, + p); + if (rv != APR_SUCCESS) { + fprintf(stderr, "apr_thread_create->%d\n", rv); + exit(1); + } + ++i; + } + + apr_sleep(5 * APR_USEC_PER_SEC); + + if (test_mode == TEST_PROC) { + printf(" Mutex mechanism `%s' is %sglobal in scope on this platform.\n", + mech_name, counter == 1 ? "" : "not "); + } + else { + if (counter != 1) { + fprintf(stderr, "\n!!!apr_global_mutex operations are broken on this " + "platform for mutex mechanism `%s'!\n" + "They don't block out threads within the same process.\n", + mech_name); + fprintf(stderr, "counter value: %d\n", counter); + exit(1); + } + else { + printf(" no problems encountered...\n"); + } + } + + assert(apr_thread_mutex_unlock(thread_mutex) == APR_SUCCESS); + + i = 0; + while (i < numThreads) + { + apr_status_t ignored; + + rv = apr_thread_join(&ignored, + threads[i]); + assert(rv == APR_SUCCESS); + ++i; + } + + lock_destroy(test_mode); + apr_thread_mutex_destroy(thread_mutex); + apr_pool_destroy(p); +} + +static void test_mech(apr_lockmech_e mech, const char *mech_name) +{ + test_mech_mode(mech, mech_name, TEST_PROC); + test_mech_mode(mech, mech_name, TEST_GLOBAL); +} + +int main(void) +{ + struct { + apr_lockmech_e mech; + const char *mech_name; + } lockmechs[] = { + {APR_LOCK_DEFAULT, "default"} +#if APR_HAS_FLOCK_SERIALIZE + ,{APR_LOCK_FLOCK, "flock"} +#endif +#if APR_HAS_SYSVSEM_SERIALIZE + ,{APR_LOCK_SYSVSEM, "sysvsem"} +#endif +#if APR_HAS_POSIXSEM_SERIALIZE + ,{APR_LOCK_POSIXSEM, "posix"} +#endif +#if APR_HAS_FCNTL_SERIALIZE + ,{APR_LOCK_FCNTL, "fcntl"} +#endif +#if APR_HAS_PROC_PTHREAD_SERIALIZE + ,{APR_LOCK_PROC_PTHREAD, "proc_pthread"} +#endif + }; + int i; + + assert(apr_initialize() == APR_SUCCESS); + + for (i = 0; i < sizeof(lockmechs) / sizeof(lockmechs[0]); i++) { + test_mech(lockmechs[i].mech, lockmechs[i].mech_name); + } + + apr_terminate(); + return 0; +} + +#endif /* APR_HAS_THREADS */ From b0fcbb4a5caffd29021015937144942466bbb784 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 9 May 2002 18:56:43 +0000 Subject: [PATCH 3366/7878] Fix a problem with global mutexes on OS/390 when something other than the default mechanism (fcntl) was used. The mutexes didn't necessarily block out other threads in the same process. This commit also adds the infrastructure to allow any individual process mutex mechanism to be declared as global for a platform so that APR doesn't wastefully use an extra thread mutex for any operations on a global mutex based on that process mutex mechanism. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63376 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ acconfig.h | 5 +++++ build/apr_hints.m4 | 2 +- configure.in | 34 +++++++++++++++++++++++++++++++++- locks/unix/proc_mutex.c | 8 ++++---- 5 files changed, 48 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 1dd98a685f1..71e89498821 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Fix a problem with global mutexes on OS/390 when something other + than the default mechanism (fcntl) was used. The mutexes didn't + necessarily block out other threads in the same process. + [Jeff Trawick] + *) Fixed apr_strfsize formatting of values over 1 gig [Matsuzaki Yoshinobu ] diff --git a/acconfig.h b/acconfig.h index c2a8fbd2a28..967bd57f629 100644 --- a/acconfig.h +++ b/acconfig.h @@ -25,6 +25,11 @@ #undef USE_PROC_PTHREAD_SERIALIZE #undef USE_PTHREAD_SERIALIZE +#undef POSIXSEM_IS_GLOBAL +#undef SYSVSEM_IS_GLOBAL +#undef FCNTL_IS_GLOBAL +#undef FLOCK_IS_GLOBAL + #undef READDIR_IS_THREAD_SAFE #undef GETHOSTBYNAME_IS_THREAD_SAFE #undef GETHOSTBYADDR_IS_THREAD_SAFE diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index e7f4b036e39..d50b79bf060 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -355,7 +355,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-ibm-os390) APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE]) - APR_SETIFNULL(apr_process_lock_is_global, [yes]) + APR_SETIFNULL(apr_sysvsem_is_global, [yes]) APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes]) APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes]) APR_ADDTO(CPPFLAGS, [-U_NO_PROTO -DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR -DPTHREAD_SETS_ERRNO -DPTHREAD_DETACH_ARG1_ADDR -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1]) diff --git a/configure.in b/configure.in index 17e9d0f9aec..c0b293a20d4 100644 --- a/configure.in +++ b/configure.in @@ -1474,7 +1474,7 @@ AC_SUBST(fcntlser) AC_SUBST(procpthreadser) AC_SUBST(pthreadser) -AC_MSG_CHECKING(if interprocess lock affects threads) +AC_MSG_CHECKING(if all interprocess locks affect threads) if test "x$apr_process_lock_is_global" = "xyes"; then proclockglobal="1" AC_MSG_RESULT(yes) @@ -1485,6 +1485,38 @@ fi AC_SUBST(proclockglobal) +AC_MSG_CHECKING(if Posix sems affect threads in the same process) +if test "x$apr_posixsem_is_global" = "xyes"; then + AC_DEFINE(POSIXSEM_IS_GLOBAL) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +AC_MSG_CHECKING(if SysV sems affect threads in the same process) +if test "x$apr_sysvsem_is_global" = "xyes"; then + AC_DEFINE(SYSVSEM_IS_GLOBAL) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +AC_MSG_CHECKING(if fcntl locks affect threads in the same process) +if test "x$apr_fcntl_is_global" = "xyes"; then + AC_DEFINE(FCNTL_IS_GLOBAL) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +AC_MSG_CHECKING(if flock locks affect threads in the same process) +if test "x$apr_flock_is_global" = "xyes"; then + AC_DEFINE(FLOCK_IS_GLOBAL) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + dnl #----------------------------- Checking for /dev/random AC_MSG_CHECKING(for /dev/random) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 5808e7e3955..3fa707cdf97 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -167,7 +167,7 @@ static apr_status_t proc_mutex_posix_child_init(apr_proc_mutex_t **mutex, const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_posix_methods = { -#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(POSIXSEM_IS_GLOBAL) APR_PROCESS_LOCK_MECH_IS_GLOBAL, #else 0, @@ -282,7 +282,7 @@ static apr_status_t proc_mutex_sysv_child_init(apr_proc_mutex_t **mutex, apr_poo const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods = { -#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(SYSVSEM_IS_GLOBAL) APR_PROCESS_LOCK_MECH_IS_GLOBAL, #else 0, @@ -591,7 +591,7 @@ static apr_status_t proc_mutex_fcntl_child_init(apr_proc_mutex_t **mutex, const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods = { -#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(FCNTL_IS_GLOBAL) APR_PROCESS_LOCK_MECH_IS_GLOBAL, #else 0, @@ -720,7 +720,7 @@ static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_flock_methods = { -#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(FLOCK_IS_GLOBAL) APR_PROCESS_LOCK_MECH_IS_GLOBAL, #else 0, From e65b2adfd87f71f5e453709d6bac3363adbd1bf9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 9 May 2002 19:42:33 +0000 Subject: [PATCH 3367/7878] AIX: Global mutexes don't need an intraprocess mutex when SysV sems are used for the crossprocess mutex. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63377 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ build/apr_hints.m4 | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 71e89498821..187cbee0e38 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) AIX: Global mutexes don't need an intraprocess mutex when SysV + sems are used for the crossprocess mutex. [Jeff Trawick] + *) Fix a problem with global mutexes on OS/390 when something other than the default mechanism (fcntl) was used. The mutexes didn't necessarily block out other threads in the same process. diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index d50b79bf060..cc101ff811f 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -62,6 +62,7 @@ if test "x$apr_preload_done" != "xyes" ; then APR_ADDTO(CFLAGS, [-qHALT=E]) fi APR_SETIFNULL(apr_iconv_inbuf_const, [1]) + APR_SETIFNULL(apr_sysvsem_is_global, [yes]) APR_ADDTO(LDFLAGS, [-Wl,-brtl]) ;; *-apollo-*) From fe1c77f38e07bce9ee44482cc2ea57b57add6a6a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 9 May 2002 19:46:23 +0000 Subject: [PATCH 3368/7878] fix a CHANGES entry... if you used SysV sem it was okay... if you used fcntl it was broken git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63378 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 187cbee0e38..5e3a8f98aaf 100644 --- a/CHANGES +++ b/CHANGES @@ -4,7 +4,7 @@ Changes with APR b1 sems are used for the crossprocess mutex. [Jeff Trawick] *) Fix a problem with global mutexes on OS/390 when something other - than the default mechanism (fcntl) was used. The mutexes didn't + than the default mechanism (SysV sem) was used. The mutexes didn't necessarily block out other threads in the same process. [Jeff Trawick] From f9d05da3c28225c13a70a5479109d1f95a99e819 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 9 May 2002 23:27:20 +0000 Subject: [PATCH 3369/7878] Darwin: Global mutexes don't need an intraprocess mutex when Posix sems are used for the crossprocess mutex. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63379 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++- build/apr_hints.m4 | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 5e3a8f98aaf..3aff062cc1c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,9 @@ Changes with APR b1 *) AIX: Global mutexes don't need an intraprocess mutex when SysV - sems are used for the crossprocess mutex. [Jeff Trawick] + sems are used for the crossprocess mutex. + Darwin: The same optimization was applied for Posix sems. + [Jeff Trawick] *) Fix a problem with global mutexes on OS/390 when something other than the default mechanism (SysV sem) was used. The mutexes didn't diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index cc101ff811f..cf9601d87b8 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -152,6 +152,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-apple-darwin*) APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp]) + APR_SETIFNULL(apr_posixsem_is_global, [yes]) ;; *-dec-osf*) APR_ADDTO(CPPFLAGS, [-DOSF1]) From 3edce6f576e96e46b75eed311149ab485c829815 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 10 May 2002 03:11:17 +0000 Subject: [PATCH 3370/7878] Add /usr/local/apache2 directory to our default search path so that people who have basic configurations of httpd-2.0 can find their APR and APR-util. (Kevin committed this to SVN.) Submitted by: Kevin Pilch-Bisson Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63380 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index ee3b175a912..df0148d588a 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -77,7 +77,7 @@ build directory, or an apr-config file.]) apr_config="apr-config" else dnl look in some standard places (apparently not in builtin/default) - for lookdir in /usr /usr/local /opt/apr ; do + for lookdir in /usr /usr/local /opt/apr /usr/local/apache2 ; do if $TEST_X "$lookdir/bin/apr-config"; then apr_found="yes" apr_config="$lookdir/bin/apr-config" From 4607944c424792384ddef8fe86fea3b3fae97174 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 10 May 2002 03:56:19 +0000 Subject: [PATCH 3371/7878] Address PR 8963 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63381 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/fileio.h | 10 +++++----- test/testdso.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 14348084f1c..8394cd151a6 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -107,13 +107,13 @@ #endif #if BEOS_BONE - #ifndef BONE7 +# ifndef BONE7 /* prior to BONE/7 fd_set & select were defined in sys/socket.h */ - #include - #else +# include +# else /* Be moved the fd_set stuff and also the FIONBIO definition... */ - #include - #endif +# include +# endif #endif /* End System headers */ diff --git a/test/testdso.c b/test/testdso.c index 1562602903e..4231dcb0436 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -67,11 +67,11 @@ #ifdef NETWARE #define LIB_NAME "mod_test.nlm" #else - #ifndef BEOS - #define LIB_NAME ".libs/mod_test.so" - #else - #define LIB_NAME "mod_test.so" - #endif +# ifndef BEOS +# define LIB_NAME ".libs/mod_test.so" +# else +# define LIB_NAME "mod_test.so" +# endif #endif int main (int argc, char ** argv) From 16ac63b8f6a504416d23391c63496ac6eeb8583f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 10 May 2002 03:56:44 +0000 Subject: [PATCH 3372/7878] Address PR 8963 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63382 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index f42e82b5fd2..2affb84a2de 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -111,7 +111,7 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func) if ((signo == SIGCHLD) && (func == SIG_IGN)) { act.sa_flags |= SA_NOCLDWAIT; } - #endif +#endif if (sigaction(signo, &act, &oact) < 0) return SIG_ERR; return oact.sa_handler; From c4d362d61ef62907ecc63a0e698da04b2a5d84f8 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Fri, 10 May 2002 11:15:51 +0000 Subject: [PATCH 3373/7878] Refer to the new guidelines document. Also reflowed one comment and added some whitespace. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63383 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_version.h | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/include/apr_version.h b/include/apr_version.h index e4a5905a593..c8ad159ffe1 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -76,40 +76,28 @@ extern "C" { * compiled against a different version of APR by use of the compile-time * constants and the use of the run-time query function. * - * ### we have not defined source/binary compatibility guidelines yet and - * ### how those map against these (release) version numbers. a strawman - * ### would be the following text: + * APR version numbering follows the guidelines specified in: * - * APR is binary-compatible (an app compiled against one version does not - * need to be recompiled to work against another version) for the same - * MAJOR and MINOR versions. - * - * APR is source-compatible (an app needs to be recompiled, but will work - * the same) for the same MAJOR version. - * - * If the MAJOR version changes, then an application may need source changes. - * - * Note that APR is defined to be forward compatible only, meaning that a - * given application will be compatible with APR releases moving forward in - * time. An application may not be compatible with earlier versions of an - * APR library (even if the major and minor versions match). This restriction - * is because a later version of APR can introduce new APIs. + * http://apr.apache.org/versioning.html */ /* The numeric compile-time version constants. These constants are the * authoritative version numbers for APR. */ + /** major version - * Major API changes that could cause compatibility problems for older programs - * such as structure size changes. No binary compatibility is possible across - * a change in the major version. + * Major API changes that could cause compatibility problems for older + * programs such as structure size changes. No binary compatibility is + * possible across a change in the major version. */ #define APR_MAJOR_VERSION 0 + /** * Minor API changes that do not cause binary compatibility problems. * Should be reset to 0 when upgrading APR_MAJOR_VERSION */ #define APR_MINOR_VERSION 9 + /** patch level */ #define APR_PATCH_VERSION 0 From 72f6b5c32bfd879781fee5274de4512a23d59caa Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 10 May 2002 14:03:29 +0000 Subject: [PATCH 3374/7878] get rid of the macro redefinition warnings for a pool-debug build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63384 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 7165cdce992..28140bc2821 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -386,7 +386,7 @@ APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size, */ #if defined(DOXYGEN) APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); -#else +#elif !APR_POOL_DEBUG #define apr_pcalloc(p, size) memset(apr_palloc(p, size), 0, size) #endif From 679ff92d7e6c9a326b4cc35aa586d51177d5ebc5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 10 May 2002 19:10:58 +0000 Subject: [PATCH 3375/7878] Linux, AIX: Use crypt_r() instead of crypt() because the native crypt() is not thread-safe. The misuse of crypt() led to intermittent failures with Apache basic authentication when crypt passwords were being used. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63385 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ build/apr_common.m4 | 53 +++++++++++++++++++++++++++++++++++++++++++++ configure.in | 4 ++++ passwd/apr_md5.c | 21 ++++++++++++++++++ 4 files changed, 83 insertions(+) diff --git a/CHANGES b/CHANGES index 3aff062cc1c..61480d2d54e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Linux, AIX: Use crypt_r() instead of crypt() because the native + crypt() is not thread-safe. The misuse of crypt() led to + intermittent failures with Apache basic authentication when crypt + passwords were being used. [Jeff Trawick] + *) AIX: Global mutexes don't need an intraprocess mutex when SysV sems are used for the crossprocess mutex. Darwin: The same optimization was applied for Posix sems. diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 7ec02223aa5..876396af229 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -458,6 +458,59 @@ else fi AC_MSG_RESULT([$msg]) ] ) +dnl +dnl APR_CHECK_CRYPT_R_STYLE +dnl +dnl Decide which of a couple of flavors of crypt_r() is necessary for +dnl this platform. +dnl +AC_DEFUN(APR_CHECK_CRYPT_R_STYLE,[ +AC_CACHE_CHECK(style of crypt_r, ac_cv_crypt_r_style,[ +dnl +ac_cv_crypt_r_style=none +dnl +AC_TRY_COMPILE([ +#include +],[ +CRYPTD buffer; +crypt_r("passwd", "hash", &buffer); +], ac_cv_crypt_r_style=cryptd) +dnl +if test "$ac_cv_crypt_r_style" = "none"; then +AC_TRY_COMPILE([ +#include +],[ +struct crypt_data buffer; +crypt_r("passwd", "hash", &buffer); +], ac_cv_crypt_r_style=struct_crypt_data) +fi +dnl +if test "$ac_cv_crypt_r_style" = "none"; then +dnl same as previous test, but see if defining _GNU_SOURCE helps +AC_TRY_COMPILE([ +#define _GNU_SOURCE +#include +],[ +struct crypt_data buffer; +crypt_r("passwd", "hash", &buffer); +], ac_cv_crypt_r_style=struct_crypt_data_gnu_source) +fi +dnl +]) +if test "$ac_cv_crypt_r_style" = "cryptd"; then + AC_DEFINE(CRYPT_R_CRYPTD, 1, [Define if crypt_r has uses CRYPTD]) +fi +dnl if we don't combine these conditions, CRYPT_R_STRUCT_CRYPT_DATA +dnl will end up defined twice +if test "$ac_cv_crypt_r_style" = "struct_crypt_data" -o \ + "$ac_cv_crypt_r_style" = "struct_crypt_data_gnu_source"; then + AC_DEFINE(CRYPT_R_STRUCT_CRYPT_DATA, 1, [Define if crypt_r uses struct crypt_data]) +fi +if test "$ac_cv_crypt_r_style" = "struct_crypt_data_gnu_source"; then + APR_ADDTO(CPPFLAGS, [-D_GNU_SOURCE]) +fi +]) + dnl dnl APR_CHECK_ICONV_INBUF dnl diff --git a/configure.in b/configure.in index c0b293a20d4..b484e701ff5 100644 --- a/configure.in +++ b/configure.in @@ -830,6 +830,10 @@ AC_CHECK_FUNCS(strerror_r, [ strerror_r="1" ], [ strerror_r="0" ]) if test "$strerror_r" = "1"; then APR_CHECK_STRERROR_R_RC fi +AC_CHECK_FUNCS(crypt_r, [ crypt_r="1" ], [ crypt_r="0" ]) +if test "$crypt_r" = "1"; then + APR_CHECK_CRYPT_R_STYLE +fi AC_CHECK_FUNCS(iconv, [ iconv="1" ], [ iconv="0" ]) if test "$iconv" = "1"; then APR_CHECK_ICONV_INBUF diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index 2c21eee8e6f..76a16b494a4 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -699,7 +699,28 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, */ #if defined(WIN32) || defined(BEOS) || defined(NETWARE) apr_cpystrn(sample, passwd, sizeof(sample) - 1); +#elif defined(CRYPT_R_CRYPTD) + CRYPTD buffer; + + crypt_pw = crypt_r(passwd, hash, &buffer); + apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); +#elif defined(CRYPT_R_STRUCT_CRYPT_DATA) + struct crypt_data buffer; + + /* having to clear this seems bogus... GNU doc is + * confusing... user report found from google says + * the crypt_data struct had to be cleared to get + * the same result as plain crypt() + */ + memset(&buffer, 0, sizeof(buffer)); + crypt_pw = crypt_r(passwd, hash, &buffer); + apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); #else + /* XXX if this is a threaded build, we should hold a mutex + * around the next two lines... but note that on some + * platforms (e.g., Solaris, HP-UX) crypt() returns a + * pointer to thread-specific data + */ crypt_pw = crypt(passwd, hash); apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); #endif From c1f0dd6dfd3b16c7826cf8bd2ef88790a4b5a77e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 10 May 2002 20:28:32 +0000 Subject: [PATCH 3376/7878] add another platform to a comment listing some platforms where crypt() is thread-safe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63386 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_md5.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index 76a16b494a4..4c9ac4969b5 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -718,8 +718,9 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, #else /* XXX if this is a threaded build, we should hold a mutex * around the next two lines... but note that on some - * platforms (e.g., Solaris, HP-UX) crypt() returns a - * pointer to thread-specific data + * platforms (e.g., Solaris, HP-UX, OS/390) crypt() + * returns a pointer to thread-specific data so we don't + * want a mutex on those platforms */ crypt_pw = crypt(passwd, hash); apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); From 6310a6826ebd5746b5dc3c7b14e5173a6942cafd Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 12 May 2002 00:56:26 +0000 Subject: [PATCH 3377/7878] Added apr_strcatv(), a string concatenation function that uses writev-style arguments. It's a faster alternative to apr_strcat() in situations where the caller knows the lengths of the strings to be concatenated. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63387 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 13 +++++++++++++ strings/apr_strings.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/include/apr_strings.h b/include/apr_strings.h index 33f1c49fdc1..8cb1e98a292 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -81,6 +81,8 @@ #include "apr.h" #include "apr_errno.h" #include "apr_pools.h" +#define APR_WANT_IOVEC +#include "apr_want.h" #if APR_HAVE_STDARG_H #include @@ -169,6 +171,17 @@ APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n); */ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...); +/** + * Concatenate multiple strings specified in a writev-style vector + * @param p The pool from which to allocate + * @param vec The strings to concatenate + * @param nvec The number of strings to concatenate + * @param nbytes (output) strlen of new string (pass in NULL to omit) + * @return The new string + */ +APR_DECLARE_NONSTD(char *) apr_pstrcatv(apr_pool_t *p, const struct iovec *vec, + apr_size_t nvec, apr_size_t *nbytes); + /** * printf-style style printing routine. The data is output to a string * allocated from a pool diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 2bce20e38f0..407ea1a84be 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -177,6 +177,44 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) return res; } +APR_DECLARE_NONSTD(char *) apr_pstrcatv(apr_pool_t *a, const struct iovec *vec, + apr_size_t nvec, apr_size_t *nbytes) +{ + apr_size_t i; + apr_size_t len; + const struct iovec *src; + char *res; + char *dst; + + /* Pass one --- find length of required string */ + len = 0; + src = vec; + for (i = nvec; i; i--) { + len += src->iov_len; + src++; + } + if (nbytes) { + *nbytes = len; + } + + /* Allocate the required string */ + res = (char *) apr_palloc(a, len + 1); + + /* Pass two --- copy the argument strings into the result space */ + src = vec; + dst = res; + for (i = nvec; i; i--) { + memcpy(dst, src->iov_base, src->iov_len); + dst += src->iov_len; + src++; + } + + /* Return the result string */ + *dst = '\0'; + + return res; +} + #if (!APR_HAVE_MEMCHR) void *memchr(const void *s, int c, size_t n) { From 507460af9e46856de926cc95734a0272d52f6c04 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 13 May 2002 05:33:39 +0000 Subject: [PATCH 3378/7878] Add -p option to the cp command for includes. (install-include in httpd-2.0 has the -p option.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63388 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index a8411293d9e..df7ea01eaf3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -62,10 +62,10 @@ install: $(TARGET_LIB) if [ ! -d $(includedir) ]; then \ $(top_srcdir)/build/mkdir.sh $(includedir); \ fi; - cp $(top_srcdir)/include/*.h $(includedir); + cp -p $(top_srcdir)/include/*.h $(includedir); if test -n "$(top_blddir)"; then \ - cp $(top_blddir)/include/*.h $(includedir); \ + cp -p $(top_blddir)/include/*.h $(includedir); \ fi; if [ ! -d $(libdir) ]; then \ $(top_srcdir)/build/mkdir.sh $(libdir); \ From 72cb0ad0c251e7f2e0379cf3c850662ac25449f9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 13 May 2002 16:09:22 +0000 Subject: [PATCH 3379/7878] Fix a char'ness issue. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63389 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 407ea1a84be..9d884fd6f8a 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -268,7 +268,7 @@ APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n) } *start = 0; do { - *--start = '0' + (n % 10); + *--start = (char)('0' + (n % 10)); n /= 10; } while (n); if (negative) { From 6272100d4cf3a5755788f1730cb2b70760ecaa0d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 13 May 2002 16:22:46 +0000 Subject: [PATCH 3380/7878] Correct the omission of version.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63390 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++++ libapr.dsp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apr.dsp b/apr.dsp index 83625e58237..f441f88790b 100644 --- a/apr.dsp +++ b/apr.dsp @@ -237,6 +237,10 @@ SOURCE=.\misc\win32\start.c SOURCE=.\misc\unix\uuid.c # End Source File +# Begin Source File + +SOURCE=.\misc\unix\version.c +# End Source File # End Group # Begin Group "mmap" diff --git a/libapr.dsp b/libapr.dsp index c0b39f16ae8..c776a72b48a 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -243,6 +243,10 @@ SOURCE=.\misc\win32\start.c SOURCE=.\misc\unix\uuid.c # End Source File +# Begin Source File + +SOURCE=.\misc\unix\version.c +# End Source File # End Group # Begin Group "mmap" From 5501934b2427d354d083f61c19f50a24bb2c2fd8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 13 May 2002 16:35:05 +0000 Subject: [PATCH 3381/7878] Ain't got no regex, ain't got no fork, Till I committed, this thing was borked git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63391 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.pl | 7 ++++--- test/Makefile.in | 12 +++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl index 96e94b2f3ab..36ab44c8584 100644 --- a/test/MakeWin32Make.pl +++ b/test/MakeWin32Make.pl @@ -45,9 +45,10 @@ if ($t =~ s|-shared|\/subsystem:windows \/dll|) { $t =~ s|-o (\S+)|\/out:\"$1\"|; } - while ($t =~ s|\.a\b|\.lib|) {} - while ($t =~ s|\.o\b|\.obj|) {} - while ($t =~ s|\.lo\b|\.obj|) {} + $t =~ s|\$\(NONPORTABLE\)||g; + $t =~ s|\.a\b|\.lib|g; + $t =~ s|\.o\b|\.obj|g; + $t =~ s|\.lo\b|\.obj|g; print $dstfl $t; diff --git a/test/Makefile.in b/test/Makefile.in index 6657474863c..1f0ff9151a3 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,6 +1,12 @@ srcdir = @srcdir@ VPATH = @srcdir@ +NONPORTABLE = \ + testshm@EXEEXT@ \ + testprocmutex@EXEEXT@ \ + testglobalmutex@EXEEXT@ \ + testregex@EXEEXT@ + PROGRAMS = \ client@EXEEXT@ \ sendfile@EXEEXT@ \ @@ -19,7 +25,6 @@ PROGRAMS = \ testargs@EXEEXT@ \ testud@EXEEXT@ \ testmmap@EXEEXT@ \ - testshm@EXEEXT@ \ testshmproducer@EXEEXT@ \ testshmconsumer@EXEEXT@ \ testpipe@EXEEXT@ \ @@ -34,19 +39,16 @@ PROGRAMS = \ teststr@EXEEXT@ \ testuser@EXEEXT@ \ testsockets@EXEEXT@ \ - testprocmutex@EXEEXT@ \ - testglobalmutex@EXEEXT@ \ testvsn@EXEEXT@ \ testsleep@EXEEXT@ \ testrand@EXEEXT@ \ testdup@EXEEXT@ \ testatomic@EXEEXT@ \ - testregex@EXEEXT@ \ testpools@EXEEXT@ \ testmutexscope@EXEEXT@ -TARGETS = $(PROGRAMS) +TARGETS = $(PROGRAMS) $(NONPORTABLE) # bring in rules.mk for standard functionality @INCLUDE_RULES@ From 974ecb8a470840df922a73580102777c29e48ae4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 13 May 2002 16:36:23 +0000 Subject: [PATCH 3382/7878] At least this one is an easy fix. All the tests build once again, even on devstudio 7.0 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63392 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmutexscope.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testmutexscope.c b/test/testmutexscope.c index 78c2068dd6a..9b85b28e1ec 100644 --- a/test/testmutexscope.c +++ b/test/testmutexscope.c @@ -125,7 +125,7 @@ static void lock_release(test_mode_e test_mode) } } -static void *eachThread(apr_thread_t *id, void *p) +static void * APR_THREAD_FUNC eachThread(apr_thread_t *id, void *p) { test_mode_e test_mode = (test_mode_e)p; From 295cdd8215fa76298c76e188821c5c5f26574b10 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 13 May 2002 17:45:49 +0000 Subject: [PATCH 3383/7878] OK... we force folks to swallow awk for all sorts of goodies, such as make_exports and win32res (version resource tags.) Why not this rather simple script as well? Eliminates all but one .pl requirement, and that is only for moving around .mak files on win32 (build/fixwin32mak.pl) which is only done for a release. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63393 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.awk | 52 ++++++++++++++++++++++++++++++++++++ test/MakeWin32Make.pl | 60 ------------------------------------------ test/aprtest.win | 4 +-- 3 files changed, 54 insertions(+), 62 deletions(-) create mode 100644 test/MakeWin32Make.awk delete mode 100644 test/MakeWin32Make.pl diff --git a/test/MakeWin32Make.awk b/test/MakeWin32Make.awk new file mode 100644 index 00000000000..8627b0a45c8 --- /dev/null +++ b/test/MakeWin32Make.awk @@ -0,0 +1,52 @@ +{ + + if (match($0, /\@INCLUDE_RULES\@/ ) ) { + print "ALL: \$(TARGETS)"; + print ""; + print "CL = cl.exe"; + print "LINK = link.exe /nologo /debug /machine:I386 /subsystem:console /incremental:no "; + print ""; + print "CFLAGS = /nologo /c /MDd /W3 /Gm /GX /Zi /Od /D _DEBUG /D WIN32 /D APR_DECLARE_STATIC /FD "; + print ""; + print ".c.obj::"; + $0 = "\t\$(CL) -c \$< \$(CFLAGS) \$(INCLUDES)"; + } + if ( match( $0, /^ALL_LIBS=/ ) ) { + $0 = ""; + } + if ( match( $0, /^LOCAL_LIBS=/ ) ) { + print "LOCAL_LIBS= ../LibD/apr.lib "; + print "ALL_LIBS= kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib "; + $0 = "" + } + if ( match( $0, /\@CFLAGS\@/ ) ) { + $0 = ""; + } + gsub( /\$\{LD_FLAGS\}/, "", $0 ); + gsub( /\.\.\/libapr\.la/, "../LibD/apr.lib", $0 ); + gsub( /\@RM\@/, "del", $0 ); + if (gsub( /\$\(RM\) -f/, "del" ) ) { + gsub( /\*\.a/, "*.lib *.exp *.idb *.ilk *.pdb", $0 ); + gsub( /Makefile/, "Makefile *.ncb *.opt", $0 ); + } + gsub( /\@CC\@/, "cl", $0); + gsub( /\@RANLIB\@/, "", $0); + gsub( /-I\$\(INCDIR\)/, "/I \"$(INCDIR)\"", $0); + + gsub( /\.\.\/libapr\.a/, "../LibD/apr.lib", $0 ); + if ( gsub( /\@EXEEXT\@/, ".exe", $0 ) ) { + gsub( /\$\(CC\) \$\(CFLAGS\)/, "\$\(LINK\) /subsystem:console", $0 ); + gsub( /-o (\S+)/, "/out:\"$1\"", $0 ); + gsub( /--export-dynamic /, "", $0 ); + gsub( /-fPIC /, "", $0 ); + } + if ( gsub( /-shared/, "/subsystem:windows /dll", $0 ) ) { + gsub( /-o (\S+)/ "/out:\"$1\"", $0 ); + } + gsub( /\$\(NONPORTABLE\)/, "", $0 ); + gsub( /\.a /, ".lib ", $0 ); + gsub( /\.o /, ".obj ", $0 ); + gsub( /\.lo /, ".obj ", $0 ); + + print $0; +} diff --git a/test/MakeWin32Make.pl b/test/MakeWin32Make.pl deleted file mode 100644 index 36ab44c8584..00000000000 --- a/test/MakeWin32Make.pl +++ /dev/null @@ -1,60 +0,0 @@ -use IO::File; - -$srcfl = new IO::File "Makefile.in", "r" || die "failed to open .in file"; -$dstfl = new IO::File "Makefile", "w" || die "failed to create Makefile"; - -while ($t = <$srcfl>) { - - if ($t =~ m|\@INCLUDE_RULES\@|) { - $t = "ALL: \$(TARGETS)\n\n" - . "CL = cl.exe\n" - . "LINK = link.exe /nologo /debug /machine:I386 /subsystem:console /incremental:no \n\n" - . "CFLAGS = /nologo /c /MDd /W3 /Gm /GX /Zi /Od /D _DEBUG /D WIN32 /D APR_DECLARE_STATIC /FD \n\n" - . ".c.obj::\n" - . "\t\$(CL) -c \$< \$(CFLAGS) \$(INCLUDES)\n"; - } - if ($t =~ m|^ALL_LIBS=|) { - $t = ""; - } - if ($t =~ m|^LOCAL_LIBS=|) { - $t = "LOCAL_LIBS=../LibD/apr.lib\n" - . "ALL_LIBS=kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib\n\n"; - } - if ($t =~ s|\@CFLAGS\@||) { - $t = ""; - } - $t =~ s|\$\{LD_FLAGS\}||; - $t =~ s|\.\./libapr\.la|../LibD/apr.lib|; - - $t =~ s|\@RM\@|del|; - if ($t =~ s|(\$\(RM\)) -f|$1|) { - $t =~ s|\*\.a|\*\.lib \*\.exp \*\.idb \*\.ilk \*\.pdb|; - $t =~ s|(Makefile)|$1 \*\.ncb \*\.opt|; - } - $t =~ s|\@CC\@|cl|; - $t =~ s|\@RANLIB\@||; - $t =~ s|-I\$\(INCDIR\)|\/I "\$\(INCDIR\)"|; - $t =~ s|\.\.\/libapr\.a|\.\./LibD/apr\.lib|; - if ($t =~ s|\@EXEEXT\@|\.exe|) { - while ($t =~ s|\@EXEEXT\@|\.exe|) {} - $t =~ s|\$\(CC\) \$\(CFLAGS\)|\$\(LINK\) \/subsystem:console|; - $t =~ s|-o (\S+)|\/out:\"$1\"|; - $t =~ s|--export-dynamic ||; - $t =~ s|-fPIC ||; - } - if ($t =~ s|-shared|\/subsystem:windows \/dll|) { - $t =~ s|-o (\S+)|\/out:\"$1\"|; - } - $t =~ s|\$\(NONPORTABLE\)||g; - $t =~ s|\.a\b|\.lib|g; - $t =~ s|\.o\b|\.obj|g; - $t =~ s|\.lo\b|\.obj|g; - - print $dstfl $t; - -} - -undef $srcfl; -undef $dstfl; - -print "Generated Makefile from Makefile.in\n"; diff --git a/test/aprtest.win b/test/aprtest.win index f2a42451f96..f72297cc91c 100644 --- a/test/aprtest.win +++ b/test/aprtest.win @@ -12,7 +12,7 @@ $(TARGET): Makefile $(MAKE) /nologo /f Makefile $(TARGET) Makefile: Makefile.in MakeWin32Make.pl - perl MakeWin32Make.pl + awk -f MakeWin32Make.awk Makefile clean: - del makefile *.obj *.exe *.idb *.pdb \ No newline at end of file + del Makefile *.obj *.exe *.idb *.pdb From b95017dde59cea3deae5110c275ead5598c01637 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 14 May 2002 03:06:18 +0000 Subject: [PATCH 3384/7878] Always print the LA_FILE information even if the .la file doesn't exist yet. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63394 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/apr-config.in b/apr-config.in index a87cd34216a..d1670cdc574 100644 --- a/apr-config.in +++ b/apr-config.in @@ -185,19 +185,10 @@ while test $# -gt 0; do fi ;; --link-libtool) - if test -f "$LA_FILE"; then - flags="$flags $LA_FILE" - elif test "$location" = "installed"; then - ### avoid using -L if libdir is a "standard" location like /usr/lib - flags="$flags -L$libdir -lapr" - else - flags="$flags -L$thisdir -lapr" - fi + flags="$flags $LA_FILE" ;; --apr-la-file) - if test -f "$LA_FILE"; then - flags="$flags $LA_FILE" - fi + flags="$flags $LA_FILE" ;; --apr-so-ext) echo "$APR_SO_EXT" From 9c6edc15c7bc46d45bfcdb9c2d04bbe2ae2ad576 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 14 May 2002 07:21:05 +0000 Subject: [PATCH 3385/7878] Merge bjh's change to mkdir.sh from httpd-2.0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63395 13f79535-47bb-0310-9956-ffa450edef68 --- build/mkdir.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/mkdir.sh b/build/mkdir.sh index 4cd33c5671c..b947c926060 100755 --- a/build/mkdir.sh +++ b/build/mkdir.sh @@ -23,6 +23,8 @@ for file in ${1+"$@"} ; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; + ?: ) pathcomp="$pathcomp/" + continue ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 From 8364b788a8cd4144587479a951954f926928a62c Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 14 May 2002 07:35:58 +0000 Subject: [PATCH 3386/7878] Add APR_MKDIR_P_CHECK macro based on httpd-2.0's APACHE_MKDIR_P_CHECK. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63396 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 876396af229..5be8b9eb867 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -49,6 +49,26 @@ EOF chmod +x $1 ])dnl +dnl APR_MKDIR_P_CHECK(fallback-mkdir-p) +dnl checks whether mkdir -p works +AC_DEFUN(APR_MKDIR_P_CHECK,[ + AC_CACHE_CHECK(for working mkdir -p, ac_cv_mkdir_p,[ + test -d conftestdir && rm -rf conftestdir + mkdir -p conftestdir/somedir >/dev/null 2>&1 + if test -d conftestdir/somedir; then + ac_cv_mkdir_p=yes + else + ac_cv_mkdir_p=no + fi + rm -rf conftestdir + ]) + if test "$ac_cv_mkdir_p" = "yes"; then + mkdir_p="mkdir -p" + else + mkdir_p="$1" + fi +]) + dnl dnl APR_SUBDIR_CONFIG(dir [, sub-package-cmdline-args]) dnl From 9e4bbb2e4e6e2793d5df55e43dd1dd016b2b9e7d Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 14 May 2002 07:38:16 +0000 Subject: [PATCH 3387/7878] As a safeguard, call the new APR_MKDIR_P_CHECK macro. If APR were to ever call APR_SUBDIR_CONFIG, the mkdir_p value needs to be initialized. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63397 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.in b/configure.in index b484e701ff5..fe6684cddb0 100644 --- a/configure.in +++ b/configure.in @@ -75,6 +75,9 @@ AC_SUBST(apr_builders) MKDIR=$apr_builders/mkdir.sh +dnl Initialize mkdir -p functionality. +APR_MKDIR_P_CHECK($apr_builders/mkdir.sh) + dnl These added to allow default directories to be used... DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" From ff58b190552c566ee00d36b7afb8392b28c4341c Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 14 May 2002 08:05:32 +0000 Subject: [PATCH 3388/7878] Revert and fix ala gstein. The better thing to do here is if we're installed and the file doesn't exist, we MUST print the -L/-l options. But, if we're in build mode, then we'll be optimistic and assume that at some point we'll create the LA_FILE. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63398 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/apr-config.in b/apr-config.in index d1670cdc574..d80ed2d153e 100644 --- a/apr-config.in +++ b/apr-config.in @@ -185,10 +185,23 @@ while test $# -gt 0; do fi ;; --link-libtool) - flags="$flags $LA_FILE" + # If the LA_FILE exists where we think it should be, use it. If we're + # installed and the LA_FILE does not exist, assume to use -L/-l + # (the LA_FILE may not have been installed). If we're building ourselves, + # we'll assume that at some point the .la file be created. + if test -f "$LA_FILE"; then + flags="$flags $LA_FILE" + elif test "$location" = "installed"; then + ### avoid using -L if libdir is a "standard" location like /usr/lib + flags="$flags -L$libdir -lapr" + else + flags="$flags $LA_FILE" + fi ;; --apr-la-file) - flags="$flags $LA_FILE" + if test -f "$LA_FILE"; then + flags="$flags $LA_FILE" + fi ;; --apr-so-ext) echo "$APR_SO_EXT" From 32dc2ca7917c0fe13a1d8ecc0dd2d724c1336e70 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 15 May 2002 11:06:58 +0000 Subject: [PATCH 3389/7878] Added apr_strmatch.h to the precompile list that generates the final export list for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63399 13f79535-47bb-0310-9956-ffa450edef68 --- build/nw_export.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/build/nw_export.inc b/build/nw_export.inc index 83af8bf7268..c3d9d28b31e 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -68,3 +68,4 @@ #include "apr_uri.h" #include "apr_xml.h" #include "apr_compat.h" +#include "apr_strmatch.h" From d2886d112c3dad34a40080ab9bf162ef305e31a3 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Wed, 15 May 2002 16:47:09 +0000 Subject: [PATCH 3390/7878] Enable autoconf/autoheader to be redefined by users. Submitted by: Joe Orton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63400 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 2 +- buildconf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 86cf95f3412..0bc0be4fdfd 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -3,7 +3,7 @@ echo "buildconf: checking installation..." # autoconf 2.13 or newer -ac_version=`autoconf --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` +ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` if test -z "$ac_version"; then echo "buildconf: autoconf not found." echo " You need autoconf version 2.13 or newer installed" diff --git a/buildconf b/buildconf index 506b02ac6a8..be13d7468a2 100755 --- a/buildconf +++ b/buildconf @@ -98,13 +98,13 @@ rm -f aclocal.m4 # Generate the autoconf header and ./configure # echo "Creating include/arch/unix/apr_private.h.in ..." -autoheader +${AUTOHEADER:-autoheader} echo "Creating configure ..." ### do some work to toss config.cache? -autoconf +${AUTOCONF:-autoconf} # Remove autoconf 2.5x's cache directory -rm -rf autom4te.cache +rm -rf autom4te*.cache exit 0 From 76d45cab8f28d60edf60d8fa55ae766a2266fd20 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 15 May 2002 17:37:59 +0000 Subject: [PATCH 3391/7878] expose the name of the shared library path variable git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63401 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apr-config.in b/apr-config.in index d80ed2d153e..bc3383bdfde 100644 --- a/apr-config.in +++ b/apr-config.in @@ -91,6 +91,7 @@ Known values for OPTION are: --srcdir print APR source directory --link-ld print link switch(es) for linking to APR --link-libtool print the libtool inputs for linking to APR + --shlib-path-var print the name of the shard library path env var --apr-la-file print the path to the .la file, if available --apr-so-ext print the extensions of shared objects on this platform --apr-lib-target print the libtool target information @@ -198,6 +199,10 @@ while test $# -gt 0; do flags="$flags $LA_FILE" fi ;; + --shlib-path-var) + echo "$SHLIBPATH_VAR" + exit 0 + ;; --apr-la-file) if test -f "$LA_FILE"; then flags="$flags $LA_FILE" From 8c28bd9681a747f2b730b907c9dc02d743c4ff1c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 15 May 2002 17:45:49 +0000 Subject: [PATCH 3392/7878] fix a mispelling of shared in a help message Submitted by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63402 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apr-config.in b/apr-config.in index bc3383bdfde..5424a76508a 100644 --- a/apr-config.in +++ b/apr-config.in @@ -91,7 +91,7 @@ Known values for OPTION are: --srcdir print APR source directory --link-ld print link switch(es) for linking to APR --link-libtool print the libtool inputs for linking to APR - --shlib-path-var print the name of the shard library path env var + --shlib-path-var print the name of the shared library path env var --apr-la-file print the path to the .la file, if available --apr-so-ext print the extensions of shared objects on this platform --apr-lib-target print the libtool target information From fe57628ca5393090349cd91ca66549567c197572 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Thu, 16 May 2002 12:18:10 +0000 Subject: [PATCH 3393/7878] Some platforms require the definitions from to be included before using git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63403 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/proc_mutex.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/arch/unix/proc_mutex.h b/include/arch/unix/proc_mutex.h index 563d6098829..e55fdd59b84 100644 --- a/include/arch/unix/proc_mutex.h +++ b/include/arch/unix/proc_mutex.h @@ -76,6 +76,9 @@ #include #endif +#ifdef HAVE_SYS_IPC_H +#include +#endif #ifdef HAVE_SYS_SEM_H #include #endif From 8ff8a71965820c454ce665d96b2f20b0400d30ed Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 16 May 2002 23:06:30 +0000 Subject: [PATCH 3394/7878] Make it so that the installed programs must explicitly set a value in the APR_FIND_APR, APR_FIND_APU macros to allow searching in the "default" locations when no --with-apr{-util} value is specified. Searching for default locations arbitrarily may result in locations being used that are out-of-date. (A variation on this may be to ignore directories that are equivalent to our prefix, but this seems safer.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63404 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index df0148d588a..a334cc16813 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -6,7 +6,7 @@ dnl library. It provides a standardized mechanism for using APR. It supports dnl embedding APR into the application source, or locating an installed dnl copy of APR. dnl -dnl APR_FIND_APR([srcdir [, builddir]]) +dnl APR_FIND_APR([srcdir [, builddir, implicit-install-check]]) dnl dnl where srcdir is the location of the bundled APR source directory, or dnl empty if source is not bundled. @@ -14,6 +14,8 @@ dnl dnl where blddir is the location where the bundled APR will will be built, dnl or empty if the build will occur in the srcdir. dnl +dnl where implicit-install-check set to 1 indicates if there is no +dnl --with-apr option specified, we will look for installed copies. dnl dnl Sets the following variables on exit: dnl @@ -71,19 +73,20 @@ AC_DEFUN(APR_FIND_APR, [ build directory, or an apr-config file.]) fi ],[ - dnl always look in the builtin/default places - if apr-config --help > /dev/null 2>&1 ; then - apr_found="yes" - apr_config="apr-config" - else - dnl look in some standard places (apparently not in builtin/default) - for lookdir in /usr /usr/local /opt/apr /usr/local/apache2 ; do - if $TEST_X "$lookdir/bin/apr-config"; then - apr_found="yes" - apr_config="$lookdir/bin/apr-config" - break - fi - done + if test -n "$3" && test "$3" = "1"; then + if apr-config --help > /dev/null 2>&1 ; then + apr_found="yes" + apr_config="apr-config" + else + dnl look in some standard places (apparently not in builtin/default) + for lookdir in /usr /usr/local /opt/apr /usr/local/apache2 ; do + if $TEST_X "$lookdir/bin/apr-config"; then + apr_found="yes" + apr_config="$lookdir/bin/apr-config" + break + fi + done + fi fi dnl if we have a bundled source directory, then we may have more work if test -d "$1"; then From ea0bd20f1fdbc95fdc8227a2a6d19d6a3034120c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 17 May 2002 11:18:58 +0000 Subject: [PATCH 3395/7878] axe a commented-out call to Apache's logging routine git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63405 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_cpystrn.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index aba64ef095b..567d43b4c60 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -244,11 +244,6 @@ char *strdup(const char *str) size_t len = strlen(str) + 1; if (!(sdup = (char *) malloc(len))) { - /* ### whoops! we can't call Apache logging routines here... */ -#if 0 - apr_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, - "Ouch! Out of memory in our strdup()!"); -#endif return NULL; } memcpy(sdup, str, len); From ab152d82bbbc130cd87cbffc2184f594cf54c21d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 17 May 2002 14:58:27 +0000 Subject: [PATCH 3396/7878] don't check for malloc() failure in our strdup() replacement Submitted by: Aaron Bannert Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63406 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_cpystrn.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index 567d43b4c60..7c56a25fa40 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -243,9 +243,7 @@ char *strdup(const char *str) char *sdup; size_t len = strlen(str) + 1; - if (!(sdup = (char *) malloc(len))) { - return NULL; - } + sdup = (char *) malloc(len); memcpy(sdup, str, len); return sdup; From 681ba071a0bf8b4a63fe9a31cc6019a64dbd02c0 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 17 May 2002 17:54:12 +0000 Subject: [PATCH 3397/7878] Remove a few stray tabs. (No code changes, but anyone reading this code needs psychiatric help.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63407 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index d860fa4c032..79bc8ed6c5b 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -203,12 +203,12 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o } } } - /* must disable the incomplete read support if we change to a - * blocking socket. - */ - if (on == 0) { - sock->netmask &= ~APR_INCOMPLETE_READ; - } + /* must disable the incomplete read support if we change to a + * blocking socket. + */ + if (on == 0) { + sock->netmask &= ~APR_INCOMPLETE_READ; + } sock->timeout = on; apr_set_option(&sock->netmask, APR_SO_TIMEOUT, on); } @@ -273,7 +273,7 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o #endif } if (opt & APR_INCOMPLETE_READ) { - apr_set_option(&sock->netmask, APR_INCOMPLETE_READ, on); + apr_set_option(&sock->netmask, APR_INCOMPLETE_READ, on); } return APR_SUCCESS; From 249b32b2f15fc6e8746846b639ca3a8f3f9563eb Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 17 May 2002 18:01:14 +0000 Subject: [PATCH 3398/7878] linux sendfile: exit with an error if the file gets smaller in the middle of a request. With this patch, a faked up shrinking file, and LogLevel info, the log contains: [Fri May 17 13:34:45 2002] [info] (20514)End of file found: core_output_filter: writing data to the network ...and the assert in sendfile_it_all doesn't hit. Is APR_EOF appropriate? beats me; it gets the job done. If you think of something better, please speak up soon because I plan on doing FreeBSD next. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63408 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index f9229c8feee..da54464d4a6 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -390,16 +390,28 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, nbytes += rv; - /* If this was a partial write, return now with the partial byte count; - * this is a non-blocking socket. - */ - if (rv < *len) { *len = nbytes; - if (sock->timeout) { - sock->netmask |= APR_INCOMPLETE_WRITE; + arv = apr_setsocketopt(sock, APR_TCP_NOPUSH, 0); + if (rv > 0) { + + /* If this was a partial write, return now with the + * partial byte count; this is a non-blocking socket. + */ + + if (sock->timeout) { + sock->netmask |= APR_INCOMPLETE_WRITE; + } + return arv; + } + else { + /* If the file got smaller mid-request, eventually the offset + * becomes equal to the new file size and the kernel returns 0. + * Make this an error so the caller knows to log something and + * exit. + */ + return APR_EOF; } - return apr_setsocketopt(sock, APR_TCP_NOPUSH, 0); } /* Now write the footers */ From e763a7ba66f32e69cbd55ea0a133dbaf1b670700 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Fri, 17 May 2002 18:05:24 +0000 Subject: [PATCH 3399/7878] We must respect the APR_BINARY flag on the Unix implementation of apr_file_open() if the underlying platform requires it (ie, cygwin). We currently detect that condition by expecting O_BINARY to be defined. PR: 9185 Reviewed by: William Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63409 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ file_io/unix/open.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index 61480d2d54e..ce9ca99a61f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Cygwin: the unix version of apr_file_open() must respect the + APR_BINARY flag if the underlying platform requires it (in + which case we assume O_BINARY is defined in fcntl.h). PR 9185. + [Cliff Woolley] + *) Linux, AIX: Use crypt_r() instead of crypt() because the native crypt() is not thread-safe. The misuse of crypt() led to intermittent failures with Apache basic authentication when crypt diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 95cbea085d9..624b66b71c6 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -152,6 +152,11 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, if (flag & APR_TRUNCATE) { oflags |= O_TRUNC; } +#ifdef O_BINARY + if (flag & APR_BINARY) { + oflags |= O_BINARY; + } +#endif if (perm == APR_OS_DEFAULT) { (*new)->filedes = open(fname, oflags, 0666); From 124ead66d3e83df29d205250d33e0d95c86f1a32 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Fri, 17 May 2002 18:07:23 +0000 Subject: [PATCH 3400/7878] It doesn't really *have to* be in fcntl.h, it just probably will be (and is on cygwin). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63410 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index ce9ca99a61f..a4d57c69ed2 100644 --- a/CHANGES +++ b/CHANGES @@ -2,7 +2,7 @@ Changes with APR b1 *) Cygwin: the unix version of apr_file_open() must respect the APR_BINARY flag if the underlying platform requires it (in - which case we assume O_BINARY is defined in fcntl.h). PR 9185. + which case we assume O_BINARY is defined). PR 9185. [Cliff Woolley] *) Linux, AIX: Use crypt_r() instead of crypt() because the native From f6f578093f16f8edc0d72a82e77a373fd368bc90 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 17 May 2002 18:10:52 +0000 Subject: [PATCH 3401/7878] This particular code fragment gets an award for obfuscated code to save a few cycles. Add a description in plain english so we don't have to waste *our* cycles figuring out what this optimization is doing. (Every time I come back to this section, I get confused and the old comment isn't helpful.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63411 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 79bc8ed6c5b..fe140f0c76b 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -188,7 +188,12 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o #endif } if (opt & APR_SO_TIMEOUT) { - /* don't do the fcntl foo more than needed */ + /* If our timeout is positive or zero and our last timeout was + * negative, then we need to ensure that we are non-blocking. + * Conversely, if our timeout is negative and we had a positive + * or zero timeout, we must make sure our socket is blocking. + * We want to avoid calling fcntl more than necessary on the socket, + */ if (on >= 0 && sock->timeout < 0){ if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 1){ if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS){ From cb51e366156e32c21f1ed4a2bae62f264df99776 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 17 May 2002 21:19:45 +0000 Subject: [PATCH 3402/7878] FreeBSD sendfile: return an error if the kernel returns 0 & no bytes sent. This probably means the file became smaller after it was stat()ed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63412 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index da54464d4a6..3537393ea30 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -490,18 +490,29 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, &nbytes, /* number of bytes written */ flags); /* undefined, set to 0 */ - if (rv == -1 && errno == EAGAIN) { - if (sock->timeout) { - sock->netmask |= APR_INCOMPLETE_WRITE; + if (rv == -1) { + if (errno == EAGAIN) { + if (sock->timeout) { + sock->netmask |= APR_INCOMPLETE_WRITE; + } + /* FreeBSD's sendfile can return -1/EAGAIN even if it + * sent bytes. Sanitize the result so we get normal EAGAIN + * semantics w.r.t. bytes sent. + */ + if (nbytes) { + /* normal exit for a big file & non-blocking io */ + (*len) = nbytes; + return APR_SUCCESS; + } } - /* FreeBSD's sendfile can return -1/EAGAIN even if it - * sent bytes. Sanitize the result so we get normal EAGAIN - * semantics w.r.t. bytes sent. - */ - if (nbytes) { - /* normal exit for a big file & non-blocking io */ + } + else { /* rv == 0 (or the kernel is broken) */ + if (nbytes == 0) { + /* Most likely the file got smaller after the stat. + * Return an error so the caller can do the Right Thing. + */ (*len) = nbytes; - return APR_SUCCESS; + return APR_EOF; } } } From e37007367b029ee98acd995baacab75aedc78f51 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sat, 18 May 2002 04:12:28 +0000 Subject: [PATCH 3403/7878] Renames: APR_XtOffset -> APR_OFFSET APR_XtOffsetOf -> APR_OFFSETOF git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63413 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 25 +++++++++++++++++++------ include/apr_ring.h | 2 +- misc/unix/rand.c | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index ec9ff5fbb8b..92dbd44d8a9 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -112,35 +112,48 @@ typedef int apr_signum_t; * Finding offsets of elements within structures. * Taken from the X code... they've sweated portability of this stuff * so we don't have to. Sigh... + * @param p_type pointer type name + * @param field data field within the structure pointed to + * @return offset */ #if defined(CRAY) || (defined(__arm) && !defined(LINUX)) #ifdef __STDC__ -#define APR_XtOffset(p_type,field) _Offsetof(p_type,field) +#define APR_OFFSET(p_type,field) _Offsetof(p_type,field) #else #ifdef CRAY2 -#define APR_XtOffset(p_type,field) \ +#define APR_OFFSET(p_type,field) \ (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) #else /* !CRAY2 */ -#define APR_XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field)) +#define APR_OFFSET(p_type,field) ((unsigned int)&(((p_type)NULL)->field)) #endif /* !CRAY2 */ #endif /* __STDC__ */ #else /* ! (CRAY || __arm) */ -#define APR_XtOffset(p_type,field) \ +#define APR_OFFSET(p_type,field) \ ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) #endif /* !CRAY */ +/** + * Finding offsets of elements within structures. + * @param s_type structure type name + * @param field data field within the structure + * @return offset + */ #ifdef offsetof -#define APR_XtOffsetOf(s_type,field) offsetof(s_type,field) +#define APR_OFFSETOF(s_type,field) offsetof(s_type,field) #else -#define APR_XtOffsetOf(s_type,field) APR_XtOffset(s_type*,field) +#define APR_OFFSETOF(s_type,field) APR_OFFSET(s_type*,field) #endif +/** @deprecated */ +#define APR_XtOffset APR_OFFSET +#define APR_XtOffsetOf APR_OFFSETOF + /** * A couple of prototypes for functions in case some platform doesn't diff --git a/include/apr_ring.h b/include/apr_ring.h index 6d8f9bd9fec..b10b778e2ab 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -145,7 +145,7 @@ * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SENTINEL(hp, elem, link) \ - (struct elem *)((char *)(hp) - APR_XtOffsetOf(struct elem, link)) + (struct elem *)((char *)(hp) - APR_OFFSETOF(struct elem, link)) /** * The first element of the ring diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 24e9b863ccc..554ae8b3ca1 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -135,7 +135,7 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, memset(&addr, 0, sizeof(struct sockaddr_un)); addr.sun_family = AF_UNIX; memcpy(addr.sun_path, STR(EGD_DEFAULT_SOCKET), egd_path_len); - egd_addr_len = APR_XtOffsetOf(struct sockaddr_un, sun_path) + + egd_addr_len = APR_OFFSETOF(struct sockaddr_un, sun_path) + egd_path_len; egd_socket = socket(PF_UNIX, SOCK_STREAM, 0); From f40b64257855da2e23f2c86be7b668a8a834995f Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sat, 18 May 2002 04:16:52 +0000 Subject: [PATCH 3404/7878] Whoops, meant to note that in CHANGES git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63414 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index a4d57c69ed2..f945742bf68 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Renamed APR_XtOffset -> APR_OFFSET and APR_XtOffsetOf -> APR_OFFSETOF. + [Cliff Woolley] + *) Cygwin: the unix version of apr_file_open() must respect the APR_BINARY flag if the underlying platform requires it (in which case we assume O_BINARY is defined). PR 9185. From bf479ddff4b0263bcfa972e5bc56a704c0bd6b17 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 20 May 2002 13:22:36 +0000 Subject: [PATCH 3405/7878] Win32: Netware/OS2 folks, do you need this too? TransmitFile() returns ERROR_NETNAME_DELETED when the client closes the connection. Subsequent calls to TransmitFile (on the same connection) get th eexpected WSACONNRESET. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63415 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr_errno.h b/include/apr_errno.h index b4fe5d1bc5d..12cdf35a999 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -972,6 +972,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ + || (s) == APR_OS_START_SYSERR + ERROR_NETNAME_DELETED \ || (s) == APR_OS_START_SYSERR + WSAECONNRESET) #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ From 70526965501ca905a6e9960379dca6be729235b1 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 20 May 2002 13:43:57 +0000 Subject: [PATCH 3406/7878] Win32: Call GetOverlappedResults to get the results of an async TransmitFile() else we may return APR_SUCCESS to a call that really failed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63416 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ network_io/win32/sendrecv.c | 23 +++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index f945742bf68..54d6b4a5349 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ Changes with APR b1 + *) Win32: Fix bug where apr_sendfile() was incorrectly returning + APR_SUCCESS on a TransmitFile call that was interrupted by + the client closing its end of the connection. Always call + GetOverlappedResults() to get results of async TransmitFile() + completion notification. [Bill Stoddard] *) Renamed APR_XtOffset -> APR_OFFSET and APR_XtOffsetOf -> APR_OFFSETOF. [Cliff Woolley] diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 227e604ca50..194f33acf23 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -325,17 +325,24 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (!rv) { status = apr_get_netos_error(); if (status == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) { + HANDLE event; #ifdef WAIT_FOR_EVENT - rv = WaitForSingleObject(overlapped.hEvent, - (DWORD)(sock->timeout >= 0 - ? sock->timeout : INFINITE)); + event = overlapped.hEvent; #else - rv = WaitForSingleObject((HANDLE) sock->sock, - (DWORD)(sock->timeout >= 0 - ? sock->timeout : INFINITE)); + event = (HANDLE) sock->sock; #endif - if (rv == WAIT_OBJECT_0) - status = APR_SUCCESS; + rv = WaitForSingleObject(event, + (DWORD)(sock->timeout >= 0 + ? sock->timeout : INFINITE)); + if (rv == WAIT_OBJECT_0) { + if (!GetOverlappedResult(event, &overlapped, + &nbytes, FALSE)) { + status = APR_FROM_OS_ERROR(GetLastError()); + } + else { + status = APR_SUCCESS; + } + } else if (rv == WAIT_TIMEOUT) status = APR_FROM_OS_ERROR(WAIT_TIMEOUT); else if (rv == WAIT_ABANDONED) { From ba380050d2325311f771cdc8f908ab1cafd656da Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 20 May 2002 15:23:42 +0000 Subject: [PATCH 3407/7878] NEVER default to ALTERNATE_SEARCH_PATH!!! It's a great last resort, but a lousy first choice. Provided that httpd was mislocating libapr, ssleay32, etc, from the wrong locations. Still, it's a good fail-over. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63417 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 98c18878afb..8deec356a4c 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -112,9 +112,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, #ifndef _WIN32_WCE em = SetErrorMode(SEM_FAILCRITICALERRORS); #endif - os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + os_handle = LoadLibraryExW(wpath, NULL, 0); if (!os_handle) - os_handle = LoadLibraryExW(wpath, NULL, 0); + os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (!os_handle) rv = apr_get_os_error(); #ifndef _WIN32_WCE From ce07f09eb716cd9aa3b1057537e64dc1a1a93162 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 20 May 2002 18:29:49 +0000 Subject: [PATCH 3408/7878] Win32: Need to check for WSA_IO_PENDING. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63418 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 194f33acf23..22284bae318 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -324,7 +324,8 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, dwFlags); /* flags to control various aspects of TransmitFile */ if (!rv) { status = apr_get_netos_error(); - if (status == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) { + if ((status == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) || + (status == APR_FROM_OS_ERROR(WSA_IO_PENDING))) { HANDLE event; #ifdef WAIT_FOR_EVENT event = overlapped.hEvent; From 10ba6c0ba95a77fa04cadc866b58f957745e8b03 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 20 May 2002 18:37:40 +0000 Subject: [PATCH 3409/7878] Win32: Rather pointless to call GetOverlappedResults() on a socket we just disconnected. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63419 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 22284bae318..de6a3b57322 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -252,6 +252,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, TRANSMIT_FILE_BUFFERS tfb, *ptfb = NULL; int ptr = 0; int bytes_to_send = *len; /* Bytes to send out of the file (not including headers) */ + int disconnected = 0; if (apr_os_level < APR_WIN_NT) { return APR_ENOTIMPL; @@ -308,6 +309,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (flags & APR_SENDFILE_DISCONNECT_SOCKET) { dwFlags |= TF_REUSE_SOCKET; dwFlags |= TF_DISCONNECT; + disconnected = 1; } } @@ -336,8 +338,8 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, (DWORD)(sock->timeout >= 0 ? sock->timeout : INFINITE)); if (rv == WAIT_OBJECT_0) { - if (!GetOverlappedResult(event, &overlapped, - &nbytes, FALSE)) { + if (!disconnected && !GetOverlappedResult(event, &overlapped, + &nbytes, FALSE)) { status = APR_FROM_OS_ERROR(GetLastError()); } else { From 0c151bcfdc11a101dd2c00d49905c3dbd97cfb7c Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 20 May 2002 22:01:41 +0000 Subject: [PATCH 3410/7878] Added strmatch to the project build for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63420 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 198909 -> 197776 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index f2dc9f21e4bd770ff283d15fc74b3cf1470533dc..4c5c2f67f38790b1c8d29d98ff6602e709ccddb4 100644 GIT binary patch delta 90252 zcmbTdbyyrh^Dc_Jgy3$$9hTq_Jh+A65JK?aw!sE>*Wke+K@uE-ED$_+kf0kDg2UpA z-_7@(^Zd>|&;9HEF|$40RW&_5U2j*vTXUaEkP=G}(u8VR0Z@fB@lO5xQ4?W-iXxbb zk3xWgg7V(+t+l(Ss~^9Mjr)NGb|Brr+`1V#rFn!o&aB1uJ+94=Cf6@k=aKc_Ib!mWr0dcC*B8D&I!1q)HFZf&3K7@2Q~ zGhRc?ddbGQv#mP_jP`ON{Mmo*Z1cBfO9%A!Izz~-r2vc5j1-Cd{u*(E6PyEe3muZJ z+aH>*jTw(nB0IGPys zcPsDCq8P<-dCMjqlf5mdaW_}T0$Jo+CEYZNt(a0NyYS# zqS(3QAjNON=%C=Ov1ns@a>hY{*eJ%lUBAtCBnPN;{RmoF=3nhKb+=brZ#eNd4z-y0 z8ue-6fmXy{E2U@AH>Vv97J|i*uU&gS?N_P3PPm?lORHYB>u~qltJOJ6ZPx{UjgmH* zTdlD?TC`&R$E=Ts7vKdK-e0#en4PHR=&qjBqK0Iwa(~I-U^ugRwRU+n7UPcvVk`q} zSAZruT|zo>{Xn-EFX{x#Z*$NiPz3RiL&q>&FlvD4{&NvLG_~5jWPF7~rdaVO5^;U( zO4DAV8~D^su+B5lqf21lho9Gfp;>{MTzEYVT&0ab567?j^;I!Eo@eX{@1fbW z+~8B2Vp3hrcOS{^CSxT$LMwaK<4PIWIqi|$aZ|l_b<~2zywB-_8OQNaQZWO^Z$QjK z_qqzfU)6i#u=Mj?3w;yY+9Th$mh>fUB5hE{hFuZv(nl@joD7cok9X)>Dj>RrWZh)#w-tS$0C)fS`RL` zXoh(8HrH$qh3g3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svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63421 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.dsp | 2 +- test/aprtest.win | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/aprtest.dsp b/test/aprtest.dsp index ea36c878fc6..ffc1be08bb4 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -189,7 +189,7 @@ SOURCE=.\Makefile.in # End Source File # Begin Source File -SOURCE=.\MakeWin32Make.pl +SOURCE=.\MakeWin32Make.awk # End Source File # End Target # End Project diff --git a/test/aprtest.win b/test/aprtest.win index f72297cc91c..85ad5b4d780 100644 --- a/test/aprtest.win +++ b/test/aprtest.win @@ -11,7 +11,7 @@ TARGET=ALL $(TARGET): Makefile $(MAKE) /nologo /f Makefile $(TARGET) -Makefile: Makefile.in MakeWin32Make.pl +Makefile: Makefile.in MakeWin32Make.awk awk -f MakeWin32Make.awk Makefile clean: From 223348e29d2cace36cfaf784e0a1ab857a027e37 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 22 May 2002 00:57:24 +0000 Subject: [PATCH 3412/7878] Fix two serious holes in the time calculations. The first patch was a discrepancy with the Unix implementations. The second patch applies to Unix implementations, no? gmtoff is independent of isdst, since gmtoff must be relocatable to another calendar month when dst is in it's other state [on/off boolean.] Reported by: Jon Travis git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63422 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/time/win32/time.c b/time/win32/time.c index e188b8a4adf..d8b0c4cf318 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -215,7 +215,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, if (days < 0) { return APR_EBADDATE; } - days -= xt->tm_gmtoff; *t = days * APR_USEC_PER_SEC + xt->tm_usec; return APR_SUCCESS; } @@ -225,7 +224,8 @@ APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, { apr_status_t status = apr_time_exp_get(t, xt); if (status == APR_SUCCESS) - *t -= (apr_time_t) xt->tm_gmtoff * APR_USEC_PER_SEC; + *t -= (apr_time_t) (xt->tm_isdst * 3600 + + xt->tm_gmtoff) * APR_USEC_PER_SEC; return status; } From a6bcdeecb3e6576cba751d278e4cff69a55a68d9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 22 May 2002 11:15:29 +0000 Subject: [PATCH 3413/7878] Darwin/Mac OS X: There is apparently no convenient way to keep deceased children from waiting until the parent reaps status, so when the APR app doesn't care about such status we need to have a handler driven and call one of the wait functions. PR: 9168 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63423 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ threadproc/unix/signals.c | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/CHANGES b/CHANGES index 54d6b4a5349..d65892e936f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ Changes with APR b1 + + *) Darwin/Mac OS X: Don't leave zombie processes when the app calls + apr_signal(SIGCHLD, SIG_IGN). This fixes a problem with Apache's + mod_cgid. PR 9168. [Jeff Trawick] + *) Win32: Fix bug where apr_sendfile() was incorrectly returning APR_SUCCESS on a TransmitFile call that was interrupted by the client closing its end of the connection. Always call diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 2affb84a2de..5127868b969 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -87,6 +87,17 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signum) #if APR_HAVE_SIGACTION +#ifdef DARWIN +static void avoid_zombies(int signo) +{ + int exit_status; + + while (waitpid(-1, &exit_status, WNOHANG) > 0) { + /* do nothing */ + } +} +#endif /* DARWIN */ + /* * Replace standard signal() with the more reliable sigaction equivalent * from W. Richard Stevens' "Advanced Programming in the UNIX Environment" @@ -111,6 +122,15 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func) if ((signo == SIGCHLD) && (func == SIG_IGN)) { act.sa_flags |= SA_NOCLDWAIT; } +#endif +#ifdef DARWIN + /* ignoring SIGCHLD or leaving the default disposition doesn't avoid zombies, + * and there is no SA_NOCLDWAIT flag, so catch the signal and reap status in + * the handler to avoid zombies + */ + if ((signo == SIGCHLD) && (func == SIG_IGN)) { + act.sa_handler = avoid_zombies; + } #endif if (sigaction(signo, &act, &oact) < 0) return SIG_ERR; From 7dfe468770d4277cfd0376f6ce2e9370f06cae0a Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 22 May 2002 18:21:46 +0000 Subject: [PATCH 3414/7878] Win32: Rearrange code for clarity git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63424 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index de6a3b57322..0dba139ecd1 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -251,22 +251,26 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, OVERLAPPED overlapped; TRANSMIT_FILE_BUFFERS tfb, *ptfb = NULL; int ptr = 0; - int bytes_to_send = *len; /* Bytes to send out of the file (not including headers) */ + int bytes_to_send; /* Bytes to send out of the file (not including headers) */ int disconnected = 0; + HANDLE wait_event; if (apr_os_level < APR_WIN_NT) { return APR_ENOTIMPL; } - /* Use len to keep track of number of total bytes sent (including headers) */ - *len = 0; - /* Initialize the overlapped structure */ memset(&overlapped,'\0', sizeof(overlapped)); #ifdef WAIT_FOR_EVENT - overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + wait_event = overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); +#else + wait_event = (HANDLE) sock->sock; #endif + /* Use len to keep track of number of total bytes sent (including headers) */ + bytes_to_send = *len; + *len = 0; + /* Handle the goofy case of sending headers/trailers and a zero byte file */ if (!bytes_to_send && hdtr) { if (hdtr->numheaders) { @@ -328,17 +332,12 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, status = apr_get_netos_error(); if ((status == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) || (status == APR_FROM_OS_ERROR(WSA_IO_PENDING))) { - HANDLE event; -#ifdef WAIT_FOR_EVENT - event = overlapped.hEvent; -#else - event = (HANDLE) sock->sock; -#endif - rv = WaitForSingleObject(event, + + rv = WaitForSingleObject(wait_event, (DWORD)(sock->timeout >= 0 ? sock->timeout : INFINITE)); if (rv == WAIT_OBJECT_0) { - if (!disconnected && !GetOverlappedResult(event, &overlapped, + if (!disconnected && !GetOverlappedResult(wait_event, &overlapped, &nbytes, FALSE)) { status = APR_FROM_OS_ERROR(GetLastError()); } @@ -375,7 +374,6 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, curoff += nbytes; } - if (status == APR_SUCCESS) { if (ptfb && ptfb->TailLength) *len += ptfb->TailLength; From 8d8356c0c9d9651aa6fb3ea8e27bc08227339570 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 22 May 2002 19:11:31 +0000 Subject: [PATCH 3415/7878] Win32: Fix bug introduced by the commit that added GetOverlappedResults() where apr_sendfile() wwould not properly send files over MAX_SEGMENT_SIZE. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63425 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 0dba139ecd1..321a5fed63a 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -289,8 +289,8 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, } /* Collapse the headers into a single buffer */ - memset(&tfb, '\0', sizeof (tfb)); if (hdtr && hdtr->numheaders) { + memset(&tfb, '\0', sizeof (tfb)); ptfb = &tfb; collapse_iovec((char **)&ptfb->Head, &ptfb->HeadLength, hdtr->headers, hdtr->numheaders, sock->cntxt); @@ -305,6 +305,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, nbytes = bytes_to_send; /* Collapse the trailers into a single buffer */ if (hdtr && hdtr->numtrailers) { + memset(&tfb, '\0', sizeof (tfb)); ptfb = &tfb; collapse_iovec((char**) &ptfb->Tail, &ptfb->TailLength, hdtr->trailers, hdtr->numtrailers, sock->cntxt); @@ -332,7 +333,6 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, status = apr_get_netos_error(); if ((status == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) || (status == APR_FROM_OS_ERROR(WSA_IO_PENDING))) { - rv = WaitForSingleObject(wait_event, (DWORD)(sock->timeout >= 0 ? sock->timeout : INFINITE)); @@ -343,6 +343,15 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, } else { status = APR_SUCCESS; + /* Ugly Code Alert: + * Account for the fact that GetOverlappedResult + * tracks bytes sent in headers, trailers and the file + * and this loop only needs to track bytes sent out + * of the file. + */ + if (ptfb) { + nbytes -= (ptfb->HeadLength + ptfb->TailLength); + } } } else if (rv == WAIT_TIMEOUT) @@ -363,21 +372,17 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (status != APR_SUCCESS) break; - /* Assume the headers have been sent */ - if (ptfb != NULL) { - *len += ptfb->HeadLength; - ptfb->HeadLength = 0; - ptfb->Head = NULL; - } bytes_to_send -= nbytes; - *len += nbytes; curoff += nbytes; + *len += nbytes; + /* Adjust len for any headers/trailers sent */ + if (ptfb) { + *len += (ptfb->HeadLength + ptfb->TailLength); + ptfb = NULL; + } } if (status == APR_SUCCESS) { - if (ptfb && ptfb->TailLength) - *len += ptfb->TailLength; - /* Mark the socket as disconnected, but do not close it. * Note: The application must have stored the socket prior to making * the call to apr_sendfile in order to either reuse it or close it. From babc32594e4b0bbce087e6c8dd345aa513b9aca0 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 22 May 2002 20:06:32 +0000 Subject: [PATCH 3416/7878] Win32: WTF was I thinking with that last commit? this is right (I hope :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63426 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 321a5fed63a..725278579cc 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -337,19 +337,17 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, (DWORD)(sock->timeout >= 0 ? sock->timeout : INFINITE)); if (rv == WAIT_OBJECT_0) { - if (!disconnected && !GetOverlappedResult(wait_event, &overlapped, - &nbytes, FALSE)) { - status = APR_FROM_OS_ERROR(GetLastError()); - } - else { - status = APR_SUCCESS; - /* Ugly Code Alert: - * Account for the fact that GetOverlappedResult - * tracks bytes sent in headers, trailers and the file - * and this loop only needs to track bytes sent out - * of the file. + status = APR_SUCCESS; + if (!disconnected) { + if (!GetOverlappedResult(wait_event, &overlapped, + &nbytes, FALSE)) { + status = APR_FROM_OS_ERROR(GetLastError()); + } + /* Ugly code alert: GetOverlappedResult returns + * a count of all bytes sent. This loop only + * tracks bytes sent out of the file. */ - if (ptfb) { + else if (ptfb) { nbytes -= (ptfb->HeadLength + ptfb->TailLength); } } From 268f53b81e7ee6bab1a01d15e2ad4d13138e8490 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 22 May 2002 23:55:27 +0000 Subject: [PATCH 3417/7878] Implement apr_thread_yield() on OS/2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63427 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/thread.c | 1 + 1 file changed, 1 insertion(+) diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 808b9938b1e..b0e1fe086a2 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -192,6 +192,7 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) void apr_thread_yield() { + DosSleep(0); } From 6e7c4798cefac1be7af0b40d0a5d5e3498cdae73 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 23 May 2002 09:53:53 +0000 Subject: [PATCH 3418/7878] OS/2: Check more return codes when locking the file for appending. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63428 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 351eb5245a1..21492e47c92 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -192,10 +192,17 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a if (thefile->flags & APR_APPEND) { FILELOCK all = { 0, 0x7fffffff }; ULONG newpos; - DosSetFileLocks(thefile->filedes, NULL, &all, -1, 0); - DosSetFilePtr(thefile->filedes, 0, FILE_END, &newpos); - rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten); - DosSetFileLocks(thefile->filedes, &all, NULL, -1, 0); + rc = DosSetFileLocks(thefile->filedes, NULL, &all, -1, 0); + + if (rc == 0) { + rc = DosSetFilePtr(thefile->filedes, 0, FILE_END, &newpos); + + if (rc == 0) { + rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten); + } + + DosSetFileLocks(thefile->filedes, &all, NULL, -1, 0); + } } else { rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten); } From c07e5a787ba67196336d482b749c28e7e058bf0c Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 23 May 2002 18:36:08 +0000 Subject: [PATCH 3419/7878] Fix a copy-and-paste error in pipe.c Submitted By: Jonathan Cobb git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63429 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 8672c632d4a..dca7b57b811 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -198,7 +198,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*out)->blocking = BLK_ON; (*out)->timeout = -1; #if APR_HAS_THREADS - (*in)->thlock = NULL; + (*out)->thlock = NULL; #endif apr_pool_cleanup_register((*in)->pool, (void *)(*in), apr_unix_file_cleanup, From 9cdf334f526c6e68174fd86b5878f9d110642d4a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 24 May 2002 15:15:41 +0000 Subject: [PATCH 3420/7878] We appear to never have had any complaints about copy srcname dstname not overwriting dstname ... this flavor is certain not to emit a file exists error [with the obvious caviat - if it's write protected, your problem.] Much simpler than /y, <.y or set copycmd fooness. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63430 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 10 ++++------ libapr.dsp | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/apr.dsp b/apr.dsp index f441f88790b..84c48cfd73a 100644 --- a/apr.dsp +++ b/apr.dsp @@ -467,23 +467,21 @@ SOURCE=.\include\apr.hw !IF "$(CFG)" == "apr - Win32 Release" -# Begin Custom Build +# Begin Custom Build - Creating apr.h from apr.hw InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw + type .\include\apr.hw > .\include\apr.h # End Custom Build !ELSEIF "$(CFG)" == "apr - Win32 Debug" -# Begin Custom Build +# Begin Custom Build - Creating apr.h from apr.hw InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw + type .\include\apr.hw > .\include\apr.h # End Custom Build diff --git a/libapr.dsp b/libapr.dsp index c776a72b48a..6c66ff258f7 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -473,23 +473,21 @@ SOURCE=.\include\apr.hw !IF "$(CFG)" == "libapr - Win32 Release" -# Begin Custom Build +# Begin Custom Build - Creating apr.h from apr.hw InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw + type .\include\apr.hw > .\include\apr.h # End Custom Build !ELSEIF "$(CFG)" == "libapr - Win32 Debug" -# Begin Custom Build +# Begin Custom Build - Creating apr.h from apr.hw InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw + type .\include\apr.hw > .\include\apr.h # End Custom Build From 2e85c89954f30f481e31a6ffea936de5bc13637b Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Fri, 24 May 2002 18:34:36 +0000 Subject: [PATCH 3421/7878] Both of these issues have been taken care of. The old locks are gone and the global mutex is looking good. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63431 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/STATUS b/STATUS index 6b54e86a715..f1876d9a827 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/07 03:35:34 $] +Last modified at [$Date: 2002/05/24 18:34:36 $] Release: @@ -44,13 +44,6 @@ RELEASE SHOWSTOPPERS: since apr_proc_create didn't allocate the apr_proc_t storage. (Aren't transparent types swell?) Suggestions? - * The new lock API is a full replacement for the old API. Before - we do a major APR release, we must deprecate the old locks API, - lest we support 2 lock APIs in perpetuity. - - * The new apr_global_mutex_t lock type must be implemented on - all platforms. - * Almost every API in APR depends on pools, but pool semantics aren't a good match for a lot of applications. We need to find a way to support alternate allocators polymorphically without From f983b452a8a6564b9b110ee075a7ce32ba206eef Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sat, 25 May 2002 20:17:45 +0000 Subject: [PATCH 3422/7878] Fair warning, as this keeps coming up over and over. We're not using apr_pool_userdata_setn() anymore as far as I can tell, because anywhere that we used it was later deemed unsafe for one reason or another. Is it wise to have it in the API at all? I suppose it has value, but knowing when it's safe to use it can be tricky. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63432 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 28140bc2821..275624b1739 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -488,8 +488,14 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set( * @note same as apr_pool_userdata_set(), except that this version doesn't * make a copy of the key (this function is useful, for example, when * the key is a string literal) - * @warning The key and the data to be attached to the pool should have - * a life span at least as long as the pool itself. + * @warning This should NOT be used if the key could change addresses by + * any means between the apr_pool_userdata_setn() call and a + * subsequent apr_pool_userdata_get() on that key, such as if a + * static string is used as a userdata key in a DSO and the DSO could + * be unloaded and reloaded between the _setn() and the _get(). You + * MUST use apr_pool_userdata_set() in such cases. + * @warning More generally, the key and the data to be attached to the + * pool should have a life span at least as long as the pool itself. * */ APR_DECLARE(apr_status_t) apr_pool_userdata_setn( From 6954bdf60ae4cac579c4034b176f4b9f018f3d19 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 25 May 2002 22:23:25 +0000 Subject: [PATCH 3423/7878] The doc doesn't match implementation. Make it consistent with write_full. Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63433 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 8c8d4ab0a24..3d4398402bc 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -360,8 +360,9 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, * is reached. If a char was put back into the stream via ungetc, * it will be the first character returned. * - * It is not possible for both bytes to be read and an APR_EOF or other - * error to be returned. + * It is possible for both bytes to be written and an error to be + * returned. And if *bytes_written is less than nbytes, an + * accompanying error is _always_ returned. * * APR_EINTR is never returned. */ From 02655654fd8debed80aaaef3a87e1f8b8623029f Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 25 May 2002 22:27:02 +0000 Subject: [PATCH 3424/7878] That cut-and-paste job was a bit too literal. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63434 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 3d4398402bc..c0f4dc24462 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -360,8 +360,8 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, * is reached. If a char was put back into the stream via ungetc, * it will be the first character returned. * - * It is possible for both bytes to be written and an error to be - * returned. And if *bytes_written is less than nbytes, an + * It is possible for both bytes to be read and an error to be + * returned. And if *bytes_read is less than nbytes, an * accompanying error is _always_ returned. * * APR_EINTR is never returned. From 8718d5a74770a1e6567d583cf866f896a6883034 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 26 May 2002 08:52:02 +0000 Subject: [PATCH 3425/7878] The hi free patch. This will add the ability for a developer to set a maximum on the free blocks in an allocators freelist. See: <86off8rtmp.fsf@kepler.ch.collab.net> for why we need it. And: <1022371367.23007.13.camel@mypc1.pacbell.net> for a benchmark showing it doesn't affect httpd performance. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63435 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 10 ++++++++ memory/unix/apr_pools.c | 56 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 079dee778eb..4d8e14f8e46 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -151,6 +151,16 @@ APR_DECLARE(void) apr_allocator_set_owner(apr_allocator_t *allocator, */ APR_DECLARE(apr_pool_t *) apr_allocator_get_owner(apr_allocator_t *allocator); + +/** + * Set the current threshold at which the allocator should start + * giving blocks back to the system. + * @param allocator The allocator the set the threshold on + * @param size The threshold. 0 == unlimited. + */ +APR_DECLARE(void) apr_allocator_set_max_free(apr_allocator_t *allocator, + apr_size_t size); + #include "apr_thread_mutex.h" #if APR_HAS_THREADS diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 568664f7cf1..4dd410263cb 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -93,6 +93,8 @@ struct apr_allocator_t { apr_uint32_t max_index; + apr_uint32_t max_free_index; + apr_uint32_t current_free_index; #if APR_HAS_THREADS apr_thread_mutex_t *mutex; #endif /* APR_HAS_THREADS */ @@ -166,6 +168,32 @@ APR_DECLARE(apr_pool_t *) apr_allocator_get_owner(apr_allocator_t *allocator) return allocator->owner; } +APR_DECLARE(void) apr_allocator_set_max_free(apr_allocator_t *allocator, + apr_size_t size) +{ + apr_uint32_t max_free_index; + +#if APR_HAS_THREADS + apr_thread_mutex_t *mutex; + + mutex = apr_allocator_get_mutex(allocator); + if (mutex != NULL) + apr_thread_mutex_lock(mutex); +#endif /* APR_HAS_THREADS */ + + max_free_index = APR_ALIGN(size, BOUNDARY_SIZE) >> BOUNDARY_INDEX; + allocator->current_free_index += max_free_index; + allocator->current_free_index -= allocator->max_free_index; + allocator->max_free_index = max_free_index; + if (allocator->current_free_index > max_free_index) + allocator->current_free_index = max_free_index; + +#if APR_HAS_THREADS + if (mutex != NULL) + apr_thread_mutex_unlock(mutex); +#endif +} + APR_INLINE APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, apr_size_t size) @@ -228,6 +256,10 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, allocator->max_index = max_index; } + allocator->current_free_index += node->index; + if (allocator->current_free_index > allocator->max_free_index) + allocator->current_free_index = allocator->max_free_index; + #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_unlock(allocator->mutex); @@ -264,6 +296,10 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, if (node) { *ref = node->next; + allocator->current_free_index += node->index; + if (allocator->current_free_index > allocator->max_free_index) + allocator->current_free_index = allocator->max_free_index; + #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_unlock(allocator->mutex); @@ -299,8 +335,9 @@ APR_INLINE APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) { - apr_memnode_t *next; + apr_memnode_t *next, *freelist = NULL; apr_uint32_t index, max_index; + apr_uint32_t max_free_index, current_free_index; #if APR_HAS_THREADS if (allocator->mutex) @@ -308,6 +345,8 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, #endif /* APR_HAS_THREADS */ max_index = allocator->max_index; + max_free_index = allocator->max_free_index; + current_free_index = allocator->current_free_index; /* Walk the list of submitted nodes and free them one by one, * shoving them in the right 'size' buckets as we go. @@ -316,7 +355,11 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, next = node->next; index = node->index; - if (index < MAX_INDEX) { + if (max_free_index != 0 && index > current_free_index) { + node->next = freelist; + freelist = node; + } + else if (index < MAX_INDEX) { /* Add the node to the appropiate 'size' bucket. Adjust * the max_index when appropiate. */ @@ -325,6 +368,7 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, max_index = index; } allocator->free[index] = node; + current_free_index -= index; } else { /* This node is too large to keep in a specific size bucket, @@ -332,15 +376,23 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, */ node->next = allocator->free[0]; allocator->free[0] = node; + current_free_index -= index; } } while ((node = next) != NULL); allocator->max_index = max_index; + allocator->current_free_index = current_free_index; #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_unlock(allocator->mutex); #endif /* APR_HAS_THREADS */ + + while (freelist != NULL) { + node = freelist; + freelist = node->next; + free(node); + } } From 90ddd615ca60c1664a44bed22561501622a77010 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 26 May 2002 09:00:08 +0000 Subject: [PATCH 3426/7878] The 'reuse' patch. This will make pools a bit more carefull about when it has to allocate a new block from the allocator. If it has an old block which can hold the allocation it allocates from that and makes it the active block. See: <86off8rtmp.fsf@kepler.ch.collab.net> for why we need it. And: <1022371367.23007.13.camel@mypc1.pacbell.net> for a benchmark showing it doesn't affect httpd performance. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63436 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 2 + memory/unix/apr_pools.c | 179 +++++++++++++++++++++++++++++++++------- 2 files changed, 151 insertions(+), 30 deletions(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 4d8e14f8e46..a509d9ee86b 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -83,7 +83,9 @@ typedef struct apr_memnode_t apr_memnode_t; struct apr_memnode_t { apr_memnode_t *next; + apr_memnode_t **ref; apr_uint32_t index; + apr_uint32_t free_index; char *first_avail; char *endp; }; diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 4dd410263cb..d74a916b920 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -596,6 +596,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) apr_memnode_t *active, *node; void *mem; char *endp; + apr_uint32_t free_index; size = APR_ALIGN_DEFAULT(size); active = pool->active; @@ -609,17 +610,54 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) return mem; } - if ((node = apr_allocator_alloc(pool->allocator, size)) == NULL) { - if (pool->abort_fn) - pool->abort_fn(APR_ENOMEM); + node = active->next; + endp = node->first_avail + size; + if (endp < node->endp) { + *node->ref = node->next; + node->next->ref = node->ref; + } + else { + if ((node = apr_allocator_alloc(pool->allocator, size)) == NULL) { + if (pool->abort_fn) + pool->abort_fn(APR_ENOMEM); - return NULL; + return NULL; + } + endp = node->first_avail + size; } - active->next = pool->active = node; + node->free_index = 0; mem = node->first_avail; - node->first_avail += size; + node->first_avail = endp; + + node->ref = active->ref; + *node->ref = node; + node->next = active; + active->ref = &node->next; + + pool->active = node; + + free_index = (APR_ALIGN(active->endp - active->first_avail + 1, + BOUNDARY_SIZE) - BOUNDARY_SIZE) >> BOUNDARY_INDEX; + + active->free_index = free_index; + node = active->next; + if (free_index >= node->free_index) + return mem; + + do { + node = node->next; + } + while (free_index < node->free_index); + + *active->ref = active->next; + active->next->ref = active->ref; + + active->ref = node->ref; + *active->ref = active; + active->next = node; + node->ref = &active->next; return mem; } @@ -677,11 +715,13 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) active = pool->active = pool->self; active->first_avail = pool->self_first_avail; - if (active->next == NULL) + if (active->next == active) return; + *active->ref = NULL; apr_allocator_free(pool->allocator, active->next); - active->next = NULL; + active->next = active; + active->ref = &active->next; } APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) @@ -724,6 +764,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) */ allocator = pool->allocator; active = pool->self; + *active->ref = NULL; #if APR_HAS_THREADS if (apr_allocator_get_owner(allocator) == pool) { @@ -776,6 +817,9 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, return APR_ENOMEM; } + node->next = node; + node->ref = &node->next; + pool = (apr_pool_t *)node->first_avail; node->first_avail = pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; @@ -843,7 +887,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, struct psprintf_data { apr_vformatter_buff_t vbuff; apr_memnode_t *node; - apr_allocator_t *allocator; + apr_pool_t *pool; apr_byte_t got_a_new_node; apr_memnode_t *free; }; @@ -852,29 +896,70 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) { struct psprintf_data *ps = (struct psprintf_data *)vbuff; apr_memnode_t *node, *active; - apr_size_t cur_len; + apr_size_t cur_len, size; char *strp; - apr_allocator_t *allocator; + apr_pool_t *pool; + apr_uint32_t free_index; - allocator = ps->allocator; - node = ps->node; + pool = ps->pool; + active = ps->node; strp = ps->vbuff.curpos; - cur_len = strp - node->first_avail; + cur_len = strp - active->first_avail; + size = cur_len << 1; - if ((active = apr_allocator_alloc(allocator, cur_len << 1)) == NULL) - return -1; + node = active->next; + if (!ps->got_a_new_node && node->first_avail + size < node->endp) { + *node->ref = node->next; + node->next->ref = node->ref; + + node->ref = active->ref; + *node->ref = node; + node->next = active; + active->ref = &node->next; + + node->free_index = 0; - memcpy(active->first_avail, node->first_avail, cur_len); + pool->active = node; - if (ps->got_a_new_node) { - node->next = ps->free; - ps->free = node; + free_index = (APR_ALIGN(active->endp - active->first_avail + 1, + BOUNDARY_SIZE) - BOUNDARY_SIZE) >> BOUNDARY_INDEX; + + active->free_index = free_index; + node = active->next; + if (free_index < node->free_index) { + do { + node = node->next; + } + while (free_index < node->free_index); + + *active->ref = active->next; + active->next->ref = active->ref; + + active->ref = node->ref; + *active->ref = active; + active->next = node; + node->ref = &active->next; + } + + node = pool->active; } + else { + if ((node = apr_allocator_alloc(pool->allocator, size)) == NULL) + return -1; - ps->node = active; - ps->vbuff.curpos = active->first_avail + cur_len; - ps->vbuff.endpos = active->endp - 1; /* Save a byte for NUL terminator */ - ps->got_a_new_node = 1; + if (ps->got_a_new_node) { + active->next = ps->free; + ps->free = node; + } + + ps->got_a_new_node = 1; + } + + memcpy(node->first_avail, active->first_avail, cur_len); + + ps->node = node; + ps->vbuff.curpos = node->first_avail + cur_len; + ps->vbuff.endpos = node->endp - 1; /* Save a byte for NUL terminator */ return 0; } @@ -884,10 +969,11 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) struct psprintf_data ps; char *strp; apr_size_t size; - apr_memnode_t *active; + apr_memnode_t *active, *node; + apr_uint32_t free_index; ps.node = active = pool->active; - ps.allocator = pool->allocator; + ps.pool = pool; ps.vbuff.curpos = ps.node->first_avail; /* Save a byte for the NUL terminator */ @@ -910,15 +996,48 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) strp = ps.node->first_avail; ps.node->first_avail += size; + if (ps.free) + apr_allocator_free(pool->allocator, ps.free); + /* * Link the node in if it's a new one */ - if (ps.got_a_new_node) { - active->next = pool->active = ps.node; + if (!ps.got_a_new_node) + return strp; + + active = pool->active; + node = ps.node; + + node->free_index = 0; + + node->ref = active->ref; + *node->ref = node; + node->next = active; + active->ref = &node->next; + + pool->active = node; + + free_index = (APR_ALIGN(active->endp - active->first_avail + 1, + BOUNDARY_SIZE) - BOUNDARY_SIZE) >> BOUNDARY_INDEX; + + active->free_index = free_index; + node = active->next; + + if (free_index >= node->free_index) + return strp; + + do { + node = node->next; } + while (free_index < node->free_index); + + *active->ref = active->next; + active->next->ref = active->ref; - if (ps.free) - apr_allocator_free(ps.allocator, ps.free); + active->ref = node->ref; + *active->ref = active; + active->next = node; + node->ref = &active->next; return strp; } From 2d9336b962b0f6d6b83543760206af4b538d5519 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Tue, 28 May 2002 23:15:10 +0000 Subject: [PATCH 3427/7878] Added --with-devrandom=[DEV] configure flag which allows a particular "/dev/random"-compatible device to be specified, overriding the default search path (/dev/random then /dev/arandom then /dev/urandom). Also, if --with-egd= is specified, it now implies --without-devrandom. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63437 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ configure.in | 61 ++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 48 insertions(+), 19 deletions(-) diff --git a/CHANGES b/CHANGES index d65892e936f..6cae608ca7e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) Added --with-devrandom=[DEV] configure flag which allows a particular + "/dev/random"-compatible device to be specified, overriding the + default search path (/dev/random then /dev/arandom then /dev/urandom). + Also, if --with-egd= is specified, it now implies + --without-devrandom. [Cliff Woolley] + *) Darwin/Mac OS X: Don't leave zombie processes when the app calls apr_signal(SIGCHLD, SIG_IGN). This fixes a problem with Apache's mod_cgid. PR 9168. [Jeff Trawick] diff --git a/configure.in b/configure.in index fe6684cddb0..f9bb7a4eb60 100644 --- a/configure.in +++ b/configure.in @@ -1525,17 +1525,50 @@ else fi dnl #----------------------------- Checking for /dev/random -AC_MSG_CHECKING(for /dev/random) +AC_MSG_CHECKING(for entropy source) -if test -r "/dev/random"; then - AC_DEFINE(DEV_RANDOM, [/dev/random]) - AC_MSG_RESULT(/dev/random) - rand="1" -elif test -r "/dev/urandom"; then - AC_DEFINE(DEV_RANDOM, [/dev/urandom]) - AC_MSG_RESULT(/dev/urandom) +AC_ARG_WITH(egd, + [ --with-egd= use egd-compatible socket], + [ if test "$withval" = "yes"; then + AC_ERROR([You must specify a default EGD socket path.]) + fi + AC_DEFINE(HAVE_EGD) + AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, [$withval]) + AC_MSG_RESULT(EGD-compatible daemon) rand="1" -else + ]) + +if test "$rand" != "1"; then + AC_ARG_WITH(devrandom, + [ --with-devrandom[[=DEV]] use /dev/random or compatible [[searches by default]]], + [ apr_devrandom="$withval" ], [ apr_devrandom="yes" ]) + + if test "$apr_devrandom" = "yes"; then + if test -r "/dev/random"; then + AC_DEFINE(DEV_RANDOM, [/dev/random]) + AC_MSG_RESULT(/dev/random) + rand="1" + elif test -r "/dev/arandom"; then + AC_DEFINE(DEV_RANDOM, [/dev/arandom]) + AC_MSG_RESULT(/dev/arandom) + rand="1" + elif test -r "/dev/urandom"; then + AC_DEFINE(DEV_RANDOM, [/dev/urandom]) + AC_MSG_RESULT(/dev/urandom) + rand="1" + fi + elif test "$apr_devrandom" != "no"; then + if test -r "$apr_devrandom"; then + AC_DEFINE(DEV_RANDOM, [$apr_devrandom]) + AC_MSG_RESULT($apr_devrandom) + rand="1" + else + AC_ERROR([$apr_devrandom not found or unreadable.]) + fi + fi +fi + +if test "$rand" != "1"; then case $host in # we have built in support for OS/2 *-os2*) @@ -1543,16 +1576,6 @@ else rand="1" ;; *) - AC_ARG_WITH(egd, - [ --with-egd= use egd-compatible socket], - [ if test "$withval" = "yes"; then - AC_ERROR([You must specify a default EGD socket path.]) - fi - AC_DEFINE(HAVE_EGD) - AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, [$withval]) - AC_MSG_RESULT(EGD-compatible daemon) - rand="1" - ]) if test "$rand" != "1"; then if test "$ac_cv_lib_truerand_main" = "yes"; then AC_DEFINE(HAVE_TRUERAND) From 96896f2bb814a9dc574415fd2c955e0292f12a00 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 29 May 2002 21:10:57 +0000 Subject: [PATCH 3428/7878] Reimplemented apr_file_pipe_create() on NetWare using the standard pipe() function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63438 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 80 +++++++++++------------------------ include/arch/netware/fileio.h | 1 - 2 files changed, 25 insertions(+), 56 deletions(-) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 82c190bb225..031eaa11d91 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -59,26 +59,6 @@ #include "fileio.h" #include "apr_strings.h" -apr_status_t apr_netware_pipe_cleanup(void *thefile) -{ - apr_file_t *file = thefile; - apr_status_t rv = APR_SUCCESS; - int rc; - - rc = close(file->filedes); - if (rc == 0) { - file->filedes = -1; - if (file->thlock) { - rv = apr_thread_mutex_destroy(file->thlock); - } - } - else { - /* Are there any error conditions other than EINTR or EBADF? */ - rv = errno; - } - return rv; -} - static apr_status_t pipeblock(apr_file_t *thepipe) { #ifdef USE_FLAGS @@ -154,47 +134,37 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) { - char tname[L_tmpnam+1]; int filedes[2]; int err; - if (!tmpnam(tname)) - return errno; - - if (((filedes[0] = pipe_open(tname, O_RDONLY)) != -1) - && ((filedes[1] = pipe_open(tname, O_WRONLY)) != -1)) - { - (*in) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); - (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); - - (*in)->pool = - (*out)->pool = pool; - (*in)->filedes = filedes[0]; - (*out)->filedes = filedes[1]; - (*in)->pipe = - (*out)->pipe = 1; - (*out)->fname = apr_pstrdup(pool, tname); - (*in)->fname = apr_pstrdup(pool, tname);; - (*in)->buffered = - (*out)->buffered = 0; - (*in)->blocking = - (*out)->blocking = BLK_ON; - (*in)->timeout = - (*out)->timeout = -1; - (*in)->ungetchar = -1; - (*in)->thlock = - (*out)->thlock = NULL; - } - else - { - if (filedes[0] != -1) - close(filedes[0]); + if (pipe(filedes) == -1) { return errno; - } + } - apr_pool_cleanup_register((*in)->pool, (void *)(*in), apr_netware_pipe_cleanup, + (*in) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + + (*in)->pool = + (*out)->pool = pool; + (*in)->filedes = filedes[0]; + (*out)->filedes = filedes[1]; + (*in)->pipe = + (*out)->pipe = 1; + (*out)->fname = + (*in)->fname = NULL; + (*in)->buffered = + (*out)->buffered = 0; + (*in)->blocking = + (*out)->blocking = BLK_ON; + (*in)->timeout = + (*out)->timeout = -1; + (*in)->ungetchar = -1; + (*in)->thlock = + (*out)->thlock = NULL; + + apr_pool_cleanup_register((*in)->pool, (void *)(*in), apr_unix_file_cleanup, apr_pool_cleanup_null); - apr_pool_cleanup_register((*out)->pool, (void *)(*out), apr_netware_pipe_cleanup, + apr_pool_cleanup_register((*out)->pool, (void *)(*out), apr_unix_file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; diff --git a/include/arch/netware/fileio.h b/include/arch/netware/fileio.h index 93a112b0a76..62db86e5e22 100644 --- a/include/arch/netware/fileio.h +++ b/include/arch/netware/fileio.h @@ -162,7 +162,6 @@ apr_status_t filepath_has_drive(const char *rootpath, int only, apr_pool_t *p); apr_status_t filepath_compare_drive(const char *path1, const char *path2, apr_pool_t *p); apr_status_t apr_unix_file_cleanup(void *); -apr_status_t apr_netware_pipe_cleanup(void *thefile); #endif /* ! FILE_IO_H */ From 86f9f2d755c2829b35711cc5c9053dbd179a3095 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 29 May 2002 21:13:01 +0000 Subject: [PATCH 3429/7878] Reimplemented apr_proc_create() on NetWare to use the new processve() function rather than the NXVmSpawn() stuff. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63439 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 153 ++++++-------------------------------- 1 file changed, 23 insertions(+), 130 deletions(-) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index a83e93e5078..7a409160785 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -293,150 +293,43 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, apr_procattr_t *attr, apr_pool_t *pool) { - int i, envCount=0; - const char **newargs; - char **newenv; - NXVmId_t newVM; - unsigned long flags = NX_VM_SAME_ADDRSPACE; - char **sysenv = NULL; - - NXNameSpec_t nameSpec; - NXExecEnvSpec_t envSpec; - - /* Set up the info for the NLM to be started */ - nameSpec.ssType = NX_OBJ_FILE; - nameSpec.ssPathCtx = NULL; - nameSpec.ssPath = (void*)progname; - - /* Count how many arguments there are and assign them - to the environent */ - for (i=0;args && args[i];i++); - envSpec.esArgc = i; - envSpec.esArgv = (void**)args; - - getenv("ENV"); /* just needs to be here for now */ - sysenv = nxGetEnviron(); - /* Count how many environment variables there are in the - system, add any new environment variables and place - them in the environment. */ - for (i=0;env && env[i];i++); - for (envCount=0;sysenv && sysenv[envCount];envCount++); - if ((envCount + i) > 0) { - newenv = (char **) NXMemAlloc(sizeof(char *) * (envCount+i+1), 0); - if (!newenv) - return APR_ENOMEM; - for (i=0;sysenv && sysenv[i];i++) { - newenv[i] = (char*)sysenv[i]; - } - for (i=0;env && env[i];i++) { - newenv[envCount+i-1] = (char*)env[i]; - } - newenv[envCount+i] = NULL; + wiring_t wire; + + wire.infd = attr->child_in ? attr->child_in->filedes : FD_UNUSED; + wire.outfd = attr->child_out ? attr->child_out->filedes : FD_UNUSED; + wire.errfd = attr->child_err ? attr->child_err->filedes : FD_UNUSED; + + newproc->in = attr->parent_in; + newproc->out = attr->parent_out; + newproc->err = attr->parent_err; - envSpec.esEnv = (void**)newenv; + /* XXX Switch to spawning in separate address spaces once the address + space shutdown problem is fixed. */ + if ((newproc->pid = processve(progname, PROC_CURRENT_SPACE, (const char**)env, &wire, + NULL, NULL, (const char **)args)) == 0) { + return errno; } - else - envSpec.esEnv = NULL; - envSpec.esStdin.ssType = NX_OBJ_FIFO; - envSpec.esStdin.ssHandle = -1; - envSpec.esStdin.ssPathCtx = 0; if (attr->child_in) { apr_pool_cleanup_kill(apr_file_pool_get(attr->child_in), - attr->child_in, apr_netware_pipe_cleanup); - envSpec.esStdin.ssPath = attr->child_in->fname; + attr->child_in, apr_unix_file_cleanup); apr_file_close(attr->child_in); - if (attr->parent_in) { - close(attr->parent_in->filedes); - attr->parent_in->filedes = pipe_open(attr->parent_in->fname, O_WRONLY); - /* XXX take this out when pipe blocking is fixed */ - fcntl(attr->parent_in->filedes, F_SETFL, 0); - } - } - else if (attr->parent_in) { - envSpec.esStdin.ssPath = attr->parent_in->fname; - close(attr->parent_in->filedes); - attr->parent_in->filedes = pipe_open(attr->parent_in->fname, O_WRONLY); - /* XXX take this out when pipe blocking is fixed */ - fcntl(attr->parent_in->filedes, F_SETFL, 0); } - else { - envSpec.esStdin.ssPath = NULL; - } - - envSpec.esStdout.ssType = NX_OBJ_FIFO; - envSpec.esStdout.ssHandle = -1; - envSpec.esStdout.ssPathCtx = 0; if (attr->child_out) { - apr_pool_cleanup_kill(apr_file_pool_get(attr->child_out), - attr->child_out, apr_netware_pipe_cleanup); - envSpec.esStdout.ssPath = attr->child_out->fname; + apr_pool_cleanup_kill(apr_file_pool_get(attr->child_out), + attr->child_out, apr_unix_file_cleanup); apr_file_close(attr->child_out); - if (attr->parent_out) { - close(attr->parent_out->filedes); - attr->parent_out->filedes = pipe_open(attr->parent_out->fname, O_RDONLY); - /* XXX take this out when pipe blocking is fixed */ - fcntl(attr->parent_out->filedes, F_SETFL, 0); - } - } - else if (attr->parent_out) { - envSpec.esStdout.ssPath = attr->parent_out->fname; - close(attr->parent_out->filedes); - attr->parent_out->filedes = pipe_open(attr->parent_out->fname, O_RDONLY); - /* XXX take this out when pipe blocking is fixed */ - fcntl(attr->parent_out->filedes, F_SETFL, 0); - } - else { - envSpec.esStdout.ssPath = NULL; } - - envSpec.esStderr.ssType = NX_OBJ_FIFO; - envSpec.esStderr.ssHandle = -1; - envSpec.esStderr.ssPathCtx = 0; if (attr->child_err) { - apr_pool_cleanup_kill(apr_file_pool_get(attr->child_err), - attr->child_err, apr_netware_pipe_cleanup); - envSpec.esStderr.ssPath = attr->child_err->fname; + apr_pool_cleanup_kill(apr_file_pool_get(attr->child_err), + attr->child_err, apr_unix_file_cleanup); apr_file_close(attr->child_err); - if (attr->parent_err) { - close(attr->parent_err->filedes); - attr->parent_err->filedes = pipe_open(attr->parent_err->fname, O_RDONLY); - /* XXX take this out when pipe blocking is fixed */ - fcntl(attr->parent_err->filedes, F_SETFL, 0); - } - } - else if (attr->parent_err) { - envSpec.esStderr.ssPath = attr->parent_err->fname; - close(attr->parent_err->filedes); - attr->parent_err->filedes = pipe_open(attr->parent_err->fname, O_RDONLY); - /* XXX take this out when pipe blocking is fixed */ - fcntl(attr->parent_err->filedes, F_SETFL, 0); - } - else { - envSpec.esStderr.ssPath = NULL; } - if (attr->detached) { - flags = NX_VM_CREATE_DETACHED; - } - - newproc->in = attr->parent_in; - newproc->err = attr->parent_err; - newproc->out = attr->parent_out; - if (NXVmSpawn(&nameSpec, &envSpec, flags, &newVM) != 0) { - apr_file_close(attr->parent_in); - apr_file_close(attr->parent_out); - apr_file_close(attr->parent_err); - return errno; - } - else { - newproc->pid = newVM; - apr_pool_cleanup_register(pool, (void *)newproc, apr_netware_proc_cleanup, - apr_pool_cleanup_null); - } - /*if (sysenv) - free(sysenv); - */ + +// apr_pool_cleanup_register(pool, (void *)newproc, apr_netware_proc_cleanup, +// apr_pool_cleanup_null); + return APR_SUCCESS; } From b37090074d3932a2b340192f0cb70beba4e9c675 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 29 May 2002 21:19:44 +0000 Subject: [PATCH 3430/7878] Split APR_THREAD_MUTEX_DEFAULT with a new APR_THREAD_MUTEX_UNNESTED which guarentees unnested lock behavior, keep APR_THREAD_MUTEX_DEFAULT on Win32, Netware and OS2 as nested locks, leave Unix and BeOS with unnested locks by default. Needs an implementation on Netware and OS2 for UNNESTED locks, for now return APR_ENOTIMPL. Required for absolute locks in series for Win32 on the same thread, since CriticalSection objects are blindingly fast without contention, but they will always nest on the same thread. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63440 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_mutex.h | 7 ++- include/arch/win32/thread_mutex.h | 16 +++++- locks/beos/thread_mutex.c | 4 ++ locks/netware/thread_mutex.c | 6 ++- locks/os2/thread_mutex.c | 3 ++ locks/unix/thread_mutex.c | 4 ++ locks/win32/thread_mutex.c | 81 ++++++++++++++++++++++++++----- 7 files changed, 105 insertions(+), 16 deletions(-) diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 4e9381570cf..e7014b2b678 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -79,6 +79,7 @@ typedef struct apr_thread_mutex_t apr_thread_mutex_t; #define APR_THREAD_MUTEX_DEFAULT 0x0 #define APR_THREAD_MUTEX_NESTED 0x1 +#define APR_THREAD_MUTEX_UNNESTED 0x2 /* Delayed the include to avoid a circular reference */ #include "apr_pools.h" @@ -89,10 +90,14 @@ typedef struct apr_thread_mutex_t apr_thread_mutex_t; * stored. * @param flags Or'ed value of: *

    - *           APR_THREAD_MUTEX_DEFAULT   normal lock behavior (non-recursive).
    + *           APR_THREAD_MUTEX_DEFAULT   platform-optimal lock behavior.
      *           APR_THREAD_MUTEX_NESTED    enable nested (recursive) locks.
    + *           APR_THREAD_MUTEX_UNNESTED  disable nested locks (non-recursive).
      * 
    * @param pool the pool from which to allocate the mutex. + * @tip Be cautious in using APR_THREAD_MUTEX_DEFAULT. While this is the + * most optimial mutex based on a given platform's performance charateristics, + * it will behave as either a nested or an unnested lock. */ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, unsigned int flags, diff --git a/include/arch/win32/thread_mutex.h b/include/arch/win32/thread_mutex.h index 9744bf9c5a2..dd59be8cdcc 100644 --- a/include/arch/win32/thread_mutex.h +++ b/include/arch/win32/thread_mutex.h @@ -57,9 +57,21 @@ #include "apr_pools.h" +typedef enum thread_mutex_type { + thread_mutex_critical_section, + thread_mutex_unnested_event, + thread_mutex_nested_mutex +} thread_mutex_type; + +/* handle applies only to unnested_event on all platforms + * and nested_mutex on Win9x only. Otherwise critical_section + * is used for NT nexted mutexes providing optimal performance. + */ struct apr_thread_mutex_t { - apr_pool_t *pool; - CRITICAL_SECTION section; + apr_pool_t *pool; + thread_mutex_type type; + HANDLE handle; + CRITICAL_SECTION section; }; #endif /* THREAD_MUTEX_H */ diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index 33b89b90d03..0ffd305331b 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -96,6 +96,10 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, new_m->LockCount = 0; new_m->Lock = stat; new_m->pool = pool; + + /* Optimal default is APR_THREAD_MUTEX_UNNESTED, + * no additional checks required for either flag. + */ new_m->nested = flags & APR_THREAD_MUTEX_NESTED; apr_pool_cleanup_register(new_m->pool, (void *)new_m, _thread_mutex_cleanup, diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index 22b5bff4e50..1c892feb3d2 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -73,6 +73,11 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, { apr_thread_mutex_t *new_mutex = NULL; + /* XXX: Implement _UNNESTED flavor and favor _DEFAULT for performance + */ + if (flags & APR_THREAD_MUTEX_UNNESTED) { + return APR_ENOTIMPL; + } new_mutex = (apr_thread_mutex_t *)apr_pcalloc(pool, sizeof(apr_thread_mutex_t)); if(new_mutex ==NULL) { @@ -80,7 +85,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, } new_mutex->pool = pool; - /* FIXME: only use recursive locks if (flags & APR_THREAD_MUTEX_NESTED) */ new_mutex->mutex = NXMutexAlloc(NX_MUTEX_RECURSIVE, NULL, NULL); if(new_mutex->mutex == NULL) diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index 25774128a33..24c514208a2 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -69,6 +69,9 @@ static apr_status_t thread_mutex_cleanup(void *themutex) +/* XXX: Need to respect APR_THREAD_MUTEX_[UN]NESTED flags argument + * or return APR_ENOTIMPL!!! + */ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, unsigned int flags, apr_pool_t *pool) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 170e0b70a7b..8245781c1a7 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -89,6 +89,10 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, } new_mutex->pool = pool; + + /* Optimal default is APR_THREAD_MUTEX_UNNESTED, + * no additional checks required for either flag. + */ new_mutex->nested = flags & APR_THREAD_MUTEX_NESTED; if ((rv = pthread_mutexattr_init(&mattr))) { diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 96480925907..cf9981a66a6 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -65,7 +65,14 @@ static apr_status_t thread_mutex_cleanup(void *data) { apr_thread_mutex_t *lock = data; - DeleteCriticalSection(&lock->section); + if (lock->type == thread_mutex_critical_section) { + DeleteCriticalSection(&lock->section); + } + else { + if (!CloseHandle(lock->handle)) { + return apr_get_os_error(); + } + } return APR_SUCCESS; } @@ -76,9 +83,34 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, (*mutex) = (apr_thread_mutex_t *)apr_palloc(pool, sizeof(**mutex)); (*mutex)->pool = pool; - /* FIXME: Implement nested (aka recursive) locks or use a native - * win32 implementation if available. */ - InitializeCriticalSection(&(*mutex)->section); + + if (flags & APR_THREAD_MUTEX_UNNESTED) { + /* Use an auto-reset signaled event, ready to accept one + * waiting thread. + */ + (*mutex)->type = thread_mutex_unnested_event; + (*mutex)->handle = CreateEvent(NULL, FALSE, TRUE, NULL); + } + else { +#if APR_HAS_UNICODE_FS + /* Critical Sections are terrific, performance-wise, on NT. + * On Win9x, we cannot 'try' on a critical section, so we + * use a [slower] mutex object, instead. + */ + IF_WIN_OS_IS_UNICODE { + (*mutex)->type = thread_mutex_critical_section; + InitializeCriticalSection(&(*mutex)->section); + } +#endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { + (*mutex)->type = thread_mutex_nested_mutex; + (*mutex)->handle = CreateMutex(NULL, FALSE, NULL); + + } +#endif + } + apr_pool_cleanup_register((*mutex)->pool, (*mutex), thread_mutex_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; @@ -86,24 +118,49 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { - EnterCriticalSection(&mutex->section); + if (mutex->type == thread_mutex_critical_section) { + EnterCriticalSection(&mutex->section); + } + else { + DWORD rv = WaitForSingleObject(mutex->handle, INFINITE); + if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) { + return (rv == WAIT_TIMEOUT) ? APR_EBUSY : apr_get_os_error(); + } + } return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { - if (apr_os_level < APR_WIN_NT) { - return APR_ENOTIMPL; - } - if (TryEnterCriticalSection(&mutex->section)) { - return APR_SUCCESS; + if (mutex->type == thread_mutex_critical_section) { + if (!TryEnterCriticalSection(&mutex->section)) { + return APR_EBUSY; + } } - return APR_EBUSY; + else { + DWORD rv = WaitForSingleObject(mutex->handle, 0); + if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) { + return (rv == WAIT_TIMEOUT) ? APR_EBUSY : apr_get_os_error(); + } + } + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { - LeaveCriticalSection(&mutex->section); + if (mutex->type == thread_mutex_critical_section) { + LeaveCriticalSection(&mutex->section); + } + else if (mutex->type == thread_mutex_unnested_event) { + if (!SetEvent(mutex->handle)) { + return apr_get_os_error(); + } + } + else if (mutex->type == thread_mutex_nested_mutex) { + if (!ReleaseMutex(mutex->handle)) { + return apr_get_os_error(); + } + } return APR_SUCCESS; } From de08c03c30467081ce4ad998dcae702b5684cb1d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 29 May 2002 22:07:58 +0000 Subject: [PATCH 3431/7878] Fix apr_generate_random_bytes() for Win32 on Win NT or 9x by dropping the 0x40 bit (CRYPT_SILENT) for earlier OS'es. Thanks for nagging Mr. Trawick :) PR: 9286 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63441 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/rand.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 3bf8c31ca74..ca55caebaec 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -54,6 +54,7 @@ #include "apr_private.h" #include "apr_general.h" +#include "misc.h" #include APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, @@ -63,9 +64,12 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, apr_status_t res = APR_SUCCESS; /* 0x40 bit = CRYPT_SILENT, only introduced in more recent PSDKs + * and will only work for Win2K and later. */ - if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT | 0x40)) { + DWORD flags = CRYPT_VERIFYCONTEXT + | ((apr_os_level >= APR_WIN_2000) ? 0x40 : 0); + + if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, flags)) { return apr_get_os_error(); } if (!CryptGenRandom(hProv, length, buf)) { From f3b15f8acfd75d5e45c6c669bc7a425e40173305 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 29 May 2002 22:08:43 +0000 Subject: [PATCH 3432/7878] Forgot to commit [actually explicitly committed, but forgot to save first.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63442 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 6cae608ca7e..0131b2272a5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Fixed apr_generate_random_bytes() for Win32 on Win NT or 9x by + dropping the 0x40 bit (CRYPT_SILENT) for earlier OS'es. + PR 9286 [William Rowe] + *) Added --with-devrandom=[DEV] configure flag which allows a particular "/dev/random"-compatible device to be specified, overriding the default search path (/dev/random then /dev/arandom then /dev/urandom). From 9d302d3249081cc24d94416737412cf41b346243 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Wed, 29 May 2002 23:02:24 +0000 Subject: [PATCH 3433/7878] Don't inline and export functions at the same time. Submitted by: Branko Cibej git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63443 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index d74a916b920..8bd0f92e047 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -142,14 +142,12 @@ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) } #if APR_HAS_THREADS -APR_INLINE APR_DECLARE(void) apr_allocator_set_mutex(apr_allocator_t *allocator, apr_thread_mutex_t *mutex) { allocator->mutex = mutex; } -APR_INLINE APR_DECLARE(apr_thread_mutex_t *) apr_allocator_get_mutex( apr_allocator_t *allocator) { @@ -194,9 +192,8 @@ APR_DECLARE(void) apr_allocator_set_max_free(apr_allocator_t *allocator, #endif } -APR_INLINE -APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, - apr_size_t size) +static APR_INLINE +apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size) { apr_memnode_t *node, **ref; apr_uint32_t i, index, max_index; @@ -331,9 +328,8 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, return node; } -APR_INLINE -APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, - apr_memnode_t *node) +static APR_INLINE +void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) { apr_memnode_t *next, *freelist = NULL; apr_uint32_t index, max_index; @@ -395,6 +391,18 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, } } +APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, + apr_size_t size) +{ + return allocator_alloc(allocator, size); +} + +APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, + apr_memnode_t *node) +{ + allocator_free(allocator, node); +} + /* * Debug level @@ -617,7 +625,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) node->next->ref = node->ref; } else { - if ((node = apr_allocator_alloc(pool->allocator, size)) == NULL) { + if ((node = allocator_alloc(pool->allocator, size)) == NULL) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); @@ -719,7 +727,7 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) return; *active->ref = NULL; - apr_allocator_free(pool->allocator, active->next); + allocator_free(pool->allocator, active->next); active->next = active; active->ref = &active->next; } @@ -778,7 +786,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) /* Free all the nodes in the pool (including the node holding the * pool struct), by giving them back to the allocator. */ - apr_allocator_free(allocator, active); + allocator_free(allocator, active); /* If this pool happens to be the owner of the allocator, free * everything in the allocator (that includes the pool struct @@ -809,8 +817,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, if (allocator == NULL) allocator = parent->allocator; - if ((node = apr_allocator_alloc(allocator, - MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { + if ((node = allocator_alloc(allocator, + MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -944,7 +952,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) node = pool->active; } else { - if ((node = apr_allocator_alloc(pool->allocator, size)) == NULL) + if ((node = allocator_alloc(pool->allocator, size)) == NULL) return -1; if (ps->got_a_new_node) { @@ -996,8 +1004,8 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) strp = ps.node->first_avail; ps.node->first_avail += size; - if (ps.free) - apr_allocator_free(pool->allocator, ps.free); + if (ps.free) + allocator_free(pool->allocator, ps.free); /* * Link the node in if it's a new one From 4993350fb2a7800e0545701a8d6c5efe226d9ffa Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 30 May 2002 00:20:56 +0000 Subject: [PATCH 3434/7878] Renames: apr_allocator_set_owner -> apr_allocator_owner_set apr_allocator_get_owner -> apr_allocator_owner_get apr_allocator_set_mutex -> apr_allocator_mutex_set apr_allocator_get_mutex -> apr_allocator_mutex_get Suggested by: Cliff Woolley git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63444 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 8 ++++---- include/apr_pools.h | 2 +- memory/unix/apr_pools.c | 26 +++++++++++++------------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index a509d9ee86b..fe548c6253c 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -144,14 +144,14 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, * you can make a pool an owner, but if the pool doesn't use the allocator * the allocator will never be destroyed. */ -APR_DECLARE(void) apr_allocator_set_owner(apr_allocator_t *allocator, +APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator, apr_pool_t *pool); /** * Get the current owner of the allocator * @param allocator The allocator to get the owner from */ -APR_DECLARE(apr_pool_t *) apr_allocator_get_owner(apr_allocator_t *allocator); +APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator); /** @@ -171,14 +171,14 @@ APR_DECLARE(void) apr_allocator_set_max_free(apr_allocator_t *allocator, * @param allocator The allocator to set the mutex for * @param mutex The mutex */ -APR_DECLARE(void) apr_allocator_set_mutex(apr_allocator_t *allocator, +APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator, apr_thread_mutex_t *mutex); /** * Get the mutex currently set for the allocator * @param allocator The allocator */ -APR_DECLARE(apr_thread_mutex_t *) apr_allocator_get_mutex( +APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get( apr_allocator_t *allocator); #endif /* APR_HAS_THREADS */ diff --git a/include/apr_pools.h b/include/apr_pools.h index 275624b1739..cde48482675 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -150,7 +150,7 @@ typedef struct apr_pool_t apr_pool_t; * combination with the verbose flag above, * it will output OWNER in such an event * prior to aborting. Use the debug - * function apr_pool_set_owner() to switch + * function apr_pool_owner_set() to switch * a pools ownership. * * When no debug level was specified, assume general debug mode. diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 8bd0f92e047..01ff5ad3b25 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -142,26 +142,26 @@ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) } #if APR_HAS_THREADS -APR_DECLARE(void) apr_allocator_set_mutex(apr_allocator_t *allocator, +APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator, apr_thread_mutex_t *mutex) { allocator->mutex = mutex; } -APR_DECLARE(apr_thread_mutex_t *) apr_allocator_get_mutex( +APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get( apr_allocator_t *allocator) { return allocator->mutex; } #endif /* APR_HAS_THREADS */ -APR_DECLARE(void) apr_allocator_set_owner(apr_allocator_t *allocator, +APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator, apr_pool_t *pool) { allocator->owner = pool; } -APR_DECLARE(apr_pool_t *) apr_allocator_get_owner(apr_allocator_t *allocator) +APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator) { return allocator->owner; } @@ -174,7 +174,7 @@ APR_DECLARE(void) apr_allocator_set_max_free(apr_allocator_t *allocator, #if APR_HAS_THREADS apr_thread_mutex_t *mutex; - mutex = apr_allocator_get_mutex(allocator); + mutex = apr_allocator_mutex_get(allocator); if (mutex != NULL) apr_thread_mutex_lock(mutex); #endif /* APR_HAS_THREADS */ @@ -553,11 +553,11 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) return rv; } - apr_allocator_set_mutex(global_allocator, mutex); + apr_allocator_mutex_set(global_allocator, mutex); } #endif /* APR_HAS_THREADS */ - apr_allocator_set_owner(global_allocator, global_pool); + apr_allocator_owner_set(global_allocator, global_pool); return APR_SUCCESS; } @@ -754,7 +754,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) #if APR_HAS_THREADS apr_thread_mutex_t *mutex; - if ((mutex = apr_allocator_get_mutex(pool->parent->allocator)) != NULL) + if ((mutex = apr_allocator_mutex_get(pool->parent->allocator)) != NULL) apr_thread_mutex_lock(mutex); #endif /* APR_HAS_THREADS */ @@ -775,11 +775,11 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) *active->ref = NULL; #if APR_HAS_THREADS - if (apr_allocator_get_owner(allocator) == pool) { + if (apr_allocator_owner_get(allocator) == pool) { /* Make sure to remove the lock, since it is highly likely to * be invalid now. */ - apr_allocator_set_mutex(allocator, NULL); + apr_allocator_mutex_set(allocator, NULL); } #endif /* APR_HAS_THREADS */ @@ -793,7 +793,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) * and the allocator). Don't worry about destroying the optional mutex * in the allocator, it will have been destroyed by the cleanup function. */ - if (apr_allocator_get_owner(allocator) == pool) { + if (apr_allocator_owner_get(allocator) == pool) { apr_allocator_destroy(allocator); } } @@ -848,7 +848,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, #if APR_HAS_THREADS apr_thread_mutex_t *mutex; - if ((mutex = apr_allocator_get_mutex(allocator)) != NULL) + if ((mutex = apr_allocator_mutex_get(allocator)) != NULL) apr_thread_mutex_lock(mutex); #endif /* APR_HAS_THREADS */ @@ -1421,7 +1421,7 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, } if (pool->allocator != NULL - && apr_allocator_get_owner(pool->allocator) == pool) { + && apr_allocator_owner_get(pool->allocator) == pool) { apr_allocator_destroy(pool->allocator); } From 804448970783884bbfbd3eff9b33d0dd84eaebe0 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 30 May 2002 00:36:42 +0000 Subject: [PATCH 3435/7878] Fix the pool debug code. A pool clear destroys the pools mutex. Make sure no other code uses the pools mutex while it is invalid. Tested by: Philip Martin git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63445 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 01ff5ad3b25..a52b04caa80 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1382,13 +1382,44 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, const char *file_line) { +#if APR_HAS_THREADS + apr_thread_mutex_t *mutex = NULL; +#endif + apr_pool_check_integrity(pool); #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) apr_pool_log_event(pool, "CLEAR", file_line, 1); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ +#if APR_HAS_THREADS + if (pool->parent != NULL) + mutex = pool->parent->mutex; + + /* Lock the parent mutex before clearing so that if we have our + * own mutex it won't be accessed by apr_pool_walk_tree after + * it has been destroyed. + */ + if (mutex != NULL && mutex != pool->mutex) { + apr_thread_mutex_lock(mutex); + } +#endif + pool_clear_debug(pool, file_line); + +#if APR_HAS_THREADS + /* If we had our own mutex, it will have been destroyed by + * the registered cleanups. Recreate the mutex. Unlock + * the mutex we obtained above. + */ + if (mutex != pool->mutex) { + (void)apr_thread_mutex_create(&pool->mutex, + APR_THREAD_MUTEX_NESTED, pool); + + if (mutex != NULL) + (void)apr_thread_mutex_unlock(mutex); + } +#endif /* APR_HAS_THREADS */ } APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, From 1dabb6597d7cfe0ddbd3df3a837a4550bbb5300a Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 30 May 2002 00:54:55 +0000 Subject: [PATCH 3436/7878] The style police patrols in a dimly lit alleyway... Issued tickets for tabs and trailing whitespace. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63446 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index a52b04caa80..51c0d9a5498 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -948,7 +948,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) active->next = node; node->ref = &active->next; } - + node = pool->active; } else { @@ -957,7 +957,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) if (ps->got_a_new_node) { active->next = ps->free; - ps->free = node; + ps->free = node; } ps->got_a_new_node = 1; @@ -1385,7 +1385,7 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, #if APR_HAS_THREADS apr_thread_mutex_t *mutex = NULL; #endif - + apr_pool_check_integrity(pool); #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) @@ -1394,17 +1394,17 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, #if APR_HAS_THREADS if (pool->parent != NULL) - mutex = pool->parent->mutex; - + mutex = pool->parent->mutex; + /* Lock the parent mutex before clearing so that if we have our * own mutex it won't be accessed by apr_pool_walk_tree after * it has been destroyed. */ if (mutex != NULL && mutex != pool->mutex) { - apr_thread_mutex_lock(mutex); + apr_thread_mutex_lock(mutex); } #endif - + pool_clear_debug(pool, file_line); #if APR_HAS_THREADS @@ -1416,8 +1416,8 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, (void)apr_thread_mutex_create(&pool->mutex, APR_THREAD_MUTEX_NESTED, pool); - if (mutex != NULL) - (void)apr_thread_mutex_unlock(mutex); + if (mutex != NULL) + (void)apr_thread_mutex_unlock(mutex); } #endif /* APR_HAS_THREADS */ } From 413461e7ae1b3170ac3613970e061392143529f2 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 30 May 2002 01:06:42 +0000 Subject: [PATCH 3437/7878] New function: apr_pool_allocator_get. This function allows us to find out which allocator is being used by a pool. This is particularly usefull when you have created a pool with its own allocator, but don't want to keep a global pointer around to do tricks with its max free size or its mutexes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63447 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 6 ++++++ memory/unix/apr_pools.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/include/apr_pools.h b/include/apr_pools.h index cde48482675..e4bc5e5bdcf 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -289,6 +289,12 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, (void)apr_pool_create_ex(newpool, parent, abort_fn, NULL) #endif +/** + * Find the pools allocator + * @param pool The pool to get the allocator from. + */ +APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool); + /** * Clear all memory in the pool and run all the cleanups. This also destroys all * subpools. diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 51c0d9a5498..a7601c968c2 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -873,6 +873,11 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, return APR_SUCCESS; } +APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool) +{ + return pool->allocator; +} + /* * "Print" functions From adf34b40f3163a57cec8c80aabc2682441b40850 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 30 May 2002 01:15:29 +0000 Subject: [PATCH 3438/7878] Move the apr_pool_allocator_get out of the #if !APR_POOL_DEBUG block. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63448 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index a7601c968c2..cdcc3a6025e 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -873,11 +873,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, return APR_SUCCESS; } -APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool) -{ - return pool->allocator; -} - /* * "Print" functions @@ -1755,6 +1750,11 @@ APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool) return pool->parent; } +APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool) +{ + return pool->allocator; +} + /* return TRUE if a is an ancestor of b * NULL is considered an ancestor of all pools */ From b5d90b873e7555c4df7daf7f114e8ba9c414bae3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 30 May 2002 05:25:00 +0000 Subject: [PATCH 3439/7878] Modify our pipe semantics to match linux, such that at least 65536 bytes may be written to the pipe before it deadlocks. Matches our 1.3 fix. PR: 8179 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63449 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 1 + file_io/win32/pipe.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index e0615076b0c..6435aa133fe 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -519,6 +519,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file)->filehand = *thefile; (*file)->ungetchar = -1; /* no char avail */ (*file)->flags; + (*file)->pipe; return APR_SUCCESS; } diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 9d1a1284126..1ccca5204d0 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -122,7 +122,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*out)->dataRead = 0; (*out)->direction = 0; - if (!CreatePipe(&(*in)->filehand, &(*out)->filehand, &sa, 0)) { + if (!CreatePipe(&(*in)->filehand, &(*out)->filehand, &sa, 65536)) { return apr_get_os_error(); } @@ -214,8 +214,8 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, dwOpenMode, dwPipeMode, 1, //nMaxInstances, - 8182, //nOutBufferSize, - 8192, //nInBufferSize, + 0, //nOutBufferSize, + 65536, //nInBufferSize, 1, //nDefaultTimeOut, &sa); @@ -237,7 +237,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, } else { /* Pipes on Win9* are blocking. Live with it. */ - if (!CreatePipe(&(*in)->filehand, &(*out)->filehand, &sa, 0)) { + if (!CreatePipe(&(*in)->filehand, &(*out)->filehand, &sa, 65536)) { return apr_get_os_error(); } } From aa9eb4b6e7209804a12df2e84f30af96080e853f Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Fri, 31 May 2002 00:07:40 +0000 Subject: [PATCH 3440/7878] "I can see down your shirt!" -- Joe Dirt git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63450 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index f1876d9a827..553b427be63 100644 --- a/STATUS +++ b/STATUS @@ -1,8 +1,10 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/24 18:34:36 $] +Last modified at [$Date: 2002/05/31 00:07:40 $] Release: + 0.9.0-dev : in progress + 2.0a9 : released December 12, 2000 2.0a8 : released November 20, 2000 2.0a7 : released October 8, 2000 @@ -49,6 +51,11 @@ RELEASE SHOWSTOPPERS: a way to support alternate allocators polymorphically without a significant performance penalty. + * extract the MAJOR version from apr_version.h and pass it to + libtool for use in applying version numbers to the shared + libraries. + + CURRENT VOTES: * For the atomics code to be efficient it depends on instructions From 07358baf8542fb4f7b8a2bab806450333e69780c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 31 May 2002 04:37:27 +0000 Subject: [PATCH 3441/7878] Some win32 experimental code I'm playing with. Simply demonstrates how to configure an app for WinNT or all Win32 applications. I expect to extend this simple code to actually set up and test different 'signalling' APIs that are supported under Win32 (e.g. console, service, 9x hidden console service, etc.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63451 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.dsw | 38 ++++++++++++++++- test/testapp.c | 10 +++++ test/testapp.dsp | 90 ++++++++++++++++++++++++++++++++++++++++ test/testappnt.dsp | 101 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 238 insertions(+), 1 deletion(-) create mode 100644 test/testapp.c create mode 100644 test/testapp.dsp create mode 100644 test/testappnt.dsp diff --git a/test/aprtest.dsw b/test/aprtest.dsw index e9e79dde08c..d82af60f1b9 100644 --- a/test/aprtest.dsw +++ b/test/aprtest.dsw @@ -30,6 +30,21 @@ Package=<4> ############################################################################### +Project: "aprtest"=".\aprtest.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name apr + End Project Dependency +}}} + +############################################################################### + Project: "libapr"="..\libapr.dsp" - Package Owner=<4> Package=<5> @@ -57,7 +72,25 @@ Package=<4> ############################################################################### -Project: "aprtest"=".\aprtest.dsp" - Package Owner=<4> +Project: "testapp"=".\testapp.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name apr + End Project Dependency + Begin Project Dependency + Project_Dep_Name apr_app + End Project Dependency +}}} + +############################################################################### + +Project: "testappnt"=".\testappnt.dsp" - Package Owner=<4> Package=<5> {{{ @@ -68,6 +101,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name apr End Project Dependency + Begin Project Dependency + Project_Dep_Name apr_app + End Project Dependency }}} ############################################################################### diff --git a/test/testapp.c b/test/testapp.c new file mode 100644 index 00000000000..9e5bec3c5ff --- /dev/null +++ b/test/testapp.c @@ -0,0 +1,10 @@ +#include +#include + +int main(int argc, const char * const * argv, const char * const *env) +{ + apr_app_initialize(&argc, &argv, &env); + + + apr_terminate(); +} \ No newline at end of file diff --git a/test/testapp.dsp b/test/testapp.dsp new file mode 100644 index 00000000000..9260851fb84 --- /dev/null +++ b/test/testapp.dsp @@ -0,0 +1,90 @@ +# Microsoft Developer Studio Project File - Name="testapp" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=testapp - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "testapp.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "testapp.mak" CFG="testapp - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "testapp - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "testapp - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "testapp - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /Fd"./testapp" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /map /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /map /machine:I386 + +!ELSEIF "$(CFG)" == "testapp - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "." +# PROP BASE Intermediate_Dir "." +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "." +# PROP Intermediate_Dir "." +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /Fd"./testapp" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /map /debug /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /map /debug /machine:I386 + +!ENDIF + +# Begin Target + +# Name "testapp - Win32 Release" +# Name "testapp - Win32 Debug" +# Begin Source File + +SOURCE=.\testapp.c +# End Source File +# End Target +# End Project diff --git a/test/testappnt.dsp b/test/testappnt.dsp new file mode 100644 index 00000000000..4f258b29d8b --- /dev/null +++ b/test/testappnt.dsp @@ -0,0 +1,101 @@ +# Microsoft Developer Studio Project File - Name="testappnt" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=testappnt - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "testappnt.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "testappnt.mak" CFG="testappnt - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "testappnt - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "testappnt - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "testappnt - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "WINNT" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../include" /D "NDEBUG" /D "WIN32" /D "WINNT" /D "_CONSOLE" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /Fd"./testappnt" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /map /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console /map /machine:I386 + +!ELSEIF "$(CFG)" == "testappnt - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "." +# PROP BASE Intermediate_Dir "." +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "." +# PROP Intermediate_Dir "." +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /D "_DEBUG" /D "WIN32" /D "WINNT" /D "_CONSOLE" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /Fd"./testappnt" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /map /debug /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console /incremental:no /map /debug /machine:I386 + +!ENDIF + +# Begin Target + +# Name "testappnt - Win32 Release" +# Name "testappnt - Win32 Debug" +# Begin Source File + +SOURCE=.\testapp.c + +!IF "$(CFG)" == "testappnt - Win32 Release" + +# ADD CPP /Fo"testappnt" + +!ELSEIF "$(CFG)" == "testappnt - Win32 Debug" + +# ADD CPP /Fo"testappnt" + +!ENDIF + +# End Source File +# End Target +# End Project From 58e06c006beec691a7f19ae379ad453baedf6886 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 31 May 2002 16:18:38 +0000 Subject: [PATCH 3442/7878] don't use "pipe" as a field name; some platforms redefine pipe via macro substitution related to PR: 9457 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63452 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 2 +- file_io/unix/pipe.c | 8 ++++---- include/arch/unix/fileio.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 624b66b71c6..f887c9a47c3 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -171,7 +171,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, return errno; } - (*new)->pipe = 0; + (*new)->is_pipe = 0; (*new)->timeout = -1; (*new)->ungetchar = -1; (*new)->eof_hit = 0; diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index dca7b57b811..93745b75539 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -142,7 +142,7 @@ static apr_status_t pipenonblock(apr_file_t *thepipe) APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) { - if (thepipe->pipe == 1) { + if (thepipe->is_pipe == 1) { thepipe->timeout = timeout; if (timeout >= 0) { if (thepipe->blocking != BLK_OFF) { /* blocking or unknown state */ @@ -161,7 +161,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_int APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) { - if (thepipe->pipe == 1) { + if (thepipe->is_pipe == 1) { *timeout = thepipe->timeout; return APR_SUCCESS; } @@ -179,7 +179,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); (*in)->pool = pool; (*in)->filedes = filedes[0]; - (*in)->pipe = 1; + (*in)->is_pipe = 1; (*in)->fname = NULL; (*in)->buffered = 0; (*in)->blocking = BLK_ON; @@ -192,7 +192,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); (*out)->pool = pool; (*out)->filedes = filedes[1]; - (*out)->pipe = 1; + (*out)->is_pipe = 1; (*out)->fname = NULL; (*out)->buffered = 0; (*out)->blocking = BLK_ON; diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index 8394cd151a6..60b91181e3f 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -125,7 +125,7 @@ struct apr_file_t { char *fname; apr_int32_t flags; int eof_hit; - int pipe; + int is_pipe; apr_interval_time_t timeout; int buffered; enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; From 94772fb560e03f410bc2e5700d465cd996ef3be2 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 31 May 2002 17:11:47 +0000 Subject: [PATCH 3443/7878] Added the IPv6 header for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63453 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/apr.hnw b/include/apr.hnw index fd3fee22862..5c257c3409a 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -189,6 +189,10 @@ #include #endif +#if APR_HAVE_IPV6 +#include +#endif + /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY 0 #define APR_HAS_THREADS 1 From da642ea132aa73191c7fc825d856e02fa558a214 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 31 May 2002 17:14:03 +0000 Subject: [PATCH 3444/7878] Switching the blocking and nonblocking functions since they were backwards git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63454 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 031eaa11d91..dc1b6245764 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -71,7 +71,8 @@ static apr_status_t pipeblock(apr_file_t *thepipe) fcntl(thepipe->filedes, F_SETFL, flags); } #else - fcntl(thepipe->filedes, F_SETFL, FNDELAY); + errno = 0; + fcntl(thepipe->filedes, F_SETFL, 0); #endif if (errno) @@ -94,7 +95,8 @@ static apr_status_t pipenonblock(apr_file_t *thepipe) fcntl(thepipe->filedes, F_SETFL, flags); } #else - fcntl(thepipe->filedes, F_SETFL, 0); + errno = 0; + fcntl(thepipe->filedes, F_SETFL, FNDELAY); #endif if (errno) From e85af271e67e0e046982077d853855f89c736dbf Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 31 May 2002 22:17:42 +0000 Subject: [PATCH 3445/7878] Implemented code that discovers the proper casing of the filename as it exists on disk. This had to wait until now for an update to our libraries. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63455 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index a4d746cd1d3..22b885debcd 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -111,7 +111,6 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, char *case_filename(apr_pool_t *pPool, const char *szFile) { char *casedFileName = NULL; -#ifdef WAIT_TO_IMPLEMENT char buf[1024]; NXDirAttrWithName_t *attrBuf; int rc; @@ -122,7 +121,6 @@ char *case_filename(apr_pool_t *pPool, const char *szFile) casedFileName = apr_pstrdup(pPool, attrBuf->deName); } else -#endif { char *s; s = strrchr(szFile, '/'); From d4178240e78735775ed77c27fcc7fa5d8008b5b5 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 31 May 2002 22:19:49 +0000 Subject: [PATCH 3446/7878] Added the pipe test to the test build project. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63456 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 197776 -> 195032 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 4c5c2f67f38790b1c8d29d98ff6602e709ccddb4..856c03e9fa837698443196cfddcda09a7a24e9d1 100644 GIT binary patch delta 99118 zcmb@tbzGE96hCSqA|)tYuOgx}Qql?nN-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B=uoF5Q%iBUudQGggrG$B4EzCoXHkg!~U;m|f0UQvq1QbvQLL8fnNKS{V< z4VDUK%%Ef@(+7`w@vQ>B6E$XhP&}Ib0haj{lB} z#S0S20dn)w(v*SOgN(^ugYw9jfLC2qzODc~5<+Am<`7Sbh8uJn4jYOa6dPh2SjVtO zphM^(_>kg|{19?Tc?jYG@jy$UfuKN29!efS!6jfGNYl;Vl-=NN&TzVJ#%>mS+6M4{ z-WG*sY{?*4lRO$4P1zZc687dB-T47oD0qOl{$b<(bw2nK&l33(%Q;2oH^3+G;(`Ew z@TmEK?%|{JMPd-qj3|vI@)DmD-w;c+)G9yF?a=H)+bIX2gL2WmWWAusX4mueCavpb zN-|_iJUe9j(0v#Ug(|3*Os)C5n%X*K70;t(<`z`O)=b~bHpRBYHVUv{59l{ullX_I zRmR&aCquPFx5UT}-lyINg@RNey7=EX?l395kT*CH+=dsx;vW%twCKy!%qjP&L;vOt zS;a{a-L+um)WdjDEsbXBDXtpmBd{Od0YEc%8C&lUFdbzN*a*K0cnB}x@n&v3&1}s| z|1ob)Wsp79KII7{fh-n(6A*)}>{|1+42UNLj`JmkmeJ%>7emv)A$YM3>kW3mFtE%U zdT!8WDrF9KsvFcNuQ6>n68{e()uFY=ih`1S9&@A$j8RJ;-Hm0J;H4q(ML{0pMxk`y`CkD-*Do0c2KP0kH@3lYQL zba3WhT?R-4yrEM@_e=l0pWB{7;?^6y>HteOPd6pN(ui&fdvf)$U(&(k0Ex49a{_n- z(E2|pCgUMHB9u}_z z#4-Qi?QnKLWYdM~0%Djm+~0VI9=`}gG)h2>b02@^a7F9mBAGbgMS6i^co92@zlk
      * 
    - *     int sum_values(apr_pool_t *p, apr_hash_t *ht)
    - *     {
    - *         apr_hash_index_t *hi;
    - * 	   void *val;
    - * 	   int sum = 0;
    - * 	   for (hi = apr_hash_first(p, ht); hi; hi = apr_hash_next(hi)) {
    - * 	       apr_hash_this(hi, NULL, NULL, &val);
    - * 	       sum += *(int *)val;
    - * 	   }
    - * 	   return sum;
    + * int sum_values(apr_pool_t *p, apr_hash_t *ht)
    + * {
    + *     apr_hash_index_t *hi;
    + *     void *val;
    + *     int sum = 0;
    + *     for (hi = apr_hash_first(p, ht); hi; hi = apr_hash_next(hi)) {
    + *         apr_hash_this(hi, NULL, NULL, &val);
    + *         sum += *(int *)val;
      *     }
    + *     return sum;
    + * }
      * 
      * There is no restriction on adding or deleting hash entries during an
      * iteration (although the results may be unpredictable unless all you do
    
    From e09ce9d4116b29c9c9c8df3dd101bd0fc47ad0a8 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 10 Jul 2002 18:39:54 +0000
    Subject: [PATCH 3585/7878]   Reorder alpha, and clarify
     apr_group_id_/apr_user_id_ [still some   discussion on those.]
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63598 13f79535-47bb-0310-9956-ffa450edef68
    ---
     renames_pending | 31 ++++++++++++++++---------------
     1 file changed, 16 insertions(+), 15 deletions(-)
    
    diff --git a/renames_pending b/renames_pending
    index e961e6c65ec..bc0f0203ffe 100644
    --- a/renames_pending
    +++ b/renames_pending
    @@ -1,13 +1,5 @@
    -Symbol renames for APR 
    +Pending symbol renames for APR [for some discussion yet]
     
    -apr_user_homedir_get             from apr_get_home_directory
    -apr_user_id_get                  from apr_get_userid
    -apr_user_name_get                from apr_get_username
    -
    -----------------------------------------------------------
    -apr_time_exp_gmt_get             from apr_implode_gmt
    -apr_time_interval_t              from apr_interval_time_t
    -apr_time_interval_short_t        from apr_short_interval_time_t
     apr_file_info_t                  from apr_finfo_t
     apr_file_stat                    from apr_stat
     apr_file_lstat                   from apr_lstat
    @@ -21,14 +13,19 @@ apr_lock_type_e                  from apr_locktype_e
     apr_lock_mech_e                  from apr_lockmech_e
     apr_lock_readerwriter_e          from apr_readerwriter_e
     
    +apr_group_id_get                 from apr_get_groupid
    +apr_group_id_compare                from apr_compare_groups
    +
    +apr_hostname_get                 from apr_gethostname
    +
    +apr_port_addr_parse              from apr_parse_addr_port
    +
     apr_socket_shutdown              from apr_shutdown
     apr_socket_bind                  from apr_bind
     apr_socket_listen                from apr_listen
     apr_socket_accept                from apr_accept
     apr_socket_connect               from apr_connect
     apr_sockaddr_name_info_get       from apr_getnameinfo
    -apr_port_addr_parse              from apr_parse_addr_port
    -apr_hostname_get                 from apr_gethostname
     apr_socket_send                  from apr_send
     apr_socket_sendv                 from apr_sendv
     apr_socket_sendto                from apr_sendto
    @@ -43,8 +40,12 @@ apr_socket_filter_accept         from apr_socket_accept_filter
     apr_socket_inherit_set           from apr_socket_set_inherit
     apr_socket_inherit_unset         from apr_socket_unset_inherit
     
    -apr_user_id_current              from apr_current_userid
    -apr_user_compare                 from apr_compare_users
    -apr_group_id_get                 from apr_get_groupid
    -apr_group_compare                from apr_compare_groups
    +apr_time_exp_gmt_get             from apr_implode_gmt
    +apr_time_interval_t              from apr_interval_time_t
    +apr_time_interval_short_t        from apr_short_interval_time_t
     
    +apr_user_homepath_get            from apr_get_home_directory
    +apr_user_id_get                  from apr_get_userid
    +apr_user_id_current              from apr_current_userid
    +apr_user_id_compare              from apr_compare_users
    +apr_user_name_get                from apr_get_username
    
    From ffd0a2d05ebf743252e11bd070ef5c20ddf7b71a Mon Sep 17 00:00:00 2001
    From: Aaron Bannert 
    Date: Wed, 10 Jul 2002 20:42:18 +0000
    Subject: [PATCH 3586/7878] Get rid of a couple of redundant zero assignments.
     We call memset() just a few lines above.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63599 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sa_common.c | 2 --
     1 file changed, 2 deletions(-)
    
    diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c
    index fd3af244efc..e199ee235f4 100644
    --- a/network_io/unix/sa_common.c
    +++ b/network_io/unix/sa_common.c
    @@ -351,7 +351,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa,
             int error;
     
             memset(&hints, 0, sizeof(hints));
    -        hints.ai_flags = 0; /* XXX: might need a way to turn on AI_CANONNAME */
     #if !APR_HAVE_IPV6
             /* we can't talk IPv6 so we might as well not search for IPv6
              * addresses
    @@ -362,7 +361,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa,
     #endif
                 hints.ai_family = family;
             hints.ai_socktype = SOCK_STREAM;
    -        hints.ai_protocol = 0;
             error = getaddrinfo(hostname, NULL, &hints, &ai_list);
             if (error) {
                 if (error == EAI_SYSTEM) {
    
    From fd9ad161e3b8561c020df684bffbf114d647210c Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 11 Jul 2002 01:02:48 +0000
    Subject: [PATCH 3587/7878]   Thom, Ian, Cliff say yea.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63600 13f79535-47bb-0310-9956-ffa450edef68
    ---
     renames_pending | 16 +++++++++-------
     1 file changed, 9 insertions(+), 7 deletions(-)
    
    diff --git a/renames_pending b/renames_pending
    index bc0f0203ffe..ee58a9cde0e 100644
    --- a/renames_pending
    +++ b/renames_pending
    @@ -13,8 +13,10 @@ apr_lock_type_e                  from apr_locktype_e
     apr_lock_mech_e                  from apr_lockmech_e
     apr_lock_readerwriter_e          from apr_readerwriter_e
     
    -apr_group_id_get                 from apr_get_groupid
    -apr_group_id_compare                from apr_compare_groups
    +apr_gid_get                      from apr_get_groupid
    +apr_gid_name_get                 from apr_get_groupname
    +apr_gid_name_get                 from apr_group_name_get
    +apr_gid_compare                  from apr_compare_groups
     
     apr_hostname_get                 from apr_gethostname
     
    @@ -44,8 +46,8 @@ apr_time_exp_gmt_get             from apr_implode_gmt
     apr_time_interval_t              from apr_interval_time_t
     apr_time_interval_short_t        from apr_short_interval_time_t
     
    -apr_user_homepath_get            from apr_get_home_directory
    -apr_user_id_get                  from apr_get_userid
    -apr_user_id_current              from apr_current_userid
    -apr_user_id_compare              from apr_compare_users
    -apr_user_name_get                from apr_get_username
    +apr_uid_homepath_get            from apr_get_home_directory
    +apr_uid_get                     from apr_get_userid
    +apr_uid_current                 from apr_current_userid
    +apr_uid_compare                 from apr_compare_users
    +apr_uid_name_get                from apr_get_username
    
    From 494f8c82fa79d913da74037a9603bf9337df7225 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Thu, 11 Jul 2002 05:19:45 +0000
    Subject: [PATCH 3588/7878] Reimplement apr_poll() on Unix.  This improves
     performance by giving the user back control over the memory in the pollset.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63601 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                       |   5 +
     configure.in                  |   2 +-
     file_io/unix/readwrite.c      |  42 +---
     include/apr_network_io.h      | 120 +---------
     include/apr_poll.h            | 227 +++++++++++++++++++
     include/apr_support.h         |  82 +++++++
     include/arch/unix/networkio.h |  30 ---
     network_io/unix/Makefile.in   |   1 -
     network_io/unix/poll.c        | 410 ----------------------------------
     network_io/unix/sendrecv.c    |  59 ++---
     poll/unix/Makefile.in         |  15 ++
     poll/unix/poll.c              | 339 ++++++++++++++++++++++++++++
     support/unix/Makefile.in      |  15 ++
     support/unix/waitio.c         | 101 +++++++++
     test/sendfile.c               |   3 +-
     test/server.c                 |   3 +-
     test/testfile.c               |   3 +-
     test/testpoll.c               |  13 +-
     18 files changed, 816 insertions(+), 654 deletions(-)
     create mode 100644 include/apr_poll.h
     create mode 100644 include/apr_support.h
     delete mode 100644 network_io/unix/poll.c
     create mode 100755 poll/unix/Makefile.in
     create mode 100644 poll/unix/poll.c
     create mode 100755 support/unix/Makefile.in
     create mode 100644 support/unix/waitio.c
    
    diff --git a/CHANGES b/CHANGES
    index 73022c7a213..ffc1e36ec9c 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,4 +1,9 @@
     Changes with APR b1
    +
    +  *) Re-write apr_poll() on Unix.  This improves the performance by
    +     giving the user back control over the memory in the pollset.
    +     [Ryan Bloom]
    +
       *) Added APR_LIMIT_NOFILE option to apr_procattr_limit_set() to
          control the file descriptor limit on platforms that support
          RLIMIT_NOFILE.  [Brian Pane]
    diff --git a/configure.in b/configure.in
    index d8c1e6c6cc2..886f434f2ed 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -82,7 +82,7 @@ dnl These added to allow default directories to be used...
     DEFAULT_OSDIR="unix"
     echo "(Default will be ${DEFAULT_OSDIR})"
     
    -apr_modules="file_io network_io threadproc misc locks time mmap shmem i18n user memory atomic"
    +apr_modules="file_io network_io threadproc misc locks time mmap shmem i18n user memory atomic poll support"
     
     dnl Checks for programs.
     AC_PROG_MAKE_SET
    diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c
    index 3963840a371..fc283240d1b 100644
    --- a/file_io/unix/readwrite.c
    +++ b/file_io/unix/readwrite.c
    @@ -55,6 +55,7 @@
     #include "fileio.h"
     #include "apr_strings.h"
     #include "apr_thread_mutex.h"
    +#include "apr_support.h"
     
     /* The only case where we don't use wait_for_io_or_timeout is on
      * pre-BONE BeOS, so this check should be sufficient and simpler */
    @@ -62,43 +63,6 @@
     #define USE_WAIT_FOR_IO
     #endif
     
    -#ifdef USE_WAIT_FOR_IO
    -static apr_status_t wait_for_io_or_timeout(apr_file_t *file, int for_read)
    -{
    -    struct timeval tv, *tvptr;
    -    fd_set fdset;
    -    int srv;
    -
    -    /* TODO - timeout should be less each time through this loop */
    -
    -    do {
    -        FD_ZERO(&fdset);
    -        FD_SET(file->filedes, &fdset);
    -        if (file->timeout >= 0) {
    -            tv.tv_sec = apr_time_sec(file->timeout);
    -            tv.tv_usec = apr_time_usec(file->timeout);
    -            tvptr = &tv;
    -        }
    -        else {
    -            tvptr = NULL;
    -        }
    -        srv = select(file->filedes + 1,
    -            for_read ? &fdset : NULL,
    -            for_read ? NULL : &fdset,
    -            NULL,
    -            tvptr);
    -    } while (srv == -1 && errno == EINTR);
    -
    -    if (srv == 0) {
    -        return APR_TIMEUP;
    -    }
    -    else if (srv < 0) {
    -        return errno;
    -    }
    -    return APR_SUCCESS;
    -}
    -#endif
    -
     /* problems: 
      * 1) ungetchar not used for buffered files
      */
    @@ -193,7 +157,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size
             if (rv == -1 && 
                 (errno == EAGAIN || errno == EWOULDBLOCK) && 
                 thefile->timeout != 0) {
    -            apr_status_t arv = wait_for_io_or_timeout(thefile, 1);
    +            apr_status_t arv = apr_wait_for_io_or_timeout(thefile, NULL, 1);
                 if (arv != APR_SUCCESS) {
                     *nbytes = bytes_read;
                     return arv;
    @@ -272,7 +236,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a
             if (rv == (apr_size_t)-1 &&
                 (errno == EAGAIN || errno == EWOULDBLOCK) && 
                 thefile->timeout != 0) {
    -            apr_status_t arv = wait_for_io_or_timeout(thefile, 0);
    +            apr_status_t arv = apr_wait_for_io_or_timeout(thefile, NULL, 0);
                 if (arv != APR_SUCCESS) {
                     *nbytes = 0;
                     return arv;
    diff --git a/include/apr_network_io.h b/include/apr_network_io.h
    index fd4c20d3594..7255d6315ea 100644
    --- a/include/apr_network_io.h
    +++ b/include/apr_network_io.h
    @@ -187,7 +187,6 @@ typedef enum {
     #endif
     
     typedef struct apr_socket_t     apr_socket_t;
    -typedef struct apr_pollfd_t     apr_pollfd_t;
     /**
      * A structure to encapsulate headers and trailers for apr_sendfile
      */
    @@ -634,123 +633,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr,
     APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1,
                                         const apr_sockaddr_t *addr2);
     
    -/**
    - * Setup the memory required for poll to operate properly
    - * @param new_poll The poll structure to be used. 
    - * @param num The number of socket descriptors to be polled.
    - * @param cont The pool to operate on.
    - */
    -APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new_poll, 
    -                                         apr_int32_t num,
    -                                         apr_pool_t *cont);
    -
    -/**
    - * Poll the sockets in the poll structure
    - * @param aprset The poll structure we will be using. 
    - * @param nsds The number of sockets we are polling. 
    - * @param timeout The amount of time in microseconds to wait.  This is 
    - *                a maximum, not a minimum.  If a socket is signalled, we 
    - *                will wake up before this time.  A negative number means 
    - *                wait until a socket is signalled.
    - * @remark
    - * 
    - * The number of sockets signalled is returned in the second argument. 
    - *
    - *        This is a blocking call, and it will not return until either a 
    - *        socket has been signalled, or the timeout has expired. 
    - * 
    - */ -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, - apr_interval_time_t timeout); - -/** - * Add a socket to the poll structure. - * @param aprset The poll structure we will be using. - * @param socket The socket to add to the current poll structure. - * @param event The events to look for when we do the poll. One of: - *
    - *            APR_POLLIN       signal if read will not block
    - *            APR_POLLPRI      signal if prioirty data is availble to be read
    - *            APR_POLLOUT      signal if write will not block
    - * 
    - */ -APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, - apr_socket_t *sock, - apr_int16_t event); - -/** - * Modify a socket in the poll structure with mask. - * @param aprset The poll structure we will be using. - * @param sock The socket to modify in poll structure. - * @param events The events to stop looking for during the poll. One of: - *
    - *            APR_POLLIN       signal if read will not block
    - *            APR_POLLPRI      signal if priority data is available to be read
    - *            APR_POLLOUT      signal if write will not block
    - * 
    - */ -APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, - apr_socket_t *sock, - apr_int16_t events); -/** - * Remove a socket from the poll structure. - * @param aprset The poll structure we will be using. - * @param sock The socket to remove from the current poll structure. - */ -APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, - apr_socket_t *sock); - -/** - * Remove all sockets from the poll structure. - * @param aprset The poll structure we will be using. - * @param events The events to clear from all sockets. One of: - *
    - *            APR_POLLIN       signal if read will not block
    - *            APR_POLLPRI      signal if priority data is available to be read
    - *            APR_POLLOUT      signal if write will not block
    - * 
    - */ -APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, - apr_int16_t events); - -/** - * Get the return events for the specified socket. - * @param event The returned events for the socket. One of: - *
    - *            APR_POLLIN       Data is available to be read 
    - *            APR_POLLPRI      Priority data is availble to be read
    - *            APR_POLLOUT      Write will succeed
    - *            APR_POLLERR      An error occurred on the socket
    - *            APR_POLLHUP      The connection has been terminated
    - *            APR_POLLNVAL     This is an invalid socket to poll on.
    - *                             Socket not open.
    - * 
    - * @param sock The socket we wish to get information about. - * @param aprset The poll structure we will be using. - */ -APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, - apr_socket_t *sock, - apr_pollfd_t *aprset); - -/** - * Return the data associated with the current poll. - * @param pollfd The currently open pollfd. - * @param key The key to use for retrieving data associated with a poll struct. - * @param data The user data associated with the pollfd. - */ -APR_DECLARE(apr_status_t) apr_poll_data_get(apr_pollfd_t *pollfd, - const char *key, void *data); - -/** - * Set the data associated with the current poll. - * @param pollfd The currently open pollfd. - * @param data The key to associate with the data. - * @param key The user data to associate with the pollfd. - * @param cleanup The cleanup function - */ -APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data, - const char *key, - apr_status_t (*cleanup)(void *)); #if APR_FILES_AS_SOCKETS || defined(DOXYGEN) @@ -761,6 +643,8 @@ APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data, * @warning This is not available on all platforms. Platforms that have the * ability to poll files for data to be read/written/exceptions will * have the APR_FILES_AS_SOCKETS macro defined as true. + * @deprecated This function has been deprecated, because of the new poll + * implementation. */ APR_DECLARE(apr_status_t) apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file); diff --git a/include/apr_poll.h b/include/apr_poll.h new file mode 100644 index 00000000000..2acc5f760b2 --- /dev/null +++ b/include/apr_poll.h @@ -0,0 +1,227 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_POLL_H +#define APR_POLL_H +/** + * @file apr_network_io.h + * @brief APR Network library + */ +/** + * @defgroup APR_Net Network Routines + * @ingroup APR + * @{ + */ + +#include "apr.h" +#include "apr_pools.h" +#include "apr_errno.h" +#include "apr_inherit.h" +#include "apr_file_io.h" +#include "apr_network_io.h" + +#if APR_HAVE_NETINET_IN_H +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @defgroup Poll options + * @{ + */ +#define APR_POLLIN 0x001 +#define APR_POLLPRI 0x002 +#define APR_POLLOUT 0x004 +#define APR_POLLERR 0x010 +#define APR_POLLHUP 0x020 +#define APR_POLLNVAL 0x040 +/** @} */ + +typedef enum { + APR_NO_DESC, + APR_POLL_SOCKET, + APR_POLL_FILE, + APR_POLL_LASTDESC +} apr_datatype_e ; + +typedef union { + apr_file_t *f; + apr_socket_t *s; +} apr_descriptor; + +typedef struct apr_pollfd_t apr_pollfd_t; + +struct apr_pollfd_t { + apr_pool_t *p; + apr_datatype_e desc_type; + apr_int16_t events; + apr_int16_t revents; + apr_descriptor desc; +}; + +/** + * Setup the memory required for poll to operate properly + * @param new_poll The poll structure to be used. + * @param num The number of socket descriptors to be polled. + * @param cont The pool to operate on. + * @deprecated This function is deprecated, APR applications should control the pollset memory themselves. + */ +APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new_poll, + apr_int32_t num, + apr_pool_t *cont); + +/** + * Poll the sockets in the poll structure + * @param aprset The poll structure we will be using. + * @param num The number of sockets we are polling + * @param nsds The number of sockets signalled. + * @param timeout The amount of time in microseconds to wait. This is + * a maximum, not a minimum. If a socket is signalled, we + * will wake up before this time. A negative number means + * wait until a socket is signalled. + * @remark + *
    + * The number of sockets signalled is returned in the second argument. 
    + *
    + *        This is a blocking call, and it will not return until either a 
    + *        socket has been signalled, or the timeout has expired. 
    + * 
    + */ +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, + apr_int32_t *nsds, + apr_interval_time_t timeout); + +/** + * Add a socket to the poll structure. + * @param aprset The poll structure we will be using. + * @param socket The socket to add to the current poll structure. + * @param event The events to look for when we do the poll. One of: + *
    + *            APR_POLLIN       signal if read will not block
    + *            APR_POLLPRI      signal if prioirty data is availble to be read
    + *            APR_POLLOUT      signal if write will not block
    + * 
    + * @deprecated This function is deprecated, APR applications should control the pollset memory themselves. + */ +APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, + apr_socket_t *sock, + apr_int16_t event); + +/** + * Modify a socket in the poll structure with mask. + * @param aprset The poll structure we will be using. + * @param sock The socket to modify in poll structure. + * @param events The events to stop looking for during the poll. One of: + *
    + *            APR_POLLIN       signal if read will not block
    + *            APR_POLLPRI      signal if priority data is available to be read
    + *            APR_POLLOUT      signal if write will not block
    + * 
    + * @deprecated This function is deprecated, APR applications should control the pollset memory themselves. + */ +APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, + apr_socket_t *sock, + apr_int16_t events); +/** + * Remove a socket from the poll structure. + * @param aprset The poll structure we will be using. + * @param sock The socket to remove from the current poll structure. + * @deprecated This function is deprecated, APR applications should control the pollset memory themselves. + */ +APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, + apr_socket_t *sock); + +/** + * Remove all sockets from the poll structure. + * @param aprset The poll structure we will be using. + * @param events The events to clear from all sockets. One of: + *
    + *            APR_POLLIN       signal if read will not block
    + *            APR_POLLPRI      signal if priority data is available to be read
    + *            APR_POLLOUT      signal if write will not block
    + * 
    + * @deprecated This function is deprecated, APR applications should control the pollset memory themselves. + */ +APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, + apr_int16_t events); + +/** + * Get the return events for the specified socket. + * @param event The returned events for the socket. One of: + *
    + *            APR_POLLIN       Data is available to be read 
    + *            APR_POLLPRI      Priority data is availble to be read
    + *            APR_POLLOUT      Write will succeed
    + *            APR_POLLERR      An error occurred on the socket
    + *            APR_POLLHUP      The connection has been terminated
    + *            APR_POLLNVAL     This is an invalid socket to poll on.
    + *                             Socket not open.
    + * 
    + * @param sock The socket we wish to get information about. + * @param aprset The poll structure we will be using. + * @deprecated This function is deprecated, APR applications should control the pollset memory themselves. + */ +APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, + apr_socket_t *sock, + apr_pollfd_t *aprset); + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif /* ! APR_POLL_H */ + diff --git a/include/apr_support.h b/include/apr_support.h new file mode 100644 index 00000000000..ecb20a4c62b --- /dev/null +++ b/include/apr_support.h @@ -0,0 +1,82 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_SUPPORT_H +#define APR_SUPPORT_H +/** + * @file apr_file_io.h + * @brief APR Support functions + */ +/** + * @defgroup APR_Support Internal APR support functions + * @ingroup APR_Support + * @{ + */ + +#include "apr.h" +#include "apr_network_io.h" +#include "apr_file_io.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, + int for_read); + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif /* ! APR_SUPPORT_H */ diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index f6615a2f67a..1b991429131 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -69,12 +69,6 @@ #if APR_HAVE_SYS_UIO_H #include #endif -#ifdef HAVE_SYS_POLL_H -#include -#endif -#ifdef HAVE_POLL_H -#include -#endif #ifdef HAVE_SYS_SELECT_H #include #endif @@ -138,32 +132,8 @@ struct apr_socket_t { apr_int32_t inherit; }; -struct apr_pollfd_t { - apr_pool_t *cntxt; -#ifdef HAVE_POLL - struct pollfd *pollset; - int num; - int curpos; -#else - fd_set *read; - fd_set *write; - fd_set *except; - int highsock; - fd_set *read_set; - fd_set *write_set; - fd_set *except_set; - apr_int16_t *events; - apr_int16_t *revents; -#ifdef BEOS - int lowsock; - int ncks; -#endif -#endif -}; - const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); -apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read); void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); #define apr_is_option_set(mask, option) ((mask & option) ==option) diff --git a/network_io/unix/Makefile.in b/network_io/unix/Makefile.in index 761af5fad97..3ea7d03bd45 100644 --- a/network_io/unix/Makefile.in +++ b/network_io/unix/Makefile.in @@ -2,7 +2,6 @@ srcdir = @srcdir@ VPATH = @srcdir@ TARGETS = \ - poll.lo \ sendrecv.lo \ sockets.lo \ sockopt.lo \ diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c deleted file mode 100644 index 5c15e015082..00000000000 --- a/network_io/unix/poll.c +++ /dev/null @@ -1,410 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "networkio.h" -#include "fileio.h" - -#ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ - -apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) -{ - (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t)); - if ((*new) == NULL) { - return APR_ENOMEM; - } - (*new)->pollset = (struct pollfd *)apr_pcalloc(cont, - sizeof(struct pollfd) * num); - - if ((*new)->pollset == NULL) { - return APR_ENOMEM; - } - (*new)->num = num; - (*new)->cntxt = cont; - (*new)->curpos = 0; - return APR_SUCCESS; -} - -static apr_int16_t get_event(apr_int16_t event) -{ - apr_int16_t rv = 0; - - if (event & APR_POLLIN) - rv |= POLLIN; - if (event & APR_POLLPRI) - rv |= POLLPRI; - if (event & APR_POLLOUT) - rv |= POLLOUT; - if (event & APR_POLLERR) - rv |= POLLERR; - if (event & APR_POLLHUP) - rv |= POLLHUP; - if (event & APR_POLLNVAL) - rv |= POLLNVAL; - - return rv; -} - -static apr_int16_t get_revent(apr_int16_t event) -{ - apr_int16_t rv = 0; - - if (event & POLLIN) - rv |= APR_POLLIN; - if (event & POLLPRI) - rv |= APR_POLLPRI; - if (event & POLLOUT) - rv |= APR_POLLOUT; - if (event & POLLERR) - rv |= APR_POLLERR; - if (event & POLLHUP) - rv |= APR_POLLHUP; - if (event & POLLNVAL) - rv |= APR_POLLNVAL; - - return rv; -} - -apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t event) -{ - int i = 0; - - while (i < aprset->curpos && aprset->pollset[i].fd != sock->socketdes) { - i++; - } - if (i >= aprset->curpos) { - if(aprset->curpos == aprset->num) { - return APR_ENOMEM; - } - aprset->curpos++; - } - aprset->pollset[i].fd = sock->socketdes; - aprset->pollset[i].events = get_event(event); - - return APR_SUCCESS; -} - -apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, - apr_interval_time_t timeout) -{ - int rv; - - if (timeout > 0) { - timeout /= 1000; /* convert microseconds to milliseconds */ - } - - rv = poll(aprset->pollset, aprset->curpos, timeout); - (*nsds) = rv; - - if ((*nsds) < 0) { - return errno; - } - return APR_SUCCESS; -} - -apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) -{ - int i = 0; - - while (i < aprset->curpos && aprset->pollset[i].fd != sock->socketdes) { - i++; - } - if (i >= aprset->curpos) { - return APR_EINVALSOCK; - } - (*event) = get_revent(aprset->pollset[i].revents); - return APR_SUCCESS; -} - -apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t events) -{ - apr_int16_t newevents; - int i = 0; - - while (i < aprset->curpos && aprset->pollset[i].fd != sock->socketdes) { - i++; - } - if (i >= aprset->curpos) { - return APR_NOTFOUND; - } - newevents = get_event(events); - if (aprset->pollset[i].events & newevents) { - aprset->pollset[i].events ^= newevents; - } - - return APR_SUCCESS; -} - -apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) -{ - int i = 0; - while(i < aprset->curpos && aprset->pollset[i].fd != sock->socketdes) { - i++; - } - if(i >= aprset->curpos) { - return APR_NOTFOUND; - } - while(++i < aprset->curpos) { - aprset->pollset[i-1].fd = aprset->pollset[i].fd; - aprset->pollset[i-1].events = aprset->pollset[i].events; - } - --aprset->curpos; - return APR_SUCCESS; -} - -apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) -{ - int i = 0; - apr_int16_t newevents; - - newevents = get_event(events); - - while (i < aprset->curpos) { - if (aprset->pollset[i].events & newevents) { - aprset->pollset[i].events &= ~newevents; - } - i++; - } - return APR_SUCCESS; -} - -#else /* Use select to mimic poll */ - -apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) -{ - (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num); - if ((*new) == NULL) { - return APR_ENOMEM; - } - (*new)->cntxt = cont; - (*new)->read = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->except = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->read_set = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->write_set = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->except_set = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - FD_ZERO((*new)->read); - FD_ZERO((*new)->write); - FD_ZERO((*new)->except); - FD_ZERO((*new)->read_set); - FD_ZERO((*new)->write_set); - FD_ZERO((*new)->except_set); - (*new)->highsock = -1; - return APR_SUCCESS; -} - -apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t event) -{ - if (event & APR_POLLIN) { - FD_SET(sock->socketdes, aprset->read_set); - } - if (event & APR_POLLPRI) { - FD_SET(sock->socketdes, aprset->except_set); - } - if (event & APR_POLLOUT) { - FD_SET(sock->socketdes, aprset->write_set); - } - if (sock->socketdes > aprset->highsock) { - aprset->highsock = sock->socketdes; - } - return APR_SUCCESS; -} - -apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, - apr_socket_t *sock, - apr_int16_t events) -{ - if (events & APR_POLLIN) { - FD_CLR(sock->socketdes, aprset->read_set); - } - if (events & APR_POLLPRI) { - FD_CLR(sock->socketdes, aprset->except_set); - } - if (events & APR_POLLOUT) { - FD_CLR(sock->socketdes, aprset->write_set); - } - return APR_SUCCESS; -} - -apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, - apr_interval_time_t timeout) -{ - int rv; - struct timeval tv, *tvptr; - - if (timeout < 0) { - tvptr = NULL; - } - else { - tv.tv_sec = apr_time_sec(timeout); - tv.tv_usec = apr_time_usec(timeout); - tvptr = &tv; - } - - memcpy(aprset->read, aprset->read_set, sizeof(fd_set)); - memcpy(aprset->write, aprset->write_set, sizeof(fd_set)); - memcpy(aprset->except, aprset->except_set, sizeof(fd_set)); - - rv = select(aprset->highsock + 1, aprset->read, aprset->write, - aprset->except, tvptr); - - (*nsds) = rv; - if ((*nsds) == 0) { - return APR_TIMEUP; - } - if ((*nsds) < 0) { - return APR_EEXIST; - } - return APR_SUCCESS; -} - -apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) -{ - apr_int16_t revents = 0; - char data[1]; - int flags = MSG_PEEK; - - /* We just want to PEEK at the data, so I am setting up a dummy WSABUF - * variable here. - */ - if (FD_ISSET(sock->socketdes, aprset->read)) { - revents |= APR_POLLIN; - if (sock->connected - && recv(sock->socketdes, data, sizeof data, flags) == -1) { - switch (errno) { - case ECONNRESET: - case ECONNABORTED: - case ESHUTDOWN: - case ENETRESET: - revents ^= APR_POLLIN; - revents |= APR_POLLHUP; - break; - case ENOTSOCK: - revents ^= APR_POLLIN; - revents |= APR_POLLNVAL; - break; - default: - revents ^= APR_POLLIN; - revents |= APR_POLLERR; - break; - } - } - } - if (FD_ISSET(sock->socketdes, aprset->write)) { - revents |= APR_POLLOUT; - } - /* I am assuming that the except is for out of band data, not a failed - * connection on a non-blocking socket. Might be a bad assumption, but - * it works for now. rbb. - */ - if (FD_ISSET(sock->socketdes, aprset->except)) { - revents |= APR_POLLPRI; - } - - (*event) = revents; - return APR_SUCCESS; -} - -apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) -{ - FD_CLR(sock->socketdes, aprset->read_set); - FD_CLR(sock->socketdes, aprset->except_set); - FD_CLR(sock->socketdes, aprset->write_set); - return APR_SUCCESS; -} - -apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t event) -{ - if (event & APR_POLLIN) { - FD_ZERO(aprset->read_set); - } - if (event & APR_POLLPRI) { - FD_ZERO(aprset->except_set); - } - if (event & APR_POLLOUT) { - FD_ZERO(aprset->write_set); - } - aprset->highsock = 0; - return APR_SUCCESS; -} - -#endif - -apr_status_t apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) -{ - return apr_pool_userdata_get(data, key, pollfd->cntxt); -} - -apr_status_t apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, - apr_status_t (*cleanup) (void *)) -{ - return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt); -} - -#if APR_FILES_AS_SOCKETS -/* I'm not sure if this needs to return an apr_status_t or not, but - * for right now, we'll leave it this way, and change it later if - * necessary. - */ -apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file) -{ - (*newsock) = apr_pcalloc(file->pool, sizeof(**newsock)); - (*newsock)->socketdes = file->filedes; - (*newsock)->cntxt = file->pool; - (*newsock)->timeout = file->timeout; - return APR_SUCCESS; -} -#endif diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index c2b9dd5a335..0d4ac9e9745 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -53,6 +53,7 @@ */ #include "networkio.h" +#include "apr_support.h" #if APR_HAS_SENDFILE /* This file is needed to allow us access to the apr_file_t internals. */ @@ -63,40 +64,6 @@ #include #endif -apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read) -{ - struct timeval tv, *tvptr; - fd_set fdset; - int srv; - - do { - FD_ZERO(&fdset); - FD_SET(sock->socketdes, &fdset); - if (sock->timeout < 0) { - tvptr = NULL; - } - else { - tv.tv_sec = sock->timeout / APR_USEC_PER_SEC; - tv.tv_usec = sock->timeout % APR_USEC_PER_SEC; - tvptr = &tv; - } - srv = select(sock->socketdes + 1, - for_read ? &fdset : NULL, - for_read ? NULL : &fdset, - NULL, - tvptr); - /* TODO - timeout should be smaller on repeats of this loop */ - } while (srv == -1 && errno == EINTR); - - if (srv == 0) { - return APR_TIMEUP; - } - else if (srv < 0) { - return errno; - } - return APR_SUCCESS; -} - apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { apr_ssize_t rv; @@ -114,7 +81,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) && sock->timeout != 0) { apr_status_t arv; do_select: - arv = apr_wait_for_io_or_timeout(sock, 0); + arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -153,7 +120,7 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { do_select: - arv = apr_wait_for_io_or_timeout(sock, 1); + arv = apr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -191,7 +158,7 @@ apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); + apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -224,7 +191,7 @@ apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 1); + apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -272,7 +239,7 @@ apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, sock->timeout != 0) { apr_status_t arv; do_select: - arv = apr_wait_for_io_or_timeout(sock, 0); + arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -370,7 +337,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { do_select: - arv = apr_wait_for_io_or_timeout(sock, 0); + arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -528,7 +495,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, if (sock->netmask & APR_INCOMPLETE_WRITE) { apr_status_t arv; sock->netmask &= ~APR_INCOMPLETE_WRITE; - arv = apr_wait_for_io_or_timeout(sock, 0); + arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -590,7 +557,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, if (rv == -1 && errno == EAGAIN && sock->timeout > 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); + apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -708,7 +675,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (rc == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); + apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -847,7 +814,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { do_select: - arv = apr_wait_for_io_or_timeout(sock, 0); + arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -957,7 +924,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, */ if (sock->netmask & APR_INCOMPLETE_WRITE) { sock->netmask &= ~APR_INCOMPLETE_WRITE; - arv = apr_wait_for_io_or_timeout(sock, 0); + arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -989,7 +956,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, else if (!arv && apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) == 1) { - apr_status_t t = apr_wait_for_io_or_timeout(sock, 0); + apr_status_t t = apr_wait_for_io_or_timeout(NULL, sock, 0); if (t != APR_SUCCESS) { diff --git a/poll/unix/Makefile.in b/poll/unix/Makefile.in new file mode 100755 index 00000000000..8848b5621a4 --- /dev/null +++ b/poll/unix/Makefile.in @@ -0,0 +1,15 @@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +TARGETS = \ + poll.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + +INCDIR=../../include +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) + +# DO NOT REMOVE diff --git a/poll/unix/poll.c b/poll/unix/poll.c new file mode 100644 index 00000000000..30f901faedb --- /dev/null +++ b/poll/unix/poll.c @@ -0,0 +1,339 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_poll.h" +#include "networkio.h" +#include "fileio.h" +#if HAVE_POLL_H +#include +#endif +#if HAVE_SYS_POLL_H +#include +#endif + +apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +{ + (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * (num + 1)); + if ((*new) == NULL) { + return APR_ENOMEM; + } + (*new)[num].desc_type = APR_POLL_LASTDESC; + (*new)[0].p = cont; + return APR_SUCCESS; +} + +apr_pollfd_t *find_poll_sock(apr_pollfd_t *aprset, apr_socket_t *sock) +{ + apr_pollfd_t *curr = aprset; + + while (curr->desc.s != sock) { + if (curr->desc_type == APR_POLL_LASTDESC) { + return NULL; + } + curr++; + } + + return curr; +} + +apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t event) +{ + apr_pollfd_t *curr = aprset; + + while (curr->desc_type != APR_NO_DESC) { + if (curr->desc_type == APR_POLL_LASTDESC) { + return APR_ENOMEM; + } + curr++; + } + curr->desc.s = sock; + curr->desc_type = APR_POLL_SOCKET; + curr->events = event; + + return APR_SUCCESS; +} + +apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +{ + apr_pollfd_t *curr = find_poll_sock(aprset, sock); + if (curr == NULL) { + return APR_NOTFOUND; + } + + (*event) = curr->revents; + return APR_SUCCESS; +} + +apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t events) +{ + apr_pollfd_t *curr = find_poll_sock(aprset, sock); + if (curr == NULL) { + return APR_NOTFOUND; + } + + if (curr->events & events) { + curr->events ^= events; + } + + return APR_SUCCESS; +} + +apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) +{ + apr_pollfd_t *curr = find_poll_sock(aprset, sock); + if (curr == NULL) { + return APR_NOTFOUND; + } + + curr->desc_type = APR_NO_DESC; + + return APR_SUCCESS; +} + +apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) +{ + apr_pollfd_t *curr = aprset; + + while (curr->desc_type != APR_POLL_LASTDESC) { + if (curr->events & events) { + curr->events &= ~events; + } + } + return APR_SUCCESS; +} + +#ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ + +static apr_int16_t get_event(apr_int16_t event) +{ + apr_int16_t rv = 0; + + if (event & APR_POLLIN) + rv |= POLLIN; + if (event & APR_POLLPRI) + rv |= POLLPRI; + if (event & APR_POLLOUT) + rv |= POLLOUT; + if (event & APR_POLLERR) + rv |= POLLERR; + if (event & APR_POLLHUP) + rv |= POLLHUP; + if (event & APR_POLLNVAL) + rv |= POLLNVAL; + + return rv; +} + +static apr_int16_t get_revent(apr_int16_t event) +{ + apr_int16_t rv = 0; + + if (event & POLLIN) + rv |= APR_POLLIN; + if (event & POLLPRI) + rv |= APR_POLLPRI; + if (event & POLLOUT) + rv |= APR_POLLOUT; + if (event & POLLERR) + rv |= APR_POLLERR; + if (event & POLLHUP) + rv |= APR_POLLHUP; + if (event & POLLNVAL) + rv |= APR_POLLNVAL; + + return rv; +} + +apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t num, + apr_int32_t *nsds, apr_interval_time_t timeout) +{ + /* obvious optimization, it would be better if this could be allocated + * on the stack. For a single file/socket, this can be otpimized + * very cleanly. + */ + struct pollfd *pollset = apr_palloc(aprset->p, + sizeof(struct pollfd) * num); + int i; + + for (i = 0; i < num; i++) { + if (aprset[i].desc_type == APR_POLL_SOCKET) { + pollset[i].fd = aprset[i].desc.s->socketdes; + } + else if (aprset[i].desc_type == APR_POLL_FILE) { + pollset[i].fd = aprset[i].desc.f->filedes; + } + pollset[i].events = get_event(aprset[i].events); + } + + if (timeout > 0) { + timeout /= 1000; /* convert microseconds to milliseconds */ + } + + i = poll(pollset, num, timeout); + (*nsds) = i; + + for (i = 0; i < num; i++) { + aprset[i].revents = get_revent(pollset[i].revents); + } + + if ((*nsds) < 0) { + return errno; + } + if ((*nsds) == 0) { + return APR_TIMEUP; + } + return APR_SUCCESS; +} + + +#else /* Use select to mimic poll */ + +apr_status_t apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *nsds, + apr_interval_time_t timeout) +{ + fd_set readset, writeset, exceptset; + int rv, i; + int maxfd = -1; + struct timeval tv, *tvptr; + + if (timeout < 0) { + tvptr = NULL; + } + else { + tv.tv_sec = apr_time_sec(timeout); + tv.tv_usec = apr_time_usec(timeout); + tvptr = &tv; + } + + FD_ZERO(&readset); + FD_ZERO(&writeset); + FD_ZERO(&exceptset); + + for (i = 0; i < num; i++) { + int fd; + + if (aprset[i].desc_type == APR_POLL_SOCKET) { + fd = aprset[i].desc.s->socketdes; + } + else if (aprset[i].desc_type == APR_POLL_FILE) { + fd = aprset[i].desc.f->filedes; + } + if (aprset[i].events & APR_POLLIN) { + FD_SET(fd, &readset); + } + if (aprset[i].events & APR_POLLOUT) { + FD_SET(fd, &writeset); + } + if (aprset[i].events & + (APR_POLLPRI | APR_POLLERR | APR_POLLHUP | APR_POLLNVAL)) { + FD_SET(fd, &exceptset); + } + if (fd > maxfd) { + maxfd = fd; + } + } + + rv = select(maxfd + 1, &readset, &writeset, &exceptset, tvptr); + + (*nsds) = rv; + if ((*nsds) == 0) { + return APR_TIMEUP; + } + if ((*nsds) < 0) { + return errno; + } + + for (i = 0; i < num; i++) { + int fd; + + if (aprset[i].desc_type == APR_POLL_SOCKET) { + fd = aprset[i].desc.s->socketdes; + } + else if (aprset[i].desc_type == APR_POLL_FILE) { + fd = aprset[i].desc.f->filedes; + } + aprset[i].revents = 0; + if (FD_ISSET(fd, &readset)) { + aprset[i].revents |= APR_POLLIN; + } + if (FD_ISSET(fd, &writeset)) { + aprset[i].revents |= APR_POLLOUT; + } + if (FD_ISSET(fd, &exceptset)) { + aprset[i].events |= APR_POLLERR; + } + } + + return APR_SUCCESS; +} + +#endif + +#if APR_FILES_AS_SOCKETS +/* I'm not sure if this needs to return an apr_status_t or not, but + * for right now, we'll leave it this way, and change it later if + * necessary. + */ +apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file) +{ + (*newsock) = apr_pcalloc(file->pool, sizeof(**newsock)); + (*newsock)->socketdes = file->filedes; + (*newsock)->cntxt = file->pool; + (*newsock)->timeout = file->timeout; + return APR_SUCCESS; +} +#endif diff --git a/support/unix/Makefile.in b/support/unix/Makefile.in new file mode 100755 index 00000000000..190cacfc291 --- /dev/null +++ b/support/unix/Makefile.in @@ -0,0 +1,15 @@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +TARGETS = \ + waitio.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + +INCDIR=../../include +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) + +# DO NOT REMOVE diff --git a/support/unix/waitio.c b/support/unix/waitio.c new file mode 100644 index 00000000000..92c1a368d34 --- /dev/null +++ b/support/unix/waitio.c @@ -0,0 +1,101 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "fileio.h" +#include "networkio.h" +#include "apr_poll.h" +#include "apr_errno.h" + +/* The only case where we don't use wait_for_io_or_timeout is on + * pre-BONE BeOS, so this check should be sufficient and simpler */ +#if !BEOS_R5 +#define USE_WAIT_FOR_IO +#endif + +#ifdef USE_WAIT_FOR_IO +apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, + int for_read) +{ + apr_interval_time_t timeout; + apr_pollfd_t pollset; + int srv, n; + int type = for_read ? APR_POLLIN : APR_POLLOUT; + + /* TODO - timeout should be less each time through this loop */ + if (f) { + pollset.desc_type = APR_POLL_FILE; + pollset.desc.f = f; + pollset.p = f->pool; + timeout = f->timeout; + } + else { + pollset.desc_type = APR_POLL_SOCKET; + pollset.desc.s = s; + pollset.p = s->cntxt; + timeout = s->timeout; + } + pollset.events = type; + + do { + srv = apr_poll(&pollset, 1, &n, timeout); + + if (n == 1 && pollset.revents & type) { + return APR_SUCCESS; + } + } while (APR_STATUS_IS_EINTR(srv)); + + return srv; +} +#endif + diff --git a/test/sendfile.c b/test/sendfile.c index c39fb4583e2..1ee95ec9d04 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -60,6 +60,7 @@ #include "apr_network_io.h" #include "apr_errno.h" #include "apr_general.h" +#include "apr_poll.h" #if !APR_HAS_SENDFILE int main(void) @@ -373,7 +374,7 @@ static int client(client_socket_mode_t socket_mode, char *host) if (APR_STATUS_IS_EAGAIN(rv)) { assert(tmplen == 0); nsocks = 1; - tmprv = apr_poll(pfd, &nsocks, -1); + tmprv = apr_poll(pfd, 1, &nsocks, -1); assert(!tmprv); assert(nsocks == 1); /* continue; */ diff --git a/test/server.c b/test/server.c index 7ca7f9a7fde..1ff377b5c73 100644 --- a/test/server.c +++ b/test/server.c @@ -58,6 +58,7 @@ #include #include "apr_network_io.h" #include "apr_getopt.h" +#include "apr_poll.h" #define STRLEN 15 @@ -138,7 +139,7 @@ int main(int argc, const char * const argv[]) pollres = 1; APR_TEST_BEGIN(rv, "Polling for socket", - apr_poll(sdset, &pollres, -1)) + apr_poll(sdset, 1, &pollres, -1)) if (pollres == 0) { fprintf(stdout, "Failed\n"); diff --git a/test/testfile.c b/test/testfile.c index 25176baebcb..1adc8c0ce5d 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -61,6 +61,7 @@ #include "apr_network_io.h" #include "apr_errno.h" #include "apr_general.h" +#include "apr_poll.h" #include "apr_lib.h" #include "test_apr.h" @@ -157,7 +158,7 @@ int main(void) apr_poll_socket_add(sdset, testsock, APR_POLLIN); num = 1; STD_TEST_NEQ(" Checking for incoming data", - apr_poll(sdset, &num, apr_time_from_sec(1))); + apr_poll(sdset, 1, &num, apr_time_from_sec(1))); if (num == 0) { printf("** This platform doesn't return readability on a regular file.**\n"); } diff --git a/test/testpoll.c b/test/testpoll.c index ddbc781d45c..8a99904b2ea 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -57,6 +57,7 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_network_io.h" +#include "apr_poll.h" #if APR_HAVE_UNISTD_H #include #endif @@ -145,7 +146,7 @@ int main(void) apr_socket_t *s[3]; apr_sockaddr_t *sa[3]; apr_pollfd_t *pollset; - int i = 0, srv = 0; + int i = 0, srv = 3; fprintf (stdout,"APR Poll Test\n*************\n\n"); @@ -186,29 +187,29 @@ int main(void) printf("OK\n"); printf("Starting Tests\n"); - apr_poll(pollset, &srv, 10); + apr_poll(pollset, 3, &srv, 10); check_sockets(pollset, s); send_msg(s, sa, 2); - apr_poll(pollset, &srv, 10); + apr_poll(pollset, 3, &srv, 10); check_sockets(pollset, s); recv_msg(s, 2, context); send_msg(s, sa, 1); - apr_poll(pollset, &srv, 10); + apr_poll(pollset, 3, &srv, 10); check_sockets(pollset, s); send_msg(s, sa, 2); - apr_poll(pollset, &srv, 10); + apr_poll(pollset, 3, &srv, 10); check_sockets(pollset, s); recv_msg(s, 1, context); send_msg(s, sa, 0); - apr_poll(pollset, &srv, 10); + apr_poll(pollset, 3, &srv, 10); check_sockets(pollset, s); printf("Tests completed.\n"); From 5cf04c01273c518f34a4be3f32ce5ebbc43a9e78 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 11 Jul 2002 05:24:21 +0000 Subject: [PATCH 3589/7878] Remove the old BeOS poll implementation. BeOS's poll implementation looks like the select implementation on Unix, so I believe that this should just work, but it is untested. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63602 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/beos/Makefile.in | 2 +- network_io/beos/poll.c | 327 ------------------------------------ 2 files changed, 1 insertion(+), 328 deletions(-) delete mode 100644 network_io/beos/poll.c diff --git a/network_io/beos/Makefile.in b/network_io/beos/Makefile.in index 1621b5fd49f..b2c93fbbf93 100644 --- a/network_io/beos/Makefile.in +++ b/network_io/beos/Makefile.in @@ -1,7 +1,7 @@ srcdir = @srcdir@ VPATH = @srcdir@ -TARGETS = poll.lo sendrecv.lo socketcommon.lo +TARGETS = sendrecv.lo socketcommon.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c deleted file mode 100644 index d794ee77cdf..00000000000 --- a/network_io/beos/poll.c +++ /dev/null @@ -1,327 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_private.h" -#if BEOS_BONE /* BONE uses the unix code - woohoo */ -#include "../unix/poll.c" -#else -#include "networkio.h" - -/* BeOS R4 doesn't have a poll function, but R5 will have - * so for the time being we try our best with an implementaion that - * uses select. However, select on beos isn't that hot either, so - * until R5 we have to live with a less than perfect implementation - * - * Apparently those sneaky people at Be included support for write in - * select for R4.5 of BeOS. So here we use code that uses the write - * bits. - */ - -static void ck_ncks(apr_pollfd_t *pfd) -{ - int i; - - pfd->ncks = 0; - for (i=pfd->lowsock;i <= pfd->highsock;i++) { - if (FD_ISSET(i, pfd->read_set)) { - pfd->ncks++; - } - if (FD_ISSET(i, pfd->write_set)) { - pfd->ncks++; - } - if (FD_ISSET(i, pfd->except_set)) { - pfd->ncks++; - } - } -} - -APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) -{ - (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num); - - if ((*new) == NULL) { - return APR_ENOMEM; - } - - (*new)->cntxt = cont; - (*new)->read = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->except = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->read_set = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->write_set = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->except_set = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - FD_ZERO((*new)->read); - FD_ZERO((*new)->write); - FD_ZERO((*new)->except); - FD_ZERO((*new)->read_set); - FD_ZERO((*new)->write_set); - FD_ZERO((*new)->except_set); - (*new)->highsock = -1; - (*new)->ncks = 0; - (*new)->lowsock = -1; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t event) -{ - if (event & APR_POLLIN) { - FD_SET(sock->socketdes, aprset->read_set); - aprset->ncks++; - } - if (event & APR_POLLPRI) { - FD_SET(sock->socketdes, aprset->read_set); - aprset->ncks++; - } - if (event & APR_POLLOUT) { - FD_SET(sock->socketdes, aprset->write_set); - aprset->ncks++; - } - if (sock->socketdes > aprset->highsock) { - aprset->highsock = sock->socketdes; - } - if (sock->socketdes < aprset->lowsock || aprset->lowsock == -1) { - aprset->lowsock = sock->socketdes; - } - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, - apr_socket_t *sock, - apr_int16_t events) -{ - if (events & APR_POLLIN) { - FD_CLR(sock->socketdes, aprset->read_set); - aprset->ncks--; - } - if (events & APR_POLLPRI) { - FD_CLR(sock->socketdes, aprset->except_set); - aprset->ncks--; - } - if (events & APR_POLLOUT) { - FD_CLR(sock->socketdes, aprset->write_set); - aprset->ncks--; - } - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, - apr_interval_time_t timeout) -{ - int rv; - struct timeval tv, *tvptr; - - if (timeout < 0) { - tvptr = NULL; - } - else { - tv.tv_sec = apr_time_sec(timeout); - tv.tv_usec = apr_time_usec(timeout); - tvptr = &tv; - } - - memcpy(aprset->read, aprset->read_set, sizeof(fd_set)); - memcpy(aprset->write, aprset->write_set, sizeof(fd_set)); - memcpy(aprset->except, aprset->except_set, sizeof(fd_set)); - - rv = select(aprset->highsock + 1, aprset->read, aprset->write, - aprset->except, tvptr); - - /* Often we won't see anything beyond the first socket that's - * available, so here we check for any more... Without this we - * really do what we want to with this call - annoying isn't it? - */ - if (rv > 0 && rv < aprset->ncks) { - while (1) { - fd_set ckr, ckw, cke; - int i; - FD_ZERO(&ckr); - FD_ZERO(&ckw); - FD_ZERO(&cke); - for (i=aprset->lowsock;i <= aprset->highsock;i++) { - if (FD_ISSET(i, aprset->read_set) && - !FD_ISSET(i, aprset->read)) { - FD_SET(i, &ckr); - } - if (FD_ISSET(i, aprset->write_set) && - !FD_ISSET(i, aprset->write)) { - FD_SET(i, &ckw); - } - if (FD_ISSET(i, aprset->except_set) && - !FD_ISSET(i, aprset->except)) { - FD_SET(i, &cke); - } - - } - /* set these to zero for an immeadiate return */ - tv.tv_sec = 0; - tv.tv_usec = 0; - i = select(aprset->highsock + 1, &ckr, &ckw, &cke, tvptr); - if (i > 0) { - for (i=aprset->lowsock;i <= aprset->highsock;i++) { - if (FD_ISSET(i, &ckr)) { - FD_SET(i, aprset->read); - rv++; - } - if (FD_ISSET(i, &ckw)) { - FD_SET(i, aprset->write); - rv++; - } - if (FD_ISSET(i, &cke)) { - FD_SET(i, aprset->except); - rv++; - } - } - } else { - break; - } - } - } - - (*nsds) = rv; - if ((*nsds) == 0) { - return APR_TIMEUP; - } - if ((*nsds) < 0) { - return errno; - } - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) -{ - apr_int16_t revents = 0; - char data[1]; - int flags = 0; - - if (FD_ISSET(sock->socketdes, aprset->read)) { - revents |= APR_POLLIN; - if (sock->connected - && recv(sock->socketdes, data, 0 /*sizeof data*/, flags) == -1) { - switch (errno) { - case ECONNRESET: - case ECONNABORTED: - case ESHUTDOWN: - case ENETRESET: - revents ^= APR_POLLIN; - revents |= APR_POLLHUP; - break; - case ENOTSOCK: - revents ^= APR_POLLIN; - revents |= APR_POLLNVAL; - break; - default: - revents ^= APR_POLLIN; - revents |= APR_POLLERR; - break; - } - } - } - if (FD_ISSET(sock->socketdes, aprset->write)) { - revents |= APR_POLLOUT; - } - /* I am assuming that the except is for out of band data, not a failed - * connection on a non-blocking socket. Might be a bad assumption, but - * it works for now. rbb. - */ - if (FD_ISSET(sock->socketdes, aprset->except)) { - revents |= APR_POLLPRI; - } - - (*event) = revents; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) -{ - if (FD_ISSET(sock->socketdes, aprset->read_set)) - aprset->ncks--; - FD_CLR(sock->socketdes, aprset->read_set); - if (FD_ISSET(sock->socketdes, aprset->except_set)) - aprset->ncks--; - FD_CLR(sock->socketdes, aprset->except_set); - if (FD_ISSET(sock->socketdes, aprset->write_set)) - aprset->ncks--; - FD_CLR(sock->socketdes, aprset->write_set); - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t event) -{ - if (event & APR_POLLIN) { - FD_ZERO(aprset->read_set); - } - if (event & APR_POLLPRI) { - FD_ZERO(aprset->except_set); - } - if (event & APR_POLLOUT) { - FD_ZERO(aprset->write_set); - } - aprset->highsock = 0; - ck_ncks(aprset); - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) -{ - return apr_pool_userdata_get(data, key, pollfd->cntxt); -} - -APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, - apr_status_t (*cleanup) (void *)) -{ - return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt); -} - -#endif /* BEOS_BONE */ From d5e85cf2ad951b51d3bac4db1a0f3fd99565ee6b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 11 Jul 2002 05:40:23 +0000 Subject: [PATCH 3590/7878] An attempt at the OS/2 implementation. I have no OS/2 box, so this probably won't work, but at least it is a start. My only question is can you select on a file descriptor on OS/2? If not, then we will just have to return an error on OS/2 if somebody tries to. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63603 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/Makefile.in | 1 - poll/os2/Makefile.in | 15 ++++ {network_io => poll}/os2/poll.c | 135 ++++++++------------------------ 3 files changed, 48 insertions(+), 103 deletions(-) create mode 100755 poll/os2/Makefile.in rename {network_io => poll}/os2/poll.c (64%) mode change 100644 => 100755 diff --git a/network_io/os2/Makefile.in b/network_io/os2/Makefile.in index 0600dee8992..04b8e32df0f 100644 --- a/network_io/os2/Makefile.in +++ b/network_io/os2/Makefile.in @@ -2,7 +2,6 @@ srcdir = @srcdir@ VPATH = @srcdir@ TARGETS = \ - poll.lo \ sendrecv.lo \ sendrecv_udp.lo \ sockets.lo \ diff --git a/poll/os2/Makefile.in b/poll/os2/Makefile.in new file mode 100755 index 00000000000..8848b5621a4 --- /dev/null +++ b/poll/os2/Makefile.in @@ -0,0 +1,15 @@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +TARGETS = \ + poll.lo + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + +INCDIR=../../include +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) + +# DO NOT REMOVE diff --git a/network_io/os2/poll.c b/poll/os2/poll.c old mode 100644 new mode 100755 similarity index 64% rename from network_io/os2/poll.c rename to poll/os2/poll.c index 3ecdbcec88f..146e950ac29 --- a/network_io/os2/poll.c +++ b/poll/os2/poll.c @@ -124,124 +124,55 @@ APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *pollfdset, int num, + apr_int32_t *nsds, apr_interval_time_t timeout) { int i; int rv = 0; + int num_read = 0, num_write = 0, num_except = 0; + int *socket_list; + + for (i = 0; i < num; i++) { + int events = pollfdset[i].events; + int fd; + + if (pollfdset[i].desc_type == APR_POLL_SOCKET) { + fd = pollfdset[i].desc.s->socketdes; + } + else if (pollfdset[i].desc_type == APR_POLL_FILE) { + fd = pollfdset[i].desc.f->filedes; + } - for (i=0; inum_total; i++) { - pollfdset->r_socket_list[i] = pollfdset->socket_list[i]; + if (events & APR_POLLIN) { + socket_list[num_read] = fd; + num_read++; + } + + if (events & APR_POLLOUT) { + socket_list[num_write] = fd; + num_write++; + } + + if (events &APR_POLLPRI) { + socket_list[num_except] = fd; + num_except++; + } } - rv = select(pollfdset->r_socket_list, - pollfdset->num_read, - pollfdset->num_write, - pollfdset->num_except, + rv = select(socket_list, + num_read, + num_write, + num_except, timeout >= 0 ? timeout / 1000 : -1); /* select() doesn't wipe the socket list in the case of a timeout or * interrupt. This prevents false positives from revents_get */ if (rv == 0) { - for (i=0; inum_total; i++) { - pollfdset->r_socket_list[i] = -1; - } return timeout < 0 ? APR_EINTR : APR_TIMEUP; } (*nsds) = rv; return rv < 0 ? APR_OS2_STATUS(sock_errno()) : APR_SUCCESS; } - - - -APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) -{ - int i; - - *event = 0; - - for (i=0; i < aprset->num_total; i++) { - if (aprset->socket_list[i] == sock->socketdes && aprset->r_socket_list[i] > 0) { - if (i < aprset->num_read) - *event |= APR_POLLIN; - else if (i < aprset->num_read + aprset->num_write) - *event |= APR_POLLOUT; - else - *event |= APR_POLLPRI; - } - } - - return APR_SUCCESS; -} - - - -APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t events) -{ - int start, *count, pos; - - while (events) { - if (events & APR_POLLIN) { - start = 0; - count = &aprset->num_read; - events -= APR_POLLIN; - } else if (events & APR_POLLOUT) { - start = aprset->num_read; - count = &aprset->num_write; - events -= APR_POLLOUT; - } else if (events & APR_POLLPRI) { - start = aprset->num_read + aprset->num_write; - count = &aprset->num_except; - events -= APR_POLLPRI; - } else - break; - - for (pos=start; pos < start+(*count) && aprset->socket_list[pos] != sock->socketdes; pos++); - - if (pos < start+(*count)) { - aprset->num_total--; - (*count)--; - - for (;posnum_total; pos++) { - aprset->socket_list[pos] = aprset->socket_list[pos+1]; - } - } - } - - return APR_SUCCESS; -} - - - -APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) -{ - return apr_poll_socket_mask(aprset, sock, APR_POLLIN|APR_POLLOUT|APR_POLLPRI); -} - - - -APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) -{ - aprset->num_read = 0; - aprset->num_write = 0; - aprset->num_except = 0; - aprset->num_total = 0; - return APR_SUCCESS; -} - - -APR_DECLARE(apr_status_t) apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data) -{ - return apr_pool_userdata_get(data, key, pollfd->cntxt); -} - - - -APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key, - apr_status_t (*cleanup) (void *)) -{ - return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt); -} From dc496b1657090783cf568c856380ec41a72f0ca7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Jul 2002 06:22:22 +0000 Subject: [PATCH 3591/7878] Get Win32 building again. Doesn't build clean, but at least it builds. poll on win32 may or may not work correctly, but then again, I don't believe that httpd needs it at this moment. Not blasting win32's poll until coders are done with it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63604 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 2 +- include/arch/win32/fileio.h | 3 +++ include/arch/win32/networkio.h | 13 +++---------- libapr.dsp | 2 +- poll/unix/poll.c | 20 ++++++++++---------- 5 files changed, 18 insertions(+), 22 deletions(-) diff --git a/apr.dsp b/apr.dsp index 87d68a048a8..a7c0e91960d 100644 --- a/apr.dsp +++ b/apr.dsp @@ -266,7 +266,7 @@ SOURCE=.\network_io\unix\inet_pton.c # End Source File # Begin Source File -SOURCE=.\network_io\win32\poll.c +SOURCE=.\network_io\unix\poll.c # End Source File # Begin Source File diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index b0bb3acd072..670ab9bf008 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -185,6 +185,9 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, * correctly when writing to a file with this flag set TRUE. */ +// for apr_poll.c; +#define filedes filehand + struct apr_file_t { apr_pool_t *pool; HANDLE filehand; diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 6c351b510ce..18ab71f28cb 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -58,6 +58,9 @@ #include "apr_network_io.h" #include "apr_general.h" +// for apr_poll.c; +#define socketdes sock + struct apr_socket_t { apr_pool_t *cntxt; SOCKET sock; @@ -72,16 +75,6 @@ struct apr_socket_t { apr_int32_t inherit; }; -struct apr_pollfd_t { - apr_pool_t *cntxt; - fd_set *read; - int numread; - fd_set *write; - int numwrite; - fd_set *exception; - int numexcept; -}; - #ifdef _WIN32_WCE #ifndef WSABUF typedef struct _WSABUF { diff --git a/libapr.dsp b/libapr.dsp index eb63be9c3c9..ee0c3d7647f 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -272,7 +272,7 @@ SOURCE=.\network_io\unix\inet_pton.c # End Source File # Begin Source File -SOURCE=.\network_io\win32\poll.c +SOURCE=.\network_io\unix\poll.c # End Source File # Begin Source File diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 30f901faedb..1f76c06fc42 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -63,7 +63,7 @@ #include #endif -apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * (num + 1)); if ((*new) == NULL) { @@ -74,7 +74,7 @@ apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con return APR_SUCCESS; } -apr_pollfd_t *find_poll_sock(apr_pollfd_t *aprset, apr_socket_t *sock) +APR_DECLARE(apr_pollfd_t*) find_poll_sock(apr_pollfd_t *aprset, apr_socket_t *sock) { apr_pollfd_t *curr = aprset; @@ -88,7 +88,7 @@ apr_pollfd_t *find_poll_sock(apr_pollfd_t *aprset, apr_socket_t *sock) return curr; } -apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event) { apr_pollfd_t *curr = aprset; @@ -106,7 +106,7 @@ apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset, return APR_SUCCESS; } -apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { apr_pollfd_t *curr = find_poll_sock(aprset, sock); if (curr == NULL) { @@ -117,7 +117,7 @@ apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_po return APR_SUCCESS; } -apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, +APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events) { apr_pollfd_t *curr = find_poll_sock(aprset, sock); @@ -132,7 +132,7 @@ apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset, return APR_SUCCESS; } -apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) +APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) { apr_pollfd_t *curr = find_poll_sock(aprset, sock); if (curr == NULL) { @@ -144,7 +144,7 @@ apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) return APR_SUCCESS; } -apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) +APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) { apr_pollfd_t *curr = aprset; @@ -198,7 +198,7 @@ static apr_int16_t get_revent(apr_int16_t event) return rv; } -apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t num, +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, apr_int32_t *nsds, apr_interval_time_t timeout) { /* obvious optimization, it would be better if this could be allocated @@ -242,7 +242,7 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t num, #else /* Use select to mimic poll */ -apr_status_t apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *nsds, +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *nsds, apr_interval_time_t timeout) { fd_set readset, writeset, exceptset; @@ -328,7 +328,7 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *nsds, * for right now, we'll leave it this way, and change it later if * necessary. */ -apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file) +APR_DECLARE(apr_status_t) apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file) { (*newsock) = apr_pcalloc(file->pool, sizeof(**newsock)); (*newsock)->socketdes = file->filedes; From fd58bcf8c7115c2d46973037c332164bc3dbdb1e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Jul 2002 06:25:28 +0000 Subject: [PATCH 3592/7878] I really don't see why we moved the file git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63605 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 2 +- libapr.dsp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apr.dsp b/apr.dsp index a7c0e91960d..025879c2c51 100644 --- a/apr.dsp +++ b/apr.dsp @@ -266,7 +266,7 @@ SOURCE=.\network_io\unix\inet_pton.c # End Source File # Begin Source File -SOURCE=.\network_io\unix\poll.c +SOURCE=.\poll\unix\poll.c # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index ee0c3d7647f..a2f6b62f4b1 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -272,7 +272,7 @@ SOURCE=.\network_io\unix\inet_pton.c # End Source File # Begin Source File -SOURCE=.\network_io\unix\poll.c +SOURCE=.\poll\unix\poll.c # End Source File # Begin Source File From 3e89b63bb4eb74ce3c01b7ec1bf144f3d6f04226 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 11 Jul 2002 06:28:40 +0000 Subject: [PATCH 3593/7878] Remove the apr_pollfd_t structure from OS/2. This structure is no longer needed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63606 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/networkio.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index d1895e9c3a3..c823c04c18e 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -77,16 +77,6 @@ struct apr_socket_t { apr_int32_t inherit; }; -struct apr_pollfd_t { - apr_pool_t *cntxt; - int *socket_list; - int *r_socket_list; - int num_read; - int num_write; - int num_except; - int num_total; -}; - /* Error codes returned from sock_errno() */ #define SOCBASEERR 10000 #define SOCEPERM (SOCBASEERR+1) /* Not owner */ From 6dff050320e2483fd682d76bb813e36c930bfe53 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Jul 2002 06:37:35 +0000 Subject: [PATCH 3594/7878] Proof that (UNNESTED) was a bad default on Win32; apr_thread_mutex_t Tests Initializing the apr_thread_mutex_t (UNNESTED) OK Starting all the threads OK microseconds: 10171875 usec apr_thread_mutex_t Tests Initializing the apr_thread_mutex_t (NESTED) OK Starting all the threads OK microseconds: 906250 usec apr_thread_rwlock_t Tests Initializing the apr_thread_rwlock_t OK microseconds: 18234375 usec git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63607 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlockperf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testlockperf.c b/test/testlockperf.c index c9515365bbe..0eec581fef9 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -124,8 +124,8 @@ int test_thread_mutex(void) mutex_counter = 0; printf("apr_thread_mutex_t Tests\n"); - printf("%-60s", " Initializing the apr_thread_mutex_t"); - s1 = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, pool); + printf("%-60s", " Initializing the apr_thread_mutex_t (UNNESTED)"); + s1 = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_UNNESTED, pool); if (s1 != APR_SUCCESS) { printf("Failed!\n"); return s1; From e52e43e319a57290083b1a5f5d410f35bd6ab0de Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 11 Jul 2002 14:32:37 +0000 Subject: [PATCH 3595/7878] fix an apparent bug in the select() implementation of apr_poll() (untested) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63608 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 1f76c06fc42..b69dda9d923 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -314,7 +314,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n aprset[i].revents |= APR_POLLOUT; } if (FD_ISSET(fd, &exceptset)) { - aprset[i].events |= APR_POLLERR; + aprset[i].revents |= APR_POLLERR; } } From c01eab9822d7a0fe5ab22087c2998d8da7ab00c8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 11 Jul 2002 14:35:34 +0000 Subject: [PATCH 3596/7878] ignore generated files git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63609 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/.cvsignore | 4 ++++ support/unix/.cvsignore | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 poll/unix/.cvsignore create mode 100644 support/unix/.cvsignore diff --git a/poll/unix/.cvsignore b/poll/unix/.cvsignore new file mode 100644 index 00000000000..2ebd06d3517 --- /dev/null +++ b/poll/unix/.cvsignore @@ -0,0 +1,4 @@ +Makefile +*.lo +.libs +.deps diff --git a/support/unix/.cvsignore b/support/unix/.cvsignore new file mode 100644 index 00000000000..2ebd06d3517 --- /dev/null +++ b/support/unix/.cvsignore @@ -0,0 +1,4 @@ +Makefile +*.lo +.libs +.deps From 71382ef5deaa40a9cbab21d417990fb8d9ef5bc7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 11 Jul 2002 14:39:04 +0000 Subject: [PATCH 3597/7878] get the new poll code to build on AIX, which for 32-bit builds has some extremely unfortunate macros in that play with "events" and "revents" via #define git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63610 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 4 ++-- poll/unix/poll.c | 20 ++++++++++---------- support/unix/waitio.c | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index 2acc5f760b2..8dc1a761345 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -108,8 +108,8 @@ typedef struct apr_pollfd_t apr_pollfd_t; struct apr_pollfd_t { apr_pool_t *p; apr_datatype_e desc_type; - apr_int16_t events; - apr_int16_t revents; + apr_int16_t reqevents; + apr_int16_t rtnevents; apr_descriptor desc; }; diff --git a/poll/unix/poll.c b/poll/unix/poll.c index b69dda9d923..2b7480eda21 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -101,7 +101,7 @@ APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, } curr->desc.s = sock; curr->desc_type = APR_POLL_SOCKET; - curr->events = event; + curr->reqevents = event; return APR_SUCCESS; } @@ -125,8 +125,8 @@ APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, return APR_NOTFOUND; } - if (curr->events & events) { - curr->events ^= events; + if (curr->reqevents & events) { + curr->reqevents ^= events; } return APR_SUCCESS; @@ -272,13 +272,13 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n else if (aprset[i].desc_type == APR_POLL_FILE) { fd = aprset[i].desc.f->filedes; } - if (aprset[i].events & APR_POLLIN) { + if (aprset[i].reqevents & APR_POLLIN) { FD_SET(fd, &readset); } - if (aprset[i].events & APR_POLLOUT) { + if (aprset[i].reqevents & APR_POLLOUT) { FD_SET(fd, &writeset); } - if (aprset[i].events & + if (aprset[i].reqevents & (APR_POLLPRI | APR_POLLERR | APR_POLLHUP | APR_POLLNVAL)) { FD_SET(fd, &exceptset); } @@ -306,15 +306,15 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n else if (aprset[i].desc_type == APR_POLL_FILE) { fd = aprset[i].desc.f->filedes; } - aprset[i].revents = 0; + aprset[i].rtnevents = 0; if (FD_ISSET(fd, &readset)) { - aprset[i].revents |= APR_POLLIN; + aprset[i].rtnevents |= APR_POLLIN; } if (FD_ISSET(fd, &writeset)) { - aprset[i].revents |= APR_POLLOUT; + aprset[i].rtnevents |= APR_POLLOUT; } if (FD_ISSET(fd, &exceptset)) { - aprset[i].revents |= APR_POLLERR; + aprset[i].rtnevents |= APR_POLLERR; } } diff --git a/support/unix/waitio.c b/support/unix/waitio.c index 92c1a368d34..c02f1415538 100644 --- a/support/unix/waitio.c +++ b/support/unix/waitio.c @@ -85,12 +85,12 @@ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, pollset.p = s->cntxt; timeout = s->timeout; } - pollset.events = type; + pollset.reqevents = type; do { srv = apr_poll(&pollset, 1, &n, timeout); - if (n == 1 && pollset.revents & type) { + if (n == 1 && pollset.rtnevents & type) { return APR_SUCCESS; } } while (APR_STATUS_IS_EINTR(srv)); From e877ea03109945caa5c8470cf71d7cec8e534d67 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 11 Jul 2002 15:32:18 +0000 Subject: [PATCH 3598/7878] Split the apr_poll() implementation from the accessor functions. This allows all platforms to use the same implementation for the accessor functions. Submitted by: Brian Havard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63611 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 + libapr.dsp | 4 + poll/os2/Makefile.in | 3 +- poll/os2/pollacc.c | 1 + poll/unix/Makefile.in | 4 +- poll/unix/poll.c | 112 +-------------------------- poll/unix/pollacc.c | 172 ++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 188 insertions(+), 112 deletions(-) create mode 100644 poll/os2/pollacc.c create mode 100644 poll/unix/pollacc.c diff --git a/apr.dsp b/apr.dsp index 025879c2c51..5fa09c4e381 100644 --- a/apr.dsp +++ b/apr.dsp @@ -266,6 +266,10 @@ SOURCE=.\network_io\unix\inet_pton.c # End Source File # Begin Source File +SOURCE=.\poll\unix\pollacc.c +# End Source File +# Begin Source File + SOURCE=.\poll\unix\poll.c # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index a2f6b62f4b1..4c38eb18eb7 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -272,6 +272,10 @@ SOURCE=.\network_io\unix\inet_pton.c # End Source File # Begin Source File +SOURCE=.\poll\unix\pollacc.c +# End Source File +# Begin Source File + SOURCE=.\poll\unix\poll.c # End Source File # Begin Source File diff --git a/poll/os2/Makefile.in b/poll/os2/Makefile.in index 8848b5621a4..86098162b9e 100755 --- a/poll/os2/Makefile.in +++ b/poll/os2/Makefile.in @@ -2,7 +2,8 @@ srcdir = @srcdir@ VPATH = @srcdir@ TARGETS = \ - poll.lo + poll.lo \ + pollacc.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/poll/os2/pollacc.c b/poll/os2/pollacc.c new file mode 100644 index 00000000000..ac87d0aa149 --- /dev/null +++ b/poll/os2/pollacc.c @@ -0,0 +1 @@ +#include "../unix/pollacc.c" diff --git a/poll/unix/Makefile.in b/poll/unix/Makefile.in index 8848b5621a4..d9ab2219e6a 100755 --- a/poll/unix/Makefile.in +++ b/poll/unix/Makefile.in @@ -2,7 +2,9 @@ srcdir = @srcdir@ VPATH = @srcdir@ TARGETS = \ - poll.lo + poll.lo \ + pollacc.lo + # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 2b7480eda21..0b950161331 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -63,99 +63,6 @@ #include #endif -APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) -{ - (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * (num + 1)); - if ((*new) == NULL) { - return APR_ENOMEM; - } - (*new)[num].desc_type = APR_POLL_LASTDESC; - (*new)[0].p = cont; - return APR_SUCCESS; -} - -APR_DECLARE(apr_pollfd_t*) find_poll_sock(apr_pollfd_t *aprset, apr_socket_t *sock) -{ - apr_pollfd_t *curr = aprset; - - while (curr->desc.s != sock) { - if (curr->desc_type == APR_POLL_LASTDESC) { - return NULL; - } - curr++; - } - - return curr; -} - -APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t event) -{ - apr_pollfd_t *curr = aprset; - - while (curr->desc_type != APR_NO_DESC) { - if (curr->desc_type == APR_POLL_LASTDESC) { - return APR_ENOMEM; - } - curr++; - } - curr->desc.s = sock; - curr->desc_type = APR_POLL_SOCKET; - curr->reqevents = event; - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) -{ - apr_pollfd_t *curr = find_poll_sock(aprset, sock); - if (curr == NULL) { - return APR_NOTFOUND; - } - - (*event) = curr->revents; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t events) -{ - apr_pollfd_t *curr = find_poll_sock(aprset, sock); - if (curr == NULL) { - return APR_NOTFOUND; - } - - if (curr->reqevents & events) { - curr->reqevents ^= events; - } - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) -{ - apr_pollfd_t *curr = find_poll_sock(aprset, sock); - if (curr == NULL) { - return APR_NOTFOUND; - } - - curr->desc_type = APR_NO_DESC; - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) -{ - apr_pollfd_t *curr = aprset; - - while (curr->desc_type != APR_POLL_LASTDESC) { - if (curr->events & events) { - curr->events &= ~events; - } - } - return APR_SUCCESS; -} - #ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ static apr_int16_t get_event(apr_int16_t event) @@ -216,7 +123,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, else if (aprset[i].desc_type == APR_POLL_FILE) { pollset[i].fd = aprset[i].desc.f->filedes; } - pollset[i].events = get_event(aprset[i].events); + pollset[i].events = get_event(aprset[i].reqevents); } if (timeout > 0) { @@ -227,7 +134,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, (*nsds) = i; for (i = 0; i < num; i++) { - aprset[i].revents = get_revent(pollset[i].revents); + aprset[i].rtnevents = get_revent(pollset[i].revents); } if ((*nsds) < 0) { @@ -322,18 +229,3 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n } #endif - -#if APR_FILES_AS_SOCKETS -/* I'm not sure if this needs to return an apr_status_t or not, but - * for right now, we'll leave it this way, and change it later if - * necessary. - */ -APR_DECLARE(apr_status_t) apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file) -{ - (*newsock) = apr_pcalloc(file->pool, sizeof(**newsock)); - (*newsock)->socketdes = file->filedes; - (*newsock)->cntxt = file->pool; - (*newsock)->timeout = file->timeout; - return APR_SUCCESS; -} -#endif diff --git a/poll/unix/pollacc.c b/poll/unix/pollacc.c new file mode 100644 index 00000000000..ea6dfe9a479 --- /dev/null +++ b/poll/unix/pollacc.c @@ -0,0 +1,172 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_poll.h" +#include "networkio.h" +#include "fileio.h" +#if HAVE_POLL_H +#include +#endif +#if HAVE_SYS_POLL_H +#include +#endif + +APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) +{ + (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * (num + 1)); + if ((*new) == NULL) { + return APR_ENOMEM; + } + (*new)[num].desc_type = APR_POLL_LASTDESC; + (*new)[0].p = cont; + return APR_SUCCESS; +} + +APR_DECLARE(apr_pollfd_t*) find_poll_sock(apr_pollfd_t *aprset, apr_socket_t *sock) +{ + apr_pollfd_t *curr = aprset; + + while (curr->desc.s != sock) { + if (curr->desc_type == APR_POLL_LASTDESC) { + return NULL; + } + curr++; + } + + return curr; +} + +APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t event) +{ + apr_pollfd_t *curr = aprset; + + while (curr->desc_type != APR_NO_DESC) { + if (curr->desc_type == APR_POLL_LASTDESC) { + return APR_ENOMEM; + } + curr++; + } + curr->desc.s = sock; + curr->desc_type = APR_POLL_SOCKET; + curr->reqevents = event; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) +{ + apr_pollfd_t *curr = find_poll_sock(aprset, sock); + if (curr == NULL) { + return APR_NOTFOUND; + } + + (*event) = curr->rtnevents; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t events) +{ + apr_pollfd_t *curr = find_poll_sock(aprset, sock); + if (curr == NULL) { + return APR_NOTFOUND; + } + + if (curr->reqevents & events) { + curr->reqevents ^= events; + } + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) +{ + apr_pollfd_t *curr = find_poll_sock(aprset, sock); + if (curr == NULL) { + return APR_NOTFOUND; + } + + curr->desc_type = APR_NO_DESC; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) +{ + apr_pollfd_t *curr = aprset; + + while (curr->desc_type != APR_POLL_LASTDESC) { + if (curr->reqevents & events) { + curr->reqevents &= ~events; + } + } + return APR_SUCCESS; +} + +#if APR_FILES_AS_SOCKETS +/* I'm not sure if this needs to return an apr_status_t or not, but + * for right now, we'll leave it this way, and change it later if + * necessary. + */ +APR_DECLARE(apr_status_t) apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file) +{ + (*newsock) = apr_pcalloc(file->pool, sizeof(**newsock)); + (*newsock)->socketdes = file->filedes; + (*newsock)->cntxt = file->pool; + (*newsock)->timeout = file->timeout; + return APR_SUCCESS; +} +#endif From de508068b327f2e750b9ce08dfa2602bb535d7c0 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 11 Jul 2002 15:49:04 +0000 Subject: [PATCH 3599/7878] Fixing up APR for NetWare so that it builds with the new apr_poll() changes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63612 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 9 +++++++++ build/nw_export.inc | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index 63bd95915b2..3b6cd9634da 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -295,6 +295,7 @@ FILES_lib_objs = \ $(OBJDIR)/utf8_ucs2.o \ $(OBJDIR)/uuid.o \ $(OBJDIR)/version.o \ + $(OBJDIR)/waitio.o \ $(OBJDIR)/xlate.o \ $(EOLIST) @@ -389,6 +390,10 @@ $(OBJDIR)/%.o: network_io/win32/%.c $(OBJDIR)\cc.opt $(OBJDIR)/%.o: network_io/unix/%.c $(OBJDIR)\cc.opt @echo Compiling $< $(CC) network_io\unix\$( Date: Thu, 11 Jul 2002 16:00:08 +0000 Subject: [PATCH 3600/7878] OS/2: rewrite apr_poll() with the new interface. There's probably room for optimization here but this at least gets us going again & passes testpoll. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63613 13f79535-47bb-0310-9956-ffa450edef68 --- poll/os2/.cvsignore | 4 ++ poll/os2/poll.c | 171 +++++++++++++++++--------------------------- 2 files changed, 71 insertions(+), 104 deletions(-) create mode 100644 poll/os2/.cvsignore diff --git a/poll/os2/.cvsignore b/poll/os2/.cvsignore new file mode 100644 index 00000000000..2ebd06d3517 --- /dev/null +++ b/poll/os2/.cvsignore @@ -0,0 +1,4 @@ +Makefile +*.lo +.libs +.deps diff --git a/poll/os2/poll.c b/poll/os2/poll.c index 146e950ac29..54b0be29ed4 100755 --- a/poll/os2/poll.c +++ b/poll/os2/poll.c @@ -52,127 +52,90 @@ * . */ +#include "apr.h" +#include "apr_poll.h" #include "networkio.h" -#include "apr_network_io.h" -#include "apr_general.h" -#include "apr_portable.h" -#include "apr_lib.h" -#include -#include - -/* OS/2 doesn't have a poll function, implement using OS/2 style select */ - -APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) + +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, + apr_int32_t *nsds, apr_interval_time_t timeout) { - *new = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t)); + int *pollset; + int i; + int num_read = 0, num_write = 0, num_except = 0, num_total; + int pos_read, pos_write, pos_except; - if (*new == NULL) { - return APR_ENOMEM; + for (i = 0; i < num; i++) { + num_read += (aprset[i].reqevents & APR_POLLIN) != 0; + num_write += (aprset[i].reqevents & APR_POLLOUT) != 0; + num_except += (aprset[i].reqevents & APR_POLLPRI) != 0; } - (*new)->socket_list = apr_palloc(cont, sizeof(int) * num); - - if ((*new)->socket_list == NULL) { - return APR_ENOMEM; - } - - (*new)->r_socket_list = apr_palloc(cont, sizeof(int) * num); - - if ((*new)->r_socket_list == NULL) { - return APR_ENOMEM; - } - - (*new)->cntxt = cont; - (*new)->num_total = 0; - (*new)->num_read = 0; - (*new)->num_write = 0; - (*new)->num_except = 0; - - return APR_SUCCESS; -} + num_total = num_read + num_write + num_except; + pollset = alloca(sizeof(int) * num_total); + memset(pollset, 0, sizeof(int) * num_total); + pos_read = 0; + pos_write = num_read; + pos_except = pos_write + num_write; + for (i = 0; i < num; i++) { + if (aprset[i].desc_type == APR_POLL_SOCKET) { + if (aprset[i].reqevents & APR_POLLIN) { + pollset[pos_read++] = aprset[i].desc.s->socketdes; + } -APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t events) -{ - int i; - - if (events & APR_POLLIN) { - for (i=aprset->num_total; i>aprset->num_read; i--) - aprset->socket_list[i] = aprset->socket_list[i-1]; - aprset->socket_list[i] = sock->socketdes; - aprset->num_read++; - aprset->num_total++; + if (aprset[i].reqevents & APR_POLLOUT) { + pollset[pos_write++] = aprset[i].desc.s->socketdes; + } + + if (aprset[i].reqevents & APR_POLLPRI) { + pollset[pos_except++] = aprset[i].desc.s->socketdes; + } + + aprset[i].rtnevents = 0; + } + } + + if (timeout > 0) { + timeout /= 1000; /* convert microseconds to milliseconds */ } - - if (events & APR_POLLOUT) { - for (i=aprset->num_total; i>aprset->num_read + aprset->num_write; i--) - aprset->socket_list[i] = aprset->socket_list[i-1]; - aprset->socket_list[i] = sock->socketdes; - aprset->num_write++; - aprset->num_total++; - } - - if (events &APR_POLLPRI) { - aprset->socket_list[aprset->num_total] = sock->socketdes; - aprset->num_except++; - aprset->num_total++; + + i = select(pollset, num_read, num_write, num_except, timeout); + (*nsds) = i; + + if ((*nsds) < 0) { + return APR_FROM_OS_ERROR(sock_errno()); } - return APR_SUCCESS; -} + if ((*nsds) == 0) { + return APR_TIMEUP; + } + pos_read = 0; + pos_write = num_read; + pos_except = pos_write + num_write; -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *pollfdset, int num, - apr_int32_t *nsds, - apr_interval_time_t timeout) -{ - int i; - int rv = 0; - int num_read = 0, num_write = 0, num_except = 0; - int *socket_list; - for (i = 0; i < num; i++) { - int events = pollfdset[i].events; - int fd; + if (aprset[i].desc_type == APR_POLL_SOCKET) { + if (aprset[i].reqevents & APR_POLLIN) { + if (pollset[pos_read++] > 0) { + aprset[i].rtnevents |= APR_POLLIN; + } + } - if (pollfdset[i].desc_type == APR_POLL_SOCKET) { - fd = pollfdset[i].desc.s->socketdes; - } - else if (pollfdset[i].desc_type == APR_POLL_FILE) { - fd = pollfdset[i].desc.f->filedes; - } + if (aprset[i].reqevents & APR_POLLOUT) { + if (pollset[pos_write++] > 0) { + aprset[i].rtnevents |= APR_POLLOUT; + } + } - if (events & APR_POLLIN) { - socket_list[num_read] = fd; - num_read++; - } - - if (events & APR_POLLOUT) { - socket_list[num_write] = fd; - num_write++; - } - - if (events &APR_POLLPRI) { - socket_list[num_except] = fd; - num_except++; + if (aprset[i].reqevents & APR_POLLPRI) { + if (pollset[pos_except++] > 0) { + aprset[i].rtnevents |= APR_POLLPRI; + } + } } } - rv = select(socket_list, - num_read, - num_write, - num_except, - timeout >= 0 ? timeout / 1000 : -1); - - /* select() doesn't wipe the socket list in the case of a timeout or - * interrupt. This prevents false positives from revents_get - */ - if (rv == 0) { - return timeout < 0 ? APR_EINTR : APR_TIMEUP; - } - - (*nsds) = rv; - return rv < 0 ? APR_OS2_STATUS(sock_errno()) : APR_SUCCESS; + return APR_SUCCESS; } From 211fdfdbdc6094911f7661f6dacf9c9002bdf81e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 11 Jul 2002 16:07:14 +0000 Subject: [PATCH 3601/7878] Updated the NetWare project file to include the new apr_poll implementation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63614 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 195032 -> 194535 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 856c03e9fa837698443196cfddcda09a7a24e9d1..2f75eb89d0de2b143ffffe02dc19e797da3229dc 100644 GIT binary patch delta 88866 zcmaI71ymeQ^e%`KJP95gf&_P$1a}DpcL@;OoyGzI1`8HEcnA)`ZLq;1NFexN0fG%a zzyLe>{ogygZ_l1RXZp_Vx>eQHC0|v2b^G@@-tGxr*bmgQ9Nc8>15UMOUG`Ly%(@&@ zdce;l1CIh#Li!ujT9+sM_R@b9P0XZx;N;s-B+SWQ^UUOrW&$8ikXz>kc_5-_L2c73PYJqQ}%fv?nwE`{D6rEJ6hE`juzHb`iHH+r((X`AQbARBs77J_@RUO1LOlhBCE{+;6q<&wTrK)6U z@HaSauPw=BfBEluR7h-8`nSc+Mz0g-IH~#d-vs->*({3srG{nB>!nFEy@bK9;j|CTz)7yK%umVjEeSfrRp|2WNrzrc(YNGacfVYRhkx+I^h4>8Zh(4V5?sWTHk8 z#~uA#$qI)T&zpX{{49Ofb?9!YO5o5g-th^5Fa0_&5ZtpjT$;;QhiGMsxZ!25Wy{8=&o~mQ5kPxzZ`m?Vu_R5mtZ*d84D|!Xa!f*Gf6YYyVpIL~A9{6FH9aYBq5WeBF zrOZz%cw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QYdPdsZTfek`<_&s2e|%hsIgTznN~E z0>nQW-nH!qMEa7t!*DuHa#rn5cBpE?kh}VX3-|0l?bJwx`O3640!<}rF@I#mNqGQ2 zur%CwN{*Ft@?6n#_Gd4ImO?lr+m9c3H)*h_jmi@*HvnSj5RHD%evfLA4{xa3LhrTj zvrd${Gaqg;R>`78Ho<_YL3nMl%(56e{GT27`wrjmFt@_kcJ5MsTythQNrQayGMy&x zElsX4u_3_Tn#q$zxKBN2H|E$ew{E{H`pzDsVM~q^?0L^#?FSbRVIdyZFfiZ~di|=s z$6>wFbnN`5KYF|32j#O=-jhA_U!XP1dhPLqH^0OHT=megSgovfIS+8@bXqS!N%k(T zg+9Hzkq8H}UJ$#umF));zs-D{00+(In++KNo?LX`zHBEMq8r0rj|XR8HwS5-m{440 z{?!0$h(nk<3OU_T!~~k)12=h^ggf4n3UGsurRYzaagh?)V_ww5fkCys{T{AbTj!Pd zy1G`4KAKUT^pddGoO6lbvhb|wmvVb7Ta7-L?cCi`GL zqIv=fZ!)byw(-txcR{|=y9CCjVI{7TbG}0Vs9=U4>j#fiIo7g!jDnzT2iqedo0ua>)5Y z4lLgu)#(urOKPs=`LThI<(Prj4(( z_ZVYk$>7Ag-0MsK!9T>!XD#I#mfu6b>rRNu8x3!rN_`=~-_rI+geA8XZM&jAyvo+_ z_H#w?t4Uq=a`SwZ&N@%{KGP&Mgk}!E62ExBx{VRV(Tinl{C22+GJ_J&;%v6SZW~3Fh3; z<5A8nfu) Date: Thu, 11 Jul 2002 22:15:26 +0000 Subject: [PATCH 3610/7878] fix apparent paste-o checking for O_NDELAY -- this is too weird to explain. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63623 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 93745b75539..8d702733c20 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -76,7 +76,7 @@ static apr_status_t pipeblock(apr_file_t *thepipe) fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); # if defined(O_NONBLOCK) fd_flags &= ~O_NONBLOCK; -# elif defined(~O_NDELAY) +# elif defined(O_NDELAY) fd_flags &= ~O_NDELAY; # elif defined(FNDELAY) fd_flags &= ~O_FNDELAY; From 3e7c7d6c89e3ea7f26f005ea8c2bd452cefb32bd Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Thu, 11 Jul 2002 23:00:17 +0000 Subject: [PATCH 3611/7878] MHO git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63624 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index adc836872bf..49cd0cb418f 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/11 19:45:10 $] +Last modified at [$Date: 2002/07/11 23:00:17 $] Release: @@ -66,10 +66,16 @@ CURRENT VOTES: system types, or map to system units. +1: rbb, wrowe, jerenkrantz, striker +0: brianp + -0.5: jwoolley -1: aaron [veto for reusing the apr_time_t identifier for a new use] 2) Renaming the function to get rid of apr_time_t vs time_t confusion, which brianp suggests apr_timeval_t. +1: fielding, aaron + +1: jwoolley [but -1 to apr_timeval_t in particular as it has just + as much potential for confusion as apr_time_t (there + is a "struct timeval" defined by POSIX -- apr_busecs_t + or apr_busec_time_t seemed okay to me, though brianp + vetoed whatever that was] -0: wrowe, jerenkrantz, striker -0.5: rbb From dc12a58d5096ec922f0329d58b05606660548a59 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Thu, 11 Jul 2002 23:00:54 +0000 Subject: [PATCH 3612/7878] This seems to be a fairly moot issue at this point. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63625 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 51 +-------------------------------------------------- 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/STATUS b/STATUS index 49cd0cb418f..d9b2b84bd3a 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/11 23:00:17 $] +Last modified at [$Date: 2002/07/11 23:00:54 $] Release: @@ -79,55 +79,6 @@ CURRENT VOTES: -0: wrowe, jerenkrantz, striker -0.5: rbb - * For the atomics code to be efficient it depends on instructions - in newer sparc models. Unfortunately this means that binaries - optimized at build-time for these architectures will not work - on older hardware, regardless of the version of Solaris running. - The same is likely happening on the various x86 implementations. - Although I had high hopes for the atomics code, I think we can - not support it in a way that is compatible with the portability - goals of APR, and I hereby propose that we remove it from APR. - - +1: Aaron - -0: Justin (I think it's warranted and fits with our portability - goals, but I'm not going to spend my time supporting it - - although I have spent more time on this than I'd like. - If someone wants to maintain it, more power to them. If - no one maintains it, this gets changed to a +1.), - BrianP,cliff,gregames: - (All the reasons why we don't want the processor-specific - code in APR are also reasons why I don't want to push - that code up into the apps that use APR. I'd rather - spend some more time searching for a workable solution - before we give up on atomics. Perhaps we should let - apps using the atomic API set a preprocessor flag to - choose an "optimal" or "portable" version of the atomic - ops?) - Sander (The positive sides of the atomics outweigh the negative - in my opinion. That said, I am not going to be the - one spending time on this, since asm on various - processors isn't really my game) - Jim,rbb: - (who thinks we'll need to reformat this vote) Any time - you make use of processor specific code for optimizations - or capability, you run into portability concerns. The - real option is to make atomics a compile-time option. - YES means you use the atomics code, based on the *build* - machine (and therefore carries some dependencies) or - NO which maintains "universal" portabiity, which is - what we have (but the default being NO atomics) - -1: IanH, BillS: - I don't agree. I think APR is the perfect place this kind of thing. - For platforms that support it is a big win, for ones which don't - they are no worse off than the alternative. - I can't maintain every asm implementation, but I am volunteering - for sparc/x86. (we could also grab the FreeBSD - implementations for HW they support) - Unfortunatly I was out of action for a month when half the - hubub was going on. - The other alternative for non-native support is maybe to turn - it into a spin lock - RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From 5f9573388b663c8ba6827bed03bffc48e57f823c Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Thu, 11 Jul 2002 23:32:50 +0000 Subject: [PATCH 3613/7878] wake up git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63626 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index d9b2b84bd3a..80da4cec55f 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/11 23:00:54 $] +Last modified at [$Date: 2002/07/11 23:32:50 $] Release: @@ -61,13 +61,18 @@ CURRENT VOTES: * apr_time_t will change to use binary microseconds based on profiling. The last remaining question on the table is keeping the apr_time_t designation, or changing the symbol name. - 1) Keeping the existing apr_time_t names, in spite of potential - ANSI/C99 time_t confusion. apr_types don't promise to be + 1) Keeping the existing apr_time_t names, in spite of + ANSI/C99 time_t confusion demonstrated by dozens of bug + fixes since it was introduced. apr_types don't promise to be system types, or map to system units. +1: rbb, wrowe, jerenkrantz, striker +0: brianp -0.5: jwoolley -1: aaron [veto for reusing the apr_time_t identifier for a new use] + fielding [if they don't map to system types, then don't mimic + the system types --- give me back all of my ap_time functions + that were converted to microsecond arguments even though none + of them do anything useful with microseconds.] 2) Renaming the function to get rid of apr_time_t vs time_t confusion, which brianp suggests apr_timeval_t. +1: fielding, aaron @@ -79,6 +84,33 @@ CURRENT VOTES: -0: wrowe, jerenkrantz, striker -0.5: rbb + [fielding: Is APR time guaranteed to be a scalar quantity? If so, + then we must include units as part of the definition of the + type in order to let developers make use of that quarantee. + In that case, the units should be in the type name [e.g., apr_busec]. + If not, then we should be storing time in a structure with + separate fields in order to have better precision with less code. + + In any case, time_t ==> seconds because time_t is guaranteed + by POSIX to be a scalar quantity for arithmetic operations. + Saying that apr_time_t doesn't imply seconds is to ignore the + fact that all of those httpd functions used to create APR were + defined in terms of seconds and make no use of microseconds. + + Meanwhile, the only reason we have this stupid debate is because + wrowe insists that time_t is 32 bits and therefore dies in 2038. + In fact, time_t is 64 bits on 64bit NT, Linux, OSF, and probably + others that I haven't checked. In any case, since we use the + system's time_t time() function to get the time value everywhere + except Win32 w/SYSTEMTIME, we only ever have a resolution of + seconds or milliseconds. So, why the hell are we storing usecs? + We don't use them. We don't even have display functions for them. + We have to do a stupid conversion every time we actually do something + useful with time in order to support somebody's wet dream of a + potentially useful feature? That's crap! This is exactly why + I hate portability libraries that aren't based on the demonstrated + needs of a specific application.] + RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From 39caa1ccda6071e5547dc6675290e541083cac8c Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Thu, 11 Jul 2002 23:40:48 +0000 Subject: [PATCH 3614/7878] Comments on the time_t discussion git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63627 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 80da4cec55f..90849258861 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/11 23:32:50 $] +Last modified at [$Date: 2002/07/11 23:40:48 $] Release: @@ -104,6 +104,12 @@ CURRENT VOTES: system's time_t time() function to get the time value everywhere except Win32 w/SYSTEMTIME, we only ever have a resolution of seconds or milliseconds. So, why the hell are we storing usecs? + + [brianp: This is incorrect. We use gettimeofday() in place + of time. It's faster than time(), and it gives us microseconds + in addition to seconds. Why do you want to throw away the + microseconds?!!] + We don't use them. We don't even have display functions for them. We have to do a stupid conversion every time we actually do something useful with time in order to support somebody's wet dream of a From a27b066c981abc50069e71e2bb178bd542d9cf6d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Jul 2002 23:58:44 +0000 Subject: [PATCH 3615/7878] Split opinion, commentary and aspecific complaints from the statements at issue; add some observations. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63628 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 68 +++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 22 deletions(-) diff --git a/STATUS b/STATUS index 90849258861..4bf9bd45a20 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/11 23:40:48 $] +Last modified at [$Date: 2002/07/11 23:58:44 $] Release: @@ -61,44 +61,61 @@ CURRENT VOTES: * apr_time_t will change to use binary microseconds based on profiling. The last remaining question on the table is keeping the apr_time_t designation, or changing the symbol name. - 1) Keeping the existing apr_time_t names, in spite of - ANSI/C99 time_t confusion demonstrated by dozens of bug - fixes since it was introduced. apr_types don't promise to be - system types, or map to system units. - +1: rbb, wrowe, jerenkrantz, striker + 1) Keeping the existing apr_time_t names, in spite of confusion + with ANSI/C99 time_t's units, and prior decimal usec definition. + +1: rbb, jerenkrantz, striker + +1: wrowe [apr_types don't promise to map to C99/ANSI units] +0: brianp -0.5: jwoolley -1: aaron [veto for reusing the apr_time_t identifier for a new use] fielding [if they don't map to system types, then don't mimic the system types --- give me back all of my ap_time functions that were converted to microsecond arguments even though none - of them do anything useful with microseconds.] + of them do anything useful with microseconds. Confusion is + demonstrated by dozens of bug fixes since it was introduced.] + 2) Renaming the function to get rid of apr_time_t vs time_t confusion, - which brianp suggests apr_timeval_t. - +1: fielding, aaron - +1: jwoolley [but -1 to apr_timeval_t in particular as it has just - as much potential for confusion as apr_time_t (there - is a "struct timeval" defined by POSIX -- apr_busecs_t - or apr_busec_time_t seemed okay to me, though brianp - vetoed whatever that was] + but keep it ambigious and make no contract with the user about the + units represented. Needs a better suggestion than apr_timeval_t. + +1: aaron + +1: jwoolley -0: wrowe, jerenkrantz, striker -0.5: rbb + 3) Renaming the function to get rid of apr_time_t vs time_t confusion, + and strongly identify the type as apr_busec_t or apr_butime_t, with + an ongoing contract with users about the type's units. + +1: fielding + +1: jwoolley + +0.5: wrowe + -0.5: rbb + [fielding: Is APR time guaranteed to be a scalar quantity? If so, then we must include units as part of the definition of the - type in order to let developers make use of that quarantee. - In that case, the units should be in the type name [e.g., apr_busec]. - If not, then we should be storing time in a structure with - separate fields in order to have better precision with less code. + type in order to let developers make use of that quarantee. + In that case, the units should be in the type name [e.g., apr_busec] - In any case, time_t ==> seconds because time_t is guaranteed + [wrowe: deltas require NO definition of the scale.] + + [fielding: If not, then we should be storing time in a + structure with separate fields in order to have better precision + with less code.] + + [wrowe: dean argued that away a very, very long time ago. That is + a dead horse... compositing and breaking apart for each simple deltas + (the most common case) is too costly. Scalars are the only clean + answer - and you do not need to know scale to do addition/subtraction.] + + [fielding: In any case, time_t ==> seconds because time_t is guaranteed by POSIX to be a scalar quantity for arithmetic operations. Saying that apr_time_t doesn't imply seconds is to ignore the fact that all of those httpd functions used to create APR were - defined in terms of seconds and make no use of microseconds. + defined in terms of seconds and make no use of microseconds.] + + [wrowe: read code.] - Meanwhile, the only reason we have this stupid debate is because - wrowe insists that time_t is 32 bits and therefore dies in 2038. + [fielding: Meanwhile, the only reason we have this stupid debate is + because wrowe insists that time_t is 32 bits and therefore dies in 2038. In fact, time_t is 64 bits on 64bit NT, Linux, OSF, and probably others that I haven't checked. In any case, since we use the system's time_t time() function to get the time value everywhere @@ -117,6 +134,13 @@ CURRENT VOTES: I hate portability libraries that aren't based on the demonstrated needs of a specific application.] + [wrowe: 1. no, time_t is undefined. Sometimes 32, sometimes 64 bits. + 2. no, on 64 bit WinNT time_t remains 32 bits, as do all ints. + 3. correct on sec/msec, until apr is improved by platform, we default + to posix values. + 4. several apps include flood and ab require usec resolution. + 5. Posix timeval structures use sec/usec resolution. + 6. Already demonstrated, done shouting yet?] RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From 02ce3c1e185be3c4eded9ad9474d8e0d8b94d0f4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 12 Jul 2002 00:01:08 +0000 Subject: [PATCH 3616/7878] Fix my misconception, and retract an otherwise combative answer to a combative comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63629 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/STATUS b/STATUS index 4bf9bd45a20..32234091126 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/11 23:58:44 $] +Last modified at [$Date: 2002/07/12 00:01:08 $] Release: @@ -136,11 +136,8 @@ CURRENT VOTES: [wrowe: 1. no, time_t is undefined. Sometimes 32, sometimes 64 bits. 2. no, on 64 bit WinNT time_t remains 32 bits, as do all ints. - 3. correct on sec/msec, until apr is improved by platform, we default - to posix values. - 4. several apps include flood and ab require usec resolution. - 5. Posix timeval structures use sec/usec resolution. - 6. Already demonstrated, done shouting yet?] + 3. several apps include flood and ab require usec resolution. + 4. Posix timeval structures use sec/usec resolution.] RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From 6418b07b4ce13f92a6971a8f533c195b6f03382f Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 12 Jul 2002 00:07:15 +0000 Subject: [PATCH 3617/7878] Yet another vote... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63630 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 32234091126..f19dd867400 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 00:01:08 $] +Last modified at [$Date: 2002/07/12 00:07:15 $] Release: @@ -88,6 +88,7 @@ CURRENT VOTES: +1: fielding +1: jwoolley +0.5: wrowe + -0: striker -0.5: rbb [fielding: Is APR time guaranteed to be a scalar quantity? If so, From bda040b712367f0c16202b0a45a09fcdec04c30f Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 12 Jul 2002 00:10:29 +0000 Subject: [PATCH 3618/7878] Grmbl, grmbl, 8 spaces -> tab... squash it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63631 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index f19dd867400..7480500d1df 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 00:07:15 $] +Last modified at [$Date: 2002/07/12 00:10:29 $] Release: @@ -88,7 +88,7 @@ CURRENT VOTES: +1: fielding +1: jwoolley +0.5: wrowe - -0: striker + -0: striker -0.5: rbb [fielding: Is APR time guaranteed to be a scalar quantity? If so, From cc7619dd744e7c150706a1fcfcac497405104c7c Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 12 Jul 2002 00:13:53 +0000 Subject: [PATCH 3619/7878] IMHO, apr_time_t should be treated as an opaque value. The library should be free to change the implementation details whenever it wants. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63632 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 7480500d1df..25303cb4e22 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 00:10:29 $] +Last modified at [$Date: 2002/07/12 00:13:53 $] Release: @@ -88,7 +88,7 @@ CURRENT VOTES: +1: fielding +1: jwoolley +0.5: wrowe - -0: striker + -0: striker, jerenkrantz -0.5: rbb [fielding: Is APR time guaranteed to be a scalar quantity? If so, From d646106ccffa5bc5472d39162eb7113ee4e41c2e Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Fri, 12 Jul 2002 00:30:59 +0000 Subject: [PATCH 3620/7878] more junk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63633 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 25303cb4e22..de7b08e2cda 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 00:13:53 $] +Last modified at [$Date: 2002/07/12 00:30:59 $] Release: @@ -98,6 +98,10 @@ CURRENT VOTES: [wrowe: deltas require NO definition of the scale.] + [fielding: That's nonsense. What does overflow mean? What are you + going to do when you print? How do you interface with other library + routines? Scale always matters for scalars.] + [fielding: If not, then we should be storing time in a structure with separate fields in order to have better precision with less code.] @@ -106,6 +110,10 @@ CURRENT VOTES: a dead horse... compositing and breaking apart for each simple deltas (the most common case) is too costly. Scalars are the only clean answer - and you do not need to know scale to do addition/subtraction.] + + [fielding: Dean argued that in general. I argue that httpd never + does time arithmetic other than in seconds and second-comparisons. + Microseconds are therefore harmful to httpd.] [fielding: In any case, time_t ==> seconds because time_t is guaranteed by POSIX to be a scalar quantity for arithmetic operations. @@ -115,6 +123,9 @@ CURRENT VOTES: [wrowe: read code.] + [fielding: I read it. I know exactly which functions from httpd + that I wrote were subsequently broken when they were moved into APR.] + [fielding: Meanwhile, the only reason we have this stupid debate is because wrowe insists that time_t is 32 bits and therefore dies in 2038. In fact, time_t is 64 bits on 64bit NT, Linux, OSF, and probably @@ -128,6 +139,11 @@ CURRENT VOTES: in addition to seconds. Why do you want to throw away the microseconds?!!] + [fielding: Sorry, I missed them: + 86 calls to apr_time_now() + 32 calls to time() + +1 to making time consistent.] + We don't use them. We don't even have display functions for them. We have to do a stupid conversion every time we actually do something useful with time in order to support somebody's wet dream of a @@ -140,6 +156,14 @@ CURRENT VOTES: 3. several apps include flood and ab require usec resolution. 4. Posix timeval structures use sec/usec resolution.] + [fielding: 1. POSIX requires it to be long, so largest native int. + 2. Microsoft claims otherwise, but it is still vaporware anyway. + 3. POSIX always stores them as separate integers. + 4. Benchmarks are meaningless unless they average over hundreds + of requests, which requires double floats (not time intervals). + 5. +1 for using struct tm everywhere. + 6. No.] + RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * The return type of a thread function (void *) is inconsistent with From 95c55a8a5c5c2c9771c69c41e900b68aee6e409c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 12 Jul 2002 00:53:43 +0000 Subject: [PATCH 3621/7878] Revert the other significant response to trolling, it didn't belong in status. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63634 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/STATUS b/STATUS index de7b08e2cda..fd6bd17d29b 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 00:30:59 $] +Last modified at [$Date: 2002/07/12 00:53:43 $] Release: @@ -120,13 +120,7 @@ CURRENT VOTES: Saying that apr_time_t doesn't imply seconds is to ignore the fact that all of those httpd functions used to create APR were defined in terms of seconds and make no use of microseconds.] - - [wrowe: read code.] - - [fielding: I read it. I know exactly which functions from httpd - that I wrote were subsequently broken when they were moved into APR.] - - [fielding: Meanwhile, the only reason we have this stupid debate is + Meanwhile, the only reason we have this stupid debate is because wrowe insists that time_t is 32 bits and therefore dies in 2038. In fact, time_t is 64 bits on 64bit NT, Linux, OSF, and probably others that I haven't checked. In any case, since we use the From 1a7e6d64feacf2cfae866b59b9cdf4fe3be35ba0 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 12 Jul 2002 01:00:12 +0000 Subject: [PATCH 3622/7878] updated my votes on apr_table_t, added some explanatory notes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63635 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index fd6bd17d29b..17db50eecf7 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 00:53:43 $] +Last modified at [$Date: 2002/07/12 01:00:12 $] Release: @@ -79,6 +79,7 @@ CURRENT VOTES: units represented. Needs a better suggestion than apr_timeval_t. +1: aaron +1: jwoolley + +1: brianp -0: wrowe, jerenkrantz, striker -0.5: rbb @@ -89,13 +90,23 @@ CURRENT VOTES: +1: jwoolley +0.5: wrowe -0: striker, jerenkrantz - -0.5: rbb + -0.5: rbb, brianp [fielding: Is APR time guaranteed to be a scalar quantity? If so, then we must include units as part of the definition of the type in order to let developers make use of that quarantee. In that case, the units should be in the type name [e.g., apr_busec] + [brianp: I think that apr_time_t is really a "struct with an + compact representation that we can pass around easily and + add/subtract efficiently," rather than a scalar. It's probably + worth noting that I look at it this way because it often is + populated from the struct timeval produced by gettimeofday(). + Because I think of the scalar representation as an implementation + detail, rather than an feature of the time API, I'd prefer to + use a name that doesn't advertise the binary microseconds concept. + But I've changed my -1 on the binary microsecond name to a -0.5.] + [wrowe: deltas require NO definition of the scale.] [fielding: That's nonsense. What does overflow mean? What are you From fe94b9cd8ecfd7b77af36d67c9d705408b79f652 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 12 Jul 2002 01:05:39 +0000 Subject: [PATCH 3623/7878] add my 2c's PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63636 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 17db50eecf7..bc9b3285d28 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 01:00:12 $] +Last modified at [$Date: 2002/07/12 01:05:39 $] Release: @@ -73,13 +73,15 @@ CURRENT VOTES: that were converted to microsecond arguments even though none of them do anything useful with microseconds. Confusion is demonstrated by dozens of bug fixes since it was introduced.] + ianh [me too] 2) Renaming the function to get rid of apr_time_t vs time_t confusion, but keep it ambigious and make no contract with the user about the units represented. Needs a better suggestion than apr_timeval_t. +1: aaron +1: jwoolley - +1: brianp + +1: brianp + +1: ianh -0: wrowe, jerenkrantz, striker -0.5: rbb @@ -90,7 +92,7 @@ CURRENT VOTES: +1: jwoolley +0.5: wrowe -0: striker, jerenkrantz - -0.5: rbb, brianp + -0.5: rbb, brianp,ianh [fielding: Is APR time guaranteed to be a scalar quantity? If so, then we must include units as part of the definition of the From 7e8006f3b97bed232a099b2704801a4d84fc9e9a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 12 Jul 2002 01:09:38 +0000 Subject: [PATCH 3624/7878] Revisit my position, and comments on-point. Off-topic comments to list. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63637 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/STATUS b/STATUS index bc9b3285d28..c1a86afa9e4 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 01:05:39 $] +Last modified at [$Date: 2002/07/12 01:09:38 $] Release: @@ -61,10 +61,11 @@ CURRENT VOTES: * apr_time_t will change to use binary microseconds based on profiling. The last remaining question on the table is keeping the apr_time_t designation, or changing the symbol name. + 1) Keeping the existing apr_time_t names, in spite of confusion with ANSI/C99 time_t's units, and prior decimal usec definition. +1: rbb, jerenkrantz, striker - +1: wrowe [apr_types don't promise to map to C99/ANSI units] + +0: wrowe [apr_types don't promise to map to C99/ANSI units] +0: brianp -0.5: jwoolley -1: aaron [veto for reusing the apr_time_t identifier for a new use] @@ -82,15 +83,15 @@ CURRENT VOTES: +1: jwoolley +1: brianp +1: ianh - -0: wrowe, jerenkrantz, striker - -0.5: rbb + -0: jerenkrantz, striker + -0.5: rbb, wrowe 3) Renaming the function to get rid of apr_time_t vs time_t confusion, and strongly identify the type as apr_busec_t or apr_butime_t, with an ongoing contract with users about the type's units. - +1: fielding + +1: fielding [prefers apr_busec_t] +1: jwoolley - +0.5: wrowe + +0.5: wrowe [prefers apr_butime_t but isn't going to fight that] -0: striker, jerenkrantz -0.5: rbb, brianp,ianh @@ -115,6 +116,9 @@ CURRENT VOTES: going to do when you print? How do you interface with other library routines? Scale always matters for scalars.] + [wrowe: We have apr_time formatting and math routines. + But I've always favored an explicit contract.] + [fielding: If not, then we should be storing time in a structure with separate fields in order to have better precision with less code.] From 7cb5ed31676ce8f4614ce4055630b06ead19338a Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 12 Jul 2002 01:20:14 +0000 Subject: [PATCH 3625/7878] Reformat all votes of the same number with no explanations on the same line git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63638 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/STATUS b/STATUS index c1a86afa9e4..ce901f4c4af 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 01:09:38 $] +Last modified at [$Date: 2002/07/12 01:20:14 $] Release: @@ -79,10 +79,7 @@ CURRENT VOTES: 2) Renaming the function to get rid of apr_time_t vs time_t confusion, but keep it ambigious and make no contract with the user about the units represented. Needs a better suggestion than apr_timeval_t. - +1: aaron - +1: jwoolley - +1: brianp - +1: ianh + +1: aaron, jwoolley, brianp, ianh -0: jerenkrantz, striker -0.5: rbb, wrowe From 4a643ad90b28ff442754df6a2c5c297387dc8679 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Fri, 12 Jul 2002 01:23:19 +0000 Subject: [PATCH 3626/7878] whee, better than a vote git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63639 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/STATUS b/STATUS index ce901f4c4af..7d0c8df7d50 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 01:20:14 $] +Last modified at [$Date: 2002/07/12 01:23:19 $] Release: @@ -86,7 +86,7 @@ CURRENT VOTES: 3) Renaming the function to get rid of apr_time_t vs time_t confusion, and strongly identify the type as apr_busec_t or apr_butime_t, with an ongoing contract with users about the type's units. - +1: fielding [prefers apr_busec_t] + +1: fielding [prefers apr_busec or simple time_t / struct tm] +1: jwoolley +0.5: wrowe [prefers apr_butime_t but isn't going to fight that] -0: striker, jerenkrantz @@ -133,8 +133,8 @@ CURRENT VOTES: by POSIX to be a scalar quantity for arithmetic operations. Saying that apr_time_t doesn't imply seconds is to ignore the fact that all of those httpd functions used to create APR were - defined in terms of seconds and make no use of microseconds.] - Meanwhile, the only reason we have this stupid debate is + defined in terms of seconds and make no use of microseconds. + Meanwhile, the only reason we have this debate is because wrowe insists that time_t is 32 bits and therefore dies in 2038. In fact, time_t is 64 bits on 64bit NT, Linux, OSF, and probably others that I haven't checked. In any case, since we use the @@ -166,11 +166,15 @@ CURRENT VOTES: [fielding: 1. POSIX requires it to be long, so largest native int. 2. Microsoft claims otherwise, but it is still vaporware anyway. - 3. POSIX always stores them as separate integers. - 4. Benchmarks are meaningless unless they average over hundreds + 3. Benchmarks are meaningless unless they average over hundreds of requests, which requires double floats (not time intervals). - 5. +1 for using struct tm everywhere. - 6. No.] + 4. POSIX always stores them as separate integers. +1 for that.] + + [fielding; Cliff says he has a sample app. I still don't know how + he uses them without making implementation assumptions about + apr_time_t everywhere (there is no print routine for microsecond + resolution), but I'll accept the need for microsecond resolution + in addition to second resolution.] RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From 51f517afff41121f7923409c9b9b362d2af3208f Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 12 Jul 2002 04:28:16 +0000 Subject: [PATCH 3627/7878] Updated votes on apr_time_t renaming git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63640 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 7d0c8df7d50..892470efc30 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 01:23:19 $] +Last modified at [$Date: 2002/07/12 04:28:16 $] Release: @@ -88,9 +88,10 @@ CURRENT VOTES: an ongoing contract with users about the type's units. +1: fielding [prefers apr_busec or simple time_t / struct tm] +1: jwoolley - +0.5: wrowe [prefers apr_butime_t but isn't going to fight that] + +0.5: wrowe, [prefers apr_butime_t but isn't going to fight that] + brianp -0: striker, jerenkrantz - -0.5: rbb, brianp,ianh + -0.5: rbb, ianh [fielding: Is APR time guaranteed to be a scalar quantity? If so, then we must include units as part of the definition of the From bbc4fb052810cee625bf02bc9c5d5300cd720f9e Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 12 Jul 2002 11:47:15 +0000 Subject: [PATCH 3628/7878] BeOS uses port 7772 for apache 2, so if you ran these tests on a system with apache 2 running then this test would fail. Move the port number higher to avoid the problem. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63641 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testpoll.c b/test/testpoll.c index 8a99904b2ea..fe373ca2a23 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -167,7 +167,7 @@ int main(void) printf("\tCreating the sockets I'll use.........."); for (i = 0; i < 3; i++){ - if (make_socket(&s[i], &sa[i], 7770 + i, context) != 0){ + if (make_socket(&s[i], &sa[i], 7777 + i, context) != 0){ exit(-1); } } From bf7021281cb87feeb898936b1b57dee126d5be32 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 12 Jul 2002 21:37:14 +0000 Subject: [PATCH 3629/7878] Add my votes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63642 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/STATUS b/STATUS index 892470efc30..09d5887ca37 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 04:28:16 $] +Last modified at [$Date: 2002/07/12 21:37:14 $] Release: @@ -64,7 +64,7 @@ CURRENT VOTES: 1) Keeping the existing apr_time_t names, in spite of confusion with ANSI/C99 time_t's units, and prior decimal usec definition. - +1: rbb, jerenkrantz, striker + +1: rbb, jerenkrantz, striker, dreid +0: wrowe [apr_types don't promise to map to C99/ANSI units] +0: brianp -0.5: jwoolley @@ -80,7 +80,7 @@ CURRENT VOTES: but keep it ambigious and make no contract with the user about the units represented. Needs a better suggestion than apr_timeval_t. +1: aaron, jwoolley, brianp, ianh - -0: jerenkrantz, striker + -0: jerenkrantz, striker, dreid -0.5: rbb, wrowe 3) Renaming the function to get rid of apr_time_t vs time_t confusion, @@ -91,7 +91,7 @@ CURRENT VOTES: +0.5: wrowe, [prefers apr_butime_t but isn't going to fight that] brianp -0: striker, jerenkrantz - -0.5: rbb, ianh + -0.5: rbb, ianh, dreid [fielding: Is APR time guaranteed to be a scalar quantity? If so, then we must include units as part of the definition of the From 4e839adb79ec7024a4a115bbb50ccd5620383ba4 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Fri, 12 Jul 2002 21:40:20 +0000 Subject: [PATCH 3630/7878] I've since been swayed more toward the middle of this debate. I'm of conflicting strong opinions at the moment, so I'm withdrawing my votes for now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63643 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/STATUS b/STATUS index 09d5887ca37..4c9b3f622c9 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 21:37:14 $] +Last modified at [$Date: 2002/07/12 21:40:20 $] Release: @@ -67,7 +67,6 @@ CURRENT VOTES: +1: rbb, jerenkrantz, striker, dreid +0: wrowe [apr_types don't promise to map to C99/ANSI units] +0: brianp - -0.5: jwoolley -1: aaron [veto for reusing the apr_time_t identifier for a new use] fielding [if they don't map to system types, then don't mimic the system types --- give me back all of my ap_time functions @@ -79,7 +78,7 @@ CURRENT VOTES: 2) Renaming the function to get rid of apr_time_t vs time_t confusion, but keep it ambigious and make no contract with the user about the units represented. Needs a better suggestion than apr_timeval_t. - +1: aaron, jwoolley, brianp, ianh + +1: aaron, brianp, ianh -0: jerenkrantz, striker, dreid -0.5: rbb, wrowe @@ -87,7 +86,6 @@ CURRENT VOTES: and strongly identify the type as apr_busec_t or apr_butime_t, with an ongoing contract with users about the type's units. +1: fielding [prefers apr_busec or simple time_t / struct tm] - +1: jwoolley +0.5: wrowe, [prefers apr_butime_t but isn't going to fight that] brianp -0: striker, jerenkrantz From 4abf7b705caabf839d9075062100ee0805b2acae Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 12 Jul 2002 21:46:18 +0000 Subject: [PATCH 3631/7878] Refine my suggested names for both alternatives. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63644 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 4c9b3f622c9..358d35c215d 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 21:40:20 $] +Last modified at [$Date: 2002/07/12 21:46:18 $] Release: @@ -80,13 +80,14 @@ CURRENT VOTES: units represented. Needs a better suggestion than apr_timeval_t. +1: aaron, brianp, ianh -0: jerenkrantz, striker, dreid - -0.5: rbb, wrowe + -0.5: rbb + wrowe [prefers apr_utime_t and apr_uspan_t where u==undefined] 3) Renaming the function to get rid of apr_time_t vs time_t confusion, and strongly identify the type as apr_busec_t or apr_butime_t, with an ongoing contract with users about the type's units. +1: fielding [prefers apr_busec or simple time_t / struct tm] - +0.5: wrowe, [prefers apr_butime_t but isn't going to fight that] + +0.5: wrowe, [prefers apr_time_busec_t and apr_span_busec_t] brianp -0: striker, jerenkrantz -0.5: rbb, ianh, dreid From 58efdc8f76214523b89de25725088f38ee6bb69e Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 12 Jul 2002 22:10:38 +0000 Subject: [PATCH 3632/7878] Updated votes on time types git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63645 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 358d35c215d..2f1b334647c 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 21:46:18 $] +Last modified at [$Date: 2002/07/12 22:10:38 $] Release: @@ -88,10 +88,13 @@ CURRENT VOTES: an ongoing contract with users about the type's units. +1: fielding [prefers apr_busec or simple time_t / struct tm] +0.5: wrowe, [prefers apr_time_busec_t and apr_span_busec_t] - brianp + brianp [can live with apr_time_busec_t and apr_span_busec_t] -0: striker, jerenkrantz -0.5: rbb, ianh, dreid + 4) Using time_t and struct timeval + -1: brianp + [fielding: Is APR time guaranteed to be a scalar quantity? If so, then we must include units as part of the definition of the type in order to let developers make use of that quarantee. From 3323975cec36a51483e9fc10d47bc4a3ad846cd3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 12 Jul 2002 22:26:59 +0000 Subject: [PATCH 3633/7878] Thanks brian... add my vote, and move fielding's to make it absolutely clear this is a seperate alternative. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63646 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/STATUS b/STATUS index 2f1b334647c..cd827f03d51 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 22:10:38 $] +Last modified at [$Date: 2002/07/12 22:26:59 $] Release: @@ -86,14 +86,15 @@ CURRENT VOTES: 3) Renaming the function to get rid of apr_time_t vs time_t confusion, and strongly identify the type as apr_busec_t or apr_butime_t, with an ongoing contract with users about the type's units. - +1: fielding [prefers apr_busec or simple time_t / struct tm] + +1: fielding [prefers apr_busec] +0.5: wrowe, [prefers apr_time_busec_t and apr_span_busec_t] brianp [can live with apr_time_busec_t and apr_span_busec_t] -0: striker, jerenkrantz -0.5: rbb, ianh, dreid - 4) Using time_t and struct timeval - -1: brianp + 4) Using time_t and struct timeval/tm + +1: fielding + -1: brianp, wrowe [fielding: Is APR time guaranteed to be a scalar quantity? If so, then we must include units as part of the definition of the From 08d10c60e66de851537d45ac0d993d1495a27f18 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 13 Jul 2002 01:49:35 +0000 Subject: [PATCH 3634/7878] more votes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63647 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/STATUS b/STATUS index cd827f03d51..0e579f3c517 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/12 22:26:59 $] +Last modified at [$Date: 2002/07/13 01:49:35 $] Release: @@ -78,7 +78,8 @@ CURRENT VOTES: 2) Renaming the function to get rid of apr_time_t vs time_t confusion, but keep it ambigious and make no contract with the user about the units represented. Needs a better suggestion than apr_timeval_t. - +1: aaron, brianp, ianh + +1: aaron, brianp, ianh, + fielding [prefers apr_time and apr_span (_t is half the problem)] -0: jerenkrantz, striker, dreid -0.5: rbb wrowe [prefers apr_utime_t and apr_uspan_t where u==undefined] @@ -86,14 +87,14 @@ CURRENT VOTES: 3) Renaming the function to get rid of apr_time_t vs time_t confusion, and strongly identify the type as apr_busec_t or apr_butime_t, with an ongoing contract with users about the type's units. - +1: fielding [prefers apr_busec] +0.5: wrowe, [prefers apr_time_busec_t and apr_span_busec_t] - brianp [can live with apr_time_busec_t and apr_span_busec_t] + brianp, [can live with apr_time_busec_t and apr_span_busec_t] + fielding [me too] -0: striker, jerenkrantz -0.5: rbb, ianh, dreid 4) Using time_t and struct timeval/tm - +1: fielding + +1: fielding (if apr_time is not an ADT) -1: brianp, wrowe [fielding: Is APR time guaranteed to be a scalar quantity? If so, From 3c54f4c889e3c8d5152ebf911f33dec494accca9 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 13 Jul 2002 02:46:46 +0000 Subject: [PATCH 3635/7878] bugger git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63648 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 0e579f3c517..9ff1e8c780e 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/13 01:49:35 $] +Last modified at [$Date: 2002/07/13 02:46:46 $] Release: @@ -79,7 +79,7 @@ CURRENT VOTES: but keep it ambigious and make no contract with the user about the units represented. Needs a better suggestion than apr_timeval_t. +1: aaron, brianp, ianh, - fielding [prefers apr_time and apr_span (_t is half the problem)] + fielding [prefers apr_utime_t and apr_utimediff_t (64bit)] -0: jerenkrantz, striker, dreid -0.5: rbb wrowe [prefers apr_utime_t and apr_uspan_t where u==undefined] From acfae587aba06950dbc8bd42d6db38caa956d9b8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 13 Jul 2002 06:31:52 +0000 Subject: [PATCH 3636/7878] Macroized... but no macros git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63649 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 1 + 1 file changed, 1 insertion(+) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 0b950161331..672946c8ff7 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -54,6 +54,7 @@ #include "apr.h" #include "apr_poll.h" +#include "apr_time.h" #include "networkio.h" #include "fileio.h" #if HAVE_POLL_H From f630b006ff52cb8142bc8f15dc2e6b0be1292d1a Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 13 Jul 2002 07:08:41 +0000 Subject: [PATCH 3637/7878] Changed apr_table_elts() and apr_is_empty_table() from macros to functions to make apr_table_t a fully abstract type git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63650 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 5 ++--- tables/apr_tables.c | 9 +++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index 0cabeefe4de..d2cc0bd1845 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -125,15 +125,14 @@ struct apr_table_entry_t { * @param t The table * @return An array containing the contents of the table */ -#define apr_table_elts(t) ((const apr_array_header_t *)(t)) +APR_DECLARE(const apr_array_header_t *) apr_table_elts(const apr_table_t *t); /** * Determine if the table is empty * @param t The table to check * @return True if empty, False otherwise */ -#define apr_is_empty_table(t) (((t) == NULL) \ - || (((apr_array_header_t *)(t))->nelts == 0)) +APR_DECLARE(int) apr_is_empty_table(const apr_table_t *t); /** * Create an array diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 1949af9db08..9f7a3bb585a 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -368,6 +368,15 @@ static apr_table_entry_t *table_push(apr_table_t *t) #define table_push(t) ((apr_table_entry_t *) apr_array_push_noclear(&(t)->a)) #endif /* MAKE_TABLE_PROFILE */ +APR_DECLARE(const apr_array_header_t *) apr_table_elts(const apr_table_t *t) +{ + return (const apr_array_header_t *)t; +} + +APR_DECLARE(int) apr_is_empty_table(const apr_table_t *t) +{ + return ((t == NULL) || (t->a.nelts == 0)); +} APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts) { From 5187a077aac9b5d8edf5d2fcc730917b96821ae8 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 13 Jul 2002 07:11:19 +0000 Subject: [PATCH 3638/7878] Fix socket counts after a socket has been removed from the poll set. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63651 13f79535-47bb-0310-9956-ffa450edef68 --- poll/os2/poll.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/poll/os2/poll.c b/poll/os2/poll.c index 54b0be29ed4..02f53b19674 100755 --- a/poll/os2/poll.c +++ b/poll/os2/poll.c @@ -65,9 +65,11 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, int pos_read, pos_write, pos_except; for (i = 0; i < num; i++) { - num_read += (aprset[i].reqevents & APR_POLLIN) != 0; - num_write += (aprset[i].reqevents & APR_POLLOUT) != 0; - num_except += (aprset[i].reqevents & APR_POLLPRI) != 0; + if (aprset[i].desc_type == APR_POLL_SOCKET) { + num_read += (aprset[i].reqevents & APR_POLLIN) != 0; + num_write += (aprset[i].reqevents & APR_POLLOUT) != 0; + num_except += (aprset[i].reqevents & APR_POLLPRI) != 0; + } } num_total = num_read + num_write + num_except; From df1fd13c3e483a8f14b6d9a4f1ea4070da86cdf0 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 13 Jul 2002 13:35:19 +0000 Subject: [PATCH 3639/7878] Cast a vote, though I have on purpose avoiding chiming in during the debate. In general, however, the need for second and microsecond resolution seems pretty clear to me, as well as the need for as much scalar ops as possible. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63652 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 9ff1e8c780e..53ec3f7d202 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/13 02:46:46 $] +Last modified at [$Date: 2002/07/13 13:35:19 $] Release: @@ -64,7 +64,7 @@ CURRENT VOTES: 1) Keeping the existing apr_time_t names, in spite of confusion with ANSI/C99 time_t's units, and prior decimal usec definition. - +1: rbb, jerenkrantz, striker, dreid + +1: rbb, jerenkrantz, striker, dreid, jim +0: wrowe [apr_types don't promise to map to C99/ANSI units] +0: brianp -1: aaron [veto for reusing the apr_time_t identifier for a new use] @@ -80,6 +80,7 @@ CURRENT VOTES: units represented. Needs a better suggestion than apr_timeval_t. +1: aaron, brianp, ianh, fielding [prefers apr_utime_t and apr_utimediff_t (64bit)] + +0.5: jim -0: jerenkrantz, striker, dreid -0.5: rbb wrowe [prefers apr_utime_t and apr_uspan_t where u==undefined] @@ -91,7 +92,7 @@ CURRENT VOTES: brianp, [can live with apr_time_busec_t and apr_span_busec_t] fielding [me too] -0: striker, jerenkrantz - -0.5: rbb, ianh, dreid + -0.5: rbb, ianh, dreid, jim 4) Using time_t and struct timeval/tm +1: fielding (if apr_time is not an ADT) From 6509bff81a3021f63d275c4d1ffcf4769e746845 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 13 Jul 2002 18:16:33 +0000 Subject: [PATCH 3640/7878] added apr_is_empty_array() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63653 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 7 +++++++ tables/apr_tables.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/include/apr_tables.h b/include/apr_tables.h index d2cc0bd1845..852a48ac315 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -134,6 +134,13 @@ APR_DECLARE(const apr_array_header_t *) apr_table_elts(const apr_table_t *t); */ APR_DECLARE(int) apr_is_empty_table(const apr_table_t *t); +/** + * Determine if the array is empty + * @param a The array to check + * @return True if empty, False otherwise + */ +APR_DECLARE(int) apr_is_empty_array(const apr_array_header_t *a); + /** * Create an array * @param p The pool to allocate the memory out of diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 9f7a3bb585a..6601a9168aa 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -109,6 +109,11 @@ static void make_array_core(apr_array_header_t *res, apr_pool_t *p, res->nalloc = nelts; /* ...but this many allocated */ } +APR_DECLARE(int) apr_is_empty_array(const apr_array_header_t *a) +{ + return ((a == NULL) || (a->nelts == 0)); +} + APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, int nelts, int elt_size) { From 2190a9be83575804dc9e5389a8b8d1d16a913abe Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sat, 13 Jul 2002 21:34:36 +0000 Subject: [PATCH 3641/7878] Remove a bogus fixup from apr_vformatter, which made sure a NUL byte could fit in by flushing if the final character was at the exact end of the buffer it was using. Take care of the case that the fixup was handling in apr_psprintf, by ensuring we can fit a NUL byte from the beginning. Implement this by calling flush if we start with a 0 byte buffer (in which nothing can fit anyway). Secondly make sure that the flush function never tries to use a block that has less than APR_PSPRINTF_MIN_STRINGSIZE bytes to spare. Thanks to Nuutti Kotivuori for pointing out the problem, digging around for answers and providing patches. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63654 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 23 +++++++++++++++++++++++ strings/apr_snprintf.c | 5 +---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 82a9f7b2e5a..91edc046eb7 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -903,6 +903,8 @@ struct psprintf_data { apr_memnode_t *free; }; +#define APR_PSPRINTF_MIN_STRINGSIZE 32 + static int psprintf_flush(apr_vformatter_buff_t *vbuff) { struct psprintf_data *ps = (struct psprintf_data *)vbuff; @@ -918,6 +920,14 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) cur_len = strp - active->first_avail; size = cur_len << 1; + /* Make sure that we don't try to use a block that has less + * than APR_PSPRINTF_MIN_STRINGSIZE bytes left in it. This + * also catches the case where size == 0, which would result + * in reusing a block that can't even hold the NUL byte. + */ + if (size < APR_PSPRINTF_MIN_STRINGSIZE) + size = APR_PSPRINTF_MIN_STRINGSIZE; + node = active->next; if (!ps->got_a_new_node && node->first_avail + size < node->endp) { *node->ref = node->next; @@ -992,6 +1002,19 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) ps.got_a_new_node = 0; ps.free = NULL; + /* Make sure that the first node passed to apr_vformatter has at least + * room to hold the NUL terminator. + */ + if (ps.node->first_avail == ps.node->endp) { + if (psprintf_flush(&ps.vbuff) == -1) { + if (pool->abort_fn) { + pool->abort_fn(APR_ENOMEM); + } + + return NULL; + } + } + if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index f73bb32c6b1..0d7d3e14d9c 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -1197,10 +1197,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), fmt++; } vbuff->curpos = sp; - if (sp >= bep) { - if (flush_func(vbuff)) - return -1; - } + return cc; } From 27be2c09d639f0fdd17a576dcec6d50cf4bef1de Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sat, 13 Jul 2002 21:38:02 +0000 Subject: [PATCH 3642/7878] Detabbify previous commit... The offending party has been slapped on the wrists by the style police. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63655 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 91edc046eb7..d8b6dd4fd66 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -926,7 +926,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) * in reusing a block that can't even hold the NUL byte. */ if (size < APR_PSPRINTF_MIN_STRINGSIZE) - size = APR_PSPRINTF_MIN_STRINGSIZE; + size = APR_PSPRINTF_MIN_STRINGSIZE; node = active->next; if (!ps->got_a_new_node && node->first_avail + size < node->endp) { @@ -1006,13 +1006,13 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) * room to hold the NUL terminator. */ if (ps.node->first_avail == ps.node->endp) { - if (psprintf_flush(&ps.vbuff) == -1) { - if (pool->abort_fn) { - pool->abort_fn(APR_ENOMEM); - } + if (psprintf_flush(&ps.vbuff) == -1) { + if (pool->abort_fn) { + pool->abort_fn(APR_ENOMEM); + } - return NULL; - } + return NULL; + } } if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) { From b0486cb43ab17bc9fbf335197c4acd1480617a80 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sun, 14 Jul 2002 20:01:39 +0000 Subject: [PATCH 3643/7878] My new view git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63656 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/STATUS b/STATUS index 53ec3f7d202..44cb82d870d 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/13 13:35:19 $] +Last modified at [$Date: 2002/07/14 20:01:39 $] Release: @@ -64,7 +64,7 @@ CURRENT VOTES: 1) Keeping the existing apr_time_t names, in spite of confusion with ANSI/C99 time_t's units, and prior decimal usec definition. - +1: rbb, jerenkrantz, striker, dreid, jim + +1: rbb, jerenkrantz, striker, dreid, jim, jwoolley +0: wrowe [apr_types don't promise to map to C99/ANSI units] +0: brianp -1: aaron [veto for reusing the apr_time_t identifier for a new use] @@ -82,7 +82,7 @@ CURRENT VOTES: fielding [prefers apr_utime_t and apr_utimediff_t (64bit)] +0.5: jim -0: jerenkrantz, striker, dreid - -0.5: rbb + -0.5: rbb, jwoolley wrowe [prefers apr_utime_t and apr_uspan_t where u==undefined] 3) Renaming the function to get rid of apr_time_t vs time_t confusion, @@ -92,11 +92,11 @@ CURRENT VOTES: brianp, [can live with apr_time_busec_t and apr_span_busec_t] fielding [me too] -0: striker, jerenkrantz - -0.5: rbb, ianh, dreid, jim + -0.5: rbb, ianh, dreid, jim, jwoolley 4) Using time_t and struct timeval/tm +1: fielding (if apr_time is not an ADT) - -1: brianp, wrowe + -1: brianp, wrowe, jwoolley [fielding: Is APR time guaranteed to be a scalar quantity? If so, then we must include units as part of the definition of the From 223290e106e21d6abdf679cb382ee933bcbe218b Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 14 Jul 2002 20:32:34 +0000 Subject: [PATCH 3644/7878] I don't like the half point votes one bit, but since others are using them and they reflect my position better, I'll put my name there. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63657 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/STATUS b/STATUS index 44cb82d870d..11fab736f7b 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/14 20:01:39 $] +Last modified at [$Date: 2002/07/14 20:32:34 $] Release: @@ -81,8 +81,8 @@ CURRENT VOTES: +1: aaron, brianp, ianh, fielding [prefers apr_utime_t and apr_utimediff_t (64bit)] +0.5: jim - -0: jerenkrantz, striker, dreid - -0.5: rbb, jwoolley + -0: jerenkrantz, dreid + -0.5: rbb, jwoolley, striker wrowe [prefers apr_utime_t and apr_uspan_t where u==undefined] 3) Renaming the function to get rid of apr_time_t vs time_t confusion, @@ -91,8 +91,8 @@ CURRENT VOTES: +0.5: wrowe, [prefers apr_time_busec_t and apr_span_busec_t] brianp, [can live with apr_time_busec_t and apr_span_busec_t] fielding [me too] - -0: striker, jerenkrantz - -0.5: rbb, ianh, dreid, jim, jwoolley + -0: jerenkrantz + -0.5: rbb, ianh, dreid, jim, jwoolley, striker 4) Using time_t and struct timeval/tm +1: fielding (if apr_time is not an ADT) From b83f18af62aa881de578b2400b9cf89038112799 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Mon, 15 Jul 2002 01:25:05 +0000 Subject: [PATCH 3645/7878] *** empty log message *** git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63658 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/STATUS b/STATUS index 11fab736f7b..5be8e910d86 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/14 20:32:34 $] +Last modified at [$Date: 2002/07/15 01:25:05 $] Release: @@ -64,7 +64,7 @@ CURRENT VOTES: 1) Keeping the existing apr_time_t names, in spite of confusion with ANSI/C99 time_t's units, and prior decimal usec definition. - +1: rbb, jerenkrantz, striker, dreid, jim, jwoolley + +1: rbb, jerenkrantz, striker, dreid, jim, jwoolley, brane +0: wrowe [apr_types don't promise to map to C99/ANSI units] +0: brianp -1: aaron [veto for reusing the apr_time_t identifier for a new use] @@ -82,7 +82,7 @@ CURRENT VOTES: fielding [prefers apr_utime_t and apr_utimediff_t (64bit)] +0.5: jim -0: jerenkrantz, dreid - -0.5: rbb, jwoolley, striker + -0.5: rbb, jwoolley, striker, brane wrowe [prefers apr_utime_t and apr_uspan_t where u==undefined] 3) Renaming the function to get rid of apr_time_t vs time_t confusion, @@ -91,12 +91,13 @@ CURRENT VOTES: +0.5: wrowe, [prefers apr_time_busec_t and apr_span_busec_t] brianp, [can live with apr_time_busec_t and apr_span_busec_t] fielding [me too] + +0: brane -0: jerenkrantz -0.5: rbb, ianh, dreid, jim, jwoolley, striker 4) Using time_t and struct timeval/tm +1: fielding (if apr_time is not an ADT) - -1: brianp, wrowe, jwoolley + -1: brianp, wrowe, jwoolley, brane [fielding: Is APR time guaranteed to be a scalar quantity? If so, then we must include units as part of the definition of the From cdd8eb6392102aabbb6e956d6bd0757169966ef9 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Mon, 15 Jul 2002 03:46:03 +0000 Subject: [PATCH 3646/7878] Fix units bug in apr_interval_time_t parameter. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63659 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/testpoll.c b/test/testpoll.c index fe373ca2a23..9073d260854 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -187,29 +187,29 @@ int main(void) printf("OK\n"); printf("Starting Tests\n"); - apr_poll(pollset, 3, &srv, 10); + apr_poll(pollset, 3, &srv, 10 * APR_USEC_PER_SEC); check_sockets(pollset, s); send_msg(s, sa, 2); - apr_poll(pollset, 3, &srv, 10); + apr_poll(pollset, 3, &srv, 10 * APR_USEC_PER_SEC); check_sockets(pollset, s); recv_msg(s, 2, context); send_msg(s, sa, 1); - apr_poll(pollset, 3, &srv, 10); + apr_poll(pollset, 3, &srv, 10 * APR_USEC_PER_SEC); check_sockets(pollset, s); send_msg(s, sa, 2); - apr_poll(pollset, 3, &srv, 10); + apr_poll(pollset, 3, &srv, 10 * APR_USEC_PER_SEC); check_sockets(pollset, s); recv_msg(s, 1, context); send_msg(s, sa, 0); - apr_poll(pollset, 3, &srv, 10); + apr_poll(pollset, 3, &srv, 10 * APR_USEC_PER_SEC); check_sockets(pollset, s); printf("Tests completed.\n"); From d48390c58480db9b9ea6e9d0bb6446986504f4a4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 04:27:38 +0000 Subject: [PATCH 3647/7878] Revoking my proposal [busec] from consideration. It may be re-introduced at some future point if the list concurs 1. that a single atomic unit of time in APR is necessary and not subject to debate. 2. that the resolution of said unit should be no less that 1ms. At that point, discussion of this patch is appropriate. At this point, discussion is too unfocused. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63660 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 127 +-------------------------------------------------------- 1 file changed, 2 insertions(+), 125 deletions(-) diff --git a/STATUS b/STATUS index 5be8e910d86..868c8202112 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/15 01:25:05 $] +Last modified at [$Date: 2002/07/15 04:27:38 $] Release: @@ -58,130 +58,7 @@ RELEASE SHOWSTOPPERS: CURRENT VOTES: - * apr_time_t will change to use binary microseconds based on - profiling. The last remaining question on the table is keeping - the apr_time_t designation, or changing the symbol name. - - 1) Keeping the existing apr_time_t names, in spite of confusion - with ANSI/C99 time_t's units, and prior decimal usec definition. - +1: rbb, jerenkrantz, striker, dreid, jim, jwoolley, brane - +0: wrowe [apr_types don't promise to map to C99/ANSI units] - +0: brianp - -1: aaron [veto for reusing the apr_time_t identifier for a new use] - fielding [if they don't map to system types, then don't mimic - the system types --- give me back all of my ap_time functions - that were converted to microsecond arguments even though none - of them do anything useful with microseconds. Confusion is - demonstrated by dozens of bug fixes since it was introduced.] - ianh [me too] - - 2) Renaming the function to get rid of apr_time_t vs time_t confusion, - but keep it ambigious and make no contract with the user about the - units represented. Needs a better suggestion than apr_timeval_t. - +1: aaron, brianp, ianh, - fielding [prefers apr_utime_t and apr_utimediff_t (64bit)] - +0.5: jim - -0: jerenkrantz, dreid - -0.5: rbb, jwoolley, striker, brane - wrowe [prefers apr_utime_t and apr_uspan_t where u==undefined] - - 3) Renaming the function to get rid of apr_time_t vs time_t confusion, - and strongly identify the type as apr_busec_t or apr_butime_t, with - an ongoing contract with users about the type's units. - +0.5: wrowe, [prefers apr_time_busec_t and apr_span_busec_t] - brianp, [can live with apr_time_busec_t and apr_span_busec_t] - fielding [me too] - +0: brane - -0: jerenkrantz - -0.5: rbb, ianh, dreid, jim, jwoolley, striker - - 4) Using time_t and struct timeval/tm - +1: fielding (if apr_time is not an ADT) - -1: brianp, wrowe, jwoolley, brane - - [fielding: Is APR time guaranteed to be a scalar quantity? If so, - then we must include units as part of the definition of the - type in order to let developers make use of that quarantee. - In that case, the units should be in the type name [e.g., apr_busec] - - [brianp: I think that apr_time_t is really a "struct with an - compact representation that we can pass around easily and - add/subtract efficiently," rather than a scalar. It's probably - worth noting that I look at it this way because it often is - populated from the struct timeval produced by gettimeofday(). - Because I think of the scalar representation as an implementation - detail, rather than an feature of the time API, I'd prefer to - use a name that doesn't advertise the binary microseconds concept. - But I've changed my -1 on the binary microsecond name to a -0.5.] - - [wrowe: deltas require NO definition of the scale.] - - [fielding: That's nonsense. What does overflow mean? What are you - going to do when you print? How do you interface with other library - routines? Scale always matters for scalars.] - - [wrowe: We have apr_time formatting and math routines. - But I've always favored an explicit contract.] - - [fielding: If not, then we should be storing time in a - structure with separate fields in order to have better precision - with less code.] - - [wrowe: dean argued that away a very, very long time ago. That is - a dead horse... compositing and breaking apart for each simple deltas - (the most common case) is too costly. Scalars are the only clean - answer - and you do not need to know scale to do addition/subtraction.] - - [fielding: Dean argued that in general. I argue that httpd never - does time arithmetic other than in seconds and second-comparisons. - Microseconds are therefore harmful to httpd.] - - [fielding: In any case, time_t ==> seconds because time_t is guaranteed - by POSIX to be a scalar quantity for arithmetic operations. - Saying that apr_time_t doesn't imply seconds is to ignore the - fact that all of those httpd functions used to create APR were - defined in terms of seconds and make no use of microseconds. - Meanwhile, the only reason we have this debate is - because wrowe insists that time_t is 32 bits and therefore dies in 2038. - In fact, time_t is 64 bits on 64bit NT, Linux, OSF, and probably - others that I haven't checked. In any case, since we use the - system's time_t time() function to get the time value everywhere - except Win32 w/SYSTEMTIME, we only ever have a resolution of - seconds or milliseconds. So, why the hell are we storing usecs? - - [brianp: This is incorrect. We use gettimeofday() in place - of time. It's faster than time(), and it gives us microseconds - in addition to seconds. Why do you want to throw away the - microseconds?!!] - - [fielding: Sorry, I missed them: - 86 calls to apr_time_now() - 32 calls to time() - +1 to making time consistent.] - - We don't use them. We don't even have display functions for them. - We have to do a stupid conversion every time we actually do something - useful with time in order to support somebody's wet dream of a - potentially useful feature? That's crap! This is exactly why - I hate portability libraries that aren't based on the demonstrated - needs of a specific application.] - - [wrowe: 1. no, time_t is undefined. Sometimes 32, sometimes 64 bits. - 2. no, on 64 bit WinNT time_t remains 32 bits, as do all ints. - 3. several apps include flood and ab require usec resolution. - 4. Posix timeval structures use sec/usec resolution.] - - [fielding: 1. POSIX requires it to be long, so largest native int. - 2. Microsoft claims otherwise, but it is still vaporware anyway. - 3. Benchmarks are meaningless unless they average over hundreds - of requests, which requires double floats (not time intervals). - 4. POSIX always stores them as separate integers. +1 for that.] - - [fielding; Cliff says he has a sample app. I still don't know how - he uses them without making implementation assumptions about - apr_time_t everywhere (there is no print routine for microsecond - resolution), but I'll accept the need for microsecond resolution - in addition to second resolution.] + * None RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From 1505741897c30defc96ecd41e7372d173f8bca95 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 06:05:23 +0000 Subject: [PATCH 3648/7878] apr_get/setsockopt (badly named) doesn't work for apr_interval_time_t's, in fact, it's the only reason apr_short_interval_time_t exists. Introduce apr_socket_timeout_set/get APIs, and prepare to deprecate APR_SO_TIMEOUT by removing the references in the docs. [But NOT the actual APR_SO_TIMEOUT macro... this is still compatible.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63661 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 7255d6315ea..fb88da2b76d 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -112,7 +112,7 @@ extern "C" { * again when NOPUSH is turned off */ #define APR_INCOMPLETE_READ 4096 /**< Set on non-blocking sockets - * (APR_SO_TIMEOUT != 0) on which the + * (timeout != 0) on which the * previous read() did not fill a buffer * completely. the next apr_recv() will * first call select()/poll() rather than @@ -432,7 +432,7 @@ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, * @remark *

      * This functions acts like a blocking write by default.  To change 
    - * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option.
    + * this behavior, use apr_socket_timeout_set().
      *
      * It is possible for both bytes to be sent and an error to be returned.
      *
    @@ -451,7 +451,7 @@ APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf,
      * @remark
      * 
      * This functions acts like a blocking write by default.  To change 
    - * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option.
    + * this behavior, use apr_socket_timeout_set().
      * The number of bytes actually sent is stored in argument 3.
      *
      * It is possible for both bytes to be sent and an error to be returned.
    @@ -498,7 +498,7 @@ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock,
      *                       including headers, file, and trailers
      * @param flags APR flags that are mapped to OS specific flags
      * @remark This functions acts like a blocking write by default.  To change 
    - *         this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option.
    + *         this behavior, use apr_socket_timeout_set().
      *         The number of bytes actually sent is stored in argument 5.
      */
     APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file,
    @@ -516,7 +516,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file,
      * @remark
      * 
      * This functions acts like a blocking read by default.  To change 
    - * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option.
    + * this behavior, use apr_socket_timeout_set().
      * The number of bytes actually sent is stored in argument 3.
      *
      * It is possible for both bytes to be received and an APR_EOF or
    @@ -540,16 +540,22 @@ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock,
      *            APR_SO_REUSEADDR  --  The rules used in validating addresses
      *                                  supplied to bind should allow reuse
      *                                  of local addresses.
    - *            APR_SO_TIMEOUT    --  Set the timeout value in microseconds.
    - *                                  values < 0 mean wait forever.  0 means
    - *                                  don't wait at all.
      *            APR_SO_SNDBUF     --  Set the SendBufferSize
      *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
      * 
    * @param on Value for the option. */ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t on); + apr_int32_t opt, + apr_int32_t on); + +/** + * Setup socket timeout for the specified socket + * @param sock The socket to set up. + * @param t Value for the timeout. + */ +APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, + apr_interval_time_t t); /** * Query socket options for the specified socket @@ -563,9 +569,6 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, * APR_SO_REUSEADDR -- The rules used in validating addresses * supplied to bind should allow reuse * of local addresses. - * APR_SO_TIMEOUT -- Set the timeout value in microseconds. - * values < 0 mean wait forever. 0 means - * don't wait at all. * APR_SO_SNDBUF -- Set the SendBufferSize * APR_SO_RCVBUF -- Set the ReceiveBufferSize * APR_SO_DISCONNECTED -- Query the disconnected state of the socket. @@ -576,6 +579,14 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on); +/** + * Query socket timeout for the specified socket + * @param sock The socket to query + * @param t Socket timeout returned from the query. + */ +APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, + apr_interval_time_t *t); + /** * Return an apr_sockaddr_t from an apr_socket_t * @param sa The returned apr_sockaddr_t. From 5ddf44ecbeebc713403064a42dde7bf042e2a0e7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 06:10:00 +0000 Subject: [PATCH 3649/7878] Straightforward implementations of apr_socket_timeout_set/get, right from the current apr_get/setsockopt implementations for OS2/Unix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63662 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockopt.c | 16 +++++++++++++- network_io/unix/sockopt.c | 44 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 776927509eb..132e462807e 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -67,6 +67,13 @@ #include +APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) +{ + sock->timeout = on; + return APR_SUCCESS; +} + + APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { int one; @@ -112,6 +119,7 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, } } if (opt & APR_SO_TIMEOUT) { + /* XXX: To be deprecated */ sock->timeout = on; } if (opt & APR_TCP_NODELAY) { @@ -123,11 +131,18 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, } +APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t) +{ + *t = sock->timeout; + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch(opt) { case APR_SO_TIMEOUT: + /* XXX: To be deprecated */ *on = sock->timeout; break; default: @@ -137,7 +152,6 @@ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, } - APR_DECLARE(apr_status_t) apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { if (gethostname(buf, len) == -1) { diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index fe140f0c76b..3eb42134916 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -110,6 +110,40 @@ static apr_status_t sononblock(int sd) return APR_SUCCESS; } + +APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) +{ + /* If our timeout is positive or zero and our last timeout was + * negative, then we need to ensure that we are non-blocking. + * Conversely, if our timeout is negative and we had a positive + * or zero timeout, we must make sure our socket is blocking. + * We want to avoid calling fcntl more than necessary on the socket, + */ + if (on >= 0 && sock->timeout < 0){ + if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 1){ + if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS){ + return stat; + } + } + } + else if (on < 0 && sock->timeout >= 0){ + if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 0){ + if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) { + return stat; + } + } + } + /* must disable the incomplete read support if we change to a + * blocking socket. + */ + if (on == 0) { + sock->netmask &= ~APR_INCOMPLETE_READ; + } + sock->timeout = t; + apr_set_option(&sock->netmask, APR_SO_TIMEOUT, t); +} + + apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { int one; @@ -188,6 +222,7 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o #endif } if (opt & APR_SO_TIMEOUT) { + /* XXX: To be deprecated */ /* If our timeout is positive or zero and our last timeout was * negative, then we need to ensure that we are non-blocking. * Conversely, if our timeout is negative and we had a positive @@ -284,10 +319,19 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o return APR_SUCCESS; } + +APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t) +{ + *t = sock->timeout; + return APR_SUCCESS; +} + + apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch(opt) { case APR_SO_TIMEOUT: + /* XXX: To be deprecated */ *on = sock->timeout; break; default: From 611dbf5c4c933cc6758954edee2dff49e915b95d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 06:12:28 +0000 Subject: [PATCH 3650/7878] Too literal. These aught to compile now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63663 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockopt.c | 2 +- network_io/unix/sockopt.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 132e462807e..05deb9e5191 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -69,7 +69,7 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) { - sock->timeout = on; + sock->timeout = t; return APR_SUCCESS; } diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 3eb42134916..c52e383dfe3 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -113,20 +113,22 @@ static apr_status_t sononblock(int sd) APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) { + apr_status_t stat; + /* If our timeout is positive or zero and our last timeout was * negative, then we need to ensure that we are non-blocking. * Conversely, if our timeout is negative and we had a positive * or zero timeout, we must make sure our socket is blocking. * We want to avoid calling fcntl more than necessary on the socket, */ - if (on >= 0 && sock->timeout < 0){ + if (t >= 0 && sock->timeout < 0){ if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 1){ if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS){ return stat; } } } - else if (on < 0 && sock->timeout >= 0){ + else if (t < 0 && sock->timeout >= 0){ if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 0){ if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) { return stat; @@ -136,7 +138,7 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interva /* must disable the incomplete read support if we change to a * blocking socket. */ - if (on == 0) { + if (t == 0) { sock->netmask &= ~APR_INCOMPLETE_READ; } sock->timeout = t; From 901f5ce44f50026d57d3e5a7ad47ca41e47fb9fe Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 06:15:00 +0000 Subject: [PATCH 3651/7878] Win32 has several bugs ... mostly from unix accessors, when timeout is presumed to be in apr time (but we've stored ms.) Keep timeout in pure apr time for the benefit of accessors and common win32/unix code, and store a new timeout_ms field, updated whenever timeout is set to > 0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63664 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/networkio.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 18ab71f28cb..17c2cca9428 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -62,17 +62,18 @@ #define socketdes sock struct apr_socket_t { - apr_pool_t *cntxt; - SOCKET sock; - int type; /* SOCK_STREAM, SOCK_DGRAM */ - apr_sockaddr_t *local_addr; - apr_sockaddr_t *remote_addr; + apr_pool_t *cntxt; + SOCKET sock; + int type; /* SOCK_STREAM, SOCK_DGRAM */ + apr_sockaddr_t *local_addr; + apr_sockaddr_t *remote_addr; + int timeout_ms; /* MUST MATCH if timeout > 0 */ apr_interval_time_t timeout; - apr_int32_t disconnected; - int local_port_unknown; - int local_interface_unknown; - apr_int32_t netmask; - apr_int32_t inherit; + apr_int32_t disconnected; + int local_port_unknown; + int local_interface_unknown; + apr_int32_t netmask; + apr_int32_t inherit; }; #ifdef _WIN32_WCE From aff2deeea5f6495214c5464190135cc2bb308669 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 06:17:36 +0000 Subject: [PATCH 3652/7878] Implement the win32 apr_socket_timeout_set/get, and accomodate both the local timeout_ms and the common timeout field definitions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63665 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 4 +- network_io/win32/sockopt.c | 77 +++++++++++++++++++++++++++++++++----- 2 files changed, 69 insertions(+), 12 deletions(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 0487a2be17f..67d25f1fc37 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -315,8 +315,8 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) tvptr = NULL; } else { - tv.tv_sec = (long)(sock->timeout / APR_USEC_PER_SEC); - tv.tv_usec = (long)(sock->timeout % APR_USEC_PER_SEC); + tv.tv_sec = apr_time_sec_get(sock->timeout); + tv.tv_usec = apr_time_usec_get(sock->timeout); tvptr = &tv; } rc = select(FD_SETSIZE+1, NULL, &wfdset, &efdset, tvptr); diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 745d23f33ed..3b0a1de7eee 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -78,6 +78,52 @@ apr_status_t sononblock(SOCKET sd) return APR_SUCCESS; } + +APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) +{ + apr_status_t stat; + + if (t == 0) { + /* Set the socket non-blocking if it was previously blocking */ + if (sock->timeout != 0) { + if ((stat = sononblock(sock->sock)) != APR_SUCCESS) + return stat; + } + } + else if (t > 0) { + /* Set the socket to blocking if it was previously non-blocking */ + if (sock->timeout == 0) { + if ((stat = soblock(sock->sock)) != APR_SUCCESS) + return stat; + } + /* Reset socket timeouts if the new timeout differs from the old timeout */ + if (sock->timeout != t) + { + /* Win32 timeouts are in msec */ + sock->timeout_ms = apr_time_as_msec(t); + setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, + (char *) &sock->timeout_ms, + sizeof(sock->timeout_ms)); + setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, + (char *) &sock->timeout_ms, + sizeof(sock->timeout_ms)); + } + } + else if (t < 0) { + int zero = 0; + /* Set the socket to blocking with infinite timeouts */ + if ((stat = soblock(sock->sock)) != APR_SUCCESS) + return stat; + setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, + (char *) &zero, sizeof(zero)); + setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, + (char *) &zero, sizeof(zero)); + } + sock->timeout = t; + return APR_SUCCESS; +} + + APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { @@ -89,10 +135,7 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, switch (opt) { case APR_SO_TIMEOUT: { - if (on > 0) { - on = on/1000; /* Convert from APR units (uS) to windows units (mS) */ - } - + /* XXX: to be deprecated */ if (on == 0) { /* Set the socket non-blocking if it was previously blocking */ if (sock->timeout != 0) { @@ -107,9 +150,16 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, return stat; } /* Reset socket timeouts if the new timeout differs from the old timeout */ - if (sock->timeout != on) { - setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, (char *) &on, sizeof(on)); - setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, (char *) &on, sizeof(on)); + if (sock->timeout != on) + { + /* Win32 timeouts are in msec */ + sock->timeout_ms = apr_time_to_msec(on); + setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, + (char *) &sock->timeout_ms, + sizeof(sock->timeout_ms)); + setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, + (char *) &sock->timeout_ms, + sizeof(sock->timeout_ms)); } } else if (on < 0) { @@ -188,14 +238,21 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, return APR_SUCCESS; } + +APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t) +{ + *t = sock->timeout; + return APR_SUCCESS; +} + + APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch (opt) { case APR_SO_TIMEOUT: - /* Convert from milliseconds (windows units) to microseconds - * (APR units) */ - *on = (apr_int32_t)(sock->timeout * 1000); + /* XXX: to be deprecated */ + *on = sock->timeout; break; case APR_SO_DISCONNECTED: *on = sock->disconnected; From 145604e8f930cd4b3744d17f4825f1decc66a207 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 06:34:32 +0000 Subject: [PATCH 3653/7878] The last transpostion of ->timeout into apr_time fixed a bug identified by TANAKA Koichi , where we used our old ms based timeout within the timeval structure usec member. This patch fixes the only exception to needing the timeout_ms. NOTICE that we first test that *timeout* is positive, since only then will timeout_ms contain anything worth using. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63666 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 1c234ff5459..d0ecf214c46 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -356,7 +356,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, (status == APR_FROM_OS_ERROR(WSA_IO_PENDING))) { rv = WaitForSingleObject(wait_event, (DWORD)(sock->timeout >= 0 - ? sock->timeout : INFINITE)); + ? sock->timeout_ms : INFINITE)); if (rv == WAIT_OBJECT_0) { status = APR_SUCCESS; if (!disconnected) { From 5f80aeba39d33765ff31ca05552661eaf52033be Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 06:43:34 +0000 Subject: [PATCH 3654/7878] Remove the silly nsec manipulator, and add some msec manipulations that win32 (at least) requires. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63667 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/apr_time.h b/include/apr_time.h index e284399aa98..11061af830a 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -95,14 +95,19 @@ typedef apr_int32_t apr_short_interval_time_t; /** number of microseconds per second */ #define APR_USEC_PER_SEC APR_TIME_C(1000000) -#define apr_time_usec(time) ((apr_int32_t)((time) % APR_USEC_PER_SEC)) +#define apr_time_sec(time) ((time) / APR_USEC_PER_SEC) -#define apr_time_nsec(time) ((apr_int32_t)((time) % APR_USEC_PER_SEC) * (apr_int32_t)1000) +#define apr_time_usec(time) ((time) % APR_USEC_PER_SEC) + +#define apr_time_msec(time) (((time) / 1000) % 1000) + + +#define apr_time_as_msec(time) ((time) / 1000) -#define apr_time_sec(time) ((apr_int64_t)((time) / APR_USEC_PER_SEC)) #define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC) + #define apr_time_make(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC \ + (apr_time_t)(usec)) From 90a8dad79e0c8238e5ac8db5495046bf7709729c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 06:44:16 +0000 Subject: [PATCH 3655/7878] Use the correct macros git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63668 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 5 +++-- network_io/win32/sockopt.c | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 67d25f1fc37..543cafe9aa9 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -315,8 +315,9 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) tvptr = NULL; } else { - tv.tv_sec = apr_time_sec_get(sock->timeout); - tv.tv_usec = apr_time_usec_get(sock->timeout); + /* casts for winsock/timeval definition */ + tv.tv_sec = (long)apr_time_sec(sock->timeout); + tv.tv_usec = (int)apr_time_usec(sock->timeout); tvptr = &tv; } rc = select(FD_SETSIZE+1, NULL, &wfdset, &efdset, tvptr); diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 3b0a1de7eee..46503b03af3 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -99,8 +99,8 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interva /* Reset socket timeouts if the new timeout differs from the old timeout */ if (sock->timeout != t) { - /* Win32 timeouts are in msec */ - sock->timeout_ms = apr_time_as_msec(t); + /* Win32 timeouts are in msec, represented as int */ + sock->timeout_ms = (int)apr_time_as_msec(t); setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, (char *) &sock->timeout_ms, sizeof(sock->timeout_ms)); @@ -153,7 +153,7 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, if (sock->timeout != on) { /* Win32 timeouts are in msec */ - sock->timeout_ms = apr_time_to_msec(on); + sock->timeout_ms = apr_time_as_msec(on); setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, (char *) &sock->timeout_ms, sizeof(sock->timeout_ms)); From f297ff59e24961dc0438abdcf3dcba9e98866c56 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 06:50:07 +0000 Subject: [PATCH 3656/7878] Credit where credit is due git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63669 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index ffc1e36ec9c..5728867607b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix misinterpretation of timeout for select() on Win32/Netware. + Identified by [TANAKA Koichi ] + *) Re-write apr_poll() on Unix. This improves the performance by giving the user back control over the memory in the pollset. [Ryan Bloom] From 8b878495afd13a7bca976c814acb2d685ea5d8a2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 07:12:26 +0000 Subject: [PATCH 3657/7878] Thanks for the test build, sander git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63670 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index c52e383dfe3..f1028b9af94 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -143,6 +143,7 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interva } sock->timeout = t; apr_set_option(&sock->netmask, APR_SO_TIMEOUT, t); + return APR_SUCCESS; } From 58fb9ae097e2c6cce314c217327f1956088a094b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 07:24:34 +0000 Subject: [PATCH 3658/7878] Formatting [c++ comments! ick.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63671 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 76b6ba3dd75..d3e215e5495 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -117,14 +117,17 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le if (rv == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) { /* Wait for the pending i/o */ if (file->timeout > 0) { - rv = WaitForSingleObject(file->pOverlapped->hEvent, (DWORD)(file->timeout/1000)); // timeout in milliseconds... + /* timeout in milliseconds... */ + rv = WaitForSingleObject(file->pOverlapped->hEvent, + (DWORD)(file->timeout/1000)); } else if (file->timeout == -1) { rv = WaitForSingleObject(file->pOverlapped->hEvent, INFINITE); } switch (rv) { case WAIT_OBJECT_0: - GetOverlappedResult(file->filehand, file->pOverlapped, nbytes, TRUE); + GetOverlappedResult(file->filehand, file->pOverlapped, + nbytes, TRUE); rv = APR_SUCCESS; break; case WAIT_TIMEOUT: From 9f8f46b4a8725fbd13242b94010cc6f8e35478c8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 07:25:18 +0000 Subject: [PATCH 3659/7878] forewarned git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63672 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/thread_cond.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index 61f995c971c..27cdb510019 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -115,7 +115,11 @@ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, - apr_interval_time_t timeout){ + apr_interval_time_t timeout) +{ + /* Remember when implementing, timeout is usec, + * Win32 Wait functions take msec + */ return APR_ENOTIMPL; } From 40aad1460ed27f879511671d267ff18f55a96562 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 07:26:12 +0000 Subject: [PATCH 3660/7878] The right solution. Follow the herd, use socketdes as our name. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63673 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/networkio.h | 5 +--- network_io/win32/sendrecv.c | 22 +++++++-------- network_io/win32/sockaddr.c | 2 +- network_io/win32/sockets.c | 42 ++++++++++++++--------------- network_io/win32/sockopt.c | 49 +++++++++++++++++++--------------- 5 files changed, 62 insertions(+), 58 deletions(-) diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 17c2cca9428..995b61ac904 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -58,12 +58,9 @@ #include "apr_network_io.h" #include "apr_general.h" -// for apr_poll.c; -#define socketdes sock - struct apr_socket_t { apr_pool_t *cntxt; - SOCKET sock; + SOCKET socketdes; int type; /* SOCK_STREAM, SOCK_DGRAM */ apr_sockaddr_t *local_addr; apr_sockaddr_t *remote_addr; diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index d0ecf214c46..2299263483f 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -85,9 +85,9 @@ APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, wsaData.buf = (char*) buf; #ifndef _WIN32_WCE - rv = WSASend(sock->sock, &wsaData, 1, &dwBytes, 0, NULL, NULL); + rv = WSASend(sock->socketdes, &wsaData, 1, &dwBytes, 0, NULL, NULL); #else - rv = send(sock->sock, wsaData.buf, wsaData.len, 0); + rv = send(sock->socketdes, wsaData.buf, wsaData.len, 0); dwBytes = rv; #endif if (rv == SOCKET_ERROR) { @@ -114,9 +114,9 @@ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, wsaData.buf = (char*) buf; #ifndef _WIN32_WCE - rv = WSARecv(sock->sock, &wsaData, 1, &dwBytes, &flags, NULL, NULL); + rv = WSARecv(sock->socketdes, &wsaData, 1, &dwBytes, &flags, NULL, NULL); #else - rv = recv(sock->sock, wsaData.buf, wsaData.len, 0); + rv = recv(sock->socketdes, wsaData.buf, wsaData.len, 0); dwBytes = rv; #endif if (rv == SOCKET_ERROR) { @@ -151,13 +151,13 @@ APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, pWsaBuf[i].len = vec[i].iov_len; } #ifndef _WIN32_WCE - rv = WSASend(sock->sock, pWsaBuf, nvec, &dwBytes, 0, NULL, NULL); + rv = WSASend(sock->socketdes, pWsaBuf, nvec, &dwBytes, 0, NULL, NULL); if (rv == SOCKET_ERROR) { rc = apr_get_netos_error(); } #else for (i = 0; i < nvec; i++) { - rv = send(sock->sock, pWsaBuf[i].buf, pWsaBuf[i].len, 0); + rv = send(sock->socketdes, pWsaBuf[i].buf, pWsaBuf[i].len, 0); if (rv == SOCKET_ERROR) { rc = apr_get_netos_error(); break; @@ -179,7 +179,7 @@ APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, { apr_ssize_t rv; - rv = sendto(sock->sock, buf, (*len), flags, + rv = sendto(sock->socketdes, buf, (*len), flags, (const struct sockaddr*)&where->sa, where->salen); if (rv == SOCKET_ERROR) { @@ -199,7 +199,7 @@ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, { apr_ssize_t rv; - rv = recvfrom(sock->sock, buf, (*len), flags, + rv = recvfrom(sock->socketdes, buf, (*len), flags, (struct sockaddr*)&from->sa, &from->salen); if (rv == SOCKET_ERROR) { (*len) = 0; @@ -285,7 +285,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, #ifdef WAIT_FOR_EVENT wait_event = overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); #else - wait_event = (HANDLE) sock->sock; + wait_event = (HANDLE) sock->socketdes; #endif /* Use len to keep track of number of total bytes sent (including headers) */ @@ -343,7 +343,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, #if APR_HAS_LARGE_FILES overlapped.OffsetHigh = (DWORD)(curoff >> 32); #endif - rv = TransmitFile(sock->sock, /* socket */ + rv = TransmitFile(sock->socketdes, /* socket */ file->filehand, /* open file descriptor of the file to be sent */ nbytes, /* number of bytes to send. 0=send all */ 0, /* Number of bytes per send. 0=use default */ @@ -408,7 +408,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, */ if (flags & APR_SENDFILE_DISCONNECT_SOCKET) { sock->disconnected = 1; - sock->sock = INVALID_SOCKET; + sock->socketdes = INVALID_SOCKET; } } diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index 317721e77ea..8814d766a88 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -63,7 +63,7 @@ static apr_status_t get_local_addr(apr_socket_t *sock) { sock->local_addr->salen = sizeof(sock->local_addr->sa); - if (getsockname(sock->sock, (struct sockaddr *)&sock->local_addr->sa, + if (getsockname(sock->socketdes, (struct sockaddr *)&sock->local_addr->sa, &sock->local_addr->salen) < 0) { return apr_get_netos_error(); } diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 543cafe9aa9..774b0223853 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -66,11 +66,11 @@ static apr_status_t socket_cleanup(void *sock) { apr_socket_t *thesocket = sock; - if (thesocket->sock != INVALID_SOCKET) { - if (closesocket(thesocket->sock) == SOCKET_ERROR) { + if (thesocket->socketdes != INVALID_SOCKET) { + if (closesocket(thesocket->socketdes) == SOCKET_ERROR) { return apr_get_netos_error(); } - thesocket->sock = INVALID_SOCKET; + thesocket->socketdes = INVALID_SOCKET; } return APR_SUCCESS; } @@ -118,15 +118,15 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, /* For right now, we are not using socket groups. We may later. * No flags to use when creating a socket, so use 0 for that parameter as well. */ - (*new)->sock = socket(family, type, 0); + (*new)->socketdes = socket(family, type, 0); #if APR_HAVE_IPV6 - if ((*new)->sock == INVALID_SOCKET && downgrade) { + if ((*new)->socketdes == INVALID_SOCKET && downgrade) { family = AF_INET; - (*new)->sock = socket(family, type, 0); + (*new)->socketdes = socket(family, type, 0); } #endif - if ((*new)->sock == INVALID_SOCKET) { + if ((*new)->socketdes == INVALID_SOCKET) { return apr_get_netos_error(); } set_socket_vars(*new, family, type); @@ -163,7 +163,7 @@ APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, return APR_BADARG; } #endif - if (shutdown(thesocket->sock, winhow) == 0) { + if (shutdown(thesocket->socketdes, winhow) == 0) { return APR_SUCCESS; } else { @@ -179,7 +179,7 @@ APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket) APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) { - if (bind(sock->sock, + if (bind(sock->socketdes, (struct sockaddr *)&sa->sa, sa->salen) == -1) { return apr_get_netos_error(); @@ -195,7 +195,7 @@ APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) { - if (listen(sock->sock, backlog) == SOCKET_ERROR) + if (listen(sock->socketdes, backlog) == SOCKET_ERROR) return apr_get_netos_error(); else return APR_SUCCESS; @@ -210,7 +210,7 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, /* Don't allocate the memory until after we call accept. This allows us to work with nonblocking sockets. */ - s = accept(sock->sock, (struct sockaddr *)&sa, &salen); + s = accept(sock->socketdes, (struct sockaddr *)&sa, &salen); if (s == INVALID_SOCKET) { return apr_get_netos_error(); } @@ -221,7 +221,7 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, (*new)->timeout = -1; (*new)->disconnected = 0; - (*new)->sock = s; + (*new)->socketdes = s; /* XXX next line looks bogus w.r.t. AF_INET6 support */ (*new)->remote_addr->salen = sizeof((*new)->remote_addr->sa); memcpy (&(*new)->remote_addr->sa, &sa, salen); @@ -281,11 +281,11 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { apr_status_t rv; - if ((sock->sock == INVALID_SOCKET) || (!sock->local_addr)) { + if ((sock->socketdes == INVALID_SOCKET) || (!sock->local_addr)) { return APR_ENOTSOCK; } - if (connect(sock->sock, (const struct sockaddr *)&sa->sa.sin, + if (connect(sock->socketdes, (const struct sockaddr *)&sa->sa.sin, sa->salen) == SOCKET_ERROR) { int rc; struct timeval tv, *tvptr; @@ -307,9 +307,9 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) /* wait for the connect to complete or timeout */ FD_ZERO(&wfdset); - FD_SET(sock->sock, &wfdset); + FD_SET(sock->socketdes, &wfdset); FD_ZERO(&efdset); - FD_SET(sock->sock, &efdset); + FD_SET(sock->socketdes, &efdset); if (sock->timeout < 0) { tvptr = NULL; @@ -328,10 +328,10 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) return APR_FROM_OS_ERROR(WSAETIMEDOUT); } /* Evaluate the efdset */ - if (FD_ISSET(sock->sock, &efdset)) { + if (FD_ISSET(sock->socketdes, &efdset)) { /* The connect failed. */ int rclen = sizeof(rc); - if (getsockopt(sock->sock, SOL_SOCKET, SO_ERROR, (char*) &rc, &rclen)) { + if (getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR, (char*) &rc, &rclen)) { return apr_get_netos_error(); } return APR_FROM_OS_ERROR(rc); @@ -369,7 +369,7 @@ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *socket, void *data, APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) { - *thesock = sock->sock; + *thesock = sock->socketdes; return APR_SUCCESS; } @@ -381,7 +381,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type); (*apr_sock)->timeout = -1; (*apr_sock)->disconnected = 0; - (*apr_sock)->sock = *os_sock_info->os_sock; + (*apr_sock)->socketdes = *os_sock_info->os_sock; if (os_sock_info->local) { memcpy(&(*apr_sock)->local_addr->sa.sin, os_sock_info->local, @@ -421,7 +421,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, (*sock)->disconnected = 0; } (*sock)->local_port_unknown = (*sock)->local_interface_unknown = 1; - (*sock)->sock = *thesock; + (*sock)->socketdes = *thesock; return APR_SUCCESS; } diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 46503b03af3..3095e747fd1 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -86,14 +86,14 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interva if (t == 0) { /* Set the socket non-blocking if it was previously blocking */ if (sock->timeout != 0) { - if ((stat = sononblock(sock->sock)) != APR_SUCCESS) + if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) return stat; } } else if (t > 0) { /* Set the socket to blocking if it was previously non-blocking */ if (sock->timeout == 0) { - if ((stat = soblock(sock->sock)) != APR_SUCCESS) + if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) return stat; } /* Reset socket timeouts if the new timeout differs from the old timeout */ @@ -101,10 +101,10 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interva { /* Win32 timeouts are in msec, represented as int */ sock->timeout_ms = (int)apr_time_as_msec(t); - setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, + setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVTIMEO, (char *) &sock->timeout_ms, sizeof(sock->timeout_ms)); - setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, + setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDTIMEO, (char *) &sock->timeout_ms, sizeof(sock->timeout_ms)); } @@ -112,11 +112,11 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interva else if (t < 0) { int zero = 0; /* Set the socket to blocking with infinite timeouts */ - if ((stat = soblock(sock->sock)) != APR_SUCCESS) + if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) return stat; - setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, + setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVTIMEO, (char *) &zero, sizeof(zero)); - setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, + setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDTIMEO, (char *) &zero, sizeof(zero)); } sock->timeout = t; @@ -139,14 +139,14 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, if (on == 0) { /* Set the socket non-blocking if it was previously blocking */ if (sock->timeout != 0) { - if ((stat = sononblock(sock->sock)) != APR_SUCCESS) + if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) return stat; } } else if (on > 0) { /* Set the socket to blocking if it was previously non-blocking */ if (sock->timeout == 0) { - if ((stat = soblock(sock->sock)) != APR_SUCCESS) + if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) return stat; } /* Reset socket timeouts if the new timeout differs from the old timeout */ @@ -154,10 +154,10 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, { /* Win32 timeouts are in msec */ sock->timeout_ms = apr_time_as_msec(on); - setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, + setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVTIMEO, (char *) &sock->timeout_ms, sizeof(sock->timeout_ms)); - setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, + setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDTIMEO, (char *) &sock->timeout_ms, sizeof(sock->timeout_ms)); } @@ -165,17 +165,20 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, else if (on < 0) { int zero = 0; /* Set the socket to blocking with infinite timeouts */ - if ((stat = soblock(sock->sock)) != APR_SUCCESS) + if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) return stat; - setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, (char *) &zero, sizeof(zero)); - setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO, (char *) &zero, sizeof(zero)); + setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVTIMEO, + (char *) &zero, sizeof(zero)); + setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDTIMEO, + (char *) &zero, sizeof(zero)); } sock->timeout = on; break; } case APR_SO_KEEPALIVE: if (on != apr_is_option_set(sock->netmask, APR_SO_KEEPALIVE)) { - if (setsockopt(sock->sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, + (void *)&one, sizeof(int)) == -1) { return apr_get_netos_error(); } apr_set_option(&sock->netmask,APR_SO_KEEPALIVE, on); @@ -183,7 +186,8 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, break; case APR_SO_DEBUG: if (on != apr_is_option_set(sock->netmask, APR_SO_DEBUG)) { - if (setsockopt(sock->sock, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, + (void *)&one, sizeof(int)) == -1) { return apr_get_netos_error(); } apr_set_option(&sock->netmask, APR_SO_DEBUG, on); @@ -191,7 +195,8 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, break; case APR_SO_REUSEADDR: if (on != apr_is_option_set(sock->netmask, APR_SO_REUSEADDR)){ - if (setsockopt(sock->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, + (void *)&one, sizeof(int)) == -1) { return apr_get_netos_error(); } apr_set_option(&sock->netmask, APR_SO_REUSEADDR, on); @@ -200,11 +205,11 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, case APR_SO_NONBLOCK: if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != on){ if (on) { - if ((stat = sononblock(sock->sock)) != APR_SUCCESS) + if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) return stat; } else { - if ((stat = soblock(sock->sock)) != APR_SUCCESS) + if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) return stat; } apr_set_option(&sock->netmask, APR_SO_NONBLOCK, on); @@ -216,7 +221,8 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, struct linger li; li.l_onoff = on; li.l_linger = MAX_SECS_TO_LINGER; - if (setsockopt(sock->sock, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, + (char *) &li, sizeof(struct linger)) == -1) { return apr_get_netos_error(); } apr_set_option(&sock->netmask, APR_SO_LINGER, on); @@ -225,7 +231,8 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, } case APR_TCP_NODELAY: if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) != on){ - if (setsockopt(sock->sock, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { + if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, + (void *)&on, sizeof(int)) == -1) { return apr_get_netos_error(); } apr_set_option(&sock->netmask, APR_TCP_NODELAY, on); From 89e9ae53d8f3e587d4df34337c4b59d3d616463d Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Mon, 15 Jul 2002 07:29:28 +0000 Subject: [PATCH 3661/7878] Symbol rename ("stat") so we don't shadow a libc symbol of the same name. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63674 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index f1028b9af94..b8a6e3626af 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -150,7 +150,7 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interva apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { int one; - apr_status_t stat; + apr_status_t rv; if (on) one = 1; @@ -199,12 +199,12 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o if (opt & APR_SO_NONBLOCK) { if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != on){ if (on) { - if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) - return stat; + if ((rv = sononblock(sock->socketdes)) != APR_SUCCESS) + return rv; } else { - if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) - return stat; + if ((rv = soblock(sock->socketdes)) != APR_SUCCESS) + return rv; } apr_set_option(&sock->netmask, APR_SO_NONBLOCK, on); } @@ -234,15 +234,15 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o */ if (on >= 0 && sock->timeout < 0){ if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 1){ - if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS){ - return stat; + if ((rv = sononblock(sock->socketdes)) != APR_SUCCESS){ + return rv; } } } else if (on < 0 && sock->timeout >= 0){ if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 0){ - if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) { - return stat; + if ((rv = soblock(sock->socketdes)) != APR_SUCCESS) { + return rv; } } } From d56a51337fec2f3dc8aa8bcba55ab7ea9646642f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 07:38:35 +0000 Subject: [PATCH 3662/7878] Deprecate apr_get/setsockopt for apr_socket_opt_get/set git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63675 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 35 ++++++++++++++++++++++------------- network_io/os2/sockopt.c | 26 ++++++++++++++++++++++---- network_io/unix/sockopt.c | 25 +++++++++++++++++++++---- network_io/win32/sockopt.c | 22 ++++++++++++++++++---- 4 files changed, 83 insertions(+), 25 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index fb88da2b76d..9da7f662bf3 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -410,7 +410,7 @@ APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont); * @param sock The currently open socket. */ APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, - apr_socket_t *sock); + apr_socket_t *sock); /** * Set the data associated with the current socket. @@ -420,8 +420,8 @@ APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, * @param cleanup The cleanup to call when the socket is destroyed. */ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, - const char *key, - apr_status_t (*cleanup)(void*)); + const char *key, + apr_status_t (*cleanup)(void*)); /** * Send data over a network. @@ -545,9 +545,12 @@ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, *
    * @param on Value for the option. */ +APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t on); + +/** @deprecated @see apr_socket_opt_set */ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, - apr_int32_t opt, - apr_int32_t on); + apr_int32_t opt, apr_int32_t on); /** * Setup socket timeout for the specified socket @@ -576,6 +579,10 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, *
    * @param on Socket option returned on the call. */ +APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t *on); + +/** @deprecated @see apr_socket_opt_set */ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on); @@ -594,8 +601,8 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, * @param sock The socket to use */ APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, - apr_interface_e which, - apr_socket_t *sock); + apr_interface_e which, + apr_socket_t *sock); /** * Set the port in an APR socket address. @@ -603,7 +610,7 @@ APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, * @param port The port to be stored in the socket address. */ APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, - apr_port_t port); + apr_port_t port); /** * Return the port in an APR socket address. @@ -611,7 +618,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, * @param sockaddr The socket address to reference. */ APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, - apr_sockaddr_t *sockaddr); + apr_sockaddr_t *sockaddr); /** * Set the IP address in an APR socket address. @@ -620,7 +627,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, * Use APR_ANYADDR to use any IP addr on the machine. */ APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, - const char *addr); + const char *addr); /** * Return the IP address (in numeric address string format) in @@ -629,7 +636,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, * @param sockaddr The socket address to reference. */ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, - apr_sockaddr_t *sockaddr); + apr_sockaddr_t *sockaddr); /** * See if the IP addresses in two APR socket addresses are @@ -678,8 +685,10 @@ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, * @param mask_or_numbits The input netmask or number-of-bits string, or NULL * @param p The pool to allocate from */ -APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char *ipstr, - const char *mask_or_numbits, apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, + const char *ipstr, + const char *mask_or_numbits, + apr_pool_t *p); /** * Test the IP address in an apr_sockaddr_t against a pre-built ip-subnet diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 05deb9e5191..b2e1567641e 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -67,14 +67,16 @@ #include -APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) +APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, + apr_interval_time_t t) { sock->timeout = t; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) +APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t on) { int one; struct linger li; @@ -131,14 +133,16 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, } -APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t) +APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, + apr_interval_time_t *t) { *t = sock->timeout; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) +APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t *on) { switch(opt) { case APR_SO_TIMEOUT: @@ -152,6 +156,20 @@ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, } +/* deprecated */ +APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t on) +{ + return apr_socket_opt_set(sock, opt, on); +} + +APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t *on) +{ + return apr_socket_opt_get(sock, opt, on) +} + + APR_DECLARE(apr_status_t) apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { if (gethostname(buf, len) == -1) { diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index b8a6e3626af..04f03c65707 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -111,7 +111,7 @@ static apr_status_t sononblock(int sd) } -APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) +apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) { apr_status_t stat; @@ -147,7 +147,8 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interva } -apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) +apr_status_t apr_socket_opt_set(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t on) { int one; apr_status_t rv; @@ -323,14 +324,15 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o } -APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t) +apr_status_t apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t) { *t = sock->timeout; return APR_SUCCESS; } -apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) +apr_status_t apr_socket_opt_get(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t *on) { switch(opt) { case APR_SO_TIMEOUT: @@ -343,6 +345,21 @@ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t * return APR_SUCCESS; } + +/* deprecated */ +apr_status_t apr_setsocketopt(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t on) +{ + return apr_socket_opt_set(sock, opt, on); +} + +apr_status_t apr_getsocketopt(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t *on) +{ + return apr_socket_opt_get(sock, opt, on) +} + + apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { if (gethostname(buf, len) == -1) { diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 3095e747fd1..0206b2b05f4 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -124,8 +124,8 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interva } -APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t on) +APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t on) { int one; apr_status_t stat; @@ -253,8 +253,8 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, apr_interva } -APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t *on) +APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t *on) { switch (opt) { case APR_SO_TIMEOUT: @@ -276,6 +276,20 @@ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, } +/* deprecated */ +APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t on) +{ + return apr_socket_opt_set(sock, opt, on); +} + +APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, + apr_int32_t opt, apr_int32_t *on) +{ + return apr_socket_opt_get(sock, opt, on) +} + + APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont) { From 7f4118f5a1f218f2f3820fe66f873dd684889f97 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 07:39:32 +0000 Subject: [PATCH 3663/7878] Missed a semicol git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63676 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockopt.c | 2 +- network_io/unix/sockopt.c | 2 +- network_io/win32/sockopt.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index b2e1567641e..779e9cbd84d 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -166,7 +166,7 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { - return apr_socket_opt_get(sock, opt, on) + return apr_socket_opt_get(sock, opt, on); } diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 04f03c65707..01523d9e3ec 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -356,7 +356,7 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { - return apr_socket_opt_get(sock, opt, on) + return apr_socket_opt_get(sock, opt, on); } diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 0206b2b05f4..ea88d666ef9 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -286,7 +286,7 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { - return apr_socket_opt_get(sock, opt, on) + return apr_socket_opt_get(sock, opt, on); } From 1c9828e236da19ef51c763543916d9fe209842c9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 07:42:35 +0000 Subject: [PATCH 3664/7878] Two down. Don't know if I agree with the entire host of these becoming apr_socket_ foo, but, well... I won't argue. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63677 13f79535-47bb-0310-9956-ffa450edef68 --- renames_pending | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/renames_pending b/renames_pending index ee58a9cde0e..9ea319f32e2 100644 --- a/renames_pending +++ b/renames_pending @@ -27,21 +27,21 @@ apr_socket_bind from apr_bind apr_socket_listen from apr_listen apr_socket_accept from apr_accept apr_socket_connect from apr_connect -apr_sockaddr_name_info_get from apr_getnameinfo apr_socket_send from apr_send apr_socket_sendv from apr_sendv apr_socket_sendto from apr_sendto apr_socket_recv_from from apr_recvfrom apr_socket_file_send from apr_sendfile apr_socket_recv from apr_recv -apr_socket_opt_set from apr_setsocketopt -apr_socket_opt_get from apr_getsocketopt apr_socket_file_create from apr_socket_from_file -apr_service_byname_get from apr_getservbyname apr_socket_filter_accept from apr_socket_accept_filter apr_socket_inherit_set from apr_socket_set_inherit apr_socket_inherit_unset from apr_socket_unset_inherit +apr_service_byname_get from apr_getservbyname + +apr_sockaddr_name_info_get from apr_getnameinfo + apr_time_exp_gmt_get from apr_implode_gmt apr_time_interval_t from apr_interval_time_t apr_time_interval_short_t from apr_short_interval_time_t From 63185fb57dacf3d397f796da9ccabe86f2eb0f5c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 07:56:13 +0000 Subject: [PATCH 3665/7878] APR occurances to update for socket_opt_get/set and socket_timeout_get/set git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63678 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 12 ++++++------ test/client.c | 2 +- test/sendfile.c | 13 ++++++------- test/server.c | 4 ++-- test/testsockopt.c | 22 +++++++++++----------- 5 files changed, 26 insertions(+), 27 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 0d4ac9e9745..41bfd6dd50b 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -293,7 +293,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_size_t hdrbytes; /* cork before writing headers */ - rv = apr_setsocketopt(sock, APR_TCP_NOPUSH, 1); + rv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 1); if (rv != APR_SUCCESS) { return rv; } @@ -316,7 +316,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, } if (hdrbytes < total_hdrbytes) { *len = hdrbytes; - return apr_setsocketopt(sock, APR_TCP_NOPUSH, 0); + return apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); } } @@ -355,7 +355,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (rv == -1) { *len = nbytes; rv = errno; - apr_setsocketopt(sock, APR_TCP_NOPUSH, 0); + apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); return rv; } @@ -363,7 +363,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (rv < *len) { *len = nbytes; - arv = apr_setsocketopt(sock, APR_TCP_NOPUSH, 0); + arv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); if (rv > 0) { /* If this was a partial write, return now with the @@ -393,12 +393,12 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (arv != APR_SUCCESS) { *len = nbytes; rv = errno; - apr_setsocketopt(sock, APR_TCP_NOPUSH, 0); + apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); return rv; } } - apr_setsocketopt(sock, APR_TCP_NOPUSH, 0); + apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); (*len) = nbytes; return rv < 0 ? errno : APR_SUCCESS; diff --git a/test/client.c b/test/client.c index 98d50260618..d20e7387d21 100644 --- a/test/client.c +++ b/test/client.c @@ -118,7 +118,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Setting socket timeout......."); - stat = apr_setsocketopt(sock, APR_SO_TIMEOUT, timeout); + stat = apr_socket_timeout_set(sock, timeout); if (stat) { fprintf(stderr, "Problem setting timeout: %d\n", stat); exit(-1); diff --git a/test/sendfile.c b/test/sendfile.c index 1ee95ec9d04..09792f03f25 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -259,9 +259,9 @@ static int client(client_socket_mode_t socket_mode, char *host) break; case NONBLK: /* set it non-blocking */ - rv = apr_setsocketopt(sock, APR_SO_NONBLOCK, 1); + rv = apr_socket_opt_set(sock, APR_SO_NONBLOCK, 1); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_setsocketopt(APR_SO_NONBLOCK)->%d/%s\n", + fprintf(stderr, "apr_socket_opt_set(APR_SO_NONBLOCK)->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -269,10 +269,9 @@ static int client(client_socket_mode_t socket_mode, char *host) break; case TIMEOUT: /* set a timeout */ - rv = apr_setsocketopt(sock, APR_SO_TIMEOUT, - 100 * APR_USEC_PER_SEC); + rv = apr_socket_timeout_set(sock, 100 * APR_USEC_PER_SEC); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_setsocketopt(APR_SO_NONBLOCK)->%d/%s\n", + fprintf(stderr, "apr_socket_opt_set(APR_SO_NONBLOCK)->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -519,9 +518,9 @@ static int server(void) family = APR_UNSPEC; apr_setup(&p, &sock, &family); - rv = apr_setsocketopt(sock, APR_SO_REUSEADDR, 1); + rv = apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_setsocketopt()->%d/%s\n", + fprintf(stderr, "apr_socket_opt_set()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); diff --git a/test/server.c b/test/server.c index 1ff377b5c73..7c45a00e0c2 100644 --- a/test/server.c +++ b/test/server.c @@ -116,10 +116,10 @@ int main(int argc, const char * const argv[]) apr_socket_create(&sock, family, SOCK_STREAM, context)) APR_TEST_SUCCESS(rv, "Setting option APR_SO_NONBLOCK", - apr_setsocketopt(sock, APR_SO_NONBLOCK, 1)) + apr_socket_opt_set(sock, APR_SO_NONBLOCK, 1)) APR_TEST_SUCCESS(rv, "Setting option APR_SO_REUSEADDR", - apr_setsocketopt(sock, APR_SO_REUSEADDR, 1)) + apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1)) if (!localsa) { apr_socket_addr_get(&localsa, APR_LOCAL, sock); diff --git a/test/testsockopt.c b/test/testsockopt.c index 81836e85fb7..a99c90d2ba0 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -111,7 +111,7 @@ int main(void) printf("OK\n"); printf ("\tTrying to set APR_SO_KEEPALIVE..........."); - if (apr_setsocketopt(sock, APR_SO_KEEPALIVE, 1) != APR_SUCCESS){ + if (apr_socket_opt_set(sock, APR_SO_KEEPALIVE, 1) != APR_SUCCESS){ apr_socket_close(sock); printf("Failed!\n"); exit (-1); @@ -119,7 +119,7 @@ int main(void) printf ("OK\n"); printf("\tChecking if we recorded it..............."); - if (apr_getsocketopt(sock, APR_SO_KEEPALIVE, &ck) != APR_SUCCESS){ + if (apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck) != APR_SUCCESS){ apr_socket_close(sock); fprintf(stderr,"Failed\n"); exit(-1); @@ -132,14 +132,14 @@ int main(void) printf("Yes\n"); printf("\tTrying to set APR_SO_DEBUG..............."); - if (apr_setsocketopt(sock, APR_SO_DEBUG, 1) != APR_SUCCESS){ + if (apr_socket_opt_set(sock, APR_SO_DEBUG, 1) != APR_SUCCESS){ printf("Failed (ignored)\n"); } else { printf ("OK\n"); printf("\tChecking if we recorded it..............."); - if (apr_getsocketopt(sock, APR_SO_DEBUG, &ck) != APR_SUCCESS){ + if (apr_socket_opt_get(sock, APR_SO_DEBUG, &ck) != APR_SUCCESS){ apr_socket_close(sock); printf("Failed!\n"); exit (-1); @@ -153,7 +153,7 @@ int main(void) } printf ("\tTrying to remove APR_SO_KEEPALIVE........"); - if (apr_setsocketopt(sock, APR_SO_KEEPALIVE, 0) != APR_SUCCESS){ + if (apr_socket_opt_set(sock, APR_SO_KEEPALIVE, 0) != APR_SUCCESS){ apr_socket_close(sock); printf("Failed!\n"); exit (-1); @@ -161,7 +161,7 @@ int main(void) printf ("OK\n"); printf ("\tDid we record the removal................"); - if (apr_getsocketopt(sock, APR_SO_KEEPALIVE, &ck) != APR_SUCCESS){ + if (apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck) != APR_SUCCESS){ apr_socket_close(sock); printf("Didn't get value!\n"); exit(-1); @@ -174,17 +174,17 @@ int main(void) #if APR_HAVE_CORKABLE_TCP printf ("\tTesting APR_TCP_NOPUSH!\n"); printf("\t\tSetting APR_TCP_NODELAY.........."); - if (apr_setsocketopt(sock, APR_TCP_NODELAY, 1) != APR_SUCCESS){ + if (apr_socket_opt_set(sock, APR_TCP_NODELAY, 1) != APR_SUCCESS){ failure(sock); } printf("OK\n"); printf("\t\tSetting APR_TCP_NOPUSH..........."); - if (apr_setsocketopt(sock, APR_TCP_NOPUSH, 1) != APR_SUCCESS){ + if (apr_socket_opt_set(sock, APR_TCP_NOPUSH, 1) != APR_SUCCESS){ failure(sock); } printf("OK\n"); printf("\t\tChecking on APR_TCP_NODELAY......"); - if (apr_getsocketopt(sock, APR_TCP_NODELAY, &ck) != APR_SUCCESS){ + if (apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck) != APR_SUCCESS){ failure(sock); } if (ck != 0){ @@ -192,13 +192,13 @@ int main(void) } printf("Yes (not set)\n"); printf("\t\tUnsetting APR_TCP_NOPUSH........."); - if (apr_setsocketopt(sock, APR_TCP_NOPUSH, 0) != APR_SUCCESS){ + if (apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0) != APR_SUCCESS){ failure(sock); } printf("OK\n"); printf("\t\tChecking on APR_TCP_NODELAY......"); - if (apr_getsocketopt(sock, APR_TCP_NODELAY, &ck) != APR_SUCCESS){ + if (apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck) != APR_SUCCESS){ failure(sock); } if (ck != 1){ From 30bb6df51917972bfd3d18a05c16d9f45528e09b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 08:22:35 +0000 Subject: [PATCH 3666/7878] This emit will bug me for a year. Quell it, it's deprecated later anyways. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63679 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockopt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index ea88d666ef9..7672ae3165c 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -259,7 +259,7 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, switch (opt) { case APR_SO_TIMEOUT: /* XXX: to be deprecated */ - *on = sock->timeout; + *on = (apr_int32_t)sock->timeout; break; case APR_SO_DISCONNECTED: *on = sock->disconnected; From e8a932a50a9d77e8cee0ac79a96ed6fa4e659fe9 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 15 Jul 2002 17:30:58 +0000 Subject: [PATCH 3667/7878] poll.c is not longer used or needed. Removing from the network_io directory. The current version is in poll/unix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63680 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/poll.c | 268 ---------------------------------------- 1 file changed, 268 deletions(-) delete mode 100644 network_io/win32/poll.c diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c deleted file mode 100644 index d9c8cd1d2e4..00000000000 --- a/network_io/win32/poll.c +++ /dev/null @@ -1,268 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "networkio.h" -#include "apr_network_io.h" -#include "apr_general.h" -#include "apr_lib.h" -#if APR_HAVE_ERRNO_H -#include -#endif -#if APR_HAVE_TIME_H -#include -#endif - -APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, - apr_pool_t *cont) -{ - (*new) = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t) * num); - if ((*new) == NULL) { - return APR_ENOMEM; - } - (*new)->cntxt = cont; - (*new)->read = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->exception = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - FD_ZERO((*new)->read); - (*new)->numread = 0; - FD_ZERO((*new)->write); - (*new)->numwrite = 0; - FD_ZERO((*new)->exception); - (*new)->numexcept = 0; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, - apr_socket_t *sock, - apr_int16_t event) -{ - if (event & APR_POLLIN) { - FD_SET(sock->sock, aprset->read); - aprset->numread++; - } - if (event & APR_POLLPRI) { - FD_SET(sock->sock, aprset->read); - aprset->numexcept++; - } - if (event & APR_POLLOUT) { - FD_SET(sock->sock, aprset->write); - aprset->numwrite++; - } - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, - apr_interval_time_t timeout) -{ - int rv; - struct timeval tv, *tvptr; - fd_set *newread = NULL; - fd_set *newwrite = NULL; - fd_set *newexcept = NULL; - - if (aprset->numread != 0) { - newread = aprset->read; - } - if (aprset->numwrite != 0) { - newwrite = aprset->write; - } - if (aprset->numexcept != 0) { - newexcept = aprset->exception; - } - - if (newread == NULL && newwrite == NULL && newexcept == NULL) { -#ifdef NETWARE - delay((DWORD)(timeout / 1000)); /* convert microseconds into milliseconds */ -#else - Sleep((DWORD)(timeout / 1000)); /* convert microseconds into milliseconds */ -#endif - return APR_TIMEUP; /* TODO - get everybody in synch with Win32 apr_status_t */ - } - else { - if (timeout < 0) { - tvptr = NULL; - } - else { - tv.tv_sec = (long)apr_time_sec(timeout); - tv.tv_usec = (long)apr_time_usec(timeout); - tvptr = &tv; - } - rv = select(500, /* ignored on Windows */ - newread, newwrite, newexcept, tvptr); - } - - (*nsds) = rv; - if ((*nsds) < 0) { - return apr_get_netos_error(); - } - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, - apr_socket_t *sock, - apr_pollfd_t *aprset) -{ - apr_int16_t revents = 0; - WSABUF data; - char buf[256]; - DWORD dummy; - DWORD flags = MSG_PEEK; - - /* We just want to PEEK at the data, so I am setting up a dummy WSABUF - * variable here. - */ - data.len = sizeof(buf); - data.buf = buf; - - if (FD_ISSET(sock->sock, aprset->read)) { - revents |= APR_POLLIN; -#ifdef _WIN32_WCE - if (recv(sock->sock, data.buf, data.len, 0) == SOCKET_ERROR) -#else - if (WSARecv(sock->sock, &data, 1, &dummy, &flags, NULL, - NULL) == SOCKET_ERROR) -#endif - { - /* This is only legit since we don't return the error */ - dummy = WSAGetLastError(); - switch (dummy) { - case WSAECONNRESET: - case WSAECONNABORTED: - case WSAESHUTDOWN: - case WSAENETRESET: { - revents ^= APR_POLLIN; - revents |= APR_POLLHUP; - break; - } - case WSAENOTSOCK: { - revents ^= APR_POLLIN; - revents |= APR_POLLNVAL; - } - default: { - revents ^= APR_POLLIN; - revents |= APR_POLLERR; - } - } - } - } - if (FD_ISSET(sock->sock, aprset->write)) { - revents |= APR_POLLOUT; - } - /* I am assuming that the except is for out of band data, not a failed - * connection on a non-blocking socket. Might be a bad assumption, but - * it works for now. rbb. - */ - if (FD_ISSET(sock->sock, aprset->exception)) { - revents |= APR_POLLPRI; - } - - (*event) = revents; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_data_get(apr_pollfd_t *pollfd, - const char *key, void *data) -{ - return apr_pool_userdata_get(data, key, pollfd->cntxt); -} - -APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data, - const char *key, - apr_status_t (*cleanup)(void *)) -{ - return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt); -} - -APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, - apr_socket_t *sock, - apr_int16_t events) -{ - if (events & APR_POLLIN) { - FD_CLR(sock->sock, aprset->read); - aprset->numread--; - } - if (events & APR_POLLPRI) { - FD_CLR(sock->sock, aprset->exception); - aprset->numexcept--; - } - if (events & APR_POLLOUT) { - FD_CLR(sock->sock, aprset->write); - aprset->numwrite--; - } - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, - apr_socket_t *sock) -{ - return apr_poll_socket_mask(aprset, sock, ~0); -} - -APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, - apr_int16_t events) -{ - if (events & APR_POLLIN) { - FD_ZERO(aprset->read); - aprset->numread = 0; - } - if (events & APR_POLLPRI) { - FD_ZERO(aprset->read); - aprset->numexcept = 0; - } - if (events & APR_POLLOUT) { - FD_ZERO(aprset->write); - aprset->numwrite = 0; - } - return APR_SUCCESS; -} From 4c07a785bfd33c8ad6fef11fb79a989e1fcc0628 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 18:27:39 +0000 Subject: [PATCH 3668/7878] Eliminate the one Unix emit, and one of three Win32 emits. The other two Win32 emits, setting the des from filedes/socketdes [HANDLE -> int] shouldn't be cast around, and we will likely move this code from poll/unix anyways. The other emit, FD_SET errors, are gone in the latest win32 clib implementations, and again, our own win32 platform code will evaporate those problems. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63681 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 672946c8ff7..8188f2313b8 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -162,8 +162,8 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n tvptr = NULL; } else { - tv.tv_sec = apr_time_sec(timeout); - tv.tv_usec = apr_time_usec(timeout); + tv.tv_sec = (long)apr_time_sec(timeout); + tv.tv_usec = (long)apr_time_usec(timeout); tvptr = &tv; } From 89e82c12e21a26d029553318f432270d9628c665 Mon Sep 17 00:00:00 2001 From: Karl Fogel Date: Mon, 15 Jul 2002 19:21:01 +0000 Subject: [PATCH 3669/7878] (make_identity_table): New function to create a sbcs_table that performs unity conversion. See apr_xlate_open. (apr_xlate_open): When topage and frompage are the same, make_identity_table is used to create a shortcut instead of calling iconv_open. The reason being that iconv_open can fail in this case. Submitted by: Marcus Comstedt Reviewed by: Karl Fogel git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63682 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/xlate.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 06644cb296f..8c6aa98f245 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -219,6 +219,14 @@ static void check_sbcs(apr_xlate_t *convset) } #endif /* HAVE_ICONV */ +static void make_identity_table(apr_xlate_t *convset) +{ + int i; + convset->sbcs_table = apr_palloc(convset->pool, 256); + for (i = 0; i < 256; i++) + convset->sbcs_table[i] = i; +} + apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, const char *frompage, apr_pool_t *pool) { @@ -251,6 +259,12 @@ apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, set found to non-zero if found in the cache #endif + if ((! found) && (strcmp(topage, frompage) == 0)) { + /* to and from are the same */ + found = 1; + make_identity_table(new); + } + #ifdef HAVE_ICONV if (!found) { new->ich = iconv_open(topage, frompage); @@ -259,7 +273,8 @@ apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, } found = 1; check_sbcs(new); - } + } else + new->ich = (iconv_t)-1; #endif /* HAVE_ICONV */ if (found) { From e82d1e4be549ce037d69e431593932be85e083ec Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 15 Jul 2002 20:16:17 +0000 Subject: [PATCH 3670/7878] Define _getch() and use the same getpass() implementation as Win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63683 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_private.h | 1 + passwd/apr_getpass.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 29d396178b9..778ab539309 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -149,6 +149,7 @@ typedef void (Sigfunc)(int); #define strcasecmp(s1, s2) stricmp(s1, s2) #define Sleep(t) delay(t) #define lstat(a,b) stat(a,b) +#define _getch() getcharacter() #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index cf84b7f1d78..a9fbcf233ee 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -104,9 +104,9 @@ #ifndef HAVE_GETPASS -/* MPE, Win32 and BeOS all lack a native getpass() */ +/* MPE, Win32, NetWare and BeOS all lack a native getpass() */ -#if !defined(HAVE_TERMIOS_H) && !defined(WIN32) +#if !defined(HAVE_TERMIOS_H) && !defined(WIN32) && !defined(NETWARE) /* * MPE lacks getpass() and a way to suppress stdin echo. So for now, just * issue the prompt and read the results with echo. (Ugh). From 8b5b392a9f378d3eafd283cc06b72d915cfcd4df Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 15 Jul 2002 20:29:38 +0000 Subject: [PATCH 3671/7878] As rbb pointed out, two constructors are prone to bugs. Remap our old apr_socket_opt_set(SO_TIMEOUT) flavor to invoke apr_socket_timeout_set() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63684 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockopt.c | 4 ++-- network_io/unix/sockopt.c | 31 ++-------------------------- network_io/win32/sockopt.c | 41 ++------------------------------------ 3 files changed, 6 insertions(+), 70 deletions(-) diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 779e9cbd84d..3ecc1aa02e8 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -122,7 +122,7 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, } if (opt & APR_SO_TIMEOUT) { /* XXX: To be deprecated */ - sock->timeout = on; + return apr_socket_timeout_set(sock, on); } if (opt & APR_TCP_NODELAY) { if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { @@ -147,7 +147,7 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, switch(opt) { case APR_SO_TIMEOUT: /* XXX: To be deprecated */ - *on = sock->timeout; + *on = (apr_int32_t)sock->timeout; break; default: return APR_EINVAL; diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 01523d9e3ec..36630db155c 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -227,34 +227,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, } if (opt & APR_SO_TIMEOUT) { /* XXX: To be deprecated */ - /* If our timeout is positive or zero and our last timeout was - * negative, then we need to ensure that we are non-blocking. - * Conversely, if our timeout is negative and we had a positive - * or zero timeout, we must make sure our socket is blocking. - * We want to avoid calling fcntl more than necessary on the socket, - */ - if (on >= 0 && sock->timeout < 0){ - if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 1){ - if ((rv = sononblock(sock->socketdes)) != APR_SUCCESS){ - return rv; - } - } - } - else if (on < 0 && sock->timeout >= 0){ - if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 0){ - if ((rv = soblock(sock->socketdes)) != APR_SUCCESS) { - return rv; - } - } - } - /* must disable the incomplete read support if we change to a - * blocking socket. - */ - if (on == 0) { - sock->netmask &= ~APR_INCOMPLETE_READ; - } - sock->timeout = on; - apr_set_option(&sock->netmask, APR_SO_TIMEOUT, on); + return apr_socket_timeout_set(sock, on); } if (opt & APR_TCP_NODELAY) { #if defined(TCP_NODELAY) @@ -337,7 +310,7 @@ apr_status_t apr_socket_opt_get(apr_socket_t *sock, switch(opt) { case APR_SO_TIMEOUT: /* XXX: To be deprecated */ - *on = sock->timeout; + *on = (apr_int32_t)sock->timeout; break; default: *on = apr_is_option_set(sock->netmask, opt); diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 7672ae3165c..68ca7fe812e 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -135,45 +135,8 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, switch (opt) { case APR_SO_TIMEOUT: { - /* XXX: to be deprecated */ - if (on == 0) { - /* Set the socket non-blocking if it was previously blocking */ - if (sock->timeout != 0) { - if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) - return stat; - } - } - else if (on > 0) { - /* Set the socket to blocking if it was previously non-blocking */ - if (sock->timeout == 0) { - if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) - return stat; - } - /* Reset socket timeouts if the new timeout differs from the old timeout */ - if (sock->timeout != on) - { - /* Win32 timeouts are in msec */ - sock->timeout_ms = apr_time_as_msec(on); - setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVTIMEO, - (char *) &sock->timeout_ms, - sizeof(sock->timeout_ms)); - setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDTIMEO, - (char *) &sock->timeout_ms, - sizeof(sock->timeout_ms)); - } - } - else if (on < 0) { - int zero = 0; - /* Set the socket to blocking with infinite timeouts */ - if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) - return stat; - setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVTIMEO, - (char *) &zero, sizeof(zero)); - setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDTIMEO, - (char *) &zero, sizeof(zero)); - } - sock->timeout = on; - break; + /* XXX: To be deprecated */ + return apr_socket_timeout_set(sock, on); } case APR_SO_KEEPALIVE: if (on != apr_is_option_set(sock->netmask, APR_SO_KEEPALIVE)) { From 699e45370c4f9188d3e5358e7705bd090d538480 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Tue, 16 Jul 2002 05:22:26 +0000 Subject: [PATCH 3672/7878] Fix the parameter name in the inherit_set/unset functions so that it avoids shadowing global symbols (as with "socket"). Reported by: Karl Fogel PS: I'm sure somebody will tell me if I horribly broke win32. :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63685 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_inherit.h | 6 ++++-- include/arch/unix/inherit.h | 26 ++++++++++++++------------ include/arch/win32/inherit.h | 28 ++++++++++++++-------------- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/include/apr_inherit.h b/include/apr_inherit.h index 1865a65f7cc..d8e77ad0460 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -75,13 +75,15 @@ extern "C" { * @param name Set Inheritance for this Socket/File Handle */ #define APR_DECLARE_INHERIT_SET(name) \ - APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *name) + APR_DECLARE(apr_status_t) apr_##name##_inherit_set( \ + apr_##name##_t *the##name) /** * @param name Unset Inheritance for this Socket/File Handle */ #define APR_DECLARE_INHERIT_UNSET(name) \ - APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *name) + APR_DECLARE(apr_status_t) apr_##name##_inherit_unset( \ + apr_##name##_t *the##name) #ifdef __cplusplus } diff --git a/include/arch/unix/inherit.h b/include/arch/unix/inherit.h index 3ec4e370cf5..acf5f8c581f 100644 --- a/include/arch/unix/inherit.h +++ b/include/arch/unix/inherit.h @@ -60,35 +60,37 @@ #define APR_INHERIT (1 << 24) /* Must not conflict with other bits */ #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ -apr_status_t apr_##name##_inherit_set(apr_##name##_t *name) \ +apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \ { \ - if (!(name->flag & APR_INHERIT)) { \ - name->flag |= APR_INHERIT; \ - apr_pool_child_cleanup_set(name->pool, (void *)name, \ + if (!(the##name->flag & APR_INHERIT)) { \ + the##name->flag |= APR_INHERIT; \ + apr_pool_child_cleanup_set(the##name->pool, \ + (void *)the##name, \ cleanup, apr_pool_cleanup_null); \ } \ return APR_SUCCESS; \ } \ /* Deprecated */ \ -void apr_##name##_set_inherit(apr_##name##_t *name) \ +void apr_##name##_set_inherit(apr_##name##_t *the##name) \ { \ - apr_##name##_inherit_set(name); \ + apr_##name##_inherit_set(the##name); \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ -apr_status_t apr_##name##_inherit_unset(apr_##name##_t *name) \ +apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \ { \ - if (name->flag & APR_INHERIT) { \ - name->flag &= ~APR_INHERIT; \ - apr_pool_child_cleanup_set(name->pool, (void *)name, \ + if (the##name->flag & APR_INHERIT) { \ + the##name->flag &= ~APR_INHERIT; \ + apr_pool_child_cleanup_set(the##name->pool, \ + (void *)the##name, \ cleanup, cleanup); \ } \ return APR_SUCCESS; \ } \ /* Deprecated */ \ -void apr_##name##_unset_inherit(apr_##name##_t *name) \ +void apr_##name##_unset_inherit(apr_##name##_t *the##name) \ { \ - apr_##name##_inherit_unset(name); \ + apr_##name##_inherit_unset(the##name); \ } #endif /* ! INHERIT_H */ diff --git a/include/arch/win32/inherit.h b/include/arch/win32/inherit.h index 32ec740c4d5..83744c1e352 100644 --- a/include/arch/win32/inherit.h +++ b/include/arch/win32/inherit.h @@ -60,11 +60,11 @@ #define APR_INHERIT (1 << 24) /* Must not conflict with other bits */ #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ -APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *name) \ +APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ { \ IF_WIN_OS_IS_UNICODE \ { \ - if (!SetHandleInformation(name->filehand, \ + if (!SetHandleInformation(the##name->filehand, \ HANDLE_FLAG_INHERIT, \ HANDLE_FLAG_INHERIT)) \ return apr_get_os_error(); \ @@ -72,46 +72,46 @@ APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *name) \ ELSE_WIN_OS_IS_ANSI \ { \ HANDLE temp, hproc = GetCurrentProcess(); \ - if (!DuplicateHandle(hproc, name->filehand, \ + if (!DuplicateHandle(hproc, the##name->filehand, \ hproc, &temp, 0, TRUE, \ DUPLICATE_SAME_ACCESS)) \ return apr_get_os_error(); \ - CloseHandle(name->filehand); \ - name->filehand = temp; \ + CloseHandle(the##name->filehand); \ + the##name->filehand = temp; \ } \ return APR_SUCCESS; \ } \ /* Deprecated */ \ -APR_DECLARE(void) apr_##name##_set_inherit(apr_##name##_t *name) \ +APR_DECLARE(void) apr_##name##_set_inherit(apr_##name##_t *the##name) \ { \ - apr_##name##_inherit_set(name); \ + apr_##name##_inherit_set(the##name); \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ -APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *name) \ +APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ { \ IF_WIN_OS_IS_UNICODE \ { \ - if (!SetHandleInformation(name->filehand, \ + if (!SetHandleInformation(the##name->filehand, \ HANDLE_FLAG_INHERIT, 0)) \ return apr_get_os_error(); \ } \ ELSE_WIN_OS_IS_ANSI \ { \ HANDLE temp, hproc = GetCurrentProcess(); \ - if (!DuplicateHandle(hproc, name->filehand, \ + if (!DuplicateHandle(hproc, the##name->filehand, \ hproc, &temp, 0, FALSE, \ DUPLICATE_SAME_ACCESS)) \ return apr_get_os_error(); \ - CloseHandle(name->filehand); \ - name->filehand = temp; \ + CloseHandle(the##name->filehand); \ + the##name->filehand = temp; \ } \ return APR_SUCCESS; \ } \ /* Deprecated */ \ -APR_DECLARE(void) apr_##name##_unset_inherit(apr_##name##_t *name) \ +APR_DECLARE(void) apr_##name##_unset_inherit(apr_##name##_t *the##name) \ { \ - apr_##name##_inherit_unset(name); \ + apr_##name##_inherit_unset(the##name); \ } #endif /* ! INHERIT_H */ From 8d06e04e46cdc93484aa90f0d5a789364aed5c9f Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Tue, 16 Jul 2002 05:25:44 +0000 Subject: [PATCH 3673/7878] Nuke a warning due to a function that should have been static AFAICT: pollacc.c:78: warning: no previous prototype for `find_poll_sock' git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63686 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollacc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/pollacc.c b/poll/unix/pollacc.c index ea6dfe9a479..d421a45c0ba 100644 --- a/poll/unix/pollacc.c +++ b/poll/unix/pollacc.c @@ -74,7 +74,7 @@ APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, ap return APR_SUCCESS; } -APR_DECLARE(apr_pollfd_t*) find_poll_sock(apr_pollfd_t *aprset, apr_socket_t *sock) +static apr_pollfd_t *find_poll_sock(apr_pollfd_t *aprset, apr_socket_t *sock) { apr_pollfd_t *curr = aprset; From 93fc788381270df20cb4401bbff918ba924cb69b Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 16 Jul 2002 10:08:36 +0000 Subject: [PATCH 3674/7878] Export functions declared by APR_DECLARE_INHERIT_SET/UNSET macros. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63687 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_exports.awk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build/make_exports.awk b/build/make_exports.awk index 09651f2af6a..eefc1a94516 100644 --- a/build/make_exports.awk +++ b/build/make_exports.awk @@ -104,6 +104,20 @@ function add_symbol(symbol) { next } +/^[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(][^)]*[)]/ { + sub("[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(]", "", $0) + sub("[)].*$", "", $0) + add_symbol("apr_" $0 "_inherit_set") + next +} + +/^[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(][^)]*[)]/ { + sub("[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(]", "", $0) + sub("[)].*$", "", $0) + add_symbol("apr_" $0 "_inherit_unset") + next +} + /^#[ \t]*if(ndef| !defined[(])([^_]*_)*H/ { enter_scope(TYPE_HEADER) next From 4c0bcd3a1dc8f2f1c636104fc2c23e92a7043275 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 16 Jul 2002 14:34:03 +0000 Subject: [PATCH 3675/7878] OS/2: Prevent duplicate symbol apr_wait_for_io_or_timeout by eliminating a local version & using the general purpose one in support/unix/waitio.c instead. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63688 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sendrecv_udp.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c index 480d8c41eb0..4010a083ac1 100644 --- a/network_io/os2/sendrecv_udp.c +++ b/network_io/os2/sendrecv_udp.c @@ -56,30 +56,10 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_network_io.h" +#include "apr_support.h" #include "apr_lib.h" #include -apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read) -{ - int waitsock = sock->socketdes; - int srv; - - do { - waitsock = sock->socketdes; - srv = select(&waitsock, for_read > 0, !for_read, 0, sock->timeout / 1000); - } while (srv < 0 && sock_errno() == SOCEINTR); - - if (srv == 0) { - return APR_TIMEUP; - } - else if (srv < 0) { - return APR_FROM_OS_ERROR(sock_errno()); - } - - return APR_SUCCESS; -} - - APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, apr_int32_t flags, const char *buf, apr_size_t *len) @@ -94,7 +74,7 @@ APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, } while (rv == -1 && (serrno = sock_errno()) == EINTR); if (rv == -1 && serrno == SOCEWOULDBLOCK && sock->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); + apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -132,7 +112,7 @@ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, } while (rv == -1 && (serrno = sock_errno()) == EINTR); if (rv == -1 && serrno == SOCEWOULDBLOCK && sock->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 1); + apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { *len = 0; From 2b19daec271f4a0eddc7f0a74acc22b69c7c5292 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 16 Jul 2002 17:55:01 +0000 Subject: [PATCH 3676/7878] Add APR_BUFFERED support to apr_file_os_put() calls. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63689 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ file_io/os2/open.c | 12 +++++++++++- file_io/unix/open.c | 19 +++++++++++++++---- file_io/win32/open.c | 16 ++++++++++++++++ 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 5728867607b..5bedb104dc8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Add APR_BUFFERED support to apr_os_file_put(). [Justin Erenkrantz] + *) Fix misinterpretation of timeout for select() on Win32/Netware. Identified by [TANAKA Koichi ] diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 05301d815f4..07ebe666a6e 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -224,10 +224,20 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thef (*file)->pool = pool; (*file)->filedes = *dafile; (*file)->isopen = TRUE; - (*file)->buffered = FALSE; (*file)->eof_hit = FALSE; (*file)->flags = flags; (*file)->pipe = FALSE; + (*file)->buffered = (flags & APR_BUFFERED) > 0; + + if ((*file)->buffered) { + apr_status_t rv; + + (*file)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); + rv = apr_thread_mutex_create(&(*file)->mutex, 0, pool); + + if (rv) + return rv; + } return APR_SUCCESS; } diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 46882a1633f..9f758119076 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -228,15 +228,26 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); (*file)->pool = pool; (*file)->eof_hit = 0; - (*file)->buffered = 0; (*file)->blocking = BLK_UNKNOWN; /* in case it is a pipe */ (*file)->timeout = -1; (*file)->ungetchar = -1; /* no char avail */ (*file)->filedes = *dafile; (*file)->flags = flags; - /* buffer already NULL; - * don't get a lock (only for buffered files) - */ + (*file)->buffered = (flags & APR_BUFFERED) > 0; + + if ((*file)->buffered) { + (*file)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); +#if APR_HAS_THREADS + if ((*file)->flags & APR_XTHREAD) { + apr_status_t rv; + rv = apr_thread_mutex_create(&((*file)->thlock), + APR_THREAD_MUTEX_DEFAULT, pool); + if (rv) { + return rv; + } + } +#endif + } return APR_SUCCESS; } diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 796d0e45bc5..87cf8016724 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -524,6 +524,22 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, if (flags & APR_APPEND) (*file)->append = 1; + if (flags & APR_BUFFERED) { + apr_status_t rv; + + (*file)->buffered = 1; + (*file)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); + rv = apr_thread_mutex_create(&(*file)->mutex, APR_THREAD_MUTEX_DEFAULT, + pool); + + if (rv) { + if (file_cleanup(*new) == APR_SUCCESS) { + apr_pool_cleanup_kill(pool, *file, file_cleanup); + } + return rv; + } + } + /* XXX... we pcalloc above so all others are zeroed. * Should we be testing if thefile is a handle to * a PIPE and set up the mechanics appropriately? From 389d1fff4d56e22f9d599dc363ec21db04e0c2c4 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Tue, 16 Jul 2002 20:10:13 +0000 Subject: [PATCH 3677/7878] Fix cut-n-paste-o in apr_os_file_put. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63690 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 87cf8016724..c5d1c230029 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -533,7 +533,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, pool); if (rv) { - if (file_cleanup(*new) == APR_SUCCESS) { + if (file_cleanup(*file) == APR_SUCCESS) { apr_pool_cleanup_kill(pool, *file, file_cleanup); } return rv; From 720047bf9397e1538691ccd8d5dc516768f51c6c Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 16 Jul 2002 20:23:48 +0000 Subject: [PATCH 3678/7878] Added a check for EWOULDBLOCK as well as WSAEWOULDBLOCK to the NetWare APR_STATUS_IS_EAGAIN() macro. This fixes the handling of an EWOULDBLOCK return value from a xxx_bucket_read() call. Also removed some duplicate NetWare macros. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63691 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 7e10c551325..c3d9386a2eb 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -1035,6 +1035,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ + || (s) == EWOULDBLOCK \ || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK) #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ || (s) == APR_OS_START_SYSERR + WSAEINTR) @@ -1072,33 +1073,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) -#ifdef NETWARE -#define apr_get_netos_error() (WSAGetLastError()+APR_OS_START_SYSERR) - -#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ - || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \ - || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK) -#define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ - || (s) == APR_OS_START_SYSERR + WSAEINTR) -#define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ - || (s) == APR_OS_START_SYSERR + WSAENOTSOCK) -#define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ - || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED) -#define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ - || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS) -#define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ - || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) -#define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ - || (s) == APR_OS_START_SYSERR + WSAECONNRESET) -#define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ - || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ - || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) -#define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ - || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) -#define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ - || (s) == APR_OS_START_SYSERR + WSAENETUNREACH) -#endif - /** no error */ #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) From ee130922956f5b3d5f9b118f376c7699f0580189 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 16 Jul 2002 20:27:43 +0000 Subject: [PATCH 3679/7878] NetWare uses a different select() call if the handle is pipe rather than a socket. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63692 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 8188f2313b8..9b2deb5dc33 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -157,6 +157,9 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n int rv, i; int maxfd = -1; struct timeval tv, *tvptr; +#ifdef NETWARE + int is_pipe = 0; +#endif if (timeout < 0) { tvptr = NULL; @@ -179,6 +182,9 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n } else if (aprset[i].desc_type == APR_POLL_FILE) { fd = aprset[i].desc.f->filedes; +#ifdef NETWARE + is_pipe = aprset[i].desc.f->is_pipe; +#endif } if (aprset[i].reqevents & APR_POLLIN) { FD_SET(fd, &readset); @@ -195,8 +201,19 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n } } +#ifdef NETWARE + if (is_pipe) { + rv = pipe_select(maxfd + 1, &readset, &writeset, &exceptset, tvptr); + } + else { +#endif + rv = select(maxfd + 1, &readset, &writeset, &exceptset, tvptr); +#ifdef NETWARE + } +#endif + (*nsds) = rv; if ((*nsds) == 0) { return APR_TIMEUP; From 14e7b5643627d869b431165cde9099086947e26a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Jul 2002 02:53:25 +0000 Subject: [PATCH 3680/7878] MD5 is crypto. It belongs in crypto. And as far as I can tell, this didn't even cause any hassles. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63693 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 8 - include/apr_lib.h | 8 - include/apr_md5.h | 187 ------------ libapr.dsp | 8 - passwd/Makefile.in | 2 +- passwd/apr_md5.c | 730 --------------------------------------------- 6 files changed, 1 insertion(+), 942 deletions(-) delete mode 100644 include/apr_md5.h delete mode 100644 passwd/apr_md5.c diff --git a/apr.dsp b/apr.dsp index 5fa09c4e381..f1ac6750069 100644 --- a/apr.dsp +++ b/apr.dsp @@ -301,10 +301,6 @@ SOURCE=.\network_io\win32\sockopt.c SOURCE=.\passwd\apr_getpass.c # End Source File -# Begin Source File - -SOURCE=.\passwd\apr_md5.c -# End Source File # End Group # Begin Group "shmem" @@ -541,10 +537,6 @@ SOURCE=.\include\apr_lib.h # End Source File # Begin Source File -SOURCE=.\include\apr_md5.h -# End Source File -# Begin Source File - SOURCE=.\include\apr_mmap.h # End Source File # Begin Source File diff --git a/include/apr_lib.h b/include/apr_lib.h index 15be50aa923..7850891b05d 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -235,14 +235,6 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), apr_vformatter_buff_t *c, const char *fmt, va_list ap); -/** - * Validate any password encypted with any algorithm that APR understands - * @param passwd The password to validate - * @param hash The password to validate against - */ -APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, - const char *hash); - /** * Display a prompt and read in the password from stdin. * @param prompt The prompt to display diff --git a/include/apr_md5.h b/include/apr_md5.h deleted file mode 100644 index a88199bfdcc..00000000000 --- a/include/apr_md5.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - * This is work is derived from material Copyright RSA Data Security, Inc. - * - * The RSA copyright statement and Licence for that original material is - * included below. This is followed by the Apache copyright statement and - * licence for the modifications made to that material. - */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All - rights reserved. - - License to copy and use this software is granted provided that it - is identified as the "RSA Data Security, Inc. MD5 Message-Digest - Algorithm" in all material mentioning or referencing this software - or this function. - - License is also granted to make and use derivative works provided - that such works are identified as "derived from the RSA Data - Security, Inc. MD5 Message-Digest Algorithm" in all material - mentioning or referencing the derived work. - - RSA Data Security, Inc. makes no representations concerning either - the merchantability of this software or the suitability of this - software for any particular purpose. It is provided "as is" - without express or implied warranty of any kind. - - These notices must be retained in any copies of any part of this - documentation and/or software. - */ - -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_MD5_H -#define APR_MD5_H - -#include "apr.h" -#include "apr_xlate.h" - -#ifdef __cplusplus -extern "C" { -#endif -/** - * @file apr_md5.h - * @brief APR MD5 Routines - */ - -/** - * @defgroup APR_MD5 MD5 Routines - * @ingroup APR - * @{ - */ - -#define MD5_DIGESTSIZE 16 - -typedef struct apr_md5_ctx_t apr_md5_ctx_t; - -/** MD5 context. */ -struct apr_md5_ctx_t { - /** state (ABCD) */ - apr_uint32_t state[4]; - /** number of bits, modulo 2^64 (lsb first) */ - apr_uint32_t count[2]; - /** input buffer */ - unsigned char buffer[64]; -#if APR_HAS_XLATE - /** translation handle */ - apr_xlate_t *xlate; -#endif -}; - -/** - * MD5 Initialize. Begins an MD5 operation, writing a new context. - * @param context The MD5 context to initialize. - */ -APR_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context); - -/** - * MD5 translation setup. Provides the APR translation handle to be used - * for translating the content before calculating the digest. - * @param context The MD5 content to set the translation for. - * @param xlate The translation handle to use for this MD5 context - */ -#if APR_HAS_XLATE -APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context, - apr_xlate_t *xlate); -#else -#define apr_md5_set_xlate(context, xlate) APR_ENOTIMPL -#endif - -/** - * MD5 block update operation. Continue an MD5 message-digest operation, - * processing another message block, and updating the context. - * @param context The MD5 content to update. - * @param input next message block to update - * @param inputLen The length of the next message block - */ -APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context, - const unsigned char *input, - apr_size_t inputLen); - -/** - * MD5 finalization. Ends an MD5 message-digest operation, writing the - * message digest and zeroing the context - * @param digest The final MD5 digest - * @param context The MD5 content we are finalizing. - */ -APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE], - apr_md5_ctx_t *context); - -/** - * MD5 in one step - * @param digest The final MD5 digest - * @param input The message block to use - * @param inputLen The length of the message block - */ -APR_DECLARE(apr_status_t) apr_md5(unsigned char digest[MD5_DIGESTSIZE], - const unsigned char *input, - apr_size_t inputLen); - -/** - * Encode a password using an MD5 algorithm - * @param password The password to encode - * @param salt The salt to use for the encoding - * @param result The string to store the encoded password in - * @param nbytes The length of the string - */ -APR_DECLARE(apr_status_t) apr_md5_encode(const char *password, const char *salt, - char *result, apr_size_t nbytes); - -/** @} */ -#ifdef __cplusplus -} -#endif - -#endif /* !APR_MD5_H */ diff --git a/libapr.dsp b/libapr.dsp index 4c38eb18eb7..d17429ce7a2 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -307,10 +307,6 @@ SOURCE=.\network_io\win32\sockopt.c SOURCE=.\passwd\apr_getpass.c # End Source File -# Begin Source File - -SOURCE=.\passwd\apr_md5.c -# End Source File # End Group # Begin Group "shmem" @@ -547,10 +543,6 @@ SOURCE=.\include\apr_lib.h # End Source File # Begin Source File -SOURCE=.\include\apr_md5.h -# End Source File -# Begin Source File - SOURCE=.\include\apr_mmap.h # End Source File # Begin Source File diff --git a/passwd/Makefile.in b/passwd/Makefile.in index cb30efeb24a..162d415eab5 100644 --- a/passwd/Makefile.in +++ b/passwd/Makefile.in @@ -1,7 +1,7 @@ srcdir = @srcdir@ VPATH = @srcdir@ -TARGETS = apr_md5.lo apr_getpass.lo +TARGETS = apr_getpass.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c deleted file mode 100644 index 958400dbc76..00000000000 --- a/passwd/apr_md5.c +++ /dev/null @@ -1,730 +0,0 @@ -/* - * This is work is derived from material Copyright RSA Data Security, Inc. - * - * The RSA copyright statement and Licence for that original material is - * included below. This is followed by the Apache copyright statement and - * licence for the modifications made to that material. - */ - -/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm - */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All - rights reserved. - - License to copy and use this software is granted provided that it - is identified as the "RSA Data Security, Inc. MD5 Message-Digest - Algorithm" in all material mentioning or referencing this software - or this function. - - License is also granted to make and use derivative works provided - that such works are identified as "derived from the RSA Data - Security, Inc. MD5 Message-Digest Algorithm" in all material - mentioning or referencing the derived work. - - RSA Data Security, Inc. makes no representations concerning either - the merchantability of this software or the suitability of this - software for any particular purpose. It is provided "as is" - without express or implied warranty of any kind. - - These notices must be retained in any copies of any part of this - documentation and/or software. - */ - -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* - * The apr_md5_encode() routine uses much code obtained from the FreeBSD 3.0 - * MD5 crypt() function, which is licenced as follows: - * ---------------------------------------------------------------------------- - * "THE BEER-WARE LICENSE" (Revision 42): - * wrote this file. As long as you retain this notice you - * can do whatever you want with this stuff. If we meet some day, and you think - * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp - * ---------------------------------------------------------------------------- - */ -#ifndef WIN32 -#include "apr_private.h" -#endif -#include "apr_strings.h" -#include "apr_md5.h" -#include "apr_lib.h" - -#if APR_HAVE_STRING_H -#include -#endif -#if APR_HAVE_CRYPT_H -#include -#endif -#if APR_HAVE_UNISTD_H -#include -#endif - -/* Constants for MD5Transform routine. - */ - -#define S11 7 -#define S12 12 -#define S13 17 -#define S14 22 -#define S21 5 -#define S22 9 -#define S23 14 -#define S24 20 -#define S31 4 -#define S32 11 -#define S33 16 -#define S34 23 -#define S41 6 -#define S42 10 -#define S43 15 -#define S44 21 - -static void MD5Transform(apr_uint32_t state[4], const unsigned char block[64]); -static void Encode(unsigned char *output, const apr_uint32_t *input, - unsigned int len); -static void Decode(apr_uint32_t *output, const unsigned char *input, - unsigned int len); - -static unsigned char PADDING[64] = -{ - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -#if APR_CHARSET_EBCDIC -static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_md5_encode() */ -#endif - -/* F, G, H and I are basic MD5 functions. - */ -#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define I(x, y, z) ((y) ^ ((x) | (~z))) - -/* ROTATE_LEFT rotates x left n bits. - */ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) - -/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. - * Rotation is separate from addition to prevent recomputation. - */ -#define FF(a, b, c, d, x, s, ac) { \ - (a) += F ((b), (c), (d)) + (x) + (apr_uint32_t)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define GG(a, b, c, d, x, s, ac) { \ - (a) += G ((b), (c), (d)) + (x) + (apr_uint32_t)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define HH(a, b, c, d, x, s, ac) { \ - (a) += H ((b), (c), (d)) + (x) + (apr_uint32_t)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define II(a, b, c, d, x, s, ac) { \ - (a) += I ((b), (c), (d)) + (x) + (apr_uint32_t)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } - -/* MD5 initialization. Begins an MD5 operation, writing a new context. - */ -APR_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context) -{ - context->count[0] = context->count[1] = 0; - - /* Load magic initialization constants. */ - context->state[0] = 0x67452301; - context->state[1] = 0xefcdab89; - context->state[2] = 0x98badcfe; - context->state[3] = 0x10325476; - -#if APR_HAS_XLATE - context->xlate = NULL; -#endif - - return APR_SUCCESS; -} - -#if APR_HAS_XLATE -/* MD5 translation setup. Provides the APR translation handle - * to be used for translating the content before calculating the - * digest. - */ -APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context, - apr_xlate_t *xlate) -{ - apr_status_t rv; - int is_sb; - - /* TODO: remove the single-byte-only restriction from this code - */ - rv = apr_xlate_sb_get(xlate, &is_sb); - if (rv != APR_SUCCESS) { - return rv; - } - if (!is_sb) { - return APR_EINVAL; - } - context->xlate = xlate; - return APR_SUCCESS; -} -#endif /* APR_HAS_XLATE */ - -/* MD5 block update operation. Continues an MD5 message-digest - * operation, processing another message block, and updating the - * context. - */ -APR_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context, - const unsigned char *input, - apr_size_t inputLen) -{ - unsigned int i, idx, partLen; -#if APR_HAS_XLATE - apr_size_t inbytes_left, outbytes_left; -#endif - - /* Compute number of bytes mod 64 */ - idx = (unsigned int)((context->count[0] >> 3) & 0x3F); - - /* Update number of bits */ - if ((context->count[0] += ((apr_uint32_t)inputLen << 3)) - < ((apr_uint32_t)inputLen << 3)) - context->count[1]++; - context->count[1] += (apr_uint32_t)inputLen >> 29; - - partLen = 64 - idx; - - /* Transform as many times as possible. */ -#if !APR_HAS_XLATE - if (inputLen >= partLen) { - memcpy(&context->buffer[idx], input, partLen); - MD5Transform(context->state, context->buffer); - - for (i = partLen; i + 63 < inputLen; i += 64) - MD5Transform(context->state, &input[i]); - - idx = 0; - } - else - i = 0; - - /* Buffer remaining input */ - memcpy(&context->buffer[idx], &input[i], inputLen - i); -#else /*APR_HAS_XLATE*/ - if (inputLen >= partLen) { - if (context->xlate) { - inbytes_left = outbytes_left = partLen; - apr_xlate_conv_buffer(context->xlate, (const char *)input, - &inbytes_left, - (char *)&context->buffer[idx], - &outbytes_left); - } - else { - memcpy(&context->buffer[idx], input, partLen); - } - MD5Transform(context->state, context->buffer); - - for (i = partLen; i + 63 < inputLen; i += 64) { - if (context->xlate) { - unsigned char inp_tmp[64]; - inbytes_left = outbytes_left = 64; - apr_xlate_conv_buffer(context->xlate, (const char *)&input[i], - &inbytes_left, (char *)inp_tmp, - &outbytes_left); - MD5Transform(context->state, inp_tmp); - } - else { - MD5Transform(context->state, &input[i]); - } - } - - idx = 0; - } - else - i = 0; - - /* Buffer remaining input */ - if (context->xlate) { - inbytes_left = outbytes_left = inputLen - i; - apr_xlate_conv_buffer(context->xlate, (const char *)&input[i], - &inbytes_left, (char *)&context->buffer[idx], - &outbytes_left); - } - else { - memcpy(&context->buffer[idx], &input[i], inputLen - i); - } -#endif /*APR_HAS_XLATE*/ - return APR_SUCCESS; -} - -/* MD5 finalization. Ends an MD5 message-digest operation, writing the - * the message digest and zeroizing the context. - */ -APR_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE], - apr_md5_ctx_t *context) -{ - unsigned char bits[8]; - unsigned int idx, padLen; - - /* Save number of bits */ - Encode(bits, context->count, 8); - -#if APR_HAS_XLATE - /* apr_md5_update() should not translate for this final round. */ - context->xlate = NULL; -#endif /*APR_HAS_XLATE*/ - - /* Pad out to 56 mod 64. */ - idx = (unsigned int)((context->count[0] >> 3) & 0x3f); - padLen = (idx < 56) ? (56 - idx) : (120 - idx); - apr_md5_update(context, PADDING, padLen); - - /* Append length (before padding) */ - apr_md5_update(context, bits, 8); - - /* Store state in digest */ - Encode(digest, context->state, MD5_DIGESTSIZE); - - /* Zeroize sensitive information. */ - memset(context, 0, sizeof(*context)); - - return APR_SUCCESS; -} - -/* MD5 in one step (init, update, final) - */ -APR_DECLARE(apr_status_t) apr_md5(unsigned char digest[MD5_DIGESTSIZE], - const unsigned char *input, - apr_size_t inputLen) -{ - apr_md5_ctx_t ctx; - apr_status_t rv; - - apr_md5_init(&ctx); - - if ((rv = apr_md5_update(&ctx, input, inputLen)) != APR_SUCCESS) - return rv; - - return apr_md5_final(digest, &ctx); -} - -/* MD5 basic transformation. Transforms state based on block. */ -static void MD5Transform(apr_uint32_t state[4], const unsigned char block[64]) -{ - apr_uint32_t a = state[0], b = state[1], c = state[2], d = state[3], - x[MD5_DIGESTSIZE]; - - Decode(x, block, 64); - - /* Round 1 */ - FF(a, b, c, d, x[0], S11, 0xd76aa478); /* 1 */ - FF(d, a, b, c, x[1], S12, 0xe8c7b756); /* 2 */ - FF(c, d, a, b, x[2], S13, 0x242070db); /* 3 */ - FF(b, c, d, a, x[3], S14, 0xc1bdceee); /* 4 */ - FF(a, b, c, d, x[4], S11, 0xf57c0faf); /* 5 */ - FF(d, a, b, c, x[5], S12, 0x4787c62a); /* 6 */ - FF(c, d, a, b, x[6], S13, 0xa8304613); /* 7 */ - FF(b, c, d, a, x[7], S14, 0xfd469501); /* 8 */ - FF(a, b, c, d, x[8], S11, 0x698098d8); /* 9 */ - FF(d, a, b, c, x[9], S12, 0x8b44f7af); /* 10 */ - FF(c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ - FF(b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ - FF(a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ - FF(d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ - FF(c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ - FF(b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ - - /* Round 2 */ - GG(a, b, c, d, x[1], S21, 0xf61e2562); /* 17 */ - GG(d, a, b, c, x[6], S22, 0xc040b340); /* 18 */ - GG(c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ - GG(b, c, d, a, x[0], S24, 0xe9b6c7aa); /* 20 */ - GG(a, b, c, d, x[5], S21, 0xd62f105d); /* 21 */ - GG(d, a, b, c, x[10], S22, 0x2441453); /* 22 */ - GG(c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ - GG(b, c, d, a, x[4], S24, 0xe7d3fbc8); /* 24 */ - GG(a, b, c, d, x[9], S21, 0x21e1cde6); /* 25 */ - GG(d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ - GG(c, d, a, b, x[3], S23, 0xf4d50d87); /* 27 */ - GG(b, c, d, a, x[8], S24, 0x455a14ed); /* 28 */ - GG(a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ - GG(d, a, b, c, x[2], S22, 0xfcefa3f8); /* 30 */ - GG(c, d, a, b, x[7], S23, 0x676f02d9); /* 31 */ - GG(b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ - - /* Round 3 */ - HH(a, b, c, d, x[5], S31, 0xfffa3942); /* 33 */ - HH(d, a, b, c, x[8], S32, 0x8771f681); /* 34 */ - HH(c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ - HH(b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ - HH(a, b, c, d, x[1], S31, 0xa4beea44); /* 37 */ - HH(d, a, b, c, x[4], S32, 0x4bdecfa9); /* 38 */ - HH(c, d, a, b, x[7], S33, 0xf6bb4b60); /* 39 */ - HH(b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ - HH(a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ - HH(d, a, b, c, x[0], S32, 0xeaa127fa); /* 42 */ - HH(c, d, a, b, x[3], S33, 0xd4ef3085); /* 43 */ - HH(b, c, d, a, x[6], S34, 0x4881d05); /* 44 */ - HH(a, b, c, d, x[9], S31, 0xd9d4d039); /* 45 */ - HH(d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ - HH(c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ - HH(b, c, d, a, x[2], S34, 0xc4ac5665); /* 48 */ - - /* Round 4 */ - II(a, b, c, d, x[0], S41, 0xf4292244); /* 49 */ - II(d, a, b, c, x[7], S42, 0x432aff97); /* 50 */ - II(c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ - II(b, c, d, a, x[5], S44, 0xfc93a039); /* 52 */ - II(a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ - II(d, a, b, c, x[3], S42, 0x8f0ccc92); /* 54 */ - II(c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ - II(b, c, d, a, x[1], S44, 0x85845dd1); /* 56 */ - II(a, b, c, d, x[8], S41, 0x6fa87e4f); /* 57 */ - II(d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ - II(c, d, a, b, x[6], S43, 0xa3014314); /* 59 */ - II(b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ - II(a, b, c, d, x[4], S41, 0xf7537e82); /* 61 */ - II(d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ - II(c, d, a, b, x[2], S43, 0x2ad7d2bb); /* 63 */ - II(b, c, d, a, x[9], S44, 0xeb86d391); /* 64 */ - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - - /* Zeroize sensitive information. */ - memset(x, 0, sizeof(x)); -} - -/* Encodes input (apr_uint32_t) into output (unsigned char). Assumes len is - * a multiple of 4. - */ -static void Encode(unsigned char *output, const apr_uint32_t *input, - unsigned int len) -{ - unsigned int i, j; - apr_uint32_t k; - - for (i = 0, j = 0; j < len; i++, j += 4) { - k = input[i]; - output[j] = (unsigned char)(k & 0xff); - output[j + 1] = (unsigned char)((k >> 8) & 0xff); - output[j + 2] = (unsigned char)((k >> 16) & 0xff); - output[j + 3] = (unsigned char)((k >> 24) & 0xff); - } -} - -/* Decodes input (unsigned char) into output (apr_uint32_t). Assumes len is - * a multiple of 4. - */ -static void Decode(apr_uint32_t *output, const unsigned char *input, - unsigned int len) -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) - output[i] = ((apr_uint32_t)input[j]) | - (((apr_uint32_t)input[j + 1]) << 8) | - (((apr_uint32_t)input[j + 2]) << 16) | - (((apr_uint32_t)input[j + 3]) << 24); -} - -#if APR_CHARSET_EBCDIC -APR_DECLARE(apr_status_t) apr_MD5InitEBCDIC(apr_xlate_t *xlate) -{ - xlate_ebcdic_to_ascii = xlate; - return APR_SUCCESS; -} -#endif - -/* - * Define the Magic String prefix that identifies a password as being - * hashed using our algorithm. - */ -static const char *apr1_id = "$apr1$"; - -/* - * The following MD5 password encryption code was largely borrowed from - * the FreeBSD 3.0 /usr/src/lib/libcrypt/crypt.c file, which is - * licenced as stated at the top of this file. - */ - -static void to64(char *s, unsigned long v, int n) -{ - static unsigned char itoa64[] = /* 0 ... 63 => ASCII - 64 */ - "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - - while (--n >= 0) { - *s++ = itoa64[v&0x3f]; - v >>= 6; - } -} - -APR_DECLARE(apr_status_t) apr_md5_encode(const char *pw, const char *salt, - char *result, apr_size_t nbytes) -{ - /* - * Minimum size is 8 bytes for salt, plus 1 for the trailing NUL, - * plus 4 for the '$' separators, plus the password hash itself. - * Let's leave a goodly amount of leeway. - */ - - char passwd[120], *p; - const char *sp, *ep; - unsigned char final[MD5_DIGESTSIZE]; - apr_ssize_t sl, pl, i; - apr_md5_ctx_t ctx, ctx1; - unsigned long l; - - /* - * Refine the salt first. It's possible we were given an already-hashed - * string as the salt argument, so extract the actual salt value from it - * if so. Otherwise just use the string up to the first '$' as the salt. - */ - sp = salt; - - /* - * If it starts with the magic string, then skip that. - */ - if (!strncmp(sp, apr1_id, strlen(apr1_id))) { - sp += strlen(apr1_id); - } - - /* - * It stops at the first '$' or 8 chars, whichever comes first - */ - for (ep = sp; (*ep != '\0') && (*ep != '$') && (ep < (sp + 8)); ep++) { - continue; - } - - /* - * Get the length of the true salt - */ - sl = ep - sp; - - /* - * 'Time to make the doughnuts..' - */ - apr_md5_init(&ctx); -#if APR_CHARSET_EBCDIC - apr_md5_set_xlate(&ctx, xlate_ebcdic_to_ascii); -#endif - - /* - * The password first, since that is what is most unknown - */ - apr_md5_update(&ctx, (unsigned char *)pw, strlen(pw)); - - /* - * Then our magic string - */ - apr_md5_update(&ctx, (unsigned char *)apr1_id, strlen(apr1_id)); - - /* - * Then the raw salt - */ - apr_md5_update(&ctx, (unsigned char *)sp, sl); - - /* - * Then just as many characters of the MD5(pw, salt, pw) - */ - apr_md5_init(&ctx1); - apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); - apr_md5_update(&ctx1, (unsigned char *)sp, sl); - apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); - apr_md5_final(final, &ctx1); - for (pl = strlen(pw); pl > 0; pl -= MD5_DIGESTSIZE) { - apr_md5_update(&ctx, final, - (pl > MD5_DIGESTSIZE) ? MD5_DIGESTSIZE : pl); - } - - /* - * Don't leave anything around in vm they could use. - */ - memset(final, 0, sizeof(final)); - - /* - * Then something really weird... - */ - for (i = strlen(pw); i != 0; i >>= 1) { - if (i & 1) { - apr_md5_update(&ctx, final, 1); - } - else { - apr_md5_update(&ctx, (unsigned char *)pw, 1); - } - } - - /* - * Now make the output string. We know our limitations, so we - * can use the string routines without bounds checking. - */ - strcpy(passwd, apr1_id); - strncat(passwd, sp, sl); - strcat(passwd, "$"); - - apr_md5_final(final, &ctx); - - /* - * And now, just to make sure things don't run too fast.. - * On a 60 Mhz Pentium this takes 34 msec, so you would - * need 30 seconds to build a 1000 entry dictionary... - */ - for (i = 0; i < 1000; i++) { - apr_md5_init(&ctx1); - if (i & 1) { - apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); - } - else { - apr_md5_update(&ctx1, final, MD5_DIGESTSIZE); - } - if (i % 3) { - apr_md5_update(&ctx1, (unsigned char *)sp, sl); - } - - if (i % 7) { - apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); - } - - if (i & 1) { - apr_md5_update(&ctx1, final, MD5_DIGESTSIZE); - } - else { - apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw)); - } - apr_md5_final(final,&ctx1); - } - - p = passwd + strlen(passwd); - - l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; to64(p, l, 4); p += 4; - l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; to64(p, l, 4); p += 4; - l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; to64(p, l, 4); p += 4; - l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; to64(p, l, 4); p += 4; - l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; to64(p, l, 4); p += 4; - l = final[11] ; to64(p, l, 2); p += 2; - *p = '\0'; - - /* - * Don't leave anything around in vm they could use. - */ - memset(final, 0, sizeof(final)); - - apr_cpystrn(result, passwd, nbytes - 1); - return APR_SUCCESS; -} - -/* - * Validate a plaintext password against a smashed one. Use either - * crypt() (if available) or apr_md5_encode(), depending upon the format - * of the smashed input password. Return APR_SUCCESS if they match, or - * APR_EMISMATCH if they don't. - */ - -APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, - const char *hash) -{ - char sample[120]; -#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) - char *crypt_pw; -#endif - if (!strncmp(hash, apr1_id, strlen(apr1_id))) { - /* - * The hash was created using our custom algorithm. - */ - apr_md5_encode(passwd, hash, sample, sizeof(sample)); - } - else { - /* - * It's not our algorithm, so feed it to crypt() if possible. - */ -#if defined(WIN32) || defined(BEOS) || defined(NETWARE) - apr_cpystrn(sample, passwd, sizeof(sample) - 1); -#elif defined(CRYPT_R_CRYPTD) - CRYPTD buffer; - - crypt_pw = crypt_r(passwd, hash, &buffer); - apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); -#elif defined(CRYPT_R_STRUCT_CRYPT_DATA) - struct crypt_data buffer; - - /* having to clear this seems bogus... GNU doc is - * confusing... user report found from google says - * the crypt_data struct had to be cleared to get - * the same result as plain crypt() - */ - memset(&buffer, 0, sizeof(buffer)); - crypt_pw = crypt_r(passwd, hash, &buffer); - apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); -#else - /* XXX if this is a threaded build, we should hold a mutex - * around the next two lines... but note that on some - * platforms (e.g., Solaris, HP-UX, OS/390) crypt() - * returns a pointer to thread-specific data so we don't - * want a mutex on those platforms - */ - crypt_pw = crypt(passwd, hash); - apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); -#endif - } - return (strcmp(sample, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; -} From 7c7dd3f232b453c0780cab2e98de7426d100f8a3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Jul 2002 02:56:37 +0000 Subject: [PATCH 3681/7878] Forgot to haul the test on across libraries git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63694 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 -- test/testmd5.c | 180 ----------------------------------------------- 2 files changed, 184 deletions(-) delete mode 100644 test/testmd5.c diff --git a/test/Makefile.in b/test/Makefile.in index 3db64c9dff0..e373a3b3fa4 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -32,7 +32,6 @@ PROGRAMS = \ testuuid@EXEEXT@ \ testsockopt@EXEEXT@ \ testipsub@EXEEXT@ \ - testmd5@EXEEXT@ \ testpoll@EXEEXT@ \ testhash@EXEEXT@ \ occhild@EXEEXT@ \ @@ -153,9 +152,6 @@ testsockopt@EXEEXT@: testsockopt.lo $(LOCAL_LIBS) testipsub@EXEEXT@: testipsub.lo $(LOCAL_LIBS) $(LINK) testipsub.lo $(LOCAL_LIBS) $(ALL_LIBS) -testmd5@EXEEXT@: testmd5.lo $(LOCAL_LIBS) - $(LINK) testmd5.lo $(LOCAL_LIBS) $(ALL_LIBS) - testpoll@EXEEXT@: testpoll.lo $(LOCAL_LIBS) $(LINK) testpoll.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/testmd5.c b/test/testmd5.c deleted file mode 100644 index 80aad42b367..00000000000 --- a/test/testmd5.c +++ /dev/null @@ -1,180 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include -#include -#include - -#include "apr_md5.h" -#include "apr_xlate.h" -#include "apr_general.h" -#include "test_apr.h" - -int cur; - -struct testcase { - const char *s; - const char *digest; -}; - -struct testcase testcases[] = -{ - {"Jeff was here!", - "\xa5\x25\x8a\x89\x11\xb2\x9d\x1f\x81\x75\x96\x3b\x60\x94\x49\xc0"}, - {"01234567890aBcDeFASDFGHJKLPOIUYTR" - "POIUYTREWQZXCVBN LLLLLLLLLLLLLLL", - "\xd4\x1a\x06\x2c\xc5\xfd\x6f\x24\x67\x68\x56\x7c\x40\x8a\xd5\x69"}, - {"111111118888888888888888*******%%%%%%%%%%#####" - "142134u8097289720432098409289nkjlfkjlmn,m.. ", - "\xb6\xea\x5b\xe8\xca\x45\x8a\x33\xf0\xf1\x84\x6f\xf9\x65\xa8\xe1"}, - {"01234567890aBcDeFASDFGHJKLPOIUYTR" - "POIUYTREWQZXCVBN LLLLLLLLLLLLLLL" - "01234567890aBcDeFASDFGHJKLPOIUYTR" - "POIUYTREWQZXCVBN LLLLLLLLLLLLLLL" - "1", - "\xd1\xa1\xc0\x97\x8a\x60\xbb\xfb\x2a\x25\x46\x9d\xa5\xae\xd0\xb0"} -}; - -static void try(const void *buf, apr_size_t bufLen, apr_xlate_t *xlate, - const void *digest) -{ - int i; - apr_md5_ctx_t context; - unsigned char hash[MD5_DIGESTSIZE]; - - printf("Trying translation %d\n", cur + 1); - - STD_TEST_NEQ(" apr_md5_init", apr_md5_init(&context)) - - if (xlate) { -#if APR_HAS_XLATE - STD_TEST_NEQ(" apr_md5_set_xlate", - apr_md5_set_xlate(&context, xlate)) -#else - printf(" Didn't expect a translation handle! Not fatal.\n"); -#endif - } - - STD_TEST_NEQ(" apr_md5_update", apr_md5_update(&context, buf, bufLen)) - STD_TEST_NEQ(" apr_md5_final", apr_md5_final(hash, &context)) - - printf(" (MD5 hash : "); - for (i = 0; i < MD5_DIGESTSIZE; i++) { - printf("%02x",hash[i]); - } - - printf(")\n"); - - printf("%-60s", " Checking hash against expected"); - if (memcmp(hash, digest, MD5_DIGESTSIZE)) { - /* This is a fatal error...report on stderr */ - fprintf(stderr, "The digest is not as expected!\n"); -#if 'A' != 0x41 - fprintf(stderr, - "Maybe you didn't tell me what character sets " - "to translate between?\n" - "The expected digest is based on the string " - "being in ASCII.\n"); -#endif - } - printf("OK\n"); -} - -int main(int argc, char **argv) -{ - apr_status_t rv; - apr_xlate_t *xlate = NULL; - apr_pool_t *pool; - const char *src = NULL, *dst = NULL; - - switch(argc) { - case 1: - break; - case 3: - src = argv[1]; - dst = argv[2]; - break; - default: - fprintf(stderr, - "Usage: %s [src-charset dst-charset]\n", - argv[0]); - exit(1); - } - - rv = apr_initialize(); - assert(!rv); - atexit(apr_terminate); - - printf("APR MD5 Test\n============\n\n"); - STD_TEST_NEQ("Creating pool", apr_pool_create(&pool, NULL)) - - if (src) { -#if APR_HAS_XLATE - STD_TEST_NEQ("Opening xlate functions", - apr_xlate_open(&xlate, dst, src, pool)) -#else - /* This isn't a fatal error, so just report it... */ - printf("APR doesn't implement translation for this " - "configuration.\n"); -#endif - } - - for (cur = 0; cur < sizeof(testcases) / sizeof(testcases[0]); cur++) { - try(testcases[cur].s, strlen(testcases[cur].s), xlate, - testcases[cur].digest); - } - - printf("\nMD5 Test passed.\n"); - return 0; -} From 2356e6ab50a95780fc2330608c782cab363a61a5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Jul 2002 03:26:30 +0000 Subject: [PATCH 3682/7878] Move the win32-only utf8 support [for the Unicode filesystem] out of the i18n/unix tree. Never built it there anyways. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63695 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 16 ++++++++-------- dso/win32/dso.c | 2 +- file_io/win32/open.c | 2 +- include/arch/win32/fileio.h | 2 +- include/arch/{unix/i18n.h => win32/utf8.h} | 7 +++---- libapr.dsp | 16 ++++++++-------- i18n/unix/utf8_ucs2.c => misc/win32/utf8.c | 5 ++++- test/testucs.c | 2 +- 8 files changed, 27 insertions(+), 25 deletions(-) rename include/arch/{unix/i18n.h => win32/utf8.h} (98%) rename i18n/unix/utf8_ucs2.c => misc/win32/utf8.c (99%) diff --git a/apr.dsp b/apr.dsp index f1ac6750069..72ce1805c4d 100644 --- a/apr.dsp +++ b/apr.dsp @@ -157,10 +157,6 @@ SOURCE=.\file_io\win32\seek.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\i18n\unix\utf8_ucs2.c -# End Source File -# Begin Source File - SOURCE=.\i18n\unix\xlate.c # End Source File # End Group @@ -234,6 +230,10 @@ SOURCE=.\misc\win32\start.c # End Source File # Begin Source File +SOURCE=.\misc\win32\utf8.c +# End Source File +# Begin Source File + SOURCE=.\misc\unix\uuid.c # End Source File # Begin Source File @@ -420,10 +420,6 @@ SOURCE=.\include\arch\win32\fileio.h # End Source File # Begin Source File -SOURCE=.\include\arch\unix\i18n.h -# End Source File -# Begin Source File - SOURCE=.\include\arch\win32\inherit.h # End Source File # Begin Source File @@ -446,6 +442,10 @@ SOURCE=.\include\arch\win32\thread_rwlock.h SOURCE=.\include\arch\win32\threadproc.h # End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\utf8.h +# End Source File # End Group # Begin Group "Public Header Files" diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 8deec356a4c..2b5c22fcead 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -56,7 +56,7 @@ #include "apr_strings.h" #include "apr_private.h" #include "fileio.h" -#include "i18n.h" +#include "utf8.h" #if APR_HAS_DSO diff --git a/file_io/win32/open.c b/file_io/win32/open.c index c5d1c230029..99981bb50ca 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -53,7 +53,7 @@ */ #include "apr_private.h" -#include "win32/fileio.h" +#include "fileio.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_strings.h" diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 670ab9bf008..58a5dba0a9e 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -86,7 +86,7 @@ #endif #if APR_HAS_UNICODE_FS -#include "arch/unix/i18n.h" +#include "arch/win32/utf8.h" #include typedef apr_uint16_t apr_wchar_t; diff --git a/include/arch/unix/i18n.h b/include/arch/win32/utf8.h similarity index 98% rename from include/arch/unix/i18n.h rename to include/arch/win32/utf8.h index 5273e0095c1..3134f4109bf 100644 --- a/include/arch/unix/i18n.h +++ b/include/arch/win32/utf8.h @@ -52,11 +52,10 @@ * . */ -#ifndef I18N_H -#define I18N_H +#ifndef UTF8_H +#define UTF8_H #include "apr.h" -#include "apr_xlate.h" /* If we ever support anything more exciting than char... this could move. */ @@ -90,4 +89,4 @@ APR_DECLARE(apr_status_t) apr_conv_ucs2_to_utf8(const apr_wchar_t *in, char *out, apr_size_t *outbytes); -#endif /* def I18N_H */ +#endif /* def UTF8_H */ diff --git a/libapr.dsp b/libapr.dsp index d17429ce7a2..d639848fc88 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -163,10 +163,6 @@ SOURCE=.\file_io\win32\seek.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\i18n\unix\utf8_ucs2.c -# End Source File -# Begin Source File - SOURCE=.\i18n\unix\xlate.c # End Source File # End Group @@ -240,6 +236,10 @@ SOURCE=.\misc\win32\start.c # End Source File # Begin Source File +SOURCE=.\misc\win32\utf8.c +# End Source File +# Begin Source File + SOURCE=.\misc\unix\uuid.c # End Source File # Begin Source File @@ -426,10 +426,6 @@ SOURCE=.\include\arch\win32\fileio.h # End Source File # Begin Source File -SOURCE=.\include\arch\unix\i18n.h -# End Source File -# Begin Source File - SOURCE=.\include\arch\win32\inherit.h # End Source File # Begin Source File @@ -452,6 +448,10 @@ SOURCE=.\include\arch\win32\thread_rwlock.h SOURCE=.\include\arch\win32\threadproc.h # End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\utf8.h +# End Source File # End Group # Begin Group "Public Header Files" diff --git a/i18n/unix/utf8_ucs2.c b/misc/win32/utf8.c similarity index 99% rename from i18n/unix/utf8_ucs2.c rename to misc/win32/utf8.c index 3b9a5ec466b..a0aa83a8e95 100644 --- a/i18n/unix/utf8_ucs2.c +++ b/misc/win32/utf8.c @@ -52,7 +52,10 @@ * . */ -#include "i18n.h" +#include "apr.h" +#include "apr_private.h" +#include "apr_errno.h" +#include "utf8.h" /* Implement the design principal specified by RFC 2718 2.2.5 * Guidelines for new URL Schemes - within the APR. diff --git a/test/testucs.c b/test/testucs.c index 070d456d9cf..5b9b3fe1de3 100644 --- a/test/testucs.c +++ b/test/testucs.c @@ -1,5 +1,5 @@ #include "apr_xlate.h" -#include "../include/arch/unix/i18n.h" +#include "../include/misc/win32/utf8.h" #include #include From 150938d60192468f77afe91860ae9a04a2ef1d3f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Jul 2002 04:11:33 +0000 Subject: [PATCH 3683/7878] Move UUID. Not the simplest thing in the world. Note that almost all the remaining getuuid.c source should be made generic. I just grabbed what my compiler tripped over. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63696 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 12 --- include/apr.h.in | 1 + include/apr.hnw | 1 + include/apr.hw | 1 + include/apr_portable.h | 8 ++ include/apr_uuid.h | 114 -------------------- libapr.dsp | 12 --- misc/unix/Makefile.in | 3 +- misc/unix/getuuid.c | 240 ----------------------------------------- misc/unix/uuid.c | 134 ----------------------- misc/win32/getuuid.c | 81 -------------- misc/win32/rand.c | 23 +++- test/Makefile.in | 4 - test/testuuid.c | 96 ----------------- 14 files changed, 34 insertions(+), 696 deletions(-) delete mode 100644 include/apr_uuid.h delete mode 100644 misc/unix/getuuid.c delete mode 100644 misc/unix/uuid.c delete mode 100644 misc/win32/getuuid.c delete mode 100644 test/testuuid.c diff --git a/apr.dsp b/apr.dsp index 72ce1805c4d..539fb65788f 100644 --- a/apr.dsp +++ b/apr.dsp @@ -206,10 +206,6 @@ SOURCE=.\misc\unix\getopt.c # End Source File # Begin Source File -SOURCE=.\misc\win32\getuuid.c -# End Source File -# Begin Source File - SOURCE=.\misc\win32\internal.c # End Source File # Begin Source File @@ -234,10 +230,6 @@ SOURCE=.\misc\win32\utf8.c # End Source File # Begin Source File -SOURCE=.\misc\unix\uuid.c -# End Source File -# Begin Source File - SOURCE=.\misc\unix\version.c # End Source File # End Group @@ -601,10 +593,6 @@ SOURCE=.\include\apr_user.h # End Source File # Begin Source File -SOURCE=.\include\apr_uuid.h -# End Source File -# Begin Source File - SOURCE=.\include\apr_want.h # End Source File # Begin Source File diff --git a/include/apr.h.in b/include/apr.h.in index 432f1cb7eee..ea9caf16193 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -146,6 +146,7 @@ #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 0 #define APR_HAS_XTHREAD_FILES 0 +#define APR_HAS_OS_UUID 0 /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible * to poll on files/pipes. On such a system, the application can diff --git a/include/apr.hnw b/include/apr.hnw index 009b883c80a..063c9f80d90 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -209,6 +209,7 @@ #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 0 #define APR_HAS_XTHREAD_FILES 0 +#define APR_HAS_OS_UUID 0 /* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE * on all platforms. diff --git a/include/apr.hw b/include/apr.hw index 207441454c1..75a3289738b 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -297,6 +297,7 @@ extern "C" { #define APR_HAS_LARGE_FILES 0 #define APR_HAS_XTHREAD_FILES 0 #endif +#define APR_HAS_OS_UUID 1 /* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE * on all platforms. diff --git a/include/apr_portable.h b/include/apr_portable.h index d4388d63352..1b73c6caf17 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -463,6 +463,14 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **dso, */ APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso, apr_dso_handle_t *aprdso); + +#if APR_HAS_OS_UUID +/** + * Private: apr-util's apr_uuid module when supported by the platform + */ +APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data); +#endif + /** @} */ #endif /* APR_HAS_DSO */ diff --git a/include/apr_uuid.h b/include/apr_uuid.h deleted file mode 100644 index 48fe2c41f2a..00000000000 --- a/include/apr_uuid.h +++ /dev/null @@ -1,114 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/** - * @file apr_uuid.h - * @brief APR UUID library - */ -#ifndef APR_UUID_H -#define APR_UUID_H - -#include "apr.h" -#include "apr_errno.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** - * @defgroup APR_UUID UUID Handling - * @ingroup APR - * @{ - */ - -/** - * we represent a UUID as a block of 16 bytes. - */ - -typedef struct { - unsigned char data[16]; /**< the actual UUID */ -} apr_uuid_t; - -/** UUIDs are formatted as: 00112233-4455-6677-8899-AABBCCDDEEFF */ -#define APR_UUID_FORMATTED_LENGTH 36 - - -/** - * Generate and return a (new) UUID - * @param uuid The resulting UUID - */ -APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid); - -/** - * Format a UUID into a string, following the standard format - * @param buffer The buffer to place the formatted UUID string into. It must - * be at least APR_UUID_FORMATTED_LENGTH + 1 bytes long to hold - * the formatted UUID and a null terminator - * @param uuid The UUID to format - */ -APR_DECLARE(void) apr_uuid_format(char *buffer, const apr_uuid_t *uuid); - -/** - * Parse a standard-format string into a UUID - * @param uuid The resulting UUID - * @param uuid_str The formatted UUID - */ -APR_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str); - -/** @} */ -#ifdef __cplusplus -} -#endif - -#endif /* APR_UUID_H */ diff --git a/libapr.dsp b/libapr.dsp index d639848fc88..fd48cb0561a 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -212,10 +212,6 @@ SOURCE=.\misc\unix\getopt.c # End Source File # Begin Source File -SOURCE=.\misc\win32\getuuid.c -# End Source File -# Begin Source File - SOURCE=.\misc\win32\internal.c # End Source File # Begin Source File @@ -240,10 +236,6 @@ SOURCE=.\misc\win32\utf8.c # End Source File # Begin Source File -SOURCE=.\misc\unix\uuid.c -# End Source File -# Begin Source File - SOURCE=.\misc\unix\version.c # End Source File # End Group @@ -607,10 +599,6 @@ SOURCE=.\include\apr_user.h # End Source File # Begin Source File -SOURCE=.\include\apr_uuid.h -# End Source File -# Begin Source File - SOURCE=.\include\apr_want.h # End Source File # Begin Source File diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index 9d9a91f52e4..76366dbb8b9 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -2,8 +2,7 @@ srcdir = @srcdir@ VPATH = @srcdir@ TARGETS = \ - start.lo getopt.lo otherchild.lo errorcodes.lo rand.lo \ - uuid.lo getuuid.lo version.lo + start.lo getopt.lo otherchild.lo errorcodes.lo rand.lo version.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/misc/unix/getuuid.c b/misc/unix/getuuid.c deleted file mode 100644 index 97c3a9d236e..00000000000 --- a/misc/unix/getuuid.c +++ /dev/null @@ -1,240 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* - * This attempts to generate V1 UUIDs according to the Internet Draft - * located at http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt - */ - -#include /* for getpid, gethostname */ -#include /* for rand, srand */ - -#include "apr.h" -#include "apr_private.h" -#include "apr_uuid.h" -#include "apr_md5.h" -#include "apr_general.h" -#if APR_HAVE_STRING_H -#include -#endif -#if APR_HAVE_STRINGS_H -#include -#endif -#if APR_HAVE_NETDB_H -#include -#endif -#if APR_HAVE_SYS_TIME_H -#include /* for gettimeofday */ -#endif - -#define NODE_LENGTH 6 - -static int uuid_state_seqnum; -static unsigned char uuid_state_node[NODE_LENGTH] = { 0 }; - - -static void get_random_info(unsigned char node[NODE_LENGTH]) -{ -#if APR_HAS_RANDOM - - (void) apr_generate_random_bytes(node, NODE_LENGTH); - -#else - - unsigned char seed[MD5_DIGESTSIZE]; - apr_md5_ctx_t c; - - /* ### probably should revise some of this to be a bit more portable */ - - /* Leach & Salz use Linux-specific struct sysinfo; - * replace with pid/tid for portability (in the spirit of mod_unique_id) */ - struct { - /* Add thread id here, if applicable, when we get to pthread or apr */ - pid_t pid; -#ifdef NETWARE - apr_uint64_t t; -#else - struct timeval t; -#endif - char hostname[257]; - - } r; - - apr_md5_init(&c); -#ifdef NETWARE - r.pid = NXThreadGetId(); - NXGetTime(NX_SINCE_BOOT, NX_USECONDS, &(r.t)); -#else - r.pid = getpid(); - gettimeofday(&r.t, (struct timezone *)0); -#endif - gethostname(r.hostname, 256); - apr_md5_update(&c, (const unsigned char *)&r, sizeof(r)); - apr_md5_final(seed, &c); - - memcpy(node, seed, NODE_LENGTH); /* use a subset of the seed bytes */ -#endif -} - -/* This implementation generates a random node ID instead of a - system-dependent call to get IEEE node ID. This is also more secure: - we aren't passing out our MAC address. -*/ -static void get_pseudo_node_identifier(unsigned char *node) -{ - get_random_info(node); - node[0] |= 0x80; /* this designates a random node ID */ -} - -static void get_system_time(apr_uint64_t *uuid_time) -{ -#ifdef NETWARE - uint64_t sec; - - NXGetTime(NX_SINCE_1970, NX_SECONDS, &sec); - *uuid_time = (sec * 10000000) + 0x01B21DD213814000LL; -#else - struct timeval tp; - - /* ### fix this call to be more portable? */ - gettimeofday(&tp, (struct timezone *)0); - - /* Offset between UUID formatted times and Unix formatted times. - UUID UTC base time is October 15, 1582. - Unix base time is January 1, 1970. */ - *uuid_time = (tp.tv_sec * 10000000) + (tp.tv_usec * 10) + - 0x01B21DD213814000LL; -#endif -} - -/* true_random -- generate a crypto-quality random number. */ -static int true_random(void) -{ - apr_uint64_t time_now; - -#if APR_HAS_RANDOM - unsigned char buf[2]; - - if (apr_generate_random_bytes(buf, 2) == APR_SUCCESS) { - return (buf[0] << 8) | buf[1]; - } -#endif - - /* crap. this isn't crypto quality, but it will be Good Enough */ - - get_system_time(&time_now); - srand((unsigned int)(((time_now >> 32) ^ time_now) & 0xffffffff)); - - return rand() & 0x0FFFF; -} - -static void init_state(void) -{ - uuid_state_seqnum = true_random(); - get_pseudo_node_identifier(uuid_state_node); -} - -static void get_current_time(apr_uint64_t *timestamp) -{ - /* ### this needs to be made thread-safe! */ - - apr_uint64_t time_now; - static apr_uint64_t time_last = 0; - static int fudge = 0; - - get_system_time(&time_now); - - /* if clock reading changed since last UUID generated... */ - if (time_last != time_now) { - /* The clock reading has changed since the last UUID was generated. - Reset the fudge factor. if we are generating them too fast, then - the fudge may need to be reset to something greater than zero. */ - if (time_last + fudge > time_now) - fudge = time_last + fudge - time_now + 1; - else - fudge = 0; - time_last = time_now; - } - else { - /* We generated two really fast. Bump the fudge factor. */ - ++fudge; - } - - *timestamp = time_now + fudge; -} - -APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid) -{ - apr_uint64_t timestamp; - unsigned char *d = uuid->data; - - if (!uuid_state_node[0]) - init_state(); - - get_current_time(×tamp); - - d[0] = (unsigned char)timestamp; - d[1] = (unsigned char)(timestamp >> 8); - d[2] = (unsigned char)(timestamp >> 16); - d[3] = (unsigned char)(timestamp >> 24); - d[4] = (unsigned char)(timestamp >> 32); - d[5] = (unsigned char)(timestamp >> 40); - d[6] = (unsigned char)(timestamp >> 48); - d[7] = (unsigned char)(((timestamp >> 56) & 0x0F) | 0x10); - - d[8] = (unsigned char)(((uuid_state_seqnum >> 8) & 0x3F) | 0x80); - d[9] = (unsigned char)uuid_state_seqnum; - - memcpy(&d[10], uuid_state_node, NODE_LENGTH); -} diff --git a/misc/unix/uuid.c b/misc/unix/uuid.c deleted file mode 100644 index 48ed48a8d1d..00000000000 --- a/misc/unix/uuid.c +++ /dev/null @@ -1,134 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include /* for sprintf */ - -#include "apr.h" -#include "apr_uuid.h" -#include "apr_errno.h" -#include "apr_lib.h" - - -APR_DECLARE(void) apr_uuid_format(char *buffer, const apr_uuid_t *uuid) -{ - const unsigned char *d = uuid->data; - - sprintf(buffer, - "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", - d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], - d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); -} - -/* convert a pair of hex digits to an integer value [0,255] */ -static unsigned char parse_hexpair(const char *s) -{ - int result; - int temp; - - result = s[0] - '0'; - if (result > 48) - result = (result - 39) << 4; - else if (result > 16) - result = (result - 7) << 4; - else - result = result << 4; - - temp = s[1] - '0'; - if (temp > 48) - result |= temp - 39; - else if (temp > 16) - result |= temp - 7; - else - result |= temp; - - return (unsigned char)result; -} - -APR_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, - const char *uuid_str) -{ - int i; - unsigned char *d = uuid->data; - - for (i = 0; i < 36; ++i) { - char c = uuid_str[i]; - if (!apr_isxdigit(c) && - !(c == '-' && (i == 8 || i == 13 || i == 18 || i == 23))) - /* ### need a better value */ - return APR_BADARG; - } - if (uuid_str[36] != '\0') { - /* ### need a better value */ - return APR_BADARG; - } - - d[0] = parse_hexpair(&uuid_str[0]); - d[1] = parse_hexpair(&uuid_str[2]); - d[2] = parse_hexpair(&uuid_str[4]); - d[3] = parse_hexpair(&uuid_str[6]); - - d[4] = parse_hexpair(&uuid_str[9]); - d[5] = parse_hexpair(&uuid_str[11]); - - d[6] = parse_hexpair(&uuid_str[14]); - d[7] = parse_hexpair(&uuid_str[16]); - - d[8] = parse_hexpair(&uuid_str[19]); - d[9] = parse_hexpair(&uuid_str[21]); - - for (i = 6; i--;) - d[10 + i] = parse_hexpair(&uuid_str[i*2+24]); - - return APR_SUCCESS; -} diff --git a/misc/win32/getuuid.c b/misc/win32/getuuid.c deleted file mode 100644 index f04e128f7ce..00000000000 --- a/misc/win32/getuuid.c +++ /dev/null @@ -1,81 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* - * This attempts to generate V1 UUIDs according to the Internet Draft - * located at http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt - */ - -#include -#include -#include "apr.h" -#include "apr_uuid.h" - -APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid) -{ - GUID guid; - - /* Note: this call doesn't actually require CoInitialize() first - * - * XXX: This is wrong (two ways) ... one we need to test the HRESULT - * and if not S_OK (0) then we actually FAILED! - * - * Second, we should scramble the bytes or some such to eliminate the - * possible misuse/abuse since uuid is based on the NIC address, and - * is therefore not only a uniqifier, but an identity (which might not - * be appropriate in all cases. - */ - (void) CoCreateGuid(&guid); - memcpy(uuid->data, &guid, sizeof(uuid->data)); -} diff --git a/misc/win32/rand.c b/misc/win32/rand.c index ca55caebaec..0e3b47be6d9 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -52,10 +52,15 @@ * . */ +#include +#include +#include +#include "apr.h" #include "apr_private.h" #include "apr_general.h" +#include "apr_portable.h" #include "misc.h" -#include + APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, int length) @@ -78,3 +83,19 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, CryptReleaseContext(hProv, 0); return res; } + + +APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) +{ + /* Note: this call doesn't actually require CoInitialize() first + * + * XXX: we should scramble the bytes or some such to eliminate the + * possible misuse/abuse since uuid is based on the NIC address, and + * is therefore not only a uniqifier, but an identity (which might not + * be appropriate in all cases. + */ + if (FAILED(CoCreateGuid((LPGUID)uuid_data))) { + return APR_EGENERAL; + } + return APR_SUCCESS; +} diff --git a/test/Makefile.in b/test/Makefile.in index e373a3b3fa4..fc61f0d43c1 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -29,7 +29,6 @@ PROGRAMS = \ testshmconsumer@EXEEXT@ \ testpipe@EXEEXT@ \ testoc@EXEEXT@ \ - testuuid@EXEEXT@ \ testsockopt@EXEEXT@ \ testipsub@EXEEXT@ \ testpoll@EXEEXT@ \ @@ -143,9 +142,6 @@ testshmconsumer@EXEEXT@: testshmconsumer.lo $(LOCAL_LIBS) testpipe@EXEEXT@: testpipe.lo $(LOCAL_LIBS) $(LINK) testpipe.lo $(LOCAL_LIBS) $(ALL_LIBS) -testuuid@EXEEXT@: testuuid.lo $(LOCAL_LIBS) - $(LINK) testuuid.lo $(LOCAL_LIBS) $(ALL_LIBS) - testsockopt@EXEEXT@: testsockopt.lo $(LOCAL_LIBS) $(LINK) testsockopt.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/testuuid.c b/test/testuuid.c deleted file mode 100644 index 8a691d812eb..00000000000 --- a/test/testuuid.c +++ /dev/null @@ -1,96 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include -#include - -#include "apr_general.h" -#include "apr_uuid.h" - - -int main(int argc, char **argv) -{ - apr_uuid_t uuid; - apr_uuid_t uuid2; - char buf[APR_UUID_FORMATTED_LENGTH + 1]; - int retcode = 0; - - apr_initialize(); - atexit(apr_terminate); - - apr_uuid_get(&uuid); - apr_uuid_format(buf, &uuid); - printf("UUID: %s\n", buf); - - apr_uuid_parse(&uuid2, buf); - if (memcmp(&uuid, &uuid2, sizeof(uuid)) == 0) - printf("Parse appears to work.\n"); - else { - printf("ERROR: parse produced a different UUID.\n"); - retcode = 1; - } - - apr_uuid_format(buf, &uuid2); - printf("parsed/reformatted UUID: %s\n", buf); - - /* generate two of them quickly */ - apr_uuid_get(&uuid); - apr_uuid_get(&uuid2); - apr_uuid_format(buf, &uuid); - printf("UUID 1: %s\n", buf); - apr_uuid_format(buf, &uuid2); - printf("UUID 2: %s\n", buf); - - return retcode; -} From 856cef73ee42d1c549f9fcbb1f2053dc860751ce Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Jul 2002 04:55:02 +0000 Subject: [PATCH 3684/7878] Quick includes fixup [and brand an unbranded test] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63697 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/utf8.h | 2 ++ test/testucs.c | 58 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/include/arch/win32/utf8.h b/include/arch/win32/utf8.h index 3134f4109bf..5000c893085 100644 --- a/include/arch/win32/utf8.h +++ b/include/arch/win32/utf8.h @@ -56,6 +56,8 @@ #define UTF8_H #include "apr.h" +#include "apr_lib.h" +#include "apr_errno.h" /* If we ever support anything more exciting than char... this could move. */ diff --git a/test/testucs.c b/test/testucs.c index 5b9b3fe1de3..809fafffc38 100644 --- a/test/testucs.c +++ b/test/testucs.c @@ -1,5 +1,59 @@ -#include "apr_xlate.h" -#include "../include/misc/win32/utf8.h" +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "arch/win32/utf8.h" #include #include From f8d903291ac79e684bdc6f16f30d54767256f035 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Jul 2002 05:15:17 +0000 Subject: [PATCH 3685/7878] Changed APR_HAS_XLATE within apr to an APR_HAVE_ICONV feature test. Moved xlate.c into apr-util. Define APR_HAS_XLATE based on APR_HAVE_ICONV. It could become an APU_HAVE_ICONV test, but my configure.in.foo isn't that worthy. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63698 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 8 - build/nw_export.inc | 4 +- configure.in | 4 +- docs/doxygen.conf | 1 - i18n/unix/.cvsignore | 4 - i18n/unix/Makefile.in | 13 -- i18n/unix/xlate.c | 420 ------------------------------------------ include/apr.h.in | 2 +- include/apr.hnw | 4 +- include/apr.hw | 2 +- include/apr_xlate.h | 191 ------------------- libapr.dsp | 12 -- 12 files changed, 7 insertions(+), 658 deletions(-) delete mode 100644 i18n/unix/.cvsignore delete mode 100644 i18n/unix/Makefile.in delete mode 100644 i18n/unix/xlate.c delete mode 100644 include/apr_xlate.h diff --git a/apr.dsp b/apr.dsp index 539fb65788f..61f58e0c7dc 100644 --- a/apr.dsp +++ b/apr.dsp @@ -155,10 +155,6 @@ SOURCE=.\file_io\win32\seek.c # Begin Group "i18n" # PROP Default_Filter "" -# Begin Source File - -SOURCE=.\i18n\unix\xlate.c -# End Source File # End Group # Begin Group "locks" @@ -595,10 +591,6 @@ SOURCE=.\include\apr_user.h SOURCE=.\include\apr_want.h # End Source File -# Begin Source File - -SOURCE=.\include\apr_xlate.h -# End Source File # End Group # End Target # End Project diff --git a/build/nw_export.inc b/build/nw_export.inc index fff5dc5847a..85500742caa 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -24,7 +24,6 @@ #include "apr_hash.h" #include "apr_inherit.h" #include "apr_lib.h" -#include "apr_md5.h" #include "apr_mmap.h" #include "apr_network_io.h" #include "apr_poll.h" @@ -43,10 +42,9 @@ #include "apr_thread_rwlock.h" #include "apr_time.h" #include "apr_user.h" -#include "apr_uuid.h" #include "apr_version.h" #include "apr_want.h" -#include "apr_xlate.h" + /* Must include apu.h first so that we can undefine the standard prototypes macros after it messes with diff --git a/configure.in b/configure.in index 886f434f2ed..448eef6cc0a 100644 --- a/configure.in +++ b/configure.in @@ -851,7 +851,7 @@ AC_CHECK_FUNCS(crypt_r, [ crypt_r="1" ], [ crypt_r="0" ]) if test "$crypt_r" = "1"; then APR_CHECK_CRYPT_R_STYLE fi -AC_CHECK_FUNCS(iconv, [ iconv="1" ], [ iconv="0" ]) +AC_CHECK_FUNCS(iconv, [ have_iconv="1" ], [ have_iconv="0" ]) if test "$iconv" = "1"; then APR_CHECK_ICONV_INBUF fi @@ -871,7 +871,7 @@ AC_SUBST(have_inet_network) AC_SUBST(have_sigaction) AC_SUBST(have_setrlimit) AC_SUBST(have_getrlimit) -AC_SUBST(iconv) +AC_SUBST(have_iconv) AC_SUBST(mmap) AC_SUBST(have_memmove) diff --git a/docs/doxygen.conf b/docs/doxygen.conf index 9388af2f9b8..b741a1abad7 100644 --- a/docs/doxygen.conf +++ b/docs/doxygen.conf @@ -13,7 +13,6 @@ EXPAND_ONLY_PREDEF=YES # not sure why this doesn't work as EXPAND_AS_DEFINED, it should! PREDEFINED="APR_DECLARE(x)=x" \ "APR_DECLARE_NONSTD(x)=x" \ - "APR_HAS_XLATE" \ "APR_HAS_THREADS" \ DOXYGEN= diff --git a/i18n/unix/.cvsignore b/i18n/unix/.cvsignore deleted file mode 100644 index 2ebd06d3517..00000000000 --- a/i18n/unix/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -Makefile -*.lo -.libs -.deps diff --git a/i18n/unix/Makefile.in b/i18n/unix/Makefile.in deleted file mode 100644 index cd42ace99ec..00000000000 --- a/i18n/unix/Makefile.in +++ /dev/null @@ -1,13 +0,0 @@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -TARGETS = xlate.lo - -# bring in rules.mk for standard functionality -@INCLUDE_RULES@ - -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) - -# DO NOT REMOVE diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c deleted file mode 100644 index 8c6aa98f245..00000000000 --- a/i18n/unix/xlate.c +++ /dev/null @@ -1,420 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_private.h" - -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_xlate.h" - -/* If no implementation is available, don't generate code here since - * apr_xlate.h emitted macros which return APR_ENOTIMPL. - */ - -#if APR_HAS_XLATE - -#ifdef HAVE_STDDEF_H -#include /* for NULL */ -#endif -#if APR_HAVE_STRING_H -#include -#endif -#if APR_HAVE_STRINGS_H -#include -#endif -#ifdef HAVE_LANGINFO_H -#include -#endif -#ifdef HAVE_ICONV_H -#include -#endif - -#ifdef APR_ICONV_INBUF_CONST -#define ICONV_INBUF_TYPE const char ** -#else -#define ICONV_INBUF_TYPE char ** -#endif - -#ifndef min -#define min(x,y) ((x) <= (y) ? (x) : (y)) -#endif - -struct apr_xlate_t { - apr_pool_t *pool; - char *frompage; - char *topage; - char *sbcs_table; -#ifdef HAVE_ICONV - iconv_t ich; -#endif -}; - -/* get_default_charset() - * - * simple heuristic to determine codepage of source code so that - * literal strings (e.g., "GET /\r\n") in source code can be translated - * properly - * - * If appropriate, a symbol can be set at configure time to determine - * this. On EBCDIC platforms, it will be important how the code was - * unpacked. - */ - -static const char *get_default_charset(void) -{ -#ifdef __MVS__ -# ifdef __CODESET__ - return __CODESET__; -# else - return "IBM-1047"; -# endif -#endif - - if ('}' == 0xD0) { - return "IBM-1047"; - } - - if ('{' == 0xFB) { - return "EDF04"; - } - - if ('A' == 0xC1) { - return "EBCDIC"; /* not useful */ - } - - if ('A' == 0x41) { - return "ISO8859-1"; /* not necessarily true */ - } - - return "unknown"; -} - -/* get_locale_charset() - * - * If possible on this system, get the charset of the locale. Otherwise, - * defer to get_default_charset(). - */ - -static const char *get_locale_charset(void) -{ -#if defined(HAVE_NL_LANGINFO) && defined(HAVE_CODESET) - const char *charset; - charset = nl_langinfo(CODESET); - if (charset) { - return charset; - } -#endif - return get_default_charset(); -} - -static const char *handle_special_names(const char *page) -{ - if (page == APR_DEFAULT_CHARSET) { - return get_default_charset(); - } - else if (page == APR_LOCALE_CHARSET) { - return get_locale_charset(); - } - else { - return page; - } -} - -static apr_status_t apr_xlate_cleanup(void *convset) -{ -#ifdef HAVE_ICONV - apr_xlate_t *old = convset; - - if (old->ich != (iconv_t)-1) { - if (iconv_close(old->ich)) { - return errno; - } - } -#endif - return APR_SUCCESS; -} - -#ifdef HAVE_ICONV -static void check_sbcs(apr_xlate_t *convset) -{ - char inbuf[256], outbuf[256]; - char *inbufptr = inbuf; - char *outbufptr = outbuf; - apr_size_t inbytes_left, outbytes_left; - int i; - apr_size_t translated; - - for (i = 0; i < sizeof(inbuf); i++) { - inbuf[i] = i; - } - - inbytes_left = outbytes_left = sizeof(inbuf); - translated = iconv(convset->ich, (ICONV_INBUF_TYPE)&inbufptr, - &inbytes_left, &outbufptr, &outbytes_left); - if (translated != (apr_size_t) -1 && - inbytes_left == 0 && - outbytes_left == 0) { - /* hurray... this is simple translation; save the table, - * close the iconv descriptor - */ - - convset->sbcs_table = apr_palloc(convset->pool, sizeof(outbuf)); - memcpy(convset->sbcs_table, outbuf, sizeof(outbuf)); - iconv_close(convset->ich); - convset->ich = (iconv_t)-1; - - /* TODO: add the table to the cache */ - } -} -#endif /* HAVE_ICONV */ - -static void make_identity_table(apr_xlate_t *convset) -{ - int i; - convset->sbcs_table = apr_palloc(convset->pool, 256); - for (i = 0; i < 256; i++) - convset->sbcs_table[i] = i; -} - -apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, - const char *frompage, apr_pool_t *pool) -{ - apr_status_t status; - apr_xlate_t *new; - int found = 0; - - *convset = NULL; - - topage = handle_special_names(topage); - frompage = handle_special_names(frompage); - - new = (apr_xlate_t *)apr_pcalloc(pool, sizeof(apr_xlate_t)); - if (!new) { - return APR_ENOMEM; - } - - new->pool = pool; - new->topage = apr_pstrdup(pool, topage); - new->frompage = apr_pstrdup(pool, frompage); - if (!new->topage || !new->frompage) { - return APR_ENOMEM; - } - -#ifdef TODO - /* search cache of codepage pairs; we may be able to avoid the - * expensive iconv_open() - */ - - set found to non-zero if found in the cache -#endif - - if ((! found) && (strcmp(topage, frompage) == 0)) { - /* to and from are the same */ - found = 1; - make_identity_table(new); - } - -#ifdef HAVE_ICONV - if (!found) { - new->ich = iconv_open(topage, frompage); - if (new->ich == (iconv_t)-1) { - return errno; - } - found = 1; - check_sbcs(new); - } else - new->ich = (iconv_t)-1; -#endif /* HAVE_ICONV */ - - if (found) { - *convset = new; - apr_pool_cleanup_register(pool, (void *)new, apr_xlate_cleanup, - apr_pool_cleanup_null); - status = APR_SUCCESS; - } - else { - status = EINVAL; /* same as what iconv() would return if it - couldn't handle the pair */ - } - - return status; -} - -apr_status_t apr_xlate_sb_get(apr_xlate_t *convset, int *onoff) -{ - *onoff = convset->sbcs_table != NULL; - return APR_SUCCESS; -} - -apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, - apr_size_t *inbytes_left, char *outbuf, - apr_size_t *outbytes_left) -{ - apr_status_t status = APR_SUCCESS; -#ifdef HAVE_ICONV - apr_size_t translated; - - if (convset->ich != (iconv_t)-1) { - const char *inbufptr = inbuf; - char *outbufptr = outbuf; - - translated = iconv(convset->ich, (ICONV_INBUF_TYPE)&inbufptr, - inbytes_left, &outbufptr, outbytes_left); - /* If everything went fine but we ran out of buffer, don't - * report it as an error. Caller needs to look at the two - * bytes-left values anyway. - * - * There are three expected cases where rc is -1. In each of - * these cases, *inbytes_left != 0. - * a) the non-error condition where we ran out of output - * buffer - * b) the non-error condition where we ran out of input (i.e., - * the last input character is incomplete) - * c) the error condition where the input is invalid - */ - if (translated == (apr_size_t)-1) { - switch (errno) { - case E2BIG: /* out of space on output */ - status = 0; /* change table lookup code below if you - make this an error */ - break; - case EINVAL: /* input character not complete (yet) */ - status = APR_INCOMPLETE; - break; - case EILSEQ: /* bad input byte */ - status = APR_EINVAL; - break; - default: - status = errno; - } - } - } - else -#endif - { - int to_convert = min(*inbytes_left, *outbytes_left); - int converted = to_convert; - char *table = convset->sbcs_table; - - while (to_convert) { - *outbuf = table[(unsigned char)*inbuf]; - ++outbuf; - ++inbuf; - --to_convert; - } - *inbytes_left -= converted; - *outbytes_left -= converted; - } - - return status; -} - -apr_int32_t apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar) -{ - if (convset->sbcs_table) { - return convset->sbcs_table[inchar]; - } - else { - return -1; - } -} - -apr_status_t apr_xlate_close(apr_xlate_t *convset) -{ - return apr_pool_cleanup_run(convset->pool, convset, apr_xlate_cleanup); -} - -#else /* !APR_HAS_XLATE */ - -APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, - const char *topage, - const char *frompage, - apr_pool_t *pool) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, - unsigned char inchar) -{ - return (-1); -} - -APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, - const char *inbuf, - apr_size_t *inbytes_left, - char *outbuf, - apr_size_t *outbytes_left) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset) -{ - return APR_ENOTIMPL; -} - -#endif /* APR_HAS_XLATE */ - -/* Deprecated - */ -APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff) -{ - return apr_xlate_sb_get(convset, onoff); -} diff --git a/include/apr.h.in b/include/apr.h.in index ea9caf16193..a07c94be6de 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -99,6 +99,7 @@ #define APR_HAVE_CORKABLE_TCP @have_corkable_tcp@ #define APR_HAVE_GETRLIMIT @have_getrlimit@ +#define APR_HAVE_ICONV @have_iconv@ #define APR_HAVE_IN_ADDR @have_in_addr@ #define APR_HAVE_INET_ADDR @have_inet_addr@ #define APR_HAVE_INET_NETWORK @have_inet_network@ @@ -137,7 +138,6 @@ #define APR_HAS_MMAP @mmap@ #define APR_HAS_FORK @fork@ #define APR_HAS_RANDOM @rand@ -#define APR_HAS_XLATE @iconv@ #define APR_HAS_OTHER_CHILD @oc@ #define APR_HAS_DSO @aprdso@ #define APR_HAS_SO_ACCEPTFILTER @acceptfilter@ diff --git a/include/apr.hnw b/include/apr.hnw index 063c9f80d90..783fae17ac4 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -165,8 +165,9 @@ #define APR_HAVE_CORKABLE_TCP 0 #define APR_HAVE_GETRLIMIT 0 +#define APR_HAVE_ICONV 0 #define APR_HAVE_IN_ADDR 1 -#define APR_HAVE_INET_ADDR 1 +#define APR_HAVE_INET_ADDR 1 #define APR_HAVE_INET_NETWORK 0 #define APR_HAVE_IPV6 0 #define APR_HAVE_MEMCHR 1 @@ -200,7 +201,6 @@ #define APR_HAS_MMAP 0 #define APR_HAS_FORK 0 #define APR_HAS_RANDOM 1 -#define APR_HAS_XLATE 0 #define APR_HAS_OTHER_CHILD 0 #define APR_HAS_DSO 1 #define APR_HAS_SO_ACCEPTFILTER 0 diff --git a/include/apr.hw b/include/apr.hw index 75a3289738b..2368c127603 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -189,6 +189,7 @@ extern "C" { #define APR_HAVE_CORKABLE_TCP 0 #define APR_HAVE_GETRLIMIT 0 +#define APR_HAVE_ICONV 0 #define APR_HAVE_IN_ADDR 1 #define APR_HAVE_INET_ADDR 1 #define APR_HAVE_INET_NETWORK 0 @@ -280,7 +281,6 @@ extern "C" { #define APR_HAS_MMAP 1 #define APR_HAS_FORK 0 #define APR_HAS_RANDOM 1 -#define APR_HAS_XLATE 0 #define APR_HAS_OTHER_CHILD 1 #define APR_HAS_DSO 1 #define APR_HAS_SO_ACCEPTFILTER 0 diff --git a/include/apr_xlate.h b/include/apr_xlate.h deleted file mode 100644 index f9c5040ee36..00000000000 --- a/include/apr_xlate.h +++ /dev/null @@ -1,191 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_XLATE_H -#define APR_XLATE_H - -#include "apr.h" -#include "apr_pools.h" -#include "apr_errno.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** - * @file apr_xlate.h - * @brief APR I18N translation library - */ - -/** - * @defgroup APR_I18N I18N translation library - * @ingroup APR - * @{ - */ - -/** - * APR_HAS_XLATE determines whether or not useful implementations of - * apr_xlate_open() et al are provided. - * - * If APR_HAS_XLATE is zero, apr_xlate_open() et al will all return - * APR_ENOTIMPL at run-time. - */ - -typedef struct apr_xlate_t apr_xlate_t; - -/** - * Set up for converting text from one charset to another. - * @param convset The handle to be filled in by this function - * @param topage The name of the target charset - * @param frompage The name of the source charset - * @param pool The pool to use - * @remark - * Specify APR_DEFAULT_CHARSET for one of the charset - * names to indicate the charset of the source code at - * compile time. This is useful if there are literal - * strings in the source code which must be translated - * according to the charset of the source code. - * APR_DEFAULT_CHARSET is not useful if the source code - * of the caller was not encoded in the same charset as - * APR at compile time. - * - * @remark - * Specify APR_LOCALE_CHARSET for one of the charset - * names to indicate the charset of the current locale. - *

    +h=K6>4&G!9UuQ;{Bz)cT#nGd`e?4^nJYZt3sBg8Pa_< z#Hn!`zR%xPuzdL0Qs3@9Wqm;n15Izg7#r+gMKD z(ceN;2XQ>NYSrbdOCAdDv+A9YnS$5a%1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*hN!6TNbndmp17ealdh4I>0FzDM?Vb@iDOMN2~h|pCEq2 Ys_xEbb?1}I?pfW}6L;9$-Q3*%54bib761SM From 084ffde18f1630999e5c444752e54ef8ce5d1318 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Jul 2002 16:27:52 +0000 Subject: [PATCH 3602/7878] FirstBill says longlong integer divisions are near gone. Change the vote to keeping apr_time_t v.s. renaming apr_butime_t, apr_busec_t or any other name you care to propose. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63615 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/STATUS b/STATUS index 0d7f404c0b5..e1d883dffdd 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/06/28 23:15:19 $] +Last modified at [$Date: 2002/07/11 16:27:52 $] Release: @@ -58,18 +58,18 @@ RELEASE SHOWSTOPPERS: CURRENT VOTES: - * apr_time_t has proven to be a performance problem in some key - apps (like httpd-2.0) due to the need for 64-bit division to - retrieve the seconds "field." Alternatives that have been - discussed on dev@apr are: - 1) Keep the 64-bit int, but change it to use binary microseconds - (renaming the function to get rid of apr_time_t vs time_t confusion, - and having macros to convert BUSEC to USEC and back if need be) - +1: BrianP, Cliff, Brane, rbb, Jim, Thom - 2) Add a separate data type (and supporting functions) for seconds only - -0: Cliff, Brane, rbb, Jim - 3) Replace it with a struct with separate fields for sec and usec - -0: BrianP, Cliff, Brane, rbb, Thom + * apr_time_t will change to use binary microseconds based on + profiling. The last remaining question on the table is keeping + the apr_time_t designation, or changing the symbol name. + 1) Keeping the existing apr_time_t names, in spite of potential + ANSI/C99 time_t confusion. apr_types don't promise to be + system types, or map to system units. + +1: rbb, wrowe + 2) Renaming the function to get rid of apr_time_t vs time_t confusion, + which wrowe suggests apr_butime_t [binary microtime]. + +1: fielding + -0: wrowe + -0.5: rbb * For the atomics code to be efficient it depends on instructions in newer sparc models. Unfortunately this means that binaries From c857ea360b9df167cdaf863eb5228fdbad9a56c2 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Thu, 11 Jul 2002 16:37:50 +0000 Subject: [PATCH 3603/7878] Added vote on apr_time_t naming git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63616 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index e1d883dffdd..ff6d91df891 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/11 16:27:52 $] +Last modified at [$Date: 2002/07/11 16:37:50 $] Release: @@ -65,11 +65,18 @@ CURRENT VOTES: ANSI/C99 time_t confusion. apr_types don't promise to be system types, or map to system units. +1: rbb, wrowe + +0: brianp 2) Renaming the function to get rid of apr_time_t vs time_t confusion, which wrowe suggests apr_butime_t [binary microtime]. +1: fielding -0: wrowe -0.5: rbb + -1: brianp [-1 for the apr_butime_t name specifically: let's + keep the type name independent of the internal + representation, so that we don't have to + change the name the next time we change the + implementation. I'd prefer something like + apr_timeval_t, but I can live with apr_time_t.] * For the atomics code to be efficient it depends on instructions in newer sparc models. Unfortunately this means that binaries From 83dd4e0c0cc2c9a10fc5ec5a134f86e05326e99a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 11 Jul 2002 17:08:23 +0000 Subject: [PATCH 3604/7878] include the proper header file to get prototypes fix breakage in apr_connect() which caused a hard failure in mod_proxy git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63617 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 3 ++- support/unix/waitio.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 58f7fd246de..ccf2fbdd0f2 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -54,6 +54,7 @@ #include "networkio.h" #include "apr_network_io.h" +#include "apr_support.h" #include "apr_portable.h" #include "inherit.h" @@ -260,7 +261,7 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) * socket; if called again, we can see EALREADY */ if (rc == -1 && (errno == EINPROGRESS || errno == EALREADY) && sock->timeout != 0) { - rc = apr_wait_for_io_or_timeout(sock, 0); + rc = apr_wait_for_io_or_timeout(NULL, sock, 0); if (rc != APR_SUCCESS) { return rc; } diff --git a/support/unix/waitio.c b/support/unix/waitio.c index c02f1415538..cdc0ee10de3 100644 --- a/support/unix/waitio.c +++ b/support/unix/waitio.c @@ -56,6 +56,7 @@ #include "networkio.h" #include "apr_poll.h" #include "apr_errno.h" +#include "apr_support.h" /* The only case where we don't use wait_for_io_or_timeout is on * pre-BONE BeOS, so this check should be sufficient and simpler */ From 3aa246afad40f584af0cfcd1beced8093464caa5 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 11 Jul 2002 19:03:25 +0000 Subject: [PATCH 3605/7878] Votes passing in the night git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63618 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index ff6d91df891..c3617f8f9a2 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/11 16:37:50 $] +Last modified at [$Date: 2002/07/11 19:03:25 $] Release: @@ -64,12 +64,12 @@ CURRENT VOTES: 1) Keeping the existing apr_time_t names, in spite of potential ANSI/C99 time_t confusion. apr_types don't promise to be system types, or map to system units. - +1: rbb, wrowe + +1: rbb, wrowe, jerenkrantz +0: brianp 2) Renaming the function to get rid of apr_time_t vs time_t confusion, which wrowe suggests apr_butime_t [binary microtime]. +1: fielding - -0: wrowe + -0: wrowe, jerenkrantz -0.5: rbb -1: brianp [-1 for the apr_butime_t name specifically: let's keep the type name independent of the internal From 48d924cbc4c0b73ef33f6a93b879bfb9d4bed1da Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 11 Jul 2002 19:10:53 +0000 Subject: [PATCH 3606/7878] These two questions aren't orthogonal, so the votes don't all make sense. But here are my votes anyway. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63619 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index c3617f8f9a2..8d5edb2e03d 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/11 19:03:25 $] +Last modified at [$Date: 2002/07/11 19:10:53 $] Release: @@ -66,9 +66,11 @@ CURRENT VOTES: system types, or map to system units. +1: rbb, wrowe, jerenkrantz +0: brianp + -1: aaron [veto for reusing the apr_time_t identifier for a new use. + I'm ok with apr_timeval_t.] 2) Renaming the function to get rid of apr_time_t vs time_t confusion, which wrowe suggests apr_butime_t [binary microtime]. - +1: fielding + +1: fielding, aaron -0: wrowe, jerenkrantz -0.5: rbb -1: brianp [-1 for the apr_butime_t name specifically: let's From c4ab0df26daf16b173e6aa39637cd80895adee51 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 11 Jul 2002 19:17:29 +0000 Subject: [PATCH 3607/7878] Drop in my votes on this issue. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63620 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 8d5edb2e03d..94dc4dd7050 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/11 19:10:53 $] +Last modified at [$Date: 2002/07/11 19:17:29 $] Release: @@ -64,14 +64,14 @@ CURRENT VOTES: 1) Keeping the existing apr_time_t names, in spite of potential ANSI/C99 time_t confusion. apr_types don't promise to be system types, or map to system units. - +1: rbb, wrowe, jerenkrantz + +1: rbb, wrowe, jerenkrantz, striker +0: brianp -1: aaron [veto for reusing the apr_time_t identifier for a new use. I'm ok with apr_timeval_t.] 2) Renaming the function to get rid of apr_time_t vs time_t confusion, which wrowe suggests apr_butime_t [binary microtime]. +1: fielding, aaron - -0: wrowe, jerenkrantz + -0: wrowe, jerenkrantz, striker -0.5: rbb -1: brianp [-1 for the apr_butime_t name specifically: let's keep the type name independent of the internal From 60dd117536e1dfe8c4b9ff49596316dcce6ce9d8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Jul 2002 19:45:10 +0000 Subject: [PATCH 3608/7878] noone liked apr_butime_t so eliminate that part of the debate. apr_timeval_t is our running contender as the replacement for apr_time_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63621 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/STATUS b/STATUS index 94dc4dd7050..adc836872bf 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/11 19:17:29 $] +Last modified at [$Date: 2002/07/11 19:45:10 $] Release: @@ -66,19 +66,12 @@ CURRENT VOTES: system types, or map to system units. +1: rbb, wrowe, jerenkrantz, striker +0: brianp - -1: aaron [veto for reusing the apr_time_t identifier for a new use. - I'm ok with apr_timeval_t.] + -1: aaron [veto for reusing the apr_time_t identifier for a new use] 2) Renaming the function to get rid of apr_time_t vs time_t confusion, - which wrowe suggests apr_butime_t [binary microtime]. + which brianp suggests apr_timeval_t. +1: fielding, aaron -0: wrowe, jerenkrantz, striker -0.5: rbb - -1: brianp [-1 for the apr_butime_t name specifically: let's - keep the type name independent of the internal - representation, so that we don't have to - change the name the next time we change the - implementation. I'd prefer something like - apr_timeval_t, but I can live with apr_time_t.] * For the atomics code to be efficient it depends on instructions in newer sparc models. Unfortunately this means that binaries From 9cd170705521eb175cf5211ef3a1290f34e60a5e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 11 Jul 2002 20:25:38 +0000 Subject: [PATCH 3609/7878] Added pollacc.c to the build for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63622 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 + libaprnw.mcp.zip | Bin 194535 -> 194839 bytes 2 files changed, 1 insertion(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index 3b6cd9634da..8eb02f3ee79 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -271,6 +271,7 @@ FILES_lib_objs = \ $(OBJDIR)/open.o \ $(OBJDIR)/pipe.o \ $(OBJDIR)/poll.o \ + $(OBJDIR)/pollacc.o \ $(OBJDIR)/proc.o \ $(OBJDIR)/procsup.o \ $(OBJDIR)/proc_mutex.o \ diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 2f75eb89d0de2b143ffffe02dc19e797da3229dc..04c1eda009e76d7b6f70536d7564031e606ceb26 100644 GIT binary patch delta 89847 zcma&NcRXBA_&=&k)aX_((Ob0WLJ&>M&g?lMdN zk%>(Y+=rMMP66V^zZxBXJ;@*CGu4_ese8*8u#o;iJLRWPos~rPV5>&S*Ep$^$EuI< zjqzxVc(1ub8KWzr<%F%Mb@lY9b<@6;?G1BT?mH_&-_?Y{2dIe358 zZXj2pKgvmug#~#>_9vuAW>{S(K`Pe1(+I%FzcNgh9##)R(mqn1*b!S4?n?c|{bRsZ z8UWc}o<8^ZEGuGVxbreyp38=8uV=UkMp3xaA#hKD-8 z0s?J0l8nQrB~+qLakjoDInz1W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U5sPu;__L%@CJ@wZVi!^-(A zM=?)B6rj5+o2xfoGK14~8|aYw@QEJiq^b|R^MNPGb`81J1#{b*-A<>dxkS(a_hK$> ztg{JmE8_b9mBt4r%9402~W`l+9&F`qGaR6{0r#&y

    - */ -APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, - const char *topage, - const char *frompage, - apr_pool_t *pool); - -/** - * This is to indicate the charset of the sourcecode at compile time - * names to indicate the charset of the source code at - * compile time. This is useful if there are literal - * strings in the source code which must be translated - * according to the charset of the source code. - */ -#define APR_DEFAULT_CHARSET (const char *)0 -/** - * To indicate charset names of the current locale - */ -#define APR_LOCALE_CHARSET (const char *)1 - -/** - * Find out whether or not the specified conversion is single-byte-only. - * @param convset The handle allocated by apr_xlate_open, specifying the - * parameters of conversion - * @param onoff Output: whether or not the conversion is single-byte-only - */ -APR_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff); - -/** @deprecated @see apr_xlate_sb_get */ -APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff); - -/** - * Convert a buffer of text from one codepage to another. - * @param convset The handle allocated by apr_xlate_open, specifying - * the parameters of conversion - * @param inbuf The address of the source buffer - * @param inbytes_left Input: the amount of input data to be translated - * Output: the amount of input data not yet translated - * @param outbuf The address of the destination buffer - * @param outbytes_left Input: the size of the output buffer - * Output: the amount of the output buffer not yet used - */ -APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, - const char *inbuf, - apr_size_t *inbytes_left, - char *outbuf, - apr_size_t *outbytes_left); - -/* @see apr_file_io.h the comment in apr_file_io.h about this hack */ -#ifdef APR_NOT_DONE_YET -/** - * The purpose of apr_xlate_conv_char is to translate one character - * at a time. This needs to be written carefully so that it works - * with double-byte character sets. - * @param convset The handle allocated by apr_xlate_open, specifying the - * parameters of conversion - * @param inchar The character to convert - * @param outchar The converted character - */ -APR_DECLARE(apr_status_t) apr_xlate_conv_char(apr_xlate_t *convset, - char inchar, char outchar); -#endif - -/** - * Convert a single-byte character from one charset to another. - * @param convset The handle allocated by apr_xlate_open, specifying the - * parameters of conversion - * @param inchar The single-byte character to convert. - * @warning This only works when converting between single-byte character sets. - * -1 will be returned if the conversion can't be performed. - */ -APR_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, - unsigned char inchar); - -/** - * Close a codepage translation handle. - * @param convset The codepage translation handle to close - */ -APR_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset); - -/** @} */ -#ifdef __cplusplus -} -#endif - -#endif /* ! APR_XLATE_H */ diff --git a/libapr.dsp b/libapr.dsp index fd48cb0561a..a0e03cdb3d8 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -158,14 +158,6 @@ SOURCE=.\file_io\win32\readwrite.c SOURCE=.\file_io\win32\seek.c # End Source File # End Group -# Begin Group "i18n" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\i18n\unix\xlate.c -# End Source File -# End Group # Begin Group "locks" # PROP Default_Filter "" @@ -601,10 +593,6 @@ SOURCE=.\include\apr_user.h SOURCE=.\include\apr_want.h # End Source File -# Begin Source File - -SOURCE=.\include\apr_xlate.h -# End Source File # End Group # Begin Source File From ed2a96846a38c1267594a87d6c03536faebbe2c0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Jul 2002 05:26:52 +0000 Subject: [PATCH 3686/7878] Stop and breathe. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63699 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 5bedb104dc8..cf67a43b634 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Removed apr/i18n to apr-util/xlate for inclusion of apr-iconv + as required by missing libiconv. [William Rowe] + + *) Removed apr/md5 and apr/uuid into apr-util/crypto. [William Rowe] + *) Add APR_BUFFERED support to apr_os_file_put(). [Justin Erenkrantz] *) Fix misinterpretation of timeout for select() on Win32/Netware. From a92ca1be5c20f53309b7d427d62ca0555879ae42 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Jul 2002 06:17:24 +0000 Subject: [PATCH 3687/7878] Thanks Justin! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63700 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 448eef6cc0a..44efacbd658 100644 --- a/configure.in +++ b/configure.in @@ -82,7 +82,7 @@ dnl These added to allow default directories to be used... DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" -apr_modules="file_io network_io threadproc misc locks time mmap shmem i18n user memory atomic poll support" +apr_modules="file_io network_io threadproc misc locks time mmap shmem user memory atomic poll support" dnl Checks for programs. AC_PROG_MAKE_SET From 781db31e0736860579aaa8c6ae13a542ae87ffe8 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 17 Jul 2002 17:03:55 +0000 Subject: [PATCH 3688/7878] Getting ready for an API change in the NetWare libraries git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63701 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/flock.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/file_io/netware/flock.c b/file_io/netware/flock.c index 5b54c2f083a..99a085ea2d2 100644 --- a/file_io/netware/flock.c +++ b/file_io/netware/flock.c @@ -55,6 +55,7 @@ #include #include "fileio.h" +/*#define NEW_API */ apr_status_t apr_file_lock(apr_file_t *thefile, int type) { @@ -62,7 +63,12 @@ apr_status_t apr_file_lock(apr_file_t *thefile, int type) fc = (type & APR_FLOCK_NONBLOCK) ? NX_RANGE_LOCK_TRYLOCK : NX_RANGE_LOCK_CHECK; +/* Remove this #ifdef once the next NDK ships */ +#ifdef NEW_API + if(NXFileRangeLock(thefile->filedes,fc, 0, 0, NX_LOCK_RANGE_FORWARD) == -1) +#else if(NXFileRangeLock(thefile->filedes,fc, 0, 0) == -1) +#endif return errno; return APR_SUCCESS; @@ -70,7 +76,11 @@ apr_status_t apr_file_lock(apr_file_t *thefile, int type) apr_status_t apr_file_unlock(apr_file_t *thefile) { +#ifdef NEW_API + if(NXFileRangeUnlock(thefile->filedes,NX_RANGE_LOCK_CANCEL,0 , 0, NX_LOCK_RANGE_FORWARD) == -1) +#else if(NXFileRangeUnlock(thefile->filedes,NX_RANGE_LOCK_CANCEL,0 , 0) == -1) +#endif return errno; return APR_SUCCESS; From 934daf69abc90f0972a21f56022a28732364ad8e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Jul 2002 20:19:35 +0000 Subject: [PATCH 3689/7878] Skip the entire CoAPI garbage and go right for UuidCreate(), which on Win2000/XP no longer reveals the mac address. Submitted by: David Shane Holden git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63702 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 4 ++-- misc/win32/rand.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libapr.dsp b/libapr.dsp index a0e03cdb3d8..dab9ea37ff7 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -53,7 +53,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF !ELSEIF "$(CFG)" == "libapr - Win32 Debug" @@ -79,7 +79,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF !ENDIF diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 0e3b47be6d9..562e56ccc6c 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -93,9 +93,12 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) * possible misuse/abuse since uuid is based on the NIC address, and * is therefore not only a uniqifier, but an identity (which might not * be appropriate in all cases. + * + * Note that Win2000, XP and later no longer suffer from this problem, + * a scrambling fix is only needed for (apr_os_level < APR_WIN_2000) */ - if (FAILED(CoCreateGuid((LPGUID)uuid_data))) { - return APR_EGENERAL; + if (FAILED(UuidCreate((UUID *)uuid_data))) { + return APR_EGENERAL; } return APR_SUCCESS; } From b20edc0a75d02f628a5ce9aae4856657da1bad28 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Jul 2002 20:23:14 +0000 Subject: [PATCH 3690/7878] Axe an unused files group. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63703 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apr.dsp b/apr.dsp index 61f58e0c7dc..7d7b6d94860 100644 --- a/apr.dsp +++ b/apr.dsp @@ -152,10 +152,6 @@ SOURCE=.\file_io\win32\readwrite.c SOURCE=.\file_io\win32\seek.c # End Source File # End Group -# Begin Group "i18n" - -# PROP Default_Filter "" -# End Group # Begin Group "locks" # PROP Default_Filter "" From 8a601b48d8a24a22d7705d33ee3d7a0aba52b799 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Jul 2002 20:24:10 +0000 Subject: [PATCH 3691/7878] A few semirandom fixes to a mode that isn't used by much of anyone yet. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63704 13f79535-47bb-0310-9956-ffa450edef68 --- build/libapr_app.dsp | 2 +- misc/win32/apr_app.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/libapr_app.dsp b/build/libapr_app.dsp index 25fb253edd4..b84688c2051 100644 --- a/build/libapr_app.dsp +++ b/build/libapr_app.dsp @@ -91,7 +91,7 @@ SOURCE=..\misc\win32\internal.c # End Source File # Begin Source File -SOURCE=..\i18n\unix\utf8_ucs2.c +SOURCE=..\misc\win32\utf8.c # End Source File # End Target # End Project diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index e4116feb0f2..3131fc11b54 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -54,7 +54,7 @@ /* Usage Notes: * - * this module, and the i18n/unix/ucs2_utf8.c modules must be + * this module, and the misc/win32/utf8.c modules must be * compiled APR_EXPORT_STATIC and linked to an application with * the /entry:wmainCRTStartup flag. This module becomes the true * wmain entry point, and passes utf-8 reformatted argv and env From 94d908187af690c11b0a5841de545cca6ee0c83f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Jul 2002 20:53:25 +0000 Subject: [PATCH 3692/7878] Outch. The most important part, stop dragging in troublesome includes. Submitted by: David Shane Holden git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63705 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/rand.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 562e56ccc6c..68dc2b32d8d 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -52,14 +52,12 @@ * . */ -#include -#include -#include #include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_portable.h" #include "misc.h" +#include APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, From faa361453e8f67039f73f854479b56ddf6d5565e Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Thu, 18 Jul 2002 12:58:54 +0000 Subject: [PATCH 3693/7878] The HANDLE members in the STARTUPINFO struct used in the call to CreateProcess() aren't currently initialized properly... Obtained from: Rob Sacoaccio Reviewed by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63706 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ threadproc/win32/proc.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index cf67a43b634..a5fb64d17a6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) initalize handle members to invalid before calling createprocess + on win32 [Rob Saccoccio ] + *) Removed apr/i18n to apr-util/xlate for inclusion of apr-iconv as required by missing libiconv. [William Rowe] diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 89b4933185e..e3b6ef28444 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -590,6 +590,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, memset(&si, 0, sizeof(si)); si.cb = sizeof(si); + si.hStdInput = INVALID_HANDLE_VALUE; + si.hStdOutput = INVALID_HANDLE_VALUE; + si.hStdError = INVALID_HANDLE_VALUE; + if (attr->detached) { si.dwFlags |= STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; From 8d6b1fadf59da0e9fe50399f6b4ae77a327101cf Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 18 Jul 2002 19:27:38 +0000 Subject: [PATCH 3694/7878] Correct Rob's recent patch to handle both NT and 9x, and skip wasting these cycles if we aren't toggling USESTDHANDLES or have a handle to fill-in-the-blanks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63707 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 42 ++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index e3b6ef28444..1c4dd5685bb 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -590,26 +590,30 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, memset(&si, 0, sizeof(si)); si.cb = sizeof(si); - si.hStdInput = INVALID_HANDLE_VALUE; - si.hStdOutput = INVALID_HANDLE_VALUE; - si.hStdError = INVALID_HANDLE_VALUE; if (attr->detached) { si.dwFlags |= STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; } + #ifndef _WIN32_WCE if ((attr->child_in && attr->child_in->filehand) || (attr->child_out && attr->child_out->filehand) || (attr->child_err && attr->child_err->filehand)) { si.dwFlags |= STARTF_USESTDHANDLES; - if (attr->child_in) - si.hStdInput = attr->child_in->filehand; - if (attr->child_out) - si.hStdOutput = attr->child_out->filehand; - if (attr->child_err) - si.hStdError = attr->child_err->filehand; + + si.hStdInput = (attr->child_in) + ? attr->child_in->filehand + : INVALID_HANDLE_VALUE; + + si.hStdOutput = (attr->child_out) + ? attr->child_out->filehand + : INVALID_HANDLE_VALUE; + + si.hStdError = (attr->child_err) + ? attr->child_err->filehand + : INVALID_HANDLE_VALUE; } rv = CreateProcessW(wprg, wcmd, /* Executable & Command line */ NULL, NULL, /* Proc & thread security attributes */ @@ -636,21 +640,29 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, STARTUPINFOA si; memset(&si, 0, sizeof(si)); si.cb = sizeof(si); + if (attr->detached) { si.dwFlags |= STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; } + if ((attr->child_in && attr->child_in->filehand) || (attr->child_out && attr->child_out->filehand) || (attr->child_err && attr->child_err->filehand)) { si.dwFlags |= STARTF_USESTDHANDLES; - if (attr->child_in) - si.hStdInput = attr->child_in->filehand; - if (attr->child_out) - si.hStdOutput = attr->child_out->filehand; - if (attr->child_err) - si.hStdError = attr->child_err->filehand; + + si.hStdInput = (attr->child_in) + ? attr->child_in->filehand + : INVALID_HANDLE_VALUE; + + si.hStdOutput = (attr->child_out) + ? attr->child_out->filehand + : INVALID_HANDLE_VALUE; + + si.hStdError = (attr->child_err) + ? attr->child_err->filehand + : INVALID_HANDLE_VALUE; } rv = CreateProcessA(progname, cmdline, /* Command line */ From 8ad29efcec9419fe22b6d2f3d5d88a42d2d1629d Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 18 Jul 2002 23:02:19 +0000 Subject: [PATCH 3695/7878] Needed to swap the second and third parameters in the macro for NetWare. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63708 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index b289923d9b3..9277658cf78 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -165,7 +165,7 @@ APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); #define apr_atomic_set(mem, val) (*mem = val) #define apr_atomic_read(mem) (*mem) #define apr_atomic_init(pool) APR_SUCCESS -#define apr_atomic_cas(mem,with,cmp) atomic_cmpxchg(mem,with,cmp) +#define apr_atomic_cas(mem,with,cmp) atomic_cmpxchg(mem,cmp,with) #elif defined(__FreeBSD__) From 381cf14d1acc6a8e31d3c8c0689a140c563d0945 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 18 Jul 2002 23:31:35 +0000 Subject: [PATCH 3696/7878] Allow the makefiles to alter the screen name git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63709 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 86fc5ae0cd3..62b437287c9 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -20,6 +20,11 @@ ifndef NLM_THREAD_NAME NLM_THREAD_NAME = $(NLM_NAME) Thread endif +ifndef NLM_SCREEN_NAME +NLM_SCREEN_NAME = Apache for NetWare +endif + + # # Create dependency lists based on the files available # @@ -190,7 +195,7 @@ ifeq "$(RELEASE)" "debug" else @echo -sym internal >> $@ endif - @echo -screenname "Apache for NetWare" >> $@ + @echo -screenname "$(NLM_SCREEN_NAME)" >> $@ ifneq "$(NLM_VERSION)" "" @echo -nlmversion=$(NLM_VERSION) >> $@ else From aa9ad722635e1ccd05083f1b91eb9044188c5ef9 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 19 Jul 2002 11:36:19 +0000 Subject: [PATCH 3697/7878] All TABS and members present of other gangs, like the dreadful trailing spaces, were killed today in a shootout with the Style Police. Another small victory, making another small patch of source a little more pleasant to spend time in. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63710 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 85 ++++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 5199b532edd..dc99943fe95 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -83,11 +83,11 @@ typedef struct apr_hash_entry_t apr_hash_entry_t; struct apr_hash_entry_t { - apr_hash_entry_t *next; - int hash; - const void *key; - apr_ssize_t klen; - const void *val; + apr_hash_entry_t *next; + int hash; + const void *key; + apr_ssize_t klen; + const void *val; }; /* @@ -98,7 +98,7 @@ struct apr_hash_entry_t { * apr_hash_next(). */ struct apr_hash_index_t { - apr_hash_t *ht; + apr_hash_t *ht; apr_hash_entry_t *this, *next; int index; }; @@ -111,11 +111,12 @@ struct apr_hash_index_t { * collision rate. */ struct apr_hash_t { - apr_pool_t *pool; + apr_pool_t *pool; apr_hash_entry_t **array; apr_hash_index_t iterator; /* For apr_hash_first(NULL, ...) */ int count, max; }; + #define INITIAL_MAX 15 /* tunable == 2^n - 1 */ @@ -148,9 +149,10 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi) { hi->this = hi->next; while (!hi->this) { - if (hi->index > hi->ht->max) - return NULL; - hi->this = hi->ht->array[hi->index++]; + if (hi->index > hi->ht->max) + return NULL; + + hi->this = hi->ht->array[hi->index++]; } hi->next = hi->this->next; return hi; @@ -159,10 +161,11 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi) APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht) { apr_hash_index_t *hi; - if (p) + if (p) hi = apr_palloc(p, sizeof(*hi)); else hi = &ht->iterator; + hi->ht = ht; hi->index = 0; hi->this = NULL; @@ -171,9 +174,9 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht) } APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, - const void **key, - apr_ssize_t *klen, - void **val) + const void **key, + apr_ssize_t *klen, + void **val) { if (key) *key = hi->this->key; if (klen) *klen = hi->this->klen; @@ -195,10 +198,10 @@ static void expand_array(apr_hash_t *ht) new_max = ht->max * 2 + 1; new_array = alloc_array(ht, new_max); for (hi = apr_hash_first(NULL, ht); hi; hi = apr_hash_next(hi)) { - i = hi->this->hash & new_max; - hi->this->next = new_array[i]; - new_array[i] = hi->this; - } + i = hi->this->hash & new_max; + hi->this->next = new_array[i]; + new_array[i] = hi->this; + } ht->array = new_array; ht->max = new_max; } @@ -213,9 +216,9 @@ static void expand_array(apr_hash_t *ht) */ static apr_hash_entry_t **find_entry(apr_hash_t *ht, - const void *key, - apr_ssize_t klen, - const void *val) + const void *key, + apr_ssize_t klen, + const void *val) { apr_hash_entry_t **hep, *he; const unsigned char *p; @@ -271,18 +274,18 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, hash = hash * 33 + *p; } } - + /* scan linked list */ for (hep = &ht->array[hash & ht->max], he = *hep; - he; - hep = &he->next, he = *hep) { - if (he->hash == hash && - he->klen == klen && - memcmp(he->key, key, klen) == 0) - break; + he; hep = &he->next, he = *hep) { + if (he->hash == hash + && he->klen == klen + && memcmp(he->key, key, klen) == 0) + break; } if (he || !val) - return hep; + return hep; + /* add a new entry for non-NULL values */ he = apr_palloc(ht->pool, sizeof(*he)); he->next = NULL; @@ -331,21 +334,21 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, } APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, - const void *key, - apr_ssize_t klen) + const void *key, + apr_ssize_t klen) { apr_hash_entry_t *he; he = *find_entry(ht, key, klen, NULL); if (he) - return (void *)he->val; + return (void *)he->val; else - return NULL; + return NULL; } APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, - const void *key, - apr_ssize_t klen, - const void *val) + const void *key, + apr_ssize_t klen, + const void *val) { apr_hash_entry_t **hep; hep = find_entry(ht, key, klen, val); @@ -372,15 +375,15 @@ APR_DECLARE(int) apr_hash_count(apr_hash_t *ht) return ht->count; } -APR_DECLARE(apr_hash_t*) apr_hash_overlay(apr_pool_t *p, - const apr_hash_t *overlay, +APR_DECLARE(apr_hash_t*) apr_hash_overlay(apr_pool_t *p, + const apr_hash_t *overlay, const apr_hash_t *base) { return apr_hash_merge(p, overlay, base, NULL, NULL); } APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, - const apr_hash_t *overlay, + const apr_hash_t *overlay, const apr_hash_t *base, void * (*merger)(apr_pool_t *p, const void *key, @@ -402,12 +405,12 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, * as long as p */ if (!apr_pool_is_ancestor(overlay->pool, p)) { - fprintf(stderr, + fprintf(stderr, "apr_hash_overlay: overlay's pool is not an ancestor of p\n"); abort(); } if (!apr_pool_is_ancestor(base->pool, p)) { - fprintf(stderr, + fprintf(stderr, "apr_hash_overlay: base's pool is not an ancestor of p\n"); abort(); } From ce225702d4daaabcc732faa4be521e2c83960925 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 19 Jul 2002 13:02:13 +0000 Subject: [PATCH 3698/7878] Remove all iconv detection from APR. Enable iconv detection in APR-util. Submitted by: Branko Cibej Reviewed by: Sander Striker git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63711 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 31 ------------------------------- configure.in | 7 ------- include/apr.h.in | 1 - 3 files changed, 39 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index d351e4ab6f1..381ce145e5b 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -534,37 +534,6 @@ if test "$ac_cv_crypt_r_style" = "struct_crypt_data_gnu_source"; then fi ]) -dnl -dnl APR_CHECK_ICONV_INBUF -dnl -dnl Decide whether or not the inbuf parameter to iconv() is const. -dnl -dnl We try to compile something without const. If it fails to -dnl compile, we assume that the system's iconv() has const. -dnl Unfortunately, we won't realize when there was a compile -dnl warning, so we allow a variable -- apr_iconv_inbuf_const -- to -dnl be set in hints.m4 to specify whether or not iconv() has const -dnl on this parameter. -dnl -AC_DEFUN(APR_CHECK_ICONV_INBUF,[ -AC_MSG_CHECKING(for type of inbuf parameter to iconv) -if test "x$apr_iconv_inbuf_const" = "x"; then - APR_TRY_COMPILE_NO_WARNING([ - #include - #include - ],[ - iconv(0,(char **)0,(size_t *)0,(char **)0,(size_t *)0); - ], apr_iconv_inbuf_const="0", apr_iconv_inbuf_const="1") -fi -if test "$apr_iconv_inbuf_const" = "1"; then - AC_DEFINE(APR_ICONV_INBUF_CONST, 1, [Define if the inbuf parm to iconv() is const char **]) - msg="const char **" -else - msg="char **" -fi -AC_MSG_RESULT([$msg]) -])dnl - dnl the following is a newline, a space, a tab, and a backslash (the dnl backslash is used by the shell to skip newlines, but m4 sees it; diff --git a/configure.in b/configure.in index 44efacbd658..37dcf49acfe 100644 --- a/configure.in +++ b/configure.in @@ -456,7 +456,6 @@ AC_SEARCH_LIBS(gethostname, nsl) AC_CHECK_LIB(socket, socket) AC_SEARCH_LIBS(crypt, crypt ufc) AC_CHECK_LIB(truerand, main) -AC_CHECK_LIB(iconv, iconv) AC_CHECK_LIB(m, modf) dnl #----------------------------- Checking for Threads @@ -851,10 +850,6 @@ AC_CHECK_FUNCS(crypt_r, [ crypt_r="1" ], [ crypt_r="0" ]) if test "$crypt_r" = "1"; then APR_CHECK_CRYPT_R_STYLE fi -AC_CHECK_FUNCS(iconv, [ have_iconv="1" ], [ have_iconv="0" ]) -if test "$iconv" = "1"; then - APR_CHECK_ICONV_INBUF -fi AC_CHECK_FUNCS(mmap, [ mmap="1" ], [ mmap="0" ]) if test "$native_mmap_emul" = "1"; then mmap="1" @@ -871,7 +866,6 @@ AC_SUBST(have_inet_network) AC_SUBST(have_sigaction) AC_SUBST(have_setrlimit) AC_SUBST(have_getrlimit) -AC_SUBST(have_iconv) AC_SUBST(mmap) AC_SUBST(have_memmove) @@ -892,7 +886,6 @@ APR_FLAG_HEADERS( errno.h \ fcntl.h \ grp.h \ - iconv.h \ io.h \ langinfo.h \ limits.h \ diff --git a/include/apr.h.in b/include/apr.h.in index a07c94be6de..f6311bc7db7 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -99,7 +99,6 @@ #define APR_HAVE_CORKABLE_TCP @have_corkable_tcp@ #define APR_HAVE_GETRLIMIT @have_getrlimit@ -#define APR_HAVE_ICONV @have_iconv@ #define APR_HAVE_IN_ADDR @have_in_addr@ #define APR_HAVE_INET_ADDR @have_inet_addr@ #define APR_HAVE_INET_NETWORK @have_inet_network@ From 1fb0366f044b7442aa6da1ecec5fe835629b01ff Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 19 Jul 2002 17:48:33 +0000 Subject: [PATCH 3699/7878] Implemented the thread_once API's on NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63712 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/threadproc.h | 4 ++++ threadproc/netware/thread.c | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/arch/netware/threadproc.h b/include/arch/netware/threadproc.h index 3b57cd8e348..05c5f2cbb2c 100644 --- a/include/arch/netware/threadproc.h +++ b/include/arch/netware/threadproc.h @@ -100,6 +100,10 @@ struct apr_procattr_t { apr_int32_t detached; }; +struct apr_thread_once_t { + unsigned long value; +}; + //struct apr_proc_t { // apr_pool_t *pool; // pid_t pid; diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 119bba9dc4a..4856e6397b4 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -263,13 +263,17 @@ APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, apr_pool_t *p) { - return APR_ENOTIMPL; + (*control) = apr_pcalloc(p, sizeof(**control)); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, void (*func)(void)) { - return APR_ENOTIMPL; + if (!atomic_xchg(&control->value, 1)) { + func(); + } + return APR_SUCCESS; } APR_POOL_IMPLEMENT_ACCESSOR(thread) From af4bb03d977da9a2871646effa6d3750c20d3e4a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 19 Jul 2002 17:49:24 +0000 Subject: [PATCH 3700/7878] Terminate APR properly git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63713 13f79535-47bb-0310-9956-ffa450edef68 --- test/testthread.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/testthread.c b/test/testthread.c index f59cb3a5d05..c41732ccc71 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -186,6 +186,8 @@ int main(void) } printf("OK\n"); + apr_terminate(); + return 0; } From 0b06224400d1ef3b2a33c3aa68cd4e1c963ac402 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 19 Jul 2002 19:46:33 +0000 Subject: [PATCH 3701/7878] Bringing the NetWare export script up to date with other export scripts git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63714 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_nw_export.awk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index 1d848105139..e0f273b0f9e 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -51,6 +51,20 @@ function add_symbol (sym_name) { next } +/^[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(][^)]*[)]/ { + sub("[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(]", "", $0) + sub("[)].*$", "", $0) + add_symbol("apr_" $0 "_inherit_set") + next +} + +/^[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(][^)]*[)]/ { + sub("[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(]", "", $0) + sub("[)].*$", "", $0) + add_symbol("apr_" $0 "_inherit_unset") + next +} + /^[ \t]*AP[RU]?_DECLARE_DATA .*;$/ { varname = $NF; gsub( /[*;]/, "", varname); From 471f5e43ab3dc88c9f15cb423446b8cc739c46d2 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 19 Jul 2002 19:47:16 +0000 Subject: [PATCH 3702/7878] NetWare project file updates for the xlate changes to apr-util git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63715 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 194839 -> 177738 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 04c1eda009e76d7b6f70536d7564031e606ceb26..1344d6a51e9419cc2b03b2feafcd0da27bc666e0 100644 GIT binary patch delta 72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xxyp&VxNfyo&!-!-QApL(luVK3nK+)P(YiNmaczUlmSl zbe^t!Ju8~&fR+ei^RHU3WXMHyKjLvB2S=6Mh0cG#!VOP}%tPZq5U`jx6d>)UAg`Pf z9{_f!_?&UAlye?UACI3BF0kW75!$N^BCBy%N{vc^!4}V?k2Rc#wQ?R#a4}xBYY)Tv zA)KHy&CgM9mfOg0c&+uQ`(_o=9_j<2Tqd12d^}3K52P@!N@!~0j@TFm#>yookdVmD z0CG;_PmD^ssTozdlQ~C_Eo50X2gCX?Tzn^6)4bQwTeFF7G1*&8cK4fgAoNYpNm%E7h8FuY$ADhlii?zmr2?hl@Src`m zVWjIp9epG6yc|VNm(KPA*SoznH5^*jAmyOd;$9j(G^Tdu;eMKeoCSs}J5}DY!gt;L z*4Trcr7<%7I3nEO4)naZQwuORIwky0k$Ota(m_{m0z{8Uos(W(8R$n$b`*A&KI0O2 zOgB55!n zTs&z3hQyIk+`Z6M0kHX=xkF(G!r;hP(3wYR;(}Xz#mD)L=d5w&eA@}oGjBCv=MH$^ zha>v+BK3nU%}hMy`L2c3o^_2(J!y!4w}wCbuF~a$I;YIs(PBv=BZ7QbnPMwP{{N`y)S=TKXHkbr?cw))xE3b zBfEvVuT`hedVt<*w2awpPcLk$UlYuGOM_m$<5GNV8>?r$>s`{~7;~{Y=g$%|@+^}T zNp2seFv&ZRrTs?^jnz{X{c(MpoqH-BClX_Oy5Zpk zbe7nJ{2pYHk_>peBi*-X%kTNWK^`rpM;iI-<)onwsy3WFG;BV{d1Po t7z28#rK;KwzM+htFq7w&T==CW>HYUsUY=7LQ1=1tFTXlJc<;UU{twcTQ7Hfb From 19e0164df2fe8de1444980c83b80ee244b995534 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 19 Jul 2002 19:47:39 +0000 Subject: [PATCH 3703/7878] NetWare make file updates for the xlate changes to apr-util git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63716 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 9 --------- build/nw_export.inc | 6 ++++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 8eb02f3ee79..8b95c1d0188 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -241,7 +241,6 @@ FILES_lib_objs = \ $(OBJDIR)/apr_fnmatch.o \ $(OBJDIR)/apr_getpass.o \ $(OBJDIR)/apr_hash.o \ - $(OBJDIR)/apr_md5.o \ $(OBJDIR)/apr_pools.o \ $(OBJDIR)/apr_snprintf.o \ $(OBJDIR)/apr_strings.o \ @@ -261,7 +260,6 @@ FILES_lib_objs = \ $(OBJDIR)/flock.o \ $(OBJDIR)/fullrw.o \ $(OBJDIR)/getopt.o \ - $(OBJDIR)/getuuid.o \ $(OBJDIR)/groupinfo.o \ $(OBJDIR)/inet_pton.o \ $(OBJDIR)/inet_ntop.o \ @@ -293,11 +291,8 @@ FILES_lib_objs = \ $(OBJDIR)/time.o \ $(OBJDIR)/timestr.o \ $(OBJDIR)/userinfo.o \ - $(OBJDIR)/utf8_ucs2.o \ - $(OBJDIR)/uuid.o \ $(OBJDIR)/version.o \ $(OBJDIR)/waitio.o \ - $(OBJDIR)/xlate.o \ $(EOLIST) @@ -396,10 +391,6 @@ $(OBJDIR)/%.o: poll/unix/%.c $(OBJDIR)\cc.opt @echo Compiling $< $(CC) poll\unix\$( Date: Sat, 20 Jul 2002 07:43:40 +0000 Subject: [PATCH 3704/7878] Add .PHONY and .NOTPARALLEL targets to inform smarter makes that these targets are fake and can not be run in parallel. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63717 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile.in b/Makefile.in index 10d4a53f772..ac6b26eaf75 100644 --- a/Makefile.in +++ b/Makefile.in @@ -137,3 +137,6 @@ test: $(TARGET_LIB) # DO NOT REMOVE docs: $(INCDIR)/*.h + +.PHONY: delete-lib delete-exports +.NOTPARALLEL: delete-lib delete-exports From c02056c78d851c68fb43d68cbbdd8fb26b781ccb Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 20 Jul 2002 07:46:31 +0000 Subject: [PATCH 3705/7878] Enforce touching of the generated TARGET_LIB. Can't move this to the LINK definition a la LT_COMPILE since we dynamically build the LINK command line. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63718 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index ac6b26eaf75..7b5b47da4ac 100644 --- a/Makefile.in +++ b/Makefile.in @@ -97,7 +97,7 @@ $(TARGET_LIB): @for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \ tmpcmd="$(LINK) @lib_target@ @lib_target_libs@"; \ echo $$tmpcmd; \ - $$tmpcmd + $$tmpcmd && touch $@ delete-exports: @if test -f apr.exp; then \ From a36fcd07eec5bc54692b3c5bdce5c83fb33cc306 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 20 Jul 2002 07:58:41 +0000 Subject: [PATCH 3706/7878] Add optional description field to APR_CHECK_DEFINE that gets passed to AC_DEFINE, so that we can avoid having to create an acconfig.h if we use this macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63719 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 381ce145e5b..a86f1b29186 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -248,7 +248,7 @@ AC_DEFUN(APR_CHECK_DEFINE_FILES,[ dnl -dnl APR_CHECK_DEFINE( symbol, header_file ) +dnl APR_CHECK_DEFINE( symbol, header_file [, description ]) dnl AC_DEFUN(APR_CHECK_DEFINE,[ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ @@ -260,7 +260,7 @@ AC_DEFUN(APR_CHECK_DEFINE,[ ], ac_cv_define_$1=yes, ac_cv_define_$1=no) ]) if test "$ac_cv_define_$1" = "yes"; then - AC_DEFINE(HAVE_$1) + AC_DEFINE(HAVE_$1, 1, [$3]) fi ]) From aeb30b6e6e2f8132cfcf93392300fe3d81873dac Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 20 Jul 2002 08:37:26 +0000 Subject: [PATCH 3707/7878] Remove autoconf checks that were related to the now removed xlate. (This autoconf code has already been duplicated in apr-util.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63720 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 1 - configure.in | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/acconfig.h b/acconfig.h index 967bd57f629..ec0ce9167db 100644 --- a/acconfig.h +++ b/acconfig.h @@ -7,7 +7,6 @@ #undef HAVE_LOCK_EX #undef HAVE_F_SETLK #undef HAVE_SEM_UNDO -#undef HAVE_CODESET #undef HAVE_PTHREAD_PROCESS_SHARED #undef DEV_RANDOM #undef HAVE_EGD diff --git a/configure.in b/configure.in index 37dcf49acfe..ac40893ff2a 100644 --- a/configure.in +++ b/configure.in @@ -793,7 +793,7 @@ AC_SUBST(sharedmem) dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) -AC_CHECK_FUNCS(calloc strcasecmp stricmp setsid nl_langinfo isinf isnan) +AC_CHECK_FUNCS(calloc strcasecmp stricmp setsid isinf isnan) AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) AC_CHECK_FUNCS(writev) @@ -887,7 +887,6 @@ APR_FLAG_HEADERS( fcntl.h \ grp.h \ io.h \ - langinfo.h \ limits.h \ mach-o/dyld.h \ malloc.h \ @@ -1348,7 +1347,6 @@ dnl Checks for libraries. APR_CHECK_DEFINE(LOCK_EX, sys/file.h) APR_CHECK_DEFINE(F_SETLK, fcntl.h) APR_CHECK_DEFINE(SEM_UNDO, sys/sem.h) -APR_CHECK_DEFINE(CODESET, langinfo.h) # We are assuming that if the platform doesn't have POLLIN, it doesn't have # any POLL definitions. From ecc86a4dee30d0166b1a92f82fdad4d9caf2b7c8 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 20 Jul 2002 21:28:50 +0000 Subject: [PATCH 3708/7878] Added a simple index to apr_table_t to reduce the best-case execution time for table lookups from O(n) to O(1). The worst-case time remains O(n), but in httpd benchmarking this indexing reduces the mean execution time of apr_table_get() by 40% and apr_table_unset() by 60%. The indexing will make it possible to speed up apr_table_vdo() and apr_table_overlap() in the future, but I haven't changed those yet. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63721 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + tables/apr_tables.c | 283 +++++++++++++++++++++++++++++++++++++------- 2 files changed, 241 insertions(+), 45 deletions(-) diff --git a/CHANGES b/CHANGES index a5fb64d17a6..c4c11f55ea8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Added a lightweight internal index to apr_table_t to speed up + table lookup operations [Brian Pane] + *) initalize handle members to invalid before calling createprocess on win32 [Rob Saccoccio ] diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 6601a9168aa..12a5ebe8cc2 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -313,6 +313,12 @@ APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, #define CASE_MASK 0xdfdfdfdf #endif +#define TABLE_HASH_SIZE 32 +#define TABLE_INDEX_MASK 0x1f +#define TABLE_HASH(key) (TABLE_INDEX_MASK & *(unsigned char *)(key)) +#define TABLE_INDEX_IS_INITIALIZED(t, i) ((t)->index_initialized & (1 << (i))) +#define TABLE_SET_INDEX_INITIALIZED(t, i) ((t)->index_initialized |= (1 << (i))) + /* Compute the "checksum" for a key, consisting of the first * 4 bytes, normalized for case-insensitivity and packed into * an int...this checksum allows us to do a single integer @@ -355,6 +361,21 @@ struct apr_table_t { /** Who created the array. */ void *creator; #endif + /* An index to speed up table lookups. The way this works is: + * - Take the requested key and compute its checksum + * - Hash the checksum into the index: + * - index_first[TABLE_HASH(checksum)] is the offset within + * the table of the first entry with that key checksum + * - index_last[TABLE_HASH(checksum)] is the offset within + * the table of the first entry with that key checksum + * - If (and only if) there is no entry in the table whose + * checksum hashes to index element i, then the i'th bit + * of index_initialized will be zero. (Check this before + * trying to use index_first[i] or index_last[i]!) + */ + apr_uint32_t index_initialized; + int index_first[TABLE_HASH_SIZE]; + int index_last[TABLE_HASH_SIZE]; }; /* @@ -391,6 +412,7 @@ APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts) #ifdef MAKE_TABLE_PROFILE t->creator = __builtin_return_address(0); #endif + t->index_initialized = 0; return t; } @@ -410,26 +432,55 @@ APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, const apr_table_t *t) make_array_core(&new->a, p, t->a.nalloc, sizeof(apr_table_entry_t), 0); memcpy(new->a.elts, t->a.elts, t->a.nelts * sizeof(apr_table_entry_t)); new->a.nelts = t->a.nelts; + memcpy(new->index_first, t->index_first, sizeof(int) * TABLE_HASH_SIZE); + memcpy(new->index_last, t->index_last, sizeof(int) * TABLE_HASH_SIZE); + new->index_initialized = t->index_initialized; return new; } +static void table_reindex(apr_table_t *t) +{ + int i; + int hash; + apr_table_entry_t *next_elt = (apr_table_entry_t *) t->a.elts; + + t->index_initialized = 0; + for (i = 0; i < t->a.nelts; i++, next_elt++) { + hash = TABLE_HASH(next_elt->key); + t->index_last[hash] = i; + if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) { + t->index_first[hash] = i; + TABLE_SET_INDEX_INITIALIZED(t, hash); + } + } +} + APR_DECLARE(void) apr_table_clear(apr_table_t *t) { t->a.nelts = 0; + t->index_initialized = 0; } APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key) { - apr_table_entry_t *next_elt = (apr_table_entry_t *) t->a.elts; - apr_table_entry_t *end_elt = next_elt + t->a.nelts; + apr_table_entry_t *next_elt; + apr_table_entry_t *end_elt; apr_uint32_t checksum; + int hash; if (key == NULL) { return NULL; } + hash = TABLE_HASH(key); + if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) { + return NULL; + } COMPUTE_KEY_CHECKSUM(key, checksum); - for (; next_elt < end_elt; next_elt++) { + next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];; + end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash]; + + for (; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && !strcasecmp(next_elt->key, key)) { return next_elt->val; @@ -440,21 +491,36 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key) } APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, - const char *val) + const char *val) { - apr_table_entry_t *next_elt = (apr_table_entry_t *) t->a.elts; - apr_table_entry_t *end_elt = next_elt + t->a.nelts; - apr_table_entry_t *dst_elt; + apr_table_entry_t *next_elt; + apr_table_entry_t *end_elt; apr_uint32_t checksum; + int hash; COMPUTE_KEY_CHECKSUM(key, checksum); - for (; next_elt < end_elt; next_elt++) { + hash = TABLE_HASH(key); + if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) { + t->index_first[hash] = t->a.nelts; + TABLE_SET_INDEX_INITIALIZED(t, hash); + goto add_new_elt; + } + next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];; + end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash]; + + for (; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && !strcasecmp(next_elt->key, key)) { + + /* Found an existing entry with the same key, so overwrite it */ + + int must_reindex = 0; + apr_table_entry_t *dst_elt = NULL; + next_elt->val = apr_pstrdup(t->a.pool, val); - /* remove any other instances of this key */ - dst_elt = NULL; - for (next_elt++; next_elt < end_elt; next_elt++) { + + /* Remove any other instances of this key */ + for (next_elt++; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && !strcasecmp(next_elt->key, key)) { t->a.nelts--; @@ -464,13 +530,32 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, } else if (dst_elt) { *dst_elt++ = *next_elt; + must_reindex = 1; } + } + /* If we've removed anything, shift over the remainder + * of the table (note that the previous loop didn't + * run to the end of the table, just to the last match + * for the index) + */ + if (dst_elt) { + apr_table_entry_t *table_end = + ((apr_table_entry_t *) t->a.elts) + t->a.nelts; + for (; next_elt < table_end; next_elt++) { + *dst_elt++ = *next_elt; + } + must_reindex = 1; + } + if (must_reindex) { + table_reindex(t); } return; } } +add_new_elt: + t->index_last[hash] = t->a.nelts; next_elt = (apr_table_entry_t *) table_push(t); next_elt->key = apr_pstrdup(t->a.pool, key); next_elt->val = apr_pstrdup(t->a.pool, val); @@ -478,21 +563,36 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, } APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, - const char *val) + const char *val) { - apr_table_entry_t *next_elt = (apr_table_entry_t *) t->a.elts; - apr_table_entry_t *end_elt = next_elt + t->a.nelts; - apr_table_entry_t *dst_elt; + apr_table_entry_t *next_elt; + apr_table_entry_t *end_elt; apr_uint32_t checksum; + int hash; COMPUTE_KEY_CHECKSUM(key, checksum); - for (; next_elt < end_elt; next_elt++) { + hash = TABLE_HASH(key); + if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) { + t->index_first[hash] = t->a.nelts; + TABLE_SET_INDEX_INITIALIZED(t, hash); + goto add_new_elt; + } + next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];; + end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash]; + + for (; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && !strcasecmp(next_elt->key, key)) { + + /* Found an existing entry with the same key, so overwrite it */ + + int must_reindex = 0; + apr_table_entry_t *dst_elt = NULL; + next_elt->val = (char *)val; - /* remove any other instances of this key */ - dst_elt = NULL; - for (next_elt++; next_elt < end_elt; next_elt++) { + + /* Remove any other instances of this key */ + for (next_elt++; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && !strcasecmp(next_elt->key, key)) { t->a.nelts--; @@ -502,13 +602,32 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, } else if (dst_elt) { *dst_elt++ = *next_elt; + must_reindex = 1; } + } + /* If we've removed anything, shift over the remainder + * of the table (note that the previous loop didn't + * run to the end of the table, just to the last match + * for the index) + */ + if (dst_elt) { + apr_table_entry_t *table_end = + ((apr_table_entry_t *) t->a.elts) + t->a.nelts; + for (; next_elt < table_end; next_elt++) { + *dst_elt++ = *next_elt; + } + must_reindex = 1; + } + if (must_reindex) { + table_reindex(t); } return; } } +add_new_elt: + t->index_last[hash] = t->a.nelts; next_elt = (apr_table_entry_t *) table_push(t); next_elt->key = (char *)key; next_elt->val = (char *)val; @@ -517,18 +636,33 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) { - apr_table_entry_t *next_elt = (apr_table_entry_t *) t->a.elts; + apr_table_entry_t *next_elt; apr_table_entry_t *end_elt = next_elt + t->a.nelts; apr_table_entry_t *dst_elt; apr_uint32_t checksum; + int hash; + int must_reindex; + hash = TABLE_HASH(key); + if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) { + return; + } COMPUTE_KEY_CHECKSUM(key, checksum); - for (; next_elt < end_elt; next_elt++) { + next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash]; + end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash]; + must_reindex = 0; + for (; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && !strcasecmp(next_elt->key, key)) { + + /* Found a match: remove this entry, plus any additional + * matches for the same key that might follow + */ + apr_table_entry_t *table_end = ((apr_table_entry_t *) t->a.elts) + + t->a.nelts; t->a.nelts--; dst_elt = next_elt; - for (next_elt++; next_elt < end_elt; next_elt++) { + for (next_elt++; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && !strcasecmp(next_elt->key, key)) { t->a.nelts--; @@ -537,38 +671,67 @@ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) *dst_elt++ = *next_elt; } } + + /* Shift over the remainder of the table (note that + * the previous loop didn't run to the end of the table, + * just to the last match for the index) + */ + for (; next_elt < table_end; next_elt++) { + *dst_elt++ = *next_elt; + } + must_reindex = 1; break; } } + if (must_reindex) { + table_reindex(t); + } } APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, const char *val) { - apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; - int i; + apr_table_entry_t *next_elt; + apr_table_entry_t *end_elt; apr_uint32_t checksum; + int hash; COMPUTE_KEY_CHECKSUM(key, checksum); - for (i = 0; i < t->a.nelts; ++i) { - if ((checksum == elts[i].key_checksum) && !strcasecmp(elts[i].key, key)) { - elts[i].val = apr_pstrcat(t->a.pool, elts[i].val, ", ", val, NULL); - return; - } + hash = TABLE_HASH(key); + if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) { + t->index_first[hash] = t->a.nelts; + TABLE_SET_INDEX_INITIALIZED(t, hash); + goto add_new_elt; } + next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash]; + end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash]; - elts = (apr_table_entry_t *) table_push(t); - elts->key = apr_pstrdup(t->a.pool, key); - elts->val = apr_pstrdup(t->a.pool, val); - elts->key_checksum = checksum; + for (; next_elt <= end_elt; next_elt++) { + if ((checksum == next_elt->key_checksum) && + !strcasecmp(next_elt->key, key)) { + + /* Found an existing entry with the same key, so merge with it */ + next_elt->val = apr_pstrcat(t->a.pool, next_elt->val, ", ", + val, NULL); + return; + } + } + +add_new_elt: + t->index_last[hash] = t->a.nelts; + next_elt = (apr_table_entry_t *) table_push(t); + next_elt->key = apr_pstrdup(t->a.pool, key); + next_elt->val = apr_pstrdup(t->a.pool, val); + next_elt->key_checksum = checksum; } APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, const char *val) { - apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; - int i; + apr_table_entry_t *next_elt; + apr_table_entry_t *end_elt; apr_uint32_t checksum; + int hash; #ifdef POOL_DEBUG { @@ -584,17 +747,32 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, #endif COMPUTE_KEY_CHECKSUM(key, checksum); - for (i = 0; i < t->a.nelts; ++i) { - if ((checksum == elts[i].key_checksum) && !strcasecmp(elts[i].key, key)) { - elts[i].val = apr_pstrcat(t->a.pool, elts[i].val, ", ", val, NULL); - return; - } + hash = TABLE_HASH(key); + if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) { + t->index_first[hash] = t->a.nelts; + TABLE_SET_INDEX_INITIALIZED(t, hash); + goto add_new_elt; } + next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];; + end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash]; - elts = (apr_table_entry_t *) table_push(t); - elts->key = (char *)key; - elts->val = (char *)val; - elts->key_checksum = checksum; + for (; next_elt <= end_elt; next_elt++) { + if ((checksum == next_elt->key_checksum) && + !strcasecmp(next_elt->key, key)) { + + /* Found an existing entry with the same key, so merge with it */ + next_elt->val = apr_pstrcat(t->a.pool, next_elt->val, ", ", + val, NULL); + return; + } + } + +add_new_elt: + t->index_last[hash] = t->a.nelts; + next_elt = (apr_table_entry_t *) table_push(t); + next_elt->key = (char *)key; + next_elt->val = (char *)val; + next_elt->key_checksum = checksum; } APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, @@ -602,7 +780,14 @@ APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, { apr_table_entry_t *elts; apr_uint32_t checksum; + int hash; + hash = TABLE_HASH(key); + t->index_last[hash] = t->a.nelts; + if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) { + t->index_first[hash] = t->a.nelts; + TABLE_SET_INDEX_INITIALIZED(t, hash); + } COMPUTE_KEY_CHECKSUM(key, checksum); elts = (apr_table_entry_t *) table_push(t); elts->key = apr_pstrdup(t->a.pool, key); @@ -615,6 +800,7 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, { apr_table_entry_t *elts; apr_uint32_t checksum; + int hash; #ifdef POOL_DEBUG { @@ -629,6 +815,12 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, } #endif + hash = TABLE_HASH(key); + t->index_last[hash] = t->a.nelts; + if (!TABLE_INDEX_IS_INITIALIZED(t, hash)) { + t->index_first[hash] = t->a.nelts; + TABLE_SET_INDEX_INITIALIZED(t, hash); + } COMPUTE_KEY_CHECKSUM(key, checksum); elts = (apr_table_entry_t *) table_push(t); elts->key = (char *)key; @@ -664,7 +856,7 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, res->a.pool = p; copy_array_hdr_core(&res->a, &overlay->a); apr_array_cat(&res->a, &base->a); - + table_reindex(res); return res; } @@ -1108,5 +1300,6 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, elt->key_checksum = cat_keys[i].elt->key_checksum; } } + table_reindex(a); } From c3f38cf55964258af40c3926b953fc2030d11789 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 20 Jul 2002 22:51:50 +0000 Subject: [PATCH 3709/7878] remove an extraneous initialization left over from the last change to apr_table_unset git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63722 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 12a5ebe8cc2..3aa9db1f0f9 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -637,7 +637,7 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) { apr_table_entry_t *next_elt; - apr_table_entry_t *end_elt = next_elt + t->a.nelts; + apr_table_entry_t *end_elt; apr_table_entry_t *dst_elt; apr_uint32_t checksum; int hash; From ed98bc6a9e740eb957109c5bef57d76a36b21793 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 21 Jul 2002 10:51:33 +0000 Subject: [PATCH 3710/7878] Add APR_HELP_STRING macro based on httpd-2.0's APACHE_HELP_STRING macro. Obtained from: httpd-2.0 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63723 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index a86f1b29186..eb603f1a83b 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -645,3 +645,10 @@ else fi ]) +dnl APR_HELP_STRING(LHS, RHS) +dnl Autoconf 2.50 can not handle substr correctly. It does have +dnl AC_HELP_STRING, so let's try to call it if we can. +dnl Note: this define must be on one line so that it can be properly returned +dnl as the help string. When using this macro with a multi-line RHS, ensure +dnl that you surround the macro invocation with []s +AC_DEFUN(APR_HELP_STRING,[ifelse(regexp(AC_ACVERSION, 2\.1), -1, AC_HELP_STRING([$1],[$2]),[ ][$1] substr([ ],len($1))[$2])]) From 8761f121c2c8ad343dfc058bd2b4c15905ba738c Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 23 Jul 2002 17:01:57 +0000 Subject: [PATCH 3711/7878] The old macro was blowing up on some platforms that weren't using gcc. Specifically, True64 with the cc compiler. This resolves that problem by using a cleaner macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63724 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 61eb9f34828..1a3784d7312 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -167,8 +167,14 @@ const char *apr_signal_description_get(int signum) static const char *signal_description[APR_NUMSIG]; #define store_desc(index, string) \ - (assert(index < APR_NUMSIG), \ - signal_description[index] = string) + do { \ + if (index >= APR_NUMSIG) { \ + assert(index < APR_NUMSIG); \ + } \ + else { \ + signal_description[index] = string; \ + } \ + } while (0) void apr_signal_init(apr_pool_t *pglobal) { From 855fbd0e5d8b5366414a714954fa1d77b3f44b78 Mon Sep 17 00:00:00 2001 From: Karl Fogel Date: Tue, 23 Jul 2002 21:14:59 +0000 Subject: [PATCH 3712/7878] * httpd-2.0/srclib/apr/threadproc/unix/signals.c (store_desc): Make the backslash quote a newline, not a space. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63725 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 1a3784d7312..b8cfc679802 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -169,7 +169,7 @@ static const char *signal_description[APR_NUMSIG]; #define store_desc(index, string) \ do { \ if (index >= APR_NUMSIG) { \ - assert(index < APR_NUMSIG); \ + assert(index < APR_NUMSIG); \ } \ else { \ signal_description[index] = string; \ From 5014e85329393777117f80a3c513f9039c1b3752 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 24 Jul 2002 12:33:39 +0000 Subject: [PATCH 3713/7878] fix typo in comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63726 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index ac40893ff2a..0d525ef1bc3 100644 --- a/configure.in +++ b/configure.in @@ -36,7 +36,7 @@ echo "Platform: $host" dnl # Some initial steps for configuration. We setup the default directory dnl # and which files are to be configured. -dnl Set optional CC hints here in case autoconf make an inappropriate choice. +dnl Set optional CC hints here in case autoconf makes an inappropriate choice. dnl This allows us to suggest what the compiler should be, but still dnl allows the user to override CC externally. APR_CC_HINTS From 44e6ae840de1f5868d5df6180a4e5b620de6f09e Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Wed, 24 Jul 2002 14:21:28 +0000 Subject: [PATCH 3714/7878] Darwin declares sigwait() in pthread.h. Submitted by: Shantonu Sen git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63727 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_threads.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index ad96d115e57..ad3b27a1fd1 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -176,10 +176,11 @@ dnl AC_DEFUN(APR_CHECK_SIGWAIT_ONE_ARG,[ AC_CACHE_CHECK(whether sigwait takes one argument,ac_cv_sigwait_one_arg,[ AC_TRY_COMPILE([ -#ifdef __NETBSD__ +#if defined(__NETBSD__) || defined(DARWIN) /* When using the unproven-pthreads package, we need to pull in this * header to get a prototype for sigwait(). Else things will fail later * on. XXX Should probably be fixed in the unproven-pthreads package. + * Darwin is declaring sigwait() in the wrong place as well. */ #include #endif From 006e72efd564b083c8efb193b2831fe8490ac548 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 24 Jul 2002 14:35:43 +0000 Subject: [PATCH 3715/7878] Divided the cstat() memory pool into per processor memory pools to avoid having two different processors return the same memory node on an apr_palloc(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63728 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 19 ++++++++++++++----- include/arch/netware/apr_private.h | 4 ++-- misc/netware/libprews.c | 21 ++++++++++++++------- misc/netware/start.c | 2 +- 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 8bffb5e02d5..483f4b6e577 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -220,7 +220,7 @@ extern apr_int32_t CpuCurrentProcessor; /* system variable */ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *pool) { apr_hash_t *statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor); - apr_pool_t *gPool = (apr_pool_t *)getGlobalPool(); + apr_pool_t *gPool = (apr_pool_t *)getGlobalPool(CpuCurrentProcessor); apr_stat_entry_t *stat_entry; struct stat *info; apr_time_t now = apr_time_now(); @@ -233,10 +233,19 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo /* If there isn't a global pool then just stat the file and return */ if (!gPool) { - ret = stat(path, buf); - if (ret == 0) - *casedName = case_filename(pool, path); - return ret; + char poolname[50]; + + if (apr_pool_create(&gPool, NULL) != APR_SUCCESS) { + ret = stat(path, buf); + if (ret == 0) + *casedName = case_filename(pool, path); + return ret; + } + + sprintf (poolname, "cstat_mem_pool_%d", CpuCurrentProcessor); + apr_pool_tag(gPool, poolname); + + setGlobalPool(gPool, CpuCurrentProcessor); } /* If we have a statCache hash table then use it. diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 778ab539309..9df1b957ebe 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -169,8 +169,8 @@ int register_NLM(void *NLMHandle); int unregister_NLM(void *NLMHandle); /* Application global data management */ -int setGlobalPool(void *data); -void* getGlobalPool(); +int setGlobalPool(void *data, int proc); +void* getGlobalPool(int proc); int setStatCache(void *data, int proc); void* getStatCache(int proc); diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index 8213636b858..192efa519ba 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -19,7 +19,7 @@ typedef struct app_data { int initialized; - void* gPool; + void* gPool[MAX_PROCESSORS]; void* statCache[MAX_PROCESSORS]; } APP_DATA; @@ -151,26 +151,34 @@ int DisposeLibraryData(void *data) return 0; } -int setGlobalPool(void *data) +int setGlobalPool(void *data, int proc) { APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); + if ((proc < 0) || (proc > (MAX_PROCESSORS-1))) { + return 0; + } + NXLock(gLibLock); - if (app_data && !app_data->gPool) { - app_data->gPool = data; + if (app_data && !app_data->gPool[proc]) { + app_data->gPool[proc] = data; } NXUnlock(gLibLock); return 1; } -void* getGlobalPool() +void* getGlobalPool(int proc) { APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); + if ((proc < 0) || (proc > (MAX_PROCESSORS-1))) { + return NULL; + } + if (app_data) { - return app_data->gPool; + return app_data->gPool[proc]; } return NULL; @@ -181,7 +189,6 @@ int setStatCache(void *data, int proc) APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); if ((proc < 0) || (proc > (MAX_PROCESSORS-1))) { - data = NULL; return 0; } diff --git a/misc/netware/start.c b/misc/netware/start.c index 64c6c0a9d9e..fc12e21d49b 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -110,7 +110,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) } apr_signal_init(pool); - setGlobalPool((void*)pool); +// setGlobalPool((void*)pool); return APR_SUCCESS; } From 829cc3e888fb48fafb0d9446b619906e67b8bf51 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 24 Jul 2002 18:33:57 +0000 Subject: [PATCH 3716/7878] use ac_cv_prog_gcc instead of GCC in APR_TRY_COMPILE_NO_WARNING ac_cv_prog_gcc is set when appropriate in apr-util's configure, so the check for the type of the inbuf parm to iconv works again git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63729 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index eb603f1a83b..1ecb653c43a 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -422,7 +422,7 @@ AC_DEFUN(APR_TRY_COMPILE_NO_WARNING, else apr_tcnw_flags=$CFLAGS_WARN fi -if test "$GCC" = "yes"; then +if test "$ac_cv_prog_gcc" = "yes"; then apr_tcnw_flags="$apr_tcnw_flags -Werror" fi changequote(', ') From ac9ddb0c1119b9c72b7fe0b0add45c24cd157629 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Wed, 24 Jul 2002 20:29:38 +0000 Subject: [PATCH 3717/7878] Added apr_strtoll() and apr_atoll() to strings lib. Submitted by: Shantonu Sen git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63730 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 2 ++ include/apr.h.in | 1 + include/apr_strings.h | 24 ++++++++++++++++++++++++ strings/apr_strings.c | 19 +++++++++++++++++++ 5 files changed, 49 insertions(+) diff --git a/CHANGES b/CHANGES index c4c11f55ea8..b870a84ff34 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Added apr_strtoll() and apr_atoll() to strings lib. + [Shantonu Sen , Wilfredo Sanchez] + *) Added a lightweight internal index to apr_table_t to speed up table lookup operations [Brian Pane] diff --git a/configure.in b/configure.in index 0d525ef1bc3..587f1c1fbf0 100644 --- a/configure.in +++ b/configure.in @@ -1210,6 +1210,7 @@ AC_CHECK_FUNCS(strcasecmp, have_strcasecmp="1", have_strcasecmp="0") AC_CHECK_FUNCS(strdup, have_strdup="1", have_strdup="0") AC_CHECK_FUNCS(strstr, have_strstr="1", have_strstr="0") AC_CHECK_FUNCS(memchr, have_memchr="1", have_memchr="0") +AC_CHECK_FUNCS(strtoll, have_strtoll="1", have_strtoll="0") AC_SUBST(have_strnicmp) AC_SUBST(have_strncasecmp) @@ -1218,6 +1219,7 @@ AC_SUBST(have_strcasecmp) AC_SUBST(have_strdup) AC_SUBST(have_strstr) AC_SUBST(have_memchr) +AC_SUBST(have_strtoll) dnl #----------------------------- Checking for DSO support echo $ac_n "${nl}Checking for DSO...${nl}" diff --git a/include/apr.h.in b/include/apr.h.in index f6311bc7db7..1b9c7134795 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -115,6 +115,7 @@ #define APR_HAVE_STRNICMP @have_strnicmp@ #define APR_HAVE_STRSTR @have_strstr@ #define APR_HAVE_MEMCHR @have_memchr@ +#define APR_HAVE_STRTOLL @have_strtoll@ #define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@ #define APR_HAVE_UNION_SEMUN @have_union_semun@ diff --git a/include/apr_strings.h b/include/apr_strings.h index c33b835479b..0f9075e84a9 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -326,6 +326,30 @@ APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n); */ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); +/** + * parse a numeric string into a long long value + * @param buf The string to parse. It may contain optional whitespace, + * followed by an optional '+' (positive, default) or '-' (negative) + * character, followed by an optional '0x' prefix if base is 0 or 16, + * followed by numeric digits appropriate for base. + * @param end A pointer to the end of the valid character in buf. If + * not nil, it is set to the first invalid character in buf. + * @param base A numeric base in the range between 2 and 36 inclusive, + * or 0. If base is zero, buf will be treated as base ten unless its + * digits are prefixed with '0x', in which case it will be treated as + * base 16. + * @return The long long value of the string. + */ +APR_DECLARE(long long) apr_strtoll(char *buf, char **end, int base); + +/** + * parse a base-10 numeric string into a long long value. + * Equivalent to apr_strtoll(buf, (char**)NULL, 10). + * @param buf The string to parse + * @return The long long value of the string + */ +APR_DECLARE(long long) apr_atoll(char *buf); + /** * Format a binary size (magnitiudes are 2^10 rather than 10^3) from an apr_off_t, * as bytes, K, M, T, etc, to a four character compacted human readable string. diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 4dd000d6b84..aa870fd039c 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -65,6 +65,10 @@ #include /* NULL */ #endif +#ifdef HAVE_STDLIB_H +#include /* strtol and strtoll */ +#endif + /** this is used to cache lengths in apr_pstrcat */ #define MAX_SAVED_LENGTHS 6 @@ -229,6 +233,21 @@ void *memchr(const void *s, int c, size_t n) } #endif +APR_DECLARE(long long) apr_strtoll(char *buf, char **end, int base) +{ +#if (APR_HAVE_STRTOLL) + return strtoll(buf, NULL, 0); +#else + /* best-effort function. If no strtoll, use strtol */ + return (long long)strtol(buf, NULL, 0); +#endif +} + +APR_DECLARE(long long) apr_atoll(char *buf) +{ + return apr_strtoll(buf, NULL, 0); +} + APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n) { const int BUFFER_SIZE = sizeof(int) * 3 + 2; From 6e115d8e631195001949a6190f38c803e44768ba Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 24 Jul 2002 21:23:50 +0000 Subject: [PATCH 3718/7878] add some needed const to apr_strtoll and apr_atoll fix the parms to strtol[l] in apr_strtoll git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63731 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 4 ++-- strings/apr_strings.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index 0f9075e84a9..ad09495e9c4 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -340,7 +340,7 @@ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); * base 16. * @return The long long value of the string. */ -APR_DECLARE(long long) apr_strtoll(char *buf, char **end, int base); +APR_DECLARE(long long) apr_strtoll(const char *buf, char **end, int base); /** * parse a base-10 numeric string into a long long value. @@ -348,7 +348,7 @@ APR_DECLARE(long long) apr_strtoll(char *buf, char **end, int base); * @param buf The string to parse * @return The long long value of the string */ -APR_DECLARE(long long) apr_atoll(char *buf); +APR_DECLARE(long long) apr_atoll(const char *buf); /** * Format a binary size (magnitiudes are 2^10 rather than 10^3) from an apr_off_t, diff --git a/strings/apr_strings.c b/strings/apr_strings.c index aa870fd039c..98a21d4a632 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -233,17 +233,17 @@ void *memchr(const void *s, int c, size_t n) } #endif -APR_DECLARE(long long) apr_strtoll(char *buf, char **end, int base) +APR_DECLARE(long long) apr_strtoll(const char *buf, char **end, int base) { #if (APR_HAVE_STRTOLL) - return strtoll(buf, NULL, 0); + return strtoll(buf, end, base); #else /* best-effort function. If no strtoll, use strtol */ - return (long long)strtol(buf, NULL, 0); + return (long long)strtol(buf, end, base); #endif } -APR_DECLARE(long long) apr_atoll(char *buf) +APR_DECLARE(long long) apr_atoll(const char *buf) { return apr_strtoll(buf, NULL, 0); } From 6bd8ff14df78f0f8daccaaa047603522248d2e77 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Wed, 24 Jul 2002 23:31:57 +0000 Subject: [PATCH 3719/7878] Use apr_int64_t instead of long long as return type for apr_strtoll() and apr_atol(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63732 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 12 ++++++------ strings/apr_strings.c | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index ad09495e9c4..58c61bda4fa 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -327,7 +327,7 @@ APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n); APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); /** - * parse a numeric string into a long long value + * parse a numeric string into a 64-bit numeric value * @param buf The string to parse. It may contain optional whitespace, * followed by an optional '+' (positive, default) or '-' (negative) * character, followed by an optional '0x' prefix if base is 0 or 16, @@ -338,17 +338,17 @@ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); * or 0. If base is zero, buf will be treated as base ten unless its * digits are prefixed with '0x', in which case it will be treated as * base 16. - * @return The long long value of the string. + * @return The numeric value of the string. */ -APR_DECLARE(long long) apr_strtoll(const char *buf, char **end, int base); +APR_DECLARE(apr_int64_t) apr_strtoll(const char *buf, char **end, int base); /** - * parse a base-10 numeric string into a long long value. + * parse a base-10 numeric string into a 64-bit numeric value. * Equivalent to apr_strtoll(buf, (char**)NULL, 10). * @param buf The string to parse - * @return The long long value of the string + * @return The numeric value of the string */ -APR_DECLARE(long long) apr_atoll(const char *buf); +APR_DECLARE(apr_int64_t) apr_atoll(const char *buf); /** * Format a binary size (magnitiudes are 2^10 rather than 10^3) from an apr_off_t, diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 98a21d4a632..dddf694b1e9 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -233,17 +233,17 @@ void *memchr(const void *s, int c, size_t n) } #endif -APR_DECLARE(long long) apr_strtoll(const char *buf, char **end, int base) +APR_DECLARE(apr_int64_t) apr_strtoll(const char *buf, char **end, int base) { #if (APR_HAVE_STRTOLL) - return strtoll(buf, end, base); + return (apr_int64_t)strtoll(buf, end, base); #else /* best-effort function. If no strtoll, use strtol */ - return (long long)strtol(buf, end, base); + return (apr_int64_t)strtol(buf, end, base); #endif } -APR_DECLARE(long long) apr_atoll(const char *buf) +APR_DECLARE(apr_int64_t) apr_atoll(const char *buf) { return apr_strtoll(buf, NULL, 0); } From 48919c77c7f9c90683349a71b9557bfb096754d7 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 26 Jul 2002 07:55:57 +0000 Subject: [PATCH 3720/7878] Style Police patrolling again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63733 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 79 +++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 42 deletions(-) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 5ab44cf5bfa..e450ecdf0bb 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -75,6 +75,7 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_int32_t flags, apr_pool_t *p) { char path[APR_PATH_MAX]; + if (!getcwd(path, sizeof(path))) { if (errno == ERANGE) return APR_ENAMETOOLONG; @@ -82,8 +83,9 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_int32_t flags, return errno; } *defpath = apr_pstrdup(p, path); + return APR_SUCCESS; -} +} /* Any OS that requires/refuses trailing slashes should be dealt with here @@ -92,29 +94,30 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p) { if (chdir(path) != 0) return errno; + return APR_SUCCESS; -} +} -APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, +APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, const char **inpath, apr_int32_t flags, apr_pool_t *p) { - if (**inpath == '/') - { + if (**inpath == '/') { *rootpath = apr_pstrdup(p, "/"); do { ++(*inpath); } while (**inpath == '/'); + return APR_SUCCESS; } return APR_ERELATIVE; } -APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, - const char *rootpath, - const char *addpath, +APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, + const char *rootpath, + const char *addpath, apr_int32_t flags, apr_pool_t *p) { @@ -131,8 +134,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, if (!addpath) addpath = ""; - if (addpath[0] == '/') - { + if (addpath[0] == '/') { /* If addpath is rooted, then rootpath is unused. * Ths violates any APR_FILEPATH_SECUREROOTTEST and * APR_FILEPATH_NOTABSOLUTE flags specified. @@ -149,15 +151,13 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, if (!rootpath && !(flags & APR_FILEPATH_NOTABOVEROOT)) rootpath = ""; } - else - { - /* If APR_FILEPATH_NOTABSOLUTE is specified, the caller + else { + /* If APR_FILEPATH_NOTABSOLUTE is specified, the caller * requires a relative result. If the rootpath is * ommitted, we do not retrieve the working path, * if rootpath was supplied as absolute then fail. */ - if (flags & APR_FILEPATH_NOTABSOLUTE) - { + if (flags & APR_FILEPATH_NOTABSOLUTE) { if (!rootpath) rootpath = ""; else if (rootpath[0] == '/') @@ -165,8 +165,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } } - if (!rootpath) - { + if (!rootpath) { /* Start with the current working path. This is bass akwards, * but required since the compiler (at least vc) doesn't like * passing the address of a char const* for a char** arg. @@ -176,7 +175,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, rootpath = getpath; if (rv != APR_SUCCESS) return errno; - + /* XXX: Any kernel subject to goofy, uncanonical results * must run the rootpath against the user's given flags. * Simplest would be a recursive call to apr_filepath_merge @@ -193,9 +192,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } path = (char *)apr_palloc(p, maxlen); - if (addpath[0] == '/') - { - /* Ignore the given root path, strip off leading + if (addpath[0] == '/') { + /* Ignore the given root path, strip off leading * '/'s to a single leading '/' from the addpath, * and leave addpath at the first non-'/' character. */ @@ -205,18 +203,17 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, path[0] = '/'; pathlen = 1; } - else - { + else { /* If both paths are relative, fail early */ if (rootpath[0] != '/' && (flags & APR_FILEPATH_NOTRELATIVE)) - return APR_ERELATIVE; + return APR_ERELATIVE; /* Base the result path on the rootpath */ keptlen = rootlen; memcpy(path, rootpath, rootlen); - + /* Always '/' terminate the given root path */ if (keptlen && path[keptlen - 1] != '/') { @@ -225,9 +222,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, pathlen = keptlen; } - while (*addpath) - { - /* Parse each segment, find the closing '/' + while (*addpath) { + /* Parse each segment, find the closing '/' */ const char *next = addpath; while (*next && (*next != '/')) { @@ -236,13 +232,13 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, seglen = next - addpath; if (seglen == 0 || (seglen == 1 && addpath[0] == '.')) { - /* noop segment (/ or ./) so skip it + /* noop segment (/ or ./) so skip it */ } else if (seglen == 2 && addpath[0] == '.' && addpath[1] == '.') { /* backpath (../) */ if (pathlen == 1 && path[0] == '/') { - /* Attempt to move above root. Always die if the + /* Attempt to move above root. Always die if the * APR_FILEPATH_SECUREROOTTEST flag is specified. */ if (flags & APR_FILEPATH_SECUREROOTTEST) { @@ -254,9 +250,11 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, */ keptlen = 0; } - else if (pathlen == 0 - || (pathlen == 3 && !memcmp(path + pathlen - 3, "../", 3)) - || (pathlen > 3 && !memcmp(path + pathlen - 4, "/../", 4))) { + else if (pathlen == 0 + || (pathlen == 3 + && !memcmp(path + pathlen - 3, "../", 3)) + || (pathlen > 3 + && !memcmp(path + pathlen - 4, "/../", 4))) { /* Path is already backpathed or empty, if the * APR_FILEPATH_SECUREROOTTEST.was given die now. */ @@ -269,9 +267,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, memcpy(path + pathlen, "../", 3); pathlen += 3; } - else - { - /* otherwise crop the prior segment + else { + /* otherwise crop the prior segment */ do { --pathlen; @@ -281,16 +278,14 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* Now test if we are above where we started and back up * the keptlen offset to reflect the added/altered path. */ - if (pathlen < keptlen) - { + if (pathlen < keptlen) { if (flags & APR_FILEPATH_SECUREROOTTEST) { return APR_EABOVEROOT; } keptlen = pathlen; } } - else - { + else { /* An actual segment, append it to the destination path */ if (*next) { @@ -309,7 +304,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, addpath = next; } path[pathlen] = '\0'; - + /* keptlen will be the rootlen unless the addpath contained * backpath elements. If so, and APR_FILEPATH_NOTABOVEROOT * is specified (APR_FILEPATH_SECUREROOTTEST was caught above), @@ -325,7 +320,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, return APR_EABOVEROOT; } } - + *newpath = path; return APR_SUCCESS; } From 353032ba55486c285df302869fcba045f35c8782 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 27 Jul 2002 21:45:06 +0000 Subject: [PATCH 3721/7878] Updated apr_table_vdo() to take advantage of the indexing recently added to tables. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63734 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 3aa9db1f0f9..c4181ffe45f 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -951,19 +951,32 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, { char *argp; apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; - int vdorv = 1, rv, i; + int vdorv = 1; argp = va_arg(vp, char *); do { - apr_uint32_t checksum = 0; + int rv = 1, i; if (argp) { - COMPUTE_KEY_CHECKSUM(argp, checksum); + /* Scan for entries that match the next key */ + int hash = TABLE_HASH(argp); + if (TABLE_INDEX_IS_INITIALIZED(t, hash)) { + apr_uint32_t checksum; + COMPUTE_KEY_CHECKSUM(argp, checksum); + for (i = t->index_first[hash]; + rv && (i <= t->index_last[hash]); ++i) { + if (elts[i].key && (checksum == elts[i].key_checksum) && + !strcasecmp(elts[i].key, argp)) { + rv = (*comp) (rec, elts[i].key, elts[i].val); + } + } + } } - for (rv = 1, i = 0; rv && (i < t->a.nelts); ++i) { - if (elts[i].key && (!argp || - ((checksum == elts[i].key_checksum) && - !strcasecmp(elts[i].key, argp)))) { - rv = (*comp) (rec, elts[i].key, elts[i].val); + else { + /* Scan the entire table */ + for (i = 0; rv && (i < t->a.nelts); ++i) { + if (elts[i].key) { + rv = (*comp) (rec, elts[i].key, elts[i].val); + } } } if (rv == 0) { From 92ddad9fcd74dd28636bbb2bc3ca865e9c4ed6e4 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 27 Jul 2002 22:59:20 +0000 Subject: [PATCH 3722/7878] Fixed a bug in apr_table_set/setn from an earlier change: entries at the end of the table weren't being properly shifted when apr_table_set/setn removed duplicate keys (found using "testtable" in apr/test) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63735 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index c4181ffe45f..8e5107520af 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -495,6 +495,7 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, { apr_table_entry_t *next_elt; apr_table_entry_t *end_elt; + apr_table_entry_t *table_end; apr_uint32_t checksum; int hash; @@ -507,6 +508,7 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, } next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];; end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash]; + table_end =((apr_table_entry_t *) t->a.elts) + t->a.nelts; for (; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && @@ -540,8 +542,6 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, * for the index) */ if (dst_elt) { - apr_table_entry_t *table_end = - ((apr_table_entry_t *) t->a.elts) + t->a.nelts; for (; next_elt < table_end; next_elt++) { *dst_elt++ = *next_elt; } @@ -567,6 +567,7 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, { apr_table_entry_t *next_elt; apr_table_entry_t *end_elt; + apr_table_entry_t *table_end; apr_uint32_t checksum; int hash; @@ -579,6 +580,7 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, } next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];; end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash]; + table_end =((apr_table_entry_t *) t->a.elts) + t->a.nelts; for (; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && @@ -612,8 +614,6 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, * for the index) */ if (dst_elt) { - apr_table_entry_t *table_end = - ((apr_table_entry_t *) t->a.elts) + t->a.nelts; for (; next_elt < table_end; next_elt++) { *dst_elt++ = *next_elt; } From d23539c84466d5cb4d2ca074d5f6c460647b3d12 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 27 Jul 2002 23:17:48 +0000 Subject: [PATCH 3723/7878] Added an apr_table_overlap() test git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63736 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtable.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/test/testtable.c b/test/testtable.c index 5c26865cd89..97c926eaacc 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -70,7 +70,7 @@ int main(int argc, const char *const argv[]) { apr_pool_t *p; - apr_table_t *t1; + apr_table_t *t1, *t2; const char *val; @@ -80,6 +80,7 @@ int main(int argc, const char *const argv[]) apr_pool_create(&p, NULL); t1 = apr_table_make(p, 5); + t2 = apr_table_make(p, 5); fprintf(stderr, "Test 1: apr_table_set..."); apr_table_set(t1, "foo", "bar"); @@ -135,5 +136,33 @@ int main(int argc, const char *const argv[]) } fprintf(stderr, "OK\n"); + fprintf(stderr, "Test 5: apr_table_overlap..."); + apr_table_clear(t1); + apr_table_addn(t1, "a", "0"); + apr_table_addn(t1, "g", "7"); + apr_table_clear(t2); + apr_table_addn(t2, "a", "1"); + apr_table_addn(t2, "b", "2"); + apr_table_addn(t2, "c", "3"); + apr_table_addn(t2, "b", "2.0"); + apr_table_addn(t2, "d", "4"); + apr_table_addn(t2, "e", "5"); + apr_table_addn(t2, "b", "2."); + apr_table_addn(t2, "f", "6"); + apr_table_overlap(t1, t2, APR_OVERLAP_TABLES_SET); + if ((apr_table_elts(t1)->nelts != 7) || + !(val = apr_table_get(t1, "a")) || strcmp(val, "1") || + !(val = apr_table_get(t1, "b")) || strcmp(val, "2") || + !(val = apr_table_get(t1, "c")) || strcmp(val, "3") || + !(val = apr_table_get(t1, "d")) || strcmp(val, "4") || + !(val = apr_table_get(t1, "e")) || strcmp(val, "5") || + !(val = apr_table_get(t1, "f")) || strcmp(val, "6") || + !(val = apr_table_get(t1, "g")) || strcmp(val, "7") || + (apr_table_get(t1, "h") != NULL)) { + fprintf(stderr, "ERROR\n"); + exit(-1); + } + fprintf(stderr, "OK\n"); + return 0; } From 7d3fa2784b1620e4ea2577cea71ef709216fb403 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 27 Jul 2002 23:43:20 +0000 Subject: [PATCH 3724/7878] Optimization for apr_table_overlap(): because the destination array is pre-allocated to ensure that it's big enough to hold the result table, just use simple pointer arithmetic to write to successive elements, rather than calling the array push function git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63737 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 8e5107520af..3d59d310532 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -1211,6 +1211,7 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, int nhash; int i; apr_table_entry_t *elts; + apr_table_entry_t *dst_elt; max_keys = a->a.nelts + b->a.nelts; if (!max_keys) { @@ -1265,6 +1266,7 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, */ make_array_core(&a->a, b->a.pool, max_keys, sizeof(apr_table_entry_t), 0); nkeys = 0; + dst_elt = (apr_table_entry_t *)a->a.elts; for (i = 0; i < max_keys; i++) { if (cat_keys[i].skip) { continue; @@ -1301,18 +1303,19 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, next = next->merge_next; } while (next); *val_next = 0; - elt = (apr_table_entry_t *)table_push(a); - elt->key = cat_keys[i].elt->key; - elt->val = new_val; - elt->key_checksum = cat_keys[i].elt->key_checksum; + dst_elt->key = cat_keys[i].elt->key; + dst_elt->val = new_val; + dst_elt->key_checksum = cat_keys[i].elt->key_checksum; + dst_elt++; } else { - apr_table_entry_t *elt = (apr_table_entry_t *)table_push(a); - elt->key = cat_keys[i].elt->key; - elt->val = cat_keys[i].elt->val; - elt->key_checksum = cat_keys[i].elt->key_checksum; + dst_elt->key = cat_keys[i].elt->key; + dst_elt->val = cat_keys[i].elt->val; + dst_elt->key_checksum = cat_keys[i].elt->key_checksum; + dst_elt++; } } + a->a.nelts = dst_elt - (apr_table_entry_t *)a->a.elts; table_reindex(a); } From 020fa89b14557a2ae96ee910bd40ba433a377d71 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 29 Jul 2002 05:00:33 +0000 Subject: [PATCH 3725/7878] Inherited socket()'s considered harmful on win32. Specifically, we can never use an inherited handle directly, we must use WSADuplicateSocket. So this code cleans up that issue, and prepares us to eliminate the make_listeners_noninherited() code from the winnt mpm. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63738 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 774b0223853..37a60ea64f6 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -59,6 +59,7 @@ #include "apr_portable.h" #include #include "inherit.h" +#include "misc.h" static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */ @@ -129,6 +130,42 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, if ((*new)->socketdes == INVALID_SOCKET) { return apr_get_netos_error(); } + +#ifdef WIN32 + /* Socket handles are never truly inheritable, there are too many + * bugs associated. WSADuplicateSocket will copy them, but for our + * purposes, always transform the socket() created as a non-inherited + * handle + */ +#if APR_HAS_UNICODE_FS + IF_WIN_OS_IS_UNICODE { + /* A different approach. Many users report errors such as + * (32538)An operation was attempted on something that is not + * a socket. : Parent: WSADuplicateSocket failed... + * + * This appears that the duplicated handle is no longer recognized + * as a socket handle. SetHandleInformation should overcome that + * problem by not altering the handle identifier. But this won't + * work on 9x - it's unsupported. + */ + SetHandleInformation((HANDLE) (*new)->socketdes, + HANDLE_FLAG_INHERIT, 0); + } +#endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { + HANDLE hProcess = GetCurrentProcess(); + HANDLE dup; + if (DuplicateHandle(hProcess, (HANDLE) (*new)->socketdes, hProcess, + &dup, 0, FALSE, DUPLICATE_SAME_ACCESS)) { + closesocket((*new)->socketdes); + (*new)->socketdes = (SOCKET) dup; + } + } +#endif + +#endif /* def WIN32 */ + set_socket_vars(*new, family, type); (*new)->timeout = -1; From 20a1391df541a7cce45dd52e89bb3679c0f96962 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 29 Jul 2002 11:22:28 +0000 Subject: [PATCH 3726/7878] zap an unused variable git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63739 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 3d59d310532..74d7d7770f2 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -1272,7 +1272,6 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, continue; } if (cat_keys[i].merge_next) { - apr_table_entry_t *elt; char *new_val; char *val_next; overlap_key *next = cat_keys[i].merge_next; From 3b86bc16321d87688c38ee01f95674f17a8c2593 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 29 Jul 2002 22:30:52 +0000 Subject: [PATCH 3727/7878] NetWare has strtoll() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63740 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr.hnw b/include/apr.hnw index 783fae17ac4..c00ede954d4 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -117,6 +117,7 @@ #define APR_HAVE_STDLIB_H 1 #define APR_HAVE_STRING_H 1 #define APR_HAVE_STRINGS_H 0 +#define APR_HAVE_STRTOLL 1 #define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 From 45727a515395e59e80fbddb385259fea3bb9fe67 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 30 Jul 2002 13:56:17 +0000 Subject: [PATCH 3728/7878] axe some checks for out-of-storage which are not helpful; we'd already have segfaulted at this point and we don't normally perform such checks anyway git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63741 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 7 ------- network_io/unix/sockets.c | 4 ---- network_io/win32/sockets.c | 7 ------- 3 files changed, 18 deletions(-) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 0c2d5baa3f6..5e8312311ae 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -118,13 +118,6 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int alloc_socket(new, cont); - if ((*new) == NULL) { - return APR_ENOMEM; - } - if ((*new)->local_addr == NULL || (*new)->remote_addr == NULL) { - return APR_ENOMEM; - } - (*new)->socketdes = socket(family, type, 0); #if APR_HAVE_IPV6 if ((*new)->socketdes < 0 && downgrade) { diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index ccf2fbdd0f2..057e56fdcaf 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -118,10 +118,6 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, alloc_socket(new, cont); - if ((*new)->local_addr == NULL || (*new)->remote_addr == NULL) { - return APR_ENOMEM; - } - (*new)->socketdes = socket(family, type, 0); #if APR_HAVE_IPV6 diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 37a60ea64f6..bff6b651686 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -109,13 +109,6 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, alloc_socket(new, cont); - if ((*new) == NULL) { - return APR_ENOMEM; - } - if (((*new)->local_addr == NULL) || ((*new)->remote_addr == NULL)) { - return APR_ENOMEM; - } - /* For right now, we are not using socket groups. We may later. * No flags to use when creating a socket, so use 0 for that parameter as well. */ From 7d28b3475db69c5b2e5663d1e127e89dc5533e24 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 30 Jul 2002 17:01:38 +0000 Subject: [PATCH 3729/7878] When we are destroying a mutex we don't know if it is locked or not, so we shouldn't try to unlock the mutex. Submitted by: Philip Martin Reviewed by: Aaron Bannert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63742 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_mutex.c | 1 - 1 file changed, 1 deletion(-) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 8245781c1a7..f27b1d1cd16 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -63,7 +63,6 @@ static apr_status_t thread_mutex_cleanup(void *data) apr_thread_mutex_t *mutex = (apr_thread_mutex_t *)data; apr_status_t rv; - pthread_mutex_unlock(&mutex->mutex); rv = pthread_mutex_destroy(&mutex->mutex); #ifdef PTHREAD_SETS_ERRNO if (rv) { From d56d8caf8bd68e379379fb5ec1f62d3791e19c2b Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 30 Jul 2002 17:06:00 +0000 Subject: [PATCH 3730/7878] Collapse this down to the infinately more readable apr_pool_cleanup_run(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63743 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_mutex.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index f27b1d1cd16..885fc83fd50 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -228,12 +228,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) { - apr_status_t rv; - if ((rv = thread_mutex_cleanup(mutex)) == APR_SUCCESS) { - apr_pool_cleanup_kill(mutex->pool, mutex, thread_mutex_cleanup); - return APR_SUCCESS; - } - return rv; + return apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup); } APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex) From 50cbd01db721de60bb897abf5afdd3bf8f9d047e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 30 Jul 2002 19:26:35 +0000 Subject: [PATCH 3731/7878] partial fix for realizing that we can't deal with pthreads on hp 10.20 or other platforms that are missing PTHREAD_ONCE_INIT the rest of the fix (not coded) is to disable threads when the pthreads test compilation fails git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63744 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_threads.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index ad3b27a1fd1..ba7644aa16b 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -86,6 +86,7 @@ void *thread_routine(void *data) { int main() { pthread_t thd; pthread_mutexattr_t mattr; + pthread_once_t once_init = PTHREAD_ONCE_INIT; int data = 1; pthread_mutexattr_init(&mattr); return pthread_create(&thd, NULL, thread_routine, &data); From 8abf644ad98b9616c6dcea29a0045c4553bd1d22 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Wed, 31 Jul 2002 01:12:43 +0000 Subject: [PATCH 3732/7878] Use storage on the stack instead of apr_palloc in apr_poll() when the number of descriptors is small (Note: The poll API still needs a rewrite in order to be usable with large numbers of descriptors. This change is just a short-term hack to work around the memory leak that apr_poll() was causing in the httpd.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63745 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 9b2deb5dc33..f697170c65e 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -106,17 +106,29 @@ static apr_int16_t get_revent(apr_int16_t event) return rv; } +#define SMALL_POLLSET_LIMIT 8 + APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, apr_int32_t *nsds, apr_interval_time_t timeout) { - /* obvious optimization, it would be better if this could be allocated - * on the stack. For a single file/socket, this can be otpimized - * very cleanly. - */ - struct pollfd *pollset = apr_palloc(aprset->p, - sizeof(struct pollfd) * num); + struct pollfd tmp_pollset[SMALL_POLLSET_LIMIT]; + struct pollfd *pollset; int i; + if (num <= SMALL_POLLSET_LIMIT) { + pollset = tmp_pollset; + } + else { + /* XXX There are two problems with this code: it leaks + * memory, and it requires an O(n)-time loop to copy + * n descriptors from the apr_pollfd_t structs into + * the pollfd structs. At the moment, it's best suited + * for use with fewer than SMALL_POLLSET_LIMIT + * descriptors. + */ + pollset = apr_palloc(aprset->p, + sizeof(struct pollfd) * num); + } for (i = 0; i < num; i++) { if (aprset[i].desc_type == APR_POLL_SOCKET) { pollset[i].fd = aprset[i].desc.s->socketdes; From f86861294128df32fdda7eb67e8050f6703114eb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 31 Jul 2002 06:08:08 +0000 Subject: [PATCH 3733/7878] Handle leaks right now are a huge problem. Close two of them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63746 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/proc_mutex.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 19100cdd03c..8e25a01cec6 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -76,10 +76,6 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, apr_pool_t *pool) { HANDLE hMutex; - SECURITY_ATTRIBUTES sec; - sec.nLength = sizeof(SECURITY_ATTRIBUTES); - sec.lpSecurityDescriptor = NULL; - sec.bInheritHandle = TRUE; /* With Win2000 Terminal Services, the Mutex name can have a * "Global\" or "Local\" prefix to explicitly create the object @@ -94,7 +90,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, fname = apr_pstrdup(pool, fname); } - hMutex = CreateMutex(&sec, FALSE, fname); + hMutex = CreateMutex(NULL, FALSE, fname); if (!hMutex) { return apr_get_os_error(); } @@ -119,7 +115,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, else fname = apr_pstrdup(pool, fname); - hMutex = OpenMutex(MUTEX_ALL_ACCESS, TRUE, fname); + hMutex = OpenMutex(MUTEX_ALL_ACCESS, FALSE, fname); if (!hMutex) { return apr_get_os_error(); } From a4f9219b0d41f1e82203bf7bbac5cdb2891b2824 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 31 Jul 2002 06:20:15 +0000 Subject: [PATCH 3734/7878] More handle leakage. We need to be explicit when we create a duplicate handle for a child or all our children's children end up with the polution. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63747 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 48f45a5fd17..8de8b7eb361 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -95,7 +95,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, apr_pool_t *pool) { static apr_size_t memblock = 0; - SECURITY_ATTRIBUTES sec, *psec; HANDLE hMap, hFile; apr_status_t rv; apr_size_t size; @@ -117,15 +116,9 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, size = memblock * (1 + (reqsize - 1) / memblock); if (!file) { - /* Do Anonymous, which will be an inherited handle */ + /* Do Anonymous, which must be passed as a duplicated handle */ #ifndef _WIN32_WCE hFile = INVALID_HANDLE_VALUE; - sec.nLength = sizeof(SECURITY_ATTRIBUTES); - sec.lpSecurityDescriptor = NULL; - sec.bInheritHandle = TRUE; - psec = &sec; -#else - psec = NULL; #endif mapkey = NULL; } @@ -144,19 +137,18 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, } rv = apr_file_trunc(f, size); mapkey = res_name_from_filename(file, 1, pool); - psec = NULL; } #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - hMap = CreateFileMappingW(hFile, psec, PAGE_READWRITE, 0, size, mapkey); + hMap = CreateFileMappingW(hFile, NULL, PAGE_READWRITE, 0, size, mapkey); } #endif #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI { - hMap = CreateFileMappingA(hFile, psec, PAGE_READWRITE, 0, size, mapkey); + hMap = CreateFileMappingA(hFile, NULL, PAGE_READWRITE, 0, size, mapkey); } #endif err = apr_get_os_error(); From aadd2d2a558dcaf3afaf0e065529f6b98c0d22f2 Mon Sep 17 00:00:00 2001 From: Thom May Date: Wed, 31 Jul 2002 11:35:52 +0000 Subject: [PATCH 3735/7878] Yet another horrendous day in London town git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63748 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/STATUS b/STATUS index 868c8202112..8e656364c43 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/15 04:27:38 $] +Last modified at [$Date: 2002/07/31 11:35:52 $] Release: @@ -46,11 +46,6 @@ RELEASE SHOWSTOPPERS: since apr_proc_create didn't allocate the apr_proc_t storage. (Aren't transparent types swell?) Suggestions? - * Almost every API in APR depends on pools, but pool semantics - aren't a good match for a lot of applications. We need to find - a way to support alternate allocators polymorphically without - a significant performance penalty. - * extract the MAJOR version from apr_version.h and pass it to libtool for use in applying version numbers to the shared libraries. @@ -58,7 +53,13 @@ RELEASE SHOWSTOPPERS: CURRENT VOTES: - * None + * Is this really a showstopper for the 1.0 release?: + * Almost every API in APR depends on pools, but pool semantics + aren't a good match for a lot of applications. We need to find + a way to support alternate allocators polymorphically without + a significant performance penalty. + + Not a showstopper: Thom RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From 8a2e79f36f89987b0ecc252b8cc75beef5bd43bb Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 31 Jul 2002 11:43:15 +0000 Subject: [PATCH 3736/7878] Day? It is still night isn't it? /me looks at clock *mumbles something about becoming a pumpkin several hours ago* git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63749 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 8e656364c43..6f763e1e656 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/31 11:35:52 $] +Last modified at [$Date: 2002/07/31 11:43:15 $] Release: @@ -50,6 +50,12 @@ RELEASE SHOWSTOPPERS: libtool for use in applying version numbers to the shared libraries. + * Change apr_initialize to take the expected version (in some form) + and return an error code if the requirement isn't satisfied. + + Justin says: "Relying solely on the run-time linker isn't enough + to guarantee versioning." + CURRENT VOTES: @@ -59,7 +65,7 @@ CURRENT VOTES: a way to support alternate allocators polymorphically without a significant performance penalty. - Not a showstopper: Thom + Not a showstopper: Thom, Justin RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From 35df9435a479e513fdf66ea6f01ace8c95145754 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 31 Jul 2002 20:06:06 +0000 Subject: [PATCH 3737/7878] Forgot to unbind the thread on an error condition git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63750 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 483f4b6e577..e09697cd30e 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -308,8 +308,10 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo } NXThreadBind (NX_THR_UNBOUND); } - else + else{ + NXThreadBind (NX_THR_UNBOUND); return ret; + } } } else { From ecccabb77e5547288e1a522b90d2deffa9090f72 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 1 Aug 2002 02:57:27 +0000 Subject: [PATCH 3738/7878] Add a vote. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63751 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 6f763e1e656..2a519cafa9c 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/07/31 11:43:15 $] +Last modified at [$Date: 2002/08/01 02:57:27 $] Release: @@ -65,7 +65,7 @@ CURRENT VOTES: a way to support alternate allocators polymorphically without a significant performance penalty. - Not a showstopper: Thom, Justin + Not a showstopper: Thom, Justin, Sander RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From 93f4868934d25d8a094e4c3b379f04f3cbf2caa6 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 1 Aug 2002 05:23:18 +0000 Subject: [PATCH 3739/7878] Fix autoconf-2.53+ brokeness which uses a faulty top_builddir macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63752 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7b5b47da4ac..ace243babb9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -43,8 +43,8 @@ includedir=@includedir@ installbuilddir=@installbuilddir@ srcdir=@srcdir@ VPATH=@srcdir@ -top_srcdir=@top_srcdir@ -top_blddir=@top_builddir@ +top_srcdir=@apr_srcdir@ +top_blddir=@apr_builddir@ EXPORT_FILES = $(top_srcdir)/include/*.h From 9673056bdf701fce40570724d3d1658376264b83 Mon Sep 17 00:00:00 2001 From: Brian Fitzpatrick Date: Thu, 1 Aug 2002 16:00:31 +0000 Subject: [PATCH 3740/7878] ENOSHOWSTOP: Not a showstopper. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63753 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 2a519cafa9c..df0b6bb639b 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/08/01 02:57:27 $] +Last modified at [$Date: 2002/08/01 16:00:31 $] Release: @@ -65,7 +65,7 @@ CURRENT VOTES: a way to support alternate allocators polymorphically without a significant performance penalty. - Not a showstopper: Thom, Justin, Sander + Not a showstopper: Thom, Justin, Sander, Fitz RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: From 65f176582bb5b6e841d60030772e4be5e30a887c Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Thu, 1 Aug 2002 20:10:03 +0000 Subject: [PATCH 3741/7878] Renamed some variables and replaced integer constants with macros to avoid confusion later when we add tests for the apr_pollset API git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63754 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/test/testpoll.c b/test/testpoll.c index 9073d260854..2a72ff87eb3 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -85,13 +85,13 @@ static int make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, apr_port_t port return 0; } -static int check_sockets(apr_pollfd_t *pollset, apr_socket_t **sockarray) +static int check_sockets(apr_pollfd_t *pollarray, apr_socket_t **sockarray) { int i = 0; printf("\tSocket 0\tSocket 1\tSocket 2\n\t"); for (i = 0;i < 3;i++){ apr_int16_t event; - if (apr_poll_revents_get(&event, sockarray[i], pollset) != APR_SUCCESS){ + if (apr_poll_revents_get(&event, sockarray[i], pollarray) != APR_SUCCESS){ printf("Failed!\n"); exit (-1); } @@ -140,13 +140,16 @@ static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p) printf("OK\n"); } +#define SMALL_NUM_SOCKETS 3 +#define LARGE_NUM_SOCKETS 100 + int main(void) { apr_pool_t *context; - apr_socket_t *s[3]; - apr_sockaddr_t *sa[3]; - apr_pollfd_t *pollset; - int i = 0, srv = 3; + apr_socket_t *s[LARGE_NUM_SOCKETS]; + apr_sockaddr_t *sa[LARGE_NUM_SOCKETS]; + apr_pollfd_t *pollarray; + int i = 0, srv = SMALL_NUM_SOCKETS; fprintf (stdout,"APR Poll Test\n*************\n\n"); @@ -166,20 +169,20 @@ int main(void) printf("OK\n"); printf("\tCreating the sockets I'll use.........."); - for (i = 0; i < 3; i++){ + for (i = 0; i < SMALL_NUM_SOCKETS; i++){ if (make_socket(&s[i], &sa[i], 7777 + i, context) != 0){ exit(-1); } } printf("OK\n"); - printf ("\tSetting up the pollset I'll use........"); - if (apr_poll_setup(&pollset, 3, context) != APR_SUCCESS){ - printf("Couldn't create a pollset!\n"); + printf ("\tSetting up the poll array I'll use........"); + if (apr_poll_setup(&pollarray, SMALL_NUM_SOCKETS, context) != APR_SUCCESS){ + printf("Couldn't create a poll array!\n"); exit (-1); } - for (i = 0; i < 3;i++){ - if (apr_poll_socket_add(pollset, s[i], APR_POLLIN) != APR_SUCCESS){ + for (i = 0; i < SMALL_NUM_SOCKETS;i++){ + if (apr_poll_socket_add(pollarray, s[i], APR_POLLIN) != APR_SUCCESS){ printf("Failed to add socket %d\n", i); exit (-1); } @@ -187,34 +190,34 @@ int main(void) printf("OK\n"); printf("Starting Tests\n"); - apr_poll(pollset, 3, &srv, 10 * APR_USEC_PER_SEC); - check_sockets(pollset, s); + apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 10 * APR_USEC_PER_SEC); + check_sockets(pollarray, s); send_msg(s, sa, 2); - apr_poll(pollset, 3, &srv, 10 * APR_USEC_PER_SEC); - check_sockets(pollset, s); + apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 10 * APR_USEC_PER_SEC); + check_sockets(pollarray, s); recv_msg(s, 2, context); send_msg(s, sa, 1); - apr_poll(pollset, 3, &srv, 10 * APR_USEC_PER_SEC); - check_sockets(pollset, s); + apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 10 * APR_USEC_PER_SEC); + check_sockets(pollarray, s); send_msg(s, sa, 2); - apr_poll(pollset, 3, &srv, 10 * APR_USEC_PER_SEC); - check_sockets(pollset, s); + apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 10 * APR_USEC_PER_SEC); + check_sockets(pollarray, s); recv_msg(s, 1, context); send_msg(s, sa, 0); - apr_poll(pollset, 3, &srv, 10 * APR_USEC_PER_SEC); - check_sockets(pollset, s); + apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 10 * APR_USEC_PER_SEC); + check_sockets(pollarray, s); printf("Tests completed.\n"); printf("\tClosing sockets........................"); - for (i = 0; i < 3; i++){ + for (i = 0; i < SMALL_NUM_SOCKETS; i++){ if (apr_socket_close(s[i]) != APR_SUCCESS){ printf("Failed!\n"); exit(-1); From 9b66ab9df5aad40b1389ecdb2252d5f09ff68944 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Thu, 1 Aug 2002 21:17:58 +0000 Subject: [PATCH 3742/7878] Added general-purpose pollset API to handle arbitrarily large numbers of file descriptors git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63755 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 54 ++++++++++++++++++++++ poll/unix/poll.c | 113 +++++++++++++++++++++++++++++++++++++++++++++ test/testpoll.c | 65 ++++++++++++++++++++++++-- 3 files changed, 228 insertions(+), 4 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index 8dc1a761345..7320d57e784 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -219,6 +219,60 @@ APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset); +/* General-purpose poll API for arbitrarily large numbers of + * file descriptors + */ + +typedef struct apr_pollset_t apr_pollset_t; + +/** + * Setup a pollset object + * @param pollset The pointer in which to return the newly created object + * @param size The maximum number of descriptors that this pollset can hold + * @param p The pool from which to allocate the pollset + */ +APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, + apr_uint32_t size, + apr_pool_t *p); + +/** + * Destroy a pollset object + * @param pollset The pollset to destroy + * @param descriptors An initial set of descriptors to add to the pollset + * (may be NULL) + * @param num The number of elements in the descriptors array + * @param p The pool from which to allocate the pollset + */ +APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset); + +/** + * Add a socket or file descriptor to a pollset + * @param pollset The pollset to which to add the descriptor + * @param descriptor The descriptor to add + */ +APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor); + +/** + * Remove a descriptor from a pollset + * @param pollset The pollset from which to remove the descriptor + * @param descriptor The descriptor to remove + */ +APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor); + +/** + * Block for activity on the descriptor(s) in a pollset + * @param pollset The pollset to use + * @param timeout Timeout in microseconds + * @param num Number of signalled descriptors (output parameter) + * @param descriptors Array of signalled descriptors (output parameter) + */ +APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, + apr_interval_time_t timeout, + apr_int32_t *num, + const apr_pollfd_t **descriptors); + #ifdef __cplusplus } #endif diff --git a/poll/unix/poll.c b/poll/unix/poll.c index f697170c65e..b551585f3ca 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -259,3 +259,116 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n } #endif + + +struct apr_pollset_t { + apr_uint32_t nelts; + apr_uint32_t nalloc; + struct pollfd *pollset; + apr_pollfd_t *query_set; + apr_pollfd_t *result_set; + apr_pool_t *pool; +}; + +APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, + apr_uint32_t size, + apr_pool_t *p) +{ + *pollset = apr_palloc(p, sizeof(**pollset)); + (*pollset)->nelts = 0; + (*pollset)->nalloc = size; + (*pollset)->pollset = apr_palloc(p, size * sizeof(struct pollfd)); + (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + (*pollset)->pool = p; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) +{ + /* A no-op function for now. If we later implement /dev/poll + * support, we'll need to close the /dev/poll fd here + */ + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) +{ + if (pollset->nelts == pollset->nalloc) { + return APR_ENOMEM; + } + + pollset->query_set[pollset->nelts] = *descriptor; + if (descriptor->desc_type == APR_POLL_SOCKET) { + pollset->pollset[pollset->nelts].fd = descriptor->desc.s->socketdes; + } + else { + pollset->pollset[pollset->nelts].fd = descriptor->desc.f->filedes; + } + pollset->pollset[pollset->nelts].events = get_event(descriptor->reqevents); + pollset->nelts++; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) +{ + apr_uint32_t i; + int fd; + + if (descriptor->desc_type == APR_POLL_SOCKET) { + fd = descriptor->desc.s->socketdes; + } + else { + fd = descriptor->desc.f->filedes; + } + + for (i = 0; i < pollset->nelts; i++) { + if (fd == pollset->pollset[i].fd) { + /* Found an instance of the fd: remove this and any other copies */ + apr_uint32_t dst = i; + apr_uint32_t old_nelts = pollset->nelts; + pollset->nelts--; + for (i++; i < old_nelts; i++) { + if (fd == pollset->pollset[i].fd) { + pollset->nelts--; + } + else { + pollset->pollset[dst] = pollset->pollset[i]; + } + } + return APR_SUCCESS; + } + } + return APR_NOTFOUND; +} + +APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, + apr_interval_time_t timeout, + apr_int32_t *num, + const apr_pollfd_t **descriptors) +{ + int rv; + apr_uint32_t i, j; + + if (timeout > 0) { + timeout /= 1000; + } + rv = poll(pollset->pollset, pollset->nelts, timeout); + (*num) = rv; + if (rv < 0) { + return errno; + } + j = 0; + for (i = 0; i < pollset->nelts; i++) { + if (pollset->pollset[i].revents != 0) { + pollset->result_set[j] = pollset->query_set[i]; + pollset->result_set[j].rtnevents = + get_revent(pollset->pollset[i].revents); + j++; + } + } + *descriptors = pollset->result_set; + return APR_SUCCESS; +} diff --git a/test/testpoll.c b/test/testpoll.c index 2a72ff87eb3..d54a5293982 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -149,7 +149,10 @@ int main(void) apr_socket_t *s[LARGE_NUM_SOCKETS]; apr_sockaddr_t *sa[LARGE_NUM_SOCKETS]; apr_pollfd_t *pollarray; + apr_pollset_t *pollset; int i = 0, srv = SMALL_NUM_SOCKETS; + apr_int32_t num; + const apr_pollfd_t *descriptors_out; fprintf (stdout,"APR Poll Test\n*************\n\n"); @@ -169,7 +172,7 @@ int main(void) printf("OK\n"); printf("\tCreating the sockets I'll use.........."); - for (i = 0; i < SMALL_NUM_SOCKETS; i++){ + for (i = 0; i < LARGE_NUM_SOCKETS; i++){ if (make_socket(&s[i], &sa[i], 7777 + i, context) != 0){ exit(-1); } @@ -190,7 +193,7 @@ int main(void) printf("OK\n"); printf("Starting Tests\n"); - apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 10 * APR_USEC_PER_SEC); + apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); check_sockets(pollarray, s); send_msg(s, sa, 2); @@ -214,15 +217,69 @@ int main(void) apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 10 * APR_USEC_PER_SEC); check_sockets(pollarray, s); - + + recv_msg(s, 0, context); + recv_msg(s, 2, context); + printf("Tests completed.\n"); + + fprintf (stdout,"\nAPR Pollset Test\n****************\n\n"); + + printf ("\tSetting up pollset...................."); + if (apr_pollset_create(&pollset, LARGE_NUM_SOCKETS, context) != APR_SUCCESS){ + printf("Couldn't create a pollset!\n"); + exit (-1); + } + for (i = 0; i < LARGE_NUM_SOCKETS;i++){ + apr_pollfd_t socket_pollfd; + socket_pollfd.desc_type = APR_POLL_SOCKET; + socket_pollfd.reqevents = APR_POLLIN; + socket_pollfd.desc.s = s[i]; + if (apr_pollset_add(pollset, &socket_pollfd) != APR_SUCCESS){ + printf("Failed to add socket %d\n", i); + exit (-1); + } + } + printf("OK\n"); + + printf("\nTest 1: No descriptors signalled......."); + if ((apr_pollset_poll(pollset, 0, &num, &descriptors_out) != APR_SUCCESS) || + (num != 0)) { + printf("FAILED\n"); + exit(-1); + } + printf("OK\n"); + + printf("\nTest 2: First descriptor signalled.....\n"); + send_msg(s, sa, 0); + if ((apr_pollset_poll(pollset, 0, &num, &descriptors_out) != APR_SUCCESS) || + (num != 1)) { + printf("Test 2: FAILED\n"); + exit(-1); + } + recv_msg(s, 0, context); + printf("Test 2: OK\n"); + + printf("\nTest 3: Last descriptor signalled......\n"); + send_msg(s, sa, 99); + if ((apr_pollset_poll(pollset, 0, &num, &descriptors_out) != APR_SUCCESS) || + (num != 1)) { + printf("Test 3: FAILED\n"); + exit(-1); + } + recv_msg(s, 99, context); + printf("Test 3: OK\n"); + + printf("\nTests completed.\n"); + printf("\tClosing sockets........................"); - for (i = 0; i < SMALL_NUM_SOCKETS; i++){ + for (i = 0; i < LARGE_NUM_SOCKETS; i++){ if (apr_socket_close(s[i]) != APR_SUCCESS){ printf("Failed!\n"); exit(-1); } } printf ("OK\n"); + return 0; } From 4ad300856105757b09e97ea4b200934442ea4218 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Thu, 1 Aug 2002 22:54:25 +0000 Subject: [PATCH 3743/7878] Added select-based pollset implementation for systems without poll git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63756 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 140 ++++++++++++++++++++++++++++++++++++++++++++++- test/testpoll.c | 2 +- 2 files changed, 138 insertions(+), 4 deletions(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index b551585f3ca..e316f9a38b1 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -240,7 +240,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n if (aprset[i].desc_type == APR_POLL_SOCKET) { fd = aprset[i].desc.s->socketdes; } - else if (aprset[i].desc_type == APR_POLL_FILE) { + else { fd = aprset[i].desc.f->filedes; } aprset[i].rtnevents = 0; @@ -264,7 +264,12 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n struct apr_pollset_t { apr_uint32_t nelts; apr_uint32_t nalloc; +#ifdef HAVE_POLL struct pollfd *pollset; +#else + fd_set readset, writeset, exceptset; + int maxfd; +#endif apr_pollfd_t *query_set; apr_pollfd_t *result_set; apr_pool_t *pool; @@ -277,7 +282,14 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, *pollset = apr_palloc(p, sizeof(**pollset)); (*pollset)->nelts = 0; (*pollset)->nalloc = size; +#ifdef HAVE_POLL (*pollset)->pollset = apr_palloc(p, size * sizeof(struct pollfd)); +#else + FD_ZERO(&((*pollset)->readset)); + FD_ZERO(&((*pollset)->writeset)); + FD_ZERO(&((*pollset)->exceptset)); + (*pollset)->maxfd = 0; +#endif (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); (*pollset)->pool = p; @@ -295,18 +307,36 @@ APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { + int fd; if (pollset->nelts == pollset->nalloc) { return APR_ENOMEM; } pollset->query_set[pollset->nelts] = *descriptor; if (descriptor->desc_type == APR_POLL_SOCKET) { - pollset->pollset[pollset->nelts].fd = descriptor->desc.s->socketdes; + fd = descriptor->desc.s->socketdes; } else { - pollset->pollset[pollset->nelts].fd = descriptor->desc.f->filedes; + fd = descriptor->desc.f->filedes; } +#ifdef HAVE_POLL + pollset->pollset[pollset->nelts].fd = fd; pollset->pollset[pollset->nelts].events = get_event(descriptor->reqevents); +#else + if (descriptor->reqevents & APR_POLLIN) { + FD_SET(fd, &(pollset->readset)); + } + if (descriptor->reqevents & APR_POLLOUT) { + FD_SET(fd, &(pollset->writeset)); + } + if (descriptor->reqevents & + (APR_POLLPRI | APR_POLLERR | APR_POLLHUP | APR_POLLNVAL)) { + FD_SET(fd, &(pollset->exceptset)); + } + if (fd > pollset->maxfd) { + pollset->maxfd = fd; + } +#endif pollset->nelts++; return APR_SUCCESS; } @@ -324,6 +354,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, fd = descriptor->desc.f->filedes; } +#ifdef HAVE_POLL for (i = 0; i < pollset->nelts; i++) { if (fd == pollset->pollset[i].fd) { /* Found an instance of the fd: remove this and any other copies */ @@ -336,14 +367,49 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, } else { pollset->pollset[dst] = pollset->pollset[i]; + pollset->query_set[dst] = pollset->query_set[i]; + } + } + return APR_SUCCESS; + } + } + +#else /* no poll */ + for (i = 0; i < pollset->nelts; i++) { + if (((pollset->query_set[i].desc_type == APR_POLL_SOCKET) && + (fd == pollset->query_set[i].desc.s->socketdes)) || + ((pollset->query_set[i].desc_type == APR_POLL_FILE) && + (fd == pollset->query_set[i].desc.f->filedes))) { + /* Found an instance of the fd: remove this and any other copies */ + apr_uint32_t dst = i; + apr_uint32_t old_nelts = pollset->nelts; + pollset->nelts--; + for (i++; i < old_nelts; i++) { + if (((pollset->query_set[i].desc_type == APR_POLL_SOCKET) && + (fd == pollset->query_set[i].desc.s->socketdes)) || + ((pollset->query_set[i].desc_type == APR_POLL_FILE) && + (fd == pollset->query_set[i].desc.f->filedes))) { + pollset->nelts--; + } + else { + pollset->query_set[dst] = pollset->query_set[i]; } } + FD_CLR(fd, &(pollset->readset)); + FD_CLR(fd, &(pollset->writeset)); + FD_CLR(fd, &(pollset->exceptset)); + if ((fd == pollset->maxfd) && (pollset->maxfd > 0)) { + pollset->maxfd--; + } return APR_SUCCESS; } } +#endif /* no poll */ + return APR_NOTFOUND; } +#ifdef HAVE_POLL APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_interval_time_t timeout, apr_int32_t *num, @@ -360,6 +426,9 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, if (rv < 0) { return errno; } + if (rv == 0) { + return APR_TIMEUP; + } j = 0; for (i = 0; i < pollset->nelts; i++) { if (pollset->pollset[i].revents != 0) { @@ -372,3 +441,68 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, *descriptors = pollset->result_set; return APR_SUCCESS; } + +#else /* no poll */ + +APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, + apr_interval_time_t timeout, + apr_int32_t *num, + const apr_pollfd_t **descriptors) +{ + int rv; + apr_uint32_t i, j; + struct timeval tv, *tvptr; + fd_set readset, writeset, exceptset; + + if (timeout < 0) { + tvptr = NULL; + } + else { + tv.tv_sec = (long)apr_time_sec(timeout); + tv.tv_usec = (long)apr_time_usec(timeout); + tvptr = &tv; + } + + memcpy(&readset, &(pollset->readset), sizeof(fd_set)); + memcpy(&writeset, &(pollset->writeset), sizeof(fd_set)); + memcpy(&exceptset, &(pollset->exceptset), sizeof(fd_set)); + + rv = select(pollset->maxfd + 1, &readset, &writeset, &exceptset, tvptr); + + (*num) = rv; + if (rv < 0) { + return errno; + } + if (rv == 0) { + return APR_TIMEUP; + } + j = 0; + for (i = 0; i < pollset->nelts; i++) { + int fd; + if (pollset->query_set[i].desc_type == APR_POLL_SOCKET) { + fd = pollset->query_set[i].desc.s->socketdes; + } + else { + fd = pollset->query_set[i].desc.s->socketdes; + } + if (FD_ISSET(fd, &readset) || FD_ISSET(fd, &writeset) || + FD_ISSET(fd, &exceptset)) { + pollset->result_set[j] = pollset->query_set[i]; + pollset->result_set[j].rtnevents = 0; + if (FD_ISSET(fd, &readset)) { + pollset->result_set[j].rtnevents |= APR_POLLIN; + } + if (FD_ISSET(fd, &writeset)) { + pollset->result_set[j].rtnevents |= APR_POLLOUT; + } + if (FD_ISSET(fd, &exceptset)) { + pollset->result_set[j].rtnevents |= APR_POLLERR; + } + j++; + } + } + + return APR_SUCCESS; +} + +#endif /* no poll */ diff --git a/test/testpoll.c b/test/testpoll.c index d54a5293982..1ac261b3a58 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -243,7 +243,7 @@ int main(void) printf("OK\n"); printf("\nTest 1: No descriptors signalled......."); - if ((apr_pollset_poll(pollset, 0, &num, &descriptors_out) != APR_SUCCESS) || + if ((apr_pollset_poll(pollset, 0, &num, &descriptors_out) != APR_TIMEUP) || (num != 0)) { printf("FAILED\n"); exit(-1); From 1de66564f64c3b06a60f640bb0c71d97bb2544ee Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 2 Aug 2002 01:13:49 +0000 Subject: [PATCH 3744/7878] Remove some assumptions about file descriptors being integers git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63757 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index e316f9a38b1..f329d435da2 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -307,22 +307,32 @@ APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { +#ifndef HAVE_POLL int fd; +#endif + if (pollset->nelts == pollset->nalloc) { return APR_ENOMEM; } pollset->query_set[pollset->nelts] = *descriptor; +#ifdef HAVE_POLL + if (descriptor->desc_type == APR_POLL_SOCKET) { - fd = descriptor->desc.s->socketdes; + pollset->pollset[pollset->nelts].fd = descriptor->desc.s->socketdes; } else { - fd = descriptor->desc.f->filedes; + pollset->pollset[pollset->nelts].fd = descriptor->desc.f->filedes; } -#ifdef HAVE_POLL - pollset->pollset[pollset->nelts].fd = fd; + pollset->pollset[pollset->nelts].events = get_event(descriptor->reqevents); #else + if (descriptor->desc_type == APR_POLL_SOCKET) { + fd = descriptor->desc.s->socketdes; + } + else { + fd = descriptor->desc.f->filedes; + } if (descriptor->reqevents & APR_POLLIN) { FD_SET(fd, &(pollset->readset)); } @@ -345,24 +355,19 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { apr_uint32_t i; +#ifndef HAVE_POLL int fd; - - if (descriptor->desc_type == APR_POLL_SOCKET) { - fd = descriptor->desc.s->socketdes; - } - else { - fd = descriptor->desc.f->filedes; - } +#endif #ifdef HAVE_POLL for (i = 0; i < pollset->nelts; i++) { - if (fd == pollset->pollset[i].fd) { + if (descriptor->desc.s == pollset->query_set[i].desc.s) { /* Found an instance of the fd: remove this and any other copies */ apr_uint32_t dst = i; apr_uint32_t old_nelts = pollset->nelts; pollset->nelts--; for (i++; i < old_nelts; i++) { - if (fd == pollset->pollset[i].fd) { + if (descriptor->desc.s == pollset->query_set[i].desc.s) { pollset->nelts--; } else { @@ -375,20 +380,21 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, } #else /* no poll */ + if (descriptor->desc_type == APR_POLL_SOCKET) { + fd = descriptor->desc.s->socketdes; + } + else { + fd = descriptor->desc.f->filedes; + } + for (i = 0; i < pollset->nelts; i++) { - if (((pollset->query_set[i].desc_type == APR_POLL_SOCKET) && - (fd == pollset->query_set[i].desc.s->socketdes)) || - ((pollset->query_set[i].desc_type == APR_POLL_FILE) && - (fd == pollset->query_set[i].desc.f->filedes))) { + if (descriptor->desc.s == pollset->query_set[i].desc.s) { /* Found an instance of the fd: remove this and any other copies */ apr_uint32_t dst = i; apr_uint32_t old_nelts = pollset->nelts; pollset->nelts--; for (i++; i < old_nelts; i++) { - if (((pollset->query_set[i].desc_type == APR_POLL_SOCKET) && - (fd == pollset->query_set[i].desc.s->socketdes)) || - ((pollset->query_set[i].desc_type == APR_POLL_FILE) && - (fd == pollset->query_set[i].desc.f->filedes))) { + if (descriptor->desc.s == pollset->query_set[i].desc.s) { pollset->nelts--; } else { From 31e7cef2902b937ccb15f57e8dcce75348b01f8d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 2 Aug 2002 03:37:12 +0000 Subject: [PATCH 3745/7878] UuidCreate demanded yet another .lib git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63758 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/MakeWin32Make.awk b/test/MakeWin32Make.awk index 447fac1df9a..c5529f8ffda 100644 --- a/test/MakeWin32Make.awk +++ b/test/MakeWin32Make.awk @@ -16,7 +16,7 @@ } if ( match( $0, /^LOCAL_LIBS=/ ) ) { print "LOCAL_LIBS= ../LibD/apr.lib "; - print "ALL_LIBS= kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib ole32\.lib "; + print "ALL_LIBS= kernel32\.lib user32\.lib advapi32\.lib Rpcrt4\.lib ws2_32\.lib wsock32\.lib ole32\.lib "; $0 = "" } if ( match( $0, /\@CFLAGS\@/ ) ) { From 64486989e2e5e8df6b07ac396ab2f25350d780e8 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 2 Aug 2002 04:53:47 +0000 Subject: [PATCH 3746/7878] c/unsigned int/SOCKET/ for win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63759 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index f329d435da2..8a68d8c6b89 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -187,7 +187,11 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n FD_ZERO(&exceptset); for (i = 0; i < num; i++) { +#ifdef WIN32 + SOCKET fd; +#else int fd; +#endif if (aprset[i].desc_type == APR_POLL_SOCKET) { fd = aprset[i].desc.s->socketdes; @@ -235,7 +239,11 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n } for (i = 0; i < num; i++) { +#ifdef WIN32 + SOCKET fd; +#else int fd; +#endif if (aprset[i].desc_type == APR_POLL_SOCKET) { fd = aprset[i].desc.s->socketdes; @@ -308,7 +316,11 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { #ifndef HAVE_POLL +#ifdef WIN32 + SOCKET fd; +#else int fd; +#endif #endif if (pollset->nelts == pollset->nalloc) { @@ -356,8 +368,12 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, { apr_uint32_t i; #ifndef HAVE_POLL +#ifdef WIN32 + SOCKET fd; +#else int fd; #endif +#endif #ifdef HAVE_POLL for (i = 0; i < pollset->nelts; i++) { @@ -484,7 +500,11 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } j = 0; for (i = 0; i < pollset->nelts; i++) { +#ifdef WIN32 + SOCKET fd; +#else int fd; +#endif if (pollset->query_set[i].desc_type == APR_POLL_SOCKET) { fd = pollset->query_set[i].desc.s->socketdes; } From 1ceaf9111a08bd69e5e1e1963075c684c83f95ba Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 2 Aug 2002 05:07:16 +0000 Subject: [PATCH 3747/7878] Avoid trying to turn file handles into sockets on win32 (where they're not interchangeable) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63760 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 8a68d8c6b89..37b834dceb4 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -197,10 +197,14 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n fd = aprset[i].desc.s->socketdes; } else if (aprset[i].desc_type == APR_POLL_FILE) { +#ifdef WIN32 + return APR_EBADF; +#else fd = aprset[i].desc.f->filedes; #ifdef NETWARE is_pipe = aprset[i].desc.f->is_pipe; -#endif +#endif /* NETWARE */ +#endif /* !WIN32 */ } if (aprset[i].reqevents & APR_POLLIN) { FD_SET(fd, &readset); @@ -249,7 +253,11 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n fd = aprset[i].desc.s->socketdes; } else { +#ifdef WIN32 + return EBADF; +#else fd = aprset[i].desc.f->filedes; +#endif } aprset[i].rtnevents = 0; if (FD_ISSET(fd, &readset)) { @@ -509,7 +517,11 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, fd = pollset->query_set[i].desc.s->socketdes; } else { - fd = pollset->query_set[i].desc.s->socketdes; +#ifdef WIN32 + return APR_EBADF; +#else + fd = pollset->query_set[i].desc.f->filedes; +#endif } if (FD_ISSET(fd, &readset) || FD_ISSET(fd, &writeset) || FD_ISSET(fd, &exceptset)) { From 9e3157826eb94017e32cae68489766322f5fa139 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 2 Aug 2002 05:12:35 +0000 Subject: [PATCH 3748/7878] One more fix for socket/file incompatibility on win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63761 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 37b834dceb4..ffb54f5d382 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -254,7 +254,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n } else { #ifdef WIN32 - return EBADF; + return APR_EBADF; #else fd = aprset[i].desc.f->filedes; #endif @@ -351,7 +351,11 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, fd = descriptor->desc.s->socketdes; } else { +#ifdef WIN32 + return APR_EBADF; +#else fd = descriptor->desc.f->filedes; +#endif } if (descriptor->reqevents & APR_POLLIN) { FD_SET(fd, &(pollset->readset)); From aadba40193dfaf03a27e0f7fe32af1b363c01eac Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 2 Aug 2002 05:20:32 +0000 Subject: [PATCH 3749/7878] More test cases and error diagnostics git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63762 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/test/testpoll.c b/test/testpoll.c index 1ac261b3a58..1a6933bfa73 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -153,6 +153,7 @@ int main(void) int i = 0, srv = SMALL_NUM_SOCKETS; apr_int32_t num; const apr_pollfd_t *descriptors_out; + apr_status_t rv; fprintf (stdout,"APR Poll Test\n*************\n\n"); @@ -243,33 +244,45 @@ int main(void) printf("OK\n"); printf("\nTest 1: No descriptors signalled......."); - if ((apr_pollset_poll(pollset, 0, &num, &descriptors_out) != APR_TIMEUP) || - (num != 0)) { - printf("FAILED\n"); + if ((rv = apr_pollset_poll(pollset, 0, &num, &descriptors_out) != + APR_TIMEUP) || (num != 0)) { + printf("Test 1: FAILED (errno=%d, num=%d (expected 0)\n", rv, num); exit(-1); } - printf("OK\n"); + printf("Test 1: OK\n"); printf("\nTest 2: First descriptor signalled.....\n"); send_msg(s, sa, 0); - if ((apr_pollset_poll(pollset, 0, &num, &descriptors_out) != APR_SUCCESS) || - (num != 1)) { - printf("Test 2: FAILED\n"); + if ((rv = apr_pollset_poll(pollset, 0, &num, &descriptors_out) + != APR_SUCCESS) || (num != 1)) { + printf("Test 2: FAILED (errno=%d, num=%d (expected 1)\n", rv, num); exit(-1); } recv_msg(s, 0, context); printf("Test 2: OK\n"); - printf("\nTest 3: Last descriptor signalled......\n"); - send_msg(s, sa, 99); - if ((apr_pollset_poll(pollset, 0, &num, &descriptors_out) != APR_SUCCESS) || - (num != 1)) { - printf("Test 3: FAILED\n"); + printf("\nTest 3: Middle descriptors signalled.....\n"); + send_msg(s, sa, 2); + send_msg(s, sa, 5); + if ((rv = apr_pollset_poll(pollset, 0, &num, &descriptors_out) + != APR_SUCCESS) || (num != 2)) { + printf("Test 2: FAILED (errno=%d, num=%d (expected 2)\n", rv, num); exit(-1); } - recv_msg(s, 99, context); + recv_msg(s, 2, context); + recv_msg(s, 5, context); printf("Test 3: OK\n"); + printf("\nTest 4: Last descriptor signalled......\n"); + send_msg(s, sa, LARGE_NUM_SOCKETS - 1); + if ((rv = apr_pollset_poll(pollset, 0, &num, &descriptors_out) != + APR_SUCCESS) || (num != 1)) { + printf("Test 4: FAILED (errno=%d, num=%d (expected 1)\n", rv, num); + exit(-1); + } + recv_msg(s, LARGE_NUM_SOCKETS - 1, context); + printf("Test 4: OK\n"); + printf("\nTests completed.\n"); printf("\tClosing sockets........................"); From 66008ba8a8cd6566d0a93f1021e1fb7c8f73da47 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 2 Aug 2002 05:42:23 +0000 Subject: [PATCH 3750/7878] more win32 socket descriptor signedness fixes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63763 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index ffb54f5d382..9b25504d132 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -216,8 +216,8 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n (APR_POLLPRI | APR_POLLERR | APR_POLLHUP | APR_POLLNVAL)) { FD_SET(fd, &exceptset); } - if (fd > maxfd) { - maxfd = fd; + if ((int)fd > maxfd) { + maxfd = (int)fd; } } @@ -367,8 +367,8 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, (APR_POLLPRI | APR_POLLERR | APR_POLLHUP | APR_POLLNVAL)) { FD_SET(fd, &(pollset->exceptset)); } - if (fd > pollset->maxfd) { - pollset->maxfd = fd; + if ((int)fd > pollset->maxfd) { + pollset->maxfd = (int)fd; } #endif pollset->nelts++; @@ -432,7 +432,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, FD_CLR(fd, &(pollset->readset)); FD_CLR(fd, &(pollset->writeset)); FD_CLR(fd, &(pollset->exceptset)); - if ((fd == pollset->maxfd) && (pollset->maxfd > 0)) { + if (((int)fd == pollset->maxfd) && (pollset->maxfd > 0)) { pollset->maxfd--; } return APR_SUCCESS; From 90dc4f44c75ef8d52efd26068ded2bd7ff45e7d0 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 2 Aug 2002 16:26:09 +0000 Subject: [PATCH 3751/7878] de-tab this sucker git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63764 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getopt.c | 158 ++++++++++++++++++++++----------------------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 922d152b836..4eaa95f61e9 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -142,9 +142,9 @@ static void reverse(const char **argv, int start, int len) const char *temp; for (; len >= 2; start++, len -= 2) { - temp = argv[start]; - argv[start] = argv[start + len - 1]; - argv[start + len - 1] = temp; + temp = argv[start]; + argv[start] = argv[start + len - 1]; + argv[start + len - 1] = temp; } } @@ -160,15 +160,15 @@ static void permute(apr_getopt_t *os) int len2 = os->ind - os->skip_end; if (os->interleave) { - /* - * Exchange the sequences argv[os->skip_start..os->skip_end-1] and - * argv[os->skip_end..os->ind-1]. The easiest way to do that is - * to reverse the entire range and then reverse the two - * sub-ranges. - */ - reverse(os->argv, os->skip_start, len1 + len2); - reverse(os->argv, os->skip_start, len2); - reverse(os->argv, os->skip_start + len2, len1); + /* + * Exchange the sequences argv[os->skip_start..os->skip_end-1] and + * argv[os->skip_end..os->ind-1]. The easiest way to do that is + * to reverse the entire range and then reverse the two + * sub-ranges. + */ + reverse(os->argv, os->skip_start, len1 + len2); + reverse(os->argv, os->skip_start, len2); + reverse(os->argv, os->skip_start + len2, len1); } /* Reset skip range to the new location of the non-option sequence. */ @@ -178,36 +178,36 @@ static void permute(apr_getopt_t *os) /* Helper function to print out an error involving a long option */ static apr_status_t serr(apr_getopt_t *os, const char *err, const char *str, - apr_status_t status) + apr_status_t status) { if (os->errfn) - (os->errfn)(os->errarg, "%s: %s: %s\n", + (os->errfn)(os->errarg, "%s: %s: %s\n", apr_filename_of_pathname(*os->argv), err, str); return status; } /* Helper function to print out an error involving a short option */ static apr_status_t cerr(apr_getopt_t *os, const char *err, int ch, - apr_status_t status) + apr_status_t status) { if (os->errfn) - (os->errfn)(os->errarg, "%s: %s: %c\n", + (os->errfn)(os->errarg, "%s: %s: %c\n", apr_filename_of_pathname(*os->argv), err, ch); return status; } APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, - const apr_getopt_option_t *opts, - int *optch, const char **optarg) + const apr_getopt_option_t *opts, + int *optch, const char **optarg) { const char *p; int i; /* Let the calling program reset option processing. */ if (os->reset) { - os->place = EMSG; - os->ind = 1; - os->reset = 0; + os->place = EMSG; + os->ind = 1; + os->reset = 0; } /* @@ -217,54 +217,54 @@ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, * one first. */ p = os->place; if (*p == '\0') { - /* If we are interleaving, skip non-option arguments. */ - if (os->interleave) { - while (os->ind < os->argc && *os->argv[os->ind] != '-') - os->ind++; - os->skip_end = os->ind; - } - if (os->ind >= os->argc || *os->argv[os->ind] != '-') { - os->ind = os->skip_start; - return APR_EOF; - } + /* If we are interleaving, skip non-option arguments. */ + if (os->interleave) { + while (os->ind < os->argc && *os->argv[os->ind] != '-') + os->ind++; + os->skip_end = os->ind; + } + if (os->ind >= os->argc || *os->argv[os->ind] != '-') { + os->ind = os->skip_start; + return APR_EOF; + } - p = os->argv[os->ind++] + 1; - if (*p == '-' && p[1] != '\0') { /* Long option */ - /* Search for the long option name in the caller's table. */ - apr_size_t len = 0; + p = os->argv[os->ind++] + 1; + if (*p == '-' && p[1] != '\0') { /* Long option */ + /* Search for the long option name in the caller's table. */ + apr_size_t len = 0; - p++; - for (i = 0; ; i++) { - if (opts[i].optch == 0) /* No match */ - return serr(os, "invalid option", p - 2, APR_BADCH); - len = strlen(opts[i].name); - if (strncmp(p, opts[i].name, len) == 0 - && (p[len] == '\0' || p[len] == '=')) - break; - } - *optch = opts[i].optch; + p++; + for (i = 0; ; i++) { + if (opts[i].optch == 0) /* No match */ + return serr(os, "invalid option", p - 2, APR_BADCH); + len = strlen(opts[i].name); + if (strncmp(p, opts[i].name, len) == 0 + && (p[len] == '\0' || p[len] == '=')) + break; + } + *optch = opts[i].optch; - if (opts[i].has_arg) { - if (p[len] == '=') /* Argument inline */ - *optarg = p + len + 1; - else if (os->ind >= os->argc) /* Argument missing */ - return serr(os, "missing argument", p - 2, APR_BADARG); - else /* Argument in next arg */ - *optarg = os->argv[os->ind++]; - } else { - *optarg = NULL; - if (p[len] == '=') - return serr(os, "erroneous argument", p - 2, APR_BADARG); - } - permute(os); - return APR_SUCCESS; - } else if (*p == '-') { /* Bare "--"; we're done */ - permute(os); - os->ind = os->skip_start; - return APR_EOF; - } - else if (*p == '\0') /* Bare "-" is illegal */ - return serr(os, "invalid option", p, APR_BADCH); + if (opts[i].has_arg) { + if (p[len] == '=') /* Argument inline */ + *optarg = p + len + 1; + else if (os->ind >= os->argc) /* Argument missing */ + return serr(os, "missing argument", p - 2, APR_BADARG); + else /* Argument in next arg */ + *optarg = os->argv[os->ind++]; + } else { + *optarg = NULL; + if (p[len] == '=') + return serr(os, "erroneous argument", p - 2, APR_BADARG); + } + permute(os); + return APR_SUCCESS; + } else if (*p == '-') { /* Bare "--"; we're done */ + permute(os); + os->ind = os->skip_start; + return APR_EOF; + } + else if (*p == '\0') /* Bare "-" is illegal */ + return serr(os, "invalid option", p, APR_BADCH); } /* @@ -272,24 +272,24 @@ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, * Look for it in the caller's table. */ for (i = 0; ; i++) { - if (opts[i].optch == 0) /* No match */ - return cerr(os, "invalid option character", *p, APR_BADCH); - if (*p == opts[i].optch) - break; + if (opts[i].optch == 0) /* No match */ + return cerr(os, "invalid option character", *p, APR_BADCH); + if (*p == opts[i].optch) + break; } *optch = *p++; if (opts[i].has_arg) { - if (*p != '\0') /* Argument inline */ - *optarg = p; - else if (os->ind >= os->argc) /* Argument missing */ - return cerr(os, "missing argument", *optch, APR_BADARG); - else /* Argument in next arg */ - *optarg = os->argv[os->ind++]; - os->place = EMSG; + if (*p != '\0') /* Argument inline */ + *optarg = p; + else if (os->ind >= os->argc) /* Argument missing */ + return cerr(os, "missing argument", *optch, APR_BADARG); + else /* Argument in next arg */ + *optarg = os->argv[os->ind++]; + os->place = EMSG; } else { - *optarg = NULL; - os->place = p; + *optarg = NULL; + os->place = p; } permute(os); From 1206a154fa2eb290c29f726c92464b85d8394c3c Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 2 Aug 2002 16:28:11 +0000 Subject: [PATCH 3752/7878] The documentation within include/apr_getopt.h says that the name argument within the option structure should be NULL if a long name is not present - but it performs a strlen on that value without checking for NULL. Submitted by : David Waite git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63765 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getopt.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 4eaa95f61e9..e3aa387fb5a 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -237,10 +237,12 @@ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, for (i = 0; ; i++) { if (opts[i].optch == 0) /* No match */ return serr(os, "invalid option", p - 2, APR_BADCH); - len = strlen(opts[i].name); - if (strncmp(p, opts[i].name, len) == 0 - && (p[len] == '\0' || p[len] == '=')) - break; + if (opts[i].name) { + len = strlen(opts[i].name); + if (strncmp(p, opts[i].name, len) == 0 + && (p[len] == '\0' || p[len] == '=')) + break; + } } *optch = opts[i].optch; From db50d0256dafbd0f040f982a2a39e25161fb6dae Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 2 Aug 2002 16:29:57 +0000 Subject: [PATCH 3753/7878] check for null in getopt PR: Obtained from: Submitted by: David Waite Reviewed by: Ian Holsman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63766 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index b870a84ff34..666e6bf0d89 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) dont performs a strlen on that value without checking for NULL in getopt + [David Waite , Ian Holsman] + *) Added apr_strtoll() and apr_atoll() to strings lib. [Shantonu Sen , Wilfredo Sanchez] From af63d2176b1e5f59c179d601577b92a2ec358ee0 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 2 Aug 2002 16:40:41 +0000 Subject: [PATCH 3754/7878] fix the 'elseif' style by adding some curly brakets git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63767 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/getopt.c | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index e3aa387fb5a..2a8b7d1a421 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -121,7 +121,8 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, return (APR_BADARG); } if (os->errfn) { - (os->errfn)(os->errarg, "%s: option requires an argument -- %c\n", + (os->errfn)(os->errarg, + "%s: option requires an argument -- %c\n", apr_filename_of_pathname(*os->argv), os->opt); } *optch = os->opt; @@ -237,6 +238,7 @@ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, for (i = 0; ; i++) { if (opts[i].optch == 0) /* No match */ return serr(os, "invalid option", p - 2, APR_BADCH); + if (opts[i].name) { len = strlen(opts[i].name); if (strncmp(p, opts[i].name, len) == 0 @@ -247,26 +249,31 @@ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, *optch = opts[i].optch; if (opts[i].has_arg) { - if (p[len] == '=') /* Argument inline */ + if (p[len] == '=') /* Argument inline */ *optarg = p + len + 1; - else if (os->ind >= os->argc) /* Argument missing */ - return serr(os, "missing argument", p - 2, APR_BADARG); - else /* Argument in next arg */ - *optarg = os->argv[os->ind++]; + else { + if (os->ind >= os->argc) /* Argument missing */ + return serr(os, "missing argument", p - 2, APR_BADARG); + else /* Argument in next arg */ + *optarg = os->argv[os->ind++]; + } } else { - *optarg = NULL; + *optarg = NULL; if (p[len] == '=') return serr(os, "erroneous argument", p - 2, APR_BADARG); } permute(os); return APR_SUCCESS; - } else if (*p == '-') { /* Bare "--"; we're done */ - permute(os); - os->ind = os->skip_start; - return APR_EOF; + } else { + if (*p == '-') { /* Bare "--"; we're done */ + permute(os); + os->ind = os->skip_start; + return APR_EOF; + } + else + if (*p == '\0') /* Bare "-" is illegal */ + return serr(os, "invalid option", p, APR_BADCH); } - else if (*p == '\0') /* Bare "-" is illegal */ - return serr(os, "invalid option", p, APR_BADCH); } /* @@ -276,6 +283,7 @@ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, for (i = 0; ; i++) { if (opts[i].optch == 0) /* No match */ return cerr(os, "invalid option character", *p, APR_BADCH); + if (*p == opts[i].optch) break; } @@ -284,10 +292,12 @@ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, if (opts[i].has_arg) { if (*p != '\0') /* Argument inline */ *optarg = p; - else if (os->ind >= os->argc) /* Argument missing */ - return cerr(os, "missing argument", *optch, APR_BADARG); - else /* Argument in next arg */ - *optarg = os->argv[os->ind++]; + else { + if (os->ind >= os->argc) /* Argument missing */ + return cerr(os, "missing argument", *optch, APR_BADARG); + else /* Argument in next arg */ + *optarg = os->argv[os->ind++]; + } os->place = EMSG; } else { *optarg = NULL; From 2a70af849c4af46bce6a0aee4091f2d4905c96bb Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Fri, 2 Aug 2002 16:45:45 +0000 Subject: [PATCH 3755/7878] hard to belive that english is my natural language :( git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63768 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 666e6bf0d89..787730454be 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ Changes with APR b1 - *) dont performs a strlen on that value without checking for NULL in getopt + *) don't perform a strlen on that name value without checking for NULL + first (in getopt) [David Waite , Ian Holsman] *) Added apr_strtoll() and apr_atoll() to strings lib. From dce114888f29ca7071ced2be81609316cbd23a12 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 2 Aug 2002 18:12:04 +0000 Subject: [PATCH 3756/7878] Remove the memory leak from the apr_poll implementation. On all systems, this will support any number of files/sockets. On modern systems, this will allocate on the stack. On older systems we fall back to malloc/free. Note: We will rarely ever use malloc/free. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63769 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 2 ++ configure.in | 12 +++++++++++- poll/unix/poll.c | 25 ++++++++++++++++--------- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/acconfig.h b/acconfig.h index ec0ce9167db..8f7a4d50a73 100644 --- a/acconfig.h +++ b/acconfig.h @@ -48,6 +48,8 @@ #undef HAVE_INT64_C +#undef HAVE_VLA + /* BeOS specific flag */ #undef HAVE_BONE_VERSION diff --git a/configure.in b/configure.in index 587f1c1fbf0..40053f93942 100644 --- a/configure.in +++ b/configure.in @@ -793,7 +793,7 @@ AC_SUBST(sharedmem) dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) -AC_CHECK_FUNCS(calloc strcasecmp stricmp setsid isinf isnan) +AC_CHECK_FUNCS(alloca calloc strcasecmp stricmp setsid isinf isnan) AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) AC_CHECK_FUNCS(writev) @@ -1281,6 +1281,16 @@ AC_ARG_ENABLE(other-child, AC_SUBST(oc) +AC_MSG_CHECKING(for Variable Length Arrays) +APR_TRY_COMPILE_NO_WARNING([], +[ + int foo[atoi(argv[1])]; +], vla_msg=yes, vla_msg=no ) +AC_MSG_RESULT([$vla_msg]) +if test "$vla_msg" = "yes"; then + AC_DEFINE(HAVE_VLA) +fi + AC_CACHE_CHECK(struct rlimit,ac_cv_struct_rlimit,[ AC_TRY_RUN([ #include diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 9b25504d132..68ccde8dbe4 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -111,24 +111,25 @@ static apr_int16_t get_revent(apr_int16_t event) APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, apr_int32_t *nsds, apr_interval_time_t timeout) { + int i; +#ifdef HAVE_VLA + struct pollfd pollset[num]; +#elif defined(HAVE_ALLOCA) + struct pollfd *pollset = alloca(sizeof(pollfd) * num); +#else struct pollfd tmp_pollset[SMALL_POLLSET_LIMIT]; struct pollfd *pollset; - int i; if (num <= SMALL_POLLSET_LIMIT) { pollset = tmp_pollset; } else { - /* XXX There are two problems with this code: it leaks - * memory, and it requires an O(n)-time loop to copy - * n descriptors from the apr_pollfd_t structs into - * the pollfd structs. At the moment, it's best suited - * for use with fewer than SMALL_POLLSET_LIMIT - * descriptors. + /* This does require O(n) to copy the descriptors to the internal + * mapping. */ - pollset = apr_palloc(aprset->p, - sizeof(struct pollfd) * num); + pollset = malloc(sizeof(struct pollfd) * num); } +#endif for (i = 0; i < num; i++) { if (aprset[i].desc_type == APR_POLL_SOCKET) { pollset[i].fd = aprset[i].desc.s->socketdes; @@ -150,6 +151,12 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, aprset[i].rtnevents = get_revent(pollset[i].revents); } +#if !defined(HAVE_VLA) && !defined(HAVE_ALLOCA) + if (num > SMALL_POLLSET_LIMIT) { + free(pollset); + } +#endif + if ((*nsds) < 0) { return errno; } From 847f60d3107292319677cbe1be65c5eca96ceb1a Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 2 Aug 2002 18:29:29 +0000 Subject: [PATCH 3757/7878] use apr_os_sock_t for socket descriptor variables git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63770 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 68ccde8dbe4..b63645e1df6 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -55,6 +55,7 @@ #include "apr.h" #include "apr_poll.h" #include "apr_time.h" +#include "apr_portable.h" #include "networkio.h" #include "fileio.h" #if HAVE_POLL_H @@ -194,16 +195,12 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n FD_ZERO(&exceptset); for (i = 0; i < num; i++) { -#ifdef WIN32 - SOCKET fd; -#else - int fd; -#endif + apr_os_sock_t fd; if (aprset[i].desc_type == APR_POLL_SOCKET) { fd = aprset[i].desc.s->socketdes; } - else if (aprset[i].desc_type == APR_POLL_FILE) { + else { #ifdef WIN32 return APR_EBADF; #else @@ -250,11 +247,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n } for (i = 0; i < num; i++) { -#ifdef WIN32 - SOCKET fd; -#else - int fd; -#endif + apr_os_sock_t fd; if (aprset[i].desc_type == APR_POLL_SOCKET) { fd = aprset[i].desc.s->socketdes; @@ -331,11 +324,7 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { #ifndef HAVE_POLL -#ifdef WIN32 - SOCKET fd; -#else - int fd; -#endif + apr_os_sock_t fd; #endif if (pollset->nelts == pollset->nalloc) { @@ -387,11 +376,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, { apr_uint32_t i; #ifndef HAVE_POLL -#ifdef WIN32 - SOCKET fd; -#else - int fd; -#endif + apr_os_sock_t fd; #endif #ifdef HAVE_POLL @@ -519,11 +504,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } j = 0; for (i = 0; i < pollset->nelts; i++) { -#ifdef WIN32 - SOCKET fd; -#else - int fd; -#endif + apr_os_sock_t fd; if (pollset->query_set[i].desc_type == APR_POLL_SOCKET) { fd = pollset->query_set[i].desc.s->socketdes; } From b03700930c093e87a859b558e43a5f71517c7203 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 2 Aug 2002 18:51:53 +0000 Subject: [PATCH 3758/7878] We safely ignore palloc failures [we can segv in the allocator]. We cannot ignore alloca/malloc failures. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63771 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index b63645e1df6..a6f25e353e9 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -114,9 +114,12 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, { int i; #ifdef HAVE_VLA + /* XXX: I trust that this is a segv when insufficient stack exists? */ struct pollfd pollset[num]; #elif defined(HAVE_ALLOCA) struct pollfd *pollset = alloca(sizeof(pollfd) * num); + if (!pollset) + return APR_ENOMEM; #else struct pollfd tmp_pollset[SMALL_POLLSET_LIMIT]; struct pollfd *pollset; @@ -129,6 +132,11 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, * mapping. */ pollset = malloc(sizeof(struct pollfd) * num); + /* The other option is adding an apr_pool_abort() fn to invoke + * the pool's out of memory handler + */ + if (!pollset) + return APR_ENOMEM; } #endif for (i = 0; i < num; i++) { From d99b66bf9e653a34941e9444857290cf38dc5fb8 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 2 Aug 2002 19:43:34 +0000 Subject: [PATCH 3759/7878] Added a "client data" void* to the poll API so that an app can associate application context with each file descriptor (e.g., map each descriptor to the filter that should process that descriptor once it's signalled) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63772 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/apr_poll.h b/include/apr_poll.h index 7320d57e784..5ddde025be1 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -111,6 +111,7 @@ struct apr_pollfd_t { apr_int16_t reqevents; apr_int16_t rtnevents; apr_descriptor desc; + void *client_data; /* allows app to associate context with a descriptor */ }; /** @@ -249,6 +250,9 @@ APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset); * Add a socket or file descriptor to a pollset * @param pollset The pollset to which to add the descriptor * @param descriptor The descriptor to add + * @param remark If you set client_data in the descriptor, that value + * will be returned in the client_data field whenever this + * descriptor is signalled in apr_pollset_poll(). */ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor); From bc7db53bc3be85923be8bee925d8016c85aba5ee Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 2 Aug 2002 19:48:49 +0000 Subject: [PATCH 3760/7878] Cleanup the last emit ... one final fd-as-socket problem. These should really become HAVE_FILES_AS_SOCKETS or some other macro git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63773 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index a6f25e353e9..f788fb538b1 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -412,7 +412,11 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, fd = descriptor->desc.s->socketdes; } else { +#ifdef WIN32 + return APR_EBADF; +#else fd = descriptor->desc.f->filedes; +#endif } for (i = 0; i < pollset->nelts; i++) { From 7822893ee9340ba0d141e8002b7a1d839cc0cce6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 2 Aug 2002 19:56:08 +0000 Subject: [PATCH 3761/7878] Features, not platforms, correct? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63774 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 4 ++++ include/apr.hw | 4 ++++ poll/unix/poll.c | 12 ++++++------ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index c00ede954d4..f2761e6460a 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -212,6 +212,10 @@ #define APR_HAS_XTHREAD_FILES 0 #define APR_HAS_OS_UUID 0 +/* Netware can poll on files/pipes. + */ +#define APR_FILES_AS_SOCKETS 1 + /* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE * on all platforms. */ diff --git a/include/apr.hw b/include/apr.hw index 2368c127603..a4bdfb070b1 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -299,6 +299,10 @@ extern "C" { #endif #define APR_HAS_OS_UUID 1 +/* Win32 cannot poll [just yet] on files/pipes. + */ +#define APR_FILES_AS_SOCKETS 0 + /* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE * on all platforms. */ diff --git a/poll/unix/poll.c b/poll/unix/poll.c index f788fb538b1..7f02b4d9f53 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -209,14 +209,14 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n fd = aprset[i].desc.s->socketdes; } else { -#ifdef WIN32 +#if !APR_FILES_AS_SOCKETS return APR_EBADF; #else fd = aprset[i].desc.f->filedes; #ifdef NETWARE is_pipe = aprset[i].desc.f->is_pipe; #endif /* NETWARE */ -#endif /* !WIN32 */ +#endif /* APR_FILES_AS_SOCKETS */ } if (aprset[i].reqevents & APR_POLLIN) { FD_SET(fd, &readset); @@ -261,7 +261,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n fd = aprset[i].desc.s->socketdes; } else { -#ifdef WIN32 +#if !APR_FILES_AS_SOCKETS return APR_EBADF; #else fd = aprset[i].desc.f->filedes; @@ -355,7 +355,7 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, fd = descriptor->desc.s->socketdes; } else { -#ifdef WIN32 +#if !APR_FILES_AS_SOCKETS return APR_EBADF; #else fd = descriptor->desc.f->filedes; @@ -412,7 +412,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, fd = descriptor->desc.s->socketdes; } else { -#ifdef WIN32 +#if !APR_FILES_AS_SOCKETS return APR_EBADF; #else fd = descriptor->desc.f->filedes; @@ -521,7 +521,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, fd = pollset->query_set[i].desc.s->socketdes; } else { -#ifdef WIN32 +#if !APR_FILES_AS_SOCKETS return APR_EBADF; #else fd = pollset->query_set[i].desc.f->filedes; From c2679bbb9fc697e26bb04ec5459f4e5fe251f644 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 2 Aug 2002 20:41:58 +0000 Subject: [PATCH 3762/7878] fix a compile break on stock FreeBSD 3.4 (gcc 2.7.2.3) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63775 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 7f02b4d9f53..d28a719b345 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -117,7 +117,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, /* XXX: I trust that this is a segv when insufficient stack exists? */ struct pollfd pollset[num]; #elif defined(HAVE_ALLOCA) - struct pollfd *pollset = alloca(sizeof(pollfd) * num); + struct pollfd *pollset = alloca(sizeof(struct pollfd) * num); if (!pollset) return APR_ENOMEM; #else From d78933098cd1350e5e701ec9762f7a08c8a7d5df Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 2 Aug 2002 20:47:17 +0000 Subject: [PATCH 3763/7878] Introducing a new API for resolving the file name to disk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63776 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index e09697cd30e..061e1bcbad7 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -107,15 +107,23 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, char *case_filename(apr_pool_t *pPool, const char *szFile) { char *casedFileName = NULL; - char buf[1024]; - NXDirAttrWithName_t *attrBuf; + char name[1024]; int rc; - attrBuf = (NXDirAttrWithName_t *) &buf; +#ifdef NEW_API + rc = realname(szFile, name); + if (rc == 0) { + casedFileName = apr_pstrdup(pPool, name); + } +#else + NXDirAttrWithName_t *attrBuf; + + attrBuf = (NXDirAttrWithName_t *) &name; rc =NXGetAttr(NULL, szFile, NX_DELEVEL_NAME_ONLY, attrBuf, 1024, 0); if (rc == 0) { casedFileName = apr_pstrdup(pPool, attrBuf->deName); } +#endif else { char *s; From e8df55ae0c34da2bc3925bf04b6aafbc84fa5625 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 2 Aug 2002 20:49:02 +0000 Subject: [PATCH 3764/7878] NetWare can't handle mixed descriptor sets. Added code to make sure that the set contain only socket or pipe descriptors. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63777 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 59 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index d28a719b345..58c52014797 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -65,6 +65,11 @@ #include #endif +#ifdef NETWARE +#define HAS_SOCKETS(dt) (dt == APR_POLL_SOCKET) ? 1 : 0 +#define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0 +#endif + #ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ static apr_int16_t get_event(apr_int16_t event) @@ -186,7 +191,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n int maxfd = -1; struct timeval tv, *tvptr; #ifdef NETWARE - int is_pipe = 0; + apr_datatype_e set_type = APR_NO_DESC; #endif if (timeout < 0) { @@ -206,16 +211,30 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n apr_os_sock_t fd; if (aprset[i].desc_type == APR_POLL_SOCKET) { +#ifdef NETWARE + if (HAS_PIPES(set_type)) { + return APR_EBADF; + } + else { + set_type = APR_POLL_SOCKET; + } +#endif fd = aprset[i].desc.s->socketdes; } else { #if !APR_FILES_AS_SOCKETS return APR_EBADF; #else - fd = aprset[i].desc.f->filedes; #ifdef NETWARE - is_pipe = aprset[i].desc.f->is_pipe; + if (aprset[i].desc.f->is_pipe && !HAS_SOCKETS(set_type)) { + set_type = APR_POLL_FILE; + } + else + return APR_EBADF; #endif /* NETWARE */ + + fd = aprset[i].desc.f->filedes; + #endif /* APR_FILES_AS_SOCKETS */ } if (aprset[i].reqevents & APR_POLLIN) { @@ -234,7 +253,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n } #ifdef NETWARE - if (is_pipe) { + if (HAS_PIPES(set_type)) { rv = pipe_select(maxfd + 1, &readset, &writeset, &exceptset, tvptr); } else { @@ -297,6 +316,9 @@ struct apr_pollset_t { apr_pollfd_t *query_set; apr_pollfd_t *result_set; apr_pool_t *pool; +#ifdef NETWARE + int set_type; +#endif }; APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, @@ -313,6 +335,9 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, FD_ZERO(&((*pollset)->writeset)); FD_ZERO(&((*pollset)->exceptset)); (*pollset)->maxfd = 0; +#ifdef NETWARE + (*pollset)->set_type = APR_NO_DESC; +#endif #endif (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); @@ -352,13 +377,33 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, pollset->pollset[pollset->nelts].events = get_event(descriptor->reqevents); #else if (descriptor->desc_type == APR_POLL_SOCKET) { +#ifdef NETWARE + /* NetWare can't handle mixed descriptor types in select() */ + if (HAS_PIPES(pollset->set_type)) { + return APR_EBADF; + } + else { + pollset->set_type = APR_POLL_SOCKET; + } +#endif fd = descriptor->desc.s->socketdes; } else { #if !APR_FILES_AS_SOCKETS return APR_EBADF; +#else +#ifdef NETWARE + /* NetWare can't handle mixed descriptor types in select() */ + if (descriptor->desc.f->is_pipe && !HAS_SOCKETS(pollset->set_type)) { + pollset->set_type = APR_POLL_FILE; + fd = descriptor->desc.f->filedes; + } + else { + return APR_EBADF; + } #else fd = descriptor->desc.f->filedes; +#endif #endif } if (descriptor->reqevents & APR_POLLIN) { @@ -505,6 +550,12 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, memcpy(&writeset, &(pollset->writeset), sizeof(fd_set)); memcpy(&exceptset, &(pollset->exceptset), sizeof(fd_set)); +#ifdef NETWARE + if (HAS_PIPES(pollset->set_type)) { + rv = pipe_select(pollset->maxfd + 1, &readset, &writeset, &exceptset, tvptr); + } + else +#endif rv = select(pollset->maxfd + 1, &readset, &writeset, &exceptset, tvptr); (*num) = rv; From 604744e39ee0b7b72094704b8576923dc887ac35 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 2 Aug 2002 21:02:12 +0000 Subject: [PATCH 3765/7878] Test apr_poll() with larger numbers of descriptors git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63778 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/test/testpoll.c b/test/testpoll.c index 1a6933bfa73..8a74e62b3ec 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -149,6 +149,7 @@ int main(void) apr_socket_t *s[LARGE_NUM_SOCKETS]; apr_sockaddr_t *sa[LARGE_NUM_SOCKETS]; apr_pollfd_t *pollarray; + apr_pollfd_t *pollarray_large; apr_pollset_t *pollset; int i = 0, srv = SMALL_NUM_SOCKETS; apr_int32_t num; @@ -180,17 +181,29 @@ int main(void) } printf("OK\n"); - printf ("\tSetting up the poll array I'll use........"); + printf ("\tSetting up the poll arrays I'll use........"); if (apr_poll_setup(&pollarray, SMALL_NUM_SOCKETS, context) != APR_SUCCESS){ printf("Couldn't create a poll array!\n"); exit (-1); } + if (apr_poll_setup(&pollarray_large, LARGE_NUM_SOCKETS, context) != + APR_SUCCESS){ + printf("Couldn't create a poll array!\n"); + exit (-1); + } for (i = 0; i < SMALL_NUM_SOCKETS;i++){ if (apr_poll_socket_add(pollarray, s[i], APR_POLLIN) != APR_SUCCESS){ printf("Failed to add socket %d\n", i); exit (-1); } } + for (i = 0; i < LARGE_NUM_SOCKETS;i++){ + if (apr_poll_socket_add(pollarray_large, s[i], APR_POLLIN) != + APR_SUCCESS){ + printf("Failed to add socket %d\n", i); + exit (-1); + } + } printf("OK\n"); printf("Starting Tests\n"); @@ -222,6 +235,12 @@ int main(void) recv_msg(s, 0, context); recv_msg(s, 2, context); + send_msg(s, sa, LARGE_NUM_SOCKETS - 1); + apr_poll(pollarray_large, LARGE_NUM_SOCKETS, &srv, 10 * APR_USEC_PER_SEC); + check_sockets(pollarray_large, s); + recv_msg(s, LARGE_NUM_SOCKETS - 1, context); + + printf("Tests completed.\n"); fprintf (stdout,"\nAPR Pollset Test\n****************\n\n"); From fee71d8897b1ffdfa4565cf4fe24c1a9d71f999d Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 3 Aug 2002 00:10:57 +0000 Subject: [PATCH 3766/7878] On systems without poll, limit apr_pollset's capacity to the number of descriptors that select can handle (this is why testpoll test #4 was failing on win32) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63779 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 6 ++++++ test/testpoll.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 58c52014797..969726ddd56 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -325,6 +325,12 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p) { +#if !defined(HAVE_POLL) && defined(FD_SETSIZE) + if (size > FD_SETSIZE) { + *pollset = NULL; + return APR_EINVAL; + } +#endif *pollset = apr_palloc(p, sizeof(**pollset)); (*pollset)->nelts = 0; (*pollset)->nalloc = size; diff --git a/test/testpoll.c b/test/testpoll.c index 8a74e62b3ec..0827777ecdd 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -141,7 +141,7 @@ static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p) } #define SMALL_NUM_SOCKETS 3 -#define LARGE_NUM_SOCKETS 100 +#define LARGE_NUM_SOCKETS 64 int main(void) { From 4dbf4034276e2841be87a24da6615b915238da06 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 3 Aug 2002 19:31:36 +0000 Subject: [PATCH 3767/7878] Step one, rename from the meaningless 'll' to 'i64'. I have nothing against spelling out apr_atoint64 but I think that's probably excessive. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63780 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ include/apr_strings.h | 6 +++--- strings/apr_strings.c | 8 ++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 787730454be..78cbbbbe275 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Renamed apr_strtoll()/apr_atoll() to follow int64 convention, + so these new helpers are apr_strtoi64/apr_atoi64(), since + 'll' (long long) is a nonportable and aspecific construct. + [William Rowe] + *) don't perform a strlen on that name value without checking for NULL first (in getopt) [David Waite , Ian Holsman] diff --git a/include/apr_strings.h b/include/apr_strings.h index 58c61bda4fa..d9406f6831c 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -340,15 +340,15 @@ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); * base 16. * @return The numeric value of the string. */ -APR_DECLARE(apr_int64_t) apr_strtoll(const char *buf, char **end, int base); +APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base); /** * parse a base-10 numeric string into a 64-bit numeric value. - * Equivalent to apr_strtoll(buf, (char**)NULL, 10). + * Equivalent to apr_strtoi64(buf, (char**)NULL, 10). * @param buf The string to parse * @return The numeric value of the string */ -APR_DECLARE(apr_int64_t) apr_atoll(const char *buf); +APR_DECLARE(apr_int64_t) apr_atoi64(const char *buf); /** * Format a binary size (magnitiudes are 2^10 rather than 10^3) from an apr_off_t, diff --git a/strings/apr_strings.c b/strings/apr_strings.c index dddf694b1e9..e58c88dc386 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -233,19 +233,19 @@ void *memchr(const void *s, int c, size_t n) } #endif -APR_DECLARE(apr_int64_t) apr_strtoll(const char *buf, char **end, int base) +APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base) { #if (APR_HAVE_STRTOLL) return (apr_int64_t)strtoll(buf, end, base); #else - /* best-effort function. If no strtoll, use strtol */ + /* XXX This Is Absolutely Bogus */ return (apr_int64_t)strtol(buf, end, base); #endif } -APR_DECLARE(apr_int64_t) apr_atoll(const char *buf) +APR_DECLARE(apr_int64_t) apr_atoi64(const char *buf) { - return apr_strtoll(buf, NULL, 0); + return apr_strtoi64(buf, NULL, 0); } APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n) From 2bbba148d2d0c1b84287f765a393fed174cd0331 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 3 Aug 2002 20:29:54 +0000 Subject: [PATCH 3768/7878] Out of time and at the end of my config-foo. This should get us the appropriate 64 bit atoi/atol/atoll or signal that the fn is unavailable. Someone with better config foo than I might want to make both variables private and relocate them into apr_private.h (without APR_ decoration.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63781 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 ++++++++-- include/apr.h.in | 5 ++++- include/apr.hnw | 4 ++++ include/apr.hw | 10 ++++++++++ strings/apr_strings.c | 8 ++++---- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 40053f93942..8e2f8522cd6 100644 --- a/configure.in +++ b/configure.in @@ -1028,12 +1028,14 @@ if test "$ac_cv_sizeof_int" = "8"; then int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 1' int64_value="int" long_value=int + int64_strfn="strtoi" elif test "$ac_cv_sizeof_long" = "8"; then int64_literal='#define APR_INT64_C(val) (val##L)' int64_t_fmt='#define APR_INT64_T_FMT "ld"' int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' int64_value="long" long_value=long + int64_strfn="strtol" elif test "$ac_cv_sizeof_long_long" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LL)' dnl Linux, Solaris, FreeBSD all support ll with printf. @@ -1044,18 +1046,21 @@ elif test "$ac_cv_sizeof_long_long" = "8"; then int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 3' int64_value="long long" long_value="long long" + int64_strfn="strtoll" elif test "$ac_cv_sizeof_long_double" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LD)' int64_t_fmt='#define APR_INT64_T_FMT "Ld"' int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' int64_value="long double" long_value="long double" + int64_strfn="strtoll" elif test "$ac_cv_sizeof_longlong" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LL)' int64_t_fmt='#define APR_INT64_T_FMT "qd"' int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' int64_value="__int64" long_value="__int64" + int64_strfn="strtoll" else dnl # int64_literal may be overriden if your compiler thinks you have dnl # a 64-bit value but APR does not agree. @@ -1210,7 +1215,7 @@ AC_CHECK_FUNCS(strcasecmp, have_strcasecmp="1", have_strcasecmp="0") AC_CHECK_FUNCS(strdup, have_strdup="1", have_strdup="0") AC_CHECK_FUNCS(strstr, have_strstr="1", have_strstr="0") AC_CHECK_FUNCS(memchr, have_memchr="1", have_memchr="0") -AC_CHECK_FUNCS(strtoll, have_strtoll="1", have_strtoll="0") +AC_CHECK_FUNCS($int64_strfn, have_int64_strfn="1", have_int64_strfn="0") AC_SUBST(have_strnicmp) AC_SUBST(have_strncasecmp) @@ -1219,7 +1224,8 @@ AC_SUBST(have_strcasecmp) AC_SUBST(have_strdup) AC_SUBST(have_strstr) AC_SUBST(have_memchr) -AC_SUBST(have_strtoll) +AC_SUBST(have_int64_strfn) +AC_SUBST(int64_strfn) dnl #----------------------------- Checking for DSO support echo $ac_n "${nl}Checking for DSO...${nl}" diff --git a/include/apr.h.in b/include/apr.h.in index 1b9c7134795..fcb8efe11cb 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -115,7 +115,6 @@ #define APR_HAVE_STRNICMP @have_strnicmp@ #define APR_HAVE_STRSTR @have_strstr@ #define APR_HAVE_MEMCHR @have_memchr@ -#define APR_HAVE_STRTOLL @have_strtoll@ #define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@ #define APR_HAVE_UNION_SEMUN @have_union_semun@ @@ -266,6 +265,10 @@ typedef @socklen_t_value@ apr_socklen_t; @int64_t_fmt@ @int64_t_fmt_len@ +/* Deal with atoi64 variables ... these should move to apr_private.h */ +#define APR_HAVE_INT64_STRFN @have_int64_strfn@ +#define APR_INT64_STRFN @int64_strfn@ + /* are we going to force the generic atomic operations */ #define APR_FORCE_ATOMIC_GENERIC @apr_force_atomic_generic@ diff --git a/include/apr.hnw b/include/apr.hnw index f2761e6460a..3c465870eec 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -339,6 +339,10 @@ typedef int apr_wait_t; #define APR_INT64_T_FMT "l64d" #define APR_TIME_T_FMT APR_INT64_T_FMT +/* Deal with atoi64 variables ... these should move to apr_private.h */ +/* I don't have the answer, perhaps a NetWare hacker will fill this in? */ +#define APR_HAVE_INT64_STRFN 0 +#define APR_INT64_STRFN missing #endif /* APR_H */ /** @} */ diff --git a/include/apr.hw b/include/apr.hw index a4bdfb070b1..871fae6fc2b 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -414,6 +414,16 @@ typedef int gid_t; #define APR_INT64_T_FMT "I64d" +/* Deal with atoi64 variables ... these should move to apr_private.h */ +/* MSVC 6.0 introduced _strtoui64 */ +#if _MSC_VER >= 1200 +#define APR_HAVE_INT64_STRFN 1 +#define APR_INT64_STRFN _strtoui64 +#else +#define APR_HAVE_INT64_STRFN 0 +#define APR_INT64_STRFN undef +#endif + /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" diff --git a/strings/apr_strings.c b/strings/apr_strings.c index e58c88dc386..01df0b5ae44 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -235,11 +235,11 @@ void *memchr(const void *s, int c, size_t n) APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base) { -#if (APR_HAVE_STRTOLL) - return (apr_int64_t)strtoll(buf, end, base); +#if (APR_HAVE_INT64_STRFN) + return APR_INT64_STRFN(buf, end, base); #else - /* XXX This Is Absolutely Bogus */ - return (apr_int64_t)strtol(buf, end, base); + /* XXX This Is Absolutely Bogus :: REIMPLEMENT! */ + return strtol(buf, end, base); #endif } From e6336b7205f5daab36b18167d0c7cd8daeba823e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 3 Aug 2002 20:35:30 +0000 Subject: [PATCH 3769/7878] Clarify the comment and remove the evil tab git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63782 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 78cbbbbe275..936a273647a 100644 --- a/CHANGES +++ b/CHANGES @@ -2,7 +2,8 @@ Changes with APR b1 *) Renamed apr_strtoll()/apr_atoll() to follow int64 convention, so these new helpers are apr_strtoi64/apr_atoi64(), since - 'll' (long long) is a nonportable and aspecific construct. + 'll' (long long) is a nonportable and aspecific construct. + Used ac/m4 tests to choose the appropriate fn behind strtoi64. [William Rowe] *) don't perform a strlen on that name value without checking for NULL From 36651b0baadca51c1e5b3fae46865f08f5fc7e2d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 3 Aug 2002 20:53:06 +0000 Subject: [PATCH 3770/7878] Fix two problems... if this pid/off are longlongs, WTF aren't we following the identical semantics to our earlier apr_int32_fmt_t construction? And let us fall gracefully into strtoq when applicable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63783 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 8e2f8522cd6..6abad40e52c 100644 --- a/configure.in +++ b/configure.in @@ -1142,7 +1142,7 @@ if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then off_t_fmt='#define APR_OFF_T_FMT "ld"' elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then - off_t_fmt='#define APR_OFF_T_FMT "qd"' + off_t_fmt='#define APR_OFF_T_FMT $int64_t_fmt' else off_t_fmt='#error Can not determine the proper size for off_t' fi @@ -1154,7 +1154,7 @@ if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_int"; then elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long"; then pid_t_fmt='#define APR_PID_T_FMT "ld"' elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long_long"; then - pid_t_fmt='#define APR_PID_T_FMT "qd"' + pid_t_fmt='#define APR_PID_T_FMT $int64_t_fmt' else pid_t_fmt='#error Can not determine the proper size for pid_t' fi @@ -1217,6 +1217,12 @@ AC_CHECK_FUNCS(strstr, have_strstr="1", have_strstr="0") AC_CHECK_FUNCS(memchr, have_memchr="1", have_memchr="0") AC_CHECK_FUNCS($int64_strfn, have_int64_strfn="1", have_int64_strfn="0") +dnl #----------------------------- We have a fallback position +if test ("$have_int64_strfn" = "0") -a ("int64_strfn" = "strtoll"); then + int64_strfn = "strtoq" + AC_CHECK_FUNCS($int64_strfn, have_int64_strfn="1", have_int64_strfn="0") +fi + AC_SUBST(have_strnicmp) AC_SUBST(have_strncasecmp) AC_SUBST(have_stricmp) From a2b73ed59181f106126df41fbdca53759fb0e1b0 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 3 Aug 2002 20:58:55 +0000 Subject: [PATCH 3771/7878] Change config.nice generation to always expand variables. This removes situations where an option could rely on an environment variable that was not defined in the config.nice preamble. "--libdir=${prefix}/lib" now is "--libdir=/my/expanded-prefix/lib" This allows config.nice to be executed without errors out-of-the-box. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63784 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ build/apr_common.m4 | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 936a273647a..fa6ed0d1944 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Change config.nice generation to always expand variables. + [Justin Erenkrantz] + *) Renamed apr_strtoll()/apr_atoll() to follow int64 convention, so these new helpers are apr_strtoi64/apr_atoi64(), since 'll' (long long) is a nonportable and aspecific construct. diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 1ecb653c43a..af072ff7ca2 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -46,6 +46,7 @@ EOF fi for arg in [$]0 "[$]@"; do + APR_EXPAND_VAR(arg, $arg) echo "\"[$]arg\" \\" >> $1 done echo '"[$]@"' >> $1 From 7e4d5046b81ef231a2046d9220246d0bc890eefc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 3 Aug 2002 21:04:09 +0000 Subject: [PATCH 3772/7878] Get strtoq detection working. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63785 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 6abad40e52c..e3f8cd82404 100644 --- a/configure.in +++ b/configure.in @@ -1218,8 +1218,8 @@ AC_CHECK_FUNCS(memchr, have_memchr="1", have_memchr="0") AC_CHECK_FUNCS($int64_strfn, have_int64_strfn="1", have_int64_strfn="0") dnl #----------------------------- We have a fallback position -if test ("$have_int64_strfn" = "0") -a ("int64_strfn" = "strtoll"); then - int64_strfn = "strtoq" +if test ("$have_int64_strfn" = "0") -a ("$int64_strfn" = "strtoll"); then + int64_strfn="strtoq" AC_CHECK_FUNCS($int64_strfn, have_int64_strfn="1", have_int64_strfn="0") fi From f2a89629756c910fc6cd09cbf482558bb8385305 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 3 Aug 2002 22:06:59 +0000 Subject: [PATCH 3773/7878] Roll-our-own apr_strtoi64 [based on the bsd, factoring out the div/mod operations that cutoff required]. It's pretty hackish if you consider that we can't trust our INT64_MIN/MAX on any non-2's-compliment cpu. But I fixed EBCDIC, so I'll leave it up to a clever mainframe hack to work out the non-2's-compliment case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63786 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 4 +- strings/apr_strings.c | 139 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 137 insertions(+), 6 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 871fae6fc2b..a42c15d5ef7 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -415,8 +415,8 @@ typedef int gid_t; #define APR_INT64_T_FMT "I64d" /* Deal with atoi64 variables ... these should move to apr_private.h */ -/* MSVC 6.0 introduced _strtoui64 */ -#if _MSC_VER >= 1200 +/* MSVC 7.0 introduced _strtoui64 */ +#if _MSC_VER >= 1300 && _INTEGRAL_MAX_BITS >= 64 #define APR_HAVE_INT64_STRFN 1 #define APR_INT64_STRFN _strtoui64 #else diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 01df0b5ae44..15eb5cb4a5b 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -50,6 +50,37 @@ * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . + * + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include "apr.h" @@ -233,13 +264,113 @@ void *memchr(const void *s, int c, size_t n) } #endif -APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base) +#ifndef INT64_MAX +#define INT64_MAX APR_INT64_C(0x7fffffffffffffff) +#endif +#ifndef INT64_MIN +#define INT64_MIN (-APR_INT64_C(0x7fffffffffffffff) - APR_INT64_C(1)) +#endif + +APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) { #if (APR_HAVE_INT64_STRFN) - return APR_INT64_STRFN(buf, end, base); + return APR_INT64_STRFN(nptr, endptr, base); #else - /* XXX This Is Absolutely Bogus :: REIMPLEMENT! */ - return strtol(buf, end, base); + const char *s; + apr_int64_t acc; + apr_int64_t val; + int neg, any; + char c; + + /* + * Skip white space and pick up leading +/- sign if any. + * If base is 0, allow 0x for hex and 0 for octal, else + * assume decimal; if base is already 16, allow 0x. + */ + s = nptr; + do { + c = *s++; + } while (apr_isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) { + errno = EINVAL; + if (endptr != NULL) + *endptr = (char *)(any ? s - 1 : nptr); + return acc; + } + + /* The classic bsd implementation requires div/mod operators + * to compute a cutoff. Benchmarking proves that iss very, very + * evil to some 32 bit processors. Instead, look for underflow + * in both the mult and add/sub operation. Unlike the bsd impl, + * we also work strictly in a signed int64 word as we haven't + * implemented the unsigned type in win32. + * + * Set 'any' if any `digits' consumed; make it negative to indicate + * overflow. + */ + while (acc >= 0 && (c = *s++)) { + if (c >= '0' && c <= '9') + c -= '0'; +#if (('Z' - 'A') == 25) + else if (c >= 'A' && c <= 'Z') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'z') + c -= 'a' - 10; +#elif (('I' - 'A') == 9) && (('R' - 'J') == 9) && (('Z' - 'S') == 8) + else if (c >= 'A' && c <= 'I') + c -= 'A' - 10; + else if (c >= 'J' && c <= 'R') + c -= 'J' - 19; + else if (c >= 'S' && c <= 'Z') + c -= 'S' - 28; + else if (c >= 'a' && c <= 'i') + c -= 'a' - 10; + else if (c >= 'j' && c <= 'r') + c -= 'j' - 19; + else if (c >= 's' && c <= 'z') + c -= 'z' - 28; +#else +#error "CANNOT COMPILE apr_strtoi64(), only ASCII and EBCDIC supported" +#endif + else + break; + if (c >= base) + break; + val *= base; + if ((neg && (val > acc || (val -= c) > acc)) + || (val < acc || (val += c) < acc)) { + any = -1; + } else { + acc = val; + any = 1; + } + } + if (any < 0) { + acc = neg ? INT64_MIN : INT64_MAX; + errno = ERANGE; + } else if (!any) { + errno = EINVAL; + } + if (endptr != NULL) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); #endif } From f75fe9ac46e2952f7bd32648820e3ee730ec676b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 4 Aug 2002 01:35:45 +0000 Subject: [PATCH 3774/7878] apr_get_netos_error() must be implemented on all platforms. Aren't you unix folks already having trouble with h_errno v.s. errno? Fix apr_poll to use apr_get_netos_error(). Submitted by: Rob Saccoccio git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63787 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 8 +++++++- poll/unix/poll.c | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index c3d9386a2eb..2a372ffd114 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -906,7 +906,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) -/* A special case, only Win32 winsock calls require this: +/* A special case, only socket calls require this: */ #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) @@ -1073,6 +1073,12 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) +/* A special case, only socket calls require this: + * [Note: platforms using h_errno should replace this macro, + * although watch out for thread saftey issues with h_errno.] + */ +#define apr_get_netos_error() (errno) + /** no error */ #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 969726ddd56..6e2e7b0cf39 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -172,7 +172,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, #endif if ((*nsds) < 0) { - return errno; + return apr_get_netos_error(); } if ((*nsds) == 0) { return APR_TIMEUP; @@ -270,7 +270,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n return APR_TIMEUP; } if ((*nsds) < 0) { - return errno; + return apr_get_netos_error(); } for (i = 0; i < num; i++) { @@ -513,7 +513,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, rv = poll(pollset->pollset, pollset->nelts, timeout); (*num) = rv; if (rv < 0) { - return errno; + return apr_get_netos_error(); } if (rv == 0) { return APR_TIMEUP; @@ -566,7 +566,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, (*num) = rv; if (rv < 0) { - return errno; + return apr_get_netos_error(); } if (rv == 0) { return APR_TIMEUP; From 149cc2a7c125b4f013a232b7c2504ff0549b27cc Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 4 Aug 2002 01:52:25 +0000 Subject: [PATCH 3775/7878] Remove unnecessary brackets and replace "-a" through a second test expression for portability. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63788 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index e3f8cd82404..87a76a1c5b1 100644 --- a/configure.in +++ b/configure.in @@ -1218,7 +1218,7 @@ AC_CHECK_FUNCS(memchr, have_memchr="1", have_memchr="0") AC_CHECK_FUNCS($int64_strfn, have_int64_strfn="1", have_int64_strfn="0") dnl #----------------------------- We have a fallback position -if test ("$have_int64_strfn" = "0") -a ("$int64_strfn" = "strtoll"); then +if test "$have_int64_strfn" = "0" && test "$int64_strfn" = "strtoll"; then int64_strfn="strtoq" AC_CHECK_FUNCS($int64_strfn, have_int64_strfn="1", have_int64_strfn="0") fi From 17b2ad18681e349b909e31de7c4476dd2501ee27 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 4 Aug 2002 04:28:41 +0000 Subject: [PATCH 3776/7878] fix an uninitialized variable git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63789 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strings.c | 1 + 1 file changed, 1 insertion(+) diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 15eb5cb4a5b..bf14bbceefb 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -325,6 +325,7 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) * Set 'any' if any `digits' consumed; make it negative to indicate * overflow. */ + val = 0; while (acc >= 0 && (c = *s++)) { if (c >= '0' && c <= '9') c -= '0'; From c0ba15c580146cb30e6e12556c620b45ba814122 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 4 Aug 2002 04:43:23 +0000 Subject: [PATCH 3777/7878] One more update to the pollset API before we start using it in the httpd: add a "flags" argument to apr_pollset_create(). When we add support for OS-specific poll alternatives in the future, I anticipate that we'll need to give apps a way to pass hints to the pollset create function to help it pick the best mechanism for a specific pollset. (E.g., there may be situations where we'll want to use poll(2) even if the OS has /dev/poll.) This "flags" argument is a placeholder to make it possible to add such hints later. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63790 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 5 ++++- poll/unix/poll.c | 3 ++- test/testpoll.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index 5ddde025be1..672ede10ba9 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -231,10 +231,13 @@ typedef struct apr_pollset_t apr_pollset_t; * @param pollset The pointer in which to return the newly created object * @param size The maximum number of descriptors that this pollset can hold * @param p The pool from which to allocate the pollset + * @param flags Optional flags to modify the operation of the pollset + * (reserved for future expansion) */ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, - apr_pool_t *p); + apr_pool_t *p, + apr_uint32_t flags); /** * Destroy a pollset object diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 6e2e7b0cf39..ff4a5921610 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -323,7 +323,8 @@ struct apr_pollset_t { APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, - apr_pool_t *p) + apr_pool_t *p, + apr_uint32_t flags) { #if !defined(HAVE_POLL) && defined(FD_SETSIZE) if (size > FD_SETSIZE) { diff --git a/test/testpoll.c b/test/testpoll.c index 0827777ecdd..38af175c702 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -246,7 +246,7 @@ int main(void) fprintf (stdout,"\nAPR Pollset Test\n****************\n\n"); printf ("\tSetting up pollset...................."); - if (apr_pollset_create(&pollset, LARGE_NUM_SOCKETS, context) != APR_SUCCESS){ + if (apr_pollset_create(&pollset, LARGE_NUM_SOCKETS, context, 0) != APR_SUCCESS){ printf("Couldn't create a pollset!\n"); exit (-1); } From 1d7436ff80ddf1d842c05d6f588ae5fc579acd43 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 4 Aug 2002 17:22:02 +0000 Subject: [PATCH 3778/7878] c is the valid first digit, must use it for the first iteration git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63791 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strings.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/strings/apr_strings.c b/strings/apr_strings.c index bf14bbceefb..3ab08a67112 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -326,7 +326,7 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) * overflow. */ val = 0; - while (acc >= 0 && (c = *s++)) { + do { if (c >= '0' && c <= '9') c -= '0'; #if (('Z' - 'A') == 25) @@ -362,7 +362,8 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) acc = val; any = 1; } - } + } while (any >= 0 && (c = *s++)); + if (any < 0) { acc = neg ? INT64_MIN : INT64_MAX; errno = ERANGE; From 9ef51f1f18e7bdb39b5835424e1b469501f1704d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 4 Aug 2002 18:29:33 +0000 Subject: [PATCH 3779/7878] Time in exact ms intervals can be very useful in benchmarking... this patch defines a general API for doing so if the platform supports toggling the clock resolution. Don't recommend doing so for HTTPD, but flood and ab should appreciate it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63792 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 8 ++++++++ time/unix/time.c | 6 ++++++ time/win32/time.c | 20 ++++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/include/apr_time.h b/include/apr_time.h index 11061af830a..d364b406013 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -256,6 +256,14 @@ APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, apr_time_exp_t *tm); +/** + * Improve the clock resolution for the lifetime of the given pool. + * Generally this is only desireable on benchmarking and other very + * time-sensitive applications, and has no impact on most platforms. + * @param pool The pool to associate the finer clock resolution + */ +APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p); + #ifdef __cplusplus } #endif diff --git a/time/unix/time.c b/time/unix/time.c index 65b82b0aa36..2669f30cffa 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -364,6 +364,12 @@ APR_DECLARE(void) apr_unix_setup_time(void) #endif +/* A noop on all known Unix implementations */ +APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p) +{ + return; +} + /* Deprecated */ APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, apr_time_t input, diff --git a/time/win32/time.c b/time/win32/time.c index 672b683cf2e..42b531b266e 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -65,6 +65,7 @@ #endif #include #include +#include "misc.h" /* Leap year is any year divisible by four, but not by 100 unless also * divisible by 400 @@ -282,6 +283,25 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t) Sleep((DWORD)(t / 1000)); } + +static apr_status_t clock_restore(void *unsetres) +{ + ULONG newRes; + SetTimerResolution((ULONG)unsetres, FALSE, &newRes); + return APR_SUCCESS; +} + +APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p) +{ + ULONG newRes; + if (SetTimerResolution(10000, TRUE, &newRes) == 0 /* STATUS_SUCCESS */) { + /* register the cleanup... */ + apr_pool_cleanup_register(p, (void*)10000, clock_restore, + apr_pool_cleanup_null); + } +} + + /* Deprecated */ APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, apr_time_t input, From a0f1c2ceb6268be50536b1b1fe9331568ca88f1f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 4 Aug 2002 18:31:38 +0000 Subject: [PATCH 3780/7878] Docs are always good, especially when it's this obscure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63793 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/time.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/time/win32/time.c b/time/win32/time.c index 42b531b266e..94d92602ee6 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -294,6 +294,9 @@ static apr_status_t clock_restore(void *unsetres) APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p) { ULONG newRes; + /* Timer resolution is stated in 100ns units. Note that TRUE requests the + * new clock resolution, FALSE above releases the request. + */ if (SetTimerResolution(10000, TRUE, &newRes) == 0 /* STATUS_SUCCESS */) { /* register the cleanup... */ apr_pool_cleanup_register(p, (void*)10000, clock_restore, From 41d8482077ffa582d3f7781e681d0ed3f18e0e3d Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Mon, 5 Aug 2002 09:28:24 +0000 Subject: [PATCH 3781/7878] Fix buggy substitution git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63794 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 87a76a1c5b1..dac4cea7354 100644 --- a/configure.in +++ b/configure.in @@ -1142,7 +1142,7 @@ if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then off_t_fmt='#define APR_OFF_T_FMT "ld"' elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then - off_t_fmt='#define APR_OFF_T_FMT $int64_t_fmt' + off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' else off_t_fmt='#error Can not determine the proper size for off_t' fi @@ -1154,7 +1154,7 @@ if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_int"; then elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long"; then pid_t_fmt='#define APR_PID_T_FMT "ld"' elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long_long"; then - pid_t_fmt='#define APR_PID_T_FMT $int64_t_fmt' + pid_t_fmt='#define APR_PID_T_FMT APR_INT64_T_FMT' else pid_t_fmt='#error Can not determine the proper size for pid_t' fi From 941f7bbe0db6a17bc7e5e181597bc0aa1e10f1f9 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 5 Aug 2002 21:09:47 +0000 Subject: [PATCH 3782/7878] Added apr_reslist to the NetWare build project git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63795 13f79535-47bb-0310-9956-ffa450edef68 --- build/nw_export.inc | 1 + libaprnw.mcp.zip | Bin 177738 -> 177597 bytes 2 files changed, 1 insertion(+) diff --git a/build/nw_export.inc b/build/nw_export.inc index 6e7e694d83d..9f191e1da47 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -66,6 +66,7 @@ #include "apr_md5.h" #include "apr_optional.h" #include "apr_optional_hooks.h" +#include "apr_reslist.h" #include "apr_rmm.h" #include "apr_sdbm.h" #include "apr_sha1.h" diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 1344d6a51e9419cc2b03b2feafcd0da27bc666e0..ffc8f56381faffc1746ef8243f03119ac0c1efb1 100644 GIT binary patch delta 71808 zcmagF2T)T{_b-Z~ARwS1pi~>6KtOs2l_p*39qAoHCzKoo0g>K&@1ge&Ql$4@14s+K zC6qwm#qayioBQs}yLXb=aL(GR{q~x5viDi5e~++bm+)KloxEg%ERXvj=DgKvtN60y zJI?@o?H#d z?cHBk+MYX@tTH;>7;X~3J>))Bs3Zt_HVAtUXHIv3FAp}K9t;XQq`RAw6{_V#n`!I% zv)Rl~>6e(4Zd(r>T4-}r+Pbq;db7$)nE=t9i3%dIZwm)=%>TR;EPADFxKJtg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driydBofrT%h#)38oims zfnw@^4%|yQH%MO`RJr8xy2Vv=h(mC?>au#Nu3V_Y@Iu#IRxdf^b?1oM|2JG#FGa}S zII6A-H(gdQ?K?#xQ61-&%jzY+9FSwGS8eMyQ|5bI_2&TYrCK!|;sm@xf9|D$sq&r> g{ywE{{BJ#F(Ws=Zzw_LqXS0yPG_wE_SD0GoQ+hyVZp From 2279bf284bda758f1e2d51003a64d2a9e86416eb Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 5 Aug 2002 21:11:12 +0000 Subject: [PATCH 3783/7878] Rollback the API change to NXFileRangeLock() and NXFileRangeUnlock() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63796 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/flock.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/file_io/netware/flock.c b/file_io/netware/flock.c index 99a085ea2d2..5b54c2f083a 100644 --- a/file_io/netware/flock.c +++ b/file_io/netware/flock.c @@ -55,7 +55,6 @@ #include #include "fileio.h" -/*#define NEW_API */ apr_status_t apr_file_lock(apr_file_t *thefile, int type) { @@ -63,12 +62,7 @@ apr_status_t apr_file_lock(apr_file_t *thefile, int type) fc = (type & APR_FLOCK_NONBLOCK) ? NX_RANGE_LOCK_TRYLOCK : NX_RANGE_LOCK_CHECK; -/* Remove this #ifdef once the next NDK ships */ -#ifdef NEW_API - if(NXFileRangeLock(thefile->filedes,fc, 0, 0, NX_LOCK_RANGE_FORWARD) == -1) -#else if(NXFileRangeLock(thefile->filedes,fc, 0, 0) == -1) -#endif return errno; return APR_SUCCESS; @@ -76,11 +70,7 @@ apr_status_t apr_file_lock(apr_file_t *thefile, int type) apr_status_t apr_file_unlock(apr_file_t *thefile) { -#ifdef NEW_API - if(NXFileRangeUnlock(thefile->filedes,NX_RANGE_LOCK_CANCEL,0 , 0, NX_LOCK_RANGE_FORWARD) == -1) -#else if(NXFileRangeUnlock(thefile->filedes,NX_RANGE_LOCK_CANCEL,0 , 0) == -1) -#endif return errno; return APR_SUCCESS; From 83be575af2ad430445432cf518a223b987cdaeb2 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Tue, 6 Aug 2002 03:37:54 +0000 Subject: [PATCH 3784/7878] Set the result array in the select-based version of apr_pollset_poll() Submitted by: Rob Saccoccio git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63797 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 1 + 1 file changed, 1 insertion(+) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index ff4a5921610..f495c821f6c 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -602,6 +602,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } } + *descriptors = pollset->result_set; return APR_SUCCESS; } From a6fb263fcf14e49f8e1455e33345384fa725be8f Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Tue, 6 Aug 2002 04:08:03 +0000 Subject: [PATCH 3785/7878] Added more detailed checking of the apr_pollset_poll results git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63798 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/test/testpoll.c b/test/testpoll.c index 38af175c702..07f1b0364d4 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -255,6 +255,7 @@ int main(void) socket_pollfd.desc_type = APR_POLL_SOCKET; socket_pollfd.reqevents = APR_POLLIN; socket_pollfd.desc.s = s[i]; + socket_pollfd.client_data = s[i]; if (apr_pollset_add(pollset, &socket_pollfd) != APR_SUCCESS){ printf("Failed to add socket %d\n", i); exit (-1); @@ -272,8 +273,11 @@ int main(void) printf("\nTest 2: First descriptor signalled.....\n"); send_msg(s, sa, 0); + descriptors_out = NULL; if ((rv = apr_pollset_poll(pollset, 0, &num, &descriptors_out) - != APR_SUCCESS) || (num != 1)) { + != APR_SUCCESS) || (num != 1) || !descriptors_out || + (descriptors_out[0].desc.s != s[0]) || + (descriptors_out[0].client_data != s[0])) { printf("Test 2: FAILED (errno=%d, num=%d (expected 1)\n", rv, num); exit(-1); } @@ -283,8 +287,16 @@ int main(void) printf("\nTest 3: Middle descriptors signalled.....\n"); send_msg(s, sa, 2); send_msg(s, sa, 5); + descriptors_out = NULL; + /* note that the descriptors in the result set can be in + * any order, so we have to test for both permutations here + */ if ((rv = apr_pollset_poll(pollset, 0, &num, &descriptors_out) - != APR_SUCCESS) || (num != 2)) { + != APR_SUCCESS) || (num != 2) || !descriptors_out || + !(((descriptors_out[0].desc.s == s[2]) && + (descriptors_out[1].desc.s == s[5])) || + ((descriptors_out[0].desc.s == s[5]) && + (descriptors_out[1].desc.s == s[2])))) { printf("Test 2: FAILED (errno=%d, num=%d (expected 2)\n", rv, num); exit(-1); } @@ -294,8 +306,11 @@ int main(void) printf("\nTest 4: Last descriptor signalled......\n"); send_msg(s, sa, LARGE_NUM_SOCKETS - 1); + descriptors_out = NULL; if ((rv = apr_pollset_poll(pollset, 0, &num, &descriptors_out) != - APR_SUCCESS) || (num != 1)) { + APR_SUCCESS) || (num != 1) || !descriptors_out || + (descriptors_out[0].desc.s != s[LARGE_NUM_SOCKETS - 1]) || + (descriptors_out[0].client_data != s[LARGE_NUM_SOCKETS - 1])) { printf("Test 4: FAILED (errno=%d, num=%d (expected 1)\n", rv, num); exit(-1); } From 4491d81e6e28b45ff5f37e55f593ea9b8cae97a5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 6 Aug 2002 06:50:17 +0000 Subject: [PATCH 3786/7878] Solve the elusive .pdf failure on Win32. Where Headers + Trailers were present, we always blasted the Headers. Now, we reinitialize the hdtr structure after consuming it, instead of trying to initialize for both headers and trailers. [RM - can we update the .40 test tag for this patch?] PR: 10781 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63799 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 2299263483f..ed40a4f9720 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -280,14 +280,6 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, return APR_ENOTIMPL; } - /* Initialize the overlapped structure */ - memset(&overlapped,'\0', sizeof(overlapped)); -#ifdef WAIT_FOR_EVENT - wait_event = overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); -#else - wait_event = (HANDLE) sock->socketdes; -#endif - /* Use len to keep track of number of total bytes sent (including headers) */ bytes_to_send = *len; *len = 0; @@ -309,9 +301,17 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, return APR_SUCCESS; } + /* Initialize the header/trailer and overlapped structures */ + memset(&tfb, '\0', sizeof (tfb)); + memset(&overlapped,'\0', sizeof(overlapped)); +#ifdef WAIT_FOR_EVENT + wait_event = overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); +#else + wait_event = (HANDLE) sock->socketdes; +#endif + /* Collapse the headers into a single buffer */ if (hdtr && hdtr->numheaders) { - memset(&tfb, '\0', sizeof (tfb)); ptfb = &tfb; collapse_iovec((char **)&ptfb->Head, &ptfb->HeadLength, hdtr->headers, hdtr->numheaders, sock->cntxt); @@ -326,7 +326,6 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, nbytes = bytes_to_send; /* Collapse the trailers into a single buffer */ if (hdtr && hdtr->numtrailers) { - memset(&tfb, '\0', sizeof (tfb)); ptfb = &tfb; collapse_iovec((char**) &ptfb->Tail, &ptfb->TailLength, hdtr->trailers, hdtr->numtrailers, sock->cntxt); @@ -342,7 +341,8 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, overlapped.Offset = (DWORD)(curoff); #if APR_HAS_LARGE_FILES overlapped.OffsetHigh = (DWORD)(curoff >> 32); -#endif +#endif + /* XXX BoundsChecker claims dwFlags must not be zero. */ rv = TransmitFile(sock->socketdes, /* socket */ file->filehand, /* open file descriptor of the file to be sent */ nbytes, /* number of bytes to send. 0=send all */ @@ -353,7 +353,8 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (!rv) { status = apr_get_netos_error(); if ((status == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) || - (status == APR_FROM_OS_ERROR(WSA_IO_PENDING))) { + (status == APR_FROM_OS_ERROR(WSA_IO_PENDING))) + { rv = WaitForSingleObject(wait_event, (DWORD)(sock->timeout >= 0 ? sock->timeout_ms : INFINITE)); @@ -362,7 +363,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (!disconnected) { if (!GetOverlappedResult(wait_event, &overlapped, &nbytes, FALSE)) { - status = APR_FROM_OS_ERROR(GetLastError()); + status = apr_get_os_error(); } /* Ugly code alert: GetOverlappedResult returns * a count of all bytes sent. This loop only @@ -373,8 +374,9 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, } } } - else if (rv == WAIT_TIMEOUT) + else if (rv == WAIT_TIMEOUT) { status = APR_FROM_OS_ERROR(WAIT_TIMEOUT); + } else if (rv == WAIT_ABANDONED) { /* Hummm... WAIT_ABANDONDED is not an error code. It is * a return specific to the Win32 WAIT functions that @@ -397,6 +399,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, /* Adjust len for any headers/trailers sent */ if (ptfb) { *len += (ptfb->HeadLength + ptfb->TailLength); + memset(&tfb, '\0', sizeof (tfb)); ptfb = NULL; } } From 1aa509dce625333188d8a55fa0cabe35c6c5aeba Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Tue, 6 Aug 2002 23:51:37 +0000 Subject: [PATCH 3787/7878] Fixed a comment to accurately reflect what the "clear" function does git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63800 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index 672ede10ba9..fbb3060d264 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -187,7 +187,7 @@ APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock); /** - * Remove all sockets from the poll structure. + * Clear all events in the poll structure. * @param aprset The poll structure we will be using. * @param events The events to clear from all sockets. One of: *

    
    From f9969b3b13137a72515bc1916cc120fa36a97176 Mon Sep 17 00:00:00 2001
    From: Brian Pane 
    Date: Wed, 7 Aug 2002 00:06:12 +0000
    Subject: [PATCH 3788/7878] Changed apr_poll_socket_remove() and apr_poll() to
     avoid putting invalid descriptors on the pollset after removing from the
     middle of the array Reported by: Rob Saccoccio 
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63801 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/unix/poll.c    | 10 +++++++++-
     poll/unix/pollacc.c | 21 +++++++++++++++++++--
     2 files changed, 28 insertions(+), 3 deletions(-)
    
    diff --git a/poll/unix/poll.c b/poll/unix/poll.c
    index f495c821f6c..da79e4b9558 100644
    --- a/poll/unix/poll.c
    +++ b/poll/unix/poll.c
    @@ -151,6 +151,10 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num,
             else if (aprset[i].desc_type == APR_POLL_FILE) {
                 pollset[i].fd = aprset[i].desc.f->filedes;
             }
    +        else if (aprset[i].desc_type == APR_NO_DESC) {
    +            num = i + 1;
    +            break;
    +        }
             pollset[i].events = get_event(aprset[i].reqevents);
         }
     
    @@ -221,7 +225,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n
     #endif
                 fd = aprset[i].desc.s->socketdes;
             }
    -        else {
    +        else if (aprset[i].desc_type == APR_POLL_FILE) {
     #if !APR_FILES_AS_SOCKETS
                 return APR_EBADF;
     #else
    @@ -237,6 +241,10 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n
     
     #endif /* APR_FILES_AS_SOCKETS */
             }
    +        else if (aprset[i].desc_type == APR_NO_DESC) {
    +            num = i + 1;
    +            break;
    +        }
             if (aprset[i].reqevents & APR_POLLIN) {
                 FD_SET(fd, &readset);
             }
    diff --git a/poll/unix/pollacc.c b/poll/unix/pollacc.c
    index d421a45c0ba..36a2c8c7c3c 100644
    --- a/poll/unix/pollacc.c
    +++ b/poll/unix/pollacc.c
    @@ -134,11 +134,28 @@ APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset,
     
     APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock)
     {
    -    apr_pollfd_t *curr = find_poll_sock(aprset, sock);
    -    if (curr == NULL) {
    +    apr_pollfd_t *match = NULL;
    +    apr_pollfd_t *curr;
    +
    +    for (curr = aprset; (curr->desc_type != APR_POLL_LASTDESC) &&
    +             (curr->desc_type != APR_NO_DESC); curr++) {
    +        if (curr->desc.s == sock) {
    +            match = curr;
    +        }
    +    }
    +    if (match == NULL) {
             return APR_NOTFOUND;
         }
     
    +    /* Remove this entry by swapping the last entry into its place.
    +     * This ensures that the non-APR_NO_DESC entries are all at the
    +     * start of the array, so that apr_poll() doesn't have to worry
    +     * about invalid entries in the middle of the pollset.
    +     */
    +    curr--;
    +    if (curr != match) {
    +        *match = *curr;
    +    }
         curr->desc_type = APR_NO_DESC;
     
         return APR_SUCCESS;
    
    From 6b13b1947e39af06239d3ac12809c2feb5a22cce Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 8 Aug 2002 19:14:19 +0000
    Subject: [PATCH 3789/7878] In apr_signal_thread() remove synchronous signals
     from the mask passed to sigwait().  It is never valid for them to be there.
     Some platforms silently ignore them, some return EINVAL, some don't process
     it as desired.
    
    One problem was found with an old Apache 2.0.30 build on AIX.
    sig_coredump() wasn't getting called when a plug-in generated SIGABRT.
    Removing SIGABRT from the signal mask passed to sigwait() by the
    main worker thread fixed the problem.  After reviewing sigwait()
    documentation it was clear that none of the synchronous signals
    should be in the mask passed to sigwait().
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63802 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                   | 5 +++++
     threadproc/unix/signals.c | 3 +++
     2 files changed, 8 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index fa6ed0d1944..7bb2182f8f5 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,10 @@
     Changes with APR b1
     
    +  *) In apr_signal_thread() remove synchronous signals from the mask
    +     passed to sigwait().  It is never valid for them to be there.
    +     Some platforms silently ignore them, some return EINVAL, some
    +     don't process it as desired.  [Jeff Trawick]
    +
       *) Change config.nice generation to always expand variables.
          [Justin Erenkrantz]
     
    diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c
    index b8cfc679802..fa4867b9b40 100644
    --- a/threadproc/unix/signals.c
    +++ b/threadproc/unix/signals.c
    @@ -374,6 +374,9 @@ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum))
         sigdelset(&sig_mask, SIGWAITING);
     #endif
     
    +    /* no synchronous signals should be in the mask passed to sigwait() */
    +    remove_sync_sigs(&sig_mask);
    +
         /* On AIX (4.3.3, at least), sigwait() won't wake up if the high-
          * order bit of the second word of flags is turned on.  sigdelset()
          * returns an error when trying to turn this off, so we'll turn it
    
    From f9fe1a3a06fd44ad4f33665958cdcee65ca439cb Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Fri, 9 Aug 2002 09:11:52 +0000
    Subject: [PATCH 3790/7878] OS/2: Add APR_ENOTIMPL stubs for apr_pollset_*()
     functions so that we can still build before I find time to implement them
     properly.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63803 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/os2/Makefile.in |   1 +
     poll/os2/pollset.c   | 104 +++++++++++++++++++++++++++++++++++++++++++
     2 files changed, 105 insertions(+)
     create mode 100644 poll/os2/pollset.c
    
    diff --git a/poll/os2/Makefile.in b/poll/os2/Makefile.in
    index 86098162b9e..96fc006fe4b 100755
    --- a/poll/os2/Makefile.in
    +++ b/poll/os2/Makefile.in
    @@ -3,6 +3,7 @@ VPATH = @srcdir@
     
     TARGETS = \
     	poll.lo \
    +	pollset.lo \
     	pollacc.lo
     
     # bring in rules.mk for standard functionality
    diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c
    new file mode 100644
    index 00000000000..bd6e30dd491
    --- /dev/null
    +++ b/poll/os2/pollset.c
    @@ -0,0 +1,104 @@
    +/* ====================================================================
    + * The Apache Software License, Version 1.1
    + *
    + * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + *
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + *
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in
    + *    the documentation and/or other materials provided with the
    + *    distribution.
    + *
    + * 3. The end-user documentation included with the redistribution,
    + *    if any, must include the following acknowledgment:
    + *       "This product includes software developed by the
    + *        Apache Software Foundation (http://www.apache.org/)."
    + *    Alternately, this acknowledgment may appear in the software itself,
    + *    if and wherever such third-party acknowledgments normally appear.
    + *
    + * 4. The names "Apache" and "Apache Software Foundation" must
    + *    not be used to endorse or promote products derived from this
    + *    software without prior written permission. For written
    + *    permission, please contact apache@apache.org.
    + *
    + * 5. Products derived from this software may not be called "Apache",
    + *    nor may "Apache" appear in their name, without prior written
    + *    permission of the Apache Software Foundation.
    + *
    + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + * ====================================================================
    + *
    + * This software consists of voluntary contributions made by many
    + * individuals on behalf of the Apache Software Foundation.  For more
    + * information on the Apache Software Foundation, please see
    + * .
    + */
    +
    +#include "apr.h"
    +#include "apr_poll.h"
    +#include "networkio.h"
    +
    +
    +
    +struct apr_pollset_t {
    +    apr_pool_t *pool;
    +};
    +
    +APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
    +                                             apr_uint32_t size,
    +                                             apr_pool_t *p,
    +                                             apr_uint32_t flags)
    +{
    +    return APR_ENOTIMPL;
    +}
    +
    +
    +
    +APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset)
    +{
    +    return APR_ENOTIMPL;
    +}
    +
    +
    +
    +APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset,
    +                                          const apr_pollfd_t *descriptor)
    +{
    +    return APR_ENOTIMPL;
    +}
    +
    +
    +
    +APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset,
    +                                             const apr_pollfd_t *descriptor)
    +{
    +    return APR_ENOTIMPL;
    +}
    +
    +
    +
    +APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
    +                                           apr_interval_time_t timeout,
    +                                           apr_int32_t *num,
    +                                           const apr_pollfd_t **descriptors)
    +{
    +    return APR_ENOTIMPL;
    +}
    
    From 2deb6bb3935bc4bd87fb7a119b5e3c0684d18949 Mon Sep 17 00:00:00 2001
    From: Brian Pane 
    Date: Sun, 11 Aug 2002 20:53:43 +0000
    Subject: [PATCH 3791/7878] Cleaned up the code for handling invalid descriptor
     types in apr_poll
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63805 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/unix/poll.c | 16 +++++++++-------
     1 file changed, 9 insertions(+), 7 deletions(-)
    
    diff --git a/poll/unix/poll.c b/poll/unix/poll.c
    index da79e4b9558..82b049902ae 100644
    --- a/poll/unix/poll.c
    +++ b/poll/unix/poll.c
    @@ -117,7 +117,7 @@ static apr_int16_t get_revent(apr_int16_t event)
     APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num,
                           apr_int32_t *nsds, apr_interval_time_t timeout)
     {
    -    int i;
    +    int i, num_to_poll;
     #ifdef HAVE_VLA
         /* XXX: I trust that this is a segv when insufficient stack exists? */
         struct pollfd pollset[num];
    @@ -151,18 +151,18 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num,
             else if (aprset[i].desc_type == APR_POLL_FILE) {
                 pollset[i].fd = aprset[i].desc.f->filedes;
             }
    -        else if (aprset[i].desc_type == APR_NO_DESC) {
    -            num = i + 1;
    +        else {
                 break;
             }
             pollset[i].events = get_event(aprset[i].reqevents);
         }
    +    num_to_poll = i;
     
         if (timeout > 0) {
             timeout /= 1000; /* convert microseconds to milliseconds */
         }
     
    -    i = poll(pollset, num, timeout);
    +    i = poll(pollset, num_to_poll, timeout);
         (*nsds) = i;
     
         for (i = 0; i < num; i++) {
    @@ -241,8 +241,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n
     
     #endif /* APR_FILES_AS_SOCKETS */
             }
    -        else if (aprset[i].desc_type == APR_NO_DESC) {
    -            num = i + 1;
    +        else {
                 break;
             }
             if (aprset[i].reqevents & APR_POLLIN) {
    @@ -287,13 +286,16 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n
             if (aprset[i].desc_type == APR_POLL_SOCKET) {
                 fd = aprset[i].desc.s->socketdes;
             }
    -        else {
    +        else if (aprset[i].desc_type == APR_POLL_FILE) {
     #if !APR_FILES_AS_SOCKETS
                 return APR_EBADF;
     #else
                 fd = aprset[i].desc.f->filedes;
     #endif
             }
    +        else {
    +            break;
    +        }
             aprset[i].rtnevents = 0;
             if (FD_ISSET(fd, &readset)) {
                 aprset[i].rtnevents |= APR_POLLIN;
    
    From f832d97f2480e0fa9b8f234dde9e80407bca06ec Mon Sep 17 00:00:00 2001
    From: Sander Striker 
    Date: Mon, 12 Aug 2002 22:02:18 +0000
    Subject: [PATCH 3792/7878] Fix pools to play nice with gcc bounds checking.
    
    Submitted by:	Blair Zajac 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63806 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_pools.c | 14 +++++---------
     1 file changed, 5 insertions(+), 9 deletions(-)
    
    diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
    index d8b6dd4fd66..059af143aae 100644
    --- a/memory/unix/apr_pools.c
    +++ b/memory/unix/apr_pools.c
    @@ -606,24 +606,21 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size)
     {
         apr_memnode_t *active, *node;
         void *mem;
    -    char *endp;
         apr_uint32_t free_index;
     
         size = APR_ALIGN_DEFAULT(size);
         active = pool->active;
     
         /* If the active node has enough bytes left, use it. */
    -    endp = active->first_avail + size;
    -    if (endp < active->endp) {
    +    if (size < active->endp - active->first_avail) {
             mem = active->first_avail;
    -        active->first_avail = endp;
    +        active->first_avail += size;
     
             return mem;
         }
     
         node = active->next;
    -    endp = node->first_avail + size;
    -    if (endp < node->endp) {
    +    if (size < node->endp - node->first_avail) {
             *node->ref = node->next;
             node->next->ref = node->ref;
         }
    @@ -634,13 +631,12 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size)
     
                 return NULL;
             }
    -        endp = node->first_avail + size;
         }
     
         node->free_index = 0;
     
         mem = node->first_avail;
    -    node->first_avail = endp;
    +    node->first_avail += size;
     
         node->ref = active->ref;
         *node->ref = node;
    @@ -929,7 +925,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff)
             size = APR_PSPRINTF_MIN_STRINGSIZE;
     
         node = active->next;
    -    if (!ps->got_a_new_node && node->first_avail + size < node->endp) {
    +    if (!ps->got_a_new_node && size < node->endp - node->first_avail) {
             *node->ref = node->next;
             node->next->ref = node->ref;
     
    
    From deedf65ca549305c684c836a65483b5ef6301b07 Mon Sep 17 00:00:00 2001
    From: Greg Ames 
    Date: Tue, 13 Aug 2002 13:51:53 +0000
    Subject: [PATCH 3793/7878] apr_strtoi64: off-by-one errors in the ebcdic test
     (i.e. 'I' - 'A' is 8). It's much more straightforward to test
     APR_CHARSET_EBCDIC.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63807 13f79535-47bb-0310-9956-ffa450edef68
    ---
     strings/apr_strings.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/strings/apr_strings.c b/strings/apr_strings.c
    index 3ab08a67112..8a19945c7e7 100644
    --- a/strings/apr_strings.c
    +++ b/strings/apr_strings.c
    @@ -334,7 +334,7 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base)
     	    c -= 'A' - 10;
     	else if (c >= 'a' && c <= 'z')
     	    c -= 'a' - 10;
    -#elif (('I' - 'A') == 9) && (('R' - 'J') == 9) && (('Z' - 'S') == 8) 
    +#elif APR_CHARSET_EBCDIC
     	else if (c >= 'A' && c <= 'I')
     	    c -= 'A' - 10;
     	else if (c >= 'J' && c <= 'R')
    
    From ffd6fea0ecb654028bb31101ab11f0bf59ff17fa Mon Sep 17 00:00:00 2001
    From: Greg Ames 
    Date: Tue, 13 Aug 2002 17:30:06 +0000
    Subject: [PATCH 3794/7878] document the ebcdic build problem with
     apr_strings.c since it exists in the httpd-2.0.40 release tarball.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63808 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index 7bb2182f8f5..39cee97556b 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,9 @@
     Changes with APR b1
     
    +  *) EBCDIC: fix compile failure in strings/apr_strings.c in
    +     httpd-2.0.40 with the following error message:
    +     CANNOT COMPILE apr_strtoi64(), only ASCII and EBCDIC supported
    +     
       *) In apr_signal_thread() remove synchronous signals from the mask
          passed to sigwait().  It is never valid for them to be there.
          Some platforms silently ignore them, some return EINVAL, some
    
    From 77987bd66a9911b8c4c310a975dd199606fe4e84 Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Wed, 14 Aug 2002 04:35:19 +0000
    Subject: [PATCH 3795/7878] silly change to make emacs happier
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63809 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr-config.in | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/apr-config.in b/apr-config.in
    index 5424a76508a..b68766ba103 100644
    --- a/apr-config.in
    +++ b/apr-config.in
    @@ -106,6 +106,7 @@ or when linking directly:
     An application should use the results of --cflags, --cppflags, --includes,
     and --ldflags in their build process.
     EOF
    +#' close a quote from above to make emacs happy
     }
     
     if test $# -eq 0; then
    
    From dc0e0074ed8fa85bf03897e140f4bc14233ea647 Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Wed, 14 Aug 2002 16:06:56 +0000
    Subject: [PATCH 3796/7878] what the heck? toss this silly little file. it
     wasn't even getting built, and its purpose is unknown. most likely a turd
     from Ryan's initial import into APR several years ago...
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63810 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/abc.c | 28 ----------------------------
     1 file changed, 28 deletions(-)
     delete mode 100644 test/abc.c
    
    diff --git a/test/abc.c b/test/abc.c
    deleted file mode 100644
    index d0cd82302a7..00000000000
    --- a/test/abc.c
    +++ /dev/null
    @@ -1,28 +0,0 @@
    -#include 
    -#include 
    -#include 
    -#include "apr_file_io.h"
    -#include "apr_general.h"
    -
    -int main(int argc, char *argv[])
    -{
    -    apr_file_t *fd = NULL;
    -    char ch;
    -    int status = 0;
    -    apr_pool_t *context;
    -
    -    apr_pool_create(&context, NULL); 
    -
    -    apr_file_open(&fd, argv[1], APR_READ, -1, context);
    -    
    -    while (!status) {
    -        status = apr_file_getc(&ch, fd);
    -        if (status == APR_EOF )
    -            fprintf(stdout, "EOF, YEAH!!!!!!!!!\n");
    -        else if (status == APR_SUCCESS)
    -            fprintf(stdout, "%c", ch);
    -        else
    -            fprintf(stdout, " Big error, NOooooooooo!\n");
    -    }
    -    return 1; 
    -}    
    
    From 873313dd7c85f9715b04f0515ab9dea7856cd854 Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Wed, 14 Aug 2002 17:15:15 +0000
    Subject: [PATCH 3797/7878] Various changes to clean up APR for a release.
    
    * Add a version number to the library name to support parallel
      installation.
      See: http://www106.pair.com/rhp/parallel.html
    
      (assuming the app uses apr-config to fetch linking information, then
       users should not have anything to change)
    
    * Get rid of APRVARS. Apps should be using apr-config by now.
    
    * Add --version to apr-config so that apps can see what they're
      building against.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63811 13f79535-47bb-0310-9956-ffa450edef68
    ---
     .cvsignore           |  1 -
     APRVARS.in           | 14 --------------
     CHANGES              |  9 +++++++++
     Makefile.in          |  7 +++----
     apr-config.in        | 12 +++++++++---
     build/get-version.sh | 31 +++++++++++++++++++++++++++++++
     configure.in         | 16 ++++++++++++++--
     test/Makefile.in     |  2 +-
     8 files changed, 67 insertions(+), 25 deletions(-)
     delete mode 100644 APRVARS.in
     create mode 100755 build/get-version.sh
    
    diff --git a/.cvsignore b/.cvsignore
    index 28bd8376994..e24285d0b0b 100644
    --- a/.cvsignore
    +++ b/.cvsignore
    @@ -5,7 +5,6 @@ config.nice
     config.status
     configure
     libtool
    -APRVARS
     apr-config
     LibD
     LibR
    diff --git a/APRVARS.in b/APRVARS.in
    deleted file mode 100644
    index 2e933a51727..00000000000
    --- a/APRVARS.in
    +++ /dev/null
    @@ -1,14 +0,0 @@
    -CC="@CC@"
    -CPP="@CPP@"
    -SHELL="@SHELL@"
    -EXTRA_CPPFLAGS="@EXTRA_CPPFLAGS@"
    -EXTRA_CFLAGS="@EXTRA_CFLAGS@"
    -EXTRA_LDFLAGS="@EXTRA_LDFLAGS@"
    -EXTRA_LIBS="@EXTRA_LIBS@"
    -EXTRA_INCLUDES="@EXTRA_INCLUDES@"
    -LIBTOOL_LIBS="@LIBTOOL_LIBS@"
    -SHLIBPATH_VAR="@shlibpath_var@"
    -APR_SOURCE_DIR="@apr_srcdir@"
    -APR_SO_EXT="@so_ext@"
    -APR_LIB_TARGET="@export_lib_target@"
    -
    diff --git a/CHANGES b/CHANGES
    index 39cee97556b..574e7875b3e 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,14 @@
     Changes with APR b1
     
    +  *) Add a version number to the library name (e.g. libapr-1.so) so
    +     that apps can do things like: -lapr-1 or -lapr-2, depending on
    +     which version they want to use and link against.
    +
    +  *) Add --version to apr-config so that apps can retrieve the version
    +     information of the (installed) APR. [Greg Stein]
    +
    +  *) Remove the APRVARS system; apps should use apr-config. [Greg Stein]
    +
       *) EBCDIC: fix compile failure in strings/apr_strings.c in
          httpd-2.0.40 with the following error message:
          CANNOT COMPILE apr_strtoi64(), only ASCII and EBCDIC supported
    diff --git a/Makefile.in b/Makefile.in
    index ace243babb9..c52240ea794 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -17,7 +17,7 @@ SUBDIRS=@SUBDIRS@
     CLEAN_SUBDIRS= . test build
     INSTALL_SUBDIRS=@INSTALL_SUBDIRS@
     
    -TARGET_LIB = libapr.la
    +TARGET_LIB = @APR_LIBNAME@.la
     
     #
     # Rules for building specific targets, starting with 'all' for
    @@ -31,7 +31,7 @@ TARGETS = delete-lib $(TARGET_LIB) delete-exports export_vars.h apr.exp
     CLEAN_TARGETS = 
     DISTCLEAN_TARGETS = config.cache config.log config.status \
     	include/apr.h include/arch/unix/apr_private.h \
    -	APRVARS libtool apr.exp apr-config
    +	libtool apr.exp apr-config
     EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in \
     	exports.c export_vars.h
     
    @@ -71,7 +71,6 @@ install: $(TARGET_LIB)
     	    $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(libdir); \
     	fi;
     	$(LIBTOOL) --mode=install cp $(TARGET_LIB) $(DESTDIR)$(libdir)
    -	$(LIBTOOL) --mode=install cp APRVARS $(DESTDIR)$(libdir)
     	$(LIBTOOL) --mode=install cp apr.exp $(DESTDIR)$(libdir)
     	if [ ! -d $(DESTDIR)$(installbuilddir) ]; then \
     	   	$(top_srcdir)/build/mkdir.sh $(DESTDIR)$(installbuilddir); \
    @@ -116,7 +115,7 @@ export_vars.h:
     	$(AWK) -f $(top_srcdir)/build/make_var_export.awk $(EXPORT_FILES) > $@
     
     apr.exp: exports.c export_vars.h
    -	@echo "#! libapr.so" > $@
    +	@echo "#! @APR_LIBNAME@.so" > $@
     	@echo "* This file was AUTOGENERATED at build time." >> $@
     	@echo "* Please do not edit by hand." >> $@
     	$(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@
    diff --git a/apr-config.in b/apr-config.in
    index b68766ba103..56ef86594d8 100644
    --- a/apr-config.in
    +++ b/apr-config.in
    @@ -75,6 +75,8 @@ SHLIBPATH_VAR="@shlibpath_var@"
     APR_SOURCE_DIR="@apr_srcdir@"
     APR_SO_EXT="@so_ext@"
     APR_LIB_TARGET="@export_lib_target@"
    +APR_DOTTED_VERSION="@APR_DOTTED_VERSION@"
    +APR_LIBNAME="@APR_LIBNAME@"
     
     show_usage()
     {
    @@ -96,6 +98,7 @@ Known values for OPTION are:
       --apr-so-ext      print the extensions of shared objects on this platform
       --apr-lib-target  print the libtool target information
       --apr-libtool     print the path to APR's libtool
    +  --version         print the APR's version as a dotted triple
       --help            print this help
     
     When linking with libtool, an application should do something like:
    @@ -106,7 +109,6 @@ or when linking directly:
     An application should use the results of --cflags, --cppflags, --includes,
     and --ldflags in their build process.
     EOF
    -#' close a quote from above to make emacs happy
     }
     
     if test $# -eq 0; then
    @@ -130,9 +132,9 @@ else
     fi
     
     if test "$location" = "installed"; then
    -    LA_FILE="$libdir/libapr.la"
    +    LA_FILE="$libdir/${APR_LIBNAME}.la"
     else
    -    LA_FILE="$thisdir/libapr.la"
    +    LA_FILE="$thisdir/${APR_LIBNAME}.la"
     fi
     
     flags=""
    @@ -178,6 +180,10 @@ while test $# -gt 0; do
         echo $APR_SOURCE_DIR
         exit 0
         ;;
    +    --version)
    +    echo $APR_DOTTED_VERSION
    +    exit 0
    +    ;;
         --link-ld)
         if test "$location" = "installed"; then
             ### avoid using -L if libdir is a "standard" location like /usr/lib
    diff --git a/build/get-version.sh b/build/get-version.sh
    new file mode 100755
    index 00000000000..77ab4bbacd3
    --- /dev/null
    +++ b/build/get-version.sh
    @@ -0,0 +1,31 @@
    +#!/bin/sh
    +#
    +# extract version numbers from the apr_version.h header file
    +#
    +# USAGE: get-version.sh CMD INCLUDEDIR
    +#   where CMD is one of: all, major
    +#
    +#   get-version.sh all returns a dotted version number
    +#   get-version.sh major returns just the major version number
    +#
    +
    +if test $# != 2; then
    +  echo "USAGE: $0 CMD INCLUDEDIR"
    +  echo "  where CMD is one of: all, major"
    +  exit 1
    +fi
    +
    +versfile=${2}/apr_version.h
    +
    +major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $versfile`"
    +minor="`sed -n '/#define.*APR_MINOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $versfile`"
    +patch="`sed -n '/#define.*APR_PATCH_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $versfile`"
    +
    +if test "$1" = "all"; then
    +  echo ${major}.${minor}.${patch}
    +elif test "$1" = "major"; then
    +  echo ${major}
    +else
    +  echo "ERROR: unknown version CMD"
    +  exit 1
    +fi
    diff --git a/configure.in b/configure.in
    index dac4cea7354..df9314b3139 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -102,7 +102,20 @@ AC_ISC_POSIX
     AC_MINIX
     
     APR_EBCDIC
    - 
    +
    +dnl get our version information
    +APR_MAJOR_VERSION="`$apr_builders/get-version.sh major $apr_srcdir/include`"
    +APR_DOTTED_VERSION="`$apr_builders/get-version.sh all $apr_srcdir/include`"
    +
    +dnl this one will go into apr-config.in
    +AC_SUBST(APR_DOTTED_VERSION)
    +
    +echo "APR Version: ${APR_DOTTED_VERSION}"
    +
    +dnl this is our library name
    +APR_LIBNAME="libapr-${APR_MAJOR_VERSION}"
    +AC_SUBST(APR_LIBNAME)
    +
     dnl prep libtool
     dnl
     echo "performing libtool configuration..."
    @@ -1830,7 +1843,6 @@ test -d $dir || $MKDIR $dir
     AC_OUTPUT([
     	$MAKEFILE1 $MAKEFILE2 $MAKEFILE3
     	include/apr.h
    -	APRVARS
     	build/rules.mk
     	apr-config
     ],[
    diff --git a/test/Makefile.in b/test/Makefile.in
    index fc61f0d43c1..a7555562a49 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -52,7 +52,7 @@ TARGETS = $(PROGRAMS) $(NONPORTABLE)
     # bring in rules.mk for standard functionality
     @INCLUDE_RULES@
     
    -LOCAL_LIBS=../libapr.la
    +LOCAL_LIBS=../@APR_LIBNAME@.la
     
     CLEAN_TARGETS = testfile.tmp testdso@EXEEXT@ mod_test.slo
     
    
    From ce283e79bee77fa6f57bb2e4fd39d18b57aa3736 Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Thu, 15 Aug 2002 03:23:36 +0000
    Subject: [PATCH 3798/7878] Add a comment about a needed (future) fix to the
     API.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63812 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_network_io.h | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/include/apr_network_io.h b/include/apr_network_io.h
    index 9da7f662bf3..bb9dbad7a5e 100644
    --- a/include/apr_network_io.h
    +++ b/include/apr_network_io.h
    @@ -380,6 +380,8 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname,
      *                 *scope_id will be NULL if no scope id was specified.
      * @param port The port number.  On output, *port will be 0 if no port was 
      *             specified.
    + *             ### FIXME: 0 is a legal port (per RFC 1700). this should
    + *             ### return something besides zero if the port is missing.
      * @param str The input string to be parsed.
      * @param p The pool from which *addr and *scope_id are allocated.
      * @remark If scope id shouldn't be allowed, check for scope_id != NULL in 
    
    From 7e8eccb014906487b1059e98bb1241ebea9c31c5 Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Thu, 15 Aug 2002 05:34:30 +0000
    Subject: [PATCH 3799/7878] * build/get-version.sh: accept a specific header
     file rather than     looking specifically for apr_version.h (some more work
     will enable     other apps to reuse this script). add a 'libtool' command for
         generating a version number intended for libtool's -version-info    
     switch.
    
    * configure.in: tweak the calling sequences for get-version.sh. add a
        call to get the libtool version information and plug that into the
        link command. we now generate .so files with .so.0.{MINOR}.{PATCH}
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63813 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/get-version.sh | 17 +++++++++--------
     configure.in         |  9 ++++++---
     2 files changed, 15 insertions(+), 11 deletions(-)
    
    diff --git a/build/get-version.sh b/build/get-version.sh
    index 77ab4bbacd3..f85b297981d 100755
    --- a/build/get-version.sh
    +++ b/build/get-version.sh
    @@ -1,12 +1,13 @@
     #!/bin/sh
     #
    -# extract version numbers from the apr_version.h header file
    +# extract version numbers from a header file
     #
    -# USAGE: get-version.sh CMD INCLUDEDIR
    -#   where CMD is one of: all, major
    +# USAGE: get-version.sh CMD VERSION_HEADER
    +#   where CMD is one of: all, major, libtool
     #
     #   get-version.sh all returns a dotted version number
     #   get-version.sh major returns just the major version number
    +#   get-version.sh libtool returns a version "libtool -version-info" format
     #
     
     if test $# != 2; then
    @@ -15,16 +16,16 @@ if test $# != 2; then
       exit 1
     fi
     
    -versfile=${2}/apr_version.h
    -
    -major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $versfile`"
    -minor="`sed -n '/#define.*APR_MINOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $versfile`"
    -patch="`sed -n '/#define.*APR_PATCH_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $versfile`"
    +major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $2`"
    +minor="`sed -n '/#define.*APR_MINOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $2`"
    +patch="`sed -n '/#define.*APR_PATCH_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $2`"
     
     if test "$1" = "all"; then
       echo ${major}.${minor}.${patch}
     elif test "$1" = "major"; then
       echo ${major}
    +elif test "$1" = "libtool"; then
    +  echo ${minor}:${patch}:${minor}
     else
       echo "ERROR: unknown version CMD"
       exit 1
    diff --git a/configure.in b/configure.in
    index df9314b3139..71985e6678d 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -104,8 +104,10 @@ AC_MINIX
     APR_EBCDIC
     
     dnl get our version information
    -APR_MAJOR_VERSION="`$apr_builders/get-version.sh major $apr_srcdir/include`"
    -APR_DOTTED_VERSION="`$apr_builders/get-version.sh all $apr_srcdir/include`"
    +get_version="$apr_builders/get-version.sh"
    +version_hdr="$apr_srcdir/include/apr_version.h"
    +APR_MAJOR_VERSION="`$get_version major $version_hdr`"
    +APR_DOTTED_VERSION="`$get_version all $version_hdr`"
     
     dnl this one will go into apr-config.in
     AC_SUBST(APR_DOTTED_VERSION)
    @@ -149,7 +151,8 @@ AC_ARG_WITH(libtool, [  --without-libtool       avoid using libtool to link the
     
     if test "x$use_libtool" = "xyes"; then
           lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -c $< && touch $@'
    -      link='$(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(ALL_LDFLAGS) -o $@'
    +      LT_VERSION="-version-info `$get_version libtool $version_hdr`"
    +      link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) ${LT_VERSION} \$(ALL_LDFLAGS) -o \$@"
           so_ext='lo'
           lib_target='-rpath $(libdir) $$objects'
           export_lib_target='-rpath \$(libdir) \$\$objects'
    
    From a4d9d1cd56e0de83e5009e6bbc5a7d4adcf2832f Mon Sep 17 00:00:00 2001
    From: Karl Fogel 
    Date: Thu, 15 Aug 2002 17:56:04 +0000
    Subject: [PATCH 3800/7878] Expand the error code spaces:
    
    * include/apr_errno.h
    
      (APR_OS_ERRSPACE_SIZE): New #defined constant, init to 50000.
    
      (APR_OS_START_USERERR): New name for APR_OS_START_USEERR.  Leave the
      old name defined for compatibility, but mark as obsolete.
    
      (APR_OS_START_STATUS, APR_OS_START_USERERR, APR_OS_START_CANONERR,
      APR_OS_START_EAIERR, APR_OS_START_SYSERR): Expand ranges as per
      above, and give USERERR a range ten times larger than the others.
    
    * misc/unix/errorcodes.c
      (apr_strerror): Adjust for the rename.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63814 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h    | 29 ++++++++++++++++++++++-------
     misc/unix/errorcodes.c |  2 +-
     2 files changed, 23 insertions(+), 8 deletions(-)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 2a372ffd114..0b87233e609 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -148,30 +148,45 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
      * APR_OS_START_ERROR is where the APR specific error values start.
      */
     #define APR_OS_START_ERROR     20000
    +/**
    + * APR_OS_ERRSPACE_SIZE is the maximum number of errors you can fit
    + *    into one of the error/status ranges below -- except for
    + *    APR_OS_START_USERERR, which see.
    + */
    +#define APR_OS_ERRSPACE_SIZE 50000
     /**
      * APR_OS_START_STATUS is where the APR specific status codes start.
      */
    -#define APR_OS_START_STATUS    (APR_OS_START_ERROR + 500)
    +#define APR_OS_START_STATUS    (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
    +/**
    + * APR_OS_START_USERERR are reserved for applications that use APR that
    + *     layer their own error codes along with APR's.  Note that the
    + *     error immediately following this one is set ten times farther
    + *     away than usual, so that users of apr have a lot of room in
    + *     which to declare custom error codes.
    + */
    +#define APR_OS_START_USERERR    (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
     /**
    - * APR_OS_START_USEERR are reserved for applications that use APR that
    - *     layer their own error codes along with APR's.
    + * APR_OS_START_USEERR is obsolete, defined for compatibility only.
    + * Use APR_OS_START_USERERR instead.
      */
    -#define APR_OS_START_USEERR    (APR_OS_START_STATUS + 500)
    +#define APR_OS_START_USEERR     APR_OS_START_USERERR
     /**
      * APR_OS_START_CANONERR is where APR versions of errno values are defined
      *     on systems which don't have the corresponding errno.
      */
    -#define APR_OS_START_CANONERR  (APR_OS_START_USEERR + 500)
    +#define APR_OS_START_CANONERR  (APR_OS_START_USERERR \
    +                                 + (APR_OS_ERRSPACE_SIZE * 10))
     /**
      * APR_OS_START_EAIERR folds EAI_ error codes from getaddrinfo() into 
      *     apr_status_t values.
      */
    -#define APR_OS_START_EAIERR    (APR_OS_START_CANONERR + 500)
    +#define APR_OS_START_EAIERR    (APR_OS_START_CANONERR + APR_OS_ERRSPACE_SIZE)
     /**
      * APR_OS_START_SYSERR folds platform-specific system error values into 
      *     apr_status_t values.
      */
    -#define APR_OS_START_SYSERR    (APR_OS_START_EAIERR + 500)
    +#define APR_OS_START_SYSERR    (APR_OS_START_EAIERR + APR_OS_ERRSPACE_SIZE)
     
     /** no error. @see APR_STATUS_IS_SUCCESS */
     #define APR_SUCCESS 0
    diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c
    index 74c0aedb220..abec8154186 100644
    --- a/misc/unix/errorcodes.c
    +++ b/misc/unix/errorcodes.c
    @@ -409,7 +409,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
         if (statcode < APR_OS_START_ERROR) {
             return native_strerror(statcode, buf, bufsize);
         }
    -    else if (statcode < APR_OS_START_USEERR) {
    +    else if (statcode < APR_OS_START_USERERR) {
             return stuffbuffer(buf, bufsize, apr_error_string(statcode));
         }
         else if (statcode < APR_OS_START_EAIERR) {
    
    From bcc1607b99df9694949cc778ef065cee00532448 Mon Sep 17 00:00:00 2001
    From: Thom May 
    Date: Thu, 15 Aug 2002 19:58:35 +0000
    Subject: [PATCH 3801/7878] configure.in   Add layout and argument parsing
     macros
    
    config.layout
      Create a skeleton set of layouts for APR
    
    build/apr_common.m4
      APR_LAYOUT: New macro to parse layouts stored in config.layout
    
      APR_ENABLE_LAYOUT: New macro to enable layout parsing, takes one argument
      in configure, --enable-layout=
    
      APR_PARSE_ARGUMENTS: New macro to allow us to reparse location handling
      arguments after setting up a layout.
    
    Concept Obtained From: Justin, Greg
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63815 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_common.m4 | 193 +++++++++++++++++++++++++++++++++++++++
     config.layout       | 213 ++++++++++++++++++++++++++++++++++++++++++++
     configure.in        |   5 ++
     3 files changed, 411 insertions(+)
     create mode 100644 config.layout
    
    diff --git a/build/apr_common.m4 b/build/apr_common.m4
    index af072ff7ca2..24483734712 100644
    --- a/build/apr_common.m4
    +++ b/build/apr_common.m4
    @@ -653,3 +653,196 @@ dnl Note: this define must be on one line so that it can be properly returned
     dnl as the help string.  When using this macro with a multi-line RHS, ensure
     dnl that you surround the macro invocation with []s
     AC_DEFUN(APR_HELP_STRING,[ifelse(regexp(AC_ACVERSION, 2\.1), -1, AC_HELP_STRING([$1],[$2]),[  ][$1] substr([                       ],len($1))[$2])])
    +
    +dnl
    +dnl APR_LAYOUT(configlayout, layoutname)
    +dnl
    +AC_DEFUN(APR_LAYOUT,[
    +  if test ! -f $srcdir/config.layout; then
    +    echo "** Error: Layout file $srcdir/config.layout not found"
    +    echo "** Error: Cannot use undefined layout '$LAYOUT'"
    +    exit 1
    +  fi
    +  pldconf=./config.pld
    +  changequote({,})
    +  sed -e "1,/[ 	]*<[lL]ayout[ 	]*$2[ 	]*>[ 	]*/d" \
    +      -e '/[ 	]*<\/Layout>[ 	]*/,$d' \
    +      -e "s/^[ 	]*//g" \
    +      -e "s/:[ 	]*/=\'/g" \
    +      -e "s/[ 	]*$/'/g" \
    +      $1 > $pldconf
    +  layout_name=$2
    +  . $pldconf
    +  rm $pldconf
    +  for var in prefix exec_prefix bindir sbindir libexecdir mandir \
    +             sysconfdir datadir  \
    +             includedir localstatedir runtimedir logfiledir libdir \
    +             installbuilddir; do
    +    eval "val=\"\$$var\""
    +    case $val in
    +      *+)
    +        val=`echo $val | sed -e 's;\+$;;'`
    +        eval "$var=\"\$val\""
    +        autosuffix=yes
    +        ;;
    +      *)
    +        autosuffix=no
    +        ;;
    +    esac
    +    val=`echo $val | sed -e 's:\(.\)/*$:\1:'`
    +    val=`echo $val | sed -e 's:[\$]\([a-z_]*\):${\1}:g'`
    +    if test "$autosuffix" = "yes"; then
    +      if echo $val | grep apache >/dev/null; then
    +        addtarget=no
    +      else
    +        addtarget=yes
    +      fi
    +      if test "$addtarget" = "yes"; then
    +        val="$val/apache2"
    +      fi
    +    fi
    +    eval "$var='$val'"
    +  done
    +  changequote([,])
    +])dnl
    +
    +dnl
    +dnl APR_ENABLE_LAYOUT
    +dnl
    +AC_DEFUN(APR_ENABLE_LAYOUT,[
    +AC_ARG_ENABLE(layout,
    +[  --enable-layout=LAYOUT],[
    +  LAYOUT=$enableval
    +])
    +
    +if test -z "$LAYOUT"; then
    +  LAYOUT="Apache"
    +fi
    +APR_LAYOUT($srcdir/config.layout, $LAYOUT)
    +
    +AC_MSG_CHECKING(for chosen layout)
    +AC_MSG_RESULT($layout_name)
    +])
    +
    +
    +dnl
    +dnl APR_PARSE_ARGUMENTS
    +dnl a reimplementation of autoconf's argument parser,
    +dnl used here to allow us to co-exist layouts and argument based
    +dnl set ups.
    +AC_DEFUN(APR_PARSE_ARGUMENTS,[
    +ac_prev=
    +for ac_option
    +do
    +  # If the previous option needs an argument, assign it.
    +  if test -n "$ac_prev"; then
    +    eval "$ac_prev=\$ac_option"
    +    ac_prev=
    +    continue
    +  fi
    +
    +  ac_optarg=`expr "x$ac_option" : 'x[[^=]]*=\(.*\)'`
    +
    +  case $ac_option in
    +
    +  -bindir | --bindir | --bindi | --bind | --bin | --bi)
    +    ac_prev=bindir ;;
    +  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
    +    bindir="$ac_optarg" ;;
    +
    +  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
    +    ac_prev=datadir ;;
    +  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
    +  | --da=*)
    +    datadir="$ac_optarg" ;;
    +
    +  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
    +  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
    +  | --exec | --exe | --ex)
    +    ac_prev=exec_prefix ;;
    +  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
    +  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
    +  | --exec=* | --exe=* | --ex=*)
    +    exec_prefix="$ac_optarg" ;;
    +
    +  -includedir | --includedir | --includedi | --included | --include \
    +  | --includ | --inclu | --incl | --inc)
    +    ac_prev=includedir ;;
    +  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
    +  | --includ=* | --inclu=* | --incl=* | --inc=*)
    +    includedir="$ac_optarg" ;;
    +
    +  -infodir | --infodir | --infodi | --infod | --info | --inf)
    +    ac_prev=infodir ;;
    +  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
    +    infodir="$ac_optarg" ;;
    +
    +  -libdir | --libdir | --libdi | --libd)
    +    ac_prev=libdir ;;
    +  -libdir=* | --libdir=* | --libdi=* | --libd=*)
    +    libdir="$ac_optarg" ;;
    +
    +  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
    +  | --libexe | --libex | --libe)
    +    ac_prev=libexecdir ;;
    +  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
    +  | --libexe=* | --libex=* | --libe=*)
    +    libexecdir="$ac_optarg" ;;
    +
    +  -localstatedir | --localstatedir | --localstatedi | --localstated \
    +  | --localstate | --localstat | --localsta | --localst \
    +  | --locals | --local | --loca | --loc | --lo)
    +    ac_prev=localstatedir ;;
    +  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
    +  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
    +  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
    +    localstatedir="$ac_optarg" ;;
    +
    +  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
    +    ac_prev=mandir ;;
    +  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
    +    mandir="$ac_optarg" ;;
    +
    +  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
    +    ac_prev=prefix ;;
    +  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
    +    prefix="$ac_optarg" ;;
    +
    +  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
    +    ac_prev=sbindir ;;
    +  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
    +  | --sbi=* | --sb=*)
    +    sbindir="$ac_optarg" ;;
    +
    +  -sharedstatedir | --sharedstatedir | --sharedstatedi \
    +  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
    +  | --sharedst | --shareds | --shared | --share | --shar \
    +  | --sha | --sh)
    +    ac_prev=sharedstatedir ;;
    +  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
    +  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
    +  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
    +  | --sha=* | --sh=*)
    +    sharedstatedir="$ac_optarg" ;;
    +
    +  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
    +  | --syscon | --sysco | --sysc | --sys | --sy)
    +    ac_prev=sysconfdir ;;
    +  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
    +  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
    +    sysconfdir="$ac_optarg" ;;
    +
    +  esac
    +done
    +
    +# Be sure to have absolute paths.
    +for ac_var in exec_prefix prefix
    +do
    +  eval ac_val=$`echo $ac_var`
    +  case $ac_val in
    +    [[\\/$]]* | ?:[[\\/]]* | NONE | '' ) ;;
    +    *)  AC_MSG_ERROR([expected an absolute path for --$ac_var: $ac_val]);;
    +  esac
    +done
    +
    +])dnl
    diff --git a/config.layout b/config.layout
    new file mode 100644
    index 00000000000..245da94eb7c
    --- /dev/null
    +++ b/config.layout
    @@ -0,0 +1,213 @@
    +##
    +##  config.layout -- Pre-defined Installation Path Layouts
    +##
    +##  Hints:
    +##  - layouts can be loaded with configure's --enable-layout=ID option
    +##  - when no --enable-layout option is given, the default layout is `apr'
    +##  - a trailing plus character (`+') on paths is replaced with a 
    +##    `/' suffix where  is currently hardcoded to 'apr'.
    +##    (This may become a configurable parameter at some point.)
    +##
    +
    +#   Classical apr path layout.
    +
    +    prefix:        /usr/local/apr
    +    exec_prefix:   ${prefix}
    +    bindir:        ${exec_prefix}/bin
    +    sbindir:       ${exec_prefix}/bin
    +    libdir:        ${exec_prefix}/lib
    +    libexecdir:    ${exec_prefix}/modules
    +    mandir:        ${prefix}/man
    +    sysconfdir:    ${prefix}/conf
    +    datadir:       ${prefix}
    +    installbuilddir: ${datadir}/build
    +    includedir:    ${prefix}/include
    +    localstatedir: ${prefix}
    +
    +
    +#   GNU standards conforming path layout.
    +#   See FSF's GNU project `make-stds' document for details.
    +
    +    prefix:        /usr/local
    +    exec_prefix:   ${prefix}
    +    bindir:        ${exec_prefix}/bin
    +    sbindir:       ${exec_prefix}/sbin
    +    libdir:        ${exec_prefix}/lib
    +    libexecdir:    ${exec_prefix}/libexec
    +    mandir:        ${prefix}/man
    +    sysconfdir:    ${prefix}/etc+
    +    datadir:       ${prefix}/share+
    +    installbuilddir: ${datadir}/build
    +    includedir:    ${prefix}/include+
    +    localstatedir: ${prefix}/var+
    +    runtimedir:    ${localstatedir}/run
    +
    +
    +#   Mac OS X Server (Rhapsody)
    +
    +    prefix:        /Local/Library/WebServer
    +    exec_prefix:   /usr
    +    bindir:        ${exec_prefix}/bin
    +    sbindir:       ${exec_prefix}/sbin
    +    libdir:        ${exec_prefix}/lib
    +    libexecdir:    /System/Library/apr/Modules
    +    mandir:        ${exec_prefix}/share/man
    +    sysconfdir:    ${prefix}/Configuration
    +    datadir:       ${prefix}
    +    installbuilddir: /System/Library/apr/Build
    +    includedir:    /System/Library/Frameworks/apr.framework/Versions/2.0/Headers
    +    localstatedir: /var
    +    runtimedir:    ${prefix}/Logs
    +
    +
    +#   Darwin/Mac OS Layout
    +
    +    prefix:        /usr
    +    exec_prefix:   ${prefix}
    +    bindir:        ${exec_prefix}/bin
    +    sbindir:       ${exec_prefix}/sbin
    +    libdir:        ${exec_prefix}/lib
    +    libexecdir:    ${exec_prefix}/libexec+
    +    mandir:        ${prefix}/share/man
    +    datadir:       /Library/WebServer
    +    sysconfdir:    /etc+
    +    installbuilddir: ${prefix}/share/httpd/build
    +    includedir:    ${prefix}/include+
    +    localstatedir: /var
    +    runtimedir:    ${localstatedir}/run
    +
    +
    +#   Red Hat Linux 7.x layout
    +
    +    prefix:        /usr
    +    exec_prefix:   ${prefix}
    +    bindir:        ${prefix}/bin
    +    sbindir:       ${prefix}/sbin
    +    libdir:        ${prefix}/lib
    +    libexecdir:    ${prefix}/lib/apr
    +    mandir:        ${prefix}/man
    +    sysconfdir:    /etc/httpd/conf
    +    datadir:       /var/www
    +    installbuilddir: ${datadir}/build
    +    includedir:    ${prefix}/include/apr
    +    localstatedir: /var
    +    runtimedir:    ${localstatedir}/run
    +     
    +
    +#   According to the /opt filesystem conventions
    +
    +    prefix:        /opt/apr
    +    exec_prefix:   ${prefix}
    +    bindir:        ${exec_prefix}/bin
    +    sbindir:       ${exec_prefix}/sbin
    +    libdir:        ${exec_prefix}/lib
    +    libexecdir:    ${exec_prefix}/libexec
    +    mandir:        ${prefix}/man
    +    sysconfdir:    /etc${prefix}
    +    datadir:       ${prefix}/share
    +    installbuilddir: ${datadir}/build
    +    includedir:    ${prefix}/include
    +    localstatedir: /var${prefix}
    +    runtimedir:    ${localstatedir}/run
    +
    +
    +#  BeOS layout...
    +
    +    prefix:        /boot/home/apr
    +    exec_prefix:   ${prefix}
    +    bindir:        ${exec_prefix}/bin
    +    sbindir:       ${exec_prefix}/bin
    +    libdir:        ${exec_prefix}/lib
    +    libexecdir:    ${exec_prefix}/libexec
    +    mandir:        ${prefix}/man
    +    sysconfdir:    ${prefix}/conf
    +    datadir:       ${prefix}
    +    installbuilddir: ${datadir}/build
    +    includedir:    ${prefix}/include
    +    localstatedir: ${prefix}
    +    runtimedir:    ${localstatedir}/logs
    +
    +
    +#   SuSE 6.x layout
    +
    +    prefix:        /usr
    +    exec_prefix:   ${prefix}
    +    bindir:        ${prefix}/bin
    +    sbindir:       ${prefix}/sbin
    +    libdir:        ${prefix}/lib
    +    libexecdir:    ${prefix}/lib/apr
    +    mandir:        ${prefix}/share/man
    +    sysconfdir:    /etc/httpd
    +    datadir:       /usr/local/httpd
    +    installbuilddir: ${datadir}/build
    +    includedir:    ${prefix}/include/apr
    +    localstatedir: /var/lib/httpd
    +    runtimedir:    /var/run
    +
    +
    +#   BSD/OS layout
    +
    +    prefix:        /var/www
    +    exec_prefix:   /usr/contrib
    +    bindir:        ${exec_prefix}/bin
    +    sbindir:       ${exec_prefix}/bin
    +    libdir:        ${exec_prefix}/lib
    +    libexecdir:    ${exec_prefix}/libexec/apr
    +    mandir:        ${exec_prefix}/man
    +    sysconfdir:    ${prefix}/conf
    +    datadir:       ${prefix}
    +    installbuilddir: ${datadir}/build
    +    includedir:    ${exec_prefix}/include/apr
    +    localstatedir: /var
    +    runtimedir:    ${localstatedir}/run
    +
    +
    +#   Solaris 8 Layout
    +
    +    prefix:        /usr/apr
    +    exec_prefix:   ${prefix}
    +    bindir:        ${exec_prefix}/bin
    +    sbindir:       ${exec_prefix}/bin
    +    libdir:        ${exec_prefix}/lib
    +    libexecdir:    ${exec_prefix}/libexec
    +    mandir:        ${exec_prefix}/man
    +    sysconfdir:    /etc/apr
    +    datadir:       /var/apr
    +    installbuilddir: ${datadir}/build
    +    includedir:    ${exec_prefix}/include
    +    localstatedir: ${prefix}
    +    runtimedir:    /var/run
    +
    +
    +#   OpenBSD Layout
    +
    +    prefix:        /var/www
    +    exec_prefix:   /usr
    +    bindir:        ${exec_prefix}/bin
    +    sbindir:       ${exec_prefix}/sbin
    +    libdir:        ${exec_prefix}/lib
    +    libexecdir:    ${exec_prefix}/lib/apr/modules
    +    mandir:        ${exec_prefix}/share/man
    +    sysconfdir:    ${prefix}/conf
    +    datadir:       ${prefix}
    +    installbuilddir: ${prefix}/build
    +    includedir:    ${exec_prefix}/lib/apr/include
    +    localstatedir: ${prefix}
    +    runtimedir:    ${prefix}/logs
    +
    +
    +# Debian layout
    +
    +    prefix:        
    +    exec_prefix:   ${prefix}/usr
    +    bindir:        ${exec_prefix}/bin
    +    sbindir:       ${exec_prefix}/sbin
    +    libdir:        ${exec_prefix}/lib
    +    libexecdir:    ${exec_prefix}/lib/apr/modules
    +    mandir:        ${exec_prefix}/share/man
    +    datadir:       ${exec_prefix}/share/apr
    +    includedir:    ${exec_prefix}/include/apr
    +    localstatedir: ${prefix}/var/run
    +    runtimedir:    ${prefix}/var/run
    +    infodir:       ${exec_prefix}/share/info
    +
    diff --git a/configure.in b/configure.in
    index 71985e6678d..ecd039541b5 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -36,6 +36,11 @@ echo "Platform: $host"
     dnl # Some initial steps for configuration.  We setup the default directory
     dnl # and which files are to be configured.
     
    +dnl # First, we need to enable the layout handling code, then reparse the 
    +dnl # prefix-style arguments due to autoconf being a PITA.
    +APR_ENABLE_LAYOUT
    +APR_PARSE_ARGUMENTS
    +
     dnl Set optional CC hints here in case autoconf makes an inappropriate choice.
     dnl This allows us to suggest what the compiler should be, but still
     dnl allows the user to override CC externally.
    
    From cebb928872dfb0a8123f9c8a9a9fe39b400114cd Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Mon, 19 Aug 2002 06:33:10 +0000
    Subject: [PATCH 3802/7878] - Add parallel-apr layout which confines the
     'parallel install' logic to a   layout rather than unchangeable values. -
     Delay layout parsing until after we have setup the directory variables and  
     determined our APR version. - Use ${libsuffix} instead of hardcoded
     -${APR_MAJOR_VERSION}. - Parse libsuffix in config.layout. - Add version info
     to rules.mk - Add APR_MAJOR_VERSION to apr-config.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63816 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES             |  3 +++
     apr-config.in       |  4 ++-
     build/apr_common.m4 |  2 +-
     build/rules.mk.in   |  4 +++
     config.layout       | 17 +++++++++++++
     configure.in        | 62 +++++++++++++++++++++++----------------------
     6 files changed, 60 insertions(+), 32 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 574e7875b3e..44843949152 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,8 @@
     Changes with APR b1
     
    +  *) Add parallel-apr layout which utilizes the major version number in
    +     directories and library names.  [Justin Erenkrantz]
    +
       *) Add a version number to the library name (e.g. libapr-1.so) so
          that apps can do things like: -lapr-1 or -lapr-2, depending on
          which version they want to use and link against.
    diff --git a/apr-config.in b/apr-config.in
    index 56ef86594d8..fd916f43e46 100644
    --- a/apr-config.in
    +++ b/apr-config.in
    @@ -55,6 +55,9 @@
     # APR script designed to allow easy command line access to APR configuration
     # parameters.
     
    +APR_MAJOR_VERSION="@APR_MAJOR_VERSION@"
    +APR_DOTTED_VERSION="@APR_DOTTED_VERSION@"
    +
     prefix="@prefix@"
     exec_prefix="@exec_prefix@"
     bindir="@bindir@"
    @@ -75,7 +78,6 @@ SHLIBPATH_VAR="@shlibpath_var@"
     APR_SOURCE_DIR="@apr_srcdir@"
     APR_SO_EXT="@so_ext@"
     APR_LIB_TARGET="@export_lib_target@"
    -APR_DOTTED_VERSION="@APR_DOTTED_VERSION@"
     APR_LIBNAME="@APR_LIBNAME@"
     
     show_usage()
    diff --git a/build/apr_common.m4 b/build/apr_common.m4
    index 24483734712..a37ade4ff93 100644
    --- a/build/apr_common.m4
    +++ b/build/apr_common.m4
    @@ -677,7 +677,7 @@ AC_DEFUN(APR_LAYOUT,[
       for var in prefix exec_prefix bindir sbindir libexecdir mandir \
                  sysconfdir datadir  \
                  includedir localstatedir runtimedir logfiledir libdir \
    -             installbuilddir; do
    +             installbuilddir libsuffix; do
         eval "val=\"\$$var\""
         case $val in
           *+)
    diff --git a/build/rules.mk.in b/build/rules.mk.in
    index 7a670160e21..98a16f8bba0 100644
    --- a/build/rules.mk.in
    +++ b/build/rules.mk.in
    @@ -64,6 +64,10 @@
     apr_builddir=@apr_builddir@
     apr_builders=@apr_builders@
     
    +# Some layouts require knowing what version we are at.
    +APR_MAJOR_VERSION=@APR_MAJOR_VERSION@
    +APR_DOTTED_VERSION=@APR_DOTTED_VERSION@
    +
     CC=@CC@
     RM=@RM@
     AWK=@AWK@
    diff --git a/config.layout b/config.layout
    index 245da94eb7c..4e26e22278f 100644
    --- a/config.layout
    +++ b/config.layout
    @@ -25,6 +25,23 @@
         localstatedir: ${prefix}
     
     
    +#   Classical apr path layout designed for parallel installs.
    +
    +    prefix:        /usr/local/apr
    +    exec_prefix:   ${prefix}
    +    bindir:        ${exec_prefix}/bin
    +    sbindir:       ${exec_prefix}/bin
    +    libdir:        ${exec_prefix}/lib/apr-${APR_MAJOR_VERSION}
    +    libexecdir:    ${exec_prefix}/modules
    +    mandir:        ${prefix}/man
    +    sysconfdir:    ${prefix}/conf
    +    datadir:       ${prefix}
    +    installbuilddir: ${datadir}/build
    +    includedir:    ${prefix}/include/apr-${APR_MAJOR_VERSION}
    +    localstatedir: ${prefix}
    +    libsuffix:     -${APR_MAJOR_VERSION}
    +
    +
     #   GNU standards conforming path layout.
     #   See FSF's GNU project `make-stds' document for details.
     
    diff --git a/configure.in b/configure.in
    index ecd039541b5..9be9ebc9e67 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -36,24 +36,7 @@ echo "Platform: $host"
     dnl # Some initial steps for configuration.  We setup the default directory
     dnl # and which files are to be configured.
     
    -dnl # First, we need to enable the layout handling code, then reparse the 
    -dnl # prefix-style arguments due to autoconf being a PITA.
    -APR_ENABLE_LAYOUT
    -APR_PARSE_ARGUMENTS
    -
    -dnl Set optional CC hints here in case autoconf makes an inappropriate choice.
    -dnl This allows us to suggest what the compiler should be, but still
    -dnl allows the user to override CC externally.
    -APR_CC_HINTS
    -
    -dnl Do the various CC checks *before* preloading values. The preload code
    -dnl may need to use compiler characteristics to make decisions. This macro
    -dnl can only be used once within a configure script, so this prevents a
    -dnl preload section from invoking the macro to get compiler info.
    -AC_PROG_CC
    -
    -dnl Preload
    -APR_PRELOAD
    +dnl Setup the directory macros now
     
     dnl Absolute source/build directory
     apr_srcdir=`(cd $srcdir && pwd)`
    @@ -83,6 +66,36 @@ MKDIR=$apr_builders/mkdir.sh
     dnl Initialize mkdir -p functionality.
     APR_MKDIR_P_CHECK($apr_builders/mkdir.sh)
     
    +dnl get our version information
    +get_version="$apr_builders/get-version.sh"
    +version_hdr="$apr_srcdir/include/apr_version.h"
    +APR_MAJOR_VERSION="`$get_version major $version_hdr`"
    +APR_DOTTED_VERSION="`$get_version all $version_hdr`"
    +
    +AC_SUBST(APR_DOTTED_VERSION)
    +AC_SUBST(APR_MAJOR_VERSION)
    +
    +echo "APR Version: ${APR_DOTTED_VERSION}"
    +
    +dnl # Enable the layout handling code, then reparse the prefix-style
    +dnl # arguments due to autoconf being a PITA.
    +APR_ENABLE_LAYOUT
    +APR_PARSE_ARGUMENTS
    +
    +dnl Set optional CC hints here in case autoconf makes an inappropriate choice.
    +dnl This allows us to suggest what the compiler should be, but still
    +dnl allows the user to override CC externally.
    +APR_CC_HINTS
    +
    +dnl Do the various CC checks *before* preloading values. The preload code
    +dnl may need to use compiler characteristics to make decisions. This macro
    +dnl can only be used once within a configure script, so this prevents a
    +dnl preload section from invoking the macro to get compiler info.
    +AC_PROG_CC
    +
    +dnl Preload
    +APR_PRELOAD
    +
     dnl These added to allow default directories to be used...
     DEFAULT_OSDIR="unix"
     echo "(Default will be ${DEFAULT_OSDIR})"
    @@ -108,19 +121,8 @@ AC_MINIX
     
     APR_EBCDIC
     
    -dnl get our version information
    -get_version="$apr_builders/get-version.sh"
    -version_hdr="$apr_srcdir/include/apr_version.h"
    -APR_MAJOR_VERSION="`$get_version major $version_hdr`"
    -APR_DOTTED_VERSION="`$get_version all $version_hdr`"
    -
    -dnl this one will go into apr-config.in
    -AC_SUBST(APR_DOTTED_VERSION)
    -
    -echo "APR Version: ${APR_DOTTED_VERSION}"
    -
     dnl this is our library name
    -APR_LIBNAME="libapr-${APR_MAJOR_VERSION}"
    +APR_LIBNAME="libapr${libsuffix}"
     AC_SUBST(APR_LIBNAME)
     
     dnl prep libtool
    
    From 705477a3daf1c1adb4580efa39109d686f2715f6 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Mon, 19 Aug 2002 20:25:29 +0000
    Subject: [PATCH 3803/7878] Added apr_queue.h to the Netware export list
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63817 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/nw_export.inc | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/build/nw_export.inc b/build/nw_export.inc
    index 9f191e1da47..d13f71de401 100644
    --- a/build/nw_export.inc
    +++ b/build/nw_export.inc
    @@ -66,6 +66,7 @@
     #include "apr_md5.h"
     #include "apr_optional.h"
     #include "apr_optional_hooks.h"
    +#include "apr_queue.h"
     #include "apr_reslist.h"
     #include "apr_rmm.h"
     #include "apr_sdbm.h"
    
    From 9b2425de4b90daca6332434394d088c5926ab5df Mon Sep 17 00:00:00 2001
    From: Jim Jagielski 
    Date: Mon, 19 Aug 2002 21:33:23 +0000
    Subject: [PATCH 3804/7878] apr_atoi64 must use base 10
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63818 13f79535-47bb-0310-9956-ffa450edef68
    ---
     strings/apr_strings.c | 7 ++++---
     1 file changed, 4 insertions(+), 3 deletions(-)
    
    diff --git a/strings/apr_strings.c b/strings/apr_strings.c
    index 8a19945c7e7..c5a5fc51960 100644
    --- a/strings/apr_strings.c
    +++ b/strings/apr_strings.c
    @@ -326,7 +326,7 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base)
          * overflow.
          */
         val = 0;
    -    do {
    +    for ( ; ; c = *s++) {
             if (c >= '0' && c <= '9')
     	    c -= '0';
     #if (('Z' - 'A') == 25)
    @@ -358,11 +358,12 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base)
             if ((neg && (val > acc || (val -= c) > acc))
                      || (val < acc || (val += c) < acc)) {
                 any = -1;
    +            break;
             } else {
                 acc = val;
     	    any = 1;
             }
    -    } while (any >= 0 && (c = *s++));
    +    }
     
         if (any < 0) {
     	acc = neg ? INT64_MIN : INT64_MAX;
    @@ -378,7 +379,7 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base)
     
     APR_DECLARE(apr_int64_t) apr_atoi64(const char *buf)
     {
    -    return apr_strtoi64(buf, NULL, 0);
    +    return apr_strtoi64(buf, NULL, 10);
     }
     
     APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n)
    
    From 6c09c854e8f4146ce7790e1bc042845ecb119371 Mon Sep 17 00:00:00 2001
    From: Thom May 
    Date: Mon, 19 Aug 2002 21:35:49 +0000
    Subject: [PATCH 3805/7878] Oops, should add this to CHANGES too.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63819 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index 44843949152..703bfc96db4 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,8 @@
     Changes with APR b1
     
    +  *) Add APR_PARSE_ARGUMENTS and APR_LAYOUT macros for better layout
    +     support. [Thom May]
    +
       *) Add parallel-apr layout which utilizes the major version number in
          directories and library names.  [Justin Erenkrantz]
     
    
    From 548dc2e436cbffb24b52dffac7eb40b84131d899 Mon Sep 17 00:00:00 2001
    From: Thom May 
    Date: Mon, 19 Aug 2002 21:38:46 +0000
    Subject: [PATCH 3806/7878] This vote seems to be pretty resolved.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63820 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 17 ++++++++---------
     1 file changed, 8 insertions(+), 9 deletions(-)
    
    diff --git a/STATUS b/STATUS
    index df0b6bb639b..cac40850d2c 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -1,5 +1,5 @@
     APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS:			-*-text-*-
    -Last modified at [$Date: 2002/08/01 16:00:31 $]
    +Last modified at [$Date: 2002/08/19 21:38:46 $]
     
     Release:
     
    @@ -59,14 +59,6 @@ RELEASE SHOWSTOPPERS:
     
     CURRENT VOTES:
     
    -    * Is this really a showstopper for the 1.0 release?:
    -    * Almost every API in APR depends on pools, but pool semantics
    -      aren't a good match for a lot of applications.  We need to find
    -      a way to support alternate allocators polymorphically without
    -      a significant performance penalty.
    -
    -      Not a showstopper: Thom, Justin, Sander, Fitz
    -
     RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
     
         * The return type of a thread function (void *) is inconsistent with
    @@ -371,3 +363,10 @@ Stuff waiting for code thawing after Beta 1:
                          misc/unix/getuuid.c that forces md5 to be in APR.
             Sander: +1 for the move.
     
    +Stuff for post 1.0:
    +
    +    * Almost every API in APR depends on pools, but pool semantics
    +      aren't a good match for a lot of applications.  We need to find
    +      a way to support alternate allocators polymorphically without
    +      a significant performance penalty.
    +
    
    From 9531c7e0c589629dd93a32c1c6a858774bfb1143 Mon Sep 17 00:00:00 2001
    From: Jim Jagielski 
    Date: Tue, 20 Aug 2002 00:13:19 +0000
    Subject: [PATCH 3807/7878] Allow for behavior to be compile-time
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63821 13f79535-47bb-0310-9956-ffa450edef68
    ---
     strings/apr_strings.c | 4 +++-
     1 file changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/strings/apr_strings.c b/strings/apr_strings.c
    index c5a5fc51960..75cb8289b65 100644
    --- a/strings/apr_strings.c
    +++ b/strings/apr_strings.c
    @@ -355,10 +355,12 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base)
     	if (c >= base)
     	    break;
     	val *= base;
    -        if ((neg && (val > acc || (val -= c) > acc))
    +        if ( (any < 0) || (neg && (val > acc || (val -= c) > acc))
                      || (val < acc || (val += c) < acc)) {
                 any = -1;
    +#ifdef APR_STRTOI64_OVERFLOW_IS_BAD_CHAR
                 break;
    +#endif
             } else {
                 acc = val;
     	    any = 1;
    
    From 9e2e382e80b0dfff5840464b9a3b01c6a579f540 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 20 Aug 2002 18:32:09 +0000
    Subject: [PATCH 3808/7878]   Fix bug reported as PR 11854.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63822 13f79535-47bb-0310-9956-ffa450edef68
    ---
     misc/win32/start.c | 13 ++++++++++---
     1 file changed, 10 insertions(+), 3 deletions(-)
    
    diff --git a/misc/win32/start.c b/misc/win32/start.c
    index cd83860ddbf..64a0b0dee4a 100644
    --- a/misc/win32/start.c
    +++ b/misc/win32/start.c
    @@ -133,6 +133,12 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc,
                                                  const char * const * *argv, 
                                                  const char * const * *env)
     {
    +    apr_status_t rv = apr_initialize();
    +
    +    if (rv != APR_SUCCESS) {
    +        return rv;
    +    }
    +
     #if APR_HAS_UNICODE_FS
         IF_WIN_OS_IS_UNICODE
         {
    @@ -142,9 +148,11 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc,
             int dupenv;
     
             if (apr_app_init_complete) {
    -            return apr_initialize();
    +            return rv;
             }
     
    +        apr_app_init_complete = 1;
    +
             sysstr = GetCommandLineW();
             if (sysstr) {
                 wstrs = CommandLineToArgvW(sysstr, &wstrc);
    @@ -178,10 +186,9 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc,
                 free(wenv);
             }
     
    -        apr_app_init_complete = 1;
         }
     #endif
    -    return apr_initialize();
    +    return rv;
     }
     
     static int initialized = 0;
    
    From 4ff301ec6ef0bf6c6bc1ee3763dedcf853223952 Mon Sep 17 00:00:00 2001
    From: Jim Jagielski 
    Date: Tue, 20 Aug 2002 23:43:28 +0000
    Subject: [PATCH 3809/7878] comment the checks being done, making it clear that
     the short-circuit is safe, because we've already noted an over/underflow (so
     we're just biding our time)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63823 13f79535-47bb-0310-9956-ffa450edef68
    ---
     strings/apr_strings.c | 7 ++++---
     1 file changed, 4 insertions(+), 3 deletions(-)
    
    diff --git a/strings/apr_strings.c b/strings/apr_strings.c
    index 75cb8289b65..93b8b9305ed 100644
    --- a/strings/apr_strings.c
    +++ b/strings/apr_strings.c
    @@ -355,9 +355,10 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base)
     	if (c >= base)
     	    break;
     	val *= base;
    -        if ( (any < 0) || (neg && (val > acc || (val -= c) > acc))
    -                 || (val < acc || (val += c) < acc)) {
    -            any = -1;
    +        if ( (any < 0)	/* already noted an over/under flow - short circuit */
    +           || (neg && (val > acc || (val -= c) > acc)) /* underflow */
    +           || (val < acc || (val += c) < acc)) {       /* overflow */
    +            any = -1;	/* once noted, over/underflows never go away */
     #ifdef APR_STRTOI64_OVERFLOW_IS_BAD_CHAR
                 break;
     #endif
    
    From 9fb0c6aefb17b816661dd52be9c06c82ff272b1b Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 21 Aug 2002 17:37:12 +0000
    Subject: [PATCH 3810/7878] Fix apr_tokenize_to_argv() to remove the escape
     character (backslash) from the argument tokens.
    
    PR:               11793
    Submitted by:	  Paul J. Reder
    Reviewed by:	  Jeff Trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63824 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES               |  3 +++
     strings/apr_cpystrn.c | 32 ++++++++++++++++++++++++++++++--
     2 files changed, 33 insertions(+), 2 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 703bfc96db4..e3b937c41b3 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,8 @@
     Changes with APR b1
     
    +  *) Fix apr_tokenize_to_argv() to remove the escape character
    +     (backslash) from the argument tokens. PR 11793 [Paul J. Reder]
    +
       *) Add APR_PARSE_ARGUMENTS and APR_LAYOUT macros for better layout
          support. [Thom May]
     
    diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c
    index 7c56a25fa40..f99eb92fc84 100644
    --- a/strings/apr_cpystrn.c
    +++ b/strings/apr_cpystrn.c
    @@ -126,6 +126,8 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str,
     {
         const char *cp;
         const char *ct;
    +    char *cleaned, *dirty;
    +    int escaped;
         int isquoted, numargs = 0, argnum;
     
     #define SKIP_WHITESPACE(cp) \
    @@ -138,6 +140,10 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str,
         if (*cp == '"') { \
             isquoted = 1; \
             cp++; \
    +    } \
    +    else if (*cp == '\'') { \
    +        isquoted = 2; \
    +        cp++; \
         }
     
     /* DETERMINE_NEXTSTRING:
    @@ -147,15 +153,35 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str,
     #define DETERMINE_NEXTSTRING(cp,isquoted) \
         for ( ; *cp != '\0'; cp++) { \
             if (   (isquoted    && (*cp     == ' ' || *cp     == '\t')) \
    -            || (*cp == '\\' && (*(cp+1) == ' ' || *(cp+1) == '\t'))) { \
    +            || (*cp == '\\' && (*(cp+1) == ' ' || *(cp+1) == '\t' || \
    +                                *(cp+1) == '"' || *(cp+1) == '\''))) { \
                 cp++; \
                 continue; \
             } \
             if (   (!isquoted && (*cp == ' ' || *cp == '\t')) \
    -            || (isquoted  && *cp == '"')                  ) { \
    +            || (isquoted == 1 && *cp == '"') \
    +            || (isquoted == 2 && *cp == '\'')                 ) { \
                 break; \
             } \
         }
    + 
    +/* REMOVE_ESCAPE_CHARS:
    + * Compresses the arg string to remove all of the '\' escape chars.
    + * The final argv strings should not have any extra escape chars in it.
    + */
    +#define REMOVE_ESCAPE_CHARS(cleaned, dirty, escaped) \
    +    escaped = 0; \
    +    while(*dirty) { \
    +        if (!escaped && *dirty == '\\') { \
    +            escaped = 1; \
    +        } \
    +        else { \
    +            escaped = 0; \
    +            *cleaned++ = *dirty; \
    +        } \
    +        ++dirty; \
    +    } \
    +    *cleaned = 0;        /* last line of macro... */
     
         cp = arg_str;
         SKIP_WHITESPACE(cp);
    @@ -187,6 +213,8 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str,
             cp++;
             (*argv_out)[argnum] = apr_palloc(token_context, cp - ct);
             apr_cpystrn((*argv_out)[argnum], ct, cp - ct);
    +        cleaned = dirty = (*argv_out)[argnum];
    +        REMOVE_ESCAPE_CHARS(cleaned, dirty, escaped);
             SKIP_WHITESPACE(cp);
         }
         (*argv_out)[argnum] = NULL;
    
    From fd750f6aa75b196faeede76099866dda4f16461f Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Thu, 22 Aug 2002 20:16:23 +0000
    Subject: [PATCH 3811/7878] "A dump truck... a *yellow* dump truck..."     --
     kid on Emergency, circa mid 70's
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63825 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 36 ++++++++++++++++++++++++------------
     1 file changed, 24 insertions(+), 12 deletions(-)
    
    diff --git a/STATUS b/STATUS
    index cac40850d2c..23f16799924 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -1,5 +1,5 @@
     APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS:			-*-text-*-
    -Last modified at [$Date: 2002/08/19 21:38:46 $]
    +Last modified at [$Date: 2002/08/22 20:16:23 $]
     
     Release:
     
    @@ -33,12 +33,16 @@ RELEASE SHOWSTOPPERS:
                                   HIBYTE, LOBYTE)
             apr.hw                (NO_USE_SIGACTION)
     
    +      1.0 showstopper (not 0.9.x): gstein
    +
         * complete the efforts started by DougM for cleaner fn naming
           conventions: see proposed name changes in renames_pending
           and offer up any additions/vetos/clarifications.
           DougM offered to complete the work with his nifty perl rename
           script at the hackathon. 
     
    +      1.0 showstopper (not 0.9.0): gstein
    +
         * When Win32 apr_proc_create was fixed, the apr_proc_t hproc
           member was added for that platform.  That's a problem (and
           was when pid was abused as well) since nobody goes and cleans
    @@ -46,19 +50,27 @@ RELEASE SHOWSTOPPERS:
           since apr_proc_create didn't allocate the apr_proc_t storage.
           (Aren't transparent types swell?)  Suggestions?
     
    -    * extract the MAJOR version from apr_version.h and pass it to
    -      libtool for use in applying version numbers to the shared
    -      libraries.
    +      1.0 showstopper (not 0.9.0): gstein
     
         * Change apr_initialize to take the expected version (in some form)
           and return an error code if the requirement isn't satisfied.
     
    +      gstein: -1
    +
           Justin says: "Relying solely on the run-time linker isn't enough
                         to guarantee versioning."
    +      Greg says: "yup. but now the libraries have different names.
    +                  -lapr-1 and -lapr-2. further, we can always add a
    +                  utility function to check (the minor rev), rather
    +                  than monkey with the initialization itself. the
    +		  runtime linker will catch new function requirements
    +		  across minor rev upgrades, but will not catch new
    +		  constants."
           
     
     CURRENT VOTES:
     
    +
     RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
     
         * The return type of a thread function (void *) is inconsistent with
    @@ -180,7 +192,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
         * add a version number to apr_initialize() as an extra failsafe against
           (APR) library version skew.
           MsgID: 
    -      Status: Greg +1 (volunteers), Jeff +1, Ryan +1, Tony -0(?), david +1
    +      Status: Greg -1, Jeff +1, Ryan +1, Tony -0(?), david +1
     
         * add apr_crypt() and APR_HAS_CRYPT for apps to determine whether the
           crypt() function is available, and a way to call it (whether it is
    @@ -225,14 +237,14 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
           Justin says: Both thread and file have the accessors now.  Any others?
           Status: Greg volunteers
     
    -    * I think apr_open_stderr() and friends dup() the descriptor. That
    -      would allow the new/returned file to be closed (via pool cleanup
    -      or manually) without accidentally closing stderr/out.
    -      Justin says: Is this "I think it should?"
    +    * I think apr_open_stderr() and friends *should* dup() the
    +      descriptor.  That would allow the new/returned file to be closed
    +      (via pool cleanup or manually) without accidentally closing
    +      stderr/out.
     
    -    * need to export the shared library extension (e.g. ".so") for the
    -      platform. clients need to use this to construct filenames to
    -      pass to apr_dso_load()
    +    * need to export (in code, not just build scripts) the shared
    +      library extension (e.g. ".so") for the platform. clients need to
    +      use this to construct filenames to pass to apr_dso_load()
           -- note on Win32 we distinguish 'apache module' names from other 
              'loadable module' names, so be careful with Apache's directive.
     
    
    From 97a690a5eac96dbce28d8a0c7fa8b1bb12831d79 Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Thu, 22 Aug 2002 20:34:16 +0000
    Subject: [PATCH 3812/7878] * substitute APR_MAJOR_VERSION to the Makefile so
     that other     substitutions can refer to it (eg. APR_LIBNAME)
    
    * add a param to APR_ENABLE_LAYOUT to specify the default ("apr" in
        our case, not "Apache")
    
    * change the default APR layout to support parallel installation;
        rename the old layout to "classic"
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63826 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES             | 14 ++++++++++++--
     Makefile.in         |  3 +++
     build/apr_common.m4 |  4 ++--
     config.layout       | 14 +++++++-------
     configure.in        |  6 +++---
     5 files changed, 27 insertions(+), 14 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index e3b937c41b3..4827e00a374 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,4 +1,11 @@
    -Changes with APR b1
    +Changes with APR 0.9.0
    +
    +  *) Includes moved to INCLUDEDIR/apr-{major} (e.g. /usr/include/apr-0)
    +     [Greg Stein]
    +
    +  *) libtool versioning is used to give the library sonames a real
    +     value. The libraries will be libapr-{major}.so.0.{minor}.{patch}
    +     [Greg Stein]
     
       *) Fix apr_tokenize_to_argv() to remove the escape character
          (backslash) from the argument tokens. PR 11793 [Paul J. Reder]
    @@ -11,7 +18,7 @@ Changes with APR b1
     
       *) Add a version number to the library name (e.g. libapr-1.so) so
          that apps can do things like: -lapr-1 or -lapr-2, depending on
    -     which version they want to use and link against.
    +     which version they want to use and link against. [Greg Stein]
     
       *) Add --version to apr-config so that apps can retrieve the version
          information of the (installed) APR. [Greg Stein]
    @@ -1115,6 +1122,7 @@ Changes with APR b1
          supports IPv6 and will be friendlier for use with eventual 
          SOCK_DGRAM support.  apr_get_hostname() is gone.  [Jeff Trawick]
     
    +
     Changes with APR a9
     
       *) Removed the iconv implementation from the i18n/unix/iconv branch.
    @@ -1170,7 +1178,9 @@ Changes with APR a9
       *) Get APR_OFF_T_FMT defined properly on Solaris Sparc.
          [Jeff Trawick]
     
    +
     Changes with APR a8
    +
       *) Change the name of the sa_len field in apr_sockaddr_t to salen.
          Some platforms have a macro named sa_len.
          [Tony Finch]
    diff --git a/Makefile.in b/Makefile.in
    index c52240ea794..1a74ac9045c 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -3,6 +3,9 @@
     #
     CPP = @CPP@
     
    +# get get substituted into some targets
    +APR_MAJOR_VERSION=@APR_MAJOR_VERSION@
    +
     #
     # Macros for supporting directories
     #
    diff --git a/build/apr_common.m4 b/build/apr_common.m4
    index a37ade4ff93..c46a03eedc0 100644
    --- a/build/apr_common.m4
    +++ b/build/apr_common.m4
    @@ -707,7 +707,7 @@ AC_DEFUN(APR_LAYOUT,[
     ])dnl
     
     dnl
    -dnl APR_ENABLE_LAYOUT
    +dnl APR_ENABLE_LAYOUT(default layout name)
     dnl
     AC_DEFUN(APR_ENABLE_LAYOUT,[
     AC_ARG_ENABLE(layout,
    @@ -716,7 +716,7 @@ AC_ARG_ENABLE(layout,
     ])
     
     if test -z "$LAYOUT"; then
    -  LAYOUT="Apache"
    +  LAYOUT="$1"
     fi
     APR_LAYOUT($srcdir/config.layout, $LAYOUT)
     
    diff --git a/config.layout b/config.layout
    index 4e26e22278f..e059302e629 100644
    --- a/config.layout
    +++ b/config.layout
    @@ -9,7 +9,7 @@
     ##    (This may become a configurable parameter at some point.)
     ##
     
    -#   Classical apr path layout.
    +#   Classical APR path layout designed for parallel installs.
     
         prefix:        /usr/local/apr
         exec_prefix:   ${prefix}
    @@ -21,25 +21,25 @@
         sysconfdir:    ${prefix}/conf
         datadir:       ${prefix}
         installbuilddir: ${datadir}/build
    -    includedir:    ${prefix}/include
    +    includedir:    ${prefix}/include/apr-${APR_MAJOR_VERSION}
         localstatedir: ${prefix}
    +    libsuffix:     -${APR_MAJOR_VERSION}
     
     
    -#   Classical apr path layout designed for parallel installs.
    -
    +#   Classical single-installation APR path layout.
    +
         prefix:        /usr/local/apr
         exec_prefix:   ${prefix}
         bindir:        ${exec_prefix}/bin
         sbindir:       ${exec_prefix}/bin
    -    libdir:        ${exec_prefix}/lib/apr-${APR_MAJOR_VERSION}
    +    libdir:        ${exec_prefix}/lib
         libexecdir:    ${exec_prefix}/modules
         mandir:        ${prefix}/man
         sysconfdir:    ${prefix}/conf
         datadir:       ${prefix}
         installbuilddir: ${datadir}/build
    -    includedir:    ${prefix}/include/apr-${APR_MAJOR_VERSION}
    +    includedir:    ${prefix}/include
         localstatedir: ${prefix}
    -    libsuffix:     -${APR_MAJOR_VERSION}
     
     
     #   GNU standards conforming path layout.
    diff --git a/configure.in b/configure.in
    index 9be9ebc9e67..e5c61c7cf23 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -77,9 +77,9 @@ AC_SUBST(APR_MAJOR_VERSION)
     
     echo "APR Version: ${APR_DOTTED_VERSION}"
     
    -dnl # Enable the layout handling code, then reparse the prefix-style
    -dnl # arguments due to autoconf being a PITA.
    -APR_ENABLE_LAYOUT
    +dnl Enable the layout handling code, then reparse the prefix-style
    +dnl arguments due to autoconf being a PITA.
    +APR_ENABLE_LAYOUT(apr)
     APR_PARSE_ARGUMENTS
     
     dnl Set optional CC hints here in case autoconf makes an inappropriate choice.
    
    From fcc6d87909d8ba356a841d68256684f2e091823c Mon Sep 17 00:00:00 2001
    From: Ian Holsman 
    Date: Thu, 22 Aug 2002 23:29:01 +0000
    Subject: [PATCH 3813/7878] Excerpt from MSVC help; "Like the Win32 ExitThread
     API, _endthreadex does not close the thread handle. Therefore, when you use
     _beginthreadex and _endthreadex, you must close the thread handle by calling
     the Win32 CloseHandle API."
    
    SUZUKI Rintaro  wrote the patch.
    
    Thanks.
    - INOUE Seiichiro 
    
    PR:
    Obtained from:  SUZUKI Rintaro  
    Submitted by:	INOUE Seiichiro 
    Reviewed by:	Will Rowe
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63827 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                   | 2 ++
     threadproc/win32/thread.c | 7 ++++++-
     2 files changed, 8 insertions(+), 1 deletion(-)
    
    diff --git a/CHANGES b/CHANGES
    index 4827e00a374..3806b9ac536 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,4 +1,6 @@
     Changes with APR 0.9.0
    +  *) handle leak related to threads on Windows2000/XP 
    +     [INOUE Seiichiro ]
     
       *) Includes moved to INCLUDEDIR/apr-{major} (e.g. /usr/include/apr-0)
          [Greg Stein]
    diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c
    index da7b5a72193..f602c96a3b8 100644
    --- a/threadproc/win32/thread.c
    +++ b/threadproc/win32/thread.c
    @@ -138,6 +138,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new,
     #endif
         if (attr && attr->detach) {
             CloseHandle((*new)->td);
    +        (*new)->td = NULL;
         }
     
         return APR_SUCCESS;
    @@ -149,6 +150,9 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd,
         thd->exitval = retval;
         apr_pool_destroy(thd->pool);
     #ifndef _WIN32_WCE
    +    if (thd->td) {
    +        CloseHandle(thd->td);
    +    }
         _endthreadex(0);
     #else
         ExitThread(0);
    @@ -172,7 +176,8 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval,
     
     APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd)
     {
    -    if (CloseHandle(thd->td)) {
    +    if (thd->td && CloseHandle(thd->td)) {
    +        thd->td = NULL;
             return APR_SUCCESS;
         }
         else {
    
    From 463f5f22ffb1c9cffac234e18e7b6577eb5be96e Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 25 Aug 2002 04:10:40 +0000
    Subject: [PATCH 3814/7878] Printing a string with apr_snprintf can seg fault,
     if a precision is specified for the string, and the string being printed
     doesn't have a trailing '\0'.  Fix that seg fault by not calling strlen if a
     precision is specified when printing a string.  Also add a test to the test
     suite for this case.
    
    PR:	8554
    Submitted by:	R Samuel Klatchko 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63828 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                |  8 ++++++++
     strings/apr_snprintf.c | 35 ++++++++++++++++++++++++++++++++---
     test/teststr.c         | 23 +++++++++++++++++++++++
     3 files changed, 63 insertions(+), 3 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 3806b9ac536..163151a96fc 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,4 +1,12 @@
     Changes with APR 0.9.0
    +
    +  *) Printing a string with apr_snprintf can seg fault, if a precision is
    +     specified for the string, and the string being printed doesn't have a
    +     trailing '\0'.  Fix that seg fault by not calling strlen if a precision
    +     is specified when printing a string.  Also add a test to the test suite
    +     for this case.
    +     [R Samuel Klatchko ]
    +
       *) handle leak related to threads on Windows2000/XP 
          [INOUE Seiichiro ]
     
    diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c
    index 0d7d3e14d9c..a066241df4f 100644
    --- a/strings/apr_snprintf.c
    +++ b/strings/apr_snprintf.c
    @@ -952,9 +952,38 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *),
                 case 's':
                     s = va_arg(ap, char *);
                     if (s != NULL) {
    -                    s_len = strlen(s);
    -                    if (adjust_precision && precision < s_len)
    -                        s_len = precision;
    +                    if (!adjust_precision) {
    +                        s_len = strlen(s);
    +                    }
    +                    else {
    +                        /* From the C library standard in section 7.9.6.1:
    +                         * ...if the precision is specified, no more then
    +                         * that many characters are written.  If the
    +                         * precision is not specified or is greater
    +                         * than the size of the array, the array shall
    +                         * contain a null character.
    +                         *
    +                         * My reading is is precision is specified and
    +                         * is less then or equal to the size of the
    +                         * array, no null character is required.  So
    +                         * we can't do a strlen.
    +                         *
    +                         * This figures out the length of the string
    +                         * up to the precision.  Once it's long enough
    +                         * for the specified precision, we don't care
    +                         * anymore.
    +                         *
    +                         * NOTE: you must do the length comparison
    +                         * before the check for the null character.
    +                         * Otherwise, you'll check one beyond the
    +                         * last valid character.
    +                         */
    +                        const char *walk;
    +
    +                        for (walk = s, s_len = 0;
    +                             (s_len < precision) && (*walk != '\0');
    +                             ++walk, ++s_len);
    +                    }
                     }
                     else {
                         s = S_NULL;
    diff --git a/test/teststr.c b/test/teststr.c
    index 29279aa2139..4a341d041dc 100644
    --- a/test/teststr.c
    +++ b/test/teststr.c
    @@ -54,6 +54,7 @@
     
     #include 
     #include 
    +#include 
     #include 
     
     #include "apr_general.h"
    @@ -119,6 +120,27 @@ static void test_strtok(apr_pool_t *p)
         }
     }
     
    +void test_snprintf(apr_pool_t *p)
    +{
    +    char buff[100];
    +    char *testing = apr_palloc(p, 10);
    +
    +    testing[0] = 't';
    +    testing[1] = 'e';
    +    testing[2] = 's';
    +    testing[3] = 't';
    +    testing[4] = 'i';
    +    testing[5] = 'n';
    +    testing[6] = 'g';
    +    
    +    fprintf(stderr, "Testing precision  ........  ");
    +    apr_snprintf(buff, sizeof(buff), "%.*s", 7, testing);
    +    if (!strncmp(buff, testing, 7)) {
    +        fprintf(stderr, "OK\n");
    +    }
    +
    +}
    +
     int main(int argc, const char * const argv[])
     {
         apr_pool_t *p;
    @@ -128,6 +150,7 @@ int main(int argc, const char * const argv[])
         apr_pool_create(&p, NULL);
     
         test_strtok(p);
    +    test_snprintf(p);
     
         return 0;
     }
    
    From a4b18fc54778e994fadde83a4e3b5d5d9606ee5a Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 25 Aug 2002 04:22:36 +0000
    Subject: [PATCH 3815/7878] If the length argument to apr_snprintf is 0, then
     we should return the length that the string would be if we actually were
     going to fill it out. However, if the length argument is 0, we can also
     accept a NULL string. Also, added a test case for this.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63829 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                |  5 +++++
     strings/apr_snprintf.c | 30 +++++++++++++++---------------
     test/teststr.c         | 10 ++++++++++
     3 files changed, 30 insertions(+), 15 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 163151a96fc..e5f00908785 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,10 @@
     Changes with APR 0.9.0
     
    +  *) If the length argument to apr_snprintf is 0, then we should return the
    +     length that the string would be if we actually were going to fill it out.
    +     However, if the length argument is 0, we can also accept a NULL string.
    +     Also, added a test case for this.  [Ryan Bloom]
    +
       *) Printing a string with apr_snprintf can seg fault, if a precision is
          specified for the string, and the string being printed doesn't have a
          trailing '\0'.  Fix that seg fault by not calling strlen if a precision
    diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c
    index a066241df4f..cb97e18b599 100644
    --- a/strings/apr_snprintf.c
    +++ b/strings/apr_snprintf.c
    @@ -294,14 +294,16 @@ static char *apr_gcvt(double number, int ndigit, char *buf, boolean_e altform)
      */
     #define INS_CHAR(c, sp, bep, cc)                    \
     {                                                   \
    -    if (sp >= bep) {                                \
    -        vbuff->curpos = sp;                         \
    -        if (flush_func(vbuff))                      \
    -            return -1;                              \
    -        sp = vbuff->curpos;                         \
    -        bep = vbuff->endpos;                        \
    +    if (sp) {                                       \
    +        if (sp >= bep) {                            \
    +            vbuff->curpos = sp;                     \
    +            if (flush_func(vbuff))                  \
    +                return -1;                          \
    +            sp = vbuff->curpos;                     \
    +            bep = vbuff->endpos;                    \
    +        }                                           \
    +        *sp++ = (c);                                \
         }                                               \
    -    *sp++ = (c);                                    \
         cc++;                                           \
     }
     
    @@ -1247,16 +1249,15 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len,
         va_list ap;
         apr_vformatter_buff_t vbuff;
     
    -    if (len == 0)
    -        return 0;
    -
         /* save one byte for nul terminator */
         vbuff.curpos = buf;
         vbuff.endpos = buf + len - 1;
         va_start(ap, format);
         cc = apr_vformatter(snprintf_flush, &vbuff, format, ap);
         va_end(ap);
    -    *vbuff.curpos = '\0';
    +    if (len != 0) {
    +        *vbuff.curpos = '\0';
    +    }
         return (cc == -1) ? (int)len : cc;
     }
     
    @@ -1267,13 +1268,12 @@ APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format,
         int cc;
         apr_vformatter_buff_t vbuff;
     
    -    if (len == 0)
    -        return 0;
    -
         /* save one byte for nul terminator */
         vbuff.curpos = buf;
         vbuff.endpos = buf + len - 1;
         cc = apr_vformatter(snprintf_flush, &vbuff, format, ap);
    -    *vbuff.curpos = '\0';
    +    if (len != 0) {
    +        *vbuff.curpos = '\0';
    +    }
         return (cc == -1) ? (int)len : cc;
     }
    diff --git a/test/teststr.c b/test/teststr.c
    index 4a341d041dc..d0fbac5de38 100644
    --- a/test/teststr.c
    +++ b/test/teststr.c
    @@ -124,6 +124,7 @@ void test_snprintf(apr_pool_t *p)
     {
         char buff[100];
         char *testing = apr_palloc(p, 10);
    +    int rv;
     
         testing[0] = 't';
         testing[1] = 'e';
    @@ -135,10 +136,19 @@ void test_snprintf(apr_pool_t *p)
         
         fprintf(stderr, "Testing precision  ........  ");
         apr_snprintf(buff, sizeof(buff), "%.*s", 7, testing);
    +    /* If this test fails, we are going to seg fault, so there is no reason
    +     * to print a failure message.  rbb
    +     */
         if (!strncmp(buff, testing, 7)) {
             fprintf(stderr, "OK\n");
         }
     
    +    fprintf(stderr, "Testing 0 length ..........  ");
    +    rv = apr_snprintf(NULL, 0, "%sBAR", "FOO");
    +    if (rv != 6) {
    +        fprintf(stderr, "FAILED\n");
    +    }
    +    fprintf(stderr, "OK\n");
     }
     
     int main(int argc, const char * const argv[])
    
    From 3667ad2ab5bc488dd33ab263eff6ae2e1b47973c Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 26 Aug 2002 14:18:16 +0000
    Subject: [PATCH 3816/7878] get rid of a warning by not exporting a function
     that is not previously prototyped
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63830 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/teststr.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/teststr.c b/test/teststr.c
    index d0fbac5de38..c7d4534af7c 100644
    --- a/test/teststr.c
    +++ b/test/teststr.c
    @@ -120,7 +120,7 @@ static void test_strtok(apr_pool_t *p)
         }
     }
     
    -void test_snprintf(apr_pool_t *p)
    +static void test_snprintf(apr_pool_t *p)
     {
         char buff[100];
         char *testing = apr_palloc(p, 10);
    
    From 665927e7c23f672f25848005a91cb70dffc41174 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Mon, 26 Aug 2002 15:29:31 +0000
    Subject: [PATCH 3817/7878] Turn off optimization completely when building
     debug
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63831 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/NWGNUenvironment.inc | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc
    index 2131d032c42..345012f7627 100644
    --- a/build/NWGNUenvironment.inc
    +++ b/build/NWGNUenvironment.inc
    @@ -141,10 +141,10 @@ PLIB3S	= $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\MSL C++\MWCPP
     CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII -inst mmx
     
     # -g                    generate debugging information
    -# -O1                   level 1 optimizations
    +# -O0                   level 0 optimizations
     
     ifeq "$(RELEASE)" "debug"
    -CFLAGS += -g -O1
    +CFLAGS += -g -O0
     endif
     
     # -O4,p                 level 4 optimizations, optimize for speed
    
    From 8e67ab00e0cb0b70a85be2db2abff7dda1fe78ed Mon Sep 17 00:00:00 2001
    From: Jim Jagielski 
    Date: Mon, 26 Aug 2002 17:34:07 +0000
    Subject: [PATCH 3818/7878] Document the len == 0 special case for
     apr_snprintf() and allow it to work no matter what buf is (NULL or not). PR:
     Obtained from: Submitted by: Reviewed by:	rbb
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63832 13f79535-47bb-0310-9956-ffa450edef68
    ---
     strings/apr_snprintf.c | 30 ++++++++++++++++++++++++------
     1 file changed, 24 insertions(+), 6 deletions(-)
    
    diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c
    index cb97e18b599..6cde1877905 100644
    --- a/strings/apr_snprintf.c
    +++ b/strings/apr_snprintf.c
    @@ -1249,9 +1249,21 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len,
         va_list ap;
         apr_vformatter_buff_t vbuff;
     
    -    /* save one byte for nul terminator */
    -    vbuff.curpos = buf;
    -    vbuff.endpos = buf + len - 1;
    +    if (len == 0) {
    +        /* NOTE: This is a special case; we just want to return the number
    +         * of chars that would be written (minus \0) if the buffer
    +         * size was infinite. We leverage the fact that INS_CHAR
    +         * just does actual inserts iff the buffer pointer is non-NULL.
    +         * In this case, we don't care what buf is; it can be NULL, since
    +         * we don't touch it at all.
    +         * /
    +        vbuff.curpos = NULL;
    +        vbuff.endpos = NULL;
    +    } else {
    +        /* save one byte for nul terminator */
    +        vbuff.curpos = buf;
    +        vbuff.endpos = buf + len - 1;
    +    }
         va_start(ap, format);
         cc = apr_vformatter(snprintf_flush, &vbuff, format, ap);
         va_end(ap);
    @@ -1268,9 +1280,15 @@ APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format,
         int cc;
         apr_vformatter_buff_t vbuff;
     
    -    /* save one byte for nul terminator */
    -    vbuff.curpos = buf;
    -    vbuff.endpos = buf + len - 1;
    +    if (len == 0) {
    +        /* See above notee */
    +        vbuff.curpos = NULL;
    +        vbuff.endpos = NULL;
    +    } else {
    +        /* save one byte for nul terminator */
    +        vbuff.curpos = buf;
    +        vbuff.endpos = buf + len - 1;
    +    }
         cc = apr_vformatter(snprintf_flush, &vbuff, format, ap);
         if (len != 0) {
             *vbuff.curpos = '\0';
    
    From 5f09d23d0223a228d85d4ba05197e449465cdab2 Mon Sep 17 00:00:00 2001
    From: Jim Jagielski 
    Date: Tue, 27 Aug 2002 00:15:51 +0000
    Subject: [PATCH 3819/7878] Add another test... PR: Obtained from: Submitted
     by: Reviewed by:
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63833 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/teststr.c | 12 +++++++++++-
     1 file changed, 11 insertions(+), 1 deletion(-)
    
    diff --git a/test/teststr.c b/test/teststr.c
    index c7d4534af7c..c58656c8e7c 100644
    --- a/test/teststr.c
    +++ b/test/teststr.c
    @@ -143,12 +143,22 @@ static void test_snprintf(apr_pool_t *p)
             fprintf(stderr, "OK\n");
         }
     
    -    fprintf(stderr, "Testing 0 length ..........  ");
    +    fprintf(stderr, "Testing 0 length with NULL ..........  ");
         rv = apr_snprintf(NULL, 0, "%sBAR", "FOO");
         if (rv != 6) {
             fprintf(stderr, "FAILED\n");
         }
         fprintf(stderr, "OK\n");
    +
    +    fprintf(stderr, "Testing 0 length with non-NULL ..........  ");
    +    rv = apr_snprintf(buff, 0, "%sBAR", "FOO");
    +    if (rv != 6) {
    +        fprintf(stderr, "FAILED (return val)\n");
    +    }
    +    if (strcmp(buff, "FOOBAR") == 0) {
    +        fprintf(stderr, "FAILED (mangled buff)\n");
    +    }
    +    fprintf(stderr, "OK\n");
     }
     
     int main(int argc, const char * const argv[])
    
    From a75300ea9997f810e8923516a9a2fc9649fc62c6 Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Tue, 27 Aug 2002 00:40:51 +0000
    Subject: [PATCH 3820/7878] Fix typo that broke things in really odd ways.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63834 13f79535-47bb-0310-9956-ffa450edef68
    ---
     strings/apr_snprintf.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c
    index 6cde1877905..3256fbd240d 100644
    --- a/strings/apr_snprintf.c
    +++ b/strings/apr_snprintf.c
    @@ -1256,7 +1256,7 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len,
              * just does actual inserts iff the buffer pointer is non-NULL.
              * In this case, we don't care what buf is; it can be NULL, since
              * we don't touch it at all.
    -         * /
    +         */
             vbuff.curpos = NULL;
             vbuff.endpos = NULL;
         } else {
    
    From 4c1c01ec27e672eb4a1e18ae1e728b061f5d8140 Mon Sep 17 00:00:00 2001
    From: Jim Jagielski 
    Date: Tue, 27 Aug 2002 02:04:04 +0000
    Subject: [PATCH 3821/7878] fix typo before someone else notices it and pounces
     :)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63835 13f79535-47bb-0310-9956-ffa450edef68
    ---
     strings/apr_snprintf.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c
    index 3256fbd240d..b282f246b0b 100644
    --- a/strings/apr_snprintf.c
    +++ b/strings/apr_snprintf.c
    @@ -1281,7 +1281,7 @@ APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format,
         apr_vformatter_buff_t vbuff;
     
         if (len == 0) {
    -        /* See above notee */
    +        /* See above note */
             vbuff.curpos = NULL;
             vbuff.endpos = NULL;
         } else {
    
    From 1bd0a1d5e9d4f35a087ee379782b9e005d5d1e65 Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Tue, 27 Aug 2002 16:01:40 +0000
    Subject: [PATCH 3822/7878] bye bye, testtable...
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63836 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/.cvsignore | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/test/.cvsignore b/test/.cvsignore
    index 1423951986d..439041f645c 100644
    --- a/test/.cvsignore
    +++ b/test/.cvsignore
    @@ -63,3 +63,4 @@ testglobalmutex
     testvsn
     testregex
     testmutexscope
    +testtable
    
    From 1a9c7b10b84dc922f7d6e9ddc6d0b51654d5ceb7 Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Wed, 28 Aug 2002 06:15:19 +0000
    Subject: [PATCH 3823/7878] We're no longer 0.9.0-dev. The tag will be shifted
     to this new rev in just a second.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63837 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_version.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr_version.h b/include/apr_version.h
    index c8ad159ffe1..704bda91e19 100644
    --- a/include/apr_version.h
    +++ b/include/apr_version.h
    @@ -106,7 +106,7 @@ extern "C" {
      *  This symbol is defined for internal, "development" copies of APR. This
      *  symbol will be #undef'd for releases. 
      */
    -#define APR_IS_DEV_VERSION
    +#undef APR_IS_DEV_VERSION
     
     /** The formatted string of APR's version */
     #define APR_VERSION_STRING \
    
    From 81ad1a3e184dd9db24be910be20b34359d45ed7e Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Wed, 28 Aug 2002 06:16:14 +0000
    Subject: [PATCH 3824/7878] Now at 0.9.1-dev
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63839 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_version.h | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/include/apr_version.h b/include/apr_version.h
    index 704bda91e19..0f0652a70f1 100644
    --- a/include/apr_version.h
    +++ b/include/apr_version.h
    @@ -99,14 +99,14 @@ extern "C" {
     #define APR_MINOR_VERSION       9
     
     /** patch level */
    -#define APR_PATCH_VERSION       0
    +#define APR_PATCH_VERSION       1
     
     
     /** 
      *  This symbol is defined for internal, "development" copies of APR. This
      *  symbol will be #undef'd for releases. 
      */
    -#undef APR_IS_DEV_VERSION
    +#define APR_IS_DEV_VERSION
     
     /** The formatted string of APR's version */
     #define APR_VERSION_STRING \
    
    From 7b988b941713506377cdb5708894210b00210e60 Mon Sep 17 00:00:00 2001
    From: Tony Finch 
    Date: Wed, 28 Aug 2002 14:54:12 +0000
    Subject: [PATCH 3825/7878] Explain the workings of the ring sentinel. They'll
     never let me into the Magic Circle.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63840 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_ring.h | 55 ++++++++++++++++++++++++++++++++++++++++++++--
     1 file changed, 53 insertions(+), 2 deletions(-)
    
    diff --git a/include/apr_ring.h b/include/apr_ring.h
    index 4f006e4fcdf..86cf0bb12cd 100644
    --- a/include/apr_ring.h
    +++ b/include/apr_ring.h
    @@ -96,8 +96,10 @@
      *          char *bar;
      *      };
      * 
    - * An element struct may be put on more than one ring if it has - * more than one APR_RING_ENTRY field. + * + * An element struct may be put on more than one ring if it has more + * than one APR_RING_ENTRY field. Each APR_RING_ENTRY has a corresponding + * APR_RING_HEAD declaration. * * @warning For strict C standards compliance you should put the APR_RING_ENTRY * first in the element struct unless the head is always part of a larger @@ -140,6 +142,55 @@ * get rid of all the special cases when dealing with the ends of the * ring, we play typecasting games to make it look like one. * + * Here is a diagram to illustrate the arrangements of the next and + * prev pointers of each element in a single ring. Note that they point + * to the start of each element, not to the APR_RING_ENTRY structure. + * + *
    + *     +->+------+<-+  +->+------+<-+  +->+------+<-+
    + *     |  |struct|  |  |  |struct|  |  |  |struct|  |
    + *    /   | elem |   \/   | elem |   \/   | elem |  \
    + * ...    |      |   /\   |      |   /\   |      |   ...
    + *        +------+  |  |  +------+  |  |  +------+
    + *   ...--|prev  |  |  +--|ring  |  |  +--|prev  |
    + *        |  next|--+     | entry|--+     |  next|--...
    + *        +------+        +------+        +------+
    + *        | etc. |        | etc. |        | etc. |
    + *        :      :        :      :        :      :
    + * 
    + * + * The APR_RING_HEAD is nothing but a bare APR_RING_ENTRY. The prev + * and next pointers in the first and last elements don't actually + * point to the head, they point to a phantom place called the + * sentinel. Its value is such that last->next->next == first because + * the offset from the sentinel to the head's next pointer is the same + * as the offset from the start of an element to its next pointer. + * This also works in the opposite direction. + * + *
    + *        last                            first
    + *     +->+------+<-+  +->sentinel<-+  +->+------+<-+
    + *     |  |struct|  |  |            |  |  |struct|  |
    + *    /   | elem |   \/              \/   | elem |  \
    + * ...    |      |   /\              /\   |      |   ...
    + *        +------+  |  |  +------+  |  |  +------+
    + *   ...--|prev  |  |  +--|ring  |  |  +--|prev  |
    + *        |  next|--+     |  head|--+     |  next|--...
    + *        +------+        +------+        +------+
    + *        | etc. |                        | etc. |
    + *        :      :                        :      :
    + * 
    + * + * Note that the offset mentioned above is different for each kind of + * ring that the element may be on, and each kind of ring has a unique + * name for its APR_RING_ENTRY in each element, and has its own type + * for its APR_RING_HEAD. + * + * Note also that if the offset is non-zero (which is required if an + * element has more than one APR_RING_ENTRY), the unreality of the + * sentinel may have bad implications on very perverse implementations + * of C -- see the warning in APR_RING_ENTRY. + * * @param hp The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct From 3d08a7473a9f734300f335206d2d56521f2fe2f4 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Thu, 29 Aug 2002 17:56:52 +0000 Subject: [PATCH 3826/7878] Fix the result of "apr-config --link-ld --libs". It did not include the "-0" suffix on the lib name. - Remove "lib" prefix from APR_LIBNAME definition. - Determine ld-style library name from APR_LIBNAME for correct suffix. Submitted by: Scott Lamb git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63841 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 4 ++-- apr-config.in | 10 +++++----- configure.in | 2 +- test/Makefile.in | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index 1a74ac9045c..7f069db9c6e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -20,7 +20,7 @@ SUBDIRS=@SUBDIRS@ CLEAN_SUBDIRS= . test build INSTALL_SUBDIRS=@INSTALL_SUBDIRS@ -TARGET_LIB = @APR_LIBNAME@.la +TARGET_LIB = lib@APR_LIBNAME@.la # # Rules for building specific targets, starting with 'all' for @@ -118,7 +118,7 @@ export_vars.h: $(AWK) -f $(top_srcdir)/build/make_var_export.awk $(EXPORT_FILES) > $@ apr.exp: exports.c export_vars.h - @echo "#! @APR_LIBNAME@.so" > $@ + @echo "#! lib@APR_LIBNAME@.so" > $@ @echo "* This file was AUTOGENERATED at build time." >> $@ @echo "* Please do not edit by hand." >> $@ $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@ diff --git a/apr-config.in b/apr-config.in index fd916f43e46..62992e96149 100644 --- a/apr-config.in +++ b/apr-config.in @@ -134,9 +134,9 @@ else fi if test "$location" = "installed"; then - LA_FILE="$libdir/${APR_LIBNAME}.la" + LA_FILE="$libdir/lib${APR_LIBNAME}.la" else - LA_FILE="$thisdir/${APR_LIBNAME}.la" + LA_FILE="$thisdir/lib${APR_LIBNAME}.la" fi flags="" @@ -189,9 +189,9 @@ while test $# -gt 0; do --link-ld) if test "$location" = "installed"; then ### avoid using -L if libdir is a "standard" location like /usr/lib - flags="$flags -L$libdir -lapr" + flags="$flags -L$libdir -l${APR_LIBNAME}" else - flags="$flags -L$thisdir -lapr" + flags="$flags -L$thisdir -l${APR_LIBNAME}" fi ;; --link-libtool) @@ -203,7 +203,7 @@ while test $# -gt 0; do flags="$flags $LA_FILE" elif test "$location" = "installed"; then ### avoid using -L if libdir is a "standard" location like /usr/lib - flags="$flags -L$libdir -lapr" + flags="$flags -L$libdir -l${APR_LIBNAME}" else flags="$flags $LA_FILE" fi diff --git a/configure.in b/configure.in index e5c61c7cf23..7edba41a391 100644 --- a/configure.in +++ b/configure.in @@ -122,7 +122,7 @@ AC_MINIX APR_EBCDIC dnl this is our library name -APR_LIBNAME="libapr${libsuffix}" +APR_LIBNAME="apr${libsuffix}" AC_SUBST(APR_LIBNAME) dnl prep libtool diff --git a/test/Makefile.in b/test/Makefile.in index a7555562a49..d03dd6f7c4c 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -52,7 +52,7 @@ TARGETS = $(PROGRAMS) $(NONPORTABLE) # bring in rules.mk for standard functionality @INCLUDE_RULES@ -LOCAL_LIBS=../@APR_LIBNAME@.la +LOCAL_LIBS=../lib@APR_LIBNAME@.la CLEAN_TARGETS = testfile.tmp testdso@EXEEXT@ mod_test.slo From b8e4000d72deb62373476407b590ae14c2a991a4 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 31 Aug 2002 22:56:18 +0000 Subject: [PATCH 3827/7878] Cleaner mechanism for using platform-specific atomics on platforms that override some of the default atomic functions but not others git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63842 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 60 ++++++++++++++++++---------- include/apr_atomic.h | 86 +++++++++++++++++++++++++++++----------- 2 files changed, 102 insertions(+), 44 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index a17e1adaa73..e28d0f94cc2 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -56,17 +56,18 @@ #include "apr_atomic.h" #include "apr_thread_mutex.h" -#if APR_HAS_THREADS - -#if defined(APR_ATOMIC_NEED_DEFAULT) || defined(APR_ATOMIC_NEED_CAS_DEFAULT) +#if !defined(apr_atomic_init) && !defined(APR_OVERRIDE_ATOMIC_INIT) +#if APR_HAS_THREADS #define NUM_ATOMIC_HASH 7 /* shift by 2 to get rid of alignment issues */ #define ATOMIC_HASH(x) (unsigned int)(((unsigned long)(x)>>2)%(unsigned int)NUM_ATOMIC_HASH) static apr_thread_mutex_t **hash_mutex; +#endif /* APR_HAS_THREADS */ apr_status_t apr_atomic_init(apr_pool_t *p) { +#if APR_HAS_THREADS int i; apr_status_t rv; hash_mutex = apr_palloc(p, sizeof(apr_thread_mutex_t*) * NUM_ATOMIC_HASH); @@ -78,13 +79,15 @@ apr_status_t apr_atomic_init(apr_pool_t *p) return rv; } } +#endif /* APR_HAS_THREADS */ return APR_SUCCESS; } -#endif /* APR_ATOMIC_NEED_DEFAULT || APR_ATOMIC_NEED_CAS_DEFAULT */ +#endif /*!defined(apr_atomic_init) && !defined(APR_OVERRIDE_ATOMIC_INIT) */ -#if defined(APR_ATOMIC_NEED_DEFAULT) +#if !defined(apr_atomic_add) && !defined(APR_OVERRIDE_ATOMIC_ADD) void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val) { +#if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; apr_uint32_t prev; @@ -93,10 +96,16 @@ void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val) *mem += val; apr_thread_mutex_unlock(lock); } +#else + *mem += val; +#endif /* APR_HAS_THREADS */ } +#endif /*!defined(apr_atomic_add) && !defined(APR_OVERRIDE_ATOMIC_ADD) */ +#if !defined(apr_atomic_set) && !defined(APR_OVERRIDE_ATOMIC_SET) void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val) { +#if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; apr_uint32_t prev; @@ -105,10 +114,16 @@ void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val) *mem = val; apr_thread_mutex_unlock(lock); } +#else + *mem = val; +#endif /* APR_HAS_THREADS */ } +#endif /*!defined(apr_atomic_set) && !defined(APR_OVERRIDE_ATOMIC_SET) */ +#if !defined(apr_atomic_inc) && !defined(APR_OVERRIDE_ATOMIC_INC) void apr_atomic_inc(volatile apr_uint32_t *mem) { +#if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; apr_uint32_t prev; @@ -117,10 +132,16 @@ void apr_atomic_inc(volatile apr_uint32_t *mem) (*mem)++; apr_thread_mutex_unlock(lock); } +#else + (*mem)++; +#endif /* APR_HAS_THREADS */ } +#endif /*!defined(apr_atomic_inc) && !defined(APR_OVERRIDE_ATOMIC_INC) */ +#if !defined(apr_atomic_dec) && !defined(APR_OVERRIDE_ATOMIC_DEC) int apr_atomic_dec(volatile apr_atomic_t *mem) { +#if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; apr_uint32_t new; @@ -130,14 +151,17 @@ int apr_atomic_dec(volatile apr_atomic_t *mem) apr_thread_mutex_unlock(lock); return new; } +#else + (*mem)--; +#endif /* APR_HAS_THREADS */ return *mem; } +#endif /*!defined(apr_atomic_dec) && !defined(APR_OVERRIDE_ATOMIC_DEC) */ -#endif /* APR_ATOMIC_NEED_DEFAULT */ -#if defined(APR_ATOMIC_NEED_CAS_DEFAULT) - +#if !defined(apr_atomic_cas) && !defined(APR_OVERRIDE_ATOMIC_CASE) apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp) { +#if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; long prev; @@ -150,16 +174,12 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp) return prev; } return *(long*)mem; -} -#endif /* APR_ATOMIC_NEED_CAS_DEFAULT */ - -#else /* !APR_HAS_THREADS */ - -#if !defined(apr_atomic_init) -apr_status_t apr_atomic_init(apr_pool_t *p) -{ - return APR_SUCCESS; -} -#endif /* !defined(apr_atomic_init) */ - +#else + prev = *(long*)mem; + if ( prev == cmp) { + *(long*)mem = with; + } + return prev; #endif /* APR_HAS_THREADS */ +} +#endif /*!defined(apr_atomic_dec) && !defined(APR_OVERRIDE_ATOMIC_DEC) */ diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 9277658cf78..e9189aa565f 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -136,13 +136,14 @@ int apr_atomic_dec(volatile apr_atomic_t *mem); apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #else /* !DOXYGEN */ -#if APR_FORCE_ATOMIC_GENERIC -#if APR_HAS_THREADS -#define APR_ATOMIC_NEED_DEFAULT 1 -#define APR_ATOMIC_NEED_CAS_DEFAULT 1 -#endif /* APR_HAS_THREADS */ +/* The following definitions provide optimized, OS-specific + * implementations of the APR atomic functions on various + * platforms. Any atomic operation that isn't redefined as + * a macro here will be declared as a function later, and + * apr_atomic.c will provide a mutex-based default implementation. + */ -#elif defined(WIN32) +#if defined(WIN32) typedef LONG apr_atomic_t; @@ -161,6 +162,7 @@ typedef LONG apr_atomic_t; #define apr_atomic_add(mem, val) atomic_add(mem,val) APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); +#define APR_OVERRIDE_ATOMIC_DEC 1 #define apr_atomic_inc(mem) atomic_inc(mem) #define apr_atomic_set(mem, val) (*mem = val) #define apr_atomic_read(mem) (*mem) @@ -178,9 +180,8 @@ APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); #define apr_atomic_set(mem, val) atomic_set_int(mem, val) #define apr_atomic_read(mem) (*mem) -#define APR_ATOMIC_NEED_CAS_DEFAULT 1 +#elif defined(__linux__) && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC -#elif defined(__linux__) && defined(__i386__) #define apr_atomic_t apr_uint32_t #define apr_atomic_cas(mem,with,cmp) \ ({ apr_atomic_t prev; \ @@ -190,12 +191,8 @@ APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); : "memory"); \ prev;}) -#define APR_ATOMIC_NEED_DEFAULT 1 -#if defined(APR_ATOMIC_NEED_CAS_DEFAULT) -#undef APR_ATOMIC_NEED_CAS_DEFAULT -#endif +#elif defined(__sparc__) || defined(sparc) && !APR_FORCE_ATOMIC_GENERIC -#elif defined(__sparc__) || defined(sparc) #define apr_atomic_t apr_uint32_t #define apr_atomic_read(p) *p @@ -217,6 +214,8 @@ apr_uint32_t apr_atomic_cas_sparc(volatile apr_uint32_t *mem, long with, long cm apr_int32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_int32_t val); apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem, apr_uint32_t swap, apr_uint32_t cmp); +#define APR_OVERRIDE_ATOMIC_ADD 1 +#define APR_OVERRIDE_ATOMIC_CAS 1 #define apr_atomic_inc(mem) apr_atomic_add(mem, 1) #define apr_atomic_dec(mem) apr_atomic_add(mem, -1) @@ -234,30 +233,69 @@ apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem, apr_uint32_t swap, #define apr_atomic_read(p) (*p) #define apr_atomic_set(mem, val) (*mem = val) -#else -#if APR_HAS_THREADS -#define APR_ATOMIC_NEED_DEFAULT 1 -#define APR_ATOMIC_NEED_CAS_DEFAULT 1 -#endif /* APR_HAS_THREADS */ +#endif /* end big if-elseif switch for platform-specifics */ + -#endif /* !defined(WIN32) */ +/* Default implementation of the atomic API + * The definitions above may override some or all of the + * atomic functions with optimized, platform-specific versions. + * Any operation that hasn't been overridden as a macro above + * is declared as a function here, unless APR_OVERRIDE_ATOMIC_[OPERATION] + * is defined. (The purpose of the APR_OVERRIDE_ATOMIC_* is + * to allow a platform to declare an apr_atomic_*() function + * with a different signature than the default.) + */ + +#define APR_ATOMIC_NEED_DEFAULT_INIT 0 -#if defined(APR_ATOMIC_NEED_DEFAULT) +#if !defined(apr_atomic_t) #define apr_atomic_t apr_uint32_t -#define apr_atomic_read(p) *p +#endif + +#if !defined(apr_atomic_init) && !defined(APR_OVERRIDE_ATOMIC_INIT) apr_status_t apr_atomic_init(apr_pool_t *p); +#endif + +#if !defined(apr_atomic_read) && !defined(APR_OVERRIDE_ATOMIC_READ) +#define apr_atomic_read(p) *p +#endif + +#if !defined(apr_atomic_set) && !defined(APR_OVERRIDE_ATOMIC_SET) void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val); +#define APR_ATOMIC_NEED_DEFAULT_INIT 1 +#endif + +#if !defined(apr_atomic_add) && !defined(APR_OVERRIDE_ATOMIC_ADD) void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val); +#define APR_ATOMIC_NEED_DEFAULT_INIT 1 +#endif + +#if !defined(apr_atomic_inc) && !defined(APR_OVERRIDE_ATOMIC_INC) void apr_atomic_inc(volatile apr_atomic_t *mem); +#define APR_ATOMIC_NEED_DEFAULT_INIT 1 +#endif + +#if !defined(apr_atomic_dec) && !defined(APR_OVERRIDE_ATOMIC_DEC) int apr_atomic_dec(volatile apr_atomic_t *mem); +#define APR_ATOMIC_NEED_DEFAULT_INIT 1 #endif -#if defined(APR_ATOMIC_NEED_CAS_DEFAULT) -apr_status_t apr_atomic_init(apr_pool_t *p); +#if !defined(apr_atomic_cas) && !defined(APR_OVERRIDE_ATOMIC_CAS) apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); +#define APR_ATOMIC_NEED_DEFAULT_INIT 1 +#endif + +/* If we're using the default versions of any of the atomic functions, + * we'll need the atomic init to set up mutexes. If a platform-specific + * override above has replaced the atomic_init with a macro, it's an error. + */ +#if APR_ATOMIC_NEED_DEFAULT_INIT +#if defined(apr_atomic_init) || defined(APR_OVERRIDE_ATOMIC_INIT) +#error Platform has redefined apr_atomic_init, but other default default atomics require a default apr_atomic_init #endif +#endif /* APR_ATOMIC_NEED_DEFAULT_INIT */ -#endif /* DOXYGEN */ +#endif /* !DOXYGEN */ #ifdef __cplusplus } #endif From f510eee0e529fa3ae7c3e5f61655150a555db7c5 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 1 Sep 2002 04:15:11 +0000 Subject: [PATCH 3828/7878] Bugfix for apr_pollset_remove() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63843 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 82b049902ae..657625d97f5 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -463,6 +463,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, else { pollset->pollset[dst] = pollset->pollset[i]; pollset->query_set[dst] = pollset->query_set[i]; + dst++; } } return APR_SUCCESS; @@ -493,6 +494,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, } else { pollset->query_set[dst] = pollset->query_set[i]; + dst++; } } FD_CLR(fd, &(pollset->readset)); From e5bb8931da1dc5f25e7ccda219a039f07c5f6dc3 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 1 Sep 2002 09:34:42 +0000 Subject: [PATCH 3829/7878] Fixed the SPARC v8plus version of apr_atomic_dec so that it returns the new value instead of the old value (to match the way the other implementations of this function work) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63844 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ atomic/solaris_sparc/apr_atomic_sparc.s | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index e5f00908785..3eef20f1c5b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.0 + *) Fixed the native SPARC v8plus version of apr_atomic_dec + to match the semantics of the default C version [Brian Pane] + *) If the length argument to apr_snprintf is 0, then we should return the length that the string would be if we actually were going to fill it out. However, if the length argument is 0, we can also accept a NULL string. diff --git a/atomic/solaris_sparc/apr_atomic_sparc.s b/atomic/solaris_sparc/apr_atomic_sparc.s index 3057b3238d2..9d87fe03d79 100644 --- a/atomic/solaris_sparc/apr_atomic_sparc.s +++ b/atomic/solaris_sparc/apr_atomic_sparc.s @@ -65,6 +65,7 @@ ! %o1 [input] - the increment delta value ! %o2 [local] - work register (was %l0 in book) ! %o3 [local] - work register (was %l1 in book) +! %o4 [local] - work register ! %o0 [output] - contains return value ! ! @@ -90,12 +91,13 @@ _apr_atomic_add_sparc_loop: ld [%o0], %o2 _apr_atomic_sub_sparc_loop: sub %o2, %o1, %o3 + mov %o3, %o4 cas [%o0], %o2, %o3 cmp %o2, %o3 bne,a _apr_atomic_sub_sparc_loop - ld [%o0], %o2 + nop retl - mov %o3, %o0 + mov %o4, %o0 SET_SIZE(apr_atomic_sub_sparc) ! From 70b0dfc89afb03aaba7088128f23defa1a079a03 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 1 Sep 2002 16:54:41 +0000 Subject: [PATCH 3830/7878] Delay definition of APR_ATOMIC_NEED_DEFAULT_INIT to be 0 and only do so if it isn't previously defined. (Silences all sorts of redefinition warnings.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63845 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index e9189aa565f..fb8036aabed 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -246,8 +246,6 @@ apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem, apr_uint32_t swap, * with a different signature than the default.) */ -#define APR_ATOMIC_NEED_DEFAULT_INIT 0 - #if !defined(apr_atomic_t) #define apr_atomic_t apr_uint32_t #endif @@ -285,6 +283,10 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #define APR_ATOMIC_NEED_DEFAULT_INIT 1 #endif +#ifndef APR_ATOMIC_NEED_DEFAULT_INIT +#define APR_ATOMIC_NEED_DEFAULT_INIT 0 +#endif + /* If we're using the default versions of any of the atomic functions, * we'll need the atomic init to set up mutexes. If a platform-specific * override above has replaced the atomic_init with a macro, it's an error. From 9a955ecc5a28860666933e1383c4224babb3a747 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 1 Sep 2002 17:14:11 +0000 Subject: [PATCH 3831/7878] Minor style nit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63846 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index e28d0f94cc2..0f69d610e26 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -167,7 +167,7 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp) if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { prev = *(long*)mem; - if ( prev == cmp) { + if (prev == cmp) { *(long*)mem = with; } apr_thread_mutex_unlock(lock); @@ -176,7 +176,7 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp) return *(long*)mem; #else prev = *(long*)mem; - if ( prev == cmp) { + if (prev == cmp) { *(long*)mem = with; } return prev; From 41a3a318968b554119585f611dcef2bdf79ccb95 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 1 Sep 2002 17:15:05 +0000 Subject: [PATCH 3832/7878] Fix !APR_HAS_THREADS code path for apr_atomic_cas by always defining prev. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63847 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 0f69d610e26..c4c98539a7d 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -161,9 +161,9 @@ int apr_atomic_dec(volatile apr_atomic_t *mem) #if !defined(apr_atomic_cas) && !defined(APR_OVERRIDE_ATOMIC_CASE) apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp) { + long prev; #if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - long prev; if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { prev = *(long*)mem; From 407ddf6862bcbb86b9e5c6b729f2b060a20cdb74 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 2 Sep 2002 09:27:57 +0000 Subject: [PATCH 3833/7878] Add apr_array_pop() function to apr_array_header_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63848 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ include/apr_tables.h | 8 ++++++++ tables/apr_tables.c | 9 +++++++++ 3 files changed, 19 insertions(+) diff --git a/CHANGES b/CHANGES index 3eef20f1c5b..68c75ff63f2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR 0.9.0 + *) Add apr_array_pop(). [Justin Erenkrantz] + *) Fixed the native SPARC v8plus version of apr_atomic_dec to match the semantics of the default C version [Brian Pane] diff --git a/include/apr_tables.h b/include/apr_tables.h index 852a48ac315..1e5404002e9 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -160,6 +160,14 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, */ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr); +/** + * Remove an element from an array + * @param arr The array to remove an element from. + * @return Location of the element in the array. + * @remark If there are no elements in the array, NULL is returned. + */ +APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr); + /** * Concatenate two arrays together * @param dst The destination array, and the one to go first in the combined diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 74d7d7770f2..24659f00a72 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -124,6 +124,15 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, return res; } +APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr) +{ + if (apr_is_empty_array(arr)) { + return NULL; + } + + return arr->elts + (arr->elt_size * (--arr->nelts)); +} + APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr) { if (arr->nelts == arr->nalloc) { From a5c6fdc9ac9ce918aad0f2dd24107ec445dd931f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 3 Sep 2002 16:29:43 +0000 Subject: [PATCH 3834/7878] Getting ready to build for IPV6 on NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63849 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 4 ++++ include/arch/netware/apr_private.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/apr.hnw b/include/apr.hnw index 3c465870eec..6e3d456232a 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -170,7 +170,11 @@ #define APR_HAVE_IN_ADDR 1 #define APR_HAVE_INET_ADDR 1 #define APR_HAVE_INET_NETWORK 0 +#ifdef NW_BUILD_IPV6 +#define APR_HAVE_IPV6 1 +#else #define APR_HAVE_IPV6 0 +#endif #define APR_HAVE_MEMCHR 1 #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 9df1b957ebe..793941371de 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -99,6 +99,10 @@ #define ALLOC_USE_MALLOC #define DSO_USE_DLFCN +#ifdef NW_BUILD_IPV6 +#define HAVE_GETADDRINFO 1 +#define HAVE_GETNAMEINFO 1 +#endif /* 1 is used for SIGABRT on netware */ /* 2 is used for SIGFPE on netware */ From 2366af1afa015fa87c03e712024ea950bd82f218 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 5 Sep 2002 05:25:04 +0000 Subject: [PATCH 3835/7878] Remove the toplevel "make test" target, but replace it with a simliar "make check" (If anyone has strong feelings about this, I don't mind changing it to "make test" again.) Add an explicit all target to the test/Makefile that simply builds the normal and non-portable programs. Add a check target to the test/Makefile that makes sure all test programs are built then runs each one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63850 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 11 ++--------- test/Makefile.in | 10 ++++++++++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7f069db9c6e..0bf9228ea3f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -127,15 +127,8 @@ apr.exp: exports.c export_vars.h dox: doxygen $(top_srcdir)/docs/doxygen.conf -test: $(TARGET_LIB) - (cd test; make clean; make; \ - for prog in `find . -type f -perm -u+x -name "test*" -print`; do \ - ./$$prog; \ - if [ $$? -eq 255 ]; then \ - echo "$$prog failed"; \ - break; \ - fi \ - done ) +check: $(TARGET_LIB) + (cd test && $(MAKE) check) # DO NOT REMOVE docs: $(INCDIR)/*.h diff --git a/test/Makefile.in b/test/Makefile.in index d03dd6f7c4c..2ad52775c0e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -59,6 +59,16 @@ CLEAN_TARGETS = testfile.tmp testdso@EXEEXT@ mod_test.slo INCDIR=../include INCLUDES=-I$(INCDIR) +all: $(PROGRAMS) $(NONPORTABLE) + +check: $(PROGRAMS) $(NONPORTABLE) + for prog in $(PROGRAMS) $(NONPORTABLE); do \ + ./$$prog; \ + if test $$i = 255; then \ + echo "$$prog failed"; \ + break; \ + fi \ + done testfile@EXEEXT@: testfile.lo $(LOCAL_LIBS) $(LINK) testfile.lo $(LOCAL_LIBS) $(ALL_LIBS) From 13ea40f4b7ebc811de14d59d9bb989192abc90fd Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 5 Sep 2002 05:26:48 +0000 Subject: [PATCH 3836/7878] Mention the "make check" changes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63851 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 68c75ff63f2..e9e410b41f9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.0 + *) Running "make check" in the toplevel directory or the test/ directory + will build and run all test programs. [Aaron Bannert] + *) Add apr_array_pop(). [Justin Erenkrantz] *) Fixed the native SPARC v8plus version of apr_atomic_dec From 04105e67f07e4fc0a1cae01b2a08c1f27f817353 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 6 Sep 2002 20:27:06 +0000 Subject: [PATCH 3837/7878] Update the inline comments to reflect reality regarding how apr_snprintf works. Document the "new" special case. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63852 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index d9406f6831c..6cadb48e97f 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -265,16 +265,18 @@ APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last); * * Note that various standards and implementations disagree on the return * value of snprintf, and side-effects due to %n in the formatting string. - * apr_snprintf behaves as follows: + * apr_snprintf (and apr_vsnprintf) behaves as follows: * * Process the format string until the entire string is exhausted, or * the buffer fills. If the buffer fills then stop processing immediately * (so no further %n arguments are processed), and return the buffer - * length. In all cases the buffer is NUL terminated. + * length. In all cases the buffer is NUL terminated. It will return the + * number of characters inserted into the buffer, not including the + * terminating NUL. As a special case, if len is 0, apr_snprintf will + * return the number of characters that would have been inserted if + * the buffer had been infinite (in this case, *buffer can be NULL) * - * In no event does apr_snprintf return a negative number. It's not possible - * to distinguish between an output which was truncated, and an output which - * exactly filled the buffer. + * In no event does apr_snprintf return a negative number. * @{ */ From a708b7fa3a04bf65272ab7e25e8feaaf95c89006 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 7 Sep 2002 03:18:43 +0000 Subject: [PATCH 3838/7878] Handle (well, ignore for now) -version switch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63853 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/build/aplibtool.c b/build/aplibtool.c index 357393e847e..f28896ff54e 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -109,7 +109,7 @@ typedef struct { void parse_args(int argc, char *argv[], cmd_data_t *cmd_data); bool parse_long_opt(char *arg, cmd_data_t *cmd_data); -bool parse_short_opt(char *arg, cmd_data_t *cmd_data); +int parse_short_opt(char *arg, cmd_data_t *cmd_data); bool parse_input_file_name(char *arg, cmd_data_t *cmd_data); bool parse_output_file_name(char *arg, cmd_data_t *cmd_data); void post_parse_fixup(cmd_data_t *cmd_data); @@ -162,7 +162,12 @@ void parse_args(int argc, char *argv[], cmd_data_t *cmd_data) arg = argv[++a]; argused = parse_output_file_name(arg, cmd_data); } else { - argused = parse_short_opt(arg + 1, cmd_data); + int num_used = parse_short_opt(arg + 1, cmd_data); + argused = num_used > 0; + + if (num_used > 1) { + a += num_used - 1; + } } } else { argused = parse_input_file_name(arg, cmd_data); @@ -220,33 +225,37 @@ bool parse_long_opt(char *arg, cmd_data_t *cmd_data) -bool parse_short_opt(char *arg, cmd_data_t *cmd_data) +int parse_short_opt(char *arg, cmd_data_t *cmd_data) { if (strcmp(arg, "export-dynamic") == 0) { - return true; + return 1; } if (strcmp(arg, "module") == 0) { - return true; + return 1; } if (strcmp(arg, "Zexe") == 0) { - return true; + return 1; } if (strcmp(arg, "avoid-version") == 0) { - return true; + return 1; } if (strcmp(arg, "prefer-pic") == 0) { - return true; + return 1; } if (strcmp(arg, "prefer-non-pic") == 0) { - return true; + return 1; } - return false; + if (strcmp(arg, "version-info") == 0 ) { + return 2; + } + + return 0; } From f6522c4c7b5c66b4d7e9c016cddc46e78aa6753c Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Mon, 9 Sep 2002 22:02:17 +0000 Subject: [PATCH 3839/7878] Include alloca.h on Tru64 to ensure that alloca gets redefined to a version that works properly with threads Submitted by: David Hill [ddhill@zk3.dec.com] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63854 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ poll/unix/poll.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index e9e410b41f9..393c3d125ea 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.0 + *) Fixed usage of alloca in apr_poll() on Tru64 + [Dave Hill ] + *) Running "make check" in the toplevel directory or the test/ directory will build and run all test programs. [Aaron Bannert] diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 657625d97f5..9a31ecaa1ec 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -64,6 +64,10 @@ #if HAVE_SYS_POLL_H #include #endif +#if HAVE_ALLOCA && defined(__osf__) +/* Tru64 UNIX requires this for proper alloca operation in threaded programs */ +#include +#endif #ifdef NETWARE #define HAS_SOCKETS(dt) (dt == APR_POLL_SOCKET) ? 1 : 0 From c3723f60c59893af33843b9dd10d69637202bba6 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 10 Sep 2002 09:11:20 +0000 Subject: [PATCH 3840/7878] Make it a little easier to drop get-version.sh into apr-util by removing the hardcoded APR prefix to the version defines and taking that as a parameter. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63855 13f79535-47bb-0310-9956-ffa450edef68 --- build/get-version.sh | 19 ++++++++++++------- configure.in | 6 +++--- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/build/get-version.sh b/build/get-version.sh index f85b297981d..c29bceb01db 100755 --- a/build/get-version.sh +++ b/build/get-version.sh @@ -2,31 +2,36 @@ # # extract version numbers from a header file # -# USAGE: get-version.sh CMD VERSION_HEADER +# USAGE: get-version.sh CMD VERSION_HEADER PREFIX # where CMD is one of: all, major, libtool +# where PREFIX is the prefix to {MAJOR|MINOR|PATCH}_VERSION defines # # get-version.sh all returns a dotted version number # get-version.sh major returns just the major version number # get-version.sh libtool returns a version "libtool -version-info" format # -if test $# != 2; then - echo "USAGE: $0 CMD INCLUDEDIR" +if test $# != 3; then + echo "USAGE: $0 CMD INCLUDEDIR PREFIX" echo " where CMD is one of: all, major" exit 1 fi -major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $2`" -minor="`sed -n '/#define.*APR_MINOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $2`" -patch="`sed -n '/#define.*APR_PATCH_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p' $2`" +major_sed="/#define.*$3_MAJOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p" +minor_sed="/#define.*$3_MINOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p" +patch_sed="/#define.*$3_PATCH_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p" +major="`sed -n $major_sed $2`" +minor="`sed -n $minor_sed $2`" +patch="`sed -n $patch_sed $2`" if test "$1" = "all"; then echo ${major}.${minor}.${patch} elif test "$1" = "major"; then echo ${major} elif test "$1" = "libtool"; then + # Yes, ${minor}:${patch}:${minor} is correct due to libtool idiocy. echo ${minor}:${patch}:${minor} else - echo "ERROR: unknown version CMD" + echo "ERROR: unknown version CMD ($1)" exit 1 fi diff --git a/configure.in b/configure.in index 7edba41a391..08b88bf4147 100644 --- a/configure.in +++ b/configure.in @@ -69,8 +69,8 @@ APR_MKDIR_P_CHECK($apr_builders/mkdir.sh) dnl get our version information get_version="$apr_builders/get-version.sh" version_hdr="$apr_srcdir/include/apr_version.h" -APR_MAJOR_VERSION="`$get_version major $version_hdr`" -APR_DOTTED_VERSION="`$get_version all $version_hdr`" +APR_MAJOR_VERSION="`$get_version major $version_hdr APR`" +APR_DOTTED_VERSION="`$get_version all $version_hdr APR`" AC_SUBST(APR_DOTTED_VERSION) AC_SUBST(APR_MAJOR_VERSION) @@ -158,7 +158,7 @@ AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the if test "x$use_libtool" = "xyes"; then lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -c $< && touch $@' - LT_VERSION="-version-info `$get_version libtool $version_hdr`" + LT_VERSION="-version-info `$get_version libtool $version_hdr APR`" link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) ${LT_VERSION} \$(ALL_LDFLAGS) -o \$@" so_ext='lo' lib_target='-rpath $(libdir) $$objects' From 9403ac8c41bd43adc3ee40e023af2e8275e33c38 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 10 Sep 2002 16:40:13 +0000 Subject: [PATCH 3841/7878] Can not set h_errno on NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63856 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index e199ee235f4..fe8b6aaef35 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -85,11 +85,15 @@ struct apr_ipsubnet_t { #endif }; +#ifndef NETWARE #ifdef HAVE_SET_H_ERRNO #define SET_H_ERRNO(newval) set_h_errno(newval) #else #define SET_H_ERRNO(newval) h_errno = (newval) #endif +#else +#define SET_H_ERRNO(newval) +#endif #if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ defined(HAVE_GETHOSTBYNAME_R) From 98c089d46605e9fe7cfae19716e25423d9bcc2e6 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 10 Sep 2002 22:45:29 +0000 Subject: [PATCH 3842/7878] Make file environment variables for building APR for NetWare with IPV6 support git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63857 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUenvironment.inc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 345012f7627..315e65ec957 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -182,6 +182,19 @@ INSTALL = $(APR_WORK)\Dist INSTDIRS = $(APR_WORK)\Dist endif +# Add support for building IPV6 alongside +ifneq "$(IPV6)" "" +DEFINES += -DNW_BUILD_IPV6 + +ifneq "$(IPV6)" "SET" +OBJDIR := $(OBJDIR)_IPV6 +INSTALL := $(INSTALL)_IPV6 +INSTDIRS := $(INSTDIRS)_IPV6 +IPV6=SET +endif + +endif + INSTDEVDIRS := \ $(INSTDIRS) \ $(INSTALL)\Apache2 \ From 0b27aeff7b3dd954c8cc531045de986274787546 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 12 Sep 2002 00:46:57 +0000 Subject: [PATCH 3843/7878] Bump apr_version.h for 0.9.1 release git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63858 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_version.h b/include/apr_version.h index 0f0652a70f1..abf444947c2 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -106,7 +106,7 @@ extern "C" { * This symbol is defined for internal, "development" copies of APR. This * symbol will be #undef'd for releases. */ -#define APR_IS_DEV_VERSION +#undef APR_IS_DEV_VERSION /** The formatted string of APR's version */ #define APR_VERSION_STRING \ From 3e54ce8d6677dca45c51d7e2b52be3ca5b529443 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 12 Sep 2002 00:48:41 +0000 Subject: [PATCH 3844/7878] Fixup CHANGES for 0.9.1 release git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63859 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 393c3d125ea..333c456210f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -Changes with APR 0.9.0 +Changes with APR 0.9.1 *) Fixed usage of alloca in apr_poll() on Tru64 [Dave Hill ] @@ -11,6 +11,8 @@ Changes with APR 0.9.0 *) Fixed the native SPARC v8plus version of apr_atomic_dec to match the semantics of the default C version [Brian Pane] +Changes with APR 0.9.0 + *) If the length argument to apr_snprintf is 0, then we should return the length that the string would be if we actually were going to fill it out. However, if the length argument is 0, we can also accept a NULL string. From a16be95b4a7ee82bc2ab4f982470a713178728c2 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 12 Sep 2002 00:50:21 +0000 Subject: [PATCH 3845/7878] Move to 0.9.2-dev git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63861 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ include/apr_version.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 333c456210f..bffb42bd951 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +Changes with APR 0.9.2 + Changes with APR 0.9.1 *) Fixed usage of alloca in apr_poll() on Tru64 diff --git a/include/apr_version.h b/include/apr_version.h index abf444947c2..92bd1d3e08e 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -99,14 +99,14 @@ extern "C" { #define APR_MINOR_VERSION 9 /** patch level */ -#define APR_PATCH_VERSION 1 +#define APR_PATCH_VERSION 2 /** * This symbol is defined for internal, "development" copies of APR. This * symbol will be #undef'd for releases. */ -#undef APR_IS_DEV_VERSION +#define APR_IS_DEV_VERSION /** The formatted string of APR's version */ #define APR_VERSION_STRING \ From 924288d92846378a05f99f644159fb6a26831064 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 12 Sep 2002 13:29:50 +0000 Subject: [PATCH 3846/7878] Ugg! It does not appear that we have ever been disabling "native" atomics on Solaris. Change that logic so that now APR_FORCE_ATOMIC_GENERIC matters :) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63862 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index fb8036aabed..bddbd25795c 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -191,7 +191,7 @@ APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); : "memory"); \ prev;}) -#elif defined(__sparc__) || defined(sparc) && !APR_FORCE_ATOMIC_GENERIC +#elif (defined(__sparc__) || defined(sparc)) && !APR_FORCE_ATOMIC_GENERIC #define apr_atomic_t apr_uint32_t #define apr_atomic_read(p) *p From 3d7155ba6c82bef57f8fcf228bfef2b8eaca6c32 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 13 Sep 2002 04:59:52 +0000 Subject: [PATCH 3847/7878] When encountering a link error when loading a DSO on Darwin, print the error. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63863 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ dso/unix/dso.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index bffb42bd951..07217e435c9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR 0.9.2 + *) Print informative link errors on Darwin. [Justin Erenkrantz] + Changes with APR 0.9.1 *) Fixed usage of alloca in apr_poll() on Tru64 diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 8f97b7555a4..9168920fd12 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -125,7 +125,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, NSObjectFileImage image; NSModule os_handle = NULL; NSObjectFileImageReturnCode dsoerr; - char* err_msg = NULL; + const char* err_msg = NULL; dsoerr = NSCreateObjectFileImageFromFile(path, &image); if (dsoerr == NSObjectFileImageSuccess) { @@ -133,6 +133,13 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, os_handle = NSLinkModule(image, path, NSLINKMODULE_OPTION_RETURN_ON_ERROR | NSLINKMODULE_OPTION_NONE); + /* If something went wrong, get the errors... */ + if (!os_handle) { + NSLinkEditErrors errors; + int errorNumber; + const char *fileName; + NSLinkEditError(&errors, &errorNumber, &fileName, &err_msg); + } #else os_handle = NSLinkModule(image, path, FALSE); #endif From 11ef5d79c36b2c1dc4e65fabec687a3e3108a4ab Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 13 Sep 2002 07:28:40 +0000 Subject: [PATCH 3848/7878] Silence preprocessor warning git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63864 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 41bfd6dd50b..f28547744dc 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -449,7 +449,7 @@ static int include_hdrs_in_length(void) */ api = NEW; return 0; -#elif +#else /* the build system's kernel is older than 3.4. Use the old API */ return 1; #endif From 8d6df9932fa06f93a5d0e2441ea4afe4f9ebd9d1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 13 Sep 2002 15:43:30 +0000 Subject: [PATCH 3849/7878] PR: Fix a broken check for a failure to read from the random device file. PR: 12615 Submitted by: tenthumbs@cybernex.net git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63865 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ misc/unix/rand.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 07217e435c9..8c2d1a4f2dc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.2 + *) Fix a broken check for a failure to read from the random device file. + PR 12615 [tenthumbs@cybernex.net] + *) Print informative link errors on Darwin. [Justin Erenkrantz] Changes with APR 0.9.1 diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 94970dccb03..b44a3f9646c 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -85,15 +85,20 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, { #ifdef DEV_RANDOM - int rnd; + int rnd, rc; apr_size_t got, tot; if ((rnd = open(STR(DEV_RANDOM), O_RDONLY)) == -1) return errno; - for (tot=0; tot Date: Fri, 13 Sep 2002 21:45:03 +0000 Subject: [PATCH 3850/7878] Added apu_version.c to the NetWare build project git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63866 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 177597 -> 171766 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index ffc8f56381faffc1746ef8243f03119ac0c1efb1..8e303b27852e214be6c909cf35d9ef69cf79f45b 100644 GIT binary patch delta 66815 zcma&OcQ~Bg*C_m?N)ZwyqIaT4Hw>Z$(GsG!U=R_#*E=G5pV5txgb>kN7&S3rj2d-_ zZpMht=>3f6_rBNnUf((2b-sVhtiA5N`r2#FzW3I=a%->o*1MWZpR<8~{<-mwl(wK? z>FuYopD$nf=j#u$f5`v&=byKZHr8$)F1|v}wr;CaH{q1KIP}&=nfHv5%Y)S8mc&Uk zws~E4blqmWo7qK4MX56w1_vpXO={d=Gty)G^qJ~@>WNkEMiW{H)S`NNyl}kbm%Zp~ z-y$}XnX?h3AU1Q@$HNH*1FQ(tT<6My8=N`!ck*i`B{cj!1)7&R5WVd__9ejY)pO1B z&d%9Qb*t9SO&7&W0|`7u;Dt4}189|r|E!Z-ixD#8{kfhDqqAYvWvrh`;>L^j>bf@E zL%+J`))qD!4jpUP`+da|5d zbSV91xO|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878] Update revision history. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63867 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 23f16799924..808b60e3311 100644 --- a/STATUS +++ b/STATUS @@ -1,9 +1,11 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/08/22 20:16:23 $] +Last modified at [$Date: 2002/09/13 23:17:45 $] Release: - 0.9.0-dev : in progress + 0.9.2 : in progress + 0.9.1 : released September 11, 2002 + 0.9.0 : released August 28, 2002 2.0a9 : released December 12, 2000 2.0a8 : released November 20, 2000 From 3b2023c2a3e80a7bee4f809daf01c6b9deff78d2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 14 Sep 2002 20:41:10 +0000 Subject: [PATCH 3852/7878] Improve the getpass() situation on win32. Respect BS/DEL/left-arrows and generally clean up this feature. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63868 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_getpass.c | 58 ++++++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index a9fbcf233ee..78bab66233e 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -172,35 +172,63 @@ static char *getpass(const char *prompt) /* WCE lacks console. So the getpass is unsuported * The only way is to use the GUI so the getpass should be implemented * on per-application basis. -*/ + */ #ifdef _WIN32_WCE return NULL; #else - static char password[MAX_STRING_LEN]; + static char password[128]; int n = 0; + int ch; fputs(prompt, stderr); - while ((password[n] = _getch()) != '\r') { - if (n < sizeof(password) - 1 && password[n] >= ' ' && password[n] <= '~') { - n++; - printf("*"); + while ((ch = _getch()) != '\r') { + if (ch == EOF) /* EOF */ { + fputs("[EOF]\n", stderr); + return NULL; } - else { - printf("\n"); + else if (ch == 0 || ch == 0xE0) { + /* FN Keys (0 or E0) are a sentinal for a FN code */ + ch = (ch << 4) | _getch(); + /* Catch {DELETE}, {<--}, Num{DEL} and Num{<--} */ + if ((ch == 0xE53 || ch == 0xE4B || ch == 0x053 || ch == 0x04b) && n) { + password[--n] = '\0'; + fputs("\b \b", stderr); + } + else { + fputc('\a', stderr); + } + } + else if ((ch == '\b' || ch == 127) && n) /* BS/DEL */ { + password[--n] = '\0'; + fputs("\b \b", stderr); + } + else if (ch == 3) /* CTRL+C */ { + /* _getch() bypasses Ctrl+C but not Ctrl+Break detection! */ + fputs("^C\n", stderr); + exit(-1); + } + else if (ch == 26) /* CTRL+Z */ { + fputs("^Z\n", stderr); + return NULL; + } + else if (ch == 27) /* ESC */ { + fputc('\n', stderr); fputs(prompt, stderr); n = 0; } + else if ((n < sizeof(password) - 1) && !apr_iscntrl(ch)) { + password[n++] = ch; + fputc('*', stderr); + } + else { + fputc('\a', stderr); + } } + fputc('\n', stderr); password[n] = '\0'; - printf("\n"); - - if (n > (MAX_STRING_LEN - 1)) { - password[MAX_STRING_LEN - 1] = '\0'; - } - - return (char *) &password; + return password; #endif } From d727ee430fb4fa4da1ede4175074381b16b84644 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 15 Sep 2002 21:35:22 +0000 Subject: [PATCH 3853/7878] Kill a small and mostly insignificant leak. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63869 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/start.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/win32/start.c b/misc/win32/start.c index 64a0b0dee4a..e81e87c26ef 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -173,6 +173,8 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, else { } + FreeEnvironmentStringsW(sysstr); + /* MSVCRT will attempt to maintain the wide environment calls * on _putenv(), which is bogus if we've passed a non-ascii * string to _putenv(), since they use MultiByteToWideChar From 903404153ebbaa55fefe4b50f6e02acb6745fd01 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 15 Sep 2002 22:51:28 +0000 Subject: [PATCH 3854/7878] Begin to migrate the APR test suite to the CuTest framework. This basically moves testtime and teststr to a single binary, testall. The testall binary will run all of the tests that it knows about, and print the results. A document will be added later today that describes how to write tests, and how the test suite works. This is just an initial port for these test programs. There have been no new tests added. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63870 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 + test/CuTest.c | 438 +++++++++++++++++++++++++++++++++++++++++++++++ test/CuTest.h | 132 ++++++++++++++ test/Makefile.in | 17 +- test/test_apr.h | 13 ++ test/testall.c | 91 ++++++++++ test/testapr.c | 85 +++++++++ test/teststr.c | 88 +++++----- test/testtime.c | 332 ++++++++++++++++++++++------------- 9 files changed, 1035 insertions(+), 167 deletions(-) create mode 100644 test/CuTest.c create mode 100644 test/CuTest.h create mode 100644 test/testall.c create mode 100644 test/testapr.c diff --git a/CHANGES b/CHANGES index 8c2d1a4f2dc..de70d7d9f8d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR 0.9.2 + *) Begin to rehash the test suite. There is now a new test program called + testall. This program currently runs testtime and teststr with the + CuTest framework. The stand-alone programs for testtime and teststr + can be built, but only if a special flag is specified when building. + [Ryan Bloom] + *) Fix a broken check for a failure to read from the random device file. PR 12615 [tenthumbs@cybernex.net] diff --git a/test/CuTest.c b/test/CuTest.c new file mode 100644 index 00000000000..26cafe1c25e --- /dev/null +++ b/test/CuTest.c @@ -0,0 +1,438 @@ +/* + * Copyright (c) 2002-2006 Asim Jalis + * + * This library is released under the zlib/libpng license as described at + * + * http://www.opensource.org/licenses/zlib-license.html + * + * Here is the statement of the license: + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in a + * product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + */ +/* + * This file has been modified from the original distribution. + */ + +#include +#include +#include +#include +#include + +#include "CuTest.h" + +static int verbose = 0; + +void CuInit(int argc, char *argv[]) +{ + int c; + + c = getopt(argc, argv, "v"); + if (c == 'v') { + verbose = 1; + } +} + +/*-------------------------------------------------------------------------* + * CuStr + *-------------------------------------------------------------------------*/ + +char* CuStrAlloc(int size) +{ + char* new = (char*) malloc( sizeof(char) * (size) ); + return new; +} + +char* CuStrCopy(char* old) +{ + int len = strlen(old); + char* new = CuStrAlloc(len + 1); + strcpy(new, old); + return new; +} + +/*-------------------------------------------------------------------------* + * CuString + *-------------------------------------------------------------------------*/ + +void CuStringInit(CuString* str) +{ + str->length = 0; + str->size = STRING_MAX; + str->buffer = (char*) malloc(sizeof(char) * str->size); + str->buffer[0] = '\0'; +} + +CuString* CuStringNew(void) +{ + CuString* str = (CuString*) malloc(sizeof(CuString)); + str->length = 0; + str->size = STRING_MAX; + str->buffer = (char*) malloc(sizeof(char) * str->size); + str->buffer[0] = '\0'; + return str; +} + +void CuStringResize(CuString* str, int newSize) +{ + str->buffer = (char*) realloc(str->buffer, sizeof(char) * newSize); + str->size = newSize; +} + +void CuStringAppend(CuString* str, char* text) +{ + int length = strlen(text); + if (str->length + length + 1 >= str->size) + CuStringResize(str, str->length + length + 1 + STRING_INC); + str->length += length; + strcat(str->buffer, text); +} + +void CuStringAppendChar(CuString* str, char ch) +{ + char text[2]; + text[0] = ch; + text[1] = '\0'; + CuStringAppend(str, text); +} + +void CuStringAppendFormat(CuString* str, char* format, ...) +{ + va_list argp; + char buf[HUGE_STRING_LEN]; + va_start(argp, format); + vsprintf(buf, format, argp); + va_end(argp); + CuStringAppend(str, buf); +} + +void CuStringRead(CuString *str, char *path) +{ + path = strdup(str->buffer); +} + +/*-------------------------------------------------------------------------* + * CuTest + *-------------------------------------------------------------------------*/ + +void CuTestInit(CuTest* t, char* name, TestFunction function) +{ + t->name = CuStrCopy(name); + t->notimpl = 0; + t->failed = 0; + t->ran = 0; + t->message = NULL; + t->function = function; + t->jumpBuf = NULL; +} + +CuTest* CuTestNew(char* name, TestFunction function) +{ + CuTest* tc = CU_ALLOC(CuTest); + CuTestInit(tc, name, function); + return tc; +} + +void CuNotImpl(CuTest* tc, char* message) +{ + CuString* newstr = CuStringNew(); + CuStringAppend(newstr, message); + CuStringAppend(newstr, " not implemented on this platform"); + tc->notimpl = 1; + tc->message = CuStrCopy(newstr->buffer); + if (tc->jumpBuf != 0) longjmp(*(tc->jumpBuf), 0); +} + +void CuFail(CuTest* tc, char* message) +{ + tc->failed = 1; + tc->message = CuStrCopy(message); + if (tc->jumpBuf != 0) longjmp(*(tc->jumpBuf), 0); +} + +void CuAssert(CuTest* tc, char* message, int condition) +{ + if (condition) return; + CuFail(tc, message); +} + +void CuAssertTrue(CuTest* tc, int condition) +{ + if (condition) return; + CuFail(tc, "assert failed"); +} + +void CuAssertStrEquals(CuTest* tc, char* expected, char* actual) +{ + CuString* message; + if (strcmp(expected, actual) == 0) return; + message = CuStringNew(); + CuStringAppend(message, "expected\n---->\n"); + CuStringAppend(message, expected); + CuStringAppend(message, "\n<----\nbut saw\n---->\n"); + CuStringAppend(message, actual); + CuStringAppend(message, "\n<----\n"); + CuFail(tc, message->buffer); +} + +void CuAssertIntEquals(CuTest* tc, int expected, int actual) +{ + char buf[STRING_MAX]; + if (expected == actual) return; + sprintf(buf, "expected <%d> but was <%d>", expected, actual); + CuFail(tc, buf); +} + +void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual) +{ + char buf[STRING_MAX]; + if (expected == actual) return; + sprintf(buf, "expected pointer <0x%X> but was <0x%X>", expected, actual); + CuFail(tc, buf); +} + +void CuAssertPtrNotNull(CuTest* tc, void* pointer) +{ + char buf[STRING_MAX]; + if (pointer != NULL ) return; + sprintf(buf, "null pointer unexpected", pointer); + CuFail(tc, buf); +} + +void CuTestRun(CuTest* tc) +{ + jmp_buf buf; + tc->jumpBuf = &buf; + if (setjmp(buf) == 0) + { + tc->ran = 1; + (tc->function)(tc); + } + tc->jumpBuf = 0; +} + +/*-------------------------------------------------------------------------* + * CuSuite + *-------------------------------------------------------------------------*/ + +void CuSuiteInit(CuSuite* testSuite, char *name) +{ + testSuite->name = strdup(name); + testSuite->count = 0; + testSuite->failCount = 0; + testSuite->notimplCount = 0; +} + +CuSuite* CuSuiteNew(char *name) +{ + CuSuite* testSuite = CU_ALLOC(CuSuite); + CuSuiteInit(testSuite, name); + return testSuite; +} + +void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase) +{ + assert(testSuite->count < MAX_TEST_CASES); + testSuite->list[testSuite->count] = testCase; + testSuite->count++; +} + +void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2) +{ + int i; + for (i = 0 ; i < testSuite2->count ; ++i) + { + CuTest* testCase = testSuite2->list[i]; + CuSuiteAdd(testSuite, testCase); + } +} + +void CuSuiteRun(CuSuite* testSuite) +{ + int i; + for (i = 0 ; i < testSuite->count ; ++i) + { + CuTest* testCase = testSuite->list[i]; + CuTestRun(testCase); + if (testCase->failed) { testSuite->failCount += 1; } + if (testCase->notimpl) { testSuite->notimplCount += 1; } + } +} + +void CuSuiteSummary(CuSuite* testSuite, CuString* summary) +{ + int i; + CuStringAppendFormat(summary, "%s:\t", testSuite->name); + for (i = 0 ; i < testSuite->count ; ++i) + { + CuTest* testCase = testSuite->list[i]; + CuStringAppend(summary, testCase->failed ? "F" : + testCase->notimpl ? "N": "."); + } + CuStringAppend(summary, "\n"); +} + +void CuSuiteOverView(CuSuite* testSuite, CuString* details) +{ + int i; + int failCount = 0; + int notImpleCount = 0; + int passCount = testSuite->count - testSuite->failCount; + + CuStringAppendFormat(details, "%d %s run: %d passed, %d failed, " + "%d not implemented.\n", + testSuite->count, + testSuite->count == 1 ? "test" : "tests", + testSuite->count - testSuite->failCount - + testSuite->notimplCount, + testSuite->failCount, testSuite->notimplCount); +} + +void CuSuiteDetails(CuSuite* testSuite, CuString* details) +{ + int i; + int failCount = 0; + int notImpleCount = 0; + int passCount = testSuite->count - testSuite->failCount; + char* testWord = passCount == 1 ? "test" : "tests"; + + if (testSuite->failCount != 0 && verbose) + { + CuStringAppendFormat(details, "Failed tests:\n"); + for (i = 0 ; i < testSuite->count ; ++i) + { + CuTest* testCase = testSuite->list[i]; + if (testCase->failed) + { + failCount++; + CuStringAppendFormat(details, "%d) %s: %s\n", + failCount, testCase->name, testCase->message); + } + } + } + if (testSuite->notimplCount != 0 && verbose) + { + CuStringAppendFormat(details, "\nNot Implemented tests:\n"); + for (i = 0 ; i < testSuite->count ; ++i) + { + CuTest* testCase = testSuite->list[i]; + if (testCase->notimpl) + { + failCount++; + CuStringAppendFormat(details, "%d) %s: %s\n", + failCount, testCase->name, testCase->message); + } + } + } +} + +/*-------------------------------------------------------------------------* + * CuSuiteList + *-------------------------------------------------------------------------*/ + +CuSuiteList* CuSuiteListNew(char *name) +{ + CuSuiteList* testSuite = CU_ALLOC(CuSuiteList); + testSuite->name = strdup(name); + testSuite->count = 0; + return testSuite; +} + +void CuSuiteListAdd(CuSuiteList *suites, CuSuite *origsuite) +{ + assert(suites->count < MAX_TEST_CASES); + suites->list[suites->count] = origsuite; + suites->count++; +} + +void CuSuiteListRun(CuSuiteList* testSuite) +{ + int i; + for (i = 0 ; i < testSuite->count ; ++i) + { + CuSuite* testCase = testSuite->list[i]; + CuSuiteRun(testCase); + } +} + +void CuSuiteListSummary(CuSuiteList* testSuite, CuString* summary) +{ + int i; + CuStringAppendFormat(summary, "%s:\n", testSuite->name); + for (i = 0 ; i < testSuite->count ; ++i) + { + CuSuite* testCase = testSuite->list[i]; + CuString *str = CuStringNew(); + CuSuiteSummary(testCase, str); + CuStringAppend(summary, " "); + CuStringAppend(summary, str->buffer); + } + CuStringAppend(summary, "\n"); +} + +void CuSuiteListDetails(CuSuiteList* testSuite, CuString* details) +{ + int i; + int failCount = 0; + int notImplCount = 0; + int passCount = 0; + int count = 0; + char *testWord = passCount == 1 ? "test" : "tests"; + + for (i = 0 ; i < testSuite->count ; ++i) + { + failCount += testSuite->list[i]->failCount; + notImplCount += testSuite->list[i]->notimplCount; + count += testSuite->list[i]->count; + } + CuStringAppendFormat(details, "%d %s run: %d passed, %d failed, " + "%d not implemented.\n", + count, + count == 1 ? "test" : "tests", + count - failCount - notImplCount, + failCount, notImplCount); + + if (failCount != 0 && verbose) + { + for (i = 0 ; i < testSuite->count ; ++i) + { + CuString *str = CuStringNew(); + CuSuite* testCase = testSuite->list[i]; + if (testCase->failCount) + { + CuSuiteDetails(testCase, str); + CuStringAppend(details, str->buffer); + } + } + } + if (notImplCount != 0 && verbose) + { + CuStringAppendFormat(details, "\nNot Implemented tests:\n"); + for (i = 0 ; i < testSuite->count ; ++i) + { + CuString *str = CuStringNew(); + CuSuite* testCase = testSuite->list[i]; + if (testCase->notimplCount) + { + CuSuiteDetails(testCase, str); + CuStringAppend(details, str->buffer); + } + } + } +} diff --git a/test/CuTest.h b/test/CuTest.h new file mode 100644 index 00000000000..66a585fc12c --- /dev/null +++ b/test/CuTest.h @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2002-2006 Asim Jalis + * + * This library is released under the zlib/libpng license as described at + * + * http://www.opensource.org/licenses/zlib-license.html + * + * Here is the statement of the license: + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in a + * product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + */ +/* + * This file has been modified from the original distribution. + */ + +#ifndef CU_TEST_H +#define CU_TEST_H + +#include +#include + +/* CuString */ + +char* CuStrAlloc(int size); +char* CuStrCopy(char* old); + +#define CU_ALLOC(TYPE) ((TYPE*) malloc(sizeof(TYPE))) + +#define HUGE_STRING_LEN 8192 +#define STRING_MAX 256 +#define STRING_INC 256 + +typedef struct +{ + int length; + int size; + char* buffer; +} CuString; + +void CuStringInit(CuString* str); +CuString* CuStringNew(void); +void CuStringRead(CuString* str, char* path); +void CuStringAppend(CuString* str, char* text); +void CuStringAppendChar(CuString* str, char ch); +void CuStringAppendFormat(CuString* str, char* format, ...); +void CuStringResize(CuString* str, int newSize); + +/* CuTest */ + +typedef struct CuTest CuTest; + +typedef void (*TestFunction)(CuTest *); + +struct CuTest +{ + char* name; + TestFunction function; + int notimpl; + int failed; + int ran; + char* message; + jmp_buf *jumpBuf; +}; + +void CuInit(int argc, char *argv[]); +void CuTestInit(CuTest* t, char* name, TestFunction function); +CuTest* CuTestNew(char* name, TestFunction function); +void CuFail(CuTest* tc, char* message); +void CuAssert(CuTest* tc, char* message, int condition); +void CuAssertTrue(CuTest* tc, int condition); +void CuAssertStrEquals(CuTest* tc, char* expected, char* actual); +void CuAssertIntEquals(CuTest* tc, int expected, int actual); +void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual); +void CuAssertPtrNotNull(CuTest* tc, void* pointer); +void CuTestRun(CuTest* tc); + +/* CuSuite */ + +#define MAX_TEST_CASES 1024 + +#define SUITE_ADD_TEST(SUITE,TEST) CuSuiteAdd(SUITE, CuTestNew(#TEST, TEST)) + +typedef struct +{ + char *name; + int count; + CuTest* list[MAX_TEST_CASES]; + int failCount; + int notimplCount; + +} CuSuite; + + +void CuSuiteInit(CuSuite* testSuite, char* name); +CuSuite* CuSuiteNew(char* name); +void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase); +void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2); +void CuSuiteRun(CuSuite* testSuite); +void CuSuiteSummary(CuSuite* testSuite, CuString* summary); +void CuSuiteOverView(CuSuite* testSuite, CuString* details); +void CuSuiteDetails(CuSuite* testSuite, CuString* details); + +typedef struct +{ + char *name; + int count; + CuSuite* list[MAX_TEST_CASES]; +} CuSuiteList; + + +CuSuiteList* CuSuiteListNew(char* name); +void CuSuiteListAdd(CuSuiteList* testSuite, CuSuite *testCase); +void CuSuiteListRun(CuSuiteList* testSuite); +void CuSuiteListSummary(CuSuiteList* testSuite, CuString* summary); +void CuSuiteListDetails(CuSuiteList* testSuite, CuString* details); +#endif /* CU_TEST_H */ diff --git a/test/Makefile.in b/test/Makefile.in index 2ad52775c0e..30500950ad4 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -44,7 +44,8 @@ PROGRAMS = \ testatomic@EXEEXT@ \ testpools@EXEEXT@ \ testmutexscope@EXEEXT@ \ - testtable@EXEEXT@ + testtable@EXEEXT@ \ + testall@EXEEXT@ TARGETS = $(PROGRAMS) $(NONPORTABLE) @@ -59,6 +60,8 @@ CLEAN_TARGETS = testfile.tmp testdso@EXEEXT@ mod_test.slo INCDIR=../include INCLUDES=-I$(INCDIR) +CFLAGS=$(MY_CFLAGS) + all: $(PROGRAMS) $(NONPORTABLE) check: $(PROGRAMS) $(NONPORTABLE) @@ -134,8 +137,8 @@ server@EXEEXT@: server.lo $(LOCAL_LIBS) sendfile@EXEEXT@: sendfile.lo $(LOCAL_LIBS) $(LINK) sendfile.lo $(LOCAL_LIBS) $(ALL_LIBS) -testtime@EXEEXT@: testtime.lo $(LOCAL_LIBS) - $(LINK) testtime.lo $(LOCAL_LIBS) $(ALL_LIBS) +testtime@EXEEXT@: testtime.lo CuTest.lo testapr.lo $(LOCAL_LIBS) + $(LINK) testtime.lo CuTest.lo testapr.lo $(LOCAL_LIBS) $(ALL_LIBS) testmmap@EXEEXT@: testmmap.lo $(LOCAL_LIBS) $(LINK) testmmap.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -164,8 +167,8 @@ testpoll@EXEEXT@: testpoll.lo $(LOCAL_LIBS) testhash@EXEEXT@: testhash.lo $(LOCAL_LIBS) $(LINK) testhash.lo $(LOCAL_LIBS) $(ALL_LIBS) -teststr@EXEEXT@: teststr.lo $(LOCAL_LIBS) - $(LINK) teststr.lo $(LOCAL_LIBS) $(ALL_LIBS) +teststr@EXEEXT@: teststr.lo CuTest.lo testapr.lo $(LOCAL_LIBS) + $(LINK) teststr.lo CuTest.lo testapr.lo $(LOCAL_LIBS) $(ALL_LIBS) testsockets@EXEEXT@: testsockets.lo $(LOCAL_LIBS) $(LINK) testsockets.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -206,4 +209,8 @@ testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) testtable@EXEEXT@: testtable.lo $(LOCAL_LIBS) $(LINK) testtable.lo $(LOCAL_LIBS) $(ALL_LIBS) +testall: testall.lo testtime.lo teststr.lo CuTest.lo $(LOCAL_LIBS) + $(LINK) testall.lo testtime.lo teststr.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) + + # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index 3cd81fde50b..b75757404e5 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -66,9 +66,22 @@ #ifndef APR_TEST_INCLUDES #define APR_TEST_INCLUDES +#include "CuTest.h" +#include "apr_pools.h" + +extern apr_pool_t *p; + +CuSuite *getsuite(void); + +CuSuite *teststr(void); +CuSuite *testtime(void); + + + #include "apr_strings.h" #include "apr_time.h" + #define TEST_EQ(str, func, value, good, bad) \ printf("%-60s", str); \ { \ diff --git a/test/testall.c b/test/testall.c new file mode 100644 index 00000000000..eee4b8cce7a --- /dev/null +++ b/test/testall.c @@ -0,0 +1,91 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "test_apr.h" + +#define NUM_TESTS 2 + +apr_pool_t *p; + +typedef CuSuite *(testfunc)(void); + +testfunc *tests[NUM_TESTS] = { + teststr, + testtime +}; + +int main(int argc, char *argv[]) +{ + CuSuiteList *alltests = CuSuiteListNew("All APR Tests"); + CuString *output = CuStringNew(); + int i; + + apr_initialize(); + atexit(apr_terminate); + + CuInit(argc, argv); + + apr_pool_create(&p, NULL); + + for (i = 0; i < NUM_TESTS; i++) { + CuSuiteListAdd(alltests, tests[i]()); + } + + CuSuiteListRun(alltests); + CuSuiteListSummary(alltests, output); + CuSuiteListDetails(alltests, output); + printf("%s\n", output->buffer); + +} + diff --git a/test/testapr.c b/test/testapr.c new file mode 100644 index 00000000000..1736e53a1f9 --- /dev/null +++ b/test/testapr.c @@ -0,0 +1,85 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "test_apr.h" + +apr_pool_t *p; + +int main(int argc, char *argv[]) +{ + CuSuite *suite; + CuString *output = CuStringNew(); + + apr_initialize(); + atexit(apr_terminate); + + CuInit(argc, argv); + + apr_pool_create(&p, NULL); + + suite = getsuite(); + + CuSuiteRun(suite); + CuSuiteSummary(suite, output); + CuStringAppend(output, "\n"); + CuSuiteOverView(suite, output); + printf("%s", output->buffer); + CuStringInit(output); + CuSuiteDetails(suite, output); + if (strcmp(output->buffer, "")) { + printf("%s\n", output->buffer); + } + return 0; +} + diff --git a/test/teststr.c b/test/teststr.c index c58656c8e7c..c06113492a5 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -52,6 +52,8 @@ * . */ +#include "test_apr.h" + #include #include #include @@ -60,13 +62,17 @@ #include "apr_general.h" #include "apr_strings.h" -static void test_strtok(apr_pool_t *p) +/* I haven't bothered to check for APR_ENOTIMPL here, AFAIK, all string + * functions exist on all platforms. + */ + +static void test_strtok(CuTest *tc) { struct { char *input; char *sep; } - tc[] = { + cases[] = { { "", "Z" @@ -96,23 +102,24 @@ static void test_strtok(apr_pool_t *p) }; int curtc; - for (curtc = 0; curtc < sizeof tc / sizeof tc[0]; curtc++) { + for (curtc = 0; curtc < sizeof cases / sizeof cases[0]; curtc++) { char *retval1, *retval2; char *str1, *str2; char *state; - str1 = apr_pstrdup(p, tc[curtc].input); - str2 = apr_pstrdup(p, tc[curtc].input); + str1 = apr_pstrdup(p, cases[curtc].input); + str2 = apr_pstrdup(p, cases[curtc].input); do { - retval1 = apr_strtok(str1, tc[curtc].sep, &state); - retval2 = strtok(str2, tc[curtc].sep); + retval1 = apr_strtok(str1, cases[curtc].sep, &state); + retval2 = strtok(str2, cases[curtc].sep); - if (!retval1) - assert(!retval2); + if (!retval1) { + CuAssertTrue(tc, retval2 == NULL); + } else { - assert(retval2); - assert(!strcmp(retval1, retval2)); + CuAssertTrue(tc, retval2 != NULL); + CuAssertStrEquals(tc, retval2, retval1); } str1 = str2 = NULL; /* make sure we pass NULL on subsequent calls */ @@ -120,7 +127,7 @@ static void test_strtok(apr_pool_t *p) } } -static void test_snprintf(apr_pool_t *p) +static void snprintf_noNULL(CuTest *tc) { char buff[100]; char *testing = apr_palloc(p, 10); @@ -134,43 +141,44 @@ static void test_snprintf(apr_pool_t *p) testing[5] = 'n'; testing[6] = 'g'; - fprintf(stderr, "Testing precision ........ "); + /* If this test fails, we are going to seg fault. */ apr_snprintf(buff, sizeof(buff), "%.*s", 7, testing); - /* If this test fails, we are going to seg fault, so there is no reason - * to print a failure message. rbb - */ - if (!strncmp(buff, testing, 7)) { - fprintf(stderr, "OK\n"); - } + CuAssertStrEquals(tc, buff, testing); +} + +static void snprintf_0NULL(CuTest *tc) +{ + int rv; - fprintf(stderr, "Testing 0 length with NULL .......... "); rv = apr_snprintf(NULL, 0, "%sBAR", "FOO"); - if (rv != 6) { - fprintf(stderr, "FAILED\n"); - } - fprintf(stderr, "OK\n"); + CuAssertIntEquals(tc, 6, rv); +} + +static void snprintf_0nonNULL(CuTest *tc) +{ + int rv; + char *buff = "testing"; - fprintf(stderr, "Testing 0 length with non-NULL .......... "); rv = apr_snprintf(buff, 0, "%sBAR", "FOO"); - if (rv != 6) { - fprintf(stderr, "FAILED (return val)\n"); - } - if (strcmp(buff, "FOOBAR") == 0) { - fprintf(stderr, "FAILED (mangled buff)\n"); - } - fprintf(stderr, "OK\n"); + CuAssertIntEquals(tc, 6, rv); + CuAssert(tc, "buff unmangled", strcmp(buff, "FOOBAR") != 0); } -int main(int argc, const char * const argv[]) +CuSuite *teststr(void) { - apr_pool_t *p; + CuSuite *suite = CuSuiteNew("Test Strings"); - apr_initialize(); - atexit(apr_terminate); - apr_pool_create(&p, NULL); + SUITE_ADD_TEST(suite, snprintf_0NULL); + SUITE_ADD_TEST(suite, snprintf_0nonNULL); + SUITE_ADD_TEST(suite, snprintf_noNULL); + SUITE_ADD_TEST(suite, test_strtok); - test_strtok(p); - test_snprintf(p); + return suite; +} - return 0; +#ifdef SINGLE_PROG +CuSuite *getsuite(void) +{ + return teststr(); } +#endif diff --git a/test/testtime.c b/test/testtime.c index a1ee2ce7b7f..2266890cf8d 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -57,12 +57,21 @@ #include "apr_general.h" #include "apr_lib.h" #include +#include #include #include "test_apr.h" #define STR_SIZE 45 -static const char* print_time (apr_pool_t *pool, const apr_time_exp_t *xt) +/* The time value is used throughout the tests, so just make this a global. + * Also, we need a single value that we can test for the positive tests, so + * I chose the number below, it corresponds to: + * 2002-08-14 12:05:36.186711 -25200 [257 Sat]. + * Which happens to be when I wrote the new tests. + */ +apr_time_t now = 1032030336186711; + +static char* print_time (apr_pool_t *pool, const apr_time_exp_t *xt) { return apr_psprintf (pool, "%04d-%02d-%02d %02d:%02d:%02d.%06d %+05d [%d %s]%s", @@ -79,145 +88,224 @@ static const char* print_time (apr_pool_t *pool, const apr_time_exp_t *xt) (xt->tm_isdst ? " DST" : "")); } -int main(void) + +static void test_now(CuTest *tc) { - apr_time_t now; - apr_time_exp_t xt, xt2; - apr_time_t imp; - apr_pool_t *p; - char *str, *str2; - apr_size_t sz; - apr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */ - apr_int64_t hr_off_64; + apr_time_t timediff; + apr_time_t current; + time_t os_now; - apr_initialize(); + current = apr_time_now(); + time(&os_now); - printf("APR Time Functions\n==================\n\n"); + timediff = os_now - (current / APR_USEC_PER_SEC); + /* Even though these are called so close together, there is the chance + * that the time will be slightly off, so accept anything between -1 and + * 1 second. + */ + CuAssert(tc, "apr_time and OS time do not agree", + (timediff > -1) && (timediff < 1)); +} - STD_TEST_NEQ("Creating a pool to use", apr_pool_create(&p, NULL)) +static void test_gmtstr(CuTest *tc) +{ + apr_status_t rv; + apr_time_exp_t xt; + time_t os_now; - printf("%-60s", " apr_time_now()"); - now = apr_time_now(); - printf("OK\n"); + rv = apr_time_exp_gmt(&xt, now); + os_now = now / APR_USEC_PER_SEC; + if (rv == APR_ENOTIMPL) { + CuNotImpl(tc, "apr_time_exp_gmt"); + } + CuAssertTrue(tc, rv == APR_SUCCESS); + CuAssertStrEquals(tc, "2002-08-14 19:05:36.186711 +0000 [257 Sat]", + print_time(p, &xt)); +} - STD_TEST_NEQ(" apr_time_exp_gmt", apr_time_exp_gmt(&xt, now)) - printf(" (%s)\n", print_time(p, &xt)); +static void test_localstr(CuTest *tc) +{ + apr_status_t rv; + apr_time_exp_t xt; + time_t os_now; - STD_TEST_NEQ(" apr_time_exp_lt", apr_time_exp_lt(&xt2, now)) - printf(" (%s)\n", print_time(p, &xt2)); + rv = apr_time_exp_lt(&xt, now); + os_now = now / APR_USEC_PER_SEC; + if (rv == APR_ENOTIMPL) { + CuNotImpl(tc, "apr_time_exp_lt"); + } + CuAssertTrue(tc, rv == APR_SUCCESS); + CuAssertStrEquals(tc, "2002-08-14 12:05:36.186711 -25200 [257 Sat] DST", + print_time(p, &xt)); +} - STD_TEST_NEQ(" apr_time_exp_get (GMT)", apr_time_exp_get(&imp, &xt)) +static void test_exp_get_gmt(CuTest *tc) +{ + apr_status_t rv; + apr_time_exp_t xt; + apr_time_t imp; + apr_int64_t hr_off_64; - printf("%-60s", " checking GMT explode == implode"); + rv = apr_time_exp_gmt(&xt, now); + CuAssertTrue(tc, rv == APR_SUCCESS); + rv = apr_time_exp_get(&imp, &xt); + if (rv == APR_ENOTIMPL) { + CuNotImpl(tc, "apr_time_exp_get"); + } + CuAssertTrue(tc, rv == APR_SUCCESS); + hr_off_64 = (apr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC; + CuAssertTrue(tc, now + hr_off_64 == imp); +} + +static void test_exp_get_lt(CuTest *tc) +{ + apr_status_t rv; + apr_time_exp_t xt; + apr_time_t imp; + apr_int64_t hr_off_64; + + rv = apr_time_exp_lt(&xt, now); + CuAssertTrue(tc, rv == APR_SUCCESS); + rv = apr_time_exp_get(&imp, &xt); + if (rv == APR_ENOTIMPL) { + CuNotImpl(tc, "apr_time_exp_get"); + } + CuAssertTrue(tc, rv == APR_SUCCESS); hr_off_64 = (apr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC; - if (imp != now + hr_off_64) { - printf("mismatch\n" - "\t\tapr_now() %" APR_INT64_T_FMT "\n" - "\t\tapr_implode() returned %" APR_INT64_T_FMT "\n" - "\t\terror delta was %" APR_TIME_T_FMT "\n" - "\t\tshould have been %" APR_INT64_T_FMT "\n", - now, imp, imp-now, hr_off_64); - exit(-1); + CuAssertTrue(tc, now + hr_off_64 == imp); +} + +static void test_imp_gmt(CuTest *tc) +{ + apr_status_t rv; + apr_time_exp_t xt; + apr_time_t imp; + + rv = apr_time_exp_gmt(&xt, now); + CuAssertTrue(tc, rv == APR_SUCCESS); + rv = apr_implode_gmt(&imp, &xt); + if (rv == APR_ENOTIMPL) { + CuNotImpl(tc, "apr_implode_gmt"); + } + CuAssertTrue(tc, rv == APR_SUCCESS); + CuAssertTrue(tc, now == imp); +} + +static void test_rfcstr(CuTest *tc) +{ + apr_status_t rv; + char str[STR_SIZE]; + + rv = apr_rfc822_date(str, now); + if (rv == APR_ENOTIMPL) { + CuNotImpl(tc, "apr_rfc822_date"); } - printf("OK\n"); - - STD_TEST_NEQ(" apr_time_exp_get (localtime)", - apr_time_exp_get(&imp, &xt2)) - - printf("%-60s", " checking localtime explode == implode"); - hr_off_64 = (apr_int64_t) xt2.tm_gmtoff * APR_USEC_PER_SEC; - if (imp != now + hr_off_64) { - printf("mismatch\n" - "\t\tapr_now() %" APR_INT64_T_FMT "\n" - "\t\tapr_implode() returned %" APR_INT64_T_FMT "\n" - "\t\terror delta was %" APR_TIME_T_FMT "\n" - "\t\tshould have been %" APR_INT64_T_FMT "\n", - now, imp, imp-now, hr_off_64); - exit(-1); + CuAssertTrue(tc, rv == APR_SUCCESS); + CuAssertStrEquals(tc, "Sat, 14 Sep 2002 19:05:36 GMT", str); +} + +static void test_ctime(CuTest *tc) +{ + apr_status_t rv; + char str[STR_SIZE]; + + rv = apr_ctime(str, now); + if (rv == APR_ENOTIMPL) { + CuNotImpl(tc, "apr_ctime"); } - printf("OK\n"); - - STD_TEST_NEQ(" apr_implode_gmt (GMT)", - apr_implode_gmt(&imp, &xt)) - - printf("%-60s", " checking GMT explode == GMT implode"); - if (imp != now) { - printf("mismatch\n" - "\t\tapr_now() %" APR_INT64_T_FMT "\n" - "\t\tapr_implode() returned %" APR_INT64_T_FMT "\n" - "\t\terror delta was %" APR_TIME_T_FMT "\n" - "\t\tshould have been 0\n", - now, imp, imp-now); - exit(-1); + CuAssertTrue(tc, rv == APR_SUCCESS); + CuAssertStrEquals(tc, "Sat Sep 14 12:05:36 2002", str); +} + +static void test_strftime(CuTest *tc) +{ + apr_status_t rv; + apr_time_exp_t xt; + char *str = NULL; + apr_size_t sz; + + rv = apr_time_exp_gmt(&xt, now); + str = apr_palloc(p, STR_SIZE + 1); + rv = apr_strftime(str, &sz, STR_SIZE, "%R %A %d %B %Y", &xt); + if (rv == APR_ENOTIMPL) { + CuNotImpl(tc, "apr_strftime"); } - printf("OK\n"); - - STD_TEST_NEQ(" apr_implode_gmt (localtime)", - apr_implode_gmt(&imp, &xt2)) - - printf("%-60s", " checking localtime explode == GMT implode"); - if (imp != now) { - printf("mismatch\n" - "\t\tapr_now() %" APR_INT64_T_FMT "\n" - "\t\tapr_implode() returned %" APR_INT64_T_FMT "\n" - "\t\terror delta was %" APR_TIME_T_FMT "\n" - "\t\tshould have been 0\n", - now, imp, imp-now); - exit(-1); + CuAssertTrue(tc, rv == APR_SUCCESS); + CuAssertStrEquals(tc, "19:05 Saturday 14 September 2002", str); +} + +static void test_strftimesmall(CuTest *tc) +{ + apr_status_t rv; + apr_time_exp_t xt; + char str[STR_SIZE]; + apr_size_t sz; + + rv = apr_time_exp_gmt(&xt, now); + rv = apr_strftime(str, &sz, STR_SIZE, "%T", &xt); + if (rv == APR_ENOTIMPL) { + CuNotImpl(tc, "apr_strftime"); } - printf("OK\n"); + CuAssertTrue(tc, rv == APR_SUCCESS); + CuAssertStrEquals(tc, "19:05:36", str); +} - str = apr_pcalloc(p, sizeof(char) * STR_SIZE); - str2 = apr_pcalloc(p, sizeof(char) * STR_SIZE); - imp = 0; +static void test_exp_tz(CuTest *tc) +{ + apr_status_t rv; + apr_time_exp_t xt; + char str[STR_SIZE]; + apr_size_t sz; + apr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */ - if (!str || !str2) { - printf("Failure!\n"); - fprintf(stderr,"Failed to allocate memory!\n"); - exit(-1); + rv = apr_time_exp_tz(&xt, now, hr_off); + if (rv == APR_ENOTIMPL) { + CuNotImpl(tc, "apr_time_exp_tz"); } + CuAssertTrue(tc, rv == APR_SUCCESS); + CuAssertStrEquals(tc, "19:05:36", str); +} + +static void test_strftimeoffset(CuTest *tc) +{ + apr_status_t rv; + apr_time_exp_t xt; + char str[STR_SIZE]; + apr_size_t sz; + apr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */ - STD_TEST_NEQ(" apr_rfc822_date", apr_rfc822_date(str, now)) - printf(" ( %s )\n", str); - - STD_TEST_NEQ(" apr_ctime (local time)", apr_ctime(str, now)) - printf(" ( %s )\n", str); - - STD_TEST_NEQ(" apr_strftime (GMT) (24H day date month year)", - apr_strftime(str, &sz, STR_SIZE, "%R %A %d %B %Y", &xt)) - printf(" ( %s )\n", str); - - STD_TEST_NEQ(" apr_strftime (GMT) (HH:MM:SS)", - apr_strftime(str, &sz, STR_SIZE, "%T", &xt)) - printf (" ( %s )\n", str); - - STD_TEST_NEQ(" apr_time_exp_tz (GMT -5 hours)", - apr_time_exp_tz(&xt2, now, hr_off)) - - STD_TEST_NEQ(" apr_strftime (offset) (HH:MM:SS)", - apr_strftime(str2, &sz, STR_SIZE, "%T", &xt2)) - printf(" ( %s )\n", str2); - - TEST_EQ(" Comparing the GMT and offset time strings", - strcmp(str, str2), 0, "OK", "Failed") - printf(" ( %s != %s )\n", str, str2); - - STD_TEST_NEQ(" apr_time_exp_get (offset)", - apr_time_exp_get(&imp, &xt2)) - - hr_off_64 = (apr_int64_t) hr_off * APR_USEC_PER_SEC; /* microseconds */ - printf("%-60s"," Checking offset is correct"); - if (imp != now + hr_off_64){ - printf("Failed! :(\n"); - printf("Difference is %" APR_INT64_T_FMT " (should be %" - APR_INT64_T_FMT")\n", imp - now, hr_off_64); - exit(-1); + apr_time_exp_tz(&xt, now, hr_off); + rv = apr_strftime(str, &sz, STR_SIZE, "%T", &xt); + if (rv == APR_ENOTIMPL) { + CuNotImpl(tc, "apr_strftime"); } - printf("OK\n"); - printf(" ( %" APR_TIME_T_FMT " - %" APR_TIME_T_FMT - " = %" APR_INT64_T_FMT " )\n", imp, now, imp - now); + CuAssertTrue(tc, rv == APR_SUCCESS); + CuAssertStrEquals(tc, "14:05:36", str); +} + +CuSuite *testtime(void) +{ + CuSuite *suite = CuSuiteNew("Test Time"); - printf("\nTest Complete.\n"); - return 0; -} + SUITE_ADD_TEST(suite, test_now); + SUITE_ADD_TEST(suite, test_gmtstr); + SUITE_ADD_TEST(suite, test_localstr); + SUITE_ADD_TEST(suite, test_exp_get_gmt); + SUITE_ADD_TEST(suite, test_exp_get_lt); + SUITE_ADD_TEST(suite, test_imp_gmt); + SUITE_ADD_TEST(suite, test_rfcstr); + SUITE_ADD_TEST(suite, test_ctime); + SUITE_ADD_TEST(suite, test_strftime); + SUITE_ADD_TEST(suite, test_strftimesmall); + SUITE_ADD_TEST(suite, test_exp_tz); + SUITE_ADD_TEST(suite, test_strftimeoffset); + return suite; +} + +#ifdef SINGLE_PROG +CuSuite *getsuite(void) +{ + return testtime(); +} +#endif From 98a6e2b35e1214d600795da565742ef40e77ef49 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 16 Sep 2002 01:53:08 +0000 Subject: [PATCH 3855/7878] Add a README describing how to use the test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63873 13f79535-47bb-0310-9956-ffa450edef68 --- test/README | 257 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100644 test/README diff --git a/test/README b/test/README new file mode 100644 index 00000000000..4cfcf95060a --- /dev/null +++ b/test/README @@ -0,0 +1,257 @@ +Writing APR tests + +All APR tests should be executable in 2 ways, as an individual program, or +as a part of the full test suite. The full test suite is controlled with +the testall program. At the beginning of the testall.c file, there is an +array of functions called tests. The testall program loops through this +array calling each function. Each function returns a CuSuite variable, which +is then added to the SuiteList. Once all Suites have been added, the SuiteList +is executed, and the output is printed to the screen. All functions in the +array should follow the same basic format: + +The Full Suite +-------------- + +/* The driver function. This must return a CuSuite variable, which will + * then be used to actually run the tests. Essentially, all Suites are a + * collection of tests. The driver will take each Suite, and put it in a + * SuiteList, which is a collection of Suites. + */ +CuSuite *testtime(void) +{ + /* The actual suite, this must be created for each test program. Please + * give it a useful name, that will inform the user of the feature being + * tested. + */ + CuSuite *suite = CuSuiteNew("Test Time"); + + /* Each function must be added to the suite. Each function represents + * a single test. It is possible to test multiple features in a single + * function, although no tests currently do that. + */ + SUITE_ADD_TEST(suite, test_now); + SUITE_ADD_TEST(suite, test_gmtstr); + SUITE_ADD_TEST(suite, test_localstr); + SUITE_ADD_TEST(suite, test_exp_get_gmt); + SUITE_ADD_TEST(suite, test_exp_get_lt); + SUITE_ADD_TEST(suite, test_imp_gmt); + SUITE_ADD_TEST(suite, test_rfcstr); + SUITE_ADD_TEST(suite, test_ctime); + SUITE_ADD_TEST(suite, test_strftime); + SUITE_ADD_TEST(suite, test_strftimesmall); + SUITE_ADD_TEST(suite, test_exp_tz); + SUITE_ADD_TEST(suite, test_strftimeoffset); + + /* You must return the suite so that the driver knows which suites to + * run. + */ + return suite; +} + +Building the full driver +------------------------ + +All you need to do to build the full driver is run: + + make testall + +To run it, run: + + ./testall + +Individual Program +------------------ + +The second way to run a test program is as an individual program. This is +done with another function, getsuite. This function should always look like: + +#ifdef SINGLE_PROG +CuSuite *getsuite(void) +{ + return testtime(); +} +#endif + +Notice that all this function does is return the suite that is generated +in the function used by the full driver. This is very important. + +Also, notice that this function is protected by "#ifdef SINGLE_PROG". All +test programs should include this function. The individual program will +call this function to get the suite, and then it will run the suite and +print the output. + +The reason that this function must be protected, is that all test programs +have this function, and when they are linked into the full driver, they +conflict with each other. I hope to fix this problem soon. + +Building individual test programs +--------------------------------- + +To build individual test programs, you must do the following (for example): + + MY_CFLAGS=-DSINGLE_PROGRAM make testtime + +To run the test, run: + + ./testtime + +Most people should just build the full test driver. + +Reading the test suite output +----------------------------- + +Once you run the test suite, you will get output like: + +All APR Tests: + Test Strings: .... + Test Time: ............ + +16 tests run: 16 passed, 0 failed, 0 not implemented. + +There are a couple of things to look at with this. First, if you look at the +first function in this document, you should notice that the string passed to +the CuSuiteNew function is in the output. That is why the string should +explain the feature you are testing. + +Second, this test passed completely. This is obvious in two ways. First, and +most obvious, the summary line tells you that 16 tests were run and 16 tests +passed. However, the results can also be found in the lines above. Every +'.' in the output represents a passed test. + +If a test fails, the output will look like: + +All APR Tests: + Test Strings: .... + Test Time: ..F......... + +16 tests run: 15 passed, 1 failed, 0 not implemented. + +This is not very useful, because you don't know which test failed. However, +once you know that a test failed, you can run the suite again, with the +-v option. If you do this, you will get something like: + +All APR Tests: + Test Strings: .... + Test Time: ..F......... + +16 tests run: 15 passed, 1 failed, 0 not implemented. +Failed tests: +1) test_localstr: assert failed + +In this case, we know the test_localstr function failed, and there is an +Assert in this that failed (I modified the test to fail for this document). +Now, you can look at what that test does, and why it would have failed. + +There is one other possible output for the test suite (run with -v): + +All APR Tests: + Test Strings: .... + Test Time: ..N......... + +16 tests run: 15 passed, 0 failed, 1 not implemented. + +Not Implemented tests: + +Not Implemented tests: +1) test_localstr: apr_time_exp_lt not implemented on this platform + +The 'N' means that a function has returned APR_ENOTIMPL. This should be +treated as an error, and the function should be implemented as soon as +possible. + +Adding New test Suites to the full driver +------------------------------------------- + +To add a new Suite to the full driver, you must make a couple of modifications. + +1) Edit test_apr.h, and add the prototype for the function. +2) Edit testall.c, and add the function to the tests array. +3) Increase the NUM_TESTS macro in testall.c +4) Edit Makefile.in, and add the .lo file to the testall target. + +Once those four things are done, your tests will automatically be added +to the suite. + +Writing tests +------------- + +There are a couple of rules for writing good tests for the test suite. + +1) All tests can determine for themselves if it passed or not. This means +that there is no reason for the person running the test suite to interpret +the results of the tests. +2) Never use printf to add to the output of the test suite. The suite +library should be able to print all of the information required to debug +a problem. +3) Functions should be tested with both positive and negative tests. This +means that you should test things that should both succeed and fail. + +An example test +--------------- + +Finally, we will look at a quick test: + +/* All tests are passed a CuTest variable. This is how the suite determines + * if the test succeeded or failed. + */ +static void test_localstr(CuTest *tc) +{ + apr_status_t rv; + apr_time_exp_t xt; + time_t os_now; + + rv = apr_time_exp_lt(&xt, now); + os_now = now / APR_USEC_PER_SEC; + + /* If the function can return APR_ENOTIMPL, then you should check for it. + * This allows platform implementors to know if they have to implement + * the function. + */ + if (rv == APR_ENOTIMPL) { + CuNotImpl(tc, "apr_time_exp_lt"); + } + + /* It often helps to ensure that the return code was APR_SUCESS. If it + * wasn't, then we know the test failed. + */ + CuAssertTrue(tc, rv == APR_SUCCESS); + + /* Now that we know APR thinks it worked properly, we need to check the + * output to ensure that we got what we expected. + */ + CuAssertStrEquals(tc, "2002-08-14 12:05:36.186711 -25200 [257 Sat] DST", + print_time(p, &xt)); +} + +Notice, the same test can fail for any of a number of reasons. The first +test to fail ends the test. + +CuTest +------ + +CuTest is an open source test suite written by Asim Jalis. It has been +released under the zlib/libpng license. That license can be found in the +CuTest.c and CuTest.h files. + +The version of CuTest that is included in the APR test suite has been modified +from the original distribution in the following ways: + +1) The original distribution does not have a -v flag, the details are always +printed. +2) The NotImplemented result does not exist. +3) SuiteLists do not exist. In the original distribution, you can add suites +to suites, but it just adds the tests in the first suite to the list of tests +in the original suite. The output wasn't as detailed as I wanted, so I created +SuiteLists. + +The first two modifications have been sent to the original author of CuTest, +but they have not been integrated into the base distribution. The SuiteList +changes will be sent to the original author soon. + +The modified version of CuTest is not currently in any CVS or Subversion +server. In time, it will be hosted at rkbloom.net. + +There are currently no docs for how to write tests, but the teststr and +testtime programs should give an idea of how it is done. In time, a document +should be written to define how tests are written. + From a8c2969969537418133f6b38fa367f395872a27c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 16 Sep 2002 11:06:08 +0000 Subject: [PATCH 3856/7878] just say no to carriage returns git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63874 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 877 +++++++++++++++++++++++++------------------------- test/CuTest.h | 265 +++++++-------- 2 files changed, 572 insertions(+), 570 deletions(-) diff --git a/test/CuTest.c b/test/CuTest.c index 26cafe1c25e..76c5be88dbd 100644 --- a/test/CuTest.c +++ b/test/CuTest.c @@ -1,438 +1,439 @@ -/* - * Copyright (c) 2002-2006 Asim Jalis - * - * This library is released under the zlib/libpng license as described at - * - * http://www.opensource.org/licenses/zlib-license.html - * - * Here is the statement of the license: - * - * This software is provided 'as-is', without any express or implied warranty. - * In no event will the authors be held liable for any damages arising from - * the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software in a - * product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source distribution. - */ -/* - * This file has been modified from the original distribution. - */ - -#include -#include -#include -#include -#include - -#include "CuTest.h" - -static int verbose = 0; - -void CuInit(int argc, char *argv[]) -{ - int c; - - c = getopt(argc, argv, "v"); - if (c == 'v') { - verbose = 1; - } -} - -/*-------------------------------------------------------------------------* - * CuStr - *-------------------------------------------------------------------------*/ - -char* CuStrAlloc(int size) -{ - char* new = (char*) malloc( sizeof(char) * (size) ); - return new; -} - -char* CuStrCopy(char* old) -{ - int len = strlen(old); - char* new = CuStrAlloc(len + 1); - strcpy(new, old); - return new; -} - -/*-------------------------------------------------------------------------* - * CuString - *-------------------------------------------------------------------------*/ - -void CuStringInit(CuString* str) -{ - str->length = 0; - str->size = STRING_MAX; - str->buffer = (char*) malloc(sizeof(char) * str->size); - str->buffer[0] = '\0'; -} - -CuString* CuStringNew(void) -{ - CuString* str = (CuString*) malloc(sizeof(CuString)); - str->length = 0; - str->size = STRING_MAX; - str->buffer = (char*) malloc(sizeof(char) * str->size); - str->buffer[0] = '\0'; - return str; -} - -void CuStringResize(CuString* str, int newSize) -{ - str->buffer = (char*) realloc(str->buffer, sizeof(char) * newSize); - str->size = newSize; -} - -void CuStringAppend(CuString* str, char* text) -{ - int length = strlen(text); - if (str->length + length + 1 >= str->size) - CuStringResize(str, str->length + length + 1 + STRING_INC); - str->length += length; - strcat(str->buffer, text); -} - -void CuStringAppendChar(CuString* str, char ch) -{ - char text[2]; - text[0] = ch; - text[1] = '\0'; - CuStringAppend(str, text); -} - -void CuStringAppendFormat(CuString* str, char* format, ...) -{ - va_list argp; - char buf[HUGE_STRING_LEN]; - va_start(argp, format); - vsprintf(buf, format, argp); - va_end(argp); - CuStringAppend(str, buf); -} - -void CuStringRead(CuString *str, char *path) -{ - path = strdup(str->buffer); -} - -/*-------------------------------------------------------------------------* - * CuTest - *-------------------------------------------------------------------------*/ - -void CuTestInit(CuTest* t, char* name, TestFunction function) -{ - t->name = CuStrCopy(name); - t->notimpl = 0; - t->failed = 0; - t->ran = 0; - t->message = NULL; - t->function = function; - t->jumpBuf = NULL; -} - -CuTest* CuTestNew(char* name, TestFunction function) -{ - CuTest* tc = CU_ALLOC(CuTest); - CuTestInit(tc, name, function); - return tc; -} - -void CuNotImpl(CuTest* tc, char* message) -{ - CuString* newstr = CuStringNew(); - CuStringAppend(newstr, message); - CuStringAppend(newstr, " not implemented on this platform"); - tc->notimpl = 1; - tc->message = CuStrCopy(newstr->buffer); - if (tc->jumpBuf != 0) longjmp(*(tc->jumpBuf), 0); -} - -void CuFail(CuTest* tc, char* message) -{ - tc->failed = 1; - tc->message = CuStrCopy(message); - if (tc->jumpBuf != 0) longjmp(*(tc->jumpBuf), 0); -} - -void CuAssert(CuTest* tc, char* message, int condition) -{ - if (condition) return; - CuFail(tc, message); -} - -void CuAssertTrue(CuTest* tc, int condition) -{ - if (condition) return; - CuFail(tc, "assert failed"); -} - -void CuAssertStrEquals(CuTest* tc, char* expected, char* actual) -{ - CuString* message; - if (strcmp(expected, actual) == 0) return; - message = CuStringNew(); - CuStringAppend(message, "expected\n---->\n"); - CuStringAppend(message, expected); - CuStringAppend(message, "\n<----\nbut saw\n---->\n"); - CuStringAppend(message, actual); - CuStringAppend(message, "\n<----\n"); - CuFail(tc, message->buffer); -} - -void CuAssertIntEquals(CuTest* tc, int expected, int actual) -{ - char buf[STRING_MAX]; - if (expected == actual) return; - sprintf(buf, "expected <%d> but was <%d>", expected, actual); - CuFail(tc, buf); -} - -void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual) -{ - char buf[STRING_MAX]; - if (expected == actual) return; - sprintf(buf, "expected pointer <0x%X> but was <0x%X>", expected, actual); - CuFail(tc, buf); -} - -void CuAssertPtrNotNull(CuTest* tc, void* pointer) -{ - char buf[STRING_MAX]; - if (pointer != NULL ) return; - sprintf(buf, "null pointer unexpected", pointer); - CuFail(tc, buf); -} - -void CuTestRun(CuTest* tc) -{ - jmp_buf buf; - tc->jumpBuf = &buf; - if (setjmp(buf) == 0) - { - tc->ran = 1; - (tc->function)(tc); - } - tc->jumpBuf = 0; -} - -/*-------------------------------------------------------------------------* - * CuSuite - *-------------------------------------------------------------------------*/ - -void CuSuiteInit(CuSuite* testSuite, char *name) -{ - testSuite->name = strdup(name); - testSuite->count = 0; - testSuite->failCount = 0; - testSuite->notimplCount = 0; -} - -CuSuite* CuSuiteNew(char *name) -{ - CuSuite* testSuite = CU_ALLOC(CuSuite); - CuSuiteInit(testSuite, name); - return testSuite; -} - -void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase) -{ - assert(testSuite->count < MAX_TEST_CASES); - testSuite->list[testSuite->count] = testCase; - testSuite->count++; -} - -void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2) -{ - int i; - for (i = 0 ; i < testSuite2->count ; ++i) - { - CuTest* testCase = testSuite2->list[i]; - CuSuiteAdd(testSuite, testCase); - } -} - -void CuSuiteRun(CuSuite* testSuite) -{ - int i; - for (i = 0 ; i < testSuite->count ; ++i) - { - CuTest* testCase = testSuite->list[i]; - CuTestRun(testCase); - if (testCase->failed) { testSuite->failCount += 1; } - if (testCase->notimpl) { testSuite->notimplCount += 1; } - } -} - -void CuSuiteSummary(CuSuite* testSuite, CuString* summary) -{ - int i; - CuStringAppendFormat(summary, "%s:\t", testSuite->name); - for (i = 0 ; i < testSuite->count ; ++i) - { - CuTest* testCase = testSuite->list[i]; - CuStringAppend(summary, testCase->failed ? "F" : - testCase->notimpl ? "N": "."); - } - CuStringAppend(summary, "\n"); -} - -void CuSuiteOverView(CuSuite* testSuite, CuString* details) -{ - int i; - int failCount = 0; - int notImpleCount = 0; - int passCount = testSuite->count - testSuite->failCount; - - CuStringAppendFormat(details, "%d %s run: %d passed, %d failed, " - "%d not implemented.\n", - testSuite->count, - testSuite->count == 1 ? "test" : "tests", - testSuite->count - testSuite->failCount - - testSuite->notimplCount, - testSuite->failCount, testSuite->notimplCount); -} - -void CuSuiteDetails(CuSuite* testSuite, CuString* details) -{ - int i; - int failCount = 0; - int notImpleCount = 0; - int passCount = testSuite->count - testSuite->failCount; - char* testWord = passCount == 1 ? "test" : "tests"; - - if (testSuite->failCount != 0 && verbose) - { - CuStringAppendFormat(details, "Failed tests:\n"); - for (i = 0 ; i < testSuite->count ; ++i) - { - CuTest* testCase = testSuite->list[i]; - if (testCase->failed) - { - failCount++; - CuStringAppendFormat(details, "%d) %s: %s\n", - failCount, testCase->name, testCase->message); - } - } - } - if (testSuite->notimplCount != 0 && verbose) - { - CuStringAppendFormat(details, "\nNot Implemented tests:\n"); - for (i = 0 ; i < testSuite->count ; ++i) - { - CuTest* testCase = testSuite->list[i]; - if (testCase->notimpl) - { - failCount++; - CuStringAppendFormat(details, "%d) %s: %s\n", - failCount, testCase->name, testCase->message); - } - } - } -} - -/*-------------------------------------------------------------------------* - * CuSuiteList - *-------------------------------------------------------------------------*/ - -CuSuiteList* CuSuiteListNew(char *name) -{ - CuSuiteList* testSuite = CU_ALLOC(CuSuiteList); - testSuite->name = strdup(name); - testSuite->count = 0; - return testSuite; -} - -void CuSuiteListAdd(CuSuiteList *suites, CuSuite *origsuite) -{ - assert(suites->count < MAX_TEST_CASES); - suites->list[suites->count] = origsuite; - suites->count++; -} - -void CuSuiteListRun(CuSuiteList* testSuite) -{ - int i; - for (i = 0 ; i < testSuite->count ; ++i) - { - CuSuite* testCase = testSuite->list[i]; - CuSuiteRun(testCase); - } -} - -void CuSuiteListSummary(CuSuiteList* testSuite, CuString* summary) -{ - int i; - CuStringAppendFormat(summary, "%s:\n", testSuite->name); - for (i = 0 ; i < testSuite->count ; ++i) - { - CuSuite* testCase = testSuite->list[i]; - CuString *str = CuStringNew(); - CuSuiteSummary(testCase, str); - CuStringAppend(summary, " "); - CuStringAppend(summary, str->buffer); - } - CuStringAppend(summary, "\n"); -} - -void CuSuiteListDetails(CuSuiteList* testSuite, CuString* details) -{ - int i; - int failCount = 0; - int notImplCount = 0; - int passCount = 0; - int count = 0; - char *testWord = passCount == 1 ? "test" : "tests"; - - for (i = 0 ; i < testSuite->count ; ++i) - { - failCount += testSuite->list[i]->failCount; - notImplCount += testSuite->list[i]->notimplCount; - count += testSuite->list[i]->count; - } - CuStringAppendFormat(details, "%d %s run: %d passed, %d failed, " - "%d not implemented.\n", - count, - count == 1 ? "test" : "tests", - count - failCount - notImplCount, - failCount, notImplCount); - - if (failCount != 0 && verbose) - { - for (i = 0 ; i < testSuite->count ; ++i) - { - CuString *str = CuStringNew(); - CuSuite* testCase = testSuite->list[i]; - if (testCase->failCount) - { - CuSuiteDetails(testCase, str); - CuStringAppend(details, str->buffer); - } - } - } - if (notImplCount != 0 && verbose) - { - CuStringAppendFormat(details, "\nNot Implemented tests:\n"); - for (i = 0 ; i < testSuite->count ; ++i) - { - CuString *str = CuStringNew(); - CuSuite* testCase = testSuite->list[i]; - if (testCase->notimplCount) - { - CuSuiteDetails(testCase, str); - CuStringAppend(details, str->buffer); - } - } - } -} +/* + * Copyright (c) 2002-2006 Asim Jalis + * + * This library is released under the zlib/libpng license as described at + * + * http://www.opensource.org/licenses/zlib-license.html + * + * Here is the statement of the license: + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in a + * product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + */ +/* + * This file has been modified from the original distribution. + */ + +#include +#include +#include +#include +#include + +#include "CuTest.h" + +static int verbose = 0; + +void CuInit(int argc, char *argv[]) +{ + int c; + + c = getopt(argc, argv, "v"); + if (c == 'v') { + verbose = 1; + } +} + +/*-------------------------------------------------------------------------* + * CuStr + *-------------------------------------------------------------------------*/ + +char* CuStrAlloc(int size) +{ + char* new = (char*) malloc( sizeof(char) * (size) ); + return new; +} + +char* CuStrCopy(char* old) +{ + int len = strlen(old); + char* new = CuStrAlloc(len + 1); + strcpy(new, old); + return new; +} + +/*-------------------------------------------------------------------------* + * CuString + *-------------------------------------------------------------------------*/ + +void CuStringInit(CuString* str) +{ + str->length = 0; + str->size = STRING_MAX; + str->buffer = (char*) malloc(sizeof(char) * str->size); + str->buffer[0] = '\0'; +} + +CuString* CuStringNew(void) +{ + CuString* str = (CuString*) malloc(sizeof(CuString)); + str->length = 0; + str->size = STRING_MAX; + str->buffer = (char*) malloc(sizeof(char) * str->size); + str->buffer[0] = '\0'; + return str; +} + +void CuStringResize(CuString* str, int newSize) +{ + str->buffer = (char*) realloc(str->buffer, sizeof(char) * newSize); + str->size = newSize; +} + +void CuStringAppend(CuString* str, char* text) +{ + int length = strlen(text); + if (str->length + length + 1 >= str->size) + CuStringResize(str, str->length + length + 1 + STRING_INC); + str->length += length; + strcat(str->buffer, text); +} + +void CuStringAppendChar(CuString* str, char ch) +{ + char text[2]; + text[0] = ch; + text[1] = '\0'; + CuStringAppend(str, text); +} + +void CuStringAppendFormat(CuString* str, char* format, ...) +{ + va_list argp; + char buf[HUGE_STRING_LEN]; + va_start(argp, format); + vsprintf(buf, format, argp); + va_end(argp); + CuStringAppend(str, buf); +} + +void CuStringRead(CuString *str, char *path) +{ + path = strdup(str->buffer); +} + +/*-------------------------------------------------------------------------* + * CuTest + *-------------------------------------------------------------------------*/ + +void CuTestInit(CuTest* t, char* name, TestFunction function) +{ + t->name = CuStrCopy(name); + t->notimpl = 0; + t->failed = 0; + t->ran = 0; + t->message = NULL; + t->function = function; + t->jumpBuf = NULL; +} + +CuTest* CuTestNew(char* name, TestFunction function) +{ + CuTest* tc = CU_ALLOC(CuTest); + CuTestInit(tc, name, function); + return tc; +} + +void CuNotImpl(CuTest* tc, char* message) +{ + CuString* newstr = CuStringNew(); + CuStringAppend(newstr, message); + CuStringAppend(newstr, " not implemented on this platform"); + tc->notimpl = 1; + tc->message = CuStrCopy(newstr->buffer); + if (tc->jumpBuf != 0) longjmp(*(tc->jumpBuf), 0); +} + +void CuFail(CuTest* tc, char* message) +{ + tc->failed = 1; + tc->message = CuStrCopy(message); + if (tc->jumpBuf != 0) longjmp(*(tc->jumpBuf), 0); +} + +void CuAssert(CuTest* tc, char* message, int condition) +{ + if (condition) return; + CuFail(tc, message); +} + +void CuAssertTrue(CuTest* tc, int condition) +{ + if (condition) return; + CuFail(tc, "assert failed"); +} + +void CuAssertStrEquals(CuTest* tc, char* expected, char* actual) +{ + CuString* message; + if (strcmp(expected, actual) == 0) return; + message = CuStringNew(); + CuStringAppend(message, "expected\n---->\n"); + CuStringAppend(message, expected); + CuStringAppend(message, "\n<----\nbut saw\n---->\n"); + CuStringAppend(message, actual); + CuStringAppend(message, "\n<----\n"); + CuFail(tc, message->buffer); +} + +void CuAssertIntEquals(CuTest* tc, int expected, int actual) +{ + char buf[STRING_MAX]; + if (expected == actual) return; + sprintf(buf, "expected <%d> but was <%d>", expected, actual); + CuFail(tc, buf); +} + +void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual) +{ + char buf[STRING_MAX]; + if (expected == actual) return; + sprintf(buf, "expected pointer <0x%X> but was <0x%X>", expected, actual); + CuFail(tc, buf); +} + +void CuAssertPtrNotNull(CuTest* tc, void* pointer) +{ + char buf[STRING_MAX]; + if (pointer != NULL ) return; + sprintf(buf, "null pointer unexpected", pointer); + CuFail(tc, buf); +} + +void CuTestRun(CuTest* tc) +{ + jmp_buf buf; + tc->jumpBuf = &buf; + if (setjmp(buf) == 0) + { + tc->ran = 1; + (tc->function)(tc); + } + tc->jumpBuf = 0; +} + +/*-------------------------------------------------------------------------* + * CuSuite + *-------------------------------------------------------------------------*/ + +void CuSuiteInit(CuSuite* testSuite, char *name) +{ + testSuite->name = strdup(name); + testSuite->count = 0; + testSuite->failCount = 0; + testSuite->notimplCount = 0; +} + +CuSuite* CuSuiteNew(char *name) +{ + CuSuite* testSuite = CU_ALLOC(CuSuite); + CuSuiteInit(testSuite, name); + return testSuite; +} + +void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase) +{ + assert(testSuite->count < MAX_TEST_CASES); + testSuite->list[testSuite->count] = testCase; + testSuite->count++; +} + +void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2) +{ + int i; + for (i = 0 ; i < testSuite2->count ; ++i) + { + CuTest* testCase = testSuite2->list[i]; + CuSuiteAdd(testSuite, testCase); + } +} + +void CuSuiteRun(CuSuite* testSuite) +{ + int i; + for (i = 0 ; i < testSuite->count ; ++i) + { + CuTest* testCase = testSuite->list[i]; + CuTestRun(testCase); + if (testCase->failed) { testSuite->failCount += 1; } + if (testCase->notimpl) { testSuite->notimplCount += 1; } + } +} + +void CuSuiteSummary(CuSuite* testSuite, CuString* summary) +{ + int i; + CuStringAppendFormat(summary, "%s:\t", testSuite->name); + for (i = 0 ; i < testSuite->count ; ++i) + { + CuTest* testCase = testSuite->list[i]; + CuStringAppend(summary, testCase->failed ? "F" : + testCase->notimpl ? "N": "."); + } + CuStringAppend(summary, "\n"); +} + +void CuSuiteOverView(CuSuite* testSuite, CuString* details) +{ + int i; + int failCount = 0; + int notImpleCount = 0; + int passCount = testSuite->count - testSuite->failCount; + + CuStringAppendFormat(details, "%d %s run: %d passed, %d failed, " + "%d not implemented.\n", + testSuite->count, + testSuite->count == 1 ? "test" : "tests", + testSuite->count - testSuite->failCount - + testSuite->notimplCount, + testSuite->failCount, testSuite->notimplCount); +} + +void CuSuiteDetails(CuSuite* testSuite, CuString* details) +{ + int i; + int failCount = 0; + int notImpleCount = 0; + int passCount = testSuite->count - testSuite->failCount; + char* testWord = passCount == 1 ? "test" : "tests"; + + if (testSuite->failCount != 0 && verbose) + { + CuStringAppendFormat(details, "Failed tests:\n"); + for (i = 0 ; i < testSuite->count ; ++i) + { + CuTest* testCase = testSuite->list[i]; + if (testCase->failed) + { + failCount++; + CuStringAppendFormat(details, "%d) %s: %s\n", + failCount, testCase->name, testCase->message); + } + } + } + if (testSuite->notimplCount != 0 && verbose) + { + CuStringAppendFormat(details, "\nNot Implemented tests:\n"); + for (i = 0 ; i < testSuite->count ; ++i) + { + CuTest* testCase = testSuite->list[i]; + if (testCase->notimpl) + { + failCount++; + CuStringAppendFormat(details, "%d) %s: %s\n", + failCount, testCase->name, testCase->message); + } + } + } +} + +/*-------------------------------------------------------------------------* + * CuSuiteList + *-------------------------------------------------------------------------*/ + +CuSuiteList* CuSuiteListNew(char *name) +{ + CuSuiteList* testSuite = CU_ALLOC(CuSuiteList); + testSuite->name = strdup(name); + testSuite->count = 0; + return testSuite; +} + +void CuSuiteListAdd(CuSuiteList *suites, CuSuite *origsuite) +{ + assert(suites->count < MAX_TEST_CASES); + suites->list[suites->count] = origsuite; + suites->count++; +} + +void CuSuiteListRun(CuSuiteList* testSuite) +{ + int i; + for (i = 0 ; i < testSuite->count ; ++i) + { + CuSuite* testCase = testSuite->list[i]; + CuSuiteRun(testCase); + } +} + +void CuSuiteListSummary(CuSuiteList* testSuite, CuString* summary) +{ + int i; + CuStringAppendFormat(summary, "%s:\n", testSuite->name); + for (i = 0 ; i < testSuite->count ; ++i) + { + CuSuite* testCase = testSuite->list[i]; + CuString *str = CuStringNew(); + CuSuiteSummary(testCase, str); + CuStringAppend(summary, " "); + CuStringAppend(summary, str->buffer); + } + CuStringAppend(summary, "\n"); +} + +void CuSuiteListDetails(CuSuiteList* testSuite, CuString* details) +{ + int i; + int failCount = 0; + int notImplCount = 0; + int passCount = 0; + int count = 0; + char *testWord = passCount == 1 ? "test" : "tests"; + + for (i = 0 ; i < testSuite->count ; ++i) + { + failCount += testSuite->list[i]->failCount; + notImplCount += testSuite->list[i]->notimplCount; + count += testSuite->list[i]->count; + } + CuStringAppendFormat(details, "%d %s run: %d passed, %d failed, " + "%d not implemented.\n", + count, + count == 1 ? "test" : "tests", + count - failCount - notImplCount, + failCount, notImplCount); + + if (failCount != 0 && verbose) + { + for (i = 0 ; i < testSuite->count ; ++i) + { + CuString *str = CuStringNew(); + CuSuite* testCase = testSuite->list[i]; + if (testCase->failCount) + { + CuSuiteDetails(testCase, str); + CuStringAppend(details, str->buffer); + } + } + } + if (notImplCount != 0 && verbose) + { + CuStringAppendFormat(details, "\nNot Implemented tests:\n"); + for (i = 0 ; i < testSuite->count ; ++i) + { + CuString *str = CuStringNew(); + CuSuite* testCase = testSuite->list[i]; + if (testCase->notimplCount) + { + CuSuiteDetails(testCase, str); + CuStringAppend(details, str->buffer); + } + } + } +} + diff --git a/test/CuTest.h b/test/CuTest.h index 66a585fc12c..448c116ea33 100644 --- a/test/CuTest.h +++ b/test/CuTest.h @@ -1,132 +1,133 @@ -/* - * Copyright (c) 2002-2006 Asim Jalis - * - * This library is released under the zlib/libpng license as described at - * - * http://www.opensource.org/licenses/zlib-license.html - * - * Here is the statement of the license: - * - * This software is provided 'as-is', without any express or implied warranty. - * In no event will the authors be held liable for any damages arising from - * the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software in a - * product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source distribution. - */ -/* - * This file has been modified from the original distribution. - */ - -#ifndef CU_TEST_H -#define CU_TEST_H - -#include -#include - -/* CuString */ - -char* CuStrAlloc(int size); -char* CuStrCopy(char* old); - -#define CU_ALLOC(TYPE) ((TYPE*) malloc(sizeof(TYPE))) - -#define HUGE_STRING_LEN 8192 -#define STRING_MAX 256 -#define STRING_INC 256 - -typedef struct -{ - int length; - int size; - char* buffer; -} CuString; - -void CuStringInit(CuString* str); -CuString* CuStringNew(void); -void CuStringRead(CuString* str, char* path); -void CuStringAppend(CuString* str, char* text); -void CuStringAppendChar(CuString* str, char ch); -void CuStringAppendFormat(CuString* str, char* format, ...); -void CuStringResize(CuString* str, int newSize); - -/* CuTest */ - -typedef struct CuTest CuTest; - -typedef void (*TestFunction)(CuTest *); - -struct CuTest -{ - char* name; - TestFunction function; - int notimpl; - int failed; - int ran; - char* message; - jmp_buf *jumpBuf; -}; - -void CuInit(int argc, char *argv[]); -void CuTestInit(CuTest* t, char* name, TestFunction function); -CuTest* CuTestNew(char* name, TestFunction function); -void CuFail(CuTest* tc, char* message); -void CuAssert(CuTest* tc, char* message, int condition); -void CuAssertTrue(CuTest* tc, int condition); -void CuAssertStrEquals(CuTest* tc, char* expected, char* actual); -void CuAssertIntEquals(CuTest* tc, int expected, int actual); -void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual); -void CuAssertPtrNotNull(CuTest* tc, void* pointer); -void CuTestRun(CuTest* tc); - -/* CuSuite */ - -#define MAX_TEST_CASES 1024 - -#define SUITE_ADD_TEST(SUITE,TEST) CuSuiteAdd(SUITE, CuTestNew(#TEST, TEST)) - -typedef struct -{ - char *name; - int count; - CuTest* list[MAX_TEST_CASES]; - int failCount; - int notimplCount; - -} CuSuite; - - -void CuSuiteInit(CuSuite* testSuite, char* name); -CuSuite* CuSuiteNew(char* name); -void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase); -void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2); -void CuSuiteRun(CuSuite* testSuite); -void CuSuiteSummary(CuSuite* testSuite, CuString* summary); -void CuSuiteOverView(CuSuite* testSuite, CuString* details); -void CuSuiteDetails(CuSuite* testSuite, CuString* details); - -typedef struct -{ - char *name; - int count; - CuSuite* list[MAX_TEST_CASES]; -} CuSuiteList; - - -CuSuiteList* CuSuiteListNew(char* name); -void CuSuiteListAdd(CuSuiteList* testSuite, CuSuite *testCase); -void CuSuiteListRun(CuSuiteList* testSuite); -void CuSuiteListSummary(CuSuiteList* testSuite, CuString* summary); -void CuSuiteListDetails(CuSuiteList* testSuite, CuString* details); -#endif /* CU_TEST_H */ +/* + * Copyright (c) 2002-2006 Asim Jalis + * + * This library is released under the zlib/libpng license as described at + * + * http://www.opensource.org/licenses/zlib-license.html + * + * Here is the statement of the license: + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in a + * product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + */ +/* + * This file has been modified from the original distribution. + */ + +#ifndef CU_TEST_H +#define CU_TEST_H + +#include +#include + +/* CuString */ + +char* CuStrAlloc(int size); +char* CuStrCopy(char* old); + +#define CU_ALLOC(TYPE) ((TYPE*) malloc(sizeof(TYPE))) + +#define HUGE_STRING_LEN 8192 +#define STRING_MAX 256 +#define STRING_INC 256 + +typedef struct +{ + int length; + int size; + char* buffer; +} CuString; + +void CuStringInit(CuString* str); +CuString* CuStringNew(void); +void CuStringRead(CuString* str, char* path); +void CuStringAppend(CuString* str, char* text); +void CuStringAppendChar(CuString* str, char ch); +void CuStringAppendFormat(CuString* str, char* format, ...); +void CuStringResize(CuString* str, int newSize); + +/* CuTest */ + +typedef struct CuTest CuTest; + +typedef void (*TestFunction)(CuTest *); + +struct CuTest +{ + char* name; + TestFunction function; + int notimpl; + int failed; + int ran; + char* message; + jmp_buf *jumpBuf; +}; + +void CuInit(int argc, char *argv[]); +void CuTestInit(CuTest* t, char* name, TestFunction function); +CuTest* CuTestNew(char* name, TestFunction function); +void CuFail(CuTest* tc, char* message); +void CuAssert(CuTest* tc, char* message, int condition); +void CuAssertTrue(CuTest* tc, int condition); +void CuAssertStrEquals(CuTest* tc, char* expected, char* actual); +void CuAssertIntEquals(CuTest* tc, int expected, int actual); +void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual); +void CuAssertPtrNotNull(CuTest* tc, void* pointer); +void CuTestRun(CuTest* tc); + +/* CuSuite */ + +#define MAX_TEST_CASES 1024 + +#define SUITE_ADD_TEST(SUITE,TEST) CuSuiteAdd(SUITE, CuTestNew(#TEST, TEST)) + +typedef struct +{ + char *name; + int count; + CuTest* list[MAX_TEST_CASES]; + int failCount; + int notimplCount; + +} CuSuite; + + +void CuSuiteInit(CuSuite* testSuite, char* name); +CuSuite* CuSuiteNew(char* name); +void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase); +void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2); +void CuSuiteRun(CuSuite* testSuite); +void CuSuiteSummary(CuSuite* testSuite, CuString* summary); +void CuSuiteOverView(CuSuite* testSuite, CuString* details); +void CuSuiteDetails(CuSuite* testSuite, CuString* details); + +typedef struct +{ + char *name; + int count; + CuSuite* list[MAX_TEST_CASES]; +} CuSuiteList; + + +CuSuiteList* CuSuiteListNew(char* name); +void CuSuiteListAdd(CuSuiteList* testSuite, CuSuite *testCase); +void CuSuiteListRun(CuSuiteList* testSuite); +void CuSuiteListSummary(CuSuiteList* testSuite, CuString* summary); +void CuSuiteListDetails(CuSuiteList* testSuite, CuString* details); +#endif /* CU_TEST_H */ + From 22f6fff4bf893bbc755d66c51b1af2a5d73fb86a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 16 Sep 2002 11:06:41 +0000 Subject: [PATCH 3857/7878] axe an unused variable git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63875 13f79535-47bb-0310-9956-ffa450edef68 --- test/teststr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/test/teststr.c b/test/teststr.c index c06113492a5..31a60be2aca 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -131,7 +131,6 @@ static void snprintf_noNULL(CuTest *tc) { char buff[100]; char *testing = apr_palloc(p, 10); - int rv; testing[0] = 't'; testing[1] = 'e'; From f1dfd91dcea32d693b84c05cf68a79f8ef247b99 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 16 Sep 2002 11:08:46 +0000 Subject: [PATCH 3858/7878] get rid of warnings (missing function prototypes, missing return value from main()) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63876 13f79535-47bb-0310-9956-ffa450edef68 --- test/testall.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/testall.c b/test/testall.c index eee4b8cce7a..b3e5818bf71 100644 --- a/test/testall.c +++ b/test/testall.c @@ -52,6 +52,9 @@ * . */ +#include +#include + #include "test_apr.h" #define NUM_TESTS 2 @@ -86,6 +89,6 @@ int main(int argc, char *argv[]) CuSuiteListSummary(alltests, output); CuSuiteListDetails(alltests, output); printf("%s\n", output->buffer); - + return 0; } From d984b3f4576d2d8e118d76a49c4f08b1f70861d0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 17 Sep 2002 14:13:21 +0000 Subject: [PATCH 3859/7878] fix a typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63877 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 24659f00a72..ecfaed08fd0 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -1100,7 +1100,7 @@ static void overlap_hash(overlap_key *elt, if (flags == APR_OVERLAP_TABLES_MERGE) { /* Just link this node at the end of the list * of values for the key. It doesn't need to - * be linked into the tree, becaue the node at + * be linked into the tree, because the node at * the head of this key's value list is in the * tree already. */ From 009082b646f499072a5c9312ac9484b71461f0e0 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 19 Sep 2002 05:31:40 +0000 Subject: [PATCH 3860/7878] Add --bindir option to apr-config so that users of APR have an idea where apr-config will end up so that they can do later queries after apr-config is installed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63878 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ apr-config.in | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index de70d7d9f8d..40629bab977 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR 0.9.2 + *) Add --bindir option to apr-config. [Justin Erenkrantz] + *) Begin to rehash the test suite. There is now a new test program called testall. This program currently runs testtime and teststr with the CuTest framework. The stand-alone programs for testtime and teststr diff --git a/apr-config.in b/apr-config.in index 62992e96149..e2f879b215c 100644 --- a/apr-config.in +++ b/apr-config.in @@ -87,6 +87,7 @@ Usage: apr-config [OPTION] Known values for OPTION are: --prefix[=DIR] change prefix to DIR + --bindir print location where binaries are installed --cflags print C compiler flags --cppflags print cpp flags --includes print include information @@ -157,6 +158,10 @@ while test $# -gt 0; do echo $prefix exit 0 ;; + --bindir) + echo $bindir + exit 0 + ;; --cflags) flags="$flags $CFLAGS" ;; From 5d6ffb45babb39c10da031136c0d78a0d5143097 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 20 Sep 2002 10:42:37 +0000 Subject: [PATCH 3861/7878] include on any system that has it, not just on Tru64 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63879 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + poll/unix/poll.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 08b88bf4147..7e1b898f5b8 100644 --- a/configure.in +++ b/configure.in @@ -898,6 +898,7 @@ dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC APR_FLAG_HEADERS( + alloca.h \ ByteOrder.h \ conio.h \ crypt.h \ diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 9a31ecaa1ec..a5a0965a74f 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -64,8 +64,7 @@ #if HAVE_SYS_POLL_H #include #endif -#if HAVE_ALLOCA && defined(__osf__) -/* Tru64 UNIX requires this for proper alloca operation in threaded programs */ +#if HAVE_ALLOCA_H #include #endif From 933d5988bf113382c77d60193765d4f68c10472b Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 22 Sep 2002 03:47:01 +0000 Subject: [PATCH 3862/7878] Test all of the atomic math operations in the multithreaded phase of the tests git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63880 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/testatomic.c b/test/testatomic.c index 84e82fb23ea..cbd36344d77 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -213,7 +213,10 @@ void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data) apr_thread_once(control, init_func); for (i = 0; i < NUM_ITERATIONS ; i++) { - apr_atomic_inc( &y ); + apr_atomic_inc(&y); + apr_atomic_add(&y, 2); + apr_atomic_dec(&y); + apr_atomic_dec(&y); } apr_thread_exit(thd, exit_ret_val); return NULL; From 99cf1949e7ba447b5d4148cd10cbd7d5fc8d7fbd Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 22 Sep 2002 04:17:02 +0000 Subject: [PATCH 3863/7878] Inline, mutex-free implementations of the rest of the atomic functions for Linux/x86. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63881 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_atomic.h | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/CHANGES b/CHANGES index 40629bab977..4aea14f09ed 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR 0.9.2 + *) Faster (inline and mutex-free) implementations of all apr_atomic + operations for Linux/x86 (requires a 486 or later; to enable, + configure APR with --enable-nonportable-atomics=yes ) [Brian Pane] + *) Add --bindir option to apr-config. [Justin Erenkrantz] *) Begin to rehash the test suite. There is now a new test program called diff --git a/include/apr_atomic.h b/include/apr_atomic.h index bddbd25795c..9a3eb43c3d3 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -191,6 +191,31 @@ APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); : "memory"); \ prev;}) +#define apr_atomic_add(mem, val) \ +({ register apr_atomic_t last; \ + do { \ + last = *(mem); \ + } while (apr_atomic_cas((mem), last + (val), last) != last); \ + }) + +#define apr_atomic_dec(mem) \ +({ register apr_atomic_t last; \ + do { \ + last = *(mem); \ + } while (apr_atomic_cas((mem), last - 1, last) != last); \ + (--last != 0); }) + +#define apr_atomic_inc(mem) \ +({ register apr_atomic_t last; \ + do { \ + last = *(mem); \ + } while (apr_atomic_cas((mem), last + 1, last) != last); \ + }) + +#define apr_atomic_set(mem, val) (*(mem) = val) +#define apr_atomic_read(mem) (*(mem)) +#define apr_atomic_init(pool) APR_SUCCESS + #elif (defined(__sparc__) || defined(sparc)) && !APR_FORCE_ATOMIC_GENERIC #define apr_atomic_t apr_uint32_t From d325723e3e0ec02afe1eb1c61ca72c444c777a74 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 22 Sep 2002 19:26:41 +0000 Subject: [PATCH 3864/7878] Added support for SCO OpenServer 5 Submitted by: Kean Johnston Reviewed by: Brian Pane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63882 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ build/apr_hints.m4 | 6 +++--- configure.in | 10 ++++++---- file_io/unix/filestat.c | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 4aea14f09ed..e3b897d6463 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR 0.9.2 + *) Support for SCO OpenServer Release 5 [Kean Johnston ] + *) Faster (inline and mutex-free) implementations of all apr_atomic operations for Linux/x86 (requires a 486 or later; to enable, configure APR with --enable-nonportable-atomics=yes ) [Brian Pane] diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index cf9601d87b8..905f810aa66 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -173,14 +173,14 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(LDFLAGS, [-posix]) APR_ADDTO(LIBS, [-linet]) ;; - *-sco3*) + *-sco3.2v[234]*) APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT]) APR_ADDTO(CFLAGS, [-Oacgiltz]) APR_ADDTO(LIBS, [-lPW -lmalloc _i]) ;; - *-sco5*) + *-sco3.2v5*) APR_ADDTO(CPPFLAGS, [-DSCO5 -D_REENTRANT]) - APR_ADDTO(LIBS, [-lmalloc -lprot -ltinfo -lx]) + APR_ADDTO(LIBS, [-lprot]) ;; *-sco_sv*|*-SCO_SV*) APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT]) diff --git a/configure.in b/configure.in index 7e1b898f5b8..a60636862aa 100644 --- a/configure.in +++ b/configure.in @@ -1173,7 +1173,9 @@ fi APR_CHECK_SIZEOF_EXTENDED([#include ], pid_t, 8) -if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_int"; then +if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_short"; then + pid_t_fmt='#define APR_PID_T_FMT "hd"' +elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_int"; then pid_t_fmt='#define APR_PID_T_FMT "d"' elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long"; then pid_t_fmt='#define APR_PID_T_FMT "ld"' @@ -1265,11 +1267,11 @@ AC_ARG_ENABLE(dso, [ AC_CHECK_FUNCS(NSLinkModule, [ tempdso="dyld" ], [ tempdso="no" ]) if test "$tempdso" = "no"; then - AC_CHECK_LIB(dl, dlopen, [ tempdso="dlfcn" APR_ADDTO(LIBS,-ldl) ], - tempdso="no") + AC_CHECK_FUNCS(dlopen, [ tempdso="dlfcn" ], [ tempdso="no" ]) fi if test "$tempdso" = "no"; then - AC_CHECK_FUNCS(dlopen, [ tempdso="dlfcn" ], [ tempdso="no" ]) + AC_CHECK_LIB(dl, dlopen, [ tempdso="dlfcn" APR_ADDTO(LIBS,-ldl) ], + tempdso="no") fi if test "$tempdso" = "no"; then AC_CHECK_LIB(root, load_image, tempdso="yes", tempdso="no") diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 1ca88bbb9ef..7c82b4b37b4 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -74,7 +74,7 @@ static apr_filetype_e filetype_from_mode(mode_t mode) type = APR_PIPE; if (S_ISLNK(mode)) type = APR_LNK; -#ifndef BEOS +#if !defined(BEOS) && defined(S_ISSOCK) if (S_ISSOCK(mode)) type = APR_SOCK; #endif From 71551dab37e94e4ead3f3c4144e390bbf8dc7355 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 22 Sep 2002 22:26:23 +0000 Subject: [PATCH 3865/7878] Add more information about writing valid tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63883 13f79535-47bb-0310-9956-ffa450edef68 --- test/README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/README b/test/README index 4cfcf95060a..e0a3ad11011 100644 --- a/test/README +++ b/test/README @@ -185,6 +185,8 @@ library should be able to print all of the information required to debug a problem. 3) Functions should be tested with both positive and negative tests. This means that you should test things that should both succeed and fail. +4) Just checking the return code does _NOT_ make a useful test. You must +check to determine that the test actually did what you expected it to do. An example test --------------- From 1c9f1569f4301b39bec4d63d8d555510733fa66d Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 26 Sep 2002 13:05:39 +0000 Subject: [PATCH 3866/7878] OS/2: Implement apr_pollset_*() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63884 13f79535-47bb-0310-9956-ffa450edef68 --- poll/os2/pollset.c | 164 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 159 insertions(+), 5 deletions(-) diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c index bd6e30dd491..a9c5cf1ba0f 100644 --- a/poll/os2/pollset.c +++ b/poll/os2/pollset.c @@ -60,21 +60,43 @@ struct apr_pollset_t { apr_pool_t *pool; + apr_uint32_t nelts; + apr_uint32_t nalloc; + int *pollset; + int num_read; + int num_write; + int num_except; + int num_total; + apr_pollfd_t *query_set; + apr_pollfd_t *result_set; }; + + APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags) { - return APR_ENOTIMPL; + *pollset = apr_palloc(p, sizeof(**pollset)); + (*pollset)->pool = p; + (*pollset)->nelts = 0; + (*pollset)->nalloc = size; + (*pollset)->pollset = apr_palloc(p, size * sizeof(int) * 3); + (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + (*pollset)->num_read = -1; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) { - return APR_ENOTIMPL; + /* A no-op function for now. If we later implement /dev/poll + * support, we'll need to close the /dev/poll fd here + */ + return APR_SUCCESS; } @@ -82,7 +104,19 @@ APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { - return APR_ENOTIMPL; + if (pollset->nelts == pollset->nalloc) { + return APR_ENOMEM; + } + + pollset->query_set[pollset->nelts] = *descriptor; + + if (descriptor->desc_type != APR_POLL_SOCKET) { + return APR_EBADF; + } + + pollset->nelts++; + pollset->num_read = -1; + return APR_SUCCESS; } @@ -90,7 +124,67 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { - return APR_ENOTIMPL; + apr_uint32_t i; + + for (i = 0; i < pollset->nelts; i++) { + if (descriptor->desc.s == pollset->query_set[i].desc.s) { + /* Found an instance of the fd: remove this and any other copies */ + apr_uint32_t dst = i; + apr_uint32_t old_nelts = pollset->nelts; + pollset->nelts--; + + for (i++; i < old_nelts; i++) { + if (descriptor->desc.s == pollset->query_set[i].desc.s) { + pollset->nelts--; + } + else { + pollset->pollset[dst] = pollset->pollset[i]; + pollset->query_set[dst] = pollset->query_set[i]; + dst++; + } + } + + pollset->num_read = -1; + return APR_SUCCESS; + } + } + + return APR_NOTFOUND; +} + + + +static void make_pollset(apr_pollset_t *pollset) +{ + int i; + int pos = 0; + + pollset->num_read = 0; + pollset->num_write = 0; + pollset->num_except = 0; + + for (i = 0; i < pollset->nelts; i++) { + if (pollset->query_set[i].reqevents & APR_POLLIN) { + pollset->pollset[pos++] = pollset->query_set[i].desc.s->socketdes; + pollset->num_read++; + } + } + + for (i = 0; i < pollset->nelts; i++) { + if (pollset->query_set[i].reqevents & APR_POLLOUT) { + pollset->pollset[pos++] = pollset->query_set[i].desc.s->socketdes; + pollset->num_write++; + } + } + + for (i = 0; i < pollset->nelts; i++) { + if (pollset->query_set[i].reqevents & APR_POLLPRI) { + pollset->pollset[pos++] = pollset->query_set[i].desc.s->socketdes; + pollset->num_except++; + } + } + + pollset->num_total = pollset->num_read + pollset->num_write + pollset->num_except; } @@ -100,5 +194,65 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_int32_t *num, const apr_pollfd_t **descriptors) { - return APR_ENOTIMPL; + int rv; + apr_uint32_t i; + int *pollresult; + int read_pos, write_pos, except_pos; + + if (pollset->num_read < 0) { + make_pollset(pollset); + } + + pollresult = alloca(sizeof(int) * pollset->num_total); + memcpy(pollresult, pollset->pollset, sizeof(int) * pollset->num_total); + + if (timeout > 0) { + timeout /= 1000; + } + + rv = select(pollresult, pollset->num_read, pollset->num_write, pollset->num_except, timeout); + + if (rv < 0) { + return APR_FROM_OS_ERROR(sock_errno()); + } + + if (rv == 0) { + return APR_TIMEUP; + } + + read_pos = 0; + write_pos = pollset->num_read; + except_pos = pollset->num_read + pollset->num_write; + (*num) = 0; + + for (i = 0; i < pollset->nelts; i++) { + int rtnevents = 0; + + if (pollset->query_set[i].reqevents & APR_POLLIN) { + if (pollresult[read_pos++] != -1) { + rtnevents |= APR_POLLIN; + } + } + + if (pollset->query_set[i].reqevents & APR_POLLOUT) { + if (pollresult[write_pos++] != -1) { + rtnevents |= APR_POLLOUT; + } + } + + if (pollset->query_set[i].reqevents & APR_POLLPRI) { + if (pollresult[except_pos++] != -1) { + rtnevents |= APR_POLLPRI; + } + } + + if (rtnevents) { + pollset->result_set[*num] = pollset->query_set[i]; + pollset->result_set[*num].rtnevents = rtnevents; + (*num)++; + } + } + + *descriptors = pollset->result_set; + return APR_SUCCESS; } From eb82ab49ce6d3d6393446986a0edbbcf0485d0fd Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Thu, 26 Sep 2002 17:51:54 +0000 Subject: [PATCH 3867/7878] Delete some invalid comments from the apr_pollset_destroy doc. Submitted by: Garrett Rooney git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63885 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index fbb3060d264..8ba499e9425 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -242,10 +242,6 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, /** * Destroy a pollset object * @param pollset The pollset to destroy - * @param descriptors An initial set of descriptors to add to the pollset - * (may be NULL) - * @param num The number of elements in the descriptors array - * @param p The pool from which to allocate the pollset */ APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset); From ef1342d3963e71d830128cfcd4c245e164087103 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 26 Sep 2002 20:16:27 +0000 Subject: [PATCH 3868/7878] Clean up addition IPV6 build issues git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63886 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUenvironment.inc | 3 ++- build/NWGNUtail.inc | 55 ++++++++++++++++++++------------------ 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 315e65ec957..06407673806 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -185,6 +185,7 @@ endif # Add support for building IPV6 alongside ifneq "$(IPV6)" "" DEFINES += -DNW_BUILD_IPV6 +INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS) ifneq "$(IPV6)" "SET" OBJDIR := $(OBJDIR)_IPV6 @@ -254,7 +255,7 @@ XMLLIB = $(XML)/$(OBJDIR)/xmllib.lib # Additional general defines # VERSION = 2,0,0 - + EnvironmentDefined = 1 endif # ifndef EnvironmentDefined diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 62b437287c9..301afcff5cf 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -4,7 +4,7 @@ # # -# If we are going to create an nlm, make sure we have assigned variables to +# If we are going to create an nlm, make sure we have assigned variables to # use during the link. # echo NLM_NAME=$(NLM_NAME) @@ -37,7 +37,7 @@ CCOPT_DEPENDS = \ NWGNUmakefile \ $(CUSTOM_INI) \ $(EOLIST) - + CPPOPT_DEPENDS = \ $(APR_WORK)\build\NWGNUhead.inc \ $(APR_WORK)\build\NWGNUenvironment.inc \ @@ -81,7 +81,7 @@ endif $(OBJDIR)/%.o: %.c $(OBJDIR)\cc.opt @echo Compiling $< - $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt $(OBJDIR)\cc.opt: $(CCOPT_DEPENDS) @echo CCOPT_DEPENDS=$(CCOPT_DEPENDS) @@ -89,46 +89,46 @@ $(OBJDIR)\cc.opt: $(CCOPT_DEPENDS) @echo Generating $@ ifneq "$(strip $(CFLAGS))" "" @echo $(CFLAGS) >> $@ -endif +endif ifneq "$(strip $(XCFLAGS))" "" @echo $(XCFLAGS) >> $@ endif ifneq "$(strip $(XINCDIRS))" "" @echo $(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir)) >> $@ -endif +endif ifneq "$(strip $(INCDIRS))" "" @echo $(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir)) >> $@ endif -ifneq "$(strip $(DEFINES))" "" +ifneq "$(strip $(DEFINES))" "" @echo $(DEFINES) >> $@ endif -ifneq "$(strip $(XDEFINES))" "" +ifneq "$(strip $(XDEFINES))" "" @echo $(XDEFINES) >> $@ endif $(OBJDIR)/%.o: %.cpp $(OBJDIR)\cpp.opt @echo Compiling $< - $(CPP) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cpp.opt + $(CPP) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cpp.opt $(OBJDIR)\cpp.opt: $(CPPOPT_DEPENDS) $(CHK) $@ $(DEL) $@ @echo Generating $@ ifneq "$(strip $(CFLAGS))" "" @echo $(CFLAGS) >> $@ -endif +endif ifneq "$(strip $(XCFLAGS))" "" @echo $(XCFLAGS) >> $@ endif ifneq "$(strip $(XINCDIRS))" "" @echo $(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir)) >> $@ -endif +endif ifneq "$(strip $(INCDIRS))" "" @echo $(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir)) >> $@ endif -ifneq "$(strip $(DEFINES))" "" +ifneq "$(strip $(DEFINES))" "" @echo $(DEFINES) >> $@ endif -ifneq "$(strip $(XDEFINES))" "" +ifneq "$(strip $(XDEFINES))" "" @echo $(XDEFINES) >> $@ endif @@ -144,7 +144,7 @@ $(TARGET_lib) : $(OBJDIR)\$(LIB_NAME)_lib.lst @echo Generating $@ $(CHK) $(OBJDIR)\$(@F) $(DEL) $(OBJDIR)\$(@F) $(LIB) -o $(OBJDIR)\$(@F) @$? - + $(OBJDIR)\$(LIB_NAME)_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS) $(CHK) $@ $(DEL) $@ @echo Generating $@ @@ -161,7 +161,7 @@ $(OBJDIR)/%.lib: NWGNU% $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUt endif # -# Rules to build nlms. +# Rules to build nlms. # vpath libcpre.o $(NOVELLLIBC)\imports @@ -173,7 +173,7 @@ $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)\$(NLM_NAME)_link.o @echo Linking $@ $(LINK) @$(OBJDIR)\$(NLM_NAME)_link.opt -# This will force the link option file to be rebuilt if we change the +# This will force the link option file to be rebuilt if we change the # corresponding makefile $(OBJDIR)\$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) @@ -192,12 +192,12 @@ ifeq "$(RELEASE)" "debug" @echo -sym internal >> $@ @echo -sym codeview4 >> $@ @echo -osym $(OBJDIR)\$(NLM_NAME).sym >> $@ -else +else @echo -sym internal >> $@ -endif - @echo -screenname "$(NLM_SCREEN_NAME)" >> $@ +endif + @echo -screenname "$(NLM_SCREEN_NAME)" >> $@ ifneq "$(NLM_VERSION)" "" - @echo -nlmversion=$(NLM_VERSION) >> $@ + @echo -nlmversion=$(NLM_VERSION) >> $@ else @echo -nlmversion=$(VERSION) >> $@ endif @@ -206,16 +206,19 @@ endif @echo -l $(XML)/$(OBJDIR) >> $@ @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime" >> $@ @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++" >> $@ - @echo -l $(NOVELLLIBC)/imports >> $@ -ifneq "$(LDAPSDK)" "" +ifneq "$(IPV6)" "" + @echo -l $(NOVELLLIBC)\include\winsock\IPV6 >> $@ +endif + @echo -l $(NOVELLLIBC)/imports >> $@ +ifneq "$(LDAPSDK)" "" @echo -l $(LDAPSDK)/lib/nlm >> $@ -endif +endif @echo -nodefaults >> $@ @echo -map $(OBJDIR)\$(NLM_NAME).map>> $@ @echo -threadname "$(NLM_THREAD_NAME)" >> $@ ifneq "$(NLM_STACK_SIZE)" "" @echo -stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE)))) >> $@ -else +else @echo -stacksize 64000 >> $@ endif ifneq "$(NLM_ENTRY_SYM)" "" @@ -248,10 +251,10 @@ ifneq "$(FILES_nlm_modules)" "" endif ifneq "$(FILES_nlm_Ximports)" "" @echo Import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(subst /,\,$(import))) >> $(OBJDIR)\$(NLM_NAME)_link.def -endif +endif ifneq "$(FILES_nlm_exports)" "" @echo Export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(subst /,\,$(export))) >> $(OBJDIR)\$(NLM_NAME)_link.def -endif +endif ifneq "$(strip $(XLFLAGS))" "" @echo $(XLFLAGS) >> $(OBJDIR)\$(NLM_NAME)_link.def endif @@ -267,7 +270,7 @@ endif else # more than one target so look for individual makefiles. -# Only include these if NO_LICENSE_FILE isn't set to prevent excessive +# Only include these if NO_LICENSE_FILE isn't set to prevent excessive # recursion ifndef NO_LICENSE_FILE From 5548384ab8679f54870760ab70b691c0e93bffaa Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 29 Sep 2002 16:21:52 +0000 Subject: [PATCH 3869/7878] Patch a compilation signedness emit... the difference of the memory ptrs resulted in a ssize_t rather than the size_t we are comparing to. Change to addition and all is well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63887 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 059af143aae..9fe5bcc1773 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -612,7 +612,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) active = pool->active; /* If the active node has enough bytes left, use it. */ - if (size < active->endp - active->first_avail) { + if (active->first_avail + size < active->endp) { mem = active->first_avail; active->first_avail += size; @@ -620,7 +620,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) } node = active->next; - if (size < node->endp - node->first_avail) { + if (node->first_avail + size < node->endp) { *node->ref = node->next; node->next->ref = node->ref; } @@ -925,7 +925,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) size = APR_PSPRINTF_MIN_STRINGSIZE; node = active->next; - if (!ps->got_a_new_node && size < node->endp - node->first_avail) { + if (!ps->got_a_new_node && (node->first_avail + size < node->endp)) { *node->ref = node->next; node->next->ref = node->ref; From 1dfbc7c953bee93f869bf020c245e845bf9a8778 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 3 Oct 2002 00:32:20 +0000 Subject: [PATCH 3870/7878] Remove the #ifdef so that the new (realname() ) file info API will be used. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63888 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 061e1bcbad7..0a9bd4869e0 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -110,20 +110,10 @@ char *case_filename(apr_pool_t *pPool, const char *szFile) char name[1024]; int rc; -#ifdef NEW_API rc = realname(szFile, name); if (rc == 0) { casedFileName = apr_pstrdup(pPool, name); } -#else - NXDirAttrWithName_t *attrBuf; - - attrBuf = (NXDirAttrWithName_t *) &name; - rc =NXGetAttr(NULL, szFile, NX_DELEVEL_NAME_ONLY, attrBuf, 1024, 0); - if (rc == 0) { - casedFileName = apr_pstrdup(pPool, attrBuf->deName); - } -#endif else { char *s; From 78f9d20c84a483f0ead309c77b1634a2745776f3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 3 Oct 2002 05:35:21 +0000 Subject: [PATCH 3871/7878] On to the 2.0.43 candidate git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63889 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGES b/CHANGES index e3b897d6463..f228656dd17 100644 --- a/CHANGES +++ b/CHANGES @@ -6,8 +6,6 @@ Changes with APR 0.9.2 operations for Linux/x86 (requires a 486 or later; to enable, configure APR with --enable-nonportable-atomics=yes ) [Brian Pane] - *) Add --bindir option to apr-config. [Justin Erenkrantz] - *) Begin to rehash the test suite. There is now a new test program called testall. This program currently runs testtime and teststr with the CuTest framework. The stand-alone programs for testtime and teststr From 00479cd4d388a27cea352b28f3bc0c0569c50dd1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 3 Oct 2002 05:39:27 +0000 Subject: [PATCH 3872/7878] They are still here, they didn't make it into 2.0.43 however git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63891 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index f228656dd17..e3b897d6463 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,8 @@ Changes with APR 0.9.2 operations for Linux/x86 (requires a 486 or later; to enable, configure APR with --enable-nonportable-atomics=yes ) [Brian Pane] + *) Add --bindir option to apr-config. [Justin Erenkrantz] + *) Begin to rehash the test suite. There is now a new test program called testall. This program currently runs testtime and teststr with the CuTest framework. The stand-alone programs for testtime and teststr From a7cc1a623ed811aeca460cb9438da15026770d37 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 3 Oct 2002 15:31:49 +0000 Subject: [PATCH 3873/7878] Disable IPv6 support on Darwin. The current IPv6 support has a problem in getnameinfo() which breaks certain applications. Debugged by: Sander Temme Change coded by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63892 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ configure.in | 31 +++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index e3b897d6463..83d50af88d9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR 0.9.2 + *) Disable IPv6 support on Darwin. The current IPv6 support has a + problem in getnameinfo() which breaks certain applications. + [Sander Temme , Jeff Trawick] + *) Support for SCO OpenServer Release 5 [Kean Johnston ] *) Faster (inline and mutex-free) implementations of all apr_atomic diff --git a/configure.in b/configure.in index a60636862aa..8cd59faa24c 100644 --- a/configure.in +++ b/configure.in @@ -1748,6 +1748,17 @@ AC_ARG_ENABLE(ipv6, fi ], [ user_disabled_ipv6=0 ] ) +case $host in + *apple-darwin*) + dnl # It appears that Jaguar has all the right features, but + dnl # getnameinfo() fails to find the hostname for a mapped + dnl # address. + broken_ipv6=1 + ;; + *) + broken_ipv6=0 +esac + AC_SEARCH_LIBS(getaddrinfo, inet6) AC_SEARCH_LIBS(gai_strerror, inet6) AC_SEARCH_LIBS(getnameinfo, inet6) @@ -1762,19 +1773,23 @@ have_ipv6="0" if test "$user_disabled_ipv6" = 1; then AC_MSG_RESULT("no -- disabled by user") else - if test "x$have_sockaddr_in6" = "x1"; then - if test "x$ac_cv_working_getaddrinfo" = "xyes"; then - if test "x$ac_cv_working_getnameinfo" = "xyes"; then - have_ipv6="1" - AC_MSG_RESULT("yes") + if test "x$broken_ipv6" = "x0"; then + if test "x$have_sockaddr_in6" = "x1"; then + if test "x$ac_cv_working_getaddrinfo" = "xyes"; then + if test "x$ac_cv_working_getnameinfo" = "xyes"; then + have_ipv6="1" + AC_MSG_RESULT("yes") + else + AC_MSG_RESULT("no -- no getnameinfo") + fi else - AC_MSG_RESULT("no -- no getnameinfo") + AC_MSG_RESULT("no -- no working getaddrinfo") fi else - AC_MSG_RESULT("no -- no working getaddrinfo") + AC_MSG_RESULT("no -- no sockaddr_in6"); fi else - AC_MSG_RESULT("no -- no sockaddr_in6"); + AC_MSG_RESULT("no -- the platform has problems supporting IPv6"); fi fi From 1ff853390f29f1d99ac4aab44bd64907007b236c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 3 Oct 2002 17:55:42 +0000 Subject: [PATCH 3874/7878] add a way to create an apr_file_t from an apr_os_file_t which results in something that APR will treat as a pipe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63893 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/pipe.c | 23 +++++++++++++++++++++++ include/apr_portable.h | 12 ++++++++++++ 2 files changed, 35 insertions(+) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 8d702733c20..16e21737c3b 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -54,6 +54,7 @@ #include "fileio.h" #include "apr_strings.h" +#include "apr_portable.h" /* Figure out how to get pipe block/nonblock on BeOS... * Basically, BONE7 changed things again so that ioctl didn't work, @@ -168,6 +169,28 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int return APR_EINVAL; } +APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, + apr_os_file_t *thefile, + apr_pool_t *pool) +{ + int *dafile = thefile; + + (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file)->pool = pool; + (*file)->eof_hit = 0; + (*file)->is_pipe = 1; + (*file)->blocking = BLK_UNKNOWN; /* app needs to make a timeout call */ + (*file)->timeout = -1; + (*file)->ungetchar = -1; /* no char avail */ + (*file)->filedes = *dafile; + (*file)->flags = 0; + (*file)->buffered = 0; +#if APR_HAS_THREADS + (*file)->thlock = NULL; +#endif + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) { int filedes[2]; diff --git a/include/apr_portable.h b/include/apr_portable.h index 1b73c6caf17..756816f6272 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -363,6 +363,18 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_int32_t flags, apr_pool_t *cont); +/** + * convert the file from os specific type to apr type. + * @param file The apr file we are converting to. + * @param thefile The os specific pipe to convert + * @param cont The pool to use if it is needed. + * @remark On Unix, it is only possible to put a file descriptor into + * an apr file type. + */ +APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, + apr_os_file_t *thefile, + apr_pool_t *cont); + /** * convert the dir from os specific type to apr type. * @param dir The apr dir we are converting to. From 6c7549132263c1abe979f569965fb6217d89433c Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sat, 5 Oct 2002 12:14:03 +0000 Subject: [PATCH 3875/7878] Revert wrowes last commit and use casts instead. 'active->first_avail + size' might overflow, whereas 'active->endp - active->first_avail' can never underflow. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63894 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 9fe5bcc1773..7422de5d6fd 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -612,7 +612,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) active = pool->active; /* If the active node has enough bytes left, use it. */ - if (active->first_avail + size < active->endp) { + if (size < (apr_size_t)(active->endp - active->first_avail)) { mem = active->first_avail; active->first_avail += size; @@ -620,7 +620,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) } node = active->next; - if (node->first_avail + size < node->endp) { + if (size < (apr_size_t)(node->endp - node->first_avail)) { *node->ref = node->next; node->next->ref = node->ref; } @@ -925,7 +925,8 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) size = APR_PSPRINTF_MIN_STRINGSIZE; node = active->next; - if (!ps->got_a_new_node && (node->first_avail + size < node->endp)) { + if (!ps->got_a_new_node + && size < (apr_size_t)(node->endp - node->first_avail)) { *node->ref = node->next; node->next->ref = node->ref; From 1ea9229151eb26661c383f912188266672db255d Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 9 Oct 2002 15:40:28 +0000 Subject: [PATCH 3876/7878] Implemented the apr_os_pipe_put() API on NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63895 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 47c8648940b..7b8fca77add 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -58,6 +58,7 @@ #include "fileio.h" #include "apr_strings.h" +#include "apr_portable.h" static apr_status_t pipeblock(apr_file_t *thepipe) { @@ -134,6 +135,28 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int return APR_EINVAL; } +APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, + apr_os_file_t *thefile, + apr_pool_t *pool) +{ + int *dafile = thefile; + + (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file)->pool = pool; + (*file)->eof_hit = 0; + (*file)->is_pipe = 1; + (*file)->blocking = BLK_UNKNOWN; /* app needs to make a timeout call */ + (*file)->timeout = -1; + (*file)->ungetchar = -1; /* no char avail */ + (*file)->filedes = *dafile; + (*file)->flags = 0; + (*file)->buffered = 0; +#if APR_HAS_THREADS + (*file)->thlock = NULL; +#endif + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) { int filedes[2]; From 83e448c3d5654581f35a84c3ea193807c3cae833 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 10 Oct 2002 13:21:19 +0000 Subject: [PATCH 3877/7878] make the test for readability on a regular file non-fatal this call isn't valid on FreeBSD 3.4, but that's no reason not to do the rest of the tests git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63896 13f79535-47bb-0310-9956-ffa450edef68 --- test/test_apr.h | 17 +++++++++++++++++ test/testfile.c | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/test/test_apr.h b/test/test_apr.h index b75757404e5..d6cff1ad51b 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -110,6 +110,20 @@ CuSuite *testtime(void); printf("%s\n", good); \ } +#define TEST_NEQ_NONFATAL(str, func, value, good, bad) \ + printf("%-60s", str); \ + { \ + apr_status_t rv; \ + if ((rv = func) != value){ \ + char errmsg[200]; \ + printf("%s\n", bad); \ + fprintf(stderr, "Error was %d : %s\n", rv, \ + apr_strerror(rv, (char*)&errmsg, 200)); \ + } \ + else \ + printf("%s\n", good); \ + } + #define TEST_STATUS(str, func, testmacro, good, bad) \ printf("%-60s", str); \ { \ @@ -127,6 +141,9 @@ CuSuite *testtime(void); #define STD_TEST_NEQ(str, func) \ TEST_NEQ(str, func, APR_SUCCESS, "OK", "Failed"); +#define STD_TEST_NEQ_NONFATAL(str, func) \ + TEST_NEQ_NONFATAL(str, func, APR_SUCCESS, "OK", "Failed"); + #define PRINT_ERROR(rv) \ { \ char errmsg[200]; \ diff --git a/test/testfile.c b/test/testfile.c index 1adc8c0ce5d..5b2285630e1 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -157,8 +157,8 @@ int main(void) apr_poll_setup(&sdset, 1, pool); apr_poll_socket_add(sdset, testsock, APR_POLLIN); num = 1; - STD_TEST_NEQ(" Checking for incoming data", - apr_poll(sdset, 1, &num, apr_time_from_sec(1))); + STD_TEST_NEQ_NONFATAL(" Checking for incoming data", + apr_poll(sdset, 1, &num, apr_time_from_sec(1))); if (num == 0) { printf("** This platform doesn't return readability on a regular file.**\n"); } From 85d85bb875161e6324a87c4dbd53270d60ce8a09 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 10 Oct 2002 17:51:30 +0000 Subject: [PATCH 3878/7878] Make testlockperf run the same 3 lock tests for increasing numbers of concurrent threads, which at the moment means 1 through 6 concurrent threads. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63897 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlockperf.c | 152 ++++++++++++++++++++++---------------------- 1 file changed, 75 insertions(+), 77 deletions(-) diff --git a/test/testlockperf.c b/test/testlockperf.c index 0eec581fef9..428b91e29f0 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -74,19 +74,19 @@ int main(void) #else /* !APR_HAS_THREADS */ #define MAX_COUNTER 1000000 -#define MAX_ITER 40000 +#define MAX_THREADS 6 static long mutex_counter; static apr_thread_mutex_t *thread_lock; void * APR_THREAD_FUNC thread_mutex_func(apr_thread_t *thd, void *data); -apr_status_t test_thread_mutex(void); /* apr_thread_mutex_t */ +apr_status_t test_thread_mutex(int num_threads); /* apr_thread_mutex_t */ static apr_thread_rwlock_t *thread_rwlock; void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data); -apr_status_t test_thread_rwlock(void); /* apr_thread_rwlock_t */ +apr_status_t test_thread_rwlock(int num_threads); /* apr_thread_rwlock_t */ -int test_thread_mutex_nested(void); +int test_thread_mutex_nested(int num_threads); apr_pool_t *pool; int i = 0, x = 0; @@ -115,34 +115,33 @@ void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data) return NULL; } -int test_thread_mutex(void) +int test_thread_mutex(int num_threads) { - apr_thread_t *t1, *t2, *t3, *t4; - apr_status_t s1, s2, s3, s4; + apr_thread_t *t[MAX_THREADS]; + apr_status_t s[MAX_THREADS]; apr_time_t time_start, time_stop; + int i; mutex_counter = 0; printf("apr_thread_mutex_t Tests\n"); printf("%-60s", " Initializing the apr_thread_mutex_t (UNNESTED)"); - s1 = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_UNNESTED, pool); - if (s1 != APR_SUCCESS) { + s[0] = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_UNNESTED, pool); + if (s[0] != APR_SUCCESS) { printf("Failed!\n"); - return s1; + return s[0]; } printf("OK\n"); apr_thread_mutex_lock(thread_lock); /* set_concurrency(4)? -aaron */ - printf("%-60s"," Starting all the threads"); - s1 = apr_thread_create(&t1, NULL, thread_mutex_func, NULL, pool); - s2 = apr_thread_create(&t2, NULL, thread_mutex_func, NULL, pool); - s3 = apr_thread_create(&t3, NULL, thread_mutex_func, NULL, pool); - s4 = apr_thread_create(&t4, NULL, thread_mutex_func, NULL, pool); - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || - s3 != APR_SUCCESS || s4 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; + printf(" Starting %d threads ", num_threads); + for (i = 0; i < num_threads; ++i) { + s[i] = apr_thread_create(&t[i], NULL, thread_mutex_func, NULL, pool); + if (s[i] != APR_SUCCESS) { + printf("Failed!\n"); + return s[i]; + } } printf("OK\n"); @@ -150,49 +149,47 @@ int test_thread_mutex(void) apr_thread_mutex_unlock(thread_lock); /* printf("%-60s", " Waiting for threads to exit"); */ - apr_thread_join(&s1, t1); - apr_thread_join(&s2, t2); - apr_thread_join(&s3, t3); - apr_thread_join(&s4, t4); + for (i = 0; i < num_threads; ++i) { + apr_thread_join(&s[i], t[i]); + } /* printf("OK\n"); */ time_stop = apr_time_now(); printf("microseconds: %" APR_INT64_T_FMT " usec\n", (time_stop - time_start)); - if (mutex_counter != MAX_COUNTER * 4) + if (mutex_counter != MAX_COUNTER * num_threads) printf("error: counter = %ld\n", mutex_counter); return APR_SUCCESS; } -int test_thread_mutex_nested(void) +int test_thread_mutex_nested(int num_threads) { - apr_thread_t *t1, *t2, *t3, *t4; - apr_status_t s1, s2, s3, s4; + apr_thread_t *t[MAX_THREADS]; + apr_status_t s[MAX_THREADS]; apr_time_t time_start, time_stop; + int i; mutex_counter = 0; printf("apr_thread_mutex_t Tests\n"); printf("%-60s", " Initializing the apr_thread_mutex_t (NESTED)"); - s1 = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_NESTED, pool); - if (s1 != APR_SUCCESS) { + s[0] = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_NESTED, pool); + if (s[0] != APR_SUCCESS) { printf("Failed!\n"); - return s1; + return s[0]; } printf("OK\n"); apr_thread_mutex_lock(thread_lock); /* set_concurrency(4)? -aaron */ - printf("%-60s"," Starting all the threads"); - s1 = apr_thread_create(&t1, NULL, thread_mutex_func, NULL, pool); - s2 = apr_thread_create(&t2, NULL, thread_mutex_func, NULL, pool); - s3 = apr_thread_create(&t3, NULL, thread_mutex_func, NULL, pool); - s4 = apr_thread_create(&t4, NULL, thread_mutex_func, NULL, pool); - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || - s3 != APR_SUCCESS || s4 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; + printf(" Starting %d threads ", num_threads); + for (i = 0; i < num_threads; ++i) { + s[i] = apr_thread_create(&t[i], NULL, thread_mutex_func, NULL, pool); + if (s[i] != APR_SUCCESS) { + printf("Failed!\n"); + return s[i]; + } } printf("OK\n"); @@ -200,64 +197,63 @@ int test_thread_mutex_nested(void) apr_thread_mutex_unlock(thread_lock); /* printf("%-60s", " Waiting for threads to exit"); */ - apr_thread_join(&s1, t1); - apr_thread_join(&s2, t2); - apr_thread_join(&s3, t3); - apr_thread_join(&s4, t4); + for (i = 0; i < num_threads; ++i) { + apr_thread_join(&s[i], t[i]); + } /* printf("OK\n"); */ time_stop = apr_time_now(); printf("microseconds: %" APR_INT64_T_FMT " usec\n", (time_stop - time_start)); - if (mutex_counter != MAX_COUNTER * 4) + if (mutex_counter != MAX_COUNTER * num_threads) printf("error: counter = %ld\n", mutex_counter); return APR_SUCCESS; } -int test_thread_rwlock(void) +int test_thread_rwlock(int num_threads) { - apr_thread_t *t1, *t2, *t3, *t4; - apr_status_t s1, s2, s3, s4; + apr_thread_t *t[MAX_THREADS]; + apr_status_t s[MAX_THREADS]; apr_time_t time_start, time_stop; + int i; mutex_counter = 0; printf("apr_thread_rwlock_t Tests\n"); printf("%-60s", " Initializing the apr_thread_rwlock_t"); - s1 = apr_thread_rwlock_create(&thread_rwlock, pool); - if (s1 != APR_SUCCESS) { + s[0] = apr_thread_rwlock_create(&thread_rwlock, pool); + if (s[0] != APR_SUCCESS) { printf("Failed!\n"); - return s1; + return s[0]; } printf("OK\n"); apr_thread_rwlock_wrlock(thread_rwlock); /* set_concurrency(4)? -aaron */ - s1 = apr_thread_create(&t1, NULL, thread_rwlock_func, NULL, pool); - s2 = apr_thread_create(&t2, NULL, thread_rwlock_func, NULL, pool); - s3 = apr_thread_create(&t3, NULL, thread_rwlock_func, NULL, pool); - s4 = apr_thread_create(&t4, NULL, thread_rwlock_func, NULL, pool); - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || - s3 != APR_SUCCESS || s4 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; + printf(" Starting %d threads ", num_threads); + for (i = 0; i < num_threads; ++i) { + s[i] = apr_thread_create(&t[i], NULL, thread_rwlock_func, NULL, pool); + if (s[i] != APR_SUCCESS) { + printf("Failed!\n"); + return s[i]; + } } + printf("OK\n"); time_start = apr_time_now(); apr_thread_rwlock_unlock(thread_rwlock); /* printf("%-60s", " Waiting for threads to exit"); */ - apr_thread_join(&s1, t1); - apr_thread_join(&s2, t2); - apr_thread_join(&s3, t3); - apr_thread_join(&s4, t4); + for (i = 0; i < num_threads; ++i) { + apr_thread_join(&s[i], t[i]); + } /* printf("OK\n"); */ time_stop = apr_time_now(); printf("microseconds: %" APR_INT64_T_FMT " usec\n", (time_stop - time_start)); - if (mutex_counter != MAX_COUNTER * 4) + if (mutex_counter != MAX_COUNTER * num_threads) printf("error: counter = %ld\n", mutex_counter); return APR_SUCCESS; @@ -298,22 +294,24 @@ int main(int argc, const char * const *argv) exit(-1); } - if ((rv = test_thread_mutex()) != APR_SUCCESS) { - fprintf(stderr,"thread_mutex test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-3); - } + for (i = 1; i <= MAX_THREADS; ++i) { + if ((rv = test_thread_mutex(i)) != APR_SUCCESS) { + fprintf(stderr,"thread_mutex test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-3); + } - if ((rv = test_thread_mutex_nested()) != APR_SUCCESS) { - fprintf(stderr,"thread_mutex (NESTED) test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-4); - } + if ((rv = test_thread_mutex_nested(i)) != APR_SUCCESS) { + fprintf(stderr,"thread_mutex (NESTED) test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-4); + } - if ((rv = test_thread_rwlock()) != APR_SUCCESS) { - fprintf(stderr,"thread_rwlock test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-6); + if ((rv = test_thread_rwlock(i)) != APR_SUCCESS) { + fprintf(stderr,"thread_rwlock test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-6); + } } return 0; From ccf02888079c0131a44133fdeb7c6f697d41c2db Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 11 Oct 2002 10:55:59 +0000 Subject: [PATCH 3879/7878] fix a typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63898 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 0bf9228ea3f..b1a6b83520f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3,7 +3,7 @@ # CPP = @CPP@ -# get get substituted into some targets +# get substituted into some targets APR_MAJOR_VERSION=@APR_MAJOR_VERSION@ # From 4f303ac800a0e31786518f62149c93628adc0dc1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 11 Oct 2002 12:21:42 +0000 Subject: [PATCH 3880/7878] don't tell apr_file_write() to write 256 bytes when we only give it 13 or so bytes of valid storage (got EFAULT) before that change, we relied on filling up the child process's buffer so that fgets() would return even though no '\n' was written... but that no longer happens so add '\n' to end of message so that fgets() returns in the child this showed up when I moved an ElectricFence regression test from RH 6.1 to RH 8.0 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63899 13f79535-47bb-0310-9956-ffa450edef68 --- test/testproc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test/testproc.c b/test/testproc.c index 00585e3b90d..0b3adf1641a 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -108,11 +108,11 @@ int main(int argc, char *argv[]) fprintf(stderr, "%s", teststr); exit(1); } - teststr = apr_pstrdup(pool, "Whooo Hoooo\0"); + teststr = apr_pstrdup(pool, "Whooo Hoooo\n"); printf("APR Process Test\n================\n\n"); - STD_TEST_NEQ("Creating directory for later use", + STD_TEST_NEQ("Creating directory \"proctest\" for later use", apr_dir_make("proctest", APR_UREAD | APR_UWRITE | APR_UEXECUTE, pool)) /* =================================================================== */ @@ -136,12 +136,15 @@ int main(int argc, char *argv[]) testfile = newproc.in; printf("OK\n"); - length = 256; + length = strlen(teststr); printf("%-60s", "Writing the data to child"); - if (apr_file_write(testfile, teststr, &length) == APR_SUCCESS) { + if ((rv = apr_file_write(testfile, teststr, &length)) == APR_SUCCESS) { printf("OK\n"); } - else printf("Write failed.\n"); + else { + printf("Write failed: (%d) %s.\n", + rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); + } printf("%-60s", "Grabbing child's stdout"); testfile = newproc.out; @@ -155,7 +158,7 @@ int main(int argc, char *argv[]) printf("OK\n"); else { printf( "Uh-Oh\n"); - printf(" (I actually got %s_\n", buf); + printf(" (I actually got %s)\n", buf); } } else { From 1a4b30f46038569501c5d9624b2a878993986229 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 11 Oct 2002 18:28:36 +0000 Subject: [PATCH 3881/7878] refactor apr_sockaddr_info_get() same basic code but hopefully arranged in a way that is easier to understand and easier to extend git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63900 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 224 +++++++++++++++++++----------------- 1 file changed, 117 insertions(+), 107 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index fe8b6aaef35..415a97b7b39 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -321,112 +321,94 @@ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, } #if defined(HAVE_GETADDRINFO) -static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa, - struct addrinfo *ai, apr_port_t port) -{ - sa->pool = p; - memcpy(&sa->sa, ai->ai_addr, ai->ai_addrlen); - apr_sockaddr_vars_set(sa, ai->ai_family, port); -} -#else -static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa, - struct in_addr ipaddr, apr_port_t port) + +static apr_status_t call_resolver(apr_sockaddr_t **sa, + const char *hostname, apr_int32_t family, + apr_port_t port, apr_int32_t flags, + apr_pool_t *p) { - sa->pool = p; - sa->sa.sin.sin_addr = ipaddr; - apr_sockaddr_vars_set(sa, AF_INET, port); -} + struct addrinfo hints, *ai, *ai_list; + apr_sockaddr_t *prev_sa; + int error; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = family; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo(hostname, NULL, &hints, &ai_list); + if (error) { + if (error == EAI_SYSTEM) { + return errno; + } + else { + /* issues with representing this with APR's error scheme: + * glibc uses negative values for these numbers, perhaps so + * they don't conflict with h_errno values... Tru64 uses + * positive values which conflict with h_errno values + */ +#if defined(NEGATIVE_EAI) + error = -error; #endif + return error + APR_OS_START_EAIERR; + } + } -APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, - const char *hostname, - apr_int32_t family, apr_port_t port, - apr_int32_t flags, apr_pool_t *p) -{ - (*sa) = (apr_sockaddr_t *)apr_pcalloc(p, sizeof(apr_sockaddr_t)); - if ((*sa) == NULL) - return APR_ENOMEM; - (*sa)->hostname = apr_pstrdup(p, hostname); + prev_sa = NULL; + ai = ai_list; + while (ai) { /* while more addresses to report */ + apr_sockaddr_t *new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); -#if defined(HAVE_GETADDRINFO) - if (hostname != NULL) { - struct addrinfo hints, *ai, *ai_list; - apr_sockaddr_t *cursa; - int error; + new_sa->pool = p; + memcpy(&new_sa->sa, ai->ai_addr, ai->ai_addrlen); + apr_sockaddr_vars_set(new_sa, ai->ai_family, port); - memset(&hints, 0, sizeof(hints)); -#if !APR_HAVE_IPV6 - /* we can't talk IPv6 so we might as well not search for IPv6 - * addresses - */ - if (family == AF_UNSPEC) - hints.ai_family = AF_INET; - else -#endif - hints.ai_family = family; - hints.ai_socktype = SOCK_STREAM; - error = getaddrinfo(hostname, NULL, &hints, &ai_list); - if (error) { - if (error == EAI_SYSTEM) { - return errno; - } - else { - /* issues with representing this with APR's error scheme: - * glibc uses negative values for these numbers, perhaps so - * they don't conflict with h_errno values... Tru64 uses - * positive values which conflict with h_errno values - */ -#if defined(NEGATIVE_EAI) - error = -error; -#endif - return error + APR_OS_START_EAIERR; - } + if (!prev_sa) { /* first element in new list */ + new_sa->hostname = apr_pstrdup(p, hostname); + *sa = new_sa; } - cursa = *sa; - ai = ai_list; - save_addrinfo(p, cursa, ai, port); - while (ai->ai_next) { /* while more addresses to report */ - cursa->next = apr_pcalloc(p, sizeof(apr_sockaddr_t)); - ai = ai->ai_next; - cursa = cursa->next; - save_addrinfo(p, cursa, ai, port); + else { + prev_sa->next = new_sa; } - freeaddrinfo(ai_list); - } - else { - (*sa)->pool = p; - apr_sockaddr_vars_set(*sa, - family == APR_UNSPEC ? APR_INET : family, - port); + + prev_sa = new_sa; + ai = ai->ai_next; } -#else - if (hostname != NULL) { - struct hostent *hp; - apr_sockaddr_t *cursa; - int curaddr; + freeaddrinfo(ai_list); + return APR_SUCCESS; +} + +#else /* end of HAVE_GETADDRINFO code */ + +static apr_status_t call_resolver(apr_sockaddr_t **sa, + const char *hostname, apr_int32_t family, + apr_port_t port, apr_int32_t flags, + apr_pool_t *p) +{ + struct hostent *hp; + apr_sockaddr_t *prev_sa; + int curaddr; #if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) #ifdef GETHOSTBYNAME_R_HOSTENT_DATA - struct hostent_data hd; + struct hostent_data hd; #else - char tmp[GETHOSTBYNAME_BUFLEN]; + char tmp[GETHOSTBYNAME_BUFLEN]; #endif - int hosterror; - struct hostent hs; + int hosterror; #endif + struct hostent hs; + struct in_addr ipaddr; + char *addr_list[2]; - if (family == APR_UNSPEC) { - family = APR_INET; /* we don't support IPv6 here */ - } - - if (*hostname >= '0' && *hostname <= '9' && - strspn(hostname, "0123456789.") == strlen(hostname)) { - struct in_addr ipaddr; + if (*hostname >= '0' && *hostname <= '9' && + strspn(hostname, "0123456789.") == strlen(hostname)) { - ipaddr.s_addr = inet_addr(hostname); - save_addrinfo(p, *sa, ipaddr, port); - } - else { + ipaddr.s_addr = inet_addr(hostname); + addr_list[0] = (char *)&ipaddr; + addr_list[1] = NULL; /* just one IP in list */ + hs.h_addr_list = (char **)addr_list; + hp = &hs; + } + else { #if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) #if defined(GETHOSTBYNAME_R_HOSTENT_DATA) @@ -462,27 +444,55 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, return (h_errno + APR_OS_START_SYSERR); #endif } - cursa = *sa; - curaddr = 0; - save_addrinfo(p, cursa, *(struct in_addr *)hp->h_addr_list[curaddr], - port); - ++curaddr; - while (hp->h_addr_list[curaddr]) { - cursa->next = apr_pcalloc(p, sizeof(apr_sockaddr_t)); - cursa = cursa->next; - save_addrinfo(p, cursa, *(struct in_addr *)hp->h_addr_list[curaddr], - port); - ++curaddr; + } + + prev_sa = NULL; + curaddr = 0; + while (hp->h_addr_list[curaddr]) { + apr_sockaddr_t *new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); + + new_sa->pool = p; + new_sa->sa.sin.sin_addr = *(struct in_addr *)hp->h_addr_list[curaddr]; + apr_sockaddr_vars_set(new_sa, AF_INET, port); + + if (!prev_sa) { /* first element in new list */ + new_sa->hostname = apr_pstrdup(p, hostname); + *sa = new_sa; } + else { + prev_sa->next = new_sa; } + + prev_sa = new_sa; + ++curaddr; } - else { - (*sa)->pool = p; - apr_sockaddr_vars_set(*sa, - family == APR_UNSPEC ? APR_INET : family, - port); - } + + return APR_SUCCESS; +} + +#endif /* end of !HAVE_GETADDRINFO code */ + +APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, + const char *hostname, + apr_int32_t family, apr_port_t port, + apr_int32_t flags, apr_pool_t *p) +{ + *sa = NULL; + + if (hostname) { +#if !APR_HAVE_IPV6 + if (family == APR_UNSPEC) { + family = APR_INET; + } #endif + return call_resolver(sa, hostname, family, port, flags, p); + } + + *sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); + (*sa)->pool = p; + apr_sockaddr_vars_set(*sa, + family == APR_UNSPEC ? APR_INET : family, + port); return APR_SUCCESS; } From bb8f618c7b00fae9d60d896130417559b62ba731 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 11 Oct 2002 20:41:23 +0000 Subject: [PATCH 3882/7878] Add APR_IPV4_ADDR_OK flag to apr_sockaddr_info_get() to allow apps to avoid lookup of IPv6 address if IPv4 address is sufficient. (New APR_IPV6_ADDR_OK flag is similar.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63901 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++ include/apr_network_io.h | 20 +++++++++++-- network_io/unix/sa_common.c | 56 +++++++++++++++++++++++++++++++++---- 3 files changed, 73 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 83d50af88d9..579cea64c23 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR 0.9.2 + *) Add APR_IPV4_ADDR_OK flag to apr_sockaddr_info_get() to allow + apps to avoid lookup of IPv6 address if IPv4 address is sufficient. + (New APR_IPV6_ADDR_OK flag is similar.) [Jeff Trawick] + *) Disable IPv6 support on Darwin. The current IPv6 support has a problem in getnameinfo() which breaks certain applications. [Sander Temme , Jeff Trawick] diff --git a/include/apr_network_io.h b/include/apr_network_io.h index bb9dbad7a5e..163501b8246 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -136,6 +136,9 @@ extern "C" { typedef enum {APR_SHUTDOWN_READ, APR_SHUTDOWN_WRITE, APR_SHUTDOWN_READWRITE} apr_shutdown_how_e; +#define APR_IPV4_ADDR_OK 0x01 /* see doc for apr_sockaddr_info_get() */ +#define APR_IPV6_ADDR_OK 0x02 /* see doc for apr_sockaddr_info_get() */ + #if (!APR_HAVE_IN_ADDR) /** * We need to make sure we always have an in_addr type, so APR will just @@ -335,11 +338,24 @@ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa); /** * Create apr_sockaddr_t from hostname, address family, and port. * @param sa The new apr_sockaddr_t. - * @param hostname The hostname or numeric address string to resolve/parse. + * @param hostname The hostname or numeric address string to resolve/parse, or + * NULL to build an address that corresponds to 0.0.0.0 or :: * @param family The address family to use, or APR_UNSPEC if the system should * decide. * @param port The port number. - * @param flags Special processing flags. + * @param flags Special processing flags: + *

    + *       APR_IPV4_ADDR_OK          first query for IPv4 addresses; only look
    + *                                 for IPv6 addresses if the first query failed;
    + *                                 only valid if family is APR_UNSPEC and hostname
    + *                                 isn't NULL; mutually exclusive with
    + *                                 APR_IPV6_ADDR_OK
    + *       APR_IPV6_ADDR_OK          first query for IPv6 addresses; only look
    + *                                 for IPv4 addresses if the first query failed;
    + *                                 only valid if family is APR_UNSPEC and hostname
    + *                                 isn't NULL and APR_HAVE_IPV6; mutually exclusive
    + *                                 with APR_IPV4_ADDR_OK
    + * 
    * @param p The pool for the apr_sockaddr_t and associated storage. */ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 415a97b7b39..03278aba86b 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -376,12 +376,44 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, return APR_SUCCESS; } +static apr_status_t find_addresses(apr_sockaddr_t **sa, + const char *hostname, apr_int32_t family, + apr_port_t port, apr_int32_t flags, + apr_pool_t *p) +{ + if (flags & APR_IPV4_ADDR_OK) { + apr_status_t error = call_resolver(sa, hostname, AF_INET, port, flags, p); + +#if APR_HAVE_IPV6 + if (error) { + family = AF_INET6; /* try again */ + } + else +#endif + return error; + } +#if APR_HAVE_IPV6 + else if (flags & APR_IPV6_ADDR_OK) { + apr_status_t error = call_resolver(sa, hostname, AF_INET6, port, flags, p); + + if (error) { + family = AF_INET; /* try again */ + } + else { + return APR_SUCCESS; + } + } +#endif + + return call_resolver(sa, hostname, family, port, flags, p); +} + #else /* end of HAVE_GETADDRINFO code */ -static apr_status_t call_resolver(apr_sockaddr_t **sa, - const char *hostname, apr_int32_t family, - apr_port_t port, apr_int32_t flags, - apr_pool_t *p) +static apr_status_t find_addresses(apr_sockaddr_t **sa, + const char *hostname, apr_int32_t family, + apr_port_t port, apr_int32_t flags, + apr_pool_t *p) { struct hostent *hp; apr_sockaddr_t *prev_sa; @@ -478,14 +510,28 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, apr_int32_t flags, apr_pool_t *p) { *sa = NULL; + apr_int32_t masked; + if ((masked = flags & (APR_IPV4_ADDR_OK | APR_IPV6_ADDR_OK))) { + if (!hostname || + family != AF_UNSPEC || + masked == (APR_IPV4_ADDR_OK | APR_IPV6_ADDR_OK)) { + return APR_EINVAL; + } +#if !APR_HAVE_IPV6 + if (flags & APR_IPV6_ADDR_OK) { + return APR_ENOTIMPL; + } +#endif + } + if (hostname) { #if !APR_HAVE_IPV6 if (family == APR_UNSPEC) { family = APR_INET; } #endif - return call_resolver(sa, hostname, family, port, flags, p); + return find_addresses(sa, hostname, family, port, flags, p); } *sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); From 74d841c9788640bc95a7a7635b1db601b7fa957d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 11 Oct 2002 21:49:03 +0000 Subject: [PATCH 3883/7878] WE can declare a variable after executing some code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63902 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 03278aba86b..f8d1c0d7df7 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -509,8 +509,8 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p) { - *sa = NULL; apr_int32_t masked; + *sa = NULL; if ((masked = flags & (APR_IPV4_ADDR_OK | APR_IPV6_ADDR_OK))) { if (!hostname || From 8216c67143b0b61ad136d0e0b80d2a3f511dce19 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 12 Oct 2002 05:28:16 +0000 Subject: [PATCH 3884/7878] Cannot tolerate this workaround, for reasons that will be apparent in a moment. Users encountering problems with the aclapi include will simply have to grab a more recent SDK. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63903 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 696ba3307c7..5839badfaf8 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -52,10 +52,10 @@ * . */ -#include +#include "apr.h" #include #include "apr_private.h" -#include "win32/fileio.h" +#include "fileio.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_strings.h" From aedd0f39147a0f34a2cf022992ee83d08058b0d6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 12 Oct 2002 05:29:19 +0000 Subject: [PATCH 3885/7878] Toggling APR_HAVE_IPV6 to 1 simply works now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63904 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index a42c15d5ef7..2fa1d243e12 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -341,12 +341,26 @@ typedef int pid_t; typedef int uid_t; typedef int gid_t; - /* Mechanisms to properly type numeric literals */ #define APR_INT64_C(val) (val##i64) +#if APR_HAVE_IPV6 +#include + +/* Win32 does it's own thing. Again. */ +#define in6_addr in_addr6 + +/* Appears in later flavors, not the originals. */ +#ifndef WS2TCPIP_INLINE +#define IN6_IS_ADDR_V4MAPPED(a) \ + ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \ + && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) +#endif +#endif + + /* Definitions that APR programs need to work properly. */ #define APR_THREAD_FUNC __stdcall From cc4fa67c644bfa2c58135a5ebe00d21395356757 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 13 Oct 2002 00:39:58 +0000 Subject: [PATCH 3886/7878] Cleanup all warnings generated by the test suite code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63905 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 15 +++------------ test/CuTest.h | 1 + test/testtime.c | 1 - 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/test/CuTest.c b/test/CuTest.c index 76c5be88dbd..fab44d20d4e 100644 --- a/test/CuTest.c +++ b/test/CuTest.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "CuTest.h" @@ -203,7 +204,7 @@ void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual) { char buf[STRING_MAX]; if (expected == actual) return; - sprintf(buf, "expected pointer <0x%X> but was <0x%X>", expected, actual); + sprintf(buf, "expected pointer <%p> but was <%p>", expected, actual); CuFail(tc, buf); } @@ -211,7 +212,7 @@ void CuAssertPtrNotNull(CuTest* tc, void* pointer) { char buf[STRING_MAX]; if (pointer != NULL ) return; - sprintf(buf, "null pointer unexpected", pointer); + sprintf(buf, "null pointer unexpected, but was <%p>", pointer); CuFail(tc, buf); } @@ -290,11 +291,6 @@ void CuSuiteSummary(CuSuite* testSuite, CuString* summary) void CuSuiteOverView(CuSuite* testSuite, CuString* details) { - int i; - int failCount = 0; - int notImpleCount = 0; - int passCount = testSuite->count - testSuite->failCount; - CuStringAppendFormat(details, "%d %s run: %d passed, %d failed, " "%d not implemented.\n", testSuite->count, @@ -308,9 +304,6 @@ void CuSuiteDetails(CuSuite* testSuite, CuString* details) { int i; int failCount = 0; - int notImpleCount = 0; - int passCount = testSuite->count - testSuite->failCount; - char* testWord = passCount == 1 ? "test" : "tests"; if (testSuite->failCount != 0 && verbose) { @@ -391,9 +384,7 @@ void CuSuiteListDetails(CuSuiteList* testSuite, CuString* details) int i; int failCount = 0; int notImplCount = 0; - int passCount = 0; int count = 0; - char *testWord = passCount == 1 ? "test" : "tests"; for (i = 0 ; i < testSuite->count ; ++i) { diff --git a/test/CuTest.h b/test/CuTest.h index 448c116ea33..d86f01410fa 100644 --- a/test/CuTest.h +++ b/test/CuTest.h @@ -82,6 +82,7 @@ void CuInit(int argc, char *argv[]); void CuTestInit(CuTest* t, char* name, TestFunction function); CuTest* CuTestNew(char* name, TestFunction function); void CuFail(CuTest* tc, char* message); +void CuNotImpl(CuTest* tc, char* message); void CuAssert(CuTest* tc, char* message, int condition); void CuAssertTrue(CuTest* tc, int condition); void CuAssertStrEquals(CuTest* tc, char* expected, char* actual); diff --git a/test/testtime.c b/test/testtime.c index 2266890cf8d..5ae428ce446 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -255,7 +255,6 @@ static void test_exp_tz(CuTest *tc) apr_status_t rv; apr_time_exp_t xt; char str[STR_SIZE]; - apr_size_t sz; apr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */ rv = apr_time_exp_tz(&xt, now, hr_off); From 3ebef97d4f20a96d7a712b1e2f10e7019ab7e6e7 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 13 Oct 2002 02:19:15 +0000 Subject: [PATCH 3887/7878] Const-ify some functions in the test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63906 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 6 +++--- test/CuTest.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/CuTest.c b/test/CuTest.c index fab44d20d4e..420d31383fa 100644 --- a/test/CuTest.c +++ b/test/CuTest.c @@ -96,7 +96,7 @@ void CuStringResize(CuString* str, int newSize) str->size = newSize; } -void CuStringAppend(CuString* str, char* text) +void CuStringAppend(CuString* str, const char* text) { int length = strlen(text); if (str->length + length + 1 >= str->size) @@ -113,7 +113,7 @@ void CuStringAppendChar(CuString* str, char ch) CuStringAppend(str, text); } -void CuStringAppendFormat(CuString* str, char* format, ...) +void CuStringAppendFormat(CuString* str, const char* format, ...) { va_list argp; char buf[HUGE_STRING_LEN]; @@ -179,7 +179,7 @@ void CuAssertTrue(CuTest* tc, int condition) CuFail(tc, "assert failed"); } -void CuAssertStrEquals(CuTest* tc, char* expected, char* actual) +void CuAssertStrEquals(CuTest* tc, const char* expected, const char* actual) { CuString* message; if (strcmp(expected, actual) == 0) return; diff --git a/test/CuTest.h b/test/CuTest.h index d86f01410fa..4cc976d2f47 100644 --- a/test/CuTest.h +++ b/test/CuTest.h @@ -56,9 +56,9 @@ typedef struct void CuStringInit(CuString* str); CuString* CuStringNew(void); void CuStringRead(CuString* str, char* path); -void CuStringAppend(CuString* str, char* text); +void CuStringAppend(CuString* str, const char* text); void CuStringAppendChar(CuString* str, char ch); -void CuStringAppendFormat(CuString* str, char* format, ...); +void CuStringAppendFormat(CuString* str, const char* format, ...); void CuStringResize(CuString* str, int newSize); /* CuTest */ @@ -85,7 +85,7 @@ void CuFail(CuTest* tc, char* message); void CuNotImpl(CuTest* tc, char* message); void CuAssert(CuTest* tc, char* message, int condition); void CuAssertTrue(CuTest* tc, int condition); -void CuAssertStrEquals(CuTest* tc, char* expected, char* actual); +void CuAssertStrEquals(CuTest* tc, const char* expected, const char* actual); void CuAssertIntEquals(CuTest* tc, int expected, int actual); void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual); void CuAssertPtrNotNull(CuTest* tc, void* pointer); From d20fdc270bd188705537bad3f1ecef401212261b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 13 Oct 2002 02:20:34 +0000 Subject: [PATCH 3888/7878] Convert testvsn to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63907 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 ++-- test/test_apr.h | 1 + test/testall.c | 5 +++-- test/testvsn.c | 42 +++++++++++++++++++++++++++--------------- 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 30500950ad4..ec61caaec0f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -209,8 +209,8 @@ testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) testtable@EXEEXT@: testtable.lo $(LOCAL_LIBS) $(LINK) testtable.lo $(LOCAL_LIBS) $(ALL_LIBS) -testall: testall.lo testtime.lo teststr.lo CuTest.lo $(LOCAL_LIBS) - $(LINK) testall.lo testtime.lo teststr.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) +testall: testall.lo testtime.lo teststr.lo testvsn.lo CuTest.lo $(LOCAL_LIBS) + $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index d6cff1ad51b..52b14a8b770 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -75,6 +75,7 @@ CuSuite *getsuite(void); CuSuite *teststr(void); CuSuite *testtime(void); +CuSuite *testvsn(void); diff --git a/test/testall.c b/test/testall.c index b3e5818bf71..2d7db9c6de0 100644 --- a/test/testall.c +++ b/test/testall.c @@ -57,7 +57,7 @@ #include "test_apr.h" -#define NUM_TESTS 2 +#define NUM_TESTS 3 apr_pool_t *p; @@ -65,7 +65,8 @@ typedef CuSuite *(testfunc)(void); testfunc *tests[NUM_TESTS] = { teststr, - testtime + testtime, + testvsn }; int main(int argc, char *argv[]) diff --git a/test/testvsn.c b/test/testvsn.c index ad4b7d722db..9ac9d2ff13c 100644 --- a/test/testvsn.c +++ b/test/testvsn.c @@ -54,28 +54,40 @@ #include +#include "test_apr.h" #include "apr_version.h" #include "apr_general.h" -int main(int argc, char **argv) +static void test_strings(CuTest *tc) { - apr_version_t vsn; + CuAssertStrEquals(tc, APR_VERSION_STRING, apr_version_string()); +} - printf("compiled integer form: %d.%d.%d%s\ncompiled string form: %s\n", - APR_MAJOR_VERSION, APR_MINOR_VERSION, APR_PATCH_VERSION, -#ifdef APR_IS_DEV_VERSION - "-dev", -#else - "", -#endif - APR_VERSION_STRING); +static void test_ints(CuTest *tc) +{ + apr_version_t vsn; apr_version(&vsn); - printf("runtime integer form: %d.%d.%d%s\nruntime string form: %s\n", - vsn.major, vsn.minor, vsn.patch, - vsn.is_dev ? "-dev" : "", - apr_version_string()); - return 0; + CuAssertIntEquals(tc, APR_MAJOR_VERSION, vsn.major); + CuAssertIntEquals(tc, APR_MINOR_VERSION, vsn.minor); + CuAssertIntEquals(tc, APR_PATCH_VERSION, vsn.patch); +} + +CuSuite *testvsn(void) +{ + CuSuite *suite = CuSuiteNew("Test Versioning"); + + SUITE_ADD_TEST(suite, test_strings); + SUITE_ADD_TEST(suite, test_ints); + + return suite; } + +#ifdef SINGLE_PROG +CuSuite *getsuite(void) +{ + return testvsn(); +} +#endif From ed621388c5a4b734b62358c802aa29ad590c2e99 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 13 Oct 2002 02:54:23 +0000 Subject: [PATCH 3889/7878] This was getting printed twice for SuiteLists, but we only need it once. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63908 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 1 - 1 file changed, 1 deletion(-) diff --git a/test/CuTest.c b/test/CuTest.c index 420d31383fa..ce0ee04ce84 100644 --- a/test/CuTest.c +++ b/test/CuTest.c @@ -414,7 +414,6 @@ void CuSuiteListDetails(CuSuiteList* testSuite, CuString* details) } if (notImplCount != 0 && verbose) { - CuStringAppendFormat(details, "\nNot Implemented tests:\n"); for (i = 0 ; i < testSuite->count ; ++i) { CuString *str = CuStringNew(); From 5983b1ad3fbd43d087417ddb9f3298f53bc8acab Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 13 Oct 2002 03:34:32 +0000 Subject: [PATCH 3890/7878] Prepare to eliminate a platform specific #define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e)) for the platform agnostic APR_FROM_OS_ERROR() macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63909 13f79535-47bb-0310-9956-ffa450edef68 --- dso/os2/dso.c | 6 +++--- file_io/os2/dir.c | 8 ++++---- file_io/os2/filestat.c | 6 +++--- file_io/os2/open.c | 10 +++++----- file_io/os2/pipe.c | 14 +++++++------- file_io/os2/readwrite.c | 14 +++++++------- file_io/os2/seek.c | 6 +++--- 7 files changed, 32 insertions(+), 32 deletions(-) diff --git a/dso/os2/dso.c b/dso/os2/dso.c index 3a663100eaf..d1b79e6c22c 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -73,7 +73,7 @@ static apr_status_t dso_cleanup(void *thedso) if (rc == 0) dso->handle = 0; - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } @@ -89,9 +89,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char (*res_handle)->failed_module = NULL; if ((rc = DosLoadModule(failed_module, sizeof(failed_module), path, &handle)) != 0) { - (*res_handle)->load_error = APR_OS2_STATUS(rc); + (*res_handle)->load_error = APR_FROM_OS_ERROR(rc); (*res_handle)->failed_module = apr_pstrdup(ctx, failed_module); - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } (*res_handle)->handle = handle; diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 9ccd8c55a40..59f61b265de 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -101,7 +101,7 @@ APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir) } } - return APR_OS2_STATUS(rv); + return APR_FROM_OS_ERROR(rv); } @@ -154,7 +154,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, thedir->validentry = FALSE; if (rv) - return APR_OS2_STATUS(rv); + return APR_FROM_OS_ERROR(rv); return APR_ENOENT; } @@ -170,7 +170,7 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir) APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *pool) { - return APR_OS2_STATUS(DosCreateDir(path, NULL)); + return APR_FROM_OS_ERROR(DosCreateDir(path, NULL)); } @@ -185,7 +185,7 @@ apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool) { - return APR_OS2_STATUS(DosDeleteDir(path)); + return APR_FROM_OS_ERROR(DosDeleteDir(path)); } diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 75b15074d9f..6634a182318 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -112,7 +112,7 @@ static apr_status_t handle_type(apr_filetype_e *ftype, HFILE file) return APR_SUCCESS; } - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } @@ -142,7 +142,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want finfo->protection = 0; finfo->filetype = APR_NOFILE; - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, apr_fileperms_t perms) @@ -187,7 +187,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, return APR_SUCCESS; } - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 07ebe666a6e..00fb4424676 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -135,7 +135,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr } if (rv != 0) - return APR_OS2_STATUS(rv); + return APR_FROM_OS_ERROR(rv); dafile->isopen = TRUE; dafile->fname = apr_pstrdup(pool, fname); @@ -167,10 +167,10 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) status = APR_SUCCESS; if (file->flags & APR_DELONCLOSE) { - status = APR_OS2_STATUS(DosDelete(file->fname)); + status = APR_FROM_OS_ERROR(DosDelete(file->fname)); } } else { - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } } @@ -185,7 +185,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool) { ULONG rc = DosDelete(path); - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } @@ -203,7 +203,7 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_ } } - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 33e14cf5751..a40ac981eb1 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -72,13 +72,13 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out rc = DosCreateNPipe(pipename, filedes, NP_ACCESS_INBOUND, NP_NOWAIT|1, 4096, 4096, 0); if (rc) - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); rc = DosConnectNPipe(filedes[0]); if (rc && rc != ERROR_PIPE_NOT_CONNECTED) { DosClose(filedes[0]); - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } rc = DosOpen (pipename, filedes+1, &action, 0, FILE_NORMAL, @@ -88,7 +88,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out if (rc) { DosClose(filedes[0]); - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } (*in) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); @@ -97,7 +97,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out if (rc) { DosClose(filedes[0]); DosClose(filedes[1]); - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } rc = DosSetNPipeSem(filedes[0], (HSEM)(*in)->pipeSem, 1); @@ -110,7 +110,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out DosClose(filedes[0]); DosClose(filedes[1]); DosCloseEventSem((*in)->pipeSem); - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } (*in)->pool = pool; @@ -157,13 +157,13 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_int if (thepipe->timeout >= 0) { if (thepipe->blocking != BLK_OFF) { thepipe->blocking = BLK_OFF; - return APR_OS2_STATUS(DosSetNPHState(thepipe->filedes, NP_NOWAIT)); + return APR_FROM_OS_ERROR(DosSetNPHState(thepipe->filedes, NP_NOWAIT)); } } else if (thepipe->timeout == -1) { if (thepipe->blocking != BLK_ON) { thepipe->blocking = BLK_ON; - return APR_OS2_STATUS(DosSetNPHState(thepipe->filedes, NP_WAIT)); + return APR_FROM_OS_ERROR(DosSetNPHState(thepipe->filedes, NP_WAIT)); } } } diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 1cf6cb836c3..1a7212a6490 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -117,7 +117,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size return APR_EOF; } - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } else { if (thefile->pipe) DosResetEventSem(thefile->pipeSem, &rc); @@ -133,7 +133,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size if (rc) { *nbytes = 0; - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } *nbytes = bytesread; @@ -187,7 +187,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } apr_thread_mutex_unlock(thefile->mutex); - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } else { if (thefile->flags & APR_APPEND) { FILELOCK all = { 0, 0x7fffffff }; @@ -209,7 +209,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a if (rc) { *nbytes = 0; - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } *nbytes = byteswritten; @@ -249,7 +249,7 @@ APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile) rc = DosWrite(thefile->filedes, &ch, 1, &byteswritten); if (rc) { - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } return APR_SUCCESS; @@ -313,7 +313,7 @@ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) thefile->bufpos = 0; } - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } else { /* There isn't anything to do if we aren't buffering the output * so just return success. @@ -385,5 +385,5 @@ apr_status_t apr_file_check_read(apr_file_t *fd) if (rc == ERROR_TIMEOUT) return APR_TIMEUP; - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index e0a1329e6e2..a6a7fbea92f 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -80,7 +80,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) thefile->bufpos = thefile->dataRead = 0; } - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } @@ -130,7 +130,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh break; } - return APR_OS2_STATUS(DosSetFilePtr(thefile->filedes, *offset, where, (ULONG *)offset)); + return APR_FROM_OS_ERROR(DosSetFilePtr(thefile->filedes, *offset, where, (ULONG *)offset)); } } @@ -141,7 +141,7 @@ APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset) int rc = DosSetFileSize(fp->filedes, offset); if (rc != 0) { - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } if (fp->buffered) { From b22ca82c127190375c9ee2a93a14295782b92340 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 13 Oct 2002 03:37:21 +0000 Subject: [PATCH 3891/7878] Well MS got around to getting it right, after some fashion. This is also conditional on old includes. And we cannot exclude GDI declarations since the aclapi stuff depends on GDI declarations as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63910 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 2fa1d243e12..51ebd0a131e 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -232,9 +232,6 @@ extern "C" { #ifndef NOUSER #define NOUSER #endif -#ifndef NOGDI -#define NOGDI -#endif #ifndef NOMCX #define NOMCX #endif @@ -349,10 +346,11 @@ typedef int gid_t; #if APR_HAVE_IPV6 #include -/* Win32 does it's own thing. Again. */ +/* Appears in later flavors, not the originals. */ +#ifndef in_addr6 #define in6_addr in_addr6 +#endif -/* Appears in later flavors, not the originals. */ #ifndef WS2TCPIP_INLINE #define IN6_IS_ADDR_V4MAPPED(a) \ ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \ From bd83c76b347b5b8798faa36bf3cca8ca8af6b406 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 13 Oct 2002 03:59:52 +0000 Subject: [PATCH 3892/7878] Port the testipsub program to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63911 13f79535-47bb-0310-9956-ffa450edef68 --- test/test_apr.h | 1 + test/testall.c | 5 +-- test/testipsub.c | 83 ++++++++++++++++++++++++------------------------ 3 files changed, 45 insertions(+), 44 deletions(-) diff --git a/test/test_apr.h b/test/test_apr.h index 52b14a8b770..62a349ccc23 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -76,6 +76,7 @@ CuSuite *getsuite(void); CuSuite *teststr(void); CuSuite *testtime(void); CuSuite *testvsn(void); +CuSuite *testipsub(void); diff --git a/test/testall.c b/test/testall.c index 2d7db9c6de0..c1827087e82 100644 --- a/test/testall.c +++ b/test/testall.c @@ -57,7 +57,7 @@ #include "test_apr.h" -#define NUM_TESTS 3 +#define NUM_TESTS 4 apr_pool_t *p; @@ -66,7 +66,8 @@ typedef CuSuite *(testfunc)(void); testfunc *tests[NUM_TESTS] = { teststr, testtime, - testvsn + testvsn, + testipsub }; int main(int argc, char *argv[]) diff --git a/test/testipsub.c b/test/testipsub.c index bd63d251619..1951b3f95e0 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -52,14 +52,12 @@ * . */ -#include -#include - +#include "test_apr.h" #include "apr_general.h" #include "apr_network_io.h" #include "apr_errno.h" -static void test_bad_input(apr_pool_t *p) +static void test_bad_input(CuTest *tc) { struct { const char *ipstr; @@ -108,11 +106,11 @@ static void test_bad_input(apr_pool_t *p) for (i = 0; i < (sizeof testcases / sizeof testcases[0]); i++) { rv = apr_ipsubnet_create(&ipsub, testcases[i].ipstr, testcases[i].mask, p); - assert(rv == testcases[i].expected_rv); + CuAssertIntEquals(tc, rv, testcases[i].expected_rv); } } -static void test_singleton_subnets(apr_pool_t *p) +static void test_singleton_subnets(CuTest *tc) { const char *v4addrs[] = { "127.0.0.1", "129.42.18.99", "63.161.155.20", "207.46.230.229", "64.208.42.36", @@ -126,16 +124,16 @@ static void test_singleton_subnets(apr_pool_t *p) for (i = 0; i < sizeof v4addrs / sizeof v4addrs[0]; i++) { rv = apr_ipsubnet_create(&ipsub, v4addrs[i], NULL, p); - assert(rv == APR_SUCCESS); + CuAssertTrue(tc, rv == APR_SUCCESS); for (j = 0; j < sizeof v4addrs / sizeof v4addrs[0]; j++) { rv = apr_sockaddr_info_get(&sa, v4addrs[j], APR_INET, 0, 0, p); - assert(rv == APR_SUCCESS); + CuAssertTrue(tc, rv == APR_SUCCESS); rc = apr_ipsubnet_test(ipsub, sa); if (!strcmp(v4addrs[i], v4addrs[j])) { - assert(rc != 0); + CuAssertTrue(tc, rc != 0); } else { - assert(rc == 0); + CuAssertTrue(tc, rc == 0); } } } @@ -143,7 +141,7 @@ static void test_singleton_subnets(apr_pool_t *p) /* same for v6? */ } -static void test_interesting_subnets(apr_pool_t *p) +static void test_interesting_subnets(CuTest *tc) { struct { const char *ipstr, *mask; @@ -171,49 +169,50 @@ static void test_interesting_subnets(apr_pool_t *p) for (i = 0; i < sizeof testcases / sizeof testcases[0]; i++) { rv = apr_ipsubnet_create(&ipsub, testcases[i].ipstr, testcases[i].mask, p); - assert(rv == APR_SUCCESS); + CuAssertTrue(tc, rv == APR_SUCCESS); rv = apr_sockaddr_info_get(&sa, testcases[i].in_subnet, testcases[i].family, 0, 0, p); - assert(rv == APR_SUCCESS); + CuAssertTrue(tc, rv == APR_SUCCESS); rc = apr_ipsubnet_test(ipsub, sa); - assert(rc != 0); + CuAssertTrue(tc, rc != 0); rv = apr_sockaddr_info_get(&sa, testcases[i].not_in_subnet, testcases[i].family, 0, 0, p); - assert(rv == APR_SUCCESS); + CuAssertTrue(tc, rv == APR_SUCCESS); rc = apr_ipsubnet_test(ipsub, sa); - assert(rc == 0); + CuAssertTrue(tc, rc == 0); } } -int main(void) +static void test_badmask_str(CuTest *tc) { - apr_status_t rv; - apr_pool_t *p; char buf[128]; - rv = apr_initialize(); - if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_initialize()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); - } - - atexit(apr_terminate); + CuAssertStrEquals(tc, apr_strerror(APR_EBADMASK, buf, sizeof buf), + "The specified network mask is invalid."); +} - rv = apr_pool_create(&p, NULL); - if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_pool_create()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); - } +static void test_badip_str(CuTest *tc) +{ + char buf[128]; - test_bad_input(p); - test_singleton_subnets(p); - test_interesting_subnets(p); + CuAssertStrEquals(tc, apr_strerror(APR_EBADIP, buf, sizeof buf), + "The specified IP address is invalid."); +} - printf("error strings:\n"); - printf("\tAPR_EBADIP\t`%s'\n", apr_strerror(APR_EBADIP, buf, sizeof buf)); - printf("\tAPR_EBADMASK\t`%s'\n", apr_strerror(APR_EBADMASK, buf, sizeof buf)); +CuSuite *testipsub(void) +{ + CuSuite *suite = CuSuiteNew("Test IP subnets"); + + SUITE_ADD_TEST(suite, test_bad_input); + SUITE_ADD_TEST(suite, test_singleton_subnets); + SUITE_ADD_TEST(suite, test_interesting_subnets); + SUITE_ADD_TEST(suite, test_badmask_str); + SUITE_ADD_TEST(suite, test_badip_str); + return suite; +} - return 0; +#ifdef SINGLE_PROG +CuSuite *getsuite(void) +{ + return testipsub(); } +#endif + From 2b4f117a6153b489c3049110e3375475f773cbd2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 13 Oct 2002 04:08:34 +0000 Subject: [PATCH 3893/7878] Consistify apr_get_netos_error() and apr_set_netos_error(). Only remaining question... are h_errno values in the errno domain, or are they in their very own conflicting range? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63912 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 0b87233e609..d9c5a272c9c 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -770,6 +770,21 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define INCL_DOSERRORS #define INCL_DOS + +/* Leave these undefined. + * OS2 doesn't rely on the errno concept. + * The API calls always return a result codes which + * should be filtered through APR_FROM_OS_ERROR(). + * + * #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) + * #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) + */ + +/* A special case, only socket calls require this: + */ +define apr_get_netos_error() (APR_FROM_OS_ERROR(h_errno)) +define apr_set_netos_error(e) (h_errno = APR_TO_OS_ERROR(e))) + /* And this needs to be greped away for good: */ #define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e)) @@ -924,6 +939,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, /* A special case, only socket calls require this: */ #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) +#define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e))) #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS \ || (s) == APR_OS_START_SYSERR + ERROR_SUCCESS) @@ -1026,12 +1042,12 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_FROM_OS_ERROR(e) (e) #define APR_TO_OS_ERROR(e) (e) -#define APR_TO_NETOS_ERROR(e) (e-APR_OS_START_SYSERR) #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) #define apr_get_netos_error() (WSAGetLastError()+APR_OS_START_SYSERR) +#define apr_set_netos_error(e) (WSASetLastError((e)-APR_OS_START_SYSERR)) #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) @@ -1084,15 +1100,20 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, */ #define APR_FROM_OS_ERROR(e) (e) #define APR_TO_OS_ERROR(e) (e) +/* Platform specific, should be deprecated */ +#define APR_TO_NETOS_ERROR(e) (e-APR_OS_START_SYSERR) #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) /* A special case, only socket calls require this: - * [Note: platforms using h_errno should replace this macro, - * although watch out for thread saftey issues with h_errno.] */ -#define apr_get_netos_error() (errno) +#define apr_get_netos_error() (h_errno) +#ifdef HAVE_SET_H_ERRNO +#define apr_set_netos_error(e) set_h_errno(e) +#else +#define apr_set_netos_error(e) (h_errno = (e)) +#endif /** no error */ #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) From 92181c1006973420d72aa7e460aa030c5316b5f3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 13 Oct 2002 04:09:47 +0000 Subject: [PATCH 3894/7878] Missed one transform git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63913 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filedup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 08c6b9a17a2..1243e8aa588 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -80,7 +80,7 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_po rv = DosDupHandle(old_file->filedes, &dup_file->filedes); if (rv) { - return APR_OS2_STATUS(rv); + return APR_FROM_OS_ERROR(rv); } dup_file->fname = apr_pstrdup(dup_file->pool, old_file->fname); From 5de21ea105bc5e45e2f56daf50120375dc0e6043 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 13 Oct 2002 04:10:21 +0000 Subject: [PATCH 3895/7878] Prepare for IPV6 on win32 as well, cleaning up just a few code paths that are a little grey and hard to follow. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63914 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 80 +++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 44 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index f8d1c0d7df7..9ff06fd730d 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -85,16 +85,6 @@ struct apr_ipsubnet_t { #endif }; -#ifndef NETWARE -#ifdef HAVE_SET_H_ERRNO -#define SET_H_ERRNO(newval) set_h_errno(newval) -#else -#define SET_H_ERRNO(newval) h_errno = (newval) -#endif -#else -#define SET_H_ERRNO(newval) -#endif - #if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ defined(HAVE_GETHOSTBYNAME_R) /* This is the maximum size that may be returned from the reentrant @@ -336,8 +326,12 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, hints.ai_socktype = SOCK_STREAM; error = getaddrinfo(hostname, NULL, &hints, &ai_list); if (error) { +#ifdef WIN32 + /* XXX Netware also??? */ + return apr_get_netos_error(); +#else if (error == EAI_SYSTEM) { - return errno; + return apr_get_os_error(); } else { /* issues with representing this with APR's error scheme: @@ -350,6 +344,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, #endif return error + APR_OS_START_EAIERR; } +#endif } prev_sa = NULL; @@ -423,6 +418,8 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, #ifdef GETHOSTBYNAME_R_HOSTENT_DATA struct hostent_data hd; #else + /* If you see ERANGE, that means GETHOSBYNAME_BUFLEN needs to be + * bumped. */ char tmp[GETHOSTBYNAME_BUFLEN]; #endif int hosterror; @@ -451,30 +448,23 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, /* Linux glibc2+ */ gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hp, &hosterror); + if (!hp) { + return (hosterror + APR_OS_START_SYSERR); + } #else /* Solaris, Irix et alia */ hp = gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hosterror); + if (!hp) { + return (hosterror + APR_OS_START_SYSERR); + } #endif #else hp = gethostbyname(hostname); #endif if (!hp) { -#ifdef WIN32 return apr_get_netos_error(); -#elif APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ - defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) -#ifdef GETHOSTBYNAME_R_HOSTENT_DATA - return (h_errno + APR_OS_START_SYSERR); -#else - /* If you see ERANGE, that means GETHOSBYNAME_BUFLEN needs to be - * bumped. */ - return (hosterror + APR_OS_START_SYSERR); -#endif -#else - return (h_errno + APR_OS_START_SYSERR); -#endif } } @@ -556,7 +546,7 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, /* don't know if it is portable for getnameinfo() to set h_errno; * clear it then see if it was set */ - SET_H_ERRNO(0); + apr_set_netos_error(0); /* default flags are NI_NAMREQD; otherwise, getnameinfo() will return * a numeric address string if it fails to resolve the host name; * that is *not* what we want here @@ -566,7 +556,10 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, flags != 0 ? flags : NI_NAMEREQD); if (rc != 0) { *hostname = NULL; - +#ifdef WIN32 + /* XXX and Netware? */ + return apr_get_netos_error(); +#else /* something went wrong. Look at the EAI_ error code */ if (rc != EAI_SYSTEM) { #if defined(NEGATIVE_EAI) @@ -577,13 +570,14 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, else { /* EAI_SYSTEM System error returned in errno. */ /* IMHO, Implementations that set h_errno a simply broken. */ - if (h_errno) { /* for broken implementations which set h_errno */ - return h_errno + APR_OS_START_SYSERR; + if (apr_get_netos_error()) { /* for broken implementations which set h_errno */ + return apr_get_netos_error(); } else { /* "normal" case */ - return errno + APR_OS_START_SYSERR; + return apr_get_os_error(); } } +#endif } *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, tmphostname); @@ -609,11 +603,19 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, sizeof(struct in_addr), AF_INET, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hptr, &hosterror); + if (!hptr) { + *hostname = NULL; + return hosterror + APR_OS_START_SYSERR; + } #else /* Solaris, Irix et alia */ hptr = gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, sizeof(struct in_addr), AF_INET, &hs, tmp, GETHOSTBYNAME_BUFLEN, &hosterror); + if (!hptr) { + *hostname = NULL; + return hosterror + APR_OS_START_SYSERR; + } #endif #else struct hostent *hptr; @@ -621,22 +623,12 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, sizeof(struct in_addr), AF_INET); #endif - if (hptr) { - *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, hptr->h_name); - return APR_SUCCESS; + if (!hptr) { + *hostname = NULL; + return apr_get_netos_error(); } - *hostname = NULL; -#if APR_HAS_THREADS && !defined(GETHOSTBYADDR_IS_THREAD_SAFE) && \ - defined(HAVE_GETHOSTBYADDR_R) && !defined(BEOS) && \ - !defined(GETHOSTBYNAME_R_HOSTENT_DATA) - return hosterror + APR_OS_START_SYSERR; -#elif defined(WIN32) - return apr_get_netos_error(); -#elif defined(OS2) - return h_errno; -#else - return h_errno + APR_OS_START_SYSERR; -#endif + *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, hptr->h_name); + return APR_SUCCESS; #endif } From 60f9f95f64fa7e11b40f8fcdce20d48ac859a458 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 13 Oct 2002 04:11:14 +0000 Subject: [PATCH 3896/7878] If we toggle APR_HAS_IPV6, we really need to use the new API. Toggling IPV6 this way really requires the November 2001 Platform SDK from MS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63915 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_private.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index cea7b97efc1..ac6150b39d7 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -177,5 +177,10 @@ APR_DECLARE_DATA int errno; #define ENOSPC 1 #endif +#if APR_HAVE_IPV6 +#define HAVE_GETADDRINFO 1 +#define HAVE_GETNAMEINFO 1 +#endif + #endif /*APR_PRIVATE_H*/ #endif /*WIN32*/ From 8c44755a0113b18da969b1ac7c4208c7377ab925 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 13 Oct 2002 04:56:57 +0000 Subject: [PATCH 3897/7878] Add a datafile for the MMAP test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63916 13f79535-47bb-0310-9956-ffa450edef68 --- test/data/mmap_datafile.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/data/mmap_datafile.txt diff --git a/test/data/mmap_datafile.txt b/test/data/mmap_datafile.txt new file mode 100644 index 00000000000..50f47a609ed --- /dev/null +++ b/test/data/mmap_datafile.txt @@ -0,0 +1 @@ +This is the MMAP data file. From 0ace95181624645b2f69ea5f5dbd881df5beb87b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 13 Oct 2002 05:28:15 +0000 Subject: [PATCH 3898/7878] Port testmmap to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63917 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 +- test/test_apr.h | 16 ++--- test/testall.c | 5 +- test/testmmap.c | 179 ++++++++++++++++++++++++++--------------------- 4 files changed, 109 insertions(+), 95 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index ec61caaec0f..13cc7d2edb9 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -209,8 +209,8 @@ testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) testtable@EXEEXT@: testtable.lo $(LOCAL_LIBS) $(LINK) testtable.lo $(LOCAL_LIBS) $(ALL_LIBS) -testall: testall.lo testtime.lo teststr.lo testvsn.lo CuTest.lo $(LOCAL_LIBS) - $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) +testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo CuTest.lo $(LOCAL_LIBS) + $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index 62a349ccc23..a38865ce923 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -52,23 +52,16 @@ * . */ -/* Some simple functions to make the test apps easier to write and - * a bit more consistent... - */ - -/* Things to bear in mind when using these... - * - * If you include '\t' within the string passed in it won't be included - * in the spacing, so use spaces instead :) - * - */ - #ifndef APR_TEST_INCLUDES #define APR_TEST_INCLUDES #include "CuTest.h" #include "apr_pools.h" +/* Some simple functions to make the test apps easier to write and + * a bit more consistent... + */ + extern apr_pool_t *p; CuSuite *getsuite(void); @@ -77,6 +70,7 @@ CuSuite *teststr(void); CuSuite *testtime(void); CuSuite *testvsn(void); CuSuite *testipsub(void); +CuSuite *testmmap(void); diff --git a/test/testall.c b/test/testall.c index c1827087e82..5bd08634875 100644 --- a/test/testall.c +++ b/test/testall.c @@ -57,7 +57,7 @@ #include "test_apr.h" -#define NUM_TESTS 4 +#define NUM_TESTS 5 apr_pool_t *p; @@ -67,7 +67,8 @@ testfunc *tests[NUM_TESTS] = { teststr, testtime, testvsn, - testipsub + testipsub, + testmmap }; int main(int argc, char *argv[]) diff --git a/test/testmmap.c b/test/testmmap.c index 72e252d0f56..bcd6ac4d580 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -52,100 +52,119 @@ * . */ +#include "test_apr.h" #include "apr_mmap.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_file_io.h" #include "apr_strings.h" -#if APR_HAVE_UNISTD_H -#include -#endif -#include -#include -#include /* hmmm, what is a truly portable define for the max path * length on a platform? */ #define PATH_LEN 255 -int main(void) +#if !APR_HAS_MMAP +static void not_implemented(CuTest *tc) +{ + CuNotImpl(tc, "User functions"); +} + +#else + +apr_mmap_t *themmap = NULL; +apr_file_t *thefile = NULL; +char *file1; +apr_finfo_t finfo; + +static void create_filename(CuTest *tc) +{ + char *oldfileptr; + + apr_filepath_get(&file1, 0, p); + CuAssertTrue(tc, file1[0] == '/'); + CuAssertTrue(tc, file1[strlen(file1) - 1] != '/'); + + oldfileptr = file1; + file1 = apr_pstrcat(p, file1,"/data/mmap_datafile.txt" ,NULL); + CuAssertTrue(tc, oldfileptr != file1); +} + +static void test_file_open(CuTest *tc) { -#if APR_HAS_MMAP - apr_pool_t *context; - apr_mmap_t *themmap = NULL; - apr_file_t *thefile = NULL; - apr_finfo_t finfo; - apr_int32_t flag = APR_READ; apr_status_t rv; - char *file1; - char errmsg[120]; - - fprintf (stdout,"APR MMAP Test\n*************\n\n"); - - fprintf(stdout,"Initializing........................"); - if (apr_initialize() != APR_SUCCESS) { - fprintf(stderr, "Failed.\n"); - exit(-1); - } - fprintf(stdout,"OK\n"); - atexit(apr_terminate); - - fprintf(stdout,"Creating context...................."); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - fprintf(stderr, "Failed.\n"); - exit(-1); - } - fprintf(stdout,"OK\n"); - - apr_filepath_get(&file1, 0, context); - file1 = apr_pstrcat(context,file1,"/testmmap",NULL); - - fprintf(stdout, "Opening file........................"); - rv = apr_file_open(&thefile, file1, flag, APR_UREAD | APR_GREAD, context); - if (rv != APR_SUCCESS) { - fprintf(stderr, - "couldn't open file `%s': %d/%s\n", - file1, rv, apr_strerror(rv, errmsg, sizeof errmsg)); - exit(-1); - } - else { - fprintf(stdout, "OK\n"); - } - - fprintf(stderr, "Getting file size..................."); + + rv = apr_file_open(&thefile, file1, APR_READ, APR_UREAD | APR_GREAD, p); + CuAssertIntEquals(tc, rv, APR_SUCCESS); + CuAssertPtrNotNull(tc, thefile); +} + +static void test_get_filesize(CuTest *tc) +{ + apr_status_t rv; + rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); - if (rv != APR_SUCCESS) { - fprintf(stderr, - "Didn't get file information: %d/%s\n", - rv, apr_strerror(rv, errmsg, sizeof errmsg)); - exit(-1); - } - else { - fprintf(stdout, "%d bytes\n", (int)finfo.size); - } - - fprintf(stdout,"Trying to mmap the file............."); - if (apr_mmap_create(&themmap, thefile, 0, finfo.size, APR_MMAP_READ, context) != APR_SUCCESS) { - fprintf(stderr,"Failed!\n"); - exit(-1); - } - fprintf(stdout,"OK\n"); - - fprintf(stdout,"Trying to delete the mmap file......"); - if (apr_mmap_delete(themmap) != APR_SUCCESS) { - fprintf(stderr,"Failed!\n"); - exit (-1); - } - fprintf(stdout,"OK\n"); - - fprintf (stdout,"\nTest Complete\n"); - - return 0; -#else - fprintf(stdout,"APR MMAP Test\n*************\n\n"); - fprintf(stdout,"Failed! APR was not built with MMAP.\n"); - return -1; + CuAssertIntEquals(tc, rv, APR_SUCCESS); + CuAssertIntEquals(tc, finfo.size, 28); +} + +static void test_mmap_create(CuTest *tc) +{ + apr_status_t rv; + + rv = apr_mmap_create(&themmap, thefile, 0, finfo.size, APR_MMAP_READ, p); + CuAssertPtrNotNull(tc, themmap); + CuAssertIntEquals(tc, rv, APR_SUCCESS); +} + +static void test_mmap_contents(CuTest *tc) +{ + CuAssertPtrNotNull(tc, themmap->mm); + CuAssertIntEquals(tc, themmap->size, 28); + CuAssertStrEquals(tc, themmap->mm, "This is the MMAP data file.\n"); +} + +static void test_mmap_delete(CuTest *tc) +{ + apr_status_t rv; + rv = apr_mmap_delete(themmap); + CuAssertIntEquals(tc, rv, APR_SUCCESS); +} + +static void test_mmap_offset(CuTest *tc) +{ + apr_status_t rv; + void *addr; + + rv = apr_mmap_offset(&addr, themmap, 5); + CuAssertStrEquals(tc, addr, "This is the MMAP data file.\n" + 5); +} #endif + +CuSuite *testmmap(void) +{ + CuSuite *suite = CuSuiteNew("Test MMAP"); + +#if APR_HAS_MMAP + SUITE_ADD_TEST(suite, create_filename); + SUITE_ADD_TEST(suite, test_file_open); + SUITE_ADD_TEST(suite, test_get_filesize); + SUITE_ADD_TEST(suite, test_mmap_create); + SUITE_ADD_TEST(suite, test_mmap_contents); + SUITE_ADD_TEST(suite, test_mmap_offset); + SUITE_ADD_TEST(suite, test_mmap_delete); +#else + SUITE_ADD_TEST(suite, not_implemented); +#endif + + return suite; } + +#ifdef SINGLE_PROG +CuSuite *getsuite(void) +{ + return testmmap(); +} +#endif + From 713d154806cc018e86a8f1b0ddb66b8cd475e584 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 13 Oct 2002 18:13:49 +0000 Subject: [PATCH 3899/7878] Ignore goodness for VC7 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63918 13f79535-47bb-0310-9956-ffa450edef68 --- build/.cvsignore | 3 +++ test/.cvsignore | 3 +++ 2 files changed, 6 insertions(+) diff --git a/build/.cvsignore b/build/.cvsignore index 397247c1c22..85433cc343c 100644 --- a/build/.cvsignore +++ b/build/.cvsignore @@ -5,6 +5,9 @@ ltmain.sh rules.mk LibD LibR +Debug +Release +*.vcproj *.aps *.plg *.dep diff --git a/test/.cvsignore b/test/.cvsignore index 439041f645c..795cbd06ef7 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -41,6 +41,9 @@ aprtest aprtest.ncb aprtest.opt aprtest.plg +aprtest.sln +aprtest.suo +aprtest.vcproj testfile.tmp testflock testsockopt From 6c23318f3d61251cc92d4f027610a1a3c1250ce7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 13 Oct 2002 22:25:09 +0000 Subject: [PATCH 3900/7878] disconnected is determined in the while (bytes_to_send) {} logic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63919 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index ed40a4f9720..0fd02a43768 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -409,7 +409,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, * Note: The application must have stored the socket prior to making * the call to apr_sendfile in order to either reuse it or close it. */ - if (flags & APR_SENDFILE_DISCONNECT_SOCKET) { + if (disconnected) { sock->disconnected = 1; sock->socketdes = INVALID_SOCKET; } From 88b29afafb478d37cf26d5bd7f5c41580c777a8c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 13 Oct 2002 23:28:22 +0000 Subject: [PATCH 3901/7878] First, revert my changes from yesterday to make Jeff Trawick's suggestions simpler to follow. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63920 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 80 ++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 9ff06fd730d..f8d1c0d7df7 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -85,6 +85,16 @@ struct apr_ipsubnet_t { #endif }; +#ifndef NETWARE +#ifdef HAVE_SET_H_ERRNO +#define SET_H_ERRNO(newval) set_h_errno(newval) +#else +#define SET_H_ERRNO(newval) h_errno = (newval) +#endif +#else +#define SET_H_ERRNO(newval) +#endif + #if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ defined(HAVE_GETHOSTBYNAME_R) /* This is the maximum size that may be returned from the reentrant @@ -326,12 +336,8 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, hints.ai_socktype = SOCK_STREAM; error = getaddrinfo(hostname, NULL, &hints, &ai_list); if (error) { -#ifdef WIN32 - /* XXX Netware also??? */ - return apr_get_netos_error(); -#else if (error == EAI_SYSTEM) { - return apr_get_os_error(); + return errno; } else { /* issues with representing this with APR's error scheme: @@ -344,7 +350,6 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, #endif return error + APR_OS_START_EAIERR; } -#endif } prev_sa = NULL; @@ -418,8 +423,6 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, #ifdef GETHOSTBYNAME_R_HOSTENT_DATA struct hostent_data hd; #else - /* If you see ERANGE, that means GETHOSBYNAME_BUFLEN needs to be - * bumped. */ char tmp[GETHOSTBYNAME_BUFLEN]; #endif int hosterror; @@ -448,23 +451,30 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, /* Linux glibc2+ */ gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hp, &hosterror); - if (!hp) { - return (hosterror + APR_OS_START_SYSERR); - } #else /* Solaris, Irix et alia */ hp = gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hosterror); - if (!hp) { - return (hosterror + APR_OS_START_SYSERR); - } #endif #else hp = gethostbyname(hostname); #endif if (!hp) { +#ifdef WIN32 return apr_get_netos_error(); +#elif APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ + defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) +#ifdef GETHOSTBYNAME_R_HOSTENT_DATA + return (h_errno + APR_OS_START_SYSERR); +#else + /* If you see ERANGE, that means GETHOSBYNAME_BUFLEN needs to be + * bumped. */ + return (hosterror + APR_OS_START_SYSERR); +#endif +#else + return (h_errno + APR_OS_START_SYSERR); +#endif } } @@ -546,7 +556,7 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, /* don't know if it is portable for getnameinfo() to set h_errno; * clear it then see if it was set */ - apr_set_netos_error(0); + SET_H_ERRNO(0); /* default flags are NI_NAMREQD; otherwise, getnameinfo() will return * a numeric address string if it fails to resolve the host name; * that is *not* what we want here @@ -556,10 +566,7 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, flags != 0 ? flags : NI_NAMEREQD); if (rc != 0) { *hostname = NULL; -#ifdef WIN32 - /* XXX and Netware? */ - return apr_get_netos_error(); -#else + /* something went wrong. Look at the EAI_ error code */ if (rc != EAI_SYSTEM) { #if defined(NEGATIVE_EAI) @@ -570,14 +577,13 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, else { /* EAI_SYSTEM System error returned in errno. */ /* IMHO, Implementations that set h_errno a simply broken. */ - if (apr_get_netos_error()) { /* for broken implementations which set h_errno */ - return apr_get_netos_error(); + if (h_errno) { /* for broken implementations which set h_errno */ + return h_errno + APR_OS_START_SYSERR; } else { /* "normal" case */ - return apr_get_os_error(); + return errno + APR_OS_START_SYSERR; } } -#endif } *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, tmphostname); @@ -603,19 +609,11 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, sizeof(struct in_addr), AF_INET, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hptr, &hosterror); - if (!hptr) { - *hostname = NULL; - return hosterror + APR_OS_START_SYSERR; - } #else /* Solaris, Irix et alia */ hptr = gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, sizeof(struct in_addr), AF_INET, &hs, tmp, GETHOSTBYNAME_BUFLEN, &hosterror); - if (!hptr) { - *hostname = NULL; - return hosterror + APR_OS_START_SYSERR; - } #endif #else struct hostent *hptr; @@ -623,12 +621,22 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, sizeof(struct in_addr), AF_INET); #endif - if (!hptr) { - *hostname = NULL; - return apr_get_netos_error(); + if (hptr) { + *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, hptr->h_name); + return APR_SUCCESS; } - *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, hptr->h_name); - return APR_SUCCESS; + *hostname = NULL; +#if APR_HAS_THREADS && !defined(GETHOSTBYADDR_IS_THREAD_SAFE) && \ + defined(HAVE_GETHOSTBYADDR_R) && !defined(BEOS) && \ + !defined(GETHOSTBYNAME_R_HOSTENT_DATA) + return hosterror + APR_OS_START_SYSERR; +#elif defined(WIN32) + return apr_get_netos_error(); +#elif defined(OS2) + return h_errno; +#else + return h_errno + APR_OS_START_SYSERR; +#endif #endif } From 5a0da1ad4d8c56cb8d2c82e11d39f37382c9286e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 13 Oct 2002 23:41:50 +0000 Subject: [PATCH 3902/7878] Make the code legible. Now note the OS2 discrepancy in handling h_errno between the gethostbyname and gethostbyaddr calls. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63921 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index f8d1c0d7df7..32c87cc5763 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -423,6 +423,8 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, #ifdef GETHOSTBYNAME_R_HOSTENT_DATA struct hostent_data hd; #else + /* If you see ERANGE, that means GETHOSBYNAME_BUFLEN needs to be + * bumped. */ char tmp[GETHOSTBYNAME_BUFLEN]; #endif int hosterror; @@ -447,7 +449,8 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, /* AIX, HP/UX, D/UX et alia */ gethostbyname_r(hostname, &hs, &hd); hp = &hs; -#elif defined(GETHOSTBYNAME_R_GLIBC2) +#else +#if defined(GETHOSTBYNAME_R_GLIBC2) /* Linux glibc2+ */ gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hp, &hosterror); @@ -455,23 +458,18 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, /* Solaris, Irix et alia */ hp = gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hosterror); -#endif +#endif /* !defined(GETHOSTBYNAME_R_GLIBC2) */ + if (!hp) { + return (hosterror + APR_OS_START_SYSERR); + } +#endif /* !defined(GETHOSTBYNAME_R_HOSTENT_DATA) */ #else hp = gethostbyname(hostname); #endif - if (!hp) { + if (!hp) { #ifdef WIN32 return apr_get_netos_error(); -#elif APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ - defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) -#ifdef GETHOSTBYNAME_R_HOSTENT_DATA - return (h_errno + APR_OS_START_SYSERR); -#else - /* If you see ERANGE, that means GETHOSBYNAME_BUFLEN needs to be - * bumped. */ - return (hosterror + APR_OS_START_SYSERR); -#endif #else return (h_errno + APR_OS_START_SYSERR); #endif @@ -604,7 +602,8 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, sizeof(struct in_addr), AF_INET, &hs, &hd); hptr = &hs; -#elif defined(GETHOSTBYNAME_R_GLIBC2) +#else +#if defined(GETHOSTBYNAME_R_GLIBC2) /* Linux glibc2+ */ gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, sizeof(struct in_addr), AF_INET, @@ -614,7 +613,12 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, hptr = gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, sizeof(struct in_addr), AF_INET, &hs, tmp, GETHOSTBYNAME_BUFLEN, &hosterror); -#endif +#endif /* !defined(GETHOSTBYNAME_R_GLIBC2) */ + if (!hptr) { + *hostname = NULL; + return hosterror + APR_OS_START_SYSERR; + } +#endif /* !defined(GETHOSTBYNAME_R_HOSTENT_DATA) */ #else struct hostent *hptr; hptr = gethostbyaddr((char *)&sockaddr->sa.sin.sin_addr, @@ -626,11 +630,7 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, return APR_SUCCESS; } *hostname = NULL; -#if APR_HAS_THREADS && !defined(GETHOSTBYADDR_IS_THREAD_SAFE) && \ - defined(HAVE_GETHOSTBYADDR_R) && !defined(BEOS) && \ - !defined(GETHOSTBYNAME_R_HOSTENT_DATA) - return hosterror + APR_OS_START_SYSERR; -#elif defined(WIN32) +#if defined(WIN32) return apr_get_netos_error(); #elif defined(OS2) return h_errno; From 531a832cdf45a48fd456b7bfa37d50555331b5d1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 13 Oct 2002 23:43:48 +0000 Subject: [PATCH 3903/7878] Just a nit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63922 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index abec8154186..efdbdc6535d 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -325,7 +325,7 @@ static char *apr_os_strerror(char *buf, apr_size_t bufsize, apr_status_t errcode #else /* On Unix, apr_os_strerror() handles error codes from the resolver * (h_errno). - e*/ + */ static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) { #ifdef HAVE_HSTRERROR From 81c7ae4c6e0ff1314e4a504e3aa12762887c5e20 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 13 Oct 2002 23:55:46 +0000 Subject: [PATCH 3904/7878] I believe this is correct... would three platform folks holler from the Unix, OS2 and Netware camps that this looks good? We aren't trying to deal with h_errno here, only the socket errno values. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63923 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 58 ++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index d9c5a272c9c..ac61450cf88 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -113,24 +113,14 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, /** * @def apr_get_os_error() - * @return apr_status_t the last platform error, folded into apr_status_t, on some platforms + * @return apr_status_t the last platform error, folded into apr_status_t, on most platforms * @remark This retrieves errno, or calls a GetLastError() style function, and * folds it with APR_FROM_OS_ERROR. Some platforms (such as OS2) have no - * such mechanism, so this call may be unsupported. Some platforms - * require the alternate apr_get_netos_error() to retrieve the last - * socket error. - */ -#define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) - -/** - * Return the last socket error, folded into apr_status_t, on some platforms - * @deffunc apr_status_t apr_get_netos_error() - * @tip This retrieves errno, h_errno, or calls a GetLastSocketError() style - * function, and folds it with APR_FROM_OS_ERROR. Some platforms (such - * as OS2) have no such mechanism, so this call may be unsupported. + * such mechanism, so this call may be unsupported. Do NOT use this + * call for socket errors from socket, send, recv etc! */ +#define apr_get_os_error() -#define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) /** * Reset the last platform error, unfolded from an apr_status_t, on some platforms * @param statcode The OS error folded in a prior call to APR_FROM_OS_ERROR() @@ -142,8 +132,30 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * with APR_TO_OS_ERROR. Some platforms (such as OS2) have no such * mechanism, so this call may be unsupported. */ -#define apr_set_os_error() (APR_FROM_OS_ERROR(WSAGetLastError())) -#endif +#define apr_set_os_error(statcode) + +/** + * Return the last socket error, folded into apr_status_t, on all platforms + * @deffunc apr_status_t apr_get_netos_error() + * @tip This retrieves errno or calls a GetLastSocketError() style function, + * and folds it with APR_FROM_OS_ERROR. + */ +#define apr_get_netos_error() + +/** + * Reset the last socket error, unfolded from an apr_status_t + * @param socketcode The socket error folded in a prior call to APR_FROM_OS_ERROR() + * @deffunc void apr_set_os_error(apr_status_t statcode) + * @tip Warning: macro implementation; the statcode argument may be evaluated + * multiple times. If the statcode was not created by apr_get_os_error + * or APR_FROM_OS_ERROR, the results are undefined. This macro sets + * errno, or calls a WSASetLastError() style function, unfolding + * socketcode with APR_TO_OS_ERROR. + */ +#define apr_set_netos_error(socketcode) + +#endif /* defined(DOXYGEN) */ + /** * APR_OS_START_ERROR is where the APR specific error values start. */ @@ -780,10 +792,10 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) */ -/* A special case, only socket calls require this: +/* A special case, only socket calls require this; */ -define apr_get_netos_error() (APR_FROM_OS_ERROR(h_errno)) -define apr_set_netos_error(e) (h_errno = APR_TO_OS_ERROR(e))) +#define apr_get_netos_error() (APR_FROM_OS_ERROR(errno)) +#define apr_set_netos_error(e) (errno = APR_TO_OS_ERROR(e)) /* And this needs to be greped away for good: */ @@ -1108,12 +1120,8 @@ define apr_set_netos_error(e) (h_errno = APR_TO_OS_ERROR(e))) /* A special case, only socket calls require this: */ -#define apr_get_netos_error() (h_errno) -#ifdef HAVE_SET_H_ERRNO -#define apr_set_netos_error(e) set_h_errno(e) -#else -#define apr_set_netos_error(e) (h_errno = (e)) -#endif +#define apr_get_netos_error() (errno) +#define apr_set_netos_error(e) (errno = (e)) /** no error */ #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) From 788c6c732a11a2dceabb3de1897e2bb185c976a8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 14 Oct 2002 00:03:46 +0000 Subject: [PATCH 3905/7878] Use EAI results on Win32 for the moment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63924 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 32c87cc5763..3431fc13f6e 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -85,7 +85,7 @@ struct apr_ipsubnet_t { #endif }; -#ifndef NETWARE +#if !defined(NETWARE) && !defined(WIN32) #ifdef HAVE_SET_H_ERRNO #define SET_H_ERRNO(newval) set_h_errno(newval) #else @@ -336,10 +336,13 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, hints.ai_socktype = SOCK_STREAM; error = getaddrinfo(hostname, NULL, &hints, &ai_list); if (error) { +#ifndef WIN32 if (error == EAI_SYSTEM) { return errno; } - else { + else +#endif + { /* issues with representing this with APR's error scheme: * glibc uses negative values for these numbers, perhaps so * they don't conflict with h_errno values... Tru64 uses @@ -565,14 +568,9 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, if (rc != 0) { *hostname = NULL; +#ifndef WIN32 /* something went wrong. Look at the EAI_ error code */ - if (rc != EAI_SYSTEM) { -#if defined(NEGATIVE_EAI) - if (rc < 0) rc = -rc; -#endif - return rc + APR_OS_START_EAIERR; /* return the EAI_ error */ - } - else { + if (rc == EAI_SYSTEM) { /* EAI_SYSTEM System error returned in errno. */ /* IMHO, Implementations that set h_errno a simply broken. */ if (h_errno) { /* for broken implementations which set h_errno */ @@ -582,6 +580,14 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, return errno + APR_OS_START_SYSERR; } } + else +#endif + { +#if defined(NEGATIVE_EAI) + if (rc < 0) rc = -rc; +#endif + return rc + APR_OS_START_EAIERR; /* return the EAI_ error */ + } } *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, tmphostname); From f48cb85fe4420f06ca295c346ede61d50da3138b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 14 Oct 2002 17:40:10 +0000 Subject: [PATCH 3906/7878] Allow sendfile semantics to be requested for a given file. While this flag is strictly advisory (and doesn't affect apr_sendrecv sendfile support) it allows the library consumer to set and retrieve the flag through apr_file_flags_get(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63925 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 19 +++++++++++++++++-- include/apr_file_io.h | 7 +++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 99981bb50ca..9f001cd7a58 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -339,11 +339,19 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, */ attributes |= FILE_FLAG_OVERLAPPED; } - #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { apr_wchar_t wfname[APR_PATH_MAX]; + + if (flag & APR_OPEN_FOR_SENDFILE) { + /* This feature is required to enable sendfile operations + * against the file on Win32. Also implies APR_XTHREAD. + */ + flag |= APR_XTHREAD; + attributes |= FILE_FLAG_SEQUENTIAL_SCAN | FILE_FLAG_OVERLAPPED; + } + if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) / sizeof(apr_wchar_t), fname)) return rv; @@ -352,9 +360,16 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, } #endif #if APR_HAS_ANSI_FS - ELSE_WIN_OS_IS_ANSI + ELSE_WIN_OS_IS_ANSI { handle = CreateFileA(fname, oflags, sharemode, NULL, createflags, attributes, 0); + if (flag & APR_OPEN_FOR_SENDFILE) { + /* This feature is not supported on this platform. + */ + flag &= ~APR_OPEN_FOR_SENDFILE; + } + + } #endif if (handle == INVALID_HANDLE_VALUE) { return apr_get_os_error(); diff --git a/include/apr_file_io.h b/include/apr_file_io.h index b9de5d75b3b..378d64b7e67 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -103,7 +103,8 @@ extern "C" { writes across process/machines */ #define APR_FILE_NOCLEANUP 2048 /**< Do not register a cleanup when the file is opened */ - +#define APR_OPEN_FOR_SENDFILE 4096 /**< Open with appropriate semantics for + apr_sendfile operation */ /** @} */ /** @@ -184,7 +185,9 @@ typedef struct apr_file_t apr_file_t; * APR_FILE_NOCLEANUP Do not register a cleanup with the pool * passed in on the cont argument (see below). * The apr_os_file_t handle in apr_file_t will not - & be closed when the pool is destroyed. + * be closed when the pool is destroyed. + * APR_OPEN_FOR_SENDFILE Open with appropriate platform semantics + * for sendfile operations. * * @param perm Access permissions for file. * @param cont The pool to use. From 3478bf3bec60ff1c74d50cda51c6fb98aef9d3e2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 14 Oct 2002 20:05:58 +0000 Subject: [PATCH 3907/7878] I really disliked this identifier, found a better one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63926 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 6 +++--- include/apr_file_io.h | 44 +++++++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 9f001cd7a58..9a27e19bdfe 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -344,7 +344,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, { apr_wchar_t wfname[APR_PATH_MAX]; - if (flag & APR_OPEN_FOR_SENDFILE) { + if (flag & APR_SENDFILE_ENABLED) { /* This feature is required to enable sendfile operations * against the file on Win32. Also implies APR_XTHREAD. */ @@ -363,10 +363,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, ELSE_WIN_OS_IS_ANSI { handle = CreateFileA(fname, oflags, sharemode, NULL, createflags, attributes, 0); - if (flag & APR_OPEN_FOR_SENDFILE) { + if (flag & APR_SENDFILE_ENABLED) { /* This feature is not supported on this platform. */ - flag &= ~APR_OPEN_FOR_SENDFILE; + flag &= ~APR_SENDFILE_ENABLED; } } diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 378d64b7e67..a5da3d42ef1 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -103,7 +103,7 @@ extern "C" { writes across process/machines */ #define APR_FILE_NOCLEANUP 2048 /**< Do not register a cleanup when the file is opened */ -#define APR_OPEN_FOR_SENDFILE 4096 /**< Open with appropriate semantics for +#define APR_SENDFILE_ENABLED 4096 /**< Open with appropriate semantics for apr_sendfile operation */ /** @} */ @@ -167,27 +167,27 @@ typedef struct apr_file_t apr_file_t; * @param fname The full path to the file (using / on all systems) * @param flag Or'ed value of: *
    - *           APR_READ             open for reading
    - *           APR_WRITE            open for writing
    - *           APR_CREATE           create the file if not there
    - *           APR_APPEND           file ptr is set to end prior to all writes
    - *           APR_TRUNCATE         set length to zero if file exists
    - *           APR_BINARY           not a text file (This flag is ignored on 
    - *                                UNIX because it has no meaning)
    - *           APR_BUFFERED         buffer the data.  Default is non-buffered
    - *           APR_EXCL             return error if APR_CREATE and file exists
    - *           APR_DELONCLOSE       delete the file after closing.
    - *           APR_XTHREAD          Platform dependent tag to open the file
    - *                                for use across multiple threads
    - *           APR_SHARELOCK        Platform dependent support for higher
    - *                                level locked read/write access to support
    - *                                writes across process/machines
    - *           APR_FILE_NOCLEANUP   Do not register a cleanup with the pool 
    - *                                passed in on the cont argument (see below).
    - *                                The apr_os_file_t handle in apr_file_t will not
    - *                                be closed when the pool is destroyed.
    - *           APR_OPEN_FOR_SENDFILE  Open with appropriate platform semantics
    - *                                for sendfile operations.
    + *         APR_READ              open for reading
    + *         APR_WRITE             open for writing
    + *         APR_CREATE            create the file if not there
    + *         APR_APPEND            file ptr is set to end prior to all writes
    + *         APR_TRUNCATE          set length to zero if file exists
    + *         APR_BINARY            not a text file (This flag is ignored on 
    + *                               UNIX because it has no meaning)
    + *         APR_BUFFERED          buffer the data.  Default is non-buffered
    + *         APR_EXCL              return error if APR_CREATE and file exists
    + *         APR_DELONCLOSE        delete the file after closing.
    + *         APR_XTHREAD           Platform dependent tag to open the file
    + *                               for use across multiple threads
    + *         APR_SHARELOCK         Platform dependent support for higher
    + *                               level locked read/write access to support
    + *                               writes across process/machines
    + *         APR_FILE_NOCLEANUP    Do not register a cleanup with the pool 
    + *                               passed in on the cont argument (see below).
    + *                               The apr_os_file_t handle in apr_file_t will not
    + *                               be closed when the pool is destroyed.
    + *         APR_SENDFILE_ENABLED  Open with appropriate platform semantics
    + *                               for sendfile operations.
      * 
    * @param perm Access permissions for file. * @param cont The pool to use. From 6f7cd29bbb97077950a244cd7e360018881717fd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 14 Oct 2002 20:07:33 +0000 Subject: [PATCH 3908/7878] Better docs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63927 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index a5da3d42ef1..2074d2a60e9 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -103,8 +103,8 @@ extern "C" { writes across process/machines */ #define APR_FILE_NOCLEANUP 2048 /**< Do not register a cleanup when the file is opened */ -#define APR_SENDFILE_ENABLED 4096 /**< Open with appropriate semantics for - apr_sendfile operation */ +#define APR_SENDFILE_ENABLED 4096 /**< Advisory flag that this file should + support apr_sendfile operation */ /** @} */ /** @@ -187,7 +187,8 @@ typedef struct apr_file_t apr_file_t; * The apr_os_file_t handle in apr_file_t will not * be closed when the pool is destroyed. * APR_SENDFILE_ENABLED Open with appropriate platform semantics - * for sendfile operations. + * for sendfile operations. Advisory only, + * apr_sendfile does not check this flag. * * @param perm Access permissions for file. * @param cont The pool to use. From 0c63c9b56d062614c71323ff7e7ee5c26c097295 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 15 Oct 2002 04:10:31 +0000 Subject: [PATCH 3909/7878] Change kibitz to a better kibitz. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63928 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 3431fc13f6e..d7856326a0a 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -474,7 +474,20 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, #ifdef WIN32 return apr_get_netos_error(); #else - return (h_errno + APR_OS_START_SYSERR); + switch (h_errno) { +#ifdef NETDB_INTERNAL + NETDB_INTERNAL: + return APR_FROM_OS_ERROR(errno); + HOST_NOT_FOUND: + return APR_EHOSTUNREACH; + NO_DATA: + return APR_E; + NO_RECOVERY: + return APR_EHOSTUNREACH; + TRY_AGAIN: + return APR_EAGAIN; + } + /* return (h_errno + APR_OS_START_SYSERR); */ #endif } } From e44a95eb400338d19ee1b66555df1c28410cd13f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 15 Oct 2002 11:06:36 +0000 Subject: [PATCH 3910/7878] get sa_common.c to compile again git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63929 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index d7856326a0a..579935c0aaf 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -478,6 +478,7 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, #ifdef NETDB_INTERNAL NETDB_INTERNAL: return APR_FROM_OS_ERROR(errno); +#endif HOST_NOT_FOUND: return APR_EHOSTUNREACH; NO_DATA: From 5d03950a93f5772852d8d42020aea1e9ec033f86 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 15 Oct 2002 11:19:00 +0000 Subject: [PATCH 3911/7878] get it to compile (hopefully) on some systems without getaddrinfo() related trivia: disabling getaddrinfo() support on Linux has failed for some time because the correct reentrant gethostbyname flavor isn't being used or it is coded incorrectly git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63930 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 579935c0aaf..26939b86242 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -476,16 +476,16 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, #else switch (h_errno) { #ifdef NETDB_INTERNAL - NETDB_INTERNAL: + case NETDB_INTERNAL: return APR_FROM_OS_ERROR(errno); #endif - HOST_NOT_FOUND: + case HOST_NOT_FOUND: return APR_EHOSTUNREACH; - NO_DATA: - return APR_E; - NO_RECOVERY: + case NO_DATA: + return 11111 /* APR_E */; + case NO_RECOVERY: return APR_EHOSTUNREACH; - TRY_AGAIN: + case TRY_AGAIN: return APR_EAGAIN; } /* return (h_errno + APR_OS_START_SYSERR); */ From 97217e81e0bb6eaaa3ccc340cae9cd21720548d3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 15 Oct 2002 12:27:38 +0000 Subject: [PATCH 3912/7878] Didn't intend to commit this. Was attempting to commit comments on another file. Bahhh ... more sleep would be good. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63931 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 26939b86242..3431fc13f6e 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -474,21 +474,7 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, #ifdef WIN32 return apr_get_netos_error(); #else - switch (h_errno) { -#ifdef NETDB_INTERNAL - case NETDB_INTERNAL: - return APR_FROM_OS_ERROR(errno); -#endif - case HOST_NOT_FOUND: - return APR_EHOSTUNREACH; - case NO_DATA: - return 11111 /* APR_E */; - case NO_RECOVERY: - return APR_EHOSTUNREACH; - case TRY_AGAIN: - return APR_EAGAIN; - } - /* return (h_errno + APR_OS_START_SYSERR); */ + return (h_errno + APR_OS_START_SYSERR); #endif } } From 953350cf70b509316fefab163be732137b5c8182 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 15 Oct 2002 20:47:11 +0000 Subject: [PATCH 3913/7878] fix some AC_MSG_RESULT()s to not include double quotes, e.g. checking if APR supports IPv6... "yes" and also removes the stray semi-colons. Submitted by: Joe Orton Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63932 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 8cd59faa24c..a1d99a160e0 100644 --- a/configure.in +++ b/configure.in @@ -1771,25 +1771,25 @@ APR_CHECK_SOCKADDR_IN6 AC_MSG_CHECKING(if APR supports IPv6) have_ipv6="0" if test "$user_disabled_ipv6" = 1; then - AC_MSG_RESULT("no -- disabled by user") + AC_MSG_RESULT([no -- disabled by user]) else if test "x$broken_ipv6" = "x0"; then if test "x$have_sockaddr_in6" = "x1"; then if test "x$ac_cv_working_getaddrinfo" = "xyes"; then if test "x$ac_cv_working_getnameinfo" = "xyes"; then have_ipv6="1" - AC_MSG_RESULT("yes") + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT("no -- no getnameinfo") + AC_MSG_RESULT([no -- no getnameinfo]) fi else - AC_MSG_RESULT("no -- no working getaddrinfo") + AC_MSG_RESULT([no -- no working getaddrinfo]) fi else - AC_MSG_RESULT("no -- no sockaddr_in6"); + AC_MSG_RESULT([no -- no sockaddr_in6]) fi else - AC_MSG_RESULT("no -- the platform has problems supporting IPv6"); + AC_MSG_RESULT([no -- the platform has problems supporting IPv6]) fi fi From 492597c1989d5b390e40a044fb7373f722738b27 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 16 Oct 2002 11:36:33 +0000 Subject: [PATCH 3914/7878] Don't use whitespace before preprocessor directives in the configure logic. Such whitespace breaks with some older preprocessors; a particularly nasty break occurs on Tru64 4.0f where APR_CHECK_DEFINE will always suceed. Submitted by: Joe Orton Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63933 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ build/apr_common.m4 | 24 ++++++++++++------------ configure.in | 26 +++++++++++++------------- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/CHANGES b/CHANGES index 579cea64c23..1f29c02478e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR 0.9.2 + *) Don't use whitespace before preprocessor directives in the configure + logic. Such whitespace breaks with some older preprocessors; a + particularly nasty break occurs on Tru64 4.0f where APR_CHECK_DEFINE + will always suceed. [Joe Orton ] + *) Add APR_IPV4_ADDR_OK flag to apr_sockaddr_info_get() to allow apps to avoid lookup of IPv6 address if IPv4 address is sufficient. (New APR_IPV6_ADDR_OK flag is similar.) [Jeff Trawick] diff --git a/build/apr_common.m4 b/build/apr_common.m4 index c46a03eedc0..0210e83715b 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -235,10 +235,10 @@ AC_DEFUN(APR_CHECK_DEFINE_FILES,[ for curhdr in $2 do AC_EGREP_CPP(YES_IS_DEFINED, [ - #include <$curhdr> - #ifdef $1 - YES_IS_DEFINED - #endif +#include <$curhdr> +#ifdef $1 +YES_IS_DEFINED +#endif ], ac_cv_define_$1=yes) done ]) @@ -254,10 +254,10 @@ dnl AC_DEFUN(APR_CHECK_DEFINE,[ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ AC_EGREP_CPP(YES_IS_DEFINED, [ - #include <$2> - #ifdef $1 - YES_IS_DEFINED - #endif +#include <$2> +#ifdef $1 +YES_IS_DEFINED +#endif ], ac_cv_define_$1=yes, ac_cv_define_$1=no) ]) if test "$ac_cv_define_$1" = "yes"; then @@ -270,10 +270,10 @@ dnl APR_CHECK_APR_DEFINE( symbol, path_to_apr ) dnl AC_DEFUN(APR_CHECK_APR_DEFINE,[ AC_EGREP_CPP(YES_IS_DEFINED, [ - #include "$2/include/apr.h" - #if $1 - YES_IS_DEFINED - #endif +#include "$2/include/apr.h" +#if $1 +YES_IS_DEFINED +#endif ], ac_cv_define_$1=yes, ac_cv_define_$1=no) ]) diff --git a/configure.in b/configure.in index a1d99a160e0..1ee49a9672c 100644 --- a/configure.in +++ b/configure.in @@ -542,15 +542,15 @@ else dnl # but keeps the pthread_rwlock_t structure hidden unless dnl # special things are defined. AC_TRY_COMPILE([#include - #include ], +#include ], [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;], ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no) if test "$ac_cv_struct_pthread_rw" = "no"; then AC_TRY_COMPILE([#define _XOPEN_SOURCE 500 - #define _BSD_SOURCE - #define _SVID_SOURCE - #include - #include ], +#define _BSD_SOURCE +#define _SVID_SOURCE +#include +#include ], [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;], ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no) if test "$ac_cv_struct_pthread_rw" = "yes"; then @@ -1411,8 +1411,8 @@ if test "$threads" = "1"; then dnl Linux and older versions of AIX have this problem. APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, AC_TRY_RUN([ - #include - #include +#include +#include int main() { pthread_mutex_t mutex; @@ -1434,8 +1434,8 @@ if test "$threads" = "1"; then AC_CHECK_FUNCS(pthread_mutexattr_setrobust_np) if test "$ac_cv_func_pthread_mutexattr_setrobust_np" = "no"; then AC_TRY_COMPILE([#define _POSIX_THREAD_PRIO_INHERIT - #include - #include ],[ +#include +#include ],[ int main() { pthread_mutex_t mutex; @@ -1706,10 +1706,10 @@ else case $host in *linux*) AC_EGREP_CPP(yes,[ - #include - #ifdef TCP_CORK - yes - #endif +#include +#ifdef TCP_CORK +yes +#endif ],[ apr_tcp_nopush_flag="3" have_corkable_tcp="1" From da52cddb8e293e0e88fbf4ae010093291c48d090 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 16 Oct 2002 11:46:14 +0000 Subject: [PATCH 3915/7878] Fix the detection of INT64_C() when defined in . Submitted by: Joe Orton Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63934 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 35 ++++++++++++++++------------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGES b/CHANGES index 1f29c02478e..1c198d39825 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.2 + *) Fix the detection of INT64_C() when defined in . + [Joe Orton ] + *) Don't use whitespace before preprocessor directives in the configure logic. Such whitespace breaks with some older preprocessors; a particularly nasty break occurs on Tru64 4.0f where APR_CHECK_DEFINE diff --git a/configure.in b/configure.in index 1ee49a9672c..ea00a029ad9 100644 --- a/configure.in +++ b/configure.in @@ -1093,29 +1093,26 @@ else int64_t_fmt_len='#error Can not determine the proper size for apr_int64_t' fi -dnl # If present, allow the C99 macro INT64_C to override our conversion. -dnl # -dnl # HP-UX's ANSI C compiler provides this without any includes, so we -dnl # will first look for INT64_C without adding stdint.h -AC_MSG_CHECKING(for INT64_C) -stdint=0 +# If present, allow the C99 macro INT64_C to override our conversion. +# +# HP-UX's ANSI C compiler provides this without any includes, so we +# will first look for INT64_C without adding stdint.h +AC_CACHE_CHECK([for INT64_C], [apr_cv_define_INT64_C], [ AC_EGREP_CPP(YES_IS_DEFINED, [#ifdef INT64_C YES_IS_DEFINED -#endif -], -[ ac_cv_define_INT64_C=yes - AC_MSG_RESULT(yes) -], -[ ac_cv_define_INT64_C=no - AC_MSG_RESULT(no) - APR_CHECK_DEFINE(INT64_C, stdint.h) - if test "$ac_cv_define_INT64_C" = "yes"; then - stdint=1 - fi -]) -if test "$ac_cv_define_INT64_C" = "yes"; then +#endif], [apr_cv_define_INT64_C=yes], [ + # Now check for INT64_C in stdint.h + AC_EGREP_CPP(YES_IS_DEFINED, [#include +#ifdef INT64_C +YES_IS_DEFINED +#endif], [apr_cv_define_INT64_C=yes], [apr_cv_define_INT64_C=no])])]) + +if test "$apr_cv_define_INT64_C" = "yes"; then int64_literal='#define APR_INT64_C(val) INT64_C(val)' + stdint=1 +else + stdint=0 fi if test "$ac_cv_type_off_t" = "yes"; then From 4285441deff8d8f0ba6c4f751ee51d05996dcc0f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 16 Oct 2002 11:47:53 +0000 Subject: [PATCH 3916/7878] fix a mispelling in a recent change entry git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63935 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 1c198d39825..2c19381e32b 100644 --- a/CHANGES +++ b/CHANGES @@ -6,7 +6,7 @@ Changes with APR 0.9.2 *) Don't use whitespace before preprocessor directives in the configure logic. Such whitespace breaks with some older preprocessors; a particularly nasty break occurs on Tru64 4.0f where APR_CHECK_DEFINE - will always suceed. [Joe Orton ] + will always succeed. [Joe Orton ] *) Add APR_IPV4_ADDR_OK flag to apr_sockaddr_info_get() to allow apps to avoid lookup of IPv6 address if IPv4 address is sufficient. From af36381227888e1e2d7cbb97fc3b1c35601c7907 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 16 Oct 2002 12:49:18 +0000 Subject: [PATCH 3917/7878] In Autoconf, it's good practice to use "dnl" only when commenting on an m4 construct, or something which doesn't end up in the configure script. But otherwise, '#' should be used, so that the configure script can be debugged more easily. This fixes some uses of "dnl" which should be "#", and removes uses of the redundant "dnl #" oddity. Submitted by: Joe Orton Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63936 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 4 +- configure.in | 178 ++++++++++++++++++++++---------------------- 2 files changed, 91 insertions(+), 91 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 0210e83715b..61b6b830a2b 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -524,8 +524,8 @@ dnl if test "$ac_cv_crypt_r_style" = "cryptd"; then AC_DEFINE(CRYPT_R_CRYPTD, 1, [Define if crypt_r has uses CRYPTD]) fi -dnl if we don't combine these conditions, CRYPT_R_STRUCT_CRYPT_DATA -dnl will end up defined twice +# if we don't combine these conditions, CRYPT_R_STRUCT_CRYPT_DATA +# will end up defined twice if test "$ac_cv_crypt_r_style" = "struct_crypt_data" -o \ "$ac_cv_crypt_r_style" = "struct_crypt_data_gnu_source"; then AC_DEFINE(CRYPT_R_STRUCT_CRYPT_DATA, 1, [Define if crypt_r uses struct crypt_data]) diff --git a/configure.in b/configure.in index ea00a029ad9..465d1505441 100644 --- a/configure.in +++ b/configure.in @@ -1,16 +1,16 @@ -dnl # -dnl # Autoconf configuration file for APR -dnl # -dnl # Process this file with autoconf to produce a configure script. -dnl # Use ./buildconf to prepare build files and run autoconf for APR. +dnl +dnl Autoconf configuration file for APR +dnl +dnl Process this file with autoconf to produce a configure script. +dnl Use ./buildconf to prepare build files and run autoconf for APR. AC_INIT(build/apr_common.m4) AC_CONFIG_HEADER(include/arch/unix/apr_private.h) AC_CONFIG_AUX_DIR(build) -dnl # -dnl # Include our own M4 macros along with those for libtool -dnl # +dnl +dnl Include our own M4 macros along with those for libtool +dnl sinclude(build/apr_common.m4) sinclude(build/apr_network.m4) sinclude(build/apr_threads.m4) @@ -33,12 +33,12 @@ AC_CANONICAL_SYSTEM echo "Configuring APR library" echo "Platform: $host" -dnl # Some initial steps for configuration. We setup the default directory -dnl # and which files are to be configured. +dnl Some initial steps for configuration. We setup the default directory +dnl and which files are to be configured. dnl Setup the directory macros now -dnl Absolute source/build directory +# Absolute source/build directory apr_srcdir=`(cd $srcdir && pwd)` apr_builddir=`pwd` AC_SUBST(apr_srcdir) @@ -48,15 +48,15 @@ if test "$apr_builddir" != "$apr_srcdir"; then USE_VPATH=1 fi -dnl Libtool might need this symbol -- it must point to the location of -dnl the generated libtool script (not necessarily the "top" build dir). -dnl +# Libtool might need this symbol -- it must point to the location of +# the generated libtool script (not necessarily the "top" build dir). +# top_builddir="$apr_builddir" AC_SUBST(top_builddir) -dnl Directory containing apr build macros, helpers, and make rules -dnl NOTE: make rules (rules.mk) will be in the builddir for vpath -dnl +# Directory containing apr build macros, helpers, and make rules +# NOTE: make rules (rules.mk) will be in the builddir for vpath +# apr_buildout=$apr_builddir/build apr_builders=$apr_srcdir/build AC_SUBST(apr_builders) @@ -66,7 +66,7 @@ MKDIR=$apr_builders/mkdir.sh dnl Initialize mkdir -p functionality. APR_MKDIR_P_CHECK($apr_builders/mkdir.sh) -dnl get our version information +# get our version information get_version="$apr_builders/get-version.sh" version_hdr="$apr_srcdir/include/apr_version.h" APR_MAJOR_VERSION="`$get_version major $version_hdr APR`" @@ -141,7 +141,7 @@ AC_PROG_LIBTOOL if test "x$LTFLAGS" = "x"; then LTFLAGS='--silent' fi - dnl get libtool's setting of shlibpath_var + # get libtool's setting of shlibpath_var eval `grep "^shlibpath_var=[[A-Z_]]*$" $apr_builddir/libtool` if test "x$shlibpath_var" = "x"; then shlibpath_var=REPLACE_WITH_YOUR_SHLIBPATH_VAR @@ -171,7 +171,7 @@ else export_lib_target='' fi -dnl On AIX, libraries need to be specified on the link of lib_target +# On AIX, libraries need to be specified on the link of lib_target lib_target_libs="" case $host in *aix*) @@ -194,7 +194,7 @@ AC_SUBST(LTFLAGS) AC_SUBST(LT_LDFLAGS) AC_SUBST(lib_target_libs) -dnl #----------------------------- Checks for compiler flags +dnl ----------------------------- Checks for compiler flags nl=' ' echo $ac_n "${nl}Check for compiler flags...${nl}" @@ -310,8 +310,8 @@ if test "$host" = "i586-pc-beos"; then ) dnl fi -dnl # this is the place to put specific options for platform/compiler -dnl # combinations +# this is the place to put specific options for platform/compiler +# combinations case "$host:$CC" in *-hp-hpux*:cc ) APR_ADDTO(CFLAGS,[-Ae +DAportable +Z]) @@ -323,11 +323,11 @@ case "$host:$CC" in ;; esac -dnl force_atomic_generic flag -dnl this will be set we find a cpu/OS combo -dnl which is historical and doesn't work with the method -dnl we are using for the more up to date cpu/OS -dnl (ie.. old sparcs) +# force_atomic_generic flag +# this will be set we find a cpu/OS combo +# which is historical and doesn't work with the method +# we are using for the more up to date cpu/OS +# (ie.. old sparcs) apr_force_atomic_generic=0 proc_mutex_is_global=0 nonportable_atomics_enabled=0 @@ -453,8 +453,8 @@ AC_SUBST(proc_mutex_is_global) AC_SUBST(eolstr) AC_SUBST(INSTALL_SUBDIRS) -dnl For some platforms we need a version string which allows easy numeric -dnl comparisons. +# For some platforms we need a version string which allows easy numeric +# comparisons. case $host in *freebsd*) # 3.4-RELEASE: 340 4.1.1-RELEASE: 411 @@ -468,7 +468,7 @@ case $host in ;; esac -dnl #----------------------------- Checks for Any required Libraries +dnl ----------------------------- Checks for Any required Libraries dnl Note: Autoconf will always append LIBS with an extra " " in AC_CHECK_LIB. dnl It should check for LIBS being empty and set LIBS equal to the new value dnl without the extra " " in that case, but they didn't do that. So, we @@ -481,7 +481,7 @@ AC_SEARCH_LIBS(crypt, crypt ufc) AC_CHECK_LIB(truerand, main) AC_CHECK_LIB(m, modf) -dnl #----------------------------- Checking for Threads +dnl ----------------------------- Checking for Threads echo $ac_n "${nl}Checking for Threads...${nl}" if test -z "$enable_threads"; then @@ -537,10 +537,10 @@ else AC_CHECK_FUNCS(pthread_key_delete pthread_rwlock_init) if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then - dnl #----------------------------- Checking for pthread_rwlock_t - dnl # Linux is silly as it has pthread_rwlock_init defined - dnl # but keeps the pthread_rwlock_t structure hidden unless - dnl # special things are defined. + dnl ----------------------------- Checking for pthread_rwlock_t + dnl Linux is silly as it has pthread_rwlock_init defined + dnl but keeps the pthread_rwlock_t structure hidden unless + dnl special things are defined. AC_TRY_COMPILE([#include #include ], [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;], @@ -607,17 +607,17 @@ AC_SUBST(have_sigwait) AC_CHECK_FUNCS(poll) -dnl #----------------------------- Checking for missing POSIX thread functions +dnl ----------------------------- Checking for missing POSIX thread functions AC_CHECK_FUNCS(getpwnam_r) AC_CHECK_FUNCS(getpwuid_r) AC_CHECK_FUNCS(getgrnam_r) AC_CHECK_FUNCS(getgrgid_r) -dnl #----------------------------- Checking for Shared Memory Support +dnl ----------------------------- Checking for Shared Memory Support echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" -dnl The Posix function are in librt on Solaris. This will -dnl also help us find sem_open when doing locking below +# The Posix function are in librt on Solaris. This will +# also help us find sem_open when doing locking below case $host in *-solaris*) AC_CHECK_LIB(rt, shm_open) @@ -634,7 +634,7 @@ AC_CHECK_HEADERS(kernel/OS.h) AC_CHECK_FUNCS(create_area) AC_CHECK_HEADERS(os2.h) -dnl Not all systems can mmap /dev/zero (such as HP-UX). Check for that. +# Not all systems can mmap /dev/zero (such as HP-UX). Check for that. if test "$ac_cv_func_mmap" = "yes" && test "$ac_cv_file__dev_zero" = "yes"; then AC_MSG_CHECKING(for mmap that can map /dev/zero) @@ -666,7 +666,7 @@ if test "$ac_cv_func_mmap" = "yes" && AC_MSG_RESULT($ac_cv_file__dev_zero) fi -dnl Now we determine which one is our anonymous shmem preference. +# Now we determine which one is our anonymous shmem preference. haveshmgetanon="0" havemmapzero="0" havemmapanon="0" @@ -692,10 +692,10 @@ APR_IFALLYES(header:kernel/OS.h func:create_area, [BeOS areas])]) case $host in *linux* ) - dnl Linux has problems with MM_SHMT_MMANON even though it reports - dnl that it has it. - dnl FIXME - find exact 2.3 version that MMANON was fixed in. It is - dnl confirmed fixed in 2.4 series. + # Linux has problems with MM_SHMT_MMANON even though it reports + # that it has it. + # FIXME - find exact 2.3 version that MMANON was fixed in. It is + # confirmed fixed in 2.4 series. if test $os_version -le "240"; then APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_ZERO USE_SHMEM_SHMGET_ANON) fi @@ -730,7 +730,7 @@ AC_SUBST(haveshmgetanon) AC_SUBST(havemmapzero) AC_SUBST(havemmapanon) -dnl Now we determine which one is our name-based shmem preference. +# Now we determine which one is our name-based shmem preference. havemmaptmp="0" havemmapshm="0" haveshmget="0" @@ -758,10 +758,10 @@ APR_IFALLYES(header:os2.h, APR_DECIDE(USE_SHMEM_OS2, [OS/2 DosAllocSharedMem()])]) case $host in *linux* ) - dnl Linux has problems with MM_SHMT_MMANON even though it reports - dnl that it has it. - dnl FIXME - find exact 2.3 version that MMANON was fixed in. It is - dnl confirmed fixed in 2.4 series. + # Linux has problems with MM_SHMT_MMANON even though it reports + # that it has it. + # FIXME - find exact 2.3 version that MMANON was fixed in. It is + # confirmed fixed in 2.4 series. if test $os_version -le "240"; then APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_TMP USE_SHMEM_MMAP_SHM dnl USE_SHMEM_SHMGET) @@ -795,7 +795,7 @@ case $ac_decision in ;; esac -dnl Do we have any shared memory support? +# Do we have any shared memory support? if test "$usemmaptmp$usemmapshm$usemmapzero$useshmget$usemmapanon$usebeosarea$useos2shm" = "0000000"; then sharedmem="0" else @@ -814,7 +814,7 @@ AC_SUBST(havebeosarea) AC_SUBST(haveos2shm) AC_SUBST(sharedmem) -dnl #----------------------------- Checks for Any required Functions +dnl ----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) AC_CHECK_FUNCS(alloca calloc strcasecmp stricmp setsid isinf isnan) AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) @@ -894,7 +894,7 @@ AC_SUBST(have_memmove) APR_CHECK_SIGWAIT_ONE_ARG -dnl #----------------------------- Checks for Any required Headers +dnl ----------------------------- Checks for Any required Headers AC_HEADER_STDC APR_FLAG_HEADERS( @@ -958,9 +958,9 @@ APR_FLAG_HEADERS( sys/un.h \ sys/wait.h) -dnl IRIX 6.5 has a problem in which prevents it from -dnl being included by itself. Check for manually, -dnl including another header file first. +# IRIX 6.5 has a problem in which prevents it from +# being included by itself. Check for manually, +# including another header file first. AC_MSG_CHECKING(for netinet/tcp.h) AC_TRY_CPP([ #ifdef HAVE_NETINET_IN_H @@ -1007,7 +1007,7 @@ AC_SUBST(sys_waith) AC_SUBST(pthreadh) AC_SUBST(semaphoreh) -dnl #----------------------------- Checking for h_errno in +# Checking for h_errno in if test "$netdbh" = "1"; then APR_CHECK_H_ERRNO_FLAG if test "$ac_cv_h_errno_cflags" = "no"; then @@ -1015,7 +1015,7 @@ if test "$netdbh" = "1"; then fi fi -dnl #----------------------------- Checks for standard typedefs +dnl ----------------------------- Checks for standard typedefs AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T @@ -1030,7 +1030,7 @@ APR_CHECK_SOCKLEN_T APR_INADDR_NONE -dnl # Checks for integer size +dnl Checks for integer size AC_CHECK_SIZEOF(char, 1) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) @@ -1044,8 +1044,8 @@ fi if test "$ac_cv_sizeof_int" = "4"; then int_value=int fi -dnl # Now we need to find what apr_int64_t (sizeof == 8) will be. -dnl # The first match is our preference. +# Now we need to find what apr_int64_t (sizeof == 8) will be. +# The first match is our preference. if test "$ac_cv_sizeof_int" = "8"; then int64_literal='#define APR_INT64_C(val) (val)' int64_t_fmt='#define APR_INT64_T_FMT "d"' @@ -1062,10 +1062,10 @@ elif test "$ac_cv_sizeof_long" = "8"; then int64_strfn="strtol" elif test "$ac_cv_sizeof_long_long" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LL)' - dnl Linux, Solaris, FreeBSD all support ll with printf. - dnl BSD 4.4 originated 'q'. Solaris is more popular and - dnl doesn't support 'q'. Solaris wins. Exceptions can - dnl go to the OS-dependent section. + # Linux, Solaris, FreeBSD all support ll with printf. + # BSD 4.4 originated 'q'. Solaris is more popular and + # doesn't support 'q'. Solaris wins. Exceptions can + # go to the OS-dependent section. int64_t_fmt='#define APR_INT64_T_FMT "lld"' int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 3' int64_value="long long" @@ -1086,8 +1086,8 @@ elif test "$ac_cv_sizeof_longlong" = "8"; then long_value="__int64" int64_strfn="strtoll" else - dnl # int64_literal may be overriden if your compiler thinks you have - dnl # a 64-bit value but APR does not agree. + # int64_literal may be overriden if your compiler thinks you have + # a 64-bit value but APR does not agree. int64_literal='#error Can not determine the proper size for apr_int64_t' int64_t_fmt='#error Can not determine the proper size for apr_int64_t' int64_t_fmt_len='#error Can not determine the proper size for apr_int64_t' @@ -1230,7 +1230,7 @@ AC_SUBST(pid_t_fmt) AC_SUBST(int64_literal) AC_SUBST(stdint) -dnl #----------------------------- Checking for string functions +dnl ----------------------------- Checking for string functions AC_CHECK_FUNCS(strnicmp, have_strnicmp="1", have_strnicmp="0") AC_CHECK_FUNCS(strncasecmp, have_strncasecmp="1", have_strncasecmp="0") AC_CHECK_FUNCS(stricmp, have_stricmp="1", have_stricmp="0") @@ -1240,7 +1240,7 @@ AC_CHECK_FUNCS(strstr, have_strstr="1", have_strstr="0") AC_CHECK_FUNCS(memchr, have_memchr="1", have_memchr="0") AC_CHECK_FUNCS($int64_strfn, have_int64_strfn="1", have_int64_strfn="0") -dnl #----------------------------- We have a fallback position +dnl ----------------------------- We have a fallback position if test "$have_int64_strfn" = "0" && test "$int64_strfn" = "strtoll"; then int64_strfn="strtoq" AC_CHECK_FUNCS($int64_strfn, have_int64_strfn="1", have_int64_strfn="0") @@ -1256,7 +1256,7 @@ AC_SUBST(have_memchr) AC_SUBST(have_int64_strfn) AC_SUBST(int64_strfn) -dnl #----------------------------- Checking for DSO support +dnl ----------------------------- Checking for DSO support echo $ac_n "${nl}Checking for DSO...${nl}" AC_ARG_ENABLE(dso, [ --enable-dso Enable dso support ], @@ -1300,7 +1300,7 @@ fi AC_SUBST(aprdso) -dnl #----------------------------- Checking for Processes +dnl ----------------------------- Checking for Processes echo $ac_n "${nl}Checking for Processes...${nl}" AC_CHECK_FUNCS(waitpid) @@ -1345,14 +1345,14 @@ struct_rlimit=0 test "x$ac_cv_struct_rlimit" = xyes && struct_rlimit=1 AC_SUBST(struct_rlimit) -dnl #----------------------------- Checking for Locking Characteristics +dnl ----------------------------- Checking for Locking Characteristics echo $ac_n "${nl}Checking for Locking...${nl}" AC_CHECK_FUNCS(semget semctl flock) AC_CHECK_HEADERS(semaphore.h) AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait) -dnl Some systems return ENOSYS from sem_open. +# Some systems return ENOSYS from sem_open. AC_CACHE_CHECK(for working sem_open,ac_cv_func_sem_open,[ AC_TRY_RUN([ #include @@ -1577,7 +1577,7 @@ else AC_MSG_RESULT(no) fi -dnl #----------------------------- Checking for /dev/random +dnl ----------------------------- Checking for /dev/random AC_MSG_CHECKING(for entropy source) AC_ARG_WITH(egd, @@ -1645,7 +1645,7 @@ if test "$rand" != "1"; then fi AC_SUBST(rand) -dnl #----------------------------- Checking for Time Support +dnl ----------------------------- Checking for Time Support echo $ac_n "${nl}Checking for Time Support...${nl}" AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, [AC_TRY_COMPILE([#include @@ -1656,7 +1656,7 @@ if test "$ac_cv_struct_tm_gmtoff" = "yes"; then AC_DEFINE(HAVE_GMTOFF) fi -dnl #----------------------------- Checking for Networking Support +dnl ----------------------------- Checking for Networking Support echo $ac_n "${nl}Checking for Networking support...${nl}" AC_MSG_CHECKING(for in_addr in netinet/in.h) AC_TRY_COMPILE([ @@ -1683,7 +1683,7 @@ AC_SUBST(file_as_socket) APR_CHECK_SOCKADDR_SA_LEN -dnl Check the types only if we have gethostbyname_r +# Check the types only if we have gethostbyname_r if test "$ac_cv_func_gethostbyname_r" = "yes"; then APR_CHECK_GETHOSTBYNAME_R_STYLE fi @@ -1691,7 +1691,7 @@ fi APR_CHECK_TCP_NODELAY_INHERITED APR_CHECK_O_NONBLOCK_INHERITED -dnl # Look for a way of corking TCP... +# Look for a way of corking TCP... APR_CHECK_DEFINE(TCP_CORK, netinet/tcp.h) APR_CHECK_DEFINE(TCP_NOPUSH, netinet/tcp.h) apr_tcp_nopush_flag="0" @@ -1736,7 +1736,7 @@ AC_CHECK_FUNCS(set_h_errno) APR_CHECK_RESOLV_RETRANS echo $ac_n "${nl}Checking for IPv6 Networking support...${nl}" -dnl # Start of checking for IPv6 support... +dnl Start of checking for IPv6 support... AC_ARG_ENABLE(ipv6, [ --disable-ipv6 Disable IPv6 support in APR.], @@ -1747,9 +1747,9 @@ AC_ARG_ENABLE(ipv6, case $host in *apple-darwin*) - dnl # It appears that Jaguar has all the right features, but - dnl # getnameinfo() fails to find the hostname for a mapped - dnl # address. + # It appears that Jaguar has all the right features, but + # getnameinfo() fails to find the hostname for a mapped + # address. broken_ipv6=1 ;; *) @@ -1792,7 +1792,7 @@ fi AC_SUBST(have_ipv6) -dnl #----------------------------- Finalize the variables +dnl ----------------------------- Finalize the variables echo $ac_n "${nl}Restore user-defined environment settings...${nl}" @@ -1807,7 +1807,7 @@ AC_SUBST(NOTEST_LDFLAGS) AC_SUBST(NOTEST_LIBS) AC_SUBST(NOTEST_INCLUDES) -dnl #----------------------------- Construct the files +dnl ----------------------------- Construct the files AC_SUBST(LDLIBS) AC_SUBST(AR) @@ -1837,9 +1837,9 @@ if test -d $srcdir/test; then fi AC_SUBST(SUBDIRS) -dnl -dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles -dnl +# +# BSD/OS (BSDi) needs to use a different include syntax in the Makefiles +# case $host in *bsdi*) # Check whether they've installed GNU make @@ -1881,7 +1881,7 @@ done chmod +x apr-config ]) -dnl #----------------------------- Fixup Makefiles for VPATH support +dnl ----------------------------- Fixup Makefiles for VPATH support changequote({,}) From 01f5388df87bf3b3adff7bee195a5f0b520bd91d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 16 Oct 2002 15:51:30 +0000 Subject: [PATCH 3918/7878] Thanks to Brad for cleaning up the only few occurances of this symbol in the Netware MPM, it can now be eliminated (never was portably provided.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63937 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index ac61450cf88..ccbf1956691 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -1112,8 +1112,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, */ #define APR_FROM_OS_ERROR(e) (e) #define APR_TO_OS_ERROR(e) (e) -/* Platform specific, should be deprecated */ -#define APR_TO_NETOS_ERROR(e) (e-APR_OS_START_SYSERR) #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) From 77bebf1db28a521b098db6dc14c4299b718a069b Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 16 Oct 2002 23:53:03 +0000 Subject: [PATCH 3919/7878] Adding the current version string to the link of each NLM git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63938 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 2 +- build/NWGNUenvironment.inc | 1 - build/NWGNUmakefile | 1 + build/NWGNUtail.inc | 17 ++++++++++++++++- build/nw_ver.awk | 25 +++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 build/nw_ver.awk diff --git a/NWGNUmakefile b/NWGNUmakefile index 8b95c1d0188..5d147fc8ddc 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -108,7 +108,7 @@ NLM_NAME = aprlib # This is used by the link '-desc ' directive. # If left blank, NLM_NAME will be used. # -NLM_DESCRIPTION = Apache Portability Runtime Library +NLM_DESCRIPTION = Apache Portability Runtime Library $(VERSION_STR) # # This is used by the '-threadname' directive. If left blank, diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 06407673806..6ffd74e5a31 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -254,7 +254,6 @@ XMLLIB = $(XML)/$(OBJDIR)/xmllib.lib # # Additional general defines # -VERSION = 2,0,0 EnvironmentDefined = 1 endif # ifndef EnvironmentDefined diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index eaa230c7e10..bbacbbf89a4 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -78,6 +78,7 @@ install :: nlms FORCE clean :: $(CHK) nw_export.i $(DEL) nw_export.i $(CHK) cc.opt $(DEL) cc.opt + $(CHK) NWGNUversion.inc $(DEL) NWGNUversion.inc $(CHK) $(subst /,\,$(APR))\include\apr.h $(DEL) $(subst /,\,$(APR))\include\apr.h $(CHK) $(subst /,\,$(APRUTIL))\include\apu.h $(DEL) $(subst /,\,$(APRUTIL))\include\apu.h $(CHK) $(subst /,\,$(APRUTIL))\include\apr_ldap.h $(DEL) $(subst /,\,$(APRUTIL))\include\apr_ldap.h diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 301afcff5cf..2c80716a331 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -52,6 +52,7 @@ $(NLM_NAME)_LINKOPT_DEPENDS = \ NWGNUmakefile \ $(APR_WORK)\build\NWGNUtail.inc \ $(CUSTOM_INI) \ + $(VERSION_INC) \ $(EOLIST) ifeq "$(words $(strip $(TARGET_lib)))" "1" @@ -79,6 +80,20 @@ endif # Generic compiler rules # +$(APR_WORK)\build\NWGNUversion.inc : $(APR_WORK)\include\apr_version.h $(APR_WORK)\build\nw_ver.awk + @echo Generating $(subst /,\,$@) + awk -f $(APR_WORK)\build\nw_ver.awk $(APR_WORK)\include\apr_version.h > $(APR_WORK)\build\NWGNUversion.inc + +-include $(APR_WORK)\build\NWGNUversion.inc + +ifneq "$(strip $(VERSION_STR))" "" +VERSION_INC = $(APR_WORK)\build\NWGNUversion.inc +else +VERSION = 1,0,0 +VERSION_STR = 1.0.0 +endif + + $(OBJDIR)/%.o: %.c $(OBJDIR)\cc.opt @echo Compiling $< $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt @@ -275,7 +290,7 @@ else # more than one target so look for individual makefiles. ifndef NO_LICENSE_FILE -$(OBJDIR)/%.nlm: NWGNU% $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUtail.inc $(APR_WORK)\build\NWGNUenvironment.inc $(CUSTOM_INI) FORCE +$(OBJDIR)/%.nlm: NWGNU% $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUtail.inc $(APR_WORK)\build\NWGNUenvironment.inc $(CUSTOM_INI) $(VERSION_INC) FORCE @echo Calling $< $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE) $(CMD) echo. diff --git a/build/nw_ver.awk b/build/nw_ver.awk new file mode 100644 index 00000000000..ae82305a114 --- /dev/null +++ b/build/nw_ver.awk @@ -0,0 +1,25 @@ +BEGIN { + + # fetch APR version numbers from input file and writes them to STDOUT + + while ((getline < ARGV[1]) > 0) { + if (match ($0, /^#define APR_MAJOR_VERSION/)) { + ver_major = $3; + } + else if (match ($0, /^#define APR_MINOR_VERSION/)) { + ver_minor = $3; + } + else if (match ($0, /^#define APR_PATCH_VERSION/)) { + ver_str_patch = $3; + if (match (ver_str_patch, /[0-9][0-9]*/)) { + ver_patch = substr(ver_str_patch, RSTART, RLENGTH); + } + } + } + ver = ver_major "," ver_minor "," ver_patch; + ver_str = ver_major "." ver_minor "." ver_str_patch; + + print "VERSION = " ver ""; + print "VERSION_STR = " ver_str ""; + +} From cdd0ac5f8b2b349180f268b018d5f8ecf1122279 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 17 Oct 2002 14:33:07 +0000 Subject: [PATCH 3920/7878] This patch compresses a few expansions of AC_CHECK_{FUNCS,HEADERS} into single expansions, since both these macros are implemented as for loops; this reduces the size of the generated configure script (possibly making it faster). Submitted by: Joe Orton Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63939 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/configure.in b/configure.in index 465d1505441..650b365df74 100644 --- a/configure.in +++ b/configure.in @@ -608,10 +608,7 @@ AC_SUBST(have_sigwait) AC_CHECK_FUNCS(poll) dnl ----------------------------- Checking for missing POSIX thread functions -AC_CHECK_FUNCS(getpwnam_r) -AC_CHECK_FUNCS(getpwuid_r) -AC_CHECK_FUNCS(getgrnam_r) -AC_CHECK_FUNCS(getgrgid_r) +AC_CHECK_FUNCS([getpwnam_r getpwuid_r getgrnam_r getgrgid_r]) dnl ----------------------------- Checking for Shared Memory Support echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" @@ -624,15 +621,11 @@ case $host in ;; esac -AC_CHECK_HEADERS(sys/mman.h) +AC_CHECK_HEADERS([sys/mman.h sys/ipc.h sys/shm.h sys/file.h kernel/OS.h os2.h]) +AC_CHECK_FUNCS([mmap munmap shm_open shm_unlink shmget shmat shmdt shmctl \ + create_area]) APR_CHECK_DEFINE(MAP_ANON, sys/mman.h) -AC_CHECK_FUNCS(mmap munmap shm_open shm_unlink) APR_CHECK_FILE(/dev/zero) -AC_CHECK_HEADERS(sys/ipc.h sys/shm.h sys/file.h) -AC_CHECK_FUNCS(shmget shmat shmdt shmctl) -AC_CHECK_HEADERS(kernel/OS.h) -AC_CHECK_FUNCS(create_area) -AC_CHECK_HEADERS(os2.h) # Not all systems can mmap /dev/zero (such as HP-UX). Check for that. if test "$ac_cv_func_mmap" = "yes" && @@ -859,12 +852,10 @@ AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) AC_DECL_SYS_SIGLIST AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ]) -AC_CHECK_FUNCS(getpass) APR_CHECK_INET_ADDR APR_CHECK_INET_NETWORK AC_SUBST(apr_inaddr_none) AC_CHECK_FUNC(_getch) -AC_CHECK_FUNCS(gmtime_r localtime_r) AC_CHECK_FUNCS(strerror_r, [ strerror_r="1" ], [ strerror_r="0" ]) if test "$strerror_r" = "1"; then APR_CHECK_STRERROR_R_RC @@ -877,9 +868,8 @@ AC_CHECK_FUNCS(mmap, [ mmap="1" ], [ mmap="0" ]) if test "$native_mmap_emul" = "1"; then mmap="1" fi -AC_CHECK_FUNCS(hstrerror) AC_CHECK_FUNCS(memmove, [ have_memmove="1" ], [have_memmove="0" ]) -AC_CHECK_FUNCS(mkstemp) +AC_CHECK_FUNCS([getpass gmtime_r localtime_r hstrerror mkstemp]) AC_SUBST(fork) AC_SUBST(have_inet_addr) From 27eadb291b11b53d0df27d0a6cb71bc09fac4640 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 17 Oct 2002 15:04:00 +0000 Subject: [PATCH 3921/7878] This patch: * simplifies APR_CHECK_FILE to use an m4 translit() to avoid the evals * uses AC_DEFUN to define macros in autoconf, not define() * drops support for the second and third arguments to the macro, since these aren't used anywhere. (checked apr-util, httpd-2.0, SVN) Submitted by: Joe Orton Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63940 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 61b6b830a2b..4e48ecb931f 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -277,23 +277,17 @@ YES_IS_DEFINED ], ac_cv_define_$1=yes, ac_cv_define_$1=no) ]) -define(APR_CHECK_FILE,[ -ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(ac_cv_file_$ac_safe, [ - if test -r $1; then - eval "ac_cv_file_$ac_safe=yes" - else - eval "ac_cv_file_$ac_safe=no" - fi -])dnl -if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) -else - AC_MSG_RESULT(no) -ifelse([$3], , , [$3]) -fi +dnl APR_CHECK_FILE(filename); set ac_cv_file_filename to +dnl "yes" if 'filename' is readable, else "no". +AC_DEFUN([APR_CHECK_FILE], [ +dnl Pick a safe variable name +define([apr_cvname], ac_cv_file_[]translit([$1], [./+-], [__p_])) +AC_CACHE_CHECK([for $1], [apr_cvname], +[if test -r $1; then + apr_cvname=yes + else + apr_cvname=no + fi]) ]) define(APR_IFALLYES,[dnl From 0bbb67f1a5b69ac7ba8385fcaafc9a2353103f4f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Oct 2002 17:40:24 +0000 Subject: [PATCH 3922/7878] Platform preference for shl_load on HPUX11 must be expressed by testing first for that method. dlopen on HPUX11/64 bit OS'es or including one off libdld's should not be recognized. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63941 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 650b365df74..dc4a349d437 100644 --- a/configure.in +++ b/configure.in @@ -1253,6 +1253,10 @@ AC_ARG_ENABLE(dso, [ tempdso=$enableval], [ AC_CHECK_FUNCS(NSLinkModule, [ tempdso="dyld" ], [ tempdso="no" ]) + if test "$tempdso" = "no"; then + AC_CHECK_LIB(dld, shl_load, [ tempdso="shl" APR_ADDTO(LIBS,-ldld) ], + tempdso="no") + fi if test "$tempdso" = "no"; then AC_CHECK_FUNCS(dlopen, [ tempdso="dlfcn" ], [ tempdso="no" ]) fi @@ -1263,10 +1267,6 @@ AC_ARG_ENABLE(dso, if test "$tempdso" = "no"; then AC_CHECK_LIB(root, load_image, tempdso="yes", tempdso="no") fi - if test "$tempdso" = "no"; then - AC_CHECK_LIB(dld, shl_load, [ tempdso="shl" APR_ADDTO(LIBS,-ldld) ], - tempdso="no") - fi if test "$tempdso" = "no"; then case $host in *os390|*-os2*|*os400) From 5def3fa492a6362ecc13717a6ce56c964d1c8bc4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Oct 2002 18:22:16 +0000 Subject: [PATCH 3923/7878] When we build HP-UX applications, they must be able to follow the SHLIB_PATH path variable due to the construction and potential relocation of libapr.sl/libaprutil.sl with binary builds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63942 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 905f810aa66..1e7dc91ef7c 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -81,6 +81,7 @@ if test "x$apr_preload_done" != "xyes" ; then ;; *-hp-hpux11.*) APR_ADDTO(CPPFLAGS, [-DHPUX11 -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED]) + APR_ADDTO(LDFLAGS, [+s]) ;; *-hp-hpux10.*) case $host in @@ -91,9 +92,11 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; esac APR_ADDTO(CPPFLAGS, [-D_REENTRANT]) + APR_ADDTO(LDFLAGS, [+s]) ;; *-hp-hpux*) APR_ADDTO(CPPFLAGS, [-DHPUX -D_REENTRANT]) + APR_ADDTO(LDFLAGS, [+s]) ;; *-linux-*) case `uname -r` in From 1c723ed5b60c8be1e9148243fc0033980e92ad74 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Oct 2002 12:04:00 +0000 Subject: [PATCH 3924/7878] Add apr_socket_create_ex() to allow protocol to be specified for the socket. With APR 1.0, this function will be removed and apr_socket_create() will have the additional parameter. Submitted by: Randall Stewart Reviewed/mangled by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63943 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ include/apr_network_io.h | 33 +++++++++++++++++++++++++++++ include/apr_portable.h | 9 +++++--- include/arch/os2/networkio.h | 1 + include/arch/unix/networkio.h | 1 + include/arch/win32/networkio.h | 1 + network_io/os2/sockets.c | 35 +++++++++++++++++++++++-------- network_io/unix/sockets.c | 35 +++++++++++++++++++++++-------- network_io/win32/sockets.c | 38 ++++++++++++++++++++++++++-------- test/server.c | 9 +++++++- 10 files changed, 136 insertions(+), 31 deletions(-) diff --git a/CHANGES b/CHANGES index 2c19381e32b..9449ceeb07f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR 0.9.2 + *) Add apr_socket_create_ex() to allow protocol to be specified for the + socket. With APR 1.0, this function will be removed and apr_socket_create() + will have the additional parameter. + [Randall Stewart ] + *) Fix the detection of INT64_C() when defined in . [Joe Orton ] diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 163501b8246..672e5cd04c9 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -167,6 +167,16 @@ struct in_addr { #define APR_INET6 AF_INET6 #endif +/** + * @defgroup IP_Proto IP Protocol Definitions for use when creating sockets + * @{ + */ +#define APR_PROTO_TCP 6 +#define APR_PROTO_UDP 17 +#define APR_PROTO_SCTP 132 +/** @} */ + + /** * Enum to tell us if we're interested in remote or local socket */ @@ -265,6 +275,7 @@ struct apr_hdtr_t { /** * Create a socket. + * @remark With APR 1.0, this function will pick up a new protocol parameter. * @param new_sock The new socket that has been set up. * @param family The address family of the socket (e.g., APR_INET). * @param type The type of the socket (e.g., SOCK_STREAM). @@ -274,6 +285,20 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, int family, int type, apr_pool_t *cont); +/** + * Create a socket. + * @remark With APR 1.0, this function will be removed. + * @param new_sock The new socket that has been set up. + * @param family The address family of the socket (e.g., APR_INET). + * @param type The type of the socket (e.g., SOCK_STREAM). + * @param protocol The protocol of the socket (e.g., APR_PROTO_TCP). + * @param cont The pool to use + */ +APR_DECLARE(apr_status_t) apr_socket_create_ex(apr_socket_t **new_sock, + int family, int type, + int protocol, + apr_pool_t *cont); + /** * Shutdown either reading, writing, or both sides of a socket. * @param thesocket The socket to close @@ -729,6 +754,14 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, char *args); #endif +/** + * Return the protocol of the socket. + * @param sock The socket to query. + * @param protocol The returned protocol (e.g., APR_PROTO_TCP). + */ +APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, + int *protocol); + /** * Set a socket to be inherited by child processes. * @param socket The socket to enable inheritance. diff --git a/include/apr_portable.h b/include/apr_portable.h index 756816f6272..3189f6088f8 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -201,7 +201,7 @@ typedef void* apr_os_shm_t; #endif /** - * @typedef apr_os_sock_t + * @typedef apr_os_sock_info_t * @brief alias for local OS socket */ /** @@ -212,8 +212,11 @@ struct apr_os_sock_info_t { apr_os_sock_t *os_sock; /**< always required */ struct sockaddr *local; /**< NULL if not yet bound */ struct sockaddr *remote; /**< NULL if not connected */ - int family; /**< always required (APR_INET, APR_INET6, etc. */ - int type; /**< always required (SOCK_STREAM, SOCK_DGRAM, etc. */ + int family; /**< always required (APR_INET, APR_INET6, etc.) */ + int type; /**< always required (SOCK_STREAM, SOCK_DGRAM, etc.) */ +#ifdef APR_ENABLE_FOR_1_0 /**< enable with APR 1.0 */ + int protocol; /**< 0 or actual protocol (APR_PROTO_SCTP, APR_PROTO_TCP, etc.) */ +#endif }; typedef struct apr_os_sock_info_t apr_os_sock_info_t; diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index c823c04c18e..09f5cd2f441 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -67,6 +67,7 @@ struct apr_socket_t { apr_pool_t *cntxt; int socketdes; int type; + int protocol; apr_sockaddr_t *local_addr; apr_sockaddr_t *remote_addr; apr_interval_time_t timeout; diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 1b991429131..8f16b05335f 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -120,6 +120,7 @@ struct apr_socket_t { apr_pool_t *cntxt; int socketdes; int type; + int protocol; apr_sockaddr_t *local_addr; apr_sockaddr_t *remote_addr; apr_interval_time_t timeout; diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 995b61ac904..af9024a0303 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -62,6 +62,7 @@ struct apr_socket_t { apr_pool_t *cntxt; SOCKET socketdes; int type; /* SOCK_STREAM, SOCK_DGRAM */ + int protocol; apr_sockaddr_t *local_addr; apr_sockaddr_t *remote_addr; int timeout_ms; /* MUST MATCH if timeout > 0 */ diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 5e8312311ae..3f72bd59001 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -84,9 +84,10 @@ static apr_status_t socket_cleanup(void *sock) } } -static void set_socket_vars(apr_socket_t *sock, int family, int type) +static void set_socket_vars(apr_socket_t *sock, int family, int type, int protocol) { sock->type = type; + sock->protocol = protocol; apr_sockaddr_vars_set(sock->local_addr, family, 0); apr_sockaddr_vars_set(sock->remote_addr, family, 0); } @@ -103,8 +104,14 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr->pool = p; } -APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int type, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, int *protocol) +{ + *protocol = sock->protocol; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_socket_create_ex(apr_socket_t **new, int family, int type, + int protocol, apr_pool_t *cont) { int downgrade = (family == AF_UNSPEC); @@ -118,18 +125,18 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int alloc_socket(new, cont); - (*new)->socketdes = socket(family, type, 0); + (*new)->socketdes = socket(family, type, protocol); #if APR_HAVE_IPV6 if ((*new)->socketdes < 0 && downgrade) { family = AF_INET; - (*new)->socketdes = socket(family, type, 0); + (*new)->socketdes = socket(family, type, protocol); } #endif if ((*new)->socketdes < 0) { return APR_OS2_STATUS(sock_errno()); } - set_socket_vars(*new, family, type); + set_socket_vars(*new, family, type, protocol); (*new)->timeout = -1; (*new)->nonblock = FALSE; @@ -138,6 +145,12 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int type, + apr_pool_t *cont) +{ + return apr_socket_create_ex(new, family, type, 0, cont); +} + APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { if (shutdown(thesocket->socketdes, how) == 0) { @@ -177,7 +190,7 @@ APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { alloc_socket(new, connection_context); - set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM); + set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM, sock->protocol); (*new)->timeout = -1; (*new)->nonblock = FALSE; @@ -246,7 +259,11 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_pool_t *cont) { alloc_socket(apr_sock, cont); - set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type); +#ifdef APR_ENABLE_FOR_1_0 /* no protocol field yet */ + set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, 0); +#else + set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, os_sock_info->protocol); +#endif (*apr_sock)->timeout = -1; (*apr_sock)->socketdes = *os_sock_info->os_sock; if (os_sock_info->local) { @@ -280,7 +297,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *th } if ((*sock) == NULL) { alloc_socket(sock, cont); - set_socket_vars(*sock, AF_INET, SOCK_STREAM); + set_socket_vars(*sock, AF_INET, SOCK_STREAM, APR_PROTO_TCP); (*sock)->timeout = -1; } diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 057e56fdcaf..7fe93a2d3e4 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -77,9 +77,10 @@ static apr_status_t socket_cleanup(void *sock) } } -static void set_socket_vars(apr_socket_t *sock, int family, int type) +static void set_socket_vars(apr_socket_t *sock, int family, int type, int protocol) { sock->type = type; + sock->protocol = protocol; apr_sockaddr_vars_set(sock->local_addr, family, 0); apr_sockaddr_vars_set(sock->remote_addr, family, 0); sock->netmask = 0; @@ -103,8 +104,14 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr->pool = p; } -apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, - apr_pool_t *cont) +apr_status_t apr_socket_protocol_get(apr_socket_t *sock, int *protocol) +{ + *protocol = sock->protocol; + return APR_SUCCESS; +} + +apr_status_t apr_socket_create_ex(apr_socket_t **new, int ofamily, int type, + int protocol, apr_pool_t *cont) { int family = ofamily; @@ -118,19 +125,19 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, alloc_socket(new, cont); - (*new)->socketdes = socket(family, type, 0); + (*new)->socketdes = socket(family, type, protocol); #if APR_HAVE_IPV6 if ((*new)->socketdes < 0 && ofamily == APR_UNSPEC) { family = APR_INET; - (*new)->socketdes = socket(family, type, 0); + (*new)->socketdes = socket(family, type, protocol); } #endif if ((*new)->socketdes < 0) { return errno; } - set_socket_vars(*new, family, type); + set_socket_vars(*new, family, type, protocol); (*new)->timeout = -1; (*new)->inherit = 0; @@ -139,6 +146,12 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, return APR_SUCCESS; } +apr_status_t apr_socket_create(apr_socket_t **new, int family, int type, + apr_pool_t *cont) +{ + return apr_socket_create_ex(new, family, type, 0, cont); +} + apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { return (shutdown(thesocket->socketdes, how) == -1) ? errno : APR_SUCCESS; @@ -176,7 +189,7 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { alloc_socket(new, connection_context); - set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM); + set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM, sock->protocol); #ifndef HAVE_POLL (*new)->connected = 1; @@ -322,7 +335,11 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_pool_t *cont) { alloc_socket(apr_sock, cont); - set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type); +#ifdef APR_ENABLE_FOR_1_0 /* no protocol field yet */ + set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, os_sock_info->protocol); +#else + set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, 0); +#endif (*apr_sock)->timeout = -1; (*apr_sock)->socketdes = *os_sock_info->os_sock; if (os_sock_info->local) { @@ -360,7 +377,7 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, /* XXX IPv6 figure out the family here! */ /* XXX figure out the actual socket type here */ /* *or* just decide that apr_os_sock_put() has to be told the family and type */ - set_socket_vars(*sock, APR_INET, SOCK_STREAM); + set_socket_vars(*sock, APR_INET, SOCK_STREAM, APR_PROTO_TCP); (*sock)->timeout = -1; } (*sock)->local_port_unknown = (*sock)->local_interface_unknown = 1; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index bff6b651686..5e4d208a86f 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -76,9 +76,10 @@ static apr_status_t socket_cleanup(void *sock) return APR_SUCCESS; } -static void set_socket_vars(apr_socket_t *sock, int family, int type) +static void set_socket_vars(apr_socket_t *sock, int family, int type, int protocol) { sock->type = type; + sock->protocol = protocol; apr_sockaddr_vars_set(sock->local_addr, family, 0); apr_sockaddr_vars_set(sock->remote_addr, family, 0); } @@ -94,8 +95,16 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr->pool = p; } -APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, - int type, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, + int *protocol) +{ + *protocol = sock->protocol; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_socket_create_ex(apr_socket_t **new, int family, + int type, int protocol, + apr_pool_t *cont) { int downgrade = (family == AF_UNSPEC); @@ -112,11 +121,11 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, /* For right now, we are not using socket groups. We may later. * No flags to use when creating a socket, so use 0 for that parameter as well. */ - (*new)->socketdes = socket(family, type, 0); + (*new)->socketdes = socket(family, type, protocol); #if APR_HAVE_IPV6 if ((*new)->socketdes == INVALID_SOCKET && downgrade) { family = AF_INET; - (*new)->socketdes = socket(family, type, 0); + (*new)->socketdes = socket(family, type, protocol); } #endif @@ -159,7 +168,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, #endif /* def WIN32 */ - set_socket_vars(*new, family, type); + set_socket_vars(*new, family, type, protocol); (*new)->timeout = -1; (*new)->disconnected = 0; @@ -170,6 +179,12 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, + int type, apr_pool_t *cont) +{ + return apr_socket_create_ex(new, family, type, protocol, cont); +} + APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { @@ -246,7 +261,8 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, } alloc_socket(new, p); - set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM); + set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM, + sock->protocol); (*new)->timeout = -1; (*new)->disconnected = 0; @@ -408,7 +424,11 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_pool_t *cont) { alloc_socket(apr_sock, cont); - set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type); +#ifdef APR_ENABLE_FOR_1_0 /* no protocol field yet */ + set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, 0); +#else + set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, os_sock_info->protocol); +#endif (*apr_sock)->timeout = -1; (*apr_sock)->disconnected = 0; (*apr_sock)->socketdes = *os_sock_info->os_sock; @@ -446,7 +466,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, alloc_socket(sock, cont); /* XXX figure out the actual socket type here */ /* *or* just decide that apr_os_sock_put() has to be told the family and type */ - set_socket_vars(*sock, AF_INET, SOCK_STREAM); + set_socket_vars(*sock, AF_INET, SOCK_STREAM, APR_PROTO_TCP); (*sock)->timeout = -1; (*sock)->disconnected = 0; } diff --git a/test/server.c b/test/server.c index 7c45a00e0c2..fb298ea3f90 100644 --- a/test/server.c +++ b/test/server.c @@ -79,6 +79,7 @@ int main(int argc, const char * const argv[]) apr_sockaddr_t *localsa = NULL, *remotesa; apr_status_t stat; int family = APR_UNSPEC; + int protocol; apr_getopt_t *opt; const char *optarg; char optchar; @@ -113,7 +114,7 @@ int main(int argc, const char * const argv[]) } APR_TEST_SUCCESS(rv, "Creating new socket", - apr_socket_create(&sock, family, SOCK_STREAM, context)) + apr_socket_create_ex(&sock, family, SOCK_STREAM, APR_PROTO_TCP, context)) APR_TEST_SUCCESS(rv, "Setting option APR_SO_NONBLOCK", apr_socket_opt_set(sock, APR_SO_NONBLOCK, 1)) @@ -153,6 +154,12 @@ int main(int argc, const char * const argv[]) APR_TEST_SUCCESS(rv, "Accepting a connection", apr_accept(&sock2, sock, context)) + apr_socket_protocol_get(sock2, &protocol); + if (protocol != APR_PROTO_TCP) { + fprintf(stderr, "Error: protocol not conveyed from listening socket " + "to connected socket!\n"); + exit(1); + } apr_socket_addr_get(&remotesa, APR_REMOTE, sock2); apr_sockaddr_ip_get(&remote_ipaddr, remotesa); apr_sockaddr_port_get(&remote_port, remotesa); From 4a5af05ce54c16fb9b90a152f657637bd91ca389 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Oct 2002 12:36:12 +0000 Subject: [PATCH 3925/7878] mention need to clean up protocol info for socket creation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63944 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 808b60e3311..45cb529f4a3 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/09/13 23:17:45 $] +Last modified at [$Date: 2002/10/18 12:36:12 $] Release: @@ -68,7 +68,13 @@ RELEASE SHOWSTOPPERS: runtime linker will catch new function requirements across minor rev upgrades, but will not catch new constants." - + + * For 1.0, clean up ability to specify protocol for a socket by + axing apr_socket_create_ex(), adding protocol parm to + apr_socket_create(), and enabling protocol field in + apr_os_sock_info_t. + + 1.0 showstopper (not 0.9.x): trawick CURRENT VOTES: From c2ac9f115e806d74cf0d23cd71ab683272cad121 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Oct 2002 14:03:42 +0000 Subject: [PATCH 3926/7878] fix compile break Submitted by: Randall Stewart Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63945 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 5e4d208a86f..6da7c3a93ea 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -182,7 +182,7 @@ APR_DECLARE(apr_status_t) apr_socket_create_ex(apr_socket_t **new, int family, APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int type, apr_pool_t *cont) { - return apr_socket_create_ex(new, family, type, protocol, cont); + return apr_socket_create_ex(new, family, type, 0, cont); } APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, From 38cfac1668875a65b75ce7ba413c7258a2cbe02c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Oct 2002 14:13:38 +0000 Subject: [PATCH 3927/7878] apr_os_sock_put() shouldn't assume any particular protocol Submitted by: Randall Stewart Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63946 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 2 +- network_io/unix/sockets.c | 2 +- network_io/win32/sockets.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 3f72bd59001..9efc135350d 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -297,7 +297,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *th } if ((*sock) == NULL) { alloc_socket(sock, cont); - set_socket_vars(*sock, AF_INET, SOCK_STREAM, APR_PROTO_TCP); + set_socket_vars(*sock, AF_INET, SOCK_STREAM, 0); (*sock)->timeout = -1; } diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 7fe93a2d3e4..3092301924e 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -377,7 +377,7 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, /* XXX IPv6 figure out the family here! */ /* XXX figure out the actual socket type here */ /* *or* just decide that apr_os_sock_put() has to be told the family and type */ - set_socket_vars(*sock, APR_INET, SOCK_STREAM, APR_PROTO_TCP); + set_socket_vars(*sock, APR_INET, SOCK_STREAM, 0); (*sock)->timeout = -1; } (*sock)->local_port_unknown = (*sock)->local_interface_unknown = 1; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 6da7c3a93ea..e1dabdc075b 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -466,7 +466,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, alloc_socket(sock, cont); /* XXX figure out the actual socket type here */ /* *or* just decide that apr_os_sock_put() has to be told the family and type */ - set_socket_vars(*sock, AF_INET, SOCK_STREAM, APR_PROTO_TCP); + set_socket_vars(*sock, AF_INET, SOCK_STREAM, 0); (*sock)->timeout = -1; (*sock)->disconnected = 0; } From 88e11aa7d6a053d85bbc1c90a2765f2ae2c2be3f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Oct 2002 15:00:35 +0000 Subject: [PATCH 3928/7878] %ld is the right format for size_t on Linux for s/390 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63947 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.in b/configure.in index dc4a349d437..0f5433e91dd 100644 --- a/configure.in +++ b/configure.in @@ -1179,6 +1179,11 @@ fi case $host in *linux*) off_t_fmt='#define APR_OFF_T_FMT "ld"' + case $host in + s390*) + size_t_fmt='#define APR_SIZE_T_FMT "ld"' + ;; + esac ;; *os2_emx) off_t_fmt='#define APR_OFF_T_FMT "ld"' From f568ab144c6605de49aaabf50eb9cb13c0aa23c1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Oct 2002 15:08:09 +0000 Subject: [PATCH 3929/7878] fix compile break in OS/2 and Win32 apr_os_sock_make() Reported by: Brent R. Matzelle git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63948 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 4 ++-- network_io/win32/sockets.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 9efc135350d..7148cee83ec 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -260,9 +260,9 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, { alloc_socket(apr_sock, cont); #ifdef APR_ENABLE_FOR_1_0 /* no protocol field yet */ - set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, 0); -#else set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, os_sock_info->protocol); +#else + set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, 0); #endif (*apr_sock)->timeout = -1; (*apr_sock)->socketdes = *os_sock_info->os_sock; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index e1dabdc075b..0710689190d 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -425,9 +425,9 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, { alloc_socket(apr_sock, cont); #ifdef APR_ENABLE_FOR_1_0 /* no protocol field yet */ - set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, 0); -#else set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, os_sock_info->protocol); +#else + set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, 0); #endif (*apr_sock)->timeout = -1; (*apr_sock)->disconnected = 0; From 590d646f4145c704c3bd4cde9b16304b3c41bc5b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Oct 2002 19:37:44 +0000 Subject: [PATCH 3930/7878] This was at best simply the wrong patch (aught to have been -Wl,+s) but at worst is the wrong solution for gcc builds. Leave this alone for now, reverting the prior HP/UX workaround. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63949 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 3 --- 1 file changed, 3 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 1e7dc91ef7c..905f810aa66 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -81,7 +81,6 @@ if test "x$apr_preload_done" != "xyes" ; then ;; *-hp-hpux11.*) APR_ADDTO(CPPFLAGS, [-DHPUX11 -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED]) - APR_ADDTO(LDFLAGS, [+s]) ;; *-hp-hpux10.*) case $host in @@ -92,11 +91,9 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; esac APR_ADDTO(CPPFLAGS, [-D_REENTRANT]) - APR_ADDTO(LDFLAGS, [+s]) ;; *-hp-hpux*) APR_ADDTO(CPPFLAGS, [-DHPUX -D_REENTRANT]) - APR_ADDTO(LDFLAGS, [+s]) ;; *-linux-*) case `uname -r` in From 992ca907d5e5f09b3bc8a32a794d0e560ca21a6d Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 19 Oct 2002 03:20:44 +0000 Subject: [PATCH 3931/7878] OS/2: Add implementation of apr_os_pipe_put(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63950 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/pipe.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index a40ac981eb1..b96e5e43f10 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -58,6 +58,7 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" +#include "apr_portable.h" #include #include @@ -180,3 +181,20 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int } return APR_EINVAL; } + + + +APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, + apr_os_file_t *thefile, + apr_pool_t *pool) +{ + (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file)->pool = pool; + (*file)->isopen = TRUE; + (*file)->pipe = 1; + (*file)->blocking = BLK_UNKNOWN; /* app needs to make a timeout call */ + (*file)->timeout = -1; + (*file)->filedes = *thefile; + + return APR_SUCCESS; +} From 1d8b0ca8503d3bd1b511dcf27e2c7f5d07fd3fa4 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 19 Oct 2002 18:00:54 +0000 Subject: [PATCH 3932/7878] Determine sizeof(void *) during configuration (we'll need this in order to help map an upcoming "atomic compare-and-swap for pointers" to the right inline assembly) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63951 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 ++++++++++ include/apr.h.in | 2 ++ 2 files changed, 12 insertions(+) diff --git a/configure.in b/configure.in index 0f5433e91dd..b4f4d12b7a4 100644 --- a/configure.in +++ b/configure.in @@ -1020,6 +1020,15 @@ APR_CHECK_SOCKLEN_T APR_INADDR_NONE +dnl Checks for pointer size +AC_CHECK_SIZEOF(void*, 4) + +if test "x$ac_cv_sizeof_voidp" != "x"; then + voidp_size=$ac_cv_sizeof_voidp +else + AC_ERROR([Cannot determine size of void*]) +fi + dnl Checks for integer size AC_CHECK_SIZEOF(char, 1) AC_CHECK_SIZEOF(int, 4) @@ -1208,6 +1217,7 @@ case $host in ;; esac +AC_SUBST(voidp_size) AC_SUBST(short_value) AC_SUBST(int_value) AC_SUBST(long_value) diff --git a/include/apr.h.in b/include/apr.h.in index fcb8efe11cb..2a6280520b9 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -194,6 +194,8 @@ typedef @ssize_t_value@ apr_ssize_t; typedef @off_t_value@ apr_off_t; typedef @socklen_t_value@ apr_socklen_t; +#define APR_SIZEOF_VOIDP @voidp_size@ + /* Mechanisms to properly type numeric literals */ @int64_literal@ From 8c43d9c330f766c3e43e9b207fa97f0174c771e4 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 19 Oct 2002 18:06:59 +0000 Subject: [PATCH 3933/7878] fix an old typo and a bad cut-and-paste git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63952 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index c4c98539a7d..eeefb1fe085 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -158,7 +158,7 @@ int apr_atomic_dec(volatile apr_atomic_t *mem) } #endif /*!defined(apr_atomic_dec) && !defined(APR_OVERRIDE_ATOMIC_DEC) */ -#if !defined(apr_atomic_cas) && !defined(APR_OVERRIDE_ATOMIC_CASE) +#if !defined(apr_atomic_cas) && !defined(APR_OVERRIDE_ATOMIC_CAS) apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp) { long prev; @@ -182,4 +182,4 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp) return prev; #endif /* APR_HAS_THREADS */ } -#endif /*!defined(apr_atomic_dec) && !defined(APR_OVERRIDE_ATOMIC_DEC) */ +#endif /*!defined(apr_atomic_cas) && !defined(APR_OVERRIDE_ATOMIC_CAS) */ From e8f4f6ce6a0bcce80c78841c8f30d7e1f93ea9ab Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 19 Oct 2002 19:05:53 +0000 Subject: [PATCH 3934/7878] Add pointer version of apr_atomic_cas git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63953 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ atomic/solaris_sparc/Makefile.in | 2 +- .../apr_atomic_sparc_no_support.c | 5 ++-- atomic/unix/apr_atomic.c | 26 +++++++++++++++++++ configure.in | 4 +-- include/apr_atomic.h | 20 ++++++++++++++ 6 files changed, 55 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 9449ceeb07f..8e49eb5f259 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.2 + *) Add apr_atomic_casptr() to support atomic compare-and-swap + of pointers [Brian Pane] + *) Add apr_socket_create_ex() to allow protocol to be specified for the socket. With APR 1.0, this function will be removed and apr_socket_create() will have the additional parameter. diff --git a/atomic/solaris_sparc/Makefile.in b/atomic/solaris_sparc/Makefile.in index 571440781ac..df5e6cfeafa 100644 --- a/atomic/solaris_sparc/Makefile.in +++ b/atomic/solaris_sparc/Makefile.in @@ -1,7 +1,7 @@ srcdir = @srcdir@ VPATH = @srcdir@ -TARGETS = @apr_atomic_sparc_compile@ +TARGETS = @apr_atomic_sparc_compile@ apr_atomic_sparc_no_support.lo ASFLAGS += @ASFLAGS@ ASCPPFLAGS = @ASCPPFLAGS@ diff --git a/atomic/solaris_sparc/apr_atomic_sparc_no_support.c b/atomic/solaris_sparc/apr_atomic_sparc_no_support.c index 97b95b139c0..029d2760c8e 100644 --- a/atomic/solaris_sparc/apr_atomic_sparc_no_support.c +++ b/atomic/solaris_sparc/apr_atomic_sparc_no_support.c @@ -1,5 +1,6 @@ #include "apr.h" -#if APR_FORCE_ATOMIC_GENERIC +/* Pick up the default implementations of any atomic operations + * that haven't been redefined as Sparc-specific functions + */ #include "../unix/apr_atomic.c" -#else #endif diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index eeefb1fe085..10ffb491657 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -183,3 +183,29 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp) #endif /* APR_HAS_THREADS */ } #endif /*!defined(apr_atomic_cas) && !defined(APR_OVERRIDE_ATOMIC_CAS) */ + +#if !defined(apr_atomic_casptr) && !defined(APR_OVERRIDE_ATOMIC_CASPTR) +void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + void *prev; +#if APR_HAS_THREADS + apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + + if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { + prev = *(void **)mem; + if (prev == cmp) { + *mem = with; + } + apr_thread_mutex_unlock(lock); + return prev; + } + return *(void **)mem; +#else + prev = *(void **)mem; + if (prev == cmp) { + *mem = with; + } + return prev; +#endif /* APR_HAS_THREADS */ +} +#endif /*!defined(apr_atomic_cas) && !defined(APR_OVERRIDE_ATOMIC_CAS) */ diff --git a/configure.in b/configure.in index b4f4d12b7a4..6b0a9c6e55a 100644 --- a/configure.in +++ b/configure.in @@ -402,7 +402,7 @@ case $host in case "$sparc_arch" in sun4c|sun4m|sun4d|sun4t|sun4) apr_force_atomic_generic=1 - apr_atomic_sparc_compile=apr_atomic_sparc_no_support.lo + apr_atomic_sparc_compile="" ;; *) if test -n "$is_gnu_as"; then @@ -418,7 +418,7 @@ case $host in esac else apr_force_atomic_generic=1 - apr_atomic_sparc_compile=apr_atomic_sparc_no_support.lo + apr_atomic_sparc_compile="" fi AC_SUBST(ASCPPFLAGS) AC_SUBST(ASFLAGS) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 9a3eb43c3d3..b2ab37eee3c 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -63,6 +63,7 @@ extern "C" { #endif +#include "apr.h" #include "apr_pools.h" /** @@ -134,6 +135,16 @@ int apr_atomic_dec(volatile apr_atomic_t *mem); * on some platforms they may be implemented by different mechanisms */ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); + +/** + * compare the pointer's value with cmp. + * If they are the same swap the value with 'with' + * @param mem pointer to the pointer + * @param with what to swap it with + * @param the value to compare it to + * @return the old value of the pointer + */ +void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); #else /* !DOXYGEN */ /* The following definitions provide optimized, OS-specific @@ -308,6 +319,15 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #define APR_ATOMIC_NEED_DEFAULT_INIT 1 #endif +#if !defined(apr_atomic_casptr) && !defined(APR_OVERRIDE_ATOMIC_CASPTR) +#if APR_SIZEOF_VOIDP == 4 +#define apr_atomic_casptr(mem, with, cmp) (void *)apr_atomic_cas((apr_uint32_t *)(mem), (long)(with), (long)cmp) +#else +void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); +#define APR_ATOMIC_NEED_DEFAULT_INIT 1 +#endif +#endif + #ifndef APR_ATOMIC_NEED_DEFAULT_INIT #define APR_ATOMIC_NEED_DEFAULT_INIT 0 #endif From a650a0717cfb166548ade21e782006cd3f3642a9 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 19 Oct 2002 19:06:44 +0000 Subject: [PATCH 3935/7878] updated testatomic to cover apr_atomic_casptr git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63954 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/test/testatomic.c b/test/testatomic.c index cbd36344d77..d1411fa61a8 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -83,7 +83,11 @@ apr_atomic_t y; /* atomic locks */ static apr_status_t check_basic_atomics(volatile apr_atomic_t*p) { apr_atomic_t oldval; - apr_atomic_t casval = 0; + apr_uint32_t casval = 0; + float object1, object2; + void *casptr; + void *oldptr; + apr_atomic_set(&y, 2); printf("%-60s", "testing apr_atomic_dec"); if (apr_atomic_dec(&y) == 0) { @@ -122,6 +126,29 @@ static apr_status_t check_basic_atomics(volatile apr_atomic_t*p) } printf("OK\n"); + printf("%-60s", "testing CAS for pointers"); + casptr = NULL; + oldptr = apr_atomic_casptr(&casptr, &object1, 0); + if (oldptr != 0) { + fprintf(stderr, "Failed\noldval =%p should be zero\n", oldptr); + return APR_EGENERAL; + } + printf("OK\n"); + printf("%-60s", "testing CAS for pointers - match non-null"); + oldptr = apr_atomic_casptr(&casptr, &object2, &object1); + if (oldptr != &object1) { + fprintf(stderr, "Failed\noldval =%p should be %p\n", oldptr, &object1); + return APR_EGENERAL; + } + printf("OK\n"); + printf("%-60s", "testing CAS - no match"); + oldptr = apr_atomic_casptr(&casptr, &object2, &object1); + if (oldptr != &object2) { + fprintf(stderr, "Failed\noldval =%p should be %p\n", oldptr, &object2); + return APR_EGENERAL; + } + printf("OK\n"); + printf("%-60s", "testing add"); apr_atomic_set(&y, 23); apr_atomic_add(&y, 4); From 4149cb7a3777a188793c3bd96441f952d25fe15f Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 19 Oct 2002 19:15:20 +0000 Subject: [PATCH 3936/7878] fix the label on one of the new tests git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63955 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testatomic.c b/test/testatomic.c index d1411fa61a8..3b13d20624b 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -141,7 +141,7 @@ static apr_status_t check_basic_atomics(volatile apr_atomic_t*p) return APR_EGENERAL; } printf("OK\n"); - printf("%-60s", "testing CAS - no match"); + printf("%-60s", "testing CAS for pointers - no match"); oldptr = apr_atomic_casptr(&casptr, &object2, &object1); if (oldptr != &object2) { fprintf(stderr, "Failed\noldval =%p should be %p\n", oldptr, &object2); From 05142feb8b1b59095532368700bf996d05696a4a Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 19 Oct 2002 19:16:41 +0000 Subject: [PATCH 3937/7878] remove an extraneous endif git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63956 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/apr_atomic_sparc_no_support.c | 1 - 1 file changed, 1 deletion(-) diff --git a/atomic/solaris_sparc/apr_atomic_sparc_no_support.c b/atomic/solaris_sparc/apr_atomic_sparc_no_support.c index 029d2760c8e..d77c7886054 100644 --- a/atomic/solaris_sparc/apr_atomic_sparc_no_support.c +++ b/atomic/solaris_sparc/apr_atomic_sparc_no_support.c @@ -3,4 +3,3 @@ * that haven't been redefined as Sparc-specific functions */ #include "../unix/apr_atomic.c" -#endif From 9ca481cfef9b85aadde4cc5d20c515905de4cc6b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 21 Oct 2002 11:19:41 +0000 Subject: [PATCH 3938/7878] add a note about apr_os_sock_put() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63957 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_portable.h b/include/apr_portable.h index 3189f6088f8..78f027c0783 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -393,6 +393,8 @@ APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, * @param sock The pool to use. * @param thesock The socket to convert to. * @param cont The socket we are converting to an apr type. + * @remark If it is a true socket, it is best to call apr_os_sock_make() + * and provide APR with more information about the socket. */ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, From 7c7b02927f34ee63138f10a95ce0251b38cb5efd Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 21 Oct 2002 17:41:41 +0000 Subject: [PATCH 3939/7878] Win32: apr_atomic_casptr. Not tested. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63958 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index b2ab37eee3c..d1a46ff7688 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -165,6 +165,7 @@ typedef LONG apr_atomic_t; #define apr_atomic_read(mem) (*mem) #define apr_atomic_cas(mem,with,cmp) InterlockedCompareExchange(mem,with,cmp) #define apr_atomic_init(pool) APR_SUCCESS +#define apr_atomic_casptr(mem,with,cmp) InterlockedCompareExchangePointer(mem,with,cmp) #elif defined(NETWARE) From c20876963939aac1bcb403327833ea9e95d08e2b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 22 Oct 2002 02:23:20 +0000 Subject: [PATCH 3940/7878] Allow people who use userdata to distinguish between a successful retrieval from the pool userdata, and not being able to retrieve. We could also separate out when the hash doesn't exist, but I have left that for somebody else. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63959 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 ++ memory/unix/apr_pools.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index ccbf1956691..c701db7bdec 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -421,6 +421,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_EMISMATCH (APR_OS_START_STATUS + 24) /** @see APR_STATUS_IS_EBUSY */ #define APR_EBUSY (APR_OS_START_STATUS + 25) +/**@see APR_STATUS_IS_KEYNOTFOUND */ +#define APR_KEYNOTFOUND (APR_OS_START_STATUS + 26) /** * @defgroup aprerr_status Status Value Tests diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 7422de5d6fd..0d29b25bd05 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1860,10 +1860,16 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_check_integrity(pool); #endif /* APR_POOL_DEBUG */ - if (pool->user_data == NULL) + if (pool->user_data == NULL) { *data = NULL; - else + } + else { *data = apr_hash_get(pool->user_data, key, APR_HASH_KEY_STRING); + } + + if (*data == NULL) { + return APR_KEYNOTFOUND; + } return APR_SUCCESS; } From a34b90d358969f2889f5b16a5653784a33534c2f Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 22 Oct 2002 02:24:59 +0000 Subject: [PATCH 3941/7878] Port testud to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63960 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 +-- test/test_apr.h | 1 + test/testall.c | 8 +++-- test/testud.c | 76 +++++++++++++++++++++++++++++++++++++----------- 4 files changed, 67 insertions(+), 22 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 13cc7d2edb9..24c8ad8332a 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -209,8 +209,8 @@ testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) testtable@EXEEXT@: testtable.lo $(LOCAL_LIBS) $(LINK) testtable.lo $(LOCAL_LIBS) $(ALL_LIBS) -testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo CuTest.lo $(LOCAL_LIBS) - $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) +testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo CuTest.lo $(LOCAL_LIBS) + $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index a38865ce923..3996181006f 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -71,6 +71,7 @@ CuSuite *testtime(void); CuSuite *testvsn(void); CuSuite *testipsub(void); CuSuite *testmmap(void); +CuSuite *testud(void); diff --git a/test/testall.c b/test/testall.c index 5bd08634875..2a03af4aedb 100644 --- a/test/testall.c +++ b/test/testall.c @@ -57,7 +57,7 @@ #include "test_apr.h" -#define NUM_TESTS 5 +#define NUM_TESTS 255 apr_pool_t *p; @@ -68,7 +68,9 @@ testfunc *tests[NUM_TESTS] = { testtime, testvsn, testipsub, - testmmap + testmmap, + testud, + NULL }; int main(int argc, char *argv[]) @@ -84,7 +86,7 @@ int main(int argc, char *argv[]) apr_pool_create(&p, NULL); - for (i = 0; i < NUM_TESTS; i++) { + for (i = 0; tests[i]; i++) { CuSuiteListAdd(alltests, tests[i]()); } diff --git a/test/testud.c b/test/testud.c index 2393c3a2e62..e6521b05d1d 100644 --- a/test/testud.c +++ b/test/testud.c @@ -61,36 +61,78 @@ #include "apr_strings.h" #include "test_apr.h" +static apr_pool_t *pool; +static char *testdata; +static int cleanup_called = 0; + static apr_status_t string_cleanup(void *data) { + cleanup_called = 1; return APR_SUCCESS; } -int main(void) +static void set_userdata(CuTest *tc) +{ + apr_status_t rv; + + rv = apr_pool_userdata_set(testdata, "TEST", string_cleanup, pool); + CuAssertIntEquals(tc, rv, APR_SUCCESS); +} + +static void get_userdata(CuTest *tc) { - apr_pool_t *pool; - char *testdata; + apr_status_t rv; char *retdata; - printf("APR User Data Test\n==================\n\n"); + rv = apr_pool_userdata_get((void **)&retdata, "TEST", pool); + CuAssertIntEquals(tc, rv, APR_SUCCESS); + CuAssertStrEquals(tc, retdata, testdata); +} - STD_TEST_NEQ("Initializing APR", apr_initialize()) - atexit(apr_terminate); +static void get_nonexistkey(CuTest *tc) +{ + apr_status_t rv; + char *retdata; - STD_TEST_NEQ("Creating a pool", apr_pool_create(&pool, NULL)) + rv = apr_pool_userdata_get((void **)&retdata, "DOESNTEXIST", pool); + CuAssertTrue(tc, rv != APR_SUCCESS); + CuAssertPtrEquals(tc, retdata, NULL); + CuAssertIntEquals(tc, rv, APR_KEYNOTFOUND); +} +static void post_pool_clear(CuTest *tc) +{ + apr_status_t rv; + char *retdata; + + rv = apr_pool_userdata_get((void **)&retdata, "DOESNTEXIST", pool); + CuAssertTrue(tc, rv != APR_SUCCESS); + CuAssertPtrEquals(tc, retdata, NULL); + CuAssertIntEquals(tc, rv, APR_KEYNOTFOUND); +} + +CuSuite *testud(void) +{ + CuSuite *suite = CuSuiteNew("Test User Data"); + + apr_pool_create(&pool, p); testdata = apr_pstrdup(pool, "This is a test\n"); - printf("Testing pool\n"); - STD_TEST_NEQ(" Setting user data into the pool", - apr_pool_userdata_set(testdata, "TEST", string_cleanup, pool)) - - STD_TEST_NEQ(" Getting user data from the pool", - apr_pool_userdata_get((void **)&retdata, "TEST", pool)) + SUITE_ADD_TEST(suite, set_userdata); + SUITE_ADD_TEST(suite, get_userdata); + SUITE_ADD_TEST(suite, get_nonexistkey); - TEST_NEQ(" Checking the data we got", strcmp(testdata, retdata), - 0, "OK","Failed :(") + apr_pool_clear(pool); - printf("\nTest complete\n"); - return 0; + SUITE_ADD_TEST(suite, post_pool_clear); + + return suite; } + +#ifdef SINGLE_PROG +CuSuite *getsuite(void) +{ + return testud(); +} +#endif + From f4303dffadbaa0bb1888f9a900017e3b31218bac Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 22 Oct 2002 03:35:47 +0000 Subject: [PATCH 3942/7878] Win32: Fix apr_shutdown() to honor the setting of apr_shutdown_how_e git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63961 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ network_io/win32/sockets.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8e49eb5f259..4e7ac1d7322 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR 0.9.2 + *) Win32: apr_shutdown was not honoring apr_shutdown_how_e and + always shutting down the socket for read. This could result + in Apache HTTPD 2.0 clients getting early connection closures + because lingering_close() was broken. [Bill Stoddard, Allan Edwards] *) Add apr_atomic_casptr() to support atomic compare-and-swap of pointers [Brian Pane] diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 0710689190d..468958dee0c 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -190,7 +190,7 @@ APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, { int winhow = 0; -#if SD_RECEIVE +#ifdef SD_RECEIVE switch (how) { case APR_SHUTDOWN_READ: { winhow = SD_RECEIVE; From 70075a90e9f1089bc00006827b0d0c21edc1bac1 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 22 Oct 2002 04:59:26 +0000 Subject: [PATCH 3943/7878] More work? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63962 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 45cb529f4a3..1bf8925a77c 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/10/18 12:36:12 $] +Last modified at [$Date: 2002/10/22 04:59:26 $] Release: @@ -81,6 +81,9 @@ CURRENT VOTES: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * Someone needs to port testucs to Unix. Right now it only works + on Windows. + * The return type of a thread function (void *) is inconsistent with the type used in apr_thread_exit()/apr_thread_join() (apr_status_t). The thread function's return type should be changed to apr_status_t From 186db0cbb11d45e871e6cdf3fb7590fa88d431df Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 22 Oct 2002 05:44:12 +0000 Subject: [PATCH 3944/7878] Port testtable to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63963 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testtable.c | 205 +++++++++++++++++++++++++++++------------------ 4 files changed, 130 insertions(+), 81 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 24c8ad8332a..069186b5c47 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -209,8 +209,8 @@ testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) testtable@EXEEXT@: testtable.lo $(LOCAL_LIBS) $(LINK) testtable.lo $(LOCAL_LIBS) $(ALL_LIBS) -testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo CuTest.lo $(LOCAL_LIBS) - $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) +testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo CuTest.lo $(LOCAL_LIBS) + $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index 3996181006f..ed163baa806 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -72,6 +72,7 @@ CuSuite *testvsn(void); CuSuite *testipsub(void); CuSuite *testmmap(void); CuSuite *testud(void); +CuSuite *testtable(void); diff --git a/test/testall.c b/test/testall.c index 2a03af4aedb..c2c471796c8 100644 --- a/test/testall.c +++ b/test/testall.c @@ -70,6 +70,7 @@ testfunc *tests[NUM_TESTS] = { testipsub, testmmap, testud, + testtable, NULL }; diff --git a/test/testtable.c b/test/testtable.c index 97c926eaacc..a86dc68851b 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -52,6 +52,7 @@ * . */ +#include "test_apr.h" #include "apr.h" #include "apr_strings.h" #include "apr_general.h" @@ -67,80 +68,100 @@ #include #endif -int main(int argc, const char *const argv[]) +apr_table_t *t1 = NULL; + +static void table_make(CuTest *tc) { - apr_pool_t *p; - apr_table_t *t1, *t2; + t1 = apr_table_make(p, 5); + CuAssertPtrNotNull(tc, t1); +} +static void table_get(CuTest *tc) +{ + apr_status_t rv; const char *val; - apr_initialize(); - atexit(apr_terminate); + apr_table_set(t1, "foo", "bar"); + val = apr_table_get(t1, "foo"); + CuAssertStrEquals(tc, val, "bar"); +} - apr_pool_create(&p, NULL); +static void table_set(CuTest *tc) +{ + apr_status_t rv; + const char *val; - t1 = apr_table_make(p, 5); - t2 = apr_table_make(p, 5); + apr_table_set(t1, "setkey", "bar"); + apr_table_set(t1, "setkey", "2ndtry"); + val = apr_table_get(t1, "setkey"); + CuAssertStrEquals(tc, val, "2ndtry"); +} - fprintf(stderr, "Test 1: apr_table_set..."); - apr_table_set(t1, "foo", "bar"); - if (!(val = apr_table_get(t1, "foo")) || strcmp(val, "bar")) { - fprintf(stderr, "ERROR\n"); - exit(-1); - } - fprintf(stderr, "OK\n"); - - fprintf(stderr, "Test 2: apr_table_add..."); - apr_table_add(t1, "foo", "12345"); - if (!(val = apr_table_get(t1, "foo")) || strcmp(val, "bar")) { - fprintf(stderr, "ERROR\n"); - exit(-1); - } - fprintf(stderr, "OK\n"); - - fprintf(stderr, "Test 3: apr_table_set..."); - apr_table_set(t1, "abc", "def"); - apr_table_addn(t1, "foo", "dummy1"); - apr_table_addn(t1, "foo", "dummy2"); - apr_table_set(t1, "def", "abc"); - apr_table_set(t1, "foo", "zzz"); - if (!(val = apr_table_get(t1, "foo")) || strcmp(val, "zzz") || - (apr_table_elts(t1)->nelts != 3) || - !(val = apr_table_get(t1, "abc")) || strcmp(val, "def") || - !(val = apr_table_get(t1, "def")) || strcmp(val, "abc")) { - fprintf(stderr, "ERROR\n"); - exit(-1); - } - fprintf(stderr, "OK\n"); - - fprintf(stderr, "Test 4: apr_table_unset..."); - apr_table_clear(t1); - apr_table_addn(t1, "a", "1"); - apr_table_addn(t1, "b", "2"); - apr_table_addn(t1, "c", "3"); - apr_table_addn(t1, "b", "2"); - apr_table_addn(t1, "d", "4"); - apr_table_addn(t1, "e", "5"); - apr_table_addn(t1, "b", "2"); - apr_table_addn(t1, "f", "6"); - apr_table_unset(t1, "b"); - if ((apr_table_elts(t1)->nelts != 5) || - !(val = apr_table_get(t1, "a")) || strcmp(val, "1") || - !(val = apr_table_get(t1, "c")) || strcmp(val, "3") || - !(val = apr_table_get(t1, "d")) || strcmp(val, "4") || - !(val = apr_table_get(t1, "e")) || strcmp(val, "5") || - !(val = apr_table_get(t1, "f")) || strcmp(val, "6") || - (apr_table_get(t1, "b") != NULL)) { - fprintf(stderr, "ERROR\n"); - exit(-1); - } - fprintf(stderr, "OK\n"); - - fprintf(stderr, "Test 5: apr_table_overlap..."); +static void table_getnotthere(CuTest *tc) +{ + const char *val; + + val = apr_table_get(t1, "keynotthere"); + CuAssertPtrEquals(tc, NULL, (void *)val); +} + +static void table_add(CuTest *tc) +{ + const char *val; + + apr_table_add(t1, "addkey", "bar"); + apr_table_add(t1, "addkey", "foo"); + val = apr_table_get(t1, "addkey"); + CuAssertStrEquals(tc, val, "bar"); + +} + +static void table_nelts(CuTest *tc) +{ + const char *val; + apr_table_t *t = apr_table_make(p, 1); + + apr_table_set(t, "abc", "def"); + apr_table_set(t, "def", "abc"); + apr_table_set(t, "foo", "zzz"); + val = apr_table_get(t, "foo"); + CuAssertStrEquals(tc, val, "zzz"); + val = apr_table_get(t, "abc"); + CuAssertStrEquals(tc, val, "def"); + val = apr_table_get(t, "def"); + CuAssertStrEquals(tc, val, "abc"); + CuAssertIntEquals(tc, 3, apr_table_elts(t)->nelts); +} + +static void table_clear(CuTest *tc) +{ apr_table_clear(t1); + CuAssertIntEquals(tc, 0, apr_table_elts(t1)->nelts); +} + +static void table_unset(CuTest *tc) +{ + const char *val; + apr_table_t *t = apr_table_make(p, 1); + + apr_table_set(t, "a", "1"); + apr_table_set(t, "b", "2"); + apr_table_unset(t, "b"); + CuAssertIntEquals(tc, 1, apr_table_elts(t)->nelts); + val = apr_table_get(t, "a"); + CuAssertStrEquals(tc, val, "1"); + val = apr_table_get(t, "b"); + CuAssertPtrEquals(tc, (void *)val, (void *)NULL); +} + +static void table_overlap(CuTest *tc) +{ + const char *val; + apr_table_t *t1 = apr_table_make(p, 1); + apr_table_t *t2 = apr_table_make(p, 1); + apr_table_addn(t1, "a", "0"); apr_table_addn(t1, "g", "7"); - apr_table_clear(t2); apr_table_addn(t2, "a", "1"); apr_table_addn(t2, "b", "2"); apr_table_addn(t2, "c", "3"); @@ -150,19 +171,45 @@ int main(int argc, const char *const argv[]) apr_table_addn(t2, "b", "2."); apr_table_addn(t2, "f", "6"); apr_table_overlap(t1, t2, APR_OVERLAP_TABLES_SET); - if ((apr_table_elts(t1)->nelts != 7) || - !(val = apr_table_get(t1, "a")) || strcmp(val, "1") || - !(val = apr_table_get(t1, "b")) || strcmp(val, "2") || - !(val = apr_table_get(t1, "c")) || strcmp(val, "3") || - !(val = apr_table_get(t1, "d")) || strcmp(val, "4") || - !(val = apr_table_get(t1, "e")) || strcmp(val, "5") || - !(val = apr_table_get(t1, "f")) || strcmp(val, "6") || - !(val = apr_table_get(t1, "g")) || strcmp(val, "7") || - (apr_table_get(t1, "h") != NULL)) { - fprintf(stderr, "ERROR\n"); - exit(-1); - } - fprintf(stderr, "OK\n"); - - return 0; + + CuAssertIntEquals(tc, apr_table_elts(t1)->nelts, 7); + val = apr_table_get(t1, "a"); + CuAssertStrEquals(tc, val, "1"); + val = apr_table_get(t1, "b"); + CuAssertStrEquals(tc, val, "2"); + val = apr_table_get(t1, "c"); + CuAssertStrEquals(tc, val, "3"); + val = apr_table_get(t1, "d"); + CuAssertStrEquals(tc, val, "4"); + val = apr_table_get(t1, "e"); + CuAssertStrEquals(tc, val, "5"); + val = apr_table_get(t1, "f"); + CuAssertStrEquals(tc, val, "6"); + val = apr_table_get(t1, "g"); + CuAssertStrEquals(tc, val, "7"); +} + +CuSuite *testtable(void) +{ + CuSuite *suite = CuSuiteNew("Test Table"); + + SUITE_ADD_TEST(suite, table_make); + SUITE_ADD_TEST(suite, table_get); + SUITE_ADD_TEST(suite, table_set); + SUITE_ADD_TEST(suite, table_getnotthere); + SUITE_ADD_TEST(suite, table_add); + SUITE_ADD_TEST(suite, table_nelts); + SUITE_ADD_TEST(suite, table_clear); + SUITE_ADD_TEST(suite, table_unset); + SUITE_ADD_TEST(suite, table_overlap); + + return suite; +} + +#ifdef SINGLE_PROG +CuSuite *getsuite(void) +{ + return testtable(); } +#endif + From 0dcca58504438f461ca96d5127d839d7fc5b832c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 22 Oct 2002 12:37:40 +0000 Subject: [PATCH 3945/7878] add configure-time detection of issues related to SCTP protocol support Submitted by: Randall Stewart , Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63964 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 38 ++++++++++++++++++++++++++++++++++++++ configure.in | 7 +++++++ include/apr.h.in | 3 +++ 3 files changed, 48 insertions(+) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 406c15b6350..73f69bfc6e9 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -658,6 +658,44 @@ int h_e = h_errno; ])]) +dnl +dnl APR_CHECK_SCTP +dnl +dnl check for presence of SCTP protocol support +dnl +AC_DEFUN(APR_CHECK_SCTP,[ + AC_CACHE_CHECK(if SCTP protocol is supported, ac_cv_sctp,[ + AC_TRY_RUN( [ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +int main(void) { + int s = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); + if (s < 0) { + exit(1); + } + exit(0); +} +],[ + ac_cv_sctp="yes" +],[ + ac_cv_sctp="no" +],[ + ac_cv_sctp="yes" +])]) +if test "$ac_cv_sctp" = "yes"; then + have_sctp=1 +else + have_sctp=0 +fi +]) + dnl dnl APR_CHECK_H_ERRNO_FLAG dnl diff --git a/configure.in b/configure.in index 6b0a9c6e55a..6b3b0598892 100644 --- a/configure.in +++ b/configure.in @@ -930,6 +930,8 @@ APR_FLAG_HEADERS( kernel/OS.h \ net/errno.h \ netinet/in.h \ + netinet/sctp.h \ + netinet/sctp_uio.h \ sys/file.h \ sys/mman.h \ sys/poll.h \ @@ -977,6 +979,8 @@ AC_SUBST(limitsh) AC_SUBST(netdbh) AC_SUBST(sys_syslimitsh) AC_SUBST(netinet_inh) +AC_SUBST(netinet_sctph) +AC_SUBST(netinet_sctp_uioh) AC_SUBST(netinet_tcph) AC_SUBST(stdargh) AC_SUBST(stdioh) @@ -1733,9 +1737,12 @@ else acceptfilter="0" fi +APR_CHECK_SCTP + AC_SUBST(apr_tcp_nopush_flag) AC_SUBST(have_corkable_tcp) AC_SUBST(acceptfilter) +AC_SUBST(have_sctp) AC_CHECK_FUNCS(set_h_errno) APR_CHECK_RESOLV_RETRANS diff --git a/include/apr.h.in b/include/apr.h.in index 2a6280520b9..984c903b958 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -43,6 +43,8 @@ #define APR_HAVE_LIMITS_H @limitsh@ #define APR_HAVE_NETDB_H @netdbh@ #define APR_HAVE_NETINET_IN_H @netinet_inh@ +#define APR_HAVE_NETINET_SCTP_H @netinet_sctph@ +#define APR_HAVE_NETINET_SCTP_UIO_H @netinet_sctp_uioh@ #define APR_HAVE_NETINET_TCP_H @netinet_tcph@ #define APR_HAVE_PTHREAD_H @pthreadh@ #define APR_HAVE_SEMAPHORE_H @semaphoreh@ @@ -117,6 +119,7 @@ #define APR_HAVE_MEMCHR @have_memchr@ #define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@ #define APR_HAVE_UNION_SEMUN @have_union_semun@ +#define APR_HAVE_SCTP @have_sctp@ #if APR_HAVE_SYS_TYPES_H #include From 52eb8301f1e0f23d47ee56dee920abc6badf5bf5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 22 Oct 2002 13:52:16 +0000 Subject: [PATCH 3946/7878] Revert the apr_pool_userdata_get change from last night. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63965 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 -- memory/unix/apr_pools.c | 4 ---- test/testud.c | 6 ++---- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index c701db7bdec..ccbf1956691 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -421,8 +421,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_EMISMATCH (APR_OS_START_STATUS + 24) /** @see APR_STATUS_IS_EBUSY */ #define APR_EBUSY (APR_OS_START_STATUS + 25) -/**@see APR_STATUS_IS_KEYNOTFOUND */ -#define APR_KEYNOTFOUND (APR_OS_START_STATUS + 26) /** * @defgroup aprerr_status Status Value Tests diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 0d29b25bd05..2a7fdf8fc39 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1867,10 +1867,6 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, *data = apr_hash_get(pool->user_data, key, APR_HASH_KEY_STRING); } - if (*data == NULL) { - return APR_KEYNOTFOUND; - } - return APR_SUCCESS; } diff --git a/test/testud.c b/test/testud.c index e6521b05d1d..59fda0dc47b 100644 --- a/test/testud.c +++ b/test/testud.c @@ -95,9 +95,8 @@ static void get_nonexistkey(CuTest *tc) char *retdata; rv = apr_pool_userdata_get((void **)&retdata, "DOESNTEXIST", pool); - CuAssertTrue(tc, rv != APR_SUCCESS); + CuAssertIntEquals(tc, rv, APR_SUCCESS); CuAssertPtrEquals(tc, retdata, NULL); - CuAssertIntEquals(tc, rv, APR_KEYNOTFOUND); } static void post_pool_clear(CuTest *tc) @@ -106,9 +105,8 @@ static void post_pool_clear(CuTest *tc) char *retdata; rv = apr_pool_userdata_get((void **)&retdata, "DOESNTEXIST", pool); - CuAssertTrue(tc, rv != APR_SUCCESS); + CuAssertIntEquals(tc, rv, APR_SUCCESS); CuAssertPtrEquals(tc, retdata, NULL); - CuAssertIntEquals(tc, rv, APR_KEYNOTFOUND); } CuSuite *testud(void) From 9b50717eee94a54f215006b61b394d9dfd35107b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 22 Oct 2002 15:08:43 +0000 Subject: [PATCH 3947/7878] Mote the testucs.c file from test/ to test/internal/. The testucs program specifically tests internals of APR that are not exported. This is a good thing, but the test/ directory is for testing APR externals so that APR developers can ensure that their port of APR works correctly. For testing APR internals, there is now a separate directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63966 13f79535-47bb-0310-9956-ffa450edef68 --- test/{ => internal}/testucs.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/{ => internal}/testucs.c (100%) diff --git a/test/testucs.c b/test/internal/testucs.c similarity index 100% rename from test/testucs.c rename to test/internal/testucs.c From 5149a8070de7c56535b76e77dbf3199bd51c1e25 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 22 Oct 2002 18:10:26 +0000 Subject: [PATCH 3948/7878] Port testsleep to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63967 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 +-- test/test_apr.h | 1 + test/testall.c | 1 + test/testsleep.c | 84 ++++++++++++++---------------------------------- 4 files changed, 29 insertions(+), 61 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 069186b5c47..1f6d8bcae0f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -209,8 +209,8 @@ testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) testtable@EXEEXT@: testtable.lo $(LOCAL_LIBS) $(LINK) testtable.lo $(LOCAL_LIBS) $(ALL_LIBS) -testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo CuTest.lo $(LOCAL_LIBS) - $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) +testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo CuTest.lo $(LOCAL_LIBS) + $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index ed163baa806..bfec033de12 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -73,6 +73,7 @@ CuSuite *testipsub(void); CuSuite *testmmap(void); CuSuite *testud(void); CuSuite *testtable(void); +CuSuite *testsleep(void); diff --git a/test/testall.c b/test/testall.c index c2c471796c8..332469ffad2 100644 --- a/test/testall.c +++ b/test/testall.c @@ -71,6 +71,7 @@ testfunc *tests[NUM_TESTS] = { testmmap, testud, testtable, + testsleep, NULL }; diff --git a/test/testsleep.c b/test/testsleep.c index 579a6866e3f..af097dbdf03 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -52,7 +52,7 @@ * . */ -#include "apr_time.h" +#include "time.h" #include "apr_thread_proc.h" #include "apr_errno.h" #include "apr_general.h" @@ -62,73 +62,39 @@ #include #include "test_apr.h" +#define SLEEP_INTERVAL 5 -static void do_sleep(int howlong) +static void sleep_one(CuTest *tc) { - apr_time_t then, now, diff; - apr_time_t interval = apr_time_from_sec(howlong); - - printf(" I'm about to go to sleep!\n"); - - then = apr_time_now(); - apr_sleep(interval); - now = apr_time_now(); - - diff = now - then; - - printf("%-60s"," Just woken up, checking how long I've been asleep"); - if (diff < interval * 0.99 || diff > interval * 1.01) { - printf("Failed!\n\t(actual: %" APR_TIME_T_FMT - ", wanted: %" APR_TIME_T_FMT")\n", diff, interval); - } else { - printf("OK\n"); - } + time_t pretime = time(NULL); + time_t posttime; + time_t timediff; + + apr_sleep(apr_time_from_sec(SLEEP_INTERVAL)); + posttime = time(NULL); + + /* normalize the timediff. We should have slept for SLEEP_INTERVAL, so + * we should just subtract that out. + */ + timediff = posttime - pretime - SLEEP_INTERVAL; + CuAssertTrue(tc, timediff >= 0); + CuAssertTrue(tc, timediff <= 1); } -#if APR_HAS_THREADS -static void * APR_THREAD_FUNC time_a_thread(apr_thread_t *thd, void *data) +CuSuite *testsleep(void) { - do_sleep(15); + CuSuite *suite = CuSuiteNew("Test Sleep"); - return NULL; + SUITE_ADD_TEST(suite, sleep_one); + + return suite; } -#define OUTPUT_LINES 8 -#else -#define OUTPUT_LINES 2 -#endif /* APR_HAS_THREADS */ -int main(void) +#ifdef SINGLE_PROG +CuSuite *getsuite(void) { - apr_pool_t *p; -#if APR_HAS_THREADS - apr_thread_t *t1, *t2, *t3; - apr_status_t rv; -#endif - - apr_initialize(); - - printf("Testing apr_sleep()\n===================\n\n"); - - STD_TEST_NEQ("Creating a pool to use", apr_pool_create(&p, NULL)) - -#if APR_HAS_THREADS - printf("\nI will now start 3 threads, each of which should sleep for\n" - "15 seconds, then exit.\n"); -#endif - - printf("The main app will sleep for 45 seconds then wake up.\n"); - printf("All tests will check how long they've been in the land of nod.\n\n"); - printf("If all is working you should see %d lines below within 45 seconds.\n\n", - OUTPUT_LINES); - -#if APR_HAS_THREADS - rv = apr_thread_create(&t1, NULL, time_a_thread, NULL, p); - rv = apr_thread_create(&t2, NULL, time_a_thread, NULL, p); - rv = apr_thread_create(&t3, NULL, time_a_thread, NULL, p); + return testsleep(); +} #endif - do_sleep(45); - - return 0; -} From 4c68c9bd8d014efd3417a21e341b671907b24251 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 22 Oct 2002 18:55:17 +0000 Subject: [PATCH 3949/7878] style tweaks only git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63968 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 36630db155c..72cfe5af4d8 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -121,15 +121,15 @@ apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) * or zero timeout, we must make sure our socket is blocking. * We want to avoid calling fcntl more than necessary on the socket, */ - if (t >= 0 && sock->timeout < 0){ - if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 1){ - if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS){ + if (t >= 0 && sock->timeout < 0) { + if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 1) { + if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) { return stat; } } } - else if (t < 0 && sock->timeout >= 0){ - if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 0){ + else if (t < 0 && sock->timeout >= 0) { + if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 0) { if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) { return stat; } @@ -159,7 +159,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, one = 0; if (opt & APR_SO_KEEPALIVE) { #ifdef SO_KEEPALIVE - if (on != apr_is_option_set(sock->netmask, APR_SO_KEEPALIVE)){ + if (on != apr_is_option_set(sock->netmask, APR_SO_KEEPALIVE)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { return errno; } @@ -170,7 +170,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, #endif } if (opt & APR_SO_DEBUG) { - if (on != apr_is_option_set(sock->netmask, APR_SO_DEBUG)){ + if (on != apr_is_option_set(sock->netmask, APR_SO_DEBUG)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { return errno; } @@ -178,7 +178,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, } } if (opt & APR_SO_REUSEADDR) { - if (on != apr_is_option_set(sock->netmask, APR_SO_REUSEADDR)){ + if (on != apr_is_option_set(sock->netmask, APR_SO_REUSEADDR)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { return errno; } @@ -187,7 +187,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, } if (opt & APR_SO_SNDBUF) { #ifdef SO_SNDBUF - if (apr_is_option_set(sock->netmask, APR_SO_SNDBUF) != on){ + if (apr_is_option_set(sock->netmask, APR_SO_SNDBUF) != on) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { return errno; } @@ -198,7 +198,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, #endif } if (opt & APR_SO_NONBLOCK) { - if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != on){ + if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != on) { if (on) { if ((rv = sononblock(sock->socketdes)) != APR_SUCCESS) return rv; @@ -212,7 +212,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, } if (opt & APR_SO_LINGER) { #ifdef SO_LINGER - if (apr_is_option_set(sock->netmask, APR_SO_LINGER) != on){ + if (apr_is_option_set(sock->netmask, APR_SO_LINGER) != on) { struct linger li; li.l_onoff = on; li.l_linger = MAX_SECS_TO_LINGER; @@ -231,7 +231,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, } if (opt & APR_TCP_NODELAY) { #if defined(TCP_NODELAY) - if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) != on){ + if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) != on) { if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { return errno; } @@ -250,35 +250,35 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, return APR_ENOTIMPL; #endif } - if (opt & APR_TCP_NOPUSH){ + if (opt & APR_TCP_NOPUSH) { #if APR_TCP_NOPUSH_FLAG - if (apr_is_option_set(sock->netmask, APR_TCP_NOPUSH) != on){ + if (apr_is_option_set(sock->netmask, APR_TCP_NOPUSH) != on) { /* OK we're going to change some settings here... */ /* TCP_NODELAY is mutually exclusive, so do we have it set? */ - if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) == 1 && on){ + if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) == 1 && on) { /* If we want to set NOPUSH then if we have the TCP_NODELAY * flag set we need to switch it off... */ int tmpflag = 0; if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, - (void*)&tmpflag, sizeof(int)) == -1){ + (void*)&tmpflag, sizeof(int)) == -1) { return errno; } apr_set_option(&sock->netmask, APR_RESET_NODELAY, 1); apr_set_option(&sock->netmask, APR_TCP_NODELAY, 0); - } else if (on){ + } else if (on) { apr_set_option(&sock->netmask, APR_RESET_NODELAY, 0); } /* OK, now we can just set the TCP_NOPUSH flag accordingly...*/ if (setsockopt(sock->socketdes, IPPROTO_TCP, APR_TCP_NOPUSH_FLAG, - (void*)&on, sizeof(int)) == -1){ + (void*)&on, sizeof(int)) == -1) { return errno; } apr_set_option(&sock->netmask, APR_TCP_NOPUSH, on); - if (!on && apr_is_option_set(sock->netmask, APR_RESET_NODELAY)){ + if (!on && apr_is_option_set(sock->netmask, APR_RESET_NODELAY)) { int tmpflag = 1; if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, - (void*)&tmpflag, sizeof(int)) == -1){ + (void*)&tmpflag, sizeof(int)) == -1) { return errno; } apr_set_option(&sock->netmask, APR_RESET_NODELAY,0); From d17e8fd5767cedd6244ba6939049c0ae47a36a2f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 22 Oct 2002 20:00:06 +0000 Subject: [PATCH 3950/7878] minor style tweaks git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63969 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockopt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 68ca7fe812e..641a7736acc 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -157,7 +157,7 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, } break; case APR_SO_REUSEADDR: - if (on != apr_is_option_set(sock->netmask, APR_SO_REUSEADDR)){ + if (on != apr_is_option_set(sock->netmask, APR_SO_REUSEADDR)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { return apr_get_netos_error(); @@ -166,7 +166,7 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, } break; case APR_SO_NONBLOCK: - if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != on){ + if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != on) { if (on) { if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) return stat; @@ -180,7 +180,7 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, break; case APR_SO_LINGER: { - if (apr_is_option_set(sock->netmask, APR_SO_LINGER) != on){ + if (apr_is_option_set(sock->netmask, APR_SO_LINGER) != on) { struct linger li; li.l_onoff = on; li.l_linger = MAX_SECS_TO_LINGER; @@ -193,7 +193,7 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, break; } case APR_TCP_NODELAY: - if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) != on){ + if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) != on) { if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { return apr_get_netos_error(); From 7ff8abae1735aec0d63fa3d95faad802bf4f9808 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 22 Oct 2002 20:05:35 +0000 Subject: [PATCH 3951/7878] map the TCP_NODELAY socket option to SCTP_NODELAY as appropriate Submitted by: Randall Stewart Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63970 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_network_io.h | 4 +++- include/arch/unix/networkio.h | 6 ++++++ network_io/unix/sockopt.c | 24 +++++++++++++++++++++--- network_io/win32/sockopt.c | 11 ++++++++++- 5 files changed, 44 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 4e7ac1d7322..63aa9ca056f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR 0.9.2 + + *) Add recognition of and socket API support for the SCTP protocol. + [Randall Stewart ] + *) Win32: apr_shutdown was not honoring apr_shutdown_how_e and always shutting down the socket for read. This could result in Apache HTTPD 2.0 clients getting early connection closures diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 672e5cd04c9..6416e268571 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -103,7 +103,9 @@ extern "C" { #define APR_SO_SNDBUF 64 #define APR_SO_RCVBUF 128 #define APR_SO_DISCONNECTED 256 -#define APR_TCP_NODELAY 512 +#define APR_TCP_NODELAY 512 /**< For SCTP sockets, this is mapped + * to STCP_NODELAY internally. + */ #define APR_TCP_NOPUSH 1024 #define APR_RESET_NODELAY 2048 /**< This flag is ONLY set internally * when we set APR_TCP_NOPUSH with diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index 8f16b05335f..c14e8ef82a9 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -87,6 +87,12 @@ #if APR_HAVE_NETINET_TCP_H #include #endif +#if APR_HAVE_NETINET_SCTP_UIO_H +#include +#endif +#if APR_HAVE_NETINET_SCTP_H +#include +#endif #if APR_HAVE_NETINET_IN_H #include #endif diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 72cfe5af4d8..41ed14746eb 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -232,7 +232,16 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, if (opt & APR_TCP_NODELAY) { #if defined(TCP_NODELAY) if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) != on) { - if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { + int optlevel = IPPROTO_TCP; + int optname = TCP_NODELAY; + +#if APR_HAVE_SCTP + if (sock->protocol == IPPROTO_SCTP) { + optlevel = IPPROTO_SCTP; + optname = SCTP_NODELAY; + } +#endif + if (setsockopt(sock->socketdes, optlevel, optname, (void *)&on, sizeof(int)) == -1) { return errno; } apr_set_option(&sock->netmask, APR_TCP_NODELAY, on); @@ -253,6 +262,15 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, if (opt & APR_TCP_NOPUSH) { #if APR_TCP_NOPUSH_FLAG if (apr_is_option_set(sock->netmask, APR_TCP_NOPUSH) != on) { + int optlevel = IPPROTO_TCP; + int optname = TCP_NODELAY; + +#if APR_HAVE_SCTP + if (sock->protocol == IPPROTO_SCTP) { + optlevel = IPPROTO_SCTP; + optname = SCTP_NODELAY; + } +#endif /* OK we're going to change some settings here... */ /* TCP_NODELAY is mutually exclusive, so do we have it set? */ if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) == 1 && on) { @@ -260,7 +278,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, * flag set we need to switch it off... */ int tmpflag = 0; - if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, + if (setsockopt(sock->socketdes, optlevel, optname, (void*)&tmpflag, sizeof(int)) == -1) { return errno; } @@ -277,7 +295,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, apr_set_option(&sock->netmask, APR_TCP_NOPUSH, on); if (!on && apr_is_option_set(sock->netmask, APR_RESET_NODELAY)) { int tmpflag = 1; - if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, + if (setsockopt(sock->socketdes, optlevel, optname, (void*)&tmpflag, sizeof(int)) == -1) { return errno; } diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 641a7736acc..53f633265a5 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -194,7 +194,16 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, } case APR_TCP_NODELAY: if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) != on) { - if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, + int optlevel = IPPROTO_TCP; + int optname = TCP_NODELAY; + +#if APR_HAVE_SCTP + if (sock->protocol == IPPROTO_SCTP) { + optlevel = IPPROTO_SCTP; + optname = SCTP_NODELAY; + } +#endif + if (setsockopt(sock->socketdes, optlevel, optname, (void *)&on, sizeof(int)) == -1) { return apr_get_netos_error(); } From ac20be95c6dea2f4dc9015693810c49177172b50 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 22 Oct 2002 23:22:06 +0000 Subject: [PATCH 3952/7878] Port testpools to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63971 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testpools.c | 118 +++++++++++++++++++++++------------------------ 4 files changed, 63 insertions(+), 61 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 1f6d8bcae0f..bda5418fb92 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -209,8 +209,8 @@ testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) testtable@EXEEXT@: testtable.lo $(LOCAL_LIBS) $(LINK) testtable.lo $(LOCAL_LIBS) $(ALL_LIBS) -testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo CuTest.lo $(LOCAL_LIBS) - $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) +testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo CuTest.lo $(LOCAL_LIBS) + $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index bfec033de12..371ba2f37ce 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -74,6 +74,7 @@ CuSuite *testmmap(void); CuSuite *testud(void); CuSuite *testtable(void); CuSuite *testsleep(void); +CuSuite *testpool(void); diff --git a/test/testall.c b/test/testall.c index 332469ffad2..8491f545fbb 100644 --- a/test/testall.c +++ b/test/testall.c @@ -72,6 +72,7 @@ testfunc *tests[NUM_TESTS] = { testud, testtable, testsleep, + testpool, NULL }; diff --git a/test/testpools.c b/test/testpools.c index 631c06aa062..4a8aa45881b 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -65,90 +65,90 @@ #endif #include "test_apr.h" -static void alloc_bytes(apr_pool_t *p, int bytes) +#define ALLOC_BYTES 1024 + +apr_pool_t *pmain = NULL; +apr_pool_t *pchild = NULL; + +static void alloc_bytes(CuTest *tc) { int i; char *alloc; - printf("apr_palloc for %d bytes\n", bytes); - printf("%-60s", " apr_palloc"); - alloc = apr_palloc(p, bytes); - if (!alloc) { - printf("Failed\n"); - exit(-1); - } - printf("OK\n"); - - printf("%-60s", " Checking entire allocation is writable"); - for (i=0;i Date: Wed, 23 Oct 2002 14:19:57 +0000 Subject: [PATCH 3953/7878] change to a more appropriate CuAssert* call git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63972 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testpools.c b/test/testpools.c index 4a8aa45881b..f416811a196 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -98,7 +98,7 @@ static void calloc_bytes(CuTest *tc) for (i=0;i Date: Wed, 23 Oct 2002 14:34:52 +0000 Subject: [PATCH 3954/7878] Update the README. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63973 13f79535-47bb-0310-9956-ffa450edef68 --- test/README | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/README b/test/README index e0a3ad11011..7501975b930 100644 --- a/test/README +++ b/test/README @@ -166,8 +166,7 @@ To add a new Suite to the full driver, you must make a couple of modifications. 1) Edit test_apr.h, and add the prototype for the function. 2) Edit testall.c, and add the function to the tests array. -3) Increase the NUM_TESTS macro in testall.c -4) Edit Makefile.in, and add the .lo file to the testall target. +3) Edit Makefile.in, and add the .lo file to the testall target. Once those four things are done, your tests will automatically be added to the suite. From 3521adcea16beb0d587037b5564a8a26bd01e7d5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 23 Oct 2002 14:51:18 +0000 Subject: [PATCH 3955/7878] now should be static. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63974 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testtime.c b/test/testtime.c index 5ae428ce446..dba25ebc8a4 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -69,7 +69,7 @@ * 2002-08-14 12:05:36.186711 -25200 [257 Sat]. * Which happens to be when I wrote the new tests. */ -apr_time_t now = 1032030336186711; +static apr_time_t now = 1032030336186711; static char* print_time (apr_pool_t *pool, const apr_time_exp_t *xt) { From a42ff0bd60510a523891d3decc93f89647382994 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 23 Oct 2002 22:21:19 +0000 Subject: [PATCH 3956/7878] Getting ready for an API change in the NetWare LIBC library that will speed up the file IO. Use a path context rather than the file path to get direct access to the file in the file system rather than having to make the file system traverse the directory tree. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63975 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 180 ++++++++++++++++++++++++++++++++-- file_io/unix/open.c | 31 +++++- file_io/win32/filepath.c | 3 + include/arch/netware/fileio.h | 19 ++++ 4 files changed, 225 insertions(+), 8 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 0a9bd4869e0..5eb6c9870d5 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -53,6 +53,9 @@ */ #include "fileio.h" +#ifdef FAST_STAT +#include "fsio.h" +#endif #include "nks/dirio.h" #include "apr_file_io.h" #include "apr_general.h" @@ -104,6 +107,7 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, */ } +#ifndef FAST_STAT char *case_filename(apr_pool_t *pPool, const char *szFile) { char *casedFileName = NULL; @@ -126,6 +130,7 @@ char *case_filename(apr_pool_t *pPool, const char *szFile) } return casedFileName; } +#endif APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, @@ -205,16 +210,176 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, return apr_file_perms_set(fname, finfo.protection); } -typedef struct apr_stat_entry_t apr_stat_entry_t; +#ifdef FAST_STAT +int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *pool) +{ + apr_hash_t *statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor); + apr_pool_t *gPool = (apr_pool_t *)getGlobalPool(CpuCurrentProcessor); + apr_stat_entry_t *stat_entry; + struct stat *info; + apr_time_t now = apr_time_now(); + NXPathCtx_t pathCtx = 0; + char *key; + int ret; + int found = 0; -struct apr_stat_entry_t { - struct stat info; - char *casedName; - apr_time_t expire; -}; + *casedName = NULL; + errno = 0; + + /* If there isn't a global pool then just stat the file + and return */ + if (!gPool) { + char poolname[50]; + + if (apr_pool_create(&gPool, NULL) != APR_SUCCESS) { + getcwdpath(NULL, &pathCtx, CTX_ACTUAL_CWD); + ret = getstat(pathCtx, path, buf, ST_STAT_BITS|ST_NAME_BIT); + if (ret == 0) { + *casedName = apr_pstrdup (pool, buf->st_name); + return 0; + } + else { + errno = ret; + return -1; + } + } + + sprintf (poolname, "cstat_mem_pool_%d", CpuCurrentProcessor); + apr_pool_tag(gPool, apr_pstrdup(gPool, poolname)); + + setGlobalPool(gPool, CpuCurrentProcessor); + } + + /* If we have a statCache hash table then use it. + Otherwise we need to create it and initialized it + with a new mutex lock. */ + if (!statCache) { + statCache = apr_hash_make(gPool); + setStatCache((void*)statCache, CpuCurrentProcessor); + } + + /* If we have a statCache then try to pull the information + from the cache. Otherwise just stat the file and return.*/ + if (statCache) { + stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, path, APR_HASH_KEY_STRING); + /* If we got an entry then check the expiration time. If the entry + hasn't expired yet then copy the information and return. */ + if (stat_entry) { + if ((now - stat_entry->expire) <= APR_USEC_PER_SEC) { + memcpy (buf, &(stat_entry->info), sizeof(struct stat)); + *casedName = apr_pstrdup (pool, stat_entry->casedName); + found = 1; + } + } + + /* Since we are creating a separate stat cache for each processor, we + don't need to worry about locking the hash table before manipulating + it. */ + if (!found) { + /* Bind the thread to the current cpu so that we don't wake + up on some other cpu and try to manipulate the wrong cache. */ + NXThreadBind (CpuCurrentProcessor); + + /* If we don't have a stat_entry then create one, copy + the data and add it to the hash table. */ + if (!stat_entry) { + char *dirPath = NULL, *fname = NULL; + char *ptr; + int err, len; + char pathbuf[256]; + + getcwdpath(pathbuf, &pathCtx, CTX_ACTUAL_CWD); + ret = getstat(pathCtx, path, buf, ST_STAT_BITS|ST_NAME_BIT); + + if (ret) { + NXThreadBind (NX_THR_UNBOUND); + errno = ret; + return -1; + } + + if (filetype_from_mode(buf->st_mode) == APR_DIR) { + dirPath = apr_pstrdup (pool, path); + len = strlen (dirPath) - strlen(buf->st_name); + dirPath[len-1] = '\0'; + } + else if (filetype_from_mode(buf->st_mode) == APR_REG) { + dirPath = apr_pstrdup (pool, path); + ptr = strrchr (dirPath, '/'); + if (ptr) { + *ptr = '\0'; + } + } -extern apr_int32_t CpuCurrentProcessor; /* system variable */ +/* xxx Need to handle error codes here */ + err = NXCreatePathContext(pathCtx, dirPath, 0, NULL, &pathCtx); + + key = apr_pstrdup (gPool, path); + stat_entry = apr_palloc (gPool, sizeof(apr_stat_entry_t)); + memcpy (&(stat_entry->info), buf, sizeof(struct stat)); + stat_entry->casedName = (stat_entry->info).st_name; + *casedName = apr_pstrdup(pool, stat_entry->casedName); + stat_entry->expire = now; + if (err == 0) { + stat_entry->pathCtx = pathCtx; + } + else { + stat_entry->pathCtx = 0; + } + apr_hash_set(statCache, key, APR_HASH_KEY_STRING, stat_entry); + } + else { + NXDirAttrNks_t dirInfo; + + /* If we have a path context then get the info the fast way. Otherwise + just default to getting the stat info from stat() */ + if (stat_entry->pathCtx) { + ret = getstat(stat_entry->pathCtx, stat_entry->casedName, buf, + ST_MODE_BIT|ST_ATIME_BIT|ST_MTIME_BIT|ST_CTIME_BIT|ST_SIZE_BIT|ST_NAME_BIT); + } + else { + char pathbuf[256]; + getcwdpath(pathbuf, &pathCtx, CTX_ACTUAL_CWD); + ret = getstat(pathCtx, path, buf, + ST_MODE_BIT|ST_ATIME_BIT|ST_MTIME_BIT|ST_CTIME_BIT|ST_SIZE_BIT|ST_NAME_BIT); + } + + if (ret) { + NXThreadBind (NX_THR_UNBOUND); + errno = ret; + return -1; + } + else { + (stat_entry->info).st_atime.tv_sec = (buf->st_atime).tv_sec; + (stat_entry->info).st_mtime.tv_sec = (buf->st_mtime).tv_sec; + (stat_entry->info).st_ctime.tv_sec = (buf->st_ctime).tv_sec; + (stat_entry->info).st_size = buf->st_size; + (stat_entry->info).st_mode = buf->st_mode; + memcpy ((stat_entry->info).st_name, buf->st_name, sizeof(buf->st_name)); + memcpy (buf, &(stat_entry->info), sizeof(struct stat)); + } + /* If we do have a stat_entry then it must have expired. Just + copy the data and reset the expiration. */ + *casedName = apr_pstrdup(pool, stat_entry->casedName); + stat_entry->expire = now; + } + NXThreadBind (NX_THR_UNBOUND); + } + } + else { + getcwdpath(NULL, &pathCtx, CTX_ACTUAL_CWD); + ret = getstat(pathCtx, path, buf, ST_STAT_BITS|ST_NAME_BIT); + if (ret == 0) { + *casedName = apr_pstrdup(pool, buf->st_name); + } + else { + errno = ret; + return -1; + } + } + return 0; +} +#else int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *pool) { apr_hash_t *statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor); @@ -320,6 +485,7 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo } return 0; } +#endif APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 9f758119076..fc8ca018a81 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -58,6 +58,14 @@ #include "apr_thread_mutex.h" #include "inherit.h" +#ifdef FAST_STAT +#ifdef NETWARE +#include "nks/dirio.h" +#include "apr_hash.h" +#include "fsio.h" +#endif +#endif + apr_status_t apr_unix_file_cleanup(void *thefile) { apr_file_t *file = thefile; @@ -97,6 +105,13 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, apr_status_t rv; #endif +#ifdef FAST_STAT +#ifdef NETWARE + apr_hash_t *statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor); + apr_stat_entry_t *stat_entry; +#endif +#endif + (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); (*new)->pool = pool; (*new)->flags = flag; @@ -158,12 +173,26 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, } #endif +#ifdef FAST_STAT +#ifdef NETWARE + stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, fname, APR_HASH_KEY_STRING); + if (stat_entry) { + errno = NXFileOpen (stat_entry->pathCtx, stat_entry->casedName, oflags, &(*new)->filedes); + } + else { +#endif +#endif if (perm == APR_OS_DEFAULT) { (*new)->filedes = open(fname, oflags, 0666); } else { (*new)->filedes = open(fname, oflags, apr_unix_perms2mode(perm)); - } + } +#ifdef FAST_STAT +#ifdef NETWARE + } +#endif +#endif if ((*new)->filedes < 0) { (*new)->filedes = -1; diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 13222b23236..74e8ce23c6b 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -61,6 +61,9 @@ #ifdef NETWARE #include +#ifdef FAST_STAT +#include +#endif #endif /* WinNT accepts several odd forms of a 'root' path. Under Unicode diff --git a/include/arch/netware/fileio.h b/include/arch/netware/fileio.h index e5234d476ac..109f79f1dec 100644 --- a/include/arch/netware/fileio.h +++ b/include/arch/netware/fileio.h @@ -55,6 +55,8 @@ #ifndef FILE_IO_H #define FILE_IO_H +//#define FAST_STAT + #include "apr.h" #include "apr_private.h" #include "apr_general.h" @@ -102,6 +104,12 @@ #include #endif +#ifdef FAST_STAT +#include +#else +#include +#endif + /* End System headers */ #define APR_FILE_BUFSIZE 4096 @@ -136,6 +144,17 @@ struct apr_dir_t { struct dirent *entry; }; +typedef struct apr_stat_entry_t apr_stat_entry_t; + +struct apr_stat_entry_t { + struct stat info; + char *casedName; + apr_time_t expire; + NXPathCtx_t pathCtx; +}; + +extern apr_int32_t CpuCurrentProcessor; /* system variable */ + #define MAX_SERVER_NAME 64 #define MAX_VOLUME_NAME 64 #define MAX_PATH_NAME 256 From 89c5e91ce1ef0f6358d6d8ea22f8cf5f121e9ceb Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 23 Oct 2002 23:28:12 +0000 Subject: [PATCH 3957/7878] Cleanup the output from the new test suite. It now prints the output as the tests are run. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63976 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 20 +++++++++++++++++++- test/CuTest.h | 1 + test/testall.c | 3 +-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/test/CuTest.c b/test/CuTest.c index ce0ee04ce84..8e604a05214 100644 --- a/test/CuTest.c +++ b/test/CuTest.c @@ -279,7 +279,6 @@ void CuSuiteRun(CuSuite* testSuite) void CuSuiteSummary(CuSuite* testSuite, CuString* summary) { int i; - CuStringAppendFormat(summary, "%s:\t", testSuite->name); for (i = 0 ; i < testSuite->count ; ++i) { CuTest* testCase = testSuite->list[i]; @@ -364,6 +363,25 @@ void CuSuiteListRun(CuSuiteList* testSuite) } } +void CuSuiteListRunWithSummary(CuSuiteList* testSuite) +{ + int i; + + printf("%s:\n", testSuite->name); + for (i = 0 ; i < testSuite->count ; ++i) + { + CuSuite* testCase = testSuite->list[i]; + CuString *str = CuStringNew(); + + printf("%s:\t", testCase->name); + CuSuiteRun(testCase); + CuSuiteSummary(testCase, str); + printf(" %s", str->buffer); + + } + printf("\n"); +} + void CuSuiteListSummary(CuSuiteList* testSuite, CuString* summary) { int i; diff --git a/test/CuTest.h b/test/CuTest.h index 4cc976d2f47..1c189126a77 100644 --- a/test/CuTest.h +++ b/test/CuTest.h @@ -128,6 +128,7 @@ typedef struct CuSuiteList* CuSuiteListNew(char* name); void CuSuiteListAdd(CuSuiteList* testSuite, CuSuite *testCase); void CuSuiteListRun(CuSuiteList* testSuite); +void CuSuiteListRunWithSummary(CuSuiteList* testSuite); void CuSuiteListSummary(CuSuiteList* testSuite, CuString* summary); void CuSuiteListDetails(CuSuiteList* testSuite, CuString* details); #endif /* CU_TEST_H */ diff --git a/test/testall.c b/test/testall.c index 8491f545fbb..892f9855f21 100644 --- a/test/testall.c +++ b/test/testall.c @@ -93,8 +93,7 @@ int main(int argc, char *argv[]) CuSuiteListAdd(alltests, tests[i]()); } - CuSuiteListRun(alltests); - CuSuiteListSummary(alltests, output); + CuSuiteListRunWithSummary(alltests); CuSuiteListDetails(alltests, output); printf("%s\n", output->buffer); return 0; From a06b9e00a1e91da03cc894bbb0b6751f2e48845c Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 24 Oct 2002 00:09:35 +0000 Subject: [PATCH 3958/7878] Move testregex to test/internal. This test is testing regular expressions, which isn't a feature that APR provides. The test is still available, but it is not a part of the external test suite anymore. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63977 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- test/Makefile.in | 4 ---- test/internal/Makefile.in | 37 +++++++++++++++++++++++++++++++++ test/{ => internal}/testregex.c | 0 4 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 test/internal/Makefile.in rename test/{ => internal}/testregex.c (100%) diff --git a/configure.in b/configure.in index 6b3b0598892..16ac205489f 100644 --- a/configure.in +++ b/configure.in @@ -1845,7 +1845,7 @@ do done if test -d $srcdir/test; then - MAKEFILE3="test/Makefile" + MAKEFILE3="test/Makefile test/internal/Makefile" fi AC_SUBST(SUBDIRS) diff --git a/test/Makefile.in b/test/Makefile.in index bda5418fb92..fa88acbe243 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -5,7 +5,6 @@ NONPORTABLE = \ testshm@EXEEXT@ \ testprocmutex@EXEEXT@ \ testglobalmutex@EXEEXT@ \ - testregex@EXEEXT@ PROGRAMS = \ client@EXEEXT@ \ @@ -191,9 +190,6 @@ testsleep@EXEEXT@: testsleep.lo $(LOCAL_LIBS) testatomic@EXEEXT@: testatomic.lo $(LOCAL_LIBS) $(LINK) testatomic.lo $(LOCAL_LIBS) $(ALL_LIBS) -testregex@EXEEXT@: testregex.lo $(LOCAL_LIBS) - $(LINK) testregex.lo $(LOCAL_LIBS) $(ALL_LIBS) - testdup@EXEEXT@: testdup.lo $(LOCAL_LIBS) $(LINK) testdup.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/internal/Makefile.in b/test/internal/Makefile.in new file mode 100644 index 00000000000..2ace52c7e4d --- /dev/null +++ b/test/internal/Makefile.in @@ -0,0 +1,37 @@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +NONPORTABLE = \ + testregex@EXEEXT@ + +PROGRAMS = \ + +TARGETS = $(PROGRAMS) $(NONPORTABLE) + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + +LOCAL_LIBS=../../lib@APR_LIBNAME@.la + +CLEAN_TARGETS = testfile.tmp testdso@EXEEXT@ mod_test.slo + +INCDIR=../../include +INCLUDES=-I$(INCDIR) + +CFLAGS=$(MY_CFLAGS) + +all: $(PROGRAMS) $(NONPORTABLE) + +check: $(PROGRAMS) $(NONPORTABLE) + for prog in $(PROGRAMS) $(NONPORTABLE); do \ + ./$$prog; \ + if test $$i = 255; then \ + echo "$$prog failed"; \ + break; \ + fi \ + done + +testregex@EXEEXT@: testregex.lo $(LOCAL_LIBS) + $(LINK) testregex.lo $(LOCAL_LIBS) $(ALL_LIBS) + +# DO NOT REMOVE diff --git a/test/testregex.c b/test/internal/testregex.c similarity index 100% rename from test/testregex.c rename to test/internal/testregex.c From c0a5230ca130f64f9298ce8b50359aec89dcb1da Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 24 Oct 2002 00:12:24 +0000 Subject: [PATCH 3959/7878] Remove the tests that have already been ported. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63978 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index fa88acbe243..1e6fd79251b 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -20,30 +20,21 @@ PROGRAMS = \ testthread@EXEEXT@ \ testlock@EXEEXT@ \ testlockperf@EXEEXT@ \ - testtime@EXEEXT@ \ testargs@EXEEXT@ \ - testud@EXEEXT@ \ - testmmap@EXEEXT@ \ testshmproducer@EXEEXT@ \ testshmconsumer@EXEEXT@ \ testpipe@EXEEXT@ \ testoc@EXEEXT@ \ testsockopt@EXEEXT@ \ - testipsub@EXEEXT@ \ testpoll@EXEEXT@ \ testhash@EXEEXT@ \ occhild@EXEEXT@ \ - teststr@EXEEXT@ \ testuser@EXEEXT@ \ testsockets@EXEEXT@ \ - testvsn@EXEEXT@ \ - testsleep@EXEEXT@ \ testrand@EXEEXT@ \ testdup@EXEEXT@ \ testatomic@EXEEXT@ \ - testpools@EXEEXT@ \ testmutexscope@EXEEXT@ \ - testtable@EXEEXT@ \ testall@EXEEXT@ @@ -109,9 +100,6 @@ libmod_test.la: mod_test.slo $(LOCAL_LIBS) testargs@EXEEXT@: testargs.lo $(LOCAL_LIBS) $(LINK) testargs.lo $(LOCAL_LIBS) $(ALL_LIBS) -testud@EXEEXT@: testud.lo $(LOCAL_LIBS) - $(LINK) testud.lo $(LOCAL_LIBS) $(ALL_LIBS) - testproc@EXEEXT@: testproc.lo $(LOCAL_LIBS) $(LINK) testproc.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -136,12 +124,6 @@ server@EXEEXT@: server.lo $(LOCAL_LIBS) sendfile@EXEEXT@: sendfile.lo $(LOCAL_LIBS) $(LINK) sendfile.lo $(LOCAL_LIBS) $(ALL_LIBS) -testtime@EXEEXT@: testtime.lo CuTest.lo testapr.lo $(LOCAL_LIBS) - $(LINK) testtime.lo CuTest.lo testapr.lo $(LOCAL_LIBS) $(ALL_LIBS) - -testmmap@EXEEXT@: testmmap.lo $(LOCAL_LIBS) - $(LINK) testmmap.lo $(LOCAL_LIBS) $(ALL_LIBS) - testshm@EXEEXT@: testshm.lo $(LOCAL_LIBS) testshmproducer@EXEEXT@ testshmconsumer@EXEEXT@ $(LINK) testshm.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -157,18 +139,12 @@ testpipe@EXEEXT@: testpipe.lo $(LOCAL_LIBS) testsockopt@EXEEXT@: testsockopt.lo $(LOCAL_LIBS) $(LINK) testsockopt.lo $(LOCAL_LIBS) $(ALL_LIBS) -testipsub@EXEEXT@: testipsub.lo $(LOCAL_LIBS) - $(LINK) testipsub.lo $(LOCAL_LIBS) $(ALL_LIBS) - testpoll@EXEEXT@: testpoll.lo $(LOCAL_LIBS) $(LINK) testpoll.lo $(LOCAL_LIBS) $(ALL_LIBS) testhash@EXEEXT@: testhash.lo $(LOCAL_LIBS) $(LINK) testhash.lo $(LOCAL_LIBS) $(ALL_LIBS) -teststr@EXEEXT@: teststr.lo CuTest.lo testapr.lo $(LOCAL_LIBS) - $(LINK) teststr.lo CuTest.lo testapr.lo $(LOCAL_LIBS) $(ALL_LIBS) - testsockets@EXEEXT@: testsockets.lo $(LOCAL_LIBS) $(LINK) testsockets.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -181,12 +157,6 @@ testprocmutex@EXEEXT@: testprocmutex.lo $(LOCAL_LIBS) testglobalmutex@EXEEXT@: testglobalmutex.lo $(LOCAL_LIBS) $(LINK) testglobalmutex.lo $(LOCAL_LIBS) $(ALL_LIBS) -testvsn@EXEEXT@: testvsn.lo $(LOCAL_LIBS) - $(LINK) testvsn.lo $(LOCAL_LIBS) $(ALL_LIBS) - -testsleep@EXEEXT@: testsleep.lo $(LOCAL_LIBS) - $(LINK) testsleep.lo $(LOCAL_LIBS) $(ALL_LIBS) - testatomic@EXEEXT@: testatomic.lo $(LOCAL_LIBS) $(LINK) testatomic.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -196,15 +166,9 @@ testdup@EXEEXT@: testdup.lo $(LOCAL_LIBS) testrand@EXEEXT@: testrand.lo $(LOCAL_LIBS) $(LINK) testrand.lo $(LOCAL_LIBS) $(ALL_LIBS) -testpools@EXEEXT@: testpools.lo $(LOCAL_LIBS) - $(LINK) testpools.lo $(LOCAL_LIBS) $(ALL_LIBS) - testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) $(LINK) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) -testtable@EXEEXT@: testtable.lo $(LOCAL_LIBS) - $(LINK) testtable.lo $(LOCAL_LIBS) $(ALL_LIBS) - testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo CuTest.lo $(LOCAL_LIBS) $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) From 227be0d379352fc6a9a7b9731a693bab4e1d7f72 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 24 Oct 2002 00:20:33 +0000 Subject: [PATCH 3960/7878] Port testfmt to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63979 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 8 ++--- test/test_apr.h | 1 + test/testall.c | 1 + test/testfmt.c | 94 ++++++++++++++++++++++++++++++++---------------- 4 files changed, 68 insertions(+), 36 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 1e6fd79251b..954f29111f3 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -14,7 +14,6 @@ PROGRAMS = \ testdir@EXEEXT@ \ testnames@EXEEXT@ \ testflock@EXEEXT@ \ - testfmt@EXEEXT@ \ testproc@EXEEXT@ \ testsock@EXEEXT@ \ testthread@EXEEXT@ \ @@ -75,9 +74,6 @@ testnames@EXEEXT@: testnames.lo $(LOCAL_LIBS) testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS) $(LINK) testflock.lo $(LOCAL_LIBS) $(ALL_LIBS) -testfmt@EXEEXT@: testfmt.lo $(LOCAL_LIBS) - $(LINK) testfmt.lo $(LOCAL_LIBS) $(ALL_LIBS) - testdso@EXEEXT@: testdso.lo mod_test.la libmod_test.la $(LOCAL_LIBS) $(LINK) testdso.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -169,8 +165,8 @@ testrand@EXEEXT@: testrand.lo $(LOCAL_LIBS) testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) $(LINK) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) -testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo CuTest.lo $(LOCAL_LIBS) - $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) +testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo CuTest.lo $(LOCAL_LIBS) + $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index 371ba2f37ce..381d45763a4 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -75,6 +75,7 @@ CuSuite *testud(void); CuSuite *testtable(void); CuSuite *testsleep(void); CuSuite *testpool(void); +CuSuite *testfmt(void); diff --git a/test/testall.c b/test/testall.c index 892f9855f21..0821ce3112d 100644 --- a/test/testall.c +++ b/test/testall.c @@ -73,6 +73,7 @@ testfunc *tests[NUM_TESTS] = { testtable, testsleep, testpool, + testfmt, NULL }; diff --git a/test/testfmt.c b/test/testfmt.c index ad794c17bef..edbfb269622 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -52,39 +52,73 @@ * . */ -#include - +#include "test_apr.h" #include "apr.h" #include "apr_portable.h" -int main(int argc, char *argv[]) + +static void ssize_t_fmt(CuTest *tc) +{ + char buf[100]; + apr_ssize_t var = 0; + + sprintf(buf, "%" APR_SSIZE_T_FMT, var); + CuAssertStrEquals(tc, buf, "0"); +} + +static void size_t_fmt(CuTest *tc) +{ + char buf[100]; + apr_size_t var = 0; + + sprintf(buf, "%" APR_SIZE_T_FMT, var); + CuAssertStrEquals(tc, buf, "0"); +} + +static void off_t_fmt(CuTest *tc) +{ + char buf[100]; + apr_off_t var = 0; + + sprintf(buf, "%" APR_OFF_T_FMT, var); + CuAssertStrEquals(tc, buf, "0"); +} + +static void pid_t_fmt(CuTest *tc) +{ + char buf[100]; + pid_t var = 0; + + sprintf(buf, "%" APR_PID_T_FMT, var); + CuAssertStrEquals(tc, buf, "0"); +} + +static void int64_t_fmt(CuTest *tc) { char buf[100]; - - { - apr_ssize_t var = 0; - sprintf(buf, "%" APR_SSIZE_T_FMT, var); - } - - { - apr_size_t var = 0; - sprintf(buf, "%" APR_SIZE_T_FMT, var); - } - - { - apr_off_t var = 0; - sprintf(buf, "%" APR_OFF_T_FMT, var); - } - - { - pid_t var = 0; - sprintf(buf, "%" APR_PID_T_FMT, var); - } - - { - apr_int64_t var = 0; - sprintf(buf, "%" APR_INT64_T_FMT, var); - } - - return 0; + apr_int64_t var = 0; + + sprintf(buf, "%" APR_INT64_T_FMT, var); + CuAssertStrEquals(tc, buf, "0"); +} + +CuSuite *testfmt(void) +{ + CuSuite *suite = CuSuiteNew("Test Formats"); + + SUITE_ADD_TEST(suite, ssize_t_fmt); + SUITE_ADD_TEST(suite, size_t_fmt); + SUITE_ADD_TEST(suite, off_t_fmt); + SUITE_ADD_TEST(suite, pid_t_fmt); + SUITE_ADD_TEST(suite, int64_t_fmt); + + return suite; } + +#ifdef SINGLE_PROG +CuSuite *getsuite(void) +{ + return testfmt(); +} +#endif + From b203c8e9b3a7df32c841f2f7c19a672be4923741 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 24 Oct 2002 00:29:17 +0000 Subject: [PATCH 3961/7878] Finish cleaning up the test suite's output. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63980 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/CuTest.c b/test/CuTest.c index 8e604a05214..e70ca7e045d 100644 --- a/test/CuTest.c +++ b/test/CuTest.c @@ -363,6 +363,14 @@ void CuSuiteListRun(CuSuiteList* testSuite) } } +static const char *genspaces(int i) +{ + char *str = malloc((i + 1) * sizeof(char)); + memset(str, ' ', i); + str[i] = '\0'; + return str; +} + void CuSuiteListRunWithSummary(CuSuiteList* testSuite) { int i; @@ -373,7 +381,8 @@ void CuSuiteListRunWithSummary(CuSuiteList* testSuite) CuSuite* testCase = testSuite->list[i]; CuString *str = CuStringNew(); - printf("%s:\t", testCase->name); + printf(" %s:%s", testCase->name, + genspaces(21 - strlen(testCase->name))); CuSuiteRun(testCase); CuSuiteSummary(testCase, str); printf(" %s", str->buffer); From d350d0dfe4124a13bcc006cf220b1f597c9e3bfa Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 24 Oct 2002 11:17:01 +0000 Subject: [PATCH 3962/7878] fix a typo in a comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63981 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index f28547744dc..650e33d791e 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -410,7 +410,7 @@ static int include_hdrs_in_length(void) { #ifdef HAVE_SYS_SYSCTL_H /* this assumes: - * if the header exits, so does the sysctlbyname() syscall, and + * if the header exists, so does the sysctlbyname() syscall, and * if the header doesn't exist, the kernel is really old */ From aa3e4f501827dad2a9ce97afe0a251bccd149198 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 24 Oct 2002 22:46:11 +0000 Subject: [PATCH 3963/7878] Implement apr_atomic_casptr() for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63982 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index d1a46ff7688..898ea2847e6 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -175,11 +175,13 @@ typedef LONG apr_atomic_t; #define apr_atomic_add(mem, val) atomic_add(mem,val) APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); #define APR_OVERRIDE_ATOMIC_DEC 1 +#define APR_OVERRIDE_ATOMIC_CASPTR 1 #define apr_atomic_inc(mem) atomic_inc(mem) #define apr_atomic_set(mem, val) (*mem = val) #define apr_atomic_read(mem) (*mem) #define apr_atomic_init(pool) APR_SUCCESS #define apr_atomic_cas(mem,with,cmp) atomic_cmpxchg(mem,cmp,with) +#define apr_atomic_casptr(mem,with,cmp) (void*)atomic_cmpxchg((apr_uint32_t *)(mem),(long)(cmp),(long)(with)) #elif defined(__FreeBSD__) From bf8bed15f3949f4b9797629114a6b0d36dc243dc Mon Sep 17 00:00:00 2001 From: Karl Fogel Date: Fri, 25 Oct 2002 00:17:00 +0000 Subject: [PATCH 3964/7878] * apr/file_io/unix/copy.c (apr_file_transfer_contents): Fix comment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63983 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index 86dc44b499d..d7cb4730be4 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -71,7 +71,7 @@ static apr_status_t apr_file_transfer_contents(const char *from_path, if (status) return status; - /* Get its size. */ + /* Maybe get its permissions. */ if (to_perms == APR_FILE_SOURCE_PERMS) { status = apr_file_info_get(&finfo, APR_FINFO_PROT, s); if (status != APR_SUCCESS && status != APR_INCOMPLETE) { From 5e58bd030e52998a2c780ebba523d6135801737f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 25 Oct 2002 16:14:22 +0000 Subject: [PATCH 3965/7878] Avoiding some compiler type mismatch warnings on NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63984 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 898ea2847e6..7111843054b 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -180,8 +180,8 @@ APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); #define apr_atomic_set(mem, val) (*mem = val) #define apr_atomic_read(mem) (*mem) #define apr_atomic_init(pool) APR_SUCCESS -#define apr_atomic_cas(mem,with,cmp) atomic_cmpxchg(mem,cmp,with) -#define apr_atomic_casptr(mem,with,cmp) (void*)atomic_cmpxchg((apr_uint32_t *)(mem),(long)(cmp),(long)(with)) +#define apr_atomic_cas(mem,with,cmp) atomic_cmpxchg((unsigned long *)(mem),(unsigned long)(cmp),(unsigned long)(with)) +#define apr_atomic_casptr(mem,with,cmp) (void*)atomic_cmpxchg((unsigned long *)(mem),(unsigned long)(cmp),(unsigned long)(with)) #elif defined(__FreeBSD__) From d740d8299d56152546fc398897f827c41f208a59 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 25 Oct 2002 17:15:37 +0000 Subject: [PATCH 3966/7878] Fix a problem retrieving the remote socket address for sockets created via apr_os_sock_put() or apr_s_sock_make() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63985 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/arch/os2/networkio.h | 1 + include/arch/unix/networkio.h | 1 + include/arch/win32/networkio.h | 1 + network_io/os2/sockets.c | 4 ++++ network_io/unix/sa_common.c | 7 +++++++ network_io/unix/sockaddr.c | 15 +++++++++++++++ network_io/unix/sockets.c | 4 ++++ network_io/win32/sockets.c | 4 ++++ 9 files changed, 40 insertions(+) diff --git a/CHANGES b/CHANGES index 63aa9ca056f..820fe58532c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.2 + *) Fix a problem retrieving the remote socket address for sockets + created via apr_os_sock_put() or apr_os_sock_make(). [Jeff Trawick] + *) Add recognition of and socket API support for the SCTP protocol. [Randall Stewart ] diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index 09f5cd2f441..3f7a812bba7 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -74,6 +74,7 @@ struct apr_socket_t { int nonblock; int local_port_unknown; int local_interface_unknown; + int remote_addr_unknown; apr_int32_t netmask; apr_int32_t inherit; }; diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index c14e8ef82a9..bc35872907e 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -135,6 +135,7 @@ struct apr_socket_t { #endif int local_port_unknown; int local_interface_unknown; + int remote_addr_unknown; apr_int32_t netmask; apr_int32_t inherit; }; diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index af9024a0303..488e7617549 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -70,6 +70,7 @@ struct apr_socket_t { apr_int32_t disconnected; int local_port_unknown; int local_interface_unknown; + int remote_addr_unknown; apr_int32_t netmask; apr_int32_t inherit; }; diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 7148cee83ec..9a704b8f429 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -283,6 +283,9 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ (*apr_sock)->remote_addr->port = ntohs((*apr_sock)->remote_addr->sa.sin.sin_port); } + else { + (*apr_sock)->remote_addr_unknown = 1; + } apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), socket_cleanup, apr_pool_cleanup_null); @@ -302,6 +305,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *th } (*sock)->local_port_unknown = (*sock)->local_interface_unknown = 1; + (*sock)->remote_addr_unknown = 1; (*sock)->socketdes = *thesock; return APR_SUCCESS; } diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 3431fc13f6e..b6d0fa40b09 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -209,6 +209,13 @@ APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, *sa = sock->local_addr; } else if (which == APR_REMOTE) { + if (sock->remote_addr_unknown) { + apr_status_t rv = get_remote_addr(sock); + + if (rv != APR_SUCCESS) { + return rv; + } + } *sa = sock->remote_addr; } else { diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index a65a7bbc49f..a78607d47c1 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -70,6 +70,21 @@ static apr_status_t get_local_addr(apr_socket_t *sock) } } +static apr_status_t get_remote_addr(apr_socket_t *sock) +{ + sock->remote_addr->salen = sizeof(sock->remote_addr->sa); + if (getpeername(sock->socketdes, (struct sockaddr *)&sock->remote_addr->sa, + &sock->remote_addr->salen) < 0) { + return errno; + } + else { + sock->remote_addr_unknown = 0; + /* XXX assumes sin_port and sin6_port at same offset */ + sock->remote_addr->port = ntohs(sock->remote_addr->sa.sin.sin_port); + return APR_SUCCESS; + } +} + /* included here to allow us to use get_local_addr(). NOTE: this file (sockaddr.c) can be included from other directories. If diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 3092301924e..f442cdabb12 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -362,6 +362,9 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ (*apr_sock)->remote_addr->port = ntohs((*apr_sock)->remote_addr->sa.sin.sin_port); } + else { + (*apr_sock)->remote_addr_unknown = 1; + } (*apr_sock)->inherit = 0; apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), @@ -381,6 +384,7 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, (*sock)->timeout = -1; } (*sock)->local_port_unknown = (*sock)->local_interface_unknown = 1; + (*sock)->remote_addr_unknown = 1; (*sock)->socketdes = *thesock; return APR_SUCCESS; } diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 468958dee0c..528a408a6d9 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -451,6 +451,9 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ (*apr_sock)->remote_addr->port = ntohs((*apr_sock)->remote_addr->sa.sin.sin_port); } + else { + (*apr_sock)->remote_addr_unknown = 1; + } apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), socket_cleanup, apr_pool_cleanup_null); @@ -471,6 +474,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, (*sock)->disconnected = 0; } (*sock)->local_port_unknown = (*sock)->local_interface_unknown = 1; + (*sock)->remote_addr_unknown = 1; (*sock)->socketdes = *thesock; return APR_SUCCESS; } From 99b25d4f210a6c4469c468f81115ccc2aa021b5e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 27 Oct 2002 03:04:40 +0000 Subject: [PATCH 3967/7878] This file shouldn't exist. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63986 13f79535-47bb-0310-9956-ffa450edef68 --- test/testproc.rbb | 148 ---------------------------------------------- 1 file changed, 148 deletions(-) delete mode 100644 test/testproc.rbb diff --git a/test/testproc.rbb b/test/testproc.rbb deleted file mode 100644 index befddc9e663..00000000000 --- a/test/testproc.rbb +++ /dev/null @@ -1,148 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the Apache Software Foundation - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * 4. The names "Apache Server" and "Apache Software Foundation" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the Apache Software Foundation - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * THIS SOFTWARE IS PROVIDED BY THE Apache Software Foundation ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE Apache Software Foundation OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. - * For more information on the Apache Software Foundation and the Apache HTTP server - * project, please see . - * - */ - -#include "apr_thread_proc.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "errno.h" -#ifndef WIN32 -#include -#endif -#include -#include -#include - -int test_filedel(void); -int testdirs(void); - -int main(int argc, char *argv[]) -{ - ap_context_t *context; - ap_proc_t *newproc; - ap_procattr_t *attr; - ap_file_t *testfile; - ap_ssize_t length; - char *buf; - char *args[3]; - char *teststr; - - ap_create_context(NULL, NULL, &context); - - teststr = ap_pstrdup(context, "Whooo Hoooo\n"); - - if (argc > 1) { - fprintf(stdout, "%s", teststr); - exit(1); - } - fprintf(stdout, "Creating procattr......."); - if (ap_createprocattr_init(context, &attr) != APR_SUCCESS) { - fprintf(stderr, "Could not create attr\n"); - exit(-1);; - } - fprintf(stdout, "OK.\n"); - - fprintf(stdout, "Setting attr pipes, all three......."); - if (ap_setprocattr_io(attr, 1, 1, 0) != APR_SUCCESS) { - fprintf(stderr, "Could not set pipes attr\n"); - exit(-1); - } - fprintf(stdout, "OK.\n"); - - fprintf(stdout, "Setting attr dir......."); - if (ap_setprocattr_dir(attr, "proctest") != APR_SUCCESS) { - fprintf(stderr, "Could not set directory attr\n"); - exit(-1); - } - fprintf(stdout, "OK.\n"); - - fprintf(stdout, "Setting attr cmd type......."); - if (ap_setprocattr_cmdtype(attr, APR_PROGRAM) != APR_SUCCESS) { - fprintf(stderr, "Could not set cmd type attr\n"); - exit(-1); - } - fprintf(stdout, "OK.\n"); - - args[0] = ap_pstrdup(context, "testproc"); - args[1] = ap_pstrdup(context, "-X"); - args[2] = NULL; - - fprintf(stdout, "Creating a new process......."); - if (ap_create_process(context, "../testproc", args, NULL, attr, &newproc) != APR_SUCCESS) { - fprintf(stderr, "Could not create the new process\n"); - exit(-1); - } - fprintf(stdout, "OK.\n"); - - fprintf(stdout, "Grabbing child's stdout......."); - if (ap_get_childout(newproc, &testfile) != APR_SUCCESS) { - fprintf(stderr, "Could not get child's stdout\n"); - exit(-1); - } - fprintf(stdout, "OK.\n"); - - length = 256; - fprintf(stdout, "Checking the data read from pipe to child......."); - buf = ap_pcalloc(context, length); - if (ap_read(testfile, buf, &length) == APR_SUCCESS) { - if (!strcmp(buf, teststr)) - fprintf(stdout,"OK\n"); - else fprintf(stderr, "Uh-Oh\n"); - } - else fprintf(stderr, "Read failed.\n"); - - return(1); -} - From 2a1b2da1641e36a73b628e8997d2feface6b0233 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 27 Oct 2002 03:19:02 +0000 Subject: [PATCH 3968/7878] The last broken tree was a good example that sa_common has outlived its usefulness. Win32 will now use unix/sockaddr.t in full (which it essentially had already done.) Only two small changes to grab the right errno. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63987 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sa_common.c | 928 ------------------------------------ network_io/unix/sockaddr.c | 879 +++++++++++++++++++++++++++++++++- network_io/win32/sockaddr.c | 88 ---- 3 files changed, 870 insertions(+), 1025 deletions(-) delete mode 100644 network_io/unix/sa_common.c delete mode 100644 network_io/win32/sockaddr.c diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c deleted file mode 100644 index b6d0fa40b09..00000000000 --- a/network_io/unix/sa_common.c +++ /dev/null @@ -1,928 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* sa_common.c - * - * this file has common code that manipulates socket information - * - * It's intended to be included in sockaddr.c for every platform and - * so should NOT have any headers included in it. - * - * Feature defines are OK, but there should not be any code in this file - * that differs between platforms. - */ - -#include "apr.h" -#include "apr_lib.h" -#include "apr_strings.h" - -#if APR_HAVE_STDLIB_H -#include -#endif - -#define APR_WANT_STRFUNC -#include "apr_want.h" - -struct apr_ipsubnet_t { - int family; -#if APR_HAVE_IPV6 - apr_uint32_t sub[4]; /* big enough for IPv4 and IPv6 addresses */ - apr_uint32_t mask[4]; -#else - apr_uint32_t sub[1]; - apr_uint32_t mask[1]; -#endif -}; - -#if !defined(NETWARE) && !defined(WIN32) -#ifdef HAVE_SET_H_ERRNO -#define SET_H_ERRNO(newval) set_h_errno(newval) -#else -#define SET_H_ERRNO(newval) h_errno = (newval) -#endif -#else -#define SET_H_ERRNO(newval) -#endif - -#if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ - defined(HAVE_GETHOSTBYNAME_R) -/* This is the maximum size that may be returned from the reentrant - * gethostbyname_r function. If the system tries to use more, it - * should return ERANGE. - */ -#define GETHOSTBYNAME_BUFLEN 512 -#endif - -APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, - apr_port_t port) -{ - sockaddr->port = port; - /* XXX IPv6: assumes sin_port and sin6_port at same offset */ - sockaddr->sa.sin.sin_port = htons(port); - return APR_SUCCESS; -} - -/* XXX assumes IPv4... I don't think this function is needed anyway - * since we have apr_sockaddr_info_get(), but we need to clean up Apache's - * listen.c a bit more first. - */ -APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, - const char *addr) -{ - apr_uint32_t ipaddr; - - if (!strcmp(addr, APR_ANYADDR)) { - sockaddr->sa.sin.sin_addr.s_addr = htonl(INADDR_ANY); - return APR_SUCCESS; - } - - ipaddr = inet_addr(addr); - if (ipaddr == (apr_uint32_t)-1) { -#ifdef WIN32 - return WSAEADDRNOTAVAIL; -#else - return errno; -#endif - } - - sockaddr->sa.sin.sin_addr.s_addr = ipaddr; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, - apr_sockaddr_t *sockaddr) -{ - *port = sockaddr->port; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, - apr_sockaddr_t *sockaddr) -{ - *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len); - apr_inet_ntop(sockaddr->family, - sockaddr->ipaddr_ptr, - *addr, - sockaddr->addr_str_len); -#if APR_HAVE_IPV6 - if (sockaddr->family == AF_INET6 && - IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sockaddr->ipaddr_ptr)) { - /* This is an IPv4-mapped IPv6 address; drop the leading - * part of the address string so we're left with the familiar - * IPv4 format. - */ - *addr += strlen("::ffff:"); - } -#endif - return APR_SUCCESS; -} - -void apr_sockaddr_vars_set(apr_sockaddr_t *addr, int family, apr_port_t port) -{ - addr->family = family; - addr->sa.sin.sin_family = family; - if (port) { - /* XXX IPv6: assumes sin_port and sin6_port at same offset */ - addr->sa.sin.sin_port = htons(port); - addr->port = port; - } - - if (family == APR_INET) { - addr->salen = sizeof(struct sockaddr_in); - addr->addr_str_len = 16; - addr->ipaddr_ptr = &(addr->sa.sin.sin_addr); - addr->ipaddr_len = sizeof(struct in_addr); - } -#if APR_HAVE_IPV6 - else if (family == APR_INET6) { - addr->salen = sizeof(struct sockaddr_in6); - addr->addr_str_len = 46; - addr->ipaddr_ptr = &(addr->sa.sin6.sin6_addr); - addr->ipaddr_len = sizeof(struct in6_addr); - } -#endif -} - -APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, - apr_interface_e which, - apr_socket_t *sock) -{ - if (which == APR_LOCAL) { - if (sock->local_interface_unknown || sock->local_port_unknown) { - apr_status_t rv = get_local_addr(sock); - - if (rv != APR_SUCCESS) { - return rv; - } - } - *sa = sock->local_addr; - } - else if (which == APR_REMOTE) { - if (sock->remote_addr_unknown) { - apr_status_t rv = get_remote_addr(sock); - - if (rv != APR_SUCCESS) { - return rv; - } - } - *sa = sock->remote_addr; - } - else { - *sa = NULL; - return APR_EINVAL; - } - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, - char **scope_id, - apr_port_t *port, - const char *str, - apr_pool_t *p) -{ - const char *ch, *lastchar; - int big_port; - apr_size_t addrlen; - - *addr = NULL; /* assume not specified */ - *scope_id = NULL; /* assume not specified */ - *port = 0; /* assume not specified */ - - /* First handle the optional port number. That may be all that - * is specified in the string. - */ - ch = lastchar = str + strlen(str) - 1; - while (ch >= str && apr_isdigit(*ch)) { - --ch; - } - - if (ch < str) { /* Entire string is the port. */ - big_port = atoi(str); - if (big_port < 1 || big_port > 65535) { - return APR_EINVAL; - } - *port = big_port; - return APR_SUCCESS; - } - - if (*ch == ':' && ch < lastchar) { /* host and port number specified */ - if (ch == str) { /* string starts with ':' -- bad */ - return APR_EINVAL; - } - big_port = atoi(ch + 1); - if (big_port < 1 || big_port > 65535) { - return APR_EINVAL; - } - *port = big_port; - lastchar = ch - 1; - } - - /* now handle the hostname */ - addrlen = lastchar - str + 1; - -/* XXX we don't really have to require APR_HAVE_IPV6 for this; - * just pass char[] for ipaddr (so we don't depend on struct in6_addr) - * and always define APR_INET6 - */ -#if APR_HAVE_IPV6 - if (*str == '[') { - const char *end_bracket = memchr(str, ']', addrlen); - struct in6_addr ipaddr; - const char *scope_delim; - - if (!end_bracket || end_bracket != lastchar) { - *port = 0; - return APR_EINVAL; - } - - /* handle scope id; this is the only context where it is allowed */ - scope_delim = memchr(str, '%', addrlen); - if (scope_delim) { - if (scope_delim == end_bracket - 1) { /* '%' without scope id */ - *port = 0; - return APR_EINVAL; - } - addrlen = scope_delim - str - 1; - *scope_id = apr_palloc(p, end_bracket - scope_delim); - memcpy(*scope_id, scope_delim + 1, end_bracket - scope_delim - 1); - (*scope_id)[end_bracket - scope_delim - 1] = '\0'; - } - else { - addrlen = addrlen - 2; /* minus 2 for '[' and ']' */ - } - - *addr = apr_palloc(p, addrlen + 1); - memcpy(*addr, - str + 1, - addrlen); - (*addr)[addrlen] = '\0'; - if (apr_inet_pton(AF_INET6, *addr, &ipaddr) != 1) { - *addr = NULL; - *scope_id = NULL; - *port = 0; - return APR_EINVAL; - } - } - else -#endif - { - /* XXX If '%' is not a valid char in a DNS name, we *could* check - * for bogus scope ids first. - */ - *addr = apr_palloc(p, addrlen + 1); - memcpy(*addr, str, addrlen); - (*addr)[addrlen] = '\0'; - } - return APR_SUCCESS; -} - -#if defined(HAVE_GETADDRINFO) - -static apr_status_t call_resolver(apr_sockaddr_t **sa, - const char *hostname, apr_int32_t family, - apr_port_t port, apr_int32_t flags, - apr_pool_t *p) -{ - struct addrinfo hints, *ai, *ai_list; - apr_sockaddr_t *prev_sa; - int error; - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = family; - hints.ai_socktype = SOCK_STREAM; - error = getaddrinfo(hostname, NULL, &hints, &ai_list); - if (error) { -#ifndef WIN32 - if (error == EAI_SYSTEM) { - return errno; - } - else -#endif - { - /* issues with representing this with APR's error scheme: - * glibc uses negative values for these numbers, perhaps so - * they don't conflict with h_errno values... Tru64 uses - * positive values which conflict with h_errno values - */ -#if defined(NEGATIVE_EAI) - error = -error; -#endif - return error + APR_OS_START_EAIERR; - } - } - - prev_sa = NULL; - ai = ai_list; - while (ai) { /* while more addresses to report */ - apr_sockaddr_t *new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); - - new_sa->pool = p; - memcpy(&new_sa->sa, ai->ai_addr, ai->ai_addrlen); - apr_sockaddr_vars_set(new_sa, ai->ai_family, port); - - if (!prev_sa) { /* first element in new list */ - new_sa->hostname = apr_pstrdup(p, hostname); - *sa = new_sa; - } - else { - prev_sa->next = new_sa; - } - - prev_sa = new_sa; - ai = ai->ai_next; - } - freeaddrinfo(ai_list); - return APR_SUCCESS; -} - -static apr_status_t find_addresses(apr_sockaddr_t **sa, - const char *hostname, apr_int32_t family, - apr_port_t port, apr_int32_t flags, - apr_pool_t *p) -{ - if (flags & APR_IPV4_ADDR_OK) { - apr_status_t error = call_resolver(sa, hostname, AF_INET, port, flags, p); - -#if APR_HAVE_IPV6 - if (error) { - family = AF_INET6; /* try again */ - } - else -#endif - return error; - } -#if APR_HAVE_IPV6 - else if (flags & APR_IPV6_ADDR_OK) { - apr_status_t error = call_resolver(sa, hostname, AF_INET6, port, flags, p); - - if (error) { - family = AF_INET; /* try again */ - } - else { - return APR_SUCCESS; - } - } -#endif - - return call_resolver(sa, hostname, family, port, flags, p); -} - -#else /* end of HAVE_GETADDRINFO code */ - -static apr_status_t find_addresses(apr_sockaddr_t **sa, - const char *hostname, apr_int32_t family, - apr_port_t port, apr_int32_t flags, - apr_pool_t *p) -{ - struct hostent *hp; - apr_sockaddr_t *prev_sa; - int curaddr; -#if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ - defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) -#ifdef GETHOSTBYNAME_R_HOSTENT_DATA - struct hostent_data hd; -#else - /* If you see ERANGE, that means GETHOSBYNAME_BUFLEN needs to be - * bumped. */ - char tmp[GETHOSTBYNAME_BUFLEN]; -#endif - int hosterror; -#endif - struct hostent hs; - struct in_addr ipaddr; - char *addr_list[2]; - - if (*hostname >= '0' && *hostname <= '9' && - strspn(hostname, "0123456789.") == strlen(hostname)) { - - ipaddr.s_addr = inet_addr(hostname); - addr_list[0] = (char *)&ipaddr; - addr_list[1] = NULL; /* just one IP in list */ - hs.h_addr_list = (char **)addr_list; - hp = &hs; - } - else { -#if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ - defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) -#if defined(GETHOSTBYNAME_R_HOSTENT_DATA) - /* AIX, HP/UX, D/UX et alia */ - gethostbyname_r(hostname, &hs, &hd); - hp = &hs; -#else -#if defined(GETHOSTBYNAME_R_GLIBC2) - /* Linux glibc2+ */ - gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, - &hp, &hosterror); -#else - /* Solaris, Irix et alia */ - hp = gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, - &hosterror); -#endif /* !defined(GETHOSTBYNAME_R_GLIBC2) */ - if (!hp) { - return (hosterror + APR_OS_START_SYSERR); - } -#endif /* !defined(GETHOSTBYNAME_R_HOSTENT_DATA) */ -#else - hp = gethostbyname(hostname); -#endif - - if (!hp) { -#ifdef WIN32 - return apr_get_netos_error(); -#else - return (h_errno + APR_OS_START_SYSERR); -#endif - } - } - - prev_sa = NULL; - curaddr = 0; - while (hp->h_addr_list[curaddr]) { - apr_sockaddr_t *new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); - - new_sa->pool = p; - new_sa->sa.sin.sin_addr = *(struct in_addr *)hp->h_addr_list[curaddr]; - apr_sockaddr_vars_set(new_sa, AF_INET, port); - - if (!prev_sa) { /* first element in new list */ - new_sa->hostname = apr_pstrdup(p, hostname); - *sa = new_sa; - } - else { - prev_sa->next = new_sa; - } - - prev_sa = new_sa; - ++curaddr; - } - - return APR_SUCCESS; -} - -#endif /* end of !HAVE_GETADDRINFO code */ - -APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, - const char *hostname, - apr_int32_t family, apr_port_t port, - apr_int32_t flags, apr_pool_t *p) -{ - apr_int32_t masked; - *sa = NULL; - - if ((masked = flags & (APR_IPV4_ADDR_OK | APR_IPV6_ADDR_OK))) { - if (!hostname || - family != AF_UNSPEC || - masked == (APR_IPV4_ADDR_OK | APR_IPV6_ADDR_OK)) { - return APR_EINVAL; - } -#if !APR_HAVE_IPV6 - if (flags & APR_IPV6_ADDR_OK) { - return APR_ENOTIMPL; - } -#endif - } - - if (hostname) { -#if !APR_HAVE_IPV6 - if (family == APR_UNSPEC) { - family = APR_INET; - } -#endif - return find_addresses(sa, hostname, family, port, flags, p); - } - - *sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); - (*sa)->pool = p; - apr_sockaddr_vars_set(*sa, - family == APR_UNSPEC ? APR_INET : family, - port); - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, - apr_sockaddr_t *sockaddr, - apr_int32_t flags) -{ -#if defined(HAVE_GETNAMEINFO) - int rc; -#if defined(NI_MAXHOST) - char tmphostname[NI_MAXHOST]; -#else - char tmphostname[256]; -#endif - - /* don't know if it is portable for getnameinfo() to set h_errno; - * clear it then see if it was set */ - SET_H_ERRNO(0); - /* default flags are NI_NAMREQD; otherwise, getnameinfo() will return - * a numeric address string if it fails to resolve the host name; - * that is *not* what we want here - */ - rc = getnameinfo((const struct sockaddr *)&sockaddr->sa, sockaddr->salen, - tmphostname, sizeof(tmphostname), NULL, 0, - flags != 0 ? flags : NI_NAMEREQD); - if (rc != 0) { - *hostname = NULL; - -#ifndef WIN32 - /* something went wrong. Look at the EAI_ error code */ - if (rc == EAI_SYSTEM) { - /* EAI_SYSTEM System error returned in errno. */ - /* IMHO, Implementations that set h_errno a simply broken. */ - if (h_errno) { /* for broken implementations which set h_errno */ - return h_errno + APR_OS_START_SYSERR; - } - else { /* "normal" case */ - return errno + APR_OS_START_SYSERR; - } - } - else -#endif - { -#if defined(NEGATIVE_EAI) - if (rc < 0) rc = -rc; -#endif - return rc + APR_OS_START_EAIERR; /* return the EAI_ error */ - } - } - *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, - tmphostname); - return APR_SUCCESS; -#else -#if APR_HAS_THREADS && !defined(GETHOSTBYADDR_IS_THREAD_SAFE) && \ - defined(HAVE_GETHOSTBYADDR_R) && !defined(BEOS) -#ifdef GETHOSTBYNAME_R_HOSTENT_DATA - struct hostent_data hd; -#else - char tmp[GETHOSTBYNAME_BUFLEN]; -#endif - int hosterror; - struct hostent hs, *hptr; - -#if defined(GETHOSTBYNAME_R_HOSTENT_DATA) - /* AIX, HP/UX, D/UX et alia */ - gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, - sizeof(struct in_addr), AF_INET, &hs, &hd); - hptr = &hs; -#else -#if defined(GETHOSTBYNAME_R_GLIBC2) - /* Linux glibc2+ */ - gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, - sizeof(struct in_addr), AF_INET, - &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hptr, &hosterror); -#else - /* Solaris, Irix et alia */ - hptr = gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, - sizeof(struct in_addr), AF_INET, - &hs, tmp, GETHOSTBYNAME_BUFLEN, &hosterror); -#endif /* !defined(GETHOSTBYNAME_R_GLIBC2) */ - if (!hptr) { - *hostname = NULL; - return hosterror + APR_OS_START_SYSERR; - } -#endif /* !defined(GETHOSTBYNAME_R_HOSTENT_DATA) */ -#else - struct hostent *hptr; - hptr = gethostbyaddr((char *)&sockaddr->sa.sin.sin_addr, - sizeof(struct in_addr), AF_INET); -#endif - - if (hptr) { - *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, hptr->h_name); - return APR_SUCCESS; - } - *hostname = NULL; -#if defined(WIN32) - return apr_get_netos_error(); -#elif defined(OS2) - return h_errno; -#else - return h_errno + APR_OS_START_SYSERR; -#endif -#endif -} - -APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, - const char *servname) -{ - struct servent *se; - - if (servname == NULL) - return APR_EINVAL; - - if ((se = getservbyname(servname, NULL)) != NULL){ - sockaddr->port = htons(se->s_port); - sockaddr->servname = apr_pstrdup(sockaddr->pool, servname); - sockaddr->sa.sin.sin_port = se->s_port; - return APR_SUCCESS; - } - return errno; -} - -#define V4MAPPED_EQUAL(a,b) \ -((a)->sa.sin.sin_family == AF_INET && \ - (b)->sa.sin.sin_family == AF_INET6 && \ - IN6_IS_ADDR_V4MAPPED((struct in6_addr *)(b)->ipaddr_ptr) && \ - !memcmp((a)->ipaddr_ptr, \ - &((struct in6_addr *)(b)->ipaddr_ptr)->s6_addr[12], \ - (a)->ipaddr_len)) - -APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1, - const apr_sockaddr_t *addr2) -{ - if (addr1->ipaddr_len == addr2->ipaddr_len && - !memcmp(addr1->ipaddr_ptr, addr2->ipaddr_ptr, addr1->ipaddr_len)) { - return 1; - } -#if APR_HAVE_IPV6 - if (V4MAPPED_EQUAL(addr1, addr2)) { - return 1; - } - if (V4MAPPED_EQUAL(addr2, addr1)) { - return 1; - } -#endif - return 0; /* not equal */ -} - -static apr_status_t parse_network(apr_ipsubnet_t *ipsub, const char *network) -{ - /* legacy syntax for ip addrs: a.b.c. ==> a.b.c.0/24 for example */ - int shift; - char *s, *t; - int octet; - char buf[sizeof "255.255.255.255"]; - - if (strlen(network) < sizeof buf) { - strcpy(buf, network); - } - else { - return APR_EBADIP; - } - - /* parse components */ - s = buf; - ipsub->sub[0] = 0; - ipsub->mask[0] = 0; - shift = 24; - while (*s) { - t = s; - if (!apr_isdigit(*t)) { - return APR_EBADIP; - } - while (apr_isdigit(*t)) { - ++t; - } - if (*t == '.') { - *t++ = 0; - } - else if (*t) { - return APR_EBADIP; - } - if (shift < 0) { - return APR_EBADIP; - } - octet = atoi(s); - if (octet < 0 || octet > 255) { - return APR_EBADIP; - } - ipsub->sub[0] |= octet << shift; - ipsub->mask[0] |= 0xFFUL << shift; - s = t; - shift -= 8; - } - ipsub->sub[0] = ntohl(ipsub->sub[0]); - ipsub->mask[0] = ntohl(ipsub->mask[0]); - ipsub->family = AF_INET; - return APR_SUCCESS; -} - -/* return values: - * APR_EINVAL not an IP address; caller should see if it is something else - * APR_BADIP IP address portion is is not valid - * APR_BADMASK mask portion is not valid - */ - -static apr_status_t parse_ip(apr_ipsubnet_t *ipsub, const char *ipstr, int network_allowed) -{ - /* supported flavors of IP: - * - * . IPv6 numeric address string (e.g., "fe80::1") - * - * IMPORTANT: Don't store IPv4-mapped IPv6 address as an IPv6 address. - * - * . IPv4 numeric address string (e.g., "127.0.0.1") - * - * . IPv4 network string (e.g., "9.67") - * - * IMPORTANT: This network form is only allowed if network_allowed is on. - */ - int rc; - -#if APR_HAVE_IPV6 - rc = apr_inet_pton(AF_INET6, ipstr, ipsub->sub); - if (rc == 1) { - if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)ipsub->sub)) { - /* apr_ipsubnet_test() assumes that we don't create IPv4-mapped IPv6 - * addresses; this of course forces the user to specify IPv4 addresses - * in a.b.c.d style instead of ::ffff:a.b.c.d style. - */ - return APR_EBADIP; - } - ipsub->family = AF_INET6; - } - else -#endif - { - rc = apr_inet_pton(AF_INET, ipstr, ipsub->sub); - if (rc == 1) { - ipsub->family = AF_INET; - } - } - if (rc != 1) { - if (network_allowed) { - return parse_network(ipsub, ipstr); - } - else { - return APR_EBADIP; - } - } - return APR_SUCCESS; -} - -static int looks_like_ip(const char *ipstr) -{ - if (strchr(ipstr, ':')) { - /* definitely not a hostname; assume it is intended to be an IPv6 address */ - return 1; - } - - /* simple IPv4 address string check */ - while ((*ipstr == '.') || apr_isdigit(*ipstr)) - ipstr++; - return (*ipstr == '\0'); -} - -static void fix_subnet(apr_ipsubnet_t *ipsub) -{ - /* in case caller specified more bits in network address than are - * valid according to the mask, turn off the extra bits - */ - int i; - - for (i = 0; i < sizeof ipsub->mask / sizeof(apr_int32_t); i++) { - ipsub->sub[i] &= ipsub->mask[i]; - } -} - -/* be sure not to store any IPv4 address as a v4-mapped IPv6 address */ -APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char *ipstr, - const char *mask_or_numbits, apr_pool_t *p) -{ - apr_status_t rv; - char *endptr; - long bits, maxbits = 32; - - /* filter out stuff which doesn't look remotely like an IP address; this helps - * callers like mod_access which have a syntax allowing hostname or IP address; - * APR_EINVAL tells the caller that it was probably not intended to be an IP - * address - */ - if (!looks_like_ip(ipstr)) { - return APR_EINVAL; - } - - *ipsub = apr_pcalloc(p, sizeof(apr_ipsubnet_t)); - - /* assume ipstr is an individual IP address, not a subnet */ - memset((*ipsub)->mask, 0xFF, sizeof (*ipsub)->mask); - - rv = parse_ip(*ipsub, ipstr, mask_or_numbits == NULL); - if (rv != APR_SUCCESS) { - return rv; - } - - if (mask_or_numbits) { -#if APR_HAVE_IPV6 - if ((*ipsub)->family == AF_INET6) { - maxbits = 128; - } -#endif - bits = strtol(mask_or_numbits, &endptr, 10); - if (*endptr == '\0' && bits > 0 && bits <= maxbits) { - /* valid num-bits string; fill in mask appropriately */ - int cur_entry = 0; - apr_int32_t cur_bit_value; - - memset((*ipsub)->mask, 0, sizeof (*ipsub)->mask); - while (bits > 32) { - (*ipsub)->mask[cur_entry] = 0xFFFFFFFF; /* all 32 bits */ - bits -= 32; - ++cur_entry; - } - cur_bit_value = 0x80000000; - while (bits) { - (*ipsub)->mask[cur_entry] |= cur_bit_value; - --bits; - cur_bit_value /= 2; - } - (*ipsub)->mask[cur_entry] = htonl((*ipsub)->mask[cur_entry]); - } - else if (apr_inet_pton(AF_INET, mask_or_numbits, (*ipsub)->mask) == 1 && - (*ipsub)->family == AF_INET) { - /* valid IPv4 netmask */ - } - else { - return APR_EBADMASK; - } - } - - fix_subnet(*ipsub); - - return APR_SUCCESS; -} - -APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa) -{ -#if APR_HAVE_IPV6 - if (sa->sa.sin.sin_family == AF_INET) { - if (ipsub->family == AF_INET && - ((sa->sa.sin.sin_addr.s_addr & ipsub->mask[0]) == ipsub->sub[0])) { - return 1; - } - } - else if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sa->ipaddr_ptr)) { - if (ipsub->family == AF_INET && - (((apr_uint32_t *)sa->ipaddr_ptr)[3] & ipsub->mask[0]) == ipsub->sub[0]) { - return 1; - } - } - else { - apr_uint32_t *addr = (apr_uint32_t *)sa->ipaddr_ptr; - - if ((addr[0] & ipsub->mask[0]) == ipsub->sub[0] && - (addr[1] & ipsub->mask[1]) == ipsub->sub[1] && - (addr[2] & ipsub->mask[2]) == ipsub->sub[2] && - (addr[3] & ipsub->mask[3]) == ipsub->sub[3]) { - return 1; - } - } -#else - if ((sa->sa.sin.sin_addr.s_addr & ipsub->mask[0]) == ipsub->sub[0]) { - return 1; - } -#endif /* APR_HAVE_IPV6 */ - return 0; /* no match */ -} - diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index a78607d47c1..2791a5bcea3 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -54,13 +54,62 @@ #include "networkio.h" #include "apr_strings.h" +#include "apr.h" +#include "apr_lib.h" +#include "apr_strings.h" + +#if APR_HAVE_STDLIB_H +#include +#endif + +#define APR_WANT_STRFUNC +#include "apr_want.h" + +struct apr_ipsubnet_t { + int family; +#if APR_HAVE_IPV6 + apr_uint32_t sub[4]; /* big enough for IPv4 and IPv6 addresses */ + apr_uint32_t mask[4]; +#else + apr_uint32_t sub[1]; + apr_uint32_t mask[1]; +#endif +}; + +#if !defined(NETWARE) && !defined(WIN32) +#ifdef HAVE_SET_H_ERRNO +#define SET_H_ERRNO(newval) set_h_errno(newval) +#else +#define SET_H_ERRNO(newval) h_errno = (newval) +#endif +#else +#define SET_H_ERRNO(newval) +#endif + +#if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ + defined(HAVE_GETHOSTBYNAME_R) +/* This is the maximum size that may be returned from the reentrant + * gethostbyname_r function. If the system tries to use more, it + * should return ERANGE. + */ +#define GETHOSTBYNAME_BUFLEN 512 +#endif + +#ifdef _WIN32_WCE +/* XXX: BS solution. Need an HAVE_GETSERVBYNAME and actually + * do something here, to provide the obvious proto mappings. + */ +static void *getservbyname(const char *name, const char *proto) +{ + return NULL; +} static apr_status_t get_local_addr(apr_socket_t *sock) { sock->local_addr->salen = sizeof(sock->local_addr->sa); if (getsockname(sock->socketdes, (struct sockaddr *)&sock->local_addr->sa, &sock->local_addr->salen) < 0) { - return errno; + return apr_get_netos_error(); } else { sock->local_port_unknown = sock->local_interface_unknown = 0; @@ -75,7 +124,7 @@ static apr_status_t get_remote_addr(apr_socket_t *sock) sock->remote_addr->salen = sizeof(sock->remote_addr->sa); if (getpeername(sock->socketdes, (struct sockaddr *)&sock->remote_addr->sa, &sock->remote_addr->salen) < 0) { - return errno; + return apr_get_netos_error(); } else { sock->remote_addr_unknown = 0; @@ -85,12 +134,824 @@ static apr_status_t get_remote_addr(apr_socket_t *sock) } } -/* included here to allow us to use get_local_addr(). +APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, + apr_port_t port) +{ + sockaddr->port = port; + /* XXX IPv6: assumes sin_port and sin6_port at same offset */ + sockaddr->sa.sin.sin_port = htons(port); + return APR_SUCCESS; +} + +/* XXX assumes IPv4... I don't think this function is needed anyway + * since we have apr_sockaddr_info_get(), but we need to clean up Apache's + * listen.c a bit more first. + */ +APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, + const char *addr) +{ + apr_uint32_t ipaddr; + + if (!strcmp(addr, APR_ANYADDR)) { + sockaddr->sa.sin.sin_addr.s_addr = htonl(INADDR_ANY); + return APR_SUCCESS; + } + + ipaddr = inet_addr(addr); + if (ipaddr == (apr_uint32_t)-1) { +#ifdef WIN32 + return WSAEADDRNOTAVAIL; +#else + return errno; +#endif + } + + sockaddr->sa.sin.sin_addr.s_addr = ipaddr; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, + apr_sockaddr_t *sockaddr) +{ + *port = sockaddr->port; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, + apr_sockaddr_t *sockaddr) +{ + *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len); + apr_inet_ntop(sockaddr->family, + sockaddr->ipaddr_ptr, + *addr, + sockaddr->addr_str_len); +#if APR_HAVE_IPV6 + if (sockaddr->family == AF_INET6 && + IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sockaddr->ipaddr_ptr)) { + /* This is an IPv4-mapped IPv6 address; drop the leading + * part of the address string so we're left with the familiar + * IPv4 format. + */ + *addr += strlen("::ffff:"); + } +#endif + return APR_SUCCESS; +} + +void apr_sockaddr_vars_set(apr_sockaddr_t *addr, int family, apr_port_t port) +{ + addr->family = family; + addr->sa.sin.sin_family = family; + if (port) { + /* XXX IPv6: assumes sin_port and sin6_port at same offset */ + addr->sa.sin.sin_port = htons(port); + addr->port = port; + } + + if (family == APR_INET) { + addr->salen = sizeof(struct sockaddr_in); + addr->addr_str_len = 16; + addr->ipaddr_ptr = &(addr->sa.sin.sin_addr); + addr->ipaddr_len = sizeof(struct in_addr); + } +#if APR_HAVE_IPV6 + else if (family == APR_INET6) { + addr->salen = sizeof(struct sockaddr_in6); + addr->addr_str_len = 46; + addr->ipaddr_ptr = &(addr->sa.sin6.sin6_addr); + addr->ipaddr_len = sizeof(struct in6_addr); + } +#endif +} + +APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, + apr_interface_e which, + apr_socket_t *sock) +{ + if (which == APR_LOCAL) { + if (sock->local_interface_unknown || sock->local_port_unknown) { + apr_status_t rv = get_local_addr(sock); + + if (rv != APR_SUCCESS) { + return rv; + } + } + *sa = sock->local_addr; + } + else if (which == APR_REMOTE) { + if (sock->remote_addr_unknown) { + apr_status_t rv = get_remote_addr(sock); + + if (rv != APR_SUCCESS) { + return rv; + } + } + *sa = sock->remote_addr; + } + else { + *sa = NULL; + return APR_EINVAL; + } + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, + char **scope_id, + apr_port_t *port, + const char *str, + apr_pool_t *p) +{ + const char *ch, *lastchar; + int big_port; + apr_size_t addrlen; + + *addr = NULL; /* assume not specified */ + *scope_id = NULL; /* assume not specified */ + *port = 0; /* assume not specified */ + + /* First handle the optional port number. That may be all that + * is specified in the string. + */ + ch = lastchar = str + strlen(str) - 1; + while (ch >= str && apr_isdigit(*ch)) { + --ch; + } + + if (ch < str) { /* Entire string is the port. */ + big_port = atoi(str); + if (big_port < 1 || big_port > 65535) { + return APR_EINVAL; + } + *port = big_port; + return APR_SUCCESS; + } + + if (*ch == ':' && ch < lastchar) { /* host and port number specified */ + if (ch == str) { /* string starts with ':' -- bad */ + return APR_EINVAL; + } + big_port = atoi(ch + 1); + if (big_port < 1 || big_port > 65535) { + return APR_EINVAL; + } + *port = big_port; + lastchar = ch - 1; + } + + /* now handle the hostname */ + addrlen = lastchar - str + 1; + +/* XXX we don't really have to require APR_HAVE_IPV6 for this; + * just pass char[] for ipaddr (so we don't depend on struct in6_addr) + * and always define APR_INET6 + */ +#if APR_HAVE_IPV6 + if (*str == '[') { + const char *end_bracket = memchr(str, ']', addrlen); + struct in6_addr ipaddr; + const char *scope_delim; + + if (!end_bracket || end_bracket != lastchar) { + *port = 0; + return APR_EINVAL; + } + + /* handle scope id; this is the only context where it is allowed */ + scope_delim = memchr(str, '%', addrlen); + if (scope_delim) { + if (scope_delim == end_bracket - 1) { /* '%' without scope id */ + *port = 0; + return APR_EINVAL; + } + addrlen = scope_delim - str - 1; + *scope_id = apr_palloc(p, end_bracket - scope_delim); + memcpy(*scope_id, scope_delim + 1, end_bracket - scope_delim - 1); + (*scope_id)[end_bracket - scope_delim - 1] = '\0'; + } + else { + addrlen = addrlen - 2; /* minus 2 for '[' and ']' */ + } + + *addr = apr_palloc(p, addrlen + 1); + memcpy(*addr, + str + 1, + addrlen); + (*addr)[addrlen] = '\0'; + if (apr_inet_pton(AF_INET6, *addr, &ipaddr) != 1) { + *addr = NULL; + *scope_id = NULL; + *port = 0; + return APR_EINVAL; + } + } + else +#endif + { + /* XXX If '%' is not a valid char in a DNS name, we *could* check + * for bogus scope ids first. + */ + *addr = apr_palloc(p, addrlen + 1); + memcpy(*addr, str, addrlen); + (*addr)[addrlen] = '\0'; + } + return APR_SUCCESS; +} + +#if defined(HAVE_GETADDRINFO) + +static apr_status_t call_resolver(apr_sockaddr_t **sa, + const char *hostname, apr_int32_t family, + apr_port_t port, apr_int32_t flags, + apr_pool_t *p) +{ + struct addrinfo hints, *ai, *ai_list; + apr_sockaddr_t *prev_sa; + int error; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = family; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo(hostname, NULL, &hints, &ai_list); + if (error) { +#ifndef WIN32 + if (error == EAI_SYSTEM) { + return errno; + } + else +#endif + { + /* issues with representing this with APR's error scheme: + * glibc uses negative values for these numbers, perhaps so + * they don't conflict with h_errno values... Tru64 uses + * positive values which conflict with h_errno values + */ +#if defined(NEGATIVE_EAI) + error = -error; +#endif + return error + APR_OS_START_EAIERR; + } + } + + prev_sa = NULL; + ai = ai_list; + while (ai) { /* while more addresses to report */ + apr_sockaddr_t *new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); + + new_sa->pool = p; + memcpy(&new_sa->sa, ai->ai_addr, ai->ai_addrlen); + apr_sockaddr_vars_set(new_sa, ai->ai_family, port); + + if (!prev_sa) { /* first element in new list */ + new_sa->hostname = apr_pstrdup(p, hostname); + *sa = new_sa; + } + else { + prev_sa->next = new_sa; + } + + prev_sa = new_sa; + ai = ai->ai_next; + } + freeaddrinfo(ai_list); + return APR_SUCCESS; +} + +static apr_status_t find_addresses(apr_sockaddr_t **sa, + const char *hostname, apr_int32_t family, + apr_port_t port, apr_int32_t flags, + apr_pool_t *p) +{ + if (flags & APR_IPV4_ADDR_OK) { + apr_status_t error = call_resolver(sa, hostname, AF_INET, port, flags, p); + +#if APR_HAVE_IPV6 + if (error) { + family = AF_INET6; /* try again */ + } + else +#endif + return error; + } +#if APR_HAVE_IPV6 + else if (flags & APR_IPV6_ADDR_OK) { + apr_status_t error = call_resolver(sa, hostname, AF_INET6, port, flags, p); + + if (error) { + family = AF_INET; /* try again */ + } + else { + return APR_SUCCESS; + } + } +#endif + + return call_resolver(sa, hostname, family, port, flags, p); +} + +#else /* end of HAVE_GETADDRINFO code */ + +static apr_status_t find_addresses(apr_sockaddr_t **sa, + const char *hostname, apr_int32_t family, + apr_port_t port, apr_int32_t flags, + apr_pool_t *p) +{ + struct hostent *hp; + apr_sockaddr_t *prev_sa; + int curaddr; +#if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ + defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) +#ifdef GETHOSTBYNAME_R_HOSTENT_DATA + struct hostent_data hd; +#else + /* If you see ERANGE, that means GETHOSBYNAME_BUFLEN needs to be + * bumped. */ + char tmp[GETHOSTBYNAME_BUFLEN]; +#endif + int hosterror; +#endif + struct hostent hs; + struct in_addr ipaddr; + char *addr_list[2]; + + if (*hostname >= '0' && *hostname <= '9' && + strspn(hostname, "0123456789.") == strlen(hostname)) { + + ipaddr.s_addr = inet_addr(hostname); + addr_list[0] = (char *)&ipaddr; + addr_list[1] = NULL; /* just one IP in list */ + hs.h_addr_list = (char **)addr_list; + hp = &hs; + } + else { +#if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ + defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) +#if defined(GETHOSTBYNAME_R_HOSTENT_DATA) + /* AIX, HP/UX, D/UX et alia */ + gethostbyname_r(hostname, &hs, &hd); + hp = &hs; +#else +#if defined(GETHOSTBYNAME_R_GLIBC2) + /* Linux glibc2+ */ + gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, + &hp, &hosterror); +#else + /* Solaris, Irix et alia */ + hp = gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, + &hosterror); +#endif /* !defined(GETHOSTBYNAME_R_GLIBC2) */ + if (!hp) { + return (hosterror + APR_OS_START_SYSERR); + } +#endif /* !defined(GETHOSTBYNAME_R_HOSTENT_DATA) */ +#else + hp = gethostbyname(hostname); +#endif + + if (!hp) { +#ifdef WIN32 + return apr_get_netos_error(); +#else + return (h_errno + APR_OS_START_SYSERR); +#endif + } + } + + prev_sa = NULL; + curaddr = 0; + while (hp->h_addr_list[curaddr]) { + apr_sockaddr_t *new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); + + new_sa->pool = p; + new_sa->sa.sin.sin_addr = *(struct in_addr *)hp->h_addr_list[curaddr]; + apr_sockaddr_vars_set(new_sa, AF_INET, port); + + if (!prev_sa) { /* first element in new list */ + new_sa->hostname = apr_pstrdup(p, hostname); + *sa = new_sa; + } + else { + prev_sa->next = new_sa; + } + + prev_sa = new_sa; + ++curaddr; + } + + return APR_SUCCESS; +} + +#endif /* end of !HAVE_GETADDRINFO code */ + +APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, + const char *hostname, + apr_int32_t family, apr_port_t port, + apr_int32_t flags, apr_pool_t *p) +{ + apr_int32_t masked; + *sa = NULL; + + if ((masked = flags & (APR_IPV4_ADDR_OK | APR_IPV6_ADDR_OK))) { + if (!hostname || + family != AF_UNSPEC || + masked == (APR_IPV4_ADDR_OK | APR_IPV6_ADDR_OK)) { + return APR_EINVAL; + } +#if !APR_HAVE_IPV6 + if (flags & APR_IPV6_ADDR_OK) { + return APR_ENOTIMPL; + } +#endif + } + + if (hostname) { +#if !APR_HAVE_IPV6 + if (family == APR_UNSPEC) { + family = APR_INET; + } +#endif + return find_addresses(sa, hostname, family, port, flags, p); + } + + *sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); + (*sa)->pool = p; + apr_sockaddr_vars_set(*sa, + family == APR_UNSPEC ? APR_INET : family, + port); + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, + apr_sockaddr_t *sockaddr, + apr_int32_t flags) +{ +#if defined(HAVE_GETNAMEINFO) + int rc; +#if defined(NI_MAXHOST) + char tmphostname[NI_MAXHOST]; +#else + char tmphostname[256]; +#endif + + /* don't know if it is portable for getnameinfo() to set h_errno; + * clear it then see if it was set */ + SET_H_ERRNO(0); + /* default flags are NI_NAMREQD; otherwise, getnameinfo() will return + * a numeric address string if it fails to resolve the host name; + * that is *not* what we want here + */ + rc = getnameinfo((const struct sockaddr *)&sockaddr->sa, sockaddr->salen, + tmphostname, sizeof(tmphostname), NULL, 0, + flags != 0 ? flags : NI_NAMEREQD); + if (rc != 0) { + *hostname = NULL; + +#ifndef WIN32 + /* something went wrong. Look at the EAI_ error code */ + if (rc == EAI_SYSTEM) { + /* EAI_SYSTEM System error returned in errno. */ + /* IMHO, Implementations that set h_errno a simply broken. */ + if (h_errno) { /* for broken implementations which set h_errno */ + return h_errno + APR_OS_START_SYSERR; + } + else { /* "normal" case */ + return errno + APR_OS_START_SYSERR; + } + } + else +#endif + { +#if defined(NEGATIVE_EAI) + if (rc < 0) rc = -rc; +#endif + return rc + APR_OS_START_EAIERR; /* return the EAI_ error */ + } + } + *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, + tmphostname); + return APR_SUCCESS; +#else +#if APR_HAS_THREADS && !defined(GETHOSTBYADDR_IS_THREAD_SAFE) && \ + defined(HAVE_GETHOSTBYADDR_R) && !defined(BEOS) +#ifdef GETHOSTBYNAME_R_HOSTENT_DATA + struct hostent_data hd; +#else + char tmp[GETHOSTBYNAME_BUFLEN]; +#endif + int hosterror; + struct hostent hs, *hptr; + +#if defined(GETHOSTBYNAME_R_HOSTENT_DATA) + /* AIX, HP/UX, D/UX et alia */ + gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, + sizeof(struct in_addr), AF_INET, &hs, &hd); + hptr = &hs; +#else +#if defined(GETHOSTBYNAME_R_GLIBC2) + /* Linux glibc2+ */ + gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, + sizeof(struct in_addr), AF_INET, + &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hptr, &hosterror); +#else + /* Solaris, Irix et alia */ + hptr = gethostbyaddr_r((char *)&sockaddr->sa.sin.sin_addr, + sizeof(struct in_addr), AF_INET, + &hs, tmp, GETHOSTBYNAME_BUFLEN, &hosterror); +#endif /* !defined(GETHOSTBYNAME_R_GLIBC2) */ + if (!hptr) { + *hostname = NULL; + return hosterror + APR_OS_START_SYSERR; + } +#endif /* !defined(GETHOSTBYNAME_R_HOSTENT_DATA) */ +#else + struct hostent *hptr; + hptr = gethostbyaddr((char *)&sockaddr->sa.sin.sin_addr, + sizeof(struct in_addr), AF_INET); +#endif + + if (hptr) { + *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, hptr->h_name); + return APR_SUCCESS; + } + *hostname = NULL; +#if defined(WIN32) + return apr_get_netos_error(); +#elif defined(OS2) + return h_errno; +#else + return h_errno + APR_OS_START_SYSERR; +#endif +#endif +} + +APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, + const char *servname) +{ + struct servent *se; + + if (servname == NULL) + return APR_EINVAL; + + if ((se = getservbyname(servname, NULL)) != NULL){ + sockaddr->port = htons(se->s_port); + sockaddr->servname = apr_pstrdup(sockaddr->pool, servname); + sockaddr->sa.sin.sin_port = se->s_port; + return APR_SUCCESS; + } + return errno; +} - NOTE: this file (sockaddr.c) can be included from other directories. If - we left the following include as just "sa_common.c", then it would be - relative to the directory where sockaddr.c was included (wrong!). To - fix that problem, this include specifically refers to the unix directory - to include sa_common.c +#define V4MAPPED_EQUAL(a,b) \ +((a)->sa.sin.sin_family == AF_INET && \ + (b)->sa.sin.sin_family == AF_INET6 && \ + IN6_IS_ADDR_V4MAPPED((struct in6_addr *)(b)->ipaddr_ptr) && \ + !memcmp((a)->ipaddr_ptr, \ + &((struct in6_addr *)(b)->ipaddr_ptr)->s6_addr[12], \ + (a)->ipaddr_len)) + +APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1, + const apr_sockaddr_t *addr2) +{ + if (addr1->ipaddr_len == addr2->ipaddr_len && + !memcmp(addr1->ipaddr_ptr, addr2->ipaddr_ptr, addr1->ipaddr_len)) { + return 1; + } +#if APR_HAVE_IPV6 + if (V4MAPPED_EQUAL(addr1, addr2)) { + return 1; + } + if (V4MAPPED_EQUAL(addr2, addr1)) { + return 1; + } +#endif + return 0; /* not equal */ +} + +static apr_status_t parse_network(apr_ipsubnet_t *ipsub, const char *network) +{ + /* legacy syntax for ip addrs: a.b.c. ==> a.b.c.0/24 for example */ + int shift; + char *s, *t; + int octet; + char buf[sizeof "255.255.255.255"]; + + if (strlen(network) < sizeof buf) { + strcpy(buf, network); + } + else { + return APR_EBADIP; + } + + /* parse components */ + s = buf; + ipsub->sub[0] = 0; + ipsub->mask[0] = 0; + shift = 24; + while (*s) { + t = s; + if (!apr_isdigit(*t)) { + return APR_EBADIP; + } + while (apr_isdigit(*t)) { + ++t; + } + if (*t == '.') { + *t++ = 0; + } + else if (*t) { + return APR_EBADIP; + } + if (shift < 0) { + return APR_EBADIP; + } + octet = atoi(s); + if (octet < 0 || octet > 255) { + return APR_EBADIP; + } + ipsub->sub[0] |= octet << shift; + ipsub->mask[0] |= 0xFFUL << shift; + s = t; + shift -= 8; + } + ipsub->sub[0] = ntohl(ipsub->sub[0]); + ipsub->mask[0] = ntohl(ipsub->mask[0]); + ipsub->family = AF_INET; + return APR_SUCCESS; +} + +/* return values: + * APR_EINVAL not an IP address; caller should see if it is something else + * APR_BADIP IP address portion is is not valid + * APR_BADMASK mask portion is not valid */ -#include "../unix/sa_common.c" + +static apr_status_t parse_ip(apr_ipsubnet_t *ipsub, const char *ipstr, int network_allowed) +{ + /* supported flavors of IP: + * + * . IPv6 numeric address string (e.g., "fe80::1") + * + * IMPORTANT: Don't store IPv4-mapped IPv6 address as an IPv6 address. + * + * . IPv4 numeric address string (e.g., "127.0.0.1") + * + * . IPv4 network string (e.g., "9.67") + * + * IMPORTANT: This network form is only allowed if network_allowed is on. + */ + int rc; + +#if APR_HAVE_IPV6 + rc = apr_inet_pton(AF_INET6, ipstr, ipsub->sub); + if (rc == 1) { + if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)ipsub->sub)) { + /* apr_ipsubnet_test() assumes that we don't create IPv4-mapped IPv6 + * addresses; this of course forces the user to specify IPv4 addresses + * in a.b.c.d style instead of ::ffff:a.b.c.d style. + */ + return APR_EBADIP; + } + ipsub->family = AF_INET6; + } + else +#endif + { + rc = apr_inet_pton(AF_INET, ipstr, ipsub->sub); + if (rc == 1) { + ipsub->family = AF_INET; + } + } + if (rc != 1) { + if (network_allowed) { + return parse_network(ipsub, ipstr); + } + else { + return APR_EBADIP; + } + } + return APR_SUCCESS; +} + +static int looks_like_ip(const char *ipstr) +{ + if (strchr(ipstr, ':')) { + /* definitely not a hostname; assume it is intended to be an IPv6 address */ + return 1; + } + + /* simple IPv4 address string check */ + while ((*ipstr == '.') || apr_isdigit(*ipstr)) + ipstr++; + return (*ipstr == '\0'); +} + +static void fix_subnet(apr_ipsubnet_t *ipsub) +{ + /* in case caller specified more bits in network address than are + * valid according to the mask, turn off the extra bits + */ + int i; + + for (i = 0; i < sizeof ipsub->mask / sizeof(apr_int32_t); i++) { + ipsub->sub[i] &= ipsub->mask[i]; + } +} + +/* be sure not to store any IPv4 address as a v4-mapped IPv6 address */ +APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char *ipstr, + const char *mask_or_numbits, apr_pool_t *p) +{ + apr_status_t rv; + char *endptr; + long bits, maxbits = 32; + + /* filter out stuff which doesn't look remotely like an IP address; this helps + * callers like mod_access which have a syntax allowing hostname or IP address; + * APR_EINVAL tells the caller that it was probably not intended to be an IP + * address + */ + if (!looks_like_ip(ipstr)) { + return APR_EINVAL; + } + + *ipsub = apr_pcalloc(p, sizeof(apr_ipsubnet_t)); + + /* assume ipstr is an individual IP address, not a subnet */ + memset((*ipsub)->mask, 0xFF, sizeof (*ipsub)->mask); + + rv = parse_ip(*ipsub, ipstr, mask_or_numbits == NULL); + if (rv != APR_SUCCESS) { + return rv; + } + + if (mask_or_numbits) { +#if APR_HAVE_IPV6 + if ((*ipsub)->family == AF_INET6) { + maxbits = 128; + } +#endif + bits = strtol(mask_or_numbits, &endptr, 10); + if (*endptr == '\0' && bits > 0 && bits <= maxbits) { + /* valid num-bits string; fill in mask appropriately */ + int cur_entry = 0; + apr_int32_t cur_bit_value; + + memset((*ipsub)->mask, 0, sizeof (*ipsub)->mask); + while (bits > 32) { + (*ipsub)->mask[cur_entry] = 0xFFFFFFFF; /* all 32 bits */ + bits -= 32; + ++cur_entry; + } + cur_bit_value = 0x80000000; + while (bits) { + (*ipsub)->mask[cur_entry] |= cur_bit_value; + --bits; + cur_bit_value /= 2; + } + (*ipsub)->mask[cur_entry] = htonl((*ipsub)->mask[cur_entry]); + } + else if (apr_inet_pton(AF_INET, mask_or_numbits, (*ipsub)->mask) == 1 && + (*ipsub)->family == AF_INET) { + /* valid IPv4 netmask */ + } + else { + return APR_EBADMASK; + } + } + + fix_subnet(*ipsub); + + return APR_SUCCESS; +} + +APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa) +{ +#if APR_HAVE_IPV6 + if (sa->sa.sin.sin_family == AF_INET) { + if (ipsub->family == AF_INET && + ((sa->sa.sin.sin_addr.s_addr & ipsub->mask[0]) == ipsub->sub[0])) { + return 1; + } + } + else if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sa->ipaddr_ptr)) { + if (ipsub->family == AF_INET && + (((apr_uint32_t *)sa->ipaddr_ptr)[3] & ipsub->mask[0]) == ipsub->sub[0]) { + return 1; + } + } + else { + apr_uint32_t *addr = (apr_uint32_t *)sa->ipaddr_ptr; + + if ((addr[0] & ipsub->mask[0]) == ipsub->sub[0] && + (addr[1] & ipsub->mask[1]) == ipsub->sub[1] && + (addr[2] & ipsub->mask[2]) == ipsub->sub[2] && + (addr[3] & ipsub->mask[3]) == ipsub->sub[3]) { + return 1; + } + } +#else + if ((sa->sa.sin.sin_addr.s_addr & ipsub->mask[0]) == ipsub->sub[0]) { + return 1; + } +#endif /* APR_HAVE_IPV6 */ + return 0; /* no match */ +} diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c deleted file mode 100644 index 8814d766a88..00000000000 --- a/network_io/win32/sockaddr.c +++ /dev/null @@ -1,88 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "networkio.h" -#include "apr_network_io.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_lib.h" -#include "apr_private.h" -#include - -static apr_status_t get_local_addr(apr_socket_t *sock) -{ - sock->local_addr->salen = sizeof(sock->local_addr->sa); - if (getsockname(sock->socketdes, (struct sockaddr *)&sock->local_addr->sa, - &sock->local_addr->salen) < 0) { - return apr_get_netos_error(); - } - else { - sock->local_port_unknown = sock->local_interface_unknown = 0; - /* XXX assumes sin_port and sin6_port at same offset */ - sock->local_addr->port = ntohs(sock->local_addr->sa.sin.sin_port); - return APR_SUCCESS; - } -} - -#ifdef _WIN32_WCE -/* WCE lacks getservbyname */ -static void *getservbyname(const char *name, const char *proto) -{ - return NULL; -} - -#endif -/* Include this here so we have get_local_addr defined... */ -#include "../unix/sa_common.c" - From 9c516e5487a5d164f19d9eebc72edf76b8b10822 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 27 Oct 2002 03:20:39 +0000 Subject: [PATCH 3969/7878] Fat fingers, missing an #endif git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63988 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 2791a5bcea3..2095c5cc049 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -103,6 +103,7 @@ static void *getservbyname(const char *name, const char *proto) { return NULL; } +#endif static apr_status_t get_local_addr(apr_socket_t *sock) { From ba25d6798206c59b204fda9302f56307f13446c9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 27 Oct 2002 03:29:05 +0000 Subject: [PATCH 3970/7878] Resync to network_io/unix/sockaddr.c now that they are completely common. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63989 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 7 +------ libapr.dsp | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/apr.dsp b/apr.dsp index 7d7b6d94860..96dfc1b1ff6 100644 --- a/apr.dsp +++ b/apr.dsp @@ -258,16 +258,11 @@ SOURCE=.\poll\unix\poll.c # End Source File # Begin Source File -SOURCE=.\network_io\unix\sa_common.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File -SOURCE=.\network_io\win32\sockaddr.c +SOURCE=.\network_io\unix\sockaddr.c # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index dab9ea37ff7..087dc7d5ecc 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -264,16 +264,11 @@ SOURCE=.\poll\unix\poll.c # End Source File # Begin Source File -SOURCE=.\network_io\unix\sa_common.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File -SOURCE=.\network_io\win32\sockaddr.c +SOURCE=.\network_io\unix\sockaddr.c # End Source File # Begin Source File From 376f13831adedfe374b42ab0036152a2ca3c7092 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 29 Oct 2002 01:28:32 +0000 Subject: [PATCH 3971/7878] Win32: Get APR_APPEND file i/o working correctly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63990 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 1 + file_io/win32/filedup.c | 10 ++++----- file_io/win32/open.c | 47 ++++++++++++++------------------------- file_io/win32/readwrite.c | 41 ++++++++++++++++++++++++++++------ 4 files changed, 57 insertions(+), 42 deletions(-) diff --git a/CHANGES b/CHANGES index 820fe58532c..df5d4235d27 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,5 @@ Changes with APR 0.9.2 + *) Win32: Fix APR_APPEND file i/o. [Bill Stoddard] *) Fix a problem retrieving the remote socket address for sockets created via apr_os_sock_put() or apr_os_sock_make(). [Jeff Trawick] diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index e995de323d6..1ffae64412f 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -165,11 +165,11 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, else { memcpy((*new_file)->buffer, old_file->buffer, old_file->dataRead); } - if (old_file->mutex) { - apr_thread_mutex_create(&((*new_file)->mutex), - APR_THREAD_MUTEX_DEFAULT, p); - apr_thread_mutex_destroy(old_file->mutex); - } + } + if (old_file->mutex) { + apr_thread_mutex_create(&((*new_file)->mutex), + APR_THREAD_MUTEX_DEFAULT, p); + apr_thread_mutex_destroy(old_file->mutex); } if (old_file->fname) { (*new_file)->fname = apr_pstrdup(p, old_file->fname); diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 9a27e19bdfe..2dd62ec8352 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -380,21 +380,21 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, (*new)->filehand = handle; (*new)->fname = apr_pstrdup(pool, fname); (*new)->flags = flag; + (*new)->timeout = -1; + (*new)->ungetchar = -1; if (flag & APR_APPEND) { (*new)->append = 1; SetFilePointer((*new)->filehand, 0, NULL, FILE_END); } - else { - (*new)->append = 0; - } - if (flag & APR_BUFFERED) { (*new)->buffered = 1; (*new)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); - rv = apr_thread_mutex_create(&(*new)->mutex, APR_THREAD_MUTEX_DEFAULT, - pool); - + } + /* Need the mutex to handled buffered and O_APPEND style file i/o */ + if ((*new)->buffered || (*new)->append) { + rv = apr_thread_mutex_create(&(*new)->mutex, + APR_THREAD_MUTEX_DEFAULT, pool); if (rv) { if (file_cleanup(*new) == APR_SUCCESS) { apr_pool_cleanup_kill(pool, *new, file_cleanup); @@ -402,22 +402,6 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, return rv; } } - else { - (*new)->buffered = 0; - (*new)->buffer = NULL; - (*new)->mutex = NULL; - } - - (*new)->pipe = 0; - (*new)->timeout = -1; - (*new)->ungetchar = -1; - (*new)->eof_hit = 0; - - /* Buffered mode fields not initialized above */ - (*new)->bufpos = 0; - (*new)->dataRead = 0; - (*new)->direction = 0; - (*new)->filePtr = 0; if (!(flag & APR_FILE_NOCLEANUP)) { apr_pool_cleanup_register((*new)->pool, (void *)(*new), file_cleanup, @@ -432,8 +416,9 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) if ((stat = file_cleanup(file)) == APR_SUCCESS) { apr_pool_cleanup_kill(file->pool, file, file_cleanup); - if (file->buffered) + if (file->mutex) { apr_thread_mutex_destroy(file->mutex); + } return APR_SUCCESS; } @@ -536,17 +521,19 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file)->ungetchar = -1; /* no char avail */ (*file)->timeout = -1; (*file)->flags = flags; - if (flags & APR_APPEND) - (*file)->append = 1; + if (flags & APR_APPEND) { + (*file)->append = 1; + } if (flags & APR_BUFFERED) { - apr_status_t rv; - (*file)->buffered = 1; (*file)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); - rv = apr_thread_mutex_create(&(*file)->mutex, APR_THREAD_MUTEX_DEFAULT, - pool); + } + if ((*file)->append || (*file)->buffered) { + apr_status_t rv; + rv = apr_thread_mutex_create(&(*file)->mutex, + APR_THREAD_MUTEX_DEFAULT, pool); if (rv) { if (file_cleanup(*file) == APR_SUCCESS) { apr_pool_cleanup_kill(pool, *file, file_cleanup); diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index d3e215e5495..b35904e9d40 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -303,15 +303,42 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a apr_thread_mutex_unlock(thefile->mutex); return rv; } else { - if (thefile->pOverlapped && !thefile->pipe) { - thefile->pOverlapped->Offset = (DWORD)thefile->filePtr; - thefile->pOverlapped->OffsetHigh = (DWORD)(thefile->filePtr >> 32); + if (!thefile->pipe) { + apr_off_t offset = 0; + apr_status_t rc; + if (thefile->pOverlapped) { + thefile->pOverlapped->Offset = (DWORD)thefile->filePtr; + thefile->pOverlapped->OffsetHigh = (DWORD)(thefile->filePtr >> 32); + } + if (thefile->append) { + apr_thread_mutex_lock(thefile->mutex); + if (!thefile->pOverlapped) { + rc = apr_file_lock(thefile, APR_FLOCK_EXCLUSIVE); + if (rc != APR_SUCCESS) { + apr_thread_mutex_unlock(thefile->mutex); + return rc; + } + } + rc = apr_file_seek(thefile, APR_END, &offset); + if (rc != APR_SUCCESS) { + apr_thread_mutex_unlock(thefile->mutex); + return rc; + } + } + rv = WriteFile(thefile->filehand, buf, *nbytes, &bwrote, + thefile->pOverlapped); + if (thefile->append) { + if (!thefile->pOverlapped) { + apr_file_unlock(thefile); + } + apr_thread_mutex_unlock(thefile->mutex); + } } - else if (!thefile->pipe && thefile->append) { - SetFilePointer(thefile->filehand, 0, NULL, FILE_END); + else { + rv = WriteFile(thefile->filehand, buf, *nbytes, &bwrote, + thefile->pOverlapped); } - if (WriteFile(thefile->filehand, buf, *nbytes, &bwrote, - thefile->pOverlapped)) { + if (rv) { *nbytes = bwrote; rv = APR_SUCCESS; } From 476784530f6a9a72d2b57ce99daca9aa31608865 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 29 Oct 2002 01:33:51 +0000 Subject: [PATCH 3972/7878] Fix comments git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63991 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 1ccca5204d0..efc3c83e576 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -135,7 +135,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out } /* apr_create_nt_pipe() - * An internal (for now) APR function created for use by apr_proc_create() + * An internal (for now) APR function used by apr_proc_create() * when setting up pipes to communicate with the child process. * apr_create_nt_pipe() allows setting the blocking mode of each end of * the pipe when the pipe is created (rather than after the pipe is created). @@ -150,9 +150,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out * non-blocking? On NT, even though you can set a pipe non-blocking, * there is no clean way to set event driven non-zero timeouts (e.g select(), * WaitForSinglelObject, et. al. will not detect pipe i/o). On NT, you - * have to poll the pipe to detech i/o on a non-blocking pipe. - * - * wgs + * have to poll the pipe to detect i/o on a non-blocking pipe. */ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, From c9bf440349b7d1dc4b0b91eef8c77a73f2ca58c7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Oct 2002 02:19:50 +0000 Subject: [PATCH 3973/7878] If opened append and overlapped, use apr_file_seek -first- to recompute ->filePtr. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63992 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index b35904e9d40..fc9894ddbd7 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -306,10 +306,6 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a if (!thefile->pipe) { apr_off_t offset = 0; apr_status_t rc; - if (thefile->pOverlapped) { - thefile->pOverlapped->Offset = (DWORD)thefile->filePtr; - thefile->pOverlapped->OffsetHigh = (DWORD)(thefile->filePtr >> 32); - } if (thefile->append) { apr_thread_mutex_lock(thefile->mutex); if (!thefile->pOverlapped) { @@ -325,6 +321,10 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a return rc; } } + if (thefile->pOverlapped) { + thefile->pOverlapped->Offset = (DWORD)thefile->filePtr; + thefile->pOverlapped->OffsetHigh = (DWORD)(thefile->filePtr >> 32); + } rv = WriteFile(thefile->filehand, buf, *nbytes, &bwrote, thefile->pOverlapped); if (thefile->append) { From ecdd8d0a87af3876ba78584e9b81bdb1bbd4605a Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 29 Oct 2002 12:15:19 +0000 Subject: [PATCH 3974/7878] Comment a not so obvious tidbit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63993 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index fc9894ddbd7..b286935c1f8 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -307,6 +307,11 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a apr_off_t offset = 0; apr_status_t rc; if (thefile->append) { + /* apr_file_lock will mutex the file across processes. + * The call to apr_thread_mutex_lock is added to avoid + * a race condition between LockFile and WriteFile + * that occasionally leads to deadlocked threads. + */ apr_thread_mutex_lock(thefile->mutex); if (!thefile->pOverlapped) { rc = apr_file_lock(thefile, APR_FLOCK_EXCLUSIVE); From 2d5699b224f5f2ded6b569de4b9f04d256364055 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Oct 2002 21:13:54 +0000 Subject: [PATCH 3975/7878] Always lock the file on append, it's a good idea git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63994 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index b286935c1f8..3b0a22e3d2a 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -313,12 +313,10 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a * that occasionally leads to deadlocked threads. */ apr_thread_mutex_lock(thefile->mutex); - if (!thefile->pOverlapped) { - rc = apr_file_lock(thefile, APR_FLOCK_EXCLUSIVE); - if (rc != APR_SUCCESS) { - apr_thread_mutex_unlock(thefile->mutex); - return rc; - } + rc = apr_file_lock(thefile, APR_FLOCK_EXCLUSIVE); + if (rc != APR_SUCCESS) { + apr_thread_mutex_unlock(thefile->mutex); + return rc; } rc = apr_file_seek(thefile, APR_END, &offset); if (rc != APR_SUCCESS) { @@ -333,9 +331,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = WriteFile(thefile->filehand, buf, *nbytes, &bwrote, thefile->pOverlapped); if (thefile->append) { - if (!thefile->pOverlapped) { - apr_file_unlock(thefile); - } + apr_file_unlock(thefile); apr_thread_mutex_unlock(thefile->mutex); } } From ff96b26d8b2351e3dc209c0d23fa6bfca5ddfe97 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 29 Oct 2002 22:54:22 +0000 Subject: [PATCH 3976/7878] Whoa Nelly! Lots of errors in the global mutex failure cases. We have to unlock the outer lock when the inner lock fails!!! Many deadlock situations existed prior to this patch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63995 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/global_mutex.c | 49 +++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index 763d0b0b5a2..51f2ba54e68 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -64,19 +64,20 @@ static apr_status_t global_mutex_cleanup(void *data) apr_global_mutex_t *m = (apr_global_mutex_t *)data; apr_status_t rv; + rv = apr_proc_mutex_destroy(m->proc_mutex); + #if APR_HAS_THREADS if (m->thread_mutex) { - rv = apr_thread_mutex_destroy(m->thread_mutex); if (rv != APR_SUCCESS) { - return rv; + (void)apr_thread_mutex_destroy(m->thread_mutex); + } + else { + rv = apr_thread_mutex_destroy(m->thread_mutex); } } #endif /* APR_HAS_THREADS */ - rv = apr_proc_mutex_destroy(m->proc_mutex); - if (rv != APR_SUCCESS) { - return rv; - } - return APR_SUCCESS; + + return rv; } APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, @@ -103,6 +104,7 @@ APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, rv = apr_thread_mutex_create(&m->thread_mutex, APR_THREAD_MUTEX_DEFAULT, m->pool); if (rv != APR_SUCCESS) { + rv = apr_proc_mutex_destroy(m->proc_mutex); return rv; } } @@ -134,11 +136,18 @@ APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) } } #endif /* APR_HAS_THREADS */ + rv = apr_proc_mutex_lock(mutex->proc_mutex); + +#if APR_HAS_THREADS if (rv != APR_SUCCESS) { - return rv; + if (mutex->thread_mutex) { + (void)apr_thread_mutex_unlock(mutex->thread_mutex); + } } - return APR_SUCCESS; +#endif /* APR_HAS_THREADS */ + + return rv; } APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) @@ -153,11 +162,18 @@ APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) } } #endif /* APR_HAS_THREADS */ + rv = apr_proc_mutex_trylock(mutex->proc_mutex); + +#if APR_HAS_THREADS if (rv != APR_SUCCESS) { - return rv; + if (mutex->thread_mutex) { + (void)apr_thread_mutex_unlock(mutex->thread_mutex); + } } - return APR_SUCCESS; +#endif /* APR_HAS_THREADS */ + + return rv; } APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) @@ -165,18 +181,17 @@ APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) apr_status_t rv; rv = apr_proc_mutex_unlock(mutex->proc_mutex); - if (rv != APR_SUCCESS) { - return rv; - } #if APR_HAS_THREADS if (mutex->thread_mutex) { - rv = apr_thread_mutex_unlock(mutex->thread_mutex); if (rv != APR_SUCCESS) { - return rv; + (void)apr_thread_mutex_unlock(mutex->thread_mutex); + } + else { + rv = apr_thread_mutex_unlock(mutex->thread_mutex); } } #endif /* APR_HAS_THREADS */ - return APR_SUCCESS; + return rv; } APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmutex, From d3e7dff04f95d6982979fa31f1da7b335f54f543 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 30 Oct 2002 07:19:37 +0000 Subject: [PATCH 3977/7878] Based on Brad's feedback, we don't want really huge things on the stack, so set an arbitrary limit and retain the malloc-for-too-many WSABUFs architecture. However, don't waste extra stack space. Also create an arbitrary buffer of 4kb to deal with headers and trailers. If this small buffer is exceeded, punt to apr_sendv instead of following these multi-copy semantics, and let sendv do what sendv does best. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63996 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 69 +++++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 19 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 0fd02a43768..a9f8a41896e 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -138,14 +138,12 @@ APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, apr_ssize_t rv; int i; DWORD dwBytes = 0; - WSABUF wsabuf[WSABUF_ON_STACK]; - LPWSABUF pWsaBuf = wsabuf; + WSABUF *pWsaBuf = (nvec <= WSABUF_ON_STACK) ? _alloca(sizeof(WSABUF) * (nvec)) + : malloc(sizeof(WSABUF) * (nvec)); + + if (!pWsaBuf) + return APR_ENOMEM; - if (nvec > WSABUF_ON_STACK) { - pWsaBuf = (LPWSABUF) malloc(sizeof(WSABUF) * nvec); - if (!pWsaBuf) - return APR_ENOMEM; - } for (i = 0; i < nvec; i++) { pWsaBuf[i].buf = vec[i].iov_base; pWsaBuf[i].len = vec[i].iov_len; @@ -213,12 +211,12 @@ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, } -static void collapse_iovec(char **buf, int *len, struct iovec *iovec, int numvec, apr_pool_t *p) +static apr_status_t collapse_iovec(char **off, apr_size_t *len, + struct iovec *iovec, int numvec, + char *buf, apr_size_t buflen) { - int ptr = 0; - if (numvec == 1) { - *buf = iovec[0].iov_base; + *off = iovec[0].iov_base; *len = iovec[0].iov_len; } else { @@ -227,13 +225,19 @@ static void collapse_iovec(char **buf, int *len, struct iovec *iovec, int numvec *len += iovec[i].iov_len; } - *buf = apr_palloc(p, *len); /* Should this be a malloc? */ + if (*len > buflen) { + *len = 0; + return APR_INCOMPLETE; + } + + *off = buf; for (i = 0; i < numvec; i++) { - memcpy((char*)*buf + ptr, iovec[i].iov_base, iovec[i].iov_len); - ptr += iovec[i].iov_len; + memcpy(buf, iovec[i].iov_base, iovec[i].iov_len); + buf += iovec[i].iov_len; } } + return APR_SUCCESS; } @@ -274,7 +278,9 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, int ptr = 0; int bytes_to_send; /* Bytes to send out of the file (not including headers) */ int disconnected = 0; + int sendv_trailers = 0; HANDLE wait_event; + char hdtrbuf[4096]; if (apr_os_level < APR_WIN_NT) { return APR_ENOTIMPL; @@ -313,8 +319,18 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, /* Collapse the headers into a single buffer */ if (hdtr && hdtr->numheaders) { ptfb = &tfb; - collapse_iovec((char **)&ptfb->Head, &ptfb->HeadLength, hdtr->headers, - hdtr->numheaders, sock->cntxt); + nbytes = 0; + rv = collapse_iovec((char **)&ptfb->Head, &ptfb->HeadLength, + hdtr->headers, hdtr->numheaders, + hdtrbuf, sizeof(hdtrbuf)); + /* If not enough buffer, punt to sendv */ + if (rv == APR_INCOMPLETE) { + rv = apr_sendv(sock, hdtr->headers, hdtr->numheaders, &nbytes); + if (rv != APR_SUCCESS) + return rv; + *len += nbytes; + ptfb = NULL; + } } while (bytes_to_send) { @@ -327,11 +343,18 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, /* Collapse the trailers into a single buffer */ if (hdtr && hdtr->numtrailers) { ptfb = &tfb; - collapse_iovec((char**) &ptfb->Tail, &ptfb->TailLength, - hdtr->trailers, hdtr->numtrailers, sock->cntxt); + rv = collapse_iovec((char**) &ptfb->Tail, &ptfb->TailLength, + hdtr->trailers, hdtr->numtrailers, + hdtrbuf + ptfb->HeadLength, + sizeof(hdtrbuf) - ptfb->HeadLength); + if (rv == APR_INCOMPLETE) { + /* If not enough buffer, punt to sendv, later */ + sendv_trailers = 1; + } } /* Disconnect the socket after last send */ - if (flags & APR_SENDFILE_DISCONNECT_SOCKET) { + if ((flags & APR_SENDFILE_DISCONNECT_SOCKET) + && !sendv_trailers) { dwFlags |= TF_REUSE_SOCKET; dwFlags |= TF_DISCONNECT; disconnected = 1; @@ -405,6 +428,14 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, } if (status == APR_SUCCESS) { + if (sendv_trailers) { + rv = apr_sendv(sock, hdtr->trailers, hdtr->numtrailers, &nbytes); + if (rv != APR_SUCCESS) + return rv; + *len += nbytes; + } + + /* Mark the socket as disconnected, but do not close it. * Note: The application must have stored the socket prior to making * the call to apr_sendfile in order to either reuse it or close it. From a1cbf0506f85de5be048728e80fc0f96f6614f90 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 31 Oct 2002 09:40:20 +0000 Subject: [PATCH 3978/7878] ignore generated file git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63997 13f79535-47bb-0310-9956-ffa450edef68 --- test/internal/.cvsignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/internal/.cvsignore diff --git a/test/internal/.cvsignore b/test/internal/.cvsignore new file mode 100644 index 00000000000..f3c7a7c5da6 --- /dev/null +++ b/test/internal/.cvsignore @@ -0,0 +1 @@ +Makefile From 2995b1dfcbde2a6c73d65cd69d26b1ff368cd922 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 5 Nov 2002 16:01:51 +0000 Subject: [PATCH 3979/7878] ReliantUnix: recognize that dlsym() is in libdl and dlopen() is in libc. The check is generic so maybe this fixes some other system. PR: 14189 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63998 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ configure.in | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGES b/CHANGES index df5d4235d27..3b71f16dcfe 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ Changes with APR 0.9.2 + + *) ReliantUnix: recognize that dlsym() is in libdl and dlopen() is in + libc. The check is generic so maybe this fixes some other system. + PR 14189 [Jeff Trawick] + *) Win32: Fix APR_APPEND file i/o. [Bill Stoddard] *) Fix a problem retrieving the remote socket address for sockets diff --git a/configure.in b/configure.in index 16ac205489f..56bf5ca37e8 100644 --- a/configure.in +++ b/configure.in @@ -1283,6 +1283,17 @@ AC_ARG_ENABLE(dso, AC_CHECK_LIB(dl, dlopen, [ tempdso="dlfcn" APR_ADDTO(LIBS,-ldl) ], tempdso="no") fi + if test "$tempdso" = "dlfcn"; then + # ReliantUnix has dlopen() in libc but dlsym() in libdl :( + AC_CHECK_FUNCS(dlsym, [ tempdso="dlfcn" ], [ tempdso="no" ]) + if test "$tempdso" = "no"; then + AC_CHECK_LIB(dl, dlsym, [ tempdso="dlfcn" APR_ADDTO(LIBS, -ldl) ], + tempdso="no") + fi + if test "$tempdso" = "no"; then + echo "Weird: dlopen() was found but dlsym() was not found!" + fi + fi if test "$tempdso" = "no"; then AC_CHECK_LIB(root, load_image, tempdso="yes", tempdso="no") fi From 26b84b60646300380e9b492125ef901559ff3ebd Mon Sep 17 00:00:00 2001 From: Ben Collins-Sussman Date: Tue, 5 Nov 2002 22:09:19 +0000 Subject: [PATCH 3980/7878] * find_apr.m4: backport a change from svn; favor in-tree over installed apr git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63999 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index a334cc16813..90865aeca9c 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -73,7 +73,17 @@ AC_DEFUN(APR_FIND_APR, [ build directory, or an apr-config file.]) fi ],[ - if test -n "$3" && test "$3" = "1"; then + dnl if we have a bundled source directory, use it + if test -d "$1"; then + apr_temp_abs_srcdir="`cd $1 && pwd`" + apr_found="reconfig" + if test -n "$2"; then + apr_config="$2/apr-config" + else + apr_config="$1/apr-config" + fi + fi + if test "$apr_found" = "no" && test -n "$3" && test "$3" = "1"; then if apr-config --help > /dev/null 2>&1 ; then apr_found="yes" apr_config="apr-config" @@ -88,25 +98,6 @@ build directory, or an apr-config file.]) done fi fi - dnl if we have a bundled source directory, then we may have more work - if test -d "$1"; then - apr_temp_abs_srcdir="`cd $1 && pwd`" - if test "$apr_found" = "yes" \ - && test "`$apr_config --srcdir`" = "$apr_temp_abs_srcdir"; then - dnl the installed apr-config represents our source directory, so - dnl pretend we didn't see it and just use our bundled source - apr_found="no" - fi - dnl We could not find an apr-config; use the bundled one - if test "$apr_found" = "no"; then - apr_found="reconfig" - if test -n "$2"; then - apr_config="$2/apr-config" - else - apr_config="$1/apr-config" - fi - fi - fi ]) AC_MSG_RESULT($apr_found) From bfa435e1cda587482ea0b5f3cb9b43c1f1ae56c5 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 6 Nov 2002 17:08:53 +0000 Subject: [PATCH 3981/7878] Store and use the path context to each directory and file rather than relying on the directory path alone. This allows for direct access into the file system on every stat() and open() call rather than having to traverse the file system each time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64000 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 137 ---------------------------------- file_io/unix/open.c | 8 -- file_io/win32/filepath.c | 2 - include/arch/netware/fileio.h | 6 -- 4 files changed, 153 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 5eb6c9870d5..7d039cf51b1 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -53,9 +53,7 @@ */ #include "fileio.h" -#ifdef FAST_STAT #include "fsio.h" -#endif #include "nks/dirio.h" #include "apr_file_io.h" #include "apr_general.h" @@ -107,32 +105,6 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, */ } -#ifndef FAST_STAT -char *case_filename(apr_pool_t *pPool, const char *szFile) -{ - char *casedFileName = NULL; - char name[1024]; - int rc; - - rc = realname(szFile, name); - if (rc == 0) { - casedFileName = apr_pstrdup(pPool, name); - } - else - { - char *s; - s = strrchr(szFile, '/'); - if (!s) - s = strrchr(szFile, ':'); - if (s) { - casedFileName = apr_pstrdup(pPool, &s[1]); - } - } - return casedFileName; -} -#endif - - APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) @@ -210,7 +182,6 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, return apr_file_perms_set(fname, finfo.protection); } -#ifdef FAST_STAT int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *pool) { apr_hash_t *statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor); @@ -310,7 +281,6 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo } } -/* xxx Need to handle error codes here */ err = NXCreatePathContext(pathCtx, dirPath, 0, NULL, &pathCtx); key = apr_pstrdup (gPool, path); @@ -379,113 +349,6 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo } return 0; } -#else -int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *pool) -{ - apr_hash_t *statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor); - apr_pool_t *gPool = (apr_pool_t *)getGlobalPool(CpuCurrentProcessor); - apr_stat_entry_t *stat_entry; - struct stat *info; - apr_time_t now = apr_time_now(); - char *key; - int ret; - int found = 0; - - *casedName = NULL; - - /* If there isn't a global pool then just stat the file - and return */ - if (!gPool) { - char poolname[50]; - - if (apr_pool_create(&gPool, NULL) != APR_SUCCESS) { - ret = stat(path, buf); - if (ret == 0) - *casedName = case_filename(pool, path); - return ret; - } - - sprintf (poolname, "cstat_mem_pool_%d", CpuCurrentProcessor); - apr_pool_tag(gPool, poolname); - - setGlobalPool(gPool, CpuCurrentProcessor); - } - - /* If we have a statCache hash table then use it. - Otherwise we need to create it and initialized it - with a new mutex lock. */ - if (!statCache) { - statCache = apr_hash_make(gPool); - setStatCache((void*)statCache, CpuCurrentProcessor); - } - - /* If we have a statCache then try to pull the information - from the cache. Otherwise just stat the file and return.*/ - if (statCache) { - stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, path, APR_HASH_KEY_STRING); - /* If we got an entry then check the expiration time. If the entry - hasn't expired yet then copy the information and return. */ - if (stat_entry) { - if ((now - stat_entry->expire) <= APR_USEC_PER_SEC) { - memcpy (buf, &(stat_entry->info), sizeof(struct stat)); - if (stat_entry->casedName) - *casedName = apr_pstrdup (pool, stat_entry->casedName); - else - *casedName = case_filename(pool, path); - found = 1; - } - } - - /* Since we are creating a separate stat cache for each processor, we - don't need to worry about locking the hash table before manipulating - it. */ - if (!found) { - /* Bind the thread to the current cpu so that we don't wake - up on some other cpu and try to manipulate the wrong cache. */ - NXThreadBind (CpuCurrentProcessor); - ret = stat(path, buf); - if (ret == 0) { - *casedName = case_filename(pool, path); - /* If we don't have a stat_entry then create one, copy - the data and add it to the hash table. */ - if (!stat_entry) { - key = apr_pstrdup (gPool, path); - stat_entry = apr_palloc (gPool, sizeof(apr_stat_entry_t)); - memcpy (&(stat_entry->info), buf, sizeof(struct stat)); - if (*casedName) - stat_entry->casedName = apr_pstrdup (gPool, *casedName); - stat_entry->expire = now; - apr_hash_set(statCache, key, APR_HASH_KEY_STRING, stat_entry); - } - else { - /* If we do have a stat_entry then it must have expired. Just - copy the data and reset the expiration. */ - memcpy (&(stat_entry->info), buf, sizeof(struct stat)); - - /* If we have a casedName and don't have a cached name or the names don't - compare, then cache the name. */ - if (*casedName && (!stat_entry->casedName || strcmp(*casedName, stat_entry->casedName))) { - stat_entry->casedName = apr_pstrdup (gPool, *casedName); - } - stat_entry->expire = now; - } - NXThreadBind (NX_THR_UNBOUND); - } - else{ - NXThreadBind (NX_THR_UNBOUND); - return ret; - } - } - } - else { - ret = stat(path, buf); - if (ret == 0) - *casedName = case_filename(pool, path); - return ret; - } - return 0; -} -#endif APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, diff --git a/file_io/unix/open.c b/file_io/unix/open.c index fc8ca018a81..80268be1a4f 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -58,13 +58,11 @@ #include "apr_thread_mutex.h" #include "inherit.h" -#ifdef FAST_STAT #ifdef NETWARE #include "nks/dirio.h" #include "apr_hash.h" #include "fsio.h" #endif -#endif apr_status_t apr_unix_file_cleanup(void *thefile) { @@ -105,11 +103,9 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, apr_status_t rv; #endif -#ifdef FAST_STAT #ifdef NETWARE apr_hash_t *statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor); apr_stat_entry_t *stat_entry; -#endif #endif (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); @@ -173,14 +169,12 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, } #endif -#ifdef FAST_STAT #ifdef NETWARE stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, fname, APR_HASH_KEY_STRING); if (stat_entry) { errno = NXFileOpen (stat_entry->pathCtx, stat_entry->casedName, oflags, &(*new)->filedes); } else { -#endif #endif if (perm == APR_OS_DEFAULT) { (*new)->filedes = open(fname, oflags, 0666); @@ -188,10 +182,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, else { (*new)->filedes = open(fname, oflags, apr_unix_perms2mode(perm)); } -#ifdef FAST_STAT #ifdef NETWARE } -#endif #endif if ((*new)->filedes < 0) { diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 74e8ce23c6b..f66df5a3e79 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -61,9 +61,7 @@ #ifdef NETWARE #include -#ifdef FAST_STAT #include -#endif #endif /* WinNT accepts several odd forms of a 'root' path. Under Unicode diff --git a/include/arch/netware/fileio.h b/include/arch/netware/fileio.h index 109f79f1dec..9a7d0569d7f 100644 --- a/include/arch/netware/fileio.h +++ b/include/arch/netware/fileio.h @@ -55,8 +55,6 @@ #ifndef FILE_IO_H #define FILE_IO_H -//#define FAST_STAT - #include "apr.h" #include "apr_private.h" #include "apr_general.h" @@ -104,11 +102,7 @@ #include #endif -#ifdef FAST_STAT #include -#else -#include -#endif /* End System headers */ From fc85c20d861bd9effa52ea85560427a45351fa33 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 6 Nov 2002 17:09:35 +0000 Subject: [PATCH 3982/7878] NetWare quick file IO scheme git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64001 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 3b71f16dcfe..bee30d69971 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR 0.9.2 + *) NetWare: implemented a file IO path context scheme to directly + reference directory paths and files in the file system rather + than having to traverse the file system on every stat() or + open() call. (Performance enhancement) [Brad Nicholes] + *) ReliantUnix: recognize that dlsym() is in libdl and dlopen() is in libc. The check is generic so maybe this fixes some other system. PR 14189 [Jeff Trawick] From 0b5dde4466f6c8d0d43cfce6908b7e98d8f902c4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 7 Nov 2002 18:35:46 +0000 Subject: [PATCH 3983/7878] more ignore good-ness. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64002 13f79535-47bb-0310-9956-ffa450edef68 --- test/internal/.cvsignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/internal/.cvsignore b/test/internal/.cvsignore index f3c7a7c5da6..59c0d1c4bd8 100644 --- a/test/internal/.cvsignore +++ b/test/internal/.cvsignore @@ -1 +1,5 @@ Makefile +.libs +testregex +testregex.lo + From 22c9be645c8689db4edd65c2986fea02df52e031 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 7 Nov 2002 19:50:04 +0000 Subject: [PATCH 3984/7878] Switched from processve() to procve() API. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64003 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index dd5dd953f9e..60ad76935b5 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -57,7 +57,7 @@ #include "apr_strings.h" #include "apr_portable.h" -#include +#include apr_status_t apr_netware_proc_cleanup(void *theproc) { @@ -304,10 +304,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, newproc->out = attr->parent_out; newproc->err = attr->parent_err; - addr_space = attr->detached ? 0 : PROC_CURRENT_SPACE; + addr_space = (attr->detached ? 0 : PROC_CURRENT_SPACE) | PROC_LOAD_SILENT; - if ((newproc->pid = processve(progname, addr_space, (const char**)env, &wire, - NULL, NULL, (const char **)args)) == 0) { + if ((newproc->pid = procve(progname, addr_space, (const char**)env, &wire, + NULL, NULL, 0, NULL, (const char **)args)) == 0) { return errno; } From 0564dca28a8c08ae37ca2537719b195a7d3bac97 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 7 Nov 2002 19:50:24 +0000 Subject: [PATCH 3985/7878] Cleaning out some left over garbage. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64004 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_private.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 793941371de..da924107b69 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -75,19 +75,17 @@ #include #include -//#include "memcheck.h" - /* Use this section to define all of the HAVE_FOO_H * that are required to build properly. */ #define HAVE_DLFCN_H 1 #define HAVE_LIMITS_H 1 -//#define HAVE_MALLOC_H 1 #define HAVE_SIGNAL_H 1 -/* #define HAVE_STDDEF_H 1 why not? */ +#define HAVE_STDDEF_H 1 #define HAVE_STDLIB_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_FCNTL_H 1 +#define HAVE_ICONV_H 1 #define HAVE_STRICMP 1 #define HAVE_STRNICMP 1 @@ -96,8 +94,7 @@ #define HAVE_MEMCHR 1 #define HAVE_CALLOC 1 -#define ALLOC_USE_MALLOC -#define DSO_USE_DLFCN +/*#define DSO_USE_DLFCN */ #ifdef NW_BUILD_IPV6 #define HAVE_GETADDRINFO 1 From 807e619c3559778beb9953d2b091b5563d77a029 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 7 Nov 2002 19:59:37 +0000 Subject: [PATCH 3986/7878] Move the APR design document to the docs directory, and make it an HTML file. The content has been changed a little bit to match what we are doing currently. I should have made two commits, but I noticed all of the errors in the doc as I was converting it to HTML, so it was easier to do all of the changes in one go. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64005 13f79535-47bb-0310-9956-ffa450edef68 --- APRDesign | 341 ------------------------------------- docs/APRDesign.html | 399 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 399 insertions(+), 341 deletions(-) delete mode 100644 APRDesign create mode 100644 docs/APRDesign.html diff --git a/APRDesign b/APRDesign deleted file mode 100644 index 8db21f9b889..00000000000 --- a/APRDesign +++ /dev/null @@ -1,341 +0,0 @@ -Design of APR - -The Apache Portable Run-time libraries have been designed to provide a common -interface to low level routines across any platform. The original goal of APR -was to combine all code in Apache to one common code base. This is not the -correct approach however, so the goal of APR has changed. - -There are places where common code is not a good thing. For example, how to -map requests to either threads or processes should be platform specific. -APR's place is now to combine any code that can be safely combined without -sacrificing performance. - -To this end we have created a set of operations that are required for cross -platform development. There may be other types that are desired and those -will be implemented in the future. The first version of APR will focus on -what Apache 2.0 needs. Of course, anything that is submitted will be -considered for inclusion. - -This document will discuss the structure of APR, and how best to contribute -code to the effort. - -APR On Windows - -APR on Windows is different from APR on all other systems, because it -doesn't use autoconf. On Unix, apr_private.h (private to APR) and apr.h -(public, used by applications that use APR) are generated by autoconf -from acconfig.h and apr.h.in respectively. On Windows, apr_private.h -and apr.h are created from apr_private.hw and apr.hw respectively. - -!!!*** If you add code to acconfig.h or tests to configure.in or aclocal.m4, - please give some thought to whether or not Windows needs this addition - as well. A general rule of thumb, is that if it is a feature macro, - such as APR_HAS_THREADS, Windows needs it. If the definition is going - to be used in a public APR header file, such as apr_general.h, Windows - needs it. - - The only time it is safe to add a macro or test without also adding - the macro to apr*.hw, is if the macro tells APR how to build. For - example, a test for a header file does not need to be added to Windows. -***!!! - -APR Features - -One of the goals of APR is to provide a common set of features across all -platforms. This is an admirable goal, it is also not realistic. We cannot -expect to be able to implement ALL features on ALL platforms. So we are -going to do the next best thing. Provide a common interface to ALL APR -features on MOST platforms. - -APR developers should create FEATURE MACROS for any feature that is not -available on ALL platforms. This should be a simple definition which has -the form: - -APR_HAS_FEATURE - -This macro should evaluate to true if APR has this feature on this platform. -For example, Linux and Windows have mmap'ed files, and APR is providing an -interface for mmapp'ing a file. On both Linux and Windows, APR_HAS_MMAP -should evaluate to one, and the ap_mmap_* functions should map files into -memory and return the appropriate status codes. - -If your OS of choice does not have mmap'ed files, APR_HAS_MMAP should evaluate -to zero, and all ap_mmap_* functions should not be defined. The second step -is a precaution that will allow us to break at compile time if a programmer -tries to use unsupported functions. - -APR types - -The base types in APR -file_io File I/O, including pipes -lib A portable library originally used in Apache. This contains - memory management, tables, and arrays. -locks Mutex and reader/writer locks -misc Any APR type which doesn't have any other place to belong -network_io Network I/O -shmem Shared Memory (Not currently implemented) -signal Asynchronous Signals -threadproc Threads and Processes -time Time - -Directory Structure - -Each type has a base directory. Inside this base directory, are -subdirectories, which contain the actual code. These subdirectories are named -after the platforms the are compiled on. Unix is also used as a common -directory. If the code you are writing is POSIX based, you should look at the -code in the unix directory. A good rule of thumb, is that if more than half -your code needs to be ifdef'ed out, and the structures required for your code -are substantively different from the POSIX code, you should create a new -directory. - -Currently, the APR code is written for Unix, BeOS, Windows, and OS/2. An -example of the directory structure is the file I/O directory: - -apr - | - -> file_io - | - -> unix The Unix and common base code - | - -> win32 The Windows code - | - -> os2 The OS/2 code - -Obviously, BeOS does not have a directory. This is because BeOS is currently -using the Unix directory for it's file_io. In the near future, it will be -possible to use individual files from the Unix directory. - -There are a few special top level directories. These are test, inc, include, -and libs. Test is a directory which stores all test programs. It is expected -that if a new type is developed, there will also be a new test program, to -help people port this new type to different platforms. Inc is a directory for -internal header files. This directory is likely to go away soon. Include is -a directory which stores all required APR header files for external use. The -distinction between internal and external header files will be made soon. -Finally, libs is a generated directory. When APR finishes building, it will -store it's library files in the libs directory. - -Creating an APR Type - -The current design of APR requires that APR types be incomplete. It is not -possible to write flexible portable code if programs can access the internals -of APR types. This is because different platforms are likely to define -different native types. - -For this reason, each platform defines a structure in their own directories. -Those structures are then typedef'ed in an external header file. For example -in file_io/unix/fileio.h: - - struct ap_file_t { - apr_pool_t *cntxt; - int filedes; - FILE *filehand; - ... - } - -In include/apr_file_io.h: - typedef struct ap_file_t ap_file_t; - -This will cause a compiler error if somebody tries to access the filedes field -in this structure. Windows does not have a filedes field, so obviously, it is -important that programs not be able to access these. - -The only exception to the incomplete type rule can be found in apr_portable.h. -This file defines the native types for each platform. Using these types, it -is possible to extract native types for any APR type. - -You may notice the apr_pool_t field. Most APR types have this field. This -type is used to allocate memory within APR. Any APR type that has this -field should place this field first. If it is important to retrieve the -pool from an APR variable, it is possible to use the macro APR_GET_POOL to -accomplish this. This macro will only work on types that actually have -a pool in them as the first field. On any other type, this macro will cause -a seg fault as soon as the pool is used. - -New Function - -When creating a new function, please try to adhere to these rules. - -1) Result arguments should be the first arguments. -2) If a function needs a context, it should be the last argument. -3) These rules are flexible, especially if it makes the code easier - to understand because it mimics a standard function. - -Documentation - -Whenever a new function is added to APR, it MUST be documented. New -functions will not be committed unless there are docs to go along with them. -The documentation should be a comment block above the function in the header -file. - -The format for the comment block is: - -/** - * Brief description of the function - * @param parma_1_name explanation - * @param parma_2_name explanation - * @param parma_n_name explanation - * @tip Any extra information people should know. - * @deffunc function prototype if required - */ - -The last line is not strictly needed. The parser in ScanDoc is not perfect -yet, and it can not parse prototypes that are in any form other than - return_type program_name(type1 param1, type2 param2, ...) -This means that any function prototype that resembles: - APR_DECLARE(ap_status_t) ap_foo(int f1, char *f2) -will need the deffunc. - -For an actual example, look at any file in the include directory (ap_tables.h -hasn't been done yet). - -APR Error reporting - -Most APR functions should return an ap_status_t type. The only time an -APR function does not return an ap_status_t is if it absolutely CAN NOT -fail. Examples of this would be filling out an array when you know you are -not beyond the array's range. If it cannot fail on your platform, but it -could conceivably fail on another platform, it should return an ap_status_t. -Unless you are sure, return an ap_status_t. :-) - -All platforms return errno values unchanged. Each platform can also have -one system error type, which can be returned after an offset is added. -There are five types of error values in APR, each with it's own offset. - - Name Purpose -0) This is 0 for all platforms and isn't really defined - anywhere, but it is the offset for errno values. - (This has no name because it isn't actually defined, - but for completeness we are discussing it here). -1) APR_OS_START_ERROR This is platform dependent, and is the offset at which - APR errors start to be defined. (Canonical error - values are also defined in this section. [Canonical - error values are discussed later]). -2) APR_OS_START_STATUS This is platform dependent, and is the offset at which - APR status values start. -4) APR_OS_START_USEERR This is platform dependent, and is the offset at which - APR apps can begin to add their own error codes. -3) APR_OS_START_SYSERR This is platform dependent, and is the offset at which - system error values begin. - -All of these definitions can be found in apr_errno.h for all platforms. When -an error occurs in an APR function, the function must return an error code. -If the error occurred in a system call and that system call uses errno to -report an error, then the code is returned unchanged. For example: - - if (open(fname, oflags, 0777) < 0) - return errno; - - -The next place an error can occur is a system call that uses some error value -other than the primary error value on a platform. This can also be handled -by APR applications. For example: - - if (CreateFile(fname, oflags, sharemod, NULL, - createflags, attributes, 0) == INVALID_HANDLE_VALUE - return (GetLAstError() + APR_OS_START_SYSERR); - -These two examples implement the same function for two different platforms. -Obviously even if the underlying problem is the same on both platforms, this -will result in two different error codes being returned. This is OKAY, and -is correct for APR. APR relies on the fact that most of the time an error -occurs, the program logs the error and continues, it does not try to -programatically solve the problem. This does not mean we have not provided -support for programmatically solving the problem, it just isn't the default -case. We'll get to how this problem is solved in a little while. - -If the error occurs in an APR function but it is not due to a system call, -but it is actually an APR error or just a status code from APR, then the -appropriate code should be returned. These codes are defined in apr_errno.h -and are self explanatory. - -No APR code should ever return a code between APR_OS_START_USEERR and -APR_OS_START_SYSERR, those codes are reserved for APR applications. - -To programmatically correct an error in a running application, the error codes -need to be consistent across platforms. This should make sense. To get -consistent error codes, APR provides a function ap_canonical_error(). -This function will take as input any ap_status_t value, and return a small -subset of canonical APR error codes. These codes will be equivalent to -Unix errno's. Why is it a small subset? Because we don't want to try to -convert everything in the first pass. As more programs require that more -error codes are converted, they will be added to this function. - -Why did APR take this approach? There are two ways to deal with error -codes portably. - -1) return the same error code across all platforms. 2) return platform -specific error codes and convert them when necessary. - -The problem with option number one is that it takes time to convert error -codes to a common code, and most of the time programs want to just output -an error string. If we convert all errors to a common subset, we have four -steps to output an error string: - - make syscall that fails - convert to common error code step 1 - return common error code - check for success - call error output function step 2 - convert back to system error step 3 - output error string step 4 - -By keeping the errors platform specific, we can output error strings in two -steps. - - make syscall that fails - return error code - check for success - call error output function step 1 - output error string step 2 - -Less often, programs change their execution based on what error was returned. -This is no more expensive using option 2 and it is using option 1, but we -put the onus of converting the error code on the programmer themselves. -For example, using option 1: - - make syscall that fails - convert to common error code - return common error code - decide execution based on common error code - -Using option 2: - - make syscall that fails - return error code - convert to common error code (using ap_canonical_error) - decide execution based on common error code - -Finally, there is one more operation on error codes. You can get a string -that explains in human readable form what has happened. To do this using -APR, call ap_strerror(). - -On all platforms ap_strerror takes the form: - -char *ap_strerror(ap_status_t err) -{ - if (err < APR_OS_START_ERRNO2) - return (platform dependent error string generator) - if (err < APR_OS_START_ERROR) - return (platform dependent error string generator for - supplemental error values) - if (err < APR_OS_SYSERR) - return (APR generated error or status string) - if (err == 0) - return "No error was found" - else - return "APR doesn't understand this error value" -} - -Notice, this does not handle canonicalized error values well. Those will -return "APR doesn't understand this error value" on some platforms and -an actual error string on others. To deal with this, just get the -string before canonicalizing your error code. - -The other problem with option 1, is that it is a lossy conversion. For -example, Windows and OS/2 have a couple hundred error codes, but POSIX errno -only defines about 50 errno values. This means that if we convert to a -canonical error value immediately, there is no way for the programmer to -get the actual system error. - diff --git a/docs/APRDesign.html b/docs/APRDesign.html new file mode 100644 index 00000000000..7d1caeb8d4e --- /dev/null +++ b/docs/APRDesign.html @@ -0,0 +1,399 @@ + +APR Design Document + +

    Design of APR

    + +

    The Apache Portable Run-time libraries have been designed to provide a common +interface to low level routines across any platform. The original goal of APR +was to combine all code in Apache to one common code base. This is not the +correct approach however, so the goal of APR has changed. There are places +where common code is not a good thing. For example, how to map requests +to either threads or processes should be platform specific. APR's place +is now to combine any code that can be safely combined without sacrificing +performance.

    + +

    To this end we have created a set of operations that are required for cross +platform development. There may be other types that are desired and those +will be implemented in the future.

    + +

    This document will discuss the structure of APR, and how best to contribute +code to the effort.

    + +

    APR On Windows and Netware

    + +

    APR on Windows and Netware is different from APR on all other systems, +because those platforms don't use autoconf. On Unix, apr_private.h (private to +APR) and apr.h (public, used by applications that use APR) are generated by +autoconf from acconfig.h and apr.h.in respectively. On Windows (and Netware), +apr_private.h and apr.h are created from apr_private.hw (apr_private.hwn) +and apr.hw (apr.hwn) respectively.

    + +

    + If you add code to acconfig.h or tests to configure.in or aclocal.m4, + please give some thought to whether or not Windows and Netware need + these additions as well. A general rule of thumb, is that if it is + a feature macro, such as APR_HAS_THREADS, Windows and Netware need it. + In other words, if the definition is going to be used in a public APR + header file, such as apr_general.h, Windows needs it. + + The only time it is safe to add a macro or test without also adding + the macro to apr*.h[n]w, is if the macro tells APR how to build. For + example, a test for a header file does not need to be added to Windows. +

    + +

    APR Features

    + +

    One of the goals of APR is to provide a common set of features across all +platforms. This is an admirable goal, it is also not realistic. We cannot +expect to be able to implement ALL features on ALL platforms. So we are +going to do the next best thing. Provide a common interface to ALL APR +features on MOST platforms.

    + +

    APR developers should create FEATURE MACROS for any feature that is not +available on ALL platforms. This should be a simple definition which has +the form:

    + +APR_HAS_FEATURE + +

    This macro should evaluate to true if APR has this feature on this platform. +For example, Linux and Windows have mmap'ed files, and APR is providing an +interface for mmapp'ing a file. On both Linux and Windows, APR_HAS_MMAP +should evaluate to one, and the ap_mmap_* functions should map files into +memory and return the appropriate status codes.

    + +

    If your OS of choice does not have mmap'ed files, APR_HAS_MMAP should +evaluate to zero, and all ap_mmap_* functions should not be defined. The +second step is a precaution that will allow us to break at compile time if a +programmer tries to use unsupported functions.

    + +

    APR types

    + +

    The base types in APR

    + +
      +
    • dso
      + Shared library routines +
    • mmap
      + Memory-mapped files +
    • poll
      + Polling I/O +
    • time
      + Time +
    • user
      + Users and groups +
    • locks
      + Process and thread locks (critical sections) +
    • shmem
      + Shared memory +
    • file_io
      + File I/O, including pipes +
    • atomic
      + Atomic integer operations +
    • strings
      + String handling routines +
    • memory
      + Pool-based memory allocation +
    • passwd
      + Reading passwords from the terminal +
    • tables
      + Tables and hashes +
    • network_io
      + Network I/O +
    • threadproc
      + Threads and processes +
    • misc
      + Any APR type which doesn't have any other place to belong. This + should be used sparingly. +
    • support
      + Functions meant to be used across multiple APR types. This area + is for internal functions only. If a function is exposed, it should + not be put here. +
    + +

    Directory Structure

    + +

    Each type has a base directory. Inside this base directory, are +subdirectories, which contain the actual code. These subdirectories are named +after the platforms the are compiled on. Unix is also used as a common +directory. If the code you are writing is POSIX based, you should look at the +code in the unix directory. A good rule of thumb, is that if more than half +your code needs to be ifdef'ed out, and the structures required for your code +are substantively different from the POSIX code, you should create a new +directory.

    + +

    Currently, the APR code is written for Unix, BeOS, Windows, and OS/2. An +example of the directory structure is the file I/O directory:

    + +
    +apr
    +  |
    +   ->  file_io
    +          |
    +           -> unix            The Unix and common base code
    +          |
    +           -> win32           The Windows code
    +          | 
    +           -> os2             The OS/2 code
    +
    + +

    Obviously, BeOS does not have a directory. This is because BeOS is currently +using the Unix directory for it's file_io.

    + +

    There are a few special top level directories. These are test and include. +Test is a directory which stores all test programs. It is expected +that if a new type is developed, there will also be a new test program, to +help people port this new type to different platforms. A small document +describing how to create new tests that integrate with the test suite can be +found in the test/ directory. Include is a directory which stores all +required APR header files for external use.

    + +

    Creating an APR Type

    + +

    The current design of APR requires that most APR types be incomplete. +It is not possible to write flexible portable code if programs can access +the internals of APR types. This is because different platforms are +likely to define different native types. There are only two execptions to +this rule:

    + +
      +
    • The first exception to this rule is if the type can only reasonably be +implemented one way. For example, time is a complete type because there +is only one reasonable time implementation. + +
    • The second exception to the incomplete type rule can be found in +apr_portable.h. This file defines the native types for each platform. +Using these types, it is possible to extract native types for any APR type.

      +
    + +

    For this reason, each platform defines a structure in their own directories. +Those structures are then typedef'ed in an external header file. For example +in file_io/unix/fileio.h:

    + +
    +    struct ap_file_t {
    +        apr_pool_t *cntxt;
    +        int filedes;
    +        FILE *filehand;
    +        ...
    +    }
    +
    + +

    In include/apr_file_io.h:

    + + typedef struct ap_file_t ap_file_t; + + +

    This will cause a compiler error if somebody tries to access the filedes +field in this structure. Windows does not have a filedes field, so obviously, +it is important that programs not be able to access these.

    + +

    You may notice the apr_pool_t field. Most APR types have this field. This +type is used to allocate memory within APR. Because every APR type has a pool, +any APR function can allocate memory if it needs to. This is very important +and it is one of the reasons that APR works. If you create a new type, you +must add a pool to it. If you do not, then all functions that operate on that +type will need a pool argument.

    + +

    New Function

    + +

    When creating a new function, please try to adhere to these rules.

    + +
      +
    • Result arguments should be the first arguments. +
    • If a function needs a pool, it should be the last argument. +
    • These rules are flexible, especially if it makes the code easier + to understand because it mimics a standard function. +
    + +

    Documentation

    + +

    Whenever a new function is added to APR, it MUST be documented. New +functions will not be committed unless there are docs to go along with them. +The documentation should be a comment block above the function in the header +file.

    + +

    The format for the comment block is:

    + +
    +    /**
    +     * Brief description of the function
    +     * @param parma_1_name explanation
    +     * @param parma_2_name explanation
    +     * @param parma_n_name explanation
    +     * @tip Any extra information people should know.
    +     * @deffunc function prototype if required
    +     */ 
    +
    + +

    For an actual example, look at any file in the include directory. The +reason the docs are in the header files is to ensure that the docs always +reflect the current code. If you change paramters or return values for a +function, please be sure to update the documentation.

    + +

    APR Error reporting

    + +

    Most APR functions should return an ap_status_t type. The only time an +APR function does not return an ap_status_t is if it absolutely CAN NOT +fail. Examples of this would be filling out an array when you know you are +not beyond the array's range. If it cannot fail on your platform, but it +could conceivably fail on another platform, it should return an ap_status_t. +Unless you are sure, return an ap_status_t.

    + + + This includes functions that return TRUE/FALSE values. How that + is handled is discussed below + + +

    All platforms return errno values unchanged. Each platform can also have +one system error type, which can be returned after an offset is added. +There are five types of error values in APR, each with it's own offset.

    + + +
    +    Name			Purpose
    +0) 			This is 0 for all platforms and isn't really defined
    + 			anywhere, but it is the offset for errno values.
    +			(This has no name because it isn't actually defined, 
    +                        but for completeness we are discussing it here).
    +
    +1) APR_OS_START_ERROR	This is platform dependent, and is the offset at which
    +			APR errors start to be defined.  Error values are 
    +			defined as anything which caused the APR function to 
    +			fail.  APR errors in this range should be named 
    +			APR_E* (i.e. APR_ENOSOCKET)
    +
    +2) APR_OS_START_STATUS	This is platform dependent, and is the offset at which
    +			APR status values start.  Status values do not indicate
    +			success or failure, and should be returned if 
    +			APR_SUCCESS does not make sense.  APR status codes in 
    +			this range should be name APR_* (i.e. APR_DETACH)
    +
    +4) APR_OS_START_USEERR	This is platform dependent, and is the offset at which
    +			APR apps can begin to add their own error codes.
    +
    +3) APR_OS_START_SYSERR	This is platform dependent, and is the offset at which
    +			system error values begin.
    +
    + +The difference in naming between APR_OS_START_ERROR and +APR_OS_START_STATUS mentioned above allows programmers to easily determine if +the error code indicates an error condition or a status codition. + +

    If your function has multiple return codes that all indicate success, but +with different results, or if your function can only return PASS/FAIL, you +should still return an apr_status_t. In the first case, define one +APR status code for each return value, an example of this is +apr_proc_wait, which can only return APR_CHILDDONE, +APR_CHILDNOTDONE, or an error code. In the second case, please return +APR_SUCCESS for PASS, and define a new APR status code for failure, an +example of this is apr_compare_users, which can only return +APR_SUCCESS, APR_EMISMATCH, or an error code.

    + +

    All of these definitions can be found in apr_errno.h for all platforms. When +an error occurs in an APR function, the function must return an error code. +If the error occurred in a system call and that system call uses errno to +report an error, then the code is returned unchanged. For example:

    + +
    +    if (open(fname, oflags, 0777) < 0)
    +        return errno;
    +
    + +

    The next place an error can occur is a system call that uses some error value +other than the primary error value on a platform. This can also be handled +by APR applications. For example:

    + +
    +    if (CreateFile(fname, oflags, sharemod, NULL, 
    +                   createflags, attributes, 0) == INVALID_HANDLE_VALUE
    +        return (GetLAstError() + APR_OS_START_SYSERR);
    +
    + +

    These two examples implement the same function for two different platforms. +Obviously even if the underlying problem is the same on both platforms, this +will result in two different error codes being returned. This is OKAY, and +is correct for APR. APR relies on the fact that most of the time an error +occurs, the program logs the error and continues, it does not try to +programatically solve the problem. This does not mean we have not provided +support for programmatically solving the problem, it just isn't the default +case. We'll get to how this problem is solved in a little while.

    + +

    If the error occurs in an APR function but it is not due to a system call, +but it is actually an APR error or just a status code from APR, then the +appropriate code should be returned. These codes are defined in apr_errno.h +and should be self explanatory.

    + +

    No APR code should ever return a code between APR_OS_START_USEERR and +APR_OS_START_SYSERR, those codes are reserved for APR applications.

    + +

    To programmatically correct an error in a running application, the error +codes need to be consistent across platforms. This should make sense. APR +has provided macros to test for status code equivalency. For example, to +determine if the code that you received from the APR function means EOF, you +would use the macro APR_STATUS_IS_EOF().

    + +

    Why did APR take this approach? There are two ways to deal with error +codes portably.

    + +
      +
    1. Return the same error code across all platforms. +
    2. Return platform specific error codes and convert them when necessary. +
    + +

    The problem with option number one is that it takes time to convert error +codes to a common code, and most of the time programs want to just output +an error string. If we convert all errors to a common subset, we have four +steps to output an error string:

    + +

    The seocnd problem with option 1, is that it is a lossy conversion. For +example, Windows and OS/2 have a couple hundred error codes, but POSIX errno +only defines about 50 errno values. This means that if we convert to a +canonical error value immediately, there is no way for the programmer to +get the actual system error.

    + +
    +    make syscall that fails
    +        convert to common error code                 step 1
    +        return common error code
    +            check for success
    +            call error output function               step 2
    +                convert back to system error         step 3
    +                output error string                  step 4
    +
    + +

    By keeping the errors platform specific, we can output error strings in two +steps.

    + +
    +    make syscall that fails
    +        return error code
    +            check for success
    +            call error output function               step 1
    +                output error string                  step 2
    +
    + +

    Less often, programs change their execution based on what error was returned. +This is no more expensive using option 2 than it is using option 1, but we +put the onus of converting the error code on the programmer themselves. +For example, using option 1:

    + +
    +    make syscall that fails
    +        convert to common error code
    +        return common error code
    +            decide execution based on common error code
    +
    + +

    Using option 2:

    + +
    +    make syscall that fails
    +        return error code
    +            convert to common error code (using ap_canonical_error)
    +            decide execution based on common error code
    +
    + +

    Finally, there is one more operation on error codes. You can get a string +that explains in human readable form what has happened. To do this using +APR, call ap_strerror().

    + From de17ef660d62f22f9f349af8af8ceb09d7e452c6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 8 Nov 2002 05:36:57 +0000 Subject: [PATCH 3987/7878] This test was bogus, I copied and pasted, and I forgot to remove the check of the string. So, remove that test and add a valid one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64006 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/testtime.c b/test/testtime.c index dba25ebc8a4..9ee67eecfb9 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -254,15 +254,23 @@ static void test_exp_tz(CuTest *tc) { apr_status_t rv; apr_time_exp_t xt; - char str[STR_SIZE]; apr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */ + apr_time_exp_t expnow = { 186711, 36, 5, 14, 14, 8, 102, 6, 256, 0, -18000 }; rv = apr_time_exp_tz(&xt, now, hr_off); if (rv == APR_ENOTIMPL) { CuNotImpl(tc, "apr_time_exp_tz"); } CuAssertTrue(tc, rv == APR_SUCCESS); - CuAssertStrEquals(tc, "19:05:36", str); + CuAssertTrue(tc, (xt.tm_usec == 186711) && + (xt.tm_sec == 36) && + (xt.tm_min == 5) && + (xt.tm_hour == 14) && + (xt.tm_mday == 14) && + (xt.tm_mon == 8) && + (xt.tm_year == 102) && + (xt.tm_wday == 6) && + (xt.tm_yday == 256)); } static void test_strftimeoffset(CuTest *tc) @@ -279,7 +287,6 @@ static void test_strftimeoffset(CuTest *tc) CuNotImpl(tc, "apr_strftime"); } CuAssertTrue(tc, rv == APR_SUCCESS); - CuAssertStrEquals(tc, "14:05:36", str); } CuSuite *testtime(void) From 6c77360d1d4ceab9ab06ab381d379de2cfbbe9d4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 10 Nov 2002 02:08:16 +0000 Subject: [PATCH 3988/7878] Remove all directory tests from testfile. We have testdir.c for testing directories. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64007 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 57 ------------------------------------------------- 1 file changed, 57 deletions(-) diff --git a/test/testfile.c b/test/testfile.c index 5b2285630e1..0cb46fc282d 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -87,7 +87,6 @@ struct view_fileinfo }; void test_filedel(apr_pool_t *); -void testdirs(apr_pool_t *); static void test_read(apr_pool_t *); static void test_read_seek(apr_int32_t, apr_pool_t *); static void test_mod_neg(apr_pool_t *, apr_int32_t); @@ -239,7 +238,6 @@ int main(void) APR_UREAD | APR_UWRITE | APR_GREAD, pool), APR_SUCCESS, "OK", "Failed") - testdirs(pool); test_filedel(pool); test_read(pool); test_mod_neg(pool, 0); /* unbuffered */ @@ -269,61 +267,6 @@ void test_filedel(apr_pool_t *pool) "OK", "Failed") } -void testdirs(apr_pool_t *pool) -{ - apr_dir_t *temp; - apr_file_t *file = NULL; - apr_size_t bytes; - apr_finfo_t dirent; - - fprintf(stdout, "Testing Directory functions.\n"); - - STD_TEST_NEQ(" Making directory", - apr_dir_make("tmpdir", - APR_UREAD | APR_UWRITE | APR_UEXECUTE | - APR_GREAD | APR_GWRITE | APR_GEXECUTE | - APR_WREAD | APR_WWRITE | APR_WEXECUTE, pool)) - - STD_TEST_NEQ(" Creating a file in the new directory", - apr_file_open(&file, "tmpdir/testfile", - APR_READ | APR_WRITE | APR_CREATE, - APR_UREAD | APR_UWRITE | APR_UEXECUTE, pool)) - - bytes = strlen("Another test!!!"); - apr_file_write(file, "Another test!!", &bytes); - apr_file_close(file); - - STD_TEST_NEQ(" Opening directory", apr_dir_open(&temp, "tmpdir", pool)) - STD_TEST_NEQ(" Reading directory", - apr_dir_read(&dirent, APR_FINFO_DIRENT, temp)) - - printf(" Getting Information about the file...\n"); - do { - /* Because I want the file I created, I am skipping the "." and ".." - * files that are here. - */ - if (apr_dir_read(&dirent, APR_FINFO_DIRENT | APR_FINFO_TYPE - | APR_FINFO_SIZE | APR_FINFO_MTIME, temp) - != APR_SUCCESS) { - fprintf(stderr, "Error reading directory tmpdir"); - exit(-1); - } - } while (dirent.name[0] == '.'); - TEST_NEQ(" File name", - strcmp(dirent.name, "testfile"), 0, - "OK", "Got wrong file name"); - TEST_NEQ(" File type", dirent.filetype, APR_REG, - "OK", "Got wrong file type") - TEST_NEQ(" File size", dirent.size, bytes, - "OK", "Got wrong file size") - printf(" Done checking file information\n"); - STD_TEST_NEQ(" Rewind directory", apr_dir_rewind(temp)) - STD_TEST_NEQ(" Closing directory", apr_dir_close(temp)) - STD_TEST_NEQ(" Removing file from directory", - apr_file_remove("tmpdir/testfile", pool)) - STD_TEST_NEQ(" Removing directory", apr_dir_remove("tmpdir", pool)) -} - #define TESTREAD_BLKSIZE 1024 #define APR_BUFFERSIZE 4096 /* This should match APR's buffer size. */ From 6375000f1ec02bb9a4fa7153ddec96eda61c9de6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 10 Nov 2002 02:44:50 +0000 Subject: [PATCH 3989/7878] Migrate testfile to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64008 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testfile.c | 746 ++++++++++++++++++----------------------------- 4 files changed, 295 insertions(+), 457 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 954f29111f3..5a497d99e7a 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -165,8 +165,8 @@ testrand@EXEEXT@: testrand.lo $(LOCAL_LIBS) testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) $(LINK) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) -testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo CuTest.lo $(LOCAL_LIBS) - $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) +testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo CuTest.lo $(LOCAL_LIBS) + $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index 381d45763a4..0257d557fde 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -76,6 +76,7 @@ CuSuite *testtable(void); CuSuite *testsleep(void); CuSuite *testpool(void); CuSuite *testfmt(void); +CuSuite *testfile(void); diff --git a/test/testall.c b/test/testall.c index 0821ce3112d..98f5ca7e645 100644 --- a/test/testall.c +++ b/test/testall.c @@ -74,6 +74,7 @@ testfunc *tests[NUM_TESTS] = { testsleep, testpool, testfmt, + testfile, NULL }; diff --git a/test/testfile.c b/test/testfile.c index 0cb46fc282d..f06f2092296 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -52,10 +52,6 @@ * . */ -#include -#include -#include -#include #include "apr_file_io.h" #include "apr_file_info.h" #include "apr_network_io.h" @@ -65,496 +61,302 @@ #include "apr_lib.h" #include "test_apr.h" -struct view_fileinfo +#define FILENAME "data/file_datafile.txt" +#define TESTSTR "This is the file data file." + +#define TESTREAD_BLKSIZE 1024 +#define APR_BUFFERSIZE 4096 /* This should match APR's buffer size. */ + + +static apr_file_t *filetest = NULL; + +static void test_open_noreadwrite(CuTest *tc) { - apr_int32_t bits; - char *description; -} vfi[] = { - {APR_FINFO_MTIME, "MTIME"}, - {APR_FINFO_CTIME, "CTIME"}, - {APR_FINFO_ATIME, "ATIME"}, - {APR_FINFO_SIZE, "SIZE"}, - {APR_FINFO_DEV, "DEV"}, - {APR_FINFO_INODE, "INODE"}, - {APR_FINFO_NLINK, "NLINK"}, - {APR_FINFO_TYPE, "TYPE"}, - {APR_FINFO_USER, "USER"}, - {APR_FINFO_GROUP, "GROUP"}, - {APR_FINFO_UPROT, "UPROT"}, - {APR_FINFO_GPROT, "GPROT"}, - {APR_FINFO_WPROT, "WPROT"}, - {0, NULL} -}; - -void test_filedel(apr_pool_t *); -static void test_read(apr_pool_t *); -static void test_read_seek(apr_int32_t, apr_pool_t *); -static void test_mod_neg(apr_pool_t *, apr_int32_t); - -int main(void) + apr_status_t rv; + apr_file_t *thefile = NULL; + + rv = apr_file_open(&thefile, FILENAME, + APR_CREATE | APR_EXCL, + APR_UREAD | APR_UWRITE | APR_GREAD, p); + CuAssertTrue(tc, rv != APR_SUCCESS); + CuAssertIntEquals(tc, APR_EACCES, rv); +#if 0 + /* I consider this a bug, if we are going to return an error, we shouldn't + * allocate the file pointer. But, this would make us fail the text, so + * I am commenting it out for now. + */ + CuAssertPtrEquals(tc, NULL, thefile); +#endif +} + +static void test_open_excl(CuTest *tc) { - apr_pool_t *pool; + apr_status_t rv; apr_file_t *thefile = NULL; - apr_finfo_t finfo; - apr_socket_t *testsock = NULL; - apr_pollfd_t *sdset = NULL; - apr_status_t status; - apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; - apr_size_t nbytes = 0; - apr_off_t zer = 0; - char *buf; - const char *str; - char *filename = "test.fil"; - char *teststr; - apr_uid_t uid; - apr_gid_t gid; -#if APR_FILES_AS_SOCKETS - apr_int32_t num; + + rv = apr_file_open(&thefile, FILENAME, + APR_CREATE | APR_EXCL | APR_WRITE, + APR_UREAD | APR_UWRITE | APR_GREAD, p); + CuAssertTrue(tc, rv != APR_SUCCESS); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_EEXIST(rv)); +#if 0 + /* I consider this a bug, if we are going to return an error, we shouldn't + * allocate the file pointer. But, this would make us fail the text, so + * I am commenting it out for now. + */ + CuAssertPtrEquals(tc, NULL, thefile); #endif +} - printf("APR File Functions Test\n=======================\n\n"); - - STD_TEST_NEQ("Initializing APR", apr_initialize()) - atexit(apr_terminate); - STD_TEST_NEQ("Creating the main pool we'll use", - apr_pool_create(&pool, NULL)) - STD_TEST_NEQ("Creating the second pool we'll use", - apr_pool_create(&pool, NULL)) - +static void test_open_read(CuTest *tc) +{ + apr_status_t rv; - fprintf(stdout, "Testing file functions.\n"); + rv = apr_file_open(&filetest, FILENAME, + APR_READ, + APR_UREAD | APR_UWRITE | APR_GREAD, p); + CuAssertIntEquals(tc, rv, APR_SUCCESS); + CuAssertPtrNotNull(tc, filetest); +} - STD_TEST_NEQ(" Opening file", - apr_file_open(&thefile, filename, flag, - APR_UREAD | APR_UWRITE | APR_GREAD, pool)) - - printf("%-60s", " Checking filename"); - if (thefile == NULL){ - MSG_AND_EXIT("\nBad file descriptor") - } - apr_file_name_get(&str, thefile); - printf("%s\n", str); - if (strcmp(str, filename) != 0){ - MSG_AND_EXIT("Wrong filename\n") - } +static void test_read(CuTest *tc) +{ + apr_status_t rv; + apr_size_t nbytes = 256; + char *str = apr_palloc(p, nbytes + 1); - nbytes = strlen("this is a test"); - STD_TEST_NEQ(" Writing to the file", - apr_file_write(thefile, "this is a test", &nbytes)) - TEST_NEQ(" Checking we wrote everything", nbytes, - strlen("this is a test"), "OK", "Failed to write everything") - - zer = 0; - STD_TEST_NEQ(" Moving to the start of file", - apr_file_seek(thefile, SEEK_SET, &zer)) - -#if APR_FILES_AS_SOCKETS - printf(" This platform supports files_like_sockets, testing...\n"); - STD_TEST_NEQ(" Making file look like a socket", - apr_socket_from_file(&testsock, thefile)) - - apr_poll_setup(&sdset, 1, pool); - apr_poll_socket_add(sdset, testsock, APR_POLLIN); - num = 1; - STD_TEST_NEQ_NONFATAL(" Checking for incoming data", - apr_poll(sdset, 1, &num, apr_time_from_sec(1))); - if (num == 0) { - printf("** This platform doesn't return readability on a regular file.**\n"); - } - printf(" End of files as sockets test.\n"); -#endif + rv = apr_file_read(filetest, str, &nbytes); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, strlen(TESTSTR), nbytes); + CuAssertStrEquals(tc, TESTSTR, str); +} - nbytes = strlen("this is a test"); - buf = (char *)apr_palloc(pool, nbytes + 1); - STD_TEST_NEQ(" Reading from the file", - apr_file_read(thefile, buf, &nbytes)) - TEST_NEQ(" Checking what we read", nbytes, strlen("this is a test"), - "OK", "We didn't read properly.\n") - STD_TEST_NEQ(" Adding user data to the file", - apr_file_data_set(thefile, "This is a test", - "test", apr_pool_cleanup_null)) - STD_TEST_NEQ(" Getting user data from the file", - apr_file_data_get((void **)&teststr, "test", thefile)) - TEST_NEQ(" Checking the data we got", strcmp(teststr, "This is a test"), 0, - "OK", "Got the data, but it was wrong") - - printf("%-60s", " Getting fileinfo"); - status = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); - if (status == APR_INCOMPLETE) { - int i; - printf("INCOMPLETE\n"); - for (i = 0; vfi[i].bits; ++i) - if (vfi[i].bits & ~finfo.valid) - fprintf(stderr, "\t Missing %s\n", vfi[i].description); - } - else if (status != APR_SUCCESS) { - printf("OK\n"); - MSG_AND_EXIT("Couldn't get the fileinfo") - } - else { - printf("OK\n"); - } - gid = finfo.group; - uid = finfo.user; - - STD_TEST_NEQ(" Closing the file", apr_file_close(thefile)) - - printf("%-60s", " Stat'ing file"); - status = apr_stat(&finfo, filename, APR_FINFO_NORM, pool); - if (status == APR_INCOMPLETE) { - int i; - printf("INCOMPLETE\n"); - for (i = 0; vfi[i].bits; ++i) - if (vfi[i].bits & ~finfo.valid) - fprintf(stderr, "\t Missing %s\n", vfi[i].description); - } - else if (status != APR_SUCCESS) { - printf("Failed\n"); - MSG_AND_EXIT("Couldn't stat the file") - } - else { - printf("OK\n"); - } - - if (finfo.valid & APR_FINFO_GROUP) { - STD_TEST_NEQ(" Getting groupname", - apr_group_name_get(&buf, finfo.group, pool)) - STD_TEST_NEQ(" Comparing group ID's", - apr_compare_groups(finfo.group, gid)) - printf(" (gid's for %s match)\n", buf); - } +static void test_filename(CuTest *tc) +{ + const char *str; + apr_status_t rv; - if (finfo.valid & APR_FINFO_USER) { - STD_TEST_NEQ(" Getting username", - apr_get_username(&buf, finfo.user, pool)) - STD_TEST_NEQ(" Comparing users", - apr_compare_users(finfo.user, uid)) - printf(" (uid's for %s match)\n", buf); - } + rv = apr_file_name_get(&str, filetest); + CuAssertIntEquals(tc, rv, APR_SUCCESS); + CuAssertStrEquals(tc, FILENAME, str); +} + +static void test_fileclose(CuTest *tc) +{ + char *str; + apr_status_t rv; + apr_size_t one = 1; - STD_TEST_NEQ(" Deleting the file", apr_file_remove(filename, pool)) - TEST_EQ(" Making sure it's gone", - apr_file_open(&thefile, filename, APR_READ, - APR_UREAD | APR_UWRITE | APR_GREAD, pool), - APR_SUCCESS, "OK", "Failed") + rv = apr_file_close(filetest); + CuAssertIntEquals(tc, rv, APR_SUCCESS); + /* We just closed the file, so this should fail */ + rv = apr_file_read(filetest, str, &one); + CuAssertIntEquals(tc, APR_EBADF, rv); +} - test_filedel(pool); - test_read(pool); - test_mod_neg(pool, 0); /* unbuffered */ - test_mod_neg(pool, APR_BUFFERED); +static void test_file_remove(CuTest *tc) +{ + apr_status_t rv; - apr_pool_destroy(pool); + rv = apr_file_remove(FILENAME, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - printf("\nAll tests passed OK\n"); - return 0; + rv = apr_file_open(&filetest, FILENAME, APR_READ, + APR_UREAD | APR_UWRITE | APR_GREAD, p); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); } -void test_filedel(apr_pool_t *pool) +static void test_open_write(CuTest *tc) { - apr_file_t *thefile = NULL; - apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; - - STD_TEST_NEQ(" Creating the file", - apr_file_open(&thefile, "testdel", flag, - APR_UREAD | APR_UWRITE | APR_GREAD, pool)) - STD_TEST_NEQ(" Closing the file", - apr_file_close(thefile)) - STD_TEST_NEQ(" Removing the file", apr_file_remove("testdel", pool)) - TEST_EQ(" Checking it's gone", - apr_file_open(&thefile, "testdel", APR_READ, - APR_UREAD | APR_UWRITE | APR_GREAD, pool), - APR_SUCCESS, - "OK", "Failed") + apr_status_t rv; + + filetest = NULL; + rv = apr_file_open(&filetest, FILENAME, + APR_WRITE, + APR_UREAD | APR_UWRITE | APR_GREAD, p); + CuAssertIntEquals(tc, APR_ENOENT, rv); } -#define TESTREAD_BLKSIZE 1024 -#define APR_BUFFERSIZE 4096 /* This should match APR's buffer size. */ +static void test_open_writecreate(CuTest *tc) +{ + apr_status_t rv; -static void create_testread(apr_pool_t *p, const char *fname) + filetest = NULL; + rv = apr_file_open(&filetest, FILENAME, + APR_WRITE | APR_CREATE, + APR_UREAD | APR_UWRITE | APR_GREAD, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); +} + +static void test_write(CuTest *tc) { - apr_file_t *f = NULL; apr_status_t rv; - char buf[TESTREAD_BLKSIZE]; - apr_size_t nbytes; + apr_size_t bytes = strlen(TESTSTR); - /* Create a test file with known content. - */ - - rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); - if (rv) { - fprintf(stderr, "apr_file_open()->%d/%s\n", - rv, apr_strerror(rv, buf, sizeof buf)); - exit(1); - } - nbytes = 4; - rv = apr_file_write(f, "abc\n", &nbytes); - assert(!rv && nbytes == 4); - memset(buf, 'a', sizeof buf); - nbytes = sizeof buf; - rv = apr_file_write(f, buf, &nbytes); - assert(!rv && nbytes == sizeof buf); - nbytes = 2; - rv = apr_file_write(f, "\n\n", &nbytes); - assert(!rv && nbytes == 2); - rv = apr_file_close(f); - assert(!rv); + rv = apr_file_write(filetest, TESTSTR, &bytes); + CuAssertIntEquals(tc, APR_SUCCESS, rv); } -static char read_one(apr_file_t *f, int expected) +static void test_open_readwrite(CuTest *tc) { - char bytes[3]; - apr_status_t rv; - static int counter = 0; - apr_size_t nbytes; - - counter += 1; - - bytes[0] = bytes[2] = 0x01; - if (counter % 2) { - rv = apr_file_getc(bytes + 1, f); - } - else { - nbytes = 1; - rv = apr_file_read(f, bytes + 1, &nbytes); - assert(nbytes == 1); - } - assert(!rv); - assert(bytes[0] == 0x01 && bytes[2] == 0x01); - if (expected != -1) { - assert(bytes[1] == expected); - } - return bytes[1]; + apr_status_t rv; + + apr_file_close(filetest); + filetest = NULL; + rv = apr_file_open(&filetest, FILENAME, + APR_READ | APR_WRITE, + APR_UREAD | APR_UWRITE | APR_GREAD, p); + CuAssertIntEquals(tc, rv, APR_SUCCESS); + CuAssertPtrNotNull(tc, filetest); } -static int test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_flags) +static void test_seek(CuTest *tc) { - apr_file_t *f = NULL; apr_status_t rv; - apr_size_t nbytes; - char buf[1024]; - int i; + apr_off_t offset = 5; + apr_size_t nbytes = 256; + char *str = apr_palloc(p, nbytes + 1); - rv = apr_file_open(&f, fname, APR_READ | extra_flags, 0, p); - assert(!rv); - read_one(f, 'a'); - read_one(f, 'b'); - rv = apr_file_ungetc('b', f); - assert(!rv); - /* Note: some implementations move the file ptr back; - * others just save up to one char; it isn't - * portable to unget more than once. - */ - /* Don't do this: rv = apr_file_ungetc('a', f); */ - read_one(f, 'b'); - read_one(f, 'c'); - read_one(f, '\n'); - for (i = 0; i < TESTREAD_BLKSIZE; i++) { - read_one(f, 'a'); - } - read_one(f, '\n'); - read_one(f, '\n'); - rv = apr_file_getc(buf, f); - assert(rv == APR_EOF); - rv = apr_file_close(f); - assert(!rv); + rv = apr_file_seek(filetest, SEEK_SET, &offset); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_file_read(filetest, str, &nbytes); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, strlen(TESTSTR) - 5, nbytes); + CuAssertStrEquals(tc, TESTSTR + 5, str); +} - f = NULL; - rv = apr_file_open(&f, fname, APR_READ | extra_flags, 0, p); - assert(!rv); - rv = apr_file_gets(buf, 10, f); - assert(!rv); - assert(!strcmp(buf, "abc\n")); - /* read first 800 of TESTREAD_BLKSIZE 'a's - */ - rv = apr_file_gets(buf, 801, f); - assert(!rv); - assert(strlen(buf) == 800); - for (i = 0; i < 800; i++) { - assert(buf[i] == 'a'); - } - /* read rest of the 'a's and the first newline - */ - rv = apr_file_gets(buf, sizeof buf, f); - assert(!rv); - assert(strlen(buf) == TESTREAD_BLKSIZE - 800 + 1); - for (i = 0; i < TESTREAD_BLKSIZE - 800; i++) { - assert(buf[i] == 'a'); - } - assert(buf[TESTREAD_BLKSIZE - 800] == '\n'); - /* read the last newline - */ - rv = apr_file_gets(buf, sizeof buf, f); - assert(!rv); - assert(!strcmp(buf, "\n")); - /* get APR_EOF - */ - rv = apr_file_gets(buf, sizeof buf, f); - assert(rv == APR_EOF); - /* get APR_EOF with apr_file_getc - */ - rv = apr_file_getc(buf, f); - assert(rv == APR_EOF); - /* get APR_EOF with apr_file_read - */ - nbytes = sizeof buf; - rv = apr_file_read(f, buf, &nbytes); - assert(rv == APR_EOF); - rv = apr_file_close(f); - assert(!rv); - return (1); -} -static void test_bigread(apr_pool_t *p, const char *fname, apr_int32_t extra_flags) +static void test_userdata_set(CuTest *tc) { - apr_file_t *f = NULL; apr_status_t rv; - char buf[APR_BUFFERSIZE * 2]; - apr_size_t nbytes; - /* Create a test file with known content. - */ - rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); - if (rv) { - fprintf(stderr, "apr_file_open()->%d/%s\n", - rv, apr_strerror(rv, buf, sizeof buf)); - exit(1); - } - nbytes = APR_BUFFERSIZE; - memset(buf, 0xFE, nbytes); - rv = apr_file_write(f, buf, &nbytes); - assert(!rv && nbytes == APR_BUFFERSIZE); - rv = apr_file_close(f); - assert(!rv); + rv = apr_file_data_set(filetest, "This is a test", + "test", apr_pool_cleanup_null); + CuAssertIntEquals(tc, APR_SUCCESS, rv); +} - f = NULL; - rv = apr_file_open(&f, fname, APR_READ | extra_flags, 0, p); - assert(!rv); - nbytes = sizeof buf; - rv = apr_file_read(f, buf, &nbytes); - assert(!rv); - assert(nbytes == APR_BUFFERSIZE); - rv = apr_file_close(f); - assert(!rv); +static void test_userdata_get(CuTest *tc) +{ + apr_status_t rv; + char *teststr; + + rv = apr_file_data_get((void **)&teststr, "test", filetest); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, "This is a test", teststr); } -static void test_read(apr_pool_t *p) +static void test_userdata_getnokey(CuTest *tc) { - const char *fname = "testread.dat"; apr_status_t rv; + char *teststr; - printf("Testing file read functions.\n"); - - create_testread(p, fname); - printf("%-60s", " Buffered file tests"); - if (test_read_guts(p, fname, APR_BUFFERED)) - printf("OK\n"); - printf("%-60s", " Unbuffered file tests"); - test_read_guts(p, fname, 0); - printf("OK\n"); - printf("%-60s", " More buffered file tests"); - test_bigread(p, fname, APR_BUFFERED); - printf("OK\n"); - printf("%-60s", " More unbuffered file tests"); - test_bigread(p, fname, 0); - printf("OK\n"); - printf("%-60s", " Even more buffered file tests"); - test_read_seek(APR_BUFFERED, p); - printf("OK\n"); - printf("%-60s", " Even more unbuffered file tests"); - test_read_seek(0, p); - printf("OK\n"); - rv = apr_file_remove(fname, p); - assert(!rv); - printf("%-60s", " All read tests"); - printf("OK\n"); + rv = apr_file_data_get((void **)&teststr, "nokey", filetest); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrEquals(tc, NULL, teststr); } -static void test_read_seek(apr_int32_t moreflags, apr_pool_t *p) +static void test_getc(CuTest *tc) { - const char *fname = "readseek.dat"; + apr_file_t *f = NULL; apr_status_t rv; - apr_file_t *f; - apr_size_t nbytes; - const char *str1, *str2, *str3; - char buf[8192]; - apr_off_t seek_amt; + char ch; - /* create the content */ + rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); - assert(!rv); + apr_file_getc(&ch, f); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, (int)TESTSTR[0], (int)ch); + apr_file_close(f); +} - str1 = "abcdefghijklmnopqrstuvwxyz\n"; - str2 = "1234567890\n"; - str3 = "1234567890-=+_)(*&^%$#@!\n"; +static void test_ungetc(CuTest *tc) +{ + apr_file_t *f = NULL; + apr_status_t rv; + char ch; - nbytes = strlen(str1); - rv = apr_file_write(f, str1, &nbytes); - assert(!rv && nbytes == strlen(str1)); + rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - nbytes = strlen(str2); - rv = apr_file_write(f, str2, &nbytes); - assert(!rv && nbytes == strlen(str2)); + apr_file_getc(&ch, f); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, (int)TESTSTR[0], (int)ch); - nbytes = strlen(str3); - rv = apr_file_write(f, str3, &nbytes); - assert(!rv && nbytes == strlen(str3)); + apr_file_ungetc('X', f); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - nbytes = strlen(str1); - rv = apr_file_write(f, str1, &nbytes); - assert(!rv && nbytes == strlen(str1)); + apr_file_getc(&ch, f); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 'X', (int)ch); - nbytes = strlen(str2); - rv = apr_file_write(f, str2, &nbytes); - assert(!rv && nbytes == strlen(str2)); + apr_file_close(f); +} - nbytes = strlen(str3); - rv = apr_file_write(f, str3, &nbytes); - assert(!rv && nbytes == strlen(str3)); +static void test_gets(CuTest *tc) +{ + apr_file_t *f = NULL; + apr_status_t rv; + char *str = apr_palloc(p, 256); - rv = apr_file_close(f); - assert(!rv); + rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - rv = apr_file_open(&f, fname, APR_READ | moreflags, 0, p); - assert(!rv); + rv = apr_file_gets(str, 256, f); + /* Only one line in the test file, so we should get the EOF on the first + * call to gets. + */ + CuAssertIntEquals(tc, APR_EOF, rv); + CuAssertStrEquals(tc, TESTSTR, str); - rv = apr_file_gets(buf, sizeof buf, f); - assert(!rv); - assert(!strcmp(buf, str1)); + apr_file_close(f); +} - rv = apr_file_gets(buf, sizeof buf, f); - assert(!rv); - assert(!strcmp(buf, str2)); +static void test_bigread(CuTest *tc) +{ + apr_file_t *f = NULL; + apr_status_t rv; + char buf[APR_BUFFERSIZE * 2]; + apr_size_t nbytes; - nbytes = sizeof buf; - rv = apr_file_read(f, buf, &nbytes); - assert(!rv); - assert(nbytes == strlen(str3) + strlen(str1) + strlen(str2) + strlen(str3)); - assert(!memcmp(buf, str3, strlen(str3))); + /* Create a test file with known content. + */ + rv = apr_file_open(&f, "data/created_file", + APR_CREATE | APR_WRITE | APR_TRUNCATE, + APR_UREAD | APR_UWRITE, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + nbytes = APR_BUFFERSIZE; + memset(buf, 0xFE, nbytes); - /* seek back a couple of strings */ - seek_amt = -(apr_off_t)(nbytes - strlen(str3) - strlen(str1)); - rv = apr_file_seek(f, APR_CUR, &seek_amt); - assert(!rv); - /* seek_amt should be updated with the current offset into the file */ - assert(seek_amt == strlen(str1) + strlen(str2) + strlen(str3) + strlen(str1)); + rv = apr_file_write(f, buf, &nbytes); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, APR_BUFFERSIZE, nbytes); - rv = apr_file_gets(buf, sizeof buf, f); - assert(!rv); - assert(!strcmp(buf, str2)); + rv = apr_file_close(f); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + f = NULL; + rv = apr_file_open(&f, "data/created_file", APR_READ, 0, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - rv = apr_file_gets(buf, sizeof buf, f); - assert(!rv); - assert(!strcmp(buf, str3)); + nbytes = sizeof buf; + rv = apr_file_read(f, buf, &nbytes); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, APR_BUFFERSIZE, nbytes); rv = apr_file_close(f); - assert(!rv); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - rv = apr_file_remove(fname, p); - assert(!rv); + rv = apr_file_remove("data/created_file", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); } -static void test_mod_neg(apr_pool_t *p, apr_int32_t flags) +/* This is a horrible name for this function. We are testing APR, not how + * Apache uses APR. And, this function tests _way_ too much stuff. + */ +static void test_mod_neg(CuTest *tc) { apr_status_t rv; apr_file_t *f; @@ -563,74 +365,108 @@ static void test_mod_neg(apr_pool_t *p, apr_int32_t flags) apr_size_t nbytes; char buf[8192]; apr_off_t cur; - const char *fname = "modneg.dat"; + const char *fname = "data/modneg.dat"; - printf(" Testing mod_negotiation-style file access (%sbuffered)...\n", - !flags ? "un" : ""); - - rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); - assert(!rv); + rv = apr_file_open(&f, fname, + APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); s = "body56789\n"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); - assert(!rv); - assert(nbytes == strlen(s)); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, strlen(s), nbytes); for (i = 0; i < 7980; i++) { s = "0"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); - assert(!rv); - assert(nbytes == strlen(s)); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, strlen(s), nbytes); } s = "end456789\n"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); - assert(!rv); - assert(nbytes == strlen(s)); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, strlen(s), nbytes); for (i = 0; i < 10000; i++) { s = "1"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); - assert(!rv); - assert(nbytes == strlen(s)); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, strlen(s), nbytes); } rv = apr_file_close(f); - assert(!rv); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - rv = apr_file_open(&f, fname, APR_READ | flags, 0, p); - assert(!rv); + rv = apr_file_open(&f, fname, APR_READ, 0, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = apr_file_gets(buf, 11, f); - assert(!rv); - assert(!strcmp(buf, "body56789\n")); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, "body56789\n", buf); cur = 0; rv = apr_file_seek(f, APR_CUR, &cur); - assert(!rv); - assert(cur == 10); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 10, cur); nbytes = sizeof(buf); rv = apr_file_read(f, buf, &nbytes); - assert(!rv); - assert(nbytes == sizeof(buf)); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, nbytes, sizeof(buf)); cur = -((apr_off_t)nbytes - 7980); rv = apr_file_seek(f, APR_CUR, &cur); - assert(!rv); - assert(cur == 7990); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 7990, cur); rv = apr_file_gets(buf, 11, f); - assert(!rv); - assert(!strcmp(buf, "end456789\n")); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, "end456789\n", buf); rv = apr_file_close(f); - assert(!rv); + CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = apr_file_remove(fname, p); - assert(!rv); + CuAssertIntEquals(tc, APR_SUCCESS, rv); } + +CuSuite *testfile(void) +{ + CuSuite *suite = CuSuiteNew("Test File I/O"); + + SUITE_ADD_TEST(suite, test_open_noreadwrite); + SUITE_ADD_TEST(suite, test_open_excl); + SUITE_ADD_TEST(suite, test_open_read); + SUITE_ADD_TEST(suite, test_read); + SUITE_ADD_TEST(suite, test_seek); + SUITE_ADD_TEST(suite, test_filename); + SUITE_ADD_TEST(suite, test_fileclose); + SUITE_ADD_TEST(suite, test_file_remove); + SUITE_ADD_TEST(suite, test_open_write); + SUITE_ADD_TEST(suite, test_open_writecreate); + SUITE_ADD_TEST(suite, test_write); + SUITE_ADD_TEST(suite, test_userdata_set); + SUITE_ADD_TEST(suite, test_userdata_get); + SUITE_ADD_TEST(suite, test_userdata_getnokey); + SUITE_ADD_TEST(suite, test_getc); + SUITE_ADD_TEST(suite, test_ungetc); + SUITE_ADD_TEST(suite, test_gets); + SUITE_ADD_TEST(suite, test_bigread); + SUITE_ADD_TEST(suite, test_mod_neg); + + return suite; +} + +#ifdef SINGLE_PROG +CuSuite *getsuite(void) +{ + return testfile(); +} +#endif + + From 9375d33ce3d0816cbd4dc1e8608aabe18fdfc446 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 10 Nov 2002 08:35:16 +0000 Subject: [PATCH 3990/7878] Go through doxygen output and remove as many errors and warnings as I could. No code changes. (Note removal of #define duplication in apr_poll.h/apr_network_io.h of the APR_POLL* values. This appears to have been an oversight and is now just in apr_poll.h) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64009 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ include/apr_allocator.h | 14 ++++---- include/apr_atomic.h | 18 +++++------ include/apr_errno.h | 4 +-- include/apr_file_info.h | 37 ++++++++++----------- include/apr_file_io.h | 6 +++- include/apr_general.h | 4 +++ include/apr_getopt.h | 3 ++ include/apr_global_mutex.h | 1 + include/apr_lib.h | 2 ++ include/apr_mmap.h | 15 +++++++-- include/apr_network_io.h | 64 +++++++++++++++++++++---------------- include/apr_poll.h | 57 ++++++++++++++++++--------------- include/apr_pools.h | 2 +- include/apr_portable.h | 39 ++++++++++++++-------- include/apr_proc_mutex.h | 21 +++++++++--- include/apr_shm.h | 4 +-- include/apr_signal.h | 6 ++-- include/apr_strings.h | 2 +- include/apr_support.h | 7 ++-- include/apr_tables.h | 7 ++-- include/apr_thread_cond.h | 1 + include/apr_thread_mutex.h | 7 ++-- include/apr_thread_proc.h | 15 ++++++--- include/apr_thread_rwlock.h | 1 + include/apr_time.h | 19 ++++++----- include/apr_version.h | 8 ++--- 27 files changed, 223 insertions(+), 143 deletions(-) diff --git a/CHANGES b/CHANGES index bee30d69971..ec8edb344a1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR 0.9.2 + *) Update doxygen tags. [Justin Erenkrantz] + *) NetWare: implemented a file IO path context scheme to directly reference directory paths and files in the file system rather than having to traverse the file system on every stat() or diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 2041fc43b47..07992004d5b 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -81,15 +81,17 @@ typedef struct apr_allocator_t apr_allocator_t; /** the structure which holds information about the allocation */ typedef struct apr_memnode_t apr_memnode_t; +/** basic memory node structure */ struct apr_memnode_t { - apr_memnode_t *next; - apr_memnode_t **ref; - apr_uint32_t index; - apr_uint32_t free_index; - char *first_avail; - char *endp; + apr_memnode_t *next; /**< next memnode */ + apr_memnode_t **ref; /**< reference to self */ + apr_uint32_t index; /**< size */ + apr_uint32_t free_index; /**< how much free */ + char *first_avail; /**< pointer to first free memory */ + char *endp; /**< pointer to end of free memory */ }; +/** The base size of a memory node - aligned. */ #define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t)) /** Symbolic constants */ diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 7111843054b..360b279cc92 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -85,23 +85,23 @@ extern "C" { typedef apr_atomic_t; /** - * @param pool * this function is required on some platforms to initialize the * atomic operation's internal structures - * returns APR_SUCCESS on successfull completion + * @param p pool + * @return APR_SUCCESS on successful completion */ apr_status_t apr_atomic_init(apr_pool_t *p); /** * read the value stored in a atomic variable - * @param the pointer + * @param mem the pointer * @warning on certain platforms this number is not stored * directly in the pointer. in others it is */ apr_uint32_t apr_atomic_read(volatile apr_atomic_t *mem); /** * set the value for atomic. - * @param the pointer - * @param the value + * @param mem the pointer + * @param val the value */ void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val); /** @@ -120,7 +120,7 @@ void apr_atomic_inc(volatile apr_atomic_t *mem); /** * decrement the atomic variable by 1 * @param mem pointer to the atomic value - * @returns zero if the value is zero, otherwise non-zero + * @return zero if the value is zero, otherwise non-zero */ int apr_atomic_dec(volatile apr_atomic_t *mem); @@ -129,19 +129,19 @@ int apr_atomic_dec(volatile apr_atomic_t *mem); * If they are the same swap the value with 'with' * @param mem pointer to the atomic value * @param with what to swap it with - * @param the value to compare it to + * @param cmp the value to compare it to * @return the old value of the atomic * @warning do not mix apr_atomic's with the CAS function. * on some platforms they may be implemented by different mechanisms */ -apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); +apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp); /** * compare the pointer's value with cmp. * If they are the same swap the value with 'with' * @param mem pointer to the pointer * @param with what to swap it with - * @param the value to compare it to + * @param cmp the value to compare it to * @return the old value of the pointer */ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); diff --git a/include/apr_errno.h b/include/apr_errno.h index ccbf1956691..ed3fe0540f5 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -94,7 +94,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * @def APR_FROM_OS_ERROR(os_err_type syserr) * Fold a platform specific error into an apr_status_t code. * @return apr_status_t - * @param syserr The platform os error code. + * @param e The platform os error code. * @warning macro implementation; the syserr argument may be evaluated * multiple times. */ @@ -104,7 +104,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * @def APR_TO_OS_ERROR(apr_status_t statcode) * @return os_err_type * Fold an apr_status_t code back to the native platform defined error. - * @param syserr The apr_status_t folded platform os error code. + * @param e The apr_status_t folded platform os error code. * @warning macro implementation; the statcode argument may be evaluated * multiple times. If the statcode was not created by apr_get_os_error * or APR_FROM_OS_ERROR, the results are undefined. diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 8ccb407cf39..186b9918107 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -147,6 +147,7 @@ typedef dev_t apr_dev_t; * @defgroup APR_File_Info Stat Functions * @{ */ +/** file info structure */ typedef struct apr_finfo_t apr_finfo_t; #define APR_FINFO_LINK 0x00000001 /**< Stat the link not the file itself if it is a link */ @@ -155,24 +156,24 @@ typedef struct apr_finfo_t apr_finfo_t; #define APR_FINFO_ATIME 0x00000040 /**< Access Time */ #define APR_FINFO_SIZE 0x00000100 /**< Size of the file */ #define APR_FINFO_CSIZE 0x00000200 /**< Storage size consumed by the file */ -#define APR_FINFO_DEV 0x00001000 -#define APR_FINFO_INODE 0x00002000 -#define APR_FINFO_NLINK 0x00004000 -#define APR_FINFO_TYPE 0x00008000 -#define APR_FINFO_USER 0x00010000 -#define APR_FINFO_GROUP 0x00020000 -#define APR_FINFO_UPROT 0x00100000 -#define APR_FINFO_GPROT 0x00200000 -#define APR_FINFO_WPROT 0x00400000 -#define APR_FINFO_ICASE 0x01000000 /**< if dev is case insensitive */ -#define APR_FINFO_NAME 0x02000000 /**< ->name in proper case */ - -#define APR_FINFO_MIN 0x00008170 /**< type, mtime, ctime, atime, size */ -#define APR_FINFO_IDENT 0x00003000 /**< dev and inode */ -#define APR_FINFO_OWNER 0x00030000 /**< user and group */ -#define APR_FINFO_PROT 0x00700000 /**< all protections */ -#define APR_FINFO_NORM 0x0073b170 /**< an atomic unix apr_stat() */ -#define APR_FINFO_DIRENT 0x02000000 /**< an atomic unix apr_dir_read() */ +#define APR_FINFO_DEV 0x00001000 /**< Device */ +#define APR_FINFO_INODE 0x00002000 /**< Inode */ +#define APR_FINFO_NLINK 0x00004000 /**< Number of links */ +#define APR_FINFO_TYPE 0x00008000 /**< Type */ +#define APR_FINFO_USER 0x00010000 /**< User */ +#define APR_FINFO_GROUP 0x00020000 /**< Group */ +#define APR_FINFO_UPROT 0x00100000 /**< User protection bits */ +#define APR_FINFO_GPROT 0x00200000 /**< Group protection bits */ +#define APR_FINFO_WPROT 0x00400000 /**< World protection bits */ +#define APR_FINFO_ICASE 0x01000000 /**< if dev is case insensitive */ +#define APR_FINFO_NAME 0x02000000 /**< ->name in proper case */ + +#define APR_FINFO_MIN 0x00008170 /**< type, mtime, ctime, atime, size */ +#define APR_FINFO_IDENT 0x00003000 /**< dev and inode */ +#define APR_FINFO_OWNER 0x00030000 /**< user and group */ +#define APR_FINFO_PROT 0x00700000 /**< all protections */ +#define APR_FINFO_NORM 0x0073b170 /**< an atomic unix apr_stat() */ +#define APR_FINFO_DIRENT 0x02000000 /**< an atomic unix apr_dir_read() */ /** * The file information structure. This is analogous to the POSIX diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 2074d2a60e9..2fdd73cfda0 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -113,8 +113,11 @@ extern "C" { */ /* flags for apr_file_seek */ +/** Set the file position */ #define APR_SET SEEK_SET +/** Current */ #define APR_CUR SEEK_CUR +/** Go to end of file */ #define APR_END SEEK_END /** @} */ @@ -638,7 +641,8 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, * will be reported if PATH already exists. * @param path the path for the directory to be created. (use / on all systems) * @param perm Permissions for the new direcoty. - * @param cont the pool to use. */ + * @param pool the pool to use. + */ APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, apr_fileperms_t perm, apr_pool_t *pool); diff --git a/include/apr_general.h b/include/apr_general.h index d32209d880c..c81af684c23 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -106,6 +106,7 @@ extern "C" { /** a tab */ #define APR_ASCII_TAB '\011' +/** signal numbers typedef */ typedef int apr_signum_t; /** @@ -181,6 +182,7 @@ int strncasecmp(const char *a, const char *b, size_t n); #define APR_ALIGN(size, boundary) \ (((size) + ((boundary) - 1)) & ~((boundary) - 1)) +/** Default alignment */ #define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) @@ -188,7 +190,9 @@ int strncasecmp(const char *a, const char *b, size_t n); * String and memory functions */ +/** Properly quote a value as a string in the C preprocessor */ #define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) +/** Helper macro for APR_STRINGIFY */ #define APR_STRINGIFY_HELPER(n) #n #if (!APR_HAVE_MEMMOVE) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 24e27244e17..a1ecb18088b 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -76,7 +76,9 @@ extern "C" { */ typedef void (apr_getopt_err_fn_t)(void *arg, const char *err, ...); +/** @see apr_getopt_t */ typedef struct apr_getopt_t apr_getopt_t; + /** * Structure to store command line argument information. */ @@ -107,6 +109,7 @@ struct apr_getopt_t { int skip_end; }; +/** @see apr_getopt_option_t */ typedef struct apr_getopt_option_t apr_getopt_option_t; /** diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index 4ef988a0a08..05b572a998d 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -77,6 +77,7 @@ extern "C" { #if !APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN) +/** Opaque global mutex structure. */ typedef struct apr_global_mutex_t apr_global_mutex_t; /* Function definitions */ diff --git a/include/apr_lib.h b/include/apr_lib.h index 7850891b05d..b4c67c24c75 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -78,12 +78,14 @@ extern "C" { #endif /* __cplusplus */ +/** A constant representing a 'large' string. */ #define HUGE_STRING_LEN 8192 /* * Define the structures used by the APR general-purpose library. */ +/** @see apr_vformatter_buff_t */ typedef struct apr_vformatter_buff_t apr_vformatter_buff_t; /** diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 202062e8d49..44e51be08d2 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -77,10 +77,14 @@ extern "C" { * @{ */ +/** MMap opened for reading */ #define APR_MMAP_READ 1 +/** MMap opened for writing */ #define APR_MMAP_WRITE 2 +/** @see apr_mmap_t */ typedef struct apr_mmap_t apr_mmap_t; + /** * @remark * As far as I can tell the only really sane way to store an MMAP is as a @@ -117,7 +121,8 @@ struct apr_mmap_t { #if APR_HAS_MMAP || defined(DOXYGEN) -/* Files have to be at least this big before they're mmap()d. This is to deal +/** @def APR_MMAP_THRESHOLD + * Files have to be at least this big before they're mmap()d. This is to deal * with systems where the expense of doing an mmap() and an munmap() outweighs * the benefit for small files. It shouldn't be set lower than 1. */ @@ -131,12 +136,16 @@ struct apr_mmap_t { # endif /* SUNOS4 */ #endif /* MMAP_THRESHOLD */ +/** @def APR_MMAP_LIMIT + * Maximum size of MMap region + */ #ifdef MMAP_LIMIT # define APR_MMAP_LIMIT MMAP_LIMIT #else # define APR_MMAP_LIMIT (4*1024*1024) #endif /* MMAP_LIMIT */ +/** Can this file be MMaped */ #define APR_MMAP_CANDIDATE(filelength) \ ((filelength >= APR_MMAP_THRESHOLD) && (filelength < APR_MMAP_LIMIT)) @@ -191,14 +200,14 @@ APR_DECLARE(apr_status_t) apr_mmap_setaside(apr_mmap_t **new_mmap, /** * Remove a mmap'ed. - * @param mmap The mmap'ed file. + * @param mm The mmap'ed file. */ APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm); /** * Move the pointer into the mmap'ed file to the specified offset. * @param addr The pointer to the offset specified. - * @param mmap The mmap'ed file. + * @param mm The mmap'ed file. * @param offset The offset to move to. */ APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mm, diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 6416e268571..cd05cb63a87 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -79,14 +79,17 @@ extern "C" { #endif /* __cplusplus */ #ifndef MAX_SECS_TO_LINGER +/** Maximum seconds to linger */ #define MAX_SECS_TO_LINGER 30 #endif #ifndef APRMAXHOSTLEN +/** Maximum hostname length */ #define APRMAXHOSTLEN 256 #endif #ifndef APR_ANYADDR +/** Default 'any' address */ #define APR_ANYADDR "0.0.0.0" #endif @@ -94,19 +97,19 @@ extern "C" { * @defgroup Sock_opt Socket option definitions * @{ */ -#define APR_SO_LINGER 1 -#define APR_SO_KEEPALIVE 2 -#define APR_SO_DEBUG 4 -#define APR_SO_NONBLOCK 8 -#define APR_SO_REUSEADDR 16 -#define APR_SO_TIMEOUT 32 -#define APR_SO_SNDBUF 64 -#define APR_SO_RCVBUF 128 -#define APR_SO_DISCONNECTED 256 +#define APR_SO_LINGER 1 /**< Linger */ +#define APR_SO_KEEPALIVE 2 /**< Keepalive */ +#define APR_SO_DEBUG 4 /**< Debug */ +#define APR_SO_NONBLOCK 8 /**< Non-blocking IO */ +#define APR_SO_REUSEADDR 16 /**< Reuse addresses */ +#define APR_SO_TIMEOUT 32 /**< Timeout */ +#define APR_SO_SNDBUF 64 /**< Send buffer */ +#define APR_SO_RCVBUF 128 /**< Receive buffer */ +#define APR_SO_DISCONNECTED 256 /**< Disconnected */ #define APR_TCP_NODELAY 512 /**< For SCTP sockets, this is mapped * to STCP_NODELAY internally. */ -#define APR_TCP_NOPUSH 1024 +#define APR_TCP_NOPUSH 1024 /**< No push */ #define APR_RESET_NODELAY 2048 /**< This flag is ONLY set internally * when we set APR_TCP_NOPUSH with * APR_TCP_NODELAY set to tell us that @@ -124,22 +127,21 @@ extern "C" { * read, in cases where the app expects * that an immediate read would fail.) */ -#define APR_INCOMPLETE_WRITE 8192 /* like APR_INCOMPLETE_READ, but for write +#define APR_INCOMPLETE_WRITE 8192 /**< like APR_INCOMPLETE_READ, but for write + * @see APR_INCOMPLETE_READ */ -#define APR_POLLIN 0x001 -#define APR_POLLPRI 0x002 -#define APR_POLLOUT 0x004 -#define APR_POLLERR 0x010 -#define APR_POLLHUP 0x020 -#define APR_POLLNVAL 0x040 /** @} */ -typedef enum {APR_SHUTDOWN_READ, APR_SHUTDOWN_WRITE, - APR_SHUTDOWN_READWRITE} apr_shutdown_how_e; +/** Define what type of socket shutdown should occur. */ +typedef enum { + APR_SHUTDOWN_READ, /**< no longer allow read request */ + APR_SHUTDOWN_WRITE, /**< no longer allow write requests */ + APR_SHUTDOWN_READWRITE /**< no longer allow read or write requests */ +} apr_shutdown_how_e; -#define APR_IPV4_ADDR_OK 0x01 /* see doc for apr_sockaddr_info_get() */ -#define APR_IPV6_ADDR_OK 0x02 /* see doc for apr_sockaddr_info_get() */ +#define APR_IPV4_ADDR_OK 0x01 /**< @see apr_sockaddr_info_get() */ +#define APR_IPV6_ADDR_OK 0x02 /**< @see apr_sockaddr_info_get() */ #if (!APR_HAVE_IN_ADDR) /** @@ -173,9 +175,9 @@ struct in_addr { * @defgroup IP_Proto IP Protocol Definitions for use when creating sockets * @{ */ -#define APR_PROTO_TCP 6 -#define APR_PROTO_UDP 17 -#define APR_PROTO_SCTP 132 +#define APR_PROTO_TCP 6 /**< TCP */ +#define APR_PROTO_UDP 17 /**< UDP */ +#define APR_PROTO_SCTP 132 /**< SCTP */ /** @} */ @@ -201,11 +203,13 @@ typedef enum { #define apr_inet_addr inet_network #endif +/** A structure to represent sockets */ typedef struct apr_socket_t apr_socket_t; /** * A structure to encapsulate headers and trailers for apr_sendfile */ typedef struct apr_hdtr_t apr_hdtr_t; +/** A structure to represent in_addr */ typedef struct in_addr apr_in_addr_t; /** A structure to represent an IP subnet */ typedef struct apr_ipsubnet_t apr_ipsubnet_t; @@ -213,13 +217,13 @@ typedef struct apr_ipsubnet_t apr_ipsubnet_t; /** @remark use apr_uint16_t just in case some system has a short that isn't 16 bits... */ typedef apr_uint16_t apr_port_t; -/* It's defined here as I think it should all be platform safe... +/** @remark It's defined here as I think it should all be platform safe... + * @see apr_sockaddr_t */ +typedef struct apr_sockaddr_t apr_sockaddr_t; /** * APRs socket address type, used to ensure protocol independence */ -typedef struct apr_sockaddr_t apr_sockaddr_t; - struct apr_sockaddr_t { /** The pool to use... */ apr_pool_t *pool; @@ -231,6 +235,7 @@ struct apr_sockaddr_t { apr_port_t port; /** The family */ apr_int32_t family; + /** Union of either IPv4 or IPv6 sockaddr. */ union { /** IPv4 sockaddr structure */ struct sockaddr_in sin; @@ -310,6 +315,7 @@ APR_DECLARE(apr_status_t) apr_socket_create_ex(apr_socket_t **new_sock, * APR_SHUTDOWN_WRITE no longer allow write requests * APR_SHUTDOWN_READWRITE no longer allow read or write requests * + * @see apr_shutdown_how_e * @remark This does not actually close the socket descriptor, it just * controls which calls are still valid on the socket. */ @@ -511,7 +517,8 @@ APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, /** * @param sock The socket to send from * @param where The apr_sockaddr_t describing where to send the data - * @param data The data to send + * @param flags The flags to use + * @param buf The data to send * @param len The length of the data to send */ APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, @@ -521,6 +528,7 @@ APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, /** * @param from The apr_sockaddr_t to fill in the recipient info * @param sock The socket to use + * @param flags The flags to use * @param buf The buffer to use * @param len The length of the available buffer */ diff --git a/include/apr_poll.h b/include/apr_poll.h index 8ba499e9425..7f41955b446 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -55,11 +55,11 @@ #ifndef APR_POLL_H #define APR_POLL_H /** - * @file apr_network_io.h - * @brief APR Network library + * @file apr_poll.h + * @brief APR Poll interface */ /** - * @defgroup APR_Net Network Routines + * @defgroup APR_Poll Poll Routines * @ingroup APR * @{ */ @@ -83,35 +83,39 @@ extern "C" { * @defgroup Poll options * @{ */ -#define APR_POLLIN 0x001 -#define APR_POLLPRI 0x002 -#define APR_POLLOUT 0x004 -#define APR_POLLERR 0x010 -#define APR_POLLHUP 0x020 -#define APR_POLLNVAL 0x040 +#define APR_POLLIN 0x001 /**< Can read without blocking */ +#define APR_POLLPRI 0x002 /**< Priority data available */ +#define APR_POLLOUT 0x004 /**< Can write without blocking */ +#define APR_POLLERR 0x010 /**< Pending error */ +#define APR_POLLHUP 0x020 /**< Hangup occurred */ +#define APR_POLLNVAL 0x040 /**< Descriptior invalid */ /** @} */ +/** Used in apr_pollfd_t to determine what the apr_descriptor is */ typedef enum { - APR_NO_DESC, - APR_POLL_SOCKET, - APR_POLL_FILE, - APR_POLL_LASTDESC + APR_NO_DESC, /**< nothing here */ + APR_POLL_SOCKET, /**< descriptor refers to a socket */ + APR_POLL_FILE, /**< descriptor refers to a file */ + APR_POLL_LASTDESC /**< descriptor is the last one in the list */ } apr_datatype_e ; +/** Union of either an APR file or socket. */ typedef union { - apr_file_t *f; - apr_socket_t *s; + apr_file_t *f; /**< file */ + apr_socket_t *s; /**< socket */ } apr_descriptor; +/** @see apr_pollfd_t */ typedef struct apr_pollfd_t apr_pollfd_t; +/** Poll descriptor set. */ struct apr_pollfd_t { - apr_pool_t *p; - apr_datatype_e desc_type; - apr_int16_t reqevents; - apr_int16_t rtnevents; - apr_descriptor desc; - void *client_data; /* allows app to associate context with a descriptor */ + apr_pool_t *p; /**< associated pool */ + apr_datatype_e desc_type; /**< descriptor type */ + apr_int16_t reqevents; /**< requested events */ + apr_int16_t rtnevents; /**< returned events */ + apr_descriptor desc; /**< @see apr_descriptor */ + void *client_data; /**< allows app to associate context */ }; /** @@ -128,7 +132,7 @@ APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new_poll, /** * Poll the sockets in the poll structure * @param aprset The poll structure we will be using. - * @param num The number of sockets we are polling + * @param numsock The number of sockets we are polling * @param nsds The number of sockets signalled. * @param timeout The amount of time in microseconds to wait. This is * a maximum, not a minimum. If a socket is signalled, we @@ -149,7 +153,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, /** * Add a socket to the poll structure. * @param aprset The poll structure we will be using. - * @param socket The socket to add to the current poll structure. + * @param sock The socket to add to the current poll structure. * @param event The events to look for when we do the poll. One of: *
      *            APR_POLLIN       signal if read will not block
    @@ -224,6 +228,7 @@ APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event,
      * file descriptors
      */
     
    +/** Opaque structure used for pollset API */
     typedef struct apr_pollset_t apr_pollset_t;
     
     /**
    @@ -249,9 +254,9 @@ APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset);
      * Add a socket or file descriptor to a pollset
      * @param pollset The pollset to which to add the descriptor
      * @param descriptor The descriptor to add
    - * @param remark If you set client_data in the descriptor, that value
    - *               will be returned in the client_data field whenever this
    - *               descriptor is signalled in apr_pollset_poll().
    + * @remark If you set client_data in the descriptor, that value
    + *         will be returned in the client_data field whenever this
    + *         descriptor is signalled in apr_pollset_poll().
      */
     APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset,
                                               const apr_pollfd_t *descriptor);
    diff --git a/include/apr_pools.h b/include/apr_pools.h
    index febdecb58dc..5fb7602160b 100644
    --- a/include/apr_pools.h
    +++ b/include/apr_pools.h
    @@ -212,7 +212,7 @@ APR_DECLARE(void) apr_pool_terminate(void);
      *        pool.  If it is non-NULL, the new pool will inherit all
      *        of its parent pool's attributes, except the apr_pool_t will
      *        be a sub-pool.
    - * @param apr_abort A function to use if the pool cannot allocate more memory.
    + * @param abort_fn A function to use if the pool cannot allocate more memory.
      * @param allocator The allocator to use with the new pool.  If NULL the
      *        allocator of the parent pool will be used.
      */
    diff --git a/include/apr_portable.h b/include/apr_portable.h
    index 78f027c0783..3966e5542fa 100644
    --- a/include/apr_portable.h
    +++ b/include/apr_portable.h
    @@ -160,6 +160,7 @@ typedef void*                 apr_os_shm_t;
      * denominator typedefs for  all UNIX-like systems.  :)
      */
     
    +/** Basic OS process mutex structure. */
     struct apr_os_proc_mutex_t {
     #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE
         int crossproc;
    @@ -175,18 +176,23 @@ struct apr_os_proc_mutex_t {
     #endif
     };
     
    -typedef int                   apr_os_file_t;
    -typedef DIR                   apr_os_dir_t;
    -typedef int                   apr_os_sock_t;
    -typedef struct apr_os_proc_mutex_t  apr_os_proc_mutex_t;
    +typedef int                   apr_os_file_t;        /**< native file */
    +typedef DIR                   apr_os_dir_t;         /**< native dir */
    +typedef int                   apr_os_sock_t;        /**< native dir */
    +typedef struct apr_os_proc_mutex_t  apr_os_proc_mutex_t; /**< native proces
    +                                                          *   mutex
    +                                                          */
     #if APR_HAS_THREADS && APR_HAVE_PTHREAD_H 
    -typedef pthread_t             apr_os_thread_t;
    -typedef pthread_key_t         apr_os_threadkey_t;
    +typedef pthread_t             apr_os_thread_t;      /**< native thread */
    +typedef pthread_key_t         apr_os_threadkey_t;   /**< native thread address
    +                                                     *   space */
     #endif
    -typedef pid_t                 apr_os_proc_t;
    -typedef struct timeval        apr_os_imp_time_t;
    -typedef struct tm             apr_os_exp_time_t;
    -/* dso types... */
    +typedef pid_t                 apr_os_proc_t;        /**< native pid */
    +typedef struct timeval        apr_os_imp_time_t;    /**< native timeval */
    +typedef struct tm             apr_os_exp_time_t;    /**< native tm */
    +/** @var apr_os_dso_handle_t
    + * native dso types
    + */
     #if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
     #include 
     typedef shl_t                 apr_os_dso_handle_t;
    @@ -196,7 +202,7 @@ typedef NSModule              apr_os_dso_handle_t;
     #else
     typedef void *                apr_os_dso_handle_t;
     #endif
    -typedef void*                 apr_os_shm_t;
    +typedef void*                 apr_os_shm_t;         /**< native SHM */
     
     #endif
     
    @@ -221,10 +227,15 @@ struct apr_os_sock_info_t {
     
     typedef struct apr_os_sock_info_t apr_os_sock_info_t;
     
    -#if APR_PROC_MUTEX_IS_GLOBAL
    +#if APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN)
    +/** Opaque global mutex type */
     #define apr_os_global_mutex_t apr_os_proc_mutex_t
    +/** @return apr_os_global_mutex */
     #define apr_os_global_mutex_get apr_os_proc_mutex_get
     #else
    +    /** Thread and process mutex for those platforms where process mutexes
    +     *  are not held in threads.
    +     */
         struct apr_os_global_mutex_t {
             apr_pool_t *pool;
             apr_proc_mutex_t *proc_mutex;
    @@ -283,8 +294,8 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime,
     
     /**
      * Get the imploded time in the platforms native format.
    - * @param ostime the native time format
    - * @param aprtimethe time to convert
    + * @param ostime  the native time format
    + * @param aprtime the time to convert
      */
     APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, 
                                                   apr_time_t *aprtime);
    diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h
    index 7bc84343105..408af28d9d8 100644
    --- a/include/apr_proc_mutex.h
    +++ b/include/apr_proc_mutex.h
    @@ -74,10 +74,21 @@ extern "C" {
      * @{
      */
     
    -typedef enum {APR_LOCK_FCNTL, APR_LOCK_FLOCK, APR_LOCK_SYSVSEM,
    -              APR_LOCK_PROC_PTHREAD, APR_LOCK_POSIXSEM,
    -              APR_LOCK_DEFAULT} apr_lockmech_e;
    -
    +/** 
    + * Enumerated potential types for APR process locking methods
    + * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports
    + *          APR_LOCK_foo.  Only APR_LOCK_DEFAULT is portable.
    + */
    +typedef enum {
    +    APR_LOCK_FCNTL,         /**< fcntl() */
    +    APR_LOCK_FLOCK,         /**< flock() */
    +    APR_LOCK_SYSVSEM,       /**< System V Semaphores */
    +    APR_LOCK_PROC_PTHREAD,  /**< POSIX pthread process-based locking */
    +    APR_LOCK_POSIXSEM,      /**< POSIX semaphore process-based locking */
    +    APR_LOCK_DEFAULT        /**< Use the default process lock */
    +} apr_lockmech_e;
    +
    +/** Opaque structure representing a process mutex. */
     typedef struct apr_proc_mutex_t apr_proc_mutex_t;
     
     /*   Function definitions */
    @@ -99,6 +110,7 @@ typedef struct apr_proc_mutex_t apr_proc_mutex_t;
      *            APR_LOCK_DEFAULT     pick the default mechanism for the platform
      * 
    * @param pool the pool from which to allocate the mutex. + * @see apr_lockmech_e * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports * APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. */ @@ -159,7 +171,6 @@ APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex); /** * Display the name of the default mutex: APR_LOCK_DEFAULT - * @param mutex the name of the default mutex */ APR_DECLARE(const char *) apr_proc_mutex_defname(void); diff --git a/include/apr_shm.h b/include/apr_shm.h index 3a1dee3a036..fdf428e9a5f 100644 --- a/include/apr_shm.h +++ b/include/apr_shm.h @@ -84,7 +84,7 @@ typedef struct apr_shm_t apr_shm_t; * Create and make accessable a shared memory segment. * @param m The shared memory structure to create. * @param reqsize The desired size of the segment. - * @param file The file to use for shared memory on platforms that + * @param filename The file to use for shared memory on platforms that * require it. * @param pool the pool from which to allocate the shared memory * structure. @@ -118,7 +118,7 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m); * Attach to a shared memory segment that was created * by another process. * @param m The shared memory structure to create. - * @param file The file used to create the original segment. + * @param filename The file used to create the original segment. * (This MUST match the original filename.) * @param pool the pool from which to allocate the shared memory * structure for this process. diff --git a/include/apr_signal.h b/include/apr_signal.h index 3a0a013b4dc..ce5da1550be 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -76,7 +76,7 @@ extern "C" { * @{ */ -#if APR_HAVE_SIGACTION +#if APR_HAVE_SIGACTION || defined(DOXYGEN) #if defined(DARWIN) && !defined(__cplusplus) && !defined(_ANSI_SOURCE) /* work around Darwin header file bugs @@ -90,13 +90,13 @@ extern "C" { #define SIG_ERR (void (*)(int))-1 #endif +/** Function prototype for signal handlers */ typedef void apr_sigfunc_t(int); -/* ### how to doc this? */ /** * Set the signal handler function for a given signal * @param signo The signal (eg... SIGWINCH) - * @parm the function to get called + * @param func the function to get called */ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func); diff --git a/include/apr_strings.h b/include/apr_strings.h index 6cadb48e97f..0a59c1b4467 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -236,7 +236,7 @@ APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src); /** * Convert the arguments to a program from one string to an array of * strings terminated by a NULL pointer - * @param str The arguments to convert + * @param arg_str The arguments to convert * @param argv_out Output location. This is a pointer to an array of strings. * @param token_context Pool to use. */ diff --git a/include/apr_support.h b/include/apr_support.h index ecb20a4c62b..bbbee089995 100644 --- a/include/apr_support.h +++ b/include/apr_support.h @@ -55,7 +55,7 @@ #ifndef APR_SUPPORT_H #define APR_SUPPORT_H /** - * @file apr_file_io.h + * @file apr_support.h * @brief APR Support functions */ /** @@ -72,8 +72,11 @@ extern "C" { #endif /* __cplusplus */ +/** + * Wait for IO to occur or timeout. + */ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, - int for_read); + int for_read); #ifdef __cplusplus } diff --git a/include/apr_tables.h b/include/apr_tables.h index 1e5404002e9..3d1970479d6 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -86,9 +86,10 @@ extern "C" { /** the table abstract data type */ typedef struct apr_table_t apr_table_t; -/** An opaque array type */ +/** @see apr_array_header_t */ typedef struct apr_array_header_t apr_array_header_t; +/** An opaque array type */ struct apr_array_header_t { /** The pool the array is allocated out of */ apr_pool_t *pool; @@ -204,7 +205,7 @@ APR_DECLARE(apr_array_header_t *) apr_array_copy_hdr(apr_pool_t *p, * @param p The pool to allocate the new array out of * @param first The array to put first in the new array. * @param second The array to put second in the new array. - * @param return A new array containing the data from the two arrays passed in. + * @return A new array containing the data from the two arrays passed in. */ APR_DECLARE(apr_array_header_t *) apr_array_append(apr_pool_t *p, const apr_array_header_t *first, @@ -353,7 +354,7 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, * and apr_table_vdo(). * @param rec The data passed as the first argument to apr_table_[v]do() * @param key The key from this iteration of the table - * @param key The value from this iteration of the table + * @param value The value from this iteration of the table * @remark Iteration continues while this callback function returns non-zero. * To export the callback function for apr_table_[v]do() it must be declared * in the _NONSTD convention. diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h index 982780f3afe..5524ab5953f 100644 --- a/include/apr_thread_cond.h +++ b/include/apr_thread_cond.h @@ -78,6 +78,7 @@ extern "C" { * @{ */ +/** Opaque structure for thread condition variables */ typedef struct apr_thread_cond_t apr_thread_cond_t; /* Function definitions */ diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index e7014b2b678..e02b885ccd3 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -75,11 +75,12 @@ extern "C" { * @{ */ +/** Opaque thread-local mutex structure */ typedef struct apr_thread_mutex_t apr_thread_mutex_t; -#define APR_THREAD_MUTEX_DEFAULT 0x0 -#define APR_THREAD_MUTEX_NESTED 0x1 -#define APR_THREAD_MUTEX_UNNESTED 0x2 +#define APR_THREAD_MUTEX_DEFAULT 0x0 /**< platform-optimal lock behavior */ +#define APR_THREAD_MUTEX_NESTED 0x1 /**< enable nested (recursive) locks */ +#define APR_THREAD_MUTEX_UNNESTED 0x2 /**< disable nested locks */ /* Delayed the include to avoid a circular reference */ #include "apr_pools.h" diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 6735ddf040d..d3bcf2812da 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -150,6 +150,7 @@ typedef enum { /** @} */ #endif /* APR_HAS_OTHER_CHILD */ +/** @see apr_proc_t */ typedef struct apr_proc_t apr_proc_t; /** The APR process type */ @@ -176,13 +177,19 @@ struct apr_proc_t { #endif }; +/** Opaque Thread structure. */ typedef struct apr_thread_t apr_thread_t; +/** Opaque Thread attributes structure. */ typedef struct apr_threadattr_t apr_threadattr_t; +/** Opaque Process attributes structure. */ typedef struct apr_procattr_t apr_procattr_t; +/** Opaque control variable for one-time atomic variables. */ typedef struct apr_thread_once_t apr_thread_once_t; +/** Opaque thread private address space. */ typedef struct apr_threadkey_t apr_threadkey_t; #if APR_HAS_OTHER_CHILD +/** Opaque record of child process. */ typedef struct apr_other_child_rec_t apr_other_child_rec_t; #endif /* APR_HAS_OTHER_CHILD */ @@ -494,8 +501,8 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont); * Create a new process and execute a new program within that process. * @param new_proc The resulting process handle. * @param progname The program to run - * @param const_args the arguments to pass to the new program. The first - * one should be the program name. + * @param args the arguments to pass to the new program. The first + * one should be the program name. * @param env The new environment table for the new process. This * should be a list of NULL-terminated strings. This argument * is ignored for APR_PROGRAM_ENV and APR_PROGRAM_PATH types @@ -571,8 +578,8 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_how_e waithow, apr_pool_t *p); -#define APR_PROC_DETACH_FOREGROUND 0 -#define APR_PROC_DETACH_DAEMONIZE 1 +#define APR_PROC_DETACH_FOREGROUND 0 /**< Do not detach */ +#define APR_PROC_DETACH_DAEMONIZE 1 /**< Detach */ /** * Detach the process from the controlling terminal. diff --git a/include/apr_thread_rwlock.h b/include/apr_thread_rwlock.h index 9ee005b0f48..1d242ca137b 100644 --- a/include/apr_thread_rwlock.h +++ b/include/apr_thread_rwlock.h @@ -76,6 +76,7 @@ extern "C" { * @{ */ +/** Opaque read-write thread-safe lock. */ typedef struct apr_thread_rwlock_t apr_thread_rwlock_t; /** diff --git a/include/apr_time.h b/include/apr_time.h index d364b406013..050d7a3e4d0 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -95,34 +95,38 @@ typedef apr_int32_t apr_short_interval_time_t; /** number of microseconds per second */ #define APR_USEC_PER_SEC APR_TIME_C(1000000) +/** @return apr_time_t as a second */ #define apr_time_sec(time) ((time) / APR_USEC_PER_SEC) +/** @return apr_time_t as a usec */ #define apr_time_usec(time) ((time) % APR_USEC_PER_SEC) +/** @return apr_time_t as a msec */ #define apr_time_msec(time) (((time) / 1000) % 1000) - +/** @return apr_time_t as a msec */ #define apr_time_as_msec(time) ((time) / 1000) - +/** @return a second as an apr_time_t */ #define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC) - +/** @return a second and usec combination as an apr_time_t */ #define apr_time_make(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC \ + (apr_time_t)(usec)) /** - * return the current time + * @return the current time */ APR_DECLARE(apr_time_t) apr_time_now(void); +/** @see apr_time_exp_t */ +typedef struct apr_time_exp_t apr_time_exp_t; + /** * a structure similar to ANSI struct tm with the following differences: * - tm_usec isn't an ANSI field * - tm_gmtoff isn't an ANSI field (it's a bsdism) */ -typedef struct apr_time_exp_t apr_time_exp_t; - struct apr_time_exp_t { /** microseconds past tm_sec */ apr_int32_t tm_usec; @@ -162,7 +166,6 @@ APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, * @param result the exploded time * @param input the time to explode * @param offs the number of seconds offset to apply - * @param zone the zone description */ APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, apr_time_t input, @@ -260,7 +263,7 @@ APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, * Improve the clock resolution for the lifetime of the given pool. * Generally this is only desireable on benchmarking and other very * time-sensitive applications, and has no impact on most platforms. - * @param pool The pool to associate the finer clock resolution + * @param p The pool to associate the finer clock resolution */ APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p); diff --git a/include/apr_version.h b/include/apr_version.h index 92bd1d3e08e..0d3db8bfbd6 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -121,10 +121,10 @@ extern "C" { * structure. */ typedef struct { - int major; - int minor; - int patch; - int is_dev; + int major; /**< major number */ + int minor; /**< minor number */ + int patch; /**< patch number */ + int is_dev; /**< is development (1 or 0) */ } apr_version_t; /** From 25ebc1fc6873d87fbd831cd2c1c0c2303dd02d03 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 11 Nov 2002 03:02:37 +0000 Subject: [PATCH 3991/7878] I forgot to commit this file last night, so the file I/O tests couldn't work. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64010 13f79535-47bb-0310-9956-ffa450edef68 --- test/data/file_datafile.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/data/file_datafile.txt diff --git a/test/data/file_datafile.txt b/test/data/file_datafile.txt new file mode 100644 index 00000000000..1651a3293f6 --- /dev/null +++ b/test/data/file_datafile.txt @@ -0,0 +1 @@ +This is the file data file. \ No newline at end of file From 232b2706f193937df671e254807b8a6a7224d8af Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 11 Nov 2002 04:54:45 +0000 Subject: [PATCH 3992/7878] Migrate the directory test program to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64011 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testdir.c | 287 +++++++++++++++++++++++++++++++++++++++-------- 4 files changed, 244 insertions(+), 49 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 5a497d99e7a..8cb93d233c1 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -165,8 +165,8 @@ testrand@EXEEXT@: testrand.lo $(LOCAL_LIBS) testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) $(LINK) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) -testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo CuTest.lo $(LOCAL_LIBS) - $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) +testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo testdir.lo CuTest.lo $(LOCAL_LIBS) + $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo testdir.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index 0257d557fde..3295fbde018 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -77,6 +77,7 @@ CuSuite *testsleep(void); CuSuite *testpool(void); CuSuite *testfmt(void); CuSuite *testfile(void); +CuSuite *testdir(void); diff --git a/test/testall.c b/test/testall.c index 98f5ca7e645..c025986eb3f 100644 --- a/test/testall.c +++ b/test/testall.c @@ -75,6 +75,7 @@ testfunc *tests[NUM_TESTS] = { testpool, testfmt, testfile, + testdir, NULL }; diff --git a/test/testdir.c b/test/testdir.c index cbd21ceeece..0fc58ab55f8 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -52,7 +52,6 @@ * . */ -#include #include #include #include @@ -63,74 +62,268 @@ #include "apr_lib.h" #include "test_apr.h" +static void test_mkdir(CuTest *tc) +{ + apr_status_t rv; + apr_finfo_t finfo; + + rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, APR_DIR, finfo.filetype); +} + +static void test_mkdir_recurs(CuTest *tc) +{ + apr_status_t rv; + apr_finfo_t finfo; + + rv = apr_dir_make_recursive("data/one/two/three", + APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_stat(&finfo, "data/one", APR_FINFO_TYPE, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, APR_DIR, finfo.filetype); + + rv = apr_stat(&finfo, "data/one/two", APR_FINFO_TYPE, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, APR_DIR, finfo.filetype); + + rv = apr_stat(&finfo, "data/one/two/three", APR_FINFO_TYPE, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, APR_DIR, finfo.filetype); +} + +static void test_remove(CuTest *tc) +{ + apr_status_t rv; + apr_finfo_t finfo; + + rv = apr_dir_remove("data/testdir", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); +} + +static void test_removeall_fail(CuTest *tc) +{ + apr_status_t rv; + apr_finfo_t finfo; + + rv = apr_dir_remove("data/one", p); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv)); +} + +static void test_removeall(CuTest *tc) +{ + apr_status_t rv; + apr_finfo_t finfo; + + rv = apr_dir_remove("data/one/two/three", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/one/two", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/one", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); +} + +static void test_remove_notthere(CuTest *tc) +{ + apr_status_t rv; + apr_finfo_t finfo; + + rv = apr_dir_remove("data/notthere", p); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); +} + +static void test_mkdir_twice(CuTest *tc) +{ + apr_status_t rv; + apr_finfo_t finfo; + + rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_EEXIST(rv)); + + rv = apr_dir_remove("data/testdir", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); +} + +static void test_opendir(CuTest *tc) +{ + apr_status_t rv; + apr_dir_t *dir; + + rv = apr_dir_open(&dir, "data", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + apr_dir_close(dir); +} + +static void test_opendir_notthere(CuTest *tc) +{ + apr_status_t rv; + apr_dir_t *dir; + + rv = apr_dir_open(&dir, "notthere", p); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); +} + +static void test_closedir(CuTest *tc) +{ + apr_status_t rv; + apr_dir_t *dir; + + rv = apr_dir_open(&dir, "data", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_dir_close(dir); + CuAssertIntEquals(tc, APR_SUCCESS, rv); +} + +static void test_readdir_onedot(CuTest *tc) +{ + apr_status_t rv; + apr_dir_t *dir; + apr_finfo_t finfo; + + rv = apr_dir_open(&dir, "data", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_dir_read(&finfo, APR_FINFO_NORM, dir); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, ".", finfo.name); + + rv = apr_dir_close(dir); + CuAssertIntEquals(tc, APR_SUCCESS, rv); +} + +static void test_readdir_twodot(CuTest *tc) +{ + apr_status_t rv; + apr_dir_t *dir; + apr_finfo_t finfo; + + rv = apr_dir_open(&dir, "data", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_dir_read(&finfo, APR_FINFO_NORM, dir); + rv = apr_dir_read(&finfo, APR_FINFO_NORM, dir); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, "..", finfo.name); + + rv = apr_dir_close(dir); + CuAssertIntEquals(tc, APR_SUCCESS, rv); +} + +static void test_rewind(CuTest *tc) +{ + apr_status_t rv; + apr_dir_t *dir; + apr_finfo_t finfo; + + rv = apr_dir_open(&dir, "data", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_dir_read(&finfo, APR_FINFO_NORM, dir); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, ".", finfo.name); + + rv = apr_dir_rewind(dir); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_dir_read(&finfo, APR_FINFO_NORM, dir); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, ".", finfo.name); + + rv = apr_dir_close(dir); + CuAssertIntEquals(tc, APR_SUCCESS, rv); +} /* Test for a (fixed) bug in apr_dir_read(). This bug only happened in threadless cases. */ - -int main(void) +static void test_uncleared_errno(CuTest *tc) { - apr_pool_t *pool; apr_file_t *thefile = NULL; apr_finfo_t finfo; apr_int32_t finfo_flags = APR_FINFO_TYPE | APR_FINFO_NAME; apr_dir_t *this_dir; - - printf("APR Directory Read Test\n===========================\n\n"); - - STD_TEST_NEQ("Initializing APR", apr_initialize()) - atexit(apr_terminate); - STD_TEST_NEQ("Creating the main pool we'll use", - apr_pool_create(&pool, NULL)) - - fprintf(stdout, "Testing for readdir() bug.\n"); - - /* Make two empty directories, and put a file in one of them. */ - STD_TEST_NEQ(" Creating empty dir1", - apr_dir_make("dir1", APR_OS_DEFAULT, pool)) - STD_TEST_NEQ(" Creating empty dir2", - apr_dir_make("dir2", APR_OS_DEFAULT, pool)) - STD_TEST_NEQ(" Creating dir1/file1", - apr_file_open(&thefile, "dir1/file1", - APR_READ | APR_WRITE | APR_CREATE, - APR_OS_DEFAULT, pool)) - STD_TEST_NEQ(" Closing dir1/file1", - apr_file_close(thefile)) + apr_status_t rv; + + rv = apr_dir_make("dir1", APR_OS_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_dir_make("dir2", APR_OS_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_file_open(&thefile, "dir1/file1", + APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_file_close(thefile); + CuAssertIntEquals(tc, APR_SUCCESS, rv); /* Try to remove dir1. This should fail because it's not empty. However, on a platform with threads disabled (such as FreeBSD), `errno' will be set as a result. */ - TEST_EQ(" Failing to remove dir1", apr_dir_remove("dir1", pool), - APR_SUCCESS, "OK", "Failed") + rv = apr_dir_remove("dir1", p); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv)); /* Read `.' and `..' out of dir2. */ - STD_TEST_NEQ(" Opening dir2", - apr_dir_open(&this_dir, "dir2", pool)) - STD_TEST_NEQ(" reading `.' entry", - apr_dir_read(&finfo, finfo_flags, this_dir)) - STD_TEST_NEQ(" reading `..' entry", - apr_dir_read(&finfo, finfo_flags, this_dir)) + rv = apr_dir_open(&this_dir, "dir2", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_dir_read(&finfo, finfo_flags, this_dir); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_dir_read(&finfo, finfo_flags, this_dir); + CuAssertIntEquals(tc, APR_SUCCESS, rv); /* Now, when we attempt to do a third read of empty dir2, and the underlying system readdir() returns NULL, the old value of errno shouldn't cause a false alarm. We should get an ENOENT back from apr_dir_read, and *not* the old errno. */ - TEST_STATUS(" get ENOENT on 3rd read", - apr_dir_read(&finfo, finfo_flags, this_dir), - APR_STATUS_IS_ENOENT, "OK", "Failed") + rv = apr_dir_read(&finfo, finfo_flags, this_dir); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); - STD_TEST_NEQ(" closing dir", - apr_dir_close(this_dir)); + rv = apr_dir_close(this_dir); + CuAssertIntEquals(tc, APR_SUCCESS, rv); /* Cleanup */ - STD_TEST_NEQ(" Cleanup file1", - apr_file_remove("dir1/file1", pool)) - STD_TEST_NEQ(" Cleanup dir1", - apr_dir_remove("dir1", pool)) - STD_TEST_NEQ(" Cleanup dir2", - apr_dir_remove("dir2", pool)) + rv = apr_file_remove("dir1/file1", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_dir_remove("dir1", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_dir_remove("dir2", p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + +} + +CuSuite *testdir(void) +{ + CuSuite *suite = CuSuiteNew("Test Directory"); - apr_pool_destroy(pool); + SUITE_ADD_TEST(suite, test_mkdir); + SUITE_ADD_TEST(suite, test_mkdir_recurs); + SUITE_ADD_TEST(suite, test_remove); + SUITE_ADD_TEST(suite, test_removeall_fail); + SUITE_ADD_TEST(suite, test_removeall); + SUITE_ADD_TEST(suite, test_remove_notthere); + SUITE_ADD_TEST(suite, test_mkdir_twice); - printf("\nAll tests passed OK\n"); - return 0; + SUITE_ADD_TEST(suite, test_opendir); + SUITE_ADD_TEST(suite, test_opendir_notthere); + SUITE_ADD_TEST(suite, test_closedir); + SUITE_ADD_TEST(suite, test_uncleared_errno); + + return suite; } + +#ifdef SINGLE_PROG +CuSuite *getsuite(void) +{ + return testdir(); +} +#endif + From 003045553a7bb85568045c11937aa1b1f1c3ffbb Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 11 Nov 2002 20:09:44 +0000 Subject: [PATCH 3993/7878] Remove unused variables. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64012 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/testtime.c b/test/testtime.c index 9ee67eecfb9..8ccab93f053 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -111,10 +111,8 @@ static void test_gmtstr(CuTest *tc) { apr_status_t rv; apr_time_exp_t xt; - time_t os_now; rv = apr_time_exp_gmt(&xt, now); - os_now = now / APR_USEC_PER_SEC; if (rv == APR_ENOTIMPL) { CuNotImpl(tc, "apr_time_exp_gmt"); } @@ -127,10 +125,8 @@ static void test_localstr(CuTest *tc) { apr_status_t rv; apr_time_exp_t xt; - time_t os_now; rv = apr_time_exp_lt(&xt, now); - os_now = now / APR_USEC_PER_SEC; if (rv == APR_ENOTIMPL) { CuNotImpl(tc, "apr_time_exp_lt"); } From 7ede558d04fb6277ae103b093da5f9dfab579795 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 11 Nov 2002 22:43:26 +0000 Subject: [PATCH 3994/7878] Ignore the testall executable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64013 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.cvsignore b/test/.cvsignore index 795cbd06ef7..30a31ceda64 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -67,3 +67,4 @@ testvsn testregex testmutexscope testtable +testall From 98c28c18d08bfc2110f04eacb778d9374c04d4b6 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 11 Nov 2002 22:46:57 +0000 Subject: [PATCH 3995/7878] Flush stdout after printing the test name but before running the tests. (better feedback whilst running the sleep tests) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64014 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/CuTest.c b/test/CuTest.c index e70ca7e045d..7455116a5e8 100644 --- a/test/CuTest.c +++ b/test/CuTest.c @@ -383,6 +383,7 @@ void CuSuiteListRunWithSummary(CuSuiteList* testSuite) printf(" %s:%s", testCase->name, genspaces(21 - strlen(testCase->name))); + fflush(stdout); CuSuiteRun(testCase); CuSuiteSummary(testCase, str); printf(" %s", str->buffer); From cd1feaa2ec3eb211ca4dfde272486aee52ad54bf Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Tue, 12 Nov 2002 02:55:45 +0000 Subject: [PATCH 3996/7878] Introduced apr_os_default_encoding and apr_os_locale_encoding, with implementations for Unix and Win32, needed by apr_xlate. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64015 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++ include/apr_portable.h | 16 ++++++ libapr.dsp | 4 ++ misc/unix/Makefile.in | 3 +- misc/unix/charset.c | 115 +++++++++++++++++++++++++++++++++++++++++ misc/win32/charset.c | 81 +++++++++++++++++++++++++++++ 6 files changed, 222 insertions(+), 1 deletion(-) create mode 100644 misc/unix/charset.c create mode 100644 misc/win32/charset.c diff --git a/apr.dsp b/apr.dsp index 96dfc1b1ff6..868415a9408 100644 --- a/apr.dsp +++ b/apr.dsp @@ -190,6 +190,10 @@ SOURCE=.\misc\win32\apr_app.c # End Source File # Begin Source File +SOURCE=.\misc\win32\charset.c +# End Source File +# Begin Source File + SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File diff --git a/include/apr_portable.h b/include/apr_portable.h index 3966e5542fa..7eff31d020e 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -503,6 +503,22 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data); #endif /* APR_HAS_DSO */ +/** + * Get the name of the system default characer set. + * @param pool the pool to allocate the name from, if needed + */ +APR_DECLARE(const char*) apr_os_default_encoding(apr_pool_t *pool); + + +/** + * Get the name of the current locale character set. + * @param pool the pool to allocate the name from, if needed + * @remark Defers to apr_os_default_encoding if the current locale's + * data can't be retreved on this system. + */ +APR_DECLARE(const char*) apr_os_locale_encoding(apr_pool_t *pool); + + #ifdef __cplusplus } #endif diff --git a/libapr.dsp b/libapr.dsp index 087dc7d5ecc..07845a8bff4 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -196,6 +196,10 @@ SOURCE=.\misc\win32\apr_app.c # End Source File # Begin Source File +SOURCE=.\misc\win32\charset.c +# End Source File +# Begin Source File + SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index 76366dbb8b9..28fef32d466 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -2,7 +2,8 @@ srcdir = @srcdir@ VPATH = @srcdir@ TARGETS = \ - start.lo getopt.lo otherchild.lo errorcodes.lo rand.lo version.lo + start.lo getopt.lo otherchild.lo errorcodes.lo rand.lo version.lo \ + charset.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/misc/unix/charset.c b/misc/unix/charset.c new file mode 100644 index 00000000000..404c9073eb9 --- /dev/null +++ b/misc/unix/charset.c @@ -0,0 +1,115 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_strings.h" +#include "apr_portable.h" + +#ifdef HAVE_LANGINFO_H +#include +#endif + +/* + * simple heuristic to determine codepage of source code so that + * literal strings (e.g., "GET /\r\n") in source code can be translated + * properly + * + * If appropriate, a symbol can be set at configure time to determine + * this. On EBCDIC platforms, it will be important how the code was + * unpacked. + */ + +APR_DECLARE(const char*) apr_os_default_encoding (apr_pool_t *pool) +{ +#ifdef __MVS__ +# ifdef __CODESET__ + return __CODESET__; +# else + return "IBM-1047"; +# endif +#endif + + if ('}' == 0xD0) { + return "IBM-1047"; + } + + if ('{' == 0xFB) { + return "EDF04"; + } + + if ('A' == 0xC1) { + return "EBCDIC"; /* not useful */ + } + + if ('A' == 0x41) { + return "ISO8859-1"; /* not necessarily true */ + } + + return "unknown"; +} + + +APR_DECLARE(const char*) apr_os_locale_encoding (apr_pool_t *pool) +{ +#if defined(HAVE_NL_LANGINFO) && defined(HAVE_CODESET) + const char *charset; + + charset = nl_langinfo(CODESET); + if (charset) { + return charset; + } +#endif + + return apr_os_default_encoding(pool); +} diff --git a/misc/win32/charset.c b/misc/win32/charset.c new file mode 100644 index 00000000000..958d113c9d4 --- /dev/null +++ b/misc/win32/charset.c @@ -0,0 +1,81 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_strings.h" +#include "apr_portable.h" + + +APR_DECLARE(const char*) apr_os_default_encoding (apr_pool_t *pool) +{ + return apr_psprintf(pool, "CP%u", (unsigned) GetACP()); +} + + +APR_DECLARE(const char*) apr_os_locale_encoding (apr_pool_t *pool) +{ + LCID locale = GetThreadLocale(); + int len = GetLocaleInfo(locale, LOCALE_IDEFAULTANSICODEPAGE, NULL, 0); + char *cp = apr_palloc(pool, len + 2); + if (0 < GetLocaleInfo(locale, LOCALE_IDEFAULTANSICODEPAGE, cp + 2, len)) + { + /* Fix up the returned number to make a valid codepage name of + the form "CPnnnn". */ + cp[0] = 'C'; + cp[1] = 'P'; + return cp; + } + + return apr_os_default_encoding(pool); +} From 5e947534549f2ca47180d5ac2e348d321985e09a Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 12 Nov 2002 04:24:51 +0000 Subject: [PATCH 3997/7878] Update free_proc_chain timeout algorithm from a static 3 second timeout to an exponentiallly growing timeout. PR: 7617 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64016 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++++++ memory/unix/apr_pools.c | 39 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index ec8edb344a1..e400da62d87 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,12 @@ Changes with APR 0.9.2 + *) Update timeout algorithm in free_proc_chain. If a subprocess + did not exit immediately, the thread would sleep for 3 seconds + before checking the subprocess exit status again. In a very + common case when the subprocess was an HTTP server CGI script, + the CGI script actually exited a fraction of a second into the 3 + second sleep, which effectively limited the server to serving one + CGI request every 3 seconds across a persistent connection. + [Bill Stoddard, Kai.Risku@arrak.fi] *) Update doxygen tags. [Justin Erenkrantz] diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 2a7fdf8fc39..5538b0269bf 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -86,6 +86,15 @@ #define BOUNDARY_INDEX 12 #define BOUNDARY_SIZE (1 << BOUNDARY_INDEX) +/* + * Timing constants for killing subprocesses + * There is a total 3-second delay between sending a SIGINT + * and sending of the final SIGKILL. + * TIMEOUT_INTERVAL should be set to TIMEOUT_USECS / 64 + * for the exponetial timeout alogrithm. + */ +#define TIMEOUT_USECS 3000000 +#define TIMEOUT_INTERVAL 46875 /* * Allocator @@ -2031,6 +2040,7 @@ static void free_proc_chain(struct process_chain *procs) */ struct process_chain *pc; int need_timeout = 0; + apr_time_t timeout_interval; if (!procs) return; /* No work. Whew! */ @@ -2071,9 +2081,32 @@ static void free_proc_chain(struct process_chain *procs) } } - /* Sleep only if we have to... */ - if (need_timeout) - apr_sleep(apr_time_from_sec(3)); + /* Sleep only if we have to. The sleep algorithm grows + * by a factor of two on each iteration. TIMEOUT_INTERVAL + * is equal to TIMEOUT_USECS / 64. + */ + if (need_timeout) { + timeout_interval = TIMEOUT_INTERVAL; + apr_sleep(timeout_interval); + } + while (need_timeout) { + need_timeout = 0; + /* check the status of the subprocesses */ + for (pc = procs; pc; pc = pc->next) { + if (pc->kill_how == APR_KILL_AFTER_TIMEOUT && + apr_proc_wait(pc->pid, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE) + pc->kill_how = APR_KILL_NEVER; /* subprocess has exited */ + else + need_timeout = 1; /* subprocess is still active */ + } + if (need_timeout) { + apr_sleep(timeout_interval); + timeout_interval *= 2; + if (timeout_interval >= TIMEOUT_USECS) { + break; + } + } + } /* OK, the scripts we just timed out for have had a chance to clean up * --- now, just get rid of them, and also clean up the system accounting From a5fbf44a8ce5ca1e8ce39839a0068a653a18f1f0 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 12 Nov 2002 08:45:18 +0000 Subject: [PATCH 3998/7878] Fix build on BSD/OS 4.0, where sys/sysctl.h needs other headers to be included first; only include this header on FreeBSD, since it's only used on FreeBSD by the include_hdrs_in_length() function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64017 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 650e33d791e..521ab533a71 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -60,7 +60,8 @@ #include "fileio.h" #endif /* APR_HAS_SENDFILE */ -#ifdef HAVE_SYS_SYSCTL_H +/* sys/sysctl.h is only needed on FreeBSD for include_hdrs_in_length() */ +#if defined(__FreeBSD__) && defined(HAVE_SYS_SYSCTL_H) #include #endif From 04a1e18f07a1e1b9e1af328317ab7fde172aaa4d Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 12 Nov 2002 21:22:53 +0000 Subject: [PATCH 3999/7878] Fix a couple of logic bugs: 1. The previous code was missing the last sleep cycle, thus we would wait only half the time we should have been waiting. 2. We were incorrectly setting the need_timeout flag if pc->kill_how was not APR_KILL_AFTER_TIMEOUT git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64018 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 5538b0269bf..568d3bd4e8d 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -2088,24 +2088,26 @@ static void free_proc_chain(struct process_chain *procs) if (need_timeout) { timeout_interval = TIMEOUT_INTERVAL; apr_sleep(timeout_interval); - } - while (need_timeout) { - need_timeout = 0; - /* check the status of the subprocesses */ - for (pc = procs; pc; pc = pc->next) { - if (pc->kill_how == APR_KILL_AFTER_TIMEOUT && - apr_proc_wait(pc->pid, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE) - pc->kill_how = APR_KILL_NEVER; /* subprocess has exited */ - else - need_timeout = 1; /* subprocess is still active */ - } - if (need_timeout) { - apr_sleep(timeout_interval); - timeout_interval *= 2; - if (timeout_interval >= TIMEOUT_USECS) { - break; + + do { + /* check the status of the subprocesses */ + need_timeout = 0; + for (pc = procs; pc; pc = pc->next) { + if (pc->kill_how == APR_KILL_AFTER_TIMEOUT) { + if (apr_proc_wait(pc->pid, NULL, NULL, APR_NOWAIT) == APR_CHILD_NOTDONE) + need_timeout = 1; /* subprocess is still active */ + else + pc->kill_how = APR_KILL_NEVER; /* subprocess has exited */ + } } - } + if (need_timeout) { + if (timeout_interval >= TIMEOUT_USECS) { + break; + } + apr_sleep(timeout_interval); + timeout_interval *= 2; + } + } while (need_timeout); } /* OK, the scripts we just timed out for have had a chance to clean up From 14c1ae701365f855114c8543d0d3ff379f0aee74 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 13 Nov 2002 23:47:30 +0000 Subject: [PATCH 4000/7878] add APR_IPV6_V6ONLY socket option git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64019 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_network_io.h | 3 +++ network_io/unix/sockopt.c | 14 ++++++++++++++ network_io/win32/sockopt.c | 14 ++++++++++++++ 4 files changed, 34 insertions(+) diff --git a/CHANGES b/CHANGES index e400da62d87..faba6328e6d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ Changes with APR 0.9.2 + + *) Add APR_IPV6_V6ONLY socket option. [Jeff Trawick] + *) Update timeout algorithm in free_proc_chain. If a subprocess did not exit immediately, the thread would sleep for 3 seconds before checking the subprocess exit status again. In a very diff --git a/include/apr_network_io.h b/include/apr_network_io.h index cd05cb63a87..30eaa97867a 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -130,6 +130,9 @@ extern "C" { #define APR_INCOMPLETE_WRITE 8192 /**< like APR_INCOMPLETE_READ, but for write * @see APR_INCOMPLETE_READ */ +#define APR_IPV6_V6ONLY 16384 /**< Don't accept IPv4 connections on an + * IPv6 listening socket. + */ /** @} */ diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 41ed14746eb..31024a8aa74 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -310,6 +310,20 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, if (opt & APR_INCOMPLETE_READ) { apr_set_option(&sock->netmask, APR_INCOMPLETE_READ, on); } + if (opt & APR_IPV6_V6ONLY) { +#if APR_HAVE_IPV6 && defined(IPV6_V6ONLY) + /* we don't know the initial setting of this option, + * so don't check/set sock->netmask since that optimization + * won't work + */ + if (setsockopt(sock->socketdes, IPPROTO_IPV6, IPV6_V6ONLY, + (void *)&on, sizeof(int)) == -1) { + return errno; + } +#else + return APR_ENOTIMPL; +#endif + } return APR_SUCCESS; } diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 53f633265a5..c326f9dae03 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -210,6 +210,20 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, apr_set_option(&sock->netmask, APR_TCP_NODELAY, on); } break; + case APR_IPV6_V6ONLY: +#if APR_HAVE_IPV6 && defined(IPV6_V6ONLY) + /* we don't know the initial setting of this option, + * so don't check/set sock->netmask since that optimization + * won't work + */ + if (setsockopt(sock->socketdes, IPPROTO_IPV6, IPV6_V6ONLY, + (void *)&on, sizeof(int)) == -1) { + return apr_get_netos_error(); + } +#else + return APR_ENOTIMPL; +#endif + break; default: return APR_EINVAL; break; From d984108a5a50365dce8040250a504dde7363fb6c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 14 Nov 2002 10:24:52 +0000 Subject: [PATCH 4001/7878] Fail gracefully if the apr_mmap_create call fails. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64020 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmmap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testmmap.c b/test/testmmap.c index bcd6ac4d580..7003552b5ad 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -120,6 +120,7 @@ static void test_mmap_create(CuTest *tc) static void test_mmap_contents(CuTest *tc) { + CuAssertPtrNotNull(tc, themmap); CuAssertPtrNotNull(tc, themmap->mm); CuAssertIntEquals(tc, themmap->size, 28); CuAssertStrEquals(tc, themmap->mm, "This is the MMAP data file.\n"); @@ -128,6 +129,8 @@ static void test_mmap_contents(CuTest *tc) static void test_mmap_delete(CuTest *tc) { apr_status_t rv; + + CuAssertPtrNotNull(tc, themmap); rv = apr_mmap_delete(themmap); CuAssertIntEquals(tc, rv, APR_SUCCESS); } @@ -137,6 +140,7 @@ static void test_mmap_offset(CuTest *tc) apr_status_t rv; void *addr; + CuAssertPtrNotNull(tc, themmap); rv = apr_mmap_offset(&addr, themmap, 5); CuAssertStrEquals(tc, addr, "This is the MMAP data file.\n" + 5); } From 7f6f33d5c0bbd2a1286b3e963c3bb759ee70f674 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 14 Nov 2002 12:03:43 +0000 Subject: [PATCH 4002/7878] Remove testdir and testfile from $(PROGRAMS) since they have been migrated to CuTest and hence no longer link by default. Remove redundant 'all' target which is overridden by 'all' from build.mk. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64021 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 8cb93d233c1..a9ba4796aea 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -10,8 +10,6 @@ PROGRAMS = \ client@EXEEXT@ \ sendfile@EXEEXT@ \ server@EXEEXT@ \ - testfile@EXEEXT@ \ - testdir@EXEEXT@ \ testnames@EXEEXT@ \ testflock@EXEEXT@ \ testproc@EXEEXT@ \ @@ -51,8 +49,6 @@ INCLUDES=-I$(INCDIR) CFLAGS=$(MY_CFLAGS) -all: $(PROGRAMS) $(NONPORTABLE) - check: $(PROGRAMS) $(NONPORTABLE) for prog in $(PROGRAMS) $(NONPORTABLE); do \ ./$$prog; \ From 9375db227b6b5c8ce7d1984efac4fedf1c1db16b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 14 Nov 2002 12:16:35 +0000 Subject: [PATCH 4003/7878] Change CuSuiteListDetails function to return the number of tests which failed. Use this in testall's main() to return a non-zero exit code iff any tests failed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64022 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 3 ++- test/CuTest.h | 4 +++- test/testall.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/CuTest.c b/test/CuTest.c index 7455116a5e8..d2fb7a98888 100644 --- a/test/CuTest.c +++ b/test/CuTest.c @@ -407,7 +407,7 @@ void CuSuiteListSummary(CuSuiteList* testSuite, CuString* summary) CuStringAppend(summary, "\n"); } -void CuSuiteListDetails(CuSuiteList* testSuite, CuString* details) +int CuSuiteListDetails(CuSuiteList* testSuite, CuString* details) { int i; int failCount = 0; @@ -453,5 +453,6 @@ void CuSuiteListDetails(CuSuiteList* testSuite, CuString* details) } } } + return failCount; } diff --git a/test/CuTest.h b/test/CuTest.h index 1c189126a77..b0ebe83ec19 100644 --- a/test/CuTest.h +++ b/test/CuTest.h @@ -130,6 +130,8 @@ void CuSuiteListAdd(CuSuiteList* testSuite, CuSuite *testCase); void CuSuiteListRun(CuSuiteList* testSuite); void CuSuiteListRunWithSummary(CuSuiteList* testSuite); void CuSuiteListSummary(CuSuiteList* testSuite, CuString* summary); -void CuSuiteListDetails(CuSuiteList* testSuite, CuString* details); +/* Print details of test suite results; returns total number of + * tests which failed. */ +int CuSuiteListDetails(CuSuiteList* testSuite, CuString* details); #endif /* CU_TEST_H */ diff --git a/test/testall.c b/test/testall.c index c025986eb3f..2706967ad0c 100644 --- a/test/testall.c +++ b/test/testall.c @@ -97,8 +97,8 @@ int main(int argc, char *argv[]) } CuSuiteListRunWithSummary(alltests); - CuSuiteListDetails(alltests, output); + i = CuSuiteListDetails(alltests, output); printf("%s\n", output->buffer); - return 0; + return i > 0 ? 1 : 0; } From d6d8c5f8a81065ce71987796a10b6cfbdbcd6e05 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 14 Nov 2002 12:25:56 +0000 Subject: [PATCH 4004/7878] Make global variables static where appropriate. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64023 13f79535-47bb-0310-9956-ffa450edef68 --- test/testall.c | 3 ++- test/testmmap.c | 8 ++++---- test/testpools.c | 4 ++-- test/testtable.c | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/test/testall.c b/test/testall.c index 2706967ad0c..d048dd3366b 100644 --- a/test/testall.c +++ b/test/testall.c @@ -59,11 +59,12 @@ #define NUM_TESTS 255 +/* Top-level pool which can be used by tests. */ apr_pool_t *p; typedef CuSuite *(testfunc)(void); -testfunc *tests[NUM_TESTS] = { +static testfunc *tests[NUM_TESTS] = { teststr, testtime, testvsn, diff --git a/test/testmmap.c b/test/testmmap.c index 7003552b5ad..3734def1ad4 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -73,10 +73,10 @@ static void not_implemented(CuTest *tc) #else -apr_mmap_t *themmap = NULL; -apr_file_t *thefile = NULL; -char *file1; -apr_finfo_t finfo; +static apr_mmap_t *themmap = NULL; +static apr_file_t *thefile = NULL; +static char *file1; +static apr_finfo_t finfo; static void create_filename(CuTest *tc) { diff --git a/test/testpools.c b/test/testpools.c index f416811a196..5da1f2b9e8a 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -67,8 +67,8 @@ #define ALLOC_BYTES 1024 -apr_pool_t *pmain = NULL; -apr_pool_t *pchild = NULL; +static apr_pool_t *pmain = NULL; +static apr_pool_t *pchild = NULL; static void alloc_bytes(CuTest *tc) { diff --git a/test/testtable.c b/test/testtable.c index a86dc68851b..6f89fdfb172 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -68,7 +68,7 @@ #include #endif -apr_table_t *t1 = NULL; +static apr_table_t *t1 = NULL; static void table_make(CuTest *tc) { From ab2cfdff8de4135f91c8c6f880dfc61a33a9ddff Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 14 Nov 2002 12:33:45 +0000 Subject: [PATCH 4005/7878] Remove "unused variable" warnings from GCC. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64024 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdir.c | 4 ---- test/testtable.c | 2 -- test/testtime.c | 1 - 3 files changed, 7 deletions(-) diff --git a/test/testdir.c b/test/testdir.c index 0fc58ab55f8..1d0d53581c2 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -112,7 +112,6 @@ static void test_remove(CuTest *tc) static void test_removeall_fail(CuTest *tc) { apr_status_t rv; - apr_finfo_t finfo; rv = apr_dir_remove("data/one", p); CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv)); @@ -121,7 +120,6 @@ static void test_removeall_fail(CuTest *tc) static void test_removeall(CuTest *tc) { apr_status_t rv; - apr_finfo_t finfo; rv = apr_dir_remove("data/one/two/three", p); CuAssertIntEquals(tc, APR_SUCCESS, rv); @@ -136,7 +134,6 @@ static void test_removeall(CuTest *tc) static void test_remove_notthere(CuTest *tc) { apr_status_t rv; - apr_finfo_t finfo; rv = apr_dir_remove("data/notthere", p); CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); @@ -145,7 +142,6 @@ static void test_remove_notthere(CuTest *tc) static void test_mkdir_twice(CuTest *tc) { apr_status_t rv; - apr_finfo_t finfo; rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); diff --git a/test/testtable.c b/test/testtable.c index 6f89fdfb172..b71c4f78a6d 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -78,7 +78,6 @@ static void table_make(CuTest *tc) static void table_get(CuTest *tc) { - apr_status_t rv; const char *val; apr_table_set(t1, "foo", "bar"); @@ -88,7 +87,6 @@ static void table_get(CuTest *tc) static void table_set(CuTest *tc) { - apr_status_t rv; const char *val; apr_table_set(t1, "setkey", "bar"); diff --git a/test/testtime.c b/test/testtime.c index 8ccab93f053..9dbfb18dfe7 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -251,7 +251,6 @@ static void test_exp_tz(CuTest *tc) apr_status_t rv; apr_time_exp_t xt; apr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */ - apr_time_exp_t expnow = { 186711, 36, 5, 14, 14, 8, 102, 6, 256, 0, -18000 }; rv = apr_time_exp_tz(&xt, now, hr_off); if (rv == APR_ENOTIMPL) { From b1954a45313f43f1678deb1291722347c60a7d87 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 14 Nov 2002 12:41:35 +0000 Subject: [PATCH 4006/7878] Fix location passed to apr_file_read in test_fileclose. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64025 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testfile.c b/test/testfile.c index f06f2092296..755c29098bb 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -143,14 +143,14 @@ static void test_filename(CuTest *tc) static void test_fileclose(CuTest *tc) { - char *str; + char str; apr_status_t rv; apr_size_t one = 1; rv = apr_file_close(filetest); CuAssertIntEquals(tc, rv, APR_SUCCESS); /* We just closed the file, so this should fail */ - rv = apr_file_read(filetest, str, &one); + rv = apr_file_read(filetest, &str, &one); CuAssertIntEquals(tc, APR_EBADF, rv); } From 4bda3f2eaa64c5a3de57f535930606f061658b8a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 14 Nov 2002 16:43:56 +0000 Subject: [PATCH 4007/7878] Cleanup: use AC_CACHE_CHECK and AC_DEFINE in check for netinet/tcp.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64026 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index 56bf5ca37e8..32ff4df3efa 100644 --- a/configure.in +++ b/configure.in @@ -953,18 +953,18 @@ APR_FLAG_HEADERS( # IRIX 6.5 has a problem in which prevents it from # being included by itself. Check for manually, # including another header file first. -AC_MSG_CHECKING(for netinet/tcp.h) -AC_TRY_CPP([ -#ifdef HAVE_NETINET_IN_H +AC_CACHE_CHECK([for netinet/tcp.h], [apr_cv_hdr_netinet_tcp_h], +[AC_TRY_CPP( +[#ifdef HAVE_NETINET_IN_H #include #endif #include -], netinet_tcph="1", netinet_tcph="0") -if test $netinet_tcph = 1; then - AC_MSG_RESULT(yes) - echo "#define HAVE_NETINET_TCP_H 1" >> confdefs.h +], [apr_cv_hdr_netinet_tcp_h=yes], [apr_cv_hdr_netinet_tcp_h=no])]) +if test "$apr_cv_hdr_netinet_tcp_h" = "yes"; then + netinet_tcph=1 + AC_DEFINE([HAVE_NETINET_TCP_H], 1, [Defined if netinet/tcp.h is present]) else - AC_MSG_RESULT(no) + netinet_tcph=0 fi AC_SUBST(arpa_ineth) From ec5e5a0240881df590bd90dbc3f0f5055cda3ae3 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 14 Nov 2002 18:07:14 +0000 Subject: [PATCH 4008/7878] Switch to passing three arguments to the AC_DEFINE macro where appropriate, removing the corresponding #undef's in acconfig.h. (use of accconfig.h is "deprecated and discouraged" in autoconf 2.5x) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64027 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 17 ----------------- build/apr_common.m4 | 4 ++-- configure.in | 43 ++++++++++++++++++++++++++----------------- 3 files changed, 28 insertions(+), 36 deletions(-) diff --git a/acconfig.h b/acconfig.h index 8f7a4d50a73..ae91a49c395 100644 --- a/acconfig.h +++ b/acconfig.h @@ -9,10 +9,7 @@ #undef HAVE_SEM_UNDO #undef HAVE_PTHREAD_PROCESS_SHARED #undef DEV_RANDOM -#undef HAVE_EGD #undef EGD_DEFAULT_SOCKET -#undef HAVE_TRUERAND -#undef HAVE_POLLIN #undef HAVE_isascii #undef HAVE_SO_ACCEPTFILTER #undef HAVE_MAP_ANON @@ -29,18 +26,6 @@ #undef FCNTL_IS_GLOBAL #undef FLOCK_IS_GLOBAL -#undef READDIR_IS_THREAD_SAFE -#undef GETHOSTBYNAME_IS_THREAD_SAFE -#undef GETHOSTBYADDR_IS_THREAD_SAFE -#undef STRERROR_R_RC_INT - -#undef HAVE_GMTOFF -#undef USE_THREADS - -#undef DSO_USE_DLFCN -#undef DSO_USE_SHL -#undef DSO_USE_DYLD - #undef SIZEOF_SSIZE_T #undef SIZEOF_SIZE_T #undef SIZEOF_OFF_T @@ -48,8 +33,6 @@ #undef HAVE_INT64_C -#undef HAVE_VLA - /* BeOS specific flag */ #undef HAVE_BONE_VERSION diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 4e48ecb931f..ba859bc926e 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -243,7 +243,7 @@ YES_IS_DEFINED done ]) if test "$ac_cv_define_$1" = "yes"; then - AC_DEFINE(HAVE_$1) + AC_DEFINE(HAVE_$1, 1, [Define if $1 is defined]) fi ]) @@ -469,7 +469,7 @@ main() ac_cv_strerror_r_rc_int=no ], [ ac_cv_strerror_r_rc_int=no ] ) if test "x$ac_cv_strerror_r_rc_int" = xyes; then - AC_DEFINE(STRERROR_R_RC_INT) + AC_DEFINE(STRERROR_R_RC_INT, 1, [Define if strerror returns int]) msg="int" else msg="pointer" diff --git a/configure.in b/configure.in index 32ff4df3efa..939cf6be739 100644 --- a/configure.in +++ b/configure.in @@ -506,7 +506,7 @@ else threads="1" pthreadh="1" pthreadser="1" - AC_DEFINE(USE_THREADS) ], [ + AC_DEFINE(USE_THREADS, 1, [Define if APR supports threads]) ], [ threads="0" pthreadh="0" pthreadser="0" @@ -567,18 +567,22 @@ ac_cv_define_GETHOSTBYNAME_IS_THREAD_SAFE=no ac_cv_define_GETHOSTBYADDR_IS_THREAD_SAFE=no if test "$threads" = "1"; then echo "APR will use threads" - AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE)) + AC_CHECK_LIB(c_r, readdir, + AC_DEFINE(READDIR_IS_THREAD_SAFE, 1, + [Define if readdir is thread safe])) if test "x$apr_gethostbyname_is_thread_safe" = "x"; then AC_CHECK_LIB(c_r, gethostbyname, apr_gethostbyname_is_thread_safe=yes) fi if test "$apr_gethostbyname_is_thread_safe" = "yes"; then - AC_DEFINE(GETHOSTBYNAME_IS_THREAD_SAFE) + AC_DEFINE(GETHOSTBYNAME_IS_THREAD_SAFE, 1, + [Define if gethostbyname is thread safe]) fi if test "x$apr_gethostbyaddr_is_thread_safe" = "x"; then AC_CHECK_LIB(c_r, gethostbyaddr, apr_gethostbyaddr_is_thread_safe=yes) fi if test "$apr_gethostbyaddr_is_thread_safe" = "yes"; then - AC_DEFINE(GETHOSTBYADDR_IS_THREAD_SAFE) + AC_DEFINE(GETHOSTBYADDR_IS_THREAD_SAFE, 1, + [Define if gethostbyaddr is thread safe]) fi AC_CHECK_FUNCS(gethostbyname_r gethostbyaddr_r) @@ -1310,9 +1314,9 @@ if test "$tempdso" = "no"; then aprdso="0" else case "$tempdso" in - dlfcn) AC_DEFINE(DSO_USE_DLFCN);; - shl) AC_DEFINE(DSO_USE_SHL);; - dyld) AC_DEFINE(DSO_USE_DYLD);; + dlfcn) AC_DEFINE(DSO_USE_DLFCN, 1, [Define if DSO support uses dlfcn.h]);; + shl) AC_DEFINE(DSO_USE_SHL, 1, [Define if DSO support uses shl_load]);; + dyld) AC_DEFINE(DSO_USE_DYLD, 1, [Define if DSO support uses dyld.h]);; esac aprdso="1" apr_modules="$apr_modules dso" @@ -1343,7 +1347,7 @@ APR_TRY_COMPILE_NO_WARNING([], ], vla_msg=yes, vla_msg=no ) AC_MSG_RESULT([$vla_msg]) if test "$vla_msg" = "yes"; then - AC_DEFINE(HAVE_VLA) + AC_DEFINE(HAVE_VLA, 1, [Define if C compiler supports VLA]) fi AC_CACHE_CHECK(struct rlimit,ac_cv_struct_rlimit,[ @@ -1567,7 +1571,8 @@ AC_SUBST(proclockglobal) AC_MSG_CHECKING(if Posix sems affect threads in the same process) if test "x$apr_posixsem_is_global" = "xyes"; then - AC_DEFINE(POSIXSEM_IS_GLOBAL) + AC_DEFINE(POSIXSEM_IS_GLOBAL, 1, + [Define if POSIX semaphores affect threads within the process]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -1575,7 +1580,8 @@ fi AC_MSG_CHECKING(if SysV sems affect threads in the same process) if test "x$apr_sysvsem_is_global" = "xyes"; then - AC_DEFINE(SYSVSEM_IS_GLOBAL) + AC_DEFINE(SYSVSEM_IS_GLOBAL, 1, + [Define if SysV semaphores affect threads within the process]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -1583,7 +1589,8 @@ fi AC_MSG_CHECKING(if fcntl locks affect threads in the same process) if test "x$apr_fcntl_is_global" = "xyes"; then - AC_DEFINE(FCNTL_IS_GLOBAL) + AC_DEFINE(FCNTL_IS_GLOBAL, 1, + [Define if fcntl locks affect threads within the process]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -1591,7 +1598,8 @@ fi AC_MSG_CHECKING(if flock locks affect threads in the same process) if test "x$apr_flock_is_global" = "xyes"; then - AC_DEFINE(FLOCK_IS_GLOBAL) + AC_DEFINE(FLOCK_IS_GLOBAL, 1, + [Define if flock locks affect threads within the process]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -1602,9 +1610,10 @@ AC_MSG_CHECKING(for entropy source) AC_ARG_WITH(egd, [ --with-egd[[=]] use egd-compatible socket], - [ AC_DEFINE(HAVE_EGD) + [ AC_DEFINE(HAVE_EGD, 1, [Define if EGD is supported]) if test "$withval" = "yes"; then - AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, ["/var/run/egd-pool","/dev/egd-pool","/etc/egd-pool","/etc/entropy"]) + AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, ["/var/run/egd-pool","/dev/egd-pool","/etc/egd-pool","/etc/entropy"], + [Define to list of paths to EGD sockets]) else AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, ["$withval"]) fi @@ -1619,7 +1628,7 @@ if test "$rand" != "1"; then if test "$apr_devrandom" = "yes"; then if test -r "/dev/random"; then - AC_DEFINE(DEV_RANDOM, [/dev/random]) + AC_DEFINE(DEV_RANDOM, [/dev/random], [Define to path of random device]) AC_MSG_RESULT(/dev/random) rand="1" elif test -r "/dev/arandom"; then @@ -1652,7 +1661,7 @@ if test "$rand" != "1"; then *) if test "$rand" != "1"; then if test "$ac_cv_lib_truerand_main" = "yes"; then - AC_DEFINE(HAVE_TRUERAND) + AC_DEFINE(HAVE_TRUERAND, 1, [Define if truerand is supported]) AC_MSG_RESULT(truerand) rand="1" else @@ -1673,7 +1682,7 @@ AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) if test "$ac_cv_struct_tm_gmtoff" = "yes"; then - AC_DEFINE(HAVE_GMTOFF) + AC_DEFINE(HAVE_GMTOFF, 1, [Define if struct tm has a tm_gmtoff field]) fi dnl ----------------------------- Checking for Networking Support From 8cb63d87f14516b370cdecd2d40fd80947c593be Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 14 Nov 2002 18:30:02 +0000 Subject: [PATCH 4009/7878] Have APR_CHECK_SIZEOF_EXTENDED and APR_CHECK_DEFINE pass the third argument to AC_DEFINE(_UNQUOTED); remove corresponding lines from acconfig.h. (dropping the third argument to APR_CHECK_DEFINE) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64028 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 18 ------------------ build/apr_common.m4 | 6 +++--- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/acconfig.h b/acconfig.h index ae91a49c395..3143dd62002 100644 --- a/acconfig.h +++ b/acconfig.h @@ -4,15 +4,9 @@ @TOP@ /* Various #defines we need to know about */ -#undef HAVE_LOCK_EX -#undef HAVE_F_SETLK -#undef HAVE_SEM_UNDO -#undef HAVE_PTHREAD_PROCESS_SHARED #undef DEV_RANDOM #undef EGD_DEFAULT_SOCKET #undef HAVE_isascii -#undef HAVE_SO_ACCEPTFILTER -#undef HAVE_MAP_ANON /* Cross process serialization techniques */ #undef USE_FLOCK_SERIALIZE @@ -26,20 +20,8 @@ #undef FCNTL_IS_GLOBAL #undef FLOCK_IS_GLOBAL -#undef SIZEOF_SSIZE_T -#undef SIZEOF_SIZE_T -#undef SIZEOF_OFF_T -#undef SIZEOF_PID_T - #undef HAVE_INT64_C -/* BeOS specific flag */ -#undef HAVE_BONE_VERSION - -/* Does this system have a corkable TCP? */ -#undef HAVE_TCP_CORK -#undef HAVE_TCP_NOPUSH - @BOTTOM@ /* Make sure we have ssize_t defined to be something */ diff --git a/build/apr_common.m4 b/build/apr_common.m4 index ba859bc926e..963ef9db72d 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -249,7 +249,7 @@ YES_IS_DEFINED dnl -dnl APR_CHECK_DEFINE( symbol, header_file [, description ]) +dnl APR_CHECK_DEFINE(symbol, header_file) dnl AC_DEFUN(APR_CHECK_DEFINE,[ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ @@ -261,7 +261,7 @@ YES_IS_DEFINED ], ac_cv_define_$1=yes, ac_cv_define_$1=no) ]) if test "$ac_cv_define_$1" = "yes"; then - AC_DEFINE(HAVE_$1, 1, [$3]) + AC_DEFINE(HAVE_$1, 1, [Define if $1 is defined in $2]) fi ]) @@ -398,7 +398,7 @@ main() }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$3],,, AC_CV_NAME=$3))])dnl AC_MSG_RESULT($AC_CV_NAME) -AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) +AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The size of ]$2) undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl ]) From 18891e1364971b194a5e161068420a26f34c02ec Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 14 Nov 2002 19:55:00 +0000 Subject: [PATCH 4010/7878] - define DEV_RANDOM as a string literal so it doesn't have to be converted into one later. - remove DEV_RANDOM from acconfig.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64029 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 1 - configure.in | 8 ++++---- misc/unix/rand.c | 6 +----- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/acconfig.h b/acconfig.h index 3143dd62002..416624bd596 100644 --- a/acconfig.h +++ b/acconfig.h @@ -4,7 +4,6 @@ @TOP@ /* Various #defines we need to know about */ -#undef DEV_RANDOM #undef EGD_DEFAULT_SOCKET #undef HAVE_isascii diff --git a/configure.in b/configure.in index 939cf6be739..2c1bc8448a8 100644 --- a/configure.in +++ b/configure.in @@ -1628,21 +1628,21 @@ if test "$rand" != "1"; then if test "$apr_devrandom" = "yes"; then if test -r "/dev/random"; then - AC_DEFINE(DEV_RANDOM, [/dev/random], [Define to path of random device]) + AC_DEFINE_UNQUOTED(DEV_RANDOM, ["/dev/random"], [Define to path of random device]) AC_MSG_RESULT(/dev/random) rand="1" elif test -r "/dev/arandom"; then - AC_DEFINE(DEV_RANDOM, [/dev/arandom]) + AC_DEFINE_UNQUOTED(DEV_RANDOM, ["/dev/arandom"]) AC_MSG_RESULT(/dev/arandom) rand="1" elif test -r "/dev/urandom"; then - AC_DEFINE(DEV_RANDOM, [/dev/urandom]) + AC_DEFINE_UNQUOTED(DEV_RANDOM, ["/dev/urandom"]) AC_MSG_RESULT(/dev/urandom) rand="1" fi elif test "$apr_devrandom" != "no"; then if test -r "$apr_devrandom"; then - AC_DEFINE(DEV_RANDOM, [$apr_devrandom]) + AC_DEFINE_UNQUOTED(DEV_RANDOM, ["$apr_devrandom"]) AC_MSG_RESULT($apr_devrandom) rand="1" else diff --git a/misc/unix/rand.c b/misc/unix/rand.c index b44a3f9646c..3ecb3726348 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -76,10 +76,6 @@ #if APR_HAS_RANDOM -/* This tells the preprocessor to put quotes around the value. */ -#define XSTR(x) #x -#define STR(x) XSTR(x) - APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, int length) { @@ -88,7 +84,7 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, int rnd, rc; apr_size_t got, tot; - if ((rnd = open(STR(DEV_RANDOM), O_RDONLY)) == -1) + if ((rnd = open(DEV_RANDOM, O_RDONLY)) == -1) return errno; for (tot=0; tot Date: Thu, 14 Nov 2002 20:29:58 +0000 Subject: [PATCH 4011/7878] Add back USE_THREADS and DEV_RANDOM to fix build with autoconf 2.13. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64030 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/acconfig.h b/acconfig.h index 416624bd596..07509d9f118 100644 --- a/acconfig.h +++ b/acconfig.h @@ -4,6 +4,8 @@ @TOP@ /* Various #defines we need to know about */ +#undef USE_THREADS +#undef DEV_RANDOM #undef EGD_DEFAULT_SOCKET #undef HAVE_isascii From 787d1f5e54999cbb9719399adac10f81a1fcaf47 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 14 Nov 2002 21:13:42 +0000 Subject: [PATCH 4012/7878] Advertise the ability to disable DSO support, not an "--enable-dso" flag which will break the build on many platforms unless used correctly. (e.g. simply "./configure --enable-dso" doesn't do the right thing) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64031 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 2c1bc8448a8..eeb44ab6b6d 100644 --- a/configure.in +++ b/configure.in @@ -1272,7 +1272,7 @@ AC_SUBST(int64_strfn) dnl ----------------------------- Checking for DSO support echo $ac_n "${nl}Checking for DSO...${nl}" AC_ARG_ENABLE(dso, - [ --enable-dso Enable dso support ], + [ --disable-dso Disable DSO support ], [ tempdso=$enableval], [ AC_CHECK_FUNCS(NSLinkModule, [ tempdso="dyld" ], [ tempdso="no" ]) From c5fa0a17307014e3c8bfa215d7ace05e2c04e7d7 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 14 Nov 2002 21:26:59 +0000 Subject: [PATCH 4013/7878] Need to default to the standard open() call for NetWare when the returned statCache is NULL git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64032 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 80268be1a4f..dfbd810e62f 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -105,7 +105,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, #ifdef NETWARE apr_hash_t *statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor); - apr_stat_entry_t *stat_entry; + apr_stat_entry_t *stat_entry = NULL; #endif (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); @@ -170,7 +170,9 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, #endif #ifdef NETWARE - stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, fname, APR_HASH_KEY_STRING); + if (statCache) { + stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, fname, APR_HASH_KEY_STRING); + } if (stat_entry) { errno = NXFileOpen (stat_entry->pathCtx, stat_entry->casedName, oflags, &(*new)->filedes); } From 9ad4fb982988804b9521f721aeb2dc28f10ece7e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 14 Nov 2002 21:45:34 +0000 Subject: [PATCH 4014/7878] Prevent test for C99 variable length arrays from failing with GCC if CPPFLAGS contains -Wall (e.g. if --enable-maintainer-mode is used). GCC gave warnings for the unused variable and lack of atoi prototype with -Wall. PR: 13036 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64033 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index eeb44ab6b6d..23b77c009e1 100644 --- a/configure.in +++ b/configure.in @@ -1343,7 +1343,8 @@ AC_SUBST(oc) AC_MSG_CHECKING(for Variable Length Arrays) APR_TRY_COMPILE_NO_WARNING([], [ - int foo[atoi(argv[1])]; + int foo[argc]; + foo[0] = 0; ], vla_msg=yes, vla_msg=no ) AC_MSG_RESULT([$vla_msg]) if test "$vla_msg" = "yes"; then From 0644b93a5dcc0906b8a24c25564dff610abd2540 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 14 Nov 2002 23:52:56 +0000 Subject: [PATCH 4015/7878] Simplify logic of /dev/*random search, reducing to a single AC_DEFINE expansion for the DEV_RANDOM variable. This allows the removal of DEV_RANDOM from acconfig.h even with autoheader 2.13. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64034 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 1 - configure.in | 27 ++++++++++++--------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/acconfig.h b/acconfig.h index 07509d9f118..c0f25434e44 100644 --- a/acconfig.h +++ b/acconfig.h @@ -5,7 +5,6 @@ /* Various #defines we need to know about */ #undef USE_THREADS -#undef DEV_RANDOM #undef EGD_DEFAULT_SOCKET #undef HAVE_isascii diff --git a/configure.in b/configure.in index 23b77c009e1..070454370c5 100644 --- a/configure.in +++ b/configure.in @@ -1628,28 +1628,25 @@ if test "$rand" != "1"; then [ apr_devrandom="$withval" ], [ apr_devrandom="yes" ]) if test "$apr_devrandom" = "yes"; then - if test -r "/dev/random"; then - AC_DEFINE_UNQUOTED(DEV_RANDOM, ["/dev/random"], [Define to path of random device]) - AC_MSG_RESULT(/dev/random) - rand="1" - elif test -r "/dev/arandom"; then - AC_DEFINE_UNQUOTED(DEV_RANDOM, ["/dev/arandom"]) - AC_MSG_RESULT(/dev/arandom) - rand="1" - elif test -r "/dev/urandom"; then - AC_DEFINE_UNQUOTED(DEV_RANDOM, ["/dev/urandom"]) - AC_MSG_RESULT(/dev/urandom) - rand="1" - fi + for f in /dev/random /dev/arandom /dev/urandom; do + if test -r $f; then + apr_devrandom=$f + rand=1 + break + fi + done elif test "$apr_devrandom" != "no"; then if test -r "$apr_devrandom"; then - AC_DEFINE_UNQUOTED(DEV_RANDOM, ["$apr_devrandom"]) - AC_MSG_RESULT($apr_devrandom) rand="1" else AC_ERROR([$apr_devrandom not found or unreadable.]) fi fi + + if test "$rand" = "1"; then + AC_DEFINE_UNQUOTED(DEV_RANDOM, ["$apr_devrandom"], [Define to path of random device]) + AC_MSG_RESULT([$apr_devrandom]) + fi fi if test "$rand" != "1"; then From 565e73211cca2fcbbac102a328578ec1cffa72da Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 14 Nov 2002 23:59:40 +0000 Subject: [PATCH 4016/7878] Remove a stale comment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64035 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/misc.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index e5926b5b335..05804781938 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -76,7 +76,6 @@ #include #endif -/* ### create APR_HAVE_* macros for these? */ #if APR_HAVE_STDLIB_H #include #endif From 0d3a367f6651320a71fd5964d9249d755c099729 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 15 Nov 2002 00:58:05 +0000 Subject: [PATCH 4017/7878] Cleanup: passing -n to echo to suppress the trailing newline and including a trailing newline is redundant. $ac_n doesn't exist in autoconf 2.5x either. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64036 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/configure.in b/configure.in index 070454370c5..7eda4c84423 100644 --- a/configure.in +++ b/configure.in @@ -197,7 +197,7 @@ AC_SUBST(lib_target_libs) dnl ----------------------------- Checks for compiler flags nl=' ' -echo $ac_n "${nl}Check for compiler flags...${nl}" +echo "${nl}Check for compiler flags..." dnl AC_PROG_CC sets -g in CFLAGS (and -O2 for gcc) by default. dnl On OS/390 this causes the compiler to insert extra debugger @@ -482,7 +482,7 @@ AC_CHECK_LIB(truerand, main) AC_CHECK_LIB(m, modf) dnl ----------------------------- Checking for Threads -echo $ac_n "${nl}Checking for Threads...${nl}" +echo "${nl}Checking for Threads..." if test -z "$enable_threads"; then AC_ARG_ENABLE(threads, @@ -615,7 +615,7 @@ dnl ----------------------------- Checking for missing POSIX thread functions AC_CHECK_FUNCS([getpwnam_r getpwuid_r getgrnam_r getgrgid_r]) dnl ----------------------------- Checking for Shared Memory Support -echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" +echo "${nl}Checking for Shared Memory Support..." # The Posix function are in librt on Solaris. This will # also help us find sem_open when doing locking below @@ -1270,7 +1270,7 @@ AC_SUBST(have_int64_strfn) AC_SUBST(int64_strfn) dnl ----------------------------- Checking for DSO support -echo $ac_n "${nl}Checking for DSO...${nl}" +echo "${nl}Checking for DSO..." AC_ARG_ENABLE(dso, [ --disable-dso Disable DSO support ], [ tempdso=$enableval], @@ -1325,7 +1325,7 @@ fi AC_SUBST(aprdso) dnl ----------------------------- Checking for Processes -echo $ac_n "${nl}Checking for Processes...${nl}" +echo "${nl}Checking for Processes..." AC_CHECK_FUNCS(waitpid) @@ -1371,7 +1371,7 @@ test "x$ac_cv_struct_rlimit" = xyes && struct_rlimit=1 AC_SUBST(struct_rlimit) dnl ----------------------------- Checking for Locking Characteristics -echo $ac_n "${nl}Checking for Locking...${nl}" +echo "${nl}Checking for Locking..." AC_CHECK_FUNCS(semget semctl flock) AC_CHECK_HEADERS(semaphore.h) @@ -1673,7 +1673,7 @@ fi AC_SUBST(rand) dnl ----------------------------- Checking for Time Support -echo $ac_n "${nl}Checking for Time Support...${nl}" +echo "${nl}Checking for Time Support..." AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, [AC_TRY_COMPILE([#include #include ], [struct tm tm; tm.tm_gmtoff;], @@ -1684,7 +1684,7 @@ if test "$ac_cv_struct_tm_gmtoff" = "yes"; then fi dnl ----------------------------- Checking for Networking Support -echo $ac_n "${nl}Checking for Networking support...${nl}" +echo "${nl}Checking for Networking support..." AC_MSG_CHECKING(for in_addr in netinet/in.h) AC_TRY_COMPILE([ #include @@ -1765,7 +1765,7 @@ AC_SUBST(have_sctp) AC_CHECK_FUNCS(set_h_errno) APR_CHECK_RESOLV_RETRANS -echo $ac_n "${nl}Checking for IPv6 Networking support...${nl}" +echo "${nl}Checking for IPv6 Networking support..." dnl Start of checking for IPv6 support... AC_ARG_ENABLE(ipv6, @@ -1824,7 +1824,7 @@ AC_SUBST(have_ipv6) dnl ----------------------------- Finalize the variables -echo $ac_n "${nl}Restore user-defined environment settings...${nl}" +echo "${nl}Restore user-defined environment settings..." APR_RESTORE_THE_ENVIRONMENT(CPPFLAGS, EXTRA_) APR_RESTORE_THE_ENVIRONMENT(CFLAGS, EXTRA_) From 14f8529d6894a247e6b805daaa64b72b0626f6c4 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 15 Nov 2002 01:20:52 +0000 Subject: [PATCH 4018/7878] Fix parse error from Solaris make. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64037 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index a9ba4796aea..5d09767cd87 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -4,7 +4,7 @@ VPATH = @srcdir@ NONPORTABLE = \ testshm@EXEEXT@ \ testprocmutex@EXEEXT@ \ - testglobalmutex@EXEEXT@ \ + testglobalmutex@EXEEXT@ PROGRAMS = \ client@EXEEXT@ \ From 2135aee35e70292d469532549055bf875987fb89 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 15 Nov 2002 11:32:13 +0000 Subject: [PATCH 4019/7878] Use "DIR" rather than "" as argument value in --with-* help texts, for consistency. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64038 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 7eda4c84423..dbee0e6c463 100644 --- a/configure.in +++ b/configure.in @@ -149,7 +149,7 @@ AC_PROG_LIBTOOL ;; esac -AC_ARG_WITH(installbuilddir, [ --with-installbuilddir= location to store APR build files (defaults to '${datadir}/build')], +AC_ARG_WITH(installbuilddir, [ --with-installbuilddir=DIR location to store APR build files (defaults to '${datadir}/build')], [ installbuilddir=$withval ], [ installbuilddir="${datadir}/build" ] ) AC_SUBST(installbuilddir) @@ -1610,7 +1610,7 @@ dnl ----------------------------- Checking for /dev/random AC_MSG_CHECKING(for entropy source) AC_ARG_WITH(egd, - [ --with-egd[[=]] use egd-compatible socket], + [ --with-egd[[=DIR]] use EGD-compatible socket], [ AC_DEFINE(HAVE_EGD, 1, [Define if EGD is supported]) if test "$withval" = "yes"; then AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, ["/var/run/egd-pool","/dev/egd-pool","/etc/egd-pool","/etc/entropy"], From 4658110517302c73113c5cb946af95ff1c6f3b1a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Sat, 16 Nov 2002 00:31:43 +0000 Subject: [PATCH 4020/7878] Implemented the new OS language API for NetWare. This is a temporary implementation just to get it building again. The real implementation will come later. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64039 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 + misc/netware/charset.c | 72 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 misc/netware/charset.c diff --git a/NWGNUmakefile b/NWGNUmakefile index 5d147fc8ddc..28032e28b64 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -247,6 +247,7 @@ FILES_lib_objs = \ $(OBJDIR)/apr_strnatcmp.o \ $(OBJDIR)/apr_strtok.o \ $(OBJDIR)/apr_tables.o \ + $(OBJDIR)/charset.o \ $(OBJDIR)/copy.o \ $(OBJDIR)/common.o \ $(OBJDIR)/dir.o \ diff --git a/misc/netware/charset.c b/misc/netware/charset.c new file mode 100644 index 00000000000..90c69731c94 --- /dev/null +++ b/misc/netware/charset.c @@ -0,0 +1,72 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_strings.h" +#include "apr_portable.h" + +/* static struct utsname sysinfo; */ + +/* XXX This needs to be fixed to produce the correct system language */ + +APR_DECLARE(const char*) apr_os_default_encoding (apr_pool_t *pool) +{ + return apr_pstrdup(pool, "CP1252"); +} + + +APR_DECLARE(const char*) apr_os_locale_encoding (apr_pool_t *pool) +{ + return apr_os_default_encoding(pool); +} From f8f1c25f1584b9777750fb452bf78b5c74e0c797 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Mon, 18 Nov 2002 01:59:03 +0000 Subject: [PATCH 4021/7878] Rip out buggy nested-mutex code from apr_proc_mutex. This should fix subtle problems on MP boxes (Linux in particular). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64040 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/proc_mutex.h | 7 ---- locks/unix/proc_mutex.c | 61 ++-------------------------------- 2 files changed, 3 insertions(+), 65 deletions(-) diff --git a/include/arch/unix/proc_mutex.h b/include/arch/unix/proc_mutex.h index 580e1e3911e..09a887570f5 100644 --- a/include/arch/unix/proc_mutex.h +++ b/include/arch/unix/proc_mutex.h @@ -160,13 +160,6 @@ struct apr_proc_mutex_t { #if APR_HAS_PROC_PTHREAD_SERIALIZE pthread_mutex_t *pthread_interproc; #endif -#if APR_HAS_THREADS - /* APR doesn't have threads, no sense in having a thread lock mechanism. - */ - - apr_os_thread_t owner; - int owner_ref; -#endif }; void apr_proc_mutex_unix_setup_lock(void); diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index a2d2fbcc442..24e1da7a9f9 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -882,72 +882,17 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) { - apr_status_t rv; - -#if APR_HAS_THREADS - if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { - mutex->owner_ref++; - return APR_SUCCESS; - } -#endif - - if ((rv = mutex->meth->acquire(mutex)) != APR_SUCCESS) { - return rv; - } - -#if APR_HAS_THREADS - mutex->owner = apr_os_thread_current(); - mutex->owner_ref = 1; -#endif - - return APR_SUCCESS; + return mutex->meth->acquire(mutex); } APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) { - apr_status_t rv; - -#if APR_HAS_THREADS - if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { - mutex->owner_ref++; - return APR_SUCCESS; - } -#endif - - if ((rv = mutex->meth->tryacquire(mutex)) != APR_SUCCESS) { - return rv; - } - -#if APR_HAS_THREADS - mutex->owner = apr_os_thread_current(); - mutex->owner_ref = 1; -#endif - - return APR_SUCCESS; + return mutex->meth->tryacquire(mutex); } APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) { - apr_status_t rv; - -#if APR_HAS_THREADS - if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { - mutex->owner_ref--; - if (mutex->owner_ref > 0) - return APR_SUCCESS; - } -#endif - - if ((rv = mutex->meth->release(mutex)) != APR_SUCCESS) { - return rv; - } - -#if APR_HAS_THREADS - memset(&mutex->owner, 0, sizeof mutex->owner); - mutex->owner_ref = 0; -#endif - - return APR_SUCCESS; + return mutex->meth->release(mutex); } APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) From cdf5b6e0cba96f7db39e5494dc21b54117242858 Mon Sep 17 00:00:00 2001 From: Thom May Date: Tue, 19 Nov 2002 01:04:01 +0000 Subject: [PATCH 4022/7878] Add and update apr_rename.pl to the latest set of renames Obtained From: Doug MacEachern git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64041 13f79535-47bb-0310-9956-ffa450edef68 --- helpers/apr_rename.pl | 340 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 340 insertions(+) create mode 100755 helpers/apr_rename.pl diff --git a/helpers/apr_rename.pl b/helpers/apr_rename.pl new file mode 100755 index 00000000000..642ea820799 --- /dev/null +++ b/helpers/apr_rename.pl @@ -0,0 +1,340 @@ +#!/usr/bin/perl -w +use strict; +use ExtUtils::MakeMaker qw(prompt); +use File::Find; + +my $just_check = @ARGV ? $ARGV[0] eq '-c' : 0; +shift if $just_check; +my $dir = shift || '.'; +my %names; + +my $prefix = 'apr_'; + +while () { + chomp; + my($old, $new) = grep { s/^$prefix//o } split; + next unless $old and $new; + $names{$old} = $new; +} + +my $pattern = join '|', keys %names; +#print "replacement pattern=$pattern\n"; + +find sub { + chomp; + return unless /\.[ch]$/; + my $file = "$File::Find::dir/$_"; + print "looking in $file\n"; + + replace($_, !$just_check); + +}, $dir; + +sub replace { + my($file, $replace) = @_; + local *IN, *OUT; + my @lines; + my $found = 0; + + open IN, $file or die "open $file: $!"; + + while () { + for (m/[^_\"]*$prefix($pattern)\b/og) { + $found++; + print " $file:$. apr_$_ -> apr_$names{$_}\n"; + } + push @lines, $_ if $replace; + } + + close IN; + + return unless $found and $replace; + +# my $ans = prompt("replace?", 'y'); +# return unless $ans =~ /^y/i; + + open OUT, ">$file" or die "open $file: $!"; + + for (@lines) { + unless (/^\#include/) { + s/([^_\"]*$prefix)($pattern)\b/$1$names{$2}/og; + } + print OUT $_; + } + + close OUT; +} + +__DATA__ +apr_pollfd_t: +apr_add_poll_socket apr_poll_socket_add +apr_clear_poll_sockets apr_poll_socket_clear +apr_get_polldata apr_poll_data_get +apr_get_revents apr_poll_revents_get +apr_mask_poll_socket apr_poll_socket_mask +apr_remove_poll_socket apr_poll_socket_remove +apr_set_polldata apr_poll_data_set +apr_setup_poll apr_poll_setup + +apr_time_t: +apr_now apr_time_now +apr_implode_gmt apr_time_exp_gmt_get + +apr_array_header_t: +apr_append_arrays apr_array_append +apr_copy_array apr_array_copy +apr_copy_array_hdr apr_array_copy_hdr +apr_make_array apr_array_make +apr_push_array apr_array_push + +apr_socket_t: +apr_close_socket apr_socket_close +apr_create_socket apr_socket_create +apr_get_sockaddr apr_socket_addr_get +apr_get_socketdata apr_socket_data_get +apr_set_socketdata apr_socket_data_set +apr_shutdown apr_socket_shutdown +apr_bind apr_socket_bind +apr_listen apr_socket_listen +apr_accept apr_socket_accept +apr_connect apr_socket_connect +apr_send apr_socket_send +apr_sendv apr_socket_sendv +apr_sendto apr_socket_sendto +apr_recvfrom apr_socket_recvfrom +apr_sendfile apr_socket_sendfile +apr_recv apr_socket_recv + + + +apr_sockaddr_t: +apr_getaddrinfo apr_sockaddr_info_get +apr_get_ipaddr apr_sockaddr_ip_get +apr_set_ipaddr apr_sockaddr_ip_set +apr_set_port apr_sockaddr_port_set +apr_get_port apr_sockaddr_port_get + +apr_pool_t: +apr_create_pool apr_pool_create +apr_destroy_pool apr_pool_destroy +apr_get_userdata apr_pool_userdata_get +apr_set_userdata apr_pool_userdata_set +apr_kill_cleanup apr_pool_cleanup_kill +apr_run_cleanup apr_pool_cleanup_run +apr_null_cleanup apr_pool_cleanup_null +apr_register_cleanup apr_pool_cleanup_register +apr_make_sub_pool apr_pool_sub_make +apr_note_subprocess apr_pool_note_subprocess +apr_bytes_in_pool apr_pool_num_bytes +apr_bytes_in_free_blocks apr_pool_free_blocks_num_bytes +apr_cleanup_for_exec apr_pool_cleanup_for_exec +apr_init_alloc apr_pool_alloc_init +apr_term_alloc apr_pool_alloc_term + +apr_lock_t: +apr_child_init_lock apr_lock_child_init +apr_create_lock apr_lock_create +apr_destroy_lock apr_lock_destroy +apr_get_lockdata apr_lock_data_get +apr_set_lockdata apr_lock_data_set +apr_lock apr_lock_aquire +apr_unlock apr_lock_release + +apr_table_: +apr_clear_table apr_table_clear +apr_copy_table apr_table_copy +apr_make_table apr_table_make +apr_overlap_tables apr_table_overlap +apr_overlay_tables apr_table_overlay + +apr_file_t: +apr_open apr_file_open +apr_close apr_file_close +apr_create_namedpipe apr_file_namedpipe_create +apr_create_pipe apr_file_pipe_create +apr_dupfile apr_file_dup +apr_flush apr_file_flush +apr_eof apr_file_eof +apr_ferror apr_file_error +apr_fgets apr_file_gets +apr_fprintf apr_file_printf +apr_full_read apr_file_read_file +apr_full_write apr_file_write_full +apr_getc apr_file_getc +apr_ungetc apr_file_ungetc +apr_putc apr_file_putc +apr_puts apr_file_puts +apr_read apr_file_read +apr_write apr_file_write +apr_writev apr_file_writev +apr_seek apr_file_seek +apr_get_filedata apr_file_data_get +apr_getfileinfo apr_file_info_get +apr_get_filename apr_file_name_get +apr_get_file_pool apr_file_pool_get +apr_get_pipe_timeout apr_file_pipe_timeout_get +apr_set_pipe_timeout apr_file_pipe_timeout_set +apr_lock_file apr_file_lock +apr_unlock_file apr_file_unlock +apr_open_stderr apr_file_open_stderr +apr_open_stdout apr_file_open_stdout +apr_remove_file apr_file_remove +apr_rename_file apr_file_rename +apr_set_filedata apr_file_data_set +apr_setfileperms apr_file_perms_set + +apr_filepath_*: +apr_filename_of_pathname apr_filepath_name_get + +apr_procattr_t: +apr_createprocattr_init apr_procattr_create +apr_setprocattr_childerr apr_procattr_child_err_set +apr_setprocattr_childin apr_procattr_child_in_set +apr_setprocattr_childout apr_procattr_child_out_set +apr_setprocattr_cmdtype apr_procattr_cmdtype_set +apr_setprocattr_detach apr_procattr_detach_set +apr_setprocattr_dir apr_procattr_dir_set +apr_setprocattr_io apr_procattr_io_set +apr_setprocattr_limit apr_procattr_limit_set + +apr_proc_t: +apr_create_process apr_proc_create +apr_fork apr_proc_fork +apr_kill apr_proc_kill +apr_probe_writable_fds apr_proc_probe_writable_fds +apr_reap_other_child apr_proc_other_child_read +apr_register_other_child apr_proc_other_child_register +apr_unregister_other_child apr_proc_other_child_unregister +apr_check_other_child apr_proc_other_child_check +apr_wait_all_procs apr_proc_wait_all_procs +apr_wait_proc apr_proc_wait +apr_detach apr_proc_detach + +apr_thread_t: +apr_create_thread apr_thread_create +apr_get_threaddata apr_thread_data_get +apr_set_threaddata apr_thread_data_set +apr_thread_detach apr_thread_detach + +apr_threadkey_t: +apr_get_threadkeydata apr_threadkey_data_get +apr_set_threadkeydata apr_threadkey_data_set +apr_create_thread_private apr_threadkey_private_create +apr_delete_thread_private apr_threadkey_private_delete +apr_get_thread_private apr_threadkey_private_get +apr_set_thread_private apr_threadkey_private_set + +apr_threadatt_t: +apr_create_threadattr apr_threadattr_create +apr_getthreadattr_detach apr_threadattr_detach_set +apr_setthreadattr_detach apr_threadattr_detach_get + +apr_dir_t: +apr_make_dir apr_dir_make +apr_remove_dir apr_dir_remove + +apr_gid_t: +apr_get_groupid apr_gid_get +apr_get_groupname apr_gid_name_get +apr_group_name_get apr_gid_name_get +apr_compare_groups apr_gid_compare + +apr_uuid_t: +apr_format_uuid apr_uuid_format +apr_get_uuid apr_uuid_get +apr_parse_uuid apr_uuid_parse + +apr_uid_t: +apr_get_home_directory apr_uid_homepath_get +apr_get_userid apr_uid_get +apr_current_userid apr_uid_current +apr_compare_users apr_uid_compare +apr_get_username apr_uid_name_get +apr_compare_users apr_uid_compare + +apr_shmem_t: +apr_get_shm_name apr_shm_name_get +apr_set_shm_name apr_shm_name_set +apr_open_shmem apr_shm_open + +apr_hash_t: +apr_make_hash apr_hash_make +apr_getpass apr_password_get +apr_validate_password apr_password_validate +apr_generic_hook_get apr_hook_generic_get +apr_hook_generic apr_hook_generic_add + +apr_bucket_*: +apr_bucket_copy_notimpl apr_bucket_notimpl_copy +apr_bucket_copy_shared apr_bucket_shared_copy +apr_bucket_create_eos apr_bucket_eos_create +apr_bucket_create_file apr_bucket_file_create +apr_bucket_create_flush apr_bucket_flush_create +apr_bucket_create_heap apr_bucket_heap_create +apr_bucket_create_immortal apr_bucket_immortal_create +apr_bucket_create_mmap apr_bucket_mmap_create +apr_bucket_create_pipe apr_bucket_pipe_creat +apr_bucket_create_pool apr_bucket_pool_create +apr_bucket_create_socket apr_bucket_socket_create +apr_bucket_create_transient apr_bucket_transient_create +apr_bucket_destroy_notimpl apr_bucket_notimpl_destroy +apr_bucket_destroy_shared apr_bucket_shared_destroy +apr_bucket_make_eos apr_bucket_eos_make +apr_bucket_make_file apr_bucket_file_make +apr_bucket_make_flush apr_bucket_flush_make +apr_bucket_make_heap apr_bucket_heap_make +apr_bucket_make_immortal apr_bucket_immortal_make +apr_bucket_make_mmap apr_bucket_mmap_make +apr_bucket_make_pipe apr_bucket_pipe_make +apr_bucket_make_pool apr_bucket_pool_make +apr_bucket_make_shared apr_bucket_shared_make +apr_bucket_make_socket apr_bucket_socket_make +apr_bucket_make_transient apr_bucket_transient_make +apr_bucket_setaside_notimpl apr_bucket_notimpl_setaside +apr_bucket_split_notimpl apr_bucket_notimpl_split +apr_bucket_split_shared apr_bucket_shared_split +apr_init_bucket_types apr_bucket_init_types +apr_insert_bucket_type apr_bucket_insert_type + +apr_os_*: +apr_get_os_dir apr_os_dir_get +apr_get_os_exp_time apr_os_exp_time_get +apr_get_os_file apr_os_file_get +apr_get_os_imp_time apr_os_imp_time_get +apr_get_os_lock apr_os_lock_get +apr_get_os_sock apr_os_sock_get +apr_get_os_thread apr_os_thread_get +apr_get_os_threadkey apr_os_threadkey_get +apr_make_os_sock apr_os_sock_make +apr_put_os_dir apr_os_dir_put +apr_put_os_exp_time apr_os_exp_time_put +apr_put_os_file apr_os_file_put +apr_put_os_imp_time apr_os_imp_time_put +apr_put_os_lock apr_os_lock_put +apr_put_os_sock apr_os_sock_put +apr_put_os_thread apr_os_thread_put +apr_put_os_threadkey apr_os_threadkey_put + +apr_md5_ctx_t: +apr_MD5Encode apr_md5_encode +apr_MD5Final apr_md5_final +apr_MD5Init apr_md5_init +apr_MD5SetXlate apr_md5_set_xlate +apr_MD5Update apr_md5_update + +apr_sha1_ctx_t: +apr_SHA1Final apr_sha1_final +apr_SHA1Init apr_sha1_init +apr_SHA1Update apr_sha1_update +apr_SHA1Update_binary apr_sha1_update_binary + +apr_getopt_t: +apr_initopt apr_getopt_init + +apr_base64_*: +apr_base64decode apr_base64_decode +apr_base64decode_binary apr_base64_decode_binary +apr_base64decode_len apr_base64_decode_len +apr_base64encode apr_base64_encode +apr_base64encode_binary apr_base64_encode_binary +apr_base64encode_len apr_base64_encode_len From 020b6e528fc9458ab932f46a8c2d9d1d1662fd83 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 19 Nov 2002 20:00:26 +0000 Subject: [PATCH 4023/7878] Fix cleanups so cleanups actually get run when registered from within another cleanup. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64042 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 568d3bd4e8d..d8276eab410 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -523,8 +523,8 @@ static apr_file_t *file_stderr = NULL; * Local functions */ -static void run_cleanups(cleanup_t *c); -static void run_child_cleanups(cleanup_t *c); +static void run_cleanups(cleanup_t **c); +static void run_child_cleanups(cleanup_t **c); static void free_proc_chain(struct process_chain *procs); @@ -715,7 +715,7 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) apr_pool_destroy(pool->child); /* Run cleanups */ - run_cleanups(pool->cleanups); + run_cleanups(&pool->cleanups); pool->cleanups = NULL; /* Free subprocesses */ @@ -752,7 +752,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) apr_pool_destroy(pool->child); /* Run cleanups */ - run_cleanups(pool->cleanups); + run_cleanups(&pool->cleanups); /* Free subprocesses */ free_proc_chain(pool->subprocesses); @@ -1389,7 +1389,7 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) apr_pool_destroy_debug(pool->child, file_line); /* Run cleanups */ - run_cleanups(pool->cleanups); + run_cleanups(&pool->cleanups); pool->cleanups = NULL; /* Free subprocesses */ @@ -1967,26 +1967,31 @@ APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, return (*cleanup_fn)(data); } -static void run_cleanups(cleanup_t *c) +static void run_cleanups(cleanup_t **cref) { + cleanup_t *c = *cref; + while (c) { + *cref = c->next; (*c->plain_cleanup_fn)((void *)c->data); - c = c->next; + c = *cref; } } -static void run_child_cleanups(cleanup_t *c) +static void run_child_cleanups(cleanup_t **cref) { + cleanup_t *c = *cref; + while (c) { + *cref = c->next; (*c->child_cleanup_fn)((void *)c->data); - c = c->next; + c = *cref; } } static void cleanup_pool_for_exec(apr_pool_t *p) { - run_child_cleanups(p->cleanups); - p->cleanups = NULL; + run_child_cleanups(&p->cleanups); for (p = p->child; p; p = p->sibling) cleanup_pool_for_exec(p); From 4439f6f50b1334942315cc4b931a5d72f9224f9a Mon Sep 17 00:00:00 2001 From: Thom May Date: Wed, 20 Nov 2002 03:50:23 +0000 Subject: [PATCH 4024/7878] *) Renames done (deprecated functions wrapped): apr_filename_of_pathname -> apr_filepath_name_get apr_get_groupid -> apr_gid_get apr_get_groupname -> apr_gid_name_get apr_compare_groups -> apr_gid_compare apr_parse_addr_port -> apr_port_addr_parse apr_shutdown -> apr_socket_shutdown apr_bind -> apr_socket_bind apr_listen -> apr_socket_listen apr_accept -> apr_socket_accept apr_connect -> apr_socket_connect apr_send -> apr_socket_send apr_sendv -> apr_socket_sendv apr_sendto -> apr_socket_sendto apr_implode_gmt -> apr_time_exp_gmt_get apr_get_home_directory -> apr_uid_homepath_get apr_get_userid -> apr_uid_get apr_current_userid -> apr_uid_current apr_compare_users -> apr_uid_compare apr_get_username -> apr_uid_name_get apr_recvfrom -> apr_socket_recvfrom apr_sendfile -> apr_socket_sendfile apr_recv -> apr_socket_recv git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64043 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 26 ++++++ file_io/win32/filepath.c | 5 +- include/apr_lib.h | 3 + include/apr_network_io.h | 69 +++++++++++++-- include/apr_time.h | 4 + include/apr_user.h | 47 ++++++++-- misc/unix/getopt.c | 8 +- network_io/beos/sendrecv.c | 64 +++++++++++--- network_io/os2/sendrecv.c | 32 ++++++- network_io/os2/sendrecv_udp.c | 14 ++- network_io/os2/sockets.c | 48 ++++++++-- network_io/os2/sockopt.c | 4 +- network_io/unix/sendrecv.c | 160 ++++++++++++++++++++++------------ network_io/unix/sockets.c | 43 +++++++-- network_io/unix/sockopt.c | 1 - network_io/win32/sendrecv.c | 108 +++++++++++++++++------ network_io/win32/sockets.c | 48 ++++++++-- network_io/win32/sockopt.c | 1 - renames_pending | 70 ++++++--------- shmem/unix/shm.c | 4 +- strings/apr_cpystrn.c | 10 ++- test/client.c | 8 +- test/sendfile.c | 84 +++++++++--------- test/server.c | 12 +-- test/testpoll.c | 6 +- test/testsockets.c | 8 +- test/testtime.c | 4 +- test/testuser.c | 22 ++--- time/unix/time.c | 10 ++- time/win32/time.c | 12 ++- user/netware/groupinfo.c | 20 ++++- user/netware/userinfo.c | 48 +++++++--- user/unix/groupinfo.c | 20 ++++- user/unix/userinfo.c | 50 ++++++++--- user/win32/groupinfo.c | 25 +++++- user/win32/userinfo.c | 57 ++++++++++-- 36 files changed, 859 insertions(+), 296 deletions(-) diff --git a/CHANGES b/CHANGES index faba6328e6d..d738599e6c0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,30 @@ Changes with APR 0.9.2 + *) Add DougM's apr_rename.pl script into helpers, and update for the new batch of updates [Thom May] + + *) Renames done (deprecated functions wrapped): + apr_filename_of_pathname -> apr_filepath_name_get + apr_get_groupid -> apr_gid_get + apr_get_groupname -> apr_gid_name_get + apr_compare_groups -> apr_gid_compare + apr_parse_addr_port -> apr_port_addr_parse + apr_shutdown -> apr_socket_shutdown + apr_bind -> apr_socket_bind + apr_listen -> apr_socket_listen + apr_accept -> apr_socket_accept + apr_connect -> apr_socket_connect + apr_send -> apr_socket_send + apr_sendv -> apr_socket_sendv + apr_sendto -> apr_socket_sendto + apr_implode_gmt -> apr_time_exp_gmt_get + apr_get_home_directory -> apr_uid_homepath_get + apr_get_userid -> apr_uid_get + apr_current_userid -> apr_uid_current + apr_compare_users -> apr_uid_compare + apr_get_username -> apr_uid_name_get + apr_recvfrom -> apr_socket_recvfrom + apr_sendfile -> apr_socket_sendfile + apr_recv -> apr_socket_recv + [Thom May] *) Add APR_IPV6_V6ONLY socket option. [Jeff Trawick] diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index f66df5a3e79..63eef19e936 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -870,8 +870,9 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } /* Null term for stat! */ path[keptlen + seglen] = '\0'; - if ((rv = apr_lstat(&finfo, path, APR_FINFO_TYPE | APR_FINFO_NAME, p)) - == APR_SUCCESS) { + if ((rv = apr_lstat(&finfo, path, + APR_FINFO_TYPE | APR_FINFO_NAME, p)) + == APR_SUCCESS) { apr_size_t namelen = strlen(finfo.name); #if defined(OS2) || defined(NETWARE) /* only has case folding, never aliases that change the length */ diff --git a/include/apr_lib.h b/include/apr_lib.h index b4c67c24c75..2e4e1ae3040 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -113,6 +113,9 @@ struct apr_vformatter_buff_t { * "wi\\n32\\stuff" -> "stuff" * */ +APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); + +/** @deprecated @see apr_filepath_name_get */ APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname); /** diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 30eaa97867a..cd4ff258511 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -119,8 +119,8 @@ extern "C" { #define APR_INCOMPLETE_READ 4096 /**< Set on non-blocking sockets * (timeout != 0) on which the * previous read() did not fill a buffer - * completely. the next apr_recv() will - * first call select()/poll() rather than + * completely. the next apr_socket_recv() + * will first call select()/poll() rather than * going straight into read(). (Can also * be set by an application to force a * select()/poll() call before the next @@ -209,7 +209,7 @@ typedef enum { /** A structure to represent sockets */ typedef struct apr_socket_t apr_socket_t; /** - * A structure to encapsulate headers and trailers for apr_sendfile + * A structure to encapsulate headers and trailers for apr_socket_sendfile */ typedef struct apr_hdtr_t apr_hdtr_t; /** A structure to represent in_addr */ @@ -263,11 +263,11 @@ struct apr_sockaddr_t { }; #if APR_HAS_SENDFILE -/* Define flags passed in on apr_sendfile() */ +/* Define flags passed in on apr_socket_sendfile() */ #define APR_SENDFILE_DISCONNECT_SOCKET 1 #endif -/** A structure to encapsulate headers and trailers for apr_sendfile */ +/** A structure to encapsulate headers and trailers for apr_socket_sendfile */ struct apr_hdtr_t { /** An iovec to store the headers sent before the file. * @defvar iovec *headers */ @@ -322,6 +322,10 @@ APR_DECLARE(apr_status_t) apr_socket_create_ex(apr_socket_t **new_sock, * @remark This does not actually close the socket descriptor, it just * controls which calls are still valid on the socket. */ +APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, + apr_shutdown_how_e how); + +/** @deprecated @see apr_socket_shutdown */ APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how); @@ -338,6 +342,10 @@ APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket); * @remark This may be where we will find out if there is any other process * using the selected port. */ +APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, + apr_sockaddr_t *sa); + +/* @deprecated @see apr_socket_bind */ APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa); /** @@ -347,6 +355,10 @@ APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa); * listen queue. If this value is less than zero, the listen * queue size is set to zero. */ +APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, + apr_int32_t backlog); + +/** @deprecated @see apr_socket_listen */ APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog); /** @@ -357,6 +369,11 @@ APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog); * @param sock The socket we are listening on. * @param connection_pool The pool for the new socket. */ +APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new_sock, + apr_socket_t *sock, + apr_pool_t *connection_pool); + +/** @deprecated @see apr_socket_accept */ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, apr_pool_t *connection_pool); @@ -369,6 +386,10 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new_sock, * APR assumes that the sockaddr_in in the apr_socket is * completely filled out. */ +APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, + apr_sockaddr_t *sa); + +/** @deprecated @see apr_socket_connect */ APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa); /** @@ -410,7 +431,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, apr_sockaddr_t *sa, apr_int32_t flags); - + /** * Parse hostname/IP address with scope id and port. * @@ -493,6 +514,10 @@ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, * APR_EINTR is never returned. * */ +APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, + apr_size_t *len); + +/** @deprecated @see apr_socket_send */ APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len); @@ -513,6 +538,11 @@ APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, * APR_EINTR is never returned. * */ +APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, + const struct iovec *vec, + apr_int32_t nvec, apr_size_t *len); + +/** @deprecated @see apr_socket_sendv */ APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len); @@ -524,6 +554,12 @@ APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, * @param buf The data to send * @param len The length of the data to send */ +APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, + apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, + apr_size_t *len); + +/** @deprecated @see apr_socket_sendto */ APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, apr_int32_t flags, const char *buf, apr_size_t *len); @@ -536,10 +572,16 @@ APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, * @param len The length of the available buffer */ +APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, + apr_socket_t *sock, + apr_int32_t flags, char *buf, + apr_size_t *len); + +/** @deprecated @see apr_socket_recvfrom */ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, apr_int32_t flags, char *buf, apr_size_t *len); - + #if APR_HAS_SENDFILE || defined(DOXYGEN) /** @@ -557,6 +599,14 @@ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, * this behavior, use apr_socket_timeout_set(). * The number of bytes actually sent is stored in argument 5. */ +APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, + apr_file_t *file, + apr_hdtr_t *hdtr, + apr_off_t *offset, + apr_size_t *len, + apr_int32_t flags); + +/** @deprecated @see apr_socket_sendfile */ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags); @@ -581,6 +631,10 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, * APR_EINTR is never returned. * */ +APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, + char *buf, apr_size_t *len); + +/** @deprecated @see apr_socket_recv */ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len); @@ -732,7 +786,6 @@ APR_DECLARE(apr_status_t) apr_socket_from_file(apr_socket_t **newsock, */ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname); - /** * Build an ip-subnet representation from an IP address and optional netmask or * number-of-bits. diff --git a/include/apr_time.h b/include/apr_time.h index 050d7a3e4d0..fc5f2ca278f 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -211,6 +211,10 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *result, * @param result the resulting imploded time * @param input the input exploded time */ +APR_DECLARE(apr_status_t) apr_time_exp_gmt_get(apr_time_t *result, + apr_time_exp_t *input); + +/** @deprecated @see apr_time_exp_gmt_get */ APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *result, apr_time_exp_t *input); diff --git a/include/apr_user.h b/include/apr_user.h index e54411043c6..d31505cabea 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -100,10 +100,14 @@ typedef gid_t apr_gid_t; * @param p The pool from which to allocate working space * @remark This function is available only if APR_HAS_USER is defined. */ +APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *userid, + apr_gid_t *groupid, + apr_pool_t *p); + +/** @deprecated @see apr_uid_current */ APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *userid, apr_gid_t *groupid, apr_pool_t *p); - /** * Get the user name for a specified userid * @param username Pointer to new string containing user name (on output) @@ -111,8 +115,12 @@ APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *userid, * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ -APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, + apr_pool_t *p); +/** @deprecated @see apr_uid_name_get */ +APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, + apr_pool_t *p); /** * Get the userid (and groupid) for the specified username * @param userid Returns the user id @@ -121,6 +129,10 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap * @param p The pool from which to allocate working space * @remark This function is available only if APR_HAS_USER is defined. */ +APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *userid, apr_gid_t *groupid, + const char *username, apr_pool_t *p); + +/** @deprecated @see apr_uid_get */ APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *userid, apr_gid_t *groupid, const char *username, apr_pool_t *p); @@ -131,7 +143,14 @@ APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *userid, apr_gid_t *groupid, * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ -APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *username, apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, + const char *username, + apr_pool_t *p); + +/** @deprecated @see apr_uid_homepath_get */ +APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, + const char *username, + apr_pool_t *p); /** * Compare two user identifiers for equality. @@ -142,8 +161,13 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use * @remark This function is available only if APR_HAS_USER is defined. */ #if defined(WIN32) +APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right); + +/** @deprecated @see apr_uid_compare */ APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right); #else +#define apr_uid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) +/** @deprecated @see apr_uid_compare */ #define apr_compare_users(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) #endif @@ -154,10 +178,14 @@ APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right); * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ +APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, + apr_gid_t groupid, apr_pool_t *p); + +/** @deprecated @see apr_gid_name_get */ APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p); -/** @deprecated @see apr_group_name_get */ +/** @deprecated @see apr_gid_name_get */ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p); @@ -168,7 +196,12 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ -APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, const char *groupname, apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, + const char *groupname, apr_pool_t *p); + +/** @deprecated @see apr_gid_get */ +APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, + const char *groupname, apr_pool_t *p); /** * Compare two group identifiers for equality. @@ -179,8 +212,12 @@ APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, const char *groupn * @remark This function is available only if APR_HAS_USER is defined. */ #if defined(WIN32) +APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right); +/** @deprecated @see apr_gid_compare */ APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right); #else +#define apr_gid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) +/** @deprecated @see apr_gid_compare */ #define apr_compare_groups(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) #endif diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 2a8b7d1a421..1e0911710b2 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -101,7 +101,7 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, ++os->ind; if (os->errfn && *opts != ':') { (os->errfn)(os->errarg, "%s: illegal option -- %c\n", - apr_filename_of_pathname(*os->argv), os->opt); + apr_filepath_name_get(*os->argv), os->opt); } *optch = os->opt; return (APR_BADCH); @@ -123,7 +123,7 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, if (os->errfn) { (os->errfn)(os->errarg, "%s: option requires an argument -- %c\n", - apr_filename_of_pathname(*os->argv), os->opt); + apr_filepath_name_get(*os->argv), os->opt); } *optch = os->opt; return (APR_BADCH); @@ -183,7 +183,7 @@ static apr_status_t serr(apr_getopt_t *os, const char *err, const char *str, { if (os->errfn) (os->errfn)(os->errarg, "%s: %s: %s\n", - apr_filename_of_pathname(*os->argv), err, str); + apr_filepath_name_get(*os->argv), err, str); return status; } @@ -193,7 +193,7 @@ static apr_status_t cerr(apr_getopt_t *os, const char *err, int ch, { if (os->errfn) (os->errfn)(os->errarg, "%s: %s: %c\n", - apr_filename_of_pathname(*os->argv), err, ch); + apr_filepath_name_get(*os->argv), err, ch); return status; } diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 3762befbb86..19dc63d9043 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -95,7 +95,8 @@ apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read) #define SEND_WAIT APR_USEC_PER_SEC / 10 -APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, + apr_size_t *len) { apr_ssize_t rv; @@ -128,7 +129,8 @@ APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, apr_size return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, + apr_size_t *len) { apr_ssize_t rv; @@ -160,15 +162,18 @@ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, apr_size_t *le /* BeOS doesn't have writev for sockets so we use the following instead... */ -APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t * sock, const struct iovec *vec, - apr_int32_t nvec, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t * sock, + const struct iovec *vec, + apr_int32_t nvec, apr_size_t *len) { *len = vec[0].iov_len; - return apr_send(sock, vec[0].iov_base, len); + return apr_socket_send(sock, vec[0].iov_base, len); } -APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, + apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, + apr_size_t *len) { apr_ssize_t rv; @@ -200,9 +205,10 @@ APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, - apr_int32_t flags, char *buf, - apr_size_t *len) +APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, + apr_socket_t *sock, + apr_int32_t flags, char *buf, + apr_size_t *len) { apr_ssize_t rv; @@ -243,4 +249,42 @@ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, return APR_SUCCESS; } +/* deprecated */ +APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, + apr_size_t *len) +{ + return apr_socket_send(sock, buf, len); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t * sock, + const struct iovec *vec, + apr_int32_t nvec, apr_size_t *len) +{ + return apr_socket_sendv(sock, vec, nvec, len); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, + apr_size_t *len) +{ + return apr_socket_sendto(sock, where, flags, buf, len); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, + apr_int32_t flags, char *buf, + apr_size_t *len) +{ + return apr_socket_recvfrom(from, sock, flags, buf, len); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, + apr_size_t *len) +{ + return apr_socket_recv(sock, buf, len); +} + #endif diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index e3631dadf6c..6a28e9c52e3 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -59,7 +59,8 @@ #include "apr_lib.h" #include -APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, + apr_size_t *len) { apr_ssize_t rv; int fds, err = 0; @@ -98,7 +99,8 @@ APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, apr_size -APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, + apr_size_t *len) { apr_ssize_t rv; int fds, err = 0; @@ -137,7 +139,9 @@ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, apr_size_t *le -APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, + const struct iovec *vec, + apr_int32_t nvec, apr_size_t *len) { apr_status_t rv; struct iovec *tmpvec; @@ -183,3 +187,25 @@ APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, const struct iovec *vec, *len = rv; return APR_SUCCESS; } + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, + apr_size_t *len) +{ + return apr_socket_send(sock, buf, len); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, + const struct iovec *vec, + apr_int32_t nvec, apr_size_t *len) +{ + return apr_socket_sendv(sock, vec, nvec, len); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, + apr_size_t *len) +{ + return apr_socket_recv(sock, buf, len); +} diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c index 4010a083ac1..4667b9278cf 100644 --- a/network_io/os2/sendrecv_udp.c +++ b/network_io/os2/sendrecv_udp.c @@ -61,8 +61,10 @@ #include -APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, + apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, + apr_size_t *len) { apr_ssize_t rv; int serrno; @@ -137,3 +139,11 @@ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, return APR_SUCCESS; } + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, + apr_size_t *len) +{ + return apr_socket_sendto(sock, where, flags, buf, len); +} diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 9a704b8f429..90eda2bd439 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -151,7 +151,8 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int return apr_socket_create_ex(new, family, type, 0, cont); } -APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) +APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, + apr_shutdown_how_e how) { if (shutdown(thesocket->socketdes, how) == 0) { return APR_SUCCESS; @@ -167,7 +168,8 @@ APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket) return socket_cleanup(thesocket); } -APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) +APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, + apr_sockaddr_t *sa) { if (bind(sock->socketdes, (struct sockaddr *)&sa->sa, @@ -179,7 +181,8 @@ APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) } } -APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) +APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, + apr_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return APR_OS2_STATUS(sock_errno()); @@ -187,7 +190,9 @@ APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) +APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, + apr_socket_t *sock, + apr_pool_t *connection_context) { alloc_socket(new, connection_context); set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM, sock->protocol); @@ -217,7 +222,8 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, apr return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) +APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, + apr_sockaddr_t *sa) { if ((connect(sock->socketdes, (struct sockaddr *)&sa->sa.sin, sa->salen) < 0) && @@ -313,3 +319,35 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *th APR_IMPLEMENT_INHERIT_SET(socket, inherit, cntxt, socket_cleanup) APR_IMPLEMENT_INHERIT_UNSET(socket, inherit, cntxt, socket_cleanup) + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, + apr_shutdown_how_e how) +{ + return apr_socket_shutdown(thesocket, how); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) +{ + return apr_socket_bind(sock, sa); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) +{ + return apr_socket_listen(sock, backlog); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, + apr_pool_t *connection_context) +{ + return apr_socket_accept(new, sock, connection_context); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) +{ + return apr_socket_connect(sock, sa); +} diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 3ecc1aa02e8..0623e6ce73c 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -170,7 +170,8 @@ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, } -APR_DECLARE(apr_status_t) apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_gethostname(char *buf, apr_int32_t len, + apr_pool_t *cont) { if (gethostname(buf, len) == -1) { buf[0] = '\0'; @@ -182,4 +183,3 @@ APR_DECLARE(apr_status_t) apr_gethostname(char *buf, apr_int32_t len, apr_pool_t } return APR_SUCCESS; } - diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 521ab533a71..ac6e197142c 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -65,7 +65,8 @@ #include #endif -apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) +apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, + apr_size_t *len) { apr_ssize_t rv; @@ -98,20 +99,20 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) return errno; } if (sock->timeout && rv < *len) { - sock->netmask |= APR_INCOMPLETE_WRITE; + sock->netmask |= APR_INCOMPLETE_WRITE; } (*len) = rv; return APR_SUCCESS; } -apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) +apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len) { apr_ssize_t rv; apr_status_t arv; if (sock->netmask & APR_INCOMPLETE_READ) { - sock->netmask &= ~APR_INCOMPLETE_READ; - goto do_select; + sock->netmask &= ~APR_INCOMPLETE_READ; + goto do_select; } do { @@ -121,7 +122,7 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { do_select: - arv = apr_wait_for_io_or_timeout(NULL, sock, 1); + arv = apr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -137,7 +138,7 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) return errno; } if (sock->timeout && rv < *len) { - sock->netmask |= APR_INCOMPLETE_READ; + sock->netmask |= APR_INCOMPLETE_READ; } (*len) = rv; if (rv == 0) { @@ -146,8 +147,9 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) return APR_SUCCESS; } -apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, apr_size_t *len) +apr_status_t apr_socket_sendto(apr_socket_t *sock, apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, + apr_size_t *len) { apr_ssize_t rv; @@ -179,9 +181,9 @@ apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, return APR_SUCCESS; } -apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, - apr_int32_t flags, char *buf, - apr_size_t *len) +apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, + apr_int32_t flags, char *buf, + apr_size_t *len) { apr_ssize_t rv; @@ -216,8 +218,8 @@ apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, } #ifdef HAVE_WRITEV -apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, - apr_int32_t nvec, apr_size_t *len) +apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, + apr_int32_t nvec, apr_size_t *len) { apr_ssize_t rv; apr_size_t requested_len = 0; @@ -256,7 +258,7 @@ apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, return errno; } if (sock->timeout && rv < requested_len) { - sock->netmask |= APR_INCOMPLETE_WRITE; + sock->netmask |= APR_INCOMPLETE_WRITE; } (*len) = rv; return APR_SUCCESS; @@ -275,9 +277,9 @@ static apr_hdtr_t no_hdtr; #if defined(__linux__) && defined(HAVE_WRITEV) -apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, - apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, - apr_int32_t flags) +apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, + apr_size_t *len, apr_int32_t flags) { off_t off = *offset; int rv, nbytes = 0, total_hdrbytes, i; @@ -300,9 +302,10 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, } /* Now write the headers */ - arv = apr_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); + arv = apr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, + &hdrbytes); if (arv != APR_SUCCESS) { - *len = 0; + *len = 0; return errno; } nbytes += hdrbytes; @@ -327,10 +330,10 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, } do { - rv = sendfile(sock->socketdes, /* socket */ - file->filedes, /* open file descriptor of the file to be sent */ - &off, /* where in the file to start */ - *len /* number of bytes to send */ + rv = sendfile(sock->socketdes, /* socket */ + file->filedes, /* open file descriptor of the file to be sent */ + &off, /* where in the file to start */ + *len /* number of bytes to send */ ); } while (rv == -1 && errno == EINTR); @@ -338,23 +341,23 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { do_select: - arv = apr_wait_for_io_or_timeout(NULL, sock, 0); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } + arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } else { do { - rv = sendfile(sock->socketdes, /* socket */ - file->filedes, /* open file descriptor of the file to be sent */ - &off, /* where in the file to start */ - *len); /* number of bytes to send */ + rv = sendfile(sock->socketdes, /* socket */ + file->filedes, /* open file descriptor of the file to be sent */ + &off, /* where in the file to start */ + *len); /* number of bytes to send */ } while (rv == -1 && errno == EINTR); } } if (rv == -1) { - *len = nbytes; + *len = nbytes; rv = errno; apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); return rv; @@ -389,10 +392,11 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, /* Now write the footers */ if (hdtr->numtrailers > 0) { apr_size_t trbytes; - arv = apr_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trbytes); + arv = apr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, + &trbytes); nbytes += trbytes; if (arv != APR_SUCCESS) { - *len = nbytes; + *len = nbytes; rv = errno; apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); return rv; @@ -455,10 +459,11 @@ static int include_hdrs_in_length(void) return 1; #endif } + /* Release 3.1 or greater */ -apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, - apr_int32_t flags) +apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, + apr_hdtr_t * hdtr, apr_off_t * offset, + apr_size_t * len, apr_int32_t flags) { off_t nbytes = 0; int rv, i; @@ -588,9 +593,9 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, * if nbytes == 0, the rest of the file (from offset) is sent */ -apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, - apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, - apr_int32_t flags) +apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, + apr_size_t *len, apr_int32_t flags) { int i; apr_ssize_t rc; @@ -700,7 +705,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, } if (rc == -1) { - *len = 0; + *len = 0; return errno; } @@ -719,9 +724,9 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, * AIX - version 4.3.2 with APAR IX85388, or version 4.3.3 and above * OS/390 - V2R7 and above */ -apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, - apr_int32_t flags) +apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, + apr_hdtr_t * hdtr, apr_off_t * offset, + apr_size_t * len, apr_int32_t flags) { int i, ptr, rv = 0; void * hbuf=NULL, * tbuf=NULL; @@ -865,9 +870,9 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, * 111298-01, 108529-09, 109473-06, 109235-04, 108996-02, 111296-01, 109026-04, * 108992-13 */ -apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, - apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, - apr_int32_t flags) +apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, + apr_size_t *len, apr_int32_t flags) { apr_status_t rv, arv; apr_size_t nbytes; @@ -980,7 +985,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, /* Update how much we sent */ *len = nbytes; if (sock->timeout && (*len < requested_len)) { - sock->netmask |= APR_INCOMPLETE_WRITE; + sock->netmask |= APR_INCOMPLETE_WRITE; } return APR_SUCCESS; } @@ -996,14 +1001,59 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, * apr_sendfile() doesn't work on the platform; * this dummy version is just to get exports.c to compile/link */ -apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, - apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, - apr_int32_t flags); /* avoid warning for no proto */ +apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, + apr_size_t *len, apr_int32_t flags); + /* avoid warning for no proto */ + +apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, + apr_size_t *len, apr_int32_t flags) +{ + return APR_ENOTIMPL; +} +#endif +/* deprecated */ +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) +{ + return apr_socket_send(sock, buf, len); +} + +/* deprecated */ +#ifdef HAVE_WRITEV +apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, + apr_int32_t nvec, apr_size_t *len) +{ + return apr_socket_sendv(sock, vec, nvec, len); +} +#endif + +/* deprecated */ +apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, apr_size_t *len) +{ + return apr_socket_sendto(sock, where, flags, buf, len); +} + +/* deprecated */ +apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, + apr_int32_t flags, char *buf, + apr_size_t *len) +{ + return apr_socket_recvfrom(from, sock, flags, buf, len); +} + +/* deprecated */ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags) { - return APR_ENOTIMPL; + return apr_socket_sendfile(sock, file, hdtr, offset, len, flags); +} + +/* deprecated */ +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) +{ + return apr_socket_recv(sock, buf, len); } -#endif diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index f442cdabb12..2dc1bcd1479 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -152,7 +152,8 @@ apr_status_t apr_socket_create(apr_socket_t **new, int family, int type, return apr_socket_create_ex(new, family, type, 0, cont); } -apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) +apr_status_t apr_socket_shutdown(apr_socket_t *thesocket, + apr_shutdown_how_e how) { return (shutdown(thesocket->socketdes, how) == -1) ? errno : APR_SUCCESS; } @@ -162,7 +163,7 @@ apr_status_t apr_socket_close(apr_socket_t *thesocket) return apr_pool_cleanup_run(thesocket->cntxt, thesocket, socket_cleanup); } -apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) +apr_status_t apr_socket_bind(apr_socket_t *sock, apr_sockaddr_t *sa) { if (bind(sock->socketdes, (struct sockaddr *)&sa->sa, sa->salen) == -1) { @@ -178,7 +179,7 @@ apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) } } -apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) +apr_status_t apr_socket_listen(apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return errno; @@ -186,7 +187,8 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) return APR_SUCCESS; } -apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) +apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, + apr_pool_t *connection_context) { alloc_socket(new, connection_context); set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM, sock->protocol); @@ -256,7 +258,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn return APR_SUCCESS; } -apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) +apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { int rc; @@ -392,3 +394,34 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, APR_IMPLEMENT_INHERIT_SET(socket, inherit, cntxt, socket_cleanup) APR_IMPLEMENT_INHERIT_UNSET(socket, inherit, cntxt, socket_cleanup) + +/* deprecated */ +apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) +{ + return apr_socket_shutdown(thesocket, how); +} + +/* deprecated */ +apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) +{ + return apr_socket_bind(sock, sa); +} + +/* deprecated */ +apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) +{ + return apr_socket_listen(sock, backlog); +} + +/* deprecated */ +apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, + apr_pool_t *connection_context) +{ + return apr_socket_accept(new, sock, connection_context); +} + +/* deprecated */ +apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) +{ + return apr_socket_connect(sock, sa); +} diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 31024a8aa74..86f7db8dc6a 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -396,4 +396,3 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, return APR_SUCCESS; } #endif - diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index a9f8a41896e..a32336e4cce 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -65,16 +65,17 @@ /* MAX_SEGMENT_SIZE is the maximum amount of data that will be sent to a client * in one call of TransmitFile. This number must be small enough to give the * slowest client time to receive the data before the socket timeout triggers. - * The same problem can exist with apr_send(). In that case, we rely on the - * application to adjust socket timeouts and max send segment sizes appropriately. - * For example, Apache will in most cases call apr_send() with less than 8193 - * bytes. + * The same problem can exist with apr_socket_send(). In that case, we rely on + * the application to adjust socket timeouts and max send segment + * sizes appropriately. + * For example, Apache will in most cases call apr_socket_send() with less + * than 8193 bytes. */ #define MAX_SEGMENT_SIZE 65536 #define WSABUF_ON_STACK 50 -APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, - apr_size_t *len) +APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, + apr_size_t *len) { apr_ssize_t rv; WSABUF wsaData; @@ -101,8 +102,8 @@ APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, } -APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, - apr_size_t *len) +APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, + apr_size_t *len) { apr_ssize_t rv; WSABUF wsaData; @@ -130,9 +131,9 @@ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, } -APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, - const struct iovec *vec, - apr_int32_t nvec, apr_size_t *nbytes) +APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, + const struct iovec *vec, + apr_int32_t nvec, apr_size_t *nbytes) { apr_status_t rc = APR_SUCCESS; apr_ssize_t rv; @@ -171,9 +172,10 @@ APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, } -APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, - apr_size_t *len) +APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, + apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, + apr_size_t *len) { apr_ssize_t rv; @@ -190,10 +192,10 @@ APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, } -APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, - apr_socket_t *sock, - apr_int32_t flags, - char *buf, apr_size_t *len) +APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, + apr_socket_t *sock, + apr_int32_t flags, + char *buf, apr_size_t *len) { apr_ssize_t rv; @@ -253,8 +255,8 @@ static apr_status_t collapse_iovec(char **off, apr_size_t *len, */ /* - * apr_status_t apr_sendfile(apr_socket_t *, apr_file_t *, apr_hdtr_t *, - * apr_off_t *, apr_size_t *, apr_int32_t flags) + * apr_status_t apr_socket_sendfile(apr_socket_t *, apr_file_t *, apr_hdtr_t *, + * apr_off_t *, apr_size_t *, apr_int32_t flags) * Send a file from an open file descriptor to a socket, along with * optional headers and trailers * arg 1) The socket to which we're writing @@ -264,9 +266,12 @@ static apr_status_t collapse_iovec(char **off, apr_size_t *len, * arg 5) Number of bytes to send out of the file * arg 6) APR flags that are mapped to OS specific flags */ -APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, - apr_hdtr_t *hdtr, apr_off_t *offset, - apr_size_t *len, apr_int32_t flags) +APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, + apr_file_t *file, + apr_hdtr_t *hdtr, + apr_off_t *offset, + apr_size_t *len, + apr_int32_t flags) { apr_status_t status = APR_SUCCESS; apr_ssize_t rv; @@ -293,13 +298,15 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, /* Handle the goofy case of sending headers/trailers and a zero byte file */ if (!bytes_to_send && hdtr) { if (hdtr->numheaders) { - rv = apr_sendv(sock, hdtr->headers, hdtr->numheaders, &nbytes); + rv = apr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, + &nbytes); if (rv != APR_SUCCESS) return rv; *len += nbytes; } if (hdtr->numtrailers) { - rv = apr_sendv(sock, hdtr->trailers, hdtr->numtrailers, &nbytes); + rv = apr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, + &nbytes); if (rv != APR_SUCCESS) return rv; *len += nbytes; @@ -438,7 +445,8 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, /* Mark the socket as disconnected, but do not close it. * Note: The application must have stored the socket prior to making - * the call to apr_sendfile in order to either reuse it or close it. + * the call to apr_socket_sendfile in order to either reuse it + * or close it. */ if (disconnected) { sock->disconnected = 1; @@ -451,4 +459,52 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, #endif return status; } + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, + apr_size_t *len, apr_int32_t flags) +{ + return apr_socket_sendfile(sock, file, hdtr, offset, len, flags); +} + #endif + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, + apr_size_t *len) +{ + return apr_socket_send(sock. buf, len); +} + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, + const struct iovec *vec, + apr_int32_t nvec, apr_size_t *nbytes) +{ + return apr_socket_sendv(sock, vec, nvec, nbytes); +} + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, + apr_int32_t flags, const char *buf, + apr_size_t *len) +{ + return apr_socket_sendto(sock, where, flags, buf, len); +} + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, + apr_socket_t *sock, + apr_int32_t flags, + char *buf, apr_size_t *len) +{ + return apr_socket_recvfrom(from, sock, flags, buf, len); +} + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, + apr_size_t *len) +{ + return apr_socket_recv(sock, buf, len); +} diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 528a408a6d9..5bd0a133a18 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -185,8 +185,8 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, return apr_socket_create_ex(new, family, type, 0, cont); } -APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, - apr_shutdown_how_e how) +APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, + apr_shutdown_how_e how) { int winhow = 0; @@ -222,7 +222,8 @@ APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket) return socket_cleanup(thesocket); } -APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) +APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, + apr_sockaddr_t *sa) { if (bind(sock->socketdes, (struct sockaddr *)&sa->sa, @@ -238,7 +239,8 @@ APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) } } -APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) +APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, + apr_int32_t backlog) { if (listen(sock->socketdes, backlog) == SOCKET_ERROR) return apr_get_netos_error(); @@ -246,8 +248,8 @@ APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, + apr_socket_t *sock, apr_pool_t *p) { SOCKET s; struct sockaddr sa; @@ -323,7 +325,8 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) +APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, + apr_sockaddr_t *sa) { apr_status_t rv; @@ -504,3 +507,34 @@ APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *socket) { apr_socket_inherit_unset(socket); } +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, + apr_shutdown_how_e how) +{ + return apr_socket_shutdown(thesocket, how); +} + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) +{ + return apr_socket_bind(sock, sa); +} + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) +{ + return apr_socket_listen(sock. backlog); +} + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, + apr_pool_t *p) +{ + return apr_socket_accept(new, sock, p); +} + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) +{ + return apr_socket_connect(sock, sa); +} diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index c326f9dae03..a60e017431a 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -290,4 +290,3 @@ APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, return APR_SUCCESS; } - diff --git a/renames_pending b/renames_pending index 9ea319f32e2..ca007a729c1 100644 --- a/renames_pending +++ b/renames_pending @@ -1,53 +1,39 @@ Pending symbol renames for APR [for some discussion yet] -apr_file_info_t from apr_finfo_t -apr_file_stat from apr_stat -apr_file_lstat from apr_lstat +apr_file_info_t from apr_finfo_t apr_file_attrs_t from apr_fileattrs_t apr_file_seek_where_t from apr_seek_where_t -apr_filepath_name_get from apr_filename_of_pathname +#apr_filepath_name_get from apr_filename_of_pathname -apr_lock_scope_e from apr_lockscope_e -apr_lock_type_e from apr_locktype_e apr_lock_mech_e from apr_lockmech_e -apr_lock_readerwriter_e from apr_readerwriter_e -apr_gid_get from apr_get_groupid -apr_gid_name_get from apr_get_groupname -apr_gid_name_get from apr_group_name_get -apr_gid_compare from apr_compare_groups - -apr_hostname_get from apr_gethostname - -apr_port_addr_parse from apr_parse_addr_port - -apr_socket_shutdown from apr_shutdown -apr_socket_bind from apr_bind -apr_socket_listen from apr_listen -apr_socket_accept from apr_accept -apr_socket_connect from apr_connect -apr_socket_send from apr_send -apr_socket_sendv from apr_sendv -apr_socket_sendto from apr_sendto -apr_socket_recv_from from apr_recvfrom -apr_socket_file_send from apr_sendfile -apr_socket_recv from apr_recv -apr_socket_file_create from apr_socket_from_file -apr_socket_filter_accept from apr_socket_accept_filter -apr_socket_inherit_set from apr_socket_set_inherit -apr_socket_inherit_unset from apr_socket_unset_inherit - -apr_service_byname_get from apr_getservbyname - -apr_sockaddr_name_info_get from apr_getnameinfo - -apr_time_exp_gmt_get from apr_implode_gmt +#apr_gid_get from apr_get_groupid +#apr_gid_name_get from apr_get_groupname +#apr_gid_name_get from apr_group_name_get +#apr_gid_compare from apr_compare_groups + +#apr_socket_shutdown from apr_shutdown +#apr_socket_bind from apr_bind +#apr_socket_listen from apr_listen +#apr_socket_accept from apr_accept +#apr_socket_connect from apr_connect +#apr_socket_send from apr_send +#apr_socket_sendv from apr_sendv +#apr_socket_sendto from apr_sendto +#apr_socket_recvfrom from apr_recvfrom +#apr_socket_sendfile from apr_sendfile +#apr_socket_recv from apr_recv +#apr_socket_inherit_set from apr_socket_set_inherit +#apr_socket_inherit_unset from apr_socket_unset_inherit + + +#apr_time_exp_gmt_get from apr_implode_gmt apr_time_interval_t from apr_interval_time_t apr_time_interval_short_t from apr_short_interval_time_t -apr_uid_homepath_get from apr_get_home_directory -apr_uid_get from apr_get_userid -apr_uid_current from apr_current_userid -apr_uid_compare from apr_compare_users -apr_uid_name_get from apr_get_username +#apr_uid_homepath_get from apr_get_home_directory +#apr_uid_get from apr_get_userid +#apr_uid_current from apr_current_userid +#apr_uid_compare from apr_compare_users +#apr_uid_name_get from apr_get_username diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index a190ef5cace..be5f3359c22 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -240,7 +240,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, if (shmctl(new_m->shmid, IPC_STAT, &shmbuf) == -1) { return errno; } - apr_current_userid(&uid, &gid, pool); + apr_uid_current(&uid, &gid, pool); shmbuf.shm_perm.uid = uid; shmbuf.shm_perm.gid = gid; if (shmctl(new_m->shmid, IPC_SET, &shmbuf) == -1) { @@ -387,7 +387,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, if (shmctl(new_m->shmid, IPC_STAT, &shmbuf) == -1) { return errno; } - apr_current_userid(&uid, &gid, pool); + apr_uid_current(&uid, &gid, pool); shmbuf.shm_perm.uid = uid; shmbuf.shm_perm.gid = gid; if (shmctl(new_m->shmid, IPC_SET, &shmbuf) == -1) { diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index f99eb92fc84..e9e9575ac86 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -222,7 +222,7 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, return APR_SUCCESS; } -/* Filename_of_pathname returns the final element of the pathname. +/* Filepath_name_get returns the final element of the pathname. * Using the current platform's filename syntax. * "/foo/bar/gum" -> "gum" * "/foo/bar/gum/" -> "" @@ -232,7 +232,7 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, * Corrected Win32 to accept "a/b\\stuff", "a:stuff" */ -APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname) +APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname) { const char path_separator = '/'; const char *s = strrchr(pathname, path_separator); @@ -250,6 +250,12 @@ APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname) return s ? ++s : pathname; } +/* deprecated */ +APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname) +{ + return apr_filepath_name_get(pathname); +} + /* length of dest assumed >= length of src * collapse in place (src == dest) is legal. * returns terminating null ptr to dest string. diff --git a/test/client.c b/test/client.c index d20e7387d21..cf42c50b7d5 100644 --- a/test/client.c +++ b/test/client.c @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "\tClient: Connecting to socket......."); - stat = apr_connect(sock, remote_sa); + stat = apr_socket_connect(sock, remote_sa); if (stat != APR_SUCCESS) { apr_socket_close(sock); @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "\tClient: Trying to send data over socket......."); length = STRLEN; - if ((stat = apr_send(sock, datasend, &length) != APR_SUCCESS)) { + if ((stat = apr_socket_send(sock, datasend, &length) != APR_SUCCESS)) { apr_socket_close(sock); fprintf(stderr, "Problem sending data: %s (%d)\n", apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) length = STRLEN; fprintf(stdout, "\tClient: Trying to receive data over socket......."); - if ((stat = apr_recv(sock, datarecv, &length)) != APR_SUCCESS) { + if ((stat = apr_socket_recv(sock, datarecv, &length)) != APR_SUCCESS) { apr_socket_close(sock); fprintf(stderr, "Problem receiving data: %s (%d)\n", apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); @@ -173,7 +173,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Shutting down socket......."); - if (apr_shutdown(sock, APR_SHUTDOWN_WRITE) != APR_SUCCESS) { + if (apr_socket_shutdown(sock, APR_SHUTDOWN_WRITE) != APR_SUCCESS) { apr_socket_close(sock); fprintf(stderr, "Could not shutdown socket\n"); exit(-1); diff --git a/test/sendfile.c b/test/sendfile.c index 09792f03f25..f339f72a2f7 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -245,9 +245,9 @@ static int client(client_socket_mode_t socket_mode, char *host) exit(1); } - rv = apr_connect(sock, destsa); + rv = apr_socket_connect(sock, destsa); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_connect()->%d/%s\n", + fprintf(stderr, "apr_socket_connect()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -313,25 +313,25 @@ static int client(client_socket_mode_t socket_mode, char *host) if (socket_mode == BLK) { current_file_offset = 0; len = FILE_LENGTH; - rv = apr_sendfile(sock, f, &hdtr, ¤t_file_offset, &len, 0); + rv = apr_socket_sendfile(sock, f, &hdtr, ¤t_file_offset, &len, 0); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_sendfile()->%d/%s\n", + fprintf(stderr, "apr_socket_sendfile()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } - printf("apr_sendfile() updated offset with %ld\n", + printf("apr_socket_sendfile() updated offset with %ld\n", (long int)current_file_offset); - printf("apr_sendfile() updated len with %ld\n", + printf("apr_socket_sendfile() updated len with %ld\n", (long int)len); printf("bytes really sent: %" APR_SIZE_T_FMT "\n", expected_len); if (len != expected_len) { - fprintf(stderr, "apr_sendfile() didn't report the correct " + fprintf(stderr, "apr_socket_sendfile() didn't report the correct " "number of bytes sent!\n"); exit(1); } @@ -353,7 +353,7 @@ static int client(client_socket_mode_t socket_mode, char *host) apr_size_t tmplen; tmplen = len; /* bytes remaining to send from the file */ - printf("Calling apr_sendfile()...\n"); + printf("Calling apr_socket_sendfile()...\n"); printf("Headers (%d):\n", hdtr.numheaders); for (i = 0; i < hdtr.numheaders; i++) { printf("\t%d bytes (%c)\n", @@ -367,8 +367,8 @@ static int client(client_socket_mode_t socket_mode, char *host) hdtr.trailers[i].iov_len); } - rv = apr_sendfile(sock, f, &hdtr, ¤t_file_offset, &tmplen, 0); - printf("apr_sendfile()->%d, sent %ld bytes\n", rv, (long)tmplen); + rv = apr_socket_sendfile(sock, f, &hdtr, ¤t_file_offset, &tmplen, 0); + printf("apr_socket_sendfile()->%d, sent %ld bytes\n", rv, (long)tmplen); if (rv) { if (APR_STATUS_IS_EAGAIN(rv)) { assert(tmplen == 0); @@ -463,22 +463,22 @@ static int client(client_socket_mode_t socket_mode, char *host) exit(1); } - printf("After apr_sendfile(), the kernel file pointer is " + printf("After apr_socket_sendfile(), the kernel file pointer is " "at offset %ld.\n", (long int)current_file_offset); - rv = apr_shutdown(sock, APR_SHUTDOWN_WRITE); + rv = apr_socket_shutdown(sock, APR_SHUTDOWN_WRITE); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_shutdown()->%d/%s\n", + fprintf(stderr, "apr_socket_shutdown()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } bytes_read = 1; - rv = apr_recv(sock, buf, &bytes_read); + rv = apr_socket_recv(sock, buf, &bytes_read); if (rv != APR_EOF) { - fprintf(stderr, "apr_recv()->%d/%s (expected APR_EOF)\n", + fprintf(stderr, "apr_socket_recv()->%d/%s (expected APR_EOF)\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -490,7 +490,7 @@ static int client(client_socket_mode_t socket_mode, char *host) exit(1); } - printf("client: apr_sendfile() worked as expected!\n"); + printf("client: apr_socket_sendfile() worked as expected!\n"); rv = apr_file_remove(TESTFILE, p); if (rv != APR_SUCCESS) { @@ -534,17 +534,17 @@ static int server(void) exit(1); } - rv = apr_bind(sock, localsa); + rv = apr_socket_bind(sock, localsa); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_bind()->%d/%s\n", + fprintf(stderr, "apr_socket_bind()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = apr_listen(sock, 5); + rv = apr_socket_listen(sock, 5); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_listen()->%d/%s\n", + fprintf(stderr, "apr_socket_listen()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -552,9 +552,9 @@ static int server(void) printf("Waiting for a client to connect...\n"); - rv = apr_accept(&newsock, sock, p); + rv = apr_socket_accept(&newsock, sock, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_accept()->%d/%s\n", + fprintf(stderr, "apr_socket_accept()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -564,9 +564,9 @@ static int server(void) assert(sizeof buf > strlen(HDR1)); bytes_read = strlen(HDR1); - rv = apr_recv(newsock, buf, &bytes_read); + rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_recv()->%d/%s\n", + fprintf(stderr, "apr_socket_recv()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -584,9 +584,9 @@ static int server(void) assert(sizeof buf > strlen(HDR2)); bytes_read = strlen(HDR2); - rv = apr_recv(newsock, buf, &bytes_read); + rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_recv()->%d/%s\n", + fprintf(stderr, "apr_socket_recv()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -604,15 +604,15 @@ static int server(void) for (i = 0; i < HDR3_LEN; i++) { bytes_read = 1; - rv = apr_recv(newsock, buf, &bytes_read); + rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_recv()->%d/%s\n", + fprintf(stderr, "apr_socket_recv()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 1) { - fprintf(stderr, "apr_recv()->%ld bytes instead of 1\n", + fprintf(stderr, "apr_socket_recv()->%ld bytes instead of 1\n", (long int)bytes_read); exit(1); } @@ -629,15 +629,15 @@ static int server(void) for (i = 0; i < FILE_LENGTH; i++) { bytes_read = 1; - rv = apr_recv(newsock, buf, &bytes_read); + rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_recv()->%d/%s\n", + fprintf(stderr, "apr_socket_recv()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 1) { - fprintf(stderr, "apr_recv()->%ld bytes instead of 1\n", + fprintf(stderr, "apr_socket_recv()->%ld bytes instead of 1\n", (long int)bytes_read); exit(1); } @@ -654,9 +654,9 @@ static int server(void) assert(sizeof buf > strlen(TRL1)); bytes_read = strlen(TRL1); - rv = apr_recv(newsock, buf, &bytes_read); + rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_recv()->%d/%s\n", + fprintf(stderr, "apr_socket_recv()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -674,9 +674,9 @@ static int server(void) assert(sizeof buf > strlen(TRL2)); bytes_read = strlen(TRL2); - rv = apr_recv(newsock, buf, &bytes_read); + rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_recv()->%d/%s\n", + fprintf(stderr, "apr_socket_recv()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -694,15 +694,15 @@ static int server(void) for (i = 0; i < TRL3_LEN; i++) { bytes_read = 1; - rv = apr_recv(newsock, buf, &bytes_read); + rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_recv()->%d/%s\n", + fprintf(stderr, "apr_socket_recv()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 1) { - fprintf(stderr, "apr_recv()->%ld bytes instead of 1\n", + fprintf(stderr, "apr_socket_recv()->%ld bytes instead of 1\n", (long int)bytes_read); exit(1); } @@ -718,9 +718,9 @@ static int server(void) } bytes_read = 1; - rv = apr_recv(newsock, buf, &bytes_read); + rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_EOF) { - fprintf(stderr, "apr_recv()->%d/%s (expected APR_EOF)\n", + fprintf(stderr, "apr_socket_recv()->%d/%s (expected APR_EOF)\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); @@ -732,7 +732,7 @@ static int server(void) exit(1); } - printf("server: apr_sendfile() worked as expected!\n"); + printf("server: apr_socket_sendfile() worked as expected!\n"); return 0; } diff --git a/test/server.c b/test/server.c index fb298ea3f90..ff974cdea8e 100644 --- a/test/server.c +++ b/test/server.c @@ -128,10 +128,10 @@ int main(int argc, const char * const argv[]) } APR_TEST_SUCCESS(rv, "Binding socket to port", - apr_bind(sock, localsa)) + apr_socket_bind(sock, localsa)) APR_TEST_SUCCESS(rv, "Listening to socket", - apr_listen(sock, 5)) + apr_socket_listen(sock, 5)) APR_TEST_BEGIN(rv, "Setting up for polling", apr_poll_setup(&sdset, 1, context)) @@ -152,7 +152,7 @@ int main(int argc, const char * const argv[]) fprintf(stdout, "OK\n"); APR_TEST_SUCCESS(rv, "Accepting a connection", - apr_accept(&sock2, sock, context)) + apr_socket_accept(&sock2, sock, context)) apr_socket_protocol_get(sock2, &protocol); if (protocol != APR_PROTO_TCP) { @@ -171,7 +171,7 @@ int main(int argc, const char * const argv[]) length = STRLEN; APR_TEST_BEGIN(rv, "Receiving data from socket", - apr_recv(sock2, datasend, &length)) + apr_socket_recv(sock2, datasend, &length)) if (strcmp(datasend, "Send data test")) { fprintf(stdout, "Failed\n"); @@ -186,10 +186,10 @@ int main(int argc, const char * const argv[]) length = STRLEN; APR_TEST_SUCCESS(rv, "Sending data over socket", - apr_send(sock2, datarecv, &length)) + apr_socket_send(sock2, datarecv, &length)) APR_TEST_SUCCESS(rv, "Shutting down accepted socket", - apr_shutdown(sock2, APR_SHUTDOWN_READ)) + apr_socket_shutdown(sock2, APR_SHUTDOWN_READ)) APR_TEST_SUCCESS(rv, "Closing duplicate socket", apr_socket_close(sock2)) diff --git a/test/testpoll.c b/test/testpoll.c index 07f1b0364d4..b540f8edb3e 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -78,7 +78,7 @@ static int make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, apr_port_t port printf("couldn't create UDP socket, shutting down"); return 1; } - if (apr_bind((*sock), (*sa)) != APR_SUCCESS){ + if (apr_socket_bind((*sock), (*sa)) != APR_SUCCESS){ printf("couldn't bind UDP socket!"); return 1; } @@ -112,7 +112,7 @@ static void send_msg(apr_socket_t **sockarray, apr_sockaddr_t **sas, int which) char errmsg[120]; printf("\tSending message to socket %d............", which); - if ((rv = apr_sendto(sockarray[which], sas[which], 0, "hello", &len)) != APR_SUCCESS){ + if ((rv = apr_socket_sendto(sockarray[which], sas[which], 0, "hello", &len)) != APR_SUCCESS){ apr_strerror(rv, errmsg, sizeof errmsg); printf("Failed! %s\n", errmsg); exit(-1); @@ -131,7 +131,7 @@ static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p) apr_sockaddr_info_get(&recsa, "127.0.0.1", APR_UNSPEC, 7770, 0, p); printf("\tTrying to get message from socket %d....", which); - if ((rv = apr_recvfrom(recsa, sockarray[which], 0, buffer, &buflen)) + if ((rv = apr_socket_recvfrom(recsa, sockarray[which], 0, buffer, &buflen)) != APR_SUCCESS){ apr_strerror(rv, errmsg, sizeof errmsg); printf("Failed! %s\n", errmsg); diff --git a/test/testsockets.c b/test/testsockets.c index 80cedd201a2..7d42aa4dd86 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -134,16 +134,16 @@ int main(void) apr_sockaddr_info_get(&to, US, APR_UNSPEC, 7772, 0, pool); apr_sockaddr_info_get(&from, US, APR_UNSPEC, 7771, 0, pool); - STD_TEST_NEQ(" Binding socket #1", apr_bind(sock, to)) - STD_TEST_NEQ(" Binding socket #2", apr_bind(sock2, from)) + STD_TEST_NEQ(" Binding socket #1", apr_socket_bind(sock, to)) + STD_TEST_NEQ(" Binding socket #2", apr_socket_bind(sock2, from)) len = STRLEN; STD_TEST_NEQ(" Trying to sendto", - apr_sendto(sock2, to, 0, sendbuf, &len)) + apr_socket_sendto(sock2, to, 0, sendbuf, &len)) len = 80; STD_TEST_NEQ(" Trying to recvfrom", - apr_recvfrom(from, sock, 0, recvbuf, &len)) + apr_socket_recvfrom(from, sock, 0, recvbuf, &len)) printf("\t\tGot back %d bytes [%s] from recvfrom\n", len, recvbuf); apr_sockaddr_ip_get(&ip_addr, from); apr_sockaddr_port_get(&fromport, from); diff --git a/test/testtime.c b/test/testtime.c index 9dbfb18dfe7..09d9cb0c017 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -179,9 +179,9 @@ static void test_imp_gmt(CuTest *tc) rv = apr_time_exp_gmt(&xt, now); CuAssertTrue(tc, rv == APR_SUCCESS); - rv = apr_implode_gmt(&imp, &xt); + rv = apr_time_exp_gmt_get(&imp, &xt); if (rv == APR_ENOTIMPL) { - CuNotImpl(tc, "apr_implode_gmt"); + CuNotImpl(tc, "apr_time_exp_gmt_get"); } CuAssertTrue(tc, rv == APR_SUCCESS); CuAssertTrue(tc, now == imp); diff --git a/test/testuser.c b/test/testuser.c index cfda620c0cd..a08719a9ad8 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -93,14 +93,14 @@ int main(int argc, char *argv[]) fprintf(stderr, "optional: %s username\n", argv[0]); - if ((rv = apr_current_userid(&userid, &groupid, p)) != APR_SUCCESS) { - fprintf(stderr, "apr_current_userid failed: %s\n", + if ((rv = apr_uid_current(&userid, &groupid, p)) != APR_SUCCESS) { + fprintf(stderr, "apr_uid_current failed: %s\n", apr_strerror(rv, msgbuf, sizeof(msgbuf))); exit(-1); } - apr_get_username(&username, userid, p); + apr_uid_name_get(&username, userid, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_get_username(,,) failed: %s\n", + fprintf(stderr, "apr_uid_name_get(,,) failed: %s\n", apr_strerror(rv, msgbuf, sizeof(msgbuf))); exit(-1); } @@ -108,22 +108,22 @@ int main(int argc, char *argv[]) else { username = argv[1]; - rv = apr_get_userid(&userid, &groupid, username, p); + rv = apr_uid_get(&userid, &groupid, username, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_get_userid(,,%s,) failed: %s\n", + fprintf(stderr, "apr_uid_get(,,%s,) failed: %s\n", username, apr_strerror(rv, msgbuf, sizeof(msgbuf))); exit(-1); } } - rv = apr_group_name_get(&groupname, groupid, p); + rv = apr_gid_name_get(&groupname, groupid, p); if (rv != APR_SUCCESS) groupname = "(none)"; - rv = apr_get_groupid(&newgroupid, groupname, p); + rv = apr_gid_get(&newgroupid, groupname, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_get_groupid(,%s,) failed: %s\n", + fprintf(stderr, "apr_gid_get(,%s,) failed: %s\n", groupname, apr_strerror(rv, msgbuf, sizeof msgbuf)); exit(-1); @@ -143,9 +143,9 @@ int main(int argc, char *argv[]) username, (int)userid, (int)groupid); - rv = apr_get_home_directory(&homedir, username, p); + rv = apr_uid_homepath_get(&homedir, username, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_get_home_directory(,%s,) failed: %s\n", + fprintf(stderr, "apr_uid_homepath_get(,%s,) failed: %s\n", username, apr_strerror(rv, msgbuf, sizeof(msgbuf))); exit(-1); diff --git a/time/unix/time.c b/time/unix/time.c index 2669f30cffa..409cc2d1533 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -203,7 +203,8 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, apr_time_exp_t *xt) +APR_DECLARE(apr_status_t) apr_time_exp_gmt_get(apr_time_t *t, + apr_time_exp_t *xt) { apr_status_t status = apr_time_exp_get(t, xt); if (status == APR_SUCCESS) @@ -384,3 +385,10 @@ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, { return apr_time_exp_lt(result, input); } + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, apr_time_exp_t *xt) +{ + return apr_time_exp_gmt_get(t, xt); +} + diff --git a/time/win32/time.c b/time/win32/time.c index 94d92602ee6..b79602955ef 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -223,8 +223,8 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, - apr_time_exp_t *xt) +APR_DECLARE(apr_status_t) apr_time_exp_gmt_get(apr_time_t *t, + apr_time_exp_t *xt) { apr_status_t status = apr_time_exp_get(t, xt); if (status == APR_SUCCESS) @@ -319,3 +319,11 @@ APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, { return apr_time_exp_lt(result, input); } + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, + apr_time_exp_t *xt) +{ + return apr_time_exp_gmt_get(t, xt); +} + diff --git a/user/netware/groupinfo.c b/user/netware/groupinfo.c index 50b45bff675..46002c266ed 100644 --- a/user/netware/groupinfo.c +++ b/user/netware/groupinfo.c @@ -66,12 +66,14 @@ #include /* for _POSIX_THREAD_SAFE_FUNCTIONS */ #endif -APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, + apr_pool_t *p) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, const char *groupname, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, + const char *groupname, apr_pool_t *p) { return APR_ENOTIMPL; } @@ -80,5 +82,17 @@ APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, const char *groupn APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) { - return apr_group_name_get(groupname, groupid, p); + return apr_gid_name_get(groupname, groupid, p); +} + +APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, + apr_gid_t groupid, apr_pool_t *p) +{ + return apr_gid_name_get(groupname, groupid, p); +} + +APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, + const char *groupname, apr_pool_t *p) +{ + return apr_gid_get(groupid, groupname, p); } diff --git a/user/netware/userinfo.c b/user/netware/userinfo.c index 2f88a225d83..98ac409d74c 100644 --- a/user/netware/userinfo.c +++ b/user/netware/userinfo.c @@ -75,18 +75,18 @@ static apr_status_t getpwnam_safe(const char *username, return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, - const char *username, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, + const char *username, + apr_pool_t *p) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, - apr_gid_t *gid, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *uid, + apr_gid_t *gid, + apr_pool_t *p) { return APR_ENOTIMPL; } @@ -94,15 +94,43 @@ APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, -APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, - const char *username, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *uid, apr_gid_t *gid, + const char *username, apr_pool_t *p) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, + apr_pool_t *p) { return APR_ENOTIMPL; } - +/* deprecated */ +APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, + const char *username, + apr_pool_t *p) +{ + return apr_uid_homepath_get(dirname, username, p); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, + const char *username, apr_pool_t *p) +{ + return apr_uid_get(uid, gid, username, p); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, + apr_gid_t *gid, + apr_pool_t *p) +{ + return apr_uid_current(uid, gid, p); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) +{ + return apr_uid_name_get(username, uid, p); +} diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 8519b838fff..e0ba9aa90c1 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -66,7 +66,8 @@ #include /* for _POSIX_THREAD_SAFE_FUNCTIONS */ #endif -APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, + apr_pool_t *p) { struct group *gr; #ifndef BEOS @@ -86,7 +87,8 @@ APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, const char *groupname, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, + const char *groupname, apr_pool_t *p) { struct group *gr; #ifndef BEOS @@ -110,5 +112,17 @@ APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, const char *groupn APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) { - return apr_group_name_get(groupname, groupid, p); + return apr_gid_name_get(groupname, groupid, p); +} + +APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, + apr_gid_t groupid, apr_pool_t *p) +{ + return apr_gid_name_get(groupname, groupid, p); +} + +APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, + const char *groupname, apr_pool_t *p) +{ + return apr_gid_get(groupid, groupname, p); } diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 1455c8f5e6a..a268f521b9e 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -94,9 +94,9 @@ static apr_status_t getpwnam_safe(const char *username, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, - const char *username, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, + const char *username, + apr_pool_t *p) { struct passwd pw; char pwbuf[PWBUF_SIZE]; @@ -116,9 +116,9 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, -APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, - apr_gid_t *gid, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *uid, + apr_gid_t *gid, + apr_pool_t *p) { *uid = getuid(); *gid = getgid(); @@ -129,8 +129,8 @@ APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, -APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, - const char *username, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *uid, apr_gid_t *gid, + const char *username, apr_pool_t *p) { struct passwd pw; char pwbuf[PWBUF_SIZE]; @@ -145,7 +145,8 @@ APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, + apr_pool_t *p) { struct passwd *pw; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWUID_R) @@ -162,4 +163,33 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap return APR_SUCCESS; } - +/* deprecated */ +APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, + const char *username, + apr_pool_t *p) +{ + return apr_uid_homepath_get(dirname, username, p); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, + const char *username, apr_pool_t *p) +{ + return apr_uid_get(uid, gid, username, p); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, + apr_gid_t *gid, + apr_pool_t *p) +{ + return apr_uid_current(uid, gid, p); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, + apr_pool_t *p) +{ + return apr_uid_name_get(username, userid, p); +} + diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index c0a2af4a3a2..457a9063f2b 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -60,8 +60,8 @@ #include #endif -APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *gid, - const char *groupname, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *gid, + const char *groupname, apr_pool_t *p) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -104,7 +104,7 @@ APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *gid, #endif } -APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p) { #ifdef _WIN32_WCE *groupname = apr_pstrdup(p, "Administrators"); @@ -124,7 +124,7 @@ APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right) +APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right) { if (!left || !right) return APR_EINVAL; @@ -138,8 +138,25 @@ APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right) } /* Deprecated */ +APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, + apr_gid_t groupid, apr_pool_t *p) +{ + return apr_gid_name_get(groupname, groupid, p); +} + APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p) { return apr_group_name_get(groupname, groupid, p); } + +APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *gid, + const char *groupname, apr_pool_t *p) +{ + return apr_gid_get(gid, groupname, p); +} + +APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right) +{ + return apr_gid_compare(left, right); +} diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 28ae3ddd227..eb8e5bead2c 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -102,7 +102,9 @@ void get_sid_string(char *buf, int blen, apr_uid_t id) /* Query the ProfileImagePath from the version-specific branch, where the * regkey uses the user's name on 9x, and user's sid string on NT. */ -APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *username, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, + const char *username, + apr_pool_t *p) { #ifdef _WIN32_WCE *dirname = apr_pstrdup(p, "/My Documents"); @@ -119,7 +121,7 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use apr_uid_t uid; apr_gid_t gid; - if ((rv = apr_get_userid(&uid, &gid, username, p)) != APR_SUCCESS) + if ((rv = apr_uid_get(&uid, &gid, username, p)) != APR_SUCCESS) return rv; strcpy(regkey, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\" @@ -197,9 +199,9 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use #endif /* _WIN32_WCE */ } -APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, - apr_gid_t *gid, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *uid, + apr_gid_t *gid, + apr_pool_t *p) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -234,8 +236,8 @@ APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, #endif } -APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, - const char *username, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *uid, apr_gid_t *gid, + const char *username, apr_pool_t *p) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -281,7 +283,8 @@ APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, #endif } -APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, + apr_pool_t *p) { #ifdef _WIN32_WCE *username = apr_pstrdup(p, "Administrator"); @@ -301,7 +304,7 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap #endif } -APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right) +APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right) { if (!left || !right) return APR_EINVAL; @@ -313,3 +316,39 @@ APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right) #endif return APR_SUCCESS; } + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, + const char *username, + apr_pool_t *p) +{ + return apr_uid_homepath_get(dirname, username, p); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, + const char *username, apr_pool_t *p) +{ + return apr_uid_get(uid, gid, username, p); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, + apr_gid_t *gid, + apr_pool_t *p) +{ + return apr_uid_current(uid, gid, p); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right) +{ + return apr_uid_compare(left, right); +} + +/* deprecated */ +APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, + apr_pool_t *p) +{ + return apr_uid_name_get(username, userid, p); +} From 91e37bb0e83b2d9e8945fe8043cdb53eecbb9925 Mon Sep 17 00:00:00 2001 From: Thom May Date: Wed, 20 Nov 2002 03:52:27 +0000 Subject: [PATCH 4025/7878] Bah. kill tab. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64044 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index d738599e6c0..81751f87417 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ Changes with APR 0.9.2 - *) Add DougM's apr_rename.pl script into helpers, and update for the new batch of updates [Thom May] + *) Add DougM's apr_rename.pl script into helpers, and update for the new + batch of updates [Thom May] *) Renames done (deprecated functions wrapped): apr_filename_of_pathname -> apr_filepath_name_get From 01e60344fc692db487e785e2a951d8985f07ba44 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 20 Nov 2002 05:47:39 +0000 Subject: [PATCH 4026/7878] Call apr_initialize at startup of the child processes. You cannot have an unequal number of apr_terminate and apr_initialize calls. If you do, bad things will happen. In this case, the bad thing is that if the mutex is a semaphore, it will be destroyed before all of the processes die. That means that the test will most likely fail. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64045 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 72806837e6d..2f98d2618a8 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -81,6 +81,16 @@ static int make_child(apr_proc_t **proc, apr_pool_t *p) apr_sleep (1); if (apr_proc_fork(*proc, p) == APR_INCHILD) { + /* The parent process has setup all processes to call apr_terminate + * at exit. But, that means that all processes must also call + * apr_initialize at startup. You cannot have an unequal number + * of apr_terminate and apr_initialize calls. If you do, bad things + * will happen. In this case, the bad thing is that if the mutex + * is a semaphore, it will be destroyed before all of the processes + * die. That means that the test will most likely fail. + */ + apr_initialize(); + while (1) { apr_proc_mutex_lock(proc_lock); if (i == MAX_ITER) { From 417e76ab793a12a49819b7a434b4e9cca936da3b Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 20 Nov 2002 15:30:43 +0000 Subject: [PATCH 4027/7878] Win32: Fix Win32 compile break due to last commit (renames) Submitted by: Sebastian Bergmann Reviewed by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64046 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 2 +- network_io/win32/sockets.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index a32336e4cce..17bc3988f26 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -474,7 +474,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { - return apr_socket_send(sock. buf, len); + return apr_socket_send(sock, buf, len); } /* Deprecated */ diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 5bd0a133a18..dfb0f40ca50 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -523,7 +523,7 @@ APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) /* Deprecated */ APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) { - return apr_socket_listen(sock. backlog); + return apr_socket_listen(sock, backlog); } /* Deprecated */ From 65f1b9c4071a7b36552211e7299f83ca7f245c25 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 20 Nov 2002 17:33:53 +0000 Subject: [PATCH 4028/7878] Fixed a variable name mismatch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64047 13f79535-47bb-0310-9956-ffa450edef68 --- user/netware/userinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/netware/userinfo.c b/user/netware/userinfo.c index 98ac409d74c..a31fbe17f9b 100644 --- a/user/netware/userinfo.c +++ b/user/netware/userinfo.c @@ -132,5 +132,5 @@ APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, /* deprecated */ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) { - return apr_uid_name_get(username, uid, p); + return apr_uid_name_get(username, userid, p); } From 56793d3d3dce257206992cdaf5ace3f0164d9d3c Mon Sep 17 00:00:00 2001 From: Thom May Date: Wed, 20 Nov 2002 19:06:46 +0000 Subject: [PATCH 4029/7878] apr_get_groupname() is declared twice in apr/user/win32/groupinfo.c the second one should have been apr_group_name_get() Submitted by: Sebastian Bergmann (lists@sebastian-bergmann.de) Reviewed by: Thom May git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64048 13f79535-47bb-0310-9956-ffa450edef68 --- user/win32/groupinfo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index 457a9063f2b..9d35855d7a8 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -144,10 +144,10 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, return apr_gid_name_get(groupname, groupid, p); } -APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, - apr_gid_t groupid, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, + apr_gid_t groupid, apr_pool_t *p) { - return apr_group_name_get(groupname, groupid, p); + return apr_gid_name_get(groupname, groupid, p); } APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *gid, From 8b8165843dd59d9c451e37800e97969480bf3ba1 Mon Sep 17 00:00:00 2001 From: Thom May Date: Wed, 20 Nov 2002 19:30:31 +0000 Subject: [PATCH 4030/7878] Comment on renames status. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64049 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 1bf8925a77c..a66ec6e9edc 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/10/22 04:59:26 $] +Last modified at [$Date: 2002/11/20 19:30:31 $] Release: @@ -42,8 +42,11 @@ RELEASE SHOWSTOPPERS: and offer up any additions/vetos/clarifications. DougM offered to complete the work with his nifty perl rename script at the hackathon. + Thom says: I think this is close to done; does anyone want to add any + further renames? 1.0 showstopper (not 0.9.0): gstein + * When Win32 apr_proc_create was fixed, the apr_proc_t hproc member was added for that platform. That's a problem (and From 81d702d63fd1f86b669011095382687dbc56d926 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 20 Nov 2002 21:11:43 +0000 Subject: [PATCH 4031/7878] Register the proc_mutex cleanup with an exported API. Most of this change is just a name change to make it very obvious what is happening. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64050 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_proc_mutex.h | 8 +++++++ include/arch/unix/proc_mutex.h | 2 +- locks/unix/proc_mutex.c | 41 +++++++++++++++------------------- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index 408af28d9d8..94330a3d91e 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -162,6 +162,14 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex); */ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex); +/** + * Destroy the mutex and free the memory associated with the lock. + * @param mutex the mutex to destroy. + * @note This function is generally used to kill a cleanup on an already + * created mutex + */ +APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex); + /** * Display the name of the mutex, as it relates to the actual method used. * This matches the valid options for Apache's AcceptMutex directive diff --git a/include/arch/unix/proc_mutex.h b/include/arch/unix/proc_mutex.h index 09a887570f5..bc51247f4df 100644 --- a/include/arch/unix/proc_mutex.h +++ b/include/arch/unix/proc_mutex.h @@ -111,7 +111,7 @@ struct apr_proc_mutex_unix_lock_methods_t { apr_status_t (*acquire)(apr_proc_mutex_t *); apr_status_t (*tryacquire)(apr_proc_mutex_t *); apr_status_t (*release)(apr_proc_mutex_t *); - apr_status_t (*destroy)(apr_proc_mutex_t *); + apr_status_t (*cleanup)(void *); apr_status_t (*child_init)(apr_proc_mutex_t **, apr_pool_t *, const char *); const char *name; }; diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 24e1da7a9f9..cfbf62a450d 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -63,6 +63,12 @@ #define SEM_FAILED (-1) #endif +static apr_status_t proc_mutex_destroy(apr_proc_mutex_t *mutex) +{ + return apr_pool_cleanup_run(mutex->pool, mutex, apr_proc_mutex_cleanup); +} + + static void proc_mutex_posix_setup(void) { } @@ -122,7 +128,7 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, sem_unlink((const char *) semname); new_mutex->interproc->filedes = (int)psem; /* Ugg */ apr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, - proc_mutex_posix_cleanup, + apr_proc_mutex_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -149,17 +155,6 @@ static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_posix_destroy(apr_proc_mutex_t *mutex) -{ - apr_status_t stat; - - if ((stat = proc_mutex_posix_cleanup(mutex)) == APR_SUCCESS) { - apr_pool_cleanup_kill(mutex->pool, mutex, proc_mutex_posix_cleanup); - return APR_SUCCESS; - } - return stat; -} - static apr_status_t proc_mutex_posix_child_init(apr_proc_mutex_t **mutex, apr_pool_t *cont, const char *fname) @@ -178,7 +173,7 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_posix_methods = proc_mutex_posix_acquire, NULL, /* no tryacquire */ proc_mutex_posix_release, - proc_mutex_posix_destroy, + proc_mutex_posix_cleanup, proc_mutex_posix_child_init, "posixsem" }; @@ -234,7 +229,7 @@ static apr_status_t proc_mutex_sysv_create(apr_proc_mutex_t *new_mutex, } new_mutex->curr_locked = 0; apr_pool_cleanup_register(new_mutex->pool, - (void *)new_mutex, proc_mutex_sysv_cleanup, + (void *)new_mutex, apr_proc_mutex_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -294,7 +289,7 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods = proc_mutex_sysv_acquire, NULL, /* no tryacquire */ proc_mutex_sysv_release, - proc_mutex_sysv_destroy, + proc_mutex_sysv_cleanup, proc_mutex_sysv_child_init, "sysvsem" }; @@ -399,7 +394,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, new_mutex->curr_locked = 0; apr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, - proc_mutex_proc_pthread_cleanup, + apr_proc_mutex_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -469,7 +464,7 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_proc_pthread_method proc_mutex_proc_pthread_acquire, NULL, /* no tryacquire */ proc_mutex_proc_pthread_release, - proc_mutex_proc_pthread_destroy, + proc_mutex_proc_pthread_cleanup, proc_mutex_proc_pthread_child_init, "pthread" }; @@ -544,7 +539,7 @@ static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, unlink(new_mutex->fname); apr_pool_cleanup_register(new_mutex->pool, (void*)new_mutex, - proc_mutex_fcntl_cleanup, + apr_proc_mutex_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -605,7 +600,7 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods = proc_mutex_fcntl_acquire, NULL, /* no tryacquire */ proc_mutex_fcntl_release, - proc_mutex_fcntl_destroy, + proc_mutex_fcntl_cleanup, proc_mutex_fcntl_child_init, "fcntl" }; @@ -659,7 +654,7 @@ static apr_status_t proc_mutex_flock_create(apr_proc_mutex_t *new_mutex, } new_mutex->curr_locked = 0; apr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, - proc_mutex_flock_cleanup, + apr_proc_mutex_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -735,7 +730,7 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_flock_methods = proc_mutex_flock_acquire, NULL, /* no tryacquire */ proc_mutex_flock_release, - proc_mutex_flock_destroy, + proc_mutex_flock_cleanup, proc_mutex_flock_child_init, "flock" }; @@ -895,9 +890,9 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) return mutex->meth->release(mutex); } -APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) +APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex) { - return mutex->meth->destroy(mutex); + return ((apr_proc_mutex_t *)mutex)->meth->cleanup(mutex); } APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) From 07ca6313c01e649395e6e80ffb340446709a5484 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 20 Nov 2002 21:56:21 +0000 Subject: [PATCH 4032/7878] Rename apr_recvfrom -> apr_socket_recvfrom Missed in last round of renames. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64051 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sendrecv_udp.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c index 4667b9278cf..f7ad58241ac 100644 --- a/network_io/os2/sendrecv_udp.c +++ b/network_io/os2/sendrecv_udp.c @@ -101,9 +101,10 @@ APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, -APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, - apr_int32_t flags, char *buf, - apr_size_t *len) +APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, + apr_socket_t *sock, + apr_int32_t flags, char *buf, + apr_size_t *len) { apr_ssize_t rv; int serrno; @@ -147,3 +148,13 @@ APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, { return apr_socket_sendto(sock, where, flags, buf, len); } + + + +APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, + apr_socket_t *sock, + apr_int32_t flags, char *buf, + apr_size_t *len) +{ + return apr_socket_recvfrom(from, sock, flags, buf, len); +} From 4c9563daf2199c7d1625a9adae48e3cd59aeecbc Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 21 Nov 2002 15:05:47 +0000 Subject: [PATCH 4033/7878] apr_proc_mutex_destroy should be exported. Submitted By: jean-frederic clere git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64052 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index cfbf62a450d..6dfabb7c1c2 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -63,7 +63,7 @@ #define SEM_FAILED (-1) #endif -static apr_status_t proc_mutex_destroy(apr_proc_mutex_t *mutex) +APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) { return apr_pool_cleanup_run(mutex->pool, mutex, apr_proc_mutex_cleanup); } From 7bc075ec1d4dd229fe58fa694fce11e1fa989414 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 21 Nov 2002 15:59:35 +0000 Subject: [PATCH 4034/7878] get apr_proc_mutex_destroy() out from under #if APR_HAS_POSIXSEM_SERIALIZE git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64053 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 6dfabb7c1c2..2a2a1b301fd 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -57,18 +57,18 @@ #include "proc_mutex.h" #include "fileio.h" /* for apr_mkstemp() */ -#if APR_HAS_POSIXSEM_SERIALIZE - -#ifndef SEM_FAILED -#define SEM_FAILED (-1) -#endif - APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) { return apr_pool_cleanup_run(mutex->pool, mutex, apr_proc_mutex_cleanup); } +#if APR_HAS_POSIXSEM_SERIALIZE + +#ifndef SEM_FAILED +#define SEM_FAILED (-1) +#endif + static void proc_mutex_posix_setup(void) { } From 3d0609ffd2b153b7244d66380102c4e55f776e89 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 21 Nov 2002 16:28:08 +0000 Subject: [PATCH 4035/7878] axe the remaining proc_mutex_FOO_destroy() functions, which are no longer used git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64054 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 45 +---------------------------------------- 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 2a2a1b301fd..2c33c85d0a4 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -262,17 +262,6 @@ static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_sysv_destroy(apr_proc_mutex_t *mutex) -{ - apr_status_t rv; - - if ((rv = proc_mutex_sysv_cleanup(mutex)) == APR_SUCCESS) { - apr_pool_cleanup_kill(mutex->pool, mutex, proc_mutex_sysv_cleanup); - return APR_SUCCESS; - } - return rv; -} - static apr_status_t proc_mutex_sysv_child_init(apr_proc_mutex_t **mutex, apr_pool_t *cont, const char *fname) { return APR_SUCCESS; @@ -438,18 +427,6 @@ static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_proc_pthread_destroy(apr_proc_mutex_t *mutex) -{ - apr_status_t rv; - if ((rv = proc_mutex_proc_pthread_cleanup(mutex)) == APR_SUCCESS) { - apr_pool_cleanup_kill(mutex->pool, - mutex, - proc_mutex_proc_pthread_cleanup); - return APR_SUCCESS; - } - return rv; -} - static apr_status_t proc_mutex_proc_pthread_child_init(apr_proc_mutex_t **mutex, apr_pool_t *cont, const char *fname) @@ -572,16 +549,6 @@ static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_fcntl_destroy(apr_proc_mutex_t *mutex) -{ - apr_status_t rv; - if ((rv = proc_mutex_fcntl_cleanup(mutex)) == APR_SUCCESS) { - apr_pool_cleanup_kill(mutex->pool, mutex, proc_mutex_fcntl_cleanup); - return APR_SUCCESS; - } - return rv; -} - static apr_status_t proc_mutex_fcntl_child_init(apr_proc_mutex_t **mutex, apr_pool_t *pool, const char *fname) @@ -687,16 +654,6 @@ static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_flock_destroy(apr_proc_mutex_t *mutex) -{ - apr_status_t rv; - if ((rv = proc_mutex_flock_cleanup(mutex)) == APR_SUCCESS) { - apr_pool_cleanup_kill(mutex->pool, mutex, proc_mutex_flock_cleanup); - return APR_SUCCESS; - } - return rv; -} - static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, apr_pool_t *pool, const char *fname) @@ -712,7 +669,7 @@ static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, APR_WRITE, 0, new_mutex->pool); if (rv != APR_SUCCESS) { - proc_mutex_flock_destroy(new_mutex); + proc_mutex_flock_cleanup(new_mutex); return rv; } *mutex = new_mutex; From ec5db05832f32f89812d5fbbb6db23f04b1537aa Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 22 Nov 2002 06:19:24 +0000 Subject: [PATCH 4036/7878] Add a new test, testfileinfo. This came from the old testfile program, but I split it up to make the tests more managable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64055 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testfileinfo.c | 195 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 199 insertions(+), 2 deletions(-) create mode 100644 test/testfileinfo.c diff --git a/test/Makefile.in b/test/Makefile.in index 5d09767cd87..4176440fe49 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -161,8 +161,8 @@ testrand@EXEEXT@: testrand.lo $(LOCAL_LIBS) testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) $(LINK) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) -testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo testdir.lo CuTest.lo $(LOCAL_LIBS) - $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo testdir.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) +testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo testdir.lo testfileinfo.lo CuTest.lo $(LOCAL_LIBS) + $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo testdir.lo testfileinfo.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index 3295fbde018..964309bc151 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -78,6 +78,7 @@ CuSuite *testpool(void); CuSuite *testfmt(void); CuSuite *testfile(void); CuSuite *testdir(void); +CuSuite *testfileinfo(void); diff --git a/test/testall.c b/test/testall.c index d048dd3366b..3eeeae25c9f 100644 --- a/test/testall.c +++ b/test/testall.c @@ -77,6 +77,7 @@ static testfunc *tests[NUM_TESTS] = { testfmt, testfile, testdir, + testfileinfo, NULL }; diff --git a/test/testfileinfo.c b/test/testfileinfo.c new file mode 100644 index 00000000000..af2f5b47262 --- /dev/null +++ b/test/testfileinfo.c @@ -0,0 +1,195 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_file_io.h" +#include "apr_file_info.h" +#include "apr_strings.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_poll.h" +#include "apr_lib.h" +#include "test_apr.h" + +#define FILENAME "data/file_datafile.txt" + +struct view_fileinfo +{ + apr_int32_t bits; + char *description; +} vfi[] = { + {APR_FINFO_MTIME, "MTIME"}, + {APR_FINFO_CTIME, "CTIME"}, + {APR_FINFO_ATIME, "ATIME"}, + {APR_FINFO_SIZE, "SIZE"}, + {APR_FINFO_DEV, "DEV"}, + {APR_FINFO_INODE, "INODE"}, + {APR_FINFO_NLINK, "NLINK"}, + {APR_FINFO_TYPE, "TYPE"}, + {APR_FINFO_USER, "USER"}, + {APR_FINFO_GROUP, "GROUP"}, + {APR_FINFO_UPROT, "UPROT"}, + {APR_FINFO_GPROT, "GPROT"}, + {APR_FINFO_WPROT, "WPROT"}, + {0, NULL} +}; + +int finfo_equal(apr_finfo_t f1, apr_finfo_t f2) +{ + return (f1.valid == f2.valid && + f1.protection == f2.protection && + f1.filetype == f2.filetype && + f1.user == f2.user && + f1.group == f2.group && + f1.inode == f2.inode && + f1.device == f2.device && + f1.nlink == f2.nlink && + f1.size == f2.size && +/* Can't check csize, we don't fill it out, which makes me wonder why it + * is still there. + * f1.csize == f2.csize && + */ + f1.atime == f2.atime && + f1.mtime == f2.mtime && + f1.ctime == f2.ctime && + !strcmp(f1.fname, f2.fname)); +/* We also can't check name, because it is only ever set on Unix. This + * means that we have non-portable fields in a transparant structure. + !strcmp(f1.name, f2.name)); + */ +} + +static void test_info_get(CuTest *tc) +{ + apr_file_t *thefile; + apr_finfo_t finfo; + apr_status_t rv; + + rv = apr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); + if (rv == APR_INCOMPLETE) { + char *str = apr_palloc(p, 256); + int i; + str = apr_pstrdup(p, "APR_INCOMPLETE: Missing "); + for (i = 0; vfi[i].bits; ++i) { + if (vfi[i].bits & ~finfo.valid) { + str = apr_pstrcat(p, str, vfi[i].description); + } + } + CuFail(tc, str); + } + CuAssertIntEquals(tc, APR_SUCCESS, rv); + apr_file_close(thefile); +} + +static void test_stat(CuTest *tc) +{ + apr_file_t *thefile; + apr_finfo_t finfo; + apr_status_t rv; + + rv = apr_stat(&finfo, FILENAME, APR_FINFO_NORM, p); + if (rv == APR_INCOMPLETE) { + char *str = apr_palloc(p, 256); + int i; + str = apr_pstrdup(p, "APR_INCOMPLETE: Missing "); + for (i = 0; vfi[i].bits; ++i) { + if (vfi[i].bits & ~finfo.valid) { + str = apr_pstrcat(p, str, vfi[i].description); + } + } + CuFail(tc, str); + } + CuAssertIntEquals(tc, APR_SUCCESS, rv); + apr_file_close(thefile); +} + +static void test_stat_eq_finfo(CuTest *tc) +{ + apr_file_t *thefile; + apr_finfo_t finfo; + apr_finfo_t stat_finfo; + apr_status_t rv; + + rv = apr_stat(&stat_finfo, FILENAME, APR_FINFO_NORM, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); + apr_file_close(thefile); + + CuAssert(tc, "results from apr_stat are not identical to results " + "from apr_finfo", finfo_equal(stat_finfo, finfo)); +} + +CuSuite *testfileinfo(void) +{ + CuSuite *suite = CuSuiteNew("Test File Info"); + + SUITE_ADD_TEST(suite, test_info_get); + SUITE_ADD_TEST(suite, test_stat); + SUITE_ADD_TEST(suite, test_stat_eq_finfo); + + return suite; +} + +#ifdef SINGLE_PROG +CuSuite *getsuite(void) +{ + return testfileinfo(); +} +#endif + From 7e2604a78a4f5bff25081101e81ca11fa7be783a Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 22 Nov 2002 16:19:50 +0000 Subject: [PATCH 4037/7878] Win32: Fix apr_stat() fooness. When passing in a filename like c:/foo/
    , the < and > were treated like wildcards and the apr_stat call would succeed indicating a filename of perhaps 'aaa' if aaa were a directory in c:/foo. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64056 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 5839badfaf8..611715d2a05 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -503,6 +503,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * enough string to handle the longest file name. */ char tmpname[APR_FILE_MAX * 3 + 1]; + const char *name; HANDLE hFind; if (strchr(fname, '*') || strchr(fname, '?')) return APR_ENOENT; @@ -514,6 +515,13 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, FileInfo.w.cFileName)) { return APR_ENAMETOOLONG; } + /* If fname does not match the name returned by FindFirstFile + * then fname does not exist and we're done. + */ + name = apr_filepath_name_get(fname); + if (strcasecmp(name, tmpname)) { + return APR_ENOENT; + } filename = apr_pstrdup(pool, tmpname); } } @@ -554,6 +562,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * or are looking for the root of a Win98 drive. */ HANDLE hFind; + const char *name; if (strchr(fname, '*') || strchr(fname, '?')) return APR_ENOENT; hFind = FindFirstFileA(fname, &FileInfo.n); @@ -561,6 +570,13 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, return apr_get_os_error(); } FindClose(hFind); + /* If fname does not match the name returned by FindFirstFile + * then fname does not exist and we're done. + */ + name = apr_filepath_name_get(fname); + if (strcasecmp(name, FileInfo.n.cFileName)) { + return APR_ENOENT; + } filename = apr_pstrdup(pool, FileInfo.n.cFileName); } #endif From ce10360dd2965ec0b53ff383e09f2b62dfbbdaf2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 22 Nov 2002 17:01:12 +0000 Subject: [PATCH 4038/7878] Getpass on Solaris has an 8 character limit, which makes it less than useful. By switching to getpassphrase, we get a 256 character limit. Submitted by: Florin Iucha git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64057 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- passwd/apr_getpass.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index dbee0e6c463..f287aca7e0f 100644 --- a/configure.in +++ b/configure.in @@ -873,7 +873,7 @@ if test "$native_mmap_emul" = "1"; then mmap="1" fi AC_CHECK_FUNCS(memmove, [ have_memmove="1" ], [have_memmove="0" ]) -AC_CHECK_FUNCS([getpass gmtime_r localtime_r hstrerror mkstemp]) +AC_CHECK_FUNCS([getpass getpassphrase gmtime_r localtime_r hstrerror mkstemp]) AC_SUBST(fork) AC_SUBST(have_inet_addr) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 78bab66233e..72c67775eaf 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -253,7 +253,11 @@ static char *getpass(const char *prompt) APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, apr_size_t *bufsiz) { +#ifdef HAVE_GETPASSPHRASE + char *pw_got = getpassphrase(prompt); +#else char *pw_got = getpass(prompt); +#endif if (!pw_got) return APR_EINVAL; apr_cpystrn(pwbuf, pw_got, *bufsiz); From 1a1c6622de92bacd2cb765edab63fc426d173fae Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 22 Nov 2002 20:33:06 +0000 Subject: [PATCH 4039/7878] Implemention of apr_proc_mutex_cleanup() for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64058 13f79535-47bb-0310-9956-ffa450edef68 --- locks/netware/proc_mutex.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index e86802104b7..6d4c9968fc8 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -108,6 +108,11 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) return APR_ENOLOCK; } +APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex) +{ + return apr_proc_mutex_destroy(mutex); +} + APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) { if (mutex) From 29b49dfef481dec2a76e971fb22e72d0ac5abf85 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Sat, 23 Nov 2002 00:38:13 +0000 Subject: [PATCH 4040/7878] Added charset.c to the NetWare project file git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64059 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 171766 -> 171800 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 8e303b27852e214be6c909cf35d9ef69cf79f45b..f9d5c14e61f378e50b8ba31b2f05ad83090221b7 100644 GIT binary patch delta 64768 zcmZ6ycRbtQ7eD^??og$aDz&%NUNu6{Va04|&7gMCQnBZ&t)e!GJ=;>FR_zs3%@DMd zP^$+W@OalVvmM0lQ_RVE=l8Ixw6p?b7%L%-vUq&I zW&tY9g5sdHHWU+~3o7f`7iKovveu5s8@O)#7Z8?M+g8?g8b+p}@9n|;0>LOZI?svz zew)+i5tEi%jhxejP1}>nq1~#$#%^>ufnx-v%#qsSM%QMEnN@bMJkL2BeRPud`Q7L1 zzB}<=Q_ueV-rjljvnn=MR%Bg=F5k2QHRl)8V=geRNIamT~y*&_gw3*FLScL zr~~R!^iIEKmi_kliNW96nRTdWD0$CGC{I>xd%16IK(hX|^7{04_EN>lM#E6Sb_Bz* z{I-vB-_c*GXH(~E=i3rz3aO_Oq9uJTDcmI4f}i(G0K`&=_jOIRtKPJPjRvRfDiFL! zq!D}lu;iBh>)f~7rR~0@N#h)jS@g<_^g5Cev`>DWC7$PUDO6e*PSuZ0yT^^!SEmXE zxP=yYyQsYQlS7=9u*}Qj>thxgjV=_@n}K~utBlc#XM7H! zAD4T#tR5sz=LHR1-Q9AUHd}qKPN^P#Mg4eeor9i%lVvwzV9@Anr|YFA9oJf$CBw`U zUmd?=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2S^>oj1o{3X%;CJ3fKEPSQa0 zvJAkWX{*dTqISXJwUf52Q|Gy-X9!^^W^3mHP(Gv$$MfMn&5ER6y##x*=yFy)SnYII zjUgZKb>p82hZ(TxjoFVn*0sd~% z{enepq7Zob^jlA^@z9g59Eio3hvntO}3a%2e zG2aW9Rn6btj(fUzLy&xMm%38|{!J=Xqx#&7lv1ga-tvT#uteNmckLz%AaxR|wz(E< z^)Kd`?0AzHvemQ+toBHFMIY(vIJ$jwSR?k_l0%_fbL}xlV>t*I{F+Btd^y_W z%0TIR(aACoULB|H|A-0JWJhm}I_&@FH<$)%C%kl6_}_m3@Z7`tUuiP8<9`3gLdNz_ zvb(c6Df!yOle-;M`e0Q}H48V!f{pL~*YL>%p+k%ZH_3jjMK#INck#_|Mr?iD6?+Z= zo$zeNcLyAP4W+u2EaO{LdUi21=my4mx34=OXmb1*jJeqf2(&id_S;hboX)C|=rDz_#E7k`!u5GY5STjYNCCO7=$lYmHh!pk z3}vJ#0mPrbz!~8_H)lK~BS=2qz^r#B0*uRusM$?$MpTmia5O%KBb@!HaF8H(1v?UP zt}nkA%Nol-U&v#yZCMdp!>;(91vsQBFJeoTmy@7_3=YZL-aff`)}a~Ge})f3Zg8n| zsx22gOlFm7q`6wd10AQR5D}sVVad3Kta@2vihqHFKCzL5ifuk|Osyjxz{#o)bpQK_ zJ=pO;7Pdys?S8U09jX;nL-^-!8irqCq)tGEr))>1p#F#rk|3ne8S<+Om&DI{*0jA)WP8Mm zEaW_e{EK&=_W_NI)^Lyz_?hWOG~3x$dizt#vARW52Q`CE|0(5VjQji|9BuPm>>t8& zava-B4sWFdcR_7~STHRKXNY~`j~z!OA%dQO= Date: Sat, 23 Nov 2002 00:47:40 +0000 Subject: [PATCH 4041/7878] OS/2: Make apr_proc_mutex_cleanup() public to match recent API change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64060 13f79535-47bb-0310-9956-ffa450edef68 --- locks/os2/proc_mutex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 7338e466b2d..54309c63a49 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -87,7 +87,7 @@ static char *fixed_name(const char *fname, apr_pool_t *pool) -static apr_status_t proc_mutex_cleanup(void *vmutex) +APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *vmutex) { apr_proc_mutex_t *mutex = vmutex; return apr_proc_mutex_destroy(mutex); @@ -127,7 +127,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, rc = DosCreateMutexSem(semname, &(new->hMutex), DC_SEM_SHARED, FALSE); if (!rc) { - apr_pool_cleanup_register(pool, new, proc_mutex_cleanup, apr_pool_cleanup_null); + apr_pool_cleanup_register(pool, new, apr_proc_mutex_cleanup, apr_pool_cleanup_null); } return APR_FROM_OS_ERROR(rc); @@ -153,7 +153,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, *mutex = new; if (!rc) { - apr_pool_cleanup_register(pool, new, proc_mutex_cleanup, apr_pool_cleanup_null); + apr_pool_cleanup_register(pool, new, apr_proc_mutex_cleanup, apr_pool_cleanup_null); } return APR_FROM_OS_ERROR(rc); From 08b2d15c023a35e219b9c150713250213f1b0bbf Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 23 Nov 2002 04:29:55 +0000 Subject: [PATCH 4042/7878] Fix a bug in apr_hash_merge() which caused the last entry in the overlay has to be lost. PR: 10522 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64061 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ tables/apr_hash.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 81751f87417..abaae4b2898 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR 0.9.2 + + *) Fix a bug in apr_hash_merge() which caused the last entry in the + overlay has to be lost. PR 10522 [Jeff Trawick] + *) Add DougM's apr_rename.pl script into helpers, and update for the new batch of updates [Thom May] diff --git a/tables/apr_hash.c b/tables/apr_hash.c index dc99943fe95..4a0fc5dbef7 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -442,7 +442,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, } } - for (k = 0; k < overlay->max; k++) { + for (k = 0; k <= overlay->max; k++) { for (iter = overlay->array[k]; iter; iter = iter->next) { i = iter->hash & res->max; for (ent = res->array[i]; ent; ent = ent->next) { From 4050ae45f537fe80668b6b310001f42193e88f38 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 23 Nov 2002 04:32:58 +0000 Subject: [PATCH 4043/7878] fix a typo in a CHANGES entry git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64062 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index abaae4b2898..6c25b276ca2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,7 @@ Changes with APR 0.9.2 *) Fix a bug in apr_hash_merge() which caused the last entry in the - overlay has to be lost. PR 10522 [Jeff Trawick] + overlay hash to be lost. PR 10522 [Jeff Trawick] *) Add DougM's apr_rename.pl script into helpers, and update for the new batch of updates [Thom May] From a12a21f55c8f27f36a2c3e8ecacbc5ffc70a2050 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 23 Nov 2002 12:37:12 +0000 Subject: [PATCH 4044/7878] Fix test_stat function; don't call apr_file_close on a dangling pointer. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64063 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfileinfo.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/testfileinfo.c b/test/testfileinfo.c index af2f5b47262..ee4ece7b70d 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -136,7 +136,6 @@ static void test_info_get(CuTest *tc) static void test_stat(CuTest *tc) { - apr_file_t *thefile; apr_finfo_t finfo; apr_status_t rv; @@ -153,7 +152,6 @@ static void test_stat(CuTest *tc) CuFail(tc, str); } CuAssertIntEquals(tc, APR_SUCCESS, rv); - apr_file_close(thefile); } static void test_stat_eq_finfo(CuTest *tc) From 3a10c16bb1d57031f46048a136687a30d596e815 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 23 Nov 2002 16:04:51 +0000 Subject: [PATCH 4045/7878] Migrate testrand to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64064 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 11 ++--------- test/test_apr.h | 1 + test/testall.c | 1 + test/testrand.c | 49 ++++++++++++++++++++++++------------------------ 4 files changed, 29 insertions(+), 33 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 4176440fe49..68790fda106 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -28,7 +28,6 @@ PROGRAMS = \ occhild@EXEEXT@ \ testuser@EXEEXT@ \ testsockets@EXEEXT@ \ - testrand@EXEEXT@ \ testdup@EXEEXT@ \ testatomic@EXEEXT@ \ testmutexscope@EXEEXT@ \ @@ -58,9 +57,6 @@ check: $(PROGRAMS) $(NONPORTABLE) fi \ done -testfile@EXEEXT@: testfile.lo $(LOCAL_LIBS) - $(LINK) testfile.lo $(LOCAL_LIBS) $(ALL_LIBS) - testdir@EXEEXT@: testdir.lo $(LOCAL_LIBS) $(LINK) testdir.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -155,14 +151,11 @@ testatomic@EXEEXT@: testatomic.lo $(LOCAL_LIBS) testdup@EXEEXT@: testdup.lo $(LOCAL_LIBS) $(LINK) testdup.lo $(LOCAL_LIBS) $(ALL_LIBS) -testrand@EXEEXT@: testrand.lo $(LOCAL_LIBS) - $(LINK) testrand.lo $(LOCAL_LIBS) $(ALL_LIBS) - testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) $(LINK) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) -testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo testdir.lo testfileinfo.lo CuTest.lo $(LOCAL_LIBS) - $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo testdir.lo testfileinfo.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) +testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo CuTest.lo $(LOCAL_LIBS) + $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index 964309bc151..31d36465a18 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -79,6 +79,7 @@ CuSuite *testfmt(void); CuSuite *testfile(void); CuSuite *testdir(void); CuSuite *testfileinfo(void); +CuSuite *testrand(void); diff --git a/test/testall.c b/test/testall.c index 3eeeae25c9f..714ca08b2b8 100644 --- a/test/testall.c +++ b/test/testall.c @@ -78,6 +78,7 @@ static testfunc *tests[NUM_TESTS] = { testfile, testdir, testfileinfo, + testrand, NULL }; diff --git a/test/testrand.c b/test/testrand.c index f57c9b3123b..e4f8191cc8e 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -58,38 +58,39 @@ #include #include "test_apr.h" -#if !APR_HAS_RANDOM -#error Random support is not available. Go punt. -#endif - -int main(void) +static void rand_exists(CuTest *tc) { +#if !APR_HAS_RANDOM + CuNotImpl(tc, "apr_generate_random_bytes"); +#else apr_pool_t *p; apr_status_t rv; unsigned char c[2048]; int i; - apr_initialize(); - - printf("Testing apr_generate_random_bytes()\n===================\n\n"); - - if (apr_pool_create(&p, NULL) != APR_SUCCESS) { - exit(-1); - } - + /* There must be a better way to test random-ness, but I don't know + * what it is right now. + */ for (i = 1; i <= 8; i++) { - printf("%-5d %-55s", i * 255, "bytes"); rv = apr_generate_random_bytes(c, i * 255); - if (rv != APR_SUCCESS) { - char msgbuf[120]; - - printf("Failed: %d %s\n", rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); - } - else { - printf("OK\n"); - } + CuAssertIntEquals(tc, APR_SUCCESS, rv); } - - return 0; +#endif } +CuSuite *testrand(void) +{ + CuSuite *suite = CuSuiteNew("Test Random"); + + SUITE_ADD_TEST(suite, rand_exists); + + return suite; +} + +#ifdef SINGLE_PROG +CuSuite *getsuite(void) +{ + return testrand(); +} +#endif + From 7abc38440bbd4ea7e375936bf2263323b1358cbc Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 23 Nov 2002 19:44:15 +0000 Subject: [PATCH 4046/7878] Change how individual test programs are run. Now, testall is the driver for all tests. IF you just want to run individual tests, you do that by passing the name of the test to testall. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64065 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 10 +++++-- test/README | 41 +++++----------------------- test/testall.c | 66 +++++++++++++++++++++++++++++++-------------- test/testdir.c | 7 ----- test/testfile.c | 8 ------ test/testfileinfo.c | 7 ----- test/testfmt.c | 7 ----- test/testipsub.c | 7 ----- test/testmmap.c | 7 ----- test/testpools.c | 8 ------ test/testrand.c | 7 ----- test/testsleep.c | 8 ------ test/teststr.c | 6 ----- test/testtable.c | 7 ----- test/testtime.c | 6 ----- test/testud.c | 7 ----- test/testvsn.c | 6 ----- 17 files changed, 61 insertions(+), 154 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 68790fda106..59646a1ed2f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -154,8 +154,14 @@ testdup@EXEEXT@: testdup.lo $(LOCAL_LIBS) testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) $(LINK) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) -testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo CuTest.lo $(LOCAL_LIBS) - $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) +testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ + testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ + testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ + testdso.lo CuTest.lo mod_test.la libmod_test.la $(LOCAL_LIBS) + $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ + testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ + testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ + testdso.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/README b/test/README index 7501975b930..ec1028d342b 100644 --- a/test/README +++ b/test/README @@ -59,43 +59,16 @@ To run it, run: ./testall -Individual Program ------------------- - -The second way to run a test program is as an individual program. This is -done with another function, getsuite. This function should always look like: - -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return testtime(); -} -#endif - -Notice that all this function does is return the suite that is generated -in the function used by the full driver. This is very important. - -Also, notice that this function is protected by "#ifdef SINGLE_PROG". All -test programs should include this function. The individual program will -call this function to get the suite, and then it will run the suite and -print the output. - -The reason that this function must be protected, is that all test programs -have this function, and when they are linked into the full driver, they -conflict with each other. I hope to fix this problem soon. - -Building individual test programs +Running individual tests --------------------------------- -To build individual test programs, you must do the following (for example): - - MY_CFLAGS=-DSINGLE_PROGRAM make testtime - -To run the test, run: +It is not possible to build individual tests, however it is possible to +run individual tests. When running the test suite, specify the name of the +tests that you want to run on the command line. For example: - ./testtime + ./testall teststr testrand -Most people should just build the full test driver. +Will run the Strings and Random generator tests. Reading the test suite output ----------------------------- @@ -165,7 +138,7 @@ Adding New test Suites to the full driver To add a new Suite to the full driver, you must make a couple of modifications. 1) Edit test_apr.h, and add the prototype for the function. -2) Edit testall.c, and add the function to the tests array. +2) Edit testall.c, and add the function and name to the tests array. 3) Edit Makefile.in, and add the .lo file to the testall target. Once those four things are done, your tests will automatically be added diff --git a/test/testall.c b/test/testall.c index 714ca08b2b8..a795f368649 100644 --- a/test/testall.c +++ b/test/testall.c @@ -62,31 +62,36 @@ /* Top-level pool which can be used by tests. */ apr_pool_t *p; -typedef CuSuite *(testfunc)(void); +struct testlist { + char *testname; + CuSuite *(*func)(void); +}; +typedef struct testlist testlist; -static testfunc *tests[NUM_TESTS] = { - teststr, - testtime, - testvsn, - testipsub, - testmmap, - testud, - testtable, - testsleep, - testpool, - testfmt, - testfile, - testdir, - testfileinfo, - testrand, - NULL +static testlist tests[NUM_TESTS] = { + {"teststr", teststr}, + {"testtime", testtime}, + {"testvsn", testvsn}, + {"testipsub", testipsub}, + {"testmmap", testmmap}, + {"testud", testud}, + {"testtable", testtable}, + {"testsleep", testsleep}, + {"testpool", testpool}, + {"testfmt", testfmt}, + {"testfile", testfile}, + {"testdir", testdir}, + {"testfileinfo", testfileinfo}, + {"testrand", testrand}, + {"LastTest", NULL} }; int main(int argc, char *argv[]) { - CuSuiteList *alltests = CuSuiteListNew("All APR Tests"); + CuSuiteList *alltests; CuString *output = CuStringNew(); int i; + int partial = 0; apr_initialize(); atexit(apr_terminate); @@ -95,8 +100,29 @@ int main(int argc, char *argv[]) apr_pool_create(&p, NULL); - for (i = 0; tests[i]; i++) { - CuSuiteListAdd(alltests, tests[i]()); + /* build the list of tests to run */ + for (i = 1; i < argc; i++) { + int j; + if (!strcmp(argv[i], "-v")) { + continue; + } + for (j = 0; tests[j].func != NULL; j++) { + if (!strcmp(argv[i], tests[j].testname)) { + if (!partial) { + alltests = CuSuiteListNew("Partial APR Tests"); + partial = 1; + } + + CuSuiteListAdd(alltests, tests[j].func()); + } + } + } + + if (!partial) { + alltests = CuSuiteListNew("All APR Tests"); + for (i = 0; tests[i].func != NULL; i++) { + CuSuiteListAdd(alltests, tests[i].func()); + } } CuSuiteListRunWithSummary(alltests); diff --git a/test/testdir.c b/test/testdir.c index 1d0d53581c2..e9449c9e5e2 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -316,10 +316,3 @@ CuSuite *testdir(void) return suite; } -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return testdir(); -} -#endif - diff --git a/test/testfile.c b/test/testfile.c index 755c29098bb..00b9d32b1ae 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -462,11 +462,3 @@ CuSuite *testfile(void) return suite; } -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return testfile(); -} -#endif - - diff --git a/test/testfileinfo.c b/test/testfileinfo.c index ee4ece7b70d..e4b917acce2 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -184,10 +184,3 @@ CuSuite *testfileinfo(void) return suite; } -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return testfileinfo(); -} -#endif - diff --git a/test/testfmt.c b/test/testfmt.c index edbfb269622..f97fe08bf04 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -115,10 +115,3 @@ CuSuite *testfmt(void) return suite; } -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return testfmt(); -} -#endif - diff --git a/test/testipsub.c b/test/testipsub.c index 1951b3f95e0..9bbe7915c80 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -209,10 +209,3 @@ CuSuite *testipsub(void) return suite; } -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return testipsub(); -} -#endif - diff --git a/test/testmmap.c b/test/testmmap.c index 3734def1ad4..f79d1c0b55a 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -165,10 +165,3 @@ CuSuite *testmmap(void) return suite; } -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return testmmap(); -} -#endif - diff --git a/test/testpools.c b/test/testpools.c index 5da1f2b9e8a..cb8df339e40 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -144,11 +144,3 @@ CuSuite *testpool(void) return suite; } -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return testpool(); -} -#endif - - diff --git a/test/testrand.c b/test/testrand.c index e4f8191cc8e..8d7f3a08ee1 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -87,10 +87,3 @@ CuSuite *testrand(void) return suite; } -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return testrand(); -} -#endif - diff --git a/test/testsleep.c b/test/testsleep.c index af097dbdf03..d93313c4aa6 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -90,11 +90,3 @@ CuSuite *testsleep(void) return suite; } -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return testsleep(); -} -#endif - - diff --git a/test/teststr.c b/test/teststr.c index 31a60be2aca..af952e09d89 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -175,9 +175,3 @@ CuSuite *teststr(void) return suite; } -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return teststr(); -} -#endif diff --git a/test/testtable.c b/test/testtable.c index b71c4f78a6d..74194595bcd 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -204,10 +204,3 @@ CuSuite *testtable(void) return suite; } -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return testtable(); -} -#endif - diff --git a/test/testtime.c b/test/testtime.c index 09d9cb0c017..ad1843e859c 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -304,9 +304,3 @@ CuSuite *testtime(void) return suite; } -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return testtime(); -} -#endif diff --git a/test/testud.c b/test/testud.c index 59fda0dc47b..70bfa9dede0 100644 --- a/test/testud.c +++ b/test/testud.c @@ -127,10 +127,3 @@ CuSuite *testud(void) return suite; } -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return testud(); -} -#endif - diff --git a/test/testvsn.c b/test/testvsn.c index 9ac9d2ff13c..106945005a6 100644 --- a/test/testvsn.c +++ b/test/testvsn.c @@ -85,9 +85,3 @@ CuSuite *testvsn(void) return suite; } -#ifdef SINGLE_PROG -CuSuite *getsuite(void) -{ - return testvsn(); -} -#endif From dd46677f09748ecb404e895088a972f900a984a4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 23 Nov 2002 20:58:30 +0000 Subject: [PATCH 4047/7878] Add some const good-ness git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64066 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 8 ++++---- test/CuTest.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/CuTest.c b/test/CuTest.c index d2fb7a98888..23eff695b50 100644 --- a/test/CuTest.c +++ b/test/CuTest.c @@ -60,7 +60,7 @@ char* CuStrAlloc(int size) return new; } -char* CuStrCopy(char* old) +char* CuStrCopy(const char* old) { int len = strlen(old); char* new = CuStrAlloc(len + 1); @@ -150,7 +150,7 @@ CuTest* CuTestNew(char* name, TestFunction function) return tc; } -void CuNotImpl(CuTest* tc, char* message) +void CuNotImpl(CuTest* tc, const char* message) { CuString* newstr = CuStringNew(); CuStringAppend(newstr, message); @@ -160,14 +160,14 @@ void CuNotImpl(CuTest* tc, char* message) if (tc->jumpBuf != 0) longjmp(*(tc->jumpBuf), 0); } -void CuFail(CuTest* tc, char* message) +void CuFail(CuTest* tc, const char* message) { tc->failed = 1; tc->message = CuStrCopy(message); if (tc->jumpBuf != 0) longjmp(*(tc->jumpBuf), 0); } -void CuAssert(CuTest* tc, char* message, int condition) +void CuAssert(CuTest* tc, const char* message, int condition) { if (condition) return; CuFail(tc, message); diff --git a/test/CuTest.h b/test/CuTest.h index b0ebe83ec19..8c51663b5f4 100644 --- a/test/CuTest.h +++ b/test/CuTest.h @@ -38,7 +38,7 @@ /* CuString */ char* CuStrAlloc(int size); -char* CuStrCopy(char* old); +char* CuStrCopy(const char* old); #define CU_ALLOC(TYPE) ((TYPE*) malloc(sizeof(TYPE))) @@ -81,9 +81,9 @@ struct CuTest void CuInit(int argc, char *argv[]); void CuTestInit(CuTest* t, char* name, TestFunction function); CuTest* CuTestNew(char* name, TestFunction function); -void CuFail(CuTest* tc, char* message); -void CuNotImpl(CuTest* tc, char* message); -void CuAssert(CuTest* tc, char* message, int condition); +void CuFail(CuTest* tc, const char* message); +void CuNotImpl(CuTest* tc, const char* message); +void CuAssert(CuTest* tc, const char* message, int condition); void CuAssertTrue(CuTest* tc, int condition); void CuAssertStrEquals(CuTest* tc, const char* expected, const char* actual); void CuAssertIntEquals(CuTest* tc, int expected, int actual); From 2b744baf1d1b749595a575e2002140771acd34f4 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sat, 23 Nov 2002 21:17:27 +0000 Subject: [PATCH 4048/7878] Fixed the apr_mmap_dup ownership problem for disjoint pools by getting rid of the is_owner thing completely. Instead, we place all of the dup'ed apr_mmap_t's in a ring with each other (essentially the same as refcounting the mmaped region but without the where-do-you-store-it pitfall). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64067 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ include/apr_mmap.h | 19 ++++++++++++------- mmap/unix/mmap.c | 37 +++++++++++++++---------------------- mmap/win32/mmap.c | 35 ++++++++++++++--------------------- 4 files changed, 47 insertions(+), 50 deletions(-) diff --git a/CHANGES b/CHANGES index 6c25b276ca2..9af68a45341 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR 0.9.2 + *) Changed apr_mmap_dup() and friends so that there's no longer any + is_owner concept on the mmaped region, but rather something more + along the lines of a reference count. This allows the old apr_mmap_t + to still be used safely when the new apr_mmap_t is in a disjoint pool. + [Cliff Woolley, Sander Striker] + *) Fix a bug in apr_hash_merge() which caused the last entry in the overlay hash to be lost. PR 10522 [Jeff Trawick] diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 44e51be08d2..2c2278c9927 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -58,6 +58,7 @@ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" +#include "apr_ring.h" #include "apr_file_io.h" /* for apr_file_t */ #ifdef BEOS @@ -115,8 +116,12 @@ struct apr_mmap_t { void *mm; /** The amount of data in the mmap */ apr_size_t size; - /** Whether this object is reponsible for doing the munmap */ - int is_owner; + /** @deprecated this field is no longer used and will be removed + * in APR 1.0 */ + int unused; + /** ring of apr_mmap_t's that reference the same + * mmap'ed region; acts in place of a reference count */ + APR_RING_ENTRY(apr_mmap_t) link; }; #if APR_HAS_MMAP || defined(DOXYGEN) @@ -174,8 +179,8 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap, * @param new_mmap The structure to duplicate into. * @param old_mmap The mmap to duplicate. * @param p The pool to use for new_mmap. - * @param transfer_ownership Whether responsibility for destroying - * the memory-mapped segment is transferred from old_mmap to new_mmap + * @param transfer_ownership DEPRECATED: this param is now ignored + * and should be removed prior to APR 1.0 */ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, apr_mmap_t *old_mmap, @@ -185,10 +190,11 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, #if defined(DOXYGEN) /** * Transfer the specified MMAP to a different pool - * @param new_mmap The structure to duplicate into. + * @param new_mmap The structure to duplicate into. * @param old_mmap The file to transfer. * @param p The pool to use for new_mmap. - * @remark After this call, old_mmap cannot be used + * @deprecated Just use apr_mmap_dup(). The transfer_ownership flag will + * go away soon anyway. */ APR_DECLARE(apr_status_t) apr_mmap_setaside(apr_mmap_t **new_mmap, apr_mmap_t *old_mmap, @@ -197,7 +203,6 @@ APR_DECLARE(apr_status_t) apr_mmap_setaside(apr_mmap_t **new_mmap, #define apr_mmap_setaside(new_mmap, old_mmap, p) apr_mmap_dup(new_mmap, old_mmap, p, 1) #endif /* DOXYGEN */ - /** * Remove a mmap'ed. * @param mm The mmap'ed file. diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 4a54b860eb4..707702662fa 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -83,13 +83,17 @@ static apr_status_t mmap_cleanup(void *themmap) { apr_mmap_t *mm = themmap; - int rv; + apr_mmap_t *next = APR_RING_NEXT(mm,link); + int rv = 0; - if (!mm->is_owner) { - return APR_EINVAL; - } - else if (mm->mm == (void *)-1) { - return APR_ENOENT; + /* we no longer refer to the mmaped region */ + APR_RING_REMOVE(mm,link); + APR_RING_NEXT(mm,link) = NULL; + APR_RING_PREV(mm,link) = NULL; + + if (next != mm) { + /* more references exist, so we're done */ + return APR_SUCCESS; } #ifdef BEOS @@ -163,7 +167,7 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, (*new)->mm = mm; (*new)->size = size; (*new)->cntxt = cont; - (*new)->is_owner = 1; + APR_RING_ELEM_INIT(*new, link); /* register the cleanup... */ apr_pool_cleanup_register((*new)->cntxt, (void*)(*new), mmap_cleanup, @@ -179,21 +183,10 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, *new_mmap = (apr_mmap_t *)apr_pmemdup(p, old_mmap, sizeof(apr_mmap_t)); (*new_mmap)->cntxt = p; - /* The old_mmap can transfer ownership only if the old_mmap itself - * is an owner of the mmap'ed segment. - */ - if (old_mmap->is_owner) { - if (transfer_ownership) { - (*new_mmap)->is_owner = 1; - old_mmap->is_owner = 0; - apr_pool_cleanup_kill(old_mmap->cntxt, old_mmap, mmap_cleanup); - apr_pool_cleanup_register(p, *new_mmap, mmap_cleanup, - apr_pool_cleanup_null); - } - else { - (*new_mmap)->is_owner = 0; - } - } + APR_RING_INSERT_AFTER(old_mmap, *new_mmap, link); + + apr_pool_cleanup_register(p, *new_mmap, mmap_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index a113ecfcf2a..4053ab868b1 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -66,13 +66,17 @@ static apr_status_t mmap_cleanup(void *themmap) { apr_mmap_t *mm = themmap; + apr_mmap_t *next = APR_RING_NEXT(mm,link); apr_status_t rv = 0; - if (!mm->is_owner) { - return APR_EINVAL; - } - else if (!mm->mhandle) { - return APR_ENOENT; + /* we no longer refer to the mmaped region */ + APR_RING_REMOVE(mm,link); + APR_RING_NEXT(mm,link) = NULL; + APR_RING_PREV(mm,link) = NULL; + + if (next != mm) { + /* more references exist, so we're done */ + return APR_SUCCESS; } if (mm->mv) { @@ -163,7 +167,7 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, (*new)->mm = (char*)((*new)->mv) + (*new)->poffset; (*new)->size = size; (*new)->cntxt = cont; - (*new)->is_owner = 1; + APR_RING_ELEM_INIT(*new, link); /* register the cleanup... */ apr_pool_cleanup_register((*new)->cntxt, (void*)(*new), mmap_cleanup, @@ -179,21 +183,10 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, *new_mmap = (apr_mmap_t *)apr_pmemdup(p, old_mmap, sizeof(apr_mmap_t)); (*new_mmap)->cntxt = p; - /* The old_mmap can transfer ownership only if the old_mmap itself - * is an owner of the mmap'ed segment. - */ - if (old_mmap->is_owner) { - if (transfer_ownership) { - (*new_mmap)->is_owner = 1; - old_mmap->is_owner = 0; - apr_pool_cleanup_kill(old_mmap->cntxt, old_mmap, mmap_cleanup); - apr_pool_cleanup_register(p, *new_mmap, mmap_cleanup, - apr_pool_cleanup_null); - } - else { - (*new_mmap)->is_owner = 0; - } - } + APR_RING_INSERT_AFTER(old_mmap, *new_mmap, link); + + apr_pool_cleanup_register(p, *new_mmap, mmap_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } From 838a4b7af68f4f2d6965cc66ba21d031aa447519 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 23 Nov 2002 21:38:30 +0000 Subject: [PATCH 4049/7878] Don't link testdso.lo into testall as it hasn't been CuTestified yet. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64068 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 59646a1ed2f..1abf0b988ce 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -157,11 +157,11 @@ testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ - testdso.lo CuTest.lo mod_test.la libmod_test.la $(LOCAL_LIBS) + CuTest.lo mod_test.la libmod_test.la $(LOCAL_LIBS) $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ - testdso.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) + CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE From ae628d6712ebbb61dfb4980d55ab359ea1d37f1d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 23 Nov 2002 21:47:03 +0000 Subject: [PATCH 4050/7878] Remove redundant NUM_TESTS array size and unused typedef. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64069 13f79535-47bb-0310-9956-ffa450edef68 --- test/testall.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/test/testall.c b/test/testall.c index a795f368649..2c74b294944 100644 --- a/test/testall.c +++ b/test/testall.c @@ -57,18 +57,13 @@ #include "test_apr.h" -#define NUM_TESTS 255 - /* Top-level pool which can be used by tests. */ apr_pool_t *p; -struct testlist { - char *testname; +static const struct testlist { + const char *testname; CuSuite *(*func)(void); -}; -typedef struct testlist testlist; - -static testlist tests[NUM_TESTS] = { +} tests[] = { {"teststr", teststr}, {"testtime", testtime}, {"testvsn", testvsn}, From 9a8d3b28829577742b90165bd2bfd6d3e79f0de2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 23 Nov 2002 21:53:00 +0000 Subject: [PATCH 4051/7878] Migrate testdso to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64070 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 +- test/mod_test.c | 18 +-- test/test_apr.h | 1 + test/testall.c | 1 + test/testdso.c | 304 ++++++++++++++++++++++++++++++++--------------- 5 files changed, 218 insertions(+), 110 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 1abf0b988ce..59646a1ed2f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -157,11 +157,11 @@ testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ - CuTest.lo mod_test.la libmod_test.la $(LOCAL_LIBS) + testdso.lo CuTest.lo mod_test.la libmod_test.la $(LOCAL_LIBS) $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ - CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) + testdso.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/mod_test.c b/test/mod_test.c index fe6974b11a9..c16c71c543e 100644 --- a/test/mod_test.c +++ b/test/mod_test.c @@ -1,21 +1,13 @@ #include -int goodbyes = 0; - -void print_hello(void); -int print_goodbye(int reps); - -void print_hello(void) +void print_hello(char str[256]) { - fprintf(stdout,"Hello - I'm a DSO!\n"); + apr_cpystrn(str, "Hello - I'm a DSO!\n", strlen("Hello - I'm a DSO!\n") + 1); } -int print_goodbye(int reps) +int count_reps(int reps) { int i = 0; - for (i = 0;i < reps; i++) { - fprintf (stdout, "Goodbye from the DSO! (%d of %d)\n", i+1, reps); - } - goodbyes = reps; - return 0; + for (i = 0;i < reps; i++); + return i; } diff --git a/test/test_apr.h b/test/test_apr.h index 31d36465a18..20eaac2f660 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -80,6 +80,7 @@ CuSuite *testfile(void); CuSuite *testdir(void); CuSuite *testfileinfo(void); CuSuite *testrand(void); +CuSuite *testdso(void); diff --git a/test/testall.c b/test/testall.c index 2c74b294944..5023b72a2fb 100644 --- a/test/testall.c +++ b/test/testall.c @@ -78,6 +78,7 @@ static const struct testlist { {"testdir", testdir}, {"testfileinfo", testfileinfo}, {"testrand", testrand}, + {"testdso", testdso}, {"LastTest", NULL} }; diff --git a/test/testdso.c b/test/testdso.c index 512f7298e49..e7dc7242275 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -53,16 +53,11 @@ */ +#include "test_apr.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_errno.h" #include "apr_dso.h" -#include -#include -#include -#if APR_HAVE_UNISTD_H -#include -#endif #ifdef NETWARE # define LIB_NAME "mod_test.nlm" @@ -80,104 +75,223 @@ # endif #endif -void test_shared_library(const char *libname, apr_pool_t *pool) +static char *filename; +static char *filename2; + +void test_load_module(CuTest *tc) +{ + apr_dso_handle_t *h = NULL; + apr_status_t status; + char errstr[256]; + + status = apr_dso_load(&h, filename, p); + CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + CuAssertPtrNotNull(tc, h); + + apr_dso_unload(h); +} + +void test_dso_sym(CuTest *tc) { apr_dso_handle_t *h = NULL; apr_dso_handle_sym_t func1 = NULL; - apr_dso_handle_sym_t func2 = NULL; apr_status_t status; - void (*function)(void); - void (*function1)(int); - int *retval; - char filename[256]; + void (*function)(char str[256]); + char teststr[256]; + char errstr[256]; + + status = apr_dso_load(&h, filename, p); + CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + CuAssertPtrNotNull(tc, h); + + status = apr_dso_sym(&func1, h, "print_hello"); + CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + CuAssertPtrNotNull(tc, func1); + + function = (void *)func1; + (*function)(teststr); + CuAssertStrEquals(tc, "Hello - I'm a DSO!\n", teststr); + + apr_dso_unload(h); +} + +void test_dso_sym_return_value(CuTest *tc) +{ + apr_dso_handle_t *h = NULL; + apr_dso_handle_sym_t func1 = NULL; + apr_status_t status; + int (*function)(int); + char teststr[256]; + char errstr[256]; + + status = apr_dso_load(&h, filename, p); + CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + CuAssertPtrNotNull(tc, h); + + status = apr_dso_sym(&func1, h, "count_reps"); + CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + CuAssertPtrNotNull(tc, func1); + + function = (void *)func1; + status = (*function)(5); + CuAssertIntEquals(tc, 5, status); + + apr_dso_unload(h); +} + +void test_unload_module(CuTest *tc) +{ + apr_dso_handle_t *h = NULL; + apr_status_t status; + char errstr[256]; + apr_dso_handle_sym_t func1 = NULL; + + status = apr_dso_load(&h, filename, p); + CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + CuAssertPtrNotNull(tc, h); + + status = apr_dso_unload(h); + CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + + status = apr_dso_sym(&func1, h, "print_hello"); + CuAssertIntEquals(tc, APR_EINIT, status); +} + + +void test_load_non_module(CuTest *tc) +{ +#ifndef LIB_NAME2 + CuNotImpl(tc, "Can't load non-module library"); +#else + apr_dso_handle_t *h = NULL; + apr_status_t status; + char errstr[256]; + + status = apr_dso_load(&h, filename2, p); + CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + CuAssertPtrNotNull(tc, h); + + apr_dso_unload(h); +#endif +} + +void test_dso_sym_non_module(CuTest *tc) +{ +#ifndef LIB_NAME2 + CuNotImpl(tc, "Can't load non-module library"); +#else + apr_dso_handle_t *h = NULL; + apr_dso_handle_sym_t func1 = NULL; + apr_status_t status; + void (*function)(char str[256]); + char teststr[256]; + char errstr[256]; + + status = apr_dso_load(&h, filename2, p); + CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + CuAssertPtrNotNull(tc, h); + + status = apr_dso_sym(&func1, h, "print_hello"); + CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + CuAssertPtrNotNull(tc, func1); - getcwd(filename, 256); - strcat(filename, "/"); - strcat(filename, libname); - - fprintf(stdout,"Trying to load DSO now....................."); - fflush(stdout); - if ((status = apr_dso_load(&h, filename, pool)) != APR_SUCCESS){ - char my_error[256]; - apr_strerror(status, my_error, sizeof(my_error)); - fprintf(stderr, "%s!\n", my_error); - exit (-1); - } - fprintf(stdout,"OK\n"); - - fprintf(stdout,"Trying to get the DSO's attention.........."); - fflush(stdout); - if ((status = apr_dso_sym(&func1, h, "print_hello")) != APR_SUCCESS) { - char my_error[256]; - apr_dso_error(h, my_error, sizeof(my_error)); - fprintf(stderr, "%s\n", my_error); - exit (-1); - } - fprintf(stdout,"OK\n"); - function = (void *)func1; - (*function)(); - - fprintf(stdout,"Saying farewell 5 times...................."); - fflush(stdout); - if (apr_dso_sym(&func2, h, "print_goodbye") != APR_SUCCESS) { - fprintf(stderr, "Failed!\n"); - exit (-1); - } - fprintf(stdout,"OK\n"); - - function1 = (void *)(int)func2; - (*function1)(5); - - fprintf(stdout,"Checking how many times I said goodbye.."); - fflush(stdout); - if (apr_dso_sym(&func1, h, "goodbyes") != APR_SUCCESS) { - fprintf(stderr, "Failed!\n"); - exit (-1); - } - retval = (int *)func1; - fprintf(stdout,"%d..", (*retval)); - fflush(stdout); - if ((*retval) == 5){ - fprintf(stderr,"OK\n"); - } else { - fprintf(stderr,"Failed!\n"); - } - - fprintf(stdout,"Trying to unload DSO now..................."); - if (apr_dso_unload(h) != APR_SUCCESS) { - fprintf(stderr, "Failed!\n"); - exit (-1); - } - fprintf(stdout,"OK\n"); - - fprintf(stdout,"Checking it's been unloaded................"); - fflush(stdout); - if (apr_dso_sym(&func1, h, "print_hello") == APR_SUCCESS) { - fprintf(stderr, "Failed!\n"); - exit (-1); - } - fprintf(stdout,"OK\n"); + (*function)(teststr); + CuAssertStrEquals(tc, "Hello - I'm a DSO!\n", teststr); + + apr_dso_unload(h); +#endif } -int main (int argc, char ** argv) +void test_dso_sym_return_value_non_mod(CuTest *tc) { - apr_pool_t *pool; - - apr_initialize(); - atexit(apr_terminate); - - if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { - fprintf(stderr, "Couldn't allocate context."); - exit(-1); - } - - fprintf(stdout,"=== Checking module library ===\n"); - test_shared_library(LIB_NAME, pool); -#ifdef LIB_NAME2 - fprintf(stdout,"=== Checking non-module library ===\n"); - test_shared_library(LIB_NAME2, pool); +#ifndef LIB_NAME2 + CuNotImpl(tc, "Can't load non-module library"); +#else + apr_dso_handle_t *h = NULL; + apr_dso_handle_sym_t func1 = NULL; + apr_status_t status; + int (*function)(int); + char teststr[256]; + char errstr[256]; + + status = apr_dso_load(&h, filename2, p); + CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + CuAssertPtrNotNull(tc, h); + + status = apr_dso_sym(&func1, h, "count_reps"); + CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + CuAssertPtrNotNull(tc, func1); + + function = (void *)func1; + status = (*function)(5); + CuAssertIntEquals(tc, 5, status); + + apr_dso_unload(h); #endif +} - return 0; +void test_unload_non_module(CuTest *tc) +{ +#ifndef LIB_NAME2 + CuNotImpl(tc, "Can't load non-module library"); +#else + apr_dso_handle_t *h = NULL; + apr_status_t status; + char errstr[256]; + apr_dso_handle_sym_t func1 = NULL; + + status = apr_dso_load(&h, filename2, p); + CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + CuAssertPtrNotNull(tc, h); + + status = apr_dso_unload(h); + CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + + status = apr_dso_sym(&func1, h, "print_hello"); + CuAssertIntEquals(tc, APR_EINIT, status); +#endif } + +static void test_load_notthere(CuTest *tc) +{ + apr_dso_handle_t *h = NULL; + apr_dso_handle_sym_t func1 = NULL; + apr_status_t status; + char errstr[256]; + + status = apr_dso_load(&h, "No_File.so", p); + CuAssertIntEquals(tc, APR_EDSOOPEN, status); + CuAssertPtrNotNull(tc, h); + + apr_dso_unload(h); +} + +CuSuite *testdso(void) +{ + filename = apr_pcalloc(p, 256); + getcwd(filename, 256); + filename = apr_pstrcat(p, filename, "/", LIB_NAME, NULL); + + filename2 = apr_pcalloc(p, 256); + getcwd(filename2, 256); + filename2 = apr_pstrcat(p, filename2, "/", LIB_NAME2, NULL); + + + CuSuite *suite = CuSuiteNew("Test DSO"); + + SUITE_ADD_TEST(suite, test_load_module); + SUITE_ADD_TEST(suite, test_dso_sym); + SUITE_ADD_TEST(suite, test_dso_sym_return_value); + SUITE_ADD_TEST(suite, test_unload_module); + + SUITE_ADD_TEST(suite, test_load_non_module); + SUITE_ADD_TEST(suite, test_dso_sym_non_module); + SUITE_ADD_TEST(suite, test_dso_sym_return_value_non_mod); + SUITE_ADD_TEST(suite, test_unload_non_module); + + SUITE_ADD_TEST(suite, test_load_notthere); + + return suite; +} + From ac1007a6e24b240bed42cebeae13eea8019f554b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 23 Nov 2002 22:04:14 +0000 Subject: [PATCH 4052/7878] Remove an unused variable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64071 13f79535-47bb-0310-9956-ffa450edef68 --- test/testrand.c | 1 - 1 file changed, 1 deletion(-) diff --git a/test/testrand.c b/test/testrand.c index 8d7f3a08ee1..3af1f8b07db 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -63,7 +63,6 @@ static void rand_exists(CuTest *tc) #if !APR_HAS_RANDOM CuNotImpl(tc, "apr_generate_random_bytes"); #else - apr_pool_t *p; apr_status_t rv; unsigned char c[2048]; int i; From 29d11899657ede09d5803539f2cbd5797e4c06b0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 23 Nov 2002 22:06:15 +0000 Subject: [PATCH 4053/7878] Quiet an annoying warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64072 13f79535-47bb-0310-9956-ffa450edef68 --- test/testall.c | 2 +- test/testoc.c | 28 ++++++++++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/test/testall.c b/test/testall.c index 5023b72a2fb..a4f3b5db2e8 100644 --- a/test/testall.c +++ b/test/testall.c @@ -84,7 +84,7 @@ static const struct testlist { int main(int argc, char *argv[]) { - CuSuiteList *alltests; + CuSuiteList *alltests = NULL; CuString *output = CuStringNew(); int i; int partial = 0; diff --git a/test/testoc.c b/test/testoc.c index e5254533dd0..184a9ed157f 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -52,17 +52,12 @@ * . */ +#include "apr_test.h" #include "apr_thread_proc.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" -#include -#include -#include -#if APR_HAVE_UNISTD_H -#include -#endif #if APR_HAS_OTHER_CHILD static void ocmaint(int reason, void *data, int status) @@ -166,3 +161,24 @@ int main(int argc, char *argv[]) return 0; } +#if !APR_HAS_OTHER_CHILD +static void oc_not_impl(CuTest *tc) +{ + CuNotImpl(tc, "Other child logic not implemented on this platform"); +} +#endif + +CuSuite *testoc(void) +{ + CuSuite *suite = CuSuiteNew("Test Time"); + +#if APR_HAS_OTHER_CHILD + SUITE_ADD_TEST(suite, oc_not_impl); +#else + + SUITE_ADD_TEST(suite, test_strftimeoffset); + +#endif + return suite; +} + From 4df10e0a64780aa64684153a8e83c5a323e51386 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 23 Nov 2002 22:07:41 +0000 Subject: [PATCH 4054/7878] This shouldn't have been committed. I just started working on it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64073 13f79535-47bb-0310-9956-ffa450edef68 --- test/testoc.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/test/testoc.c b/test/testoc.c index 184a9ed157f..e5254533dd0 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -52,12 +52,17 @@ * . */ -#include "apr_test.h" #include "apr_thread_proc.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" +#include +#include +#include +#if APR_HAVE_UNISTD_H +#include +#endif #if APR_HAS_OTHER_CHILD static void ocmaint(int reason, void *data, int status) @@ -161,24 +166,3 @@ int main(int argc, char *argv[]) return 0; } -#if !APR_HAS_OTHER_CHILD -static void oc_not_impl(CuTest *tc) -{ - CuNotImpl(tc, "Other child logic not implemented on this platform"); -} -#endif - -CuSuite *testoc(void) -{ - CuSuite *suite = CuSuiteNew("Test Time"); - -#if APR_HAS_OTHER_CHILD - SUITE_ADD_TEST(suite, oc_not_impl); -#else - - SUITE_ADD_TEST(suite, test_strftimeoffset); - -#endif - return suite; -} - From deb2a60515dfe64ceec095c34708423bdb699b36 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 23 Nov 2002 22:08:14 +0000 Subject: [PATCH 4055/7878] This file is no longer used for anything. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64074 13f79535-47bb-0310-9956-ffa450edef68 --- test/testapr.c | 85 -------------------------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 test/testapr.c diff --git a/test/testapr.c b/test/testapr.c deleted file mode 100644 index 1736e53a1f9..00000000000 --- a/test/testapr.c +++ /dev/null @@ -1,85 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "test_apr.h" - -apr_pool_t *p; - -int main(int argc, char *argv[]) -{ - CuSuite *suite; - CuString *output = CuStringNew(); - - apr_initialize(); - atexit(apr_terminate); - - CuInit(argc, argv); - - apr_pool_create(&p, NULL); - - suite = getsuite(); - - CuSuiteRun(suite); - CuSuiteSummary(suite, output); - CuStringAppend(output, "\n"); - CuSuiteOverView(suite, output); - printf("%s", output->buffer); - CuStringInit(output); - CuSuiteDetails(suite, output); - if (strcmp(output->buffer, "")) { - printf("%s\n", output->buffer); - } - return 0; -} - From 7c108262e20a6f693bde807e4da6835c4fa99bc2 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 23 Nov 2002 22:10:00 +0000 Subject: [PATCH 4056/7878] Ignore some files that we don't track in CVS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64075 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/.cvsignore b/test/.cvsignore index 30a31ceda64..17b971c1418 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -3,6 +3,8 @@ Debug Release *.lo *.swp +*.slo +*.la .libs .deps testmd5 From 768d0cd2dd9b2403f7250f4d17310ca4842cab42 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 23 Nov 2002 22:33:12 +0000 Subject: [PATCH 4057/7878] Remove redundant pallocs, and mark local funcs/vars as static. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64076 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfileinfo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testfileinfo.c b/test/testfileinfo.c index e4b917acce2..89fdba47d3b 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -63,7 +63,7 @@ #define FILENAME "data/file_datafile.txt" -struct view_fileinfo +static const struct view_fileinfo { apr_int32_t bits; char *description; @@ -84,7 +84,7 @@ struct view_fileinfo {0, NULL} }; -int finfo_equal(apr_finfo_t f1, apr_finfo_t f2) +static int finfo_equal(apr_finfo_t f1, apr_finfo_t f2) { return (f1.valid == f2.valid && f1.protection == f2.protection && @@ -120,7 +120,7 @@ static void test_info_get(CuTest *tc) rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); if (rv == APR_INCOMPLETE) { - char *str = apr_palloc(p, 256); + char *str; int i; str = apr_pstrdup(p, "APR_INCOMPLETE: Missing "); for (i = 0; vfi[i].bits; ++i) { @@ -141,7 +141,7 @@ static void test_stat(CuTest *tc) rv = apr_stat(&finfo, FILENAME, APR_FINFO_NORM, p); if (rv == APR_INCOMPLETE) { - char *str = apr_palloc(p, 256); + char *str; int i; str = apr_pstrdup(p, "APR_INCOMPLETE: Missing "); for (i = 0; vfi[i].bits; ++i) { From 5ab3989d1e41280fdf3a6cd0035d66d35d778e16 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 24 Nov 2002 04:49:45 +0000 Subject: [PATCH 4058/7878] Migrate testoc to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64077 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 9 ++-- test/test_apr.h | 1 + test/testall.c | 1 + test/testoc.c | 128 +++++++++++++++++++++-------------------------- 4 files changed, 63 insertions(+), 76 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 59646a1ed2f..1f5b6883590 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -25,7 +25,6 @@ PROGRAMS = \ testsockopt@EXEEXT@ \ testpoll@EXEEXT@ \ testhash@EXEEXT@ \ - occhild@EXEEXT@ \ testuser@EXEEXT@ \ testsockets@EXEEXT@ \ testdup@EXEEXT@ \ @@ -69,9 +68,6 @@ testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS) testdso@EXEEXT@: testdso.lo mod_test.la libmod_test.la $(LOCAL_LIBS) $(LINK) testdso.lo $(LOCAL_LIBS) $(ALL_LIBS) -testoc@EXEEXT@: testoc.lo occhild@EXEEXT@ $(LOCAL_LIBS) - $(LINK) testoc.lo $(LOCAL_LIBS) $(ALL_LIBS) - occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS) $(LINK) occhild.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -157,11 +153,12 @@ testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ - testdso.lo CuTest.lo mod_test.la libmod_test.la $(LOCAL_LIBS) + testdso.lo testoc.lo CuTest.lo mod_test.la libmod_test.la \ + occhild@EXEEXT@ $(LOCAL_LIBS) $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ - testdso.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) + testdso.lo testoc.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index 20eaac2f660..93dc44285f1 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -81,6 +81,7 @@ CuSuite *testdir(void); CuSuite *testfileinfo(void); CuSuite *testrand(void); CuSuite *testdso(void); +CuSuite *testoc(void); diff --git a/test/testall.c b/test/testall.c index a4f3b5db2e8..18834c5150c 100644 --- a/test/testall.c +++ b/test/testall.c @@ -79,6 +79,7 @@ static const struct testlist { {"testfileinfo", testfileinfo}, {"testrand", testrand}, {"testdso", testdso}, + {"testoc", testoc}, {"LastTest", NULL} }; diff --git a/test/testoc.c b/test/testoc.c index e5254533dd0..ea2804f69fb 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -52,34 +52,35 @@ * . */ +#include "test_apr.h" #include "apr_thread_proc.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" -#include -#include -#include -#if APR_HAVE_UNISTD_H -#include -#endif #if APR_HAS_OTHER_CHILD + +static char reasonstr[256]; + static void ocmaint(int reason, void *data, int status) { - fprintf(stdout,"[CHILD] Maintenance routine called...."); - fflush(stdout); switch (reason) { case APR_OC_REASON_DEATH: - fprintf(stdout, "Died correctly\n"); + apr_cpystrn(reasonstr, "APR_OC_REASON_DEATH", + strlen("APR_OC_REASON_DEATH") + 1); break; case APR_OC_REASON_LOST: - fprintf(stdout, "APR_OC_REASON_LOST\n"); + apr_cpystrn(reasonstr, "APR_OC_REASON_LOST", + strlen("APR_OC_REASON_LOST") + 1); + break; case APR_OC_REASON_UNWRITABLE: - fprintf(stdout, "APR_OC_REASON_UNWRITEABLE\n"); + apr_cpystrn(reasonstr, "APR_OC_REASON_UNWRITEABLE", + strlen("APR_OC_REASON_UNWRITEABLE") + 1); + break; case APR_OC_REASON_RESTART: - fprintf(stdout, "APR_OC_REASON_RESTART\n"); - fprintf(stdout, "OC maintentance called for reason other than death\n"); + apr_cpystrn(reasonstr, "APR_OC_REASON_RESTART", + strlen("APR_OC_REASON_RESTART") + 1); break; } } @@ -89,80 +90,67 @@ static void ocmaint(int reason, void *data, int status) #define SIGKILL 1 #endif -int main(int argc, char *argv[]) +/* It would be great if we could stress this stuff more, and make the test + * more granular. + */ +static void test_child_kill(CuTest *tc) { -#if APR_HAS_OTHER_CHILD - apr_status_t rv; - apr_pool_t *context; + apr_file_t *std = NULL; apr_proc_t newproc; apr_procattr_t *procattr = NULL; - apr_file_t *std = NULL; const char *args[3]; + apr_status_t rv; - if (argc > 1) { - while (1); - } - - if (apr_initialize() != APR_SUCCESS) { - fprintf(stderr, "Couldn't initialize."); - exit(-1); - } - atexit(apr_terminate); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - fprintf(stderr, "Couldn't allocate context."); - exit(-1); - } - - args[0] = apr_pstrdup(context, "occhild"); - args[1] = apr_pstrdup(context, "-X"); + args[0] = apr_pstrdup(p, "occhild"); + args[1] = apr_pstrdup(p, "-X"); args[2] = NULL; - fprintf(stdout, "[PARENT] Creating procattr............."); - fflush(stdout); - if (apr_procattr_create(&procattr, context) != APR_SUCCESS) { - fprintf(stderr, "Could not create attr\n"); - exit(-1);; - } - else { - apr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_NO_PIPE, APR_NO_PIPE); - } - fprintf(stdout, "OK\n"); - - fprintf(stdout, "[PARENT] Starting other child.........."); - fflush(stdout); - if (apr_proc_create(&newproc, "./occhild", args, NULL, procattr, context) - != APR_SUCCESS) { - fprintf(stderr, "error starting other child\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); + rv = apr_procattr_create(&procattr, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_NO_PIPE, + APR_NO_PIPE); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_proc_create(&newproc, "./occhild", args, NULL, procattr, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, newproc.in); + CuAssertPtrEquals(tc, NULL, newproc.out); + CuAssertPtrEquals(tc, NULL, newproc.err); std = newproc.in; - apr_proc_other_child_register(&newproc, ocmaint, NULL, std, context); + apr_proc_other_child_register(&newproc, ocmaint, NULL, std, p); - fprintf(stdout, "[PARENT] Sending SIGKILL to child......"); - fflush(stdout); apr_sleep(apr_time_from_sec(1)); - if ((rv = apr_proc_kill(&newproc, SIGKILL)) != APR_SUCCESS) { - char msgbuf[120]; - - fprintf(stderr,"couldn't send the signal: %d/%s!\n", - rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); - exit(-1); - } - fprintf(stdout,"OK\n"); + rv = apr_proc_kill(&newproc, SIGKILL); + CuAssertIntEquals(tc, APR_SUCCESS, rv); /* allow time for things to settle... */ apr_sleep(apr_time_from_sec(3)); - fprintf(stdout, "[PARENT] Checking on children..........\n"); apr_proc_other_child_check(); -#else - fprintf(stdout, "OC failed!\n"); - fprintf(stdout, "Other_child is not supported on this platform\n"); + CuAssertStrEquals(tc, "APR_OC_REASON_DEATH", reasonstr); +} + +#if !APR_HAS_OTHER_CHILD +static void oc_not_impl(CuTest *tc) +{ + CuNotImpl(tc, "Other child logic not implemented on this platform"); +} #endif - return 0; -} +CuSuite *testoc(void) +{ + CuSuite *suite = CuSuiteNew("Test Time"); + +#if !APR_HAS_OTHER_CHILD + SUITE_ADD_TEST(suite, oc_not_impl); +#else + + SUITE_ADD_TEST(suite, test_child_kill); + +#endif + return suite; +} From 50d12bc15579d6b9747b0355dcc59a15bc777c7b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 24 Nov 2002 04:51:37 +0000 Subject: [PATCH 4059/7878] Use the correct name for testoc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64078 13f79535-47bb-0310-9956-ffa450edef68 --- test/testoc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testoc.c b/test/testoc.c index ea2804f69fb..49702755800 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -142,7 +142,7 @@ static void oc_not_impl(CuTest *tc) CuSuite *testoc(void) { - CuSuite *suite = CuSuiteNew("Test Time"); + CuSuite *suite = CuSuiteNew("Other Child"); #if !APR_HAS_OTHER_CHILD SUITE_ADD_TEST(suite, oc_not_impl); From cb50f9df3f84d8250c2808a4a8723c875c0491a3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 24 Nov 2002 04:57:35 +0000 Subject: [PATCH 4060/7878] Fix the names for all tests. (I got sick of seeing Test in the output) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64079 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdir.c | 2 +- test/testdso.c | 2 +- test/testfile.c | 2 +- test/testfileinfo.c | 2 +- test/testfmt.c | 2 +- test/testipsub.c | 2 +- test/testmmap.c | 2 +- test/testpools.c | 2 +- test/testrand.c | 2 +- test/testsleep.c | 2 +- test/teststr.c | 2 +- test/testtable.c | 2 +- test/testtime.c | 2 +- test/testud.c | 2 +- test/testvsn.c | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/testdir.c b/test/testdir.c index e9449c9e5e2..528df74b859 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -298,7 +298,7 @@ static void test_uncleared_errno(CuTest *tc) CuSuite *testdir(void) { - CuSuite *suite = CuSuiteNew("Test Directory"); + CuSuite *suite = CuSuiteNew("Directory"); SUITE_ADD_TEST(suite, test_mkdir); SUITE_ADD_TEST(suite, test_mkdir_recurs); diff --git a/test/testdso.c b/test/testdso.c index e7dc7242275..6a977da4927 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -278,7 +278,7 @@ CuSuite *testdso(void) filename2 = apr_pstrcat(p, filename2, "/", LIB_NAME2, NULL); - CuSuite *suite = CuSuiteNew("Test DSO"); + CuSuite *suite = CuSuiteNew("DSO"); SUITE_ADD_TEST(suite, test_load_module); SUITE_ADD_TEST(suite, test_dso_sym); diff --git a/test/testfile.c b/test/testfile.c index 00b9d32b1ae..026685840fe 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -437,7 +437,7 @@ static void test_mod_neg(CuTest *tc) CuSuite *testfile(void) { - CuSuite *suite = CuSuiteNew("Test File I/O"); + CuSuite *suite = CuSuiteNew("File I/O"); SUITE_ADD_TEST(suite, test_open_noreadwrite); SUITE_ADD_TEST(suite, test_open_excl); diff --git a/test/testfileinfo.c b/test/testfileinfo.c index 89fdba47d3b..be9da8d0123 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -175,7 +175,7 @@ static void test_stat_eq_finfo(CuTest *tc) CuSuite *testfileinfo(void) { - CuSuite *suite = CuSuiteNew("Test File Info"); + CuSuite *suite = CuSuiteNew("File Info"); SUITE_ADD_TEST(suite, test_info_get); SUITE_ADD_TEST(suite, test_stat); diff --git a/test/testfmt.c b/test/testfmt.c index f97fe08bf04..236fa75dbd6 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -104,7 +104,7 @@ static void int64_t_fmt(CuTest *tc) CuSuite *testfmt(void) { - CuSuite *suite = CuSuiteNew("Test Formats"); + CuSuite *suite = CuSuiteNew("Formats"); SUITE_ADD_TEST(suite, ssize_t_fmt); SUITE_ADD_TEST(suite, size_t_fmt); diff --git a/test/testipsub.c b/test/testipsub.c index 9bbe7915c80..e4cf7f8c8ad 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -199,7 +199,7 @@ static void test_badip_str(CuTest *tc) CuSuite *testipsub(void) { - CuSuite *suite = CuSuiteNew("Test IP subnets"); + CuSuite *suite = CuSuiteNew("IP subnets"); SUITE_ADD_TEST(suite, test_bad_input); SUITE_ADD_TEST(suite, test_singleton_subnets); diff --git a/test/testmmap.c b/test/testmmap.c index f79d1c0b55a..3725f96990a 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -148,7 +148,7 @@ static void test_mmap_offset(CuTest *tc) CuSuite *testmmap(void) { - CuSuite *suite = CuSuiteNew("Test MMAP"); + CuSuite *suite = CuSuiteNew("MMAP"); #if APR_HAS_MMAP SUITE_ADD_TEST(suite, create_filename); diff --git a/test/testpools.c b/test/testpools.c index cb8df339e40..01347673801 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -132,7 +132,7 @@ static void test_notancestor(CuTest *tc) CuSuite *testpool(void) { - CuSuite *suite = CuSuiteNew("Test Pools"); + CuSuite *suite = CuSuiteNew("Pools"); SUITE_ADD_TEST(suite, parent_pool); SUITE_ADD_TEST(suite, child_pool); diff --git a/test/testrand.c b/test/testrand.c index 3af1f8b07db..235442a06e6 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -79,7 +79,7 @@ static void rand_exists(CuTest *tc) CuSuite *testrand(void) { - CuSuite *suite = CuSuiteNew("Test Random"); + CuSuite *suite = CuSuiteNew("Random"); SUITE_ADD_TEST(suite, rand_exists); diff --git a/test/testsleep.c b/test/testsleep.c index d93313c4aa6..8be3d4d1154 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -83,7 +83,7 @@ static void sleep_one(CuTest *tc) CuSuite *testsleep(void) { - CuSuite *suite = CuSuiteNew("Test Sleep"); + CuSuite *suite = CuSuiteNew("Sleep"); SUITE_ADD_TEST(suite, sleep_one); diff --git a/test/teststr.c b/test/teststr.c index af952e09d89..191f6405d54 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -165,7 +165,7 @@ static void snprintf_0nonNULL(CuTest *tc) CuSuite *teststr(void) { - CuSuite *suite = CuSuiteNew("Test Strings"); + CuSuite *suite = CuSuiteNew("Strings"); SUITE_ADD_TEST(suite, snprintf_0NULL); SUITE_ADD_TEST(suite, snprintf_0nonNULL); diff --git a/test/testtable.c b/test/testtable.c index 74194595bcd..9b6a59343e3 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -189,7 +189,7 @@ static void table_overlap(CuTest *tc) CuSuite *testtable(void) { - CuSuite *suite = CuSuiteNew("Test Table"); + CuSuite *suite = CuSuiteNew("Table"); SUITE_ADD_TEST(suite, table_make); SUITE_ADD_TEST(suite, table_get); diff --git a/test/testtime.c b/test/testtime.c index ad1843e859c..7aeb70c7d37 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -286,7 +286,7 @@ static void test_strftimeoffset(CuTest *tc) CuSuite *testtime(void) { - CuSuite *suite = CuSuiteNew("Test Time"); + CuSuite *suite = CuSuiteNew("Time"); SUITE_ADD_TEST(suite, test_now); SUITE_ADD_TEST(suite, test_gmtstr); diff --git a/test/testud.c b/test/testud.c index 70bfa9dede0..4847c947650 100644 --- a/test/testud.c +++ b/test/testud.c @@ -111,7 +111,7 @@ static void post_pool_clear(CuTest *tc) CuSuite *testud(void) { - CuSuite *suite = CuSuiteNew("Test User Data"); + CuSuite *suite = CuSuiteNew("User Data"); apr_pool_create(&pool, p); testdata = apr_pstrdup(pool, "This is a test\n"); diff --git a/test/testvsn.c b/test/testvsn.c index 106945005a6..6b152981f84 100644 --- a/test/testvsn.c +++ b/test/testvsn.c @@ -77,7 +77,7 @@ static void test_ints(CuTest *tc) CuSuite *testvsn(void) { - CuSuite *suite = CuSuiteNew("Test Versioning"); + CuSuite *suite = CuSuiteNew("Versioning"); SUITE_ADD_TEST(suite, test_strings); SUITE_ADD_TEST(suite, test_ints); From 98f027e63d162bd138670546c7ef2fd095673d2e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 24 Nov 2002 05:11:46 +0000 Subject: [PATCH 4061/7878] Add some tests that were written but not being run. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64080 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdir.c | 4 ++++ test/testfile.c | 1 + 2 files changed, 5 insertions(+) diff --git a/test/testdir.c b/test/testdir.c index 528df74b859..6ffe90b9c95 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -308,6 +308,10 @@ CuSuite *testdir(void) SUITE_ADD_TEST(suite, test_remove_notthere); SUITE_ADD_TEST(suite, test_mkdir_twice); + SUITE_ADD_TEST(suite, test_readdir_onedot); + SUITE_ADD_TEST(suite, test_readdir_twodot); + SUITE_ADD_TEST(suite, test_rewind); + SUITE_ADD_TEST(suite, test_opendir); SUITE_ADD_TEST(suite, test_opendir_notthere); SUITE_ADD_TEST(suite, test_closedir); diff --git a/test/testfile.c b/test/testfile.c index 026685840fe..dab8a7d5a13 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -442,6 +442,7 @@ CuSuite *testfile(void) SUITE_ADD_TEST(suite, test_open_noreadwrite); SUITE_ADD_TEST(suite, test_open_excl); SUITE_ADD_TEST(suite, test_open_read); + SUITE_ADD_TEST(suite, test_open_readwrite); SUITE_ADD_TEST(suite, test_read); SUITE_ADD_TEST(suite, test_seek); SUITE_ADD_TEST(suite, test_filename); From da1e40b5b18ad50891e2c7d435aaee40cbce6eb6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 24 Nov 2002 05:18:23 +0000 Subject: [PATCH 4062/7878] Remove the rest of the warnings from the test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64081 13f79535-47bb-0310-9956-ffa450edef68 --- test/mod_test.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++- test/testdso.c | 24 ++++++++++---------- 2 files changed, 70 insertions(+), 13 deletions(-) diff --git a/test/mod_test.c b/test/mod_test.c index c16c71c543e..2069214dffb 100644 --- a/test/mod_test.c +++ b/test/mod_test.c @@ -1,4 +1,61 @@ -#include +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_strings.h" + +void print_hello(char str[256]); +int count_reps(int reps); void print_hello(char str[256]) { diff --git a/test/testdso.c b/test/testdso.c index 6a977da4927..21e5d19dccd 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -58,6 +58,10 @@ #include "apr_pools.h" #include "apr_errno.h" #include "apr_dso.h" +#include "apr.h" +#ifdef APR_HAVE_UNISTD_H +#include +#endif #ifdef NETWARE # define LIB_NAME "mod_test.nlm" @@ -78,7 +82,7 @@ static char *filename; static char *filename2; -void test_load_module(CuTest *tc) +static void test_load_module(CuTest *tc) { apr_dso_handle_t *h = NULL; apr_status_t status; @@ -91,7 +95,7 @@ void test_load_module(CuTest *tc) apr_dso_unload(h); } -void test_dso_sym(CuTest *tc) +static void test_dso_sym(CuTest *tc) { apr_dso_handle_t *h = NULL; apr_dso_handle_sym_t func1 = NULL; @@ -115,13 +119,12 @@ void test_dso_sym(CuTest *tc) apr_dso_unload(h); } -void test_dso_sym_return_value(CuTest *tc) +static void test_dso_sym_return_value(CuTest *tc) { apr_dso_handle_t *h = NULL; apr_dso_handle_sym_t func1 = NULL; apr_status_t status; int (*function)(int); - char teststr[256]; char errstr[256]; status = apr_dso_load(&h, filename, p); @@ -139,7 +142,7 @@ void test_dso_sym_return_value(CuTest *tc) apr_dso_unload(h); } -void test_unload_module(CuTest *tc) +static void test_unload_module(CuTest *tc) { apr_dso_handle_t *h = NULL; apr_status_t status; @@ -158,7 +161,7 @@ void test_unload_module(CuTest *tc) } -void test_load_non_module(CuTest *tc) +static void test_load_non_module(CuTest *tc) { #ifndef LIB_NAME2 CuNotImpl(tc, "Can't load non-module library"); @@ -175,7 +178,7 @@ void test_load_non_module(CuTest *tc) #endif } -void test_dso_sym_non_module(CuTest *tc) +static void test_dso_sym_non_module(CuTest *tc) { #ifndef LIB_NAME2 CuNotImpl(tc, "Can't load non-module library"); @@ -203,7 +206,7 @@ void test_dso_sym_non_module(CuTest *tc) #endif } -void test_dso_sym_return_value_non_mod(CuTest *tc) +static void test_dso_sym_return_value_non_mod(CuTest *tc) { #ifndef LIB_NAME2 CuNotImpl(tc, "Can't load non-module library"); @@ -212,7 +215,6 @@ void test_dso_sym_return_value_non_mod(CuTest *tc) apr_dso_handle_sym_t func1 = NULL; apr_status_t status; int (*function)(int); - char teststr[256]; char errstr[256]; status = apr_dso_load(&h, filename2, p); @@ -231,7 +233,7 @@ void test_dso_sym_return_value_non_mod(CuTest *tc) #endif } -void test_unload_non_module(CuTest *tc) +static void test_unload_non_module(CuTest *tc) { #ifndef LIB_NAME2 CuNotImpl(tc, "Can't load non-module library"); @@ -256,9 +258,7 @@ void test_unload_non_module(CuTest *tc) static void test_load_notthere(CuTest *tc) { apr_dso_handle_t *h = NULL; - apr_dso_handle_sym_t func1 = NULL; apr_status_t status; - char errstr[256]; status = apr_dso_load(&h, "No_File.so", p); CuAssertIntEquals(tc, APR_EDSOOPEN, status); From c0efa3275bdb001bcd2a1a3be8c7f40dc33718b5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 24 Nov 2002 06:13:59 +0000 Subject: [PATCH 4063/7878] Migrate testdup to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64082 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 6 +- test/test_apr.h | 1 + test/testall.c | 3 +- test/testdup.c | 161 ++++++++++++++++++++++++++++++++++------------- 4 files changed, 122 insertions(+), 49 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 1f5b6883590..2f232ca52d9 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -153,12 +153,12 @@ testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ - testdso.lo testoc.lo CuTest.lo mod_test.la libmod_test.la \ - occhild@EXEEXT@ $(LOCAL_LIBS) + testdso.lo testoc.lo testdup.lo CuTest.lo mod_test.la \ + libmod_test.la occhild@EXEEXT@ $(LOCAL_LIBS) $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ - testdso.lo testoc.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) + testdso.lo testoc.lo testdup.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index 93dc44285f1..c999675fcde 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -82,6 +82,7 @@ CuSuite *testfileinfo(void); CuSuite *testrand(void); CuSuite *testdso(void); CuSuite *testoc(void); +CuSuite *testdup(void); diff --git a/test/testall.c b/test/testall.c index 18834c5150c..0553df8c5bf 100644 --- a/test/testall.c +++ b/test/testall.c @@ -75,8 +75,9 @@ static const struct testlist { {"testpool", testpool}, {"testfmt", testfmt}, {"testfile", testfile}, - {"testdir", testdir}, {"testfileinfo", testfileinfo}, + {"testdup", testdup}, + {"testdir", testdir}, {"testrand", testrand}, {"testdso", testdso}, {"testoc", testoc}, diff --git a/test/testdup.c b/test/testdup.c index 19ae1c9216d..e639c83b186 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -57,83 +57,154 @@ #include "apr_pools.h" #include "apr_errno.h" #include "apr_file_io.h" -#include -#include -#include -#if APR_HAVE_UNISTD_H -#include -#endif #include "test_apr.h" #define TEST "Testing\n" #define TEST2 "Testing again\n" +#define FILENAME "data/testdup.file" -int main (int argc, char ** argv) +static void test_file_dup(CuTest *tc) { apr_file_t *file1 = NULL; - apr_file_t *file2 = NULL; apr_file_t *file3 = NULL; + apr_status_t rv; + apr_finfo_t finfo; - apr_pool_t *p; + /* First, create a new file, empty... */ + rv = apr_file_open(&file1, FILENAME, APR_READ | APR_WRITE | APR_CREATE| + APR_DELONCLOSE, APR_OS_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, file1); + + rv = apr_file_dup(&file3, file1, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, file3); + + rv = apr_file_close(file1); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + /* cleanup after ourselves */ + rv = apr_file_close(file3); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_stat(&finfo, FILENAME, APR_FINFO_NORM, p); + CuAssertIntEquals(tc, APR_ENOENT, rv); +} + +static void test_file_readwrite(CuTest *tc) +{ + apr_file_t *file1 = NULL; + apr_file_t *file3 = NULL; + apr_status_t rv; + apr_finfo_t finfo; apr_size_t txtlen = sizeof(TEST); char buff[50]; apr_off_t fpos; - apr_initialize(); - atexit(apr_terminate); - - fprintf(stdout, "APR File Duplication Test\n=========================\n\n"); - STD_TEST_NEQ("Creating a pool", apr_pool_create(&p, NULL)) - - printf("\nTesting apr_file_dup\n"); /* First, create a new file, empty... */ - STD_TEST_NEQ(" Open a new, empty file (#1)", apr_file_open(&file1, "./testdup.file", - APR_READ | APR_WRITE | APR_CREATE, - APR_OS_DEFAULT, p)) + rv = apr_file_open(&file1, FILENAME, APR_READ | APR_WRITE | APR_CREATE| + APR_DELONCLOSE, APR_OS_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, file1); - STD_TEST_NEQ(" Simple dup", apr_file_dup(&file3, file1, p)) + rv = apr_file_dup(&file3, file1, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, file3); - STD_TEST_NEQ(" Write to dup'd file (#3)", apr_file_write(file3, TEST, &txtlen)) + rv = apr_file_write(file3, TEST, &txtlen); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, sizeof(TEST), txtlen); fpos = 0; - STD_TEST_NEQ(" Rewind file #1 to start", apr_file_seek(file1, APR_SET, &fpos)) + rv = apr_file_seek(file1, APR_SET, &fpos); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 0, fpos); txtlen = 50; - STD_TEST_NEQ(" Read from file #1", - apr_file_read(file1, buff, &txtlen)) + rv = apr_file_read(file1, buff, &txtlen); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, TEST, buff); + + /* cleanup after ourselves */ + rv = apr_file_close(file1); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_file_close(file3); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_stat(&finfo, FILENAME, APR_FINFO_NORM, p); + CuAssertIntEquals(tc, APR_ENOENT, rv); +} + +static void test_dup2(CuTest *tc) +{ + apr_file_t *file2 = NULL; + apr_file_t *file3 = NULL; + apr_status_t rv; + + rv = apr_file_open(&file2, FILENAME, APR_READ | APR_WRITE | APR_CREATE | + APR_DELONCLOSE, APR_OS_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, file2); - TEST_NEQ(" Checking what we read from #1", strcmp(buff, TEST), 0, "OK", "Failed") + rv = apr_file_open_stderr(&file3, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_file_dup2(file3, file2, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, file3); - printf("\nTesting apr_file_dup2\n"); - STD_TEST_NEQ(" Open another new, empty file (#2)", - apr_file_open(&file2, "./testdup2.file", - APR_READ | APR_WRITE | APR_CREATE, - APR_OS_DEFAULT, p)) + apr_file_close(file2); + apr_file_close(file3); +} + +static void test_dup2_readwrite(CuTest *tc) +{ + apr_file_t *file3 = NULL; + apr_file_t *file2 = NULL; + apr_status_t rv; + apr_size_t txtlen = sizeof(TEST); + char buff[50]; + apr_off_t fpos; + + rv = apr_file_open(&file2, FILENAME, APR_READ | APR_WRITE | APR_CREATE | + APR_DELONCLOSE, APR_OS_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, file2); - STD_TEST_NEQ(" Dup2 test", apr_file_dup2(file3, file2, p)) + rv = apr_file_open_stderr(&file3, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_file_dup2(file3, file2, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, file3); txtlen = sizeof(TEST2); - STD_TEST_NEQ(" Write to dup'd file #3", apr_file_write(file3, TEST2, &txtlen)) + rv = apr_file_write(file3, TEST2, &txtlen); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, sizeof(TEST2), txtlen); - STD_TEST_NEQ(" Rewind file #2 to start", apr_file_seek(file2, APR_SET, &fpos)) + fpos = 0; + rv = apr_file_seek(file2, APR_SET, &fpos); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 0, fpos); txtlen = 50; - STD_TEST_NEQ(" Read from file #2", - apr_file_read(file2, buff, &txtlen)) - - TEST_NEQ(" Checking what we read from #2", strcmp(buff, TEST2), 0, "OK", "Failed") + rv = apr_file_read(file2, buff, &txtlen); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, TEST2, buff); - printf("\nCleaning up\n"); - STD_TEST_NEQ(" Closing file #3", apr_file_close(file3)) - STD_TEST_NEQ(" Closing file #2", apr_file_close(file2)) - STD_TEST_NEQ(" Closing file #1", apr_file_close(file1)) + apr_file_close(file2); + apr_file_close(file3); +} - STD_TEST_NEQ(" Removing first test file", apr_file_remove("./testdup.file", p)) - STD_TEST_NEQ(" Removing first test file", apr_file_remove("./testdup2.file", p)) +CuSuite *testdup(void) +{ + CuSuite *suite = CuSuiteNew("File duplication"); - printf("\nAll Tests completed - OK!\n"); + SUITE_ADD_TEST(suite, test_file_dup); + SUITE_ADD_TEST(suite, test_file_readwrite); + SUITE_ADD_TEST(suite, test_dup2); + SUITE_ADD_TEST(suite, test_dup2_readwrite); - return (0); + return suite; } From 51b23ace2059e21438b96a7e26c84b0ebc1cad8a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 24 Nov 2002 06:54:55 +0000 Subject: [PATCH 4064/7878] Migrate testsockets to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64083 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 9 +-- test/test_apr.h | 1 + test/testall.c | 1 + test/testsockets.c | 152 +++++++++++++++++++++++++++------------------ 4 files changed, 95 insertions(+), 68 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 2f232ca52d9..2cd3c64c200 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -26,7 +26,6 @@ PROGRAMS = \ testpoll@EXEEXT@ \ testhash@EXEEXT@ \ testuser@EXEEXT@ \ - testsockets@EXEEXT@ \ testdup@EXEEXT@ \ testatomic@EXEEXT@ \ testmutexscope@EXEEXT@ \ @@ -129,9 +128,6 @@ testpoll@EXEEXT@: testpoll.lo $(LOCAL_LIBS) testhash@EXEEXT@: testhash.lo $(LOCAL_LIBS) $(LINK) testhash.lo $(LOCAL_LIBS) $(ALL_LIBS) -testsockets@EXEEXT@: testsockets.lo $(LOCAL_LIBS) - $(LINK) testsockets.lo $(LOCAL_LIBS) $(ALL_LIBS) - testuser@EXEEXT@: testuser.lo $(LOCAL_LIBS) $(LINK) testuser.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -153,12 +149,13 @@ testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ - testdso.lo testoc.lo testdup.lo CuTest.lo mod_test.la \ + testdso.lo testoc.lo testdup.lo testsockets.lo CuTest.lo mod_test.la \ libmod_test.la occhild@EXEEXT@ $(LOCAL_LIBS) $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ - testdso.lo testoc.lo testdup.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) + testdso.lo testoc.lo testdup.lo testsockets.lo CuTest.lo \ + $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index c999675fcde..846ae23d3e0 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -83,6 +83,7 @@ CuSuite *testrand(void); CuSuite *testdso(void); CuSuite *testoc(void); CuSuite *testdup(void); +CuSuite *testsockets(void); diff --git a/test/testall.c b/test/testall.c index 0553df8c5bf..d17d2344d58 100644 --- a/test/testall.c +++ b/test/testall.c @@ -81,6 +81,7 @@ static const struct testlist { {"testrand", testrand}, {"testdso", testdso}, {"testoc", testoc}, + {"testsockets", testsockets}, {"LastTest", NULL} }; diff --git a/test/testsockets.c b/test/testsockets.c index 7d42aa4dd86..833aa58df67 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -52,10 +52,6 @@ * . */ -#include -#include -#include -#include #include "apr_network_io.h" #include "apr_errno.h" #include "apr_general.h" @@ -64,93 +60,125 @@ #if APR_HAVE_IPV6 #define US "::1" +#define FAMILY APR_INET6 #else #define US "127.0.0.1" +#define FAMILY APR_INET #endif -static void closeapr(void) +#define STRLEN 21 + +static void tcp_socket(CuTest *tc) { - apr_terminate(); + apr_status_t rv; + apr_socket_t *sock = NULL; + + rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, sock); + apr_socket_close(sock); } -static void close_sock(apr_socket_t *sock) +static void udp_socket(CuTest *tc) { - STD_TEST_NEQ(" Closing socket", apr_socket_close(sock)) -} + apr_status_t rv; + apr_socket_t *sock = NULL; -#define STRLEN 21 + rv = apr_socket_create(&sock, APR_INET, SOCK_DGRAM, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, sock); + apr_socket_close(sock); +} -int main(void) +static void tcp6_socket(CuTest *tc) { - apr_pool_t *pool; - apr_socket_t *sock = NULL, *sock2 = NULL; - apr_sockaddr_t *from; - apr_sockaddr_t *to; - apr_size_t len = 30; - char sendbuf[STRLEN] = "APR_INET, SOCK_DGRAM"; - char recvbuf[80]; - char *ip_addr; - apr_port_t fromport; #if APR_HAVE_IPV6 - int family = APR_INET6; + apr_status_t rv; + apr_socket_t *sock = NULL; + + rv = apr_socket_create(&sock, APR_INET6, SOCK_STREAM, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, sock); + apr_socket_close(sock); #else - int family = APR_INET; + CuNotImpl(tc, "IPv6"); #endif +} - STD_TEST_NEQ("Initializing APR", apr_initialize()) - - atexit(closeapr); - STD_TEST_NEQ("Creating 1st pool", apr_pool_create(&pool, NULL)) - - printf("Testing socket creation functions.\n"); - - STD_TEST_NEQ(" Creating a TCP socket", - apr_socket_create(&sock, APR_INET, SOCK_STREAM, pool)) - close_sock(sock); - - STD_TEST_NEQ(" Creating UDP socket", - apr_socket_create(&sock, APR_INET, SOCK_DGRAM, pool)) - close_sock(sock); - +static void udp6_socket(CuTest *tc) +{ #if APR_HAVE_IPV6 - STD_TEST_NEQ(" Creating an IPv6 TCP socket", - apr_socket_create(&sock, APR_INET6, SOCK_STREAM, pool)) - close_sock(sock); + apr_status_t rv; + apr_socket_t *sock = NULL; - STD_TEST_NEQ(" Creating an IPv6 UDP socket", - apr_socket_create(&sock, APR_INET6, SOCK_DGRAM, pool)) - close_sock(sock); + rv = apr_socket_create(&sock, APR_INET6, SOCK_DGRAM, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, sock); + apr_socket_close(sock); #else - printf("NO IPv6 support.\n"); + CuNotImpl(tc, "IPv6"); #endif +} - printf("Now trying sendto/recvfrom (simple tests only)\n"); +static void sendto_receivefrom(CuTest *tc) +{ + apr_status_t rv; + apr_socket_t *sock = NULL; + apr_socket_t *sock2 = NULL; + char sendbuf[STRLEN] = "APR_INET, SOCK_DGRAM"; + char recvbuf[80]; + char *ip_addr; + apr_port_t fromport; + apr_sockaddr_t *from; + apr_sockaddr_t *to; + apr_size_t len = 30; - STD_TEST_NEQ(" Creating socket #1 for test", - apr_socket_create(&sock, family, SOCK_DGRAM, pool)) - STD_TEST_NEQ(" Creating socket #2 for test", - apr_socket_create(&sock2, family, SOCK_DGRAM, pool)) + rv = apr_socket_create(&sock, FAMILY, SOCK_DGRAM, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_socket_create(&sock2, FAMILY, SOCK_DGRAM, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - apr_sockaddr_info_get(&to, US, APR_UNSPEC, 7772, 0, pool); - apr_sockaddr_info_get(&from, US, APR_UNSPEC, 7771, 0, pool); + rv = apr_sockaddr_info_get(&to, US, APR_UNSPEC, 7772, 0, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_sockaddr_info_get(&from, US, APR_UNSPEC, 7771, 0, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - STD_TEST_NEQ(" Binding socket #1", apr_socket_bind(sock, to)) - STD_TEST_NEQ(" Binding socket #2", apr_socket_bind(sock2, from)) + rv = apr_socket_bind(sock, to); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_socket_bind(sock2, from); + CuAssertIntEquals(tc, APR_SUCCESS, rv); len = STRLEN; + rv = apr_socket_sendto(sock2, to, 0, sendbuf, &len); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, STRLEN, len); - STD_TEST_NEQ(" Trying to sendto", - apr_socket_sendto(sock2, to, 0, sendbuf, &len)) len = 80; - STD_TEST_NEQ(" Trying to recvfrom", - apr_socket_recvfrom(from, sock, 0, recvbuf, &len)) - printf("\t\tGot back %d bytes [%s] from recvfrom\n", len, recvbuf); + rv = apr_socket_recvfrom(from, sock, 0, recvbuf, &len); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, STRLEN, len); + CuAssertStrEquals(tc, "APR_INET, SOCK_DGRAM", recvbuf); + apr_sockaddr_ip_get(&ip_addr, from); apr_sockaddr_port_get(&fromport, from); - printf("\t\tData came from %s:%u\n", ip_addr, fromport); + CuAssertStrEquals(tc, US, ip_addr); + CuAssertIntEquals(tc, 7771, fromport); - close_sock(sock); - close_sock(sock2); + apr_socket_close(sock); + apr_socket_close(sock2); +} - return 1; +CuSuite *testsockets(void) +{ + CuSuite *suite = CuSuiteNew("Socket Creation"); + + SUITE_ADD_TEST(suite, tcp_socket); + SUITE_ADD_TEST(suite, udp_socket); + + SUITE_ADD_TEST(suite, tcp6_socket); + SUITE_ADD_TEST(suite, udp6_socket); + + SUITE_ADD_TEST(suite, sendto_receivefrom); + return suite; } + From 836511a05052573c262fa8daa1d764ee5aaf7e1f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 24 Nov 2002 10:02:40 +0000 Subject: [PATCH 4065/7878] Move variable declarations to beginning of block (only allowed in C99/C++). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64084 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/testdso.c b/test/testdso.c index 21e5d19dccd..aa0f5b2ba88 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -269,6 +269,8 @@ static void test_load_notthere(CuTest *tc) CuSuite *testdso(void) { + CuSuite *suite = CuSuiteNew("DSO"); + filename = apr_pcalloc(p, 256); getcwd(filename, 256); filename = apr_pstrcat(p, filename, "/", LIB_NAME, NULL); @@ -277,9 +279,6 @@ CuSuite *testdso(void) getcwd(filename2, 256); filename2 = apr_pstrcat(p, filename2, "/", LIB_NAME2, NULL); - - CuSuite *suite = CuSuiteNew("DSO"); - SUITE_ADD_TEST(suite, test_load_module); SUITE_ADD_TEST(suite, test_dso_sym); SUITE_ADD_TEST(suite, test_dso_sym_return_value); From 831efbad082e63bf7f8c73713e1bdb01a263b43d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 25 Nov 2002 05:06:31 +0000 Subject: [PATCH 4066/7878] As pointed out by Marcel Mann , we were returning 0xfffffffe (the pseudo-handle) for the current thread. Stash the real apr_thread_t and recover it for apr_os_thread_current(). We were also missing thread_compare so I dropped that in while I was at it. The test is simple with the above behavior. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64085 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/start.c | 6 ++++++ threadproc/win32/thread.c | 17 ++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/misc/win32/start.c b/misc/win32/start.c index e81e87c26ef..df2ff70fe7b 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -195,6 +195,9 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, static int initialized = 0; +/* Provide to win32/thread.c */ +extern DWORD tls_apr_thread; + APR_DECLARE(apr_status_t) apr_initialize(void) { apr_pool_t *pool; @@ -213,6 +216,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_EEXIST; } + tls_apr_thread = TlsAlloc(); if ((status = apr_pool_initialize()) != APR_SUCCESS) return status; @@ -247,6 +251,8 @@ APR_DECLARE_NONSTD(void) apr_terminate(void) apr_pool_terminate(); WSACleanup(); + + TlsFree(tls_apr_thread); } APR_DECLARE(void) apr_terminate2(void) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index f602c96a3b8..12c6f257690 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -63,6 +63,9 @@ #endif #include "misc.h" +/* Chosen for us in apr_initialize */ +DWORD tls_apr_thread = 0; + APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *pool) { @@ -94,6 +97,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) static void *dummy_worker(void *opaque) { apr_thread_t *thd = (apr_thread_t *)opaque; + TlsSetValue(tls_apr_thread, thd); return thd->func(thd, thd->data); } @@ -214,7 +218,8 @@ APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) { - return GetCurrentThread(); + apr_thread_t *thd = (apr_thread_t *)TlsGetValue(tls_apr_thread); + return thd->td; } APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, @@ -258,4 +263,14 @@ APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, return APR_SUCCESS; } +APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, + apr_os_thread_t tid2) +{ + /* Since the only tid's we support our are own, and + * apr_os_thread_current returns the identical handle + * to the one we created initially, the test is simple. + */ + return (tid1 == tid2); +} + APR_POOL_IMPLEMENT_ACCESSOR(thread) From 1dc99e6a5d4337d3ecdd7bec58ad67430e48a6ea Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 25 Nov 2002 15:01:17 +0000 Subject: [PATCH 4067/7878] void * is not compatible with function ptrs use the right function ptr type git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64086 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testdso.c b/test/testdso.c index aa0f5b2ba88..b214441d5d5 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -112,7 +112,7 @@ static void test_dso_sym(CuTest *tc) CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); CuAssertPtrNotNull(tc, func1); - function = (void *)func1; + function = (void (*)(char *))func1; (*function)(teststr); CuAssertStrEquals(tc, "Hello - I'm a DSO!\n", teststr); @@ -135,7 +135,7 @@ static void test_dso_sym_return_value(CuTest *tc) CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); CuAssertPtrNotNull(tc, func1); - function = (void *)func1; + function = (int (*)(int))func1; status = (*function)(5); CuAssertIntEquals(tc, 5, status); @@ -198,7 +198,7 @@ static void test_dso_sym_non_module(CuTest *tc) CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); CuAssertPtrNotNull(tc, func1); - function = (void *)func1; + function = (void (*)(char *))func1; (*function)(teststr); CuAssertStrEquals(tc, "Hello - I'm a DSO!\n", teststr); @@ -225,7 +225,7 @@ static void test_dso_sym_return_value_non_mod(CuTest *tc) CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); CuAssertPtrNotNull(tc, func1); - function = (void *)func1; + function = (int (*)(int))func1; status = (*function)(5); CuAssertIntEquals(tc, 5, status); From 66ed0c6460a17a664ad4c5ce712b9a92f4c871f6 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 25 Nov 2002 20:26:16 +0000 Subject: [PATCH 4068/7878] $(shell ...) is a GNU make extension. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64087 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 2cd3c64c200..41d14d3137b 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -75,10 +75,10 @@ mod_test.slo: mod_test.c $(LIBTOOL) --mode=compile $(COMPILE) -prefer-pic -c $< && touch $@ mod_test.la: mod_test.slo $(LOCAL_LIBS) - $(LINK) --mode=link $(COMPILE) -rpath $(shell pwd) -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ + $(LINK) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ libmod_test.la: mod_test.slo $(LOCAL_LIBS) - $(LINK) --mode=link $(COMPILE) -rpath $(shell pwd) -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ + $(LINK) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ testargs@EXEEXT@: testargs.lo $(LOCAL_LIBS) $(LINK) testargs.lo $(LOCAL_LIBS) $(ALL_LIBS) From c931b5c444c856a45933ae200d4ad51a53087af0 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 26 Nov 2002 10:25:11 +0000 Subject: [PATCH 4069/7878] Fix use of $< outside inference rules (another GNU make extension). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64088 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index 41d14d3137b..5739be2576c 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -72,7 +72,7 @@ occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS) # FIXME: -prefer-pic is only supported with libtool-1.4+ mod_test.slo: mod_test.c - $(LIBTOOL) --mode=compile $(COMPILE) -prefer-pic -c $< && touch $@ + $(LIBTOOL) --mode=compile $(COMPILE) -prefer-pic -c mod_test.c && touch $@ mod_test.la: mod_test.slo $(LOCAL_LIBS) $(LINK) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ From dc3c22631cca8670b07306d3f5452a612d9366c8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 26 Nov 2002 16:02:37 +0000 Subject: [PATCH 4070/7878] Migrate testproc to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64089 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 26 ++--- test/test_apr.h | 1 + test/testall.c | 1 + test/testproc.c | 282 ++++++++++++++++++----------------------------- 4 files changed, 120 insertions(+), 190 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 5739be2576c..e71b675efed 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -12,7 +12,6 @@ PROGRAMS = \ server@EXEEXT@ \ testnames@EXEEXT@ \ testflock@EXEEXT@ \ - testproc@EXEEXT@ \ testsock@EXEEXT@ \ testthread@EXEEXT@ \ testlock@EXEEXT@ \ @@ -21,12 +20,10 @@ PROGRAMS = \ testshmproducer@EXEEXT@ \ testshmconsumer@EXEEXT@ \ testpipe@EXEEXT@ \ - testoc@EXEEXT@ \ testsockopt@EXEEXT@ \ testpoll@EXEEXT@ \ testhash@EXEEXT@ \ testuser@EXEEXT@ \ - testdup@EXEEXT@ \ testatomic@EXEEXT@ \ testmutexscope@EXEEXT@ \ testall@EXEEXT@ @@ -39,7 +36,7 @@ TARGETS = $(PROGRAMS) $(NONPORTABLE) LOCAL_LIBS=../lib@APR_LIBNAME@.la -CLEAN_TARGETS = testfile.tmp testdso@EXEEXT@ mod_test.slo +CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ INCDIR=../include INCLUDES=-I$(INCDIR) @@ -64,12 +61,12 @@ testnames@EXEEXT@: testnames.lo $(LOCAL_LIBS) testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS) $(LINK) testflock.lo $(LOCAL_LIBS) $(ALL_LIBS) -testdso@EXEEXT@: testdso.lo mod_test.la libmod_test.la $(LOCAL_LIBS) - $(LINK) testdso.lo $(LOCAL_LIBS) $(ALL_LIBS) - occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS) $(LINK) occhild.lo $(LOCAL_LIBS) $(ALL_LIBS) +proc_child@EXEEXT@: proc_child.lo $(LOCAL_LIBS) + $(LINK) proc_child.lo $(LOCAL_LIBS) $(ALL_LIBS) + # FIXME: -prefer-pic is only supported with libtool-1.4+ mod_test.slo: mod_test.c $(LIBTOOL) --mode=compile $(COMPILE) -prefer-pic -c mod_test.c && touch $@ @@ -83,9 +80,6 @@ libmod_test.la: mod_test.slo $(LOCAL_LIBS) testargs@EXEEXT@: testargs.lo $(LOCAL_LIBS) $(LINK) testargs.lo $(LOCAL_LIBS) $(ALL_LIBS) -testproc@EXEEXT@: testproc.lo $(LOCAL_LIBS) - $(LINK) testproc.lo $(LOCAL_LIBS) $(ALL_LIBS) - testthread@EXEEXT@: testthread.lo $(LOCAL_LIBS) $(LINK) testthread.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -140,22 +134,20 @@ testglobalmutex@EXEEXT@: testglobalmutex.lo $(LOCAL_LIBS) testatomic@EXEEXT@: testatomic.lo $(LOCAL_LIBS) $(LINK) testatomic.lo $(LOCAL_LIBS) $(ALL_LIBS) -testdup@EXEEXT@: testdup.lo $(LOCAL_LIBS) - $(LINK) testdup.lo $(LOCAL_LIBS) $(ALL_LIBS) - testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) $(LINK) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ - testdso.lo testoc.lo testdup.lo testsockets.lo CuTest.lo mod_test.la \ - libmod_test.la occhild@EXEEXT@ $(LOCAL_LIBS) + testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ + CuTest.lo mod_test.la libmod_test.la occhild@EXEEXT@ \ + proc_child@EXEEXT@ $(LOCAL_LIBS) $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ - testdso.lo testoc.lo testdup.lo testsockets.lo CuTest.lo \ - $(LOCAL_LIBS) $(ALL_LIBS) + testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ + CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index 846ae23d3e0..a9646f5ab6e 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -84,6 +84,7 @@ CuSuite *testdso(void); CuSuite *testoc(void); CuSuite *testdup(void); CuSuite *testsockets(void); +CuSuite *testproc(void); diff --git a/test/testall.c b/test/testall.c index d17d2344d58..c1479f8a5fc 100644 --- a/test/testall.c +++ b/test/testall.c @@ -82,6 +82,7 @@ static const struct testlist { {"testdso", testdso}, {"testoc", testoc}, {"testsockets", testsockets}, + {"testproc", testproc}, {"LastTest", NULL} }; diff --git a/test/testproc.c b/test/testproc.c index 0b3adf1641a..afe22a8753b 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -57,19 +57,8 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" -#include -#if APR_HAVE_UNISTD_H -#include -#endif -#include -#include -#include -#include #include "test_apr.h" -int test_filedel(void); -int testdirs(void); - /* XXX I'm sure there has to be a better way to do this ... */ #ifdef WIN32 #define EXTENSION ".exe" @@ -77,197 +66,144 @@ int testdirs(void); #define EXTENSION #endif -int main(int argc, char *argv[]) +#define TESTSTR "This is a test" + +static apr_proc_t newproc; + +static void test_create_proc(CuTest *tc) { - apr_pool_t *pool; - apr_proc_t newproc; + const char *args[2]; apr_procattr_t *attr; apr_file_t *testfile = NULL; - apr_file_t *testout = NULL; - apr_file_t *testerr = NULL; + apr_status_t rv; apr_size_t length; - apr_off_t offset; char *buf; - char msgbuf[120]; - const char *args[3]; - char *teststr; - apr_status_t rv; - if (apr_initialize() != APR_SUCCESS){ - printf("Failed to initialize APR\n"); - exit(-1); - } - atexit(apr_terminate); - apr_pool_create(&pool, NULL); + rv = apr_procattr_create(&attr, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - if (argc > 1) { - teststr = apr_palloc(pool, 256); - teststr = fgets(teststr, 256, stdin); - printf("%s", teststr); - if (!strcmp("--to-stderr", argv[1])) - fprintf(stderr, "%s", teststr); - exit(1); - } - teststr = apr_pstrdup(pool, "Whooo Hoooo\n"); - - printf("APR Process Test\n================\n\n"); - - STD_TEST_NEQ("Creating directory \"proctest\" for later use", - apr_dir_make("proctest", APR_UREAD | APR_UWRITE | APR_UEXECUTE, pool)) - - /* =================================================================== */ + rv = apr_procattr_io_set(attr, APR_FULL_BLOCK, APR_FULL_BLOCK, + APR_NO_PIPE); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - printf("\nTesting process pipes ...\n\n"); + rv = apr_procattr_dir_set(attr, "data"); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - STD_TEST_NEQ("Creating procattr", apr_procattr_create(&attr, pool)) - STD_TEST_NEQ("Setting attr pipes, all three", apr_procattr_io_set(attr, APR_FULL_BLOCK, - APR_CHILD_BLOCK, APR_NO_PIPE)) - STD_TEST_NEQ("Setting attr dir", apr_procattr_dir_set(attr, "proctest")) - STD_TEST_NEQ("Setting attr cmd type", apr_procattr_cmdtype_set(attr, APR_PROGRAM)) + rv = apr_procattr_cmdtype_set(attr, APR_PROGRAM); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - args[0] = "testproc"; - args[1] = "-X"; - args[2] = NULL; + args[0] = "proc_child"; + args[1] = NULL; - STD_TEST_NEQ("Creating a new process", apr_proc_create(&newproc, - "../testproc" EXTENSION, args, NULL, attr, pool)) + rv = apr_proc_create(&newproc, "../proc_child" EXTENSION, args, NULL, + attr, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - printf("%-60s","Grabbing child's stdin"); testfile = newproc.in; - printf("OK\n"); - length = strlen(teststr); - printf("%-60s", "Writing the data to child"); - if ((rv = apr_file_write(testfile, teststr, &length)) == APR_SUCCESS) { - printf("OK\n"); - } - else { - printf("Write failed: (%d) %s.\n", - rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); - } + length = strlen(TESTSTR); + rv = apr_file_write(testfile, TESTSTR, &length); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, strlen(TESTSTR), length); - printf("%-60s", "Grabbing child's stdout"); testfile = newproc.out; - printf("OK\n"); - length = 256; - printf("%-60s", "Checking the data read from pipe to child"); - buf = apr_pcalloc(pool, length); - if ((rv = apr_file_read(testfile, buf, &length)) == APR_SUCCESS) { - if (!strcmp(buf, teststr)) - printf("OK\n"); - else { - printf( "Uh-Oh\n"); - printf(" (I actually got %s)\n", buf); - } - } - else { - printf("Read failed - (%d) %s\n", - rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); - } + buf = apr_pcalloc(p, length); + rv = apr_file_read(testfile, buf, &length); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, TESTSTR, buf); +} - TEST_NEQ("Waiting for child to die", - apr_proc_wait(&newproc, NULL, NULL, APR_WAIT), - APR_CHILD_DONE, "OK", "Failed") +static void test_proc_wait(CuTest *tc) +{ + apr_status_t rv; - /* =================================================================== */ + rv = apr_proc_wait(&newproc, NULL, NULL, APR_WAIT); + CuAssertIntEquals(tc, APR_CHILD_DONE, rv); +} - printf("\nTesting file redirection ...\n\n"); +static void test_file_redir(CuTest *tc) +{ + apr_file_t *testout = NULL; + apr_file_t *testerr = NULL; + apr_off_t offset; + apr_status_t rv; + const char *args[2]; + apr_procattr_t *attr; + apr_file_t *testfile = NULL; + apr_size_t length; + char *buf; testfile = NULL; - STD_TEST_NEQ("Creating input file", - apr_file_open(&testfile, "proctest/stdin", - APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, - APR_OS_DEFAULT, pool)) - STD_TEST_NEQ("Creating output file", - apr_file_open(&testout, "proctest/stdout", - APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, - APR_OS_DEFAULT, pool)) - STD_TEST_NEQ("Creating error file", - apr_file_open(&testerr, "proctest/stderr", - APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, - APR_OS_DEFAULT, pool)) - - length = strlen(teststr); - STD_TEST_NEQ("Writing input file", - apr_file_write(testfile, teststr, &length)) + rv = apr_file_open(&testfile, "data/stdin", + APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, + APR_OS_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_file_open(&testout, "data/stdout", + APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, + APR_OS_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_file_open(&testerr, "data/stderr", + APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, + APR_OS_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + length = strlen(TESTSTR); + apr_file_write(testfile, TESTSTR, &length); offset = 0; - STD_TEST_NEQ("Rewinding input file", - apr_file_seek(testfile, APR_SET, &offset)) - - STD_TEST_NEQ("Creating procattr", apr_procattr_create(&attr, pool)) - STD_TEST_NEQ("Setting attr input file", - apr_procattr_child_in_set(attr, testfile, NULL)) - STD_TEST_NEQ("Setting attr output file", - apr_procattr_child_out_set(attr, testout, NULL)) - STD_TEST_NEQ("Setting attr error file", - apr_procattr_child_err_set(attr, testerr, NULL)) - STD_TEST_NEQ("Setting attr dir", apr_procattr_dir_set(attr, "proctest")) - STD_TEST_NEQ("Setting attr cmd type", apr_procattr_cmdtype_set(attr, APR_PROGRAM)) - - args[0] = "testproc"; - args[1] = "--to-stderr"; - args[2] = NULL; - - STD_TEST_NEQ("Creating a new process", apr_proc_create(&newproc, - "../testproc" EXTENSION, args, NULL, attr, pool)) - - TEST_NEQ("Waiting for child to die", - apr_proc_wait(&newproc, NULL, NULL, APR_WAIT), - APR_CHILD_DONE, "OK", "Failed") + rv = apr_file_seek(testfile, APR_SET, &offset); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 0, offset); + + rv = apr_procattr_create(&attr, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_procattr_child_in_set(attr, testfile, NULL); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_procattr_child_out_set(attr, testout, NULL); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_procattr_child_err_set(attr, testerr, NULL); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_procattr_dir_set(attr, "data"); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_procattr_cmdtype_set(attr, APR_PROGRAM); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + args[0] = "proc_child"; + args[1] = NULL; + + rv = apr_proc_create(&newproc, "../proc_child" EXTENSION, args, NULL, + attr, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_proc_wait(&newproc, NULL, NULL, APR_WAIT); + CuAssertIntEquals(tc, APR_CHILD_DONE, rv); offset = 0; - STD_TEST_NEQ("Rewinding output file", - apr_file_seek(testout, APR_SET, &offset)) - length = 256; - printf("%-60s", "Checking the data read from child's stdout"); - buf = apr_pcalloc(pool, length); - if ((rv = apr_file_read(testout, buf, &length)) == APR_SUCCESS) { - if (!strcmp(buf, teststr)) - printf("OK\n"); - else { - printf( "Uh-Oh\n"); - printf(" (I actually got %s_\n", buf); - } - } - else { - printf("Read failed - (%d) %s\n", - rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); - } + rv = apr_file_seek(testout, APR_SET, &offset); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - offset = 0; - STD_TEST_NEQ("Rewinding error file", - apr_file_seek(testerr, APR_SET, &offset)) length = 256; - printf("%-60s", "Checking the data read from child's stderr"); - buf = apr_pcalloc(pool, length); - if ((rv = apr_file_read(testerr, buf, &length)) == APR_SUCCESS) { - if (!strcmp(buf, teststr)) - printf("OK\n"); - else { - printf( "Uh-Oh\n"); - printf(" (I actually got %s_\n", buf); - } - } - else { - printf("Read failed - (%d) %s\n", - rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); - } - - STD_TEST_NEQ("Closing input file", apr_file_close(testfile)); - STD_TEST_NEQ("Closing output file", apr_file_close(testout)); - STD_TEST_NEQ("Closing error file", apr_file_close(testerr)); - - STD_TEST_NEQ("Removing input file", apr_file_remove("proctest/stdin", pool)); - STD_TEST_NEQ("Removing output file", apr_file_remove("proctest/stdout", pool)); - STD_TEST_NEQ("Removing error file", apr_file_remove("proctest/stderr", pool)); + buf = apr_pcalloc(p, length); + rv = apr_file_read(testout, buf, &length); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, TESTSTR, buf); + + rv = apr_file_remove("data/stdin", p);; + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_file_remove("data/stdout", p);; + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_file_remove("data/stderr", p);; + CuAssertIntEquals(tc, APR_SUCCESS, rv); +} - /* =================================================================== */ +CuSuite *testproc(void) +{ + CuSuite *suite = CuSuiteNew("Process control"); - printf("\n"); - STD_TEST_NEQ("Removing directory", apr_dir_remove("proctest", pool)) + SUITE_ADD_TEST(suite, test_create_proc); + SUITE_ADD_TEST(suite, test_proc_wait); + SUITE_ADD_TEST(suite, test_file_redir); - printf("\nTest completed succesfully\n"); - return 0; + return suite; } From 448d1077114562da21d1c6ce24b92cdeb906f0a0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 26 Nov 2002 16:09:56 +0000 Subject: [PATCH 4071/7878] Forgot to commit this file with the testproc changes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64090 13f79535-47bb-0310-9956-ffa450edef68 --- test/proc_child.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/proc_child.c diff --git a/test/proc_child.c b/test/proc_child.c new file mode 100644 index 00000000000..9b3fd1cf25f --- /dev/null +++ b/test/proc_child.c @@ -0,0 +1,16 @@ +#include "apr.h" +#include +#if APR_HAVE_UNISTD_H +#include +#endif +#include + +int main(void) +{ + char buf[256]; + + read(STDIN_FILENO, buf, 256); + fprintf(stdout, "%s", buf); + + return 0; /* just to keep the compiler happy */ +} From fe0c21a4ea297a7fd3f9c7ece5120635502a85e4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 26 Nov 2002 16:10:25 +0000 Subject: [PATCH 4072/7878] These macros can finally go away, there are no tests that are still using them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64091 13f79535-47bb-0310-9956-ffa450edef68 --- test/test_apr.h | 88 ------------------------------------------------- 1 file changed, 88 deletions(-) diff --git a/test/test_apr.h b/test/test_apr.h index a9646f5ab6e..f1173a43c33 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -86,92 +86,4 @@ CuSuite *testdup(void); CuSuite *testsockets(void); CuSuite *testproc(void); - - -#include "apr_strings.h" -#include "apr_time.h" - - -#define TEST_EQ(str, func, value, good, bad) \ - printf("%-60s", str); \ - { \ - apr_status_t rv; \ - if ((rv = func) == value){ \ - char errmsg[200]; \ - printf("%s\n", bad); \ - fprintf(stderr, "Error was %d : %s\n", rv, \ - apr_strerror(rv, (char*)&errmsg, 200)); \ - exit(-1); \ - } \ - printf("%s\n", good); \ - } - -#define TEST_NEQ(str, func, value, good, bad) \ - printf("%-60s", str); \ - { \ - apr_status_t rv; \ - if ((rv = func) != value){ \ - char errmsg[200]; \ - printf("%s\n", bad); \ - fprintf(stderr, "Error was %d : %s\n", rv, \ - apr_strerror(rv, (char*)&errmsg, 200)); \ - exit(-1); \ - } \ - printf("%s\n", good); \ - } - -#define TEST_NEQ_NONFATAL(str, func, value, good, bad) \ - printf("%-60s", str); \ - { \ - apr_status_t rv; \ - if ((rv = func) != value){ \ - char errmsg[200]; \ - printf("%s\n", bad); \ - fprintf(stderr, "Error was %d : %s\n", rv, \ - apr_strerror(rv, (char*)&errmsg, 200)); \ - } \ - else \ - printf("%s\n", good); \ - } - -#define TEST_STATUS(str, func, testmacro, good, bad) \ - printf("%-60s", str); \ - { \ - apr_status_t rv = func; \ - if (!testmacro(rv)) { \ - char errmsg[200]; \ - printf("%s\n", bad); \ - fprintf(stderr, "Error was %d : %s\n", rv, \ - apr_strerror(rv, (char*)&errmsg, 200)); \ - exit(-1); \ - } \ - printf("%s\n", good); \ - } - -#define STD_TEST_NEQ(str, func) \ - TEST_NEQ(str, func, APR_SUCCESS, "OK", "Failed"); - -#define STD_TEST_NEQ_NONFATAL(str, func) \ - TEST_NEQ_NONFATAL(str, func, APR_SUCCESS, "OK", "Failed"); - -#define PRINT_ERROR(rv) \ - { \ - char errmsg[200]; \ - fprintf(stderr, "Error was %d : %s\n", rv, \ - apr_strerror(rv, (char*)&errmsg, 200)); \ - exit(-1); \ - } - -#define MSG_AND_EXIT(msg) \ - printf("%s\n", msg); \ - exit (-1); - -#define TIME_FUNCTION(time, function) \ - { \ - apr_time_t tt = apr_time_now(); \ - function; \ - time = apr_time_now() - tt; \ - } - - #endif /* APR_TEST_INCLUDES */ From 817fa23dd564458f4b186822ec3e7b3400d9b121 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 26 Nov 2002 16:10:59 +0000 Subject: [PATCH 4073/7878] Fix a coupleof build warnings git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64092 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 1 + test/testtime.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testdso.c b/test/testdso.c index b214441d5d5..99bf00d6e83 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -58,6 +58,7 @@ #include "apr_pools.h" #include "apr_errno.h" #include "apr_dso.h" +#include "apr_strings.h" #include "apr.h" #ifdef APR_HAVE_UNISTD_H #include diff --git a/test/testtime.c b/test/testtime.c index 7aeb70c7d37..e68f3ae70b5 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -56,10 +56,9 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" -#include -#include -#include #include "test_apr.h" +#include "apr_strings.h" +#include #define STR_SIZE 45 From 354398d9923957d3789b1edc940005fbed7bdc94 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 26 Nov 2002 22:53:50 +0000 Subject: [PATCH 4074/7878] Allow for the path length to change while resolving each segment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64093 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 63eef19e936..63142c28af3 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -875,12 +875,12 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, == APR_SUCCESS) { apr_size_t namelen = strlen(finfo.name); -#if defined(OS2) || defined(NETWARE) /* only has case folding, never aliases that change the length */ +#if defined(OS2) /* only has case folding, never aliases that change the length */ if (memcmp(finfo.name, path + keptlen, seglen) != 0) { memcpy(path + keptlen, finfo.name, namelen); } -#else /* WIN32; here there be aliases that gire and gimble and change length */ +#else /* WIN32 || NETWARE; here there be aliases that gire and gimble and change length */ if ((namelen != seglen) || (memcmp(finfo.name, path + keptlen, seglen) != 0)) From 996a1429cf2ef0487ee88a7d6bf0104787927e6b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 27 Nov 2002 05:28:38 +0000 Subject: [PATCH 4075/7878] Add some const saftey to CuTest git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64094 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 4 ++-- test/CuTest.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/CuTest.c b/test/CuTest.c index 23eff695b50..6b15bcef10c 100644 --- a/test/CuTest.c +++ b/test/CuTest.c @@ -200,7 +200,7 @@ void CuAssertIntEquals(CuTest* tc, int expected, int actual) CuFail(tc, buf); } -void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual) +void CuAssertPtrEquals(CuTest* tc, const void* expected, const void* actual) { char buf[STRING_MAX]; if (expected == actual) return; @@ -208,7 +208,7 @@ void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual) CuFail(tc, buf); } -void CuAssertPtrNotNull(CuTest* tc, void* pointer) +void CuAssertPtrNotNull(CuTest* tc, const void* pointer) { char buf[STRING_MAX]; if (pointer != NULL ) return; diff --git a/test/CuTest.h b/test/CuTest.h index 8c51663b5f4..8d93818bc6f 100644 --- a/test/CuTest.h +++ b/test/CuTest.h @@ -87,8 +87,8 @@ void CuAssert(CuTest* tc, const char* message, int condition); void CuAssertTrue(CuTest* tc, int condition); void CuAssertStrEquals(CuTest* tc, const char* expected, const char* actual); void CuAssertIntEquals(CuTest* tc, int expected, int actual); -void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual); -void CuAssertPtrNotNull(CuTest* tc, void* pointer); +void CuAssertPtrEquals(CuTest* tc, const void* expected, const void* actual); +void CuAssertPtrNotNull(CuTest* tc, const void* pointer); void CuTestRun(CuTest* tc); /* CuSuite */ From a16b5c407a0da151a8a5fea2b9cbbfd0801983e0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 27 Nov 2002 05:41:52 +0000 Subject: [PATCH 4076/7878] Migrate testpoll to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64095 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 8 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testpoll.c | 570 +++++++++++++++++++++++++++++------------------ 4 files changed, 360 insertions(+), 220 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index e71b675efed..1ee31bc2969 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -21,7 +21,6 @@ PROGRAMS = \ testshmconsumer@EXEEXT@ \ testpipe@EXEEXT@ \ testsockopt@EXEEXT@ \ - testpoll@EXEEXT@ \ testhash@EXEEXT@ \ testuser@EXEEXT@ \ testatomic@EXEEXT@ \ @@ -116,9 +115,6 @@ testpipe@EXEEXT@: testpipe.lo $(LOCAL_LIBS) testsockopt@EXEEXT@: testsockopt.lo $(LOCAL_LIBS) $(LINK) testsockopt.lo $(LOCAL_LIBS) $(ALL_LIBS) -testpoll@EXEEXT@: testpoll.lo $(LOCAL_LIBS) - $(LINK) testpoll.lo $(LOCAL_LIBS) $(ALL_LIBS) - testhash@EXEEXT@: testhash.lo $(LOCAL_LIBS) $(LINK) testhash.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -141,13 +137,13 @@ testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ - CuTest.lo mod_test.la libmod_test.la occhild@EXEEXT@ \ + testpoll.lo CuTest.lo mod_test.la libmod_test.la occhild@EXEEXT@ \ proc_child@EXEEXT@ $(LOCAL_LIBS) $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ - CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) + testpoll.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/test_apr.h b/test/test_apr.h index f1173a43c33..c5e166dcc84 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -85,5 +85,6 @@ CuSuite *testoc(void); CuSuite *testdup(void); CuSuite *testsockets(void); CuSuite *testproc(void); +CuSuite *testpoll(void); #endif /* APR_TEST_INCLUDES */ diff --git a/test/testall.c b/test/testall.c index c1479f8a5fc..0b16574a9b2 100644 --- a/test/testall.c +++ b/test/testall.c @@ -83,6 +83,7 @@ static const struct testlist { {"testoc", testoc}, {"testsockets", testsockets}, {"testproc", testproc}, + {"testpoll", testpoll}, {"LastTest", NULL} }; diff --git a/test/testpoll.c b/test/testpoll.c index b540f8edb3e..5757597e274 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -52,281 +52,423 @@ * . */ -#include "apr_mmap.h" +#include "test_apr.h" +#include "apr_strings.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_network_io.h" #include "apr_poll.h" -#if APR_HAVE_UNISTD_H -#include -#endif -#include -#include -#include - -static int make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, apr_port_t port, - apr_pool_t *p) + +#define SMALL_NUM_SOCKETS 3 +#define LARGE_NUM_SOCKETS 64 + +static apr_socket_t *s[LARGE_NUM_SOCKETS]; +static apr_sockaddr_t *sa[LARGE_NUM_SOCKETS]; +static apr_pollfd_t *pollarray; +static apr_pollfd_t *pollarray_large; +static apr_pollset_t *pollset; + +static void make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, + apr_port_t port, apr_pool_t *p, CuTest *tc) { - if (apr_sockaddr_info_get(sa, "127.0.0.1", APR_UNSPEC, port, 0, p) - != APR_SUCCESS){ - printf("couldn't create control socket information, shutting down"); - return 1; - } - if (apr_socket_create(sock, (*sa)->family, SOCK_DGRAM, p) - != APR_SUCCESS){ - printf("couldn't create UDP socket, shutting down"); - return 1; - } - if (apr_socket_bind((*sock), (*sa)) != APR_SUCCESS){ - printf("couldn't bind UDP socket!"); - return 1; - } - return 0; + apr_status_t rv; + + rv = apr_sockaddr_info_get(sa, "127.0.0.1", APR_UNSPEC, port, 0, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_socket_create(sock, (*sa)->family, SOCK_DGRAM, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv =apr_socket_bind((*sock), (*sa)); + CuAssertIntEquals(tc, APR_SUCCESS, rv); } -static int check_sockets(apr_pollfd_t *pollarray, apr_socket_t **sockarray) +static void check_sockets(const apr_pollfd_t *pollarray, + apr_socket_t **sockarray, int which, int pollin, + CuTest *tc) { - int i = 0; - printf("\tSocket 0\tSocket 1\tSocket 2\n\t"); - for (i = 0;i < 3;i++){ - apr_int16_t event; - if (apr_poll_revents_get(&event, sockarray[i], pollarray) != APR_SUCCESS){ - printf("Failed!\n"); - exit (-1); - } - if (event & APR_POLLIN){ - printf ("POLLIN!\t\t"); - } else { - printf ("No wait\t\t"); - } + apr_status_t rv; + apr_int16_t event; + char *str; + + rv = apr_poll_revents_get(&event, sockarray[which], + (apr_pollfd_t *)pollarray); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + if (pollin) { + str = apr_psprintf(p, "Socket %d not signalled when it should be", + which); + CuAssert(tc, str, event & APR_POLLIN); + } else { + str = apr_psprintf(p, "Socket %d signalled when it should not be", + which); + CuAssert(tc, str, !(event & APR_POLLIN)); } - printf("\n"); - return 0; } -static void send_msg(apr_socket_t **sockarray, apr_sockaddr_t **sas, int which) +static void send_msg(apr_socket_t **sockarray, apr_sockaddr_t **sas, int which, + CuTest *tc) { apr_size_t len = 5; apr_status_t rv; - char errmsg[120]; - printf("\tSending message to socket %d............", which); - if ((rv = apr_socket_sendto(sockarray[which], sas[which], 0, "hello", &len)) != APR_SUCCESS){ - apr_strerror(rv, errmsg, sizeof errmsg); - printf("Failed! %s\n", errmsg); - exit(-1); - } - printf("OK\n"); + rv = apr_socket_sendto(sockarray[which], sas[which], 0, "hello", &len); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, strlen("hello"), len); } -static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p) +static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p, + CuTest *tc) { apr_size_t buflen = 5; char *buffer = apr_pcalloc(p, sizeof(char) * buflen); apr_sockaddr_t *recsa; apr_status_t rv; - char errmsg[120]; apr_sockaddr_info_get(&recsa, "127.0.0.1", APR_UNSPEC, 7770, 0, p); - printf("\tTrying to get message from socket %d....", which); - if ((rv = apr_socket_recvfrom(recsa, sockarray[which], 0, buffer, &buflen)) - != APR_SUCCESS){ - apr_strerror(rv, errmsg, sizeof errmsg); - printf("Failed! %s\n", errmsg); - exit (-1); - } - printf("OK\n"); + rv = apr_socket_recvfrom(recsa, sockarray[which], 0, buffer, &buflen); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, strlen("hello"), buflen); + CuAssertStrEquals(tc, "hello", buffer); } -#define SMALL_NUM_SOCKETS 3 -#define LARGE_NUM_SOCKETS 64 - -int main(void) -{ - apr_pool_t *context; - apr_socket_t *s[LARGE_NUM_SOCKETS]; - apr_sockaddr_t *sa[LARGE_NUM_SOCKETS]; - apr_pollfd_t *pollarray; - apr_pollfd_t *pollarray_large; - apr_pollset_t *pollset; - int i = 0, srv = SMALL_NUM_SOCKETS; - apr_int32_t num; - const apr_pollfd_t *descriptors_out; - apr_status_t rv; - - fprintf (stdout,"APR Poll Test\n*************\n\n"); - printf("Initializing..................................."); - if (apr_initialize() != APR_SUCCESS) { - printf("Failed.\n"); - exit(-1); - } - printf("OK\n"); - atexit(apr_terminate); +static void create_all_sockets(CuTest *tc) +{ + int i; - printf("Creating context..............................."); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - printf("Failed.\n"); - exit(-1); - } - printf("OK\n"); - - printf("\tCreating the sockets I'll use.........."); for (i = 0; i < LARGE_NUM_SOCKETS; i++){ - if (make_socket(&s[i], &sa[i], 7777 + i, context) != 0){ - exit(-1); - } + make_socket(&s[i], &sa[i], 7777 + i, p, tc); } - printf("OK\n"); +} - printf ("\tSetting up the poll arrays I'll use........"); - if (apr_poll_setup(&pollarray, SMALL_NUM_SOCKETS, context) != APR_SUCCESS){ - printf("Couldn't create a poll array!\n"); - exit (-1); - } - if (apr_poll_setup(&pollarray_large, LARGE_NUM_SOCKETS, context) != - APR_SUCCESS){ - printf("Couldn't create a poll array!\n"); - exit (-1); - } +static void setup_small_poll(CuTest *tc) +{ + apr_status_t rv; + int i; + + rv = apr_poll_setup(&pollarray, SMALL_NUM_SOCKETS, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + for (i = 0; i < SMALL_NUM_SOCKETS;i++){ - if (apr_poll_socket_add(pollarray, s[i], APR_POLLIN) != APR_SUCCESS){ - printf("Failed to add socket %d\n", i); - exit (-1); - } + CuAssertIntEquals(tc, 0, pollarray[i].reqevents); + CuAssertIntEquals(tc, 0, pollarray[i].rtnevents); + + rv = apr_poll_socket_add(pollarray, s[i], APR_POLLIN); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrEquals(tc, s[i], pollarray[i].desc.s); } +} + +static void setup_large_poll(CuTest *tc) +{ + apr_status_t rv; + int i; + + rv = apr_poll_setup(&pollarray_large, LARGE_NUM_SOCKETS, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + for (i = 0; i < LARGE_NUM_SOCKETS;i++){ - if (apr_poll_socket_add(pollarray_large, s[i], APR_POLLIN) != - APR_SUCCESS){ - printf("Failed to add socket %d\n", i); - exit (-1); - } + CuAssertIntEquals(tc, 0, pollarray_large[i].reqevents); + CuAssertIntEquals(tc, 0, pollarray_large[i].rtnevents); + + rv = apr_poll_socket_add(pollarray_large, s[i], APR_POLLIN); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrEquals(tc, s[i], pollarray_large[i].desc.s); } - printf("OK\n"); - printf("Starting Tests\n"); +} - apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - check_sockets(pollarray, s); - - send_msg(s, sa, 2); +static void nomessage(CuTest *tc) +{ + apr_status_t rv; + int srv = SMALL_NUM_SOCKETS; - apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 10 * APR_USEC_PER_SEC); - check_sockets(pollarray, s); + rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + check_sockets(pollarray, s, 0, 0, tc); + check_sockets(pollarray, s, 1, 0, tc); + check_sockets(pollarray, s, 2, 0, tc); +} - recv_msg(s, 2, context); - send_msg(s, sa, 1); +static void send_2(CuTest *tc) +{ + apr_status_t rv; + int srv = SMALL_NUM_SOCKETS; - apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 10 * APR_USEC_PER_SEC); - check_sockets(pollarray, s); + send_msg(s, sa, 2, tc); - send_msg(s, sa, 2); + rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + check_sockets(pollarray, s, 0, 0, tc); + check_sockets(pollarray, s, 1, 0, tc); + check_sockets(pollarray, s, 2, 1, tc); +} - apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 10 * APR_USEC_PER_SEC); - check_sockets(pollarray, s); - - recv_msg(s, 1, context); - send_msg(s, sa, 0); - - apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 10 * APR_USEC_PER_SEC); - check_sockets(pollarray, s); +static void recv_2_send_1(CuTest *tc) +{ + apr_status_t rv; + int srv = SMALL_NUM_SOCKETS; + + recv_msg(s, 2, p, tc); + send_msg(s, sa, 1, tc); + + rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + check_sockets(pollarray, s, 0, 0, tc); + check_sockets(pollarray, s, 1, 1, tc); + check_sockets(pollarray, s, 2, 0, tc); +} + +static void send_2_signaled_1(CuTest *tc) +{ + apr_status_t rv; + int srv = SMALL_NUM_SOCKETS; + + send_msg(s, sa, 2, tc); + + rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + check_sockets(pollarray, s, 0, 0, tc); + check_sockets(pollarray, s, 1, 1, tc); + check_sockets(pollarray, s, 2, 1, tc); +} + +static void recv_1_send_0(CuTest *tc) +{ + apr_status_t rv; + int srv = SMALL_NUM_SOCKETS; + + recv_msg(s, 1, p, tc); + send_msg(s, sa, 0, tc); + + rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + check_sockets(pollarray, s, 0, 1, tc); + check_sockets(pollarray, s, 1, 0, tc); + check_sockets(pollarray, s, 2, 1, tc); +} + +static void clear_all_signalled(CuTest *tc) +{ + apr_status_t rv; + int srv = SMALL_NUM_SOCKETS; + + recv_msg(s, 0, p, tc); + recv_msg(s, 2, p, tc); - recv_msg(s, 0, context); - recv_msg(s, 2, context); + rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + check_sockets(pollarray, s, 0, 0, tc); + check_sockets(pollarray, s, 1, 0, tc); + check_sockets(pollarray, s, 2, 0, tc); +} - send_msg(s, sa, LARGE_NUM_SOCKETS - 1); - apr_poll(pollarray_large, LARGE_NUM_SOCKETS, &srv, 10 * APR_USEC_PER_SEC); - check_sockets(pollarray_large, s); - recv_msg(s, LARGE_NUM_SOCKETS - 1, context); +static void send_large_pollarray(CuTest *tc) +{ + apr_status_t rv; + int lrv = LARGE_NUM_SOCKETS; + int i; + send_msg(s, sa, LARGE_NUM_SOCKETS - 1, tc); - printf("Tests completed.\n"); + rv = apr_poll(pollarray_large, LARGE_NUM_SOCKETS, &lrv, + 2 * APR_USEC_PER_SEC); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + for (i = 0; i < LARGE_NUM_SOCKETS; i++) { + if (i == (LARGE_NUM_SOCKETS - 1)) { + check_sockets(pollarray_large, s, i, 1, tc); + } + else { + check_sockets(pollarray_large, s, i, 0, tc); + } + } +} - fprintf (stdout,"\nAPR Pollset Test\n****************\n\n"); +static void recv_large_pollarray(CuTest *tc) +{ + apr_status_t rv; + int lrv = LARGE_NUM_SOCKETS; + int i; - printf ("\tSetting up pollset...................."); - if (apr_pollset_create(&pollset, LARGE_NUM_SOCKETS, context, 0) != APR_SUCCESS){ - printf("Couldn't create a pollset!\n"); - exit (-1); + recv_msg(s, LARGE_NUM_SOCKETS - 1, p, tc); + + rv = apr_poll(pollarray_large, LARGE_NUM_SOCKETS, &lrv, + 2 * APR_USEC_PER_SEC); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + + for (i = 0; i < LARGE_NUM_SOCKETS; i++) { + check_sockets(pollarray_large, s, i, 0, tc); } +} + +static void setup_pollset(CuTest *tc) +{ + apr_status_t rv; + rv = apr_pollset_create(&pollset, LARGE_NUM_SOCKETS, p, 0); + CuAssertIntEquals(tc, APR_SUCCESS, rv); +} + +static void add_sockets_pollset(CuTest *tc) +{ + apr_status_t rv; + int i; + for (i = 0; i < LARGE_NUM_SOCKETS;i++){ apr_pollfd_t socket_pollfd; socket_pollfd.desc_type = APR_POLL_SOCKET; socket_pollfd.reqevents = APR_POLLIN; socket_pollfd.desc.s = s[i]; socket_pollfd.client_data = s[i]; - if (apr_pollset_add(pollset, &socket_pollfd) != APR_SUCCESS){ - printf("Failed to add socket %d\n", i); - exit (-1); - } + rv = apr_pollset_add(pollset, &socket_pollfd); + CuAssertIntEquals(tc, APR_SUCCESS, rv); } - printf("OK\n"); +} - printf("\nTest 1: No descriptors signalled......."); - if ((rv = apr_pollset_poll(pollset, 0, &num, &descriptors_out) != - APR_TIMEUP) || (num != 0)) { - printf("Test 1: FAILED (errno=%d, num=%d (expected 0)\n", rv, num); - exit(-1); - } - printf("Test 1: OK\n"); - - printf("\nTest 2: First descriptor signalled.....\n"); - send_msg(s, sa, 0); - descriptors_out = NULL; - if ((rv = apr_pollset_poll(pollset, 0, &num, &descriptors_out) - != APR_SUCCESS) || (num != 1) || !descriptors_out || - (descriptors_out[0].desc.s != s[0]) || - (descriptors_out[0].client_data != s[0])) { - printf("Test 2: FAILED (errno=%d, num=%d (expected 1)\n", rv, num); - exit(-1); - } - recv_msg(s, 0, context); - printf("Test 2: OK\n"); - - printf("\nTest 3: Middle descriptors signalled.....\n"); - send_msg(s, sa, 2); - send_msg(s, sa, 5); - descriptors_out = NULL; - /* note that the descriptors in the result set can be in - * any order, so we have to test for both permutations here - */ - if ((rv = apr_pollset_poll(pollset, 0, &num, &descriptors_out) - != APR_SUCCESS) || (num != 2) || !descriptors_out || - !(((descriptors_out[0].desc.s == s[2]) && - (descriptors_out[1].desc.s == s[5])) || - ((descriptors_out[0].desc.s == s[5]) && - (descriptors_out[1].desc.s == s[2])))) { - printf("Test 2: FAILED (errno=%d, num=%d (expected 2)\n", rv, num); - exit(-1); - } - recv_msg(s, 2, context); - recv_msg(s, 5, context); - printf("Test 3: OK\n"); - - printf("\nTest 4: Last descriptor signalled......\n"); - send_msg(s, sa, LARGE_NUM_SOCKETS - 1); - descriptors_out = NULL; - if ((rv = apr_pollset_poll(pollset, 0, &num, &descriptors_out) != - APR_SUCCESS) || (num != 1) || !descriptors_out || - (descriptors_out[0].desc.s != s[LARGE_NUM_SOCKETS - 1]) || - (descriptors_out[0].client_data != s[LARGE_NUM_SOCKETS - 1])) { - printf("Test 4: FAILED (errno=%d, num=%d (expected 1)\n", rv, num); - exit(-1); - } - recv_msg(s, LARGE_NUM_SOCKETS - 1, context); - printf("Test 4: OK\n"); +static void nomessage_pollset(CuTest *tc) +{ + apr_status_t rv; + int lrv; + const apr_pollfd_t *descs = NULL; + + rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + CuAssertIntEquals(tc, 0, lrv); + CuAssertPtrEquals(tc, NULL, descs); +} + +static void send0_pollset(CuTest *tc) +{ + apr_status_t rv; + const apr_pollfd_t *descs = NULL; + int num; + + send_msg(s, sa, 0, tc); + rv = apr_pollset_poll(pollset, 0, &num, &descs); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 1, num); + CuAssertPtrNotNull(tc, descs); + + CuAssertPtrEquals(tc, s[0], descs[0].desc.s); + CuAssertPtrEquals(tc, s[0], descs[0].client_data); +} + +static void recv0_pollset(CuTest *tc) +{ + apr_status_t rv; + int lrv; + const apr_pollfd_t *descs = NULL; + + recv_msg(s, 0, p, tc); + rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + CuAssertIntEquals(tc, 0, lrv); + CuAssertPtrEquals(tc, NULL, descs); +} + +static void send_middle_pollset(CuTest *tc) +{ + apr_status_t rv; + const apr_pollfd_t *descs = NULL; + int num; + + send_msg(s, sa, 2, tc); + send_msg(s, sa, 5, tc); + rv = apr_pollset_poll(pollset, 0, &num, &descs); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 2, num); + CuAssertPtrNotNull(tc, descs); + + CuAssert(tc, "Incorrect socket in result set", + ((descs[0].desc.s == s[2]) && (descs[1].desc.s == s[5])) || + ((descs[0].desc.s == s[5]) && (descs[1].desc.s == s[2]))); +} + +static void clear_middle_pollset(CuTest *tc) +{ + apr_status_t rv; + int lrv; + const apr_pollfd_t *descs = NULL; + + recv_msg(s, 2, p, tc); + recv_msg(s, 5, p, tc); + + rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + CuAssertIntEquals(tc, 0, lrv); + CuAssertPtrEquals(tc, NULL, descs); +} + +static void send_last_pollset(CuTest *tc) +{ + apr_status_t rv; + const apr_pollfd_t *descs = NULL; + int num; + + send_msg(s, sa, LARGE_NUM_SOCKETS - 1, tc); + rv = apr_pollset_poll(pollset, 0, &num, &descs); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 1, num); + CuAssertPtrNotNull(tc, descs); + + CuAssertPtrEquals(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].desc.s); + CuAssertPtrEquals(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].client_data); +} + +static void clear_last_pollset(CuTest *tc) +{ + apr_status_t rv; + int lrv; + const apr_pollfd_t *descs = NULL; + + recv_msg(s, LARGE_NUM_SOCKETS - 1, p, tc); - printf("\nTests completed.\n"); + rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + CuAssertIntEquals(tc, 0, lrv); + CuAssertPtrEquals(tc, NULL, descs); +} + +static void close_all_sockets(CuTest *tc) +{ + apr_status_t rv; + int i; - printf("\tClosing sockets........................"); for (i = 0; i < LARGE_NUM_SOCKETS; i++){ - if (apr_socket_close(s[i]) != APR_SUCCESS){ - printf("Failed!\n"); - exit(-1); - } + rv = apr_socket_close(s[i]); + CuAssertIntEquals(tc, APR_SUCCESS, rv); } - printf ("OK\n"); +} + +CuSuite *testpoll(void) +{ + CuSuite *suite = CuSuiteNew("Poll"); - return 0; + SUITE_ADD_TEST(suite, create_all_sockets); + SUITE_ADD_TEST(suite, setup_small_poll); + SUITE_ADD_TEST(suite, setup_large_poll); + SUITE_ADD_TEST(suite, nomessage); + SUITE_ADD_TEST(suite, send_2); + SUITE_ADD_TEST(suite, recv_2_send_1); + SUITE_ADD_TEST(suite, send_2_signaled_1); + SUITE_ADD_TEST(suite, recv_1_send_0); + SUITE_ADD_TEST(suite, clear_all_signalled); + SUITE_ADD_TEST(suite, send_large_pollarray); + SUITE_ADD_TEST(suite, recv_large_pollarray); + + SUITE_ADD_TEST(suite, setup_pollset); + SUITE_ADD_TEST(suite, add_sockets_pollset); + SUITE_ADD_TEST(suite, nomessage_pollset); + SUITE_ADD_TEST(suite, send0_pollset); + SUITE_ADD_TEST(suite, recv0_pollset); + SUITE_ADD_TEST(suite, send_middle_pollset); + SUITE_ADD_TEST(suite, clear_middle_pollset); + SUITE_ADD_TEST(suite, send_last_pollset); + SUITE_ADD_TEST(suite, clear_last_pollset); + + SUITE_ADD_TEST(suite, close_all_sockets); + + return suite; } + From 2726fb98e90c88717eee57a946e3c965636e9aca Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 27 Nov 2002 05:42:25 +0000 Subject: [PATCH 4077/7878] Ignore proc_child git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64096 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/.cvsignore b/test/.cvsignore index 17b971c1418..30f84375858 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -70,3 +70,4 @@ testregex testmutexscope testtable testall +proc_child From 92fc4b9e37c982cba72ce2083f395b0295baf606 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 27 Nov 2002 07:54:30 +0000 Subject: [PATCH 4078/7878] Flatten conditionals; define LIB_NAME{,2} correctly on HP-UX. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64097 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/test/testdso.c b/test/testdso.c index 99bf00d6e83..ef1d4e4138f 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -66,18 +66,17 @@ #ifdef NETWARE # define LIB_NAME "mod_test.nlm" -#else -# ifdef BEOS -# define LIB_NAME "mod_test.so" -# else -# ifdef DARWIN -# define LIB_NAME ".libs/mod_test.so" -# define LIB_NAME2 ".libs/libmod_test.dylib" -# else -# define LIB_NAME ".libs/mod_test.so" -# define LIB_NAME2 ".libs/libmod_test.so" -# endif -# endif +#elif defined(BEOS) +# define LIB_NAME "mod_test.so" +#elif defined(DARWIN) +# define LIB_NAME ".libs/mod_test.so" +# define LIB_NAME2 ".libs/libmod_test.dylib" +#elif defined(__hpux__) +# define LIB_NAME ".libs/mod_test.sl" +# define LIB_NAME2 ".libs/libmod_test.sl" +#else /* Every other Unix */ +# define LIB_NAME ".libs/mod_test.so" +# define LIB_NAME2 ".libs/libmod_test.so" #endif static char *filename; From 46208fc4eb3d0de4d5ab93d1b27367a76522741a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 27 Nov 2002 11:54:50 +0000 Subject: [PATCH 4079/7878] Ensure that strings passed to strcmp() are NUL-terminated. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64098 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testfile.c b/test/testfile.c index dab8a7d5a13..29f85d389f6 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -123,7 +123,7 @@ static void test_read(CuTest *tc) { apr_status_t rv; apr_size_t nbytes = 256; - char *str = apr_palloc(p, nbytes + 1); + char *str = apr_pcalloc(p, nbytes + 1); rv = apr_file_read(filetest, str, &nbytes); CuAssertIntEquals(tc, APR_SUCCESS, rv); @@ -215,7 +215,7 @@ static void test_seek(CuTest *tc) apr_status_t rv; apr_off_t offset = 5; apr_size_t nbytes = 256; - char *str = apr_palloc(p, nbytes + 1); + char *str = apr_pcalloc(p, nbytes + 1); rv = apr_file_seek(filetest, SEEK_SET, &offset); CuAssertIntEquals(tc, APR_SUCCESS, rv); From 62e79ff5daa8fac4b92d3fe3aa98ab487922a4ae Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 27 Nov 2002 12:30:18 +0000 Subject: [PATCH 4080/7878] Fix to not assume input is NUL-terminated. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64099 13f79535-47bb-0310-9956-ffa450edef68 --- test/proc_child.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/proc_child.c b/test/proc_child.c index 9b3fd1cf25f..b3b6ddb931f 100644 --- a/test/proc_child.c +++ b/test/proc_child.c @@ -8,9 +8,11 @@ int main(void) { char buf[256]; - - read(STDIN_FILENO, buf, 256); - fprintf(stdout, "%s", buf); + ssize_t bytes; + + bytes = read(STDIN_FILENO, buf, 256); + if (bytes > 0) + write(STDOUT_FILENO, buf, bytes); return 0; /* just to keep the compiler happy */ } From bda0b2fff8cb544f63e470609fdfe2d844c0b880 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 27 Nov 2002 17:56:11 +0000 Subject: [PATCH 4081/7878] Fix for VPATH builds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64100 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 1ee31bc2969..2b319284cee 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -67,8 +67,8 @@ proc_child@EXEEXT@: proc_child.lo $(LOCAL_LIBS) $(LINK) proc_child.lo $(LOCAL_LIBS) $(ALL_LIBS) # FIXME: -prefer-pic is only supported with libtool-1.4+ -mod_test.slo: mod_test.c - $(LIBTOOL) --mode=compile $(COMPILE) -prefer-pic -c mod_test.c && touch $@ +mod_test.slo: $(srcdir)/mod_test.c + $(LIBTOOL) --mode=compile $(COMPILE) -prefer-pic -c $(srcdir)/mod_test.c && touch $@ mod_test.la: mod_test.slo $(LOCAL_LIBS) $(LINK) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ From be3919ab5a1ab0fce2dbdedd404c10be060cbcbc Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 27 Nov 2002 18:01:17 +0000 Subject: [PATCH 4082/7878] Move list of test modules into a TESTS variable to stop duplicating it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64101 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 2b319284cee..62d33c7f9ec 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -133,17 +133,15 @@ testatomic@EXEEXT@: testatomic.lo $(LOCAL_LIBS) testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) $(LINK) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) -testall: testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ - testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ - testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ - testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ - testpoll.lo CuTest.lo mod_test.la libmod_test.la occhild@EXEEXT@ \ - proc_child@EXEEXT@ $(LOCAL_LIBS) - $(LINK) testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ - testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ - testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ - testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ - testpoll.lo CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) +TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ + testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ + testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ + testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ + testpoll.lo + +testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ + CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) + $(LINK) $(TESTS) CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE From 416221ae759e4b8011206785a37cec78f7642ab9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 27 Nov 2002 18:03:46 +0000 Subject: [PATCH 4083/7878] testdir has been CuTestified. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64102 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 62d33c7f9ec..582b0e92a2d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -51,9 +51,6 @@ check: $(PROGRAMS) $(NONPORTABLE) fi \ done -testdir@EXEEXT@: testdir.lo $(LOCAL_LIBS) - $(LINK) testdir.lo $(LOCAL_LIBS) $(ALL_LIBS) - testnames@EXEEXT@: testnames.lo $(LOCAL_LIBS) $(LINK) testnames.lo $(LOCAL_LIBS) $(ALL_LIBS) From cc07e965c8a4b5f051b05f837c3160ce12c8540b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 28 Nov 2002 08:35:26 +0000 Subject: [PATCH 4084/7878] Ensure that buffers passed to strcmp are NUL-terminated. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64103 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testpoll.c b/test/testpoll.c index 5757597e274..2b917eab041 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -121,7 +121,7 @@ static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p, CuTest *tc) { apr_size_t buflen = 5; - char *buffer = apr_pcalloc(p, sizeof(char) * buflen); + char *buffer = apr_pcalloc(p, sizeof(char) * (buflen + 1)); apr_sockaddr_t *recsa; apr_status_t rv; From b9110aa81d259f788a76593b7e5e574929c7c531 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 28 Nov 2002 09:04:58 +0000 Subject: [PATCH 4085/7878] Document some gotchas. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64104 13f79535-47bb-0310-9956-ffa450edef68 --- test/README | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/README b/test/README index ec1028d342b..42ecdd47cb5 100644 --- a/test/README +++ b/test/README @@ -59,6 +59,23 @@ To run it, run: ./testall +Caveats +------- + +Currently, some tests are known to fail in certain circumstances: + + * 'testpoll' opens 64 sockets concurrently; ensure that resource +limits are high enough to allow this (using ulimit or limit); for +instance, Solaris <=2.7 and HP-UX 11.00 both set the limit to <=64 by +default + + * 'testipsub' will tickle the Solaris 8 getaddrinfo() IPv6 +bug, causing the test to hang. Configure with --disable-ipv6 if using +an unpatched Solaris 8 installation. + + * The 'testdso' tests will not work if configured with +--disable-shared since the loadable modules cannot be built. + Running individual tests --------------------------------- From 63273a407eb0c8610ac8a25366094a1ff191e2cf Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 28 Nov 2002 11:17:10 +0000 Subject: [PATCH 4086/7878] Detabify. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64105 13f79535-47bb-0310-9956-ffa450edef68 --- test/proc_child.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/proc_child.c b/test/proc_child.c index b3b6ddb931f..a4c16ebf373 100644 --- a/test/proc_child.c +++ b/test/proc_child.c @@ -12,7 +12,7 @@ int main(void) bytes = read(STDIN_FILENO, buf, 256); if (bytes > 0) - write(STDOUT_FILENO, buf, bytes); + write(STDOUT_FILENO, buf, bytes); return 0; /* just to keep the compiler happy */ } From 8bd75a1fc0894d7c49eb9cb07e9f255200650847 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 30 Nov 2002 06:05:07 +0000 Subject: [PATCH 4087/7878] Fix the clean targets for the test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64106 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 3 ++- test/internal/Makefile.in | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 582b0e92a2d..165a64aa115 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -35,7 +35,8 @@ TARGETS = $(PROGRAMS) $(NONPORTABLE) LOCAL_LIBS=../lib@APR_LIBNAME@.la -CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ +CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \ + testprocmutex@EXEEXT@ testglobalmutex@EXEEXT@ testshm@EXEEXT@ INCDIR=../include INCLUDES=-I$(INCDIR) diff --git a/test/internal/Makefile.in b/test/internal/Makefile.in index 2ace52c7e4d..b1f6c6a6c43 100644 --- a/test/internal/Makefile.in +++ b/test/internal/Makefile.in @@ -13,7 +13,7 @@ TARGETS = $(PROGRAMS) $(NONPORTABLE) LOCAL_LIBS=../../lib@APR_LIBNAME@.la -CLEAN_TARGETS = testfile.tmp testdso@EXEEXT@ mod_test.slo +CLEAN_TARGETS = testregex@EXEEXT@ INCDIR=../../include INCLUDES=-I$(INCDIR) From 84efbc8ad208680f785e48088ff8e4da0b9ea342 Mon Sep 17 00:00:00 2001 From: Thom May Date: Sat, 30 Nov 2002 16:34:41 +0000 Subject: [PATCH 4088/7878] Limit the renames performed in apr_rename.pl to the newest ones only. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64107 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + helpers/apr_rename.pl | 234 ------------------------------------------ 2 files changed, 2 insertions(+), 234 deletions(-) diff --git a/CHANGES b/CHANGES index 9af68a45341..d33aed85434 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ Changes with APR 0.9.2 + *) limit the renames performed in apr_rename.pl to the most recent renames. + [Thom May] *) Changed apr_mmap_dup() and friends so that there's no longer any is_owner concept on the mmaped region, but rather something more diff --git a/helpers/apr_rename.pl b/helpers/apr_rename.pl index 642ea820799..25b9d52d4c0 100755 --- a/helpers/apr_rename.pl +++ b/helpers/apr_rename.pl @@ -66,27 +66,9 @@ sub replace { } __DATA__ -apr_pollfd_t: -apr_add_poll_socket apr_poll_socket_add -apr_clear_poll_sockets apr_poll_socket_clear -apr_get_polldata apr_poll_data_get -apr_get_revents apr_poll_revents_get -apr_mask_poll_socket apr_poll_socket_mask -apr_remove_poll_socket apr_poll_socket_remove -apr_set_polldata apr_poll_data_set -apr_setup_poll apr_poll_setup - apr_time_t: -apr_now apr_time_now apr_implode_gmt apr_time_exp_gmt_get -apr_array_header_t: -apr_append_arrays apr_array_append -apr_copy_array apr_array_copy -apr_copy_array_hdr apr_array_copy_hdr -apr_make_array apr_array_make -apr_push_array apr_array_push - apr_socket_t: apr_close_socket apr_socket_close apr_create_socket apr_socket_create @@ -105,145 +87,15 @@ sub replace { apr_sendfile apr_socket_sendfile apr_recv apr_socket_recv - - -apr_sockaddr_t: -apr_getaddrinfo apr_sockaddr_info_get -apr_get_ipaddr apr_sockaddr_ip_get -apr_set_ipaddr apr_sockaddr_ip_set -apr_set_port apr_sockaddr_port_set -apr_get_port apr_sockaddr_port_get - -apr_pool_t: -apr_create_pool apr_pool_create -apr_destroy_pool apr_pool_destroy -apr_get_userdata apr_pool_userdata_get -apr_set_userdata apr_pool_userdata_set -apr_kill_cleanup apr_pool_cleanup_kill -apr_run_cleanup apr_pool_cleanup_run -apr_null_cleanup apr_pool_cleanup_null -apr_register_cleanup apr_pool_cleanup_register -apr_make_sub_pool apr_pool_sub_make -apr_note_subprocess apr_pool_note_subprocess -apr_bytes_in_pool apr_pool_num_bytes -apr_bytes_in_free_blocks apr_pool_free_blocks_num_bytes -apr_cleanup_for_exec apr_pool_cleanup_for_exec -apr_init_alloc apr_pool_alloc_init -apr_term_alloc apr_pool_alloc_term - -apr_lock_t: -apr_child_init_lock apr_lock_child_init -apr_create_lock apr_lock_create -apr_destroy_lock apr_lock_destroy -apr_get_lockdata apr_lock_data_get -apr_set_lockdata apr_lock_data_set -apr_lock apr_lock_aquire -apr_unlock apr_lock_release - -apr_table_: -apr_clear_table apr_table_clear -apr_copy_table apr_table_copy -apr_make_table apr_table_make -apr_overlap_tables apr_table_overlap -apr_overlay_tables apr_table_overlay - -apr_file_t: -apr_open apr_file_open -apr_close apr_file_close -apr_create_namedpipe apr_file_namedpipe_create -apr_create_pipe apr_file_pipe_create -apr_dupfile apr_file_dup -apr_flush apr_file_flush -apr_eof apr_file_eof -apr_ferror apr_file_error -apr_fgets apr_file_gets -apr_fprintf apr_file_printf -apr_full_read apr_file_read_file -apr_full_write apr_file_write_full -apr_getc apr_file_getc -apr_ungetc apr_file_ungetc -apr_putc apr_file_putc -apr_puts apr_file_puts -apr_read apr_file_read -apr_write apr_file_write -apr_writev apr_file_writev -apr_seek apr_file_seek -apr_get_filedata apr_file_data_get -apr_getfileinfo apr_file_info_get -apr_get_filename apr_file_name_get -apr_get_file_pool apr_file_pool_get -apr_get_pipe_timeout apr_file_pipe_timeout_get -apr_set_pipe_timeout apr_file_pipe_timeout_set -apr_lock_file apr_file_lock -apr_unlock_file apr_file_unlock -apr_open_stderr apr_file_open_stderr -apr_open_stdout apr_file_open_stdout -apr_remove_file apr_file_remove -apr_rename_file apr_file_rename -apr_set_filedata apr_file_data_set -apr_setfileperms apr_file_perms_set - apr_filepath_*: apr_filename_of_pathname apr_filepath_name_get -apr_procattr_t: -apr_createprocattr_init apr_procattr_create -apr_setprocattr_childerr apr_procattr_child_err_set -apr_setprocattr_childin apr_procattr_child_in_set -apr_setprocattr_childout apr_procattr_child_out_set -apr_setprocattr_cmdtype apr_procattr_cmdtype_set -apr_setprocattr_detach apr_procattr_detach_set -apr_setprocattr_dir apr_procattr_dir_set -apr_setprocattr_io apr_procattr_io_set -apr_setprocattr_limit apr_procattr_limit_set - -apr_proc_t: -apr_create_process apr_proc_create -apr_fork apr_proc_fork -apr_kill apr_proc_kill -apr_probe_writable_fds apr_proc_probe_writable_fds -apr_reap_other_child apr_proc_other_child_read -apr_register_other_child apr_proc_other_child_register -apr_unregister_other_child apr_proc_other_child_unregister -apr_check_other_child apr_proc_other_child_check -apr_wait_all_procs apr_proc_wait_all_procs -apr_wait_proc apr_proc_wait -apr_detach apr_proc_detach - -apr_thread_t: -apr_create_thread apr_thread_create -apr_get_threaddata apr_thread_data_get -apr_set_threaddata apr_thread_data_set -apr_thread_detach apr_thread_detach - -apr_threadkey_t: -apr_get_threadkeydata apr_threadkey_data_get -apr_set_threadkeydata apr_threadkey_data_set -apr_create_thread_private apr_threadkey_private_create -apr_delete_thread_private apr_threadkey_private_delete -apr_get_thread_private apr_threadkey_private_get -apr_set_thread_private apr_threadkey_private_set - -apr_threadatt_t: -apr_create_threadattr apr_threadattr_create -apr_getthreadattr_detach apr_threadattr_detach_set -apr_setthreadattr_detach apr_threadattr_detach_get - -apr_dir_t: -apr_make_dir apr_dir_make -apr_remove_dir apr_dir_remove - apr_gid_t: apr_get_groupid apr_gid_get apr_get_groupname apr_gid_name_get apr_group_name_get apr_gid_name_get apr_compare_groups apr_gid_compare -apr_uuid_t: -apr_format_uuid apr_uuid_format -apr_get_uuid apr_uuid_get -apr_parse_uuid apr_uuid_parse - apr_uid_t: apr_get_home_directory apr_uid_homepath_get apr_get_userid apr_uid_get @@ -252,89 +104,3 @@ sub replace { apr_get_username apr_uid_name_get apr_compare_users apr_uid_compare -apr_shmem_t: -apr_get_shm_name apr_shm_name_get -apr_set_shm_name apr_shm_name_set -apr_open_shmem apr_shm_open - -apr_hash_t: -apr_make_hash apr_hash_make -apr_getpass apr_password_get -apr_validate_password apr_password_validate -apr_generic_hook_get apr_hook_generic_get -apr_hook_generic apr_hook_generic_add - -apr_bucket_*: -apr_bucket_copy_notimpl apr_bucket_notimpl_copy -apr_bucket_copy_shared apr_bucket_shared_copy -apr_bucket_create_eos apr_bucket_eos_create -apr_bucket_create_file apr_bucket_file_create -apr_bucket_create_flush apr_bucket_flush_create -apr_bucket_create_heap apr_bucket_heap_create -apr_bucket_create_immortal apr_bucket_immortal_create -apr_bucket_create_mmap apr_bucket_mmap_create -apr_bucket_create_pipe apr_bucket_pipe_creat -apr_bucket_create_pool apr_bucket_pool_create -apr_bucket_create_socket apr_bucket_socket_create -apr_bucket_create_transient apr_bucket_transient_create -apr_bucket_destroy_notimpl apr_bucket_notimpl_destroy -apr_bucket_destroy_shared apr_bucket_shared_destroy -apr_bucket_make_eos apr_bucket_eos_make -apr_bucket_make_file apr_bucket_file_make -apr_bucket_make_flush apr_bucket_flush_make -apr_bucket_make_heap apr_bucket_heap_make -apr_bucket_make_immortal apr_bucket_immortal_make -apr_bucket_make_mmap apr_bucket_mmap_make -apr_bucket_make_pipe apr_bucket_pipe_make -apr_bucket_make_pool apr_bucket_pool_make -apr_bucket_make_shared apr_bucket_shared_make -apr_bucket_make_socket apr_bucket_socket_make -apr_bucket_make_transient apr_bucket_transient_make -apr_bucket_setaside_notimpl apr_bucket_notimpl_setaside -apr_bucket_split_notimpl apr_bucket_notimpl_split -apr_bucket_split_shared apr_bucket_shared_split -apr_init_bucket_types apr_bucket_init_types -apr_insert_bucket_type apr_bucket_insert_type - -apr_os_*: -apr_get_os_dir apr_os_dir_get -apr_get_os_exp_time apr_os_exp_time_get -apr_get_os_file apr_os_file_get -apr_get_os_imp_time apr_os_imp_time_get -apr_get_os_lock apr_os_lock_get -apr_get_os_sock apr_os_sock_get -apr_get_os_thread apr_os_thread_get -apr_get_os_threadkey apr_os_threadkey_get -apr_make_os_sock apr_os_sock_make -apr_put_os_dir apr_os_dir_put -apr_put_os_exp_time apr_os_exp_time_put -apr_put_os_file apr_os_file_put -apr_put_os_imp_time apr_os_imp_time_put -apr_put_os_lock apr_os_lock_put -apr_put_os_sock apr_os_sock_put -apr_put_os_thread apr_os_thread_put -apr_put_os_threadkey apr_os_threadkey_put - -apr_md5_ctx_t: -apr_MD5Encode apr_md5_encode -apr_MD5Final apr_md5_final -apr_MD5Init apr_md5_init -apr_MD5SetXlate apr_md5_set_xlate -apr_MD5Update apr_md5_update - -apr_sha1_ctx_t: -apr_SHA1Final apr_sha1_final -apr_SHA1Init apr_sha1_init -apr_SHA1Update apr_sha1_update -apr_SHA1Update_binary apr_sha1_update_binary - -apr_getopt_t: -apr_initopt apr_getopt_init - -apr_base64_*: -apr_base64decode apr_base64_decode -apr_base64decode_binary apr_base64_decode_binary -apr_base64decode_len apr_base64_decode_len -apr_base64encode apr_base64_encode -apr_base64encode_binary apr_base64_encode_binary -apr_base64encode_len apr_base64_encode_len From fe11d15ff2395871422f4e61540cf012fc9f2f56 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 1 Dec 2002 01:51:02 +0000 Subject: [PATCH 4089/7878] Ignore both the test and the include/arch directory. Those are internal header files, and don't need to be doc'ed in the API docs. This removes some doxygen error messages. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64108 13f79535-47bb-0310-9956-ffa450edef68 --- docs/doxygen.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/doxygen.conf b/docs/doxygen.conf index b741a1abad7..36b623264a6 100644 --- a/docs/doxygen.conf +++ b/docs/doxygen.conf @@ -21,3 +21,6 @@ OPTIMIZE_OUTPUT_FOR_C=YES FULL_PATH_NAMES=YES # some autoconf guru needs to make configure set this correctly... STRIP_FROM_PATH=/home/rbb/httpd-2.0/srclib/apr + +EXCLUDE_PATTERNS="*/test/*" \ + "*/arch/*" From ba4d19f07cca13d46a77db0e2b07bc5a512bf327 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 1 Dec 2002 04:32:26 +0000 Subject: [PATCH 4090/7878] Fix the docs for apr_bind. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64109 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index cd4ff258511..dcd560dab77 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -345,7 +345,7 @@ APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket); APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, apr_sockaddr_t *sa); -/* @deprecated @see apr_socket_bind */ +/** @deprecated @see apr_socket_bind */ APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa); /** From 3abc884936210e5c07bfb484a0108b2b5ce2bcd6 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 2 Dec 2002 16:07:09 +0000 Subject: [PATCH 4091/7878] Fix selection of random device on OpenBSD; prefer /dev/arandom over /dev/random, since the latter does not provide random data on OpenBSD. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64110 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index f287aca7e0f..2e6562005ea 100644 --- a/configure.in +++ b/configure.in @@ -1628,7 +1628,9 @@ if test "$rand" != "1"; then [ apr_devrandom="$withval" ], [ apr_devrandom="yes" ]) if test "$apr_devrandom" = "yes"; then - for f in /dev/random /dev/arandom /dev/urandom; do + # /dev/random on OpenBSD doesn't provide random data, so + # prefer /dev/arandom, which does; see random(4). + for f in /dev/arandom /dev/random /dev/urandom; do if test -r $f; then apr_devrandom=$f rand=1 From 4a25fc26dbb18f34f751854b66c89f987d8ff835 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 2 Dec 2002 21:16:45 +0000 Subject: [PATCH 4092/7878] Moving the application global data management structure to APR.hnw to give it a wider scope. This needs to be done to handle the per-application global data in the apr_util hook APIs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64111 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 21 ++++++++++++++++++--- include/arch/netware/apr_private.h | 4 ---- misc/netware/libprews.c | 10 +++------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index 6e3d456232a..76d95f2d129 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -344,9 +344,24 @@ typedef int apr_wait_t; #define APR_TIME_T_FMT APR_INT64_T_FMT /* Deal with atoi64 variables ... these should move to apr_private.h */ -/* I don't have the answer, perhaps a NetWare hacker will fill this in? */ -#define APR_HAVE_INT64_STRFN 0 -#define APR_INT64_STRFN missing +#define APR_HAVE_INT64_STRFN 1 +#define APR_INT64_STRFN strtoll + +/* Application global data management */ +extern int gLibId; +extern void *gLibHandle; + +#define MAX_PROCESSORS 128 + +typedef struct app_data { + int initialized; + void* gPool[MAX_PROCESSORS]; + void* statCache[MAX_PROCESSORS]; + void* gs_aHooksToSort; + void* gs_phOptionalHooks; + void* gs_phOptionalFunctions; +} APP_DATA; + #endif /* APR_H */ /** @} */ diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index da924107b69..08063506cd0 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -160,10 +160,6 @@ typedef void (Sigfunc)(int); void netware_pool_proc_cleanup (); -// library-private data... -extern int gLibId; -extern void *gLibHandle; - /* NLM registration routines for managing which NLMs are using the library. */ int register_NLM(void *NLMHandle); diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index 192efa519ba..0818babbb06 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -15,13 +15,6 @@ #include "apr_pools.h" -#define MAX_PROCESSORS 128 - -typedef struct app_data { - int initialized; - void* gPool[MAX_PROCESSORS]; - void* statCache[MAX_PROCESSORS]; -} APP_DATA; /* library-private data...*/ int gLibId = -1; @@ -216,3 +209,6 @@ void* getStatCache(int proc) return NULL; } + + + From afd8877b85aa1a139d526d07978c3986d09a199f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 2 Dec 2002 23:17:47 +0000 Subject: [PATCH 4093/7878] Studying the sizes [in debug mode] consumed by libapr.dll and family, this is the beginning of a bit of trimming for a reasonable size. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64112 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libapr.dsp b/libapr.dsp index 07845a8bff4..7a7e3bce8ca 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -52,8 +52,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF !ELSEIF "$(CFG)" == "libapr - Win32 Debug" @@ -78,8 +78,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EE00000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF !ENDIF From 03bbd56c02c79964a53b7df56569551490423f98 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 3 Dec 2002 05:03:21 +0000 Subject: [PATCH 4094/7878] Migrate testlock to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64113 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 5 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testlock.c | 347 +++++++++++++---------------------------------- 4 files changed, 100 insertions(+), 254 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 165a64aa115..e520bb74479 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -80,9 +80,6 @@ testargs@EXEEXT@: testargs.lo $(LOCAL_LIBS) testthread@EXEEXT@: testthread.lo $(LOCAL_LIBS) $(LINK) testthread.lo $(LOCAL_LIBS) $(ALL_LIBS) -testlock@EXEEXT@: testlock.lo $(LOCAL_LIBS) - $(LINK) testlock.lo $(LOCAL_LIBS) $(ALL_LIBS) - testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS) $(LINK) testlockperf.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -135,7 +132,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ - testpoll.lo + testpoll.lo testlock.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/test_apr.h b/test/test_apr.h index c5e166dcc84..0e8701155a8 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -86,5 +86,6 @@ CuSuite *testdup(void); CuSuite *testsockets(void); CuSuite *testproc(void); CuSuite *testpoll(void); +CuSuite *testlock(void); #endif /* APR_TEST_INCLUDES */ diff --git a/test/testall.c b/test/testall.c index 0b16574a9b2..260b7dd79ae 100644 --- a/test/testall.c +++ b/test/testall.c @@ -84,6 +84,7 @@ static const struct testlist { {"testsockets", testsockets}, {"testproc", testproc}, {"testpoll", testpoll}, + {"testlock", testlock}, {"LastTest", NULL} }; diff --git a/test/testlock.c b/test/testlock.c index d0996890dd1..0a3c92f1945 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -60,40 +60,25 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_getopt.h" -#include "errno.h" -#include -#include #include "test_apr.h" -#if !APR_HAS_THREADS -int main(void) -{ - printf("This program won't work on this platform because there is no " - "support for threads.\n"); - return 0; -} -#else /* !APR_HAS_THREADS */ +#if APR_HAS_THREADS #define MAX_ITER 40000 #define MAX_COUNTER 100000 #define MAX_RETRY 5 -void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data); -void * APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data); -void * APR_THREAD_FUNC thread_cond_producer(apr_thread_t *thd, void *data); -void * APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data); -apr_status_t test_thread_mutex(void); -apr_status_t test_thread_rwlock(void); -apr_status_t test_cond(void); -apr_status_t test_timeoutcond(void); - -apr_file_t *in, *out, *err; -apr_thread_mutex_t *thread_mutex; -apr_thread_rwlock_t *rwlock; -apr_pool_t *pool; -int i = 0, x = 0; - -int buff[MAX_COUNTER]; +static void *APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data); +static void *APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data); +static void *APR_THREAD_FUNC thread_cond_producer(apr_thread_t *thd, void *data); +static void *APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data); + +static apr_thread_mutex_t *thread_mutex; +static apr_thread_rwlock_t *rwlock; +static int i = 0, x = 0; + +static int buff[MAX_COUNTER]; + struct { apr_thread_mutex_t *mutex; int nput; @@ -106,10 +91,10 @@ struct { int nready; } nready; -apr_thread_mutex_t *timeout_mutex; -apr_thread_cond_t *timeout_cond; +static apr_thread_mutex_t *timeout_mutex; +static apr_thread_cond_t *timeout_cond; -void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data) +static void *APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data) { int exitLoop = 1; @@ -134,7 +119,7 @@ void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data) return NULL; } -void * APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data) +static void *APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data) { int exitLoop = 1; @@ -159,7 +144,7 @@ void * APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data) return NULL; } -void * APR_THREAD_FUNC thread_cond_producer(apr_thread_t *thd, void *data) +static void *APR_THREAD_FUNC thread_cond_producer(apr_thread_t *thd, void *data) { for (;;) { apr_thread_mutex_lock(put.mutex); @@ -184,7 +169,7 @@ void * APR_THREAD_FUNC thread_cond_producer(apr_thread_t *thd, void *data) return NULL; } -void * APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data) +static void *APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data) { int i; @@ -202,132 +187,82 @@ void * APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data) return NULL; } -apr_status_t test_thread_mutex(void) +static void test_thread_mutex(CuTest *tc) { apr_thread_t *t1, *t2, *t3, *t4; apr_status_t s1, s2, s3, s4; - printf("thread_mutex test\n"); - printf("%-60s", " Initializing the mutex"); - s1 = apr_thread_mutex_create(&thread_mutex, APR_THREAD_MUTEX_DEFAULT, pool); - - if (s1 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); + s1 = apr_thread_mutex_create(&thread_mutex, APR_THREAD_MUTEX_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, s1); + CuAssertPtrNotNull(tc, thread_mutex); i = 0; x = 0; - printf("%-60s", " Starting all the threads"); - s1 = apr_thread_create(&t1, NULL, thread_mutex_function, NULL, pool); - s2 = apr_thread_create(&t2, NULL, thread_mutex_function, NULL, pool); - s3 = apr_thread_create(&t3, NULL, thread_mutex_function, NULL, pool); - s4 = apr_thread_create(&t4, NULL, thread_mutex_function, NULL, pool); - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || - s3 != APR_SUCCESS || s4 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); + s1 = apr_thread_create(&t1, NULL, thread_mutex_function, NULL, p); + CuAssertIntEquals(tc, APR_SUCCESS, s1); + s2 = apr_thread_create(&t2, NULL, thread_mutex_function, NULL, p); + CuAssertIntEquals(tc, APR_SUCCESS, s2); + s3 = apr_thread_create(&t3, NULL, thread_mutex_function, NULL, p); + CuAssertIntEquals(tc, APR_SUCCESS, s3); + s4 = apr_thread_create(&t4, NULL, thread_mutex_function, NULL, p); + CuAssertIntEquals(tc, APR_SUCCESS, s4); - printf("%-60s", " Waiting for threads to exit"); apr_thread_join(&s1, t1); apr_thread_join(&s2, t2); apr_thread_join(&s3, t3); apr_thread_join(&s4, t4); - printf("OK\n"); - if (x != MAX_ITER) { - fprintf(stderr, "pthread_mutex don't appear to work!" - " x = %d instead of %d\n", - x, MAX_ITER); - } - else { - printf("Test passed\n"); - } - return APR_SUCCESS; + CuAssertIntEquals(tc, MAX_ITER, x); } -apr_status_t test_thread_rwlock(void) +static void test_thread_rwlock(CuTest *tc) { apr_thread_t *t1, *t2, *t3, *t4; apr_status_t s1, s2, s3, s4; - printf("thread_rwlock Tests\n"); - printf("%-60s", " Initializing the apr_thread_rwlock_t"); - s1 = apr_thread_rwlock_create(&rwlock, pool); - if (s1 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); + s1 = apr_thread_rwlock_create(&rwlock, p); + CuAssertIntEquals(tc, APR_SUCCESS, s1); + CuAssertPtrNotNull(tc, rwlock); i = 0; x = 0; - printf("%-60s"," Starting all the threads"); - s1 = apr_thread_create(&t1, NULL, thread_rwlock_func, NULL, pool); - s2 = apr_thread_create(&t2, NULL, thread_rwlock_func, NULL, pool); - s3 = apr_thread_create(&t3, NULL, thread_rwlock_func, NULL, pool); - s4 = apr_thread_create(&t4, NULL, thread_rwlock_func, NULL, pool); - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || - s3 != APR_SUCCESS || s4 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); + s1 = apr_thread_create(&t1, NULL, thread_rwlock_func, NULL, p); + CuAssertIntEquals(tc, APR_SUCCESS, s1); + s2 = apr_thread_create(&t2, NULL, thread_rwlock_func, NULL, p); + CuAssertIntEquals(tc, APR_SUCCESS, s2); + s3 = apr_thread_create(&t3, NULL, thread_rwlock_func, NULL, p); + CuAssertIntEquals(tc, APR_SUCCESS, s3); + s4 = apr_thread_create(&t4, NULL, thread_rwlock_func, NULL, p); + CuAssertIntEquals(tc, APR_SUCCESS, s4); - printf("%-60s", " Waiting for threads to exit"); apr_thread_join(&s1, t1); apr_thread_join(&s2, t2); apr_thread_join(&s3, t3); apr_thread_join(&s4, t4); - printf("OK\n"); - if (x != MAX_ITER) { - fprintf(stderr, "thread_rwlock didn't work as expected. x = %d instead of %d\n", - x, MAX_ITER); - } - else { - printf("Test passed\n"); - } - - return APR_SUCCESS; + CuAssertIntEquals(tc, MAX_ITER, x); } -apr_status_t test_cond(void) +static void test_cond(CuTest *tc) { apr_thread_t *p1, *p2, *p3, *p4, *c1; apr_status_t s0, s1, s2, s3, s4; int count1, count2, count3, count4; int sum; - printf("thread_cond Tests\n"); - printf("%-60s", " Initializing the first apr_thread_mutex_t"); - s1 = apr_thread_mutex_create(&put.mutex, APR_THREAD_MUTEX_DEFAULT, pool); - if (s1 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); + s1 = apr_thread_mutex_create(&put.mutex, APR_THREAD_MUTEX_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, s1); + CuAssertPtrNotNull(tc, put.mutex); - printf("%-60s", " Initializing the second apr_thread_mutex_t"); - s1 = apr_thread_mutex_create(&nready.mutex, APR_THREAD_MUTEX_DEFAULT, pool); - if (s1 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); + s1 = apr_thread_mutex_create(&nready.mutex, APR_THREAD_MUTEX_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, s1); + CuAssertPtrNotNull(tc, nready.mutex); - printf("%-60s", " Initializing the apr_thread_cond_t"); - s1 = apr_thread_cond_create(&nready.cond, pool); - if (s1 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); + s1 = apr_thread_cond_create(&nready.cond, p); + CuAssertIntEquals(tc, APR_SUCCESS, s1); + CuAssertPtrNotNull(tc, nready.cond); count1 = count2 = count3 = count4 = 0; put.nput = put.nval = 0; @@ -335,177 +270,89 @@ apr_status_t test_cond(void) i = 0; x = 0; - printf("%-60s"," Starting all the threads"); - s0 = apr_thread_create(&p1, NULL, thread_cond_producer, &count1, pool); - s1 = apr_thread_create(&p2, NULL, thread_cond_producer, &count2, pool); - s2 = apr_thread_create(&p3, NULL, thread_cond_producer, &count3, pool); - s3 = apr_thread_create(&p4, NULL, thread_cond_producer, &count4, pool); - s4 = apr_thread_create(&c1, NULL, thread_cond_consumer, NULL, pool); - if (s0 != APR_SUCCESS || s1 != APR_SUCCESS || s2 != APR_SUCCESS || - s3 != APR_SUCCESS || s4 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); + s0 = apr_thread_create(&p1, NULL, thread_cond_producer, &count1, p); + CuAssertIntEquals(tc, APR_SUCCESS, s0); + s1 = apr_thread_create(&p2, NULL, thread_cond_producer, &count2, p); + CuAssertIntEquals(tc, APR_SUCCESS, s1); + s2 = apr_thread_create(&p3, NULL, thread_cond_producer, &count3, p); + CuAssertIntEquals(tc, APR_SUCCESS, s2); + s3 = apr_thread_create(&p4, NULL, thread_cond_producer, &count4, p); + CuAssertIntEquals(tc, APR_SUCCESS, s3); + s4 = apr_thread_create(&c1, NULL, thread_cond_consumer, NULL, p); + CuAssertIntEquals(tc, APR_SUCCESS, s4); - printf("%-60s", " Waiting for threads to exit"); apr_thread_join(&s0, p1); apr_thread_join(&s1, p2); apr_thread_join(&s2, p3); apr_thread_join(&s3, p4); apr_thread_join(&s4, c1); - printf("OK\n"); sum = count1 + count2 + count3 + count4; /* printf("count1 = %d count2 = %d count3 = %d count4 = %d\n", count1, count2, count3, count4); */ - if (sum != MAX_COUNTER) { - fprintf(stderr, "thread_cond didn't work as expected. sum = %d, instead of %d\n", sum, MAX_COUNTER); - } - else { - printf("Test passed\n"); - } - - return APR_SUCCESS; + CuAssertIntEquals(tc, MAX_COUNTER, sum); } -apr_status_t test_timeoutcond(void) +static void test_timeoutcond(CuTest *tc) { apr_status_t s; apr_interval_time_t timeout; apr_time_t begin, end; int i; - printf("thread_cond_timedwait Tests\n"); - printf("%-60s", " Initializing the first apr_thread_mutex_t"); - s = apr_thread_mutex_create(&timeout_mutex, APR_THREAD_MUTEX_DEFAULT, pool); - if (s != APR_SUCCESS) { - printf("Failed!\n"); - return s; - } - printf("OK\n"); + s = apr_thread_mutex_create(&timeout_mutex, APR_THREAD_MUTEX_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, s); + CuAssertPtrNotNull(tc, timeout_mutex); - printf("%-60s", " Initializing the apr_thread_cond_t"); - s = apr_thread_cond_create(&timeout_cond, pool); - if (s != APR_SUCCESS) { - printf("Failed!\n"); - return s; - } - printf("OK\n"); + s = apr_thread_cond_create(&timeout_cond, p); + CuAssertIntEquals(tc, APR_SUCCESS, s); + CuAssertPtrNotNull(tc, timeout_cond); timeout = apr_time_from_sec(5); for (i = 0; i < MAX_RETRY; i++) { apr_thread_mutex_lock(timeout_mutex); - printf("%-60s"," Waiting for condition for 5 seconds"); begin = apr_time_now(); s = apr_thread_cond_timedwait(timeout_cond, timeout_mutex, timeout); end = apr_time_now(); apr_thread_mutex_unlock(timeout_mutex); - /* If we slept for more than 100ms over the timeout. */ - if (end - begin - timeout > 100000) { - if (APR_STATUS_IS_TIMEUP(s)) { - printf("Failed (late TIMEUP)!\n"); - printf(" The timer returned in %" APR_TIME_T_FMT " usec!\n", - end - begin); - return s; - } - else if (s != APR_SUCCESS) { - printf("Failed!\n"); - return s; - } - } - /* else, everything is ok */ - else if (APR_STATUS_IS_TIMEUP(s)) { - printf("OK\n"); - return APR_SUCCESS; - } - /* else, we were within the time limit, and something broke. */ - else if (s != APR_SUCCESS) { - printf("Failed! (bad timer)\n"); - return s; - } - /* else, spurious wakeup, just try again. */ - else { - printf("Spurious wakeup...retrying\n"); + if (s != APR_SUCCESS && !APR_STATUS_IS_TIMEUP(s)) { continue; } + CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(s)); + CuAssert(tc, "Timer returned too late", end - begin - timeout < 100000); + break; } - printf("Too many spurious wakeups, unable to complete test.\n"); - - return APR_EGENERAL; + CuAssert(tc, "Too many retries", i < MAX_RETRY); } -int main(int argc, const char * const *argv) -{ - apr_status_t rv; - char errmsg[200]; - const char *lockname = "multi.lock"; - apr_getopt_t *opt; - char optchar; - const char *optarg; - - printf("APR Locks Test\n==============\n\n"); - - apr_initialize(); - atexit(apr_terminate); - - if (apr_pool_create(&pool, NULL) != APR_SUCCESS) - exit(-1); - - if ((rv = apr_getopt_init(&opt, pool, argc, argv)) != APR_SUCCESS) { - fprintf(stderr, "Could not set up to parse options: [%d] %s\n", - rv, apr_strerror(rv, errmsg, sizeof errmsg)); - exit(-1); - } - - while ((rv = apr_getopt(opt, "f:", &optchar, &optarg)) == APR_SUCCESS) { - if (optchar == 'f') { - lockname = optarg; - } - } - - if (rv != APR_SUCCESS && rv != APR_EOF) { - fprintf(stderr, "Could not parse options: [%d] %s\n", - rv, apr_strerror(rv, errmsg, sizeof errmsg)); - exit(-1); - } - - if ((rv = test_thread_mutex()) != APR_SUCCESS) { - fprintf(stderr,"thread_mutex test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-5); - } +#endif /* !APR_HAS_THREADS */ - if ((rv = test_thread_rwlock()) != APR_SUCCESS) { - if (rv == APR_ENOTIMPL) { - fprintf(stderr, "read/write locks aren't implemented on this " - "platform... skipping those tests...\n"); - } - else { - fprintf(stderr,"thread_rwlock test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-6); - } - } +#if !APR_HAS_THREADS +static void threads_not_impl(CuTest *tc) +{ + CuNotImpl(tc, "Threads not implemented on this platform"); +} +#endif - if ((rv = test_cond()) != APR_SUCCESS) { - fprintf(stderr,"thread_cond test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-7); - } - if ((rv = test_timeoutcond()) != APR_SUCCESS) { - fprintf(stderr,"thread_cond_timedwait test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-8); - } +CuSuite *testlock(void) +{ + CuSuite *suite = CuSuiteNew("Thread Locks"); - return 0; +#if !APR_HAS_THREADS + SUITE_ADD_TEST(suite, threads_not_impl); +#else + SUITE_ADD_TEST(suite, test_thread_mutex); + SUITE_ADD_TEST(suite, test_thread_rwlock); + SUITE_ADD_TEST(suite, test_cond); + SUITE_ADD_TEST(suite, test_timeoutcond); +#endif + + return suite; } -#endif /* !APR_HAS_THREADS */ From 625eedb2e2c17e1d945b70df272cdc5ee102c11d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 3 Dec 2002 06:32:13 +0000 Subject: [PATCH 4095/7878] Migrate testsockopt to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64114 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testsockopt.c | 258 +++++++++++++++++++-------------------------- 4 files changed, 114 insertions(+), 148 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index e520bb74479..db62dccc09f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -132,7 +132,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ - testpoll.lo testlock.lo + testpoll.lo testlock.lo testsockopt.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/test_apr.h b/test/test_apr.h index 0e8701155a8..b3b5f599e89 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -87,5 +87,6 @@ CuSuite *testsockets(void); CuSuite *testproc(void); CuSuite *testpoll(void); CuSuite *testlock(void); +CuSuite *testsockopt(void); #endif /* APR_TEST_INCLUDES */ diff --git a/test/testall.c b/test/testall.c index 260b7dd79ae..7108b2ac13c 100644 --- a/test/testall.c +++ b/test/testall.c @@ -82,6 +82,7 @@ static const struct testlist { {"testdso", testdso}, {"testoc", testoc}, {"testsockets", testsockets}, + {"testsockopt", testsockopt}, {"testproc", testproc}, {"testpoll", testpoll}, {"testlock", testlock}, diff --git a/test/testsockopt.c b/test/testsockopt.c index a99c90d2ba0..43f71056def 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -52,169 +52,133 @@ * . */ -#include -#include -#include -#include #include "apr_network_io.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" -#if APR_HAVE_UNISTD_H -#include -#endif +#include "test_apr.h" + +static apr_socket_t *sock = NULL; -static void failure(apr_socket_t *sock) +static void create_socket(CuTest *tc) { - apr_socket_close(sock); - printf("Failed!\n"); - exit(-1); + apr_status_t rv; + + rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, sock); +} + +static void set_keepalive(CuTest *tc) +{ + apr_status_t rv; + apr_int32_t ck; + + rv = apr_socket_opt_set(sock, APR_SO_KEEPALIVE, 1); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 1, ck); +} + +static void set_debug(CuTest *tc) +{ + apr_status_t rv; + apr_int32_t ck; + + rv = apr_socket_opt_set(sock, APR_SO_DEBUG, 1); + /* Grrrr, this is annoying, but APR_SO_DEBUG is only valid if the program + * is running as root. Rather than add all the logic to determine who + * the program is running as, I have just added a simple compile time + * check. + */ +#if RUN_AS_ROOT + CuAssertIntEquals(tc, APR_SUCCESS, rv); +#else + CuAssertIntEquals(tc, 1, APR_STATUS_IS_EACCES(rv)); +#endif + + rv = apr_socket_opt_get(sock, APR_SO_DEBUG, &ck); + CuAssertIntEquals(tc, APR_SUCCESS, rv); +#if RUN_AS_ROOT + CuAssertIntEquals(tc, 1, ck); +#else + CuAssertIntEquals(tc, 0, ck); +#endif } -static void failureno(apr_socket_t *sock) +static void remove_keepalive(CuTest *tc) { - apr_socket_close(sock); - printf("No!\n"); - exit(-1); + apr_status_t rv; + apr_int32_t ck; + + rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 1, ck); + + rv = apr_socket_opt_set(sock, APR_SO_KEEPALIVE, 0); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 0, ck); } -int main(void) +static void corkable(CuTest *tc) { - apr_pool_t *context; - apr_pool_t *cont2; - apr_socket_t *sock = NULL; - apr_status_t stat = 0; +#if !APR_HAVE_CORKABLE_TCP + CuNotImpl(tc, "TCP isn't corkable"); +#else + apr_status_t rv; apr_int32_t ck; - if (apr_initialize() != APR_SUCCESS) { - fprintf(stderr, "Couldn't initialize."); - exit(-1); - } - atexit(apr_terminate); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - fprintf(stderr, "Couldn't allocate context."); - exit(-1); - } - if (apr_pool_create(&cont2, context) != APR_SUCCESS) { - fprintf(stderr, "Couldn't allocate context."); - exit(-1); - } - - printf("Testing socket option functions.\n"); - - printf("\tCreating socket.........................."); - if ((stat = apr_socket_create(&sock, APR_INET, SOCK_STREAM, context)) - != APR_SUCCESS){ - printf("Failed to create a socket!\n"); - exit(-1); - } - printf("OK\n"); - - printf ("\tTrying to set APR_SO_KEEPALIVE..........."); - if (apr_socket_opt_set(sock, APR_SO_KEEPALIVE, 1) != APR_SUCCESS){ - apr_socket_close(sock); - printf("Failed!\n"); - exit (-1); - } - printf ("OK\n"); - - printf("\tChecking if we recorded it..............."); - if (apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck) != APR_SUCCESS){ - apr_socket_close(sock); - fprintf(stderr,"Failed\n"); - exit(-1); - } - if (ck != 1){ - apr_socket_close(sock); - printf("No (%d)\n", ck); - exit(-1); - } - printf("Yes\n"); - - printf("\tTrying to set APR_SO_DEBUG..............."); - if (apr_socket_opt_set(sock, APR_SO_DEBUG, 1) != APR_SUCCESS){ - printf("Failed (ignored)\n"); - } - else { - printf ("OK\n"); - - printf("\tChecking if we recorded it..............."); - if (apr_socket_opt_get(sock, APR_SO_DEBUG, &ck) != APR_SUCCESS){ - apr_socket_close(sock); - printf("Failed!\n"); - exit (-1); - } - if (ck != 1){ - printf ("No (%d)\n", ck); - apr_socket_close(sock); - exit (-1); - } - printf ("Yes\n"); - } - - printf ("\tTrying to remove APR_SO_KEEPALIVE........"); - if (apr_socket_opt_set(sock, APR_SO_KEEPALIVE, 0) != APR_SUCCESS){ - apr_socket_close(sock); - printf("Failed!\n"); - exit (-1); - } - printf ("OK\n"); - - printf ("\tDid we record the removal................"); - if (apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck) != APR_SUCCESS){ - apr_socket_close(sock); - printf("Didn't get value!\n"); - exit(-1); - } - if (ck != 0){ - failureno(sock); - } - printf ("Yes\n"); - -#if APR_HAVE_CORKABLE_TCP - printf ("\tTesting APR_TCP_NOPUSH!\n"); - printf("\t\tSetting APR_TCP_NODELAY.........."); - if (apr_socket_opt_set(sock, APR_TCP_NODELAY, 1) != APR_SUCCESS){ - failure(sock); - } - printf("OK\n"); - printf("\t\tSetting APR_TCP_NOPUSH..........."); - if (apr_socket_opt_set(sock, APR_TCP_NOPUSH, 1) != APR_SUCCESS){ - failure(sock); - } - printf("OK\n"); - printf("\t\tChecking on APR_TCP_NODELAY......"); - if (apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck) != APR_SUCCESS){ - failure(sock); - } - if (ck != 0){ - failureno(sock); - } - printf("Yes (not set)\n"); - printf("\t\tUnsetting APR_TCP_NOPUSH........."); - if (apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0) != APR_SUCCESS){ - failure(sock); - } - printf("OK\n"); + rv = apr_socket_opt_set(sock, APR_TCP_NODELAY, 1); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 1, ck); + + rv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 1); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_socket_opt_get(sock, APR_TCP_NOPUSH, &ck); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 1, ck); + + rv = apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 0, ck); + + rv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - printf("\t\tChecking on APR_TCP_NODELAY......"); - if (apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck) != APR_SUCCESS){ - failure(sock); - } - if (ck != 1){ - failureno(sock); - } - printf("Yes (set)\n"); - - printf ("\tSeems OK!\n"); + rv = apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 1, ck); #endif +} + +static void close_socket(CuTest *tc) +{ + apr_status_t rv; + + rv = apr_socket_close(sock); + CuAssertIntEquals(tc, APR_SUCCESS, rv); +} + +CuSuite *testsockopt(void) +{ + CuSuite *suite = CuSuiteNew("Socket Options"); - printf("\tTrying to close the socket..............."); - if ((stat = apr_socket_close(sock)) != APR_SUCCESS){ - printf("Failed to close the socket!\n"); - exit(-1); - } - printf("OK\n"); + SUITE_ADD_TEST(suite, create_socket); + SUITE_ADD_TEST(suite, set_keepalive); + SUITE_ADD_TEST(suite, set_debug); + SUITE_ADD_TEST(suite, remove_keepalive); + SUITE_ADD_TEST(suite, corkable); + SUITE_ADD_TEST(suite, close_socket); - return 0; + return suite; } + From b3921b029cef7d89fcc522a590f0f9a10a93483a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 3 Dec 2002 22:01:00 +0000 Subject: [PATCH 4096/7878] migrate testpipe to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64115 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 8 +-- test/test_apr.h | 1 + test/testall.c | 1 + test/testpipe.c | 131 ++++++++++++++++++++++++++++------------------- 4 files changed, 82 insertions(+), 59 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index db62dccc09f..dad211a8e4f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -104,12 +104,6 @@ testshmproducer@EXEEXT@: testshmproducer.lo $(LOCAL_LIBS) testshmconsumer@EXEEXT@: testshmconsumer.lo $(LOCAL_LIBS) $(LINK) testshmconsumer.lo $(LOCAL_LIBS) $(ALL_LIBS) -testpipe@EXEEXT@: testpipe.lo $(LOCAL_LIBS) - $(LINK) testpipe.lo $(LOCAL_LIBS) $(ALL_LIBS) - -testsockopt@EXEEXT@: testsockopt.lo $(LOCAL_LIBS) - $(LINK) testsockopt.lo $(LOCAL_LIBS) $(ALL_LIBS) - testhash@EXEEXT@: testhash.lo $(LOCAL_LIBS) $(LINK) testhash.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -132,7 +126,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ - testpoll.lo testlock.lo testsockopt.lo + testpoll.lo testlock.lo testsockopt.lo testpipe.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/test_apr.h b/test/test_apr.h index b3b5f599e89..b1cbd2bc722 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -88,5 +88,6 @@ CuSuite *testproc(void); CuSuite *testpoll(void); CuSuite *testlock(void); CuSuite *testsockopt(void); +CuSuite *testpipe(void); #endif /* APR_TEST_INCLUDES */ diff --git a/test/testall.c b/test/testall.c index 7108b2ac13c..559b5a46500 100644 --- a/test/testall.c +++ b/test/testall.c @@ -76,6 +76,7 @@ static const struct testlist { {"testfmt", testfmt}, {"testfile", testfile}, {"testfileinfo", testfileinfo}, + {"testpipe", testpipe}, {"testdup", testdup}, {"testdir", testdir}, {"testrand", testrand}, diff --git a/test/testpipe.c b/test/testpipe.c index 8d57954b51b..bdd0640f8d5 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -52,67 +52,94 @@ * . */ -#include +#include "test_apr.h" #include "apr_file_io.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" -#include -#ifdef BEOS -#include -#endif -int main(void) +static apr_file_t *readp = NULL; +static apr_file_t *writep = NULL; + +static void create_pipe(CuTest *tc) +{ + apr_status_t rv; + + rv = apr_file_pipe_create(&readp, &writep, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, readp); + CuAssertPtrNotNull(tc, writep); +} + +static void close_pipe(CuTest *tc) { - apr_pool_t *context; + apr_status_t rv; + apr_size_t nbytes = 256; + char buf[256]; + + rv = apr_file_close(readp); + rv = apr_file_close(writep); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_file_read(readp, buf, &nbytes); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_EBADF(rv)); +} + +static void set_timeout(CuTest *tc) +{ + apr_status_t rv; apr_file_t *readp = NULL; apr_file_t *writep = NULL; - apr_size_t nbytes; + apr_interval_time_t timeout; + + rv = apr_file_pipe_create(&readp, &writep, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, readp); + CuAssertPtrNotNull(tc, writep); + + rv = apr_file_pipe_timeout_get(readp, &timeout); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, -1, timeout); + + rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_file_pipe_timeout_get(readp, &timeout); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, apr_time_from_sec(1), timeout); +} + +static void read_write(CuTest *tc) +{ apr_status_t rv; char *buf; - char msgbuf[120]; - - if (apr_initialize() != APR_SUCCESS) { - fprintf(stderr, "Couldn't initialize."); - exit(-1); - } - atexit(apr_terminate); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - fprintf(stderr, "Couldn't allocate context."); - exit(-1); - } - - fprintf(stdout, "Testing pipe functions.\n"); - - fprintf(stdout, "\tCreating pipes......."); - if ((rv = apr_file_pipe_create(&readp, &writep, context)) != APR_SUCCESS) { - fprintf(stderr, "apr_file_pipe_create()->%d/%s\n", - rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); - exit(-1); - } - else { - fprintf(stdout, "OK\n"); - } - - fprintf(stdout, "\tSetting pipe timeout......."); - if ((rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1))) != APR_SUCCESS) { - fprintf(stderr, "apr_file_pipe_timeout_set()->%d/%s\n", - rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); - exit(-1); - } else { - fprintf(stdout, "OK\n"); - } - - fprintf(stdout, "\tReading from the pipe......."); + apr_size_t nbytes; + nbytes = strlen("this is a test"); - buf = (char *)apr_palloc(context, nbytes + 1); - if (apr_file_read(readp, buf, &nbytes) == APR_TIMEUP) { - fprintf(stdout, "OK\n"); - } - else { - fprintf(stdout, "The timeout didn't work :-(\n"); - exit(-1); - } - - return 0; + buf = (char *)apr_palloc(p, nbytes + 1); + + rv = apr_file_pipe_create(&readp, &writep, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, readp); + CuAssertPtrNotNull(tc, writep); + + rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_file_read(readp, buf, &nbytes); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + CuAssertIntEquals(tc, 0, nbytes); } + +CuSuite *testpipe(void) +{ + CuSuite *suite = CuSuiteNew("Pipes"); + + SUITE_ADD_TEST(suite, create_pipe); + SUITE_ADD_TEST(suite, close_pipe); + SUITE_ADD_TEST(suite, set_timeout); + SUITE_ADD_TEST(suite, read_write); + + return suite; +} + From df50684efe3997fa8d3fa07047232e7155d525b5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 3 Dec 2002 22:09:04 +0000 Subject: [PATCH 4097/7878] Remove a couple of tests that can't be built separately. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64116 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index dad211a8e4f..1291bd329b9 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -19,8 +19,6 @@ PROGRAMS = \ testargs@EXEEXT@ \ testshmproducer@EXEEXT@ \ testshmconsumer@EXEEXT@ \ - testpipe@EXEEXT@ \ - testsockopt@EXEEXT@ \ testhash@EXEEXT@ \ testuser@EXEEXT@ \ testatomic@EXEEXT@ \ From 7228db6975a34daac8df03f1ed638b5d31483985 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 3 Dec 2002 22:42:02 +0000 Subject: [PATCH 4098/7878] Migrate testthread to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64117 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 6 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testthread.c | 185 ++++++++++++++++++++-------------------------- 4 files changed, 84 insertions(+), 109 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 1291bd329b9..7b9950da02d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -13,7 +13,6 @@ PROGRAMS = \ testnames@EXEEXT@ \ testflock@EXEEXT@ \ testsock@EXEEXT@ \ - testthread@EXEEXT@ \ testlock@EXEEXT@ \ testlockperf@EXEEXT@ \ testargs@EXEEXT@ \ @@ -75,9 +74,6 @@ libmod_test.la: mod_test.slo $(LOCAL_LIBS) testargs@EXEEXT@: testargs.lo $(LOCAL_LIBS) $(LINK) testargs.lo $(LOCAL_LIBS) $(ALL_LIBS) -testthread@EXEEXT@: testthread.lo $(LOCAL_LIBS) - $(LINK) testthread.lo $(LOCAL_LIBS) $(ALL_LIBS) - testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS) $(LINK) testlockperf.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -124,7 +120,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ - testpoll.lo testlock.lo testsockopt.lo testpipe.lo + testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/test_apr.h b/test/test_apr.h index b1cbd2bc722..d1affc3dbcb 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -89,5 +89,6 @@ CuSuite *testpoll(void); CuSuite *testlock(void); CuSuite *testsockopt(void); CuSuite *testpipe(void); +CuSuite *testthread(void); #endif /* APR_TEST_INCLUDES */ diff --git a/test/testall.c b/test/testall.c index 559b5a46500..bee69746a54 100644 --- a/test/testall.c +++ b/test/testall.c @@ -87,6 +87,7 @@ static const struct testlist { {"testproc", testproc}, {"testpoll", testpoll}, {"testlock", testlock}, + {"testthread", testthread}, {"LastTest", NULL} }; diff --git a/test/testthread.c b/test/testthread.c index c41732ccc71..5b8e2151a09 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -56,41 +56,30 @@ #include "apr_errno.h" #include "apr_general.h" #include "errno.h" -#include -#include #include "apr_time.h" -#if APR_HAVE_UNISTD_H -#include -#endif +#include "test_apr.h" -#if !APR_HAS_THREADS -int main(void) -{ - fprintf(stderr, - "This program won't work on this platform because there is no " - "support for threads.\n"); - return 0; -} -#else /* !APR_HAS_THREADS */ +#if APR_HAS_THREADS + +static apr_thread_mutex_t *thread_lock; +static apr_thread_once_t *control = NULL; +static int x = 0; +static int value = 0; -void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data); -void * APR_THREAD_FUNC thread_func2(apr_thread_t *thd, void *data); -void * APR_THREAD_FUNC thread_func3(apr_thread_t *thd, void *data); -void * APR_THREAD_FUNC thread_func4(apr_thread_t *thd, void *data); +static apr_thread_t *t1; +static apr_thread_t *t2; +static apr_thread_t *t3; +static apr_thread_t *t4; -apr_thread_mutex_t *thread_lock; -apr_pool_t *context; -apr_thread_once_t *control = NULL; -int x = 0; -int value = 0; -apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ +/* just some made up number to check on later */ +static apr_status_t exit_ret_val = 123; static void init_func(void) { value++; } -void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data) +static void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data) { int i; @@ -105,90 +94,78 @@ void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data) return NULL; } -int main(void) +static void thread_init(CuTest *tc) { - apr_thread_t *t1; - apr_thread_t *t2; - apr_thread_t *t3; - apr_thread_t *t4; - apr_status_t r1, r2, r3, r4; - apr_status_t s1, s2, s3, s4; - apr_initialize(); - - printf("APR Simple Thread Test\n======================\n\n"); - - printf("%-60s", "Initializing the context"); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - fflush(stdout); - fprintf(stderr, "Failed.\nCould not initialize\n"); - exit(-1); - } - printf("OK\n"); + apr_status_t rv; - apr_thread_once_init(&control, context); + rv = apr_thread_once_init(&control, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); - printf("%-60s", "Initializing the lock"); - r1 = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, - context); - if (r1 != APR_SUCCESS) { - fflush(stdout); - fprintf(stderr, "Failed\nCould not create lock\n"); - exit(-1); - } - printf("OK\n"); - - printf("%-60s", "Starting all the threads"); - r1 = apr_thread_create(&t1, NULL, thread_func1, NULL, context); - r2 = apr_thread_create(&t2, NULL, thread_func1, NULL, context); - r3 = apr_thread_create(&t3, NULL, thread_func1, NULL, context); - r4 = apr_thread_create(&t4, NULL, thread_func1, NULL, context); - if (r1 != APR_SUCCESS || r2 != APR_SUCCESS || - r3 != APR_SUCCESS || r4 != APR_SUCCESS) { - fflush(stdout); - fprintf(stderr, "Failed\nError starting thread\n"); - exit(-1); - } - printf("OK\n"); - - printf("%-60s", "Waiting for threads to exit"); - fflush(stdout); - apr_thread_join(&s1, t1); - apr_thread_join(&s2, t2); - apr_thread_join(&s3, t3); - apr_thread_join(&s4, t4); - printf("OK\n"); - - printf("%-60s", "Checking thread's returned value"); - if (s1 != exit_ret_val || s2 != exit_ret_val || - s3 != exit_ret_val || s4 != exit_ret_val) { - fflush(stdout); - fprintf(stderr, - "Invalid return value\nGot %d/%d/%d/%d, but expected %d for all 4\n", - s1, s2, s3, s4, exit_ret_val); - exit(-1); - } - printf("OK\n"); + rv = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); +} - printf("%-60s", "Checking if locks worked"); - if (x != 40000) { - fflush(stdout); - fprintf(stderr, "No!\nThe locks didn't work???? x = %d instead of 40,000\n", x); - exit(-1); - } - printf("OK\n"); - - printf("%-60s", "Checking if apr_thread_once worked"); - if (value != 1) { - fflush(stdout); - fprintf(stderr, "Failed!\napr_thread_once must not have worked, " - "value is %d instead of 1\n", value); - exit(-1); - } - printf("OK\n"); +static void create_threads(CuTest *tc) +{ + apr_status_t rv; + + rv = apr_thread_create(&t1, NULL, thread_func1, NULL, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_thread_create(&t2, NULL, thread_func1, NULL, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_thread_create(&t3, NULL, thread_func1, NULL, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_thread_create(&t4, NULL, thread_func1, NULL, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); +} + +static void join_threads(CuTest *tc) +{ + apr_status_t s; + + apr_thread_join(&s, t1); + CuAssertIntEquals(tc, exit_ret_val, s); + apr_thread_join(&s, t2); + CuAssertIntEquals(tc, exit_ret_val, s); + apr_thread_join(&s, t3); + CuAssertIntEquals(tc, exit_ret_val, s); + apr_thread_join(&s, t4); + CuAssertIntEquals(tc, exit_ret_val, s); +} - apr_terminate(); +static void check_locks(CuTest *tc) +{ + CuAssertIntEquals(tc, 40000, x); +} + +static void check_thread_once(CuTest *tc) +{ + CuAssertIntEquals(tc, 1, value); +} + +#else + +static void threads_not_impl(CuTest *tc) +{ + CuNotImpl(tc, "Threads not implemented on this platform"); +} + +#endif + +CuSuite *testthread(void) +{ + CuSuite *suite = CuSuiteNew("Threads"); + +#if !APR_HAS_THREADS + SUITE_ADD_TEST(suite, threads_not_impl); +#else + SUITE_ADD_TEST(suite, thread_init); + SUITE_ADD_TEST(suite, create_threads); + SUITE_ADD_TEST(suite, join_threads); + SUITE_ADD_TEST(suite, check_locks); + SUITE_ADD_TEST(suite, check_thread_once); +#endif - return 0; + return suite; } -#endif /* !APR_HAS_THREADS */ From 5d815f1e71ce70cf03a68df73c6034308dbecc8a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 4 Dec 2002 22:33:08 +0000 Subject: [PATCH 4099/7878] Migrate testhash to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64118 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 3 ++- test/test_apr.h | 1 + test/testall.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index 7b9950da02d..ed1055b28ca 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -120,7 +120,8 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ - testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo + testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ + testhash.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/test_apr.h b/test/test_apr.h index d1affc3dbcb..57213e91dcc 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -73,6 +73,7 @@ CuSuite *testipsub(void); CuSuite *testmmap(void); CuSuite *testud(void); CuSuite *testtable(void); +CuSuite *testhash(void); CuSuite *testsleep(void); CuSuite *testpool(void); CuSuite *testfmt(void); diff --git a/test/testall.c b/test/testall.c index bee69746a54..feb7bac12b2 100644 --- a/test/testall.c +++ b/test/testall.c @@ -71,6 +71,7 @@ static const struct testlist { {"testmmap", testmmap}, {"testud", testud}, {"testtable", testtable}, + {"testhash", testhash}, {"testsleep", testsleep}, {"testpool", testpool}, {"testfmt", testfmt}, From ea5efda3e5221c9c36680945c69d5dd500749af5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 4 Dec 2002 22:35:02 +0000 Subject: [PATCH 4100/7878] Forgot to remove this target git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64119 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index ed1055b28ca..e34b2a6f339 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -98,9 +98,6 @@ testshmproducer@EXEEXT@: testshmproducer.lo $(LOCAL_LIBS) testshmconsumer@EXEEXT@: testshmconsumer.lo $(LOCAL_LIBS) $(LINK) testshmconsumer.lo $(LOCAL_LIBS) $(ALL_LIBS) -testhash@EXEEXT@: testhash.lo $(LOCAL_LIBS) - $(LINK) testhash.lo $(LOCAL_LIBS) $(ALL_LIBS) - testuser@EXEEXT@: testuser.lo $(LOCAL_LIBS) $(LINK) testuser.lo $(LOCAL_LIBS) $(ALL_LIBS) From 181ebe8880e2544f31b62cc05f4eb27c71930d2c Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 5 Dec 2002 20:24:46 +0000 Subject: [PATCH 4101/7878] Joe pointed out that this file wasn't committed yesterday. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64120 13f79535-47bb-0310-9956-ffa450edef68 --- test/testhash.c | 478 +++++++++++++++++++++++++++++++----------------- 1 file changed, 313 insertions(+), 165 deletions(-) diff --git a/test/testhash.c b/test/testhash.c index 7c3ff6c29b9..dc59188f9ae 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -52,38 +52,29 @@ * . */ +#include "test_apr.h" #include "apr.h" #include "apr_strings.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_hash.h" -#if APR_HAVE_STDIO_H -#include -#endif -#if APR_HAVE_STDLIB_H -#include -#endif -#if APR_HAVE_STRING_H -#include -#endif - -static void dump_hash(apr_pool_t *p, apr_hash_t *h) + +static void dump_hash(apr_pool_t *p, apr_hash_t *h, char *str) { apr_hash_index_t *hi; char *val, *key; apr_ssize_t len; int i = 0; + str[0] = '\0'; + for (hi = apr_hash_first(p, h); hi; hi = apr_hash_next(hi)) { apr_hash_this(hi,(void*) &key, &len, (void*) &val); - fprintf(stdout, "Key %s (%" APR_SSIZE_T_FMT ") Value %s\n", key, len, val); + apr_snprintf(str, 8196, "%sKey %s (%" APR_SSIZE_T_FMT ") Value %s\n", + str, key, len, val); i++; } - if (i != apr_hash_count(h)) - fprintf(stderr, "ERROR: #entries (%d) does not match count (%d)\n", - i, apr_hash_count(h)); - else - fprintf(stdout, "#entries %d \n", i); + apr_snprintf(str, 8196, "%s#entries %d\n", str, i); } static void sum_hash(apr_pool_t *p, apr_hash_t *h, int *pcount, int *keySum, int *valSum) @@ -104,26 +95,85 @@ static void sum_hash(apr_pool_t *p, apr_hash_t *h, int *pcount, int *keySum, int *pcount=count; } -int main(int argc, const char *const argv[]) +static void hash_make(CuTest *tc) { - apr_pool_t *cntxt; - apr_hash_t *h, *h2, *h3, *h4; + apr_hash_t *h = NULL; - int i, j, *val, *key; - char *result; - int sumKeys, sumVal, trySumKey, trySumVal; + h = apr_hash_make(p); + CuAssertPtrNotNull(tc, h); +} - apr_initialize(); - atexit(apr_terminate); +static void hash_set(CuTest *tc) +{ + apr_hash_t *h = NULL; + char *result = NULL; - apr_pool_create(&cntxt, NULL); + h = apr_hash_make(p); + CuAssertPtrNotNull(tc, h); - /* table defaults */ - h = apr_hash_make(cntxt); - if (h == NULL) { - fprintf(stderr, "ERROR: can not allocate HASH!\n"); - exit(-1); - } + apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); + result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); + CuAssertStrEquals(tc, "value", result); +} + +static void hash_reset(CuTest *tc) +{ + apr_hash_t *h = NULL; + char *result = NULL; + + h = apr_hash_make(p); + CuAssertPtrNotNull(tc, h); + + apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); + result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); + CuAssertStrEquals(tc, "value", result); + + apr_hash_set(h, "key", APR_HASH_KEY_STRING, "new"); + result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); + CuAssertStrEquals(tc, "new", result); +} + +static void same_value(CuTest *tc) +{ + apr_hash_t *h = NULL; + char *result = NULL; + + h = apr_hash_make(p); + CuAssertPtrNotNull(tc, h); + + apr_hash_set(h, "same1", APR_HASH_KEY_STRING, "same"); + result = apr_hash_get(h, "same1", APR_HASH_KEY_STRING); + CuAssertStrEquals(tc, "same", result); + + apr_hash_set(h, "same2", APR_HASH_KEY_STRING, "same"); + result = apr_hash_get(h, "same2", APR_HASH_KEY_STRING); + CuAssertStrEquals(tc, "same", result); +} + +static void key_space(CuTest *tc) +{ + apr_hash_t *h = NULL; + char *result = NULL; + + h = apr_hash_make(p); + CuAssertPtrNotNull(tc, h); + + apr_hash_set(h, "key with space", APR_HASH_KEY_STRING, "value"); + result = apr_hash_get(h, "key with space", APR_HASH_KEY_STRING); + CuAssertStrEquals(tc, "value", result); +} + +/* This is kind of a hack, but I am just keeping an existing test. This is + * really testing apr_hash_first, apr_hash_next, and apr_hash_this which + * should be tested in three separate tests, but this will do for now. + */ +static void hash_traverse(CuTest *tc) +{ + apr_hash_t *h; + char str[8196]; + + h = apr_hash_make(p); + CuAssertPtrNotNull(tc, h); apr_hash_set(h, "OVERWRITE", APR_HASH_KEY_STRING, "should not see this"); apr_hash_set(h, "FOO3", APR_HASH_KEY_STRING, "bar3"); @@ -135,39 +185,30 @@ int main(int argc, const char *const argv[]) apr_hash_set(h, "SAME2", APR_HASH_KEY_STRING, "same"); apr_hash_set(h, "OVERWRITE", APR_HASH_KEY_STRING, "Overwrite key"); - result = apr_hash_get(h, "FOO2", APR_HASH_KEY_STRING); - if (strcmp(result, "bar2")) - fprintf(stderr, "ERROR:apr_hash_get FOO2 = %s (should be bar2)\n", - result); - - result = apr_hash_get(h, "SAME2", APR_HASH_KEY_STRING); - if (strcmp(result, "same")) - fprintf(stderr, "ERROR:apr_hash_get SAME2 = %s (should be same)\n", - result); - - result = apr_hash_get(h, "OVERWRITE", APR_HASH_KEY_STRING); - if (strcmp(result, "Overwrite key")) - fprintf(stderr, - "ERROR:apr_hash_get OVERWRITE = %s (should be 'Overwrite key')\n", - result); - - result = apr_hash_get(h, "NOTTHERE", APR_HASH_KEY_STRING); - if (result) - fprintf(stderr, "ERROR:apr_hash_get NOTTHERE = %s (should be NULL)\n", - result); - - result=apr_hash_get(h, "FOO3", APR_HASH_KEY_STRING); - if (strcmp(result, "bar3")) - fprintf(stderr, "ERROR:apr_hash_get FOO3 = %s (should be bar3)\n", - result); - - dump_hash(cntxt, h); + dump_hash(p, h, str); + CuAssertStrEquals(tc, "Key FOO1 (4) Value bar1\n" + "Key FOO2 (4) Value bar2\n" + "Key OVERWRITE (9) Value Overwrite key\n" + "Key FOO3 (4) Value bar3\n" + "Key SAME1 (5) Value same\n" + "Key FOO4 (4) Value bar4\n" + "Key SAME2 (5) Value same\n" + "#entries 7\n", str); +} + +/* This is kind of a hack, but I am just keeping an existing test. This is + * really testing apr_hash_first, apr_hash_next, and apr_hash_this which + * should be tested in three separate tests, but this will do for now. + */ +static void summation_test(CuTest *tc) +{ + apr_hash_t *h; + int sumKeys, sumVal, trySumKey, trySumVal; + int i, j, *val, *key; + + h =apr_hash_make(p); + CuAssertPtrNotNull(tc, h); - h2 =apr_hash_make(cntxt); - if (h2 == NULL) { - fprintf(stderr, "ERROR: can not allocate HASH!\n"); - exit(-1); - } sumKeys = 0; sumVal = 0; trySumKey = 0; @@ -177,117 +218,224 @@ int main(int argc, const char *const argv[]) j = i * 10 + 1; sumKeys += j; sumVal += i; - key = apr_palloc(cntxt, sizeof(int)); + key = apr_palloc(p, sizeof(int)); *key = j; - val = apr_palloc(cntxt, sizeof(int)); + val = apr_palloc(p, sizeof(int)); *val = i; - apr_hash_set(h2, key, sizeof(int), val); + apr_hash_set(h, key, sizeof(int), val); } - sum_hash(cntxt, h2, &i, &trySumKey, &trySumVal); - if (i==100) { - fprintf(stdout, "All keys accounted for\n"); - } else { - fprintf(stderr, "ERROR: Only got %d (out of 100)\n",i); - } - if (trySumVal != sumVal) { - fprintf(stderr, "ERROR:Values don't add up Got %d expected %d\n", - trySumVal, sumVal); - } - if (trySumKey != sumKeys) { - fprintf(stderr, "ERROR:Keys don't add up Got %d expected %d\n", - trySumKey, sumKeys); - } + sum_hash(p, h, &i, &trySumKey, &trySumVal); + CuAssertIntEquals(tc, 100, i); + CuAssertIntEquals(tc, sumVal, trySumVal); + CuAssertIntEquals(tc, sumKeys, trySumKey); +} - j=891; - apr_hash_set(h2, &j, sizeof(int), NULL); - - if (apr_hash_get(h2, &j, sizeof(int))) { - fprintf(stderr, "ERROR: Delete not working\n"); - } else { - fprintf(stdout, "Delete working\n"); - } - sum_hash(cntxt, h2, &i, &trySumKey, &trySumVal); +static void delete_key(CuTest *tc) +{ + apr_hash_t *h = NULL; + char *result = NULL; - sumKeys -= 891; - sumVal -= 89; + h = apr_hash_make(p); + CuAssertPtrNotNull(tc, h); - if (i==99) { - fprintf(stdout, "All keys accounted for.. Delete OK\n"); - } else { - fprintf(stderr, "Only got %d (out of 99) Delete Not OK\n", i); - } - if (trySumVal != sumVal) { - fprintf(stderr, "ERROR:Values don't add up Got %d expected %d\n", - trySumVal, sumVal); - } - if (trySumKey != sumKeys) { - fprintf(stderr, "ERROR:Keys don't add up Got %d expected %d\n", - trySumKey, sumKeys); - } + apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); + apr_hash_set(h, "key2", APR_HASH_KEY_STRING, "value2"); - /* test overlay */ - h3 = apr_hash_make(cntxt); - /* test with blank hash tables */ - h4 = apr_hash_overlay(cntxt, h3, h); - - if (apr_hash_count(h4) != apr_hash_count(h)) { - fprintf(stderr, - "ERROR: overlay not working with blank overlay as overlay\n"); - dump_hash(cntxt, h4); - } + result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); + CuAssertStrEquals(tc, "value", result); - h4 = apr_hash_overlay(cntxt, h, h3); - if (apr_hash_count(h4) != apr_hash_count(h)) { - fprintf(stderr, - "ERROR: overlay not working with blank overlay as base\n"); - dump_hash(cntxt, h4); - } + result = apr_hash_get(h, "key2", APR_HASH_KEY_STRING); + CuAssertStrEquals(tc, "value2", result); - h4 = apr_hash_overlay(cntxt, h, h2); - if (apr_hash_count(h4) != (apr_hash_count(h) + apr_hash_count(h2))) - fprintf(stderr, - "ERROR: overlay not working when overlaying 2 unique hashs\n"); + apr_hash_set(h, "key", APR_HASH_KEY_STRING, NULL); - h4 = apr_hash_overlay(cntxt, h, h); - if (apr_hash_count(h4) != apr_hash_count(h)) { - fprintf(stderr, - "ERROR: overlay not working when overlaying same hash\n"); - dump_hash(cntxt, h4); - } - - result = apr_hash_get(h4, "FOO2", APR_HASH_KEY_STRING); - if (strcmp(result, "bar2")) - fprintf(stderr, "ERROR:apr_hash_get FOO2 = %s (should be bar2)\n", - result); - - result = apr_hash_get(h4, "SAME2", APR_HASH_KEY_STRING); - if (strcmp(result, "same")) - fprintf(stderr, "ERROR:apr_hash_get SAME2 = %s (should be same)\n", - result); - - result = apr_hash_get(h4, "OVERWRITE", APR_HASH_KEY_STRING); - if (strcmp(result, "Overwrite key")) - fprintf(stderr, - "ERROR:apr_hash_get OVERWRITE = %s (should be 'Overwrite key')\n", - result); - - result = apr_hash_get(h4, "NOTTHERE", APR_HASH_KEY_STRING); - if (result) - fprintf(stderr, "ERROR:apr_hash_get NOTTHERE = %s (should be NULL)\n", - result); + result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); + CuAssertPtrEquals(tc, NULL, result); + + result = apr_hash_get(h, "key2", APR_HASH_KEY_STRING); + CuAssertStrEquals(tc, "value2", result); +} + +static void hash_count_0(CuTest *tc) +{ + apr_hash_t *h = NULL; + int count; + + h = apr_hash_make(p); + CuAssertPtrNotNull(tc, h); + + count = apr_hash_count(h); + CuAssertIntEquals(tc, 0, count); +} + +static void hash_count_1(CuTest *tc) +{ + apr_hash_t *h = NULL; + int count; + + h = apr_hash_make(p); + CuAssertPtrNotNull(tc, h); + + apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); + + count = apr_hash_count(h); + CuAssertIntEquals(tc, 1, count); +} + +static void hash_count_5(CuTest *tc) +{ + apr_hash_t *h = NULL; + int count; + + h = apr_hash_make(p); + CuAssertPtrNotNull(tc, h); + + apr_hash_set(h, "key1", APR_HASH_KEY_STRING, "value1"); + apr_hash_set(h, "key2", APR_HASH_KEY_STRING, "value2"); + apr_hash_set(h, "key3", APR_HASH_KEY_STRING, "value3"); + apr_hash_set(h, "key4", APR_HASH_KEY_STRING, "value4"); + apr_hash_set(h, "key5", APR_HASH_KEY_STRING, "value5"); + + count = apr_hash_count(h); + CuAssertIntEquals(tc, 5, count); +} + +static void overlay_empty(CuTest *tc) +{ + apr_hash_t *base = NULL; + apr_hash_t *overlay = NULL; + apr_hash_t *result = NULL; + int count; + char str[8196]; + + base = apr_hash_make(p); + overlay = apr_hash_make(p); + CuAssertPtrNotNull(tc, base); + CuAssertPtrNotNull(tc, overlay); + + apr_hash_set(base, "key1", APR_HASH_KEY_STRING, "value1"); + apr_hash_set(base, "key2", APR_HASH_KEY_STRING, "value2"); + apr_hash_set(base, "key3", APR_HASH_KEY_STRING, "value3"); + apr_hash_set(base, "key4", APR_HASH_KEY_STRING, "value4"); + apr_hash_set(base, "key5", APR_HASH_KEY_STRING, "value5"); + + result = apr_hash_overlay(p, overlay, base); + + count = apr_hash_count(result); + CuAssertIntEquals(tc, 5, count); + + dump_hash(p, result, str); + CuAssertStrEquals(tc, "Key key1 (4) Value value1\n" + "Key key2 (4) Value value2\n" + "Key key3 (4) Value value3\n" + "Key key4 (4) Value value4\n" + "Key key5 (4) Value value5\n" + "#entries 5\n", str); +} + +static void overlay_2unique(CuTest *tc) +{ + apr_hash_t *base = NULL; + apr_hash_t *overlay = NULL; + apr_hash_t *result = NULL; + int count; + char str[8196]; + + base = apr_hash_make(p); + overlay = apr_hash_make(p); + CuAssertPtrNotNull(tc, base); + CuAssertPtrNotNull(tc, overlay); + + apr_hash_set(base, "base1", APR_HASH_KEY_STRING, "value1"); + apr_hash_set(base, "base2", APR_HASH_KEY_STRING, "value2"); + apr_hash_set(base, "base3", APR_HASH_KEY_STRING, "value3"); + apr_hash_set(base, "base4", APR_HASH_KEY_STRING, "value4"); + apr_hash_set(base, "base5", APR_HASH_KEY_STRING, "value5"); + + apr_hash_set(overlay, "overlay1", APR_HASH_KEY_STRING, "value1"); + apr_hash_set(overlay, "overlay2", APR_HASH_KEY_STRING, "value2"); + apr_hash_set(overlay, "overlay3", APR_HASH_KEY_STRING, "value3"); + apr_hash_set(overlay, "overlay4", APR_HASH_KEY_STRING, "value4"); + apr_hash_set(overlay, "overlay5", APR_HASH_KEY_STRING, "value5"); + + result = apr_hash_overlay(p, overlay, base); + + count = apr_hash_count(result); + CuAssertIntEquals(tc, 10, count); + + dump_hash(p, result, str); + /* I don't know why these are out of order, but they are. I would probably + * consider this a bug, but others should comment. + */ + CuAssertStrEquals(tc, "Key base5 (5) Value value5\n" + "Key overlay1 (8) Value value1\n" + "Key overlay2 (8) Value value2\n" + "Key overlay3 (8) Value value3\n" + "Key overlay4 (8) Value value4\n" + "Key overlay5 (8) Value value5\n" + "Key base1 (5) Value value1\n" + "Key base2 (5) Value value2\n" + "Key base3 (5) Value value3\n" + "Key base4 (5) Value value4\n" + "#entries 10\n", str); +} + +static void overlay_same(CuTest *tc) +{ + apr_hash_t *base = NULL; + apr_hash_t *result = NULL; + int count; + char str[8196]; + + base = apr_hash_make(p); + CuAssertPtrNotNull(tc, base); + + apr_hash_set(base, "base1", APR_HASH_KEY_STRING, "value1"); + apr_hash_set(base, "base2", APR_HASH_KEY_STRING, "value2"); + apr_hash_set(base, "base3", APR_HASH_KEY_STRING, "value3"); + apr_hash_set(base, "base4", APR_HASH_KEY_STRING, "value4"); + apr_hash_set(base, "base5", APR_HASH_KEY_STRING, "value5"); + + result = apr_hash_overlay(p, base, base); + + count = apr_hash_count(result); + CuAssertIntEquals(tc, 5, count); + + dump_hash(p, result, str); + /* I don't know why these are out of order, but they are. I would probably + * consider this a bug, but others should comment. + */ + CuAssertStrEquals(tc, "Key base5 (5) Value value5\n" + "Key base1 (5) Value value1\n" + "Key base2 (5) Value value2\n" + "Key base3 (5) Value value3\n" + "Key base4 (5) Value value4\n" + "#entries 5\n", str); +} - result = apr_hash_get(h4, "FOO3", APR_HASH_KEY_STRING); - if (strcmp(result, "bar3")) - fprintf(stderr, "ERROR:apr_hash_get FOO3 = %s (should be bar3)\n", - result); - - apr_hash_set(h4, "FOO3", sizeof(int), NULL); - result = apr_hash_get(h4, "FOO3", APR_HASH_KEY_STRING); - if (result) - fprintf(stderr, - "ERROR:apr_hash_get FOO3 = %s (should be NULL, we just deleted it!)\n", - result); - - return 0; +CuSuite *testhash(void) +{ + CuSuite *suite = CuSuiteNew("Hash"); + + SUITE_ADD_TEST(suite, hash_make); + SUITE_ADD_TEST(suite, hash_set); + SUITE_ADD_TEST(suite, hash_reset); + SUITE_ADD_TEST(suite, same_value); + SUITE_ADD_TEST(suite, key_space); + SUITE_ADD_TEST(suite, delete_key); + + SUITE_ADD_TEST(suite, hash_count_0); + SUITE_ADD_TEST(suite, hash_count_1); + SUITE_ADD_TEST(suite, hash_count_5); + + SUITE_ADD_TEST(suite, hash_traverse); + SUITE_ADD_TEST(suite, summation_test); + + SUITE_ADD_TEST(suite, overlay_empty); + SUITE_ADD_TEST(suite, overlay_2unique); + SUITE_ADD_TEST(suite, overlay_same); + + return suite; } + From c0467d23e1b38fe5d5ab97791f6a464d8ab7230d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 6 Dec 2002 11:44:01 +0000 Subject: [PATCH 4102/7878] Add CuAssertSuccess function for giving useful failure messages. (upstream formatting style maintained in CuTest.c, tabs and all) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64121 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 10 ++++++++++ test/CuTest.h | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/test/CuTest.c b/test/CuTest.c index 6b15bcef10c..9e1b3792a59 100644 --- a/test/CuTest.c +++ b/test/CuTest.c @@ -216,6 +216,16 @@ void CuAssertPtrNotNull(CuTest* tc, const void* pointer) CuFail(tc, buf); } +void CuAssertSuccess(CuTest* tc, const char* context, apr_status_t rv) +{ + if (!APR_STATUS_IS_SUCCESS(rv)) { + char buf[STRING_MAX], ebuf[128]; + sprintf(buf, "%s (%d): %s\n", context, rv, + apr_strerror(rv, ebuf, sizeof ebuf)); + CuFail(tc, buf); + } +} + void CuTestRun(CuTest* tc) { jmp_buf buf; diff --git a/test/CuTest.h b/test/CuTest.h index 8d93818bc6f..3ff882c9b9f 100644 --- a/test/CuTest.h +++ b/test/CuTest.h @@ -32,6 +32,8 @@ #ifndef CU_TEST_H #define CU_TEST_H +#include "apr_errno.h" /* for apr_status_t */ + #include #include @@ -89,6 +91,11 @@ void CuAssertStrEquals(CuTest* tc, const char* expected, const char* actual); void CuAssertIntEquals(CuTest* tc, int expected, int actual); void CuAssertPtrEquals(CuTest* tc, const void* expected, const void* actual); void CuAssertPtrNotNull(CuTest* tc, const void* pointer); + +/* Assert that RV is an APR_SUCCESS value; else fail giving strerror + * for RV and CONTEXT message. */ +void CuAssertSuccess(CuTest* tc, const char *context, apr_status_t rv); + void CuTestRun(CuTest* tc); /* CuSuite */ From a755fb8c46f7d66fae6a5150703e92e67fab17c0 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 6 Dec 2002 13:35:36 +0000 Subject: [PATCH 4103/7878] Use CuAssertSuccess for some rv==APR_SUCCESS checks which are currently failing on various platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64122 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 10 +++++----- test/testrand.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/testlock.c b/test/testlock.c index 0a3c92f1945..2dfa2e043f1 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -222,20 +222,20 @@ static void test_thread_rwlock(CuTest *tc) apr_status_t s1, s2, s3, s4; s1 = apr_thread_rwlock_create(&rwlock, p); - CuAssertIntEquals(tc, APR_SUCCESS, s1); + CuAssertSuccess(tc, "rwlock_create", s1); CuAssertPtrNotNull(tc, rwlock); i = 0; x = 0; s1 = apr_thread_create(&t1, NULL, thread_rwlock_func, NULL, p); - CuAssertIntEquals(tc, APR_SUCCESS, s1); + CuAssertSuccess(tc, "create thread 1", s1); s2 = apr_thread_create(&t2, NULL, thread_rwlock_func, NULL, p); - CuAssertIntEquals(tc, APR_SUCCESS, s2); + CuAssertSuccess(tc, "create thread 2", s2); s3 = apr_thread_create(&t3, NULL, thread_rwlock_func, NULL, p); - CuAssertIntEquals(tc, APR_SUCCESS, s3); + CuAssertSuccess(tc, "create thread 3", s3); s4 = apr_thread_create(&t4, NULL, thread_rwlock_func, NULL, p); - CuAssertIntEquals(tc, APR_SUCCESS, s4); + CuAssertSuccess(tc, "create thread 4", s4); apr_thread_join(&s1, t1); apr_thread_join(&s2, t2); diff --git a/test/testrand.c b/test/testrand.c index 235442a06e6..43c1760092a 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -72,7 +72,7 @@ static void rand_exists(CuTest *tc) */ for (i = 1; i <= 8; i++) { rv = apr_generate_random_bytes(c, i * 255); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertSuccess(tc, "apr_generate_random_bytes failed", rv); } #endif } From 4dd90d3c4362b36fdad21371a44e04a1d7672ed5 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 6 Dec 2002 13:50:50 +0000 Subject: [PATCH 4104/7878] Rework set_debug test to work on platforms which allow setting SO_DEBUG as a user (Solaris, HP-UX, ...); just test for set/get consistency of this option. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64123 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsockopt.c | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/test/testsockopt.c b/test/testsockopt.c index 43f71056def..f126454b8ea 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -84,28 +84,19 @@ static void set_keepalive(CuTest *tc) static void set_debug(CuTest *tc) { - apr_status_t rv; + apr_status_t rv1, rv2; apr_int32_t ck; - - rv = apr_socket_opt_set(sock, APR_SO_DEBUG, 1); - /* Grrrr, this is annoying, but APR_SO_DEBUG is only valid if the program - * is running as root. Rather than add all the logic to determine who - * the program is running as, I have just added a simple compile time - * check. - */ -#if RUN_AS_ROOT - CuAssertIntEquals(tc, APR_SUCCESS, rv); -#else - CuAssertIntEquals(tc, 1, APR_STATUS_IS_EACCES(rv)); -#endif - - rv = apr_socket_opt_get(sock, APR_SO_DEBUG, &ck); - CuAssertIntEquals(tc, APR_SUCCESS, rv); -#if RUN_AS_ROOT - CuAssertIntEquals(tc, 1, ck); -#else - CuAssertIntEquals(tc, 0, ck); -#endif + + /* On some platforms APR_SO_DEBUG can only be set as root; just test + * for get/set consistency of this option. */ + rv1 = apr_socket_opt_set(sock, APR_SO_DEBUG, 1); + rv2 = apr_socket_opt_get(sock, APR_SO_DEBUG, &ck); + CuAssertSuccess(tc, "get SO_DEBUG option", rv2); + if (APR_STATUS_IS_SUCCESS(rv1)) { + CuAssertIntEquals(tc, 1, ck); + } else { + CuAssertIntEquals(tc, 0, ck); + } } static void remove_keepalive(CuTest *tc) From 9ca6b3c1a9066fa432c41a780595013884acfa95 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 6 Dec 2002 16:04:58 +0000 Subject: [PATCH 4105/7878] Migreate testargs to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64124 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 8 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testargs.c | 222 ++++++++++++++++++++++++++++++++++++++++------- 4 files changed, 193 insertions(+), 39 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index e34b2a6f339..322be7ec0fb 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -13,12 +13,9 @@ PROGRAMS = \ testnames@EXEEXT@ \ testflock@EXEEXT@ \ testsock@EXEEXT@ \ - testlock@EXEEXT@ \ testlockperf@EXEEXT@ \ - testargs@EXEEXT@ \ testshmproducer@EXEEXT@ \ testshmconsumer@EXEEXT@ \ - testhash@EXEEXT@ \ testuser@EXEEXT@ \ testatomic@EXEEXT@ \ testmutexscope@EXEEXT@ \ @@ -71,9 +68,6 @@ mod_test.la: mod_test.slo $(LOCAL_LIBS) libmod_test.la: mod_test.slo $(LOCAL_LIBS) $(LINK) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ -testargs@EXEEXT@: testargs.lo $(LOCAL_LIBS) - $(LINK) testargs.lo $(LOCAL_LIBS) $(ALL_LIBS) - testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS) $(LINK) testlockperf.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -118,7 +112,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ - testhash.lo + testhash.lo testargs.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/test_apr.h b/test/test_apr.h index 57213e91dcc..5fe444498fb 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -91,5 +91,6 @@ CuSuite *testlock(void); CuSuite *testsockopt(void); CuSuite *testpipe(void); CuSuite *testthread(void); +CuSuite *testgetopt(void); #endif /* APR_TEST_INCLUDES */ diff --git a/test/testall.c b/test/testall.c index feb7bac12b2..cbe5e5540bf 100644 --- a/test/testall.c +++ b/test/testall.c @@ -89,6 +89,7 @@ static const struct testlist { {"testpoll", testpoll}, {"testlock", testlock}, {"testthread", testthread}, + {"testargs", testgetopt}, {"LastTest", NULL} }; diff --git a/test/testargs.c b/test/testargs.c index 1eb96a881e7..34915fdc088 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -52,65 +52,223 @@ * . */ -#include "apr_file_io.h" #include "apr_errno.h" #include "apr_general.h" -#include "apr_lib.h" #include "apr_getopt.h" -#include -#include -#ifdef BEOS -#include -#endif +#include "apr_strings.h" +#include "test_apr.h" -static void maybe_arg(const char *arg) +static void format_arg(char *str, char option, const char *arg) { if (arg) { - printf(" with %s\n", arg); + apr_snprintf(str, 8196, "%soption: %c with %s\n", str, option, arg); } else { - printf("\n"); + apr_snprintf(str, 8196, "%soption: %c\n", str, option); } } -int main(int argc, const char * const argv[]) +static void unknown_arg(void *str, const char *err, ...) +{ + va_list va; + + va_start(va, err); + apr_vsnprintf(str, 8196, err, va); + va_end(va); +} + +static void no_options_found(CuTest *tc) { - apr_pool_t *context; + int largc = 5; + const char * const largv[] = {"testprog", "-a", "-b", "-c", "-d"}; apr_getopt_t *opt; + apr_status_t rv; char data; const char *optarg; + char str[8196]; - apr_initialize(); - atexit(apr_terminate); - apr_pool_create(&context, NULL); - - if (apr_getopt_init(&opt, context, argc, argv)) - { - printf("failed to initialize opts"); - exit(1); + str[0] = '\0'; + rv = apr_getopt_init(&opt, p, largc, largv); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + while (apr_getopt(opt, "abcd", &data, &optarg) == APR_SUCCESS) { + switch (data) { + case 'a': + case 'b': + case 'c': + case 'd': + default: + format_arg(str, data, optarg); + } } - while (apr_getopt(opt, "abc:d::", &data, &optarg) == APR_SUCCESS) { + CuAssertStrEquals(tc, "option: a\n" + "option: b\n" + "option: c\n" + "option: d\n", str); +} + +static void no_options(CuTest *tc) +{ + int largc = 5; + const char * const largv[] = {"testprog", "-a", "-b", "-c", "-d"}; + apr_getopt_t *opt; + apr_status_t rv; + char data; + const char *optarg; + char str[8196]; + + str[0] = '\0'; + rv = apr_getopt_init(&opt, p, largc, largv); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + opt->errfn = unknown_arg; + opt->errarg = str; + + while (apr_getopt(opt, "efgh", &data, &optarg) == APR_SUCCESS) { switch (data) { case 'a': case 'b': - printf("option %c\n", data); - break; case 'c': - printf("option %c with %s\n", data, optarg); - break; case 'd': - printf("option %c", data); - maybe_arg(optarg); + format_arg(str, data, optarg); + break; + default: + break; + } + } + CuAssertStrEquals(tc, "testprog: illegal option -- a\n", str); +} + +static void required_option(CuTest *tc) +{ + int largc = 3; + const char * const largv[] = {"testprog", "-a", "foo"}; + apr_getopt_t *opt; + apr_status_t rv; + char data; + const char *optarg; + char str[8196]; + + str[0] = '\0'; + rv = apr_getopt_init(&opt, p, largc, largv); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + opt->errfn = unknown_arg; + opt->errarg = str; + + while (apr_getopt(opt, "a:", &data, &optarg) == APR_SUCCESS) { + switch (data) { + case 'a': + format_arg(str, data, optarg); break; default: - printf("unknown option: %c", data); - maybe_arg(optarg); break; } } + CuAssertStrEquals(tc, "option: a with foo\n", str); +} + +static void required_option_notgiven(CuTest *tc) +{ + int largc = 2; + const char * const largv[] = {"testprog", "-a"}; + apr_getopt_t *opt; + apr_status_t rv; + char data; + const char *optarg; + char str[8196]; + + str[0] = '\0'; + rv = apr_getopt_init(&opt, p, largc, largv); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + opt->errfn = unknown_arg; + opt->errarg = str; + + while (apr_getopt(opt, "a:", &data, &optarg) == APR_SUCCESS) { + switch (data) { + case 'a': + format_arg(str, data, optarg); + break; + default: + break; + } + } + CuAssertStrEquals(tc, "testprog: option requires an argument -- a\n", str); +} + +static void optional_option(CuTest *tc) +{ + int largc = 3; + const char * const largv[] = {"testprog", "-a", "foo"}; + apr_getopt_t *opt; + apr_status_t rv; + char data; + const char *optarg; + char str[8196]; + + str[0] = '\0'; + rv = apr_getopt_init(&opt, p, largc, largv); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + opt->errfn = unknown_arg; + opt->errarg = str; + + while (apr_getopt(opt, "a::", &data, &optarg) == APR_SUCCESS) { + switch (data) { + case 'a': + format_arg(str, data, optarg); + break; + default: + break; + } + } + CuAssertStrEquals(tc, "option: a with foo\n", str); +} + +static void optional_option_notgiven(CuTest *tc) +{ + int largc = 2; + const char * const largv[] = {"testprog", "-a"}; + apr_getopt_t *opt; + apr_status_t rv; + char data; + const char *optarg; + char str[8196]; + + str[0] = '\0'; + rv = apr_getopt_init(&opt, p, largc, largv); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + opt->errfn = unknown_arg; + opt->errarg = str; + + while (apr_getopt(opt, "a::", &data, &optarg) == APR_SUCCESS) { + switch (data) { + case 'a': + format_arg(str, data, optarg); + break; + default: + break; + } + } +#if 0 +/* Our version of getopt doesn't allow for optional arguments. */ + CuAssertStrEquals(tc, "option: a\n", str); +#endif + CuAssertStrEquals(tc, "testprog: option requires an argument -- a\n", str); +} + +CuSuite *testgetopt(void) +{ + CuSuite *suite = CuSuiteNew("Getopt"); - while (opt->ind < opt->argc) - printf("extra arg: %s\n", opt->argv[opt->ind++]); + SUITE_ADD_TEST(suite, no_options); + SUITE_ADD_TEST(suite, no_options_found); + SUITE_ADD_TEST(suite, required_option); + SUITE_ADD_TEST(suite, required_option_notgiven); + SUITE_ADD_TEST(suite, optional_option); + SUITE_ADD_TEST(suite, optional_option_notgiven); - return 0; + return suite; } From b59e7921dd75101549b4a319baa0e67186c93761 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 6 Dec 2002 16:06:06 +0000 Subject: [PATCH 4106/7878] Remove the apr_thread_once test from testatomic.c. We already test that feature in testthread.c (using the exact same code), so it is just confusing an already complicated test program. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64125 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index 3b13d20624b..694297a4c3c 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -205,7 +205,6 @@ void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data); apr_thread_mutex_t *thread_lock; -apr_thread_once_t *control = NULL; volatile long x = 0; /* mutex locks */ volatile long z = 0; /* no locks */ int value = 0; @@ -213,17 +212,10 @@ apr_status_t exit_ret_val = 123; /* just some made up number to check on later * #define NUM_THREADS 50 #define NUM_ITERATIONS 20000 -static void init_func(void) -{ - value++; -} - void * APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data) { int i; - apr_thread_once(control, init_func); - for (i = 0; i < NUM_ITERATIONS; i++) { apr_thread_mutex_lock(thread_lock); x++; @@ -237,8 +229,6 @@ void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data) { int i; - apr_thread_once(control, init_func); - for (i = 0; i < NUM_ITERATIONS ; i++) { apr_atomic_inc(&y); apr_atomic_add(&y, 2); @@ -253,8 +243,6 @@ void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data) { int i; - apr_thread_once(control, init_func); - for (i = 0; i < NUM_ITERATIONS ; i++) { z++; } @@ -295,8 +283,6 @@ int main(int argc, char**argv) } printf("OK\n"); - apr_thread_once_init(&control, context); - if (mutex == 1) { printf("%-60s", "Initializing the lock"); rv = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, @@ -393,15 +379,6 @@ int main(int argc, char**argv) printf("OK\n"); } - printf("%-60s", "Checking if apr_thread_once worked"); - if (value != 1) { - fflush(stdout); - fprintf(stderr, "Failed!\napr_thread_once must not have worked, " - "value is %d instead of 1\n", value); - exit(-1); - } - printf("OK\n"); - return 0; } From cb09e0079dc2cda2656ed7645b4ea5fc8934ba9d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 6 Dec 2002 16:32:18 +0000 Subject: [PATCH 4107/7878] Move CuAssertSuccess to apr_assert_success, and remove it from the CuTest sources. This keeps the CuTest sources clean of any knowledge about APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64126 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 10 ---------- test/CuTest.h | 4 ---- test/test_apr.h | 5 +++++ test/testall.c | 10 ++++++++++ test/testlock.c | 10 +++++----- test/testrand.c | 2 +- test/testsockopt.c | 2 +- 7 files changed, 22 insertions(+), 21 deletions(-) diff --git a/test/CuTest.c b/test/CuTest.c index 9e1b3792a59..6b15bcef10c 100644 --- a/test/CuTest.c +++ b/test/CuTest.c @@ -216,16 +216,6 @@ void CuAssertPtrNotNull(CuTest* tc, const void* pointer) CuFail(tc, buf); } -void CuAssertSuccess(CuTest* tc, const char* context, apr_status_t rv) -{ - if (!APR_STATUS_IS_SUCCESS(rv)) { - char buf[STRING_MAX], ebuf[128]; - sprintf(buf, "%s (%d): %s\n", context, rv, - apr_strerror(rv, ebuf, sizeof ebuf)); - CuFail(tc, buf); - } -} - void CuTestRun(CuTest* tc) { jmp_buf buf; diff --git a/test/CuTest.h b/test/CuTest.h index 3ff882c9b9f..054a72a2163 100644 --- a/test/CuTest.h +++ b/test/CuTest.h @@ -92,10 +92,6 @@ void CuAssertIntEquals(CuTest* tc, int expected, int actual); void CuAssertPtrEquals(CuTest* tc, const void* expected, const void* actual); void CuAssertPtrNotNull(CuTest* tc, const void* pointer); -/* Assert that RV is an APR_SUCCESS value; else fail giving strerror - * for RV and CONTEXT message. */ -void CuAssertSuccess(CuTest* tc, const char *context, apr_status_t rv); - void CuTestRun(CuTest* tc); /* CuSuite */ diff --git a/test/test_apr.h b/test/test_apr.h index 5fe444498fb..3466775dcdd 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -93,4 +93,9 @@ CuSuite *testpipe(void); CuSuite *testthread(void); CuSuite *testgetopt(void); +/* Assert that RV is an APR_SUCCESS value; else fail giving strerror + * for RV and CONTEXT message. */ +void apr_assert_success(CuTest* tc, const char *context, apr_status_t rv); + + #endif /* APR_TEST_INCLUDES */ diff --git a/test/testall.c b/test/testall.c index cbe5e5540bf..2a3c261f1d9 100644 --- a/test/testall.c +++ b/test/testall.c @@ -60,6 +60,16 @@ /* Top-level pool which can be used by tests. */ apr_pool_t *p; +void apr_assert_success(CuTest* tc, const char* context, apr_status_t rv) +{ + if (!APR_STATUS_IS_SUCCESS(rv)) { + char buf[STRING_MAX], ebuf[128]; + sprintf(buf, "%s (%d): %s\n", context, rv, + apr_strerror(rv, ebuf, sizeof ebuf)); + CuFail(tc, buf); + } +} + static const struct testlist { const char *testname; CuSuite *(*func)(void); diff --git a/test/testlock.c b/test/testlock.c index 2dfa2e043f1..1b5b8f8de81 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -222,20 +222,20 @@ static void test_thread_rwlock(CuTest *tc) apr_status_t s1, s2, s3, s4; s1 = apr_thread_rwlock_create(&rwlock, p); - CuAssertSuccess(tc, "rwlock_create", s1); + apr_assert_success(tc, "rwlock_create", s1); CuAssertPtrNotNull(tc, rwlock); i = 0; x = 0; s1 = apr_thread_create(&t1, NULL, thread_rwlock_func, NULL, p); - CuAssertSuccess(tc, "create thread 1", s1); + apr_assert_success(tc, "create thread 1", s1); s2 = apr_thread_create(&t2, NULL, thread_rwlock_func, NULL, p); - CuAssertSuccess(tc, "create thread 2", s2); + apr_assert_success(tc, "create thread 2", s2); s3 = apr_thread_create(&t3, NULL, thread_rwlock_func, NULL, p); - CuAssertSuccess(tc, "create thread 3", s3); + apr_assert_success(tc, "create thread 3", s3); s4 = apr_thread_create(&t4, NULL, thread_rwlock_func, NULL, p); - CuAssertSuccess(tc, "create thread 4", s4); + apr_assert_success(tc, "create thread 4", s4); apr_thread_join(&s1, t1); apr_thread_join(&s2, t2); diff --git a/test/testrand.c b/test/testrand.c index 43c1760092a..b323be159e5 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -72,7 +72,7 @@ static void rand_exists(CuTest *tc) */ for (i = 1; i <= 8; i++) { rv = apr_generate_random_bytes(c, i * 255); - CuAssertSuccess(tc, "apr_generate_random_bytes failed", rv); + apr_assert_success(tc, "apr_generate_random_bytes failed", rv); } #endif } diff --git a/test/testsockopt.c b/test/testsockopt.c index f126454b8ea..3cf08d729b1 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -91,7 +91,7 @@ static void set_debug(CuTest *tc) * for get/set consistency of this option. */ rv1 = apr_socket_opt_set(sock, APR_SO_DEBUG, 1); rv2 = apr_socket_opt_get(sock, APR_SO_DEBUG, &ck); - CuAssertSuccess(tc, "get SO_DEBUG option", rv2); + apr_assert_success(tc, "get SO_DEBUG option", rv2); if (APR_STATUS_IS_SUCCESS(rv1)) { CuAssertIntEquals(tc, 1, ck); } else { From 4656b6d6ecd61a93c33a1dd7dcf35c8500f3acfa Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 6 Dec 2002 17:19:17 +0000 Subject: [PATCH 4108/7878] Testatomic needs to be run on all platforms. Adding a platform specific check to the test doesn't help us find problems. If the test fails, that is important information to have. Also, get the test to run on platforms without threads, it used to segfault. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64127 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index 694297a4c3c..4a3298eeee0 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -68,15 +68,6 @@ #include #endif -#if defined(__FreeBSD__) && (__FreeBSD__ < 5) - -int main(void) -{ - printf("atomic test skipped\n"); -} - -#else - apr_pool_t *context; apr_atomic_t y; /* atomic locks */ @@ -178,6 +169,8 @@ int main(void) { apr_status_t rv; + apr_initialize(); + fprintf(stderr, "This program won't work fully on this platform because there is no " "support for threads.\n"); @@ -383,4 +376,3 @@ int main(int argc, char**argv) } #endif /* !APR_HAS_THREADS */ -#endif /* !(defined(__FreeBSD) && (__FreeBSD__ < 4)) */ From f033c0f4478ae435b8aa7356a242eac0493c4750 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 7 Dec 2002 02:59:20 +0000 Subject: [PATCH 4109/7878] Migrate testnames to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64128 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 6 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testnames.c | 223 ++++++++++++++++++++++++++++++++--------------- 4 files changed, 156 insertions(+), 75 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 322be7ec0fb..87f5122cd9e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -10,7 +10,6 @@ PROGRAMS = \ client@EXEEXT@ \ sendfile@EXEEXT@ \ server@EXEEXT@ \ - testnames@EXEEXT@ \ testflock@EXEEXT@ \ testsock@EXEEXT@ \ testlockperf@EXEEXT@ \ @@ -46,9 +45,6 @@ check: $(PROGRAMS) $(NONPORTABLE) fi \ done -testnames@EXEEXT@: testnames.lo $(LOCAL_LIBS) - $(LINK) testnames.lo $(LOCAL_LIBS) $(ALL_LIBS) - testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS) $(LINK) testflock.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -112,7 +108,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ - testhash.lo testargs.lo + testhash.lo testargs.lo testnames.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/test_apr.h b/test/test_apr.h index 3466775dcdd..d59b6d9fe83 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -92,6 +92,7 @@ CuSuite *testsockopt(void); CuSuite *testpipe(void); CuSuite *testthread(void); CuSuite *testgetopt(void); +CuSuite *testnames(void); /* Assert that RV is an APR_SUCCESS value; else fail giving strerror * for RV and CONTEXT message. */ diff --git a/test/testall.c b/test/testall.c index 2a3c261f1d9..8d0554b564f 100644 --- a/test/testall.c +++ b/test/testall.c @@ -100,6 +100,7 @@ static const struct testlist { {"testlock", testlock}, {"testthread", testthread}, {"testargs", testgetopt}, + {"testnames", testnames}, {"LastTest", NULL} }; diff --git a/test/testnames.c b/test/testnames.c index 23f8ef929db..6ee9b80d0af 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -52,9 +52,7 @@ * . */ -#include -#include -#include +#include "test_apr.h" #include "apr_file_io.h" #include "apr_file_info.h" #include "apr_errno.h" @@ -62,87 +60,172 @@ #include "apr_pools.h" #include "apr_lib.h" -apr_pool_t *context; +static void merge_aboveroot(CuTest *tc) +{ + apr_status_t rv; + char *dstpath = NULL; + char errmsg[256]; + + rv = apr_filepath_merge(&dstpath, "/foo", "/bar", APR_FILEPATH_NOTABOVEROOT, + p); + apr_strerror(rv, errmsg, sizeof(errmsg)); + CuAssertPtrEquals(tc, NULL, dstpath); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_EABOVEROOT(rv)); + CuAssertStrEquals(tc, "The given path was above the root path", errmsg); +} -static void closeapr(void) +static void merge_belowroot(CuTest *tc) { - apr_pool_destroy(context); - apr_terminate(); + apr_status_t rv; + char *dstpath = NULL; + + rv = apr_filepath_merge(&dstpath, "/foo", "/foo/bar", + APR_FILEPATH_NOTABOVEROOT, p); + CuAssertPtrNotNull(tc, dstpath); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, "/foo/bar", dstpath); } -static void root_result(const char *path) +static void merge_noflag(CuTest *tc) { - apr_status_t status; + apr_status_t rv; + char *dstpath = NULL; + + rv = apr_filepath_merge(&dstpath, "/foo", "/foo/bar", 0, p); + CuAssertPtrNotNull(tc, dstpath); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, "/foo/bar", dstpath); +} + +static void merge_dotdot(CuTest *tc) +{ + apr_status_t rv; + char *dstpath = NULL; + + rv = apr_filepath_merge(&dstpath, "/foo/bar", "../baz", 0, p); + CuAssertPtrNotNull(tc, dstpath); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, "/foo/baz", dstpath); +} + +static void merge_secure(CuTest *tc) +{ + apr_status_t rv; + char *dstpath = NULL; + + rv = apr_filepath_merge(&dstpath, "/foo/bar", "../bar/baz", 0, p); + CuAssertPtrNotNull(tc, dstpath); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, "/foo/bar/baz", dstpath); +} + +static void merge_notrel(CuTest *tc) +{ + apr_status_t rv; + char *dstpath = NULL; + + rv = apr_filepath_merge(&dstpath, "/foo/bar", "../baz", + APR_FILEPATH_NOTRELATIVE, p); + CuAssertPtrNotNull(tc, dstpath); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, "/foo/baz", dstpath); +} + +static void merge_notrelfail(CuTest *tc) +{ + apr_status_t rv; + char *dstpath = NULL; char errmsg[256]; - const char *root = NULL; - status = apr_filepath_root(&root, &path, APR_FILEPATH_NATIVE, context); - apr_strerror(status, errmsg, sizeof(errmsg)); - if (root) - fprintf(stderr, "\tRoot \"%s\" Path \"%s\" (%s)\n", - root, path, errmsg); - else - fprintf(stderr, "\tPath \"%s\" Error (%s)\n", - path, errmsg); + rv = apr_filepath_merge(&dstpath, "foo/bar", "../baz", + APR_FILEPATH_NOTRELATIVE, p); + apr_strerror(rv, errmsg, sizeof(errmsg)); + + CuAssertPtrEquals(tc, NULL, dstpath); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_ERELATIVE(rv)); + CuAssertStrEquals(tc, "The given path is relative", errmsg); } -static void mergeresult(char *rootpath, char *addpath, apr_int32_t mergetype, char *tdesc) +static void merge_notabsfail(CuTest *tc) { + apr_status_t rv; + char *dstpath = NULL; char errmsg[256]; + + rv = apr_filepath_merge(&dstpath, "/foo/bar", "../baz", + APR_FILEPATH_NOTABSOLUTE, p); + apr_strerror(rv, errmsg, sizeof(errmsg)); + + CuAssertPtrEquals(tc, NULL, dstpath); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_EABSOLUTE(rv)); + CuAssertStrEquals(tc, "The given path is absolute", errmsg); +} + +static void merge_notabs(CuTest *tc) +{ + apr_status_t rv; char *dstpath = NULL; - apr_status_t status = apr_filepath_merge(&dstpath, - strcmp(rootpath, "NULL") ? rootpath : NULL, - strcmp(addpath, "NULL") ? addpath : NULL, - mergetype, context); - apr_strerror(status, errmsg, sizeof(errmsg)); - if (dstpath) { - fprintf(stderr, "%s result for %s\n\tResult Path \"%s\"\n", errmsg, tdesc, dstpath); - } - else { - fprintf(stderr, "%s result for %s\n", errmsg, tdesc); - } + + rv = apr_filepath_merge(&dstpath, "foo/bar", "../baz", + APR_FILEPATH_NOTABSOLUTE, p); + + CuAssertPtrNotNull(tc, dstpath); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, "foo/baz", dstpath); +} + +static void root_absolute(CuTest *tc) +{ + apr_status_t rv; + const char *root = NULL; + const char *path = "/foo/bar"; + + rv = apr_filepath_root(&root, &path, 0, p); + + CuAssertPtrNotNull(tc, root); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, "/", root); +} + +static void root_relative(CuTest *tc) +{ + apr_status_t rv; + const char *root = NULL; + const char *path = "foo/bar"; + char errmsg[256]; + + rv = apr_filepath_root(&root, &path, 0, p); + apr_strerror(rv, errmsg, sizeof(errmsg)); + + CuAssertPtrEquals(tc, NULL, root); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_ERELATIVE(rv)); + CuAssertStrEquals(tc, "The given path is relative", errmsg); } -#define merge_result(r, a, t) mergeresult(r, a, t, #t) -int main(void) +#if 0 + root_result(rootpath); + root_result(addpath); +} +#endif + +CuSuite *testnames(void) { - char rootpath[256]; - char addpath[256]; - char *eos; - - if (apr_initialize() != APR_SUCCESS) { - fprintf(stderr, "Couldn't initialize."); - exit(-1); - } - atexit(closeapr); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - fprintf(stderr, "Couldn't allocate context."); - exit(-1); - } - - fprintf(stdout, "Testing file truepath.\n"); - - while (1) { - fprintf(stdout, "\nEnter a root path$ "); - if (!fgets(rootpath, 256, stdin)) - exit(0); - for (eos = strchr(rootpath, '\0'); --eos >= rootpath; ) - if (apr_isspace(*eos)) - *eos = '\0'; - fprintf(stdout, "Enter an add path$ "); - if (!fgets(addpath, 256, stdin)) - exit(0); - for (eos = strchr(addpath, '\0'); --eos >= addpath; ) - if (apr_isspace(*eos)) - *eos = '\0'; - merge_result(rootpath, addpath, 0); - merge_result(rootpath, addpath, APR_FILEPATH_NOTABOVEROOT); - merge_result(rootpath, addpath, APR_FILEPATH_SECUREROOT); - merge_result(rootpath, addpath, APR_FILEPATH_NOTABSOLUTE); - merge_result(rootpath, addpath, APR_FILEPATH_NOTRELATIVE); - root_result(rootpath); - root_result(addpath); - } - return (0); + CuSuite *suite = CuSuiteNew("Path names"); + + SUITE_ADD_TEST(suite, merge_aboveroot); + SUITE_ADD_TEST(suite, merge_belowroot); + SUITE_ADD_TEST(suite, merge_noflag); + SUITE_ADD_TEST(suite, merge_dotdot); + SUITE_ADD_TEST(suite, merge_secure); + SUITE_ADD_TEST(suite, merge_notrel); + SUITE_ADD_TEST(suite, merge_notrelfail); + SUITE_ADD_TEST(suite, merge_notabs); + SUITE_ADD_TEST(suite, merge_notabsfail); + + SUITE_ADD_TEST(suite, root_absolute); + SUITE_ADD_TEST(suite, root_relative); + + return suite; } + From a9a473f813fdae6c9d464481859d2935d3a58ac4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 7 Dec 2002 03:49:21 +0000 Subject: [PATCH 4110/7878] Migrate testuser to the new test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64129 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 6 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testuser.c | 172 +++++++++++++++++++++-------------------------- 4 files changed, 80 insertions(+), 100 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 87f5122cd9e..ea617a50de5 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -15,7 +15,6 @@ PROGRAMS = \ testlockperf@EXEEXT@ \ testshmproducer@EXEEXT@ \ testshmconsumer@EXEEXT@ \ - testuser@EXEEXT@ \ testatomic@EXEEXT@ \ testmutexscope@EXEEXT@ \ testall@EXEEXT@ @@ -88,9 +87,6 @@ testshmproducer@EXEEXT@: testshmproducer.lo $(LOCAL_LIBS) testshmconsumer@EXEEXT@: testshmconsumer.lo $(LOCAL_LIBS) $(LINK) testshmconsumer.lo $(LOCAL_LIBS) $(ALL_LIBS) -testuser@EXEEXT@: testuser.lo $(LOCAL_LIBS) - $(LINK) testuser.lo $(LOCAL_LIBS) $(ALL_LIBS) - testprocmutex@EXEEXT@: testprocmutex.lo $(LOCAL_LIBS) $(LINK) testprocmutex.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -108,7 +104,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ - testhash.lo testargs.lo testnames.lo + testhash.lo testargs.lo testnames.lo testuser.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/test_apr.h b/test/test_apr.h index d59b6d9fe83..d205aba36a1 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -93,6 +93,7 @@ CuSuite *testpipe(void); CuSuite *testthread(void); CuSuite *testgetopt(void); CuSuite *testnames(void); +CuSuite *testuser(void); /* Assert that RV is an APR_SUCCESS value; else fail giving strerror * for RV and CONTEXT message. */ diff --git a/test/testall.c b/test/testall.c index 8d0554b564f..5b7ab18793a 100644 --- a/test/testall.c +++ b/test/testall.c @@ -101,6 +101,7 @@ static const struct testlist { {"testthread", testthread}, {"testargs", testgetopt}, {"testnames", testnames}, + {"testuser", testuser}, {"LastTest", NULL} }; diff --git a/test/testuser.c b/test/testuser.c index a08719a9ad8..d48699eebfc 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -52,107 +52,89 @@ * . */ -#include -#include - +#include "test_apr.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_user.h" -#if !APR_HAS_USER -int main(void) +#if APR_HAS_USER +static void uid_current(CuTest *tc) { - fprintf(stderr, - "This program won't work on this platform because !APR_HAS_USER.\n"); - return 0; + apr_uid_t uid = -1; + apr_gid_t gid = -1; + apr_status_t rv; + + rv = apr_uid_current(&uid, &gid, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssert(tc, "uid not modified", uid != -1); + CuAssert(tc, "gid not modified", gid != -1); } -#else -int main(int argc, char *argv[]) + +static void username(CuTest *tc) +{ + apr_uid_t uid = -1; + apr_gid_t gid = -1; + apr_uid_t retreived_uid = -1; + apr_gid_t retreived_gid = -1; + apr_status_t rv; + char *uname = NULL; + + rv = apr_uid_current(&uid, &gid, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssert(tc, "uid not modified", uid != -1); + CuAssert(tc, "gid not modified", gid != -1); + + rv = apr_uid_name_get(&uname, uid, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, uname); + + rv = apr_uid_get(&retreived_uid, &retreived_gid, uname, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + CuAssertIntEquals(tc, uid, retreived_uid); + CuAssertIntEquals(tc, gid, retreived_gid); +} + +static void groupname(CuTest *tc) { - apr_pool_t *p; + apr_uid_t uid = -1; + apr_gid_t gid = -1; + apr_gid_t retreived_gid = -1; apr_status_t rv; - char msgbuf[80]; - char *groupname; - char *username; - char *homedir; - apr_uid_t userid; - apr_gid_t groupid, newgroupid; - - if (apr_initialize() != APR_SUCCESS) { - fprintf(stderr, "Something went wrong\n"); - exit(-1); - } - atexit(apr_terminate); - - if (apr_pool_create(&p, NULL) != APR_SUCCESS) { - fprintf(stderr, "Something went wrong\n"); - exit(-1); - } - - if (argc != 2) { - fprintf(stderr, - "optional: %s username\n", - argv[0]); - if ((rv = apr_uid_current(&userid, &groupid, p)) != APR_SUCCESS) { - fprintf(stderr, "apr_uid_current failed: %s\n", - apr_strerror(rv, msgbuf, sizeof(msgbuf))); - exit(-1); - } - apr_uid_name_get(&username, userid, p); - if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_uid_name_get(,,) failed: %s\n", - apr_strerror(rv, msgbuf, sizeof(msgbuf))); - exit(-1); - } - } - else { - username = argv[1]; - - rv = apr_uid_get(&userid, &groupid, username, p); - if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_uid_get(,,%s,) failed: %s\n", - username, - apr_strerror(rv, msgbuf, sizeof(msgbuf))); - exit(-1); - } - } - - rv = apr_gid_name_get(&groupname, groupid, p); - if (rv != APR_SUCCESS) - groupname = "(none)"; - - rv = apr_gid_get(&newgroupid, groupname, p); - if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_gid_get(,%s,) failed: %s\n", - groupname, - apr_strerror(rv, msgbuf, sizeof msgbuf)); - exit(-1); - } - - if (groupid != newgroupid) { - fprintf(stderr, "oops, we got a different result for the " - "group name/id mapping\n"); - /* whoever hits this problem gets to figure out how to - * portably display groupid and newgroupid :) - */ - fprintf(stderr, "group: %s\n", - groupname); - } - - printf("user/group ids for %s: %d/%d\n", - username, - (int)userid, (int)groupid); - - rv = apr_uid_homepath_get(&homedir, username, p); - if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_uid_homepath_get(,%s,) failed: %s\n", - username, - apr_strerror(rv, msgbuf, sizeof(msgbuf))); - exit(-1); - } - printf("home directory for %s (member of %s) is:\n`%s'\n", - username, groupname, homedir); - - return 0; + char *gname = NULL; + + rv = apr_uid_current(&uid, &gid, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssert(tc, "uid not modified", uid != -1); + CuAssert(tc, "gid not modified", gid != -1); + + rv = apr_gid_name_get(&gname, gid, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertPtrNotNull(tc, gname); + + rv = apr_gid_get(&retreived_gid, gname, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + CuAssertIntEquals(tc, gid, retreived_gid); +} +#else +static void threads_not_impl(CuTest *tc) +{ + CuNotImpl(tc, "Users not implemented on this platform"); +} +#endif + +CuSuite *testuser(void) +{ + CuSuite *suite = CuSuiteNew("Users"); + +#if !APR_HAS_USER + SUITE_ADD_TEST(suite, users_not_impl); +#else + SUITE_ADD_TEST(suite, uid_current); + SUITE_ADD_TEST(suite, username); + SUITE_ADD_TEST(suite, groupname); +#endif + + return suite; } -#endif /* APR_HAS_USER */ From 1a1550c1985f6d85e7c8163f4277e623e187ebf4 Mon Sep 17 00:00:00 2001 From: Thom May Date: Sun, 8 Dec 2002 17:16:25 +0000 Subject: [PATCH 4111/7878] PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64130 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 1 + build/Makefile.in | 1 + 2 files changed, 2 insertions(+) diff --git a/.cvsignore b/.cvsignore index e24285d0b0b..68a84710f26 100644 --- a/.cvsignore +++ b/.cvsignore @@ -30,3 +30,4 @@ BuildLog.htm *.sto *.vcproj autom4te.cache +ltcf-c.sh diff --git a/build/Makefile.in b/build/Makefile.in index ee1e6b58d38..f7fff70fca5 100644 --- a/build/Makefile.in +++ b/build/Makefile.in @@ -4,6 +4,7 @@ VPATH = @srcdir@ TARGETS= INCLUDES= DISTCLEAN_TARGETS = rules.mk +EXTRACLEAN_TARGETS = ltcf-c.sh # bring in rules.mk for standard functionality @INCLUDE_RULES@ From dc68dca6d2d8c13ac6e6094b27b26fde57d901a8 Mon Sep 17 00:00:00 2001 From: Thom May Date: Sun, 8 Dec 2002 17:19:22 +0000 Subject: [PATCH 4112/7878] added ltcf-c.sh to build/.cvsignore git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64131 13f79535-47bb-0310-9956-ffa450edef68 --- build/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/build/.cvsignore b/build/.cvsignore index 85433cc343c..fc7683cab08 100644 --- a/build/.cvsignore +++ b/build/.cvsignore @@ -2,6 +2,7 @@ Makefile libtool.m4 ltconfig ltmain.sh +ltcf-c.sh rules.mk LibD LibR From 340f711d4cf416b6b2b9a495ed7c3664ea740b25 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 9 Dec 2002 20:21:18 +0000 Subject: [PATCH 4113/7878] Get rid of somewhat long-standing issue regarding large values of precision causing a buffer to be clobbered in the vformatter function (eg: apr_snprintf) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64132 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ strings/apr_snprintf.c | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index d33aed85434..d98790a185d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR 0.9.2 + + *) Prevent obscenely large values of precision in apr_vformatter + from clobbering a buffer. [Sander Striker, Jim Jagielski] + *) limit the renames performed in apr_rename.pl to the most recent renames. [Thom May] diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index b282f246b0b..aac28bfc6eb 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -321,15 +321,21 @@ static char *apr_gcvt(double number, int ndigit, char *buf, boolean_e altform) * This macro does zero padding so that the precision * requirement is satisfied. The padding is done by * adding '0's to the left of the string that is going - * to be printed. + * to be printed. We don't allow precision to be large + * enough that we continue past the start of s. + * + * NOTE: this makes use of the magic info that s is + * always based on num_buf with a size of NUM_BUF_SIZE. */ #define FIX_PRECISION(adjust, precision, s, s_len) \ - if (adjust) \ - while (s_len < precision) \ + if (adjust) { \ + int p = precision < NUM_BUF_SIZE - 1 ? precision : NUM_BUF_SIZE - 1; \ + while (s_len < p) \ { \ *--s = '0'; \ s_len++; \ - } + } \ + } /* * Macro that does padding. The padding is done by printing @@ -784,10 +790,6 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * Check if a precision was specified - * - * XXX: an unreasonable amount of precision may be specified - * resulting in overflow of num_buf. Currently we - * ignore this possibility. */ if (*fmt == '.') { adjust_precision = YES; From d633f003033fae84289658df822e8f9600434066 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 9 Dec 2002 23:46:20 +0000 Subject: [PATCH 4114/7878] Close a bug identified by Juergen Heckel that we would crash when mod_ssl called apr_os_thread_current() against the 'main' thread we had not created. Also address the possibility that the pool scope is bad for a given apr_thread_t and do *not* dereference the ->td member for apr_os_thread_current(). This patch causes us to 'waste' a system handle for every thread that *apr* does not create, that apr_os_thread_current() is called within. In 99% of situations that is a single handle for the main thread. But there is the possibility of an application creating dozens of it's own threads outside of apr, each of which then call apr_os_thread_current(). The scenario appears so abstract and the complications of this code so obnoxious that this patch has chosen not to address the possibility. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64133 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/thread.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 12c6f257690..4293b1829c4 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -63,7 +63,7 @@ #endif #include "misc.h" -/* Chosen for us in apr_initialize */ +/* Chosen for us by apr_initialize */ DWORD tls_apr_thread = 0; APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, @@ -84,7 +84,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) { attr->detach = on; - return APR_SUCCESS; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) @@ -97,7 +97,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) static void *dummy_worker(void *opaque) { apr_thread_t *thd = (apr_thread_t *)opaque; - TlsSetValue(tls_apr_thread, thd); + TlsSetValue(tls_apr_thread, thd->td); return thd->func(thd, thd->data); } @@ -216,10 +216,25 @@ APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, return apr_pool_userdata_set(data, key, cleanup, thread->pool); } + APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) { - apr_thread_t *thd = (apr_thread_t *)TlsGetValue(tls_apr_thread); - return thd->td; + HANDLE hthread = (HANDLE)TlsGetValue(tls_apr_thread); + HANDLE hproc; + + if (hthread) { + return hthread; + } + + hproc = GetCurrentProcess(); + hthread = GetCurrentThread(); + if (!DuplicateHandle(hproc, hthread, + hproc, &hthread, 0, FALSE, + DUPLICATE_SAME_ACCESS)) { + return NULL; + } + TlsSetValue(tls_apr_thread, hthread); + return hthread; } APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, From c312cdc0a65b02f2a60dbe92321dba4e98f6f87d Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Tue, 10 Dec 2002 05:11:39 +0000 Subject: [PATCH 4115/7878] Add a little comment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64134 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 1 + 1 file changed, 1 insertion(+) diff --git a/apr-config.in b/apr-config.in index e2f879b215c..8ae8649fd43 100644 --- a/apr-config.in +++ b/apr-config.in @@ -180,6 +180,7 @@ while test $# -gt 0; do elif test "$location" = "source"; then flags="$flags -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES" else + # this is for VPATH builds flags="$flags -I$thisdir/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES" fi ;; From d66eff11510a17b6ddadfa1c078d3a96be9e0608 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 10 Dec 2002 08:56:42 +0000 Subject: [PATCH 4116/7878] IIUC, users expect APR_EAGAIN() to respond TRUE if a lock has contention calling apr_file_lock() with APR_FLOCK_NONBLOCK. In that case, we need to include this in our APR_EAGAIN() case list. I suspect OS2 may want the same. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64135 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/flock.c | 5 ----- include/apr_errno.h | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index d57b0923765..991db9037c3 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -66,11 +66,6 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) flags = ((type & APR_FLOCK_NONBLOCK) ? LOCKFILE_FAIL_IMMEDIATELY : 0) + (((type & APR_FLOCK_TYPEMASK) == APR_FLOCK_SHARED) ? 0 : LOCKFILE_EXCLUSIVE_LOCK); - /* XXX on NT 4.0 we get ERROR_LOCK_VIOLATION when we specify - * LOCKFILE_FAIL_IMMEDIATELY and another process is holding - * the lock; something needs to be done so an APR app can - * recognize this as a try-again situation - */ if (apr_os_level >= APR_WIN_NT) { /* Syntax is correct, len is passed for LengthLow and LengthHigh*/ OVERLAPPED offset; diff --git a/include/apr_errno.h b/include/apr_errno.h index ed3fe0540f5..874f9a5071b 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -1014,6 +1014,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + ERROR_NO_PROC_SLOTS \ || (s) == APR_OS_START_SYSERR + ERROR_NESTING_NOT_ALLOWED \ || (s) == APR_OS_START_SYSERR + ERROR_MAX_THRDS_REACHED \ + || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \ || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK) #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ || (s) == APR_OS_START_SYSERR + WSAEINTR) From a6cf2634f997e30c1c303033cf5ee086cbb0df31 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 10 Dec 2002 17:56:54 +0000 Subject: [PATCH 4117/7878] A few NOTICEs for developers modifying code, not 'XXX' developer pointers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64136 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 2 +- tables/apr_tables.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index aac28bfc6eb..af69625d4e6 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -115,7 +115,7 @@ typedef int bool_int; /* * NUM_BUF_SIZE is the size of the buffer used for arithmetic conversions * - * XXX: this is a magic number; do not decrease it + * NOTICE: this is a magic number; do not decrease it */ #define NUM_BUF_SIZE 512 diff --git a/tables/apr_tables.c b/tables/apr_tables.c index ecfaed08fd0..4bc8c35aa50 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -388,8 +388,8 @@ struct apr_table_t { }; /* - * XXX: if you tweak this you should look at is_empty_table() and table_elts() - * in alloc.h + * NOTICE: if you tweak this you should look at is_empty_table() + * and table_elts() in alloc.h */ #ifdef MAKE_TABLE_PROFILE static apr_table_entry_t *table_push(apr_table_t *t) From d99e030b088339b00bf889b28ef454c296f67e01 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 10 Dec 2002 19:59:14 +0000 Subject: [PATCH 4118/7878] These can't be moved to a private header file. They are used by apr-util, which means that they must be public APIs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64137 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 07992004d5b..5e78ff766bd 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -118,9 +118,6 @@ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator); * @param size The size of the mem to allocate (excluding the * memnode structure) */ -/* - * XXX: Move this to a private header file - */ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, apr_size_t size); @@ -129,9 +126,6 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, * @param allocator The allocator to give the mem back to * @param memnode The memory node to return */ -/* - * XXX: Move this to a private header file - */ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, apr_memnode_t *memnode); From 16b9135f48d8d83dbbb6080b7c5b81d75085bf31 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 10 Dec 2002 20:06:50 +0000 Subject: [PATCH 4119/7878] Fix 'make check'. Currently server, client, and sendfile are all tests that should _only_ be run by testsock or by developers by hand. They all rely on having multiple processes that interact in order for the tests to work. Before this fix, 'make check' would always hang when it ran server, because nobody was running client to finish the tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64138 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index ea617a50de5..e4497f16b1e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -7,9 +7,6 @@ NONPORTABLE = \ testglobalmutex@EXEEXT@ PROGRAMS = \ - client@EXEEXT@ \ - sendfile@EXEEXT@ \ - server@EXEEXT@ \ testflock@EXEEXT@ \ testsock@EXEEXT@ \ testlockperf@EXEEXT@ \ @@ -20,7 +17,8 @@ PROGRAMS = \ testall@EXEEXT@ -TARGETS = $(PROGRAMS) $(NONPORTABLE) +TARGETS = $(PROGRAMS) $(NONPORTABLE) client@EXEEXT@ sendfile@EXEEXT@ \ + server@EXEEXT@ # bring in rules.mk for standard functionality @INCLUDE_RULES@ From e19f2a39f2f4c2e2ac3d296e50fda724b22d8703 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 10 Dec 2002 20:08:42 +0000 Subject: [PATCH 4120/7878] Invite others to the party. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64139 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index a66ec6e9edc..1afd6ab3816 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/11/20 19:30:31 $] +Last modified at [$Date: 2002/12/10 20:08:42 $] Release: @@ -37,6 +37,10 @@ RELEASE SHOWSTOPPERS: 1.0 showstopper (not 0.9.x): gstein + * close out the XXX's already! (wrowe: this is "production release" + quality code with that many unanswered questions?) If they aren't + showstoppers, deprecate them to TODO:s. + * complete the efforts started by DougM for cleaner fn naming conventions: see proposed name changes in renames_pending and offer up any additions/vetos/clarifications. From 289fbd26b7e3497ef5c3e4395d7f5a34e1b55c7d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 10 Dec 2002 20:32:40 +0000 Subject: [PATCH 4121/7878] It was raining, now it's sunny. :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64140 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 1afd6ab3816..719900b70a8 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/12/10 20:08:42 $] +Last modified at [$Date: 2002/12/10 20:32:40 $] Release: @@ -37,6 +37,13 @@ RELEASE SHOWSTOPPERS: 1.0 showstopper (not 0.9.x): gstein + * Flush out the test suite and make sure it passes on all platforms. + We currently have about 450 functions in APR and 147 tests. That + means we have a large number of functions that we can't verify are + actually portable. This TODO includes finishing the migration to the + unified test suite, and adding more tests to make the suite + comprehensive. + * close out the XXX's already! (wrowe: this is "production release" quality code with that many unanswered questions?) If they aren't showstoppers, deprecate them to TODO:s. From 10d6887f2da8b2aa464b7822995c514be6dc19f6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 11 Dec 2002 03:02:37 +0000 Subject: [PATCH 4122/7878] Without strftime() on wince, apr_strftime is currently unimplemented. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64141 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/timestr.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/time/win32/timestr.c b/time/win32/timestr.c index c78e6a1d91f..38c53e76dcd 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -155,6 +155,9 @@ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t) return APR_SUCCESS; } + +#ifndef _WIN32_WCE + int win32_strftime_extra(char *s, size_t max, const char *format, const struct tm *tm) { /* If the new format string is bigger than max, the result string won't fit @@ -216,12 +219,18 @@ int win32_strftime_extra(char *s, size_t max, const char *format, } free(new_format); return return_value; - } +} + +#endif + APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, apr_time_exp_t *xt) { +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else struct tm tm; memset(&tm, 0, sizeof tm); tm.tm_sec = xt->tm_sec; @@ -235,4 +244,5 @@ APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, tm.tm_isdst = xt->tm_isdst; (*retsize) = win32_strftime_extra(s, max, format, &tm); return APR_SUCCESS; +#endif } From f7d1a943f46ab2b14acdd8f2606eb222d30f938d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 11 Dec 2002 18:21:40 +0000 Subject: [PATCH 4123/7878] CuTest.h doesn't need apr_errno.h anymore. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64142 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/CuTest.h b/test/CuTest.h index 054a72a2163..638b0283e41 100644 --- a/test/CuTest.h +++ b/test/CuTest.h @@ -32,8 +32,6 @@ #ifndef CU_TEST_H #define CU_TEST_H -#include "apr_errno.h" /* for apr_status_t */ - #include #include From 036ffcac54667fde4d94fa7d26364d2291f7a69b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 11 Dec 2002 19:37:08 +0000 Subject: [PATCH 4124/7878] Don't pass BIND_VERBOSE to shl_load(), else it dumps errors to stderr by default. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64143 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 9168920fd12..1246d9ddb8d 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -119,7 +119,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *pool) { #if defined(DSO_USE_SHL) - shl_t os_handle = shl_load(path, BIND_IMMEDIATE|BIND_VERBOSE|BIND_NOSTART, 0L); + shl_t os_handle = shl_load(path, BIND_IMMEDIATE|BIND_NOSTART, 0L); #elif defined(DSO_USE_DYLD) NSObjectFileImage image; From 30d56d95d79f27d181045b3a9bafe1ee041f1b79 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 11 Dec 2002 19:52:06 +0000 Subject: [PATCH 4125/7878] Add a stub function for apr_dir_make_recursive. This doesn't do anything, but it gets us linking the tests again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64144 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 39e23f6bd7d..a31f57310ec 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -295,6 +295,14 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, + apr_fileperms_t perm, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + + APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool) { #if APR_HAS_UNICODE_FS From bc538818af57c61bcbb0c939768cb6382549becb Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 11 Dec 2002 19:59:06 +0000 Subject: [PATCH 4126/7878] This should have been #if, not #ifdef. D'Oh. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64145 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testdso.c b/test/testdso.c index ef1d4e4138f..1d45a1f0f4f 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -60,7 +60,7 @@ #include "apr_dso.h" #include "apr_strings.h" #include "apr.h" -#ifdef APR_HAVE_UNISTD_H +#if APR_HAVE_UNISTD_H #include #endif From 690d17c045df235250423a1cdb39435d51fdb141 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 11 Dec 2002 20:00:42 +0000 Subject: [PATCH 4127/7878] Get the test suite to compile on Windows finally. This is a hack of a Makefile, but it works for me. At some point, this needs to be made much cleaner. To build the test suite, just use nmake /f Makefile.win testall git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64146 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 13 +++--- test/Makefile.win | 101 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 test/Makefile.win diff --git a/test/CuTest.c b/test/CuTest.c index 6b15bcef10c..2a29d8ecde9 100644 --- a/test/CuTest.c +++ b/test/CuTest.c @@ -34,7 +34,6 @@ #include #include #include -#include #include "CuTest.h" @@ -42,11 +41,15 @@ static int verbose = 0; void CuInit(int argc, char *argv[]) { - int c; + int i; - c = getopt(argc, argv, "v"); - if (c == 'v') { - verbose = 1; + /* Windows doesn't have getopt, so we have to fake it. We can't use + * apr_getopt, because CuTest is meant to be a stand-alone test suite + */ + for (i = 0; i < argc; i++) { + if (!strcmp(argv[i], "-v")) { + verbose = 1; + } } } diff --git a/test/Makefile.win b/test/Makefile.win new file mode 100644 index 00000000000..5e8e3180104 --- /dev/null +++ b/test/Makefile.win @@ -0,0 +1,101 @@ + + +NONPORTABLE = \ + testshm.exe \ + testprocmutex.exe \ + testglobalmutex.exe + +PROGRAMS = \ + testflock.exe \ + testsock.exe \ + testlockperf.exe \ + testshmproducer.exe \ + testshmconsumer.exe \ + testatomic.exe \ + testmutexscope.exe \ + testall.exe + + +TARGETS = $(PROGRAMS) $(NONPORTABLE) client.exe sendfile.exe \ + server.exe + +LOCAL_LIBS=..\LibD\apr.lib + +CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child.exe occhild.exe \ + testprocmutex.exe testglobalmutex.exe testshm.exe + +INCDIR=../include +INCLUDES=/I "$(INCDIR)" + +.c.obj: + cl /nologo /c /MDd /W3 /GX /Zi /Od /DWIN32 /D_DEBUG /D_WINDOWS /DAPR_DECLARE_STATIC $(INCLUDES) $< + +testflock.exe: testflock.obj $(LOCAL_LIBS) + $(LINK) testflock.obj $(LOCAL_LIBS) $(ALL_LIBS) + +occhild.exe: occhild.obj $(LOCAL_LIBS) + $(LINK) occhild.obj $(LOCAL_LIBS) $(ALL_LIBS) + +proc_child.exe: proc_child.obj $(LOCAL_LIBS) + $(LINK) proc_child.obj $(LOCAL_LIBS) $(ALL_LIBS) + +# FIXME: -prefer-pic is only supported with libtool-1.4+ +mod_test.so: $(srcdir)/mod_test.c + $(LIBTOOL) --mode=compile $(COMPILE) -prefer-pic -c $(srcdir)/mod_test.c && touch $@ + +mod_test.la: mod_test.slo $(LOCAL_LIBS) + $(LINK) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.obj $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ + +libmod_test.la: mod_test.slo $(LOCAL_LIBS) + $(LINK) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.obj $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ + +testlockperf.exe: testlockperf.obj $(LOCAL_LIBS) + $(LINK) testlockperf.obj $(LOCAL_LIBS) $(ALL_LIBS) + +testsock.exe: testsock.obj client.exe server.exe sendfile.exe $(LOCAL_LIBS) + $(LINK) testsock.obj $(LOCAL_LIBS) $(ALL_LIBS) + +client.exe: client.obj $(LOCAL_LIBS) + $(LINK) client.obj $(LOCAL_LIBS) $(ALL_LIBS) + +server.exe: server.obj $(LOCAL_LIBS) + $(LINK) server.obj $(LOCAL_LIBS) $(ALL_LIBS) + +sendfile.exe: sendfile.obj $(LOCAL_LIBS) + $(LINK) sendfile.obj $(LOCAL_LIBS) $(ALL_LIBS) + +testshm.exe: testshm.obj $(LOCAL_LIBS) testshmproducer.exe testshmconsumer.exe + $(LINK) testshm.obj $(LOCAL_LIBS) $(ALL_LIBS) + +testshmproducer.exe: testshmproducer.obj $(LOCAL_LIBS) + $(LINK) testshmproducer.obj $(LOCAL_LIBS) $(ALL_LIBS) + +testshmconsumer.exe: testshmconsumer.obj $(LOCAL_LIBS) + $(LINK) testshmconsumer.obj $(LOCAL_LIBS) $(ALL_LIBS) + +testprocmutex.exe: testprocmutex.obj $(LOCAL_LIBS) + $(LINK) testprocmutex.obj $(LOCAL_LIBS) $(ALL_LIBS) + +testglobalmutex.exe: testglobalmutex.obj $(LOCAL_LIBS) + $(LINK) testglobalmutex.obj $(LOCAL_LIBS) $(ALL_LIBS) + +testatomic.exe: testatomic.obj $(LOCAL_LIBS) + $(LINK) testatomic.obj $(LOCAL_LIBS) $(ALL_LIBS) + +testmutexscope.exe: testmutexscope.obj $(LOCAL_LIBS) + $(LINK) testmutexscope.obj $(LOCAL_LIBS) $(ALL_LIBS) + +TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ + testmmap.obj testud.obj testtable.obj testsleep.obj testpools.obj \ + testfmt.obj testfile.obj testdir.obj testfileinfo.obj testrand.obj \ + testdso.obj testoc.obj testdup.obj testsockets.obj testproc.obj \ + testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \ + testhash.obj testargs.obj testnames.obj testuser.obj + +testall: $(TESTS) \ + CuTest.obj $(LOCAL_LIBS) + link /nologo /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ + $(LOCAL_LIBS) kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib + + +# DO NOT REMOVE From 8cb5913df2f39f275fa9e110143df75cbfbb8fc6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 11 Dec 2002 20:38:01 +0000 Subject: [PATCH 4128/7878] Make the file tests more portable. The status checking needs to use our macros, not the values directly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64147 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testfile.c b/test/testfile.c index 29f85d389f6..2f1bdeb1515 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -79,7 +79,7 @@ static void test_open_noreadwrite(CuTest *tc) APR_CREATE | APR_EXCL, APR_UREAD | APR_UWRITE | APR_GREAD, p); CuAssertTrue(tc, rv != APR_SUCCESS); - CuAssertIntEquals(tc, APR_EACCES, rv); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_EACCES(rv)); #if 0 /* I consider this a bug, if we are going to return an error, we shouldn't * allocate the file pointer. But, this would make us fail the text, so @@ -151,7 +151,7 @@ static void test_fileclose(CuTest *tc) CuAssertIntEquals(tc, rv, APR_SUCCESS); /* We just closed the file, so this should fail */ rv = apr_file_read(filetest, &str, &one); - CuAssertIntEquals(tc, APR_EBADF, rv); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_EBADF(rv)); } static void test_file_remove(CuTest *tc) @@ -174,7 +174,7 @@ static void test_open_write(CuTest *tc) rv = apr_file_open(&filetest, FILENAME, APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - CuAssertIntEquals(tc, APR_ENOENT, rv); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_open_writecreate(CuTest *tc) From 41fabf5669e994cd3cf4e23bd31c1faafedfdc37 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 11 Dec 2002 20:43:56 +0000 Subject: [PATCH 4129/7878] Fix a couple of tests that were checking return codes directly instead of using our macros. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64148 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testdup.c b/test/testdup.c index e639c83b186..68a03614073 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -87,7 +87,7 @@ static void test_file_dup(CuTest *tc) rv = apr_file_close(file3); CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, FILENAME, APR_FINFO_NORM, p); - CuAssertIntEquals(tc, APR_ENOENT, rv); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_file_readwrite(CuTest *tc) @@ -131,7 +131,7 @@ static void test_file_readwrite(CuTest *tc) rv = apr_file_close(file3); CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, FILENAME, APR_FINFO_NORM, p); - CuAssertIntEquals(tc, APR_ENOENT, rv); + CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_dup2(CuTest *tc) From f875ce17e54abf061b9ca06bc1f1ff27e2f972d7 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 11 Dec 2002 20:54:35 +0000 Subject: [PATCH 4130/7878] Be more verbose about where the tests failed when we print information about failed and not implemented tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64149 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/CuTest.c b/test/CuTest.c index 2a29d8ecde9..6f2035b6f84 100644 --- a/test/CuTest.c +++ b/test/CuTest.c @@ -309,7 +309,7 @@ void CuSuiteDetails(CuSuite* testSuite, CuString* details) if (testSuite->failCount != 0 && verbose) { - CuStringAppendFormat(details, "Failed tests:\n"); + CuStringAppendFormat(details, "Failed tests in %s:\n", testSuite->name); for (i = 0 ; i < testSuite->count ; ++i) { CuTest* testCase = testSuite->list[i]; @@ -323,7 +323,7 @@ void CuSuiteDetails(CuSuite* testSuite, CuString* details) } if (testSuite->notimplCount != 0 && verbose) { - CuStringAppendFormat(details, "\nNot Implemented tests:\n"); + CuStringAppendFormat(details, "\nNot Implemented tests in %s:\n", testSuite->name); for (i = 0 ; i < testSuite->count ; ++i) { CuTest* testCase = testSuite->list[i]; From 1e91a4e2e259d69f4f9aa763ae7d08793f313d7d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 12 Dec 2002 00:30:38 +0000 Subject: [PATCH 4131/7878] Fix the segfault in testmmap. The first test, create_filename, was failing, which made the second test fail. That meant that there wasn't an open file to MMAP. Many of these tests still fail, but that is another problem. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64150 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmmap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testmmap.c b/test/testmmap.c index 3725f96990a..7d9da05eca7 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -83,7 +83,11 @@ static void create_filename(CuTest *tc) char *oldfileptr; apr_filepath_get(&file1, 0, p); +#ifdef WIN32 + CuAssertTrue(tc, file1[1] == ':'); +#else CuAssertTrue(tc, file1[0] == '/'); +#endif CuAssertTrue(tc, file1[strlen(file1) - 1] != '/'); oldfileptr = file1; From 05897efbe0066442b1a224044909682c3ac2dfa8 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 12 Dec 2002 04:01:11 +0000 Subject: [PATCH 4132/7878] A small optimization. No reason to go through the whole loop once we find what we want git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64151 13f79535-47bb-0310-9956-ffa450edef68 --- test/testall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testall.c b/test/testall.c index 5b7ab18793a..8df8a583941 100644 --- a/test/testall.c +++ b/test/testall.c @@ -133,6 +133,7 @@ int main(int argc, char *argv[]) } CuSuiteListAdd(alltests, tests[j].func()); + break; } } } From a2364a6564f1e5a4a7df411252756f2bd03d424a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 12 Dec 2002 04:01:30 +0000 Subject: [PATCH 4133/7878] Allow testall to be debugged on Windows git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64152 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.win b/test/Makefile.win index 5e8e3180104..c3eabbe6277 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -94,7 +94,7 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testall: $(TESTS) \ CuTest.obj $(LOCAL_LIBS) - link /nologo /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ + link /nologo /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ $(LOCAL_LIBS) kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib From 8c67baf1f3b3b670509338026f59e8afd9bebda0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 12 Dec 2002 04:02:10 +0000 Subject: [PATCH 4134/7878] Force the timeout_read of pipes to fail on Windows. This allows the test suite to run all tests, and this test fails as it stands now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64153 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpipe.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/testpipe.c b/test/testpipe.c index bdd0640f8d5..2fb9bd94b0b 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -115,6 +115,16 @@ static void read_write(CuTest *tc) char *buf; apr_size_t nbytes; +#ifdef WIN32 + /* XXX: THIS IS A HACK + * This test currently fails on Windows, because it never returns from the file_read + * call. Because this stops the test suite from working, I am just making this fail + * automatically on Windows without running the test. When Windows gets this feature, + * this hack should be removed. + */ + CuFail(tc, "Timeouts don't work on pipes on Windows"); +#endif + nbytes = strlen("this is a test"); buf = (char *)apr_palloc(p, nbytes + 1); From 21ab3d02c82793a780d78d94c922967f57fe6b2f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Dec 2002 06:58:54 +0000 Subject: [PATCH 4135/7878] Dueling patches. Replace FirstBill's strcasecmp patch with a patch that specifically looks for excluded characters. Also deal with an anomily I've noticed about the behavior of GetFullPathName on WinXP. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64154 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 175 ++++++++++++++++++++++++--------------- 1 file changed, 109 insertions(+), 66 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 611715d2a05..b1b031d4f94 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -65,6 +65,26 @@ #include "atime.h" #include "misc.h" +/* We have to assure that the file name contains no '*'s, or other + * wildcards when using FindFirstFile to recover the true file name. + */ +static apr_status_t test_safe_name(const char *name) +{ + /* Only accept ':' in the second position of the filename, + * as the drive letter delimiter: + */ + if (apr_isalpha(*name) && (name[1] == ':')) { + name += 2; + } + while (*name) { + if (!IS_FNCHAR(*name) && (*name != '\\') && (*name != '/')) { + return APR_EBADPATH; + } + ++name; + } + return APR_SUCCESS; +} + static apr_status_t free_localheap(void *heap) { LocalFree(heap); return APR_SUCCESS; @@ -503,10 +523,10 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * enough string to handle the longest file name. */ char tmpname[APR_FILE_MAX * 3 + 1]; - const char *name; HANDLE hFind; - if (strchr(fname, '*') || strchr(fname, '?')) - return APR_ENOENT; + if ((rv = test_safe_name(fname)) != APR_SUCCESS) { + return rv; + } hFind = FindFirstFileW(wfname, &FileInfo.w); if (hFind == INVALID_HANDLE_VALUE) return apr_get_os_error(); @@ -515,69 +535,64 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, FileInfo.w.cFileName)) { return APR_ENAMETOOLONG; } - /* If fname does not match the name returned by FindFirstFile - * then fname does not exist and we're done. - */ - name = apr_filepath_name_get(fname); - if (strcasecmp(name, tmpname)) { - return APR_ENOENT; - } filename = apr_pstrdup(pool, tmpname); } } #endif #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI - if ((apr_os_level >= APR_WIN_98) && (!(wanted & APR_FINFO_NAME) || isroot)) { - /* cannot use FindFile on a Win98 root, it returns \* - * GetFileAttributesExA is not available on Win95 - */ - if (!GetFileAttributesExA(fname, GetFileExInfoStandard, - &FileInfo.i)) { - return apr_get_os_error(); - } - } - else if (isroot) { - /* This is Win95 and we are trying to stat a root. Lie. - */ - if (GetDriveType(fname) != DRIVE_UNKNOWN) + char *root = NULL; + char *test = fname; + rv = apr_filepath_root(&root, &test APR_FILEPATH_NATIVE, pool); + isroot = (root && *root && !(*test)); + + if ((apr_os_level >= APR_WIN_98) && (!(wanted & APR_FINFO_NAME) || isroot)) { - finfo->pool = pool; - finfo->filetype = 0; - finfo->mtime = apr_time_now(); - finfo->protection |= APR_WREAD | APR_WEXECUTE | APR_WWRITE; - finfo->protection |= (finfo->protection << prot_scope_group) - | (finfo->protection << prot_scope_user); - finfo->valid |= APR_FINFO_TYPE | APR_FINFO_PROT | APR_FINFO_MTIME - | (wanted & APR_FINFO_LINK); - return (wanted &= ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; + /* cannot use FindFile on a Win98 root, it returns \* + * GetFileAttributesExA is not available on Win95 + */ + if (!GetFileAttributesExA(fname, GetFileExInfoStandard, + &FileInfo.i)) { + return apr_get_os_error(); + } } - else - return APR_FROM_OS_ERROR(ERROR_PATH_NOT_FOUND); - } - else { - /* Guard against bogus wildcards and retrieve by name - * since we want the true name, or are stuck in Win95, - * or are looking for the root of a Win98 drive. - */ - HANDLE hFind; - const char *name; - if (strchr(fname, '*') || strchr(fname, '?')) - return APR_ENOENT; - hFind = FindFirstFileA(fname, &FileInfo.n); - if (hFind == INVALID_HANDLE_VALUE) { - return apr_get_os_error(); - } - FindClose(hFind); - /* If fname does not match the name returned by FindFirstFile - * then fname does not exist and we're done. - */ - name = apr_filepath_name_get(fname); - if (strcasecmp(name, FileInfo.n.cFileName)) { - return APR_ENOENT; + else if (isroot) { + /* This is Win95 and we are trying to stat a root. Lie. + */ + if (GetDriveType(fname) != DRIVE_UNKNOWN) + { + finfo->pool = pool; + finfo->filetype = 0; + finfo->mtime = apr_time_now(); + finfo->protection |= APR_WREAD | APR_WEXECUTE | APR_WWRITE; + finfo->protection |= (finfo->protection << prot_scope_group) + | (finfo->protection << prot_scope_user); + finfo->valid |= APR_FINFO_TYPE | APR_FINFO_PROT + | APR_FINFO_MTIME + | (wanted & APR_FINFO_LINK); + return (wanted &= ~finfo->valid) ? APR_INCOMPLETE + : APR_SUCCESS; + } + else + return APR_FROM_OS_ERROR(ERROR_PATH_NOT_FOUND); + } + else { + /* Guard against bogus wildcards and retrieve by name + * since we want the true name, or are stuck in Win95, + * or are looking for the root of a Win98 drive. + */ + HANDLE hFind; + if ((rv = test_safe_name(fname)) != APR_SUCCESS) { + return rv; + } + hFind = FindFirstFileA(fname, &FileInfo.n); + if (hFind == INVALID_HANDLE_VALUE) { + return apr_get_os_error(); + } + FindClose(hFind); + filename = apr_pstrdup(pool, FileInfo.n.cFileName); } - filename = apr_pstrdup(pool, FileInfo.n.cFileName); } #endif @@ -589,28 +604,56 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * to reliably translate char devices to the path '\\.\device' * so go ask for the full path. */ - IF_WIN_OS_IS_UNICODE + if (apr_os_level >= APR_WIN_NT) { #if APR_HAS_UNICODE_FS apr_wchar_t tmpname[APR_FILE_MAX]; - apr_wchar_t *tmpoff; + apr_wchar_t *tmpoff = NULL; if (GetFullPathNameW(wfname, sizeof(tmpname) / sizeof(apr_wchar_t), tmpname, &tmpoff)) { - if ((tmpoff == tmpname + 4) - && !wcsncmp(tmpname, L"\\\\.\\", 4)) - finfo->filetype = APR_CHR; - } + if (!wcsncmp(tmpname, L"\\\\.\\", 4)) { #else + /* Same initial logic as above, but + * only for WinNT/non-UTF-8 builds of APR: + */ char tmpname[APR_FILE_MAX]; char *tmpoff; if (GetFullPathName(fname, sizeof(tmpname), tmpname, &tmpoff)) { - if ((tmpoff == tmpname + 4) - && !strncmp(tmpname, "\\\\.\\", 4)) - finfo->filetype = APR_CHR; - } + if (!strncmp(tmpname, "\\\\.\\", 4)) { #endif + if (tmpoff == tmpname + 4) { + finfo->filetype = APR_CHR; + } + /* For WHATEVER reason, CHR devices such as \\.\con + * or \\.\lpt1 *may*not* update tmpoff; in fact the + * resulting tmpoff is set to NULL. Guard against + * either case. + * + * This code is identical for wide and narrow chars... + */ + else if (!tmpoff) { + tmpoff = tmpname + 4; + while (*tmpoff) { + if (*tmpoff == '\\' || *tmpoff == '/') { + break; + } + ++tmpoff; + } + if (!*tmpoff) { + finfo->filetype = APR_CHR; + } + } + } + } + else { + finfo->valid &= ~APR_FINFO_TYPE; + } + + } + else { + finfo->valid &= ~APR_FINFO_TYPE; } } finfo->pool = pool; From 934846622e397c2007e2ab78828e19aa5837dba0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Dec 2002 06:59:48 +0000 Subject: [PATCH 4136/7878] Resolve an XXX question about Win64 behavior git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64155 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 51ebd0a131e..04726173566 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -415,13 +415,20 @@ typedef int gid_t; #define APR_DECLARE_DATA __declspec(dllimport) #endif +#ifdef WIN64 +#define APR_SSIZE_T_FMT "I64d" +#define APR_SIZE_T_FMT "I64d" +#else #define APR_SSIZE_T_FMT "d" - #define APR_SIZE_T_FMT "d" +#endif +#if APR_HAS_LARGE_FILES #define APR_OFF_T_FMT "I64d" +#else +#define APR_OFF_T_FMT "d" +#endif -/* XXX: Win64 portability problem? */ #define APR_PID_T_FMT "d" #define APR_INT64_T_FMT "I64d" From e0a7fad370772bb31b3dc55603039828f6f91d51 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Dec 2002 07:00:05 +0000 Subject: [PATCH 4137/7878] Ick... an XXX where we didn't want one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64156 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_want.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_want.h b/include/apr_want.h index 5d62846b1ab..1c403f8d0fb 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -55,7 +55,7 @@ #include "apr.h" /* configuration data */ /** * @file apr_want.h - * @brief APR_WANT_XXX documentation + * @brief APR_WANT_HEADERS documentation * *
      * Features:
    
    From e1d28939f7fd61392582c9945bc09e7fa2239f3f Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 12 Dec 2002 07:01:51 +0000
    Subject: [PATCH 4138/7878]   switch {case} and default: are probably better
     for handling this case.   Is anyone aware of a platform where S_IFxxx # isn't
     available, yet   S_ISxxx(#) is?
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64157 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/filestat.c | 38 +++++++++++++++++++++-----------------
     1 file changed, 21 insertions(+), 17 deletions(-)
    
    diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c
    index 7c82b4b37b4..9eafe611598 100644
    --- a/file_io/unix/filestat.c
    +++ b/file_io/unix/filestat.c
    @@ -60,24 +60,28 @@
     
     static apr_filetype_e filetype_from_mode(mode_t mode)
     {
    -    apr_filetype_e type = APR_NOFILE;
    -
    -    if (S_ISREG(mode))
    -        type = APR_REG;
    -    if (S_ISDIR(mode))
    -        type = APR_DIR;
    -    if (S_ISCHR(mode))
    -        type = APR_CHR;
    -    if (S_ISBLK(mode))
    -        type = APR_BLK;
    -    if (S_ISFIFO(mode))
    -        type = APR_PIPE;
    -    if (S_ISLNK(mode))
    -        type = APR_LNK;
    -#if !defined(BEOS) && defined(S_ISSOCK)
    -    if (S_ISSOCK(mode))
    -        type = APR_SOCK;
    +    apr_filetype_e type;
    +
    +    switch (type & S_IFMT) {
    +    case S_IFREG:
    +        type = APR_REG;  break;
    +    case S_IFDIR:
    +        type = APR_DIR;  break;
    +    case S_IFLNK:
    +        type = APR_LNK;  break;
    +    case S_IFCHR:
    +        type = APR_CHR;  break;
    +    case S_IFBLK:
    +        type = APR_BLK;  break;
    +    case S_IFFIFO:
    +        type = APR_PIPE; break;
    +#if !defined(BEOS) && defined(S_IFSOCK)
    +    case S_IFSOCK:
    +        type = APR_SOCK; break;
     #endif
    +    default:
    +        type = APR_NOFILE;
    +    }
         return type;
     }
     
    
    From 4c71daeef9c8dd5fa2c9897570b88c2fdd637a62 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 12 Dec 2002 07:02:36 +0000
    Subject: [PATCH 4139/7878]   Comments for legibility.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64158 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filepath.c | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c
    index 63142c28af3..8e0d0ec55e6 100644
    --- a/file_io/win32/filepath.c
    +++ b/file_io/win32/filepath.c
    @@ -155,7 +155,8 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath,
     
         return APR_EINCOMPLETE;
     
    -#else
    +#else /* ndef(NETWARE) */
    +
         char seperator[2] = { (flags & APR_FILEPATH_NATIVE) ? '\\' : '/', 0};
         const char *delim1;
         const char *delim2;
    @@ -361,7 +362,8 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath,
     
         /* Nothing interesting */
         return APR_ERELATIVE;
    -#endif
    +
    +#endif /* ndef(NETWARE) */
     }
     
     
    
    From 05c4c194932549406e4e345b7c4bcc1ca3e6a3a5 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 12 Dec 2002 07:11:54 +0000
    Subject: [PATCH 4140/7878]   Fix rootpath detection for Win9X so we don't go
     stat'ing the volume.   In 95, we lie outright because 95 can't stat a volume.
      This patch   was partially committed in the previous commit.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64159 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filestat.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
    index b1b031d4f94..d8c9b6c7d4d 100644
    --- a/file_io/win32/filestat.c
    +++ b/file_io/win32/filestat.c
    @@ -543,8 +543,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
         ELSE_WIN_OS_IS_ANSI
         {
             char *root = NULL;
    -        char *test = fname;
    -        rv = apr_filepath_root(&root, &test APR_FILEPATH_NATIVE, pool);
    +        const char *test = fname;
    +        rv = apr_filepath_root(&root, &test, APR_FILEPATH_NATIVE, pool);
             isroot = (root && *root && !(*test));
     
             if ((apr_os_level >= APR_WIN_98) && (!(wanted & APR_FINFO_NAME) || isroot))
    
    From e396b045e81ec2fdaed59a5e7c595684168a037d Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 12 Dec 2002 15:41:16 +0000
    Subject: [PATCH 4141/7878]   Since Jeff indicates we trip on FIFO... here
     should be a legitmiate   workaround for those platforms without FIFO support.
      This is still   quite a bit simpler for the mainline cases if you look at
     the extra   work (discounting the potential benefits of optimizing compilers)
       that happens within the S_ISxxx() macros.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64160 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/filestat.c | 16 ++++++++++++++++
     1 file changed, 16 insertions(+)
    
    diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c
    index 9eafe611598..fa165ba5998 100644
    --- a/file_io/unix/filestat.c
    +++ b/file_io/unix/filestat.c
    @@ -73,13 +73,29 @@ static apr_filetype_e filetype_from_mode(mode_t mode)
             type = APR_CHR;  break;
         case S_IFBLK:
             type = APR_BLK;  break;
    +#if defined(S_IFFIFO)
         case S_IFFIFO:
             type = APR_PIPE; break;
    +#endif
     #if !defined(BEOS) && defined(S_IFSOCK)
         case S_IFSOCK:
             type = APR_SOCK; break;
     #endif
    +
         default:
    +	/* Work around missing S_IFxxx values above
    +         * for Linux et al.
    +         */
    +#if !defined(S_IFFIFO) && defined(S_ISFIFO)
    +    	if (S_ISFIFO(type)) {
    +            type = APR_PIPE;
    +	} else
    +#endif
    +#if !defined(BEOS) && !defined(S_IFSOCK) && defined(S_ISSOCK)
    +    	if (S_ISSOCK(type)) {
    +            type = APR_SOCK;
    +	} else
    +#endif
             type = APR_NOFILE;
         }
         return type;
    
    From a5f0c431236936bed53886a8886b6b4ec8084242 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 12 Dec 2002 20:43:14 +0000
    Subject: [PATCH 4142/7878]   Fix of my braindead error, submitted by Karl
     Fogel 
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64161 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/filestat.c | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c
    index fa165ba5998..c2c31ba2eaf 100644
    --- a/file_io/unix/filestat.c
    +++ b/file_io/unix/filestat.c
    @@ -62,7 +62,7 @@ static apr_filetype_e filetype_from_mode(mode_t mode)
     {
         apr_filetype_e type;
     
    -    switch (type & S_IFMT) {
    +    switch (mode & S_IFMT) {
         case S_IFREG:
             type = APR_REG;  break;
         case S_IFDIR:
    @@ -87,12 +87,12 @@ static apr_filetype_e filetype_from_mode(mode_t mode)
              * for Linux et al.
              */
     #if !defined(S_IFFIFO) && defined(S_ISFIFO)
    -    	if (S_ISFIFO(type)) {
    +    	if (S_ISFIFO(mode)) {
                 type = APR_PIPE;
     	} else
     #endif
     #if !defined(BEOS) && !defined(S_IFSOCK) && defined(S_ISSOCK)
    -    	if (S_ISSOCK(type)) {
    +    	if (S_ISSOCK(mode)) {
                 type = APR_SOCK;
     	} else
     #endif
    
    From 7e0860aa84161683717a71da41f879f6413ea74c Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Thu, 12 Dec 2002 23:27:13 +0000
    Subject: [PATCH 4143/7878] Always use overlapped pipes on NT-based machines. 
     This allows pipes to timeout correctly.  Also, add a test case for pipes that
     don't have a timeout.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64162 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/pipe.c | 44 +-------------------------------------------
     test/testpipe.c      | 37 +++++++++++++++++++++++++++----------
     2 files changed, 28 insertions(+), 53 deletions(-)
    
    diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c
    index efc3c83e576..20fe2b49fe2 100644
    --- a/file_io/win32/pipe.c
    +++ b/file_io/win32/pipe.c
    @@ -89,49 +89,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int
     
     APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *p)
     {
    -#ifdef _WIN32_WCE
    -    return APR_ENOTIMPL;
    -#else
    -    SECURITY_ATTRIBUTES sa;
    -
    -    sa.nLength = sizeof(sa);
    -    sa.bInheritHandle = TRUE;
    -    sa.lpSecurityDescriptor = NULL;
    -
    -    (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t));
    -    (*in)->pool = p;
    -    (*in)->fname = NULL;
    -    (*in)->pipe = 1;
    -    (*in)->timeout = -1;
    -    (*in)->ungetchar = -1;
    -    (*in)->eof_hit = 0;
    -    (*in)->filePtr = 0;
    -    (*in)->bufpos = 0;
    -    (*in)->dataRead = 0;
    -    (*in)->direction = 0;
    -
    -    (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t));
    -    (*out)->pool = p;
    -    (*in)->fname = NULL;
    -    (*out)->pipe = 1;
    -    (*out)->timeout = -1;
    -    (*out)->ungetchar = -1;
    -    (*out)->eof_hit = 0;
    -    (*out)->filePtr = 0;
    -    (*out)->bufpos = 0;
    -    (*out)->dataRead = 0;
    -    (*out)->direction = 0;
    -
    -    if (!CreatePipe(&(*in)->filehand, &(*out)->filehand, &sa, 65536)) {
    -        return apr_get_os_error();
    -    }
    -
    -    apr_pool_cleanup_register((*in)->pool, (void *)(*in), file_cleanup,
    -                        apr_pool_cleanup_null);
    -    apr_pool_cleanup_register((*out)->pool, (void *)(*out), file_cleanup,
    -                        apr_pool_cleanup_null);
    -    return APR_SUCCESS;
    -#endif
    +    return apr_create_nt_pipe(in, out, TRUE, TRUE, p);
     }
     
     /* apr_create_nt_pipe()
    diff --git a/test/testpipe.c b/test/testpipe.c
    index 2fb9bd94b0b..d1eaf6096d5 100644
    --- a/test/testpipe.c
    +++ b/test/testpipe.c
    @@ -114,16 +114,6 @@ static void read_write(CuTest *tc)
         apr_status_t rv;
         char *buf;
         apr_size_t nbytes;
    -
    -#ifdef WIN32
    -    /* XXX:   THIS IS A HACK
    -     * This test currently fails on Windows, because it never returns from the file_read
    -     * call.  Because this stops the test suite from working, I am just making this fail
    -     * automatically on Windows without running the test.  When Windows gets this feature,
    -     * this hack should be removed.
    -     */
    -    CuFail(tc, "Timeouts don't work on pipes on Windows");
    -#endif
         
         nbytes = strlen("this is a test");
         buf = (char *)apr_palloc(p, nbytes + 1);
    @@ -141,6 +131,32 @@ static void read_write(CuTest *tc)
         CuAssertIntEquals(tc, 0, nbytes);
     }
     
    +static void read_write_notimeout(CuTest *tc)
    +{
    +    apr_status_t rv;
    +    char *buf = "this is a test";
    +    char *input;
    +    apr_size_t nbytes;
    +    
    +    nbytes = strlen("this is a test");
    +
    +    rv = apr_file_pipe_create(&readp, &writep, p);
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    CuAssertPtrNotNull(tc, readp);
    +    CuAssertPtrNotNull(tc, writep);
    +
    +    rv = apr_file_write(writep, buf, &nbytes);
    +    CuAssertIntEquals(tc, strlen("this is a test"), nbytes);
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +
    +    nbytes = 256;
    +    input = apr_pcalloc(p, nbytes + 1);
    +    rv = apr_file_read(readp, input, &nbytes);
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    CuAssertIntEquals(tc, strlen("this is a test"), nbytes);
    +    CuAssertStrEquals(tc, "this is a test", input);
    +}
    +
     CuSuite *testpipe(void)
     {
         CuSuite *suite = CuSuiteNew("Pipes");
    @@ -149,6 +165,7 @@ CuSuite *testpipe(void)
         SUITE_ADD_TEST(suite, close_pipe);
         SUITE_ADD_TEST(suite, set_timeout);
         SUITE_ADD_TEST(suite, read_write);
    +    SUITE_ADD_TEST(suite, read_write_notimeout);
     
         return suite;
     }
    
    From d7a4f36307e14c01307bc815273dfb6800d9796d Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Fri, 13 Dec 2002 00:40:44 +0000
    Subject: [PATCH 4144/7878] Fix the mmap tests.  We need to use the EOL macro
     for the tests.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64163 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testmmap.c | 11 +++++++----
     1 file changed, 7 insertions(+), 4 deletions(-)
    
    diff --git a/test/testmmap.c b/test/testmmap.c
    index 7d9da05eca7..dd1ae1f9df8 100644
    --- a/test/testmmap.c
    +++ b/test/testmmap.c
    @@ -107,10 +107,11 @@ static void test_file_open(CuTest *tc)
     static void test_get_filesize(CuTest *tc)
     {
         apr_status_t rv;
    +    int fsize = strlen("This is the MMAP data file."APR_EOL_STR);
     
         rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile);
         CuAssertIntEquals(tc, rv, APR_SUCCESS);
    -    CuAssertIntEquals(tc, finfo.size, 28);
    +    CuAssertIntEquals(tc, fsize, finfo.size);
     }
     
     static void test_mmap_create(CuTest *tc)
    @@ -124,10 +125,12 @@ static void test_mmap_create(CuTest *tc)
     
     static void test_mmap_contents(CuTest *tc)
     {
    +    int fsize = strlen("This is the MMAP data file."APR_EOL_STR);
    +    
         CuAssertPtrNotNull(tc, themmap);
         CuAssertPtrNotNull(tc, themmap->mm);
    -    CuAssertIntEquals(tc, themmap->size, 28);
    -    CuAssertStrEquals(tc, themmap->mm, "This is the MMAP data file.\n");
    +    CuAssertIntEquals(tc, fsize, themmap->size);
    +    CuAssertStrEquals(tc, themmap->mm, "This is the MMAP data file."APR_EOL_STR);
     }
     
     static void test_mmap_delete(CuTest *tc)
    @@ -146,7 +149,7 @@ static void test_mmap_offset(CuTest *tc)
     
         CuAssertPtrNotNull(tc, themmap);
         rv = apr_mmap_offset(&addr, themmap, 5);
    -    CuAssertStrEquals(tc, addr, "This is the MMAP data file.\n" + 5);
    +    CuAssertStrEquals(tc, addr, "This is the MMAP data file."APR_EOL_STR + 5);
     }
     #endif
     
    
    From 1ef8c1b9b85ac27f587eff18b9fe5168f8bbc109 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Fri, 13 Dec 2002 03:51:57 +0000
    Subject: [PATCH 4145/7878] Add a clean target to the Windows Makefile
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64164 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.win | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/test/Makefile.win b/test/Makefile.win
    index c3eabbe6277..0ce28b22adb 100644
    --- a/test/Makefile.win
    +++ b/test/Makefile.win
    @@ -21,12 +21,15 @@ TARGETS = $(PROGRAMS) $(NONPORTABLE) client.exe sendfile.exe \
     
     LOCAL_LIBS=..\LibD\apr.lib 
     
    -CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child.exe occhild.exe \
    +CLEAN_TARGETS = mod_test.slo proc_child.exe occhild.exe \
     	        testprocmutex.exe testglobalmutex.exe testshm.exe
     
     INCDIR=../include
     INCLUDES=/I "$(INCDIR)"
     
    +clean:
    +	del $(CLEAN_TARGETS) $(PROGRAMS) *.obj
    +
     .c.obj:
     	cl /nologo /c /MDd /W3 /GX /Zi /Od /DWIN32 /D_DEBUG /D_WINDOWS /DAPR_DECLARE_STATIC $(INCLUDES) $<
     
    
    From 01dc1007b50a1ecd8efeefc1950c042eba2f70c7 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Fri, 13 Dec 2002 19:49:22 +0000
    Subject: [PATCH 4146/7878] Fix some of the testuser tests on Windows.  This
     still fails one test, but we need to use the functions/macros for uid
     comparison, and we can't treat uid's as ints if we want to be portable.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64165 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testuser.c | 32 +++++++++++++-------------------
     1 file changed, 13 insertions(+), 19 deletions(-)
    
    diff --git a/test/testuser.c b/test/testuser.c
    index d48699eebfc..8dc453f8236 100644
    --- a/test/testuser.c
    +++ b/test/testuser.c
    @@ -60,29 +60,25 @@
     #if APR_HAS_USER
     static void uid_current(CuTest *tc)
     {
    -    apr_uid_t uid = -1;
    -    apr_gid_t gid = -1;
    +    apr_uid_t uid;
    +    apr_gid_t gid;
         apr_status_t rv;
     
         rv = apr_uid_current(&uid, &gid, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssert(tc, "uid not modified", uid != -1);
    -    CuAssert(tc, "gid not modified", gid != -1);
     }
     
     static void username(CuTest *tc)
     {
    -    apr_uid_t uid = -1;
    -    apr_gid_t gid = -1;
    -    apr_uid_t retreived_uid = -1;
    -    apr_gid_t retreived_gid = -1;
    +    apr_uid_t uid;
    +    apr_gid_t gid;
    +    apr_uid_t retreived_uid;
    +    apr_gid_t retreived_gid;
         apr_status_t rv;
         char *uname = NULL;
     
         rv = apr_uid_current(&uid, &gid, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssert(tc, "uid not modified", uid != -1);
    -    CuAssert(tc, "gid not modified", gid != -1);
     
         rv = apr_uid_name_get(&uname, uid, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    @@ -91,22 +87,20 @@ static void username(CuTest *tc)
         rv = apr_uid_get(&retreived_uid, &retreived_gid, uname, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
    -    CuAssertIntEquals(tc, uid, retreived_uid);
    -    CuAssertIntEquals(tc, gid, retreived_gid);
    +    CuAssertIntEquals(tc, APR_SUCCESS, apr_uid_compare(uid, retreived_uid));
    +    CuAssertIntEquals(tc, APR_SUCCESS, apr_gid_compare(gid, retreived_gid));
     }
     
     static void groupname(CuTest *tc)
     {
    -    apr_uid_t uid = -1;
    -    apr_gid_t gid = -1;
    -    apr_gid_t retreived_gid = -1;
    +    apr_uid_t uid;
    +    apr_gid_t gid;
    +    apr_gid_t retreived_gid;
         apr_status_t rv;
         char *gname = NULL;
     
         rv = apr_uid_current(&uid, &gid, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssert(tc, "uid not modified", uid != -1);
    -    CuAssert(tc, "gid not modified", gid != -1);
     
         rv = apr_gid_name_get(&gname, gid, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    @@ -115,10 +109,10 @@ static void groupname(CuTest *tc)
         rv = apr_gid_get(&retreived_gid, gname, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
    -    CuAssertIntEquals(tc, gid, retreived_gid);
    +    CuAssertIntEquals(tc, APR_SUCCESS, apr_gid_compare(gid, retreived_gid));
     }
     #else
    -static void threads_not_impl(CuTest *tc)
    +static void users_not_impl(CuTest *tc)
     {
         CuNotImpl(tc, "Users not implemented on this platform");
     }
    
    From 542b8d065d68e9d617de62d987a6c6e48f06be93 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Fri, 13 Dec 2002 22:40:33 +0000
    Subject: [PATCH 4147/7878] Changes to apr_generate_random_bytes: - use
     apr_size_t for buffer size (please check on non-Unix platforms) - rewrite
     DEV_RANDOM implementation to re-open if an EOF is received (rather than go
     into an infinite loop), to cope with the odd /dev/random implementation on
     BSD/OS 4.1. Also don't leak the fd if the read() fails, and fix a warning
     with gcc -Wsign-compare.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64166 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_general.h |  6 +++---
     misc/unix/rand.c      | 38 +++++++++++++++++++++++++-------------
     2 files changed, 28 insertions(+), 16 deletions(-)
    
    diff --git a/include/apr_general.h b/include/apr_general.h
    index c81af684c23..03574e64c72 100644
    --- a/include/apr_general.h
    +++ b/include/apr_general.h
    @@ -262,12 +262,12 @@ APR_DECLARE(void) apr_terminate2(void);
     
     /* TODO: I'm not sure this is the best place to put this prototype...*/
     /**
    - * Generate a string of random bytes.
    + * Generate random bytes.
      * @param buf Random bytes go here
    - * @param length size of the buffer
    + * @param length number of bytes to read
      */
     APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, 
    -                                                    int length);
    +                                                    apr_size_t length);
     
     #endif
     /** @} */
    diff --git a/misc/unix/rand.c b/misc/unix/rand.c
    index 3ecb3726348..727fc33c76e 100644
    --- a/misc/unix/rand.c
    +++ b/misc/unix/rand.c
    @@ -77,27 +77,39 @@
     #if APR_HAS_RANDOM
     
     APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, 
    -                                                    int length) 
    +                                                    apr_size_t length)
     {
     #ifdef DEV_RANDOM
     
    -    int rnd, rc;
    -    apr_size_t got, tot;
    +    int fd = -1;
     
    -    if ((rnd = open(DEV_RANDOM, O_RDONLY)) == -1) 
    -	return errno;
    +    /* On BSD/OS 4.1, /dev/random gives out 8 bytes at a time, then
    +     * gives EOF, so reading 'length' bytes may require opening the
    +     * device several times. */
    +    do {
    +        apr_ssize_t rc;
     
    -    for (tot=0; tot 0);
    +    
    +    close(fd);
     #elif defined(OS2)
         static UCHAR randbyte();
         unsigned int idx;
    
    From ebcceac665bf6c98b487237952001ce1aaec1ba9 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sat, 14 Dec 2002 05:52:56 +0000
    Subject: [PATCH 4148/7878]   Introduce an APR_UNKFILE distinct from APR_NOFILE
     (which was misleading).
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64167 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_file_info.h | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/include/apr_file_info.h b/include/apr_file_info.h
    index 186b9918107..b696b98a101 100644
    --- a/include/apr_file_info.h
    +++ b/include/apr_file_info.h
    @@ -86,7 +86,8 @@ typedef enum {
         APR_BLK,            /**< a block device */
         APR_PIPE,           /**< a FIFO / pipe */
         APR_LNK,            /**< a symbolic link */
    -    APR_SOCK            /**< a [unix domain] socket */
    +    APR_SOCK,           /**< a [unix domain] socket */
    +    APR_UNKFILE = 127   /**< a file of unknown type */
     } apr_filetype_e; 
     
     /**
    
    From a0ac0211ec00679e3bb4d37c6677f324aa67c074 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sat, 14 Dec 2002 05:53:57 +0000
    Subject: [PATCH 4149/7878]   Use the new APR_UNKFILE when appropriate.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64168 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/filestat.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c
    index c2c31ba2eaf..e2487bec2b2 100644
    --- a/file_io/unix/filestat.c
    +++ b/file_io/unix/filestat.c
    @@ -96,7 +96,7 @@ static apr_filetype_e filetype_from_mode(mode_t mode)
                 type = APR_SOCK;
     	} else
     #endif
    -        type = APR_NOFILE;
    +        type = APR_UNKFILE;
         }
         return type;
     }
    
    From 04d3135f9a517a0eba021da2d2686aed14014e1f Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sat, 14 Dec 2002 05:55:03 +0000
    Subject: [PATCH 4150/7878]   Introduce detection of dirent->d_fileno (or
     ->d_ino) and dirent->d_type   and fill out the apr_fileinfo_t members from
     apr_dir_read.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64169 13f79535-47bb-0310-9956-ffa450edef68
    ---
     acconfig.h          |  2 ++
     build/apr_common.m4 | 60 ++++++++++++++++++++++++++++++++++++++++++
     configure.in        |  2 ++
     file_io/unix/dir.c  | 64 ++++++++++++++++++++++++++++++++++++---------
     4 files changed, 116 insertions(+), 12 deletions(-)
    
    diff --git a/acconfig.h b/acconfig.h
    index c0f25434e44..cf48df04dde 100644
    --- a/acconfig.h
    +++ b/acconfig.h
    @@ -7,6 +7,8 @@
     #undef USE_THREADS
     #undef EGD_DEFAULT_SOCKET
     #undef HAVE_isascii
    +#undef DIRENT_INODE
    +#undef DIRENT_TYPE
     
     /* Cross process serialization techniques */
     #undef USE_FLOCK_SERIALIZE
    diff --git a/build/apr_common.m4 b/build/apr_common.m4
    index 963ef9db72d..a084096b1a4 100644
    --- a/build/apr_common.m4
    +++ b/build/apr_common.m4
    @@ -529,6 +529,66 @@ if test "$ac_cv_crypt_r_style" = "struct_crypt_data_gnu_source"; then
     fi
     ])
     
    +dnl
    +dnl APR_CHECK_DIRENT_INODE
    +dnl
    +dnl  Decide if d_fileno or d_ino are available in the dirent
    +dnl  structure on this platform.  Single UNIX Spec says d_ino,
    +dnl  BSD uses d_fileno.  Undef to find the real beast.
    +dnl
    +AC_DEFUN(APR_CHECK_DIRENT_INODE, [
    +AC_CACHE_CHECK([for inode member of struct dirent], apr_cv_dirent_inode, [
    +apr_cv_dirent_inode=no
    +AC_TRY_COMPILE([
    +#include 
    +#include 
    +],[
    +#ifdef d_ino
    +#undef d_ino
    +#endif
    +struct dirent de; de.d_fileno;
    +], apr_cv_dirent_inode=d_fileno)
    +if test "$apr_cv_dirent_inode" = "no"; then
    +AC_TRY_COMPILE([
    +#include 
    +#include 
    +],[
    +#ifdef d_fileno
    +#undef d_fileno
    +#endif
    +struct dirent de; de.d_ino;
    +], apr_cv_dirent_inode=d_ino)
    +fi
    +])
    +if test "$apr_cv_dirent_inode" != "no"; then
    +  AC_DEFINE_UNQUOTED(DIRENT_INODE, $apr_cv_dirent_inode)
    +fi
    +AC_MSG_RESULT($apr_cv_dirent_inode)
    +])
    +
    +dnl
    +dnl APR_CHECK_DIRENT_TYPE
    +dnl
    +dnl  Decide if d_type is available in the dirent structure 
    +dnl  on this platform.  Not part of the Single UNIX Spec.
    +dnl  Note that this is worthless without DT_xxx macros, so
    +dnl  look for one while we are at it.
    +dnl
    +AC_DEFUN(APR_CHECK_DIRENT_TYPE,[
    +AC_CACHE_CHECK([for file type member of struct dirent], apr_cv_dirent_type,[
    +apr_cv_dirent_type=no
    +AC_TRY_COMPILE([
    +#include 
    +#include 
    +],[
    +struct dirent de; de.d_type = DT_REG;
    +], apr_cv_dirent_type=d_type)
    +])
    +if test "$apr_cv_dirent_type" != "no"; then
    +  AC_DEFINE_UNQUOTED(DIRENT_TYPE, $apr_cv_dirent_type) 
    +fi
    +AC_MSG_RESULT($apr_cv_dirent_type)
    +])
     
     dnl the following is a newline, a space, a tab, and a backslash (the
     dnl backslash is used by the shell to skip newlines, but m4 sees it;
    diff --git a/configure.in b/configure.in
    index 2e6562005ea..b5da45b2f7f 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -887,6 +887,8 @@ AC_SUBST(mmap)
     AC_SUBST(have_memmove)
     
     APR_CHECK_SIGWAIT_ONE_ARG
    +APR_CHECK_DIRENT_INODE
    +APR_CHECK_DIRENT_TYPE
     
     dnl ----------------------------- Checks for Any required Headers
     AC_HEADER_STDC
    diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
    index 8160a02be7b..0af39f3ba88 100644
    --- a/file_io/unix/dir.c
    +++ b/file_io/unix/dir.c
    @@ -140,12 +140,42 @@ apr_status_t apr_dir_close(apr_dir_t *thedir)
         return apr_pool_cleanup_run(thedir->pool, thedir, dir_cleanup);
     }
     
    +apr_filetype_e apr_filetype_from_dirent_type(int type)
    +{
    +    switch (type) {
    +    case DT_REG:
    +        return APR_REG;
    +    case DT_DIR:
    +        return APR_DIR;
    +    case DT_LNK:
    +        return APR_LNK;
    +    case DT_CHR:
    +        return APR_CHR;
    +    case DT_BLK:
    +        return APR_BLK;
    +#if defined(DT_FIFO)
    +    case DT_FIFO:
    +        return APR_PIPE;
    +#endif
    +#if !defined(BEOS) && defined(DT_SOCK)
    +    case DT_SOCK:
    +        return APR_SOCK;
    +#endif
    +    default:
    +        return APR_UNKFILE;
    +    }
    +}
    +
    +
     apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
                               apr_dir_t *thedir)
     {
         apr_status_t ret = 0;
    +#ifdef DIRENT_TYPE
    +    apr_filetype_e type;
    +#endif
     #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
    -    && !defined(READDIR_IS_THREAD_SAFE)
    +                    && !defined(READDIR_IS_THREAD_SAFE)
         struct dirent *retent;
     
         ret = readdir_r(thedir->dirstruct, thedir->entry, &retent);
    @@ -179,26 +209,31 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
             return ret;
         }
     
    -    /* What we already know - and restrict the wanted test below to stat
    -     * only if stat will give us what this platform supports, and we can't
    -     * get it from the platform.
    -     * XXX: Optimize here with d_fileno, d_type etc by platform */
    -    wanted &= ~(APR_FINFO_NAME);
    +#ifdef DIRENT_INODE
    +    wanted &= ~APR_FINFO_INODE;
    +#endif
    +#ifdef DIRENT_TYPE
    +    wanted &= ~APR_FINFO_TYPE;
    +#endif
    +
    +    wanted &= ~APR_FINFO_NAME;
    +
         if (wanted)
         {
             char fspec[APR_PATH_MAX];
             int off;
             apr_cpystrn(fspec, thedir->dirname, sizeof(fspec));
             off = strlen(fspec);
    -        if (fspec[off - 1] != '/')
    +        if ((fspec[off - 1] != '/') && (off + 1 < sizeof(fspec)))
                 fspec[off++] = '/';
             apr_cpystrn(fspec + off, thedir->entry->d_name, sizeof(fspec) - off);
             ret = apr_lstat(finfo, fspec, wanted, thedir->pool);
    +        /* We passed a stack name that will disappear */
    +        finfo->fname = NULL;
         }
     
         if (wanted && (ret == APR_SUCCESS || ret == APR_INCOMPLETE)) {
             wanted &= ~finfo->valid;
    -        ret = APR_SUCCESS;
         }
         else {
             /* We don't bail because we fail to stat, when we are only -required-
    @@ -206,13 +241,18 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
              */
             finfo->pool = thedir->pool;
             finfo->valid = 0;
    +#ifdef DIRENT_TYPE
    +        finfo->filetype = apr_type_from_dirent_type(thedir->entry->DIRENT_TYPE);
    +        finfo->valid |= APR_FINFO_TYPE;
    +#endif
    +#ifdef DIRENT_INODE
    +        finfo->inode = thedir->entry->DIRENT_INODE;
    +        finfo->valid |= APR_FINFO_INODE;
    +#endif
         }
     
    -    /* We passed a stack name that is now gone */
    -    finfo->fname = NULL;
    +    finfo->name = apr_pstrdup(thedir->pool, thedir->entry->d_name);
         finfo->valid |= APR_FINFO_NAME;
    -    /* XXX: Optimize here with d_fileno, d_type etc by platform */
    -    finfo->name = thedir->entry->d_name;
     
         if (wanted)
             return APR_INCOMPLETE;
    
    From 173d8eab63534d8f98efc7c9a7880218e505dd45 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sat, 14 Dec 2002 06:04:02 +0000
    Subject: [PATCH 4151/7878]   One cleanup from the redundancy dept of
     redundancy
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64170 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_common.m4 | 2 --
     1 file changed, 2 deletions(-)
    
    diff --git a/build/apr_common.m4 b/build/apr_common.m4
    index a084096b1a4..e78ff12844a 100644
    --- a/build/apr_common.m4
    +++ b/build/apr_common.m4
    @@ -563,7 +563,6 @@ fi
     if test "$apr_cv_dirent_inode" != "no"; then
       AC_DEFINE_UNQUOTED(DIRENT_INODE, $apr_cv_dirent_inode)
     fi
    -AC_MSG_RESULT($apr_cv_dirent_inode)
     ])
     
     dnl
    @@ -587,7 +586,6 @@ struct dirent de; de.d_type = DT_REG;
     if test "$apr_cv_dirent_type" != "no"; then
       AC_DEFINE_UNQUOTED(DIRENT_TYPE, $apr_cv_dirent_type) 
     fi
    -AC_MSG_RESULT($apr_cv_dirent_type)
     ])
     
     dnl the following is a newline, a space, a tab, and a backslash (the
    
    From f655040ff6a21c5d8a96624c52d44e65d457748e Mon Sep 17 00:00:00 2001
    From: Brian Pane 
    Date: Sun, 15 Dec 2002 00:15:06 +0000
    Subject: [PATCH 4152/7878] fix dependency on a nonexistent function, and
     remove an unused variable
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64171 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/dir.c | 5 +----
     1 file changed, 1 insertion(+), 4 deletions(-)
    
    diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
    index 0af39f3ba88..2d23f591cba 100644
    --- a/file_io/unix/dir.c
    +++ b/file_io/unix/dir.c
    @@ -171,9 +171,6 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
                               apr_dir_t *thedir)
     {
         apr_status_t ret = 0;
    -#ifdef DIRENT_TYPE
    -    apr_filetype_e type;
    -#endif
     #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
                         && !defined(READDIR_IS_THREAD_SAFE)
         struct dirent *retent;
    @@ -242,7 +239,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
             finfo->pool = thedir->pool;
             finfo->valid = 0;
     #ifdef DIRENT_TYPE
    -        finfo->filetype = apr_type_from_dirent_type(thedir->entry->DIRENT_TYPE);
    +        finfo->filetype = apr_filetype_from_dirent_type(thedir->entry->DIRENT_TYPE);
             finfo->valid |= APR_FINFO_TYPE;
     #endif
     #ifdef DIRENT_INODE
    
    From f8cfeb2f0591c50a420a2ccc43b9822be3f8fb81 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 15 Dec 2002 02:00:22 +0000
    Subject: [PATCH 4153/7878] Fix a compile break on Solaris, and a warning on
     Linux.  If the function isn't used, it shouldn't be declared.  This should
     probably also be static, but I haven't digested it yet.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64172 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/dir.c | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
    index 2d23f591cba..c38e303b959 100644
    --- a/file_io/unix/dir.c
    +++ b/file_io/unix/dir.c
    @@ -140,6 +140,7 @@ apr_status_t apr_dir_close(apr_dir_t *thedir)
         return apr_pool_cleanup_run(thedir->pool, thedir, dir_cleanup);
     }
     
    +#ifdef DIRENT_TYPE
     apr_filetype_e apr_filetype_from_dirent_type(int type)
     {
         switch (type) {
    @@ -165,7 +166,7 @@ apr_filetype_e apr_filetype_from_dirent_type(int type)
             return APR_UNKFILE;
         }
     }
    -
    +#endif
     
     apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
                               apr_dir_t *thedir)
    
    From c8d04dd2f5632c84c712cfaa58a4a6dd2a7d58e6 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 15 Dec 2002 02:21:42 +0000
    Subject: [PATCH 4154/7878] Some Unix's return EEXIST instead of ENOTEMPTY when
     deleting a non-empty dir.  This fixes the test.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64173 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 874f9a5071b..2194187d269 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -1203,7 +1203,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     /** cross device link */
     #define APR_STATUS_IS_EXDEV(s)           ((s) == APR_EXDEV)
     /** Directory Not Empty */
    -#define APR_STATUS_IS_ENOTEMPTY(s)       ((s) == APR_ENOTEMPTY)
    +#define APR_STATUS_IS_ENOTEMPTY(s)       ((s) == APR_ENOTEMPTY || \
    +                                          (s) == APR_EEXIST)
     
     #endif /* !def OS2 || WIN32 */
     
    
    From 39152611996498e6ea767eeb12fff0400da1fa01 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 15 Dec 2002 03:24:34 +0000
    Subject: [PATCH 4155/7878] Solaris is a bit strange, if there are no more
     entries in the directory, it returns EINVAL.  Since this is against POSIX, we
     hack around the problem here.  EINVAL is possible from other readdir
     implementations, but only if the result buffer is too small. since we control
     the size of that buffer, we should never have that problem.
    
    With this change Solaris passes all directory tests.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64174 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/dir.c | 11 +++++++++++
     1 file changed, 11 insertions(+)
    
    diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
    index c38e303b959..a802717a18d 100644
    --- a/file_io/unix/dir.c
    +++ b/file_io/unix/dir.c
    @@ -183,6 +183,17 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
          */
         if(!ret && thedir->entry != retent)
             ret = APR_ENOENT;
    +
    +    /* Solaris is a bit strange, if there are no more entries in the
    +     * directory, it returns EINVAL.  Since this is against POSIX, we
    +     * hack around the problem here.  EINVAL is possible from other
    +     * readdir implementations, but only if the result buffer is too small.
    +     * since we control the size of that buffer, we should never have
    +     * that problem.
    +     */
    +    if (ret == EINVAL) {
    +        ret = ENOENT;
    +    }
     #else
         /* We're about to call a non-thread-safe readdir() that may
            possibly set `errno', and the logic below actually cares about
    
    From 41abdf7a66261ca96d37cfccca395c91d89a6e21 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 15 Dec 2002 05:17:51 +0000
    Subject: [PATCH 4156/7878]   Untested... but Ryan's assertion was correct,
     this should be static.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64175 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/dir.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
    index a802717a18d..e5773639b78 100644
    --- a/file_io/unix/dir.c
    +++ b/file_io/unix/dir.c
    @@ -141,7 +141,7 @@ apr_status_t apr_dir_close(apr_dir_t *thedir)
     }
     
     #ifdef DIRENT_TYPE
    -apr_filetype_e apr_filetype_from_dirent_type(int type)
    +static apr_filetype_e filetype_from_dirent_type(int type)
     {
         switch (type) {
         case DT_REG:
    @@ -251,7 +251,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
             finfo->pool = thedir->pool;
             finfo->valid = 0;
     #ifdef DIRENT_TYPE
    -        finfo->filetype = apr_filetype_from_dirent_type(thedir->entry->DIRENT_TYPE);
    +        finfo->filetype = filetype_from_dirent_type(thedir->entry->DIRENT_TYPE);
             finfo->valid |= APR_FINFO_TYPE;
     #endif
     #ifdef DIRENT_INODE
    
    From 29c83afc679df71e90d44cfcf3c41d141ec5f798 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 15 Dec 2002 19:01:16 +0000
    Subject: [PATCH 4157/7878] We were leaking file descriptors from the testfile
     program.  That interfered with testpoll on some platforms.  All tests need to
     clean up after themselves.  testfile now finishes without any leaks.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64176 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfile.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++--
     1 file changed, 81 insertions(+), 3 deletions(-)
    
    diff --git a/test/testfile.c b/test/testfile.c
    index 2f1bdeb1515..5e85d5a43c5 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -68,7 +68,6 @@
     #define APR_BUFFERSIZE   4096 /* This should match APR's buffer size. */
     
     
    -static apr_file_t *filetest = NULL;
     
     static void test_open_noreadwrite(CuTest *tc)
     {
    @@ -87,6 +86,7 @@ static void test_open_noreadwrite(CuTest *tc)
          */
         CuAssertPtrEquals(tc, NULL, thefile); 
     #endif
    +    apr_file_close(thefile);
     }
     
     static void test_open_excl(CuTest *tc)
    @@ -106,17 +106,20 @@ static void test_open_excl(CuTest *tc)
          */
         CuAssertPtrEquals(tc, NULL, thefile); 
     #endif
    +    apr_file_close(thefile);
     }
     
     static void test_open_read(CuTest *tc)
     {
         apr_status_t rv;
    +    apr_file_t *filetest = NULL;
     
         rv = apr_file_open(&filetest, FILENAME, 
                            APR_READ, 
                            APR_UREAD | APR_UWRITE | APR_GREAD, p);
         CuAssertIntEquals(tc, rv, APR_SUCCESS);
         CuAssertPtrNotNull(tc, filetest);
    +    apr_file_close(filetest);
     }
     
     static void test_read(CuTest *tc)
    @@ -124,21 +127,35 @@ static void test_read(CuTest *tc)
         apr_status_t rv;
         apr_size_t nbytes = 256;
         char *str = apr_pcalloc(p, nbytes + 1);
    +    apr_file_t *filetest = NULL;
         
    +    rv = apr_file_open(&filetest, FILENAME, 
    +                       APR_READ, 
    +                       APR_UREAD | APR_UWRITE | APR_GREAD, p);
    +
         rv = apr_file_read(filetest, str, &nbytes);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertIntEquals(tc, strlen(TESTSTR), nbytes);
         CuAssertStrEquals(tc, TESTSTR, str);
    +
    +    apr_file_close(filetest);
     }
     
     static void test_filename(CuTest *tc)
     {
         const char *str;
         apr_status_t rv;
    +    apr_file_t *filetest = NULL;
    +    
    +    rv = apr_file_open(&filetest, FILENAME, 
    +                       APR_READ, 
    +                       APR_UREAD | APR_UWRITE | APR_GREAD, p);
     
         rv = apr_file_name_get(&str, filetest);
         CuAssertIntEquals(tc, rv, APR_SUCCESS);
         CuAssertStrEquals(tc, FILENAME, str);
    +
    +    apr_file_close(filetest);
     }
         
     static void test_fileclose(CuTest *tc)
    @@ -146,6 +163,12 @@ static void test_fileclose(CuTest *tc)
         char str;
         apr_status_t rv;
         apr_size_t one = 1;
    +    apr_file_t *filetest = NULL;
    +    
    +    rv = apr_file_open(&filetest, FILENAME, 
    +                       APR_READ, 
    +                       APR_UREAD | APR_UWRITE | APR_GREAD, p);
    +
     
         rv = apr_file_close(filetest);
         CuAssertIntEquals(tc, rv, APR_SUCCESS);
    @@ -157,6 +180,7 @@ static void test_fileclose(CuTest *tc)
     static void test_file_remove(CuTest *tc)
     {
         apr_status_t rv;
    +    apr_file_t *filetest = NULL;
     
         rv = apr_file_remove(FILENAME, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    @@ -169,45 +193,60 @@ static void test_file_remove(CuTest *tc)
     static void test_open_write(CuTest *tc)
     {
         apr_status_t rv;
    +    apr_file_t *filetest = NULL;
     
         filetest = NULL;
         rv = apr_file_open(&filetest, FILENAME, 
                            APR_WRITE, 
                            APR_UREAD | APR_UWRITE | APR_GREAD, p);
         CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv));
    +    apr_file_close(filetest);
     }
     
     static void test_open_writecreate(CuTest *tc)
     {
         apr_status_t rv;
    +    apr_file_t *filetest = NULL;
     
         filetest = NULL;
         rv = apr_file_open(&filetest, FILENAME, 
                            APR_WRITE | APR_CREATE, 
                            APR_UREAD | APR_UWRITE | APR_GREAD, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +
    +    apr_file_close(filetest);
     }
     
     static void test_write(CuTest *tc)
     {
         apr_status_t rv;
         apr_size_t bytes = strlen(TESTSTR);
    +    apr_file_t *filetest = NULL;
    +
    +    rv = apr_file_open(&filetest, FILENAME, 
    +                       APR_WRITE | APR_CREATE, 
    +                       APR_UREAD | APR_UWRITE | APR_GREAD, p);
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
         rv = apr_file_write(filetest, TESTSTR, &bytes);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +
    +    apr_file_close(filetest);
     }
     
     static void test_open_readwrite(CuTest *tc)
     {
         apr_status_t rv;
    +    apr_file_t *filetest = NULL;
     
    -    apr_file_close(filetest);
         filetest = NULL;
         rv = apr_file_open(&filetest, FILENAME, 
                            APR_READ | APR_WRITE, 
                            APR_UREAD | APR_UWRITE | APR_GREAD, p);
         CuAssertIntEquals(tc, rv, APR_SUCCESS);
         CuAssertPtrNotNull(tc, filetest);
    +
    +    apr_file_close(filetest);
     }
     
     static void test_seek(CuTest *tc)
    @@ -216,6 +255,18 @@ static void test_seek(CuTest *tc)
         apr_off_t offset = 5;
         apr_size_t nbytes = 256;
         char *str = apr_pcalloc(p, nbytes + 1);
    +    apr_file_t *filetest = NULL;
    +
    +    rv = apr_file_open(&filetest, FILENAME, 
    +                       APR_READ, 
    +                       APR_UREAD | APR_UWRITE | APR_GREAD, p);
    +
    +    rv = apr_file_read(filetest, str, &nbytes);
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    CuAssertIntEquals(tc, strlen(TESTSTR), nbytes);
    +    CuAssertStrEquals(tc, TESTSTR, str);
    +
    +    memset(str, 0, nbytes + 1);
     
         rv = apr_file_seek(filetest, SEEK_SET, &offset);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    @@ -224,36 +275,63 @@ static void test_seek(CuTest *tc)
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertIntEquals(tc, strlen(TESTSTR) - 5, nbytes);
         CuAssertStrEquals(tc, TESTSTR + 5, str);
    -}                
     
    +    apr_file_close(filetest);
    +}                
     
     static void test_userdata_set(CuTest *tc)
     {
         apr_status_t rv;
    +    apr_file_t *filetest = NULL;
    +
    +    rv = apr_file_open(&filetest, FILENAME, 
    +                       APR_WRITE, 
    +                       APR_UREAD | APR_UWRITE | APR_GREAD, p);
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
         rv = apr_file_data_set(filetest, "This is a test",
                                "test", apr_pool_cleanup_null);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    apr_file_close(filetest);
     }
     
     static void test_userdata_get(CuTest *tc)
     {
         apr_status_t rv;
         char *teststr;
    +    apr_file_t *filetest = NULL;
    +
    +    rv = apr_file_open(&filetest, FILENAME, 
    +                       APR_WRITE, 
    +                       APR_UREAD | APR_UWRITE | APR_GREAD, p);
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +
    +    rv = apr_file_data_set(filetest, "This is a test",
    +                           "test", apr_pool_cleanup_null);
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
         rv = apr_file_data_get((void **)&teststr, "test", filetest);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertStrEquals(tc, "This is a test", teststr);
    +
    +    apr_file_close(filetest);
     }
     
     static void test_userdata_getnokey(CuTest *tc)
     {
         apr_status_t rv;
         char *teststr;
    +    apr_file_t *filetest = NULL;
    +
    +    rv = apr_file_open(&filetest, FILENAME, 
    +                       APR_WRITE, 
    +                       APR_UREAD | APR_UWRITE | APR_GREAD, p);
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
         rv = apr_file_data_get((void **)&teststr, "nokey", filetest);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertPtrEquals(tc, NULL, teststr);
    +    apr_file_close(filetest);
     }
     
     static void test_getc(CuTest *tc)
    
    From 2b19e37d108a1a8d003923d7912f7a39b309ecf2 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 15 Dec 2002 19:03:09 +0000
    Subject: [PATCH 4158/7878] testmmap now cleans up all of its file descriptors
     correctly.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64177 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testmmap.c | 9 +++++++++
     1 file changed, 9 insertions(+)
    
    diff --git a/test/testmmap.c b/test/testmmap.c
    index dd1ae1f9df8..495ea7c5aba 100644
    --- a/test/testmmap.c
    +++ b/test/testmmap.c
    @@ -95,6 +95,14 @@ static void create_filename(CuTest *tc)
         CuAssertTrue(tc, oldfileptr != file1);
     }
     
    +static void test_file_close(CuTest *tc)
    +{
    +    apr_status_t rv;
    +
    +    rv = apr_file_close(thefile);
    +    CuAssertIntEquals(tc, rv, APR_SUCCESS);
    +}
    +   
     static void test_file_open(CuTest *tc)
     {
         apr_status_t rv;
    @@ -165,6 +173,7 @@ CuSuite *testmmap(void)
         SUITE_ADD_TEST(suite, test_mmap_contents);
         SUITE_ADD_TEST(suite, test_mmap_offset);
         SUITE_ADD_TEST(suite, test_mmap_delete);
    +    SUITE_ADD_TEST(suite, test_file_close);
     #else
         SUITE_ADD_TEST(suite, not_implemented);
     #endif
    
    From 2262660b2ee90bc61a81828d33da9b6dc0fdc3e5 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 15 Dec 2002 19:12:10 +0000
    Subject: [PATCH 4159/7878] Make sure testproc cleans up after itself too.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64178 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testall.c  | 1 +
     test/testproc.c | 5 +++++
     2 files changed, 6 insertions(+)
    
    diff --git a/test/testall.c b/test/testall.c
    index 8df8a583941..98ea845b1ed 100644
    --- a/test/testall.c
    +++ b/test/testall.c
    @@ -148,6 +148,7 @@ int main(int argc, char *argv[])
         CuSuiteListRunWithSummary(alltests);
         i = CuSuiteListDetails(alltests, output);
         printf("%s\n", output->buffer);
    +
         return i > 0 ? 1 : 0;
     }
     
    diff --git a/test/testproc.c b/test/testproc.c
    index afe22a8753b..1c231c0099d 100644
    --- a/test/testproc.c
    +++ b/test/testproc.c
    @@ -188,6 +188,11 @@ static void test_file_redir(CuTest *tc)
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertStrEquals(tc, TESTSTR, buf);
     
    +
    +    apr_file_close(testfile);
    +    apr_file_close(testout);
    +    apr_file_close(testerr);
    +
         rv = apr_file_remove("data/stdin", p);;
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         rv = apr_file_remove("data/stdout", p);;
    
    From 951067d01fcfcdfffe08145795c3870f3c005ac9 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 15 Dec 2002 19:19:32 +0000
    Subject: [PATCH 4160/7878] In apr_assert_success, if the return code is
     ENOTIMPL, then make sure that the output is correct.  Also, just test for
     equality with APR_SUCCESS.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64179 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testall.c | 6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/test/testall.c b/test/testall.c
    index 98ea845b1ed..b3aba464bd0 100644
    --- a/test/testall.c
    +++ b/test/testall.c
    @@ -62,7 +62,11 @@ apr_pool_t *p;
     
     void apr_assert_success(CuTest* tc, const char* context, apr_status_t rv)
     {
    -    if (!APR_STATUS_IS_SUCCESS(rv)) {
    +    if (rv == APR_ENOTIMPL) {
    +        CuNotImpl(tc, context);
    +    }
    +
    +    if (rv != APR_SUCCESS) {
             char buf[STRING_MAX], ebuf[128];
             sprintf(buf, "%s (%d): %s\n", context, rv,
                     apr_strerror(rv, ebuf, sizeof ebuf));
    
    From 6bc34b8af1788c08f47e53ccb6cc8714468af03d Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 15 Dec 2002 19:22:10 +0000
    Subject: [PATCH 4161/7878] Use less sockets in the large pollset.  Solaris has
     a default fd limit of 64, and we were hitting it when testpoll was run as a
     part of the test suite.  Tests should clean up after themselves, but if they
     don't, we now have 15 fd's lee-way built-in.
    
    Also, we were seg-faulting if we hit that limit, because some of the
    sockets in the array would be NULL.  Now, we don't seg-fault, although
    we do fail a lot of tests if we hit the limit.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64180 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testpoll.c | 13 ++++++++++++-
     1 file changed, 12 insertions(+), 1 deletion(-)
    
    diff --git a/test/testpoll.c b/test/testpoll.c
    index 2b917eab041..b8d8c5b100b 100644
    --- a/test/testpoll.c
    +++ b/test/testpoll.c
    @@ -61,7 +61,11 @@
     #include "apr_poll.h"
     
     #define SMALL_NUM_SOCKETS 3
    -#define LARGE_NUM_SOCKETS 64
    +/* We can't use 64 here, because some platforms *ahem* Solaris *ahem* have
    + * a default limit of 64 open file descriptors per process.  If we use
    + * 64, the test will fail even though the code is correct.
    + */
    +#define LARGE_NUM_SOCKETS 50
     
     static apr_socket_t *s[LARGE_NUM_SOCKETS];
     static apr_sockaddr_t *sa[LARGE_NUM_SOCKETS];
    @@ -112,6 +116,8 @@ static void send_msg(apr_socket_t **sockarray, apr_sockaddr_t **sas, int which,
         apr_size_t len = 5;
         apr_status_t rv;
     
    +    CuAssertPtrNotNull(tc, sockarray[which]);
    +
         rv = apr_socket_sendto(sockarray[which], sas[which], 0, "hello", &len);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertIntEquals(tc, strlen("hello"), len);
    @@ -125,6 +131,8 @@ static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p,
         apr_sockaddr_t *recsa;
         apr_status_t rv;
     
    +    CuAssertPtrNotNull(tc, sockarray[which]);
    +
         apr_sockaddr_info_get(&recsa, "127.0.0.1", APR_UNSPEC, 7770, 0, p);
     
         rv = apr_socket_recvfrom(recsa, sockarray[which], 0, buffer, &buflen);
    @@ -317,6 +325,9 @@ static void add_sockets_pollset(CuTest *tc)
     
         for (i = 0; i < LARGE_NUM_SOCKETS;i++){
             apr_pollfd_t socket_pollfd;
    +
    +        CuAssertPtrNotNull(tc, s[i]);
    +
             socket_pollfd.desc_type = APR_POLL_SOCKET;
             socket_pollfd.reqevents = APR_POLLIN;
             socket_pollfd.desc.s = s[i];
    
    From d02145d0e77d8d70d735968552d9d04b782a8c99 Mon Sep 17 00:00:00 2001
    From: Branko Cibej 
    Date: Mon, 16 Dec 2002 02:42:19 +0000
    Subject: [PATCH 4162/7878] Update the definition apr_generate_random_bytes to
     match jorton's prototype change of 2002-12-13.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64181 13f79535-47bb-0310-9956-ffa450edef68
    ---
     misc/win32/rand.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/misc/win32/rand.c b/misc/win32/rand.c
    index 68dc2b32d8d..17108c770eb 100644
    --- a/misc/win32/rand.c
    +++ b/misc/win32/rand.c
    @@ -61,7 +61,7 @@
     
     
     APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf,
    -                                                    int length)
    +                                                    apr_size_t length)
     {
         HCRYPTPROV hProv;
         apr_status_t res = APR_SUCCESS;
    
    From 1b6811398c303e9512e208b20871d6593f760ecc Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 17 Dec 2002 01:07:00 +0000
    Subject: [PATCH 4163/7878]   Ryan correctly reminds me I didn't get this
     straight...
    
      Clarify the distinction between APR_NOFILE and APR_UNKFILE.
    
      APR_NOFILE is the traditional 'no type known' or 'not a file'.
    
      APR_UNKFILE is the 'we have a filetype, and can't represent it!'
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64182 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_file_info.h | 25 +++++++++++++++++++++----
     1 file changed, 21 insertions(+), 4 deletions(-)
    
    diff --git a/include/apr_file_info.h b/include/apr_file_info.h
    index b696b98a101..2a6d0802e5e 100644
    --- a/include/apr_file_info.h
    +++ b/include/apr_file_info.h
    @@ -78,8 +78,24 @@ extern "C" {
      * @{
      */
     
    +/* Many applications use the type member to determine the
    + * existance of a file or initialization of the file info,
    + * so the APR_NOFILE value must be distinct from APR_UNKFILE.
    + */
    +
    +/** apr_filetype_e values for the filetype member of the 
    + * apr_file_info_t structure
    + * @warning: Not all of the filetypes below can be determined.
    + * For example, a given platform might not correctly report 
    + * a socket descriptor as APR_SOCK if that type isn't 
    + * well-identified on that platform.  In such cases where
    + * a filetype exists but cannot be described by the recognized
    + * flags below, the filetype will be APR_UNKFILE.  If the
    + * filetype member is not determined, the type will be APR_NOFILE.
    + */
    +
     typedef enum {
    -    APR_NOFILE = 0,     /**< the file exists, but APR doesn't know its type */
    +    APR_NOFILE = 0,     /**< no file type determined */
         APR_REG,            /**< a regular file */
         APR_DIR,            /**< a directory */
         APR_CHR,            /**< a character device */
    @@ -87,7 +103,7 @@ typedef enum {
         APR_PIPE,           /**< a FIFO / pipe */
         APR_LNK,            /**< a symbolic link */
         APR_SOCK,           /**< a [unix domain] socket */
    -    APR_UNKFILE = 127   /**< a file of unknown type */
    +    APR_UNKFILE = 127   /**< a file of some other unknown type */
     } apr_filetype_e; 
     
     /**
    @@ -188,8 +204,9 @@ struct apr_finfo_t {
         apr_int32_t valid;
         /** The access permissions of the file.  Mimics Unix access rights. */
         apr_fileperms_t protection;
    -    /** The type of file.  One of APR_NOFILE, APR_REG, APR_DIR, APR_CHR, 
    -     *  APR_BLK, APR_PIPE, APR_LNK, APR_SOCK 
    +    /** The type of file.  One of APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, 
    +     * APR_LNK or APR_SOCK.  If the type is undetermined, the value is APR_NOFILE.
    +     * If the type cannot be determined, the value is APR_UNKFILE.
          */
         apr_filetype_e filetype;
         /** The user id that owns the file */
    
    From 50a20c230892cc248f93491d728e312fa02805a7 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 17 Dec 2002 01:08:12 +0000
    Subject: [PATCH 4164/7878]   Brad, please review.  Adopt the alternate
     'UNKFILE' if we failed   to S_ISxxx() the file.  Note: might as well drag
     over the unix code,   or better yet, start using the unix filestat if it's
     this tightly   applicable.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64183 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/netware/filestat.c | 14 ++++++++------
     1 file changed, 8 insertions(+), 6 deletions(-)
    
    diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c
    index 7d039cf51b1..ca61c7d9f52 100644
    --- a/file_io/netware/filestat.c
    +++ b/file_io/netware/filestat.c
    @@ -67,18 +67,20 @@ static apr_filetype_e filetype_from_mode(mode_t mode)
     
         if (S_ISREG(mode))
             type = APR_REG;
    -    if (S_ISDIR(mode))
    +    else if (S_ISDIR(mode))
             type = APR_DIR;
    -    if (S_ISCHR(mode))
    +    else if (S_ISCHR(mode))
             type = APR_CHR;
    -    if (S_ISBLK(mode))
    +    else if (S_ISBLK(mode))
             type = APR_BLK;
    -    if (S_ISFIFO(mode))
    +    else if (S_ISFIFO(mode))
             type = APR_PIPE;
    -    if (S_ISLNK(mode))
    +    else if (S_ISLNK(mode))
             type = APR_LNK;
    -    if (S_ISSOCK(mode))
    +    else if (S_ISSOCK(mode))
             type = APR_SOCK;
    +    else
    +        type = APR_UNKFILE;
         return type;
     }
     
    
    From 950ffdacf7641c00c72f111316b92020d98da268 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 17 Dec 2002 01:08:45 +0000
    Subject: [PATCH 4165/7878]   Brian, for your review.  Start catching those
     scenarios which are UNKFILE   rather than NOFILE on OS2.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64184 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/os2/filestat.c | 7 +++++++
     1 file changed, 7 insertions(+)
    
    diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c
    index 6634a182318..7749b35c977 100644
    --- a/file_io/os2/filestat.c
    +++ b/file_io/os2/filestat.c
    @@ -69,6 +69,7 @@ static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus)
             finfo->filetype = APR_DIR;
         else
             finfo->filetype = APR_REG;
    +    /* XXX: No other possible types from FS3? */
     
         finfo->user = 0;
         finfo->group = 0;
    @@ -108,6 +109,12 @@ static apr_status_t handle_type(apr_filetype_e *ftype, HFILE file)
             case 2:
                 *ftype = APR_PIPE;
                 break;
    +
    +        default:
    +            /* Brian, is this correct???
    +             */
    +            *ftype = APR_UNKFILE;
    +            break;
             }
     
             return APR_SUCCESS;
    
    From 0dc354bb69cda7b66f499bb167c1a48b88cbc549 Mon Sep 17 00:00:00 2001
    From: Wilfredo Sanchez 
    Date: Tue, 17 Dec 2002 07:09:21 +0000
    Subject: [PATCH 4166/7878] Define SHUT_RDWR to 2 if it's not already defined.
     Submitted by: "Kean Johnston" 
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64185 13f79535-47bb-0310-9956-ffa450edef68
    ---
     misc/unix/rand.c | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/misc/unix/rand.c b/misc/unix/rand.c
    index 727fc33c76e..a8e0a400a7b 100644
    --- a/misc/unix/rand.c
    +++ b/misc/unix/rand.c
    @@ -74,6 +74,10 @@
     #include 
     #endif
     
    +#ifndef SHUT_RDWR
    +#define SHUT_RDWR 2
    +#endif
    +
     #if APR_HAS_RANDOM
     
     APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, 
    
    From f6bc6f0c93a7e4c1e774eb866b200ce60e4632f5 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Tue, 17 Dec 2002 20:34:22 +0000
    Subject: [PATCH 4167/7878] Make the testnames program portable.  This fails
     one test on Windows currently, but that is an actual bug in the code, not the
     test suite,
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64186 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testnames.c | 34 ++++++++++++++++++++--------------
     1 file changed, 20 insertions(+), 14 deletions(-)
    
    diff --git a/test/testnames.c b/test/testnames.c
    index 6ee9b80d0af..29ca7a657fc 100644
    --- a/test/testnames.c
    +++ b/test/testnames.c
    @@ -60,13 +60,19 @@
     #include "apr_pools.h"
     #include "apr_lib.h"
     
    +#if WIN32
    +#define ABS_ROOT "C:"
    +#else
    +#define ABS_ROOT
    +#endif
    +
     static void merge_aboveroot(CuTest *tc)
     {
         apr_status_t rv;
         char *dstpath = NULL;
         char errmsg[256];
     
    -    rv = apr_filepath_merge(&dstpath, "/foo", "/bar", APR_FILEPATH_NOTABOVEROOT,
    +    rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo", ABS_ROOT"/bar", APR_FILEPATH_NOTABOVEROOT,
                                 p);
         apr_strerror(rv, errmsg, sizeof(errmsg));
         CuAssertPtrEquals(tc, NULL, dstpath);
    @@ -79,11 +85,11 @@ static void merge_belowroot(CuTest *tc)
         apr_status_t rv;
         char *dstpath = NULL;
     
    -    rv = apr_filepath_merge(&dstpath, "/foo", "/foo/bar", 
    +    rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo", ABS_ROOT"/foo/bar", 
                                 APR_FILEPATH_NOTABOVEROOT, p);
         CuAssertPtrNotNull(tc, dstpath);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, "/foo/bar", dstpath);
    +    CuAssertStrEquals(tc, ABS_ROOT"/foo/bar", dstpath);
     }
     
     static void merge_noflag(CuTest *tc)
    @@ -91,10 +97,10 @@ static void merge_noflag(CuTest *tc)
         apr_status_t rv;
         char *dstpath = NULL;
     
    -    rv = apr_filepath_merge(&dstpath, "/foo", "/foo/bar", 0, p);
    +    rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo", ABS_ROOT"/foo/bar", 0, p);
         CuAssertPtrNotNull(tc, dstpath);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, "/foo/bar", dstpath);
    +    CuAssertStrEquals(tc, ABS_ROOT"/foo/bar", dstpath);
     }
     
     static void merge_dotdot(CuTest *tc)
    @@ -102,10 +108,10 @@ static void merge_dotdot(CuTest *tc)
         apr_status_t rv;
         char *dstpath = NULL;
     
    -    rv = apr_filepath_merge(&dstpath, "/foo/bar", "../baz", 0, p);
    +    rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo/bar", "../baz", 0, p);
         CuAssertPtrNotNull(tc, dstpath);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, "/foo/baz", dstpath);
    +    CuAssertStrEquals(tc, ABS_ROOT"/foo/baz", dstpath);
     }
     
     static void merge_secure(CuTest *tc)
    @@ -113,10 +119,10 @@ static void merge_secure(CuTest *tc)
         apr_status_t rv;
         char *dstpath = NULL;
     
    -    rv = apr_filepath_merge(&dstpath, "/foo/bar", "../bar/baz", 0, p);
    +    rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo/bar", "../bar/baz", 0, p);
         CuAssertPtrNotNull(tc, dstpath);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, "/foo/bar/baz", dstpath);
    +    CuAssertStrEquals(tc, ABS_ROOT"/foo/bar/baz", dstpath);
     }
     
     static void merge_notrel(CuTest *tc)
    @@ -124,11 +130,11 @@ static void merge_notrel(CuTest *tc)
         apr_status_t rv;
         char *dstpath = NULL;
     
    -    rv = apr_filepath_merge(&dstpath, "/foo/bar", "../baz",
    +    rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo/bar", "../baz",
                                 APR_FILEPATH_NOTRELATIVE, p);
         CuAssertPtrNotNull(tc, dstpath);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, "/foo/baz", dstpath);
    +    CuAssertStrEquals(tc, ABS_ROOT"/foo/baz", dstpath);
     }
     
     static void merge_notrelfail(CuTest *tc)
    @@ -152,7 +158,7 @@ static void merge_notabsfail(CuTest *tc)
         char *dstpath = NULL;
         char errmsg[256];
     
    -    rv = apr_filepath_merge(&dstpath, "/foo/bar", "../baz", 
    +    rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo/bar", "../baz", 
                                 APR_FILEPATH_NOTABSOLUTE, p);
         apr_strerror(rv, errmsg, sizeof(errmsg));
     
    @@ -178,13 +184,13 @@ static void root_absolute(CuTest *tc)
     {
         apr_status_t rv;
         const char *root = NULL;
    -    const char *path = "/foo/bar";
    +    const char *path = ABS_ROOT"/foo/bar";
     
         rv = apr_filepath_root(&root, &path, 0, p);
     
         CuAssertPtrNotNull(tc, root);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, "/", root);
    +    CuAssertStrEquals(tc, ABS_ROOT"/", root);
     }
     
     static void root_relative(CuTest *tc)
    
    From 1483ea853b914ff087c4da7ad2b37c8bb03ffdb7 Mon Sep 17 00:00:00 2001
    From: Branko Cibej 
    Date: Wed, 18 Dec 2002 01:03:16 +0000
    Subject: [PATCH 4168/7878] Reverse the tests for DIRENT_INODE and DIRENT_TYPE
     that were added to apr_dir_read that were introduced in version 1.65. This
     makes Subversion tests on Linux pass again.
    
    Submitted by Philip Martin .
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64187 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/dir.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
    index e5773639b78..a86c6d634ae 100644
    --- a/file_io/unix/dir.c
    +++ b/file_io/unix/dir.c
    @@ -218,10 +218,10 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
             return ret;
         }
     
    -#ifdef DIRENT_INODE
    +#ifndef DIRENT_INODE
         wanted &= ~APR_FINFO_INODE;
     #endif
    -#ifdef DIRENT_TYPE
    +#ifndef DIRENT_TYPE
         wanted &= ~APR_FINFO_TYPE;
     #endif
     
    
    From e2f15d33dda551b24c182555b6ea75fc9f754385 Mon Sep 17 00:00:00 2001
    From: Branko Cibej 
    Date: Wed, 18 Dec 2002 04:28:09 +0000
    Subject: [PATCH 4169/7878] Reverted my last change for now.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64188 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/dir.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
    index a86c6d634ae..e5773639b78 100644
    --- a/file_io/unix/dir.c
    +++ b/file_io/unix/dir.c
    @@ -218,10 +218,10 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
             return ret;
         }
     
    -#ifndef DIRENT_INODE
    +#ifdef DIRENT_INODE
         wanted &= ~APR_FINFO_INODE;
     #endif
    -#ifndef DIRENT_TYPE
    +#ifdef DIRENT_TYPE
         wanted &= ~APR_FINFO_TYPE;
     #endif
     
    
    From 1c4fd44a517ea5ef760dddb0b19218fd3fb17e19 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Wed, 18 Dec 2002 16:07:35 +0000
    Subject: [PATCH 4170/7878] Makefile fix for building IPV6.  This stops the
     makefile from recursively creating IPV6 directories
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64189 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/NWGNUenvironment.inc | 9 +++++++--
     1 file changed, 7 insertions(+), 2 deletions(-)
    
    diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc
    index 6ffd74e5a31..da4819a44bd 100644
    --- a/build/NWGNUenvironment.inc
    +++ b/build/NWGNUenvironment.inc
    @@ -187,11 +187,16 @@ ifneq "$(IPV6)" ""
     DEFINES += -DNW_BUILD_IPV6
     INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS)
     
    -ifneq "$(IPV6)" "SET"
    +ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6"
     OBJDIR := $(OBJDIR)_IPV6
    +endif
    +        
    +ifneq "$(findstring IPV6,$(INSTALL))" "IPV6"
     INSTALL := $(INSTALL)_IPV6
    +endif        
    +
    +ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6"
     INSTDIRS := $(INSTDIRS)_IPV6
    -IPV6=SET
     endif
     
     endif
    
    From 9ee6d5a6e0b454b200df14bea304c88001e6fa7c Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Wed, 18 Dec 2002 16:08:29 +0000
    Subject: [PATCH 4171/7878] NetWare needs some defines that are in
     apr_private.h
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64190 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sockaddr.c | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
    index 2095c5cc049..becff5c1faf 100644
    --- a/network_io/unix/sockaddr.c
    +++ b/network_io/unix/sockaddr.c
    @@ -57,6 +57,9 @@
     #include "apr.h"
     #include "apr_lib.h"
     #include "apr_strings.h"
    +#ifdef NETWARE
    +#include "apr_private.h"
    +#endif
     
     #if APR_HAVE_STDLIB_H
     #include 
    
    From 90f8bba6a00e795cd8dae7c068fbffc6e508c9b0 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 18 Dec 2002 18:06:56 +0000
    Subject: [PATCH 4172/7878]   Based on Philip Martin's research, we need to
     ignore any d_type results   of DT_UNKNOWN from dirread, and just to be
     thorough, we will lstat() any   file where the inode was (0/-1) as undefined
     values, or type was not in   our mappable list based on DT_ flags.  This
     should resolve SVN's breakage.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64191 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/dir.c | 28 ++++++++++++++++++++--------
     1 file changed, 20 insertions(+), 8 deletions(-)
    
    diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
    index e5773639b78..b671c95fc9f 100644
    --- a/file_io/unix/dir.c
    +++ b/file_io/unix/dir.c
    @@ -172,6 +172,9 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
                               apr_dir_t *thedir)
     {
         apr_status_t ret = 0;
    +#ifdef DIRENT_TYPE
    +    apr_filetype_e type;
    +#endif
     #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
                         && !defined(READDIR_IS_THREAD_SAFE)
         struct dirent *retent;
    @@ -218,11 +221,16 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
             return ret;
         }
     
    -#ifdef DIRENT_INODE
    -    wanted &= ~APR_FINFO_INODE;
    -#endif
     #ifdef DIRENT_TYPE
    -    wanted &= ~APR_FINFO_TYPE;
    +    type = filetype_from_dirent_type(thedir->entry->DIRENT_TYPE);
    +    if (type != APR_UNKFILE) {
    +        wanted &= ~APR_FINFO_TYPE;
    +    }
    +#endif
    +#ifdef DIRENT_INODE
    +    if (thedir->entry->DIRENT_INODE && thedir->entry->DIRENT_INODE != -1) {
    +        wanted &= ~APR_FINFO_INODE;
    +    }
     #endif
     
         wanted &= ~APR_FINFO_NAME;
    @@ -251,12 +259,16 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
             finfo->pool = thedir->pool;
             finfo->valid = 0;
     #ifdef DIRENT_TYPE
    -        finfo->filetype = filetype_from_dirent_type(thedir->entry->DIRENT_TYPE);
    -        finfo->valid |= APR_FINFO_TYPE;
    +        if (type != APR_UNKFILE) {
    +            finfo->filetype = type;
    +            finfo->valid |= APR_FINFO_TYPE;
    +        }
     #endif
     #ifdef DIRENT_INODE
    -        finfo->inode = thedir->entry->DIRENT_INODE;
    -        finfo->valid |= APR_FINFO_INODE;
    +        if (thedir->entry->DIRENT_INODE && thedir->entry->DIRENT_INODE != -1) {
    +            finfo->inode = thedir->entry->DIRENT_INODE;
    +            finfo->valid |= APR_FINFO_INODE;
    +        }
     #endif
         }
     
    
    From 6239db6277bc4b27face26ecd392438ab0908e36 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Thu, 19 Dec 2002 01:49:18 +0000
    Subject: [PATCH 4173/7878] Add a CuAssertStrnEquals which does a strncmp
     instead of a strcmp.  This fixes a big in teststr.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64192 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/CuTest.c  | 14 ++++++++++++++
     test/CuTest.h  |  2 ++
     test/teststr.c |  2 +-
     3 files changed, 17 insertions(+), 1 deletion(-)
    
    diff --git a/test/CuTest.c b/test/CuTest.c
    index 6f2035b6f84..c3ed2a5d2b1 100644
    --- a/test/CuTest.c
    +++ b/test/CuTest.c
    @@ -182,6 +182,20 @@ void CuAssertTrue(CuTest* tc, int condition)
     	CuFail(tc, "assert failed");
     }
     
    +void CuAssertStrNEquals(CuTest* tc, const char* expected, const char* actual,
    +                        int n)
    +{
    +	CuString* message;
    +	if (strncmp(expected, actual, n) == 0) return;
    +	message = CuStringNew();
    +	CuStringAppend(message, "expected\n---->\n");
    +	CuStringAppend(message, expected);
    +	CuStringAppend(message, "\n<----\nbut saw\n---->\n");
    +	CuStringAppend(message, actual);
    +	CuStringAppend(message, "\n<----\n");
    +	CuFail(tc, message->buffer);
    +}
    +
     void CuAssertStrEquals(CuTest* tc, const char* expected, const char* actual)
     {
     	CuString* message;
    diff --git a/test/CuTest.h b/test/CuTest.h
    index 638b0283e41..e607d3ac9d4 100644
    --- a/test/CuTest.h
    +++ b/test/CuTest.h
    @@ -86,6 +86,8 @@ void CuNotImpl(CuTest* tc, const char* message);
     void CuAssert(CuTest* tc, const char* message, int condition);
     void CuAssertTrue(CuTest* tc, int condition);
     void CuAssertStrEquals(CuTest* tc, const char* expected, const char* actual);
    +void CuAssertStrNEquals(CuTest* tc, const char* expected, const char* actual,
    +                        int n);
     void CuAssertIntEquals(CuTest* tc, int expected, int actual);
     void CuAssertPtrEquals(CuTest* tc, const void* expected, const void* actual);
     void CuAssertPtrNotNull(CuTest* tc, const void* pointer);
    diff --git a/test/teststr.c b/test/teststr.c
    index 191f6405d54..668e434f6ba 100644
    --- a/test/teststr.c
    +++ b/test/teststr.c
    @@ -142,7 +142,7 @@ static void snprintf_noNULL(CuTest *tc)
         
         /* If this test fails, we are going to seg fault. */
         apr_snprintf(buff, sizeof(buff), "%.*s", 7, testing);
    -    CuAssertStrEquals(tc, buff, testing);
    +    CuAssertStrNEquals(tc, buff, testing, 7);
     }
     
     static void snprintf_0NULL(CuTest *tc)
    
    From eb04c59213ebdc13745caf5742472b24bf54da61 Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Thu, 19 Dec 2002 05:19:23 +0000
    Subject: [PATCH 4174/7878] Allow dependencies to be generated by something
     other than GCC. This allows Sun's cpp to generate valid .deps dependencies.
    
    - Remove no longer used build/mkdep.sh (we haven't used this in a while)
    - Do a run-time check in configure to determine our MKDEP program
      (Unfortunately Forte's cc -E -M option doesn't work - must call cpp
       directly - hence that special case.)
    - Switch the dependency generation to be executed for each file as not all
      cpp's can handle wildcards.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64193 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES             |  3 +++
     build/apr_common.m4 | 34 ++++++++++++++++++++++++++++++++++
     build/mkdep.sh      | 16 ----------------
     build/rules.mk.in   | 10 +++++++---
     configure.in        |  3 +++
     5 files changed, 47 insertions(+), 19 deletions(-)
     delete mode 100755 build/mkdep.sh
    
    diff --git a/CHANGES b/CHANGES
    index d98790a185d..123e121d9c3 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,8 @@
     Changes with APR 0.9.2
     
    +  *) Allow generation of dependencies by non-GCC compilers.
    +     [Justin Erenkrantz]
    +
       *) Prevent obscenely large values of precision in apr_vformatter
          from clobbering a buffer. [Sander Striker, Jim Jagielski]
     
    diff --git a/build/apr_common.m4 b/build/apr_common.m4
    index e78ff12844a..3d7b56e677e 100644
    --- a/build/apr_common.m4
    +++ b/build/apr_common.m4
    @@ -898,3 +898,37 @@ do
     done
     
     ])dnl
    +
    +dnl
    +dnl APR_CHECK_DEPEND
    +dnl
    +dnl Determine what program we can use to generate .deps-style dependencies
    +dnl
    +AC_DEFUN(APR_CHECK_DEPEND,[
    +dnl Try to determine what depend program we can use
    +dnl All GCC-variants should have -MM.
    +dnl If not, then we can check on those, too.
    +if test "$GCC" = "yes"; then
    +  MKDEP='$(CC) -MM'
    +else
    +  rm -f conftest.c
    +dnl  should be available everywhere!
    +  cat > conftest.c <
    +  int main() { return 0; }
    +EOF
    +  MKDEP="true"
    +  for i in "$CC -MM" "$CC -M" "$CPP -MM" "$CPP -M" "cpp -M"; do
    +    AC_MSG_CHECKING([if $i can create proper make dependencies])
    +    if $i conftest.c 2>/dev/null | grep 'conftest.o: conftest.c' >/dev/null; then
    +      MKDEP=$i
    +      AC_MSG_RESULT(yes)
    +      break;
    +    fi
    +    AC_MSG_RESULT(no)
    +  done
    +  rm -f conftest.c
    +fi
    +
    +AC_SUBST(MKDEP)
    +])
    diff --git a/build/mkdep.sh b/build/mkdep.sh
    deleted file mode 100755
    index eca1c119119..00000000000
    --- a/build/mkdep.sh
    +++ /dev/null
    @@ -1,16 +0,0 @@
    -#!/bin/sh
    -#
    -# 1) remove everything after the DO NOT REMOVE
    -# 2) generate the dependencies, adding them to the end of Makefile.new
    -# 3) move the Makefile.new back into place
    -#
    -# Note that we use && to ensure that Makefile is not changed if an error
    -# occurs during the process
    -#
    -if test -z "$CC"; then
    -   CC=cc
    -fi
    -
    -sed -ne '1,/^# DO NOT REMOVE/p' Makefile > Makefile.new \
    -    && $CC -MM  $* | sed -e "s/\.o:/\.lo:/" >> Makefile.new \
    -    && mv Makefile.new Makefile
    diff --git a/build/rules.mk.in b/build/rules.mk.in
    index 98a16f8bba0..68da150d073 100644
    --- a/build/rules.mk.in
    +++ b/build/rules.mk.in
    @@ -124,7 +124,7 @@ LT_COMPILE   = @lt_compile@
     LINK         = @link@
     
     MKEXPORT     = $(AWK) -f $(apr_builders)/make_export.awk
    -MKDEP        = $(apr_builders)/mkdep.sh
    +MKDEP        = @MKDEP@
     
     #
     # Standard build rules
    @@ -200,8 +200,12 @@ local-all: $(TARGETS)
     
     local-depend: x-local-depend
     	@if test -n "`ls $(srcdir)/*.c 2> /dev/null`"; then \
    -		$(CC) -MM $(ALL_CPPFLAGS) $(ALL_INCLUDES) $(srcdir)/*.c | sed 's/\.o:/.lo:/' > .deps || true;           \
    -    fi
    +		$(RM) -f .deps; \
    +		list='$(srcdir)/*.c'; \
    +		for i in $$list; do \
    +			$(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) $$i | sed 's/\.o:/.lo:/' >> .deps; \
    +		done; \
    +	fi
     
     # to be filled in by the actual Makefile
     x-local-depend x-local-clean x-local-distclean x-local-extraclean:
    diff --git a/configure.in b/configure.in
    index b5da45b2f7f..e71ed39b74f 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -323,6 +323,9 @@ case "$host:$CC" in
     	;;
     esac
     
    +dnl Check the depend program we can use
    +APR_CHECK_DEPEND
    +
     # force_atomic_generic flag 
     # this will be set we find a cpu/OS combo
     # which is historical and doesn't work with the method
    
    From 4f2e6e9e40615bcc7cd1e9ccbfc950b50a0afa91 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Thu, 19 Dec 2002 16:14:18 +0000
    Subject: [PATCH 4175/7878] NetWare makefile for building the test suite
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64194 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/NWGNUmakefile | 258 +++++++++++++++++++++++++++++++++++++++++
     test/nwgnuaprtest  | 282 +++++++++++++++++++++++++++++++++++++++++++++
     test/nwgnumod_test | 257 +++++++++++++++++++++++++++++++++++++++++
     3 files changed, 797 insertions(+)
     create mode 100644 test/NWGNUmakefile
     create mode 100644 test/nwgnuaprtest
     create mode 100644 test/nwgnumod_test
    
    diff --git a/test/NWGNUmakefile b/test/NWGNUmakefile
    new file mode 100644
    index 00000000000..32e8b17e718
    --- /dev/null
    +++ b/test/NWGNUmakefile
    @@ -0,0 +1,258 @@
    +#
    +# Declare the sub-directories to be built here
    +#
    +
    +SUBDIRS = \
    +	$(EOLIST) 
    +
    +#
    +# Get the 'head' of the build environment.  This includes default targets and
    +# paths to tools
    +#
    +
    +include $(APR_WORK)\build\NWGNUhead.inc
    +
    +#
    +# build this level's files
    +
    +#
    +# Make sure all needed macro's are defined
    +#
    +
    +
    +#
    +# These directories will be at the beginning of the include list, followed by
    +# INCDIRS
    +#
    +XINCDIRS	+= \
    +			$(APR_WORK)/include \
    +			$(APR_WORK)/include/arch/NetWare \
    +			$(EOLIST)
    +
    +#
    +# These flags will come after CFLAGS
    +#
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +#
    +# These defines will come after DEFINES
    +#
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +#
    +# These flags will be added to the link.opt file
    +#
    +XLFLAGS		+= \
    +			$(EOLIST)
    +
    +#
    +# These values will be appended to the correct variables based on the value of
    +# RELEASE
    +#
    +ifeq "$(RELEASE)" "debug"
    +XINCDIRS	+= \
    +			$(EOLIST)
    +
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +XLFLAGS		+= \
    +			$(EOLIST)
    +						
    +endif
    +
    +ifeq "$(RELEASE)" "noopt"
    +XINCDIRS	+= \
    +			$(EOLIST)
    +
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +XLFLAGS		+= \
    +			$(EOLIST)
    +endif
    +
    +ifeq "$(RELEASE)" "release"
    +XINCDIRS	+= \
    +			$(EOLIST)
    +
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +XLFLAGS		+= \
    +			$(EOLIST)
    +endif
    +
    +#
    +# These are used by the link target if an NLM is being generated
    +# This is used by the link 'name' directive to name the nlm.  If left blank
    +# TARGET_nlm (see below) will be used.
    +#
    +NLM_NAME		=	
    +
    +#
    +# This is used by the link '-desc ' directive. 
    +# If left blank, NLM_NAME will be used.
    +#
    +NLM_DESCRIPTION	=  NLM is to test the apr layer
    +
    +#
    +# This is used by the '-threadname' directive.  If left blank,
    +# NLM_NAME Thread will be used.
    +#
    +NLM_THREAD_NAME	= 
    +
    +#
    +# This is used by the '-screenname' directive.  If left blank,
    +# 'Apache for NetWare' Thread will be used.
    +#
    +NLM_SCREEN_NAME =
    +
    +#
    +# If this is specified, it will override VERSION value in 
    +# $(APR_WORK)\build\NWGNUenvironment.inc
    +#
    +NLM_VERSION		= 
    +
    +#
    +# If this is specified, it will override the default of 64K
    +#
    +NLM_STACK_SIZE	= 
    +
    +#
    +# If this is specified it will be used by the link '-entry' directive
    +#
    +NLM_ENTRY_SYM	= 
    +
    +#
    +# If this is specified it will be used by the link '-exit' directive
    +#
    +NLM_EXIT_SYM	= 
    +
    +#
    +# If this is specified it will be used by the link '-check' directive
    +#
    +NLM_CHECK_SYM	=
    +
    +#
    +# If this is specified it will be used by the link '-flags' directive
    +#
    +NLM_FLAGS		=
    + 
    +#
    +# If this is specified it will be linked in with the XDCData option in the def 
    +# file instead of the default of $(APR)/misc/netware/apache.xdc.  XDCData can 
    +# be disabled by setting APACHE_UNIPROC in the environment
    +#
    +XDCDATA         = 
    +
    +#
    +# Declare all target files (you must add your files here)
    +#
    +
    +#
    +# If there is an NLM target, put it here
    +#
    +TARGET_nlm = \
    +	$(OBJDIR)/aprtest.nlm \
    +	$(OBJDIR)/mod_test.nlm \
    +	$(EOLIST)
    +#
    +# If there is an LIB target, put it here
    +#
    +TARGET_lib = \
    +	$(EOLIST)
    +
    +#
    +# These are the OBJ files needed to create the NLM target above.
    +# Paths must all use the '/' character
    +#
    +FILES_nlm_objs = \
    +		$(EOLIST)
    +
    +#
    +# These are the LIB files needed to create the NLM target above.
    +# These will be added as a library command in the link.opt file.
    +#
    +FILES_nlm_libs = \
    +   	$(EOLIST)
    +
    +#
    +# These are the modules that the above NLM target depends on to load.
    +# These will be added as a module command in the link.opt file.
    +#
    +FILES_nlm_modules = \
    +	aprlib \
    +  	$(EOLIST)
    +
    +#
    +# If the nlm has a msg file, put it's path here
    +#
    +FILE_nlm_msg =
    + 
    +#
    +# If the nlm has a hlp file put it's path here
    +#
    +FILE_nlm_hlp =
    +
    +#
    +# If this is specified, it will override the default copyright.
    +#
    +FILE_nlm_copyright =
    +
    +#
    +# Any additional imports go here
    +#
    +FILES_nlm_Ximports = \
    +   	$(EOLIST)
    + 
    +#   
    +# Any symbols exported to here
    +#
    +FILES_nlm_exports = \
    +	$(EOLIST)
    +	
    +#   
    +# These are the OBJ files needed to create the LIB target above.
    +# Paths must all use the '/' character
    +#
    +FILES_lib_objs = \
    +	$(EOLIST)
    +
    +#
    +# implement targets and dependancies (leave this section alone)
    +#
    +
    +libs :: $(OBJDIR) $(TARGET_lib)
    +
    +nlms :: libs $(TARGET_nlm)
    +
    +#
    +# Updated this target to create necessary directories and copy files to the 
    +# correct place.  (See $(APR_WORK)\build\NWGNUhead.inc for examples)
    +#
    +install :: nlms FORCE
    +	  copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2
    +
    +#
    +# Any specialized rules here
    +#
    +
    +#
    +# Include the 'tail' makefile that has targets that depend on variables defined
    +# in this makefile
    +#
    +
    +include $(APR_WORK)\build\NWGNUtail.inc
    +
    diff --git a/test/nwgnuaprtest b/test/nwgnuaprtest
    new file mode 100644
    index 00000000000..ccf78a7a5b0
    --- /dev/null
    +++ b/test/nwgnuaprtest
    @@ -0,0 +1,282 @@
    +#
    +# Make sure all needed macro's are defined
    +#
    +
    +#
    +# Get the 'head' of the build environment if necessary.  This includes default
    +# targets and paths to tools
    +#
    +
    +ifndef EnvironmentDefined
    +include $(APR_WORK)\build\NWGNUhead.inc
    +endif
    +
    +#
    +# These directories will be at the beginning of the include list, followed by
    +# INCDIRS
    +#
    +XINCDIRS	+= \
    +			$(APR_WORK)/include \
    +			$(APR_WORK)/include/arch/NetWare \
    +			$(EOLIST)
    +
    +#
    +# These flags will come after CFLAGS
    +#
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +#
    +# These defines will come after DEFINES
    +#
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +#
    +# These flags will be added to the link.opt file
    +#
    +XLFLAGS		+= \
    +			$(EOLIST)
    +
    +#
    +# These values will be appended to the correct variables based on the value of
    +# RELEASE
    +#
    +ifeq "$(RELEASE)" "debug"
    +XINCDIRS	+= \
    +			$(EOLIST)
    +
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +XLFLAGS		+= \
    +			$(EOLIST)
    +endif
    +
    +ifeq "$(RELEASE)" "noopt"
    +XINCDIRS	+= \
    +			$(EOLIST)
    +
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +XLFLAGS		+= \
    +			$(EOLIST)
    +endif
    +
    +ifeq "$(RELEASE)" "release"
    +XINCDIRS	+= \
    +			$(EOLIST)
    +
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +XLFLAGS		+= \
    +			$(EOLIST)
    +endif
    +
    +#
    +# These are used by the link target if an NLM is being generated
    +# This is used by the link 'name' directive to name the nlm.  If left blank
    +# TARGET_nlm (see below) will be used.
    +#
    +NLM_NAME		=aprtest
    +#
    +# This is used by the link '-desc ' directive. 
    +# If left blank, NLM_NAME will be used.
    +#
    +NLM_DESCRIPTION	=  NLM is to test the apr layer
    +
    +#
    +# This is used by the '-threadname' directive.  If left blank,
    +# NLM_NAME Thread will be used.
    +#
    +NLM_THREAD_NAME	= aprtest
    +
    +#
    +# This is used by the '-screenname' directive.  If left blank,
    +# 'Apache for NetWare' Thread will be used.
    +#
    +NLM_SCREEN_NAME = aprtest
    +
    +#
    +# If this is specified, it will override VERSION value in 
    +# $(APR_WORK)\build\NWGNUenvironment.inc
    +#
    +NLM_VERSION		= 1,0,0
    +
    +#
    +# If this is specified, it will override the default of 64K
    +#
    +NLM_STACK_SIZE	= 
    +
    +#
    +# If this is specified it will be used by the link '-entry' directive
    +#
    +NLM_ENTRY_SYM	= _LibCPrelude
    +
    +#
    +# If this is specified it will be used by the link '-exit' directive
    +#
    +NLM_EXIT_SYM	= _LibCPostlude
    +
    +#
    +# If this is specified it will be used by the link '-check' directive
    +#
    +NLM_CHECK_SYM	=
    +
    +#
    +# If this is specified it will be used by the link '-flags' directive
    +#
    +NLM_FLAGS		= AUTOUNLOAD, PSEUDOPREEMPTION
    + 
    +#
    +# If this is specified it will be linked in with the XDCData option in the def 
    +# file instead of the default of $(APR)/misc/netware/apache.xdc.  XDCData can 
    +# be disabled by setting APACHE_UNIPROC in the environment
    +#
    +XDCDATA         = 
    +
    +#
    +# Declare all target files (you must add your files here)
    +#
    +
    +#
    +# If there is an NLM target, put it here
    +#
    +TARGET_nlm = \
    +	$(OBJDIR)/aprtest.nlm \
    +	$(EOLIST)
    +
    +#
    +# If there is an LIB target, put it here
    +#
    +TARGET_lib = \
    +	$(EOLIST)
    +
    +#
    +# These are the OBJ files needed to create the NLM target above.
    +# Paths must all use the '/' character
    +#
    +FILES_nlm_objs = \
    +	$(OBJDIR)/cutest.o \
    +	$(OBJDIR)/testall.o \
    +	$(OBJDIR)/testargs.o \
    +	$(OBJDIR)/testdir.o \
    +	$(OBJDIR)/testdup.o \
    +	$(OBJDIR)/testdso.o \
    +	$(OBJDIR)/testfileinfo.o \
    +	$(OBJDIR)/testfile.o \
    +	$(OBJDIR)/testfmt.o \
    +	$(OBJDIR)/testhash.o \
    +	$(OBJDIR)/testipsub.o \
    +	$(OBJDIR)/testlock.o \
    +	$(OBJDIR)/testmmap.o \
    +	$(OBJDIR)/testnames.o \
    +	$(OBJDIR)/testoc.o \
    +	$(OBJDIR)/testpipe.o \
    +	$(OBJDIR)/testpoll.o \
    +	$(OBJDIR)/testpools.o \
    +	$(OBJDIR)/testproc.o \
    +	$(OBJDIR)/testrand.o \
    +	$(OBJDIR)/testsleep.o \
    +	$(OBJDIR)/testsockets.o \
    +	$(OBJDIR)/testsockopt.o \
    +	$(OBJDIR)/teststr.o \
    +	$(OBJDIR)/testthread.o \
    +	$(OBJDIR)/testtime.o \
    +	$(OBJDIR)/testtable.o \
    +	$(OBJDIR)/testud.o \
    +	$(OBJDIR)/testuser.o \
    +	$(OBJDIR)/testvsn.o \
    +	$(EOLIST)
    +
    +	
    +#
    +# These are the LIB files needed to create the NLM target above.
    +# These will be added as a library command in the link.opt file.
    +#
    +FILES_nlm_libs = \
    +	libcpre.o \
    +	$(EOLIST)
    +
    +#
    +# These are the modules that the above NLM target depends on to load.
    +# These will be added as a module command in the link.opt file.
    +#
    +FILES_nlm_modules = \
    +	Libc \
    +	APRLIB \
    +	$(EOLIST)
    +
    +#
    +# If the nlm has a msg file, put it's path here
    +#
    +FILE_nlm_msg =
    + 
    +#
    +# If the nlm has a hlp file put it's path here
    +#
    +FILE_nlm_hlp =
    +
    +#
    +# If this is specified, it will override the default copyright.
    +#
    +FILE_nlm_copyright =
    +
    +#
    +# Any additional imports go here
    +#
    +FILES_nlm_Ximports = \
    +	@libc.imp \
    +	@$(APR)/aprlib.imp	\
    +	$(EOLIST)
    + 
    +#   
    +# Any symbols exported to here
    +#
    +FILES_nlm_exports = \
    +	$(EOLIST)
    +	
    +#   
    +# These are the OBJ files needed to create the LIB target above.
    +# Paths must all use the '/' character
    +#
    +FILES_lib_objs = \
    +	$(EOLIST)
    +
    +#
    +# implement targets and dependancies (leave this section alone)
    +#
    +
    +libs :: $(OBJDIR) $(TARGET_lib)
    +
    +nlms :: libs $(TARGET_nlm)
    +
    +#
    +# Updated this target to create necessary directories and copy files to the 
    +# correct place.  (See $(APR_WORK)\build\NWGNUhead.inc for examples)
    +#
    +install :: nlms FORCE
    +
    +#
    +# Any specialized rules here
    +#
    +
    +
    +#
    +# Include the 'tail' makefile that has targets that depend on variables defined
    +# in this makefile
    +#
    +
    +include $(APR_WORK)\build\NWGNUtail.inc
    +
    diff --git a/test/nwgnumod_test b/test/nwgnumod_test
    new file mode 100644
    index 00000000000..1510ccb5252
    --- /dev/null
    +++ b/test/nwgnumod_test
    @@ -0,0 +1,257 @@
    +#
    +# Make sure all needed macro's are defined
    +#
    +
    +#
    +# Get the 'head' of the build environment if necessary.  This includes default
    +# targets and paths to tools
    +#
    +
    +ifndef EnvironmentDefined
    +include $(APR_WORK)\build\NWGNUhead.inc
    +endif
    +
    +#
    +# These directories will be at the beginning of the include list, followed by
    +# INCDIRS
    +#
    +XINCDIRS	+= \
    +			$(APR_WORK)/include \
    +			$(APR_WORK)/include/arch/NetWare \
    +			$(EOLIST)
    +
    +#
    +# These flags will come after CFLAGS
    +#
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +#
    +# These defines will come after DEFINES
    +#
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +#
    +# These flags will be added to the link.opt file
    +#
    +XLFLAGS		+= \
    +			$(EOLIST)
    +
    +#
    +# These values will be appended to the correct variables based on the value of
    +# RELEASE
    +#
    +ifeq "$(RELEASE)" "debug"
    +XINCDIRS	+= \
    +			$(EOLIST)
    +
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +XLFLAGS		+= \
    +			$(EOLIST)
    +						
    +endif
    +
    +ifeq "$(RELEASE)" "noopt"
    +XINCDIRS	+= \
    +			$(EOLIST)
    +
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +XLFLAGS		+= \
    +			$(EOLIST)
    +
    +			$(EOLIST)
    +endif
    +
    +ifeq "$(RELEASE)" "release"
    +XINCDIRS	+= \
    +			$(EOLIST)
    +
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +XLFLAGS		+= \
    +			$(EOLIST)
    +endif
    +
    +#
    +# These are used by the link target if an NLM is being generated
    +# This is used by the link 'name' directive to name the nlm.  If left blank
    +# TARGET_nlm (see below) will be used.
    +#
    +NLM_NAME		=	mod_test
    +
    +#
    +# This is used by the link '-desc ' directive. 
    +# If left blank, NLM_NAME will be used.
    +#
    +NLM_DESCRIPTION	=  DSO NLM to test the apr DSO loading layer
    +
    +#
    +# This is used by the '-threadname' directive.  If left blank,
    +# NLM_NAME Thread will be used.
    +#
    +NLM_THREAD_NAME	= mod_test
    +
    +#
    +# This is used by the '-screenname' directive.  If left blank,
    +# 'Apache for NetWare' Thread will be used.
    +#
    +NLM_SCREEN_NAME = DEFAULT
    +
    +#
    +# If this is specified, it will override VERSION value in 
    +# $(APR_WORK)\build\NWGNUenvironment.inc
    +#
    +NLM_VERSION		= 1,0,0
    +
    +#
    +# If this is specified, it will override the default of 64K
    +#
    +NLM_STACK_SIZE	= 
    +
    +#
    +# If this is specified it will be used by the link '-entry' directive
    +#
    +NLM_ENTRY_SYM	= _LibCPrelude
    +
    +#
    +# If this is specified it will be used by the link '-exit' directive
    +#
    +NLM_EXIT_SYM	= _LibCPostlude
    +
    +#
    +# If this is specified it will be used by the link '-check' directive
    +#
    +NLM_CHECK_SYM	=
    +
    +#
    +# If this is specified it will be used by the link '-flags' directive
    +#
    +NLM_FLAGS		= AUTOUNLOAD, PSEUDOPREEMPTION
    + 
    +#
    +# If this is specified it will be linked in with the XDCData option in the def 
    +# file instead of the default of $(APR)/misc/netware/apache.xdc.  XDCData can 
    +# be disabled by setting APACHE_UNIPROC in the environment
    +#
    +XDCDATA         = 
    +
    +#
    +# Declare all target files (you must add your files here)
    +#
    +
    +#
    +# If there is an NLM target, put it here
    +#
    +TARGET_nlm = \
    +	$(OBJDIR)/mod_test.nlm \
    +	$(EOLIST)
    +
    +#
    +# If there is an LIB target, put it here
    +#
    +TARGET_lib = \
    +	$(EOLIST)
    +
    +#
    +# These are the OBJ files needed to create the NLM target above.
    +# Paths must all use the '/' character
    +#
    +FILES_nlm_objs = \
    +	$(OBJDIR)/mod_test.o \
    +	$(EOLIST)
    +
    +#
    +# These are the LIB files needed to create the NLM target above.
    +# These will be added as a library command in the link.opt file.
    +#
    +FILES_nlm_libs = \
    +	libcpre.o \
    +	$(EOLIST)
    +
    +#
    +# These are the modules that the above NLM target depends on to load.
    +# These will be added as a module command in the link.opt file.
    +#
    +FILES_nlm_modules = \
    +	aprlib \
    +	Libc \
    +	$(EOLIST)
    +
    +#
    +# If the nlm has a msg file, put it's path here
    +#
    +FILE_nlm_msg =
    + 
    +#
    +# If the nlm has a hlp file put it's path here
    +#
    +FILE_nlm_hlp =
    +
    +#
    +# If this is specified, it will override the default copyright.
    +#
    +FILE_nlm_copyright =
    +
    +#
    +# Any additional imports go here
    +#
    +FILES_nlm_Ximports = \
    +	@$(APR)/aprlib.imp \
    +	@libc.imp \
    +	$(EOLIST)
    + 
    +#   
    +# Any symbols exported to here
    +#
    +FILES_nlm_exports = \
    +	print_hello \
    +	count_reps \
    +	$(EOLIST)
    +	
    +#   
    +# These are the OBJ files needed to create the LIB target above.
    +# Paths must all use the '/' character
    +#
    +FILES_lib_objs = \
    +	$(EOLIST)
    +
    +#
    +# implement targets and dependancies (leave this section alone)
    +#
    +
    +libs :: $(OBJDIR) $(TARGET_lib)
    +
    +nlms :: libs $(TARGET_nlm)
    +
    +#
    +# Updated this target to create necessary directories and copy files to the 
    +# correct place.  (See $(APR_WORK)\build\NWGNUhead.inc for examples)
    +#
    +install :: nlms FORCE
    +
    +#
    +# Any specialized rules here
    +#
    +
    +#
    +# Include the 'tail' makefile that has targets that depend on variables defined
    +# in this makefile
    +#
    +
    +include $(APR_WORK)\build\NWGNUtail.inc
    +
    
    From c21dc050d98ad9e5e771c7f6253da71328bdfc92 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Thu, 19 Dec 2002 16:15:29 +0000
    Subject: [PATCH 4176/7878] Missing LIB_NAME2 #ifdef
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64195 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testdso.c | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/test/testdso.c b/test/testdso.c
    index 1d45a1f0f4f..43bc3e210d2 100644
    --- a/test/testdso.c
    +++ b/test/testdso.c
    @@ -275,9 +275,11 @@ CuSuite *testdso(void)
         getcwd(filename, 256);
         filename = apr_pstrcat(p, filename, "/", LIB_NAME, NULL);
     
    +#ifdef LIB_NAME2
         filename2 = apr_pcalloc(p, 256);
         getcwd(filename2, 256);
         filename2 = apr_pstrcat(p, filename2, "/", LIB_NAME2, NULL);
    +#endif
     
         SUITE_ADD_TEST(suite, test_load_module);
         SUITE_ADD_TEST(suite, test_dso_sym);
    
    From 4dc7593613786a6a694a4b55e4f05a85870d9441 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Thu, 19 Dec 2002 16:17:50 +0000
    Subject: [PATCH 4177/7878] If the platform does not have other child
     functionality then don't enable any of the other child tests.  Otherwise the
     tests don't compile.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64196 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testoc.c | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/test/testoc.c b/test/testoc.c
    index 49702755800..92b7b9fe82c 100644
    --- a/test/testoc.c
    +++ b/test/testoc.c
    @@ -84,7 +84,6 @@ static void ocmaint(int reason, void *data, int status)
             break;
         }
     }
    -#endif
     
     #ifndef SIGKILL
     #define SIGKILL 1
    @@ -132,8 +131,8 @@ static void test_child_kill(CuTest *tc)
         apr_proc_other_child_check();
         CuAssertStrEquals(tc, "APR_OC_REASON_DEATH", reasonstr);
     }    
    +#else
     
    -#if !APR_HAS_OTHER_CHILD
     static void oc_not_impl(CuTest *tc)
     {
         CuNotImpl(tc, "Other child logic not implemented on this platform");
    
    From 4d0f2d071df6951d2c550953a921b76858fda573 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Thu, 19 Dec 2002 19:55:11 +0000
    Subject: [PATCH 4178/7878] Make sure that when we print the string in
     test_localstr we get the time in the PST timezone.  This way, we can be sure
     that the test will succeed against the hard-coded string, which is in PST.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64197 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testtime.c | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/test/testtime.c b/test/testtime.c
    index e68f3ae70b5..c298da8db38 100644
    --- a/test/testtime.c
    +++ b/test/testtime.c
    @@ -129,6 +129,10 @@ static void test_localstr(CuTest *tc)
         if (rv == APR_ENOTIMPL) {
             CuNotImpl(tc, "apr_time_exp_lt");
         }
    +    /* Force us into PST timezone.  This is the only way the test will
    +     * succeed.
    +     */
    +    xt.tm_gmtoff = -25200;
         CuAssertTrue(tc, rv == APR_SUCCESS);
         CuAssertStrEquals(tc, "2002-08-14 12:05:36.186711 -25200 [257 Sat] DST",
                           print_time(p, &xt));
    
    From b0e84ac836009c6805689e5b842ed9afbbc2d351 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Thu, 19 Dec 2002 21:18:10 +0000
    Subject: [PATCH 4179/7878] Missing a space between each missing item in the
     file info and the NULL as the last argument to the apr_pstrcat() so that it
     doesn't run off the end.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64198 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfileinfo.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/test/testfileinfo.c b/test/testfileinfo.c
    index be9da8d0123..70071eaddf5 100644
    --- a/test/testfileinfo.c
    +++ b/test/testfileinfo.c
    @@ -125,7 +125,7 @@ static void test_info_get(CuTest *tc)
             str = apr_pstrdup(p, "APR_INCOMPLETE:  Missing ");
             for (i = 0; vfi[i].bits; ++i) {
                 if (vfi[i].bits & ~finfo.valid) {
    -                str = apr_pstrcat(p, str, vfi[i].description);
    +                str = apr_pstrcat(p, str, vfi[i].description, " ", NULL);
                 }
             }
             CuFail(tc, str);
    @@ -146,7 +146,7 @@ static void test_stat(CuTest *tc)
             str = apr_pstrdup(p, "APR_INCOMPLETE:  Missing ");
             for (i = 0; vfi[i].bits; ++i) {
                 if (vfi[i].bits & ~finfo.valid) {
    -                str = apr_pstrcat(p, str, vfi[i].description);
    +                str = apr_pstrcat(p, str, vfi[i].description, " ", NULL);
                 }
             }
             CuFail(tc, str);
    
    From e5d9a19aebe17776352013aab802c9320b044b12 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Fri, 20 Dec 2002 18:59:32 +0000
    Subject: [PATCH 4180/7878] Use getcwdpath() rather than getcwd() in
     apr_filepath_get() to make sure that the resulting path includes a volume
     name.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64199 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/netware/filesys.c | 16 +++++++++++++---
     1 file changed, 13 insertions(+), 3 deletions(-)
    
    diff --git a/file_io/netware/filesys.c b/file_io/netware/filesys.c
    index 722d4e5c188..8960cf1c87a 100644
    --- a/file_io/netware/filesys.c
    +++ b/file_io/netware/filesys.c
    @@ -106,17 +106,27 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_int32_t flags,
                                                apr_pool_t *p)
     {
         char path[APR_PATH_MAX];
    -    if (!getcwd(path, sizeof(path))) {
    +    char *ptr;
    +
    +    /* use getcwdpath to make sure that we get the volume name*/
    +    if (!getcwdpath(path, NULL, 0)) {
             if (errno == ERANGE)
                 return APR_ENAMETOOLONG;
             else
                 return errno;
         }
    -    *rootpath = apr_pstrdup(p, path);
    +    /* Strip off the server name if there is one*/
    +    ptr = strpbrk(path, "\\/:");
    +    if (!ptr) {
    +        return APR_ENOENT;
    +    }
    +    if (*ptr == ':') {
    +        ptr = path;
    +    }
    +    *rootpath = apr_pstrdup(p, ptr);
         return APR_SUCCESS;
     }
     
    -
     APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath,
                                                apr_pool_t *p)
     {
    
    From 01afbc17cec019db1beee528e7c10ad18b79d4b9 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Fri, 20 Dec 2002 19:08:01 +0000
    Subject: [PATCH 4181/7878] Make sure that the path to the current working
     directory and to the spawned NLM is fully qualified.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64200 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/netware/proc.c | 18 +++++++++++++-----
     1 file changed, 13 insertions(+), 5 deletions(-)
    
    diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c
    index 60ad76935b5..c9e6e969291 100644
    --- a/threadproc/netware/proc.c
    +++ b/threadproc/netware/proc.c
    @@ -196,11 +196,8 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f
     APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, 
                                    const char *dir) 
     {
    -    attr->currdir = apr_pstrdup(attr->pool, dir);
    -    if (attr->currdir) {
    -        return APR_SUCCESS;
    -    }
    -    return APR_ENOMEM;
    +    return apr_filepath_merge(&attr->currdir, NULL, dir, 
    +                              APR_FILEPATH_NATIVE, attr->pool);
     }
     
     APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr,
    @@ -306,6 +303,17 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
     
         addr_space = (attr->detached ? 0 : PROC_CURRENT_SPACE) | PROC_LOAD_SILENT;
     
    +    if (attr->currdir) {
    +        char *fullpath = NULL;
    +        apr_status_t rv;
    +
    +        if ((rv = apr_filepath_merge(&fullpath, attr->currdir, progname, 
    +                                     APR_FILEPATH_NATIVE, pool)) != APR_SUCCESS) {
    +            return rv;
    +        }
    +        progname = fullpath;
    +    } 
    +
         if ((newproc->pid = procve(progname, addr_space, (const char**)env, &wire, 
             NULL, NULL, 0, NULL, (const char **)args)) == 0) {
             return errno;
    
    From a24c55653de56671efe692d5d878c9ffb7bc569b Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Fri, 20 Dec 2002 19:09:14 +0000
    Subject: [PATCH 4182/7878] Making the APR tests run on NetWare
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64201 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/NWGNUmakefile |  1 +
     test/nw_misc.c     | 22 ++++++++++++++++++++++
     test/nwgnuaprtest  |  4 +++-
     test/testproc.c    |  2 ++
     4 files changed, 28 insertions(+), 1 deletion(-)
     create mode 100644 test/nw_misc.c
    
    diff --git a/test/NWGNUmakefile b/test/NWGNUmakefile
    index 32e8b17e718..6ce99306617 100644
    --- a/test/NWGNUmakefile
    +++ b/test/NWGNUmakefile
    @@ -167,6 +167,7 @@ XDCDATA         =
     TARGET_nlm = \
     	$(OBJDIR)/aprtest.nlm \
     	$(OBJDIR)/mod_test.nlm \
    +	$(OBJDIR)/proc_child.nlm \
     	$(EOLIST)
     #
     # If there is an LIB target, put it here
    diff --git a/test/nw_misc.c b/test/nw_misc.c
    new file mode 100644
    index 00000000000..dfb6cfe0318
    --- /dev/null
    +++ b/test/nw_misc.c
    @@ -0,0 +1,22 @@
    +#include 
    +#include 
    +#include "test_apr.h"
    +
    +void _NonAppStop( void )
    +{
    +    pressanykey();
    +}
    +
    +static void test_not_impl(CuTest *tc)
    +{
    +    CuNotImpl(tc, "Test not implemented on this platform yet");
    +}
    +
    +CuSuite *testpipe(void)
    +{
    +    CuSuite *suite = CuSuiteNew("Pipes");
    +    SUITE_ADD_TEST(suite, test_not_impl);
    +
    +    return suite;
    +}
    +
    diff --git a/test/nwgnuaprtest b/test/nwgnuaprtest
    index ccf78a7a5b0..5c63eed7573 100644
    --- a/test/nwgnuaprtest
    +++ b/test/nwgnuaprtest
    @@ -183,7 +183,6 @@ FILES_nlm_objs = \
     	$(OBJDIR)/testmmap.o \
     	$(OBJDIR)/testnames.o \
     	$(OBJDIR)/testoc.o \
    -	$(OBJDIR)/testpipe.o \
     	$(OBJDIR)/testpoll.o \
     	$(OBJDIR)/testpools.o \
     	$(OBJDIR)/testproc.o \
    @@ -198,8 +197,11 @@ FILES_nlm_objs = \
     	$(OBJDIR)/testud.o \
     	$(OBJDIR)/testuser.o \
     	$(OBJDIR)/testvsn.o \
    +	$(OBJDIR)/nw_misc.o \
     	$(EOLIST)
     
    +# Pending tests
    +#	$(OBJDIR)/testpipe.o \
     	
     #
     # These are the LIB files needed to create the NLM target above.
    diff --git a/test/testproc.c b/test/testproc.c
    index 1c231c0099d..cdc538e2ece 100644
    --- a/test/testproc.c
    +++ b/test/testproc.c
    @@ -62,6 +62,8 @@
     /* XXX I'm sure there has to be a better way to do this ... */
     #ifdef WIN32
     #define EXTENSION ".exe"
    +#elif NETWARE
    +#define EXTENSION ".nlm"
     #else
     #define EXTENSION
     #endif
    
    From 06fc866929e6b10bdb58705c731ea898b1e7b2ec Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Fri, 20 Dec 2002 20:08:05 +0000
    Subject: [PATCH 4183/7878] NetWare makefile
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64202 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/nwgnuproc_child | 255 +++++++++++++++++++++++++++++++++++++++++++
     1 file changed, 255 insertions(+)
     create mode 100644 test/nwgnuproc_child
    
    diff --git a/test/nwgnuproc_child b/test/nwgnuproc_child
    new file mode 100644
    index 00000000000..404e339fd71
    --- /dev/null
    +++ b/test/nwgnuproc_child
    @@ -0,0 +1,255 @@
    +#
    +# Make sure all needed macro's are defined
    +#
    +
    +#
    +# Get the 'head' of the build environment if necessary.  This includes default
    +# targets and paths to tools
    +#
    +
    +ifndef EnvironmentDefined
    +include $(APR_WORK)\build\NWGNUhead.inc
    +endif
    +
    +#
    +# These directories will be at the beginning of the include list, followed by
    +# INCDIRS
    +#
    +XINCDIRS	+= \
    +			$(APR_WORK)/include \
    +			$(APR_WORK)/include/arch/NetWare \
    +			$(EOLIST)
    +
    +#
    +# These flags will come after CFLAGS
    +#
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +#
    +# These defines will come after DEFINES
    +#
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +#
    +# These flags will be added to the link.opt file
    +#
    +XLFLAGS		+= \
    +			$(EOLIST)
    +
    +#
    +# These values will be appended to the correct variables based on the value of
    +# RELEASE
    +#
    +ifeq "$(RELEASE)" "debug"
    +XINCDIRS	+= \
    +			$(EOLIST)
    +
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +XLFLAGS		+= \
    +			$(EOLIST)
    +						
    +endif
    +
    +ifeq "$(RELEASE)" "noopt"
    +XINCDIRS	+= \
    +			$(EOLIST)
    +
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +XLFLAGS		+= \
    +			$(EOLIST)
    +
    +			$(EOLIST)
    +endif
    +
    +ifeq "$(RELEASE)" "release"
    +XINCDIRS	+= \
    +			$(EOLIST)
    +
    +XCFLAGS		+= \
    +			$(EOLIST)
    +
    +XDEFINES	+= \
    +			$(EOLIST)
    +
    +XLFLAGS		+= \
    +			$(EOLIST)
    +endif
    +
    +#
    +# These are used by the link target if an NLM is being generated
    +# This is used by the link 'name' directive to name the nlm.  If left blank
    +# TARGET_nlm (see below) will be used.
    +#
    +NLM_NAME		=	proc_child
    +
    +#
    +# This is used by the link '-desc ' directive. 
    +# If left blank, NLM_NAME will be used.
    +#
    +NLM_DESCRIPTION	=  child NLM to test the proc layer
    +
    +#
    +# This is used by the '-threadname' directive.  If left blank,
    +# NLM_NAME Thread will be used.
    +#
    +NLM_THREAD_NAME	= proc_child
    +
    +#
    +# This is used by the '-screenname' directive.  If left blank,
    +# 'Apache for NetWare' Thread will be used.
    +#
    +NLM_SCREEN_NAME = DEFAULT
    +
    +#
    +# If this is specified, it will override VERSION value in 
    +# $(APR_WORK)\build\NWGNUenvironment.inc
    +#
    +NLM_VERSION		= 1,0,0
    +
    +#
    +# If this is specified, it will override the default of 64K
    +#
    +NLM_STACK_SIZE	= 
    +
    +#
    +# If this is specified it will be used by the link '-entry' directive
    +#
    +NLM_ENTRY_SYM	= _LibCPrelude
    +
    +#
    +# If this is specified it will be used by the link '-exit' directive
    +#
    +NLM_EXIT_SYM	= _LibCPostlude
    +
    +#
    +# If this is specified it will be used by the link '-check' directive
    +#
    +NLM_CHECK_SYM	=
    +
    +#
    +# If this is specified it will be used by the link '-flags' directive
    +#
    +NLM_FLAGS		= AUTOUNLOAD, PSEUDOPREEMPTION
    + 
    +#
    +# If this is specified it will be linked in with the XDCData option in the def 
    +# file instead of the default of $(APR)/misc/netware/apache.xdc.  XDCData can 
    +# be disabled by setting APACHE_UNIPROC in the environment
    +#
    +XDCDATA         = 
    +
    +#
    +# Declare all target files (you must add your files here)
    +#
    +
    +#
    +# If there is an NLM target, put it here
    +#
    +TARGET_nlm = \
    +	$(OBJDIR)/proc_child.nlm \
    +	$(EOLIST)
    +
    +#
    +# If there is an LIB target, put it here
    +#
    +TARGET_lib = \
    +	$(EOLIST)
    +
    +#
    +# These are the OBJ files needed to create the NLM target above.
    +# Paths must all use the '/' character
    +#
    +FILES_nlm_objs = \
    +	$(OBJDIR)/proc_child.o \
    +	$(EOLIST)
    +
    +#
    +# These are the LIB files needed to create the NLM target above.
    +# These will be added as a library command in the link.opt file.
    +#
    +FILES_nlm_libs = \
    +	libcpre.o \
    +	$(EOLIST)
    +
    +#
    +# These are the modules that the above NLM target depends on to load.
    +# These will be added as a module command in the link.opt file.
    +#
    +FILES_nlm_modules = \
    +	aprlib \
    +	Libc \
    +	$(EOLIST)
    +
    +#
    +# If the nlm has a msg file, put it's path here
    +#
    +FILE_nlm_msg =
    + 
    +#
    +# If the nlm has a hlp file put it's path here
    +#
    +FILE_nlm_hlp =
    +
    +#
    +# If this is specified, it will override the default copyright.
    +#
    +FILE_nlm_copyright =
    +
    +#
    +# Any additional imports go here
    +#
    +FILES_nlm_Ximports = \
    +	@$(APR)/aprlib.imp \
    +	@libc.imp \
    +	$(EOLIST)
    + 
    +#   
    +# Any symbols exported to here
    +#
    +FILES_nlm_exports = \
    +	$(EOLIST)
    +	
    +#   
    +# These are the OBJ files needed to create the LIB target above.
    +# Paths must all use the '/' character
    +#
    +FILES_lib_objs = \
    +	$(EOLIST)
    +
    +#
    +# implement targets and dependancies (leave this section alone)
    +#
    +
    +libs :: $(OBJDIR) $(TARGET_lib)
    +
    +nlms :: libs $(TARGET_nlm)
    +
    +#
    +# Updated this target to create necessary directories and copy files to the 
    +# correct place.  (See $(APR_WORK)\build\NWGNUhead.inc for examples)
    +#
    +install :: nlms FORCE
    +
    +#
    +# Any specialized rules here
    +#
    +
    +#
    +# Include the 'tail' makefile that has targets that depend on variables defined
    +# in this makefile
    +#
    +
    +include $(APR_WORK)\build\NWGNUtail.inc
    +
    
    From bb925a75634da4a5df7ea59689d1989ef74ae339 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Fri, 20 Dec 2002 20:23:10 +0000
    Subject: [PATCH 4184/7878] Fixed prototype mismatch
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64203 13f79535-47bb-0310-9956-ffa450edef68
    ---
     misc/netware/rand.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/misc/netware/rand.c b/misc/netware/rand.c
    index ea38026c61c..00ee5d619c1 100644
    --- a/misc/netware/rand.c
    +++ b/misc/netware/rand.c
    @@ -62,7 +62,7 @@
     #include 
     
     APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, 
    -                                                    int length) 
    +                                                    apr_size_t length) 
     {
         return NXSeedRandom(length, buf);
     }
    
    From c0e182dd5fcf8422cc29ccd07601b1b5ca023bfc Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 23 Dec 2002 09:34:13 +0000
    Subject: [PATCH 4185/7878]   As silly as this stub appears, it at least
     provides that apr may be   build (trivially) outside of any other build
     schema.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64204 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr.dsw | 41 +++++++++++++++++++++++++++++++++++++++++
     1 file changed, 41 insertions(+)
     create mode 100644 apr.dsw
    
    diff --git a/apr.dsw b/apr.dsw
    new file mode 100644
    index 00000000000..3688d9e61ad
    --- /dev/null
    +++ b/apr.dsw
    @@ -0,0 +1,41 @@
    +Microsoft Developer Studio Workspace File, Format Version 6.00
    +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
    +
    +###############################################################################
    +
    +Project: "apr"=".\apr.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +}}}
    +
    +###############################################################################
    +
    +Project: "libapr"=".\libapr.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +}}}
    +
    +###############################################################################
    +
    +Global:
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<3>
    +{{{
    +}}}
    +
    +###############################################################################
    +
    
    From ccb7c2056546c651146556e79bb7d4f85e7c34f5 Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Mon, 23 Dec 2002 20:41:17 +0000
    Subject: [PATCH 4186/7878] Allow apr_hash to have greater than int number of
     elements. (serf_spider needs a ridiculously large hash table.)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64205 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES            |  3 +++
     include/apr_hash.h |  2 +-
     tables/apr_hash.c  | 21 +++++++++++----------
     3 files changed, 15 insertions(+), 11 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 123e121d9c3..5fa81bdbee3 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,8 @@
     Changes with APR 0.9.2
     
    +  *) Allow apr_hash to have greater than int number of elements.
    +     [Justin Erenkrantz]
    +
       *) Allow generation of dependencies by non-GCC compilers.
          [Justin Erenkrantz]
     
    diff --git a/include/apr_hash.h b/include/apr_hash.h
    index 15a7f48c9a9..80fb1fccf9f 100644
    --- a/include/apr_hash.h
    +++ b/include/apr_hash.h
    @@ -190,7 +190,7 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key,
      * @param ht The hash table
      * @return The number of key/value pairs in the hash table.
      */
    -APR_DECLARE(int) apr_hash_count(apr_hash_t *ht);
    +APR_DECLARE(apr_size_t) apr_hash_count(apr_hash_t *ht);
     
     /**
      * Merge two hash tables into one new hash table. The values of the overlay
    diff --git a/tables/apr_hash.c b/tables/apr_hash.c
    index 4a0fc5dbef7..3947ecf6e2d 100644
    --- a/tables/apr_hash.c
    +++ b/tables/apr_hash.c
    @@ -84,7 +84,7 @@ typedef struct apr_hash_entry_t apr_hash_entry_t;
     
     struct apr_hash_entry_t {
         apr_hash_entry_t *next;
    -    int               hash;
    +    apr_size_t        hash;
         const void       *key;
         apr_ssize_t       klen;
         const void       *val;
    @@ -100,7 +100,7 @@ struct apr_hash_entry_t {
     struct apr_hash_index_t {
         apr_hash_t         *ht;
         apr_hash_entry_t   *this, *next;
    -    int                 index;
    +    apr_size_t          index;
     };
     
     /*
    @@ -114,7 +114,7 @@ struct apr_hash_t {
         apr_pool_t          *pool;
         apr_hash_entry_t   **array;
         apr_hash_index_t     iterator;  /* For apr_hash_first(NULL, ...) */
    -    int                  count, max;
    +    apr_size_t           count, max;
     };
     
     #define INITIAL_MAX 15 /* tunable == 2^n - 1 */
    @@ -124,7 +124,7 @@ struct apr_hash_t {
      * Hash creation functions.
      */
     
    -static apr_hash_entry_t **alloc_array(apr_hash_t *ht, int max)
    +static apr_hash_entry_t **alloc_array(apr_hash_t *ht, apr_size_t max)
     {
        return apr_pcalloc(ht->pool, sizeof(*ht->array) * (max + 1));
     }
    @@ -192,12 +192,13 @@ static void expand_array(apr_hash_t *ht)
     {
         apr_hash_index_t *hi;
         apr_hash_entry_t **new_array;
    -    int new_max;
    -    int i;
    +    apr_size_t new_max;
     
         new_max = ht->max * 2 + 1;
         new_array = alloc_array(ht, new_max);
         for (hi = apr_hash_first(NULL, ht); hi; hi = apr_hash_next(hi)) {
    +        apr_size_t i;
    +
             i = hi->this->hash & new_max;
             hi->this->next = new_array[i];
             new_array[i] = hi->this;
    @@ -222,7 +223,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht,
     {
         apr_hash_entry_t **hep, *he;
         const unsigned char *p;
    -    int hash;
    +    apr_size_t hash;
         apr_ssize_t i;
     
         /*
    @@ -303,7 +304,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool,
     {
         apr_hash_t *ht;
         apr_hash_entry_t *new_vals;
    -    int i, j;
    +    apr_size_t i, j;
     
         ht = apr_palloc(pool, sizeof(apr_hash_t) +
                         sizeof(*ht->array) * (orig->max + 1) +
    @@ -370,7 +371,7 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht,
         /* else key not present and val==NULL */
     }
     
    -APR_DECLARE(int) apr_hash_count(apr_hash_t *ht)
    +APR_DECLARE(apr_size_t) apr_hash_count(apr_hash_t *ht)
     {
         return ht->count;
     }
    @@ -397,7 +398,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p,
         apr_hash_entry_t *new_vals = NULL;
         apr_hash_entry_t *iter;
         apr_hash_entry_t *ent;
    -    int i,j,k;
    +    apr_size_t i,j,k;
     
     #ifdef POOL_DEBUG
         /* we don't copy keys and values, so it's necessary that
    
    From 9ad67ec7c0d3ae1a21196d9b71865e3d6dc621dc Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Tue, 24 Dec 2002 15:59:58 +0000
    Subject: [PATCH 4187/7878] Fix an infinite loop in apr_poll_socket_clear.
     Submitted by:	INOUE Seiichiro 
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64206 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/unix/pollacc.c | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/poll/unix/pollacc.c b/poll/unix/pollacc.c
    index 36a2c8c7c3c..d27ff4ad93e 100644
    --- a/poll/unix/pollacc.c
    +++ b/poll/unix/pollacc.c
    @@ -169,6 +169,7 @@ APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_
             if (curr->reqevents & events) {
                 curr->reqevents &= ~events;
             }
    +        curr++
         }
         return APR_SUCCESS;
     }
    
    From 2233a6e6ba86eb6b3e49fef17bf706b0705194b3 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Tue, 24 Dec 2002 20:21:06 +0000
    Subject: [PATCH 4188/7878] I forgot the ;. Submitted by:	Ben Laurie
     
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64207 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/unix/pollacc.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/poll/unix/pollacc.c b/poll/unix/pollacc.c
    index d27ff4ad93e..440273e610c 100644
    --- a/poll/unix/pollacc.c
    +++ b/poll/unix/pollacc.c
    @@ -169,7 +169,7 @@ APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_
             if (curr->reqevents & events) {
                 curr->reqevents &= ~events;
             }
    -        curr++
    +        curr++;
         }
         return APR_SUCCESS;
     }
    
    From f63bf7bcbf89e5a77eb4b1ecf68ba961d5539a54 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Thu, 26 Dec 2002 08:20:06 +0000
    Subject: [PATCH 4189/7878] OS/2: Fill out the possible OS error codes for
     APR_STATUS_IS_EEXIST.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64208 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 2194187d269..dbb916612d7 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -856,7 +856,10 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_EACCES(s)         ((s) == APR_EACCES \
                     || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \
                     || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION)
    -#define APR_STATUS_IS_EEXIST(s)         ((s) == APR_EEXIST)
    +#define APR_STATUS_IS_EEXIST(s)         ((s) == APR_EEXIST \
    +                || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \
    +                || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \
    +                || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS)
     #define APR_STATUS_IS_ENAMETOOLONG(s)   ((s) == APR_ENAMETOOLONG \
                     || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \
                     || (s) == APR_OS_START_SYSERR + SOCENAMETOOLONG)
    
    From 2817ba5d0da9077dbb724400c1f1a726a51ed385 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Thu, 26 Dec 2002 08:27:26 +0000
    Subject: [PATCH 4190/7878] OS/2: Fix file open flag manipulation so that
     APR_EXCL actually works. This also fixes a number of other testfile failures.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64209 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/os2/open.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/file_io/os2/open.c b/file_io/os2/open.c
    index 00fb4424676..3c1c80a452a 100644
    --- a/file_io/os2/open.c
    +++ b/file_io/os2/open.c
    @@ -120,7 +120,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr
     
         if (flag & APR_TRUNCATE) {
             oflags |= OPEN_ACTION_REPLACE_IF_EXISTS;
    -    } else if ((oflags & 0xF) == 0) {
    +    } else if ((oflags & 0xFF) == 0) {
             oflags |= OPEN_ACTION_OPEN_IF_EXISTS;
         }
         
    
    From 3a21b3fe89a76782354844261d9e0546e201c579 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sat, 28 Dec 2002 20:29:12 +0000
    Subject: [PATCH 4191/7878]   Remove the segfault from testfile.c and introduce
     new breakage.
    
      If the filehandle we are closing corresponds to a standard handle,
      we must protect against these dup2'ed handles in file_cleanup and
      invalidate the corresponding StdHandle entries, or they may point
      (in the future) to a newly reused handle identifier.
    
      Why testfile.c thinks it can close a std handle and then simply
      obtain it again is beyond me.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64210 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/open.c | 15 +++++++++++++++
     1 file changed, 15 insertions(+)
    
    diff --git a/file_io/win32/open.c b/file_io/win32/open.c
    index 2dd62ec8352..08eaaf0712b 100644
    --- a/file_io/win32/open.c
    +++ b/file_io/win32/open.c
    @@ -264,6 +264,21 @@ apr_status_t file_cleanup(void *thefile)
         apr_status_t flush_rv = APR_SUCCESS;
     
         if (file->filehand != INVALID_HANDLE_VALUE) {
    +
    +        /* In order to avoid later segfaults with handle 'reuse',
    +         * we must protect against the case that a dup2'ed handle
    +         * is being closed, and invalidate the corresponding StdHandle 
    +         */
    +        if (file->filehand == GetStdHandle(STD_ERROR_HANDLE)) {
    +            SetStdHandle(STD_ERROR_HANDLE, INVALID_HANDLE_VALUE);
    +        }
    +        else if (file->filehand == GetStdHandle(STD_OUTPUT_HANDLE)) {
    +            SetStdHandle(STD_OUTPUT_HANDLE, INVALID_HANDLE_VALUE);
    +        }
    +        else if (file->filehand == GetStdHandle(STD_INPUT_HANDLE)) {
    +            SetStdHandle(STD_INPUT_HANDLE, INVALID_HANDLE_VALUE);
    +        }
    +
             if (file->buffered) {
                 flush_rv = apr_file_flush((apr_file_t *)thefile);
             }
    
    From 61f561333a5168549d9d994094a307bda310b856 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sat, 28 Dec 2002 20:36:21 +0000
    Subject: [PATCH 4192/7878]   Several StdHandles may be defined as the same
     handle, handle that case.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64211 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filedup.c | 21 +++++++++++++--------
     file_io/win32/open.c    |  4 ++--
     2 files changed, 15 insertions(+), 10 deletions(-)
    
    diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c
    index 1ffae64412f..5919f26b5b5 100644
    --- a/file_io/win32/filedup.c
    +++ b/file_io/win32/filedup.c
    @@ -89,6 +89,9 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file,
     #endif /* !defined(_WIN32_WCE) */
     }
     
    +#define stdin_handle 0x01
    +#define stdout_handle 0x02
    +#define stderr_handle 0x04
     
     APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file,
                                             apr_file_t *old_file, apr_pool_t *p)
    @@ -96,7 +99,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file,
     #ifdef _WIN32_WCE
         return APR_ENOTIMPL;
     #else
    -    DWORD stdhandle = -1;
    +    DWORD stdhandle = 0;
         HANDLE hproc = GetCurrentProcess();
         HANDLE newhand = NULL;
         apr_int32_t newflags;
    @@ -107,22 +110,24 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file,
          * The os_handle will change, however.
          */
         if (new_file->filehand == GetStdHandle(STD_ERROR_HANDLE)) {
    -        stdhandle = STD_ERROR_HANDLE;
    +        stdhandle |= stderr_handle;
         }
    -    else if (new_file->filehand == GetStdHandle(STD_OUTPUT_HANDLE)) {
    -        stdhandle = STD_OUTPUT_HANDLE;
    +    if (new_file->filehand == GetStdHandle(STD_OUTPUT_HANDLE)) {
    +        stdhandle |= stdout_handle;
         }
    -    else if (new_file->filehand == GetStdHandle(STD_INPUT_HANDLE)) {
    -        stdhandle = STD_INPUT_HANDLE;
    +    if (new_file->filehand == GetStdHandle(STD_INPUT_HANDLE)) {
    +        stdhandle |= stdin_handle;
         }
     
    -    if (stdhandle != -1) {
    +    if (stdhandle) {
             if (!DuplicateHandle(hproc, old_file->filehand, 
                                  hproc, &newhand, 0,
                                  TRUE, DUPLICATE_SAME_ACCESS)) {
                 return apr_get_os_error();
             }
    -        if (!SetStdHandle(stdhandle, newhand)) {
    +        if (((stdhandle & stderr_handle) && !SetStdHandle(STD_ERROR_HANDLE, newhand)) ||
    +            ((stdhandle & stdout_handle) && !SetStdHandle(STD_OUTPUT_HANDLE, newhand)) ||
    +            ((stdhandle & stdin_handle) && !SetStdHandle(STD_INPUT_HANDLE, newhand))) {
                 return apr_get_os_error();
             }
             newflags = old_file->flags | APR_INHERIT;
    diff --git a/file_io/win32/open.c b/file_io/win32/open.c
    index 08eaaf0712b..ae15ed9a37a 100644
    --- a/file_io/win32/open.c
    +++ b/file_io/win32/open.c
    @@ -272,10 +272,10 @@ apr_status_t file_cleanup(void *thefile)
             if (file->filehand == GetStdHandle(STD_ERROR_HANDLE)) {
                 SetStdHandle(STD_ERROR_HANDLE, INVALID_HANDLE_VALUE);
             }
    -        else if (file->filehand == GetStdHandle(STD_OUTPUT_HANDLE)) {
    +        if (file->filehand == GetStdHandle(STD_OUTPUT_HANDLE)) {
                 SetStdHandle(STD_OUTPUT_HANDLE, INVALID_HANDLE_VALUE);
             }
    -        else if (file->filehand == GetStdHandle(STD_INPUT_HANDLE)) {
    +        if (file->filehand == GetStdHandle(STD_INPUT_HANDLE)) {
                 SetStdHandle(STD_INPUT_HANDLE, INVALID_HANDLE_VALUE);
             }
     
    
    From dbb537790b52c80817bc82570090d0e90a86b92d Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sat, 28 Dec 2002 20:39:49 +0000
    Subject: [PATCH 4193/7878]   Introduce APR_EPATHWILD to designate that a given
     apr_file_[l]stat()   was against a filename that included wildcards (on
     platforms where   wildcards are invalid filename characters, e.g. OS2, Win32
     etc.)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64212 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filestat.c | 5 ++++-
     include/apr_errno.h      | 4 ++++
     2 files changed, 8 insertions(+), 1 deletion(-)
    
    diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
    index d8c9b6c7d4d..429d26e721b 100644
    --- a/file_io/win32/filestat.c
    +++ b/file_io/win32/filestat.c
    @@ -78,7 +78,10 @@ static apr_status_t test_safe_name(const char *name)
         }
         while (*name) {
             if (!IS_FNCHAR(*name) && (*name != '\\') && (*name != '/')) {
    -            return APR_EBADPATH;
    +            if (*name == '?' || *name == '*')
    +                return APR_EPATHWILD;
    +            else
    +                return APR_EBADPATH;
             }
             ++name;
         }
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index dbb916612d7..196b740c7ca 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -307,6 +307,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_EABOVEROOT     (APR_OS_START_ERROR + 23)
     /** @see APR_STATUS_IS_EBADPATH */
     #define APR_EBADPATH       (APR_OS_START_ERROR + 24)
    +/** @see APR_STATUS_IS_EPATHWILD */
    +#define APR_EPATHWILD      (APR_OS_START_ERROR + 25)
     
     /* APR ERROR VALUE TESTS */
     /** 
    @@ -375,6 +377,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_EABOVEROOT(s)     ((s) == APR_EABOVEROOT)
     /** The given path was bad. */
     #define APR_STATUS_IS_EBADPATH(s)       ((s) == APR_EBADPATH)
    +/** The given path contained wildcards. */
    +#define APR_STATUS_IS_EPATHWILD(s)      ((s) == APR_EPATHWILD)
     
     /* APR STATUS VALUES */
     /** @see APR_STATUS_IS_INCHILD */
    
    From 854a9c13e1fd143dca1b93e09fa88c57c6dfe581 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sat, 28 Dec 2002 20:41:58 +0000
    Subject: [PATCH 4194/7878]   Grudgingly accept that folks may want to merge
     paths containing wildcard   characters... fail similarly to ENOENT/ENOTDIR,
     where we return the path   but emit the error as a precaution.  Folks
     interested in the results of   an invalid path merge need to look for those
     APR_STATUS_IS_xxx() results.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64213 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filepath.c | 9 ++++++++-
     include/apr_file_info.h  | 5 +++++
     2 files changed, 13 insertions(+), 1 deletion(-)
    
    diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c
    index 8e0d0ec55e6..417aa0c0b68 100644
    --- a/file_io/win32/filepath.c
    +++ b/file_io/win32/filepath.c
    @@ -952,9 +952,16 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath,
                 if (rv != APR_SUCCESS) {
                     if (APR_STATUS_IS_ENOENT(rv))
                         break;
    +                if (APR_STATUS_IS_EPATHWILD(rv))
    +                    /* This path included wildcards.  The path elements
    +                     * that did not contain wildcards are canonicalized,
    +                     * so we will return the path, although later elements
    +                     * don't necessarily exist, and aren't canonical.
    +                     */
    +                    break;
                     else if (APR_STATUS_IS_ENOTDIR(rv))
                         /* This is a little more serious, we just added a name
    -                     * onto a filename (think http's CGI MORE_INFO)
    +                     * onto a filename (think http's PATH_INFO)
                          * If the caller is foolish enough to do this, we expect
                          * the've already canonicalized the root) that they knew
                          * what they are doing :(
    diff --git a/include/apr_file_info.h b/include/apr_file_info.h
    index 2a6d0802e5e..717858d9eea 100644
    --- a/include/apr_file_info.h
    +++ b/include/apr_file_info.h
    @@ -373,6 +373,11 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath,
      * @param flags the desired APR_FILEPATH_ rules to apply when merging
      * @param p the pool to allocate the new path string from
      * @deffunc apr_status_t apr_filepath_merge(char **newpath, const char *rootpath, const char *addpath, apr_int32_t flags, apr_pool_t *p)
    + * @remark if the flag APR_FILEPATH_TRUENAME is given, and the addpath 
    + * contains wildcard characters ('*', '?') on platforms that don't support 
    + * such characters within filenames, the paths will be merged, but the 
    + * result code will be APR_EPATHWILD, and all further segments will not
    + * reflect the true filenames including the wildcard and following segments.
      */                        
     APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, 
                                                  const char *rootpath,
    
    From c11c1702b51b9b97ec52f5ac73658b0f29a6765e Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sat, 28 Dec 2002 20:43:59 +0000
    Subject: [PATCH 4195/7878]   Fix several bugs where handle creation failed. 
     Win32 doesn't (and other   platforms shouldn't) accept NULL as
     apr_file_close.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64214 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testdup.c | 18 +++++++++++-------
     1 file changed, 11 insertions(+), 7 deletions(-)
    
    diff --git a/test/testdup.c b/test/testdup.c
    index 68a03614073..b411f84ae1c 100644
    --- a/test/testdup.c
    +++ b/test/testdup.c
    @@ -61,7 +61,7 @@
     
     #define TEST "Testing\n"
     #define TEST2 "Testing again\n"
    -#define FILENAME "data/testdup.file"
    +#define FILEPATH "data/"
     
     static void test_file_dup(CuTest *tc)
     {
    @@ -71,7 +71,8 @@ static void test_file_dup(CuTest *tc)
         apr_finfo_t finfo;
     
         /* First, create a new file, empty... */
    -    rv = apr_file_open(&file1, FILENAME, APR_READ | APR_WRITE | APR_CREATE|
    +    rv = apr_file_open(&file1, FILEPATH "testdup.file", 
    +                       APR_READ | APR_WRITE | APR_CREATE |
                            APR_DELONCLOSE, APR_OS_DEFAULT, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertPtrNotNull(tc, file1);
    @@ -86,7 +87,7 @@ static void test_file_dup(CuTest *tc)
         /* cleanup after ourselves */
         rv = apr_file_close(file3);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    rv = apr_stat(&finfo, FILENAME, APR_FINFO_NORM, p);
    +    rv = apr_stat(&finfo, FILEPATH "testdup.file", APR_FINFO_NORM, p);
         CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv));
     }  
     
    @@ -101,7 +102,8 @@ static void test_file_readwrite(CuTest *tc)
         apr_off_t fpos;
     
         /* First, create a new file, empty... */
    -    rv = apr_file_open(&file1, FILENAME, APR_READ | APR_WRITE | APR_CREATE|
    +    rv = apr_file_open(&file1, FILEPATH "testdup.readwrite.file", 
    +                       APR_READ | APR_WRITE | APR_CREATE |
                            APR_DELONCLOSE, APR_OS_DEFAULT, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertPtrNotNull(tc, file1);
    @@ -130,7 +132,7 @@ static void test_file_readwrite(CuTest *tc)
     
         rv = apr_file_close(file3);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    rv = apr_stat(&finfo, FILENAME, APR_FINFO_NORM, p);
    +    rv = apr_stat(&finfo, FILEPATH "testdup.readwrite.file", APR_FINFO_NORM, p);
         CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv));
     }  
     
    @@ -140,7 +142,8 @@ static void test_dup2(CuTest *tc)
         apr_file_t *file3 = NULL;
         apr_status_t rv;
     
    -    rv = apr_file_open(&file2, FILENAME, APR_READ | APR_WRITE | APR_CREATE |
    +    rv = apr_file_open(&file2, FILEPATH "testdup2.file", 
    +                       APR_READ | APR_WRITE | APR_CREATE |
                            APR_DELONCLOSE, APR_OS_DEFAULT, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertPtrNotNull(tc, file2);
    @@ -165,7 +168,8 @@ static void test_dup2_readwrite(CuTest *tc)
         char buff[50];
         apr_off_t fpos;
     
    -    rv = apr_file_open(&file2, FILENAME, APR_READ | APR_WRITE | APR_CREATE |
    +    rv = apr_file_open(&file2, FILEPATH "testdup2.readwrite.file", 
    +                       APR_READ | APR_WRITE | APR_CREATE |
                            APR_DELONCLOSE, APR_OS_DEFAULT, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertPtrNotNull(tc, file2);
    
    From 17f02cea4dd31ba5a14b380c2acb48e857c91c9a Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sat, 28 Dec 2002 20:44:55 +0000
    Subject: [PATCH 4196/7878]   You cannot close files that failed to open.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64215 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfile.c | 12 ++++++++++--
     1 file changed, 10 insertions(+), 2 deletions(-)
    
    diff --git a/test/testfile.c b/test/testfile.c
    index 5e85d5a43c5..93d7b8c58e9 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -106,7 +106,13 @@ static void test_open_excl(CuTest *tc)
          */
         CuAssertPtrEquals(tc, NULL, thefile); 
     #endif
    -    apr_file_close(thefile);
    +    /* And this too is a bug... Win32 (correctly) does not allocate
    +     * an apr_file_t, and (correctly) returns NULL.  Closing objects
    +     * that failed to open is invalid.  Apparently someone is doing so.
    +     */
    +    if (thefile) {
    +        apr_file_close(thefile);
    +    }
     }
     
     static void test_open_read(CuTest *tc)
    @@ -200,7 +206,9 @@ static void test_open_write(CuTest *tc)
                            APR_WRITE, 
                            APR_UREAD | APR_UWRITE | APR_GREAD, p);
         CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv));
    -    apr_file_close(filetest);
    +    if (filetest) {
    +        apr_file_close(filetest);
    +    }
     }
     
     static void test_open_writecreate(CuTest *tc)
    
    From b086ec23a4ce99f8aad404e3c4584af87707c3a4 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 05:44:01 +0000
    Subject: [PATCH 4197/7878]   First; once any apr object is closed, the results
     are undefined.
    
      Second; if a platform does not use distinct 'libraries' and 'modules',
      the four _non_module tests (should have been named _library tests)
      don't apply; this includes Netware, Win32, BeOS and OS2.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64216 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testdso.c | 44 ++++++++++++--------------------------------
     1 file changed, 12 insertions(+), 32 deletions(-)
    
    diff --git a/test/testdso.c b/test/testdso.c
    index 43bc3e210d2..0daf209aae8 100644
    --- a/test/testdso.c
    +++ b/test/testdso.c
    @@ -66,7 +66,7 @@
     
     #ifdef NETWARE
     # define LIB_NAME "mod_test.nlm"
    -#elif defined(BEOS)
    +#elif defined(BEOS) || defined(WIN32)
     # define LIB_NAME "mod_test.so"
     #elif defined(DARWIN)
     # define LIB_NAME ".libs/mod_test.so" 
    @@ -155,17 +155,11 @@ static void test_unload_module(CuTest *tc)
     
         status = apr_dso_unload(h);
         CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
    -
    -    status = apr_dso_sym(&func1, h, "print_hello");
    -    CuAssertIntEquals(tc, APR_EINIT, status);
     }
     
     
     static void test_load_non_module(CuTest *tc)
     {
    -#ifndef LIB_NAME2
    -    CuNotImpl(tc, "Can't load non-module library");
    -#else
         apr_dso_handle_t *h = NULL;
         apr_status_t status;
         char errstr[256];
    @@ -175,14 +169,10 @@ static void test_load_non_module(CuTest *tc)
         CuAssertPtrNotNull(tc, h);
     
         apr_dso_unload(h);
    -#endif
     }
     
     static void test_dso_sym_non_module(CuTest *tc)
     {
    -#ifndef LIB_NAME2
    -    CuNotImpl(tc, "Can't load non-module library");
    -#else
         apr_dso_handle_t *h = NULL;
         apr_dso_handle_sym_t func1 = NULL;
         apr_status_t status;
    @@ -203,14 +193,10 @@ static void test_dso_sym_non_module(CuTest *tc)
         CuAssertStrEquals(tc, "Hello - I'm a DSO!\n", teststr);
     
         apr_dso_unload(h);
    -#endif
     }
     
     static void test_dso_sym_return_value_non_mod(CuTest *tc)
     {
    -#ifndef LIB_NAME2
    -    CuNotImpl(tc, "Can't load non-module library");
    -#else
         apr_dso_handle_t *h = NULL;
         apr_dso_handle_sym_t func1 = NULL;
         apr_status_t status;
    @@ -230,14 +216,10 @@ static void test_dso_sym_return_value_non_mod(CuTest *tc)
         CuAssertIntEquals(tc, 5, status);
     
         apr_dso_unload(h);
    -#endif
     }
     
     static void test_unload_non_module(CuTest *tc)
     {
    -#ifndef LIB_NAME2
    -    CuNotImpl(tc, "Can't load non-module library");
    -#else
         apr_dso_handle_t *h = NULL;
         apr_status_t status;
         char errstr[256];
    @@ -249,22 +231,20 @@ static void test_unload_non_module(CuTest *tc)
     
         status = apr_dso_unload(h);
         CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
    -
    -    status = apr_dso_sym(&func1, h, "print_hello");
    -    CuAssertIntEquals(tc, APR_EINIT, status);
    -#endif
     }
     
     static void test_load_notthere(CuTest *tc)
     {
         apr_dso_handle_t *h = NULL;
    +    char errstr[256];
         apr_status_t status;
     
         status = apr_dso_load(&h, "No_File.so", p);
    -    CuAssertIntEquals(tc, APR_EDSOOPEN, status);
    +    /* Original test was status == APR_EDSOOPEN, but that's not valid
    +     * with DSO_USE_SHL (HP/UX etc), OS2 or Win32.  Accept simple failure.
    +     */
    +    CuAssert(tc, apr_dso_error(h, errstr, 256), status);
         CuAssertPtrNotNull(tc, h);
    -
    -    apr_dso_unload(h);
     }    
     
     CuSuite *testdso(void)
    @@ -275,21 +255,21 @@ CuSuite *testdso(void)
         getcwd(filename, 256);
         filename = apr_pstrcat(p, filename, "/", LIB_NAME, NULL);
     
    -#ifdef LIB_NAME2
    -    filename2 = apr_pcalloc(p, 256);
    -    getcwd(filename2, 256);
    -    filename2 = apr_pstrcat(p, filename2, "/", LIB_NAME2, NULL);
    -#endif
    -
         SUITE_ADD_TEST(suite, test_load_module);
         SUITE_ADD_TEST(suite, test_dso_sym);
         SUITE_ADD_TEST(suite, test_dso_sym_return_value);
         SUITE_ADD_TEST(suite, test_unload_module);
     
    +#ifdef LIB_NAME2
    +    filename2 = apr_pcalloc(p, 256);
    +    getcwd(filename2, 256);
    +    filename2 = apr_pstrcat(p, filename2, "/", LIB_NAME2, NULL);
    +
         SUITE_ADD_TEST(suite, test_load_non_module);
         SUITE_ADD_TEST(suite, test_dso_sym_non_module);
         SUITE_ADD_TEST(suite, test_dso_sym_return_value_non_mod);
         SUITE_ADD_TEST(suite, test_unload_non_module);
    +#endif
     
         SUITE_ADD_TEST(suite, test_load_notthere);
     
    
    From ba5847d39b7b0bfd690edb1ca48c6ebd8cf48255 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 05:45:15 +0000
    Subject: [PATCH 4198/7878]   Clean up these dup2 tests by retaining the
     original stderr file while   testing the substitution of an alternate stderr
     (with dup2) and finally   replacing stderr with it's original, rather than
     closing it.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64217 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testdup.c | 60 ++++++++++++++++++++++++++++++++------------------
     1 file changed, 39 insertions(+), 21 deletions(-)
    
    diff --git a/test/testdup.c b/test/testdup.c
    index b411f84ae1c..ef36f2c9dec 100644
    --- a/test/testdup.c
    +++ b/test/testdup.c
    @@ -138,66 +138,84 @@ static void test_file_readwrite(CuTest *tc)
     
     static void test_dup2(CuTest *tc)
     {
    -    apr_file_t *file2 = NULL;
    -    apr_file_t *file3 = NULL;
    +    apr_file_t *testfile = NULL;
    +    apr_file_t *errfile = NULL;
    +    apr_file_t *saveerr = NULL;
         apr_status_t rv;
     
    -    rv = apr_file_open(&file2, FILEPATH "testdup2.file", 
    +    rv = apr_file_open(&testfile, FILEPATH "testdup2.file", 
                            APR_READ | APR_WRITE | APR_CREATE |
                            APR_DELONCLOSE, APR_OS_DEFAULT, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertPtrNotNull(tc, file2);
    +    CuAssertPtrNotNull(tc, testfile);
     
    -    rv = apr_file_open_stderr(&file3, p);
    +    rv = apr_file_open_stderr(&errfile, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
    -    rv = apr_file_dup2(file3, file2, p);
    +    /* Set aside the real errfile */
    +    rv = apr_file_dup(&saveerr, errfile, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertPtrNotNull(tc, file3);
    +    CuAssertPtrNotNull(tc, saveerr);
    +
    +    rv = apr_file_dup2(errfile, testfile, p);
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    CuAssertPtrNotNull(tc, errfile);
    +
    +    apr_file_close(testfile);
     
    -    apr_file_close(file2);
    -    apr_file_close(file3);
    +    rv = apr_file_dup2(errfile, saveerr, p);
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    CuAssertPtrNotNull(tc, errfile);
     }
     
     static void test_dup2_readwrite(CuTest *tc)
     {
    -    apr_file_t *file3 = NULL;
    -    apr_file_t *file2 = NULL;
    +    apr_file_t *errfile = NULL;
    +    apr_file_t *testfile = NULL;
    +    apr_file_t *saveerr = NULL;
         apr_status_t rv;
         apr_size_t txtlen = sizeof(TEST);
         char buff[50];
         apr_off_t fpos;
     
    -    rv = apr_file_open(&file2, FILEPATH "testdup2.readwrite.file", 
    +    rv = apr_file_open(&testfile, FILEPATH "testdup2.readwrite.file", 
                            APR_READ | APR_WRITE | APR_CREATE |
                            APR_DELONCLOSE, APR_OS_DEFAULT, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertPtrNotNull(tc, file2);
    +    CuAssertPtrNotNull(tc, testfile);
     
    -    rv = apr_file_open_stderr(&file3, p);
    +    rv = apr_file_open_stderr(&errfile, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
    -    rv = apr_file_dup2(file3, file2, p);
    +    /* Set aside the real errfile */
    +    rv = apr_file_dup(&saveerr, errfile, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertPtrNotNull(tc, file3);
    +    CuAssertPtrNotNull(tc, saveerr);
    +
    +    rv = apr_file_dup2(errfile, testfile, p);
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    CuAssertPtrNotNull(tc, errfile);
     
         txtlen = sizeof(TEST2);
    -    rv = apr_file_write(file3, TEST2, &txtlen);
    +    rv = apr_file_write(errfile, TEST2, &txtlen);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertIntEquals(tc, sizeof(TEST2), txtlen);
     
         fpos = 0;
    -    rv = apr_file_seek(file2, APR_SET, &fpos);
    +    rv = apr_file_seek(testfile, APR_SET, &fpos);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertIntEquals(tc, 0, fpos);
     
         txtlen = 50;
    -    rv = apr_file_read(file2, buff, &txtlen);
    +    rv = apr_file_read(testfile, buff, &txtlen);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertStrEquals(tc, TEST2, buff);
           
    -    apr_file_close(file2);
    -    apr_file_close(file3);
    +    apr_file_close(testfile);
    +
    +    rv = apr_file_dup2(errfile, saveerr, p);
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    CuAssertPtrNotNull(tc, errfile);
     }
     
     CuSuite *testdup(void)
    
    From a9a3d9d1bfccc30f86a282d1c5a35b43b413b55b Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 05:48:51 +0000
    Subject: [PATCH 4199/7878]   Remove a bogus test.  All of the original
     architects have argued against   testing for bogus (invalid) combinations of
     bits.  This test checked a   POSIX behavior of requiring the caller to
     request read and/or write access.
    
      On Win32 and some other platforms that support metadata access, opening
      a file internally for no read or write access is entirely valid.  E.g. to
      modify the meta information, especially about directories on platforms
      that don't support opening 'directories' for read/write access, APR already
      uses apr_file_open() to handle the file metadata access.  I see no
      compelling reason to emulate POSIX's fail-on-no-read-or-write-request
      behavior.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64218 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfile.c | 22 ----------------------
     1 file changed, 22 deletions(-)
    
    diff --git a/test/testfile.c b/test/testfile.c
    index 93d7b8c58e9..1e2656eac6d 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -68,27 +68,6 @@
     #define APR_BUFFERSIZE   4096 /* This should match APR's buffer size. */
     
     
    -
    -static void test_open_noreadwrite(CuTest *tc)
    -{
    -    apr_status_t rv;
    -    apr_file_t *thefile = NULL;
    -
    -    rv = apr_file_open(&thefile, FILENAME,
    -                       APR_CREATE | APR_EXCL, 
    -                       APR_UREAD | APR_UWRITE | APR_GREAD, p);
    -    CuAssertTrue(tc, rv != APR_SUCCESS);
    -    CuAssertIntEquals(tc, 1, APR_STATUS_IS_EACCES(rv));
    -#if 0
    -    /* I consider this a bug, if we are going to return an error, we shouldn't
    -     * allocate the file pointer.  But, this would make us fail the text, so
    -     * I am commenting it out for now.
    -     */
    -    CuAssertPtrEquals(tc, NULL, thefile); 
    -#endif
    -    apr_file_close(thefile);
    -}
    -
     static void test_open_excl(CuTest *tc)
     {
         apr_status_t rv;
    @@ -525,7 +504,6 @@ CuSuite *testfile(void)
     {
         CuSuite *suite = CuSuiteNew("File I/O");
     
    -    SUITE_ADD_TEST(suite, test_open_noreadwrite);
         SUITE_ADD_TEST(suite, test_open_excl);
         SUITE_ADD_TEST(suite, test_open_read);
         SUITE_ADD_TEST(suite, test_open_readwrite);
    
    From 167121da62ac3818aa9e2a0f5d136e5aae00e176 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 05:51:43 +0000
    Subject: [PATCH 4200/7878]   After recovering the 'manditory' bits, confirm
     that fields are identical   one-by-one for diagnostics.  You can't simply
     memcmp() all of the fields,   such as ->valid, because some platforms don't
     obtain the same information   from both the stat() of a filename and the
     getfileinfo() of an open handle.
    
      Even the filename is "unknowable" against a file handle, since one of many
      filenames could have been used to access that file.
    
      Finally, there is one test that (correctly) fails, the APR_FINFO_PROT
      values on Win32 don't agree.  I suspect we are really getting the perms
      of the 'open file handle' rather than the 'filesystem object'.  Researching.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64219 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfileinfo.c | 88 +++++++++++++++++++++++++++++++--------------
     1 file changed, 61 insertions(+), 27 deletions(-)
    
    diff --git a/test/testfileinfo.c b/test/testfileinfo.c
    index 70071eaddf5..bb41083de54 100644
    --- a/test/testfileinfo.c
    +++ b/test/testfileinfo.c
    @@ -84,29 +84,59 @@ static const struct view_fileinfo
         {0,                NULL}
     }; 
     
    -static int finfo_equal(apr_finfo_t f1, apr_finfo_t f2)
    +static void finfo_equal(CuTest *tc, apr_finfo_t f1, apr_finfo_t f2)
     {
    -    return (f1.valid == f2.valid &&
    -            f1.protection == f2.protection &&
    -            f1.filetype == f2.filetype &&
    -            f1.user == f2.user &&
    -            f1.group == f2.group &&
    -            f1.inode == f2.inode &&
    -            f1.device == f2.device &&
    -            f1.nlink == f2.nlink &&
    -            f1.size == f2.size &&
    -/*  Can't check csize, we don't fill it out, which makes me wonder why it
    - *  is still there.
    - *          f1.csize == f2.csize &&
    - */
    -            f1.atime == f2.atime &&
    -            f1.mtime == f2.mtime &&
    -            f1.ctime == f2.ctime &&
    -            !strcmp(f1.fname, f2.fname));
    -/*  We also can't check name, because it is only ever set on Unix.  This 
    - *  means that we have non-portable fields in a transparant structure.
    -            !strcmp(f1.name, f2.name));
    - */
    +    /* Minimum supported flags across all platforms (APR_FINFO_MIN) */
    +    CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_TYPE",
    +             (f1.valid & f2.valid & APR_FINFO_TYPE));
    +    CuAssert(tc, "apr_stat and apr_getfileinfo differ in filetype",
    +             f1.filetype == f2.filetype);
    +    CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_SIZE",
    +             (f1.valid & f2.valid & APR_FINFO_SIZE));
    +    CuAssert(tc, "apr_stat and apr_getfileinfo differ in size",
    +             f1.size == f2.size);
    +    CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_ATIME",
    +             (f1.valid & f2.valid & APR_FINFO_ATIME));
    +    CuAssert(tc, "apr_stat and apr_getfileinfo differ in atime",
    +             f1.atime == f2.atime);
    +    CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_MTIME",
    +             (f1.valid & f2.valid & APR_FINFO_MTIME));
    +    CuAssert(tc, "apr_stat and apr_getfileinfo differ in mtime",
    +             f1.mtime == f2.mtime);
    +    CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_CTIME",
    +             (f1.valid & f2.valid & APR_FINFO_CTIME));
    +    CuAssert(tc, "apr_stat and apr_getfileinfo differ in ctime",
    +             f1.ctime == f2.ctime);
    +
    +    if (f1.valid & f2.valid & APR_FINFO_NAME)
    +        CuAssert(tc, "apr_stat and apr_getfileinfo differ in name",
    +                 !strcmp(f1.name, f2.name));
    +    if (f1.fname && f2.fname)
    +        CuAssert(tc, "apr_stat and apr_getfileinfo differ in fname",
    +                 !strcmp(f1.fname, f2.fname));
    +
    +    /* Additional supported flags not supported on all platforms */
    +    if (f1.valid & f2.valid & APR_FINFO_USER)
    +        CuAssert(tc, "apr_stat and apr_getfileinfo differ in user",
    +                 !apr_uid_compare(f1.user, f2.user));
    +    if (f1.valid & f2.valid & APR_FINFO_GROUP)
    +        CuAssert(tc, "apr_stat and apr_getfileinfo differ in group",
    +                 !apr_gid_compare(f1.group, f2.group));
    +    if (f1.valid & f2.valid & APR_FINFO_INODE)
    +        CuAssert(tc, "apr_stat and apr_getfileinfo differ in inode",
    +                 f1.inode == f2.inode);
    +    if (f1.valid & f2.valid & APR_FINFO_DEV)
    +        CuAssert(tc, "apr_stat and apr_getfileinfo differ in device",
    +                 f1.device == f2.device);
    +    if (f1.valid & f2.valid & APR_FINFO_NLINK)
    +        CuAssert(tc, "apr_stat and apr_getfileinfo differ in nlink",
    +                 f1.nlink == f2.nlink);
    +    if (f1.valid & f2.valid & APR_FINFO_CSIZE)
    +        CuAssert(tc, "apr_stat and apr_getfileinfo differ in csize",
    +                 f1.csize == f2.csize);
    +    if (f1.valid & f2.valid & APR_FINFO_PROT)
    +        CuAssert(tc, "apr_stat and apr_getfileinfo differ in protection",
    +                 f1.protection == f2.protection);
     }
     
     static void test_info_get(CuTest *tc)
    @@ -161,16 +191,20 @@ static void test_stat_eq_finfo(CuTest *tc)
         apr_finfo_t stat_finfo;
         apr_status_t rv;
     
    -    rv = apr_stat(&stat_finfo, FILENAME, APR_FINFO_NORM, p);
    -    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -
         rv = apr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile);
    +
    +    /* Opening the file may have toggled the atime member (time last
    +     * accessed), so fetch our apr_stat() after getting the fileinfo 
    +     * of the open file...
    +     */
    +    rv = apr_stat(&stat_finfo, FILENAME, APR_FINFO_NORM, p);
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +
         apr_file_close(thefile);
     
    -    CuAssert(tc, "results from apr_stat are not identical to results "
    -                 "from apr_finfo", finfo_equal(stat_finfo, finfo));
    +    finfo_equal(tc, stat_finfo, finfo);
     }
     
     CuSuite *testfileinfo(void)
    
    From 0d6ebfba24bfb60deffc4653bdbc0ea1b4fe5620 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 05:56:00 +0000
    Subject: [PATCH 4201/7878]   Get testall building within the studio
     environment for debugging on win32.   This is BS to maintain two build files,
     but as long as everyone shares the   responsibility for keeping them in sync,
     I can ignore this from now on.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64220 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.win |  35 +++----
     test/testall.dsp  | 249 ++++++++++++++++++++++++++++++++++++++++++++++
     test/testall.dsw  | 122 +++++++++++++++++++++++
     3 files changed, 389 insertions(+), 17 deletions(-)
     create mode 100644 test/testall.dsp
     create mode 100644 test/testall.dsw
    
    diff --git a/test/Makefile.win b/test/Makefile.win
    index 0ce28b22adb..6c03343fb81 100644
    --- a/test/Makefile.win
    +++ b/test/Makefile.win
    @@ -1,4 +1,5 @@
     
    +LINK=link /nologo
     
     NONPORTABLE = \
     	testshm.exe \
    @@ -13,13 +14,15 @@ PROGRAMS = \
     	testshmconsumer.exe \
     	testatomic.exe \
     	testmutexscope.exe \
    -	testall.exe
    +	testall.exe \
    +	mod_test.so
     
     
    -TARGETS = $(PROGRAMS) $(NONPORTABLE) client.exe sendfile.exe \
    +TARGETS = $(PROGRAMS) client.exe sendfile.exe \
     	server.exe 
     
     LOCAL_LIBS=..\LibD\apr.lib 
    +ALL_LIBS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib
     
     CLEAN_TARGETS = mod_test.slo proc_child.exe occhild.exe \
     	        testprocmutex.exe testglobalmutex.exe testshm.exe
    @@ -27,8 +30,10 @@ CLEAN_TARGETS = mod_test.slo proc_child.exe occhild.exe \
     INCDIR=../include
     INCLUDES=/I "$(INCDIR)"
     
    +all: $(TARGETS)
    +
     clean:
    -	del $(CLEAN_TARGETS) $(PROGRAMS) *.obj
    +	-del $(CLEAN_TARGETS) $(PROGRAMS) *.obj 2>NUL
     
     .c.obj:
     	cl /nologo /c /MDd /W3 /GX /Zi /Od /DWIN32 /D_DEBUG /D_WINDOWS /DAPR_DECLARE_STATIC $(INCLUDES) $<
    @@ -42,15 +47,12 @@ occhild.exe: occhild.obj $(LOCAL_LIBS)
     proc_child.exe: proc_child.obj $(LOCAL_LIBS)
     	$(LINK) proc_child.obj $(LOCAL_LIBS) $(ALL_LIBS)
     
    -# FIXME: -prefer-pic is only supported with libtool-1.4+
    -mod_test.so: $(srcdir)/mod_test.c
    -	$(LIBTOOL) --mode=compile $(COMPILE) -prefer-pic -c $(srcdir)/mod_test.c && touch $@
    -
    -mod_test.la: mod_test.slo $(LOCAL_LIBS)
    -	$(LINK) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.obj $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@
    -
    -libmod_test.la: mod_test.slo $(LOCAL_LIBS)
    -	$(LINK) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.obj $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@
    +# FIXME: This is BS ... we should deal with namespace decoration within the
    +# apr_dso_sym() function or within the test (take y'r pick) since many platforms
    +# have decoration and decoration issues.
    +mod_test.so: mod_test.obj
    +	$(LINK) mod_test.obj /dll /out:mod_test.so $(LOCAL_LIBS) $(ALL_LIBS) \
    +		/export:print_hello /export:count_reps
     
     testlockperf.exe: testlockperf.obj $(LOCAL_LIBS)
     	$(LINK) testlockperf.obj $(LOCAL_LIBS) $(ALL_LIBS)
    @@ -95,10 +97,9 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \
     	testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \
     	testhash.obj testargs.obj testnames.obj testuser.obj
     
    -testall: $(TESTS) \
    -	 CuTest.obj $(LOCAL_LIBS)
    -	link /nologo /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \
    -	$(LOCAL_LIBS) kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib
    -
    +testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS)
    +	$(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \
    +		$(LOCAL_LIBS) $(ALL_LIBS)
    +	
     
     # DO NOT REMOVE
    diff --git a/test/testall.dsp b/test/testall.dsp
    new file mode 100644
    index 00000000000..22bd28d7665
    --- /dev/null
    +++ b/test/testall.dsp
    @@ -0,0 +1,249 @@
    +# Microsoft Developer Studio Project File - Name="testall" - Package Owner=<4>
    +# Microsoft Developer Studio Generated Build File, Format Version 6.00
    +# ** DO NOT EDIT **
    +
    +# TARGTYPE "Win32 (x86) External Target" 0x0106
    +
    +CFG=testall - Win32 Debug
    +!MESSAGE This is not a valid makefile. To build this project using NMAKE,
    +!MESSAGE use the Export Makefile command and run
    +!MESSAGE 
    +!MESSAGE NMAKE /f "testall.mak".
    +!MESSAGE 
    +!MESSAGE You can specify a configuration when running NMAKE
    +!MESSAGE by defining the macro CFG on the command line. For example:
    +!MESSAGE 
    +!MESSAGE NMAKE /f "testall.mak" CFG="testall - Win32 Debug"
    +!MESSAGE 
    +!MESSAGE Possible choices for configuration are:
    +!MESSAGE 
    +!MESSAGE "testall - Win32 Release" (based on "Win32 (x86) External Target")
    +!MESSAGE "testall - Win32 Debug" (based on "Win32 (x86) External Target")
    +!MESSAGE 
    +
    +# Begin Project
    +# PROP AllowPerConfigDependencies 0
    +# PROP Scc_ProjName ""
    +# PROP Scc_LocalPath ""
    +
    +!IF  "$(CFG)" == "testall - Win32 Release"
    +
    +# PROP BASE Use_MFC 0
    +# PROP BASE Use_Debug_Libraries 0
    +# PROP BASE Output_Dir ""
    +# PROP BASE Intermediate_Dir ""
    +# PROP BASE Cmd_Line "NMAKE /f Makefile.win testall.exe"
    +# PROP BASE Rebuild_Opt "/a"
    +# PROP BASE Target_File "testall.exe"
    +# PROP BASE Bsc_Name "testall.bsc"
    +# PROP BASE Target_Dir ""
    +# PROP Use_MFC 0
    +# PROP Use_Debug_Libraries 0
    +# PROP Output_Dir ""
    +# PROP Intermediate_Dir ""
    +# PROP Cmd_Line "NMAKE /f Makefile.win testall.exe"
    +# PROP Rebuild_Opt "/a"
    +# PROP Target_File "testall.exe"
    +# PROP Bsc_Name ""
    +# PROP Target_Dir ""
    +
    +!ELSEIF  "$(CFG)" == "testall - Win32 Debug"
    +
    +# PROP BASE Use_MFC 0
    +# PROP BASE Use_Debug_Libraries 1
    +# PROP BASE Output_Dir ""
    +# PROP BASE Intermediate_Dir ""
    +# PROP BASE Cmd_Line "NMAKE /f Makefile.win testall.exe"
    +# PROP BASE Rebuild_Opt "/a"
    +# PROP BASE Target_File "testall.exe"
    +# PROP BASE Bsc_Name "testall.bsc"
    +# PROP BASE Target_Dir ""
    +# PROP Use_MFC 0
    +# PROP Use_Debug_Libraries 1
    +# PROP Output_Dir ""
    +# PROP Intermediate_Dir ""
    +# PROP Cmd_Line "NMAKE /f Makefile.win testall.exe"
    +# PROP Rebuild_Opt "/a"
    +# PROP Target_File "testall.exe"
    +# PROP Bsc_Name ""
    +# PROP Target_Dir ""
    +
    +!ENDIF 
    +
    +# Begin Target
    +
    +# Name "testall - Win32 Release"
    +# Name "testall - Win32 Debug"
    +
    +!IF  "$(CFG)" == "testall - Win32 Release"
    +
    +!ELSEIF  "$(CFG)" == "testall - Win32 Debug"
    +
    +!ENDIF 
    +
    +# Begin Source File
    +
    +SOURCE=.\Makefile.win
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testall.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testapp.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testargs.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testatomic.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testdir.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testdso.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testdup.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testfile.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testfileinfo.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testflock.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testfmt.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testglobalmutex.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testhash.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testipsub.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testlock.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testlockperf.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testmmap.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testmutexscope.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testnames.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testoc.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testpipe.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testpoll.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testpools.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testproc.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testprocmutex.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testrand.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testshm.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testshmconsumer.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testshmproducer.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testsleep.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testsock.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testsockets.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testsockopt.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\teststr.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testtable.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testthread.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testtime.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testud.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testuser.c
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\testvsn.c
    +# End Source File
    +# End Target
    +# End Project
    diff --git a/test/testall.dsw b/test/testall.dsw
    new file mode 100644
    index 00000000000..f4be05d975b
    --- /dev/null
    +++ b/test/testall.dsw
    @@ -0,0 +1,122 @@
    +Microsoft Developer Studio Workspace File, Format Version 6.00
    +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
    +
    +###############################################################################
    +
    +Project: "apr"="..\apr.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +}}}
    +
    +###############################################################################
    +
    +Project: "apr_app"="..\build\apr_app.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +    Begin Project Dependency
    +    Project_Dep_Name apr
    +    End Project Dependency
    +}}}
    +
    +###############################################################################
    +
    +Project: "testall"=".\testall.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +    Begin Project Dependency
    +    Project_Dep_Name apr
    +    End Project Dependency
    +}}}
    +
    +###############################################################################
    +
    +Project: "libapr"="..\libapr.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +}}}
    +
    +###############################################################################
    +
    +Project: "libapr_app"="..\build\libapr_app.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +    Begin Project Dependency
    +    Project_Dep_Name libapr
    +    End Project Dependency
    +}}}
    +
    +###############################################################################
    +
    +Project: "testapp"=".\testapp.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +    Begin Project Dependency
    +    Project_Dep_Name apr
    +    End Project Dependency
    +    Begin Project Dependency
    +    Project_Dep_Name apr_app
    +    End Project Dependency
    +}}}
    +
    +###############################################################################
    +
    +Project: "testappnt"=".\testappnt.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +    Begin Project Dependency
    +    Project_Dep_Name apr
    +    End Project Dependency
    +    Begin Project Dependency
    +    Project_Dep_Name apr_app
    +    End Project Dependency
    +}}}
    +
    +###############################################################################
    +
    +Global:
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<3>
    +{{{
    +}}}
    +
    +###############################################################################
    +
    
    From d52ae8aee76dd993a301c752c53b853becae97f4 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 05:56:58 +0000
    Subject: [PATCH 4202/7878]   New ignore goodness
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64221 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/.cvsignore | 7 ++++++-
     1 file changed, 6 insertions(+), 1 deletion(-)
    
    diff --git a/test/.cvsignore b/test/.cvsignore
    index 30f84375858..d37e3cf8d1f 100644
    --- a/test/.cvsignore
    +++ b/test/.cvsignore
    @@ -53,7 +53,9 @@ testipsub
     *.ilk
     *.pdb
     *.idb
    -mod_test.dll
    +mod_test.exp
    +mod_test.lib
    +mod_test.so
     testnames
     *.dbg
     testmem
    @@ -70,4 +72,7 @@ testregex
     testmutexscope
     testtable
     testall
    +testall.ncb
    +testall.opt
    +testall.plg
     proc_child
    
    From d6c121d9564fb0e06187ea6ba470cb4a01732b77 Mon Sep 17 00:00:00 2001
    From: Thom May 
    Date: Sun, 29 Dec 2002 19:19:28 +0000
    Subject: [PATCH 4203/7878] Apply a patch to fix make check in test from Matt
     Kraai, extended to run testall during make check. Submitted by: Matt Kraai
      Reviewed by: Thom May
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64222 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in | 8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index e4497f16b1e..56b9d56b79f 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -33,13 +33,13 @@ INCLUDES=-I$(INCDIR)
     
     CFLAGS=$(MY_CFLAGS)
     
    -check: $(PROGRAMS) $(NONPORTABLE)
    -	for prog in $(PROGRAMS) $(NONPORTABLE); do \
    +check: $(PROGRAMS) $(NONPORTABLE) testall
    +	for prog in $(PROGRAMS) $(NONPORTABLE) testall; do \
     		./$$prog; \
    -		if test $$i = 255; then \
    +		if test $$? = 255; then \
     			echo "$$prog failed"; \
     			break; \
    -		fi \
    +		fi; \
     	done
     
     testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS)
    
    From 2e23334dbae42a0c9d23cc8b51daeaa3b7cf1ac5 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 19:31:07 +0000
    Subject: [PATCH 4204/7878]   Revert the bit from rev 1.31 that Rbb objects
     to... continue to test   undefined/undocumented behavior.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64223 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testdso.c | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/test/testdso.c b/test/testdso.c
    index 0daf209aae8..2ed53f3e069 100644
    --- a/test/testdso.c
    +++ b/test/testdso.c
    @@ -155,6 +155,9 @@ static void test_unload_module(CuTest *tc)
     
         status = apr_dso_unload(h);
         CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
    +
    +    status = apr_dso_sym(&func1, h, "print_hello");
    +    CuAssertIntEquals(tc, APR_EINIT, status);
     }
     
     
    
    From 6ba38aa6a604b6a492fe16e60c062aa4773e5183 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 19:37:24 +0000
    Subject: [PATCH 4205/7878]   Reclassify LIB and LIB2 as MOD and LIB
     (corresponding to loadable modules   and libraries, respectively.) 
     Re-introduce a single CuNotImpl for those   cases where LIB is undefined.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64224 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testdso.c | 75 +++++++++++++++++++++++++++-----------------------
     1 file changed, 41 insertions(+), 34 deletions(-)
    
    diff --git a/test/testdso.c b/test/testdso.c
    index 2ed53f3e069..2d04507c2f7 100644
    --- a/test/testdso.c
    +++ b/test/testdso.c
    @@ -65,22 +65,22 @@
     #endif
     
     #ifdef NETWARE
    -# define LIB_NAME "mod_test.nlm"
    +# define MOD_NAME "mod_test.nlm"
     #elif defined(BEOS) || defined(WIN32)
    -# define LIB_NAME "mod_test.so"
    +# define MOD_NAME "mod_test.so"
     #elif defined(DARWIN)
    -# define LIB_NAME ".libs/mod_test.so" 
    -# define LIB_NAME2 ".libs/libmod_test.dylib" 
    +# define MOD_NAME ".libs/mod_test.so" 
    +# define LIB_NAME ".libs/libmod_test.dylib" 
     #elif defined(__hpux__)
    -# define LIB_NAME ".libs/mod_test.sl"
    -# define LIB_NAME2 ".libs/libmod_test.sl"
    +# define MOD_NAME ".libs/mod_test.sl"
    +# define LIB_NAME ".libs/libmod_test.sl"
     #else /* Every other Unix */
    -# define LIB_NAME ".libs/mod_test.so"
    -# define LIB_NAME2 ".libs/libmod_test.so"
    +# define MOD_NAME ".libs/mod_test.so"
    +# define LIB_NAME ".libs/libmod_test.so"
     #endif
     
    -static char *filename;
    -static char *filename2;
    +static char *modname;
    +static char *libname;
     
     static void test_load_module(CuTest *tc)
     {
    @@ -88,7 +88,7 @@ static void test_load_module(CuTest *tc)
         apr_status_t status;
         char errstr[256];
     
    -    status = apr_dso_load(&h, filename, p);
    +    status = apr_dso_load(&h, modname, p);
         CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
         CuAssertPtrNotNull(tc, h);
     
    @@ -104,7 +104,7 @@ static void test_dso_sym(CuTest *tc)
         char teststr[256];
         char errstr[256];
     
    -    status = apr_dso_load(&h, filename, p);
    +    status = apr_dso_load(&h, modname, p);
         CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
         CuAssertPtrNotNull(tc, h);
     
    @@ -127,7 +127,7 @@ static void test_dso_sym_return_value(CuTest *tc)
         int (*function)(int);
         char errstr[256];
     
    -    status = apr_dso_load(&h, filename, p);
    +    status = apr_dso_load(&h, modname, p);
         CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
         CuAssertPtrNotNull(tc, h);
     
    @@ -149,7 +149,7 @@ static void test_unload_module(CuTest *tc)
         char errstr[256];
         apr_dso_handle_sym_t func1 = NULL;
     
    -    status = apr_dso_load(&h, filename, p);
    +    status = apr_dso_load(&h, modname, p);
         CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
         CuAssertPtrNotNull(tc, h);
     
    @@ -161,20 +161,20 @@ static void test_unload_module(CuTest *tc)
     }
     
     
    -static void test_load_non_module(CuTest *tc)
    +static void test_load_library(CuTest *tc)
     {
         apr_dso_handle_t *h = NULL;
         apr_status_t status;
         char errstr[256];
     
    -    status = apr_dso_load(&h, filename2, p);
    +    status = apr_dso_load(&h, libname, p);
         CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
         CuAssertPtrNotNull(tc, h);
     
         apr_dso_unload(h);
     }
     
    -static void test_dso_sym_non_module(CuTest *tc)
    +static void test_dso_sym_library(CuTest *tc)
     {
         apr_dso_handle_t *h = NULL;
         apr_dso_handle_sym_t func1 = NULL;
    @@ -183,7 +183,7 @@ static void test_dso_sym_non_module(CuTest *tc)
         char teststr[256];
         char errstr[256];
     
    -    status = apr_dso_load(&h, filename2, p);
    +    status = apr_dso_load(&h, libname, p);
         CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
         CuAssertPtrNotNull(tc, h);
     
    @@ -198,7 +198,7 @@ static void test_dso_sym_non_module(CuTest *tc)
         apr_dso_unload(h);
     }
     
    -static void test_dso_sym_return_value_non_mod(CuTest *tc)
    +static void test_dso_sym_return_value_library(CuTest *tc)
     {
         apr_dso_handle_t *h = NULL;
         apr_dso_handle_sym_t func1 = NULL;
    @@ -206,7 +206,7 @@ static void test_dso_sym_return_value_non_mod(CuTest *tc)
         int (*function)(int);
         char errstr[256];
     
    -    status = apr_dso_load(&h, filename2, p);
    +    status = apr_dso_load(&h, libname, p);
         CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
         CuAssertPtrNotNull(tc, h);
     
    @@ -221,14 +221,14 @@ static void test_dso_sym_return_value_non_mod(CuTest *tc)
         apr_dso_unload(h);
     }
     
    -static void test_unload_non_module(CuTest *tc)
    +static void test_unload_library(CuTest *tc)
     {
         apr_dso_handle_t *h = NULL;
         apr_status_t status;
         char errstr[256];
         apr_dso_handle_sym_t func1 = NULL;
     
    -    status = apr_dso_load(&h, filename2, p);
    +    status = apr_dso_load(&h, libname, p);
         CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
         CuAssertPtrNotNull(tc, h);
     
    @@ -250,28 +250,35 @@ static void test_load_notthere(CuTest *tc)
         CuAssertPtrNotNull(tc, h);
     }    
     
    +static void library_not_impl(CuTest *tc)
    +{
    +    CuNotImpl(tc, "Loadable libraries and modules are equivilant on this platform");
    +}
    +
     CuSuite *testdso(void)
     {
         CuSuite *suite = CuSuiteNew("DSO");
     
    -    filename = apr_pcalloc(p, 256);
    -    getcwd(filename, 256);
    -    filename = apr_pstrcat(p, filename, "/", LIB_NAME, NULL);
    +    modname = apr_pcalloc(p, 256);
    +    getcwd(modname, 256);
    +    modname = apr_pstrcat(p, modname, "/", MOD_NAME, NULL);
     
         SUITE_ADD_TEST(suite, test_load_module);
         SUITE_ADD_TEST(suite, test_dso_sym);
         SUITE_ADD_TEST(suite, test_dso_sym_return_value);
         SUITE_ADD_TEST(suite, test_unload_module);
     
    -#ifdef LIB_NAME2
    -    filename2 = apr_pcalloc(p, 256);
    -    getcwd(filename2, 256);
    -    filename2 = apr_pstrcat(p, filename2, "/", LIB_NAME2, NULL);
    -
    -    SUITE_ADD_TEST(suite, test_load_non_module);
    -    SUITE_ADD_TEST(suite, test_dso_sym_non_module);
    -    SUITE_ADD_TEST(suite, test_dso_sym_return_value_non_mod);
    -    SUITE_ADD_TEST(suite, test_unload_non_module);
    +#ifndef LIB_NAME
    +    SUITE_ADD_TEST(suite, library_not_impl);
    +#else
    +    libname = apr_pcalloc(p, 256);
    +    getcwd(libname, 256);
    +    libname = apr_pstrcat(p, libname, "/", LIB_NAME, NULL);
    +
    +    SUITE_ADD_TEST(suite, test_load_library);
    +    SUITE_ADD_TEST(suite, test_dso_sym_library);
    +    SUITE_ADD_TEST(suite, test_dso_sym_return_value_library);
    +    SUITE_ADD_TEST(suite, test_unload_library);
     #endif
     
         SUITE_ADD_TEST(suite, test_load_notthere);
    
    From ce7dd191a28df3451bfa24bee5ec4f6921b55144 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 19:41:20 +0000
    Subject: [PATCH 4206/7878]   Readd the test removed since rev 1.60.  Let
     others untangle the implications,   since only two coders care {again} and
     don't share the same opinion this   discussion is entirely moot.  Note this
     test fails on Win32.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64225 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfile.c | 22 ++++++++++++++++++++++
     1 file changed, 22 insertions(+)
    
    diff --git a/test/testfile.c b/test/testfile.c
    index 1e2656eac6d..93d7b8c58e9 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -68,6 +68,27 @@
     #define APR_BUFFERSIZE   4096 /* This should match APR's buffer size. */
     
     
    +
    +static void test_open_noreadwrite(CuTest *tc)
    +{
    +    apr_status_t rv;
    +    apr_file_t *thefile = NULL;
    +
    +    rv = apr_file_open(&thefile, FILENAME,
    +                       APR_CREATE | APR_EXCL, 
    +                       APR_UREAD | APR_UWRITE | APR_GREAD, p);
    +    CuAssertTrue(tc, rv != APR_SUCCESS);
    +    CuAssertIntEquals(tc, 1, APR_STATUS_IS_EACCES(rv));
    +#if 0
    +    /* I consider this a bug, if we are going to return an error, we shouldn't
    +     * allocate the file pointer.  But, this would make us fail the text, so
    +     * I am commenting it out for now.
    +     */
    +    CuAssertPtrEquals(tc, NULL, thefile); 
    +#endif
    +    apr_file_close(thefile);
    +}
    +
     static void test_open_excl(CuTest *tc)
     {
         apr_status_t rv;
    @@ -504,6 +525,7 @@ CuSuite *testfile(void)
     {
         CuSuite *suite = CuSuiteNew("File I/O");
     
    +    SUITE_ADD_TEST(suite, test_open_noreadwrite);
         SUITE_ADD_TEST(suite, test_open_excl);
         SUITE_ADD_TEST(suite, test_open_read);
         SUITE_ADD_TEST(suite, test_open_readwrite);
    
    From 5cd2fad7fa6b31e7215b2ab017e3f21211ac0976 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 19:51:34 +0000
    Subject: [PATCH 4207/7878]   apr_file_open(f, "directory", ..., p) is not
     portable, test for it.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64226 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfile.c | 40 ++++++++++++++++++++++------------------
     1 file changed, 22 insertions(+), 18 deletions(-)
    
    diff --git a/test/testfile.c b/test/testfile.c
    index 93d7b8c58e9..c6adad9fc58 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -61,7 +61,8 @@
     #include "apr_lib.h"
     #include "test_apr.h"
     
    -#define FILENAME "data/file_datafile.txt"
    +#define DIRNAME "data"
    +#define FILENAME DIRNAME "/file_datafile.txt"
     #define TESTSTR  "This is the file data file."
     
     #define TESTREAD_BLKSIZE 1024
    @@ -79,14 +80,26 @@ static void test_open_noreadwrite(CuTest *tc)
                            APR_UREAD | APR_UWRITE | APR_GREAD, p);
         CuAssertTrue(tc, rv != APR_SUCCESS);
         CuAssertIntEquals(tc, 1, APR_STATUS_IS_EACCES(rv));
    -#if 0
    -    /* I consider this a bug, if we are going to return an error, we shouldn't
    -     * allocate the file pointer.  But, this would make us fail the text, so
    -     * I am commenting it out for now.
    -     */
         CuAssertPtrEquals(tc, NULL, thefile); 
    -#endif
    -    apr_file_close(thefile);
    +    if (thefile) {
    +        apr_file_close(thefile);
    +    }
    +}
    +
    +static void test_open_dir_read(CuTest *tc)
    +{
    +    apr_status_t rv;
    +    apr_file_t *thedir = NULL;
    +
    +    rv = apr_file_open(&thedir, DIRNAME, 
    +                       APR_READ, 
    +                       APR_UREAD | APR_UWRITE | APR_GREAD, p);
    +    CuAssertTrue(tc, rv != APR_SUCCESS);
    +    CuAssertIntEquals(tc, 1, APR_STATUS_IS_EACCES(rv));
    +    CuAssertPtrEquals(tc, NULL, thedir);
    +    if (thedir) {
    +        apr_file_close(thedir);
    +    }
     }
     
     static void test_open_excl(CuTest *tc)
    @@ -99,17 +112,7 @@ static void test_open_excl(CuTest *tc)
                            APR_UREAD | APR_UWRITE | APR_GREAD, p);
         CuAssertTrue(tc, rv != APR_SUCCESS);
         CuAssertIntEquals(tc, 1, APR_STATUS_IS_EEXIST(rv));
    -#if 0
    -    /* I consider this a bug, if we are going to return an error, we shouldn't
    -     * allocate the file pointer.  But, this would make us fail the text, so
    -     * I am commenting it out for now.
    -     */
         CuAssertPtrEquals(tc, NULL, thefile); 
    -#endif
    -    /* And this too is a bug... Win32 (correctly) does not allocate
    -     * an apr_file_t, and (correctly) returns NULL.  Closing objects
    -     * that failed to open is invalid.  Apparently someone is doing so.
    -     */
         if (thefile) {
             apr_file_close(thefile);
         }
    @@ -526,6 +529,7 @@ CuSuite *testfile(void)
         CuSuite *suite = CuSuiteNew("File I/O");
     
         SUITE_ADD_TEST(suite, test_open_noreadwrite);
    +    SUITE_ADD_TEST(suite, test_open_dir_read);
         SUITE_ADD_TEST(suite, test_open_excl);
         SUITE_ADD_TEST(suite, test_open_read);
         SUITE_ADD_TEST(suite, test_open_readwrite);
    
    From 859124820e931ad2149202826bbabcd53f92a6a6 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 20:28:58 +0000
    Subject: [PATCH 4208/7878]   Add an internal Win32 apr_file_open flag
     APR_OPENINFO to allow APR itself   to access a Win32 file or directory
     without READ/WRITE access, for various   GetFileInformationEx() and security
     descriptor access.  Now the testfile   suite passes on Win32.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64227 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filestat.c    | 16 ++++++++--------
     file_io/win32/open.c        | 25 ++++++++++++++++++++-----
     include/arch/win32/fileio.h |  7 ++++---
     3 files changed, 32 insertions(+), 16 deletions(-)
    
    diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
    index 429d26e721b..cd4f6c2ac11 100644
    --- a/file_io/win32/filestat.c
    +++ b/file_io/win32/filestat.c
    @@ -191,11 +191,11 @@ static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname,
          * user, group or permissions.
          */
         
    -    if ((rv = apr_file_open(&thefile, fname, 
    -                       ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0)
    -                     | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER))
    -                           ? APR_READCONTROL : 0),
    -                       APR_OS_DEFAULT, pool)) == APR_SUCCESS) {
    +    if ((rv = apr_file_open(&thefile, fname, APR_OPENINFO
    +                          | ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0)
    +                          | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER))
    +                                ? APR_READCONTROL : 0),
    +                            APR_OS_DEFAULT, pool)) == APR_SUCCESS) {
             rv = apr_file_info_get(finfo, wanted, thefile);
             finfo->filehand = NULL;
             apr_file_close(thefile);
    @@ -205,9 +205,9 @@ static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname,
             /* We have a backup plan.  Perhaps we couldn't grab READ_CONTROL?
              * proceed without asking for that permission...
              */
    -        if ((rv = apr_file_open(&thefile, fname, 
    -                           ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0),
    -                           APR_OS_DEFAULT, pool)) == APR_SUCCESS) {
    +        if ((rv = apr_file_open(&thefile, fname, APR_OPENINFO
    +                              | ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0),
    +                                APR_OS_DEFAULT, pool)) == APR_SUCCESS) {
                 rv = apr_file_info_get(finfo, wanted & ~(APR_FINFO_PROT 
                                                      | APR_FINFO_OWNER),
                                      thefile);
    diff --git a/file_io/win32/open.c b/file_io/win32/open.c
    index ae15ed9a37a..b0bb7da0469 100644
    --- a/file_io/win32/open.c
    +++ b/file_io/win32/open.c
    @@ -339,21 +339,36 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname,
         if (flag & APR_DELONCLOSE) {
             attributes |= FILE_FLAG_DELETE_ON_CLOSE;
         }
    +
         if (flag & APR_OPENLINK) {
            attributes |= FILE_FLAG_OPEN_REPARSE_POINT;
         }
    -    if (!(flag & (APR_READ | APR_WRITE)) && (apr_os_level >= APR_WIN_NT)) {
    -        /* We once failed here, but this is how one opens 
    -         * a directory as a file under winnt
    -         */
    -        attributes |= FILE_FLAG_BACKUP_SEMANTICS;
    +
    +    /* Without READ or WRITE, we fail unless apr called apr_file_open
    +     * internally with the private APR_OPENINFO flag.
    +     *
    +     * With the APR_OPENINFO flag on NT, use the option flag
    +     * FILE_FLAG_BACKUP_SEMANTICS to allow us to open directories.
    +     * See the static resolve_ident() fn in file_io/win32/filestat.c
    +     */
    +    if (!(flag & (APR_READ | APR_WRITE))) {
    +        if (flag & APR_OPENINFO) {
    +            if (apr_os_level >= APR_WIN_NT) {
    +                attributes |= FILE_FLAG_BACKUP_SEMANTICS;
    +            }
    +        }
    +        else {
    +            return APR_EACCES;
    +        }
         }
    +
         if (flag & APR_XTHREAD) {
             /* This win32 specific feature is required 
              * to allow multiple threads to work with the file.
              */
             attributes |= FILE_FLAG_OVERLAPPED;
         }
    +
     #if APR_HAS_UNICODE_FS
         IF_WIN_OS_IS_UNICODE
         {
    diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h
    index 58a5dba0a9e..d1aa721b0a9 100644
    --- a/include/arch/win32/fileio.h
    +++ b/include/arch/win32/fileio.h
    @@ -133,9 +133,10 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool);
     #endif
     
     /* Internal Flags for apr_file_open */
    -#define APR_OPENLINK      8192    /* Open a link itself, if supported */
    -#define APR_READCONTROL   4096    /* Read the file's owner/perms */
    -#define APR_WRITECONTROL  2048    /* Modifythe file's owner/perms */
    +#define APR_OPENINFO     0x4000    /* Open without READ or WRITE access */
    +#define APR_OPENLINK     0x2000    /* Open a link itself, if supported */
    +#define APR_READCONTROL  0x1000    /* Read the file's owner/perms */
    +#define APR_WRITECONTROL 0x0800    /* Modifythe file's owner/perms */
     
     /* Entries missing from the MSVC 5.0 Win32 SDK:
      */
    
    From 77d2edebd0f9d428edb712803553b3d828b43a0c Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 20:31:12 +0000
    Subject: [PATCH 4209/7878]   Defer allocation of the apr_file_t until the file
     is successfully opened   (and the thread_mutex, when required, was
     successfully created.)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64228 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/open.c | 71 ++++++++++++++++++++++++---------------------
     1 file changed, 38 insertions(+), 33 deletions(-)
    
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index dfbd810e62f..ea79e14248d 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -98,8 +98,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
                                             apr_fileperms_t perm, 
                                             apr_pool_t *pool)
     {
    +    apr_os_file_t fd;
         int oflags = 0;
     #if APR_HAS_THREADS
    +    apr_thread_mutex_t *thlock;
         apr_status_t rv;
     #endif
     
    @@ -108,11 +110,6 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
         apr_stat_entry_t *stat_entry = NULL;
     #endif
     
    -    (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t));
    -    (*new)->pool = pool;
    -    (*new)->flags = flag;
    -    (*new)->filedes = -1;
    -
         if ((flag & APR_READ) && (flag & APR_WRITE)) {
             oflags = O_RDWR;
         }
    @@ -126,27 +123,6 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
             return APR_EACCES; 
         }
     
    -    (*new)->fname = apr_pstrdup(pool, fname);
    -
    -    (*new)->blocking = BLK_ON;
    -    (*new)->buffered = (flag & APR_BUFFERED) > 0;
    -
    -    if ((*new)->buffered) {
    -        (*new)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE);
    -#if APR_HAS_THREADS
    -        if ((*new)->flags & APR_XTHREAD) {
    -            rv = apr_thread_mutex_create(&((*new)->thlock),
    -                                         APR_THREAD_MUTEX_DEFAULT, pool);
    -            if (rv) {
    -                return rv;
    -            }
    -        }
    -#endif
    -    }
    -    else {
    -        (*new)->buffer = NULL;
    -    }
    -
         if (flag & APR_CREATE) {
             oflags |= O_CREAT; 
             if (flag & APR_EXCL) {
    @@ -169,31 +145,60 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
         }
     #endif
         
    +#if APR_HAS_THREADS
    +    if ((flag & APR_BUFFERED) && ((*new)->flags & APR_XTHREAD)) {
    +        rv = apr_thread_mutex_create(thlock),
    +                                     APR_THREAD_MUTEX_DEFAULT, pool);
    +        if (rv) {
    +            return rv;
    +        }
    +    }
    +#endif
    +
     #ifdef NETWARE
         if (statCache) {
             stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, fname, APR_HASH_KEY_STRING);
         }
         if (stat_entry) {
    -        errno = NXFileOpen (stat_entry->pathCtx, stat_entry->casedName, oflags, &(*new)->filedes);
    +        errno = NXFileOpen (stat_entry->pathCtx, stat_entry->casedName, oflags, &fd);
         }
         else {
     #endif
         if (perm == APR_OS_DEFAULT) {
    -        (*new)->filedes = open(fname, oflags, 0666);
    +        fd = open(fname, oflags, 0666);
         }
         else {
    -        (*new)->filedes = open(fname, oflags, apr_unix_perms2mode(perm));
    +        fd = open(fname, oflags, apr_unix_perms2mode(perm));
         } 
     #ifdef NETWARE
         }
     #endif
    -
    -    if ((*new)->filedes < 0) {
    -       (*new)->filedes = -1;
    -       (*new)->eof_hit = 1;
    +    if (fd < 0) {
            return errno;
         }
     
    +    (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t));
    +    (*new)->pool = pool;
    +    (*new)->flags = flag;
    +    (*new)->filedes = fd;
    +
    +    (*new)->fname = apr_pstrdup(pool, fname);
    +
    +    (*new)->blocking = BLK_ON;
    +    (*new)->buffered = (flag & APR_BUFFERED) > 0;
    +
    +    if ((*new)->buffered) {
    +        (*new)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE);
    +#if APR_HAS_THREADS
    +        if ((*new)->flags & APR_XTHREAD) {
    +            (*new)->thlock = thlock;
    +        }
    +#endif
    +    }
    +    else {
    +        (*new)->buffer = NULL;
    +    }
    +
         (*new)->is_pipe = 0;
         (*new)->timeout = -1;
         (*new)->ungetchar = -1;
    
    From d57c60c2b08ddd2dfdca270336ec3ad721d91f44 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 29 Dec 2002 20:52:45 +0000
    Subject: [PATCH 4210/7878] Get us building on unix again.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64229 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/open.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index ea79e14248d..be8b88102f1 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -147,7 +147,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
         
     #if APR_HAS_THREADS
         if ((flag & APR_BUFFERED) && ((*new)->flags & APR_XTHREAD)) {
    -        rv = apr_thread_mutex_create(thlock),
    +        rv = apr_thread_mutex_create(&thlock,
                                          APR_THREAD_MUTEX_DEFAULT, pool);
             if (rv) {
                 return rv;
    
    From 85d6f93918a277b28197b35eaa504184f53176e5 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 29 Dec 2002 20:55:22 +0000
    Subject: [PATCH 4211/7878] Remove some code that we can never reach.  If we
     fail the CuAssertPtrEquals, the test suite will longjmp.  If we pass it, then
     the pointer is NULL, and we won't go to the internals of the if statement.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64230 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfile.c | 13 +------------
     1 file changed, 1 insertion(+), 12 deletions(-)
    
    diff --git a/test/testfile.c b/test/testfile.c
    index c6adad9fc58..6fa6dbf730a 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -81,9 +81,6 @@ static void test_open_noreadwrite(CuTest *tc)
         CuAssertTrue(tc, rv != APR_SUCCESS);
         CuAssertIntEquals(tc, 1, APR_STATUS_IS_EACCES(rv));
         CuAssertPtrEquals(tc, NULL, thefile); 
    -    if (thefile) {
    -        apr_file_close(thefile);
    -    }
     }
     
     static void test_open_dir_read(CuTest *tc)
    @@ -97,9 +94,6 @@ static void test_open_dir_read(CuTest *tc)
         CuAssertTrue(tc, rv != APR_SUCCESS);
         CuAssertIntEquals(tc, 1, APR_STATUS_IS_EACCES(rv));
         CuAssertPtrEquals(tc, NULL, thedir);
    -    if (thedir) {
    -        apr_file_close(thedir);
    -    }
     }
     
     static void test_open_excl(CuTest *tc)
    @@ -113,9 +107,6 @@ static void test_open_excl(CuTest *tc)
         CuAssertTrue(tc, rv != APR_SUCCESS);
         CuAssertIntEquals(tc, 1, APR_STATUS_IS_EEXIST(rv));
         CuAssertPtrEquals(tc, NULL, thefile); 
    -    if (thefile) {
    -        apr_file_close(thefile);
    -    }
     }
     
     static void test_open_read(CuTest *tc)
    @@ -209,9 +200,7 @@ static void test_open_write(CuTest *tc)
                            APR_WRITE, 
                            APR_UREAD | APR_UWRITE | APR_GREAD, p);
         CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv));
    -    if (filetest) {
    -        apr_file_close(filetest);
    -    }
    +    CuAssertPtrEquals(tc, NULL, filetest);
     }
     
     static void test_open_writecreate(CuTest *tc)
    
    From b25ef114a8dbd8897fd70c30ee186e90639afb06 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 22:10:13 +0000
    Subject: [PATCH 4212/7878]   Only APR_FINFO_DIRENT is guarenteed to be
     supported... other platforms   may be missing things such as APR_FINFO_GROUP,
     APR_FINFO_INODE etc.   It would be healthy to add a {seperate} test that
     APR_FINFO_MIN at least   succeeds, but that should not be part of the
     mainline tests.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64231 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testdir.c | 10 +++++-----
     1 file changed, 5 insertions(+), 5 deletions(-)
    
    diff --git a/test/testdir.c b/test/testdir.c
    index 6ffe90b9c95..1df7eb232d3 100644
    --- a/test/testdir.c
    +++ b/test/testdir.c
    @@ -192,7 +192,7 @@ static void test_readdir_onedot(CuTest *tc)
         rv = apr_dir_open(&dir, "data", p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
    -    rv = apr_dir_read(&finfo, APR_FINFO_NORM, dir);
    +    rv = apr_dir_read(&finfo, APR_FINFO_DIRENT, dir);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertStrEquals(tc, ".", finfo.name);
     
    @@ -209,8 +209,8 @@ static void test_readdir_twodot(CuTest *tc)
         rv = apr_dir_open(&dir, "data", p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
    -    rv = apr_dir_read(&finfo, APR_FINFO_NORM, dir);
    -    rv = apr_dir_read(&finfo, APR_FINFO_NORM, dir);
    +    rv = apr_dir_read(&finfo, APR_FINFO_DIRENT, dir);
    +    rv = apr_dir_read(&finfo, APR_FINFO_DIRENT, dir);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertStrEquals(tc, "..", finfo.name);
     
    @@ -227,14 +227,14 @@ static void test_rewind(CuTest *tc)
         rv = apr_dir_open(&dir, "data", p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
    -    rv = apr_dir_read(&finfo, APR_FINFO_NORM, dir);
    +    rv = apr_dir_read(&finfo, APR_FINFO_DIRENT, dir);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertStrEquals(tc, ".", finfo.name);
     
         rv = apr_dir_rewind(dir);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
    -    rv = apr_dir_read(&finfo, APR_FINFO_NORM, dir);
    +    rv = apr_dir_read(&finfo, APR_FINFO_DIRENT, dir);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertStrEquals(tc, ".", finfo.name);
     
    
    From fdd566f51fcf59efa1c322a561136c2fc26da135 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 22:17:29 +0000
    Subject: [PATCH 4213/7878]   apr_dir_make_recursive is now implemented.  The
     unix code is a little   wonky, lots of redundant strdups.  See this code if
     you care to streamline   that port a bit.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64232 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/dir.c | 46 ++++++++++++++++++++++++++++++++++++++++++++-
     1 file changed, 45 insertions(+), 1 deletion(-)
    
    diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c
    index a31f57310ec..0909fd9a6ee 100644
    --- a/file_io/win32/dir.c
    +++ b/file_io/win32/dir.c
    @@ -295,11 +295,55 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm,
         return APR_SUCCESS;
     }
     
    +
    +static apr_status_t dir_make_parent(char *path,
    +                                    apr_fileperms_t perm,
    +                                    apr_pool_t *pool)
    +{
    +    apr_status_t rv;
    +    char *ch = strrchr(path, '\\');
    +    if (!ch) {
    +        return APR_ENOENT;
    +    }
    +
    +    *ch = '\0';
    +    rv = apr_dir_make (path, perm, pool); /* Try to make straight off */
    +    
    +    if (APR_STATUS_IS_ENOENT(rv)) { /* Missing an intermediate dir */
    +        rv = dir_make_parent(path, perm, pool);
    +
    +        if (rv == APR_SUCCESS) {
    +            rv = apr_dir_make (path, perm, pool); /* And complete the path */
    +        }
    +    }
    +
    +    *ch = '\\'; /* Always replace the slash before returning */
    +    return rv;
    +}
    +
     APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path,
                                                      apr_fileperms_t perm,
                                                      apr_pool_t *pool)
     {
    -    return APR_ENOTIMPL;
    +    apr_status_t rv = 0;
    +    
    +    rv = apr_dir_make (path, perm, pool); /* Try to make PATH right out */
    +    
    +    if (APR_STATUS_IS_EEXIST(rv)) /* It's OK if PATH exists */
    +        return APR_SUCCESS;
    +    
    +    if (APR_STATUS_IS_ENOENT(rv)) { /* Missing an intermediate dir */
    +        char *dir;
    +        
    +        rv = apr_filepath_merge(&dir, "", path, APR_FILEPATH_NATIVE, pool);
    +
    +        if (rv == APR_SUCCESS)
    +            rv = dir_make_parent(dir, perm, pool); /* Make intermediate dirs */
    +        
    +        if (rv == APR_SUCCESS)
    +            rv = apr_dir_make (dir, perm, pool);   /* And complete the path */
    +    }
    +    return rv;
     }
     
     
    
    From 081c41d3afe611963d01124ca0e6fd8a67fb7f59 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 29 Dec 2002 22:28:11 +0000
    Subject: [PATCH 4214/7878] standardize on a couple of easy to test for error
     codes for DSO errors. This doesn't work fully on Windows yet, that is the
     next commit.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64233 13f79535-47bb-0310-9956-ffa450edef68
    ---
     dso/aix/dso.c     |  2 +-
     dso/beos/dso.c    |  6 +++---
     dso/netware/dso.c |  2 +-
     dso/os2/dso.c     |  2 +-
     dso/unix/dso.c    | 10 +++++-----
     test/testdso.c    | 14 ++++++++------
     6 files changed, 19 insertions(+), 17 deletions(-)
    
    diff --git a/dso/aix/dso.c b/dso/aix/dso.c
    index 1870a42d785..0c0d6be95dc 100644
    --- a/dso/aix/dso.c
    +++ b/dso/aix/dso.c
    @@ -197,7 +197,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym,
     
         if (retval == NULL) {
             handle->errormsg = dlerror();
    -        return APR_EINIT;
    +        return APR_ESYMNOTFOUND;
         }
     
         *ressym = retval;
    diff --git a/dso/beos/dso.c b/dso/beos/dso.c
    index 1cfe6bae144..111c9026521 100644
    --- a/dso/beos/dso.c
    +++ b/dso/beos/dso.c
    @@ -74,7 +74,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle,
         image_id newid;
     
         if((newid = load_add_on(path)) < B_NO_ERROR)
    -        return APR_EINIT;
    +        return APR_EDSOOPEN;
     
         *res_handle = apr_pcalloc(pool, sizeof(*res_handle));
         (*res_handle)->handle = newid;
    @@ -96,13 +96,13 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_hand
         int err;
     
         if (symname == NULL)
    -        return APR_EINIT;
    +        return APR_ESYMNOTFOUND;
     
         err = get_image_symbol(handle->handle, symname, B_SYMBOL_TYPE_ANY, 
     			 ressym);
     
         if(err != B_OK)
    -        return APR_EINIT;
    +        return APR_ESYMNOTFOUND;
     
         return APR_SUCCESS;
     }
    diff --git a/dso/netware/dso.c b/dso/netware/dso.c
    index 1c562489bd1..33f96022271 100644
    --- a/dso/netware/dso.c
    +++ b/dso/netware/dso.c
    @@ -141,7 +141,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym,
     
         if (retval == NULL) {
             handle->errormsg = dlerror();
    -        return APR_EINIT;
    +        return APR_ESYMNOTFOUND;
         }
     
         symbol = apr_pcalloc(handle->pool, sizeof(sym_list));
    diff --git a/dso/os2/dso.c b/dso/os2/dso.c
    index d1b79e6c22c..c5cb86a673e 100644
    --- a/dso/os2/dso.c
    +++ b/dso/os2/dso.c
    @@ -116,7 +116,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym,
         int rc;
     
         if (symname == NULL || ressym == NULL)
    -        return APR_EINIT;
    +        return APR_ESYMNOTFOUND;
     
         if ((rc = DosQueryProcAddr(handle->handle, 0, symname, &func)) != 0) {
             handle->load_error = APR_FROM_OS_ERROR(rc);
    diff --git a/dso/unix/dso.c b/dso/unix/dso.c
    index 1246d9ddb8d..dbdd444202c 100644
    --- a/dso/unix/dso.c
    +++ b/dso/unix/dso.c
    @@ -182,7 +182,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle,
         if(os_handle == NULL) {
     #if defined(DSO_USE_SHL)
             (*res_handle)->errormsg = strerror(errno);
    -        return errno;
    +        return APR_EDSOOPEN;
     #elif defined(DSO_USE_DYLD)
             (*res_handle)->errormsg = (err_msg) ? err_msg : "link failed";
             return APR_EDSOOPEN;
    @@ -219,7 +219,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym,
         if (status == -1 && errno == 0) /* try TYPE_DATA instead */
             status = shl_findsym((shl_t *)&handle->handle, symname, TYPE_DATA, &symaddr);
         if (status == -1)
    -        return errno;
    +        return APR_ESYMNOTFOUND;
         *ressym = symaddr;
         return APR_SUCCESS;
     
    @@ -241,12 +241,12 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym,
         free(symname2);
         if (symbol == NULL) {
             handle->errormsg = "undefined symbol";
    -	return APR_EINIT;
    +	return APR_ESYMNOTFOUND;
         }
         retval = NSAddressOfSymbol(symbol);
         if (retval == NULL) {
             handle->errormsg = "cannot resolve symbol";
    -	return APR_EINIT;
    +	return APR_ESYMNOTFOUND;
         }
         *ressym = retval;
         return APR_SUCCESS;
    @@ -266,7 +266,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym,
     
         if (retval == NULL) {
             handle->errormsg = dlerror();
    -        return APR_EINIT;
    +        return APR_ESYMNOTFOUND;
         }
     
         *ressym = retval;
    diff --git a/test/testdso.c b/test/testdso.c
    index 2d04507c2f7..fe720aa9700 100644
    --- a/test/testdso.c
    +++ b/test/testdso.c
    @@ -157,7 +157,7 @@ static void test_unload_module(CuTest *tc)
         CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
     
         status = apr_dso_sym(&func1, h, "print_hello");
    -    CuAssertIntEquals(tc, APR_EINIT, status);
    +    CuAssertIntEquals(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status));
     }
     
     
    @@ -234,26 +234,28 @@ static void test_unload_library(CuTest *tc)
     
         status = apr_dso_unload(h);
         CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
    +
    +    status = apr_dso_sym(&func1, h, "print_hello");
    +    CuAssertIntEquals(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status));
     }
     
     static void test_load_notthere(CuTest *tc)
     {
         apr_dso_handle_t *h = NULL;
    -    char errstr[256];
         apr_status_t status;
     
         status = apr_dso_load(&h, "No_File.so", p);
    -    /* Original test was status == APR_EDSOOPEN, but that's not valid
    -     * with DSO_USE_SHL (HP/UX etc), OS2 or Win32.  Accept simple failure.
    -     */
    -    CuAssert(tc, apr_dso_error(h, errstr, 256), status);
    +
    +    CuAssertIntEquals(tc, 1, APR_STATUS_IS_EDSOOPEN(status));
         CuAssertPtrNotNull(tc, h);
     }    
     
    +#ifndef LIB_NAME
     static void library_not_impl(CuTest *tc)
     {
         CuNotImpl(tc, "Loadable libraries and modules are equivilant on this platform");
     }
    +#endif
     
     CuSuite *testdso(void)
     {
    
    From 431af00c1443464b528196498678b30326bc4557 Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 29 Dec 2002 22:31:45 +0000
    Subject: [PATCH 4215/7878] Add the new error codes for DSO failures.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64234 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h | 5 +++++
     1 file changed, 5 insertions(+)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 196b740c7ca..3608b220bfb 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -226,6 +226,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
      * APR_EGENERAL     General failure (specific information not available)
      * APR_EBADIP       The specified IP address is invalid
      * APR_EBADMASK     The specified netmask is invalid
    + * APR_ESYMNOTFOUND Could not find the requested symbol
      * 
    * *
    @@ -309,6 +310,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_EBADPATH       (APR_OS_START_ERROR + 24)
     /** @see APR_STATUS_IS_EPATHWILD */
     #define APR_EPATHWILD      (APR_OS_START_ERROR + 25)
    +/** @see APR_STATUS_IS_ESYMNOTFOUND */
    +#define APR_ESYMNOTFOUND   (APR_OS_START_ERROR + 26)
     
     /* APR ERROR VALUE TESTS */
     /** 
    @@ -379,6 +382,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_EBADPATH(s)       ((s) == APR_EBADPATH)
     /** The given path contained wildcards. */
     #define APR_STATUS_IS_EPATHWILD(s)      ((s) == APR_EPATHWILD)
    +/** Could not find the requested symbol. */
    +#define APR_STATUS_IS_ESYMNOTFOUND(s)   ((s) == APR_ESYMNOTFOUND)
     
     /* APR STATUS VALUES */
     /** @see APR_STATUS_IS_INCHILD */
    
    From 45869b0d18df091179816cec012ef6d4f851cdfa Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 22:40:53 +0000
    Subject: [PATCH 4216/7878]   Close the last testdir emit by always calling
     FindFirstFile on open/rewind   invocations.  We don't fill-in the finfo until
     we invoke apr_dir_read the   second time and onwards (following the initial
     invocation of apr_dir_read   by the apr_dir_open or apr_dir_rewind
     functions.)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64235 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/dir.c         | 47 ++++++++++++++++++++++++++++++++++---
     include/arch/win32/fileio.h |  1 +
     2 files changed, 45 insertions(+), 3 deletions(-)
    
    diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c
    index 0909fd9a6ee..d34114f00c8 100644
    --- a/file_io/win32/dir.c
    +++ b/file_io/win32/dir.c
    @@ -86,6 +86,8 @@ static apr_status_t dir_cleanup(void *thedir)
     APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname,
                                            apr_pool_t *pool)
     {
    +    apr_status_t rv;
    +
         int len = strlen(dirname);
         (*new) = apr_pcalloc(pool, sizeof(apr_dir_t));
         /* Leave room here to add and pop the '*' wildcard for FindFirstFile 
    @@ -129,7 +131,14 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname,
         (*new)->dirhand = INVALID_HANDLE_VALUE;
         apr_pool_cleanup_register((*new)->pool, (void *)(*new), dir_cleanup,
                             apr_pool_cleanup_null);
    -    return APR_SUCCESS;
    +
    +    rv = apr_dir_read(NULL, 0, *new);
    +    if (rv != APR_SUCCESS) {
    +        dir_cleanup(*new);
    +        *new = NULL;
    +    }
    +
    +    return rv;
     }
     
     APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *dir)
    @@ -151,6 +160,9 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
         apr_wchar_t *eos = NULL;
         IF_WIN_OS_IS_UNICODE
         {
    +        /* This code path is always be invoked by apr_dir_open or
    +         * apr_dir_rewind, so return without filling out the finfo.
    +         */
             if (thedir->dirhand == INVALID_HANDLE_VALUE) 
             {
                 apr_status_t rv;
    @@ -167,10 +179,20 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
                 if (thedir->dirhand == INVALID_HANDLE_VALUE) {
                     return apr_get_os_error();
                 }
    +            thedir->bof = 1;
    +            return APR_SUCCESS;
    +        }
    +        else if (thedir->bof) {
    +            /* Noop - we already called FindFirstFileW from
    +             * either apr_dir_open or apr_dir_rewind ... use
    +             * that first record.
    +             */
    +            thedir->bof = 0; 
             }
             else if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) {
                 return apr_get_os_error();
             }
    +
             while (thedir->rootlen &&
                    thedir->rootlen + wcslen(thedir->w.entry->cFileName) >= APR_PATH_MAX)
             {
    @@ -187,9 +209,12 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
     #if APR_HAS_ANSI_FS
         ELSE_WIN_OS_IS_ANSI
         {
    -        char *eop = strchr(thedir->dirname, '\0');
    +        /* This code path is always be invoked by apr_dir_open or 
    +         * apr_dir_rewind, so return without filling out the finfo.
    +         */
             if (thedir->dirhand == INVALID_HANDLE_VALUE) {
                 /* '/' terminated, so add the '*' and pop it when we finish */
    +            char *eop = strchr(thedir->dirname, '\0');
                 eop[0] = '*';
                 eop[1] = '\0';
                 thedir->dirhand = FindFirstFileA(thedir->dirname, 
    @@ -198,6 +223,15 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
                 if (thedir->dirhand == INVALID_HANDLE_VALUE) {
                     return apr_get_os_error();
                 }
    +            thedir->bof = 1;
    +            return APR_SUCCESS;
    +        }
    +        else if (thedir->bof) {
    +            /* Noop - we already called FindFirstFileW from
    +             * either apr_dir_open or apr_dir_rewind ... use
    +             * that first record.
    +             */
    +            thedir->bof = 0; 
             }
             else if (!FindNextFile(thedir->dirhand, thedir->n.entry)) {
                 return apr_get_os_error();
    @@ -263,10 +297,17 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
     
     APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *dir)
     {
    +    apr_status_t rv;
    +
         /* this will mark the handle as invalid and we'll open it
          * again if apr_dir_read() is subsequently called
          */
    -    return dir_cleanup(dir);
    +    rv = dir_cleanup(dir);
    +
    +    if (rv == APR_SUCCESS)
    +        rv = apr_dir_read(NULL, 0, dir);
    +
    +    return rv;
     }
     
     APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm,
    diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h
    index d1aa721b0a9..ca4e91224fd 100644
    --- a/include/arch/win32/fileio.h
    +++ b/include/arch/win32/fileio.h
    @@ -235,6 +235,7 @@ struct apr_dir_t {
             } n;
     #endif        
         };
    +    int bof;
     };
     
     /* There are many goofy characters the filesystem can't accept
    
    From 33694aa4f77aedd01f263165c1aeeaaec2deb3ef Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 22:45:12 +0000
    Subject: [PATCH 4217/7878]   No pthread_setconcurrency here on Darwin.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64236 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testatomic.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/testatomic.c b/test/testatomic.c
    index 4a3298eeee0..0b20179a4fc 100644
    --- a/test/testatomic.c
    +++ b/test/testatomic.c
    @@ -265,7 +265,7 @@ int main(int argc, char**argv)
         }
     
         printf("APR Atomic Test\n===============\n\n");
    -#if !(defined WIN32) && !(defined NETWARE) && !(defined __MVS__)
    +#if !(defined WIN32) && !(defined NETWARE) && !(defined __MVS__) && !(defined DARWIN)
         pthread_setconcurrency(8);
     #endif
         printf("%-60s", "Initializing the context"); 
    
    From 8f6090499c0a7209ff489d47b996a1b00704608d Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sun, 29 Dec 2002 22:50:13 +0000
    Subject: [PATCH 4218/7878] Get the new DSO error values working on Windows. 
     Windows now passes all DSO tests.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64237 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h | 8 ++++++++
     1 file changed, 8 insertions(+)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 3608b220bfb..13aab4b6081 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -369,7 +369,11 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
      * APR was unable to open the dso object.  
      * For more information call apr_dso_error().
      */
    +#if defined(WIN32)
    +#define APR_STATUS_IS_EDSOOPEN(s)       (APR_TO_OS_ERROR(s) == ERROR_MOD_NOT_FOUND)
    +#else
     #define APR_STATUS_IS_EDSOOPEN(s)       ((s) == APR_EDSOOPEN)
    +#endif
     /** The given path was absolute. */
     #define APR_STATUS_IS_EABSOLUTE(s)      ((s) == APR_EABSOLUTE)
     /** The given path was relative. */
    @@ -383,7 +387,11 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     /** The given path contained wildcards. */
     #define APR_STATUS_IS_EPATHWILD(s)      ((s) == APR_EPATHWILD)
     /** Could not find the requested symbol. */
    +#if defined(WIN32)
    +#define APR_STATUS_IS_ESYMNOTFOUND(s)   (APR_TO_OS_ERROR(s) == ERROR_PROC_NOT_FOUND)
    +#else
     #define APR_STATUS_IS_ESYMNOTFOUND(s)   ((s) == APR_ESYMNOTFOUND)
    +#endif
     
     /* APR STATUS VALUES */
     /** @see APR_STATUS_IS_INCHILD */
    
    From d820e0405b802db63e5d4171c02ef6eee2d941c3 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 29 Dec 2002 23:13:04 +0000
    Subject: [PATCH 4219/7878]   Fix up code in thread_cond.  First always escape
     the case where we outright   fail a single WaitForSingleObject(..., INFINITE)
     (yes, it can happen) and   properly unwind the *correct* error when we fail
     the nested Wait.
    
      Also clean up the usage where rv is an apr result, and res in an NT result
      to conform a bit better with other code.
    
      Finally implements thread_cond_wait_with_timeout.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64238 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/win32/thread_cond.c | 95 +++++++++++++++++++++++++++++----------
     1 file changed, 72 insertions(+), 23 deletions(-)
    
    diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c
    index 27cdb510019..e0c428f7234 100644
    --- a/locks/win32/thread_cond.c
    +++ b/locks/win32/thread_cond.c
    @@ -83,18 +83,23 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond,
     APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond,
                                                    apr_thread_mutex_t *mutex)
     {
    -    DWORD rv;
    +    DWORD res;
     
         while (1) {
    -        WaitForSingleObject(cond->mutex, INFINITE);
    +        res = WaitForSingleObject(cond->mutex, INFINITE);
    +        if (res != WAIT_OBJECT_0) {
    +            return apr_get_os_error();
    +        }
             cond->num_waiting++;
             ReleaseMutex(cond->mutex);
     
             apr_thread_mutex_unlock(mutex);
    -        rv = WaitForSingleObject(cond->event, INFINITE);
    +        res = WaitForSingleObject(cond->event, INFINITE);
             cond->num_waiting--;
    -        if (rv == WAIT_FAILED) {
    -            return apr_get_os_error();
    +        if (res != WAIT_OBJECT_0) {
    +            apr_status_t rv = apr_get_os_error();
    +            ReleaseMutex(cond->mutex);
    +            return rv;
             }
             if (cond->signal_all) {
                 if (cond->num_waiting == 0) {
    @@ -117,39 +122,83 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond,
                                                         apr_thread_mutex_t *mutex,
                                                         apr_interval_time_t timeout)
     {
    -    /* Remember when implementing, timeout is usec, 
    -     * Win32 Wait functions take msec
    -     */
    -    return APR_ENOTIMPL;
    +    DWORD res;
    +    DWORD timeout_ms = (DWORD) apr_time_as_msec(timeout);
    +
    +    while (1) {
    +        res = WaitForSingleObject(cond->mutex, timeout_ms);
    +        if (res != WAIT_OBJECT_0) {
    +            if (res == WAIT_ABANDONED) {
    +                return APR_TIMEUP;
    +            }
    +            return apr_get_os_error();
    +        }
    +        cond->num_waiting++;
    +        ReleaseMutex(cond->mutex);
    +
    +        apr_thread_mutex_unlock(mutex);
    +        res = WaitForSingleObject(cond->event, timeout_ms);
    +        cond->num_waiting--;
    +        if (res != WAIT_OBJECT_0) {
    +            apr_status_t rv = apr_get_os_error();
    +            ReleaseMutex(cond->mutex);
    +            if (res == WAIT_ABANDONED) {
    +                rv = APR_TIMEUP;
    +            }
    +            return rv;
    +        }
    +        if (cond->signal_all) {
    +            if (cond->num_waiting == 0) {
    +                ResetEvent(cond->event);
    +            }
    +            break;
    +        }
    +        if (cond->signalled) {
    +            cond->signalled = 0;
    +            ResetEvent(cond->event);
    +            break;
    +        }
    +        ReleaseMutex(cond->mutex);
    +    }
    +    apr_thread_mutex_lock(mutex);
    +    return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond)
     {
    -    DWORD rv;
    +    apr_status_t rv = APR_SUCCESS;
    +    DWORD res;
     
    -    WaitForSingleObject(cond->mutex, INFINITE);
    -    cond->signalled = 1;
    -    rv = SetEvent(cond->event);
    -    ReleaseMutex(cond->mutex);
    -    if (rv == 0) {
    +    res = WaitForSingleObject(cond->mutex, INFINITE);
    +    if (res != WAIT_OBJECT_0) {
             return apr_get_os_error();
         }
    -    return APR_SUCCESS;
    +    cond->signalled = 1;
    +    res = SetEvent(cond->event);
    +    if (res == 0) {
    +        rv = apr_get_os_error();
    +    }
    +    ReleaseMutex(cond->mutex);
    +    return rv;
     }
     
     APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond)
     {
    -    DWORD rv;
    +    apr_status_t rv = APR_SUCCESS;
    +    DWORD res;
     
    -    WaitForSingleObject(cond->mutex, INFINITE);
    +    res = WaitForSingleObject(cond->mutex, INFINITE);
    +    if (res != WAIT_OBJECT_0) {
    +        return apr_get_os_error();
    +    }
         cond->signalled = 1;
         cond->signal_all = 1;
    -    rv = SetEvent(cond->event);
    -    ReleaseMutex(cond->mutex);
    -    if (rv == 0) {
    -        return apr_get_os_error();
    +    res = SetEvent(cond->event);
    +    if (res == 0) {
    +        rv = apr_get_os_error();
         }
    -    return APR_SUCCESS;
    +    ReleaseMutex(cond->mutex);
    +    return rv;
     }
     
     APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond)
    
    From 1cfce53bef55f8a4eaaddd5787da19db7f9c93a0 Mon Sep 17 00:00:00 2001
    From: Brian Pane 
    Date: Mon, 30 Dec 2002 06:07:20 +0000
    Subject: [PATCH 4220/7878] Fix uninitialized variable dereference from a
     recent commit that was causing a segfault at httpd startup Submitted by:
     Erik Abele  Reviewed by:	Brian Pane
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64239 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/open.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index be8b88102f1..87fd8b866ca 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -146,7 +146,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
     #endif
         
     #if APR_HAS_THREADS
    -    if ((flag & APR_BUFFERED) && ((*new)->flags & APR_XTHREAD)) {
    +    if ((flag & APR_BUFFERED) && (flag & APR_XTHREAD)) {
             rv = apr_thread_mutex_create(&thlock,
                                          APR_THREAD_MUTEX_DEFAULT, pool);
             if (rv) {
    
    From de123bfa254f3a9961407604945a8980e3f76c39 Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Mon, 30 Dec 2002 06:17:38 +0000
    Subject: [PATCH 4221/7878] Use apr_uint32_t rather than apr_size_t for the
     maximum hash table size.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64240 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_hash.h |  2 +-
     tables/apr_hash.c  | 20 ++++++++++----------
     2 files changed, 11 insertions(+), 11 deletions(-)
    
    diff --git a/include/apr_hash.h b/include/apr_hash.h
    index 80fb1fccf9f..126c407cce0 100644
    --- a/include/apr_hash.h
    +++ b/include/apr_hash.h
    @@ -190,7 +190,7 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key,
      * @param ht The hash table
      * @return The number of key/value pairs in the hash table.
      */
    -APR_DECLARE(apr_size_t) apr_hash_count(apr_hash_t *ht);
    +APR_DECLARE(apr_uint32_t) apr_hash_count(apr_hash_t *ht);
     
     /**
      * Merge two hash tables into one new hash table. The values of the overlay
    diff --git a/tables/apr_hash.c b/tables/apr_hash.c
    index 3947ecf6e2d..0db19ecb43e 100644
    --- a/tables/apr_hash.c
    +++ b/tables/apr_hash.c
    @@ -84,7 +84,7 @@ typedef struct apr_hash_entry_t apr_hash_entry_t;
     
     struct apr_hash_entry_t {
         apr_hash_entry_t *next;
    -    apr_size_t        hash;
    +    apr_uint32_t      hash;
         const void       *key;
         apr_ssize_t       klen;
         const void       *val;
    @@ -100,7 +100,7 @@ struct apr_hash_entry_t {
     struct apr_hash_index_t {
         apr_hash_t         *ht;
         apr_hash_entry_t   *this, *next;
    -    apr_size_t          index;
    +    apr_uint32_t        index;
     };
     
     /*
    @@ -114,7 +114,7 @@ struct apr_hash_t {
         apr_pool_t          *pool;
         apr_hash_entry_t   **array;
         apr_hash_index_t     iterator;  /* For apr_hash_first(NULL, ...) */
    -    apr_size_t           count, max;
    +    apr_uint32_t         count, max;
     };
     
     #define INITIAL_MAX 15 /* tunable == 2^n - 1 */
    @@ -124,7 +124,7 @@ struct apr_hash_t {
      * Hash creation functions.
      */
     
    -static apr_hash_entry_t **alloc_array(apr_hash_t *ht, apr_size_t max)
    +static apr_hash_entry_t **alloc_array(apr_hash_t *ht, apr_uint32_t max)
     {
        return apr_pcalloc(ht->pool, sizeof(*ht->array) * (max + 1));
     }
    @@ -192,12 +192,12 @@ static void expand_array(apr_hash_t *ht)
     {
         apr_hash_index_t *hi;
         apr_hash_entry_t **new_array;
    -    apr_size_t new_max;
    +    apr_uint32_t new_max;
     
         new_max = ht->max * 2 + 1;
         new_array = alloc_array(ht, new_max);
         for (hi = apr_hash_first(NULL, ht); hi; hi = apr_hash_next(hi)) {
    -        apr_size_t i;
    +        apr_uint32_t i;
     
             i = hi->this->hash & new_max;
             hi->this->next = new_array[i];
    @@ -223,7 +223,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht,
     {
         apr_hash_entry_t **hep, *he;
         const unsigned char *p;
    -    apr_size_t hash;
    +    apr_uint32_t hash;
         apr_ssize_t i;
     
         /*
    @@ -304,7 +304,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool,
     {
         apr_hash_t *ht;
         apr_hash_entry_t *new_vals;
    -    apr_size_t i, j;
    +    apr_uint32_t i, j;
     
         ht = apr_palloc(pool, sizeof(apr_hash_t) +
                         sizeof(*ht->array) * (orig->max + 1) +
    @@ -371,7 +371,7 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht,
         /* else key not present and val==NULL */
     }
     
    -APR_DECLARE(apr_size_t) apr_hash_count(apr_hash_t *ht)
    +APR_DECLARE(apr_uint32_t) apr_hash_count(apr_hash_t *ht)
     {
         return ht->count;
     }
    @@ -398,7 +398,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p,
         apr_hash_entry_t *new_vals = NULL;
         apr_hash_entry_t *iter;
         apr_hash_entry_t *ent;
    -    apr_size_t i,j,k;
    +    apr_uint32_t i,j,k;
     
     #ifdef POOL_DEBUG
         /* we don't copy keys and values, so it's necessary that
    
    From 630fb8ceada9cc6c9b8fada1455f3c687fd977f3 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 31 Dec 2002 17:10:40 +0000
    Subject: [PATCH 4222/7878]   Fix apr_poll behavior on Darwin/Win32 (now
     passing testpoll.)   We were getting spurious returned events because the
     select-based   poll implementation wasn't zeroing out previous results before
       setting the current ones and returning.
    
    Submitted by:	Garrett Rooney 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64241 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/unix/poll.c | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/poll/unix/poll.c b/poll/unix/poll.c
    index a5a0965a74f..b0c215b71ec 100644
    --- a/poll/unix/poll.c
    +++ b/poll/unix/poll.c
    @@ -275,6 +275,10 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n
         }
     #endif
     
    +    for (i = 0; i < *nsds; i++) {
    +      aprset[i].rtnevents = 0;
    +    }
    +
         (*nsds) = rv;
         if ((*nsds) == 0) {
             return APR_TIMEUP;
    
    From 345f2bd63d2d1b49a1f3bb4fb618c513f72ad2af Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 31 Dec 2002 17:42:45 +0000
    Subject: [PATCH 4223/7878]   Agreed with Ryan... it's entirely redundant to
     run the tests twice where   libraries and modules are identical (although you
     may by defining LIB_NAME   the same as MOD_NAME)... and it makes no sense to
     emit a not-implemented   message in this case.  Drop the exception, and
     exclude the _library() fns   if LIB_NAME is undefined.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64242 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testdso.c | 17 ++++++-----------
     1 file changed, 6 insertions(+), 11 deletions(-)
    
    diff --git a/test/testdso.c b/test/testdso.c
    index fe720aa9700..75deef2df90 100644
    --- a/test/testdso.c
    +++ b/test/testdso.c
    @@ -80,7 +80,6 @@
     #endif
     
     static char *modname;
    -static char *libname;
     
     static void test_load_module(CuTest *tc)
     {
    @@ -161,6 +160,9 @@ static void test_unload_module(CuTest *tc)
     }
     
     
    +#ifdef LIB_NAME
    +static char *libname;
    +
     static void test_load_library(CuTest *tc)
     {
         apr_dso_handle_t *h = NULL;
    @@ -239,6 +241,8 @@ static void test_unload_library(CuTest *tc)
         CuAssertIntEquals(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status));
     }
     
    +#endif /* def(LIB_NAME) */
    +
     static void test_load_notthere(CuTest *tc)
     {
         apr_dso_handle_t *h = NULL;
    @@ -250,13 +254,6 @@ static void test_load_notthere(CuTest *tc)
         CuAssertPtrNotNull(tc, h);
     }    
     
    -#ifndef LIB_NAME
    -static void library_not_impl(CuTest *tc)
    -{
    -    CuNotImpl(tc, "Loadable libraries and modules are equivilant on this platform");
    -}
    -#endif
    -
     CuSuite *testdso(void)
     {
         CuSuite *suite = CuSuiteNew("DSO");
    @@ -270,9 +267,7 @@ CuSuite *testdso(void)
         SUITE_ADD_TEST(suite, test_dso_sym_return_value);
         SUITE_ADD_TEST(suite, test_unload_module);
     
    -#ifndef LIB_NAME
    -    SUITE_ADD_TEST(suite, library_not_impl);
    -#else
    +#ifdef LIB_NAME
         libname = apr_pcalloc(p, 256);
         getcwd(libname, 256);
         libname = apr_pstrcat(p, libname, "/", LIB_NAME, NULL);
    
    From 53ddd1e5b994d53cf1e2f0ee93ab121155030f68 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 31 Dec 2002 17:44:56 +0000
    Subject: [PATCH 4224/7878]   A second stab at getting
     apr_thread_cond_timedwait to work.  Someone   else should look at this code,
     please, and let me know if it follows   the correct behavior.  It passes the
     tests, but that presumes the tests   themselves are sufficient.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64243 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/win32/thread_cond.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c
    index e0c428f7234..ee7e9dda124 100644
    --- a/locks/win32/thread_cond.c
    +++ b/locks/win32/thread_cond.c
    @@ -128,7 +128,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond,
         while (1) {
             res = WaitForSingleObject(cond->mutex, timeout_ms);
             if (res != WAIT_OBJECT_0) {
    -            if (res == WAIT_ABANDONED) {
    +            if (res == WAIT_TIMEOUT) {
                     return APR_TIMEUP;
                 }
                 return apr_get_os_error();
    @@ -142,7 +142,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond,
             if (res != WAIT_OBJECT_0) {
                 apr_status_t rv = apr_get_os_error();
                 ReleaseMutex(cond->mutex);
    -            if (res == WAIT_ABANDONED) {
    +            if (res == WAIT_TIMEOUT) {
                     rv = APR_TIMEUP;
                 }
                 return rv;
    
    From 79608f7c10d4716d84bc9b13e1d4269c9f6faa9c Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 31 Dec 2002 17:51:21 +0000
    Subject: [PATCH 4225/7878]   ABS_ROOT is simpler to follow if it is what its
     name implies
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64244 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testnames.c | 32 ++++++++++++++++----------------
     1 file changed, 16 insertions(+), 16 deletions(-)
    
    diff --git a/test/testnames.c b/test/testnames.c
    index 29ca7a657fc..cf4b3a6227e 100644
    --- a/test/testnames.c
    +++ b/test/testnames.c
    @@ -61,9 +61,9 @@
     #include "apr_lib.h"
     
     #if WIN32
    -#define ABS_ROOT "C:"
    +#define ABS_ROOT "C:/"
     #else
    -#define ABS_ROOT
    +#define ABS_ROOT "/"
     #endif
     
     static void merge_aboveroot(CuTest *tc)
    @@ -72,7 +72,7 @@ static void merge_aboveroot(CuTest *tc)
         char *dstpath = NULL;
         char errmsg[256];
     
    -    rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo", ABS_ROOT"/bar", APR_FILEPATH_NOTABOVEROOT,
    +    rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"bar", APR_FILEPATH_NOTABOVEROOT,
                                 p);
         apr_strerror(rv, errmsg, sizeof(errmsg));
         CuAssertPtrEquals(tc, NULL, dstpath);
    @@ -85,11 +85,11 @@ static void merge_belowroot(CuTest *tc)
         apr_status_t rv;
         char *dstpath = NULL;
     
    -    rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo", ABS_ROOT"/foo/bar", 
    +    rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"foo/bar", 
                                 APR_FILEPATH_NOTABOVEROOT, p);
         CuAssertPtrNotNull(tc, dstpath);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, ABS_ROOT"/foo/bar", dstpath);
    +    CuAssertStrEquals(tc, ABS_ROOT"foo/bar", dstpath);
     }
     
     static void merge_noflag(CuTest *tc)
    @@ -97,10 +97,10 @@ static void merge_noflag(CuTest *tc)
         apr_status_t rv;
         char *dstpath = NULL;
     
    -    rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo", ABS_ROOT"/foo/bar", 0, p);
    +    rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"foo/bar", 0, p);
         CuAssertPtrNotNull(tc, dstpath);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, ABS_ROOT"/foo/bar", dstpath);
    +    CuAssertStrEquals(tc, ABS_ROOT"foo/bar", dstpath);
     }
     
     static void merge_dotdot(CuTest *tc)
    @@ -108,10 +108,10 @@ static void merge_dotdot(CuTest *tc)
         apr_status_t rv;
         char *dstpath = NULL;
     
    -    rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo/bar", "../baz", 0, p);
    +    rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz", 0, p);
         CuAssertPtrNotNull(tc, dstpath);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, ABS_ROOT"/foo/baz", dstpath);
    +    CuAssertStrEquals(tc, ABS_ROOT"foo/baz", dstpath);
     }
     
     static void merge_secure(CuTest *tc)
    @@ -119,10 +119,10 @@ static void merge_secure(CuTest *tc)
         apr_status_t rv;
         char *dstpath = NULL;
     
    -    rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo/bar", "../bar/baz", 0, p);
    +    rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../bar/baz", 0, p);
         CuAssertPtrNotNull(tc, dstpath);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, ABS_ROOT"/foo/bar/baz", dstpath);
    +    CuAssertStrEquals(tc, ABS_ROOT"foo/bar/baz", dstpath);
     }
     
     static void merge_notrel(CuTest *tc)
    @@ -130,11 +130,11 @@ static void merge_notrel(CuTest *tc)
         apr_status_t rv;
         char *dstpath = NULL;
     
    -    rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo/bar", "../baz",
    +    rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz",
                                 APR_FILEPATH_NOTRELATIVE, p);
         CuAssertPtrNotNull(tc, dstpath);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, ABS_ROOT"/foo/baz", dstpath);
    +    CuAssertStrEquals(tc, ABS_ROOT"foo/baz", dstpath);
     }
     
     static void merge_notrelfail(CuTest *tc)
    @@ -158,7 +158,7 @@ static void merge_notabsfail(CuTest *tc)
         char *dstpath = NULL;
         char errmsg[256];
     
    -    rv = apr_filepath_merge(&dstpath, ABS_ROOT"/foo/bar", "../baz", 
    +    rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz", 
                                 APR_FILEPATH_NOTABSOLUTE, p);
         apr_strerror(rv, errmsg, sizeof(errmsg));
     
    @@ -184,13 +184,13 @@ static void root_absolute(CuTest *tc)
     {
         apr_status_t rv;
         const char *root = NULL;
    -    const char *path = ABS_ROOT"/foo/bar";
    +    const char *path = ABS_ROOT"foo/bar";
     
         rv = apr_filepath_root(&root, &path, 0, p);
     
         CuAssertPtrNotNull(tc, root);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, ABS_ROOT"/", root);
    +    CuAssertStrEquals(tc, ABS_ROOT, root);
     }
     
     static void root_relative(CuTest *tc)
    
    From 624b296987baf09ad8ccf7001a3aaed59953b9e4 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 31 Dec 2002 18:00:57 +0000
    Subject: [PATCH 4226/7878]   Look at the status before the pointer result
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64245 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testnames.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/testnames.c b/test/testnames.c
    index cf4b3a6227e..3c07d4b8129 100644
    --- a/test/testnames.c
    +++ b/test/testnames.c
    @@ -75,8 +75,8 @@ static void merge_aboveroot(CuTest *tc)
         rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"bar", APR_FILEPATH_NOTABOVEROOT,
                                 p);
         apr_strerror(rv, errmsg, sizeof(errmsg));
    -    CuAssertPtrEquals(tc, NULL, dstpath);
         CuAssertIntEquals(tc, 1, APR_STATUS_IS_EABOVEROOT(rv));
    +    CuAssertPtrEquals(tc, NULL, dstpath);
         CuAssertStrEquals(tc, "The given path was above the root path", errmsg);
     }
     
    
    From 08e8274ed73539bd353e99e2c98e089f91755551 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 31 Dec 2002 18:03:41 +0000
    Subject: [PATCH 4227/7878]   We can't optimize away this test!  Just because a
     path didn't contain   backslashes doesn't mean that both paths were not
     absolute.
    
      There probably is a 'safe' optimization for that block, but I'm not
      seeing it this morning.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64246 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filepath.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c
    index 417aa0c0b68..c0e22a0a46d 100644
    --- a/file_io/win32/filepath.c
    +++ b/file_io/win32/filepath.c
    @@ -834,7 +834,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath,
          * is still within given basepath.  Note that the root path 
          * segment is thoroughly tested prior to path parsing.
          */
    -    if (flags & APR_FILEPATH_NOTABOVEROOT && (keptlen - rootlen) < baselen) {
    +    if (flags & APR_FILEPATH_NOTABOVEROOT) {
             if (memcmp(basepath, path + rootlen, baselen))
                 return APR_EABOVEROOT;
     
    
    From 4fe8c40ead7b8fbbdb67e5f6abadea59dc15bb40 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 31 Dec 2002 18:46:29 +0000
    Subject: [PATCH 4228/7878]   APR_STATUS_IS_FOO() tests must provide at _least_
     the canonical test for   APR_FOO amoungst other platform-specific flavors.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64247 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h | 10 +++++++---
     1 file changed, 7 insertions(+), 3 deletions(-)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 13aab4b6081..6917e0d81c9 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -370,7 +370,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
      * For more information call apr_dso_error().
      */
     #if defined(WIN32)
    -#define APR_STATUS_IS_EDSOOPEN(s)       (APR_TO_OS_ERROR(s) == ERROR_MOD_NOT_FOUND)
    +#define APR_STATUS_IS_EDSOOPEN(s)       ((s) == APR_EDSOOPEN \
    +                       || APR_TO_OS_ERROR(s) == ERROR_MOD_NOT_FOUND)
     #else
     #define APR_STATUS_IS_EDSOOPEN(s)       ((s) == APR_EDSOOPEN)
     #endif
    @@ -386,9 +387,12 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_EBADPATH(s)       ((s) == APR_EBADPATH)
     /** The given path contained wildcards. */
     #define APR_STATUS_IS_EPATHWILD(s)      ((s) == APR_EPATHWILD)
    -/** Could not find the requested symbol. */
    +/** Could not find the requested symbol.
    + * For more information call apr_dso_error().
    + */
     #if defined(WIN32)
    -#define APR_STATUS_IS_ESYMNOTFOUND(s)   (APR_TO_OS_ERROR(s) == ERROR_PROC_NOT_FOUND)
    +#define APR_STATUS_IS_ESYMNOTFOUND(s)   ((s) == APR_ESYMNOTFOUND \
    +                       || APR_TO_OS_ERROR(s) == ERROR_PROC_NOT_FOUND)
     #else
     #define APR_STATUS_IS_ESYMNOTFOUND(s)   ((s) == APR_ESYMNOTFOUND)
     #endif
    
    From fe8e75686e69bebdd7b3a34f377dec63f818bef4 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 31 Dec 2002 19:37:04 +0000
    Subject: [PATCH 4229/7878]   Clarify what is going on here... Win32 can only
     recover the 'primary'   group of an existing token.  An arbitrary user sid
     can't be an   authenticated token, so apr_uid_get cannot return the group.
    
      There may be a way to do so, but I hadn't found it.  For now, register
      this case as not implemented; it would probably be better if both the
      apr_uid_get and apr_uid_current quit dealing in gids altogether.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64248 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testuser.c | 16 +++++++++++++++-
     1 file changed, 15 insertions(+), 1 deletion(-)
    
    diff --git a/test/testuser.c b/test/testuser.c
    index 8dc453f8236..aa052100cc1 100644
    --- a/test/testuser.c
    +++ b/test/testuser.c
    @@ -88,7 +88,21 @@ static void username(CuTest *tc)
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
         CuAssertIntEquals(tc, APR_SUCCESS, apr_uid_compare(uid, retreived_uid));
    -    CuAssertIntEquals(tc, APR_SUCCESS, apr_gid_compare(gid, retreived_gid));
    +    if (!gid || !retreived_gid) {
    +        /* The function had no way to recover the gid (this would have been
    +         * an ENOTIMPL if apr_uid_ functions didn't try to double-up and
    +         * also return apr_gid_t values, which was bogus.
    +         */
    +        if (!gid) {
    +            CuNotImpl(tc, "Groups from apr_uid_current");
    +        }
    +        else {
    +            CuNotImpl(tc, "Groups from apr_uid_get");
    +        }        
    +    }
    +    else {
    +        CuAssertIntEquals(tc, APR_SUCCESS, apr_gid_compare(gid, retreived_gid));
    +    }
     }
     
     static void groupname(CuTest *tc)
    
    From c4a81589f4f0d46c72b8d20a864a85fda5afc341 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 31 Dec 2002 19:38:30 +0000
    Subject: [PATCH 4230/7878]   I like Ryan's formatting of the notimpl stuff, do
     the same for failure.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64249 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/CuTest.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/CuTest.c b/test/CuTest.c
    index c3ed2a5d2b1..ec643ddc920 100644
    --- a/test/CuTest.c
    +++ b/test/CuTest.c
    @@ -323,7 +323,7 @@ void CuSuiteDetails(CuSuite* testSuite, CuString* details)
     
     	if (testSuite->failCount != 0 && verbose)
     	{
    -		CuStringAppendFormat(details, "Failed tests in %s:\n", testSuite->name);
    +		CuStringAppendFormat(details, "\nFailed tests in %s:\n", testSuite->name);
     		for (i = 0 ; i < testSuite->count ; ++i)
     		{
     			CuTest* testCase = testSuite->list[i];
    
    From 9517f10a8fa1f8ff9a443eb50a64d710120c7c67 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 31 Dec 2002 19:42:57 +0000
    Subject: [PATCH 4231/7878]   CuFail appends a newline; reserve blank lines to
     seperate test suites.   This bit of formatting looks lousy either way, but
     this seems more   consistent to me.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64250 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/CuTest.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/test/CuTest.c b/test/CuTest.c
    index ec643ddc920..8356b9b2808 100644
    --- a/test/CuTest.c
    +++ b/test/CuTest.c
    @@ -192,7 +192,7 @@ void CuAssertStrNEquals(CuTest* tc, const char* expected, const char* actual,
     	CuStringAppend(message, expected);
     	CuStringAppend(message, "\n<----\nbut saw\n---->\n");
     	CuStringAppend(message, actual);
    -	CuStringAppend(message, "\n<----\n");
    +	CuStringAppend(message, "\n<----");
     	CuFail(tc, message->buffer);
     }
     
    @@ -205,7 +205,7 @@ void CuAssertStrEquals(CuTest* tc, const char* expected, const char* actual)
     	CuStringAppend(message, expected);
     	CuStringAppend(message, "\n<----\nbut saw\n---->\n");
     	CuStringAppend(message, actual);
    -	CuStringAppend(message, "\n<----\n");
    +	CuStringAppend(message, "\n<----");
     	CuFail(tc, message->buffer);
     }
     
    
    From e463a2813df3c304501e99d76cd3c394c0ef78bf Mon Sep 17 00:00:00 2001
    From: Thom May 
    Date: Wed, 1 Jan 2003 00:02:01 +0000
    Subject: [PATCH 4232/7878] Update copyright notices to 2003. No functional
     changes
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64251 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr-config.in                              | 2 +-
     atomic/netware/apr_atomic.c                | 2 +-
     atomic/os390/atomic.c                      | 2 +-
     atomic/solaris_sparc/apr_atomic_sparc.s    | 2 +-
     atomic/unix/apr_atomic.c                   | 2 +-
     build/aplibtool.c                          | 2 +-
     build/rules.mk.in                          | 2 +-
     build/win32ver.awk                         | 2 +-
     buildconf                                  | 2 +-
     dso/aix/dso.c                              | 2 +-
     dso/beos/dso.c                             | 2 +-
     dso/netware/dso.c                          | 2 +-
     dso/os2/dso.c                              | 2 +-
     dso/os390/dso.c                            | 2 +-
     dso/unix/dso.c                             | 2 +-
     dso/win32/dso.c                            | 2 +-
     file_io/netware/filestat.c                 | 2 +-
     file_io/netware/filesys.c                  | 2 +-
     file_io/netware/flock.c                    | 2 +-
     file_io/netware/pipe.c                     | 2 +-
     file_io/os2/dir.c                          | 2 +-
     file_io/os2/fileacc.c                      | 2 +-
     file_io/os2/filedup.c                      | 2 +-
     file_io/os2/filestat.c                     | 2 +-
     file_io/os2/filesys.c                      | 2 +-
     file_io/os2/flock.c                        | 2 +-
     file_io/os2/maperrorcode.c                 | 2 +-
     file_io/os2/open.c                         | 2 +-
     file_io/os2/pipe.c                         | 2 +-
     file_io/os2/readwrite.c                    | 2 +-
     file_io/os2/seek.c                         | 2 +-
     file_io/unix/copy.c                        | 2 +-
     file_io/unix/dir.c                         | 2 +-
     file_io/unix/fileacc.c                     | 2 +-
     file_io/unix/filedup.c                     | 2 +-
     file_io/unix/filepath.c                    | 2 +-
     file_io/unix/filestat.c                    | 2 +-
     file_io/unix/flock.c                       | 2 +-
     file_io/unix/fullrw.c                      | 2 +-
     file_io/unix/mktemp.c                      | 2 +-
     file_io/unix/open.c                        | 2 +-
     file_io/unix/pipe.c                        | 2 +-
     file_io/unix/readwrite.c                   | 2 +-
     file_io/unix/seek.c                        | 2 +-
     file_io/win32/dir.c                        | 2 +-
     file_io/win32/filedup.c                    | 2 +-
     file_io/win32/filepath.c                   | 2 +-
     file_io/win32/filestat.c                   | 2 +-
     file_io/win32/filesys.c                    | 2 +-
     file_io/win32/flock.c                      | 2 +-
     file_io/win32/open.c                       | 2 +-
     file_io/win32/pipe.c                       | 2 +-
     file_io/win32/readwrite.c                  | 2 +-
     file_io/win32/seek.c                       | 2 +-
     include/apr.hnw                            | 2 +-
     include/apr.hw                             | 2 +-
     include/apr_allocator.h                    | 2 +-
     include/apr_atomic.h                       | 2 +-
     include/apr_dso.h                          | 2 +-
     include/apr_errno.h                        | 2 +-
     include/apr_file_info.h                    | 2 +-
     include/apr_file_io.h                      | 2 +-
     include/apr_general.h                      | 2 +-
     include/apr_getopt.h                       | 2 +-
     include/apr_global_mutex.h                 | 2 +-
     include/apr_hash.h                         | 2 +-
     include/apr_inherit.h                      | 2 +-
     include/apr_lib.h                          | 2 +-
     include/apr_mmap.h                         | 2 +-
     include/apr_network_io.h                   | 2 +-
     include/apr_poll.h                         | 2 +-
     include/apr_pools.h                        | 2 +-
     include/apr_portable.h                     | 2 +-
     include/apr_proc_mutex.h                   | 2 +-
     include/apr_ring.h                         | 2 +-
     include/apr_shm.h                          | 2 +-
     include/apr_signal.h                       | 2 +-
     include/apr_strings.h                      | 2 +-
     include/apr_support.h                      | 2 +-
     include/apr_tables.h                       | 2 +-
     include/apr_thread_cond.h                  | 2 +-
     include/apr_thread_mutex.h                 | 2 +-
     include/apr_thread_proc.h                  | 2 +-
     include/apr_thread_rwlock.h                | 2 +-
     include/apr_time.h                         | 2 +-
     include/apr_user.h                         | 2 +-
     include/apr_version.h                      | 2 +-
     include/apr_want.h                         | 2 +-
     include/arch/aix/dso.h                     | 2 +-
     include/arch/beos/dso.h                    | 2 +-
     include/arch/beos/proc_mutex.h             | 2 +-
     include/arch/beos/thread_cond.h            | 2 +-
     include/arch/beos/thread_mutex.h           | 2 +-
     include/arch/beos/thread_rwlock.h          | 2 +-
     include/arch/beos/threadproc.h             | 2 +-
     include/arch/netware/apr_private.h         | 2 +-
     include/arch/netware/dso.h                 | 2 +-
     include/arch/netware/fileio.h              | 2 +-
     include/arch/netware/global_mutex.h        | 2 +-
     include/arch/netware/internal_time.h       | 2 +-
     include/arch/netware/networkio.h           | 2 +-
     include/arch/netware/proc_mutex.h          | 2 +-
     include/arch/netware/thread_cond.h         | 2 +-
     include/arch/netware/thread_mutex.h        | 2 +-
     include/arch/netware/thread_rwlock.h       | 2 +-
     include/arch/netware/threadproc.h          | 2 +-
     include/arch/os2/dso.h                     | 2 +-
     include/arch/os2/fileio.h                  | 2 +-
     include/arch/os2/networkio.h               | 2 +-
     include/arch/os2/os2calls.h                | 2 +-
     include/arch/os2/proc_mutex.h              | 2 +-
     include/arch/os2/thread_cond.h             | 2 +-
     include/arch/os2/thread_mutex.h            | 2 +-
     include/arch/os2/thread_rwlock.h           | 2 +-
     include/arch/os2/threadproc.h              | 2 +-
     include/arch/os390/dso.h                   | 2 +-
     include/arch/unix/dso.h                    | 2 +-
     include/arch/unix/fileio.h                 | 2 +-
     include/arch/unix/global_mutex.h           | 2 +-
     include/arch/unix/inherit.h                | 2 +-
     include/arch/unix/internal_time.h          | 2 +-
     include/arch/unix/misc.h                   | 2 +-
     include/arch/unix/networkio.h              | 2 +-
     include/arch/unix/proc_mutex.h             | 2 +-
     include/arch/unix/shm.h                    | 2 +-
     include/arch/unix/thread_cond.h            | 2 +-
     include/arch/unix/thread_mutex.h           | 2 +-
     include/arch/unix/thread_rwlock.h          | 2 +-
     include/arch/unix/threadproc.h             | 2 +-
     include/arch/win32/apr_dbg_win32_handles.h | 2 +-
     include/arch/win32/apr_private.h           | 2 +-
     include/arch/win32/atime.h                 | 2 +-
     include/arch/win32/dso.h                   | 2 +-
     include/arch/win32/fileio.h                | 2 +-
     include/arch/win32/inherit.h               | 2 +-
     include/arch/win32/misc.h                  | 2 +-
     include/arch/win32/networkio.h             | 2 +-
     include/arch/win32/proc_mutex.h            | 2 +-
     include/arch/win32/thread_cond.h           | 2 +-
     include/arch/win32/thread_mutex.h          | 2 +-
     include/arch/win32/thread_rwlock.h         | 2 +-
     include/arch/win32/threadproc.h            | 2 +-
     include/arch/win32/utf8.h                  | 2 +-
     locks/beos/proc_mutex.c                    | 2 +-
     locks/beos/thread_cond.c                   | 2 +-
     locks/beos/thread_mutex.c                  | 2 +-
     locks/beos/thread_rwlock.c                 | 2 +-
     locks/netware/proc_mutex.c                 | 2 +-
     locks/netware/thread_cond.c                | 2 +-
     locks/netware/thread_mutex.c               | 2 +-
     locks/netware/thread_rwlock.c              | 2 +-
     locks/os2/proc_mutex.c                     | 2 +-
     locks/os2/thread_cond.c                    | 2 +-
     locks/os2/thread_mutex.c                   | 2 +-
     locks/os2/thread_rwlock.c                  | 2 +-
     locks/unix/global_mutex.c                  | 2 +-
     locks/unix/proc_mutex.c                    | 2 +-
     locks/unix/thread_cond.c                   | 2 +-
     locks/unix/thread_mutex.c                  | 2 +-
     locks/unix/thread_rwlock.c                 | 2 +-
     locks/win32/proc_mutex.c                   | 2 +-
     locks/win32/thread_cond.c                  | 2 +-
     locks/win32/thread_mutex.c                 | 2 +-
     locks/win32/thread_rwlock.c                | 2 +-
     memory/unix/apr_pools.c                    | 2 +-
     misc/netware/charset.c                     | 2 +-
     misc/netware/rand.c                        | 2 +-
     misc/netware/start.c                       | 2 +-
     misc/os2/randbyte.c                        | 2 +-
     misc/unix/charset.c                        | 2 +-
     misc/unix/errorcodes.c                     | 2 +-
     misc/unix/otherchild.c                     | 2 +-
     misc/unix/rand.c                           | 2 +-
     misc/unix/start.c                          | 2 +-
     misc/unix/version.c                        | 2 +-
     misc/win32/apr_app.c                       | 2 +-
     misc/win32/charset.c                       | 2 +-
     misc/win32/internal.c                      | 2 +-
     misc/win32/misc.c                          | 2 +-
     misc/win32/rand.c                          | 2 +-
     misc/win32/start.c                         | 2 +-
     misc/win32/utf8.c                          | 2 +-
     mmap/unix/common.c                         | 2 +-
     mmap/unix/mmap.c                           | 2 +-
     mmap/win32/mmap.c                          | 2 +-
     network_io/beos/sendrecv.c                 | 2 +-
     network_io/os2/os2calls.c                  | 2 +-
     network_io/os2/sendrecv.c                  | 2 +-
     network_io/os2/sendrecv_udp.c              | 2 +-
     network_io/os2/sockets.c                   | 2 +-
     network_io/os2/sockopt.c                   | 2 +-
     network_io/unix/sendrecv.c                 | 2 +-
     network_io/unix/sockaddr.c                 | 2 +-
     network_io/unix/sockets.c                  | 2 +-
     network_io/unix/sockopt.c                  | 2 +-
     network_io/win32/sendrecv.c                | 2 +-
     network_io/win32/sockets.c                 | 2 +-
     network_io/win32/sockopt.c                 | 2 +-
     passwd/apr_getpass.c                       | 2 +-
     poll/os2/poll.c                            | 2 +-
     poll/os2/pollset.c                         | 2 +-
     poll/unix/poll.c                           | 2 +-
     poll/unix/pollacc.c                        | 2 +-
     shmem/beos/shm.c                           | 2 +-
     shmem/os2/shm.c                            | 2 +-
     shmem/unix/shm.c                           | 2 +-
     shmem/win32/shm.c                          | 2 +-
     strings/apr_cpystrn.c                      | 2 +-
     strings/apr_snprintf.c                     | 2 +-
     strings/apr_strings.c                      | 2 +-
     strings/apr_strtok.c                       | 2 +-
     support/unix/waitio.c                      | 2 +-
     tables/apr_hash.c                          | 2 +-
     tables/apr_tables.c                        | 2 +-
     test/aprtest.h                             | 2 +-
     test/client.c                              | 2 +-
     test/internal/testregex.c                  | 2 +-
     test/internal/testucs.c                    | 2 +-
     test/mod_test.c                            | 2 +-
     test/sendfile.c                            | 2 +-
     test/server.c                              | 2 +-
     test/test_apr.h                            | 2 +-
     test/testall.c                             | 2 +-
     test/testargs.c                            | 2 +-
     test/testatomic.c                          | 2 +-
     test/testdir.c                             | 2 +-
     test/testdso.c                             | 2 +-
     test/testdup.c                             | 2 +-
     test/testfile.c                            | 2 +-
     test/testfileinfo.c                        | 2 +-
     test/testflock.c                           | 2 +-
     test/testfmt.c                             | 2 +-
     test/testglobalmutex.c                     | 2 +-
     test/testhash.c                            | 2 +-
     test/testipsub.c                           | 2 +-
     test/testlock.c                            | 2 +-
     test/testlockperf.c                        | 2 +-
     test/testmmap.c                            | 2 +-
     test/testmutexscope.c                      | 2 +-
     test/testnames.c                           | 2 +-
     test/testoc.c                              | 2 +-
     test/testpipe.c                            | 2 +-
     test/testpoll.c                            | 2 +-
     test/testpools.c                           | 2 +-
     test/testproc.c                            | 2 +-
     test/testprocmutex.c                       | 2 +-
     test/testrand.c                            | 2 +-
     test/testshm.c                             | 2 +-
     test/testshmconsumer.c                     | 2 +-
     test/testshmproducer.c                     | 2 +-
     test/testsleep.c                           | 2 +-
     test/testsock.c                            | 2 +-
     test/testsockets.c                         | 2 +-
     test/testsockopt.c                         | 2 +-
     test/teststr.c                             | 2 +-
     test/testtable.c                           | 2 +-
     test/testthread.c                          | 2 +-
     test/testtime.c                            | 2 +-
     test/testud.c                              | 2 +-
     test/testuser.c                            | 2 +-
     test/testvsn.c                             | 2 +-
     threadproc/beos/apr_proc_stub.c            | 2 +-
     threadproc/beos/proc.c                     | 2 +-
     threadproc/beos/thread.c                   | 2 +-
     threadproc/beos/threadpriv.c               | 2 +-
     threadproc/beos/threadproc_common.c        | 2 +-
     threadproc/netware/proc.c                  | 2 +-
     threadproc/netware/procsup.c               | 2 +-
     threadproc/netware/signals.c               | 2 +-
     threadproc/netware/thread.c                | 2 +-
     threadproc/netware/threadpriv.c            | 2 +-
     threadproc/os2/proc.c                      | 2 +-
     threadproc/os2/thread.c                    | 2 +-
     threadproc/os2/threadpriv.c                | 2 +-
     threadproc/unix/proc.c                     | 2 +-
     threadproc/unix/procsup.c                  | 2 +-
     threadproc/unix/signals.c                  | 2 +-
     threadproc/unix/thread.c                   | 2 +-
     threadproc/unix/threadpriv.c               | 2 +-
     threadproc/win32/proc.c                    | 2 +-
     threadproc/win32/signals.c                 | 2 +-
     threadproc/win32/thread.c                  | 2 +-
     threadproc/win32/threadpriv.c              | 2 +-
     time/unix/time.c                           | 2 +-
     time/unix/timestr.c                        | 2 +-
     time/win32/access.c                        | 2 +-
     time/win32/time.c                          | 2 +-
     time/win32/timestr.c                       | 2 +-
     user/netware/groupinfo.c                   | 2 +-
     user/netware/userinfo.c                    | 2 +-
     user/unix/groupinfo.c                      | 2 +-
     user/unix/userinfo.c                       | 2 +-
     user/win32/groupinfo.c                     | 2 +-
     user/win32/userinfo.c                      | 2 +-
     294 files changed, 294 insertions(+), 294 deletions(-)
    
    diff --git a/apr-config.in b/apr-config.in
    index 8ae8649fd43..e3ab2dc168a 100644
    --- a/apr-config.in
    +++ b/apr-config.in
    @@ -2,7 +2,7 @@
     # ====================================================================
     # The Apache Software License, Version 1.1
     #
    -# Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
    +# Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
     # reserved.
     #
     # Redistribution and use in source and binary forms, with or without
    diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c
    index ff21945eb50..243c0f576eb 100644
    --- a/atomic/netware/apr_atomic.c
    +++ b/atomic/netware/apr_atomic.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c
    index bd130abb2b2..84fa8f8d9c2 100644
    --- a/atomic/os390/atomic.c
    +++ b/atomic/os390/atomic.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/atomic/solaris_sparc/apr_atomic_sparc.s b/atomic/solaris_sparc/apr_atomic_sparc.s
    index 9d87fe03d79..5361db6ebbc 100644
    --- a/atomic/solaris_sparc/apr_atomic_sparc.s
    +++ b/atomic/solaris_sparc/apr_atomic_sparc.s
    @@ -1,7 +1,7 @@
     !* ====================================================================
     !* The Apache Software License, Version 1.1
     !*
    -!* Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    +!* Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
     !* reserved.
     !*
     !* Redistribution and use in source and binary forms, with or without
    diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c
    index 10ffb491657..496f71b8c12 100644
    --- a/atomic/unix/apr_atomic.c
    +++ b/atomic/unix/apr_atomic.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/build/aplibtool.c b/build/aplibtool.c
    index f28896ff54e..a9443a3a5ad 100644
    --- a/build/aplibtool.c
    +++ b/build/aplibtool.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/build/rules.mk.in b/build/rules.mk.in
    index 68da150d073..a23738738e0 100644
    --- a/build/rules.mk.in
    +++ b/build/rules.mk.in
    @@ -1,7 +1,7 @@
     # ====================================================================
     # The Apache Software License, Version 1.1
     #
    -# Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    +# Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
     # reserved.
     #
     # Redistribution and use in source and binary forms, with or without
    diff --git a/build/win32ver.awk b/build/win32ver.awk
    index 175b4a7b250..19ab3ebc1cd 100644
    --- a/build/win32ver.awk
    +++ b/build/win32ver.awk
    @@ -91,7 +91,7 @@ BEGIN {
       print "      VALUE \"FileDescription\", \"" desc "\\0\"";
       print "      VALUE \"FileVersion\", \"" ver "\\0\"";
       print "      VALUE \"InternalName\", \"" file "\\0\"";
    -  print "      VALUE \"LegalCopyright\", \"Copyright © 2000-2002 "\
    +  print "      VALUE \"LegalCopyright\", \"Copyright © 2000-2003 "\
             "The Apache Software Foundation.\\0\"";
       print "      VALUE \"OriginalFilename\", \"" file ".exe\\0\"";
       if (vendor) {
    diff --git a/buildconf b/buildconf
    index be13d7468a2..f1c3235068c 100755
    --- a/buildconf
    +++ b/buildconf
    @@ -2,7 +2,7 @@
     # ====================================================================
     # The Apache Software License, Version 1.1
     #
    -# Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    +# Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
     # reserved.
     #
     # Redistribution and use in source and binary forms, with or without
    diff --git a/dso/aix/dso.c b/dso/aix/dso.c
    index 0c0d6be95dc..7520ee6f51c 100644
    --- a/dso/aix/dso.c
    +++ b/dso/aix/dso.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/dso/beos/dso.c b/dso/beos/dso.c
    index 111c9026521..d26ca4b052c 100644
    --- a/dso/beos/dso.c
    +++ b/dso/beos/dso.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/dso/netware/dso.c b/dso/netware/dso.c
    index 33f96022271..3ccca1abcfe 100644
    --- a/dso/netware/dso.c
    +++ b/dso/netware/dso.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/dso/os2/dso.c b/dso/os2/dso.c
    index c5cb86a673e..768a27e9b1d 100644
    --- a/dso/os2/dso.c
    +++ b/dso/os2/dso.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/dso/os390/dso.c b/dso/os390/dso.c
    index 19934d1b7b0..e580e2c2c3f 100644
    --- a/dso/os390/dso.c
    +++ b/dso/os390/dso.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/dso/unix/dso.c b/dso/unix/dso.c
    index dbdd444202c..9f68e238027 100644
    --- a/dso/unix/dso.c
    +++ b/dso/unix/dso.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/dso/win32/dso.c b/dso/win32/dso.c
    index 2b5c22fcead..22e5ff5de93 100644
    --- a/dso/win32/dso.c
    +++ b/dso/win32/dso.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c
    index ca61c7d9f52..b86213fc7cc 100644
    --- a/file_io/netware/filestat.c
    +++ b/file_io/netware/filestat.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/netware/filesys.c b/file_io/netware/filesys.c
    index 8960cf1c87a..195e7654c17 100644
    --- a/file_io/netware/filesys.c
    +++ b/file_io/netware/filesys.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/netware/flock.c b/file_io/netware/flock.c
    index 5b54c2f083a..69be365ebf1 100644
    --- a/file_io/netware/flock.c
    +++ b/file_io/netware/flock.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c
    index 7b8fca77add..a3f7d0a57ce 100644
    --- a/file_io/netware/pipe.c
    +++ b/file_io/netware/pipe.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c
    index 59f61b265de..b2ad12f6833 100644
    --- a/file_io/os2/dir.c
    +++ b/file_io/os2/dir.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/os2/fileacc.c b/file_io/os2/fileacc.c
    index c3bb5d9d5b0..a1b0e1f5f55 100644
    --- a/file_io/os2/fileacc.c
    +++ b/file_io/os2/fileacc.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c
    index 1243e8aa588..3b74d0e0207 100644
    --- a/file_io/os2/filedup.c
    +++ b/file_io/os2/filedup.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c
    index 7749b35c977..1214aff146a 100644
    --- a/file_io/os2/filestat.c
    +++ b/file_io/os2/filestat.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c
    index 89fd53ab858..c82f26aaf6c 100644
    --- a/file_io/os2/filesys.c
    +++ b/file_io/os2/filesys.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/os2/flock.c b/file_io/os2/flock.c
    index ff3c59ee000..68ad421db58 100644
    --- a/file_io/os2/flock.c
    +++ b/file_io/os2/flock.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c
    index 4f6603f0833..4eaace7b7c7 100644
    --- a/file_io/os2/maperrorcode.c
    +++ b/file_io/os2/maperrorcode.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/os2/open.c b/file_io/os2/open.c
    index 3c1c80a452a..68bf48fa88e 100644
    --- a/file_io/os2/open.c
    +++ b/file_io/os2/open.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c
    index b96e5e43f10..06e9ca123c3 100644
    --- a/file_io/os2/pipe.c
    +++ b/file_io/os2/pipe.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c
    index 1a7212a6490..678c82f31cb 100644
    --- a/file_io/os2/readwrite.c
    +++ b/file_io/os2/readwrite.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c
    index a6a7fbea92f..02954c4a12a 100644
    --- a/file_io/os2/seek.c
    +++ b/file_io/os2/seek.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c
    index d7cb4730be4..609b5acec1a 100644
    --- a/file_io/unix/copy.c
    +++ b/file_io/unix/copy.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
    index b671c95fc9f..f61a7ea9990 100644
    --- a/file_io/unix/dir.c
    +++ b/file_io/unix/dir.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c
    index 8b50488bf95..fd2fab4883b 100644
    --- a/file_io/unix/fileacc.c
    +++ b/file_io/unix/fileacc.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c
    index aa21a77f688..d70c98b8795 100644
    --- a/file_io/unix/filedup.c
    +++ b/file_io/unix/filedup.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c
    index e450ecdf0bb..a6154a4a0f5 100644
    --- a/file_io/unix/filepath.c
    +++ b/file_io/unix/filepath.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c
    index e2487bec2b2..85729a9f6fd 100644
    --- a/file_io/unix/filestat.c
    +++ b/file_io/unix/filestat.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c
    index c57d158b379..0de18efc588 100644
    --- a/file_io/unix/flock.c
    +++ b/file_io/unix/flock.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c
    index 638ccfc506d..6c25e093ffa 100644
    --- a/file_io/unix/fullrw.c
    +++ b/file_io/unix/fullrw.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c
    index 20cd1d1ba71..cc1e02002d3 100644
    --- a/file_io/unix/mktemp.c
    +++ b/file_io/unix/mktemp.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index 87fd8b866ca..8b93f7119c0 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c
    index 16e21737c3b..5e8e63edc70 100644
    --- a/file_io/unix/pipe.c
    +++ b/file_io/unix/pipe.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c
    index fc283240d1b..2bb607edd14 100644
    --- a/file_io/unix/readwrite.c
    +++ b/file_io/unix/readwrite.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c
    index c3fe918b891..f3d740ee93c 100644
    --- a/file_io/unix/seek.c
    +++ b/file_io/unix/seek.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c
    index d34114f00c8..2b3e201e45f 100644
    --- a/file_io/win32/dir.c
    +++ b/file_io/win32/dir.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c
    index 5919f26b5b5..2fee4292503 100644
    --- a/file_io/win32/filedup.c
    +++ b/file_io/win32/filedup.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c
    index c0e22a0a46d..dc9ccadf4f1 100644
    --- a/file_io/win32/filepath.c
    +++ b/file_io/win32/filepath.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
    index cd4f6c2ac11..4743cbb216a 100644
    --- a/file_io/win32/filestat.c
    +++ b/file_io/win32/filestat.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c
    index 31689b40211..094d18ccee6 100644
    --- a/file_io/win32/filesys.c
    +++ b/file_io/win32/filesys.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c
    index 991db9037c3..fa01aa7300a 100644
    --- a/file_io/win32/flock.c
    +++ b/file_io/win32/flock.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/win32/open.c b/file_io/win32/open.c
    index b0bb7da0469..f87525c7df8 100644
    --- a/file_io/win32/open.c
    +++ b/file_io/win32/open.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c
    index 20fe2b49fe2..d216af13ecb 100644
    --- a/file_io/win32/pipe.c
    +++ b/file_io/win32/pipe.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c
    index 3b0a22e3d2a..fdec00a5933 100644
    --- a/file_io/win32/readwrite.c
    +++ b/file_io/win32/readwrite.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c
    index 4388c38c560..9b81d90bf9a 100644
    --- a/file_io/win32/seek.c
    +++ b/file_io/win32/seek.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr.hnw b/include/apr.hnw
    index 76d95f2d129..77242dc34fa 100644
    --- a/include/apr.hnw
    +++ b/include/apr.hnw
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr.hw b/include/apr.hw
    index 04726173566..61ee0696ede 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_allocator.h b/include/apr_allocator.h
    index 5e78ff766bd..551fa1b1b5f 100644
    --- a/include/apr_allocator.h
    +++ b/include/apr_allocator.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_atomic.h b/include/apr_atomic.h
    index 360b279cc92..dab8d40efc0 100644
    --- a/include/apr_atomic.h
    +++ b/include/apr_atomic.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_dso.h b/include/apr_dso.h
    index 8c113fc5619..1efd3c56302 100644
    --- a/include/apr_dso.h
    +++ b/include/apr_dso.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 6917e0d81c9..1b92207d9e2 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_file_info.h b/include/apr_file_info.h
    index 717858d9eea..8751d6c8a1e 100644
    --- a/include/apr_file_info.h
    +++ b/include/apr_file_info.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_file_io.h b/include/apr_file_io.h
    index 2fdd73cfda0..ebff428face 100644
    --- a/include/apr_file_io.h
    +++ b/include/apr_file_io.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_general.h b/include/apr_general.h
    index 03574e64c72..d01a0992124 100644
    --- a/include/apr_general.h
    +++ b/include/apr_general.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_getopt.h b/include/apr_getopt.h
    index a1ecb18088b..c45e444b6e8 100644
    --- a/include/apr_getopt.h
    +++ b/include/apr_getopt.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h
    index 05b572a998d..6fe8b3d7921 100644
    --- a/include/apr_global_mutex.h
    +++ b/include/apr_global_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_hash.h b/include/apr_hash.h
    index 126c407cce0..64fe920bc3e 100644
    --- a/include/apr_hash.h
    +++ b/include/apr_hash.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_inherit.h b/include/apr_inherit.h
    index d8e77ad0460..09162836166 100644
    --- a/include/apr_inherit.h
    +++ b/include/apr_inherit.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_lib.h b/include/apr_lib.h
    index 2e4e1ae3040..f35843f451d 100644
    --- a/include/apr_lib.h
    +++ b/include/apr_lib.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_mmap.h b/include/apr_mmap.h
    index 2c2278c9927..744f04e62a8 100644
    --- a/include/apr_mmap.h
    +++ b/include/apr_mmap.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_network_io.h b/include/apr_network_io.h
    index dcd560dab77..a40637fc3e7 100644
    --- a/include/apr_network_io.h
    +++ b/include/apr_network_io.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_poll.h b/include/apr_poll.h
    index 7f41955b446..95cc4dddc7d 100644
    --- a/include/apr_poll.h
    +++ b/include/apr_poll.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_pools.h b/include/apr_pools.h
    index 5fb7602160b..fcacd566204 100644
    --- a/include/apr_pools.h
    +++ b/include/apr_pools.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_portable.h b/include/apr_portable.h
    index 7eff31d020e..196ab8b1e38 100644
    --- a/include/apr_portable.h
    +++ b/include/apr_portable.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h
    index 94330a3d91e..e70da3588c2 100644
    --- a/include/apr_proc_mutex.h
    +++ b/include/apr_proc_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_ring.h b/include/apr_ring.h
    index 86cf0bb12cd..39d144ba71b 100644
    --- a/include/apr_ring.h
    +++ b/include/apr_ring.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_shm.h b/include/apr_shm.h
    index fdf428e9a5f..15408cc1282 100644
    --- a/include/apr_shm.h
    +++ b/include/apr_shm.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_signal.h b/include/apr_signal.h
    index ce5da1550be..6fda5a2a3a1 100644
    --- a/include/apr_signal.h
    +++ b/include/apr_signal.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_strings.h b/include/apr_strings.h
    index 0a59c1b4467..7b2779cd779 100644
    --- a/include/apr_strings.h
    +++ b/include/apr_strings.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_support.h b/include/apr_support.h
    index bbbee089995..f7649a0c4f7 100644
    --- a/include/apr_support.h
    +++ b/include/apr_support.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_tables.h b/include/apr_tables.h
    index 3d1970479d6..608784d2a97 100644
    --- a/include/apr_tables.h
    +++ b/include/apr_tables.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h
    index 5524ab5953f..52e0b5c8b79 100644
    --- a/include/apr_thread_cond.h
    +++ b/include/apr_thread_cond.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h
    index e02b885ccd3..6d89c10c3af 100644
    --- a/include/apr_thread_mutex.h
    +++ b/include/apr_thread_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h
    index d3bcf2812da..2681f195d21 100644
    --- a/include/apr_thread_proc.h
    +++ b/include/apr_thread_proc.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_thread_rwlock.h b/include/apr_thread_rwlock.h
    index 1d242ca137b..9f906abe74f 100644
    --- a/include/apr_thread_rwlock.h
    +++ b/include/apr_thread_rwlock.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_time.h b/include/apr_time.h
    index fc5f2ca278f..bc5a7f145a6 100644
    --- a/include/apr_time.h
    +++ b/include/apr_time.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_user.h b/include/apr_user.h
    index d31505cabea..3b8648ec53e 100644
    --- a/include/apr_user.h
    +++ b/include/apr_user.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_version.h b/include/apr_version.h
    index 0d3db8bfbd6..2629b840018 100644
    --- a/include/apr_version.h
    +++ b/include/apr_version.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/apr_want.h b/include/apr_want.h
    index 1c403f8d0fb..7ab68109006 100644
    --- a/include/apr_want.h
    +++ b/include/apr_want.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/aix/dso.h b/include/arch/aix/dso.h
    index 6b3630f4a30..0e4ee655461 100644
    --- a/include/arch/aix/dso.h
    +++ b/include/arch/aix/dso.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/beos/dso.h b/include/arch/beos/dso.h
    index 52e21fdad60..c37f9f228df 100644
    --- a/include/arch/beos/dso.h
    +++ b/include/arch/beos/dso.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/beos/proc_mutex.h b/include/arch/beos/proc_mutex.h
    index 712bb88e79f..fbea2d32f35 100644
    --- a/include/arch/beos/proc_mutex.h
    +++ b/include/arch/beos/proc_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/beos/thread_cond.h b/include/arch/beos/thread_cond.h
    index fcccdc20899..8bcbb7262c5 100644
    --- a/include/arch/beos/thread_cond.h
    +++ b/include/arch/beos/thread_cond.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/beos/thread_mutex.h b/include/arch/beos/thread_mutex.h
    index 4170957da7b..1667925eef1 100644
    --- a/include/arch/beos/thread_mutex.h
    +++ b/include/arch/beos/thread_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/beos/thread_rwlock.h b/include/arch/beos/thread_rwlock.h
    index a83704a2483..4b3fcafda86 100644
    --- a/include/arch/beos/thread_rwlock.h
    +++ b/include/arch/beos/thread_rwlock.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h
    index 759fc54c7aa..5d5e7ef7cdb 100644
    --- a/include/arch/beos/threadproc.h
    +++ b/include/arch/beos/threadproc.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h
    index 08063506cd0..6171c0d929e 100644
    --- a/include/arch/netware/apr_private.h
    +++ b/include/arch/netware/apr_private.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/netware/dso.h b/include/arch/netware/dso.h
    index b1679d0172d..926cf4c2943 100644
    --- a/include/arch/netware/dso.h
    +++ b/include/arch/netware/dso.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/netware/fileio.h b/include/arch/netware/fileio.h
    index 9a7d0569d7f..7779c2c208b 100644
    --- a/include/arch/netware/fileio.h
    +++ b/include/arch/netware/fileio.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/netware/global_mutex.h b/include/arch/netware/global_mutex.h
    index 132cf0df3da..b5c8db2f570 100644
    --- a/include/arch/netware/global_mutex.h
    +++ b/include/arch/netware/global_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/netware/internal_time.h b/include/arch/netware/internal_time.h
    index 55362b02b8a..4fe53df8b12 100644
    --- a/include/arch/netware/internal_time.h
    +++ b/include/arch/netware/internal_time.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/netware/networkio.h b/include/arch/netware/networkio.h
    index 522f5150181..812c1bba491 100644
    --- a/include/arch/netware/networkio.h
    +++ b/include/arch/netware/networkio.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/netware/proc_mutex.h b/include/arch/netware/proc_mutex.h
    index b69c17cf6f0..01541d3a110 100644
    --- a/include/arch/netware/proc_mutex.h
    +++ b/include/arch/netware/proc_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/netware/thread_cond.h b/include/arch/netware/thread_cond.h
    index 395ff610550..551a99239b2 100644
    --- a/include/arch/netware/thread_cond.h
    +++ b/include/arch/netware/thread_cond.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/netware/thread_mutex.h b/include/arch/netware/thread_mutex.h
    index 71e3b67fe5e..5dc9247ae78 100644
    --- a/include/arch/netware/thread_mutex.h
    +++ b/include/arch/netware/thread_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/netware/thread_rwlock.h b/include/arch/netware/thread_rwlock.h
    index 9a3b746faeb..e07ac70c675 100644
    --- a/include/arch/netware/thread_rwlock.h
    +++ b/include/arch/netware/thread_rwlock.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/netware/threadproc.h b/include/arch/netware/threadproc.h
    index 05c5f2cbb2c..a9d78f029f6 100644
    --- a/include/arch/netware/threadproc.h
    +++ b/include/arch/netware/threadproc.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/os2/dso.h b/include/arch/os2/dso.h
    index 4d49ac4cb98..86b92678bf6 100644
    --- a/include/arch/os2/dso.h
    +++ b/include/arch/os2/dso.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h
    index 6ecfea9e7f6..3fb44bdd69a 100644
    --- a/include/arch/os2/fileio.h
    +++ b/include/arch/os2/fileio.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h
    index 3f7a812bba7..d2ce6650218 100644
    --- a/include/arch/os2/networkio.h
    +++ b/include/arch/os2/networkio.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/os2/os2calls.h b/include/arch/os2/os2calls.h
    index 9ec583262bd..518d45b89ed 100644
    --- a/include/arch/os2/os2calls.h
    +++ b/include/arch/os2/os2calls.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/os2/proc_mutex.h b/include/arch/os2/proc_mutex.h
    index e197279fb12..f1e03013c57 100644
    --- a/include/arch/os2/proc_mutex.h
    +++ b/include/arch/os2/proc_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/os2/thread_cond.h b/include/arch/os2/thread_cond.h
    index ed30755e07a..9e31a0af07e 100644
    --- a/include/arch/os2/thread_cond.h
    +++ b/include/arch/os2/thread_cond.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/os2/thread_mutex.h b/include/arch/os2/thread_mutex.h
    index 7c901836963..2a3979b23b7 100644
    --- a/include/arch/os2/thread_mutex.h
    +++ b/include/arch/os2/thread_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/os2/thread_rwlock.h b/include/arch/os2/thread_rwlock.h
    index c5036c3e582..460843fd91f 100644
    --- a/include/arch/os2/thread_rwlock.h
    +++ b/include/arch/os2/thread_rwlock.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/threadproc.h
    index d152a848444..f077366abdf 100644
    --- a/include/arch/os2/threadproc.h
    +++ b/include/arch/os2/threadproc.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/os390/dso.h b/include/arch/os390/dso.h
    index 618bb6821db..af5297d4caf 100644
    --- a/include/arch/os390/dso.h
    +++ b/include/arch/os390/dso.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/unix/dso.h b/include/arch/unix/dso.h
    index c1b14b3e004..cf47659cce7 100644
    --- a/include/arch/unix/dso.h
    +++ b/include/arch/unix/dso.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h
    index 60b91181e3f..de5a49faf1e 100644
    --- a/include/arch/unix/fileio.h
    +++ b/include/arch/unix/fileio.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/unix/global_mutex.h b/include/arch/unix/global_mutex.h
    index ffaa45d57f1..45e3e06225a 100644
    --- a/include/arch/unix/global_mutex.h
    +++ b/include/arch/unix/global_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/unix/inherit.h b/include/arch/unix/inherit.h
    index acf5f8c581f..babb255283d 100644
    --- a/include/arch/unix/inherit.h
    +++ b/include/arch/unix/inherit.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/unix/internal_time.h b/include/arch/unix/internal_time.h
    index a82383cf05f..a0541594e0c 100644
    --- a/include/arch/unix/internal_time.h
    +++ b/include/arch/unix/internal_time.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h
    index 05804781938..36b9d5c1600 100644
    --- a/include/arch/unix/misc.h
    +++ b/include/arch/unix/misc.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h
    index bc35872907e..9e95b9fd196 100644
    --- a/include/arch/unix/networkio.h
    +++ b/include/arch/unix/networkio.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/unix/proc_mutex.h b/include/arch/unix/proc_mutex.h
    index bc51247f4df..da76da2b86c 100644
    --- a/include/arch/unix/proc_mutex.h
    +++ b/include/arch/unix/proc_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/unix/shm.h b/include/arch/unix/shm.h
    index 66a50ca99e9..3a3764ecfd3 100644
    --- a/include/arch/unix/shm.h
    +++ b/include/arch/unix/shm.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/unix/thread_cond.h b/include/arch/unix/thread_cond.h
    index 59e7cf710f2..ce4f3ce9c7b 100644
    --- a/include/arch/unix/thread_cond.h
    +++ b/include/arch/unix/thread_cond.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/unix/thread_mutex.h b/include/arch/unix/thread_mutex.h
    index f834e803a47..20e72a7ce26 100644
    --- a/include/arch/unix/thread_mutex.h
    +++ b/include/arch/unix/thread_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/unix/thread_rwlock.h b/include/arch/unix/thread_rwlock.h
    index db50c529644..c19cd371053 100644
    --- a/include/arch/unix/thread_rwlock.h
    +++ b/include/arch/unix/thread_rwlock.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h
    index ad68f5f37bc..44edbdad559 100644
    --- a/include/arch/unix/threadproc.h
    +++ b/include/arch/unix/threadproc.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/win32/apr_dbg_win32_handles.h b/include/arch/win32/apr_dbg_win32_handles.h
    index 072a1d90759..fc6db561b26 100644
    --- a/include/arch/win32/apr_dbg_win32_handles.h
    +++ b/include/arch/win32/apr_dbg_win32_handles.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h
    index ac6150b39d7..aec05c4b4ed 100644
    --- a/include/arch/win32/apr_private.h
    +++ b/include/arch/win32/apr_private.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/win32/atime.h b/include/arch/win32/atime.h
    index 78d099ddead..67acd72572b 100644
    --- a/include/arch/win32/atime.h
    +++ b/include/arch/win32/atime.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/win32/dso.h b/include/arch/win32/dso.h
    index 909cb65bd8a..deece8bcdee 100644
    --- a/include/arch/win32/dso.h
    +++ b/include/arch/win32/dso.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h
    index ca4e91224fd..1e95221f8ca 100644
    --- a/include/arch/win32/fileio.h
    +++ b/include/arch/win32/fileio.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/win32/inherit.h b/include/arch/win32/inherit.h
    index 83744c1e352..4d0967bb1bd 100644
    --- a/include/arch/win32/inherit.h
    +++ b/include/arch/win32/inherit.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h
    index 3f1e49dfb82..5ce8de30eae 100644
    --- a/include/arch/win32/misc.h
    +++ b/include/arch/win32/misc.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h
    index 488e7617549..db7fb5b3d58 100644
    --- a/include/arch/win32/networkio.h
    +++ b/include/arch/win32/networkio.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/win32/proc_mutex.h b/include/arch/win32/proc_mutex.h
    index a7d80632a9e..259bac6e331 100644
    --- a/include/arch/win32/proc_mutex.h
    +++ b/include/arch/win32/proc_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/win32/thread_cond.h b/include/arch/win32/thread_cond.h
    index 667c5248be4..6f1f6fa070a 100644
    --- a/include/arch/win32/thread_cond.h
    +++ b/include/arch/win32/thread_cond.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/win32/thread_mutex.h b/include/arch/win32/thread_mutex.h
    index dd59be8cdcc..c8c38f59bfc 100644
    --- a/include/arch/win32/thread_mutex.h
    +++ b/include/arch/win32/thread_mutex.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/win32/thread_rwlock.h b/include/arch/win32/thread_rwlock.h
    index 62e3335ece3..50d0e6ce735 100644
    --- a/include/arch/win32/thread_rwlock.h
    +++ b/include/arch/win32/thread_rwlock.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/threadproc.h
    index 23c795a19f6..33f3fd28885 100644
    --- a/include/arch/win32/threadproc.h
    +++ b/include/arch/win32/threadproc.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/include/arch/win32/utf8.h b/include/arch/win32/utf8.h
    index 5000c893085..601d485be4e 100644
    --- a/include/arch/win32/utf8.h
    +++ b/include/arch/win32/utf8.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c
    index 4557714246e..25dc318b112 100644
    --- a/locks/beos/proc_mutex.c
    +++ b/locks/beos/proc_mutex.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c
    index a1102df83bf..fdb9a5a6557 100644
    --- a/locks/beos/thread_cond.c
    +++ b/locks/beos/thread_cond.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c
    index 0ffd305331b..414909b5d98 100644
    --- a/locks/beos/thread_mutex.c
    +++ b/locks/beos/thread_mutex.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/beos/thread_rwlock.c b/locks/beos/thread_rwlock.c
    index 48a60a44e91..651354a112a 100644
    --- a/locks/beos/thread_rwlock.c
    +++ b/locks/beos/thread_rwlock.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c
    index 6d4c9968fc8..3e610a6d6da 100644
    --- a/locks/netware/proc_mutex.c
    +++ b/locks/netware/proc_mutex.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c
    index 3701c44c542..190c9a39cea 100644
    --- a/locks/netware/thread_cond.c
    +++ b/locks/netware/thread_cond.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c
    index 1c892feb3d2..b4edf2efd7c 100644
    --- a/locks/netware/thread_mutex.c
    +++ b/locks/netware/thread_mutex.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/netware/thread_rwlock.c b/locks/netware/thread_rwlock.c
    index dd1aa9a0d80..3c2740278a5 100644
    --- a/locks/netware/thread_rwlock.c
    +++ b/locks/netware/thread_rwlock.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c
    index 54309c63a49..6dcba8359fc 100644
    --- a/locks/os2/proc_mutex.c
    +++ b/locks/os2/proc_mutex.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/os2/thread_cond.c b/locks/os2/thread_cond.c
    index 57126e578d3..16049867f96 100644
    --- a/locks/os2/thread_cond.c
    +++ b/locks/os2/thread_cond.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c
    index 24c514208a2..ef4afc9f0b5 100644
    --- a/locks/os2/thread_mutex.c
    +++ b/locks/os2/thread_mutex.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/os2/thread_rwlock.c b/locks/os2/thread_rwlock.c
    index bda0ccb9877..55a3fd69970 100644
    --- a/locks/os2/thread_rwlock.c
    +++ b/locks/os2/thread_rwlock.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c
    index 51f2ba54e68..02d4680022e 100644
    --- a/locks/unix/global_mutex.c
    +++ b/locks/unix/global_mutex.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c
    index 2c33c85d0a4..2f6327fa6d5 100644
    --- a/locks/unix/proc_mutex.c
    +++ b/locks/unix/proc_mutex.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c
    index 2b53ff8b505..bfbc43b7540 100644
    --- a/locks/unix/thread_cond.c
    +++ b/locks/unix/thread_cond.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c
    index 885fc83fd50..caef8b56a6f 100644
    --- a/locks/unix/thread_mutex.c
    +++ b/locks/unix/thread_mutex.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c
    index daa1ed607d2..74f4bb16ac9 100644
    --- a/locks/unix/thread_rwlock.c
    +++ b/locks/unix/thread_rwlock.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c
    index 8e25a01cec6..73b8a169c87 100644
    --- a/locks/win32/proc_mutex.c
    +++ b/locks/win32/proc_mutex.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c
    index ee7e9dda124..33b7ad1c750 100644
    --- a/locks/win32/thread_cond.c
    +++ b/locks/win32/thread_cond.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c
    index cf9981a66a6..cd39f386c1e 100644
    --- a/locks/win32/thread_mutex.c
    +++ b/locks/win32/thread_mutex.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c
    index 72ecbc0f585..60d8b8e61e4 100644
    --- a/locks/win32/thread_rwlock.c
    +++ b/locks/win32/thread_rwlock.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
    index d8276eab410..a18fb101244 100644
    --- a/memory/unix/apr_pools.c
    +++ b/memory/unix/apr_pools.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/netware/charset.c b/misc/netware/charset.c
    index 90c69731c94..d9f124a9813 100644
    --- a/misc/netware/charset.c
    +++ b/misc/netware/charset.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/netware/rand.c b/misc/netware/rand.c
    index 00ee5d619c1..5042e069cc2 100644
    --- a/misc/netware/rand.c
    +++ b/misc/netware/rand.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/netware/start.c b/misc/netware/start.c
    index fc12e21d49b..93337a8c198 100644
    --- a/misc/netware/start.c
    +++ b/misc/netware/start.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/os2/randbyte.c b/misc/os2/randbyte.c
    index 0102f96bf37..a584d8d342b 100644
    --- a/misc/os2/randbyte.c
    +++ b/misc/os2/randbyte.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/unix/charset.c b/misc/unix/charset.c
    index 404c9073eb9..96886485fee 100644
    --- a/misc/unix/charset.c
    +++ b/misc/unix/charset.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c
    index efdbdc6535d..30cafee5d8d 100644
    --- a/misc/unix/errorcodes.c
    +++ b/misc/unix/errorcodes.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c
    index 75d47857949..d2513c4209c 100644
    --- a/misc/unix/otherchild.c
    +++ b/misc/unix/otherchild.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/unix/rand.c b/misc/unix/rand.c
    index a8e0a400a7b..6b396fc061e 100644
    --- a/misc/unix/rand.c
    +++ b/misc/unix/rand.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/unix/start.c b/misc/unix/start.c
    index 63f15424cc2..f5f306cadc0 100644
    --- a/misc/unix/start.c
    +++ b/misc/unix/start.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/unix/version.c b/misc/unix/version.c
    index cac4dbc8bda..ffaee901c5e 100644
    --- a/misc/unix/version.c
    +++ b/misc/unix/version.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c
    index 3131fc11b54..ae64974f30c 100644
    --- a/misc/win32/apr_app.c
    +++ b/misc/win32/apr_app.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/win32/charset.c b/misc/win32/charset.c
    index 958d113c9d4..24fc27159b2 100644
    --- a/misc/win32/charset.c
    +++ b/misc/win32/charset.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/win32/internal.c b/misc/win32/internal.c
    index df34a867544..ee1d2c18e08 100644
    --- a/misc/win32/internal.c
    +++ b/misc/win32/internal.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/win32/misc.c b/misc/win32/misc.c
    index 644e3c6f0e1..53e300ea8d1 100644
    --- a/misc/win32/misc.c
    +++ b/misc/win32/misc.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/win32/rand.c b/misc/win32/rand.c
    index 17108c770eb..f2eb0769837 100644
    --- a/misc/win32/rand.c
    +++ b/misc/win32/rand.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/win32/start.c b/misc/win32/start.c
    index df2ff70fe7b..2d26cf81d88 100644
    --- a/misc/win32/start.c
    +++ b/misc/win32/start.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/misc/win32/utf8.c b/misc/win32/utf8.c
    index a0aa83a8e95..ffa36c3dcad 100644
    --- a/misc/win32/utf8.c
    +++ b/misc/win32/utf8.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/mmap/unix/common.c b/mmap/unix/common.c
    index dd33fb628bd..8c3555c7e54 100644
    --- a/mmap/unix/common.c
    +++ b/mmap/unix/common.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c
    index 707702662fa..8b32791f3b0 100644
    --- a/mmap/unix/mmap.c
    +++ b/mmap/unix/mmap.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c
    index 4053ab868b1..ce21ea06172 100644
    --- a/mmap/win32/mmap.c
    +++ b/mmap/win32/mmap.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c
    index 19dc63d9043..c6808cc41f3 100644
    --- a/network_io/beos/sendrecv.c
    +++ b/network_io/beos/sendrecv.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/network_io/os2/os2calls.c b/network_io/os2/os2calls.c
    index b2708e69b9f..da8f61b6288 100644
    --- a/network_io/os2/os2calls.c
    +++ b/network_io/os2/os2calls.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c
    index 6a28e9c52e3..ce0e65a0619 100644
    --- a/network_io/os2/sendrecv.c
    +++ b/network_io/os2/sendrecv.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c
    index f7ad58241ac..e04dfed2f5a 100644
    --- a/network_io/os2/sendrecv_udp.c
    +++ b/network_io/os2/sendrecv_udp.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c
    index 90eda2bd439..ed07e1adf98 100644
    --- a/network_io/os2/sockets.c
    +++ b/network_io/os2/sockets.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c
    index 0623e6ce73c..0af2e471f64 100644
    --- a/network_io/os2/sockopt.c
    +++ b/network_io/os2/sockopt.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c
    index ac6e197142c..e9056f8af4d 100644
    --- a/network_io/unix/sendrecv.c
    +++ b/network_io/unix/sendrecv.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
    index becff5c1faf..ca5b7c18a15 100644
    --- a/network_io/unix/sockaddr.c
    +++ b/network_io/unix/sockaddr.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c
    index 2dc1bcd1479..a41e7675415 100644
    --- a/network_io/unix/sockets.c
    +++ b/network_io/unix/sockets.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c
    index 86f7db8dc6a..47d71fb7fbe 100644
    --- a/network_io/unix/sockopt.c
    +++ b/network_io/unix/sockopt.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c
    index 17bc3988f26..dceb5a8fea6 100644
    --- a/network_io/win32/sendrecv.c
    +++ b/network_io/win32/sendrecv.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c
    index dfb0f40ca50..31cc17d967b 100644
    --- a/network_io/win32/sockets.c
    +++ b/network_io/win32/sockets.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c
    index a60e017431a..d734ea2f2aa 100644
    --- a/network_io/win32/sockopt.c
    +++ b/network_io/win32/sockopt.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c
    index 72c67775eaf..f0a4dc38793 100644
    --- a/passwd/apr_getpass.c
    +++ b/passwd/apr_getpass.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/poll/os2/poll.c b/poll/os2/poll.c
    index 02f53b19674..2e4136d18aa 100755
    --- a/poll/os2/poll.c
    +++ b/poll/os2/poll.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c
    index a9c5cf1ba0f..2245da9e722 100644
    --- a/poll/os2/pollset.c
    +++ b/poll/os2/pollset.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/poll/unix/poll.c b/poll/unix/poll.c
    index b0c215b71ec..6241a4c61ad 100644
    --- a/poll/unix/poll.c
    +++ b/poll/unix/poll.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/poll/unix/pollacc.c b/poll/unix/pollacc.c
    index 440273e610c..d62d76e7286 100644
    --- a/poll/unix/pollacc.c
    +++ b/poll/unix/pollacc.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c
    index 2622a282b7c..ca2d680ed4b 100644
    --- a/shmem/beos/shm.c
    +++ b/shmem/beos/shm.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c
    index 27f5113ef5b..b559132ca28 100644
    --- a/shmem/os2/shm.c
    +++ b/shmem/os2/shm.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c
    index be5f3359c22..740c4e682be 100644
    --- a/shmem/unix/shm.c
    +++ b/shmem/unix/shm.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c
    index 8de8b7eb361..9fc5151b6e5 100644
    --- a/shmem/win32/shm.c
    +++ b/shmem/win32/shm.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c
    index e9e9575ac86..90acf366629 100644
    --- a/strings/apr_cpystrn.c
    +++ b/strings/apr_cpystrn.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c
    index af69625d4e6..191503c3c54 100644
    --- a/strings/apr_snprintf.c
    +++ b/strings/apr_snprintf.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/strings/apr_strings.c b/strings/apr_strings.c
    index 93b8b9305ed..70e29ca945c 100644
    --- a/strings/apr_strings.c
    +++ b/strings/apr_strings.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/strings/apr_strtok.c b/strings/apr_strtok.c
    index aa398656ccc..1646e7a9f9c 100644
    --- a/strings/apr_strtok.c
    +++ b/strings/apr_strtok.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/support/unix/waitio.c b/support/unix/waitio.c
    index cdc0ee10de3..716db0d709c 100644
    --- a/support/unix/waitio.c
    +++ b/support/unix/waitio.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/tables/apr_hash.c b/tables/apr_hash.c
    index 0db19ecb43e..0898648e81d 100644
    --- a/tables/apr_hash.c
    +++ b/tables/apr_hash.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/tables/apr_tables.c b/tables/apr_tables.c
    index 4bc8c35aa50..f5108b0d0ec 100644
    --- a/tables/apr_tables.c
    +++ b/tables/apr_tables.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/aprtest.h b/test/aprtest.h
    index 4e565fcd199..16374ea8059 100644
    --- a/test/aprtest.h
    +++ b/test/aprtest.h
    @@ -1,7 +1,7 @@
      /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/client.c b/test/client.c
    index cf42c50b7d5..ff85bb756c8 100644
    --- a/test/client.c
    +++ b/test/client.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/internal/testregex.c b/test/internal/testregex.c
    index 1a8374e9b3e..2efdd28517b 100644
    --- a/test/internal/testregex.c
    +++ b/test/internal/testregex.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/internal/testucs.c b/test/internal/testucs.c
    index 809fafffc38..a09dabf76fa 100644
    --- a/test/internal/testucs.c
    +++ b/test/internal/testucs.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/mod_test.c b/test/mod_test.c
    index 2069214dffb..7e05f157ebe 100644
    --- a/test/mod_test.c
    +++ b/test/mod_test.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/sendfile.c b/test/sendfile.c
    index f339f72a2f7..758a527e5a0 100644
    --- a/test/sendfile.c
    +++ b/test/sendfile.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/server.c b/test/server.c
    index ff974cdea8e..da20d259860 100644
    --- a/test/server.c
    +++ b/test/server.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/test_apr.h b/test/test_apr.h
    index d205aba36a1..9c51256cfbf 100644
    --- a/test/test_apr.h
    +++ b/test/test_apr.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testall.c b/test/testall.c
    index b3aba464bd0..b9ea4e5644c 100644
    --- a/test/testall.c
    +++ b/test/testall.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testargs.c b/test/testargs.c
    index 34915fdc088..e266dd0b8b6 100644
    --- a/test/testargs.c
    +++ b/test/testargs.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testatomic.c b/test/testatomic.c
    index 0b20179a4fc..bed3d93f810 100644
    --- a/test/testatomic.c
    +++ b/test/testatomic.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testdir.c b/test/testdir.c
    index 1df7eb232d3..3791d56ebec 100644
    --- a/test/testdir.c
    +++ b/test/testdir.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testdso.c b/test/testdso.c
    index 75deef2df90..ed0b2d4d0c6 100644
    --- a/test/testdso.c
    +++ b/test/testdso.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testdup.c b/test/testdup.c
    index ef36f2c9dec..4d9895257db 100644
    --- a/test/testdup.c
    +++ b/test/testdup.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testfile.c b/test/testfile.c
    index 6fa6dbf730a..8e2f9ae2910 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testfileinfo.c b/test/testfileinfo.c
    index bb41083de54..501d0df4f44 100644
    --- a/test/testfileinfo.c
    +++ b/test/testfileinfo.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testflock.c b/test/testflock.c
    index b1d0aa4fd47..898e7dc3a36 100644
    --- a/test/testflock.c
    +++ b/test/testflock.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testfmt.c b/test/testfmt.c
    index 236fa75dbd6..aaa63529c18 100644
    --- a/test/testfmt.c
    +++ b/test/testfmt.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c
    index 53681f9b16b..32f9f8acad4 100644
    --- a/test/testglobalmutex.c
    +++ b/test/testglobalmutex.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testhash.c b/test/testhash.c
    index dc59188f9ae..8f881341793 100644
    --- a/test/testhash.c
    +++ b/test/testhash.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testipsub.c b/test/testipsub.c
    index e4cf7f8c8ad..39712a62649 100644
    --- a/test/testipsub.c
    +++ b/test/testipsub.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testlock.c b/test/testlock.c
    index 1b5b8f8de81..cc4df3a20cb 100644
    --- a/test/testlock.c
    +++ b/test/testlock.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testlockperf.c b/test/testlockperf.c
    index 428b91e29f0..911c94eb20d 100644
    --- a/test/testlockperf.c
    +++ b/test/testlockperf.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testmmap.c b/test/testmmap.c
    index 495ea7c5aba..17cba96b4c6 100644
    --- a/test/testmmap.c
    +++ b/test/testmmap.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testmutexscope.c b/test/testmutexscope.c
    index 1893302f700..5aaa37af082 100644
    --- a/test/testmutexscope.c
    +++ b/test/testmutexscope.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testnames.c b/test/testnames.c
    index 3c07d4b8129..e17055452da 100644
    --- a/test/testnames.c
    +++ b/test/testnames.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testoc.c b/test/testoc.c
    index 92b7b9fe82c..0aba965bdea 100644
    --- a/test/testoc.c
    +++ b/test/testoc.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testpipe.c b/test/testpipe.c
    index d1eaf6096d5..14df56e01cc 100644
    --- a/test/testpipe.c
    +++ b/test/testpipe.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testpoll.c b/test/testpoll.c
    index b8d8c5b100b..2231dca6749 100644
    --- a/test/testpoll.c
    +++ b/test/testpoll.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testpools.c b/test/testpools.c
    index 01347673801..cdfa6286a3c 100644
    --- a/test/testpools.c
    +++ b/test/testpools.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testproc.c b/test/testproc.c
    index cdc538e2ece..3da9acd13ab 100644
    --- a/test/testproc.c
    +++ b/test/testproc.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testprocmutex.c b/test/testprocmutex.c
    index 2f98d2618a8..fe8067c0484 100644
    --- a/test/testprocmutex.c
    +++ b/test/testprocmutex.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testrand.c b/test/testrand.c
    index b323be159e5..5d614791897 100644
    --- a/test/testrand.c
    +++ b/test/testrand.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testshm.c b/test/testshm.c
    index bde95edb69b..50c304d8710 100644
    --- a/test/testshm.c
    +++ b/test/testshm.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testshmconsumer.c b/test/testshmconsumer.c
    index 673516624e1..f734cede83b 100644
    --- a/test/testshmconsumer.c
    +++ b/test/testshmconsumer.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testshmproducer.c b/test/testshmproducer.c
    index dde0d2e84c8..33b05813d21 100644
    --- a/test/testshmproducer.c
    +++ b/test/testshmproducer.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testsleep.c b/test/testsleep.c
    index 8be3d4d1154..d2a3f7ca306 100644
    --- a/test/testsleep.c
    +++ b/test/testsleep.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testsock.c b/test/testsock.c
    index 430b2f8f3ca..d9ec30499ae 100644
    --- a/test/testsock.c
    +++ b/test/testsock.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testsockets.c b/test/testsockets.c
    index 833aa58df67..2afa0ace7d0 100644
    --- a/test/testsockets.c
    +++ b/test/testsockets.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testsockopt.c b/test/testsockopt.c
    index 3cf08d729b1..18ace7fc96a 100644
    --- a/test/testsockopt.c
    +++ b/test/testsockopt.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/teststr.c b/test/teststr.c
    index 668e434f6ba..c92af8ff8c1 100644
    --- a/test/teststr.c
    +++ b/test/teststr.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testtable.c b/test/testtable.c
    index 9b6a59343e3..7fc1399a9f1 100644
    --- a/test/testtable.c
    +++ b/test/testtable.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testthread.c b/test/testthread.c
    index 5b8e2151a09..ecc9f476aa8 100644
    --- a/test/testthread.c
    +++ b/test/testthread.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testtime.c b/test/testtime.c
    index c298da8db38..41741081789 100644
    --- a/test/testtime.c
    +++ b/test/testtime.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testud.c b/test/testud.c
    index 4847c947650..3fd86d534e0 100644
    --- a/test/testud.c
    +++ b/test/testud.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testuser.c b/test/testuser.c
    index aa052100cc1..62d6ffb017e 100644
    --- a/test/testuser.c
    +++ b/test/testuser.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/test/testvsn.c b/test/testvsn.c
    index 6b152981f84..69854a58767 100644
    --- a/test/testvsn.c
    +++ b/test/testvsn.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/beos/apr_proc_stub.c b/threadproc/beos/apr_proc_stub.c
    index 7ba9712cb4e..b08dcc456a3 100644
    --- a/threadproc/beos/apr_proc_stub.c
    +++ b/threadproc/beos/apr_proc_stub.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c
    index 80d554892a5..3b162a9804f 100644
    --- a/threadproc/beos/proc.c
    +++ b/threadproc/beos/proc.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c
    index 12a83a29687..37d8516901f 100644
    --- a/threadproc/beos/thread.c
    +++ b/threadproc/beos/thread.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c
    index 60333868af2..ed1ea3e193c 100644
    --- a/threadproc/beos/threadpriv.c
    +++ b/threadproc/beos/threadpriv.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/beos/threadproc_common.c b/threadproc/beos/threadproc_common.c
    index df31d89b6f9..f6980fafdcf 100644
    --- a/threadproc/beos/threadproc_common.c
    +++ b/threadproc/beos/threadproc_common.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c
    index c9e6e969291..c0df971c92c 100644
    --- a/threadproc/netware/proc.c
    +++ b/threadproc/netware/proc.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/netware/procsup.c b/threadproc/netware/procsup.c
    index d894fcc9581..dce6d6305fc 100644
    --- a/threadproc/netware/procsup.c
    +++ b/threadproc/netware/procsup.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c
    index fb22ed5b44b..03b8d620b21 100644
    --- a/threadproc/netware/signals.c
    +++ b/threadproc/netware/signals.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c
    index 4856e6397b4..829639b4251 100644
    --- a/threadproc/netware/thread.c
    +++ b/threadproc/netware/thread.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/netware/threadpriv.c b/threadproc/netware/threadpriv.c
    index d5ff659ce1a..10851afe4da 100644
    --- a/threadproc/netware/threadpriv.c
    +++ b/threadproc/netware/threadpriv.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c
    index 1ef853dbd4d..b0e4dc15f24 100644
    --- a/threadproc/os2/proc.c
    +++ b/threadproc/os2/proc.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c
    index b0e1fe086a2..4dc5d470630 100644
    --- a/threadproc/os2/thread.c
    +++ b/threadproc/os2/thread.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c
    index 685268f9fe8..8fe99032e5b 100644
    --- a/threadproc/os2/threadpriv.c
    +++ b/threadproc/os2/threadpriv.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
    index f2b94349583..d534171cffe 100644
    --- a/threadproc/unix/proc.c
    +++ b/threadproc/unix/proc.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c
    index 50aa5075b3d..d0a5df28bc3 100644
    --- a/threadproc/unix/procsup.c
    +++ b/threadproc/unix/procsup.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c
    index fa4867b9b40..c31e3013173 100644
    --- a/threadproc/unix/signals.c
    +++ b/threadproc/unix/signals.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c
    index 693396d9954..8852c3be63f 100644
    --- a/threadproc/unix/thread.c
    +++ b/threadproc/unix/thread.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c
    index e1d9287017d..af693477d68 100644
    --- a/threadproc/unix/threadpriv.c
    +++ b/threadproc/unix/threadpriv.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c
    index 1c4dd5685bb..5020c456765 100644
    --- a/threadproc/win32/proc.c
    +++ b/threadproc/win32/proc.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c
    index 779de33f5f4..361413e4fb6 100644
    --- a/threadproc/win32/signals.c
    +++ b/threadproc/win32/signals.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c
    index 4293b1829c4..c0606afd257 100644
    --- a/threadproc/win32/thread.c
    +++ b/threadproc/win32/thread.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c
    index 9d9a88a3700..d016657f6fc 100644
    --- a/threadproc/win32/threadpriv.c
    +++ b/threadproc/win32/threadpriv.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/time/unix/time.c b/time/unix/time.c
    index 409cc2d1533..48956096f82 100644
    --- a/time/unix/time.c
    +++ b/time/unix/time.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/time/unix/timestr.c b/time/unix/timestr.c
    index a3ff324c984..1d7cd1b1324 100644
    --- a/time/unix/timestr.c
    +++ b/time/unix/timestr.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/time/win32/access.c b/time/win32/access.c
    index 043db594854..168a06d7304 100644
    --- a/time/win32/access.c
    +++ b/time/win32/access.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/time/win32/time.c b/time/win32/time.c
    index b79602955ef..bb888b865f8 100644
    --- a/time/win32/time.c
    +++ b/time/win32/time.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/time/win32/timestr.c b/time/win32/timestr.c
    index 38c53e76dcd..9e8d4debdbd 100644
    --- a/time/win32/timestr.c
    +++ b/time/win32/timestr.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/user/netware/groupinfo.c b/user/netware/groupinfo.c
    index 46002c266ed..aac076ed54e 100644
    --- a/user/netware/groupinfo.c
    +++ b/user/netware/groupinfo.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/user/netware/userinfo.c b/user/netware/userinfo.c
    index a31fbe17f9b..63654f3ac53 100644
    --- a/user/netware/userinfo.c
    +++ b/user/netware/userinfo.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c
    index e0ba9aa90c1..852cc18e2cf 100644
    --- a/user/unix/groupinfo.c
    +++ b/user/unix/groupinfo.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c
    index a268f521b9e..1443fb27d76 100644
    --- a/user/unix/userinfo.c
    +++ b/user/unix/userinfo.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c
    index 9d35855d7a8..dcddceacc6f 100644
    --- a/user/win32/groupinfo.c
    +++ b/user/win32/groupinfo.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c
    index eb8e5bead2c..05faf32557c 100644
    --- a/user/win32/userinfo.c
    +++ b/user/win32/userinfo.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    
    From ac25467c557063140ba33341ec5d5b11a8e2d5bc Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Thu, 2 Jan 2003 09:33:15 +0000
    Subject: [PATCH 4233/7878] OS/2: Fill in finfo->fname, was being left
     uninitialized. This gets File Info test to pass.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64252 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/os2/filestat.c | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c
    index 1214aff146a..274d369709a 100644
    --- a/file_io/os2/filestat.c
    +++ b/file_io/os2/filestat.c
    @@ -137,6 +137,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want
     
         if (rc == 0) {
             FS3_to_finfo(finfo, &fstatus);
    +        finfo->fname = thefile->fname;
     
             if (finfo->filetype == APR_REG) {
                 if (thefile->isopen) {
    @@ -171,6 +172,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
         
         if (rc == 0) {
             FS3_to_finfo(finfo, &fstatus);
    +        finfo->fname = fname;
     
             if (wanted & APR_FINFO_NAME) {
                 ULONG count = 1;
    
    From afb29976efb9a8adf07223ec57a394c6628ff4e2 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Thu, 2 Jan 2003 09:52:19 +0000
    Subject: [PATCH 4234/7878] OS/2: Return APR_TIMEUP from apr_file_read() when a
     pipe times out. Was returning the "no data" error code.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64253 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/os2/readwrite.c | 7 ++++++-
     1 file changed, 6 insertions(+), 1 deletion(-)
    
    diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c
    index 678c82f31cb..4644bf72865 100644
    --- a/file_io/os2/readwrite.c
    +++ b/file_io/os2/readwrite.c
    @@ -127,8 +127,13 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size
             if (rc == ERROR_NO_DATA && thefile->timeout != 0) {
                 int rcwait = DosWaitEventSem(thefile->pipeSem, thefile->timeout >= 0 ? thefile->timeout / 1000 : SEM_INDEFINITE_WAIT);
     
    -            if (rcwait == 0)
    +            if (rcwait == 0) {
                     rc = DosRead(thefile->filedes, buf, *nbytes, &bytesread);
    +            }
    +            else if (rcwait == ERROR_TIMEOUT) {
    +                *nbytes = 0;
    +                return APR_TIMEUP;
    +            }
             }
     
             if (rc) {
    
    From f570b897caf8c9c5b4a48a91bd8ac7029ee2dc72 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Thu, 2 Jan 2003 10:55:12 +0000
    Subject: [PATCH 4235/7878] OS/2 can return ERROR_ACCESS_DENIED when creating
     an already existing directory and attempting to delete a non-empty directory.
     Add it to appropriate test macros. This fixes a few directory tests.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64254 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 1b92207d9e2..2311ce3a58d 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -880,7 +880,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_EEXIST(s)         ((s) == APR_EEXIST \
                     || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \
                     || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \
    -                || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS)
    +                || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS \
    +                || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED)
     #define APR_STATUS_IS_ENAMETOOLONG(s)   ((s) == APR_ENAMETOOLONG \
                     || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \
                     || (s) == APR_OS_START_SYSERR + SOCENAMETOOLONG)
    @@ -932,7 +933,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_EXDEV(s)          ((s) == APR_EXDEV \
                     || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE)
     #define APR_STATUS_IS_ENOTEMPTY(s)      ((s) == APR_ENOTEMPTY \
    -                || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY)
    +                || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY \
    +                || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED)
     
     /*
         Sorry, too tired to wrap this up for OS2... feel free to
    
    From 2d20360e8e7ec1858fe69710d6bd7f4362b8dc22 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 2 Jan 2003 13:54:47 +0000
    Subject: [PATCH 4236/7878] fix the type of an integer constant, which with xlc
     will remove a warning and get 6 more time tests to work
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64255 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testtime.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/testtime.c b/test/testtime.c
    index 41741081789..787d1cca9fb 100644
    --- a/test/testtime.c
    +++ b/test/testtime.c
    @@ -68,7 +68,7 @@
      *           2002-08-14 12:05:36.186711 -25200 [257 Sat].
      * Which happens to be when I wrote the new tests.
      */
    -static apr_time_t now = 1032030336186711;
    +static apr_time_t now = 1032030336186711LL;
     
     static char* print_time (apr_pool_t *pool, const apr_time_exp_t *xt)
     {
    
    From 083ce6bf3e1001d867a913e9a7deee542e23813f Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 2 Jan 2003 14:05:42 +0000
    Subject: [PATCH 4237/7878] don't test whether or not the OS will let us open a
     directory as a regular file...  that isn't controlled by APR and on some
     platforms it will actually work
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64256 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfile.c | 14 --------------
     1 file changed, 14 deletions(-)
    
    diff --git a/test/testfile.c b/test/testfile.c
    index 8e2f9ae2910..318b5c532f9 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -83,19 +83,6 @@ static void test_open_noreadwrite(CuTest *tc)
         CuAssertPtrEquals(tc, NULL, thefile); 
     }
     
    -static void test_open_dir_read(CuTest *tc)
    -{
    -    apr_status_t rv;
    -    apr_file_t *thedir = NULL;
    -
    -    rv = apr_file_open(&thedir, DIRNAME, 
    -                       APR_READ, 
    -                       APR_UREAD | APR_UWRITE | APR_GREAD, p);
    -    CuAssertTrue(tc, rv != APR_SUCCESS);
    -    CuAssertIntEquals(tc, 1, APR_STATUS_IS_EACCES(rv));
    -    CuAssertPtrEquals(tc, NULL, thedir);
    -}
    -
     static void test_open_excl(CuTest *tc)
     {
         apr_status_t rv;
    @@ -518,7 +505,6 @@ CuSuite *testfile(void)
         CuSuite *suite = CuSuiteNew("File I/O");
     
         SUITE_ADD_TEST(suite, test_open_noreadwrite);
    -    SUITE_ADD_TEST(suite, test_open_dir_read);
         SUITE_ADD_TEST(suite, test_open_excl);
         SUITE_ADD_TEST(suite, test_open_read);
         SUITE_ADD_TEST(suite, test_open_readwrite);
    
    From 9c4827200b1ce605b6717c2ba7d1535d92d0bd72 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 2 Jan 2003 14:13:46 +0000
    Subject: [PATCH 4238/7878] fix the name of the test module on AIX
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64257 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testdso.c | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/test/testdso.c b/test/testdso.c
    index ed0b2d4d0c6..26768ff5991 100644
    --- a/test/testdso.c
    +++ b/test/testdso.c
    @@ -74,6 +74,9 @@
     #elif defined(__hpux__)
     # define MOD_NAME ".libs/mod_test.sl"
     # define LIB_NAME ".libs/libmod_test.sl"
    +#elif defined(_AIX)
    +# define MOD_NAME ".libs/libmod_test.so"
    +# define LIB_NAME ".libs/libmod_test.so"
     #else /* Every other Unix */
     # define MOD_NAME ".libs/mod_test.so"
     # define LIB_NAME ".libs/libmod_test.so"
    
    From 5a8a6d039b552684aa403577813c8030b0f93581 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 2 Jan 2003 17:51:49 +0000
    Subject: [PATCH 4239/7878]   LL isn't portable c... we created APR_INT64_C for
     this purpose.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64258 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testtime.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/testtime.c b/test/testtime.c
    index 787d1cca9fb..4c73b51bb75 100644
    --- a/test/testtime.c
    +++ b/test/testtime.c
    @@ -68,7 +68,7 @@
      *           2002-08-14 12:05:36.186711 -25200 [257 Sat].
      * Which happens to be when I wrote the new tests.
      */
    -static apr_time_t now = 1032030336186711LL;
    +static apr_time_t now = APR_INT64_C(1032030336186711);
     
     static char* print_time (apr_pool_t *pool, const apr_time_exp_t *xt)
     {
    
    From 69a7c346ba36a85320ebdf8bcf82101e1bf67890 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Thu, 2 Jan 2003 23:11:35 +0000
    Subject: [PATCH 4240/7878] Change to the correct 64-bit format string.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64259 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr.hnw | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr.hnw b/include/apr.hnw
    index 77242dc34fa..9d6e47a4f14 100644
    --- a/include/apr.hnw
    +++ b/include/apr.hnw
    @@ -340,7 +340,7 @@ typedef int apr_wait_t;
     
     #define APR_PATH_MAX PATH_MAX
     
    -#define APR_INT64_T_FMT          "l64d"
    +#define APR_INT64_T_FMT          "lld"
     #define APR_TIME_T_FMT APR_INT64_T_FMT
     
     /* Deal with atoi64 variables ... these should move to apr_private.h */
    
    From 6495d9bb22fbeb7debfe7f372a3ee20c95be8a1c Mon Sep 17 00:00:00 2001
    From: Branko Cibej 
    Date: Fri, 3 Jan 2003 09:05:28 +0000
    Subject: [PATCH 4241/7878] Added a new function, apr_filepath_encoding, to
     determine the character encoding used internally by the file_io and file_info
     functions. In most cases, the encoding is locale-dependent; on Windows,
     though, it's usually (but not always!) UTF-8.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64260 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                  |  3 +++
     file_io/unix/filepath.c  |  7 +++++++
     file_io/win32/filepath.c | 15 +++++++++++++++
     include/apr_file_info.h  | 26 ++++++++++++++++++++++++++
     4 files changed, 51 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index 5fa81bdbee3..7aa5afa78f0 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,8 @@
     Changes with APR 0.9.2
     
    +  *) Add function apr_filepath_encoding and associated constants.
    +     [Branko Cibej]
    +
       *) Allow apr_hash to have greater than int number of elements.
          [Justin Erenkrantz]
     
    diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c
    index a6154a4a0f5..004146adf84 100644
    --- a/file_io/unix/filepath.c
    +++ b/file_io/unix/filepath.c
    @@ -324,3 +324,10 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath,
         *newpath = path;
         return APR_SUCCESS;
     }
    +
    +
    +APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p)
    +{
    +    *style = APR_FILEPATH_ENCODING_LOCALE;
    +    return APR_SUCCESS;
    +}
    diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c
    index dc9ccadf4f1..184026f3a20 100644
    --- a/file_io/win32/filepath.c
    +++ b/file_io/win32/filepath.c
    @@ -977,3 +977,18 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath,
         (*newpath)[pathlen] = '\0';
         return APR_SUCCESS;
     }
    +
    +
    +APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p)
    +{
    +#if APR_HAS_UNICODE_FS
    +    IF_WIN_OS_IS_UNICODE
    +    {
    +        *style = APR_FILEPATH_ENCODING_UTF8;
    +        return APR_SUCCESS;
    +    }
    +#endif
    +
    +    *style = APR_FILEPATH_ENCODING_LOCALE;
    +    return APR_SUCCESS;
    +}
    diff --git a/include/apr_file_info.h b/include/apr_file_info.h
    index 8751d6c8a1e..5b2ee8f75d1 100644
    --- a/include/apr_file_info.h
    +++ b/include/apr_file_info.h
    @@ -406,6 +406,32 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **path, apr_int32_t flags,
      */
     APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p);
     
    +/**
    + * @defgroup apr_filepath_encoding FilePath Character encoding
    + * @{
    + */
    +
    +/** The FilePath character encoding is unknown */
    +#define APR_FILEPATH_ENCODING_UNKNOWN  0
    +
    +/** The FilePath character encoding is locale-dependent */
    +#define APR_FILEPATH_ENCODING_LOCALE   1
    +
    +/** The FilePath character encoding is UTF-8 */
    +#define APR_FILEPATH_ENCODING_UTF8     2
    +/** @} */
    +/**
    + * Determine the encoding used internally by the FilePath functions
    + * @ingroup apr_filepath_encoding
    + * @param style points to a variable which receives the encoding style flag
    + * @param p the pool to allocate any working storage
    + * @deffunc apr_status_t apr_filepath_encoding(int *style, apr_pool_t *p)
    + * @remark Use @c apr_os_locale_encoding and/or @c apr_os_default_encoding
    + * to get the name of the path encoding if it's not UTF-8.
    + */
    +APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p);
    +
    +
     /** @} */
     
     #ifdef __cplusplus
    
    From d5c52660a83e14c318a407c2b8cdeff4a77e69ed Mon Sep 17 00:00:00 2001
    From: Brian Pane 
    Date: Fri, 3 Jan 2003 17:06:07 +0000
    Subject: [PATCH 4242/7878] fix the clearing of the pollset in the select-based
     implementation
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64261 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/unix/poll.c | 5 ++---
     1 file changed, 2 insertions(+), 3 deletions(-)
    
    diff --git a/poll/unix/poll.c b/poll/unix/poll.c
    index 6241a4c61ad..899aa71ab07 100644
    --- a/poll/unix/poll.c
    +++ b/poll/unix/poll.c
    @@ -275,8 +275,8 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n
         }
     #endif
     
    -    for (i = 0; i < *nsds; i++) {
    -      aprset[i].rtnevents = 0;
    +    for (i = 0; i < num; i++) {
    +        aprset[i].rtnevents = 0;
         }
     
         (*nsds) = rv;
    @@ -303,7 +303,6 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n
             else {
                 break;
             }
    -        aprset[i].rtnevents = 0;
             if (FD_ISSET(fd, &readset)) {
                 aprset[i].rtnevents |= APR_POLLIN;
             }
    
    From ea20370f6cb5a408e4e8140f3178000b0aa5810c Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Fri, 3 Jan 2003 17:47:07 +0000
    Subject: [PATCH 4243/7878] Simplify select-based apr_poll to avoid an extra
     for loop and clear rtnevents whilst building the fd_set.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64262 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/unix/poll.c | 6 ++----
     1 file changed, 2 insertions(+), 4 deletions(-)
    
    diff --git a/poll/unix/poll.c b/poll/unix/poll.c
    index 899aa71ab07..a0aeaca3647 100644
    --- a/poll/unix/poll.c
    +++ b/poll/unix/poll.c
    @@ -217,6 +217,8 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n
         for (i = 0; i < num; i++) {
             apr_os_sock_t fd;
     
    +        aprset[i].rtnevents = 0;
    +
             if (aprset[i].desc_type == APR_POLL_SOCKET) {
     #ifdef NETWARE
                 if (HAS_PIPES(set_type)) {
    @@ -275,10 +277,6 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n
         }
     #endif
     
    -    for (i = 0; i < num; i++) {
    -        aprset[i].rtnevents = 0;
    -    }
    -
         (*nsds) = rv;
         if ((*nsds) == 0) {
             return APR_TIMEUP;
    
    From ba161aaca0decd6dd58ff0ea7debbc1fc4a94a61 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 3 Jan 2003 18:32:35 +0000
    Subject: [PATCH 4244/7878]   Need mo' targets
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64263 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.win | 14 +++++++++-----
     1 file changed, 9 insertions(+), 5 deletions(-)
    
    diff --git a/test/Makefile.win b/test/Makefile.win
    index 6c03343fb81..f2626da5c4b 100644
    --- a/test/Makefile.win
    +++ b/test/Makefile.win
    @@ -7,6 +7,11 @@ NONPORTABLE = \
     	testglobalmutex.exe
     
     PROGRAMS = \
    +	client.exe \
    +	sendfile.exe \
    +	server.exe \
    +	proc_child.exe \
    +	occhild.exe\
     	testflock.exe \
     	testsock.exe \
     	testlockperf.exe \
    @@ -18,14 +23,12 @@ PROGRAMS = \
     	mod_test.so
     
     
    -TARGETS = $(PROGRAMS) client.exe sendfile.exe \
    -	server.exe 
    +TARGETS = $(PROGRAMS)
     
     LOCAL_LIBS=..\LibD\apr.lib 
     ALL_LIBS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib
     
    -CLEAN_TARGETS = mod_test.slo proc_child.exe occhild.exe \
    -	        testprocmutex.exe testglobalmutex.exe testshm.exe
    +CLEAN_TARGETS = mod_test.lib mod_test.exp
     
     INCDIR=../include
     INCLUDES=/I "$(INCDIR)"
    @@ -45,7 +48,8 @@ occhild.exe: occhild.obj $(LOCAL_LIBS)
     	$(LINK) occhild.obj $(LOCAL_LIBS) $(ALL_LIBS)
     
     proc_child.exe: proc_child.obj $(LOCAL_LIBS)
    -	$(LINK) proc_child.obj $(LOCAL_LIBS) $(ALL_LIBS)
    +	$(LINK) /debug /subsystem:console /machine:I386 \
    +		proc_child.obj $(LOCAL_LIBS) $(ALL_LIBS)
     
     # FIXME: This is BS ... we should deal with namespace decoration within the
     # apr_dso_sym() function or within the test (take y'r pick) since many platforms
    
    From 7ad004a88ca152a9ea1e6fa310138056c46ba0f2 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 3 Jan 2003 18:32:54 +0000
    Subject: [PATCH 4245/7878]   Must ... have ... extensions
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64264 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testoc.c   | 13 +++++++++++--
     test/testproc.c |  2 +-
     2 files changed, 12 insertions(+), 3 deletions(-)
    
    diff --git a/test/testoc.c b/test/testoc.c
    index 0aba965bdea..e67240e1fc6 100644
    --- a/test/testoc.c
    +++ b/test/testoc.c
    @@ -61,6 +61,15 @@
     
     #if APR_HAS_OTHER_CHILD
     
    +/* XXX I'm sure there has to be a better way to do this ... */
    +#ifdef WIN32
    +#define EXTENSION ".exe"
    +#elif NETWARE
    +#define EXTENSION ".nlm"
    +#else
    +#define EXTENSION
    +#endif
    +
     static char reasonstr[256];
     
     static void ocmaint(int reason, void *data, int status)
    @@ -100,7 +109,7 @@ static void test_child_kill(CuTest *tc)
         const char *args[3];
         apr_status_t rv;
     
    -    args[0] = apr_pstrdup(p, "occhild");
    +    args[0] = apr_pstrdup(p, "occhild" EXTENSION);
         args[1] = apr_pstrdup(p, "-X");
         args[2] = NULL;
     
    @@ -111,7 +120,7 @@ static void test_child_kill(CuTest *tc)
                                  APR_NO_PIPE);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
    -    rv = apr_proc_create(&newproc, "./occhild", args, NULL, procattr, p);
    +    rv = apr_proc_create(&newproc, "./occhild" EXTENSION, args, NULL, procattr, p);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
         CuAssertPtrNotNull(tc, newproc.in);
         CuAssertPtrEquals(tc, NULL, newproc.out);
    diff --git a/test/testproc.c b/test/testproc.c
    index 3da9acd13ab..4bd22384520 100644
    --- a/test/testproc.c
    +++ b/test/testproc.c
    @@ -94,7 +94,7 @@ static void test_create_proc(CuTest *tc)
         rv = apr_procattr_cmdtype_set(attr, APR_PROGRAM);
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
     
    -    args[0] = "proc_child";
    +    args[0] = "proc_child" EXTENSION;
         args[1] = NULL;
         
         rv = apr_proc_create(&newproc, "../proc_child" EXTENSION, args, NULL, 
    
    From 1ae73d37b26286b13bc7512446af48729849fa62 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 3 Jan 2003 18:34:18 +0000
    Subject: [PATCH 4246/7878]   We don't have no stinkin ssize_t here.  We also
     needed io.h to compile clean
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64265 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/proc_child.c | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/test/proc_child.c b/test/proc_child.c
    index a4c16ebf373..405bb7f5b6c 100644
    --- a/test/proc_child.c
    +++ b/test/proc_child.c
    @@ -3,12 +3,15 @@
     #if APR_HAVE_UNISTD_H
     #include 
     #endif
    +#if APR_HAVE_IO_H
    +#include 
    +#endif
     #include 
     
     int main(void)
     {
         char buf[256];
    -    ssize_t bytes;
    +    apr_ssize_t bytes;
         
         bytes = read(STDIN_FILENO, buf, 256);
         if (bytes > 0)
    
    From 22b4dee54e79373137e9455cf1eee89ee419ea23 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 3 Jan 2003 19:14:13 +0000
    Subject: [PATCH 4247/7878]   This clears up the win32 testoc case... please
     review for accuracy   of the original intent of Unix's oc logic.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64266 13f79535-47bb-0310-9956-ffa450edef68
    ---
     misc/unix/otherchild.c | 22 ++++++++++++++++++----
     1 file changed, 18 insertions(+), 4 deletions(-)
    
    diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c
    index d2513c4209c..8d28bb3db13 100644
    --- a/misc/unix/otherchild.c
    +++ b/misc/unix/otherchild.c
    @@ -163,7 +163,7 @@ APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *pid, int status)
     APR_DECLARE(void) apr_proc_other_child_check(void)
     {
         apr_other_child_rec_t *ocr, *nocr;
    -    apr_status_t rv;
    +    DWORD status;
     
         /* Todo: 
          * Implement code to detect if a pipe is still alive on Windows.
    @@ -176,13 +176,27 @@ APR_DECLARE(void) apr_proc_other_child_check(void)
             if (ocr->proc == NULL)
                 continue;
     
    -        rv = WaitForSingleObject(ocr->proc->hproc, 0);
    -        if (rv != WAIT_TIMEOUT) {
    +        if (!ocr->proc->hproc) {
    +            /* Already mopped up, perhaps we apr_proc_kill'ed it */
    +            (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, -1);
    +        }
    +        else if (!GetExitCodeProcess(ocr->proc->hproc, &status)) {
    +            CloseHandle(ocr->proc->hproc);
    +            ocr->proc = NULL;
                 (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1);
             }
    +        else if (status == STILL_ACTIVE) {
    +            (*ocr->maintenance) (APR_OC_REASON_RESTART, ocr->data, -1);
    +        }
    +        else {
    +            CloseHandle(ocr->proc->hproc);
    +            ocr->proc->hproc = NULL;
    +            ocr->proc = NULL;
    +            (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status);
    +        }
         }
     }
    -#else /* Win32 */
    +#else /* ndef Win32 */
     APR_DECLARE(void) apr_proc_other_child_check(void)
     {
         apr_other_child_rec_t *ocr, *nocr;
    
    From 68b8c5387189a2101d09ae2d329e53cfe102aa09 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 3 Jan 2003 19:14:54 +0000
    Subject: [PATCH 4248/7878]   More VC dirt to sweep up after.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64267 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.win | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/Makefile.win b/test/Makefile.win
    index f2626da5c4b..f1ff0019057 100644
    --- a/test/Makefile.win
    +++ b/test/Makefile.win
    @@ -36,7 +36,7 @@ INCLUDES=/I "$(INCDIR)"
     all: $(TARGETS)
     
     clean:
    -	-del $(CLEAN_TARGETS) $(PROGRAMS) *.obj 2>NUL
    +	-del $(CLEAN_TARGETS) $(PROGRAMS) *.obj *.pdb *.ilk 2>NUL
     
     .c.obj:
     	cl /nologo /c /MDd /W3 /GX /Zi /Od /DWIN32 /D_DEBUG /D_WINDOWS /DAPR_DECLARE_STATIC $(INCLUDES) $<
    
    From ad767c30971d50b28486009def407f2721dd7778 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Sat, 4 Jan 2003 00:22:28 +0000
    Subject: [PATCH 4249/7878] OS/2: In apr_pollset_poll(), set the num value to 0
     on error or time out.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64268 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/os2/pollset.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c
    index 2245da9e722..c8fb6aaec96 100644
    --- a/poll/os2/pollset.c
    +++ b/poll/os2/pollset.c
    @@ -205,6 +205,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
     
         pollresult = alloca(sizeof(int) * pollset->num_total);
         memcpy(pollresult, pollset->pollset, sizeof(int) * pollset->num_total);
    +    (*num) = 0;
     
         if (timeout > 0) {
             timeout /= 1000;
    @@ -223,7 +224,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
         read_pos = 0;
         write_pos = pollset->num_read;
         except_pos = pollset->num_read + pollset->num_write;
    -    (*num) = 0;
     
         for (i = 0; i < pollset->nelts; i++) {
             int rtnevents = 0;
    
    From 6adc387ada19e9b4c2f6564671b9d6f5a888d562 Mon Sep 17 00:00:00 2001
    From: "Victor J. Orlikowski" 
    Date: Mon, 6 Jan 2003 19:04:08 +0000
    Subject: [PATCH 4250/7878] Minor addition to the debug flags under AIX.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64269 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/configure.in b/configure.in
    index e71ed39b74f..4e496f5b4e7 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -226,7 +226,7 @@ AC_ARG_ENABLE(maintainer-mode,[  --enable-maintainer-mode  Turn on debugging and
        if test "$GCC" = "yes"; then
          APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations])
        elif test "$AIX_XLC" = "yes"; then
    -     APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE)
    +     APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE -qwarn64 -qcheck=all)
        fi
     ])dnl
     
    
    From f735ad718b709912a6078c2373c4453ed2999ed6 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Mon, 6 Jan 2003 19:15:40 +0000
    Subject: [PATCH 4251/7878] NETWARE: Only use the path context from the stat
     cache if the request thread is running with the server identity.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64270 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/netware/filestat.c | 26 +++++++++++++++++---------
     file_io/unix/open.c        | 14 +++++++++++---
     2 files changed, 28 insertions(+), 12 deletions(-)
    
    diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c
    index b86213fc7cc..2b99fa8cfd9 100644
    --- a/file_io/netware/filestat.c
    +++ b/file_io/netware/filestat.c
    @@ -184,14 +184,13 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname,
         return apr_file_perms_set(fname, finfo.protection);
     }
     
    -int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *pool)
    +int cstat (NXPathCtx_t pathCtx, const char *path, struct stat *buf, char **casedName, apr_pool_t *pool)
     {
         apr_hash_t *statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor);
         apr_pool_t *gPool = (apr_pool_t *)getGlobalPool(CpuCurrentProcessor);
         apr_stat_entry_t *stat_entry;
         struct stat *info;
         apr_time_t now = apr_time_now();
    -    NXPathCtx_t pathCtx = 0;
         char *key;
         int ret;
         int found = 0;
    @@ -205,7 +204,6 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo
             char poolname[50];
     
             if (apr_pool_create(&gPool, NULL) != APR_SUCCESS) {
    -            getcwdpath(NULL, &pathCtx, CTX_ACTUAL_CWD);
                 ret = getstat(pathCtx, path, buf, ST_STAT_BITS|ST_NAME_BIT);
                 if (ret == 0) {
                     *casedName = apr_pstrdup (pool, buf->st_name);
    @@ -259,9 +257,7 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo
                     char *dirPath = NULL, *fname = NULL;
                     char *ptr;
                     int err, len;
    -                char pathbuf[256];
     
    -                getcwdpath(pathbuf, &pathCtx, CTX_ACTUAL_CWD);
                     ret = getstat(pathCtx, path, buf, ST_STAT_BITS|ST_NAME_BIT);
     
                     if (ret) {
    @@ -309,8 +305,6 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo
                                       ST_MODE_BIT|ST_ATIME_BIT|ST_MTIME_BIT|ST_CTIME_BIT|ST_SIZE_BIT|ST_NAME_BIT);
                     }
                     else {
    -                    char pathbuf[256];
    -                    getcwdpath(pathbuf, &pathCtx, CTX_ACTUAL_CWD);
                         ret = getstat(pathCtx, path, buf, 
                                       ST_MODE_BIT|ST_ATIME_BIT|ST_MTIME_BIT|ST_CTIME_BIT|ST_SIZE_BIT|ST_NAME_BIT);
                     }
    @@ -339,7 +333,6 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo
             }
         }
         else {
    -        getcwdpath(NULL, &pathCtx, CTX_ACTUAL_CWD);
             ret = getstat(pathCtx, path, buf, ST_STAT_BITS|ST_NAME_BIT);
             if (ret == 0) {
                 *casedName = apr_pstrdup(pool, buf->st_name);
    @@ -359,8 +352,23 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo,
         struct stat info;
         int srv;
         char *casedName = NULL;
    +    NXPathCtx_t pathCtx = 0;
    +    int identity;
    +    int ret;
    +
    +    getcwdpath(NULL, &pathCtx, CTX_ACTUAL_CWD);
    +    ret= get_identity (pathCtx, &identity);
     
    -    srv = cstat(fname, &info, &casedName, pool);
    +    if (ret || identity) {
    +        srv = getstat(pathCtx, fname, &info, ST_STAT_BITS|ST_NAME_BIT);
    +        if (srv == 0) {
    +            casedName = apr_pstrdup(pool, info.st_name);
    +        }
    +        errno = srv;
    +    }
    +    else {
    +        srv = cstat(pathCtx, fname, &info, &casedName, pool);
    +    }
     
         if (srv == 0) {
             finfo->pool = pool;
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index 8b93f7119c0..fb42e9e05cf 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -106,8 +106,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
     #endif
     
     #ifdef NETWARE
    -    apr_hash_t *statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor);
    +    apr_hash_t *statCache = NULL;
         apr_stat_entry_t *stat_entry = NULL;
    +    NXPathCtx_t pathCtx = 0;
    +    int identity;
     #endif
     
         if ((flag & APR_READ) && (flag & APR_WRITE)) {
    @@ -156,9 +158,15 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
     #endif
     
     #ifdef NETWARE
    -    if (statCache) {
    -        stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, fname, APR_HASH_KEY_STRING);
    +    if (!getcwdpath(NULL, &pathCtx, CTX_ACTUAL_CWD) &&
    +        !get_identity (pathCtx, &identity) && !identity) {
    +
    +        statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor);
    +        if (statCache) {
    +            stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, fname, APR_HASH_KEY_STRING);
    +        }
         }
    +
         if (stat_entry) {
             errno = NXFileOpen (stat_entry->pathCtx, stat_entry->casedName, oflags, &fd);
         }
    
    From 6acb43ed6a9d965eaf8e21a08e5b3919e755d08a Mon Sep 17 00:00:00 2001
    From: Thom May 
    Date: Mon, 6 Jan 2003 23:44:40 +0000
    Subject: [PATCH 4252/7878] Namespace protection for include/arch/ header files
     aix/dso.h -> -> aix/apr_arch_dso.h beos/dso.h -> beos/apr_arch_dso.h
     beos/proc_mutex.h -> beos/apr_arch_proc_mutex.h beos/thread_cond.h ->
     beos/apr_arch_thread_cond.h beos/thread_mutex.h ->
     beos/apr_arch_thread_mutex.h beos/threadproc.h -> beos/apr_arch_threadproc.h
     beos/thread_rwlock.h -> beos/apr_arch_thread_rwlock.h netware/dso.h -> ->
     netware/apr_arch_dso.h netware/fileio.h -> -> netware/apr_arch_fileio.h
     netware/global_mutex.h -> netware/apr_arch_global_mutex.h
     netware/internal_time.h -> netware/apr_arch_internal_time.h
     netware/networkio.h -> netware/apr_arch_networkio.h netware/pre_nw.h ->
     netware/apr_arch_pre_nw.h netware/proc_mutex.h ->
     netware/apr_arch_proc_mutex.h netware/thread_cond.h ->
     netware/apr_arch_thread_cond.h netware/thread_mutex.h ->
     netware/apr_arch_thread_mutex.h netware/threadproc.h ->
     netware/apr_arch_threadproc.h netware/thread_rwlock.h ->
     netware/apr_arch_thread_rwlock.h os2/dso.h -> os2/apr_arch_dso.h os2/fileio.h
     -> os2/apr_arch_fileio.h os2/networkio.h -> os2/apr_arch_networkio.h
     os2/os2calls.h -> os2/apr_arch_os2calls.h os2/proc_mutex.h ->
     os2/apr_arch_proc_mutex.h os2/thread_cond.h -> os2/apr_arch_thread_cond.h
     os2/thread_mutex.h -> os2/apr_arch_thread_mutex.h os2/threadproc.h ->
     os2/apr_arch_threadproc.h os2/thread_rwlock.h -> os2/apr_arch_thread_rwlock.h
     os390/dso.h -> os390/apr_arch_dso.h unix/dso.h -> unix/apr_arch_dso.h
     unix/fileio.h -> unix/apr_arch_fileio.h unix/global_mutex.h ->
     unix/apr_arch_global_mutex.h unix/inherit.h -> unix/apr_arch_inherit.h
     unix/internal_time.h -> unix/apr_arch_internal_time.h unix/misc.h ->
     unix/apr_arch_misc.h unix/networkio.h -> unix/apr_arch_networkio.h
     unix/proc_mutex.h -> unix/apr_arch_proc_mutex.h unix/shm.h ->
     unix/apr_arch_shm.h unix/thread_cond.h -> unix/apr_arch_thread_cond.h
     unix/thread_mutex.h -> unix/apr_arch_thread_mutex.h unix/threadproc.h ->
     unix/apr_arch_threadproc.h unix/thread_rwlock.h ->
     unix/apr_arch_thread_rwlock.h win32/atime.h -> win32/apr_arch_atime.h
     win32/dso.h -> win32/apr_arch_dso.h win32/fileio.h -> win32/apr_arch_fileio.h
     win32/inherit.h -> win32/apr_arch_inherit.h win32/misc.h ->
     win32/apr_arch_misc.h win32/networkio.h -> win32/apr_arch_networkio.h
     win32/proc_mutex.h -> win32/apr_arch_proc_mutex.h win32/thread_cond.h ->
     win32/apr_arch_thread_cond.h win32/thread_mutex.h ->
     win32/apr_arch_thread_mutex.h win32/threadproc.h ->
     win32/apr_arch_threadproc.h win32/thread_rwlock.h ->
     win32/apr_arch_thread_rwlock.h win32/utf8.h -> win32/apr_arch_utf8.h
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64271 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/NWGNUenvironment.inc                                  | 4 ++--
     dso/aix/dso.c                                               | 2 +-
     dso/beos/dso.c                                              | 2 +-
     dso/netware/dso.c                                           | 2 +-
     dso/os2/dso.c                                               | 2 +-
     dso/os390/dso.c                                             | 2 +-
     dso/unix/dso.c                                              | 2 +-
     dso/win32/dso.c                                             | 6 +++---
     file_io/netware/filestat.c                                  | 2 +-
     file_io/netware/filesys.c                                   | 2 +-
     file_io/netware/flock.c                                     | 2 +-
     file_io/netware/pipe.c                                      | 2 +-
     file_io/os2/dir.c                                           | 2 +-
     file_io/os2/filedup.c                                       | 4 ++--
     file_io/os2/filestat.c                                      | 2 +-
     file_io/os2/filesys.c                                       | 2 +-
     file_io/os2/flock.c                                         | 2 +-
     file_io/os2/maperrorcode.c                                  | 2 +-
     file_io/os2/open.c                                          | 4 ++--
     file_io/os2/pipe.c                                          | 2 +-
     file_io/os2/readwrite.c                                     | 2 +-
     file_io/os2/seek.c                                          | 2 +-
     file_io/unix/copy.c                                         | 2 +-
     file_io/unix/dir.c                                          | 2 +-
     file_io/unix/fileacc.c                                      | 2 +-
     file_io/unix/filedup.c                                      | 4 ++--
     file_io/unix/filepath.c                                     | 2 +-
     file_io/unix/filestat.c                                     | 2 +-
     file_io/unix/flock.c                                        | 2 +-
     file_io/unix/mktemp.c                                       | 2 +-
     file_io/unix/open.c                                         | 4 ++--
     file_io/unix/pipe.c                                         | 2 +-
     file_io/unix/readwrite.c                                    | 2 +-
     file_io/unix/seek.c                                         | 2 +-
     file_io/win32/dir.c                                         | 4 ++--
     file_io/win32/filedup.c                                     | 4 ++--
     file_io/win32/filepath.c                                    | 2 +-
     file_io/win32/filestat.c                                    | 6 +++---
     file_io/win32/filesys.c                                     | 2 +-
     file_io/win32/flock.c                                       | 2 +-
     file_io/win32/open.c                                        | 6 +++---
     file_io/win32/pipe.c                                        | 4 ++--
     file_io/win32/readwrite.c                                   | 6 +++---
     file_io/win32/seek.c                                        | 2 +-
     include/arch/aix/{dso.h => apr_arch_dso.h}                  | 0
     include/arch/beos/{dso.h => apr_arch_dso.h}                 | 0
     include/arch/beos/{proc_mutex.h => apr_arch_proc_mutex.h}   | 0
     include/arch/beos/{thread_cond.h => apr_arch_thread_cond.h} | 0
     .../arch/beos/{thread_mutex.h => apr_arch_thread_mutex.h}   | 0
     .../arch/beos/{thread_rwlock.h => apr_arch_thread_rwlock.h} | 0
     include/arch/beos/{threadproc.h => apr_arch_threadproc.h}   | 0
     include/arch/netware/{dso.h => apr_arch_dso.h}              | 0
     include/arch/netware/{fileio.h => apr_arch_fileio.h}        | 0
     .../netware/{global_mutex.h => apr_arch_global_mutex.h}     | 0
     .../netware/{internal_time.h => apr_arch_internal_time.h}   | 0
     include/arch/netware/{networkio.h => apr_arch_networkio.h}  | 0
     include/arch/netware/{pre_nw.h => apr_arch_pre_nw.h}        | 0
     .../arch/netware/{proc_mutex.h => apr_arch_proc_mutex.h}    | 0
     .../arch/netware/{thread_cond.h => apr_arch_thread_cond.h}  | 0
     .../netware/{thread_mutex.h => apr_arch_thread_mutex.h}     | 0
     .../netware/{thread_rwlock.h => apr_arch_thread_rwlock.h}   | 0
     .../arch/netware/{threadproc.h => apr_arch_threadproc.h}    | 0
     include/arch/os2/{dso.h => apr_arch_dso.h}                  | 0
     include/arch/os2/{fileio.h => apr_arch_fileio.h}            | 0
     include/arch/os2/{networkio.h => apr_arch_networkio.h}      | 0
     include/arch/os2/{os2calls.h => apr_arch_os2calls.h}        | 0
     include/arch/os2/{proc_mutex.h => apr_arch_proc_mutex.h}    | 0
     include/arch/os2/{thread_cond.h => apr_arch_thread_cond.h}  | 0
     .../arch/os2/{thread_mutex.h => apr_arch_thread_mutex.h}    | 0
     .../arch/os2/{thread_rwlock.h => apr_arch_thread_rwlock.h}  | 0
     include/arch/os2/{threadproc.h => apr_arch_threadproc.h}    | 0
     include/arch/os390/{dso.h => apr_arch_dso.h}                | 0
     include/arch/unix/{dso.h => apr_arch_dso.h}                 | 0
     include/arch/unix/{fileio.h => apr_arch_fileio.h}           | 0
     .../arch/unix/{global_mutex.h => apr_arch_global_mutex.h}   | 0
     include/arch/unix/{inherit.h => apr_arch_inherit.h}         | 0
     .../arch/unix/{internal_time.h => apr_arch_internal_time.h} | 0
     include/arch/unix/{misc.h => apr_arch_misc.h}               | 0
     include/arch/unix/{networkio.h => apr_arch_networkio.h}     | 0
     include/arch/unix/{proc_mutex.h => apr_arch_proc_mutex.h}   | 0
     include/arch/unix/{shm.h => apr_arch_shm.h}                 | 0
     include/arch/unix/{thread_cond.h => apr_arch_thread_cond.h} | 0
     .../arch/unix/{thread_mutex.h => apr_arch_thread_mutex.h}   | 0
     .../arch/unix/{thread_rwlock.h => apr_arch_thread_rwlock.h} | 0
     include/arch/unix/{threadproc.h => apr_arch_threadproc.h}   | 0
     include/arch/win32/{atime.h => apr_arch_atime.h}            | 0
     include/arch/win32/{dso.h => apr_arch_dso.h}                | 0
     include/arch/win32/{fileio.h => apr_arch_fileio.h}          | 0
     include/arch/win32/{inherit.h => apr_arch_inherit.h}        | 0
     include/arch/win32/{misc.h => apr_arch_misc.h}              | 0
     include/arch/win32/{networkio.h => apr_arch_networkio.h}    | 0
     include/arch/win32/{proc_mutex.h => apr_arch_proc_mutex.h}  | 0
     .../arch/win32/{thread_cond.h => apr_arch_thread_cond.h}    | 0
     .../arch/win32/{thread_mutex.h => apr_arch_thread_mutex.h}  | 0
     .../win32/{thread_rwlock.h => apr_arch_thread_rwlock.h}     | 0
     include/arch/win32/{threadproc.h => apr_arch_threadproc.h}  | 0
     include/arch/win32/{utf8.h => apr_arch_utf8.h}              | 0
     locks/beos/proc_mutex.c                                     | 2 +-
     locks/beos/thread_cond.c                                    | 4 ++--
     locks/beos/thread_mutex.c                                   | 2 +-
     locks/beos/thread_rwlock.c                                  | 2 +-
     locks/netware/proc_mutex.c                                  | 4 ++--
     locks/netware/thread_cond.c                                 | 4 ++--
     locks/netware/thread_mutex.c                                | 2 +-
     locks/netware/thread_rwlock.c                               | 2 +-
     locks/os2/proc_mutex.c                                      | 4 ++--
     locks/os2/thread_cond.c                                     | 6 +++---
     locks/os2/thread_mutex.c                                    | 4 ++--
     locks/os2/thread_rwlock.c                                   | 4 ++--
     locks/unix/global_mutex.c                                   | 2 +-
     locks/unix/proc_mutex.c                                     | 4 ++--
     locks/unix/thread_cond.c                                    | 4 ++--
     locks/unix/thread_mutex.c                                   | 2 +-
     locks/unix/thread_rwlock.c                                  | 2 +-
     locks/win32/proc_mutex.c                                    | 4 ++--
     locks/win32/thread_cond.c                                   | 4 ++--
     locks/win32/thread_mutex.c                                  | 4 ++--
     locks/win32/thread_rwlock.c                                 | 2 +-
     misc/netware/start.c                                        | 6 +++---
     misc/unix/errorcodes.c                                      | 2 +-
     misc/unix/getopt.c                                          | 2 +-
     misc/unix/otherchild.c                                      | 6 +++---
     misc/unix/rand.c                                            | 2 +-
     misc/unix/start.c                                           | 4 ++--
     misc/win32/apr_app.c                                        | 4 ++--
     misc/win32/internal.c                                       | 4 ++--
     misc/win32/misc.c                                           | 4 ++--
     misc/win32/rand.c                                           | 2 +-
     misc/win32/start.c                                          | 4 ++--
     misc/win32/utf8.c                                           | 2 +-
     mmap/unix/mmap.c                                            | 2 +-
     mmap/win32/mmap.c                                           | 2 +-
     network_io/beos/sendrecv.c                                  | 2 +-
     network_io/os2/os2calls.c                                   | 2 +-
     network_io/os2/sendrecv.c                                   | 2 +-
     network_io/os2/sendrecv_udp.c                               | 2 +-
     network_io/os2/sockets.c                                    | 6 +++---
     network_io/os2/sockopt.c                                    | 2 +-
     network_io/unix/inet_ntop.c                                 | 2 +-
     network_io/unix/inet_pton.c                                 | 2 +-
     network_io/unix/sendrecv.c                                  | 4 ++--
     network_io/unix/sockaddr.c                                  | 2 +-
     network_io/unix/sockets.c                                   | 4 ++--
     network_io/unix/sockopt.c                                   | 2 +-
     network_io/win32/sendrecv.c                                 | 4 ++--
     network_io/win32/sockets.c                                  | 6 +++---
     network_io/win32/sockopt.c                                  | 2 +-
     poll/os2/poll.c                                             | 2 +-
     poll/os2/pollset.c                                          | 2 +-
     poll/unix/poll.c                                            | 4 ++--
     poll/unix/pollacc.c                                         | 4 ++--
     shmem/unix/shm.c                                            | 2 +-
     shmem/win32/shm.c                                           | 2 +-
     support/unix/waitio.c                                       | 4 ++--
     test/internal/testucs.c                                     | 2 +-
     threadproc/beos/proc.c                                      | 2 +-
     threadproc/beos/thread.c                                    | 2 +-
     threadproc/beos/threadpriv.c                                | 2 +-
     threadproc/netware/proc.c                                   | 4 ++--
     threadproc/netware/procsup.c                                | 2 +-
     threadproc/netware/signals.c                                | 2 +-
     threadproc/netware/thread.c                                 | 2 +-
     threadproc/netware/threadpriv.c                             | 2 +-
     threadproc/os2/proc.c                                       | 4 ++--
     threadproc/os2/thread.c                                     | 4 ++--
     threadproc/os2/threadpriv.c                                 | 4 ++--
     threadproc/unix/proc.c                                      | 2 +-
     threadproc/unix/procsup.c                                   | 2 +-
     threadproc/unix/signals.c                                   | 2 +-
     threadproc/unix/thread.c                                    | 2 +-
     threadproc/unix/threadpriv.c                                | 2 +-
     threadproc/win32/proc.c                                     | 4 ++--
     threadproc/win32/signals.c                                  | 4 ++--
     threadproc/win32/thread.c                                   | 4 ++--
     threadproc/win32/threadpriv.c                               | 2 +-
     time/unix/time.c                                            | 2 +-
     time/win32/access.c                                         | 2 +-
     time/win32/time.c                                           | 4 ++--
     time/win32/timestr.c                                        | 2 +-
     user/win32/userinfo.c                                       | 2 +-
     180 files changed, 183 insertions(+), 183 deletions(-)
     rename include/arch/aix/{dso.h => apr_arch_dso.h} (100%)
     rename include/arch/beos/{dso.h => apr_arch_dso.h} (100%)
     rename include/arch/beos/{proc_mutex.h => apr_arch_proc_mutex.h} (100%)
     rename include/arch/beos/{thread_cond.h => apr_arch_thread_cond.h} (100%)
     rename include/arch/beos/{thread_mutex.h => apr_arch_thread_mutex.h} (100%)
     rename include/arch/beos/{thread_rwlock.h => apr_arch_thread_rwlock.h} (100%)
     rename include/arch/beos/{threadproc.h => apr_arch_threadproc.h} (100%)
     rename include/arch/netware/{dso.h => apr_arch_dso.h} (100%)
     rename include/arch/netware/{fileio.h => apr_arch_fileio.h} (100%)
     rename include/arch/netware/{global_mutex.h => apr_arch_global_mutex.h} (100%)
     rename include/arch/netware/{internal_time.h => apr_arch_internal_time.h} (100%)
     rename include/arch/netware/{networkio.h => apr_arch_networkio.h} (100%)
     rename include/arch/netware/{pre_nw.h => apr_arch_pre_nw.h} (100%)
     rename include/arch/netware/{proc_mutex.h => apr_arch_proc_mutex.h} (100%)
     rename include/arch/netware/{thread_cond.h => apr_arch_thread_cond.h} (100%)
     rename include/arch/netware/{thread_mutex.h => apr_arch_thread_mutex.h} (100%)
     rename include/arch/netware/{thread_rwlock.h => apr_arch_thread_rwlock.h} (100%)
     rename include/arch/netware/{threadproc.h => apr_arch_threadproc.h} (100%)
     rename include/arch/os2/{dso.h => apr_arch_dso.h} (100%)
     rename include/arch/os2/{fileio.h => apr_arch_fileio.h} (100%)
     rename include/arch/os2/{networkio.h => apr_arch_networkio.h} (100%)
     rename include/arch/os2/{os2calls.h => apr_arch_os2calls.h} (100%)
     rename include/arch/os2/{proc_mutex.h => apr_arch_proc_mutex.h} (100%)
     rename include/arch/os2/{thread_cond.h => apr_arch_thread_cond.h} (100%)
     rename include/arch/os2/{thread_mutex.h => apr_arch_thread_mutex.h} (100%)
     rename include/arch/os2/{thread_rwlock.h => apr_arch_thread_rwlock.h} (100%)
     rename include/arch/os2/{threadproc.h => apr_arch_threadproc.h} (100%)
     rename include/arch/os390/{dso.h => apr_arch_dso.h} (100%)
     rename include/arch/unix/{dso.h => apr_arch_dso.h} (100%)
     rename include/arch/unix/{fileio.h => apr_arch_fileio.h} (100%)
     rename include/arch/unix/{global_mutex.h => apr_arch_global_mutex.h} (100%)
     rename include/arch/unix/{inherit.h => apr_arch_inherit.h} (100%)
     rename include/arch/unix/{internal_time.h => apr_arch_internal_time.h} (100%)
     rename include/arch/unix/{misc.h => apr_arch_misc.h} (100%)
     rename include/arch/unix/{networkio.h => apr_arch_networkio.h} (100%)
     rename include/arch/unix/{proc_mutex.h => apr_arch_proc_mutex.h} (100%)
     rename include/arch/unix/{shm.h => apr_arch_shm.h} (100%)
     rename include/arch/unix/{thread_cond.h => apr_arch_thread_cond.h} (100%)
     rename include/arch/unix/{thread_mutex.h => apr_arch_thread_mutex.h} (100%)
     rename include/arch/unix/{thread_rwlock.h => apr_arch_thread_rwlock.h} (100%)
     rename include/arch/unix/{threadproc.h => apr_arch_threadproc.h} (100%)
     rename include/arch/win32/{atime.h => apr_arch_atime.h} (100%)
     rename include/arch/win32/{dso.h => apr_arch_dso.h} (100%)
     rename include/arch/win32/{fileio.h => apr_arch_fileio.h} (100%)
     rename include/arch/win32/{inherit.h => apr_arch_inherit.h} (100%)
     rename include/arch/win32/{misc.h => apr_arch_misc.h} (100%)
     rename include/arch/win32/{networkio.h => apr_arch_networkio.h} (100%)
     rename include/arch/win32/{proc_mutex.h => apr_arch_proc_mutex.h} (100%)
     rename include/arch/win32/{thread_cond.h => apr_arch_thread_cond.h} (100%)
     rename include/arch/win32/{thread_mutex.h => apr_arch_thread_mutex.h} (100%)
     rename include/arch/win32/{thread_rwlock.h => apr_arch_thread_rwlock.h} (100%)
     rename include/arch/win32/{threadproc.h => apr_arch_threadproc.h} (100%)
     rename include/arch/win32/{utf8.h => apr_arch_utf8.h} (100%)
    
    diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc
    index da4819a44bd..704e4da79e0 100644
    --- a/build/NWGNUenvironment.inc
    +++ b/build/NWGNUenvironment.inc
    @@ -152,9 +152,9 @@ ifeq "$(RELEASE)" "optimized"
     CFLAGS += -O4,p
     endif
     
    -# -prefix pre_nw.h      #include pre_nw.h for all files
    +# -prefix apr_arch_pre_nw.h      #include pre_nw.h for all files
     
    -CFLAGS += -prefix pre_nw.h
    +CFLAGS += -prefix apr_arch_pre_nw.h
     
     
     PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
    diff --git a/dso/aix/dso.c b/dso/aix/dso.c
    index 7520ee6f51c..713e6cbb21e 100644
    --- a/dso/aix/dso.c
    +++ b/dso/aix/dso.c
    @@ -87,7 +87,7 @@
     #include 
     #include 
     #include 
    -#include "dso.h"
    +#include "apr_arch_dso.h"
     #include "apr_portable.h"
     
     #if APR_HAS_DSO
    diff --git a/dso/beos/dso.c b/dso/beos/dso.c
    index d26ca4b052c..087ed42e8a0 100644
    --- a/dso/beos/dso.c
    +++ b/dso/beos/dso.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "beos/dso.h"
    +#include "beos/apr_arch_dso.h"
     #include "apr_portable.h"
     
     #if APR_HAS_DSO
    diff --git a/dso/netware/dso.c b/dso/netware/dso.c
    index 3ccca1abcfe..7fd3d27e07e 100644
    --- a/dso/netware/dso.c
    +++ b/dso/netware/dso.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "dso.h"
    +#include "apr_arch_dso.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/dso/os2/dso.c b/dso/os2/dso.c
    index 768a27e9b1d..813c0d23562 100644
    --- a/dso/os2/dso.c
    +++ b/dso/os2/dso.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "dso.h"
    +#include "apr_arch_dso.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     #include 
    diff --git a/dso/os390/dso.c b/dso/os390/dso.c
    index e580e2c2c3f..bce8a0df962 100644
    --- a/dso/os390/dso.c
    +++ b/dso/os390/dso.c
    @@ -54,7 +54,7 @@
     
     #include "apr_portable.h"
     #include "apr_strings.h"
    -#include "dso.h"
    +#include "apr_arch_dso.h"
     #include 
     #include 
     
    diff --git a/dso/unix/dso.c b/dso/unix/dso.c
    index 9f68e238027..69875f46ac9 100644
    --- a/dso/unix/dso.c
    +++ b/dso/unix/dso.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "dso.h"
    +#include "apr_arch_dso.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/dso/win32/dso.c b/dso/win32/dso.c
    index 22e5ff5de93..44a22012819 100644
    --- a/dso/win32/dso.c
    +++ b/dso/win32/dso.c
    @@ -52,11 +52,11 @@
      * .
      */
     
    -#include "dso.h"
    +#include "apr_arch_dso.h"
     #include "apr_strings.h"
     #include "apr_private.h"
    -#include "fileio.h"
    -#include "utf8.h"
    +#include "apr_arch_fileio.h"
    +#include "apr_arch_utf8.h"
     
     #if APR_HAS_DSO
     
    diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c
    index 2b99fa8cfd9..9b87573b204 100644
    --- a/file_io/netware/filestat.c
    +++ b/file_io/netware/filestat.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "fsio.h"
     #include "nks/dirio.h"
     #include "apr_file_io.h"
    diff --git a/file_io/netware/filesys.c b/file_io/netware/filesys.c
    index 195e7654c17..6be9110d69d 100644
    --- a/file_io/netware/filesys.c
    +++ b/file_io/netware/filesys.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_strings.h"
     
     apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p)
    diff --git a/file_io/netware/flock.c b/file_io/netware/flock.c
    index 69be365ebf1..8430dc7bb7c 100644
    --- a/file_io/netware/flock.c
    +++ b/file_io/netware/flock.c
    @@ -53,7 +53,7 @@
      */
     
     #include 
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     
     
     apr_status_t apr_file_lock(apr_file_t *thefile, int type)
    diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c
    index a3f7d0a57ce..1029e1fab96 100644
    --- a/file_io/netware/pipe.c
    +++ b/file_io/netware/pipe.c
    @@ -56,7 +56,7 @@
     #include 
     #include 
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c
    index b2ad12f6833..a79f74a3bfd 100644
    --- a/file_io/os2/dir.c
    +++ b/file_io/os2/dir.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_lib.h"
     #include "apr_strings.h"
    diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c
    index 3b74d0e0207..323fc08768b 100644
    --- a/file_io/os2/filedup.c
    +++ b/file_io/os2/filedup.c
    @@ -52,12 +52,12 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_lib.h"
     #include "apr_strings.h"
     #include 
    -#include "inherit.h"
    +#include "apr_arch_inherit.h"
     
     static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p)
     {
    diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c
    index 274d369709a..4e3aa69284a 100644
    --- a/file_io/os2/filestat.c
    +++ b/file_io/os2/filestat.c
    @@ -54,7 +54,7 @@
     
     #define INCL_DOS
     #define INCL_DOSERRORS
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_lib.h"
     #include 
    diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c
    index c82f26aaf6c..df7c8f8ee81 100644
    --- a/file_io/os2/filesys.c
    +++ b/file_io/os2/filesys.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_strings.h"
     #include "apr_lib.h"
     #include 
    diff --git a/file_io/os2/flock.c b/file_io/os2/flock.c
    index 68ad421db58..1bcee8f0d1e 100644
    --- a/file_io/os2/flock.c
    +++ b/file_io/os2/flock.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     
     APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type)
     {
    diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c
    index 4eaace7b7c7..5224f50f355 100644
    --- a/file_io/os2/maperrorcode.c
    +++ b/file_io/os2/maperrorcode.c
    @@ -53,7 +53,7 @@
      */
     
     #define INCL_DOSERRORS
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include 
     #include 
    diff --git a/file_io/os2/open.c b/file_io/os2/open.c
    index 68bf48fa88e..66203ff0f9a 100644
    --- a/file_io/os2/open.c
    +++ b/file_io/os2/open.c
    @@ -52,12 +52,12 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_lib.h"
     #include "apr_portable.h"
     #include "apr_strings.h"
    -#include "inherit.h"
    +#include "apr_arch_inherit.h"
     #include 
     
     apr_status_t apr_file_cleanup(void *thefile)
    diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c
    index 06e9ca123c3..8de90075f39 100644
    --- a/file_io/os2/pipe.c
    +++ b/file_io/os2/pipe.c
    @@ -53,7 +53,7 @@
      */
     
     #define INCL_DOSERRORS
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_lib.h"
    diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c
    index 4644bf72865..cb73a5d1bf3 100644
    --- a/file_io/os2/readwrite.c
    +++ b/file_io/os2/readwrite.c
    @@ -55,7 +55,7 @@
     #define INCL_DOS
     #define INCL_DOSERRORS
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_lib.h"
     #include "apr_strings.h"
    diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c
    index 02954c4a12a..38625d99833 100644
    --- a/file_io/os2/seek.c
    +++ b/file_io/os2/seek.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_lib.h"
     #include 
    diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c
    index 609b5acec1a..966c7e753ee 100644
    --- a/file_io/unix/copy.c
    +++ b/file_io/unix/copy.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     
     static apr_status_t apr_file_transfer_contents(const char *from_path,
    diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
    index f61a7ea9990..ac5beec1f9e 100644
    --- a/file_io/unix/dir.c
    +++ b/file_io/unix/dir.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     #if APR_HAVE_SYS_SYSLIMITS_H
    diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c
    index fd2fab4883b..a442acb0abb 100644
    --- a/file_io/unix/fileacc.c
    +++ b/file_io/unix/fileacc.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr_strings.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     
     /* A file to put ALL of the accessor functions for apr_file_t types. */
     
    diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c
    index d70c98b8795..67ac489498b 100644
    --- a/file_io/unix/filedup.c
    +++ b/file_io/unix/filedup.c
    @@ -52,11 +52,11 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     #include "apr_thread_mutex.h"
    -#include "inherit.h"
    +#include "apr_arch_inherit.h"
     
     static apr_status_t _file_dup(apr_file_t **new_file, 
                                   apr_file_t *old_file, apr_pool_t *p,
    diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c
    index 004146adf84..d2baabedb10 100644
    --- a/file_io/unix/filepath.c
    +++ b/file_io/unix/filepath.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_strings.h"
     #define APR_WANT_STRFUNC
    diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c
    index 85729a9f6fd..2448d234762 100644
    --- a/file_io/unix/filestat.c
    +++ b/file_io/unix/filestat.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c
    index 0de18efc588..c1ba8844fc1 100644
    --- a/file_io/unix/flock.c
    +++ b/file_io/unix/flock.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     
     #if APR_HAVE_FCNTL_H
     #include 
    diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c
    index cc1e02002d3..553d6b4d890 100644
    --- a/file_io/unix/mktemp.c
    +++ b/file_io/unix/mktemp.c
    @@ -87,7 +87,7 @@
     #include "apr_private.h"
     #include "apr_file_io.h" /* prototype of apr_mkstemp() */
     #include "apr_strings.h" /* prototype of apr_mkstemp() */
    -#include "fileio.h" /* prototype of apr_mkstemp() */
    +#include "apr_arch_fileio.h" /* prototype of apr_mkstemp() */
     #include "apr_portable.h" /* for apr_os_file_put() */
     
     #ifndef HAVE_MKSTEMP
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index fb42e9e05cf..dc7acf65a3e 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -52,11 +52,11 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     #include "apr_thread_mutex.h"
    -#include "inherit.h"
    +#include "apr_arch_inherit.h"
     
     #ifdef NETWARE
     #include "nks/dirio.h"
    diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c
    index 5e8e63edc70..9c7698624f9 100644
    --- a/file_io/unix/pipe.c
    +++ b/file_io/unix/pipe.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c
    index 2bb607edd14..46bb9b1656e 100644
    --- a/file_io/unix/readwrite.c
    +++ b/file_io/unix/readwrite.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_strings.h"
     #include "apr_thread_mutex.h"
     #include "apr_support.h"
    diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c
    index f3d740ee93c..374ab35e783 100644
    --- a/file_io/unix/seek.c
    +++ b/file_io/unix/seek.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     
     static apr_status_t setptr(apr_file_t *thefile, unsigned long pos )
     {
    diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c
    index 2b3e201e45f..4b86ad4274f 100644
    --- a/file_io/win32/dir.c
    +++ b/file_io/win32/dir.c
    @@ -53,11 +53,11 @@
      */
     
     #include "apr.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
    -#include "atime.h"
    +#include "apr_arch_atime.h"
     
     #if APR_HAVE_ERRNO_H
     #include 
    diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c
    index 2fee4292503..7e1b0113564 100644
    --- a/file_io/win32/filedup.c
    +++ b/file_io/win32/filedup.c
    @@ -52,12 +52,12 @@
      * .
      */
     
    -#include "win32/fileio.h"
    +#include "win32/apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_strings.h"
     #include 
    -#include "inherit.h"
    +#include "apr_arch_inherit.h"
     
     APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file,
                                            apr_file_t *old_file, apr_pool_t *p)
    diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c
    index 184026f3a20..f1400cb7a2a 100644
    --- a/file_io/win32/filepath.c
    +++ b/file_io/win32/filepath.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_strings.h"
     #include "apr_lib.h"
     #include 
    diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
    index 4743cbb216a..a06d1383c78 100644
    --- a/file_io/win32/filestat.c
    +++ b/file_io/win32/filestat.c
    @@ -55,15 +55,15 @@
     #include "apr.h"
     #include 
     #include "apr_private.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_strings.h"
     #include "apr_errno.h"
     #include "apr_time.h"
     #include 
    -#include "atime.h"
    -#include "misc.h"
    +#include "apr_arch_atime.h"
    +#include "apr_arch_misc.h"
     
     /* We have to assure that the file name contains no '*'s, or other
      * wildcards when using FindFirstFile to recover the true file name.
    diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c
    index 094d18ccee6..b67d4fef617 100644
    --- a/file_io/win32/filesys.c
    +++ b/file_io/win32/filesys.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_strings.h"
     
     /* Win32 Exceptions:
    diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c
    index fa01aa7300a..386d811bb1c 100644
    --- a/file_io/win32/flock.c
    +++ b/file_io/win32/flock.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     
     APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type)
     {
    diff --git a/file_io/win32/open.c b/file_io/win32/open.c
    index f87525c7df8..c75d78821db 100644
    --- a/file_io/win32/open.c
    +++ b/file_io/win32/open.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr_private.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    @@ -67,8 +67,8 @@
     #if APR_HAVE_SYS_STAT_H
     #include 
     #endif
    -#include "misc.h"
    -#include "inherit.h"
    +#include "apr_arch_misc.h"
    +#include "apr_arch_inherit.h"
     
     #if APR_HAS_UNICODE_FS
     apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, 
    diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c
    index d216af13ecb..9f8401f17a2 100644
    --- a/file_io/win32/pipe.c
    +++ b/file_io/win32/pipe.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "win32/fileio.h"
    +#include "win32/apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    @@ -67,7 +67,7 @@
     #if APR_HAVE_SYS_STAT_H
     #include 
     #endif
    -#include "misc.h"
    +#include "apr_arch_misc.h"
     
     APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout)
     {
    diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c
    index fdec00a5933..a61f368770b 100644
    --- a/file_io/win32/readwrite.c
    +++ b/file_io/win32/readwrite.c
    @@ -52,15 +52,15 @@
      * .
      */
     
    -#include "win32/fileio.h"
    +#include "win32/apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_strings.h"
     #include "apr_lib.h"
     #include "apr_errno.h"
     #include 
    -#include "atime.h"
    -#include "misc.h"
    +#include "apr_arch_atime.h"
    +#include "apr_arch_misc.h"
     
     /*
      * read_with_timeout() 
    diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c
    index 9b81d90bf9a..105eb796247 100644
    --- a/file_io/win32/seek.c
    +++ b/file_io/win32/seek.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "win32/fileio.h"
    +#include "win32/apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include 
     #include 
    diff --git a/include/arch/aix/dso.h b/include/arch/aix/apr_arch_dso.h
    similarity index 100%
    rename from include/arch/aix/dso.h
    rename to include/arch/aix/apr_arch_dso.h
    diff --git a/include/arch/beos/dso.h b/include/arch/beos/apr_arch_dso.h
    similarity index 100%
    rename from include/arch/beos/dso.h
    rename to include/arch/beos/apr_arch_dso.h
    diff --git a/include/arch/beos/proc_mutex.h b/include/arch/beos/apr_arch_proc_mutex.h
    similarity index 100%
    rename from include/arch/beos/proc_mutex.h
    rename to include/arch/beos/apr_arch_proc_mutex.h
    diff --git a/include/arch/beos/thread_cond.h b/include/arch/beos/apr_arch_thread_cond.h
    similarity index 100%
    rename from include/arch/beos/thread_cond.h
    rename to include/arch/beos/apr_arch_thread_cond.h
    diff --git a/include/arch/beos/thread_mutex.h b/include/arch/beos/apr_arch_thread_mutex.h
    similarity index 100%
    rename from include/arch/beos/thread_mutex.h
    rename to include/arch/beos/apr_arch_thread_mutex.h
    diff --git a/include/arch/beos/thread_rwlock.h b/include/arch/beos/apr_arch_thread_rwlock.h
    similarity index 100%
    rename from include/arch/beos/thread_rwlock.h
    rename to include/arch/beos/apr_arch_thread_rwlock.h
    diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/apr_arch_threadproc.h
    similarity index 100%
    rename from include/arch/beos/threadproc.h
    rename to include/arch/beos/apr_arch_threadproc.h
    diff --git a/include/arch/netware/dso.h b/include/arch/netware/apr_arch_dso.h
    similarity index 100%
    rename from include/arch/netware/dso.h
    rename to include/arch/netware/apr_arch_dso.h
    diff --git a/include/arch/netware/fileio.h b/include/arch/netware/apr_arch_fileio.h
    similarity index 100%
    rename from include/arch/netware/fileio.h
    rename to include/arch/netware/apr_arch_fileio.h
    diff --git a/include/arch/netware/global_mutex.h b/include/arch/netware/apr_arch_global_mutex.h
    similarity index 100%
    rename from include/arch/netware/global_mutex.h
    rename to include/arch/netware/apr_arch_global_mutex.h
    diff --git a/include/arch/netware/internal_time.h b/include/arch/netware/apr_arch_internal_time.h
    similarity index 100%
    rename from include/arch/netware/internal_time.h
    rename to include/arch/netware/apr_arch_internal_time.h
    diff --git a/include/arch/netware/networkio.h b/include/arch/netware/apr_arch_networkio.h
    similarity index 100%
    rename from include/arch/netware/networkio.h
    rename to include/arch/netware/apr_arch_networkio.h
    diff --git a/include/arch/netware/pre_nw.h b/include/arch/netware/apr_arch_pre_nw.h
    similarity index 100%
    rename from include/arch/netware/pre_nw.h
    rename to include/arch/netware/apr_arch_pre_nw.h
    diff --git a/include/arch/netware/proc_mutex.h b/include/arch/netware/apr_arch_proc_mutex.h
    similarity index 100%
    rename from include/arch/netware/proc_mutex.h
    rename to include/arch/netware/apr_arch_proc_mutex.h
    diff --git a/include/arch/netware/thread_cond.h b/include/arch/netware/apr_arch_thread_cond.h
    similarity index 100%
    rename from include/arch/netware/thread_cond.h
    rename to include/arch/netware/apr_arch_thread_cond.h
    diff --git a/include/arch/netware/thread_mutex.h b/include/arch/netware/apr_arch_thread_mutex.h
    similarity index 100%
    rename from include/arch/netware/thread_mutex.h
    rename to include/arch/netware/apr_arch_thread_mutex.h
    diff --git a/include/arch/netware/thread_rwlock.h b/include/arch/netware/apr_arch_thread_rwlock.h
    similarity index 100%
    rename from include/arch/netware/thread_rwlock.h
    rename to include/arch/netware/apr_arch_thread_rwlock.h
    diff --git a/include/arch/netware/threadproc.h b/include/arch/netware/apr_arch_threadproc.h
    similarity index 100%
    rename from include/arch/netware/threadproc.h
    rename to include/arch/netware/apr_arch_threadproc.h
    diff --git a/include/arch/os2/dso.h b/include/arch/os2/apr_arch_dso.h
    similarity index 100%
    rename from include/arch/os2/dso.h
    rename to include/arch/os2/apr_arch_dso.h
    diff --git a/include/arch/os2/fileio.h b/include/arch/os2/apr_arch_fileio.h
    similarity index 100%
    rename from include/arch/os2/fileio.h
    rename to include/arch/os2/apr_arch_fileio.h
    diff --git a/include/arch/os2/networkio.h b/include/arch/os2/apr_arch_networkio.h
    similarity index 100%
    rename from include/arch/os2/networkio.h
    rename to include/arch/os2/apr_arch_networkio.h
    diff --git a/include/arch/os2/os2calls.h b/include/arch/os2/apr_arch_os2calls.h
    similarity index 100%
    rename from include/arch/os2/os2calls.h
    rename to include/arch/os2/apr_arch_os2calls.h
    diff --git a/include/arch/os2/proc_mutex.h b/include/arch/os2/apr_arch_proc_mutex.h
    similarity index 100%
    rename from include/arch/os2/proc_mutex.h
    rename to include/arch/os2/apr_arch_proc_mutex.h
    diff --git a/include/arch/os2/thread_cond.h b/include/arch/os2/apr_arch_thread_cond.h
    similarity index 100%
    rename from include/arch/os2/thread_cond.h
    rename to include/arch/os2/apr_arch_thread_cond.h
    diff --git a/include/arch/os2/thread_mutex.h b/include/arch/os2/apr_arch_thread_mutex.h
    similarity index 100%
    rename from include/arch/os2/thread_mutex.h
    rename to include/arch/os2/apr_arch_thread_mutex.h
    diff --git a/include/arch/os2/thread_rwlock.h b/include/arch/os2/apr_arch_thread_rwlock.h
    similarity index 100%
    rename from include/arch/os2/thread_rwlock.h
    rename to include/arch/os2/apr_arch_thread_rwlock.h
    diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/apr_arch_threadproc.h
    similarity index 100%
    rename from include/arch/os2/threadproc.h
    rename to include/arch/os2/apr_arch_threadproc.h
    diff --git a/include/arch/os390/dso.h b/include/arch/os390/apr_arch_dso.h
    similarity index 100%
    rename from include/arch/os390/dso.h
    rename to include/arch/os390/apr_arch_dso.h
    diff --git a/include/arch/unix/dso.h b/include/arch/unix/apr_arch_dso.h
    similarity index 100%
    rename from include/arch/unix/dso.h
    rename to include/arch/unix/apr_arch_dso.h
    diff --git a/include/arch/unix/fileio.h b/include/arch/unix/apr_arch_fileio.h
    similarity index 100%
    rename from include/arch/unix/fileio.h
    rename to include/arch/unix/apr_arch_fileio.h
    diff --git a/include/arch/unix/global_mutex.h b/include/arch/unix/apr_arch_global_mutex.h
    similarity index 100%
    rename from include/arch/unix/global_mutex.h
    rename to include/arch/unix/apr_arch_global_mutex.h
    diff --git a/include/arch/unix/inherit.h b/include/arch/unix/apr_arch_inherit.h
    similarity index 100%
    rename from include/arch/unix/inherit.h
    rename to include/arch/unix/apr_arch_inherit.h
    diff --git a/include/arch/unix/internal_time.h b/include/arch/unix/apr_arch_internal_time.h
    similarity index 100%
    rename from include/arch/unix/internal_time.h
    rename to include/arch/unix/apr_arch_internal_time.h
    diff --git a/include/arch/unix/misc.h b/include/arch/unix/apr_arch_misc.h
    similarity index 100%
    rename from include/arch/unix/misc.h
    rename to include/arch/unix/apr_arch_misc.h
    diff --git a/include/arch/unix/networkio.h b/include/arch/unix/apr_arch_networkio.h
    similarity index 100%
    rename from include/arch/unix/networkio.h
    rename to include/arch/unix/apr_arch_networkio.h
    diff --git a/include/arch/unix/proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h
    similarity index 100%
    rename from include/arch/unix/proc_mutex.h
    rename to include/arch/unix/apr_arch_proc_mutex.h
    diff --git a/include/arch/unix/shm.h b/include/arch/unix/apr_arch_shm.h
    similarity index 100%
    rename from include/arch/unix/shm.h
    rename to include/arch/unix/apr_arch_shm.h
    diff --git a/include/arch/unix/thread_cond.h b/include/arch/unix/apr_arch_thread_cond.h
    similarity index 100%
    rename from include/arch/unix/thread_cond.h
    rename to include/arch/unix/apr_arch_thread_cond.h
    diff --git a/include/arch/unix/thread_mutex.h b/include/arch/unix/apr_arch_thread_mutex.h
    similarity index 100%
    rename from include/arch/unix/thread_mutex.h
    rename to include/arch/unix/apr_arch_thread_mutex.h
    diff --git a/include/arch/unix/thread_rwlock.h b/include/arch/unix/apr_arch_thread_rwlock.h
    similarity index 100%
    rename from include/arch/unix/thread_rwlock.h
    rename to include/arch/unix/apr_arch_thread_rwlock.h
    diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/apr_arch_threadproc.h
    similarity index 100%
    rename from include/arch/unix/threadproc.h
    rename to include/arch/unix/apr_arch_threadproc.h
    diff --git a/include/arch/win32/atime.h b/include/arch/win32/apr_arch_atime.h
    similarity index 100%
    rename from include/arch/win32/atime.h
    rename to include/arch/win32/apr_arch_atime.h
    diff --git a/include/arch/win32/dso.h b/include/arch/win32/apr_arch_dso.h
    similarity index 100%
    rename from include/arch/win32/dso.h
    rename to include/arch/win32/apr_arch_dso.h
    diff --git a/include/arch/win32/fileio.h b/include/arch/win32/apr_arch_fileio.h
    similarity index 100%
    rename from include/arch/win32/fileio.h
    rename to include/arch/win32/apr_arch_fileio.h
    diff --git a/include/arch/win32/inherit.h b/include/arch/win32/apr_arch_inherit.h
    similarity index 100%
    rename from include/arch/win32/inherit.h
    rename to include/arch/win32/apr_arch_inherit.h
    diff --git a/include/arch/win32/misc.h b/include/arch/win32/apr_arch_misc.h
    similarity index 100%
    rename from include/arch/win32/misc.h
    rename to include/arch/win32/apr_arch_misc.h
    diff --git a/include/arch/win32/networkio.h b/include/arch/win32/apr_arch_networkio.h
    similarity index 100%
    rename from include/arch/win32/networkio.h
    rename to include/arch/win32/apr_arch_networkio.h
    diff --git a/include/arch/win32/proc_mutex.h b/include/arch/win32/apr_arch_proc_mutex.h
    similarity index 100%
    rename from include/arch/win32/proc_mutex.h
    rename to include/arch/win32/apr_arch_proc_mutex.h
    diff --git a/include/arch/win32/thread_cond.h b/include/arch/win32/apr_arch_thread_cond.h
    similarity index 100%
    rename from include/arch/win32/thread_cond.h
    rename to include/arch/win32/apr_arch_thread_cond.h
    diff --git a/include/arch/win32/thread_mutex.h b/include/arch/win32/apr_arch_thread_mutex.h
    similarity index 100%
    rename from include/arch/win32/thread_mutex.h
    rename to include/arch/win32/apr_arch_thread_mutex.h
    diff --git a/include/arch/win32/thread_rwlock.h b/include/arch/win32/apr_arch_thread_rwlock.h
    similarity index 100%
    rename from include/arch/win32/thread_rwlock.h
    rename to include/arch/win32/apr_arch_thread_rwlock.h
    diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/apr_arch_threadproc.h
    similarity index 100%
    rename from include/arch/win32/threadproc.h
    rename to include/arch/win32/apr_arch_threadproc.h
    diff --git a/include/arch/win32/utf8.h b/include/arch/win32/apr_arch_utf8.h
    similarity index 100%
    rename from include/arch/win32/utf8.h
    rename to include/arch/win32/apr_arch_utf8.h
    diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c
    index 25dc318b112..405a0b15e57 100644
    --- a/locks/beos/proc_mutex.c
    +++ b/locks/beos/proc_mutex.c
    @@ -56,7 +56,7 @@
      * Stephen Beaulieu 
      */
      
    -#include "beos/proc_mutex.h"
    +#include "beos/apr_arch_proc_mutex.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c
    index fdb9a5a6557..99908faebb8 100644
    --- a/locks/beos/thread_cond.c
    +++ b/locks/beos/thread_cond.c
    @@ -52,8 +52,8 @@
      * .
      */
     
    -#include "beos/thread_mutex.h"
    -#include "beos/thread_cond.h"
    +#include "beos/apr_arch_thread_mutex.h"
    +#include "beos/apr_arch_thread_cond.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c
    index 414909b5d98..99b4de8d298 100644
    --- a/locks/beos/thread_mutex.c
    +++ b/locks/beos/thread_mutex.c
    @@ -56,7 +56,7 @@
      * Stephen Beaulieu 
      */
      
    -#include "beos/thread_mutex.h"
    +#include "beos/apr_arch_thread_mutex.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/locks/beos/thread_rwlock.c b/locks/beos/thread_rwlock.c
    index 651354a112a..984f0edd2e3 100644
    --- a/locks/beos/thread_rwlock.c
    +++ b/locks/beos/thread_rwlock.c
    @@ -56,7 +56,7 @@
      * Stephen Beaulieu 
      */
      
    -#include "beos/thread_rwlock.h"
    +#include "beos/apr_arch_thread_rwlock.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c
    index 3e610a6d6da..075d98305de 100644
    --- a/locks/netware/proc_mutex.c
    +++ b/locks/netware/proc_mutex.c
    @@ -55,8 +55,8 @@
     #include "apr.h"
     #include "apr_private.h"
     #include "apr_portable.h"
    -#include "proc_mutex.h"
    -#include "thread_mutex.h"
    +#include "apr_arch_proc_mutex.h"
    +#include "apr_arch_thread_mutex.h"
     
     APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
                                                     const char *fname,
    diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c
    index 190c9a39cea..85debe2f156 100644
    --- a/locks/netware/thread_cond.c
    +++ b/locks/netware/thread_cond.c
    @@ -58,8 +58,8 @@
     #include "apr_private.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    -#include "thread_mutex.h"
    -#include "thread_cond.h"
    +#include "apr_arch_thread_mutex.h"
    +#include "apr_arch_thread_cond.h"
     #include "apr_portable.h"
     
     static apr_status_t thread_cond_cleanup(void *data)
    diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c
    index b4edf2efd7c..d1c4f62bf5f 100644
    --- a/locks/netware/thread_mutex.c
    +++ b/locks/netware/thread_mutex.c
    @@ -56,7 +56,7 @@
     #include "apr_private.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    -#include "thread_mutex.h"
    +#include "apr_arch_thread_mutex.h"
     #include "apr_portable.h"
     
     static apr_status_t thread_mutex_cleanup(void *data)
    diff --git a/locks/netware/thread_rwlock.c b/locks/netware/thread_rwlock.c
    index 3c2740278a5..a1ba28b80d5 100644
    --- a/locks/netware/thread_rwlock.c
    +++ b/locks/netware/thread_rwlock.c
    @@ -56,7 +56,7 @@
     #include "apr_private.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    -#include "thread_rwlock.h"
    +#include "apr_arch_thread_rwlock.h"
     #include "apr_portable.h"
     
     static apr_status_t thread_rwlock_cleanup(void *data)
    diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c
    index 6dcba8359fc..2009532b6b4 100644
    --- a/locks/os2/proc_mutex.c
    +++ b/locks/os2/proc_mutex.c
    @@ -56,8 +56,8 @@
     #include "apr_lib.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
    -#include "proc_mutex.h"
    -#include "fileio.h"
    +#include "apr_arch_proc_mutex.h"
    +#include "apr_arch_fileio.h"
     #include 
     #include 
     
    diff --git a/locks/os2/thread_cond.c b/locks/os2/thread_cond.c
    index 16049867f96..9f317370f71 100644
    --- a/locks/os2/thread_cond.c
    +++ b/locks/os2/thread_cond.c
    @@ -56,9 +56,9 @@
     #include "apr_lib.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
    -#include "thread_mutex.h"
    -#include "thread_cond.h"
    -#include "fileio.h"
    +#include "apr_arch_thread_mutex.h"
    +#include "apr_arch_thread_cond.h"
    +#include "apr_arch_fileio.h"
     #include 
     
     APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond,
    diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c
    index ef4afc9f0b5..3f0d7fa61cf 100644
    --- a/locks/os2/thread_mutex.c
    +++ b/locks/os2/thread_mutex.c
    @@ -56,8 +56,8 @@
     #include "apr_lib.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
    -#include "thread_mutex.h"
    -#include "fileio.h"
    +#include "apr_arch_thread_mutex.h"
    +#include "apr_arch_fileio.h"
     #include 
     #include 
     
    diff --git a/locks/os2/thread_rwlock.c b/locks/os2/thread_rwlock.c
    index 55a3fd69970..99b7f3be12f 100644
    --- a/locks/os2/thread_rwlock.c
    +++ b/locks/os2/thread_rwlock.c
    @@ -56,8 +56,8 @@
     #include "apr_lib.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
    -#include "thread_rwlock.h"
    -#include "fileio.h"
    +#include "apr_arch_thread_rwlock.h"
    +#include "apr_arch_fileio.h"
     #include 
     
     static apr_status_t thread_rwlock_cleanup(void *therwlock)
    diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c
    index 02d4680022e..f288584d462 100644
    --- a/locks/unix/global_mutex.c
    +++ b/locks/unix/global_mutex.c
    @@ -54,7 +54,7 @@
     
     #include "apr.h"
     #include "apr_strings.h"
    -#include "global_mutex.h"
    +#include "apr_arch_global_mutex.h"
     #include "apr_proc_mutex.h"
     #include "apr_thread_mutex.h"
     #include "apr_portable.h"
    diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c
    index 2f6327fa6d5..e1b2059280a 100644
    --- a/locks/unix/proc_mutex.c
    +++ b/locks/unix/proc_mutex.c
    @@ -54,8 +54,8 @@
     
     #include "apr.h"
     #include "apr_strings.h"
    -#include "proc_mutex.h"
    -#include "fileio.h" /* for apr_mkstemp() */
    +#include "apr_arch_proc_mutex.h"
    +#include "apr_arch_fileio.h" /* for apr_mkstemp() */
     
     APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex)
     {
    diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c
    index bfbc43b7540..a09ec3fc756 100644
    --- a/locks/unix/thread_cond.c
    +++ b/locks/unix/thread_cond.c
    @@ -56,8 +56,8 @@
     
     #if APR_HAS_THREADS
     
    -#include "thread_mutex.h"
    -#include "thread_cond.h"
    +#include "apr_arch_thread_mutex.h"
    +#include "apr_arch_thread_cond.h"
     
     static apr_status_t thread_cond_cleanup(void *data)
     {
    diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c
    index caef8b56a6f..07ff34cd367 100644
    --- a/locks/unix/thread_mutex.c
    +++ b/locks/unix/thread_mutex.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "thread_mutex.h"
    +#include "apr_arch_thread_mutex.h"
     #define APR_WANT_MEMFUNC
     #include "apr_want.h"
     
    diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c
    index 74f4bb16ac9..acbfceb50a1 100644
    --- a/locks/unix/thread_rwlock.c
    +++ b/locks/unix/thread_rwlock.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "thread_rwlock.h"
    +#include "apr_arch_thread_rwlock.h"
     #include "apr_private.h"
     
     #if APR_HAS_THREADS
    diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c
    index 73b8a169c87..6c6cf26e938 100644
    --- a/locks/win32/proc_mutex.c
    +++ b/locks/win32/proc_mutex.c
    @@ -57,8 +57,8 @@
     #include "apr_general.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
    -#include "proc_mutex.h"
    -#include "misc.h"
    +#include "apr_arch_proc_mutex.h"
    +#include "apr_arch_misc.h"
     
     static apr_status_t proc_mutex_cleanup(void *mutex_)
     {
    diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c
    index 33b7ad1c750..48465cbba5a 100644
    --- a/locks/win32/thread_cond.c
    +++ b/locks/win32/thread_cond.c
    @@ -56,8 +56,8 @@
     #include "apr_private.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    -#include "win32/thread_mutex.h"
    -#include "win32/thread_cond.h"
    +#include "win32/apr_arch_thread_mutex.h"
    +#include "win32/apr_arch_thread_cond.h"
     #include "apr_portable.h"
     
     static apr_status_t thread_cond_cleanup(void *data)
    diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c
    index cd39f386c1e..ef9074d86dc 100644
    --- a/locks/win32/thread_mutex.c
    +++ b/locks/win32/thread_mutex.c
    @@ -56,10 +56,10 @@
     #include "apr_private.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    -#include "thread_mutex.h"
    +#include "apr_arch_thread_mutex.h"
     #include "apr_thread_mutex.h"
     #include "apr_portable.h"
    -#include "misc.h"
    +#include "apr_arch_misc.h"
     
     static apr_status_t thread_mutex_cleanup(void *data)
     {
    diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c
    index 60d8b8e61e4..a8d6cf1bda9 100644
    --- a/locks/win32/thread_rwlock.c
    +++ b/locks/win32/thread_rwlock.c
    @@ -56,7 +56,7 @@
     #include "apr_private.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    -#include "win32/thread_rwlock.h"
    +#include "win32/apr_arch_thread_rwlock.h"
     #include "apr_portable.h"
     
     static apr_status_t thread_rwlock_cleanup(void *data)
    diff --git a/misc/netware/start.c b/misc/netware/start.c
    index 93337a8c198..9c2919f454d 100644
    --- a/misc/netware/start.c
    +++ b/misc/netware/start.c
    @@ -57,9 +57,9 @@
     #include "apr_pools.h"
     #include "apr_signal.h"
     
    -#include "misc.h"       /* for WSAHighByte / WSALowByte */
    -#include "proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */
    -#include "internal_time.h"
    +#include "apr_arch_misc.h"       /* for WSAHighByte / WSALowByte */
    +#include "apr_arch_proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */
    +#include "apr_arch_internal_time.h"
     
     
     APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, 
    diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c
    index 30cafee5d8d..98c529cae50 100644
    --- a/misc/unix/errorcodes.c
    +++ b/misc/unix/errorcodes.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "misc.h"
    +#include "apr_arch_misc.h"
     #include "apr_strings.h"
     #include "apr_lib.h"
     #include "apr_dso.h"
    diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c
    index 1e0911710b2..24be3c82f89 100644
    --- a/misc/unix/getopt.c
    +++ b/misc/unix/getopt.c
    @@ -31,7 +31,7 @@
      * SUCH DAMAGE.
      */
     
    -#include "misc.h"
    +#include "apr_arch_misc.h"
     #include "apr_strings.h"
     #include "apr_lib.h"
     
    diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c
    index 8d28bb3db13..cd7b7526fc1 100644
    --- a/misc/unix/otherchild.c
    +++ b/misc/unix/otherchild.c
    @@ -56,9 +56,9 @@
     
     #if APR_HAS_OTHER_CHILD
     
    -#include "misc.h"
    -#include "threadproc.h"
    -#include "fileio.h"
    +#include "apr_arch_misc.h"
    +#include "apr_arch_threadproc.h"
    +#include "apr_arch_fileio.h"
     #ifdef HAVE_TIME_H
     #include 
     #endif
    diff --git a/misc/unix/rand.c b/misc/unix/rand.c
    index 6b396fc061e..0e0683beb28 100644
    --- a/misc/unix/rand.c
    +++ b/misc/unix/rand.c
    @@ -56,7 +56,7 @@
     #include "apr_want.h"
     #include "apr_general.h"
     
    -#include "misc.h"
    +#include "apr_arch_misc.h"
     #include 
     #if APR_HAVE_SYS_TYPES_H
     #include 
    diff --git a/misc/unix/start.c b/misc/unix/start.c
    index f5f306cadc0..48c815651a0 100644
    --- a/misc/unix/start.c
    +++ b/misc/unix/start.c
    @@ -58,8 +58,8 @@
     #include "apr_signal.h"
     #include "apr_atomic.h"
     
    -#include "proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */
    -#include "internal_time.h"
    +#include "apr_arch_proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */
    +#include "apr_arch_internal_time.h"
     
     
     APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, 
    diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c
    index ae64974f30c..9f2b01c415a 100644
    --- a/misc/win32/apr_app.c
    +++ b/misc/win32/apr_app.c
    @@ -75,10 +75,10 @@
     #include "ShellAPI.h"
     #include "crtdbg.h"
     #include "wchar.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "assert.h"
     #include "apr_private.h"
    -#include "misc.h"
    +#include "apr_arch_misc.h"
     
     /* This symbol is _private_, although it must be exported.
      */
    diff --git a/misc/win32/internal.c b/misc/win32/internal.c
    index ee1d2c18e08..f0f79950aa2 100644
    --- a/misc/win32/internal.c
    +++ b/misc/win32/internal.c
    @@ -54,8 +54,8 @@
     
     #include "apr_private.h"
     
    -#include "misc.h"
    -#include "fileio.h"
    +#include "apr_arch_misc.h"
    +#include "apr_arch_fileio.h"
     #include 
     #include 
     
    diff --git a/misc/win32/misc.c b/misc/win32/misc.c
    index 53e300ea8d1..67d03061db9 100644
    --- a/misc/win32/misc.c
    +++ b/misc/win32/misc.c
    @@ -53,9 +53,9 @@
      */
     
     #include "apr_private.h"
    -#include "misc.h"
    +#include "apr_arch_misc.h"
     #include "crtdbg.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "assert.h"
     #include "apr_lib.h"
     
    diff --git a/misc/win32/rand.c b/misc/win32/rand.c
    index f2eb0769837..29999d61b14 100644
    --- a/misc/win32/rand.c
    +++ b/misc/win32/rand.c
    @@ -56,7 +56,7 @@
     #include "apr_private.h"
     #include "apr_general.h"
     #include "apr_portable.h"
    -#include "misc.h"
    +#include "apr_arch_misc.h"
     #include 
     
     
    diff --git a/misc/win32/start.c b/misc/win32/start.c
    index 2d26cf81d88..0190b96b653 100644
    --- a/misc/win32/start.c
    +++ b/misc/win32/start.c
    @@ -58,9 +58,9 @@
     #include "apr_signal.h"
     #include "ShellAPI.h"
     
    -#include "misc.h"       /* for WSAHighByte / WSALowByte */
    +#include "apr_arch_misc.h"       /* for WSAHighByte / WSALowByte */
     #include "wchar.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "crtdbg.h"
     #include "assert.h"
     
    diff --git a/misc/win32/utf8.c b/misc/win32/utf8.c
    index ffa36c3dcad..399caaf6caa 100644
    --- a/misc/win32/utf8.c
    +++ b/misc/win32/utf8.c
    @@ -55,7 +55,7 @@
     #include "apr.h"
     #include "apr_private.h"
     #include "apr_errno.h"
    -#include "utf8.h"
    +#include "apr_arch_utf8.h"
     
     /* Implement the design principal specified by RFC 2718 2.2.5 
      * Guidelines for new URL Schemes - within the APR.
    diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c
    index 8b32791f3b0..dcb08040fb1 100644
    --- a/mmap/unix/mmap.c
    +++ b/mmap/unix/mmap.c
    @@ -58,7 +58,7 @@
     #include "apr_strings.h"
     #include "apr_mmap.h"
     #include "apr_errno.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_portable.h"
     
     /* System headers required for the mmap library */
    diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c
    index ce21ea06172..b47b64b3936 100644
    --- a/mmap/win32/mmap.c
    +++ b/mmap/win32/mmap.c
    @@ -57,7 +57,7 @@
     #include "apr_general.h"
     #include "apr_mmap.h"
     #include "apr_errno.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_portable.h"
     #include "apr_strings.h"
     
    diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c
    index c6808cc41f3..45dc43587ac 100644
    --- a/network_io/beos/sendrecv.c
    +++ b/network_io/beos/sendrecv.c
    @@ -56,7 +56,7 @@
     #if BEOS_BONE /* BONE uses the unix code - woohoo */
     #include "../unix/sendrecv.c"
     #else
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     #include "apr_time.h"
     
     apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read)
    diff --git a/network_io/os2/os2calls.c b/network_io/os2/os2calls.c
    index da8f61b6288..fc011588d46 100644
    --- a/network_io/os2/os2calls.c
    +++ b/network_io/os2/os2calls.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     #include "apr_network_io.h"
     #include "apr_portable.h"
     #include "apr_general.h"
    diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c
    index ce0e65a0619..654ba917aad 100644
    --- a/network_io/os2/sendrecv.c
    +++ b/network_io/os2/sendrecv.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     #include "apr_errno.h"
     #include "apr_general.h"
     #include "apr_network_io.h"
    diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c
    index e04dfed2f5a..55c7a9341c7 100644
    --- a/network_io/os2/sendrecv_udp.c
    +++ b/network_io/os2/sendrecv_udp.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     #include "apr_errno.h"
     #include "apr_general.h"
     #include "apr_network_io.h"
    diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c
    index ed07e1adf98..cd3b084f599 100644
    --- a/network_io/os2/sockets.c
    +++ b/network_io/os2/sockets.c
    @@ -52,8 +52,8 @@
      * .
      */
     
    -#include "networkio.h"
    -#include "inherit.h"
    +#include "apr_arch_networkio.h"
    +#include "apr_arch_inherit.h"
     #include "apr_network_io.h"
     #include "apr_general.h"
     #include "apr_portable.h"
    @@ -65,7 +65,7 @@
     #include 
     #include 
     #include 
    -#include "os2calls.h"
    +#include "apr_arch_os2calls.h"
     
     static apr_status_t socket_cleanup(void *sock)
     {
    diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c
    index 0af2e471f64..b23dd294d8f 100644
    --- a/network_io/os2/sockopt.c
    +++ b/network_io/os2/sockopt.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     #include "apr_network_io.h"
     #include "apr_general.h"
     #include "apr_lib.h"
    diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c
    index 9cd78852e39..451e9a0fb7f 100644
    --- a/network_io/unix/inet_ntop.c
    +++ b/network_io/unix/inet_ntop.c
    @@ -15,7 +15,7 @@
      */
     
     #include "apr_private.h"
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     #include "apr_strings.h"
     
     #if APR_HAVE_SYS_TYPES_H
    diff --git a/network_io/unix/inet_pton.c b/network_io/unix/inet_pton.c
    index 39aa7204c2c..550ab2a44f6 100644
    --- a/network_io/unix/inet_pton.c
    +++ b/network_io/unix/inet_pton.c
    @@ -15,7 +15,7 @@
      */
     
     #include "apr_private.h"
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     
     #if APR_HAVE_SYS_TYPES_H
     #include 
    diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c
    index e9056f8af4d..cff70c283e9 100644
    --- a/network_io/unix/sendrecv.c
    +++ b/network_io/unix/sendrecv.c
    @@ -52,12 +52,12 @@
      * .
      */
     
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     #include "apr_support.h"
     
     #if APR_HAS_SENDFILE
     /* This file is needed to allow us access to the apr_file_t internals. */
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #endif /* APR_HAS_SENDFILE */
     
     /* sys/sysctl.h is only needed on FreeBSD for include_hdrs_in_length() */
    diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
    index ca5b7c18a15..9408cde5500 100644
    --- a/network_io/unix/sockaddr.c
    +++ b/network_io/unix/sockaddr.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     #include "apr_strings.h"
     #include "apr.h"
     #include "apr_lib.h"
    diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c
    index a41e7675415..3ae028d0823 100644
    --- a/network_io/unix/sockets.c
    +++ b/network_io/unix/sockets.c
    @@ -52,11 +52,11 @@
      * .
      */
     
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     #include "apr_network_io.h"
     #include "apr_support.h"
     #include "apr_portable.h"
    -#include "inherit.h"
    +#include "apr_arch_inherit.h"
     
     #if defined(BEOS) && !defined(BEOS_BONE)
     #define close closesocket
    diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c
    index 47d71fb7fbe..4e9da3020b3 100644
    --- a/network_io/unix/sockopt.c
    +++ b/network_io/unix/sockopt.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     #include "apr_strings.h"
     
     static apr_status_t soblock(int sd)
    diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c
    index dceb5a8fea6..6f71956d104 100644
    --- a/network_io/win32/sendrecv.c
    +++ b/network_io/win32/sendrecv.c
    @@ -52,12 +52,12 @@
      * .
      */
     
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     #include "apr_errno.h"
     #include "apr_general.h"
     #include "apr_network_io.h"
     #include "apr_lib.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #if APR_HAVE_TIME_H
     #include 
     #endif
    diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c
    index 31cc17d967b..10f648118ea 100644
    --- a/network_io/win32/sockets.c
    +++ b/network_io/win32/sockets.c
    @@ -52,14 +52,14 @@
      * .
      */
     
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     #include "apr_network_io.h"
     #include "apr_general.h"
     #include "apr_lib.h"
     #include "apr_portable.h"
     #include 
    -#include "inherit.h"
    -#include "misc.h"
    +#include "apr_arch_inherit.h"
    +#include "apr_arch_misc.h"
     
     static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */
     
    diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c
    index d734ea2f2aa..715c3485f17 100644
    --- a/network_io/win32/sockopt.c
    +++ b/network_io/win32/sockopt.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     #include "apr_network_io.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    diff --git a/poll/os2/poll.c b/poll/os2/poll.c
    index 2e4136d18aa..ed36dc8872b 100755
    --- a/poll/os2/poll.c
    +++ b/poll/os2/poll.c
    @@ -54,7 +54,7 @@
     
     #include "apr.h"
     #include "apr_poll.h"
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     
     APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num,
                           apr_int32_t *nsds, apr_interval_time_t timeout)
    diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c
    index c8fb6aaec96..fd665e5c6ea 100644
    --- a/poll/os2/pollset.c
    +++ b/poll/os2/pollset.c
    @@ -54,7 +54,7 @@
     
     #include "apr.h"
     #include "apr_poll.h"
    -#include "networkio.h"
    +#include "apr_arch_networkio.h"
     
     
     
    diff --git a/poll/unix/poll.c b/poll/unix/poll.c
    index a0aeaca3647..516bd6c4c16 100644
    --- a/poll/unix/poll.c
    +++ b/poll/unix/poll.c
    @@ -56,8 +56,8 @@
     #include "apr_poll.h"
     #include "apr_time.h"
     #include "apr_portable.h"
    -#include "networkio.h"
    -#include "fileio.h"
    +#include "apr_arch_networkio.h"
    +#include "apr_arch_fileio.h"
     #if HAVE_POLL_H
     #include 
     #endif
    diff --git a/poll/unix/pollacc.c b/poll/unix/pollacc.c
    index d62d76e7286..a2e73759b10 100644
    --- a/poll/unix/pollacc.c
    +++ b/poll/unix/pollacc.c
    @@ -54,8 +54,8 @@
     
     #include "apr.h"
     #include "apr_poll.h"
    -#include "networkio.h"
    -#include "fileio.h"
    +#include "apr_arch_networkio.h"
    +#include "apr_arch_fileio.h"
     #if HAVE_POLL_H
     #include 
     #endif
    diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c
    index 740c4e682be..dc1e9aad214 100644
    --- a/shmem/unix/shm.c
    +++ b/shmem/unix/shm.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "shm.h"
    +#include "apr_arch_shm.h"
     
     #include "apr_general.h"
     #include "apr_errno.h"
    diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c
    index 9fc5151b6e5..7451a6cf185 100644
    --- a/shmem/win32/shm.c
    +++ b/shmem/win32/shm.c
    @@ -56,7 +56,7 @@
     #include "apr_errno.h"
     #include "apr_file_io.h"
     #include "apr_shm.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     
     typedef struct memblock_t {
         apr_size_t size;
    diff --git a/support/unix/waitio.c b/support/unix/waitio.c
    index 716db0d709c..d5d9985ca05 100644
    --- a/support/unix/waitio.c
    +++ b/support/unix/waitio.c
    @@ -52,8 +52,8 @@
      * .
      */
     
    -#include "fileio.h"
    -#include "networkio.h"
    +#include "apr_arch_fileio.h"
    +#include "apr_arch_networkio.h"
     #include "apr_poll.h"
     #include "apr_errno.h"
     #include "apr_support.h"
    diff --git a/test/internal/testucs.c b/test/internal/testucs.c
    index a09dabf76fa..ffe2562605f 100644
    --- a/test/internal/testucs.c
    +++ b/test/internal/testucs.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr.h"
    -#include "arch/win32/utf8.h"
    +#include "arch/win32/apr_arch_utf8.h"
     #include 
     #include 
     
    diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c
    index 3b162a9804f..e9708558181 100644
    --- a/threadproc/beos/proc.c
    +++ b/threadproc/beos/proc.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "threadproc.h"
    +#include "apr_arch_threadproc.h"
     #include "apr_strings.h"
     
     struct send_pipe {
    diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c
    index 37d8516901f..559233d8dc8 100644
    --- a/threadproc/beos/thread.c
    +++ b/threadproc/beos/thread.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "threadproc.h"
    +#include "apr_arch_threadproc.h"
     #include "apr_portable.h"
     
     APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *pool)
    diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c
    index ed1ea3e193c..0c89688ef21 100644
    --- a/threadproc/beos/threadpriv.c
    +++ b/threadproc/beos/threadpriv.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "threadproc.h"
    +#include "apr_arch_threadproc.h"
     
     static struct beos_key key_table[BEOS_MAX_DATAKEYS];
     static struct beos_private_data *beos_data[BEOS_MAX_DATAKEYS];
    diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c
    index c0df971c92c..849637b5af8 100644
    --- a/threadproc/netware/proc.c
    +++ b/threadproc/netware/proc.c
    @@ -52,8 +52,8 @@
      * .
      */
     
    -#include "threadproc.h"
    -#include "fileio.h"
    +#include "apr_arch_threadproc.h"
    +#include "apr_arch_fileio.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/threadproc/netware/procsup.c b/threadproc/netware/procsup.c
    index dce6d6305fc..7e88633dae8 100644
    --- a/threadproc/netware/procsup.c
    +++ b/threadproc/netware/procsup.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "threadproc.h"
    +#include "apr_arch_threadproc.h"
     
     apr_status_t apr_proc_detach(int daemonize)
     {
    diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c
    index 03b8d620b21..aacd96e355d 100644
    --- a/threadproc/netware/signals.c
    +++ b/threadproc/netware/signals.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "threadproc.h"
    +#include "apr_arch_threadproc.h"
     #include 
     #include "apr_private.h"
     #include "apr_pools.h"
    diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c
    index 829639b4251..192ad40556c 100644
    --- a/threadproc/netware/thread.c
    +++ b/threadproc/netware/thread.c
    @@ -55,7 +55,7 @@
     #include "apr.h"
     #include "apr_portable.h"
     #include "apr_strings.h"
    -#include "threadproc.h"
    +#include "apr_arch_threadproc.h"
     
     static int thread_count = 0;
     
    diff --git a/threadproc/netware/threadpriv.c b/threadproc/netware/threadpriv.c
    index 10851afe4da..e78b1c97138 100644
    --- a/threadproc/netware/threadpriv.c
    +++ b/threadproc/netware/threadpriv.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr_portable.h"
    -#include "threadproc.h"
    +#include "apr_arch_threadproc.h"
     
     apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, 
                                             void (*dest)(void *), apr_pool_t *pool) 
    diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c
    index b0e4dc15f24..86aec468deb 100644
    --- a/threadproc/os2/proc.c
    +++ b/threadproc/os2/proc.c
    @@ -55,8 +55,8 @@
     #define INCL_DOS
     #define INCL_DOSERRORS
     
    -#include "threadproc.h"
    -#include "fileio.h"
    +#include "apr_arch_threadproc.h"
    +#include "apr_arch_fileio.h"
     #include "apr_private.h"
     #include "apr_thread_proc.h"
     #include "apr_file_io.h"
    diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c
    index 4dc5d470630..fe13ac0f2a4 100644
    --- a/threadproc/os2/thread.c
    +++ b/threadproc/os2/thread.c
    @@ -54,12 +54,12 @@
     
     #define INCL_DOSERRORS
     #define INCL_DOS
    -#include "threadproc.h"
    +#include "apr_arch_threadproc.h"
     #include "apr_thread_proc.h"
     #include "apr_general.h"
     #include "apr_lib.h"
     #include "apr_portable.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include 
     
     APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *pool)
    diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c
    index 8fe99032e5b..1e8cfe14e48 100644
    --- a/threadproc/os2/threadpriv.c
    +++ b/threadproc/os2/threadpriv.c
    @@ -52,13 +52,13 @@
      * .
      */
     
    -#include "threadproc.h"
    +#include "apr_arch_threadproc.h"
     #include "apr_thread_proc.h"
     #include "apr_portable.h"
     #include "apr_general.h"
     #include "apr_errno.h"
     #include "apr_lib.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     
     APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key,
                                                            void (*dest)(void *), 
    diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
    index d534171cffe..755221f19f6 100644
    --- a/threadproc/unix/proc.c
    +++ b/threadproc/unix/proc.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "threadproc.h"
    +#include "apr_arch_threadproc.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     #include "apr_signal.h"
    diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c
    index d0a5df28bc3..a1d2a1c4cdc 100644
    --- a/threadproc/unix/procsup.c
    +++ b/threadproc/unix/procsup.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "threadproc.h"
    +#include "apr_arch_threadproc.h"
     
     APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize)
     {
    diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c
    index c31e3013173..af22651fb6b 100644
    --- a/threadproc/unix/signals.c
    +++ b/threadproc/unix/signals.c
    @@ -53,7 +53,7 @@
      */
     
     #define INCL_DOSEXCEPTIONS      /* for OS2 */
    -#include "threadproc.h"
    +#include "apr_arch_threadproc.h"
     #include "apr_private.h"
     #include "apr_pools.h"
     #include "apr_signal.h"
    diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c
    index 8852c3be63f..062b3e930e9 100644
    --- a/threadproc/unix/thread.c
    +++ b/threadproc/unix/thread.c
    @@ -54,7 +54,7 @@
     
     #include "apr.h"
     #include "apr_portable.h"
    -#include "threadproc.h"
    +#include "apr_arch_threadproc.h"
     
     #if APR_HAS_THREADS
     
    diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c
    index af693477d68..4416c7a403b 100644
    --- a/threadproc/unix/threadpriv.c
    +++ b/threadproc/unix/threadpriv.c
    @@ -54,7 +54,7 @@
     
     #include "apr.h"
     #include "apr_portable.h"
    -#include "threadproc.h"
    +#include "apr_arch_threadproc.h"
     
     #if APR_HAS_THREADS
     
    diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c
    index 5020c456765..21392ce14cc 100644
    --- a/threadproc/win32/proc.c
    +++ b/threadproc/win32/proc.c
    @@ -52,8 +52,8 @@
      * .
      */
     
    -#include "win32/threadproc.h"
    -#include "win32/fileio.h"
    +#include "win32/apr_arch_threadproc.h"
    +#include "win32/apr_arch_fileio.h"
     
     #include "apr_thread_proc.h"
     #include "apr_file_io.h"
    diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c
    index 361413e4fb6..54c45f4e5a7 100644
    --- a/threadproc/win32/signals.c
    +++ b/threadproc/win32/signals.c
    @@ -52,8 +52,8 @@
      * .
      */
     
    -#include "win32/threadproc.h"
    -#include "win32/fileio.h"
    +#include "win32/apr_arch_threadproc.h"
    +#include "win32/apr_arch_fileio.h"
     #include "apr_thread_proc.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
    diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c
    index c0606afd257..7d48228dac1 100644
    --- a/threadproc/win32/thread.c
    +++ b/threadproc/win32/thread.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr_private.h"
    -#include "win32/threadproc.h"
    +#include "win32/apr_arch_threadproc.h"
     #include "apr_thread_proc.h"
     #include "apr_general.h"
     #include "apr_lib.h"
    @@ -61,7 +61,7 @@
     #if APR_HAVE_PROCESS_H
     #include 
     #endif
    -#include "misc.h"   
    +#include "apr_arch_misc.h"   
     
     /* Chosen for us by apr_initialize */
     DWORD tls_apr_thread = 0;
    diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c
    index d016657f6fc..e2ae89c1fdb 100644
    --- a/threadproc/win32/threadpriv.c
    +++ b/threadproc/win32/threadpriv.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "win32/threadproc.h"
    +#include "win32/apr_arch_threadproc.h"
     #include "apr_thread_proc.h"
     #include "apr_general.h"
     #include "apr_lib.h"
    diff --git a/time/unix/time.c b/time/unix/time.c
    index 48956096f82..949b9ff2d3f 100644
    --- a/time/unix/time.c
    +++ b/time/unix/time.c
    @@ -59,7 +59,7 @@
     #include "apr_strings.h"
     
     /* private APR headers */
    -#include "internal_time.h"
    +#include "apr_arch_internal_time.h"
     
     /* System Headers required for time library */
     #if APR_HAVE_SYS_TIME_H
    diff --git a/time/win32/access.c b/time/win32/access.c
    index 168a06d7304..6d48b836cd2 100644
    --- a/time/win32/access.c
    +++ b/time/win32/access.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "win32/atime.h"
    +#include "win32/apr_arch_atime.h"
     #include "apr_time.h"
     #include "apr_general.h"
     #include "apr_lib.h"
    diff --git a/time/win32/time.c b/time/win32/time.c
    index bb888b865f8..8917297a402 100644
    --- a/time/win32/time.c
    +++ b/time/win32/time.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "win32/atime.h"
    +#include "win32/apr_arch_atime.h"
     #include "apr_time.h"
     #include "apr_general.h"
     #include "apr_lib.h"
    @@ -65,7 +65,7 @@
     #endif
     #include 
     #include 
    -#include "misc.h"
    +#include "apr_arch_misc.h"
     
     /* Leap year is any year divisible by four, but not by 100 unless also
      * divisible by 400
    diff --git a/time/win32/timestr.c b/time/win32/timestr.c
    index 9e8d4debdbd..5134183570c 100644
    --- a/time/win32/timestr.c
    +++ b/time/win32/timestr.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "win32/atime.h"
    +#include "win32/apr_arch_atime.h"
     #include "apr_portable.h"
     #include "apr_strings.h"
     
    diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c
    index 05faf32557c..eea131210c4 100644
    --- a/user/win32/userinfo.c
    +++ b/user/win32/userinfo.c
    @@ -56,7 +56,7 @@
     #include "apr_strings.h"
     #include "apr_portable.h"
     #include "apr_user.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #if APR_HAVE_SYS_TYPES_H
     #include 
     #endif
    
    From 65a3dbc3788545edb58f2383e880b764188d1039 Mon Sep 17 00:00:00 2001
    From: Thom May 
    Date: Mon, 6 Jan 2003 23:50:46 +0000
    Subject: [PATCH 4253/7878] Add a changelog file for my last commit.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64272 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index 7aa5afa78f0..bbb0a50202c 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,4 +1,6 @@
     Changes with APR 0.9.2
    +  *) Namespace protect the header files in include/arch
    +     [Thom May]
     
       *) Add function apr_filepath_encoding and associated constants.
          [Branko Cibej]
    
    From 4daddde8359684d300a15d3f9a657925b59fb8d0 Mon Sep 17 00:00:00 2001
    From: Thom May 
    Date: Tue, 7 Jan 2003 00:06:29 +0000
    Subject: [PATCH 4254/7878] Finish off the rename of include/arch
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64273 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/beos/apr_arch_threadproc.h   | 2 +-
     include/arch/netware/apr_arch_networkio.h | 2 +-
     include/arch/os2/apr_arch_networkio.h     | 2 +-
     include/arch/unix/apr_arch_global_mutex.h | 4 ++--
     include/arch/unix/apr_arch_proc_mutex.h   | 2 +-
     include/arch/unix/apr_arch_threadproc.h   | 2 +-
     include/arch/win32/apr_arch_fileio.h      | 4 ++--
     7 files changed, 9 insertions(+), 9 deletions(-)
    
    diff --git a/include/arch/beos/apr_arch_threadproc.h b/include/arch/beos/apr_arch_threadproc.h
    index 5d5e7ef7cdb..c8583b8ed4b 100644
    --- a/include/arch/beos/apr_arch_threadproc.h
    +++ b/include/arch/beos/apr_arch_threadproc.h
    @@ -53,7 +53,7 @@
      */
     
     #include "apr_thread_proc.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     #include "apr_file_io.h"
     #include "apr_thread_proc.h"
     #include "apr_general.h"
    diff --git a/include/arch/netware/apr_arch_networkio.h b/include/arch/netware/apr_arch_networkio.h
    index 812c1bba491..3f0625280fe 100644
    --- a/include/arch/netware/apr_arch_networkio.h
    +++ b/include/arch/netware/apr_arch_networkio.h
    @@ -59,7 +59,7 @@
         arch/netware and then arch/unix. But in this specific case we 
         want arch/win32.
     */
    -#include <../win32/networkio.h>
    +#include <../win32/apr_arch_networkio.h>
     
     #endif  /* ! NETWORK_IO_H */
     
    diff --git a/include/arch/os2/apr_arch_networkio.h b/include/arch/os2/apr_arch_networkio.h
    index d2ce6650218..bd2900dc6d5 100644
    --- a/include/arch/os2/apr_arch_networkio.h
    +++ b/include/arch/os2/apr_arch_networkio.h
    @@ -58,7 +58,7 @@
     #include "apr_private.h"
     #include "apr_network_io.h"
     #include "apr_general.h"
    -#include "os2calls.h"
    +#include "apr_arch_os2calls.h"
     #if APR_HAVE_NETDB_H
     #include 
     #endif
    diff --git a/include/arch/unix/apr_arch_global_mutex.h b/include/arch/unix/apr_arch_global_mutex.h
    index 45e3e06225a..8579535cf34 100644
    --- a/include/arch/unix/apr_arch_global_mutex.h
    +++ b/include/arch/unix/apr_arch_global_mutex.h
    @@ -60,8 +60,8 @@
     #include "apr_general.h"
     #include "apr_lib.h"
     #include "apr_global_mutex.h"
    -#include "proc_mutex.h"
    -#include "thread_mutex.h"
    +#include "apr_arch_proc_mutex.h"
    +#include "apr_arch_thread_mutex.h"
     
     struct apr_global_mutex_t {
         apr_pool_t *pool;
    diff --git a/include/arch/unix/apr_arch_proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h
    index da76da2b86c..fc0a06359d7 100644
    --- a/include/arch/unix/apr_arch_proc_mutex.h
    +++ b/include/arch/unix/apr_arch_proc_mutex.h
    @@ -63,7 +63,7 @@
     #include "apr_pools.h"
     #include "apr_portable.h"
     #include "apr_file_io.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     
     /* System headers required by Locks library */
     #if APR_HAVE_SYS_TYPES_H
    diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h
    index 44edbdad559..380ad5deb0a 100644
    --- a/include/arch/unix/apr_arch_threadproc.h
    +++ b/include/arch/unix/apr_arch_threadproc.h
    @@ -56,7 +56,7 @@
     #include "apr_private.h"
     #include "apr_thread_proc.h"
     #include "apr_file_io.h"
    -#include "fileio.h"
    +#include "apr_arch_fileio.h"
     
     /* System headers required for thread/process library */
     #if APR_HAVE_PTHREAD_H
    diff --git a/include/arch/win32/apr_arch_fileio.h b/include/arch/win32/apr_arch_fileio.h
    index 1e95221f8ca..717dbaefa4c 100644
    --- a/include/arch/win32/apr_arch_fileio.h
    +++ b/include/arch/win32/apr_arch_fileio.h
    @@ -64,7 +64,7 @@
     #include "apr_file_io.h"
     #include "apr_file_info.h"
     #include "apr_errno.h"
    -#include "misc.h"
    +#include "apr_arch_misc.h"
     
     #ifdef HAVE_SYS_STAT_H
     #include 
    @@ -86,7 +86,7 @@
     #endif
     
     #if APR_HAS_UNICODE_FS
    -#include "arch/win32/utf8.h"
    +#include "arch/win32/apr_arch_utf8.h"
     #include 
     
     typedef apr_uint16_t apr_wchar_t;
    
    From 4b5e40642852d41c2990ae09b23de83dc2dd97e6 Mon Sep 17 00:00:00 2001
    From: Thom May 
    Date: Tue, 7 Jan 2003 00:30:48 +0000
    Subject: [PATCH 4255/7878] Fix up the apr dsp files affected by the move of
     the header files Obtained from: Sander Striker
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64274 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr.dsp    | 20 ++++++++++----------
     libapr.dsp | 20 ++++++++++----------
     2 files changed, 20 insertions(+), 20 deletions(-)
    
    diff --git a/apr.dsp b/apr.dsp
    index 868415a9408..e6274c6efe9 100644
    --- a/apr.dsp
    +++ b/apr.dsp
    @@ -391,43 +391,43 @@ SOURCE=.\include\arch\win32\apr_private.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\atime.h
    +SOURCE=.\include\arch\win32\apr_arch_atime.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\dso.h
    +SOURCE=.\include\arch\win32\apr_arch_dso.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\fileio.h
    +SOURCE=.\include\arch\win32\apr_arch_fileio.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\inherit.h
    +SOURCE=.\include\arch\win32\apr_arch_inherit.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\misc.h
    +SOURCE=.\include\arch\win32\apr_arch_misc.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\networkio.h
    +SOURCE=.\include\arch\win32\apr_arch_networkio.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\thread_mutex.h
    +SOURCE=.\include\arch\win32\apr_arch_thread_mutex.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\thread_rwlock.h
    +SOURCE=.\include\arch\win32\apr_arch_thread_rwlock.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\threadproc.h
    +SOURCE=.\include\arch\win32\apr_arch_threadproc.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\utf8.h
    +SOURCE=.\include\arch\win32\apr_arch_utf8.h
     # End Source File
     # End Group
     # Begin Group "Public Header Files"
    diff --git a/libapr.dsp b/libapr.dsp
    index 7a7e3bce8ca..a6f24f0eec7 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -397,43 +397,43 @@ SOURCE=.\include\arch\win32\apr_private.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\atime.h
    +SOURCE=.\include\arch\win32\apr_arch_atime.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\dso.h
    +SOURCE=.\include\arch\win32\apr_arch_dso.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\fileio.h
    +SOURCE=.\include\arch\win32\apr_arch_fileio.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\inherit.h
    +SOURCE=.\include\arch\win32\apr_arch_inherit.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\misc.h
    +SOURCE=.\include\arch\win32\apr_arch_misc.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\networkio.h
    +SOURCE=.\include\arch\win32\apr_arch_networkio.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\thread_mutex.h
    +SOURCE=.\include\arch\win32\apr_arch_thread_mutex.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\thread_rwlock.h
    +SOURCE=.\include\arch\win32\apr_arch_thread_rwlock.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\threadproc.h
    +SOURCE=.\include\arch\win32\apr_arch_threadproc.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\utf8.h
    +SOURCE=.\include\arch\win32\apr_arch_utf8.h
     # End Source File
     # End Group
     # Begin Group "Public Header Files"
    
    From dce850a5c7d9f8f02d3f1081820e135e702c96c5 Mon Sep 17 00:00:00 2001
    From: Thom May 
    Date: Tue, 7 Jan 2003 00:52:57 +0000
    Subject: [PATCH 4256/7878] rename apr_arch_fileio.h to apr_arch_file_io.h for
     consistency
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64275 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr.dsp                                                        | 2 +-
     dso/win32/dso.c                                                | 2 +-
     file_io/netware/filestat.c                                     | 2 +-
     file_io/netware/filesys.c                                      | 2 +-
     file_io/netware/flock.c                                        | 2 +-
     file_io/netware/pipe.c                                         | 2 +-
     file_io/os2/dir.c                                              | 2 +-
     file_io/os2/filedup.c                                          | 2 +-
     file_io/os2/filestat.c                                         | 2 +-
     file_io/os2/filesys.c                                          | 2 +-
     file_io/os2/flock.c                                            | 2 +-
     file_io/os2/maperrorcode.c                                     | 2 +-
     file_io/os2/open.c                                             | 2 +-
     file_io/os2/pipe.c                                             | 2 +-
     file_io/os2/readwrite.c                                        | 2 +-
     file_io/os2/seek.c                                             | 2 +-
     file_io/unix/copy.c                                            | 2 +-
     file_io/unix/dir.c                                             | 2 +-
     file_io/unix/fileacc.c                                         | 2 +-
     file_io/unix/filedup.c                                         | 2 +-
     file_io/unix/filepath.c                                        | 2 +-
     file_io/unix/filestat.c                                        | 2 +-
     file_io/unix/flock.c                                           | 2 +-
     file_io/unix/mktemp.c                                          | 2 +-
     file_io/unix/open.c                                            | 2 +-
     file_io/unix/pipe.c                                            | 2 +-
     file_io/unix/readwrite.c                                       | 2 +-
     file_io/unix/seek.c                                            | 2 +-
     file_io/win32/dir.c                                            | 2 +-
     file_io/win32/filedup.c                                        | 2 +-
     file_io/win32/filepath.c                                       | 2 +-
     file_io/win32/filestat.c                                       | 2 +-
     file_io/win32/filesys.c                                        | 2 +-
     file_io/win32/flock.c                                          | 2 +-
     file_io/win32/open.c                                           | 2 +-
     file_io/win32/pipe.c                                           | 2 +-
     file_io/win32/readwrite.c                                      | 2 +-
     file_io/win32/seek.c                                           | 2 +-
     include/arch/beos/apr_arch_threadproc.h                        | 2 +-
     include/arch/netware/{apr_arch_fileio.h => apr_arch_file_io.h} | 0
     include/arch/os2/{apr_arch_fileio.h => apr_arch_file_io.h}     | 0
     include/arch/unix/{apr_arch_fileio.h => apr_arch_file_io.h}    | 0
     include/arch/unix/apr_arch_proc_mutex.h                        | 2 +-
     include/arch/unix/apr_arch_threadproc.h                        | 2 +-
     include/arch/win32/{apr_arch_fileio.h => apr_arch_file_io.h}   | 0
     libapr.dsp                                                     | 2 +-
     locks/os2/proc_mutex.c                                         | 2 +-
     locks/os2/thread_cond.c                                        | 2 +-
     locks/os2/thread_mutex.c                                       | 2 +-
     locks/os2/thread_rwlock.c                                      | 2 +-
     locks/unix/proc_mutex.c                                        | 2 +-
     misc/unix/otherchild.c                                         | 2 +-
     misc/win32/apr_app.c                                           | 2 +-
     misc/win32/internal.c                                          | 2 +-
     misc/win32/misc.c                                              | 2 +-
     misc/win32/start.c                                             | 2 +-
     mmap/unix/mmap.c                                               | 2 +-
     mmap/win32/mmap.c                                              | 2 +-
     network_io/unix/sendrecv.c                                     | 2 +-
     network_io/win32/sendrecv.c                                    | 2 +-
     poll/unix/poll.c                                               | 2 +-
     poll/unix/pollacc.c                                            | 2 +-
     shmem/win32/shm.c                                              | 2 +-
     support/unix/waitio.c                                          | 2 +-
     threadproc/netware/proc.c                                      | 2 +-
     threadproc/os2/proc.c                                          | 2 +-
     threadproc/os2/thread.c                                        | 2 +-
     threadproc/os2/threadpriv.c                                    | 2 +-
     threadproc/win32/proc.c                                        | 2 +-
     threadproc/win32/signals.c                                     | 2 +-
     user/win32/userinfo.c                                          | 2 +-
     71 files changed, 67 insertions(+), 67 deletions(-)
     rename include/arch/netware/{apr_arch_fileio.h => apr_arch_file_io.h} (100%)
     rename include/arch/os2/{apr_arch_fileio.h => apr_arch_file_io.h} (100%)
     rename include/arch/unix/{apr_arch_fileio.h => apr_arch_file_io.h} (100%)
     rename include/arch/win32/{apr_arch_fileio.h => apr_arch_file_io.h} (100%)
    
    diff --git a/apr.dsp b/apr.dsp
    index e6274c6efe9..2eaca5b332b 100644
    --- a/apr.dsp
    +++ b/apr.dsp
    @@ -399,7 +399,7 @@ SOURCE=.\include\arch\win32\apr_arch_dso.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\apr_arch_fileio.h
    +SOURCE=.\include\arch\win32\apr_arch_file_io.h
     # End Source File
     # Begin Source File
     
    diff --git a/dso/win32/dso.c b/dso/win32/dso.c
    index 44a22012819..900a0d0cb4c 100644
    --- a/dso/win32/dso.c
    +++ b/dso/win32/dso.c
    @@ -55,7 +55,7 @@
     #include "apr_arch_dso.h"
     #include "apr_strings.h"
     #include "apr_private.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_arch_utf8.h"
     
     #if APR_HAS_DSO
    diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c
    index 9b87573b204..6b691a9d13e 100644
    --- a/file_io/netware/filestat.c
    +++ b/file_io/netware/filestat.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "fsio.h"
     #include "nks/dirio.h"
     #include "apr_file_io.h"
    diff --git a/file_io/netware/filesys.c b/file_io/netware/filesys.c
    index 6be9110d69d..30a1600479b 100644
    --- a/file_io/netware/filesys.c
    +++ b/file_io/netware/filesys.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_strings.h"
     
     apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p)
    diff --git a/file_io/netware/flock.c b/file_io/netware/flock.c
    index 8430dc7bb7c..6fb2681cd22 100644
    --- a/file_io/netware/flock.c
    +++ b/file_io/netware/flock.c
    @@ -53,7 +53,7 @@
      */
     
     #include 
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     
     
     apr_status_t apr_file_lock(apr_file_t *thefile, int type)
    diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c
    index 1029e1fab96..43b5a7e22fd 100644
    --- a/file_io/netware/pipe.c
    +++ b/file_io/netware/pipe.c
    @@ -56,7 +56,7 @@
     #include 
     #include 
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c
    index a79f74a3bfd..cf4b461f46e 100644
    --- a/file_io/os2/dir.c
    +++ b/file_io/os2/dir.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_lib.h"
     #include "apr_strings.h"
    diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c
    index 323fc08768b..10e8566eb0c 100644
    --- a/file_io/os2/filedup.c
    +++ b/file_io/os2/filedup.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_lib.h"
     #include "apr_strings.h"
    diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c
    index 4e3aa69284a..cfb232e4a26 100644
    --- a/file_io/os2/filestat.c
    +++ b/file_io/os2/filestat.c
    @@ -54,7 +54,7 @@
     
     #define INCL_DOS
     #define INCL_DOSERRORS
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_lib.h"
     #include 
    diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c
    index df7c8f8ee81..88e7105b6df 100644
    --- a/file_io/os2/filesys.c
    +++ b/file_io/os2/filesys.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_strings.h"
     #include "apr_lib.h"
     #include 
    diff --git a/file_io/os2/flock.c b/file_io/os2/flock.c
    index 1bcee8f0d1e..09855859c92 100644
    --- a/file_io/os2/flock.c
    +++ b/file_io/os2/flock.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     
     APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type)
     {
    diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c
    index 5224f50f355..2bd3598435c 100644
    --- a/file_io/os2/maperrorcode.c
    +++ b/file_io/os2/maperrorcode.c
    @@ -53,7 +53,7 @@
      */
     
     #define INCL_DOSERRORS
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include 
     #include 
    diff --git a/file_io/os2/open.c b/file_io/os2/open.c
    index 66203ff0f9a..29c40e1cdab 100644
    --- a/file_io/os2/open.c
    +++ b/file_io/os2/open.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_lib.h"
     #include "apr_portable.h"
    diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c
    index 8de90075f39..ebd0d4cb4ff 100644
    --- a/file_io/os2/pipe.c
    +++ b/file_io/os2/pipe.c
    @@ -53,7 +53,7 @@
      */
     
     #define INCL_DOSERRORS
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_lib.h"
    diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c
    index cb73a5d1bf3..c3f2caf8ac9 100644
    --- a/file_io/os2/readwrite.c
    +++ b/file_io/os2/readwrite.c
    @@ -55,7 +55,7 @@
     #define INCL_DOS
     #define INCL_DOSERRORS
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_lib.h"
     #include "apr_strings.h"
    diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c
    index 38625d99833..605d0b7e11d 100644
    --- a/file_io/os2/seek.c
    +++ b/file_io/os2/seek.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_lib.h"
     #include 
    diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c
    index 966c7e753ee..3aa03ef58ad 100644
    --- a/file_io/unix/copy.c
    +++ b/file_io/unix/copy.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     
     static apr_status_t apr_file_transfer_contents(const char *from_path,
    diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
    index ac5beec1f9e..d8eafee55d2 100644
    --- a/file_io/unix/dir.c
    +++ b/file_io/unix/dir.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     #if APR_HAVE_SYS_SYSLIMITS_H
    diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c
    index a442acb0abb..2140c8b1e67 100644
    --- a/file_io/unix/fileacc.c
    +++ b/file_io/unix/fileacc.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr_strings.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     
     /* A file to put ALL of the accessor functions for apr_file_t types. */
     
    diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c
    index 67ac489498b..7083286fe3c 100644
    --- a/file_io/unix/filedup.c
    +++ b/file_io/unix/filedup.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     #include "apr_thread_mutex.h"
    diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c
    index d2baabedb10..f273621aade 100644
    --- a/file_io/unix/filepath.c
    +++ b/file_io/unix/filepath.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_strings.h"
     #define APR_WANT_STRFUNC
    diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c
    index 2448d234762..26deb1413e9 100644
    --- a/file_io/unix/filestat.c
    +++ b/file_io/unix/filestat.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c
    index c1ba8844fc1..29029315991 100644
    --- a/file_io/unix/flock.c
    +++ b/file_io/unix/flock.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     
     #if APR_HAVE_FCNTL_H
     #include 
    diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c
    index 553d6b4d890..0c2676c197c 100644
    --- a/file_io/unix/mktemp.c
    +++ b/file_io/unix/mktemp.c
    @@ -87,7 +87,7 @@
     #include "apr_private.h"
     #include "apr_file_io.h" /* prototype of apr_mkstemp() */
     #include "apr_strings.h" /* prototype of apr_mkstemp() */
    -#include "apr_arch_fileio.h" /* prototype of apr_mkstemp() */
    +#include "apr_arch_file_io.h" /* prototype of apr_mkstemp() */
     #include "apr_portable.h" /* for apr_os_file_put() */
     
     #ifndef HAVE_MKSTEMP
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index dc7acf65a3e..ce2ffff4066 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     #include "apr_thread_mutex.h"
    diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c
    index 9c7698624f9..8b6fe6b3441 100644
    --- a/file_io/unix/pipe.c
    +++ b/file_io/unix/pipe.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c
    index 46bb9b1656e..db412ec06ed 100644
    --- a/file_io/unix/readwrite.c
    +++ b/file_io/unix/readwrite.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_strings.h"
     #include "apr_thread_mutex.h"
     #include "apr_support.h"
    diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c
    index 374ab35e783..708d81ab5c3 100644
    --- a/file_io/unix/seek.c
    +++ b/file_io/unix/seek.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     
     static apr_status_t setptr(apr_file_t *thefile, unsigned long pos )
     {
    diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c
    index 4b86ad4274f..ee8e38c4950 100644
    --- a/file_io/win32/dir.c
    +++ b/file_io/win32/dir.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
    diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c
    index 7e1b0113564..e2c37034f20 100644
    --- a/file_io/win32/filedup.c
    +++ b/file_io/win32/filedup.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "win32/apr_arch_fileio.h"
    +#include "win32/apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c
    index f1400cb7a2a..f8b53d1beea 100644
    --- a/file_io/win32/filepath.c
    +++ b/file_io/win32/filepath.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_strings.h"
     #include "apr_lib.h"
     #include 
    diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
    index a06d1383c78..a7f922d9cfa 100644
    --- a/file_io/win32/filestat.c
    +++ b/file_io/win32/filestat.c
    @@ -55,7 +55,7 @@
     #include "apr.h"
     #include 
     #include "apr_private.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c
    index b67d4fef617..a4c5177bb67 100644
    --- a/file_io/win32/filesys.c
    +++ b/file_io/win32/filesys.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_strings.h"
     
     /* Win32 Exceptions:
    diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c
    index 386d811bb1c..0629ac92142 100644
    --- a/file_io/win32/flock.c
    +++ b/file_io/win32/flock.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     
     APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type)
     {
    diff --git a/file_io/win32/open.c b/file_io/win32/open.c
    index c75d78821db..2d59ee42327 100644
    --- a/file_io/win32/open.c
    +++ b/file_io/win32/open.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr_private.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c
    index 9f8401f17a2..2e87766110c 100644
    --- a/file_io/win32/pipe.c
    +++ b/file_io/win32/pipe.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "win32/apr_arch_fileio.h"
    +#include "win32/apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c
    index a61f368770b..eda1a589961 100644
    --- a/file_io/win32/readwrite.c
    +++ b/file_io/win32/readwrite.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "win32/apr_arch_fileio.h"
    +#include "win32/apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
     #include "apr_strings.h"
    diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c
    index 105eb796247..3809a1083ac 100644
    --- a/file_io/win32/seek.c
    +++ b/file_io/win32/seek.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "win32/apr_arch_fileio.h"
    +#include "win32/apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include 
     #include 
    diff --git a/include/arch/beos/apr_arch_threadproc.h b/include/arch/beos/apr_arch_threadproc.h
    index c8583b8ed4b..67c9e5fc67b 100644
    --- a/include/arch/beos/apr_arch_threadproc.h
    +++ b/include/arch/beos/apr_arch_threadproc.h
    @@ -53,7 +53,7 @@
      */
     
     #include "apr_thread_proc.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_file_io.h"
     #include "apr_thread_proc.h"
     #include "apr_general.h"
    diff --git a/include/arch/netware/apr_arch_fileio.h b/include/arch/netware/apr_arch_file_io.h
    similarity index 100%
    rename from include/arch/netware/apr_arch_fileio.h
    rename to include/arch/netware/apr_arch_file_io.h
    diff --git a/include/arch/os2/apr_arch_fileio.h b/include/arch/os2/apr_arch_file_io.h
    similarity index 100%
    rename from include/arch/os2/apr_arch_fileio.h
    rename to include/arch/os2/apr_arch_file_io.h
    diff --git a/include/arch/unix/apr_arch_fileio.h b/include/arch/unix/apr_arch_file_io.h
    similarity index 100%
    rename from include/arch/unix/apr_arch_fileio.h
    rename to include/arch/unix/apr_arch_file_io.h
    diff --git a/include/arch/unix/apr_arch_proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h
    index fc0a06359d7..0b52288cfae 100644
    --- a/include/arch/unix/apr_arch_proc_mutex.h
    +++ b/include/arch/unix/apr_arch_proc_mutex.h
    @@ -63,7 +63,7 @@
     #include "apr_pools.h"
     #include "apr_portable.h"
     #include "apr_file_io.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     
     /* System headers required by Locks library */
     #if APR_HAVE_SYS_TYPES_H
    diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h
    index 380ad5deb0a..002c8f701b0 100644
    --- a/include/arch/unix/apr_arch_threadproc.h
    +++ b/include/arch/unix/apr_arch_threadproc.h
    @@ -56,7 +56,7 @@
     #include "apr_private.h"
     #include "apr_thread_proc.h"
     #include "apr_file_io.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     
     /* System headers required for thread/process library */
     #if APR_HAVE_PTHREAD_H
    diff --git a/include/arch/win32/apr_arch_fileio.h b/include/arch/win32/apr_arch_file_io.h
    similarity index 100%
    rename from include/arch/win32/apr_arch_fileio.h
    rename to include/arch/win32/apr_arch_file_io.h
    diff --git a/libapr.dsp b/libapr.dsp
    index a6f24f0eec7..2bb5c0a00e4 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -405,7 +405,7 @@ SOURCE=.\include\arch\win32\apr_arch_dso.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\arch\win32\apr_arch_fileio.h
    +SOURCE=.\include\arch\win32\apr_arch_file_io.h
     # End Source File
     # Begin Source File
     
    diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c
    index 2009532b6b4..23f0bdd692d 100644
    --- a/locks/os2/proc_mutex.c
    +++ b/locks/os2/proc_mutex.c
    @@ -57,7 +57,7 @@
     #include "apr_strings.h"
     #include "apr_portable.h"
     #include "apr_arch_proc_mutex.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include 
     #include 
     
    diff --git a/locks/os2/thread_cond.c b/locks/os2/thread_cond.c
    index 9f317370f71..439885d8b38 100644
    --- a/locks/os2/thread_cond.c
    +++ b/locks/os2/thread_cond.c
    @@ -58,7 +58,7 @@
     #include "apr_portable.h"
     #include "apr_arch_thread_mutex.h"
     #include "apr_arch_thread_cond.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include 
     
     APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond,
    diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c
    index 3f0d7fa61cf..f0d33520153 100644
    --- a/locks/os2/thread_mutex.c
    +++ b/locks/os2/thread_mutex.c
    @@ -57,7 +57,7 @@
     #include "apr_strings.h"
     #include "apr_portable.h"
     #include "apr_arch_thread_mutex.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include 
     #include 
     
    diff --git a/locks/os2/thread_rwlock.c b/locks/os2/thread_rwlock.c
    index 99b7f3be12f..de76db06db5 100644
    --- a/locks/os2/thread_rwlock.c
    +++ b/locks/os2/thread_rwlock.c
    @@ -57,7 +57,7 @@
     #include "apr_strings.h"
     #include "apr_portable.h"
     #include "apr_arch_thread_rwlock.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include 
     
     static apr_status_t thread_rwlock_cleanup(void *therwlock)
    diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c
    index e1b2059280a..67656d867f2 100644
    --- a/locks/unix/proc_mutex.c
    +++ b/locks/unix/proc_mutex.c
    @@ -55,7 +55,7 @@
     #include "apr.h"
     #include "apr_strings.h"
     #include "apr_arch_proc_mutex.h"
    -#include "apr_arch_fileio.h" /* for apr_mkstemp() */
    +#include "apr_arch_file_io.h" /* for apr_mkstemp() */
     
     APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex)
     {
    diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c
    index cd7b7526fc1..eb47228ea6c 100644
    --- a/misc/unix/otherchild.c
    +++ b/misc/unix/otherchild.c
    @@ -58,7 +58,7 @@
     
     #include "apr_arch_misc.h"
     #include "apr_arch_threadproc.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #ifdef HAVE_TIME_H
     #include 
     #endif
    diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c
    index 9f2b01c415a..acd49c6de58 100644
    --- a/misc/win32/apr_app.c
    +++ b/misc/win32/apr_app.c
    @@ -75,7 +75,7 @@
     #include "ShellAPI.h"
     #include "crtdbg.h"
     #include "wchar.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "assert.h"
     #include "apr_private.h"
     #include "apr_arch_misc.h"
    diff --git a/misc/win32/internal.c b/misc/win32/internal.c
    index f0f79950aa2..5f49a2bc650 100644
    --- a/misc/win32/internal.c
    +++ b/misc/win32/internal.c
    @@ -55,7 +55,7 @@
     #include "apr_private.h"
     
     #include "apr_arch_misc.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include 
     #include 
     
    diff --git a/misc/win32/misc.c b/misc/win32/misc.c
    index 67d03061db9..4e2389c5992 100644
    --- a/misc/win32/misc.c
    +++ b/misc/win32/misc.c
    @@ -55,7 +55,7 @@
     #include "apr_private.h"
     #include "apr_arch_misc.h"
     #include "crtdbg.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "assert.h"
     #include "apr_lib.h"
     
    diff --git a/misc/win32/start.c b/misc/win32/start.c
    index 0190b96b653..b2910add1ee 100644
    --- a/misc/win32/start.c
    +++ b/misc/win32/start.c
    @@ -60,7 +60,7 @@
     
     #include "apr_arch_misc.h"       /* for WSAHighByte / WSALowByte */
     #include "wchar.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "crtdbg.h"
     #include "assert.h"
     
    diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c
    index dcb08040fb1..e557f615dbc 100644
    --- a/mmap/unix/mmap.c
    +++ b/mmap/unix/mmap.c
    @@ -58,7 +58,7 @@
     #include "apr_strings.h"
     #include "apr_mmap.h"
     #include "apr_errno.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_portable.h"
     
     /* System headers required for the mmap library */
    diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c
    index b47b64b3936..993ef5fbf04 100644
    --- a/mmap/win32/mmap.c
    +++ b/mmap/win32/mmap.c
    @@ -57,7 +57,7 @@
     #include "apr_general.h"
     #include "apr_mmap.h"
     #include "apr_errno.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_portable.h"
     #include "apr_strings.h"
     
    diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c
    index cff70c283e9..82d7af52e77 100644
    --- a/network_io/unix/sendrecv.c
    +++ b/network_io/unix/sendrecv.c
    @@ -57,7 +57,7 @@
     
     #if APR_HAS_SENDFILE
     /* This file is needed to allow us access to the apr_file_t internals. */
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #endif /* APR_HAS_SENDFILE */
     
     /* sys/sysctl.h is only needed on FreeBSD for include_hdrs_in_length() */
    diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c
    index 6f71956d104..c400d58a6fc 100644
    --- a/network_io/win32/sendrecv.c
    +++ b/network_io/win32/sendrecv.c
    @@ -57,7 +57,7 @@
     #include "apr_general.h"
     #include "apr_network_io.h"
     #include "apr_lib.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #if APR_HAVE_TIME_H
     #include 
     #endif
    diff --git a/poll/unix/poll.c b/poll/unix/poll.c
    index 516bd6c4c16..20df621991a 100644
    --- a/poll/unix/poll.c
    +++ b/poll/unix/poll.c
    @@ -57,7 +57,7 @@
     #include "apr_time.h"
     #include "apr_portable.h"
     #include "apr_arch_networkio.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #if HAVE_POLL_H
     #include 
     #endif
    diff --git a/poll/unix/pollacc.c b/poll/unix/pollacc.c
    index a2e73759b10..2473b0d797c 100644
    --- a/poll/unix/pollacc.c
    +++ b/poll/unix/pollacc.c
    @@ -55,7 +55,7 @@
     #include "apr.h"
     #include "apr_poll.h"
     #include "apr_arch_networkio.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #if HAVE_POLL_H
     #include 
     #endif
    diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c
    index 7451a6cf185..2f1ea94df92 100644
    --- a/shmem/win32/shm.c
    +++ b/shmem/win32/shm.c
    @@ -56,7 +56,7 @@
     #include "apr_errno.h"
     #include "apr_file_io.h"
     #include "apr_shm.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     
     typedef struct memblock_t {
         apr_size_t size;
    diff --git a/support/unix/waitio.c b/support/unix/waitio.c
    index d5d9985ca05..de72b7e9cb7 100644
    --- a/support/unix/waitio.c
    +++ b/support/unix/waitio.c
    @@ -52,7 +52,7 @@
      * .
      */
     
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_arch_networkio.h"
     #include "apr_poll.h"
     #include "apr_errno.h"
    diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c
    index 849637b5af8..782e05bbd7b 100644
    --- a/threadproc/netware/proc.c
    +++ b/threadproc/netware/proc.c
    @@ -53,7 +53,7 @@
      */
     
     #include "apr_arch_threadproc.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c
    index 86aec468deb..75b4237bf0f 100644
    --- a/threadproc/os2/proc.c
    +++ b/threadproc/os2/proc.c
    @@ -56,7 +56,7 @@
     #define INCL_DOSERRORS
     
     #include "apr_arch_threadproc.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_private.h"
     #include "apr_thread_proc.h"
     #include "apr_file_io.h"
    diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c
    index fe13ac0f2a4..52a485647d6 100644
    --- a/threadproc/os2/thread.c
    +++ b/threadproc/os2/thread.c
    @@ -59,7 +59,7 @@
     #include "apr_general.h"
     #include "apr_lib.h"
     #include "apr_portable.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #include 
     
     APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *pool)
    diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c
    index 1e8cfe14e48..f8bd470a3ca 100644
    --- a/threadproc/os2/threadpriv.c
    +++ b/threadproc/os2/threadpriv.c
    @@ -58,7 +58,7 @@
     #include "apr_general.h"
     #include "apr_errno.h"
     #include "apr_lib.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     
     APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key,
                                                            void (*dest)(void *), 
    diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c
    index 21392ce14cc..d67e28f14f1 100644
    --- a/threadproc/win32/proc.c
    +++ b/threadproc/win32/proc.c
    @@ -53,7 +53,7 @@
      */
     
     #include "win32/apr_arch_threadproc.h"
    -#include "win32/apr_arch_fileio.h"
    +#include "win32/apr_arch_file_io.h"
     
     #include "apr_thread_proc.h"
     #include "apr_file_io.h"
    diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c
    index 54c45f4e5a7..49d59d485cc 100644
    --- a/threadproc/win32/signals.c
    +++ b/threadproc/win32/signals.c
    @@ -53,7 +53,7 @@
      */
     
     #include "win32/apr_arch_threadproc.h"
    -#include "win32/apr_arch_fileio.h"
    +#include "win32/apr_arch_file_io.h"
     #include "apr_thread_proc.h"
     #include "apr_file_io.h"
     #include "apr_general.h"
    diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c
    index eea131210c4..84df21322b9 100644
    --- a/user/win32/userinfo.c
    +++ b/user/win32/userinfo.c
    @@ -56,7 +56,7 @@
     #include "apr_strings.h"
     #include "apr_portable.h"
     #include "apr_user.h"
    -#include "apr_arch_fileio.h"
    +#include "apr_arch_file_io.h"
     #if APR_HAVE_SYS_TYPES_H
     #include 
     #endif
    
    From e2d9f7c75475f743e7c4364ba40d331852da3eba Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Tue, 7 Jan 2003 19:40:05 +0000
    Subject: [PATCH 4257/7878] Normalize the path before trying to load the
     module.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64276 13f79535-47bb-0310-9956-ffa450edef68
    ---
     dso/netware/dso.c | 13 +++++++++++--
     1 file changed, 11 insertions(+), 2 deletions(-)
    
    diff --git a/dso/netware/dso.c b/dso/netware/dso.c
    index 7fd3d27e07e..ffb0530b920 100644
    --- a/dso/netware/dso.c
    +++ b/dso/netware/dso.c
    @@ -107,7 +107,16 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle,
                                            const char *path, apr_pool_t *pool)
     {
     
    -    void *os_handle = dlopen(path, RTLD_NOW | RTLD_LOCAL);
    +    void *os_handle = NULL;
    +    char *fullpath = NULL;
    +    apr_status_t rv;
    +
    +    if ((rv = apr_filepath_merge(&fullpath, NULL, path, 
    +                                 APR_FILEPATH_NATIVE, pool)) != APR_SUCCESS) {
    +        return rv;
    +    }
    +
    +    os_handle = dlopen(fullpath, RTLD_NOW | RTLD_LOCAL);
     
         *res_handle = apr_pcalloc(pool, sizeof(**res_handle));
     
    @@ -120,7 +129,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle,
         (*res_handle)->pool = pool;
         (*res_handle)->errormsg = NULL;
         (*res_handle)->symbols = NULL;
    -    (*res_handle)->path = apr_pstrdup(pool, path);
    +    (*res_handle)->path = apr_pstrdup(pool, fullpath);
     
         apr_pool_cleanup_register(pool, *res_handle, dso_cleanup, apr_pool_cleanup_null);
     
    
    From a3ef9767f69c9dc6e2a9516518240e98e7e4f4f8 Mon Sep 17 00:00:00 2001
    From: Thom May 
    Date: Tue, 7 Jan 2003 21:06:50 +0000
    Subject: [PATCH 4258/7878] Apply fix to add library versioning to the debian
     layout.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64277 13f79535-47bb-0310-9956-ffa450edef68
    ---
     config.layout | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/config.layout b/config.layout
    index e059302e629..731710bd3ac 100644
    --- a/config.layout
    +++ b/config.layout
    @@ -223,8 +223,9 @@
         libexecdir:    ${exec_prefix}/lib/apr/modules
         mandir:        ${exec_prefix}/share/man
         datadir:       ${exec_prefix}/share/apr
    -    includedir:    ${exec_prefix}/include/apr
    +    includedir:    ${exec_prefix}/include/apr-${APR_MAJOR_VERSION}
         localstatedir: ${prefix}/var/run
         runtimedir:    ${prefix}/var/run
         infodir:       ${exec_prefix}/share/info
    +    libsuffix:    -${APR_MAJOR_VERSION}
     
    
    From 65abb60df00afa894d6f37890de355f0afd341ac Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Wed, 8 Jan 2003 09:47:04 +0000
    Subject: [PATCH 4259/7878] Allow apr-config to work in symlinked install
     directories when 'realpath' is available.
    
    (Darwin and FreeBSD have realpath.  Solaris doesn't.)
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64278 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES       | 4 ++++
     apr-config.in | 5 +++++
     2 files changed, 9 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index bbb0a50202c..9278595ebc0 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,4 +1,8 @@
     Changes with APR 0.9.2
    +
    +  *) Allow apr-config to work in symlinked install directories when
    +     'realpath' is available.  [Justin Erenkrantz]
    +
       *) Namespace protect the header files in include/arch
          [Thom May]
     
    diff --git a/apr-config.in b/apr-config.in
    index e3ab2dc168a..ce54bf317d7 100644
    --- a/apr-config.in
    +++ b/apr-config.in
    @@ -121,6 +121,11 @@ fi
     
     thisdir="`dirname $0`"
     thisdir="`cd $thisdir && pwd`"
    +# If we have the realpath program, use it to resolve symlinks.
    +# Otherwise, being in a symlinked dir may result in incorrect output.
    +if test -x `which realpath 2>/dev/null`; then
    +  thisdir="`realpath $thisdir`"
    +fi
     if test -d $bindir; then
       tmpbindir="`cd $bindir && pwd`"
     else
    
    From 638a1f59028f1dc3ce73112bb0cf6e6a259de0a3 Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Wed, 8 Jan 2003 13:09:17 +0000
    Subject: [PATCH 4260/7878] The which line should be double-quoted.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64279 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr-config.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/apr-config.in b/apr-config.in
    index ce54bf317d7..d32f191b344 100644
    --- a/apr-config.in
    +++ b/apr-config.in
    @@ -123,7 +123,7 @@ thisdir="`dirname $0`"
     thisdir="`cd $thisdir && pwd`"
     # If we have the realpath program, use it to resolve symlinks.
     # Otherwise, being in a symlinked dir may result in incorrect output.
    -if test -x `which realpath 2>/dev/null`; then
    +if test -x "`which realpath 2>/dev/null`"; then
       thisdir="`realpath $thisdir`"
     fi
     if test -d $bindir; then
    
    From 8b98762dca708b3d85a8e456678088cd2cc253df Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Wed, 8 Jan 2003 20:40:27 +0000
    Subject: [PATCH 4261/7878] Add the NetWare file system root string
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64280 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testnames.c | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/test/testnames.c b/test/testnames.c
    index e17055452da..196afce2dcc 100644
    --- a/test/testnames.c
    +++ b/test/testnames.c
    @@ -62,6 +62,8 @@
     
     #if WIN32
     #define ABS_ROOT "C:/"
    +#elif defined(NETWARE)
    +#define ABS_ROOT "SYS:/"
     #else
     #define ABS_ROOT "/"
     #endif
    
    From e9f74aad7e9c68dc327180aae4e1eda8d1c6c2db Mon Sep 17 00:00:00 2001
    From: Sascha Schumann 
    Date: Thu, 9 Jan 2003 02:48:46 +0000
    Subject: [PATCH 4262/7878] When one does not use the value of the
     apr_atomic_cas macro, GCC 2.95.3/3.2.1 will happily optimize the assembler
     statement away (x86).
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    
    E.g.
    
        apr_atomic_t lck = 0;
        apr_atomic_cas(&lck, 1, 0);
        printf("%d\n", lck);
    
    will be turned into
    
        movl    $0, 4(%esp)
        movl    $.LC0, (%esp)
        call    printf
    
    Adding `volatile� to the asm statement fixes that.
    
        asm volatile ("lock; cmpxchgl %1, %2" ...
    
    gcc -O -S produces:
    
        movl    $0, %edx
        movl    $0, -4(%ebp)
        movl    $1, %ecx
        movl    %edx, %eax
    #APP
        lock; cmpxchgl %ecx, -4(%ebp)
    #NO_APP
        movl    -4(%ebp), %eax
        movl    %eax, 4(%esp)
        movl    $.LC0, (%esp)
        call    printf
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64281 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_atomic.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr_atomic.h b/include/apr_atomic.h
    index dab8d40efc0..b6737de9846 100644
    --- a/include/apr_atomic.h
    +++ b/include/apr_atomic.h
    @@ -199,7 +199,7 @@ APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem);
     #define apr_atomic_t apr_uint32_t
     #define apr_atomic_cas(mem,with,cmp) \
     ({ apr_atomic_t prev; \
    -    asm ("lock; cmpxchgl %1, %2"              \
    +    asm volatile ("lock; cmpxchgl %1, %2"              \
              : "=a" (prev)               \
              : "r" (with), "m" (*(mem)), "0"(cmp) \
              : "memory"); \
    
    From 4e5581773acab64b2d6f8993dff0963e6a07e0b9 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Thu, 9 Jan 2003 16:21:53 +0000
    Subject: [PATCH 4263/7878] Since deconstruct() does not actually validate the
     path, the check is meaningless.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64282 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filepath.c | 9 ++-------
     1 file changed, 2 insertions(+), 7 deletions(-)
    
    diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c
    index f8b53d1beea..1e3cca058b5 100644
    --- a/file_io/win32/filepath.c
    +++ b/file_io/win32/filepath.c
    @@ -105,13 +105,8 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath,
             the path since we won't use the deconstructed information anyway.
         */
         if (volsep) {
    -        /* Split the inpath into its separate parts. If it fails then
    -            we know we have a bad path.
    -        */
    -        if (deconstruct(testpath, server, volume, path, file, NULL, &elements, PATH_UNDEF)) {
    -            if (errno == EINVAL)
    -                return APR_EBADPATH;
    -        }
    +        /* Split the inpath into its separate parts. */
    +        deconstruct(testpath, server, volume, path, file, NULL, &elements, PATH_UNDEF);
         
             /* If we got a volume part then continue splitting out the root.
                 Otherwise we either have an incomplete or relative path
    
    From 2fd94b46658487a348252a3910d43753ea365587 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Thu, 9 Jan 2003 16:54:37 +0000
    Subject: [PATCH 4264/7878] Don't require MMX
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64283 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/NWGNUenvironment.inc | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc
    index 704e4da79e0..72997ff8ca0 100644
    --- a/build/NWGNUenvironment.inc
    +++ b/build/NWGNUenvironment.inc
    @@ -136,9 +136,9 @@ PLIB3S	= $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\MSL C++\MWCPP
     # -align 4              align on 4 byte bounderies
     # -w nocmdline          disable command-line driver/parser warnings
     # -proc PII             generate code base on Pentium II instruction set
    -# -inst mmx             use MMX extensions
    +# -inst mmx             use MMX extensions (not used)
     
    -CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII -inst mmx
    +CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII
     
     # -g                    generate debugging information
     # -O0                   level 0 optimizations
    
    From f3e46d5886f458eb0cd941c6ef0aeec41291b437 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 10 Jan 2003 15:09:00 +0000
    Subject: [PATCH 4265/7878]   Any header required by one platform is likely
     required by them all...   if testsuite IPV6 wasn't working, this is probably
     the reason.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64284 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sockaddr.c | 2 --
     1 file changed, 2 deletions(-)
    
    diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
    index 9408cde5500..5ec4ae4f2c7 100644
    --- a/network_io/unix/sockaddr.c
    +++ b/network_io/unix/sockaddr.c
    @@ -57,9 +57,7 @@
     #include "apr.h"
     #include "apr_lib.h"
     #include "apr_strings.h"
    -#ifdef NETWARE
     #include "apr_private.h"
    -#endif
     
     #if APR_HAVE_STDLIB_H
     #include 
    
    From 3840b9eff34ab57a55b75182baadb23f8f53009a Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 10 Jan 2003 15:10:49 +0000
    Subject: [PATCH 4266/7878]   Need to build accessor binaries for the test
     suite
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64285 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testall.dsp | 8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/test/testall.dsp b/test/testall.dsp
    index 22bd28d7665..c2673fddcb6 100644
    --- a/test/testall.dsp
    +++ b/test/testall.dsp
    @@ -32,7 +32,7 @@ CFG=testall - Win32 Debug
     # PROP BASE Use_Debug_Libraries 0
     # PROP BASE Output_Dir ""
     # PROP BASE Intermediate_Dir ""
    -# PROP BASE Cmd_Line "NMAKE /f Makefile.win testall.exe"
    +# PROP BASE Cmd_Line "NMAKE /f Makefile.win all"
     # PROP BASE Rebuild_Opt "/a"
     # PROP BASE Target_File "testall.exe"
     # PROP BASE Bsc_Name "testall.bsc"
    @@ -41,7 +41,7 @@ CFG=testall - Win32 Debug
     # PROP Use_Debug_Libraries 0
     # PROP Output_Dir ""
     # PROP Intermediate_Dir ""
    -# PROP Cmd_Line "NMAKE /f Makefile.win testall.exe"
    +# PROP Cmd_Line "NMAKE /f Makefile.win all"
     # PROP Rebuild_Opt "/a"
     # PROP Target_File "testall.exe"
     # PROP Bsc_Name ""
    @@ -53,7 +53,7 @@ CFG=testall - Win32 Debug
     # PROP BASE Use_Debug_Libraries 1
     # PROP BASE Output_Dir ""
     # PROP BASE Intermediate_Dir ""
    -# PROP BASE Cmd_Line "NMAKE /f Makefile.win testall.exe"
    +# PROP BASE Cmd_Line "NMAKE /f Makefile.win all"
     # PROP BASE Rebuild_Opt "/a"
     # PROP BASE Target_File "testall.exe"
     # PROP BASE Bsc_Name "testall.bsc"
    @@ -62,7 +62,7 @@ CFG=testall - Win32 Debug
     # PROP Use_Debug_Libraries 1
     # PROP Output_Dir ""
     # PROP Intermediate_Dir ""
    -# PROP Cmd_Line "NMAKE /f Makefile.win testall.exe"
    +# PROP Cmd_Line "NMAKE /f Makefile.win all"
     # PROP Rebuild_Opt "/a"
     # PROP Target_File "testall.exe"
     # PROP Bsc_Name ""
    
    From b5d4082b2a5d7c72fb1a361f0955f0cffd5c9410 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 10 Jan 2003 23:17:33 +0000
    Subject: [PATCH 4267/7878]   To divine the timezone and daylight savings time,
     effective as of the   given date, we need to change our strategy altogether
     from the old   FileTimeToLocalFileTime to the SystemTimeToTzSpecificLocalTime
     API.
    
      We also need to leave the responsibility of mapping tm_gmtoff and
      tm_isdst to the caller, because this isn't the function that can best
      guess at the gyrations.
    
      This code tests out fine after introducing %R to the win32 extra
      translations.  However, there is still the time zone disparity since
      the existing tests only succeed on PST machines.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64286 13f79535-47bb-0310-9956-ffa450edef68
    ---
     time/win32/time.c    | 106 +++++++++++++++++++++++++------------------
     time/win32/timestr.c |   8 +++-
     2 files changed, 69 insertions(+), 45 deletions(-)
    
    diff --git a/time/win32/time.c b/time/win32/time.c
    index 8917297a402..157a583de1a 100644
    --- a/time/win32/time.c
    +++ b/time/win32/time.c
    @@ -72,14 +72,25 @@
      */
     #define IsLeapYear(y) ((!(y % 4)) ? (((!(y % 400)) && (y % 100)) ? 1 : 0) : 0)
     
    -static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm, BOOL lt)
    +static LPTIME_ZONE_INFORMATION GetLocalTimeZone()
    +{
    +    static int init = 0;
    +    static TIME_ZONE_INFORMATION tz;
    +
    +    if (!init) {
    +        GetTimeZoneInformation(&tz);
    +        init = 1;
    +    }
    +    return &tz;
    +}
    +
    +static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm)
     {
    -    TIME_ZONE_INFORMATION tz;
    -    DWORD rc;
         static const int dayoffset[12] =
         {0, 31, 59, 90, 120, 151, 182, 212, 243, 273, 304, 334};
     
    -    /* XXX: this is a looser - can't forefit precision like this
    +    /* Note; the caller is responsible for filling in detailed tm_usec,
    +     * tm_gmtoff and tm_isdst data when applicable.
          */
         xt->tm_usec = tm->wMilliseconds * 1000;
         xt->tm_sec  = tm->wSecond;
    @@ -90,41 +101,14 @@ static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm, BOOL lt)
         xt->tm_year = tm->wYear - 1900;
         xt->tm_wday = tm->wDayOfWeek;
         xt->tm_yday = dayoffset[xt->tm_mon] + (tm->wDay - 1);
    +    xt->tm_isdst = 0;
    +    xt->tm_gmtoff = 0;
     
         /* If this is a leap year, and we're past the 28th of Feb. (the
          * 58th day after Jan. 1), we'll increment our tm_yday by one.
          */
         if (IsLeapYear(tm->wYear) && (xt->tm_yday > 58))
             xt->tm_yday++;
    -
    -    if (!lt) {
    -        xt->tm_isdst = 0;
    -        xt->tm_gmtoff = 0;
    -        return;
    -    }
    -
    -    rc = GetTimeZoneInformation(&tz);
    -    switch (rc) {
    -    case TIME_ZONE_ID_UNKNOWN:
    -        xt->tm_isdst = 0;
    -        /* Bias = UTC - local time in minutes 
    -         * tm_gmtoff is seconds east of UTC
    -         */
    -        xt->tm_gmtoff = tz.Bias * -60;
    -        break;
    -    case TIME_ZONE_ID_STANDARD:
    -        xt->tm_isdst = 0;
    -        xt->tm_gmtoff = (tz.Bias + tz.StandardBias) * -60;
    -        break;
    -    case TIME_ZONE_ID_DAYLIGHT:
    -        xt->tm_isdst = 1;
    -        xt->tm_gmtoff = (tz.Bias + tz.DaylightBias) * -60;
    -        break;
    -    default:
    -        xt->tm_isdst = 0;
    -        xt->tm_gmtoff = 0;
    -    }
    -    return;
     }
     
     APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, 
    @@ -157,35 +141,69 @@ APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result,
         SYSTEMTIME st;
         AprTimeToFileTime(&ft, input);
         FileTimeToSystemTime(&ft, &st);
    -    SystemTimeToAprExpTime(result, &st, 0);
    +    /* The Platform SDK documents that SYSTEMTIME/FILETIME are
    +     * generally UTC, so no timezone info needed
    +     */
    +    SystemTimeToAprExpTime(result, &st);
         result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC);
         return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, 
    -                                          apr_time_t input, apr_int32_t offs)
    +                                          apr_time_t input, 
    +                                          apr_int32_t offs)
     {
         FILETIME ft;
         SYSTEMTIME st;
         AprTimeToFileTime(&ft, input + (offs *  APR_USEC_PER_SEC));
         FileTimeToSystemTime(&ft, &st);
    -    SystemTimeToAprExpTime(result, &st, 0);
    +    /* The Platform SDK documents that SYSTEMTIME/FILETIME are
    +     * generally UTC, so we will simply note the offs used.
    +     */
    +    SystemTimeToAprExpTime(result, &st);
         result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC);
         result->tm_gmtoff = offs;
         return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
    -                                                apr_time_t input)
    +                                          apr_time_t input)
     {
    -    SYSTEMTIME st;
    +    SYSTEMTIME st, localst;
         FILETIME ft, localft;
    +    TIME_ZONE_INFORMATION *tz;
    +    apr_time_t localtime;
     
    +    tz = GetLocalTimeZone();
         AprTimeToFileTime(&ft, input);
    -    FileTimeToLocalFileTime(&ft, &localft);
    -    FileTimeToSystemTime(&localft, &st);
    -    SystemTimeToAprExpTime(result, &st, 1);
    +    FileTimeToSystemTime(&ft, &st);
    +
    +    /* The Platform SDK documents that SYSTEMTIME/FILETIME are
    +     * generally UTC.  We use SystemTimeToTzSpecificLocalTime
    +     * because FileTimeToLocalFileFime is documented that the
    +     * resulting time local file time would have DST relative
    +     * to the *present* date, not the date converted.
    +     */
    +    SystemTimeToTzSpecificLocalTime(tz, &st, &localst);
    +    SystemTimeToAprExpTime(result, &localst);
         result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC);
    +
    +    /* Recover the resulting time as an apr time and use the
    +     * delta for gmtoff in seconds (and ignore msec rounding) 
    +     */
    +    SystemTimeToFileTime(&localst, &localft);
    +    FileTimeToAprTime(&localtime, &localft);
    +    result->tm_gmtoff = (int)apr_time_sec(localtime) 
    +                      - (int)apr_time_sec(input);
    +
    +    /* To compute the dst flag, we compare the expected 
    +     * local (standard) timezone bias to the delta.
    +     * [Note, in war time or double daylight time the
    +     * resulting tm_isdst is, desireably, 2 hours]
    +     */
    +    result->tm_isdst = (result->tm_gmtoff / 3600)
    +                     - (-(tz->Bias + tz->StandardBias) / 60);
    +
         return APR_SUCCESS;
     }
     
    @@ -268,10 +286,10 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime,
                                                   apr_os_exp_time_t **ostime,
                                                   apr_pool_t *cont)
     {
    -    /* XXX: sanity failure, what is system time, gmt or local ?
    -     *      Assume local for this moment.
    +    /* The Platform SDK documents that SYSTEMTIME/FILETIME are
    +     * generally UTC, so no timezone info needed
          */
    -    SystemTimeToAprExpTime(aprtime, *ostime, 1);
    +    SystemTimeToAprExpTime(aprtime, *ostime);
         return APR_SUCCESS;
     }
     
    diff --git a/time/win32/timestr.c b/time/win32/timestr.c
    index 5134183570c..6c93c629095 100644
    --- a/time/win32/timestr.c
    +++ b/time/win32/timestr.c
    @@ -159,7 +159,8 @@ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t)
     #ifndef _WIN32_WCE
     
     int win32_strftime_extra(char *s, size_t max, const char *format,
    -                         const struct tm *tm) {
    +                         const struct tm *tm) 
    +{
        /* If the new format string is bigger than max, the result string won't fit
         * anyway. If format strings are added, made sure the padding below is
         * enough */
    @@ -192,6 +193,11 @@ int win32_strftime_extra(char *s, size_t max, const char *format,
                     i += 2;
                     j += 11;
                     break;
    +            case 'R':
    +                memcpy(new_format + j, "%H:%M", 5);
    +                i += 2;
    +                j += 5;
    +                break;
                 case 'T':
                     memcpy(new_format + j, "%H:%M:%S", 8);
                     i += 2;
    
    From bd034e9592c643dd56315baa4d4439a8144e2970 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 10 Jan 2003 23:18:42 +0000
    Subject: [PATCH 4268/7878]   One cannot just 'shift' the time by editing
     tm_gmtoff.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64287 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testtime.c | 10 +++++++---
     1 file changed, 7 insertions(+), 3 deletions(-)
    
    diff --git a/test/testtime.c b/test/testtime.c
    index 4c73b51bb75..cb11bfd5a59 100644
    --- a/test/testtime.c
    +++ b/test/testtime.c
    @@ -129,10 +129,10 @@ static void test_localstr(CuTest *tc)
         if (rv == APR_ENOTIMPL) {
             CuNotImpl(tc, "apr_time_exp_lt");
         }
    -    /* Force us into PST timezone.  This is the only way the test will
    -     * succeed.
    +    /* XXX: This test is bogus, and a good example of why one never
    +     * runs tests in their own timezone.  Of course changing the delta
    +     * has no impact on the resulting time, only the tm_gmtoff.
          */
    -    xt.tm_gmtoff = -25200;
         CuAssertTrue(tc, rv == APR_SUCCESS);
         CuAssertStrEquals(tc, "2002-08-14 12:05:36.186711 -25200 [257 Sat] DST",
                           print_time(p, &xt));
    @@ -208,6 +208,10 @@ static void test_ctime(CuTest *tc)
         apr_status_t rv;
         char str[STR_SIZE];
     
    +    /* XXX: This test is bogus, and a good example of why one never
    +     * runs tests in their own timezone.  Of course changing the delta
    +     * has no impact on the resulting time, only the tm_gmtoff.
    +     */
         rv = apr_ctime(str, now);
         if (rv == APR_ENOTIMPL) {
             CuNotImpl(tc, "apr_ctime");
    
    From 969f825af137335309ada6df3b3d72d0c968a0e0 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Fri, 10 Jan 2003 23:29:18 +0000
    Subject: [PATCH 4269/7878] Replaced the apr_atomic_dec function and the
     apr_atomic_casptr macro with inline functions for NetWare.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64288 13f79535-47bb-0310-9956-ffa450edef68
    ---
     NWGNUmakefile        |  5 -----
     include/apr_atomic.h | 20 ++++++++++++++++----
     2 files changed, 16 insertions(+), 9 deletions(-)
    
    diff --git a/NWGNUmakefile b/NWGNUmakefile
    index 28032e28b64..b57e51dbb59 100644
    --- a/NWGNUmakefile
    +++ b/NWGNUmakefile
    @@ -236,7 +236,6 @@ FILES_nlm_exports = \
     # Paths must all use the '/' character
     #
     FILES_lib_objs = \
    -	$(OBJDIR)/apr_atomic.o \
     	$(OBJDIR)/apr_cpystrn.o \
     	$(OBJDIR)/apr_fnmatch.o \
     	$(OBJDIR)/apr_getpass.o \
    @@ -316,10 +315,6 @@ install :: nlms FORCE
     # Any specialized rules here
     #
     
    -$(OBJDIR)/%.o: atomic/netware/%.c $(OBJDIR)\cc.opt
    -	@echo Compiling $<
    -	$(CC) atomic\netware\$(
    Date: Mon, 13 Jan 2003 17:57:47 +0000
    Subject: [PATCH 4270/7878]   Catch up on some new apr.h.in flags for
     consistency.
    
      Brad, please correct the netware 64 bit flag, if you have some macro
      to test on that platform.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64289 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr.hnw |  9 ++++++++-
     include/apr.hw  | 15 ++++++++++++++-
     2 files changed, 22 insertions(+), 2 deletions(-)
    
    diff --git a/include/apr.hnw b/include/apr.hnw
    index 9d6e47a4f14..556619f0566 100644
    --- a/include/apr.hnw
    +++ b/include/apr.hnw
    @@ -108,6 +108,8 @@
     #define APR_HAVE_LIMITS_H       1
     #define APR_HAVE_NETDB_H        0
     #define APR_HAVE_NETINET_IN_H   0
    +#define APR_HAVE_NETINET_SCTP_H 0
    +#define APR_HAVE_NETINET_SCTP_UIO_H 0
     #define APR_HAVE_NETINET_TCP_H  0
     #define APR_HAVE_PTHREAD_H      0
     #define APR_HAVE_SIGNAL_H       1
    @@ -189,7 +191,7 @@
     #define APR_HAVE_STRSTR         1
     #define APR_HAVE_STRUCT_RLIMIT  0
     #define APR_HAVE_UNION_SEMUN    0
    -
    +#define APR_HAVE_SCTP           0
     
     #if APR_HAVE_SYS_TYPES_H
     #include 
    @@ -255,6 +257,11 @@ typedef  ssize_t           apr_ssize_t;
     typedef  off_t             apr_off_t;
     typedef  int               apr_socklen_t;
     
    +#ifdef UNKNOWN_NETWARE_64BIT_FLAG_NEEDED
    +#define APR_SIZEOF_VOIDP   8
    +#else
    +#define APR_SIZEOF_VOIDP   4
    +#endif
     
     /* Mechanisms to properly type numeric literals */
     
    diff --git a/include/apr.hw b/include/apr.hw
    index 61ee0696ede..58a79f4c4e9 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -108,6 +108,8 @@ extern "C" {
     #define APR_HAVE_LIMITS_H       1
     #define APR_HAVE_NETDB_H        0
     #define APR_HAVE_NETINET_IN_H   0
    +#define APR_HAVE_NETINET_SCTP_H 0
    +#define APR_HAVE_NETINET_SCTP_UIO_H 0
     #define APR_HAVE_NETINET_TCP_H  0
     #define APR_HAVE_PTHREAD_H      0
     #define APR_HAVE_SIGNAL_H       1
    @@ -193,7 +195,7 @@ extern "C" {
     #define APR_HAVE_IN_ADDR        1
     #define APR_HAVE_INET_ADDR      1
     #define APR_HAVE_INET_NETWORK   0
    -#define APR_HAVE_IPV6           0
    +#define APR_HAVE_IPV6           1
     #define APR_HAVE_MEMMOVE        1
     #define APR_HAVE_SETRLIMIT      0
     #define APR_HAVE_SIGACTION      0
    @@ -206,6 +208,7 @@ extern "C" {
     #define APR_HAVE_MEMCHR         1
     #define APR_HAVE_STRUCT_RLIMIT  0
     #define APR_HAVE_UNION_SEMUN    0
    +#define APR_HAVE_SCTP           0
     
     #ifndef _WIN32_WCE
     #define APR_HAVE_STRICMP        1
    @@ -334,6 +337,16 @@ typedef  __int64     apr_off_t;
     typedef  int         apr_off_t;
     #endif
     typedef  int         apr_socklen_t;
    +
    +#ifdef WIN64
    +#define APR_SIZEOF_VOIDP   8
    +#else
    +#define APR_SIZEOF_VOIDP   4
    +#endif
    +
    +/* XXX These simply don't belong here, perhaps in apr_portabile.h
    + * based on some APR_HAVE_PID/GID/UID?
    + */
     typedef  int         pid_t;
     typedef  int         uid_t;
     typedef  int         gid_t;
    
    From 4f12040bd98821c0abbcf49e727dfeeced684300 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 13 Jan 2003 18:23:09 +0000
    Subject: [PATCH 4271/7878]   While this is a 'proper' change, it breaks 64 bit
     platforms.   Identify as "this will change" with the 1.0 (or 0.10)
     generation.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64290 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_general.h | 11 ++++++++---
     misc/netware/rand.c   |  6 +++++-
     misc/unix/rand.c      |  4 ++++
     misc/win32/rand.c     |  4 ++++
     4 files changed, 21 insertions(+), 4 deletions(-)
    
    diff --git a/include/apr_general.h b/include/apr_general.h
    index d01a0992124..cabdcb95100 100644
    --- a/include/apr_general.h
    +++ b/include/apr_general.h
    @@ -260,14 +260,19 @@ APR_DECLARE(void) apr_terminate2(void);
     
     #if APR_HAS_RANDOM
     
    +#ifdef APR_ENABLE_FOR_1_0
    +APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, 
    +                                                    apr_size_t length);
    +#else
     /* TODO: I'm not sure this is the best place to put this prototype...*/
     /**
      * Generate random bytes.
    - * @param buf Random bytes go here
    - * @param length number of bytes to read
    + * @param buf Buffer to fill with random bytes
    + * @param length Length of buffer in bytes (becomes apr_size_t in APR 1.0)
      */
     APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, 
    -                                                    apr_size_t length);
    +                                                    int length);
    +#endif
     
     #endif
     /** @} */
    diff --git a/misc/netware/rand.c b/misc/netware/rand.c
    index 5042e069cc2..44425ea4a54 100644
    --- a/misc/netware/rand.c
    +++ b/misc/netware/rand.c
    @@ -62,7 +62,11 @@
     #include 
     
     APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, 
    -                                                    apr_size_t length) 
    +#ifdef APR_ENABLE_FOR_1_0
    +                                                    apr_size_t length)
    +#else
    +                                                    int length)
    +#endif
     {
         return NXSeedRandom(length, buf);
     }
    diff --git a/misc/unix/rand.c b/misc/unix/rand.c
    index 0e0683beb28..c8e920c2f16 100644
    --- a/misc/unix/rand.c
    +++ b/misc/unix/rand.c
    @@ -81,7 +81,11 @@
     #if APR_HAS_RANDOM
     
     APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, 
    +#ifdef APR_ENABLE_FOR_1_0
                                                         apr_size_t length)
    +#else
    +                                                    int length)
    +#endif
     {
     #ifdef DEV_RANDOM
     
    diff --git a/misc/win32/rand.c b/misc/win32/rand.c
    index 29999d61b14..fa43aebd944 100644
    --- a/misc/win32/rand.c
    +++ b/misc/win32/rand.c
    @@ -61,7 +61,11 @@
     
     
     APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf,
    +#ifdef APR_ENABLE_FOR_1_0
                                                         apr_size_t length)
    +#else
    +                                                    int length)
    +#endif
     {
         HCRYPTPROV hProv;
         apr_status_t res = APR_SUCCESS;
    
    From d92db6817556e887ca3ec162867f7dc11df31e03 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 13 Jan 2003 18:52:07 +0000
    Subject: [PATCH 4272/7878]   A binary-safe patch that satisfies Jerenkrantz's
     original desire for   more elements, but structured such that we still use
     the optimal platform   element indexes (a machine int is generally faster
     than a fractional int).
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64291 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_hash.h |  2 +-
     tables/apr_hash.c  | 22 ++++++++++------------
     2 files changed, 11 insertions(+), 13 deletions(-)
    
    diff --git a/include/apr_hash.h b/include/apr_hash.h
    index 64fe920bc3e..e3f5d749287 100644
    --- a/include/apr_hash.h
    +++ b/include/apr_hash.h
    @@ -190,7 +190,7 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key,
      * @param ht The hash table
      * @return The number of key/value pairs in the hash table.
      */
    -APR_DECLARE(apr_uint32_t) apr_hash_count(apr_hash_t *ht);
    +APR_DECLARE(unsigned int) apr_hash_count(apr_hash_t *ht);
     
     /**
      * Merge two hash tables into one new hash table. The values of the overlay
    diff --git a/tables/apr_hash.c b/tables/apr_hash.c
    index 0898648e81d..153b96eb764 100644
    --- a/tables/apr_hash.c
    +++ b/tables/apr_hash.c
    @@ -84,7 +84,7 @@ typedef struct apr_hash_entry_t apr_hash_entry_t;
     
     struct apr_hash_entry_t {
         apr_hash_entry_t *next;
    -    apr_uint32_t      hash;
    +    unsigned int      hash;
         const void       *key;
         apr_ssize_t       klen;
         const void       *val;
    @@ -100,7 +100,7 @@ struct apr_hash_entry_t {
     struct apr_hash_index_t {
         apr_hash_t         *ht;
         apr_hash_entry_t   *this, *next;
    -    apr_uint32_t        index;
    +    unsigned int        index;
     };
     
     /*
    @@ -114,7 +114,7 @@ struct apr_hash_t {
         apr_pool_t          *pool;
         apr_hash_entry_t   **array;
         apr_hash_index_t     iterator;  /* For apr_hash_first(NULL, ...) */
    -    apr_uint32_t         count, max;
    +    unsigned int         count, max;
     };
     
     #define INITIAL_MAX 15 /* tunable == 2^n - 1 */
    @@ -124,7 +124,7 @@ struct apr_hash_t {
      * Hash creation functions.
      */
     
    -static apr_hash_entry_t **alloc_array(apr_hash_t *ht, apr_uint32_t max)
    +static apr_hash_entry_t **alloc_array(apr_hash_t *ht, unsigned int max)
     {
        return apr_pcalloc(ht->pool, sizeof(*ht->array) * (max + 1));
     }
    @@ -192,14 +192,12 @@ static void expand_array(apr_hash_t *ht)
     {
         apr_hash_index_t *hi;
         apr_hash_entry_t **new_array;
    -    apr_uint32_t new_max;
    +    unsigned int new_max;
     
         new_max = ht->max * 2 + 1;
         new_array = alloc_array(ht, new_max);
         for (hi = apr_hash_first(NULL, ht); hi; hi = apr_hash_next(hi)) {
    -        apr_uint32_t i;
    -
    -        i = hi->this->hash & new_max;
    +        unsigned int i = hi->this->hash & new_max;
             hi->this->next = new_array[i];
             new_array[i] = hi->this;
         }
    @@ -223,7 +221,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht,
     {
         apr_hash_entry_t **hep, *he;
         const unsigned char *p;
    -    apr_uint32_t hash;
    +    unsigned int hash;
         apr_ssize_t i;
     
         /*
    @@ -304,7 +302,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool,
     {
         apr_hash_t *ht;
         apr_hash_entry_t *new_vals;
    -    apr_uint32_t i, j;
    +    unsigned int i, j;
     
         ht = apr_palloc(pool, sizeof(apr_hash_t) +
                         sizeof(*ht->array) * (orig->max + 1) +
    @@ -371,7 +369,7 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht,
         /* else key not present and val==NULL */
     }
     
    -APR_DECLARE(apr_uint32_t) apr_hash_count(apr_hash_t *ht)
    +APR_DECLARE(unsigned int) apr_hash_count(apr_hash_t *ht)
     {
         return ht->count;
     }
    @@ -398,7 +396,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p,
         apr_hash_entry_t *new_vals = NULL;
         apr_hash_entry_t *iter;
         apr_hash_entry_t *ent;
    -    apr_uint32_t i,j,k;
    +    unsigned int i,j,k;
     
     #ifdef POOL_DEBUG
         /* we don't copy keys and values, so it's necessary that
    
    From 231621d9b4479c6a53bcbf0682ba7c43af7d55bc Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 14 Jan 2003 00:21:26 +0000
    Subject: [PATCH 4273/7878]   Brane is 100% on target... I leave this turned on
     (myself) but it shouldn't   be defined by default!
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64292 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr.hw | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr.hw b/include/apr.hw
    index 58a79f4c4e9..efb1f899e9c 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -195,7 +195,7 @@ extern "C" {
     #define APR_HAVE_IN_ADDR        1
     #define APR_HAVE_INET_ADDR      1
     #define APR_HAVE_INET_NETWORK   0
    -#define APR_HAVE_IPV6           1
    +#define APR_HAVE_IPV6           0
     #define APR_HAVE_MEMMOVE        1
     #define APR_HAVE_SETRLIMIT      0
     #define APR_HAVE_SIGACTION      0
    
    From b3d77d52aa6454997471a6232aa8a944a098d98a Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Tue, 14 Jan 2003 00:38:23 +0000
    Subject: [PATCH 4274/7878] Add the pipe test back in for NetWare
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64293 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/nw_misc.c    | 8 --------
     test/nwgnuaprtest | 2 +-
     2 files changed, 1 insertion(+), 9 deletions(-)
    
    diff --git a/test/nw_misc.c b/test/nw_misc.c
    index dfb6cfe0318..aa211ea9f45 100644
    --- a/test/nw_misc.c
    +++ b/test/nw_misc.c
    @@ -12,11 +12,3 @@ static void test_not_impl(CuTest *tc)
         CuNotImpl(tc, "Test not implemented on this platform yet");
     }
     
    -CuSuite *testpipe(void)
    -{
    -    CuSuite *suite = CuSuiteNew("Pipes");
    -    SUITE_ADD_TEST(suite, test_not_impl);
    -
    -    return suite;
    -}
    -
    diff --git a/test/nwgnuaprtest b/test/nwgnuaprtest
    index 5c63eed7573..bb2546fcf51 100644
    --- a/test/nwgnuaprtest
    +++ b/test/nwgnuaprtest
    @@ -198,10 +198,10 @@ FILES_nlm_objs = \
     	$(OBJDIR)/testuser.o \
     	$(OBJDIR)/testvsn.o \
     	$(OBJDIR)/nw_misc.o \
    +	$(OBJDIR)/testpipe.o \
     	$(EOLIST)
     
     # Pending tests
    -#	$(OBJDIR)/testpipe.o \
     	
     #
     # These are the LIB files needed to create the NLM target above.
    
    From c7fbd894260f1645ea5f4ab0202ab664165aa7b6 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Tue, 14 Jan 2003 00:51:36 +0000
    Subject: [PATCH 4275/7878] Remove the stat info caching for NetWare
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64294 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/netware/filestat.c         | 184 +----------------------------
     file_io/unix/open.c                |  25 ----
     include/apr.hnw                    |   2 -
     include/arch/netware/apr_private.h |   6 -
     misc/netware/libprews.c            |  65 ----------
     5 files changed, 4 insertions(+), 278 deletions(-)
    
    diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c
    index 6b691a9d13e..684d7265944 100644
    --- a/file_io/netware/filestat.c
    +++ b/file_io/netware/filestat.c
    @@ -184,191 +184,17 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname,
         return apr_file_perms_set(fname, finfo.protection);
     }
     
    -int cstat (NXPathCtx_t pathCtx, const char *path, struct stat *buf, char **casedName, apr_pool_t *pool)
    -{
    -    apr_hash_t *statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor);
    -    apr_pool_t *gPool = (apr_pool_t *)getGlobalPool(CpuCurrentProcessor);
    -    apr_stat_entry_t *stat_entry;
    -    struct stat *info;
    -    apr_time_t now = apr_time_now();
    -    char *key;
    -    int ret;
    -    int found = 0;
    -
    -    *casedName = NULL;
    -    errno = 0;
    -
    -    /* If there isn't a global pool then just stat the file
    -       and return */
    -    if (!gPool) {
    -        char poolname[50];
    -
    -        if (apr_pool_create(&gPool, NULL) != APR_SUCCESS) {
    -            ret = getstat(pathCtx, path, buf, ST_STAT_BITS|ST_NAME_BIT);
    -            if (ret == 0) {
    -                *casedName = apr_pstrdup (pool, buf->st_name);
    -                return 0;
    -            }
    -            else {
    -                errno = ret;
    -                return -1;
    -            }
    -        }
    -
    -        sprintf (poolname, "cstat_mem_pool_%d", CpuCurrentProcessor);
    -        apr_pool_tag(gPool, apr_pstrdup(gPool, poolname));
    -
    -        setGlobalPool(gPool, CpuCurrentProcessor);
    -    }
    -
    -    /* If we have a statCache hash table then use it.
    -       Otherwise we need to create it and initialized it
    -       with a new mutex lock. */
    -    if (!statCache) {
    -        statCache = apr_hash_make(gPool);
    -        setStatCache((void*)statCache, CpuCurrentProcessor);
    -    }
    -
    -    /* If we have a statCache then try to pull the information
    -       from the cache.  Otherwise just stat the file and return.*/
    -    if (statCache) {
    -        stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, path, APR_HASH_KEY_STRING);
    -        /* If we got an entry then check the expiration time.  If the entry
    -           hasn't expired yet then copy the information and return. */
    -        if (stat_entry) {
    -            if ((now - stat_entry->expire) <= APR_USEC_PER_SEC) {
    -                memcpy (buf, &(stat_entry->info), sizeof(struct stat));
    -                *casedName = apr_pstrdup (pool, stat_entry->casedName);
    -                found = 1;
    -            }
    -        }
    -
    -        /* Since we are creating a separate stat cache for each processor, we
    -           don't need to worry about locking the hash table before manipulating
    -           it. */
    -        if (!found) {
    -            /* Bind the thread to the current cpu so that we don't wake
    -               up on some other cpu and try to manipulate the wrong cache. */
    -            NXThreadBind (CpuCurrentProcessor);
    -
    -            /* If we don't have a stat_entry then create one, copy
    -               the data and add it to the hash table. */
    -            if (!stat_entry) {
    -                char *dirPath = NULL, *fname = NULL;
    -                char *ptr;
    -                int err, len;
    -
    -                ret = getstat(pathCtx, path, buf, ST_STAT_BITS|ST_NAME_BIT);
    -
    -                if (ret) {
    -                    NXThreadBind (NX_THR_UNBOUND);
    -                    errno = ret;
    -                    return -1;
    -    			}
    -
    -                if (filetype_from_mode(buf->st_mode) == APR_DIR) {
    -                    dirPath = apr_pstrdup (pool, path);
    -                    len = strlen (dirPath) - strlen(buf->st_name);
    -                    dirPath[len-1] = '\0';
    -                }
    -                else if (filetype_from_mode(buf->st_mode) == APR_REG) {
    -                    dirPath = apr_pstrdup (pool, path);
    -                    ptr = strrchr (dirPath, '/');
    -                    if (ptr) {
    -                        *ptr = '\0';
    -                    }
    -                }
    -
    -                err = NXCreatePathContext(pathCtx, dirPath, 0, NULL, &pathCtx);
    -
    -                key = apr_pstrdup (gPool, path);
    -                stat_entry = apr_palloc (gPool, sizeof(apr_stat_entry_t));
    -                memcpy (&(stat_entry->info), buf, sizeof(struct stat));
    -                stat_entry->casedName = (stat_entry->info).st_name;
    -                *casedName = apr_pstrdup(pool, stat_entry->casedName);
    -                stat_entry->expire = now;
    -                if (err == 0) {
    -                    stat_entry->pathCtx = pathCtx;
    -                }
    -                else {
    -                    stat_entry->pathCtx = 0;
    -                }
    -                apr_hash_set(statCache, key, APR_HASH_KEY_STRING, stat_entry);
    -            }
    -            else {
    -                NXDirAttrNks_t dirInfo;
    -
    -                /* If we have a path context then get the info the fast way.  Otherwise 
    -                   just default to getting the stat info from stat() */
    -                if (stat_entry->pathCtx) {
    -                    ret = getstat(stat_entry->pathCtx, stat_entry->casedName, buf, 
    -                                  ST_MODE_BIT|ST_ATIME_BIT|ST_MTIME_BIT|ST_CTIME_BIT|ST_SIZE_BIT|ST_NAME_BIT);
    -                }
    -                else {
    -                    ret = getstat(pathCtx, path, buf, 
    -                                  ST_MODE_BIT|ST_ATIME_BIT|ST_MTIME_BIT|ST_CTIME_BIT|ST_SIZE_BIT|ST_NAME_BIT);
    -                }
    -    
    -                if (ret) {
    -                    NXThreadBind (NX_THR_UNBOUND);
    -                    errno = ret;
    -                    return -1;
    -                }
    -                else {
    -                    (stat_entry->info).st_atime.tv_sec = (buf->st_atime).tv_sec;
    -                    (stat_entry->info).st_mtime.tv_sec = (buf->st_mtime).tv_sec;
    -                    (stat_entry->info).st_ctime.tv_sec = (buf->st_ctime).tv_sec;
    -                    (stat_entry->info).st_size = buf->st_size;
    -                    (stat_entry->info).st_mode = buf->st_mode;
    -                    memcpy ((stat_entry->info).st_name, buf->st_name, sizeof(buf->st_name));
    -                    memcpy (buf, &(stat_entry->info), sizeof(struct stat));
    -                }
    -
    -                /* If we do have a stat_entry then it must have expired.  Just
    -                   copy the data and reset the expiration. */
    -                *casedName = apr_pstrdup(pool, stat_entry->casedName);
    -                stat_entry->expire = now;
    -            }
    -            NXThreadBind (NX_THR_UNBOUND);
    -        }
    -    }
    -    else {
    -        ret = getstat(pathCtx, path, buf, ST_STAT_BITS|ST_NAME_BIT);
    -        if (ret == 0) {
    -            *casedName = apr_pstrdup(pool, buf->st_name);
    -        }
    -        else {
    -            errno = ret;
    -            return -1;
    -        }
    -    }
    -    return 0;
    -}
    -
     APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, 
                                        const char *fname, 
                                        apr_int32_t wanted, apr_pool_t *pool)
     {
         struct stat info;
         int srv;
    -    char *casedName = NULL;
         NXPathCtx_t pathCtx = 0;
    -    int identity;
    -    int ret;
     
         getcwdpath(NULL, &pathCtx, CTX_ACTUAL_CWD);
    -    ret= get_identity (pathCtx, &identity);
    -
    -    if (ret || identity) {
    -        srv = getstat(pathCtx, fname, &info, ST_STAT_BITS|ST_NAME_BIT);
    -        if (srv == 0) {
    -            casedName = apr_pstrdup(pool, info.st_name);
    -        }
    -        errno = srv;
    -    }
    -    else {
    -        srv = cstat(pathCtx, fname, &info, &casedName, pool);
    -    }
    +    srv = getstat(pathCtx, fname, &info, ST_STAT_BITS|ST_NAME_BIT);
    +    errno = srv;
     
         if (srv == 0) {
             finfo->pool = pool;
    @@ -377,10 +203,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo,
             if (wanted & APR_FINFO_LINK)
                 wanted &= ~APR_FINFO_LINK;
             if (wanted & APR_FINFO_NAME) {
    -            if (casedName) {
    -                finfo->name = casedName;
    -                finfo->valid |= APR_FINFO_NAME;
    -            }
    +            finfo->name = apr_pstrdup(pool, info.st_name);
    +            finfo->valid |= APR_FINFO_NAME;
             }
             return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;
         }
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index ce2ffff4066..3ced8dfc9cd 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -105,13 +105,6 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
         apr_status_t rv;
     #endif
     
    -#ifdef NETWARE
    -    apr_hash_t *statCache = NULL;
    -    apr_stat_entry_t *stat_entry = NULL;
    -    NXPathCtx_t pathCtx = 0;
    -    int identity;
    -#endif
    -
         if ((flag & APR_READ) && (flag & APR_WRITE)) {
             oflags = O_RDWR;
         }
    @@ -157,30 +150,12 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
         }
     #endif
     
    -#ifdef NETWARE
    -    if (!getcwdpath(NULL, &pathCtx, CTX_ACTUAL_CWD) &&
    -        !get_identity (pathCtx, &identity) && !identity) {
    -
    -        statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor);
    -        if (statCache) {
    -            stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, fname, APR_HASH_KEY_STRING);
    -        }
    -    }
    -
    -    if (stat_entry) {
    -        errno = NXFileOpen (stat_entry->pathCtx, stat_entry->casedName, oflags, &fd);
    -    }
    -    else {
    -#endif
         if (perm == APR_OS_DEFAULT) {
             fd = open(fname, oflags, 0666);
         }
         else {
             fd = open(fname, oflags, apr_unix_perms2mode(perm));
         } 
    -#ifdef NETWARE
    -    }
    -#endif
         if (fd < 0) {
            return errno;
         }
    diff --git a/include/apr.hnw b/include/apr.hnw
    index 556619f0566..41317104bc2 100644
    --- a/include/apr.hnw
    +++ b/include/apr.hnw
    @@ -362,8 +362,6 @@ extern void *gLibHandle;
     
     typedef struct app_data {
         int     initialized;
    -    void*   gPool[MAX_PROCESSORS];
    -    void*   statCache[MAX_PROCESSORS];
         void*   gs_aHooksToSort;
         void*   gs_phOptionalHooks;
         void*   gs_phOptionalFunctions;
    diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h
    index 6171c0d929e..df5169c8ca8 100644
    --- a/include/arch/netware/apr_private.h
    +++ b/include/arch/netware/apr_private.h
    @@ -165,12 +165,6 @@ void netware_pool_proc_cleanup ();
     int register_NLM(void *NLMHandle);
     int unregister_NLM(void *NLMHandle);
     
    -/* Application global data management */
    -int setGlobalPool(void *data, int proc);
    -void* getGlobalPool(int proc);
    -int setStatCache(void *data, int proc);
    -void* getStatCache(int proc);
    -
     /* Redefine malloc to use the library malloc call so 
         that all of the memory resources will be owned
         and can be shared by the library. */
    diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c
    index 0818babbb06..bf872c44e47 100644
    --- a/misc/netware/libprews.c
    +++ b/misc/netware/libprews.c
    @@ -144,71 +144,6 @@ int DisposeLibraryData(void *data)
         return 0;
     }
     
    -int setGlobalPool(void *data, int proc)
    -{
    -    APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId);
    -
    -    if ((proc < 0) || (proc > (MAX_PROCESSORS-1))) {
    -        return 0;
    -    }
    -
    -    NXLock(gLibLock);
    -
    -    if (app_data && !app_data->gPool[proc]) {
    -        app_data->gPool[proc] = data;
    -    }
    -
    -    NXUnlock(gLibLock);
    -    return 1;
    -}
    -
    -void* getGlobalPool(int proc)
    -{
    -    APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId);
    -
    -    if ((proc < 0) || (proc > (MAX_PROCESSORS-1))) {
    -        return NULL;
    -    }
    -
    -    if (app_data) {
    -        return app_data->gPool[proc];
    -    }
    -
    -    return NULL;
    -}
    -
    -int setStatCache(void *data, int proc)
    -{
    -    APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId);
    -
    -    if ((proc < 0) || (proc > (MAX_PROCESSORS-1))) {
    -        return 0;
    -    }
    -
    -    NXLock(gLibLock);
    -
    -    if (app_data && !app_data->statCache[proc]) {
    -        app_data->statCache[proc] = data;
    -    }
    -
    -    NXUnlock(gLibLock);
    -    return 1;
    -}
    -
    -void* getStatCache(int proc)
    -{
    -    APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId);
    -
    -    if ((proc < 0) || (proc > (MAX_PROCESSORS-1))) {
    -        return NULL;
    -    }
    -
    -    if (app_data) {
    -        return app_data->statCache[proc];
    -    }
    -
    -    return NULL;
    -}
     
     
     
    
    From d7f484f25e7df38622b188f7b41d1b9671ce96d2 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 14 Jan 2003 03:30:01 +0000
    Subject: [PATCH 4276/7878]   Add the apr_app targets (which allow us to clean
     up the args, and should   at some point allow us to host WinNT services as
     'daemons' with the app   totally ignorant of WinNT.)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64295 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr.dsw | 30 ++++++++++++++++++++++++++++++
     1 file changed, 30 insertions(+)
    
    diff --git a/apr.dsw b/apr.dsw
    index 3688d9e61ad..dc0871bbc88 100644
    --- a/apr.dsw
    +++ b/apr.dsw
    @@ -15,6 +15,21 @@ Package=<4>
     
     ###############################################################################
     
    +Project: "apr_app"=".\build\apr_app.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +    Begin Project Dependency
    +    Project_Dep_Name apr
    +    End Project Dependency
    +}}}
    +
    +###############################################################################
    +
     Project: "libapr"=".\libapr.dsp" - Package Owner=<4>
     
     Package=<5>
    @@ -27,6 +42,21 @@ Package=<4>
     
     ###############################################################################
     
    +Project: "libapr_app"=".\build\libapr_app.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +    Begin Project Dependency
    +    Project_Dep_Name libapr
    +    End Project Dependency
    +}}}
    +
    +###############################################################################
    +
     Global:
     
     Package=<5>
    
    From 663044bba42bd15bb111b9c4a1e782a7cd5270cb Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Tue, 14 Jan 2003 11:17:10 +0000
    Subject: [PATCH 4277/7878] OS/2: Enable inline assembly version of atomics as
     they work well with EMX GCC.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64296 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_atomic.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr_atomic.h b/include/apr_atomic.h
    index c58b1fc6ecc..be419bf56bd 100644
    --- a/include/apr_atomic.h
    +++ b/include/apr_atomic.h
    @@ -206,7 +206,7 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp)
     #define apr_atomic_set(mem, val)     atomic_set_int(mem, val)
     #define apr_atomic_read(mem)         (*mem)
     
    -#elif defined(__linux__) && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC
    +#elif (defined(__linux__) || defined(__EMX__)) && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC
     
     #define apr_atomic_t apr_uint32_t
     #define apr_atomic_cas(mem,with,cmp) \
    
    From 1113ddd7851eb91bfa7e5ae61baba8e2042cda81 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Tue, 14 Jan 2003 18:35:39 +0000
    Subject: [PATCH 4278/7878] Always load the NLM detached so that we don't have
     to wait for it to clean up when it terminates.  Also check for the correct
     return value for procve()
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64297 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/netware/proc.c | 7 +++++--
     1 file changed, 5 insertions(+), 2 deletions(-)
    
    diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c
    index 782e05bbd7b..4ca612d644d 100644
    --- a/threadproc/netware/proc.c
    +++ b/threadproc/netware/proc.c
    @@ -301,7 +301,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
         newproc->out = attr->parent_out;
         newproc->err = attr->parent_err;
     
    -    addr_space = (attr->detached ? 0 : PROC_CURRENT_SPACE) | PROC_LOAD_SILENT;
    +    /* attr->detached and PROC_DETACHED do not mean the same thing.  attr->detached means
    +     * start the NLM in a separate address space.  PROC_DETACHED means don't wait for the
    +     * NLM to unload by calling wait() or waitpid(), just clean up */
    +    addr_space = (attr->detached ? 0 : PROC_CURRENT_SPACE) | PROC_LOAD_SILENT | PROC_DETACHED;
     
         if (attr->currdir) {
             char *fullpath = NULL;
    @@ -315,7 +318,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
         } 
     
         if ((newproc->pid = procve(progname, addr_space, (const char**)env, &wire, 
    -        NULL, NULL, 0, NULL, (const char **)args)) == 0) {
    +        NULL, NULL, 0, NULL, (const char **)args)) == -1) {
             return errno;
         }
     
    
    From 25bc5030fad9dafb6b43fe5e2bae6dfe264d4a09 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Wed, 15 Jan 2003 14:00:55 +0000
    Subject: [PATCH 4279/7878] Fix misdetection of strerror_r return type with
     glibc 2.3 (which meant corrupt error messages).
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64298 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_common.m4 | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/build/apr_common.m4 b/build/apr_common.m4
    index 3d7b56e677e..afbebe481b7 100644
    --- a/build/apr_common.m4
    +++ b/build/apr_common.m4
    @@ -454,6 +454,7 @@ AC_DEFUN(APR_CHECK_STRERROR_R_RC,[
     AC_MSG_CHECKING(for type of return code from strerror_r)
     AC_TRY_RUN([
     #include 
    +#include 
     #include 
     main()
     {
    
    From b241925378de6bf8c34e304e0a1e94425de0195a Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Thu, 16 Jan 2003 11:39:42 +0000
    Subject: [PATCH 4280/7878] Fix the time vs apr_time_now comparison to really
     allow 1 second of leeway.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64299 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testtime.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/testtime.c b/test/testtime.c
    index cb11bfd5a59..5bb7ef8b5b1 100644
    --- a/test/testtime.c
    +++ b/test/testtime.c
    @@ -103,7 +103,7 @@ static void test_now(CuTest *tc)
          * 1 second.
          */
         CuAssert(tc, "apr_time and OS time do not agree", 
    -             (timediff > -1) && (timediff < 1));
    +             (timediff > -2) && (timediff < 2));
     }
     
     static void test_gmtstr(CuTest *tc)
    
    From 2d8f933d9ced361d2383c61c7359e3ee8095d98a Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 20 Jan 2003 18:36:09 +0000
    Subject: [PATCH 4281/7878]   Allow the 'filename' to include extensions,
     observed by Mladen Turk.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64301 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/win32ver.awk | 7 ++++++-
     1 file changed, 6 insertions(+), 1 deletion(-)
    
    diff --git a/build/win32ver.awk b/build/win32ver.awk
    index 19ab3ebc1cd..e41811df01f 100644
    --- a/build/win32ver.awk
    +++ b/build/win32ver.awk
    @@ -12,6 +12,11 @@ BEGIN {
       desc=ARGV[2];
       rel_h=ARGV[3];
     
    +  filename = file;
    +  if (match(file, /\./)) {
    +    sub(/\.[^\.]*$/, "", file);
    +  }
    +
       i = 4;
       while (length(ARGV[i])) {
         if (match(ARGV[i], /icon=/)) {
    @@ -93,7 +98,7 @@ BEGIN {
       print "      VALUE \"InternalName\", \"" file "\\0\"";
       print "      VALUE \"LegalCopyright\", \"Copyright © 2000-2003 "\
             "The Apache Software Foundation.\\0\"";
    -  print "      VALUE \"OriginalFilename\", \"" file ".exe\\0\"";
    +  print "      VALUE \"OriginalFilename\", \"" filename "\\0\"";
       if (vendor) {
         print "      VALUE \"PrivateBuild\", \"" vendor "\\0\"";
       }
    
    From 3a846032bcd62cf872a37e0f5a93b087433e87b7 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 20 Jan 2003 18:37:26 +0000
    Subject: [PATCH 4282/7878]   Identify libapr as a .dll, not an .exe. 
     Submitted by Mladen Turk.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64302 13f79535-47bb-0310-9956-ffa450edef68
    ---
     libapr.dsp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/libapr.dsp b/libapr.dsp
    index 2bb5c0a00e4..b0f5d5232cc 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -608,7 +608,7 @@ SOURCE=.\build\win32ver.awk
     InputPath=.\build\win32ver.awk
     
     ".\libapr.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
    -	awk -f ./build/win32ver.awk libapr "Apache Portability Runtime Library"  ../../include/ap_release.h > .\libapr.rc
    +	awk -f ./build/win32ver.awk libapr.dll "Apache Portability Runtime Library"  ../../include/ap_release.h > .\libapr.rc
     
     # End Custom Build
     
    
    From d03f3176bb533dbef1f401a1fefb2ea7b281ea8b Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 20 Jan 2003 18:38:46 +0000
    Subject: [PATCH 4283/7878]   Identify libapr as a .dll, not an .exe. 
     Submitted by Mladen Turk.   [Already fixed one case, had forgotten the
     other.]
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64303 13f79535-47bb-0310-9956-ffa450edef68
    ---
     libapr.dsp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/libapr.dsp b/libapr.dsp
    index b0f5d5232cc..6384a5640ed 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -619,7 +619,7 @@ InputPath=.\build\win32ver.awk
     InputPath=.\build\win32ver.awk
     
     ".\libapr.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
    -	awk -f ./build/win32ver.awk libapr "Apache Portability Runtime Library"  ../../include/ap_release.h > .\libapr.rc
    +	awk -f ./build/win32ver.awk libapr.dll "Apache Portability Runtime Library"  ../../include/ap_release.h > .\libapr.rc
     
     # End Custom Build
     
    
    From 74992d072c089c73f710dd3b35a38571f181c060 Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Wed, 22 Jan 2003 17:50:29 +0000
    Subject: [PATCH 4284/7878] I'm content to remove this showstopper now that we
     have the versioning bits mostly in place.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64304 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 18 +-----------------
     1 file changed, 1 insertion(+), 17 deletions(-)
    
    diff --git a/STATUS b/STATUS
    index 719900b70a8..2f7e89f5f2f 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -1,5 +1,5 @@
     APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS:			-*-text-*-
    -Last modified at [$Date: 2002/12/10 20:32:40 $]
    +Last modified at [$Date: 2003/01/22 17:50:29 $]
     
     Release:
     
    @@ -57,7 +57,6 @@ RELEASE SHOWSTOPPERS:
           further renames?
     
           1.0 showstopper (not 0.9.0): gstein
    -       
     
         * When Win32 apr_proc_create was fixed, the apr_proc_t hproc
           member was added for that platform.  That's a problem (and
    @@ -68,21 +67,6 @@ RELEASE SHOWSTOPPERS:
     
           1.0 showstopper (not 0.9.0): gstein
     
    -    * Change apr_initialize to take the expected version (in some form)
    -      and return an error code if the requirement isn't satisfied.
    -
    -      gstein: -1
    -
    -      Justin says: "Relying solely on the run-time linker isn't enough
    -                    to guarantee versioning."
    -      Greg says: "yup. but now the libraries have different names.
    -                  -lapr-1 and -lapr-2. further, we can always add a
    -                  utility function to check (the minor rev), rather
    -                  than monkey with the initialization itself. the
    -		  runtime linker will catch new function requirements
    -		  across minor rev upgrades, but will not catch new
    -		  constants."
    -
         * For 1.0, clean up ability to specify protocol for a socket by
           axing apr_socket_create_ex(), adding protocol parm to 
           apr_socket_create(), and enabling protocol field in 
    
    From 52f04e30aad086e9fdf66db391b13fe2c003f0de Mon Sep 17 00:00:00 2001
    From: Thom May 
    Date: Wed, 22 Jan 2003 18:25:59 +0000
    Subject: [PATCH 4285/7878] Only include sys/syslimits.h if we don't have
     limits.h Submitted by: Garrett Rooney, Craig Rodrigues Reviewed by: Thom May
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64305 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES          | 4 ++++
     include/apr.h.in | 5 +++--
     2 files changed, 7 insertions(+), 2 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 9278595ebc0..3f38cb1e507 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,9 @@
     Changes with APR 0.9.2
     
    +  *) Only include sys/syslimits.h if we don't have limits.h
    +     [Craig Rodrigues , Garrett Rooney 
    +     , Thom May]
    +
       *) Allow apr-config to work in symlinked install directories when
          'realpath' is available.  [Justin Erenkrantz]
     
    diff --git a/include/apr.h.in b/include/apr.h.in
    index 984c903b958..ced68b1e36d 100644
    --- a/include/apr.h.in
    +++ b/include/apr.h.in
    @@ -304,11 +304,12 @@ typedef  @socklen_t_value@       apr_socklen_t;
     #endif
     
     /* header files for PATH_MAX, _POSIX_PATH_MAX */
    +#if APR_HAVE_LIMITS_H
    +#include 
    +#else
     #if APR_HAVE_SYS_SYSLIMITS_H
     #include 
     #endif
    -#if APR_HAVE_LIMITS_H
    -#include 
     #endif
     
     #if defined(PATH_MAX)
    
    From a1c31557e3ca845141b1e05fc5b73d1659ef4985 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 22 Jan 2003 19:11:02 +0000
    Subject: [PATCH 4286/7878]   What an ugly patch.
    
      Reintroduce the broken is_dst exported value for Win9x/ME until a better
      solution is found.  This clears up a segfault for Win9x attempting to
      unpack times, while preserving the *good* behavior for WinNT in divining
      the correct DST flag.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64306 13f79535-47bb-0310-9956-ffa450edef68
    ---
     time/win32/time.c | 107 +++++++++++++++++++++++++++++++++-------------
     1 file changed, 77 insertions(+), 30 deletions(-)
    
    diff --git a/time/win32/time.c b/time/win32/time.c
    index 157a583de1a..c2250bf6a7b 100644
    --- a/time/win32/time.c
    +++ b/time/win32/time.c
    @@ -72,6 +72,7 @@
      */
     #define IsLeapYear(y) ((!(y % 4)) ? (((!(y % 400)) && (y % 100)) ? 1 : 0) : 0)
     
    +#if APR_HAS_UNICODE_FS
     static LPTIME_ZONE_INFORMATION GetLocalTimeZone()
     {
         static int init = 0;
    @@ -83,6 +84,7 @@ static LPTIME_ZONE_INFORMATION GetLocalTimeZone()
         }
         return &tz;
     }
    +#endif
     
     static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm)
     {
    @@ -169,40 +171,85 @@ APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result,
     APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
                                               apr_time_t input)
     {
    -    SYSTEMTIME st, localst;
    +    SYSTEMTIME st;
         FILETIME ft, localft;
    -    TIME_ZONE_INFORMATION *tz;
    -    apr_time_t localtime;
     
    -    tz = GetLocalTimeZone();
         AprTimeToFileTime(&ft, input);
    -    FileTimeToSystemTime(&ft, &st);
    -
    -    /* The Platform SDK documents that SYSTEMTIME/FILETIME are
    -     * generally UTC.  We use SystemTimeToTzSpecificLocalTime
    -     * because FileTimeToLocalFileFime is documented that the
    -     * resulting time local file time would have DST relative
    -     * to the *present* date, not the date converted.
    -     */
    -    SystemTimeToTzSpecificLocalTime(tz, &st, &localst);
    -    SystemTimeToAprExpTime(result, &localst);
    -    result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC);
     
    -    /* Recover the resulting time as an apr time and use the
    -     * delta for gmtoff in seconds (and ignore msec rounding) 
    -     */
    -    SystemTimeToFileTime(&localst, &localft);
    -    FileTimeToAprTime(&localtime, &localft);
    -    result->tm_gmtoff = (int)apr_time_sec(localtime) 
    -                      - (int)apr_time_sec(input);
    -
    -    /* To compute the dst flag, we compare the expected 
    -     * local (standard) timezone bias to the delta.
    -     * [Note, in war time or double daylight time the
    -     * resulting tm_isdst is, desireably, 2 hours]
    -     */
    -    result->tm_isdst = (result->tm_gmtoff / 3600)
    -                     - (-(tz->Bias + tz->StandardBias) / 60);
    +#if APR_HAS_UNICODE_FS
    +    IF_WIN_OS_IS_UNICODE
    +    {
    +        SYSTEMTIME localst;
    +        apr_time_t localtime;
    +        TIME_ZONE_INFORMATION *tz;
    +
    +        tz = GetLocalTimeZone();
    +
    +        FileTimeToSystemTime(&ft, &st);
    +
    +        /* The Platform SDK documents that SYSTEMTIME/FILETIME are
    +         * generally UTC.  We use SystemTimeToTzSpecificLocalTime
    +         * because FileTimeToLocalFileFime is documented that the
    +         * resulting time local file time would have DST relative
    +         * to the *present* date, not the date converted.
    +         */
    +        SystemTimeToTzSpecificLocalTime(tz, &st, &localst);
    +        SystemTimeToAprExpTime(result, &localst);
    +        result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC);
    +
    +
    +        /* Recover the resulting time as an apr time and use the
    +         * delta for gmtoff in seconds (and ignore msec rounding) 
    +         */
    +        SystemTimeToFileTime(&localst, &localft);
    +        FileTimeToAprTime(&localtime, &localft);
    +        result->tm_gmtoff = (int)apr_time_sec(localtime) 
    +                          - (int)apr_time_sec(input);
    +
    +        /* To compute the dst flag, we compare the expected 
    +         * local (standard) timezone bias to the delta.
    +         * [Note, in war time or double daylight time the
    +         * resulting tm_isdst is, desireably, 2 hours]
    +         */
    +        result->tm_isdst = (result->tm_gmtoff / 3600)
    +                         - (-(tz->Bias + tz->StandardBias) / 60);
    +    }
    +#endif
    +#if APR_HAS_ANSI_FS
    +    ELSE_WIN_OS_IS_ANSI
    +    {
    +	TIME_ZONE_INFORMATION tz;
    +
    +	/* XXX: This code is simply *wrong*.  The time converted will always
    +         * map to the *now current* status of daylight savings time.
    +         */
    +
    +        FileTimeToLocalFileTime(&ft, &localft);
    +        FileTimeToSystemTime(&localft, &st);
    +        SystemTimeToAprExpTime(result, &st, 1);
    +        result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC);
    +
    +        switch (GetTimeZoneInformation(&tz)) {   
    +            case TIME_ZONE_ID_UNKNOWN:   
    +                xt->tm_isdst = 0;   
    +                /* Bias = UTC - local time in minutes   
    +                 * tm_gmtoff is seconds east of UTC   
    +                 */   
    +                xt->tm_gmtoff = tz.Bias * -60;   
    +                break;   
    +            case TIME_ZONE_ID_STANDARD:   
    +                xt->tm_isdst = 0;   
    +                xt->tm_gmtoff = (tz.Bias + tz.StandardBias) * -60;   
    +                break;   
    +            case TIME_ZONE_ID_DAYLIGHT:   
    +                xt->tm_isdst = 1;   
    +                xt->tm_gmtoff = (tz.Bias + tz.DaylightBias) * -60;   
    +                break;   
    +            default:   
    +                /* noop */;
    +        }   
    +    }
    +#endif
     
         return APR_SUCCESS;
     }
    
    From 75abea94970ca0576141e2fc4fa7ff396a8ea58e Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 22 Jan 2003 19:17:55 +0000
    Subject: [PATCH 4287/7878]   Now that the old logic is restored, adjust it to
     the new variables.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64307 13f79535-47bb-0310-9956-ffa450edef68
    ---
     time/win32/time.c | 14 +++++++-------
     1 file changed, 7 insertions(+), 7 deletions(-)
    
    diff --git a/time/win32/time.c b/time/win32/time.c
    index c2250bf6a7b..df5d5684d98 100644
    --- a/time/win32/time.c
    +++ b/time/win32/time.c
    @@ -226,24 +226,24 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
     
             FileTimeToLocalFileTime(&ft, &localft);
             FileTimeToSystemTime(&localft, &st);
    -        SystemTimeToAprExpTime(result, &st, 1);
    +        SystemTimeToAprExpTime(result, &st);
             result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC);
     
             switch (GetTimeZoneInformation(&tz)) {   
                 case TIME_ZONE_ID_UNKNOWN:   
    -                xt->tm_isdst = 0;   
    +                result->tm_isdst = 0;   
                     /* Bias = UTC - local time in minutes   
                      * tm_gmtoff is seconds east of UTC   
                      */   
    -                xt->tm_gmtoff = tz.Bias * -60;   
    +                result->tm_gmtoff = tz.Bias * -60;   
                     break;   
                 case TIME_ZONE_ID_STANDARD:   
    -                xt->tm_isdst = 0;   
    -                xt->tm_gmtoff = (tz.Bias + tz.StandardBias) * -60;   
    +                result->tm_isdst = 0;   
    +                result->tm_gmtoff = (tz.Bias + tz.StandardBias) * -60;   
                     break;   
                 case TIME_ZONE_ID_DAYLIGHT:   
    -                xt->tm_isdst = 1;   
    -                xt->tm_gmtoff = (tz.Bias + tz.DaylightBias) * -60;   
    +                result->tm_isdst = 1;   
    +                result->tm_gmtoff = (tz.Bias + tz.DaylightBias) * -60;   
                     break;   
                 default:   
                     /* noop */;
    
    From 3ceab589975e61cd78b7e578fb9ca2e21fffe4ff Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 22 Jan 2003 19:39:43 +0000
    Subject: [PATCH 4288/7878]   Finally, use the same cached recovery for the
     timezone between 9x and NT.   The 9x code is just wrong, so this change
     doesn't make worse.
    
      Anyone with interest in helping tear away this problem, please speak up.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64308 13f79535-47bb-0310-9956-ffa450edef68
    ---
     time/win32/time.c | 55 +++++++++++++++++++++++------------------------
     1 file changed, 27 insertions(+), 28 deletions(-)
    
    diff --git a/time/win32/time.c b/time/win32/time.c
    index df5d5684d98..3121c43aa14 100644
    --- a/time/win32/time.c
    +++ b/time/win32/time.c
    @@ -72,19 +72,20 @@
      */
     #define IsLeapYear(y) ((!(y % 4)) ? (((!(y % 400)) && (y % 100)) ? 1 : 0) : 0)
     
    -#if APR_HAS_UNICODE_FS
    -static LPTIME_ZONE_INFORMATION GetLocalTimeZone()
    +static DWORD get_local_timezone(TIME_ZONE_INFORMATION **tzresult)
     {
    -    static int init = 0;
         static TIME_ZONE_INFORMATION tz;
    +    static DWORD result;
    +    static int init = 0;
     
         if (!init) {
    -        GetTimeZoneInformation(&tz);
    +        result = GetTimeZoneInformation(&tz);
             init = 1;
         }
    -    return &tz;
    +
    +    *tzresult = &tz;
    +    return result;
     }
    -#endif
     
     static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm)
     {
    @@ -173,6 +174,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
     {
         SYSTEMTIME st;
         FILETIME ft, localft;
    +    TIME_ZONE_INFORMATION *tz;
     
         AprTimeToFileTime(&ft, input);
     
    @@ -181,9 +183,8 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
         {
             SYSTEMTIME localst;
             apr_time_t localtime;
    -        TIME_ZONE_INFORMATION *tz;
     
    -        tz = GetLocalTimeZone();
    +        get_local_timezone(&tz);
     
             FileTimeToSystemTime(&ft, &st);
     
    @@ -218,8 +219,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
     #if APR_HAS_ANSI_FS
         ELSE_WIN_OS_IS_ANSI
         {
    -	TIME_ZONE_INFORMATION tz;
    -
     	/* XXX: This code is simply *wrong*.  The time converted will always
              * map to the *now current* status of daylight savings time.
              */
    @@ -229,25 +228,25 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
             SystemTimeToAprExpTime(result, &st);
             result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC);
     
    -        switch (GetTimeZoneInformation(&tz)) {   
    -            case TIME_ZONE_ID_UNKNOWN:   
    -                result->tm_isdst = 0;   
    -                /* Bias = UTC - local time in minutes   
    -                 * tm_gmtoff is seconds east of UTC   
    -                 */   
    -                result->tm_gmtoff = tz.Bias * -60;   
    -                break;   
    -            case TIME_ZONE_ID_STANDARD:   
    -                result->tm_isdst = 0;   
    -                result->tm_gmtoff = (tz.Bias + tz.StandardBias) * -60;   
    -                break;   
    -            case TIME_ZONE_ID_DAYLIGHT:   
    -                result->tm_isdst = 1;   
    -                result->tm_gmtoff = (tz.Bias + tz.DaylightBias) * -60;   
    -                break;   
    -            default:   
    +        switch (get_local_timezone(&tz)) {
    +            case TIME_ZONE_ID_UNKNOWN:
    +                result->tm_isdst = 0;
    +                /* Bias = UTC - local time in minutes
    +                 * tm_gmtoff is seconds east of UTC
    +                 */
    +                result->tm_gmtoff = tz->Bias * -60;
    +                break;
    +            case TIME_ZONE_ID_STANDARD:
    +                result->tm_isdst = 0;
    +                result->tm_gmtoff = (tz->Bias + tz->StandardBias) * -60;
    +                break;
    +            case TIME_ZONE_ID_DAYLIGHT:
    +                result->tm_isdst = 1;
    +                result->tm_gmtoff = (tz->Bias + tz->DaylightBias) * -60;
    +                break;
    +            default:
                     /* noop */;
    -        }   
    +        }
         }
     #endif
     
    
    From 080c4eaa3c0576f78085d6db5c7a9d76ad77f0f8 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 22 Jan 2003 22:12:13 +0000
    Subject: [PATCH 4289/7878]   Don't use the optimized form.  If Apache is
     started in ST and runs until   DST (ok, this is Win9x, don't laugh to hard),
     then even 'Time Now' will   be in the wrong timezone.  (NT code doesn't
     suffer from this problem,   although changing the -time zone- wouldn't affect
     the running instance   of Apache, which would remain on the old timezone.)
    
      Solving this might be a puzzle for the parent process to pick up such
      system config change notifications, and cycle over to a new child.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64309 13f79535-47bb-0310-9956-ffa450edef68
    ---
     time/win32/time.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/time/win32/time.c b/time/win32/time.c
    index 3121c43aa14..178b2a48f12 100644
    --- a/time/win32/time.c
    +++ b/time/win32/time.c
    @@ -228,7 +228,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
             SystemTimeToAprExpTime(result, &st);
             result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC);
     
    -        switch (get_local_timezone(&tz)) {
    +        switch (GetTimeZoneInformation(&tz)) {
                 case TIME_ZONE_ID_UNKNOWN:
                     result->tm_isdst = 0;
                     /* Bias = UTC - local time in minutes
    
    From a3c701f0d2cd377a69614d4d3bf59345244973a9 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 23 Jan 2003 03:26:21 +0000
    Subject: [PATCH 4290/7878]   After further evaluation, we will have to create
     our own implementation   of SystemTimeToTzSpecificLocalTime() for Win9x.  Get
     the code building   cleanly until that happens.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64310 13f79535-47bb-0310-9956-ffa450edef68
    ---
     time/win32/time.c | 9 +++++----
     1 file changed, 5 insertions(+), 4 deletions(-)
    
    diff --git a/time/win32/time.c b/time/win32/time.c
    index 178b2a48f12..b5beb4c71ed 100644
    --- a/time/win32/time.c
    +++ b/time/win32/time.c
    @@ -174,13 +174,13 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
     {
         SYSTEMTIME st;
         FILETIME ft, localft;
    -    TIME_ZONE_INFORMATION *tz;
     
         AprTimeToFileTime(&ft, input);
     
     #if APR_HAS_UNICODE_FS
         IF_WIN_OS_IS_UNICODE
         {
    +        TIME_ZONE_INFORMATION *tz;
             SYSTEMTIME localst;
             apr_time_t localtime;
     
    @@ -219,6 +219,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
     #if APR_HAS_ANSI_FS
         ELSE_WIN_OS_IS_ANSI
         {
    +        TIME_ZONE_INFORMATION tz;
     	/* XXX: This code is simply *wrong*.  The time converted will always
              * map to the *now current* status of daylight savings time.
              */
    @@ -234,15 +235,15 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
                     /* Bias = UTC - local time in minutes
                      * tm_gmtoff is seconds east of UTC
                      */
    -                result->tm_gmtoff = tz->Bias * -60;
    +                result->tm_gmtoff = tz.Bias * -60;
                     break;
                 case TIME_ZONE_ID_STANDARD:
                     result->tm_isdst = 0;
    -                result->tm_gmtoff = (tz->Bias + tz->StandardBias) * -60;
    +                result->tm_gmtoff = (tz.Bias + tz.StandardBias) * -60;
                     break;
                 case TIME_ZONE_ID_DAYLIGHT:
                     result->tm_isdst = 1;
    -                result->tm_gmtoff = (tz->Bias + tz->DaylightBias) * -60;
    +                result->tm_gmtoff = (tz.Bias + tz.DaylightBias) * -60;
                     break;
                 default:
                     /* noop */;
    
    From 9bb96a8e8b3e9e42b04127bfaa222bda440bb2b3 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 23 Jan 2003 04:07:21 +0000
    Subject: [PATCH 4291/7878]   Meant to do this earlier today.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64311 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 22 +++++++++++++++++++++-
     1 file changed, 21 insertions(+), 1 deletion(-)
    
    diff --git a/STATUS b/STATUS
    index 2f7e89f5f2f..d01d13c2ced 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -1,5 +1,5 @@
     APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS:			-*-text-*-
    -Last modified at [$Date: 2003/01/22 17:50:29 $]
    +Last modified at [$Date: 2003/01/23 04:07:21 $]
     
     Release:
     
    @@ -77,6 +77,26 @@ RELEASE SHOWSTOPPERS:
     CURRENT VOTES:
     
     
    +CURRENT test/testall -v EXCEPTIONS:
    +
    +    Please add any platform anomilies to the following exception list.
    +
    +    * All platforms fail tests in time: test_localstr and test_ctime
    +        Imaginary... the tests can only succeed on machines configured
    +        for the Pacific (US) timezone.  Test needs to be restructured.
    +        Ignore these errors.
    +
    +    * BUG: Win32 fails test in File Info: test_stat_eq_finfo
    +        apr_stat and apr_getfileinfo differ in protection ... wrowe
    +        guesses that we are checking the handle objects' permissions
    +        rather than the filesystem objects' permissions.
    +
    +    * Win32 Not Implemented tests 
    +        Socket Creation: tcp6_socket and udp6_socket (at least by default)
    +        Socket Options: corkable: TCP isn't corkable
    +        Users: username: Groups from apr_uid_get not implemented
    +
    +
     RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
     
         * Someone needs to port testucs to Unix. Right now it only works
    
    From 7bf2b907a733c1d943c2144215a3d0765a8d2329 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Thu, 23 Jan 2003 16:46:36 +0000
    Subject: [PATCH 4292/7878] proc_mutex support on NetWare
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64312 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/STATUS b/STATUS
    index d01d13c2ced..9f6a80726c6 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -1,5 +1,5 @@
     APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS:			-*-text-*-
    -Last modified at [$Date: 2003/01/23 04:07:21 $]
    +Last modified at [$Date: 2003/01/23 16:46:36 $]
     
     Release:
     
    @@ -119,6 +119,9 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
           not yet complete on all platforms. Components that are incomplete
           or missing include:
           Netware: apr_proc_mutex_*() (Is proc_mutex unnecessary on Netware?)
    +		* proc_mutex is not necessary on NetWare since the OS does
    +		  not support processes.  The proc_mutex APIs actually
    +		  redirect to the thread_mutex APIs. (bnicholes)
           OS/2: apr_thread_cond_*(), apr_proc_mutex_*()
     
           Less critical components that we may wish to add at some point:
    
    From f6131ee397dcd24a9a9d4715356915b39d9814bd Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 24 Jan 2003 17:15:56 +0000
    Subject: [PATCH 4293/7878]   Eliminate open_nt_process_pipe and give
     apr_create_nt_pipe a very similar   blocking argument.  Fixes mixed blocking
     modes for the child stdin pipe   and creates full blocking pipes with
     apr_file_pipe_create, just as on Unix.   Corrects the bug introduced in
     file_io/win32/pipe.c rev 1.46 - as process   std handles should never be
     created async (nonblocking, or overlapped.)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64313 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/pipe.c                  | 13 +++---
     include/arch/win32/apr_arch_file_io.h | 24 ++++++++++-
     threadproc/win32/proc.c               | 59 +++++++++------------------
     3 files changed, 50 insertions(+), 46 deletions(-)
    
    diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c
    index 2e87766110c..b4da558adae 100644
    --- a/file_io/win32/pipe.c
    +++ b/file_io/win32/pipe.c
    @@ -89,7 +89,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int
     
     APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *p)
     {
    -    return apr_create_nt_pipe(in, out, TRUE, TRUE, p);
    +    /* Unix creates full blocking pipes. */
    +    return apr_create_nt_pipe(in, out, APR_FULL_BLOCK, p);
     }
     
     /* apr_create_nt_pipe()
    @@ -111,7 +112,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out
      * have to poll the pipe to detect i/o on a non-blocking pipe.
      */
     apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, 
    -                                BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, 
    +                                apr_int32_t blocking_mode, 
                                     apr_pool_t *p)
     {
     #ifdef _WIN32_WCE
    @@ -156,7 +157,8 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out,
         if (apr_os_level >= APR_WIN_NT) {
             /* Create the read end of the pipe */
             dwOpenMode = PIPE_ACCESS_INBOUND;
    -        if (bAsyncRead) {
    +        if (blocking_mode == APR_WRITE_BLOCK /* READ_NONBLOCK */
    +               || blocking_mode == APR_FULL_NONBLOCK) {
                 dwOpenMode |= FILE_FLAG_OVERLAPPED;
                 (*in)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED));
                 (*in)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
    @@ -164,7 +166,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out,
     
             dwPipeMode = 0;
     
    -        sprintf(name, "\\\\.\\pipe\\%d.%d", getpid(), id++);
    +        sprintf(name, "\\\\.\\pipe\\apr-pipe-%u.%lu", getpid(), id++);
     
             (*in)->filehand = CreateNamedPipe(name,
                                               dwOpenMode,
    @@ -177,7 +179,8 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out,
     
             /* Create the write end of the pipe */
             dwOpenMode = FILE_ATTRIBUTE_NORMAL;
    -        if (bAsyncWrite) {
    +        if (blocking_mode == APR_READ_BLOCK /* WRITE_NONBLOCK */
    +                || blocking_mode == APR_FULL_NONBLOCK) {
                 dwOpenMode |= FILE_FLAG_OVERLAPPED;
                 (*out)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED));
                 (*out)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
    diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h
    index 717dbaefa4c..06e6e091c8b 100644
    --- a/include/arch/win32/apr_arch_file_io.h
    +++ b/include/arch/win32/apr_arch_file_io.h
    @@ -282,8 +282,30 @@ apr_status_t file_cleanup(void *);
     /**
      * Internal function to create a Win32/NT pipe that respects some async
      * timeout options.
    + * @param in new read end of the created pipe
    + * @param out new write end of the created pipe
    + * @param blocking_mode one of
    + * 
    + *       APR_FULL_BLOCK
    + *       APR_READ_BLOCK
    + *       APR_WRITE_BLOCK
    + *       APR_FULL_NONBLOCK
    + * 
    + * @remark It so happens that APR_FULL_BLOCK and APR_FULL_NONBLOCK + * are common to apr_procattr_io_set() in, out and err modes. + * Because APR_CHILD_BLOCK and APR_WRITE_BLOCK share the same value, + * as do APR_PARENT_BLOCK and APR_READ_BLOCK, it's possible to use + * that value directly for creating the stdout/stderr pipes. When + * creating the stdin pipe, the values must be transposed. + * @see apr_procattr_io_set */ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, - BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, + apr_int32_t blocking_mode, apr_pool_t *p); + +/** @see apr_create_nt_pipe */ +#define APR_READ_BLOCK 3 +/** @see apr_create_nt_pipe */ +#define APR_WRITE_BLOCK 4 + #endif /* ! FILE_IO_H */ diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index d67e28f14f1..aa2e4a62afb 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -99,59 +99,38 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, return APR_SUCCESS; } -static apr_status_t open_nt_process_pipe(apr_file_t **read, apr_file_t **write, - apr_int32_t iBlockingMode, - apr_pool_t *pool) -{ - apr_status_t stat; - BOOLEAN bAsyncRead, bAsyncWrite; - - switch (iBlockingMode) { - case APR_FULL_BLOCK: - bAsyncRead = bAsyncWrite = FALSE; - break; - case APR_PARENT_BLOCK: - bAsyncRead = FALSE; - bAsyncWrite = TRUE; - break; - case APR_CHILD_BLOCK: - bAsyncRead = TRUE; - bAsyncWrite = FALSE; - break; - default: - bAsyncRead = TRUE; - bAsyncWrite = TRUE; - } - if ((stat = apr_create_nt_pipe(read, write, bAsyncRead, bAsyncWrite, - pool)) != APR_SUCCESS) - return stat; - - return APR_SUCCESS; -} - - APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, - apr_int32_t in, - apr_int32_t out, - apr_int32_t err) + apr_int32_t in, + apr_int32_t out, + apr_int32_t err) { apr_status_t stat = APR_SUCCESS; if (in) { - stat = open_nt_process_pipe(&attr->child_in, &attr->parent_in, in, - attr->pool); + /* APR_CHILD_BLOCK maps to APR_WRITE_BLOCK, while + * APR_PARENT_BLOCK maps to APR_READ_BLOCK, so we + * must transpose the CHILD/PARENT blocking flags + * only for the stdin pipe. stdout/stderr naturally + * map to the correct mode. + */ + if (in == APR_CHILD_BLOCK) + in = APR_READ_BLOCK; + else if (in == APR_PARENT_BLOCK) + in = APR_WRITE_BLOCK; + stat = apr_create_nt_pipe(&attr->child_in, &attr->parent_in, in, + attr->pool); if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_in); } if (out && stat == APR_SUCCESS) { - stat = open_nt_process_pipe(&attr->parent_out, &attr->child_out, out, - attr->pool); + stat = apr_create_nt_pipe(&attr->parent_out, &attr->child_out, out, + attr->pool); if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_out); } if (err && stat == APR_SUCCESS) { - stat = open_nt_process_pipe(&attr->parent_err, &attr->child_err, err, - attr->pool); + stat = apr_create_nt_pipe(&attr->parent_err, &attr->child_err, err, + attr->pool); if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_err); } From fc2198474a5c302aa4913a41cb6c7096626d8177 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 24 Jan 2003 18:22:13 +0000 Subject: [PATCH 4294/7878] Expand the set/get semantic slightly... always allow the user to recover the timeout (usually -1 for files and blocking pipes) and allow the user to set the timeout to -1 always. Returns APR_EINVAL (new behavior) when the user attempts to set the timeout of a blocking pipe. While most of our pipes should become non-blocking, console apps cannot be passed a non-blocking pipe handle. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64314 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index b4da558adae..1d43e3de638 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -71,20 +71,28 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) { - if (thepipe->pipe == 1) { + /* Always OK to unset timeouts */ + if (timeout == -1) { thepipe->timeout = timeout; return APR_SUCCESS; } - return APR_EINVAL; + if (!thepipe->pipe) { + return APR_ENOTIMPL; + } + if (timeout && !(thepipe->pOverlapped)) { + /* Cannot be nonzero if a pipe was opened blocking + */ + return APR_EINVAL; + } + thepipe->timeout = timeout; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) { - if (thepipe->pipe == 1) { - *timeout = thepipe->timeout; - return APR_SUCCESS; - } - return APR_EINVAL; + /* Always OK to get the timeout (even if it's unset ... -1) */ + *timeout = thepipe->timeout; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *p) From 5c827c2eb858cf8b00febbb0e0aff8b7cbdf5443 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 24 Jan 2003 18:25:31 +0000 Subject: [PATCH 4295/7878] Simplify and be more thorough. We only want to know how many bytes are in the pipe with a timeout of zero, we don't need to retrieve them. Even so, we must not try to read more bytes than are now available if the timeout is zero. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64315 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index eda1a589961..0f7bcafa3f6 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -77,24 +77,21 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le * If data is available, go ahead and read it. */ if (file->pipe) { - char tmpbuf[5]; - DWORD dwBytesRead; - DWORD dwBytesAvail; - DWORD dwBytesLeftThisMsg; - if (!PeekNamedPipe(file->filehand, // handle to pipe to copy from - &tmpbuf, // pointer to data buffer - sizeof(tmpbuf), // size, in bytes, of data buffer - &dwBytesRead, // pointer to number of bytes read - &dwBytesAvail, // pointer to total number of bytes available - &dwBytesLeftThisMsg)) { // pointer to unread bytes in this message + DWORD bytes; + if (!PeekNamedPipe(file->filehand, NULL, 0, NULL, &bytes, NULL)) { rv = apr_get_os_error(); - if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) - return APR_EOF; + if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) { + rv = APR_EOF; + } + return rv; } else { - if (dwBytesRead == 0) { + if (bytes == 0) { return APR_EAGAIN; } + if (len > bytes) { + len = bytes; + } } } else { From 9ce3a18174aa8bd97d56aac4d660f4590a7b5dd5 Mon Sep 17 00:00:00 2001 From: Brian Fitzpatrick Date: Fri, 24 Jan 2003 19:24:24 +0000 Subject: [PATCH 4296/7878] No code changes. Augment documentation for apr_file_open_std*. Thanks for Ryan Bloom (rbb@rkbloom.net) for the enlightenment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64316 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index ebff428face..32aaa497ac1 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -275,6 +275,16 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); * @param thefile The apr file to use as stderr. * @param cont The pool to allocate the file out of. * @ingroup apr_file_open + * + * @remark The only reason that the apr_file_open_std* functions exist + * is that you may not always have a stderr/out/in on Windows. This + * is generally a problem with newer versions of Windows and services. + * + * The other problem is that the C library functions generally work + * differently on Windows and Unix. So, by using apr_file_open_std* + * functions, you can get a handle to an APR struct that works with + * the APR functions which are supposed to work identically on all + * platforms. */ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont); @@ -284,6 +294,16 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, * @param thefile The apr file to use as stdout. * @param cont The pool to allocate the file out of. * @ingroup apr_file_open + * + * @remark The only reason that the apr_file_open_std* functions exist + * is that you may not always have a stderr/out/in on Windows. This + * is generally a problem with newer versions of Windows and services. + * + * The other problem is that the C library functions generally work + * differently on Windows and Unix. So, by using apr_file_open_std* + * functions, you can get a handle to an APR struct that works with + * the APR functions which are supposed to work identically on all + * platforms. */ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont); @@ -293,6 +313,16 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, * @param thefile The apr file to use as stdin. * @param cont The pool to allocate the file out of. * @ingroup apr_file_open + * + * @remark The only reason that the apr_file_open_std* functions exist + * is that you may not always have a stderr/out/in on Windows. This + * is generally a problem with newer versions of Windows and services. + * + * The other problem is that the C library functions generally work + * differently on Windows and Unix. So, by using apr_file_open_std* + * functions, you can get a handle to an APR struct that works with + * the APR functions which are supposed to work identically on all + * platforms. */ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont); From fd6cf52b3550bfeb3293c6dbbcb308d11d6a859b Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 27 Jan 2003 17:09:09 +0000 Subject: [PATCH 4297/7878] Removed some unnecessary #defines from apr.hnw git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64317 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 ++---- include/apr.hnw | 16 ---------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/STATUS b/STATUS index 9f6a80726c6..0a87e025653 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2003/01/23 16:46:36 $] +Last modified at [$Date: 2003/01/27 17:09:09 $] Release: @@ -30,9 +30,7 @@ RELEASE SHOWSTOPPERS: apr_md5.h (MD5_DIGESTSIZE) apr_network_io.h (MAX_SECONDS_TO_LINGER) apr.hnw (READDIR_IS_THREAD_SAFE, ENUM_BITFIELD, - _POSIX_THREAD_SAFE_FUNCTIONS (?), - nuint8, nuint16, NGetLo8, NGetHi8, - HIBYTE, LOBYTE) + _POSIX_THREAD_SAFE_FUNCTIONS (?)) apr.hw (NO_USE_SIGACTION) 1.0 showstopper (not 0.9.x): gstein diff --git a/include/apr.hnw b/include/apr.hnw index 41317104bc2..3ac30a91363 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -271,22 +271,6 @@ typedef int apr_socklen_t; #define APR_INT64_C(val) (val##i64) #endif -//srj added in here, libc c no longer takes care of these - -typedef unsigned char nuint8; -typedef unsigned short nuint16; - -#define NGetLo8(a16) ((nuint8)((nuint16)(a16) & 0xFF)) -#define NGetHi8(a16) ((nuint8)((nuint16)(a16) >> 8)) - - -#if !defined( HIBYTE ) - #define HIBYTE NGetHi8 - #endif - #if !defined( LOBYTE ) - #define LOBYTE NGetLo8 -#endif - /* PROC mutex is a GLOBAL mutex on Netware */ #define APR_PROC_MUTEX_IS_GLOBAL 1 From 1b0c76933016fb7a36ac54a7de228c61fa057017 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 28 Jan 2003 00:59:43 +0000 Subject: [PATCH 4298/7878] Added a check to make sure that the path is not too long. Otherwise, just bail out. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64318 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 1e3cca058b5..a09b5a31558 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -83,10 +83,9 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, char *newpath; #ifdef NETWARE char seperator[2] = { 0, 0}; - char server[MAX_SERVER_NAME+1]; - char volume[MAX_VOLUME_NAME+1]; - char path[MAX_PATH_NAME+1]; - char file[MAX_FILE_NAME+1]; + char server[APR_PATH_MAX+1]; + char volume[APR_PATH_MAX+1]; + char file[APR_PATH_MAX+1]; char *volsep = NULL; int elements; @@ -95,18 +94,22 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, else return APR_EBADPATH; + if (strlen(*inpath) > APR_PATH_MAX) { + return APR_EBADPATH; + } + seperator[0] = (flags & APR_FILEPATH_NATIVE) ? '\\' : '/'; /* Allocate and initialize each of the segment buffers */ - server[0] = volume[0] = path[0] = file[0] = '\0'; + server[0] = volume[0] = file[0] = '\0'; /* If we don't have a volume separator then don't bother deconstructing the path since we won't use the deconstructed information anyway. */ if (volsep) { /* Split the inpath into its separate parts. */ - deconstruct(testpath, server, volume, path, file, NULL, &elements, PATH_UNDEF); + deconstruct(testpath, server, volume, NULL, file, NULL, &elements, PATH_UNDEF); /* If we got a volume part then continue splitting out the root. Otherwise we either have an incomplete or relative path From dbafc6340ac88b864b9cb6790c60d3a840727fd6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 28 Jan 2003 21:11:22 +0000 Subject: [PATCH 4299/7878] As documented to the dev@apr list; the Win32 fork of the otherchild logic is altogether misdocumented. Disable otherchild logic for the moment until the documentation and code becomes consistent. This probably means introducing additional otherchild mechanics so that authors can deploy otherchild from either Unix or Win32 in a truly portable manner. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64319 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index efb1f899e9c..3c1bfba449d 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -281,7 +281,7 @@ extern "C" { #define APR_HAS_MMAP 1 #define APR_HAS_FORK 0 #define APR_HAS_RANDOM 1 -#define APR_HAS_OTHER_CHILD 1 +#define APR_HAS_OTHER_CHILD 0 #define APR_HAS_DSO 1 #define APR_HAS_SO_ACCEPTFILTER 0 #define APR_HAS_UNICODE_FS 1 From 3273ecd31b7d15374bb187ba2f4c5570d9fc0067 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 30 Jan 2003 16:56:10 +0000 Subject: [PATCH 4300/7878] Add --includedir flag to apr-config. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64320 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ apr-config.in | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGES b/CHANGES index 3f38cb1e507..b48dc160c9e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR 0.9.2 + *) Add --includedir flag to apr-config. [Justin Erenkrantz] + *) Only include sys/syslimits.h if we don't have limits.h [Craig Rodrigues , Garrett Rooney , Thom May] diff --git a/apr-config.in b/apr-config.in index d32f191b344..b49e119c23c 100644 --- a/apr-config.in +++ b/apr-config.in @@ -88,6 +88,7 @@ Usage: apr-config [OPTION] Known values for OPTION are: --prefix[=DIR] change prefix to DIR --bindir print location where binaries are installed + --includedir print location where headers are installed --cflags print C compiler flags --cppflags print cpp flags --includes print include information @@ -167,6 +168,18 @@ while test $# -gt 0; do echo $bindir exit 0 ;; + --includedir) + if test "$location" = "installed"; then + flags="$includedir" + elif test "$location" = "source"; then + flags="$APR_SOURCE_DIR/include" + else + # this is for VPATH builds + flags="$thisdir/include $APR_SOURCE_DIR/include" + fi + echo $flags + exit 0 + ;; --cflags) flags="$flags $CFLAGS" ;; From 0dc6fc81dce4cff32b33b15ce24d822edb3a4e5a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 30 Jan 2003 17:06:21 +0000 Subject: [PATCH 4301/7878] Change the screen name default to DEFAULT for all NLMs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64321 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 2c80716a331..d60341037ab 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -21,7 +21,7 @@ NLM_THREAD_NAME = $(NLM_NAME) Thread endif ifndef NLM_SCREEN_NAME -NLM_SCREEN_NAME = Apache for NetWare +NLM_SCREEN_NAME = DEFAULT endif From 08120f805cbeb7746a3cceb47e291cc3fe531cd3 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 31 Jan 2003 23:53:18 +0000 Subject: [PATCH 4302/7878] Clean up the test by making sure that the test string is consistent and that it only tests that valid memory portion. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64322 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmmap.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/testmmap.c b/test/testmmap.c index 17cba96b4c6..024a1697cf6 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -64,6 +64,7 @@ * length on a platform? */ #define PATH_LEN 255 +#define TEST_STRING "This is the MMAP data file."APR_EOL_STR #if !APR_HAS_MMAP static void not_implemented(CuTest *tc) @@ -77,16 +78,19 @@ static apr_mmap_t *themmap = NULL; static apr_file_t *thefile = NULL; static char *file1; static apr_finfo_t finfo; +static int fsize; static void create_filename(CuTest *tc) { char *oldfileptr; apr_filepath_get(&file1, 0, p); +#ifndef NETWARE #ifdef WIN32 CuAssertTrue(tc, file1[1] == ':'); #else CuAssertTrue(tc, file1[0] == '/'); +#endif #endif CuAssertTrue(tc, file1[strlen(file1) - 1] != '/'); @@ -115,7 +119,6 @@ static void test_file_open(CuTest *tc) static void test_get_filesize(CuTest *tc) { apr_status_t rv; - int fsize = strlen("This is the MMAP data file."APR_EOL_STR); rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); CuAssertIntEquals(tc, rv, APR_SUCCESS); @@ -133,12 +136,13 @@ static void test_mmap_create(CuTest *tc) static void test_mmap_contents(CuTest *tc) { - int fsize = strlen("This is the MMAP data file."APR_EOL_STR); CuAssertPtrNotNull(tc, themmap); CuAssertPtrNotNull(tc, themmap->mm); CuAssertIntEquals(tc, fsize, themmap->size); - CuAssertStrEquals(tc, themmap->mm, "This is the MMAP data file."APR_EOL_STR); + + /* Must use nEquals since the string is not guaranteed to be NULL terminated */ + CuAssertStrNEquals(tc, themmap->mm, TEST_STRING, fsize); } static void test_mmap_delete(CuTest *tc) @@ -157,13 +161,16 @@ static void test_mmap_offset(CuTest *tc) CuAssertPtrNotNull(tc, themmap); rv = apr_mmap_offset(&addr, themmap, 5); - CuAssertStrEquals(tc, addr, "This is the MMAP data file."APR_EOL_STR + 5); + + /* Must use nEquals since the string is not guaranteed to be NULL terminated */ + CuAssertStrNEquals(tc, addr, TEST_STRING + 5, fsize-5); } #endif CuSuite *testmmap(void) { CuSuite *suite = CuSuiteNew("MMAP"); + fsize = strlen(TEST_STRING); #if APR_HAS_MMAP SUITE_ADD_TEST(suite, create_filename); From 552c14810ac88709efe14884ed4a3ae8420bac3b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 1 Feb 2003 12:21:15 +0000 Subject: [PATCH 4303/7878] Disable apr_socket_sendfile() on 64-bit AIX to avoid an apparent system problem. PR: 11408 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64323 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGES b/CHANGES index b48dc160c9e..71c181ecb02 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.2 + *) Disable apr_socket_sendfile() on 64-bit AIX to avoid an apparent + system problem. PR 11408. [Jeff Trawick] + *) Add --includedir flag to apr-config. [Justin Erenkrantz] *) Only include sys/syslimits.h if we don't have limits.h diff --git a/configure.in b/configure.in index 4e496f5b4e7..9c8d1e67051 100644 --- a/configure.in +++ b/configure.in @@ -849,6 +849,14 @@ AC_ARG_WITH(sendfile, [ --with-sendfile Override decision to use sendfi s390-*-linux-gnu) sendfile="0" ;; + *aix*) + # compiler-independent check for 64-bit build + AC_CHECK_SIZEOF(void*, 4) + if test "x$ac_cv_sizeof_voidp" = "x8"; then + # sendfile not working for 64-bit build + sendfile="0" + fi + ;; esac if test "$orig_sendfile" != "$sendfile"; then echo "sendfile support disabled to avoid system problem" From 37e8ea18fa7cffa7915e018374615a203a2d1e2d Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Mon, 3 Feb 2003 23:51:56 +0000 Subject: [PATCH 4304/7878] Added a new test to check the behaviour of apr_file_info_get in combination with buffered writes. At the moment, this test will probably fail on all plaforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64324 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfileinfo.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/test/testfileinfo.c b/test/testfileinfo.c index 501d0df4f44..ab4f771c49b 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -62,6 +62,8 @@ #include "test_apr.h" #define FILENAME "data/file_datafile.txt" +#define NEWFILENAME "data/new_datafile.txt" +#define NEWFILEDATA "This is new text in a new file." static const struct view_fileinfo { @@ -207,6 +209,36 @@ static void test_stat_eq_finfo(CuTest *tc) finfo_equal(tc, stat_finfo, finfo); } +static void test_buffered_write_size(CuTest *tc) +{ + const apr_size_t data_len = strlen(NEWFILEDATA); + apr_file_t *thefile; + apr_finfo_t finfo; + apr_status_t rv; + apr_size_t bytes; + + rv = apr_file_open(&thefile, NEWFILENAME, + APR_READ | APR_WRITE | APR_CREATE | APR_EXCL + | APR_BUFFERED | APR_DELONCLOSE, + APR_OS_DEFAULT, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + /* A funny thing happened to me the other day: I wrote something + * into a buffered file, then asked for its size using + * apr_file_info_get; and guess what? The size was 0! That's not a + * nice way to behave. + */ + bytes = data_len; + rv = apr_file_write(thefile, NEWFILEDATA, &bytes); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertTrue(tc, data_len == bytes); + + rv = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertTrue(tc, bytes == (apr_size_t) finfo.size); + apr_file_close(thefile); +} + CuSuite *testfileinfo(void) { CuSuite *suite = CuSuiteNew("File Info"); @@ -214,6 +246,7 @@ CuSuite *testfileinfo(void) SUITE_ADD_TEST(suite, test_info_get); SUITE_ADD_TEST(suite, test_stat); SUITE_ADD_TEST(suite, test_stat_eq_finfo); + SUITE_ADD_TEST(suite, test_buffered_write_size); return suite; } From debddc700712979ae8b8aceab14bde7d33b4ddbd Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 4 Feb 2003 14:39:50 +0000 Subject: [PATCH 4305/7878] Fix overzealous s/-lcrypt// in r1.17 for some SCO platforms (untested). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64325 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 905f810aa66..6a8aa144505 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -176,7 +176,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-sco3.2v[234]*) APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT]) APR_ADDTO(CFLAGS, [-Oacgiltz]) - APR_ADDTO(LIBS, [-lPW -lmalloc _i]) + APR_ADDTO(LIBS, [-lPW -lmalloc]) ;; *-sco3.2v5*) APR_ADDTO(CPPFLAGS, [-DSCO5 -D_REENTRANT]) @@ -184,7 +184,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-sco_sv*|*-SCO_SV*) APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT]) - APR_ADDTO(LIBS, [-lPW -lmalloc _i]) + APR_ADDTO(LIBS, [-lPW -lmalloc]) ;; *-solaris2*) PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` From f455d6df605e3bb132134ceae99f56b3ca06aa54 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 4 Feb 2003 14:46:44 +0000 Subject: [PATCH 4306/7878] Don't add -Oacgiltz to CFLAGS for GCC on *-sco3.2v[234]*, probable fix for PR #8570 (untested). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64326 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 6a8aa144505..a93de9cfa3f 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -175,7 +175,9 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-sco3.2v[234]*) APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT]) - APR_ADDTO(CFLAGS, [-Oacgiltz]) + if test "$GCC" = "no"; then + APR_ADDTO(CFLAGS, [-Oacgiltz]) + fi APR_ADDTO(LIBS, [-lPW -lmalloc]) ;; *-sco3.2v5*) From 6cd6439204364362e2c3bbe958898e3ae93de823 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 4 Feb 2003 20:10:34 +0000 Subject: [PATCH 4307/7878] fix a typo in a comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64327 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 2681f195d21..f64d134355d 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -462,7 +462,7 @@ APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd); /** - * Determine if the chlid should start in detached state. + * Determine if the child should start in detached state. * @param attr The procattr we care about. * @param detach Should the child start in detached state? Default is no. */ From 7937a888a52f729f58fab73336f70a466e7b2ce6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 4 Feb 2003 20:12:29 +0000 Subject: [PATCH 4308/7878] Fix a bug in apr_proc_create() that could cause a new child process to run the parent's code if setrlimit() fails. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64328 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ threadproc/unix/proc.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 71c181ecb02..c75433f3420 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.2 + *) Fix a bug in apr_proc_create() that could cause a new child process + to run the parent's code if setrlimit() fails. [Jeff Trawick] + *) Disable apr_socket_sendfile() on 64-bit AIX to avoid an apparent system problem. PR 11408. [Jeff Trawick] diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 755221f19f6..8c07e8cf955 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -373,7 +373,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } if ((status = limit_proc(attr)) != APR_SUCCESS) { - return status; + exit(-1); /* We have big problems, the child should exit. */ } if (attr->cmdtype == APR_SHELLCMD) { From 5382a312fdda048ddb244455a4bf9bc01525e559 Mon Sep 17 00:00:00 2001 From: Thom May Date: Tue, 4 Feb 2003 20:56:16 +0000 Subject: [PATCH 4309/7878] Rename rules.mk to apr_rules.mk and make it be installed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64329 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ Makefile.in | 4 ++++ build/.cvsignore | 1 + build/{rules.mk.in => apr_rules.mk.in} | 0 configure.in | 10 +++++----- 5 files changed, 13 insertions(+), 5 deletions(-) rename build/{rules.mk.in => apr_rules.mk.in} (100%) diff --git a/CHANGES b/CHANGES index c75433f3420..e3551ec7407 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.2 + *) Rename rules.mk to apr_rules.mk and make apr_rules.mk be installed. + [Thom May] + *) Fix a bug in apr_proc_create() that could cause a new child process to run the parent's code if setrlimit() fails. [Jeff Trawick] diff --git a/Makefile.in b/Makefile.in index b1a6b83520f..9bd282e40f9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -84,6 +84,10 @@ install: $(TARGET_LIB) if [ -f shlibtool ]; then \ $(LIBTOOL) --mode=install cp shlibtool $(DESTDIR)$(installbuilddir); \ fi; + if [ -f build/apr_rules.mk ]; then \ + cp build/apr_rules.mk $(DESTDIR)$(installbuilddir); \ + fi; + if [ ! -d $(DESTDIR)$(bindir) ]; then \ $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(bindir); \ fi; diff --git a/build/.cvsignore b/build/.cvsignore index fc7683cab08..7af82beb129 100644 --- a/build/.cvsignore +++ b/build/.cvsignore @@ -4,6 +4,7 @@ ltconfig ltmain.sh ltcf-c.sh rules.mk +apr_rules.mk LibD LibR Debug diff --git a/build/rules.mk.in b/build/apr_rules.mk.in similarity index 100% rename from build/rules.mk.in rename to build/apr_rules.mk.in diff --git a/configure.in b/configure.in index 9c8d1e67051..892f4acd180 100644 --- a/configure.in +++ b/configure.in @@ -55,7 +55,7 @@ top_builddir="$apr_builddir" AC_SUBST(top_builddir) # Directory containing apr build macros, helpers, and make rules -# NOTE: make rules (rules.mk) will be in the builddir for vpath +# NOTE: make rules (apr_rules.mk) will be in the builddir for vpath # apr_buildout=$apr_builddir/build apr_builders=$apr_srcdir/build @@ -1889,14 +1889,14 @@ case $host in *bsdi*) # Check whether they've installed GNU make if make --version > /dev/null 2>&1; then - INCLUDE_RULES="include $apr_buildout/rules.mk" + INCLUDE_RULES="include $apr_buildout/apr_rules.mk" else # BSDi make - INCLUDE_RULES=".include \"$apr_buildout/rules.mk\"" + INCLUDE_RULES=".include \"$apr_buildout/apr_rules.mk\"" fi ;; *) - INCLUDE_RULES="include $apr_buildout/rules.mk" + INCLUDE_RULES="include $apr_buildout/apr_rules.mk" ;; esac AC_SUBST(INCLUDE_RULES) @@ -1913,7 +1913,7 @@ test -d $dir || $MKDIR $dir AC_OUTPUT([ $MAKEFILE1 $MAKEFILE2 $MAKEFILE3 include/apr.h - build/rules.mk + build/apr_rules.mk apr-config ],[ for i in $SAVE_FILES; do From 4a0793d11aa0ee1652f9179371312b14e40592e8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 6 Feb 2003 18:50:30 +0000 Subject: [PATCH 4310/7878] Allow apr_proc_create() to call an app-provided error reporting function when apr_proc_create() fails in the new child process after fork(). The app-provided error reporting function will only be called on platforms where apr_proc_create() first calls fork() to create the new process. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64330 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ include/apr_thread_proc.h | 25 +++++++++++++++++++++++++ include/arch/unix/apr_arch_threadproc.h | 1 + threadproc/beos/proc.c | 6 ++++++ threadproc/netware/proc.c | 7 +++++++ threadproc/os2/proc.c | 9 +++++++++ threadproc/unix/proc.c | 21 +++++++++++++++++++++ threadproc/win32/proc.c | 7 +++++++ 8 files changed, 82 insertions(+) diff --git a/CHANGES b/CHANGES index e3551ec7407..15150f2189b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR 0.9.2 + *) Allow apr_proc_create() to call an app-provided error reporting + function when apr_proc_create() fails in the new child process + after fork(). The app-provided error reporting function will only + be called on platforms where apr_proc_create() first calls + fork() to create the new process. [Jeff Trawick] + *) Rename rules.mk to apr_rules.mk and make apr_rules.mk be installed. [Thom May] diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index f64d134355d..0e4b514a6e5 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -177,6 +177,19 @@ struct apr_proc_t { #endif }; +/** + * The prototype for APR child errfn functions. (See the description + * of apr_procattr_child_errfn_set() for more information.) + * It is passed the following parameters: + * @param pool Pool associated with the apr_proc_t. If your child + * error function needs user data, associate it with this + * pool. + * @param err APR error code describing the error + * @param description Text description of type of processing which failed + */ +typedef void (apr_child_errfn_t)(apr_pool_t *proc, apr_status_t err, + const char *description); + /** Opaque Thread structure. */ typedef struct apr_thread_t apr_thread_t; /** Opaque Thread attributes structure. */ @@ -487,6 +500,18 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, struct rlimit *limit); #endif +/** + * Specify an error function to be called in the child process if APR + * encounters an error in the child prior to running the specified program. + * @param child_errfn The function to call in the child process. + * @param userdata Parameter to be passed to errfn. + * @remark At the present time, it will only be called from apr_proc_create() + * on platforms where fork() is used. It will never be called on other + * platforms. + */ +APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, + apr_child_errfn_t *errfn); + #if APR_HAS_FORK /** * This is currently the only non-portable call in APR. This executes diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h index 002c8f701b0..960db1e5070 100644 --- a/include/arch/unix/apr_arch_threadproc.h +++ b/include/arch/unix/apr_arch_threadproc.h @@ -134,6 +134,7 @@ struct apr_procattr_t { #ifdef RLIMIT_NOFILE struct rlimit *limit_nofile; #endif + apr_child_errfn_t *errfn; }; #endif /* ! THREAD_PROC_H */ diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index e9708558181..7bfa3f77f30 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -203,6 +203,12 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) return APR_INPARENT; } +APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, + apr_child_errfn_t *errfn) +{ + /* won't ever be called on this platform, so don't save the function pointer */ + return APR_SUCCESS; +} APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 4ca612d644d..537d22e932b 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -283,6 +283,13 @@ static apr_status_t limit_proc(apr_procattr_t *attr) return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, + apr_child_errfn_t *errfn) +{ + /* won't ever be called on this platform, so don't save the function pointer */ + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, const char *progname, const char * const *args, diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 75b4237bf0f..7afe711fe03 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -278,6 +278,15 @@ static char *double_quotes(apr_pool_t *pool, const char *str) +APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, + apr_child_errfn_t *errfn) +{ + /* won't ever be called on this platform, so don't save the function pointer */ + return APR_SUCCESS; +} + + + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname, const char * const *args, const char * const *env, diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 8c07e8cf955..a57f76ad1cf 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -295,6 +295,13 @@ static apr_status_t limit_proc(apr_procattr_t *attr) return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, + apr_child_errfn_t *errfn) +{ + attr->errfn = errfn; + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, @@ -368,11 +375,17 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->currdir != NULL) { if (chdir(attr->currdir) == -1) { + if (attr->errfn) { + attr->errfn(pool, errno, "change of working directory failed"); + } exit(-1); /* We have big problems, the child should exit. */ } } if ((status = limit_proc(attr)) != APR_SUCCESS) { + if (attr->errfn) { + attr->errfn(pool, errno, "setting of resource limits failed"); + } exit(-1); /* We have big problems, the child should exit. */ } @@ -422,6 +435,14 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, execvp(progname, (char * const *)args); } + if (attr->errfn) { + char *desc; + + desc = apr_psprintf(pool, "exec of '%s' failed", + progname); + attr->errfn(pool, errno, desc); + } + exit(-1); /* if we get here, there is a problem, so exit with an * error code. */ } diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index aa2e4a62afb..fa80a9b12f0 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -281,6 +281,13 @@ static char *apr_caret_escape_args(apr_pool_t *p, const char *str) return cmd; } +APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, + apr_child_errfn_t *errfn) +{ + /* won't ever be called on this platform, so don't save the function pointer */ + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, From 1731dea8614de5a088f514b86f2487447d2e2770 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 6 Feb 2003 19:28:02 +0000 Subject: [PATCH 4311/7878] Consistify an irritating anomily between apr.dsp and libapr.dsp (to keep these two files as similar as possible.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64331 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apr.dsp b/apr.dsp index 2eaca5b332b..4a67779a411 100644 --- a/apr.dsp +++ b/apr.dsp @@ -66,8 +66,8 @@ LIB32=link.exe -lib # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c # ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo From 0fcd0fd0f1856a9e84a41d8e9795fbaf19fe1cab Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 6 Feb 2003 19:31:26 +0000 Subject: [PATCH 4312/7878] Clean up these project to be consistent with .dsp files saved from the IDE (correcting file name order and some whitespace issues.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64332 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 20 ++++++++++---------- libapr.dsp | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/apr.dsp b/apr.dsp index 4a67779a411..e0a4f8377e3 100644 --- a/apr.dsp +++ b/apr.dsp @@ -254,11 +254,11 @@ SOURCE=.\network_io\unix\inet_pton.c # End Source File # Begin Source File -SOURCE=.\poll\unix\pollacc.c +SOURCE=.\poll\unix\poll.c # End Source File # Begin Source File -SOURCE=.\poll\unix\poll.c +SOURCE=.\poll\unix\pollacc.c # End Source File # Begin Source File @@ -387,10 +387,6 @@ SOURCE=.\user\win32\userinfo.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\include\arch\win32\apr_private.h -# End Source File -# Begin Source File - SOURCE=.\include\arch\win32\apr_arch_atime.h # End Source File # Begin Source File @@ -429,6 +425,10 @@ SOURCE=.\include\arch\win32\apr_arch_threadproc.h SOURCE=.\include\arch\win32\apr_arch_utf8.h # End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\apr_private.h +# End Source File # End Group # Begin Group "Public Header Files" @@ -449,22 +449,22 @@ SOURCE=.\include\apr.hw !IF "$(CFG)" == "apr - Win32 Release" -# Begin Custom Build - Creating apr.h from apr.hw +# Begin Custom Build - Creating apr.h from apr.hw InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" type .\include\apr.hw > .\include\apr.h - + # End Custom Build !ELSEIF "$(CFG)" == "apr - Win32 Debug" -# Begin Custom Build - Creating apr.h from apr.hw +# Begin Custom Build - Creating apr.h from apr.hw InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" type .\include\apr.hw > .\include\apr.h - + # End Custom Build !ENDIF diff --git a/libapr.dsp b/libapr.dsp index 6384a5640ed..d12d9e93e95 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -260,11 +260,11 @@ SOURCE=.\network_io\unix\inet_pton.c # End Source File # Begin Source File -SOURCE=.\poll\unix\pollacc.c +SOURCE=.\poll\unix\poll.c # End Source File # Begin Source File -SOURCE=.\poll\unix\poll.c +SOURCE=.\poll\unix\pollacc.c # End Source File # Begin Source File @@ -393,10 +393,6 @@ SOURCE=.\user\win32\userinfo.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\include\arch\win32\apr_private.h -# End Source File -# Begin Source File - SOURCE=.\include\arch\win32\apr_arch_atime.h # End Source File # Begin Source File @@ -435,6 +431,10 @@ SOURCE=.\include\arch\win32\apr_arch_threadproc.h SOURCE=.\include\arch\win32\apr_arch_utf8.h # End Source File +# Begin Source File + +SOURCE=.\include\arch\win32\apr_private.h +# End Source File # End Group # Begin Group "Public Header Files" @@ -455,22 +455,22 @@ SOURCE=.\include\apr.hw !IF "$(CFG)" == "libapr - Win32 Release" -# Begin Custom Build - Creating apr.h from apr.hw +# Begin Custom Build - Creating apr.h from apr.hw InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" type .\include\apr.hw > .\include\apr.h - + # End Custom Build !ELSEIF "$(CFG)" == "libapr - Win32 Debug" -# Begin Custom Build - Creating apr.h from apr.hw +# Begin Custom Build - Creating apr.h from apr.hw InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" type .\include\apr.hw > .\include\apr.h - + # End Custom Build !ENDIF From dd68535cdfbf7dd5f349f2be88182f06ae0e8470 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 6 Feb 2003 19:36:10 +0000 Subject: [PATCH 4313/7878] Eliminate the last (unnecessary) discrepancy between apr.dsp and libapr.dsp git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64333 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apr.dsp b/apr.dsp index e0a4f8377e3..7c7cc238cff 100644 --- a/apr.dsp +++ b/apr.dsp @@ -42,8 +42,8 @@ RSC=rc.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c # ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo From 7d4e5844bec6c41182a2b2e83d64b1b216574769 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 6 Feb 2003 22:54:55 +0000 Subject: [PATCH 4314/7878] *) Introduce Release mode debugging symbols for Win32 builds of apr. All library builds gain /Zi for debug symbols (which are discarded at link time if some flavor of the /debug flag isn't passed to link) and .dll builds gain both .pdb and .dbg files (older debuggers and Dr. Watson-type utilities on WinNT or Win9x don't support the newer .pdb symbol files.) Documentation on how-to-use these symbol files will be forthcoming. [Allen Edwards, William Rowe] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64334 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++++++ apr.dsp | 4 ++-- build/apr_app.dsp | 4 ++-- build/libapr_app.dsp | 4 ++-- libapr.dsp | 20 ++++++++++++++------ 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 15150f2189b..b91a1df66c6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,13 @@ Changes with APR 0.9.2 + *) Introduce Release mode debugging symbols for Win32 builds of apr. + All library builds gain /Zi for debug symbols (which are discarded + at link time if some flavor of the /debug flag isn't passed to link) + and .dll builds gain both .pdb and .dbg files (older debuggers and + Dr. Watson-type utilities on WinNT or Win9x don't support the newer + .pdb symbol files.) Documentation on how-to-use these symbol files + will be forthcoming. [Allen Edwards, William Rowe] + *) Allow apr_proc_create() to call an app-provided error reporting function when apr_proc_create() fails in the new child process after fork(). The app-provided error reporting function will only diff --git a/apr.dsp b/apr.dsp index 7c7cc238cff..c61e5312a32 100644 --- a/apr.dsp +++ b/apr.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr_src" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr_src" /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/build/apr_app.dsp b/build/apr_app.dsp index 65ef758b393..91cb5bc7856 100644 --- a/build/apr_app.dsp +++ b/build/apr_app.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fd"LibR\apr_app" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fd"LibR\apr_app_src" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fd"LibD\apr_app" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fd"LibD\apr_app_src" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe diff --git a/build/libapr_app.dsp b/build/libapr_app.dsp index b84688c2051..14b2ca60f5d 100644 --- a/build/libapr_app.dsp +++ b/build/libapr_app.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"Release\libapr_app" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"Release\libapr_app_src" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"Debug\libapr_app" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"Debug\libapr_app_src" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe diff --git a/libapr.dsp b/libapr.dsp index d12d9e93e95..b8cb135e28d 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\apr" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libapr_cl" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -52,8 +52,16 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /map /machine:I386 /OPT:NOREF +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /map /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /map /debug /debugtype:both /machine:I386 /pdbtype:sept +# Begin Custom Build - Extracting .dbg symbols from $(InputPath) +InputPath=.\Release\libapr.dll +SOURCE="$(InputPath)" + +".\Release\libapr.dbg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + rebase -q -b 0x6EEC0000 -x ".\Release" $(InputPath) + +# End Custom Build !ELSEIF "$(CFG)" == "libapr - Win32 Debug" @@ -69,7 +77,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\apr" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr_cl" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -78,8 +86,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 !ENDIF From d9151197b8de10cc89c3451f1e8da2602354f019 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 7 Feb 2003 12:33:00 +0000 Subject: [PATCH 4315/7878] test_buffered_write_size: Pass TRUNCATE not EXCL to open so test isn't guaranteed to fail if run more than once. Use apr_assert_success for better failure messages. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64335 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfileinfo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testfileinfo.c b/test/testfileinfo.c index ab4f771c49b..a788193fbce 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -218,10 +218,10 @@ static void test_buffered_write_size(CuTest *tc) apr_size_t bytes; rv = apr_file_open(&thefile, NEWFILENAME, - APR_READ | APR_WRITE | APR_CREATE | APR_EXCL + APR_READ | APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BUFFERED | APR_DELONCLOSE, APR_OS_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + apr_assert_success(tc, "open file", rv); /* A funny thing happened to me the other day: I wrote something * into a buffered file, then asked for its size using @@ -230,11 +230,11 @@ static void test_buffered_write_size(CuTest *tc) */ bytes = data_len; rv = apr_file_write(thefile, NEWFILEDATA, &bytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + apr_assert_success(tc, "write file contents", rv); CuAssertTrue(tc, data_len == bytes); rv = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + apr_assert_success(tc, "get file size", rv); CuAssertTrue(tc, bytes == (apr_size_t) finfo.size); apr_file_close(thefile); } From 0190b79b70e5960ecf794620ea976d27944cdadb Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 7 Feb 2003 17:55:27 +0000 Subject: [PATCH 4316/7878] Fixed a compile problem if mmap has not been implemented git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64336 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/testmmap.c b/test/testmmap.c index 024a1697cf6..e1628ea941a 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -170,9 +170,10 @@ static void test_mmap_offset(CuTest *tc) CuSuite *testmmap(void) { CuSuite *suite = CuSuiteNew("MMAP"); - fsize = strlen(TEST_STRING); #if APR_HAS_MMAP + fsize = strlen(TEST_STRING); + SUITE_ADD_TEST(suite, create_filename); SUITE_ADD_TEST(suite, test_file_open); SUITE_ADD_TEST(suite, test_get_filesize); From fcbc9e45f653b7fdf2ea6d92e8b77f2f9b37b624 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 7 Feb 2003 17:58:45 +0000 Subject: [PATCH 4317/7878] Moved the APP_DATA structure and other private elements to apr_private.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64337 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index 3ac30a91363..03beb91b8c6 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -338,20 +338,6 @@ typedef int apr_wait_t; #define APR_HAVE_INT64_STRFN 1 #define APR_INT64_STRFN strtoll -/* Application global data management */ -extern int gLibId; -extern void *gLibHandle; - -#define MAX_PROCESSORS 128 - -typedef struct app_data { - int initialized; - void* gs_aHooksToSort; - void* gs_phOptionalHooks; - void* gs_phOptionalFunctions; -} APP_DATA; - - #endif /* APR_H */ /** @} */ #endif /* NETWARE */ From 0a62e75d6ee0f6ffc076a6cc395d122dd667f0c8 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 7 Feb 2003 18:02:04 +0000 Subject: [PATCH 4318/7878] Performance enhancement by trying to create and cache path contexts so that getstat() doesn't have to do so much work when trying to traverse a file path. This has shown a significant speed increase when stat'ing longer file paths. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64338 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 113 ++++++++++++++++++++++++++++- include/arch/netware/apr_private.h | 18 +++++ misc/netware/libprews.c | 23 ++++++ 3 files changed, 152 insertions(+), 2 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 684d7265944..7c23fa78f17 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -60,6 +60,7 @@ #include "apr_strings.h" #include "apr_errno.h" #include "apr_hash.h" +#include "apr_thread_rwlock.h" static apr_filetype_e filetype_from_mode(mode_t mode) { @@ -87,7 +88,8 @@ static apr_filetype_e filetype_from_mode(mode_t mode) static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, apr_int32_t wanted) { - finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK; + finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK + | APR_FINFO_OWNER | APR_FINFO_PROT; finfo->protection = apr_unix_mode2perms(info->st_mode); finfo->filetype = filetype_from_mode(info->st_mode); finfo->user = info->st_uid; @@ -184,6 +186,113 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, return apr_file_perms_set(fname, finfo.protection); } +static apr_status_t stat_cache_cleanup(void *data) +{ + apr_pool_t *p = (apr_pool_t *)getGlobalPool(); + apr_hash_index_t *hi; + apr_hash_t *statCache = (apr_hash_t*)data; + char *key; + apr_ssize_t keylen; + NXPathCtx_t pathctx; + + for (hi = apr_hash_first(p, statCache); hi; hi = apr_hash_next(hi)) { + apr_hash_this(hi, (const void**)&key, &keylen, (void**)&pathctx); + + if (pathctx) { + NXFreePathContext(pathctx); + } + } + + return APR_SUCCESS; +} + +int cstat (NXPathCtx_t ctx, char *path, struct stat *buf, unsigned long requestmap, apr_pool_t *p) +{ + apr_pool_t *gPool = (apr_pool_t *)getGlobalPool(); + apr_hash_t *statCache = NULL; + apr_thread_rwlock_t *rwlock = NULL; + + NXPathCtx_t pathctx = 0; + char *ptr = NULL, *tr; + int len = 0, x; + char *ppath; + char *pinfo; + + if (ctx == 1) { + + /* If there isn't a global pool then just stat the file + and return */ + if (!gPool) { + char poolname[50]; + + if (apr_pool_create(&gPool, NULL) != APR_SUCCESS) { + return getstat(ctx, path, buf, requestmap); + } + + setGlobalPool(gPool); + apr_pool_tag(gPool, apr_pstrdup(gPool, "cstat_mem_pool")); + + statCache = apr_hash_make(gPool); + apr_pool_userdata_set ((void*)statCache, "STAT_CACHE", stat_cache_cleanup, gPool); + + apr_thread_rwlock_create(&rwlock, gPool); + apr_pool_userdata_set ((void*)rwlock, "STAT_CACHE_LOCK", apr_pool_cleanup_null, gPool); + } + else { + apr_pool_userdata_get((void**)&statCache, "STAT_CACHE", gPool); + apr_pool_userdata_get((void**)&rwlock, "STAT_CACHE_LOCK", gPool); + } + + if (!gPool || !statCache || !rwlock) { + return getstat(ctx, path, buf, requestmap); + } + + for (x = 0,tr = path;*tr != '\0';tr++,x++) { + if (*tr == '\\' || *tr == '/') { + ptr = tr; + len = x; + } + if (*tr == ':') { + ptr = "\\"; + len = x; + } + } + + if (ptr) { + ppath = apr_pstrndup (p, path, len); + strlwr(ppath); + if (ptr[1] != '\0') { + ptr++; + } + pinfo = apr_pstrdup (p, ptr); + } + + /* If we have a statCache then try to pull the information + from the cache. Otherwise just stat the file and return.*/ + if (statCache) { + apr_thread_rwlock_rdlock(rwlock); + pathctx = (NXPathCtx_t) apr_hash_get(statCache, ppath, APR_HASH_KEY_STRING); + apr_thread_rwlock_unlock(rwlock); + if (pathctx) { + return getstat(pathctx, pinfo, buf, requestmap); + } + else { + int err; + + err = NXCreatePathContext(0, ppath, 0, NULL, &pathctx); + if (!err) { + apr_thread_rwlock_wrlock(rwlock); + apr_hash_set(statCache, apr_pstrdup(gPool,ppath) , APR_HASH_KEY_STRING, (void*)pathctx); + apr_thread_rwlock_unlock(rwlock); + return getstat(pathctx, pinfo, buf, requestmap); + } + } + } + } + return getstat(ctx, path, buf, requestmap); +} + + APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *pool) @@ -193,7 +302,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, NXPathCtx_t pathCtx = 0; getcwdpath(NULL, &pathCtx, CTX_ACTUAL_CWD); - srv = getstat(pathCtx, fname, &info, ST_STAT_BITS|ST_NAME_BIT); + srv = cstat(pathCtx, (char*)fname, &info, ST_STAT_BITS|ST_NAME_BIT, pool); errno = srv; if (srv == 0) { diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index df5169c8ca8..8be54371b75 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -84,6 +84,7 @@ #define HAVE_STDDEF_H 1 #define HAVE_STDLIB_H 1 #define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_MMAN_H 1 #define HAVE_FCNTL_H 1 #define HAVE_ICONV_H 1 @@ -165,6 +166,23 @@ void netware_pool_proc_cleanup (); int register_NLM(void *NLMHandle); int unregister_NLM(void *NLMHandle); +/* Application global data management */ +extern int gLibId; +extern void *gLibHandle; + +typedef struct app_data { + int initialized; + void* gPool; + void* gs_aHooksToSort; + void* gs_phOptionalHooks; + void* gs_phOptionalFunctions; +} APP_DATA; + +int setGlobalPool(void *data); +void* getGlobalPool(); +int setStatCache(void *data); +void* getStatCache(); + /* Redefine malloc to use the library malloc call so that all of the memory resources will be owned and can be shared by the library. */ diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index bf872c44e47..b40ffa59c08 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -14,6 +14,7 @@ #include "novsock2.h" #include "apr_pools.h" +#include "apr_private.h" /* library-private data...*/ @@ -144,6 +145,28 @@ int DisposeLibraryData(void *data) return 0; } +int setGlobalPool(void *data) +{ + APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); + + NXLock(gLibLock); + + if (app_data && !app_data->gPool) { + app_data->gPool = data; + } + + NXUnlock(gLibLock); + return 1; +} + +void* getGlobalPool() +{ + APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); + if (app_data) { + return app_data->gPool; + } + return NULL; +} From 92227451101aeb397cea6af67ef4132017d10b02 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 7 Feb 2003 20:01:12 +0000 Subject: [PATCH 4319/7878] rebase touches the .dll often after it's last touched the .dbg file, so the build continues to try and rebase even if the .dll isn't modified. Fix this by using a dbgmark file instead of the .dbg itself as the target. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64339 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libapr.dsp b/libapr.dsp index b8cb135e28d..e2652bfacaa 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -58,8 +58,9 @@ LINK32=link.exe InputPath=.\Release\libapr.dll SOURCE="$(InputPath)" -".\Release\libapr.dbg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +".\Release\libapr.dbgmark" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" rebase -q -b 0x6EEC0000 -x ".\Release" $(InputPath) + echo rebased > ".\Release\libapr.dbgmark" # End Custom Build From 7355f7158c4eb2735552e13a54b28e4ce32e6d41 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 7 Feb 2003 20:34:27 +0000 Subject: [PATCH 4320/7878] update apr_socket_opt_set() on Unix to get rid of the surprising way it checked which option was being manipulated, and at the same time catch bogus calls git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64340 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 46 +++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 4e9da3020b3..74bd5821618 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -157,7 +157,8 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, one = 1; else one = 0; - if (opt & APR_SO_KEEPALIVE) { + switch(opt) { + case APR_SO_KEEPALIVE: #ifdef SO_KEEPALIVE if (on != apr_is_option_set(sock->netmask, APR_SO_KEEPALIVE)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { @@ -168,24 +169,24 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, #else return APR_ENOTIMPL; #endif - } - if (opt & APR_SO_DEBUG) { + break; + case APR_SO_DEBUG: if (on != apr_is_option_set(sock->netmask, APR_SO_DEBUG)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { return errno; } apr_set_option(&sock->netmask, APR_SO_DEBUG, on); } - } - if (opt & APR_SO_REUSEADDR) { + break; + case APR_SO_REUSEADDR: if (on != apr_is_option_set(sock->netmask, APR_SO_REUSEADDR)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { return errno; } apr_set_option(&sock->netmask, APR_SO_REUSEADDR, on); } - } - if (opt & APR_SO_SNDBUF) { + break; + case APR_SO_SNDBUF: #ifdef SO_SNDBUF if (apr_is_option_set(sock->netmask, APR_SO_SNDBUF) != on) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { @@ -196,8 +197,8 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, #else return APR_ENOTIMPL; #endif - } - if (opt & APR_SO_NONBLOCK) { + break; + case APR_SO_NONBLOCK: if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != on) { if (on) { if ((rv = sononblock(sock->socketdes)) != APR_SUCCESS) @@ -209,8 +210,8 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, } apr_set_option(&sock->netmask, APR_SO_NONBLOCK, on); } - } - if (opt & APR_SO_LINGER) { + break; + case APR_SO_LINGER: #ifdef SO_LINGER if (apr_is_option_set(sock->netmask, APR_SO_LINGER) != on) { struct linger li; @@ -224,12 +225,12 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, #else return APR_ENOTIMPL; #endif - } - if (opt & APR_SO_TIMEOUT) { + break; + case APR_SO_TIMEOUT: /* XXX: To be deprecated */ return apr_socket_timeout_set(sock, on); - } - if (opt & APR_TCP_NODELAY) { + break; + case APR_TCP_NODELAY: #if defined(TCP_NODELAY) if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) != on) { int optlevel = IPPROTO_TCP; @@ -258,8 +259,8 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, #endif return APR_ENOTIMPL; #endif - } - if (opt & APR_TCP_NOPUSH) { + break; + case APR_TCP_NOPUSH: #if APR_TCP_NOPUSH_FLAG if (apr_is_option_set(sock->netmask, APR_TCP_NOPUSH) != on) { int optlevel = IPPROTO_TCP; @@ -306,11 +307,11 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, #else return APR_ENOTIMPL; #endif - } - if (opt & APR_INCOMPLETE_READ) { + break; + case APR_INCOMPLETE_READ: apr_set_option(&sock->netmask, APR_INCOMPLETE_READ, on); - } - if (opt & APR_IPV6_V6ONLY) { + break; + case APR_IPV6_V6ONLY: #if APR_HAVE_IPV6 && defined(IPV6_V6ONLY) /* we don't know the initial setting of this option, * so don't check/set sock->netmask since that optimization @@ -323,6 +324,9 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, #else return APR_ENOTIMPL; #endif + break; + default: + return APR_EINVAL; } return APR_SUCCESS; From 301a4af5cdc111898af111c9b53b06b0437a25b5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 7 Feb 2003 21:02:32 +0000 Subject: [PATCH 4321/7878] add apr_procattr_error_check_set() for telling apr_proc_create() to try to anticipate any errors that might occur after fork() (no-op everywhere but Unix) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64341 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 9 +++---- include/apr_thread_proc.h | 14 +++++++++++ include/arch/unix/apr_arch_threadproc.h | 1 + threadproc/beos/proc.c | 7 ++++++ threadproc/netware/proc.c | 7 ++++++ threadproc/os2/proc.c | 9 +++++++ threadproc/unix/proc.c | 33 +++++++++++++++++++++++++ threadproc/win32/proc.c | 7 ++++++ 8 files changed, 82 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index b91a1df66c6..51cdd495e91 100644 --- a/CHANGES +++ b/CHANGES @@ -8,11 +8,10 @@ Changes with APR 0.9.2 .pdb symbol files.) Documentation on how-to-use these symbol files will be forthcoming. [Allen Edwards, William Rowe] - *) Allow apr_proc_create() to call an app-provided error reporting - function when apr_proc_create() fails in the new child process - after fork(). The app-provided error reporting function will only - be called on platforms where apr_proc_create() first calls - fork() to create the new process. [Jeff Trawick] + *) Add two new proc attributes to improve diagnostics for + apr_proc_create() failures on platforms where fork()+exec() is used. + See the doc for apr_procattr_child_errfn_set() and + apr_procattr_error_check_set(). [Jeff Trawick] *) Rename rules.mk to apr_rules.mk and make apr_rules.mk be installed. [Thom May] diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 0e4b514a6e5..435082f5770 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -512,6 +512,20 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, apr_child_errfn_t *errfn); +/** + * Specify that apr_proc_create() should do whatever it can to report + * failures to the caller of apr_proc_create(), rather than find out in + * the child. + * @param chk Flag to indicate whether or not extra work should be done + * to try to report failures to the caller. + * @remark This flag only affects apr_proc_create() on platforms where + * fork() is used. This leads to extra overhead in the calling + * process, but that may help the application handle such + * errors more gracefully. + */ +APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, + apr_int32_t chk); + #if APR_HAS_FORK /** * This is currently the only non-portable call in APR. This executes diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h index 960db1e5070..6de6cc27525 100644 --- a/include/arch/unix/apr_arch_threadproc.h +++ b/include/arch/unix/apr_arch_threadproc.h @@ -135,6 +135,7 @@ struct apr_procattr_t { struct rlimit *limit_nofile; #endif apr_child_errfn_t *errfn; + apr_int32_t errchk; }; #endif /* ! THREAD_PROC_H */ diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 7bfa3f77f30..031debc6054 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -210,6 +210,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, + apr_int32_t chk) +{ + /* won't ever be used on this platform, so don't save the flag */ + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, const char * const *env, diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 537d22e932b..c51d8e9eab4 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -290,6 +290,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, + apr_int32_t chk) +{ + /* won't ever be used on this platform, so don't save the flag */ + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, const char *progname, const char * const *args, diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 7afe711fe03..45ab03d26a1 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -287,6 +287,15 @@ APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, +APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, + apr_int32_t chk) +{ + /* won't ever be used on this platform, so don't save the flag */ + return APR_SUCCESS; +} + + + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname, const char * const *args, const char * const *env, diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index a57f76ad1cf..015fe04c3fe 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -302,6 +302,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, + apr_int32_t chk) +{ + attr->errchk = chk; + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, @@ -316,6 +323,32 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, new->err = attr->parent_err; new->out = attr->parent_out; + if (attr->errchk) { + if (attr->currdir) { + if (access(attr->currdir, R_OK|X_OK) == -1) { + /* chdir() in child wouldn't have worked */ + return errno; + } + } + + if (attr->cmdtype == APR_PROGRAM || + attr->cmdtype == APR_PROGRAM_ENV || + *progname == '/') { + /* for both of these values of cmdtype, caller must pass + * full path, so it is easy to check; + * caller can choose to pass full path for other + * values of cmdtype + */ + if (access(progname, R_OK|X_OK) == -1) { + /* exec*() in child wouldn't have worked */ + return errno; + } + } + else { + /* todo: search PATH for progname then try to access it */ + } + } + if ((new->pid = fork()) < 0) { return errno; } diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index fa80a9b12f0..02b6f57f03c 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -288,6 +288,13 @@ APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, + apr_int32_t chk) +{ + /* won't ever be used on this platform, so don't save the flag */ + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, From c0dd51fd84839eaa08feae7f0241d004ef06d4c5 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 11 Feb 2003 15:05:19 +0000 Subject: [PATCH 4322/7878] Remove the run-time tests in the check for pthread_mutexattr_setrobust_np(), since the code is only compiled and never executed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64342 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/configure.in b/configure.in index 892f4acd180..5dac5c5c5e4 100644 --- a/configure.in +++ b/configure.in @@ -1473,20 +1473,9 @@ if test "$threads" = "1"; then #include ],[ int main() { - pthread_mutex_t mutex; pthread_mutexattr_t attr; - if (pthread_mutexattr_init(&attr)) - exit(1); - if (pthread_mutexattr_setrobust_np(&attr, - PTHREAD_MUTEX_ROBUST_NP)) - exit(2); - if (pthread_mutex_init(&mutex, &attr)) - exit(3); - if (pthread_mutexattr_destroy(&attr)) - exit(4); - if (pthread_mutex_destroy(&mutex)) - exit(5); - exit(0); + pthread_mutexattr_setrobust_np(&attr, PTHREAD_MUTEX_ROBUST_NP); + return 0; }], [ac_cv_func_pthread_mutexattr_setrobust_np=yes], []) if test "$ac_cv_func_pthread_mutexattr_setrobust_np" = "yes"; then APR_ADDTO(CPPFLAGS, -D_POSIX_THREAD_PRIO_INHERIT) From 55cf077b0fdbda0056d9c7bcc5b00c0df07196e1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 11 Feb 2003 15:18:24 +0000 Subject: [PATCH 4323/7878] Fix tests for PROCESS_SHARED locks and pthread_mutexattr_setrobust_np to print "checking for " message & result, and to cache results properly. (No logic changes here, hopefully) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64343 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 5dac5c5c5e4..534cc5f0df0 100644 --- a/configure.in +++ b/configure.in @@ -1444,8 +1444,9 @@ if test "$threads" = "1"; then dnl really support PROCESS_SHARED locks. So, we must validate that we dnl can go through the steps without receiving some sort of system error. dnl Linux and older versions of AIX have this problem. - APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, - AC_TRY_RUN([ + APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, [ + AC_CACHE_CHECK([for working PROCESS_SHARED locks], apr_cv_process_shared_works, [ + AC_TRY_RUN([ #include #include int main() @@ -1463,11 +1464,15 @@ if test "$threads" = "1"; then if (pthread_mutex_destroy(&mutex)) exit(5); exit(0); - }], [], [ac_cv_func_pthread_mutexattr_setpshared=no], - [ac_cv_func_pthread_mutexattr_setpshared=no])) + }], [apr_cv_process_shared_works=yes], [apr_cv_process_shared_works=no])]) + # Override detection of pthread_mutexattr_setpshared + ac_cv_func_pthread_mutexattr_setpshared=$apr_cv_process_shared_works]) + if test "$ac_cv_func_pthread_mutexattr_setpshared" = "yes"; then AC_CHECK_FUNCS(pthread_mutexattr_setrobust_np) if test "$ac_cv_func_pthread_mutexattr_setrobust_np" = "no"; then + AC_CACHE_CHECK([for pthread_mutexattr_setrobust_np with _POSIX_THREAD_PRIO_INHERIT], + [apr_cv_setrobust_with_prio_inherit], [ AC_TRY_COMPILE([#define _POSIX_THREAD_PRIO_INHERIT #include #include ],[ @@ -1476,8 +1481,9 @@ if test "$threads" = "1"; then pthread_mutexattr_t attr; pthread_mutexattr_setrobust_np(&attr, PTHREAD_MUTEX_ROBUST_NP); return 0; - }], [ac_cv_func_pthread_mutexattr_setrobust_np=yes], []) - if test "$ac_cv_func_pthread_mutexattr_setrobust_np" = "yes"; then + }], [apr_cv_setrobust_with_prio_inherit=yes], [apr_cv_setrobust_with_prio_inherit=no])]) + if test "$apr_cv_setrobust_with_prio_inherit" = "yes"; then + ac_cv_func_pthread_mutexattr_setrobust_np=yes APR_ADDTO(CPPFLAGS, -D_POSIX_THREAD_PRIO_INHERIT) fi fi From 74db3289dd467e0a6632b3c43edd21e090cc7fb1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 11 Feb 2003 15:36:56 +0000 Subject: [PATCH 4324/7878] Capitalize some "Posix"es and s/dnl/# a comment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64344 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 534cc5f0df0..881e70cadfb 100644 --- a/configure.in +++ b/configure.in @@ -620,7 +620,7 @@ AC_CHECK_FUNCS([getpwnam_r getpwuid_r getgrnam_r getgrgid_r]) dnl ----------------------------- Checking for Shared Memory Support echo "${nl}Checking for Shared Memory Support..." -# The Posix function are in librt on Solaris. This will +# The POSIX function are in librt on Solaris. This will # also help us find sem_open when doing locking below case $host in *-solaris*) @@ -1440,10 +1440,10 @@ APR_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h) if test "$threads" = "1"; then APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h) AC_CHECK_FUNCS(pthread_mutexattr_setpshared) - dnl Some systems have setpshared and define PROCESS_SHARED, but don't - dnl really support PROCESS_SHARED locks. So, we must validate that we - dnl can go through the steps without receiving some sort of system error. - dnl Linux and older versions of AIX have this problem. + # Some systems have setpshared and define PROCESS_SHARED, but don't + # really support PROCESS_SHARED locks. So, we must validate that we + # can go through the steps without receiving some sort of system error. + # Linux and older versions of AIX have this problem. APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, [ AC_CACHE_CHECK([for working PROCESS_SHARED locks], apr_cv_process_shared_works, [ AC_TRY_RUN([ @@ -1519,7 +1519,7 @@ APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) APR_IFALLYES(header:semaphore.h func:sem_open func_sem_close dnl func_sem_unlink func:sem_post func_sem_wait, - APR_DECIDE(USE_POSIXSEM_SERIALIZE, [Posix sem_open()])) + APR_DECIDE(USE_POSIXSEM_SERIALIZE, [POSIX sem_open()])) # note: the current APR use of shared mutex requires /dev/zero APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl func:pthread_mutexattr_setpshared dnl @@ -1578,7 +1578,7 @@ fi AC_SUBST(proclockglobal) -AC_MSG_CHECKING(if Posix sems affect threads in the same process) +AC_MSG_CHECKING(if POSIX sems affect threads in the same process) if test "x$apr_posixsem_is_global" = "xyes"; then AC_DEFINE(POSIXSEM_IS_GLOBAL, 1, [Define if POSIX semaphores affect threads within the process]) From efd06c0e4681ff0cff8ca23a13a4deb35a41637d Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 11 Feb 2003 17:15:58 +0000 Subject: [PATCH 4325/7878] Implemented apr_proc_wait and apr_wait_all_procs for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64345 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_arch_threadproc.h | 5 +- threadproc/netware/proc.c | 92 ++++++++++++++-------- 2 files changed, 62 insertions(+), 35 deletions(-) diff --git a/include/arch/netware/apr_arch_threadproc.h b/include/arch/netware/apr_arch_threadproc.h index a9d78f029f6..14899df5c40 100644 --- a/include/arch/netware/apr_arch_threadproc.h +++ b/include/arch/netware/apr_arch_threadproc.h @@ -55,12 +55,13 @@ #include "apr.h" #include "apr_thread_proc.h" #include "apr_file_io.h" -//srj #include "apr_portable.h" + +#include #ifndef THREAD_PROC_H #define THREAD_PROC_H -#define SHELL_PATH "cmd.exe" +#define SHELL_PATH "" #define APR_DEFAULT_STACK_SIZE 65536 struct apr_thread_t { diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index c51d8e9eab4..6c0bd2cd970 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -62,8 +62,14 @@ apr_status_t apr_netware_proc_cleanup(void *theproc) { apr_proc_t *proc = theproc; + int exit_int; + int waitpid_options = WUNTRACED | WNOHANG; - NXVmDestroy(proc->pid); + if (proc->pid > 0) { + waitpid(proc->pid, &exit_int, waitpid_options); + } + +/* NXVmDestroy(proc->pid); */ return APR_SUCCESS; } @@ -76,6 +82,7 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new,apr_pool_t *p } (*new)->pool = pool; (*new)->cmdtype = APR_PROGRAM; +/* (*new)->detached = 1;*/ return APR_SUCCESS; } @@ -318,7 +325,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, /* attr->detached and PROC_DETACHED do not mean the same thing. attr->detached means * start the NLM in a separate address space. PROC_DETACHED means don't wait for the * NLM to unload by calling wait() or waitpid(), just clean up */ - addr_space = (attr->detached ? 0 : PROC_CURRENT_SPACE) | PROC_LOAD_SILENT | PROC_DETACHED; + addr_space = PROC_LOAD_SILENT | ((attr->cmdtype == APR_PROGRAM_ENV) ? 0 : PROC_CURRENT_SPACE); + addr_space |= (attr->detached ? PROC_DETACHED : 0); if (attr->currdir) { char *fullpath = NULL; @@ -353,8 +361,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, } -// apr_pool_cleanup_register(pool, (void *)newproc, apr_netware_proc_cleanup, -// apr_pool_cleanup_null); + apr_pool_cleanup_register(pool, (void *)newproc, apr_netware_proc_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } @@ -365,52 +373,70 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_how_e waithow, apr_pool_t *p) { -#if 0 + proc->pid = -1; + return apr_proc_wait(proc, exitcode, exitwhy, waithow); +} + +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, + int *exitcode, apr_exit_why_e *exitwhy, + apr_wait_how_e waithow) +{ + pid_t pstatus; int waitpid_options = WUNTRACED; + int exit_int; + int ignore; + apr_exit_why_e ignorewhy; + + if (exitcode == NULL) { + exitcode = &ignore; + } + + if (exitwhy == NULL) { + exitwhy = &ignorewhy; + } if (waithow != APR_WAIT) { waitpid_options |= WNOHANG; } - if ((proc->pid = waitpid(-1, status, waitpid_options)) > 0) { + /* If the pid is 0 then the process was started detached. There + is no need to wait since there is nothing to wait for on a + detached process. Starting a process as non-detached and + then calling wait or waitpid could cause the thread to hang. + The reason for this is because NetWare does not have a way + to kill or even signal a process to be killed. Starting + all processes as detached avoids the possibility of a + thread hanging. */ + if (proc->pid == 0) { + *exitwhy = APR_PROC_EXIT; + *exitcode = 0; return APR_CHILD_DONE; } - else if (proc->pid == 0) { - return APR_CHILD_NOTDONE; - } - return errno; -#else - return APR_ENOTIMPL; -#endif -} -APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, - int *exitcode, apr_exit_why_e *exitwhy, - apr_wait_how_e waithow) -{ -#if 0 - pid_t status; + if ((pstatus = waitpid(proc->pid, &exit_int, waitpid_options)) > 0) { + proc->pid = pstatus; - if (waithow == APR_WAIT) { - if ((status = waitpid(proc->pid, NULL, WUNTRACED)) > 0) { - return APR_CHILD_DONE; + if (WIFEXITED(exit_int)) { + *exitwhy = APR_PROC_EXIT; + *exitcode = WEXITSTATUS(exit_int); } - else if (status == 0) { - return APR_CHILD_NOTDONE; + else if (WIFSIGNALED(exit_int)) { + *exitwhy = APR_PROC_SIGNAL; + *exitcode = WTERMSIG(exit_int); } - return errno; - } - if ((status = waitpid(proc->pid, NULL, WUNTRACED | WNOHANG)) > 0) { + else { + /* unexpected condition */ + return APR_EGENERAL; + } + return APR_CHILD_DONE; } - else if (status == 0) { + else if (pstatus == 0) { return APR_CHILD_NOTDONE; } + return errno; -#else - return APR_ENOTIMPL; -#endif -} +} APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, struct rlimit *limit) From d12ce3c4d0c765539f77587acec3342545da13f8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 11 Feb 2003 18:16:52 +0000 Subject: [PATCH 4326/7878] Stay consistent with naming the .pdb files from the compile step as _src. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64346 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libapr.dsp b/libapr.dsp index e2652bfacaa..87872996b7a 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libapr_cl" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libapr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -78,7 +78,7 @@ SOURCE="$(InputPath)" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr_cl" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr_src" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" From 316f0fc92e6e34ab74b433792ae19bf2475b0090 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 11 Feb 2003 21:57:45 +0000 Subject: [PATCH 4327/7878] This source isn't needed, it's exported through libapr.dll which is sufficient for linking the app library (for exclusively WinNT apps) to the libapr_app.lib symbols. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64347 13f79535-47bb-0310-9956-ffa450edef68 --- build/libapr_app.dsp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build/libapr_app.dsp b/build/libapr_app.dsp index 14b2ca60f5d..b1ccf7b7679 100644 --- a/build/libapr_app.dsp +++ b/build/libapr_app.dsp @@ -89,9 +89,5 @@ SOURCE=..\misc\win32\apr_app.c SOURCE=..\misc\win32\internal.c # End Source File -# Begin Source File - -SOURCE=..\misc\win32\utf8.c -# End Source File # End Target # End Project From d8046a4d4c1751b44d427bcdeb55e7681ef8522e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 11 Feb 2003 23:47:09 +0000 Subject: [PATCH 4328/7878] Enable APR_PROGRAM_ENV as a command type git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64348 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 6c0bd2cd970..c093b6903bf 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -210,7 +210,7 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) { - if (cmd != APR_PROGRAM) + if ((cmd != APR_PROGRAM) && (cmd != APR_PROGRAM_ENV)) return APR_ENOTIMPL; attr->cmdtype = cmd; return APR_SUCCESS; From c3f4a3e4ffaf551df8bc8a321822637dc1184469 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Wed, 12 Feb 2003 20:20:56 +0000 Subject: [PATCH 4329/7878] Added two new functions, apr_filepath_list_split and apr_filepath_list_merge, for managing search paths. The common implementation is in a new file, file_io/unix/filepath_util.c. Also added tests for these functions a new file in the test suite, testpath.c. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64349 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + NWGNUmakefile | 1 + apr.dsp | 4 + file_io/unix/Makefile.in | 1 + file_io/unix/filepath.c | 23 +++++ file_io/unix/filepath_util.c | 147 +++++++++++++++++++++++++++++ file_io/win32/filepath.c | 24 +++++ include/apr_file_info.h | 31 ++++++ include/apr_pools.h | 3 + libapr.dsp | 4 + test/Makefile.in | 2 +- test/Makefile.win | 4 +- test/aprtest.dsp | 4 + test/test_apr.h | 1 + test/testall.c | 1 + test/testall.dsp | 4 + test/testpath.c | 176 +++++++++++++++++++++++++++++++++++ 17 files changed, 430 insertions(+), 3 deletions(-) create mode 100644 file_io/unix/filepath_util.c create mode 100644 test/testpath.c diff --git a/CHANGES b/CHANGES index 51cdd495e91..cd66b35802c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.2 + *) Add functions apr_filepath_list_split and apr_filepath_list_merge + for managing search paths. [Branko Cibej] + *) Introduce Release mode debugging symbols for Win32 builds of apr. All library builds gain /Zi for debug symbols (which are discarded at link time if some flavor of the /debug flag isn't passed to link) diff --git a/NWGNUmakefile b/NWGNUmakefile index b57e51dbb59..3f074e9e408 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -255,6 +255,7 @@ FILES_lib_objs = \ $(OBJDIR)/fileacc.o \ $(OBJDIR)/filedup.o \ $(OBJDIR)/filepath.o \ + $(OBJDIR)/filepath_util.o \ $(OBJDIR)/filestat.o \ $(OBJDIR)/filesys.o \ $(OBJDIR)/flock.o \ diff --git a/apr.dsp b/apr.dsp index c61e5312a32..6015d284bc8 100644 --- a/apr.dsp +++ b/apr.dsp @@ -117,6 +117,10 @@ SOURCE=.\file_io\win32\filepath.c # End Source File # Begin Source File +SOURCE=.\file_io\unix\filepath_util.c +# End Source File +# Begin Source File + SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index ce62475b18e..01473a8011f 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -7,6 +7,7 @@ TARGETS = \ fileacc.lo \ filedup.lo \ filepath.lo \ + filepath_util.lo \ filestat.lo \ flock.lo \ fullrw.lo \ diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index f273621aade..91321ba0726 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -326,6 +326,29 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } +apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, + const char *liststr, + char separator, + apr_pool_t *p); +apr_status_t apr_filepath_list_merge_impl(char **liststr, + apr_array_header_t *pathelts, + char separator, + apr_pool_t *p); + +APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, + const char *liststr, + apr_pool_t *p) +{ + return apr_filepath_list_split_impl(pathelts, liststr, ':', p); +} +APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, + apr_array_header_t *pathelts, + apr_pool_t *p) +{ + return apr_filepath_list_merge_impl(liststr, pathelts, ':', p); +} + + APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p) { *style = APR_FILEPATH_ENCODING_LOCALE; diff --git a/file_io/unix/filepath_util.c b/file_io/unix/filepath_util.c new file mode 100644 index 00000000000..190c3021846 --- /dev/null +++ b/file_io/unix/filepath_util.c @@ -0,0 +1,147 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +#define APR_WANT_STRFUNC +#define APR_WANT_MEMFUNC +#include "apr_want.h" + +#include "apr_errno.h" +#include "apr_pools.h" +#include "apr_strings.h" +#include "apr_tables.h" + + +apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, + const char *liststr, + char separator, + apr_pool_t *p) +{ + char *path, *part, *ptr; + char separator_string[2] = { separator, '\0' }; + apr_array_header_t *elts; + int nelts; + + /* Count the number of path elements. We know there'll be at least + one even if path is an empty string. */ + path = apr_pstrdup(p, liststr); + for (nelts = 0, ptr = path; ptr != NULL; ++nelts) + { + ptr = strchr(ptr, separator); + if (ptr) + ++ptr; + } + + /* Split the path into the array. */ + elts = apr_array_make(p, nelts, sizeof(char*)); + while ((part = apr_strtok(path, separator_string, &ptr)) != NULL) + { + if (*part == '\0') /* Ignore empty path components. */ + continue; + + *(char**)apr_array_push(elts) = part; + path = NULL; /* For the next call to apr_strtok */ + } + + *pathelts = elts; + return APR_SUCCESS; +} + + +apr_status_t apr_filepath_list_merge_impl(char **liststr, + apr_array_header_t *pathelts, + char separator, + apr_pool_t *p) +{ + apr_size_t path_size = 0; + char *path; + int i; + + /* This test isn't 100% certain, but it'll catch at least some + invalid uses... */ + if (pathelts->elt_size != sizeof(char*)) + return APR_EINVAL; + + /* Calculate the size of the merged path */ + for (i = 0; i < pathelts->nelts; ++i) + path_size += strlen(((char**)pathelts->elts)[i]); + + if (path_size == 0) + { + *liststr = NULL; + return APR_SUCCESS; + } + + if (i > 0) /* Add space for the separators */ + path_size += (i - 1); + + /* Merge the path components */ + path = *liststr = apr_palloc(p, path_size + 1); + for (i = 0; i < pathelts->nelts; ++i) + { + /* ### Hmmmm. Calling strlen twice on the same string. Yuck. + But is is better than reallocation in apr_pstrcat? */ + const char *part = ((char**)pathelts->elts)[i]; + apr_size_t part_size = strlen(part); + if (part_size == 0) /* Ignore empty path components. */ + continue; + + if (i > 0) + *path++ = separator; + memcpy(path, part, part_size); + path += part_size; + } + *path = '\0'; + return APR_SUCCESS; +} diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index a09b5a31558..5ae8a54b437 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -54,6 +54,7 @@ #include "apr.h" #include "apr_arch_file_io.h" +#include "apr_arch_utf8.h" #include "apr_strings.h" #include "apr_lib.h" #include @@ -977,6 +978,29 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } +apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, + const char *liststr, + char separator, + apr_pool_t *p); +apr_status_t apr_filepath_list_merge_impl(char **liststr, + apr_array_header_t *pathelts, + char separator, + apr_pool_t *p); + +APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, + const char *liststr, + apr_pool_t *p) +{ + return apr_filepath_list_split_impl(pathelts, liststr, ';', p); +} +APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, + apr_array_header_t *pathelts, + apr_pool_t *p) +{ + return apr_filepath_list_merge_impl(liststr, pathelts, ';', p); +} + + APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p) { #if APR_HAS_UNICODE_FS diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 5b2ee8f75d1..7e69aea1367 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -58,6 +58,7 @@ #include "apr.h" #include "apr_user.h" #include "apr_pools.h" +#include "apr_tables.h" #include "apr_time.h" #include "apr_errno.h" @@ -385,6 +386,36 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, apr_int32_t flags, apr_pool_t *p); +/** + * Split a search path into separate components + * @ingroup apr_filepath + * @param pathelts the returned components of the search path + * @param liststr the search path (e.g., getenv("PATH")) + * @param p the pool to allocate the array and path components from + * @deffunc apr_status_t apr_filepath_list_split(apr_array_header_t **pathelts, const char *liststr, apr_pool_t *p) + * @remark empty path componenta do not become part of @a pathelts. + * @remark the path separator in @a liststr is system specific; + * e.g., ':' on Unix, ';' on Windows, etc. + */ +APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, + const char *liststr, + apr_pool_t *p); + +/** + * Merge a list of search path components into a single search path + * @ingroup apr_filepath + * @param liststr the returned search path; may be NULL if @a pathelts is empty + * @param pathelts the components of the search path + * @param p the pool to allocate the search path from + * @deffunc apr_status_t apr_filepath_list_merge(char **liststr, apr_array_header_t *pathelts, apr_pool_t *p) + * @remark emtpy strings in the source array are ignored. + * @remark the path separator in @a liststr is system specific; + * e.g., ':' on Unix, ';' on Windows, etc. + */ +APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, + apr_array_header_t *pathelts, + apr_pool_t *p); + /** * Return the default file path (for relative file names) * @ingroup apr_filepath diff --git a/include/apr_pools.h b/include/apr_pools.h index fcacd566204..d9a03c2a164 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -157,6 +157,9 @@ typedef struct apr_pool_t apr_pool_t; * If level 0 was specified, debugging is switched off *
    */ + +#define APR_POOL_DEBUG 1 /* FIXME: Don't commit this! */ + #if defined(APR_POOL_DEBUG) #if (APR_POOL_DEBUG != 0) && (APR_POOL_DEBUG - 0 == 0) #undef APR_POOL_DEBUG diff --git a/libapr.dsp b/libapr.dsp index 87872996b7a..d9636e52ef4 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -132,6 +132,10 @@ SOURCE=.\file_io\win32\filepath.c # End Source File # Begin Source File +SOURCE=.\file_io\unix\filepath_util.c +# End Source File +# Begin Source File + SOURCE=.\file_io\win32\filestat.c # End Source File # Begin Source File diff --git a/test/Makefile.in b/test/Makefile.in index 56b9d56b79f..70f73cdfd87 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -102,7 +102,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ - testhash.lo testargs.lo testnames.lo testuser.lo + testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/Makefile.win b/test/Makefile.win index f1ff0019057..3437f45aa37 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -99,11 +99,11 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testfmt.obj testfile.obj testdir.obj testfileinfo.obj testrand.obj \ testdso.obj testoc.obj testdup.obj testsockets.obj testproc.obj \ testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \ - testhash.obj testargs.obj testnames.obj testuser.obj + testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS) $(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ $(LOCAL_LIBS) $(ALL_LIBS) - + # DO NOT REMOVE diff --git a/test/aprtest.dsp b/test/aprtest.dsp index ffc1be08bb4..e31b898d0d2 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -140,6 +140,10 @@ SOURCE=.\testoc.c # End Source File # Begin Source File +SOURCE=.\testpath.c +# End Source File +# Begin Source File + SOURCE=.\testpipe.c # End Source File # Begin Source File diff --git a/test/test_apr.h b/test/test_apr.h index 9c51256cfbf..4f0d5768275 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -94,6 +94,7 @@ CuSuite *testthread(void); CuSuite *testgetopt(void); CuSuite *testnames(void); CuSuite *testuser(void); +CuSuite *testpath(void); /* Assert that RV is an APR_SUCCESS value; else fail giving strerror * for RV and CONTEXT message. */ diff --git a/test/testall.c b/test/testall.c index b9ea4e5644c..da24dd52ebd 100644 --- a/test/testall.c +++ b/test/testall.c @@ -106,6 +106,7 @@ static const struct testlist { {"testargs", testgetopt}, {"testnames", testnames}, {"testuser", testuser}, + {"testpath", testpath}, {"LastTest", NULL} }; diff --git a/test/testall.dsp b/test/testall.dsp index c2673fddcb6..12f031cb76a 100644 --- a/test/testall.dsp +++ b/test/testall.dsp @@ -167,6 +167,10 @@ SOURCE=.\testoc.c # End Source File # Begin Source File +SOURCE=.\testpath.c +# End Source File +# Begin Source File + SOURCE=.\testpipe.c # End Source File # Begin Source File diff --git a/test/testpath.c b/test/testpath.c new file mode 100644 index 00000000000..81efecea2ff --- /dev/null +++ b/test/testpath.c @@ -0,0 +1,176 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "test_apr.h" +#include "apr_file_info.h" +#include "apr_errno.h" +#include "apr_pools.h" +#include "apr_tables.h" + +#if defined(WIN32) || defined(NETWARE) || defined(OS2) +#define PSEP ";" +#define DSEP "\\" +#else +#define PSEP ":" +#define DSEP "/" +#endif + +#define PX "" +#define P1 "first path" +#define P2 "second" DSEP "path" +#define P3 "th ird" DSEP "path" +#define P4 "fourth" DSEP "pa th" +#define P5 "fifthpath" + +static const char *parts_in[] = { P1, P2, P3, PX, P4, P5 }; +static const char *path_in = P1 PSEP P2 PSEP P3 PSEP PX PSEP P4 PSEP P5; +static const int parts_in_count = sizeof(parts_in)/sizeof(*parts_in); + +static const char *parts_out[] = { P1, P2, P3, P4, P5 }; +static const char *path_out = P1 PSEP P2 PSEP P3 PSEP P4 PSEP P5; +static const int parts_out_count = sizeof(parts_out)/sizeof(*parts_out); + +static void list_split_multi(CuTest *tc) +{ + int i; + apr_status_t rv; + apr_array_header_t *pathelts; + + pathelts = NULL; + rv = apr_filepath_list_split(&pathelts, path_in, p); + CuAssertPtrNotNull(tc, pathelts); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, parts_out_count, pathelts->nelts); + for (i = 0; i < pathelts->nelts; ++i) + CuAssertStrEquals(tc, parts_out[i], ((char**)pathelts->elts)[i]); +} + +static void list_split_single(CuTest *tc) +{ + int i; + apr_status_t rv; + apr_array_header_t *pathelts; + + for (i = 0; i < parts_in_count; ++i) + { + pathelts = NULL; + rv = apr_filepath_list_split(&pathelts, parts_in[i], p); + CuAssertPtrNotNull(tc, pathelts); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + if (parts_in[i][0] == '\0') + CuAssertIntEquals(tc, 0, pathelts->nelts); + else + { + CuAssertIntEquals(tc, 1, pathelts->nelts); + CuAssertStrEquals(tc, parts_in[i], *(char**)pathelts->elts); + } + } +} + +static void list_merge_multi(CuTest *tc) +{ + int i; + char *liststr; + apr_status_t rv; + apr_array_header_t *pathelts; + + pathelts = apr_array_make(p, parts_in_count, sizeof(const char*)); + for (i = 0; i < parts_in_count; ++i) + *(const char**)apr_array_push(pathelts) = parts_in[i]; + + liststr = NULL; + rv = apr_filepath_list_merge(&liststr, pathelts, p); + CuAssertPtrNotNull(tc, liststr); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, liststr, path_out); +} + +static void list_merge_single(CuTest *tc) +{ + int i; + char *liststr; + apr_status_t rv; + apr_array_header_t *pathelts; + + pathelts = apr_array_make(p, 1, sizeof(const char*)); + apr_array_push(pathelts); + for (i = 0; i < parts_in_count; ++i) + { + *(const char**)pathelts->elts = parts_in[i]; + liststr = NULL; + rv = apr_filepath_list_merge(&liststr, pathelts, p); + if (parts_in[i][0] == '\0') + CuAssertPtrEquals(tc, NULL, liststr); + else + { + CuAssertPtrNotNull(tc, liststr); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, liststr, parts_in[i]); + } + } +} + + +CuSuite *testpath(void) +{ + CuSuite *suite = CuSuiteNew("Path lists"); + + SUITE_ADD_TEST(suite, list_split_multi); + SUITE_ADD_TEST(suite, list_split_single); + SUITE_ADD_TEST(suite, list_merge_multi); + SUITE_ADD_TEST(suite, list_merge_single); + + return suite; +} + From e80cde85fb81bfa8443dfb57385f8543be559118 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Wed, 12 Feb 2003 20:23:08 +0000 Subject: [PATCH 4330/7878] Revert bogus commit of revision 1.100. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64350 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index d9a03c2a164..fcacd566204 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -157,9 +157,6 @@ typedef struct apr_pool_t apr_pool_t; * If level 0 was specified, debugging is switched off * */ - -#define APR_POOL_DEBUG 1 /* FIXME: Don't commit this! */ - #if defined(APR_POOL_DEBUG) #if (APR_POOL_DEBUG != 0) && (APR_POOL_DEBUG - 0 == 0) #undef APR_POOL_DEBUG From 4d02e4496641fe8bb2ff7735c5af986612991cdd Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Wed, 12 Feb 2003 20:26:13 +0000 Subject: [PATCH 4331/7878] Remove unused #include added in revision 1.39. (Damn, I must be blind, or something...) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64351 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 1 - 1 file changed, 1 deletion(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 5ae8a54b437..f1edaaf26fc 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -54,7 +54,6 @@ #include "apr.h" #include "apr_arch_file_io.h" -#include "apr_arch_utf8.h" #include "apr_strings.h" #include "apr_lib.h" #include From 50efad22ca78378ab1754233d30da4193ddc6acb Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 12 Feb 2003 22:28:12 +0000 Subject: [PATCH 4332/7878] CodeWarrior compiler can't handle initializing an array element with a variable git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64352 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/file_io/unix/filepath_util.c b/file_io/unix/filepath_util.c index 190c3021846..05653de0657 100644 --- a/file_io/unix/filepath_util.c +++ b/file_io/unix/filepath_util.c @@ -69,10 +69,11 @@ apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, apr_pool_t *p) { char *path, *part, *ptr; - char separator_string[2] = { separator, '\0' }; + char separator_string[2] = { '\0', '\0' }; apr_array_header_t *elts; int nelts; + separator_string[0] = separator; /* Count the number of path elements. We know there'll be at least one even if path is an empty string. */ path = apr_pstrdup(p, liststr); From a14bc47dc3398038e5f71eba7da4c3177fb384a5 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 12 Feb 2003 22:28:51 +0000 Subject: [PATCH 4333/7878] Added testpath to the NetWare tests makefile git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64353 13f79535-47bb-0310-9956-ffa450edef68 --- test/nwgnuaprtest | 1 + 1 file changed, 1 insertion(+) diff --git a/test/nwgnuaprtest b/test/nwgnuaprtest index bb2546fcf51..babe4a4d19e 100644 --- a/test/nwgnuaprtest +++ b/test/nwgnuaprtest @@ -183,6 +183,7 @@ FILES_nlm_objs = \ $(OBJDIR)/testmmap.o \ $(OBJDIR)/testnames.o \ $(OBJDIR)/testoc.o \ + $(OBJDIR)/testpath.o \ $(OBJDIR)/testpoll.o \ $(OBJDIR)/testpools.o \ $(OBJDIR)/testproc.o \ From 9c5c09748219add9032f8d1fc0ecce291408e14b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 13 Feb 2003 13:24:48 +0000 Subject: [PATCH 4334/7878] get the prototypes for these functions in the right place so they actually do some good > filepath_util.c:70: warning: no previous prototype for \ `apr_filepath_list_split_impl' > filepath_util.c:107: warning: no previous prototype for \ `apr_filepath_list_merge_impl' git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64354 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 12 +----------- file_io/unix/filepath_util.c | 2 +- include/arch/unix/apr_arch_file_io.h | 9 +++++++++ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 91321ba0726..3b4ac300396 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -325,22 +325,13 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, return APR_SUCCESS; } - -apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, - const char *liststr, - char separator, - apr_pool_t *p); -apr_status_t apr_filepath_list_merge_impl(char **liststr, - apr_array_header_t *pathelts, - char separator, - apr_pool_t *p); - APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, const char *liststr, apr_pool_t *p) { return apr_filepath_list_split_impl(pathelts, liststr, ':', p); } + APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, apr_array_header_t *pathelts, apr_pool_t *p) @@ -348,7 +339,6 @@ APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, return apr_filepath_list_merge_impl(liststr, pathelts, ':', p); } - APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p) { *style = APR_FILEPATH_ENCODING_LOCALE; diff --git a/file_io/unix/filepath_util.c b/file_io/unix/filepath_util.c index 05653de0657..1f909f35338 100644 --- a/file_io/unix/filepath_util.c +++ b/file_io/unix/filepath_util.c @@ -61,7 +61,7 @@ #include "apr_pools.h" #include "apr_strings.h" #include "apr_tables.h" - +#include "apr_arch_file_io.h" apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, const char *liststr, diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index de5a49faf1e..06911ad2af5 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -153,6 +153,15 @@ apr_status_t apr_unix_file_cleanup(void *); mode_t apr_unix_perms2mode(apr_fileperms_t perms); apr_fileperms_t apr_unix_mode2perms(mode_t mode); +apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, + const char *liststr, + char separator, + apr_pool_t *p); +apr_status_t apr_filepath_list_merge_impl(char **liststr, + apr_array_header_t *pathelts, + char separator, + apr_pool_t *p); + #endif /* ! FILE_IO_H */ From 95907c8b833fa534bb992ccd41d7854457ede6f5 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 15 Feb 2003 18:09:30 +0000 Subject: [PATCH 4335/7878] Fix a nice little autoconf bug where apr-util and pcre would not configure correctly upon updating to any recent version of autoconf. (apr would configure correctly.) (apr-util and pcre's configure would exit with syntax errors.) The only fix seems to be forcing a new shell to be invoked. My hunch is that some shells have a limit to the buffer that it can contain. This isn't helped by the fact that autoconf-2.54+ will reinvoke each configure script multiple times in order to try to find the 'best' shell to use. Lame. Seen with Solaris/autoconf-2.54+. (autoconf-2.54+ will use /bin/bash by default on these systems without a way to override.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64355 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index afbebe481b7..de613deeb04 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -102,8 +102,13 @@ changequote([, ])dnl ac_sub_cache_file="$ac_popdir/$cache_file" ;; esac - # The eval makes quoting arguments work. - if eval $ac_abs_srcdir/configure $ac_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $2 + dnl The eval makes quoting arguments work - specifically $2 where the + dnl quoting mechanisms used is "" rather than []. + dnl + dnl We need to execute another shell because some autoconf/shell combinations + dnl will choke after doing repeated APR_SUBDIR_CONFIG()s. (Namely Solaris + dnl and autoconf-2.54+) + if eval $SHELL $ac_abs_srcdir/configure $ac_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $2 then : echo "$1 configured properly" else From a106bbc884d54765a4887d2506fbe14c1b34c88f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 16 Feb 2003 09:56:30 +0000 Subject: [PATCH 4336/7878] .dbgmark was a very bad choice, because foo.dbgmark == foo.dbg in 8.3 notation. dbr simply stands for 'dbg rebased' and didn't sound like any 'database' extention I've encountered. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64356 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libapr.dsp b/libapr.dsp index d9636e52ef4..56438d566ef 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -58,9 +58,9 @@ LINK32=link.exe InputPath=.\Release\libapr.dll SOURCE="$(InputPath)" -".\Release\libapr.dbgmark" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +".\Release\libapr.dbr" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" rebase -q -b 0x6EEC0000 -x ".\Release" $(InputPath) - echo rebased > ".\Release\libapr.dbgmark" + echo rebased > ".\Release\libapr.dbr" # End Custom Build From cce4b4c694d7e98bbd980f43bc571fc9d3d9fe1a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 16 Feb 2003 10:00:08 +0000 Subject: [PATCH 4337/7878] After some less than considerable discussion on-list, it seems like there are no compelling arguments to retain the 'BIND_NOSTART' option on HP/UX, and several compelling reasons to drop it, including c++ static creators and possibly even some cases of c static initialization. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64357 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 69875f46ac9..f78fcf63989 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -119,7 +119,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *pool) { #if defined(DSO_USE_SHL) - shl_t os_handle = shl_load(path, BIND_IMMEDIATE|BIND_NOSTART, 0L); + shl_t os_handle = shl_load(path, BIND_IMMEDIATE, 0L); #elif defined(DSO_USE_DYLD) NSObjectFileImage image; From 86881c80d5400a83b0005e7334bf45934bfe204f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 16 Feb 2003 10:07:54 +0000 Subject: [PATCH 4338/7878] Several problems here; licenses were missing, and generally consistify the several flavors of this file, ensuring we get identical (or at least, preferably identical) results from doxygenation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64358 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 72 +++++++++++++++++++++++++++++++++++++++++++++++- include/apr.hnw | 35 ++++++++++++++--------- include/apr.hw | 34 ++++++++++++++++------- 3 files changed, 117 insertions(+), 24 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index ced68b1e36d..cb65477aebf 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -1,12 +1,81 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + #ifndef APR_H #define APR_H +/* GENERATED FILE WARNING! DO NOT EDIT apr.h + * + * You must modify apr.h.in instead. + * + * And please, make an effort to stub apr.hw and apr.hnw in the process. + * + * This is the Win32 specific version of apr.h. It is copied from + * apr.hw when building the apr.dsp or libapr.dsp project. */ + + /** * @file include/apr.h * @brief APR APR Main Include + * @remark This is a generated header generated from include/apr.h.in by + * ./configure, or copied from include/apr.hw or include/apr.hnw + * for Win32 or Netware by those build environments, respectively. */ + /** - * @defgroup APR APR Routines + * @defgroup APR APR Functions * @{ */ @@ -320,4 +389,5 @@ typedef @socklen_t_value@ apr_socklen_t; #error no decision has been made on APR_PATH_MAX for your platform #endif /** @} */ + #endif /* APR_H */ diff --git a/include/apr.hnw b/include/apr.hnw index 03beb91b8c6..cc6d65164d8 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -52,27 +52,35 @@ * . */ -/* - * Note: This is a NetWare specific version of apr.h. It is renamed to - * apr.h at the start of a Windows build. + +#ifndef APR_H +#define APR_H + +/* GENERATED FILE WARNING! DO NOT EDIT apr.h + * + * You must modify apr.hnw instead. + * + * And please, make an effort to stub apr.hw and apr.h.in in the process. + * + * This is the NetWare specific version of apr.h. It is copied from + * apr.hnw at the start of a NetWare build by prebuildNW.bat. */ -#ifdef NETWARE + /** - * @file include\apr.h - * @brief Basic APR header for NetWare - * @remark This is a NetWare specific version of apr.h. It is copied as - * apr.h at the start of a NetWare build through prebuildNW.bat. + * @file include/apr.h + * @brief APR APR Main Include + * @remark This is a generated header generated from include/apr.h.in by + * ./configure, or copied from include/apr.hw or include/apr.hnw + * for Win32 or Netware by those build environments, respectively. */ +#if defined(NETWARE) || defined(DOXYGEN) + /** * @defgroup APR APR Functions * @{ */ - -#ifndef APR_H -#define APR_H - #include #include #include @@ -338,7 +346,8 @@ typedef int apr_wait_t; #define APR_HAVE_INT64_STRFN 1 #define APR_INT64_STRFN strtoll -#endif /* APR_H */ /** @} */ + #endif /* NETWARE */ +#endif /* APR_H */ diff --git a/include/apr.hw b/include/apr.hw index 3c1bfba449d..fb5abb587b5 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -53,22 +53,35 @@ */ +#ifndef APR_H +#define APR_H + +/* GENERATED FILE WARNING! DO NOT EDIT apr.h + * + * You must modify apr.hw instead. + * + * And please, make an effort to stub apr.hnw and apr.h.in in the process. + * + * This is the Win32 specific version of apr.h. It is copied from + * apr.hw by the apr.dsp and libapr.dsp projects. + */ + + /** - * @file include\apr.h + * @file include/apr.h * @brief Basic APR header for WIN32 - * @remark This is a Windows specific version of apr.h. It is copied as - * apr.h at the start of a Windows build. + * @remark This is a generated header generated from include/apr.h.in by + * ./configure, or copied from include/apr.hw or include/apr.hnw + * for Win32 or Netware by those build environments, respectively. */ +#if defined(WIN32) || defined(DOXYGEN) + /** - * @defgroup APR APR Functions (WIN32) + * @defgroup APR APR Functions * @{ */ -#ifdef WIN32 -#ifndef APR_H -#define APR_H - /* Ignore most warnings (back down to /W3) for poorly constructed headers */ #if defined(_MSC_VER) && _MSC_VER >= 1200 @@ -492,7 +505,8 @@ struct iovec { #pragma warning(pop) #endif -#endif /* APR_H */ +/** @} */ #endif /* WIN32 */ -/** @} */ + +#endif /* APR_H */ From e9b231401efef2451809c60c245e6cd2491d27a4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 16 Feb 2003 10:10:20 +0000 Subject: [PATCH 4339/7878] Just an interesting observation to Win32 IPV6 hackers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64359 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 5ec4ae4f2c7..ef0ec101047 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -928,6 +928,9 @@ APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa) { #if APR_HAVE_IPV6 + /* XXX This line will segv on Win32 build with APR_HAVE_IPV6, + * but without the IPV6 drivers installed. + */ if (sa->sa.sin.sin_family == AF_INET) { if (ipsub->family == AF_INET && ((sa->sa.sin.sin_addr.s_addr & ipsub->mask[0]) == ipsub->sub[0])) { From cc557ca30a14da7939077db854251717a76957da Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 16 Feb 2003 10:12:45 +0000 Subject: [PATCH 4340/7878] Clarify the changeover with APR 1.0 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64360 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index a40637fc3e7..b2111848164 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -285,7 +285,8 @@ struct apr_hdtr_t { /** * Create a socket. - * @remark With APR 1.0, this function will pick up a new protocol parameter. + * @remark With APR 1.0, this function follows the prototype + * of apr_socket_create_ex. * @param new_sock The new socket that has been set up. * @param family The address family of the socket (e.g., APR_INET). * @param type The type of the socket (e.g., SOCK_STREAM). @@ -297,7 +298,8 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, /** * Create a socket. - * @remark With APR 1.0, this function will be removed. + * @remark With APR 1.0, this function is deprecated and apr_socket_create + * follows this prototype. * @param new_sock The new socket that has been set up. * @param family The address family of the socket (e.g., APR_INET). * @param type The type of the socket (e.g., SOCK_STREAM). From 538c6d28521a160976091e4e6e8b6b4e6b40603b Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Sun, 16 Feb 2003 21:59:09 +0000 Subject: [PATCH 4341/7878] Move the apr_filepath_list_split_impl and apr_filepath_list_merge_impl prototypes from include/arch/unix/apr_arch_file_io.h into a new private header, include/arch/apr_private_common.h, and include that from the various apr_private.h instances. Update the filepath.c and filepath_util.c files to reflect this change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64361 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 5 ++ file_io/unix/filepath.c | 1 + file_io/unix/filepath_util.c | 3 +- file_io/win32/filepath.c | 11 +--- include/arch/apr_private_common.h | 75 ++++++++++++++++++++++++++++ include/arch/netware/apr_private.h | 5 ++ include/arch/unix/apr_arch_file_io.h | 8 --- include/arch/win32/apr_private.h | 5 ++ 8 files changed, 95 insertions(+), 18 deletions(-) create mode 100644 include/arch/apr_private_common.h diff --git a/acconfig.h b/acconfig.h index cf48df04dde..cbd03e53259 100644 --- a/acconfig.h +++ b/acconfig.h @@ -42,4 +42,9 @@ #define apr_sigwait(a,b) sigwait((a),(b)) #endif +/* + * Include common private declarations. + */ +#include "../apr_private_common.h" + #endif /* APR_PRIVATE_H */ diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 3b4ac300396..2acc37b0df9 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -53,6 +53,7 @@ */ #include "apr.h" +#include "apr_private.h" #include "apr_arch_file_io.h" #include "apr_file_io.h" #include "apr_strings.h" diff --git a/file_io/unix/filepath_util.c b/file_io/unix/filepath_util.c index 1f909f35338..4b27e4f6766 100644 --- a/file_io/unix/filepath_util.c +++ b/file_io/unix/filepath_util.c @@ -61,7 +61,8 @@ #include "apr_pools.h" #include "apr_strings.h" #include "apr_tables.h" -#include "apr_arch_file_io.h" + +#include "apr_private.h" apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, const char *liststr, diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index f1edaaf26fc..874942ca056 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -53,6 +53,7 @@ */ #include "apr.h" +#include "apr_private.h" #include "apr_arch_file_io.h" #include "apr_strings.h" #include "apr_lib.h" @@ -977,21 +978,13 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } -apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, - const char *liststr, - char separator, - apr_pool_t *p); -apr_status_t apr_filepath_list_merge_impl(char **liststr, - apr_array_header_t *pathelts, - char separator, - apr_pool_t *p); - APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, const char *liststr, apr_pool_t *p) { return apr_filepath_list_split_impl(pathelts, liststr, ';', p); } + APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, apr_array_header_t *pathelts, apr_pool_t *p) diff --git a/include/arch/apr_private_common.h b/include/arch/apr_private_common.h new file mode 100644 index 00000000000..eb8a395fb32 --- /dev/null +++ b/include/arch/apr_private_common.h @@ -0,0 +1,75 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/* + * This file contains private declarations common to all architectures. + */ + +#ifndef APR_PRIVATE_COMMON_H +#define APR_PRIVATE_COMMON_H + +#include "apr_pools.h" +#include "apr_tables.h" + +apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, + const char *liststr, + char separator, + apr_pool_t *p); + +apr_status_t apr_filepath_list_merge_impl(char **liststr, + apr_array_header_t *pathelts, + char separator, + apr_pool_t *p); + +#endif /*APR_PRIVATE_COMMON_H*/ diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 8be54371b75..fef19ecbc22 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -189,5 +189,10 @@ void* getStatCache(); #undef malloc #define malloc(x) library_malloc(gLibHandle,x) +/* + * Include common private declarations. + */ +#include "../apr_private_common.h" + #endif /*APR_PRIVATE_H*/ #endif /*NETWARE*/ diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index 06911ad2af5..f04b4151720 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -153,14 +153,6 @@ apr_status_t apr_unix_file_cleanup(void *); mode_t apr_unix_perms2mode(apr_fileperms_t perms); apr_fileperms_t apr_unix_mode2perms(mode_t mode); -apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, - const char *liststr, - char separator, - apr_pool_t *p); -apr_status_t apr_filepath_list_merge_impl(char **liststr, - apr_array_header_t *pathelts, - char separator, - apr_pool_t *p); #endif /* ! FILE_IO_H */ diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index aec05c4b4ed..da476db552e 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -182,5 +182,10 @@ APR_DECLARE_DATA int errno; #define HAVE_GETNAMEINFO 1 #endif +/* + * Include common private declarations. + */ +#include "../apr_private_common.h" + #endif /*APR_PRIVATE_H*/ #endif /*WIN32*/ From 3ab888add7170d3206cc150cb0c82f52ef70f763 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 17 Feb 2003 02:36:21 +0000 Subject: [PATCH 4342/7878] Fix APR_LAYOUT to work with layout files with no preceding blank lines and emit errors when layout is not found. Also, add a third parameter that allows httpd to pass in the extra variables that it expects its config.layout to have. PR: 15679 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64362 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ build/apr_common.m4 | 18 +++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index cd66b35802c..b328a26e283 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR 0.9.2 + *) Fix APR_LAYOUT to work with layout files with no preceding blank lines + and emit errors when layout is not found. PR 15679. + [Justin Erenkrantz] + *) Add functions apr_filepath_list_split and apr_filepath_list_merge for managing search paths. [Branko Cibej] diff --git a/build/apr_common.m4 b/build/apr_common.m4 index de613deeb04..a3d90d63f8c 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -713,7 +713,7 @@ dnl that you surround the macro invocation with []s AC_DEFUN(APR_HELP_STRING,[ifelse(regexp(AC_ACVERSION, 2\.1), -1, AC_HELP_STRING([$1],[$2]),[ ][$1] substr([ ],len($1))[$2])]) dnl -dnl APR_LAYOUT(configlayout, layoutname) +dnl APR_LAYOUT(configlayout, layoutname [, extravars]) dnl AC_DEFUN(APR_LAYOUT,[ if test ! -f $srcdir/config.layout; then @@ -723,19 +723,23 @@ AC_DEFUN(APR_LAYOUT,[ fi pldconf=./config.pld changequote({,}) - sed -e "1,/[ ]*<[lL]ayout[ ]*$2[ ]*>[ ]*/d" \ + sed -e "1s/[ ]*<[lL]ayout[ ]*$2[ ]*>[ ]*//;t" \ + -e "1,/[ ]*<[lL]ayout[ ]*$2[ ]*>[ ]*/d" \ -e '/[ ]*<\/Layout>[ ]*/,$d' \ -e "s/^[ ]*//g" \ -e "s/:[ ]*/=\'/g" \ -e "s/[ ]*$/'/g" \ $1 > $pldconf layout_name=$2 + if test ! -s $pldconf; then + echo "** Error: unable to find layout $layout_name" + exit 1 + fi . $pldconf rm $pldconf for var in prefix exec_prefix bindir sbindir libexecdir mandir \ - sysconfdir datadir \ - includedir localstatedir runtimedir logfiledir libdir \ - installbuilddir libsuffix; do + sysconfdir datadir includedir localstatedir runtimedir \ + logfiledir libdir installbuilddir libsuffix $3; do eval "val=\"\$$var\"" case $val in *+) @@ -765,7 +769,7 @@ AC_DEFUN(APR_LAYOUT,[ ])dnl dnl -dnl APR_ENABLE_LAYOUT(default layout name) +dnl APR_ENABLE_LAYOUT(default layout name [, extra vars]) dnl AC_DEFUN(APR_ENABLE_LAYOUT,[ AC_ARG_ENABLE(layout, @@ -776,7 +780,7 @@ AC_ARG_ENABLE(layout, if test -z "$LAYOUT"; then LAYOUT="$1" fi -APR_LAYOUT($srcdir/config.layout, $LAYOUT) +APR_LAYOUT($srcdir/config.layout, $LAYOUT, $2) AC_MSG_CHECKING(for chosen layout) AC_MSG_RESULT($layout_name) From 7d094be626e5ac8cc1e0c8e873147b72dff5e769 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Mon, 17 Feb 2003 03:47:10 +0000 Subject: [PATCH 4343/7878] Added a new module, apr_env, for manipulating the environment. The new functions are apr_env_get, apr_env_set and apr_env_delete. Also added a set of tests for the new functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64363 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + apr.dsp | 12 +++ configure.in | 1 + include/apr_env.h | 107 ++++++++++++++++++++++ libapr.dsp | 12 +++ misc/unix/Makefile.in | 2 +- misc/unix/env.c | 128 ++++++++++++++++++++++++++ misc/win32/env.c | 207 ++++++++++++++++++++++++++++++++++++++++++ test/Makefile.in | 3 +- test/Makefile.win | 3 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testenv.c | 127 ++++++++++++++++++++++++++ 13 files changed, 604 insertions(+), 3 deletions(-) create mode 100644 include/apr_env.h create mode 100644 misc/unix/env.c create mode 100644 misc/win32/env.c create mode 100644 test/testenv.c diff --git a/CHANGES b/CHANGES index b328a26e283..0274ecfe88d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.2 + *) Add functions apr_env_get, apr_env_set and apr_env_delete for + manipulating the environment. [Branko Cibej] + *) Fix APR_LAYOUT to work with layout files with no preceding blank lines and emit errors when layout is not found. PR 15679. [Justin Erenkrantz] diff --git a/apr.dsp b/apr.dsp index 6015d284bc8..5370abee4d4 100644 --- a/apr.dsp +++ b/apr.dsp @@ -198,6 +198,10 @@ SOURCE=.\misc\win32\charset.c # End Source File # Begin Source File +SOURCE=.\misc\win32\env.c +# End Source File +# Begin Source File + SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File @@ -433,6 +437,10 @@ SOURCE=.\include\arch\win32\apr_arch_utf8.h SOURCE=.\include\arch\win32\apr_private.h # End Source File +# Begin Source File + +SOURCE=.\include\arch\apr_private_common.h +# End Source File # End Group # Begin Group "Public Header Files" @@ -484,6 +492,10 @@ SOURCE=.\include\apr_dso.h # End Source File # Begin Source File +SOURCE=.\include\apr_env.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_errno.h # End Source File # Begin Source File diff --git a/configure.in b/configure.in index 881e70cadfb..844157dd37e 100644 --- a/configure.in +++ b/configure.in @@ -817,6 +817,7 @@ AC_SUBST(sharedmem) dnl ----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) AC_CHECK_FUNCS(alloca calloc strcasecmp stricmp setsid isinf isnan) +AC_CHECK_FUNCS(getenv putenv setenv unsetenv) AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) AC_CHECK_FUNCS(writev) diff --git a/include/apr_env.h b/include/apr_env.h new file mode 100644 index 00000000000..f04d62044bf --- /dev/null +++ b/include/apr_env.h @@ -0,0 +1,107 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_ENV_H +#define APR_ENV_H +/** + * @file apr_env.h + * @brief APR Environment functions + */ +/** + * @defgroup APR_ENV Functions for manupulating the environment + * @ingroup APR_ENV + * @{ + */ + +#include "apr_errno.h" +#include "apr_pools.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * Get the value of an environment variable + * @param value the returned value, allocated from @a pool + * @param envvar the name of the environment variable + * @param pool where to allocate @a value and any temporary storage from + * @deffunc apr_status_t apr_env_get(char **value, const char *envvar, apr_pool_t *pool) + */ +APR_DECLARE(apr_status_t) apr_env_get(char **value, const char *envvar, + apr_pool_t *pool); + +/** + * Set the value of an environment variable + * @param envvar the name of the environment variable + * @param value the value to set + * @param pool where to allocate temporary storage from + * @deffunc apr_status_t apr_env_get(const char *envvar, const char *value, apr_pool_t *pool) + */ +APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, const char *value, + apr_pool_t *pool); + +/** + * Delete a variable from the environment + * @param envvar the name of the environment variable + * @param pool where to allocate temporary storage from + * @deffunc apr_status_t apr_env_delete(const char *envvar, apr_pool_t *pool) + */ +APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool); + + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif /* ! APR_ENV_H */ diff --git a/libapr.dsp b/libapr.dsp index 56438d566ef..66327672e04 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -213,6 +213,10 @@ SOURCE=.\misc\win32\charset.c # End Source File # Begin Source File +SOURCE=.\misc\win32\env.c +# End Source File +# Begin Source File + SOURCE=.\misc\unix\errorcodes.c # End Source File # Begin Source File @@ -448,6 +452,10 @@ SOURCE=.\include\arch\win32\apr_arch_utf8.h SOURCE=.\include\arch\win32\apr_private.h # End Source File +# Begin Source File + +SOURCE=.\include\arch\apr_private_common.h +# End Source File # End Group # Begin Group "Public Header Files" @@ -503,6 +511,10 @@ SOURCE=.\include\apr_errno.h # End Source File # Begin Source File +SOURCE=.\include\apr_env.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_file_info.h # End Source File # Begin Source File diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in index 28fef32d466..fffd81c16b2 100644 --- a/misc/unix/Makefile.in +++ b/misc/unix/Makefile.in @@ -3,7 +3,7 @@ VPATH = @srcdir@ TARGETS = \ start.lo getopt.lo otherchild.lo errorcodes.lo rand.lo version.lo \ - charset.lo + charset.lo env.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/misc/unix/env.c b/misc/unix/env.c new file mode 100644 index 00000000000..f8ef3c2a220 --- /dev/null +++ b/misc/unix/env.c @@ -0,0 +1,128 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#define APR_WANT_STRFUNC +#include "apr_want.h" +#include "apr.h" +#include "apr_private.h" +#include "apr_env.h" + +#if APR_HAVE_UNISTD_H +#include +#endif +#if APR_HAVE_STDLIB_H +#include +#endif + +APR_DECLARE(apr_status_t) apr_env_get(char **value, + const char *envvar, + apr_pool_t *pool) +{ +#ifdef HAVE_GETENV + + char *val = getenv(envvar); + if (!val) + return APR_ENOENT; + *value = val; + return APR_SUCCESS; + +#else + return APR_ENOTIMPL; +#endif +} + + +APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, + const char *value, + apr_pool_t *pool) +{ +#if defined(HAVE_SETENV) + + if (0 > setenv(envvar, value, 1)) + return APR_ENOMEM; + return APR_SUCCESS; + +#elif defined(HAVE_PUTENV) + + apr_size_t elen = strlen(envvar); + apr_size_t vlen = strlen(value); + char *env = apr_palloc(pool, elen + vlen + 2); + char *p = env + elen; + + memcpy(env, envvar, elen); + *p++ = '='; + memcpy(p, value, vlen); + p[vlen] = '\0'; + + if (0 > putenv(env)) + return APR_ENOMEM; + return APR_SUCCESS; + +#else + return APR_ENOTIMPL; +#endif +} + + +APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool) +{ +#ifdef HAVE_UNSETENV + + unsetenv(envvar); + return APR_SUCCESS; + +#else + return APR_ENOTIMPL; +#endif +} diff --git a/misc/win32/env.c b/misc/win32/env.c new file mode 100644 index 00000000000..4d005da2e86 --- /dev/null +++ b/misc/win32/env.c @@ -0,0 +1,207 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#define APR_WANT_STRFUNC +#include "apr_want.h" +#include "apr.h" +#include "apr_arch_misc.h" +#include "apr_arch_utf8.h" +#include "apr_env.h" +#include "apr_errno.h" +#include "apr_pools.h" + + +#if APR_HAS_UNICODE_FS +static apr_status_t widen_envvar_name (apr_wchar_t *buffer, + apr_size_t bufflen, + const char *envvar) +{ + apr_size_t inchars; + apr_status_t status; + + inchars = strlen(envvar) + 1; + status = apr_conv_utf8_to_ucs2(envvar, &inchars, buffer, &bufflen); + if (status == APR_INCOMPLETE) + status = APR_ENAMETOOLONG; + + return status; +} +#endif + + +APR_DECLARE(apr_status_t) apr_env_get(char **value, + const char *envvar, + apr_pool_t *pool) +{ + char *val = NULL; + DWORD size; + +#if APR_HAS_UNICODE_FS + IF_WIN_OS_IS_UNICODE + { + apr_wchar_t wenvvar[APR_PATH_MAX]; + apr_size_t inchars, outchars; + apr_wchar_t *wvalue, dummy; + apr_status_t status; + + status = widen_envvar_name(wenvvar, APR_PATH_MAX, envvar); + if (status) + return status; + + size = GetEnvironmentVariableW(wenvvar, &dummy, 0); + if (size == 0) + /* The environment variable doesn't exist. */ + return APR_ENOENT; + + wvalue = apr_palloc(pool, size * sizeof(*wvalue)); + size = GetEnvironmentVariableW(wenvvar, wvalue, size); + if (size == 0) + /* Mid-air collision?. Somebody must've changed the env. var. */ + return APR_INCOMPLETE; + + inchars = wcslen(wvalue) + 1; + outchars = 3 * inchars; /* Enougn for any UTF-8 representation */ + val = apr_palloc(pool, outchars); + status = apr_conv_ucs2_to_utf8(wvalue, &inchars, val, &outchars); + if (status) + return status; + } +#endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI + { + char dummy; + + size = GetEnvironmentVariableA(envvar, &dummy, 0); + if (size == 0) + /* The environment variable doesn't exist. */ + return APR_ENOENT; + + val = apr_palloc(pool, size); + size = GetEnvironmentVariableA(envvar, val, size); + if (size == 0) + /* Mid-air collision?. Somebody must've changed the env. var. */ + return APR_INCOMPLETE; + } +#endif + + *value = val; + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, + const char *value, + apr_pool_t *pool) +{ +#if APR_HAS_UNICODE_FS + IF_WIN_OS_IS_UNICODE + { + apr_wchar_t wenvvar[APR_PATH_MAX]; + apr_wchar_t *wvalue; + apr_size_t inchars, outchars; + apr_status_t status; + + status = widen_envvar_name(wenvvar, APR_PATH_MAX, envvar); + if (status) + return status; + + outchars = inchars = strlen(value) + 1; + wvalue = apr_palloc(pool, outchars * sizeof(*wvalue)); + status = apr_conv_utf8_to_ucs2(value, &inchars, wvalue, &outchars); + if (status) + return status; + + if (!SetEnvironmentVariableW(wenvvar, wvalue)) + return apr_get_os_error(); + } +#endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI + { + if (!SetEnvironmentVariableA(envvar, value)) + return apr_get_os_error(); + } +#endif + + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool) +{ +#if APR_HAS_UNICODE_FS + IF_WIN_OS_IS_UNICODE + { + apr_wchar_t wenvvar[APR_PATH_MAX]; + apr_status_t status; + + status = widen_envvar_name(wenvvar, APR_PATH_MAX, envvar); + if (status) + return status; + + if (!SetEnvironmentVariableW(wenvvar, NULL)) + return apr_get_os_error(); + } +#endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI + { + if (!SetEnvironmentVariableA(envvar, NULL)) + return apr_get_os_error(); + } +#endif + + return APR_SUCCESS; +} diff --git a/test/Makefile.in b/test/Makefile.in index 70f73cdfd87..21cef88b55b 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -102,7 +102,8 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ - testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo + testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ + testenv.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/Makefile.win b/test/Makefile.win index 3437f45aa37..d1311d82f9c 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -99,7 +99,8 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testfmt.obj testfile.obj testdir.obj testfileinfo.obj testrand.obj \ testdso.obj testoc.obj testdup.obj testsockets.obj testproc.obj \ testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \ - testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj + testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ + testenv.obj testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS) $(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ diff --git a/test/test_apr.h b/test/test_apr.h index 4f0d5768275..90c6ffabef8 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -95,6 +95,7 @@ CuSuite *testgetopt(void); CuSuite *testnames(void); CuSuite *testuser(void); CuSuite *testpath(void); +CuSuite *testenv(void); /* Assert that RV is an APR_SUCCESS value; else fail giving strerror * for RV and CONTEXT message. */ diff --git a/test/testall.c b/test/testall.c index da24dd52ebd..cdf560fa9d8 100644 --- a/test/testall.c +++ b/test/testall.c @@ -107,6 +107,7 @@ static const struct testlist { {"testnames", testnames}, {"testuser", testuser}, {"testpath", testpath}, + {"testenv", testenv}, {"LastTest", NULL} }; diff --git a/test/testenv.c b/test/testenv.c new file mode 100644 index 00000000000..e1ec7c00e23 --- /dev/null +++ b/test/testenv.c @@ -0,0 +1,127 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_env.h" +#include "apr_errno.h" +#include "test_apr.h" + +#define TEST_ENVVAR_NAME "apr_test_envvar" +#define TEST_ENVVAR_VALUE "Just a value that we'll check" + +static int have_env_set; +static int have_env_get; + +static void test_setenv(CuTest *tc) +{ + apr_status_t rv; + + rv = apr_env_set(TEST_ENVVAR_NAME, TEST_ENVVAR_VALUE, p); + have_env_set = (rv != APR_ENOTIMPL); + if (!have_env_set) { + CuNotImpl(tc, "apr_env_set"); + } + apr_assert_success(tc, "set environment variable", rv); +} + +static void test_getenv(CuTest *tc) +{ + char *value; + apr_status_t rv; + + if (!have_env_set) { + CuNotImpl(tc, "apr_env_set (skip test for apr_env_get)"); + } + + rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); + have_env_get = (rv != APR_ENOTIMPL); + if (!have_env_get) { + CuNotImpl(tc, "apr_env_get"); + } + apr_assert_success(tc, "get environment variable", rv); + CuAssertStrEquals(tc, TEST_ENVVAR_VALUE, value); +} + +static void test_delenv(CuTest *tc) +{ + char *value; + apr_status_t rv; + + if (!have_env_set) { + CuNotImpl(tc, "apr_env_set (skip test for apr_env_delete)"); + } + + rv = apr_env_delete(TEST_ENVVAR_NAME, p); + if (rv == APR_ENOTIMPL) { + CuNotImpl(tc, "apr_env_delete"); + } + apr_assert_success(tc, "delete environment variable", rv); + + if (!have_env_get) { + CuNotImpl(tc, "apr_env_get (skip sanity check for apr_env_delete)"); + } + rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); + CuAssertIntEquals(tc, APR_ENOENT, rv); +} + +CuSuite *testenv(void) +{ + CuSuite *suite = CuSuiteNew("Environment"); + + SUITE_ADD_TEST(suite, test_setenv); + SUITE_ADD_TEST(suite, test_getenv); + SUITE_ADD_TEST(suite, test_delenv); + + return suite; +} + From 18cd6b2f6e555f77f41d6783f0b428a91f306cd6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 17 Feb 2003 15:06:12 +0000 Subject: [PATCH 4344/7878] clarify where the storage comes from with apr_sockaddr_ip_get() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64364 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index b2111848164..b8d85f1ea13 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -743,7 +743,8 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, /** * Return the IP address (in numeric address string format) in - * an APR socket address. + * an APR socket address. APR will allocate storage for the IP address + * string from the pool of the apr_sockaddr_t. * @param addr The IP address. * @param sockaddr The socket address to reference. */ From 0197a5071ec73bb77ea4b3af011aca8a174b710c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 18 Feb 2003 14:21:03 +0000 Subject: [PATCH 4345/7878] fix a typo in a comment Submitted by: jmc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64365 13f79535-47bb-0310-9956-ffa450edef68 --- dso/aix/dso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 713e6cbb21e..0dedc49c1c4 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -121,7 +121,7 @@ #define RTLD_GLOBAL 0x100 /* allow symbols to be global */ /* - * To be able to intialize, a library may provide a dl_info structure + * To be able to initialize, a library may provide a dl_info structure * that contains functions to be called to initialize and terminate. */ struct dl_info { From 445c66f6b1a1c47f7094c088011108b3ddac4795 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 18 Feb 2003 19:47:42 +0000 Subject: [PATCH 4346/7878] Added the apr_env functions to the NetWare build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64366 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 + build/nw_export.inc | 1 + 2 files changed, 2 insertions(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index 3f074e9e408..ad4c05be763 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -252,6 +252,7 @@ FILES_lib_objs = \ $(OBJDIR)/dir.o \ $(OBJDIR)/dso.o \ $(OBJDIR)/errorcodes.o \ + $(OBJDIR)/env.o \ $(OBJDIR)/fileacc.o \ $(OBJDIR)/filedup.o \ $(OBJDIR)/filepath.o \ diff --git a/build/nw_export.inc b/build/nw_export.inc index d13f71de401..294e179a29f 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -14,6 +14,7 @@ #include "apr_atomic.h" #include "apr_compat.h" #include "apr_dso.h" +#include "apr_env.h" #include "apr_errno.h" #include "apr_file_info.h" #include "apr_file_io.h" From 378b758bcda4b160d97aac4b3c23ec9aa6f3605d Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 18 Feb 2003 19:48:04 +0000 Subject: [PATCH 4347/7878] Added the apr_env test to the NetWare test build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64367 13f79535-47bb-0310-9956-ffa450edef68 --- test/nwgnuaprtest | 1 + 1 file changed, 1 insertion(+) diff --git a/test/nwgnuaprtest b/test/nwgnuaprtest index babe4a4d19e..04a7d43ebd6 100644 --- a/test/nwgnuaprtest +++ b/test/nwgnuaprtest @@ -174,6 +174,7 @@ FILES_nlm_objs = \ $(OBJDIR)/testdir.o \ $(OBJDIR)/testdup.o \ $(OBJDIR)/testdso.o \ + $(OBJDIR)/testenv.o \ $(OBJDIR)/testfileinfo.o \ $(OBJDIR)/testfile.o \ $(OBJDIR)/testfmt.o \ From 884b0bf5e0e87a73a9f8ec4039528eb2d4e8a432 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 19 Feb 2003 12:48:49 +0000 Subject: [PATCH 4348/7878] make a few changes to warnings with native compiler for AIX: add -qinfo=pro always to warning about missing prototypes remove -qwarn=64 from maintainer mode (it generated a bazillion warnings, most of which were for things we don't care about; somebody that wants to go through them religiously will just have to manually add -qwarn=64) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64368 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- configure.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index a93de9cfa3f..356559fe6da 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -59,7 +59,7 @@ if test "x$apr_preload_done" != "xyes" ; then dnl If using xlc, remember it, and give it the right options. if $CC 2>&1 | grep 'xlc' > /dev/null; then APR_SETIFNULL(AIX_XLC, [yes]) - APR_ADDTO(CFLAGS, [-qHALT=E]) + APR_ADDTO(CFLAGS, [-qHALT=E -qinfo=pro]) fi APR_SETIFNULL(apr_iconv_inbuf_const, [1]) APR_SETIFNULL(apr_sysvsem_is_global, [yes]) diff --git a/configure.in b/configure.in index 844157dd37e..80432527561 100644 --- a/configure.in +++ b/configure.in @@ -226,7 +226,7 @@ AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations]) elif test "$AIX_XLC" = "yes"; then - APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE -qwarn64 -qcheck=all) + APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE -qcheck=all) fi ])dnl From 80b6ff2d1464110eba86ea22771b66bf500d52ff Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 20 Feb 2003 15:55:07 +0000 Subject: [PATCH 4349/7878] After consulting with the APR list, it was decided that /map file creation is fairly redundant when you retain rich .pdb debugging symbol files. We have rarely used them, and generally .dbg and .pdb files prove much more useful for the cases we have. While eliminating /map files, we are also shrinking the size of the .dbg files by stripping 'private' symbol information. Really this means less rich diagnostics from Dr. Watson on NT or Win9x when they query the .dbg symbols in creating a DrWatson log file. But it's more than compensated for on newer OS'es where Dr. Watson will query the .pdb symbols, on all Win32 flavors when WinDbg is used with the .pdb symbols, and the fact that the distribution of binary symbols will use less bandwidth when less information is duplicated from the .pdb format into the .dbg files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64369 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 10 +++++----- test/testapp.dsp | 8 ++++---- test/testappnt.dsp | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libapr.dsp b/libapr.dsp index 66327672e04..a8b3d7cc9a0 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -52,14 +52,14 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /map /machine:I386 -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /map /debug /debugtype:both /machine:I386 /pdbtype:sept +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /debug /debugtype:both /machine:I386 /pdbtype:sept # Begin Custom Build - Extracting .dbg symbols from $(InputPath) InputPath=.\Release\libapr.dll SOURCE="$(InputPath)" ".\Release\libapr.dbr" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - rebase -q -b 0x6EEC0000 -x ".\Release" $(InputPath) + rebase -q -p -b 0x6EEC0000 -x ".\Release" $(InputPath) echo rebased > ".\Release\libapr.dbr" # End Custom Build @@ -87,8 +87,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386 !ENDIF diff --git a/test/testapp.dsp b/test/testapp.dsp index 9260851fb84..9c7733dd388 100644 --- a/test/testapp.dsp +++ b/test/testapp.dsp @@ -49,8 +49,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /map /machine:I386 -# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /map /machine:I386 +# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "testapp - Win32 Debug" @@ -73,8 +73,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /map /debug /machine:I386 -# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /map /debug /machine:I386 +# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 !ENDIF diff --git a/test/testappnt.dsp b/test/testappnt.dsp index 4f258b29d8b..54aa698cab7 100644 --- a/test/testappnt.dsp +++ b/test/testappnt.dsp @@ -49,8 +49,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /map /machine:I386 -# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console /map /machine:I386 +# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "testappnt - Win32 Debug" @@ -73,8 +73,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /map /debug /machine:I386 -# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console /incremental:no /map /debug /machine:I386 +# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console /incremental:no /debug /machine:I386 !ENDIF From ad48ec8f88e55973c5f09bf7aa277982173a8a47 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 22 Feb 2003 09:10:52 +0000 Subject: [PATCH 4350/7878] If we have realpath available, we need to transform APR_SOURCE_DIR too. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64370 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 1 + 1 file changed, 1 insertion(+) diff --git a/apr-config.in b/apr-config.in index b49e119c23c..643d0d79d7b 100644 --- a/apr-config.in +++ b/apr-config.in @@ -126,6 +126,7 @@ thisdir="`cd $thisdir && pwd`" # Otherwise, being in a symlinked dir may result in incorrect output. if test -x "`which realpath 2>/dev/null`"; then thisdir="`realpath $thisdir`" + APR_SOURCE_DIR="`realpath $APR_SOURCE_DIR`" fi if test -d $bindir; then tmpbindir="`cd $bindir && pwd`" From 127a96da58578fbb36b873d15dbdfbd2ae876c68 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sun, 23 Feb 2003 16:40:31 +0000 Subject: [PATCH 4351/7878] When we generate our own semaphore name (internally) when using Posix semaphores, initially try a name more unique (which unfortunately may also be larger than the least-common-denominator in names). If that fails, however, we gracefully use the old naming mechanism. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64371 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ locks/unix/proc_mutex.c | 30 +++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 0274ecfe88d..c0e509fd13f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.2 + *) When generating a semaphore name for posixsem locking, try to + be a little more robust (and unique). [Jim Jagielski] + *) Add functions apr_env_get, apr_env_set and apr_env_delete for manipulating the environment. [Branko Cibej] diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 67656d867f2..2d3eebf2d5c 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -91,9 +91,10 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, { sem_t *psem; apr_status_t stat; - char semname[14]; + char semname[31]; apr_time_t now; - unsigned long epoch; + unsigned long sec; + unsigned long usec; new_mutex->interproc = apr_palloc(new_mutex->pool, sizeof(*new_mutex->interproc)); @@ -104,20 +105,34 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, * - be at most 14 chars * - be unique and not match anything on the filesystem * - * Because of this, we ignore fname and craft our own. + * Because of this, we ignore fname, and try our + * own naming system. We tuck the name away, since it might + * be useful for debugging. to make this as robust as possible, + * we initially try something larger (and hopefully more unique) + * and gracefully fail down to the LCD above. + * + * NOTE: Darwin (Mac OS X) seems to be the most restrictive + * implementation. Versions previous to Darwin 6.2 had the 14 + * char limit, but later rev's allow up to 31 characters. * * FIXME: There is a small window of opportunity where * instead of getting a new semaphore descriptor, we get * a previously obtained one. This can happen if the requests - * are made at the "same time" (within a second, due to the - * apr_time_now() call) and in the small span of time between + * are made at the "same time" and in the small span of time between * the sem_open and the sem_unlink. Use of O_EXCL does not * help here however... + * */ now = apr_time_now(); - epoch = apr_time_sec(now); - apr_snprintf(semname, sizeof(semname), "/ApR.%lx", epoch); + sec = apr_time_sec(now); + usec = apr_time_usec(now); + apr_snprintf(semname, sizeof(semname), "/ApR.%lxZ%lx", sec, usec); psem = sem_open((const char *) semname, O_CREAT, 0644, 1); + if ((psem == (sem_t *)SEM_FAILED) && (errno == ENAMETOOLONG)) { + /* Oh well, good try */ + semname[13] = '\0'; + psem = sem_open((const char *) semname, O_CREAT, 0644, 1); + } if (psem == (sem_t *)SEM_FAILED) { stat = errno; @@ -127,6 +142,7 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, /* Ahhh. The joys of Posix sems. Predelete it... */ sem_unlink((const char *) semname); new_mutex->interproc->filedes = (int)psem; /* Ugg */ + new_mutex->fname = apr_pstrdup(new_mutex->pool, semname); apr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, apr_proc_mutex_cleanup, apr_pool_cleanup_null); From 14ae24b11aa7e9b404fc166dea3c9475c1f2c94a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Feb 2003 20:32:02 +0000 Subject: [PATCH 4352/7878] APR_NOPROC is sort of bogus (we don't check args, remember?) but it really didn't convey what we mean if a process *is* passed but not recognized by APR as one of APR's own (e.g. calling unregister other child with an unregistered process.) Add APR_EPROC_UNKNOWN for that definition. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64372 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 5 +++++ misc/unix/errorcodes.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/include/apr_errno.h b/include/apr_errno.h index 2311ce3a58d..74f34a038a7 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -259,6 +259,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * APR_EINCOMPLETE The given path was neither relative nor absolute. * APR_EABOVEROOT The given path was above the root path. * APR_EBUSY The given lock was busy. + * APR_EPROC_UNKNOWN The given process wasn't recognized by APR * * @{ */ @@ -312,6 +313,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_EPATHWILD (APR_OS_START_ERROR + 25) /** @see APR_STATUS_IS_ESYMNOTFOUND */ #define APR_ESYMNOTFOUND (APR_OS_START_ERROR + 26) +/** @see APR_STATUS_IS_EPROC_UNKNOWN */ +#define APR_EPROC_UNKNOWN (APR_OS_START_ERROR + 27) /* APR ERROR VALUE TESTS */ /** @@ -396,6 +399,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #else #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND) #endif +/** The given process was not recognized by APR. */ +#define APR_STATUS_IS_EPROC_UNKNOWN(s) ((s) == APR_EPROC_UNKNOWN) /* APR STATUS VALUES */ /** @see APR_STATUS_IS_INCHILD */ diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 98c529cae50..d4820a18412 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -164,6 +164,8 @@ static char *apr_error_string(apr_status_t statcode) return "The given path was above the root path"; case APR_EBADPATH: return "The given path misformatted or contained invalid characters"; + case APR_EPROC_UNKNOWN: + return "The process is not recognized."; default: return "Error string not specified yet"; } From 9767e9e443ebd7fbad6939ca0840f09cb220faab Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Feb 2003 21:28:34 +0000 Subject: [PATCH 4353/7878] Several good changes. We replaced the following functions: apr_proc_other_child_check [Unix] -> apr_proc_other_child_refresh_all(APR_OC_REASON_RESTART); apr_proc_other_child_check [Win32] -> apr_proc_other_child_refresh_all(APR_OC_REASON_RUNNING); apr_proc_other_child_read [Unix MPMs] -> apr_proc_other_child_alert(pid, APR_OC_REASON_DEATH and introduce a single checkup flavor apr_proc_other_child_refresh to update just a single child process. _alert() is an assertion that some health transition just occurred, while _refresh() checks the health and provides notification to any still-running processes. This code is nominially vetted, but I'm bringing it back down on OSX after this commit to begin vetting the Unix side. Helpers welcomed!!! Now it's possible for the MPMs to be rewritten so they are legible, however the patch is binary compatible. Finally, we always export all entry points even if they aren't implemented to ensure binary compatibility. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64373 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 70 +++++++++++---- misc/unix/otherchild.c | 182 ++++++++++++++++++++++++-------------- 2 files changed, 168 insertions(+), 84 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 435082f5770..d40856097f3 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -147,6 +147,10 @@ typedef enum { * kill the child) */ #define APR_OC_REASON_LOST 4 /**< somehow the child exited without * us knowing ... buggy os? */ +#define APR_OC_REASON_RUNNING 5 /**< a health check is occuring, + * for most maintainence functions + * this is a no-op. + */ /** @} */ #endif /* APR_HAS_OTHER_CHILD */ @@ -610,6 +614,8 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, * child is dead or not. * * @param p Pool to allocate child information out of. + * @bug Passing proc as a *proc rather than **proc was an odd choice + * for some platforms... this should be revisited in 1.0 */ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, int *exitcode, @@ -628,21 +634,24 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, */ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize); -#if APR_HAS_OTHER_CHILD - /** - * Register an other_child -- a child which must be kept track of so - * that the program knows when it has died or disappeared. - * @param pid pid is the pid of the child. + * Register an other_child -- a child associated to its registered + * maintence callback. This callback is invoked when the process + * dies, is disconnected or disappears. + * @param proc The child process to register. * @param maintenance maintenance is a function that is invoked with a * reason and the data pointer passed here. - * @param data The data to pass to the maintenance function. + * @param data Opaque context data passed to the maintenance function. * @param write_fd An fd that is probed for writing. If it is ever unwritable * then the maintenance is invoked with reason * OC_REASON_UNWRITABLE. * @param p The pool to use for allocating memory. + * @bug write_fd duplicates the proc->out stream, it's really redundant + * and should be replaced in the APR 1.0 API with a bitflag of which + * proc->in/out/err handles should be health checked. + * @bug no platform currently tests the pipes health. */ -APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid, +APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc, void (*maintenance) (int reason, void *, int status), @@ -650,7 +659,7 @@ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid, apr_pool_t *p); /** - * Stop watching the specified process. + * Stop watching the specified other child. * @param data The data to pass to the maintenance function. This is * used to find the process to unregister. * @warning Since this can be called by a maintenance function while we're @@ -661,20 +670,43 @@ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid, APR_DECLARE(void) apr_proc_other_child_unregister(void *data); /** - * Check on the specified process. If it is gone, call the maintenance - * function. - * @param pid The process to check. + * Notify the maintenance callback of a registered other child process + * that application has detected an event, such as death. + * @param proc The process to check. * @param status The status to pass to the maintenance function. + * @remark An example of code using this behavior; + *
    + * rv = apr_proc_wait_all_procs(&proc, &exitcode, &status, APR_WAIT, p);
    + * if (APR_STATUS_IS_CHILD_DONE(rv)) {
    + * #if APR_HAS_OTHER_CHILD
    + *     if (apr_proc_other_child_alert(&proc, APR_OC_REASON_DEATH, status)
    + *             == APR_SUCCESS) {
    + *         ;  (already handled)
    + *     }
    + *     else
    + * #endif
    + *         [... handling non-otherchild processes death ...]
    + * 
    */ -APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *pid, int status); +APR_DECLARE(apr_status_t) apr_proc_other_child_alert(apr_proc_t *proc, + int reason, + int status); -/** - * Loop through all registered other_children and call the appropriate - * maintenance function when necessary. +APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, + int reason); + +APR_DECLARE(void) apr_proc_other_child_refresh_all(int reason); + +/** @deprecated + * @see apr_proc_other_child_refresh_all(APR_OC_REASON_RESTART) */ -APR_DECLARE(void) apr_proc_other_child_check(void); +APR_DECLARE(void) apr_proc_other_child_check(void); + +/** @deprecated + * @see apr_proc_other_child_alert() + */ +APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *proc, int status); -#endif /* APR_HAS_OTHER_CHILD */ /** * Terminate a process. @@ -686,7 +718,7 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); /** * Register a process to be killed when a pool dies. * @param a The pool to use to define the processes lifetime - * @param pid The process to register + * @param proc The process to register * @param how How to kill the process, one of: *
      *         APR_KILL_NEVER         -- process is never sent any signals
    @@ -696,7 +728,7 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig);
      *         APR_KILL_ONLY_ONCE     -- send SIGTERM and then wait
      * 
    */ -APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *pid, +APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *proc, apr_kill_conditions_e how); #if APR_HAS_THREADS diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index eb47228ea6c..4cd770b5902 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -90,7 +90,7 @@ static apr_status_t other_child_cleanup(void *data) return APR_SUCCESS; } -APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid, +APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc, void (*maintenance) (int reason, void *, int status), void *data, apr_file_t *write_fd, apr_pool_t *p) { @@ -98,7 +98,7 @@ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *pid, ocr = apr_palloc(p, sizeof(*ocr)); ocr->p = p; - ocr->proc = pid; + ocr->proc = proc; ocr->maintenance = maintenance; ocr->data = data; if (write_fd == NULL) { @@ -138,91 +138,143 @@ APR_DECLARE(void) apr_proc_other_child_unregister(void *data) other_child_cleanup(data); } -APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *pid, int status) +APR_DECLARE(apr_status_t) apr_proc_other_child_alert(apr_proc_t *proc, + int reason, + int status) { apr_other_child_rec_t *ocr, *nocr; for (ocr = other_children; ocr; ocr = nocr) { nocr = ocr->next; - if (ocr->proc->pid != pid->pid) + if (ocr->proc->pid != proc->pid) continue; ocr->proc = NULL; - (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status); - return 0; + (*ocr->maintenance) (reason, ocr->data, status); + return APR_SUCCESS; } - return APR_CHILD_NOTDONE; + return APR_EPROC_UNKNOWN; } -#ifdef WIN32 -/* - * Run the list of Other Children and restart the ones that have died. - * ToDo: APR'ize this function so it will serve Unix and Win32. - * Not clear to me how to make the Win32 function behave exactly like - * the non-win32 branch. wgs - */ -APR_DECLARE(void) apr_proc_other_child_check(void) -{ - apr_other_child_rec_t *ocr, *nocr; - DWORD status; +APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, + int reason) +{ /* Todo: - * Implement code to detect if a pipe is still alive on Windows. + * Implement code to detect if pipes are still alive. */ - if (other_children == NULL) - return; +#ifdef WIN32 + DWORD status; - for (ocr = other_children; ocr; ocr = nocr) { - nocr = ocr->next; - if (ocr->proc == NULL) - continue; + if (ocr->proc == NULL) + return; - if (!ocr->proc->hproc) { - /* Already mopped up, perhaps we apr_proc_kill'ed it */ - (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, -1); - } - else if (!GetExitCodeProcess(ocr->proc->hproc, &status)) { - CloseHandle(ocr->proc->hproc); - ocr->proc = NULL; - (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1); - } - else if (status == STILL_ACTIVE) { - (*ocr->maintenance) (APR_OC_REASON_RESTART, ocr->data, -1); - } - else { - CloseHandle(ocr->proc->hproc); - ocr->proc->hproc = NULL; - ocr->proc = NULL; - (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status); - } + if (!ocr->proc->hproc) { + /* Already mopped up, perhaps we apr_proc_kill'ed it */ + (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, -1); } -} + else if (!GetExitCodeProcess(ocr->proc->hproc, &status)) { + CloseHandle(ocr->proc->hproc); + ocr->proc = NULL; + (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1); + } + else if (status == STILL_ACTIVE) { + (*ocr->maintenance) (reason, ocr->data, -1); + } + else { + CloseHandle(ocr->proc->hproc); + ocr->proc->hproc = NULL; + ocr->proc = NULL; + (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status); + } + #else /* ndef Win32 */ -APR_DECLARE(void) apr_proc_other_child_check(void) -{ - apr_other_child_rec_t *ocr, *nocr; pid_t waitret; int status; - for (ocr = other_children; ocr; ocr = nocr) { - nocr = ocr->next; - if (ocr->proc == NULL) - continue; + if (ocr->proc == NULL) + return; - waitret = waitpid(ocr->proc->pid, &status, WNOHANG); - if (waitret == ocr->proc->pid) { - ocr->proc = NULL; - (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status); - } - else if (waitret == 0) { - (*ocr->maintenance) (APR_OC_REASON_RESTART, ocr->data, -1); - } - else if (waitret == -1) { - /* uh what the heck? they didn't call unregister? */ - ocr->proc = NULL; - (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1); - } + waitret = waitpid(ocr->proc->pid, &status, WNOHANG); + if (waitret == ocr->proc->pid) { + ocr->proc = NULL; + (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status); + } + else if (waitret == 0) { + (*ocr->maintenance) (reason, ocr->data, -1); + } + else if (waitret == -1) { + /* uh what the heck? they didn't call unregister? */ + ocr->proc = NULL; + (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1); } -} #endif +} + +APR_DECLARE(void) apr_proc_other_child_refresh_all(int reason) +{ + apr_other_child_rec_t *ocr, *next_ocr; + + for (ocr = other_children; ocr; ocr = next_ocr) { + next_ocr = ocr->next; + apr_proc_other_child_refresh(ocr, reason); + } +} + +#else /* !APR_HAS_OTHER_CHILD */ + +APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc, + void (*maintenance) (int reason, void *, int status), + void *data, apr_file_t *write_fd, apr_pool_t *p) +{ + return; +} + +APR_DECLARE(void) apr_proc_other_child_unregister(void *data) +{ + return; +} + +APR_DECLARE(apr_status_t) apr_proc_other_child_alert(apr_proc_t *proc, + int reason, + int status) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, + int reason) +{ + return; +} + +APR_DECLARE(void) apr_proc_other_child_refresh_all(int reason) +{ + return; +} #endif /* APR_HAS_OTHER_CHILD */ + + +/* XXX: deprecated for removal in 1.0 + * The checks behaved differently between win32 and unix, while + * the old win32 code did a health check, the unix code called + * other_child_check only at restart. + */ +APR_DECLARE(void) apr_proc_other_child_check(void) +{ +#ifdef WIN32 + apr_proc_other_child_refresh_all(APR_OC_REASON_RUNNING); +#else + apr_proc_other_child_refresh_all(APR_OC_REASON_RESTART); +#endif +} + +/* XXX: deprecated for removal in 1.0 + * This really didn't test any sort of read - it simply notified + * the maintenance function that the process had died. + */ +APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *proc, int status) +{ + return apr_proc_other_child_alert(proc, APR_OC_REASON_DEATH, status); +} + From a8b2ff2a9f878528b45e7fedea8c471881e44fd7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Feb 2003 21:54:27 +0000 Subject: [PATCH 4354/7878] And with the last commit, we aught to have Win32 otherchildren once again git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64374 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index fb5abb587b5..634cd42ce96 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -294,7 +294,7 @@ extern "C" { #define APR_HAS_MMAP 1 #define APR_HAS_FORK 0 #define APR_HAS_RANDOM 1 -#define APR_HAS_OTHER_CHILD 0 +#define APR_HAS_OTHER_CHILD 1 #define APR_HAS_DSO 1 #define APR_HAS_SO_ACCEPTFILTER 0 #define APR_HAS_UNICODE_FS 1 From c01e8876d7a7cfabd5674357aae494294c854465 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Feb 2003 21:55:23 +0000 Subject: [PATCH 4355/7878] We don't guard against NULL args. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64375 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/proc.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 45ab03d26a1..b147ef285c9 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -586,9 +586,6 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, ULONG rc; PID pid; - if (!proc) - return APR_ENOPROC; - rc = DosWaitChild(DCWA_PROCESSTREE, waithow == APR_WAIT ? DCWW_WAIT : DCWW_NOWAIT, &codes, &pid, 0); if (rc == 0) { @@ -611,10 +608,6 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, RESULTCODES codes; ULONG rc; PID pid; - - if (!proc) - return APR_ENOPROC; - rc = DosWaitChild(DCWA_PROCESS, waithow == APR_WAIT ? DCWW_WAIT : DCWW_NOWAIT, &codes, &pid, proc->pid); if (rc == 0) { From 07baa1c5804b2198efe666023280046cba487f14 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Feb 2003 23:07:30 +0000 Subject: [PATCH 4356/7878] MAXIMUM_WAIT_OBJECTS has no basis in APR, and is defined for Win32 within WinNT.h - and should never be examined outside of the Win32 code (this is confirmed for Apache, it's only referenced in util_win32.c and mpm_winnt.c). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64376 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index cabdcb95100..99b6666cb63 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -85,18 +85,6 @@ extern "C" { #define TRUE (!FALSE) #endif -/** - * The Win32 call WaitForMultipleObjects will only allow you to wait for - * a maximum of MAXIMUM_WAIT_OBJECTS (current 64). Since the threading - * model in the multithreaded version of apache wants to use this call, - * we are restricted to a maximum of 64 threads. - * @see wait_for_many_objects for a way to increase this size - */ - -#ifndef MAXIMUM_WAIT_OBJECTS -#define MAXIMUM_WAIT_OBJECTS 64 -#endif - /** a space */ #define APR_ASCII_BLANK '\040' /** a carrige return */ From 35213b96a3798ae7f1a06114a23e763adf65e958 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Feb 2003 23:12:10 +0000 Subject: [PATCH 4357/7878] Namespace protection, thanks to Craig Rodrigues for the original patch. We deprecate these symbols till we can eradicate them from APR 1.0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64377 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_fnmatch.h | 29 ++++++++++++++++++----------- include/apr_network_io.h | 9 +++++++-- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index 48fc4d9e7dc..3dfe6d66633 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -53,25 +53,32 @@ extern "C" { #endif -#define FNM_NOMATCH 1 /**< Match failed. */ +#define APR_FNM_NOMATCH 1 /**< Match failed. */ -#define FNM_NOESCAPE 0x01 /**< Disable backslash escaping. */ -#define FNM_PATHNAME 0x02 /**< Slash must be matched by slash. */ -#define FNM_PERIOD 0x04 /**< Period must be matched by period. */ - -#define FNM_CASE_BLIND 0x08 /**< Compare characters case-insensitively. @remark This flag is an Apache addition */ +#define APR_FNM_NOESCAPE 0x01 /**< Disable backslash escaping. */ +#define APR_FNM_PATHNAME 0x02 /**< Slash must be matched by slash. */ +#define APR_FNM_PERIOD 0x04 /**< Period must be matched by period. */ +#define APR_FNM_CASE_BLIND 0x08 /**< Compare characters case-insensitively. + * @remark This flag is an Apache addition + */ + +#define FNM_NOMATCH APR_FNM_NOMATCH /**< @deprecated */ +#define FNM_NOESCAPE APR_FNM_NOESCAPE /**< @deprecated */ +#define FNM_PATHNAME APR_FNM_PATHNAME /**< @deprecated */ +#define FNM_PERIOD APR_FNM_PERIOD /**< @deprecated */ +#define FNM_CASE_BLIND APR_FNM_CASE_BLIND /**< @deprecated */ /** * Try to match the string to the given pattern, return APR_SUCCESS if - * match, else return FNM_NOMATCH. + * match, else return APR_FNM_NOMATCH. * @param pattern The pattern to match to * @param strings The string we are trying to match * @param flags flags to use in the match. Bitwise OR of: *
    - *              FNM_NOESCAPE       Disable backslash escaping
    - *              FNM_PATHNAME       Slash must be matched by slash
    - *              FNM_PERIOD         Period must be matched by period
    - *              FNM_CASE_BLIND     Compare characters case-insensitively.
    + *              APR_FNM_NOESCAPE       Disable backslash escaping
    + *              APR_FNM_PATHNAME       Slash must be matched by slash
    + *              APR_FNM_PERIOD         Period must be matched by period
    + *              APR_FNM_CASE_BLIND     Compare characters case-insensitively.
      * 
    */ diff --git a/include/apr_network_io.h b/include/apr_network_io.h index b8d85f1ea13..fdc922b85fe 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -78,9 +78,14 @@ extern "C" { #endif /* __cplusplus */ -#ifndef MAX_SECS_TO_LINGER +#ifndef APR_MAX_SECS_TO_LINGER /** Maximum seconds to linger */ -#define MAX_SECS_TO_LINGER 30 +#define APR_MAX_SECS_TO_LINGER 30 +#endif + +#ifndef MAX_SECS_TO_LINGER +/** @deprecated */ +#define MAX_SECS_TO_LINGER APR_MAX_SECS_TO_LINGER #endif #ifndef APRMAXHOSTLEN From 038a1ca5dc6f23b4c8f44e8cca41e826a9dd9730 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Feb 2003 23:13:30 +0000 Subject: [PATCH 4358/7878] Namespace protection, thanks to Craig Rodrigues for the original patch. Use the new symbols in all internals, taking us one step closer to being ready to just chop out the old defines. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64378 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockopt.c | 2 +- network_io/unix/sockopt.c | 2 +- network_io/win32/sockopt.c | 2 +- strings/apr_fnmatch.c | 64 +++++++++++++++++++------------------- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index b23dd294d8f..823036d71be 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -115,7 +115,7 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, } if (opt & APR_SO_LINGER) { li.l_onoff = on; - li.l_linger = MAX_SECS_TO_LINGER; + li.l_linger = APR_MAX_SECS_TO_LINGER; if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { return APR_OS2_STATUS(sock_errno()); } diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 74bd5821618..2e26659beda 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -216,7 +216,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, if (apr_is_option_set(sock->netmask, APR_SO_LINGER) != on) { struct linger li; li.l_onoff = on; - li.l_linger = MAX_SECS_TO_LINGER; + li.l_linger = APR_MAX_SECS_TO_LINGER; if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { return errno; } diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 715c3485f17..aa9e0870c36 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -183,7 +183,7 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, if (apr_is_option_set(sock->netmask, APR_SO_LINGER) != on) { struct linger li; li.l_onoff = on; - li.l_linger = MAX_SECS_TO_LINGER; + li.l_linger = APR_MAX_SECS_TO_LINGER; if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { return apr_get_netos_error(); diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index 782d42a7250..78b1cb511ed 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -64,18 +64,18 @@ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, const char *string, i for (stringstart = string;;) { switch (c = *pattern++) { case EOS: - return (*string == EOS ? APR_SUCCESS : FNM_NOMATCH); + return (*string == EOS ? APR_SUCCESS : APR_FNM_NOMATCH); case '?': if (*string == EOS) { - return (FNM_NOMATCH); + return (APR_FNM_NOMATCH); } - if (*string == '/' && (flags & FNM_PATHNAME)) { - return (FNM_NOMATCH); + if (*string == '/' && (flags & APR_FNM_PATHNAME)) { + return (APR_FNM_NOMATCH); } - if (*string == '.' && (flags & FNM_PERIOD) && + if (*string == '.' && (flags & APR_FNM_PERIOD) && (string == stringstart || - ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) { - return (FNM_NOMATCH); + ((flags & APR_FNM_PATHNAME) && *(string - 1) == '/'))) { + return (APR_FNM_NOMATCH); } ++string; break; @@ -86,58 +86,58 @@ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, const char *string, i c = *++pattern; } - if (*string == '.' && (flags & FNM_PERIOD) && + if (*string == '.' && (flags & APR_FNM_PERIOD) && (string == stringstart || - ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) { - return (FNM_NOMATCH); + ((flags & APR_FNM_PATHNAME) && *(string - 1) == '/'))) { + return (APR_FNM_NOMATCH); } /* Optimize for pattern with * at end or before /. */ if (c == EOS) { - if (flags & FNM_PATHNAME) { - return (strchr(string, '/') == NULL ? APR_SUCCESS : FNM_NOMATCH); + if (flags & APR_FNM_PATHNAME) { + return (strchr(string, '/') == NULL ? APR_SUCCESS : APR_FNM_NOMATCH); } else { return (APR_SUCCESS); } } - else if (c == '/' && flags & FNM_PATHNAME) { + else if (c == '/' && flags & APR_FNM_PATHNAME) { if ((string = strchr(string, '/')) == NULL) { - return (FNM_NOMATCH); + return (APR_FNM_NOMATCH); } break; } /* General case, use recursion. */ while ((test = *string) != EOS) { - if (!apr_fnmatch(pattern, string, flags & ~FNM_PERIOD)) { + if (!apr_fnmatch(pattern, string, flags & ~APR_FNM_PERIOD)) { return (APR_SUCCESS); } - if (test == '/' && flags & FNM_PATHNAME) { + if (test == '/' && flags & APR_FNM_PATHNAME) { break; } ++string; } - return (FNM_NOMATCH); + return (APR_FNM_NOMATCH); case '[': if (*string == EOS) { - return (FNM_NOMATCH); + return (APR_FNM_NOMATCH); } - if (*string == '/' && flags & FNM_PATHNAME) { - return (FNM_NOMATCH); + if (*string == '/' && flags & APR_FNM_PATHNAME) { + return (APR_FNM_NOMATCH); } - if (*string == '.' && (flags & FNM_PERIOD) && + if (*string == '.' && (flags & APR_FNM_PERIOD) && (string == stringstart || - ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) { - return (FNM_NOMATCH); + ((flags & APR_FNM_PATHNAME) && *(string - 1) == '/'))) { + return (APR_FNM_NOMATCH); } if ((pattern = rangematch(pattern, *string, flags)) == NULL) { - return (FNM_NOMATCH); + return (APR_FNM_NOMATCH); } ++string; break; case '\\': - if (!(flags & FNM_NOESCAPE)) { + if (!(flags & APR_FNM_NOESCAPE)) { if ((c = *pattern++) == EOS) { c = '\\'; --pattern; @@ -145,13 +145,13 @@ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, const char *string, i } /* FALLTHROUGH */ default: - if (flags & FNM_CASE_BLIND) { + if (flags & APR_FNM_CASE_BLIND) { if (apr_tolower(c) != apr_tolower(*string)) { - return (FNM_NOMATCH); + return (APR_FNM_NOMATCH); } } else if (c != *string) { - return (FNM_NOMATCH); + return (APR_FNM_NOMATCH); } string++; break; @@ -177,7 +177,7 @@ static const char *rangematch(const char *pattern, int test, int flags) } for (ok = 0; (c = *pattern++) != ']';) { - if (c == '\\' && !(flags & FNM_NOESCAPE)) { + if (c == '\\' && !(flags & APR_FNM_NOESCAPE)) { c = *pattern++; } if (c == EOS) { @@ -185,21 +185,21 @@ static const char *rangematch(const char *pattern, int test, int flags) } if (*pattern == '-' && (c2 = *(pattern + 1)) != EOS && c2 != ']') { pattern += 2; - if (c2 == '\\' && !(flags & FNM_NOESCAPE)) { + if (c2 == '\\' && !(flags & APR_FNM_NOESCAPE)) { c2 = *pattern++; } if (c2 == EOS) { return (NULL); } if ((c <= test && test <= c2) - || ((flags & FNM_CASE_BLIND) + || ((flags & APR_FNM_CASE_BLIND) && ((apr_tolower(c) <= apr_tolower(test)) && (apr_tolower(test) <= apr_tolower(c2))))) { ok = 1; } } else if ((c == test) - || ((flags & FNM_CASE_BLIND) + || ((flags & APR_FNM_CASE_BLIND) && (apr_tolower(c) == apr_tolower(test)))) { ok = 1; } From 7431c4686cfb55ebc015db5b9cd97aa622a8c127 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Feb 2003 23:21:11 +0000 Subject: [PATCH 4359/7878] A few fewer undecorated names git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64379 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ STATUS | 21 +++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/CHANGES b/CHANGES index c0e509fd13f..1db6e9780a5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR 0.9.2 + *) APR_MAX_SECONDS_TO_LINGER and APR_FNM_* #defines replace their + old undecorated names (missing APR_ prefix). The old names will + disappear with APR 1.0.0. + [Craig Rodrigues , William Rowe] + + *) When generating a semaphore name for posixsem locking, try to be a little more robust (and unique). [Jim Jagielski] diff --git a/STATUS b/STATUS index 0a87e025653..ef26c4d9306 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2003/01/27 17:09:09 $] +Last modified at [$Date: 2003/02/24 23:21:11 $] Release: @@ -20,20 +20,18 @@ Release: RELEASE SHOWSTOPPERS: * Must namespace protect all include/apr_foo.h headers. Jon Travis - has especially observed these including apr and Apache-1.3. + has especially observed these including apr within Apache-1.3. Message-ID: <20020128100116.A4288@covalent.net> (Those problems have been fixed, but it is a good example of what to look for.) Some headers with issues: - apr_fnmatch.h (FNM_foo) - apr_general.h (MAXIMUM_WAIT_OBJECTS) apr_md5.h (MD5_DIGESTSIZE) - apr_network_io.h (MAX_SECONDS_TO_LINGER) apr.hnw (READDIR_IS_THREAD_SAFE, ENUM_BITFIELD, _POSIX_THREAD_SAFE_FUNCTIONS (?)) apr.hw (NO_USE_SIGACTION) - 1.0 showstopper (not 0.9.x): gstein + 1.0 showstopper (not 0.9.x): gstein, wrowe + [wrowe observed we have deprecated for now, not trashing old names.] * Flush out the test suite and make sure it passes on all platforms. We currently have about 450 functions in APR and 147 tests. That @@ -54,7 +52,7 @@ RELEASE SHOWSTOPPERS: Thom says: I think this is close to done; does anyone want to add any further renames? - 1.0 showstopper (not 0.9.0): gstein + 1.0 showstopper (not 0.9.x): gstein, wrowe * When Win32 apr_proc_create was fixed, the apr_proc_t hproc member was added for that platform. That's a problem (and @@ -63,14 +61,8 @@ RELEASE SHOWSTOPPERS: since apr_proc_create didn't allocate the apr_proc_t storage. (Aren't transparent types swell?) Suggestions? - 1.0 showstopper (not 0.9.0): gstein - - * For 1.0, clean up ability to specify protocol for a socket by - axing apr_socket_create_ex(), adding protocol parm to - apr_socket_create(), and enabling protocol field in - apr_os_sock_info_t. + 1.0 showstopper (not 0.9.x): gstein - 1.0 showstopper (not 0.9.x): trawick CURRENT VOTES: @@ -90,6 +82,7 @@ CURRENT test/testall -v EXCEPTIONS: rather than the filesystem objects' permissions. * Win32 Not Implemented tests + Pipes: set_timeout/read_write; can't timeout blocking pipes Socket Creation: tcp6_socket and udp6_socket (at least by default) Socket Options: corkable: TCP isn't corkable Users: username: Groups from apr_uid_get not implemented From a1d82e62998999ceb0da33cbd9df0c1bbbeefe31 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Feb 2003 23:23:49 +0000 Subject: [PATCH 4360/7878] This is what Unix does, but I'm revisiting the entire ->hproc issue in a few minutes. At least start out in the same place. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64380 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/otherchild.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 4cd770b5902..b90ebe41e13 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -169,8 +169,10 @@ APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, return; if (!ocr->proc->hproc) { - /* Already mopped up, perhaps we apr_proc_kill'ed it */ - (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, -1); + /* Already mopped up, perhaps we apr_proc_kill'ed it, + * they should have already unregistered! + */ + (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1); } else if (!GetExitCodeProcess(ocr->proc->hproc, &status)) { CloseHandle(ocr->proc->hproc); From 9eeab3b6e71841d5221e5ebd2833c92a96d7b3c6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Feb 2003 23:27:14 +0000 Subject: [PATCH 4361/7878] Our exit codes are ugly, this should help some of them and tell us what sort of exit occurred. Declare apr_proc_wait_all_procs() unimplemented, and further fix the code not to shut down the ->hproc which we need to recover the error in the otherchild logic. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64381 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 02b6f57f03c..9f13d6e7a13 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -692,6 +692,31 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, + int *exitcode, + apr_exit_why_e *exitwhy, + apr_wait_how_e waithow, + apr_pool_t *p) +{ + /* Unix does apr_proc_wait(proc(-1), exitcode, exitwhy, waithow) + * but Win32's apr_proc_wait won't work that way. + */ + return APR_ENOTIMPL; +} + +static apr_exit_why_e why_from_exit_code(DWORD exit) { + /* See WinNT.h STATUS_ACCESS_VIOLATION and family for how + * this class of failures was determined + */ + if (((exit & 0xC0000000) == 0xC0000000) + && !(exit & 0x3FFF0000)) + return APR_PROC_SIGNAL; + else + return APR_PROC_EXIT; + + /* ### No way to tell if Dr Watson grabbed a core, AFAICT. */ +} + APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, int *exitcode, apr_exit_why_e *exitwhy, apr_wait_how_e waithow) @@ -699,9 +724,6 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, DWORD stat; DWORD time; - if (!proc) - return APR_ENOPROC; - if (waithow == APR_WAIT) time = INFINITE; else @@ -710,9 +732,9 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, if ((stat = WaitForSingleObject(proc->hproc, time)) == WAIT_OBJECT_0) { if (GetExitCodeProcess(proc->hproc, &stat)) { if (exitcode) - *exitcode = (apr_wait_t)stat; - CloseHandle(proc->hproc); - proc->hproc = NULL; + *exitcode = stat; + if (exitwhy) + *exitwhy = why_from_exit_code(stat); return APR_CHILD_DONE; } } From fc1f7d3a8bcff09ab49b19b4c3a68cd3571570d9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 25 Feb 2003 01:11:10 +0000 Subject: [PATCH 4362/7878] If we no longer have proc->hproc, the proc itself is now useless. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64382 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/otherchild.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index b90ebe41e13..38d147bf9f2 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -172,10 +172,12 @@ APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, /* Already mopped up, perhaps we apr_proc_kill'ed it, * they should have already unregistered! */ + ocr->proc = NULL; (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1); } else if (!GetExitCodeProcess(ocr->proc->hproc, &status)) { CloseHandle(ocr->proc->hproc); + ocr->proc->hproc = NULL; ocr->proc = NULL; (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1); } From ffed705243d76f495811c6004f6b5e2944bd90d6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 25 Feb 2003 13:55:56 +0000 Subject: [PATCH 4363/7878] Once we apr_proc_kill on Unix, we don't expect to be able to recover an exit code (in fact we waitpid on darwin to clear the zombies, which seems like behavior we would need on other bsd-derived platforms as well.) So we don't expect to be able to on Win32 either; this patch simply reinforces that notion by return APR_EPROC_UNKNOWN when we encounter an apr_proc_t that was already kill()ed or waitpid()ed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64383 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/signals.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 49d59d485cc..b10ccc43d4f 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -74,8 +74,9 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signal) } CloseHandle(proc->hproc); proc->hproc = NULL; + return APR_SUCCESS; } - return APR_SUCCESS; + return APR_EPROC_UNKNOWN; } void apr_signal_init(apr_pool_t *pglobal) From 9f5cde964afe0c7ef5e123134aa8921fa158065d Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 26 Feb 2003 10:38:09 +0000 Subject: [PATCH 4364/7878] Include filepath_util.c in OS/2 build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64384 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/Makefile.in | 1 + file_io/os2/filepath_util.c | 1 + 2 files changed, 2 insertions(+) create mode 100644 file_io/os2/filepath_util.c diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index 4f0b1dd99a5..33673e01477 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -14,6 +14,7 @@ TARGETS = \ maperrorcode.lo \ fullrw.lo \ filepath.lo \ + filepath_util.lo \ filesys.lo \ mktemp.lo \ copy.lo diff --git a/file_io/os2/filepath_util.c b/file_io/os2/filepath_util.c new file mode 100644 index 00000000000..a89c173e54e --- /dev/null +++ b/file_io/os2/filepath_util.c @@ -0,0 +1 @@ +#include "../unix/filepath_util.c" From 4f929c44b28182ffa0a48f6a050d1f075e986816 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 27 Feb 2003 17:56:24 +0000 Subject: [PATCH 4365/7878] fix a typo in a comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64385 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index 634cd42ce96..3e1526c0030 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -357,7 +357,7 @@ typedef int apr_socklen_t; #define APR_SIZEOF_VOIDP 4 #endif -/* XXX These simply don't belong here, perhaps in apr_portabile.h +/* XXX These simply don't belong here, perhaps in apr_portable.h * based on some APR_HAVE_PID/GID/UID? */ typedef int pid_t; From 9f759834a512f8dfcb35b08a70fdcd9609af6b82 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 27 Feb 2003 18:54:04 +0000 Subject: [PATCH 4366/7878] A silly little patch - the uses of 'pid' as the apr_proc_t* name are really confusing, proc is much more clearly not an actual int pid value. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64386 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index a18fb101244..25ddbd9efcb 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -439,7 +439,7 @@ typedef struct cleanup_t cleanup_t; /** A list of processes */ struct process_chain { /** The process ID */ - apr_proc_t *pid; + apr_proc_t *proc; apr_kill_conditions_e kill_how; /** The next process in the list */ struct process_chain *next; @@ -2026,12 +2026,12 @@ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) * we might want to fold support for that into the generic interface. * For now, it's a special case. */ -APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *pool, apr_proc_t *pid, +APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *pool, apr_proc_t *proc, apr_kill_conditions_e how) { struct process_chain *pc = apr_palloc(pool, sizeof(struct process_chain)); - pc->pid = pid; + pc->proc = proc; pc->kill_how = how; pc->next = pool->subprocesses; pool->subprocesses = pc; @@ -2060,7 +2060,7 @@ static void free_proc_chain(struct process_chain *procs) #ifndef NEED_WAITPID /* Pick up all defunct processes */ for (pc = procs; pc; pc = pc->next) { - if (apr_proc_wait(pc->pid, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE) + if (apr_proc_wait(pc->proc, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE) pc->kill_how = APR_KILL_NEVER; } #endif /* !defined(NEED_WAITPID) */ @@ -2077,12 +2077,12 @@ static void free_proc_chain(struct process_chain *procs) #ifdef WIN32 need_timeout = 1; #else /* !defined(WIN32) */ - if (apr_proc_kill(pc->pid, SIGTERM) == APR_SUCCESS) + if (apr_proc_kill(pc->proc, SIGTERM) == APR_SUCCESS) need_timeout = 1; #endif /* !defined(WIN32) */ } else if (pc->kill_how == APR_KILL_ALWAYS) { - apr_proc_kill(pc->pid, SIGKILL); + apr_proc_kill(pc->proc, SIGKILL); } } @@ -2099,7 +2099,8 @@ static void free_proc_chain(struct process_chain *procs) need_timeout = 0; for (pc = procs; pc; pc = pc->next) { if (pc->kill_how == APR_KILL_AFTER_TIMEOUT) { - if (apr_proc_wait(pc->pid, NULL, NULL, APR_NOWAIT) == APR_CHILD_NOTDONE) + if (apr_proc_wait(pc->proc, NULL, NULL, APR_NOWAIT) + == APR_CHILD_NOTDONE) need_timeout = 1; /* subprocess is still active */ else pc->kill_how = APR_KILL_NEVER; /* subprocess has exited */ @@ -2121,13 +2122,13 @@ static void free_proc_chain(struct process_chain *procs) */ for (pc = procs; pc; pc = pc->next) { if (pc->kill_how == APR_KILL_AFTER_TIMEOUT) - apr_proc_kill(pc->pid, SIGKILL); + apr_proc_kill(pc->proc, SIGKILL); } /* Now wait for all the signaled processes to die */ for (pc = procs; pc; pc = pc->next) { if (pc->kill_how != APR_KILL_NEVER) - (void)apr_proc_wait(pc->pid, NULL, NULL, APR_WAIT); + (void)apr_proc_wait(pc->proc, NULL, NULL, APR_WAIT); } #ifdef WIN32 @@ -2139,9 +2140,9 @@ static void free_proc_chain(struct process_chain *procs) */ { for (pc = procs; pc; pc = pc->next) { - if (pc->pid->hproc) { - CloseHandle(pc->pid->hproc); - pc->pid->hproc = NULL; + if (pc->proc->hproc) { + CloseHandle(pc->proc->hproc); + pc->proc->hproc = NULL; } } } From c2aca531683b462d997c3e687dd475703d3cb92d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 27 Feb 2003 19:05:44 +0000 Subject: [PATCH 4367/7878] Better documentation of what/how/where we deal with hproc, and note a real problem with toggling the char *invoked debugging value. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64387 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index d40856097f3..383891ebdb7 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -170,12 +170,19 @@ struct apr_proc_t { #if APR_HAS_PROC_INVOKED || defined(DOXYGEN) /** Diagnositics/debugging string of the command invoked for * this process [only present if APR_HAS_PROC_INVOKED is true] + * @remark Only enabled on Win32 by default. + * @bug This should either always or never be present in release + * builds - since it breaks binary compatibility. We may enable + * it always in APR 1.0 yet leave it undefined in most cases. */ char *invoked; #endif #if defined(WIN32) || defined(DOXYGEN) - /** Win32 specific: Must retain the creator's handle granting - * access, as a new copy may not grant the same permissions + /** (Win32 only) Creator's handle granting access to the process + * @remark This handle is closed and reset to NULL in every case + * corresponding to a waitpid() on Unix which returns the exit status. + * Therefore Win32 correspond's to Unix's zombie reaping characteristics + * and avoids potential handle leaks. */ HANDLE hproc; #endif From a055f95c2d56a4e9c37ec64855275f802fc394c1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 27 Feb 2003 19:13:48 +0000 Subject: [PATCH 4368/7878] As near as I can tell, Win32 will now correspond to Unix in terms of the availability and lifetime of the hproc process handle. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64388 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ memory/unix/apr_pools.c | 27 ++++++--------------------- threadproc/win32/proc.c | 7 ++++++- threadproc/win32/signals.c | 12 +++++++++--- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/CHANGES b/CHANGES index 1db6e9780a5..8f3a5e8979f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR 0.9.2 + *) Alter Win32's handling of the apr_proc_t hproc member, so that we + close that system handle wherever an apr function would invoke the + final waitpid() against a zombie process on Unix. [William Rowe] + *) APR_MAX_SECONDS_TO_LINGER and APR_FNM_* #defines replace their old undecorated names (missing APR_ prefix). The old names will disappear with APR 1.0.0. diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 25ddbd9efcb..0338233e2ef 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -2066,6 +2066,7 @@ static void free_proc_chain(struct process_chain *procs) #endif /* !defined(NEED_WAITPID) */ for (pc = procs; pc; pc = pc->next) { +#ifndef WIN32 if ((pc->kill_how == APR_KILL_AFTER_TIMEOUT) || (pc->kill_how == APR_KILL_ONLY_ONCE)) { /* @@ -2074,14 +2075,15 @@ static void free_proc_chain(struct process_chain *procs) * similar to a SIGKILL, so always give the process a timeout * under Windows before killing it. */ -#ifdef WIN32 - need_timeout = 1; -#else /* !defined(WIN32) */ if (apr_proc_kill(pc->proc, SIGTERM) == APR_SUCCESS) need_timeout = 1; -#endif /* !defined(WIN32) */ } else if (pc->kill_how == APR_KILL_ALWAYS) { +#else /* WIN32 knows only one fast, clean method of killing processes today */ + if (pc->kill_how != APR_KILL_NEVER) { + need_timeout = 1; + pc->kill_how = APR_KILL_ALWAYS; +#endif apr_proc_kill(pc->proc, SIGKILL); } } @@ -2130,23 +2132,6 @@ static void free_proc_chain(struct process_chain *procs) if (pc->kill_how != APR_KILL_NEVER) (void)apr_proc_wait(pc->proc, NULL, NULL, APR_WAIT); } - -#ifdef WIN32 - /* - * XXX: Do we need an APR function to clean-up a proc_t? - * Well ... yeah ... but we can't since it's scope is ill defined. - * We can't dismiss the handle until the apr_proc_wait above is - * finished with the proc_t. - */ - { - for (pc = procs; pc; pc = pc->next) { - if (pc->proc->hproc) { - CloseHandle(pc->proc->hproc); - pc->proc->hproc = NULL; - } - } - } -#endif /* defined(WIN32) */ } diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 9f13d6e7a13..ed52f314b56 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -699,7 +699,10 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_pool_t *p) { /* Unix does apr_proc_wait(proc(-1), exitcode, exitwhy, waithow) - * but Win32's apr_proc_wait won't work that way. + * but Win32's apr_proc_wait won't work that way. We can either + * register all APR created processes in some sort of AsyncWait + * thread, or simply walk from the global process pool for all + * apr_pool_note_subprocess()es registered with APR. */ return APR_ENOTIMPL; } @@ -735,6 +738,8 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, *exitcode = stat; if (exitwhy) *exitwhy = why_from_exit_code(stat); + CloseHandle(proc->hproc); + proc->hproc = NULL; return APR_CHILD_DONE; } } diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index b10ccc43d4f..e83e009fb45 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -65,15 +65,20 @@ #include #endif -/* Windows only really support killing process, but that will do for now. */ +/* Windows only really support killing process, but that will do for now. + * + * ### Actually, closing the input handle to the proc should also do fine + * for most console apps. This definately needs improvement... + */ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signal) { if (proc->hproc != NULL) { if (TerminateProcess(proc->hproc, signal) == 0) { return apr_get_os_error(); } - CloseHandle(proc->hproc); - proc->hproc = NULL; + /* On unix, SIGKILL leaves a apr_proc_wait()able pid lying around, + * so we will leave hproc alone until the app calls apr_proc_wait(). + */ return APR_SUCCESS; } return APR_EPROC_UNKNOWN; @@ -82,6 +87,7 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signal) void apr_signal_init(apr_pool_t *pglobal) { } + const char *apr_signal_description_get(int signum) { return "unknown signal (not supported)"; From 466606a7dda742f629e3039fceb0d84e47e0bb7b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 27 Feb 2003 19:20:24 +0000 Subject: [PATCH 4369/7878] Fix two problems in apr_thread_cond_timedwait, the first observed by Ohtani Hiroki that we failed to relock on failure, and the second problem I found that we weren't returning an error status when we failed for something other than timeup. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64389 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/thread_cond.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index 48465cbba5a..f99b25dd351 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -142,10 +142,11 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, if (res != WAIT_OBJECT_0) { apr_status_t rv = apr_get_os_error(); ReleaseMutex(cond->mutex); + apr_thread_mutex_lock(mutex); if (res == WAIT_TIMEOUT) { - rv = APR_TIMEUP; + return APR_TIMEUP; } - return rv; + return apr_get_os_error(); } if (cond->signal_all) { if (cond->num_waiting == 0) { From 3d5ec91f67bd8fb70694b3844343999948046359 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 2 Mar 2003 03:11:22 +0000 Subject: [PATCH 4370/7878] OS/2: Don't return the apr_file_t if the open failed. This is consistent with the other platforms & is required to pass the file tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64390 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 29c40e1cdab..3b7ef835818 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -76,7 +76,6 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr ULONG action; apr_file_t *dafile = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); - *new = dafile; dafile->pool = pool; dafile->isopen = FALSE; dafile->eof_hit = FALSE; @@ -148,6 +147,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr if (!(flag & APR_FILE_NOCLEANUP)) { apr_pool_cleanup_register(dafile->pool, dafile, apr_file_cleanup, apr_file_cleanup); } + + *new = dafile; return APR_SUCCESS; } From 01ef168e43ee22526216c5e427469953da8c3153 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 3 Mar 2003 20:54:50 +0000 Subject: [PATCH 4371/7878] Brad Nicholes points out that I unconditionally stubbed the functions yet left their argument type undefined. typedef the apr_other_child_rec_t unconditionally. Also add a little whitespace to make this list legible ;-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64391 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 383891ebdb7..c439744fcbc 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -203,19 +203,21 @@ typedef void (apr_child_errfn_t)(apr_pool_t *proc, apr_status_t err, /** Opaque Thread structure. */ typedef struct apr_thread_t apr_thread_t; + /** Opaque Thread attributes structure. */ typedef struct apr_threadattr_t apr_threadattr_t; + /** Opaque Process attributes structure. */ typedef struct apr_procattr_t apr_procattr_t; + /** Opaque control variable for one-time atomic variables. */ typedef struct apr_thread_once_t apr_thread_once_t; /** Opaque thread private address space. */ typedef struct apr_threadkey_t apr_threadkey_t; -#if APR_HAS_OTHER_CHILD + /** Opaque record of child process. */ typedef struct apr_other_child_rec_t apr_other_child_rec_t; -#endif /* APR_HAS_OTHER_CHILD */ /** * The prototype for any APR thread worker functions. From a6e401d8f444ffb8e9222899cd74b2c0e2194aa5 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 4 Mar 2003 00:03:31 +0000 Subject: [PATCH 4372/7878] Add the otherchild functions to the NetWare build so that the linker will be happy. This is now necessary due to the changes in the changes in the apr_thread_proc.h header git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64392 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index ad4c05be763..d70976ba629 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -270,6 +270,7 @@ FILES_lib_objs = \ $(OBJDIR)/mmap.o \ $(OBJDIR)/open.o \ $(OBJDIR)/pipe.o \ + $(OBJDIR)/otherchild.o \ $(OBJDIR)/poll.o \ $(OBJDIR)/pollacc.o \ $(OBJDIR)/proc.o \ From 73fe9e85e4452cb81c1382873a38207340a2bad7 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 4 Mar 2003 00:06:33 +0000 Subject: [PATCH 4373/7878] Even if the build doesn't support OTHER_CHILD functionality, we still need the definitions and typedef's since the function stubs require them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64393 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 -- misc/unix/otherchild.c | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index c439744fcbc..3233a9b89d8 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -130,7 +130,6 @@ typedef enum { /** @see apr_procattr_limit_set */ #define APR_LIMIT_NOFILE 3 -#if APR_HAS_OTHER_CHILD || defined(DOXYGEN) /** * @defgroup Other_Child Other Child Flags * @{ @@ -152,7 +151,6 @@ typedef enum { * this is a no-op. */ /** @} */ -#endif /* APR_HAS_OTHER_CHILD */ /** @see apr_proc_t */ typedef struct apr_proc_t apr_proc_t; diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 38d147bf9f2..bc0d17bf56e 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -53,12 +53,12 @@ */ #include "apr.h" - -#if APR_HAS_OTHER_CHILD - #include "apr_arch_misc.h" #include "apr_arch_threadproc.h" #include "apr_arch_file_io.h" + +#if APR_HAS_OTHER_CHILD + #ifdef HAVE_TIME_H #include #endif From 0cecff16514321cd0dc528a66c663b95f1646c4c Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 4 Mar 2003 00:08:17 +0000 Subject: [PATCH 4374/7878] Implemented the functionality for the APR_FILEPATH_NATIVE flag in apr_filepath_get() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64394 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filesys.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/file_io/netware/filesys.c b/file_io/netware/filesys.c index 30a1600479b..ff77c7f9e5e 100644 --- a/file_io/netware/filesys.c +++ b/file_io/netware/filesys.c @@ -124,6 +124,12 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_int32_t flags, ptr = path; } *rootpath = apr_pstrdup(p, ptr); + if (!(flags & APR_FILEPATH_NATIVE)) { + for (ptr = *rootpath; *ptr; ++ptr) { + if (*ptr == '\\') + *ptr = '/'; + } + } return APR_SUCCESS; } From b7bfd335a578463f5008118717ddcc93e8a5a30f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 4 Mar 2003 00:11:33 +0000 Subject: [PATCH 4375/7878] Default the current directory in the proc_attr structure since the NetWare OS doesn't have a process shell that handles it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64395 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index c093b6903bf..7b0b05baebc 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -82,6 +82,8 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new,apr_pool_t *p } (*new)->pool = pool; (*new)->cmdtype = APR_PROGRAM; + /* Default to a current path since NetWare doesn't handle it very well */ + apr_filepath_get(&((*new)->currdir), APR_FILEPATH_NATIVE, pool); /* (*new)->detached = 1;*/ return APR_SUCCESS; From 2a175569dca4bfc1b0cd7a9cbb89f9382c11afa2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 4 Mar 2003 22:19:38 +0000 Subject: [PATCH 4376/7878] Correct apr_file_gets() on OS2 and Win32 so that '\r's are no longer eaten, and apr_file_gets() -> apr_file_puts() moves the contents uncorrupted. Reviewed by bicholes and brane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64396 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ file_io/os2/readwrite.c | 4 +--- file_io/win32/readwrite.c | 4 +--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 8f3a5e8979f..6ff3100cdd9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR 0.9.2 + *) Correct apr_file_gets() on OS2 and Win32 so that '\r's are no longer + eaten, and apr_file_gets() -> apr_file_puts() moves the contents + uncorrupted. [William Rowe] + *) Alter Win32's handling of the apr_proc_t hproc member, so that we close that system handle wherever an apr function would invoke the final waitpid() against a zombie process on Unix. [William Rowe] diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index c3f2caf8ac9..20c29874222 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -343,9 +343,7 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) break; } - if (str[i] == '\r' || str[i] == '\x1A') - i--; - else if (str[i] == '\n') { + if (str[i] == '\n') { i++; break; } diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 0f7bcafa3f6..c54878a528f 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -452,9 +452,7 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) break; } - if (str[i] == '\r' || str[i] == '\x1A') - i--; /* don't keep this char */ - else if (str[i] == '\n') { + if (str[i] == '\n') { i++; /* don't clobber this char below */ break; } From b596b59f209460c0527c60f40ba5512a15cc9af7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 5 Mar 2003 21:22:26 +0000 Subject: [PATCH 4377/7878] Rebalance our exposed headers such that everything is nested properly between extern "C" blocks and doxygen blocks, that we never include other headers within our own header's extern "C" block, that we always tag the entire file contents for doxygen (within the APR_HEADER_H only-once block), and generally clean up doxygen so that it is all consistent and generates respectable (although not yet 'great') results. Major TODO after 0.9.2 releases; fill in the apr.h APR_HAVE/APR_HAS and apr_type_t documentation!!! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64397 13f79535-47bb-0310-9956-ffa450edef68 --- docs/doxygen.conf | 13 ++- include/apr.h.in | 154 ++++++++++++++++++------------ include/apr.hnw | 99 ++++++++++++-------- include/apr.hw | 182 +++++++++++++++++++++--------------- include/apr_allocator.h | 32 +++---- include/apr_atomic.h | 34 ++++--- include/apr_compat.h | 72 +++++++++++++- include/apr_dso.h | 24 ++--- include/apr_env.h | 18 ++-- include/apr_errno.h | 96 ++++++++++--------- include/apr_file_info.h | 52 +++-------- include/apr_file_io.h | 40 ++++---- include/apr_fnmatch.h | 27 +++--- include/apr_general.h | 41 +++++--- include/apr_getopt.h | 17 ++-- include/apr_global_mutex.h | 19 ++-- include/apr_hash.h | 32 +++---- include/apr_inherit.h | 50 +++++----- include/apr_lib.h | 124 ++++++++++++------------ include/apr_mmap.h | 18 ++-- include/apr_network_io.h | 39 ++++---- include/apr_poll.h | 18 ++-- include/apr_pools.h | 64 +++++++------ include/apr_portable.h | 18 ++-- include/apr_proc_mutex.h | 16 ++-- include/apr_ring.h | 17 ++-- include/apr_shm.h | 16 ++-- include/apr_signal.h | 6 +- include/apr_strings.h | 26 +++--- include/apr_support.h | 16 ++-- include/apr_tables.h | 28 +++--- include/apr_thread_cond.h | 20 ++-- include/apr_thread_mutex.h | 21 +++-- include/apr_thread_proc.h | 70 ++++++++------ include/apr_thread_rwlock.h | 16 ++-- include/apr_time.h | 27 +++--- include/apr_user.h | 14 +-- include/apr_version.h | 2 +- include/apr_want.h | 2 +- 39 files changed, 894 insertions(+), 686 deletions(-) diff --git a/docs/doxygen.conf b/docs/doxygen.conf index 36b623264a6..2efb55476f0 100644 --- a/docs/doxygen.conf +++ b/docs/doxygen.conf @@ -13,14 +13,21 @@ EXPAND_ONLY_PREDEF=YES # not sure why this doesn't work as EXPAND_AS_DEFINED, it should! PREDEFINED="APR_DECLARE(x)=x" \ "APR_DECLARE_NONSTD(x)=x" \ + "APR_DECLARE_DATA" \ + "APR_POOL_DECLARE_ACCESSOR(x)=apr_pool_t* apr_##x##_pool_get (const apr_##x##_t *the##x)" \ + "APR_DECLARE_INHERIT_SET(x)=apr_status_t apr_##x##_inherit_set(apr_##x##_t *the##x)" \ + "APR_DECLARE_INHERIT_UNSET(x)=apr_status_t apr_##x##_inherit_unset(apr_##x##_t *the##x)" \ "APR_HAS_THREADS" \ + "__attribute__(x)=" \ DOXYGEN= OPTIMIZE_OUTPUT_FOR_C=YES -FULL_PATH_NAMES=YES +FULL_PATH_NAMES=NO # some autoconf guru needs to make configure set this correctly... -STRIP_FROM_PATH=/home/rbb/httpd-2.0/srclib/apr +# in the meantime, simply listing the headers should be alright +STRIP_FROM_PATH=/buildpath/apr -EXCLUDE_PATTERNS="*/test/*" \ +EXCLUDE_PATTERNS="*/acconfig.h" \ + "*/test/*" \ "*/arch/*" diff --git a/include/apr.h.in b/include/apr.h.in index cb65477aebf..74c232945f1 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -65,17 +65,20 @@ * This is the Win32 specific version of apr.h. It is copied from * apr.hw when building the apr.dsp or libapr.dsp project. */ - /** - * @file include/apr.h - * @brief APR APR Main Include + * @file apr.h + * @brief APR Platform Definitions * @remark This is a generated header generated from include/apr.h.in by * ./configure, or copied from include/apr.hw or include/apr.hnw * for Win32 or Netware by those build environments, respectively. */ /** - * @defgroup APR APR Functions + * @defgroup APR Apache Portability Runtime library + * @{ + */ +/** + * @defgroup apr_platform Platform Definitions * @{ */ @@ -136,6 +139,54 @@ #define APR_HAVE_TIME_H @timeh@ #define APR_HAVE_UNISTD_H @unistdh@ +/** @} */ + +/* We don't include our conditional headers within the doxyblocks + * or the extern "C" namespace + */ + +#if APR_HAVE_SYS_TYPES_H +#include +#endif + +#if APR_HAVE_SYS_SOCKET_H +#include +#endif + +#if APR_HAVE_STDINT_H +#include +#endif + +#if APR_HAVE_SYS_WAIT_H +#include +#endif + +#ifdef OS2 +#define INCL_DOS +#define INCL_DOSERRORS +#include +#endif + +/* header files for PATH_MAX, _POSIX_PATH_MAX */ +#if APR_HAVE_LIMITS_H +#include +#else +#if APR_HAVE_SYS_SYSLIMITS_H +#include +#endif +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup apr_platform + * @ingroup APR + * @{ + */ + #define APR_HAVE_SHMEM_MMAP_TMP @havemmaptmp@ #define APR_HAVE_SHMEM_MMAP_SHM @havemmapshm@ #define APR_HAVE_SHMEM_MMAP_ZERO @havemmapzero@ @@ -190,18 +241,6 @@ #define APR_HAVE_UNION_SEMUN @have_union_semun@ #define APR_HAVE_SCTP @have_sctp@ -#if APR_HAVE_SYS_TYPES_H -#include -#endif - -#if APR_HAVE_SYS_SOCKET_H -#include -#endif - -#if APR_HAVE_STDINT_H -#include -#endif - /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY @sharedmem@ #define APR_HAS_THREADS @threads@ @@ -271,48 +310,60 @@ typedef @socklen_t_value@ apr_socklen_t; /* Mechanisms to properly type numeric literals */ @int64_literal@ - /* Definitions that APR programs need to work properly. */ -#define APR_THREAD_FUNC - -/** - * APR_DECLARE_EXPORT is defined when building the APR dynamic library, - * so that all public symbols are exported. - * - * APR_DECLARE_STATIC is defined when including the APR public headers, - * to provide static linkage when the dynamic library may be unavailable. - * - * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when - * including the APR public headers, to import and link the symbols from the - * dynamic APR library and assure appropriate indirection and calling - * conventions at compile time. +/** + * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, + * so that they follow the platform's calling convention. + * @example + */ +/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data); */ +#define APR_THREAD_FUNC /** * The public APR functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with * variable arguments must use APR_DECLARE_NONSTD(). * - * @deffunc APR_DECLARE(rettype) apr_func(args); + * @remark Both the declaration and implementations must use the same macro. + * @example + */ +/** APR_DECLARE(rettype) apr_func(args) + * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA + * @remark Note that when APR compiles the library itself, it passes the + * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) + * to export public symbols from the dynamic library build.\n + * The user must define the APR_DECLARE_STATIC when compiling to target + * the static APR library on some platforms (e.g. Win32.) The public symbols + * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n + * By default, compiling an application and including the APR public + * headers, without defining APR_DECLARE_STATIC, will prepare the code to be + * linked to the dynamic library. */ -#define APR_DECLARE(type) type +#define APR_DECLARE(type) type /** * The public APR functions using variable arguments are declared with - * AP_DECLARE(), as they must use the C language calling convention. - * - * @deffunc APR_DECLARE_NONSTD(rettype) apr_func(args, ...); + * APR_DECLARE_NONSTD(), as they must follow the C language calling convention. + * @see APR_DECLARE @see APR_DECLARE_DATA + * @remark Both the declaration and implementations must use the same macro. + * @example + */ +/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...); */ #define APR_DECLARE_NONSTD(type) type /** * The public APR variables are declared with AP_MODULE_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. - * - * @deffunc APR_DECLARE_DATA type apr_variable; - * @tip APR_DECLARE_DATA extern type apr_variable; syntax is required for - * declarations within headers to properly import the variable. + * @see APR_DECLARE @see APR_DECLARE_NONSTD + * @remark Note that the declaration and implementations use different forms, + * but both must include the macro. + * @example + */ +/** extern APR_DECLARE_DATA type apr_variable;\n + * APR_DECLARE_DATA type apr_variable = value; */ #define APR_DECLARE_DATA @@ -352,11 +403,8 @@ typedef @socklen_t_value@ apr_socklen_t; /* Local machine definition for console and log output. */ #define APR_EOL_STR "@eolstr@" -#if APR_HAVE_SYS_WAIT_H - -/* We have a POSIX wait interface */ -#include +#if APR_HAVE_SYS_WAIT_H #ifdef WEXITSTATUS #define apr_wait_t int #else @@ -366,21 +414,6 @@ typedef @socklen_t_value@ apr_socklen_t; #endif /* !WEXITSTATUS */ #endif /* HAVE_SYS_WAIT_H */ -#ifdef OS2 -#define INCL_DOS -#define INCL_DOSERRORS -#include -#endif - -/* header files for PATH_MAX, _POSIX_PATH_MAX */ -#if APR_HAVE_LIMITS_H -#include -#else -#if APR_HAVE_SYS_SYSLIMITS_H -#include -#endif -#endif - #if defined(PATH_MAX) #define APR_PATH_MAX PATH_MAX #elif defined(_POSIX_PATH_MAX) @@ -388,6 +421,11 @@ typedef @socklen_t_value@ apr_socklen_t; #else #error no decision has been made on APR_PATH_MAX for your platform #endif + /** @} */ +#ifdef __cplusplus +} +#endif + #endif /* APR_H */ diff --git a/include/apr.hnw b/include/apr.hnw index cc6d65164d8..bbe4bf7bc66 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -67,8 +67,8 @@ */ /** - * @file include/apr.h - * @brief APR APR Main Include + * @file apr.h + * @brief APR Platform Definitions * @remark This is a generated header generated from include/apr.h.in by * ./configure, or copied from include/apr.hw or include/apr.hnw * for Win32 or Netware by those build environments, respectively. @@ -76,11 +76,6 @@ #if defined(NETWARE) || defined(DOXYGEN) -/** - * @defgroup APR APR Functions - * @{ - */ - #include #include #include @@ -93,13 +88,28 @@ #include #include #include - - #include +#include + +#ifdef NW_BUILD_IPV6 +#include +#endif #define _POSIX_THREAD_SAFE_FUNCTIONS 1 #define READDIR_IS_THREAD_SAFE 1 +/* Keep #include'd headers from within the __cplusplus or doxyblocks */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup apr_platform Platform Definitions + * @ingroup APR + * @{ + */ + #define APR_INLINE #define APR_HAS_INLINE 0 #define __attribute__(__x) @@ -201,14 +211,6 @@ #define APR_HAVE_UNION_SEMUN 0 #define APR_HAVE_SCTP 0 -#if APR_HAVE_SYS_TYPES_H -#include -#endif - -#if APR_HAVE_IPV6 -#include -#endif - /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY 0 #define APR_HAS_THREADS 1 @@ -284,43 +286,58 @@ typedef int apr_socklen_t; /* Definitions that APR programs need to work properly. */ -#define APR_THREAD_FUNC - -/** - * APR_DECLARE_EXPORT is defined when building the APR dynamic library, - * so that all public symbols are exported. - * - * APR_DECLARE_STATIC is defined when including the APR public headers, - * to provide static linkage when the dynamic library may be unavailable. - * - * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when - * including the APR public headers, to import and link the symbols from the - * dynamic APR library and assure appropriate indirection and calling - * conventions at compile time. +/** + * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, + * so that they follow the platform's calling convention. + * @example + */ +/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data); */ +#define APR_THREAD_FUNC /** * The public APR functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with * variable arguments must use APR_DECLARE_NONSTD(). * - * @deffunc APR_DECLARE(rettype) apr_func(args); + * @remark Both the declaration and implementations must use the same macro. + * @example + */ +/** APR_DECLARE(rettype) apr_func(args) + * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA + * @remark Note that when APR compiles the library itself, it passes the + * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) + * to export public symbols from the dynamic library build.\n + * The user must define the APR_DECLARE_STATIC when compiling to target + * the static APR library on some platforms (e.g. Win32.) The public symbols + * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n + * By default, compiling an application and including the APR public + * headers, without defining APR_DECLARE_STATIC, will prepare the code to be + * linked to the dynamic library. */ -#define APR_DECLARE(type) type +#define APR_DECLARE(type) type + /** * The public APR functions using variable arguments are declared with - * AP_DECLARE(), as they must use the C language calling convention. - * - * @deffunc APR_DECLARE_NONSTD(rettype) apr_func(args, ...); + * APR_DECLARE_NONSTD(), as they must follow the C language calling convention. + * @see APR_DECLARE @see APR_DECLARE_DATA + * @remark Both the declaration and implementations must use the same macro. + * @example + */ +/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...); */ #define APR_DECLARE_NONSTD(type) type + /** * The public APR variables are declared with AP_MODULE_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. - * - * @deffunc APR_DECLARE_DATA type apr_variable; - * @tip extern APR_DECLARE_DATA type apr_variable; syntax is required for - * declarations within headers to properly import the variable. + * @see APR_DECLARE @see APR_DECLARE_NONSTD + * @remark Note that the declaration and implementations use different forms, + * but both must include the macro. + * @example + */ +/** extern APR_DECLARE_DATA type apr_variable;\n + * APR_DECLARE_DATA type apr_variable = value; */ #define APR_DECLARE_DATA @@ -348,6 +365,10 @@ typedef int apr_wait_t; /** @} */ +#ifdef __cplusplus +} +#endif + #endif /* NETWARE */ #endif /* APR_H */ diff --git a/include/apr.hw b/include/apr.hw index 3e1526c0030..e01f8592534 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -66,10 +66,9 @@ * apr.hw by the apr.dsp and libapr.dsp projects. */ - /** - * @file include/apr.h - * @brief Basic APR header for WIN32 + * @file apr.h + * @brief APR Platform Definitions * @remark This is a generated header generated from include/apr.h.in by * ./configure, or copied from include/apr.hw or include/apr.hnw * for Win32 or Netware by those build environments, respectively. @@ -77,21 +76,12 @@ #if defined(WIN32) || defined(DOXYGEN) -/** - * @defgroup APR APR Functions - * @{ - */ - /* Ignore most warnings (back down to /W3) for poorly constructed headers */ #if defined(_MSC_VER) && _MSC_VER >= 1200 #pragma warning(push, 3) #endif -#ifdef __cplusplus -extern "C" { -#endif - /* disable or reduce the frequency of... * C4057: indirection to slightly different base types * C4075: slight indirection changes (unsigned short* vs short[]) @@ -103,8 +93,52 @@ extern "C" { */ #pragma warning(disable: 4100 4127 4201 4514; once: 4057 4075 4244) +/* Has windows.h already been included? If so, our preferences don't matter, + * but we will still need the winsock things no matter what was included. + * If not, include a restricted set of windows headers to our tastes. + */ +#ifndef _WINDOWS_ +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#ifndef _WIN32_WINNT + +/* Restrict the server to a subset of Windows NT 4.0 header files by default + */ +#define _WIN32_WINNT 0x0400 +#endif +#ifndef NOUSER +#define NOUSER +#endif +#ifndef NOMCX +#define NOMCX +#endif +#ifndef NOIME +#define NOIME +#endif +#include +/* + * Add a _very_few_ declarations missing from the restricted set of headers + * (If this list becomes extensive, re-enable the required headers above!) + * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now + */ +#define SW_HIDE 0 +#ifndef _WIN32_WCE +#include +#include +#else +#include +#endif +#endif /* !_WINDOWS_ */ + +/** + * @defgroup apr_platform Platform Definitions + * @ingroup APR + * @{ + */ + #define APR_INLINE __inline -#define APR_HAS_INLINE 1 +#define APR_HAS_INLINE 1 #define __attribute__(__x) #define NO_USE_SIGACTION @@ -231,43 +265,11 @@ extern "C" { #define APR_HAVE_STRNICMP 0 #endif -/* Has windows.h already been included? If so, our preferences don't matter, - * but we will still need the winsock things no matter what was included. - * If not, include a restricted set of windows headers to our tastes. - */ -#ifndef _WINDOWS_ -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#ifndef _WIN32_WINNT +/** @} */ -/* Restrict the server to a subset of Windows NT 4.0 header files by default - */ -#define _WIN32_WINNT 0x0400 -#endif -#ifndef NOUSER -#define NOUSER -#endif -#ifndef NOMCX -#define NOMCX -#endif -#ifndef NOIME -#define NOIME -#endif -#include -/* - * Add a _very_few_ declarations missing from the restricted set of headers - * (If this list becomes extensive, re-enable the required headers above!) - * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now +/* We don't include our conditional headers within the doxyblocks + * or the extern "C" namespace */ -#define SW_HIDE 0 -#ifndef _WIN32_WCE -#include -#include -#else -#include -#endif -#endif /* !_WINDOWS_ */ #if APR_HAVE_STDLIB_H #include @@ -287,6 +289,19 @@ extern "C" { #if APR_HAVE_PROCESS_H #include #endif +#if APR_HAVE_IPV6 +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup apr_platform + * @ingroup APR + * @{ + */ /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY 1 @@ -370,7 +385,6 @@ typedef int gid_t; #if APR_HAVE_IPV6 -#include /* Appears in later flavors, not the originals. */ #ifndef in_addr6 @@ -382,51 +396,69 @@ typedef int gid_t; ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \ && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) #endif -#endif +#endif /* APR_HAS_IPV6 */ /* Definitions that APR programs need to work properly. */ -#define APR_THREAD_FUNC __stdcall - -/** - * APR_DECLARE_EXPORT is defined when building the APR dynamic library, - * so that all public symbols are exported. - * - * APR_DECLARE_STATIC is defined when including the APR public headers, - * to provide static linkage when the dynamic library may be unavailable. - * - * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when - * including the APR public headers, to import and link the symbols from the - * dynamic APR library and assure appropriate indirection and calling - * conventions at compile time. +/** + * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, + * so that they follow the platform's calling convention. + * @example + */ +/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data); */ +#define APR_THREAD_FUNC __stdcall + + +#if defined(DOXYGEN) || !defined(WIN32) -#if !defined(WIN32) /** * The public APR functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with * variable arguments must use APR_DECLARE_NONSTD(). * - * @deffunc APR_DECLARE(rettype) apr_func(args); + * @remark Both the declaration and implementations must use the same macro. + * @example */ -#define APR_DECLARE(type) type +/** APR_DECLARE(rettype) apr_func(args) + * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA + * @remark Note that when APR compiles the library itself, it passes the + * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) + * to export public symbols from the dynamic library build.\n + * The user must define the APR_DECLARE_STATIC when compiling to target + * the static APR library on some platforms (e.g. Win32.) The public symbols + * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n + * By default, compiling an application and including the APR public + * headers, without defining APR_DECLARE_STATIC, will prepare the code to be + * linked to the dynamic library. + */ +#define APR_DECLARE(type) type + /** * The public APR functions using variable arguments are declared with - * AP_DECLARE(), as they must use the C language calling convention. - * - * @deffunc APR_DECLARE_NONSTD(rettype) apr_func(args, ...); + * APR_DECLARE_NONSTD(), as they must follow the C language calling convention. + * @see APR_DECLARE @see APR_DECLARE_DATA + * @remark Both the declaration and implementations must use the same macro. + * @example + */ +/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...); */ #define APR_DECLARE_NONSTD(type) type + /** * The public APR variables are declared with AP_MODULE_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. - * - * @deffunc APR_DECLARE_DATA type apr_variable; - * @tip extern APR_DECLARE_DATA type apr_variable; syntax is required for - * declarations within headers to properly import the variable. + * @see APR_DECLARE @see APR_DECLARE_NONSTD + * @remark Note that the declaration and implementations use different forms, + * but both must include the macro. + * @example + */ +/** extern APR_DECLARE_DATA type apr_variable;\n + * APR_DECLARE_DATA type apr_variable = value; */ #define APR_DECLARE_DATA + #elif defined(APR_DECLARE_STATIC) #define APR_DECLARE(type) type __stdcall #define APR_DECLARE_NONSTD(type) type @@ -495,6 +527,8 @@ struct iovec { #define APR_PATH_MAX MAX_PATH #endif +/** @} */ + #ifdef __cplusplus } #endif @@ -505,8 +539,6 @@ struct iovec { #pragma warning(pop) #endif -/** @} */ - #endif /* WIN32 */ #endif /* APR_H */ diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 551fa1b1b5f..a07cd65578b 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -55,26 +55,27 @@ #ifndef APR_ALLOCATOR_H #define APR_ALLOCATOR_H -#ifdef __cplusplus -extern "C" { -#endif - /** * @file apr_allocator.h - * @brief APR memory allocation - * - */ -/** - * @defgroup APR_Pool_allocator Allocator - * @ingroup APR_Pool - * @{ + * @brief APR Internal Memory Allocation */ - #include "apr.h" #include "apr_errno.h" -#define APR_WANT_MEMFUNC +#define APR_WANT_MEMFUNC /**< For no good reason? */ #include "apr_want.h" +#include "apr_pools.h" +#include "apr_thread_mutex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup apr_allocator Internal Memory Allocation + * @ingroup APR + * @{ + */ /** the allocator structure */ typedef struct apr_allocator_t apr_allocator_t; @@ -130,8 +131,6 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, apr_memnode_t *memnode); -#include "apr_pools.h" - /** * Set the owner of the allocator * @param allocator The allocator to set the owner for @@ -173,8 +172,6 @@ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, APR_DECLARE(void) apr_allocator_set_max_free(apr_allocator_t *allocator, apr_size_t size); -#include "apr_thread_mutex.h" - #if APR_HAS_THREADS /** * Set a mutex for the allocator to use @@ -202,6 +199,7 @@ APR_DECLARE(apr_thread_mutex_t *) apr_allocator_get_mutex( #endif /* APR_HAS_THREADS */ /** @} */ + #ifdef __cplusplus } #endif diff --git a/include/apr_atomic.h b/include/apr_atomic.h index be419bf56bd..58690364484 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -59,20 +59,28 @@ #ifndef APR_ATOMIC_H #define APR_ATOMIC_H -#ifdef __cplusplus -extern "C" { -#endif - -#include "apr.h" -#include "apr_pools.h" - /** * @file apr_atomic.h * @brief APR Atomic Operations */ + +#include "apr.h" +#include "apr_pools.h" + +/* Platform includes for atomics */ +#if defined(NETWARE) || defined(__MVS__) /* OS/390 */ +#include +#elif defined(__FreeBSD__) +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + /** - * @defgroup APR_Atomic Atomic operations - * @ingroup APR + * @defgroup apr_atomic Atomic Operations + * @ingroup APR * @{ */ @@ -169,7 +177,6 @@ typedef LONG apr_atomic_t; #elif defined(NETWARE) -#include #define apr_atomic_t unsigned long #define apr_atomic_add(mem, val) atomic_add(mem,val) @@ -197,8 +204,6 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) #elif defined(__FreeBSD__) -#include - #define apr_atomic_t apr_uint32_t #define apr_atomic_add(mem, val) atomic_add_int(mem,val) #define apr_atomic_dec(mem) atomic_subtract_int(mem,1) @@ -259,7 +264,7 @@ apr_uint32_t apr_atomic_sub_sparc(volatile apr_atomic_t *mem, apr_uint32_t sub); apr_uint32_t apr_atomic_cas_sparc(volatile apr_uint32_t *mem, long with, long cmp); #elif defined(__MVS__) /* OS/390 */ -#include + #define apr_atomic_t cs_t apr_int32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_int32_t val); @@ -358,6 +363,9 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); #endif /* APR_ATOMIC_NEED_DEFAULT_INIT */ #endif /* !DOXYGEN */ + +/** @} */ + #ifdef __cplusplus } #endif diff --git a/include/apr_compat.h b/include/apr_compat.h index 3651eba8063..e51b79cf140 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -1,13 +1,73 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + #ifndef APR_COMPAT_H #define APR_COMPAT_H -/** + + /** * @file apr_compat.h - * @brief APR Compatibilty Functions - * @deprecated These functions are only present for historical purposes + * @brief APR Legacy Apache 1.3 Compatibility + * @deprecated These defines are only present for historical purposes */ + /** - * @defgroup APR_compat 1.3 Compatibility Functions - * @ingroup APR + * @defgroup apr_compat APR Legacy Apache 1.3 Compatibility + * @ingroup APR * @{ */ @@ -207,5 +267,7 @@ #define AP_OVERLAP_TABLES_MERGE APR_OVERLAP_TABLES_MERGE /** @deprecated @see APR_OVERLAP_TABLES_SET */ #define AP_OVERLAP_TABLES_SET APR_OVERLAP_TABLES_SET + /** @} */ + #endif /* APR_COMPAT_H */ diff --git a/include/apr_dso.h b/include/apr_dso.h index 1efd3c56302..5a5d73884c7 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -55,36 +55,34 @@ #ifndef APR_DSO_DOT_H #define APR_DSO_DOT_H -#include "apr.h" -#include "apr_pools.h" -#include "apr_errno.h" /** * @file apr_dso.h * @brief APR Dynamic Object Handling Routines */ - -/** - * @defgroup APR_DSO Dynamic Object Handling - * @ingroup APR - * @{ - */ +#include "apr.h" +#include "apr_pools.h" +#include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif +/** + * @defgroup apr_dso Dynamic Object Handling + * @ingroup APR + * @{ + */ + #if APR_HAS_DSO || defined(DOXYGEN) /** * Structure for referencing dynamic objects - * @defvar apr_dso_handle_t */ typedef struct apr_dso_handle_t apr_dso_handle_t; /** * Structure for referencing symbols from dynamic objects - * @defvar apr_dso_handle_sym_t */ typedef void * apr_dso_handle_sym_t; @@ -123,8 +121,10 @@ APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_si #endif /* APR_HAS_DSO */ +/** @} */ + #ifdef __cplusplus } #endif -/** @} */ + #endif diff --git a/include/apr_env.h b/include/apr_env.h index f04d62044bf..e8c092e3cdd 100644 --- a/include/apr_env.h +++ b/include/apr_env.h @@ -58,12 +58,6 @@ * @file apr_env.h * @brief APR Environment functions */ -/** - * @defgroup APR_ENV Functions for manupulating the environment - * @ingroup APR_ENV - * @{ - */ - #include "apr_errno.h" #include "apr_pools.h" @@ -71,12 +65,17 @@ extern "C" { #endif /* __cplusplus */ +/** + * @defgroup apr_env Functions for manupulating the environment + * @ingroup APR + * @{ + */ + /** * Get the value of an environment variable * @param value the returned value, allocated from @a pool * @param envvar the name of the environment variable * @param pool where to allocate @a value and any temporary storage from - * @deffunc apr_status_t apr_env_get(char **value, const char *envvar, apr_pool_t *pool) */ APR_DECLARE(apr_status_t) apr_env_get(char **value, const char *envvar, apr_pool_t *pool); @@ -86,7 +85,6 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, const char *envvar, * @param envvar the name of the environment variable * @param value the value to set * @param pool where to allocate temporary storage from - * @deffunc apr_status_t apr_env_get(const char *envvar, const char *value, apr_pool_t *pool) */ APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, const char *value, apr_pool_t *pool); @@ -95,13 +93,13 @@ APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, const char *value, * Delete a variable from the environment * @param envvar the name of the environment variable * @param pool where to allocate temporary storage from - * @deffunc apr_status_t apr_env_delete(const char *envvar, apr_pool_t *pool) */ APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool); +/** @} */ #ifdef __cplusplus } #endif -/** @} */ + #endif /* ! APR_ENV_H */ diff --git a/include/apr_errno.h b/include/apr_errno.h index 74f34a038a7..ca7ecddb9c3 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -55,6 +55,11 @@ #ifndef APR_ERRNO_H #define APR_ERRNO_H +/** + * @file apr_errno.h + * @brief APR Error Codes + */ + #include "apr.h" #if APR_HAVE_ERRNO_H @@ -66,12 +71,8 @@ extern "C" { #endif /* __cplusplus */ /** - * @file apr_errno.h - * @brief APR Error Codes - */ -/** - * @defgroup APR_Error_Codes Error Codes - * @ingroup APR + * @defgroup apr_errno Error Codes + * @ingroup APR * @{ */ @@ -111,48 +112,40 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, */ #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) -/** - * @def apr_get_os_error() +/** @def apr_get_os_error() * @return apr_status_t the last platform error, folded into apr_status_t, on most platforms * @remark This retrieves errno, or calls a GetLastError() style function, and * folds it with APR_FROM_OS_ERROR. Some platforms (such as OS2) have no * such mechanism, so this call may be unsupported. Do NOT use this * call for socket errors from socket, send, recv etc! */ -#define apr_get_os_error() -/** +/** @def apr_set_os_error(e) * Reset the last platform error, unfolded from an apr_status_t, on some platforms - * @param statcode The OS error folded in a prior call to APR_FROM_OS_ERROR() - * @deffunc void apr_set_os_error(apr_status_t statcode) - * @tip Warning: macro implementation; the statcode argument may be evaluated + * @param e The OS error folded in a prior call to APR_FROM_OS_ERROR() + * @warning This is a macro implementation; the statcode argument may be evaluated * multiple times. If the statcode was not created by apr_get_os_error * or APR_FROM_OS_ERROR, the results are undefined. This macro sets * errno, or calls a SetLastError() style function, unfolding statcode * with APR_TO_OS_ERROR. Some platforms (such as OS2) have no such * mechanism, so this call may be unsupported. */ -#define apr_set_os_error(statcode) -/** +/** @def apr_get_netos_error() * Return the last socket error, folded into apr_status_t, on all platforms - * @deffunc apr_status_t apr_get_netos_error() - * @tip This retrieves errno or calls a GetLastSocketError() style function, + * @remark This retrieves errno or calls a GetLastSocketError() style function, * and folds it with APR_FROM_OS_ERROR. */ -#define apr_get_netos_error() -/** +/** @def apr_set_netos_error(e) * Reset the last socket error, unfolded from an apr_status_t - * @param socketcode The socket error folded in a prior call to APR_FROM_OS_ERROR() - * @deffunc void apr_set_os_error(apr_status_t statcode) - * @tip Warning: macro implementation; the statcode argument may be evaluated + * @param e The socket error folded in a prior call to APR_FROM_OS_ERROR() + * @warning This is a macro implementation; the statcode argument may be evaluated * multiple times. If the statcode was not created by apr_get_os_error * or APR_FROM_OS_ERROR, the results are undefined. This macro sets * errno, or calls a WSASetLastError() style function, unfolding * socketcode with APR_TO_OS_ERROR. */ -#define apr_set_netos_error(socketcode) #endif /* defined(DOXYGEN) */ @@ -203,9 +196,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, /** no error. @see APR_STATUS_IS_SUCCESS */ #define APR_SUCCESS 0 -/* APR ERROR VALUES */ /** - * @defgroup APRErrorValues Error Values + * @defgroup APR_Error APR Error Values *
      * APR ERROR VALUES
      * APR_ENOSTAT      APR was unable to perform a stat on the file 
    @@ -315,17 +307,18 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_ESYMNOTFOUND   (APR_OS_START_ERROR + 26)
     /** @see APR_STATUS_IS_EPROC_UNKNOWN */
     #define APR_EPROC_UNKNOWN  (APR_OS_START_ERROR + 27)
    +/** @} */
     
    -/* APR ERROR VALUE TESTS */
     /** 
    - * @defgroup APRErrorValueTests Error Value Tests
    - * @remark For any particular error condition, more than one of these tests
    + * @defgroup APR_STATUS_IS Status Value Tests
    + * @warning For any particular error condition, more than one of these tests
      *      may match. This is because platform-specific error codes may not
      *      always match the semantics of the POSIX codes these tests (and the
      *      correcponding APR error codes) are named after. A notable example
      *      are the APR_STATUS_IS_ENOENT and APR_STATUS_IS_ENOTDIR tests on
      *      Win32 platforms. The programmer should always be aware of this and
      *      adjust the order of the tests accordingly.
    + * @{
      */
     /** 
      * APR was unable to perform a stat on the file 
    @@ -402,7 +395,12 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     /** The given process was not recognized by APR. */
     #define APR_STATUS_IS_EPROC_UNKNOWN(s)  ((s) == APR_EPROC_UNKNOWN)
     
    -/* APR STATUS VALUES */
    +/** @} */
    +
    +/** 
    + * @addtogroup APR_Error
    + * @{
    + */
     /** @see APR_STATUS_IS_INCHILD */
     #define APR_INCHILD        (APR_OS_START_STATUS + 1)
     /** @see APR_STATUS_IS_INPARENT */
    @@ -447,18 +445,11 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_EMISMATCH      (APR_OS_START_STATUS + 24)
     /** @see APR_STATUS_IS_EBUSY */
     #define APR_EBUSY          (APR_OS_START_STATUS + 25)
    +/** @} */
     
    -/**
    - * @defgroup aprerr_status Status Value Tests 
    +/** 
    + * @addtogroup APR_STATUS_IS
      * @{
    - */ 
    -/**
    - * @param status The APR_status code to check.
    - * @param statcode The apr status code to test.
    - * @tip Warning: macro implementations; the statcode argument may be
    - *      evaluated multiple times.  To test for APR_EOF, always test
    - *      APR_STATUS_IS_EOF(statcode) because platform-specific codes are
    - *      not necessarily translated into the corresponding APR_Estatus code.
      */
     /** 
      * Program is currently executing in the child 
    @@ -602,9 +593,11 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
      * more than one error code 
      */
     #define APR_STATUS_IS_EBUSY(s)          ((s) == APR_EBUSY)
    +
     /** @} */
    -/**
    - * @defgroup aprerrcanonical Canonical Errors
    +
    +/** 
    + * @addtogroup APR_Error APR Error Values
      * @{
      */
     /* APR CANONICAL ERROR VALUES */
    @@ -800,8 +793,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #endif
     
     /** @} */
    -/** @} */
    -#if defined(OS2)
    +
    +#if defined(OS2) && !defined(DOXYGEN)
     
     #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
     #define APR_TO_OS_ERROR(e)   (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
    @@ -971,7 +964,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
         { SOCEPIPE,                 EPIPE           }
     */
     
    -#elif defined(WIN32) /* endif defined(OS2) */
    +#elif defined(WIN32) && !defined(DOXYGEN) /* !defined(OS2) */
     
     #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
     #define APR_TO_OS_ERROR(e)   (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
    @@ -1082,7 +1075,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_ENOTEMPTY(s)      ((s) == APR_ENOTEMPTY \
                     || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY)
     
    -#elif defined(NETWARE) /* !def OS2 || WIN32 */
    +#elif defined(NETWARE) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */
     
     #define APR_FROM_OS_ERROR(e)  (e)
     #define APR_TO_OS_ERROR(e)    (e)
    @@ -1137,7 +1130,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_EXDEV(s)          ((s) == APR_EXDEV)
     #define APR_STATUS_IS_ENOTEMPTY(s)      ((s) == APR_ENOTEMPTY)
     
    -#else /* endif defined(NETWARE) */
    +#else /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */
     
     /*
      *  os error codes are clib error codes
    @@ -1152,11 +1145,15 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
      */
     #define apr_get_netos_error() (errno)
     #define apr_set_netos_error(e) (errno = (e))
    +/** @} */
     
    +/** 
    + * @addtogroup APR_STATUS_IS
    + * @{
    + */
     /** no error */
    -#define APR_STATUS_IS_SUCCESS(s)           ((s) == APR_SUCCESS)
    +#define APR_STATUS_IS_SUCCESS(s)        ((s) == APR_SUCCESS)
     
    -/* APR CANONICAL ERROR TESTS */
     /** permission denied */
     #define APR_STATUS_IS_EACCES(s)         ((s) == APR_EACCES)
     /** file exists */
    @@ -1236,8 +1233,9 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     /** Directory Not Empty */
     #define APR_STATUS_IS_ENOTEMPTY(s)       ((s) == APR_ENOTEMPTY || \
                                               (s) == APR_EEXIST)
    +/** @} */
     
    -#endif /* !def OS2 || WIN32 */
    +#endif /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */
     
     /** @} */
     
    diff --git a/include/apr_file_info.h b/include/apr_file_info.h
    index 7e69aea1367..a8914fa070f 100644
    --- a/include/apr_file_info.h
    +++ b/include/apr_file_info.h
    @@ -55,6 +55,11 @@
     #ifndef APR_FILE_INFO_H
     #define APR_FILE_INFO_H
     
    +/**
    + * @file apr_file_info.h
    + * @brief APR File Information
    + */
    +
     #include "apr.h"
     #include "apr_user.h"
     #include "apr_pools.h"
    @@ -69,13 +74,10 @@
     #ifdef __cplusplus
     extern "C" {
     #endif /* __cplusplus */
    +
     /**
    - * @file apr_file_info.h
    - * @brief APR File handling
    - */
    -/**
    - * @defgroup APR_File_Handle File Handling Functions
    - * @ingroup APR
    + * @defgroup apr_file_info File Information
    + * @ingroup APR 
      * @{
      */
     
    @@ -108,7 +110,7 @@ typedef enum {
     } apr_filetype_e; 
     
     /**
    - * @defgroup APR_file_handle_permission File Permissions flags 
    + * @defgroup apr_file_permissions File Permissions flags 
      * @{
      */
     
    @@ -134,18 +136,15 @@ typedef enum {
     
     /**
      * Structure for referencing directories.
    - * @defvar apr_dir_t
      */
     typedef struct apr_dir_t          apr_dir_t;
     /**
      * Structure for determining file permissions.
    - * @defvar apr_fileperms_t
      */
     typedef apr_int32_t               apr_fileperms_t;
     #if (defined WIN32) || (defined NETWARE)
     /**
      * Structure for determining the inode of the file.
    - * @defvar apr_ino_t
      */
     typedef apr_uint64_t              apr_ino_t;
     /**
    @@ -162,7 +161,7 @@ typedef dev_t                     apr_dev_t;
     #endif
     
     /**
    - * @defgroup APR_File_Info Stat Functions
    + * @defgroup apr_file_stat Stat Functions
      * @{
      */
     /** file info structure */
    @@ -266,7 +265,7 @@ APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname,
                                         apr_int32_t wanted, apr_pool_t *cont);
     /** @} */
     /**
    - * @defgroup APR_DIRECTORY Directory Manipulation Functions
    + * @defgroup apr_dir Directory Manipulation Functions
      * @{
      */
     
    @@ -304,7 +303,7 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir);
     /** @} */
     
     /**
    - * @defgroup apr_filepath FilePath Manipulation operations 
    + * @defgroup apr_filepath Filepath Manipulation Functions
      * @{
      */
     
    @@ -334,10 +333,9 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir);
      * trailing slash if a directory
      */
     #define APR_FILEPATH_TRUENAME       0x20
    -/** @} */
    +
     /**
      * Extract the rootpath from the given filepath
    - * @ingroup apr_filepath
      * @param rootpath the root file path returned with APR_SUCCESS or APR_EINCOMPLETE
      * @param filepath the pathname to parse for its root component
      * @param flags the desired rules to apply, from
    @@ -346,7 +344,6 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir);
      *      APR_FILEPATH_TRUENAME  Tests that the root exists, and makes it proper
      * 
    * @param p the pool to allocate the new path string from - * @deffunc apr_status_t apr_filepath_root(const char **rootpath, const char **inpath, apr_int32_t flags, apr_pool_t *p) * @remark on return, filepath points to the first non-root character in the * given filepath. In the simplest example, given a filepath of "/foo", * returns the rootpath of "/" and filepath points at "foo". This is far @@ -367,13 +364,11 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, /** * Merge additional file path onto the previously processed rootpath - * @ingroup apr_filepath * @param newpath the merged paths returned * @param rootpath the root file path (NULL uses the current working path) * @param addpath the path to add to the root path * @param flags the desired APR_FILEPATH_ rules to apply when merging * @param p the pool to allocate the new path string from - * @deffunc apr_status_t apr_filepath_merge(char **newpath, const char *rootpath, const char *addpath, apr_int32_t flags, apr_pool_t *p) * @remark if the flag APR_FILEPATH_TRUENAME is given, and the addpath * contains wildcard characters ('*', '?') on platforms that don't support * such characters within filenames, the paths will be merged, but the @@ -388,11 +383,9 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /** * Split a search path into separate components - * @ingroup apr_filepath * @param pathelts the returned components of the search path * @param liststr the search path (e.g., getenv("PATH")) * @param p the pool to allocate the array and path components from - * @deffunc apr_status_t apr_filepath_list_split(apr_array_header_t **pathelts, const char *liststr, apr_pool_t *p) * @remark empty path componenta do not become part of @a pathelts. * @remark the path separator in @a liststr is system specific; * e.g., ':' on Unix, ';' on Windows, etc. @@ -403,11 +396,9 @@ APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, /** * Merge a list of search path components into a single search path - * @ingroup apr_filepath * @param liststr the returned search path; may be NULL if @a pathelts is empty * @param pathelts the components of the search path * @param p the pool to allocate the search path from - * @deffunc apr_status_t apr_filepath_list_merge(char **liststr, apr_array_header_t *pathelts, apr_pool_t *p) * @remark emtpy strings in the source array are ignored. * @remark the path separator in @a liststr is system specific; * e.g., ':' on Unix, ';' on Windows, etc. @@ -418,30 +409,21 @@ APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, /** * Return the default file path (for relative file names) - * @ingroup apr_filepath * @param path the default path string returned * @param flags optional flag APR_FILEPATH_NATIVE to retrieve the * default file path in os-native format. * @param p the pool to allocate the default path string from - * @deffunc apr_status_t apr_filepath_get(char **path, apr_int32_t flags, apr_pool_t *p) */ APR_DECLARE(apr_status_t) apr_filepath_get(char **path, apr_int32_t flags, apr_pool_t *p); /** * Set the default file path (for relative file names) - * @ingroup apr_filepath * @param path the default path returned * @param p the pool to allocate any working storage - * @deffunc apr_status_t apr_filepath_get(char **defpath, apr_pool_t *p) */ APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p); -/** - * @defgroup apr_filepath_encoding FilePath Character encoding - * @{ - */ - /** The FilePath character encoding is unknown */ #define APR_FILEPATH_ENCODING_UNKNOWN 0 @@ -450,18 +432,16 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p); /** The FilePath character encoding is UTF-8 */ #define APR_FILEPATH_ENCODING_UTF8 2 -/** @} */ + /** * Determine the encoding used internally by the FilePath functions - * @ingroup apr_filepath_encoding * @param style points to a variable which receives the encoding style flag * @param p the pool to allocate any working storage - * @deffunc apr_status_t apr_filepath_encoding(int *style, apr_pool_t *p) * @remark Use @c apr_os_locale_encoding and/or @c apr_os_default_encoding * to get the name of the path encoding if it's not UTF-8. */ APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p); - +/** @} */ /** @} */ @@ -470,5 +450,3 @@ APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p); #endif #endif /* ! APR_FILE_INFO_H */ - - diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 32aaa497ac1..3f1184aa8f6 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -54,17 +54,11 @@ #ifndef APR_FILE_IO_H #define APR_FILE_IO_H + /** * @file apr_file_io.h * @brief APR File I/O Handling */ -/** - * @defgroup APR_File_IO_Handle I/O Handling Functions - * @ingroup APR_File_Handle - * @{ - */ - - #include "apr.h" #include "apr_pools.h" @@ -73,8 +67,8 @@ #include "apr_file_info.h" #include "apr_inherit.h" -#define APR_WANT_STDIO /* for SEEK_* */ -#define APR_WANT_IOVEC +#define APR_WANT_STDIO /**< for SEEK_* */ +#define APR_WANT_IOVEC /**< for apr_file_writev */ #include "apr_want.h" #ifdef __cplusplus @@ -82,7 +76,13 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_file_open File Open Flags/Routines + * @defgroup apr_file_io File I/O Handling Functions + * @ingroup APR + * @{ + */ + +/** + * @defgroup apr_file_open_flags File Open Flags/Routines * @{ */ @@ -108,7 +108,7 @@ extern "C" { /** @} */ /** - * @defgroup APR_file_seek_flags File Seek Flags + * @defgroup apr_file_seek_flags File Seek Flags * @{ */ @@ -122,7 +122,7 @@ extern "C" { /** @} */ /** - * @defgroup APR_file_attrs_set File Attribute Flags + * @defgroup apr_file_attrs_set_flags File Attribute Flags * @{ */ @@ -139,13 +139,12 @@ typedef int apr_seek_where_t; /** * Structure for referencing files. - * @defvar apr_file_t */ typedef struct apr_file_t apr_file_t; /* File lock types/flags */ /** - * @defgroup APR_file_lock_types File Lock Types + * @defgroup apr_file_lock_types File Lock Types * @{ */ @@ -164,6 +163,7 @@ typedef struct apr_file_t apr_file_t; #define APR_FLOCK_NONBLOCK 0x0010 /**< do not block while acquiring the file lock */ /** @} */ + /** * Open the specified file. * @param new_file The opened file descriptor. @@ -195,7 +195,6 @@ typedef struct apr_file_t apr_file_t; * * @param perm Access permissions for file. * @param cont The pool to use. - * @ingroup apr_file_open * @remark If perm is APR_OS_DEFAULT and the file is being created, appropriate * default permissions will be used. *arg1 must point to a valid file_t, * or NULL (in which case it will be allocated) @@ -274,7 +273,6 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); * open standard error as an apr file pointer. * @param thefile The apr file to use as stderr. * @param cont The pool to allocate the file out of. - * @ingroup apr_file_open * * @remark The only reason that the apr_file_open_std* functions exist * is that you may not always have a stderr/out/in on Windows. This @@ -293,7 +291,6 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, * open standard output as an apr file pointer. * @param thefile The apr file to use as stdout. * @param cont The pool to allocate the file out of. - * @ingroup apr_file_open * * @remark The only reason that the apr_file_open_std* functions exist * is that you may not always have a stderr/out/in on Windows. This @@ -312,7 +309,6 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, * open standard input as an apr file pointer. * @param thefile The apr file to use as stdin. * @param cont The pool to allocate the file out of. - * @ingroup apr_file_open * * @remark The only reason that the apr_file_open_std* functions exist * is that you may not always have a stderr/out/in on Windows. This @@ -711,13 +707,11 @@ APR_DECLARE(apr_int32_t) apr_file_flags_get(apr_file_t *f); /** * Get the pool used by the file. - * @return apr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(file); /** * Set a file to be inherited by child processes. - * @param file The file to enable inheritance. * */ APR_DECLARE_INHERIT_SET(file); @@ -727,7 +721,6 @@ APR_DECLARE(void) apr_file_set_inherit(apr_file_t *file); /** * Unset a file from being inherited by child processes. - * @param file The file to disable inheritance. */ APR_DECLARE_INHERIT_UNSET(file); @@ -742,7 +735,6 @@ APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); * the file is opened with * APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE * @param p The pool to allocate the file out of. - * @ingroup apr_file_open * @remark * This function generates a unique temporary file name from template. * The last six characters of template must be XXXXXX and these are replaced @@ -754,8 +746,10 @@ APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *templ, apr_int32_t flags, apr_pool_t *p); +/** @} */ + #ifdef __cplusplus } #endif -/** @} */ + #endif /* ! APR_FILE_IO_H */ diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index 3dfe6d66633..8be40fc82e0 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -41,11 +41,6 @@ * @file apr_fnmatch.h * @brief APR FNMatch Functions */ -/** - * @defgroup APR_FNMatch FNMatch Functions - * @ingroup APR - * @{ - */ #include "apr_errno.h" @@ -53,6 +48,12 @@ extern "C" { #endif +/** + * @defgroup apr_fnmatch Filename Matching Functions + * @ingroup APR + * @{ + */ + #define APR_FNM_NOMATCH 1 /**< Match failed. */ #define APR_FNM_NOESCAPE 0x01 /**< Disable backslash escaping. */ @@ -62,11 +63,11 @@ extern "C" { * @remark This flag is an Apache addition */ -#define FNM_NOMATCH APR_FNM_NOMATCH /**< @deprecated */ -#define FNM_NOESCAPE APR_FNM_NOESCAPE /**< @deprecated */ -#define FNM_PATHNAME APR_FNM_PATHNAME /**< @deprecated */ -#define FNM_PERIOD APR_FNM_PERIOD /**< @deprecated */ -#define FNM_CASE_BLIND APR_FNM_CASE_BLIND /**< @deprecated */ +#define FNM_NOMATCH APR_FNM_NOMATCH /**< @deprecated @see APR_FNM_NOMATCH */ +#define FNM_NOESCAPE APR_FNM_NOESCAPE /**< @deprecated @see APR_FNM_NOESCAPE */ +#define FNM_PATHNAME APR_FNM_PATHNAME /**< @deprecated @see APR_FNM_PATHNAME */ +#define FNM_PERIOD APR_FNM_PERIOD /**< @deprecated @see APR_FNM_PERIOD */ +#define FNM_CASE_BLIND APR_FNM_CASE_BLIND /**< @deprecated @see APR_FNM_CASE_BLIND */ /** * Try to match the string to the given pattern, return APR_SUCCESS if @@ -95,8 +96,10 @@ APR_DECLARE(int) apr_fnmatch_test(const char *pattern); /** @deprecated @see apr_fnmatch_test */ APR_DECLARE(int) apr_is_fnmatch(const char *pattern); +/** @} */ + #ifdef __cplusplus } #endif -/** @} */ -#endif /* !_FNMATCH_H_ */ + +#endif /* !_APR_FNMATCH_H_ */ diff --git a/include/apr_general.h b/include/apr_general.h index 99b6666cb63..0881757252c 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -54,10 +54,15 @@ #ifndef APR_GENERAL_H #define APR_GENERAL_H + /** * @file apr_general.h - * @brief APR Misc routines + * This is collection of oddballs that didn't fit anywhere else, + * and might move to more appropriate headers with the release + * of APR 1.0. + * @brief APR Miscellaneous library routines */ + #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" @@ -71,8 +76,11 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup APR_Misc Misc routines - * @ingroup APR + * @defgroup apr_general Miscellaneous library routines + * @ingroup APR + * This is collection of oddballs that didn't fit anywhere else, + * and might move to more appropriate headers with the release + * of APR 1.0. * @{ */ @@ -145,9 +153,9 @@ typedef int apr_signum_t; /** @deprecated @see APR_OFFSETOF */ #define APR_XtOffsetOf APR_OFFSETOF +#ifndef DOXYGEN -/** - * A couple of prototypes for functions in case some platform doesn't +/* A couple of prototypes for functions in case some platform doesn't * have it */ #if (!APR_HAVE_STRCASECMP) && (APR_HAVE_STRICMP) @@ -162,6 +170,8 @@ int strcasecmp(const char *a, const char *b); int strncasecmp(const char *a, const char *b, size_t n); #endif +#endif + /** * Alignment macros */ @@ -191,10 +201,16 @@ int strncasecmp(const char *a, const char *b, size_t n); void *memchr(const void *s, int c, size_t n); #endif +/** @} */ + +/** + * @defgroup apr_library Library initialization and termination + * @{ + */ + /** * Setup any APR internal data structures. This MUST be the first function * called for any APR library. - * @deffunc apr_status_t apr_initialize(void) * @remark See apr_app_initialize if this is an application, rather than * a library consumer of apr. */ @@ -241,23 +257,22 @@ APR_DECLARE(void) apr_terminate2(void); /** @} */ /** - * @defgroup APR_Random Random Functions - * @ingroup APR + * @defgroup apr_random Random Functions * @{ */ -#if APR_HAS_RANDOM +#if APR_HAS_RANDOM || defined(DOXYGEN) -#ifdef APR_ENABLE_FOR_1_0 -APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, - apr_size_t length); -#else /* TODO: I'm not sure this is the best place to put this prototype...*/ /** * Generate random bytes. * @param buf Buffer to fill with random bytes * @param length Length of buffer in bytes (becomes apr_size_t in APR 1.0) */ +#ifdef APR_ENABLE_FOR_1_0 +APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, + apr_size_t length); +#else APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, int length); #endif diff --git a/include/apr_getopt.h b/include/apr_getopt.h index c45e444b6e8..fbcd7545052 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -55,6 +55,11 @@ #ifndef APR_GETOPT_H #define APR_GETOPT_H +/** + * @file apr_getopt.h + * @brief APR Command Arguments (getopt) + */ + #include "apr_pools.h" #ifdef __cplusplus @@ -62,12 +67,8 @@ extern "C" { #endif /* __cplusplus */ /** - * @file apr_getopt.h - * @brief APR Command Arguments (getopt) - */ -/** - * @defgroup APR_getopt Command Argument Parsing - * @ingroup APR + * @defgroup apr_getopt Command Argument Parsing + * @ingroup APR * @{ */ @@ -150,7 +151,7 @@ APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, *
      *             APR_EOF      --  No more options to parse
      *             APR_BADCH    --  Found a bad option character
    - *             APR_BADARG   --  No argument followed @parameter:
    + *             APR_BADARG   --  No argument followed the option flag
      *             APR_SUCCESS  --  The next option was found.
      * 
    */ @@ -173,7 +174,7 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, *
      *             APR_EOF      --  No more options to parse
      *             APR_BADCH    --  Found a bad option character
    - *             APR_BADARG   --  No argument followed @parameter:
    + *             APR_BADARG   --  No argument followed the option flag
      *             APR_SUCCESS  --  The next option was found.
      * 
    * When APR_SUCCESS is returned, os->ind gives the index of the first diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index 6fe8b3d7921..5b456de278d 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -55,23 +55,26 @@ #ifndef APR_GLOBAL_MUTEX_H #define APR_GLOBAL_MUTEX_H +/** + * @file apr_global_mutex.h + * @brief APR Global Locking Routines + */ + #include "apr.h" #include "apr_proc_mutex.h" /* only for apr_lockmech_e */ #include "apr_pools.h" #include "apr_errno.h" +#if APR_PROC_MUTEX_IS_GLOBAL +#include "apr_proc_mutex.h" +#endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -/** - * @file apr_global_mutex.h - * @brief APR Global Locking Routines - */ - /** * @defgroup APR_GlobalMutex Global Locking Routines - * @ingroup APR + * @ingroup APR * @{ */ @@ -168,8 +171,6 @@ APR_POOL_DECLARE_ACCESSOR(global_mutex); * Define these platforms in terms of an apr_proc_mutex_t. */ -#include "apr_proc_mutex.h" - #define apr_global_mutex_t apr_proc_mutex_t #define apr_global_mutex_create apr_proc_mutex_create #define apr_global_mutex_child_init apr_proc_mutex_child_init @@ -181,6 +182,8 @@ APR_POOL_DECLARE_ACCESSOR(global_mutex); #endif +/** @} */ + #ifdef __cplusplus } #endif diff --git a/include/apr_hash.h b/include/apr_hash.h index e3f5d749287..31d913e1556 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -59,22 +59,23 @@ #ifndef APR_HASH_H #define APR_HASH_H -#ifdef __cplusplus -extern "C" { -#endif /** * @file apr_hash.h * @brief APR Hash Tables */ +#include "apr_pools.h" + +#ifdef __cplusplus +extern "C" { +#endif + /** - * @defgroup APR_Hash Hash Tables - * @ingroup APR + * @defgroup apr_hash Hash Tables + * @ingroup APR * @{ */ -#include "apr_pools.h" - /** * When passing a key to apr_hash_set or apr_hash_get, this value can be * passed to indicate a string-valued key, and have apr_hash compute the @@ -140,6 +141,11 @@ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, * @param p The pool to allocate the apr_hash_index_t iterator. If this * pool is NULL, then an internal, non-thread-safe iterator is used. * @param ht The hash table + * @remark There is no restriction on adding or deleting hash entries during + * an iteration (although the results may be unpredictable unless all you do + * is delete the current entry) and multiple iterations can be in + * progress at the same time. + * @example */ /** @@ -156,13 +162,8 @@ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, * } * return sum; * } - * - * There is no restriction on adding or deleting hash entries during an - * iteration (although the results may be unpredictable unless all you do - * is delete the current entry) and multiple iterations can be in - * progress at the same time. * - */ + */ APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht); /** @@ -229,13 +230,12 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, const void *data); /** - * Get a pointer to the pool which the hash table - * was created in - * @param hash the hash table in question + * Get a pointer to the pool which the hash table was created in */ APR_POOL_DECLARE_ACCESSOR(hash); /** @} */ + #ifdef __cplusplus } #endif diff --git a/include/apr_inherit.h b/include/apr_inherit.h index 09162836166..41b683633bd 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -54,40 +54,36 @@ #ifndef APR_INHERIT_H #define APR_INHERIT_H + /** - * @file apr_inherit.h - * @brief APR File Handle Inheritance - */ -/** - * @defgroup APR_File_Inheritance Inheritance Of File/Sockets - * @ingroup APR_File_Handle - * Sets/Unsets inheritance for File descriptor inheritance in children - * processes. - * - * @{ + * @file apr_inherit.h + * @brief APR File Handle Inheritance Helpers + * @remark This internal header includes internal declaration helpers + * for other headers to declare apr_foo_inherit_[un]set functions. */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - /** - * @param name Set Inheritance for this Socket/File Handle + * Prototype for type-specific declarations of apr_foo_inherit_set + * functions. + * @remark Doxygen unwraps this macro (via doxygen.conf) to provide + * actual help for each specific occurance of apr_foo_inherit_set. + * @remark the linkage is specified for APR. It would be possible to expand + * the macros to support other linkages. */ -#define APR_DECLARE_INHERIT_SET(name) \ - APR_DECLARE(apr_status_t) apr_##name##_inherit_set( \ - apr_##name##_t *the##name) +#define APR_DECLARE_INHERIT_SET(type) \ + APR_DECLARE(apr_status_t) apr_##type##_inherit_set( \ + apr_##type##_t *the##type) /** - * @param name Unset Inheritance for this Socket/File Handle + * Prototype for type-specific declarations of apr_foo_inherit_unset + * functions. + * @remark Doxygen unwraps this macro (via doxygen.conf) to provide + * actual help for each specific occurance of apr_foo_inherit_unset. + * @remark the linkage is specified for APR. It would be possible to expand + * the macros to support other linkages. */ -#define APR_DECLARE_INHERIT_UNSET(name) \ - APR_DECLARE(apr_status_t) apr_##name##_inherit_unset( \ - apr_##name##_t *the##name) - -#ifdef __cplusplus -} -#endif -/** @} */ +#define APR_DECLARE_INHERIT_UNSET(type) \ + APR_DECLARE(apr_status_t) apr_##type##_inherit_unset( \ + apr_##type##_t *the##type) #endif /* ! APR_INHERIT_H */ diff --git a/include/apr_lib.h b/include/apr_lib.h index f35843f451d..a4c6b97776c 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -54,8 +54,12 @@ #ifndef APR_LIB_H #define APR_LIB_H + /** * @file apr_lib.h + * This is collection of oddballs that didn't fit anywhere else, + * and might move to more appropriate headers with the release + * of APR 1.0. * @brief APR general purpose library routines */ @@ -68,16 +72,20 @@ #if APR_HAVE_STDARG_H #include #endif -/** - * @defgroup APR_General General Purpose Library Routines - * @ingroup APR - * @{ - */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +/** + * @defgroup apr_lib General Purpose Library Routines + * @ingroup APR + * This is collection of oddballs that didn't fit anywhere else, + * and might move to more appropriate headers with the release + * of APR 1.0. + * @{ + */ + /** A constant representing a 'large' string. */ #define HUGE_STRING_LEN 8192 @@ -102,15 +110,13 @@ struct apr_vformatter_buff_t { * return the final element of the pathname * @param pathname The path to get the final element of * @return the final element of the path - * @example - */ -/** - * Examples: + * @remark *
    - *                 "/foo/bar/gum"   -> "gum"
    - *                 "/foo/bar/gum/"  -> ""
    - *                 "gum"            -> "gum"
    - *                 "wi\\n32\\stuff" -> "stuff"
    + * For example:
    + *                 "/foo/bar/gum"    -> "gum"
    + *                 "/foo/bar/gum/"   -> ""
    + *                 "gum"             -> "gum"
    + *                 "bs\\path\\stuff" -> "stuff"
      * 
    */ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); @@ -118,47 +124,6 @@ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); /** @deprecated @see apr_filepath_name_get */ APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname); -/** - * These macros allow correct support of 8-bit characters on systems which - * support 8-bit characters. Pretty dumb how the cast is required, but - * that's legacy libc for ya. These new macros do not support EOF like - * the standard macros do. Tough. - * @defgroup apr_ctype ctype functions - * @{ - */ -/** @see isalnum */ -#define apr_isalnum(c) (isalnum(((unsigned char)(c)))) -/** @see isalpha */ -#define apr_isalpha(c) (isalpha(((unsigned char)(c)))) -/** @see iscntrl */ -#define apr_iscntrl(c) (iscntrl(((unsigned char)(c)))) -/** @see isdigit */ -#define apr_isdigit(c) (isdigit(((unsigned char)(c)))) -/** @see isgraph */ -#define apr_isgraph(c) (isgraph(((unsigned char)(c)))) -/** @see islower*/ -#define apr_islower(c) (islower(((unsigned char)(c)))) -/** @see isascii */ -#ifdef isascii -#define apr_isascii(c) (isascii(((unsigned char)(c)))) -#else -#define apr_isascii(c) (((c) & ~0x7f)==0) -#endif -/** @see isprint */ -#define apr_isprint(c) (isprint(((unsigned char)(c)))) -/** @see ispunct */ -#define apr_ispunct(c) (ispunct(((unsigned char)(c)))) -/** @see isspace */ -#define apr_isspace(c) (isspace(((unsigned char)(c)))) -/** @see isupper */ -#define apr_isupper(c) (isupper(((unsigned char)(c)))) -/** @see isxdigit */ -#define apr_isxdigit(c) (isxdigit(((unsigned char)(c)))) -/** @see tolower */ -#define apr_tolower(c) (tolower(((unsigned char)(c)))) -/** @see toupper */ -#define apr_toupper(c) (toupper(((unsigned char)(c)))) -/** @} */ /** * apr_killpg * Small utility macros to make things easier to read. Not usually a @@ -183,9 +148,7 @@ APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname); * @param fmt The format string * @param ap The arguments to use to fill out the format string. * - * @example - */ -/** + * @remark *
      * The extensions are:
      *
    @@ -249,8 +212,53 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b),
     APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, 
                                                apr_size_t *bufsize);
     
    +/** @} */
    +
    +/**
    + * @defgroup apr_ctype ctype functions
    + * These macros allow correct support of 8-bit characters on systems which
    + * support 8-bit characters.  Pretty dumb how the cast is required, but
    + * that's legacy libc for ya.  These new macros do not support EOF like
    + * the standard macros do.  Tough.
    + * @{
    + */
    +/** @see isalnum */
    +#define apr_isalnum(c) (isalnum(((unsigned char)(c))))
    +/** @see isalpha */
    +#define apr_isalpha(c) (isalpha(((unsigned char)(c))))
    +/** @see iscntrl */
    +#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
    +/** @see isdigit */
    +#define apr_isdigit(c) (isdigit(((unsigned char)(c))))
    +/** @see isgraph */
    +#define apr_isgraph(c) (isgraph(((unsigned char)(c))))
    +/** @see islower*/
    +#define apr_islower(c) (islower(((unsigned char)(c))))
    +/** @see isascii */
    +#ifdef isascii
    +#define apr_isascii(c) (isascii(((unsigned char)(c))))
    +#else
    +#define apr_isascii(c) (((c) & ~0x7f)==0)
    +#endif
    +/** @see isprint */
    +#define apr_isprint(c) (isprint(((unsigned char)(c))))
    +/** @see ispunct */
    +#define apr_ispunct(c) (ispunct(((unsigned char)(c))))
    +/** @see isspace */
    +#define apr_isspace(c) (isspace(((unsigned char)(c))))
    +/** @see isupper */
    +#define apr_isupper(c) (isupper(((unsigned char)(c))))
    +/** @see isxdigit */
    +#define apr_isxdigit(c) (isxdigit(((unsigned char)(c))))
    +/** @see tolower */
    +#define apr_tolower(c) (tolower(((unsigned char)(c))))
    +/** @see toupper */
    +#define apr_toupper(c) (toupper(((unsigned char)(c))))
    +
    +/** @} */
    +
     #ifdef __cplusplus
     }
     #endif
    -/** @} */
    +
     #endif	/* ! APR_LIB_H */
    diff --git a/include/apr_mmap.h b/include/apr_mmap.h
    index 744f04e62a8..f6255d0ae3e 100644
    --- a/include/apr_mmap.h
    +++ b/include/apr_mmap.h
    @@ -55,6 +55,11 @@
     #ifndef APR_MMAP_H
     #define APR_MMAP_H
     
    +/**
    + * @file apr_mmap.h
    + * @brief APR MMAP routines
    + */
    +
     #include "apr.h"
     #include "apr_pools.h"
     #include "apr_errno.h"
    @@ -68,13 +73,10 @@
     #ifdef __cplusplus
     extern "C" {
     #endif /* __cplusplus */
    +
     /**
    - * @file apr_mmap.h
    - * @brief APR MMAP routines
    - */
    -/**
    - * @defgroup APR_MMAP MMAP (Memory Map) Routines
    - * @ingroup APR
    + * @defgroup apr_mmap MMAP (Memory Map) Routines
    + * @ingroup APR 
      * @{
      */
     
    @@ -219,11 +221,11 @@ APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mm,
                                               apr_off_t offset);
     
     #endif /* APR_HAS_MMAP */
    +
     /** @} */
    +
     #ifdef __cplusplus
     }
     #endif
     
     #endif  /* ! APR_MMAP_H */
    -
    -
    diff --git a/include/apr_network_io.h b/include/apr_network_io.h
    index fdc922b85fe..baab12fc249 100644
    --- a/include/apr_network_io.h
    +++ b/include/apr_network_io.h
    @@ -58,11 +58,6 @@
      * @file apr_network_io.h
      * @brief APR Network library
      */
    -/**
    - * @defgroup APR_Net Network Routines
    - * @ingroup APR
    - * @{
    - */
     
     #include "apr.h"
     #include "apr_pools.h"
    @@ -78,13 +73,19 @@
     extern "C" {
     #endif /* __cplusplus */
     
    +/**
    + * @defgroup apr_network_io Network Routines
    + * @ingroup APR 
    + * @{
    + */
    +
     #ifndef APR_MAX_SECS_TO_LINGER
     /** Maximum seconds to linger */
     #define APR_MAX_SECS_TO_LINGER 30
     #endif
     
     #ifndef MAX_SECS_TO_LINGER
    -/** @deprecated */
    +/** @deprecated @see APR_MAX_SECS_TO_LINGER */
     #define MAX_SECS_TO_LINGER APR_MAX_SECS_TO_LINGER
     #endif
     
    @@ -99,7 +100,7 @@ extern "C" {
     #endif
     
     /**
    - * @defgroup Sock_opt Socket option definitions
    + * @defgroup apr_sockopt Socket option definitions
      * @{
      */
     #define APR_SO_LINGER        1    /**< Linger */
    @@ -188,7 +189,6 @@ struct in_addr {
     #define APR_PROTO_SCTP    132   /**< SCTP */
     /** @} */
     
    -
     /**
      * Enum to tell us if we're interested in remote or local socket
      */
    @@ -197,8 +197,9 @@ typedef enum {
         APR_REMOTE
     } apr_interface_e;
     
    -/* I guess not everybody uses inet_addr.  This defines apr_inet_addr
    - * appropriately.
    +/**
    + * The specific declaration of inet_addr's ... some platforms fall back
    + * inet_network (this is not good, but necessary)
      */
     
     #if APR_HAVE_INET_ADDR
    @@ -268,19 +269,21 @@ struct apr_sockaddr_t {
     };
     
     #if APR_HAS_SENDFILE
    -/* Define flags passed in on apr_socket_sendfile() */
    +/** 
    + * Support reusing the socket on platforms which support it (from disconnect,
    + * specifically Win32.
    + * @remark Optional flag passed into apr_socket_sendfile() 
    + */
     #define APR_SENDFILE_DISCONNECT_SOCKET      1
     #endif
     
     /** A structure to encapsulate headers and trailers for apr_socket_sendfile */
     struct apr_hdtr_t {
    -    /** An iovec to store the headers sent before the file. 
    -     *  @defvar iovec *headers */
    +    /** An iovec to store the headers sent before the file. */
         struct iovec* headers;
         /** number of headers in the iovec */
         int numheaders;
    -    /** An iovec to store the trailers sent after the file. 
    -     *  @defvar iovec *trailers */
    +    /** An iovec to store the trailers sent after the file. */
         struct iovec* trailers;
         /** number of trailers in the iovec */
         int numtrailers;
    @@ -838,7 +841,6 @@ APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock,
     
     /**
      * Set a socket to be inherited by child processes.
    - * @param socket The socket to enable inheritance.
      */
     APR_DECLARE_INHERIT_SET(socket);
     
    @@ -847,16 +849,17 @@ APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *skt);
     
     /**
      * Unset a socket from being inherited by child processes.
    - * @param socket The socket to disable inheritance.
      */
     APR_DECLARE_INHERIT_UNSET(socket);
     
     /** @deprecated @see apr_socket_inherit_unset */
     APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *skt);
     
    +/** @} */
    +
     #ifdef __cplusplus
     }
     #endif
    -/** @} */
    +
     #endif  /* ! APR_NETWORK_IO_H */
     
    diff --git a/include/apr_poll.h b/include/apr_poll.h
    index 95cc4dddc7d..bd15e6379da 100644
    --- a/include/apr_poll.h
    +++ b/include/apr_poll.h
    @@ -58,12 +58,6 @@
      * @file apr_poll.h
      * @brief APR Poll interface
      */
    -/**
    - * @defgroup APR_Poll Poll Routines
    - * @ingroup APR
    - * @{
    - */
    -
     #include "apr.h"
     #include "apr_pools.h"
     #include "apr_errno.h"
    @@ -80,7 +74,13 @@ extern "C" {
     #endif /* __cplusplus */
     
     /**
    - * @defgroup Poll options
    + * @defgroup apr_poll Poll Routines
    + * @ingroup APR 
    + * @{
    + */
    +
    +/**
    + * @defgroup apr_poll_opt Poll options
      * @{
      */
     #define APR_POLLIN    0x001     /**< Can read without blocking */
    @@ -281,9 +281,11 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
                                                apr_int32_t *num,
                                                const apr_pollfd_t **descriptors);
     
    +/** @} */
    +
     #ifdef __cplusplus
     }
     #endif
    -/** @} */
    +
     #endif  /* ! APR_POLL_H */
     
    diff --git a/include/apr_pools.h b/include/apr_pools.h
    index fcacd566204..a08ae890724 100644
    --- a/include/apr_pools.h
    +++ b/include/apr_pools.h
    @@ -55,16 +55,6 @@
     #ifndef APR_POOLS_H
     #define APR_POOLS_H
     
    -#include "apr.h"
    -#include "apr_errno.h"
    -#include "apr_general.h" /* for APR_STRINGIFY */
    -#define APR_WANT_MEMFUNC
    -#include "apr_want.h"
    -
    -#ifdef __cplusplus
    -extern "C" {
    -#endif
    -
     /**
      * @file apr_pools.h
      * @brief APR memory allocation
    @@ -81,9 +71,20 @@ extern "C" {
      * we can delete everything in the per-transaction apr_pool_t without fear,
      * and without thinking too hard about it either.
      */
    +
    +#include "apr.h"
    +#include "apr_errno.h"
    +#include "apr_general.h" /* for APR_STRINGIFY */
    +#define APR_WANT_MEMFUNC /**< for no good reason? */
    +#include "apr_want.h"
    +
    +#ifdef __cplusplus
    +extern "C" {
    +#endif
    +
     /**
    - * @defgroup APR_Pool Memory Pool Functions
    - * @ingroup APR
    + * @defgroup apr_pools Memory Pool Functions
    + * @ingroup APR 
      * @{
      */
     
    @@ -92,34 +93,37 @@ typedef struct apr_pool_t apr_pool_t;
     
     
     /**
    - * Pool accessor functions.
    + * Declaration helper macro to construct apr_foo_pool_get()s.
      *
    - * These standardized function are used by opaque (APR) data types to return
    + * This standardized macro is used by opaque (APR) data types to return
      * the apr_pool_t that is associated with the data type.
      *
      * APR_POOL_DECLARE_ACCESSOR() is used in a header file to declare the
      * accessor function. A typical usage and result would be:
    - *
    + * 
      *    APR_POOL_DECLARE_ACCESSOR(file);
      * becomes:
      *    APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob);
    + * 
    + * @remark Doxygen unwraps this macro (via doxygen.conf) to provide + * actual help for each specific occurance of apr_foo_pool_get. + * @remark the linkage is specified for APR. It would be possible to expand + * the macros to support other linkages. + */ +#define APR_POOL_DECLARE_ACCESSOR(type) \ + APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \ + (const apr_##type##_t *the##type) + +/** + * Implementation helper macro to provide apr_foo_pool_get()s. * * In the implementation, the APR_POOL_IMPLEMENT_ACCESSOR() is used to * actually define the function. It assumes the field is named "pool". - * - * Note: the linkage is specified for APR. It would be possible to expand - * the macros to support other linkages. */ - -#define APR_POOL_DECLARE_ACCESSOR(typename) \ - APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ - (const apr_##typename##_t *ob) - -/** used to implement the pool accessor */ -#define APR_POOL_IMPLEMENT_ACCESSOR(typename) \ - APR_DECLARE(apr_pool_t *) apr_##typename##_pool_get \ - (const apr_##typename##_t *ob) { return ob->pool; } - +#define APR_POOL_IMPLEMENT_ACCESSOR(type) \ + APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \ + (const apr_##type##_t *the##type) \ + { return the##type->pool; } /** @@ -412,7 +416,7 @@ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size, /** * Set the function to be called when an allocation failure occurs. - * @tip If the program wants APR to exit on a memory allocation error, + * @remark If the program wants APR to exit on a memory allocation error, * then this function can be called to set the callback to use (for * performing cleanup and then exiting). If this function is not called, * then APR will return an error and expect the calling program to @@ -684,8 +688,8 @@ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); #endif /* APR_POOL_DEBUG or DOXYGEN */ - /** @} */ + #ifdef __cplusplus } #endif diff --git a/include/apr_portable.h b/include/apr_portable.h index 196ab8b1e38..6f79f45cddf 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -62,11 +62,6 @@ * @file apr_portable.h * @brief APR Portability Routines */ -/** - * @defgroup APR_portability Portability Routines - * @ingroup APR - * @{ - */ #include "apr.h" #include "apr_pools.h" @@ -94,6 +89,12 @@ extern "C" { #endif /* __cplusplus */ +/** + * @defgroup apr_portabile Portability Routines + * @ingroup APR + * @{ + */ + #ifdef WIN32 /* The primitives for Windows types */ typedef HANDLE apr_os_file_t; @@ -310,7 +311,7 @@ APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, #if APR_HAS_THREADS || defined(DOXYGEN) /** - * @defgroup APR_PORT_Thread Thread portability Routines + * @defgroup apr_os_thread Thread portability Routines * @{ */ /** @@ -471,7 +472,7 @@ APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **shm, #if APR_HAS_DSO || defined(DOXYGEN) /** - * @defgroup apr_port_DSO DSO (Dynamic Loading) Portabiliity Routines + * @defgroup apr_os_dso DSO (Dynamic Loading) Portabiliity Routines * @{ */ /** @@ -518,11 +519,10 @@ APR_DECLARE(const char*) apr_os_default_encoding(apr_pool_t *pool); */ APR_DECLARE(const char*) apr_os_locale_encoding(apr_pool_t *pool); +/** @} */ #ifdef __cplusplus } #endif -/** @} */ - #endif /* ! APR_PORTABLE_H */ diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index e70da3588c2..197da270a1f 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -55,6 +55,11 @@ #ifndef APR_PROC_MUTEX_H #define APR_PROC_MUTEX_H +/** + * @file apr_proc_mutex.h + * @brief APR Process Locking Routines + */ + #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" @@ -64,13 +69,8 @@ extern "C" { #endif /* __cplusplus */ /** - * @file apr_proc_mutex.h - * @brief APR Process Locking Routines - */ - -/** - * @defgroup APR_ProcMutex Process Locking Routines - * @ingroup APR + * @defgroup apr_proc_mutex Process Locking Routines + * @ingroup APR * @{ */ @@ -188,6 +188,8 @@ APR_DECLARE(const char *) apr_proc_mutex_defname(void); */ APR_POOL_DECLARE_ACCESSOR(proc_mutex); +/** @} */ + #ifdef __cplusplus } #endif diff --git a/include/apr_ring.h b/include/apr_ring.h index 39d144ba71b..2f0984b2a05 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -61,12 +61,14 @@ * We'd use Dean's code directly if we could guarantee the * availability of inline functions. */ + +#ifndef APR_RING_H +#define APR_RING_H + /** * @file apr_ring.h * @brief APR Rings */ -#ifndef APR_RING_H -#define APR_RING_H /* * for offsetof() @@ -74,14 +76,11 @@ #include "apr_general.h" /** - * @defgroup APR_Rings Rings - * @ingroup APR - * @{ - */ - -/** + * @defgroup apr_ring Ring Macro Implementations + * @ingroup APR * A ring is a kind of doubly-linked list that can be manipulated * without knowing where its head is. + * @{ */ /** @@ -544,5 +543,7 @@ */ #define APR_RING_CHECK_ELEM(ep, elem, link, msg) #endif + /** @} */ + #endif /* !APR_RING_H */ diff --git a/include/apr_shm.h b/include/apr_shm.h index 15408cc1282..aa5764db558 100644 --- a/include/apr_shm.h +++ b/include/apr_shm.h @@ -55,6 +55,11 @@ #ifndef APR_SHM_H #define APR_SHM_H +/** + * @file apr_shm.h + * @brief APR Shared Memory Routines + */ + #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" @@ -64,13 +69,8 @@ extern "C" { #endif /* __cplusplus */ /** - * @file apr_shm.h - * @brief APR Shared Memory Routines - */ - -/** - * @defgroup APR_SHM Shared Memory Routines - * @ingroup APR + * @defgroup apr_shm Shared Memory Routines + * @ingroup APR * @{ */ @@ -156,6 +156,8 @@ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m); */ APR_POOL_DECLARE_ACCESSOR(shm); +/** @} */ + #ifdef __cplusplus } #endif diff --git a/include/apr_signal.h b/include/apr_signal.h index 6fda5a2a3a1..3ef45ec9779 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -54,6 +54,7 @@ #ifndef APR_SIGNAL_H #define APR_SIGNAL_H + /** * @file apr_signal.h * @brief APR Signal Handling @@ -71,8 +72,8 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup APR_Signal Signal Handling - * @ingroup APR + * @defgroup apr_signal Handling + * @ingroup APR * @{ */ @@ -127,6 +128,7 @@ APR_DECLARE(const char *) apr_signal_get_description(int signum); void apr_signal_init(apr_pool_t *pglobal); /** @} */ + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/include/apr_strings.h b/include/apr_strings.h index 7b2779cd779..ed90befabf3 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -78,6 +78,11 @@ #ifndef APR_STRINGS_H #define APR_STRINGS_H +/** + * @file apr_strings.h + * @brief APR Strings library + */ + #include "apr.h" #include "apr_errno.h" #include "apr_pools.h" @@ -91,15 +96,13 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ + /** - * @file apr_strings.h - * @brief APR Strings library - */ -/** - * @defgroup APR_Strings String routines - * @ingroup APR + * @defgroup apr_strings String routines + * @ingroup APR * @{ */ + /** * Do a natural order comparison of two strings. * @param a The first string to compare @@ -145,7 +148,7 @@ APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n); /** * duplicate the first n characters of a string into memory allocated - * out of a pool; the new string will be '\0'-terminated + * out of a pool; the new string will be null-terminated * @param p The pool to allocate out of * @param s The string to duplicate * @param n The number of characters to duplicate @@ -218,7 +221,7 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) * 2) strncpy() null fills, which is bogus, esp. when copy 8byte strings * into 8k blocks. * 3) Instead of returning the pointer to the beginning of the - * destination string, we return a pointer to the terminating '\0' + * destination string, we return a pointer to the terminating null * to allow us to check for truncation. *
    */ @@ -245,7 +248,7 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, apr_pool_t *token_context); /** - * Split a string into separate '\0'-terminated tokens. The tokens are + * Split a string into separate null-terminated tokens. The tokens are * delimited in the string by one or more characters from the sep * argument. * @param str The string to separate; this should be specified on the @@ -259,7 +262,6 @@ APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last); /** * @defgroup APR_Strings_Snprintf snprintf implementations - * * @warning * These are snprintf implementations based on apr_vformatter(). * @@ -302,8 +304,8 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, */ APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format, va_list ap); - /** @} */ + /** * create a string representation of an int, allocated from a pool * @param p The pool from which to allocate @@ -361,7 +363,9 @@ APR_DECLARE(apr_int64_t) apr_atoi64(const char *buf); * @remark All negative sizes report ' - ', apr_strfsize only formats positive values. */ APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf); + /** @} */ + #ifdef __cplusplus } #endif diff --git a/include/apr_support.h b/include/apr_support.h index f7649a0c4f7..50a4789e658 100644 --- a/include/apr_support.h +++ b/include/apr_support.h @@ -54,15 +54,11 @@ #ifndef APR_SUPPORT_H #define APR_SUPPORT_H + /** * @file apr_support.h * @brief APR Support functions */ -/** - * @defgroup APR_Support Internal APR support functions - * @ingroup APR_Support - * @{ - */ #include "apr.h" #include "apr_network_io.h" @@ -72,14 +68,22 @@ extern "C" { #endif /* __cplusplus */ +/** + * @defgroup apr_support Internal APR support functions + * @ingroup APR + * @{ + */ + /** * Wait for IO to occur or timeout. */ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, int for_read); +/** @} */ + #ifdef __cplusplus } #endif -/** @} */ + #endif /* ! APR_SUPPORT_H */ diff --git a/include/apr_tables.h b/include/apr_tables.h index 608784d2a97..f6620f8f1ea 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -55,6 +55,11 @@ #ifndef APR_TABLES_H #define APR_TABLES_H +/** + * @file apr_tables.h + * @brief APR Table library + */ + #include "apr.h" #include "apr_pools.h" @@ -66,23 +71,15 @@ extern "C" { #endif /* __cplusplus */ -/* - * Define the structures used by the APR general-purpose library. - */ - /** - * @file apr_tables.h - * @brief APR Table library - */ -/** - * @defgroup APR_Table Table routines - * @ingroup APR - * - * Memory allocation stuff, like pools, arrays, and tables. Pools - * and tables are opaque structures to applications, but arrays are - * published. + * @defgroup apr_tables Table and Array Functions + * @ingroup APR + * Tables are used to store entirely opaque structures + * for applications, while Arrays are usually used to + * deal with string lists. * @{ */ + /** the table abstract data type */ typedef struct apr_table_t apr_table_t; @@ -398,7 +395,7 @@ APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, * @see apr_table_do_callback_fn_t */ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, - void *rec, const apr_table_t *t, va_list); + void *rec, const apr_table_t *t, va_list vp); /** flag for overlap to use apr_table_setn */ #define APR_OVERLAP_TABLES_SET (0) @@ -445,6 +442,7 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags); /** @} */ + #ifdef __cplusplus } #endif diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h index 52e0b5c8b79..263604eb38c 100644 --- a/include/apr_thread_cond.h +++ b/include/apr_thread_cond.h @@ -55,6 +55,11 @@ #ifndef APR_THREAD_COND_H #define APR_THREAD_COND_H +/** + * @file apr_thread_cond.h + * @brief APR Condition Variable Routines + */ + #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" @@ -65,24 +70,17 @@ extern "C" { #endif /* __cplusplus */ -#if APR_HAS_THREADS - -/** - * @file apr_thread_cond.h - * @brief APR Condition Variable Routines - */ +#if APR_HAS_THREADS || defined(DOXYGEN) /** - * @defgroup APR_Cond Condition Variable Routines - * @ingroup APR + * @defgroup apr_thread_cond Condition Variable Routines + * @ingroup APR * @{ */ /** Opaque structure for thread condition variables */ typedef struct apr_thread_cond_t apr_thread_cond_t; -/* Function definitions */ - /** * Create and initialize a condition variable that can be used to signal * and schedule threads in a single process. @@ -159,6 +157,8 @@ APR_POOL_DECLARE_ACCESSOR(thread_cond); #endif /* APR_HAS_THREADS */ +/** @} */ + #ifdef __cplusplus } #endif diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 6d89c10c3af..be943f75bc1 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -55,6 +55,11 @@ #ifndef APR_THREAD_MUTEX_H #define APR_THREAD_MUTEX_H +/** + * @file apr_thread_mutex.h + * @brief APR Thread Mutex Routines + */ + #include "apr.h" #include "apr_errno.h" @@ -62,16 +67,11 @@ extern "C" { #endif /* __cplusplus */ -#if APR_HAS_THREADS - -/** - * @file apr_thread_mutex.h - * @brief APR Thread Mutex Routines - */ +#if APR_HAS_THREADS || defined(DOXYGEN) /** - * @defgroup APR_ThreadMutex Thread Mutex Routines - * @ingroup APR + * @defgroup apr_thread_mutex Thread Mutex Routines + * @ingroup APR * @{ */ @@ -96,7 +96,7 @@ typedef struct apr_thread_mutex_t apr_thread_mutex_t; * APR_THREAD_MUTEX_UNNESTED disable nested locks (non-recursive). * * @param pool the pool from which to allocate the mutex. - * @tip Be cautious in using APR_THREAD_MUTEX_DEFAULT. While this is the + * @warning Be cautious in using APR_THREAD_MUTEX_DEFAULT. While this is the * most optimial mutex based on a given platform's performance charateristics, * it will behave as either a nested or an unnested lock. */ @@ -137,9 +137,10 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex); */ APR_POOL_DECLARE_ACCESSOR(thread_mutex); - #endif /* APR_HAS_THREADS */ +/** @} */ + #ifdef __cplusplus } #endif diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 3233a9b89d8..805b9185d43 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -55,6 +55,11 @@ #ifndef APR_THREAD_PROC_H #define APR_THREAD_PROC_H +/** + * @file apr_thread_proc.h + * @brief APR Thread and Process Library + */ + #include "apr.h" #include "apr_file_io.h" #include "apr_pools.h" @@ -65,17 +70,13 @@ #include #endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ + /** - * @file apr_thread_proc.h - * @brief APR Thread and Process Library - */ -/** - * @defgroup APR_Thread Thread Library - * @ingroup APR + * @defgroup apr_thread_proc Threads and Process Functions + * @ingroup APR * @{ */ @@ -131,7 +132,7 @@ typedef enum { #define APR_LIMIT_NOFILE 3 /** - * @defgroup Other_Child Other Child Flags + * @defgroup APR_OC Other Child Flags * @{ */ #define APR_OC_REASON_DEATH 0 /**< child has died, caller must call @@ -152,11 +153,8 @@ typedef enum { */ /** @} */ -/** @see apr_proc_t */ -typedef struct apr_proc_t apr_proc_t; - /** The APR process type */ -struct apr_proc_t { +typedef struct apr_proc_t { /** The process ID */ pid_t pid; /** Parent's side of pipe to child's stdin */ @@ -184,7 +182,7 @@ struct apr_proc_t { */ HANDLE hproc; #endif -}; +} apr_proc_t; /** * The prototype for APR child errfn functions. (See the description @@ -391,12 +389,6 @@ APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, #endif -/* Process Function definitions */ - -/** - * @package APR Process library - */ - /** * Create and initialize a new procattr variable * @param new_attr The newly created procattr. @@ -514,11 +506,13 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, /** * Specify an error function to be called in the child process if APR * encounters an error in the child prior to running the specified program. - * @param child_errfn The function to call in the child process. - * @param userdata Parameter to be passed to errfn. + * @param attr The procattr describing the child process to be created. + * @param errfn The function to call in the child process. * @remark At the present time, it will only be called from apr_proc_create() * on platforms where fork() is used. It will never be called on other - * platforms. + * platforms, on those platforms apr_proc_create() will return the error + * in the parent process rather than invoke the callback in the now-forked + * child process. */ APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, apr_child_errfn_t *errfn); @@ -527,6 +521,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, * Specify that apr_proc_create() should do whatever it can to report * failures to the caller of apr_proc_create(), rather than find out in * the child. + * @param attr The procattr describing the child process to be created. * @param chk Flag to indicate whether or not extra work should be done * to try to report failures to the caller. * @remark This flag only affects apr_proc_create() on platforms where @@ -679,8 +674,9 @@ APR_DECLARE(void) apr_proc_other_child_unregister(void *data); /** * Notify the maintenance callback of a registered other child process * that application has detected an event, such as death. - * @param proc The process to check. - * @param status The status to pass to the maintenance function. + * @param proc The process to check + * @param reason The reason code to pass to the maintenance function + * @param status The status to pass to the maintenance function * @remark An example of code using this behavior; *
    */ #if defined(APR_POOL_DEBUG) -#if (APR_POOL_DEBUG != 0) && (APR_POOL_DEBUG - 0 == 0) +/* If APR_POOL_DEBUG is blank, we get 1; if it is a number, we get -1. */ +#if (APR_POOL_DEBUG - APR_POOL_DEBUG -1 == 1) #undef APR_POOL_DEBUG #define APR_POOL_DEBUG 1 #endif From 3bcde7894b406e165312178f3afb8724077da5f6 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 31 Oct 2003 08:31:20 +0000 Subject: [PATCH 4658/7878] Some remarks about the fields in the memnode_t structure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64704 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 94d39177f35..b2b7b8f0a89 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -80,7 +80,12 @@ typedef struct apr_allocator_t apr_allocator_t; /** the structure which holds information about the allocation */ typedef struct apr_memnode_t apr_memnode_t; -/** basic memory node structure */ +/** basic memory node structure + * @note The next, ref and first_avail fields are available for use by the + * caller of apr_allocator_alloc(), the remaining fields are read-only. + * The next, ref and first_avail fields will be properly restored by + * apr_allocator_free(). + */ struct apr_memnode_t { apr_memnode_t *next; /**< next memnode */ apr_memnode_t **ref; /**< reference to self */ From e1636bce3873d5db52f296a5d70cab9c15b08764 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 31 Oct 2003 10:34:28 +0000 Subject: [PATCH 4659/7878] Fix build on OpenBSD, which needs -pthread but has no -lpthread. * build/apr_threads.m4 (APR_PTHREAD_TRY_RUN): Rename macro from APR_PTHREAD_CHECK_COMPILE; take an actions argument. (APR_PTHREADS_CHECK): Rewrite to use APR_PTHREAD_TRY_RUN, fix broken use of caching, and always try looking for a library to add to LIBS as well as a flag for CFLAGS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64705 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_threads.m4 | 96 +++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 50 deletions(-) diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index ed976a74973..fe38290e628 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -70,11 +70,12 @@ fi dnl -dnl APR_PTHREADS_CHECK_COMPILE +dnl APR_PTHREADS_TRY_RUN(actions-if-success) dnl -dnl Check whether the current setup can use POSIX threads calls +dnl Try running a program which uses pthreads, executing the +dnl actions-if-success commands on success. dnl -AC_DEFUN(APR_PTHREADS_CHECK_COMPILE, [ +AC_DEFUN(APR_PTHREADS_TRY_RUN, [ AC_TRY_RUN( [ #include #include @@ -90,71 +91,66 @@ int main() { int data = 1; pthread_mutexattr_init(&mattr); return pthread_create(&thd, NULL, thread_routine, &data); -} ], [ - pthreads_working="yes" - ], [ - pthreads_working="no" - ], pthreads_working="no" ) +} ], [apr_p_t_r=yes], [apr_p_t_r=no], [apr_p_t_r=no]) + +if test $apr_p_t_r = yes; then + $1 +fi + ])dnl dnl dnl APR_PTHREADS_CHECK() dnl -dnl Try to find a way to enable POSIX threads +dnl Try to find a way to enable POSIX threads. Sets the +dnl pthreads_working variable to "yes" on success. dnl AC_DEFUN(APR_PTHREADS_CHECK,[ -if test -n "$ac_cv_pthreads_lib"; then - LIBS="$LIBS -l$ac_cv_pthreads_lib" -fi - -if test -n "$ac_cv_pthreads_cflags"; then - CFLAGS="$CFLAGS $ac_cv_pthreads_cflags" -fi -APR_PTHREADS_CHECK_COMPILE - -AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[ -ac_cv_pthreads_cflags="" -if test "$pthreads_working" != "yes"; then - for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads; do - ac_save="$CFLAGS" - CFLAGS="$CFLAGS $flag" - APR_PTHREADS_CHECK_COMPILE - if test "$pthreads_working" = "yes"; then - ac_cv_pthreads_cflags="$flag" +AC_CACHE_CHECK([for CFLAGS needed for pthreads], [apr_cv_pthreads_cflags], +[apr_ptc_cflags=$CFLAGS + for flag in none -kthread -pthread -pthreads -mthreads -Kthread -threads; do + CFLAGS=$apr_ptc_cflags + test "x$flag" != "xnone" && CFLAGS="$CFLAGS $flag" + APR_PTHREADS_TRY_RUN([ + apr_cv_pthreads_cflags="$flag" break - fi - CFLAGS="$ac_save" - done -fi + ]) + done + CFLAGS=$apr_ptc_cflags ]) -# Some versions of libtool do not pass -pthread through -# to the compiler when given in a --mode=link line. Some -# versions of gcc ignore -pthread when linking a shared -# object. Hence, if using -pthread, always add -lpthread on -# the link line, to ensure that libapr depends on libpthread. -if test "x$ac_cv_pthreads_cflags" = "x-pthread"; then - APR_ADDTO(LIBS,[-lpthread]) +if test -n "$apr_cv_pthreads_cflags"; then + pthreads_working=yes + if test "x$apr_cv_pthreads_cflags" != "xnone"; then + APR_ADDTO(CFLAGS,[$apr_cv_pthreads_cflags]) + fi fi -AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[ -ac_cv_pthreads_lib="" -if test "$pthreads_working" != "yes"; then - for lib in pthread pthreads c_r; do - ac_save="$LIBS" - LIBS="$LIBS -l$lib" - APR_PTHREADS_CHECK_COMPILE - if test "$pthreads_working" = "yes"; then - ac_cv_pthreads_lib="$lib" +# The CFLAGS may or may not be sufficient to ensure that libapr +# depends on the pthreads library: some versions of libtool +# drop -pthread when passed on the link line; some versions of +# gcc ignore -pthread when linking a shared object. So always +# try and add the relevant library to LIBS too. + +AC_CACHE_CHECK([for LIBS needed for pthreads], [apr_cv_pthreads_lib], [ + apr_ptc_libs=$LIBS + for lib in -lpthread -lpthreads -lc_r; do + LIBS="$apr_ptc_libs $lib" + APR_PTHREADS_TRY_RUN([ + apr_cv_pthreads_lib=$lib break - fi - LIBS="$ac_save" + ]) done -fi + LIBS=$apr_ptc_libs ]) +if test -n "$apr_cv_pthreads_lib"; then + pthreads_working=yes + APR_ADDTO(LIBS,[$apr_cv_pthreads_lib]) +fi + if test "$pthreads_working" = "yes"; then threads_result="POSIX Threads found" else From 980998f8d8951d2cb60424e2134f76110c9d167c Mon Sep 17 00:00:00 2001 From: Thom May Date: Sun, 2 Nov 2003 00:06:24 +0000 Subject: [PATCH 4660/7878] Bah. *BSD's mkstemp doesn't check how many (or whether you have any) Xs you have in the mkstemp format. GNU libc does. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64706 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/tempdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/tempdir.c b/file_io/unix/tempdir.c index c560c007c8a..8839baa4a79 100644 --- a/file_io/unix/tempdir.c +++ b/file_io/unix/tempdir.c @@ -69,7 +69,7 @@ static char global_temp_dir[APR_PATH_MAX+1] = { 0 }; static int test_tempdir(const char *temp_dir, apr_pool_t *p) { apr_file_t *dummy_file; - const char *path = apr_pstrcat(p, temp_dir, "/apr-tmp", NULL); + const char *path = apr_pstrcat(p, temp_dir, "/apr-tmp.XXXXXX", NULL); if (apr_file_mktemp(&dummy_file, (char *)path, 0, p) == APR_SUCCESS) { if (apr_file_putc('!', dummy_file) == APR_SUCCESS) { From 662bec545b402d60bf54e6a5c3ccd10c8963eaef Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 2 Nov 2003 01:06:49 +0000 Subject: [PATCH 4661/7878] * include/apr_allocator.h (apr_memnode_t, apr_allocator_free): Update comments regarding the use of fields within apr_memnode_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64707 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index b2b7b8f0a89..ce2f4e26a95 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -83,7 +83,10 @@ typedef struct apr_memnode_t apr_memnode_t; /** basic memory node structure * @note The next, ref and first_avail fields are available for use by the * caller of apr_allocator_alloc(), the remaining fields are read-only. - * The next, ref and first_avail fields will be properly restored by + * The next field has to be used with caution and sensibly set when the + * memnode is passed back to apr_allocator_free(). See apr_allocator_free() + * for details. + * The ref and first_avail fields will be properly restored by * apr_allocator_free(). */ struct apr_memnode_t { @@ -126,7 +129,9 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, apr_size_t size); /** - * Free a block of mem, giving it back to the allocator + * Free a list of blocks of mem, giving them back to the allocator. + * The list is typically terminated by a memnode with its next field + * set to NULL. * @param allocator The allocator to give the mem back to * @param memnode The memory node to return */ From 81041cefd1b0bbfa4a15eed2da631338c3963d48 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 2 Nov 2003 01:13:52 +0000 Subject: [PATCH 4662/7878] * file_io/unix/tempdir.c (apr_temp_dir_get): Don't cache the cwd as a temp dir. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64708 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/tempdir.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/file_io/unix/tempdir.c b/file_io/unix/tempdir.c index 8839baa4a79..0b433c5ae09 100644 --- a/file_io/unix/tempdir.c +++ b/file_io/unix/tempdir.c @@ -160,8 +160,9 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, /* Finally, try the current working directory. */ if (APR_SUCCESS == apr_filepath_get(&cwd, APR_FILEPATH_NATIVE, p)) { if (test_tempdir(cwd, p)) { - memcpy(global_temp_dir, cwd, strlen(cwd) + 1); - goto end; + /* Don't cache if the selected temp dir is the cwd */ + *temp_dir = apr_pstrdup(p, cwd); + return APR_SUCCESS; } } From f0c909a5463d30365288c2008c1bdbd320bc8452 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 2 Nov 2003 15:46:02 +0000 Subject: [PATCH 4663/7878] * file_io/unix/tempdir.c (apr_temp_dir_get): If we have a cache we might aswell use it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64709 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/tempdir.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/file_io/unix/tempdir.c b/file_io/unix/tempdir.c index 0b433c5ae09..49b3c2e5b25 100644 --- a/file_io/unix/tempdir.c +++ b/file_io/unix/tempdir.c @@ -91,6 +91,10 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, char *cwd; int i; + /* If we have a cached temp dir, use it. */ + if (global_temp_dir[0]) + goto end; + /* Our goal is to find a temporary directory suitable for writing into. We'll only pay the price once if we're successful -- we cache our successful find. Here's the order in which we'll try From c6a824035bf3bd71b04e50e46ea742e70d32ea82 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Sun, 2 Nov 2003 20:51:18 +0000 Subject: [PATCH 4664/7878] The use of "netmask" to hold options is a bit beyond bogus. That term has an entirely different meaning in a networking context. Rename the socket field to "options". Also simplified the test/set macros to just take a socket. * include/arch/os2/apr_arch_networkio.h: * include/arch/unix/apr_arch_networkio.h: * include/arch/win32/apr_arch_networkio.h: - perform adjustments as above. change all uses. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64710 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/apr_arch_networkio.h | 2 +- include/arch/unix/apr_arch_networkio.h | 11 ++-- include/arch/win32/apr_arch_networkio.h | 10 ++-- network_io/unix/sendrecv.c | 76 ++++++++++++------------- network_io/unix/sockets.c | 14 ++--- network_io/unix/sockopt.c | 68 +++++++++++----------- network_io/win32/sockets.c | 8 +-- network_io/win32/sockopt.c | 29 +++++----- 8 files changed, 111 insertions(+), 107 deletions(-) diff --git a/include/arch/os2/apr_arch_networkio.h b/include/arch/os2/apr_arch_networkio.h index efd392a06da..fbb9cb9890b 100644 --- a/include/arch/os2/apr_arch_networkio.h +++ b/include/arch/os2/apr_arch_networkio.h @@ -82,7 +82,7 @@ struct apr_socket_t { int local_port_unknown; int local_interface_unknown; int remote_addr_unknown; - apr_int32_t netmask; + apr_int32_t options; apr_int32_t inherit; sock_userdata_t *userdata; }; diff --git a/include/arch/unix/apr_arch_networkio.h b/include/arch/unix/apr_arch_networkio.h index 917d17f8238..0af3c482d91 100644 --- a/include/arch/unix/apr_arch_networkio.h +++ b/include/arch/unix/apr_arch_networkio.h @@ -149,7 +149,7 @@ struct apr_socket_t { int local_port_unknown; int local_interface_unknown; int remote_addr_unknown; - apr_int32_t netmask; + apr_int32_t options; apr_int32_t inherit; sock_userdata_t *userdata; }; @@ -158,14 +158,15 @@ const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); -#define apr_is_option_set(mask, option) ((mask & option) ==option) +#define apr_is_option_set(skt, option) \ + (((skt)->options & (option)) == (option)) -#define apr_set_option(mask, option, on) \ +#define apr_set_option(skt, option, on) \ do { \ if (on) \ - *mask |= option; \ + (skt)->options |= (option); \ else \ - *mask &= ~option; \ + (skt)->options &= ~(option); \ } while (0) #endif /* ! NETWORK_IO_H */ diff --git a/include/arch/win32/apr_arch_networkio.h b/include/arch/win32/apr_arch_networkio.h index 8fe7e808bf6..d2b7d9417b8 100644 --- a/include/arch/win32/apr_arch_networkio.h +++ b/include/arch/win32/apr_arch_networkio.h @@ -78,7 +78,7 @@ struct apr_socket_t { int local_port_unknown; int local_interface_unknown; int remote_addr_unknown; - apr_int32_t netmask; + apr_int32_t options; apr_int32_t inherit; sock_userdata_t *userdata; }; @@ -98,13 +98,15 @@ const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); -#define apr_is_option_set(mask, option) ((mask & option) ==option) +#define apr_is_option_set(skt, option) \ + (((skt)->options & (option)) == (option)) + #define apr_set_option(mask, option, on) \ do { \ if (on) \ - *mask |= option; \ + *(mask) |= (option); \ else \ - *mask &= ~option; \ + *(mask) &= ~(option); \ } while (0) #endif /* ! NETWORK_IO_H */ diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index c684ce38779..85ef64325e8 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -70,8 +70,8 @@ apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, { apr_ssize_t rv; - if (sock->netmask & APR_INCOMPLETE_WRITE) { - sock->netmask &= ~APR_INCOMPLETE_WRITE; + if (sock->options & APR_INCOMPLETE_WRITE) { + sock->options &= ~APR_INCOMPLETE_WRITE; goto do_select; } @@ -80,7 +80,7 @@ apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) - && apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { + && apr_is_option_set(sock, APR_SO_TIMEOUT)) { apr_status_t arv; do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); @@ -98,8 +98,8 @@ apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, *len = 0; return errno; } - if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) && rv < *len) { - sock->netmask |= APR_INCOMPLETE_WRITE; + if (apr_is_option_set(sock, APR_SO_TIMEOUT) && rv < *len) { + sock->options |= APR_INCOMPLETE_WRITE; } (*len) = rv; return APR_SUCCESS; @@ -110,8 +110,8 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len) apr_ssize_t rv; apr_status_t arv; - if (sock->netmask & APR_INCOMPLETE_READ) { - sock->netmask &= ~APR_INCOMPLETE_READ; + if (sock->options & APR_INCOMPLETE_READ) { + sock->options &= ~APR_INCOMPLETE_READ; goto do_select; } @@ -120,7 +120,7 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len) } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { + apr_is_option_set(sock, APR_SO_TIMEOUT)) { do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { @@ -137,8 +137,8 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len) (*len) = 0; return errno; } - if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) && rv < *len) { - sock->netmask |= APR_INCOMPLETE_READ; + if (apr_is_option_set(sock, APR_SO_TIMEOUT) && rv < *len) { + sock->options |= APR_INCOMPLETE_READ; } (*len) = rv; if (rv == 0) { @@ -160,7 +160,7 @@ apr_status_t apr_socket_sendto(apr_socket_t *sock, apr_sockaddr_t *where, } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) - && apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { + && apr_is_option_set(sock, APR_SO_TIMEOUT)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -193,7 +193,7 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { + apr_is_option_set(sock, APR_SO_TIMEOUT)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { *len = 0; @@ -230,8 +230,8 @@ apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, requested_len += vec[i].iov_len; } - if (sock->netmask & APR_INCOMPLETE_WRITE) { - sock->netmask &= ~APR_INCOMPLETE_WRITE; + if (sock->options & APR_INCOMPLETE_WRITE) { + sock->options &= ~APR_INCOMPLETE_WRITE; goto do_select; } @@ -240,7 +240,7 @@ apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { + apr_is_option_set(sock, APR_SO_TIMEOUT)) { apr_status_t arv; do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); @@ -258,9 +258,9 @@ apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, *len = 0; return errno; } - if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) && + if (apr_is_option_set(sock, APR_SO_TIMEOUT) && rv < requested_len) { - sock->netmask |= APR_INCOMPLETE_WRITE; + sock->options |= APR_INCOMPLETE_WRITE; } (*len) = rv; return APR_SUCCESS; @@ -326,8 +326,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } } - if (sock->netmask & APR_INCOMPLETE_WRITE) { - sock->netmask &= ~APR_INCOMPLETE_WRITE; + if (sock->options & APR_INCOMPLETE_WRITE) { + sock->options &= ~APR_INCOMPLETE_WRITE; goto do_select; } @@ -340,7 +340,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { + apr_is_option_set(sock, APR_SO_TIMEOUT)) { do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { @@ -375,8 +375,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, * partial byte count; this is a non-blocking socket. */ - if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { - sock->netmask |= APR_INCOMPLETE_WRITE; + if (apr_is_option_set(sock, APR_SO_TIMEOUT)) { + sock->options |= APR_INCOMPLETE_WRITE; } return arv; } @@ -499,9 +499,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, /* FreeBSD can send the headers/footers as part of the system call */ do { - if (sock->netmask & APR_INCOMPLETE_WRITE) { + if (sock->options & APR_INCOMPLETE_WRITE) { apr_status_t arv; - sock->netmask &= ~APR_INCOMPLETE_WRITE; + sock->options &= ~APR_INCOMPLETE_WRITE; arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -523,8 +523,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, if (rv == -1) { if (errno == EAGAIN) { - if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { - sock->netmask |= APR_INCOMPLETE_WRITE; + if (apr_is_option_set(sock, APR_SO_TIMEOUT)) { + sock->options |= APR_INCOMPLETE_WRITE; } /* FreeBSD's sendfile can return -1/EAGAIN even if it * sent bytes. Sanitize the result so we get normal EAGAIN @@ -563,7 +563,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, } if (rv == -1 && errno == EAGAIN && - apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { + apr_is_option_set(sock, APR_SO_TIMEOUT)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -681,7 +681,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, if (rc == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { + apr_is_option_set(sock, APR_SO_TIMEOUT)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { @@ -816,8 +816,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, /* O.K. All set up now. Let's go to town */ - if (sock->netmask & APR_INCOMPLETE_WRITE) { - sock->netmask &= ~APR_INCOMPLETE_WRITE; + if (sock->options & APR_INCOMPLETE_WRITE) { + sock->options &= ~APR_INCOMPLETE_WRITE; goto do_select; } @@ -829,7 +829,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { + apr_is_option_set(sock, APR_SO_TIMEOUT)) { do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { @@ -857,9 +857,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, return errno; } - if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) && + if (apr_is_option_set(sock, APR_SO_TIMEOUT) && (parms.bytes_sent < (parms.file_bytes + parms.header_length + parms.trailer_length))) { - sock->netmask |= APR_INCOMPLETE_WRITE; + sock->options |= APR_INCOMPLETE_WRITE; } return APR_SUCCESS; @@ -940,8 +940,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, /* If the last write couldn't send all the requested data, * wait for the socket to become writable before proceeding */ - if (sock->netmask & APR_INCOMPLETE_WRITE) { - sock->netmask &= ~APR_INCOMPLETE_WRITE; + if (sock->options & APR_INCOMPLETE_WRITE) { + sock->options &= ~APR_INCOMPLETE_WRITE; arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -972,7 +972,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, rv = 0; } else if (!arv && - apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) == 1) { + apr_is_option_set(sock, APR_SO_TIMEOUT) == 1) { apr_status_t t = apr_wait_for_io_or_timeout(NULL, sock, 0); if (t != APR_SUCCESS) { @@ -993,9 +993,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, /* Update how much we sent */ *len = nbytes; - if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) && + if (apr_is_option_set(sock, APR_SO_TIMEOUT) && (*len < requested_len)) { - sock->netmask |= APR_INCOMPLETE_WRITE; + sock->options |= APR_INCOMPLETE_WRITE; } return APR_SUCCESS; } diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 0a8c890014d..26a90d5e2fe 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -84,12 +84,12 @@ static void set_socket_vars(apr_socket_t *sock, int family, int type, int protoc sock->protocol = protocol; apr_sockaddr_vars_set(sock->local_addr, family, 0); apr_sockaddr_vars_set(sock->remote_addr, family, 0); - sock->netmask = 0; + sock->options = 0; #if defined(BEOS) && !defined(BEOS_BONE) /* BeOS pre-BONE has TCP_NODELAY on by default and it can't be * switched off! */ - sock->netmask |= APR_TCP_NODELAY; + sock->options |= APR_TCP_NODELAY; #endif } @@ -224,13 +224,13 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, } #if APR_TCP_NODELAY_INHERITED - if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) == 1) { - apr_set_option(&(*new)->netmask, APR_TCP_NODELAY, 1); + if (apr_is_option_set(sock, APR_TCP_NODELAY) == 1) { + apr_set_option(*new, APR_TCP_NODELAY, 1); } #endif /* TCP_NODELAY_INHERITED */ #if APR_O_NONBLOCK_INHERITED - if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) == 1) { - apr_set_option(&(*new)->netmask, APR_SO_NONBLOCK, 1); + if (apr_is_option_set(sock, APR_SO_NONBLOCK) == 1) { + apr_set_option(*new, APR_SO_NONBLOCK, 1); } #endif /* APR_O_NONBLOCK_INHERITED */ @@ -267,7 +267,7 @@ apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) * socket; if called again, we can see EALREADY */ if (rc == -1 && (errno == EINPROGRESS || errno == EALREADY) && - apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { + apr_is_option_set(sock, APR_SO_TIMEOUT)) { rc = apr_wait_for_io_or_timeout(NULL, sock, 0); if (rc != APR_SUCCESS) { return rc; diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index b4ac81e6064..c49809306e4 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -123,29 +123,29 @@ apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) * We want to avoid calling fcntl more than necessary on the socket, */ if (t >= 0 && sock->timeout < 0) { - if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 1) { + if (apr_is_option_set(sock, APR_SO_NONBLOCK) != 1) { if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) { return stat; } - apr_set_option(&sock->netmask, APR_SO_NONBLOCK, 1); + apr_set_option(sock, APR_SO_NONBLOCK, 1); } } else if (t < 0 && sock->timeout >= 0) { - if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != 0) { + if (apr_is_option_set(sock, APR_SO_NONBLOCK) != 0) { if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) { return stat; } - apr_set_option(&sock->netmask, APR_SO_NONBLOCK, 0); + apr_set_option(sock, APR_SO_NONBLOCK, 0); } } /* must disable the incomplete read support if we disable * a timeout */ if (t <= 0) { - sock->netmask &= ~APR_INCOMPLETE_READ; + sock->options &= ~APR_INCOMPLETE_READ; } sock->timeout = t; - apr_set_option(&sock->netmask, APR_SO_TIMEOUT, t > 0); + apr_set_option(sock, APR_SO_TIMEOUT, t > 0); return APR_SUCCESS; } @@ -163,39 +163,39 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, switch(opt) { case APR_SO_KEEPALIVE: #ifdef SO_KEEPALIVE - if (on != apr_is_option_set(sock->netmask, APR_SO_KEEPALIVE)) { + if (on != apr_is_option_set(sock, APR_SO_KEEPALIVE)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { return errno; } - apr_set_option(&sock->netmask,APR_SO_KEEPALIVE, on); + apr_set_option(sock, APR_SO_KEEPALIVE, on); } #else return APR_ENOTIMPL; #endif break; case APR_SO_DEBUG: - if (on != apr_is_option_set(sock->netmask, APR_SO_DEBUG)) { + if (on != apr_is_option_set(sock, APR_SO_DEBUG)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { return errno; } - apr_set_option(&sock->netmask, APR_SO_DEBUG, on); + apr_set_option(sock, APR_SO_DEBUG, on); } break; case APR_SO_REUSEADDR: - if (on != apr_is_option_set(sock->netmask, APR_SO_REUSEADDR)) { + if (on != apr_is_option_set(sock, APR_SO_REUSEADDR)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { return errno; } - apr_set_option(&sock->netmask, APR_SO_REUSEADDR, on); + apr_set_option(sock, APR_SO_REUSEADDR, on); } break; case APR_SO_SNDBUF: #ifdef SO_SNDBUF - if (apr_is_option_set(sock->netmask, APR_SO_SNDBUF) != on) { + if (apr_is_option_set(sock, APR_SO_SNDBUF) != on) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { return errno; } - apr_set_option(&sock->netmask, APR_SO_SNDBUF, on); + apr_set_option(sock, APR_SO_SNDBUF, on); } #else return APR_ENOTIMPL; @@ -203,18 +203,18 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, break; case APR_SO_RCVBUF: #ifdef SO_RCVBUF - if (apr_is_option_set(sock->netmask, APR_SO_RCVBUF) != on) { + if (apr_is_option_set(sock, APR_SO_RCVBUF) != on) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVBUF, (void *)&on, sizeof(int)) == -1) { return errno; } - apr_set_option(&sock->netmask, APR_SO_RCVBUF, on); + apr_set_option(sock, APR_SO_RCVBUF, on); } #else return APR_ENOTIMPL; #endif break; case APR_SO_NONBLOCK: - if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != on) { + if (apr_is_option_set(sock, APR_SO_NONBLOCK) != on) { if (on) { if ((rv = sononblock(sock->socketdes)) != APR_SUCCESS) return rv; @@ -223,19 +223,19 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, if ((rv = soblock(sock->socketdes)) != APR_SUCCESS) return rv; } - apr_set_option(&sock->netmask, APR_SO_NONBLOCK, on); + apr_set_option(sock, APR_SO_NONBLOCK, on); } break; case APR_SO_LINGER: #ifdef SO_LINGER - if (apr_is_option_set(sock->netmask, APR_SO_LINGER) != on) { + if (apr_is_option_set(sock, APR_SO_LINGER) != on) { struct linger li; li.l_onoff = on; li.l_linger = APR_MAX_SECS_TO_LINGER; if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { return errno; } - apr_set_option(&sock->netmask, APR_SO_LINGER, on); + apr_set_option(sock, APR_SO_LINGER, on); } #else return APR_ENOTIMPL; @@ -247,7 +247,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, break; case APR_TCP_NODELAY: #if defined(TCP_NODELAY) - if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) != on) { + if (apr_is_option_set(sock, APR_TCP_NODELAY) != on) { int optlevel = IPPROTO_TCP; int optname = TCP_NODELAY; @@ -260,7 +260,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, if (setsockopt(sock->socketdes, optlevel, optname, (void *)&on, sizeof(int)) == -1) { return errno; } - apr_set_option(&sock->netmask, APR_TCP_NODELAY, on); + apr_set_option(sock, APR_TCP_NODELAY, on); } #else /* BeOS pre-BONE has TCP_NODELAY set by default. @@ -277,7 +277,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, break; case APR_TCP_NOPUSH: #if APR_TCP_NOPUSH_FLAG - if (apr_is_option_set(sock->netmask, APR_TCP_NOPUSH) != on) { + if (apr_is_option_set(sock, APR_TCP_NOPUSH) != on) { int optlevel = IPPROTO_TCP; int optname = TCP_NODELAY; @@ -289,7 +289,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, #endif /* OK we're going to change some settings here... */ /* TCP_NODELAY is mutually exclusive, so do we have it set? */ - if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) == 1 && on) { + if (apr_is_option_set(sock, APR_TCP_NODELAY) == 1 && on) { /* If we want to set NOPUSH then if we have the TCP_NODELAY * flag set we need to switch it off... */ @@ -298,25 +298,25 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, (void*)&tmpflag, sizeof(int)) == -1) { return errno; } - apr_set_option(&sock->netmask, APR_RESET_NODELAY, 1); - apr_set_option(&sock->netmask, APR_TCP_NODELAY, 0); + apr_set_option(sock, APR_RESET_NODELAY, 1); + apr_set_option(sock, APR_TCP_NODELAY, 0); } else if (on) { - apr_set_option(&sock->netmask, APR_RESET_NODELAY, 0); + apr_set_option(sock, APR_RESET_NODELAY, 0); } /* OK, now we can just set the TCP_NOPUSH flag accordingly...*/ if (setsockopt(sock->socketdes, IPPROTO_TCP, APR_TCP_NOPUSH_FLAG, (void*)&on, sizeof(int)) == -1) { return errno; } - apr_set_option(&sock->netmask, APR_TCP_NOPUSH, on); - if (!on && apr_is_option_set(sock->netmask, APR_RESET_NODELAY)) { + apr_set_option(sock, APR_TCP_NOPUSH, on); + if (!on && apr_is_option_set(sock, APR_RESET_NODELAY)) { int tmpflag = 1; if (setsockopt(sock->socketdes, optlevel, optname, (void*)&tmpflag, sizeof(int)) == -1) { return errno; } - apr_set_option(&sock->netmask, APR_RESET_NODELAY,0); - apr_set_option(&sock->netmask, APR_TCP_NODELAY, 1); + apr_set_option(sock, APR_RESET_NODELAY,0); + apr_set_option(sock, APR_TCP_NODELAY, 1); } } #else @@ -324,12 +324,12 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, #endif break; case APR_INCOMPLETE_READ: - apr_set_option(&sock->netmask, APR_INCOMPLETE_READ, on); + apr_set_option(sock, APR_INCOMPLETE_READ, on); break; case APR_IPV6_V6ONLY: #if APR_HAVE_IPV6 && defined(IPV6_V6ONLY) /* we don't know the initial setting of this option, - * so don't check/set sock->netmask since that optimization + * so don't check/set sock->options since that optimization * won't work */ if (setsockopt(sock->socketdes, IPPROTO_IPV6, IPV6_V6ONLY, @@ -364,7 +364,7 @@ apr_status_t apr_socket_opt_get(apr_socket_t *sock, *on = (apr_int32_t)sock->timeout; break; default: - *on = apr_is_option_set(sock->netmask, opt); + *on = apr_is_option_set(sock, opt); } return APR_SUCCESS; } diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index ee8d15a4f75..5ef459e5e17 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -292,13 +292,13 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, } #if APR_TCP_NODELAY_INHERITED - if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) == 1) { - apr_set_option(&(*new)->netmask, APR_TCP_NODELAY, 1); + if (apr_is_option_set(sock, APR_TCP_NODELAY) == 1) { + apr_set_option(*new, APR_TCP_NODELAY, 1); } #endif /* TCP_NODELAY_INHERITED */ #if APR_O_NONBLOCK_INHERITED - if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) == 1) { - apr_set_option(&(*new)->netmask, APR_SO_NONBLOCK, 1); + if (apr_is_option_set(sock, APR_SO_NONBLOCK) == 1) { + apr_set_option(*new, APR_SO_NONBLOCK, 1); } #endif /* APR_O_NONBLOCK_INHERITED */ diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 4849bd8797a..a147ace6403 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -139,34 +139,34 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, return apr_socket_timeout_set(sock, on); } case APR_SO_KEEPALIVE: - if (on != apr_is_option_set(sock->netmask, APR_SO_KEEPALIVE)) { + if (on != apr_is_option_set(sock, APR_SO_KEEPALIVE)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { return apr_get_netos_error(); } - apr_set_option(&sock->netmask,APR_SO_KEEPALIVE, on); + apr_set_option(sock, APR_SO_KEEPALIVE, on); } break; case APR_SO_DEBUG: - if (on != apr_is_option_set(sock->netmask, APR_SO_DEBUG)) { + if (on != apr_is_option_set(sock, APR_SO_DEBUG)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { return apr_get_netos_error(); } - apr_set_option(&sock->netmask, APR_SO_DEBUG, on); + apr_set_option(sock, APR_SO_DEBUG, on); } break; case APR_SO_REUSEADDR: - if (on != apr_is_option_set(sock->netmask, APR_SO_REUSEADDR)) { + if (on != apr_is_option_set(sock, APR_SO_REUSEADDR)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { return apr_get_netos_error(); } - apr_set_option(&sock->netmask, APR_SO_REUSEADDR, on); + apr_set_option(sock, APR_SO_REUSEADDR, on); } break; case APR_SO_NONBLOCK: - if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != on) { + if (apr_is_option_set(sock, APR_SO_NONBLOCK) != on) { if (on) { if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) return stat; @@ -175,12 +175,12 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) return stat; } - apr_set_option(&sock->netmask, APR_SO_NONBLOCK, on); + apr_set_option(sock, APR_SO_NONBLOCK, on); } break; case APR_SO_LINGER: { - if (apr_is_option_set(sock->netmask, APR_SO_LINGER) != on) { + if (apr_is_option_set(sock, APR_SO_LINGER) != on) { struct linger li; li.l_onoff = on; li.l_linger = APR_MAX_SECS_TO_LINGER; @@ -188,12 +188,12 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, (char *) &li, sizeof(struct linger)) == -1) { return apr_get_netos_error(); } - apr_set_option(&sock->netmask, APR_SO_LINGER, on); + apr_set_option(sock, APR_SO_LINGER, on); } break; } case APR_TCP_NODELAY: - if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) != on) { + if (apr_is_option_set(sock, APR_TCP_NODELAY) != on) { int optlevel = IPPROTO_TCP; int optname = TCP_NODELAY; @@ -207,13 +207,13 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, (void *)&on, sizeof(int)) == -1) { return apr_get_netos_error(); } - apr_set_option(&sock->netmask, APR_TCP_NODELAY, on); + apr_set_option(sock, APR_TCP_NODELAY, on); } break; case APR_IPV6_V6ONLY: #if APR_HAVE_IPV6 && defined(IPV6_V6ONLY) /* we don't know the initial setting of this option, - * so don't check/set sock->netmask since that optimization + * so don't check/set sock->options since that optimization * won't work */ if (setsockopt(sock->socketdes, IPPROTO_IPV6, IPV6_V6ONLY, @@ -256,7 +256,8 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, case APR_SO_NONBLOCK: case APR_SO_LINGER: default: - *on = apr_is_option_set(sock->netmask, opt); + *on = apr_is_option_set(sock, opt); + break; } return APR_SUCCESS; } From cfbe49d1fc856c158f1c96b84520331fdd776b81 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Mon, 3 Nov 2003 13:25:01 +0000 Subject: [PATCH 4665/7878] Start of new PRNG. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64712 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 + Makefile.in | 3 + configure.in | 2 +- include/apr_atomic.h | 2 +- include/apr_errno.h | 2 + include/apr_random.h | 96 ++++ random/unix/Makefile.in | 18 + random/unix/apr_random.c | 294 +++++++++++ random/unix/sha2.c | 1065 ++++++++++++++++++++++++++++++++++++++ random/unix/sha2.h | 197 +++++++ random/unix/sha2_glue.c | 33 ++ test/Makefile.in | 2 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testrand2.c | 250 +++++++++ 15 files changed, 1968 insertions(+), 3 deletions(-) create mode 100644 include/apr_random.h create mode 100644 random/unix/Makefile.in create mode 100644 random/unix/apr_random.c create mode 100644 random/unix/sha2.c create mode 100644 random/unix/sha2.h create mode 100644 random/unix/sha2_glue.c create mode 100644 test/testrand2.c diff --git a/CHANGES b/CHANGES index 36f5d395143..0265cac9099 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR 1.0 + *) Add a new PRNG. Note that the implementation of SHA-256 is a + stop-gap pending snarfing the SHA-1 implementation from apr-util + and upgrading it to do SHA-256. Not yet ready for prime time. + [Ben Laurie] + *) Added new versions of the apr_atomic functions for use with 32-bit ints [Brian Pane] diff --git a/Makefile.in b/Makefile.in index 0c1bdc1740c..f69845ce146 100644 --- a/Makefile.in +++ b/Makefile.in @@ -133,6 +133,9 @@ dox: check: $(TARGET_LIB) (cd test && $(MAKE) check) +etags: + etags `find . -name '*.[ch]'` + # DO NOT REMOVE docs: $(INCDIR)/*.h diff --git a/configure.in b/configure.in index 6846570afc5..44b8ec9379e 100644 --- a/configure.in +++ b/configure.in @@ -100,7 +100,7 @@ dnl These added to allow default directories to be used... DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" -apr_modules="file_io network_io threadproc misc locks time mmap shmem user memory atomic poll support" +apr_modules="file_io network_io threadproc misc locks time mmap shmem user memory atomic poll support random" dnl Checks for programs. AC_PROG_MAKE_SET diff --git a/include/apr_atomic.h b/include/apr_atomic.h index c06ffd70f55..d8944827cfe 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -337,7 +337,7 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) #define apr_atomic_add32(mem, val) apr_atomic_add(mem, val) #define apr_atomic_dec32(mem) apr_atomic_dec(mem) #define apr_atomic_inc32(mem) apr_atomic_inc(mem) -#define apr_atomic_set32(mem) apr_atomic_set(mem) +#define apr_atomic_set32(mem,val) apr_atomic_set(mem,val) #define apr_atomic_read32(mem) apr_atomic_read(mem) #elif (defined(__linux__) || defined(__EMX__)) && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC diff --git a/include/apr_errno.h b/include/apr_errno.h index a4f22fb7046..2a1b934a1ff 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -307,6 +307,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_ESYMNOTFOUND (APR_OS_START_ERROR + 26) /** @see APR_STATUS_IS_EPROC_UNKNOWN */ #define APR_EPROC_UNKNOWN (APR_OS_START_ERROR + 27) + +#define APR_ENOTENOUGHENTROPY (APR_OS_START_ERROR + 28) /** @} */ /** diff --git a/include/apr_random.h b/include/apr_random.h new file mode 100644 index 00000000000..b9424f73a4f --- /dev/null +++ b/include/apr_random.h @@ -0,0 +1,96 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef APR_RANDOM_H +#define APR_RANDOM_H + +#include + +typedef struct apr_crypto_hash_t apr_crypto_hash_t; + +typedef void apr_crypto_hash_init_t(apr_crypto_hash_t *hash); +typedef void apr_crypto_hash_add_t(apr_crypto_hash_t *hash,const void *data, + apr_size_t bytes); +typedef void apr_crypto_hash_finish_t(apr_crypto_hash_t *hash, + unsigned char *result); + +// FIXME: make this opaque +struct apr_crypto_hash_t + { + apr_crypto_hash_init_t *init; + apr_crypto_hash_add_t *add; + apr_crypto_hash_finish_t *finish; + apr_size_t size; + void *data; + }; + +apr_crypto_hash_t *apr_crypto_sha256_new(apr_pool_t *p); + +typedef struct apr_random_t apr_random_t; + +void apr_random_init(apr_random_t *g,apr_pool_t *p, + apr_crypto_hash_t *pool_hash,apr_crypto_hash_t *key_hash, + apr_crypto_hash_t *prng_hash); +apr_random_t *apr_random_standard_new(apr_pool_t *p); +void apr_random_add_entropy(apr_random_t *g,const void *entropy_, + apr_size_t bytes); +apr_status_t apr_random_insecure_bytes(apr_random_t *g,void *random, + apr_size_t bytes); +apr_status_t apr_random_secure_bytes(apr_random_t *g,void *random, + apr_size_t bytes); +void apr_random_barrier(apr_random_t *g); +apr_status_t apr_random_secure_ready(apr_random_t *r); +apr_status_t apr_random_insecure_ready(apr_random_t *r); + +#endif /* ndef APR_RANDOM_H */ diff --git a/random/unix/Makefile.in b/random/unix/Makefile.in new file mode 100644 index 00000000000..de384368b26 --- /dev/null +++ b/random/unix/Makefile.in @@ -0,0 +1,18 @@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +TARGETS = \ + apr_random.lo \ + sha2.lo \ + sha2_glue.lo + + +# bring in rules.mk for standard functionality +@INCLUDE_RULES@ + +INCDIR=../../include +OSDIR=$(INCDIR)/arch/@OSDIR@ +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) + +# DO NOT REMOVE diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c new file mode 100644 index 00000000000..d62177b1024 --- /dev/null +++ b/random/unix/apr_random.c @@ -0,0 +1,294 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ +/* + * See the paper "???" by Ben Laurie for an explanation of this PRNG. + */ + +#include "apr.h" +#include "apr_pools.h" +#include "apr_random.h" +#include + +#define min(a,b) ((a) < (b) ? (a) : (b)) + +#define APR_RANDOM_DEFAULT_POOLS 32 +#define APR_RANDOM_DEFAULT_REHASH_SIZE 1024 +#define APR_RANDOM_DEFAULT_RESEED_SIZE 32 +#define APR_RANDOM_DEFAULT_HASH_SECRET_SIZE 32 +#define APR_RANDOM_DEFAULT_G_FOR_INSECURE 32 +#define APR_RANDOM_DEFAULT_G_FOR_SECURE 320 + +typedef struct apr_random_pool_t + { + unsigned char *pool; + int bytes; + int pool_size; + } apr_random_pool_t; + +#define hash_init(h) (h)->init(h) +#define hash_add(h,b,n) (h)->add(h,b,n) +#define hash_finish(h,r) (h)->finish(h,r) + +#define hash(h,r,b,n) hash_init(h),hash_add(h,b,n),hash_finish(h,r) + +#define crypt_setkey(c,k) (c)->set_key((c)->data,k) +#define crypt_crypt(c,out,in) (c)->crypt((c)->date,out,in) + +struct apr_random_t + { + apr_pool_t *apr_pool; + apr_crypto_hash_t *pool_hash; + unsigned int npools; + apr_random_pool_t *pools; + unsigned int next_pool; + unsigned int generation; + apr_size_t rehash_size; + apr_size_t reseed_size; + apr_crypto_hash_t *key_hash; +#define K_size(g) ((g)->key_hash->size) + apr_crypto_hash_t *prng_hash; +#define B_size(g) ((g)->prng_hash->size) + unsigned char *H; + unsigned char *H_waiting; +#define H_size(g) (B_size(g)+K_size(g)) + unsigned char *randomness; + apr_size_t random_bytes; + unsigned int g_for_insecure; + unsigned int g_for_secure; + unsigned int secure_base; + unsigned char insecure_started:1; + unsigned char secure_started:1; + }; + +void apr_random_init(apr_random_t *g,apr_pool_t *p, + apr_crypto_hash_t *pool_hash,apr_crypto_hash_t *key_hash, + apr_crypto_hash_t *prng_hash) + { + int n; + + g->apr_pool=p; + g->pool_hash=pool_hash; + g->key_hash=key_hash; + g->prng_hash=prng_hash; + g->npools=APR_RANDOM_DEFAULT_POOLS; + g->pools=apr_palloc(p,g->npools*sizeof *g->pools); + for(n=0 ; n < g->npools ; ++n) + { + g->pools[n].bytes=g->pools[n].pool_size=0; + g->pools[n].pool=NULL; + } + g->next_pool=0; + g->generation=0; + g->rehash_size=APR_RANDOM_DEFAULT_REHASH_SIZE; + /* Ensure that the rehash size is twice the size of the pool hasher */ + g->rehash_size=((g->rehash_size+2*g->pool_hash->size-1)/g->pool_hash->size + /2)*g->pool_hash->size*2; + g->reseed_size=APR_RANDOM_DEFAULT_RESEED_SIZE; + g->prng_hash=prng_hash; + g->H=apr_palloc(p,H_size(g)); + g->H_waiting=apr_palloc(p,H_size(g)); + g->randomness=apr_palloc(p,B_size(g)); + g->random_bytes=0; + + g->g_for_insecure=APR_RANDOM_DEFAULT_G_FOR_INSECURE; + g->secure_base=0; + g->g_for_secure=APR_RANDOM_DEFAULT_G_FOR_SECURE; + g->secure_started=g->insecure_started=0; + } + +apr_random_t *apr_random_standard_new(apr_pool_t *p) + { + apr_random_t *r=apr_palloc(p,sizeof *r); + + apr_random_init(r,p,apr_crypto_sha256_new(p),apr_crypto_sha256_new(p), + apr_crypto_sha256_new(p)); + return r; + } + +static void rekey(apr_random_t *g) + { + int n; + unsigned char *H=(g->insecure_started && !g->secure_started) ? g->H_waiting + : g->H; + + hash_init(g->key_hash); + hash_add(g->key_hash,H,H_size(g)); + for(n=0 ; n < g->npools && (n == 0 || g->generation&(1 << (n-1))) + ; ++n) + { + hash_add(g->key_hash,g->pools[n].pool,g->pools[n].bytes); + g->pools[n].bytes=0; + } + hash_finish(g->key_hash,H+B_size(g)); + ++g->generation; + if(!g->insecure_started && g->generation > g->g_for_insecure) + { + g->insecure_started=1; + if(!g->secure_started) + { + memcpy(g->H_waiting,g->H,H_size(g)); + g->secure_base=g->generation; + } + } + if(!g->secure_started && g->generation > g->secure_base+g->g_for_secure) + { + g->secure_started=1; + memcpy(g->H,g->H_waiting,H_size(g)); + } + } + +void apr_random_add_entropy(apr_random_t *g,const void *entropy_, + apr_size_t bytes) + { + int n; + const unsigned char *entropy=entropy_; + + for(n=0 ; n < bytes ; ++n) + { + apr_random_pool_t *p=&g->pools[g->next_pool]; + + if(++g->next_pool == g->npools) + g->next_pool=0; + + if(p->pool_size < p->bytes+1) + { + unsigned char *np=apr_palloc(g->apr_pool,(p->bytes+1)*2); + + memcpy(np,p->pool,p->bytes); + p->pool=np; + p->pool_size=(p->bytes+1)*2; + } + p->pool[p->bytes++]=entropy[n]; + + if(p->bytes == g->rehash_size) + { + int r; + + for(r=0 ; r < p->bytes/2 ; r+=g->pool_hash->size) + hash(g->pool_hash,p->pool+r,p->pool+r*2,g->pool_hash->size*2); + p->bytes/=2; + } + assert(p->bytes < g->rehash_size); + } + + if(g->pools[0].bytes >= g->reseed_size) + rekey(g); + } + +// This will give g->B_size bytes of randomness +static void apr_random_block(apr_random_t *g,unsigned char *random) + { + // FIXME: in principle, these are different hashes + hash(g->prng_hash,g->H,g->H,H_size(g)); + hash(g->prng_hash,random,g->H,B_size(g)); + } + +static void apr_random_bytes(apr_random_t *g,unsigned char *random, + apr_size_t bytes) + { + apr_size_t n; + + for(n=0 ; n < bytes ; ) + { + int l; + + if(g->random_bytes == 0) + { + apr_random_block(g,g->randomness); + g->random_bytes=B_size(g); + } + l=min(bytes-n,g->random_bytes); + memcpy(&random[n],g->randomness+B_size(g)-g->random_bytes,l); + g->random_bytes-=l; + n+=l; + } + } + +apr_status_t apr_random_secure_bytes(apr_random_t *g,void *random, + apr_size_t bytes) + { + if(!g->secure_started) + return APR_ENOTENOUGHENTROPY; + apr_random_bytes(g,random,bytes); + return APR_SUCCESS; + } + +apr_status_t apr_random_insecure_bytes(apr_random_t *g,void *random, + apr_size_t bytes) + { + if(!g->insecure_started) + return APR_ENOTENOUGHENTROPY; + apr_random_bytes(g,random,bytes); + return APR_SUCCESS; + } + +void apr_random_barrier(apr_random_t *g) + { + g->secure_started=0; + g->secure_base=g->generation; + } + +apr_status_t apr_random_secure_ready(apr_random_t *r) + { + if(!r->secure_started) + return APR_ENOTENOUGHENTROPY; + return APR_SUCCESS; + } + +apr_status_t apr_random_insecure_ready(apr_random_t *r) + { + if(!r->insecure_started) + return APR_ENOTENOUGHENTROPY; + return APR_SUCCESS; + } diff --git a/random/unix/sha2.c b/random/unix/sha2.c new file mode 100644 index 00000000000..d454285e918 --- /dev/null +++ b/random/unix/sha2.c @@ -0,0 +1,1065 @@ +/* + * FILE: sha2.c + * AUTHOR: Aaron D. Gifford + * + * Copyright (c) 2000-2001, Aaron D. Gifford + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id: sha2.c,v 1.1 2003/11/03 13:25:00 ben Exp $ + */ + +#include /* memcpy()/memset() or bcopy()/bzero() */ +#include /* assert() */ +#include "sha2.h" + +/* + * ASSERT NOTE: + * Some sanity checking code is included using assert(). On my FreeBSD + * system, this additional code can be removed by compiling with NDEBUG + * defined. Check your own systems manpage on assert() to see how to + * compile WITHOUT the sanity checking code on your system. + * + * UNROLLED TRANSFORM LOOP NOTE: + * You can define SHA2_UNROLL_TRANSFORM to use the unrolled transform + * loop version for the hash transform rounds (defined using macros + * later in this file). Either define on the command line, for example: + * + * cc -DSHA2_UNROLL_TRANSFORM -o sha2 sha2.c sha2prog.c + * + * or define below: + * + * #define SHA2_UNROLL_TRANSFORM + * + */ + + +/*** SHA-256/384/512 Machine Architecture Definitions *****************/ +/* + * BYTE_ORDER NOTE: + * + * Please make sure that your system defines BYTE_ORDER. If your + * architecture is little-endian, make sure it also defines + * LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are + * equivilent. + * + * If your system does not define the above, then you can do so by + * hand like this: + * + * #define LITTLE_ENDIAN 1234 + * #define BIG_ENDIAN 4321 + * + * And for little-endian machines, add: + * + * #define BYTE_ORDER LITTLE_ENDIAN + * + * Or for big-endian machines: + * + * #define BYTE_ORDER BIG_ENDIAN + * + * The FreeBSD machine this was written on defines BYTE_ORDER + * appropriately by including (which in turn includes + * where the appropriate definitions are actually + * made). + */ +#if !defined(BYTE_ORDER) || (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN) +#error Define BYTE_ORDER to be equal to either LITTLE_ENDIAN or BIG_ENDIAN +#endif + +/* + * Define the followingsha2_* types to types of the correct length on + * the native archtecture. Most BSD systems and Linux define u_intXX_t + * types. Machines with very recent ANSI C headers, can use the + * uintXX_t definintions from inttypes.h by defining SHA2_USE_INTTYPES_H + * during compile or in the sha.h header file. + * + * Machines that support neither u_intXX_t nor inttypes.h's uintXX_t + * will need to define these three typedefs below (and the appropriate + * ones in sha.h too) by hand according to their system architecture. + * + * Thank you, Jun-ichiro itojun Hagino, for suggesting using u_intXX_t + * types and pointing out recent ANSI C support for uintXX_t in inttypes.h. + */ +#ifdef SHA2_USE_INTTYPES_H + +typedef uint8_t sha2_byte; /* Exactly 1 byte */ +typedef uint32_t sha2_word32; /* Exactly 4 bytes */ +typedef uint64_t sha2_word64; /* Exactly 8 bytes */ + +#else /* SHA2_USE_INTTYPES_H */ + +typedef u_int8_t sha2_byte; /* Exactly 1 byte */ +typedef u_int32_t sha2_word32; /* Exactly 4 bytes */ +typedef u_int64_t sha2_word64; /* Exactly 8 bytes */ + +#endif /* SHA2_USE_INTTYPES_H */ + + +/*** SHA-256/384/512 Various Length Definitions ***********************/ +/* NOTE: Most of these are in sha2.h */ +#define SHA256_SHORT_BLOCK_LENGTH (SHA256_BLOCK_LENGTH - 8) +#define SHA384_SHORT_BLOCK_LENGTH (SHA384_BLOCK_LENGTH - 16) +#define SHA512_SHORT_BLOCK_LENGTH (SHA512_BLOCK_LENGTH - 16) + + +/*** ENDIAN REVERSAL MACROS *******************************************/ +#if BYTE_ORDER == LITTLE_ENDIAN +#define REVERSE32(w,x) { \ + sha2_word32 tmp = (w); \ + tmp = (tmp >> 16) | (tmp << 16); \ + (x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \ +} +#define REVERSE64(w,x) { \ + sha2_word64 tmp = (w); \ + tmp = (tmp >> 32) | (tmp << 32); \ + tmp = ((tmp & 0xff00ff00ff00ff00ULL) >> 8) | \ + ((tmp & 0x00ff00ff00ff00ffULL) << 8); \ + (x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \ + ((tmp & 0x0000ffff0000ffffULL) << 16); \ +} +#endif /* BYTE_ORDER == LITTLE_ENDIAN */ + +/* + * Macro for incrementally adding the unsigned 64-bit integer n to the + * unsigned 128-bit integer (represented using a two-element array of + * 64-bit words): + */ +#define ADDINC128(w,n) { \ + (w)[0] += (sha2_word64)(n); \ + if ((w)[0] < (n)) { \ + (w)[1]++; \ + } \ +} + +/* + * Macros for copying blocks of memory and for zeroing out ranges + * of memory. Using these macros makes it easy to switch from + * using memset()/memcpy() and using bzero()/bcopy(). + * + * Please define either SHA2_USE_MEMSET_MEMCPY or define + * SHA2_USE_BZERO_BCOPY depending on which function set you + * choose to use: + */ +#if !defined(SHA2_USE_MEMSET_MEMCPY) && !defined(SHA2_USE_BZERO_BCOPY) +/* Default to memset()/memcpy() if no option is specified */ +#define SHA2_USE_MEMSET_MEMCPY 1 +#endif +#if defined(SHA2_USE_MEMSET_MEMCPY) && defined(SHA2_USE_BZERO_BCOPY) +/* Abort with an error if BOTH options are defined */ +#error Define either SHA2_USE_MEMSET_MEMCPY or SHA2_USE_BZERO_BCOPY, not both! +#endif + +#ifdef SHA2_USE_MEMSET_MEMCPY +#define MEMSET_BZERO(p,l) memset((p), 0, (l)) +#define MEMCPY_BCOPY(d,s,l) memcpy((d), (s), (l)) +#endif +#ifdef SHA2_USE_BZERO_BCOPY +#define MEMSET_BZERO(p,l) bzero((p), (l)) +#define MEMCPY_BCOPY(d,s,l) bcopy((s), (d), (l)) +#endif + + +/*** THE SIX LOGICAL FUNCTIONS ****************************************/ +/* + * Bit shifting and rotation (used by the six SHA-XYZ logical functions: + * + * NOTE: The naming of R and S appears backwards here (R is a SHIFT and + * S is a ROTATION) because the SHA-256/384/512 description document + * (see http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf) uses this + * same "backwards" definition. + */ +/* Shift-right (used in SHA-256, SHA-384, and SHA-512): */ +#define R(b,x) ((x) >> (b)) +/* 32-bit Rotate-right (used in SHA-256): */ +#define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) +/* 64-bit Rotate-right (used in SHA-384 and SHA-512): */ +#define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) + +/* Two of six logical functions used in SHA-256, SHA-384, and SHA-512: */ +#define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) +#define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) + +/* Four of six logical functions used in SHA-256: */ +#define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x))) +#define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x))) +#define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x))) +#define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x))) + +/* Four of six logical functions used in SHA-384 and SHA-512: */ +#define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) +#define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) +#define sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x))) +#define sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x))) + +/*** INTERNAL FUNCTION PROTOTYPES *************************************/ +/* NOTE: These should not be accessed directly from outside this + * library -- they are intended for private internal visibility/use + * only. + */ +void SHA512_Last(SHA512_CTX*); +void SHA256_Transform(SHA256_CTX*, const sha2_word32*); +void SHA512_Transform(SHA512_CTX*, const sha2_word64*); + + +/*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ +/* Hash constant words K for SHA-256: */ +const static sha2_word32 K256[64] = { + 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, + 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, + 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, + 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, + 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, + 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, + 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, + 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, + 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, + 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, + 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, + 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, + 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, + 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, + 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, + 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL +}; + +/* Initial hash value H for SHA-256: */ +const static sha2_word32 sha256_initial_hash_value[8] = { + 0x6a09e667UL, + 0xbb67ae85UL, + 0x3c6ef372UL, + 0xa54ff53aUL, + 0x510e527fUL, + 0x9b05688cUL, + 0x1f83d9abUL, + 0x5be0cd19UL +}; + +/* Hash constant words K for SHA-384 and SHA-512: */ +const static sha2_word64 K512[80] = { + 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, + 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, + 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, + 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, + 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, + 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, + 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, + 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, + 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, + 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, + 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, + 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, + 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, + 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, + 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, + 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, + 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, + 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, + 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, + 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, + 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, + 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, + 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, + 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, + 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, + 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, + 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, + 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, + 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, + 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, + 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, + 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, + 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, + 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, + 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, + 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, + 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, + 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, + 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, + 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL +}; + +/* Initial hash value H for SHA-384 */ +const static sha2_word64 sha384_initial_hash_value[8] = { + 0xcbbb9d5dc1059ed8ULL, + 0x629a292a367cd507ULL, + 0x9159015a3070dd17ULL, + 0x152fecd8f70e5939ULL, + 0x67332667ffc00b31ULL, + 0x8eb44a8768581511ULL, + 0xdb0c2e0d64f98fa7ULL, + 0x47b5481dbefa4fa4ULL +}; + +/* Initial hash value H for SHA-512 */ +const static sha2_word64 sha512_initial_hash_value[8] = { + 0x6a09e667f3bcc908ULL, + 0xbb67ae8584caa73bULL, + 0x3c6ef372fe94f82bULL, + 0xa54ff53a5f1d36f1ULL, + 0x510e527fade682d1ULL, + 0x9b05688c2b3e6c1fULL, + 0x1f83d9abfb41bd6bULL, + 0x5be0cd19137e2179ULL +}; + +/* + * Constant used by SHA256/384/512_End() functions for converting the + * digest to a readable hexadecimal character string: + */ +static const char *sha2_hex_digits = "0123456789abcdef"; + + +/*** SHA-256: *********************************************************/ +void SHA256_Init(SHA256_CTX* context) { + if (context == (SHA256_CTX*)0) { + return; + } + MEMCPY_BCOPY(context->state, sha256_initial_hash_value, SHA256_DIGEST_LENGTH); + MEMSET_BZERO(context->buffer, SHA256_BLOCK_LENGTH); + context->bitcount = 0; +} + +#ifdef SHA2_UNROLL_TRANSFORM + +/* Unrolled SHA-256 round macros: */ + +#if BYTE_ORDER == LITTLE_ENDIAN + +#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ + REVERSE32(*data++, W256[j]); \ + T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ + K256[j] + W256[j]; \ + (d) += T1; \ + (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ + j++ + + +#else /* BYTE_ORDER == LITTLE_ENDIAN */ + +#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ + T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ + K256[j] + (W256[j] = *data++); \ + (d) += T1; \ + (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ + j++ + +#endif /* BYTE_ORDER == LITTLE_ENDIAN */ + +#define ROUND256(a,b,c,d,e,f,g,h) \ + s0 = W256[(j+1)&0x0f]; \ + s0 = sigma0_256(s0); \ + s1 = W256[(j+14)&0x0f]; \ + s1 = sigma1_256(s1); \ + T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \ + (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \ + (d) += T1; \ + (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ + j++ + +void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { + sha2_word32 a, b, c, d, e, f, g, h, s0, s1; + sha2_word32 T1, *W256; + int j; + + W256 = (sha2_word32*)context->buffer; + + /* Initialize registers with the prev. intermediate value */ + a = context->state[0]; + b = context->state[1]; + c = context->state[2]; + d = context->state[3]; + e = context->state[4]; + f = context->state[5]; + g = context->state[6]; + h = context->state[7]; + + j = 0; + do { + /* Rounds 0 to 15 (unrolled): */ + ROUND256_0_TO_15(a,b,c,d,e,f,g,h); + ROUND256_0_TO_15(h,a,b,c,d,e,f,g); + ROUND256_0_TO_15(g,h,a,b,c,d,e,f); + ROUND256_0_TO_15(f,g,h,a,b,c,d,e); + ROUND256_0_TO_15(e,f,g,h,a,b,c,d); + ROUND256_0_TO_15(d,e,f,g,h,a,b,c); + ROUND256_0_TO_15(c,d,e,f,g,h,a,b); + ROUND256_0_TO_15(b,c,d,e,f,g,h,a); + } while (j < 16); + + /* Now for the remaining rounds to 64: */ + do { + ROUND256(a,b,c,d,e,f,g,h); + ROUND256(h,a,b,c,d,e,f,g); + ROUND256(g,h,a,b,c,d,e,f); + ROUND256(f,g,h,a,b,c,d,e); + ROUND256(e,f,g,h,a,b,c,d); + ROUND256(d,e,f,g,h,a,b,c); + ROUND256(c,d,e,f,g,h,a,b); + ROUND256(b,c,d,e,f,g,h,a); + } while (j < 64); + + /* Compute the current intermediate hash value */ + context->state[0] += a; + context->state[1] += b; + context->state[2] += c; + context->state[3] += d; + context->state[4] += e; + context->state[5] += f; + context->state[6] += g; + context->state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = 0; +} + +#else /* SHA2_UNROLL_TRANSFORM */ + +void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { + sha2_word32 a, b, c, d, e, f, g, h, s0, s1; + sha2_word32 T1, T2, *W256; + int j; + + W256 = (sha2_word32*)context->buffer; + + /* Initialize registers with the prev. intermediate value */ + a = context->state[0]; + b = context->state[1]; + c = context->state[2]; + d = context->state[3]; + e = context->state[4]; + f = context->state[5]; + g = context->state[6]; + h = context->state[7]; + + j = 0; + do { +#if BYTE_ORDER == LITTLE_ENDIAN + /* Copy data while converting to host byte order */ + REVERSE32(*data++,W256[j]); + /* Apply the SHA-256 compression function to update a..h */ + T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; +#else /* BYTE_ORDER == LITTLE_ENDIAN */ + /* Apply the SHA-256 compression function to update a..h with copy */ + T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++); +#endif /* BYTE_ORDER == LITTLE_ENDIAN */ + T2 = Sigma0_256(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 16); + + do { + /* Part of the message block expansion: */ + s0 = W256[(j+1)&0x0f]; + s0 = sigma0_256(s0); + s1 = W256[(j+14)&0x0f]; + s1 = sigma1_256(s1); + + /* Apply the SHA-256 compression function to update a..h */ + T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + + (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); + T2 = Sigma0_256(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 64); + + /* Compute the current intermediate hash value */ + context->state[0] += a; + context->state[1] += b; + context->state[2] += c; + context->state[3] += d; + context->state[4] += e; + context->state[5] += f; + context->state[6] += g; + context->state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = T2 = 0; +} + +#endif /* SHA2_UNROLL_TRANSFORM */ + +void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { + unsigned int freespace, usedspace; + + if (len == 0) { + /* Calling with no data is valid - we do nothing */ + return; + } + + /* Sanity check: */ + assert(context != (SHA256_CTX*)0 && data != (sha2_byte*)0); + + usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; + if (usedspace > 0) { + /* Calculate how much free space is available in the buffer */ + freespace = SHA256_BLOCK_LENGTH - usedspace; + + if (len >= freespace) { + /* Fill the buffer completely and process it */ + MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); + context->bitcount += freespace << 3; + len -= freespace; + data += freespace; + SHA256_Transform(context, (sha2_word32*)context->buffer); + } else { + /* The buffer is not yet full */ + MEMCPY_BCOPY(&context->buffer[usedspace], data, len); + context->bitcount += len << 3; + /* Clean up: */ + usedspace = freespace = 0; + return; + } + } + while (len >= SHA256_BLOCK_LENGTH) { + /* Process as many complete blocks as we can */ + SHA256_Transform(context, (sha2_word32*)data); + context->bitcount += SHA256_BLOCK_LENGTH << 3; + len -= SHA256_BLOCK_LENGTH; + data += SHA256_BLOCK_LENGTH; + } + if (len > 0) { + /* There's left-overs, so save 'em */ + MEMCPY_BCOPY(context->buffer, data, len); + context->bitcount += len << 3; + } + /* Clean up: */ + usedspace = freespace = 0; +} + +void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { + sha2_word32 *d = (sha2_word32*)digest; + unsigned int usedspace; + + /* Sanity check: */ + assert(context != (SHA256_CTX*)0); + + /* If no digest buffer is passed, we don't bother doing this: */ + if (digest != (sha2_byte*)0) { + usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; +#if BYTE_ORDER == LITTLE_ENDIAN + /* Convert FROM host byte order */ + REVERSE64(context->bitcount,context->bitcount); +#endif + if (usedspace > 0) { + /* Begin padding with a 1 bit: */ + context->buffer[usedspace++] = 0x80; + + if (usedspace <= SHA256_SHORT_BLOCK_LENGTH) { + /* Set-up for the last transform: */ + MEMSET_BZERO(&context->buffer[usedspace], SHA256_SHORT_BLOCK_LENGTH - usedspace); + } else { + if (usedspace < SHA256_BLOCK_LENGTH) { + MEMSET_BZERO(&context->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace); + } + /* Do second-to-last transform: */ + SHA256_Transform(context, (sha2_word32*)context->buffer); + + /* And set-up for the last transform: */ + MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); + } + } else { + /* Set-up for the last transform: */ + MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); + + /* Begin padding with a 1 bit: */ + *context->buffer = 0x80; + } + /* Set the bit count: */ + *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; + + /* Final transform: */ + SHA256_Transform(context, (sha2_word32*)context->buffer); + +#if BYTE_ORDER == LITTLE_ENDIAN + { + /* Convert TO host byte order */ + int j; + for (j = 0; j < 8; j++) { + REVERSE32(context->state[j],context->state[j]); + *d++ = context->state[j]; + } + } +#else + MEMCPY_BCOPY(d, context->state, SHA256_DIGEST_LENGTH); +#endif + } + + /* Clean up state data: */ + MEMSET_BZERO(context, sizeof(context)); + usedspace = 0; +} + +char *SHA256_End(SHA256_CTX* context, char buffer[]) { + sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest; + int i; + + /* Sanity check: */ + assert(context != (SHA256_CTX*)0); + + if (buffer != (char*)0) { + SHA256_Final(digest, context); + + for (i = 0; i < SHA256_DIGEST_LENGTH; i++) { + *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; + *buffer++ = sha2_hex_digits[*d & 0x0f]; + d++; + } + *buffer = (char)0; + } else { + MEMSET_BZERO(context, sizeof(context)); + } + MEMSET_BZERO(digest, SHA256_DIGEST_LENGTH); + return buffer; +} + +char* SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) { + SHA256_CTX context; + + SHA256_Init(&context); + SHA256_Update(&context, data, len); + return SHA256_End(&context, digest); +} + + +/*** SHA-512: *********************************************************/ +void SHA512_Init(SHA512_CTX* context) { + if (context == (SHA512_CTX*)0) { + return; + } + MEMCPY_BCOPY(context->state, sha512_initial_hash_value, SHA512_DIGEST_LENGTH); + MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH); + context->bitcount[0] = context->bitcount[1] = 0; +} + +#ifdef SHA2_UNROLL_TRANSFORM + +/* Unrolled SHA-512 round macros: */ +#if BYTE_ORDER == LITTLE_ENDIAN + +#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ + REVERSE64(*data++, W512[j]); \ + T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ + K512[j] + W512[j]; \ + (d) += T1, \ + (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \ + j++ + + +#else /* BYTE_ORDER == LITTLE_ENDIAN */ + +#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ + T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ + K512[j] + (W512[j] = *data++); \ + (d) += T1; \ + (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ + j++ + +#endif /* BYTE_ORDER == LITTLE_ENDIAN */ + +#define ROUND512(a,b,c,d,e,f,g,h) \ + s0 = W512[(j+1)&0x0f]; \ + s0 = sigma0_512(s0); \ + s1 = W512[(j+14)&0x0f]; \ + s1 = sigma1_512(s1); \ + T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \ + (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \ + (d) += T1; \ + (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ + j++ + +void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { + sha2_word64 a, b, c, d, e, f, g, h, s0, s1; + sha2_word64 T1, *W512 = (sha2_word64*)context->buffer; + int j; + + /* Initialize registers with the prev. intermediate value */ + a = context->state[0]; + b = context->state[1]; + c = context->state[2]; + d = context->state[3]; + e = context->state[4]; + f = context->state[5]; + g = context->state[6]; + h = context->state[7]; + + j = 0; + do { + ROUND512_0_TO_15(a,b,c,d,e,f,g,h); + ROUND512_0_TO_15(h,a,b,c,d,e,f,g); + ROUND512_0_TO_15(g,h,a,b,c,d,e,f); + ROUND512_0_TO_15(f,g,h,a,b,c,d,e); + ROUND512_0_TO_15(e,f,g,h,a,b,c,d); + ROUND512_0_TO_15(d,e,f,g,h,a,b,c); + ROUND512_0_TO_15(c,d,e,f,g,h,a,b); + ROUND512_0_TO_15(b,c,d,e,f,g,h,a); + } while (j < 16); + + /* Now for the remaining rounds up to 79: */ + do { + ROUND512(a,b,c,d,e,f,g,h); + ROUND512(h,a,b,c,d,e,f,g); + ROUND512(g,h,a,b,c,d,e,f); + ROUND512(f,g,h,a,b,c,d,e); + ROUND512(e,f,g,h,a,b,c,d); + ROUND512(d,e,f,g,h,a,b,c); + ROUND512(c,d,e,f,g,h,a,b); + ROUND512(b,c,d,e,f,g,h,a); + } while (j < 80); + + /* Compute the current intermediate hash value */ + context->state[0] += a; + context->state[1] += b; + context->state[2] += c; + context->state[3] += d; + context->state[4] += e; + context->state[5] += f; + context->state[6] += g; + context->state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = 0; +} + +#else /* SHA2_UNROLL_TRANSFORM */ + +void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { + sha2_word64 a, b, c, d, e, f, g, h, s0, s1; + sha2_word64 T1, T2, *W512 = (sha2_word64*)context->buffer; + int j; + + /* Initialize registers with the prev. intermediate value */ + a = context->state[0]; + b = context->state[1]; + c = context->state[2]; + d = context->state[3]; + e = context->state[4]; + f = context->state[5]; + g = context->state[6]; + h = context->state[7]; + + j = 0; + do { +#if BYTE_ORDER == LITTLE_ENDIAN + /* Convert TO host byte order */ + REVERSE64(*data++, W512[j]); + /* Apply the SHA-512 compression function to update a..h */ + T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; +#else /* BYTE_ORDER == LITTLE_ENDIAN */ + /* Apply the SHA-512 compression function to update a..h with copy */ + T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++); +#endif /* BYTE_ORDER == LITTLE_ENDIAN */ + T2 = Sigma0_512(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 16); + + do { + /* Part of the message block expansion: */ + s0 = W512[(j+1)&0x0f]; + s0 = sigma0_512(s0); + s1 = W512[(j+14)&0x0f]; + s1 = sigma1_512(s1); + + /* Apply the SHA-512 compression function to update a..h */ + T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + + (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); + T2 = Sigma0_512(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 80); + + /* Compute the current intermediate hash value */ + context->state[0] += a; + context->state[1] += b; + context->state[2] += c; + context->state[3] += d; + context->state[4] += e; + context->state[5] += f; + context->state[6] += g; + context->state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = T2 = 0; +} + +#endif /* SHA2_UNROLL_TRANSFORM */ + +void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { + unsigned int freespace, usedspace; + + if (len == 0) { + /* Calling with no data is valid - we do nothing */ + return; + } + + /* Sanity check: */ + assert(context != (SHA512_CTX*)0 && data != (sha2_byte*)0); + + usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; + if (usedspace > 0) { + /* Calculate how much free space is available in the buffer */ + freespace = SHA512_BLOCK_LENGTH - usedspace; + + if (len >= freespace) { + /* Fill the buffer completely and process it */ + MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); + ADDINC128(context->bitcount, freespace << 3); + len -= freespace; + data += freespace; + SHA512_Transform(context, (sha2_word64*)context->buffer); + } else { + /* The buffer is not yet full */ + MEMCPY_BCOPY(&context->buffer[usedspace], data, len); + ADDINC128(context->bitcount, len << 3); + /* Clean up: */ + usedspace = freespace = 0; + return; + } + } + while (len >= SHA512_BLOCK_LENGTH) { + /* Process as many complete blocks as we can */ + SHA512_Transform(context, (sha2_word64*)data); + ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3); + len -= SHA512_BLOCK_LENGTH; + data += SHA512_BLOCK_LENGTH; + } + if (len > 0) { + /* There's left-overs, so save 'em */ + MEMCPY_BCOPY(context->buffer, data, len); + ADDINC128(context->bitcount, len << 3); + } + /* Clean up: */ + usedspace = freespace = 0; +} + +void SHA512_Last(SHA512_CTX* context) { + unsigned int usedspace; + + usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; +#if BYTE_ORDER == LITTLE_ENDIAN + /* Convert FROM host byte order */ + REVERSE64(context->bitcount[0],context->bitcount[0]); + REVERSE64(context->bitcount[1],context->bitcount[1]); +#endif + if (usedspace > 0) { + /* Begin padding with a 1 bit: */ + context->buffer[usedspace++] = 0x80; + + if (usedspace <= SHA512_SHORT_BLOCK_LENGTH) { + /* Set-up for the last transform: */ + MEMSET_BZERO(&context->buffer[usedspace], SHA512_SHORT_BLOCK_LENGTH - usedspace); + } else { + if (usedspace < SHA512_BLOCK_LENGTH) { + MEMSET_BZERO(&context->buffer[usedspace], SHA512_BLOCK_LENGTH - usedspace); + } + /* Do second-to-last transform: */ + SHA512_Transform(context, (sha2_word64*)context->buffer); + + /* And set-up for the last transform: */ + MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH - 2); + } + } else { + /* Prepare for final transform: */ + MEMSET_BZERO(context->buffer, SHA512_SHORT_BLOCK_LENGTH); + + /* Begin padding with a 1 bit: */ + *context->buffer = 0x80; + } + /* Store the length of input data (in bits): */ + *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; + *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; + + /* Final transform: */ + SHA512_Transform(context, (sha2_word64*)context->buffer); +} + +void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { + sha2_word64 *d = (sha2_word64*)digest; + + /* Sanity check: */ + assert(context != (SHA512_CTX*)0); + + /* If no digest buffer is passed, we don't bother doing this: */ + if (digest != (sha2_byte*)0) { + SHA512_Last(context); + + /* Save the hash data for output: */ +#if BYTE_ORDER == LITTLE_ENDIAN + { + /* Convert TO host byte order */ + int j; + for (j = 0; j < 8; j++) { + REVERSE64(context->state[j],context->state[j]); + *d++ = context->state[j]; + } + } +#else + MEMCPY_BCOPY(d, context->state, SHA512_DIGEST_LENGTH); +#endif + } + + /* Zero out state data */ + MEMSET_BZERO(context, sizeof(context)); +} + +char *SHA512_End(SHA512_CTX* context, char buffer[]) { + sha2_byte digest[SHA512_DIGEST_LENGTH], *d = digest; + int i; + + /* Sanity check: */ + assert(context != (SHA512_CTX*)0); + + if (buffer != (char*)0) { + SHA512_Final(digest, context); + + for (i = 0; i < SHA512_DIGEST_LENGTH; i++) { + *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; + *buffer++ = sha2_hex_digits[*d & 0x0f]; + d++; + } + *buffer = (char)0; + } else { + MEMSET_BZERO(context, sizeof(context)); + } + MEMSET_BZERO(digest, SHA512_DIGEST_LENGTH); + return buffer; +} + +char* SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) { + SHA512_CTX context; + + SHA512_Init(&context); + SHA512_Update(&context, data, len); + return SHA512_End(&context, digest); +} + + +/*** SHA-384: *********************************************************/ +void SHA384_Init(SHA384_CTX* context) { + if (context == (SHA384_CTX*)0) { + return; + } + MEMCPY_BCOPY(context->state, sha384_initial_hash_value, SHA512_DIGEST_LENGTH); + MEMSET_BZERO(context->buffer, SHA384_BLOCK_LENGTH); + context->bitcount[0] = context->bitcount[1] = 0; +} + +void SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) { + SHA512_Update((SHA512_CTX*)context, data, len); +} + +void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { + sha2_word64 *d = (sha2_word64*)digest; + + /* Sanity check: */ + assert(context != (SHA384_CTX*)0); + + /* If no digest buffer is passed, we don't bother doing this: */ + if (digest != (sha2_byte*)0) { + SHA512_Last((SHA512_CTX*)context); + + /* Save the hash data for output: */ +#if BYTE_ORDER == LITTLE_ENDIAN + { + /* Convert TO host byte order */ + int j; + for (j = 0; j < 6; j++) { + REVERSE64(context->state[j],context->state[j]); + *d++ = context->state[j]; + } + } +#else + MEMCPY_BCOPY(d, context->state, SHA384_DIGEST_LENGTH); +#endif + } + + /* Zero out state data */ + MEMSET_BZERO(context, sizeof(context)); +} + +char *SHA384_End(SHA384_CTX* context, char buffer[]) { + sha2_byte digest[SHA384_DIGEST_LENGTH], *d = digest; + int i; + + /* Sanity check: */ + assert(context != (SHA384_CTX*)0); + + if (buffer != (char*)0) { + SHA384_Final(digest, context); + + for (i = 0; i < SHA384_DIGEST_LENGTH; i++) { + *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; + *buffer++ = sha2_hex_digits[*d & 0x0f]; + d++; + } + *buffer = (char)0; + } else { + MEMSET_BZERO(context, sizeof(context)); + } + MEMSET_BZERO(digest, SHA384_DIGEST_LENGTH); + return buffer; +} + +char* SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) { + SHA384_CTX context; + + SHA384_Init(&context); + SHA384_Update(&context, data, len); + return SHA384_End(&context, digest); +} + diff --git a/random/unix/sha2.h b/random/unix/sha2.h new file mode 100644 index 00000000000..941cb22424c --- /dev/null +++ b/random/unix/sha2.h @@ -0,0 +1,197 @@ +/* + * FILE: sha2.h + * AUTHOR: Aaron D. Gifford + * + * Copyright (c) 2000-2001, Aaron D. Gifford + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id: sha2.h,v 1.1 2003/11/03 13:25:00 ben Exp $ + */ + +#ifndef __SHA2_H__ +#define __SHA2_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* + * Import u_intXX_t size_t type definitions from system headers. You + * may need to change this, or define these things yourself in this + * file. + */ +#include + +#ifdef SHA2_USE_INTTYPES_H + +#include + +#endif /* SHA2_USE_INTTYPES_H */ + + +/*** SHA-256/384/512 Various Length Definitions ***********************/ +#define SHA256_BLOCK_LENGTH 64 +#define SHA256_DIGEST_LENGTH 32 +#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) +#define SHA384_BLOCK_LENGTH 128 +#define SHA384_DIGEST_LENGTH 48 +#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) +#define SHA512_BLOCK_LENGTH 128 +#define SHA512_DIGEST_LENGTH 64 +#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) + + +/*** SHA-256/384/512 Context Structures *******************************/ +/* NOTE: If your architecture does not define either u_intXX_t types or + * uintXX_t (from inttypes.h), you may need to define things by hand + * for your system: + */ +#if 0 +typedef unsigned char u_int8_t; /* 1-byte (8-bits) */ +typedef unsigned int u_int32_t; /* 4-bytes (32-bits) */ +typedef unsigned long long u_int64_t; /* 8-bytes (64-bits) */ +#endif +/* + * Most BSD systems already define u_intXX_t types, as does Linux. + * Some systems, however, like Compaq's Tru64 Unix instead can use + * uintXX_t types defined by very recent ANSI C standards and included + * in the file: + * + * #include + * + * If you choose to use then please define: + * + * #define SHA2_USE_INTTYPES_H + * + * Or on the command line during compile: + * + * cc -DSHA2_USE_INTTYPES_H ... + */ +#ifdef SHA2_USE_INTTYPES_H + +typedef struct _SHA256_CTX { + uint32_t state[8]; + uint64_t bitcount; + uint8_t buffer[SHA256_BLOCK_LENGTH]; +} SHA256_CTX; +typedef struct _SHA512_CTX { + uint64_t state[8]; + uint64_t bitcount[2]; + uint8_t buffer[SHA512_BLOCK_LENGTH]; +} SHA512_CTX; + +#else /* SHA2_USE_INTTYPES_H */ + +typedef struct _SHA256_CTX { + u_int32_t state[8]; + u_int64_t bitcount; + u_int8_t buffer[SHA256_BLOCK_LENGTH]; +} SHA256_CTX; +typedef struct _SHA512_CTX { + u_int64_t state[8]; + u_int64_t bitcount[2]; + u_int8_t buffer[SHA512_BLOCK_LENGTH]; +} SHA512_CTX; + +#endif /* SHA2_USE_INTTYPES_H */ + +typedef SHA512_CTX SHA384_CTX; + + +/*** SHA-256/384/512 Function Prototypes ******************************/ +#ifndef NOPROTO +#ifdef SHA2_USE_INTTYPES_H + +void SHA256_Init(SHA256_CTX *); +void SHA256_Update(SHA256_CTX*, const uint8_t*, size_t); +void SHA256_Final(uint8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*); +char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]); +char* SHA256_Data(const uint8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]); + +void SHA384_Init(SHA384_CTX*); +void SHA384_Update(SHA384_CTX*, const uint8_t*, size_t); +void SHA384_Final(uint8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*); +char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]); +char* SHA384_Data(const uint8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]); + +void SHA512_Init(SHA512_CTX*); +void SHA512_Update(SHA512_CTX*, const uint8_t*, size_t); +void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*); +char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]); +char* SHA512_Data(const uint8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]); + +#else /* SHA2_USE_INTTYPES_H */ + +void SHA256_Init(SHA256_CTX *); +void SHA256_Update(SHA256_CTX*, const u_int8_t*, size_t); +void SHA256_Final(u_int8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*); +char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]); +char* SHA256_Data(const u_int8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]); + +void SHA384_Init(SHA384_CTX*); +void SHA384_Update(SHA384_CTX*, const u_int8_t*, size_t); +void SHA384_Final(u_int8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*); +char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]); +char* SHA384_Data(const u_int8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]); + +void SHA512_Init(SHA512_CTX*); +void SHA512_Update(SHA512_CTX*, const u_int8_t*, size_t); +void SHA512_Final(u_int8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*); +char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]); +char* SHA512_Data(const u_int8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]); + +#endif /* SHA2_USE_INTTYPES_H */ + +#else /* NOPROTO */ + +void SHA256_Init(); +void SHA256_Update(); +void SHA256_Final(); +char* SHA256_End(); +char* SHA256_Data(); + +void SHA384_Init(); +void SHA384_Update(); +void SHA384_Final(); +char* SHA384_End(); +char* SHA384_Data(); + +void SHA512_Init(); +void SHA512_Update(); +void SHA512_Final(); +char* SHA512_End(); +char* SHA512_Data(); + +#endif /* NOPROTO */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __SHA2_H__ */ + diff --git a/random/unix/sha2_glue.c b/random/unix/sha2_glue.c new file mode 100644 index 00000000000..8029f8f8426 --- /dev/null +++ b/random/unix/sha2_glue.c @@ -0,0 +1,33 @@ +#include +#include +#include +#include "sha2.h" + +static void sha256_init(apr_crypto_hash_t *h) + { + SHA256_Init(h->data); + } + +static void sha256_add(apr_crypto_hash_t *h,const void *data, + apr_size_t bytes) + { + SHA256_Update(h->data,data,bytes); + } + +static void sha256_finish(apr_crypto_hash_t *h,unsigned char *result) + { + SHA256_Final(result,h->data); + } + +apr_crypto_hash_t *apr_crypto_sha256_new(apr_pool_t *p) + { + apr_crypto_hash_t *h=apr_palloc(p,sizeof *h); + + h->data=apr_palloc(p,sizeof(SHA256_CTX)); + h->init=sha256_init; + h->add=sha256_add; + h->finish=sha256_finish; + h->size=256/8; + + return h; + } diff --git a/test/Makefile.in b/test/Makefile.in index 463ac13955e..086917ab5f5 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -115,7 +115,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ - testenv.lo testprocmutex.lo + testenv.lo testprocmutex.lo testrand2.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/test_apr.h b/test/test_apr.h index b378d0cbc1b..2af2e1c6353 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -81,6 +81,7 @@ CuSuite *testfile(void); CuSuite *testdir(void); CuSuite *testfileinfo(void); CuSuite *testrand(void); +CuSuite *testrand2(void); CuSuite *testdso(void); CuSuite *testoc(void); CuSuite *testdup(void); diff --git a/test/testall.c b/test/testall.c index 169188d9eff..5b4cc50b8a6 100644 --- a/test/testall.c +++ b/test/testall.c @@ -95,6 +95,7 @@ static const struct testlist { {"testdup", testdup}, {"testdir", testdir}, {"testrand", testrand}, + {"testrand2", testrand2}, {"testdso", testdso}, {"testoc", testoc}, {"testsockets", testsockets}, diff --git a/test/testrand2.c b/test/testrand2.c new file mode 100644 index 00000000000..32431be6dd7 --- /dev/null +++ b/test/testrand2.c @@ -0,0 +1,250 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr_general.h" +#include "apr_random.h" +#include +#include +#include +#include "test_apr.h" + +static void hexdump(const unsigned char *b,int n) + { + int i; + + for(i=0 ; i < n ; ++i) + { +#if 0 + if((i&0xf) == 0) + printf("%04x",i); + printf(" %02x",b[i]); + if((i&0xf) == 0xf) + printf("\n"); +#else + printf("0x%02x,",b[i]); + if((i&7) == 7) + printf("\n"); +#endif + } + printf("\n"); + } + +static apr_random_t *r; + +typedef apr_status_t rnd_fn(apr_random_t *r,void *b,apr_size_t n); + +static void rand_run_kat(CuTest *tc,rnd_fn *f,apr_random_t *r, + const unsigned char expected[128]) + { + unsigned char c[128]; + apr_status_t rv; + + rv=f(r,c,128); + CuAssertIntEquals(tc,0,rv); + if(rv) + return; + if(memcmp(c,expected,128)) + { + hexdump(c,128); + hexdump(expected,128); + CuFail(tc,"Randomness mismatch"); + } + } + +static void rand_add_zeroes(apr_random_t *r) + { + static unsigned char c[2048]; + + apr_random_add_entropy(r,c,sizeof c); + } + +static void rand_run_seed_short(CuTest *tc,rnd_fn *f,apr_random_t *r, + int count) + { + int i; + apr_status_t rv; + char c[1]; + + for(i=0 ; i < count ; ++i) + rand_add_zeroes(r); + rv=f(r,c,1); + CuAssertIntEquals(tc,rv,APR_ENOTENOUGHENTROPY); + } + +static void rand_seed_short(CuTest *tc) + { + r=apr_random_standard_new(p); + rand_run_seed_short(tc,apr_random_insecure_bytes,r,32); + } + +static void rand_kat(CuTest *tc) + { + unsigned char expected[128]= + { 0x82,0x04,0xad,0xd2,0x0b,0xd5,0xac,0xda, + 0x3d,0x85,0x58,0x38,0x54,0x6b,0x69,0x45, + 0x37,0x4c,0xc7,0xd7,0x87,0xeb,0xbf,0xd9, + 0xb1,0xb8,0xb8,0x2d,0x9b,0x33,0x6e,0x97, + 0x04,0x1d,0x4c,0xb0,0xd1,0xdf,0x3d,0xac, + 0xd2,0xaa,0xfa,0xcd,0x96,0xb7,0xcf,0xb1, + 0x8e,0x3d,0xb3,0xe5,0x37,0xa9,0x95,0xb4, + 0xaa,0x3d,0x11,0x1a,0x08,0x20,0x21,0x9f, + 0xdb,0x08,0x3a,0xb9,0x57,0x9f,0xf2,0x1f, + 0x27,0xdc,0xb6,0xc0,0x85,0x08,0x05,0xbb, + 0x13,0xbe,0xb1,0xe9,0x63,0x2a,0xe2,0xa4, + 0x23,0x15,0x2a,0x10,0xbf,0xdf,0x09,0xb3, + 0xc7,0xfb,0x2d,0x87,0x48,0x19,0xfb,0xc0, + 0x15,0x8c,0xcb,0xc6,0xbd,0x89,0x38,0x69, + 0xa3,0xae,0xa3,0x21,0x58,0x50,0xe7,0xc4, + 0x87,0xec,0x2e,0xb1,0x2d,0x6a,0xbd,0x46 }; + + rand_add_zeroes(r); + rand_run_kat(tc,apr_random_insecure_bytes,r,expected); + } + +static void rand_seed_short2(CuTest *tc) + { + rand_run_seed_short(tc,apr_random_secure_bytes,r,320); + } + +static void rand_kat2(CuTest *tc) + { + unsigned char expected[128]= + { 0x38,0x8f,0x01,0x29,0x5a,0x5c,0x1f,0xa8, + 0x00,0xde,0x16,0x4c,0xe5,0xf7,0x1f,0x58, + 0xc0,0x67,0xe2,0x98,0x3d,0xde,0x4a,0x75, + 0x61,0x3f,0x23,0xd8,0x45,0x7a,0x10,0x60, + 0x59,0x9b,0xd6,0xaf,0xcb,0x0a,0x2e,0x34, + 0x9c,0x39,0x5b,0xd0,0xbc,0x9a,0xf0,0x7b, + 0x7f,0x40,0x8b,0x33,0xc0,0x0e,0x2a,0x56, + 0xfc,0xe5,0xab,0xde,0x7b,0x13,0xf5,0xec, + 0x15,0x68,0xb8,0x09,0xbc,0x2c,0x15,0xf0, + 0x7b,0xef,0x2a,0x97,0x19,0xa8,0x69,0x51, + 0xdf,0xb0,0x5f,0x1a,0x4e,0xdf,0x42,0x02, + 0x71,0x36,0xa7,0x25,0x64,0x85,0xe2,0x72, + 0xc7,0x87,0x4d,0x7d,0x15,0xbb,0x15,0xd1, + 0xb1,0x62,0x0b,0x25,0xd9,0xd3,0xd9,0x5a, + 0xe3,0x47,0x1e,0xae,0x67,0xb4,0x19,0x9e, + 0xed,0xd2,0xde,0xce,0x18,0x70,0x57,0x12 }; + + rand_add_zeroes(r); + rand_run_kat(tc,apr_random_secure_bytes,r,expected); + } + +static void rand_barrier(CuTest *tc) + { + apr_random_barrier(r); + rand_run_seed_short(tc,apr_random_secure_bytes,r,320); + } + +static void rand_kat3(CuTest *tc) + { + unsigned char expected[128]= + { 0xe8,0xe7,0xc9,0x45,0xe2,0x2a,0x54,0xb2, + 0xdd,0xe0,0xf9,0xbc,0x3d,0xf9,0xce,0x3c, + 0x4c,0xbd,0xc9,0xe2,0x20,0x4a,0x35,0x1c, + 0x04,0x52,0x7f,0xb8,0x0f,0x60,0x89,0x63, + 0x8a,0xbe,0x0a,0x44,0xac,0x5d,0xd8,0xeb, + 0x24,0x7d,0xd1,0xda,0x4d,0x86,0x9b,0x94, + 0x26,0x56,0x4a,0x5e,0x30,0xea,0xd4,0xa9, + 0x9a,0xdf,0xdd,0xb6,0xb1,0x15,0xe0,0xfa, + 0x28,0xa4,0xd6,0x95,0xa4,0xf1,0xd8,0x6e, + 0xeb,0x8c,0xa4,0xac,0x34,0xfe,0x06,0x92, + 0xc5,0x09,0x99,0x86,0xdc,0x5a,0x3c,0x92, + 0xc8,0x3e,0x52,0x00,0x4d,0x01,0x43,0x6f, + 0x69,0xcf,0xe2,0x60,0x9c,0x23,0xb3,0xa5, + 0x5f,0x51,0x47,0x8c,0x07,0xde,0x60,0xc6, + 0x04,0xbf,0x32,0xd6,0xdc,0xb7,0x31,0x01, + 0x29,0x51,0x51,0xb3,0x19,0x6e,0xe4,0xf8 }; + + rand_run_kat(tc,apr_random_insecure_bytes,r,expected); + } + +static void rand_kat4(CuTest *tc) + { + unsigned char expected[128]= + { 0x7d,0x0e,0xc4,0x4e,0x3e,0xac,0x86,0x50, + 0x37,0x95,0x7a,0x98,0x23,0x26,0xa7,0xbf, + 0x60,0xfb,0xa3,0x70,0x90,0xc3,0x58,0xc6, + 0xbd,0xd9,0x5e,0xa6,0x77,0x62,0x7a,0x5c, + 0x96,0x83,0x7f,0x80,0x3d,0xf4,0x9c,0xcc, + 0x9b,0x0c,0x8c,0xe1,0x72,0xa8,0xfb,0xc9, + 0xc5,0x43,0x91,0xdc,0x9d,0x92,0xc2,0xce, + 0x1c,0x5e,0x36,0xc7,0x87,0xb1,0xb4,0xa3, + 0xc8,0x69,0x76,0xfc,0x35,0x75,0xcb,0x08, + 0x2f,0xe3,0x98,0x76,0x37,0x80,0x04,0x5c, + 0xb8,0xb0,0x7f,0xb2,0xda,0xe3,0xa3,0xba, + 0xed,0xff,0xf5,0x9d,0x3b,0x7b,0xf3,0x32, + 0x6c,0x50,0xa5,0x3e,0xcc,0xe1,0x84,0x9c, + 0x17,0x9e,0x80,0x64,0x09,0xbb,0x62,0xf1, + 0x95,0xf5,0x2c,0xc6,0x9f,0x6a,0xee,0x6d, + 0x17,0x35,0x5f,0x35,0x8d,0x55,0x0c,0x07 }; + + rand_add_zeroes(r); + rand_run_kat(tc,apr_random_secure_bytes,r,expected); + } + +CuSuite *testrand2(void) + { + CuSuite *suite = CuSuiteNew("Random2"); + + SUITE_ADD_TEST(suite, rand_seed_short); + SUITE_ADD_TEST(suite, rand_kat); + SUITE_ADD_TEST(suite, rand_seed_short2); + SUITE_ADD_TEST(suite, rand_kat2); + SUITE_ADD_TEST(suite, rand_barrier); + SUITE_ADD_TEST(suite, rand_kat3); + SUITE_ADD_TEST(suite, rand_kat4); + + return suite; + } From d29df3a03f012811fe46278f8fc668bac7ec6613 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 3 Nov 2003 13:42:10 +0000 Subject: [PATCH 4666/7878] Change the FreeBSD i386 atomics to use the asm routines in the apr_atomic header file. This was tesetd on 4.8 and reported as also working for -CURRENT and 5.1 by Paul Querna. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64713 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_atomic.h | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 0265cac9099..4d623e924ef 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR 1.0 + *) Change i386 FreeBSD to use the asm routines in apr_atomic.h + to overcome issues with the FreeBSD atomic functions return + type on i386. [David Reid] + *) Add a new PRNG. Note that the implementation of SHA-256 is a stop-gap pending snarfing the SHA-1 implementation from apr-util and upgrading it to do SHA-256. Not yet ready for prime time. diff --git a/include/apr_atomic.h b/include/apr_atomic.h index d8944827cfe..d575b54473d 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -70,7 +70,7 @@ /* Platform includes for atomics */ #if defined(NETWARE) || defined(__MVS__) /* OS/390 */ #include -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) && !defined(__i386__) #include #endif @@ -325,7 +325,7 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) #define APR_OVERRIDE_ATOMIC_DEC 1 #define APR_OVERRIDE_ATOMIC_CAS 1 -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) && !defined(__i386__) #define apr_atomic_t apr_uint32_t #define apr_atomic_add(mem, val) atomic_add_int(mem,val) @@ -337,10 +337,11 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) #define apr_atomic_add32(mem, val) apr_atomic_add(mem, val) #define apr_atomic_dec32(mem) apr_atomic_dec(mem) #define apr_atomic_inc32(mem) apr_atomic_inc(mem) -#define apr_atomic_set32(mem,val) apr_atomic_set(mem,val) +#define apr_atomic_set32(mem, val) apr_atomic_set(mem, val) #define apr_atomic_read32(mem) apr_atomic_read(mem) -#elif (defined(__linux__) || defined(__EMX__)) && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC +#elif (defined(__linux__) || defined(__EMX__) || defined(__FreeBSD__)) \ + && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC #define apr_atomic_t apr_uint32_t #define apr_atomic_cas(mem,with,cmp) \ From fb98340c7a1172206757af0a4372bfe297139c10 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Mon, 3 Nov 2003 15:44:41 +0000 Subject: [PATCH 4667/7878] Document apr_proc_fork()'s return values. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64714 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 1995b377fd0..12501dddd0f 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -538,6 +538,8 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, * a standard unix fork. * @param proc The resulting process handle. * @param cont The pool to use. + * @remark returns APR_INCHILD for the child, and APR_INPARENT for the parent + * or an error. */ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont); #endif From 4bc94ba06b0065c80276d33aa1119458045009f9 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Mon, 3 Nov 2003 17:00:15 +0000 Subject: [PATCH 4668/7878] Fix child_cleanup docco. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64715 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 350660d9540..52e204c38f6 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -523,8 +523,8 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, * @param data The data to pass to the cleanup function. * @param plain_cleanup The function to call when the pool is cleared * or destroyed - * @param child_cleanup The function to call when a child process is being - * shutdown - this function is called in the child, obviously! + * @param child_cleanup The function to call when a child process is about + * to exec - this function is called in the child, obviously! */ APR_DECLARE(void) apr_pool_cleanup_register( apr_pool_t *p, From f46c1a995af95f7d8751bba74e07cd4d0afd9b21 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Mon, 3 Nov 2003 17:50:37 +0000 Subject: [PATCH 4669/7878] Make sure randomness is different after a fork. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64716 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_random.h | 13 +++++++ random/unix/apr_random.c | 47 ++++++++++++++++++++++- test/testrand2.c | 83 ++++++++++++++++++++++++++++++++++++++++ threadproc/unix/proc.c | 3 ++ 4 files changed, 144 insertions(+), 2 deletions(-) diff --git a/include/apr_random.h b/include/apr_random.h index b9424f73a4f..102d909a0ed 100644 --- a/include/apr_random.h +++ b/include/apr_random.h @@ -93,4 +93,17 @@ void apr_random_barrier(apr_random_t *g); apr_status_t apr_random_secure_ready(apr_random_t *r); apr_status_t apr_random_insecure_ready(apr_random_t *r); +/* Call this in the child after forking to mix the randomness + pools. Note that its generally a bad idea to fork a process with a + real PRNG in it - better to have the PRNG externally and get the + randomness from there. However, if you really must do it, then you + should supply all your entropy to all the PRNGs - don't worry, they + won't produce the same output. + + Note that apr_proc_fork() calls this for you, so only weird + applications need ever call it themselves. +*/ +struct apr_proc_t; +void apr_random_after_fork(struct apr_proc_t *proc); + #endif /* ndef APR_RANDOM_H */ diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c index d62177b1024..06762804bda 100644 --- a/random/unix/apr_random.c +++ b/random/unix/apr_random.c @@ -58,6 +58,7 @@ #include "apr.h" #include "apr_pools.h" #include "apr_random.h" +#include "apr_thread_proc.h" #include #define min(a,b) ((a) < (b) ? (a) : (b)) @@ -99,9 +100,13 @@ struct apr_random_t #define K_size(g) ((g)->key_hash->size) apr_crypto_hash_t *prng_hash; #define B_size(g) ((g)->prng_hash->size) + unsigned char *H; unsigned char *H_waiting; #define H_size(g) (B_size(g)+K_size(g)) +#define H_current(g) (((g)->insecure_started && !(g)->secure_started) \ + ? (g)->H_waiting : (g)->H) + unsigned char *randomness; apr_size_t random_bytes; unsigned int g_for_insecure; @@ -109,8 +114,12 @@ struct apr_random_t unsigned int secure_base; unsigned char insecure_started:1; unsigned char secure_started:1; + + apr_random_t *next; }; +static apr_random_t *all_random; + void apr_random_init(apr_random_t *g,apr_pool_t *p, apr_crypto_hash_t *pool_hash,apr_crypto_hash_t *key_hash, apr_crypto_hash_t *prng_hash) @@ -145,6 +154,41 @@ void apr_random_init(apr_random_t *g,apr_pool_t *p, g->secure_base=0; g->g_for_secure=APR_RANDOM_DEFAULT_G_FOR_SECURE; g->secure_started=g->insecure_started=0; + + g->next=all_random; + all_random=g; + } + +static void mix_pid(apr_random_t *g,unsigned char *H,pid_t pid) + { + hash_init(g->key_hash); + hash_add(g->key_hash,H,H_size(g)); + hash_add(g->key_hash,&pid,sizeof pid); + hash_finish(g->key_hash,H); + } + +static void mixer(apr_random_t *g,pid_t pid) + { + unsigned char *H=H_current(g); + + /* mix the PID into the current H */ + mix_pid(g,H,pid); + /* if we are in waiting, then also mix into main H */ + if(H != g->H) + mix_pid(g,g->H,pid); + /* change order of pool mixing for good measure - note that going + backwards is much better than going forwards */ + --g->generation; + /* blow away any lingering randomness */ + g->random_bytes=0; + } + +void apr_random_after_fork(apr_proc_t *proc) + { + apr_random_t *r; + + for(r=all_random ; r ; r=r->next) + mixer(r,proc->pid); } apr_random_t *apr_random_standard_new(apr_pool_t *p) @@ -159,8 +203,7 @@ apr_random_t *apr_random_standard_new(apr_pool_t *p) static void rekey(apr_random_t *g) { int n; - unsigned char *H=(g->insecure_started && !g->secure_started) ? g->H_waiting - : g->H; + unsigned char *H=H_current(g); hash_init(g->key_hash); hash_add(g->key_hash,H,H_size(g)); diff --git a/test/testrand2.c b/test/testrand2.c index 32431be6dd7..afa53b9c84f 100644 --- a/test/testrand2.c +++ b/test/testrand2.c @@ -54,6 +54,7 @@ #include "apr_general.h" #include "apr_random.h" +#include "apr_thread_proc.h" #include #include #include @@ -102,6 +103,20 @@ static void rand_run_kat(CuTest *tc,rnd_fn *f,apr_random_t *r, } } +static int rand_check_kat(rnd_fn *f,apr_random_t *r, + const unsigned char expected[128]) + { + unsigned char c[128]; + apr_status_t rv; + + rv=f(r,c,128); + if(rv) + return 2; + if(memcmp(c,expected,128)) + return 1; + return 0; + } + static void rand_add_zeroes(apr_random_t *r) { static unsigned char c[2048]; @@ -234,6 +249,73 @@ static void rand_kat4(CuTest *tc) rand_run_kat(tc,apr_random_secure_bytes,r,expected); } +static void rand_fork(CuTest *tc) + { + apr_proc_t proc; + apr_status_t rv; + unsigned char expected[128]= + { 0xac,0x93,0xd2,0x5c,0xc7,0xf5,0x8d,0xc2, + 0xd8,0x8d,0xb6,0x7a,0x94,0xe1,0x83,0x4c, + 0x26,0xe2,0x38,0x6d,0xf5,0xbd,0x9d,0x6e, + 0x91,0x77,0x3a,0x4b,0x9b,0xef,0x9b,0xa3, + 0x9f,0xf6,0x6d,0x0c,0xdc,0x4b,0x02,0xe9, + 0x5d,0x3d,0xfc,0x92,0x6b,0xdf,0xc9,0xef, + 0xb9,0xa8,0x74,0x09,0xa3,0xff,0x64,0x8d, + 0x19,0xc1,0x31,0x31,0x17,0xe1,0xb7,0x7a, + 0xe7,0x55,0x14,0x92,0x05,0xe3,0x1e,0xb8, + 0x9b,0x1b,0xdc,0xac,0x0e,0x15,0x08,0xa2, + 0x93,0x13,0xf6,0x04,0xc6,0x9d,0xf8,0x7f, + 0x26,0x32,0x68,0x43,0x2e,0x5a,0x4f,0x47, + 0xe8,0xf8,0x59,0xb7,0xfb,0xbe,0x30,0x04, + 0xb6,0x63,0x6f,0x19,0xf3,0x2c,0xd4,0xeb, + 0x32,0x8a,0x54,0x01,0xd0,0xaf,0x3f,0x13, + 0xc1,0x7f,0x10,0x2e,0x08,0x1c,0x28,0x4b, }; + + rv=apr_proc_fork(&proc,p); + if(rv == APR_INCHILD) + { + int n; + + n=rand_check_kat(apr_random_secure_bytes,r,expected); + + exit(n); + } + else if(rv == APR_INPARENT) + { + int exitcode; + apr_exit_why_e why; + + rand_run_kat(tc,apr_random_secure_bytes,r,expected); + apr_proc_wait(&proc,&exitcode,&why,APR_WAIT); + if(why != APR_PROC_EXIT) + { + CuFail(tc,"Child terminated abnormally"); + return; + } + if(exitcode == 0) + { + CuFail(tc,"Child produced our randomness"); + return; + } + else if(exitcode == 2) + { + CuFail(tc,"Child randomness failed"); + return; + } + else if(exitcode != 1) + { + CuFail(tc,"Uknown child error"); + return; + } + } + else + { + CuFail(tc,"Fork failed"); + return; + } + } + + CuSuite *testrand2(void) { CuSuite *suite = CuSuiteNew("Random2"); @@ -245,6 +327,7 @@ CuSuite *testrand2(void) SUITE_ADD_TEST(suite, rand_barrier); SUITE_ADD_TEST(suite, rand_kat3); SUITE_ADD_TEST(suite, rand_kat4); + SUITE_ADD_TEST(suite, rand_fork); return suite; } diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index ecfeddea3da..e5fa9a0d1b7 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -56,6 +56,7 @@ #include "apr_strings.h" #include "apr_portable.h" #include "apr_signal.h" +#include "apr_random.h" APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *pool) @@ -232,6 +233,8 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) proc->out = NULL; proc->err = NULL; + apr_random_after_fork(proc); + return APR_INCHILD; } From 61041ac34541de28bcc9502474888383c349ad1d Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 3 Nov 2003 18:16:50 +0000 Subject: [PATCH 4670/7878] Suggested by: Joe Orton * file_io/unix/tempdir.c (apr_temp_dir_get): Axe caching. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64717 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/tempdir.c | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/file_io/unix/tempdir.c b/file_io/unix/tempdir.c index 49b3c2e5b25..8de5961ed79 100644 --- a/file_io/unix/tempdir.c +++ b/file_io/unix/tempdir.c @@ -56,13 +56,6 @@ #include "apr_strings.h" #include "apr_env.h" -/* - * FIXME - * Currently, this variable is a bit of misnomer. - * The intention is to have this in APR's global pool so that we don't have - * to go through this every time. - */ -static char global_temp_dir[APR_PATH_MAX+1] = { 0 }; /* Try to open a temporary file in the temporary dir, write to it, and then close it. */ @@ -88,13 +81,10 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, apr_status_t apr_err; const char *try_dirs[] = { "/tmp", "/usr/tmp", "/var/tmp" }; const char *try_envs[] = { "TMP", "TEMP", "TMPDIR" }; + const char *dir; char *cwd; int i; - /* If we have a cached temp dir, use it. */ - if (global_temp_dir[0]) - goto end; - /* Our goal is to find a temporary directory suitable for writing into. We'll only pay the price once if we're successful -- we cache our successful find. Here's the order in which we'll try @@ -121,7 +111,7 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, if ((apr_err == APR_SUCCESS) && value) { apr_size_t len = strlen(value); if (len && (len < APR_PATH_MAX) && test_tempdir(value, p)) { - memcpy(global_temp_dir, value, len + 1); + dir = value; goto end; } } @@ -130,14 +120,14 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, #ifdef WIN32 /* Next, on Win32, try the C:\TEMP directory. */ if (test_tempdir("C:\\TEMP", p)) { - memcpy(global_temp_dir, "C:\\TEMP", 7 + 1); + dir = "C:\\TEMP"; goto end; } #endif #ifdef NETWARE /* Next, on NetWare, try the SYS:/TMP directory. */ if (test_tempdir("SYS:/TMP", p)) { - memcpy(global_temp_dir, "SYS:/TMP", 8 + 1); + dir = "SYS:/TMP"; goto end; } #endif @@ -145,7 +135,7 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, /* Next, try a set of hard-coded paths. */ for (i = 0; i < (sizeof(try_dirs) / sizeof(const char *)); i++) { if (test_tempdir(try_dirs[i], p)) { - memcpy(global_temp_dir, try_dirs[i], strlen(try_dirs[i]) + 1); + dir = try_dirs[i]; goto end; } } @@ -156,7 +146,7 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, * the tmpdir should be */ if (test_tempdir(P_tmpdir, p)) { - memcpy(global_temp_dir, P_tmpdir, strlen(P_tmpdir) +1); + dir = P_tmpdir; goto end; } #endif @@ -164,16 +154,15 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, /* Finally, try the current working directory. */ if (APR_SUCCESS == apr_filepath_get(&cwd, APR_FILEPATH_NATIVE, p)) { if (test_tempdir(cwd, p)) { - /* Don't cache if the selected temp dir is the cwd */ - *temp_dir = apr_pstrdup(p, cwd); - return APR_SUCCESS; + dir = cwd; + goto end; } } -end: - if (global_temp_dir[0]) { - *temp_dir = apr_pstrdup(p, global_temp_dir); - return APR_SUCCESS; - } + /* We didn't find a suitable temp dir anywhere */ return APR_EGENERAL; + +end: + *temp_dir = apr_pstrdup(p, dir); + return APR_SUCCESS; } From 35c10bb5e114f6b962df6b03edf844f9c549d86b Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Tue, 4 Nov 2003 01:36:59 +0000 Subject: [PATCH 4671/7878] Fix the Win32 build. * include/arch/win32/apr_arch_networkio.h (apr_set_option): Act on sockets, not masks. Analogous to rev 1.5 of the Unix version. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64718 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_networkio.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/arch/win32/apr_arch_networkio.h b/include/arch/win32/apr_arch_networkio.h index d2b7d9417b8..2897e0d1782 100644 --- a/include/arch/win32/apr_arch_networkio.h +++ b/include/arch/win32/apr_arch_networkio.h @@ -101,12 +101,12 @@ void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); #define apr_is_option_set(skt, option) \ (((skt)->options & (option)) == (option)) -#define apr_set_option(mask, option, on) \ +#define apr_set_option(skt, option, on) \ do { \ if (on) \ - *(mask) |= (option); \ + (skt)->options |= (option); \ else \ - *(mask) &= ~(option); \ + (skt)->options &= ~(option); \ } while (0) #endif /* ! NETWORK_IO_H */ From 6f5a03f051e93682666968860d19366465abf469 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 4 Nov 2003 10:02:01 +0000 Subject: [PATCH 4672/7878] * configure.in: Don't build the "random" directory yet. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64719 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 44b8ec9379e..6846570afc5 100644 --- a/configure.in +++ b/configure.in @@ -100,7 +100,7 @@ dnl These added to allow default directories to be used... DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" -apr_modules="file_io network_io threadproc misc locks time mmap shmem user memory atomic poll support random" +apr_modules="file_io network_io threadproc misc locks time mmap shmem user memory atomic poll support" dnl Checks for programs. AC_PROG_MAKE_SET From f90a14782f8f14838afc9c029ee94c6fd1cbe394 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 5 Nov 2003 03:39:33 +0000 Subject: [PATCH 4673/7878] fix type mismatch with picky compiler settings on z/OS (volatile vs. non-volatile) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64720 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/os390/atomic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c index 84fa8f8d9c2..caa1a5e2654 100644 --- a/atomic/os390/atomic.c +++ b/atomic/os390/atomic.c @@ -58,24 +58,24 @@ #if APR_HAS_THREADS -apr_int32_t apr_atomic_add(apr_atomic_t *mem, apr_int32_t val) +apr_int32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_int32_t val) { apr_atomic_t old, new_val; old = *mem; /* old is automatically updated on cs failure */ do { new_val = old + val; - } while (__cs(&old, mem, new_val)); + } while (__cs(&old, (cs_t *)mem, new_val)); return new_val; } -apr_uint32_t apr_atomic_cas(apr_atomic_t *mem, apr_uint32_t swap, +apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem, apr_uint32_t swap, apr_uint32_t cmp) { apr_uint32_t old = cmp; - __cs(&old, mem, swap); + __cs(&old, (cs_t *)mem, swap); return old; /* old is automatically updated from mem on cs failure */ } From dc5b507eabd14f8e1f83cb9c17ae678a54215bf5 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 5 Nov 2003 09:16:44 +0000 Subject: [PATCH 4674/7878] Really fix the build again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64722 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- test/testall.c | 1 - threadproc/unix/proc.c | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 086917ab5f5..463ac13955e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -115,7 +115,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ - testenv.lo testprocmutex.lo testrand2.lo + testenv.lo testprocmutex.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/testall.c b/test/testall.c index 5b4cc50b8a6..169188d9eff 100644 --- a/test/testall.c +++ b/test/testall.c @@ -95,7 +95,6 @@ static const struct testlist { {"testdup", testdup}, {"testdir", testdir}, {"testrand", testrand}, - {"testrand2", testrand2}, {"testdso", testdso}, {"testoc", testoc}, {"testsockets", testsockets}, diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index e5fa9a0d1b7..9d274b40dd0 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -233,8 +233,6 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) proc->out = NULL; proc->err = NULL; - apr_random_after_fork(proc); - return APR_INCHILD; } From 31bc8f6f711ebcc92e4a3010c18acf09117bbd07 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 5 Nov 2003 09:21:46 +0000 Subject: [PATCH 4675/7878] * shmem/unix/shm.c (apr_shm_create): Fix build with Tru64 "cc -std"; cast MAP_FAILED to (void *). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64723 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index dc1e9aad214..278ef2c3d55 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -178,7 +178,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, new_m->base = mmap(NULL, new_m->realsize, PROT_READ|PROT_WRITE, MAP_SHARED, tmpfd, 0); - if (new_m->base == MAP_FAILED) { + if (new_m->base == (void *)MAP_FAILED) { return errno; } @@ -200,7 +200,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #elif APR_USE_SHMEM_MMAP_ANON new_m->base = mmap(NULL, new_m->realsize, PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0); - if (new_m->base == MAP_FAILED) { + if (new_m->base == (void *)MAP_FAILED) { return errno; } From 39ec9a6bfcfaceff2cc2d4ac59951b458691b749 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 5 Nov 2003 09:46:00 +0000 Subject: [PATCH 4676/7878] From 0.9 branch, though it might still be wise to try out Sascha's awk code here instead: * build/apr_common.m4 (APR_LAYOUT): Low-risk fix for config.layout parser which breaks with some sed implementations. PR: 19251 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64724 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 29e69bbbb73..c7bfcfd04bd 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -757,7 +757,7 @@ AC_DEFUN(APR_LAYOUT,[ fi pldconf=./config.pld changequote({,}) - sed -e "1s/[ ]*<[lL]ayout[ ]*$2[ ]*>[ ]*//;t" \ + sed -e "1s/[ ]*<[lL]ayout[ ]*$2[ ]*>[ ]*//;1t" \ -e "1,/[ ]*<[lL]ayout[ ]*$2[ ]*>[ ]*/d" \ -e '/[ ]*<\/Layout>[ ]*/,$d' \ -e "s/^[ ]*//g" \ From 4ae532daae38cd081a44024dcf3fdf7b51c99d53 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Wed, 5 Nov 2003 11:59:54 +0000 Subject: [PATCH 4677/7878] Code style. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64725 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_random.h | 5 +- random/unix/apr_random.c | 229 +++++++++++++++++++-------------------- 2 files changed, 114 insertions(+), 120 deletions(-) diff --git a/include/apr_random.h b/include/apr_random.h index 102d909a0ed..a6535798a70 100644 --- a/include/apr_random.h +++ b/include/apr_random.h @@ -66,14 +66,13 @@ typedef void apr_crypto_hash_finish_t(apr_crypto_hash_t *hash, unsigned char *result); // FIXME: make this opaque -struct apr_crypto_hash_t - { +struct apr_crypto_hash_t { apr_crypto_hash_init_t *init; apr_crypto_hash_add_t *add; apr_crypto_hash_finish_t *finish; apr_size_t size; void *data; - }; +}; apr_crypto_hash_t *apr_crypto_sha256_new(apr_pool_t *p); diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c index 06762804bda..167514f7cc7 100644 --- a/random/unix/apr_random.c +++ b/random/unix/apr_random.c @@ -70,12 +70,11 @@ #define APR_RANDOM_DEFAULT_G_FOR_INSECURE 32 #define APR_RANDOM_DEFAULT_G_FOR_SECURE 320 -typedef struct apr_random_pool_t - { +typedef struct apr_random_pool_t { unsigned char *pool; int bytes; int pool_size; - } apr_random_pool_t; +} apr_random_pool_t; #define hash_init(h) (h)->init(h) #define hash_add(h,b,n) (h)->add(h,b,n) @@ -86,8 +85,7 @@ typedef struct apr_random_pool_t #define crypt_setkey(c,k) (c)->set_key((c)->data,k) #define crypt_crypt(c,out,in) (c)->crypt((c)->date,out,in) -struct apr_random_t - { +struct apr_random_t { apr_pool_t *apr_pool; apr_crypto_hash_t *pool_hash; unsigned int npools; @@ -116,222 +114,219 @@ struct apr_random_t unsigned char secure_started:1; apr_random_t *next; - }; +}; static apr_random_t *all_random; void apr_random_init(apr_random_t *g,apr_pool_t *p, apr_crypto_hash_t *pool_hash,apr_crypto_hash_t *key_hash, apr_crypto_hash_t *prng_hash) - { +{ int n; - g->apr_pool=p; - g->pool_hash=pool_hash; - g->key_hash=key_hash; - g->prng_hash=prng_hash; - g->npools=APR_RANDOM_DEFAULT_POOLS; - g->pools=apr_palloc(p,g->npools*sizeof *g->pools); - for(n=0 ; n < g->npools ; ++n) - { - g->pools[n].bytes=g->pools[n].pool_size=0; - g->pools[n].pool=NULL; - } - g->next_pool=0; - g->generation=0; - g->rehash_size=APR_RANDOM_DEFAULT_REHASH_SIZE; + g->apr_pool = p; + + g->pool_hash = pool_hash; + g->key_hash = key_hash; + g->prng_hash = prng_hash; + + g->npools = APR_RANDOM_DEFAULT_POOLS; + g->pools = apr_palloc(p,g->npools*sizeof *g->pools); + for (n = 0; n < g->npools; ++n) { + g->pools[n].bytes = g->pools[n].pool_size = 0; + g->pools[n].pool = NULL; + } + g->next_pool = 0; + + g->generation = 0; + + g->rehash_size = APR_RANDOM_DEFAULT_REHASH_SIZE; /* Ensure that the rehash size is twice the size of the pool hasher */ - g->rehash_size=((g->rehash_size+2*g->pool_hash->size-1)/g->pool_hash->size + g->rehash_size = ((g->rehash_size+2*g->pool_hash->size-1)/g->pool_hash->size /2)*g->pool_hash->size*2; - g->reseed_size=APR_RANDOM_DEFAULT_RESEED_SIZE; - g->prng_hash=prng_hash; - g->H=apr_palloc(p,H_size(g)); - g->H_waiting=apr_palloc(p,H_size(g)); - g->randomness=apr_palloc(p,B_size(g)); - g->random_bytes=0; - - g->g_for_insecure=APR_RANDOM_DEFAULT_G_FOR_INSECURE; - g->secure_base=0; - g->g_for_secure=APR_RANDOM_DEFAULT_G_FOR_SECURE; - g->secure_started=g->insecure_started=0; - - g->next=all_random; - all_random=g; - } + g->reseed_size = APR_RANDOM_DEFAULT_RESEED_SIZE; + + g->H = apr_palloc(p,H_size(g)); + g->H_waiting = apr_palloc(p,H_size(g)); + + g->randomness = apr_palloc(p,B_size(g)); + g->random_bytes = 0; + + g->g_for_insecure = APR_RANDOM_DEFAULT_G_FOR_INSECURE; + g->secure_base = 0; + g->g_for_secure = APR_RANDOM_DEFAULT_G_FOR_SECURE; + g->secure_started = g->insecure_started = 0; + + g->next = all_random; + all_random = g; +} static void mix_pid(apr_random_t *g,unsigned char *H,pid_t pid) - { +{ hash_init(g->key_hash); hash_add(g->key_hash,H,H_size(g)); hash_add(g->key_hash,&pid,sizeof pid); hash_finish(g->key_hash,H); - } +} static void mixer(apr_random_t *g,pid_t pid) - { - unsigned char *H=H_current(g); +{ + unsigned char *H = H_current(g); /* mix the PID into the current H */ mix_pid(g,H,pid); /* if we are in waiting, then also mix into main H */ - if(H != g->H) + if (H != g->H) mix_pid(g,g->H,pid); /* change order of pool mixing for good measure - note that going backwards is much better than going forwards */ --g->generation; /* blow away any lingering randomness */ - g->random_bytes=0; - } + g->random_bytes = 0; +} void apr_random_after_fork(apr_proc_t *proc) - { +{ apr_random_t *r; - for(r=all_random ; r ; r=r->next) + for (r = all_random; r; r = r->next) mixer(r,proc->pid); - } +} apr_random_t *apr_random_standard_new(apr_pool_t *p) - { - apr_random_t *r=apr_palloc(p,sizeof *r); +{ + apr_random_t *r = apr_palloc(p,sizeof *r); apr_random_init(r,p,apr_crypto_sha256_new(p),apr_crypto_sha256_new(p), apr_crypto_sha256_new(p)); return r; - } +} static void rekey(apr_random_t *g) - { +{ int n; - unsigned char *H=H_current(g); + unsigned char *H = H_current(g); hash_init(g->key_hash); hash_add(g->key_hash,H,H_size(g)); - for(n=0 ; n < g->npools && (n == 0 || g->generation&(1 << (n-1))) - ; ++n) - { + for (n = 0 ; n < g->npools && (n == 0 || g->generation&(1 << (n-1))) + ; ++n) { hash_add(g->key_hash,g->pools[n].pool,g->pools[n].bytes); - g->pools[n].bytes=0; - } + g->pools[n].bytes = 0; + } hash_finish(g->key_hash,H+B_size(g)); + ++g->generation; - if(!g->insecure_started && g->generation > g->g_for_insecure) - { - g->insecure_started=1; - if(!g->secure_started) - { + if (!g->insecure_started && g->generation > g->g_for_insecure) { + g->insecure_started = 1; + if (!g->secure_started) { memcpy(g->H_waiting,g->H,H_size(g)); - g->secure_base=g->generation; - } + g->secure_base = g->generation; } - if(!g->secure_started && g->generation > g->secure_base+g->g_for_secure) - { - g->secure_started=1; + } + + if (!g->secure_started && g->generation > g->secure_base+g->g_for_secure) { + g->secure_started = 1; memcpy(g->H,g->H_waiting,H_size(g)); - } } +} void apr_random_add_entropy(apr_random_t *g,const void *entropy_, apr_size_t bytes) - { +{ int n; - const unsigned char *entropy=entropy_; + const unsigned char *entropy = entropy_; - for(n=0 ; n < bytes ; ++n) - { - apr_random_pool_t *p=&g->pools[g->next_pool]; + for (n = 0; n < bytes; ++n) { + apr_random_pool_t *p = &g->pools[g->next_pool]; - if(++g->next_pool == g->npools) - g->next_pool=0; + if (++g->next_pool == g->npools) + g->next_pool = 0; - if(p->pool_size < p->bytes+1) - { - unsigned char *np=apr_palloc(g->apr_pool,(p->bytes+1)*2); + if (p->pool_size < p->bytes+1) { + unsigned char *np = apr_palloc(g->apr_pool,(p->bytes+1)*2); memcpy(np,p->pool,p->bytes); - p->pool=np; - p->pool_size=(p->bytes+1)*2; - } - p->pool[p->bytes++]=entropy[n]; + p->pool = np; + p->pool_size = (p->bytes+1)*2; + } + p->pool[p->bytes++] = entropy[n]; - if(p->bytes == g->rehash_size) - { + if (p->bytes == g->rehash_size) { int r; - for(r=0 ; r < p->bytes/2 ; r+=g->pool_hash->size) + for (r = 0; r < p->bytes/2; r+=g->pool_hash->size) hash(g->pool_hash,p->pool+r,p->pool+r*2,g->pool_hash->size*2); p->bytes/=2; - } - assert(p->bytes < g->rehash_size); } + assert(p->bytes < g->rehash_size); + } - if(g->pools[0].bytes >= g->reseed_size) + if (g->pools[0].bytes >= g->reseed_size) rekey(g); - } +} // This will give g->B_size bytes of randomness static void apr_random_block(apr_random_t *g,unsigned char *random) - { - // FIXME: in principle, these are different hashes +{ + /* FIXME: in principle, these are different hashes */ hash(g->prng_hash,g->H,g->H,H_size(g)); hash(g->prng_hash,random,g->H,B_size(g)); - } +} static void apr_random_bytes(apr_random_t *g,unsigned char *random, apr_size_t bytes) - { +{ apr_size_t n; - for(n=0 ; n < bytes ; ) - { + for (n = 0; n < bytes; ) { int l; - if(g->random_bytes == 0) - { + if (g->random_bytes == 0) { apr_random_block(g,g->randomness); - g->random_bytes=B_size(g); - } - l=min(bytes-n,g->random_bytes); + g->random_bytes = B_size(g); + } + l = min(bytes-n,g->random_bytes); memcpy(&random[n],g->randomness+B_size(g)-g->random_bytes,l); g->random_bytes-=l; n+=l; - } } +} apr_status_t apr_random_secure_bytes(apr_random_t *g,void *random, apr_size_t bytes) - { - if(!g->secure_started) +{ + if (!g->secure_started) return APR_ENOTENOUGHENTROPY; apr_random_bytes(g,random,bytes); return APR_SUCCESS; - } +} apr_status_t apr_random_insecure_bytes(apr_random_t *g,void *random, apr_size_t bytes) - { - if(!g->insecure_started) +{ + if (!g->insecure_started) return APR_ENOTENOUGHENTROPY; apr_random_bytes(g,random,bytes); return APR_SUCCESS; - } +} void apr_random_barrier(apr_random_t *g) - { - g->secure_started=0; - g->secure_base=g->generation; - } +{ + g->secure_started = 0; + g->secure_base = g->generation; +} apr_status_t apr_random_secure_ready(apr_random_t *r) - { - if(!r->secure_started) +{ + if (!r->secure_started) return APR_ENOTENOUGHENTROPY; return APR_SUCCESS; - } +} apr_status_t apr_random_insecure_ready(apr_random_t *r) - { - if(!r->insecure_started) +{ + if (!r->insecure_started) return APR_ENOTENOUGHENTROPY; return APR_SUCCESS; - } +} From 4711175d1692be0763e14bae4daee5429f5e735d Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Wed, 5 Nov 2003 12:05:28 +0000 Subject: [PATCH 4678/7878] SHA-2 code has been licensed to the ASF. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64726 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/sha2.c | 72 +++++++++++++++++++++++++++++++--------------- random/unix/sha2.h | 72 +++++++++++++++++++++++++++++++--------------- 2 files changed, 98 insertions(+), 46 deletions(-) diff --git a/random/unix/sha2.c b/random/unix/sha2.c index d454285e918..e1e50d90828 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -1,35 +1,61 @@ -/* - * FILE: sha2.c - * AUTHOR: Aaron D. Gifford - * - * Copyright (c) 2000-2001, Aaron D. Gifford - * All rights reserved. +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2003 The Apache Software Foundation. All rights + * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. + * * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ +/* + * FILE: sha2.c + * AUTHOR: Aaron D. Gifford * - * $Id: sha2.c,v 1.1 2003/11/03 13:25:00 ben Exp $ + * A licence was granted to the ASF by Aaron on 4 November 2003. */ #include /* memcpy()/memset() or bcopy()/bzero() */ diff --git a/random/unix/sha2.h b/random/unix/sha2.h index 941cb22424c..ba9ecb196de 100644 --- a/random/unix/sha2.h +++ b/random/unix/sha2.h @@ -1,35 +1,61 @@ -/* - * FILE: sha2.h - * AUTHOR: Aaron D. Gifford - * - * Copyright (c) 2000-2001, Aaron D. Gifford - * All rights reserved. +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2003 The Apache Software Foundation. All rights + * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. + * * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * ==================================================================== * - * $Id: sha2.h,v 1.1 2003/11/03 13:25:00 ben Exp $ + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ +/* + * FILE: sha2.h + * AUTHOR: Aaron D. Gifford + * + * A licence was granted to the ASF by Aaron on 4 November 2003. */ #ifndef __SHA2_H__ From a9baf6473e264fd93d3c00f83422c205b6dac20c Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Wed, 5 Nov 2003 13:30:28 +0000 Subject: [PATCH 4679/7878] Avoid warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64727 13f79535-47bb-0310-9956-ffa450edef68 --- test/testshm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testshm.c b/test/testshm.c index 50c304d8710..c2d9c3afcd5 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -233,6 +233,7 @@ static apr_status_t test_named(apr_pool_t *parpool) if (execlp("testshmconsumer", "testshmconsumer", (char*)0) < 0) { return errno; } + return 0; /* not reached - avoid warnings */ } else if (pidproducer > 0) { /* parent */ /* fork another child */ From 086e1cbc8d624a85cfc4086f11bb9fbe35a1f7df Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Wed, 5 Nov 2003 13:34:53 +0000 Subject: [PATCH 4680/7878] Endianness and APR types for random. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64728 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +- include/apr.h.in | 3 + random/unix/sha2.c | 109 +++++++---------------------- random/unix/sha2.h | 151 +++++++---------------------------------- test/Makefile.in | 2 +- test/testall.c | 1 + threadproc/unix/proc.c | 2 + 7 files changed, 64 insertions(+), 210 deletions(-) diff --git a/configure.in b/configure.in index 6846570afc5..db057f4a921 100644 --- a/configure.in +++ b/configure.in @@ -100,7 +100,7 @@ dnl These added to allow default directories to be used... DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" -apr_modules="file_io network_io threadproc misc locks time mmap shmem user memory atomic poll support" +apr_modules="file_io network_io threadproc misc locks time mmap shmem user memory atomic poll support random" dnl Checks for programs. AC_PROG_MAKE_SET @@ -1188,6 +1188,9 @@ else pid_t_fmt='#error Can not determine the proper size for pid_t' fi +dnl Checks for endianness +AC_C_BIGENDIAN([bigendian=1],[bigendian=0]) + # Basically, we have tried to figure out the correct format strings # for APR types which vary between platforms, but we don't always get # it right. If you find that we don't get it right for your platform, @@ -1242,6 +1245,7 @@ AC_SUBST(off_t_fmt) AC_SUBST(pid_t_fmt) AC_SUBST(int64_literal) AC_SUBST(stdint) +AC_SUBST(bigendian) dnl ----------------------------- Checking for string functions AC_CHECK_FUNCS(strnicmp, have_strnicmp="1", have_strnicmp="0") diff --git a/include/apr.h.in b/include/apr.h.in index 0cba978fe3a..3baa97bf9d7 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -305,6 +305,9 @@ typedef @socklen_t_value@ apr_socklen_t; #define APR_SIZEOF_VOIDP @voidp_size@ +/* Are we big endian? */ +#define APR_IS_BIGENDIAN @bigendian@ + /* Mechanisms to properly type numeric literals */ @int64_literal@ diff --git a/random/unix/sha2.c b/random/unix/sha2.c index e1e50d90828..540c99b3972 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -82,67 +82,10 @@ * */ - /*** SHA-256/384/512 Machine Architecture Definitions *****************/ -/* - * BYTE_ORDER NOTE: - * - * Please make sure that your system defines BYTE_ORDER. If your - * architecture is little-endian, make sure it also defines - * LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are - * equivilent. - * - * If your system does not define the above, then you can do so by - * hand like this: - * - * #define LITTLE_ENDIAN 1234 - * #define BIG_ENDIAN 4321 - * - * And for little-endian machines, add: - * - * #define BYTE_ORDER LITTLE_ENDIAN - * - * Or for big-endian machines: - * - * #define BYTE_ORDER BIG_ENDIAN - * - * The FreeBSD machine this was written on defines BYTE_ORDER - * appropriately by including (which in turn includes - * where the appropriate definitions are actually - * made). - */ -#if !defined(BYTE_ORDER) || (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN) -#error Define BYTE_ORDER to be equal to either LITTLE_ENDIAN or BIG_ENDIAN -#endif - -/* - * Define the followingsha2_* types to types of the correct length on - * the native archtecture. Most BSD systems and Linux define u_intXX_t - * types. Machines with very recent ANSI C headers, can use the - * uintXX_t definintions from inttypes.h by defining SHA2_USE_INTTYPES_H - * during compile or in the sha.h header file. - * - * Machines that support neither u_intXX_t nor inttypes.h's uintXX_t - * will need to define these three typedefs below (and the appropriate - * ones in sha.h too) by hand according to their system architecture. - * - * Thank you, Jun-ichiro itojun Hagino, for suggesting using u_intXX_t - * types and pointing out recent ANSI C support for uintXX_t in inttypes.h. - */ -#ifdef SHA2_USE_INTTYPES_H - -typedef uint8_t sha2_byte; /* Exactly 1 byte */ -typedef uint32_t sha2_word32; /* Exactly 4 bytes */ -typedef uint64_t sha2_word64; /* Exactly 8 bytes */ - -#else /* SHA2_USE_INTTYPES_H */ - -typedef u_int8_t sha2_byte; /* Exactly 1 byte */ -typedef u_int32_t sha2_word32; /* Exactly 4 bytes */ -typedef u_int64_t sha2_word64; /* Exactly 8 bytes */ - -#endif /* SHA2_USE_INTTYPES_H */ - +typedef apr_byte_t sha2_byte; /* Exactly 1 byte */ +typedef apr_uint32_t sha2_word32; /* Exactly 4 bytes */ +typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ /*** SHA-256/384/512 Various Length Definitions ***********************/ /* NOTE: Most of these are in sha2.h */ @@ -152,7 +95,7 @@ typedef u_int64_t sha2_word64; /* Exactly 8 bytes */ /*** ENDIAN REVERSAL MACROS *******************************************/ -#if BYTE_ORDER == LITTLE_ENDIAN +#if !APR_IS_BIGENDIAN #define REVERSE32(w,x) { \ sha2_word32 tmp = (w); \ tmp = (tmp >> 16) | (tmp << 16); \ @@ -166,7 +109,7 @@ typedef u_int64_t sha2_word64; /* Exactly 8 bytes */ (x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \ ((tmp & 0x0000ffff0000ffffULL) << 16); \ } -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ +#endif /* !APR_IS_BIGENDIAN */ /* * Macro for incrementally adding the unsigned 64-bit integer n to the @@ -372,7 +315,7 @@ void SHA256_Init(SHA256_CTX* context) { /* Unrolled SHA-256 round macros: */ -#if BYTE_ORDER == LITTLE_ENDIAN +#if !APR_IS_BIGENDIAN #define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ REVERSE32(*data++, W256[j]); \ @@ -383,7 +326,7 @@ void SHA256_Init(SHA256_CTX* context) { j++ -#else /* BYTE_ORDER == LITTLE_ENDIAN */ +#else /* APR_IS_BIGENDIAN */ #define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ @@ -392,7 +335,7 @@ void SHA256_Init(SHA256_CTX* context) { (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ +#endif /* APR_IS_BIGENDIAN */ #define ROUND256(a,b,c,d,e,f,g,h) \ s0 = W256[(j+1)&0x0f]; \ @@ -482,15 +425,15 @@ void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { j = 0; do { -#if BYTE_ORDER == LITTLE_ENDIAN +#if !APR_IS_BIGENDIAN /* Copy data while converting to host byte order */ REVERSE32(*data++,W256[j]); /* Apply the SHA-256 compression function to update a..h */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; -#else /* BYTE_ORDER == LITTLE_ENDIAN */ +#else /* APR_IS_BIGENDIAN */ /* Apply the SHA-256 compression function to update a..h with copy */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++); -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ +#endif /* APR_IS_BIGENDIAN */ T2 = Sigma0_256(a) + Maj(a, b, c); h = g; g = f; @@ -601,7 +544,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; -#if BYTE_ORDER == LITTLE_ENDIAN +#if !APR_IS_BIGENDIAN /* Convert FROM host byte order */ REVERSE64(context->bitcount,context->bitcount); #endif @@ -635,7 +578,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { /* Final transform: */ SHA256_Transform(context, (sha2_word32*)context->buffer); -#if BYTE_ORDER == LITTLE_ENDIAN +#if !APR_IS_BIGENDIAN { /* Convert TO host byte order */ int j; @@ -699,7 +642,7 @@ void SHA512_Init(SHA512_CTX* context) { #ifdef SHA2_UNROLL_TRANSFORM /* Unrolled SHA-512 round macros: */ -#if BYTE_ORDER == LITTLE_ENDIAN +#if !APR_IS_BIGENDIAN #define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ REVERSE64(*data++, W512[j]); \ @@ -710,7 +653,7 @@ void SHA512_Init(SHA512_CTX* context) { j++ -#else /* BYTE_ORDER == LITTLE_ENDIAN */ +#else /* APR_IS_BIGENDIAN */ #define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ @@ -719,7 +662,7 @@ void SHA512_Init(SHA512_CTX* context) { (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ j++ -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ +#endif /* APR_IS_BIGENDIAN */ #define ROUND512(a,b,c,d,e,f,g,h) \ s0 = W512[(j+1)&0x0f]; \ @@ -804,15 +747,15 @@ void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { j = 0; do { -#if BYTE_ORDER == LITTLE_ENDIAN +#if !APR_IS_BIGENDIAN /* Convert TO host byte order */ REVERSE64(*data++, W512[j]); /* Apply the SHA-512 compression function to update a..h */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; -#else /* BYTE_ORDER == LITTLE_ENDIAN */ +#else /* APR_IS_BIGENDIAN */ /* Apply the SHA-512 compression function to update a..h with copy */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++); -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ +#endif /* APR_IS_BIGENDIAN */ T2 = Sigma0_512(a) + Maj(a, b, c); h = g; g = f; @@ -917,7 +860,7 @@ void SHA512_Last(SHA512_CTX* context) { unsigned int usedspace; usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; -#if BYTE_ORDER == LITTLE_ENDIAN +#if !APR_IS_BIGENDIAN /* Convert FROM host byte order */ REVERSE64(context->bitcount[0],context->bitcount[0]); REVERSE64(context->bitcount[1],context->bitcount[1]); @@ -965,7 +908,7 @@ void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { SHA512_Last(context); /* Save the hash data for output: */ -#if BYTE_ORDER == LITTLE_ENDIAN +#if !APR_IS_BIGENDIAN { /* Convert TO host byte order */ int j; @@ -974,9 +917,9 @@ void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { *d++ = context->state[j]; } } -#else +#else /* APR_IS_BIGENDIAN */ MEMCPY_BCOPY(d, context->state, SHA512_DIGEST_LENGTH); -#endif +#endif /* APR_IS_BIGENDIAN */ } /* Zero out state data */ @@ -1040,7 +983,7 @@ void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { SHA512_Last((SHA512_CTX*)context); /* Save the hash data for output: */ -#if BYTE_ORDER == LITTLE_ENDIAN +#if !APR_IS_BIGENDIAN { /* Convert TO host byte order */ int j; @@ -1049,9 +992,9 @@ void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { *d++ = context->state[j]; } } -#else +#else /* APR_IS_BIGENDIAN */ MEMCPY_BCOPY(d, context->state, SHA384_DIGEST_LENGTH); -#endif +#endif /* APR_IS_BIGENDIAN */ } /* Zero out state data */ diff --git a/random/unix/sha2.h b/random/unix/sha2.h index ba9ecb196de..cba4f993dd1 100644 --- a/random/unix/sha2.h +++ b/random/unix/sha2.h @@ -65,20 +65,7 @@ extern "C" { #endif - -/* - * Import u_intXX_t size_t type definitions from system headers. You - * may need to change this, or define these things yourself in this - * file. - */ -#include - -#ifdef SHA2_USE_INTTYPES_H - -#include - -#endif /* SHA2_USE_INTTYPES_H */ - +#include "apr.h" /*** SHA-256/384/512 Various Length Definitions ***********************/ #define SHA256_BLOCK_LENGTH 64 @@ -93,127 +80,41 @@ extern "C" { /*** SHA-256/384/512 Context Structures *******************************/ -/* NOTE: If your architecture does not define either u_intXX_t types or - * uintXX_t (from inttypes.h), you may need to define things by hand - * for your system: - */ -#if 0 -typedef unsigned char u_int8_t; /* 1-byte (8-bits) */ -typedef unsigned int u_int32_t; /* 4-bytes (32-bits) */ -typedef unsigned long long u_int64_t; /* 8-bytes (64-bits) */ -#endif -/* - * Most BSD systems already define u_intXX_t types, as does Linux. - * Some systems, however, like Compaq's Tru64 Unix instead can use - * uintXX_t types defined by very recent ANSI C standards and included - * in the file: - * - * #include - * - * If you choose to use then please define: - * - * #define SHA2_USE_INTTYPES_H - * - * Or on the command line during compile: - * - * cc -DSHA2_USE_INTTYPES_H ... - */ -#ifdef SHA2_USE_INTTYPES_H - -typedef struct _SHA256_CTX { - uint32_t state[8]; - uint64_t bitcount; - uint8_t buffer[SHA256_BLOCK_LENGTH]; -} SHA256_CTX; -typedef struct _SHA512_CTX { - uint64_t state[8]; - uint64_t bitcount[2]; - uint8_t buffer[SHA512_BLOCK_LENGTH]; -} SHA512_CTX; - -#else /* SHA2_USE_INTTYPES_H */ - typedef struct _SHA256_CTX { - u_int32_t state[8]; - u_int64_t bitcount; - u_int8_t buffer[SHA256_BLOCK_LENGTH]; + apr_uint32_t state[8]; + apr_uint64_t bitcount; + apr_byte_t buffer[SHA256_BLOCK_LENGTH]; } SHA256_CTX; typedef struct _SHA512_CTX { - u_int64_t state[8]; - u_int64_t bitcount[2]; - u_int8_t buffer[SHA512_BLOCK_LENGTH]; + apr_uint64_t state[8]; + apr_uint64_t bitcount[2]; + apr_byte_t buffer[SHA512_BLOCK_LENGTH]; } SHA512_CTX; -#endif /* SHA2_USE_INTTYPES_H */ - typedef SHA512_CTX SHA384_CTX; /*** SHA-256/384/512 Function Prototypes ******************************/ -#ifndef NOPROTO -#ifdef SHA2_USE_INTTYPES_H - void SHA256_Init(SHA256_CTX *); -void SHA256_Update(SHA256_CTX*, const uint8_t*, size_t); -void SHA256_Final(uint8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*); -char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]); -char* SHA256_Data(const uint8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]); - -void SHA384_Init(SHA384_CTX*); -void SHA384_Update(SHA384_CTX*, const uint8_t*, size_t); -void SHA384_Final(uint8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*); -char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]); -char* SHA384_Data(const uint8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]); - -void SHA512_Init(SHA512_CTX*); -void SHA512_Update(SHA512_CTX*, const uint8_t*, size_t); -void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*); -char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]); -char* SHA512_Data(const uint8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]); - -#else /* SHA2_USE_INTTYPES_H */ - -void SHA256_Init(SHA256_CTX *); -void SHA256_Update(SHA256_CTX*, const u_int8_t*, size_t); -void SHA256_Final(u_int8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*); -char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]); -char* SHA256_Data(const u_int8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]); - -void SHA384_Init(SHA384_CTX*); -void SHA384_Update(SHA384_CTX*, const u_int8_t*, size_t); -void SHA384_Final(u_int8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*); -char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]); -char* SHA384_Data(const u_int8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]); - -void SHA512_Init(SHA512_CTX*); -void SHA512_Update(SHA512_CTX*, const u_int8_t*, size_t); -void SHA512_Final(u_int8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*); -char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]); -char* SHA512_Data(const u_int8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]); - -#endif /* SHA2_USE_INTTYPES_H */ - -#else /* NOPROTO */ - -void SHA256_Init(); -void SHA256_Update(); -void SHA256_Final(); -char* SHA256_End(); -char* SHA256_Data(); - -void SHA384_Init(); -void SHA384_Update(); -void SHA384_Final(); -char* SHA384_End(); -char* SHA384_Data(); - -void SHA512_Init(); -void SHA512_Update(); -void SHA512_Final(); -char* SHA512_End(); -char* SHA512_Data(); - -#endif /* NOPROTO */ +void SHA256_Update(SHA256_CTX *, const apr_byte_t *, size_t); +void SHA256_Final(apr_byte_t [SHA256_DIGEST_LENGTH], SHA256_CTX *); +char* SHA256_End(SHA256_CTX *, char [SHA256_DIGEST_STRING_LENGTH]); +char* SHA256_Data(const apr_byte_t *, size_t, + char [SHA256_DIGEST_STRING_LENGTH]); + +void SHA384_Init(SHA384_CTX *); +void SHA384_Update(SHA384_CTX *, const apr_byte_t *, size_t); +void SHA384_Final(apr_byte_t [SHA384_DIGEST_LENGTH], SHA384_CTX *); +char* SHA384_End(SHA384_CTX *, char [SHA384_DIGEST_STRING_LENGTH]); +char* SHA384_Data(const apr_byte_t *, size_t, + char [SHA384_DIGEST_STRING_LENGTH]); + +void SHA512_Init(SHA512_CTX *); +void SHA512_Update(SHA512_CTX *, const apr_byte_t *, size_t); +void SHA512_Final(apr_byte_t [SHA512_DIGEST_LENGTH], SHA512_CTX *); +char* SHA512_End(SHA512_CTX *, char [SHA512_DIGEST_STRING_LENGTH]); +char* SHA512_Data(const apr_byte_t *, size_t, + char [SHA512_DIGEST_STRING_LENGTH]); #ifdef __cplusplus } diff --git a/test/Makefile.in b/test/Makefile.in index 463ac13955e..086917ab5f5 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -115,7 +115,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ - testenv.lo testprocmutex.lo + testenv.lo testprocmutex.lo testrand2.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/testall.c b/test/testall.c index 169188d9eff..5b4cc50b8a6 100644 --- a/test/testall.c +++ b/test/testall.c @@ -95,6 +95,7 @@ static const struct testlist { {"testdup", testdup}, {"testdir", testdir}, {"testrand", testrand}, + {"testrand2", testrand2}, {"testdso", testdso}, {"testoc", testoc}, {"testsockets", testsockets}, diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 9d274b40dd0..e5fa9a0d1b7 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -233,6 +233,8 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) proc->out = NULL; proc->err = NULL; + apr_random_after_fork(proc); + return APR_INCHILD; } From 3215d9e8f7f542a3404a76aed82ccb5456a55a2c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 5 Nov 2003 15:32:28 +0000 Subject: [PATCH 4681/7878] * configure.in: Remove duplicate checks for strcasecmp and stricmp. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64729 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index db057f4a921..135e4582173 100644 --- a/configure.in +++ b/configure.in @@ -795,7 +795,7 @@ AC_SUBST(sharedmem) dnl ----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) -AC_CHECK_FUNCS(alloca calloc strcasecmp stricmp setsid isinf isnan) +AC_CHECK_FUNCS(alloca calloc setsid isinf isnan) AC_CHECK_FUNCS(getenv putenv setenv unsetenv) AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) From 59c2b8abfd3104b73183d65ba82e64bd3a4f6bbd Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Wed, 5 Nov 2003 17:43:18 +0000 Subject: [PATCH 4682/7878] Support third-world compilers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64730 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_random.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_random.h b/include/apr_random.h index a6535798a70..7592950022f 100644 --- a/include/apr_random.h +++ b/include/apr_random.h @@ -65,7 +65,7 @@ typedef void apr_crypto_hash_add_t(apr_crypto_hash_t *hash,const void *data, typedef void apr_crypto_hash_finish_t(apr_crypto_hash_t *hash, unsigned char *result); -// FIXME: make this opaque +/* FIXME: make this opaque */ struct apr_crypto_hash_t { apr_crypto_hash_init_t *init; apr_crypto_hash_add_t *add; From 97627d7c3dc1dff53f14e596e09d580c5255f3c6 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 5 Nov 2003 22:38:40 +0000 Subject: [PATCH 4683/7878] * apr_random.c: Fix comment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64731 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/apr_random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c index 167514f7cc7..fc260ff1b3d 100644 --- a/random/unix/apr_random.c +++ b/random/unix/apr_random.c @@ -266,7 +266,7 @@ void apr_random_add_entropy(apr_random_t *g,const void *entropy_, rekey(g); } -// This will give g->B_size bytes of randomness +/* This will give g->B_size bytes of randomness */ static void apr_random_block(apr_random_t *g,unsigned char *random) { /* FIXME: in principle, these are different hashes */ From 21cf5a49dd637c5b311d89f26698664f3f3f89f0 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 5 Nov 2003 22:39:55 +0000 Subject: [PATCH 4684/7878] Ignore generated source. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64732 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/.cvsignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 random/unix/.cvsignore diff --git a/random/unix/.cvsignore b/random/unix/.cvsignore new file mode 100644 index 00000000000..2ebd06d3517 --- /dev/null +++ b/random/unix/.cvsignore @@ -0,0 +1,4 @@ +Makefile +*.lo +.libs +.deps From 9df6c98642fec08d093506abbd1b0b376cb6daa7 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Thu, 6 Nov 2003 00:25:33 +0000 Subject: [PATCH 4685/7878] Get rid of tabs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64733 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_random.h | 14 +- random/unix/apr_random.c | 122 ++-- random/unix/sha2.c | 1432 +++++++++++++++++++------------------- random/unix/sha2.h | 42 +- test/testrand2.c | 276 ++++---- threadproc/unix/proc.c | 2 +- 6 files changed, 944 insertions(+), 944 deletions(-) diff --git a/include/apr_random.h b/include/apr_random.h index 7592950022f..22e900f8a71 100644 --- a/include/apr_random.h +++ b/include/apr_random.h @@ -61,9 +61,9 @@ typedef struct apr_crypto_hash_t apr_crypto_hash_t; typedef void apr_crypto_hash_init_t(apr_crypto_hash_t *hash); typedef void apr_crypto_hash_add_t(apr_crypto_hash_t *hash,const void *data, - apr_size_t bytes); + apr_size_t bytes); typedef void apr_crypto_hash_finish_t(apr_crypto_hash_t *hash, - unsigned char *result); + unsigned char *result); /* FIXME: make this opaque */ struct apr_crypto_hash_t { @@ -79,15 +79,15 @@ apr_crypto_hash_t *apr_crypto_sha256_new(apr_pool_t *p); typedef struct apr_random_t apr_random_t; void apr_random_init(apr_random_t *g,apr_pool_t *p, - apr_crypto_hash_t *pool_hash,apr_crypto_hash_t *key_hash, - apr_crypto_hash_t *prng_hash); + apr_crypto_hash_t *pool_hash,apr_crypto_hash_t *key_hash, + apr_crypto_hash_t *prng_hash); apr_random_t *apr_random_standard_new(apr_pool_t *p); void apr_random_add_entropy(apr_random_t *g,const void *entropy_, - apr_size_t bytes); + apr_size_t bytes); apr_status_t apr_random_insecure_bytes(apr_random_t *g,void *random, - apr_size_t bytes); + apr_size_t bytes); apr_status_t apr_random_secure_bytes(apr_random_t *g,void *random, - apr_size_t bytes); + apr_size_t bytes); void apr_random_barrier(apr_random_t *g); apr_status_t apr_random_secure_ready(apr_random_t *r); apr_status_t apr_random_insecure_ready(apr_random_t *r); diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c index fc260ff1b3d..68e9739cc9e 100644 --- a/random/unix/apr_random.c +++ b/random/unix/apr_random.c @@ -76,14 +76,14 @@ typedef struct apr_random_pool_t { int pool_size; } apr_random_pool_t; -#define hash_init(h) (h)->init(h) -#define hash_add(h,b,n) (h)->add(h,b,n) -#define hash_finish(h,r) (h)->finish(h,r) +#define hash_init(h) (h)->init(h) +#define hash_add(h,b,n) (h)->add(h,b,n) +#define hash_finish(h,r) (h)->finish(h,r) -#define hash(h,r,b,n) hash_init(h),hash_add(h,b,n),hash_finish(h,r) +#define hash(h,r,b,n) hash_init(h),hash_add(h,b,n),hash_finish(h,r) -#define crypt_setkey(c,k) (c)->set_key((c)->data,k) -#define crypt_crypt(c,out,in) (c)->crypt((c)->date,out,in) +#define crypt_setkey(c,k) (c)->set_key((c)->data,k) +#define crypt_crypt(c,out,in) (c)->crypt((c)->date,out,in) struct apr_random_t { apr_pool_t *apr_pool; @@ -103,7 +103,7 @@ struct apr_random_t { unsigned char *H_waiting; #define H_size(g) (B_size(g)+K_size(g)) #define H_current(g) (((g)->insecure_started && !(g)->secure_started) \ - ? (g)->H_waiting : (g)->H) + ? (g)->H_waiting : (g)->H) unsigned char *randomness; apr_size_t random_bytes; @@ -119,8 +119,8 @@ struct apr_random_t { static apr_random_t *all_random; void apr_random_init(apr_random_t *g,apr_pool_t *p, - apr_crypto_hash_t *pool_hash,apr_crypto_hash_t *key_hash, - apr_crypto_hash_t *prng_hash) + apr_crypto_hash_t *pool_hash,apr_crypto_hash_t *key_hash, + apr_crypto_hash_t *prng_hash) { int n; @@ -133,8 +133,8 @@ void apr_random_init(apr_random_t *g,apr_pool_t *p, g->npools = APR_RANDOM_DEFAULT_POOLS; g->pools = apr_palloc(p,g->npools*sizeof *g->pools); for (n = 0; n < g->npools; ++n) { - g->pools[n].bytes = g->pools[n].pool_size = 0; - g->pools[n].pool = NULL; + g->pools[n].bytes = g->pools[n].pool_size = 0; + g->pools[n].pool = NULL; } g->next_pool = 0; @@ -143,7 +143,7 @@ void apr_random_init(apr_random_t *g,apr_pool_t *p, g->rehash_size = APR_RANDOM_DEFAULT_REHASH_SIZE; /* Ensure that the rehash size is twice the size of the pool hasher */ g->rehash_size = ((g->rehash_size+2*g->pool_hash->size-1)/g->pool_hash->size - /2)*g->pool_hash->size*2; + /2)*g->pool_hash->size*2; g->reseed_size = APR_RANDOM_DEFAULT_RESEED_SIZE; g->H = apr_palloc(p,H_size(g)); @@ -177,7 +177,7 @@ static void mixer(apr_random_t *g,pid_t pid) mix_pid(g,H,pid); /* if we are in waiting, then also mix into main H */ if (H != g->H) - mix_pid(g,g->H,pid); + mix_pid(g,g->H,pid); /* change order of pool mixing for good measure - note that going backwards is much better than going forwards */ --g->generation; @@ -190,7 +190,7 @@ void apr_random_after_fork(apr_proc_t *proc) apr_random_t *r; for (r = all_random; r; r = r->next) - mixer(r,proc->pid); + mixer(r,proc->pid); } apr_random_t *apr_random_standard_new(apr_pool_t *p) @@ -198,7 +198,7 @@ apr_random_t *apr_random_standard_new(apr_pool_t *p) apr_random_t *r = apr_palloc(p,sizeof *r); apr_random_init(r,p,apr_crypto_sha256_new(p),apr_crypto_sha256_new(p), - apr_crypto_sha256_new(p)); + apr_crypto_sha256_new(p)); return r; } @@ -210,60 +210,60 @@ static void rekey(apr_random_t *g) hash_init(g->key_hash); hash_add(g->key_hash,H,H_size(g)); for (n = 0 ; n < g->npools && (n == 0 || g->generation&(1 << (n-1))) - ; ++n) { - hash_add(g->key_hash,g->pools[n].pool,g->pools[n].bytes); - g->pools[n].bytes = 0; + ; ++n) { + hash_add(g->key_hash,g->pools[n].pool,g->pools[n].bytes); + g->pools[n].bytes = 0; } hash_finish(g->key_hash,H+B_size(g)); ++g->generation; if (!g->insecure_started && g->generation > g->g_for_insecure) { - g->insecure_started = 1; - if (!g->secure_started) { - memcpy(g->H_waiting,g->H,H_size(g)); - g->secure_base = g->generation; - } + g->insecure_started = 1; + if (!g->secure_started) { + memcpy(g->H_waiting,g->H,H_size(g)); + g->secure_base = g->generation; + } } if (!g->secure_started && g->generation > g->secure_base+g->g_for_secure) { - g->secure_started = 1; - memcpy(g->H,g->H_waiting,H_size(g)); + g->secure_started = 1; + memcpy(g->H,g->H_waiting,H_size(g)); } } void apr_random_add_entropy(apr_random_t *g,const void *entropy_, - apr_size_t bytes) + apr_size_t bytes) { int n; const unsigned char *entropy = entropy_; for (n = 0; n < bytes; ++n) { - apr_random_pool_t *p = &g->pools[g->next_pool]; + apr_random_pool_t *p = &g->pools[g->next_pool]; - if (++g->next_pool == g->npools) - g->next_pool = 0; + if (++g->next_pool == g->npools) + g->next_pool = 0; - if (p->pool_size < p->bytes+1) { - unsigned char *np = apr_palloc(g->apr_pool,(p->bytes+1)*2); + if (p->pool_size < p->bytes+1) { + unsigned char *np = apr_palloc(g->apr_pool,(p->bytes+1)*2); - memcpy(np,p->pool,p->bytes); - p->pool = np; - p->pool_size = (p->bytes+1)*2; - } - p->pool[p->bytes++] = entropy[n]; + memcpy(np,p->pool,p->bytes); + p->pool = np; + p->pool_size = (p->bytes+1)*2; + } + p->pool[p->bytes++] = entropy[n]; - if (p->bytes == g->rehash_size) { - int r; + if (p->bytes == g->rehash_size) { + int r; - for (r = 0; r < p->bytes/2; r+=g->pool_hash->size) - hash(g->pool_hash,p->pool+r,p->pool+r*2,g->pool_hash->size*2); - p->bytes/=2; - } - assert(p->bytes < g->rehash_size); + for (r = 0; r < p->bytes/2; r+=g->pool_hash->size) + hash(g->pool_hash,p->pool+r,p->pool+r*2,g->pool_hash->size*2); + p->bytes/=2; + } + assert(p->bytes < g->rehash_size); } if (g->pools[0].bytes >= g->reseed_size) - rekey(g); + rekey(g); } /* This will give g->B_size bytes of randomness */ @@ -275,38 +275,38 @@ static void apr_random_block(apr_random_t *g,unsigned char *random) } static void apr_random_bytes(apr_random_t *g,unsigned char *random, - apr_size_t bytes) + apr_size_t bytes) { apr_size_t n; for (n = 0; n < bytes; ) { - int l; - - if (g->random_bytes == 0) { - apr_random_block(g,g->randomness); - g->random_bytes = B_size(g); - } - l = min(bytes-n,g->random_bytes); - memcpy(&random[n],g->randomness+B_size(g)-g->random_bytes,l); - g->random_bytes-=l; - n+=l; + int l; + + if (g->random_bytes == 0) { + apr_random_block(g,g->randomness); + g->random_bytes = B_size(g); + } + l = min(bytes-n,g->random_bytes); + memcpy(&random[n],g->randomness+B_size(g)-g->random_bytes,l); + g->random_bytes-=l; + n+=l; } } apr_status_t apr_random_secure_bytes(apr_random_t *g,void *random, - apr_size_t bytes) + apr_size_t bytes) { if (!g->secure_started) - return APR_ENOTENOUGHENTROPY; + return APR_ENOTENOUGHENTROPY; apr_random_bytes(g,random,bytes); return APR_SUCCESS; } apr_status_t apr_random_insecure_bytes(apr_random_t *g,void *random, - apr_size_t bytes) + apr_size_t bytes) { if (!g->insecure_started) - return APR_ENOTENOUGHENTROPY; + return APR_ENOTENOUGHENTROPY; apr_random_bytes(g,random,bytes); return APR_SUCCESS; } @@ -320,13 +320,13 @@ void apr_random_barrier(apr_random_t *g) apr_status_t apr_random_secure_ready(apr_random_t *r) { if (!r->secure_started) - return APR_ENOTENOUGHENTROPY; + return APR_ENOTENOUGHENTROPY; return APR_SUCCESS; } apr_status_t apr_random_insecure_ready(apr_random_t *r) { if (!r->insecure_started) - return APR_ENOTENOUGHENTROPY; + return APR_ENOTENOUGHENTROPY; return APR_SUCCESS; } diff --git a/random/unix/sha2.c b/random/unix/sha2.c index 540c99b3972..d312d041ad8 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -52,14 +52,14 @@ * . */ /* - * FILE: sha2.c - * AUTHOR: Aaron D. Gifford + * FILE: sha2.c + * AUTHOR: Aaron D. Gifford * * A licence was granted to the ASF by Aaron on 4 November 2003. */ -#include /* memcpy()/memset() or bcopy()/bzero() */ -#include /* assert() */ +#include /* memcpy()/memset() or bcopy()/bzero() */ +#include /* assert() */ #include "sha2.h" /* @@ -83,31 +83,31 @@ */ /*** SHA-256/384/512 Machine Architecture Definitions *****************/ -typedef apr_byte_t sha2_byte; /* Exactly 1 byte */ -typedef apr_uint32_t sha2_word32; /* Exactly 4 bytes */ -typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ +typedef apr_byte_t sha2_byte; /* Exactly 1 byte */ +typedef apr_uint32_t sha2_word32; /* Exactly 4 bytes */ +typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ /*** SHA-256/384/512 Various Length Definitions ***********************/ /* NOTE: Most of these are in sha2.h */ -#define SHA256_SHORT_BLOCK_LENGTH (SHA256_BLOCK_LENGTH - 8) -#define SHA384_SHORT_BLOCK_LENGTH (SHA384_BLOCK_LENGTH - 16) -#define SHA512_SHORT_BLOCK_LENGTH (SHA512_BLOCK_LENGTH - 16) +#define SHA256_SHORT_BLOCK_LENGTH (SHA256_BLOCK_LENGTH - 8) +#define SHA384_SHORT_BLOCK_LENGTH (SHA384_BLOCK_LENGTH - 16) +#define SHA512_SHORT_BLOCK_LENGTH (SHA512_BLOCK_LENGTH - 16) /*** ENDIAN REVERSAL MACROS *******************************************/ #if !APR_IS_BIGENDIAN -#define REVERSE32(w,x) { \ - sha2_word32 tmp = (w); \ - tmp = (tmp >> 16) | (tmp << 16); \ - (x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \ +#define REVERSE32(w,x) { \ + sha2_word32 tmp = (w); \ + tmp = (tmp >> 16) | (tmp << 16); \ + (x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \ } -#define REVERSE64(w,x) { \ - sha2_word64 tmp = (w); \ - tmp = (tmp >> 32) | (tmp << 32); \ - tmp = ((tmp & 0xff00ff00ff00ff00ULL) >> 8) | \ - ((tmp & 0x00ff00ff00ff00ffULL) << 8); \ - (x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \ - ((tmp & 0x0000ffff0000ffffULL) << 16); \ +#define REVERSE64(w,x) { \ + sha2_word64 tmp = (w); \ + tmp = (tmp >> 32) | (tmp << 32); \ + tmp = ((tmp & 0xff00ff00ff00ff00ULL) >> 8) | \ + ((tmp & 0x00ff00ff00ff00ffULL) << 8); \ + (x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \ + ((tmp & 0x0000ffff0000ffffULL) << 16); \ } #endif /* !APR_IS_BIGENDIAN */ @@ -116,11 +116,11 @@ typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ * unsigned 128-bit integer (represented using a two-element array of * 64-bit words): */ -#define ADDINC128(w,n) { \ - (w)[0] += (sha2_word64)(n); \ - if ((w)[0] < (n)) { \ - (w)[1]++; \ - } \ +#define ADDINC128(w,n) { \ + (w)[0] += (sha2_word64)(n); \ + if ((w)[0] < (n)) { \ + (w)[1]++; \ + } \ } /* @@ -134,7 +134,7 @@ typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ */ #if !defined(SHA2_USE_MEMSET_MEMCPY) && !defined(SHA2_USE_BZERO_BCOPY) /* Default to memset()/memcpy() if no option is specified */ -#define SHA2_USE_MEMSET_MEMCPY 1 +#define SHA2_USE_MEMSET_MEMCPY 1 #endif #if defined(SHA2_USE_MEMSET_MEMCPY) && defined(SHA2_USE_BZERO_BCOPY) /* Abort with an error if BOTH options are defined */ @@ -142,12 +142,12 @@ typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ #endif #ifdef SHA2_USE_MEMSET_MEMCPY -#define MEMSET_BZERO(p,l) memset((p), 0, (l)) -#define MEMCPY_BCOPY(d,s,l) memcpy((d), (s), (l)) +#define MEMSET_BZERO(p,l) memset((p), 0, (l)) +#define MEMCPY_BCOPY(d,s,l) memcpy((d), (s), (l)) #endif #ifdef SHA2_USE_BZERO_BCOPY -#define MEMSET_BZERO(p,l) bzero((p), (l)) -#define MEMCPY_BCOPY(d,s,l) bcopy((s), (d), (l)) +#define MEMSET_BZERO(p,l) bzero((p), (l)) +#define MEMCPY_BCOPY(d,s,l) bcopy((s), (d), (l)) #endif @@ -161,27 +161,27 @@ typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ * same "backwards" definition. */ /* Shift-right (used in SHA-256, SHA-384, and SHA-512): */ -#define R(b,x) ((x) >> (b)) +#define R(b,x) ((x) >> (b)) /* 32-bit Rotate-right (used in SHA-256): */ -#define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) +#define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) /* 64-bit Rotate-right (used in SHA-384 and SHA-512): */ -#define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) +#define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) /* Two of six logical functions used in SHA-256, SHA-384, and SHA-512: */ -#define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) -#define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) +#define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) +#define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) /* Four of six logical functions used in SHA-256: */ -#define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x))) -#define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x))) -#define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x))) -#define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x))) +#define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x))) +#define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x))) +#define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x))) +#define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x))) /* Four of six logical functions used in SHA-384 and SHA-512: */ -#define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) -#define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) -#define sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x))) -#define sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x))) +#define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) +#define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) +#define sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x))) +#define sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x))) /*** INTERNAL FUNCTION PROTOTYPES *************************************/ /* NOTE: These should not be accessed directly from outside this @@ -196,102 +196,102 @@ void SHA512_Transform(SHA512_CTX*, const sha2_word64*); /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ /* Hash constant words K for SHA-256: */ const static sha2_word32 K256[64] = { - 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, - 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, - 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, - 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, - 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, - 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, - 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, - 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, - 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, - 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, - 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, - 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, - 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, - 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, - 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, - 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL + 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, + 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, + 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, + 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, + 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, + 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, + 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, + 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, + 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, + 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, + 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, + 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, + 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, + 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, + 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, + 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL }; /* Initial hash value H for SHA-256: */ const static sha2_word32 sha256_initial_hash_value[8] = { - 0x6a09e667UL, - 0xbb67ae85UL, - 0x3c6ef372UL, - 0xa54ff53aUL, - 0x510e527fUL, - 0x9b05688cUL, - 0x1f83d9abUL, - 0x5be0cd19UL + 0x6a09e667UL, + 0xbb67ae85UL, + 0x3c6ef372UL, + 0xa54ff53aUL, + 0x510e527fUL, + 0x9b05688cUL, + 0x1f83d9abUL, + 0x5be0cd19UL }; /* Hash constant words K for SHA-384 and SHA-512: */ const static sha2_word64 K512[80] = { - 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, - 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, - 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, - 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, - 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, - 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, - 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, - 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, - 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, - 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, - 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, - 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, - 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, - 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, - 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, - 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, - 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, - 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, - 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, - 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, - 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, - 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, - 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, - 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, - 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, - 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, - 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, - 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, - 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, - 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, - 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, - 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, - 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, - 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, - 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, - 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, - 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, - 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, - 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, - 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL + 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, + 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, + 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, + 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, + 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, + 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, + 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, + 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, + 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, + 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, + 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, + 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, + 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, + 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, + 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, + 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, + 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, + 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, + 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, + 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, + 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, + 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, + 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, + 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, + 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, + 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, + 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, + 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, + 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, + 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, + 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, + 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, + 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, + 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, + 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, + 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, + 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, + 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, + 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, + 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL }; /* Initial hash value H for SHA-384 */ const static sha2_word64 sha384_initial_hash_value[8] = { - 0xcbbb9d5dc1059ed8ULL, - 0x629a292a367cd507ULL, - 0x9159015a3070dd17ULL, - 0x152fecd8f70e5939ULL, - 0x67332667ffc00b31ULL, - 0x8eb44a8768581511ULL, - 0xdb0c2e0d64f98fa7ULL, - 0x47b5481dbefa4fa4ULL + 0xcbbb9d5dc1059ed8ULL, + 0x629a292a367cd507ULL, + 0x9159015a3070dd17ULL, + 0x152fecd8f70e5939ULL, + 0x67332667ffc00b31ULL, + 0x8eb44a8768581511ULL, + 0xdb0c2e0d64f98fa7ULL, + 0x47b5481dbefa4fa4ULL }; /* Initial hash value H for SHA-512 */ const static sha2_word64 sha512_initial_hash_value[8] = { - 0x6a09e667f3bcc908ULL, - 0xbb67ae8584caa73bULL, - 0x3c6ef372fe94f82bULL, - 0xa54ff53a5f1d36f1ULL, - 0x510e527fade682d1ULL, - 0x9b05688c2b3e6c1fULL, - 0x1f83d9abfb41bd6bULL, - 0x5be0cd19137e2179ULL + 0x6a09e667f3bcc908ULL, + 0xbb67ae8584caa73bULL, + 0x3c6ef372fe94f82bULL, + 0xa54ff53a5f1d36f1ULL, + 0x510e527fade682d1ULL, + 0x9b05688c2b3e6c1fULL, + 0x1f83d9abfb41bd6bULL, + 0x5be0cd19137e2179ULL }; /* @@ -303,12 +303,12 @@ static const char *sha2_hex_digits = "0123456789abcdef"; /*** SHA-256: *********************************************************/ void SHA256_Init(SHA256_CTX* context) { - if (context == (SHA256_CTX*)0) { - return; - } - MEMCPY_BCOPY(context->state, sha256_initial_hash_value, SHA256_DIGEST_LENGTH); - MEMSET_BZERO(context->buffer, SHA256_BLOCK_LENGTH); - context->bitcount = 0; + if (context == (SHA256_CTX*)0) { + return; + } + MEMCPY_BCOPY(context->state, sha256_initial_hash_value, SHA256_DIGEST_LENGTH); + MEMSET_BZERO(context->buffer, SHA256_BLOCK_LENGTH); + context->bitcount = 0; } #ifdef SHA2_UNROLL_TRANSFORM @@ -317,326 +317,326 @@ void SHA256_Init(SHA256_CTX* context) { #if !APR_IS_BIGENDIAN -#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ - REVERSE32(*data++, W256[j]); \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ +#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ + REVERSE32(*data++, W256[j]); \ + T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ K256[j] + W256[j]; \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ + (d) += T1; \ + (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ + j++ #else /* APR_IS_BIGENDIAN */ -#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ - K256[j] + (W256[j] = *data++); \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ +#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ + T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ + K256[j] + (W256[j] = *data++); \ + (d) += T1; \ + (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ + j++ #endif /* APR_IS_BIGENDIAN */ -#define ROUND256(a,b,c,d,e,f,g,h) \ - s0 = W256[(j+1)&0x0f]; \ - s0 = sigma0_256(s0); \ - s1 = W256[(j+14)&0x0f]; \ - s1 = sigma1_256(s1); \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \ - (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ +#define ROUND256(a,b,c,d,e,f,g,h) \ + s0 = W256[(j+1)&0x0f]; \ + s0 = sigma0_256(s0); \ + s1 = W256[(j+14)&0x0f]; \ + s1 = sigma1_256(s1); \ + T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \ + (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \ + (d) += T1; \ + (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ + j++ void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { - sha2_word32 a, b, c, d, e, f, g, h, s0, s1; - sha2_word32 T1, *W256; - int j; - - W256 = (sha2_word32*)context->buffer; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { - /* Rounds 0 to 15 (unrolled): */ - ROUND256_0_TO_15(a,b,c,d,e,f,g,h); - ROUND256_0_TO_15(h,a,b,c,d,e,f,g); - ROUND256_0_TO_15(g,h,a,b,c,d,e,f); - ROUND256_0_TO_15(f,g,h,a,b,c,d,e); - ROUND256_0_TO_15(e,f,g,h,a,b,c,d); - ROUND256_0_TO_15(d,e,f,g,h,a,b,c); - ROUND256_0_TO_15(c,d,e,f,g,h,a,b); - ROUND256_0_TO_15(b,c,d,e,f,g,h,a); - } while (j < 16); - - /* Now for the remaining rounds to 64: */ - do { - ROUND256(a,b,c,d,e,f,g,h); - ROUND256(h,a,b,c,d,e,f,g); - ROUND256(g,h,a,b,c,d,e,f); - ROUND256(f,g,h,a,b,c,d,e); - ROUND256(e,f,g,h,a,b,c,d); - ROUND256(d,e,f,g,h,a,b,c); - ROUND256(c,d,e,f,g,h,a,b); - ROUND256(b,c,d,e,f,g,h,a); - } while (j < 64); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = 0; + sha2_word32 a, b, c, d, e, f, g, h, s0, s1; + sha2_word32 T1, *W256; + int j; + + W256 = (sha2_word32*)context->buffer; + + /* Initialize registers with the prev. intermediate value */ + a = context->state[0]; + b = context->state[1]; + c = context->state[2]; + d = context->state[3]; + e = context->state[4]; + f = context->state[5]; + g = context->state[6]; + h = context->state[7]; + + j = 0; + do { + /* Rounds 0 to 15 (unrolled): */ + ROUND256_0_TO_15(a,b,c,d,e,f,g,h); + ROUND256_0_TO_15(h,a,b,c,d,e,f,g); + ROUND256_0_TO_15(g,h,a,b,c,d,e,f); + ROUND256_0_TO_15(f,g,h,a,b,c,d,e); + ROUND256_0_TO_15(e,f,g,h,a,b,c,d); + ROUND256_0_TO_15(d,e,f,g,h,a,b,c); + ROUND256_0_TO_15(c,d,e,f,g,h,a,b); + ROUND256_0_TO_15(b,c,d,e,f,g,h,a); + } while (j < 16); + + /* Now for the remaining rounds to 64: */ + do { + ROUND256(a,b,c,d,e,f,g,h); + ROUND256(h,a,b,c,d,e,f,g); + ROUND256(g,h,a,b,c,d,e,f); + ROUND256(f,g,h,a,b,c,d,e); + ROUND256(e,f,g,h,a,b,c,d); + ROUND256(d,e,f,g,h,a,b,c); + ROUND256(c,d,e,f,g,h,a,b); + ROUND256(b,c,d,e,f,g,h,a); + } while (j < 64); + + /* Compute the current intermediate hash value */ + context->state[0] += a; + context->state[1] += b; + context->state[2] += c; + context->state[3] += d; + context->state[4] += e; + context->state[5] += f; + context->state[6] += g; + context->state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = 0; } #else /* SHA2_UNROLL_TRANSFORM */ void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { - sha2_word32 a, b, c, d, e, f, g, h, s0, s1; - sha2_word32 T1, T2, *W256; - int j; - - W256 = (sha2_word32*)context->buffer; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { + sha2_word32 a, b, c, d, e, f, g, h, s0, s1; + sha2_word32 T1, T2, *W256; + int j; + + W256 = (sha2_word32*)context->buffer; + + /* Initialize registers with the prev. intermediate value */ + a = context->state[0]; + b = context->state[1]; + c = context->state[2]; + d = context->state[3]; + e = context->state[4]; + f = context->state[5]; + g = context->state[6]; + h = context->state[7]; + + j = 0; + do { #if !APR_IS_BIGENDIAN - /* Copy data while converting to host byte order */ - REVERSE32(*data++,W256[j]); - /* Apply the SHA-256 compression function to update a..h */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; + /* Copy data while converting to host byte order */ + REVERSE32(*data++,W256[j]); + /* Apply the SHA-256 compression function to update a..h */ + T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; #else /* APR_IS_BIGENDIAN */ - /* Apply the SHA-256 compression function to update a..h with copy */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++); + /* Apply the SHA-256 compression function to update a..h with copy */ + T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++); #endif /* APR_IS_BIGENDIAN */ - T2 = Sigma0_256(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 16); - - do { - /* Part of the message block expansion: */ - s0 = W256[(j+1)&0x0f]; - s0 = sigma0_256(s0); - s1 = W256[(j+14)&0x0f]; - s1 = sigma1_256(s1); - - /* Apply the SHA-256 compression function to update a..h */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + - (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); - T2 = Sigma0_256(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 64); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = T2 = 0; + T2 = Sigma0_256(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 16); + + do { + /* Part of the message block expansion: */ + s0 = W256[(j+1)&0x0f]; + s0 = sigma0_256(s0); + s1 = W256[(j+14)&0x0f]; + s1 = sigma1_256(s1); + + /* Apply the SHA-256 compression function to update a..h */ + T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + + (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); + T2 = Sigma0_256(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 64); + + /* Compute the current intermediate hash value */ + context->state[0] += a; + context->state[1] += b; + context->state[2] += c; + context->state[3] += d; + context->state[4] += e; + context->state[5] += f; + context->state[6] += g; + context->state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = T2 = 0; } #endif /* SHA2_UNROLL_TRANSFORM */ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { - unsigned int freespace, usedspace; - - if (len == 0) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - assert(context != (SHA256_CTX*)0 && data != (sha2_byte*)0); - - usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; - if (usedspace > 0) { - /* Calculate how much free space is available in the buffer */ - freespace = SHA256_BLOCK_LENGTH - usedspace; - - if (len >= freespace) { - /* Fill the buffer completely and process it */ - MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); - context->bitcount += freespace << 3; - len -= freespace; - data += freespace; - SHA256_Transform(context, (sha2_word32*)context->buffer); - } else { - /* The buffer is not yet full */ - MEMCPY_BCOPY(&context->buffer[usedspace], data, len); - context->bitcount += len << 3; - /* Clean up: */ - usedspace = freespace = 0; - return; - } - } - while (len >= SHA256_BLOCK_LENGTH) { - /* Process as many complete blocks as we can */ - SHA256_Transform(context, (sha2_word32*)data); - context->bitcount += SHA256_BLOCK_LENGTH << 3; - len -= SHA256_BLOCK_LENGTH; - data += SHA256_BLOCK_LENGTH; - } - if (len > 0) { - /* There's left-overs, so save 'em */ - MEMCPY_BCOPY(context->buffer, data, len); - context->bitcount += len << 3; - } - /* Clean up: */ - usedspace = freespace = 0; + unsigned int freespace, usedspace; + + if (len == 0) { + /* Calling with no data is valid - we do nothing */ + return; + } + + /* Sanity check: */ + assert(context != (SHA256_CTX*)0 && data != (sha2_byte*)0); + + usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; + if (usedspace > 0) { + /* Calculate how much free space is available in the buffer */ + freespace = SHA256_BLOCK_LENGTH - usedspace; + + if (len >= freespace) { + /* Fill the buffer completely and process it */ + MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); + context->bitcount += freespace << 3; + len -= freespace; + data += freespace; + SHA256_Transform(context, (sha2_word32*)context->buffer); + } else { + /* The buffer is not yet full */ + MEMCPY_BCOPY(&context->buffer[usedspace], data, len); + context->bitcount += len << 3; + /* Clean up: */ + usedspace = freespace = 0; + return; + } + } + while (len >= SHA256_BLOCK_LENGTH) { + /* Process as many complete blocks as we can */ + SHA256_Transform(context, (sha2_word32*)data); + context->bitcount += SHA256_BLOCK_LENGTH << 3; + len -= SHA256_BLOCK_LENGTH; + data += SHA256_BLOCK_LENGTH; + } + if (len > 0) { + /* There's left-overs, so save 'em */ + MEMCPY_BCOPY(context->buffer, data, len); + context->bitcount += len << 3; + } + /* Clean up: */ + usedspace = freespace = 0; } void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { - sha2_word32 *d = (sha2_word32*)digest; - unsigned int usedspace; + sha2_word32 *d = (sha2_word32*)digest; + unsigned int usedspace; - /* Sanity check: */ - assert(context != (SHA256_CTX*)0); + /* Sanity check: */ + assert(context != (SHA256_CTX*)0); - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha2_byte*)0) { - usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; + /* If no digest buffer is passed, we don't bother doing this: */ + if (digest != (sha2_byte*)0) { + usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; #if !APR_IS_BIGENDIAN - /* Convert FROM host byte order */ - REVERSE64(context->bitcount,context->bitcount); + /* Convert FROM host byte order */ + REVERSE64(context->bitcount,context->bitcount); #endif - if (usedspace > 0) { - /* Begin padding with a 1 bit: */ - context->buffer[usedspace++] = 0x80; - - if (usedspace <= SHA256_SHORT_BLOCK_LENGTH) { - /* Set-up for the last transform: */ - MEMSET_BZERO(&context->buffer[usedspace], SHA256_SHORT_BLOCK_LENGTH - usedspace); - } else { - if (usedspace < SHA256_BLOCK_LENGTH) { - MEMSET_BZERO(&context->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace); - } - /* Do second-to-last transform: */ - SHA256_Transform(context, (sha2_word32*)context->buffer); - - /* And set-up for the last transform: */ - MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); - } - } else { - /* Set-up for the last transform: */ - MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); - - /* Begin padding with a 1 bit: */ - *context->buffer = 0x80; - } - /* Set the bit count: */ - *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; - - /* Final transform: */ - SHA256_Transform(context, (sha2_word32*)context->buffer); + if (usedspace > 0) { + /* Begin padding with a 1 bit: */ + context->buffer[usedspace++] = 0x80; + + if (usedspace <= SHA256_SHORT_BLOCK_LENGTH) { + /* Set-up for the last transform: */ + MEMSET_BZERO(&context->buffer[usedspace], SHA256_SHORT_BLOCK_LENGTH - usedspace); + } else { + if (usedspace < SHA256_BLOCK_LENGTH) { + MEMSET_BZERO(&context->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace); + } + /* Do second-to-last transform: */ + SHA256_Transform(context, (sha2_word32*)context->buffer); + + /* And set-up for the last transform: */ + MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); + } + } else { + /* Set-up for the last transform: */ + MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); + + /* Begin padding with a 1 bit: */ + *context->buffer = 0x80; + } + /* Set the bit count: */ + *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; + + /* Final transform: */ + SHA256_Transform(context, (sha2_word32*)context->buffer); #if !APR_IS_BIGENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < 8; j++) { - REVERSE32(context->state[j],context->state[j]); - *d++ = context->state[j]; - } - } + { + /* Convert TO host byte order */ + int j; + for (j = 0; j < 8; j++) { + REVERSE32(context->state[j],context->state[j]); + *d++ = context->state[j]; + } + } #else - MEMCPY_BCOPY(d, context->state, SHA256_DIGEST_LENGTH); + MEMCPY_BCOPY(d, context->state, SHA256_DIGEST_LENGTH); #endif - } + } - /* Clean up state data: */ - MEMSET_BZERO(context, sizeof(context)); - usedspace = 0; + /* Clean up state data: */ + MEMSET_BZERO(context, sizeof(context)); + usedspace = 0; } char *SHA256_End(SHA256_CTX* context, char buffer[]) { - sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest; - int i; - - /* Sanity check: */ - assert(context != (SHA256_CTX*)0); - - if (buffer != (char*)0) { - SHA256_Final(digest, context); - - for (i = 0; i < SHA256_DIGEST_LENGTH; i++) { - *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha2_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { - MEMSET_BZERO(context, sizeof(context)); - } - MEMSET_BZERO(digest, SHA256_DIGEST_LENGTH); - return buffer; + sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest; + int i; + + /* Sanity check: */ + assert(context != (SHA256_CTX*)0); + + if (buffer != (char*)0) { + SHA256_Final(digest, context); + + for (i = 0; i < SHA256_DIGEST_LENGTH; i++) { + *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; + *buffer++ = sha2_hex_digits[*d & 0x0f]; + d++; + } + *buffer = (char)0; + } else { + MEMSET_BZERO(context, sizeof(context)); + } + MEMSET_BZERO(digest, SHA256_DIGEST_LENGTH); + return buffer; } char* SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) { - SHA256_CTX context; + SHA256_CTX context; - SHA256_Init(&context); - SHA256_Update(&context, data, len); - return SHA256_End(&context, digest); + SHA256_Init(&context); + SHA256_Update(&context, data, len); + return SHA256_End(&context, digest); } /*** SHA-512: *********************************************************/ void SHA512_Init(SHA512_CTX* context) { - if (context == (SHA512_CTX*)0) { - return; - } - MEMCPY_BCOPY(context->state, sha512_initial_hash_value, SHA512_DIGEST_LENGTH); - MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH); - context->bitcount[0] = context->bitcount[1] = 0; + if (context == (SHA512_CTX*)0) { + return; + } + MEMCPY_BCOPY(context->state, sha512_initial_hash_value, SHA512_DIGEST_LENGTH); + MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH); + context->bitcount[0] = context->bitcount[1] = 0; } #ifdef SHA2_UNROLL_TRANSFORM @@ -644,391 +644,391 @@ void SHA512_Init(SHA512_CTX* context) { /* Unrolled SHA-512 round macros: */ #if !APR_IS_BIGENDIAN -#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ - REVERSE64(*data++, W512[j]); \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ +#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ + REVERSE64(*data++, W512[j]); \ + T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ K512[j] + W512[j]; \ - (d) += T1, \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \ - j++ + (d) += T1, \ + (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \ + j++ #else /* APR_IS_BIGENDIAN */ -#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ +#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ + T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ K512[j] + (W512[j] = *data++); \ - (d) += T1; \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ - j++ + (d) += T1; \ + (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ + j++ #endif /* APR_IS_BIGENDIAN */ -#define ROUND512(a,b,c,d,e,f,g,h) \ - s0 = W512[(j+1)&0x0f]; \ - s0 = sigma0_512(s0); \ - s1 = W512[(j+14)&0x0f]; \ - s1 = sigma1_512(s1); \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \ +#define ROUND512(a,b,c,d,e,f,g,h) \ + s0 = W512[(j+1)&0x0f]; \ + s0 = sigma0_512(s0); \ + s1 = W512[(j+14)&0x0f]; \ + s1 = sigma1_512(s1); \ + T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \ (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \ - (d) += T1; \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ - j++ + (d) += T1; \ + (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ + j++ void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { - sha2_word64 a, b, c, d, e, f, g, h, s0, s1; - sha2_word64 T1, *W512 = (sha2_word64*)context->buffer; - int j; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { - ROUND512_0_TO_15(a,b,c,d,e,f,g,h); - ROUND512_0_TO_15(h,a,b,c,d,e,f,g); - ROUND512_0_TO_15(g,h,a,b,c,d,e,f); - ROUND512_0_TO_15(f,g,h,a,b,c,d,e); - ROUND512_0_TO_15(e,f,g,h,a,b,c,d); - ROUND512_0_TO_15(d,e,f,g,h,a,b,c); - ROUND512_0_TO_15(c,d,e,f,g,h,a,b); - ROUND512_0_TO_15(b,c,d,e,f,g,h,a); - } while (j < 16); - - /* Now for the remaining rounds up to 79: */ - do { - ROUND512(a,b,c,d,e,f,g,h); - ROUND512(h,a,b,c,d,e,f,g); - ROUND512(g,h,a,b,c,d,e,f); - ROUND512(f,g,h,a,b,c,d,e); - ROUND512(e,f,g,h,a,b,c,d); - ROUND512(d,e,f,g,h,a,b,c); - ROUND512(c,d,e,f,g,h,a,b); - ROUND512(b,c,d,e,f,g,h,a); - } while (j < 80); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = 0; + sha2_word64 a, b, c, d, e, f, g, h, s0, s1; + sha2_word64 T1, *W512 = (sha2_word64*)context->buffer; + int j; + + /* Initialize registers with the prev. intermediate value */ + a = context->state[0]; + b = context->state[1]; + c = context->state[2]; + d = context->state[3]; + e = context->state[4]; + f = context->state[5]; + g = context->state[6]; + h = context->state[7]; + + j = 0; + do { + ROUND512_0_TO_15(a,b,c,d,e,f,g,h); + ROUND512_0_TO_15(h,a,b,c,d,e,f,g); + ROUND512_0_TO_15(g,h,a,b,c,d,e,f); + ROUND512_0_TO_15(f,g,h,a,b,c,d,e); + ROUND512_0_TO_15(e,f,g,h,a,b,c,d); + ROUND512_0_TO_15(d,e,f,g,h,a,b,c); + ROUND512_0_TO_15(c,d,e,f,g,h,a,b); + ROUND512_0_TO_15(b,c,d,e,f,g,h,a); + } while (j < 16); + + /* Now for the remaining rounds up to 79: */ + do { + ROUND512(a,b,c,d,e,f,g,h); + ROUND512(h,a,b,c,d,e,f,g); + ROUND512(g,h,a,b,c,d,e,f); + ROUND512(f,g,h,a,b,c,d,e); + ROUND512(e,f,g,h,a,b,c,d); + ROUND512(d,e,f,g,h,a,b,c); + ROUND512(c,d,e,f,g,h,a,b); + ROUND512(b,c,d,e,f,g,h,a); + } while (j < 80); + + /* Compute the current intermediate hash value */ + context->state[0] += a; + context->state[1] += b; + context->state[2] += c; + context->state[3] += d; + context->state[4] += e; + context->state[5] += f; + context->state[6] += g; + context->state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = 0; } #else /* SHA2_UNROLL_TRANSFORM */ void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { - sha2_word64 a, b, c, d, e, f, g, h, s0, s1; - sha2_word64 T1, T2, *W512 = (sha2_word64*)context->buffer; - int j; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { + sha2_word64 a, b, c, d, e, f, g, h, s0, s1; + sha2_word64 T1, T2, *W512 = (sha2_word64*)context->buffer; + int j; + + /* Initialize registers with the prev. intermediate value */ + a = context->state[0]; + b = context->state[1]; + c = context->state[2]; + d = context->state[3]; + e = context->state[4]; + f = context->state[5]; + g = context->state[6]; + h = context->state[7]; + + j = 0; + do { #if !APR_IS_BIGENDIAN - /* Convert TO host byte order */ - REVERSE64(*data++, W512[j]); - /* Apply the SHA-512 compression function to update a..h */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; + /* Convert TO host byte order */ + REVERSE64(*data++, W512[j]); + /* Apply the SHA-512 compression function to update a..h */ + T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; #else /* APR_IS_BIGENDIAN */ - /* Apply the SHA-512 compression function to update a..h with copy */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++); + /* Apply the SHA-512 compression function to update a..h with copy */ + T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++); #endif /* APR_IS_BIGENDIAN */ - T2 = Sigma0_512(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 16); - - do { - /* Part of the message block expansion: */ - s0 = W512[(j+1)&0x0f]; - s0 = sigma0_512(s0); - s1 = W512[(j+14)&0x0f]; - s1 = sigma1_512(s1); - - /* Apply the SHA-512 compression function to update a..h */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + - (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); - T2 = Sigma0_512(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 80); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = T2 = 0; + T2 = Sigma0_512(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 16); + + do { + /* Part of the message block expansion: */ + s0 = W512[(j+1)&0x0f]; + s0 = sigma0_512(s0); + s1 = W512[(j+14)&0x0f]; + s1 = sigma1_512(s1); + + /* Apply the SHA-512 compression function to update a..h */ + T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + + (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); + T2 = Sigma0_512(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 80); + + /* Compute the current intermediate hash value */ + context->state[0] += a; + context->state[1] += b; + context->state[2] += c; + context->state[3] += d; + context->state[4] += e; + context->state[5] += f; + context->state[6] += g; + context->state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = T2 = 0; } #endif /* SHA2_UNROLL_TRANSFORM */ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { - unsigned int freespace, usedspace; - - if (len == 0) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - assert(context != (SHA512_CTX*)0 && data != (sha2_byte*)0); - - usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; - if (usedspace > 0) { - /* Calculate how much free space is available in the buffer */ - freespace = SHA512_BLOCK_LENGTH - usedspace; - - if (len >= freespace) { - /* Fill the buffer completely and process it */ - MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); - ADDINC128(context->bitcount, freespace << 3); - len -= freespace; - data += freespace; - SHA512_Transform(context, (sha2_word64*)context->buffer); - } else { - /* The buffer is not yet full */ - MEMCPY_BCOPY(&context->buffer[usedspace], data, len); - ADDINC128(context->bitcount, len << 3); - /* Clean up: */ - usedspace = freespace = 0; - return; - } - } - while (len >= SHA512_BLOCK_LENGTH) { - /* Process as many complete blocks as we can */ - SHA512_Transform(context, (sha2_word64*)data); - ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3); - len -= SHA512_BLOCK_LENGTH; - data += SHA512_BLOCK_LENGTH; - } - if (len > 0) { - /* There's left-overs, so save 'em */ - MEMCPY_BCOPY(context->buffer, data, len); - ADDINC128(context->bitcount, len << 3); - } - /* Clean up: */ - usedspace = freespace = 0; + unsigned int freespace, usedspace; + + if (len == 0) { + /* Calling with no data is valid - we do nothing */ + return; + } + + /* Sanity check: */ + assert(context != (SHA512_CTX*)0 && data != (sha2_byte*)0); + + usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; + if (usedspace > 0) { + /* Calculate how much free space is available in the buffer */ + freespace = SHA512_BLOCK_LENGTH - usedspace; + + if (len >= freespace) { + /* Fill the buffer completely and process it */ + MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); + ADDINC128(context->bitcount, freespace << 3); + len -= freespace; + data += freespace; + SHA512_Transform(context, (sha2_word64*)context->buffer); + } else { + /* The buffer is not yet full */ + MEMCPY_BCOPY(&context->buffer[usedspace], data, len); + ADDINC128(context->bitcount, len << 3); + /* Clean up: */ + usedspace = freespace = 0; + return; + } + } + while (len >= SHA512_BLOCK_LENGTH) { + /* Process as many complete blocks as we can */ + SHA512_Transform(context, (sha2_word64*)data); + ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3); + len -= SHA512_BLOCK_LENGTH; + data += SHA512_BLOCK_LENGTH; + } + if (len > 0) { + /* There's left-overs, so save 'em */ + MEMCPY_BCOPY(context->buffer, data, len); + ADDINC128(context->bitcount, len << 3); + } + /* Clean up: */ + usedspace = freespace = 0; } void SHA512_Last(SHA512_CTX* context) { - unsigned int usedspace; + unsigned int usedspace; - usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; + usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; #if !APR_IS_BIGENDIAN - /* Convert FROM host byte order */ - REVERSE64(context->bitcount[0],context->bitcount[0]); - REVERSE64(context->bitcount[1],context->bitcount[1]); + /* Convert FROM host byte order */ + REVERSE64(context->bitcount[0],context->bitcount[0]); + REVERSE64(context->bitcount[1],context->bitcount[1]); #endif - if (usedspace > 0) { - /* Begin padding with a 1 bit: */ - context->buffer[usedspace++] = 0x80; - - if (usedspace <= SHA512_SHORT_BLOCK_LENGTH) { - /* Set-up for the last transform: */ - MEMSET_BZERO(&context->buffer[usedspace], SHA512_SHORT_BLOCK_LENGTH - usedspace); - } else { - if (usedspace < SHA512_BLOCK_LENGTH) { - MEMSET_BZERO(&context->buffer[usedspace], SHA512_BLOCK_LENGTH - usedspace); - } - /* Do second-to-last transform: */ - SHA512_Transform(context, (sha2_word64*)context->buffer); - - /* And set-up for the last transform: */ - MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH - 2); - } - } else { - /* Prepare for final transform: */ - MEMSET_BZERO(context->buffer, SHA512_SHORT_BLOCK_LENGTH); - - /* Begin padding with a 1 bit: */ - *context->buffer = 0x80; - } - /* Store the length of input data (in bits): */ - *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; - *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; - - /* Final transform: */ - SHA512_Transform(context, (sha2_word64*)context->buffer); + if (usedspace > 0) { + /* Begin padding with a 1 bit: */ + context->buffer[usedspace++] = 0x80; + + if (usedspace <= SHA512_SHORT_BLOCK_LENGTH) { + /* Set-up for the last transform: */ + MEMSET_BZERO(&context->buffer[usedspace], SHA512_SHORT_BLOCK_LENGTH - usedspace); + } else { + if (usedspace < SHA512_BLOCK_LENGTH) { + MEMSET_BZERO(&context->buffer[usedspace], SHA512_BLOCK_LENGTH - usedspace); + } + /* Do second-to-last transform: */ + SHA512_Transform(context, (sha2_word64*)context->buffer); + + /* And set-up for the last transform: */ + MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH - 2); + } + } else { + /* Prepare for final transform: */ + MEMSET_BZERO(context->buffer, SHA512_SHORT_BLOCK_LENGTH); + + /* Begin padding with a 1 bit: */ + *context->buffer = 0x80; + } + /* Store the length of input data (in bits): */ + *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; + *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; + + /* Final transform: */ + SHA512_Transform(context, (sha2_word64*)context->buffer); } void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { - sha2_word64 *d = (sha2_word64*)digest; + sha2_word64 *d = (sha2_word64*)digest; - /* Sanity check: */ - assert(context != (SHA512_CTX*)0); + /* Sanity check: */ + assert(context != (SHA512_CTX*)0); - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha2_byte*)0) { - SHA512_Last(context); + /* If no digest buffer is passed, we don't bother doing this: */ + if (digest != (sha2_byte*)0) { + SHA512_Last(context); - /* Save the hash data for output: */ + /* Save the hash data for output: */ #if !APR_IS_BIGENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < 8; j++) { - REVERSE64(context->state[j],context->state[j]); - *d++ = context->state[j]; - } - } + { + /* Convert TO host byte order */ + int j; + for (j = 0; j < 8; j++) { + REVERSE64(context->state[j],context->state[j]); + *d++ = context->state[j]; + } + } #else /* APR_IS_BIGENDIAN */ - MEMCPY_BCOPY(d, context->state, SHA512_DIGEST_LENGTH); + MEMCPY_BCOPY(d, context->state, SHA512_DIGEST_LENGTH); #endif /* APR_IS_BIGENDIAN */ - } + } - /* Zero out state data */ - MEMSET_BZERO(context, sizeof(context)); + /* Zero out state data */ + MEMSET_BZERO(context, sizeof(context)); } char *SHA512_End(SHA512_CTX* context, char buffer[]) { - sha2_byte digest[SHA512_DIGEST_LENGTH], *d = digest; - int i; - - /* Sanity check: */ - assert(context != (SHA512_CTX*)0); - - if (buffer != (char*)0) { - SHA512_Final(digest, context); - - for (i = 0; i < SHA512_DIGEST_LENGTH; i++) { - *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha2_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { - MEMSET_BZERO(context, sizeof(context)); - } - MEMSET_BZERO(digest, SHA512_DIGEST_LENGTH); - return buffer; + sha2_byte digest[SHA512_DIGEST_LENGTH], *d = digest; + int i; + + /* Sanity check: */ + assert(context != (SHA512_CTX*)0); + + if (buffer != (char*)0) { + SHA512_Final(digest, context); + + for (i = 0; i < SHA512_DIGEST_LENGTH; i++) { + *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; + *buffer++ = sha2_hex_digits[*d & 0x0f]; + d++; + } + *buffer = (char)0; + } else { + MEMSET_BZERO(context, sizeof(context)); + } + MEMSET_BZERO(digest, SHA512_DIGEST_LENGTH); + return buffer; } char* SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) { - SHA512_CTX context; + SHA512_CTX context; - SHA512_Init(&context); - SHA512_Update(&context, data, len); - return SHA512_End(&context, digest); + SHA512_Init(&context); + SHA512_Update(&context, data, len); + return SHA512_End(&context, digest); } /*** SHA-384: *********************************************************/ void SHA384_Init(SHA384_CTX* context) { - if (context == (SHA384_CTX*)0) { - return; - } - MEMCPY_BCOPY(context->state, sha384_initial_hash_value, SHA512_DIGEST_LENGTH); - MEMSET_BZERO(context->buffer, SHA384_BLOCK_LENGTH); - context->bitcount[0] = context->bitcount[1] = 0; + if (context == (SHA384_CTX*)0) { + return; + } + MEMCPY_BCOPY(context->state, sha384_initial_hash_value, SHA512_DIGEST_LENGTH); + MEMSET_BZERO(context->buffer, SHA384_BLOCK_LENGTH); + context->bitcount[0] = context->bitcount[1] = 0; } void SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) { - SHA512_Update((SHA512_CTX*)context, data, len); + SHA512_Update((SHA512_CTX*)context, data, len); } void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { - sha2_word64 *d = (sha2_word64*)digest; + sha2_word64 *d = (sha2_word64*)digest; - /* Sanity check: */ - assert(context != (SHA384_CTX*)0); + /* Sanity check: */ + assert(context != (SHA384_CTX*)0); - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha2_byte*)0) { - SHA512_Last((SHA512_CTX*)context); + /* If no digest buffer is passed, we don't bother doing this: */ + if (digest != (sha2_byte*)0) { + SHA512_Last((SHA512_CTX*)context); - /* Save the hash data for output: */ + /* Save the hash data for output: */ #if !APR_IS_BIGENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < 6; j++) { - REVERSE64(context->state[j],context->state[j]); - *d++ = context->state[j]; - } - } + { + /* Convert TO host byte order */ + int j; + for (j = 0; j < 6; j++) { + REVERSE64(context->state[j],context->state[j]); + *d++ = context->state[j]; + } + } #else /* APR_IS_BIGENDIAN */ - MEMCPY_BCOPY(d, context->state, SHA384_DIGEST_LENGTH); + MEMCPY_BCOPY(d, context->state, SHA384_DIGEST_LENGTH); #endif /* APR_IS_BIGENDIAN */ - } + } - /* Zero out state data */ - MEMSET_BZERO(context, sizeof(context)); + /* Zero out state data */ + MEMSET_BZERO(context, sizeof(context)); } char *SHA384_End(SHA384_CTX* context, char buffer[]) { - sha2_byte digest[SHA384_DIGEST_LENGTH], *d = digest; - int i; - - /* Sanity check: */ - assert(context != (SHA384_CTX*)0); - - if (buffer != (char*)0) { - SHA384_Final(digest, context); - - for (i = 0; i < SHA384_DIGEST_LENGTH; i++) { - *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha2_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { - MEMSET_BZERO(context, sizeof(context)); - } - MEMSET_BZERO(digest, SHA384_DIGEST_LENGTH); - return buffer; + sha2_byte digest[SHA384_DIGEST_LENGTH], *d = digest; + int i; + + /* Sanity check: */ + assert(context != (SHA384_CTX*)0); + + if (buffer != (char*)0) { + SHA384_Final(digest, context); + + for (i = 0; i < SHA384_DIGEST_LENGTH; i++) { + *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; + *buffer++ = sha2_hex_digits[*d & 0x0f]; + d++; + } + *buffer = (char)0; + } else { + MEMSET_BZERO(context, sizeof(context)); + } + MEMSET_BZERO(digest, SHA384_DIGEST_LENGTH); + return buffer; } char* SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) { - SHA384_CTX context; + SHA384_CTX context; - SHA384_Init(&context); - SHA384_Update(&context, data, len); - return SHA384_End(&context, digest); + SHA384_Init(&context); + SHA384_Update(&context, data, len); + return SHA384_End(&context, digest); } diff --git a/random/unix/sha2.h b/random/unix/sha2.h index cba4f993dd1..4a5dc30bf61 100644 --- a/random/unix/sha2.h +++ b/random/unix/sha2.h @@ -52,8 +52,8 @@ * . */ /* - * FILE: sha2.h - * AUTHOR: Aaron D. Gifford + * FILE: sha2.h + * AUTHOR: Aaron D. Gifford * * A licence was granted to the ASF by Aaron on 4 November 2003. */ @@ -68,27 +68,27 @@ extern "C" { #include "apr.h" /*** SHA-256/384/512 Various Length Definitions ***********************/ -#define SHA256_BLOCK_LENGTH 64 -#define SHA256_DIGEST_LENGTH 32 -#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) -#define SHA384_BLOCK_LENGTH 128 -#define SHA384_DIGEST_LENGTH 48 -#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) -#define SHA512_BLOCK_LENGTH 128 -#define SHA512_DIGEST_LENGTH 64 -#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) +#define SHA256_BLOCK_LENGTH 64 +#define SHA256_DIGEST_LENGTH 32 +#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) +#define SHA384_BLOCK_LENGTH 128 +#define SHA384_DIGEST_LENGTH 48 +#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) +#define SHA512_BLOCK_LENGTH 128 +#define SHA512_DIGEST_LENGTH 64 +#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) /*** SHA-256/384/512 Context Structures *******************************/ typedef struct _SHA256_CTX { - apr_uint32_t state[8]; - apr_uint64_t bitcount; - apr_byte_t buffer[SHA256_BLOCK_LENGTH]; + apr_uint32_t state[8]; + apr_uint64_t bitcount; + apr_byte_t buffer[SHA256_BLOCK_LENGTH]; } SHA256_CTX; typedef struct _SHA512_CTX { - apr_uint64_t state[8]; - apr_uint64_t bitcount[2]; - apr_byte_t buffer[SHA512_BLOCK_LENGTH]; + apr_uint64_t state[8]; + apr_uint64_t bitcount[2]; + apr_byte_t buffer[SHA512_BLOCK_LENGTH]; } SHA512_CTX; typedef SHA512_CTX SHA384_CTX; @@ -100,23 +100,23 @@ void SHA256_Update(SHA256_CTX *, const apr_byte_t *, size_t); void SHA256_Final(apr_byte_t [SHA256_DIGEST_LENGTH], SHA256_CTX *); char* SHA256_End(SHA256_CTX *, char [SHA256_DIGEST_STRING_LENGTH]); char* SHA256_Data(const apr_byte_t *, size_t, - char [SHA256_DIGEST_STRING_LENGTH]); + char [SHA256_DIGEST_STRING_LENGTH]); void SHA384_Init(SHA384_CTX *); void SHA384_Update(SHA384_CTX *, const apr_byte_t *, size_t); void SHA384_Final(apr_byte_t [SHA384_DIGEST_LENGTH], SHA384_CTX *); char* SHA384_End(SHA384_CTX *, char [SHA384_DIGEST_STRING_LENGTH]); char* SHA384_Data(const apr_byte_t *, size_t, - char [SHA384_DIGEST_STRING_LENGTH]); + char [SHA384_DIGEST_STRING_LENGTH]); void SHA512_Init(SHA512_CTX *); void SHA512_Update(SHA512_CTX *, const apr_byte_t *, size_t); void SHA512_Final(apr_byte_t [SHA512_DIGEST_LENGTH], SHA512_CTX *); char* SHA512_End(SHA512_CTX *, char [SHA512_DIGEST_STRING_LENGTH]); char* SHA512_Data(const apr_byte_t *, size_t, - char [SHA512_DIGEST_STRING_LENGTH]); + char [SHA512_DIGEST_STRING_LENGTH]); -#ifdef __cplusplus +#ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/test/testrand2.c b/test/testrand2.c index afa53b9c84f..43b9fe0de16 100644 --- a/test/testrand2.c +++ b/test/testrand2.c @@ -65,19 +65,19 @@ static void hexdump(const unsigned char *b,int n) int i; for(i=0 ; i < n ; ++i) - { + { #if 0 - if((i&0xf) == 0) - printf("%04x",i); - printf(" %02x",b[i]); - if((i&0xf) == 0xf) - printf("\n"); + if((i&0xf) == 0) + printf("%04x",i); + printf(" %02x",b[i]); + if((i&0xf) == 0xf) + printf("\n"); #else - printf("0x%02x,",b[i]); - if((i&7) == 7) - printf("\n"); + printf("0x%02x,",b[i]); + if((i&7) == 7) + printf("\n"); #endif - } + } printf("\n"); } @@ -86,7 +86,7 @@ static apr_random_t *r; typedef apr_status_t rnd_fn(apr_random_t *r,void *b,apr_size_t n); static void rand_run_kat(CuTest *tc,rnd_fn *f,apr_random_t *r, - const unsigned char expected[128]) + const unsigned char expected[128]) { unsigned char c[128]; apr_status_t rv; @@ -94,26 +94,26 @@ static void rand_run_kat(CuTest *tc,rnd_fn *f,apr_random_t *r, rv=f(r,c,128); CuAssertIntEquals(tc,0,rv); if(rv) - return; + return; if(memcmp(c,expected,128)) - { - hexdump(c,128); - hexdump(expected,128); - CuFail(tc,"Randomness mismatch"); - } + { + hexdump(c,128); + hexdump(expected,128); + CuFail(tc,"Randomness mismatch"); + } } static int rand_check_kat(rnd_fn *f,apr_random_t *r, - const unsigned char expected[128]) + const unsigned char expected[128]) { unsigned char c[128]; apr_status_t rv; rv=f(r,c,128); if(rv) - return 2; + return 2; if(memcmp(c,expected,128)) - return 1; + return 1; return 0; } @@ -125,14 +125,14 @@ static void rand_add_zeroes(apr_random_t *r) } static void rand_run_seed_short(CuTest *tc,rnd_fn *f,apr_random_t *r, - int count) + int count) { int i; apr_status_t rv; char c[1]; for(i=0 ; i < count ; ++i) - rand_add_zeroes(r); + rand_add_zeroes(r); rv=f(r,c,1); CuAssertIntEquals(tc,rv,APR_ENOTENOUGHENTROPY); } @@ -146,22 +146,22 @@ static void rand_seed_short(CuTest *tc) static void rand_kat(CuTest *tc) { unsigned char expected[128]= - { 0x82,0x04,0xad,0xd2,0x0b,0xd5,0xac,0xda, - 0x3d,0x85,0x58,0x38,0x54,0x6b,0x69,0x45, - 0x37,0x4c,0xc7,0xd7,0x87,0xeb,0xbf,0xd9, - 0xb1,0xb8,0xb8,0x2d,0x9b,0x33,0x6e,0x97, - 0x04,0x1d,0x4c,0xb0,0xd1,0xdf,0x3d,0xac, - 0xd2,0xaa,0xfa,0xcd,0x96,0xb7,0xcf,0xb1, - 0x8e,0x3d,0xb3,0xe5,0x37,0xa9,0x95,0xb4, - 0xaa,0x3d,0x11,0x1a,0x08,0x20,0x21,0x9f, - 0xdb,0x08,0x3a,0xb9,0x57,0x9f,0xf2,0x1f, - 0x27,0xdc,0xb6,0xc0,0x85,0x08,0x05,0xbb, - 0x13,0xbe,0xb1,0xe9,0x63,0x2a,0xe2,0xa4, - 0x23,0x15,0x2a,0x10,0xbf,0xdf,0x09,0xb3, - 0xc7,0xfb,0x2d,0x87,0x48,0x19,0xfb,0xc0, - 0x15,0x8c,0xcb,0xc6,0xbd,0x89,0x38,0x69, - 0xa3,0xae,0xa3,0x21,0x58,0x50,0xe7,0xc4, - 0x87,0xec,0x2e,0xb1,0x2d,0x6a,0xbd,0x46 }; + { 0x82,0x04,0xad,0xd2,0x0b,0xd5,0xac,0xda, + 0x3d,0x85,0x58,0x38,0x54,0x6b,0x69,0x45, + 0x37,0x4c,0xc7,0xd7,0x87,0xeb,0xbf,0xd9, + 0xb1,0xb8,0xb8,0x2d,0x9b,0x33,0x6e,0x97, + 0x04,0x1d,0x4c,0xb0,0xd1,0xdf,0x3d,0xac, + 0xd2,0xaa,0xfa,0xcd,0x96,0xb7,0xcf,0xb1, + 0x8e,0x3d,0xb3,0xe5,0x37,0xa9,0x95,0xb4, + 0xaa,0x3d,0x11,0x1a,0x08,0x20,0x21,0x9f, + 0xdb,0x08,0x3a,0xb9,0x57,0x9f,0xf2,0x1f, + 0x27,0xdc,0xb6,0xc0,0x85,0x08,0x05,0xbb, + 0x13,0xbe,0xb1,0xe9,0x63,0x2a,0xe2,0xa4, + 0x23,0x15,0x2a,0x10,0xbf,0xdf,0x09,0xb3, + 0xc7,0xfb,0x2d,0x87,0x48,0x19,0xfb,0xc0, + 0x15,0x8c,0xcb,0xc6,0xbd,0x89,0x38,0x69, + 0xa3,0xae,0xa3,0x21,0x58,0x50,0xe7,0xc4, + 0x87,0xec,0x2e,0xb1,0x2d,0x6a,0xbd,0x46 }; rand_add_zeroes(r); rand_run_kat(tc,apr_random_insecure_bytes,r,expected); @@ -175,22 +175,22 @@ static void rand_seed_short2(CuTest *tc) static void rand_kat2(CuTest *tc) { unsigned char expected[128]= - { 0x38,0x8f,0x01,0x29,0x5a,0x5c,0x1f,0xa8, - 0x00,0xde,0x16,0x4c,0xe5,0xf7,0x1f,0x58, - 0xc0,0x67,0xe2,0x98,0x3d,0xde,0x4a,0x75, - 0x61,0x3f,0x23,0xd8,0x45,0x7a,0x10,0x60, - 0x59,0x9b,0xd6,0xaf,0xcb,0x0a,0x2e,0x34, - 0x9c,0x39,0x5b,0xd0,0xbc,0x9a,0xf0,0x7b, - 0x7f,0x40,0x8b,0x33,0xc0,0x0e,0x2a,0x56, - 0xfc,0xe5,0xab,0xde,0x7b,0x13,0xf5,0xec, - 0x15,0x68,0xb8,0x09,0xbc,0x2c,0x15,0xf0, - 0x7b,0xef,0x2a,0x97,0x19,0xa8,0x69,0x51, - 0xdf,0xb0,0x5f,0x1a,0x4e,0xdf,0x42,0x02, - 0x71,0x36,0xa7,0x25,0x64,0x85,0xe2,0x72, - 0xc7,0x87,0x4d,0x7d,0x15,0xbb,0x15,0xd1, - 0xb1,0x62,0x0b,0x25,0xd9,0xd3,0xd9,0x5a, - 0xe3,0x47,0x1e,0xae,0x67,0xb4,0x19,0x9e, - 0xed,0xd2,0xde,0xce,0x18,0x70,0x57,0x12 }; + { 0x38,0x8f,0x01,0x29,0x5a,0x5c,0x1f,0xa8, + 0x00,0xde,0x16,0x4c,0xe5,0xf7,0x1f,0x58, + 0xc0,0x67,0xe2,0x98,0x3d,0xde,0x4a,0x75, + 0x61,0x3f,0x23,0xd8,0x45,0x7a,0x10,0x60, + 0x59,0x9b,0xd6,0xaf,0xcb,0x0a,0x2e,0x34, + 0x9c,0x39,0x5b,0xd0,0xbc,0x9a,0xf0,0x7b, + 0x7f,0x40,0x8b,0x33,0xc0,0x0e,0x2a,0x56, + 0xfc,0xe5,0xab,0xde,0x7b,0x13,0xf5,0xec, + 0x15,0x68,0xb8,0x09,0xbc,0x2c,0x15,0xf0, + 0x7b,0xef,0x2a,0x97,0x19,0xa8,0x69,0x51, + 0xdf,0xb0,0x5f,0x1a,0x4e,0xdf,0x42,0x02, + 0x71,0x36,0xa7,0x25,0x64,0x85,0xe2,0x72, + 0xc7,0x87,0x4d,0x7d,0x15,0xbb,0x15,0xd1, + 0xb1,0x62,0x0b,0x25,0xd9,0xd3,0xd9,0x5a, + 0xe3,0x47,0x1e,0xae,0x67,0xb4,0x19,0x9e, + 0xed,0xd2,0xde,0xce,0x18,0x70,0x57,0x12 }; rand_add_zeroes(r); rand_run_kat(tc,apr_random_secure_bytes,r,expected); @@ -205,22 +205,22 @@ static void rand_barrier(CuTest *tc) static void rand_kat3(CuTest *tc) { unsigned char expected[128]= - { 0xe8,0xe7,0xc9,0x45,0xe2,0x2a,0x54,0xb2, - 0xdd,0xe0,0xf9,0xbc,0x3d,0xf9,0xce,0x3c, - 0x4c,0xbd,0xc9,0xe2,0x20,0x4a,0x35,0x1c, - 0x04,0x52,0x7f,0xb8,0x0f,0x60,0x89,0x63, - 0x8a,0xbe,0x0a,0x44,0xac,0x5d,0xd8,0xeb, - 0x24,0x7d,0xd1,0xda,0x4d,0x86,0x9b,0x94, - 0x26,0x56,0x4a,0x5e,0x30,0xea,0xd4,0xa9, - 0x9a,0xdf,0xdd,0xb6,0xb1,0x15,0xe0,0xfa, - 0x28,0xa4,0xd6,0x95,0xa4,0xf1,0xd8,0x6e, - 0xeb,0x8c,0xa4,0xac,0x34,0xfe,0x06,0x92, - 0xc5,0x09,0x99,0x86,0xdc,0x5a,0x3c,0x92, - 0xc8,0x3e,0x52,0x00,0x4d,0x01,0x43,0x6f, - 0x69,0xcf,0xe2,0x60,0x9c,0x23,0xb3,0xa5, - 0x5f,0x51,0x47,0x8c,0x07,0xde,0x60,0xc6, - 0x04,0xbf,0x32,0xd6,0xdc,0xb7,0x31,0x01, - 0x29,0x51,0x51,0xb3,0x19,0x6e,0xe4,0xf8 }; + { 0xe8,0xe7,0xc9,0x45,0xe2,0x2a,0x54,0xb2, + 0xdd,0xe0,0xf9,0xbc,0x3d,0xf9,0xce,0x3c, + 0x4c,0xbd,0xc9,0xe2,0x20,0x4a,0x35,0x1c, + 0x04,0x52,0x7f,0xb8,0x0f,0x60,0x89,0x63, + 0x8a,0xbe,0x0a,0x44,0xac,0x5d,0xd8,0xeb, + 0x24,0x7d,0xd1,0xda,0x4d,0x86,0x9b,0x94, + 0x26,0x56,0x4a,0x5e,0x30,0xea,0xd4,0xa9, + 0x9a,0xdf,0xdd,0xb6,0xb1,0x15,0xe0,0xfa, + 0x28,0xa4,0xd6,0x95,0xa4,0xf1,0xd8,0x6e, + 0xeb,0x8c,0xa4,0xac,0x34,0xfe,0x06,0x92, + 0xc5,0x09,0x99,0x86,0xdc,0x5a,0x3c,0x92, + 0xc8,0x3e,0x52,0x00,0x4d,0x01,0x43,0x6f, + 0x69,0xcf,0xe2,0x60,0x9c,0x23,0xb3,0xa5, + 0x5f,0x51,0x47,0x8c,0x07,0xde,0x60,0xc6, + 0x04,0xbf,0x32,0xd6,0xdc,0xb7,0x31,0x01, + 0x29,0x51,0x51,0xb3,0x19,0x6e,0xe4,0xf8 }; rand_run_kat(tc,apr_random_insecure_bytes,r,expected); } @@ -228,22 +228,22 @@ static void rand_kat3(CuTest *tc) static void rand_kat4(CuTest *tc) { unsigned char expected[128]= - { 0x7d,0x0e,0xc4,0x4e,0x3e,0xac,0x86,0x50, - 0x37,0x95,0x7a,0x98,0x23,0x26,0xa7,0xbf, - 0x60,0xfb,0xa3,0x70,0x90,0xc3,0x58,0xc6, - 0xbd,0xd9,0x5e,0xa6,0x77,0x62,0x7a,0x5c, - 0x96,0x83,0x7f,0x80,0x3d,0xf4,0x9c,0xcc, - 0x9b,0x0c,0x8c,0xe1,0x72,0xa8,0xfb,0xc9, - 0xc5,0x43,0x91,0xdc,0x9d,0x92,0xc2,0xce, - 0x1c,0x5e,0x36,0xc7,0x87,0xb1,0xb4,0xa3, - 0xc8,0x69,0x76,0xfc,0x35,0x75,0xcb,0x08, - 0x2f,0xe3,0x98,0x76,0x37,0x80,0x04,0x5c, - 0xb8,0xb0,0x7f,0xb2,0xda,0xe3,0xa3,0xba, - 0xed,0xff,0xf5,0x9d,0x3b,0x7b,0xf3,0x32, - 0x6c,0x50,0xa5,0x3e,0xcc,0xe1,0x84,0x9c, - 0x17,0x9e,0x80,0x64,0x09,0xbb,0x62,0xf1, - 0x95,0xf5,0x2c,0xc6,0x9f,0x6a,0xee,0x6d, - 0x17,0x35,0x5f,0x35,0x8d,0x55,0x0c,0x07 }; + { 0x7d,0x0e,0xc4,0x4e,0x3e,0xac,0x86,0x50, + 0x37,0x95,0x7a,0x98,0x23,0x26,0xa7,0xbf, + 0x60,0xfb,0xa3,0x70,0x90,0xc3,0x58,0xc6, + 0xbd,0xd9,0x5e,0xa6,0x77,0x62,0x7a,0x5c, + 0x96,0x83,0x7f,0x80,0x3d,0xf4,0x9c,0xcc, + 0x9b,0x0c,0x8c,0xe1,0x72,0xa8,0xfb,0xc9, + 0xc5,0x43,0x91,0xdc,0x9d,0x92,0xc2,0xce, + 0x1c,0x5e,0x36,0xc7,0x87,0xb1,0xb4,0xa3, + 0xc8,0x69,0x76,0xfc,0x35,0x75,0xcb,0x08, + 0x2f,0xe3,0x98,0x76,0x37,0x80,0x04,0x5c, + 0xb8,0xb0,0x7f,0xb2,0xda,0xe3,0xa3,0xba, + 0xed,0xff,0xf5,0x9d,0x3b,0x7b,0xf3,0x32, + 0x6c,0x50,0xa5,0x3e,0xcc,0xe1,0x84,0x9c, + 0x17,0x9e,0x80,0x64,0x09,0xbb,0x62,0xf1, + 0x95,0xf5,0x2c,0xc6,0x9f,0x6a,0xee,0x6d, + 0x17,0x35,0x5f,0x35,0x8d,0x55,0x0c,0x07 }; rand_add_zeroes(r); rand_run_kat(tc,apr_random_secure_bytes,r,expected); @@ -254,68 +254,68 @@ static void rand_fork(CuTest *tc) apr_proc_t proc; apr_status_t rv; unsigned char expected[128]= - { 0xac,0x93,0xd2,0x5c,0xc7,0xf5,0x8d,0xc2, - 0xd8,0x8d,0xb6,0x7a,0x94,0xe1,0x83,0x4c, - 0x26,0xe2,0x38,0x6d,0xf5,0xbd,0x9d,0x6e, - 0x91,0x77,0x3a,0x4b,0x9b,0xef,0x9b,0xa3, - 0x9f,0xf6,0x6d,0x0c,0xdc,0x4b,0x02,0xe9, - 0x5d,0x3d,0xfc,0x92,0x6b,0xdf,0xc9,0xef, - 0xb9,0xa8,0x74,0x09,0xa3,0xff,0x64,0x8d, - 0x19,0xc1,0x31,0x31,0x17,0xe1,0xb7,0x7a, - 0xe7,0x55,0x14,0x92,0x05,0xe3,0x1e,0xb8, - 0x9b,0x1b,0xdc,0xac,0x0e,0x15,0x08,0xa2, - 0x93,0x13,0xf6,0x04,0xc6,0x9d,0xf8,0x7f, - 0x26,0x32,0x68,0x43,0x2e,0x5a,0x4f,0x47, - 0xe8,0xf8,0x59,0xb7,0xfb,0xbe,0x30,0x04, - 0xb6,0x63,0x6f,0x19,0xf3,0x2c,0xd4,0xeb, - 0x32,0x8a,0x54,0x01,0xd0,0xaf,0x3f,0x13, - 0xc1,0x7f,0x10,0x2e,0x08,0x1c,0x28,0x4b, }; + { 0xac,0x93,0xd2,0x5c,0xc7,0xf5,0x8d,0xc2, + 0xd8,0x8d,0xb6,0x7a,0x94,0xe1,0x83,0x4c, + 0x26,0xe2,0x38,0x6d,0xf5,0xbd,0x9d,0x6e, + 0x91,0x77,0x3a,0x4b,0x9b,0xef,0x9b,0xa3, + 0x9f,0xf6,0x6d,0x0c,0xdc,0x4b,0x02,0xe9, + 0x5d,0x3d,0xfc,0x92,0x6b,0xdf,0xc9,0xef, + 0xb9,0xa8,0x74,0x09,0xa3,0xff,0x64,0x8d, + 0x19,0xc1,0x31,0x31,0x17,0xe1,0xb7,0x7a, + 0xe7,0x55,0x14,0x92,0x05,0xe3,0x1e,0xb8, + 0x9b,0x1b,0xdc,0xac,0x0e,0x15,0x08,0xa2, + 0x93,0x13,0xf6,0x04,0xc6,0x9d,0xf8,0x7f, + 0x26,0x32,0x68,0x43,0x2e,0x5a,0x4f,0x47, + 0xe8,0xf8,0x59,0xb7,0xfb,0xbe,0x30,0x04, + 0xb6,0x63,0x6f,0x19,0xf3,0x2c,0xd4,0xeb, + 0x32,0x8a,0x54,0x01,0xd0,0xaf,0x3f,0x13, + 0xc1,0x7f,0x10,0x2e,0x08,0x1c,0x28,0x4b, }; rv=apr_proc_fork(&proc,p); if(rv == APR_INCHILD) - { - int n; + { + int n; - n=rand_check_kat(apr_random_secure_bytes,r,expected); + n=rand_check_kat(apr_random_secure_bytes,r,expected); - exit(n); - } + exit(n); + } else if(rv == APR_INPARENT) - { - int exitcode; - apr_exit_why_e why; + { + int exitcode; + apr_exit_why_e why; - rand_run_kat(tc,apr_random_secure_bytes,r,expected); - apr_proc_wait(&proc,&exitcode,&why,APR_WAIT); - if(why != APR_PROC_EXIT) - { - CuFail(tc,"Child terminated abnormally"); - return; - } - if(exitcode == 0) - { - CuFail(tc,"Child produced our randomness"); - return; - } - else if(exitcode == 2) - { - CuFail(tc,"Child randomness failed"); - return; - } - else if(exitcode != 1) - { - CuFail(tc,"Uknown child error"); - return; - } - } + rand_run_kat(tc,apr_random_secure_bytes,r,expected); + apr_proc_wait(&proc,&exitcode,&why,APR_WAIT); + if(why != APR_PROC_EXIT) + { + CuFail(tc,"Child terminated abnormally"); + return; + } + if(exitcode == 0) + { + CuFail(tc,"Child produced our randomness"); + return; + } + else if(exitcode == 2) + { + CuFail(tc,"Child randomness failed"); + return; + } + else if(exitcode != 1) + { + CuFail(tc,"Uknown child error"); + return; + } + } else - { - CuFail(tc,"Fork failed"); - return; - } + { + CuFail(tc,"Fork failed"); + return; + } } - + CuSuite *testrand2(void) { CuSuite *suite = CuSuiteNew("Random2"); diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index e5fa9a0d1b7..786596c7311 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -233,7 +233,7 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) proc->out = NULL; proc->err = NULL; - apr_random_after_fork(proc); + apr_random_after_fork(proc); return APR_INCHILD; } From c46d68ff5247ac9408d60bbbd5d2cbfdaa003e00 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Thu, 6 Nov 2003 00:26:06 +0000 Subject: [PATCH 4686/7878] Help idiots like me who use emacs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64734 13f79535-47bb-0310-9956-ffa450edef68 --- emacs-mode | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 emacs-mode diff --git a/emacs-mode b/emacs-mode new file mode 100644 index 00000000000..2c7abe98356 --- /dev/null +++ b/emacs-mode @@ -0,0 +1,15 @@ +;; M-x load-file +;; or emacs -l +;; to use this style: C-c . apache +(c-add-style "apache" + '((inclass . ++) + (defun-block-intro . ++) + (statement-block-intro . ++) + (substatement . ++) + (brace-list-intro . ++) + (statement-case-intro . ++) + (inextern-lang . 0) + )) +(setq-default indent-tabs-mode nil) +;; if you forgot to do this at startup, then M-x eval-expression +;; (setq indent-tabs-mode nil) on each buffer From f7b7dab405fc6e06850162cd2452ae3159573fdc Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 6 Nov 2003 00:43:32 +0000 Subject: [PATCH 4687/7878] * memory/unix/apr_pools.c (pool_clear_debug): When there is a child pool present after cleanups have been run, we know that a cleanup created a child pool. This results in orphaned pools, so in debug mode, abort(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64735 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 8d0e60b20fd..205cdba877b 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1399,6 +1399,10 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) run_cleanups(&pool->cleanups); pool->cleanups = NULL; + /* If new child pools showed up, this is a reason to raise a flag */ + if (pool->child) + abort(); + /* Free subprocesses */ free_proc_chain(pool->subprocesses); pool->subprocesses = NULL; From 241e7e4279101f03c436fcba1a041a7748598916 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 6 Nov 2003 09:18:22 +0000 Subject: [PATCH 4688/7878] * configure.in: Fix endianness detection with autoconf 2.1x. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64736 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 135e4582173..16f0776eea8 100644 --- a/configure.in +++ b/configure.in @@ -1188,8 +1188,13 @@ else pid_t_fmt='#error Can not determine the proper size for pid_t' fi -dnl Checks for endianness -AC_C_BIGENDIAN([bigendian=1],[bigendian=0]) +# Checks for endianness +AC_C_BIGENDIAN +if test $ac_cv_c_bigendian = yes; then + bigendian=1 +else + bigendian=0 +fi # Basically, we have tried to figure out the correct format strings # for APR types which vary between platforms, but we don't always get From 9763349d19c6b61f1ae3e1caba35b1f58f4a4889 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 6 Nov 2003 16:26:09 +0000 Subject: [PATCH 4689/7878] fix an odd portability issue: Bit-field foo must be of type signed int, unsigned int or int. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64737 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/apr_random.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c index 68e9739cc9e..64cd455e9e6 100644 --- a/random/unix/apr_random.c +++ b/random/unix/apr_random.c @@ -110,8 +110,8 @@ struct apr_random_t { unsigned int g_for_insecure; unsigned int g_for_secure; unsigned int secure_base; - unsigned char insecure_started:1; - unsigned char secure_started:1; + unsigned int insecure_started:1; + unsigned int secure_started:1; apr_random_t *next; }; From c797879cbdea2b389f1c8f2fcbbce91024a38e9d Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 11 Nov 2003 22:03:00 +0000 Subject: [PATCH 4690/7878] Add APR_DECLARE() to the function prototypes so that the will show up in the NetWare export list. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64738 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_random.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/apr_random.h b/include/apr_random.h index 22e900f8a71..ab77c5a459c 100644 --- a/include/apr_random.h +++ b/include/apr_random.h @@ -74,23 +74,23 @@ struct apr_crypto_hash_t { void *data; }; -apr_crypto_hash_t *apr_crypto_sha256_new(apr_pool_t *p); +APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p); typedef struct apr_random_t apr_random_t; -void apr_random_init(apr_random_t *g,apr_pool_t *p, +APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p, apr_crypto_hash_t *pool_hash,apr_crypto_hash_t *key_hash, apr_crypto_hash_t *prng_hash); -apr_random_t *apr_random_standard_new(apr_pool_t *p); -void apr_random_add_entropy(apr_random_t *g,const void *entropy_, +APR_DECLARE(apr_random_t *) apr_random_standard_new(apr_pool_t *p); +APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g,const void *entropy_, apr_size_t bytes); -apr_status_t apr_random_insecure_bytes(apr_random_t *g,void *random, +APR_DECLARE(apr_status_t) apr_random_insecure_bytes(apr_random_t *g,void *random, apr_size_t bytes); -apr_status_t apr_random_secure_bytes(apr_random_t *g,void *random, +APR_DECLARE(apr_status_t) apr_random_secure_bytes(apr_random_t *g,void *random, apr_size_t bytes); -void apr_random_barrier(apr_random_t *g); -apr_status_t apr_random_secure_ready(apr_random_t *r); -apr_status_t apr_random_insecure_ready(apr_random_t *r); +APR_DECLARE(void) apr_random_barrier(apr_random_t *g); +APR_DECLARE(apr_status_t) apr_random_secure_ready(apr_random_t *r); +APR_DECLARE(apr_status_t) apr_random_insecure_ready(apr_random_t *r); /* Call this in the child after forking to mix the randomness pools. Note that its generally a bad idea to fork a process with a @@ -103,6 +103,6 @@ apr_status_t apr_random_insecure_ready(apr_random_t *r); applications need ever call it themselves. */ struct apr_proc_t; -void apr_random_after_fork(struct apr_proc_t *proc); +APR_DECLARE(void) apr_random_after_fork(struct apr_proc_t *proc); #endif /* ndef APR_RANDOM_H */ From c77576512464aee3e1cda9896dcbf1b9427b44db Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 11 Nov 2003 22:03:52 +0000 Subject: [PATCH 4691/7878] Add apr_random to the NetWare build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64739 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 8 ++++++++ build/nw_export.inc | 1 + 2 files changed, 9 insertions(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index 8e7ac9ae123..5b80f30bb08 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -30,6 +30,7 @@ XINCDIRS += \ $(APR_WORK)/include/arch/NetWare \ $(APR_WORK)/include/arch/unix \ $(APR_WORK)/memory/unix \ + $(APR_WORK)/random/unix \ $(APRUTIL)/xml \ $(EOLIST) @@ -277,8 +278,11 @@ FILES_lib_objs = \ $(OBJDIR)/proc_mutex.o \ $(OBJDIR)/rand.o \ $(OBJDIR)/readwrite.o \ + $(OBJDIR)/apr_random.o \ $(OBJDIR)/seek.o \ $(OBJDIR)/sendrecv.o \ + $(OBJDIR)/sha2.o \ + $(OBJDIR)/sha2_glue.o \ $(OBJDIR)/shm.o \ $(OBJDIR)/signals.o \ $(OBJDIR)/sockaddr.o \ @@ -401,6 +405,10 @@ $(OBJDIR)/%.o: shmem/unix/%.c $(OBJDIR)\cc.opt $(OBJDIR)/%.o: support/unix/%.c $(OBJDIR)\cc.opt @echo Compiling $< $(CC) support\unix\$( Date: Tue, 11 Nov 2003 22:27:07 +0000 Subject: [PATCH 4692/7878] Add the random tests the NetWare build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64740 13f79535-47bb-0310-9956-ffa450edef68 --- test/nwgnuaprtest | 1 + test/testrand2.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/nwgnuaprtest b/test/nwgnuaprtest index e3a71c83d5f..024d8b40c92 100644 --- a/test/nwgnuaprtest +++ b/test/nwgnuaprtest @@ -190,6 +190,7 @@ FILES_nlm_objs = \ $(OBJDIR)/testproc.o \ $(OBJDIR)/testprocmutex.o \ $(OBJDIR)/testrand.o \ + $(OBJDIR)/testrand2.o \ $(OBJDIR)/testsleep.o \ $(OBJDIR)/testsockets.o \ $(OBJDIR)/testsockopt.o \ diff --git a/test/testrand2.c b/test/testrand2.c index 43b9fe0de16..980a8ecda54 100644 --- a/test/testrand2.c +++ b/test/testrand2.c @@ -249,6 +249,7 @@ static void rand_kat4(CuTest *tc) rand_run_kat(tc,apr_random_secure_bytes,r,expected); } +#if APR_HAS_FORK static void rand_fork(CuTest *tc) { apr_proc_t proc; @@ -314,7 +315,7 @@ static void rand_fork(CuTest *tc) return; } } - +#endif CuSuite *testrand2(void) { @@ -327,7 +328,9 @@ CuSuite *testrand2(void) SUITE_ADD_TEST(suite, rand_barrier); SUITE_ADD_TEST(suite, rand_kat3); SUITE_ADD_TEST(suite, rand_kat4); +#if APR_HAS_FORK SUITE_ADD_TEST(suite, rand_fork); +#endif return suite; } From ac1f1a87cc2f838d48accae83094ad86074d09bc Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 12 Nov 2003 14:57:26 +0000 Subject: [PATCH 4693/7878] provide an error string for APR_EPATHWILD git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64741 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index cc199f5ee54..77739065f0d 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -164,6 +164,8 @@ static char *apr_error_string(apr_status_t statcode) return "The given path was above the root path"; case APR_EBADPATH: return "The given path misformatted or contained invalid characters"; + case APR_EPATHWILD: + return "The given path contained wildcard characters"; case APR_EPROC_UNKNOWN: return "The process is not recognized."; default: From dcf631fa7f41adf15d7eeb0775320abd0686520e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 15 Nov 2003 19:30:37 +0000 Subject: [PATCH 4694/7878] rewrite some tests that previously only worked in a particular tz we can still check apr_ctime()... compare output with what the libc function ctime() builds the important part of test_localstr() was exploding an apr time into the different components (tm_sec, tm_hour, etc.)... again, get libc to perform the same task and make sure we agree with what libc generated git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64743 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/test/testtime.c b/test/testtime.c index 5bb7ef8b5b1..2694e4769da 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -120,22 +120,34 @@ static void test_gmtstr(CuTest *tc) print_time(p, &xt)); } -static void test_localstr(CuTest *tc) +static void test_exp_lt(CuTest *tc) { apr_status_t rv; apr_time_exp_t xt; + struct tm *libc_exp; + time_t now_secs = apr_time_sec(now); rv = apr_time_exp_lt(&xt, now); if (rv == APR_ENOTIMPL) { CuNotImpl(tc, "apr_time_exp_lt"); } - /* XXX: This test is bogus, and a good example of why one never - * runs tests in their own timezone. Of course changing the delta - * has no impact on the resulting time, only the tm_gmtoff. - */ CuAssertTrue(tc, rv == APR_SUCCESS); - CuAssertStrEquals(tc, "2002-08-14 12:05:36.186711 -25200 [257 Sat] DST", - print_time(p, &xt)); + + libc_exp = localtime(&now_secs); + +#define CHK_FIELD(f) \ + CuAssertIntEquals(tc, libc_exp->f, xt.f) + + CHK_FIELD(tm_sec); + CHK_FIELD(tm_min); + CHK_FIELD(tm_hour); + CHK_FIELD(tm_mday); + CHK_FIELD(tm_mon); + CHK_FIELD(tm_year); + CHK_FIELD(tm_wday); + CHK_FIELD(tm_yday); + CHK_FIELD(tm_isdst); +#undef CHK_FIELD } static void test_exp_get_gmt(CuTest *tc) @@ -206,18 +218,19 @@ static void test_rfcstr(CuTest *tc) static void test_ctime(CuTest *tc) { apr_status_t rv; - char str[STR_SIZE]; + char apr_str[STR_SIZE]; + char libc_str[STR_SIZE]; + time_t now_sec = apr_time_sec(now); - /* XXX: This test is bogus, and a good example of why one never - * runs tests in their own timezone. Of course changing the delta - * has no impact on the resulting time, only the tm_gmtoff. - */ - rv = apr_ctime(str, now); + rv = apr_ctime(apr_str, now); if (rv == APR_ENOTIMPL) { CuNotImpl(tc, "apr_ctime"); } CuAssertTrue(tc, rv == APR_SUCCESS); - CuAssertStrEquals(tc, "Sat Sep 14 12:05:36 2002", str); + strcpy(libc_str, ctime(&now_sec)); + *strchr(libc_str, '\n') = '\0'; + + CuAssertStrEquals(tc, libc_str, apr_str); } static void test_strftime(CuTest *tc) @@ -297,7 +310,7 @@ CuSuite *testtime(void) SUITE_ADD_TEST(suite, test_now); SUITE_ADD_TEST(suite, test_gmtstr); - SUITE_ADD_TEST(suite, test_localstr); + SUITE_ADD_TEST(suite, test_exp_lt); SUITE_ADD_TEST(suite, test_exp_get_gmt); SUITE_ADD_TEST(suite, test_exp_get_lt); SUITE_ADD_TEST(suite, test_imp_gmt); From 37f086455dff2ba23293f73ee2f5faf12bbd8340 Mon Sep 17 00:00:00 2001 From: Thom May Date: Sat, 15 Nov 2003 20:08:21 +0000 Subject: [PATCH 4695/7878] Guess not then! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64744 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/STATUS b/STATUS index 181b5d40725..3899d828302 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2003/06/26 18:17:44 $] +Last modified at [$Date: 2003/11/15 20:08:21 $] Release: @@ -48,14 +48,6 @@ RELEASE 1.0 SHOWSTOPPERS: quality code with that many unanswered questions?) If they aren't showstoppers, deprecate them to TODO:s. - * complete the efforts started by DougM for cleaner fn naming - conventions: see proposed name changes in renames_pending - and offer up any additions/vetos/clarifications. - DougM offered to complete the work with his nifty perl rename - script at the hackathon. - Thom says: I think this is close to done; does anyone want to add any - further renames? - CURRENT VOTES: From dc0c08b170b0d90d4022ea7c4485c84e0801101f Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sun, 16 Nov 2003 01:26:07 +0000 Subject: [PATCH 4696/7878] rip git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64746 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_ring.h | 48 ---------------------------------------- locks/beos/thread_cond.c | 5 ----- 2 files changed, 53 deletions(-) diff --git a/include/apr_ring.h b/include/apr_ring.h index c449eaa7675..bc3bb625c7e 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -416,54 +416,6 @@ APR_RING_UNSPLICE((ep), (ep), link) -/** - * Iterate through a ring - * @param ep The current element - * @param hp The ring to iterate over - * @param elem The name of the element struct - * @param link The name of the APR_RING_ENTRY in the element struct - * @remark This is the same as either: - *
    - *	ep = APR_RING_FIRST(hp);
    - * 	while (ep != APR_RING_SENTINEL(hp, elem, link)) {
    - *	    ...
    - * 	    ep = APR_RING_NEXT(ep, link);
    - * 	}
    - *   OR
    - * 	for (ep = APR_RING_FIRST(hp);
    - *           ep != APR_RING_SENTINEL(hp, elem, link);
    - *           ep = APR_RING_NEXT(ep, link)) {
    - *	    ...
    - * 	}
    - * 
    - * @warning Be aware that you cannot change the value of ep within - * the foreach loop, nor can you destroy the ring element it points to. - * Modifying the prev and next pointers of the element is dangerous - * but can be done if you're careful. If you change ep's value or - * destroy the element it points to, then APR_RING_FOREACH - * will have no way to find out what element to use for its next - * iteration. The reason for this can be seen by looking closely - * at the equivalent loops given in the tip above. So, for example, - * if you are writing a loop that empties out a ring one element - * at a time, APR_RING_FOREACH just won't work for you. Do it - * by hand, like so: - *
    - *      while (!APR_RING_EMPTY(hp, elem, link)) {
    - *          ep = APR_RING_FIRST(hp);
    - *          ...
    - *          APR_RING_REMOVE(ep, link);
    - *      }
    - * 
    - * @deprecated This macro causes more headaches than it's worth. Use - * one of the alternatives documented here instead; the clarity gained - * in what's really going on is well worth the extra line or two of code. - * This macro will be removed at some point in the future. - */ -#define APR_RING_FOREACH(ep, hp, elem, link) \ - for ((ep) = APR_RING_FIRST((hp)); \ - (ep) != APR_RING_SENTINEL((hp), elem, link); \ - (ep) = APR_RING_NEXT((ep), link)) - /** * Iterate through a ring backwards * @param ep The current element diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c index 99908faebb8..be5565b88d9 100644 --- a/locks/beos/thread_cond.c +++ b/locks/beos/thread_cond.c @@ -63,11 +63,6 @@ static apr_status_t thread_cond_cleanup(void *data) apr_thread_cond_t *cond = (apr_thread_cond_t *)data; acquire_sem(cond->lock); -/* - APR_RING_FOREACH(w, &cond->alist, waiter_t, link) { - delete_sem(w->sem); - } -*/ delete_sem(cond->lock); return APR_SUCCESS; From bdc4601b0172b4206022d9d522fa2eb97d7c1c42 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 16 Nov 2003 01:33:02 +0000 Subject: [PATCH 4697/7878] axing deprecated apr_atomic_foo functions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64747 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++ atomic/os390/atomic.c | 6 +- atomic/unix/apr_atomic.c | 100 -------------------------- include/apr_atomic.h | 147 ++++++-------------------------------- locks/unix/thread_mutex.c | 10 +-- test/testatomic.c | 117 ++---------------------------- 6 files changed, 40 insertions(+), 346 deletions(-) diff --git a/CHANGES b/CHANGES index 4d623e924ef..a0319a7899a 100644 --- a/CHANGES +++ b/CHANGES @@ -20,6 +20,12 @@ Changes with APR 1.0 apr_allocator_set_max_free -> apr_allocator_max_free_set apr_allocator_set_mutex -> apr_allocator_mutex_set apr_allocator_set_owner -> apr_allocator_owner_set + apr_atomic_add -> apr_atomic_add32 + apr_atomic_cas -> apr_atomic_cas32 + apr_atomic_dec -> apr_atomic_dec32 + apr_atomic_inc -> apr_atomic_inc32 + apr_atomic_read -> apr_atomic_read32 + apr_atomic_set -> apr_atomic_set32 apr_bind -> apr_socket_bind apr_compare_groups -> apr_gid_compare apr_compare_users -> apr_uid_compare diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c index caa1a5e2654..1c6d7db1bfd 100644 --- a/atomic/os390/atomic.c +++ b/atomic/os390/atomic.c @@ -58,7 +58,7 @@ #if APR_HAS_THREADS -apr_int32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_int32_t val) +apr_int32_t apr_atomic_add32(volatile apr_atomic_t *mem, apr_int32_t val) { apr_atomic_t old, new_val; @@ -70,8 +70,8 @@ apr_int32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_int32_t val) return new_val; } -apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem, apr_uint32_t swap, - apr_uint32_t cmp) +apr_uint32_t apr_atomic_cas32(volatile apr_atomic_t *mem, apr_uint32_t swap, + apr_uint32_t cmp) { apr_uint32_t old = cmp; diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 16912b9687d..34ef5427589 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -84,106 +84,6 @@ apr_status_t apr_atomic_init(apr_pool_t *p) } #endif /*!defined(apr_atomic_init) && !defined(APR_OVERRIDE_ATOMIC_INIT) */ -#if !defined(apr_atomic_add) && !defined(APR_OVERRIDE_ATOMIC_ADD) -void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val) -{ -#if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - apr_uint32_t prev; - - if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - prev = *mem; - *mem += val; - apr_thread_mutex_unlock(lock); - } -#else - *mem += val; -#endif /* APR_HAS_THREADS */ -} -#endif /*!defined(apr_atomic_add) && !defined(APR_OVERRIDE_ATOMIC_ADD) */ - -#if !defined(apr_atomic_set) && !defined(APR_OVERRIDE_ATOMIC_SET) -void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val) -{ -#if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - apr_uint32_t prev; - - if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - prev = *mem; - *mem = val; - apr_thread_mutex_unlock(lock); - } -#else - *mem = val; -#endif /* APR_HAS_THREADS */ -} -#endif /*!defined(apr_atomic_set) && !defined(APR_OVERRIDE_ATOMIC_SET) */ - -#if !defined(apr_atomic_inc) && !defined(APR_OVERRIDE_ATOMIC_INC) -void apr_atomic_inc(volatile apr_uint32_t *mem) -{ -#if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - apr_uint32_t prev; - - if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - prev = *mem; - (*mem)++; - apr_thread_mutex_unlock(lock); - } -#else - (*mem)++; -#endif /* APR_HAS_THREADS */ -} -#endif /*!defined(apr_atomic_inc) && !defined(APR_OVERRIDE_ATOMIC_INC) */ - -#if !defined(apr_atomic_dec) && !defined(APR_OVERRIDE_ATOMIC_DEC) -int apr_atomic_dec(volatile apr_atomic_t *mem) -{ -#if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - apr_uint32_t new; - - if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - (*mem)--; - new = *mem; - apr_thread_mutex_unlock(lock); - return new; - } -#else - (*mem)--; -#endif /* APR_HAS_THREADS */ - return *mem; -} -#endif /*!defined(apr_atomic_dec) && !defined(APR_OVERRIDE_ATOMIC_DEC) */ - -#if !defined(apr_atomic_cas) && !defined(APR_OVERRIDE_ATOMIC_CAS) -apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp) -{ - long prev; -#if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - - if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - prev = *(long*)mem; - if (prev == cmp) { - *(long*)mem = with; - } - apr_thread_mutex_unlock(lock); - return prev; - } - return *(long*)mem; -#else - prev = *(long*)mem; - if (prev == cmp) { - *(long*)mem = with; - } - return prev; -#endif /* APR_HAS_THREADS */ -} -#endif /*!defined(apr_atomic_cas) && !defined(APR_OVERRIDE_ATOMIC_CAS) */ - #if !defined(apr_atomic_add32) && !defined(APR_OVERRIDE_ATOMIC_ADD32) void apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { diff --git a/include/apr_atomic.h b/include/apr_atomic.h index d575b54473d..21ceb9f8158 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -99,57 +99,6 @@ typedef apr_atomic_t; * @return APR_SUCCESS on successful completion */ apr_status_t apr_atomic_init(apr_pool_t *p); -/** - * read the value stored in a atomic variable - * @param mem the pointer - * @warning on certain platforms this number is not stored - * directly in the pointer. in others it is - * @deprecated - */ -apr_uint32_t apr_atomic_read(volatile apr_atomic_t *mem); -/** - * set the value for atomic. - * @param mem the pointer - * @param val the value - * @deprecated - */ -void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val); -/** - * Add 'val' to the atomic variable - * @param mem pointer to the atomic value - * @param val the addition - * @deprecated - */ -void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val); - -/** - * increment the atomic variable by 1 - * @param mem pointer to the atomic value - * @deprecated - */ -void apr_atomic_inc(volatile apr_atomic_t *mem); - -/** - * decrement the atomic variable by 1 - * @param mem pointer to the atomic value - * @return zero if the value is zero, otherwise non-zero - * @deprecated - */ -int apr_atomic_dec(volatile apr_atomic_t *mem); - -/** - * compare the atomic's value with cmp. - * If they are the same swap the value with 'with' - * @param mem pointer to the atomic value - * @param with what to swap it with - * @param cmp the value to compare it to - * @return the old value of the atomic - * @warning do not mix apr_atomic's with the CAS function. - * @deprecated - * on some platforms they may be implemented by different mechanisms - */ -apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp); - /* * Atomic operations on 32-bit values @@ -238,12 +187,6 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); #define apr_atomic_t LONG #define apr_atomic_init(pool) APR_SUCCESS -#define apr_atomic_add(mem, val) InterlockedExchangeAdd(mem,val) -#define apr_atomic_inc(mem) InterlockedIncrement(mem) -#define apr_atomic_dec(mem) InterlockedDecrement(mem) -#define apr_atomic_set(mem, val) InterlockedExchange(mem, val) -#define apr_atomic_read(mem) (*mem) -#define apr_atomic_cas(mem,with,cmp) InterlockedCompareExchange(mem,with,cmp) #define apr_atomic_casptr(mem,with,cmp) InterlockedCompareExchangePointer(mem,with,cmp) /* @@ -311,13 +254,6 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) return (void*)atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with); } -#define apr_atomic_read(mem) apr_atomic_read32(mem) -#define apr_atomic_set(mem, val) apr_atomic_set32(mem, val) -#define apr_atomic_add(mem, val) apr_atomic_add32(mem,val) -#define apr_atomic_inc(mem) apr_atomic_inc32(mem) -#define apr_atomic_dec(mem) apr_atomic_dec32(mem) -#define apr_atomic_cas(mem,with,cmp) apr_atomic_cas32(mem,with,cmp) - #define APR_OVERRIDE_ATOMIC_READ 1 #define APR_OVERRIDE_ATOMIC_SET 1 #define APR_OVERRIDE_ATOMIC_ADD 1 @@ -328,23 +264,17 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) #elif defined(__FreeBSD__) && !defined(__i386__) #define apr_atomic_t apr_uint32_t -#define apr_atomic_add(mem, val) atomic_add_int(mem,val) -#define apr_atomic_dec(mem) atomic_subtract_int(mem,1) -#define apr_atomic_inc(mem) atomic_add_int(mem,1) -#define apr_atomic_set(mem, val) atomic_set_int(mem, val) -#define apr_atomic_read(mem) (*mem) - -#define apr_atomic_add32(mem, val) apr_atomic_add(mem, val) -#define apr_atomic_dec32(mem) apr_atomic_dec(mem) -#define apr_atomic_inc32(mem) apr_atomic_inc(mem) -#define apr_atomic_set32(mem, val) apr_atomic_set(mem, val) -#define apr_atomic_read32(mem) apr_atomic_read(mem) +#define apr_atomic_add32(mem, val) atomic_add_int(mem,val) +#define apr_atomic_dec32(mem) atomic_subtract_int(mem,1) +#define apr_atomic_inc32(mem) atomic_add_int(mem,1) +#define apr_atomic_set32(mem, val) atomic_set_int(mem, val) +#define apr_atomic_read32(mem) (*mem) #elif (defined(__linux__) || defined(__EMX__) || defined(__FreeBSD__)) \ && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC #define apr_atomic_t apr_uint32_t -#define apr_atomic_cas(mem,with,cmp) \ +#define apr_atomic_cas32(mem,with,cmp) \ ({ apr_atomic_t prev; \ asm volatile ("lock; cmpxchgl %1, %2" \ : "=a" (prev) \ @@ -352,19 +282,19 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) : "memory"); \ prev;}) -#define apr_atomic_add(mem, val) \ +#define apr_atomic_add32(mem, val) \ asm volatile ("lock; addl %1, %0" \ : \ : "m" (*(mem)), "r" (val) \ : "memory") -#define apr_atomic_sub(mem, val) \ +#define apr_atomic_sub32(mem, val) \ asm volatile ("lock; subl %1, %0" \ : \ : "m" (*(mem)), "r" (val) \ : "memory") -#define apr_atomic_dec(mem) \ +#define apr_atomic_dec32(mem) \ ({ int prev; \ asm volatile ("mov $0, %%eax;\n\t" \ "lock; decl %1;\n\t" \ @@ -375,22 +305,14 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) : "memory", "%eax"); \ prev;}) -#define apr_atomic_inc(mem) \ +#define apr_atomic_inc32(mem) \ asm volatile ("lock; incl %0" \ : \ : "m" (*(mem)) \ : "memory") -#define apr_atomic_set(mem, val) (*(mem) = val) -#define apr_atomic_read(mem) (*(mem)) - -#define apr_atomic_cas32(mem, with, cmp) apr_atomic_cas(mem, with, cmp) -#define apr_atomic_add32(mem, val) apr_atomic_add(mem, val) -#define apr_atomic_sub32(mem, val) apr_atomic_sub(mem, val) -#define apr_atomic_dec32(mem) apr_atomic_dec(mem) -#define apr_atomic_inc32(mem) apr_atomic_inc(mem) -#define apr_atomic_set32(mem, val) apr_atomic_set(mem, val) -#define apr_atomic_read32(mem) apr_atomic_read(mem) +#define apr_atomic_set32(mem, val) (*(mem) = val) +#define apr_atomic_read32(mem) (*(mem)) #define apr_atomic_xchg32(mem,val) \ ({ apr_uint32_t prev = val; \ @@ -406,14 +328,14 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) #define apr_atomic_t cs_t -apr_int32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_int32_t val); -apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem, apr_uint32_t swap, - apr_uint32_t cmp); +apr_int32_t apr_atomic_add32(volatile apr_atomic_t *mem, apr_int32_t val); +apr_uint32_t apr_atomic_cas32(volatile apr_atomic_t *mem, apr_uint32_t swap, + apr_uint32_t cmp); #define APR_OVERRIDE_ATOMIC_ADD 1 #define APR_OVERRIDE_ATOMIC_CAS 1 -#define apr_atomic_inc(mem) apr_atomic_add(mem, 1) -#define apr_atomic_dec(mem) apr_atomic_add(mem, -1) +#define apr_atomic_inc32(mem) apr_atomic_add32(mem, 1) +#define apr_atomic_dec32(mem) apr_atomic_add32(mem, -1) /*#define apr_atomic_init(pool) APR_SUCCESS*/ /* warning: the following two operations, _read and _set, are atomic @@ -425,8 +347,8 @@ apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem, apr_uint32_t swap, * variables with other apr_atomic_* operations on OS/390. */ -#define apr_atomic_read(p) (*p) -#define apr_atomic_set(mem, val) (*mem = val) +#define apr_atomic_read32(p) (*p) +#define apr_atomic_set32(mem, val) (*mem = val) #endif /* end big if-elseif switch for platform-specifics */ @@ -449,35 +371,6 @@ apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem, apr_uint32_t swap, apr_status_t apr_atomic_init(apr_pool_t *p); #endif -#if !defined(apr_atomic_read) && !defined(APR_OVERRIDE_ATOMIC_READ) -#define apr_atomic_read(p) *p -#endif - -#if !defined(apr_atomic_set) && !defined(APR_OVERRIDE_ATOMIC_SET) -void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val); -#define APR_ATOMIC_NEED_DEFAULT_INIT 1 -#endif - -#if !defined(apr_atomic_add) && !defined(APR_OVERRIDE_ATOMIC_ADD) -void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val); -#define APR_ATOMIC_NEED_DEFAULT_INIT 1 -#endif - -#if !defined(apr_atomic_inc) && !defined(APR_OVERRIDE_ATOMIC_INC) -void apr_atomic_inc(volatile apr_atomic_t *mem); -#define APR_ATOMIC_NEED_DEFAULT_INIT 1 -#endif - -#if !defined(apr_atomic_dec) && !defined(APR_OVERRIDE_ATOMIC_DEC) -int apr_atomic_dec(volatile apr_atomic_t *mem); -#define APR_ATOMIC_NEED_DEFAULT_INIT 1 -#endif - -#if !defined(apr_atomic_cas) && !defined(APR_OVERRIDE_ATOMIC_CAS) -apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); -#define APR_ATOMIC_NEED_DEFAULT_INIT 1 -#endif - #if !defined(apr_atomic_read32) && !defined(APR_OVERRIDE_ATOMIC_READ32) #define apr_atomic_read32(p) *p #endif @@ -520,7 +413,7 @@ apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val); #if !defined(apr_atomic_casptr) && !defined(APR_OVERRIDE_ATOMIC_CASPTR) #if APR_SIZEOF_VOIDP == 4 -#define apr_atomic_casptr(mem, with, cmp) (void *)apr_atomic_cas((apr_uint32_t *)(mem), (long)(with), (long)cmp) +#define apr_atomic_casptr(mem, with, cmp) (void *)apr_atomic_cas32((apr_uint32_t *)(mem), (long)(with), (long)cmp) #else void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); #define APR_ATOMIC_NEED_DEFAULT_INIT 1 diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index db637cdf0da..306b021746d 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -114,7 +114,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) * testing the mutex is owned by this thread, so a deadlock is expected. */ if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { - apr_atomic_inc(&mutex->owner_ref); + apr_atomic_inc32(&mutex->owner_ref); return APR_SUCCESS; } @@ -126,7 +126,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) return rv; } - if (apr_atomic_cas(&mutex->owner_ref, 1, 0) != 0) { + if (apr_atomic_cas32(&mutex->owner_ref, 1, 0) != 0) { /* The owner_ref should be zero when the lock is not held, * if owner_ref was non-zero we have a mutex reference bug. * XXX: so now what? @@ -162,7 +162,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) * the trylock. */ if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { - apr_atomic_inc(&mutex->owner_ref); + apr_atomic_inc32(&mutex->owner_ref); return APR_SUCCESS; } @@ -174,7 +174,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) return (rv == EBUSY) ? APR_EBUSY : rv; } - if (apr_atomic_cas(&mutex->owner_ref, 1, 0) != 0) { + if (apr_atomic_cas32(&mutex->owner_ref, 1, 0) != 0) { /* The owner_ref should be zero when the lock is not held, * if owner_ref was non-zero we have a mutex reference bug. * XXX: so now what? @@ -215,7 +215,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) return APR_EINVAL; } - if (apr_atomic_dec(&mutex->owner_ref) != 0) + if (apr_atomic_dec32(&mutex->owner_ref) != 0) return APR_SUCCESS; mutex->owner = 0; } diff --git a/test/testatomic.c b/test/testatomic.c index 2ad4a743b0d..22e613b69ba 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -72,99 +72,6 @@ apr_pool_t *context; apr_atomic_t y; /* atomic locks */ apr_uint32_t y32; -static apr_status_t check_basic_atomics(void) -{ - apr_atomic_t oldval; - apr_uint32_t casval = 0; - float object1, object2; - void *casptr; - void *oldptr; - - apr_atomic_set(&y, 2); - printf("%-60s", "testing apr_atomic_dec"); - if (apr_atomic_dec(&y) == 0) { - fprintf(stderr, "Failed\noldval =%d should not be zero\n", - apr_atomic_read(&y)); - return APR_EGENERAL; - } - if (apr_atomic_dec(&y) != 0) { - fprintf(stderr, "Failed\noldval =%d should be zero\n", - apr_atomic_read(&y)); - return APR_EGENERAL; - } - printf("OK\n"); - - printf("%-60s", "testing CAS"); - oldval = apr_atomic_cas(&casval, 12, 0); - if (oldval != 0) { - fprintf(stderr, "Failed\noldval =%d should be zero\n", oldval); - return APR_EGENERAL; - } - printf("OK\n"); - printf("%-60s", "testing CAS - match non-null"); - oldval = apr_atomic_cas(&casval, 23, 12); - if (oldval != 12) { - fprintf(stderr, "Failed\noldval =%d should be 12 y=%d\n", - oldval, casval); - return APR_EGENERAL; - } - printf("OK\n"); - printf("%-60s", "testing CAS - no match"); - oldval = apr_atomic_cas(&casval, 23, 12); - if (oldval != 23) { - fprintf(stderr, "Failed\noldval =%d should be 23 y=%d\n", - oldval, casval); - return APR_EGENERAL; - } - printf("OK\n"); - - printf("%-60s", "testing CAS for pointers"); - casptr = NULL; - oldptr = apr_atomic_casptr(&casptr, &object1, 0); - if (oldptr != 0) { - fprintf(stderr, "Failed\noldval =%p should be zero\n", oldptr); - return APR_EGENERAL; - } - printf("OK\n"); - printf("%-60s", "testing CAS for pointers - match non-null"); - oldptr = apr_atomic_casptr(&casptr, &object2, &object1); - if (oldptr != &object1) { - fprintf(stderr, "Failed\noldval =%p should be %p\n", oldptr, &object1); - return APR_EGENERAL; - } - printf("OK\n"); - printf("%-60s", "testing CAS for pointers - no match"); - oldptr = apr_atomic_casptr(&casptr, &object2, &object1); - if (oldptr != &object2) { - fprintf(stderr, "Failed\noldval =%p should be %p\n", oldptr, &object2); - return APR_EGENERAL; - } - printf("OK\n"); - - printf("%-60s", "testing add"); - apr_atomic_set(&y, 23); - apr_atomic_add(&y, 4); - if ((oldval = apr_atomic_read(&y)) != 27) { - fprintf(stderr, - "Failed\nAtomic Add doesn't add up ;( expected 27 got %d\n", - oldval); - return APR_EGENERAL; - } - - printf("OK\n"); - printf("%-60s", "testing add/inc"); - apr_atomic_set(&y, 0); - apr_atomic_add(&y, 20); - apr_atomic_inc(&y); - if (apr_atomic_read(&y) != 21) { - fprintf(stderr, "Failed.\natomics do not add up\n"); - return APR_EGENERAL; - } - fprintf(stdout, "OK\n"); - - return APR_SUCCESS; -} - static apr_status_t check_basic_atomics32(void) { apr_uint32_t oldval; @@ -267,11 +174,6 @@ int main(void) fprintf(stderr, "Failed.\nCould not initialize atomics\n"); exit(-1); } - rv = check_basic_atomics(); - if (rv != APR_SUCCESS) { - fprintf(stderr, "Failed.\n"); - exit(-1); - } rv = check_basic_atomics32(); if (rv != APR_SUCCESS) { @@ -312,10 +214,10 @@ void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data) int i; for (i = 0; i < NUM_ITERATIONS ; i++) { - apr_atomic_inc(&y); - apr_atomic_add(&y, 2); - apr_atomic_dec(&y); - apr_atomic_dec(&y); + apr_atomic_inc32(&y); + apr_atomic_add32(&y, 2); + apr_atomic_dec32(&y); + apr_atomic_dec32(&y); } apr_thread_exit(thd, exit_ret_val); return NULL; @@ -384,13 +286,6 @@ int main(int argc, char**argv) } printf("OK\n"); - rv = check_basic_atomics(); - if (rv != APR_SUCCESS) { - fprintf(stderr, "Failed.\n"); - exit(-1); - } - apr_atomic_set(&y, 0); - rv = check_basic_atomics32(); if (rv != APR_SUCCESS) { fprintf(stderr, "Failed.\n"); @@ -444,11 +339,11 @@ int main(int argc, char**argv) } else { printf("%-60s", "Checking if atomic worked"); - if (apr_atomic_read(&y) != NUM_THREADS * NUM_ITERATIONS) { + if (apr_atomic_read32(&y) != NUM_THREADS * NUM_ITERATIONS) { fflush(stdout); fprintf(stderr, "No!\nThe atomics didn't work?? y = %ld instead of %ld\n", - (long)apr_atomic_read(&y), + (long)apr_atomic_read32(&y), (long)NUM_THREADS * NUM_ITERATIONS); } else { From a16e0c254c6fc5b8a4e03659c8fc5a0fb485f12c Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sun, 16 Nov 2003 01:42:50 +0000 Subject: [PATCH 4698/7878] rip git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64748 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_ring.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/include/apr_ring.h b/include/apr_ring.h index bc3bb625c7e..e25cc437c14 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -416,20 +416,6 @@ APR_RING_UNSPLICE((ep), (ep), link) -/** - * Iterate through a ring backwards - * @param ep The current element - * @param hp The ring to iterate over - * @param elem The name of the element struct - * @param link The name of the APR_RING_ENTRY in the element struct - * @see APR_RING_FOREACH - */ -#define APR_RING_FOREACH_REVERSE(ep, hp, elem, link) \ - for ((ep) = APR_RING_LAST((hp)); \ - (ep) != APR_RING_SENTINEL((hp), elem, link); \ - (ep) = APR_RING_PREV((ep), link)) - - /* Debugging tools: */ #ifdef APR_RING_DEBUG From 55da776ed0c86b4f1591a4585efc97055e5f3bd8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 16 Nov 2003 18:25:00 +0000 Subject: [PATCH 4699/7878] thread id is not always a scalar git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64749 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_mutex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 306b021746d..9f0d7cc5063 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -199,6 +199,8 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) return rv; } +static apr_os_thread_t invalid_thread_id; /* all zeroes */ + APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { apr_status_t status; @@ -217,7 +219,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) if (apr_atomic_dec32(&mutex->owner_ref) != 0) return APR_SUCCESS; - mutex->owner = 0; + mutex->owner = invalid_thread_id; } /* * This should never occur, and indicates an application error From 3462f6f0e91fa861ac76772d598f1f6847a1cfe7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 16 Nov 2003 20:09:45 +0000 Subject: [PATCH 4700/7878] Correct misdeclaration of Win32 type remapping function typedefs. Be pedantic in protecting some macro arguments, fix odd typos, and use InterlockedExchangeAdd(*foo, -bar) for subtraction. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64750 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 21ceb9f8158..14f39c9967d 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -193,28 +193,28 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); * Remapping function pointer type to accept apr_uint32_t's type-safely * as the arguments for as our apr_atomic_foo32 Functions */ -typedef WINBASEAPI apr_uint32_t (WINAPI apr_atomic_win32_ptr_fn) +typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_fn) (apr_uint32_t volatile *); -typedef WINBASEAPI apr_uint32_t (WINAPI apr_atomic_win32_ptr_val_fn) +typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_fn) (apr_uint32_t volatile *, apr_uint32_t); -typedef WINBASEAPI apr_uint32_t (WINAPI apr_atomic_win32_ptr_val_val_fn) +typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_val_fn) (apr_uint32_t volatile *, apr_uint32_t, apr_uint32_t); #define apr_atomic_add32(mem, val) \ ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem,val) #define apr_atomic_sub32(mem, val) \ - ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeSub)(mem,val) + ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem,-(val)) #define apr_atomic_inc32(mem) \ ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem) #define apr_atomic_dec32(mem) \ ((apr_atomic_win32_ptr_fn)InterlockedDecrement)(mem) #define apr_atomic_set32(mem, val) \ ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem,val) -#define apr_atomic_read32(mem) (*mem) +#define apr_atomic_read32(mem) (*(mem)) #define apr_atomic_cas32(mem,with,cmp) \ - ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem,val) + ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem,with,cmp) #define apr_atomic_xchg32(mem,val) \ ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem,val) From da159cb4a9c16147478d7a653bbb150ebd148c0a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 16 Nov 2003 23:49:15 +0000 Subject: [PATCH 4701/7878] With the exception of some intersting(1) output from testall random2, Win32 APR1.0 now builds with apr_random. Required us to compliment APR_INT64_C with a corresponding APR_UINT64_C, and finish up Brad's efforts to APR_DECLARE() the various entry points. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64751 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 16 ++++++ configure.in | 7 +++ include/apr.h.in | 1 + include/apr.hnw | 4 +- include/apr.hw | 1 + include/apr_random.h | 20 ++++--- random/unix/apr_random.c | 34 ++++++----- random/unix/sha2.c | 120 +++++++++++++++++++-------------------- random/unix/sha2_glue.c | 2 +- test/Makefile.win | 2 +- test/testall.dsp | 4 ++ test/testrand2.c | 2 +- 12 files changed, 127 insertions(+), 86 deletions(-) diff --git a/apr.dsp b/apr.dsp index 0693a1862e0..5dd315d12dc 100644 --- a/apr.dsp +++ b/apr.dsp @@ -297,6 +297,22 @@ SOURCE=.\network_io\win32\sockopt.c SOURCE=.\passwd\apr_getpass.c # End Source File # End Group +# Begin Group "random" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\random\unix\apr_random.c +# End Source File +# Begin Source File + +SOURCE=.\random\unix\sha2.c +# End Source File +# Begin Source File + +SOURCE=.\random\unix\sha2_glue.c +# End Source File +# End Group # Begin Group "shmem" # PROP Default_Filter "" diff --git a/configure.in b/configure.in index 16f0776eea8..d2636083f2f 100644 --- a/configure.in +++ b/configure.in @@ -1051,6 +1051,7 @@ fi # The first match is our preference. if test "$ac_cv_sizeof_int" = "8"; then int64_literal='#define APR_INT64_C(val) (val)' + uint64_literal='#define APR_UINT64_C(val) (val)' int64_t_fmt='#define APR_INT64_T_FMT "d"' uint64_t_fmt='#define APR_UINT64_T_FMT "u"' uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "x"' @@ -1059,6 +1060,7 @@ if test "$ac_cv_sizeof_int" = "8"; then int64_strfn="strtoi" elif test "$ac_cv_sizeof_long" = "8"; then int64_literal='#define APR_INT64_C(val) (val##L)' + uint64_literal='#define APR_UINT64_C(val) (val##UL)' int64_t_fmt='#define APR_INT64_T_FMT "ld"' uint64_t_fmt='#define APR_UINT64_T_FMT "lu"' uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "lx"' @@ -1067,6 +1069,7 @@ elif test "$ac_cv_sizeof_long" = "8"; then int64_strfn="strtol" elif test "$ac_cv_sizeof_long_long" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LL)' + uint64_literal='#define APR_UINT64_C(val) (val##ULL)' # Linux, Solaris, FreeBSD all support ll with printf. # BSD 4.4 originated 'q'. Solaris is more popular and # doesn't support 'q'. Solaris wins. Exceptions can @@ -1079,6 +1082,7 @@ elif test "$ac_cv_sizeof_long_long" = "8"; then int64_strfn="strtoll" elif test "$ac_cv_sizeof_long_double" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LD)' + uint64_literal='#define APR_UINT64_C(val) (val##ULD)' int64_t_fmt='#define APR_INT64_T_FMT "Ld"' uint64_t_fmt='#define APR_UINT64_T_FMT "Lu"' uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "Lx"' @@ -1087,6 +1091,7 @@ elif test "$ac_cv_sizeof_long_double" = "8"; then int64_strfn="strtoll" elif test "$ac_cv_sizeof_longlong" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LL)' + uint64_literal='#define APR_UINT64_C(val) (val##ULL)' int64_t_fmt='#define APR_INT64_T_FMT "qd"' uint64_t_fmt='#define APR_UINT64_T_FMT "qu"' uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "qx"' @@ -1116,6 +1121,7 @@ YES_IS_DEFINED if test "$apr_cv_define_INT64_C" = "yes"; then int64_literal='#define APR_INT64_C(val) INT64_C(val)' + uint64_literal='#define APR_UINT64_C(val) UINT64_C(val##U)' stdint=1 else stdint=0 @@ -1249,6 +1255,7 @@ AC_SUBST(size_t_fmt) AC_SUBST(off_t_fmt) AC_SUBST(pid_t_fmt) AC_SUBST(int64_literal) +AC_SUBST(uint64_literal) AC_SUBST(stdint) AC_SUBST(bigendian) diff --git a/include/apr.h.in b/include/apr.h.in index 3baa97bf9d7..8f92bb4ce40 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -310,6 +310,7 @@ typedef @socklen_t_value@ apr_socklen_t; /* Mechanisms to properly type numeric literals */ @int64_literal@ +@uint64_literal@ /* Definitions that APR programs need to work properly. */ diff --git a/include/apr.hnw b/include/apr.hnw index 1d19892ec74..4345e309869 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -274,9 +274,11 @@ typedef int apr_socklen_t; /* Mechanisms to properly type numeric literals */ #ifdef __GNUC__ -#define APR_INT64_C(val) (val) +#define APR_INT64_C(val) (val##LL) +#define APR_UINT64_C(val) (val##ULL) #else #define APR_INT64_C(val) (val##i64) +#define APR_UINT64_C(val) (val##Ui64) #endif /* PROC mutex is a GLOBAL mutex on Netware */ diff --git a/include/apr.hw b/include/apr.hw index 1ba302b319e..d8b9fff4a14 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -388,6 +388,7 @@ typedef int gid_t; /* Mechanisms to properly type numeric literals */ #define APR_INT64_C(val) (val##i64) +#define APR_UINT64_C(val) (val##Ui64) #if APR_HAVE_IPV6 diff --git a/include/apr_random.h b/include/apr_random.h index ab77c5a459c..4cd72956461 100644 --- a/include/apr_random.h +++ b/include/apr_random.h @@ -79,15 +79,19 @@ APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p); typedef struct apr_random_t apr_random_t; APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p, - apr_crypto_hash_t *pool_hash,apr_crypto_hash_t *key_hash, - apr_crypto_hash_t *prng_hash); + apr_crypto_hash_t *pool_hash, + apr_crypto_hash_t *key_hash, + apr_crypto_hash_t *prng_hash); APR_DECLARE(apr_random_t *) apr_random_standard_new(apr_pool_t *p); -APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g,const void *entropy_, - apr_size_t bytes); -APR_DECLARE(apr_status_t) apr_random_insecure_bytes(apr_random_t *g,void *random, - apr_size_t bytes); -APR_DECLARE(apr_status_t) apr_random_secure_bytes(apr_random_t *g,void *random, - apr_size_t bytes); +APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g, + const void *entropy_, + apr_size_t bytes); +APR_DECLARE(apr_status_t) apr_random_insecure_bytes(apr_random_t *g, + void *random, + apr_size_t bytes); +APR_DECLARE(apr_status_t) apr_random_secure_bytes(apr_random_t *g, + void *random, + apr_size_t bytes); APR_DECLARE(void) apr_random_barrier(apr_random_t *g); APR_DECLARE(apr_status_t) apr_random_secure_ready(apr_random_t *r); APR_DECLARE(apr_status_t) apr_random_insecure_ready(apr_random_t *r); diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c index 64cd455e9e6..fc254fb1d60 100644 --- a/random/unix/apr_random.c +++ b/random/unix/apr_random.c @@ -61,6 +61,9 @@ #include "apr_thread_proc.h" #include +#ifdef min +#undef min +#endif #define min(a,b) ((a) < (b) ? (a) : (b)) #define APR_RANDOM_DEFAULT_POOLS 32 @@ -118,9 +121,10 @@ struct apr_random_t { static apr_random_t *all_random; -void apr_random_init(apr_random_t *g,apr_pool_t *p, - apr_crypto_hash_t *pool_hash,apr_crypto_hash_t *key_hash, - apr_crypto_hash_t *prng_hash) +APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p, + apr_crypto_hash_t *pool_hash, + apr_crypto_hash_t *key_hash, + apr_crypto_hash_t *prng_hash) { int n; @@ -185,7 +189,7 @@ static void mixer(apr_random_t *g,pid_t pid) g->random_bytes = 0; } -void apr_random_after_fork(apr_proc_t *proc) +APR_DECLARE(void) apr_random_after_fork(apr_proc_t *proc) { apr_random_t *r; @@ -193,7 +197,7 @@ void apr_random_after_fork(apr_proc_t *proc) mixer(r,proc->pid); } -apr_random_t *apr_random_standard_new(apr_pool_t *p) +APR_DECLARE(apr_random_t *) apr_random_standard_new(apr_pool_t *p) { apr_random_t *r = apr_palloc(p,sizeof *r); @@ -231,8 +235,8 @@ static void rekey(apr_random_t *g) } } -void apr_random_add_entropy(apr_random_t *g,const void *entropy_, - apr_size_t bytes) +APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g,const void *entropy_, + apr_size_t bytes) { int n; const unsigned char *entropy = entropy_; @@ -293,8 +297,9 @@ static void apr_random_bytes(apr_random_t *g,unsigned char *random, } } -apr_status_t apr_random_secure_bytes(apr_random_t *g,void *random, - apr_size_t bytes) +APR_DECLARE(apr_status_t) apr_random_secure_bytes(apr_random_t *g, + void *random, + apr_size_t bytes) { if (!g->secure_started) return APR_ENOTENOUGHENTROPY; @@ -302,8 +307,9 @@ apr_status_t apr_random_secure_bytes(apr_random_t *g,void *random, return APR_SUCCESS; } -apr_status_t apr_random_insecure_bytes(apr_random_t *g,void *random, - apr_size_t bytes) +APR_DECLARE(apr_status_t) apr_random_insecure_bytes(apr_random_t *g, + void *random, + apr_size_t bytes) { if (!g->insecure_started) return APR_ENOTENOUGHENTROPY; @@ -311,20 +317,20 @@ apr_status_t apr_random_insecure_bytes(apr_random_t *g,void *random, return APR_SUCCESS; } -void apr_random_barrier(apr_random_t *g) +APR_DECLARE(void) apr_random_barrier(apr_random_t *g) { g->secure_started = 0; g->secure_base = g->generation; } -apr_status_t apr_random_secure_ready(apr_random_t *r) +APR_DECLARE(apr_status_t) apr_random_secure_ready(apr_random_t *r) { if (!r->secure_started) return APR_ENOTENOUGHENTROPY; return APR_SUCCESS; } -apr_status_t apr_random_insecure_ready(apr_random_t *r) +APR_DECLARE(apr_status_t) apr_random_insecure_ready(apr_random_t *r) { if (!r->insecure_started) return APR_ENOTENOUGHENTROPY; diff --git a/random/unix/sha2.c b/random/unix/sha2.c index d312d041ad8..90acf1175ad 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -104,10 +104,10 @@ typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ #define REVERSE64(w,x) { \ sha2_word64 tmp = (w); \ tmp = (tmp >> 32) | (tmp << 32); \ - tmp = ((tmp & 0xff00ff00ff00ff00ULL) >> 8) | \ - ((tmp & 0x00ff00ff00ff00ffULL) << 8); \ - (x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \ - ((tmp & 0x0000ffff0000ffffULL) << 16); \ + tmp = ((tmp & APR_UINT64_C(0xff00ff00ff00ff00)) >> 8) | \ + ((tmp & APR_UINT64_C(0x00ff00ff00ff00ff)) << 8); \ + (x) = ((tmp & APR_UINT64_C(0xffff0000ffff0000)) >> 16) | \ + ((tmp & APR_UINT64_C(0x0000ffff0000ffff)) << 16); \ } #endif /* !APR_IS_BIGENDIAN */ @@ -228,70 +228,70 @@ const static sha2_word32 sha256_initial_hash_value[8] = { /* Hash constant words K for SHA-384 and SHA-512: */ const static sha2_word64 K512[80] = { - 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, - 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, - 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, - 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, - 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, - 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, - 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, - 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, - 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, - 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, - 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, - 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, - 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, - 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, - 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, - 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, - 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, - 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, - 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, - 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, - 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, - 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, - 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, - 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, - 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, - 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, - 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, - 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, - 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, - 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, - 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, - 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, - 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, - 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, - 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, - 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, - 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, - 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, - 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, - 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL + APR_UINT64_C(0x428a2f98d728ae22), APR_UINT64_C(0x7137449123ef65cd), + APR_UINT64_C(0xb5c0fbcfec4d3b2f), APR_UINT64_C(0xe9b5dba58189dbbc), + APR_UINT64_C(0x3956c25bf348b538), APR_UINT64_C(0x59f111f1b605d019), + APR_UINT64_C(0x923f82a4af194f9b), APR_UINT64_C(0xab1c5ed5da6d8118), + APR_UINT64_C(0xd807aa98a3030242), APR_UINT64_C(0x12835b0145706fbe), + APR_UINT64_C(0x243185be4ee4b28c), APR_UINT64_C(0x550c7dc3d5ffb4e2), + APR_UINT64_C(0x72be5d74f27b896f), APR_UINT64_C(0x80deb1fe3b1696b1), + APR_UINT64_C(0x9bdc06a725c71235), APR_UINT64_C(0xc19bf174cf692694), + APR_UINT64_C(0xe49b69c19ef14ad2), APR_UINT64_C(0xefbe4786384f25e3), + APR_UINT64_C(0x0fc19dc68b8cd5b5), APR_UINT64_C(0x240ca1cc77ac9c65), + APR_UINT64_C(0x2de92c6f592b0275), APR_UINT64_C(0x4a7484aa6ea6e483), + APR_UINT64_C(0x5cb0a9dcbd41fbd4), APR_UINT64_C(0x76f988da831153b5), + APR_UINT64_C(0x983e5152ee66dfab), APR_UINT64_C(0xa831c66d2db43210), + APR_UINT64_C(0xb00327c898fb213f), APR_UINT64_C(0xbf597fc7beef0ee4), + APR_UINT64_C(0xc6e00bf33da88fc2), APR_UINT64_C(0xd5a79147930aa725), + APR_UINT64_C(0x06ca6351e003826f), APR_UINT64_C(0x142929670a0e6e70), + APR_UINT64_C(0x27b70a8546d22ffc), APR_UINT64_C(0x2e1b21385c26c926), + APR_UINT64_C(0x4d2c6dfc5ac42aed), APR_UINT64_C(0x53380d139d95b3df), + APR_UINT64_C(0x650a73548baf63de), APR_UINT64_C(0x766a0abb3c77b2a8), + APR_UINT64_C(0x81c2c92e47edaee6), APR_UINT64_C(0x92722c851482353b), + APR_UINT64_C(0xa2bfe8a14cf10364), APR_UINT64_C(0xa81a664bbc423001), + APR_UINT64_C(0xc24b8b70d0f89791), APR_UINT64_C(0xc76c51a30654be30), + APR_UINT64_C(0xd192e819d6ef5218), APR_UINT64_C(0xd69906245565a910), + APR_UINT64_C(0xf40e35855771202a), APR_UINT64_C(0x106aa07032bbd1b8), + APR_UINT64_C(0x19a4c116b8d2d0c8), APR_UINT64_C(0x1e376c085141ab53), + APR_UINT64_C(0x2748774cdf8eeb99), APR_UINT64_C(0x34b0bcb5e19b48a8), + APR_UINT64_C(0x391c0cb3c5c95a63), APR_UINT64_C(0x4ed8aa4ae3418acb), + APR_UINT64_C(0x5b9cca4f7763e373), APR_UINT64_C(0x682e6ff3d6b2b8a3), + APR_UINT64_C(0x748f82ee5defb2fc), APR_UINT64_C(0x78a5636f43172f60), + APR_UINT64_C(0x84c87814a1f0ab72), APR_UINT64_C(0x8cc702081a6439ec), + APR_UINT64_C(0x90befffa23631e28), APR_UINT64_C(0xa4506cebde82bde9), + APR_UINT64_C(0xbef9a3f7b2c67915), APR_UINT64_C(0xc67178f2e372532b), + APR_UINT64_C(0xca273eceea26619c), APR_UINT64_C(0xd186b8c721c0c207), + APR_UINT64_C(0xeada7dd6cde0eb1e), APR_UINT64_C(0xf57d4f7fee6ed178), + APR_UINT64_C(0x06f067aa72176fba), APR_UINT64_C(0x0a637dc5a2c898a6), + APR_UINT64_C(0x113f9804bef90dae), APR_UINT64_C(0x1b710b35131c471b), + APR_UINT64_C(0x28db77f523047d84), APR_UINT64_C(0x32caab7b40c72493), + APR_UINT64_C(0x3c9ebe0a15c9bebc), APR_UINT64_C(0x431d67c49c100d4c), + APR_UINT64_C(0x4cc5d4becb3e42b6), APR_UINT64_C(0x597f299cfc657e2a), + APR_UINT64_C(0x5fcb6fab3ad6faec), APR_UINT64_C(0x6c44198c4a475817) }; /* Initial hash value H for SHA-384 */ const static sha2_word64 sha384_initial_hash_value[8] = { - 0xcbbb9d5dc1059ed8ULL, - 0x629a292a367cd507ULL, - 0x9159015a3070dd17ULL, - 0x152fecd8f70e5939ULL, - 0x67332667ffc00b31ULL, - 0x8eb44a8768581511ULL, - 0xdb0c2e0d64f98fa7ULL, - 0x47b5481dbefa4fa4ULL + APR_UINT64_C(0xcbbb9d5dc1059ed8), + APR_UINT64_C(0x629a292a367cd507), + APR_UINT64_C(0x9159015a3070dd17), + APR_UINT64_C(0x152fecd8f70e5939), + APR_UINT64_C(0x67332667ffc00b31), + APR_UINT64_C(0x8eb44a8768581511), + APR_UINT64_C(0xdb0c2e0d64f98fa7), + APR_UINT64_C(0x47b5481dbefa4fa4) }; /* Initial hash value H for SHA-512 */ const static sha2_word64 sha512_initial_hash_value[8] = { - 0x6a09e667f3bcc908ULL, - 0xbb67ae8584caa73bULL, - 0x3c6ef372fe94f82bULL, - 0xa54ff53a5f1d36f1ULL, - 0x510e527fade682d1ULL, - 0x9b05688c2b3e6c1fULL, - 0x1f83d9abfb41bd6bULL, - 0x5be0cd19137e2179ULL + APR_UINT64_C(0x6a09e667f3bcc908), + APR_UINT64_C(0xbb67ae8584caa73b), + APR_UINT64_C(0x3c6ef372fe94f82b), + APR_UINT64_C(0xa54ff53a5f1d36f1), + APR_UINT64_C(0x510e527fade682d1), + APR_UINT64_C(0x9b05688c2b3e6c1f), + APR_UINT64_C(0x1f83d9abfb41bd6b), + APR_UINT64_C(0x5be0cd19137e2179) }; /* diff --git a/random/unix/sha2_glue.c b/random/unix/sha2_glue.c index 8029f8f8426..08f4de3f637 100644 --- a/random/unix/sha2_glue.c +++ b/random/unix/sha2_glue.c @@ -19,7 +19,7 @@ static void sha256_finish(apr_crypto_hash_t *h,unsigned char *result) SHA256_Final(result,h->data); } -apr_crypto_hash_t *apr_crypto_sha256_new(apr_pool_t *p) +APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p) { apr_crypto_hash_t *h=apr_palloc(p,sizeof *h); diff --git a/test/Makefile.win b/test/Makefile.win index c9c6eb96a5c..85c32c80d36 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -99,7 +99,7 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testdso.obj testoc.obj testdup.obj testsockets.obj testproc.obj \ testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \ testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ - testenv.obj testprocmutex.obj + testenv.obj testprocmutex.obj testrand2.obj testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS) $(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ diff --git a/test/testall.dsp b/test/testall.dsp index 12f031cb76a..2b971d94527 100644 --- a/test/testall.dsp +++ b/test/testall.dsp @@ -195,6 +195,10 @@ SOURCE=.\testrand.c # End Source File # Begin Source File +SOURCE=.\testrand2.c +# End Source File +# Begin Source File + SOURCE=.\testshm.c # End Source File # Begin Source File diff --git a/test/testrand2.c b/test/testrand2.c index 980a8ecda54..43b7fc84204 100644 --- a/test/testrand2.c +++ b/test/testrand2.c @@ -83,7 +83,7 @@ static void hexdump(const unsigned char *b,int n) static apr_random_t *r; -typedef apr_status_t rnd_fn(apr_random_t *r,void *b,apr_size_t n); +typedef apr_status_t APR_THREAD_FUNC rnd_fn(apr_random_t *r,void *b,apr_size_t n); static void rand_run_kat(CuTest *tc,rnd_fn *f,apr_random_t *r, const unsigned char expected[128]) From c43339522dce989712fe9af1a6fbcbc087861f6c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 16 Nov 2003 23:58:48 +0000 Subject: [PATCH 4702/7878] do the right thing on BEOS avoid some duplication of platform knowledge git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64752 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index 22e613b69ba..8f2b3010966 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -64,7 +64,12 @@ #include #endif -#if !(defined WIN32) && !(defined NETWARE) +#if !(defined BEOS) && !(defined WIN32) && !(defined NETWARE) && !(defined __MVS__) && !(defined DARWIN) +/* ugh... */ +#define HAVE_PTHREAD_SETCONCURRENCY +#endif + +#ifdef HAVE_PTHREAD_SETCONCURRENCY #include #endif @@ -256,7 +261,7 @@ int main(int argc, char**argv) } printf("APR Atomic Test\n===============\n\n"); -#if !(defined WIN32) && !(defined NETWARE) && !(defined __MVS__) && !(defined DARWIN) +#ifdef HAVE_PTHREAD_SETCONCURRENCY pthread_setconcurrency(8); #endif printf("%-60s", "Initializing the context"); From 4b1300f0c5360c9be694ad2c0bd93c9df9c18a49 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 17 Nov 2003 00:09:17 +0000 Subject: [PATCH 4703/7878] Fix one typo in reviewing the unix APR_UINT64_C wrapper git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64753 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index d2636083f2f..2695a85892a 100644 --- a/configure.in +++ b/configure.in @@ -1051,7 +1051,7 @@ fi # The first match is our preference. if test "$ac_cv_sizeof_int" = "8"; then int64_literal='#define APR_INT64_C(val) (val)' - uint64_literal='#define APR_UINT64_C(val) (val)' + uint64_literal='#define APR_UINT64_C(val) (val##U)' int64_t_fmt='#define APR_INT64_T_FMT "d"' uint64_t_fmt='#define APR_UINT64_T_FMT "u"' uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "x"' From 72ba5bccbc2d571edce0ae13ced954ab9bb51b99 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 17 Nov 2003 00:18:44 +0000 Subject: [PATCH 4704/7878] Correct signedness of abs values. Reviewed by Will Rowe, Ben Laurie git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64754 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/apr_random.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c index fc254fb1d60..cc7227336bc 100644 --- a/random/unix/apr_random.c +++ b/random/unix/apr_random.c @@ -75,8 +75,8 @@ typedef struct apr_random_pool_t { unsigned char *pool; - int bytes; - int pool_size; + unsigned int bytes; + unsigned int pool_size; } apr_random_pool_t; #define hash_init(h) (h)->init(h) @@ -126,7 +126,7 @@ APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p, apr_crypto_hash_t *key_hash, apr_crypto_hash_t *prng_hash) { - int n; + unsigned int n; g->apr_pool = p; @@ -208,7 +208,7 @@ APR_DECLARE(apr_random_t *) apr_random_standard_new(apr_pool_t *p) static void rekey(apr_random_t *g) { - int n; + unsigned int n; unsigned char *H = H_current(g); hash_init(g->key_hash); @@ -238,7 +238,7 @@ static void rekey(apr_random_t *g) APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g,const void *entropy_, apr_size_t bytes) { - int n; + unsigned int n; const unsigned char *entropy = entropy_; for (n = 0; n < bytes; ++n) { @@ -257,7 +257,7 @@ APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g,const void *entropy_, p->pool[p->bytes++] = entropy[n]; if (p->bytes == g->rehash_size) { - int r; + unsigned int r; for (r = 0; r < p->bytes/2; r+=g->pool_hash->size) hash(g->pool_hash,p->pool+r,p->pool+r*2,g->pool_hash->size*2); From 75be9a1b73d4c8c2b54e8e71286fe86a3ac217ef Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 17 Nov 2003 00:20:44 +0000 Subject: [PATCH 4705/7878] Remove 'long double' configure check as it's not an integral type. According to ViewCVS/cvs annotate, this dates to r1.28 of configure.in. Submitted by: Will Rowe Reviewed by: Jeff Trawick, Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64755 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 --------- 1 file changed, 9 deletions(-) diff --git a/configure.in b/configure.in index 2695a85892a..71b0b62f195 100644 --- a/configure.in +++ b/configure.in @@ -1080,15 +1080,6 @@ elif test "$ac_cv_sizeof_long_long" = "8"; then int64_value="long long" long_value="long long" int64_strfn="strtoll" -elif test "$ac_cv_sizeof_long_double" = "8"; then - int64_literal='#define APR_INT64_C(val) (val##LD)' - uint64_literal='#define APR_UINT64_C(val) (val##ULD)' - int64_t_fmt='#define APR_INT64_T_FMT "Ld"' - uint64_t_fmt='#define APR_UINT64_T_FMT "Lu"' - uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "Lx"' - int64_value="long double" - long_value="long double" - int64_strfn="strtoll" elif test "$ac_cv_sizeof_longlong" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LL)' uint64_literal='#define APR_UINT64_C(val) (val##ULL)' From b8080061b9c444e71504e8fd6200b9bd4c3bf7a0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 17 Nov 2003 00:28:25 +0000 Subject: [PATCH 4706/7878] Puzzle for the day, how does sha2.c compile already on Win32 or Netware. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64756 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 4 ++++ include/apr.hw | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/apr.hnw b/include/apr.hnw index 4345e309869..cbff5ac6967 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -265,6 +265,10 @@ typedef ssize_t apr_ssize_t; typedef off64_t apr_off_t; typedef int apr_socklen_t; +/* Are we big endian? */ +/* XXX: Fatal assumption on Alpha platforms */ +#define APR_IS_BIGENDIAN 0 + #ifdef UNKNOWN_NETWARE_64BIT_FLAG_NEEDED #define APR_SIZEOF_VOIDP 8 #else diff --git a/include/apr.hw b/include/apr.hw index d8b9fff4a14..c20b311e740 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -372,6 +372,10 @@ typedef int apr_off_t; #endif typedef int apr_socklen_t; +/* Are we big endian? */ +/* XXX: Fatal assumption on Alpha platforms */ +#define APR_IS_BIGENDIAN 0 + #ifdef WIN64 #define APR_SIZEOF_VOIDP 8 #else @@ -399,7 +403,7 @@ typedef int gid_t; #endif #ifndef WS2TCPIP_INLINE -#define IN6_IS_ADDR_V4MAPPED(a) \ +6:09 PM 11/16/2003#define IN6_IS_ADDR_V4MAPPED(a) \ ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \ && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) #endif From cf9213b03ebd171bf493d4c06234d301d6e9d8e0 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 17 Nov 2003 00:32:36 +0000 Subject: [PATCH 4707/7878] Remove the old/deprecated apr_poll interface. * include/apr_poll.h: (apr_poll, apr_poll_setup, apr_poll_socket_add, apr_poll_socket_mask, apr_poll_socket_remove, apr_poll_socket_clear, apr_poll_revents_get): removed. these were deprecated a while back, in favor of the apr_pollset_t interfaces. * poll/os2/poll.c: removed. this implemented apr_poll() which was deprecated by the new apr_pollset_t interfaces. * poll/os/Makefile.in: remove reference to poll.lo * poll/unix/poll.c: - remove include of alloca.h; no longer needed (apr_poll): removed both implementations * poll/unix/pollacc.c: (apr_poll_setup, apr_poll_socket_add, apr_poll_socket_mask, apr_poll_socket_remove, apr_poll_socket_clear, apr_poll_revents_get): removed these deprecated functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64757 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 46 ---------- poll/os2/Makefile.in | 1 - poll/os2/poll.c | 143 ------------------------------ poll/unix/poll.c | 207 +------------------------------------------ poll/unix/pollacc.c | 120 +------------------------ 5 files changed, 5 insertions(+), 512 deletions(-) delete mode 100755 poll/os2/poll.c diff --git a/include/apr_poll.h b/include/apr_poll.h index 54aafbd17fb..b830e882e9e 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -119,29 +119,6 @@ struct apr_pollfd_t { }; -/** - * Poll the sockets in the poll structure - * @param aprset The poll structure we will be using. - * @param numsock The number of sockets we are polling - * @param nsds The number of sockets signalled. - * @param timeout The amount of time in microseconds to wait. This is - * a maximum, not a minimum. If a socket is signalled, we - * will wake up before this time. A negative number means - * wait until a socket is signalled. - * @remark - *
    - * The number of sockets signalled is returned in the second argument. 
    - *
    - *        This is a blocking call, and it will not return until either a 
    - *        socket has been signalled, or the timeout has expired. 
    - * 
    - */ -/* ### is this deprecated, too? */ -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, - apr_int32_t *nsds, - apr_interval_time_t timeout); - - /* General-purpose poll API for arbitrarily large numbers of * file descriptors */ @@ -202,29 +179,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, /** @} */ -/* These functions are deprecated. If you want doc, then go to older - versions of this header file. - - ### should probably just be removed. -*/ -APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new_poll, - apr_int32_t num, - apr_pool_t *cont); -APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, - apr_socket_t *sock, - apr_int16_t event); -APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, - apr_socket_t *sock, - apr_int16_t events); -APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, - apr_socket_t *sock); -APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, - apr_int16_t events); -APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, - apr_socket_t *sock, - apr_pollfd_t *aprset); - - #ifdef __cplusplus } #endif diff --git a/poll/os2/Makefile.in b/poll/os2/Makefile.in index 96fc006fe4b..9ebedb01e9c 100755 --- a/poll/os2/Makefile.in +++ b/poll/os2/Makefile.in @@ -2,7 +2,6 @@ srcdir = @srcdir@ VPATH = @srcdir@ TARGETS = \ - poll.lo \ pollset.lo \ pollacc.lo diff --git a/poll/os2/poll.c b/poll/os2/poll.c deleted file mode 100755 index ed36dc8872b..00000000000 --- a/poll/os2/poll.c +++ /dev/null @@ -1,143 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr.h" -#include "apr_poll.h" -#include "apr_arch_networkio.h" - -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, - apr_int32_t *nsds, apr_interval_time_t timeout) -{ - int *pollset; - int i; - int num_read = 0, num_write = 0, num_except = 0, num_total; - int pos_read, pos_write, pos_except; - - for (i = 0; i < num; i++) { - if (aprset[i].desc_type == APR_POLL_SOCKET) { - num_read += (aprset[i].reqevents & APR_POLLIN) != 0; - num_write += (aprset[i].reqevents & APR_POLLOUT) != 0; - num_except += (aprset[i].reqevents & APR_POLLPRI) != 0; - } - } - - num_total = num_read + num_write + num_except; - pollset = alloca(sizeof(int) * num_total); - memset(pollset, 0, sizeof(int) * num_total); - - pos_read = 0; - pos_write = num_read; - pos_except = pos_write + num_write; - - for (i = 0; i < num; i++) { - if (aprset[i].desc_type == APR_POLL_SOCKET) { - if (aprset[i].reqevents & APR_POLLIN) { - pollset[pos_read++] = aprset[i].desc.s->socketdes; - } - - if (aprset[i].reqevents & APR_POLLOUT) { - pollset[pos_write++] = aprset[i].desc.s->socketdes; - } - - if (aprset[i].reqevents & APR_POLLPRI) { - pollset[pos_except++] = aprset[i].desc.s->socketdes; - } - - aprset[i].rtnevents = 0; - } - } - - if (timeout > 0) { - timeout /= 1000; /* convert microseconds to milliseconds */ - } - - i = select(pollset, num_read, num_write, num_except, timeout); - (*nsds) = i; - - if ((*nsds) < 0) { - return APR_FROM_OS_ERROR(sock_errno()); - } - - if ((*nsds) == 0) { - return APR_TIMEUP; - } - - pos_read = 0; - pos_write = num_read; - pos_except = pos_write + num_write; - - for (i = 0; i < num; i++) { - if (aprset[i].desc_type == APR_POLL_SOCKET) { - if (aprset[i].reqevents & APR_POLLIN) { - if (pollset[pos_read++] > 0) { - aprset[i].rtnevents |= APR_POLLIN; - } - } - - if (aprset[i].reqevents & APR_POLLOUT) { - if (pollset[pos_write++] > 0) { - aprset[i].rtnevents |= APR_POLLOUT; - } - } - - if (aprset[i].reqevents & APR_POLLPRI) { - if (pollset[pos_except++] > 0) { - aprset[i].rtnevents |= APR_POLLPRI; - } - } - } - } - - return APR_SUCCESS; -} diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 05d30b7d160..3578d17e2e4 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -64,15 +64,14 @@ #if HAVE_SYS_POLL_H #include #endif -#if HAVE_ALLOCA_H -#include -#endif + #ifdef NETWARE #define HAS_SOCKETS(dt) (dt == APR_POLL_SOCKET) ? 1 : 0 #define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0 #endif + #ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ static apr_int16_t get_event(apr_int16_t event) @@ -115,207 +114,7 @@ static apr_int16_t get_revent(apr_int16_t event) return rv; } -#define SMALL_POLLSET_LIMIT 8 - -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, - apr_int32_t *nsds, apr_interval_time_t timeout) -{ - int i, num_to_poll; -#ifdef HAVE_VLA - /* XXX: I trust that this is a segv when insufficient stack exists? */ - struct pollfd pollset[num]; -#elif defined(HAVE_ALLOCA) - struct pollfd *pollset = alloca(sizeof(struct pollfd) * num); - if (!pollset) - return APR_ENOMEM; -#else - struct pollfd tmp_pollset[SMALL_POLLSET_LIMIT]; - struct pollfd *pollset; - - if (num <= SMALL_POLLSET_LIMIT) { - pollset = tmp_pollset; - } - else { - /* This does require O(n) to copy the descriptors to the internal - * mapping. - */ - pollset = malloc(sizeof(struct pollfd) * num); - /* The other option is adding an apr_pool_abort() fn to invoke - * the pool's out of memory handler - */ - if (!pollset) - return APR_ENOMEM; - } -#endif - for (i = 0; i < num; i++) { - if (aprset[i].desc_type == APR_POLL_SOCKET) { - pollset[i].fd = aprset[i].desc.s->socketdes; - } - else if (aprset[i].desc_type == APR_POLL_FILE) { - pollset[i].fd = aprset[i].desc.f->filedes; - } - else { - break; - } - pollset[i].events = get_event(aprset[i].reqevents); - } - num_to_poll = i; - - if (timeout > 0) { - timeout /= 1000; /* convert microseconds to milliseconds */ - } - - i = poll(pollset, num_to_poll, timeout); - (*nsds) = i; - - for (i = 0; i < num; i++) { - aprset[i].rtnevents = get_revent(pollset[i].revents); - } - -#if !defined(HAVE_VLA) && !defined(HAVE_ALLOCA) - if (num > SMALL_POLLSET_LIMIT) { - free(pollset); - } -#endif - - if ((*nsds) < 0) { - return apr_get_netos_error(); - } - if ((*nsds) == 0) { - return APR_TIMEUP; - } - return APR_SUCCESS; -} - - -#else /* Use select to mimic poll */ - -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *nsds, - apr_interval_time_t timeout) -{ - fd_set readset, writeset, exceptset; - int rv, i; - int maxfd = -1; - struct timeval tv, *tvptr; -#ifdef NETWARE - apr_datatype_e set_type = APR_NO_DESC; -#endif - - if (timeout < 0) { - tvptr = NULL; - } - else { - tv.tv_sec = (long)apr_time_sec(timeout); - tv.tv_usec = (long)apr_time_usec(timeout); - tvptr = &tv; - } - - FD_ZERO(&readset); - FD_ZERO(&writeset); - FD_ZERO(&exceptset); - - for (i = 0; i < num; i++) { - apr_os_sock_t fd; - - aprset[i].rtnevents = 0; - - if (aprset[i].desc_type == APR_POLL_SOCKET) { -#ifdef NETWARE - if (HAS_PIPES(set_type)) { - return APR_EBADF; - } - else { - set_type = APR_POLL_SOCKET; - } -#endif - fd = aprset[i].desc.s->socketdes; - } - else if (aprset[i].desc_type == APR_POLL_FILE) { -#if !APR_FILES_AS_SOCKETS - return APR_EBADF; -#else -#ifdef NETWARE - if (aprset[i].desc.f->is_pipe && !HAS_SOCKETS(set_type)) { - set_type = APR_POLL_FILE; - } - else - return APR_EBADF; -#endif /* NETWARE */ - - fd = aprset[i].desc.f->filedes; - -#endif /* APR_FILES_AS_SOCKETS */ - } - else { - break; - } - if (aprset[i].reqevents & APR_POLLIN) { - FD_SET(fd, &readset); - } - if (aprset[i].reqevents & APR_POLLOUT) { - FD_SET(fd, &writeset); - } - if (aprset[i].reqevents & - (APR_POLLPRI | APR_POLLERR | APR_POLLHUP | APR_POLLNVAL)) { - FD_SET(fd, &exceptset); - } - if ((int)fd > maxfd) { - maxfd = (int)fd; - } - } - -#ifdef NETWARE - if (HAS_PIPES(set_type)) { - rv = pipe_select(maxfd + 1, &readset, &writeset, &exceptset, tvptr); - } - else { -#endif - - rv = select(maxfd + 1, &readset, &writeset, &exceptset, tvptr); - -#ifdef NETWARE - } -#endif - - (*nsds) = rv; - if ((*nsds) == 0) { - return APR_TIMEUP; - } - if ((*nsds) < 0) { - return apr_get_netos_error(); - } - - for (i = 0; i < num; i++) { - apr_os_sock_t fd; - - if (aprset[i].desc_type == APR_POLL_SOCKET) { - fd = aprset[i].desc.s->socketdes; - } - else if (aprset[i].desc_type == APR_POLL_FILE) { -#if !APR_FILES_AS_SOCKETS - return APR_EBADF; -#else - fd = aprset[i].desc.f->filedes; -#endif - } - else { - break; - } - if (FD_ISSET(fd, &readset)) { - aprset[i].rtnevents |= APR_POLLIN; - } - if (FD_ISSET(fd, &writeset)) { - aprset[i].rtnevents |= APR_POLLOUT; - } - if (FD_ISSET(fd, &exceptset)) { - aprset[i].rtnevents |= APR_POLLERR; - } - } - - return APR_SUCCESS; -} - -#endif +#endif /* HAVE_POLL */ struct apr_pollset_t { diff --git a/poll/unix/pollacc.c b/poll/unix/pollacc.c index 2473b0d797c..275895811f7 100644 --- a/poll/unix/pollacc.c +++ b/poll/unix/pollacc.c @@ -53,133 +53,17 @@ */ #include "apr.h" -#include "apr_poll.h" #include "apr_arch_networkio.h" #include "apr_arch_file_io.h" -#if HAVE_POLL_H -#include -#endif -#if HAVE_SYS_POLL_H -#include -#endif - -APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) -{ - (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * (num + 1)); - if ((*new) == NULL) { - return APR_ENOMEM; - } - (*new)[num].desc_type = APR_POLL_LASTDESC; - (*new)[0].p = cont; - return APR_SUCCESS; -} - -static apr_pollfd_t *find_poll_sock(apr_pollfd_t *aprset, apr_socket_t *sock) -{ - apr_pollfd_t *curr = aprset; - - while (curr->desc.s != sock) { - if (curr->desc_type == APR_POLL_LASTDESC) { - return NULL; - } - curr++; - } - - return curr; -} - -APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t event) -{ - apr_pollfd_t *curr = aprset; - - while (curr->desc_type != APR_NO_DESC) { - if (curr->desc_type == APR_POLL_LASTDESC) { - return APR_ENOMEM; - } - curr++; - } - curr->desc.s = sock; - curr->desc_type = APR_POLL_SOCKET; - curr->reqevents = event; - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) -{ - apr_pollfd_t *curr = find_poll_sock(aprset, sock); - if (curr == NULL) { - return APR_NOTFOUND; - } - - (*event) = curr->rtnevents; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, - apr_socket_t *sock, apr_int16_t events) -{ - apr_pollfd_t *curr = find_poll_sock(aprset, sock); - if (curr == NULL) { - return APR_NOTFOUND; - } - - if (curr->reqevents & events) { - curr->reqevents ^= events; - } - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock) -{ - apr_pollfd_t *match = NULL; - apr_pollfd_t *curr; - for (curr = aprset; (curr->desc_type != APR_POLL_LASTDESC) && - (curr->desc_type != APR_NO_DESC); curr++) { - if (curr->desc.s == sock) { - match = curr; - } - } - if (match == NULL) { - return APR_NOTFOUND; - } - - /* Remove this entry by swapping the last entry into its place. - * This ensures that the non-APR_NO_DESC entries are all at the - * start of the array, so that apr_poll() doesn't have to worry - * about invalid entries in the middle of the pollset. - */ - curr--; - if (curr != match) { - *match = *curr; - } - curr->desc_type = APR_NO_DESC; - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events) -{ - apr_pollfd_t *curr = aprset; - - while (curr->desc_type != APR_POLL_LASTDESC) { - if (curr->reqevents & events) { - curr->reqevents &= ~events; - } - curr++; - } - return APR_SUCCESS; -} #if APR_FILES_AS_SOCKETS /* I'm not sure if this needs to return an apr_status_t or not, but * for right now, we'll leave it this way, and change it later if * necessary. */ -APR_DECLARE(apr_status_t) apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file) +APR_DECLARE(apr_status_t) apr_socket_from_file(apr_socket_t **newsock, + apr_file_t *file) { (*newsock) = apr_pcalloc(file->pool, sizeof(**newsock)); (*newsock)->socketdes = file->filedes; From 7a4b6a865c2b810a0a03ef971883d4565cdff544 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 17 Nov 2003 00:59:00 +0000 Subject: [PATCH 4708/7878] apr_random won't be in APR1.0.0, so pull testrand2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64758 13f79535-47bb-0310-9956-ffa450edef68 --- test/testall.c | 1 - 1 file changed, 1 deletion(-) diff --git a/test/testall.c b/test/testall.c index 5b4cc50b8a6..169188d9eff 100644 --- a/test/testall.c +++ b/test/testall.c @@ -95,7 +95,6 @@ static const struct testlist { {"testdup", testdup}, {"testdir", testdir}, {"testrand", testrand}, - {"testrand2", testrand2}, {"testdso", testdso}, {"testoc", testoc}, {"testsockets", testsockets}, From ca9b3cf617a1d1970c876d646064fc8b3df68263 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 17 Nov 2003 01:41:18 +0000 Subject: [PATCH 4709/7878] With the removal of apr_poll(), the apr_wait_for_io_or_timeout() function needed to be rebuilt. Specifically, it needs a pollset, but we don't want to allocate that all the time. Thus, we need to create it once at socket or file creation time, and then reuse that pollset. NOTE: this makes the library compile, but some of the test programs may not. I have also not verified this work yet (in favor of just getting it to at least compile...) For the apr_arch_*.h files, I added a pollset member to the file and socket structures. For the various open/dup/etc functions, I added the creation of that pollset whenever a file or socket is created. (I may have missed some and will verify further) For the socket create and sendrecv function, I added the creation of the pollset. (again, may have missed some, but if everybody uses alloc_socket, then we should be okay) * support/unix/waitio.c: rebuild in terms of the pollset git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64759 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filedup.c | 9 +++++ file_io/os2/open.c | 9 +++++ file_io/os2/pipe.c | 3 ++ file_io/unix/filedup.c | 9 +++++ file_io/unix/open.c | 4 +++ file_io/unix/pipe.c | 6 ++++ file_io/win32/filedup.c | 9 +++++ file_io/win32/open.c | 8 +++++ file_io/win32/pipe.c | 2 ++ include/apr_support.h | 2 ++ include/arch/netware/apr_arch_file_io.h | 4 +++ include/arch/os2/apr_arch_file_io.h | 4 +++ include/arch/os2/apr_arch_networkio.h | 5 +++ include/arch/unix/apr_arch_file_io.h | 4 +++ include/arch/unix/apr_arch_networkio.h | 4 +++ include/arch/win32/apr_arch_file_io.h | 4 +++ include/arch/win32/apr_arch_networkio.h | 4 +++ network_io/beos/sendrecv.c | 10 +++--- network_io/os2/sockets.c | 6 ++++ network_io/unix/sockets.c | 5 +++ network_io/win32/sockets.c | 4 +++ support/unix/waitio.c | 46 +++++++++++++++++-------- 22 files changed, 141 insertions(+), 20 deletions(-) diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 10e8566eb0c..59530d90c83 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -96,6 +96,10 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_po *new_file = dup_file; } + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*new)->pollset, 1, p, 0); + return APR_SUCCESS; } @@ -158,5 +162,10 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, old_file->filedes = -1; apr_pool_cleanup_kill(old_file->pool, (void *)old_file, apr_file_cleanup); + + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*new)->pollset, 1, p, 0); + return APR_SUCCESS; } diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 3b7ef835818..db7df5ffcdd 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -144,6 +144,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->direction = 0; dafile->pipe = FALSE; + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&dafile->pollset, 1, cont, 0); + if (!(flag & APR_FILE_NOCLEANUP)) { apr_pool_cleanup_register(dafile->pool, dafile, apr_file_cleanup, apr_file_cleanup); } @@ -239,6 +243,11 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thef if (rv) return rv; } + + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*new)->pollset, 1, cont, 0); + return APR_SUCCESS; } diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index decf88b45a8..083bb63d2c3 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -123,6 +123,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->pipe = 1; (*in)->timeout = -1; (*in)->blocking = BLK_ON; + (void) apr_pollset_create(&(*in)->pollset, 1, pool, 0); apr_pool_cleanup_register(pool, *in, apr_file_cleanup, apr_pool_cleanup_null); (*out) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); @@ -135,6 +136,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*out)->pipe = 1; (*out)->timeout = -1; (*out)->blocking = BLK_ON; + (void) apr_pollset_create(&(*out)->pollset, 1, pool, 0); apr_pool_cleanup_register(pool, *out, apr_file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; @@ -196,6 +198,7 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, (*file)->blocking = BLK_UNKNOWN; /* app needs to make a timeout call */ (*file)->timeout = -1; (*file)->filedes = *thefile; + (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); if (register_cleanup) { apr_pool_cleanup_register(pool, *file, apr_file_cleanup, diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 34ca7de8258..4e9cece9088 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -131,6 +131,10 @@ static apr_status_t _file_dup(apr_file_t **new_file, apr_unix_file_cleanup, apr_unix_file_cleanup); + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0); + return APR_SUCCESS; } @@ -183,5 +187,10 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, old_file->filedes = -1; apr_pool_cleanup_kill(old_file->pool, (void *)old_file, apr_unix_file_cleanup); + + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0); + return APR_SUCCESS; } diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 1f6473a1657..df67b765b57 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -189,6 +189,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, (*new)->dataRead = 0; (*new)->direction = 0; + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*new)->pollset, 1, pool, 0); + if (!(flag & APR_FILE_NOCLEANUP)) { apr_pool_cleanup_register((*new)->pool, (void *)(*new), apr_unix_file_cleanup, diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 41b6cfc4bf7..140c98f8e5e 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -198,6 +198,10 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, apr_unix_file_cleanup, apr_pool_cleanup_null); } + + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); return APR_SUCCESS; } @@ -229,6 +233,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out #if APR_HAS_THREADS (*in)->thlock = NULL; #endif + (void) apr_pollset_create(&(*in)->pollset, 1, pool, 0); (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); (*out)->pool = pool; @@ -242,6 +247,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out #if APR_HAS_THREADS (*out)->thlock = NULL; #endif + (void) apr_pollset_create(&(*out)->pollset, 1, pool, 0); apr_pool_cleanup_register((*in)->pool, (void *)(*in), apr_unix_file_cleanup, apr_pool_cleanup_null); diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index f676daea20b..b14b16bdd92 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -86,6 +86,10 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), file_cleanup, apr_pool_cleanup_null); + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0); + return APR_SUCCESS; #endif /* !defined(_WIN32_WCE) */ } @@ -190,5 +194,10 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, old_file->filehand = INVALID_HANDLE_VALUE; apr_pool_cleanup_kill(old_file->pool, (void *)old_file, file_cleanup); + + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0); + return APR_SUCCESS; } diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 550206b8825..76a9388c1b8 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -436,6 +436,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, } } + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*new)->pollset, 1, cont, 0); + if (!(flag & APR_FILE_NOCLEANUP)) { apr_pool_cleanup_register((*new)->pool, (void *)(*new), file_cleanup, apr_pool_cleanup_null); @@ -575,6 +579,10 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, } } + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); + /* XXX... we pcalloc above so all others are zeroed. * Should we be testing if thefile is a handle to * a PIPE and set up the mechanics appropriately? diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 1d43e3de638..21746c89215 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -148,6 +148,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, (*in)->dataRead = 0; (*in)->direction = 0; (*in)->pOverlapped = NULL; + (void) apr_pollset_create(&(*in)->pollset, 1, p, 0); (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*out)->pool = p; @@ -161,6 +162,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, (*out)->dataRead = 0; (*out)->direction = 0; (*out)->pOverlapped = NULL; + (void) apr_pollset_create(&(*out)->pollset, 1, p, 0); if (apr_os_level >= APR_WIN_NT) { /* Create the read end of the pipe */ diff --git a/include/apr_support.h b/include/apr_support.h index 50a4789e658..8b3f257f5d8 100644 --- a/include/apr_support.h +++ b/include/apr_support.h @@ -76,6 +76,8 @@ extern "C" { /** * Wait for IO to occur or timeout. + * + * Uses POOL for temporary allocations. */ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, int for_read); diff --git a/include/arch/netware/apr_arch_file_io.h b/include/arch/netware/apr_arch_file_io.h index e17a7004edc..54dabe29bb4 100644 --- a/include/arch/netware/apr_arch_file_io.h +++ b/include/arch/netware/apr_arch_file_io.h @@ -63,6 +63,7 @@ #include "apr_file_info.h" #include "apr_errno.h" #include "apr_lib.h" +#include "apr_poll.h" /* System headers the file I/O library needs */ #if APR_HAVE_FCNTL_H @@ -120,6 +121,9 @@ struct apr_file_t { enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ + /* if there is a timeout set, then this pollset is used */ + apr_pollset_t *pollset; + /* Stuff for buffered mode */ char *buffer; int bufpos; /* Read/Write position in buffer */ diff --git a/include/arch/os2/apr_arch_file_io.h b/include/arch/os2/apr_arch_file_io.h index 3fb44bdd69a..624b7445d87 100644 --- a/include/arch/os2/apr_arch_file_io.h +++ b/include/arch/os2/apr_arch_file_io.h @@ -61,6 +61,7 @@ #include "apr_file_io.h" #include "apr_file_info.h" #include "apr_errno.h" +#include "apr_poll.h" /* We have an implementation of mkstemp but it's not very multi-threading * friendly & is part of the POSIX emulation rather than native so don't @@ -83,6 +84,9 @@ struct apr_file_t { HEV pipeSem; enum { BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; + /* if there is a timeout set, then this pollset is used */ + apr_pollset_t *pollset; + /* Stuff for buffered mode */ char *buffer; int bufpos; // Read/Write position in buffer diff --git a/include/arch/os2/apr_arch_networkio.h b/include/arch/os2/apr_arch_networkio.h index fbb9cb9890b..dd93fa24c67 100644 --- a/include/arch/os2/apr_arch_networkio.h +++ b/include/arch/os2/apr_arch_networkio.h @@ -59,6 +59,8 @@ #include "apr_network_io.h" #include "apr_general.h" #include "apr_arch_os2calls.h" +#include "apr_poll.h" + #if APR_HAVE_NETDB_H #include #endif @@ -85,6 +87,9 @@ struct apr_socket_t { apr_int32_t options; apr_int32_t inherit; sock_userdata_t *userdata; + + /* if there is a timeout set, then this pollset is used */ + apr_pollset_t *pollset; }; /* Error codes returned from sock_errno() */ diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index f04b4151720..aea12e79187 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -64,6 +64,7 @@ #include "apr_errno.h" #include "apr_lib.h" #include "apr_thread_mutex.h" +#include "apr_poll.h" /* System headers the file I/O library needs */ #if APR_HAVE_FCNTL_H @@ -131,6 +132,9 @@ struct apr_file_t { enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ + /* if there is a timeout set, then this pollset is used */ + apr_pollset_t *pollset; + /* Stuff for buffered mode */ char *buffer; int bufpos; /* Read/Write position in buffer */ diff --git a/include/arch/unix/apr_arch_networkio.h b/include/arch/unix/apr_arch_networkio.h index 0af3c482d91..4938cf6bc24 100644 --- a/include/arch/unix/apr_arch_networkio.h +++ b/include/arch/unix/apr_arch_networkio.h @@ -61,6 +61,7 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" +#include "apr_poll.h" /* System headers the network I/O library needs */ #if APR_HAVE_SYS_TYPES_H @@ -152,6 +153,9 @@ struct apr_socket_t { apr_int32_t options; apr_int32_t inherit; sock_userdata_t *userdata; + + /* if there is a timeout set, then this pollset is used */ + apr_pollset_t *pollset; }; const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index 30e863a8351..c5dd2103ff7 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -65,6 +65,7 @@ #include "apr_file_info.h" #include "apr_errno.h" #include "apr_arch_misc.h" +#include "apr_poll.h" #ifdef HAVE_SYS_STAT_H #include @@ -215,6 +216,9 @@ struct apr_file_t { apr_off_t filePtr; // position in file of handle apr_thread_mutex_t *mutex; // mutex semaphore, must be owned to access the above fields + /* if there is a timeout set, then this pollset is used */ + apr_pollset_t *pollset; + /* Pipe specific info */ }; diff --git a/include/arch/win32/apr_arch_networkio.h b/include/arch/win32/apr_arch_networkio.h index 2897e0d1782..4aab1dc1380 100644 --- a/include/arch/win32/apr_arch_networkio.h +++ b/include/arch/win32/apr_arch_networkio.h @@ -57,6 +57,7 @@ #include "apr_network_io.h" #include "apr_general.h" +#include "apr_poll.h" typedef struct sock_userdata_t sock_userdata_t; struct sock_userdata_t { @@ -81,6 +82,9 @@ struct apr_socket_t { apr_int32_t options; apr_int32_t inherit; sock_userdata_t *userdata; + + /* if there is a timeout set, then this pollset is used */ + apr_pollset_t *pollset; }; #ifdef _WIN32_WCE diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 965ea8857a2..58bbced43df 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -59,7 +59,7 @@ #include "apr_arch_networkio.h" #include "apr_time.h" -apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read) +static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) { struct timeval tv, *tvptr; fd_set fdset; @@ -139,7 +139,7 @@ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, } while (rv == -1 && errno == EINTR); if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 1); + apr_status_t arv = wait_for_io_or_timeout(sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -185,7 +185,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 0); + apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -226,7 +226,7 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(sock, 1); + apr_status_t arv = wait_for_io_or_timeout(sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -249,4 +249,4 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, return APR_SUCCESS; } -#endif +#endif /* ! BEOS_BONE */ diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 5c13fe39f47..66949b573e9 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -103,6 +103,10 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, sizeof(apr_sockaddr_t)); (*new)->remote_addr->pool = p; + + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*new)->pollset, 1, p, 0); } APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, int *protocol) @@ -115,6 +119,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int int protocol, apr_pool_t *cont) { int downgrade = (family == AF_UNSPEC); + apr_pollfd_t pfd; if (family == AF_UNSPEC) { #if APR_HAVE_IPV6 @@ -143,6 +148,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int (*new)->nonblock = FALSE; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, apr_pool_cleanup_null); + return APR_SUCCESS; } diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 26a90d5e2fe..97c0eb2c45e 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -103,6 +103,10 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, sizeof(apr_sockaddr_t)); (*new)->remote_addr->pool = p; + + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*new)->pollset, 1, p, 0); } apr_status_t apr_socket_protocol_get(apr_socket_t *sock, int *protocol) @@ -144,6 +148,7 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, (*new)->inherit = 0; apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, socket_cleanup); + return APR_SUCCESS; } diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 5ef459e5e17..fffbc7c711c 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -94,6 +94,10 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, sizeof(apr_sockaddr_t)); (*new)->remote_addr->pool = p; + + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*new)->pollset, 1, cont, 0); } APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, diff --git a/support/unix/waitio.c b/support/unix/waitio.c index de72b7e9cb7..84a8483c78d 100644 --- a/support/unix/waitio.c +++ b/support/unix/waitio.c @@ -65,38 +65,54 @@ #endif #ifdef USE_WAIT_FOR_IO + apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, - int for_read) + int for_read) { apr_interval_time_t timeout; - apr_pollfd_t pollset; - int srv, n; + apr_pollfd_t pfd; int type = for_read ? APR_POLLIN : APR_POLLOUT; + apr_pollset_t *pollset; + apr_status_t status; /* TODO - timeout should be less each time through this loop */ if (f) { - pollset.desc_type = APR_POLL_FILE; - pollset.desc.f = f; - pollset.p = f->pool; + pfd.desc_type = APR_POLL_FILE; + pfd.desc.f = f; + + pollset = f->pollset; timeout = f->timeout; } else { - pollset.desc_type = APR_POLL_SOCKET; - pollset.desc.s = s; - pollset.p = s->cntxt; + pfd.desc_type = APR_POLL_SOCKET; + pfd.desc.s = s; + + pollset = s->pollset; timeout = s->timeout; } - pollset.reqevents = type; + pfd.reqevents = type; + + /* Remove the object if it was in the pollset, then add in the new + * object with the correct reqevents value. Ignore the status result + * on the remove, because it might not be in there (yet). + */ + (void) apr_pollset_remove(pollset, &pfd); + + /* ### check status code */ + (void) apr_pollset_add(pollset, &pfd); do { - srv = apr_poll(&pollset, 1, &n, timeout); + int numdesc; + const apr_pollfd_t *pdesc; + + status = apr_pollset_poll(pollset, timeout, &numdesc, &pdesc); - if (n == 1 && pollset.rtnevents & type) { + if (numdesc == 1 && (pdesc[0].rtnevents & type) != 0) { return APR_SUCCESS; } - } while (APR_STATUS_IS_EINTR(srv)); + } while (APR_STATUS_IS_EINTR(status)); - return srv; + return status; } -#endif +#endif /* USE_WAIT_FOR_IO */ From eeba4a48d7973468b8f8bc7c4d0f37dfd9373610 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 17 Nov 2003 02:10:22 +0000 Subject: [PATCH 4710/7878] get rid of extra U suffix in APR_UINT64_C() invocations on some platforms Submitted by: wrowe Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64760 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 71b0b62f195..c9134b222f4 100644 --- a/configure.in +++ b/configure.in @@ -1112,7 +1112,7 @@ YES_IS_DEFINED if test "$apr_cv_define_INT64_C" = "yes"; then int64_literal='#define APR_INT64_C(val) INT64_C(val)' - uint64_literal='#define APR_UINT64_C(val) UINT64_C(val##U)' + uint64_literal='#define APR_UINT64_C(val) UINT64_C(val)' stdint=1 else stdint=0 From d8d6983e053ccc75c6898e8103dab68d2e7b0604 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 17 Nov 2003 02:38:04 +0000 Subject: [PATCH 4711/7878] Pull apr_random from the NetWare build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64761 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 9 +++------ build/nw_export.inc | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 5b80f30bb08..6f9da1de120 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -278,11 +278,8 @@ FILES_lib_objs = \ $(OBJDIR)/proc_mutex.o \ $(OBJDIR)/rand.o \ $(OBJDIR)/readwrite.o \ - $(OBJDIR)/apr_random.o \ $(OBJDIR)/seek.o \ $(OBJDIR)/sendrecv.o \ - $(OBJDIR)/sha2.o \ - $(OBJDIR)/sha2_glue.o \ $(OBJDIR)/shm.o \ $(OBJDIR)/signals.o \ $(OBJDIR)/sockaddr.o \ @@ -406,9 +403,9 @@ $(OBJDIR)/%.o: support/unix/%.c $(OBJDIR)\cc.opt @echo Compiling $< $(CC) support\unix\$( Date: Mon, 17 Nov 2003 09:56:47 +0000 Subject: [PATCH 4712/7878] Consolidate and update lists of known test failures. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64762 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 21 ++++++++++++++++----- test/README | 19 ++----------------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/STATUS b/STATUS index 3899d828302..d34d2b2ea83 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2003/11/15 20:08:21 $] +Last modified at [$Date: 2003/11/17 09:56:46 $] Release: @@ -56,10 +56,21 @@ CURRENT test/testall -v EXCEPTIONS: Please add any platform anomilies to the following exception list. - * All platforms fail tests in time: test_localstr and test_ctime - Imaginary... the tests can only succeed on machines configured - for the Pacific (US) timezone. Test needs to be restructured. - Ignore these errors. + * various tests fail on Unix in VPATH builds. + + * 'testsockets' will fail on some systems such as Linux where IPv6 + can be "supported" but not "enabled", and socket(PF_INET6, ...) + can fail. + + * 'testipsub' will tickle an Solaris 8 getaddrinfo() IPv6 bug, + causing the test to hang. Configure with --disable-ipv6 if + using an unpatched Solaris 8 installation. + + * The 'testdso' tests will not work if configured with + --disable-shared since the loadable modules cannot be built. + + * 'testdso' fails on older versions of OpenBSD due to dlsym(NULL, + ...) segfaulting. * BUG: Win32 fails test in File Info: test_stat_eq_finfo apr_stat and apr_getfileinfo differ in protection ... wrowe diff --git a/test/README b/test/README index 42ecdd47cb5..f387157266a 100644 --- a/test/README +++ b/test/README @@ -59,23 +59,6 @@ To run it, run: ./testall -Caveats -------- - -Currently, some tests are known to fail in certain circumstances: - - * 'testpoll' opens 64 sockets concurrently; ensure that resource -limits are high enough to allow this (using ulimit or limit); for -instance, Solaris <=2.7 and HP-UX 11.00 both set the limit to <=64 by -default - - * 'testipsub' will tickle the Solaris 8 getaddrinfo() IPv6 -bug, causing the test to hang. Configure with --disable-ipv6 if using -an unpatched Solaris 8 installation. - - * The 'testdso' tests will not work if configured with ---disable-shared since the loadable modules cannot be built. - Running individual tests --------------------------------- @@ -98,6 +81,8 @@ All APR Tests: 16 tests run: 16 passed, 0 failed, 0 not implemented. +Known test failures are documented in ../STATUS. + There are a couple of things to look at with this. First, if you look at the first function in this document, you should notice that the string passed to the CuSuiteNew function is in the output. That is why the string should From 1b588f8bdc7755e08262b34795c9e62afdf6e22a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 17 Nov 2003 11:31:01 +0000 Subject: [PATCH 4713/7878] * file_io/unix/filedup.c (file_dup): Renamed from _file_dup - the C library reserves identifiers beginning with an undercore. Callers changed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64763 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 4e9cece9088..04aa9a10570 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -58,9 +58,9 @@ #include "apr_thread_mutex.h" #include "apr_arch_inherit.h" -static apr_status_t _file_dup(apr_file_t **new_file, - apr_file_t *old_file, apr_pool_t *p, - int which_dup) +static apr_status_t file_dup(apr_file_t **new_file, + apr_file_t *old_file, apr_pool_t *p, + int which_dup) { int rv; @@ -141,13 +141,13 @@ static apr_status_t _file_dup(apr_file_t **new_file, APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { - return _file_dup(new_file, old_file, p, 1); + return file_dup(new_file, old_file, p, 1); } APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p) { - return _file_dup(&new_file, old_file, p, 2); + return file_dup(&new_file, old_file, p, 2); } APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, From bb4e5c3eb8bec16f3d60d3b1f87ad2c98a4f75d6 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 17 Nov 2003 12:15:12 +0000 Subject: [PATCH 4714/7878] * test/teststr.c (snprintf_int64): Moved from here... * test/testfmt.c (more_int64_fmts): ...to here, and adjusted to use APR_UINT64_C() now it is available. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64764 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfmt.c | 22 ++++++++++++++++++++-- test/teststr.c | 18 ------------------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/test/testfmt.c b/test/testfmt.c index db43836f8f8..299b1bc7950 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -115,7 +115,7 @@ static void int64_t_fmt(CuTest *tc) static void uint64_t_fmt(CuTest *tc) { char buf[100]; - apr_uint64_t var = 14000000; + apr_uint64_t var = APR_UINT64_C(14000000); sprintf(buf, "%" APR_UINT64_T_FMT, var); CuAssertStrEquals(tc, "14000000", buf); @@ -126,7 +126,7 @@ static void uint64_t_fmt(CuTest *tc) static void uint64_t_hex_fmt(CuTest *tc) { char buf[100]; - apr_uint64_t var = 14000000; + apr_uint64_t var = APR_UINT64_C(14000000); sprintf(buf, "%" APR_UINT64_T_HEX_FMT, var); CuAssertStrEquals(tc, "d59f80", buf); @@ -134,6 +134,23 @@ static void uint64_t_hex_fmt(CuTest *tc) CuAssertStrEquals(tc, "d59f80", buf); } +static void more_int64_fmts(CuTest *tc) +{ + char buf[100]; + apr_int64_t i = APR_INT64_C(-42); + apr_uint64_t ui = APR_UINT64_C(42); + apr_uint64_t big = APR_UINT64_C(3141592653589793238); + + apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, i); + CuAssertStrEquals(tc, buf, "-42"); + + apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, ui); + CuAssertStrEquals(tc, buf, "42"); + + apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, big); + CuAssertStrEquals(tc, buf, "3141592653589793238"); +} + CuSuite *testfmt(void) { CuSuite *suite = CuSuiteNew("Formats"); @@ -145,6 +162,7 @@ CuSuite *testfmt(void) SUITE_ADD_TEST(suite, int64_t_fmt); SUITE_ADD_TEST(suite, uint64_t_fmt); SUITE_ADD_TEST(suite, uint64_t_hex_fmt); + SUITE_ADD_TEST(suite, more_int64_fmts); return suite; } diff --git a/test/teststr.c b/test/teststr.c index e38c1f37702..7769e827137 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -164,23 +164,6 @@ static void snprintf_0nonNULL(CuTest *tc) CuAssert(tc, "buff unmangled", strcmp(buff, "FOOBAR") != 0); } -static void snprintf_int64(CuTest *tc) -{ - char buf[100]; - apr_int64_t i = APR_INT64_C(-42); - apr_uint64_t ui = APR_INT64_C(42); /* no APR_UINT64_C */ - apr_uint64_t big = APR_INT64_C(3141592653589793238); - - apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, i); - CuAssertStrEquals(tc, buf, "-42"); - - apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, ui); - CuAssertStrEquals(tc, buf, "42"); - - apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, big); - CuAssertStrEquals(tc, buf, "3141592653589793238"); -} - static void string_error(CuTest *tc) { char buf[128], *rv; @@ -213,7 +196,6 @@ CuSuite *teststr(void) SUITE_ADD_TEST(suite, snprintf_0NULL); SUITE_ADD_TEST(suite, snprintf_0nonNULL); SUITE_ADD_TEST(suite, snprintf_noNULL); - SUITE_ADD_TEST(suite, snprintf_int64); SUITE_ADD_TEST(suite, test_strtok); SUITE_ADD_TEST(suite, string_error); SUITE_ADD_TEST(suite, string_long); From 582ab2fb8414810177eb38c762cb28cb4bfda897 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 17 Nov 2003 12:58:24 +0000 Subject: [PATCH 4715/7878] * Makefile.in: Link programs using -no-install flag so that they really are binary executables, not libtool wrapper scripts, and without the -avoid-version flag which produces a warning for programs. (reinforced dependency on libtool >=1.4 for this Makefile) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64765 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 086917ab5f5..5c5c21175c9 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -42,6 +42,10 @@ readchild@EXEEXT@ INCDIR=../include INCLUDES=-I$(INCDIR) +# link programs using -no-install to get real executables not +# libtool wrapper scripts which link an executable when first run. +LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) -no-install $(ALL_LDFLAGS) -o $@ + check: $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \ ./$$prog; \ @@ -52,16 +56,16 @@ check: $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) done testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS) - $(LINK) testflock.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testflock.lo $(LOCAL_LIBS) $(ALL_LIBS) occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS) - $(LINK) occhild.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) occhild.lo $(LOCAL_LIBS) $(ALL_LIBS) readchild@EXEEXT@: readchild.lo $(LOCAL_LIBS) - $(LINK) readchild.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) readchild.lo $(LOCAL_LIBS) $(ALL_LIBS) proc_child@EXEEXT@: proc_child.lo $(LOCAL_LIBS) - $(LINK) proc_child.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) proc_child.lo $(LOCAL_LIBS) $(ALL_LIBS) # FIXME: -prefer-pic is only supported with libtool-1.4+ mod_test.slo: $(srcdir)/mod_test.c @@ -74,40 +78,40 @@ libmod_test.la: mod_test.slo $(LOCAL_LIBS) $(LIBTOOL) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS) - $(LINK) testlockperf.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testlockperf.lo $(LOCAL_LIBS) $(ALL_LIBS) testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ $(LOCAL_LIBS) - $(LINK) testsock.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testsock.lo $(LOCAL_LIBS) $(ALL_LIBS) client@EXEEXT@: client.lo $(LOCAL_LIBS) - $(LINK) client.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) client.lo $(LOCAL_LIBS) $(ALL_LIBS) server@EXEEXT@: server.lo $(LOCAL_LIBS) - $(LINK) server.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) server.lo $(LOCAL_LIBS) $(ALL_LIBS) sendfile@EXEEXT@: sendfile.lo $(LOCAL_LIBS) - $(LINK) sendfile.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) sendfile.lo $(LOCAL_LIBS) $(ALL_LIBS) testshm@EXEEXT@: testshm.lo $(LOCAL_LIBS) testshmproducer@EXEEXT@ testshmconsumer@EXEEXT@ - $(LINK) testshm.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testshm.lo $(LOCAL_LIBS) $(ALL_LIBS) testshmproducer@EXEEXT@: testshmproducer.lo $(LOCAL_LIBS) - $(LINK) testshmproducer.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testshmproducer.lo $(LOCAL_LIBS) $(ALL_LIBS) testshmconsumer@EXEEXT@: testshmconsumer.lo $(LOCAL_LIBS) - $(LINK) testshmconsumer.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testshmconsumer.lo $(LOCAL_LIBS) $(ALL_LIBS) testprocmutex@EXEEXT@: testprocmutex.lo $(LOCAL_LIBS) - $(LINK) testprocmutex.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testprocmutex.lo $(LOCAL_LIBS) $(ALL_LIBS) testglobalmutex@EXEEXT@: testglobalmutex.lo $(LOCAL_LIBS) - $(LINK) testglobalmutex.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testglobalmutex.lo $(LOCAL_LIBS) $(ALL_LIBS) testatomic@EXEEXT@: testatomic.lo $(LOCAL_LIBS) - $(LINK) testatomic.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testatomic.lo $(LOCAL_LIBS) $(ALL_LIBS) testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) - $(LINK) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ @@ -119,7 +123,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) - $(LINK) $(TESTS) CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) $(TESTS) CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE From ade81a399181e7a7d823d4568654152f13f4ac41 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 17 Nov 2003 13:29:34 +0000 Subject: [PATCH 4716/7878] * build/apr_common.m4, acconfig.h: Use the third argument to AC_DEFINE for the DIRENT_TYPE and DIRENT_INODE templates. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64766 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 2 -- build/apr_common.m4 | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/acconfig.h b/acconfig.h index cbd03e53259..cef30efd831 100644 --- a/acconfig.h +++ b/acconfig.h @@ -7,8 +7,6 @@ #undef USE_THREADS #undef EGD_DEFAULT_SOCKET #undef HAVE_isascii -#undef DIRENT_INODE -#undef DIRENT_TYPE /* Cross process serialization techniques */ #undef USE_FLOCK_SERIALIZE diff --git a/build/apr_common.m4 b/build/apr_common.m4 index c7bfcfd04bd..14382471997 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -601,7 +601,8 @@ struct dirent de; de.d_ino; fi ]) if test "$apr_cv_dirent_inode" != "no"; then - AC_DEFINE_UNQUOTED(DIRENT_INODE, $apr_cv_dirent_inode) + AC_DEFINE_UNQUOTED(DIRENT_INODE, $apr_cv_dirent_inode, + [Define if struct dirent has an inode member]) fi ]) @@ -624,7 +625,8 @@ struct dirent de; de.d_type = DT_REG; ], apr_cv_dirent_type=d_type) ]) if test "$apr_cv_dirent_type" != "no"; then - AC_DEFINE_UNQUOTED(DIRENT_TYPE, $apr_cv_dirent_type) + AC_DEFINE_UNQUOTED(DIRENT_TYPE, $apr_cv_dirent_type, + [Define if struct dirent has a d_type member]) fi ]) From 7699620a2caff64fcc9838e30040c952037f3641 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 17 Nov 2003 13:51:25 +0000 Subject: [PATCH 4717/7878] * configure.in, acconfig.h: Remove unused USE_THREADS define. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64767 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 1 - configure.in | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/acconfig.h b/acconfig.h index cef30efd831..47c2a4e9ad4 100644 --- a/acconfig.h +++ b/acconfig.h @@ -4,7 +4,6 @@ @TOP@ /* Various #defines we need to know about */ -#undef USE_THREADS #undef EGD_DEFAULT_SOCKET #undef HAVE_isascii diff --git a/configure.in b/configure.in index c9134b222f4..164c8c5025b 100644 --- a/configure.in +++ b/configure.in @@ -489,8 +489,7 @@ else APR_CHECK_PTHREADS_H([ threads="1" pthreadh="1" - pthreadser="1" - AC_DEFINE(USE_THREADS, 1, [Define if APR supports threads]) ], [ + pthreadser="1" ], [ threads="0" pthreadh="0" pthreadser="0" @@ -508,8 +507,7 @@ else APR_CHECK_PTHREADS_H([ threads="1" pthreadh="1" - pthreadser="1" - AC_DEFINE(USE_THREADS) ], [ + pthreadser="1" ], [ threads="0" pthreadser="0" pthreadh="0" From 0fe3d04da3133ca7bb80b61649d541680786145d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 17 Nov 2003 14:25:35 +0000 Subject: [PATCH 4718/7878] * acconfig.h: Remove unused HAVE_isascii and HAVE_INT64_C defines, and _IS_GLOBAL defines for which configure.in already provides templates. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64768 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/acconfig.h b/acconfig.h index 47c2a4e9ad4..28ac63aa1f5 100644 --- a/acconfig.h +++ b/acconfig.h @@ -5,7 +5,6 @@ /* Various #defines we need to know about */ #undef EGD_DEFAULT_SOCKET -#undef HAVE_isascii /* Cross process serialization techniques */ #undef USE_FLOCK_SERIALIZE @@ -14,13 +13,6 @@ #undef USE_PROC_PTHREAD_SERIALIZE #undef USE_PTHREAD_SERIALIZE -#undef POSIXSEM_IS_GLOBAL -#undef SYSVSEM_IS_GLOBAL -#undef FCNTL_IS_GLOBAL -#undef FLOCK_IS_GLOBAL - -#undef HAVE_INT64_C - @BOTTOM@ /* Make sure we have ssize_t defined to be something */ From 037e91914ca002ef857695c7598395834f8be012 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 17 Nov 2003 18:06:01 +0000 Subject: [PATCH 4719/7878] Pull the random test from the netware build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64769 13f79535-47bb-0310-9956-ffa450edef68 --- test/nwgnuaprtest | 1 - 1 file changed, 1 deletion(-) diff --git a/test/nwgnuaprtest b/test/nwgnuaprtest index 024d8b40c92..e3a71c83d5f 100644 --- a/test/nwgnuaprtest +++ b/test/nwgnuaprtest @@ -190,7 +190,6 @@ FILES_nlm_objs = \ $(OBJDIR)/testproc.o \ $(OBJDIR)/testprocmutex.o \ $(OBJDIR)/testrand.o \ - $(OBJDIR)/testrand2.o \ $(OBJDIR)/testsleep.o \ $(OBJDIR)/testsockets.o \ $(OBJDIR)/testsockopt.o \ From 79c2498fba31713d6f108a1eb59856354a00c8b1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 17 Nov 2003 19:54:08 +0000 Subject: [PATCH 4720/7878] There were no 'cont'-named pool objects, simple copy-n-paste bug. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64770 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 2 +- network_io/win32/sockets.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 76a9388c1b8..50a5ce66f3e 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -438,7 +438,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, /* Create a pollset with room for one descriptor. */ /* ### check return codes */ - (void) apr_pollset_create(&(*new)->pollset, 1, cont, 0); + (void) apr_pollset_create(&(*new)->pollset, 1, pool, 0); if (!(flag & APR_FILE_NOCLEANUP)) { apr_pool_cleanup_register((*new)->pool, (void *)(*new), file_cleanup, diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index fffbc7c711c..b03f8813cca 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -97,7 +97,7 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) /* Create a pollset with room for one descriptor. */ /* ### check return codes */ - (void) apr_pollset_create(&(*new)->pollset, 1, cont, 0); + (void) apr_pollset_create(&(*new)->pollset, 1, p, 0); } APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, From a0edfe0b00ba3cd7c3b82219d59e82bfc2459183 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Nov 2003 00:25:17 +0000 Subject: [PATCH 4721/7878] Unix propagates the fname from the apr_file_t to apr_file_info_t on an apr_file_info_get() call. Do the same on Win32, but be warned that this is informative, and is not a canonical representation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64771 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 6 ++++++ include/apr_file_info.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 812ff24c107..e595ba10185 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -445,6 +445,12 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want } finfo->pool = thefile->pool; + + /* ### The finfo lifetime may exceed the lifetime of thefile->pool + * but finfo's aren't managed in pools, so where on earth would + * we pstrdup the fname into??? + */ + finfo->fname = thefile->fname; /* Extra goodies known only by GetFileInformationByHandle() */ finfo->inode = (apr_ino_t)FileInfo.nFileIndexLow diff --git a/include/apr_file_info.h b/include/apr_file_info.h index e14fe0f6fbd..97bd8ee8ee4 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -229,7 +229,7 @@ struct apr_finfo_t { apr_time_t mtime; /** The time the file was last changed */ apr_time_t ctime; - /** The full pathname of the file */ + /** The pathname of the file (possibly unrooted) */ const char *fname; /** The file's name (no path) in filesystem case */ const char *name; From b1d67966a8e81b6b98b2c7aafd6c7567dd700cb1 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 19 Nov 2003 03:16:49 +0000 Subject: [PATCH 4722/7878] Do not strip comments from generated doxygen source listings. Submitted by: Sander Temme Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64773 13f79535-47bb-0310-9956-ffa450edef68 --- docs/doxygen.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/doxygen.conf b/docs/doxygen.conf index 2efb55476f0..c427859fa2d 100644 --- a/docs/doxygen.conf +++ b/docs/doxygen.conf @@ -22,6 +22,7 @@ PREDEFINED="APR_DECLARE(x)=x" \ DOXYGEN= OPTIMIZE_OUTPUT_FOR_C=YES +STRIP_CODE_COMMENTS=NO FULL_PATH_NAMES=NO # some autoconf guru needs to make configure set this correctly... From a91f11a200a9827618a04d7e0f4fae3d151e3b4b Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 19 Nov 2003 08:53:20 +0000 Subject: [PATCH 4723/7878] OS/2: Remove the apr_pollset_t from apr_file_t. File handles can't be polled on OS/2 so having it doesn't serve any purpose. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64774 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filedup.c | 8 -------- file_io/os2/open.c | 8 -------- file_io/os2/pipe.c | 3 --- include/arch/os2/apr_arch_file_io.h | 3 --- 4 files changed, 22 deletions(-) diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 59530d90c83..e7abb987ee7 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -96,10 +96,6 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_po *new_file = dup_file; } - /* Create a pollset with room for one descriptor. */ - /* ### check return codes */ - (void) apr_pollset_create(&(*new)->pollset, 1, p, 0); - return APR_SUCCESS; } @@ -163,9 +159,5 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, apr_pool_cleanup_kill(old_file->pool, (void *)old_file, apr_file_cleanup); - /* Create a pollset with room for one descriptor. */ - /* ### check return codes */ - (void) apr_pollset_create(&(*new)->pollset, 1, p, 0); - return APR_SUCCESS; } diff --git a/file_io/os2/open.c b/file_io/os2/open.c index db7df5ffcdd..d61008ac4c5 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -144,10 +144,6 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->direction = 0; dafile->pipe = FALSE; - /* Create a pollset with room for one descriptor. */ - /* ### check return codes */ - (void) apr_pollset_create(&dafile->pollset, 1, cont, 0); - if (!(flag & APR_FILE_NOCLEANUP)) { apr_pool_cleanup_register(dafile->pool, dafile, apr_file_cleanup, apr_file_cleanup); } @@ -244,10 +240,6 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thef return rv; } - /* Create a pollset with room for one descriptor. */ - /* ### check return codes */ - (void) apr_pollset_create(&(*new)->pollset, 1, cont, 0); - return APR_SUCCESS; } diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 083bb63d2c3..decf88b45a8 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -123,7 +123,6 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->pipe = 1; (*in)->timeout = -1; (*in)->blocking = BLK_ON; - (void) apr_pollset_create(&(*in)->pollset, 1, pool, 0); apr_pool_cleanup_register(pool, *in, apr_file_cleanup, apr_pool_cleanup_null); (*out) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); @@ -136,7 +135,6 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*out)->pipe = 1; (*out)->timeout = -1; (*out)->blocking = BLK_ON; - (void) apr_pollset_create(&(*out)->pollset, 1, pool, 0); apr_pool_cleanup_register(pool, *out, apr_file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; @@ -198,7 +196,6 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, (*file)->blocking = BLK_UNKNOWN; /* app needs to make a timeout call */ (*file)->timeout = -1; (*file)->filedes = *thefile; - (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); if (register_cleanup) { apr_pool_cleanup_register(pool, *file, apr_file_cleanup, diff --git a/include/arch/os2/apr_arch_file_io.h b/include/arch/os2/apr_arch_file_io.h index 624b7445d87..364e09c3e29 100644 --- a/include/arch/os2/apr_arch_file_io.h +++ b/include/arch/os2/apr_arch_file_io.h @@ -84,9 +84,6 @@ struct apr_file_t { HEV pipeSem; enum { BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; - /* if there is a timeout set, then this pollset is used */ - apr_pollset_t *pollset; - /* Stuff for buffered mode */ char *buffer; int bufpos; // Read/Write position in buffer From 5f0dcd22e541c58517d05cd92de5ab2f4cbdde2f Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 19 Nov 2003 12:21:13 +0000 Subject: [PATCH 4724/7878] OS/2: Include APR_FINFO_LINK in the valid flags by default. As OS/2 doesn't have sym-links we can be sure the filename isn't one. This keeps the call to apr_stat() in apr_filepath_merge() happy instead of getting APR_INCOMPLETE. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64775 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filestat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 5da100f83e9..b2bab517b82 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -85,7 +85,7 @@ static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus) fstatus->ftimeCreation ); finfo->valid = APR_FINFO_TYPE | APR_FINFO_PROT | APR_FINFO_SIZE | APR_FINFO_CSIZE | APR_FINFO_MTIME - | APR_FINFO_CTIME | APR_FINFO_ATIME; + | APR_FINFO_CTIME | APR_FINFO_ATIME | APR_FINFO_LINK; } From 260d8db5140f353b764869774ec3fe04e9b44ba7 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 20 Nov 2003 13:22:40 +0000 Subject: [PATCH 4725/7878] * build/apr_hints.m4 (APR_PRELOAD): Fix patterns which have never worked as copy'n'pasted: double-quote braces. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64776 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index bb99a998b27..b761514b6fd 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -131,7 +131,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-freebsd*) case $host in - *freebsd[2345]*) + *freebsd[[2345]]*) APR_ADDTO(CFLAGS, [-funsigned-char]) ;; esac @@ -173,7 +173,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(LDFLAGS, [-posix]) APR_ADDTO(LIBS, [-linet]) ;; - *-sco3.2v[234]*) + *-sco3.2v[[234]]*) APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT]) if test "$GCC" = "no"; then APR_ADDTO(CFLAGS, [-Oacgiltz]) @@ -298,7 +298,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CFLAGS, [-Wc,-pw]) APR_ADDTO(LIBS, [-linet -lc]) ;; - *-sequent-ptx4.[123].*) + *-sequent-ptx4.[[123]].*) APR_ADDTO(CPPFLAGS, [-DSEQUENT=41]) APR_ADDTO(CFLAGS, [-Wc,-pw]) APR_ADDTO(LIBS, [-lc]) From 2b2a1e6fc238fddb24b35f3cfdb7f809ff87dd9b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 20 Nov 2003 13:51:32 +0000 Subject: [PATCH 4726/7878] * test/testpoll.c: Fix test suite until the tests using the old API are either converted to the new API or removed, as appropriate. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64777 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/testpoll.c b/test/testpoll.c index c6b634d1a3c..033a5ab40b8 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -69,9 +69,15 @@ static apr_socket_t *s[LARGE_NUM_SOCKETS]; static apr_sockaddr_t *sa[LARGE_NUM_SOCKETS]; +static apr_pollset_t *pollset; + +/* ###: tests surrounded by ifdef OLD_POLL_INTERFACE either need to be + * converted to use the pollset interface or removed. */ + +#ifdef OLD_POLL_INTERFACE static apr_pollfd_t *pollarray; static apr_pollfd_t *pollarray_large; -static apr_pollset_t *pollset; +#endif static void make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, apr_port_t port, apr_pool_t *p, CuTest *tc) @@ -88,6 +94,7 @@ static void make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, CuAssertIntEquals(tc, APR_SUCCESS, rv); } +#ifdef OLD_POLL_INTERFACE static void check_sockets(const apr_pollfd_t *pollarray, apr_socket_t **sockarray, int which, int pollin, CuTest *tc) @@ -109,6 +116,7 @@ static void check_sockets(const apr_pollfd_t *pollarray, CuAssert(tc, str, !(event & APR_POLLIN)); } } +#endif static void send_msg(apr_socket_t **sockarray, apr_sockaddr_t **sas, int which, CuTest *tc) @@ -151,6 +159,7 @@ static void create_all_sockets(CuTest *tc) } } +#ifdef OLD_POLL_INTERFACE static void setup_small_poll(CuTest *tc) { apr_status_t rv; @@ -310,6 +319,7 @@ static void recv_large_pollarray(CuTest *tc) check_sockets(pollarray_large, s, i, 0, tc); } } +#endif static void setup_pollset(CuTest *tc) { @@ -534,6 +544,8 @@ CuSuite *testpoll(void) CuSuite *suite = CuSuiteNew("Poll"); SUITE_ADD_TEST(suite, create_all_sockets); + +#ifdef OLD_POLL_INTERFACE SUITE_ADD_TEST(suite, setup_small_poll); SUITE_ADD_TEST(suite, setup_large_poll); SUITE_ADD_TEST(suite, nomessage); @@ -544,6 +556,7 @@ CuSuite *testpoll(void) SUITE_ADD_TEST(suite, clear_all_signalled); SUITE_ADD_TEST(suite, send_large_pollarray); SUITE_ADD_TEST(suite, recv_large_pollarray); +#endif SUITE_ADD_TEST(suite, setup_pollset); SUITE_ADD_TEST(suite, add_sockets_pollset); From 2e77918beac28eeeb197a064bfa23721d0b93bd3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 20 Nov 2003 17:40:16 +0000 Subject: [PATCH 4727/7878] Getting closer to 1.0 - eliminate APR_SO_TIMEOUT and replace various tests with (sock->timeout > 0). Also mop up some very hard to read statements by liberally applying parens. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64778 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 15 ++++++---- include/apr_network_io.h | 18 ------------ network_io/os2/sockopt.c | 8 ----- network_io/unix/sendrecv.c | 60 +++++++++++++++++--------------------- network_io/unix/sockets.c | 4 +-- network_io/unix/sockopt.c | 10 ------- network_io/win32/sockopt.c | 9 ------ 7 files changed, 39 insertions(+), 85 deletions(-) diff --git a/CHANGES b/CHANGES index a0319a7899a..370c4f20564 100644 --- a/CHANGES +++ b/CHANGES @@ -1,14 +1,19 @@ -Changes with APR 1.0 - - *) Change i386 FreeBSD to use the asm routines in apr_atomic.h - to overcome issues with the FreeBSD atomic functions return - type on i386. [David Reid] +Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] *) Add a new PRNG. Note that the implementation of SHA-256 is a stop-gap pending snarfing the SHA-1 implementation from apr-util and upgrading it to do SHA-256. Not yet ready for prime time. [Ben Laurie] +Changes with APR 1.0 + + *) Removed apr_socket_opt_{get|set}(..., APR_SO_TIMEOUT) which + was deprecated in favor of apr_socket_timeout_{get|set}(). + + *) Change i386 FreeBSD to use the asm routines in apr_atomic.h + to overcome issues with the FreeBSD atomic functions return + type on i386. [David Reid] + *) Added new versions of the apr_atomic functions for use with 32-bit ints [Brian Pane] diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 52061d4f3fd..27e706f7203 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -103,7 +103,6 @@ extern "C" { #define APR_SO_DEBUG 4 /**< Debug */ #define APR_SO_NONBLOCK 8 /**< Non-blocking IO */ #define APR_SO_REUSEADDR 16 /**< Reuse addresses */ -#define APR_SO_TIMEOUT 32 /**< Timeout */ #define APR_SO_SNDBUF 64 /**< Send buffer */ #define APR_SO_RCVBUF 128 /**< Receive buffer */ #define APR_SO_DISCONNECTED 256 /**< Disconnected */ @@ -729,23 +728,6 @@ APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1, const apr_sockaddr_t *addr2); -#if APR_FILES_AS_SOCKETS || defined(DOXYGEN) - -/** - * Convert a File type to a socket so that it can be used in a poll operation. - * @param newsock the newly created socket which represents a file. - * @param file the file to mask as a socket. - * @warning This is not available on all platforms. Platforms that have the - * ability to poll files for data to be read/written/exceptions will - * have the APR_FILES_AS_SOCKETS macro defined as true. - * @deprecated This function has been deprecated, because of the new poll - * implementation. - */ -APR_DECLARE(apr_status_t) apr_socket_from_file(apr_socket_t **newsock, - apr_file_t *file); - -#endif /* APR_FILES_AS_SOCKETS */ - /** * Given an apr_sockaddr_t and a service name, set the port for the service * @param sockaddr The apr_sockaddr_t that will have its port set diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index b188f90ea5b..63f5c921158 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -120,10 +120,6 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, return APR_OS2_STATUS(sock_errno()); } } - if (opt & APR_SO_TIMEOUT) { - /* XXX: To be deprecated */ - return apr_socket_timeout_set(sock, on); - } if (opt & APR_TCP_NODELAY) { if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { return APR_OS2_STATUS(sock_errno()); @@ -145,10 +141,6 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch(opt) { - case APR_SO_TIMEOUT: - /* XXX: To be deprecated */ - *on = (apr_int32_t)sock->timeout; - break; default: return APR_EINVAL; } diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 85ef64325e8..95d3a904718 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -80,7 +80,7 @@ apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) - && apr_is_option_set(sock, APR_SO_TIMEOUT)) { + && (sock->timeout > 0)) { apr_status_t arv; do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); @@ -98,7 +98,7 @@ apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, *len = 0; return errno; } - if (apr_is_option_set(sock, APR_SO_TIMEOUT) && rv < *len) { + if ((sock->timeout > 0) && (rv < *len)) { sock->options |= APR_INCOMPLETE_WRITE; } (*len) = rv; @@ -119,8 +119,8 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len) rv = read(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR); - if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - apr_is_option_set(sock, APR_SO_TIMEOUT)) { + if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { @@ -137,7 +137,7 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len) (*len) = 0; return errno; } - if (apr_is_option_set(sock, APR_SO_TIMEOUT) && rv < *len) { + if ((sock->timeout > 0) && (rv < *len)) { sock->options |= APR_INCOMPLETE_READ; } (*len) = rv; @@ -159,8 +159,8 @@ apr_status_t apr_socket_sendto(apr_socket_t *sock, apr_sockaddr_t *where, where->salen); } while (rv == -1 && errno == EINTR); - if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) - && apr_is_option_set(sock, APR_SO_TIMEOUT)) { + if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -192,8 +192,8 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, (struct sockaddr*)&from->sa, &from->salen); } while (rv == -1 && errno == EINTR); - if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - apr_is_option_set(sock, APR_SO_TIMEOUT)) { + if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { *len = 0; @@ -239,8 +239,8 @@ apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, rv = writev(sock->socketdes, vec, nvec); } while (rv == -1 && errno == EINTR); - if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - apr_is_option_set(sock, APR_SO_TIMEOUT)) { + if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { apr_status_t arv; do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); @@ -258,8 +258,7 @@ apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, *len = 0; return errno; } - if (apr_is_option_set(sock, APR_SO_TIMEOUT) && - rv < requested_len) { + if ((sock->timeout > 0) && (rv < requested_len)) { sock->options |= APR_INCOMPLETE_WRITE; } (*len) = rv; @@ -338,9 +337,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, *len); /* number of bytes to send */ } while (rv == -1 && errno == EINTR); - if (rv == -1 && - (errno == EAGAIN || errno == EWOULDBLOCK) && - apr_is_option_set(sock, APR_SO_TIMEOUT)) { + if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { @@ -375,7 +373,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, * partial byte count; this is a non-blocking socket. */ - if (apr_is_option_set(sock, APR_SO_TIMEOUT)) { + if (sock->timeout > 0) { sock->options |= APR_INCOMPLETE_WRITE; } return arv; @@ -523,7 +521,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, if (rv == -1) { if (errno == EAGAIN) { - if (apr_is_option_set(sock, APR_SO_TIMEOUT)) { + if (sock->timeout > 0) { sock->options |= APR_INCOMPLETE_WRITE; } /* FreeBSD's sendfile can return -1/EAGAIN even if it @@ -561,9 +559,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, nbytes = 0; } } - if (rv == -1 && - errno == EAGAIN && - apr_is_option_set(sock, APR_SO_TIMEOUT)) { + if ((rv == -1) && (errno == EAGAIN) + && (sock->timeout > 0)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -679,9 +676,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } } while (rc == -1 && errno == EINTR); - if (rc == -1 && - (errno == EAGAIN || errno == EWOULDBLOCK) && - apr_is_option_set(sock, APR_SO_TIMEOUT)) { + if ((rc == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { @@ -827,9 +823,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, flags); /* flags */ } while (rv == -1 && errno == EINTR); - if (rv == -1 && - (errno == EAGAIN || errno == EWOULDBLOCK) && - apr_is_option_set(sock, APR_SO_TIMEOUT)) { + if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { @@ -857,8 +852,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, return errno; } - if (apr_is_option_set(sock, APR_SO_TIMEOUT) && - (parms.bytes_sent < (parms.file_bytes + parms.header_length + parms.trailer_length))) { + if ((sock->timeout > 0) + && (parms.bytes_sent + < (parms.file_bytes + parms.header_length + parms.trailer_length))) { sock->options |= APR_INCOMPLETE_WRITE; } @@ -971,8 +967,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, if (nbytes) { rv = 0; } - else if (!arv && - apr_is_option_set(sock, APR_SO_TIMEOUT) == 1) { + else if (!arv && (sock->timeout > 0)) { apr_status_t t = apr_wait_for_io_or_timeout(NULL, sock, 0); if (t != APR_SUCCESS) { @@ -993,8 +988,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, /* Update how much we sent */ *len = nbytes; - if (apr_is_option_set(sock, APR_SO_TIMEOUT) && - (*len < requested_len)) { + if ((sock->timeout > 0) && (*len < requested_len)) { sock->options |= APR_INCOMPLETE_WRITE; } return APR_SUCCESS; diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 97c0eb2c45e..342f619ccc4 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -271,8 +271,8 @@ apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) /* we can see EINPROGRESS the first time connect is called on a non-blocking * socket; if called again, we can see EALREADY */ - if (rc == -1 && (errno == EINPROGRESS || errno == EALREADY) && - apr_is_option_set(sock, APR_SO_TIMEOUT)) { + if ((rc == -1) && (errno == EINPROGRESS || errno == EALREADY) + && (sock->timeout > 0)) { rc = apr_wait_for_io_or_timeout(NULL, sock, 0); if (rc != APR_SUCCESS) { return rc; diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index c49809306e4..d89201d0e04 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -144,8 +144,6 @@ apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) if (t <= 0) { sock->options &= ~APR_INCOMPLETE_READ; } - sock->timeout = t; - apr_set_option(sock, APR_SO_TIMEOUT, t > 0); return APR_SUCCESS; } @@ -241,10 +239,6 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, return APR_ENOTIMPL; #endif break; - case APR_SO_TIMEOUT: - /* XXX: To be deprecated */ - return apr_socket_timeout_set(sock, on); - break; case APR_TCP_NODELAY: #if defined(TCP_NODELAY) if (apr_is_option_set(sock, APR_TCP_NODELAY) != on) { @@ -359,10 +353,6 @@ apr_status_t apr_socket_opt_get(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch(opt) { - case APR_SO_TIMEOUT: - /* XXX: To be deprecated */ - *on = (apr_int32_t)sock->timeout; - break; default: *on = apr_is_option_set(sock, opt); } diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index a147ace6403..bcb5822eb29 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -133,11 +133,6 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, one = on ? 1 : 0; switch (opt) { - case APR_SO_TIMEOUT: - { - /* XXX: To be deprecated */ - return apr_socket_timeout_set(sock, on); - } case APR_SO_KEEPALIVE: if (on != apr_is_option_set(sock, APR_SO_KEEPALIVE)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, @@ -243,10 +238,6 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch (opt) { - case APR_SO_TIMEOUT: - /* XXX: to be deprecated */ - *on = (apr_int32_t)sock->timeout; - break; case APR_SO_DISCONNECTED: *on = sock->disconnected; break; From 81ada061c0eec69e09c444621b29bd5f322730b9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 20 Nov 2003 17:48:08 +0000 Subject: [PATCH 4728/7878] Drop deprecated apr_proc_{...} functions with detailed CHANGES notes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64779 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++++++ include/apr_thread_proc.h | 14 -------------- misc/unix/otherchild.c | 25 ------------------------- 3 files changed, 8 insertions(+), 39 deletions(-) diff --git a/CHANGES b/CHANGES index 370c4f20564..9f8876ee175 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,13 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Removed deprecated interface apr_proc_other_child_check() + that behaved differently between win32 and unix. + The unix behavor is now accomplished with + apr_proc_other_child_refresh_all(APR_OC_REASON_RESTART) + The win32 behavor is now accomplished with + apr_proc_other_child_refresh_all(APR_OC_REASON_RUNNING) + *) Removed apr_socket_opt_{get|set}(..., APR_SO_TIMEOUT) which was deprecated in favor of apr_socket_timeout_{get|set}(). @@ -56,6 +63,7 @@ Changes with APR 1.0 apr_pool_get_parent -> apr_pool_parent_get apr_pool_set_abort -> apr_pool_abort_set apr_pool_sub_make -> apr_pool_create_ex + apr_proc_other_child_read -> apr_proc_other_child_alert apr_recv -> apr_socket_recv apr_recvfrom -> apr_socket_recvfrom apr_send -> apr_socket_send diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 12501dddd0f..d1c83d594de 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -715,20 +715,6 @@ APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, */ APR_DECLARE(void) apr_proc_other_child_refresh_all(int reason); -/** @deprecated @see apr_proc_other_child_refresh_all - * @remark Call apr_proc_other_child_refresh_all(APR_OC_REASON_RESTART) - * or apr_proc_other_child_refresh_all(APR_OC_REASON_RUNNING) instead. - * @bug The differing implementations of this function on Win32 (_RUNNING checks) - * and Unix (used only for _RESTART) are the reason it will be dropped with APR 1.0. - */ -APR_DECLARE(void) apr_proc_other_child_check(void); - -/** @deprecated @see apr_proc_other_child_alert - * @bug This function's name had nothing to do with it's purpose - */ -APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *proc, int status); - - /** * Terminate a process. * @param proc The process to terminate. diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index bc0d17bf56e..a930a75a1ba 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -257,28 +257,3 @@ APR_DECLARE(void) apr_proc_other_child_refresh_all(int reason) } #endif /* APR_HAS_OTHER_CHILD */ - - -/* XXX: deprecated for removal in 1.0 - * The checks behaved differently between win32 and unix, while - * the old win32 code did a health check, the unix code called - * other_child_check only at restart. - */ -APR_DECLARE(void) apr_proc_other_child_check(void) -{ -#ifdef WIN32 - apr_proc_other_child_refresh_all(APR_OC_REASON_RUNNING); -#else - apr_proc_other_child_refresh_all(APR_OC_REASON_RESTART); -#endif -} - -/* XXX: deprecated for removal in 1.0 - * This really didn't test any sort of read - it simply notified - * the maintenance function that the process had died. - */ -APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *proc, int status) -{ - return apr_proc_other_child_alert(proc, APR_OC_REASON_DEATH, status); -} - From 6880b29202d807b163e57a7160a8b6eebd750f9d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 21 Nov 2003 10:42:03 +0000 Subject: [PATCH 4729/7878] NO_USE_SIGACTION was only declared by Win32, and not tested within the win32 mpm anyways. Thanks to Jeff for pointing out that this patch was quite safe. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64780 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 10 +++++----- include/apr.hw | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/STATUS b/STATUS index d34d2b2ea83..eca6a91d384 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2003/11/17 09:56:46 $] +Last modified at [$Date: 2003/11/21 10:42:03 $] Release: @@ -34,7 +34,6 @@ RELEASE 1.0 SHOWSTOPPERS: Some headers with issues: apr.hnw (READDIR_IS_THREAD_SAFE, ENUM_BITFIELD, _POSIX_THREAD_SAFE_FUNCTIONS (?)) - apr.hw (NO_USE_SIGACTION) * Flush out the test suite and make sure it passes on all platforms. @@ -44,9 +43,10 @@ RELEASE 1.0 SHOWSTOPPERS: unified test suite, and adding more tests to make the suite comprehensive. - * close out the XXX's already! (wrowe: this is "production release" - quality code with that many unanswered questions?) If they aren't - showstoppers, deprecate them to TODO:s. + * Eliminate the TODO's and XXX's by using the doxygen @bug feature + to allow us to better track the open issues, and provide historical + bug lists that help porters understand what was wrong in the old + versions of APR that they would be upgrading from. CURRENT VOTES: diff --git a/include/apr.hw b/include/apr.hw index c20b311e740..bf4830ff045 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -143,8 +143,6 @@ #define __attribute__(__x) #endif -#define NO_USE_SIGACTION - #ifndef _WIN32_WCE #define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_CONIO_H 1 From d60eb1859ec62cf56be568b47dafb2fc551a657b Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 21 Nov 2003 19:50:02 +0000 Subject: [PATCH 4730/7878] Add back apr_poll as it shouldn't have been removed. apr_poll is only intended for quick polling. More complex setups should use the pollset structure that now exists. testpoll commit coming shortly to reflect the change and test the pollset code. Brian - can you make sure the OS/2 code is OK? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64781 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 22 +++++ poll/os2/pollset.c | 87 ++++++++++++++++++++ poll/unix/poll.c | 201 ++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 309 insertions(+), 1 deletion(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index b830e882e9e..13a6f9af1ed 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -176,6 +176,28 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_int32_t *num, const apr_pollfd_t **descriptors); + +/** + * Poll the sockets in the poll structure + * @param aprset The poll structure we will be using. + * @param numsock The number of sockets we are polling + * @param nsds The number of sockets signalled. + * @param timeout The amount of time in microseconds to wait. This is + * a maximum, not a minimum. If a socket is signalled, we + * will wake up before this time. A negative number means + * wait until a socket is signalled. + * @remark + *
    + * The number of sockets signalled is returned in the second argument. 
    + *
    + *        This is a blocking call, and it will not return until either a 
    + *        socket has been signalled, or the timeout has expired. 
    + * 
    + */ +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, + apr_int32_t *nsds, + apr_interval_time_t timeout); + /** @} */ diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c index fd665e5c6ea..9d8c76a75ff 100644 --- a/poll/os2/pollset.c +++ b/poll/os2/pollset.c @@ -256,3 +256,90 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, *descriptors = pollset->result_set; return APR_SUCCESS; } + +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, + apr_int32_t *nsds, apr_interval_time_t timeout) +{ + int *pollset; + int i; + int num_read = 0, num_write = 0, num_except = 0, num_total; + int pos_read, pos_write, pos_except; + + for (i = 0; i < num; i++) { + if (aprset[i].desc_type == APR_POLL_SOCKET) { + num_read += (aprset[i].reqevents & APR_POLLIN) != 0; + num_write += (aprset[i].reqevents & APR_POLLOUT) != 0; + num_except += (aprset[i].reqevents & APR_POLLPRI) != 0; + } + } + + num_total = num_read + num_write + num_except; + pollset = alloca(sizeof(int) * num_total); + memset(pollset, 0, sizeof(int) * num_total); + + pos_read = 0; + pos_write = num_read; + pos_except = pos_write + num_write; + + for (i = 0; i < num; i++) { + if (aprset[i].desc_type == APR_POLL_SOCKET) { + if (aprset[i].reqevents & APR_POLLIN) { + pollset[pos_read++] = aprset[i].desc.s->socketdes; + } + + if (aprset[i].reqevents & APR_POLLOUT) { + pollset[pos_write++] = aprset[i].desc.s->socketdes; + } + + if (aprset[i].reqevents & APR_POLLPRI) { + pollset[pos_except++] = aprset[i].desc.s->socketdes; + } + + aprset[i].rtnevents = 0; + } + } + + if (timeout > 0) { + timeout /= 1000; /* convert microseconds to milliseconds */ + } + + i = select(pollset, num_read, num_write, num_except, timeout); + (*nsds) = i; + + if ((*nsds) < 0) { + return APR_FROM_OS_ERROR(sock_errno()); + } + + if ((*nsds) == 0) { + return APR_TIMEUP; + } + + pos_read = 0; + pos_write = num_read; + pos_except = pos_write + num_write; + + for (i = 0; i < num; i++) { + if (aprset[i].desc_type == APR_POLL_SOCKET) { + if (aprset[i].reqevents & APR_POLLIN) { + if (pollset[pos_read++] > 0) { + aprset[i].rtnevents |= APR_POLLIN; + } + } + + if (aprset[i].reqevents & APR_POLLOUT) { + if (pollset[pos_write++] > 0) { + aprset[i].rtnevents |= APR_POLLOUT; + } + } + + if (aprset[i].reqevents & APR_POLLPRI) { + if (pollset[pos_except++] > 0) { + aprset[i].rtnevents |= APR_POLLPRI; + } + } + } + } + + return APR_SUCCESS; +} + diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 3578d17e2e4..bbc4269d879 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -114,8 +114,207 @@ static apr_int16_t get_revent(apr_int16_t event) return rv; } -#endif /* HAVE_POLL */ +#define SMALL_POLLSET_LIMIT 8 +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, + apr_int32_t *nsds, apr_interval_time_t timeout) +{ + int i, num_to_poll; +#ifdef HAVE_VLA + /* XXX: I trust that this is a segv when insufficient stack exists? */ + struct pollfd pollset[num]; +#elif defined(HAVE_ALLOCA) + struct pollfd *pollset = alloca(sizeof(struct pollfd) * num); + if (!pollset) + return APR_ENOMEM; +#else + struct pollfd tmp_pollset[SMALL_POLLSET_LIMIT]; + struct pollfd *pollset; + + if (num <= SMALL_POLLSET_LIMIT) { + pollset = tmp_pollset; + } + else { + /* This does require O(n) to copy the descriptors to the internal + * mapping. + */ + pollset = malloc(sizeof(struct pollfd) * num); + /* The other option is adding an apr_pool_abort() fn to invoke + * the pool's out of memory handler + */ + if (!pollset) + return APR_ENOMEM; + } +#endif + for (i = 0; i < num; i++) { + if (aprset[i].desc_type == APR_POLL_SOCKET) { + pollset[i].fd = aprset[i].desc.s->socketdes; + } + else if (aprset[i].desc_type == APR_POLL_FILE) { + pollset[i].fd = aprset[i].desc.f->filedes; + } + else { + break; + } + pollset[i].events = get_event(aprset[i].reqevents); + } + num_to_poll = i; + + if (timeout > 0) { + timeout /= 1000; /* convert microseconds to milliseconds */ + } + + i = poll(pollset, num_to_poll, timeout); + (*nsds) = i; + + for (i = 0; i < num; i++) { + aprset[i].rtnevents = get_revent(pollset[i].revents); + } + +#if !defined(HAVE_VLA) && !defined(HAVE_ALLOCA) + if (num > SMALL_POLLSET_LIMIT) { + free(pollset); + } +#endif + + if ((*nsds) < 0) { + return apr_get_netos_error(); + } + if ((*nsds) == 0) { + return APR_TIMEUP; + } + return APR_SUCCESS; +} + + +#else /* Use select to mimic poll */ + +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *nsds, + apr_interval_time_t timeout) +{ + fd_set readset, writeset, exceptset; + int rv, i; + int maxfd = -1; + struct timeval tv, *tvptr; +#ifdef NETWARE + apr_datatype_e set_type = APR_NO_DESC; +#endif + + if (timeout < 0) { + tvptr = NULL; + } + else { + tv.tv_sec = (long)apr_time_sec(timeout); + tv.tv_usec = (long)apr_time_usec(timeout); + tvptr = &tv; + } + + FD_ZERO(&readset); + FD_ZERO(&writeset); + FD_ZERO(&exceptset); + + for (i = 0; i < num; i++) { + apr_os_sock_t fd; + + aprset[i].rtnevents = 0; + + if (aprset[i].desc_type == APR_POLL_SOCKET) { +#ifdef NETWARE + if (HAS_PIPES(set_type)) { + return APR_EBADF; + } + else { + set_type = APR_POLL_SOCKET; + } +#endif + fd = aprset[i].desc.s->socketdes; + } + else if (aprset[i].desc_type == APR_POLL_FILE) { +#if !APR_FILES_AS_SOCKETS + return APR_EBADF; +#else +#ifdef NETWARE + if (aprset[i].desc.f->is_pipe && !HAS_SOCKETS(set_type)) { + set_type = APR_POLL_FILE; + } + else + return APR_EBADF; +#endif /* NETWARE */ + + fd = aprset[i].desc.f->filedes; + +#endif /* APR_FILES_AS_SOCKETS */ + } + else { + break; + } + if (aprset[i].reqevents & APR_POLLIN) { + FD_SET(fd, &readset); + } + if (aprset[i].reqevents & APR_POLLOUT) { + FD_SET(fd, &writeset); + } + if (aprset[i].reqevents & + (APR_POLLPRI | APR_POLLERR | APR_POLLHUP | APR_POLLNVAL)) { + FD_SET(fd, &exceptset); + } + if ((int)fd > maxfd) { + maxfd = (int)fd; + } + } + +#ifdef NETWARE + if (HAS_PIPES(set_type)) { + rv = pipe_select(maxfd + 1, &readset, &writeset, &exceptset, tvptr); + } + else { +#endif + + rv = select(maxfd + 1, &readset, &writeset, &exceptset, tvptr); + +#ifdef NETWARE + } +#endif + + (*nsds) = rv; + if ((*nsds) == 0) { + return APR_TIMEUP; + } + if ((*nsds) < 0) { + return apr_get_netos_error(); + } + + for (i = 0; i < num; i++) { + apr_os_sock_t fd; + + if (aprset[i].desc_type == APR_POLL_SOCKET) { + fd = aprset[i].desc.s->socketdes; + } + else if (aprset[i].desc_type == APR_POLL_FILE) { +#if !APR_FILES_AS_SOCKETS + return APR_EBADF; +#else + fd = aprset[i].desc.f->filedes; +#endif + } + else { + break; + } + if (FD_ISSET(fd, &readset)) { + aprset[i].rtnevents |= APR_POLLIN; + } + if (FD_ISSET(fd, &writeset)) { + aprset[i].rtnevents |= APR_POLLOUT; + } + if (FD_ISSET(fd, &exceptset)) { + aprset[i].rtnevents |= APR_POLLERR; + } + } + + return APR_SUCCESS; +} + +#endif struct apr_pollset_t { apr_uint32_t nelts; From d0ec9c6116079e066337ad8a832c4a268ccda31d Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 21 Nov 2003 23:44:15 +0000 Subject: [PATCH 4731/7878] Fix up the NetWare make files so that they copy the right headers and libraries for the installdev target git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64782 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 28 ++++++++++++++++++++++++++-- build/NWGNUenvironment.inc | 25 +++++++++++++++++++++---- build/NWGNUhead.inc | 10 ---------- 3 files changed, 47 insertions(+), 16 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 6f9da1de120..a4a7e7834d9 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -312,8 +312,32 @@ nlms :: libs $(TARGET_nlm) # Updated this target to create necessary directories and copy files to the # correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples) # -install :: nlms FORCE - copy $(OBJDIR)\aprlib.nlm $(INSTALL)\Apache2\*.* +install :: nlms $(INSTDIRS) FORCE + copy $(OBJDIR)\aprlib.nlm $(INSTALLBASE)\*.* +ifndef DEST + -copy $(subst /,\,$(APR))\STATUS $(INSTALLBASE)\*.apr + -copy $(subst /,\,$(APR))\LICENSE $(INSTALLBASE)\* + -copy $(subst /,\,$(APR))\CHANGES $(INSTALLBASE)\*.apr + -copy $(subst /,\,$(APRUTIL))\STATUS $(INSTALLBASE)\*.apu + -copy $(subst /,\,$(APRUTIL))\CHANGES $(INSTALLBASE)\*.apu + @echo rem copying the docs directories > xc.bat + @echo xcopy docs $(INSTALLBASE)\docs\*.* /E /Y >> xc.bat + $(CMD) xc.bat +endif + +$(INSTDIRS) :: + $(CHKNOT) $@\NUL mkdir $@ + +ifndef DEST +installdev :: $(INSTDEVDIRS) FORCE + -copy $(subst /,\,$(APR))\include\*.h $(INSTALLBASE)\include\*.* + -copy $(subst /,\,$(APRUTIL))\include\*.h $(INSTALLBASE)\include\*.* + -copy $(subst /,\,$(APR))\*.imp $(INSTALLBASE)\lib\*.* + -copy $(subst /,\,$(APR))\misc\netware\*.xdc $(INSTALLBASE)\lib\*.* + +$(INSTDEVDIRS) :: + $(CHKNOT) $@\NUL mkdir $@ +endif # # Any specialized rules here diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 72997ff8ca0..44417d65819 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -201,14 +201,31 @@ endif endif +ifdef DEST +INSTALLBASE := $(INSTALL)\Apache2 + +INSTDEVDIRS := \ + $(INSTDIRS) \ + $(INSTALLBASE) \ + $(INSTALLBASE)\include \ + $(INSTALLBASE)\lib \ + +INSTDIRS += \ + $(INSTALLBASE) \ + +else +INSTALLBASE := $(INSTALL)\apr + INSTDEVDIRS := \ $(INSTDIRS) \ - $(INSTALL)\Apache2 \ - $(INSTALL)\Apache2\include \ - $(INSTALL)\Apache2\lib \ + $(INSTALLBASE) \ + $(INSTALLBASE)\include \ + $(INSTALLBASE)\lib \ INSTDIRS += \ - $(INSTALL)\Apache2 \ + $(INSTALLBASE) \ + +endif # # Declare Command and tool macros here diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc index ac084d02b8b..444b2f36436 100644 --- a/build/NWGNUhead.inc +++ b/build/NWGNUhead.inc @@ -36,16 +36,6 @@ all: $(SUBDIRS) libs nlms install $(TARGETS) :: $(SUBDIRS) -install :: nlms $(INSTDIRS) - -installdev :: $(INSTDEVDIRS) - -$(INSTDIRS) :: - $(CHKNOT) $@\NUL mkdir $@ - -$(INSTDEVDIRS) :: - $(CHKNOT) $@\NUL mkdir $@ - endif #NO_LICENSE_FILE check help : From b7d22cd0f3f150290893a509c539ed70792575ac Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 22 Nov 2003 00:05:26 +0000 Subject: [PATCH 4732/7878] Tidy up the poll logic in these files so they build/run again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64784 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 19 ++++++++++++++----- test/server.c | 18 ++++++++++++++---- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/test/sendfile.c b/test/sendfile.c index 34d8315c304..6aff18ad09a 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -216,7 +216,7 @@ static int client(client_socket_mode_t socket_mode, char *host) struct iovec headers[3]; struct iovec trailers[3]; apr_size_t bytes_read; - apr_pollfd_t *pfd; + apr_pollset_t *pset; apr_int32_t nsocks; int i; int family; @@ -339,11 +339,20 @@ static int client(client_socket_mode_t socket_mode, char *host) else { /* non-blocking... wooooooo */ apr_size_t total_bytes_sent; + apr_pollfd_t pfd; - pfd = NULL; - rv = apr_poll_setup(&pfd, 1, p); + pset = NULL; + rv = apr_pollset_create(&pset, 1, p, 0); assert(!rv); - rv = apr_poll_socket_add(pfd, sock, APR_POLLOUT); + pfd.p = p; + pfd.desc_type = APR_POLL_SOCKET; + pfd.reqevents = APR_POLLOUT; + pfd.rtnevents = 0; + pfd.desc.s = sock; + pfd.client_data = NULL; + + rv = apr_pollset_add(pset, &pfd); +// rv = apr_poll_socket_add(pfd, sock, APR_POLLOUT); assert(!rv); total_bytes_sent = 0; @@ -374,7 +383,7 @@ static int client(client_socket_mode_t socket_mode, char *host) if (APR_STATUS_IS_EAGAIN(rv)) { assert(tmplen == 0); nsocks = 1; - tmprv = apr_poll(pfd, 1, &nsocks, -1); + tmprv = apr_pollset_poll(pset, -1, &nsocks, NULL); assert(!tmprv); assert(nsocks == 1); /* continue; */ diff --git a/test/server.c b/test/server.c index 5a8268fbe56..1101efee9e8 100644 --- a/test/server.c +++ b/test/server.c @@ -70,7 +70,8 @@ int main(int argc, const char * const argv[]) apr_socket_t *sock2; apr_size_t length; apr_int32_t pollres; - apr_pollfd_t *sdset; + apr_pollset_t *sdset; + apr_pollfd_t fdsock; char datasend[STRLEN]; char datarecv[STRLEN] = "Recv data test"; const char *bind_to_ipaddr = NULL; @@ -134,13 +135,22 @@ int main(int argc, const char * const argv[]) apr_socket_listen(sock, 5)) APR_TEST_BEGIN(rv, "Setting up for polling", - apr_poll_setup(&sdset, 1, context)) + apr_pollset_create(&sdset, 1, context, 0)) + + /* Hmm, probably a better way of doing this - quick 'n' dirty :) */ + fdsock.p = context; + fdsock.desc_type = APR_POLL_SOCKET; + fdsock.reqevents = APR_POLLIN; + fdsock.rtnevents = 0; + fdsock.desc.s = sock; + fdsock.client_data = NULL; + APR_TEST_END(rv, - apr_poll_socket_add(sdset, sock, APR_POLLIN)) + apr_pollset_add(sdset, &fdsock)) pollres = 1; APR_TEST_BEGIN(rv, "Polling for socket", - apr_poll(sdset, 1, &pollres, -1)) + apr_pollset_poll(sdset, -1, &pollres, NULL)) if (pollres == 0) { fprintf(stdout, "Failed\n"); From f2a3c462f1e91f0071c452f968c11d6d4232e9e7 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 22 Nov 2003 01:45:44 +0000 Subject: [PATCH 4733/7878] Resurrect poll.c for apr_poll() rather than having it in pollset.c. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64785 13f79535-47bb-0310-9956-ffa450edef68 --- poll/os2/Makefile.in | 1 + poll/os2/poll.c | 143 +++++++++++++++++++++++++++++++++++++++++++ poll/os2/pollset.c | 87 -------------------------- 3 files changed, 144 insertions(+), 87 deletions(-) create mode 100755 poll/os2/poll.c diff --git a/poll/os2/Makefile.in b/poll/os2/Makefile.in index 9ebedb01e9c..96fc006fe4b 100755 --- a/poll/os2/Makefile.in +++ b/poll/os2/Makefile.in @@ -2,6 +2,7 @@ srcdir = @srcdir@ VPATH = @srcdir@ TARGETS = \ + poll.lo \ pollset.lo \ pollacc.lo diff --git a/poll/os2/poll.c b/poll/os2/poll.c new file mode 100755 index 00000000000..ed36dc8872b --- /dev/null +++ b/poll/os2/poll.c @@ -0,0 +1,143 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_poll.h" +#include "apr_arch_networkio.h" + +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, + apr_int32_t *nsds, apr_interval_time_t timeout) +{ + int *pollset; + int i; + int num_read = 0, num_write = 0, num_except = 0, num_total; + int pos_read, pos_write, pos_except; + + for (i = 0; i < num; i++) { + if (aprset[i].desc_type == APR_POLL_SOCKET) { + num_read += (aprset[i].reqevents & APR_POLLIN) != 0; + num_write += (aprset[i].reqevents & APR_POLLOUT) != 0; + num_except += (aprset[i].reqevents & APR_POLLPRI) != 0; + } + } + + num_total = num_read + num_write + num_except; + pollset = alloca(sizeof(int) * num_total); + memset(pollset, 0, sizeof(int) * num_total); + + pos_read = 0; + pos_write = num_read; + pos_except = pos_write + num_write; + + for (i = 0; i < num; i++) { + if (aprset[i].desc_type == APR_POLL_SOCKET) { + if (aprset[i].reqevents & APR_POLLIN) { + pollset[pos_read++] = aprset[i].desc.s->socketdes; + } + + if (aprset[i].reqevents & APR_POLLOUT) { + pollset[pos_write++] = aprset[i].desc.s->socketdes; + } + + if (aprset[i].reqevents & APR_POLLPRI) { + pollset[pos_except++] = aprset[i].desc.s->socketdes; + } + + aprset[i].rtnevents = 0; + } + } + + if (timeout > 0) { + timeout /= 1000; /* convert microseconds to milliseconds */ + } + + i = select(pollset, num_read, num_write, num_except, timeout); + (*nsds) = i; + + if ((*nsds) < 0) { + return APR_FROM_OS_ERROR(sock_errno()); + } + + if ((*nsds) == 0) { + return APR_TIMEUP; + } + + pos_read = 0; + pos_write = num_read; + pos_except = pos_write + num_write; + + for (i = 0; i < num; i++) { + if (aprset[i].desc_type == APR_POLL_SOCKET) { + if (aprset[i].reqevents & APR_POLLIN) { + if (pollset[pos_read++] > 0) { + aprset[i].rtnevents |= APR_POLLIN; + } + } + + if (aprset[i].reqevents & APR_POLLOUT) { + if (pollset[pos_write++] > 0) { + aprset[i].rtnevents |= APR_POLLOUT; + } + } + + if (aprset[i].reqevents & APR_POLLPRI) { + if (pollset[pos_except++] > 0) { + aprset[i].rtnevents |= APR_POLLPRI; + } + } + } + } + + return APR_SUCCESS; +} diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c index 9d8c76a75ff..fd665e5c6ea 100644 --- a/poll/os2/pollset.c +++ b/poll/os2/pollset.c @@ -256,90 +256,3 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, *descriptors = pollset->result_set; return APR_SUCCESS; } - -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, - apr_int32_t *nsds, apr_interval_time_t timeout) -{ - int *pollset; - int i; - int num_read = 0, num_write = 0, num_except = 0, num_total; - int pos_read, pos_write, pos_except; - - for (i = 0; i < num; i++) { - if (aprset[i].desc_type == APR_POLL_SOCKET) { - num_read += (aprset[i].reqevents & APR_POLLIN) != 0; - num_write += (aprset[i].reqevents & APR_POLLOUT) != 0; - num_except += (aprset[i].reqevents & APR_POLLPRI) != 0; - } - } - - num_total = num_read + num_write + num_except; - pollset = alloca(sizeof(int) * num_total); - memset(pollset, 0, sizeof(int) * num_total); - - pos_read = 0; - pos_write = num_read; - pos_except = pos_write + num_write; - - for (i = 0; i < num; i++) { - if (aprset[i].desc_type == APR_POLL_SOCKET) { - if (aprset[i].reqevents & APR_POLLIN) { - pollset[pos_read++] = aprset[i].desc.s->socketdes; - } - - if (aprset[i].reqevents & APR_POLLOUT) { - pollset[pos_write++] = aprset[i].desc.s->socketdes; - } - - if (aprset[i].reqevents & APR_POLLPRI) { - pollset[pos_except++] = aprset[i].desc.s->socketdes; - } - - aprset[i].rtnevents = 0; - } - } - - if (timeout > 0) { - timeout /= 1000; /* convert microseconds to milliseconds */ - } - - i = select(pollset, num_read, num_write, num_except, timeout); - (*nsds) = i; - - if ((*nsds) < 0) { - return APR_FROM_OS_ERROR(sock_errno()); - } - - if ((*nsds) == 0) { - return APR_TIMEUP; - } - - pos_read = 0; - pos_write = num_read; - pos_except = pos_write + num_write; - - for (i = 0; i < num; i++) { - if (aprset[i].desc_type == APR_POLL_SOCKET) { - if (aprset[i].reqevents & APR_POLLIN) { - if (pollset[pos_read++] > 0) { - aprset[i].rtnevents |= APR_POLLIN; - } - } - - if (aprset[i].reqevents & APR_POLLOUT) { - if (pollset[pos_write++] > 0) { - aprset[i].rtnevents |= APR_POLLOUT; - } - } - - if (aprset[i].reqevents & APR_POLLPRI) { - if (pollset[pos_except++] > 0) { - aprset[i].rtnevents |= APR_POLLPRI; - } - } - } - } - - return APR_SUCCESS; -} - From 97e6a4809013565622ac95b6f7dbec1fd7030726 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 22 Nov 2003 01:53:05 +0000 Subject: [PATCH 4734/7878] Ignore -no-install switch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64786 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/aplibtool.c b/build/aplibtool.c index a9443a3a5ad..35d8a4ed0d3 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -255,6 +255,10 @@ int parse_short_opt(char *arg, cmd_data_t *cmd_data) return 2; } + if (strcmp(arg, "no-install") == 0) { + return 1; + } + return 0; } From 757eed08cf3e930f0c50c2187edadb3437dfc882 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 22 Nov 2003 04:36:26 +0000 Subject: [PATCH 4735/7878] apr_proc_other_child_check() is gone git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64787 13f79535-47bb-0310-9956-ffa450edef68 --- test/testoc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testoc.c b/test/testoc.c index e67240e1fc6..33d39c3de08 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -137,7 +137,7 @@ static void test_child_kill(CuTest *tc) /* allow time for things to settle... */ apr_sleep(apr_time_from_sec(3)); - apr_proc_other_child_check(); + apr_proc_other_child_refresh_all(APR_OC_REASON_RUNNING); CuAssertStrEquals(tc, "APR_OC_REASON_DEATH", reasonstr); } #else From c76d095a09ff7e72cbced27871ab28dd558c78cb Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 22 Nov 2003 10:53:46 +0000 Subject: [PATCH 4736/7878] This small fix allows for the passing of NULL as the descriptors arg in apr_pollset_poll. Basically if we have a single item pollset then we don't need to have the descriptors arg set as the return value is sufficient. I haven't added this for OS/2 as Brian may be moving the code into a seperate file again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64788 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index bbc4269d879..b90a0581554 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -542,7 +542,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, j++; } } - *descriptors = pollset->result_set; + if (descriptors) + *descriptors = pollset->result_set; return APR_SUCCESS; } @@ -616,7 +617,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } } - *descriptors = pollset->result_set; + if (descriptors) + *descriptors = pollset->result_set; return APR_SUCCESS; } From 1b8f8f5838735e9bcbf4477c2363f05979afdde8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 22 Nov 2003 20:44:49 +0000 Subject: [PATCH 4737/7878] restore a rather important line which was removed when APR_SO_TIMEOUT socket option was removed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64789 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index d89201d0e04..2f31bef69ae 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -144,6 +144,7 @@ apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) if (t <= 0) { sock->options &= ~APR_INCOMPLETE_READ; } + sock->timeout = t; return APR_SUCCESS; } From 09fd992046f32fdd9b82bcf41e22d88ae1a89389 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 23 Nov 2003 19:43:40 +0000 Subject: [PATCH 4738/7878] Fix the apr_thread_once_init so it works and allow the thread test to not segfault. Some other small pieces of cleanup and reformatting to make the code easier to read. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64790 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/thread.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 559233d8dc8..c2fb25ba5ad 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -122,7 +122,11 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t return stat; } - (*new)->td = spawn_thread((thread_func)dummy_worker, "apr thread", temp, (*new)); + (*new)->td = spawn_thread((thread_func)dummy_worker, + "apr thread", + temp, + (*new)); + /* Now we try to run it...*/ if (resume_thread((*new)->td) == B_NO_ERROR) { return APR_SUCCESS; @@ -154,7 +158,8 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { status_t rv = 0, ret; - if ((ret = wait_for_thread(thd->td, &rv)) == B_NO_ERROR) { + ret = wait_for_thread(thd->td, &rv); + if (ret == B_NO_ERROR) { *retval = rv; return APR_SUCCESS; } @@ -235,9 +240,9 @@ APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, *control = (apr_thread_once_t *)apr_pcalloc(p, sizeof(apr_thread_once_t)); (*control)->hit = 0; /* we haven't done it yet... */ rc = ((*control)->sem = create_sem(1, "thread_once")); - if (rc != 0) { + if (rc < 0) return rc; - } + apr_pool_cleanup_register(p, control, thread_once_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } From 1c2af8ca957ee5596b74f4b76babe12c1774d3ed Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 23 Nov 2003 20:16:59 +0000 Subject: [PATCH 4739/7878] Rumours of the demise of group information on BeOS have been greatly exaggerated :) Well, after this patch they have been anyway. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64791 13f79535-47bb-0310-9956-ffa450edef68 --- user/unix/groupinfo.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 247cd6491dd..62e576715b7 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -70,7 +70,6 @@ APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p) { struct group *gr; -#ifndef BEOS #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) struct group grp; @@ -83,7 +82,6 @@ APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, return errno; } *groupname = apr_pstrdup(p, gr->gr_name); -#endif return APR_SUCCESS; } @@ -91,7 +89,6 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, const char *groupname, apr_pool_t *p) { struct group *gr; -#ifndef BEOS #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRNAM_R) struct group grp; @@ -104,6 +101,5 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, return errno; } *groupid = gr->gr_gid; -#endif return APR_SUCCESS; } From 73b1d9cb5c0f8f96a56ec9a64be1e0c0d185384b Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 23 Nov 2003 20:33:09 +0000 Subject: [PATCH 4740/7878] Modify the beos dso code to always return a structure, adding the errormsg field as this seems to be the raison'd'etre for returning the structure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64792 13f79535-47bb-0310-9956-ffa450edef68 --- dso/beos/dso.c | 13 ++++++++----- include/arch/beos/apr_arch_dso.h | 3 +++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 087ed42e8a0..7370a814c42 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -71,14 +71,17 @@ static apr_status_t dso_cleanup(void *thedso) APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *pool) { - image_id newid; - - if((newid = load_add_on(path)) < B_NO_ERROR) - return APR_EDSOOPEN; + image_id newid = -1; *res_handle = apr_pcalloc(pool, sizeof(*res_handle)); - (*res_handle)->handle = newid; + + if((newid = load_add_on(path)) < B_NO_ERROR) { + (*res_handle)->errormsg = strerror(newid); + return APR_EDSOOPEN; + } + (*res_handle)->pool = pool; + (*res_handle)->handle = newid; apr_pool_cleanup_register(pool, *res_handle, dso_cleanup, apr_pool_cleanup_null); diff --git a/include/arch/beos/apr_arch_dso.h b/include/arch/beos/apr_arch_dso.h index c37f9f228df..8964dd24577 100644 --- a/include/arch/beos/apr_arch_dso.h +++ b/include/arch/beos/apr_arch_dso.h @@ -69,6 +69,9 @@ struct apr_dso_handle_t { image_id handle; /* Handle to the DSO loaded */ apr_pool_t *pool; + const char *errormsg; /* if the load fails, we have an error + * message here :) + */ }; #endif From 432a0067ae9ddf5fe9d311fa8aa4fa2b42518eed Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 23 Nov 2003 23:23:53 +0000 Subject: [PATCH 4741/7878] * testpipe.c (test_pipe_writefull): Wait for the child and ensure it terminates normally. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64793 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpipe.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/testpipe.c b/test/testpipe.c index 98702c0f3c5..c66fe67b7f1 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -183,6 +183,7 @@ static void test_pipe_writefull(CuTest *tc) apr_procattr_t *procattr; const char *args[2]; apr_status_t rv; + apr_exit_why_e why; rv = apr_procattr_create(&procattr, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); @@ -221,6 +222,11 @@ static void test_pipe_writefull(CuTest *tc) CuAssertIntEquals(tc, APR_SUCCESS, rv); bytes_processed = (int)apr_strtoi64(responsebuf, NULL, 10); CuAssertIntEquals(tc, iterations * bytes_per_iteration, bytes_processed); + + CuAssert(tc, "wait for child process", + apr_proc_wait(&proc, NULL, &why, APR_WAIT) == APR_CHILD_DONE); + + CuAssert(tc, "child terminated normally", why == APR_PROC_EXIT); } CuSuite *testpipe(void) From a7058578af0703e6f9d1062e1dbe9855ad07d9c0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 24 Nov 2003 00:17:24 +0000 Subject: [PATCH 4742/7878] on Unix-ish platforms, apr_wait_for_io_or_timeout() can just use poll(2) it is a perfect match for the feature set needed and avoids the setup code at object creation time currently required to use apr_pollset_poll() instead of poll(2) future: select()-based function is trivial too is any platform then left needing the support in apr/(network_io|file_io)/unix for allocating a pollset any time we create a file or socket just in case apr_wait_for_io_or_timeout() will be called? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64794 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 ++++ file_io/unix/filedup.c | 8 +++--- file_io/unix/open.c | 4 +-- file_io/unix/pipe.c | 9 ++++--- include/arch/unix/apr_arch_file_io.h | 6 +++-- include/arch/unix/apr_arch_networkio.h | 5 +++- network_io/unix/sockets.c | 3 ++- support/unix/waitio.c | 36 ++++++++++++++++++++++++++ 8 files changed, 63 insertions(+), 13 deletions(-) diff --git a/configure.in b/configure.in index 164c8c5025b..84f04c5e38f 100644 --- a/configure.in +++ b/configure.in @@ -1720,6 +1720,11 @@ fi AC_SUBST(have_in_addr) AC_SUBST(file_as_socket) +if test "$ac_cv_func_poll $file_as_socket" = "yes 1"; then + AC_DEFINE(WAITIO_USES_POLL, 1, + [Define if apr_wait_for_io_or_timeout() uses poll(2)]) +fi + # Check the types only if we have gethostbyname_r if test "$ac_cv_func_gethostbyname_r" = "yes"; then APR_CHECK_GETHOSTBYNAME_R_STYLE diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 04aa9a10570..f89e2e5a5e0 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -130,11 +130,11 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), apr_unix_file_cleanup, apr_unix_file_cleanup); - +#ifndef WAITIO_USES_POLL /* Create a pollset with room for one descriptor. */ /* ### check return codes */ (void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0); - +#endif return APR_SUCCESS; } @@ -187,10 +187,10 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, old_file->filedes = -1; apr_pool_cleanup_kill(old_file->pool, (void *)old_file, apr_unix_file_cleanup); - +#ifndef WAITIO_USES_POLL /* Create a pollset with room for one descriptor. */ /* ### check return codes */ (void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0); - +#endif return APR_SUCCESS; } diff --git a/file_io/unix/open.c b/file_io/unix/open.c index df67b765b57..54775e3c847 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -188,11 +188,11 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, (*new)->bufpos = 0; (*new)->dataRead = 0; (*new)->direction = 0; - +#ifndef WAITIO_USES_POLL /* Create a pollset with room for one descriptor. */ /* ### check return codes */ (void) apr_pollset_create(&(*new)->pollset, 1, pool, 0); - +#endif if (!(flag & APR_FILE_NOCLEANUP)) { apr_pool_cleanup_register((*new)->pool, (void *)(*new), apr_unix_file_cleanup, diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 140c98f8e5e..5ab52cbdd51 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -198,10 +198,11 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, apr_unix_file_cleanup, apr_pool_cleanup_null); } - +#ifndef WAITIO_USES_POLL /* Create a pollset with room for one descriptor. */ /* ### check return codes */ (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); +#endif return APR_SUCCESS; } @@ -233,8 +234,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out #if APR_HAS_THREADS (*in)->thlock = NULL; #endif +#ifndef WAITIO_USES_POLL (void) apr_pollset_create(&(*in)->pollset, 1, pool, 0); - +#endif (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); (*out)->pool = pool; (*out)->filedes = filedes[1]; @@ -247,8 +249,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out #if APR_HAS_THREADS (*out)->thlock = NULL; #endif +#ifndef WAITIO_USES_POLL (void) apr_pollset_create(&(*out)->pollset, 1, pool, 0); - +#endif apr_pool_cleanup_register((*in)->pool, (void *)(*in), apr_unix_file_cleanup, apr_pool_cleanup_null); apr_pool_cleanup_register((*out)->pool, (void *)(*out), apr_unix_file_cleanup, diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index aea12e79187..3ee5ab8b06c 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -64,7 +64,9 @@ #include "apr_errno.h" #include "apr_lib.h" #include "apr_thread_mutex.h" +#ifndef WAITIO_USES_POLL #include "apr_poll.h" +#endif /* System headers the file I/O library needs */ #if APR_HAVE_FCNTL_H @@ -131,10 +133,10 @@ struct apr_file_t { int buffered; enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ - +#ifndef WAITIO_USES_POLL /* if there is a timeout set, then this pollset is used */ apr_pollset_t *pollset; - +#endif /* Stuff for buffered mode */ char *buffer; int bufpos; /* Read/Write position in buffer */ diff --git a/include/arch/unix/apr_arch_networkio.h b/include/arch/unix/apr_arch_networkio.h index 4938cf6bc24..ef50273547d 100644 --- a/include/arch/unix/apr_arch_networkio.h +++ b/include/arch/unix/apr_arch_networkio.h @@ -61,7 +61,9 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" +#ifndef WAITIO_USES_POLL #include "apr_poll.h" +#endif /* System headers the network I/O library needs */ #if APR_HAVE_SYS_TYPES_H @@ -153,9 +155,10 @@ struct apr_socket_t { apr_int32_t options; apr_int32_t inherit; sock_userdata_t *userdata; - +#ifndef WAITIO_USES_POLL /* if there is a timeout set, then this pollset is used */ apr_pollset_t *pollset; +#endif }; const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 342f619ccc4..1c1638932c7 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -103,10 +103,11 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, sizeof(apr_sockaddr_t)); (*new)->remote_addr->pool = p; - +#ifndef WAITIO_USES_POLL /* Create a pollset with room for one descriptor. */ /* ### check return codes */ (void) apr_pollset_create(&(*new)->pollset, 1, p, 0); +#endif } apr_status_t apr_socket_protocol_get(apr_socket_t *sock, int *protocol) diff --git a/support/unix/waitio.c b/support/unix/waitio.c index 84a8483c78d..be918b13d5b 100644 --- a/support/unix/waitio.c +++ b/support/unix/waitio.c @@ -66,6 +66,41 @@ #ifdef USE_WAIT_FOR_IO +#ifdef WAITIO_USES_POLL + +#ifdef HAVE_POLL_H +#include +#endif +#ifdef HAVE_SYS_POLL_H +#include +#endif + +apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, + int for_read) +{ + struct pollfd pfd; + int rc, timeout; + + timeout = f ? f->timeout / 1000 : s->timeout / 1000; + pfd.fd = f ? f->filedes : s->socketdes; + pfd.events = for_read ? POLLIN : POLLOUT; + + do { + rc = poll(&pfd, 1, timeout); + } while (rc == -1 && errno == EINTR); + if (rc == 0) { + return APR_TIMEUP; + } + else if (rc > 0) { + return APR_SUCCESS; + } + else { + return errno; + } +} + +#else + apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, int for_read) { @@ -114,5 +149,6 @@ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, return status; } +#endif /* WAITIO_USES_POLL */ #endif /* USE_WAIT_FOR_IO */ From 6788512d0f23830a21a391f15ef4328a91a5d1ed Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 24 Nov 2003 11:09:03 +0000 Subject: [PATCH 4743/7878] stop stuffing the same descriptor in the pollset twice... this is not implemented for select()-based apr_pollset* and it isn't clear that there is a good reason to do so (testpoll is happy on OS X now) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64796 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/test/testpoll.c b/test/testpoll.c index 033a5ab40b8..c3c20ed85fc 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -492,21 +492,16 @@ static void pollset_remove(CuTest *tc) rv = apr_pollset_add(pollset, &pfd); CuAssertIntEquals(tc, APR_SUCCESS, rv); - pfd.desc.s = s[1]; - pfd.client_data = (void *)4; - rv = apr_pollset_add(pollset, &pfd); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - pfd.desc.s = s[3]; - pfd.client_data = (void *)5; + pfd.client_data = (void *)4; rv = apr_pollset_add(pollset, &pfd); CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 5, num); + CuAssertIntEquals(tc, 4, num); - /* now remove the pollset elements referring to desc s[1] */ + /* now remove the pollset element referring to desc s[1] */ pfd.desc.s = s[1]; pfd.client_data = (void *)999; /* not used on this call */ rv = apr_pollset_remove(pollset, &pfd); @@ -520,7 +515,7 @@ static void pollset_remove(CuTest *tc) CuAssertPtrEquals(tc, s[0], hot_files[0].desc.s); CuAssertPtrEquals(tc, (void *)3, hot_files[1].client_data); CuAssertPtrEquals(tc, s[2], hot_files[1].desc.s); - CuAssertPtrEquals(tc, (void *)5, hot_files[2].client_data); + CuAssertPtrEquals(tc, (void *)4, hot_files[2].client_data); CuAssertPtrEquals(tc, s[3], hot_files[2].desc.s); /* now remove the pollset elements referring to desc s[2] */ @@ -535,7 +530,7 @@ static void pollset_remove(CuTest *tc) CuAssertIntEquals(tc, 2, num); CuAssertPtrEquals(tc, (void *)1, hot_files[0].client_data); CuAssertPtrEquals(tc, s[0], hot_files[0].desc.s); - CuAssertPtrEquals(tc, (void *)5, hot_files[1].client_data); + CuAssertPtrEquals(tc, (void *)4, hot_files[1].client_data); CuAssertPtrEquals(tc, s[3], hot_files[1].desc.s); } From 25b1f28b3de98e25e25737719ceb772a687be2b9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 24 Nov 2003 13:22:46 +0000 Subject: [PATCH 4744/7878] // considered harmful git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64797 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 1 - 1 file changed, 1 deletion(-) diff --git a/test/sendfile.c b/test/sendfile.c index 6aff18ad09a..b9ba73e3957 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -352,7 +352,6 @@ static int client(client_socket_mode_t socket_mode, char *host) pfd.client_data = NULL; rv = apr_pollset_add(pset, &pfd); -// rv = apr_poll_socket_add(pfd, sock, APR_POLLOUT); assert(!rv); total_bytes_sent = 0; From ccc58377bc746e6dca592c4c05bceac1baa3a915 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 25 Nov 2003 09:11:10 +0000 Subject: [PATCH 4745/7878] * file_io/unix/open.c (apr_os_file_put): Create the pollset. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64798 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 54775e3c847..3a1561ec073 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -249,6 +249,12 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file)->flags = flags | APR_FILE_NOCLEANUP; (*file)->buffered = (flags & APR_BUFFERED) > 0; +#ifndef WAITIO_USES_POLL + /* Create a pollset with room for one descriptor. */ + /* ### check return codes */ + (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); +#endif + if ((*file)->buffered) { (*file)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); #if APR_HAS_THREADS From cb0b9181badb08d3b949c2edac76fbd3e496ef57 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 25 Nov 2003 19:30:02 +0000 Subject: [PATCH 4746/7878] Use the correct literal typing for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64799 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index cbff5ac6967..1eaea5183a6 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -276,14 +276,8 @@ typedef int apr_socklen_t; #endif /* Mechanisms to properly type numeric literals */ - -#ifdef __GNUC__ #define APR_INT64_C(val) (val##LL) #define APR_UINT64_C(val) (val##ULL) -#else -#define APR_INT64_C(val) (val##i64) -#define APR_UINT64_C(val) (val##Ui64) -#endif /* PROC mutex is a GLOBAL mutex on Netware */ #define APR_PROC_MUTEX_IS_GLOBAL 1 From 1bfec84d74869b7bd7b146f8de2feee6933f2227 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 25 Nov 2003 21:57:53 +0000 Subject: [PATCH 4747/7878] Need to create the pollsets for both ends of the pipe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64800 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 8f3940836b5..497c0df8d63 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -204,6 +204,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->ungetchar = -1; (*in)->thlock = (*out)->thlock = NULL; + (void) apr_pollset_create(&(*in)->pollset, 1, pool, 0); + (void) apr_pollset_create(&(*out)->pollset, 1, pool, 0); apr_pool_cleanup_register((*in)->pool, (void *)(*in), apr_unix_file_cleanup, apr_pool_cleanup_null); From 914182a2e960396362cfd801cdaf40791e3c4bd3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 30 Nov 2003 16:47:29 +0000 Subject: [PATCH 4748/7878] Add apr_socket_type_get() for retrieving the type (e.g., stream) of the socket. Submitted by: Philippe M. Chiasson Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64801 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_network_io.h | 9 ++++++++- network_io/os2/sockets.c | 5 +++++ network_io/unix/sockets.c | 6 ++++++ network_io/win32/sockets.c | 6 ++++++ test/testsockets.c | 12 ++++++++++++ 6 files changed, 40 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 9f8876ee175..2dc01835516 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Add apr_socket_type_get() for retrieving the type (e.g., stream) + of the socket. [Philippe M. Chiasson gozer cpan.org] + *) Removed deprecated interface apr_proc_other_child_check() that behaved differently between win32 and unix. The unix behavor is now accomplished with diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 27e706f7203..9449fdc8183 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -727,7 +727,14 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1, const apr_sockaddr_t *addr2); - +/** +* Return the type of the socket. +* @param sock The socket to query. +* @param type The returned type (e.g., SOCK_STREAM). +*/ +APR_DECLARE(apr_status_t) apr_socket_type_get(apr_socket_t *sock, + int *type); + /** * Given an apr_sockaddr_t and a service name, set the port for the service * @param sockaddr The apr_sockaddr_t that will have its port set diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 66949b573e9..b58c046e71d 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -240,6 +240,11 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, } } +APR_DECLARE(apr_status_t) apr_socket_type_get(apr_socket_t *sock, int *type) +{ + *type = sock->type; + return APR_SUCCESS; +} APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, apr_socket_t *sock) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 1c1638932c7..52bf434c95f 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -317,6 +317,12 @@ apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) return APR_SUCCESS; } +apr_status_t apr_socket_type_get(apr_socket_t *sock, int *type) +{ + *type = sock->type; + return APR_SUCCESS; +} + apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *sock) { sock_userdata_t *cur = sock->userdata; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index b03f8813cca..55f31140fe1 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -401,6 +401,12 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_socket_type_get(apr_socket_t *sock, int *type) +{ + *type = sock->type; + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, apr_socket_t *sock) { diff --git a/test/testsockets.c b/test/testsockets.c index 87f46a02769..1ba2ea11174 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -72,10 +72,16 @@ static void tcp_socket(CuTest *tc) { apr_status_t rv; apr_socket_t *sock = NULL; + int type; rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, 0, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); CuAssertPtrNotNull(tc, sock); + + rv = apr_socket_type_get(sock, &type); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, SOCK_STREAM, type); + apr_socket_close(sock); } @@ -83,10 +89,16 @@ static void udp_socket(CuTest *tc) { apr_status_t rv; apr_socket_t *sock = NULL; + int type; rv = apr_socket_create(&sock, APR_INET, SOCK_DGRAM, 0, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); CuAssertPtrNotNull(tc, sock); + + rv = apr_socket_type_get(sock, &type); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, SOCK_DGRAM, type); + apr_socket_close(sock); } From 4979c2bdebd1b59af77b4f03362fd0c998966a15 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 2 Dec 2003 14:24:24 +0000 Subject: [PATCH 4749/7878] remove botched e-mail address git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64802 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 2dc01835516..f72afb876a8 100644 --- a/CHANGES +++ b/CHANGES @@ -8,7 +8,7 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 *) Add apr_socket_type_get() for retrieving the type (e.g., stream) - of the socket. [Philippe M. Chiasson gozer cpan.org] + of the socket. [Philippe M. Chiasson] *) Removed deprecated interface apr_proc_other_child_check() that behaved differently between win32 and unix. From 042aa8e5fdbd40c87a3b4fba484dae0822596181 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 3 Dec 2003 00:04:42 +0000 Subject: [PATCH 4750/7878] move the implementations of apr atomics out of the public header file in order to . aid in keeping the different flavors consistent . prevent bug fixes from requiring that apps be rebuilt Reviewed and/or fixed by: Brad Nicholes, Greg Marr git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64803 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/netware/apr_atomic.c | 51 +++- atomic/os390/atomic.c | 58 ++++- atomic/unix/apr_atomic.c | 195 ++++++++++++++ include/apr_atomic.h | 297 +--------------------- include/arch/unix/apr_arch_thread_mutex.h | 2 +- test/testatomic.c | 4 +- 6 files changed, 308 insertions(+), 299 deletions(-) diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index 243c0f576eb..9c8dfea1b00 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -52,13 +52,58 @@ * . */ - #include "apr.h" #include "apr_atomic.h" -int apr_atomic_dec(apr_atomic_t *mem) +#include + +APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *pool) +{ + return APR_SUCCESS; +} + +APR_DECLARE(void) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + atomic_add((unsigned long *)mem,(unsigned long)val); +} + +APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + atomic_sub((unsigned long *)mem,(unsigned long)val); +} + +APR_DECLARE(void) apr_atomic_inc32(volatile apr_uint32_t *mem) +{ + atomic_inc((unsigned long *)mem); +} + +APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) { - atomic_dec(mem); + *mem = val; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) +{ + return *mem; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with,apr_uint32_t cmp) +{ + return atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + return atomic_xchg((unsigned long *)mem,(unsigned long)val); +} + +APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + atomic_dec((unsigned long *)mem); return *mem; } +APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + return (void*)atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with); +} diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c index 1c6d7db1bfd..08875935219 100644 --- a/atomic/os390/atomic.c +++ b/atomic/os390/atomic.c @@ -56,21 +56,56 @@ #include "apr.h" #include "apr_atomic.h" -#if APR_HAS_THREADS +#include -apr_int32_t apr_atomic_add32(volatile apr_atomic_t *mem, apr_int32_t val) +apr_status_t apr_atomic_init(apr_pool_t *p) { - apr_atomic_t old, new_val; + return APR_SUCCESS; +} + +void apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t old, new_val; old = *mem; /* old is automatically updated on cs failure */ do { new_val = old + val; } while (__cs(&old, (cs_t *)mem, new_val)); +} + +void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_atomic_add32(mem, -val); +} + +void apr_atomic_inc32(volatile apr_uint32_t *mem) +{ + apr_atomic_add32(mem, 1); +} + +int apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + apr_uint32_t old, new_val; + + old = *mem; /* old is automatically updated on cs failure */ + do { + new_val = old - 1; + } while (__cs(&old, (cs_t *)mem, new_val)); + + return new_val != 0; +} + +apr_uint32_t apr_atomic_read32(volatile apr_uint32_t *mem) +{ + return *mem; +} - return new_val; +void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + *mem = val; } -apr_uint32_t apr_atomic_cas32(volatile apr_atomic_t *mem, apr_uint32_t swap, +apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t swap, apr_uint32_t cmp) { apr_uint32_t old = cmp; @@ -79,4 +114,15 @@ apr_uint32_t apr_atomic_cas32(volatile apr_atomic_t *mem, apr_uint32_t swap, return old; /* old is automatically updated from mem on cs failure */ } -#endif /* APR_HAS_THREADS */ +apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t old, new_val; + + old = *mem; /* old is automatically updated on cs failure */ + do { + new_val = val; + } while (__cs(&old, (cs_t *)mem, new_val)); + + return old; +} + diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 34ef5427589..b24dd72e229 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -56,6 +56,193 @@ #include "apr_atomic.h" #include "apr_thread_mutex.h" +#if defined(WIN32) + +#define apr_atomic_t LONG /* not used */ + +APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) +{ + return APR_SUCCESS; +} + +APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + return InterlockedCompareExchangePointer(mem, with, cmp); +} + +/* + * Remapping function pointer type to accept apr_uint32_t's type-safely + * as the arguments for as our apr_atomic_foo32 Functions + */ +typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_fn) + (apr_uint32_t volatile *); +typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_fn) + (apr_uint32_t volatile *, + apr_uint32_t); +typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_val_fn) + (apr_uint32_t volatile *, + apr_uint32_t, apr_uint32_t); + +APR_DECLARE(void) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val); +} +#define APR_OVERRIDE_ATOMIC_ADD32 + +APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, -val); +} +#define APR_OVERRIDE_ATOMIC_SUB32 + +APR_DECLARE(void) apr_atomic_inc32(volatile apr_uint32_t *mem) +{ + ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem); +} +#define APR_OVERRIDE_ATOMIC_INC32 + +APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + return ((apr_atomic_win32_ptr_fn)InterlockedDecrement)(mem); +} +#define APR_OVERRIDE_ATOMIC_DEC32 + +APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); +} +#define APR_OVERRIDE_ATOMIC_SET32 + +APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, + apr_uint32_t cmp) +{ + return ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem, with, cmp); +} +#define APR_OVERRIDE_ATOMIC_CAS32 + +APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + return ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); +} +#define APR_OVERRIDE_ATOMIC_XCHG32 + +#endif /* WIN32 */ + +#if defined(__FreeBSD__) && !defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC + +#include + +#define apr_atomic_t apr_uint32_t /* unused */ + +APR_DECLARE(void) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + atomic_add_int(mem, val); +} +#define APR_OVERRIDE_ATOMIC_ADD32 + +APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + return atomic_subtract_int(mem, 1); +} +#define APR_OVERRIDE_ATOMIC_DEC32 + +APR_DECLARE(void) apr_atomic_inc32(volatile apr_uint32_t *mem) +{ + atomic_add_int(mem, 1); +} +#define APR_OVERRIDE_ATOMIC_INC32 + +APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + atomic_set_int(mem, val); +} +#define APR_OVERRIDE_ATOMIC_SET32 + +#endif /* __FreeBSD__ && !__i386__ */ + +#if (defined(__linux__) || defined(__EMX__) || defined(__FreeBSD__)) \ + && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC + +/* #define apr_atomic_t apr_uint32_t UNUSED */ + +APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, + apr_uint32_t with, + apr_uint32_t cmp) +{ + apr_uint32_t prev; + + asm volatile ("lock; cmpxchgl %1, %2" + : "=a" (prev) + : "r" (with), "m" (*(mem)), "0"(cmp) + : "memory"); + return prev; +} +#define APR_OVERRIDE_ATOMIC_CAS32 + +APR_DECLARE(void) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + asm volatile ("lock; addl %1, %0" + : + : "m" (*(mem)), "r" (val) + : "memory"); +} +#define APR_OVERRIDE_ATOMIC_ADD32 + +APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + asm volatile ("lock; subl %1, %0" + : + : "m" (*(mem)), "r" (val) + : "memory"); +} +#define APR_OVERRIDE_ATOMIC_SUB32 + +APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + int prev; + + asm volatile ("mov $0, %%eax;\n\t" + "lock; decl %1;\n\t" + "setnz %%al;\n\t" + "mov %%eax, %0" + : "=r" (prev) + : "m" (*(mem)) + : "memory", "%eax"); + return prev; +} +#define APR_OVERRIDE_ATOMIC_DEC32 + +APR_DECLARE(void) apr_atomic_inc32(volatile apr_uint32_t *mem) +{ + asm volatile ("lock; incl %0" + : + : "m" (*(mem)) + : "memory"); +} +#define APR_OVERRIDE_ATOMIC_INC32 + +APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + *mem = val; +} +#define APR_OVERRIDE_ATOMIC_SET32 + +APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t prev = val; + + asm volatile ("lock; xchgl %0, %1" + : "=r" (prev) + : "m" (*(mem)), "0"(prev) + : "memory"); + return prev; +} +#define APR_OVERRIDE_ATOMIC_XCHG32 + +/*#define apr_atomic_init(pool) APR_SUCCESS*/ + +#endif /* (__linux__ || __EMX__ || __FreeBSD__) && __i386__ */ + #if !defined(apr_atomic_init) && !defined(APR_OVERRIDE_ATOMIC_INIT) #if APR_HAS_THREADS @@ -242,3 +429,11 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) #endif /* APR_HAS_THREADS */ } #endif /*!defined(apr_atomic_casptr) && !defined(APR_OVERRIDE_ATOMIC_CASPTR) */ + +#if !defined(APR_OVERRIDE_ATOMIC_READ32) +APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) +{ + return *mem; +} +#endif + diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 14f39c9967d..3750429cfdd 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -67,13 +67,6 @@ #include "apr.h" #include "apr_pools.h" -/* Platform includes for atomics */ -#if defined(NETWARE) || defined(__MVS__) /* OS/390 */ -#include -#elif defined(__FreeBSD__) && !defined(__i386__) -#include -#endif - #ifdef __cplusplus extern "C" { #endif @@ -84,21 +77,13 @@ extern "C" { * @{ */ -/* easiest way to get these documented for the moment */ -#if defined(DOXYGEN) -/** - * structure for holding a atomic value. - * this number >only< has a 24 bit size on some platforms - */ -typedef apr_atomic_t; - /** * this function is required on some platforms to initialize the * atomic operation's internal structures * @param p pool * @return APR_SUCCESS on successful completion */ -apr_status_t apr_atomic_init(apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p); /* * Atomic operations on 32-bit values @@ -110,40 +95,40 @@ apr_status_t apr_atomic_init(apr_pool_t *p); * atomically read an apr_uint32_t from memory * @param mem the pointer */ -apr_uint32_t apr_atomic_read32(volatile apr_uint32_t *mem); +APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem); /** * atomically set an apr_uint32_t in memory * @param mem pointer to the object */ -void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val); +APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val); /** * atomically add 'val' to an apr_uint32_t * @param mem pointer to the object * @param val amount to add */ -void apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val); +APR_DECLARE(void) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val); /** * atomically subtract 'val' from an apr_uint32_t * @param mem pointer to the object * @param val amount to subtract */ -void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val); +APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val); /** * atomically increment an apr_uint32_t by 1 * @param mem pointer to the object */ -void apr_atomic_inc32(volatile apr_uint32_t *mem); +APR_DECLARE(void) apr_atomic_inc32(volatile apr_uint32_t *mem); /** * atomically decrement an apr_uint32_t by 1 * @param mem pointer to the atomic value * @return zero if the value becomes zero on decrement, otherwise non-zero */ -int apr_atomic_dec32(volatile apr_uint32_t *mem); +APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem); /** * compare an apr_uint32_t's value with 'cmp'. @@ -153,7 +138,7 @@ int apr_atomic_dec32(volatile apr_uint32_t *mem); * @param cmp the value to compare it to * @return the old value of *mem */ -apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, +APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, apr_uint32_t cmp); /** @@ -162,7 +147,7 @@ apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, * @param val what to swap it with * @return the old value of *mem */ -apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val); +APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val); /** * compare the pointer's value with cmp. @@ -172,269 +157,7 @@ apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val); * @param cmp the value to compare it to * @return the old value of the pointer */ -void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); -#else /* !DOXYGEN */ - -/* The following definitions provide optimized, OS-specific - * implementations of the APR atomic functions on various - * platforms. Any atomic operation that isn't redefined as - * a macro here will be declared as a function later, and - * apr_atomic.c will provide a mutex-based default implementation. - */ - -#if defined(WIN32) - -#define apr_atomic_t LONG - -#define apr_atomic_init(pool) APR_SUCCESS -#define apr_atomic_casptr(mem,with,cmp) InterlockedCompareExchangePointer(mem,with,cmp) - -/* - * Remapping function pointer type to accept apr_uint32_t's type-safely - * as the arguments for as our apr_atomic_foo32 Functions - */ -typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_fn) - (apr_uint32_t volatile *); -typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_fn) - (apr_uint32_t volatile *, - apr_uint32_t); -typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_val_fn) - (apr_uint32_t volatile *, - apr_uint32_t, apr_uint32_t); - -#define apr_atomic_add32(mem, val) \ - ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem,val) -#define apr_atomic_sub32(mem, val) \ - ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem,-(val)) -#define apr_atomic_inc32(mem) \ - ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem) -#define apr_atomic_dec32(mem) \ - ((apr_atomic_win32_ptr_fn)InterlockedDecrement)(mem) -#define apr_atomic_set32(mem, val) \ - ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem,val) -#define apr_atomic_read32(mem) (*(mem)) -#define apr_atomic_cas32(mem,with,cmp) \ - ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem,with,cmp) -#define apr_atomic_xchg32(mem,val) \ - ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem,val) - -#elif defined(NETWARE) - -#define apr_atomic_init(pool) APR_SUCCESS -#define apr_atomic_add32(mem, val) atomic_add((unsigned long *)(mem),(unsigned long)(val)) -#define apr_atomic_sub32(mem, val) atomic_sub((unsigned long *)(mem),(unsigned long)(val)) -#define apr_atomic_inc32(mem) atomic_inc((unsigned long *)(mem)) -#define apr_atomic_set32(mem, val) (*mem = val) -#define apr_atomic_read32(mem) (*mem) -#define apr_atomic_cas32(mem,with,cmp) atomic_cmpxchg((unsigned long *)(mem),(unsigned long)(cmp),(unsigned long)(with)) -#define apr_atomic_xchg32(mem, val) atomic_xchg((unsigned long *)(mem),(unsigned long)val) - -int apr_atomic_dec32(apr_uint32_t *mem); -void *apr_atomic_casptr(void **mem, void *with, const void *cmp); - -#define APR_OVERRIDE_ATOMIC_READ32 1 -#define APR_OVERRIDE_ATOMIC_SET32 1 -#define APR_OVERRIDE_ATOMIC_ADD32 1 -#define APR_OVERRIDE_ATOMIC_SUB32 1 -#define APR_OVERRIDE_ATOMIC_INC32 1 -#define APR_OVERRIDE_ATOMIC_DEC32 1 -#define APR_OVERRIDE_ATOMIC_CAS32 1 -#define APR_OVERRIDE_ATOMIC_XCHG32 1 - -#define APR_OVERRIDE_ATOMIC_CASPTR 1 - -inline int apr_atomic_dec32(apr_uint32_t *mem) -{ - atomic_dec((unsigned long *)mem); - return *mem; -} - -inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) -{ - return (void*)atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with); -} - -#define APR_OVERRIDE_ATOMIC_READ 1 -#define APR_OVERRIDE_ATOMIC_SET 1 -#define APR_OVERRIDE_ATOMIC_ADD 1 -#define APR_OVERRIDE_ATOMIC_INC 1 -#define APR_OVERRIDE_ATOMIC_DEC 1 -#define APR_OVERRIDE_ATOMIC_CAS 1 - -#elif defined(__FreeBSD__) && !defined(__i386__) - -#define apr_atomic_t apr_uint32_t -#define apr_atomic_add32(mem, val) atomic_add_int(mem,val) -#define apr_atomic_dec32(mem) atomic_subtract_int(mem,1) -#define apr_atomic_inc32(mem) atomic_add_int(mem,1) -#define apr_atomic_set32(mem, val) atomic_set_int(mem, val) -#define apr_atomic_read32(mem) (*mem) - -#elif (defined(__linux__) || defined(__EMX__) || defined(__FreeBSD__)) \ - && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC - -#define apr_atomic_t apr_uint32_t -#define apr_atomic_cas32(mem,with,cmp) \ -({ apr_atomic_t prev; \ - asm volatile ("lock; cmpxchgl %1, %2" \ - : "=a" (prev) \ - : "r" (with), "m" (*(mem)), "0"(cmp) \ - : "memory"); \ - prev;}) - -#define apr_atomic_add32(mem, val) \ - asm volatile ("lock; addl %1, %0" \ - : \ - : "m" (*(mem)), "r" (val) \ - : "memory") - -#define apr_atomic_sub32(mem, val) \ - asm volatile ("lock; subl %1, %0" \ - : \ - : "m" (*(mem)), "r" (val) \ - : "memory") - -#define apr_atomic_dec32(mem) \ -({ int prev; \ - asm volatile ("mov $0, %%eax;\n\t" \ - "lock; decl %1;\n\t" \ - "setnz %%al;\n\t" \ - "mov %%eax, %0" \ - : "=r" (prev) \ - : "m" (*(mem)) \ - : "memory", "%eax"); \ - prev;}) - -#define apr_atomic_inc32(mem) \ - asm volatile ("lock; incl %0" \ - : \ - : "m" (*(mem)) \ - : "memory") - -#define apr_atomic_set32(mem, val) (*(mem) = val) -#define apr_atomic_read32(mem) (*(mem)) - -#define apr_atomic_xchg32(mem,val) \ -({ apr_uint32_t prev = val; \ - asm volatile ("lock; xchgl %0, %1" \ - : "=r" (prev) \ - : "m" (*(mem)), "0"(prev) \ - : "memory"); \ - prev;}) - -/*#define apr_atomic_init(pool) APR_SUCCESS*/ - -#elif defined(__MVS__) /* OS/390 */ - -#define apr_atomic_t cs_t - -apr_int32_t apr_atomic_add32(volatile apr_atomic_t *mem, apr_int32_t val); -apr_uint32_t apr_atomic_cas32(volatile apr_atomic_t *mem, apr_uint32_t swap, - apr_uint32_t cmp); -#define APR_OVERRIDE_ATOMIC_ADD 1 -#define APR_OVERRIDE_ATOMIC_CAS 1 - -#define apr_atomic_inc32(mem) apr_atomic_add32(mem, 1) -#define apr_atomic_dec32(mem) apr_atomic_add32(mem, -1) -/*#define apr_atomic_init(pool) APR_SUCCESS*/ - -/* warning: the following two operations, _read and _set, are atomic - * if the memory variables are aligned (the usual case). - * - * If you try really hard and manage to mis-align them, they are not - * guaranteed to be atomic on S/390. But then your program will blow up - * with SIGBUS on a sparc, or with a S0C6 abend if you use the mis-aligned - * variables with other apr_atomic_* operations on OS/390. - */ - -#define apr_atomic_read32(p) (*p) -#define apr_atomic_set32(mem, val) (*mem = val) - -#endif /* end big if-elseif switch for platform-specifics */ - - -/* Default implementation of the atomic API - * The definitions above may override some or all of the - * atomic functions with optimized, platform-specific versions. - * Any operation that hasn't been overridden as a macro above - * is declared as a function here, unless APR_OVERRIDE_ATOMIC_[OPERATION] - * is defined. (The purpose of the APR_OVERRIDE_ATOMIC_* is - * to allow a platform to declare an apr_atomic_*() function - * with a different signature than the default.) - */ - -#if !defined(apr_atomic_t) -#define apr_atomic_t apr_uint32_t -#endif - -#if !defined(apr_atomic_init) && !defined(APR_OVERRIDE_ATOMIC_INIT) -apr_status_t apr_atomic_init(apr_pool_t *p); -#endif - -#if !defined(apr_atomic_read32) && !defined(APR_OVERRIDE_ATOMIC_READ32) -#define apr_atomic_read32(p) *p -#endif - -#if !defined(apr_atomic_set32) && !defined(APR_OVERRIDE_ATOMIC_SET32) -void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val); -#define APR_ATOMIC_NEED_DEFAULT_INIT 1 -#endif - -#if !defined(apr_atomic_add32) && !defined(APR_OVERRIDE_ATOMIC_ADD32) -void apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val); -#define APR_ATOMIC_NEED_DEFAULT_INIT 1 -#endif - -#if !defined(apr_atomic_sub32) && !defined(APR_OVERRIDE_ATOMIC_SUB32) -void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val); -#define APR_ATOMIC_NEED_DEFAULT_INIT 1 -#endif - -#if !defined(apr_atomic_inc32) && !defined(APR_OVERRIDE_ATOMIC_INC32) -void apr_atomic_inc32(volatile apr_uint32_t *mem); -#define APR_ATOMIC_NEED_DEFAULT_INIT 1 -#endif - -#if !defined(apr_atomic_dec32) && !defined(APR_OVERRIDE_ATOMIC_DEC32) -int apr_atomic_dec32(volatile apr_uint32_t *mem); -#define APR_ATOMIC_NEED_DEFAULT_INIT 1 -#endif - -#if !defined(apr_atomic_cas32) && !defined(APR_OVERRIDE_ATOMIC_CAS32) -apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, - apr_uint32_t cmp); -#define APR_ATOMIC_NEED_DEFAULT_INIT 1 -#endif - -#if !defined(apr_atomic_xchg32) && !defined(APR_OVERRIDE_ATOMIC_XCHG32) -apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val); -#define APR_ATOMIC_NEED_DEFAULT_INIT 1 -#endif - -#if !defined(apr_atomic_casptr) && !defined(APR_OVERRIDE_ATOMIC_CASPTR) -#if APR_SIZEOF_VOIDP == 4 -#define apr_atomic_casptr(mem, with, cmp) (void *)apr_atomic_cas32((apr_uint32_t *)(mem), (long)(with), (long)cmp) -#else -void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); -#define APR_ATOMIC_NEED_DEFAULT_INIT 1 -#endif -#endif - -#ifndef APR_ATOMIC_NEED_DEFAULT_INIT -#define APR_ATOMIC_NEED_DEFAULT_INIT 0 -#endif - -/* If we're using the default versions of any of the atomic functions, - * we'll need the atomic init to set up mutexes. If a platform-specific - * override above has replaced the atomic_init with a macro, it's an error. - */ -#if APR_ATOMIC_NEED_DEFAULT_INIT -#if defined(apr_atomic_init) || defined(APR_OVERRIDE_ATOMIC_INIT) -#error Platform has redefined apr_atomic_init, but other default atomics require a default apr_atomic_init -#endif -#endif /* APR_ATOMIC_NEED_DEFAULT_INIT */ - -#endif /* !DOXYGEN */ +APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); /** @} */ diff --git a/include/arch/unix/apr_arch_thread_mutex.h b/include/arch/unix/apr_arch_thread_mutex.h index a8171e0e4af..0982a1528a5 100644 --- a/include/arch/unix/apr_arch_thread_mutex.h +++ b/include/arch/unix/apr_arch_thread_mutex.h @@ -71,7 +71,7 @@ struct apr_thread_mutex_t { apr_pool_t *pool; pthread_mutex_t mutex; volatile apr_os_thread_t owner; - volatile apr_atomic_t owner_ref; + volatile apr_uint32_t owner_ref; char nested; /* a boolean */ }; #endif diff --git a/test/testatomic.c b/test/testatomic.c index 8f2b3010966..8134864fc1e 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -74,7 +74,7 @@ #endif apr_pool_t *context; -apr_atomic_t y; /* atomic locks */ +apr_uint32_t y; /* atomic locks */ apr_uint32_t y32; static apr_status_t check_basic_atomics32(void) @@ -199,7 +199,7 @@ volatile long z = 0; /* no locks */ int value = 0; apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ -#define NUM_THREADS 50 +#define NUM_THREADS 20 #define NUM_ITERATIONS 200000 void * APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data) { From 9a69a7b27ae10369cb661e559b21c6b23e093375 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 3 Dec 2003 00:10:03 +0000 Subject: [PATCH 4751/7878] apr_atomic_t is dead git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64804 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index b24dd72e229..b181f6cada9 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -58,8 +58,6 @@ #if defined(WIN32) -#define apr_atomic_t LONG /* not used */ - APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) { return APR_SUCCESS; @@ -132,8 +130,6 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint #include -#define apr_atomic_t apr_uint32_t /* unused */ - APR_DECLARE(void) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { atomic_add_int(mem, val); @@ -163,8 +159,6 @@ APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) #if (defined(__linux__) || defined(__EMX__) || defined(__FreeBSD__)) \ && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC -/* #define apr_atomic_t apr_uint32_t UNUSED */ - APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, apr_uint32_t cmp) From 251047f290671da8c448e843dee6b34f7d2d1cdb Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 3 Dec 2003 01:05:07 +0000 Subject: [PATCH 4752/7878] move win32 atomic functions out of the unix file (which wasn't built on win32 anyway) and into a unique file apr_atomic_casptr() is busted for me on win32, as I am missing the magic bits for InterlockedCompareExchangePointer() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64805 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 8 +++ atomic/unix/apr_atomic.c | 70 ---------------------- atomic/win32/apr_atomic.c | 121 ++++++++++++++++++++++++++++++++++++++ libapr.dsp | 8 +++ 4 files changed, 137 insertions(+), 70 deletions(-) create mode 100644 atomic/win32/apr_atomic.c diff --git a/apr.dsp b/apr.dsp index 5dd315d12dc..08c9111083c 100644 --- a/apr.dsp +++ b/apr.dsp @@ -84,6 +84,14 @@ LIB32=link.exe -lib # Begin Group "Source Files" # PROP Default_Filter ".c" +# Begin Group "atomic" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\atomic\win32\apr_atomic.c +# End Source File +# End Group # Begin Group "dso" # PROP Default_Filter "" diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index b181f6cada9..c7acfc22c6f 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -56,76 +56,6 @@ #include "apr_atomic.h" #include "apr_thread_mutex.h" -#if defined(WIN32) - -APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) -{ - return APR_SUCCESS; -} - -APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) -{ - return InterlockedCompareExchangePointer(mem, with, cmp); -} - -/* - * Remapping function pointer type to accept apr_uint32_t's type-safely - * as the arguments for as our apr_atomic_foo32 Functions - */ -typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_fn) - (apr_uint32_t volatile *); -typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_fn) - (apr_uint32_t volatile *, - apr_uint32_t); -typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_val_fn) - (apr_uint32_t volatile *, - apr_uint32_t, apr_uint32_t); - -APR_DECLARE(void) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val); -} -#define APR_OVERRIDE_ATOMIC_ADD32 - -APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, -val); -} -#define APR_OVERRIDE_ATOMIC_SUB32 - -APR_DECLARE(void) apr_atomic_inc32(volatile apr_uint32_t *mem) -{ - ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem); -} -#define APR_OVERRIDE_ATOMIC_INC32 - -APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) -{ - return ((apr_atomic_win32_ptr_fn)InterlockedDecrement)(mem); -} -#define APR_OVERRIDE_ATOMIC_DEC32 - -APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); -} -#define APR_OVERRIDE_ATOMIC_SET32 - -APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, - apr_uint32_t cmp) -{ - return ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem, with, cmp); -} -#define APR_OVERRIDE_ATOMIC_CAS32 - -APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - return ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); -} -#define APR_OVERRIDE_ATOMIC_XCHG32 - -#endif /* WIN32 */ - #if defined(__FreeBSD__) && !defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC #include diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c new file mode 100644 index 00000000000..624b46a657d --- /dev/null +++ b/atomic/win32/apr_atomic.c @@ -0,0 +1,121 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_atomic.h" +#include "apr_thread_mutex.h" + +APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) +{ + return APR_SUCCESS; +} + +APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + return InterlockedCompareExchangePointer(mem, with, cmp); +} + +/* + * Remapping function pointer type to accept apr_uint32_t's type-safely + * as the arguments for as our apr_atomic_foo32 Functions + */ +typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_fn) + (apr_uint32_t volatile *); +typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_fn) + (apr_uint32_t volatile *, + apr_uint32_t); +typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_val_fn) + (apr_uint32_t volatile *, + apr_uint32_t, apr_uint32_t); + +APR_DECLARE(void) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val); +} + +APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, -val); +} + +APR_DECLARE(void) apr_atomic_inc32(volatile apr_uint32_t *mem) +{ + ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem); +} + +APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + return ((apr_atomic_win32_ptr_fn)InterlockedDecrement)(mem); +} + +APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) +{ + return *mem; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, + apr_uint32_t cmp) +{ + return ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem, with, cmp); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + return ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); +} diff --git a/libapr.dsp b/libapr.dsp index 6508da3b564..93dca9dd4a8 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -90,6 +90,14 @@ LINK32=link.exe # Begin Group "Source Files" # PROP Default_Filter ".c" +# Begin Group "atomic" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\atomic\win32\apr_atomic.c +# End Source File +# End Group # Begin Group "dso" # PROP Default_Filter "" From 656dcd08a1984a9435e24feccd63a75ea1401971 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 3 Dec 2003 12:36:42 +0000 Subject: [PATCH 4753/7878] remove apr_sockaddr_ip_set() API remove comment in apr_socket_connect() documentation mentioning that the sockaddr parameter can be NULL git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64806 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 1 + include/apr_network_io.h | 13 +------------ network_io/unix/sockaddr.c | 27 --------------------------- 3 files changed, 2 insertions(+), 39 deletions(-) diff --git a/CHANGES b/CHANGES index f72afb876a8..44eb34593f1 100644 --- a/CHANGES +++ b/CHANGES @@ -76,6 +76,7 @@ Changes with APR 1.0 apr_setsocketopt -> apr_socket_opt_set apr_shutdown -> apr_socket_shutdown apr_signal_get_description -> apr_signal_description_get + apr_sockaddr_ip_set -> apr_sockaddr_info_get apr_socket_create_ex -> apr_socket_create apr_socket_set_inherit -> apr_socket_inherit_set apr_socket_unset_inherit -> apr_socket_inherit_unset diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 9449fdc8183..0e6a645dc28 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -371,9 +371,7 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new_sock, * Issue a connection request to a socket either on the same machine * or a different one. * @param sock The socket we wish to use for our side of the connection - * @param sa The address of the machine we wish to connect to. If NULL, - * APR assumes that the sockaddr_in in the apr_socket is - * completely filled out. + * @param sa The address of the machine we wish to connect to. */ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa); @@ -695,15 +693,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, apr_sockaddr_t *sockaddr); -/** - * Set the IP address in an APR socket address. - * @param sockaddr The socket address to use - * @param addr The IP address to attach to the socket. - * Use APR_ANYADDR to use any IP addr on the machine. - */ -APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, - const char *addr); - /** * Return the IP address (in numeric address string format) in * an APR socket address. APR will allocate storage for the IP address diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 24a7019ff6f..51ccd0af35d 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -145,33 +145,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, return APR_SUCCESS; } -/* XXX assumes IPv4... I don't think this function is needed anyway - * since we have apr_sockaddr_info_get(), but we need to clean up Apache's - * listen.c a bit more first. - */ -APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, - const char *addr) -{ - apr_uint32_t ipaddr; - - if (!strcmp(addr, APR_ANYADDR)) { - sockaddr->sa.sin.sin_addr.s_addr = htonl(INADDR_ANY); - return APR_SUCCESS; - } - - ipaddr = inet_addr(addr); - if (ipaddr == (apr_uint32_t)-1) { -#ifdef WIN32 - return WSAEADDRNOTAVAIL; -#else - return errno; -#endif - } - - sockaddr->sa.sin.sin_addr.s_addr = ipaddr; - return APR_SUCCESS; -} - APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, apr_sockaddr_t *sockaddr) { From a5f18bd6ce21699d8bc984582b5e59205718461a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 3 Dec 2003 23:55:52 +0000 Subject: [PATCH 4754/7878] Add atomic.c to the netware build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64807 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index a4a7e7834d9..e4cc4458854 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -236,6 +236,7 @@ FILES_nlm_exports = \ # Paths must all use the '/' character # FILES_lib_objs = \ + $(OBJDIR)/apr_atomic.o \ $(OBJDIR)/apr_cpystrn.o \ $(OBJDIR)/apr_fnmatch.o \ $(OBJDIR)/apr_getpass.o \ @@ -343,6 +344,10 @@ endif # Any specialized rules here # +$(OBJDIR)/%.o: atomic/netware/%.c $(OBJDIR)\cc.opt + @echo Compiling $< + $(CC) atomic\netware\$( Date: Thu, 4 Dec 2003 20:06:03 +0000 Subject: [PATCH 4755/7878] apr_atomic_add32() and apr_atomic_inc32() now return values (the old value) Submitted by: gregames (all the hard bits) and trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64808 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/netware/apr_atomic.c | 8 +++---- atomic/os390/atomic.c | 16 +++++++++---- atomic/unix/apr_atomic.c | 46 ++++++++++++++++++++++++------------- atomic/win32/apr_atomic.c | 9 ++++---- include/apr_atomic.h | 6 +++-- 5 files changed, 54 insertions(+), 31 deletions(-) diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index 9c8dfea1b00..55feb55638d 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -62,9 +62,9 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *pool) return APR_SUCCESS; } -APR_DECLARE(void) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { - atomic_add((unsigned long *)mem,(unsigned long)val); + return atomic_add((unsigned long *)mem,(unsigned long)val); } APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) @@ -72,9 +72,9 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) atomic_sub((unsigned long *)mem,(unsigned long)val); } -APR_DECLARE(void) apr_atomic_inc32(volatile apr_uint32_t *mem) +APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) { - atomic_inc((unsigned long *)mem); + return atomic_inc((unsigned long *)mem); } APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c index 08875935219..3adeb357615 100644 --- a/atomic/os390/atomic.c +++ b/atomic/os390/atomic.c @@ -63,24 +63,30 @@ apr_status_t apr_atomic_init(apr_pool_t *p) return APR_SUCCESS; } -void apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { apr_uint32_t old, new_val; old = *mem; /* old is automatically updated on cs failure */ do { new_val = old + val; - } while (__cs(&old, (cs_t *)mem, new_val)); + } while (__cs(&old, (cs_t *)mem, new_val)); + return old; } void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) { - apr_atomic_add32(mem, -val); + apr_uint32_t old, new_val; + + old = *mem; /* old is automatically updated on cs failure */ + do { + new_val = old - val; + } while (__cs(&old, (cs_t *)mem, new_val)); } -void apr_atomic_inc32(volatile apr_uint32_t *mem) +apr_uint32_t apr_atomic_inc32(volatile apr_uint32_t *mem) { - apr_atomic_add32(mem, 1); + return apr_atomic_add32(mem, 1); } int apr_atomic_dec32(volatile apr_uint32_t *mem) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index c7acfc22c6f..85cd45e2025 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -60,9 +60,9 @@ #include -APR_DECLARE(void) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { - atomic_add_int(mem, val); + return atomic_add_int(mem, val); } #define APR_OVERRIDE_ATOMIC_ADD32 @@ -72,9 +72,9 @@ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) } #define APR_OVERRIDE_ATOMIC_DEC32 -APR_DECLARE(void) apr_atomic_inc32(volatile apr_uint32_t *mem) +APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) { - atomic_add_int(mem, 1); + return atomic_add_int(mem, 1); } #define APR_OVERRIDE_ATOMIC_INC32 @@ -103,12 +103,13 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, } #define APR_OVERRIDE_ATOMIC_CAS32 -APR_DECLARE(void) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { - asm volatile ("lock; addl %1, %0" - : - : "m" (*(mem)), "r" (val) - : "memory"); + asm volatile ("lock; xadd %1, (%2)" + : "=r"(val) /* output, same as 1st input */ + : "r"(val), "r"(mem) /* inputs */ + : "%1","memory"); /* tell gcc they are clobbered */ + return val; } #define APR_OVERRIDE_ATOMIC_ADD32 @@ -136,12 +137,15 @@ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) } #define APR_OVERRIDE_ATOMIC_DEC32 -APR_DECLARE(void) apr_atomic_inc32(volatile apr_uint32_t *mem) +APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) { - asm volatile ("lock; incl %0" - : - : "m" (*(mem)) - : "memory"); + apr_uint32_t val = 1; + + asm volatile ("lock; xadd %1, (%2)" + : "=r"(val) /* output, same as 1st input */ + : "r"(val), "r"(mem) /* inputs */ + : "%1","memory"); /* tell gcc they are clobbered */ + return val; } #define APR_OVERRIDE_ATOMIC_INC32 @@ -196,18 +200,23 @@ apr_status_t apr_atomic_init(apr_pool_t *p) #endif /*!defined(apr_atomic_init) && !defined(APR_OVERRIDE_ATOMIC_INIT) */ #if !defined(apr_atomic_add32) && !defined(APR_OVERRIDE_ATOMIC_ADD32) -void apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { + apr_uint32_t old_value; + #if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { + old_value = *mem; *mem += val; apr_thread_mutex_unlock(lock); } #else + old_value = *mem; *mem += val; #endif /* APR_HAS_THREADS */ + return old_value; } #endif /*!defined(apr_atomic_sub32) && !defined(APR_OVERRIDE_ATOMIC_SUB32) */ @@ -244,18 +253,23 @@ void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) #endif /*!defined(apr_atomic_set32) && !defined(APR_OVERRIDE_ATOMIC_SET32) */ #if !defined(apr_atomic_inc32) && !defined(APR_OVERRIDE_ATOMIC_INC32) -void apr_atomic_inc32(volatile apr_uint32_t *mem) +apr_uint32_t apr_atomic_inc32(volatile apr_uint32_t *mem) { + apr_uint32_t old_value; + #if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { + old_value = *mem; (*mem)++; apr_thread_mutex_unlock(lock); } #else + old_value = *mem; (*mem)++; #endif /* APR_HAS_THREADS */ + return old_value; } #endif /*!defined(apr_atomic_inc32) && !defined(APR_OVERRIDE_ATOMIC_INC32) */ diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index 624b46a657d..801f38cb39e 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -79,9 +79,9 @@ typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_val_fn) (apr_uint32_t volatile *, apr_uint32_t, apr_uint32_t); -APR_DECLARE(void) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { - ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val); + return ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val); } APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) @@ -89,9 +89,10 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, -val); } -APR_DECLARE(void) apr_atomic_inc32(volatile apr_uint32_t *mem) +APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) { - ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem); + /* we return old value, win32 returns new value :( */ + return ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem) - 1; } APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 3750429cfdd..c3a25bdb109 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -107,8 +107,9 @@ APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) * atomically add 'val' to an apr_uint32_t * @param mem pointer to the object * @param val amount to add + * @return old value pointed to by mem */ -APR_DECLARE(void) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val); +APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val); /** * atomically subtract 'val' from an apr_uint32_t @@ -120,8 +121,9 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) /** * atomically increment an apr_uint32_t by 1 * @param mem pointer to the object + * @return old value pointed to by mem */ -APR_DECLARE(void) apr_atomic_inc32(volatile apr_uint32_t *mem); +APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem); /** * atomically decrement an apr_uint32_t by 1 From 6f805a948513b9f089b4032c884fa6fbe7e15103 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 4 Dec 2003 21:44:33 +0000 Subject: [PATCH 4756/7878] Fix up the return values for apr_atomic_add32() and apr_atomic_inc32() since the native Netware functions return void by default git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64809 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/netware/apr_atomic.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index 55feb55638d..3d68e3f8809 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -64,7 +64,9 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *pool) APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { - return atomic_add((unsigned long *)mem,(unsigned long)val); + apr_uint32_t old = *mem; + atomic_add((unsigned long *)mem,(unsigned long)val); + return old; } APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) @@ -74,7 +76,9 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) { - return atomic_inc((unsigned long *)mem); + apr_uint32_t old = *mem; + atomic_inc((unsigned long *)mem); + return old; } APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) From 054aa2ddef69fe52efb823d006a4131fec5d5a0d Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 4 Dec 2003 22:14:16 +0000 Subject: [PATCH 4757/7878] be sure that _add and _inc use 32 bit instructions. Also make sure gcc knows we want the same register for an input and an output operand. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64810 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 85cd45e2025..7e87b9618e2 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -105,9 +105,9 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { - asm volatile ("lock; xadd %1, (%2)" + asm volatile ("lock; xaddl %1, (%2)" : "=r"(val) /* output, same as 1st input */ - : "r"(val), "r"(mem) /* inputs */ + : "0"(val), "r"(mem) /* inputs */ : "%1","memory"); /* tell gcc they are clobbered */ return val; } @@ -141,9 +141,9 @@ APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) { apr_uint32_t val = 1; - asm volatile ("lock; xadd %1, (%2)" + asm volatile ("lock; xaddl %1, (%2)" : "=r"(val) /* output, same as 1st input */ - : "r"(val), "r"(mem) /* inputs */ + : "0"(val), "r"(mem) /* inputs */ : "%1","memory"); /* tell gcc they are clobbered */ return val; } From c538e6e58472bc46a6bd090d557b49d5612fe35b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 5 Dec 2003 01:02:31 +0000 Subject: [PATCH 4758/7878] axe apr_sockaddr_port_set() and apr_sockaddr_port_get() from APR 1.0 API git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64811 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ include/apr_network_io.h | 16 ---------------- network_io/unix/sockaddr.c | 16 ---------------- test/client.c | 4 ++-- test/server.c | 29 +++++++++++++---------------- test/testsockets.c | 2 +- 6 files changed, 18 insertions(+), 51 deletions(-) diff --git a/CHANGES b/CHANGES index 44eb34593f1..fc7907c9bb2 100644 --- a/CHANGES +++ b/CHANGES @@ -77,6 +77,8 @@ Changes with APR 1.0 apr_shutdown -> apr_socket_shutdown apr_signal_get_description -> apr_signal_description_get apr_sockaddr_ip_set -> apr_sockaddr_info_get + apr_sockaddr_port_get -> (access directly) + apr_sockaddr_port_set -> apr_sockaddr_info_get apr_socket_create_ex -> apr_socket_create apr_socket_set_inherit -> apr_socket_inherit_set apr_socket_unset_inherit -> apr_socket_inherit_unset diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 0e6a645dc28..9d1c6a6e066 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -677,22 +677,6 @@ APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock); -/** - * Set the port in an APR socket address. - * @param sockaddr The socket address to set. - * @param port The port to be stored in the socket address. - */ -APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, - apr_port_t port); - -/** - * Return the port in an APR socket address. - * @param port The port from the socket address. - * @param sockaddr The socket address to reference. - */ -APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, - apr_sockaddr_t *sockaddr); - /** * Return the IP address (in numeric address string format) in * an APR socket address. APR will allocate storage for the IP address diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 51ccd0af35d..a9337cbe663 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -136,22 +136,6 @@ static apr_status_t get_remote_addr(apr_socket_t *sock) } } -APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr, - apr_port_t port) -{ - sockaddr->port = port; - /* XXX IPv6: assumes sin_port and sin6_port at same offset */ - sockaddr->sa.sin.sin_port = htons(port); - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, - apr_sockaddr_t *sockaddr) -{ - *port = sockaddr->port; - return APR_SUCCESS; -} - APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr) { diff --git a/test/client.c b/test/client.c index 7e023a792e1..2c10fe933d7 100644 --- a/test/client.c +++ b/test/client.c @@ -140,10 +140,10 @@ int main(int argc, char *argv[]) apr_socket_addr_get(&remote_sa, APR_REMOTE, sock); apr_sockaddr_ip_get(&remote_ipaddr, remote_sa); - apr_sockaddr_port_get(&remote_port, remote_sa); + remote_port = remote_sa->port; apr_socket_addr_get(&local_sa, APR_LOCAL, sock); apr_sockaddr_ip_get(&local_ipaddr, local_sa); - apr_sockaddr_port_get(&local_port, local_sa); + local_port = local_sa->port; fprintf(stdout, "\tClient socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); fprintf(stdout, "\tClient: Trying to send data over socket......."); diff --git a/test/server.c b/test/server.c index 1101efee9e8..1727215373f 100644 --- a/test/server.c +++ b/test/server.c @@ -74,7 +74,7 @@ int main(int argc, const char * const argv[]) apr_pollfd_t fdsock; char datasend[STRLEN]; char datarecv[STRLEN] = "Recv data test"; - const char *bind_to_ipaddr = NULL; + const char *bind_to_ipaddr = APR_ANYADDR; char *local_ipaddr, *remote_ipaddr; apr_port_t local_port, remote_port; apr_sockaddr_t *localsa = NULL, *remotesa; @@ -104,16 +104,18 @@ int main(int argc, const char * const argv[]) exit(-1); } - if (bind_to_ipaddr) { - /* First, parse/resolve ipaddr so we know what address family of - * socket we need. We'll use the returned sockaddr later when - * we bind. - */ - APR_TEST_SUCCESS(rv, "Preparing sockaddr", - apr_sockaddr_info_get(&localsa, bind_to_ipaddr, APR_UNSPEC, 8021, 0, context)) - family = localsa->family; + if (!bind_to_ipaddr) { + bind_to_ipaddr = APR_LOCAL; } + /* First, parse/resolve ipaddr so we know what address family of + * socket we need. We'll use the returned sockaddr later when + * we bind. + */ + APR_TEST_SUCCESS(rv, "Preparing sockaddr", + apr_sockaddr_info_get(&localsa, bind_to_ipaddr, APR_UNSPEC, 8021, 0, context)) + family = localsa->family; + APR_TEST_SUCCESS(rv, "Creating new socket", apr_socket_create(&sock, family, SOCK_STREAM, APR_PROTO_TCP, context)) @@ -123,11 +125,6 @@ int main(int argc, const char * const argv[]) APR_TEST_SUCCESS(rv, "Setting option APR_SO_REUSEADDR", apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1)) - if (!localsa) { - apr_socket_addr_get(&localsa, APR_LOCAL, sock); - apr_sockaddr_port_set(localsa, 8021); - } - APR_TEST_SUCCESS(rv, "Binding socket to port", apr_socket_bind(sock, localsa)) @@ -172,10 +169,10 @@ int main(int argc, const char * const argv[]) } apr_socket_addr_get(&remotesa, APR_REMOTE, sock2); apr_sockaddr_ip_get(&remote_ipaddr, remotesa); - apr_sockaddr_port_get(&remote_port, remotesa); + remote_port = remotesa->port; apr_socket_addr_get(&localsa, APR_LOCAL, sock2); apr_sockaddr_ip_get(&local_ipaddr, localsa); - apr_sockaddr_port_get(&local_port, localsa); + local_port = localsa->port; fprintf(stdout, "Server socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); diff --git a/test/testsockets.c b/test/testsockets.c index 1ba2ea11174..165cfc29f6a 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -172,7 +172,7 @@ static void sendto_receivefrom(CuTest *tc) CuAssertStrEquals(tc, "APR_INET, SOCK_DGRAM", recvbuf); apr_sockaddr_ip_get(&ip_addr, from); - apr_sockaddr_port_get(&fromport, from); + fromport = from->port; CuAssertStrEquals(tc, US, ip_addr); CuAssertIntEquals(tc, 7771, fromport); From 267075330553370d873f9044e02f94f413e7b907 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 5 Dec 2003 13:12:03 +0000 Subject: [PATCH 4759/7878] * apr_atomic.c: abort() if any mutex locking or unlocking calls fail. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64812 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 93 ++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 51 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 7e87b9618e2..13c65703dfe 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -56,6 +56,8 @@ #include "apr_atomic.h" #include "apr_thread_mutex.h" +#include + #if defined(__FreeBSD__) && !defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC #include @@ -199,6 +201,9 @@ apr_status_t apr_atomic_init(apr_pool_t *p) } #endif /*!defined(apr_atomic_init) && !defined(APR_OVERRIDE_ATOMIC_INIT) */ +/* abort() if 'x' does not evaluate to APR_SUCCESS. */ +#define CHECK(x) do { if ((x) != APR_SUCCESS) abort(); } while (0) + #if !defined(apr_atomic_add32) && !defined(APR_OVERRIDE_ATOMIC_ADD32) apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { @@ -207,11 +212,10 @@ apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) #if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - old_value = *mem; - *mem += val; - apr_thread_mutex_unlock(lock); - } + CHECK(apr_thread_mutex_lock(lock)); + old_value = *mem; + *mem += val; + CHECK(apr_thread_mutex_unlock(lock)); #else old_value = *mem; *mem += val; @@ -226,10 +230,9 @@ void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) #if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - *mem -= val; - apr_thread_mutex_unlock(lock); - } + CHECK(apr_thread_mutex_lock(lock)); + *mem -= val; + CHECK(apr_thread_mutex_unlock(lock)); #else *mem -= val; #endif /* APR_HAS_THREADS */ @@ -242,10 +245,9 @@ void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) #if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - *mem = val; - apr_thread_mutex_unlock(lock); - } + CHECK(apr_thread_mutex_lock(lock)); + *mem = val; + CHECK(apr_thread_mutex_unlock(lock)); #else *mem = val; #endif /* APR_HAS_THREADS */ @@ -260,11 +262,10 @@ apr_uint32_t apr_atomic_inc32(volatile apr_uint32_t *mem) #if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - old_value = *mem; - (*mem)++; - apr_thread_mutex_unlock(lock); - } + CHECK(apr_thread_mutex_lock(lock)); + old_value = *mem; + (*mem)++; + CHECK(apr_thread_mutex_unlock(lock)); #else old_value = *mem; (*mem)++; @@ -280,16 +281,15 @@ int apr_atomic_dec32(volatile apr_uint32_t *mem) apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; apr_uint32_t new; - if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - (*mem)--; - new = *mem; - apr_thread_mutex_unlock(lock); - return new; - } + CHECK(apr_thread_mutex_lock(lock)); + (*mem)--; + new = *mem; + CHECK(apr_thread_mutex_unlock(lock)); + return new; #else (*mem)--; -#endif /* APR_HAS_THREADS */ return *mem; +#endif /* APR_HAS_THREADS */ } #endif /*!defined(apr_atomic_dec32) && !defined(APR_OVERRIDE_ATOMIC_DEC32) */ @@ -301,22 +301,19 @@ apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, #if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - prev = *mem; - if (prev == cmp) { - *mem = with; - } - apr_thread_mutex_unlock(lock); - return prev; + CHECK(apr_thread_mutex_lock(lock)); + prev = *mem; + if (prev == cmp) { + *mem = with; } - return *mem; + CHECK(apr_thread_mutex_unlock(lock)); #else prev = *mem; if (prev == cmp) { *mem = with; } - return prev; #endif /* APR_HAS_THREADS */ + return prev; } #endif /*!defined(apr_atomic_cas32) && !defined(APR_OVERRIDE_ATOMIC_CAS32) */ @@ -327,18 +324,15 @@ apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) #if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - prev = *mem; - *mem = val; - apr_thread_mutex_unlock(lock); - return prev; - } - return *mem; + CHECK(apr_thread_mutex_lock(lock)); + prev = *mem; + *mem = val; + CHECK(apr_thread_mutex_unlock(lock)); #else prev = *mem; *mem = val; - return prev; #endif /* APR_HAS_THREADS */ + return prev; } #endif /*!defined(apr_atomic_xchg32) && !defined(APR_OVERRIDE_ATOMIC_XCHG32) */ @@ -349,22 +343,19 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) #if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - prev = *(void **)mem; - if (prev == cmp) { - *mem = with; - } - apr_thread_mutex_unlock(lock); - return prev; + CHECK(apr_thread_mutex_lock(lock)); + prev = *(void **)mem; + if (prev == cmp) { + *mem = with; } - return *(void **)mem; + CHECK(apr_thread_mutex_unlock(lock)); #else prev = *(void **)mem; if (prev == cmp) { *mem = with; } - return prev; #endif /* APR_HAS_THREADS */ + return prev; } #endif /*!defined(apr_atomic_casptr) && !defined(APR_OVERRIDE_ATOMIC_CASPTR) */ From 3abf6db89402e34e2e5e9b26f144389872e461ca Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 5 Dec 2003 16:53:12 +0000 Subject: [PATCH 4760/7878] * testatomic.c: Whitelist rather than blacklist to enable pthread_setconcurrency (fix build on a bunch of platforms which don't have pthread_setconcurrency at all). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64813 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index 8134864fc1e..aa8ccd9b2ee 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -64,8 +64,11 @@ #include #endif -#if !(defined BEOS) && !(defined WIN32) && !(defined NETWARE) && !(defined __MVS__) && !(defined DARWIN) -/* ugh... */ +/* Use pthread_setconcurrency where it is available and not a nullop, + * i.e. platforms using M:N or M:1 thread models: */ +#if APR_HAS_THREADS && \ + ((defined(SOLARIS2) && SOLARIS2 > 26) || defined(_AIX)) +/* also HP-UX, IRIX? ... */ #define HAVE_PTHREAD_SETCONCURRENCY #endif From 4b769d0a0fa734bc9cb205508fdf782a4af5260e Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 5 Dec 2003 18:57:21 +0000 Subject: [PATCH 4761/7878] use an inlined function to eliminate one copy of the xadd assembler code. You need to specify at least -O1 to enable inlining. That seems fair. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64814 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 13c65703dfe..d596ab7e6ea 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -105,7 +105,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, } #define APR_OVERRIDE_ATOMIC_CAS32 -APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +static apr_uint32_t inline intel_atomic_add32(volatile apr_uint32_t *mem, + apr_uint32_t val) { asm volatile ("lock; xaddl %1, (%2)" : "=r"(val) /* output, same as 1st input */ @@ -113,6 +114,12 @@ APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint3 : "%1","memory"); /* tell gcc they are clobbered */ return val; } + +APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, + apr_uint32_t val) +{ + return intel_atomic_add32(mem, val); +} #define APR_OVERRIDE_ATOMIC_ADD32 APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) @@ -141,13 +148,7 @@ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) { - apr_uint32_t val = 1; - - asm volatile ("lock; xaddl %1, (%2)" - : "=r"(val) /* output, same as 1st input */ - : "0"(val), "r"(mem) /* inputs */ - : "%1","memory"); /* tell gcc they are clobbered */ - return val; + return intel_atomic_add32(mem, 1); } #define APR_OVERRIDE_ATOMIC_INC32 From 0712ad1a2575881e3b3573f753a766c7b52c4d55 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 5 Dec 2003 20:15:32 +0000 Subject: [PATCH 4762/7878] intel_atomic_add32: re-specify asm inputs and outputs, after RTFMing and Googling git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64815 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index d596ab7e6ea..19dc3e9e774 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -108,10 +108,11 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, static apr_uint32_t inline intel_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { - asm volatile ("lock; xaddl %1, (%2)" - : "=r"(val) /* output, same as 1st input */ - : "0"(val), "r"(mem) /* inputs */ - : "%1","memory"); /* tell gcc they are clobbered */ + asm volatile ("lock; xaddl %0,%1" + : "+r"(val), "+m"(*mem) /* outputs and inputs */ + : + : "memory"); /*XXX is this needed? it knows that + *mem is an output */ return val; } From c0a0040f640b7bd373c48a6bfc6e5078f32b7e96 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Mon, 8 Dec 2003 19:49:16 +0000 Subject: [PATCH 4763/7878] add apr_atomic_cas32 for ppc with gcc. Could someone try this with testatomic on Mac OS X? It should just work, but I couldn't test it. moof no longer likes me. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64816 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 19dc3e9e774..65d30bda57e 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -175,6 +175,31 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint #endif /* (__linux__ || __EMX__ || __FreeBSD__) && __i386__ */ +#if defined(__PPC__) && defined(__GNUC__) && !APR_FORCE_ATOMIC_GENERIC +APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, + apr_uint32_t swap, + apr_uint32_t cmp) +{ + apr_uint32_t prev; + + asm volatile ("retry:\n\t" + "lwarx %0,0,%1\n\t" /* load prev and reserve */ + "cmpw %0,%3\n\t" /* does it match cmp? */ + "bne- exit\n\t" /* ...no, bail out */ + "stwcx. %2,0,%1\n\t" /* ...yes, conditionally + store swap */ + "bne- retry\n\t" /* start over if we lost + the reservation */ + "exit:" + : "=&r"(prev) /* output */ + : "r" (mem), "r" (swap), "r"(cmp) /* inputs */ + : "memory"); /* clobbered */ + return prev; +} +#define APR_OVERRIDE_ATOMIC_CAS32 + +#endif /* __PPC__ && __GNUC__ */ + #if !defined(apr_atomic_init) && !defined(APR_OVERRIDE_ATOMIC_INIT) #if APR_HAS_THREADS From a0186ec14f40982088dee388522d8d7a9d8b96f2 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 8 Dec 2003 21:44:31 +0000 Subject: [PATCH 4764/7878] Switch to a pure atomic implementation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64817 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/netware/apr_atomic.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index 3d68e3f8809..53f88bfb138 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -64,9 +64,7 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *pool) APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { - apr_uint32_t old = *mem; - atomic_add((unsigned long *)mem,(unsigned long)val); - return old; + return atomic_xchgadd((unsigned long *)mem,(unsigned long)val); } APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) @@ -76,9 +74,7 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) { - apr_uint32_t old = *mem; - atomic_inc((unsigned long *)mem); - return old; + return atomic_xchgadd((unsigned long *)mem, 1); } APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) From 9adf1a2d975fac177249f5a96b0e0f3078489801 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 8 Dec 2003 22:58:02 +0000 Subject: [PATCH 4765/7878] changes to the apr atomic implementations for unix-ish boxes a) need to check for __ppc__ on Darwin to pick up the PPC non-portable atomics b) axe the historic checks for defined(apr_atomic_foo) when deciding whether to generate the default version of apr_atomic_foo; checking for APR_OVERRIDE_ATOMIC_FOO is sufficient c) if the platform has defined apr_atomic_cas32() but not all the other apr_atomic_foo32(), use apr_atomic_cas32() in a generic version that will be much preferable to the no-cas32 version (which must use locking) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64818 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 102 ++++++++++++++++++++++++++------------- 1 file changed, 69 insertions(+), 33 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 65d30bda57e..cedc27ca0a5 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -175,7 +175,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint #endif /* (__linux__ || __EMX__ || __FreeBSD__) && __i386__ */ -#if defined(__PPC__) && defined(__GNUC__) && !APR_FORCE_ATOMIC_GENERIC +#if (defined(__PPC__) || defined(__ppc__)) && defined(__GNUC__) && !APR_FORCE_ATOMIC_GENERIC APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t swap, apr_uint32_t cmp) @@ -200,7 +200,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, #endif /* __PPC__ && __GNUC__ */ -#if !defined(apr_atomic_init) && !defined(APR_OVERRIDE_ATOMIC_INIT) +#if !defined(APR_OVERRIDE_ATOMIC_INIT) #if APR_HAS_THREADS #define NUM_ATOMIC_HASH 7 @@ -226,12 +226,24 @@ apr_status_t apr_atomic_init(apr_pool_t *p) #endif /* APR_HAS_THREADS */ return APR_SUCCESS; } -#endif /*!defined(apr_atomic_init) && !defined(APR_OVERRIDE_ATOMIC_INIT) */ +#endif /* !defined(APR_OVERRIDE_ATOMIC_INIT) */ /* abort() if 'x' does not evaluate to APR_SUCCESS. */ #define CHECK(x) do { if ((x) != APR_SUCCESS) abort(); } while (0) -#if !defined(apr_atomic_add32) && !defined(APR_OVERRIDE_ATOMIC_ADD32) +#if !defined(APR_OVERRIDE_ATOMIC_ADD32) +#if defined(APR_OVERRIDE_ATOMIC_CAS32) +apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t old_value, new_value; + + do { + old_value = *mem; + new_value = old_value + val; + } while (apr_atomic_cas32(mem, new_value, old_value) != old_value); + return old_value; +} +#else apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { apr_uint32_t old_value; @@ -249,9 +261,21 @@ apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) #endif /* APR_HAS_THREADS */ return old_value; } -#endif /*!defined(apr_atomic_sub32) && !defined(APR_OVERRIDE_ATOMIC_SUB32) */ +#endif /* defined(APR_OVERRIDE_ATOMIC_CAS32) */ +#endif /* !defined(APR_OVERRIDE_ATOMIC_SUB32) */ -#if !defined(apr_atomic_sub32) && !defined(APR_OVERRIDE_ATOMIC_SUB32) +#if !defined(APR_OVERRIDE_ATOMIC_SUB32) +#if defined(APR_OVERRIDE_ATOMIC_CAS32) +void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t old_value, new_value; + + do { + old_value = *mem; + new_value = old_value - val; + } while (apr_atomic_cas32(mem, new_value, old_value) != old_value); +} +#else void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) { #if APR_HAS_THREADS @@ -264,9 +288,10 @@ void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) *mem -= val; #endif /* APR_HAS_THREADS */ } -#endif /*!defined(apr_atomic_sub32) && !defined(APR_OVERRIDE_ATOMIC_SUB32) */ +#endif /* defined(APR_OVERRIDE_ATOMIC_CAS32) */ +#endif /* !defined(APR_OVERRIDE_ATOMIC_SUB32) */ -#if !defined(apr_atomic_set32) && !defined(APR_OVERRIDE_ATOMIC_SET32) +#if !defined(APR_OVERRIDE_ATOMIC_SET32) void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) { #if APR_HAS_THREADS @@ -279,29 +304,28 @@ void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) *mem = val; #endif /* APR_HAS_THREADS */ } -#endif /*!defined(apr_atomic_set32) && !defined(APR_OVERRIDE_ATOMIC_SET32) */ +#endif /* !defined(APR_OVERRIDE_ATOMIC_SET32) */ -#if !defined(apr_atomic_inc32) && !defined(APR_OVERRIDE_ATOMIC_INC32) +#if !defined(APR_OVERRIDE_ATOMIC_INC32) apr_uint32_t apr_atomic_inc32(volatile apr_uint32_t *mem) { - apr_uint32_t old_value; - -#if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - - CHECK(apr_thread_mutex_lock(lock)); - old_value = *mem; - (*mem)++; - CHECK(apr_thread_mutex_unlock(lock)); -#else - old_value = *mem; - (*mem)++; -#endif /* APR_HAS_THREADS */ - return old_value; + return apr_atomic_add32(mem, 1); } -#endif /*!defined(apr_atomic_inc32) && !defined(APR_OVERRIDE_ATOMIC_INC32) */ +#endif /* !defined(APR_OVERRIDE_ATOMIC_INC32) */ -#if !defined(apr_atomic_dec32) && !defined(APR_OVERRIDE_ATOMIC_DEC32) +#if !defined(APR_OVERRIDE_ATOMIC_DEC32) +#if defined(APR_OVERRIDE_ATOMIC_CAS32) +int apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + apr_uint32_t old_value, new_value; + + do { + old_value = *mem; + new_value = old_value - 1; + } while (apr_atomic_cas32(mem, new_value, old_value) != old_value); + return old_value != 1; +} +#else int apr_atomic_dec32(volatile apr_uint32_t *mem) { #if APR_HAS_THREADS @@ -318,9 +342,10 @@ int apr_atomic_dec32(volatile apr_uint32_t *mem) return *mem; #endif /* APR_HAS_THREADS */ } -#endif /*!defined(apr_atomic_dec32) && !defined(APR_OVERRIDE_ATOMIC_DEC32) */ +#endif /* defined(APR_OVERRIDE_ATOMIC_CAS32) */ +#endif /* !defined(APR_OVERRIDE_ATOMIC_DEC32) */ -#if !defined(apr_atomic_cas32) && !defined(APR_OVERRIDE_ATOMIC_CAS32) +#if !defined(APR_OVERRIDE_ATOMIC_CAS32) apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, apr_uint32_t cmp) { @@ -342,9 +367,19 @@ apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, #endif /* APR_HAS_THREADS */ return prev; } -#endif /*!defined(apr_atomic_cas32) && !defined(APR_OVERRIDE_ATOMIC_CAS32) */ +#endif /* !defined(APR_OVERRIDE_ATOMIC_CAS32) */ -#if !defined(apr_atomic_xchg32) && !defined(APR_OVERRIDE_ATOMIC_XCHG32) +#if !defined(APR_OVERRIDE_ATOMIC_XCHG32) +#if defined(APR_OVERRIDE_ATOMIC_CAS32) +apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t prev; + do { + prev = *mem; + } while (apr_atomic_cas32(mem, val, prev) != prev); + return prev; +} +#else apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) { apr_uint32_t prev; @@ -361,9 +396,10 @@ apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) #endif /* APR_HAS_THREADS */ return prev; } -#endif /*!defined(apr_atomic_xchg32) && !defined(APR_OVERRIDE_ATOMIC_XCHG32) */ +#endif /* defined(APR_OVERRIDE_ATOMIC_CAS32) */ +#endif /* !defined(APR_OVERRIDE_ATOMIC_XCHG32) */ -#if !defined(apr_atomic_casptr) && !defined(APR_OVERRIDE_ATOMIC_CASPTR) +#if !defined(APR_OVERRIDE_ATOMIC_CASPTR) void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) { void *prev; @@ -384,7 +420,7 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) #endif /* APR_HAS_THREADS */ return prev; } -#endif /*!defined(apr_atomic_casptr) && !defined(APR_OVERRIDE_ATOMIC_CASPTR) */ +#endif /* !defined(APR_OVERRIDE_ATOMIC_CASPTR) */ #if !defined(APR_OVERRIDE_ATOMIC_READ32) APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) From 0e2d0d5efca59c41c766bbf23cbe6a6ee5794cca Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Mon, 8 Dec 2003 23:20:25 +0000 Subject: [PATCH 4766/7878] allow non-portable atomics on Linux/ppc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64819 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 84f04c5e38f..bdba24fc37b 100644 --- a/configure.in +++ b/configure.in @@ -409,7 +409,7 @@ case $host in *linux*) apr_force_atomic_generic=1 case $host_cpu in - i486|i586|i686) + i486|i586|i686|powerpc64) if test "$nonportable_atomics_enabled" = 1; then apr_force_atomic_generic=0 fi From 5097770adbc3cff9d3c757dd17345f887d6c977f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 9 Dec 2003 09:37:15 +0000 Subject: [PATCH 4767/7878] * configure.in: Size of long double is no longer needed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64820 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.in b/configure.in index bdba24fc37b..fb09f5e7b3b 100644 --- a/configure.in +++ b/configure.in @@ -1036,7 +1036,6 @@ AC_CHECK_SIZEOF(char, 1) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(short, 2) -AC_CHECK_SIZEOF(long double, 12) AC_CHECK_SIZEOF(long long, 8) if test "$ac_cv_sizeof_short" = "2"; then From be6264a3bc9b4a39438d165d0a1f186f344273c7 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 9 Dec 2003 10:06:55 +0000 Subject: [PATCH 4768/7878] Completely remove apr_socket_from_file which is deprecated on the 0.9 branch and was partially removed earlier. * include/apr.h.in: Removed reference to apr_socket_from_file. * apr.dsp, libapr.dsp, poll/unix/Makefile.in: Don't build pollacc.c. * poll/unix/pollacc.c: Removed file. PR: 25324 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64821 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 --- include/apr.h.in | 4 +-- libapr.dsp | 4 --- poll/unix/Makefile.in | 3 +- poll/unix/pollacc.c | 74 ------------------------------------------- 5 files changed, 2 insertions(+), 87 deletions(-) delete mode 100644 poll/unix/pollacc.c diff --git a/apr.dsp b/apr.dsp index 08c9111083c..67002ac07f8 100644 --- a/apr.dsp +++ b/apr.dsp @@ -278,10 +278,6 @@ SOURCE=.\poll\unix\poll.c # End Source File # Begin Source File -SOURCE=.\poll\unix\pollacc.c -# End Source File -# Begin Source File - SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File diff --git a/include/apr.h.in b/include/apr.h.in index 8f92bb4ce40..ea96ee789ed 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -262,9 +262,7 @@ extern "C" { #define APR_HAS_OS_UUID 0 /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible - * to poll on files/pipes. On such a system, the application can - * call apr_socket_from_file() to get an APR socket representation and - * then pass the socket representation to apr_poll_socket_add(). + * to poll on files/pipes. */ #define APR_FILES_AS_SOCKETS @file_as_socket@ diff --git a/libapr.dsp b/libapr.dsp index 93dca9dd4a8..7132691a30d 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -284,10 +284,6 @@ SOURCE=.\poll\unix\poll.c # End Source File # Begin Source File -SOURCE=.\poll\unix\pollacc.c -# End Source File -# Begin Source File - SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File diff --git a/poll/unix/Makefile.in b/poll/unix/Makefile.in index d9ab2219e6a..e4594d35b79 100755 --- a/poll/unix/Makefile.in +++ b/poll/unix/Makefile.in @@ -2,8 +2,7 @@ srcdir = @srcdir@ VPATH = @srcdir@ TARGETS = \ - poll.lo \ - pollacc.lo + poll.lo # bring in rules.mk for standard functionality diff --git a/poll/unix/pollacc.c b/poll/unix/pollacc.c deleted file mode 100644 index 275895811f7..00000000000 --- a/poll/unix/pollacc.c +++ /dev/null @@ -1,74 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr.h" -#include "apr_arch_networkio.h" -#include "apr_arch_file_io.h" - - -#if APR_FILES_AS_SOCKETS -/* I'm not sure if this needs to return an apr_status_t or not, but - * for right now, we'll leave it this way, and change it later if - * necessary. - */ -APR_DECLARE(apr_status_t) apr_socket_from_file(apr_socket_t **newsock, - apr_file_t *file) -{ - (*newsock) = apr_pcalloc(file->pool, sizeof(**newsock)); - (*newsock)->socketdes = file->filedes; - (*newsock)->cntxt = file->pool; - (*newsock)->timeout = file->timeout; - return APR_SUCCESS; -} -#endif From bd896bf4a8e82f195f7b49808369d730915aece8 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 9 Dec 2003 15:43:23 +0000 Subject: [PATCH 4769/7878] no functional change. add whitespace to align asm operands git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64823 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index cedc27ca0a5..61648807d33 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -188,7 +188,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, "bne- exit\n\t" /* ...no, bail out */ "stwcx. %2,0,%1\n\t" /* ...yes, conditionally store swap */ - "bne- retry\n\t" /* start over if we lost + "bne- retry\n\t" /* start over if we lost the reservation */ "exit:" : "=&r"(prev) /* output */ From c05022d7e48f88ce08460b6c11f766dd7582f235 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 9 Dec 2003 15:51:09 +0000 Subject: [PATCH 4770/7878] fix an apparent cut-n-paste-o in a comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64824 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 61648807d33..015d2f9e8bd 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -262,7 +262,7 @@ apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) return old_value; } #endif /* defined(APR_OVERRIDE_ATOMIC_CAS32) */ -#endif /* !defined(APR_OVERRIDE_ATOMIC_SUB32) */ +#endif /* !defined(APR_OVERRIDE_ATOMIC_ADD32) */ #if !defined(APR_OVERRIDE_ATOMIC_SUB32) #if defined(APR_OVERRIDE_ATOMIC_CAS32) From 0dc8c4341043e9de867890f480a1d445a6bf1e62 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 9 Dec 2003 17:43:01 +0000 Subject: [PATCH 4771/7878] Since all NetWare memory is shared, allowing an application access to the APR global pool allows it to allocate memory and set cleanups that will never happen even if the application terminates. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64825 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 205cdba877b..e5e88661192 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1792,6 +1792,13 @@ APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool) APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool) { +#ifdef NETWARE + /* On NetWare, don't return the global_pool, return the application pool + as the top most pool */ + if (pool->parent == global_pool) + return NULL; + else +#endif return pool->parent; } From 997607b0a625e7a5e10263e97f63ffcbb21f9c32 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 9 Dec 2003 19:00:51 +0000 Subject: [PATCH 4772/7878] add return value checks for apr_atomic_add32 and apr_atomic_inc32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64827 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index aa8ccd9b2ee..74d9284f63e 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -138,15 +138,35 @@ static apr_status_t check_basic_atomics32(void) printf("%-60s", "testing apr_atomic_add32"); apr_atomic_set32(&y32, 23); - apr_atomic_add32(&y32, 4); + if ((oldval = apr_atomic_add32(&y32, 4)) != 23) { + fprintf(stderr, + "Failed\noldval problem =%d should be 23\n", + oldval); + return APR_EGENERAL; + } if ((oldval = apr_atomic_read32(&y32)) != 27) { fprintf(stderr, "Failed\nAtomic Add doesn't add up ;( expected 27 got %d\n", oldval); return APR_EGENERAL; } - printf("OK\n"); + + printf("%-60s", "testing apr_atomic_inc32"); + if ((oldval = apr_atomic_inc32(&y32)) != 27) { + fprintf(stderr, + "Failed\noldval problem =%d should be 27\n", + oldval); + return APR_EGENERAL; + } + if ((oldval = apr_atomic_read32(&y32)) != 28) { + fprintf(stderr, + "Failed\nAtomic Inc didn't increment ;( expected 28 got %d\n", + oldval); + return APR_EGENERAL; + } + printf("OK\n"); + printf("%-60s", "testing add32/inc32/sub32"); apr_atomic_set32(&y32, 0); apr_atomic_add32(&y32, 20); From 27ec61018948a873dfdacc60104b30e6f4137f75 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 9 Dec 2003 19:11:03 +0000 Subject: [PATCH 4773/7878] Remove pollacc.c from the NetWare make file git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64828 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 - 1 file changed, 1 deletion(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index e4cc4458854..620bbbb1c8c 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -273,7 +273,6 @@ FILES_lib_objs = \ $(OBJDIR)/pipe.o \ $(OBJDIR)/otherchild.o \ $(OBJDIR)/poll.o \ - $(OBJDIR)/pollacc.o \ $(OBJDIR)/proc.o \ $(OBJDIR)/procsup.o \ $(OBJDIR)/proc_mutex.o \ From 078b7ffd7a37ea5cfd193341fb36be07b29e762a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 9 Dec 2003 21:15:44 +0000 Subject: [PATCH 4774/7878] Update the Netware tests to include the atomic test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64829 13f79535-47bb-0310-9956-ffa450edef68 --- test/NWGNUmakefile | 1 + test/nwgnutestatmc | 255 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 256 insertions(+) create mode 100644 test/nwgnutestatmc diff --git a/test/NWGNUmakefile b/test/NWGNUmakefile index 6ce99306617..c63714a57bf 100644 --- a/test/NWGNUmakefile +++ b/test/NWGNUmakefile @@ -168,6 +168,7 @@ TARGET_nlm = \ $(OBJDIR)/aprtest.nlm \ $(OBJDIR)/mod_test.nlm \ $(OBJDIR)/proc_child.nlm \ + $(OBJDIR)/testatmc.nlm \ $(EOLIST) # # If there is an LIB target, put it here diff --git a/test/nwgnutestatmc b/test/nwgnutestatmc new file mode 100644 index 00000000000..afe1aaf2116 --- /dev/null +++ b/test/nwgnutestatmc @@ -0,0 +1,255 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(APR_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR_WORK)/include \ + $(APR_WORK)/include/arch/NetWare \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME =testatmc +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = NLM is to test the atomic functions + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = testatmc + +# +# This is used by the '-screenname' directive. If left blank, +# 'Apache for NetWare' Thread will be used. +# +NLM_SCREEN_NAME = testatmc + +# +# If this is specified, it will override VERSION value in +# $(APR_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = 1,0,0 + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If this is specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can +# be disabled by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# Declare all target files (you must add your files here) +# + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/testatmc.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/testatomic.o \ + $(OBJDIR)/nw_misc.o \ + $(EOLIST) + +# Pending tests + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + Libc \ + APRLIB \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override the default copyright. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @libc.imp \ + @$(APR)/aprlib.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + From 83eef7c1958809258bd113f60bedac87b3130c96 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 9 Dec 2003 22:20:22 +0000 Subject: [PATCH 4775/7878] ppc + gcc updates apr_atomic_cas32: * make sure gcc uses a valid base register (not r0) for mem, * tell gcc that the condition code is clobbered, and * use asm local labels to avoid future namespace collisions apr_atomic_add32: add a native implementation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64832 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 015d2f9e8bd..65258b22f82 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -182,22 +182,45 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, { apr_uint32_t prev; - asm volatile ("retry:\n\t" + asm volatile ("0:\n\t" /* retry local label */ "lwarx %0,0,%1\n\t" /* load prev and reserve */ "cmpw %0,%3\n\t" /* does it match cmp? */ - "bne- exit\n\t" /* ...no, bail out */ + "bne- 1f\n\t" /* ...no, bail out */ "stwcx. %2,0,%1\n\t" /* ...yes, conditionally store swap */ - "bne- retry\n\t" /* start over if we lost + "bne- 0b\n\t" /* start over if we lost the reservation */ - "exit:" + "1:" /* exit local label */ + : "=&r"(prev) /* output */ - : "r" (mem), "r" (swap), "r"(cmp) /* inputs */ - : "memory"); /* clobbered */ + : "b" (mem), "r" (swap), "r"(cmp) /* inputs */ + : "memory", "cc"); /* clobbered */ return prev; } #define APR_OVERRIDE_ATOMIC_CAS32 +APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, + apr_uint32_t delta) +{ + apr_uint32_t prev, temp; + + asm volatile ("0:\n\t" /* retry local label */ + "lwarx %0,0,%2\n\t" /* load prev and reserve */ + "add %1,%0,%3\n\t" /* temp = prev + delta */ + "stwcx. %1,0,%2\n\t" /* conditionally store */ + "bne- 0b" /* start over if we lost + the reservation */ + + /*XXX find a cleaner way to define the temp + * it's not an output + */ + : "=&r" (prev), "=&r" (temp) /* output, temp */ + : "b" (mem), "r" (delta) /* inputs */ + : "memory", "cc"); /* clobbered */ + return prev; +} +#define APR_OVERRIDE_ATOMIC_ADD32 + #endif /* __PPC__ && __GNUC__ */ #if !defined(APR_OVERRIDE_ATOMIC_INIT) From 80f6f9ddfe61280b65f2b942a3c5dc1f6ef3c9e9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 10 Dec 2003 16:27:40 +0000 Subject: [PATCH 4776/7878] * threadproc/unix/threadpriv.c (apr_threadkey_private_delete): Define function regardless of HAVE_PTHREAD_KEY_DELETE. PR: 23837 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64833 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/threadpriv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 4416c7a403b..056f509d8af 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -100,9 +100,9 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, } } -#ifdef HAVE_PTHREAD_KEY_DELETE APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) { +#ifdef HAVE_PTHREAD_KEY_DELETE apr_status_t stat; if ((stat = pthread_key_delete(key->key)) == 0) { @@ -110,8 +110,10 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) } return stat; -} +#else + return APR_ENOTIMPL; #endif +} APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) From aa556891401e6693fa3df2e54eb2b73b4bbd9f50 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 12 Dec 2003 12:17:56 +0000 Subject: [PATCH 4777/7878] Clarify what is and isn't safe to do with cleanups. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64834 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 52e204c38f6..15802f75c3f 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -514,7 +514,12 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, * Cleanup * * Cleanups are performed in the reverse order they were registered. That is: - * Last In, First Out. + * Last In, First Out. A cleanup function can safely allocate memory from + * the pool that is being cleaned up. It can also safely register additional + * cleanups which will be run LIFO, directly after the current cleanup + * terminates. Cleanups have to take caution in calling functions that + * create subpools. Subpools, created during cleanup will NOT automatically + * be cleaned up. In other words, cleanups are to clean up after themselves. */ /** From 3d373a8cd588b11a06f47b816b9c186f98a10d05 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 12 Dec 2003 17:47:23 +0000 Subject: [PATCH 4778/7878] enable the x86 atomic code on Solaris/x86 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64835 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 65258b22f82..a6d55378c31 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -88,7 +88,7 @@ APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) #endif /* __FreeBSD__ && !__i386__ */ -#if (defined(__linux__) || defined(__EMX__) || defined(__FreeBSD__)) \ +#if (defined(__linux__) || defined(__sun__) || defined(__EMX__) || defined(__FreeBSD__)) \ && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, From d23220b804907ef19483f31021bee77fefe51aef Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Sat, 13 Dec 2003 20:32:49 +0000 Subject: [PATCH 4779/7878] large file support is causing problems with acrobat reader and PDF files. Turning it off on NetWare until I can figure out why. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64836 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/apr.hnw b/include/apr.hnw index 1eaea5183a6..919c5413290 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -227,7 +227,7 @@ extern "C" { #define APR_HAS_UNICODE_FS 0 #define APR_HAS_PROC_INVOKED 0 #define APR_HAS_USER 1 -#define APR_HAS_LARGE_FILES 1 +#define APR_HAS_LARGE_FILES 0 #define APR_HAS_XTHREAD_FILES 0 #define APR_HAS_OS_UUID 0 @@ -262,7 +262,11 @@ typedef unsigned long long apr_uint64_t; typedef size_t apr_size_t; typedef ssize_t apr_ssize_t; +#if APR_HAS_LARGE_FILES typedef off64_t apr_off_t; +#else +typedef off_t apr_off_t; +#endif typedef int apr_socklen_t; /* Are we big endian? */ From eccaa92ab4194dbb818b5e69d6befd03549c2568 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 15 Dec 2003 13:21:08 +0000 Subject: [PATCH 4780/7878] enable i386 atomics for gcc on any platform... it is expected that there are relatively few (or zero) platforms where it would be used where it won't work git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64837 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index a6d55378c31..67a6bb0aa7e 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -88,8 +88,7 @@ APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) #endif /* __FreeBSD__ && !__i386__ */ -#if (defined(__linux__) || defined(__sun__) || defined(__EMX__) || defined(__FreeBSD__)) \ - && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC +#if defined(__i386__) && defined(__GNUC__) && !APR_FORCE_ATOMIC_GENERIC APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, From a858a50ae505f6d87cb224f2fff243c8696c8254 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 15 Dec 2003 22:05:34 +0000 Subject: [PATCH 4781/7878] Clean up some 32 bit/64 bit type incompatibilities that cause problems when large file support is enabled. Also turn large file support back on for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64838 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 4 ++++ file_io/unix/seek.c | 16 ++++++++++++++-- include/apr.hnw | 6 +++++- include/arch/netware/apr_arch_file_io.h | 4 ++-- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 98d86d5b1c4..38ca0819985 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -203,7 +203,11 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a */ apr_int64_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; if (offset != thefile->filePtr) +#if defined(NETWARE) && APR_HAS_LARGE_FILES + lseek64(thefile->filedes, offset, SEEK_SET); +#else lseek(thefile->filedes, offset, SEEK_SET); +#endif thefile->bufpos = thefile->dataRead = 0; thefile->direction = 1; } diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 725e522ab45..b92d71bd670 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -54,9 +54,9 @@ #include "apr_arch_file_io.h" -static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) +static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) { - long newbufpos; + apr_off_t newbufpos; int rc; if (thefile->direction == 1) { @@ -70,7 +70,11 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) rc = 0; } else { +#if defined(NETWARE) && APR_HAS_LARGE_FILES + rc = lseek64(thefile->filedes, pos, SEEK_SET); +#else rc = lseek(thefile->filedes, pos, SEEK_SET); +#endif if (rc != -1 ) { thefile->bufpos = thefile->dataRead = 0; @@ -117,7 +121,11 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh } else { +#if defined(NETWARE) && APR_HAS_LARGE_FILES + rv = lseek64(thefile->filedes, *offset, where); +#else rv = lseek(thefile->filedes, *offset, where); +#endif if (rv == -1) { *offset = -1; return errno; @@ -131,7 +139,11 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset) { +#if defined(NETWARE) && APR_HAS_LARGE_FILES + if (ftruncate64(fp->filedes, offset) == -1) { +#else if (ftruncate(fp->filedes, offset) == -1) { +#endif return errno; } return setptr(fp, offset); diff --git a/include/apr.hnw b/include/apr.hnw index 919c5413290..a03bc0276c2 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -227,7 +227,7 @@ extern "C" { #define APR_HAS_UNICODE_FS 0 #define APR_HAS_PROC_INVOKED 0 #define APR_HAS_USER 1 -#define APR_HAS_LARGE_FILES 0 +#define APR_HAS_LARGE_FILES 1 #define APR_HAS_XTHREAD_FILES 0 #define APR_HAS_OS_UUID 0 @@ -347,7 +347,11 @@ typedef int apr_socklen_t; #define APR_SIZE_T_FMT "d" +#if APR_HAS_LARGE_FILES +#define APR_OFF_T_FMT "lld" +#else #define APR_OFF_T_FMT "ld" +#endif #define APR_PID_T_FMT "d" diff --git a/include/arch/netware/apr_arch_file_io.h b/include/arch/netware/apr_arch_file_io.h index 54dabe29bb4..70c8ea51fa6 100644 --- a/include/arch/netware/apr_arch_file_io.h +++ b/include/arch/netware/apr_arch_file_io.h @@ -127,9 +127,9 @@ struct apr_file_t { /* Stuff for buffered mode */ char *buffer; int bufpos; /* Read/Write position in buffer */ - unsigned long dataRead; /* amount of valid data read into buffer */ + apr_off_t dataRead; /* amount of valid data read into buffer */ int direction; /* buffer being used for 0 = read, 1 = write */ - unsigned long filePtr; /* position in file of handle */ + apr_off_t filePtr; /* position in file of handle */ #if APR_HAS_THREADS struct apr_thread_mutex_t *thlock; #endif From e06450716fce6c7d6fb8d4b434d634cb6aa383e4 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 16 Dec 2003 10:57:17 +0000 Subject: [PATCH 4782/7878] Review of x86 asm, fixing intel_atomic_add32 with gcc 2.7.2.1 which doesn't allow the '+' constraint on an output operand. * apr_atomic.c (apr_atomic_cas32, apr_atomic_sub32): Condition code register is clobbered. (intel_atomic_add32): Use separate input operands rather than read/write output operands; clobber cc. (apr_atomic_dec32): Simplify by two instructions to output an 8-bit value; clobber cc. Submitted by: David Howells git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64839 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 67a6bb0aa7e..122a2c4d0a1 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -99,7 +99,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, asm volatile ("lock; cmpxchgl %1, %2" : "=a" (prev) : "r" (with), "m" (*(mem)), "0"(cmp) - : "memory"); + : "memory", "cc"); return prev; } #define APR_OVERRIDE_ATOMIC_CAS32 @@ -108,10 +108,9 @@ static apr_uint32_t inline intel_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { asm volatile ("lock; xaddl %0,%1" - : "+r"(val), "+m"(*mem) /* outputs and inputs */ - : - : "memory"); /*XXX is this needed? it knows that - *mem is an output */ + : "=r"(val), "=m"(*mem) /* outputs */ + : "0"(val), "m"(*mem) /* inputs */ + : "memory", "cc"); return val; } @@ -127,21 +126,19 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) asm volatile ("lock; subl %1, %0" : : "m" (*(mem)), "r" (val) - : "memory"); + : "memory", "cc"); } #define APR_OVERRIDE_ATOMIC_SUB32 APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) { - int prev; + unsigned char prev; - asm volatile ("mov $0, %%eax;\n\t" - "lock; decl %1;\n\t" - "setnz %%al;\n\t" - "mov %%eax, %0" - : "=r" (prev) + asm volatile ("lock; decl %1;\n\t" + "setnz %%al" + : "=a" (prev) : "m" (*(mem)) - : "memory", "%eax"); + : "memory", "cc"); return prev; } #define APR_OVERRIDE_ATOMIC_DEC32 From cd0f059887fe437044ecac1008c8bee4b22503cb Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 16 Dec 2003 18:24:03 +0000 Subject: [PATCH 4783/7878] apr_socket_connect(): allow app to make subsequent call on non-blocking socket. (and find it is connected, not get unexpected EISCONN retval) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64840 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ network_io/unix/sockets.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index fc7907c9bb2..b4c510e9102 100644 --- a/CHANGES +++ b/CHANGES @@ -100,6 +100,9 @@ Changes with APR 1.0 Changes with APR 0.9.5 + *) apr_socket_connect(): allow app to make subsequent call on + non-blocking socket. [Jeff Trawick] + *) Add apr_os_pipe_put_ex(), which allows the caller to tell APR to establish a cleanup on the pipe. [Jeff Trawick, Brad Nicholes] diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 52bf434c95f..a2ae69a1ec4 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -294,7 +294,7 @@ apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) #endif /* SO_ERROR */ } - if (rc == -1) { + if (rc == -1 && errno != EISCONN) { return errno; } From 6736d5cd272ffce05580978cba4601012b423dd6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 22 Dec 2003 21:03:55 +0000 Subject: [PATCH 4784/7878] the iconv hint is picked up from apr-util/apu-hints.m4, not from this file git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64842 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 -- 1 file changed, 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index b761514b6fd..e124ca18c45 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -61,7 +61,6 @@ if test "x$apr_preload_done" != "xyes" ; then APR_SETIFNULL(AIX_XLC, [yes]) APR_ADDTO(CFLAGS, [-qHALT=E]) fi - APR_SETIFNULL(apr_iconv_inbuf_const, [1]) APR_SETIFNULL(apr_sysvsem_is_global, [yes]) APR_ADDTO(LDFLAGS, [-Wl,-brtl]) ;; @@ -191,7 +190,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-solaris2*) PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT]) - APR_SETIFNULL(apr_iconv_inbuf_const, [1]) ;; *-sunos4*) APR_ADDTO(CPPFLAGS, [-DSUNOS4]) From a9a7add37a290064d907e080cf5ffa5163d82177 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 23 Dec 2003 14:54:55 +0000 Subject: [PATCH 4785/7878] fix a false failure with APR_CHECK_GETNAMEINFO_IPV4_MAPPED on z/OS - NI_MAXHOST is not defined, so provide fall-back logic (we could just skip NI_MAXHOST altogether, but showing the fallback will remind folks of why we can't just use NI_MAXHOST) - htonl is a macro in arpa/inet.h, so include that header so that the link is successful git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64845 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index a749ca7d2b9..ff875773f73 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -198,11 +198,18 @@ AC_DEFUN(APR_CHECK_GETNAMEINFO_IPV4_MAPPED,[ #ifdef HAVE_NETINET_IN_H #include #endif +#ifdef HAVE_ARPA_INET_H +#include +#endif void main(void) { struct sockaddr_in6 sa = {0}; struct in_addr ipv4; +#if defined(NI_MAXHOST) char hbuf[NI_MAXHOST]; +#else + char hbuf[256]; +#endif unsigned int *addr32; int error; From bb807f3682122812dfbe10368a9ef1401902f19c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 29 Dec 2003 14:57:30 +0000 Subject: [PATCH 4786/7878] Spelling/grammar fixes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64846 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_cond.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h index 263604eb38c..1fa67370845 100644 --- a/include/apr_thread_cond.h +++ b/include/apr_thread_cond.h @@ -127,9 +127,9 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, apr_interval_time_t timeout); /** - * Signals a singla thread, if one exists, that is blocking on the given + * Signals a single thread, if one exists, that is blocking on the given * condition variable. That thread is then scheduled to wake up and acquire - * the associated mutex. Although it is not required, if predictible schedule + * the associated mutex. Although it is not required, if predictable scheduling * is desired, that mutex must be locked while calling this function. * @param cond the condition variable on which to produce the signal. */ @@ -137,7 +137,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond); /** * Signals all threads blocking on the given condition variable. - * Each thread that was signaled is then schedule to wake up and acquire + * Each thread that was signaled is then scheduled to wake up and acquire * the associated mutex. This will happen in a serialized manner. * @param cond the condition variable on which to produce the broadcast. */ From a4b0d5e0807b1b59fe3ca1f33ed8c4b952a5851f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 29 Dec 2003 15:06:38 +0000 Subject: [PATCH 4787/7878] * include/arch/unix/apr_arch_thread_cond.h: Store a pthread_cond_t object in struct apr_thread_cond_t rather than a pointer to one. * locks/unix/thread_cond.c (apr_thread_cond_create): Adjust use of ->cond, remove ENOMEM handling. (apr_thread_cond_wait, apr_thread_cond_timedwait, apr_thread_cond_signal, apr_thread_cond_broadcast): Adjust use of ->cond. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64847 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_thread_cond.h | 2 +- locks/unix/thread_cond.c | 25 +++++++----------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/include/arch/unix/apr_arch_thread_cond.h b/include/arch/unix/apr_arch_thread_cond.h index ce4f3ce9c7b..5ae50d1ee1b 100644 --- a/include/arch/unix/apr_arch_thread_cond.h +++ b/include/arch/unix/apr_arch_thread_cond.h @@ -72,7 +72,7 @@ #if APR_HAS_THREADS struct apr_thread_cond_t { apr_pool_t *pool; - pthread_cond_t *cond; + pthread_cond_t cond; }; #endif diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c index a09ec3fc756..ae6c760cf72 100644 --- a/locks/unix/thread_cond.c +++ b/locks/unix/thread_cond.c @@ -64,7 +64,7 @@ static apr_status_t thread_cond_cleanup(void *data) apr_thread_cond_t *cond = (apr_thread_cond_t *)data; apr_status_t rv; - rv = pthread_cond_destroy(cond->cond); + rv = pthread_cond_destroy(&cond->cond); #ifdef PTHREAD_SETS_ERRNO if (rv) { rv = errno; @@ -79,22 +79,11 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, apr_thread_cond_t *new_cond; apr_status_t rv; - new_cond = (apr_thread_cond_t *)apr_pcalloc(pool, - sizeof(apr_thread_cond_t)); - - if (new_cond == NULL) { - return APR_ENOMEM; - } + new_cond = apr_palloc(pool, sizeof(apr_thread_cond_t)); new_cond->pool = pool; - new_cond->cond = (pthread_cond_t *)apr_palloc(pool, - sizeof(pthread_cond_t)); - - if (new_cond->cond == NULL) { - return APR_ENOMEM; - } - if ((rv = pthread_cond_init(new_cond->cond, NULL))) { + if ((rv = pthread_cond_init(&new_cond->cond, NULL))) { #ifdef PTHREAD_SETS_ERRNO rv = errno; #endif @@ -115,7 +104,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, { apr_status_t rv; - rv = pthread_cond_wait(cond->cond, &mutex->mutex); + rv = pthread_cond_wait(&cond->cond, &mutex->mutex); #ifdef PTHREAD_SETS_ERRNO if (rv) { rv = errno; @@ -136,7 +125,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, abstime.tv_sec = apr_time_sec(then); abstime.tv_nsec = apr_time_usec(then) * 1000; /* nanoseconds */ - rv = pthread_cond_timedwait(cond->cond, &mutex->mutex, &abstime); + rv = pthread_cond_timedwait(&cond->cond, &mutex->mutex, &abstime); #ifdef PTHREAD_SETS_ERRNO if (rv) { rv = errno; @@ -153,7 +142,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) { apr_status_t rv; - rv = pthread_cond_signal(cond->cond); + rv = pthread_cond_signal(&cond->cond); #ifdef PTHREAD_SETS_ERRNO if (rv) { rv = errno; @@ -166,7 +155,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) { apr_status_t rv; - rv = pthread_cond_broadcast(cond->cond); + rv = pthread_cond_broadcast(&cond->cond); #ifdef PTHREAD_SETS_ERRNO if (rv) { rv = errno; From 1270678d5f0af2b12a8f76ab0e88e34e707d90d6 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 29 Dec 2003 15:31:39 +0000 Subject: [PATCH 4788/7878] * include/apr_thread_cond.h: Note when destroying a condvar gives undefined results in a POSIX implementation. * locks/unix/thread_cond.c (apr_thread_cond_create): Don't run cleanup if pthread_cond_init fails since that gives undefined results. (apr_thread_cond_destroy): Use apr_pool_cleanup_run so the cleanup is always unregistered. * test/testlock.c (test_cond): Test apr_thread_cond_destroy and use apr_assert_success() a little more. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64848 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_cond.h | 6 ++++++ locks/unix/thread_cond.c | 8 +------- test/testlock.c | 19 ++++++++++++------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h index 1fa67370845..8bf13713768 100644 --- a/include/apr_thread_cond.h +++ b/include/apr_thread_cond.h @@ -81,6 +81,12 @@ extern "C" { /** Opaque structure for thread condition variables */ typedef struct apr_thread_cond_t apr_thread_cond_t; +/** + * Note: destroying a condition variable (or likewise, destroying or + * clearing the pool from which a condition variable was allocated) if + * any threads are blocked waiting on it gives undefined results. + */ + /** * Create and initialize a condition variable that can be used to signal * and schedule threads in a single process. diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c index ae6c760cf72..94f42268a97 100644 --- a/locks/unix/thread_cond.c +++ b/locks/unix/thread_cond.c @@ -87,7 +87,6 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, #ifdef PTHREAD_SETS_ERRNO rv = errno; #endif - thread_cond_cleanup(new_cond); return rv; } @@ -166,12 +165,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) { - apr_status_t rv; - if ((rv = thread_cond_cleanup(cond)) == APR_SUCCESS) { - apr_pool_cleanup_kill(cond->pool, cond, thread_cond_cleanup); - return APR_SUCCESS; - } - return rv; + return apr_pool_cleanup_run(cond->pool, cond, thread_cond_cleanup); } APR_POOL_IMPLEMENT_ACCESSOR(thread_cond) diff --git a/test/testlock.c b/test/testlock.c index cc4df3a20cb..d1b9b3adb88 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -251,17 +251,19 @@ static void test_cond(CuTest *tc) apr_status_t s0, s1, s2, s3, s4; int count1, count2, count3, count4; int sum; - - s1 = apr_thread_mutex_create(&put.mutex, APR_THREAD_MUTEX_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, s1); + + apr_assert_success(tc, "create put mutex", + apr_thread_mutex_create(&put.mutex, + APR_THREAD_MUTEX_DEFAULT, p)); CuAssertPtrNotNull(tc, put.mutex); - s1 = apr_thread_mutex_create(&nready.mutex, APR_THREAD_MUTEX_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, s1); + apr_assert_success(tc, "create nready mutex", + apr_thread_mutex_create(&nready.mutex, + APR_THREAD_MUTEX_DEFAULT, p)); CuAssertPtrNotNull(tc, nready.mutex); - s1 = apr_thread_cond_create(&nready.cond, p); - CuAssertIntEquals(tc, APR_SUCCESS, s1); + apr_assert_success(tc, "create condvar", + apr_thread_cond_create(&nready.cond, p)); CuAssertPtrNotNull(tc, nready.cond); count1 = count2 = count3 = count4 = 0; @@ -287,6 +289,9 @@ static void test_cond(CuTest *tc) apr_thread_join(&s3, p4); apr_thread_join(&s4, c1); + apr_assert_success(tc, "destroy condvar", + apr_thread_cond_destroy(nready.cond)); + sum = count1 + count2 + count3 + count4; /* printf("count1 = %d count2 = %d count3 = %d count4 = %d\n", From 496b200110bdbd9af927df71613470d6c38eb03a Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 29 Dec 2003 20:55:08 +0000 Subject: [PATCH 4789/7878] silence 2 doxygen warnings submitted by: sander temme git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64849 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 2 +- include/apr_network_io.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index e21d7c97752..ac280c7fa6d 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -455,7 +455,7 @@ APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile); * @param str The buffer to store the string in. * @param len The length of the string * @param thefile The file descriptor to read from - * @remark The buffer will be '\0'-terminated if any characters are stored. + * @remark The buffer will be '\\0'-terminated if any characters are stored. */ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile); diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 9d1c6a6e066..c4874100306 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -181,6 +181,10 @@ struct in_addr { #define APR_UNSPEC 0 #endif #if APR_HAVE_IPV6 +/** @def APR_INET6 +* IPv6 Address Family. Not all platforms may have this defined. +*/ + #define APR_INET6 AF_INET6 #endif From 1c48dc43ba7e4cb86d15857ab9cb96b92ca1d165 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 29 Dec 2003 21:03:49 +0000 Subject: [PATCH 4790/7878] doxygen fixes new status check APR_STATUS_IS_ENOTENOUGHENTROPY Submitted by: Sander Temme git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64850 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_errno.h | 6 ++++-- test/testrand2.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index b4c510e9102..155332e82ca 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) new error status APR_STATUS_IS_ENOTENOUGHENTROPY, Doxygen fixes + [Sander Temme Date: Mon, 29 Dec 2003 21:10:18 +0000 Subject: [PATCH 4791/7878] more doxygen fixes from sander Submitted by: sander temme git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64851 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 1 + include/apr_portable.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index c3a25bdb109..f159ecd47aa 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -100,6 +100,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem); /** * atomically set an apr_uint32_t in memory * @param mem pointer to the object + * @param val value that the object will assume */ APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val); diff --git a/include/apr_portable.h b/include/apr_portable.h index ac124a98fef..7a52c14b3dd 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -164,14 +164,17 @@ typedef void* apr_os_shm_t; /** Basic OS process mutex structure. */ struct apr_os_proc_mutex_t { #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE + /** Value used for SYS V Semaphore, FCNTL and FLOCK serialization */ int crossproc; #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE + /** Value used for PTHREAD serialization */ pthread_mutex_t *pthread_interproc; #endif #if APR_HAS_THREADS /* If no threads, no need for thread locks */ #if APR_USE_PTHREAD_SERIALIZE + /** This value is currently unused within APR and Apache */ pthread_mutex_t *intraproc; #endif #endif From bd8fc102f04d2b922c924b68add30a3a334a51a1 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Tue, 30 Dec 2003 09:21:28 +0000 Subject: [PATCH 4792/7878] more doxygen cleanup Submitted by: Sander Temme git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64852 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index 13a6f9af1ed..02c133acd2e 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -80,8 +80,7 @@ extern "C" { */ /** - * @defgroup apr_poll_opt Poll options - * @{ + * Poll options */ #define APR_POLLIN 0x001 /**< Can read without blocking */ #define APR_POLLPRI 0x002 /**< Priority data available */ @@ -89,7 +88,6 @@ extern "C" { #define APR_POLLERR 0x010 /**< Pending error */ #define APR_POLLHUP 0x020 /**< Hangup occurred */ #define APR_POLLNVAL 0x040 /**< Descriptior invalid */ -/** @} */ /** Used in apr_pollfd_t to determine what the apr_descriptor is */ typedef enum { @@ -186,13 +184,9 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, * a maximum, not a minimum. If a socket is signalled, we * will wake up before this time. A negative number means * wait until a socket is signalled. - * @remark - *
    - * The number of sockets signalled is returned in the second argument. 
    - *
    - *        This is a blocking call, and it will not return until either a 
    - *        socket has been signalled, or the timeout has expired. 
    - * 
    + * @remark The number of sockets signalled is returned in the third argument. + * This is a blocking call, and it will not return until either a + * socket has been signalled, or the timeout has expired. */ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, apr_int32_t *nsds, From 6ddc05aab5409ece495cd5540931cb6b7e08bf8a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 31 Dec 2003 21:37:33 +0000 Subject: [PATCH 4793/7878] * apr_atomic.c: Remove use of atomic_* from FreeBSD's machine/atomic.h, these don't return values and aren't usable from userspace on more arches than just i386. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64853 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 122a2c4d0a1..16139285208 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -58,36 +58,6 @@ #include -#if defined(__FreeBSD__) && !defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC - -#include - -APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - return atomic_add_int(mem, val); -} -#define APR_OVERRIDE_ATOMIC_ADD32 - -APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) -{ - return atomic_subtract_int(mem, 1); -} -#define APR_OVERRIDE_ATOMIC_DEC32 - -APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) -{ - return atomic_add_int(mem, 1); -} -#define APR_OVERRIDE_ATOMIC_INC32 - -APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - atomic_set_int(mem, val); -} -#define APR_OVERRIDE_ATOMIC_SET32 - -#endif /* __FreeBSD__ && !__i386__ */ - #if defined(__i386__) && defined(__GNUC__) && !APR_FORCE_ATOMIC_GENERIC APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, From 85b35373ea98273c1b4d47700f2af4a7acd70073 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 31 Dec 2003 21:40:57 +0000 Subject: [PATCH 4794/7878] * atomic/solaris_sparc: Remove now-unused leftovers of Solaris/SPARC-specific atomics. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64854 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/.cvsignore | 5 ---- atomic/solaris_sparc/Makefile.in | 23 ------------------- .../apr_atomic_sparc_no_support.c | 5 ---- 3 files changed, 33 deletions(-) delete mode 100644 atomic/solaris_sparc/.cvsignore delete mode 100644 atomic/solaris_sparc/Makefile.in delete mode 100644 atomic/solaris_sparc/apr_atomic_sparc_no_support.c diff --git a/atomic/solaris_sparc/.cvsignore b/atomic/solaris_sparc/.cvsignore deleted file mode 100644 index 4e18126ffb1..00000000000 --- a/atomic/solaris_sparc/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile -*.lo -*.S -.libs -.deps diff --git a/atomic/solaris_sparc/Makefile.in b/atomic/solaris_sparc/Makefile.in deleted file mode 100644 index df5e6cfeafa..00000000000 --- a/atomic/solaris_sparc/Makefile.in +++ /dev/null @@ -1,23 +0,0 @@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -TARGETS = @apr_atomic_sparc_compile@ apr_atomic_sparc_no_support.lo - -ASFLAGS += @ASFLAGS@ -ASCPPFLAGS = @ASCPPFLAGS@ -AS = @AS@ -ASCPP = @ASCPP@ - -# bring in rules.mk for standard functionality -@INCLUDE_RULES@ - -apr_atomic_sparc.lo: $(srcdir)/apr_atomic_sparc.s - $(ASCPP) $(ASCPPFLAGS) - < $(srcdir)/$*.s > $*.S - $(AS) $(ASFLAGS) -o $@ $*.S - - -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCDIR=../../include -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR) - -# DO NOT REMOVE diff --git a/atomic/solaris_sparc/apr_atomic_sparc_no_support.c b/atomic/solaris_sparc/apr_atomic_sparc_no_support.c deleted file mode 100644 index d77c7886054..00000000000 --- a/atomic/solaris_sparc/apr_atomic_sparc_no_support.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "apr.h" -/* Pick up the default implementations of any atomic operations - * that haven't been redefined as Sparc-specific functions - */ -#include "../unix/apr_atomic.c" From 563a0f0070d7eb28c0fe39abe4813ea154f0974b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 2 Jan 2004 19:24:13 +0000 Subject: [PATCH 4795/7878] * configure.in: Remove check for sqrt(), which is not used by APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64855 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.in b/configure.in index fb09f5e7b3b..c8405f2d74c 100644 --- a/configure.in +++ b/configure.in @@ -463,7 +463,6 @@ AC_CHECK_LIB(socket, socket) AC_SEARCH_LIBS(crypt, crypt ufc) AC_CHECK_LIB(truerand, main) AC_SEARCH_LIBS(modf, m) -AC_SEARCH_LIBS(sqrt, m) dnl ----------------------------- Checking for Threads echo "${nl}Checking for Threads..." From 0442c7d466f51343a286c9b9f12f91dcef637cdb Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 4 Jan 2004 11:26:22 +0000 Subject: [PATCH 4796/7878] * build/buildcheck.sh: Determine libtool version correctly for --version output from current libtool CVS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64856 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index c6c6fbbbd06..e90d086531d 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -20,9 +20,14 @@ else echo "buildconf: autoconf version $ac_version (ok)" fi -# libtool 1.3.3 or newer +# Sample libtool --version outputs: +# ltmain.sh (GNU libtool) 1.3.3 (1.385.2.181 1999/07/02 15:49:11) +# ltmain.sh (GNU libtool 1.1361 2004/01/02 23:10:52) 1.5a +# output is multiline from 1.5 onwards + +# Require libtool 1.3.3 or newer libtool=`build/PrintPath glibtool libtool` -lt_pversion=`$libtool --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'` +lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` if test -z "$lt_pversion"; then echo "buildconf: libtool not found." echo " You need libtool version 1.3.3 or newer installed" From 7ee0260b2b02501af8ce769bbff96cd2e04570ba Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Mon, 5 Jan 2004 01:23:48 +0000 Subject: [PATCH 4797/7878] make it say NUL-terminated instead of \0 terminated so both developers and doxygen can be happy! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64857 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index ac280c7fa6d..3a4a033dd79 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -455,7 +455,7 @@ APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile); * @param str The buffer to store the string in. * @param len The length of the string * @param thefile The file descriptor to read from - * @remark The buffer will be '\\0'-terminated if any characters are stored. + * @remark The buffer will be NUL-terminated if any characters are stored. */ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile); From a334a572c86d16c02e7cc5f8088d9bf780ca3bbb Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 5 Jan 2004 11:16:26 +0000 Subject: [PATCH 4798/7878] * configure.in: Don't pick up libnsl if gethostbyname is in libc, don't pick up libsocket if socket is in libc. Submitted by: Noah Misch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64858 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index c8405f2d74c..17385832c8a 100644 --- a/configure.in +++ b/configure.in @@ -457,9 +457,9 @@ dnl Note: Autoconf will always append LIBS with an extra " " in AC_CHECK_LIB. dnl It should check for LIBS being empty and set LIBS equal to the new value dnl without the extra " " in that case, but they didn't do that. So, we dnl end up LIBS="-lm -lcrypt -lnsl -ldl" which is an annoyance. -AC_CHECK_LIB(nsl, gethostbyname) +AC_SEARCH_LIBS(gethostbyname, nsl) AC_SEARCH_LIBS(gethostname, nsl) -AC_CHECK_LIB(socket, socket) +AC_SEARCH_LIBS(socket, socket) AC_SEARCH_LIBS(crypt, crypt ufc) AC_CHECK_LIB(truerand, main) AC_SEARCH_LIBS(modf, m) From 6534a28a3fe9d2b1555796e89a6281f3e7a94f63 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 6 Jan 2004 13:58:18 +0000 Subject: [PATCH 4799/7878] * atomic/unix/apr_atomic.c: Enable x86 asm on AMD64. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64859 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 16139285208..feaeee11c1b 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -58,7 +58,8 @@ #include -#if defined(__i386__) && defined(__GNUC__) && !APR_FORCE_ATOMIC_GENERIC +#if (defined(__i386__) || defined(__x86_64__)) \ + && defined(__GNUC__) && !APR_FORCE_ATOMIC_GENERIC APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, From c96b09ade3b9d50aea8104399fe664d381cb5ade Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 6 Jan 2004 14:49:11 +0000 Subject: [PATCH 4800/7878] * testatomic.c (check_basic_atomics32): Test wrapping around zero. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64860 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/testatomic.c b/test/testatomic.c index 74d9284f63e..e05a783c96d 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -84,6 +84,7 @@ static apr_status_t check_basic_atomics32(void) { apr_uint32_t oldval; apr_uint32_t casval = 0; + apr_uint32_t minus1 = -1; apr_atomic_set32(&y32, 2); printf("%-60s", "testing apr_atomic_dec32"); @@ -179,6 +180,30 @@ static apr_status_t check_basic_atomics32(void) } fprintf(stdout, "OK\n"); + printf("%-60s", "testing wrapping around zero"); + + apr_atomic_set32(&y32, 0); + if (apr_atomic_dec32(&y32) == 0) { + fprintf(stderr, "apr_atomic_dec32 on zero returned zero.\n"); + return APR_EGENERAL; + } + if (apr_atomic_read32(&y32) != minus1) { + fprintf(stderr, "zero wrap failed: 0 - 1 = %d\n", + apr_atomic_read32(&y32)); + return APR_EGENERAL; + } + + if (apr_atomic_inc32(&y32) != minus1) { + fprintf(stderr, "apr_atomic_inc32 on -1 returned bad value.\n"); + return APR_EGENERAL; + } + if (apr_atomic_read32(&y32) != 0) { + fprintf(stderr, "zero wrap failed: -1 + 1 = %u\n", + apr_atomic_read32(&y32)); + return APR_EGENERAL; + } + printf("OK\n"); + return APR_SUCCESS; } From 69d0ed538885af320ec521786b87776695b7accb Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 6 Jan 2004 15:07:46 +0000 Subject: [PATCH 4801/7878] Clean up configure logic for enabling "nonportable" atomics: don't export the result via apr.h, and enable use of inline asm by default on ppc64 and x86_64. * configure.in: Define USE_GENERIC_ATOMICS on i[456]86 unless --enable-nonportable-atomics was used. * include/apr.h.in: Remove APR_FORCE_GENERIC_ATOMICS. * atomic/unix/apr_atomic.c: Check for !defined(USE_GENERIC_ATOMICS) rather than defined(APR_FORCE_GENERIC_ATOMICS). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64861 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 8 +++++-- configure.in | 47 ++++++++++++++++------------------------ include/apr.h.in | 3 --- 3 files changed, 25 insertions(+), 33 deletions(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index feaeee11c1b..8b4296cdf73 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -56,10 +56,12 @@ #include "apr_atomic.h" #include "apr_thread_mutex.h" +#include "apr_private.h" + #include #if (defined(__i386__) || defined(__x86_64__)) \ - && defined(__GNUC__) && !APR_FORCE_ATOMIC_GENERIC + && defined(__GNUC__) && !defined(USE_GENERIC_ATOMICS) APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, @@ -142,7 +144,9 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint #endif /* (__linux__ || __EMX__ || __FreeBSD__) && __i386__ */ -#if (defined(__PPC__) || defined(__ppc__)) && defined(__GNUC__) && !APR_FORCE_ATOMIC_GENERIC +#if (defined(__PPC__) || defined(__ppc__)) && defined(__GNUC__) \ + && !defined(USE_GENERIC_ATOMICS) + APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t swap, apr_uint32_t cmp) diff --git a/configure.in b/configure.in index 17385832c8a..2f888e9983d 100644 --- a/configure.in +++ b/configure.in @@ -339,22 +339,7 @@ esac dnl Check the depend program we can use APR_CHECK_DEPEND -# force_atomic_generic flag -# this will be set we find a cpu/OS combo -# which is historical and doesn't work with the method -# we are using for the more up to date cpu/OS -# (ie.. old sparcs) -apr_force_atomic_generic=0 proc_mutex_is_global=0 -nonportable_atomics_enabled=0 - -AC_ARG_ENABLE(nonportable-atomics, -[ --enable-nonportable-atomics Turn on optimized atomic code which may produce nonportable binaries], -[ - if test "$enableval" = "yes"; then - nonportable_atomics_enabled=1 - fi -]) config_subdirs="none" INSTALL_SUBDIRS="none" @@ -406,18 +391,6 @@ case $host in enable_threads="no" eolstr="\\n" ;; - *linux*) - apr_force_atomic_generic=1 - case $host_cpu in - i486|i586|i686|powerpc64) - if test "$nonportable_atomics_enabled" = 1; then - apr_force_atomic_generic=0 - fi - ;; - esac - OSDIR="unix" - eolstr="\\n" - ;; *hpux10* ) enable_threads="no" OSDIR="unix" @@ -429,7 +402,25 @@ case $host in ;; esac -AC_SUBST(apr_force_atomic_generic) +AC_ARG_ENABLE(nonportable-atomics, +[ --enable-nonportable-atomics Use optimized atomic code which may produce nonportable binaries], +[if test $enableval = yes; then + force_generic_atomics=no + else + force_generic_atomics=yes + fi +], +[case $host_cpu in + i[[456]]86) force_generic_atomics=yes ;; + *) force_generic_atomics=no ;; +esac +]) + +if test $force_generic_atomics = yes; then + AC_DEFINE([USE_GENERIC_ATOMICS], 1, + [Define if use of generic atomics is requested]) +fi + AC_SUBST(proc_mutex_is_global) AC_SUBST(eolstr) AC_SUBST(INSTALL_SUBDIRS) diff --git a/include/apr.h.in b/include/apr.h.in index ea96ee789ed..2a19efbadbd 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -399,9 +399,6 @@ typedef @socklen_t_value@ apr_socklen_t; #define APR_HAVE_INT64_STRFN @have_int64_strfn@ #define APR_INT64_STRFN @int64_strfn@ -/* are we going to force the generic atomic operations */ -#define APR_FORCE_ATOMIC_GENERIC @apr_force_atomic_generic@ - /* Does the proc mutex lock threads too */ #define APR_PROC_MUTEX_IS_GLOBAL @proc_mutex_is_global@ From ff9c349ee223fb56b07415f3fb53dd0a542cf515 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 6 Jan 2004 15:43:25 +0000 Subject: [PATCH 4802/7878] The SPARC atomics are no longer included. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64862 13f79535-47bb-0310-9956-ffa450edef68 --- LICENSE | 8 -------- 1 file changed, 8 deletions(-) diff --git a/LICENSE b/LICENSE index aa4f091ea65..57b0271586c 100644 --- a/LICENSE +++ b/LICENSE @@ -109,14 +109,6 @@ From network_io/unix/inet_ntop.c, network_io/unix/inet_pton.c: * SOFTWARE. */ -From atomic/solaris_sparc/apr_atomic_sparc.s: - -!* This code is based on the UltraSPARC atomics library by Mike Bennett -!* The Initial Developer of the Original Code is Mike Bennett, -!* mbennett@netcom.com, Copyright (C) 1999. All Rights Reserved. -!* This code is based on the sparc architecture Manual version 9 -!* section J.11 (page 333) - From dso/aix/dso.c: * Based on libdl (dlfcn.c/dlfcn.h) which is From e81043df40c0370d0027ba44c003d8d70de4812d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 8 Jan 2004 22:47:08 +0000 Subject: [PATCH 4803/7878] * configure.in: Separate library checks from "checking for compiler flags" output. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64863 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index 2f888e9983d..993a634ccd6 100644 --- a/configure.in +++ b/configure.in @@ -443,6 +443,8 @@ case $host in ;; esac +echo "${nl}Checking for libraries..." + dnl ----------------------------- Checks for Any required Libraries dnl Note: Autoconf will always append LIBS with an extra " " in AC_CHECK_LIB. dnl It should check for LIBS being empty and set LIBS equal to the new value From efe13b8b7359c5892802c0d93ca7c0a4075bd0d9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 9 Jan 2004 16:43:05 +0000 Subject: [PATCH 4804/7878] * testuser.c: Convert to use apr_assert_success throughout. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64864 13f79535-47bb-0310-9956-ffa450edef68 --- test/testuser.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/test/testuser.c b/test/testuser.c index 69f87a422f8..5bac1d2c986 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * Copyright (c) 2000-2004 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,10 +62,9 @@ static void uid_current(CuTest *tc) { apr_uid_t uid; apr_gid_t gid; - apr_status_t rv; - rv = apr_uid_current(&uid, &gid, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + apr_assert_success(tc, "apr_uid_current failed", + apr_uid_current(&uid, &gid, p)); } static void username(CuTest *tc) @@ -74,20 +73,20 @@ static void username(CuTest *tc) apr_gid_t gid; apr_uid_t retreived_uid; apr_gid_t retreived_gid; - apr_status_t rv; char *uname = NULL; - rv = apr_uid_current(&uid, &gid, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - - rv = apr_uid_name_get(&uname, uid, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + apr_assert_success(tc, "apr_uid_current failed", + apr_uid_current(&uid, &gid, p)); + + apr_assert_success(tc, "apr_uid_name_get failed", + apr_uid_name_get(&uname, uid, p)); CuAssertPtrNotNull(tc, uname); - rv = apr_uid_get(&retreived_uid, &retreived_gid, uname, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + apr_assert_success(tc, "apr_uid_get failed", + apr_uid_get(&retreived_uid, &retreived_gid, uname, p)); - CuAssertIntEquals(tc, APR_SUCCESS, apr_uid_compare(uid, retreived_uid)); + apr_assert_success(tc, "apr_uid_compare failed", + apr_uid_compare(uid, retreived_uid)); #ifdef WIN32 /* ### this fudge was added for Win32 but makes the test return NotImpl * on Unix if run as root, when !gid is also true. */ @@ -105,7 +104,8 @@ static void username(CuTest *tc) } else { #endif - CuAssertIntEquals(tc, APR_SUCCESS, apr_gid_compare(gid, retreived_gid)); + apr_assert_success(tc, "apr_gid_compare failed", + apr_gid_compare(gid, retreived_gid)); #ifdef WIN32 } #endif @@ -116,20 +116,20 @@ static void groupname(CuTest *tc) apr_uid_t uid; apr_gid_t gid; apr_gid_t retreived_gid; - apr_status_t rv; char *gname = NULL; - rv = apr_uid_current(&uid, &gid, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + apr_assert_success(tc, "apr_uid_current failed", + apr_uid_current(&uid, &gid, p)); - rv = apr_gid_name_get(&gname, gid, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + apr_assert_success(tc, "apr_gid_name_get failed", + apr_gid_name_get(&gname, gid, p)); CuAssertPtrNotNull(tc, gname); - rv = apr_gid_get(&retreived_gid, gname, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + apr_assert_success(tc, "apr_gid_get failed", + apr_gid_get(&retreived_gid, gname, p)); - CuAssertIntEquals(tc, APR_SUCCESS, apr_gid_compare(gid, retreived_gid)); + apr_assert_success(tc, "apr_gid_compare failed", + apr_gid_compare(gid, retreived_gid)); } #else static void users_not_impl(CuTest *tc) From 51e2cae419820fb1ae8d1905c0d716ef9545f4ea Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 9 Jan 2004 18:13:52 +0000 Subject: [PATCH 4805/7878] before calling apr_socket_recv() and expecting to get EOF, make sure there is a timeout on the socket in case the peer hasn't finished yet git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64865 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/sendfile.c b/test/sendfile.c index b9ba73e3957..78cc6c2f554 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -484,6 +484,17 @@ static int client(client_socket_mode_t socket_mode, char *host) exit(1); } + /* in case this is the non-blocking test, set socket timeout; + * we're just waiting for EOF */ + + rv = apr_socket_timeout_set(sock, apr_time_from_sec(3)); + if (rv != APR_SUCCESS) { + fprintf(stderr, "apr_socket_timeout_set()->%d/%s\n", + rv, + apr_strerror(rv, buf, sizeof buf)); + exit(1); + } + bytes_read = 1; rv = apr_socket_recv(sock, buf, &bytes_read); if (rv != APR_EOF) { From fa4ee00f526aa0a58cdbd2e55e6b564d46b830c1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 9 Jan 2004 19:25:03 +0000 Subject: [PATCH 4806/7878] set timeout on socket prior to recv, since data may not be available immediately git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64867 13f79535-47bb-0310-9956-ffa450edef68 --- test/server.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/server.c b/test/server.c index 1727215373f..fabd81b2cce 100644 --- a/test/server.c +++ b/test/server.c @@ -176,6 +176,9 @@ int main(int argc, const char * const argv[]) fprintf(stdout, "Server socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); + APR_TEST_SUCCESS(rv, "Setting timeout on client socket", + apr_socket_timeout_set(sock2, apr_time_from_sec(3))); + length = STRLEN; APR_TEST_BEGIN(rv, "Receiving data from socket", apr_socket_recv(sock2, datasend, &length)) From 87bc40eb6daebdff8b4ee7a839c5a50442b85cb9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 12 Jan 2004 11:38:14 +0000 Subject: [PATCH 4807/7878] * configure.in: Fix detection of APR_OFF_T_FMT if built with -D_FILE_OFFSET_BITS=64 on 32-bit Linux/Solaris/AIX platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64869 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index 993a634ccd6..6a19bebe858 100644 --- a/configure.in +++ b/configure.in @@ -1187,26 +1187,19 @@ fi # it right. If you find that we don't get it right for your platform, # you can override our decision below. case $host in - *linux*) - off_t_fmt='#define APR_OFF_T_FMT "ld"' - case $host in - s390*) - size_t_fmt='#define APR_SIZE_T_FMT "ld"' - ;; - esac + s390*linux*) + size_t_fmt='#define APR_SIZE_T_FMT "ld"' ;; *os2_emx) off_t_fmt='#define APR_OFF_T_FMT "ld"' size_t_fmt='#define APR_SIZE_T_FMT "lu"' ;; *-solaris*) - off_t_fmt='#define APR_OFF_T_FMT "ld"' pid_t_fmt='#define APR_PID_T_FMT "ld"' ;; *aix4*|*aix5*) ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' size_t_fmt='#define APR_SIZE_T_FMT "ld"' - off_t_fmt='#define APR_OFF_T_FMT "ld"' ;; *beos*) ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' @@ -1218,6 +1211,16 @@ case $host in ;; esac +# Override format string for off_t more carefully: only use hard-coded +# choice if using a 32-bit off_t on platforms which support LFS. +if test "$ac_cv_sizeof_off_t" = "4"; then + case $host in + *linux*|*-solaris*|*aix[[45]]*) + off_t_fmt='#define APR_OFF_T_FMT "ld"' + ;; + esac +fi + AC_SUBST(voidp_size) AC_SUBST(short_value) AC_SUBST(int_value) From 7b603f80e2fbe97e4d85e4f5536f10097d1201a5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 14 Jan 2004 00:45:20 +0000 Subject: [PATCH 4808/7878] Make things a bit easier to understand, based on feedback to the dev@apr list. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64870 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index feac95ca86d..70679fde54b 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -192,7 +192,7 @@ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); * space at the unallocated end of a block, and doesn't actually * complete the allocation until apr_vformatter returns. apr_psprintf * would be completely broken if apr_vformatter were to call anything - * that used a apr_pool_t. Similarly http_bprintf() uses the "scratch" + * that used this same pool. Similarly http_bprintf() uses the "scratch" * space at the end of its output buffer, and doesn't actually note * that the space is in use until it either has to flush the buffer * or until apr_vformatter returns. From f9e2b14f4bfe194b91110a4ce97815f33692f9c9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 15 Jan 2004 09:17:16 +0000 Subject: [PATCH 4809/7878] Document return values of apr_cpystrn and apr_collapse_spaces. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64872 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index ed90befabf3..a11ce3431e6 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -1,7 +1,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * Copyright (c) 2000-2004 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -214,6 +214,7 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) * null-termination, so if src is longer than * dst_size, the actual number of characters copied is * dst_size - 1. + * @return The destination string, dst * @remark *
      * We re-implement this function to implement these specific changes:
    @@ -233,6 +234,7 @@ APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src,
      * @param dest The destination string.  It is okay to modify the string
      *             in place.  Namely dest == src
      * @param src The string to rid the spaces from.
    + * @return The destination string, dest.
      */
     APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src);
     
    
    From a2132f325cda15ab30c086a670e6712cda3b5834 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Thu, 15 Jan 2004 14:12:58 +0000
    Subject: [PATCH 4810/7878] Fix build with recent libtool HEAD:
    
    * buildconf: Use the libtool.m4 which libtoolize copies into the cwd,
    if found.  Move ltsugar.m4 into build if found.
    
    * configure.in: Pick up ltsugar.m4.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64873 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/.cvsignore |  1 +
     buildconf        | 23 ++++++++++++++++-------
     configure.in     |  1 +
     3 files changed, 18 insertions(+), 7 deletions(-)
    
    diff --git a/build/.cvsignore b/build/.cvsignore
    index 8beda2ae171..5ec0b033ba0 100644
    --- a/build/.cvsignore
    +++ b/build/.cvsignore
    @@ -1,5 +1,6 @@
     Makefile
     libtool.m4
    +ltsugar.m4
     ltconfig
     ltmain.sh
     ltcf-c.sh
    diff --git a/buildconf b/buildconf
    index cbc8f6a7759..4555a6e9034 100755
    --- a/buildconf
    +++ b/buildconf
    @@ -2,7 +2,7 @@
     # ====================================================================
     # The Apache Software License, Version 1.1
     #
    -# Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    +# Copyright (c) 2000-2004 The Apache Software Foundation.  All rights
     # reserved.
     #
     # Redistribution and use in source and binary forms, with or without
    @@ -80,9 +80,13 @@ echo "Copying libtool helper files ..."
     
     $libtoolize --copy --automake
     
    -ltpath=`dirname $libtoolize`
    -ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/libtool.m4}
    -
    +if [ -f libtool.m4 ]; then 
    +   ltfile=`pwd`/libtool.m4
    +else
    +   ltpath=`dirname $libtoolize`
    +   ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/libtool.m4}
    +fi
    +  
     if [ ! -f $ltfile ]; then
         echo "$ltfile not found"
         exit 1
    @@ -92,9 +96,14 @@ echo "buildconf: Using libtool.m4 at ${ltfile}."
     
     cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4
     
    -# This is just temporary until people's workspaces are cleared -- remove
    -# any old aclocal.m4 left over from prior build so it doesn't cause errors.
    -rm -f aclocal.m4
    +# libtool.m4 from 1.6 requires ltsugar.m4
    +if [ -f ltsugar.m4 ]; then
    +   rm -f build/ltsugar.m4
    +   mv ltsugar.m4 build/ltsugar.m4
    +fi
    +
    +# Clean up any leftovers
    +rm -f aclocal.m4 libtool.m4
     
     #
     # Generate the autoconf header and ./configure
    diff --git a/configure.in b/configure.in
    index 6a19bebe858..80d98d02449 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -16,6 +16,7 @@ sinclude(build/apr_network.m4)
     sinclude(build/apr_threads.m4)
     sinclude(build/apr_hints.m4)
     sinclude(build/libtool.m4)
    +sinclude(build/ltsugar.m4)
     
     dnl Save user-defined environment settings for later restoration
     dnl
    
    From c40fd9fc34fa5ac0f0ce501e0d0559370a74d930 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 16 Jan 2004 20:40:43 +0000
    Subject: [PATCH 4811/7878] spelling
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64874 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_pools.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr_pools.h b/include/apr_pools.h
    index 15802f75c3f..0d9e1c442ed 100644
    --- a/include/apr_pools.h
    +++ b/include/apr_pools.h
    @@ -132,7 +132,7 @@ typedef struct apr_pool_t apr_pool_t;
      * 
      * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
      * ---------------------------------
    - * |   |   |   |   |   |   |   | x |  General debug code enabled (usefull in
    + * |   |   |   |   |   |   |   | x |  General debug code enabled (useful in
      *                                    combination with --with-efence).
      *
      * |   |   |   |   |   |   | x |   |  Verbose output on stderr (report
    
    From da4145d6a92f0f9ca11fccd35fa081891c7ffa65 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Tue, 20 Jan 2004 16:28:55 +0000
    Subject: [PATCH 4812/7878] * build/buildcheck.sh: Fold the head -1 into the
     sed command; fix build in environments which strictly conform to the latest
     POSIX standard.
    
    PR: 26283
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64875 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/buildcheck.sh | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/build/buildcheck.sh b/build/buildcheck.sh
    index e90d086531d..5670c0f6af7 100755
    --- a/build/buildcheck.sh
    +++ b/build/buildcheck.sh
    @@ -3,7 +3,7 @@
     echo "buildconf: checking installation..."
     
     # autoconf 2.13 or newer
    -ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
    +ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;q'`
     if test -z "$ac_version"; then
     echo "buildconf: autoconf not found."
     echo "           You need autoconf version 2.13 or newer installed"
    
    From a7bb31e4ce6ae50371b73b15a1c38bde0b87d67b Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Sun, 25 Jan 2004 16:35:35 +0000
    Subject: [PATCH 4813/7878] * include/arch/unix/apr_arch_thread_rwlock.h: Use
     result of pthread_rwlock_init check correctly.
    
    (Possible fix for PR 22990)
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64876 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/unix/apr_arch_thread_rwlock.h | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/include/arch/unix/apr_arch_thread_rwlock.h b/include/arch/unix/apr_arch_thread_rwlock.h
    index db69404804a..40ffce1e3a3 100644
    --- a/include/arch/unix/apr_arch_thread_rwlock.h
    +++ b/include/arch/unix/apr_arch_thread_rwlock.h
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2004 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    @@ -67,7 +67,7 @@
     #endif
     
     #if APR_HAS_THREADS
    -#if HAVE_PTHREAD_RWLOCK_INIT
    +#ifdef HAVE_PTHREAD_RWLOCK_INIT
     
     struct apr_thread_rwlock_t {
         apr_pool_t *pool;
    
    From 6f561b0dfe9fc5c292a25475e11a874b2dd3ac99 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Mon, 26 Jan 2004 15:44:28 +0000
    Subject: [PATCH 4814/7878] * configure.in: Fix detection of pthread rwlocks to
     actually fail when pthread_rwlock_t can't be used; print and cache results of
     tests carried out; define HAVE_PTHREAD_RWLOCKS when rwlocks can be used.
    
    * locks/unix/thread_rwlock.c, include/arch/unix/apr_arch_thread_rwlock.h:
    Use new HAVE_PTHREAD_RWLOCKS define.
    
    PR: 22990
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64882 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in                               | 24 +++++++++++-----------
     include/arch/unix/apr_arch_thread_rwlock.h |  2 +-
     locks/unix/thread_rwlock.c                 |  8 ++++----
     3 files changed, 17 insertions(+), 17 deletions(-)
    
    diff --git a/configure.in b/configure.in
    index 80d98d02449..e860d053f01 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -516,22 +516,22 @@ else
                 dnl Linux is silly as it has pthread_rwlock_init defined
                 dnl but keeps the pthread_rwlock_t structure hidden unless 
                 dnl special things are defined.
    +            AC_CACHE_CHECK([for pthread_rwlock_t], [apr_cv_type_rwlock_t],
                 AC_TRY_COMPILE([#include 
    -#include ], 
    -                [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
    -                 ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no)
    -            if test "$ac_cv_struct_pthread_rw" = "no"; then
    -                AC_TRY_COMPILE([#define _XOPEN_SOURCE 500
    +#include ], [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
    +              [apr_cv_type_rwlock_t=yes],
    +              [AC_TRY_COMPILE([#define _XOPEN_SOURCE 500
     #define _BSD_SOURCE
     #define _SVID_SOURCE
     #include 
    -#include ], 
    -                    [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
    -                    ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no)
    -                if test "$ac_cv_struct_pthread_rw" = "yes"; then
    -                    APR_ADDTO(CPPFLAGS, [-D_XOPEN_SOURCE=500 -D_BSD_SOURCE])
    -                    APR_ADDTO(CPPFLAGS, [-D_SVID_SOURCE])
    -                fi
    +#include ], [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
    +              [apr_cv_type_rwlock_t=yes-with-XOPEN_SOURCE], [apr_cv_type_rwlock_t=no])],
    +              [apr_cv_type_rwlock_t=no]))
    +            case $apr_cv_type_rwlock_t in
    +            yes*) AC_DEFINE(HAVE_PTHREAD_RWLOCKS, 1, [Define if pthread rwlocks are available]) ;;
    +            esac
    +            if test "$apr_cv_type_rwlock_t" = "yes-with-XOPEN_SOURCE"; then
    +               APR_ADDTO(CPPFLAGS, [-D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE])
                 fi
             fi
         fi
    diff --git a/include/arch/unix/apr_arch_thread_rwlock.h b/include/arch/unix/apr_arch_thread_rwlock.h
    index 40ffce1e3a3..ad79c11e32e 100644
    --- a/include/arch/unix/apr_arch_thread_rwlock.h
    +++ b/include/arch/unix/apr_arch_thread_rwlock.h
    @@ -67,7 +67,7 @@
     #endif
     
     #if APR_HAS_THREADS
    -#ifdef HAVE_PTHREAD_RWLOCK_INIT
    +#ifdef HAVE_PTHREAD_RWLOCKS
     
     struct apr_thread_rwlock_t {
         apr_pool_t *pool;
    diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c
    index 55a45e0fdb9..2cc682ebe9c 100644
    --- a/locks/unix/thread_rwlock.c
    +++ b/locks/unix/thread_rwlock.c
    @@ -1,7 +1,7 @@
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    + * Copyright (c) 2000-2004 The Apache Software Foundation.  All rights
      * reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    @@ -57,7 +57,7 @@
     
     #if APR_HAS_THREADS
     
    -#ifdef HAVE_PTHREAD_RWLOCK_INIT
    +#ifdef HAVE_PTHREAD_RWLOCKS
     
     /* The rwlock must be initialized but not locked by any thread when
      * cleanup is called. */
    @@ -175,7 +175,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock)
         return apr_pool_cleanup_run(rwlock->pool, rwlock, thread_rwlock_cleanup);
     }
     
    -#else  /* HAVE_PTHREAD_RWLOCK_INIT */
    +#else  /* HAVE_PTHREAD_RWLOCKS */
     
     APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock,
                                                        apr_pool_t *pool)
    @@ -213,7 +213,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock)
         return APR_ENOTIMPL;
     }
     
    -#endif /* HAVE_PTHREAD_RWLOCK_INIT */
    +#endif /* HAVE_PTHREAD_RWLOCKS */
     APR_POOL_IMPLEMENT_ACCESSOR(thread_rwlock)
     
     #endif /* APR_HAS_THREADS */
    
    From db87bd20909da1c94c59e1f01c364bf16b815f42 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 30 Jan 2004 12:33:46 +0000
    Subject: [PATCH 4815/7878] Return an error instead of silently failing when
     apr_poll() is used with file descriptors >= FD_SETSIZE.  (Unix systems with
     no native poll())
    
    Submitted by:           Jeff Trawick
    Reviewed and fixed by:	Brad Nicholes
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64887 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES          |  4 ++++
     poll/unix/poll.c | 12 ++++++++++++
     2 files changed, 16 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index 155332e82ca..fe3fb7d3218 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -7,6 +7,10 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.]
     
     Changes with APR 1.0
     
    +  *) Return an error instead of silently failing when apr_poll() is
    +     used with file descriptors >= FD_SETSIZE.  (Unix systems with
    +     no native poll())  [Jeff Trawick, Brad Nicholes]
    +
       *) new error status APR_STATUS_IS_ENOTENOUGHENTROPY, Doxygen fixes
          [Sander Temme = FD_SETSIZE) {
    +            /* XXX invent new error code so application has a clue */
    +            return APR_EBADF;
    +        }
    +#endif
             if (aprset[i].reqevents & APR_POLLIN) {
                 FD_SET(fd, &readset);
             }
    @@ -425,6 +431,12 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset,
     #endif
     #endif
         }
    +#if !defined(WIN32) && !defined(NETWARE) /* socket sets handled with array of handles */
    +    if (fd >= FD_SETSIZE) {
    +        /* XXX invent new error code so application has a clue */
    +        return APR_EBADF;
    +    }
    +#endif
         if (descriptor->reqevents & APR_POLLIN) {
             FD_SET(fd, &(pollset->readset));
         }
    
    From ab5c72f60881049cbdd60d4bb32dc0ee9d906c3a Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Sun, 1 Feb 2004 16:42:44 +0000
    Subject: [PATCH 4816/7878] Remove "location detection" from apr-config:
    
    * configure.in: Substitute APR_CONFIG_LOCATION as "build" or "source"
    appropriately.
    
    * apr-config.in: Set location to @APR_CONFIG_LOCATION@ rather than
    fragile pwd/realpath guesswork; pick up and use APR_BUILD_DIR instead
    of $thisdir.
    
    * Makefile.in (apr-config.out): New target.
    (install): Install apr-config.out instead of apr-config.
    
    PR: 8867
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64888 13f79535-47bb-0310-9956-ffa450edef68
    ---
     .cvsignore    |  1 +
     Makefile.in   | 10 +++++++---
     apr-config.in | 45 ++++++++++++---------------------------------
     configure.in  |  5 +++++
     4 files changed, 25 insertions(+), 36 deletions(-)
    
    diff --git a/.cvsignore b/.cvsignore
    index 68a84710f26..22ffbe43b51 100644
    --- a/.cvsignore
    +++ b/.cvsignore
    @@ -6,6 +6,7 @@ config.status
     configure
     libtool
     apr-config
    +apr-config.out
     LibD
     LibR
     Debug
    diff --git a/Makefile.in b/Makefile.in
    index f69845ce146..7f36d2988ab 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -31,7 +31,7 @@ TARGETS = delete-lib $(TARGET_LIB) delete-exports export_vars.h apr.exp
     # bring in rules.mk for standard functionality
     @INCLUDE_RULES@
     
    -CLEAN_TARGETS = 
    +CLEAN_TARGETS = apr-config.out
     DISTCLEAN_TARGETS = config.cache config.log config.status \
     	include/apr.h include/arch/unix/apr_private.h \
     	libtool apr.exp apr-config exports.c export_vars.h
    @@ -60,7 +60,11 @@ delete-lib:
     	    fi \
     	fi
     
    -install: $(TARGET_LIB)
    +# Create apr-config script suitable for the install tree
    +apr-config.out: apr-config
    +	sed 's,^\(location=\).*$$,\1installed,' < apr-config > $@
    +
    +install: $(TARGET_LIB) apr-config.out
     	if [ ! -d $(DESTDIR)$(includedir) ]; then \
     	    $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(includedir); \
     	fi;
    @@ -90,7 +94,7 @@ install: $(TARGET_LIB)
     	if [ ! -d $(DESTDIR)$(bindir) ]; then \
     	    $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(bindir); \
     	fi;
    -	$(LIBTOOL) --mode=install cp apr-config $(DESTDIR)$(bindir)
    +	$(LIBTOOL) --mode=install cp apr-config.out $(DESTDIR)$(bindir)/apr-config
     	chmod 755 $(DESTDIR)$(bindir)/apr-config
     	@if [ $(INSTALL_SUBDIRS) != "none" ]; then \
                 for i in $(INSTALL_SUBDIRS); do \
    diff --git a/apr-config.in b/apr-config.in
    index ae9ed4a5a2c..403c52cfba6 100644
    --- a/apr-config.in
    +++ b/apr-config.in
    @@ -2,7 +2,7 @@
     # ====================================================================
     # The Apache Software License, Version 1.1
     #
    -# Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
    +# Copyright (c) 2001-2004 The Apache Software Foundation.  All rights
     # reserved.
     #
     # Redistribution and use in source and binary forms, with or without
    @@ -76,10 +76,14 @@ LIBS="@EXTRA_LIBS@"
     EXTRA_INCLUDES="@EXTRA_INCLUDES@"
     SHLIBPATH_VAR="@shlibpath_var@"
     APR_SOURCE_DIR="@apr_srcdir@"
    +APR_BUILD_DIR="@apr_builddir@"
     APR_SO_EXT="@so_ext@"
     APR_LIB_TARGET="@export_lib_target@"
     APR_LIBNAME="@APR_LIBNAME@"
     
    +# NOTE: the following line is modified during 'make install': alter with care!
    +location=@APR_CONFIG_LOCATION@
    +
     show_usage()
     {
         cat << EOF
    @@ -123,36 +127,10 @@ if test $# -eq 0; then
         exit 1
     fi
     
    -thisdir="`dirname $0`"
    -thisdir="`cd $thisdir && pwd`"
    -if test -d $bindir; then
    -  tmpbindir="`cd $bindir && pwd`"
    -else
    -  tmpbindir=""
    -fi
    -# If we have the realpath program, use it to resolve symlinks
    -# Otherwise, being in a symlinked dir may result in incorrect output.
    -if test -x "`which realpath 2>/dev/null`"; then
    -  thisdir="`realpath $thisdir`"
    -  if test -d "$APR_SOURCE_DIR"; then
    -    APR_SOURCE_DIR="`realpath $APR_SOURCE_DIR`"
    -  fi
    -  if test -n "$tmpbindir"; then
    -    tmpbindir="`realpath $tmpbindir`"
    -  fi
    -fi
    -if test "$tmpbindir" = "$thisdir"; then
    -  location=installed
    -elif test "$APR_SOURCE_DIR" = "$thisdir"; then
    -  location=source
    -else
    -  location=build
    -fi
    -
     if test "$location" = "installed"; then
         LA_FILE="$libdir/lib${APR_LIBNAME}.la"
     else
    -    LA_FILE="$thisdir/lib${APR_LIBNAME}.la"
    +    LA_FILE="$APR_BUILD_DIR/lib${APR_LIBNAME}.la"
     fi
     
     flags=""
    @@ -184,7 +162,7 @@ while test $# -gt 0; do
             flags="$APR_SOURCE_DIR/include"
         else
             # this is for VPATH builds
    -        flags="$thisdir/include $APR_SOURCE_DIR/include"
    +        flags="$APR_BUILD_DIR/include $APR_SOURCE_DIR/include"
         fi
         echo $flags
         exit 0
    @@ -216,7 +194,7 @@ while test $# -gt 0; do
             flags="$flags -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
         else
             # this is for VPATH builds
    -        flags="$flags -I$thisdir/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
    +        flags="$flags -I$APR_BUILD_DIR/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
         fi
         ;;
         --srcdir)
    @@ -230,7 +208,7 @@ while test $# -gt 0; do
             echo "$APR_SOURCE_DIR/build"
         else
             # this is for VPATH builds
    -        echo "$thisdir/build"
    +        echo "$APR_BUILD_DIR/build"
         fi
         exit 0
         ;;
    @@ -243,7 +221,8 @@ while test $# -gt 0; do
             ### avoid using -L if libdir is a "standard" location like /usr/lib
             flags="$flags -L$libdir -l${APR_LIBNAME}"
         else
    -        flags="$flags -L$thisdir -l${APR_LIBNAME}"
    +        ### this surely can't work since the library is in .libs?
    +        flags="$flags -L$APR_BUILD_DIR -l${APR_LIBNAME}"
         fi
         ;;
         --link-libtool)
    @@ -281,7 +260,7 @@ while test $# -gt 0; do
         if test "$location" = "installed"; then
             echo "${installbuilddir}/libtool"
         else
    -        echo "$thisdir/libtool"
    +        echo "$APR_BUILD_DIR/libtool"
         fi
         exit 0
         ;;
    diff --git a/configure.in b/configure.in
    index e860d053f01..1e537fe72dd 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -47,8 +47,13 @@ AC_SUBST(apr_builddir)
     
     if test "$apr_builddir" != "$apr_srcdir"; then
       USE_VPATH=1
    +  APR_CONFIG_LOCATION=build
    +else
    +  APR_CONFIG_LOCATION=source
     fi
     
    +AC_SUBST(APR_CONFIG_LOCATION)
    +
     # Libtool might need this symbol -- it must point to the location of
     # the generated libtool script (not necessarily the "top" build dir).
     #
    
    From 73d71e76f774b30256ef9a29ae6209d455210262 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Mon, 2 Feb 2004 21:39:11 +0000
    Subject: [PATCH 4817/7878] Move the NetWare memory pool cleanup code outside
     of the APR_POOL_DEBUG #if so that the clean up will happen regardless of the
     debugging mode.
    
    Submitted by: Jean-Jacques Clar [jjclar@novell.com]
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64889 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_pools.c | 41 +++++++++++++++++++++++------------------
     1 file changed, 23 insertions(+), 18 deletions(-)
    
    diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
    index e5e88661192..cc190a900e8 100644
    --- a/memory/unix/apr_pools.c
    +++ b/memory/unix/apr_pools.c
    @@ -596,24 +596,6 @@ APR_DECLARE(void) apr_pool_terminate(void)
         global_allocator = NULL;
     }
     
    -#ifdef NETWARE
    -void netware_pool_proc_cleanup ()
    -{
    -    apr_pool_t *pool = global_pool->child;
    -    apr_os_proc_t owner_proc = (apr_os_proc_t)getnlmhandle();
    -
    -    while (pool) {
    -        if (pool->owner_proc == owner_proc) {
    -            apr_pool_destroy (pool);
    -            pool = global_pool->child;
    -        }
    -        else {
    -            pool = pool->sibling;
    -        }
    -    }
    -    return;
    -}
    -#endif /* defined(NETWARE) */
     
     /* Node list management helper macros; list_insert() inserts 'node'
      * before 'point'. */
    @@ -1566,6 +1548,10 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool,
     #if APR_HAS_THREADS
         pool->owner = apr_os_thread_current();
     #endif /* APR_HAS_THREADS */
    +#ifdef NETWARE
    +    pool->owner_proc = (apr_os_proc_t)getnlmhandle();
    +#endif /* defined(NETWARE) */
    +
     
         if (parent == NULL || parent->allocator != allocator) {
     #if APR_HAS_THREADS
    @@ -1759,6 +1745,25 @@ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag)
     
     #endif /* !APR_POOL_DEBUG */
     
    +#ifdef NETWARE
    +void netware_pool_proc_cleanup ()
    +{
    +    apr_pool_t *pool = global_pool->child;
    +    apr_os_proc_t owner_proc = (apr_os_proc_t)getnlmhandle();
    +
    +    while (pool) {
    +        if (pool->owner_proc == owner_proc) {
    +            apr_pool_destroy (pool);
    +            pool = global_pool->child;
    +        }
    +        else {
    +            pool = pool->sibling;
    +        }
    +    }
    +    return;
    +}
    +#endif /* defined(NETWARE) */
    +
     
     /*
      * "Print" functions (common)
    
    From 4624883b765cb30845ef4d18993ec215dacdaf8e Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Tue, 3 Feb 2004 10:08:20 +0000
    Subject: [PATCH 4818/7878] * Makefile.in: Remove files generated during 'make'
     in the 'clean' target.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64890 13f79535-47bb-0310-9956-ffa450edef68
    ---
     Makefile.in | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/Makefile.in b/Makefile.in
    index 7f36d2988ab..0b55c5e0397 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -31,10 +31,10 @@ TARGETS = delete-lib $(TARGET_LIB) delete-exports export_vars.h apr.exp
     # bring in rules.mk for standard functionality
     @INCLUDE_RULES@
     
    -CLEAN_TARGETS = apr-config.out
    +CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.h
     DISTCLEAN_TARGETS = config.cache config.log config.status \
     	include/apr.h include/arch/unix/apr_private.h \
    -	libtool apr.exp apr-config exports.c export_vars.h
    +	libtool apr-config
     EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in
     
     prefix=@prefix@
    
    From 084f0e5e20738c8384c71ea29057f1ff18ea4bc2 Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Thu, 5 Feb 2004 10:16:25 +0000
    Subject: [PATCH 4819/7878] First whack at switching to a single top-level
     make. This adds a dependency upon Python at packaging time, but not at
     end-user config/build time. As far as I can tell, the build continues to
     function properly. (out-of-dir config/make not tested, and apr-iconv prolly
     needs some work)
    
    The buildconf scripts now generate a build-outputs.mk file which is included
    by the root's Makefile (via the build/gen-build.py script). bulid-outputs.mk
    specifies all of the various files present in the distribution.
    
    The top-level Makefiles were simplified to use an $(OBJECTS) symbol rather
    than 'find'ing them. Similarly, a $(HEADERS) symbol is used for the exports.
    The corresponding delete-* targets were eliminated since we have a precise
    set of inputs.
    
    The subdirs' Makefiles were removed since they are no longer called/used.
    The apr-util/uri Makefile was responsible for compiling a C program to
    generate the uri_delims.h file. That process was replaced by a Python script
    to generate the header (called by buildconf). The .c and .dsp were left for
    the Windows build to continue, but that should be revamped.
    
    build/apr_rules.mk was revamped somewhat to avoid recursion, but a lot of
    cleanup is still needed. Much of the recursive/local/x- logic is no longer
    needed and can be elimianated. rules.mk was created for inclusion by N
    makefiles, but that isn't really true any more, so it could probably be
    tossed (caveat: test/Makefile). Saved for a phase 2.
    
    Some additional work was added to properly clean up files in */build/,
    rather than relying on a makefile in there.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64891 13f79535-47bb-0310-9956-ffa450edef68
    ---
     .cvsignore                  |   1 +
     Makefile.in                 |  55 ++++++--------------
     atomic/os390/Makefile.in    |  14 -----
     atomic/unix/Makefile.in     |  13 -----
     build.conf                  |  33 ++++++++++++
     build/Makefile.in           |  12 -----
     build/apr_rules.mk.in       |  21 +++++---
     build/gen-build.py          | 100 ++++++++++++++++++++++++++++++++++++
     buildconf                   |   3 ++
     configure.in                |  53 +++++--------------
     dso/aix/Makefile.in         |  14 -----
     dso/beos/Makefile.in        |  13 -----
     dso/os2/Makefile.in         |  14 -----
     dso/os390/Makefile.in       |  14 -----
     dso/unix/Makefile.in        |  14 -----
     file_io/os2/Makefile.in     |  31 -----------
     file_io/unix/Makefile.in    |  29 -----------
     locks/beos/Makefile.in      |  16 ------
     locks/os2/Makefile.in       |  18 -------
     locks/unix/Makefile.in      |  19 -------
     memory/unix/Makefile.in     |  13 -----
     misc/unix/Makefile.in       |  16 ------
     mmap/unix/Makefile.in       |  13 -----
     network_io/beos/Makefile.in |  14 -----
     network_io/os2/Makefile.in  |  22 --------
     network_io/unix/Makefile.in |  20 --------
     passwd/Makefile.in          |  13 -----
     poll/os2/Makefile.in        |  17 ------
     poll/unix/Makefile.in       |  16 ------
     random/unix/Makefile.in     |  18 -------
     shmem/beos/Makefile.in      |  14 -----
     shmem/os2/Makefile.in       |  14 -----
     shmem/unix/Makefile.in      |  14 -----
     strings/Makefile.in         |  19 -------
     support/unix/Makefile.in    |  15 ------
     tables/Makefile.in          |  13 -----
     threadproc/beos/Makefile.in |  25 ---------
     threadproc/os2/Makefile.in  |  18 -------
     threadproc/unix/Makefile.in |  18 -------
     time/unix/Makefile.in       |  13 -----
     user/unix/Makefile.in       |  13 -----
     41 files changed, 178 insertions(+), 647 deletions(-)
     delete mode 100644 atomic/os390/Makefile.in
     delete mode 100644 atomic/unix/Makefile.in
     create mode 100644 build.conf
     delete mode 100644 build/Makefile.in
     create mode 100755 build/gen-build.py
     delete mode 100644 dso/aix/Makefile.in
     delete mode 100644 dso/beos/Makefile.in
     delete mode 100644 dso/os2/Makefile.in
     delete mode 100644 dso/os390/Makefile.in
     delete mode 100644 dso/unix/Makefile.in
     delete mode 100644 file_io/os2/Makefile.in
     delete mode 100644 file_io/unix/Makefile.in
     delete mode 100644 locks/beos/Makefile.in
     delete mode 100644 locks/os2/Makefile.in
     delete mode 100644 locks/unix/Makefile.in
     delete mode 100644 memory/unix/Makefile.in
     delete mode 100644 misc/unix/Makefile.in
     delete mode 100644 mmap/unix/Makefile.in
     delete mode 100644 network_io/beos/Makefile.in
     delete mode 100644 network_io/os2/Makefile.in
     delete mode 100644 network_io/unix/Makefile.in
     delete mode 100644 passwd/Makefile.in
     delete mode 100755 poll/os2/Makefile.in
     delete mode 100755 poll/unix/Makefile.in
     delete mode 100644 random/unix/Makefile.in
     delete mode 100644 shmem/beos/Makefile.in
     delete mode 100644 shmem/os2/Makefile.in
     delete mode 100644 shmem/unix/Makefile.in
     delete mode 100644 strings/Makefile.in
     delete mode 100755 support/unix/Makefile.in
     delete mode 100644 tables/Makefile.in
     delete mode 100644 threadproc/beos/Makefile.in
     delete mode 100644 threadproc/os2/Makefile.in
     delete mode 100644 threadproc/unix/Makefile.in
     delete mode 100644 time/unix/Makefile.in
     delete mode 100644 user/unix/Makefile.in
    
    diff --git a/.cvsignore b/.cvsignore
    index 22ffbe43b51..845f11c8ba5 100644
    --- a/.cvsignore
    +++ b/.cvsignore
    @@ -32,3 +32,4 @@ BuildLog.htm
     *.vcproj
     autom4te.cache
     ltcf-c.sh
    +build-outputs.mk
    diff --git a/Makefile.in b/Makefile.in
    index 0b55c5e0397..148402d2118 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -10,14 +10,14 @@ APR_MAJOR_VERSION=@APR_MAJOR_VERSION@
     # Macros for supporting directories
     #
     INCDIR=./include
    -INCDIR1=../include
    -INCLUDES=-I$(INCDIR) -I$(INCDIR1)
    +OSDIR=$(INCDIR)/arch/@OSDIR@
    +DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
     
     #
     # Macros for target determination
     #
    -SUBDIRS=@SUBDIRS@
    -CLEAN_SUBDIRS= . test build
    +CLEAN_SUBDIRS= test
     INSTALL_SUBDIRS=@INSTALL_SUBDIRS@
     
     TARGET_LIB = lib@APR_LIBNAME@.la
    @@ -26,16 +26,18 @@ TARGET_LIB = lib@APR_LIBNAME@.la
     # Rules for building specific targets, starting with 'all' for
     # building the entire package.
     #
    -TARGETS = delete-lib $(TARGET_LIB) delete-exports export_vars.h apr.exp
    +TARGETS = $(TARGET_LIB) export_vars.h apr.exp
     
     # bring in rules.mk for standard functionality
     @INCLUDE_RULES@
    +@INCLUDE_OUTPUTS@
     
     CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.h
     DISTCLEAN_TARGETS = config.cache config.log config.status \
     	include/apr.h include/arch/unix/apr_private.h \
    -	libtool apr-config
    -EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in
    +	libtool apr-config build/apr_rules.mk
    +EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in \
    +	build-outputs.mk build/ltcf-c.sh build/ltmain.sh build/libtool.m4
     
     prefix=@prefix@
     exec_prefix=@exec_prefix@
    @@ -48,17 +50,6 @@ VPATH=@srcdir@
     top_srcdir=@apr_srcdir@
     top_blddir=@apr_builddir@
     
    -EXPORT_FILES = $(top_srcdir)/include/*.h
    -
    -delete-lib:
    -	@if test -f $(TARGET_LIB); then \
    -	    for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \
    -	    if test -n "`find $$objects -newer $(TARGET_LIB)`"; then \
    -		echo Found newer objects. Will relink $(TARGET_LIB). ; \
    -		echo $(RM) -f $(TARGET_LIB) ; \
    -		$(RM) -f $(TARGET_LIB) ; \
    -	    fi \
    -	fi
     
     # Create apr-config script suitable for the install tree
     apr-config.out: apr-config
    @@ -102,27 +93,14 @@ install: $(TARGET_LIB) apr-config.out
     	    done \
     	fi
     
    -$(TARGET_LIB):
    -	@for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \
    -	    tmpcmd="$(LINK) @lib_target@ $(ALL_LIBS)"; \
    -	    echo $$tmpcmd; \
    -	    $$tmpcmd && touch $@
    -
    -delete-exports:
    -	@if test -f apr.exp; then \
    -	    headers="`find include/*.h -newer apr.exp`" ; \
    -	    if test -n "$$headers"; then \
    -		echo Found newer headers. Will rebuild apr.exp. ; \
    -		echo $(RM) -f apr.exp exports.c export_vars.h ; \
    -		$(RM) -f apr.exp exports.c export_vars.h ; \
    -	    fi \
    -	fi
    +$(TARGET_LIB): $(OBJECTS)
    +	$(LINK) @lib_target@ $(ALL_LIBS)
     
    -exports.c:
    -	$(AWK) -f $(top_srcdir)/build/make_exports.awk $(EXPORT_FILES) > $@
    +exports.c: $(HEADERS)
    +	$(AWK) -f $(top_srcdir)/build/make_exports.awk $^ > $@
     
    -export_vars.h:
    -	$(AWK) -f $(top_srcdir)/build/make_var_export.awk $(EXPORT_FILES) > $@
    +export_vars.h: $(HEADERS)
    +	$(AWK) -f $(top_srcdir)/build/make_var_export.awk $^ > $@
     
     apr.exp: exports.c export_vars.h
     	@echo "#! lib@APR_LIBNAME@.so" > $@
    @@ -142,6 +120,3 @@ etags:
     
     # DO NOT REMOVE
     docs: $(INCDIR)/*.h
    -
    -.PHONY: delete-lib delete-exports
    -.NOTPARALLEL: delete-lib delete-exports
    diff --git a/atomic/os390/Makefile.in b/atomic/os390/Makefile.in
    deleted file mode 100644
    index 28cc1b6d8bc..00000000000
    --- a/atomic/os390/Makefile.in
    +++ /dev/null
    @@ -1,14 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = atomic.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/atomic/unix/Makefile.in b/atomic/unix/Makefile.in
    deleted file mode 100644
    index 188d0d242b9..00000000000
    --- a/atomic/unix/Makefile.in
    +++ /dev/null
    @@ -1,13 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = apr_atomic.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCDIR=../../include
    -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/build.conf b/build.conf
    new file mode 100644
    index 00000000000..8d9c8418153
    --- /dev/null
    +++ b/build.conf
    @@ -0,0 +1,33 @@
    +#
    +# Configuration file for APR. Used by APR/build/gen-build.py
    +#
    +
    +[options]
    +
    +paths =
    +  atomic/{platform}/*.c
    +  dso/{platform}/*.c
    +  file_io/{platform}/*.c
    +  locks/{platform}/*.c
    +  memory/{platform}/*.c
    +  misc/{platform}/*.c
    +  mmap/{platform}/*.c
    +  network_io/{platform}/*.c
    +  passwd/*.c
    +  poll/{platform}/*.c
    +  random/{platform}/*.c
    +  shmem/{platform}/*.c
    +  strings/*.c
    +  support/{platform}/*.c
    +  tables/*.c
    +  threadproc/{platform}/*.c
    +  time/{platform}/*.c
    +  user/{platform}/*.c
    +
    +headers = include/*.h
    +
    +# aplibtool is manually built by the configure process
    +# build/aplibtool.c
    +
    +# we have a recursive makefile for the test files (for now)
    +# test/*.c
    diff --git a/build/Makefile.in b/build/Makefile.in
    deleted file mode 100644
    index c05665a195e..00000000000
    --- a/build/Makefile.in
    +++ /dev/null
    @@ -1,12 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS=
    -INCLUDES=
    -DISTCLEAN_TARGETS = apr_rules.mk
    -EXTRACLEAN_TARGETS = ltcf-c.sh ltmain.sh libtool.m4
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -# DO NOT REMOVE
    diff --git a/build/apr_rules.mk.in b/build/apr_rules.mk.in
    index a23738738e0..392efa1411f 100644
    --- a/build/apr_rules.mk.in
    +++ b/build/apr_rules.mk.in
    @@ -140,9 +140,9 @@ install: all-recursive
     
     all-recursive depend-recursive:
     	@otarget=`echo $@ | sed s/-recursive//`; \
    -	list='$(SUBDIRS)'; \
    +	list='$(SOURCE_DIRS)'; \
     	for i in $$list; do \
    -	    if test -d "$$i"; then \
    +	    if test -f "$$i/Makefile"; then \
     		target="$$otarget"; \
     		echo "Making $$target in $$i"; \
     		if test "$$i" = "."; then \
    @@ -161,9 +161,9 @@ all-recursive depend-recursive:
     
     clean-recursive distclean-recursive extraclean-recursive:
     	@otarget=`echo $@ | sed s/-recursive//`; \
    -	list='$(SUBDIRS) $(CLEAN_SUBDIRS)'; \
    +	list='$(CLEAN_SUBDIRS)'; \
     	for i in $$list; do \
    -	    if test -d "$$i"; then \
    +	    if test -f "$$i/Makefile"; then \
     		target="$$otarget"; \
     		echo "Making $$target in $$i"; \
     		if test "$$i" = "."; then \
    @@ -182,10 +182,17 @@ clean-recursive distclean-recursive extraclean-recursive:
     
     # autoconf 2.5x is creating a 'autom4te.cache' directory
     # In case someone ran autoconf by hand, get rid of that directory
    -# aswell.
    +# as well.
     local-clean: x-local-clean
    -	$(RM) -f *.o *.lo *.a *.la *.so *.obj $(CLEAN_TARGETS) $(PROGRAMS)
    -	$(RM) -rf .libs autom4te.cache
    +	@list='. $(SOURCE_DIRS)'; \
    +	for i in $$list; do \
    +	    echo $(RM) -f $$i/*.o $$i/*.lo $$i/*.a $$i/*.la $$i/*.so $$i/*.obj; \
    +	    $(RM) -f $$i/*.o $$i/*.lo $$i/*.a $$i/*.la $$i/*.so $$i/*.obj; \
    +	    echo $(RM) -rf $$i/.libs; \
    +	    $(RM) -rf $$i/.libs; \
    +        done
    +	$(RM) -f $(CLEAN_TARGETS) $(PROGRAMS)
    +	$(RM) -rf autom4te.cache
     
     local-distclean: local-clean x-local-distclean
     	$(RM) -f Makefile $(DISTCLEAN_TARGETS)
    diff --git a/build/gen-build.py b/build/gen-build.py
    new file mode 100755
    index 00000000000..6c6b0747197
    --- /dev/null
    +++ b/build/gen-build.py
    @@ -0,0 +1,100 @@
    +#!/usr/bin/env python
    +#
    +# USAGE: gen-build.py TYPE
    +#
    +# where TYPE is one of: make, dsp, vcproj
    +#
    +# It reads build.conf from the current directory, and produces its output
    +# into the current directory.
    +#
    +
    +
    +import os
    +import ConfigParser
    +import getopt
    +import string
    +import glob
    +import re
    +
    +#import ezt
    +
    +
    +def main():
    +  parser = ConfigParser.ConfigParser()
    +  parser.read('build.conf')
    +
    +  dirs = { }
    +  files = get_files(parser.get('options', 'paths'))
    +  headers = get_files(parser.get('options', 'headers'))
    +
    +  # compute the relevant headers, along with the implied includes
    +  legal_deps = map(os.path.basename, headers)
    +  h_deps = { }
    +  for fname in headers:
    +    h_deps[os.path.basename(fname)] = extract_deps(fname, legal_deps)
    +  resolve_deps(h_deps)
    +
    +  f = open('build-outputs.mk', 'w')
    +  f.write('# DO NOT EDIT. AUTOMATICALLY GENERATED.\n\n')
    +
    +  objects = [ ]
    +  for file in files:
    +    assert file[-2:] == '.c'
    +    obj = file[:-2] + '.lo'
    +    objects.append(obj)
    +
    +    dirs[os.path.dirname(file)] = None
    +
    +    # what headers does this file include, along with the implied headers
    +    deps = extract_deps(file, legal_deps)
    +    for hdr in deps.keys():
    +      deps.update(h_deps.get(hdr, {}))
    +
    +    f.write('%s: %s %s\n' % (obj, file, string.join(deps.keys(), ' ')))
    +
    +  f.write('\nOBJECTS = %s\n\n' % string.join(objects))
    +  f.write('HEADERS = %s\n\n' % string.join(headers))
    +  f.write('SOURCE_DIRS = %s\n\n' % string.join(dirs.keys()))
    +
    +
    +def extract_deps(fname, legal_deps):
    +  "Extract the headers this file includes."
    +  deps = { }
    +  for line in open(fname).readlines():
    +    if line[:8] != '#include':
    +      continue
    +    inc = _re_include.match(line).group(1)
    +    if inc in legal_deps:
    +      deps[inc] = None
    +  return deps
    +_re_include = re.compile('#include *["<](.*)[">]')
    +
    +
    +def resolve_deps(header_deps):
    +  "Alter the provided dictionary to flatten includes-of-includes."
    +  altered = 1
    +  while altered:
    +    altered = 0
    +    for hdr, deps in header_deps.items():
    +      print hdr, deps
    +      start = len(deps)
    +      for dep in deps.keys():
    +        deps.update(header_deps.get(dep, {}))
    +      if len(deps) != start:
    +        altered = 1
    +
    +
    +def get_files(patterns):
    +  patterns = string.replace(patterns, '{platform}', get_platform())
    +  patterns = string.split(string.strip(patterns))
    +  files = [ ]
    +  for pat in patterns:
    +    files.extend(glob.glob(pat))
    +  return files
    +
    +def get_platform():
    +  return 'unix'
    +
    +
    +if __name__ == '__main__':
    +  main()
    diff --git a/buildconf b/buildconf
    index 4555a6e9034..5a260a8711f 100755
    --- a/buildconf
    +++ b/buildconf
    @@ -118,4 +118,7 @@ ${AUTOCONF:-autoconf}
     # Remove autoconf 2.5x's cache directory
     rm -rf autom4te*.cache
     
    +echo "Generating 'make' outputs ..."
    +build/gen-build.py make
    +
     exit 0
    diff --git a/configure.in b/configure.in
    index 1e537fe72dd..f38a6136deb 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -178,15 +178,15 @@ AC_ARG_WITH(libtool, [  --without-libtool       avoid using libtool to link the
       [ use_libtool=$withval ], [ use_libtool="yes" ] )
     
     if test "x$use_libtool" = "xyes"; then
    -      lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -c $< && touch $@'
    +      lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -o $@ -c $< && touch $@'
           LT_VERSION="-version-info `$get_version libtool $version_hdr APR`"
           link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) ${LT_VERSION} \$(ALL_LDFLAGS) -o \$@"
           so_ext='lo'
    -      lib_target='-rpath $(libdir) $$objects'
    -      export_lib_target='-rpath \$(libdir) \$\$objects'
    +      lib_target='-rpath $(libdir) $(OBJECTS)'
    +      export_lib_target='-rpath \$(libdir) \$(OBJECTS)'
     else
    -      lt_compile='$(COMPILE) -c $<'
    -      link='$(AR) cr $(TARGET_LIB) $$objects; $(RANLIB) $(TARGET_LIB)'
    +      lt_compile='$(COMPILE) -o $@ -c $<'
    +      link='$(AR) cr $(TARGET_LIB) $(OBJECTS); $(RANLIB) $(TARGET_LIB)'
           so_ext='o'
           lib_target=''
           export_lib_target=''
    @@ -1873,24 +1873,10 @@ AC_SUBST(EXEEXT)
     AC_SUBST(LIBTOOL_LIBS)
     
     echo "${nl}Construct Makefiles and header files."
    -MAKEFILE1="Makefile strings/Makefile passwd/Makefile tables/Makefile build/Makefile"
    -SUBDIRS="strings passwd tables "
    -for dir in $apr_modules
    -do
    -    test -d $dir || $MKDIR $dir
    -    if test -f $srcdir/$dir/$OSDIR/Makefile.in; then
    -        MAKEFILE2="$MAKEFILE2 $dir/$OSDIR/Makefile "
    -        SUBDIRS="$SUBDIRS $dir/$OSDIR "
    -    else
    -        MAKEFILE2="$MAKEFILE2 $dir/$DEFAULT_OSDIR/Makefile "
    -        SUBDIRS="$SUBDIRS $dir/$DEFAULT_OSDIR "
    -    fi
    -done
    -
    +MAKEFILES="Makefile"
     if test -d $srcdir/test; then
    -    MAKEFILE3="test/Makefile test/internal/Makefile"
    +    MAKEFILES="$MAKEFILES test/Makefile test/internal/Makefile"
     fi
    -AC_SUBST(SUBDIRS)
     
     #
     # BSD/OS (BSDi) needs to use a different include syntax in the Makefiles
    @@ -1900,16 +1886,20 @@ case $host in
         # Check whether they've installed GNU make
         if make --version > /dev/null 2>&1; then 
     	INCLUDE_RULES="include $apr_buildout/apr_rules.mk"
    +	INCLUDE_OUTPUTS="include build-outputs.mk"
         else
     	# BSDi make
     	INCLUDE_RULES=".include \"$apr_buildout/apr_rules.mk\""
    +	INCLUDE_OUTPUTS=".include \"build-outputs.mk\""
         fi
         ;;
     *)
         INCLUDE_RULES="include $apr_buildout/apr_rules.mk"
    +    INCLUDE_OUTPUTS="include build-outputs.mk"
         ;;
     esac
     AC_SUBST(INCLUDE_RULES)
    +AC_SUBST(INCLUDE_OUTPUTS)
     
     SAVE_FILES="include/apr.h include/arch/unix/apr_private.h"
     
    @@ -1921,7 +1911,7 @@ dir=include/arch/unix
     test -d $dir || $MKDIR $dir
     
     AC_OUTPUT([
    -	$MAKEFILE1 $MAKEFILE2 $MAKEFILE3
    +	$MAKEFILES
     	include/apr.h
     	build/apr_rules.mk
     	apr-config
    @@ -1935,22 +1925,3 @@ for i in $SAVE_FILES; do
     done
     chmod +x apr-config
     ])
    -
    -dnl ----------------------------- Fixup Makefiles for VPATH support
    -
    -changequote({,})
    -
    -if test -n "$USE_VPATH"; then
    -  for makefile in $MAKEFILE1 $MAKEFILE2 $MAKEFILE3; do
    -    cat $makefile | \
    -        sed \
    -		-e 's#-I\($(INCDIR[0-9]*)\)#-I\1 -I$(srcdir)/\1#g' \
    -		-e 's#-I\($(OSDIR[0-9]*)\)#-I\1 -I$(srcdir)/\1#g' \
    -		-e 's#-I\($(DEFOSDIR[0-9]*)\)#-I\1 -I$(srcdir)/\1#g' \
    -		> tmp
    -    cp tmp $makefile
    -  done
    -  rm -f tmp
    -fi
    -
    -changequote([,])
    diff --git a/dso/aix/Makefile.in b/dso/aix/Makefile.in
    deleted file mode 100644
    index 7d42bdedfe4..00000000000
    --- a/dso/aix/Makefile.in
    +++ /dev/null
    @@ -1,14 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = dso.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/dso/beos/Makefile.in b/dso/beos/Makefile.in
    deleted file mode 100644
    index 02326f80e84..00000000000
    --- a/dso/beos/Makefile.in
    +++ /dev/null
    @@ -1,13 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = dso.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/dso/os2/Makefile.in b/dso/os2/Makefile.in
    deleted file mode 100644
    index 7d42bdedfe4..00000000000
    --- a/dso/os2/Makefile.in
    +++ /dev/null
    @@ -1,14 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = dso.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/dso/os390/Makefile.in b/dso/os390/Makefile.in
    deleted file mode 100644
    index 7d42bdedfe4..00000000000
    --- a/dso/os390/Makefile.in
    +++ /dev/null
    @@ -1,14 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = dso.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/dso/unix/Makefile.in b/dso/unix/Makefile.in
    deleted file mode 100644
    index 89c6b25b6be..00000000000
    --- a/dso/unix/Makefile.in
    +++ /dev/null
    @@ -1,14 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = dso.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -INCDIR2=$(INCDIR)/arch
    -INCDIR3=$(INCDIR)/arch/unix
    -INCLUDES=-I$(INCDIR) -I$(INCDIR2) -I$(INCDIR3)
    -
    -# DO NOT REMOVE
    diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in
    deleted file mode 100644
    index a87f4242399..00000000000
    --- a/file_io/os2/Makefile.in
    +++ /dev/null
    @@ -1,31 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	dir.lo \
    -	fileacc.lo \
    -	filedup.lo \
    -	filestat.lo \
    -	open.lo \
    -	pipe.lo \
    -	readwrite.lo \
    -	seek.lo \
    -	flock.lo \
    -	maperrorcode.lo \
    -	fullrw.lo \
    -	filepath.lo \
    -	filepath_util.lo \
    -	filesys.lo \
    -	mktemp.lo \
    -	copy.lo \
    -	tempdir.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in
    deleted file mode 100644
    index fbc93b1c775..00000000000
    --- a/file_io/unix/Makefile.in
    +++ /dev/null
    @@ -1,29 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	copy.lo \
    -	dir.lo \
    -	fileacc.lo \
    -	filedup.lo \
    -	filepath.lo \
    -	filepath_util.lo \
    -	filestat.lo \
    -	flock.lo \
    -	fullrw.lo \
    -	open.lo \
    -	pipe.lo \
    -	readwrite.lo \
    -	seek.lo \
    -	mktemp.lo \
    -	tempdir.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/locks/beos/Makefile.in b/locks/beos/Makefile.in
    deleted file mode 100644
    index 6c8a1bccd7c..00000000000
    --- a/locks/beos/Makefile.in
    +++ /dev/null
    @@ -1,16 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	thread_mutex.lo \
    -	thread_rwlock.lo \
    -	thread_cond.lo \
    -	proc_mutex.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch
    -
    -# DO NOT REMOVE
    diff --git a/locks/os2/Makefile.in b/locks/os2/Makefile.in
    deleted file mode 100644
    index e22f85c97be..00000000000
    --- a/locks/os2/Makefile.in
    +++ /dev/null
    @@ -1,18 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	thread_mutex.lo \
    -	thread_rwlock.lo \
    -	thread_cond.lo \
    -	proc_mutex.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/locks/unix/Makefile.in b/locks/unix/Makefile.in
    deleted file mode 100644
    index 618b0eb1ad4..00000000000
    --- a/locks/unix/Makefile.in
    +++ /dev/null
    @@ -1,19 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	thread_mutex.lo \
    -	thread_rwlock.lo \
    -	thread_cond.lo \
    -	proc_mutex.lo \
    -	global_mutex.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -INCDIR2=$(INCDIR)/arch
    -INCDIR3=$(INCDIR)/arch/unix
    -INCLUDES=-I$(INCDIR) -I$(INCDIR2) -I$(INCDIR3)
    -
    -# DO NOT REMOVE
    diff --git a/memory/unix/Makefile.in b/memory/unix/Makefile.in
    deleted file mode 100644
    index 2be5dd9634c..00000000000
    --- a/memory/unix/Makefile.in
    +++ /dev/null
    @@ -1,13 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = apr_pools.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCDIR=../../include
    -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/misc/unix/Makefile.in b/misc/unix/Makefile.in
    deleted file mode 100644
    index fffd81c16b2..00000000000
    --- a/misc/unix/Makefile.in
    +++ /dev/null
    @@ -1,16 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	start.lo getopt.lo otherchild.lo errorcodes.lo rand.lo version.lo \
    -	charset.lo env.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/mmap/unix/Makefile.in b/mmap/unix/Makefile.in
    deleted file mode 100644
    index 11dde0670b0..00000000000
    --- a/mmap/unix/Makefile.in
    +++ /dev/null
    @@ -1,13 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = mmap.lo common.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCDIR=../../include
    -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/network_io/beos/Makefile.in b/network_io/beos/Makefile.in
    deleted file mode 100644
    index b2c93fbbf93..00000000000
    --- a/network_io/beos/Makefile.in
    +++ /dev/null
    @@ -1,14 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = sendrecv.lo socketcommon.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/network_io/os2/Makefile.in b/network_io/os2/Makefile.in
    deleted file mode 100644
    index 04b8e32df0f..00000000000
    --- a/network_io/os2/Makefile.in
    +++ /dev/null
    @@ -1,22 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	sendrecv.lo \
    -	sendrecv_udp.lo \
    -	sockets.lo \
    -	sockopt.lo \
    -	sockaddr.lo \
    -	inet_ntop.lo \
    -	inet_pton.lo \
    -	os2calls.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/network_io/unix/Makefile.in b/network_io/unix/Makefile.in
    deleted file mode 100644
    index 3ea7d03bd45..00000000000
    --- a/network_io/unix/Makefile.in
    +++ /dev/null
    @@ -1,20 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	sendrecv.lo \
    -	sockets.lo \
    -	sockopt.lo \
    -	sockaddr.lo \
    -	inet_ntop.lo \
    -	inet_pton.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/passwd/Makefile.in b/passwd/Makefile.in
    deleted file mode 100644
    index 162d415eab5..00000000000
    --- a/passwd/Makefile.in
    +++ /dev/null
    @@ -1,13 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = apr_getpass.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../include
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/poll/os2/Makefile.in b/poll/os2/Makefile.in
    deleted file mode 100755
    index 96fc006fe4b..00000000000
    --- a/poll/os2/Makefile.in
    +++ /dev/null
    @@ -1,17 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	poll.lo \
    -	pollset.lo \
    -	pollacc.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/poll/unix/Makefile.in b/poll/unix/Makefile.in
    deleted file mode 100755
    index e4594d35b79..00000000000
    --- a/poll/unix/Makefile.in
    +++ /dev/null
    @@ -1,16 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	poll.lo
    -
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/random/unix/Makefile.in b/random/unix/Makefile.in
    deleted file mode 100644
    index de384368b26..00000000000
    --- a/random/unix/Makefile.in
    +++ /dev/null
    @@ -1,18 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	apr_random.lo \
    -	sha2.lo \
    -	sha2_glue.lo
    -
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/shmem/beos/Makefile.in b/shmem/beos/Makefile.in
    deleted file mode 100644
    index 52447d8be14..00000000000
    --- a/shmem/beos/Makefile.in
    +++ /dev/null
    @@ -1,14 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = shm.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/shmem/os2/Makefile.in b/shmem/os2/Makefile.in
    deleted file mode 100644
    index 52447d8be14..00000000000
    --- a/shmem/os2/Makefile.in
    +++ /dev/null
    @@ -1,14 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = shm.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/shmem/unix/Makefile.in b/shmem/unix/Makefile.in
    deleted file mode 100644
    index b155d75b7b3..00000000000
    --- a/shmem/unix/Makefile.in
    +++ /dev/null
    @@ -1,14 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = shm.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -INCDIR2=$(INCDIR)/arch
    -INCDIR3=$(INCDIR)/arch/unix
    -INCLUDES=-I$(INCDIR) -I$(INCDIR2) -I$(INCDIR3)
    -
    -# DO NOT REMOVE
    diff --git a/strings/Makefile.in b/strings/Makefile.in
    deleted file mode 100644
    index aa1e1ee0eb3..00000000000
    --- a/strings/Makefile.in
    +++ /dev/null
    @@ -1,19 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	apr_cpystrn.lo \
    -	apr_snprintf.lo \
    -	apr_strnatcmp.lo \
    -	apr_strings.lo \
    -	apr_fnmatch.lo \
    -	apr_strtok.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCDIR=../include
    -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/support/unix/Makefile.in b/support/unix/Makefile.in
    deleted file mode 100755
    index 190cacfc291..00000000000
    --- a/support/unix/Makefile.in
    +++ /dev/null
    @@ -1,15 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	waitio.lo 
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/tables/Makefile.in b/tables/Makefile.in
    deleted file mode 100644
    index 9a97a30f19a..00000000000
    --- a/tables/Makefile.in
    +++ /dev/null
    @@ -1,13 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = apr_tables.lo apr_hash.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCDIR=../include
    -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/threadproc/beos/Makefile.in b/threadproc/beos/Makefile.in
    deleted file mode 100644
    index 3bdf1dd5316..00000000000
    --- a/threadproc/beos/Makefile.in
    +++ /dev/null
    @@ -1,25 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	proc.lo \
    -	thread.lo \
    -	threadpriv.lo \
    -	threadproc_common.lo \
    -        apr_proc_stub
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch -I$(OSDIR) -I$(DEFOSDIR)
    -
    -CLEAN_TARGETS = apr_proc_stub /boot/home/config/bin/apr_proc_stub
    -
    -apr_proc_stub:
    -	$(CC) apr_proc_stub.c \
    -	&& cp apr_proc_stub /boot/home/config/bin
    -
    -# DO NOT REMOVE
    diff --git a/threadproc/os2/Makefile.in b/threadproc/os2/Makefile.in
    deleted file mode 100644
    index 3cc12ad7438..00000000000
    --- a/threadproc/os2/Makefile.in
    +++ /dev/null
    @@ -1,18 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	proc.lo \
    -	thread.lo \
    -	threadpriv.lo \
    -	signals.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/threadproc/unix/Makefile.in b/threadproc/unix/Makefile.in
    deleted file mode 100644
    index 42aa6d1b616..00000000000
    --- a/threadproc/unix/Makefile.in
    +++ /dev/null
    @@ -1,18 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = \
    -	proc.lo \
    -	procsup.lo \
    -	thread.lo \
    -	threadpriv.lo \
    -	signals.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/time/unix/Makefile.in b/time/unix/Makefile.in
    deleted file mode 100644
    index 1cc010b5dbf..00000000000
    --- a/time/unix/Makefile.in
    +++ /dev/null
    @@ -1,13 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = time.lo timestr.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCDIR=../../include
    -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    diff --git a/user/unix/Makefile.in b/user/unix/Makefile.in
    deleted file mode 100644
    index 100498f5f09..00000000000
    --- a/user/unix/Makefile.in
    +++ /dev/null
    @@ -1,13 +0,0 @@
    -srcdir = @srcdir@
    -VPATH = @srcdir@
    -
    -TARGETS = userinfo.lo groupinfo.lo
    -
    -# bring in rules.mk for standard functionality
    -@INCLUDE_RULES@
    -
    -INCDIR=../../include
    -DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(DEFOSDIR)
    -
    -# DO NOT REMOVE
    
    From bb708c6295f075421810e535dccaaf46aca5ba31 Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Thu, 5 Feb 2004 10:17:31 +0000
    Subject: [PATCH 4820/7878] record recent changes for a single top-level make
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64892 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index fe3fb7d3218..5c73b31f1e1 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -7,6 +7,8 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.]
     
     Changes with APR 1.0
     
    +  *) Switch to a single, top-level make. [Greg Stein]
    +
       *) Return an error instead of silently failing when apr_poll() is
          used with file descriptors >= FD_SETSIZE.  (Unix systems with
          no native poll())  [Jeff Trawick, Brad Nicholes]
    
    From 29b0527d6daac60c90ef9672eedea19428d1151e Mon Sep 17 00:00:00 2001
    From: Martin Kraemer 
    Date: Thu, 5 Feb 2004 10:24:17 +0000
    Subject: [PATCH 4821/7878] The APR_EGENERAL error is used inside Apache for
     returning internal error situations. However, when it was actually translated
     into a string, it read "Error string not specified yet". Add a string
     "Internal error" (and use "Error string not specified yet" for other
     (unspecified) APR errors).
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64893 13f79535-47bb-0310-9956-ffa450edef68
    ---
     misc/unix/errorcodes.c | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c
    index 77739065f0d..701a1510d8a 100644
    --- a/misc/unix/errorcodes.c
    +++ b/misc/unix/errorcodes.c
    @@ -168,6 +168,8 @@ static char *apr_error_string(apr_status_t statcode)
             return "The given path contained wildcard characters";
         case APR_EPROC_UNKNOWN:
             return "The process is not recognized.";
    +    case APR_EGENERAL:
    +        return "Internal error";
         default:
             return "Error string not specified yet";
         }
    
    From d27adcf1f23e65c59fca1dce2f8cfbbdba0a48d7 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Thu, 5 Feb 2004 11:10:39 +0000
    Subject: [PATCH 4822/7878] VPATH build fixes:
    
    * configure.in: Point at build-outputs.mk in the srcdir.
    
    * Makefile.in: Define top_srcdir and top_blddir etc higher; include
    $srcdir/arch/@OSDIR@ and $srcdir/include.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64894 13f79535-47bb-0310-9956-ffa450edef68
    ---
     Makefile.in  | 15 ++++++++-------
     configure.in |  6 +++---
     2 files changed, 11 insertions(+), 10 deletions(-)
    
    diff --git a/Makefile.in b/Makefile.in
    index 148402d2118..6c92393f162 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -1,3 +1,9 @@
    +
    +srcdir=@srcdir@
    +VPATH=@srcdir@
    +top_srcdir=@apr_srcdir@
    +top_blddir=@apr_builddir@
    +
     #
     # APR (Apache Portable Runtime) library Makefile.
     #
    @@ -10,9 +16,9 @@ APR_MAJOR_VERSION=@APR_MAJOR_VERSION@
     # Macros for supporting directories
     #
     INCDIR=./include
    -OSDIR=$(INCDIR)/arch/@OSDIR@
    +OSDIR=$(top_srcdir)/include/arch/@OSDIR@
     DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
    -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
    +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include
     
     #
     # Macros for target determination
    @@ -45,11 +51,6 @@ bindir=@bindir@
     libdir=@libdir@
     includedir=@includedir@
     installbuilddir=@installbuilddir@
    -srcdir=@srcdir@
    -VPATH=@srcdir@
    -top_srcdir=@apr_srcdir@
    -top_blddir=@apr_builddir@
    -
     
     # Create apr-config script suitable for the install tree
     apr-config.out: apr-config
    diff --git a/configure.in b/configure.in
    index f38a6136deb..d05d64710df 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -1886,16 +1886,16 @@ case $host in
         # Check whether they've installed GNU make
         if make --version > /dev/null 2>&1; then 
     	INCLUDE_RULES="include $apr_buildout/apr_rules.mk"
    -	INCLUDE_OUTPUTS="include build-outputs.mk"
    +	INCLUDE_OUTPUTS="include $apr_srcdir/build-outputs.mk"
         else
     	# BSDi make
     	INCLUDE_RULES=".include \"$apr_buildout/apr_rules.mk\""
    -	INCLUDE_OUTPUTS=".include \"build-outputs.mk\""
    +	INCLUDE_OUTPUTS=".include \"$apr_srcdir/build-outputs.mk\""
         fi
         ;;
     *)
         INCLUDE_RULES="include $apr_buildout/apr_rules.mk"
    -    INCLUDE_OUTPUTS="include build-outputs.mk"
    +    INCLUDE_OUTPUTS="include $apr_srcdir/build-outputs.mk"
         ;;
     esac
     AC_SUBST(INCLUDE_RULES)
    
    From bc9465313a9659b7b81f1f4d3476354e45053a59 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Thu, 5 Feb 2004 11:21:50 +0000
    Subject: [PATCH 4823/7878] * Makefile.in: Use portable make syntax.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64895 13f79535-47bb-0310-9956-ffa450edef68
    ---
     Makefile.in | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/Makefile.in b/Makefile.in
    index 6c92393f162..12944caed37 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -98,10 +98,10 @@ $(TARGET_LIB): $(OBJECTS)
     	$(LINK) @lib_target@ $(ALL_LIBS)
     
     exports.c: $(HEADERS)
    -	$(AWK) -f $(top_srcdir)/build/make_exports.awk $^ > $@
    +	$(AWK) -f $(top_srcdir)/build/make_exports.awk $(HEADERS) > $@
     
     export_vars.h: $(HEADERS)
    -	$(AWK) -f $(top_srcdir)/build/make_var_export.awk $^ > $@
    +	$(AWK) -f $(top_srcdir)/build/make_var_export.awk $(HEADERS) > $@
     
     apr.exp: exports.c export_vars.h
     	@echo "#! lib@APR_LIBNAME@.so" > $@
    
    From 0485011e6e9e9616e3e707326fe4e7b9b9f90914 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 5 Feb 2004 14:12:17 +0000
    Subject: [PATCH 4824/7878] gotta have python to build APR
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64896 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/buildcheck.sh | 11 +++++++++++
     1 file changed, 11 insertions(+)
    
    diff --git a/build/buildcheck.sh b/build/buildcheck.sh
    index 5670c0f6af7..0f56d9af077 100755
    --- a/build/buildcheck.sh
    +++ b/build/buildcheck.sh
    @@ -2,6 +2,17 @@
     
     echo "buildconf: checking installation..."
     
    +# any python
    +py_version=`python -V 2>&1|sed -e 's/^[^0-9]*//'`
    +if test -z "$py_version"; then
    +echo "buildconf: python not found."
    +echo "           You need python installed"
    +echo "           to build APR from CVS."
    +exit 1
    +else
    +echo "buildconf: python version $py_version (ok)"
    +fi
    +
     # autoconf 2.13 or newer
     ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;q'`
     if test -z "$ac_version"; then
    
    From da15b32602459b7e11119d04da41e46b2520dc1c Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 5 Feb 2004 14:19:16 +0000
    Subject: [PATCH 4825/7878] fix the python detection; python -V isn't cool for
     detecting presence since that writes to stderr, same place as a "not found"
     message from the shell
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64897 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/buildcheck.sh | 5 +++--
     1 file changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/build/buildcheck.sh b/build/buildcheck.sh
    index 0f56d9af077..d2d6625c52f 100755
    --- a/build/buildcheck.sh
    +++ b/build/buildcheck.sh
    @@ -3,13 +3,14 @@
     echo "buildconf: checking installation..."
     
     # any python
    -py_version=`python -V 2>&1|sed -e 's/^[^0-9]*//'`
    -if test -z "$py_version"; then
    +python=`build/PrintPath python`
    +if test -z "$python"; then
     echo "buildconf: python not found."
     echo "           You need python installed"
     echo "           to build APR from CVS."
     exit 1
     else
    +py_version=`python -V 2>&1|sed -e 's/^[^0-9]*//'`
     echo "buildconf: python version $py_version (ok)"
     fi
     
    
    From f8749068d18ecfeda98bcf9f97429bae905d1d68 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Thu, 5 Feb 2004 19:57:37 +0000
    Subject: [PATCH 4826/7878] * build/gen-build.py: Fix paths to headers in
     dependencies; fix HEADERS to work for a VPATH build.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64898 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/gen-build.py | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/build/gen-build.py b/build/gen-build.py
    index 6c6b0747197..635586a8c93 100755
    --- a/build/gen-build.py
    +++ b/build/gen-build.py
    @@ -50,10 +50,10 @@ def main():
         for hdr in deps.keys():
           deps.update(h_deps.get(hdr, {}))
     
    -    f.write('%s: %s %s\n' % (obj, file, string.join(deps.keys(), ' ')))
    +    f.write('%s: %s include/%s\n' % (obj, file, string.join(deps.keys(), ' include/')))
     
       f.write('\nOBJECTS = %s\n\n' % string.join(objects))
    -  f.write('HEADERS = %s\n\n' % string.join(headers))
    +  f.write('HEADERS = $(top_srcdir)/%s\n\n' % string.join(headers, ' $(top_srcdir)/'))
       f.write('SOURCE_DIRS = %s\n\n' % string.join(dirs.keys()))
     
     
    
    From c78c05778f240d37b67d9227fc8f2703af05ccea Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Thu, 5 Feb 2004 21:18:04 +0000
    Subject: [PATCH 4827/7878] * build/apr_common.m4 (APR_CONFIG_NICE): Preserve
     LTFLAGS setting.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64899 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_common.m4 | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/build/apr_common.m4 b/build/apr_common.m4
    index 14382471997..4b3294a717f 100644
    --- a/build/apr_common.m4
    +++ b/build/apr_common.m4
    @@ -26,6 +26,9 @@ EOF
       if test -n "$LDFLAGS"; then
         echo "LDFLAGS=\"$LDFLAGS\"; export LDFLAGS" >> $1
       fi
    +  if test -n "$LTFLAGS"; then
    +    echo "LTFLAGS=\"$LTFLAGS\"; export LTFLAGS" >> $1
    +  fi
       if test -n "$LIBS"; then
         echo "LIBS=\"$LIBS\"; export LIBS" >> $1
       fi
    
    From 6068e5c90ef4683489ba784cf14add221c5f82c5 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Fri, 6 Feb 2004 22:57:47 +0000
    Subject: [PATCH 4828/7878] * test/Makefile.in (CLEAN_SUBDIRS): Clean in the
     'internal' directory.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64900 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index 5c5c21175c9..e2462ff1ef6 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -38,6 +38,7 @@ LOCAL_LIBS=../lib@APR_LIBNAME@.la
     
     CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \
     readchild@EXEEXT@
    +CLEAN_SUBDIRS = internal
     
     INCDIR=../include
     INCLUDES=-I$(INCDIR)
    
    From c923a6ccdeb1b4e7fa7515441bc06ef80fc9fa23 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Sat, 7 Feb 2004 00:07:31 +0000
    Subject: [PATCH 4829/7878] * build/gen-build.py: Turn off the debugging output
     now too.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64901 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/gen-build.py | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/build/gen-build.py b/build/gen-build.py
    index 635586a8c93..24db04cbc1a 100755
    --- a/build/gen-build.py
    +++ b/build/gen-build.py
    @@ -76,7 +76,7 @@ def resolve_deps(header_deps):
       while altered:
         altered = 0
         for hdr, deps in header_deps.items():
    -      print hdr, deps
    +      # print hdr, deps
           start = len(deps)
           for dep in deps.keys():
             deps.update(header_deps.get(dep, {}))
    
    From d40c6326fc0e6fa9ab07c4780d8aa814db30b98d Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Sat, 7 Feb 2004 10:48:25 +0000
    Subject: [PATCH 4830/7878] * build/gen-build.py: Allow the Makefile to specify
     extra SOURCE_DIRS which can be determined by configure.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64902 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/gen-build.py | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/build/gen-build.py b/build/gen-build.py
    index 24db04cbc1a..1865585f596 100755
    --- a/build/gen-build.py
    +++ b/build/gen-build.py
    @@ -54,7 +54,7 @@ def main():
     
       f.write('\nOBJECTS = %s\n\n' % string.join(objects))
       f.write('HEADERS = $(top_srcdir)/%s\n\n' % string.join(headers, ' $(top_srcdir)/'))
    -  f.write('SOURCE_DIRS = %s\n\n' % string.join(dirs.keys()))
    +  f.write('SOURCE_DIRS = %s $(EXTRA_SOURCE_DIRS)\n\n' % string.join(dirs.keys()))
     
     
     def extract_deps(fname, legal_deps):
    
    From 8091babd5c76bd585c22cd592a480eec51437c9a Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Fri, 13 Feb 2004 09:38:38 +0000
    Subject: [PATCH 4831/7878] Relicense APR under Apache License, Version 2.0
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64904 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                                       |   4 +
     LICENSE                                       | 430 +++++++++++-------
     NOTICE                                        |   9 +
     atomic/netware/apr_atomic.c                   |  59 +--
     atomic/os390/atomic.c                         |  59 +--
     atomic/unix/apr_atomic.c                      |  59 +--
     build/aplibtool.c                             |  59 +--
     dso/aix/dso.c                                 |  59 +--
     dso/beos/dso.c                                |  59 +--
     dso/netware/dso.c                             |  59 +--
     dso/os2/dso.c                                 |  59 +--
     dso/os390/dso.c                               |  59 +--
     dso/unix/dso.c                                |  59 +--
     dso/win32/dso.c                               |  59 +--
     file_io/netware/filestat.c                    |  59 +--
     file_io/netware/filesys.c                     |  59 +--
     file_io/netware/flock.c                       |  59 +--
     file_io/netware/pipe.c                        |  59 +--
     file_io/os2/dir.c                             |  59 +--
     file_io/os2/fileacc.c                         |  59 +--
     file_io/os2/filedup.c                         |  59 +--
     file_io/os2/filepath.c                        |  15 +-
     file_io/os2/filestat.c                        |  59 +--
     file_io/os2/filesys.c                         |  59 +--
     file_io/os2/flock.c                           |  59 +--
     file_io/os2/maperrorcode.c                    |  59 +--
     file_io/os2/open.c                            |  59 +--
     file_io/os2/pipe.c                            |  59 +--
     file_io/os2/readwrite.c                       |  59 +--
     file_io/os2/seek.c                            |  59 +--
     file_io/unix/copy.c                           |  59 +--
     file_io/unix/dir.c                            |  59 +--
     file_io/unix/fileacc.c                        |  59 +--
     file_io/unix/filedup.c                        |  59 +--
     file_io/unix/filepath.c                       |  59 +--
     file_io/unix/filepath_util.c                  |  59 +--
     file_io/unix/filestat.c                       |  59 +--
     file_io/unix/flock.c                          |  59 +--
     file_io/unix/fullrw.c                         |  59 +--
     file_io/unix/mktemp.c                         |  59 +--
     file_io/unix/open.c                           |  59 +--
     file_io/unix/pipe.c                           |  59 +--
     file_io/unix/readwrite.c                      |  59 +--
     file_io/unix/seek.c                           |  59 +--
     file_io/unix/tempdir.c                        |  59 +--
     file_io/win32/dir.c                           |  59 +--
     file_io/win32/filedup.c                       |  59 +--
     file_io/win32/filepath.c                      |  59 +--
     file_io/win32/filestat.c                      |  59 +--
     file_io/win32/filesys.c                       |  59 +--
     file_io/win32/flock.c                         |  59 +--
     file_io/win32/open.c                          |  59 +--
     file_io/win32/pipe.c                          |  59 +--
     file_io/win32/readwrite.c                     |  59 +--
     file_io/win32/seek.c                          |  59 +--
     include/apr_allocator.h                       |  59 +--
     include/apr_atomic.h                          |  63 +--
     include/apr_dso.h                             |  59 +--
     include/apr_env.h                             |  59 +--
     include/apr_errno.h                           |  59 +--
     include/apr_file_info.h                       |  59 +--
     include/apr_file_io.h                         |  59 +--
     include/apr_general.h                         |  59 +--
     include/apr_getopt.h                          |  59 +--
     include/apr_global_mutex.h                    |  59 +--
     include/apr_hash.h                            |  63 +--
     include/apr_inherit.h                         |  59 +--
     include/apr_lib.h                             |  59 +--
     include/apr_mmap.h                            |  59 +--
     include/apr_network_io.h                      |  59 +--
     include/apr_poll.h                            |  59 +--
     include/apr_pools.h                           |  59 +--
     include/apr_portable.h                        |  59 +--
     include/apr_proc_mutex.h                      |  59 +--
     include/apr_ring.h                            |  59 +--
     include/apr_shm.h                             |  59 +--
     include/apr_signal.h                          |  59 +--
     include/apr_strings.h                         |  59 +--
     include/apr_support.h                         |  59 +--
     include/apr_tables.h                          |  59 +--
     include/apr_thread_cond.h                     |  59 +--
     include/apr_thread_mutex.h                    |  59 +--
     include/apr_thread_proc.h                     |  59 +--
     include/apr_thread_rwlock.h                   |  59 +--
     include/apr_time.h                            |  59 +--
     include/apr_user.h                            |  59 +--
     include/apr_version.h                         |  59 +--
     include/apr_want.h                            |  59 +--
     include/arch/aix/apr_arch_dso.h               |  59 +--
     include/arch/apr_private_common.h             |  59 +--
     include/arch/beos/apr_arch_dso.h              |  59 +--
     include/arch/beos/apr_arch_proc_mutex.h       |  59 +--
     include/arch/beos/apr_arch_thread_cond.h      |  59 +--
     include/arch/beos/apr_arch_thread_mutex.h     |  59 +--
     include/arch/beos/apr_arch_thread_rwlock.h    |  59 +--
     include/arch/beos/apr_arch_threadproc.h       |  59 +--
     include/arch/netware/apr_arch_dso.h           |  59 +--
     include/arch/netware/apr_arch_file_io.h       |  59 +--
     include/arch/netware/apr_arch_global_mutex.h  |  59 +--
     include/arch/netware/apr_arch_internal_time.h |  59 +--
     include/arch/netware/apr_arch_networkio.h     |  59 +--
     include/arch/netware/apr_arch_pre_nw.h        |  19 +-
     include/arch/netware/apr_arch_proc_mutex.h    |  59 +--
     include/arch/netware/apr_arch_thread_cond.h   |  59 +--
     include/arch/netware/apr_arch_thread_mutex.h  |  59 +--
     include/arch/netware/apr_arch_thread_rwlock.h |  59 +--
     include/arch/netware/apr_arch_threadproc.h    |  59 +--
     include/arch/netware/apr_private.h            |  59 +--
     include/arch/os2/apr_arch_dso.h               |  59 +--
     include/arch/os2/apr_arch_file_io.h           |  59 +--
     include/arch/os2/apr_arch_networkio.h         |  59 +--
     include/arch/os2/apr_arch_os2calls.h          |  59 +--
     include/arch/os2/apr_arch_proc_mutex.h        |  59 +--
     include/arch/os2/apr_arch_thread_cond.h       |  59 +--
     include/arch/os2/apr_arch_thread_mutex.h      |  59 +--
     include/arch/os2/apr_arch_thread_rwlock.h     |  59 +--
     include/arch/os2/apr_arch_threadproc.h        |  59 +--
     include/arch/os390/apr_arch_dso.h             |  59 +--
     include/arch/unix/apr_arch_dso.h              |  59 +--
     include/arch/unix/apr_arch_file_io.h          |  59 +--
     include/arch/unix/apr_arch_global_mutex.h     |  59 +--
     include/arch/unix/apr_arch_inherit.h          |  59 +--
     include/arch/unix/apr_arch_internal_time.h    |  59 +--
     include/arch/unix/apr_arch_misc.h             |  59 +--
     include/arch/unix/apr_arch_networkio.h        |  59 +--
     include/arch/unix/apr_arch_proc_mutex.h       |  59 +--
     include/arch/unix/apr_arch_shm.h              |  59 +--
     include/arch/unix/apr_arch_thread_cond.h      |  59 +--
     include/arch/unix/apr_arch_thread_mutex.h     |  59 +--
     include/arch/unix/apr_arch_thread_rwlock.h    |  59 +--
     include/arch/unix/apr_arch_threadproc.h       |  59 +--
     include/arch/win32/apr_arch_atime.h           |  59 +--
     include/arch/win32/apr_arch_dso.h             |  59 +--
     include/arch/win32/apr_arch_file_io.h         |  59 +--
     include/arch/win32/apr_arch_inherit.h         |  59 +--
     include/arch/win32/apr_arch_misc.h            |  59 +--
     include/arch/win32/apr_arch_networkio.h       |  59 +--
     include/arch/win32/apr_arch_proc_mutex.h      |  59 +--
     include/arch/win32/apr_arch_thread_cond.h     |  59 +--
     include/arch/win32/apr_arch_thread_mutex.h    |  59 +--
     include/arch/win32/apr_arch_thread_rwlock.h   |  59 +--
     include/arch/win32/apr_arch_threadproc.h      |  59 +--
     include/arch/win32/apr_arch_utf8.h            |  59 +--
     include/arch/win32/apr_dbg_win32_handles.h    |  59 +--
     include/arch/win32/apr_private.h              |  59 +--
     locks/beos/proc_mutex.c                       |  59 +--
     locks/beos/thread_cond.c                      |  59 +--
     locks/beos/thread_mutex.c                     |  59 +--
     locks/beos/thread_rwlock.c                    |  59 +--
     locks/netware/proc_mutex.c                    |  59 +--
     locks/netware/thread_cond.c                   |  59 +--
     locks/netware/thread_mutex.c                  |  59 +--
     locks/netware/thread_rwlock.c                 |  59 +--
     locks/os2/proc_mutex.c                        |  59 +--
     locks/os2/thread_cond.c                       |  59 +--
     locks/os2/thread_mutex.c                      |  59 +--
     locks/os2/thread_rwlock.c                     |  59 +--
     locks/unix/global_mutex.c                     |  59 +--
     locks/unix/proc_mutex.c                       |  59 +--
     locks/unix/thread_cond.c                      |  59 +--
     locks/unix/thread_mutex.c                     |  59 +--
     locks/unix/thread_rwlock.c                    |  59 +--
     locks/win32/proc_mutex.c                      |  59 +--
     locks/win32/thread_cond.c                     |  59 +--
     locks/win32/thread_mutex.c                    |  59 +--
     locks/win32/thread_rwlock.c                   |  59 +--
     memory/unix/apr_pools.c                       |  59 +--
     misc/netware/charset.c                        |  59 +--
     misc/netware/libprews.c                       |  24 +-
     misc/netware/rand.c                           |  59 +--
     misc/netware/start.c                          |  59 +--
     misc/os2/randbyte.c                           |  59 +--
     misc/unix/charset.c                           |  59 +--
     misc/unix/env.c                               |  59 +--
     misc/unix/errorcodes.c                        |  59 +--
     misc/unix/otherchild.c                        |  59 +--
     misc/unix/rand.c                              |  59 +--
     misc/unix/start.c                             |  59 +--
     misc/unix/version.c                           |  59 +--
     misc/win32/apr_app.c                          |  59 +--
     misc/win32/charset.c                          |  59 +--
     misc/win32/env.c                              |  59 +--
     misc/win32/internal.c                         |  59 +--
     misc/win32/misc.c                             |  59 +--
     misc/win32/rand.c                             |  59 +--
     misc/win32/start.c                            |  59 +--
     misc/win32/utf8.c                             |  59 +--
     mmap/unix/common.c                            |  59 +--
     mmap/unix/mmap.c                              |  59 +--
     mmap/win32/mmap.c                             |  59 +--
     network_io/beos/sendrecv.c                    |  59 +--
     network_io/os2/os2calls.c                     |  59 +--
     network_io/os2/sendrecv.c                     |  59 +--
     network_io/os2/sendrecv_udp.c                 |  59 +--
     network_io/os2/sockets.c                      |  59 +--
     network_io/os2/sockopt.c                      |  59 +--
     network_io/unix/sendrecv.c                    |  59 +--
     network_io/unix/sockaddr.c                    |  59 +--
     network_io/unix/sockets.c                     |  59 +--
     network_io/unix/sockopt.c                     |  59 +--
     network_io/win32/sendrecv.c                   |  59 +--
     network_io/win32/sockets.c                    |  59 +--
     network_io/win32/sockopt.c                    |  59 +--
     passwd/apr_getpass.c                          |  59 +--
     poll/os2/poll.c                               |  59 +--
     poll/os2/pollset.c                            |  59 +--
     poll/unix/poll.c                              |  59 +--
     shmem/beos/shm.c                              |  59 +--
     shmem/os2/shm.c                               |  59 +--
     shmem/unix/shm.c                              |  59 +--
     shmem/win32/shm.c                             |  59 +--
     strings/apr_cpystrn.c                         |  59 +--
     strings/apr_snprintf.c                        |  63 +--
     strings/apr_strings.c                         |  62 +--
     strings/apr_strtok.c                          |  59 +--
     support/unix/waitio.c                         |  59 +--
     tables/apr_hash.c                             |  63 +--
     tables/apr_tables.c                           |  59 +--
     test/aprtest.h                                |  59 +--
     test/client.c                                 |  59 +--
     test/internal/testregex.c                     |  59 +--
     test/internal/testucs.c                       |  59 +--
     test/mod_test.c                               |  59 +--
     test/readchild.c                              |  59 +--
     test/sendfile.c                               |  59 +--
     test/server.c                                 |  59 +--
     test/test_apr.h                               |  59 +--
     test/testall.c                                |  59 +--
     test/testargs.c                               |  59 +--
     test/testatomic.c                             |  59 +--
     test/testdir.c                                |  59 +--
     test/testdso.c                                |  59 +--
     test/testdup.c                                |  59 +--
     test/testenv.c                                |  59 +--
     test/testfile.c                               |  59 +--
     test/testfileinfo.c                           |  59 +--
     test/testflock.c                              |  59 +--
     test/testfmt.c                                |  59 +--
     test/testglobalmutex.c                        |  59 +--
     test/testhash.c                               |  59 +--
     test/testipsub.c                              |  59 +--
     test/testlock.c                               |  59 +--
     test/testlockperf.c                           |  59 +--
     test/testmmap.c                               |  59 +--
     test/testmutexscope.c                         |  59 +--
     test/testnames.c                              |  59 +--
     test/testoc.c                                 |  59 +--
     test/testpath.c                               |  59 +--
     test/testpipe.c                               |  59 +--
     test/testpoll.c                               |  59 +--
     test/testpools.c                              |  59 +--
     test/testproc.c                               |  59 +--
     test/testprocmutex.c                          |  59 +--
     test/testrand.c                               |  59 +--
     test/testshm.c                                |  59 +--
     test/testshmconsumer.c                        |  59 +--
     test/testshmproducer.c                        |  59 +--
     test/testsleep.c                              |  59 +--
     test/testsock.c                               |  59 +--
     test/testsockets.c                            |  59 +--
     test/testsockopt.c                            |  59 +--
     test/teststr.c                                |  59 +--
     test/testtable.c                              |  59 +--
     test/testthread.c                             |  59 +--
     test/testtime.c                               |  59 +--
     test/testud.c                                 |  59 +--
     test/testuser.c                               |  59 +--
     test/testvsn.c                                |  59 +--
     threadproc/beos/apr_proc_stub.c               |  59 +--
     threadproc/beos/proc.c                        |  59 +--
     threadproc/beos/thread.c                      |  59 +--
     threadproc/beos/threadpriv.c                  |  59 +--
     threadproc/beos/threadproc_common.c           |  59 +--
     threadproc/netware/proc.c                     |  59 +--
     threadproc/netware/procsup.c                  |  59 +--
     threadproc/netware/signals.c                  |  59 +--
     threadproc/netware/thread.c                   |  59 +--
     threadproc/netware/threadpriv.c               |  59 +--
     threadproc/os2/proc.c                         |  59 +--
     threadproc/os2/thread.c                       |  59 +--
     threadproc/os2/threadpriv.c                   |  59 +--
     threadproc/unix/proc.c                        |  59 +--
     threadproc/unix/procsup.c                     |  59 +--
     threadproc/unix/signals.c                     |  59 +--
     threadproc/unix/thread.c                      |  59 +--
     threadproc/unix/threadpriv.c                  |  59 +--
     threadproc/win32/proc.c                       |  59 +--
     threadproc/win32/signals.c                    |  59 +--
     threadproc/win32/thread.c                     |  59 +--
     threadproc/win32/threadpriv.c                 |  59 +--
     time/unix/time.c                              |  59 +--
     time/unix/timestr.c                           |  59 +--
     time/win32/access.c                           |  59 +--
     time/win32/time.c                             |  59 +--
     time/win32/timestr.c                          |  59 +--
     user/netware/groupinfo.c                      |  59 +--
     user/netware/userinfo.c                       |  59 +--
     user/unix/groupinfo.c                         |  59 +--
     user/unix/userinfo.c                          |  59 +--
     user/win32/groupinfo.c                        |  59 +--
     user/win32/userinfo.c                         |  59 +--
     301 files changed, 3277 insertions(+), 14648 deletions(-)
     create mode 100644 NOTICE
    
    diff --git a/CHANGES b/CHANGES
    index 5c73b31f1e1..2e8d88e2f18 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -7,6 +7,10 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.]
     
     Changes with APR 1.0
     
    +  *) The whole codebase was relicensed and is now available under
    +     the Apache License, Version 2.0 (http://www.apache.org/licenses).
    +     [Apache Software Foundation]
    +
       *) Switch to a single, top-level make. [Greg Stein]
     
       *) Return an error instead of silently failing when apr_poll() is
    diff --git a/LICENSE b/LICENSE
    index 57b0271586c..876754a9c23 100644
    --- a/LICENSE
    +++ b/LICENSE
    @@ -1,175 +1,287 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    - *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    - *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    - *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    - *
    - * Portions of this software are based upon public domain software
    - * originally written at the National Center for Supercomputing Applications,
    - * University of Illinois, Urbana-Champaign.
    - */
    +                                 Apache License
    +                           Version 2.0, January 2004
    +                        http://www.apache.org/licenses/
     
    -From strings/apr_fnmatch.c, include/apr_fnmatch.h, misc/unix/getopt.c,
    -file_io/unix/mktemp.c, strings/apr_strings.c:
    +   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
     
    -/* 
    - * Copyright (c) 1987, 1993, 1994
    - *      The Regents of the University of California.  All rights reserved.
    - *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in the
    - *    documentation and/or other materials provided with the distribution.
    - * 3. All advertising materials mentioning features or use of this software
    - *    must display the following acknowledgement:
    - *      This product includes software developed by the University of
    - *      California, Berkeley and its contributors.
    - * 4. Neither the name of the University nor the names of its contributors
    - *    may be used to endorse or promote products derived from this software
    - *    without specific prior written permission.
    - *
    - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
    - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    - * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
    - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    -
    -From network_io/unix/inet_ntop.c, network_io/unix/inet_pton.c:
    -
    -/* Copyright (c) 1996 by Internet Software Consortium.
    - *
    - * Permission to use, copy, modify, and distribute this software for any
    - * purpose with or without fee is hereby granted, provided that the above
    - * copyright notice and this permission notice appear in all copies.
    +   1. Definitions.
    +
    +      "License" shall mean the terms and conditions for use, reproduction,
    +      and distribution as defined by Sections 1 through 9 of this document.
    +
    +      "Licensor" shall mean the copyright owner or entity authorized by
    +      the copyright owner that is granting the License.
    +
    +      "Legal Entity" shall mean the union of the acting entity and all
    +      other entities that control, are controlled by, or are under common
    +      control with that entity. For the purposes of this definition,
    +      "control" means (i) the power, direct or indirect, to cause the
    +      direction or management of such entity, whether by contract or
    +      otherwise, or (ii) ownership of fifty percent (50%) or more of the
    +      outstanding shares, or (iii) beneficial ownership of such entity.
    +
    +      "You" (or "Your") shall mean an individual or Legal Entity
    +      exercising permissions granted by this License.
    +
    +      "Source" form shall mean the preferred form for making modifications,
    +      including but not limited to software source code, documentation
    +      source, and configuration files.
    +
    +      "Object" form shall mean any form resulting from mechanical
    +      transformation or translation of a Source form, including but
    +      not limited to compiled object code, generated documentation,
    +      and conversions to other media types.
    +
    +      "Work" shall mean the work of authorship, whether in Source or
    +      Object form, made available under the License, as indicated by a
    +      copyright notice that is included in or attached to the work
    +      (an example is provided in the Appendix below).
    +
    +      "Derivative Works" shall mean any work, whether in Source or Object
    +      form, that is based on (or derived from) the Work and for which the
    +      editorial revisions, annotations, elaborations, or other modifications
    +      represent, as a whole, an original work of authorship. For the purposes
    +      of this License, Derivative Works shall not include works that remain
    +      separable from, or merely link (or bind by name) to the interfaces of,
    +      the Work and Derivative Works thereof.
    +
    +      "Contribution" shall mean any work of authorship, including
    +      the original version of the Work and any modifications or additions
    +      to that Work or Derivative Works thereof, that is intentionally
    +      submitted to Licensor for inclusion in the Work by the copyright owner
    +      or by an individual or Legal Entity authorized to submit on behalf of
    +      the copyright owner. For the purposes of this definition, "submitted"
    +      means any form of electronic, verbal, or written communication sent
    +      to the Licensor or its representatives, including but not limited to
    +      communication on electronic mailing lists, source code control systems,
    +      and issue tracking systems that are managed by, or on behalf of, the
    +      Licensor for the purpose of discussing and improving the Work, but
    +      excluding communication that is conspicuously marked or otherwise
    +      designated in writing by the copyright owner as "Not a Contribution."
    +
    +      "Contributor" shall mean Licensor and any individual or Legal Entity
    +      on behalf of whom a Contribution has been received by Licensor and
    +      subsequently incorporated within the Work.
    +
    +   2. Grant of Copyright License. Subject to the terms and conditions of
    +      this License, each Contributor hereby grants to You a perpetual,
    +      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +      copyright license to reproduce, prepare Derivative Works of,
    +      publicly display, publicly perform, sublicense, and distribute the
    +      Work and such Derivative Works in Source or Object form.
    +
    +   3. Grant of Patent License. Subject to the terms and conditions of
    +      this License, each Contributor hereby grants to You a perpetual,
    +      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +      (except as stated in this section) patent license to make, have made,
    +      use, offer to sell, sell, import, and otherwise transfer the Work,
    +      where such license applies only to those patent claims licensable
    +      by such Contributor that are necessarily infringed by their
    +      Contribution(s) alone or by combination of their Contribution(s)
    +      with the Work to which such Contribution(s) was submitted. If You
    +      institute patent litigation against any entity (including a
    +      cross-claim or counterclaim in a lawsuit) alleging that the Work
    +      or a Contribution incorporated within the Work constitutes direct
    +      or contributory patent infringement, then any patent licenses
    +      granted to You under this License for that Work shall terminate
    +      as of the date such litigation is filed.
    +
    +   4. Redistribution. You may reproduce and distribute copies of the
    +      Work or Derivative Works thereof in any medium, with or without
    +      modifications, and in Source or Object form, provided that You
    +      meet the following conditions:
    +
    +      (a) You must give any other recipients of the Work or
    +          Derivative Works a copy of this License; and
    +
    +      (b) You must cause any modified files to carry prominent notices
    +          stating that You changed the files; and
    +
    +      (c) You must retain, in the Source form of any Derivative Works
    +          that You distribute, all copyright, patent, trademark, and
    +          attribution notices from the Source form of the Work,
    +          excluding those notices that do not pertain to any part of
    +          the Derivative Works; and
    +
    +      (d) If the Work includes a "NOTICE" text file as part of its
    +          distribution, then any Derivative Works that You distribute must
    +          include a readable copy of the attribution notices contained
    +          within such NOTICE file, excluding those notices that do not
    +          pertain to any part of the Derivative Works, in at least one
    +          of the following places: within a NOTICE text file distributed
    +          as part of the Derivative Works; within the Source form or
    +          documentation, if provided along with the Derivative Works; or,
    +          within a display generated by the Derivative Works, if and
    +          wherever such third-party notices normally appear. The contents
    +          of the NOTICE file are for informational purposes only and
    +          do not modify the License. You may add Your own attribution
    +          notices within Derivative Works that You distribute, alongside
    +          or as an addendum to the NOTICE text from the Work, provided
    +          that such additional attribution notices cannot be construed
    +          as modifying the License.
    +
    +      You may add Your own copyright statement to Your modifications and
    +      may provide additional or different license terms and conditions
    +      for use, reproduction, or distribution of Your modifications, or
    +      for any such Derivative Works as a whole, provided Your use,
    +      reproduction, and distribution of the Work otherwise complies with
    +      the conditions stated in this License.
    +
    +   5. Submission of Contributions. Unless You explicitly state otherwise,
    +      any Contribution intentionally submitted for inclusion in the Work
    +      by You to the Licensor shall be under the terms and conditions of
    +      this License, without any additional terms or conditions.
    +      Notwithstanding the above, nothing herein shall supersede or modify
    +      the terms of any separate license agreement you may have executed
    +      with Licensor regarding such Contributions.
    +
    +   6. Trademarks. This License does not grant permission to use the trade
    +      names, trademarks, service marks, or product names of the Licensor,
    +      except as required for reasonable and customary use in describing the
    +      origin of the Work and reproducing the content of the NOTICE file.
    +
    +   7. Disclaimer of Warranty. Unless required by applicable law or
    +      agreed to in writing, Licensor provides the Work (and each
    +      Contributor provides its Contributions) on an "AS IS" BASIS,
    +      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    +      implied, including, without limitation, any warranties or conditions
    +      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    +      PARTICULAR PURPOSE. You are solely responsible for determining the
    +      appropriateness of using or redistributing the Work and assume any
    +      risks associated with Your exercise of permissions under this License.
    +
    +   8. Limitation of Liability. In no event and under no legal theory,
    +      whether in tort (including negligence), contract, or otherwise,
    +      unless required by applicable law (such as deliberate and grossly
    +      negligent acts) or agreed to in writing, shall any Contributor be
    +      liable to You for damages, including any direct, indirect, special,
    +      incidental, or consequential damages of any character arising as a
    +      result of this License or out of the use or inability to use the
    +      Work (including but not limited to damages for loss of goodwill,
    +      work stoppage, computer failure or malfunction, or any and all
    +      other commercial damages or losses), even if such Contributor
    +      has been advised of the possibility of such damages.
    +
    +   9. Accepting Warranty or Additional Liability. While redistributing
    +      the Work or Derivative Works thereof, You may choose to offer,
    +      and charge a fee for, acceptance of support, warranty, indemnity,
    +      or other liability obligations and/or rights consistent with this
    +      License. However, in accepting such obligations, You may act only
    +      on Your own behalf and on Your sole responsibility, not on behalf
    +      of any other Contributor, and only if You agree to indemnify,
    +      defend, and hold each Contributor harmless for any liability
    +      incurred by, or claims asserted against, such Contributor by reason
    +      of your accepting any such warranty or additional liability.
    +
    +   END OF TERMS AND CONDITIONS
    +
    +   APPENDIX: How to apply the Apache License to your work.
    +
    +      To apply the Apache License to your work, attach the following
    +      boilerplate notice, with the fields enclosed by brackets "[]"
    +      replaced with your own identifying information. (Don't include
    +      the brackets!)  The text should be enclosed in the appropriate
    +      comment syntax for the file format. We also recommend that a
    +      file or class name and description of purpose be included on the
    +      same "printed page" as the copyright notice for easier
    +      identification within third-party archives.
    +
    +   Copyright [yyyy] [name of copyright owner]
    +
    +   Licensed under the Apache License, Version 2.0 (the "License");
    +   you may not use this file except in compliance with the License.
    +   You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
    +
    +
    +
    +APACHE PORTABLE RUNTIME SUBCOMPONENTS: 
    +
    +The Apache Portable Runtime includes a number of subcomponents with
    +separate copyright notices and license terms. Your use of the source
    +code for the these subcomponents is subject to the terms and
    +conditions of the following licenses. 
    +
    +For the include\apr_md5.h component: 
    +/*
    + * This is work is derived from material Copyright RSA Data Security, Inc.
      *
    - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
    - * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
    - * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
    - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
    - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
    - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
    - * SOFTWARE.
    + * The RSA copyright statement and Licence for that original material is
    + * included below. This is followed by the Apache copyright statement and
    + * licence for the modifications made to that material.
      */
     
    -From dso/aix/dso.c:
    +/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
    +   rights reserved.
     
    - *  Based on libdl (dlfcn.c/dlfcn.h) which is
    - *  Copyright (c) 1992,1993,1995,1996,1997,1988
    - *  Jens-Uwe Mager, Helios Software GmbH, Hannover, Germany.
    - *
    - *  Not derived from licensed software.
    - *
    - *  Permission is granted to freely use, copy, modify, and redistribute
    - *  this software, provided that the author is not construed to be liable
    - *  for any results of using the software, alterations are clearly marked
    - *  as such, and this notice is not modified.
    +   License to copy and use this software is granted provided that it
    +   is identified as the "RSA Data Security, Inc. MD5 Message-Digest
    +   Algorithm" in all material mentioning or referencing this software
    +   or this function.
     
    -From strings/apr_strnatcmp.c, include/apr_strings.h:
    +   License is also granted to make and use derivative works provided
    +   that such works are identified as "derived from the RSA Data
    +   Security, Inc. MD5 Message-Digest Algorithm" in all material
    +   mentioning or referencing the derived work.
     
    -  strnatcmp.c -- Perform 'natural order' comparisons of strings in C.
    -  Copyright (C) 2000 by Martin Pool 
    +   RSA Data Security, Inc. makes no representations concerning either
    +   the merchantability of this software or the suitability of this
    +   software for any particular purpose. It is provided "as is"
    +   without express or implied warranty of any kind.
     
    -  This software is provided 'as-is', without any express or implied
    -  warranty.  In no event will the authors be held liable for any damages
    -  arising from the use of this software.
    +   These notices must be retained in any copies of any part of this
    +   documentation and/or software.
    + */
     
    -  Permission is granted to anyone to use this software for any purpose,
    -  including commercial applications, and to alter it and redistribute it
    -  freely, subject to the following restrictions:
    +For the passwd\apr_md5.c component:
     
    -  1. The origin of this software must not be misrepresented; you must not
    -     claim that you wrote the original software. If you use this software
    -     in a product, an acknowledgment in the product documentation would be
    -     appreciated but is not required.
    -  2. Altered source versions must be plainly marked as such, and must not be
    -     misrepresented as being the original software.
    -  3. This notice may not be removed or altered from any source distribution.
    +/*
    + * This is work is derived from material Copyright RSA Data Security, Inc.
    + *
    + * The RSA copyright statement and Licence for that original material is
    + * included below. This is followed by the Apache copyright statement and
    + * licence for the modifications made to that material.
    + */
    +
    +/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
    + */
    +
    +/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
    +   rights reserved.
     
    +   License to copy and use this software is granted provided that it
    +   is identified as the "RSA Data Security, Inc. MD5 Message-Digest
    +   Algorithm" in all material mentioning or referencing this software
    +   or this function.
     
    -From test/CuTest.c, test/CuTest.h:
    +   License is also granted to make and use derivative works provided
    +   that such works are identified as "derived from the RSA Data
    +   Security, Inc. MD5 Message-Digest Algorithm" in all material
    +   mentioning or referencing the derived work.
     
    +   RSA Data Security, Inc. makes no representations concerning either
    +   the merchantability of this software or the suitability of this
    +   software for any particular purpose. It is provided "as is"
    +   without express or implied warranty of any kind.
    +
    +   These notices must be retained in any copies of any part of this
    +   documentation and/or software.
    + */
     /*
    - * Copyright (c) 2002-2006 Asim Jalis
    - * 
    - * This library is released under the zlib/libpng license as described at
    - * 
    - * http://www.opensource.org/licenses/zlib-license.html
    - * 
    - * Here is the statement of the license:
    - * 
    - * This software is provided 'as-is', without any express or implied warranty. 
    - * In no event will the authors be held liable for any damages arising from 
    - * the use of this software.
    - * 
    - * Permission is granted to anyone to use this software for any purpose, 
    - * including commercial applications, and to alter it and redistribute it 
    - * freely, subject to the following restrictions:
    - * 
    - * 1. The origin of this software must not be misrepresented; you must not 
    - * claim that you wrote the original software. If you use this software in a 
    - * product, an acknowledgment in the product documentation would be 
    - * appreciated but is not required.
    - * 
    - * 2. Altered source versions must be plainly marked as such, and must not be
    - * misrepresented as being the original software.
    - * 
    - * 3. This notice may not be removed or altered from any source distribution.
    + * The apr_md5_encode() routine uses much code obtained from the FreeBSD 3.0
    + * MD5 crypt() function, which is licenced as follows:
    + * ----------------------------------------------------------------------------
    + * "THE BEER-WARE LICENSE" (Revision 42):
    + *  wrote this file.  As long as you retain this notice you
    + * can do whatever you want with this stuff. If we meet some day, and you think
    + * this stuff is worth it, you can buy me a beer in return.  Poul-Henning Kamp
    + * ----------------------------------------------------------------------------
      */
    +
    diff --git a/NOTICE b/NOTICE
    new file mode 100644
    index 00000000000..129db55ae51
    --- /dev/null
    +++ b/NOTICE
    @@ -0,0 +1,9 @@
    +This product includes software developed by
    +The Apache Software Foundation (http://www.apache.org/).
    +
    +Portions of this software were developed at the National Center
    +for Supercomputing Applications (NCSA) at the University of
    +Illinois at Urbana-Champaign.
    +
    +This software contains code derived from the RSA Data Security
    +Inc. MD5 Message-Digest Algorithm.
    diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c
    index 53f88bfb138..17ffe14d515 100644
    --- a/atomic/netware/apr_atomic.c
    +++ b/atomic/netware/apr_atomic.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c
    index 3adeb357615..7c8fa484c5d 100644
    --- a/atomic/os390/atomic.c
    +++ b/atomic/os390/atomic.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     
    diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c
    index 8b4296cdf73..5827ba091ae 100644
    --- a/atomic/unix/apr_atomic.c
    +++ b/atomic/unix/apr_atomic.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/build/aplibtool.c b/build/aplibtool.c
    index 35d8a4ed0d3..1990d7d79cb 100644
    --- a/build/aplibtool.c
    +++ b/build/aplibtool.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/dso/aix/dso.c b/dso/aix/dso.c
    index 0dedc49c1c4..1b197003129 100644
    --- a/dso/aix/dso.c
    +++ b/dso/aix/dso.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /*
    diff --git a/dso/beos/dso.c b/dso/beos/dso.c
    index 7370a814c42..dac5fd50534 100644
    --- a/dso/beos/dso.c
    +++ b/dso/beos/dso.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "beos/apr_arch_dso.h"
    diff --git a/dso/netware/dso.c b/dso/netware/dso.c
    index ffb0530b920..ba93d1d71a1 100644
    --- a/dso/netware/dso.c
    +++ b/dso/netware/dso.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_dso.h"
    diff --git a/dso/os2/dso.c b/dso/os2/dso.c
    index 813c0d23562..da9f636c042 100644
    --- a/dso/os2/dso.c
    +++ b/dso/os2/dso.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_dso.h"
    diff --git a/dso/os390/dso.c b/dso/os390/dso.c
    index bce8a0df962..3022e0ea150 100644
    --- a/dso/os390/dso.c
    +++ b/dso/os390/dso.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_portable.h"
    diff --git a/dso/unix/dso.c b/dso/unix/dso.c
    index f78fcf63989..2581149fb40 100644
    --- a/dso/unix/dso.c
    +++ b/dso/unix/dso.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_dso.h"
    diff --git a/dso/win32/dso.c b/dso/win32/dso.c
    index 900a0d0cb4c..bf398e46e08 100644
    --- a/dso/win32/dso.c
    +++ b/dso/win32/dso.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_dso.h"
    diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c
    index 4b7d3f14dd6..3ef3b734422 100644
    --- a/file_io/netware/filestat.c
    +++ b/file_io/netware/filestat.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/netware/filesys.c b/file_io/netware/filesys.c
    index ff77c7f9e5e..532bee7c1a2 100644
    --- a/file_io/netware/filesys.c
    +++ b/file_io/netware/filesys.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/file_io/netware/flock.c b/file_io/netware/flock.c
    index 6fb2681cd22..7e7d771cf0d 100644
    --- a/file_io/netware/flock.c
    +++ b/file_io/netware/flock.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c
    index 497c0df8d63..2cf03ccc8c5 100644
    --- a/file_io/netware/pipe.c
    +++ b/file_io/netware/pipe.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c
    index cf4b461f46e..eb73dd99d01 100644
    --- a/file_io/os2/dir.c
    +++ b/file_io/os2/dir.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/os2/fileacc.c b/file_io/os2/fileacc.c
    index a1b0e1f5f55..870c5ddd837 100644
    --- a/file_io/os2/fileacc.c
    +++ b/file_io/os2/fileacc.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "../unix/fileacc.c"
    diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c
    index e7abb987ee7..2d06acdd2c3 100644
    --- a/file_io/os2/filedup.c
    +++ b/file_io/os2/filedup.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/os2/filepath.c b/file_io/os2/filepath.c
    index 2abaaee33a1..f4f84f76b20 100644
    --- a/file_io/os2/filepath.c
    +++ b/file_io/os2/filepath.c
    @@ -1,4 +1,15 @@
    -/* OS/2 & Win32 have much in common with regards to file names (both are 
    - * DOSish) so it makes sense to share some code 
    +/* Copyright  2004 The Apache Software Foundation
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     #include "../win32/filepath.c"
    diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c
    index b2bab517b82..e32b2906cea 100644
    --- a/file_io/os2/filestat.c
    +++ b/file_io/os2/filestat.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #define INCL_DOS
    diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c
    index 88e7105b6df..b323e488d96 100644
    --- a/file_io/os2/filesys.c
    +++ b/file_io/os2/filesys.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/file_io/os2/flock.c b/file_io/os2/flock.c
    index 09855859c92..9e452821df0 100644
    --- a/file_io/os2/flock.c
    +++ b/file_io/os2/flock.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c
    index 2bd3598435c..9848a6e58a7 100644
    --- a/file_io/os2/maperrorcode.c
    +++ b/file_io/os2/maperrorcode.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #define INCL_DOSERRORS
    diff --git a/file_io/os2/open.c b/file_io/os2/open.c
    index d61008ac4c5..fb5f740076f 100644
    --- a/file_io/os2/open.c
    +++ b/file_io/os2/open.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c
    index decf88b45a8..df351122383 100644
    --- a/file_io/os2/pipe.c
    +++ b/file_io/os2/pipe.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #define INCL_DOSERRORS
    diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c
    index 6121ebc5a1a..65fee785435 100644
    --- a/file_io/os2/readwrite.c
    +++ b/file_io/os2/readwrite.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #define INCL_DOS
    diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c
    index 605d0b7e11d..f393b9d1c19 100644
    --- a/file_io/os2/seek.c
    +++ b/file_io/os2/seek.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c
    index 3aa03ef58ad..4f990e48484 100644
    --- a/file_io/unix/copy.c
    +++ b/file_io/unix/copy.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2002-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
    index 4911974880a..29abd523cbc 100644
    --- a/file_io/unix/dir.c
    +++ b/file_io/unix/dir.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c
    index 2140c8b1e67..bcd207c8974 100644
    --- a/file_io/unix/fileacc.c
    +++ b/file_io/unix/fileacc.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_strings.h"
    diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c
    index f89e2e5a5e0..f9f9f1d3e06 100644
    --- a/file_io/unix/filedup.c
    +++ b/file_io/unix/filedup.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c
    index 2acc37b0df9..dd2720e36d6 100644
    --- a/file_io/unix/filepath.c
    +++ b/file_io/unix/filepath.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/file_io/unix/filepath_util.c b/file_io/unix/filepath_util.c
    index 4b27e4f6766..40d0cd77044 100644
    --- a/file_io/unix/filepath_util.c
    +++ b/file_io/unix/filepath_util.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     
    diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c
    index 86e3a639d50..85352fa9da7 100644
    --- a/file_io/unix/filestat.c
    +++ b/file_io/unix/filestat.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c
    index 29029315991..2ee7bc63e1c 100644
    --- a/file_io/unix/flock.c
    +++ b/file_io/unix/flock.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c
    index 6c25e093ffa..af7b70e3815 100644
    --- a/file_io/unix/fullrw.c
    +++ b/file_io/unix/fullrw.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_file_io.h"
    diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c
    index 1311a52216a..ff23a2f7b99 100644
    --- a/file_io/unix/mktemp.c
    +++ b/file_io/unix/mktemp.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    - *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     /*
      * Copyright (c) 1987, 1993
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index 3a1561ec073..81d622426fa 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c
    index 5ab52cbdd51..7013160cdc4 100644
    --- a/file_io/unix/pipe.c
    +++ b/file_io/unix/pipe.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c
    index 38ca0819985..3059f670fa4 100644
    --- a/file_io/unix/readwrite.c
    +++ b/file_io/unix/readwrite.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c
    index b92d71bd670..2ae433f9d7e 100644
    --- a/file_io/unix/seek.c
    +++ b/file_io/unix/seek.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/unix/tempdir.c b/file_io/unix/tempdir.c
    index 8de5961ed79..e64c4838dbf 100644
    --- a/file_io/unix/tempdir.c
    +++ b/file_io/unix/tempdir.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     #include "apr_private.h"
     #include "apr_file_io.h"
    diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c
    index ee8e38c4950..ab2d080472b 100644
    --- a/file_io/win32/dir.c
    +++ b/file_io/win32/dir.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c
    index b14b16bdd92..57c57ea0230 100644
    --- a/file_io/win32/filedup.c
    +++ b/file_io/win32/filedup.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "win32/apr_arch_file_io.h"
    diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c
    index f44f619ac24..74d6d087998 100644
    --- a/file_io/win32/filepath.c
    +++ b/file_io/win32/filepath.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
    index e595ba10185..3b8529e0a52 100644
    --- a/file_io/win32/filestat.c
    +++ b/file_io/win32/filestat.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c
    index a4c5177bb67..da5244baf7f 100644
    --- a/file_io/win32/filesys.c
    +++ b/file_io/win32/filesys.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c
    index 0629ac92142..65a158e8ce4 100644
    --- a/file_io/win32/flock.c
    +++ b/file_io/win32/flock.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/file_io/win32/open.c b/file_io/win32/open.c
    index 50a5ce66f3e..e937801f8a3 100644
    --- a/file_io/win32/open.c
    +++ b/file_io/win32/open.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_private.h"
    diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c
    index 21746c89215..297cda2be80 100644
    --- a/file_io/win32/pipe.c
    +++ b/file_io/win32/pipe.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "win32/apr_arch_file_io.h"
    diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c
    index 6c023b4848a..b8a5e4be80a 100644
    --- a/file_io/win32/readwrite.c
    +++ b/file_io/win32/readwrite.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "win32/apr_arch_file_io.h"
    diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c
    index 3809a1083ac..55d42a39e10 100644
    --- a/file_io/win32/seek.c
    +++ b/file_io/win32/seek.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "win32/apr_arch_file_io.h"
    diff --git a/include/apr_allocator.h b/include/apr_allocator.h
    index ce2f4e26a95..965612bf7d6 100644
    --- a/include/apr_allocator.h
    +++ b/include/apr_allocator.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_ALLOCATOR_H
    diff --git a/include/apr_atomic.h b/include/apr_atomic.h
    index f159ecd47aa..784cd053cd1 100644
    --- a/include/apr_atomic.h
    +++ b/include/apr_atomic.h
    @@ -1,59 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    - *
    - * Portions of this software are based upon public domain software
    - * originally written at the National Center for Supercomputing Applications,
    - * University of Illinois, Urbana-Champaign.
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_ATOMIC_H
    diff --git a/include/apr_dso.h b/include/apr_dso.h
    index faa95c1431b..9dd426f63cb 100644
    --- a/include/apr_dso.h
    +++ b/include/apr_dso.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_DSO_DOT_H
    diff --git a/include/apr_env.h b/include/apr_env.h
    index e8c092e3cdd..200ab48f270 100644
    --- a/include/apr_env.h
    +++ b/include/apr_env.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_ENV_H
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index e95400599e1..ddd6f13c6dc 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_ERRNO_H
    diff --git a/include/apr_file_info.h b/include/apr_file_info.h
    index 97bd8ee8ee4..fb113f3a0d3 100644
    --- a/include/apr_file_info.h
    +++ b/include/apr_file_info.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_FILE_INFO_H
    diff --git a/include/apr_file_io.h b/include/apr_file_io.h
    index 3a4a033dd79..dd5acb72b82 100644
    --- a/include/apr_file_io.h
    +++ b/include/apr_file_io.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_FILE_IO_H
    diff --git a/include/apr_general.h b/include/apr_general.h
    index f24a122fd45..3b6caaceb87 100644
    --- a/include/apr_general.h
    +++ b/include/apr_general.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_GENERAL_H
    diff --git a/include/apr_getopt.h b/include/apr_getopt.h
    index fbcd7545052..5d9639efb7f 100644
    --- a/include/apr_getopt.h
    +++ b/include/apr_getopt.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_GETOPT_H
    diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h
    index 5b456de278d..8f9e46186d4 100644
    --- a/include/apr_global_mutex.h
    +++ b/include/apr_global_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_GLOBAL_MUTEX_H
    diff --git a/include/apr_hash.h b/include/apr_hash.h
    index 31d913e1556..4b3dfb83fd1 100644
    --- a/include/apr_hash.h
    +++ b/include/apr_hash.h
    @@ -1,59 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    - *
    - * Portions of this software are based upon public domain software
    - * originally written at the National Center for Supercomputing Applications,
    - * University of Illinois, Urbana-Champaign.
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_HASH_H
    diff --git a/include/apr_inherit.h b/include/apr_inherit.h
    index 41b683633bd..5dbbbae8171 100644
    --- a/include/apr_inherit.h
    +++ b/include/apr_inherit.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_INHERIT_H
    diff --git a/include/apr_lib.h b/include/apr_lib.h
    index 70679fde54b..18d83da092c 100644
    --- a/include/apr_lib.h
    +++ b/include/apr_lib.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_LIB_H
    diff --git a/include/apr_mmap.h b/include/apr_mmap.h
    index df380705dae..606c0443eb5 100644
    --- a/include/apr_mmap.h
    +++ b/include/apr_mmap.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_MMAP_H
    diff --git a/include/apr_network_io.h b/include/apr_network_io.h
    index c4874100306..b160b3f7f5d 100644
    --- a/include/apr_network_io.h
    +++ b/include/apr_network_io.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_NETWORK_IO_H
    diff --git a/include/apr_poll.h b/include/apr_poll.h
    index 02c133acd2e..cc8920824f9 100644
    --- a/include/apr_poll.h
    +++ b/include/apr_poll.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_POLL_H
    diff --git a/include/apr_pools.h b/include/apr_pools.h
    index 0d9e1c442ed..cca864bf2ce 100644
    --- a/include/apr_pools.h
    +++ b/include/apr_pools.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_POOLS_H
    diff --git a/include/apr_portable.h b/include/apr_portable.h
    index 7a52c14b3dd..1daa1a905a4 100644
    --- a/include/apr_portable.h
    +++ b/include/apr_portable.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /* This header file is where you should put ANY platform specific information.
    diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h
    index 6cc6740ffb3..cceafcf420d 100644
    --- a/include/apr_proc_mutex.h
    +++ b/include/apr_proc_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_PROC_MUTEX_H
    diff --git a/include/apr_ring.h b/include/apr_ring.h
    index e25cc437c14..5bf11aaf678 100644
    --- a/include/apr_ring.h
    +++ b/include/apr_ring.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /*
    diff --git a/include/apr_shm.h b/include/apr_shm.h
    index aa5764db558..3507d8450dd 100644
    --- a/include/apr_shm.h
    +++ b/include/apr_shm.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_SHM_H
    diff --git a/include/apr_signal.h b/include/apr_signal.h
    index 8e4f1495f8c..ff885352f7a 100644
    --- a/include/apr_signal.h
    +++ b/include/apr_signal.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_SIGNAL_H
    diff --git a/include/apr_strings.h b/include/apr_strings.h
    index a11ce3431e6..2d8c647647f 100644
    --- a/include/apr_strings.h
    +++ b/include/apr_strings.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2004 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /* Portions of this file are covered by */
    diff --git a/include/apr_support.h b/include/apr_support.h
    index 8b3f257f5d8..164ce229d93 100644
    --- a/include/apr_support.h
    +++ b/include/apr_support.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_SUPPORT_H
    diff --git a/include/apr_tables.h b/include/apr_tables.h
    index 73a473957da..d4d451931d3 100644
    --- a/include/apr_tables.h
    +++ b/include/apr_tables.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_TABLES_H
    diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h
    index 8bf13713768..bc6b70562bf 100644
    --- a/include/apr_thread_cond.h
    +++ b/include/apr_thread_cond.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_THREAD_COND_H
    diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h
    index be943f75bc1..1040e700283 100644
    --- a/include/apr_thread_mutex.h
    +++ b/include/apr_thread_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_THREAD_MUTEX_H
    diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h
    index d1c83d594de..539ac471d65 100644
    --- a/include/apr_thread_proc.h
    +++ b/include/apr_thread_proc.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_THREAD_PROC_H
    diff --git a/include/apr_thread_rwlock.h b/include/apr_thread_rwlock.h
    index e5533fc9f4e..fdb3fa8ed82 100644
    --- a/include/apr_thread_rwlock.h
    +++ b/include/apr_thread_rwlock.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_THREAD_RWLOCK_H
    diff --git a/include/apr_time.h b/include/apr_time.h
    index 44ff6759777..02797f4cc81 100644
    --- a/include/apr_time.h
    +++ b/include/apr_time.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_TIME_H
    diff --git a/include/apr_user.h b/include/apr_user.h
    index d8027662dda..a670fde9bb6 100644
    --- a/include/apr_user.h
    +++ b/include/apr_user.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_USER_H
    diff --git a/include/apr_version.h b/include/apr_version.h
    index ab01ccf1954..8d922841789 100644
    --- a/include/apr_version.h
    +++ b/include/apr_version.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_VERSION_H
    diff --git a/include/apr_want.h b/include/apr_want.h
    index 27a27be0b29..23862b005ae 100644
    --- a/include/apr_want.h
    +++ b/include/apr_want.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"        /* configuration data */
    diff --git a/include/arch/aix/apr_arch_dso.h b/include/arch/aix/apr_arch_dso.h
    index 0e4ee655461..b59e98e23b1 100644
    --- a/include/arch/aix/apr_arch_dso.h
    +++ b/include/arch/aix/apr_arch_dso.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef DSO_H
    diff --git a/include/arch/apr_private_common.h b/include/arch/apr_private_common.h
    index eb8a395fb32..b2a02a8e4fb 100644
    --- a/include/arch/apr_private_common.h
    +++ b/include/arch/apr_private_common.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /*
    diff --git a/include/arch/beos/apr_arch_dso.h b/include/arch/beos/apr_arch_dso.h
    index 8964dd24577..a1ed754d3c9 100644
    --- a/include/arch/beos/apr_arch_dso.h
    +++ b/include/arch/beos/apr_arch_dso.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef DSO_H
    diff --git a/include/arch/beos/apr_arch_proc_mutex.h b/include/arch/beos/apr_arch_proc_mutex.h
    index fbea2d32f35..b47076f91b7 100644
    --- a/include/arch/beos/apr_arch_proc_mutex.h
    +++ b/include/arch/beos/apr_arch_proc_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef PROC_MUTEX_H
    diff --git a/include/arch/beos/apr_arch_thread_cond.h b/include/arch/beos/apr_arch_thread_cond.h
    index 8bcbb7262c5..1692edc854e 100644
    --- a/include/arch/beos/apr_arch_thread_cond.h
    +++ b/include/arch/beos/apr_arch_thread_cond.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_COND_H
    diff --git a/include/arch/beos/apr_arch_thread_mutex.h b/include/arch/beos/apr_arch_thread_mutex.h
    index 1667925eef1..4bd2d7e29ed 100644
    --- a/include/arch/beos/apr_arch_thread_mutex.h
    +++ b/include/arch/beos/apr_arch_thread_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_MUTEX_H
    diff --git a/include/arch/beos/apr_arch_thread_rwlock.h b/include/arch/beos/apr_arch_thread_rwlock.h
    index 4b3fcafda86..377c7b7f0ad 100644
    --- a/include/arch/beos/apr_arch_thread_rwlock.h
    +++ b/include/arch/beos/apr_arch_thread_rwlock.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_RWLOCK_H
    diff --git a/include/arch/beos/apr_arch_threadproc.h b/include/arch/beos/apr_arch_threadproc.h
    index 67c9e5fc67b..a81f69cfebb 100644
    --- a/include/arch/beos/apr_arch_threadproc.h
    +++ b/include/arch/beos/apr_arch_threadproc.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_thread_proc.h"
    diff --git a/include/arch/netware/apr_arch_dso.h b/include/arch/netware/apr_arch_dso.h
    index 926cf4c2943..5a4ea62fe69 100644
    --- a/include/arch/netware/apr_arch_dso.h
    +++ b/include/arch/netware/apr_arch_dso.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef DSO_H
    diff --git a/include/arch/netware/apr_arch_file_io.h b/include/arch/netware/apr_arch_file_io.h
    index 70c8ea51fa6..8d8b96441fc 100644
    --- a/include/arch/netware/apr_arch_file_io.h
    +++ b/include/arch/netware/apr_arch_file_io.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef FILE_IO_H
    diff --git a/include/arch/netware/apr_arch_global_mutex.h b/include/arch/netware/apr_arch_global_mutex.h
    index b5c8db2f570..61c91096460 100644
    --- a/include/arch/netware/apr_arch_global_mutex.h
    +++ b/include/arch/netware/apr_arch_global_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef GLOBAL_MUTEX_H
    diff --git a/include/arch/netware/apr_arch_internal_time.h b/include/arch/netware/apr_arch_internal_time.h
    index 4fe53df8b12..8522d37ab36 100644
    --- a/include/arch/netware/apr_arch_internal_time.h
    +++ b/include/arch/netware/apr_arch_internal_time.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2001-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef TIME_INTERNAL_H
    diff --git a/include/arch/netware/apr_arch_networkio.h b/include/arch/netware/apr_arch_networkio.h
    index 3f0625280fe..4ec03896030 100644
    --- a/include/arch/netware/apr_arch_networkio.h
    +++ b/include/arch/netware/apr_arch_networkio.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef NETWORK_IO_H
    diff --git a/include/arch/netware/apr_arch_pre_nw.h b/include/arch/netware/apr_arch_pre_nw.h
    index 22739f6c601..49ceb86bb99 100644
    --- a/include/arch/netware/apr_arch_pre_nw.h
    +++ b/include/arch/netware/apr_arch_pre_nw.h
    @@ -11,11 +11,20 @@
     
     #define N_PLAT_NLM
     
    -/* hint for MSL C++ that we're on NetWare platform */
    -#define __NETWARE__
    -
    -/* the FAR keyword has no meaning in a 32-bit environment 
    -   but is used in the SDK headers so we take it out */
    +/* Copyright  2004 The Apache Software Foundation
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
     #define FAR
     #define far
     
    diff --git a/include/arch/netware/apr_arch_proc_mutex.h b/include/arch/netware/apr_arch_proc_mutex.h
    index 01541d3a110..5195a0a898a 100644
    --- a/include/arch/netware/apr_arch_proc_mutex.h
    +++ b/include/arch/netware/apr_arch_proc_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef PROC_MUTEX_H
    diff --git a/include/arch/netware/apr_arch_thread_cond.h b/include/arch/netware/apr_arch_thread_cond.h
    index 551a99239b2..82607dafb94 100644
    --- a/include/arch/netware/apr_arch_thread_cond.h
    +++ b/include/arch/netware/apr_arch_thread_cond.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_COND_H
    diff --git a/include/arch/netware/apr_arch_thread_mutex.h b/include/arch/netware/apr_arch_thread_mutex.h
    index 5dc9247ae78..794b555ba90 100644
    --- a/include/arch/netware/apr_arch_thread_mutex.h
    +++ b/include/arch/netware/apr_arch_thread_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_MUTEX_H
    diff --git a/include/arch/netware/apr_arch_thread_rwlock.h b/include/arch/netware/apr_arch_thread_rwlock.h
    index e07ac70c675..3844420d19b 100644
    --- a/include/arch/netware/apr_arch_thread_rwlock.h
    +++ b/include/arch/netware/apr_arch_thread_rwlock.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_RWLOCK_H
    diff --git a/include/arch/netware/apr_arch_threadproc.h b/include/arch/netware/apr_arch_threadproc.h
    index 14899df5c40..39b79aeb11e 100644
    --- a/include/arch/netware/apr_arch_threadproc.h
    +++ b/include/arch/netware/apr_arch_threadproc.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h
    index 6ece404a966..b24758b0389 100644
    --- a/include/arch/netware/apr_private.h
    +++ b/include/arch/netware/apr_private.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /*
    diff --git a/include/arch/os2/apr_arch_dso.h b/include/arch/os2/apr_arch_dso.h
    index 86b92678bf6..9b104609579 100644
    --- a/include/arch/os2/apr_arch_dso.h
    +++ b/include/arch/os2/apr_arch_dso.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef DSO_H
    diff --git a/include/arch/os2/apr_arch_file_io.h b/include/arch/os2/apr_arch_file_io.h
    index 364e09c3e29..014438cf7a8 100644
    --- a/include/arch/os2/apr_arch_file_io.h
    +++ b/include/arch/os2/apr_arch_file_io.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef FILE_IO_H
    diff --git a/include/arch/os2/apr_arch_networkio.h b/include/arch/os2/apr_arch_networkio.h
    index dd93fa24c67..c16edfd2e36 100644
    --- a/include/arch/os2/apr_arch_networkio.h
    +++ b/include/arch/os2/apr_arch_networkio.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef NETWORK_IO_H
    diff --git a/include/arch/os2/apr_arch_os2calls.h b/include/arch/os2/apr_arch_os2calls.h
    index 518d45b89ed..33a747a1d69 100644
    --- a/include/arch/os2/apr_arch_os2calls.h
    +++ b/include/arch/os2/apr_arch_os2calls.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_errno.h"
    diff --git a/include/arch/os2/apr_arch_proc_mutex.h b/include/arch/os2/apr_arch_proc_mutex.h
    index f1e03013c57..40e35b4206e 100644
    --- a/include/arch/os2/apr_arch_proc_mutex.h
    +++ b/include/arch/os2/apr_arch_proc_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef PROC_MUTEX_H
    diff --git a/include/arch/os2/apr_arch_thread_cond.h b/include/arch/os2/apr_arch_thread_cond.h
    index 9e31a0af07e..85d70eccbcb 100644
    --- a/include/arch/os2/apr_arch_thread_cond.h
    +++ b/include/arch/os2/apr_arch_thread_cond.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_COND_H
    diff --git a/include/arch/os2/apr_arch_thread_mutex.h b/include/arch/os2/apr_arch_thread_mutex.h
    index 2a3979b23b7..fa3f279b2d1 100644
    --- a/include/arch/os2/apr_arch_thread_mutex.h
    +++ b/include/arch/os2/apr_arch_thread_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_MUTEX_H
    diff --git a/include/arch/os2/apr_arch_thread_rwlock.h b/include/arch/os2/apr_arch_thread_rwlock.h
    index 460843fd91f..e9c2c033033 100644
    --- a/include/arch/os2/apr_arch_thread_rwlock.h
    +++ b/include/arch/os2/apr_arch_thread_rwlock.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_RWLOCK_H
    diff --git a/include/arch/os2/apr_arch_threadproc.h b/include/arch/os2/apr_arch_threadproc.h
    index f077366abdf..f61eb493892 100644
    --- a/include/arch/os2/apr_arch_threadproc.h
    +++ b/include/arch/os2/apr_arch_threadproc.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_thread_proc.h"
    diff --git a/include/arch/os390/apr_arch_dso.h b/include/arch/os390/apr_arch_dso.h
    index af5297d4caf..e3084f40186 100644
    --- a/include/arch/os390/apr_arch_dso.h
    +++ b/include/arch/os390/apr_arch_dso.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef DSO_H
    diff --git a/include/arch/unix/apr_arch_dso.h b/include/arch/unix/apr_arch_dso.h
    index cf47659cce7..2a1667876e5 100644
    --- a/include/arch/unix/apr_arch_dso.h
    +++ b/include/arch/unix/apr_arch_dso.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef DSO_H
    diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h
    index 3ee5ab8b06c..0802c26399c 100644
    --- a/include/arch/unix/apr_arch_file_io.h
    +++ b/include/arch/unix/apr_arch_file_io.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef FILE_IO_H
    diff --git a/include/arch/unix/apr_arch_global_mutex.h b/include/arch/unix/apr_arch_global_mutex.h
    index 8579535cf34..24ee631d366 100644
    --- a/include/arch/unix/apr_arch_global_mutex.h
    +++ b/include/arch/unix/apr_arch_global_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef GLOBAL_MUTEX_H
    diff --git a/include/arch/unix/apr_arch_inherit.h b/include/arch/unix/apr_arch_inherit.h
    index 7807d323038..0f4f594606c 100644
    --- a/include/arch/unix/apr_arch_inherit.h
    +++ b/include/arch/unix/apr_arch_inherit.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef INHERIT_H
    diff --git a/include/arch/unix/apr_arch_internal_time.h b/include/arch/unix/apr_arch_internal_time.h
    index a0541594e0c..99bbb60e1c1 100644
    --- a/include/arch/unix/apr_arch_internal_time.h
    +++ b/include/arch/unix/apr_arch_internal_time.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2001-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef TIME_INTERNAL_H
    diff --git a/include/arch/unix/apr_arch_misc.h b/include/arch/unix/apr_arch_misc.h
    index 36b9d5c1600..a7c9cfbdafc 100644
    --- a/include/arch/unix/apr_arch_misc.h
    +++ b/include/arch/unix/apr_arch_misc.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef MISC_H
    diff --git a/include/arch/unix/apr_arch_networkio.h b/include/arch/unix/apr_arch_networkio.h
    index ef50273547d..d85cf6f4d30 100644
    --- a/include/arch/unix/apr_arch_networkio.h
    +++ b/include/arch/unix/apr_arch_networkio.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef NETWORK_IO_H
    diff --git a/include/arch/unix/apr_arch_proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h
    index 0b52288cfae..4c7cd4e317e 100644
    --- a/include/arch/unix/apr_arch_proc_mutex.h
    +++ b/include/arch/unix/apr_arch_proc_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef PROC_MUTEX_H
    diff --git a/include/arch/unix/apr_arch_shm.h b/include/arch/unix/apr_arch_shm.h
    index 0dbd18da99e..6443163da93 100644
    --- a/include/arch/unix/apr_arch_shm.h
    +++ b/include/arch/unix/apr_arch_shm.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef SHM_H
    diff --git a/include/arch/unix/apr_arch_thread_cond.h b/include/arch/unix/apr_arch_thread_cond.h
    index 5ae50d1ee1b..14f3b9b6aec 100644
    --- a/include/arch/unix/apr_arch_thread_cond.h
    +++ b/include/arch/unix/apr_arch_thread_cond.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_COND_H
    diff --git a/include/arch/unix/apr_arch_thread_mutex.h b/include/arch/unix/apr_arch_thread_mutex.h
    index 0982a1528a5..0b2fb2192d3 100644
    --- a/include/arch/unix/apr_arch_thread_mutex.h
    +++ b/include/arch/unix/apr_arch_thread_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_MUTEX_H
    diff --git a/include/arch/unix/apr_arch_thread_rwlock.h b/include/arch/unix/apr_arch_thread_rwlock.h
    index ad79c11e32e..a21541ee17d 100644
    --- a/include/arch/unix/apr_arch_thread_rwlock.h
    +++ b/include/arch/unix/apr_arch_thread_rwlock.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2004 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_RWLOCK_H
    diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h
    index 38318174c1e..6173869b472 100644
    --- a/include/arch/unix/apr_arch_threadproc.h
    +++ b/include/arch/unix/apr_arch_threadproc.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/include/arch/win32/apr_arch_atime.h b/include/arch/win32/apr_arch_atime.h
    index 67acd72572b..dd4de786553 100644
    --- a/include/arch/win32/apr_arch_atime.h
    +++ b/include/arch/win32/apr_arch_atime.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef ATIME_H
    diff --git a/include/arch/win32/apr_arch_dso.h b/include/arch/win32/apr_arch_dso.h
    index deece8bcdee..6829d7993fd 100644
    --- a/include/arch/win32/apr_arch_dso.h
    +++ b/include/arch/win32/apr_arch_dso.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef DSO_H
    diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h
    index c5dd2103ff7..4e48a9416e9 100644
    --- a/include/arch/win32/apr_arch_file_io.h
    +++ b/include/arch/win32/apr_arch_file_io.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef FILE_IO_H
    diff --git a/include/arch/win32/apr_arch_inherit.h b/include/arch/win32/apr_arch_inherit.h
    index 6659df690d0..911f35d8c56 100644
    --- a/include/arch/win32/apr_arch_inherit.h
    +++ b/include/arch/win32/apr_arch_inherit.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef INHERIT_H
    diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h
    index 5ce8de30eae..171d8f7ca6b 100644
    --- a/include/arch/win32/apr_arch_misc.h
    +++ b/include/arch/win32/apr_arch_misc.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef MISC_H
    diff --git a/include/arch/win32/apr_arch_networkio.h b/include/arch/win32/apr_arch_networkio.h
    index 4aab1dc1380..0e18f08637f 100644
    --- a/include/arch/win32/apr_arch_networkio.h
    +++ b/include/arch/win32/apr_arch_networkio.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef NETWORK_IO_H
    diff --git a/include/arch/win32/apr_arch_proc_mutex.h b/include/arch/win32/apr_arch_proc_mutex.h
    index 259bac6e331..3e47b5e0431 100644
    --- a/include/arch/win32/apr_arch_proc_mutex.h
    +++ b/include/arch/win32/apr_arch_proc_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef PROC_MUTEX_H
    diff --git a/include/arch/win32/apr_arch_thread_cond.h b/include/arch/win32/apr_arch_thread_cond.h
    index 6f1f6fa070a..98b7adf63b7 100644
    --- a/include/arch/win32/apr_arch_thread_cond.h
    +++ b/include/arch/win32/apr_arch_thread_cond.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_COND_H
    diff --git a/include/arch/win32/apr_arch_thread_mutex.h b/include/arch/win32/apr_arch_thread_mutex.h
    index c8c38f59bfc..c801a871b2e 100644
    --- a/include/arch/win32/apr_arch_thread_mutex.h
    +++ b/include/arch/win32/apr_arch_thread_mutex.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_MUTEX_H
    diff --git a/include/arch/win32/apr_arch_thread_rwlock.h b/include/arch/win32/apr_arch_thread_rwlock.h
    index 8124fe1ff79..57feaf11561 100644
    --- a/include/arch/win32/apr_arch_thread_rwlock.h
    +++ b/include/arch/win32/apr_arch_thread_rwlock.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef THREAD_RWLOCK_H
    diff --git a/include/arch/win32/apr_arch_threadproc.h b/include/arch/win32/apr_arch_threadproc.h
    index 33f3fd28885..f4903f0f169 100644
    --- a/include/arch/win32/apr_arch_threadproc.h
    +++ b/include/arch/win32/apr_arch_threadproc.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_private.h"
    diff --git a/include/arch/win32/apr_arch_utf8.h b/include/arch/win32/apr_arch_utf8.h
    index 601d485be4e..cff076f365c 100644
    --- a/include/arch/win32/apr_arch_utf8.h
    +++ b/include/arch/win32/apr_arch_utf8.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef UTF8_H
    diff --git a/include/arch/win32/apr_dbg_win32_handles.h b/include/arch/win32/apr_dbg_win32_handles.h
    index fc6db561b26..04f6ef314f1 100644
    --- a/include/arch/win32/apr_dbg_win32_handles.h
    +++ b/include/arch/win32/apr_dbg_win32_handles.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_DBG_WIN32_HANDLES_H
    diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h
    index da476db552e..700d853cec2 100644
    --- a/include/arch/win32/apr_private.h
    +++ b/include/arch/win32/apr_private.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /*
    diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c
    index bf4d7c3e5dd..af99aa82d4c 100644
    --- a/locks/beos/proc_mutex.c
    +++ b/locks/beos/proc_mutex.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /*Read/Write locking implementation based on the MultiLock code from
    diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c
    index be5565b88d9..f759267e4b2 100644
    --- a/locks/beos/thread_cond.c
    +++ b/locks/beos/thread_cond.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "beos/apr_arch_thread_mutex.h"
    diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c
    index 99b4de8d298..38e0dfd07b0 100644
    --- a/locks/beos/thread_mutex.c
    +++ b/locks/beos/thread_mutex.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /*Read/Write locking implementation based on the MultiLock code from
    diff --git a/locks/beos/thread_rwlock.c b/locks/beos/thread_rwlock.c
    index 984f0edd2e3..df12cbaaed7 100644
    --- a/locks/beos/thread_rwlock.c
    +++ b/locks/beos/thread_rwlock.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /*Read/Write locking implementation based on the MultiLock code from
    diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c
    index 789f0f81edf..f05cde6dc5e 100644
    --- a/locks/netware/proc_mutex.c
    +++ b/locks/netware/proc_mutex.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c
    index 85debe2f156..3942b06f8a9 100644
    --- a/locks/netware/thread_cond.c
    +++ b/locks/netware/thread_cond.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c
    index d1c4f62bf5f..403e34285b1 100644
    --- a/locks/netware/thread_mutex.c
    +++ b/locks/netware/thread_mutex.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/locks/netware/thread_rwlock.c b/locks/netware/thread_rwlock.c
    index a1ba28b80d5..fdee923a054 100644
    --- a/locks/netware/thread_rwlock.c
    +++ b/locks/netware/thread_rwlock.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c
    index 3a3c848aab3..e88e35b1e71 100644
    --- a/locks/os2/proc_mutex.c
    +++ b/locks/os2/proc_mutex.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_general.h"
    diff --git a/locks/os2/thread_cond.c b/locks/os2/thread_cond.c
    index 439885d8b38..ce0150a21bd 100644
    --- a/locks/os2/thread_cond.c
    +++ b/locks/os2/thread_cond.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_general.h"
    diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c
    index f0d33520153..e7f22cbabc9 100644
    --- a/locks/os2/thread_mutex.c
    +++ b/locks/os2/thread_mutex.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_general.h"
    diff --git a/locks/os2/thread_rwlock.c b/locks/os2/thread_rwlock.c
    index de76db06db5..5938a934110 100644
    --- a/locks/os2/thread_rwlock.c
    +++ b/locks/os2/thread_rwlock.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_general.h"
    diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c
    index 9ee0f20de5b..a14673e31b0 100644
    --- a/locks/unix/global_mutex.c
    +++ b/locks/unix/global_mutex.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c
    index e02796fe0e1..b8b9ceaccb0 100644
    --- a/locks/unix/proc_mutex.c
    +++ b/locks/unix/proc_mutex.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c
    index 94f42268a97..4eaeaf35f5b 100644
    --- a/locks/unix/thread_cond.c
    +++ b/locks/unix/thread_cond.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c
    index 9f0d7cc5063..854213e4dd9 100644
    --- a/locks/unix/thread_mutex.c
    +++ b/locks/unix/thread_mutex.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_thread_mutex.h"
    diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c
    index 2cc682ebe9c..2a4c4731a7e 100644
    --- a/locks/unix/thread_rwlock.c
    +++ b/locks/unix/thread_rwlock.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2004 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_thread_rwlock.h"
    diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c
    index b490299ff05..b6e55d83f38 100644
    --- a/locks/win32/proc_mutex.c
    +++ b/locks/win32/proc_mutex.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c
    index f99b25dd351..218da537dee 100644
    --- a/locks/win32/thread_cond.c
    +++ b/locks/win32/thread_cond.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c
    index ef9074d86dc..125c2c2b6f3 100644
    --- a/locks/win32/thread_mutex.c
    +++ b/locks/win32/thread_mutex.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c
    index f5671ddbe47..c4ced1ea3b1 100644
    --- a/locks/win32/thread_rwlock.c
    +++ b/locks/win32/thread_rwlock.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
    index cc190a900e8..5368546794d 100644
    --- a/memory/unix/apr_pools.c
    +++ b/memory/unix/apr_pools.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/misc/netware/charset.c b/misc/netware/charset.c
    index d9f124a9813..7250bda7fef 100644
    --- a/misc/netware/charset.c
    +++ b/misc/netware/charset.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c
    index b40ffa59c08..6246e1e4a25 100644
    --- a/misc/netware/libprews.c
    +++ b/misc/netware/libprews.c
    @@ -1,13 +1,17 @@
    -/*------------------------------------------------------------------
    -  These functions are to be called when the shared NLM starts and
    -  stops.  By using these functions instead of defining a main()
    -  and calling ExitThread(TSR_THREAD, 0), the load time of the
    -  shared NLM is faster and memory size reduced.
    -   
    -  You may also want to override these in your own Apache module
    -  to do any cleanup other than the mechanism Apache modules
    -  provide.
    -------------------------------------------------------------------*/
    +/* Copyright  2004 The Apache Software Foundation
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
     #include 
     #include 
     #include 
    diff --git a/misc/netware/rand.c b/misc/netware/rand.c
    index 89a8f7a80ff..0a602b0c187 100644
    --- a/misc/netware/rand.c
    +++ b/misc/netware/rand.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #define APR_WANT_MEMFUNC
    diff --git a/misc/netware/start.c b/misc/netware/start.c
    index 9c2919f454d..ab011734829 100644
    --- a/misc/netware/start.c
    +++ b/misc/netware/start.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/misc/os2/randbyte.c b/misc/os2/randbyte.c
    index a584d8d342b..e5c9bcb4570 100644
    --- a/misc/os2/randbyte.c
    +++ b/misc/os2/randbyte.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /* The high resolution timer API provides access to the hardware timer 
    diff --git a/misc/unix/charset.c b/misc/unix/charset.c
    index df49c9e84e2..5e1842fac75 100644
    --- a/misc/unix/charset.c
    +++ b/misc/unix/charset.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/misc/unix/env.c b/misc/unix/env.c
    index b96be21cc88..25c8277aaed 100644
    --- a/misc/unix/env.c
    +++ b/misc/unix/env.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #define APR_WANT_STRFUNC
    diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c
    index 701a1510d8a..447b8d85908 100644
    --- a/misc/unix/errorcodes.c
    +++ b/misc/unix/errorcodes.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_misc.h"
    diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c
    index a930a75a1ba..17866ee8169 100644
    --- a/misc/unix/otherchild.c
    +++ b/misc/unix/otherchild.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/misc/unix/rand.c b/misc/unix/rand.c
    index 0e0683beb28..d29c5581d99 100644
    --- a/misc/unix/rand.c
    +++ b/misc/unix/rand.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #define APR_WANT_MEMFUNC
    diff --git a/misc/unix/start.c b/misc/unix/start.c
    index 2dce9831f46..8b6905d887b 100644
    --- a/misc/unix/start.c
    +++ b/misc/unix/start.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/misc/unix/version.c b/misc/unix/version.c
    index ffaee901c5e..90a2df7d7bd 100644
    --- a/misc/unix/version.c
    +++ b/misc/unix/version.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_version.h"
    diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c
    index acd49c6de58..c7a4b9348f3 100644
    --- a/misc/win32/apr_app.c
    +++ b/misc/win32/apr_app.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /* Usage Notes:
    diff --git a/misc/win32/charset.c b/misc/win32/charset.c
    index 24fc27159b2..7760fc3ff4f 100644
    --- a/misc/win32/charset.c
    +++ b/misc/win32/charset.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/misc/win32/env.c b/misc/win32/env.c
    index 4d005da2e86..3a3386b92d8 100644
    --- a/misc/win32/env.c
    +++ b/misc/win32/env.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #define APR_WANT_STRFUNC
    diff --git a/misc/win32/internal.c b/misc/win32/internal.c
    index 5f49a2bc650..48398dad256 100644
    --- a/misc/win32/internal.c
    +++ b/misc/win32/internal.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_private.h"
    diff --git a/misc/win32/misc.c b/misc/win32/misc.c
    index 4e2389c5992..f86746214f6 100644
    --- a/misc/win32/misc.c
    +++ b/misc/win32/misc.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_private.h"
    diff --git a/misc/win32/rand.c b/misc/win32/rand.c
    index 29999d61b14..ab53d0dcfff 100644
    --- a/misc/win32/rand.c
    +++ b/misc/win32/rand.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/misc/win32/start.c b/misc/win32/start.c
    index b2910add1ee..7e130afd1cf 100644
    --- a/misc/win32/start.c
    +++ b/misc/win32/start.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_private.h"
    diff --git a/misc/win32/utf8.c b/misc/win32/utf8.c
    index 399caaf6caa..f7b70cb87df 100644
    --- a/misc/win32/utf8.c
    +++ b/misc/win32/utf8.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/mmap/unix/common.c b/mmap/unix/common.c
    index 8c3555c7e54..05c753aec8e 100644
    --- a/mmap/unix/common.c
    +++ b/mmap/unix/common.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /* common .c
    diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c
    index 249b8c26bd6..44cdbedb05a 100644
    --- a/mmap/unix/mmap.c
    +++ b/mmap/unix/mmap.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c
    index 1e34ba259b5..36f99245e38 100644
    --- a/mmap/win32/mmap.c
    +++ b/mmap/win32/mmap.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c
    index 58bbced43df..1ba3fcd54a9 100644
    --- a/network_io/beos/sendrecv.c
    +++ b/network_io/beos/sendrecv.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_private.h"
    diff --git a/network_io/os2/os2calls.c b/network_io/os2/os2calls.c
    index fc011588d46..70d0ca5a9d0 100644
    --- a/network_io/os2/os2calls.c
    +++ b/network_io/os2/os2calls.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_networkio.h"
    diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c
    index 4983b897b7b..415c2a87d47 100644
    --- a/network_io/os2/sendrecv.c
    +++ b/network_io/os2/sendrecv.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_networkio.h"
    diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c
    index f296074581a..97358af7989 100644
    --- a/network_io/os2/sendrecv_udp.c
    +++ b/network_io/os2/sendrecv_udp.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_networkio.h"
    diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c
    index b58c046e71d..4ad89e51f17 100644
    --- a/network_io/os2/sockets.c
    +++ b/network_io/os2/sockets.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_networkio.h"
    diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c
    index 63f5c921158..afba0ca6f62 100644
    --- a/network_io/os2/sockopt.c
    +++ b/network_io/os2/sockopt.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_networkio.h"
    diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c
    index 95d3a904718..60fae1a885b 100644
    --- a/network_io/unix/sendrecv.c
    +++ b/network_io/unix/sendrecv.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_networkio.h"
    diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
    index a9337cbe663..348befc3b01 100644
    --- a/network_io/unix/sockaddr.c
    +++ b/network_io/unix/sockaddr.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_networkio.h"
    diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c
    index a2ae69a1ec4..20600b93ebe 100644
    --- a/network_io/unix/sockets.c
    +++ b/network_io/unix/sockets.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_networkio.h"
    diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c
    index 2f31bef69ae..9b70c8a415f 100644
    --- a/network_io/unix/sockopt.c
    +++ b/network_io/unix/sockopt.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_networkio.h"
    diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c
    index c5d6ec3de1b..bd2eb6e34b0 100644
    --- a/network_io/win32/sendrecv.c
    +++ b/network_io/win32/sendrecv.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_networkio.h"
    diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c
    index 55f31140fe1..00cb9ae5616 100644
    --- a/network_io/win32/sockets.c
    +++ b/network_io/win32/sockets.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_networkio.h"
    diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c
    index bcb5822eb29..86339da7962 100644
    --- a/network_io/win32/sockopt.c
    +++ b/network_io/win32/sockopt.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_networkio.h"
    diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c
    index f0a4dc38793..0da9ca426d3 100644
    --- a/passwd/apr_getpass.c
    +++ b/passwd/apr_getpass.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /* apr_password_get.c: abstraction to provide for obtaining a password from the
    diff --git a/poll/os2/poll.c b/poll/os2/poll.c
    index ed36dc8872b..a9f92b3daf2 100755
    --- a/poll/os2/poll.c
    +++ b/poll/os2/poll.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c
    index fd665e5c6ea..4c054c496dc 100644
    --- a/poll/os2/pollset.c
    +++ b/poll/os2/pollset.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/poll/unix/poll.c b/poll/unix/poll.c
    index 143c45f5c8f..c792d0a6546 100644
    --- a/poll/unix/poll.c
    +++ b/poll/unix/poll.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c
    index ca2d680ed4b..58b1f0d8767 100644
    --- a/shmem/beos/shm.c
    +++ b/shmem/beos/shm.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_general.h"
    diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c
    index b559132ca28..149a8737b6c 100644
    --- a/shmem/os2/shm.c
    +++ b/shmem/os2/shm.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_general.h"
    diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c
    index 278ef2c3d55..655fca98971 100644
    --- a/shmem/unix/shm.c
    +++ b/shmem/unix/shm.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_shm.h"
    diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c
    index 21a1c43891f..dc6d80e731d 100644
    --- a/shmem/win32/shm.c
    +++ b/shmem/win32/shm.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_general.h"
    diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c
    index dc82b2807d8..37a39c51a3b 100644
    --- a/strings/apr_cpystrn.c
    +++ b/strings/apr_cpystrn.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c
    index 7ac3d9b4796..b000eb8d12b 100644
    --- a/strings/apr_snprintf.c
    +++ b/strings/apr_snprintf.c
    @@ -1,59 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    - *
    - * The apr_vsnprintf/apr_snprintf functions are based on, and used with the
    - * permission of, the  SIO stdio-replacement strx_* functions by Panos
    - * Tsirigotis  for xinetd.
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/strings/apr_strings.c b/strings/apr_strings.c
    index 70e29ca945c..ee1c1f1c3a6 100644
    --- a/strings/apr_strings.c
    +++ b/strings/apr_strings.c
    @@ -1,56 +1,18 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    - *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +/*
      * Copyright (c) 1990, 1993
      *	The Regents of the University of California.  All rights reserved.
      *
    diff --git a/strings/apr_strtok.c b/strings/apr_strtok.c
    index 1646e7a9f9c..e1b44a9d707 100644
    --- a/strings/apr_strtok.c
    +++ b/strings/apr_strtok.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifdef HAVE_STDDEF_H
    diff --git a/support/unix/waitio.c b/support/unix/waitio.c
    index be918b13d5b..dae9e38135b 100644
    --- a/support/unix/waitio.c
    +++ b/support/unix/waitio.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_file_io.h"
    diff --git a/tables/apr_hash.c b/tables/apr_hash.c
    index 153b96eb764..42a860d353f 100644
    --- a/tables/apr_hash.c
    +++ b/tables/apr_hash.c
    @@ -1,59 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    - *
    - * Portions of this software are based upon public domain software
    - * originally written at the National Center for Supercomputing Applications,
    - * University of Illinois, Urbana-Champaign.
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_private.h"
    diff --git a/tables/apr_tables.c b/tables/apr_tables.c
    index 092bb3f68a0..7b208691c2d 100644
    --- a/tables/apr_tables.c
    +++ b/tables/apr_tables.c
    @@ -1,56 +1,17 @@
     #include 
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /*
    diff --git a/test/aprtest.h b/test/aprtest.h
    index 16374ea8059..941ae3cfe5a 100644
    --- a/test/aprtest.h
    +++ b/test/aprtest.h
    @@ -1,55 +1,16 @@
    - /* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_errno.h"
    diff --git a/test/client.c b/test/client.c
    index 2c10fe933d7..fa1a1ee05a3 100644
    --- a/test/client.c
    +++ b/test/client.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/test/internal/testregex.c b/test/internal/testregex.c
    index 2efdd28517b..3b68a4019b1 100644
    --- a/test/internal/testregex.c
    +++ b/test/internal/testregex.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     
    diff --git a/test/internal/testucs.c b/test/internal/testucs.c
    index ffe2562605f..9212538eb97 100644
    --- a/test/internal/testucs.c
    +++ b/test/internal/testucs.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2002-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/test/mod_test.c b/test/mod_test.c
    index 7e05f157ebe..3b4c12f66bf 100644
    --- a/test/mod_test.c
    +++ b/test/mod_test.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_strings.h"
    diff --git a/test/readchild.c b/test/readchild.c
    index e20f6a3b60a..2cc274591da 100644
    --- a/test/readchild.c
    +++ b/test/readchild.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/test/sendfile.c b/test/sendfile.c
    index 78cc6c2f554..1ee1adc83a2 100644
    --- a/test/sendfile.c
    +++ b/test/sendfile.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/test/server.c b/test/server.c
    index fabd81b2cce..bce87f8b6f9 100644
    --- a/test/server.c
    +++ b/test/server.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #define APR_TEST_PREFIX "server: "
    diff --git a/test/test_apr.h b/test/test_apr.h
    index 2af2e1c6353..14150279b4d 100644
    --- a/test/test_apr.h
    +++ b/test/test_apr.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_TEST_INCLUDES
    diff --git a/test/testall.c b/test/testall.c
    index 169188d9eff..70e626b2e28 100644
    --- a/test/testall.c
    +++ b/test/testall.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/test/testargs.c b/test/testargs.c
    index e266dd0b8b6..a3dc4416f33 100644
    --- a/test/testargs.c
    +++ b/test/testargs.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_errno.h"
    diff --git a/test/testatomic.c b/test/testatomic.c
    index e05a783c96d..d0955489b64 100644
    --- a/test/testatomic.c
    +++ b/test/testatomic.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/test/testdir.c b/test/testdir.c
    index 3791d56ebec..948be533b4c 100644
    --- a/test/testdir.c
    +++ b/test/testdir.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/test/testdso.c b/test/testdso.c
    index dd69a7d5954..1316821da92 100644
    --- a/test/testdso.c
    +++ b/test/testdso.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     
    diff --git a/test/testdup.c b/test/testdup.c
    index 4d9895257db..166164f548c 100644
    --- a/test/testdup.c
    +++ b/test/testdup.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     
    diff --git a/test/testenv.c b/test/testenv.c
    index e1ec7c00e23..07a2d59c873 100644
    --- a/test/testenv.c
    +++ b/test/testenv.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_env.h"
    diff --git a/test/testfile.c b/test/testfile.c
    index 0bd4af9e089..1305efc10fe 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_file_io.h"
    diff --git a/test/testfileinfo.c b/test/testfileinfo.c
    index 6788d5c185f..0c1149f08ea 100644
    --- a/test/testfileinfo.c
    +++ b/test/testfileinfo.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_file_io.h"
    diff --git a/test/testflock.c b/test/testflock.c
    index 898e7dc3a36..35e94794d27 100644
    --- a/test/testflock.c
    +++ b/test/testflock.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /*
    diff --git a/test/testfmt.c b/test/testfmt.c
    index 299b1bc7950..f01858d6963 100644
    --- a/test/testfmt.c
    +++ b/test/testfmt.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "test_apr.h"
    diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c
    index 32f9f8acad4..9eba4073fe7 100644
    --- a/test/testglobalmutex.c
    +++ b/test/testglobalmutex.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_shm.h"
    diff --git a/test/testhash.c b/test/testhash.c
    index 8f881341793..078b76ac7be 100644
    --- a/test/testhash.c
    +++ b/test/testhash.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "test_apr.h"
    diff --git a/test/testipsub.c b/test/testipsub.c
    index 39712a62649..63d56783ee6 100644
    --- a/test/testipsub.c
    +++ b/test/testipsub.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "test_apr.h"
    diff --git a/test/testlock.c b/test/testlock.c
    index d1b9b3adb88..0bd226a465c 100644
    --- a/test/testlock.c
    +++ b/test/testlock.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_thread_proc.h"
    diff --git a/test/testlockperf.c b/test/testlockperf.c
    index 911c94eb20d..1ebaa552dad 100644
    --- a/test/testlockperf.c
    +++ b/test/testlockperf.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_thread_proc.h"
    diff --git a/test/testmmap.c b/test/testmmap.c
    index e1628ea941a..60e74c73d66 100644
    --- a/test/testmmap.c
    +++ b/test/testmmap.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "test_apr.h"
    diff --git a/test/testmutexscope.c b/test/testmutexscope.c
    index 99a97805b71..87c135dad56 100644
    --- a/test/testmutexscope.c
    +++ b/test/testmutexscope.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/test/testnames.c b/test/testnames.c
    index 3c5e3dfa29e..e2166a8eb26 100644
    --- a/test/testnames.c
    +++ b/test/testnames.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "test_apr.h"
    diff --git a/test/testoc.c b/test/testoc.c
    index 33d39c3de08..58f891dddbe 100644
    --- a/test/testoc.c
    +++ b/test/testoc.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "test_apr.h"
    diff --git a/test/testpath.c b/test/testpath.c
    index 81efecea2ff..5dd81ef80ec 100644
    --- a/test/testpath.c
    +++ b/test/testpath.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "test_apr.h"
    diff --git a/test/testpipe.c b/test/testpipe.c
    index c66fe67b7f1..56749de09a5 100644
    --- a/test/testpipe.c
    +++ b/test/testpipe.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/test/testpoll.c b/test/testpoll.c
    index c3c20ed85fc..440d0a03054 100644
    --- a/test/testpoll.c
    +++ b/test/testpoll.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "test_apr.h"
    diff --git a/test/testpools.c b/test/testpools.c
    index cdfa6286a3c..f77670653cb 100644
    --- a/test/testpools.c
    +++ b/test/testpools.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     
    diff --git a/test/testproc.c b/test/testproc.c
    index 4bd22384520..b000526fd96 100644
    --- a/test/testproc.c
    +++ b/test/testproc.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_thread_proc.h"
    diff --git a/test/testprocmutex.c b/test/testprocmutex.c
    index 895a5df7bda..4caa10d1e3f 100644
    --- a/test/testprocmutex.c
    +++ b/test/testprocmutex.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_shm.h"
    diff --git a/test/testrand.c b/test/testrand.c
    index 13fa08e7b79..0c5dfc61cdf 100644
    --- a/test/testrand.c
    +++ b/test/testrand.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_general.h"
    diff --git a/test/testshm.c b/test/testshm.c
    index c2d9c3afcd5..236f68c01fd 100644
    --- a/test/testshm.c
    +++ b/test/testshm.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_shm.h"
    diff --git a/test/testshmconsumer.c b/test/testshmconsumer.c
    index f734cede83b..3aaa5f2ead6 100644
    --- a/test/testshmconsumer.c
    +++ b/test/testshmconsumer.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_shm.h"
    diff --git a/test/testshmproducer.c b/test/testshmproducer.c
    index 33b05813d21..83b086148d7 100644
    --- a/test/testshmproducer.c
    +++ b/test/testshmproducer.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_shm.h"
    diff --git a/test/testsleep.c b/test/testsleep.c
    index d2a3f7ca306..cd0dab19935 100644
    --- a/test/testsleep.c
    +++ b/test/testsleep.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "time.h"
    diff --git a/test/testsock.c b/test/testsock.c
    index d9ec30499ae..6506f04670d 100644
    --- a/test/testsock.c
    +++ b/test/testsock.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/test/testsockets.c b/test/testsockets.c
    index 165cfc29f6a..24b667fcf29 100644
    --- a/test/testsockets.c
    +++ b/test/testsockets.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_network_io.h"
    diff --git a/test/testsockopt.c b/test/testsockopt.c
    index 27c9e0f9cea..2dad2c6ef8f 100644
    --- a/test/testsockopt.c
    +++ b/test/testsockopt.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_network_io.h"
    diff --git a/test/teststr.c b/test/teststr.c
    index 7769e827137..4e538478ded 100644
    --- a/test/teststr.c
    +++ b/test/teststr.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "test_apr.h"
    diff --git a/test/testtable.c b/test/testtable.c
    index 8e7c35eb80c..ea2dec6528f 100644
    --- a/test/testtable.c
    +++ b/test/testtable.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2002-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "test_apr.h"
    diff --git a/test/testthread.c b/test/testthread.c
    index ecc9f476aa8..8d29b95d7cd 100644
    --- a/test/testthread.c
    +++ b/test/testthread.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_thread_proc.h"
    diff --git a/test/testtime.c b/test/testtime.c
    index 2694e4769da..ab14cdfe3a9 100644
    --- a/test/testtime.c
    +++ b/test/testtime.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_time.h"
    diff --git a/test/testud.c b/test/testud.c
    index 3fd86d534e0..0f8737becb6 100644
    --- a/test/testud.c
    +++ b/test/testud.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/test/testuser.c b/test/testuser.c
    index 5bac1d2c986..ed944903b4d 100644
    --- a/test/testuser.c
    +++ b/test/testuser.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2004 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "test_apr.h"
    diff --git a/test/testvsn.c b/test/testvsn.c
    index 69854a58767..2e44ffe7099 100644
    --- a/test/testvsn.c
    +++ b/test/testvsn.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/threadproc/beos/apr_proc_stub.c b/threadproc/beos/apr_proc_stub.c
    index b08dcc456a3..dce3add7315 100644
    --- a/threadproc/beos/apr_proc_stub.c
    +++ b/threadproc/beos/apr_proc_stub.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include 
    diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c
    index 031debc6054..ff6ac1e0da9 100644
    --- a/threadproc/beos/proc.c
    +++ b/threadproc/beos/proc.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_threadproc.h"
    diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c
    index c2fb25ba5ad..80ec13a6dd7 100644
    --- a/threadproc/beos/thread.c
    +++ b/threadproc/beos/thread.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_threadproc.h"
    diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c
    index 0c89688ef21..5f1077762b9 100644
    --- a/threadproc/beos/threadpriv.c
    +++ b/threadproc/beos/threadpriv.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_threadproc.h"
    diff --git a/threadproc/beos/threadproc_common.c b/threadproc/beos/threadproc_common.c
    index f6980fafdcf..04ea270deaa 100644
    --- a/threadproc/beos/threadproc_common.c
    +++ b/threadproc/beos/threadproc_common.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     /* As the signal code is identical, use the unix version to reduce
    diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c
    index 35fb5fa05bb..dce5758f758 100644
    --- a/threadproc/netware/proc.c
    +++ b/threadproc/netware/proc.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_threadproc.h"
    diff --git a/threadproc/netware/procsup.c b/threadproc/netware/procsup.c
    index 7e88633dae8..6bd4c9183b8 100644
    --- a/threadproc/netware/procsup.c
    +++ b/threadproc/netware/procsup.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_threadproc.h"
    diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c
    index 96c87868aad..3ef521003d4 100644
    --- a/threadproc/netware/signals.c
    +++ b/threadproc/netware/signals.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_threadproc.h"
    diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c
    index 192ad40556c..374b0d3390c 100644
    --- a/threadproc/netware/thread.c
    +++ b/threadproc/netware/thread.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/threadproc/netware/threadpriv.c b/threadproc/netware/threadpriv.c
    index e78b1c97138..7f7297dd142 100644
    --- a/threadproc/netware/threadpriv.c
    +++ b/threadproc/netware/threadpriv.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_portable.h"
    diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c
    index 0353000bd38..8fa508fef45 100644
    --- a/threadproc/os2/proc.c
    +++ b/threadproc/os2/proc.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #define INCL_DOS
    diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c
    index 52a485647d6..d9cc23210bd 100644
    --- a/threadproc/os2/thread.c
    +++ b/threadproc/os2/thread.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #define INCL_DOSERRORS
    diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c
    index f8bd470a3ca..4e5de448083 100644
    --- a/threadproc/os2/threadpriv.c
    +++ b/threadproc/os2/threadpriv.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_threadproc.h"
    diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
    index 786596c7311..ab5018cf64c 100644
    --- a/threadproc/unix/proc.c
    +++ b/threadproc/unix/proc.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_threadproc.h"
    diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c
    index 25dbde658d0..a787f5308be 100644
    --- a/threadproc/unix/procsup.c
    +++ b/threadproc/unix/procsup.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_arch_threadproc.h"
    diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c
    index 2ff3007c06a..ae87a861b0d 100644
    --- a/threadproc/unix/signals.c
    +++ b/threadproc/unix/signals.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #define INCL_DOSEXCEPTIONS      /* for OS2 */
    diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c
    index 68a59758c7d..6997e75df31 100644
    --- a/threadproc/unix/thread.c
    +++ b/threadproc/unix/thread.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c
    index 056f509d8af..5fbc450a6d4 100644
    --- a/threadproc/unix/threadpriv.c
    +++ b/threadproc/unix/threadpriv.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c
    index ed52f314b56..777367304b0 100644
    --- a/threadproc/win32/proc.c
    +++ b/threadproc/win32/proc.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "win32/apr_arch_threadproc.h"
    diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c
    index a94ad3a2e11..6fab4fabf9d 100644
    --- a/threadproc/win32/signals.c
    +++ b/threadproc/win32/signals.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "win32/apr_arch_threadproc.h"
    diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c
    index e470710dd8d..da36c3d837b 100644
    --- a/threadproc/win32/thread.c
    +++ b/threadproc/win32/thread.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_private.h"
    diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c
    index e2ae89c1fdb..17687169d9f 100644
    --- a/threadproc/win32/threadpriv.c
    +++ b/threadproc/win32/threadpriv.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "win32/apr_arch_threadproc.h"
    diff --git a/time/unix/time.c b/time/unix/time.c
    index d2e55f0a7d9..1af56e64383 100644
    --- a/time/unix/time.c
    +++ b/time/unix/time.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_portable.h"
    diff --git a/time/unix/timestr.c b/time/unix/timestr.c
    index 1d7cd1b1324..b7a90164e23 100644
    --- a/time/unix/timestr.c
    +++ b/time/unix/timestr.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_portable.h"
    diff --git a/time/win32/access.c b/time/win32/access.c
    index 6d48b836cd2..99e749b2351 100644
    --- a/time/win32/access.c
    +++ b/time/win32/access.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "win32/apr_arch_atime.h"
    diff --git a/time/win32/time.c b/time/win32/time.c
    index 3652828781e..59ffcc43e1d 100644
    --- a/time/win32/time.c
    +++ b/time/win32/time.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "win32/apr_arch_atime.h"
    diff --git a/time/win32/timestr.c b/time/win32/timestr.c
    index 6c93c629095..f556054f3cc 100644
    --- a/time/win32/timestr.c
    +++ b/time/win32/timestr.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "win32/apr_arch_atime.h"
    diff --git a/user/netware/groupinfo.c b/user/netware/groupinfo.c
    index d2e45140237..ad19147966a 100644
    --- a/user/netware/groupinfo.c
    +++ b/user/netware/groupinfo.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_strings.h"
    diff --git a/user/netware/userinfo.c b/user/netware/userinfo.c
    index fd0c65a032d..a5cdf3f7787 100644
    --- a/user/netware/userinfo.c
    +++ b/user/netware/userinfo.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_strings.h"
    diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c
    index 62e576715b7..18d13b1efa6 100644
    --- a/user/unix/groupinfo.c
    +++ b/user/unix/groupinfo.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_strings.h"
    diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c
    index 7b0c3440ff1..dfd34c528be 100644
    --- a/user/unix/userinfo.c
    +++ b/user/unix/userinfo.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_strings.h"
    diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c
    index bfd38b63e3e..f12102b16da 100644
    --- a/user/win32/groupinfo.c
    +++ b/user/win32/groupinfo.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_strings.h"
    diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c
    index e6977b86378..caf676b9306 100644
    --- a/user/win32/userinfo.c
    +++ b/user/win32/userinfo.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr_private.h"
    
    From 76ab4a34ef8b37352ae7af134737e2836d3a338b Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Sun, 15 Feb 2004 16:36:32 +0000
    Subject: [PATCH 4832/7878] * build/gen-build.py: Fix VPATH build for fresh
     checkouts: ensure that all the necessary directories exist in the build tree.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64905 13f79535-47bb-0310-9956-ffa450edef68
    ---
     .cvsignore         |  1 +
     build/gen-build.py | 18 +++++++++++++++++-
     2 files changed, 18 insertions(+), 1 deletion(-)
    
    diff --git a/.cvsignore b/.cvsignore
    index 845f11c8ba5..f375cee181f 100644
    --- a/.cvsignore
    +++ b/.cvsignore
    @@ -33,3 +33,4 @@ BuildLog.htm
     autom4te.cache
     ltcf-c.sh
     build-outputs.mk
    +.make.dirs
    diff --git a/build/gen-build.py b/build/gen-build.py
    index 1865585f596..f45fbcdd9a7 100755
    --- a/build/gen-build.py
    +++ b/build/gen-build.py
    @@ -50,12 +50,28 @@ def main():
         for hdr in deps.keys():
           deps.update(h_deps.get(hdr, {}))
     
    -    f.write('%s: %s include/%s\n' % (obj, file, string.join(deps.keys(), ' include/')))
    +    f.write('%s: %s .make.dirs include/%s\n' % (obj, file, string.join(deps.keys(), ' include/')))
     
       f.write('\nOBJECTS = %s\n\n' % string.join(objects))
       f.write('HEADERS = $(top_srcdir)/%s\n\n' % string.join(headers, ' $(top_srcdir)/'))
       f.write('SOURCE_DIRS = %s $(EXTRA_SOURCE_DIRS)\n\n' % string.join(dirs.keys()))
     
    +  # Build a list of all necessary directories in build tree
    +  alldirs = { }
    +  for dir in dirs:
    +    d = dir
    +    while d:
    +      alldirs[d] = None
    +      d = os.path.dirname(d)
    +
    +  # Sort so 'foo' is before 'foo/bar'
    +  keys = alldirs.keys()
    +  keys.sort()
    +  f.write('BUILD_DIRS = %s\n\n' % string.join(keys))
    +
    +  f.write('.make.dirs: $(top_srcdir)/build-outputs.mk\n' \
    +          '\t@for d in $(BUILD_DIRS); do test -d $$d || mkdir $$d; done\n' \
    +          '\t@echo timestamp > $@\n')
     
     def extract_deps(fname, legal_deps):
       "Extract the headers this file includes."
    
    From 4603b3af267302b63b7b9b1d691ac1ffeca0d6d3 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Sun, 15 Feb 2004 16:43:12 +0000
    Subject: [PATCH 4833/7878] * build/gen-build.py: Use srcdir not top_srcdir in
     path to build-outputs.mk since apr-util/Makefile does not define the latter.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64906 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/gen-build.py | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/build/gen-build.py b/build/gen-build.py
    index f45fbcdd9a7..b98c51f5fea 100755
    --- a/build/gen-build.py
    +++ b/build/gen-build.py
    @@ -69,7 +69,7 @@ def main():
       keys.sort()
       f.write('BUILD_DIRS = %s\n\n' % string.join(keys))
     
    -  f.write('.make.dirs: $(top_srcdir)/build-outputs.mk\n' \
    +  f.write('.make.dirs: $(srcdir)/build-outputs.mk\n' \
               '\t@for d in $(BUILD_DIRS); do test -d $$d || mkdir $$d; done\n' \
               '\t@echo timestamp > $@\n')
     
    
    From 379553b0da2f01c53f17435ded4294cf99ab8763 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Sun, 15 Feb 2004 17:03:41 +0000
    Subject: [PATCH 4834/7878] * build/buildcheck.sh: Determine Python version
     correctly for Python 1.x.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64907 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/buildcheck.sh | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/build/buildcheck.sh b/build/buildcheck.sh
    index d2d6625c52f..728cd02cc6c 100755
    --- a/build/buildcheck.sh
    +++ b/build/buildcheck.sh
    @@ -10,7 +10,7 @@ echo "           You need python installed"
     echo "           to build APR from CVS."
     exit 1
     else
    -py_version=`python -V 2>&1|sed -e 's/^[^0-9]*//'`
    +py_version=`python -c 'import sys; print sys.version' 2>&1|sed 's/ .*//;q'`
     echo "buildconf: python version $py_version (ok)"
     fi
     
    
    From 5a93e404c057db46cffe093a2ec845f9afdc296f Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Sun, 15 Feb 2004 17:09:42 +0000
    Subject: [PATCH 4835/7878] * Makefile.in: Clean .make.dirs.
    
    * build/gen-build.py: Fix for Python 1.x.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64908 13f79535-47bb-0310-9956-ffa450edef68
    ---
     Makefile.in        | 2 +-
     build/gen-build.py | 2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/Makefile.in b/Makefile.in
    index 12944caed37..11fe93a3459 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -38,7 +38,7 @@ TARGETS = $(TARGET_LIB) export_vars.h apr.exp
     @INCLUDE_RULES@
     @INCLUDE_OUTPUTS@
     
    -CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.h
    +CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.h .make.dirs
     DISTCLEAN_TARGETS = config.cache config.log config.status \
     	include/apr.h include/arch/unix/apr_private.h \
     	libtool apr-config build/apr_rules.mk
    diff --git a/build/gen-build.py b/build/gen-build.py
    index b98c51f5fea..983693c1bb0 100755
    --- a/build/gen-build.py
    +++ b/build/gen-build.py
    @@ -58,7 +58,7 @@ def main():
     
       # Build a list of all necessary directories in build tree
       alldirs = { }
    -  for dir in dirs:
    +  for dir in dirs.keys():
         d = dir
         while d:
           alldirs[d] = None
    
    From 447903653c84c37df1b4d9196c61aa2cd95a6a08 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Sun, 15 Feb 2004 21:06:33 +0000
    Subject: [PATCH 4836/7878] * build/gen-build.py: Use values in deps
     dictionaries to store full pathname of the headers.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64909 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/gen-build.py | 11 +++++++----
     1 file changed, 7 insertions(+), 4 deletions(-)
    
    diff --git a/build/gen-build.py b/build/gen-build.py
    index 983693c1bb0..3c92b2c127c 100755
    --- a/build/gen-build.py
    +++ b/build/gen-build.py
    @@ -28,7 +28,10 @@ def main():
       headers = get_files(parser.get('options', 'headers'))
     
       # compute the relevant headers, along with the implied includes
    -  legal_deps = map(os.path.basename, headers)
    +  legal_deps = { }
    +  for fname in headers:
    +    legal_deps[os.path.basename(fname)] = fname
    +
       h_deps = { }
       for fname in headers:
         h_deps[os.path.basename(fname)] = extract_deps(fname, legal_deps)
    @@ -50,7 +53,7 @@ def main():
         for hdr in deps.keys():
           deps.update(h_deps.get(hdr, {}))
     
    -    f.write('%s: %s .make.dirs include/%s\n' % (obj, file, string.join(deps.keys(), ' include/')))
    +    f.write('%s: %s .make.dirs %s\n' % (obj, file, string.join(deps.values())))
     
       f.write('\nOBJECTS = %s\n\n' % string.join(objects))
       f.write('HEADERS = $(top_srcdir)/%s\n\n' % string.join(headers, ' $(top_srcdir)/'))
    @@ -80,8 +83,8 @@ def extract_deps(fname, legal_deps):
         if line[:8] != '#include':
           continue
         inc = _re_include.match(line).group(1)
    -    if inc in legal_deps:
    -      deps[inc] = None
    +    if inc in legal_deps.keys():
    +      deps[inc] = legal_deps[inc]
       return deps
     _re_include = re.compile('#include *["<](.*)[">]')
     
    
    From ddba5cfbcb6d45c8a1fb76c5a6446e8fc1fd19c8 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 18 Feb 2004 10:15:58 +0000
    Subject: [PATCH 4837/7878] remove Apache-specific changes for zSeries from
     APR's config.sub/config.guess
    
    potentially affected platforms are
    
    . z/OS a.k.a. OS/390 a.k.a. MVS
      Apache and APR on this OS use a non-standard libtool which includes and
      forces the use of its own copy of config.sub and config.guess, so there
      is no immediate breakage
    
    . TPF
      dunno if anybody builds APR there
    
    . VM/CMS
      dunno if anybody builds APR there
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64910 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/config.guess |  6 ------
     build/config.sub   | 16 +---------------
     2 files changed, 1 insertion(+), 21 deletions(-)
    
    diff --git a/build/config.guess b/build/config.guess
    index 6cfac28c854..2d285ae1fa5 100755
    --- a/build/config.guess
    +++ b/build/config.guess
    @@ -301,12 +301,6 @@ EOF
     #########################
     # Apache changes
     #
    -#   *:OS/390:*:*)
    -#      echo i370-ibm-openedition
    -#      exit 0 ;;
    -    *:OS390:*:* | *:OS/390:*:*)
    -       echo s390-ibm-os390
    -       exit 0 ;; 
         *:OS400:*:* | *:OS/400:*:*) 
            echo as400-ibm-os400
            exit 0 ;;
    diff --git a/build/config.sub b/build/config.sub
    index 043d45b3982..fc44869d4dc 100755
    --- a/build/config.sub
    +++ b/build/config.sub
    @@ -130,18 +130,10 @@ case $maybe_os in
     ########################
     # changes for Apache
     #
    -  tpf | os390 | vmcms)
    -    os=-$maybe_os
    -    basic_machine=s390;
    -    ;;
       os400)
         os=-$maybe_os
         basic_machine=as400;
         ;;
    -  mvs)
    -    os=-mvs
    -    basic_machine=i370;
    -    ;;
     #
     # end Apache changes
     ########################
    @@ -1103,7 +1095,7 @@ case $os in
     ########################
     # changes for Apache
     #
    -	-os2_emx | -tpf* | -os390* | -vmcms* | -os400* )
    +	-os2_emx | -os400* )
             	;;
     #
     # end Apache changes
    @@ -1320,12 +1312,6 @@ case $basic_machine in
     #
     	*-ibm)
     		case $basic_machine in
    -			s390*)
    -				os=-os390;
    -				;;
    -			i370*)
    -				os=-mvs;
    -				;;
     			as400*)
     				os=-os400;
     				;;
    
    From 1521b71d6d7a9ee4bcf2b13c5716a68561b089a0 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Wed, 18 Feb 2004 10:39:09 +0000
    Subject: [PATCH 4838/7878] Revert to using i386-pc-os2-emx on OS/2 rather than
     non-standard ...-os2_emx; entirely untested:
    
    * configure.in, build/apr_hints.m4: Match OS/2 by "*-os2*".
    
    * build/config.sub, build/config.guess: Remove customisations for
    *-os2.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64911 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_hints.m4 | 2 +-
     build/config.guess | 3 ---
     build/config.sub   | 2 +-
     configure.in       | 4 ++--
     4 files changed, 4 insertions(+), 7 deletions(-)
    
    diff --git a/build/apr_hints.m4 b/build/apr_hints.m4
    index e124ca18c45..30fce1616cc 100644
    --- a/build/apr_hints.m4
    +++ b/build/apr_hints.m4
    @@ -70,7 +70,7 @@ if test "x$apr_preload_done" != "xyes" ; then
         *-dg-dgux*)
     	APR_ADDTO(CPPFLAGS, [-DDGUX])
     	;;
    -    *os2_emx*)
    +    *-os2*)
     	APR_SETVAR(SHELL, [sh])
     	APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
     	APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
    diff --git a/build/config.guess b/build/config.guess
    index 2d285ae1fa5..d1f30a9e489 100755
    --- a/build/config.guess
    +++ b/build/config.guess
    @@ -304,9 +304,6 @@ EOF
         *:OS400:*:* | *:OS/400:*:*) 
            echo as400-ibm-os400
            exit 0 ;;
    -    *:OS/2:*:*)
    -       echo "i386-pc-os2_emx"
    -       exit 0;;
     #
     # end Apache changes
     #########################
    diff --git a/build/config.sub b/build/config.sub
    index fc44869d4dc..0d6cce6c95b 100755
    --- a/build/config.sub
    +++ b/build/config.sub
    @@ -1095,7 +1095,7 @@ case $os in
     ########################
     # changes for Apache
     #
    -	-os2_emx | -os400* )
    +	-os400* )
             	;;
     #
     # end Apache changes
    diff --git a/configure.in b/configure.in
    index d05d64710df..956bfd16105 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -139,7 +139,7 @@ AC_ARG_ENABLE(experimental-libtool,[  --experimental-libtool Use experimental cu
       [experimental_libtool=$enableval],[experimental_libtool=no])
     
     case $host in
    -*os2*)
    +*-os2*)
         # Use a custom-made libtool replacement
         echo "using aplibtool"
         LIBTOOL="$srcdir/build/aplibtool"
    @@ -1196,7 +1196,7 @@ case $host in
        s390*linux*)
            size_t_fmt='#define APR_SIZE_T_FMT "ld"'
            ;;
    -   *os2_emx)
    +   *-os2*)
            off_t_fmt='#define APR_OFF_T_FMT "ld"'
            size_t_fmt='#define APR_SIZE_T_FMT "lu"'
            ;;
    
    From aae8e2f42ca9fa5ee20576f8a93b5652b2c903d6 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Thu, 19 Feb 2004 09:55:12 +0000
    Subject: [PATCH 4839/7878] * include/apr_file_info.h: Remove misleading
     @remark about dot/dot-dot entries returned by apr_dir_read(); reported by
     Philip Martin.
    
    * test/testdir.c (test_readdir_onedot, test_readdir_twodot): Remove
    tests.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64912 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_file_info.h |  2 +-
     test/testdir.c          | 61 +++++++----------------------------------
     2 files changed, 11 insertions(+), 52 deletions(-)
    
    diff --git a/include/apr_file_info.h b/include/apr_file_info.h
    index fb113f3a0d3..c608fb8788e 100644
    --- a/include/apr_file_info.h
    +++ b/include/apr_file_info.h
    @@ -237,7 +237,7 @@ APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir);
      * @param finfo the file info structure and filled in by apr_dir_read
      * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values 
      * @param thedir the directory descriptor returned from apr_dir_open
    - * @remark All systems return . and .. as the first two files.
    + * @remark No ordering is guaranteed for the entries read.
      */                        
     APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
                                            apr_dir_t *thedir);
    diff --git a/test/testdir.c b/test/testdir.c
    index 948be533b4c..09c41802282 100644
    --- a/test/testdir.c
    +++ b/test/testdir.c
    @@ -144,63 +144,24 @@ static void test_closedir(CuTest *tc)
         CuAssertIntEquals(tc, APR_SUCCESS, rv);
     }
     
    -static void test_readdir_onedot(CuTest *tc)
    -{
    -    apr_status_t rv;
    -    apr_dir_t *dir;
    -    apr_finfo_t finfo;
    -
    -    rv = apr_dir_open(&dir, "data", p);
    -    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -
    -    rv = apr_dir_read(&finfo, APR_FINFO_DIRENT, dir);
    -    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, ".", finfo.name);
    -
    -    rv = apr_dir_close(dir);
    -    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -}
    -
    -static void test_readdir_twodot(CuTest *tc)
    -{
    -    apr_status_t rv;
    -    apr_dir_t *dir;
    -    apr_finfo_t finfo;
    -
    -    rv = apr_dir_open(&dir, "data", p);
    -    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -
    -    rv = apr_dir_read(&finfo, APR_FINFO_DIRENT, dir);
    -    rv = apr_dir_read(&finfo, APR_FINFO_DIRENT, dir);
    -    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, "..", finfo.name);
    -
    -    rv = apr_dir_close(dir);
    -    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -}
    -
     static void test_rewind(CuTest *tc)
     {
    -    apr_status_t rv;
         apr_dir_t *dir;
    -    apr_finfo_t finfo;
    +    apr_finfo_t first, second;
     
    -    rv = apr_dir_open(&dir, "data", p);
    -    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    apr_assert_success(tc, "apr_dir_open failed", apr_dir_open(&dir, "data", p));
     
    -    rv = apr_dir_read(&finfo, APR_FINFO_DIRENT, dir);
    -    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, ".", finfo.name);
    +    apr_assert_success(tc, "apr_dir_read failed",
    +                       apr_dir_read(&first, APR_FINFO_DIRENT, dir));
     
    -    rv = apr_dir_rewind(dir);
    -    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    apr_assert_success(tc, "apr_dir_rewind failed", apr_dir_rewind(dir));
     
    -    rv = apr_dir_read(&finfo, APR_FINFO_DIRENT, dir);
    -    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    CuAssertStrEquals(tc, ".", finfo.name);
    +    apr_assert_success(tc, "second apr_dir_read failed",
    +                       apr_dir_read(&second, APR_FINFO_DIRENT, dir));
     
    -    rv = apr_dir_close(dir);
    -    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    apr_assert_success(tc, "apr_dir_close failed", apr_dir_close(dir));
    +
    +    CuAssertStrEquals(tc, first.name, second.name);
     }
     
     /* Test for a (fixed) bug in apr_dir_read().  This bug only happened
    @@ -269,8 +230,6 @@ CuSuite *testdir(void)
         SUITE_ADD_TEST(suite, test_remove_notthere);
         SUITE_ADD_TEST(suite, test_mkdir_twice);
     
    -    SUITE_ADD_TEST(suite, test_readdir_onedot);
    -    SUITE_ADD_TEST(suite, test_readdir_twodot);
         SUITE_ADD_TEST(suite, test_rewind);
     
         SUITE_ADD_TEST(suite, test_opendir);
    
    From 28225d1fb8e88c70392419a7d5ee81e473c523b7 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Fri, 20 Feb 2004 16:23:04 +0000
    Subject: [PATCH 4840/7878] * build/config.guess, build/config.sub: Update to
     current GNU config scripts.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64913 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/config.guess | 367 +++++++++++++++++++++++++++++----------------
     build/config.sub   | 282 ++++++++++++++++++++--------------
     2 files changed, 408 insertions(+), 241 deletions(-)
    
    diff --git a/build/config.guess b/build/config.guess
    index d1f30a9e489..00ccf89e18b 100755
    --- a/build/config.guess
    +++ b/build/config.guess
    @@ -1,9 +1,9 @@
     #! /bin/sh
     # Attempt to guess a canonical system name.
     #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    -#   2000, 2001, 2002 Free Software Foundation, Inc.
    +#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
     
    -timestamp='2002-03-20'
    +timestamp='2004-02-16'
     
     # This file is free software; you can redistribute it and/or modify it
     # under the terms of the GNU General Public License as published by
    @@ -24,11 +24,6 @@ timestamp='2002-03-20'
     # configuration script generated by Autoconf, you may include it under
     # the same distribution terms that you use for the rest of that program.
     
    -#####################################################################
    -# This file contains changes for Apache, clearly marked below.
    -# These changes are hereby donated to the public domain.
    -#####################################################################
    -
     # Originally written by Per Bothner .
     # Please send patches to .  Submit a context
     # diff and a properly formatted ChangeLog entry.
    @@ -93,30 +88,42 @@ if test $# != 0; then
       exit 1
     fi
     
    +trap 'exit 1' 1 2 15
     
    -dummy=dummy-$$
    -trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
    +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
    +# compiler to aid in system detection is discouraged as it requires
    +# temporary files to be created and, as you can see below, it is a
    +# headache to deal with in a portable fashion.
     
    -# CC_FOR_BUILD -- compiler used by this script.
     # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
     # use `HOST_CC' if defined, but it is deprecated.
     
    -set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
    - ,,)    echo "int dummy(){}" > $dummy.c ;
    +# Portable tmp directory creation inspired by the Autoconf team.
    +
    +set_cc_for_build='
    +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
    +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
    +: ${TMPDIR=/tmp} ;
    + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
    + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
    + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
    + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
    +dummy=$tmp/dummy ;
    +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
    +case $CC_FOR_BUILD,$HOST_CC,$CC in
    + ,,)    echo "int x;" > $dummy.c ;
     	for c in cc gcc c89 c99 ; do
    -	  ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
    -	  if test $? = 0 ; then
    +	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
     	     CC_FOR_BUILD="$c"; break ;
     	  fi ;
     	done ;
    -	rm -f $dummy.c $dummy.o $dummy.rel ;
     	if test x"$CC_FOR_BUILD" = x ; then
     	  CC_FOR_BUILD=no_compiler_found ;
     	fi
     	;;
      ,,*)   CC_FOR_BUILD=$CC ;;
      ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
    -esac'
    +esac ;'
     
     # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
     # (ghazi@noc.rutgers.edu 1994-08-24)
    @@ -147,6 +154,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
     	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
     	case "${UNAME_MACHINE_ARCH}" in
    +	    armeb) machine=armeb-unknown ;;
     	    arm*) machine=arm-unknown ;;
     	    sh3el) machine=shl-unknown ;;
     	    sh3eb) machine=sh-unknown ;;
    @@ -172,18 +180,35 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     		;;
     	esac
     	# The OS release
    -	release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
    +	# Debian GNU/NetBSD machines have a different userland, and
    +	# thus, need a distinct triplet. However, they do not need
    +	# kernel version information, so it can be replaced with a
    +	# suitable tag, in the style of linux-gnu.
    +	case "${UNAME_VERSION}" in
    +	    Debian*)
    +		release='-gnu'
    +		;;
    +	    *)
    +		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
    +		;;
    +	esac
     	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
     	# contains redundant information, the shorter form:
     	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
     	echo "${machine}-${os}${release}"
     	exit 0 ;;
    +    amd64:OpenBSD:*:*)
    +	echo x86_64-unknown-openbsd${UNAME_RELEASE}
    +	exit 0 ;;
         amiga:OpenBSD:*:*)
     	echo m68k-unknown-openbsd${UNAME_RELEASE}
     	exit 0 ;;
         arc:OpenBSD:*:*)
     	echo mipsel-unknown-openbsd${UNAME_RELEASE}
     	exit 0 ;;
    +    cats:OpenBSD:*:*)
    +	echo arm-unknown-openbsd${UNAME_RELEASE}
    +	exit 0 ;;
         hp300:OpenBSD:*:*)
     	echo m68k-unknown-openbsd${UNAME_RELEASE}
     	exit 0 ;;
    @@ -202,6 +227,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
         mvmeppc:OpenBSD:*:*)
     	echo powerpc-unknown-openbsd${UNAME_RELEASE}
     	exit 0 ;;
    +    pegasos:OpenBSD:*:*)
    +	echo powerpc-unknown-openbsd${UNAME_RELEASE}
    +	exit 0 ;;
         pmax:OpenBSD:*:*)
     	echo mipsel-unknown-openbsd${UNAME_RELEASE}
     	exit 0 ;;
    @@ -217,69 +245,65 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
         *:OpenBSD:*:*)
     	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
     	exit 0 ;;
    +    *:ekkoBSD:*:*)
    +	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
    +	exit 0 ;;
    +    macppc:MirBSD:*:*)
    +	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
    +	exit 0 ;;
    +    *:MirBSD:*:*)
    +	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
    +	exit 0 ;;
         alpha:OSF1:*:*)
     	if test $UNAME_RELEASE = "V4.0"; then
     		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
     	fi
    +	# According to Compaq, /usr/sbin/psrinfo has been available on
    +	# OSF/1 and Tru64 systems produced since 1995.  I hope that
    +	# covers most systems running today.  This code pipes the CPU
    +	# types through head -n 1, so we only detect the type of CPU 0.
    +	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
    +	case "$ALPHA_CPU_TYPE" in
    +	    "EV4 (21064)")
    +		UNAME_MACHINE="alpha" ;;
    +	    "EV4.5 (21064)")
    +		UNAME_MACHINE="alpha" ;;
    +	    "LCA4 (21066/21068)")
    +		UNAME_MACHINE="alpha" ;;
    +	    "EV5 (21164)")
    +		UNAME_MACHINE="alphaev5" ;;
    +	    "EV5.6 (21164A)")
    +		UNAME_MACHINE="alphaev56" ;;
    +	    "EV5.6 (21164PC)")
    +		UNAME_MACHINE="alphapca56" ;;
    +	    "EV5.7 (21164PC)")
    +		UNAME_MACHINE="alphapca57" ;;
    +	    "EV6 (21264)")
    +		UNAME_MACHINE="alphaev6" ;;
    +	    "EV6.7 (21264A)")
    +		UNAME_MACHINE="alphaev67" ;;
    +	    "EV6.8CB (21264C)")
    +		UNAME_MACHINE="alphaev68" ;;
    +	    "EV6.8AL (21264B)")
    +		UNAME_MACHINE="alphaev68" ;;
    +	    "EV6.8CX (21264D)")
    +		UNAME_MACHINE="alphaev68" ;;
    +	    "EV6.9A (21264/EV69A)")
    +		UNAME_MACHINE="alphaev69" ;;
    +	    "EV7 (21364)")
    +		UNAME_MACHINE="alphaev7" ;;
    +	    "EV7.9 (21364A)")
    +		UNAME_MACHINE="alphaev79" ;;
    +	esac
     	# A Vn.n version is a released version.
     	# A Tn.n version is a released field test version.
     	# A Xn.n version is an unreleased experimental baselevel.
     	# 1.2 uses "1.2" for uname -r.
    -	cat <$dummy.s
    -	.data
    -\$Lformat:
    -	.byte 37,100,45,37,120,10,0	# "%d-%x\n"
    -
    -	.text
    -	.globl main
    -	.align 4
    -	.ent main
    -main:
    -	.frame \$30,16,\$26,0
    -	ldgp \$29,0(\$27)
    -	.prologue 1
    -	.long 0x47e03d80 # implver \$0
    -	lda \$2,-1
    -	.long 0x47e20c21 # amask \$2,\$1
    -	lda \$16,\$Lformat
    -	mov \$0,\$17
    -	not \$1,\$18
    -	jsr \$26,printf
    -	ldgp \$29,0(\$26)
    -	mov 0,\$16
    -	jsr \$26,exit
    -	.end main
    -EOF
    -	eval $set_cc_for_build
    -	$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
    -	if test "$?" = 0 ; then
    -		case `./$dummy` in
    -			0-0)
    -				UNAME_MACHINE="alpha"
    -				;;
    -			1-0)
    -				UNAME_MACHINE="alphaev5"
    -				;;
    -			1-1)
    -				UNAME_MACHINE="alphaev56"
    -				;;
    -			1-101)
    -				UNAME_MACHINE="alphapca56"
    -				;;
    -			2-303)
    -				UNAME_MACHINE="alphaev6"
    -				;;
    -			2-307)
    -				UNAME_MACHINE="alphaev67"
    -				;;
    -			2-1307)
    -				UNAME_MACHINE="alphaev68"
    -				;;
    -		esac
    -	fi
    -	rm -f $dummy.s $dummy
     	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
     	exit 0 ;;
    +    Alpha*:OpenVMS:*:*)
    +	echo alpha-hp-vms
    +	exit 0 ;;
         Alpha\ *:Windows_NT*:*)
     	# How do we know it's Interix rather than the generic POSIX subsystem?
     	# Should we change UNAME_MACHINE based on the output of uname instead
    @@ -298,18 +322,12 @@ EOF
         *:[Mm]orph[Oo][Ss]:*:*)
     	echo ${UNAME_MACHINE}-unknown-morphos
     	exit 0 ;;
    -#########################
    -# Apache changes
    -#
    -    *:OS400:*:* | *:OS/400:*:*) 
    -       echo as400-ibm-os400
    -       exit 0 ;;
    -#
    -# end Apache changes
    -#########################
         *:OS/390:*:*)
     	echo i370-ibm-openedition
     	exit 0 ;;
    +    *:OS400:*:*)
    +        echo powerpc-ibm-os400
    +	exit 0 ;;
         arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
     	echo arm-acorn-riscix${UNAME_RELEASE}
     	exit 0;;
    @@ -327,6 +345,13 @@ EOF
         NILE*:*:*:dcosx)
     	echo pyramid-pyramid-svr4
     	exit 0 ;;
    +    DRS?6000:unix:4.0:6*)
    +	echo sparc-icl-nx6
    +	exit 0 ;;
    +    DRS?6000:UNIX_SV:4.2*:7*)
    +	case `/usr/bin/uname -p` in
    +	    sparc) echo sparc-icl-nx7 && exit 0 ;;
    +	esac ;;
         sun4H:SunOS:5.*:*)
     	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     	exit 0 ;;
    @@ -395,6 +420,9 @@ EOF
         *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
             echo m68k-unknown-mint${UNAME_RELEASE}
             exit 0 ;;
    +    m68k:machten:*:*)
    +	echo m68k-apple-machten${UNAME_RELEASE}
    +	exit 0 ;;
         powerpc:machten:*:*)
     	echo powerpc-apple-machten${UNAME_RELEASE}
     	exit 0 ;;
    @@ -433,15 +461,20 @@ EOF
     	  exit (-1);
     	}
     EOF
    -	$CC_FOR_BUILD $dummy.c -o $dummy \
    -	  && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
    -	  && rm -f $dummy.c $dummy && exit 0
    -	rm -f $dummy.c $dummy
    +	$CC_FOR_BUILD -o $dummy $dummy.c \
    +	  && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
    +	  && exit 0
     	echo mips-mips-riscos${UNAME_RELEASE}
     	exit 0 ;;
         Motorola:PowerMAX_OS:*:*)
     	echo powerpc-motorola-powermax
     	exit 0 ;;
    +    Motorola:*:4.3:PL8-*)
    +	echo powerpc-harris-powermax
    +	exit 0 ;;
    +    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
    +	echo powerpc-harris-powermax
    +	exit 0 ;;
         Night_Hawk:Power_UNIX:*:*)
     	echo powerpc-harris-powerunix
     	exit 0 ;;
    @@ -514,8 +547,7 @@ EOF
     			exit(0);
     			}
     EOF
    -		$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
    -		rm -f $dummy.c $dummy
    +		$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
     		echo rs6000-ibm-aix3.2.5
     	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
     		echo rs6000-ibm-aix3.2.4
    @@ -613,11 +645,21 @@ EOF
                       exit (0);
                   }
     EOF
    -		    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
    -		    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
    -		    rm -f $dummy.c $dummy
    +		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
    +		    test -z "$HP_ARCH" && HP_ARCH=hppa
     		fi ;;
     	esac
    +	if [ ${HP_ARCH} = "hppa2.0w" ]
    +	then
    +	    # avoid double evaluation of $set_cc_for_build
    +	    test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
    +	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
    +	    then
    +		HP_ARCH="hppa2.0w"
    +	    else
    +		HP_ARCH="hppa64"
    +	    fi
    +	fi
     	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
     	exit 0 ;;
         ia64:HP-UX:*:*)
    @@ -651,8 +693,7 @@ EOF
     	  exit (0);
     	}
     EOF
    -	$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
    -	rm -f $dummy.c $dummy
    +	$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
     	echo unknown-hitachi-hiuxwe2
     	exit 0 ;;
         9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
    @@ -710,21 +751,26 @@ EOF
         CRAY*TS:*:*:*)
     	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     	exit 0 ;;
    -    CRAY*T3D:*:*:*)
    -	echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    -	exit 0 ;;
         CRAY*T3E:*:*:*)
     	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     	exit 0 ;;
         CRAY*SV1:*:*:*)
     	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     	exit 0 ;;
    +    *:UNICOS/mp:*:*)
    +	echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    +	exit 0 ;;
         F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
     	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
             FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
             FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
             echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
             exit 0 ;;
    +    5000:UNIX_System_V:4.*:*)
    +        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    +        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
    +        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    +	exit 0 ;;
         i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
     	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
     	exit 0 ;;
    @@ -735,7 +781,21 @@ EOF
     	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
     	exit 0 ;;
         *:FreeBSD:*:*)
    -	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
    +	# Determine whether the default compiler uses glibc.
    +	eval $set_cc_for_build
    +	sed 's/^	//' << EOF >$dummy.c
    +	#include 
    +	#if __GLIBC__ >= 2
    +	LIBC=gnu
    +	#else
    +	LIBC=
    +	#endif
    +EOF
    +	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
    +	# GNU/KFreeBSD systems have a "k" prefix to indicate we are using
    +	# FreeBSD's kernel, but not the complete OS.
    +	case ${LIBC} in gnu) kernel_only='k' ;; esac
    +	echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
     	exit 0 ;;
         i*:CYGWIN*:*)
     	echo ${UNAME_MACHINE}-pc-cygwin
    @@ -746,14 +806,17 @@ EOF
         i*:PW*:*)
     	echo ${UNAME_MACHINE}-pc-pw32
     	exit 0 ;;
    -    x86:Interix*:3*)
    -	echo i386-pc-interix3
    +    x86:Interix*:[34]*)
    +	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
    +	exit 0 ;;
    +    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
    +	echo i${UNAME_MACHINE}-pc-mks
     	exit 0 ;;
         i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
     	# How do we know it's Interix rather than the generic POSIX subsystem?
     	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
     	# UNAME_MACHINE based on the output of uname instead of i386?
    -	echo i386-pc-interix
    +	echo i586-pc-interix
     	exit 0 ;;
         i*:UWIN*:*)
     	echo ${UNAME_MACHINE}-pc-uwin
    @@ -765,14 +828,22 @@ EOF
     	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     	exit 0 ;;
         *:GNU:*:*)
    +	# the GNU system
     	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
     	exit 0 ;;
    +    *:GNU/*:*:*)
    +	# other systems with GNU libc and userland
    +	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
    +	exit 0 ;;
         i*86:Minix:*:*)
     	echo ${UNAME_MACHINE}-pc-minix
     	exit 0 ;;
         arm*:Linux:*:*)
     	echo ${UNAME_MACHINE}-unknown-linux-gnu
     	exit 0 ;;
    +    cris:Linux:*:*)
    +	echo cris-axis-linux-gnu
    +	exit 0 ;;
         ia64:Linux:*:*)
     	echo ${UNAME_MACHINE}-unknown-linux-gnu
     	exit 0 ;;
    @@ -796,8 +867,26 @@ EOF
     	#endif
     EOF
     	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
    -	rm -f $dummy.c
    -	test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
    +	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
    +	;;
    +    mips64:Linux:*:*)
    +	eval $set_cc_for_build
    +	sed 's/^	//' << EOF >$dummy.c
    +	#undef CPU
    +	#undef mips64
    +	#undef mips64el
    +	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
    +	CPU=mips64el
    +	#else
    +	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
    +	CPU=mips64
    +	#else
    +	CPU=
    +	#endif
    +	#endif
    +EOF
    +	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
    +	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
     	;;
         ppc:Linux:*:*)
     	echo powerpc-unknown-linux-gnu
    @@ -833,6 +922,9 @@ EOF
         s390:Linux:*:* | s390x:Linux:*:*)
     	echo ${UNAME_MACHINE}-ibm-linux
     	exit 0 ;;
    +    sh64*:Linux:*:*)
    +    	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	exit 0 ;;
         sh*:Linux:*:*)
     	echo ${UNAME_MACHINE}-unknown-linux-gnu
     	exit 0 ;;
    @@ -859,7 +951,7 @@ EOF
     		;;
     	  a.out-i386-linux)
     		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
    -		exit 0 ;;		
    +		exit 0 ;;
     	  coff-i386)
     		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
     		exit 0 ;;
    @@ -890,9 +982,11 @@ EOF
     	LIBC=gnuaout
     	#endif
     	#endif
    +	#ifdef __dietlibc__
    +	LIBC=dietlibc
    +	#endif
     EOF
     	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
    -	rm -f $dummy.c
     	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
     	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
     	;;
    @@ -910,6 +1004,26 @@ EOF
             # Use sysv4.2uw... so that sysv4* matches it.
     	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
     	exit 0 ;;
    +    i*86:OS/2:*:*)
    +	# If we were able to find `uname', then EMX Unix compatibility
    +	# is probably installed.
    +	echo ${UNAME_MACHINE}-pc-os2-emx
    +	exit 0 ;;
    +    i*86:XTS-300:*:STOP)
    +	echo ${UNAME_MACHINE}-unknown-stop
    +	exit 0 ;;
    +    i*86:atheos:*:*)
    +	echo ${UNAME_MACHINE}-unknown-atheos
    +	exit 0 ;;
    +	i*86:syllable:*:*)
    +	echo ${UNAME_MACHINE}-pc-syllable
    +	exit 0 ;;
    +    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
    +	echo i386-unknown-lynxos${UNAME_RELEASE}
    +	exit 0 ;;
    +    i*86:*DOS:*:*)
    +	echo ${UNAME_MACHINE}-pc-msdosdjgpp
    +	exit 0 ;;
         i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
     	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
     	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
    @@ -931,22 +1045,19 @@ EOF
     		UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
    -		UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
    -		(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
    -		(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
    +		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
    +		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
    +		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
     			&& UNAME_MACHINE=i586
    -		(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
    +		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
     			&& UNAME_MACHINE=i686
    -		(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
    +		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
     			&& UNAME_MACHINE=i686
     		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
     	else
     		echo ${UNAME_MACHINE}-pc-sysv32
     	fi
     	exit 0 ;;
    -    i*86:*DOS:*:*)
    -	echo ${UNAME_MACHINE}-pc-msdosdjgpp
    -	exit 0 ;;
         pc:*:*:*)
     	# Left here for compatibility:
             # uname -m prints for DJGPP always 'pc', but it prints nothing about
    @@ -970,9 +1081,15 @@ EOF
     	# "miniframe"
     	echo m68010-convergent-sysv
     	exit 0 ;;
    +    mc68k:UNIX:SYSTEM5:3.51m)
    +	echo m68k-convergent-sysv
    +	exit 0 ;;
    +    M680?0:D-NIX:5.3:*)
    +	echo m68k-diab-dnix
    +	exit 0 ;;
         M68*:*:R3V[567]*:*)
     	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
    -    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
    +    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
     	OS_REL=''
     	test -r /etc/.relid \
     	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
    @@ -989,9 +1106,6 @@ EOF
         mc68030:UNIX_System_V:4.*:*)
     	echo m68k-atari-sysv4
     	exit 0 ;;
    -    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
    -	echo i386-unknown-lynxos${UNAME_RELEASE}
    -	exit 0 ;;
         TSUNAMI:LynxOS:2.*:*)
     	echo sparc-unknown-lynxos${UNAME_RELEASE}
     	exit 0 ;;
    @@ -1063,6 +1177,9 @@ EOF
         SX-5:SUPER-UX:*:*)
     	echo sx5-nec-superux${UNAME_RELEASE}
     	exit 0 ;;
    +    SX-6:SUPER-UX:*:*)
    +	echo sx6-nec-superux${UNAME_RELEASE}
    +	exit 0 ;;
         Power*:Rhapsody:*:*)
     	echo powerpc-apple-rhapsody${UNAME_RELEASE}
     	exit 0 ;;
    @@ -1070,7 +1187,11 @@ EOF
     	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
     	exit 0 ;;
         *:Darwin:*:*)
    -	echo `uname -p`-apple-darwin${UNAME_RELEASE}
    +	case `uname -p` in
    +	    *86) UNAME_PROCESSOR=i686 ;;
    +	    powerpc) UNAME_PROCESSOR=powerpc ;;
    +	esac
    +	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
     	exit 0 ;;
         *:procnto*:*:* | *:QNX:[0123456789]*:*)
     	UNAME_PROCESSOR=`uname -p`
    @@ -1083,7 +1204,7 @@ EOF
         *:QNX:*:4*)
     	echo i386-pc-qnx
     	exit 0 ;;
    -    NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
    +    NSR-?:NONSTOP_KERNEL:*:*)
     	echo nsr-tandem-nsk${UNAME_RELEASE}
     	exit 0 ;;
         *:NonStop-UX:*:*)
    @@ -1106,11 +1227,6 @@ EOF
     	fi
     	echo ${UNAME_MACHINE}-unknown-plan9
     	exit 0 ;;
    -    i*86:OS/2:*:*)
    -	# If we were able to find `uname', then EMX Unix compatibility
    -	# is probably installed.
    -	echo ${UNAME_MACHINE}-pc-os2-emx
    -	exit 0 ;;
         *:TOPS-10:*:*)
     	echo pdp10-unknown-tops10
     	exit 0 ;;
    @@ -1129,11 +1245,11 @@ EOF
         *:ITS:*:*)
     	echo pdp10-unknown-its
     	exit 0 ;;
    -    i*86:XTS-300:*:STOP)
    -	echo ${UNAME_MACHINE}-unknown-stop
    +    SEI:*:*:SEIUX)
    +        echo mips-sei-seiux${UNAME_RELEASE}
     	exit 0 ;;
    -    i*86:atheos:*:*)
    -	echo ${UNAME_MACHINE}-unknown-atheos
    +    *:DragonFly:*:*)
    +	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
     	exit 0 ;;
     esac
     
    @@ -1255,8 +1371,7 @@ main ()
     }
     EOF
     
    -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
    -rm -f $dummy.c $dummy
    +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
     
     # Apollos put the system type in the environment.
     
    diff --git a/build/config.sub b/build/config.sub
    index 0d6cce6c95b..d2e3557ac40 100755
    --- a/build/config.sub
    +++ b/build/config.sub
    @@ -1,9 +1,9 @@
     #! /bin/sh
     # Configuration validation subroutine script.
     #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    -#   2000, 2001, 2002 Free Software Foundation, Inc.
    +#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
     
    -timestamp='2002-03-07'
    +timestamp='2004-02-16'
     
     # This file is (in principle) common to ALL GNU software.
     # The presence of a machine in this file suggests that SOME GNU software
    @@ -29,11 +29,6 @@ timestamp='2002-03-07'
     # configuration script generated by Autoconf, you may include it under
     # the same distribution terms that you use for the rest of that program.
     
    -#####################################################################
    -# This file contains changes for Apache, clearly marked below.
    -# These changes are hereby donated to the public domain.
    -#####################################################################
    -
     # Please send patches to .  Submit a context
     # diff and a properly formatted ChangeLog entry.
     #
    @@ -123,20 +118,11 @@ esac
     # Here we must recognize all the valid KERNEL-OS combinations.
     maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
     case $maybe_os in
    -  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
    +  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
    +  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
         os=-$maybe_os
         basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
         ;;
    -########################
    -# changes for Apache
    -#
    -  os400)
    -    os=-$maybe_os
    -    basic_machine=as400;
    -    ;;
    -#
    -# end Apache changes
    -########################
       *)
         basic_machine=`echo $1 | sed 's/-[^-]*$//'`
         if [ $basic_machine != $1 ]
    @@ -243,28 +229,42 @@ case $basic_machine in
     	| a29k \
     	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
     	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
    +	| am33_2.0 \
     	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
     	| c4x | clipper \
    -	| d10v | d30v | dsp16xx \
    -	| fr30 \
    +	| d10v | d30v | dlx | dsp16xx \
    +	| fr30 | frv \
     	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
     	| i370 | i860 | i960 | ia64 \
    +	| ip2k | iq2000 \
     	| m32r | m68000 | m68k | m88k | mcore \
    -	| mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
    -	| mips64vr4100 | mips64vr4100el | mips64vr4300 \
    -	| mips64vr4300el | mips64vr5000 | mips64vr5000el \
    -	| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
    -	| mipsisa32 | mipsisa64 \
    +	| mips | mipsbe | mipseb | mipsel | mipsle \
    +	| mips16 \
    +	| mips64 | mips64el \
    +	| mips64vr | mips64vrel \
    +	| mips64orion | mips64orionel \
    +	| mips64vr4100 | mips64vr4100el \
    +	| mips64vr4300 | mips64vr4300el \
    +	| mips64vr5000 | mips64vr5000el \
    +	| mipsisa32 | mipsisa32el \
    +	| mipsisa32r2 | mipsisa32r2el \
    +	| mipsisa64 | mipsisa64el \
    +	| mipsisa64r2 | mipsisa64r2el \
    +	| mipsisa64sb1 | mipsisa64sb1el \
    +	| mipsisa64sr71k | mipsisa64sr71kel \
    +	| mipstx39 | mipstx39el \
     	| mn10200 | mn10300 \
    +	| msp430 \
     	| ns16k | ns32k \
     	| openrisc | or32 \
     	| pdp10 | pdp11 | pj | pjl \
     	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
     	| pyramid \
    -	| sh | sh[34] | sh[34]eb | shbe | shle | sh64 \
    +	| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
    +	| sh64 | sh64le \
     	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
     	| strongarm \
    -	| tahoe | thumb | tic80 | tron \
    +	| tahoe | thumb | tic4x | tic80 | tron \
     	| v850 | v850e \
     	| we32k \
     	| x86 | xscale | xstormy16 | xtensa \
    @@ -296,34 +296,50 @@ case $basic_machine in
     	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
     	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
     	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
    -	| arm-*  | armbe-* | armle-* | armv*-* \
    +	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
     	| avr-* \
     	| bs2000-* \
    -	| c[123]* | c30-* | [cjt]90-* | c54x-* \
    +	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
     	| clipper-* | cydra-* \
    -	| d10v-* | d30v-* \
    +	| d10v-* | d30v-* | dlx-* \
     	| elxsi-* \
    -	| f30[01]-* | f700-* | fr30-* | fx80-* \
    +	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
     	| h8300-* | h8500-* \
     	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
     	| i*86-* | i860-* | i960-* | ia64-* \
    +	| ip2k-* | iq2000-* \
     	| m32r-* \
     	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
     	| m88110-* | m88k-* | mcore-* \
    -	| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
    -	| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
    -	| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
    -	| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
    -	| none-* | np1-* | ns16k-* | ns32k-* \
    +	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
    +	| mips16-* \
    +	| mips64-* | mips64el-* \
    +	| mips64vr-* | mips64vrel-* \
    +	| mips64orion-* | mips64orionel-* \
    +	| mips64vr4100-* | mips64vr4100el-* \
    +	| mips64vr4300-* | mips64vr4300el-* \
    +	| mips64vr5000-* | mips64vr5000el-* \
    +	| mipsisa32-* | mipsisa32el-* \
    +	| mipsisa32r2-* | mipsisa32r2el-* \
    +	| mipsisa64-* | mipsisa64el-* \
    +	| mipsisa64r2-* | mipsisa64r2el-* \
    +	| mipsisa64sb1-* | mipsisa64sb1el-* \
    +	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
    +	| mipstx39-* | mipstx39el-* \
    +	| msp430-* \
    +	| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
     	| orion-* \
     	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
     	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
     	| pyramid-* \
     	| romp-* | rs6000-* \
    -	| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \
    +	| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
    +	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
     	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
     	| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
    -	| tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
    +	| tahoe-* | thumb-* \
    +	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
    +	| tron-* \
     	| v850-* | v850e-* | vax-* \
     	| we32k-* \
     	| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
    @@ -347,6 +363,9 @@ case $basic_machine in
     		basic_machine=a29k-amd
     		os=-udi
     		;;
    +    	abacus)
    +		basic_machine=abacus-unknown
    +		;;
     	adobe68k)
     		basic_machine=m68010-adobe
     		os=-scout
    @@ -361,6 +380,12 @@ case $basic_machine in
     		basic_machine=a29k-none
     		os=-bsd
     		;;
    +	amd64)
    +		basic_machine=x86_64-pc
    +		;;
    +	amd64-*)
    +		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
    +		;;
     	amdahl)
     		basic_machine=580-amdahl
     		os=-sysv
    @@ -420,6 +445,10 @@ case $basic_machine in
     		basic_machine=j90-cray
     		os=-unicos
     		;;
    +	cr16c)
    +		basic_machine=cr16c-unknown
    +		os=-elf
    +		;;
     	crds | unos)
     		basic_machine=m68k-crds
     		;;
    @@ -710,6 +739,10 @@ case $basic_machine in
     	np1)
     		basic_machine=np1-gould
     		;;
    +	nv1)
    +		basic_machine=nv1-cray
    +		os=-unicosmp
    +		;;
     	nsr-tandem)
     		basic_machine=nsr-tandem
     		;;
    @@ -721,6 +754,10 @@ case $basic_machine in
     		basic_machine=or32-unknown
     		os=-coff
     		;;
    +	os400)
    +		basic_machine=powerpc-ibm
    +		os=-os400
    +		;;
     	OSE68000 | ose68000)
     		basic_machine=m68000-ericsson
     		os=-ose
    @@ -743,49 +780,55 @@ case $basic_machine in
     	pbb)
     		basic_machine=m68k-tti
     		;;
    -        pc532 | pc532-*)
    +	pc532 | pc532-*)
     		basic_machine=ns32k-pc532
     		;;
     	pentium | p5 | k5 | k6 | nexgen | viac3)
     		basic_machine=i586-pc
     		;;
    -	pentiumpro | p6 | 6x86 | athlon)
    +	pentiumpro | p6 | 6x86 | athlon | athlon_*)
     		basic_machine=i686-pc
     		;;
    -	pentiumii | pentium2)
    +	pentiumii | pentium2 | pentiumiii | pentium3)
     		basic_machine=i686-pc
     		;;
    +	pentium4)
    +		basic_machine=i786-pc
    +		;;
     	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
     		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
     		;;
     	pentiumpro-* | p6-* | 6x86-* | athlon-*)
     		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
     		;;
    -	pentiumii-* | pentium2-*)
    +	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
     		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
     		;;
    +	pentium4-*)
    +		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
    +		;;
     	pn)
     		basic_machine=pn-gould
     		;;
     	power)	basic_machine=power-ibm
     		;;
     	ppc)	basic_machine=powerpc-unknown
    -	        ;;
    +		;;
     	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
     		;;
     	ppcle | powerpclittle | ppc-le | powerpc-little)
     		basic_machine=powerpcle-unknown
    -	        ;;
    +		;;
     	ppcle-* | powerpclittle-*)
     		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
     		;;
     	ppc64)	basic_machine=powerpc64-unknown
    -	        ;;
    +		;;
     	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
     		;;
     	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
     		basic_machine=powerpc64le-unknown
    -	        ;;
    +		;;
     	ppc64le-* | powerpc64little-*)
     		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
     		;;
    @@ -816,15 +859,16 @@ case $basic_machine in
     		basic_machine=a29k-amd
     		os=-udi
     		;;
    -########################
    -# changes for Apache
    -#
    -	as400*)
    -		basic_machine=as400-ibm
    +	sb1)
    +		basic_machine=mipsisa64sb1-unknown
    +		;;
    +	sb1el)
    +		basic_machine=mipsisa64sb1el-unknown
    +		;;
    +	sei)
    +		basic_machine=mips-sei
    +		os=-seiux
     		;;
    -# 
    -# end Apache changes
    -########################
     	sequent)
     		basic_machine=i386-sequent
     		;;
    @@ -832,6 +876,9 @@ case $basic_machine in
     		basic_machine=sh-hitachi
     		os=-hms
     		;;
    +	sh64)
    +		basic_machine=sh64-unknown
    +		;;
     	sparclite-wrs | simso-wrs)
     		basic_machine=sparclite-wrs
     		os=-vxworks
    @@ -890,7 +937,7 @@ case $basic_machine in
     	sun386 | sun386i | roadrunner)
     		basic_machine=i386-sun
     		;;
    -        sv1)
    +	sv1)
     		basic_machine=sv1-cray
     		os=-unicos
     		;;
    @@ -898,10 +945,6 @@ case $basic_machine in
     		basic_machine=i386-sequent
     		os=-dynix
     		;;
    -	t3d)
    -		basic_machine=alpha-cray
    -		os=-unicos
    -		;;
     	t3e)
     		basic_machine=alphaev5-cray
     		os=-unicos
    @@ -914,6 +957,14 @@ case $basic_machine in
     		basic_machine=tic54x-unknown
     		os=-coff
     		;;
    +	tic55x | c55x*)
    +		basic_machine=tic55x-unknown
    +		os=-coff
    +		;;
    +	tic6x | c6x*)
    +		basic_machine=tic6x-unknown
    +		os=-coff
    +		;;
     	tx39)
     		basic_machine=mipstx39-unknown
     		;;
    @@ -927,6 +978,10 @@ case $basic_machine in
     	tower | tower-32)
     		basic_machine=m68k-ncr
     		;;
    +	tpf)
    +		basic_machine=s390x-ibm
    +		os=-tpf
    +		;;
     	udi29k)
     		basic_machine=a29k-amd
     		os=-udi
    @@ -948,8 +1003,8 @@ case $basic_machine in
     		os=-vms
     		;;
     	vpp*|vx|vx-*)
    -               basic_machine=f301-fujitsu
    -               ;;
    +		basic_machine=f301-fujitsu
    +		;;
     	vxworks960)
     		basic_machine=i960-wrs
     		os=-vxworks
    @@ -970,11 +1025,7 @@ case $basic_machine in
     		basic_machine=hppa1.1-winbond
     		os=-proelf
     		;;
    -	windows32)
    -		basic_machine=i386-pc
    -		os=-windows32-msvcrt
    -		;;
    -        xps | xps100)
    +	xps | xps100)
     		basic_machine=xps100-honeywell
     		;;
     	ymp)
    @@ -1020,7 +1071,7 @@ case $basic_machine in
     	we32k)
     		basic_machine=we32k-att
     		;;
    -	sh3 | sh4 | sh3eb | sh4eb)
    +	sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
     		basic_machine=sh-unknown
     		;;
     	sh64)
    @@ -1029,7 +1080,7 @@ case $basic_machine in
     	sparc | sparcv9 | sparcv9b)
     		basic_machine=sparc-sun
     		;;
    -        cydra)
    +	cydra)
     		basic_machine=cydra-cydrome
     		;;
     	orion)
    @@ -1044,10 +1095,6 @@ case $basic_machine in
     	pmac | pmac-mpw)
     		basic_machine=powerpc-apple
     		;;
    -	c4x*)
    -		basic_machine=c4x-none
    -		os=-coff
    -		;;
     	*-unknown)
     		# Make sure to match an already-canonicalized machine name.
     		;;
    @@ -1092,14 +1139,6 @@ case $os in
     	-gnu/linux*)
     		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
     		;;
    -########################
    -# changes for Apache
    -#
    -	-os400* )
    -        	;;
    -#
    -# end Apache changes
    -########################
     	# First accept the basic system types.
     	# The portable systems comes first.
     	# Each alternative MUST END IN A *, to match a version number.
    @@ -1111,18 +1150,20 @@ case $os in
     	      | -aos* \
     	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
     	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
    -	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
    -	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
    +	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
    +	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
    +	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
     	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
     	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
     	      | -chorusos* | -chorusrdb* \
     	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
    -	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
    -	      | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
    +	      | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
    +	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
     	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
     	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
     	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
    -	      | -morphos* | -superux* | -rtmk* | -rtmk-nova*)
    +	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
    +	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
     	# Remember, each alternative MUST END IN *, to match a version number.
     		;;
     	-qnx*)
    @@ -1134,8 +1175,10 @@ case $os in
     			;;
     		esac
     		;;
    +	-nto-qnx*)
    +		;;
     	-nto*)
    -		os=-nto-qnx
    +		os=`echo $os | sed -e 's|nto|nto-qnx|'`
     		;;
     	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
     	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
    @@ -1144,6 +1187,9 @@ case $os in
     	-mac*)
     		os=`echo $os | sed -e 's|mac|macos|'`
     		;;
    +	-linux-dietlibc)
    +		os=-linux-dietlibc
    +		;;
     	-linux*)
     		os=`echo $os | sed -e 's|linux|linux-gnu|'`
     		;;
    @@ -1156,6 +1202,9 @@ case $os in
     	-opened*)
     		os=-openedition
     		;;
    +        -os400*)
    +		os=-os400
    +		;;
     	-wince*)
     		os=-wince
     		;;
    @@ -1177,6 +1226,9 @@ case $os in
     	-atheos*)
     		os=-atheos
     		;;
    +	-syllable*)
    +		os=-syllable
    +		;;
     	-386bsd)
     		os=-bsd
     		;;
    @@ -1187,7 +1239,7 @@ case $os in
     		os=-rtmk-nova
     		;;
     	-ns2 )
    -	        os=-nextstep2
    +		os=-nextstep2
     		;;
     	-nsk*)
     		os=-nsk
    @@ -1199,6 +1251,9 @@ case $os in
     	-sinix*)
     		os=-sysv4
     		;;
    +        -tpf*)
    +		os=-tpf
    +		;;
     	-triton*)
     		os=-sysv3
     		;;
    @@ -1226,8 +1281,14 @@ case $os in
     	-xenix)
     		os=-xenix
     		;;
    -        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
    -	        os=-mint
    +	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
    +		os=-mint
    +		;;
    +	-aros*)
    +		os=-aros
    +		;;
    +	-kaos*)
    +		os=-kaos
     		;;
     	-none)
     		;;
    @@ -1260,11 +1321,14 @@ case $basic_machine in
     	arm*-semi)
     		os=-aout
     		;;
    +    c4x-* | tic4x-*)
    +        os=-coff
    +        ;;
     	# This must come before the *-dec entry.
     	pdp10-*)
     		os=-tops20
     		;;
    -        pdp11-*)
    +	pdp11-*)
     		os=-none
     		;;
     	*-dec | vax-*)
    @@ -1303,27 +1367,9 @@ case $basic_machine in
     	*-be)
     		os=-beos
     		;;
    -########################
    -# changes for Apache
    -#
    -#	*-ibm)
    -#		os=-aix
    -#		;;
    -#
     	*-ibm)
    -		case $basic_machine in
    -			as400*)
    -				os=-os400;
    -				;;
    -			*)
    -				os=-aix
    -				;;
    -		esac
    -                ;;
    -# 
    -# end Apache changes
    -########################
    -
    +		os=-aix
    +		;;
     	*-wec)
     		os=-proelf
     		;;
    @@ -1375,19 +1421,19 @@ case $basic_machine in
     	*-next)
     		os=-nextstep3
     		;;
    -        *-gould)
    +	*-gould)
     		os=-sysv
     		;;
    -        *-highlevel)
    +	*-highlevel)
     		os=-bsd
     		;;
     	*-encore)
     		os=-bsd
     		;;
    -        *-sgi)
    +	*-sgi)
     		os=-irix
     		;;
    -        *-siemens)
    +	*-siemens)
     		os=-sysv4
     		;;
     	*-masscomp)
    @@ -1456,10 +1502,16 @@ case $basic_machine in
     			-mvs* | -opened*)
     				vendor=ibm
     				;;
    +			-os400*)
    +				vendor=ibm
    +				;;
     			-ptx*)
     				vendor=sequent
     				;;
    -			-vxsim* | -vxworks*)
    +			-tpf*)
    +				vendor=ibm
    +				;;
    +			-vxsim* | -vxworks* | -windiss*)
     				vendor=wrs
     				;;
     			-aux*)
    
    From 5fa064d284ae589a472a959812366d7dfdb1b46e Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Sat, 21 Feb 2004 00:31:49 +0000
    Subject: [PATCH 4841/7878] Fix the generation of the build-outputs.mk file.
     That file must remain platform independent since it gets included with the
     tarball, and the tarball is targeted for all platforms.
    
    In this new scheme, the build-outputs.mk includes symbols named
    OBJECTS_ which specifies the necessary object files for each platform.
    The apr_rules.mk(.in) file then pulls in the right symbol for the configured
    platform. Since apr-util directly uses apr_rules.mk, then it picks up the
    same logic with no change.
    
    The build.conf was altered to include a set of platform-independent files,
    and subdirectories which contain per-platform subdirectories. This was
    needed to help out the logic which selects object files based on whether a
    platform is present in each source subdir. (and if a platform subdir is not
    present, then "parent" gets used instead; e.g. use 'unix' if 'beos' is not
    in the subdir)
    
    Lastly, configure.in was updated to select the appropriate set of objects
    for the build.
    
    * build.conf:
      (paths): remove per-platform symbols
      (platform_dirs): new option to list the dirs which have platform subdirs
    
    * configure.in:
      - define and substitute OBJECTS_PLATFORM to reference the platform
        specific set of objects, which get defined in build-outputs.mk
    
    * build/apr_rules.mk.in:
      - define OBJECTS in terms of the substituted OBJECTS_PLATFORM symbol
    
    * build/gen-build.py:
      (PLATFORMS): the various platforms found in APR. unused, actually.
      (MAKE_PLATFORMS): the platforms which use a Makefile, and what default
        platform should be used if SUBDIR/ is not present.
      (main): update logic to generate multiple OBJECTS_* symbols. this now
        includes logic to deal with subdirs which may not have a platform subdir
        for the platform in question, thus needing to default to another.
      (write_objects): some code factored out of main() to process a list of
        source files into dependencies lines in the makefile.
      (get_files): no more need to substitute for {platform}, and simplified
        some of the .split() stuff.
      (get_platform): no longer required. we generate for all platforms.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64914 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build.conf            | 23 ++++-------
     build/apr_rules.mk.in |  6 +++
     build/gen-build.py    | 93 +++++++++++++++++++++++++++++++++----------
     configure.in          |  8 ++++
     4 files changed, 95 insertions(+), 35 deletions(-)
    
    diff --git a/build.conf b/build.conf
    index 8d9c8418153..0522a1bb783 100644
    --- a/build.conf
    +++ b/build.conf
    @@ -4,26 +4,19 @@
     
     [options]
     
    +# paths to platform-independent .c files to build
     paths =
    -  atomic/{platform}/*.c
    -  dso/{platform}/*.c
    -  file_io/{platform}/*.c
    -  locks/{platform}/*.c
    -  memory/{platform}/*.c
    -  misc/{platform}/*.c
    -  mmap/{platform}/*.c
    -  network_io/{platform}/*.c
       passwd/*.c
    -  poll/{platform}/*.c
    -  random/{platform}/*.c
    -  shmem/{platform}/*.c
       strings/*.c
    -  support/{platform}/*.c
       tables/*.c
    -  threadproc/{platform}/*.c
    -  time/{platform}/*.c
    -  user/{platform}/*.c
     
    +# directories that have platform-specific code in them. the resulting
    +# pattern will be: SUBDIR/PLATFORM/*.c
    +platform_dirs =
    +  atomic dso file_io locks memory misc mmap network_io poll random
    +  shmem support threadproc time user
    +
    +# all the public headers
     headers = include/*.h
     
     # aplibtool is manually built by the configure process
    diff --git a/build/apr_rules.mk.in b/build/apr_rules.mk.in
    index 392efa1411f..747adb1a34e 100644
    --- a/build/apr_rules.mk.in
    +++ b/build/apr_rules.mk.in
    @@ -115,6 +115,12 @@ ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES)
     LTFLAGS      = @LTFLAGS@
     LT_LDFLAGS   = @LT_LDFLAGS@
     
    +# The set of object files that will be linked into the target library.
    +# The build-outputs.mk specifies a different set for each platform. The
    +# configure script will select the appropriate set.
    +#
    +OBJECTS      = @OBJECTS_PLATFORM@
    +
     #
     # Basic macro setup
     #
    diff --git a/build/gen-build.py b/build/gen-build.py
    index 3c92b2c127c..8582741de80 100755
    --- a/build/gen-build.py
    +++ b/build/gen-build.py
    @@ -18,13 +18,26 @@
     
     #import ezt
     
    +#
    +# legal platforms: aix, beos, netware, os2, os390, unix, win32
    +# 'make' users: aix, beos, os2, os390, unix
    +#
    +PLATFORMS = [ 'aix', 'beos', 'netware', 'os2', 'os390', 'unix', 'win32' ]
    +MAKE_PLATFORMS = [
    +  ('unix', None),
    +  ('aix', 'unix'),
    +  ('beos', 'unix'),
    +  ('os2', 'unix'),
    +  ('os390', 'unix'),
    +  ]
    +# note: MAKE_PLATFORMS is an ordered set. we want to generate unix symbols
    +#       first, so that the later platforms can reference them.
    +
     
     def main():
       parser = ConfigParser.ConfigParser()
       parser.read('build.conf')
     
    -  dirs = { }
    -  files = get_files(parser.get('options', 'paths'))
       headers = get_files(parser.get('options', 'headers'))
     
       # compute the relevant headers, along with the implied includes
    @@ -40,22 +53,45 @@ def main():
       f = open('build-outputs.mk', 'w')
       f.write('# DO NOT EDIT. AUTOMATICALLY GENERATED.\n\n')
     
    -  objects = [ ]
    -  for file in files:
    -    assert file[-2:] == '.c'
    -    obj = file[:-2] + '.lo'
    -    objects.append(obj)
    +  # write out the platform-independent files
    +  files = get_files(parser.get('options', 'paths'))
    +  objects, dirs = write_objects(f, legal_deps, h_deps, files)
    +  f.write('\nOBJECTS_all = %s\n\n' % string.join(objects))
     
    -    dirs[os.path.dirname(file)] = None
    +  # for each platform and each subdirectory holding platform-specific files,
    +  # write out their compilation rules, and an OBJECT__ symbol.
    +  for platform, parent in MAKE_PLATFORMS:
     
    -    # what headers does this file include, along with the implied headers
    -    deps = extract_deps(file, legal_deps)
    -    for hdr in deps.keys():
    -      deps.update(h_deps.get(hdr, {}))
    +    # record the object symbols to build for each platform
    +    group = [ '$(OBJECTS_all)' ]
     
    -    f.write('%s: %s .make.dirs %s\n' % (obj, file, string.join(deps.values())))
    +    for subdir in string.split(parser.get('options', 'platform_dirs')):
    +      path = '%s/%s' % (subdir, platform)
    +      if not os.path.exists(path):
    +        # this subdir doesn't have a subdir for this platform, so we'll
    +        # use the parent-platform's set of symbols
    +        if parent:
    +          group.append('$(OBJECTS_%s_%s)' % (subdir, parent))
    +        continue
    +
    +      # remember that this directory has files/objects
    +      dirs[path] = None
    +
    +      # write out the compilation lines for this subdir
    +      files = get_files(path + '/*.c')
    +      objects, _unused = write_objects(f, legal_deps, h_deps, files)
    +
    +      symname = 'OBJECTS_%s_%s' % (subdir, platform)
    +
    +      # and write the symbol for the whole group
    +      f.write('\n%s = %s\n\n' % (symname, string.join(objects)))
    +
    +      # and include that symbol in the group
    +      group.append('$(%s)' % symname)
    +
    +    # write out a symbol which contains the necessary files
    +    f.write('OBJECTS_%s = %s\n\n' % (platform, string.join(group)))
     
    -  f.write('\nOBJECTS = %s\n\n' % string.join(objects))
       f.write('HEADERS = $(top_srcdir)/%s\n\n' % string.join(headers, ' $(top_srcdir)/'))
       f.write('SOURCE_DIRS = %s $(EXTRA_SOURCE_DIRS)\n\n' % string.join(dirs.keys()))
     
    @@ -76,6 +112,28 @@ def main():
               '\t@for d in $(BUILD_DIRS); do test -d $$d || mkdir $$d; done\n' \
               '\t@echo timestamp > $@\n')
     
    +
    +def write_objects(f, legal_deps, h_deps, files):
    +  dirs = { }
    +  objects = [ ]
    +
    +  for file in files:
    +    assert file[-2:] == '.c'
    +    obj = file[:-2] + '.lo'
    +    objects.append(obj)
    +
    +    dirs[os.path.dirname(file)] = None
    +
    +    # what headers does this file include, along with the implied headers
    +    deps = extract_deps(file, legal_deps)
    +    for hdr in deps.keys():
    +      deps.update(h_deps.get(hdr, {}))
    +
    +    f.write('%s: %s .make.dirs %s\n' % (obj, file, string.join(deps.values())))
    +
    +  return objects, dirs
    +
    +
     def extract_deps(fname, legal_deps):
       "Extract the headers this file includes."
       deps = { }
    @@ -104,16 +162,11 @@ def resolve_deps(header_deps):
     
     
     def get_files(patterns):
    -  patterns = string.replace(patterns, '{platform}', get_platform())
    -  patterns = string.split(string.strip(patterns))
       files = [ ]
    -  for pat in patterns:
    +  for pat in string.split(patterns):
         files.extend(glob.glob(pat))
       return files
     
    -def get_platform():
    -  return 'unix'
    -
     
     if __name__ == '__main__':
       main()
    diff --git a/configure.in b/configure.in
    index 956bfd16105..70c167477b6 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -349,11 +349,14 @@ proc_mutex_is_global=0
     
     config_subdirs="none"
     INSTALL_SUBDIRS="none"
    +OBJECTS_PLATFORM='$(OBJECTS_unix)'
    +
     case $host in
        i386-ibm-aix* | *-ibm-aix[1-2].* | *-ibm-aix3.* | *-ibm-aix4.1 | *-ibm-aix4.1.* | *-ibm-aix4.2 | *-ibm-aix4.2.*)
            OSDIR="aix"
            APR_ADDTO(LDFLAGS,-lld)
            eolstr="\\n"
    +       OBJECTS_PLATFORM='$(OBJECTS_aix)'
            ;;
        *-os2*)
            APR_ADDTO(CPPFLAGS,-DOS2)
    @@ -364,6 +367,7 @@ case $host in
            eolstr="\\r\\n"
            file_as_socket="0"
            proc_mutex_is_global=1
    +       OBJECTS_PLATFORM='$(OBJECTS_os2)'
            ;;
        *beos*)
            OSDIR="beos"
    @@ -374,6 +378,7 @@ case $host in
            eolstr="\\n"
            osver=`uname -r`
            proc_mutex_is_global=1
    +       OBJECTS_PLATFORM='$(OBJECTS_beos)'
            case $osver in
               5.0.4)
                  file_as_socket="1"
    @@ -385,6 +390,7 @@ case $host in
            ;;
        *os390)
            OSDIR="os390"
    +       OBJECTS_PLATFORM='$(OBJECTS_os390)'
            eolstr="\\n"
            ;;
        *os400)
    @@ -408,6 +414,8 @@ case $host in
            ;;
     esac
     
    +AC_SUBST(OBJECTS_PLATFORM)
    +
     AC_ARG_ENABLE(nonportable-atomics,
     [  --enable-nonportable-atomics  Use optimized atomic code which may produce nonportable binaries],
     [if test $enableval = yes; then
    
    From 207b571f2c98d7e43293140cd4bef4f875349e25 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Sat, 21 Feb 2004 14:10:19 +0000
    Subject: [PATCH 4842/7878] * configure.in: Fix comparison of mmap() return
     value.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64915 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/configure.in b/configure.in
    index 70c167477b6..f16ca180fef 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -637,7 +637,7 @@ if test "$ac_cv_func_mmap" = "yes" &&
                 return 1;
             }
             m = mmap(0, sizeof(void*), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
    -        if (m < 0) {  /* aka MAP_FAILED */
    +        if (m == (void *)-1) {  /* aka MAP_FAILED */
                 return 2;
             }
             if (munmap(m, sizeof(void*)) < 0) {
    
    From ee29a3892ad3b4dc79f11bb18c8e0d304d86704d Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Tue, 24 Feb 2004 04:21:13 +0000
    Subject: [PATCH 4843/7878] Sync PrintPath with the one in httpd-2.0 that has
     the AL v2.0 at top
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64917 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/PrintPath | 19 ++++++++++++++++---
     1 file changed, 16 insertions(+), 3 deletions(-)
    
    diff --git a/build/PrintPath b/build/PrintPath
    index c5b5dff7e34..0e512250f9d 100755
    --- a/build/PrintPath
    +++ b/build/PrintPath
    @@ -1,4 +1,20 @@
     #!/bin/sh
    +#
    +# Copyright 1999-2004 The Apache Software Foundation
    +#
    +# Licensed under the Apache License, Version 2.0 (the "License");
    +# you may not use this file except in compliance with the License.
    +# You may obtain a copy of the License at
    +#
    +#     http://www.apache.org/licenses/LICENSE-2.0
    +#
    +# Unless required by applicable law or agreed to in writing, software
    +# distributed under the License is distributed on an "AS IS" BASIS,
    +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +# See the License for the specific language governing permissions and
    +# limitations under the License.
    +#
    +#
     # Look for program[s] somewhere in $PATH.
     #
     # Options:
    @@ -12,9 +28,6 @@
     #
     # Initially written by Jim Jagielski for the Apache configuration mechanism
     #  (with kudos to Kernighan/Pike)
    -#
    -# This script falls under the Apache License.
    -# See http://www.apache.org/docs/LICENSE
     
     ##
     # Some "constants"
    
    From 8117c23fbd4936acd39c33195afab52519cb819f Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Tue, 24 Feb 2004 20:57:02 +0000
    Subject: [PATCH 4844/7878] * build/apr_hints.m4: Disable use of POSIX
     process-shared mutexes on Tru64 since they don't seem to be working.  (these
     are selected as the default locking mechanism since the "mmap of /dev/zero"
     configure test was fixed!)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64918 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_hints.m4 | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/build/apr_hints.m4 b/build/apr_hints.m4
    index 30fce1616cc..4d74412ee27 100644
    --- a/build/apr_hints.m4
    +++ b/build/apr_hints.m4
    @@ -155,6 +155,8 @@ dnl	       # Not a problem in 10.20.  Otherwise, who knows?
     	;;
         *-dec-osf*)
     	APR_ADDTO(CPPFLAGS, [-DOSF1])
    +        # process-shared mutexes don't seem to work in Tru64 5.0
    +        APR_SETIFNULL(apr_cv_process_shared_works, [no])
     	;;
         *-nto-qnx*)
     	;;
    
    From 3c3716b7bf1f67a87284a138d1213029a6085db9 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Thu, 26 Feb 2004 17:03:26 +0000
    Subject: [PATCH 4845/7878] Fix some include paths for the new build system
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64919 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/beos/proc_mutex.c    | 2 +-
     locks/beos/thread_cond.c   | 4 ++--
     locks/beos/thread_mutex.c  | 2 +-
     locks/beos/thread_rwlock.c | 2 +-
     4 files changed, 5 insertions(+), 5 deletions(-)
    
    diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c
    index af99aa82d4c..e1d694a4c68 100644
    --- a/locks/beos/proc_mutex.c
    +++ b/locks/beos/proc_mutex.c
    @@ -17,7 +17,7 @@
      * Stephen Beaulieu 
      */
      
    -#include "beos/apr_arch_proc_mutex.h"
    +#include "apr_arch_proc_mutex.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c
    index f759267e4b2..71068facb5c 100644
    --- a/locks/beos/thread_cond.c
    +++ b/locks/beos/thread_cond.c
    @@ -13,8 +13,8 @@
      * limitations under the License.
      */
     
    -#include "beos/apr_arch_thread_mutex.h"
    -#include "beos/apr_arch_thread_cond.h"
    +#include "apr_arch_thread_mutex.h"
    +#include "apr_arch_thread_cond.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c
    index 38e0dfd07b0..350e05b9b4a 100644
    --- a/locks/beos/thread_mutex.c
    +++ b/locks/beos/thread_mutex.c
    @@ -17,7 +17,7 @@
      * Stephen Beaulieu 
      */
      
    -#include "beos/apr_arch_thread_mutex.h"
    +#include "apr_arch_thread_mutex.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    diff --git a/locks/beos/thread_rwlock.c b/locks/beos/thread_rwlock.c
    index df12cbaaed7..2f81407484a 100644
    --- a/locks/beos/thread_rwlock.c
    +++ b/locks/beos/thread_rwlock.c
    @@ -17,7 +17,7 @@
      * Stephen Beaulieu 
      */
      
    -#include "beos/apr_arch_thread_rwlock.h"
    +#include "apr_arch_thread_rwlock.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    
    From 3d9b0a09822025b870b1b291e968bc3c69511851 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Thu, 26 Feb 2004 17:04:13 +0000
    Subject: [PATCH 4846/7878] Cold but clear here today.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64920 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/beos/.cvsignore | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/locks/beos/.cvsignore b/locks/beos/.cvsignore
    index 2ebd06d3517..7712ce79860 100644
    --- a/locks/beos/.cvsignore
    +++ b/locks/beos/.cvsignore
    @@ -1,4 +1,5 @@
     Makefile
     *.lo
    +*.slo
     .libs
     .deps
    
    From cc733fa3d5c7b3c57000de0cbf49062d61281705 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 27 Feb 2004 14:37:03 +0000
    Subject: [PATCH 4847/7878] fix some compile and/or run-time bogosity on
     Unix-ish platforms with no O_NDELAY or FNDELAY flags
    
    this has been here since apr time zero when it was mis-copied
    from Apache httpd 1.3's buff.c, so perhaps this doesn't actually
    make anyone's life easer
    
    Discovered by: Joe Orton
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64923 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sockopt.c | 10 ++++------
     1 file changed, 4 insertions(+), 6 deletions(-)
    
    diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c
    index 9b70c8a415f..683cf6d721a 100644
    --- a/network_io/unix/sockopt.c
    +++ b/network_io/unix/sockopt.c
    @@ -29,10 +29,9 @@ static apr_status_t soblock(int sd)
     #elif defined(O_NDELAY)
         fd_flags &= ~O_NDELAY;
     #elif defined(FNDELAY)
    -    fd_flags &= ~O_FNDELAY;
    +    fd_flags |= FNDELAY;
     #else
    -    /* XXXX: this breaks things, but an alternative isn't obvious...*/
    -    return -1;
    +#error Please teach APR how to make sockets blocking on your platform.
     #endif
         if (fcntl(sd, F_SETFL, fd_flags) == -1) {
             return errno;
    @@ -56,10 +55,9 @@ static apr_status_t sononblock(int sd)
     #elif defined(O_NDELAY)
         fd_flags |= O_NDELAY;
     #elif defined(FNDELAY)
    -    fd_flags |= O_FNDELAY;
    +    fd_flags |= FNDELAY;
     #else
    -    /* XXXX: this breaks things, but an alternative isn't obvious...*/
    -    return -1;
    +#error Please teach APR how to make sockets non-blocking on your platform.
     #endif
         if (fcntl(sd, F_SETFL, fd_flags) == -1) {
             return errno;
    
    From daf950c8acca9ff8ca389a0c7214c9f61cc6b651 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 27 Feb 2004 15:06:26 +0000
    Subject: [PATCH 4848/7878] fix typo in previous commit
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64927 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sockopt.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c
    index 683cf6d721a..822e5d7d64f 100644
    --- a/network_io/unix/sockopt.c
    +++ b/network_io/unix/sockopt.c
    @@ -29,7 +29,7 @@ static apr_status_t soblock(int sd)
     #elif defined(O_NDELAY)
         fd_flags &= ~O_NDELAY;
     #elif defined(FNDELAY)
    -    fd_flags |= FNDELAY;
    +    fd_flags &= ~FNDELAY;
     #else
     #error Please teach APR how to make sockets blocking on your platform.
     #endif
    
    From 76520463ec3320f03b9f1c55aa693933885ab19b Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Sat, 28 Feb 2004 01:35:16 +0000
    Subject: [PATCH 4849/7878] unix/pollacc.c no longer exists, don't try to
     include it in the OS/2 build.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64928 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/os2/pollacc.c | 1 -
     1 file changed, 1 deletion(-)
     delete mode 100644 poll/os2/pollacc.c
    
    diff --git a/poll/os2/pollacc.c b/poll/os2/pollacc.c
    deleted file mode 100644
    index ac87d0aa149..00000000000
    --- a/poll/os2/pollacc.c
    +++ /dev/null
    @@ -1 +0,0 @@
    -#include "../unix/pollacc.c"
    
    From 465d28c624b46da453386ee72cf42ea6ebc3f3ec Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Sat, 28 Feb 2004 01:40:44 +0000
    Subject: [PATCH 4850/7878] OS/2: In apr_pollset_poll(), allow descriptors to
     be NULL. This makes it consistent with the unix implementation.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64929 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/os2/pollset.c | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c
    index 4c054c496dc..f6722182bde 100644
    --- a/poll/os2/pollset.c
    +++ b/poll/os2/pollset.c
    @@ -214,6 +214,9 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
             }
         }
     
    -    *descriptors = pollset->result_set;
    +    if (descriptors) {
    +        *descriptors = pollset->result_set;
    +    }
    +
         return APR_SUCCESS;
     }
    
    From dc10cd046e8cfa53db68085040c9e0a42ee31fe0 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Sat, 28 Feb 2004 18:31:41 +0000
    Subject: [PATCH 4851/7878] Relicense.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64930 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr-config.in             | 60 +++++++----------------------------
     atomic/win32/apr_atomic.c | 59 ++++++----------------------------
     build/apr_rules.mk.in     | 66 +++++++++------------------------------
     buildconf                 | 60 +++++++----------------------------
     include/apr.h.in          | 59 ++++++----------------------------
     include/apr.hnw           | 59 ++++++----------------------------
     include/apr.hw            | 59 ++++++----------------------------
     include/apr_random.h      | 59 ++++++----------------------------
     random/unix/apr_random.c  | 59 ++++++----------------------------
     random/unix/sha2.c        | 59 ++++++----------------------------
     random/unix/sha2.h        | 59 ++++++----------------------------
     11 files changed, 116 insertions(+), 542 deletions(-)
    
    diff --git a/apr-config.in b/apr-config.in
    index 403c52cfba6..230ad40cb71 100644
    --- a/apr-config.in
    +++ b/apr-config.in
    @@ -1,56 +1,18 @@
     #!/bin/sh
    -# ====================================================================
    -# The Apache Software License, Version 1.1
    +# Copyright 2001-2004 The Apache Software Foundation
    +# 
    +# Licensed under the Apache License, Version 2.0 (the "License");
    +# you may not use this file except in compliance with the License.
    +# You may obtain a copy of the License at
     #
    -# Copyright (c) 2001-2004 The Apache Software Foundation.  All rights
    -# reserved.
    +#    http://www.apache.org/licenses/LICENSE-2.0
     #
    -# Redistribution and use in source and binary forms, with or without
    -# modification, are permitted provided that the following conditions
    -# are met:
    +# Unless required by applicable law or agreed to in writing, software
    +# distributed under the License is distributed on an "AS IS" BASIS,
    +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +# See the License for the specific language governing permissions and
    +# limitations under the License.
     #
    -# 1. Redistributions of source code must retain the above copyright
    -#    notice, this list of conditions and the following disclaimer.
    -#
    -# 2. Redistributions in binary form must reproduce the above copyright
    -#    notice, this list of conditions and the following disclaimer in
    -#    the documentation and/or other materials provided with the
    -#    distribution.
    -#
    -# 3. The end-user documentation included with the redistribution,
    -#    if any, must include the following acknowledgment:
    -#       "This product includes software developed by the
    -#        Apache Software Foundation (http://www.apache.org/)."
    -#    Alternately, this acknowledgment may appear in the software itself,
    -#    if and wherever such third-party acknowledgments normally appear.
    -#
    -# 4. The names "Apache" and "Apache Software Foundation" must
    -#    not be used to endorse or promote products derived from this
    -#    software without prior written permission. For written
    -#    permission, please contact apache@apache.org.
    -#
    -# 5. Products derived from this software may not be called "Apache",
    -#    nor may "Apache" appear in their name, without prior written
    -#    permission of the Apache Software Foundation.
    -#
    -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    -# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    -# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    -# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    -# SUCH DAMAGE.
    -# ====================================================================
    -#
    -# This software consists of voluntary contributions made by many
    -# individuals on behalf of the Apache Software Foundation.  For more
    -# information on the Apache Software Foundation, please see
    -# .
     
     # APR script designed to allow easy command line access to APR configuration
     # parameters.
    diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c
    index 801f38cb39e..5ca8145afcd 100644
    --- a/atomic/win32/apr_atomic.c
    +++ b/atomic/win32/apr_atomic.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #include "apr.h"
    diff --git a/build/apr_rules.mk.in b/build/apr_rules.mk.in
    index 747adb1a34e..661c1bf5325 100644
    --- a/build/apr_rules.mk.in
    +++ b/build/apr_rules.mk.in
    @@ -1,55 +1,17 @@
    -# ====================================================================
    -# The Apache Software License, Version 1.1
    -#
    -# Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    -# reserved.
    -#
    -# Redistribution and use in source and binary forms, with or without
    -# modification, are permitted provided that the following conditions
    -# are met:
    -#
    -# 1. Redistributions of source code must retain the above copyright
    -#    notice, this list of conditions and the following disclaimer.
    -#
    -# 2. Redistributions in binary form must reproduce the above copyright
    -#    notice, this list of conditions and the following disclaimer in
    -#    the documentation and/or other materials provided with the
    -#    distribution.
    -#
    -# 3. The end-user documentation included with the redistribution,
    -#    if any, must include the following acknowledgment:
    -#       "This product includes software developed by the
    -#        Apache Software Foundation (http://www.apache.org/)."
    -#    Alternately, this acknowledgment may appear in the software itself,
    -#    if and wherever such third-party acknowledgments normally appear.
    -#
    -# 4. The names "Apache" and "Apache Software Foundation" must
    -#    not be used to endorse or promote products derived from this
    -#    software without prior written permission. For written
    -#    permission, please contact apache@apache.org.
    -#
    -# 5. Products derived from this software may not be called "Apache",
    -#    nor may "Apache" appear in their name, without prior written
    -#    permission of the Apache Software Foundation.
    -#
    -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    -# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    -# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    -# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    -# SUCH DAMAGE.
    -# ====================================================================
    -#
    -# This software consists of voluntary contributions made by many
    -# individuals on behalf of the Apache Software Foundation.  For more
    -# information on the Apache Software Foundation, please see
    -# .
    +# Copyright 2000-2004 The Apache Software Foundation
    +# 
    +# Licensed under the Apache License, Version 2.0 (the "License");
    +# you may not use this file except in compliance with the License.
    +# You may obtain a copy of the License at
    +#
    +#    http://www.apache.org/licenses/LICENSE-2.0
    +#
    +# Unless required by applicable law or agreed to in writing, software
    +# distributed under the License is distributed on an "AS IS" BASIS,
    +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +# See the License for the specific language governing permissions and
    +# limitations under the License.
    +#
     #
     
     #
    diff --git a/buildconf b/buildconf
    index 5a260a8711f..f64d5451edf 100755
    --- a/buildconf
    +++ b/buildconf
    @@ -1,56 +1,18 @@
     #!/bin/sh
    -# ====================================================================
    -# The Apache Software License, Version 1.1
    +# Copyright 2000-2004 The Apache Software Foundation
    +# 
    +# Licensed under the Apache License, Version 2.0 (the "License");
    +# you may not use this file except in compliance with the License.
    +# You may obtain a copy of the License at
     #
    -# Copyright (c) 2000-2004 The Apache Software Foundation.  All rights
    -# reserved.
    +#    http://www.apache.org/licenses/LICENSE-2.0
     #
    -# Redistribution and use in source and binary forms, with or without
    -# modification, are permitted provided that the following conditions
    -# are met:
    +# Unless required by applicable law or agreed to in writing, software
    +# distributed under the License is distributed on an "AS IS" BASIS,
    +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +# See the License for the specific language governing permissions and
    +# limitations under the License.
     #
    -# 1. Redistributions of source code must retain the above copyright
    -#    notice, this list of conditions and the following disclaimer.
    -#
    -# 2. Redistributions in binary form must reproduce the above copyright
    -#    notice, this list of conditions and the following disclaimer in
    -#    the documentation and/or other materials provided with the
    -#    distribution.
    -#
    -# 3. The end-user documentation included with the redistribution,
    -#    if any, must include the following acknowledgment:
    -#       "This product includes software developed by the
    -#        Apache Software Foundation (http://www.apache.org/)."
    -#    Alternately, this acknowledgment may appear in the software itself,
    -#    if and wherever such third-party acknowledgments normally appear.
    -#
    -# 4. The names "Apache" and "Apache Software Foundation" must
    -#    not be used to endorse or promote products derived from this
    -#    software without prior written permission. For written
    -#    permission, please contact apache@apache.org.
    -#
    -# 5. Products derived from this software may not be called "Apache",
    -#    nor may "Apache" appear in their name, without prior written
    -#    permission of the Apache Software Foundation.
    -#
    -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    -# DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    -# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    -# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    -# SUCH DAMAGE.
    -# ====================================================================
    -#
    -# This software consists of voluntary contributions made by many
    -# individuals on behalf of the Apache Software Foundation.  For more
    -# information on the Apache Software Foundation, please see
    -# .
     #
     
     # buildconf: Build the support scripts needed to compile from a
    diff --git a/include/apr.h.in b/include/apr.h.in
    index 2a19efbadbd..02ae79c1d5b 100644
    --- a/include/apr.h.in
    +++ b/include/apr.h.in
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     
    diff --git a/include/apr.hnw b/include/apr.hnw
    index a03bc0276c2..bc8b7b9e91a 100644
    --- a/include/apr.hnw
    +++ b/include/apr.hnw
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     
    diff --git a/include/apr.hw b/include/apr.hw
    index bf4830ff045..67bc1844202 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     
    diff --git a/include/apr_random.h b/include/apr_random.h
    index 4cd72956461..fb295aa0b5c 100644
    --- a/include/apr_random.h
    +++ b/include/apr_random.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2000-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     
     #ifndef APR_RANDOM_H
    diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c
    index cc7227336bc..b4daeb2f504 100644
    --- a/random/unix/apr_random.c
    +++ b/random/unix/apr_random.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2003-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     /*
      * See the paper "???" by Ben Laurie for an explanation of this PRNG.
    diff --git a/random/unix/sha2.c b/random/unix/sha2.c
    index 90acf1175ad..7e35e18f34d 100644
    --- a/random/unix/sha2.c
    +++ b/random/unix/sha2.c
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2003-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     /*
      * FILE:        sha2.c
    diff --git a/random/unix/sha2.h b/random/unix/sha2.h
    index 4a5dc30bf61..df99e76521a 100644
    --- a/random/unix/sha2.h
    +++ b/random/unix/sha2.h
    @@ -1,55 +1,16 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    +/* Copyright 2003-2004 The Apache Software Foundation
      *
    - * Copyright (c) 2003 The Apache Software Foundation.  All rights
    - * reserved.
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
      *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    + *     http://www.apache.org/licenses/LICENSE-2.0
      *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
      */
     /*
      * FILE:        sha2.h
    
    From f8fff48be21ec3e681c1cbf72f57ead245166906 Mon Sep 17 00:00:00 2001
    From: "Allan K. Edwards" 
    Date: Mon, 1 Mar 2004 15:55:54 +0000
    Subject: [PATCH 4852/7878] enable IPv6 for Windows XP and 2003. In addition
     this this we need a way to set APR_HAVE_IPV6 at build time in apr.hw
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64933 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr.hw | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/include/apr.hw b/include/apr.hw
    index 67bc1844202..7f2a26a4d59 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -48,11 +48,12 @@
      *   C4075: slight indirection changes (unsigned short* vs short[])
      *   C4100: unreferenced formal parameter
      *   C4127: conditional expression is constant
    + *   C4163: '_rotl64' : not available as an intrinsic function
      *   C4201: nonstandard extension nameless struct/unions
      *   C4244: int to char/short - precision loss
      *   C4514: unreferenced inline function removed
      */
    -#pragma warning(disable: 4100 4127 4201 4514; once: 4057 4075 4244)
    +#pragma warning(disable: 4100 4127 4163 4201 4514; once: 4057 4075 4244)
     
     /* Has windows.h already been included?  If so, our preferences don't matter,
      * but we will still need the winsock things no matter what was included.
    
    From 28ec09a81482b46dc5fb44610ad2599ba95fc82d Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 1 Mar 2004 21:05:44 +0000
    Subject: [PATCH 4853/7878] Add apr_threadattr_stacksize_set() for overriding
     the default stack size for threads created by apr_thread_create().
    
    This is currently a not-implemented stub for BeOS.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64934 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                                  |  4 ++++
     include/apr_thread_proc.h                |  8 ++++++++
     include/arch/os2/apr_arch_threadproc.h   |  1 +
     include/arch/win32/apr_arch_threadproc.h |  1 +
     threadproc/beos/thread.c                 |  6 ++++++
     threadproc/netware/thread.c              |  7 +++++++
     threadproc/os2/thread.c                  | 12 ++++++++++--
     threadproc/unix/thread.c                 | 16 ++++++++++++++++
     threadproc/win32/thread.c                | 16 ++++++++++++++--
     9 files changed, 67 insertions(+), 4 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 2e8d88e2f18..5102f17a933 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -7,6 +7,10 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.]
     
     Changes with APR 1.0
     
    +  *) Add apr_threadattr_stacksize_set() for overriding the default
    +     stack size for threads created by apr_thread_create().
    +     [Jeff Trawick]
    +
       *) The whole codebase was relicensed and is now available under
          the Apache License, Version 2.0 (http://www.apache.org/licenses).
          [Apache Software Foundation]
    diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h
    index 539ac471d65..ce793f6d2dc 100644
    --- a/include/apr_thread_proc.h
    +++ b/include/apr_thread_proc.h
    @@ -215,6 +215,14 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr,
      */
     APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr);
     
    +/**
    + * Set the stack size of newly created threads.
    + * @param attr The threadattr to affect 
    + * @param on The stack size in bytes
    + */
    +APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
    +                                                       apr_size_t stacksize);
    +
     /**
      * Create a new thread of execution
      * @param new_thread The newly created thread handle.
    diff --git a/include/arch/os2/apr_arch_threadproc.h b/include/arch/os2/apr_arch_threadproc.h
    index f61eb493892..2efc4d32b3e 100644
    --- a/include/arch/os2/apr_arch_threadproc.h
    +++ b/include/arch/os2/apr_arch_threadproc.h
    @@ -27,6 +27,7 @@
     struct apr_threadattr_t {
         apr_pool_t *pool;
         unsigned long attr;
    +    apr_size_t stacksize;
     };
     
     struct apr_thread_t {
    diff --git a/include/arch/win32/apr_arch_threadproc.h b/include/arch/win32/apr_arch_threadproc.h
    index f4903f0f169..6e8ac8d5411 100644
    --- a/include/arch/win32/apr_arch_threadproc.h
    +++ b/include/arch/win32/apr_arch_threadproc.h
    @@ -35,6 +35,7 @@ struct apr_thread_t {
     struct apr_threadattr_t {
         apr_pool_t *pool;
         apr_int32_t detach;
    +    apr_size_t stacksize;
     };
     
     struct apr_threadkey_t {
    diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c
    index 80ec13a6dd7..15f1ca09102 100644
    --- a/threadproc/beos/thread.c
    +++ b/threadproc/beos/thread.c
    @@ -49,6 +49,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr)
     	return APR_NOTDETACH;
     }
     
    +APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
    +                                                       apr_size_t stacksize)
    +{
    +    return APR_ENOTIMPL;
    +}
    +
     static void *dummy_worker(void *opaque)
     {
         apr_thread_t *thd = (apr_thread_t*)opaque;
    diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c
    index 374b0d3390c..1703b55b123 100644
    --- a/threadproc/netware/thread.c
    +++ b/threadproc/netware/thread.c
    @@ -50,6 +50,13 @@ apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr)
         return APR_NOTDETACH;
     }
     
    +APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
    +                                                       apr_size_t stacksize)
    +{
    +    attr->stack_size = stacksize;
    +    return APR_SUCCESS;
    +}
    +
     static void *dummy_worker(void *opaque)
     {
         apr_thread_t *thd = (apr_thread_t *)opaque;
    diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c
    index d9cc23210bd..24b29f680b0 100644
    --- a/threadproc/os2/thread.c
    +++ b/threadproc/os2/thread.c
    @@ -33,6 +33,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool
     
         (*new)->pool = pool;
         (*new)->attr = 0;
    +    (*new)->stacksize = 0;
         return APR_SUCCESS;
     }
     
    @@ -51,7 +52,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr)
         return (attr->attr & APR_THREADATTR_DETACHED) ? APR_DETACH : APR_NOTDETACH;
     }
     
    -
    +APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
    +                                                       apr_size_t stacksize)
    +{
    +    attr->stacksize = stacksize;
    +    return APR_SUCCESS;
    +}
     
     static void apr_thread_begin(void *arg)
     {
    @@ -94,7 +100,9 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t
         }
     
         thread->tid = _beginthread(apr_thread_begin, NULL, 
    -                               APR_THREAD_STACKSIZE, thread);
    +                               thread->attr->stacksize > 0 ?
    +                               thread->attr->stacksize : APR_THREAD_STACKSIZE,
    +                               thread);
             
         if (thread->tid < 0) {
             return errno;
    diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c
    index 6997e75df31..00eee7ea3a2 100644
    --- a/threadproc/unix/thread.c
    +++ b/threadproc/unix/thread.c
    @@ -78,6 +78,22 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr)
         return APR_NOTDETACH;
     }
     
    +APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
    +                                                       apr_size_t stacksize)
    +{
    +    int stat;
    +
    +    stat = pthread_attr_setstacksize(&attr->attr, stacksize);
    +    if (stat == 0) {
    +        return APR_SUCCESS;
    +    }
    +#ifdef PTHREAD_SETS_ERRNO
    +    stat = errno;
    +#endif
    +
    +    return stat;
    +}
    +
     static void *dummy_worker(void *opaque)
     {
         apr_thread_t *thread = (apr_thread_t*)opaque;
    diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c
    index da36c3d837b..92b6755a6a0 100644
    --- a/threadproc/win32/thread.c
    +++ b/threadproc/win32/thread.c
    @@ -38,6 +38,9 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new,
         }
     
         (*new)->pool = pool;
    +    (*new)->detach = 0;
    +    (*new)->stacksize = 0;
    +
         return APR_SUCCESS;
     }
     
    @@ -55,6 +58,13 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr)
         return APR_NOTDETACH;
     }
     
    +APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
    +                                                       apr_size_t stacksize)
    +{
    +    attr->stacksize = stacksize;
    +    return APR_SUCCESS;
    +}
    +
     static void *dummy_worker(void *opaque)
     {
         apr_thread_t *thd = (apr_thread_t *)opaque;
    @@ -89,13 +99,15 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new,
          * same size as the calling thread. 
          */
     #ifndef _WIN32_WCE
    -    if (((*new)->td = (HANDLE)_beginthreadex(NULL, 0, 
    +    if (((*new)->td = (HANDLE)_beginthreadex(NULL,
    +                        attr && attr->stacksize > 0 ? attr->stacksize : 0,
                             (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker,
                             (*new), 0, &temp)) == 0) {
             return APR_FROM_OS_ERROR(_doserrno);
         }
     #else
    -   if (((*new)->td = CreateThread(NULL, 0, 
    +   if (((*new)->td = CreateThread(NULL,
    +                        attr && attr->stacksize > 0 ? attr->stacksize : 0,
                             (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker,
                             (*new), 0, &temp)) == 0) {
             return apr_get_os_error();
    
    From de1d6edd40323156ac7fb8051dd8f5f1d474f99f Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Thu, 4 Mar 2004 16:17:25 +0000
    Subject: [PATCH 4854/7878] Workaround odd behaviour of AF_UNSPEC lookups with
     AI_PASSIVE set on some old versions of glibc:
    
    * network_io/sockets/sockaddr.c (call_resolver): Ignore anything other
    than AF_INET and AF_INET6 addresses.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64935 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sockaddr.c | 12 +++++++++++-
     1 file changed, 11 insertions(+), 1 deletion(-)
    
    diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
    index 348befc3b01..8593725e826 100644
    --- a/network_io/unix/sockaddr.c
    +++ b/network_io/unix/sockaddr.c
    @@ -352,7 +352,17 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa,
         prev_sa = NULL;
         ai = ai_list;
         while (ai) { /* while more addresses to report */
    -        apr_sockaddr_t *new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t));
    +        apr_sockaddr_t *new_sa;
    +
    +        /* Ignore anything bogus: getaddrinfo in some old versions of
    +         * glibc will return AF_UNIX entries for AF_UNSPEC+AI_PASSIVE
    +         * lookups. */
    +        if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) {
    +            ai = ai->ai_next;
    +            continue;
    +        }
    +
    +        new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t));
     
             new_sa->pool = p;
             memcpy(&new_sa->sa, ai->ai_addr, ai->ai_addrlen);
    
    From 3ba41ea5e01668393f45cf1f5763137b15c8df3d Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Fri, 5 Mar 2004 19:52:06 +0000
    Subject: [PATCH 4855/7878] Add apr_match_glob and two tests to make sure that
     it is working.  There is a problem that is documented in the code that
     requires an apr_filepath_basename.  That will be added soon.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64936 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_fnmatch.h | 12 +++++++
     strings/apr_fnmatch.c | 50 ++++++++++++++++++++++++++++
     test/Makefile.in      |  2 +-
     test/Makefile.win     |  2 +-
     test/test_apr.h       |  1 +
     test/testall.c        |  1 +
     test/testfnmatch.c    | 77 +++++++++++++++++++++++++++++++++++++++++++
     7 files changed, 143 insertions(+), 2 deletions(-)
     create mode 100644 test/testfnmatch.c
    
    diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h
    index 74a6572e589..7a2811aac8f 100644
    --- a/include/apr_fnmatch.h
    +++ b/include/apr_fnmatch.h
    @@ -43,6 +43,7 @@
      */
     
     #include "apr_errno.h"
    +#include "apr_tables.h"
     
     #ifdef __cplusplus
     extern "C" {
    @@ -87,6 +88,17 @@ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern,
      */
     APR_DECLARE(int) apr_fnmatch_test(const char *pattern);
     
    +/**
    + * Find all files that match a specified pattern.
    + * @param pattern The pattern to use for finding files.
    + * @param result Array to use when storing the results
    + * @param p The pool to use.
    + * @return non-zero if pattern has any glob characters in it
    + */
    +APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, 
    +                                         apr_array_header_t **result,
    +                                         apr_pool_t *p);
    +
     /** @} */
     
     #ifdef __cplusplus
    diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c
    index 08e2b9bc748..417ac831201 100644
    --- a/strings/apr_fnmatch.c
    +++ b/strings/apr_fnmatch.c
    @@ -45,8 +45,11 @@ static char sccsid[] = "@(#)fnmatch.c	8.2 (Berkeley) 4/16/94";
     #ifndef WIN32
     #include "apr_private.h"
     #endif
    +#include "apr_file_info.h"
     #include "apr_fnmatch.h"
    +#include "apr_tables.h"
     #include "apr_lib.h"
    +#include "apr_strings.h"
     #include 
     #if APR_HAVE_CTYPE_H
     # include 
    @@ -241,3 +244,50 @@ APR_DECLARE(int) apr_fnmatch_test(const char *pattern)
         }
         return 0;
     }
    +
    +/* Find all files matching the specified pattern */
    +APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, 
    +                                         apr_array_header_t **result,
    +                                         apr_pool_t *p)
    +{
    +    apr_dir_t *dir;
    +    apr_finfo_t finfo;
    +    apr_status_t rv;
    +    char *path;
    +
    +    /* XXX So, this is kind of bogus.  Basically, I need to strip any leading
    +     * directories off the pattern, but there is no portable way to do that.
    +     * So, for now we just find the last occurance of '/' and if that doesn't
    +     * return anything, then we look for '\'.  This means that we could
    +     * screw up on unix if the pattern is something like "foo\.*"  That '\'
    +     * isn't a directory delimiter, it is a part of the filename.  To fix this,
    +     * we really need apr_filepath_basename, which will be coming as soon as
    +     * I get to it.  rbb
    +     */
    +    char *idx = strrchr(pattern, '/');
    +    
    +    if (idx == NULL) {
    +        idx = strrchr(pattern, '\\');
    +    }
    +    if (idx == NULL) {
    +        path = ".";
    +    }
    +    else {
    +        path = apr_pstrndup(p, pattern, idx - pattern);
    +        pattern = idx + 1;
    +    }
    +
    +    *result = apr_array_make(p, 0, sizeof(char *));
    +    rv = apr_dir_open(&dir, path, p);
    +    if (rv != APR_SUCCESS) {
    +        return rv;
    +    }
    +
    +    while (apr_dir_read(&finfo, APR_FINFO_NAME, dir) == APR_SUCCESS) {
    +        if (apr_fnmatch(pattern, finfo.name, 0) == APR_SUCCESS) {
    +            *(const char **)apr_array_push(*result) = finfo.name;
    +        }
    +    }
    +    apr_dir_close(dir);
    +    return APR_SUCCESS;
    +}
    diff --git a/test/Makefile.in b/test/Makefile.in
    index e2462ff1ef6..f556ef32130 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -120,7 +120,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \
     	testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \
     	testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \
     	testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \
    -	testenv.lo testprocmutex.lo testrand2.lo
    +	testenv.lo testprocmutex.lo testrand2.lo testfnmatch.lo
     
     testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \
     	 readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS)
    diff --git a/test/Makefile.win b/test/Makefile.win
    index 85c32c80d36..f5d3fafa9aa 100644
    --- a/test/Makefile.win
    +++ b/test/Makefile.win
    @@ -99,7 +99,7 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \
     	testdso.obj testoc.obj testdup.obj testsockets.obj testproc.obj \
     	testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \
     	testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \
    -	testenv.obj testprocmutex.obj testrand2.obj 
    +	testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj
     
     testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS)
     	$(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \
    diff --git a/test/test_apr.h b/test/test_apr.h
    index 14150279b4d..f2c8684f8b3 100644
    --- a/test/test_apr.h
    +++ b/test/test_apr.h
    @@ -59,6 +59,7 @@ CuSuite *testnames(void);
     CuSuite *testuser(void);
     CuSuite *testpath(void);
     CuSuite *testenv(void);
    +CuSuite *testfnmatch(void);
     
     /* Assert that RV is an APR_SUCCESS value; else fail giving strerror
      * for RV and CONTEXT message. */
    diff --git a/test/testall.c b/test/testall.c
    index 70e626b2e28..04fda49c656 100644
    --- a/test/testall.c
    +++ b/test/testall.c
    @@ -70,6 +70,7 @@ static const struct testlist {
         {"testuser", testuser},
         {"testpath", testpath},
         {"testenv", testenv},
    +    {"testfnmatch", testfnmatch},
         {"LastTest", NULL}
     };
     
    diff --git a/test/testfnmatch.c b/test/testfnmatch.c
    new file mode 100644
    index 00000000000..4dcb058d070
    --- /dev/null
    +++ b/test/testfnmatch.c
    @@ -0,0 +1,77 @@
    +/* Copyright 2000-2004 The Apache Software Foundation
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +#include "test_apr.h"
    +
    +#include 
    +#include 
    +#include 
    +
    +#include "apr_file_info.h"
    +#include "apr_fnmatch.h"
    +#include "apr_tables.h"
    +
    +static void test_glob(CuTest *tc)
    +{
    +    int i;
    +    char **list;
    +    apr_array_header_t *result;
    +    apr_status_t rv = apr_match_glob("data\\*.txt", &result, p);
    +
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    /* XXX If we ever add a file that matches *.txt to data, then we need
    +     * to increase this.
    +     */
    +    CuAssertIntEquals(tc, 2, result->nelts);
    +
    +    list = (char **)result->elts;
    +    for (i = 0; i < result->nelts; i++) {
    +        char *dot = strrchr(list[i], '.');
    +        CuAssertStrEquals(tc, dot, ".txt");
    +    }
    +}
    +
    +static void test_glob_currdir(CuTest *tc)
    +{
    +    int i;
    +    char **list;
    +    apr_array_header_t *result;
    +    apr_status_t rv;
    +    apr_filepath_set("data", p);
    +    rv = apr_match_glob("*.txt", &result, p);
    +
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    /* XXX If we ever add a file that matches *.txt to data, then we need
    +     * to increase this.
    +     */
    +    CuAssertIntEquals(tc, 2, result->nelts);
    +
    +    list = (char **)result->elts;
    +    for (i = 0; i < result->nelts; i++) {
    +        char *dot = strrchr(list[i], '.');
    +        CuAssertStrEquals(tc, dot, ".txt");
    +    }
    +}
    +
    +CuSuite *testfnmatch(void)
    +{
    +    CuSuite *suite = CuSuiteNew("Fnmatch");
    +
    +    SUITE_ADD_TEST(suite, test_glob);
    +    SUITE_ADD_TEST(suite, test_glob_currdir);
    +
    +    return suite;
    +}
    +
    
    From d140647132671bc986b715657897bef0ec0b01dc Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Sat, 6 Mar 2004 02:49:50 +0000
    Subject: [PATCH 4856/7878] Fix a bug in apr_match_glob.  We need to strdup the
     filename, otherwise each call to apr_dir_read will overwrite the previous
     name.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64937 13f79535-47bb-0310-9956-ffa450edef68
    ---
     strings/apr_fnmatch.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c
    index 417ac831201..7c41ea6585e 100644
    --- a/strings/apr_fnmatch.c
    +++ b/strings/apr_fnmatch.c
    @@ -285,7 +285,7 @@ APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern,
     
         while (apr_dir_read(&finfo, APR_FINFO_NAME, dir) == APR_SUCCESS) {
             if (apr_fnmatch(pattern, finfo.name, 0) == APR_SUCCESS) {
    -            *(const char **)apr_array_push(*result) = finfo.name;
    +            *(const char **)apr_array_push(*result) = apr_pstrdup(p, finfo.name);
             }
         }
         apr_dir_close(dir);
    
    From c620cdf47bb2253249ed18f67ab515bb09ccae1a Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Sat, 6 Mar 2004 08:40:42 +0000
    Subject: [PATCH 4857/7878] * test/testfnmatch.c: Convert to Unix newlines.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64938 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfnmatch.c | 154 ++++++++++++++++++++++-----------------------
     1 file changed, 77 insertions(+), 77 deletions(-)
    
    diff --git a/test/testfnmatch.c b/test/testfnmatch.c
    index 4dcb058d070..dbd5852c03b 100644
    --- a/test/testfnmatch.c
    +++ b/test/testfnmatch.c
    @@ -1,77 +1,77 @@
    -/* Copyright 2000-2004 The Apache Software Foundation
    - *
    - * Licensed under the Apache License, Version 2.0 (the "License");
    - * you may not use this file except in compliance with the License.
    - * You may obtain a copy of the License at
    - *
    - *     http://www.apache.org/licenses/LICENSE-2.0
    - *
    - * Unless required by applicable law or agreed to in writing, software
    - * distributed under the License is distributed on an "AS IS" BASIS,
    - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    - * See the License for the specific language governing permissions and
    - * limitations under the License.
    - */
    -
    -#include "test_apr.h"
    -
    -#include 
    -#include 
    -#include 
    -
    -#include "apr_file_info.h"
    -#include "apr_fnmatch.h"
    -#include "apr_tables.h"
    -
    -static void test_glob(CuTest *tc)
    -{
    -    int i;
    -    char **list;
    -    apr_array_header_t *result;
    -    apr_status_t rv = apr_match_glob("data\\*.txt", &result, p);
    -
    -    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    /* XXX If we ever add a file that matches *.txt to data, then we need
    -     * to increase this.
    -     */
    -    CuAssertIntEquals(tc, 2, result->nelts);
    -
    -    list = (char **)result->elts;
    -    for (i = 0; i < result->nelts; i++) {
    -        char *dot = strrchr(list[i], '.');
    -        CuAssertStrEquals(tc, dot, ".txt");
    -    }
    -}
    -
    -static void test_glob_currdir(CuTest *tc)
    -{
    -    int i;
    -    char **list;
    -    apr_array_header_t *result;
    -    apr_status_t rv;
    -    apr_filepath_set("data", p);
    -    rv = apr_match_glob("*.txt", &result, p);
    -
    -    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    -    /* XXX If we ever add a file that matches *.txt to data, then we need
    -     * to increase this.
    -     */
    -    CuAssertIntEquals(tc, 2, result->nelts);
    -
    -    list = (char **)result->elts;
    -    for (i = 0; i < result->nelts; i++) {
    -        char *dot = strrchr(list[i], '.');
    -        CuAssertStrEquals(tc, dot, ".txt");
    -    }
    -}
    -
    -CuSuite *testfnmatch(void)
    -{
    -    CuSuite *suite = CuSuiteNew("Fnmatch");
    -
    -    SUITE_ADD_TEST(suite, test_glob);
    -    SUITE_ADD_TEST(suite, test_glob_currdir);
    -
    -    return suite;
    -}
    -
    +/* Copyright 2000-2004 The Apache Software Foundation
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +#include "test_apr.h"
    +
    +#include 
    +#include 
    +#include 
    +
    +#include "apr_file_info.h"
    +#include "apr_fnmatch.h"
    +#include "apr_tables.h"
    +
    +static void test_glob(CuTest *tc)
    +{
    +    int i;
    +    char **list;
    +    apr_array_header_t *result;
    +    apr_status_t rv = apr_match_glob("data\\*.txt", &result, p);
    +
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    /* XXX If we ever add a file that matches *.txt to data, then we need
    +     * to increase this.
    +     */
    +    CuAssertIntEquals(tc, 2, result->nelts);
    +
    +    list = (char **)result->elts;
    +    for (i = 0; i < result->nelts; i++) {
    +        char *dot = strrchr(list[i], '.');
    +        CuAssertStrEquals(tc, dot, ".txt");
    +    }
    +}
    +
    +static void test_glob_currdir(CuTest *tc)
    +{
    +    int i;
    +    char **list;
    +    apr_array_header_t *result;
    +    apr_status_t rv;
    +    apr_filepath_set("data", p);
    +    rv = apr_match_glob("*.txt", &result, p);
    +
    +    CuAssertIntEquals(tc, APR_SUCCESS, rv);
    +    /* XXX If we ever add a file that matches *.txt to data, then we need
    +     * to increase this.
    +     */
    +    CuAssertIntEquals(tc, 2, result->nelts);
    +
    +    list = (char **)result->elts;
    +    for (i = 0; i < result->nelts; i++) {
    +        char *dot = strrchr(list[i], '.');
    +        CuAssertStrEquals(tc, dot, ".txt");
    +    }
    +}
    +
    +CuSuite *testfnmatch(void)
    +{
    +    CuSuite *suite = CuSuiteNew("Fnmatch");
    +
    +    SUITE_ADD_TEST(suite, test_glob);
    +    SUITE_ADD_TEST(suite, test_glob_currdir);
    +
    +    return suite;
    +}
    +
    
    From 572ded29d34d649fc2b35309fa23f74390583f5c Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sun, 7 Mar 2004 01:29:21 +0000
    Subject: [PATCH 4858/7878] a fairly recent config fix changed default mutex
     mechanism from sysvsem to cross-process pthread on AIX
    
    but sysvsem, which was the default on AIX thus far, is a better choice
    there; pthread mutexes have no sysdef advantages on AIX, and
    of course pthread mutexes are subject to deadlock when the holder
    segfaults
    
    so define sysvsem as the default mechanism rather than leaving
    it up to chance
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64942 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_hints.m4 | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/build/apr_hints.m4 b/build/apr_hints.m4
    index 4d74412ee27..c1f49dffa93 100644
    --- a/build/apr_hints.m4
    +++ b/build/apr_hints.m4
    @@ -62,6 +62,7 @@ if test "x$apr_preload_done" != "xyes" ; then
               APR_ADDTO(CFLAGS, [-qHALT=E])
             fi
     	APR_SETIFNULL(apr_sysvsem_is_global, [yes])
    +	APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE])
     	APR_ADDTO(LDFLAGS, [-Wl,-brtl])
             ;;
         *-apollo-*)
    
    From 4509297447bcc3c4d9b28a50510b168257cad6d0 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Sun, 7 Mar 2004 20:50:41 +0000
    Subject: [PATCH 4859/7878] Restore copyright notices.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64946 13f79535-47bb-0310-9956-ffa450edef68
    ---
     LICENSE | 186 ++++++++++++++++++++++++++++++++++----------------------
     1 file changed, 112 insertions(+), 74 deletions(-)
    
    diff --git a/LICENSE b/LICENSE
    index 876754a9c23..a14c66e6459 100644
    --- a/LICENSE
    +++ b/LICENSE
    @@ -209,79 +209,117 @@ separate copyright notices and license terms. Your use of the source
     code for the these subcomponents is subject to the terms and
     conditions of the following licenses. 
     
    -For the include\apr_md5.h component: 
    -/*
    - * This is work is derived from material Copyright RSA Data Security, Inc.
    - *
    - * The RSA copyright statement and Licence for that original material is
    - * included below. This is followed by the Apache copyright statement and
    - * licence for the modifications made to that material.
    - */
    -
    -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
    -   rights reserved.
    -
    -   License to copy and use this software is granted provided that it
    -   is identified as the "RSA Data Security, Inc. MD5 Message-Digest
    -   Algorithm" in all material mentioning or referencing this software
    -   or this function.
    -
    -   License is also granted to make and use derivative works provided
    -   that such works are identified as "derived from the RSA Data
    -   Security, Inc. MD5 Message-Digest Algorithm" in all material
    -   mentioning or referencing the derived work.
    -
    -   RSA Data Security, Inc. makes no representations concerning either
    -   the merchantability of this software or the suitability of this
    -   software for any particular purpose. It is provided "as is"
    -   without express or implied warranty of any kind.
    -
    -   These notices must be retained in any copies of any part of this
    -   documentation and/or software.
    - */
    -
    -For the passwd\apr_md5.c component:
    +From strings/apr_fnmatch.c, include/apr_fnmatch.h, misc/unix/getopt.c,
    +file_io/unix/mktemp.c, strings/apr_strings.c:
     
    -/*
    - * This is work is derived from material Copyright RSA Data Security, Inc.
    +/* 
    + * Copyright (c) 1987, 1993, 1994
    + *      The Regents of the University of California.  All rights reserved.
      *
    - * The RSA copyright statement and Licence for that original material is
    - * included below. This is followed by the Apache copyright statement and
    - * licence for the modifications made to that material.
    - */
    -
    -/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
    - */
    -
    -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
    -   rights reserved.
    -
    -   License to copy and use this software is granted provided that it
    -   is identified as the "RSA Data Security, Inc. MD5 Message-Digest
    -   Algorithm" in all material mentioning or referencing this software
    -   or this function.
    -
    -   License is also granted to make and use derivative works provided
    -   that such works are identified as "derived from the RSA Data
    -   Security, Inc. MD5 Message-Digest Algorithm" in all material
    -   mentioning or referencing the derived work.
    -
    -   RSA Data Security, Inc. makes no representations concerning either
    -   the merchantability of this software or the suitability of this
    -   software for any particular purpose. It is provided "as is"
    -   without express or implied warranty of any kind.
    -
    -   These notices must be retained in any copies of any part of this
    -   documentation and/or software.
    - */
    -/*
    - * The apr_md5_encode() routine uses much code obtained from the FreeBSD 3.0
    - * MD5 crypt() function, which is licenced as follows:
    - * ----------------------------------------------------------------------------
    - * "THE BEER-WARE LICENSE" (Revision 42):
    - *  wrote this file.  As long as you retain this notice you
    - * can do whatever you want with this stuff. If we meet some day, and you think
    - * this stuff is worth it, you can buy me a beer in return.  Poul-Henning Kamp
    - * ----------------------------------------------------------------------------
    - */
    -
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in the
    + *    documentation and/or other materials provided with the distribution.
    + * 3. All advertising materials mentioning features or use of this software
    + *    must display the following acknowledgement:
    + *      This product includes software developed by the University of
    + *      California, Berkeley and its contributors.
    + * 4. Neither the name of the University nor the names of its contributors
    + *    may be used to endorse or promote products derived from this software
    + *    without specific prior written permission.
    + *
    + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
    + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    + * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
    + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    +
    +From network_io/unix/inet_ntop.c, network_io/unix/inet_pton.c:
    +
    +/* Copyright (c) 1996 by Internet Software Consortium.
    + *
    + * Permission to use, copy, modify, and distribute this software for any
    + * purpose with or without fee is hereby granted, provided that the above
    + * copyright notice and this permission notice appear in all copies.
    + *
    + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
    + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
    + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
    + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
    + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
    + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
    + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
    + * SOFTWARE.
    +
    +From dso/aix/dso.c:
    +
    + *  Based on libdl (dlfcn.c/dlfcn.h) which is
    + *  Copyright (c) 1992,1993,1995,1996,1997,1988
    + *  Jens-Uwe Mager, Helios Software GmbH, Hannover, Germany.
    + *
    + *  Not derived from licensed software.
    + *
    + *  Permission is granted to freely use, copy, modify, and redistribute
    + *  this software, provided that the author is not construed to be liable
    + *  for any results of using the software, alterations are clearly marked
    + *  as such, and this notice is not modified.
    +
    +From strings/apr_strnatcmp.c, include/apr_strings.h:
    +
    +  strnatcmp.c -- Perform 'natural order' comparisons of strings in C.
    +  Copyright (C) 2000 by Martin Pool 
    +
    +  This software is provided 'as-is', without any express or implied
    +  warranty.  In no event will the authors be held liable for any damages
    +  arising from the use of this software.
    +
    +  Permission is granted to anyone to use this software for any purpose,
    +  including commercial applications, and to alter it and redistribute it
    +  freely, subject to the following restrictions:
    +
    +  1. The origin of this software must not be misrepresented; you must not
    +     claim that you wrote the original software. If you use this software
    +     in a product, an acknowledgment in the product documentation would be
    +     appreciated but is not required.
    +  2. Altered source versions must be plainly marked as such, and must not be
    +     misrepresented as being the original software.
    +  3. This notice may not be removed or altered from any source distribution.
    +
    +
    +From test/CuTest.c, test/CuTest.h:
    +
    + * Copyright (c) 2002-2006 Asim Jalis
    + * 
    + * This library is released under the zlib/libpng license as described at
    + * 
    + * http://www.opensource.org/licenses/zlib-license.html
    + * 
    + * Here is the statement of the license:
    + * 
    + * This software is provided 'as-is', without any express or implied warranty. 
    + * In no event will the authors be held liable for any damages arising from 
    + * the use of this software.
    + * 
    + * Permission is granted to anyone to use this software for any purpose, 
    + * including commercial applications, and to alter it and redistribute it 
    + * freely, subject to the following restrictions:
    + * 
    + * 1. The origin of this software must not be misrepresented; you must not 
    + * claim that you wrote the original software. If you use this software in a 
    + * product, an acknowledgment in the product documentation would be 
    + * appreciated but is not required.
    + * 
    + * 2. Altered source versions must be plainly marked as such, and must not be
    + * misrepresented as being the original software.
    + * 
    + * 3. This notice may not be removed or altered from any source distribution.
    
    From 627dd8a0aa9879106321af951e5d573b7c0fc181 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Sun, 7 Mar 2004 21:15:04 +0000
    Subject: [PATCH 4860/7878] Synch with 0.9 branch.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64948 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 26 ++++++++++++++++++++++++--
     1 file changed, 24 insertions(+), 2 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 5102f17a933..397d2062a04 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -117,6 +117,28 @@ Changes with APR 1.0
     
     Changes with APR 0.9.5
     
    +  *) Various build fixes: thread_rwlock.c on some Solaris platforms
    +     (PR 22990); filestat.c on ReliantUnix (PR 22990); config.status
    +     on IRIX (PR 19251).  [Various]
    +
    +  *) Use NI_NAMEREQD instead of NI_NUMERICHOST in
    +     APR_CHECK_GETNAMEINFO_IPV4_MAPPED.  PR 24469.  [Justin Erenkrantz]
    +
    +  *) Ensure that apr_sockaddr_info_get() does not return anything
    +     other than AF_INET and AF_INET6 addresses.  [Joe Orton]
    +
    +  *) Clarify that apr_dir_read() does not guarantee order of returned
    +     entries as previously claimed.  [Joe Orton]
    +
    +  *) The whole codebase was relicensed and is now available under
    +     the Apache License, Version 2.0 (http://www.apache.org/licenses).
    +     [Apache Software Foundation]
    +
    +  *) Define apr_off_t as long rather than as off_t on platforms with a
    +     32-bit off_t to prevent incompatibility with packages such as
    +     Perl which redefine the size of off_t via _FILE_OFFSET_BITS on
    +     some platforms.  [Ben Reser ]
    +
       *) apr_socket_connect(): allow app to make subsequent call on 
          non-blocking socket.  [Jeff Trawick]
      
    @@ -127,8 +149,8 @@ Changes with APR 0.9.5
     
     Changes with APR 0.9.4
     
    -  *) fix apr_file_dup() and apr_file_dup2() to dup the ungetchar
    -     member [Stas Bekman]
    +  *) win32: fix apr_file_dup() and apr_file_dup2() to dup the
    +     ungetchar member [Stas Bekman]
     
       *) Preserve leading '../' segments as when merging to an empty and
          unrooted path - fixes a bug observed in SVN with Win32/Netware/OS2.
    
    From 18e3654ed5115d3b4bcdf13093eae4199352b5b4 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Tue, 9 Mar 2004 14:39:02 +0000
    Subject: [PATCH 4861/7878] Fixup for library usage by apr. - remove -lbe and
     -lroot as they're not needed. (-lroot causes regex problems   and segfaults
     under httpd) - remove a standard path that is no longer needed.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64949 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_hints.m4 | 8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/build/apr_hints.m4 b/build/apr_hints.m4
    index c1f49dffa93..f8c59500bad 100644
    --- a/build/apr_hints.m4
    +++ b/build/apr_hints.m4
    @@ -335,13 +335,13 @@ dnl	       # Not a problem in 10.20.  Otherwise, who knows?
             APR_SETIFNULL(apr_process_lock_is_global, [yes])
             case $PLATOSVERS in
                 5.0.4)
    -                APR_ADDTO(LDFLAGS, [-L/boot/develop/lib/x86 -L/boot/beos/system/lib -lbind -lsocket])
    -                APR_ADDTO(LIBS, [-lbind -lbe -lroot])
    +                APR_ADDTO(LDFLAGS, [-L/boot/beos/system/lib])
    +                APR_ADDTO(LIBS, [-lbind -lsocket])
                     APR_ADDTO(CPPFLAGS,[-DBONE7])
                     ;;
                 5.1)
    -                APR_ADDTO(LDFLAGS, [-L/boot/develop/lib/x86 -L/boot/beos/system/lib -lbind -lsocket])
    -                APR_ADDTO(LIBS, [-lbind -lbe -lroot])
    +                APR_ADDTO(LDFLAGS, [-L/boot/beos/system/lib])
    +                APR_ADDTO(LIBS, [-lbind -lsocket])
                     ;;
     	esac
     	APR_ADDTO(CPPFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK -DAP_AUTH_DBM_USE_APR])
    
    From d58566891540522818e9c59b0b7f28594ab01492 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Tue, 9 Mar 2004 14:39:45 +0000
    Subject: [PATCH 4862/7878] Add the apr_proc_mutex_cleanup function.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64950 13f79535-47bb-0310-9956-ffa450edef68
    ---
     locks/beos/proc_mutex.c | 6 ++++++
     1 file changed, 6 insertions(+)
    
    diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c
    index e1d694a4c68..8d3ca31c29b 100644
    --- a/locks/beos/proc_mutex.c
    +++ b/locks/beos/proc_mutex.c
    @@ -118,6 +118,12 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex)
         return stat;
     }
     
    +APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex)
    +{
    +    return _proc_mutex_cleanup(mutex);
    +}
    +
    +
     APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex)
     {
         return NULL;
    
    From 210e5fcd147ec04af7b9b8319b5e8457b9831ea2 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Tue, 9 Mar 2004 14:40:41 +0000
    Subject: [PATCH 4863/7878] Fix an include path.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64951 13f79535-47bb-0310-9956-ffa450edef68
    ---
     dso/beos/dso.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/dso/beos/dso.c b/dso/beos/dso.c
    index dac5fd50534..41fec345092 100644
    --- a/dso/beos/dso.c
    +++ b/dso/beos/dso.c
    @@ -13,7 +13,7 @@
      * limitations under the License.
      */
     
    -#include "beos/apr_arch_dso.h"
    +#include "apr_arch_dso.h"
     #include "apr_portable.h"
     
     #if APR_HAS_DSO
    
    From d5ee2d7e154010c1996f4e2b9576619b74a330fa Mon Sep 17 00:00:00 2001
    From: Ryan Bloom 
    Date: Tue, 9 Mar 2004 18:55:23 +0000
    Subject: [PATCH 4864/7878] Add a target to generate coverage information. 
     This assumes that you have built for a gcov run and have already run the
     tests. PR: Obtained from: Submitted by: Reviewed by:
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64952 13f79535-47bb-0310-9956-ffa450edef68
    ---
     Makefile.in       |  3 ++
     build/run-gcov.sh | 99 +++++++++++++++++++++++++++++++++++++++++++++++
     2 files changed, 102 insertions(+)
     create mode 100755 build/run-gcov.sh
    
    diff --git a/Makefile.in b/Makefile.in
    index 11fe93a3459..7b1898ac44c 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -113,6 +113,9 @@ apr.exp: exports.c export_vars.h
     dox:
     	doxygen $(top_srcdir)/docs/doxygen.conf
     
    +gcov: 
    +	build/run-gcov.sh
    +
     check: $(TARGET_LIB)
     	(cd test && $(MAKE) check)
     
    diff --git a/build/run-gcov.sh b/build/run-gcov.sh
    new file mode 100755
    index 00000000000..bf4a0a8292d
    --- /dev/null
    +++ b/build/run-gcov.sh
    @@ -0,0 +1,99 @@
    +#!/bin/sh
    +
    +if [ ! -d coverage ]; then
    +    mkdir coverage
    +fi
    +cd coverage
    +
    +for i in `find .. -name "*.bb" -maxdepth 1`; do
    +    gcov $i -o ..
    +done
    +
    +# It would be really nice to find a better way to do this than copying the 
    +# HTML into this script.  But, I am being lazy right now.
    +cat > index.html << EOF
    +
    +
    +
    +  
    +    
    +    
    +    Test Coverage
    +  
    +  
    +

    The Apache Portable Runtime Project

    + + + + + + + + +
    + ApacheCon +

    Get Involved

    + +
  • CVS
  • +
  • Mailing Lists
  • +
  • Snapshots
  • +
  • Build on Win32
  • +
  • Build on Unix
  • +
    +

    Download!

    + +
  • from a mirror
  • +
    +

    Docs

    + +
  • APR
  • +
  • APR-util
  • +
  • APR-iconv
  • +
    +

    Guidelines

    + +
  • Project Guidelines
  • +
  • Contributing
  • +
  • Version Numbers
  • +
    +

    Miscellaneous

    + +
  • License
  • +
  • Projects using APR
  • +
    +
    + + + +
    + + APR Test Coverage + +
    +
    +

    This should give us some idea of how well our tests actually stress our +code.

    +
    + +EOF + +for i in `find . -name "*.gcov" -print`; do + name=`echo $i | awk -F'/' {'print $2'}` + echo " $name
    " >> index.html +done; + +cat >> index.html << EOF +
    + +

    + + Copyright © 1999-2003, The Apache Software Foundation + +
    + + + +EOF From 3cd67ffa811964dc73883185ffab3f7329560e9e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 9 Mar 2004 18:57:54 +0000 Subject: [PATCH 4865/7878] Add instructions for generating coverage data. This could probably be automated better, but this is unlikely to be run often, so I am not too worried about automating it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64953 13f79535-47bb-0310-9956-ffa450edef68 --- README.dev | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.dev b/README.dev index c3527a0999d..d7167de201a 100644 --- a/README.dev +++ b/README.dev @@ -13,3 +13,18 @@ If you are building APR from a distribution tarball, buildconf will have already been run for you, and you therefore do not need to have either autoconf or libtool installed, and you do not need to run buildconf. Skip step one above and just run configure then make. + +Generating Test Coverage information +==================================== + +If you want to generate test coverage data, use the following steps: + +1) ./buildconf +2) CFLAGS="-fprofile-arcs -ftest-coverage ./configure +3) make +4) cd test +5) make +6) ./testall +7) cd .. +8) make gcov + From ca481644d666611f9c3936c42db365fa5e63f343 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 9 Mar 2004 18:59:39 +0000 Subject: [PATCH 4866/7878] Ignore all files generated by running coverage data. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64954 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 4 ++++ test/.cvsignore | 3 +++ 2 files changed, 7 insertions(+) diff --git a/.cvsignore b/.cvsignore index f375cee181f..9ec5b6b69a9 100644 --- a/.cvsignore +++ b/.cvsignore @@ -34,3 +34,7 @@ autom4te.cache ltcf-c.sh build-outputs.mk .make.dirs +*.bb +*.bbg +*.da +coverage diff --git a/test/.cvsignore b/test/.cvsignore index 4736de44928..cd27483746b 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -77,3 +77,6 @@ testall.ncb testall.opt testall.plg proc_child +*.bb +*.bbg +*.da From 11bf8f15631fc1ef28826e55bee22cdb29e46b08 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 9 Mar 2004 19:05:24 +0000 Subject: [PATCH 4867/7878] Add the instructions to the web page too. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64955 13f79535-47bb-0310-9956-ffa450edef68 --- build/run-gcov.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build/run-gcov.sh b/build/run-gcov.sh index bf4a0a8292d..f057f9f8d09 100755 --- a/build/run-gcov.sh +++ b/build/run-gcov.sh @@ -71,7 +71,19 @@ cat > index.html << EOF

    This should give us some idea of how well our tests actually stress our -code.

    +code. To generate this data, do the following:

    + +
  • ./buildconf
  • +
  • CFLAGS="-fprofile-arcs -ftest-coverage ./configure
  • +
  • make
  • +
  • cd test
  • +
  • make
  • +
  • ./testall
  • +
  • cd ..
  • +
  • make gcov
  • +
    +

    Note that this will only generate test coverage data for the testall script, +but all tests should be moving to the unified framework, so this is correct.

    EOF From 5e39553b10fd551c19594a07c06aa394fb3fd958 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 9 Mar 2004 23:46:54 +0000 Subject: [PATCH 4868/7878] Allow support for random bytes on older hardware git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64957 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/rand.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/misc/netware/rand.c b/misc/netware/rand.c index 0a602b0c187..c8afa3b550d 100644 --- a/misc/netware/rand.c +++ b/misc/netware/rand.c @@ -22,10 +22,50 @@ #include +static int NXSeedRandomInternal( size_t width, void *seed ) +{ + static int init = 0; + int *s = (int *) seed; + union { int x; char y[4]; } u; + + if (!init) { + srand(NXGetSystemTick()); + init = 1; + } + + if (width > 3) + { + do + { + *s++ = rand(); + } + while ((width -= 4) > 3); + } + + if (width > 0) + { + char *p = (char *) s; + + u.x = rand(); + + while (width > 0) + *p++ = u.y[width--]; + } + + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, apr_size_t length) { - return NXSeedRandom(length, buf); + int ret; + + if (NXSeedRandom(length, buf) != 0) { + return NXSeedRandomInternal (length, buf); + } + return APR_SUCCESS; } + + #endif /* APR_HAS_RANDOM */ From cc8175087acd7d0f219cfe6037761c700d502103 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 10 Mar 2004 02:44:27 +0000 Subject: [PATCH 4869/7878] add a last updated and change the copyright. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64959 13f79535-47bb-0310-9956-ffa450edef68 --- build/run-gcov.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/run-gcov.sh b/build/run-gcov.sh index f057f9f8d09..3543e727484 100755 --- a/build/run-gcov.sh +++ b/build/run-gcov.sh @@ -93,6 +93,8 @@ for i in `find . -name "*.gcov" -print`; do echo " $name
    " >> index.html done; +echo "

    Last generated `date`

    " >> index.html + cat >> index.html << EOF @@ -100,7 +102,7 @@ cat >> index.html << EOF
    - Copyright © 1999-2003, The Apache Software Foundation + Copyright © 1999-2004, The Apache Software Foundation From b9474a9399dde667827283d1fa520bb76bb4fa8b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 10 Mar 2004 18:48:25 +0000 Subject: [PATCH 4870/7878] Don't echo while building gcov data. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64962 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 7b1898ac44c..16c065d51c8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -114,7 +114,7 @@ dox: doxygen $(top_srcdir)/docs/doxygen.conf gcov: - build/run-gcov.sh + @build/run-gcov.sh check: $(TARGET_LIB) (cd test && $(MAKE) check) From a81753d4e46db46be1c19bd9380fd93046731979 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 10 Mar 2004 19:36:38 +0000 Subject: [PATCH 4871/7878] Add percent tested to the output of the coverage script. Also colorize the page based on the percent tested. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64963 13f79535-47bb-0310-9956-ffa450edef68 --- build/run-gcov.sh | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/build/run-gcov.sh b/build/run-gcov.sh index 3543e727484..702d9508f0a 100755 --- a/build/run-gcov.sh +++ b/build/run-gcov.sh @@ -5,10 +5,6 @@ if [ ! -d coverage ]; then fi cd coverage -for i in `find .. -name "*.bb" -maxdepth 1`; do - gcov $i -o .. -done - # It would be really nice to find a better way to do this than copying the # HTML into this script. But, I am being lazy right now. cat > index.html << EOF @@ -86,14 +82,35 @@ code. To generate this data, do the following:

    but all tests should be moving to the unified framework, so this is correct.

    + EOF -for i in `find . -name "*.gcov" -print`; do +for i in `find .. -name "*.bb" -maxdepth 1`; do + percent=`gcov $i -o .. | grep "%" | awk -F'%' {'print $1'}` name=`echo $i | awk -F'/' {'print $2'}` - echo " $name
    " >> index.html -done; + basename=`echo $name | awk -F'.' {'print $1'}` + + if [ "x$percent" = "x" ]; then + echo "" >> index.html + echo "" >> index.html + echo "
    Error generating data for $basename
    " >> index.html + continue; + fi + intpercent=`echo "$percent/1" | bc` + if [ $intpercent -lt 33 ]; then + color="#ffaaaa" + else if [ $intpercent -lt 66 ]; then + color="#ffff77" + else + color="#aaffaa" + fi + fi + + echo "
    $basename
    " >> index.html + echo "
    $percent% tested" >> index.html +done -echo "

    Last generated `date`

    " >> index.html +echo "

    Last generated `date`

    " >> index.html cat >> index.html << EOF From bf73d00435c72cd858f8698e69528dcda060e637 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 10 Mar 2004 19:40:16 +0000 Subject: [PATCH 4872/7878] Use a cellspacing of 0 for a better look. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64964 13f79535-47bb-0310-9956-ffa450edef68 --- build/run-gcov.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/run-gcov.sh b/build/run-gcov.sh index 702d9508f0a..5e6e20a9bab 100755 --- a/build/run-gcov.sh +++ b/build/run-gcov.sh @@ -82,7 +82,7 @@ code. To generate this data, do the following:

    but all tests should be moving to the unified framework, so this is correct.

    - +
    EOF for i in `find .. -name "*.bb" -maxdepth 1`; do From 7bd2676562cb398d5314485410e489056e64bc09 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 10 Mar 2004 20:58:34 +0000 Subject: [PATCH 4873/7878] * network_io/unix/sockets.c (apr_socket_accept): Move TPF check for accept returning zero out of httpd. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64965 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 20600b93ebe..d843fdf8814 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -167,6 +167,13 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, if ((*new)->socketdes < 0) { return errno; } +#ifdef TPF + if ((*new)->socketdes == 0) { + /* 0 is an invalid socket for TPF */ + return APR_EINTR; + } +#endif + *(*new)->local_addr = *sock->local_addr; /* The above assignment just overwrote the pool entry. Setting the local_addr From c2e299d98c731d180a4b000839bb7c11da73c9d5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 10 Mar 2004 22:00:16 +0000 Subject: [PATCH 4874/7878] Sort the files by name. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64966 13f79535-47bb-0310-9956-ffa450edef68 --- build/run-gcov.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/run-gcov.sh b/build/run-gcov.sh index 5e6e20a9bab..c918a9012e7 100755 --- a/build/run-gcov.sh +++ b/build/run-gcov.sh @@ -85,7 +85,7 @@ but all tests should be moving to the unified framework, so this is correct.

    EOF -for i in `find .. -name "*.bb" -maxdepth 1`; do +for i in `find .. -name "*.bb" -maxdepth 1 | sort`; do percent=`gcov $i -o .. | grep "%" | awk -F'%' {'print $1'}` name=`echo $i | awk -F'/' {'print $2'}` basename=`echo $name | awk -F'.' {'print $1'}` From 644d2f366155166ea5d67201248870c3426a5248 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 11 Mar 2004 01:50:59 +0000 Subject: [PATCH 4875/7878] Fix the links on the left side of the page. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64967 13f79535-47bb-0310-9956-ffa450edef68 --- build/run-gcov.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/build/run-gcov.sh b/build/run-gcov.sh index c918a9012e7..98f911fc89a 100755 --- a/build/run-gcov.sh +++ b/build/run-gcov.sh @@ -28,11 +28,11 @@ cat > index.html << EOF width="150" border="0" alt="ApacheCon" />

    Get Involved

    -
  • CVS
  • -
  • Mailing Lists
  • +
  • CVS
  • +
  • Mailing Lists
  • Snapshots
  • -
  • Build on Win32
  • -
  • Build on Unix
  • +
  • Build on Win32
  • +
  • Build on Unix
  • Download!

    @@ -40,20 +40,20 @@ cat > index.html << EOF

    Docs

    -
  • APR
  • -
  • APR-util
  • +
  • APR
  • +
  • APR-util
  • APR-iconv
  • Guidelines

    -
  • Project Guidelines
  • -
  • Contributing
  • -
  • Version Numbers
  • +
  • Project Guidelines
  • +
  • Contributing
  • +
  • Version Numbers
  • Miscellaneous

  • License
  • -
  • Projects using APR
  • +
  • Projects using APR
  • From 8522e9620cf4769c5cbbceda4f703e3db62b27a5 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 12 Mar 2004 17:24:36 +0000 Subject: [PATCH 4876/7878] * include/apr_errno.h: Treat EDQUOT like ENOSPC on Unix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64968 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/apr_errno.h b/include/apr_errno.h index ddd6f13c6dc..6bc8c219f77 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -1130,7 +1130,12 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, /** not a directory */ #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) /** no space left on device */ +#ifdef EDQUOT +#define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ + || (s) == EDQUOT) +#else #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC) +#endif /** not enough memory */ #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) /** too many open files */ From 1f06463a462a754d6654e0a4e176f4115150ffbc Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 12 Mar 2004 23:23:43 +0000 Subject: [PATCH 4877/7878] * configure.in: Don't use AC_TYPE_SIZE_T twice. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64969 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.in b/configure.in index f16ca180fef..322843b40a7 100644 --- a/configure.in +++ b/configure.in @@ -1023,7 +1023,6 @@ AC_TYPE_UID_T AC_CHECK_TYPE(ssize_t, int) AC_C_INLINE AC_C_CONST -AC_TYPE_SIZE_T AC_FUNC_SETPGRP APR_CHECK_SOCKLEN_T From f859fe46e3f13737ef00fd7701886b1507d2fa7f Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 13 Mar 2004 00:28:45 +0000 Subject: [PATCH 4878/7878] Migrate testatomic to testall. I have commented out a test that specifically states that we expect it to fail. We aren't actually testing APR with that test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64970 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 7 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testatomic.c | 426 +++++++++++++++++++--------------------------- 4 files changed, 177 insertions(+), 258 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index f556ef32130..0e0857f63f9 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -16,7 +16,6 @@ STDTEST_PORTABLE = \ testlockperf@EXEEXT@ \ testshmproducer@EXEEXT@ \ testshmconsumer@EXEEXT@ \ - testatomic@EXEEXT@ \ testmutexscope@EXEEXT@ \ testall@EXEEXT@ @@ -108,9 +107,6 @@ testprocmutex@EXEEXT@: testprocmutex.lo $(LOCAL_LIBS) testglobalmutex@EXEEXT@: testglobalmutex.lo $(LOCAL_LIBS) $(LINK_PROG) testglobalmutex.lo $(LOCAL_LIBS) $(ALL_LIBS) -testatomic@EXEEXT@: testatomic.lo $(LOCAL_LIBS) - $(LINK_PROG) testatomic.lo $(LOCAL_LIBS) $(ALL_LIBS) - testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) $(LINK_PROG) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -120,7 +116,8 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ - testenv.lo testprocmutex.lo testrand2.lo testfnmatch.lo + testenv.lo testprocmutex.lo testrand2.lo testfnmatch.lo \ + testatomic.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/test_apr.h b/test/test_apr.h index f2c8684f8b3..c50cffbd48b 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -60,6 +60,7 @@ CuSuite *testuser(void); CuSuite *testpath(void); CuSuite *testenv(void); CuSuite *testfnmatch(void); +CuSuite *testatomic(void); /* Assert that RV is an APR_SUCCESS value; else fail giving strerror * for RV and CONTEXT message. */ diff --git a/test/testall.c b/test/testall.c index 04fda49c656..2b79c392377 100644 --- a/test/testall.c +++ b/test/testall.c @@ -71,6 +71,7 @@ static const struct testlist { {"testpath", testpath}, {"testenv", testenv}, {"testfnmatch", testfnmatch}, + {"testatomic", testatomic}, {"LastTest", NULL} }; diff --git a/test/testatomic.c b/test/testatomic.c index d0955489b64..92c314179f9 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -13,17 +13,13 @@ * limitations under the License. */ -#include -#include +#include "test_apr.h" +#include "apr_strings.h" #include "apr_thread_proc.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_atomic.h" -#include "errno.h" #include "apr_time.h" -#if APR_HAVE_UNISTD_H -#include -#endif /* Use pthread_setconcurrency where it is available and not a nullop, * i.e. platforms using M:N or M:1 thread models: */ @@ -37,179 +33,159 @@ #include #endif -apr_pool_t *context; -apr_uint32_t y; /* atomic locks */ -apr_uint32_t y32; +static void test_init(CuTest *tc) +{ + apr_assert_success(tc, "Could not initliaze atomics", apr_atomic_init(p)); +} -static apr_status_t check_basic_atomics32(void) +static void test_set32(CuTest *tc) { - apr_uint32_t oldval; - apr_uint32_t casval = 0; - apr_uint32_t minus1 = -1; + apr_uint32_t y32; + apr_atomic_set32(&y32, 2); + CuAssertIntEquals(tc, 2, y32); +} +static void test_read32(CuTest *tc) +{ + apr_uint32_t y32; apr_atomic_set32(&y32, 2); - printf("%-60s", "testing apr_atomic_dec32"); - if (apr_atomic_dec32(&y32) == 0) { - fprintf(stderr, "Failed\noldval =%d should not be zero\n", - apr_atomic_read32(&y32)); - return APR_EGENERAL; - } - if (apr_atomic_dec32(&y32) != 0) { - fprintf(stderr, "Failed\noldval =%d should be zero\n", - apr_atomic_read32(&y32)); - return APR_EGENERAL; - } - printf("OK\n"); + CuAssertIntEquals(tc, 2, apr_atomic_read32(&y32)); +} + +static void test_dec32(CuTest *tc) +{ + apr_uint32_t y32; + int rv; + + apr_atomic_set32(&y32, 2); + + rv = apr_atomic_dec32(&y32); + CuAssertIntEquals(tc, 1, y32); + CuAssert(tc, "atomic_dec returned zero when it shouldn't", rv != 0); + + rv = apr_atomic_dec32(&y32); + CuAssertIntEquals(tc, 0, y32); + CuAssert(tc, "atomic_dec didn't returned zero when it should", rv == 0); +} + +static void test_xchg32(CuTest *tc) +{ + apr_uint32_t oldval; + apr_uint32_t y32; - printf("%-60s", "testing apr_atomic_xchg32"); apr_atomic_set32(&y32, 100); oldval = apr_atomic_xchg32(&y32, 50); - if (oldval != 100) { - fprintf(stderr, "Failed\noldval =%d should be 100\n", oldval); - return APR_EGENERAL; - } - if (y32 != 50) { - fprintf(stderr, "Failed\nnewval =%d should be 50\n", oldval); - return APR_EGENERAL; - } - printf("OK\n"); - printf("%-60s", "testing apr_atomic_cas32"); + CuAssertIntEquals(tc, 100, oldval); + CuAssertIntEquals(tc, 50, y32); +} + +static void test_cas_equal(CuTest *tc) +{ + apr_uint32_t casval = 0; + apr_uint32_t oldval; + oldval = apr_atomic_cas32(&casval, 12, 0); - if (oldval != 0) { - fprintf(stderr, "Failed\noldval =%d should be zero\n", oldval); - return APR_EGENERAL; - } - printf("OK\n"); - printf("%-60s", "testing apr_atomic_cas32 - match non-null"); - oldval = apr_atomic_cas32(&casval, 23, 12); - if (oldval != 12) { - fprintf(stderr, "Failed\noldval =%d should be 12 y=%d\n", - oldval, casval); - return APR_EGENERAL; - } - printf("OK\n"); - printf("%-60s", "testing apr_atomic_cas32 - no match"); + CuAssertIntEquals(tc, 0, oldval); + CuAssertIntEquals(tc, 12, casval); +} + +static void test_cas_equal_nonnull(CuTest *tc) +{ + apr_uint32_t casval = 12; + apr_uint32_t oldval; + oldval = apr_atomic_cas32(&casval, 23, 12); - if (oldval != 23) { - fprintf(stderr, "Failed\noldval =%d should be 23 y=%d\n", - oldval, casval); - return APR_EGENERAL; - } - printf("OK\n"); + CuAssertIntEquals(tc, 12, oldval); + CuAssertIntEquals(tc, 23, casval); +} + +static void test_cas_notequal(CuTest *tc) +{ + apr_uint32_t casval = 12; + apr_uint32_t oldval; + + oldval = apr_atomic_cas32(&casval, 23, 2); + CuAssertIntEquals(tc, 12, oldval); + CuAssertIntEquals(tc, 12, casval); +} + +static void test_add32(CuTest *tc) +{ + apr_uint32_t oldval; + apr_uint32_t y32; - printf("%-60s", "testing apr_atomic_add32"); apr_atomic_set32(&y32, 23); - if ((oldval = apr_atomic_add32(&y32, 4)) != 23) { - fprintf(stderr, - "Failed\noldval problem =%d should be 23\n", - oldval); - return APR_EGENERAL; - } - if ((oldval = apr_atomic_read32(&y32)) != 27) { - fprintf(stderr, - "Failed\nAtomic Add doesn't add up ;( expected 27 got %d\n", - oldval); - return APR_EGENERAL; - } - printf("OK\n"); - - printf("%-60s", "testing apr_atomic_inc32"); - if ((oldval = apr_atomic_inc32(&y32)) != 27) { - fprintf(stderr, - "Failed\noldval problem =%d should be 27\n", - oldval); - return APR_EGENERAL; - } - if ((oldval = apr_atomic_read32(&y32)) != 28) { - fprintf(stderr, - "Failed\nAtomic Inc didn't increment ;( expected 28 got %d\n", - oldval); - return APR_EGENERAL; - } - printf("OK\n"); + oldval = apr_atomic_add32(&y32, 4); + CuAssertIntEquals(tc, 23, oldval); + CuAssertIntEquals(tc, 27, y32); +} + +static void test_inc32(CuTest *tc) +{ + apr_uint32_t oldval; + apr_uint32_t y32; + + apr_atomic_set32(&y32, 23); + oldval = apr_atomic_inc32(&y32); + CuAssertIntEquals(tc, 23, oldval); + CuAssertIntEquals(tc, 24, y32); +} + +static void test_set_add_inc_sub(CuTest *tc) +{ + apr_uint32_t y32; - printf("%-60s", "testing add32/inc32/sub32"); apr_atomic_set32(&y32, 0); apr_atomic_add32(&y32, 20); apr_atomic_inc32(&y32); apr_atomic_sub32(&y32, 10); - if (apr_atomic_read32(&y32) != 11) { - fprintf(stderr, "Failed.\natomics do not add up: expected 11 got %d\n", - apr_atomic_read32(&y32)); - return APR_EGENERAL; - } - fprintf(stdout, "OK\n"); - printf("%-60s", "testing wrapping around zero"); + CuAssertIntEquals(tc, 11, y32); +} - apr_atomic_set32(&y32, 0); - if (apr_atomic_dec32(&y32) == 0) { - fprintf(stderr, "apr_atomic_dec32 on zero returned zero.\n"); - return APR_EGENERAL; - } - if (apr_atomic_read32(&y32) != minus1) { - fprintf(stderr, "zero wrap failed: 0 - 1 = %d\n", - apr_atomic_read32(&y32)); - return APR_EGENERAL; - } +static void test_wrap_zero(CuTest *tc) +{ + apr_uint32_t y32; + apr_uint32_t rv; + apr_uint32_t minus1 = -1; - if (apr_atomic_inc32(&y32) != minus1) { - fprintf(stderr, "apr_atomic_inc32 on -1 returned bad value.\n"); - return APR_EGENERAL; - } - if (apr_atomic_read32(&y32) != 0) { - fprintf(stderr, "zero wrap failed: -1 + 1 = %u\n", - apr_atomic_read32(&y32)); - return APR_EGENERAL; - } - printf("OK\n"); + apr_atomic_set32(&y32, 0); + rv = apr_atomic_dec32(&y32); - return APR_SUCCESS; + CuAssert(tc, "apr_atomic_dec32 on zero returned zero.", rv != 0); + char *str = apr_psprintf(p, "zero wrap failed: 0 - 1 = %d", y32); + CuAssert(tc, str, y32 == minus1); } -#if !APR_HAS_THREADS -int main(void) +static void test_inc_neg1(CuTest *tc) { - apr_status_t rv; - - apr_initialize(); + apr_uint32_t y32 = -1; + apr_uint32_t minus1 = -1; + apr_uint32_t rv; - fprintf(stderr, - "This program won't work fully on this platform because there is no " - "support for threads.\n"); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - fflush(stdout); - fprintf(stderr, "Failed.\nCould not initialize\n"); - exit(-1); - } - rv = apr_atomic_init(context); - if (rv != APR_SUCCESS) { - fprintf(stderr, "Failed.\nCould not initialize atomics\n"); - exit(-1); - } + rv = apr_atomic_inc32(&y32); - rv = check_basic_atomics32(); - if (rv != APR_SUCCESS) { - fprintf(stderr, "Failed.\n"); - exit(-1); - } - return 0; + CuAssert(tc, "apr_atomic_dec32 on zero returned zero.", rv == minus1); + char *str = apr_psprintf(p, "zero wrap failed: -1 + 1 = %d", y32); + CuAssert(tc, str, y32 == 0); } -#else /* !APR_HAS_THREADS */ + + +#if APR_HAS_THREADS void * APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data); apr_thread_mutex_t *thread_lock; -volatile long x = 0; /* mutex locks */ -volatile long z = 0; /* no locks */ -int value = 0; +volatile apr_uint32_t x = 0; /* mutex locks */ +volatile apr_uint32_t y = 0; /* atomic operations */ +volatile apr_uint32_t z = 0; /* no locks */ apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ -#define NUM_THREADS 20 -#define NUM_ITERATIONS 200000 +#define NUM_THREADS 40 +#define NUM_ITERATIONS 20000 void * APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data) { int i; @@ -248,136 +224,80 @@ void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data) return NULL; } -int main(int argc, char**argv) +static void test_atomics_threaded(CuTest *tc) { apr_thread_t *t1[NUM_THREADS]; apr_thread_t *t2[NUM_THREADS]; + apr_thread_t *t3[NUM_THREADS]; apr_status_t r1[NUM_THREADS]; apr_status_t r2[NUM_THREADS]; + apr_status_t r3[NUM_THREADS]; apr_status_t s1[NUM_THREADS]; apr_status_t s2[NUM_THREADS]; + apr_status_t s3[NUM_THREADS]; apr_status_t rv; int i; - int mutex; - - apr_initialize(); - - if (argc == 2 && argv[1][0] == 'm') { - mutex = 1; - } - else { - mutex = 0; - } - printf("APR Atomic Test\n===============\n\n"); #ifdef HAVE_PTHREAD_SETCONCURRENCY pthread_setconcurrency(8); #endif - printf("%-60s", "Initializing the context"); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - fflush(stdout); - fprintf(stderr, "Failed.\nCould not initialize\n"); - exit(-1); - } - printf("OK\n"); - - if (mutex == 1) { - printf("%-60s", "Initializing the lock"); - rv = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, - context); - if (rv != APR_SUCCESS) { - fflush(stdout); - fprintf(stderr, "Failed\nCould not create lock\n"); - exit(-1); - } - printf("OK\n"); - } - printf("%-60s", "Initializing the atomics"); - rv = apr_atomic_init(context); - if (rv != APR_SUCCESS) { - fprintf(stderr, "Failed.\n"); - exit(-1); - } - printf("OK\n"); - - rv = check_basic_atomics32(); - if (rv != APR_SUCCESS) { - fprintf(stderr, "Failed.\n"); - exit(-1); - } + rv = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, p); + apr_assert_success(tc, "Could not create lock", rv); - printf("%-60s", "Starting all the threads"); for (i = 0; i < NUM_THREADS; i++) { - r1[i] = apr_thread_create(&t1[i], NULL, - (mutex == 1 ? thread_func_mutex : thread_func_atomic), - NULL, context); - r2[i] = apr_thread_create(&t2[i], NULL, thread_func_none, NULL, - context); - if (r1[i] != APR_SUCCESS || r2[i] != APR_SUCCESS ) { - fflush(stdout); - fprintf(stderr, "Failed\nError starting thread in group %d\n",i); - exit(-1); - } + r1[i] = apr_thread_create(&t1[i], NULL, thread_func_mutex, NULL, p); + r2[i] = apr_thread_create(&t2[i], NULL, thread_func_atomic, NULL, p); + r3[i] = apr_thread_create(&t3[i], NULL, thread_func_none, NULL, p); + CuAssert(tc, "Failed creating threads", + r1[i] == APR_SUCCESS && r2[i] == APR_SUCCESS && + r3[i] == APR_SUCCESS); } - printf("OK\n"); - - printf("%-60s\n", "Waiting for threads to exit"); - printf("%-60s", "(Note that this may take a while to complete.)"); - fflush(stdout); for (i = 0; i < NUM_THREADS; i++) { apr_thread_join(&s1[i], t1[i]); apr_thread_join(&s2[i], t2[i]); - if (s1[i] != exit_ret_val || s2[i] != exit_ret_val) { - fprintf(stderr, - "Invalid return value\n" - "Got %d/%d, but expected %d for all \n", - s1[i], s2[i], exit_ret_val); - } - } - printf("OK\n"); - - if (mutex == 1) { - printf("%-60s", "Checking if mutex locks worked"); - if (x != NUM_THREADS * NUM_ITERATIONS) { - fflush(stdout); - fprintf(stderr, - "No!\nThe locks didn't work?? x = %ld instead of %ld\n", - x, - (long)NUM_THREADS * NUM_ITERATIONS); - } - else { - printf("OK\n"); - } - } - else { - printf("%-60s", "Checking if atomic worked"); - if (apr_atomic_read32(&y) != NUM_THREADS * NUM_ITERATIONS) { - fflush(stdout); - fprintf(stderr, - "No!\nThe atomics didn't work?? y = %ld instead of %ld\n", - (long)apr_atomic_read32(&y), - (long)NUM_THREADS * NUM_ITERATIONS); - } - else { - printf("OK\n"); - } - } - printf("%-60s", "Checking if nolock worked"); - if (z != NUM_THREADS * NUM_ITERATIONS) { - fflush(stdout); - fprintf(stderr, - "no surprise\n" - "The no-locks didn't work. z = %ld instead of %ld\n", - z, - (long)NUM_THREADS * NUM_ITERATIONS); - } - else { - printf("OK\n"); - } - - return 0; + apr_thread_join(&s3[i], t3[i]); + CuAssert(tc, "Invalid return value from thread_join", + s1[i] == exit_ret_val && s2[i] == exit_ret_val && + s3[i] == exit_ret_val); + } + + CuAssertIntEquals(tc, x, NUM_THREADS * NUM_ITERATIONS); + CuAssertIntEquals(tc, apr_atomic_read32(&y), NUM_THREADS * NUM_ITERATIONS); + /* Comment out this test, because I have no clue what this test is + * actually telling us. We are checking something that may or may not + * be true, and it isn't really testing APR at all. + CuAssert(tc, "We expect this to fail, because we tried to update " + "an integer in a non-thread-safe manner.", + z != NUM_THREADS * NUM_ITERATIONS); + */ } #endif /* !APR_HAS_THREADS */ + +CuSuite *testatomic(void) +{ + CuSuite *suite = CuSuiteNew("Atomic"); + + SUITE_ADD_TEST(suite, test_init); + SUITE_ADD_TEST(suite, test_set32); + SUITE_ADD_TEST(suite, test_read32); + SUITE_ADD_TEST(suite, test_dec32); + SUITE_ADD_TEST(suite, test_xchg32); + SUITE_ADD_TEST(suite, test_cas_equal); + SUITE_ADD_TEST(suite, test_cas_equal_nonnull); + SUITE_ADD_TEST(suite, test_cas_notequal); + SUITE_ADD_TEST(suite, test_add32); + SUITE_ADD_TEST(suite, test_inc32); + SUITE_ADD_TEST(suite, test_set_add_inc_sub); + SUITE_ADD_TEST(suite, test_wrap_zero); + SUITE_ADD_TEST(suite, test_inc_neg1); + +#if APR_HAS_THREADS + SUITE_ADD_TEST(suite, test_atomics_threaded); +#endif + + return suite; +} + From 02f93e31d4c90a0046c393b445b2ad653b9910cf Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 13 Mar 2004 00:29:31 +0000 Subject: [PATCH 4879/7878] Add testatomic to testall in the Windows build system. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64971 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/Makefile.win b/test/Makefile.win index f5d3fafa9aa..953f46a01b6 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -16,7 +16,6 @@ PROGRAMS = \ testlockperf.exe \ testshmproducer.exe \ testshmconsumer.exe \ - testatomic.exe \ testmutexscope.exe \ testall.exe \ mod_test.so @@ -87,9 +86,6 @@ testprocmutex.exe: testprocmutex.obj $(LOCAL_LIBS) testglobalmutex.exe: testglobalmutex.obj $(LOCAL_LIBS) $(LINK) testglobalmutex.obj $(LOCAL_LIBS) $(ALL_LIBS) -testatomic.exe: testatomic.obj $(LOCAL_LIBS) - $(LINK) testatomic.obj $(LOCAL_LIBS) $(ALL_LIBS) - testmutexscope.exe: testmutexscope.obj $(LOCAL_LIBS) $(LINK) testmutexscope.obj $(LOCAL_LIBS) $(ALL_LIBS) @@ -99,7 +95,8 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testdso.obj testoc.obj testdup.obj testsockets.obj testproc.obj \ testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \ testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ - testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj + testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj \ + testatomic.obj testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS) $(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ From b8d927b633db1120cd19b6e2606616873d4ecb02 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 13 Mar 2004 00:32:43 +0000 Subject: [PATCH 4880/7878] Stop messing around with _FOO_SOURCE things mid-configure: enable _GNU_SOURCE for glibc-based systems in the platform hints. (and avoid jumping through hoops to define _{XOPEN,BSD,SVID}_SOURCE which are all implied by _GNU_SOURCE anyway) * build/apr_hints.m4: Define _GNU_SOURCE in CPPFLAGS for GNU/HURD and GNU/Linux. * build/apr_common.m4: Remove tricks to get glibc to expose crypt_r. * configure.in: Remove tricks to get glibc to expose pthread_rwlock_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64972 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 17 +---------------- build/apr_hints.m4 | 4 ++-- configure.in | 18 +++--------------- 3 files changed, 6 insertions(+), 33 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 4b3294a717f..73a43572645 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -546,30 +546,15 @@ crypt_r("passwd", "hash", &buffer); ], ac_cv_crypt_r_style=struct_crypt_data) fi dnl -if test "$ac_cv_crypt_r_style" = "none"; then -dnl same as previous test, but see if defining _GNU_SOURCE helps -AC_TRY_COMPILE([ -#define _GNU_SOURCE -#include -],[ -struct crypt_data buffer; -crypt_r("passwd", "hash", &buffer); -], ac_cv_crypt_r_style=struct_crypt_data_gnu_source) -fi -dnl ]) if test "$ac_cv_crypt_r_style" = "cryptd"; then AC_DEFINE(CRYPT_R_CRYPTD, 1, [Define if crypt_r has uses CRYPTD]) fi # if we don't combine these conditions, CRYPT_R_STRUCT_CRYPT_DATA # will end up defined twice -if test "$ac_cv_crypt_r_style" = "struct_crypt_data" -o \ - "$ac_cv_crypt_r_style" = "struct_crypt_data_gnu_source"; then +if test "$ac_cv_crypt_r_style" = "struct_crypt_data"; then AC_DEFINE(CRYPT_R_STRUCT_CRYPT_DATA, 1, [Define if crypt_r uses struct crypt_data]) fi -if test "$ac_cv_crypt_r_style" = "struct_crypt_data_gnu_source"; then - APR_ADDTO(CPPFLAGS, [-D_GNU_SOURCE]) -fi ]) dnl diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index f8c59500bad..9c83a47e524 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -104,10 +104,10 @@ dnl # Not a problem in 10.20. Otherwise, who knows? * ) ;; esac - APR_ADDTO(CPPFLAGS, [-D_REENTRANT]) + APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE]) ;; *-GNU*) - APR_ADDTO(CPPFLAGS, [-DHURD]) + APR_ADDTO(CPPFLAGS, [-DHURD -D_GNU_SOURCE]) ;; *-lynx-lynxos) APR_ADDTO(CPPFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) diff --git a/configure.in b/configure.in index 322843b40a7..4645e5339da 100644 --- a/configure.in +++ b/configure.in @@ -526,25 +526,13 @@ else if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then dnl ----------------------------- Checking for pthread_rwlock_t - dnl Linux is silly as it has pthread_rwlock_init defined - dnl but keeps the pthread_rwlock_t structure hidden unless - dnl special things are defined. AC_CACHE_CHECK([for pthread_rwlock_t], [apr_cv_type_rwlock_t], AC_TRY_COMPILE([#include #include ], [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;], - [apr_cv_type_rwlock_t=yes], - [AC_TRY_COMPILE([#define _XOPEN_SOURCE 500 -#define _BSD_SOURCE -#define _SVID_SOURCE -#include -#include ], [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;], - [apr_cv_type_rwlock_t=yes-with-XOPEN_SOURCE], [apr_cv_type_rwlock_t=no])], + [apr_cv_type_rwlock_t=yes], [apr_cv_type_rwlock_t=no], [apr_cv_type_rwlock_t=no])) - case $apr_cv_type_rwlock_t in - yes*) AC_DEFINE(HAVE_PTHREAD_RWLOCKS, 1, [Define if pthread rwlocks are available]) ;; - esac - if test "$apr_cv_type_rwlock_t" = "yes-with-XOPEN_SOURCE"; then - APR_ADDTO(CPPFLAGS, [-D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE]) + if test "$apr_cv_type_rwlock_t" = "yes"; then + AC_DEFINE(HAVE_PTHREAD_RWLOCKS, 1, [Define if pthread rwlocks are available]) fi fi fi From 90c80c37733d55867765b576a6fa45d256ba71a3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 13 Mar 2004 00:33:24 +0000 Subject: [PATCH 4881/7878] Declare variables at the beginning of functions, I'm surprised this actually compiled on Linux. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64973 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index 92c314179f9..b92baae51c4 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -149,12 +149,13 @@ static void test_wrap_zero(CuTest *tc) apr_uint32_t y32; apr_uint32_t rv; apr_uint32_t minus1 = -1; + char *str; apr_atomic_set32(&y32, 0); rv = apr_atomic_dec32(&y32); CuAssert(tc, "apr_atomic_dec32 on zero returned zero.", rv != 0); - char *str = apr_psprintf(p, "zero wrap failed: 0 - 1 = %d", y32); + str = apr_psprintf(p, "zero wrap failed: 0 - 1 = %d", y32); CuAssert(tc, str, y32 == minus1); } @@ -163,11 +164,12 @@ static void test_inc_neg1(CuTest *tc) apr_uint32_t y32 = -1; apr_uint32_t minus1 = -1; apr_uint32_t rv; + char *str; rv = apr_atomic_inc32(&y32); CuAssert(tc, "apr_atomic_dec32 on zero returned zero.", rv == minus1); - char *str = apr_psprintf(p, "zero wrap failed: -1 + 1 = %d", y32); + str = apr_psprintf(p, "zero wrap failed: -1 + 1 = %d", y32); CuAssert(tc, str, y32 == 0); } From 34a51eaa415a0478c112e6b59da8db3a5b30f535 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 13 Mar 2004 01:24:43 +0000 Subject: [PATCH 4882/7878] * configure.in, build/apr_common.m4: Remove checks for crypt_r which are only necessary in apr-util. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64974 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 37 ------------------------------------- configure.in | 4 ---- 2 files changed, 41 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 73a43572645..fc0ae549381 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -519,43 +519,6 @@ else fi AC_MSG_RESULT([$msg]) ] ) -dnl -dnl APR_CHECK_CRYPT_R_STYLE -dnl -dnl Decide which of a couple of flavors of crypt_r() is necessary for -dnl this platform. -dnl -AC_DEFUN(APR_CHECK_CRYPT_R_STYLE,[ -AC_CACHE_CHECK(style of crypt_r, ac_cv_crypt_r_style,[ -dnl -ac_cv_crypt_r_style=none -dnl -AC_TRY_COMPILE([ -#include -],[ -CRYPTD buffer; -crypt_r("passwd", "hash", &buffer); -], ac_cv_crypt_r_style=cryptd) -dnl -if test "$ac_cv_crypt_r_style" = "none"; then -AC_TRY_COMPILE([ -#include -],[ -struct crypt_data buffer; -crypt_r("passwd", "hash", &buffer); -], ac_cv_crypt_r_style=struct_crypt_data) -fi -dnl -]) -if test "$ac_cv_crypt_r_style" = "cryptd"; then - AC_DEFINE(CRYPT_R_CRYPTD, 1, [Define if crypt_r has uses CRYPTD]) -fi -# if we don't combine these conditions, CRYPT_R_STRUCT_CRYPT_DATA -# will end up defined twice -if test "$ac_cv_crypt_r_style" = "struct_crypt_data"; then - AC_DEFINE(CRYPT_R_STRUCT_CRYPT_DATA, 1, [Define if crypt_r uses struct crypt_data]) -fi -]) dnl dnl APR_CHECK_DIRENT_INODE diff --git a/configure.in b/configure.in index 4645e5339da..f7b9c99dd00 100644 --- a/configure.in +++ b/configure.in @@ -848,10 +848,6 @@ AC_CHECK_FUNCS(strerror_r, [ strerror_r="1" ], [ strerror_r="0" ]) if test "$strerror_r" = "1"; then APR_CHECK_STRERROR_R_RC fi -AC_CHECK_FUNCS(crypt_r, [ crypt_r="1" ], [ crypt_r="0" ]) -if test "$crypt_r" = "1"; then - APR_CHECK_CRYPT_R_STYLE -fi AC_CHECK_FUNCS(mmap, [ mmap="1" ], [ mmap="0" ]) if test "$native_mmap_emul" = "1"; then mmap="1" From b893d0b5c7fe0c96c0fd808c096b550057e84f42 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 13 Mar 2004 01:50:58 +0000 Subject: [PATCH 4883/7878] No reason to keep track of the old return values. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64975 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index b92baae51c4..3c5c3af29b4 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -231,9 +231,6 @@ static void test_atomics_threaded(CuTest *tc) apr_thread_t *t1[NUM_THREADS]; apr_thread_t *t2[NUM_THREADS]; apr_thread_t *t3[NUM_THREADS]; - apr_status_t r1[NUM_THREADS]; - apr_status_t r2[NUM_THREADS]; - apr_status_t r3[NUM_THREADS]; apr_status_t s1[NUM_THREADS]; apr_status_t s2[NUM_THREADS]; apr_status_t s3[NUM_THREADS]; @@ -248,18 +245,21 @@ static void test_atomics_threaded(CuTest *tc) apr_assert_success(tc, "Could not create lock", rv); for (i = 0; i < NUM_THREADS; i++) { - r1[i] = apr_thread_create(&t1[i], NULL, thread_func_mutex, NULL, p); - r2[i] = apr_thread_create(&t2[i], NULL, thread_func_atomic, NULL, p); - r3[i] = apr_thread_create(&t3[i], NULL, thread_func_none, NULL, p); + apr_status_t r1, r2, r3; + r1 = apr_thread_create(&t1[i], NULL, thread_func_mutex, NULL, p); + r2 = apr_thread_create(&t2[i], NULL, thread_func_atomic, NULL, p); + r3 = apr_thread_create(&t3[i], NULL, thread_func_none, NULL, p); CuAssert(tc, "Failed creating threads", - r1[i] == APR_SUCCESS && r2[i] == APR_SUCCESS && - r3[i] == APR_SUCCESS); + r1 == APR_SUCCESS && r2 == APR_SUCCESS && + r3 == APR_SUCCESS); } for (i = 0; i < NUM_THREADS; i++) { + char *str; apr_thread_join(&s1[i], t1[i]); apr_thread_join(&s2[i], t2[i]); apr_thread_join(&s3[i], t3[i]); + CuAssert(tc, "Invalid return value from thread_join", s1[i] == exit_ret_val && s2[i] == exit_ret_val && s3[i] == exit_ret_val); From 17de35a810d8162c1231c2cb1b9c6bb09ace5af1 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 13 Mar 2004 01:51:59 +0000 Subject: [PATCH 4884/7878] Remove unused var. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64976 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 1 - 1 file changed, 1 deletion(-) diff --git a/test/testatomic.c b/test/testatomic.c index 3c5c3af29b4..ccd33d416fe 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -255,7 +255,6 @@ static void test_atomics_threaded(CuTest *tc) } for (i = 0; i < NUM_THREADS; i++) { - char *str; apr_thread_join(&s1[i], t1[i]); apr_thread_join(&s2[i], t2[i]); apr_thread_join(&s3[i], t3[i]); From 78996eb3108bb5cf0e9ca01e611e81f6fe9395d4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 13 Mar 2004 12:34:49 +0000 Subject: [PATCH 4885/7878] Migrate testflock to unified test framework git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64977 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + test/Makefile.in | 14 ++-- test/test_apr.h | 1 + test/testall.c | 1 + test/testflock.c | 183 +++++++++++++++++------------------------------ test/testflock.h | 26 +++++++ test/tryread.c | 62 ++++++++++++++++ 7 files changed, 165 insertions(+), 123 deletions(-) create mode 100644 test/testflock.h create mode 100644 test/tryread.c diff --git a/test/.cvsignore b/test/.cvsignore index cd27483746b..0d0f816f35c 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -72,6 +72,7 @@ testvsn testregex testmutexscope testtable +tryread testall testall.ncb testall.opt diff --git a/test/Makefile.in b/test/Makefile.in index 0e0857f63f9..8f9a9bdaa26 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -11,7 +11,6 @@ VPATH = @srcdir@ # or with special parameters STDTEST_PORTABLE = \ - testflock@EXEEXT@ \ testsock@EXEEXT@ \ testlockperf@EXEEXT@ \ testshmproducer@EXEEXT@ \ @@ -36,7 +35,7 @@ TARGETS = $(PROGRAMS) LOCAL_LIBS=../lib@APR_LIBNAME@.la CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \ -readchild@EXEEXT@ +readchild@EXEEXT@ tryread@EXEEXT@ CLEAN_SUBDIRS = internal INCDIR=../include @@ -55,14 +54,14 @@ check: $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) fi; \ done -testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS) - $(LINK_PROG) testflock.lo $(LOCAL_LIBS) $(ALL_LIBS) - occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS) $(LINK_PROG) occhild.lo $(LOCAL_LIBS) $(ALL_LIBS) readchild@EXEEXT@: readchild.lo $(LOCAL_LIBS) $(LINK_PROG) readchild.lo $(LOCAL_LIBS) $(ALL_LIBS) + +tryread@EXEEXT@: tryread.lo $(LOCAL_LIBS) + $(LINK_PROG) tryread.lo $(LOCAL_LIBS) $(ALL_LIBS) proc_child@EXEEXT@: proc_child.lo $(LOCAL_LIBS) $(LINK_PROG) proc_child.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -117,10 +116,11 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ testenv.lo testprocmutex.lo testrand2.lo testfnmatch.lo \ - testatomic.lo + testatomic.lo testflock.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ - readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) + readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ \ + tryread@EXEEXT@ $(LOCAL_LIBS) $(LINK_PROG) $(TESTS) CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/test_apr.h b/test/test_apr.h index c50cffbd48b..403ce74d828 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -61,6 +61,7 @@ CuSuite *testpath(void); CuSuite *testenv(void); CuSuite *testfnmatch(void); CuSuite *testatomic(void); +CuSuite *testflock(void); /* Assert that RV is an APR_SUCCESS value; else fail giving strerror * for RV and CONTEXT message. */ diff --git a/test/testall.c b/test/testall.c index 2b79c392377..663f8af19e1 100644 --- a/test/testall.c +++ b/test/testall.c @@ -72,6 +72,7 @@ static const struct testlist { {"testenv", testenv}, {"testfnmatch", testfnmatch}, {"testatomic", testatomic}, + {"testflock", testflock}, {"LastTest", NULL} }; diff --git a/test/testflock.c b/test/testflock.c index 35e94794d27..a1b6abeacf0 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -13,143 +13,94 @@ * limitations under the License. */ -/* - * USAGE - * - * Start one process, no args, and place it into the background. Start a - * second process with the "-r" switch to attempt a read on the file - * created by the first process. - * - * $ ./testflock & - * ...messages... - * $ ./testflock -r - * ...messages... - * - * The first process will sleep for 30 seconds while holding a lock. The - * second process will attempt to grab it (non-blocking) and fail. It - * will then grab it with a blocking scheme. When the first process' 30 - * seconds are up, it will exit (thus releasing its lock). The second - * process will acquire the lock, then exit. - */ - +#include "testflock.h" +#include "test_apr.h" #include "apr_pools.h" +#include "apr_thread_proc.h" #include "apr_file_io.h" -#include "apr_time.h" +#include "apr_file_info.h" #include "apr_general.h" -#include "apr_getopt.h" #include "apr_strings.h" -#include -#include - -const char *testfile = "testfile.tmp"; +/* XXX I'm sure there has to be a better way to do this ... */ +#ifdef WIN32 +#define EXTENSION ".exe" +#elif NETWARE +#define EXTENSION ".nlm" +#else +#define EXTENSION +#endif -static apr_pool_t *pool = NULL; -static void errmsg(const char *msg) +static int launch_reader(CuTest *tc) { - if (pool != NULL) - apr_pool_destroy(pool); - fprintf(stderr, msg); - exit(1); -} + int i; + apr_proc_t proc = {0}; + apr_procattr_t *procattr; + const char *args[2]; + apr_status_t rv; + apr_exit_why_e why; + int exitcode; -static void errmsg2(const char *msg, apr_status_t rv) -{ - char *newmsg; - char errstr[120]; - - apr_strerror(rv, errstr, sizeof errstr); - newmsg = apr_psprintf(pool, "%s: %s (%d)\n", - msg, errstr, rv); - errmsg(newmsg); - exit(1); -} + rv = apr_procattr_create(&procattr, p); + apr_assert_success(tc, "Couldn't create procattr", rv); -static void do_read(void) -{ - apr_file_t *file; - apr_status_t status; - - if (apr_file_open(&file, testfile, APR_WRITE, - APR_OS_DEFAULT, pool) != APR_SUCCESS) - errmsg("Could not open test file.\n"); - printf("Test file opened.\n"); - - status = apr_file_lock(file, APR_FLOCK_EXCLUSIVE | APR_FLOCK_NONBLOCK); - if (!APR_STATUS_IS_EAGAIN(status)) { - char msg[200]; - errmsg(apr_psprintf(pool, "Expected APR_EAGAIN. Got %d: %s.\n", - status, apr_strerror(status, msg, sizeof(msg)))); - } - printf("First attempt: we were properly locked out.\nWaiting for lock..."); - fflush(stdout); - - if (apr_file_lock(file, APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) - errmsg("Could not establish lock on test file."); - printf(" got it.\n"); + rv = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, + APR_NO_PIPE); + apr_assert_success(tc, "Couldn't set io in procattr", rv); - (void) apr_file_close(file); - printf("Exiting.\n"); + rv = apr_procattr_error_check_set(procattr, 1); + apr_assert_success(tc, "Couldn't set error check in procattr", rv); + + args[0] = "tryread" EXTENSION; + args[1] = NULL; + rv = apr_proc_create(&proc, "./tryread" EXTENSION, args, NULL, procattr, p); + apr_assert_success(tc, "Couldn't launch program", rv); + + CuAssert(tc, "wait for child process", + apr_proc_wait(&proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); + + CuAssert(tc, "child terminated normally", why == APR_PROC_EXIT); + return exitcode; } -static void do_write(void) +static void test_withlock(CuTest *tc) { apr_file_t *file; apr_status_t rv; + int code; + + rv = apr_file_open(&file, TESTFILE, APR_WRITE|APR_CREATE, + APR_OS_DEFAULT, p); + apr_assert_success(tc, "Could not create file.", rv); + CuAssertPtrNotNull(tc, file); - if (apr_file_open(&file, testfile, APR_WRITE|APR_CREATE, APR_OS_DEFAULT, - pool) != APR_SUCCESS) - errmsg("Could not create file.\n"); - printf("Test file created.\n"); - - if ((rv = apr_file_lock(file, APR_FLOCK_EXCLUSIVE)) != APR_SUCCESS) - errmsg2("Could not lock the file", rv); - printf("Lock created.\nSleeping..."); - fflush(stdout); + rv = apr_file_lock(file, APR_FLOCK_EXCLUSIVE); + apr_assert_success(tc, "Could not lock the file.", rv); + CuAssertPtrNotNull(tc, file); - apr_sleep(apr_time_from_sec(30)); + code = launch_reader(tc); + CuAssertIntEquals(tc, FAILED_READ, code); (void) apr_file_close(file); - printf(" done.\nExiting.\n"); } -int main(int argc, const char * const *argv) +static void test_withoutlock(CuTest *tc) +{ + apr_file_t *file; + apr_status_t rv; + int code; + + code = launch_reader(tc); + CuAssertIntEquals(tc, SUCCESSFUL_READ, code); +} + +CuSuite *testflock(void) { - int reader = 0; - apr_status_t status; - char optchar; - const char *optarg; - apr_getopt_t *opt; - - if (apr_initialize() != APR_SUCCESS) - errmsg("Could not initialize APR.\n"); - atexit(apr_terminate); - - if (apr_pool_create(&pool, NULL) != APR_SUCCESS) - errmsg("Could not create global pool.\n"); - - if (apr_getopt_init(&opt, pool, argc, argv) != APR_SUCCESS) - errmsg("Could not parse options.\n"); - - while ((status = apr_getopt(opt, "rf:", &optchar, &optarg)) == APR_SUCCESS) { - if (optchar == 'r') - ++reader; - else if (optchar == 'f') - testfile = optarg; - } - if (status != APR_SUCCESS && status != APR_EOF) { - char msgbuf[80]; - - fprintf(stderr, "error: %s\n", - apr_strerror(status, msgbuf, sizeof msgbuf)); - exit(1); - } - - if (reader) - do_read(); - else - do_write(); - - return 0; + CuSuite *suite = CuSuiteNew("Flock"); + + SUITE_ADD_TEST(suite, test_withlock); + SUITE_ADD_TEST(suite, test_withoutlock); + + return suite; } diff --git a/test/testflock.h b/test/testflock.h new file mode 100644 index 00000000000..a2020ae2f5d --- /dev/null +++ b/test/testflock.h @@ -0,0 +1,26 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TESTFLOCK +#define TESTFLOCK + +#define TESTFILE "data/testfile.lock" + +#define FAILED_READ 0 +#define SUCCESSFUL_READ 1 +#define UNEXPECTED_ERROR 2 + +#endif + diff --git a/test/tryread.c b/test/tryread.c new file mode 100644 index 00000000000..d60b942cbff --- /dev/null +++ b/test/tryread.c @@ -0,0 +1,62 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * USAGE + * + * Start one process, no args, and place it into the background. Start a + * second process with the "-r" switch to attempt a read on the file + * created by the first process. + * + * $ ./testflock & + * ...messages... + * $ ./testflock -r + * ...messages... + * + * The first process will sleep for 30 seconds while holding a lock. The + * second process will attempt to grab it (non-blocking) and fail. It + * will then grab it with a blocking scheme. When the first process' 30 + * seconds are up, it will exit (thus releasing its lock). The second + * process will acquire the lock, then exit. + */ + +#include "testflock.h" +#include "apr_pools.h" +#include "apr_file_io.h" +#include "apr_general.h" + +int main(int argc, const char * const *argv) +{ + apr_file_t *file; + apr_status_t status; + apr_pool_t *p; + + apr_initialize(); + apr_pool_create(&p, NULL); + + if (apr_file_open(&file, TESTFILE, APR_WRITE, APR_OS_DEFAULT, p) + != APR_SUCCESS) { + + exit(UNEXPECTED_ERROR); + } + status = apr_file_lock(file, APR_FLOCK_EXCLUSIVE | APR_FLOCK_NONBLOCK); + if (status == APR_SUCCESS) { + exit(SUCCESSFUL_READ); + } + if (APR_STATUS_IS_EAGAIN(status)) { + exit(FAILED_READ); + } + exit(UNEXPECTED_ERROR); +} From 73ba5af0762d7d524c058c6aeca9fd27e3f1b76e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 13 Mar 2004 12:38:16 +0000 Subject: [PATCH 4886/7878] Add testflock to windows build, cleanup after the test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64978 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 8 ++++---- test/testflock.c | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/test/Makefile.win b/test/Makefile.win index 953f46a01b6..f30441ec8e8 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -10,8 +10,8 @@ PROGRAMS = \ sendfile.exe \ server.exe \ proc_child.exe \ + tryread.exe \ occhild.exe\ - testflock.exe \ testsock.exe \ testlockperf.exe \ testshmproducer.exe \ @@ -39,8 +39,8 @@ clean: .c.obj: cl /nologo /c /MDd /W3 /GX /Zi /Od /DWIN32 /D_DEBUG /D_WINDOWS /DAPR_DECLARE_STATIC $(INCLUDES) $< -testflock.exe: testflock.obj $(LOCAL_LIBS) - $(LINK) testflock.obj $(LOCAL_LIBS) $(ALL_LIBS) +tryread.exe: tryread.obj $(LOCAL_LIBS) + $(LINK) tryread.obj $(LOCAL_LIBS) $(ALL_LIBS) occhild.exe: occhild.obj $(LOCAL_LIBS) $(LINK) occhild.obj $(LOCAL_LIBS) $(ALL_LIBS) @@ -96,7 +96,7 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \ testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj \ - testatomic.obj + testatomic.obj testflock.obj testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS) $(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ diff --git a/test/testflock.c b/test/testflock.c index a1b6abeacf0..db13cb500c7 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -95,12 +95,19 @@ static void test_withoutlock(CuTest *tc) CuAssertIntEquals(tc, SUCCESSFUL_READ, code); } +static void remove_lockfile(CuTest *tc) +{ + apr_assert_success(tc, "Couldn't remove lock file.", + apr_file_remove(TESTFILE, p)); +} + CuSuite *testflock(void) { CuSuite *suite = CuSuiteNew("Flock"); SUITE_ADD_TEST(suite, test_withlock); SUITE_ADD_TEST(suite, test_withoutlock); + SUITE_ADD_TEST(suite, remove_lockfile); return suite; } From 1bf480b2a8eba815014d121e4a0cc74a30c5ca0e Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 13 Mar 2004 12:40:33 +0000 Subject: [PATCH 4887/7878] Remove some unused variables git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64979 13f79535-47bb-0310-9956-ffa450edef68 --- test/testflock.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/testflock.c b/test/testflock.c index db13cb500c7..ad27210b0e6 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -34,7 +34,6 @@ static int launch_reader(CuTest *tc) { - int i; apr_proc_t proc = {0}; apr_procattr_t *procattr; const char *args[2]; @@ -87,8 +86,6 @@ static void test_withlock(CuTest *tc) static void test_withoutlock(CuTest *tc) { - apr_file_t *file; - apr_status_t rv; int code; code = launch_reader(tc); From 5c98f029709cdeef5dcac67cf4e373d6a77a22f6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 13 Mar 2004 13:01:05 +0000 Subject: [PATCH 4888/7878] Fix testfnmatch, it must clean up after itself by cd'ing back into the main test directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64980 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfnmatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testfnmatch.c b/test/testfnmatch.c index dbd5852c03b..adc8b29cbfd 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -63,6 +63,7 @@ static void test_glob_currdir(CuTest *tc) char *dot = strrchr(list[i], '.'); CuAssertStrEquals(tc, dot, ".txt"); } + apr_filepath_set("..", p); } CuSuite *testfnmatch(void) From 0f363be8f30cdfc256a9087fd734b01d252635da Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 13 Mar 2004 13:02:35 +0000 Subject: [PATCH 4889/7878] Put the lists of tests in alphabetical order. I am hoping that this makes the tests easier to find. Also, add testrand2 into the test suite. It has been written for the unified test suite, but it wasn't added to testall.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64981 13f79535-47bb-0310-9956-ffa450edef68 --- test/test_apr.h | 55 +++++++++++++++++++++++++------------------------ test/testall.c | 53 ++++++++++++++++++++++++----------------------- 2 files changed, 55 insertions(+), 53 deletions(-) diff --git a/test/test_apr.h b/test/test_apr.h index 403ce74d828..f98413b6879 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -27,41 +27,42 @@ extern apr_pool_t *p; CuSuite *getsuite(void); -CuSuite *teststr(void); -CuSuite *testtime(void); -CuSuite *testvsn(void); -CuSuite *testipsub(void); -CuSuite *testmmap(void); -CuSuite *testud(void); -CuSuite *testtable(void); -CuSuite *testhash(void); -CuSuite *testsleep(void); -CuSuite *testpool(void); -CuSuite *testfmt(void); -CuSuite *testfile(void); +CuSuite *testatomic(void); CuSuite *testdir(void); -CuSuite *testfileinfo(void); -CuSuite *testrand(void); -CuSuite *testrand2(void); CuSuite *testdso(void); -CuSuite *testoc(void); CuSuite *testdup(void); -CuSuite *testsockets(void); +CuSuite *testenv(void); +CuSuite *testfile(void); +CuSuite *testfileinfo(void); +CuSuite *testflock(void); +CuSuite *testfmt(void); +CuSuite *testfnmatch(void); +CuSuite *testgetopt(void); +CuSuite *testhash(void); +CuSuite *testipsub(void); +CuSuite *testlock(void); +CuSuite *testmmap(void); +CuSuite *testnames(void); +CuSuite *testoc(void); +CuSuite *testpath(void); +CuSuite *testpipe(void); +CuSuite *testpoll(void); +CuSuite *testpool(void); CuSuite *testproc(void); CuSuite *testprocmutex(void); -CuSuite *testpoll(void); -CuSuite *testlock(void); +CuSuite *testrand(void); +CuSuite *testrand2(void); +CuSuite *testsleep(void); CuSuite *testsockopt(void); -CuSuite *testpipe(void); +CuSuite *testsockets(void); +CuSuite *teststr(void); +CuSuite *testtable(void); CuSuite *testthread(void); -CuSuite *testgetopt(void); -CuSuite *testnames(void); +CuSuite *testtime(void); +CuSuite *testud(void); CuSuite *testuser(void); -CuSuite *testpath(void); -CuSuite *testenv(void); -CuSuite *testfnmatch(void); -CuSuite *testatomic(void); -CuSuite *testflock(void); +CuSuite *testvsn(void); + /* Assert that RV is an APR_SUCCESS value; else fail giving strerror * for RV and CONTEXT message. */ diff --git a/test/testall.c b/test/testall.c index 663f8af19e1..371ecbf07a3 100644 --- a/test/testall.c +++ b/test/testall.c @@ -39,40 +39,41 @@ static const struct testlist { const char *testname; CuSuite *(*func)(void); } tests[] = { - {"teststr", teststr}, - {"testtime", testtime}, - {"testvsn", testvsn}, - {"testipsub", testipsub}, - {"testmmap", testmmap}, - {"testud", testud}, - {"testtable", testtable}, - {"testhash", testhash}, - {"testsleep", testsleep}, - {"testpool", testpool}, - {"testfmt", testfmt}, + {"testargs", testgetopt}, + {"testatomic", testatomic}, + {"testdir", testdir}, + {"testdso", testdso}, + {"testdup", testdup}, + {"testenv", testenv}, {"testfile", testfile}, {"testfileinfo", testfileinfo}, + {"testflock", testflock}, + {"testfmt", testfmt}, + {"testfnmatch", testfnmatch}, + {"testhash", testhash}, + {"testipsub", testipsub}, + {"testlock", testlock}, + {"testmmap", testmmap}, + {"testnames", testnames}, + {"testoc", testoc}, + {"testpath", testpath}, {"testpipe", testpipe}, - {"testdup", testdup}, - {"testdir", testdir}, + {"testpoll", testpoll}, + {"testpool", testpool}, + {"testproc", testproc}, + {"testprocmutex", testprocmutex}, {"testrand", testrand}, - {"testdso", testdso}, - {"testoc", testoc}, + {"testrand2", testrand2}, + {"testsleep", testsleep}, {"testsockets", testsockets}, {"testsockopt", testsockopt}, - {"testproc", testproc}, - {"testprocmutex", testprocmutex}, - {"testpoll", testpoll}, - {"testlock", testlock}, + {"teststr", teststr}, + {"testtable", testtable}, {"testthread", testthread}, - {"testargs", testgetopt}, - {"testnames", testnames}, + {"testtime", testtime}, + {"testud", testud}, {"testuser", testuser}, - {"testpath", testpath}, - {"testenv", testenv}, - {"testfnmatch", testfnmatch}, - {"testatomic", testatomic}, - {"testflock", testflock}, + {"testvsn", testvsn}, {"LastTest", NULL} }; From 5892d44483b8e6f67ac2bcdbb9c9919ed2612d81 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 13 Mar 2004 21:41:04 +0000 Subject: [PATCH 4890/7878] Port testshm and all of it's component parts (testshmconsumer and testshmproducer) so that they are a part of the unified test suite. They are also now all portable programs, which means that we are actually using APR as a part of the tests. Also, just generally improve the tests. Now, we not only check that msgavail flag is set, we also check that the actuall message is transferred correctly. Finally, we ensure that the receiver received the same number of messages that the sender sent. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64982 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 6 +- test/Makefile.win | 3 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testshm.c | 349 +++++++++++++++++------------------------ test/testshmconsumer.c | 55 ++----- test/testshmproducer.c | 57 ++----- 7 files changed, 175 insertions(+), 297 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 8f9a9bdaa26..4e403a06033 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -19,7 +19,6 @@ STDTEST_PORTABLE = \ testall@EXEEXT@ STDTEST_NONPORTABLE = \ - testshm@EXEEXT@ \ testglobalmutex@EXEEXT@ OTHER_PROGRAMS = client@EXEEXT@ sendfile@EXEEXT@ \ @@ -91,9 +90,6 @@ server@EXEEXT@: server.lo $(LOCAL_LIBS) sendfile@EXEEXT@: sendfile.lo $(LOCAL_LIBS) $(LINK_PROG) sendfile.lo $(LOCAL_LIBS) $(ALL_LIBS) -testshm@EXEEXT@: testshm.lo $(LOCAL_LIBS) testshmproducer@EXEEXT@ testshmconsumer@EXEEXT@ - $(LINK_PROG) testshm.lo $(LOCAL_LIBS) $(ALL_LIBS) - testshmproducer@EXEEXT@: testshmproducer.lo $(LOCAL_LIBS) $(LINK_PROG) testshmproducer.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -116,7 +112,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ testenv.lo testprocmutex.lo testrand2.lo testfnmatch.lo \ - testatomic.lo testflock.lo + testatomic.lo testflock.lo testshm.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ \ diff --git a/test/Makefile.win b/test/Makefile.win index f30441ec8e8..4a6e826aed0 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -2,7 +2,6 @@ LINK=link /nologo NONPORTABLE = \ - testshm.exe \ testglobalmutex.exe PROGRAMS = \ @@ -96,7 +95,7 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \ testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj \ - testatomic.obj testflock.obj + testatomic.obj testflock.obj testshm.obj testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS) $(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ diff --git a/test/test_apr.h b/test/test_apr.h index f98413b6879..ebe93afcd7d 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -53,6 +53,7 @@ CuSuite *testprocmutex(void); CuSuite *testrand(void); CuSuite *testrand2(void); CuSuite *testsleep(void); +CuSuite *testshm(void); CuSuite *testsockopt(void); CuSuite *testsockets(void); CuSuite *teststr(void); diff --git a/test/testall.c b/test/testall.c index 371ecbf07a3..91abb1c214f 100644 --- a/test/testall.c +++ b/test/testall.c @@ -65,6 +65,7 @@ static const struct testlist { {"testrand", testrand}, {"testrand2", testrand2}, {"testsleep", testsleep}, + {"testshm", testshm}, {"testsockets", testsockets}, {"testsockopt", testsockopt}, {"teststr", teststr}, diff --git a/test/testshm.c b/test/testshm.c index 236f68c01fd..9d82dc2a69d 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -13,281 +13,214 @@ * limitations under the License. */ +#include "test_apr.h" #include "apr_shm.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" +#include "apr_thread_proc.h" #include "apr_time.h" -#include -#include -#include -#if APR_HAVE_UNISTD_H -#include -#endif +#include "testshm.h" #if APR_HAS_SHARED_MEMORY -typedef struct mbox { - char msg[1024]; - int msgavail; -} mbox; -mbox *boxes; - -#define N_BOXES 10 -#define N_MESSAGES 100 -#define SHARED_SIZE (apr_size_t)(N_BOXES * sizeof(mbox)) -#define SHARED_FILENAME "/tmp/apr.testshm.shm" - -static void msgwait(int sleep_sec, int first_box, int last_box) +static int msgwait(int sleep_sec, int first_box, int last_box) { int i; + int recvd = 0; apr_time_t start = apr_time_now(); apr_interval_time_t sleep_duration = apr_time_from_sec(sleep_sec); while (apr_time_now() - start < sleep_duration) { for (i = first_box; i < last_box; i++) { - if (boxes[i].msgavail) { - fprintf(stdout, "received a message in box %d, message was: %s\n", - i, boxes[i].msg); + if (boxes[i].msgavail && !strcmp(boxes[i].msg, MSG)) { + recvd++; boxes[i].msgavail = 0; /* reset back to 0 */ + /* reset the msg field. 1024 is a magic number and it should + * be a macro, but I am being lazy. + */ + memset(boxes[i].msg, 0, 1024); } } apr_sleep(apr_time_make(0, 10000)); /* 10ms */ } - fprintf(stdout, "done waiting on mailboxes...\n"); + return recvd; } static void msgput(int boxnum, char *msg) { - fprintf(stdout, "Sending message to box %d\n", boxnum); - apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg)); + apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg) + 1); boxes[boxnum].msgavail = 1; } -static apr_status_t test_anon(apr_pool_t *parpool) +static void test_anon_create(CuTest *tc) { apr_status_t rv; - apr_pool_t *pool; - apr_shm_t *shm; - apr_size_t retsize; - pid_t pid; - int cnt, i, exit_int; + apr_shm_t *shm = NULL; - rv = apr_pool_create(&pool, parpool); - if (rv != APR_SUCCESS) { - fprintf(stderr, "Error creating child pool\n"); - return rv; - } + rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); + apr_assert_success(tc, "Error allocating shared memory block", rv); + CuAssertPtrNotNull(tc, shm); - printf("Creating anonymous shared memory block (%" - APR_SIZE_T_FMT " bytes)........", SHARED_SIZE); - rv = apr_shm_create(&shm, SHARED_SIZE, NULL, pool); - if (rv != APR_SUCCESS) { - fprintf(stderr, "Error allocating shared memory block\n"); - return rv; - } - fprintf(stdout, "OK\n"); + rv = apr_shm_destroy(shm); + apr_assert_success(tc, "Error destroying shared memory block", rv); +} - printf("Checking size...%" APR_SIZE_T_FMT " bytes...", - retsize = apr_shm_size_get(shm)); - if (retsize != SHARED_SIZE) { - fprintf(stderr, "Error allocating shared memory block\n"); - return rv; - } - fprintf(stdout, "OK\n"); +static void test_check_size(CuTest *tc) +{ + apr_status_t rv; + apr_shm_t *shm = NULL; + apr_size_t retsize; - printf("Allocating shared mbox memory for %d boxes ..............", - N_BOXES); - boxes = apr_shm_baseaddr_get(shm); - if (boxes == NULL) { - fprintf(stderr, "Error creating message boxes.\n"); - return rv; - } - fprintf(stdout, "OK\n"); + rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); + apr_assert_success(tc, "Error allocating shared memory block", rv); + CuAssertPtrNotNull(tc, shm); - printf("Shared Process Test (child/parent)\n"); - pid = fork(); - if (pid == 0) { /* child */ - msgwait(5, 0, N_BOXES); - exit(0); - } - else if (pid > 0) { /* parent */ - i = N_BOXES; - cnt = N_MESSAGES; - while (--cnt > 0) { - if ((i-=3) < 0) { - i += N_BOXES; /* start over at the top */ - } - msgput(i, "Sending a message\n"); - apr_sleep(apr_time_make(0, 10000)); - } - } - else { - printf("Error creating a child process\n"); - return errno; - } - /* wait for the child */ - printf("Waiting for child to exit.\n"); - if (waitpid(pid, &exit_int, 0) < 0) { - return errno; - } + retsize = apr_shm_size_get(shm); + CuAssertIntEquals(tc, SHARED_SIZE, retsize); - printf("Destroying shared memory segment..."); rv = apr_shm_destroy(shm); - if (rv != APR_SUCCESS) { - printf("FAILED\n"); - return rv; - } - printf("OK\n"); + apr_assert_success(tc, "Error destroying shared memory block", rv); +} - apr_pool_destroy(pool); +static void test_shm_allocate(CuTest *tc) +{ + apr_status_t rv; + apr_shm_t *shm = NULL; + apr_size_t retsize; + + rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); + apr_assert_success(tc, "Error allocating shared memory block", rv); + CuAssertPtrNotNull(tc, shm); + + boxes = apr_shm_baseaddr_get(shm); + CuAssertPtrNotNull(tc, boxes); - return APR_SUCCESS; + rv = apr_shm_destroy(shm); + apr_assert_success(tc, "Error destroying shared memory block", rv); } -static apr_status_t test_named(apr_pool_t *parpool) +static void test_anon(CuTest *tc) { + apr_proc_t proc; apr_status_t rv; - apr_pool_t *pool; apr_shm_t *shm; apr_size_t retsize; - pid_t pidproducer, pidconsumer; - int exit_int; + pid_t pid; + int cnt, i, exit_int; + int recvd; - rv = apr_pool_create(&pool, parpool); - if (rv != APR_SUCCESS) { - fprintf(stderr, "Error creating child pool\n"); - return rv; - } + rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); + apr_assert_success(tc, "Error allocating shared memory block", rv); + CuAssertPtrNotNull(tc, shm); - printf("Creating named shared memory block (%" - APR_SIZE_T_FMT " bytes)........", SHARED_SIZE); - rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, pool); - if (rv != APR_SUCCESS) { - fprintf(stderr, "Error allocating shared memory block\n"); - return rv; - } - fprintf(stdout, "OK\n"); + retsize = apr_shm_size_get(shm); + CuAssertIntEquals(tc, SHARED_SIZE, retsize); - printf("Checking size...%" APR_SIZE_T_FMT " bytes...", - retsize = apr_shm_size_get(shm)); - if (retsize != SHARED_SIZE) { - fprintf(stderr, "Error allocating shared memory block\n"); - return rv; - } - fprintf(stdout, "OK\n"); - - printf("Allocating shared mbox memory for %d boxes ..............", - N_BOXES); boxes = apr_shm_baseaddr_get(shm); - if (boxes == NULL) { - fprintf(stderr, "Error creating message boxes.\n"); - return rv; - } - fprintf(stdout, "OK\n"); - - printf("fork()ing and exec()ing children:\n"); - pidproducer = fork(); - if (pidproducer == 0) { /* child */ - /* FIXME: exec a producer */ - printf("starting consumer.....\n"); - if (execlp("testshmconsumer", "testshmconsumer", (char*)0) < 0) { - return errno; - } - return 0; /* not reached - avoid warnings */ + CuAssertPtrNotNull(tc, boxes); + + rv = apr_proc_fork(&proc, p); + if (rv == APR_INCHILD) { /* child */ + int num = msgwait(5, 0, N_BOXES); + /* exit with the number of messages received so that the parent + * can check that all messages were received. + */ + exit(num); } - else if (pidproducer > 0) { /* parent */ - /* fork another child */ - pidconsumer = fork(); - if (pidconsumer == 0) { /* child */ - /* FIXME: exec a producer */ - printf("starting producer.....\n"); - if (execlp("testshmproducer", "testshmproducer", (char*)0) < 0) { - return errno; + else if (rv == APR_INPARENT) { /* parent */ + i = N_BOXES; + cnt = 0; + while (cnt++ < N_MESSAGES) { + if ((i-=3) < 0) { + i += N_BOXES; /* start over at the top */ } - } - else if (pidconsumer < 0) { /* parent */ - printf("Error creating a child process\n"); - return errno; + msgput(i, MSG); + apr_sleep(apr_time_make(0, 10000)); } } else { - printf("Error creating a child process\n"); - return errno; + CuFail(tc, "apr_proc_fork failed"); } /* wait for the child */ - printf("Waiting for producer to exit.\n"); - if (waitpid(pidconsumer, &exit_int, 0) < 0) { - return errno; - } - if (!WIFEXITED(exit_int)) { - printf("Producer was unsuccessful.\n"); - return APR_EGENERAL; - } - printf("Waiting for consumer to exit.\n"); - if (waitpid(pidproducer, &exit_int, 0) < 0) { - return errno; - } - if (!WIFEXITED(exit_int)) { - printf("Consumer was unsuccessful.\n"); - return APR_EGENERAL; - } + rv = apr_proc_wait(&proc, &recvd, NULL, APR_WAIT); + CuAssertIntEquals(tc, N_MESSAGES, recvd); - printf("Destroying shared memory segment..."); rv = apr_shm_destroy(shm); - if (rv != APR_SUCCESS) { - printf("FAILED\n"); - return rv; - } - printf("OK\n"); - - apr_pool_destroy(pool); - - return APR_SUCCESS; + apr_assert_success(tc, "Error destroying shared memory block", rv); } -int main(void) +static void test_named(CuTest *tc) { apr_status_t rv; - apr_pool_t *pool; - char errmsg[200]; + apr_shm_t *shm = NULL; + apr_size_t retsize; + apr_proc_t pidproducer, pidconsumer; + apr_procattr_t *attr1 = NULL, *attr2 = NULL; + int sent, received; + apr_exit_why_e why; + const char *args[4]; - apr_initialize(); + rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); + apr_assert_success(tc, "Error allocating shared memory block", rv); + CuAssertPtrNotNull(tc, shm); + + retsize = apr_shm_size_get(shm); + CuAssertIntEquals(tc, SHARED_SIZE, retsize); + + boxes = apr_shm_baseaddr_get(shm); + CuAssertPtrNotNull(tc, boxes); + + rv = apr_procattr_create(&attr1, p); + CuAssertPtrNotNull(tc, attr1); + apr_assert_success(tc, "Couldn't create attr1", rv); + args[0] = apr_pstrdup(p, "testshmproducer"); + args[1] = NULL; + rv = apr_proc_create(&pidproducer, "./testshmproducer", args, NULL, + attr1, p); + apr_assert_success(tc, "Couldn't launch producer", rv); + + rv = apr_procattr_create(&attr2, p); + CuAssertPtrNotNull(tc, attr2); + apr_assert_success(tc, "Couldn't create attr2", rv); + args[0] = apr_pstrdup(p, "testshmconsumer"); + rv = apr_proc_create(&pidconsumer, "./testshmconsumer", args, NULL, + attr2, p); + apr_assert_success(tc, "Couldn't launch consumer", rv); + + rv = apr_proc_wait(&pidconsumer, &received, &why, APR_WAIT); + CuAssertIntEquals(tc, APR_CHILD_DONE, rv); + CuAssertIntEquals(tc, APR_PROC_EXIT, why); + + rv = apr_proc_wait(&pidproducer, &sent, &why, APR_WAIT); + CuAssertIntEquals(tc, APR_CHILD_DONE, rv); + CuAssertIntEquals(tc, APR_PROC_EXIT, why); + + /* Cleanup before testing that producer and consumer worked correctly. + * This way, if they didn't succeed, we can just run this test again + * without having to cleanup manually. + */ + apr_assert_success(tc, "Error destroying shared memory", + apr_shm_destroy(shm)); - printf("APR Shared Memory Test\n"); - printf("======================\n\n"); + CuAssertIntEquals(tc, sent, received); - printf("Initializing the pool............................"); - if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { - printf("could not initialize pool\n"); - exit(-1); - } - printf("OK\n"); +} +#endif - rv = test_anon(pool); - if (rv != APR_SUCCESS) { - if (rv == APR_ENOTIMPL) { - printf("Anonymous shared memory unavailable on this platform.\n"); - } - else { - printf("Anonymous shared memory test FAILED: [%d] %s\n", - rv, apr_strerror(rv, errmsg, sizeof(errmsg))); - exit(-2); - } - } - printf("Anonymous shared memory test passed!\n"); +CuSuite *testshm(void) +{ + CuSuite *suite = CuSuiteNew("Shared Memory"); - if ((rv = test_named(pool)) != APR_SUCCESS) { - printf("Name-based shared memory test FAILED: [%d] %s \n", - rv, apr_strerror(rv, errmsg, sizeof(errmsg))); - exit(-3); - } - printf("Named shared memory test passed!\n"); +#if APR_HAS_SHARED_MEMORY + SUITE_ADD_TEST(suite, test_anon_create); + SUITE_ADD_TEST(suite, test_check_size); + SUITE_ADD_TEST(suite, test_shm_allocate); + SUITE_ADD_TEST(suite, test_anon); + SUITE_ADD_TEST(suite, test_named); +#endif - return 0; + return suite; } -#else /* APR_HAS_SHARED_MEMORY */ -#error shmem is not supported on this platform -#endif /* APR_HAS_SHARED_MEMORY */ diff --git a/test/testshmconsumer.c b/test/testshmconsumer.c index 3aaa5f2ead6..0fb78c76292 100644 --- a/test/testshmconsumer.c +++ b/test/testshmconsumer.c @@ -19,41 +19,27 @@ #include "apr_lib.h" #include "apr_strings.h" #include "apr_time.h" -#include -#include -#include -#if APR_HAVE_UNISTD_H -#include -#endif +#include "testshm.h" #if APR_HAS_SHARED_MEMORY -typedef struct mbox { - char msg[1024]; - int msgavail; -} mbox; -mbox *boxes; - -#define N_BOXES 10 -#define SHARED_SIZE (apr_size_t)(N_BOXES * sizeof(mbox)) -#define SHARED_FILENAME "/tmp/apr.testshm.shm" - -static void msgwait(int sleep_sec, int first_box, int last_box) +static int msgwait(int sleep_sec, int first_box, int last_box) { int i; + int recvd = 0; apr_time_t start = apr_time_now(); apr_interval_time_t sleep_duration = apr_time_from_sec(sleep_sec); while (apr_time_now() - start < sleep_duration) { for (i = first_box; i < last_box; i++) { - if (boxes[i].msgavail) { - fprintf(stdout, "Consumer: received a message in box %d, message was: %s\n", - i, boxes[i].msg); + if (boxes[i].msgavail && !strcmp(boxes[i].msg, MSG)) { + recvd++; boxes[i].msgavail = 0; /* reset back to 0 */ + memset(boxes[i].msg, 0, 1024); } } apr_sleep(apr_time_from_sec(1)); } - fprintf(stdout, "Consumer: done waiting on mailboxes...\n"); + return recvd; } int main(void) @@ -62,53 +48,40 @@ int main(void) apr_pool_t *pool; apr_shm_t *shm; char errmsg[200]; + int recvd; apr_initialize(); - printf("APR Shared Memory Test: CONSUMER\n"); - - printf("Initializing the pool............................"); if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { - printf("could not initialize pool\n"); exit(-1); } - printf("OK\n"); - printf("Consumer attaching to name-based shared memory...."); rv = apr_shm_attach(&shm, SHARED_FILENAME, pool); if (rv != APR_SUCCESS) { - printf("Consumer unable to attach to name-based shared memory " - "segment: [%d] %s \n", rv, - apr_strerror(rv, errmsg, sizeof(errmsg))); exit(-2); } - printf("OK\n"); boxes = apr_shm_baseaddr_get(shm); /* consume messages on all of the boxes */ - msgwait(30, 0, N_BOXES); /* wait for 30 seconds for messages */ + recvd = msgwait(30, 0, N_BOXES); /* wait for 30 seconds for messages */ - printf("Consumer detaching from name-based shared memory...."); rv = apr_shm_detach(shm); if (rv != APR_SUCCESS) { - printf("Consumer unable to detach from name-based shared memory " - "segment: [%d] %s \n", rv, - apr_strerror(rv, errmsg, sizeof(errmsg))); exit(-3); } - printf("OK\n"); - return 0; + return recvd; } #else /* APR_HAS_SHARED_MEMORY */ int main(void) { - printf("APR SHMEM test not run!\n"); - printf("shmem is not supported on this platform\n"); - return -1; + /* Just return, this program will never be called, so we don't need + * to print a message + */ + return 0; } #endif /* APR_HAS_SHARED_MEMORY */ diff --git a/test/testshmproducer.c b/test/testshmproducer.c index 83b086148d7..3f98bb23dfc 100644 --- a/test/testshmproducer.c +++ b/test/testshmproducer.c @@ -19,29 +19,12 @@ #include "apr_lib.h" #include "apr_strings.h" #include "apr_time.h" -#include -#include -#include -#if APR_HAVE_UNISTD_H -#include -#endif +#include "testshm.h" #if APR_HAS_SHARED_MEMORY - -typedef struct mbox { - char msg[1024]; - int msgavail; -} mbox; -mbox *boxes; - -#define N_BOXES 10 -#define SHARED_SIZE (apr_size_t)(N_BOXES * sizeof(mbox)) -#define SHARED_FILENAME "/tmp/apr.testshm.shm" - static void msgput(int boxnum, char *msg) { - fprintf(stdout, "Producer: Sending message to box %d\n", boxnum); - apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg)); + apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg) + 1); boxes[boxnum].msgavail = 1; } @@ -51,57 +34,49 @@ int main(void) apr_pool_t *pool; apr_shm_t *shm; int i; + int sent = 0; char errmsg[200]; apr_initialize(); - printf("APR Shared Memory Test: PRODUCER\n"); - - printf("Initializing the pool............................"); if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { - printf("could not initialize pool\n"); exit(-1); } - printf("OK\n"); - printf("Producer attaching to name-based shared memory...."); rv = apr_shm_attach(&shm, SHARED_FILENAME, pool); if (rv != APR_SUCCESS) { - printf("Producer unable to attach to name-based shared memory " - "segment: [%d] %s \n", rv, - apr_strerror(rv, errmsg, sizeof(errmsg))); exit(-2); } - printf("OK\n"); boxes = apr_shm_baseaddr_get(shm); - /* produce messages on all of the boxes, in descending order */ - for (i = N_BOXES - 1; i > 0; i--) { - msgput(i, "Sending a message\n"); + /* produce messages on all of the boxes, in descending order, + * Yes, we could just return N_BOXES, but I want to have a double-check + * in this code. The original code actually sent N_BOXES - 1 messages, + * so rather than rely on possibly buggy code, this way we know that we + * are returning the right number. + */ + for (i = N_BOXES - 1, sent = 0; i >= 0; i--, sent++) { + msgput(i, MSG); apr_sleep(apr_time_from_sec(1)); } - printf("Producer detaching from name-based shared memory...."); rv = apr_shm_detach(shm); if (rv != APR_SUCCESS) { - printf("Producer unable to detach from name-based shared memory " - "segment: [%d] %s \n", rv, - apr_strerror(rv, errmsg, sizeof(errmsg))); exit(-3); } - printf("OK\n"); - return 0; + return sent; } #else /* APR_HAS_SHARED_MEMORY */ int main(void) { - printf("APR SHMEM test not run!\n"); - printf("shmem is not supported on this platform\n"); - return -1; + /* Just return, this program will never be launched, so there is no + * reason to print a message. + */ + return 0; } #endif /* APR_HAS_SHARED_MEMORY */ From 23090a4914f274f24b25b7782a5147b21622eb32 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 13 Mar 2004 21:42:18 +0000 Subject: [PATCH 4891/7878] Add testshm.h, which I forgot when commiting the testshm changes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64983 13f79535-47bb-0310-9956-ffa450edef68 --- test/testshm.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/testshm.h diff --git a/test/testshm.h b/test/testshm.h new file mode 100644 index 00000000000..bb12f7c42d4 --- /dev/null +++ b/test/testshm.h @@ -0,0 +1,32 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TESTSHM_H +#define TESTSHM_H + +typedef struct mbox { + char msg[1024]; + int msgavail; +} mbox; +mbox *boxes; + +#define N_BOXES 10 +#define SHARED_SIZE (apr_size_t)(N_BOXES * sizeof(mbox)) +#define SHARED_FILENAME "data/apr.testshm.shm" +#define N_MESSAGES 100 +#define MSG "Sending a message" + +#endif + From b0b910f2f18c3cfa40c6921e203f37dbbab310d3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 13 Mar 2004 21:49:38 +0000 Subject: [PATCH 4892/7878] Finish the port of testshm(producer|consumer) to windows. This Add extensions to the apr_proc_create call in testshm. Remove the test that relies on apr_fork. Cleanup some unused variables. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64984 13f79535-47bb-0310-9956-ffa450edef68 --- test/testshm.c | 29 ++++++++++++++++++++--------- test/testshmconsumer.c | 1 - test/testshmproducer.c | 1 - 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/test/testshm.c b/test/testshm.c index 9d82dc2a69d..86dac66b46d 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -23,6 +23,15 @@ #include "apr_time.h" #include "testshm.h" +/* XXX I'm sure there has to be a better way to do this ... */ +#ifdef WIN32 +#define EXTENSION ".exe" +#elif NETWARE +#define EXTENSION ".nlm" +#else +#define EXTENSION +#endif + #if APR_HAS_SHARED_MEMORY static int msgwait(int sleep_sec, int first_box, int last_box) @@ -87,7 +96,6 @@ static void test_shm_allocate(CuTest *tc) { apr_status_t rv; apr_shm_t *shm = NULL; - apr_size_t retsize; rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); apr_assert_success(tc, "Error allocating shared memory block", rv); @@ -100,14 +108,14 @@ static void test_shm_allocate(CuTest *tc) apr_assert_success(tc, "Error destroying shared memory block", rv); } +#if APR_HAS_FORK static void test_anon(CuTest *tc) { apr_proc_t proc; apr_status_t rv; apr_shm_t *shm; apr_size_t retsize; - pid_t pid; - int cnt, i, exit_int; + int cnt, i; int recvd; rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); @@ -149,6 +157,7 @@ static void test_anon(CuTest *tc) rv = apr_shm_destroy(shm); apr_assert_success(tc, "Error destroying shared memory block", rv); } +#endif static void test_named(CuTest *tc) { @@ -174,18 +183,18 @@ static void test_named(CuTest *tc) rv = apr_procattr_create(&attr1, p); CuAssertPtrNotNull(tc, attr1); apr_assert_success(tc, "Couldn't create attr1", rv); - args[0] = apr_pstrdup(p, "testshmproducer"); + args[0] = apr_pstrdup(p, "testshmproducer" EXTENSION); args[1] = NULL; - rv = apr_proc_create(&pidproducer, "./testshmproducer", args, NULL, - attr1, p); + rv = apr_proc_create(&pidproducer, "./testshmproducer" EXTENSION, args, + NULL, attr1, p); apr_assert_success(tc, "Couldn't launch producer", rv); rv = apr_procattr_create(&attr2, p); CuAssertPtrNotNull(tc, attr2); apr_assert_success(tc, "Couldn't create attr2", rv); - args[0] = apr_pstrdup(p, "testshmconsumer"); - rv = apr_proc_create(&pidconsumer, "./testshmconsumer", args, NULL, - attr2, p); + args[0] = apr_pstrdup(p, "testshmconsumer" EXTENSION); + rv = apr_proc_create(&pidconsumer, "./testshmconsumer" EXTENSION, args, + NULL, attr2, p); apr_assert_success(tc, "Couldn't launch consumer", rv); rv = apr_proc_wait(&pidconsumer, &received, &why, APR_WAIT); @@ -216,7 +225,9 @@ CuSuite *testshm(void) SUITE_ADD_TEST(suite, test_anon_create); SUITE_ADD_TEST(suite, test_check_size); SUITE_ADD_TEST(suite, test_shm_allocate); +#if APR_HAS_FORK SUITE_ADD_TEST(suite, test_anon); +#endif SUITE_ADD_TEST(suite, test_named); #endif diff --git a/test/testshmconsumer.c b/test/testshmconsumer.c index 0fb78c76292..86979e53fd6 100644 --- a/test/testshmconsumer.c +++ b/test/testshmconsumer.c @@ -47,7 +47,6 @@ int main(void) apr_status_t rv; apr_pool_t *pool; apr_shm_t *shm; - char errmsg[200]; int recvd; apr_initialize(); diff --git a/test/testshmproducer.c b/test/testshmproducer.c index 3f98bb23dfc..5bef013630c 100644 --- a/test/testshmproducer.c +++ b/test/testshmproducer.c @@ -35,7 +35,6 @@ int main(void) apr_shm_t *shm; int i; int sent = 0; - char errmsg[200]; apr_initialize(); From fbfc472eca0d6613e86badc61fc5832aab48878c Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 14 Mar 2004 03:01:08 +0000 Subject: [PATCH 4893/7878] Reorganise the OS/2 random byte generation code to work with the new build scheme. This is needed so buildconf uses misc/unix for OS/2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64985 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/rand.c | 2 +- misc/{os2/randbyte.c => unix/randbyte_os2.inc} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename misc/{os2/randbyte.c => unix/randbyte_os2.inc} (100%) diff --git a/misc/unix/rand.c b/misc/unix/rand.c index d29c5581d99..894022f6d73 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -198,7 +198,7 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, #undef XSTR #ifdef OS2 -#include "../os2/randbyte.c" +#include "randbyte_os2.inc" #endif #endif /* APR_HAS_RANDOM */ diff --git a/misc/os2/randbyte.c b/misc/unix/randbyte_os2.inc similarity index 100% rename from misc/os2/randbyte.c rename to misc/unix/randbyte_os2.inc From 40c757af8809fd4ee6a37b433f5afde2bb73231c Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 14 Mar 2004 13:16:06 +0000 Subject: [PATCH 4894/7878] Remove some common macros to test_apr.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64986 13f79535-47bb-0310-9956-ffa450edef68 --- test/test_apr.h | 11 ++++++++++- test/testflock.c | 10 ---------- test/testoc.c | 9 --------- test/testpipe.c | 9 --------- test/testproc.c | 9 --------- 5 files changed, 10 insertions(+), 38 deletions(-) diff --git a/test/test_apr.h b/test/test_apr.h index ebe93afcd7d..1524e9a1720 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -19,6 +19,15 @@ #include "CuTest.h" #include "apr_pools.h" +/* XXX FIXME */ +#ifdef WIN32 +#define EXTENSION ".exe" +#elif NETWARE +#define EXTENSION ".nlm" +#else +#define EXTENSION +#endif + /* Some simple functions to make the test apps easier to write and * a bit more consistent... */ @@ -54,8 +63,8 @@ CuSuite *testrand(void); CuSuite *testrand2(void); CuSuite *testsleep(void); CuSuite *testshm(void); -CuSuite *testsockopt(void); CuSuite *testsockets(void); +CuSuite *testsockopt(void); CuSuite *teststr(void); CuSuite *testtable(void); CuSuite *testthread(void); diff --git a/test/testflock.c b/test/testflock.c index ad27210b0e6..79b5b032c02 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -22,16 +22,6 @@ #include "apr_general.h" #include "apr_strings.h" -/* XXX I'm sure there has to be a better way to do this ... */ -#ifdef WIN32 -#define EXTENSION ".exe" -#elif NETWARE -#define EXTENSION ".nlm" -#else -#define EXTENSION -#endif - - static int launch_reader(CuTest *tc) { apr_proc_t proc = {0}; diff --git a/test/testoc.c b/test/testoc.c index 58f891dddbe..f5c79fba28d 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -22,15 +22,6 @@ #if APR_HAS_OTHER_CHILD -/* XXX I'm sure there has to be a better way to do this ... */ -#ifdef WIN32 -#define EXTENSION ".exe" -#elif NETWARE -#define EXTENSION ".nlm" -#else -#define EXTENSION -#endif - static char reasonstr[256]; static void ocmaint(int reason, void *data, int status) diff --git a/test/testpipe.c b/test/testpipe.c index 56749de09a5..e7220e88590 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -122,15 +122,6 @@ static void read_write_notimeout(CuTest *tc) CuAssertStrEquals(tc, "this is a test", input); } -/* XXX FIXME */ -#ifdef WIN32 -#define EXTENSION ".exe" -#elif NETWARE -#define EXTENSION ".nlm" -#else -#define EXTENSION -#endif - static void test_pipe_writefull(CuTest *tc) { int iterations = 1000; diff --git a/test/testproc.c b/test/testproc.c index b000526fd96..2fb809aa62e 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -20,15 +20,6 @@ #include "apr_strings.h" #include "test_apr.h" -/* XXX I'm sure there has to be a better way to do this ... */ -#ifdef WIN32 -#define EXTENSION ".exe" -#elif NETWARE -#define EXTENSION ".nlm" -#else -#define EXTENSION -#endif - #define TESTSTR "This is a test" static apr_proc_t newproc; From 0679e8e0392905e9922b25bf5db60e6199623095 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 14 Mar 2004 20:27:14 +0000 Subject: [PATCH 4895/7878] Port testsock to the unified framework. This doesn't include the sendfile tests, those are next. Also, instead of having a server and client, testsock.c implements the server, and sockchild.c implements the client. I have also removed the part of the test that relied on apr_poll(). That is tested in testpoll, and just makes this code more confusing than it needs to be. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64987 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 19 +-- test/Makefile.win | 16 +-- test/client.c | 152 ---------------------- test/server.c | 173 ------------------------ test/test_apr.h | 1 + test/testall.c | 1 + test/testsock.c | 325 ++++++++++++++++++++++++++-------------------- test/testsock.h | 33 +++++ 8 files changed, 227 insertions(+), 493 deletions(-) delete mode 100644 test/client.c delete mode 100644 test/server.c create mode 100644 test/testsock.h diff --git a/test/Makefile.in b/test/Makefile.in index 4e403a06033..8a3e15503ef 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -11,7 +11,6 @@ VPATH = @srcdir@ # or with special parameters STDTEST_PORTABLE = \ - testsock@EXEEXT@ \ testlockperf@EXEEXT@ \ testshmproducer@EXEEXT@ \ testshmconsumer@EXEEXT@ \ @@ -34,7 +33,7 @@ TARGETS = $(PROGRAMS) LOCAL_LIBS=../lib@APR_LIBNAME@.la CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \ -readchild@EXEEXT@ tryread@EXEEXT@ +readchild@EXEEXT@ tryread@EXEEXT@ sockchid@EXEEXT@ CLEAN_SUBDIRS = internal INCDIR=../include @@ -56,6 +55,9 @@ check: $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS) $(LINK_PROG) occhild.lo $(LOCAL_LIBS) $(ALL_LIBS) +sockchild@EXEEXT@: sockchild.lo $(LOCAL_LIBS) + $(LINK_PROG) sockchild.lo $(LOCAL_LIBS) $(ALL_LIBS) + readchild@EXEEXT@: readchild.lo $(LOCAL_LIBS) $(LINK_PROG) readchild.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -78,15 +80,6 @@ libmod_test.la: mod_test.slo $(LOCAL_LIBS) testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS) $(LINK_PROG) testlockperf.lo $(LOCAL_LIBS) $(ALL_LIBS) -testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ $(LOCAL_LIBS) - $(LINK_PROG) testsock.lo $(LOCAL_LIBS) $(ALL_LIBS) - -client@EXEEXT@: client.lo $(LOCAL_LIBS) - $(LINK_PROG) client.lo $(LOCAL_LIBS) $(ALL_LIBS) - -server@EXEEXT@: server.lo $(LOCAL_LIBS) - $(LINK_PROG) server.lo $(LOCAL_LIBS) $(ALL_LIBS) - sendfile@EXEEXT@: sendfile.lo $(LOCAL_LIBS) $(LINK_PROG) sendfile.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -112,11 +105,11 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ testenv.lo testprocmutex.lo testrand2.lo testfnmatch.lo \ - testatomic.lo testflock.lo testshm.lo + testatomic.lo testflock.lo testshm.lo testsock.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ \ - tryread@EXEEXT@ $(LOCAL_LIBS) + tryread@EXEEXT@ sockchild@EXEEXT@ $(LOCAL_LIBS) $(LINK_PROG) $(TESTS) CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/Makefile.win b/test/Makefile.win index 4a6e826aed0..d458e5a5d07 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -5,13 +5,11 @@ NONPORTABLE = \ testglobalmutex.exe PROGRAMS = \ - client.exe \ sendfile.exe \ - server.exe \ proc_child.exe \ tryread.exe \ occhild.exe\ - testsock.exe \ + sockchild.exe \ testlockperf.exe \ testshmproducer.exe \ testshmconsumer.exe \ @@ -58,14 +56,8 @@ mod_test.so: mod_test.obj testlockperf.exe: testlockperf.obj $(LOCAL_LIBS) $(LINK) testlockperf.obj $(LOCAL_LIBS) $(ALL_LIBS) -testsock.exe: testsock.obj client.exe server.exe sendfile.exe $(LOCAL_LIBS) - $(LINK) testsock.obj $(LOCAL_LIBS) $(ALL_LIBS) - -client.exe: client.obj $(LOCAL_LIBS) - $(LINK) client.obj $(LOCAL_LIBS) $(ALL_LIBS) - -server.exe: server.obj $(LOCAL_LIBS) - $(LINK) server.obj $(LOCAL_LIBS) $(ALL_LIBS) +sockchild.exe: sockchild.obj $(LOCAL_LIBS) + $(LINK) sockchild.obj $(LOCAL_LIBS) $(ALL_LIBS) sendfile.exe: sendfile.obj $(LOCAL_LIBS) $(LINK) sendfile.obj $(LOCAL_LIBS) $(ALL_LIBS) @@ -95,7 +87,7 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \ testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj \ - testatomic.obj testflock.obj testshm.obj + testatomic.obj testflock.obj testshm.obj testsock.obj testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS) $(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ diff --git a/test/client.c b/test/client.c deleted file mode 100644 index fa1a1ee05a3..00000000000 --- a/test/client.c +++ /dev/null @@ -1,152 +0,0 @@ -/* Copyright 2000-2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "apr_network_io.h" -#include "apr_errno.h" -#include "apr_general.h" -#include - -#define STRLEN 15 - -int main(int argc, char *argv[]) -{ - apr_pool_t *context; - apr_socket_t *sock; - apr_size_t length; - apr_status_t stat; - char datasend[STRLEN] = "Send data test"; - char datarecv[STRLEN]; - char msgbuf[80]; - char *local_ipaddr, *remote_ipaddr; - char *dest = "127.0.0.1"; - apr_port_t local_port, remote_port; - apr_interval_time_t timeout = apr_time_from_sec(2); - apr_sockaddr_t *local_sa, *remote_sa; - - setbuf(stdout, NULL); - if (argc > 1) { - dest = argv[1]; - } - - if (argc > 2) { - timeout = atoi(argv[2]); - } - - fprintf(stdout, "Initializing........."); - if (apr_initialize() != APR_SUCCESS) { - fprintf(stderr, "Something went wrong\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - atexit(apr_terminate); - - fprintf(stdout, "Creating context......."); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - fprintf(stderr, "Something went wrong\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - - fprintf(stdout,"\tClient: Making socket address..............."); - if ((stat = apr_sockaddr_info_get(&remote_sa, dest, APR_UNSPEC, 8021, 0, context)) - != APR_SUCCESS) { - fprintf(stdout, "Failed!\n"); - fprintf(stdout, "Address resolution failed for %s: %s\n", - dest, apr_strerror(stat, msgbuf, sizeof(msgbuf))); - exit(-1); - } - fprintf(stdout,"OK\n"); - - fprintf(stdout, "\tClient: Creating new socket......."); - if (apr_socket_create(&sock, remote_sa->family, SOCK_STREAM, 0, - context) != APR_SUCCESS) { - fprintf(stderr, "Couldn't create socket\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - - fprintf(stdout, "\tClient: Setting socket timeout......."); - stat = apr_socket_timeout_set(sock, timeout); - if (stat) { - fprintf(stderr, "Problem setting timeout: %d\n", stat); - exit(-1); - } - fprintf(stdout, "OK\n"); - - fprintf(stdout, "\tClient: Connecting to socket......."); - - stat = apr_socket_connect(sock, remote_sa); - - if (stat != APR_SUCCESS) { - apr_socket_close(sock); - fprintf(stderr, "Could not connect: %s (%d)\n", - apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); - fflush(stderr); - exit(-1); - } - fprintf(stdout, "OK\n"); - - apr_socket_addr_get(&remote_sa, APR_REMOTE, sock); - apr_sockaddr_ip_get(&remote_ipaddr, remote_sa); - remote_port = remote_sa->port; - apr_socket_addr_get(&local_sa, APR_LOCAL, sock); - apr_sockaddr_ip_get(&local_ipaddr, local_sa); - local_port = local_sa->port; - fprintf(stdout, "\tClient socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); - - fprintf(stdout, "\tClient: Trying to send data over socket......."); - length = STRLEN; - if ((stat = apr_socket_send(sock, datasend, &length) != APR_SUCCESS)) { - apr_socket_close(sock); - fprintf(stderr, "Problem sending data: %s (%d)\n", - apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); - exit(-1); - } - fprintf(stdout, "OK\n"); - - length = STRLEN; - fprintf(stdout, "\tClient: Trying to receive data over socket......."); - - if ((stat = apr_socket_recv(sock, datarecv, &length)) != APR_SUCCESS) { - apr_socket_close(sock); - fprintf(stderr, "Problem receiving data: %s (%d)\n", - apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); - exit(-1); - } - if (strcmp(datarecv, "Recv data test")) { - apr_socket_close(sock); - fprintf(stderr, "I did not receive the correct data %s\n", datarecv); - exit(-1); - } - fprintf(stdout, "OK\n"); - - fprintf(stdout, "\tClient: Shutting down socket......."); - if (apr_socket_shutdown(sock, APR_SHUTDOWN_WRITE) != APR_SUCCESS) { - apr_socket_close(sock); - fprintf(stderr, "Could not shutdown socket\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - - fprintf(stdout, "\tClient: Closing down socket......."); - if (apr_socket_close(sock) != APR_SUCCESS) { - fprintf(stderr, "Could not shutdown socket\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - - return 1; -} diff --git a/test/server.c b/test/server.c deleted file mode 100644 index bce87f8b6f9..00000000000 --- a/test/server.c +++ /dev/null @@ -1,173 +0,0 @@ -/* Copyright 2000-2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define APR_TEST_PREFIX "server: " - -#include "aprtest.h" -#include -#include "apr_network_io.h" -#include "apr_getopt.h" -#include "apr_poll.h" - -#define STRLEN 15 - -int main(int argc, const char * const argv[]) -{ - apr_pool_t *context; - apr_status_t rv; - apr_socket_t *sock; - apr_socket_t *sock2; - apr_size_t length; - apr_int32_t pollres; - apr_pollset_t *sdset; - apr_pollfd_t fdsock; - char datasend[STRLEN]; - char datarecv[STRLEN] = "Recv data test"; - const char *bind_to_ipaddr = APR_ANYADDR; - char *local_ipaddr, *remote_ipaddr; - apr_port_t local_port, remote_port; - apr_sockaddr_t *localsa = NULL, *remotesa; - apr_status_t stat; - int family = APR_UNSPEC; - int protocol; - apr_getopt_t *opt; - const char *optarg; - char optchar; - - APR_TEST_INITIALIZE(rv, context); - - APR_TEST_SUCCESS(rv, "Preparing getopt", - apr_getopt_init(&opt, context, argc, argv)) - - while ((stat = apr_getopt(opt, "i:", &optchar, &optarg)) == APR_SUCCESS) { - switch(optchar) { - case 'i': - bind_to_ipaddr = optarg; - break; - } - } - if (stat != APR_EOF) { - fprintf(stderr, - "usage: %s [-i local-interface-address]\n", - argv[0]); - exit(-1); - } - - if (!bind_to_ipaddr) { - bind_to_ipaddr = APR_LOCAL; - } - - /* First, parse/resolve ipaddr so we know what address family of - * socket we need. We'll use the returned sockaddr later when - * we bind. - */ - APR_TEST_SUCCESS(rv, "Preparing sockaddr", - apr_sockaddr_info_get(&localsa, bind_to_ipaddr, APR_UNSPEC, 8021, 0, context)) - family = localsa->family; - - APR_TEST_SUCCESS(rv, "Creating new socket", - apr_socket_create(&sock, family, SOCK_STREAM, APR_PROTO_TCP, context)) - - APR_TEST_SUCCESS(rv, "Setting option APR_SO_NONBLOCK", - apr_socket_opt_set(sock, APR_SO_NONBLOCK, 1)) - - APR_TEST_SUCCESS(rv, "Setting option APR_SO_REUSEADDR", - apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1)) - - APR_TEST_SUCCESS(rv, "Binding socket to port", - apr_socket_bind(sock, localsa)) - - APR_TEST_SUCCESS(rv, "Listening to socket", - apr_socket_listen(sock, 5)) - - APR_TEST_BEGIN(rv, "Setting up for polling", - apr_pollset_create(&sdset, 1, context, 0)) - - /* Hmm, probably a better way of doing this - quick 'n' dirty :) */ - fdsock.p = context; - fdsock.desc_type = APR_POLL_SOCKET; - fdsock.reqevents = APR_POLLIN; - fdsock.rtnevents = 0; - fdsock.desc.s = sock; - fdsock.client_data = NULL; - - APR_TEST_END(rv, - apr_pollset_add(sdset, &fdsock)) - - pollres = 1; - APR_TEST_BEGIN(rv, "Polling for socket", - apr_pollset_poll(sdset, -1, &pollres, NULL)) - - if (pollres == 0) { - fprintf(stdout, "Failed\n"); - apr_socket_close(sock); - fprintf(stderr, "Error: Unrecognized poll result, " - "expected 1, received %d\n", pollres); - exit(-1); - } - fprintf(stdout, "OK\n"); - - APR_TEST_SUCCESS(rv, "Accepting a connection", - apr_socket_accept(&sock2, sock, context)) - - apr_socket_protocol_get(sock2, &protocol); - if (protocol != APR_PROTO_TCP) { - fprintf(stderr, "Error: protocol not conveyed from listening socket " - "to connected socket!\n"); - exit(1); - } - apr_socket_addr_get(&remotesa, APR_REMOTE, sock2); - apr_sockaddr_ip_get(&remote_ipaddr, remotesa); - remote_port = remotesa->port; - apr_socket_addr_get(&localsa, APR_LOCAL, sock2); - apr_sockaddr_ip_get(&local_ipaddr, localsa); - local_port = localsa->port; - fprintf(stdout, "Server socket: %s:%u -> %s:%u\n", local_ipaddr, - local_port, remote_ipaddr, remote_port); - - APR_TEST_SUCCESS(rv, "Setting timeout on client socket", - apr_socket_timeout_set(sock2, apr_time_from_sec(3))); - - length = STRLEN; - APR_TEST_BEGIN(rv, "Receiving data from socket", - apr_socket_recv(sock2, datasend, &length)) - - if (strcmp(datasend, "Send data test")) { - fprintf(stdout, "Failed\n"); - apr_socket_close(sock); - apr_socket_close(sock2); - fprintf(stderr, "Error: Unrecognized response;\n" - "Expected: \"Send data test\"\n" - "Received: \"%s\"\n", datarecv); - exit(-1); - } - fprintf(stdout, "OK\n"); - - length = STRLEN; - APR_TEST_SUCCESS(rv, "Sending data over socket", - apr_socket_send(sock2, datarecv, &length)) - - APR_TEST_SUCCESS(rv, "Shutting down accepted socket", - apr_socket_shutdown(sock2, APR_SHUTDOWN_READ)) - - APR_TEST_SUCCESS(rv, "Closing duplicate socket", - apr_socket_close(sock2)) - - APR_TEST_SUCCESS(rv, "Closing original socket", - apr_socket_close(sock)) - - return 0; -} - diff --git a/test/test_apr.h b/test/test_apr.h index 1524e9a1720..352c79ee3c4 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -63,6 +63,7 @@ CuSuite *testrand(void); CuSuite *testrand2(void); CuSuite *testsleep(void); CuSuite *testshm(void); +CuSuite *testsock(void); CuSuite *testsockets(void); CuSuite *testsockopt(void); CuSuite *teststr(void); diff --git a/test/testall.c b/test/testall.c index 91abb1c214f..d0cf8cbd827 100644 --- a/test/testall.c +++ b/test/testall.c @@ -66,6 +66,7 @@ static const struct testlist { {"testrand2", testrand2}, {"testsleep", testsleep}, {"testshm", testshm}, + {"testsock", testsock}, {"testsockets", testsockets}, {"testsockopt", testsockopt}, {"teststr", teststr}, diff --git a/test/testsock.c b/test/testsock.c index 6506f04670d..8fbf8af3c93 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -13,162 +13,201 @@ * limitations under the License. */ -#include -#include -#include +#include "test_apr.h" +#include "testsock.h" #include "apr_thread_proc.h" +#include "apr_network_io.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" -#define STRLEN 15 - -static int run_basic_test(apr_pool_t *context) +static apr_proc_t launch_child(CuTest *tc, const char *arg1) { - apr_procattr_t *attr1 = NULL; - apr_procattr_t *attr2 = NULL; - apr_proc_t proc1; - apr_proc_t proc2; - apr_status_t s1; - apr_status_t s2; + apr_proc_t proc = {0}; + apr_procattr_t *procattr; const char *args[2]; + apr_status_t rv; + + rv = apr_procattr_create(&procattr, p); + apr_assert_success(tc, "Couldn't create procattr", rv); + + rv = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, + APR_NO_PIPE); + apr_assert_success(tc, "Couldn't set io in procattr", rv); + + rv = apr_procattr_error_check_set(procattr, 1); + apr_assert_success(tc, "Couldn't set error check in procattr", rv); - fprintf(stdout, "Creating children to run network tests.......\n"); - s1 = apr_procattr_create(&attr1, context); - s2 = apr_procattr_create(&attr2, context); - - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { - fprintf(stderr, "Problem creating proc attrs\n"); - exit(-1); - } - - args[0] = apr_pstrdup(context, "server"); - args[1] = NULL; - s1 = apr_proc_create(&proc1, "./server", args, NULL, attr1, context); - - /* Sleep for 5 seconds to ensure the server is setup before we begin */ - apr_sleep(5000000); - args[0] = apr_pstrdup(context, "client"); - s2 = apr_proc_create(&proc2, "./client", args, NULL, attr2, context); - - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { - fprintf(stderr, "Problem spawning new process\n"); - exit(-1); - } - - while ((s1 = apr_proc_wait(&proc1, NULL, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE && - (s2 = apr_proc_wait(&proc2, NULL, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE) { - continue; - } - - if (s1 == APR_SUCCESS) { - apr_proc_kill(&proc2, SIGTERM); - while (apr_proc_wait(&proc2, NULL, NULL, APR_WAIT) == APR_CHILD_NOTDONE); - } - else { - apr_proc_kill(&proc1, SIGTERM); - while (apr_proc_wait(&proc1, NULL, NULL, APR_WAIT) == APR_CHILD_NOTDONE); - } - fprintf(stdout, "Network test completed.\n"); - - return 1; + args[0] = "sockchild" EXTENSION; + args[1] = arg1; + args[2] = NULL; + rv = apr_proc_create(&proc, "./sockchild" EXTENSION, args, NULL, + procattr, p); + apr_assert_success(tc, "Couldn't launch program", rv); + return proc; } -static int run_sendfile(apr_pool_t *context, int number) +static int wait_child(CuTest *tc, apr_proc_t proc) { - apr_procattr_t *attr1 = NULL; - apr_procattr_t *attr2 = NULL; - apr_proc_t proc1; - apr_proc_t proc2; - apr_status_t s1; - apr_status_t s2; - const char *args[4]; - - fprintf(stdout, "Creating children to run network tests.......\n"); - s1 = apr_procattr_create(&attr1, context); - s2 = apr_procattr_create(&attr2, context); - - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { - fprintf(stderr, "Problem creating proc attrs\n"); - exit(-1); - } - - args[0] = apr_pstrdup(context, "sendfile"); - args[1] = apr_pstrdup(context, "server"); - args[2] = NULL; - s1 = apr_proc_create(&proc1, "./sendfile", args, NULL, attr1, context); - - /* Sleep for 5 seconds to ensure the server is setup before we begin */ - apr_sleep(5000000); - args[1] = apr_pstrdup(context, "client"); - switch (number) { - case 0: { - args[2] = apr_pstrdup(context, "blocking"); - break; - } - case 1: { - args[2] = apr_pstrdup(context, "nonblocking"); - break; - } - case 2: { - args[2] = apr_pstrdup(context, "timeout"); - break; - } - } - args[3] = NULL; - s2 = apr_proc_create(&proc2, "./sendfile", args, NULL, attr2, context); - - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { - fprintf(stderr, "Problem spawning new process\n"); - exit(-1); - } - - while ((s1 = apr_proc_wait(&proc1, NULL, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE && - (s2 = apr_proc_wait(&proc2, NULL, NULL, APR_NOWAIT)) == APR_CHILD_NOTDONE) { - continue; - } - - if (s1 == APR_SUCCESS) { - apr_proc_kill(&proc2, SIGTERM); - while (apr_proc_wait(&proc2, NULL, NULL, APR_WAIT) == APR_CHILD_NOTDONE); - } - else { - apr_proc_kill(&proc1, SIGTERM); - while (apr_proc_wait(&proc1, NULL, NULL, APR_WAIT) == APR_CHILD_NOTDONE); - } - fprintf(stdout, "Network test completed.\n"); - - return 1; + int exitcode; + apr_exit_why_e why; + + CuAssert(tc, "Error waiting for child process", + apr_proc_wait(&proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); + + CuAssert(tc, "child terminated normally", why == APR_PROC_EXIT); + return exitcode; } -int main(int argc, char *argv[]) +static void test_addr_info(CuTest *tc) { - apr_pool_t *context = NULL; - - fprintf(stdout, "Initializing........."); - if (apr_initialize() != APR_SUCCESS) { - fprintf(stderr, "Something went wrong\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - atexit(apr_terminate); - - fprintf(stdout, "Creating context......."); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { - fprintf(stderr, "Could not create context\n"); - exit(-1); - } - fprintf(stdout, "OK\n"); - - fprintf(stdout, "This test relies on the process test working. Please\n"); - fprintf(stdout, "run that test first, and only run this test when it\n"); - fprintf(stdout, "completes successfully. Alternatively, you could run\n"); - fprintf(stdout, "server and client by yourself.\n"); - run_basic_test(context); - run_sendfile(context, 0); - run_sendfile(context, 1); - run_sendfile(context, 2); - - return 0; + apr_status_t rv; + apr_sockaddr_t *sa; + + rv = apr_sockaddr_info_get(&sa, APR_LOCAL, APR_UNSPEC, 80, 0, p); + apr_assert_success(tc, "Problem generating sockaddr", rv); + + rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, 80, 0, p); + apr_assert_success(tc, "Problem generating sockaddr", rv); + CuAssertStrEquals(tc, "127.0.0.1", sa->hostname); } + +static apr_socket_t *setup_socket(CuTest *tc) +{ + apr_status_t rv; + apr_sockaddr_t *sa; + apr_socket_t *sock; + + rv = apr_sockaddr_info_get(&sa, APR_LOCAL, APR_INET, 8021, 0, p); + apr_assert_success(tc, "Problem generating sockaddr", rv); + + rv = apr_socket_create(&sock, sa->family, SOCK_STREAM, APR_PROTO_TCP, p); + apr_assert_success(tc, "Problem creating socket", rv); + + rv = apr_socket_bind(sock, sa); + apr_assert_success(tc, "Problem binding to port", rv); + + rv = apr_socket_listen(sock, 5); + apr_assert_success(tc, "Problem listening on socket", rv); + + return sock; +} + +static void test_create_bind_listen(CuTest *tc) +{ + apr_status_t rv; + apr_socket_t *sock = setup_socket(tc); + + rv = apr_socket_close(sock); + apr_assert_success(tc, "Problem closing socket", rv); +} + +static void test_send(CuTest *tc) +{ + apr_status_t rv; + apr_socket_t *sock; + apr_socket_t *sock2; + apr_proc_t proc; + int protocol; + int length; + + sock = setup_socket(tc); + + proc = launch_child(tc, "read"); + + rv = apr_socket_accept(&sock2, sock, p); + apr_assert_success(tc, "Problem with receiving connection", rv); + + apr_socket_protocol_get(sock2, &protocol); + CuAssertIntEquals(tc, APR_PROTO_TCP, protocol); + + length = strlen(DATASTR); + apr_socket_send(sock2, DATASTR, &length); + + /* Make sure that the client received the data we sent */ + CuAssertIntEquals(tc, strlen(DATASTR), wait_child(tc, proc)); + + rv = apr_socket_close(sock2); + apr_assert_success(tc, "Problem closing connected socket", rv); + rv = apr_socket_close(sock); + apr_assert_success(tc, "Problem closing socket", rv); +} + +static void test_recv(CuTest *tc) +{ + apr_status_t rv; + apr_socket_t *sock; + apr_socket_t *sock2; + apr_proc_t proc; + int protocol; + int length = STRLEN; + char datastr[STRLEN]; + + sock = setup_socket(tc); + + proc = launch_child(tc, "write"); + + rv = apr_socket_accept(&sock2, sock, p); + apr_assert_success(tc, "Problem with receiving connection", rv); + + apr_socket_protocol_get(sock2, &protocol); + CuAssertIntEquals(tc, APR_PROTO_TCP, protocol); + + length = strlen(DATASTR); + apr_socket_recv(sock2, datastr, &length); + + /* Make sure that the server received the data we sent */ + CuAssertStrEquals(tc, DATASTR, datastr); + CuAssertIntEquals(tc, strlen(datastr), wait_child(tc, proc)); + + rv = apr_socket_close(sock2); + apr_assert_success(tc, "Problem closing connected socket", rv); + rv = apr_socket_close(sock); + apr_assert_success(tc, "Problem closing socket", rv); +} + +static void test_timeout(CuTest *tc) +{ + apr_status_t rv; + apr_socket_t *sock; + apr_socket_t *sock2; + apr_proc_t proc; + int protocol; + int exit; + + sock = setup_socket(tc); + + proc = launch_child(tc, "read"); + + rv = apr_socket_accept(&sock2, sock, p); + apr_assert_success(tc, "Problem with receiving connection", rv); + + apr_socket_protocol_get(sock2, &protocol); + CuAssertIntEquals(tc, APR_PROTO_TCP, protocol); + + exit = wait_child(tc, proc); + CuAssertIntEquals(tc, SOCKET_TIMEOUT, exit); + + /* We didn't write any data, so make sure the child program returns + * an error. + */ + rv = apr_socket_close(sock2); + apr_assert_success(tc, "Problem closing connected socket", rv); + rv = apr_socket_close(sock); + apr_assert_success(tc, "Problem closing socket", rv); +} + +CuSuite *testsock(void) +{ + CuSuite *suite = CuSuiteNew("Socket operations"); + + SUITE_ADD_TEST(suite, test_addr_info); + SUITE_ADD_TEST(suite, test_create_bind_listen); + SUITE_ADD_TEST(suite, test_send); + SUITE_ADD_TEST(suite, test_recv); + SUITE_ADD_TEST(suite, test_timeout); + + return suite; +} + diff --git a/test/testsock.h b/test/testsock.h new file mode 100644 index 00000000000..bf52178e8a8 --- /dev/null +++ b/test/testsock.h @@ -0,0 +1,33 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TESTSOCK_H +#define TESTSOCK_H + +#define DATASTR "This is a test" +#define STRLEN 8092 + +/* This is a hack. We can't return APR_TIMEOUT from sockchild, because + * Unix OSes only return the least significant 8 bits of the return code, + * which means that instead of receiving 70007, testsock gets 119. But, + * we also don't want to return -1, because we use that value for general + * errors from sockchild. So, we define 1 to mean that the read/write + * operation timed out. This means that we can't write a test that tries + * to send a single character between ends of the socket. + */ +#define SOCKET_TIMEOUT 1 + +#endif + From 7bbc6ae153924ef4750ba905abda188ca1ec72b1 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 14 Mar 2004 20:30:20 +0000 Subject: [PATCH 4896/7878] I forgot to add sockchild.c, which is required for testsock. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64988 13f79535-47bb-0310-9956-ffa450edef68 --- test/sockchild.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 test/sockchild.c diff --git a/test/sockchild.c b/test/sockchild.c new file mode 100644 index 00000000000..65ca84872b5 --- /dev/null +++ b/test/sockchild.c @@ -0,0 +1,77 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "testsock.h" +#include "apr_network_io.h" +#include "apr_pools.h" + +int main(int argc, char *argv[]) +{ + apr_pool_t *p; + apr_socket_t *sock; + apr_status_t rv; + apr_sockaddr_t *remote_sa; + + apr_initialize(); + atexit(apr_terminate); + apr_pool_create(&p, NULL); + + if (argc < 2) { + exit(-1); + } + + rv = apr_sockaddr_info_get(&remote_sa, "127.0.0.1", APR_UNSPEC, 8021, 0, p); + if (rv != APR_SUCCESS) { + exit(-1); + } + + if (apr_socket_create(&sock, remote_sa->family, SOCK_STREAM, 0, + p) != APR_SUCCESS) { + exit(-1); + } + + rv = apr_socket_timeout_set(sock, apr_time_from_sec(3)); + if (rv) { + exit(-1); + } + + apr_socket_connect(sock, remote_sa); + + if (!strcmp("read", argv[1])) { + char datarecv[STRLEN]; + int length = STRLEN; + + apr_status_t rv = apr_socket_recv(sock, datarecv, &length); + apr_socket_close(sock); + if (rv == APR_TIMEUP) { + exit(SOCKET_TIMEOUT); + } + + if (strcmp(datarecv, DATASTR)) { + exit(-1); + } + + exit(length); + } + else if (!strcmp("write", argv[1])) { + int length = strlen(DATASTR); + apr_socket_send(sock, DATASTR, &length); + + apr_socket_close(sock); + exit(length); + } + exit(-1); +} From 51b1263dbe68d1ad759ec09087146ee5dd961e77 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 15 Mar 2004 01:57:27 +0000 Subject: [PATCH 4897/7878] Remove some unused #includes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64989 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfnmatch.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/testfnmatch.c b/test/testfnmatch.c index adc8b29cbfd..7b099e10d73 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -14,11 +14,6 @@ */ #include "test_apr.h" - -#include -#include -#include - #include "apr_file_info.h" #include "apr_fnmatch.h" #include "apr_tables.h" From 4ab895be1e4d1c9acde1fb273af227b749e844da Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 15 Mar 2004 02:06:51 +0000 Subject: [PATCH 4898/7878] testsock no longer causes a GPF on Windows. Still doesn't pass the tests though. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64990 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/test/testsock.c b/test/testsock.c index 8fbf8af3c93..43d41979413 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -22,11 +22,10 @@ #include "apr_lib.h" #include "apr_strings.h" -static apr_proc_t launch_child(CuTest *tc, const char *arg1) +static void launch_child(CuTest *tc, apr_proc_t *proc, const char *arg1, apr_pool_t *p) { - apr_proc_t proc = {0}; apr_procattr_t *procattr; - const char *args[2]; + const char *args[3]; apr_status_t rv; rv = apr_procattr_create(&procattr, p); @@ -42,19 +41,18 @@ static apr_proc_t launch_child(CuTest *tc, const char *arg1) args[0] = "sockchild" EXTENSION; args[1] = arg1; args[2] = NULL; - rv = apr_proc_create(&proc, "./sockchild" EXTENSION, args, NULL, + rv = apr_proc_create(proc, "./sockchild" EXTENSION, args, NULL, procattr, p); apr_assert_success(tc, "Couldn't launch program", rv); - return proc; } -static int wait_child(CuTest *tc, apr_proc_t proc) +static int wait_child(CuTest *tc, apr_proc_t *proc) { int exitcode; apr_exit_why_e why; CuAssert(tc, "Error waiting for child process", - apr_proc_wait(&proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); + apr_proc_wait(proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); CuAssert(tc, "child terminated normally", why == APR_PROC_EXIT); return exitcode; @@ -99,7 +97,7 @@ static void test_create_bind_listen(CuTest *tc) apr_status_t rv; apr_socket_t *sock = setup_socket(tc); - rv = apr_socket_close(sock); + rv = apr_socket_close(sock) ; apr_assert_success(tc, "Problem closing socket", rv); } @@ -111,10 +109,10 @@ static void test_send(CuTest *tc) apr_proc_t proc; int protocol; int length; - + sock = setup_socket(tc); - proc = launch_child(tc, "read"); + launch_child(tc, &proc, "read", p); rv = apr_socket_accept(&sock2, sock, p); apr_assert_success(tc, "Problem with receiving connection", rv); @@ -126,7 +124,7 @@ static void test_send(CuTest *tc) apr_socket_send(sock2, DATASTR, &length); /* Make sure that the client received the data we sent */ - CuAssertIntEquals(tc, strlen(DATASTR), wait_child(tc, proc)); + CuAssertIntEquals(tc, strlen(DATASTR), wait_child(tc, &proc)); rv = apr_socket_close(sock2); apr_assert_success(tc, "Problem closing connected socket", rv); @@ -146,7 +144,7 @@ static void test_recv(CuTest *tc) sock = setup_socket(tc); - proc = launch_child(tc, "write"); + launch_child(tc, &proc, "write", p); rv = apr_socket_accept(&sock2, sock, p); apr_assert_success(tc, "Problem with receiving connection", rv); @@ -159,7 +157,7 @@ static void test_recv(CuTest *tc) /* Make sure that the server received the data we sent */ CuAssertStrEquals(tc, DATASTR, datastr); - CuAssertIntEquals(tc, strlen(datastr), wait_child(tc, proc)); + CuAssertIntEquals(tc, strlen(datastr), wait_child(tc, &proc)); rv = apr_socket_close(sock2); apr_assert_success(tc, "Problem closing connected socket", rv); @@ -178,7 +176,7 @@ static void test_timeout(CuTest *tc) sock = setup_socket(tc); - proc = launch_child(tc, "read"); + launch_child(tc, &proc, "read", p); rv = apr_socket_accept(&sock2, sock, p); apr_assert_success(tc, "Problem with receiving connection", rv); @@ -186,7 +184,7 @@ static void test_timeout(CuTest *tc) apr_socket_protocol_get(sock2, &protocol); CuAssertIntEquals(tc, APR_PROTO_TCP, protocol); - exit = wait_child(tc, proc); + exit = wait_child(tc, &proc); CuAssertIntEquals(tc, SOCKET_TIMEOUT, exit); /* We didn't write any data, so make sure the child program returns From afeb6a0cd76813898b3fbb89d678f38e349c003a Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 15 Mar 2004 02:09:52 +0000 Subject: [PATCH 4899/7878] client and server no longer exist. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64991 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 8a3e15503ef..765d342421d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -20,8 +20,7 @@ STDTEST_PORTABLE = \ STDTEST_NONPORTABLE = \ testglobalmutex@EXEEXT@ -OTHER_PROGRAMS = client@EXEEXT@ sendfile@EXEEXT@ \ - server@EXEEXT@ +OTHER_PROGRAMS = sendfile@EXEEXT@ PROGRAMS = $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS) From ec5af822960fe982be4c6743c62624eaf2d7847b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 15 Mar 2004 02:14:58 +0000 Subject: [PATCH 4900/7878] Fix compile warnings in sockchild.c on Mac OS X Submitted By: Garrett Rooney git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64992 13f79535-47bb-0310-9956-ffa450edef68 --- test/sockchild.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sockchild.c b/test/sockchild.c index 65ca84872b5..7693bd10521 100644 --- a/test/sockchild.c +++ b/test/sockchild.c @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) if (!strcmp("read", argv[1])) { char datarecv[STRLEN]; - int length = STRLEN; + apr_size_t length = STRLEN; apr_status_t rv = apr_socket_recv(sock, datarecv, &length); apr_socket_close(sock); @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) exit(length); } else if (!strcmp("write", argv[1])) { - int length = strlen(DATASTR); + apr_size_t length = strlen(DATASTR); apr_socket_send(sock, DATASTR, &length); apr_socket_close(sock); From 1ec070e7209c1ff83567f32f5eaf838c1bc1b306 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 15 Mar 2004 02:42:50 +0000 Subject: [PATCH 4901/7878] Fix the testsock tests on Windows, mostly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64993 13f79535-47bb-0310-9956-ffa450edef68 --- test/sockchild.c | 6 ++++-- test/testsock.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/sockchild.c b/test/sockchild.c index 7693bd10521..0e156327f05 100644 --- a/test/sockchild.c +++ b/test/sockchild.c @@ -53,10 +53,12 @@ int main(int argc, char *argv[]) if (!strcmp("read", argv[1])) { char datarecv[STRLEN]; apr_size_t length = STRLEN; + apr_status_t rv; - apr_status_t rv = apr_socket_recv(sock, datarecv, &length); + memset(datarecv, 0, STRLEN); + rv = apr_socket_recv(sock, datarecv, &length); apr_socket_close(sock); - if (rv == APR_TIMEUP) { + if (APR_STATUS_IS_TIMEUP(rv)) { exit(SOCKET_TIMEOUT); } diff --git a/test/testsock.c b/test/testsock.c index 43d41979413..6c8308017da 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -152,7 +152,7 @@ static void test_recv(CuTest *tc) apr_socket_protocol_get(sock2, &protocol); CuAssertIntEquals(tc, APR_PROTO_TCP, protocol); - length = strlen(DATASTR); + memset(datastr, 0, STRLEN); apr_socket_recv(sock2, datastr, &length); /* Make sure that the server received the data we sent */ From 4702dd229238d4844b4bb6b387edaf4e46ea97f0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 15 Mar 2004 02:43:48 +0000 Subject: [PATCH 4902/7878] Fix compile warnings on Mac OS X. Submitted By: Garrett Rooney git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64994 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testsock.c b/test/testsock.c index 6c8308017da..4877f402c7b 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -108,7 +108,7 @@ static void test_send(CuTest *tc) apr_socket_t *sock2; apr_proc_t proc; int protocol; - int length; + apr_size_t length; sock = setup_socket(tc); @@ -139,7 +139,7 @@ static void test_recv(CuTest *tc) apr_socket_t *sock2; apr_proc_t proc; int protocol; - int length = STRLEN; + apr_size_t length = STRLEN; char datastr[STRLEN]; sock = setup_socket(tc); From 2d319f4719eb5630cd59eb1d11de1766a84c4304 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 15 Mar 2004 03:28:31 +0000 Subject: [PATCH 4903/7878] Use APR in occhild so that it is portable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64995 13f79535-47bb-0310-9956-ffa450edef68 --- test/occhild.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/test/occhild.c b/test/occhild.c index 05df4ae7d22..9f8035c628f 100644 --- a/test/occhild.c +++ b/test/occhild.c @@ -1,16 +1,21 @@ #include "apr.h" -#include -#if APR_HAVE_UNISTD_H -#include -#endif -#include +#include "apr_file_io.h" int main(void) { char buf[256]; + apr_file_t *err; + apr_pool_t *p; + + apr_initialize(); + atexit(apr_terminate); + + apr_pool_create(&p, NULL); + apr_file_open_stdin(&err, p); while (1) { - read(STDERR_FILENO, buf, 256); + apr_size_t length = 256; + apr_file_read(err, buf, &length); } - return 0; /* just to keep the compiler happy */ + exit(0); /* just to keep the compiler happy */ } From be2193098e2e95fefe92d3f13792c46d3d086ac6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 15 Mar 2004 03:32:43 +0000 Subject: [PATCH 4904/7878] Cleanup some emits git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64996 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + test/occhild.c | 5 +++++ test/testshm.c | 10 +++------- test/testshmconsumer.c | 6 ++++++ test/testshmproducer.c | 6 ++++++ test/tryread.c | 6 ++++++ 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/test/.cvsignore b/test/.cvsignore index 0d0f816f35c..5b58306f82b 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -78,6 +78,7 @@ testall.ncb testall.opt testall.plg proc_child +sockchild *.bb *.bbg *.da diff --git a/test/occhild.c b/test/occhild.c index 9f8035c628f..a96885d8271 100644 --- a/test/occhild.c +++ b/test/occhild.c @@ -1,5 +1,10 @@ #include "apr.h" #include "apr_file_io.h" +#include "apr.h" + +#if APR_HAVE_STDLIB_H +#include +#endif int main(void) { diff --git a/test/testshm.c b/test/testshm.c index 86dac66b46d..de2f049f2f7 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -22,14 +22,10 @@ #include "apr_thread_proc.h" #include "apr_time.h" #include "testshm.h" +#include "apr.h" -/* XXX I'm sure there has to be a better way to do this ... */ -#ifdef WIN32 -#define EXTENSION ".exe" -#elif NETWARE -#define EXTENSION ".nlm" -#else -#define EXTENSION +#if APR_HAVE_STDLIB_H +#include #endif #if APR_HAS_SHARED_MEMORY diff --git a/test/testshmconsumer.c b/test/testshmconsumer.c index 86979e53fd6..14db1f5e792 100644 --- a/test/testshmconsumer.c +++ b/test/testshmconsumer.c @@ -20,6 +20,12 @@ #include "apr_strings.h" #include "apr_time.h" #include "testshm.h" +#include "apr.h" + +#if APR_HAVE_STDLIB_H +#include +#endif + #if APR_HAS_SHARED_MEMORY diff --git a/test/testshmproducer.c b/test/testshmproducer.c index 5bef013630c..93cb5b5ca84 100644 --- a/test/testshmproducer.c +++ b/test/testshmproducer.c @@ -20,6 +20,12 @@ #include "apr_strings.h" #include "apr_time.h" #include "testshm.h" +#include "apr.h" + +#if APR_HAVE_STDLIB_H +#include +#endif + #if APR_HAS_SHARED_MEMORY static void msgput(int boxnum, char *msg) diff --git a/test/tryread.c b/test/tryread.c index d60b942cbff..ce7f7530bcc 100644 --- a/test/tryread.c +++ b/test/tryread.c @@ -36,6 +36,12 @@ #include "apr_pools.h" #include "apr_file_io.h" #include "apr_general.h" +#include "apr.h" + +#if APR_HAVE_STDLIB_H +#include +#endif + int main(int argc, const char * const *argv) { From 161045d71360a916d83c04730af2e36ef9fc0325 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 15 Mar 2004 16:07:34 +0000 Subject: [PATCH 4905/7878] These instructions are wrong now, remove them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64998 13f79535-47bb-0310-9956-ffa450edef68 --- test/tryread.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/test/tryread.c b/test/tryread.c index ce7f7530bcc..84558806873 100644 --- a/test/tryread.c +++ b/test/tryread.c @@ -13,25 +13,6 @@ * limitations under the License. */ -/* - * USAGE - * - * Start one process, no args, and place it into the background. Start a - * second process with the "-r" switch to attempt a read on the file - * created by the first process. - * - * $ ./testflock & - * ...messages... - * $ ./testflock -r - * ...messages... - * - * The first process will sleep for 30 seconds while holding a lock. The - * second process will attempt to grab it (non-blocking) and fail. It - * will then grab it with a blocking scheme. When the first process' 30 - * seconds are up, it will exit (thus releasing its lock). The second - * process will acquire the lock, then exit. - */ - #include "testflock.h" #include "apr_pools.h" #include "apr_file_io.h" @@ -42,7 +23,6 @@ #include #endif - int main(int argc, const char * const *argv) { apr_file_t *file; From 9f3060e3673bb943620af9f2c27123751ea0b724 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 15 Mar 2004 18:33:30 +0000 Subject: [PATCH 4906/7878] Port testglobalmutex to the unified framework. There is a hack in globalmutexchild.c in that we create the mutex before we call child_init. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64999 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 14 ++-- test/Makefile.win | 11 ++- test/globalmutexchild.c | 51 ++++++++++++ test/test_apr.h | 1 + test/testall.c | 1 + test/testglobalmutex.c | 174 +++++++++++++--------------------------- test/testglobalmutex.h | 26 ++++++ 7 files changed, 145 insertions(+), 133 deletions(-) create mode 100644 test/globalmutexchild.c create mode 100644 test/testglobalmutex.h diff --git a/test/Makefile.in b/test/Makefile.in index 765d342421d..a227cd39e03 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -17,9 +17,6 @@ STDTEST_PORTABLE = \ testmutexscope@EXEEXT@ \ testall@EXEEXT@ -STDTEST_NONPORTABLE = \ - testglobalmutex@EXEEXT@ - OTHER_PROGRAMS = sendfile@EXEEXT@ PROGRAMS = $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS) @@ -60,6 +57,9 @@ sockchild@EXEEXT@: sockchild.lo $(LOCAL_LIBS) readchild@EXEEXT@: readchild.lo $(LOCAL_LIBS) $(LINK_PROG) readchild.lo $(LOCAL_LIBS) $(ALL_LIBS) +globalmutexchild@EXEEXT@: globalmutexchild.lo $(LOCAL_LIBS) + $(LINK_PROG) globalmutexchild.lo $(LOCAL_LIBS) $(ALL_LIBS) + tryread@EXEEXT@: tryread.lo $(LOCAL_LIBS) $(LINK_PROG) tryread.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -91,9 +91,6 @@ testshmconsumer@EXEEXT@: testshmconsumer.lo $(LOCAL_LIBS) testprocmutex@EXEEXT@: testprocmutex.lo $(LOCAL_LIBS) $(LINK_PROG) testprocmutex.lo $(LOCAL_LIBS) $(ALL_LIBS) -testglobalmutex@EXEEXT@: testglobalmutex.lo $(LOCAL_LIBS) - $(LINK_PROG) testglobalmutex.lo $(LOCAL_LIBS) $(ALL_LIBS) - testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) $(LINK_PROG) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -104,11 +101,12 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ testenv.lo testprocmutex.lo testrand2.lo testfnmatch.lo \ - testatomic.lo testflock.lo testshm.lo testsock.lo + testatomic.lo testflock.lo testshm.lo testsock.lo testglobalmutex.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ \ - tryread@EXEEXT@ sockchild@EXEEXT@ $(LOCAL_LIBS) + tryread@EXEEXT@ sockchild@EXEEXT@ globalmutexchild@EXEEXT@ \ + $(LOCAL_LIBS) $(LINK_PROG) $(TESTS) CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/Makefile.win b/test/Makefile.win index d458e5a5d07..5284b3c1ba1 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -1,10 +1,8 @@ LINK=link /nologo -NONPORTABLE = \ - testglobalmutex.exe - PROGRAMS = \ + globalmutexchild.exe \ sendfile.exe \ proc_child.exe \ tryread.exe \ @@ -74,8 +72,8 @@ testshmconsumer.exe: testshmconsumer.obj $(LOCAL_LIBS) testprocmutex.exe: testprocmutex.obj $(LOCAL_LIBS) $(LINK) testprocmutex.obj $(LOCAL_LIBS) $(ALL_LIBS) -testglobalmutex.exe: testglobalmutex.obj $(LOCAL_LIBS) - $(LINK) testglobalmutex.obj $(LOCAL_LIBS) $(ALL_LIBS) +globalmutexchild.exe: globalmutexchild.obj $(LOCAL_LIBS) + $(LINK) globalmutexchild.obj $(LOCAL_LIBS) $(ALL_LIBS) testmutexscope.exe: testmutexscope.obj $(LOCAL_LIBS) $(LINK) testmutexscope.obj $(LOCAL_LIBS) $(ALL_LIBS) @@ -87,7 +85,8 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \ testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj \ - testatomic.obj testflock.obj testshm.obj testsock.obj + testatomic.obj testflock.obj testshm.obj testsock.obj \ + testglobalmutex.obj testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS) $(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ diff --git a/test/globalmutexchild.c b/test/globalmutexchild.c new file mode 100644 index 00000000000..34ba178db48 --- /dev/null +++ b/test/globalmutexchild.c @@ -0,0 +1,51 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "testglobalmutex.h" +#include "apr_pools.h" +#include "apr_file_io.h" +#include "apr_general.h" +#include "apr_global_mutex.h" +#include "apr.h" + +#if APR_HAVE_STDLIB_H +#include +#endif + + +int main(int argc, const char * const argv[]) +{ + apr_pool_t *p; + int i = 0; + apr_global_mutex_t *global_lock; + + apr_initialize(); + atexit(apr_terminate); + + apr_pool_create(&p, NULL); + apr_global_mutex_create(&global_lock, LOCKNAME, APR_LOCK_DEFAULT, p); + apr_global_mutex_child_init(&global_lock, LOCKNAME, p); + + while (1) { + apr_global_mutex_lock(global_lock); + if (i == MAX_ITER) { + apr_global_mutex_unlock(global_lock); + exit(i); + } + i++; + apr_global_mutex_unlock(global_lock); + } + exit(0); +} diff --git a/test/test_apr.h b/test/test_apr.h index 352c79ee3c4..ffa0e898008 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -47,6 +47,7 @@ CuSuite *testflock(void); CuSuite *testfmt(void); CuSuite *testfnmatch(void); CuSuite *testgetopt(void); +CuSuite *testglobalmutex(void); CuSuite *testhash(void); CuSuite *testipsub(void); CuSuite *testlock(void); diff --git a/test/testall.c b/test/testall.c index d0cf8cbd827..8eedf9a6c25 100644 --- a/test/testall.c +++ b/test/testall.c @@ -50,6 +50,7 @@ static const struct testlist { {"testflock", testflock}, {"testfmt", testfmt}, {"testfnmatch", testfnmatch}, + {"testglobalmutex", testglobalmutex}, {"testhash", testhash}, {"testipsub", testipsub}, {"testlock", testlock}, diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index 9eba4073fe7..1f3f8051931 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -13,141 +13,77 @@ * limitations under the License. */ -#include "apr_shm.h" +#include "testglobalmutex.h" #include "apr_thread_proc.h" -#include "apr_file_io.h" #include "apr_global_mutex.h" #include "apr_errno.h" -#include "apr_general.h" -#include "apr_getopt.h" -#include "errno.h" -#include -#include #include "test_apr.h" +static void launch_child(CuTest *tc, apr_proc_t *proc, apr_pool_t *p) +{ + apr_procattr_t *procattr; + const char *args[2]; + apr_status_t rv; + + rv = apr_procattr_create(&procattr, p); + apr_assert_success(tc, "Couldn't create procattr", rv); -#define MAX_ITER 4000 -#define MAX_COUNTER (MAX_ITER * 4) + rv = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, + APR_NO_PIPE); + apr_assert_success(tc, "Couldn't set io in procattr", rv); -apr_global_mutex_t *global_lock; -apr_pool_t *pool; -int *x; + rv = apr_procattr_error_check_set(procattr, 1); + apr_assert_success(tc, "Couldn't set error check in procattr", rv); + + args[0] = "globalmutexchild" EXTENSION; + args[2] = NULL; + rv = apr_proc_create(proc, "./globalmutexchild" EXTENSION, args, NULL, + procattr, p); + apr_assert_success(tc, "Couldn't launch program", rv); +} -static int make_child(apr_proc_t **proc, apr_pool_t *p) +static int wait_child(CuTest *tc, apr_proc_t *proc) { - int i = 0; - *proc = apr_pcalloc(p, sizeof(**proc)); - - /* slight delay to allow things to settle */ - apr_sleep (1); - - if (apr_proc_fork(*proc, p) == APR_INCHILD) { - while (1) { - apr_global_mutex_lock(global_lock); - if (i == MAX_ITER) { - apr_global_mutex_unlock(global_lock); - exit(1); - } - i++; - (*x)++; - apr_global_mutex_unlock(global_lock); - } - exit(1); - } - return APR_SUCCESS; + int exitcode; + apr_exit_why_e why; + + CuAssert(tc, "Error waiting for child process", + apr_proc_wait(proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); + + CuAssert(tc, "child didn't terminate normally", why == APR_PROC_EXIT); + return exitcode; } -static apr_status_t test_exclusive(const char *lockname) +static void test_exclusive(CuTest *tc) { - apr_proc_t *p1, *p2, *p3, *p4; - apr_status_t s1, s2, s3, s4; - - printf("Exclusive lock test\n"); - printf("%-60s", " Initializing the lock"); - s1 = apr_global_mutex_create(&global_lock, lockname, APR_LOCK_DEFAULT, pool); - - if (s1 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); - - printf("%-60s", " Starting all of the processes"); - fflush(stdout); - s1 = make_child(&p1, pool); - s2 = make_child(&p2, pool); - s3 = make_child(&p3, pool); - s4 = make_child(&p4, pool); - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || - s3 != APR_SUCCESS || s4 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); + apr_proc_t p1, p2, p3, p4; + apr_status_t rv; + apr_global_mutex_t *global_lock; + int x = 0; - printf("%-60s", " Waiting for processes to exit"); - s1 = apr_proc_wait(p1, NULL, NULL, APR_WAIT); - s2 = apr_proc_wait(p2, NULL, NULL, APR_WAIT); - s3 = apr_proc_wait(p3, NULL, NULL, APR_WAIT); - s4 = apr_proc_wait(p4, NULL, NULL, APR_WAIT); - printf("OK\n"); + rv = apr_global_mutex_create(&global_lock, LOCKNAME, APR_LOCK_DEFAULT, p); + apr_assert_success(tc, "Error creating mutex", rv); + + + launch_child(tc, &p1, p); + launch_child(tc, &p2, p); + launch_child(tc, &p3, p); + launch_child(tc, &p4, p); - if ((*x) != MAX_COUNTER) { - fprintf(stderr, "Locks don't appear to work! x = %d instead of %d\n", - (*x), MAX_COUNTER); - } - else { - printf("Test passed\n"); - } - return APR_SUCCESS; + x += wait_child(tc, &p1); + x += wait_child(tc, &p2); + x += wait_child(tc, &p3); + x += wait_child(tc, &p4); + + CuAssertIntEquals(tc, MAX_COUNTER, x); } -int main(int argc, const char * const *argv) +CuSuite *testglobalmutex(void) { - apr_status_t rv; - char errmsg[200]; - const char *lockname = NULL; - const char *shmname = "shm.file"; - apr_getopt_t *opt; - char optchar; - const char *optarg; - apr_shm_t *shm; - - printf("APR Proc Mutex Test\n==============\n\n"); - - apr_initialize(); - atexit(apr_terminate); - - if (apr_pool_create(&pool, NULL) != APR_SUCCESS) - exit(-1); - - if ((rv = apr_getopt_init(&opt, pool, argc, argv)) != APR_SUCCESS) { - fprintf(stderr, "Could not set up to parse options: [%d] %s\n", - rv, apr_strerror(rv, errmsg, sizeof errmsg)); - exit(-1); - } - - while ((rv = apr_getopt(opt, "f:", &optchar, &optarg)) == APR_SUCCESS) { - if (optchar == 'f') { - lockname = optarg; - } - } - - if (rv != APR_SUCCESS && rv != APR_EOF) { - fprintf(stderr, "Could not parse options: [%d] %s\n", - rv, apr_strerror(rv, errmsg, sizeof errmsg)); - exit(-1); - } - - apr_shm_create(&shm, sizeof(int), shmname, pool); - x = apr_shm_baseaddr_get(shm); - - if ((rv = test_exclusive(lockname)) != APR_SUCCESS) { - fprintf(stderr,"Exclusive Lock test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-2); - } - - return 0; + CuSuite *suite = CuSuiteNew("Global Mutex"); + + SUITE_ADD_TEST(suite, test_exclusive); + + return suite; } diff --git a/test/testglobalmutex.h b/test/testglobalmutex.h new file mode 100644 index 00000000000..a8e5b629a36 --- /dev/null +++ b/test/testglobalmutex.h @@ -0,0 +1,26 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TESTGLOBALMUTEX_H +#define TESTGLOBALMUTEX_H + +/* set this to 255 so that the child processes can return it successfully. */ +#define MAX_ITER 255 +#define MAX_COUNTER (MAX_ITER * 4) + +#define LOCKNAME "data/apr_globalmutex.lock" + +#endif + From 3c0e246826210a8e0c9ddeabb5e37791d4ab0805 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 15 Mar 2004 18:35:10 +0000 Subject: [PATCH 4907/7878] Fix a stupid paste-o in testglobalmutex. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65000 13f79535-47bb-0310-9956-ffa450edef68 --- test/testglobalmutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index 1f3f8051931..5b9bd7ee610 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -36,7 +36,7 @@ static void launch_child(CuTest *tc, apr_proc_t *proc, apr_pool_t *p) apr_assert_success(tc, "Couldn't set error check in procattr", rv); args[0] = "globalmutexchild" EXTENSION; - args[2] = NULL; + args[1] = NULL; rv = apr_proc_create(proc, "./globalmutexchild" EXTENSION, args, NULL, procattr, p); apr_assert_success(tc, "Couldn't launch program", rv); From b27be4f6fb5017c883f7849122db102696edb8a1 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 16 Mar 2004 01:19:44 +0000 Subject: [PATCH 4908/7878] Add fnmatch to the NetWare makefiles git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65001 13f79535-47bb-0310-9956-ffa450edef68 --- test/nwgnuaprtest | 1 + 1 file changed, 1 insertion(+) diff --git a/test/nwgnuaprtest b/test/nwgnuaprtest index e3a71c83d5f..aa20a144735 100644 --- a/test/nwgnuaprtest +++ b/test/nwgnuaprtest @@ -178,6 +178,7 @@ FILES_nlm_objs = \ $(OBJDIR)/testfileinfo.o \ $(OBJDIR)/testfile.o \ $(OBJDIR)/testfmt.o \ + $(OBJDIR)/testfnmatch.o \ $(OBJDIR)/testhash.o \ $(OBJDIR)/testipsub.o \ $(OBJDIR)/testlock.o \ From 3dd58fa8a5f306076ada84f5e5e07e89c1fd03f4 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 16 Mar 2004 02:09:38 +0000 Subject: [PATCH 4909/7878] Use the correct macros for converting between winsock net errors and apr on NetWare submitted by: Jean-Jacques Clar git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65002 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 6bc8c219f77..094d1fbe098 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -1043,14 +1043,15 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #elif defined(NETWARE) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */ -#define APR_FROM_OS_ERROR(e) (e) -#define APR_TO_OS_ERROR(e) (e) +#define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) +#define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) -#define apr_get_netos_error() (WSAGetLastError()+APR_OS_START_SYSERR) -#define apr_set_netos_error(e) (WSASetLastError((e)-APR_OS_START_SYSERR)) +/* A special case, only socket calls require this: */ +#define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) +#define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e))) #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) From 4afda585e279946d3dc872f692f18f7b57f5b707 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 16 Mar 2004 02:23:33 +0000 Subject: [PATCH 4910/7878] Add a note about the problems with the locking API. This is a showstopper, because it keep people from being able to create a portable program that uses cross-process locks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65003 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index eca6a91d384..5598197cc1d 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2003/11/21 10:42:03 $] +Last modified at [$Date: 2004/03/16 02:23:33 $] Release: @@ -25,6 +25,16 @@ RELEASE 0.9 SHOWSTOPPERS: RELEASE 1.0 SHOWSTOPPERS: + * apr_global_mutex_child_init and apr_proc_mutex_child_init aren't + portable. There are a variety of problems with the locking API when it + is used with apr_create_proc instead of apr_fork. First, _child_init + doesn't take a lockmech_e parameter so it causes a segfault after the + apr_proc_create, because the proc_mutex field hasn't been initialized. + When the lockmech_e parameter is added, it _still_ doesn't work, because + some lock mechanisms expect to inherit from the parent process. For + example, sys V semaphores don't have a file to open, so the child process + can't reaquire the lock. + * Must namespace protect all include/apr_foo.h headers. Jon Travis has especially observed these including apr within Apache-1.3. Message-ID: <20020128100116.A4288@covalent.net> From e0161472c2a8089b4fb30d4ce525b21f453d25f9 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 16 Mar 2004 02:42:28 +0000 Subject: [PATCH 4911/7878] Remove an unused local variable git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65005 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/rand.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/misc/netware/rand.c b/misc/netware/rand.c index c8afa3b550d..e21a0ebfb1f 100644 --- a/misc/netware/rand.c +++ b/misc/netware/rand.c @@ -58,8 +58,6 @@ static int NXSeedRandomInternal( size_t width, void *seed ) APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, apr_size_t length) { - int ret; - if (NXSeedRandom(length, buf) != 0) { return NXSeedRandomInternal (length, buf); } From 10a0f8e66bc5c03ce9b13b18fe92295063fbf68c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 16 Mar 2004 10:43:59 +0000 Subject: [PATCH 4912/7878] * include/apr_strings.h: Clarify apr_cpystrn docco and fix null/NUL confusion. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65006 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index 2d8c647647f..474d357512e 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -168,23 +168,25 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) __attribute__((format(printf,2,3))); /** - * copy n characters from src to dst + * Copy up to dst_size characters from src to dst; does not copy + * past a NUL terminator in src, but always terminates dst with a NUL + * regardless. * @param dst The destination string * @param src The source string * @param dst_size The space available in dst; dst always receives - * null-termination, so if src is longer than + * NUL termination, so if src is longer than * dst_size, the actual number of characters copied is * dst_size - 1. - * @return The destination string, dst + * @return Pointer to the NUL terminator of the destination string, dst * @remark *
    - * We re-implement this function to implement these specific changes:
    - *       1) strncpy() doesn't always null terminate and we want it to.
    - *       2) strncpy() null fills, which is bogus, esp. when copy 8byte strings
    - *          into 8k blocks.
    - *       3) Instead of returning the pointer to the beginning of the
    - *          destination string, we return a pointer to the terminating null
    - *          to allow us to check for truncation.
    + * Note the differences between this function and strncpy():
    + *  1) strncpy() doesn't always NUL terminate; apr_cpystrn() does.
    + *  2) strncpy() pads the destination string with NULs, which is often 
    + *     unnecessary; apr_cpystrn() does not.
    + *  3) strncpy() returns a pointer to the beginning of the dst string;
    + *     apr_cpystrn() returns a pointer to the NUL terminator of dst, 
    + *     to allow a check for truncation.
      * 
    */ APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, From 53bb3e3ea4a73235a915adc67c22cf425a11509a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 16 Mar 2004 19:49:17 +0000 Subject: [PATCH 4913/7878] Increase the default for FD_SETSIZE on Netware git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65007 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr.hnw b/include/apr.hnw index bc8b7b9e91a..8711d1f64b9 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -37,6 +37,8 @@ #if defined(NETWARE) || defined(DOXYGEN) +#define FD_SETSIZE 1024 + #include #include #include From 5de781373c3d7d64668132784c8e238c09a13f64 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 16 Mar 2004 21:24:49 +0000 Subject: [PATCH 4914/7878] Remove a file that is no longer needed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65009 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.h | 51 -------------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 test/aprtest.h diff --git a/test/aprtest.h b/test/aprtest.h deleted file mode 100644 index 941ae3cfe5a..00000000000 --- a/test/aprtest.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2000-2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_strings.h" - -#ifndef APR_TEST_PREFIX -#define APR_TEST_PREFIX "" -#endif - -#define APR_TEST_BEGIN(rv, desc, op) \ - fprintf(stdout, "%s%.*s ", APR_TEST_PREFIX desc, \ - strlen(desc) < 37 ? (int)(40 - strlen(desc)) : 3, \ - "........................................"); \ - APR_TEST_MORE(rv, op) - -#define APR_TEST_MORE(rv, op) \ - if ((rv = (op)) != APR_SUCCESS) { \ - char msgbuf[256]; \ - fprintf (stdout, "Failed\n"); \ - fprintf (stderr, "Error (%d): %s\n%s", rv, #op, \ - apr_strerror(rv, msgbuf, sizeof(msgbuf))); \ - exit(-1); } - -#define APR_TEST_END(rv, op) \ - APR_TEST_MORE(rv, op) \ - fprintf(stdout, "OK\n"); - -#define APR_TEST_SUCCESS(rv, desc, op) \ - APR_TEST_BEGIN(rv, desc, op) \ - fprintf(stdout, "OK\n"); - -#define APR_TEST_INITIALIZE(rv, pool) \ - APR_TEST_SUCCESS(rv, "Initializing", apr_initialize()); \ - atexit(apr_terminate); \ - APR_TEST_SUCCESS(rv, "Creating context", \ - apr_pool_create(&pool, NULL)); - From cfd2ceeda320fb15a2cb10359edca382bf15a8a6 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 16 Mar 2004 21:26:54 +0000 Subject: [PATCH 4915/7878] Add a test for strnatcmp. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65010 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 3 +- test/Makefile.win | 2 +- test/test_apr.h | 1 + test/testall.c | 1 + test/teststrnatcmp.c | 77 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 test/teststrnatcmp.c diff --git a/test/Makefile.in b/test/Makefile.in index a227cd39e03..801d20bd3e2 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -101,7 +101,8 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ testenv.lo testprocmutex.lo testrand2.lo testfnmatch.lo \ - testatomic.lo testflock.lo testshm.lo testsock.lo testglobalmutex.lo + testatomic.lo testflock.lo testshm.lo testsock.lo testglobalmutex.lo \ + teststrnatcmp.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ \ diff --git a/test/Makefile.win b/test/Makefile.win index 5284b3c1ba1..b607bf2684e 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -86,7 +86,7 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj \ testatomic.obj testflock.obj testshm.obj testsock.obj \ - testglobalmutex.obj + testglobalmutex.obj teststrnatcmp.obj testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS) $(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ diff --git a/test/test_apr.h b/test/test_apr.h index ffa0e898008..cb80ea0640c 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -68,6 +68,7 @@ CuSuite *testsock(void); CuSuite *testsockets(void); CuSuite *testsockopt(void); CuSuite *teststr(void); +CuSuite *teststrnatcmp(void); CuSuite *testtable(void); CuSuite *testthread(void); CuSuite *testtime(void); diff --git a/test/testall.c b/test/testall.c index 8eedf9a6c25..ffc3429186f 100644 --- a/test/testall.c +++ b/test/testall.c @@ -71,6 +71,7 @@ static const struct testlist { {"testsockets", testsockets}, {"testsockopt", testsockopt}, {"teststr", teststr}, + {"teststrnatcmp", teststrnatcmp}, {"testtable", testtable}, {"testthread", testthread}, {"testtime", testtime}, diff --git a/test/teststrnatcmp.c b/test/teststrnatcmp.c new file mode 100644 index 00000000000..194aa11f2cf --- /dev/null +++ b/test/teststrnatcmp.c @@ -0,0 +1,77 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_file_io.h" +#include "apr_errno.h" +#include "apr_strings.h" +#include "test_apr.h" + +static void less0(CuTest *tc) +{ + int rv = apr_strnatcmp("a", "b"); + CuAssert(tc, "didn't compare simple strings properly", rv < 0); +} + +static void str_equal(CuTest *tc) +{ + int rv = apr_strnatcmp("a", "a"); + CuAssert(tc, "didn't compare simple strings properly", rv == 0); +} + +static void more0(CuTest *tc) +{ + int rv = apr_strnatcmp("b", "a"); + CuAssert(tc, "didn't compare simple strings properly", rv > 0); +} + +static void less_ignore_case(CuTest *tc) +{ + int rv = apr_strnatcasecmp("a", "B"); + CuAssert(tc, "didn't compare simple strings properly", rv < 0); +} + +static void str_equal_ignore_case(CuTest *tc) +{ + int rv = apr_strnatcasecmp("a", "A"); + CuAssert(tc, "didn't compare simple strings properly", rv == 0); +} + +static void more_ignore_case(CuTest *tc) +{ + int rv = apr_strnatcasecmp("b", "A"); + CuAssert(tc, "didn't compare simple strings properly", rv > 0); +} + +static void natcmp(CuTest *tc) +{ + int rv = apr_strnatcasecmp("a2", "a10"); + CuAssert(tc, "didn't compare simple strings properly", rv < 0); +} + +CuSuite *teststrnatcmp(void) +{ + CuSuite *suite = CuSuiteNew("Natural String Cmp"); + + SUITE_ADD_TEST(suite, less0); + SUITE_ADD_TEST(suite, str_equal); + SUITE_ADD_TEST(suite, more0); + SUITE_ADD_TEST(suite, less_ignore_case); + SUITE_ADD_TEST(suite, str_equal_ignore_case); + SUITE_ADD_TEST(suite, more_ignore_case); + SUITE_ADD_TEST(suite, natcmp); + + return suite; +} + From 8c6f28a2b09900b669cff46e65c67a5951e976b1 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 17 Mar 2004 00:20:59 +0000 Subject: [PATCH 4916/7878] Implement apr_file_mktemp() for NetWare to avoid problems with exclusive file locking git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65011 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/mktemp.c | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 file_io/netware/mktemp.c diff --git a/file_io/netware/mktemp.c b/file_io/netware/mktemp.c new file mode 100644 index 00000000000..884a8c40bf3 --- /dev/null +++ b/file_io/netware/mktemp.c @@ -0,0 +1,49 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_private.h" +#include "apr_file_io.h" /* prototype of apr_mkstemp() */ +#include "apr_strings.h" /* prototype of apr_mkstemp() */ +#include "apr_arch_file_io.h" /* prototype of apr_mkstemp() */ +#include "apr_portable.h" /* for apr_os_file_put() */ + +#include /* for mkstemp() - Single Unix */ + +APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_int32_t flags, apr_pool_t *p) +{ + int fd; + apr_status_t rv; + + flags = (!flags) ? APR_CREATE | APR_READ | APR_WRITE | + APR_DELONCLOSE : flags; + + fd = mkstemp(template); + if (fd == -1) { + return errno; + } + /* We need to reopen the file to get rid of the o_excl flag. + * Otherwise file locking will not allow the file to be shared. + */ + close(fd); + if ((rv = apr_file_open(fp, template, flags|APR_FILE_NOCLEANUP, + APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) { + + apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), + apr_unix_file_cleanup, apr_unix_file_cleanup); + } + + return rv; +} + From 7c54591808a42f8ab43dcc655caccd25439cd5df Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 18 Mar 2004 03:30:58 +0000 Subject: [PATCH 4917/7878] Add an initial test for the file_copy APIs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65014 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- test/Makefile.win | 2 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testfilecopy.c | 137 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 test/testfilecopy.c diff --git a/test/Makefile.in b/test/Makefile.in index 801d20bd3e2..bed4ec936de 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -102,7 +102,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ testenv.lo testprocmutex.lo testrand2.lo testfnmatch.lo \ testatomic.lo testflock.lo testshm.lo testsock.lo testglobalmutex.lo \ - teststrnatcmp.lo + teststrnatcmp.lo testfilecopy.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ \ diff --git a/test/Makefile.win b/test/Makefile.win index b607bf2684e..0c72f792cc4 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -86,7 +86,7 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj \ testatomic.obj testflock.obj testshm.obj testsock.obj \ - testglobalmutex.obj teststrnatcmp.obj + testglobalmutex.obj teststrnatcmp.obj testfilecopy.obj testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS) $(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ diff --git a/test/test_apr.h b/test/test_apr.h index cb80ea0640c..b67120b650a 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -42,6 +42,7 @@ CuSuite *testdso(void); CuSuite *testdup(void); CuSuite *testenv(void); CuSuite *testfile(void); +CuSuite *testfilecopy(void); CuSuite *testfileinfo(void); CuSuite *testflock(void); CuSuite *testfmt(void); diff --git a/test/testall.c b/test/testall.c index ffc3429186f..571340aad85 100644 --- a/test/testall.c +++ b/test/testall.c @@ -46,6 +46,7 @@ static const struct testlist { {"testdup", testdup}, {"testenv", testenv}, {"testfile", testfile}, + {"testfilecopy", testfilecopy}, {"testfileinfo", testfileinfo}, {"testflock", testflock}, {"testfmt", testfmt}, diff --git a/test/testfilecopy.c b/test/testfilecopy.c new file mode 100644 index 00000000000..2a2abb356f0 --- /dev/null +++ b/test/testfilecopy.c @@ -0,0 +1,137 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "test_apr.h" +#include "apr_file_io.h" +#include "apr_file_info.h" +#include "apr_errno.h" +#include "apr_pools.h" + +static void copy_helper(CuTest *tc, const char *from, const char * to, + apr_fileperms_t perms, int append, apr_pool_t *p) +{ + apr_status_t rv; + apr_status_t dest_rv; + apr_finfo_t copy; + apr_finfo_t orig; + apr_finfo_t dest; + + dest_rv = apr_stat(&dest, to, APR_FINFO_SIZE, p); + + if (!append) { + rv = apr_file_copy(from, to, perms, p); + } + else { + rv = apr_file_append(from, to, perms, p); + } + apr_assert_success(tc, "Error copying file", rv); + + rv = apr_stat(&orig, from, APR_FINFO_SIZE, p); + apr_assert_success(tc, "Couldn't stat original file", rv); + + rv = apr_stat(©, to, APR_FINFO_SIZE, p); + apr_assert_success(tc, "Couldn't stat copy file", rv); + + if (!append) { + CuAssertIntEquals(tc, orig.size, copy.size); + } + else { + CuAssertIntEquals(tc, + ((dest_rv == APR_SUCCESS) ? dest.size : 0) + orig.size, + copy.size); + } +} + +static void copy_short_file(CuTest *tc) +{ + apr_status_t rv; + + /* make absolutely sure that the dest file doesn't exist. */ + apr_file_remove("data/file_copy.txt", p); + + copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", + APR_FILE_SOURCE_PERMS, 0, p); + rv = apr_file_remove("data/file_copy.txt", p); + apr_assert_success(tc, "Couldn't remove copy file", rv); +} + +static void copy_over_existing(CuTest *tc) +{ + apr_status_t rv; + + /* make absolutely sure that the dest file doesn't exist. */ + apr_file_remove("data/file_copy.txt", p); + + /* This is a cheat. I don't want to create a new file, so I just copy + * one file, then I copy another. If the second copy succeeds, then + * this works. + */ + copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", + APR_FILE_SOURCE_PERMS, 0, p); + + copy_helper(tc, "data/mmap_datafile.txt", "data/file_copy.txt", + APR_FILE_SOURCE_PERMS, 0, p); + + rv = apr_file_remove("data/file_copy.txt", p); + apr_assert_success(tc, "Couldn't remove copy file", rv); +} + +static void append_nonexist(CuTest *tc) +{ + apr_status_t rv; + + /* make absolutely sure that the dest file doesn't exist. */ + apr_file_remove("data/file_copy.txt", p); + + copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", + APR_FILE_SOURCE_PERMS, 0, p); + rv = apr_file_remove("data/file_copy.txt", p); + apr_assert_success(tc, "Couldn't remove copy file", rv); +} + +static void append_exist(CuTest *tc) +{ + apr_status_t rv; + + /* make absolutely sure that the dest file doesn't exist. */ + apr_file_remove("data/file_copy.txt", p); + + /* This is a cheat. I don't want to create a new file, so I just copy + * one file, then I copy another. If the second copy succeeds, then + * this works. + */ + copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", + APR_FILE_SOURCE_PERMS, 0, p); + + copy_helper(tc, "data/mmap_datafile.txt", "data/file_copy.txt", + APR_FILE_SOURCE_PERMS, 1, p); + + rv = apr_file_remove("data/file_copy.txt", p); + apr_assert_success(tc, "Couldn't remove copy file", rv); +} + +CuSuite *testfilecopy(void) +{ + CuSuite *suite = CuSuiteNew("File Copy"); + + SUITE_ADD_TEST(suite, copy_short_file); + SUITE_ADD_TEST(suite, copy_over_existing); + + SUITE_ADD_TEST(suite, append_nonexist); + SUITE_ADD_TEST(suite, append_exist); + + return suite; +} + From a1f4b44e422ad20eefb20b0aea4d939691bc2c3d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 18 Mar 2004 17:41:08 +0000 Subject: [PATCH 4918/7878] Update .cvsignore to remove all the files that we don't build anymore. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65015 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 51 ++++++------------------------------------------- 1 file changed, 6 insertions(+), 45 deletions(-) diff --git a/test/.cvsignore b/test/.cvsignore index 5b58306f82b..2bb5c1d6600 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -7,39 +7,11 @@ Release *.la .libs .deps -testmd5 -testmmap htdigest proctest readchild -testatomic -testud -testargs -testdir -testdso -testdup -testfmt -testhash -testoc -testpipe -testpoll -testpools -testrand -testshm -testshmconsumer -testshmproducer -testsleep -teststr -testtime -testthread -client -server -testsock -testproc -testfile occhild sendfile -testuuid aprtest aprtest.ncb aprtest.opt @@ -47,31 +19,14 @@ aprtest.plg aprtest.sln aprtest.suo aprtest.vcproj -testfile.tmp -testflock -testsockopt -testipsub *.ilk *.pdb *.idb mod_test.exp mod_test.lib mod_test.so -testnames *.dbg -testmem -testlock -testlockperf *.core -testsockets -testuser -test.fil -testprocmutex -testglobalmutex -testvsn -testregex -testmutexscope -testtable tryread testall testall.ncb @@ -79,6 +34,12 @@ testall.opt testall.plg proc_child sockchild +globalmutexchild *.bb *.bbg *.da +testlockperf +testmutexscope +testshmconsumer +testshmproducer + From 8217049a650c015f07504a9e7a11a031524c7114 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 18 Mar 2004 17:46:02 +0000 Subject: [PATCH 4919/7878] Add a simple test for the functions that deal with temp files and directories. This needs a lot more work. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65016 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- test/Makefile.win | 3 ++- test/test_apr.h | 1 + test/testall.c | 1 + test/testtemp.c | 37 +++++++++++++++++++++++++++++++++++++ 5 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 test/testtemp.c diff --git a/test/Makefile.in b/test/Makefile.in index bed4ec936de..de57f51561c 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -102,7 +102,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ testenv.lo testprocmutex.lo testrand2.lo testfnmatch.lo \ testatomic.lo testflock.lo testshm.lo testsock.lo testglobalmutex.lo \ - teststrnatcmp.lo testfilecopy.lo + teststrnatcmp.lo testfilecopy.lo testtemp.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ \ diff --git a/test/Makefile.win b/test/Makefile.win index 0c72f792cc4..19eb0d10cca 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -86,7 +86,8 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj \ testatomic.obj testflock.obj testshm.obj testsock.obj \ - testglobalmutex.obj teststrnatcmp.obj testfilecopy.obj + testglobalmutex.obj teststrnatcmp.obj testfilecopy.obj \ + testtemp.obj testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS) $(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ diff --git a/test/test_apr.h b/test/test_apr.h index b67120b650a..cc46f7f424f 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -71,6 +71,7 @@ CuSuite *testsockopt(void); CuSuite *teststr(void); CuSuite *teststrnatcmp(void); CuSuite *testtable(void); +CuSuite *testtemp(void); CuSuite *testthread(void); CuSuite *testtime(void); CuSuite *testud(void); diff --git a/test/testall.c b/test/testall.c index 571340aad85..7e0a4f9f033 100644 --- a/test/testall.c +++ b/test/testall.c @@ -74,6 +74,7 @@ static const struct testlist { {"teststr", teststr}, {"teststrnatcmp", teststrnatcmp}, {"testtable", testtable}, + {"testtemp", testtemp}, {"testthread", testthread}, {"testtime", testtime}, {"testud", testud}, diff --git a/test/testtemp.c b/test/testtemp.c new file mode 100644 index 00000000000..8f1814c7bc8 --- /dev/null +++ b/test/testtemp.c @@ -0,0 +1,37 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "test_apr.h" +#include "apr_file_io.h" + +static void test_temp_dir(CuTest *tc) +{ + const char *tempdir = NULL; + apr_status_t rv; + + rv = apr_temp_dir_get(&tempdir, p); + apr_assert_success(tc, "Error finding Temporary Directory", rv); + CuAssertPtrNotNull(tc, tempdir); +} + +CuSuite *testtemp(void) +{ + CuSuite *suite = CuSuiteNew("Temp Dir"); + + SUITE_ADD_TEST(suite, test_temp_dir); + + return suite; +} + From 094a031585a15984d6f684537d75ee7d3a4eb287 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 18 Mar 2004 18:19:07 +0000 Subject: [PATCH 4920/7878] Add a note about the timeout status codes. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65017 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 5598197cc1d..897a24a8524 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2004/03/16 02:23:33 $] +Last modified at [$Date: 2004/03/18 18:19:07 $] Release: @@ -25,6 +25,11 @@ RELEASE 0.9 SHOWSTOPPERS: RELEASE 1.0 SHOWSTOPPERS: + * Timeout status codes aren't consistant across platforms. Some use + APR_TIMEUP while others use APR_ETIMEDOUT. These need to be combined into + one code (APR_TIMEUP), and APR_ETIMEDOUT needs to be removed and + deprecated. + * apr_global_mutex_child_init and apr_proc_mutex_child_init aren't portable. There are a variety of problems with the locking API when it is used with apr_create_proc instead of apr_fork. First, _child_init From c1c663f04fa033b580be7d420f480f3a0ee476c8 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 18 Mar 2004 20:45:03 +0000 Subject: [PATCH 4921/7878] * test/testsock.c (test_addr_info): Pass NULL as hostname rather than an apr_interface_e. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65018 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testsock.c b/test/testsock.c index 4877f402c7b..fad2b72a162 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -63,7 +63,7 @@ static void test_addr_info(CuTest *tc) apr_status_t rv; apr_sockaddr_t *sa; - rv = apr_sockaddr_info_get(&sa, APR_LOCAL, APR_UNSPEC, 80, 0, p); + rv = apr_sockaddr_info_get(&sa, NULL, APR_UNSPEC, 80, 0, p); apr_assert_success(tc, "Problem generating sockaddr", rv); rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, 80, 0, p); @@ -77,7 +77,7 @@ static apr_socket_t *setup_socket(CuTest *tc) apr_sockaddr_t *sa; apr_socket_t *sock; - rv = apr_sockaddr_info_get(&sa, APR_LOCAL, APR_INET, 8021, 0, p); + rv = apr_sockaddr_info_get(&sa, NULL, APR_INET, 8021, 0, p); apr_assert_success(tc, "Problem generating sockaddr", rv); rv = apr_socket_create(&sock, sa->family, SOCK_STREAM, APR_PROTO_TCP, p); From af320c36e3808a5e0e8b3ae31e77232400058c19 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 19 Mar 2004 02:22:31 +0000 Subject: [PATCH 4922/7878] Add a test for apr_mktemp git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65019 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtemp.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/testtemp.c b/test/testtemp.c index 8f1814c7bc8..a76182ca043 100644 --- a/test/testtemp.c +++ b/test/testtemp.c @@ -15,6 +15,7 @@ #include "test_apr.h" #include "apr_file_io.h" +#include "apr_strings.h" static void test_temp_dir(CuTest *tc) { @@ -26,11 +27,27 @@ static void test_temp_dir(CuTest *tc) CuAssertPtrNotNull(tc, tempdir); } +static void test_mktemp(CuTest *tc) +{ + apr_file_t *f = NULL; + const char *tempdir = NULL; + char *filetemplate; + apr_status_t rv; + + rv = apr_temp_dir_get(&tempdir, p); + apr_assert_success(tc, "Error finding Temporary Directory", rv); + + filetemplate = apr_pstrcat(p, tempdir, "/tempfileXXXXXX", NULL); + rv = apr_file_mktemp(&f, filetemplate, 0, p); + apr_assert_success(tc, "Error opening Temporary file", rv); +} + CuSuite *testtemp(void) { CuSuite *suite = CuSuiteNew("Temp Dir"); SUITE_ADD_TEST(suite, test_temp_dir); + SUITE_ADD_TEST(suite, test_mktemp); return suite; } From 3c48a8fcb5f7b38e42ec8191620f6d0cffe4162d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 22 Mar 2004 20:51:25 +0000 Subject: [PATCH 4923/7878] * test/testpipe.c (set_timeout): Use global readp, writep. (testpipe): Close pipes after use. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65021 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpipe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/testpipe.c b/test/testpipe.c index e7220e88590..b8c891a96b5 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -53,8 +53,6 @@ static void close_pipe(CuTest *tc) static void set_timeout(CuTest *tc) { apr_status_t rv; - apr_file_t *readp = NULL; - apr_file_t *writep = NULL; apr_interval_time_t timeout; rv = apr_file_pipe_create(&readp, &writep, p); @@ -188,9 +186,12 @@ CuSuite *testpipe(void) SUITE_ADD_TEST(suite, create_pipe); SUITE_ADD_TEST(suite, close_pipe); SUITE_ADD_TEST(suite, set_timeout); + SUITE_ADD_TEST(suite, close_pipe); SUITE_ADD_TEST(suite, read_write); + SUITE_ADD_TEST(suite, close_pipe); SUITE_ADD_TEST(suite, read_write_notimeout); SUITE_ADD_TEST(suite, test_pipe_writefull); + SUITE_ADD_TEST(suite, close_pipe); return suite; } From 184b15cdbd69e02a51887a16cb008dc4fd9e6205 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 22 Mar 2004 20:56:29 +0000 Subject: [PATCH 4924/7878] * test/Makefile.in: Fix includes for VPATH builds so at least the tests compile. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65022 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index de57f51561c..7465cf5f061 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -33,7 +33,7 @@ readchild@EXEEXT@ tryread@EXEEXT@ sockchid@EXEEXT@ CLEAN_SUBDIRS = internal INCDIR=../include -INCLUDES=-I$(INCDIR) +INCLUDES=-I$(INCDIR) -I$(srcdir)/../include # link programs using -no-install to get real executables not # libtool wrapper scripts which link an executable when first run. From d95a2eafa4590af196ecac93a85ac1d2f580e742 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 23 Mar 2004 21:17:08 +0000 Subject: [PATCH 4925/7878] Add apr_random to the NetWare build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65023 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 9 ++++++--- build/nw_export.inc | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 620bbbb1c8c..681019e8541 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -242,6 +242,7 @@ FILES_lib_objs = \ $(OBJDIR)/apr_getpass.o \ $(OBJDIR)/apr_hash.o \ $(OBJDIR)/apr_pools.o \ + $(OBJDIR)/apr_random.o \ $(OBJDIR)/apr_snprintf.o \ $(OBJDIR)/apr_strings.o \ $(OBJDIR)/apr_strnatcmp.o \ @@ -280,6 +281,8 @@ FILES_lib_objs = \ $(OBJDIR)/readwrite.o \ $(OBJDIR)/seek.o \ $(OBJDIR)/sendrecv.o \ + $(OBJDIR)/sha2.o \ + $(OBJDIR)/sha2_glue.o \ $(OBJDIR)/shm.o \ $(OBJDIR)/signals.o \ $(OBJDIR)/sockaddr.o \ @@ -431,9 +434,9 @@ $(OBJDIR)/%.o: support/unix/%.c $(OBJDIR)\cc.opt @echo Compiling $< $(CC) support\unix\$( Date: Thu, 25 Mar 2004 23:08:23 +0000 Subject: [PATCH 4926/7878] * time/unix/time.c (apr_time_exp_get): Remove year check that failed for 2038, use apr_time_t to avoid overflow. * time/win32/time.c (apr_time_exp_get): ditto * test/testtime.c (test_2038): Add regression test. Submitted by: Philip Martin git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65026 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ test/testtime.c | 19 +++++++++++++++++++ time/unix/time.c | 9 ++------- time/win32/time.c | 10 ++-------- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index 397d2062a04..7e9ea0e206d 100644 --- a/CHANGES +++ b/CHANGES @@ -117,6 +117,9 @@ Changes with APR 1.0 Changes with APR 0.9.5 + *) Fix apr_time_exp_get() for dates in 2038. + [Philip Martin ] + *) Various build fixes: thread_rwlock.c on some Solaris platforms (PR 22990); filestat.c on ReliantUnix (PR 22990); config.status on IRIX (PR 19251). [Various] diff --git a/test/testtime.c b/test/testtime.c index ab14cdfe3a9..a84da164c23 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -265,6 +265,24 @@ static void test_strftimeoffset(CuTest *tc) CuAssertTrue(tc, rv == APR_SUCCESS); } +/* 0.9.4 and earlier rejected valid dates in 2038 */ +static void test_2038(CuTest *tc) +{ + apr_time_exp_t xt; + apr_time_t t; + + /* 2038-01-19T03:14:07.000000Z */ + xt.tm_year = 138; + xt.tm_mon = 0; + xt.tm_mday = 19; + xt.tm_hour = 3; + xt.tm_min = 14; + xt.tm_sec = 7; + + apr_assert_success(tc, "explode January 19th, 2038", + apr_time_exp_get(&t, &xt)); +} + CuSuite *testtime(void) { CuSuite *suite = CuSuiteNew("Time"); @@ -281,6 +299,7 @@ CuSuite *testtime(void) SUITE_ADD_TEST(suite, test_strftimesmall); SUITE_ADD_TEST(suite, test_exp_tz); SUITE_ADD_TEST(suite, test_strftimeoffset); + SUITE_ADD_TEST(suite, test_2038); return suite; } diff --git a/time/unix/time.c b/time/unix/time.c index 1af56e64383..507d7101478 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -135,16 +135,11 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt) { - int year; - time_t days; + apr_time_t year = xt->tm_year; + apr_time_t days; static const int dayoffset[12] = {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; - year = xt->tm_year; - if (year < 70 || ((sizeof(time_t) <= 4) && (year >= 138))) { - return APR_EBADDATE; - } - /* shift new year to 1st March in order to make leap year calc easy */ if (xt->tm_mon < 2) diff --git a/time/win32/time.c b/time/win32/time.c index 59ffcc43e1d..35743b3d2b2 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -218,17 +218,11 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt) { - int year; - time_t days; + apr_time_t year = xt->tm_year; + apr_time_t days; static const int dayoffset[12] = {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; - year = xt->tm_year; - - if (year < 70 || ((sizeof(time_t) <= 4) && (year >= 138))) { - return APR_EBADDATE; - } - /* shift new year to 1st March in order to make leap year calc easy */ if (xt->tm_mon < 2) From 1bc252bd331b5a09a6ababe16a488fad77e194cc Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 27 Mar 2004 13:11:18 +0000 Subject: [PATCH 4927/7878] Add LFS support: * configure.in: Check for off64_t and necessary LFS functions, define apr_off_t as off64_t where available. Add --disable-lfs flag. Forward-port changes from 0.9.5 to define apr_off_t as long on systems systems with a 32-bit off_t which don't have LFS enabled. * include/apr.h.in: Let configure define APR_HAS_LARGE_FILES. * include/arch/netware/apr_arch_file_io.h: Redefine lseek and ftruncate. * include/arch/unix/apr_arch_file_io.h: Redefine stat, lstat, fstat, lseek, ftruncate here; define struct_stat. * file_io/unix/filestat.c: Use struct_stat. * file_io/unix/mktemp.c: Use mkstemp64 where available. * file_io/unix/open.c (apr_file_open): Use O_LARGEFILE by default when LFS is enabled. * file_io/unix/readwrite.c, file_io/unix/seek.c: Don't redefine lseek and ftruncate here. * mmap/unix/mmap.c (apr_mmap_create): Use mmap64 if available; otherwise check for overflow when LFS is enabled. * network_io/unix/sendrecv.c (apr_socket_sendfile) [Linux/HPUX]: Use sendfile64 if available; otherwise check for overflow when LFS is enabled. [solaris]: Use sendfilev64/sendfilevec64_t. * test/Makefile.in, test/test_apr.h, test/testlfs.c: Add tests. Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65027 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + configure.in | 108 +++++++-- file_io/unix/filestat.c | 6 +- file_io/unix/mktemp.c | 5 + file_io/unix/open.c | 4 + file_io/unix/readwrite.c | 4 - file_io/unix/seek.c | 13 -- include/apr.h.in | 2 +- include/arch/netware/apr_arch_file_io.h | 7 + include/arch/unix/apr_arch_file_io.h | 11 + mmap/unix/mmap.c | 8 + network_io/unix/sendrecv.c | 52 ++++- test/.cvsignore | 2 +- test/Makefile.in | 2 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testlfs.c | 278 ++++++++++++++++++++++++ 17 files changed, 457 insertions(+), 50 deletions(-) create mode 100644 test/testlfs.c diff --git a/CHANGES b/CHANGES index 7e9ea0e206d..f4c88907849 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Support "large files" by default on 32-bit Unix platforms which + implement the LFS standard. [Joe Orton] + *) Add apr_threadattr_stacksize_set() for overriding the default stack size for threads created by apr_thread_create(). [Jeff Trawick] diff --git a/configure.in b/configure.in index f7b9c99dd00..37dd08e339c 100644 --- a/configure.in +++ b/configure.in @@ -416,6 +416,55 @@ esac AC_SUBST(OBJECTS_PLATFORM) +# Check whether LFS has explicitly been disabled +AC_ARG_ENABLE(lfs,[ --disable-lfs Disable large file support on 32-bit platforms], +[apr_lfs_choice=$enableval], [apr_lfs_choice=yes]) + +if test "$apr_lfs_choice" = "yes"; then + # Check whether the transitional LFS API is sufficient + AC_CACHE_CHECK([whether to enable -D_LARGEFILE64_SOURCE], [apr_cv_use_lfs64], [ + apr_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" + AC_TRY_RUN([ +#include +#include +#include +#include +#include +#include + +void main(void) +{ + int fd, ret = 0; + struct stat64 st; + off64_t off = 4242; + + if (sizeof(off64_t) != 8 || sizeof(off_t) != 4) + exit(1); + if ((fd = open("conftest.lfs", O_LARGEFILE|O_CREAT|O_WRONLY)) < 0) + exit(2); + if (ftruncate64(fd, off) != 0) + ret = 3; + else if (fstat64(fd, &st) != 0 || st.st_size != off) + ret = 4; + else if (lseek64(fd, off, SEEK_SET) != off) + ret = 5; + else if (close(fd) != 0) + ret = 6; + else if (lstat64("conftest.lfs", &st) != 0 || st.st_size != off) + ret = 7; + else if (stat64("conftest.lfs", &st) != 0 || st.st_size != off) + ret = 8; + unlink("conftest.lfs"); + + exit(ret); +}], [apr_cv_use_lfs64=yes], [apr_cv_use_lfs64=no], [apr_cv_use_lfs64=no]) + CPPFLAGS=$apr_save_CPPFLAGS]) + if test "$apr_cv_use_lfs64" = "yes"; then + APR_ADDTO(CPPFLAGS, [-D_LARGEFILE64_SOURCE]) + fi +fi + AC_ARG_ENABLE(nonportable-atomics, [ --enable-nonportable-atomics Use optimized atomic code which may produce nonportable binaries], [if test $enableval = yes; then @@ -1104,11 +1153,6 @@ else stdint=0 fi -if test "$ac_cv_type_off_t" = "yes"; then - off_t_value="off_t" -else - off_t_value="apr_int32_t" -fi if test "$ac_cv_type_size_t" = "yes"; then size_t_value="size_t" else @@ -1147,15 +1191,45 @@ fi APR_CHECK_SIZEOF_EXTENDED([#include ], off_t, 8) -if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then - off_t_fmt='#define APR_OFF_T_FMT "d"' -elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then - off_t_fmt='#define APR_OFF_T_FMT "ld"' -elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then +if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then + # Enable LFS + aprlfs=1 + AC_CHECK_FUNCS([mmap64 sendfile64 sendfilev64 mkstemp64]) +else + aprlfs=0 +fi + +AC_MSG_CHECKING([which type to use for apr_off_t]) +if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then + # LFS is go! off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' + off_t_value='off64_t' +elif test "${ac_cv_sizeof_off_t}x${ac_cv_sizeof_long}" = "4x4"; then + # Special case: off_t may change size with _FILE_OFFSET_BITS + # on 32-bit systems with LFS support. To avoid compatibility + # with other software which may export _FILE_OFFSET_BITS, + # hard-code apr_off_t to long. + off_t_value=long + off_t_fmt='#define APR_OFF_T_FMT "ld"' +elif test "$ac_cv_type_off_t" = "yes"; then + off_t_value=off_t + # off_t is more commonly a long than an int; prefer that case + # where int and long are the same size. + if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then + off_t_fmt='#define APR_OFF_T_FMT "ld"' + elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then + off_t_fmt='#define APR_OFF_T_FMT "d"' + elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then + off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' + else + AC_ERROR([could not determine the size of off_t]) + fi else - off_t_fmt='#error Can not determine the proper size for off_t' + # Fallback on int + off_t_value=apr_int32_t + off_t_fmt=d fi +AC_MSG_RESULT($off_t_value) APR_CHECK_SIZEOF_EXTENDED([#include ], pid_t, 8) @@ -1188,7 +1262,6 @@ case $host in size_t_fmt='#define APR_SIZE_T_FMT "ld"' ;; *-os2*) - off_t_fmt='#define APR_OFF_T_FMT "ld"' size_t_fmt='#define APR_SIZE_T_FMT "lu"' ;; *-solaris*) @@ -1208,16 +1281,6 @@ case $host in ;; esac -# Override format string for off_t more carefully: only use hard-coded -# choice if using a 32-bit off_t on platforms which support LFS. -if test "$ac_cv_sizeof_off_t" = "4"; then - case $host in - *linux*|*-solaris*|*aix[[45]]*) - off_t_fmt='#define APR_OFF_T_FMT "ld"' - ;; - esac -fi - AC_SUBST(voidp_size) AC_SUBST(short_value) AC_SUBST(int_value) @@ -1238,6 +1301,7 @@ AC_SUBST(int64_literal) AC_SUBST(uint64_literal) AC_SUBST(stdint) AC_SUBST(bigendian) +AC_SUBST(aprlfs) dnl ----------------------------- Checking for string functions AC_CHECK_FUNCS(strnicmp, have_strnicmp="1", have_strnicmp="0") diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 85352fa9da7..4e56f99487e 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -66,7 +66,7 @@ static apr_filetype_e filetype_from_mode(mode_t mode) return type; } -static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, +static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info, apr_int32_t wanted) { finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK @@ -94,7 +94,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) { - struct stat info; + struct_stat info; if (thefile->buffered) { apr_status_t rv = apr_file_flush(thefile); @@ -227,7 +227,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *pool) { - struct stat info; + struct_stat info; int srv; if (wanted & APR_FINFO_LINK) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index ff23a2f7b99..6db13c69c7a 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -182,7 +182,12 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i return gettemp(template, fp, flags, p); #else +#ifdef HAVE_MKSTEMP64 + fd = mkstemp64(template); +#else fd = mkstemp(template); +#endif + if (fd == -1) { return errno; } diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 81d622426fa..ee91962141d 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -99,6 +99,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, } #endif +#if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE) + oflags |= O_LARGEFILE; +#endif + #if APR_HAS_THREADS if ((flag & APR_BUFFERED) && (flag & APR_XTHREAD)) { rv = apr_thread_mutex_create(&thlock, diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 3059f670fa4..1e6a6e66542 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -164,11 +164,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a */ apr_int64_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; if (offset != thefile->filePtr) -#if defined(NETWARE) && APR_HAS_LARGE_FILES - lseek64(thefile->filedes, offset, SEEK_SET); -#else lseek(thefile->filedes, offset, SEEK_SET); -#endif thefile->bufpos = thefile->dataRead = 0; thefile->direction = 1; } diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 2ae433f9d7e..cac4e9331fd 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -31,11 +31,7 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) rc = 0; } else { -#if defined(NETWARE) && APR_HAS_LARGE_FILES - rc = lseek64(thefile->filedes, pos, SEEK_SET); -#else rc = lseek(thefile->filedes, pos, SEEK_SET); -#endif if (rc != -1 ) { thefile->bufpos = thefile->dataRead = 0; @@ -81,12 +77,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh return rc; } else { - -#if defined(NETWARE) && APR_HAS_LARGE_FILES - rv = lseek64(thefile->filedes, *offset, where); -#else rv = lseek(thefile->filedes, *offset, where); -#endif if (rv == -1) { *offset = -1; return errno; @@ -100,11 +91,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset) { -#if defined(NETWARE) && APR_HAS_LARGE_FILES - if (ftruncate64(fp->filedes, offset) == -1) { -#else if (ftruncate(fp->filedes, offset) == -1) { -#endif return errno; } return setptr(fp, offset); diff --git a/include/apr.h.in b/include/apr.h.in index 02ae79c1d5b..32e7407ebf4 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -218,7 +218,7 @@ extern "C" { #define APR_HAS_UNICODE_FS 0 #define APR_HAS_PROC_INVOKED 0 #define APR_HAS_USER 1 -#define APR_HAS_LARGE_FILES 0 +#define APR_HAS_LARGE_FILES @aprlfs@ #define APR_HAS_XTHREAD_FILES 0 #define APR_HAS_OS_UUID 0 diff --git a/include/arch/netware/apr_arch_file_io.h b/include/arch/netware/apr_arch_file_io.h index 8d8b96441fc..70ce289d97f 100644 --- a/include/arch/netware/apr_arch_file_io.h +++ b/include/arch/netware/apr_arch_file_io.h @@ -70,6 +70,13 @@ #define APR_FILE_BUFSIZE 4096 +#if APR_HAS_LARGE_FILES +#define lseek(f,o,w) lseek64(f,o,w) +#define ftruncate(f,l) ftruncate64(f,l) +#endif + +typedef struct stat struct_stat; + struct apr_file_t { apr_pool_t *pool; int filedes; diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index 0802c26399c..004f59ee0bd 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -109,6 +109,17 @@ struct apr_file_t { #endif }; +#if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE) +#define stat(f,b) stat64(f,b) +#define lstat(f,b) lstat64(f,b) +#define fstat(f,b) fstat64(f,b) +#define lseek(f,o,w) lseek64(f,o,w) +#define ftruncate(f,l) ftruncate64(f,l) +typedef struct stat64 struct_stat; +#else +typedef struct stat struct_stat; +#endif + struct apr_dir_t { apr_pool_t *pool; char *dirname; diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 44cdbedb05a..05d3f72efce 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -83,6 +83,14 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_int32_t native_flags = 0; #endif +#if APR_HAS_LARGE_FILES && defined(HAVE_MMAP64) +#define mmap mmap64 +#elif APR_HAS_LARGE_FILES && SIZEOF_OFF_T == 4 + /* LFS but no mmap64: check for overflow */ + if ((apr_int64_t)offset + size > INT_MAX) + return APR_EINVAL; +#endif + if (size == 0) return APR_EINVAL; diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 60fae1a885b..9381693ed3b 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -243,10 +243,28 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags) { - off_t off = *offset; int rv, nbytes = 0, total_hdrbytes, i; apr_status_t arv; +#if APR_HAS_LARGE_FILES && defined(HAVE_SENDFILE64) + apr_off_t off = *offset; +#define sendfile sendfile64 + +#elif APR_HAS_LARGE_FILES && SIZEOF_OFF_T == 4 + /* 64-bit apr_off_t but no sendfile64(): fail if trying to send + * past the 2Gb limit. */ + off_t off; + + if ((apr_int64_t)*offset + *len > INT_MAX) { + return EINVAL; + } + + off = *offset; + +#else + off_t off = *offset; +#endif + if (!hdtr) { hdtr = &no_hdtr; } @@ -562,6 +580,24 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, struct iovec hdtrarray[2]; char *headerbuf, *trailerbuf; +#if APR_HAS_LARGE_FILES && defined(HAVE_SENDFILE64) + /* later HP-UXes have a sendfile64() */ +#define sendfile sendfile64 + apr_off_t off = *offset; + +#elif APR_HAS_LARGE_FILES && SIZEOF_OFF_T == 4 + /* HP-UX 11.00 doesn't have a sendfile64(): fail if trying to send + * past the 2Gb limit */ + off_t off; + + if ((apr_int64_t)*offset + *len > INT_MAX) { + return EINVAL; + } + off = *offset; +#else + apr_off_t off = *offset; +#endif + if (!hdtr) { hdtr = &no_hdtr; } @@ -627,7 +663,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, if (nbytes) { /* any bytes to send from the file? */ rc = sendfile(sock->socketdes, /* socket */ file->filedes, /* file descriptor to send */ - *offset, /* where in the file to start */ + off, /* where in the file to start */ nbytes, /* number of bytes to send from file */ hdtrarray, /* Headers/footers */ flags); /* undefined, set to 0 */ @@ -650,7 +686,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, if (nbytes) { rc = sendfile(sock->socketdes, /* socket */ file->filedes, /* file descriptor to send */ - *offset, /* where in the file to start */ + off, /* where in the file to start */ nbytes, /* number of bytes to send from file */ hdtrarray, /* Headers/footers */ flags); /* undefined, set to 0 */ @@ -838,6 +874,12 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, * 111298-01, 108529-09, 109473-06, 109235-04, 108996-02, 111296-01, 109026-04, * 108992-13 */ + +#if APR_HAS_LARGE_FILES && defined(HAVE_SENDFILEV64) +#define sendfilevec_t sendfilevec64_t +#define sendfilev sendfilev64 +#endif + apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags) @@ -865,7 +907,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, for (i = 0; i < hdtr->numheaders; i++, curvec++) { sfv[curvec].sfv_fd = SFV_FD_SELF; sfv[curvec].sfv_flag = 0; - sfv[curvec].sfv_off = (off_t)hdtr->headers[i].iov_base; + sfv[curvec].sfv_off = (apr_off_t)hdtr->headers[i].iov_base; sfv[curvec].sfv_len = hdtr->headers[i].iov_len; requested_len += sfv[curvec].sfv_len; } @@ -889,7 +931,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, for (i = 0; i < hdtr->numtrailers; i++, curvec++) { sfv[curvec].sfv_fd = SFV_FD_SELF; sfv[curvec].sfv_flag = 0; - sfv[curvec].sfv_off = (off_t)hdtr->trailers[i].iov_base; + sfv[curvec].sfv_off = (apr_off_t)hdtr->trailers[i].iov_base; sfv[curvec].sfv_len = hdtr->trailers[i].iov_len; requested_len += sfv[curvec].sfv_len; } diff --git a/test/.cvsignore b/test/.cvsignore index 2bb5c1d6600..d5249423983 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -42,4 +42,4 @@ testlockperf testmutexscope testshmconsumer testshmproducer - +lfstests diff --git a/test/Makefile.in b/test/Makefile.in index 7465cf5f061..92996fa1454 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -102,7 +102,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ testenv.lo testprocmutex.lo testrand2.lo testfnmatch.lo \ testatomic.lo testflock.lo testshm.lo testsock.lo testglobalmutex.lo \ - teststrnatcmp.lo testfilecopy.lo testtemp.lo + teststrnatcmp.lo testfilecopy.lo testtemp.lo testlfs.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ \ diff --git a/test/test_apr.h b/test/test_apr.h index cc46f7f424f..00fd9829fef 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -52,6 +52,7 @@ CuSuite *testglobalmutex(void); CuSuite *testhash(void); CuSuite *testipsub(void); CuSuite *testlock(void); +CuSuite *testlfs(void); CuSuite *testmmap(void); CuSuite *testnames(void); CuSuite *testoc(void); diff --git a/test/testall.c b/test/testall.c index 7e0a4f9f033..ad5d23b94d7 100644 --- a/test/testall.c +++ b/test/testall.c @@ -54,6 +54,7 @@ static const struct testlist { {"testglobalmutex", testglobalmutex}, {"testhash", testhash}, {"testipsub", testipsub}, + {"testlfs", testlfs}, {"testlock", testlock}, {"testmmap", testmmap}, {"testnames", testnames}, diff --git a/test/testlfs.c b/test/testlfs.c new file mode 100644 index 00000000000..b1297fc6a55 --- /dev/null +++ b/test/testlfs.c @@ -0,0 +1,278 @@ +/* Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_file_io.h" +#include "apr_file_info.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_poll.h" +#include "apr_strings.h" +#include "apr_lib.h" +#include "apr_mmap.h" +#include "test_apr.h" + +/* Only enable these tests by default on platforms which support sparse + * files... just Unixes? */ +#if APR_HAS_LARGE_FILES && !defined(WIN32) && !defined(OS2) && !defined(NETWARE) +#define USE_LFS_TESTS + +/* Tests which create an 8Gb sparse file and then check it can be used + * as normal. */ + +static apr_off_t eightGb = APR_INT64_C(2) << 32; + +static int madefile = 0; + +#define PRECOND if (!madefile) CuNotImpl(tc, NULL) + +#define TESTDIR "lfstests" +#define TESTFILE "large.bin" +#define TESTFN "lfstests/large.bin" + +static void test_open(CuTest *tc) +{ + apr_file_t *f; + apr_status_t rv; + + rv = apr_dir_make(TESTDIR, APR_OS_DEFAULT, p); + if (rv && !APR_STATUS_IS_EEXIST(rv)) { + apr_assert_success(tc, "make test directory", rv); + } + + apr_assert_success(tc, "open file", + apr_file_open(&f, TESTFN, + APR_CREATE | APR_WRITE | APR_TRUNCATE, + APR_OS_DEFAULT, p)); + + rv = apr_file_trunc(f, eightGb); + + apr_assert_success(tc, "close large file", apr_file_close(f)); + + /* 8Gb may pass rlimits or filesystem limits */ + +#ifdef EFBIG + if (rv == EFBIG) { + CuNotImpl(tc, "Creation of large file (limited by rlimit or fs?)"); + } else +#endif + { + apr_assert_success(tc, "truncate file to 8gb", rv); + } + + madefile = 1; +} + +static void test_reopen(CuTest *tc) +{ + apr_file_t *fh; + apr_finfo_t finfo; + + PRECOND; + + apr_assert_success(tc, "re-open 8Gb file", + apr_file_open(&fh, TESTFN, APR_READ, APR_OS_DEFAULT, p)); + + apr_assert_success(tc, "file_info_get failed", + apr_file_info_get(&finfo, APR_FINFO_NORM, fh)); + + CuAssert(tc, "file_info_get gave incorrect size", + finfo.size == eightGb); + + apr_assert_success(tc, "re-close large file", apr_file_close(fh)); +} + +static void test_stat(CuTest *tc) +{ + apr_finfo_t finfo; + + PRECOND; + + apr_assert_success(tc, "stat large file", + apr_stat(&finfo, TESTFN, APR_FINFO_NORM, p)); + + CuAssert(tc, "stat gave incorrect size", finfo.size == eightGb); +} + +static void test_readdir(CuTest *tc) +{ + apr_dir_t *dh; + apr_status_t rv; + + PRECOND; + + apr_assert_success(tc, "open test directory", + apr_dir_open(&dh, TESTDIR, p)); + + do { + apr_finfo_t finfo; + + rv = apr_dir_read(&finfo, APR_FINFO_NORM, dh); + + if (rv == APR_SUCCESS && strcmp(finfo.name, TESTFILE) == 0) { + CuAssert(tc, "apr_dir_read gave incorrect size for large file", + finfo.size == eightGb); + } + + } while (rv == APR_SUCCESS); + + if (!APR_STATUS_IS_ENOENT(rv)) { + apr_assert_success(tc, "apr_dir_read failed", rv); + } + + apr_assert_success(tc, "close test directory", + apr_dir_close(dh)); +} + +#define TESTSTR "Hello, world." + +static void test_append(CuTest *tc) +{ + apr_file_t *fh; + apr_finfo_t finfo; + + PRECOND; + + apr_assert_success(tc, "open 8Gb file for append", + apr_file_open(&fh, TESTFN, APR_WRITE | APR_APPEND, + APR_OS_DEFAULT, p)); + + apr_assert_success(tc, "append to 8Gb file", + apr_file_write_full(fh, TESTSTR, strlen(TESTSTR), NULL)); + + apr_assert_success(tc, "file_info_get failed", + apr_file_info_get(&finfo, APR_FINFO_NORM, fh)); + + CuAssert(tc, "file_info_get gave incorrect size", + finfo.size == eightGb + strlen(TESTSTR)); + + apr_assert_success(tc, "close 8Gb file", apr_file_close(fh)); +} + +static void test_seek(CuTest *tc) +{ + apr_file_t *fh; + apr_off_t pos; + + PRECOND; + + apr_assert_success(tc, "open 8Gb file for writing", + apr_file_open(&fh, TESTFN, APR_WRITE, + APR_OS_DEFAULT, p)); + + pos = eightGb; + apr_assert_success(tc, "seek to 8Gb", apr_file_seek(fh, APR_SET, &pos)); + CuAssert(tc, "seek gave 8Gb offset", pos == eightGb); + + pos = 0; + apr_assert_success(tc, "relative seek to 0", apr_file_seek(fh, APR_CUR, &pos)); + CuAssert(tc, "relative seek gave 8Gb offset", pos == eightGb); + + apr_file_close(fh); +} + +static void test_write(CuTest *tc) +{ + apr_file_t *fh; + apr_off_t pos = eightGb - 4; + + PRECOND; + + apr_assert_success(tc, "re-open 8Gb file", + apr_file_open(&fh, TESTFN, APR_WRITE, APR_OS_DEFAULT, p)); + + apr_assert_success(tc, "seek to 8Gb - 4", + apr_file_seek(fh, APR_SET, &pos)); + CuAssert(tc, "seek gave 8Gb-4 offset", pos == eightGb - 4); + + apr_assert_success(tc, "write magic string to 8Gb-4", + apr_file_write_full(fh, "FISH", 4, NULL)); + + apr_assert_success(tc, "close 8Gb file", apr_file_close(fh)); +} + + +#if APR_HAS_MMAP +static void test_mmap(CuTest *tc) +{ + apr_mmap_t *map; + apr_file_t *fh; + apr_size_t len = 16384; /* hopefully a multiple of the page size */ + apr_off_t off = eightGb - len; + void *ptr; + + PRECOND; + + apr_assert_success(tc, "open 8gb file for mmap", + apr_file_open(&fh, TESTFN, APR_READ, APR_OS_DEFAULT, p)); + + apr_assert_success(tc, "mmap 8Gb file", + apr_mmap_create(&map, fh, off, len, APR_MMAP_READ, p)); + + apr_assert_success(tc, "close file", apr_file_close(fh)); + + CuAssert(tc, "mapped a 16K block", map->size == len); + + apr_assert_success(tc, "get pointer into mmaped region", + apr_mmap_offset(&ptr, map, len - 4)); + CuAssert(tc, "pointer was not NULL", ptr != NULL); + + CuAssert(tc, "found the magic string", memcmp(ptr, "FISH", 4) == 0); + + apr_assert_success(tc, "delete mmap handle", apr_mmap_delete(map)); +} +#endif /* APR_HAS_MMAP */ + +static void test_format(CuTest *tc) +{ + apr_off_t off; + + PRECOND; + + off = apr_atoi64(apr_off_t_toa(p, eightGb)); + + CuAssert(tc, "apr_atoi64 parsed apr_off_t_toa result incorrectly", + off == eightGb); +} + +#else +static void test_nolfs(CuTest *tc) +{ + CuNotImpl(tc, "Large Files not supported"); +} +#endif + +CuSuite *testlfs(void) +{ + CuSuite *suite = CuSuiteNew("Large File Support"); + +#ifdef USE_LFS_TESTS + SUITE_ADD_TEST(suite, test_open); + SUITE_ADD_TEST(suite, test_reopen); + SUITE_ADD_TEST(suite, test_stat); + SUITE_ADD_TEST(suite, test_readdir); + SUITE_ADD_TEST(suite, test_append); + SUITE_ADD_TEST(suite, test_seek); + SUITE_ADD_TEST(suite, test_write); +#if APR_HAS_MMAP + SUITE_ADD_TEST(suite, test_mmap); +#endif + SUITE_ADD_TEST(suite, test_format); +#else + SUITE_ADD_TEST(suite, test_nolfs) +#endif + + return suite; +} + From 5016fbe21c2f4e20e3520a6c17d0fbe2f2711451 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 27 Mar 2004 16:15:02 +0000 Subject: [PATCH 4928/7878] * test/testlfs.c: Fix tests for !APR_HAS_LARGE_FILES. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65028 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testlfs.c b/test/testlfs.c index b1297fc6a55..828b631a28d 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -35,7 +35,7 @@ static apr_off_t eightGb = APR_INT64_C(2) << 32; static int madefile = 0; -#define PRECOND if (!madefile) CuNotImpl(tc, NULL) +#define PRECOND if (!madefile) CuNotImpl(tc, "Large file tests not enabled") #define TESTDIR "lfstests" #define TESTFILE "large.bin" @@ -270,7 +270,7 @@ CuSuite *testlfs(void) #endif SUITE_ADD_TEST(suite, test_format); #else - SUITE_ADD_TEST(suite, test_nolfs) + SUITE_ADD_TEST(suite, test_nolfs); #endif return suite; From 5f91697c3e9cfe68e76139a837f25a5219bfd7bd Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 29 Mar 2004 17:53:28 +0000 Subject: [PATCH 4929/7878] Remove the stat caching from the default NetWare build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65029 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 3ef3b734422..ef393275b11 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -27,7 +27,7 @@ #include #endif -/*#define APR_HAS_PSA*/ +#define APR_HAS_PSA static apr_filetype_e filetype_from_mode(mode_t mode) { From 32eb09a38ed94ddef48f9ef2eb0e04c223a9c4d3 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 30 Mar 2004 10:18:43 +0000 Subject: [PATCH 4930/7878] * test/testlfs.c (test_open): Skip rather than fail if apr_file_trunc gives EINVAL when passed the 8gb offset. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65031 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlfs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/testlfs.c b/test/testlfs.c index 828b631a28d..8d39c9880e7 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -62,12 +62,14 @@ static void test_open(CuTest *tc) /* 8Gb may pass rlimits or filesystem limits */ + if (APR_STATUS_IS_EINVAL(rv) #ifdef EFBIG - if (rv == EFBIG) { - CuNotImpl(tc, "Creation of large file (limited by rlimit or fs?)"); - } else + || rv == EFBIG #endif - { + ) { + CuNotImpl(tc, "Creation of large file (limited by rlimit or fs?)"); + } + else { apr_assert_success(tc, "truncate file to 8gb", rv); } From b90c885176ee16da9ba0a5c50bd9eec541608182 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 30 Mar 2004 11:53:35 +0000 Subject: [PATCH 4931/7878] * include/apr_file_io.h: Add APR_LARGEFILE flag, with warning. * file_io/unix/open.c (apr_file_open): Map APR_LARGEFILE onto O_LARGEFILE for non-LFS builds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65032 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 4 ++++ include/apr_file_io.h | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index ee91962141d..eab278f641d 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -101,6 +101,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, #if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE) oflags |= O_LARGEFILE; +#elif defined(O_LARGEFILE) + if (flag & APR_LARGEFILE) { + oflags |= O_LARGEFILE; + } #endif #if APR_HAS_THREADS diff --git a/include/apr_file_io.h b/include/apr_file_io.h index dd5acb72b82..86692ca7f71 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -69,6 +69,20 @@ extern "C" { is opened */ #define APR_SENDFILE_ENABLED 0x01000 /**< Advisory flag that this file should support apr_socket_sendfile operation */ +#define APR_LARGEFILE 0x04000 /**< Platform dependent flag to enable large file + support; WARNING see below. */ + +/** @warning The APR_LARGEFILE flag only has effect on some platforms + * where sizeof(apr_off_t) == 4. Where implemented, it allows opening + * and writing to a file which exceeds the size which can be + * represented by apr_off_t (2 gigabytes). When a file's size does + * exceed 2Gb, apr_file_info_get() will fail with an error on the + * descriptor, likewise apr_stat()/apr_lstat() will fail on the + * filename. apr_dir_read() will fail with APR_INCOMPLETE on a + * directory entry for a large file depending on the particular + * APR_FINFO_* flags. Generally, it is not recommended to use this + * flag. */ + /** @} */ /** From b04ef9e5eddcced5fa62519efd22c0a91d7a3c0a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 31 Mar 2004 12:51:28 +0000 Subject: [PATCH 4932/7878] * configure.in: Clarify comment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65033 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 37dd08e339c..547fa871747 100644 --- a/configure.in +++ b/configure.in @@ -1207,7 +1207,7 @@ if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then elif test "${ac_cv_sizeof_off_t}x${ac_cv_sizeof_long}" = "4x4"; then # Special case: off_t may change size with _FILE_OFFSET_BITS # on 32-bit systems with LFS support. To avoid compatibility - # with other software which may export _FILE_OFFSET_BITS, + # issues when other packages do define _FILE_OFFSET_BITS, # hard-code apr_off_t to long. off_t_value=long off_t_fmt='#define APR_OFF_T_FMT "ld"' From 6cfd38121848c52121026990b2785fe1d3a1522a Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 3 Apr 2004 17:15:52 +0000 Subject: [PATCH 4933/7878] Even if we do not check the value of APR_IPV6_V6ONLY before setting, we still must set the option cache if we're setting APR_IPV6_V6ONLY. Otherwise, later apr_socket_opt_get calls will fail. This fixes Listen directives on IPv6 machines where IPV6_V6ONLY may be enabled (i.e. FreeBSD 5.x, OpenBSD, NetBSD) where it would not properly bind to the IPv4 socket. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65034 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ network_io/unix/sockopt.c | 3 ++- network_io/win32/sockopt.c | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index f4c88907849..cd0be67dc3f 100644 --- a/CHANGES +++ b/CHANGES @@ -120,6 +120,10 @@ Changes with APR 1.0 Changes with APR 0.9.5 + *) Fix apr_socket_opt_set with APR_IPV6_V6ONLY flag. Fixes httpd + Listen IPv6 socket behavior on FreeBSD 5.x, OpenBSD, NetBSD. + [Justin Erenkrantz] + *) Fix apr_time_exp_get() for dates in 2038. [Philip Martin ] diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 822e5d7d64f..a6c80a9a59e 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -283,13 +283,14 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, case APR_IPV6_V6ONLY: #if APR_HAVE_IPV6 && defined(IPV6_V6ONLY) /* we don't know the initial setting of this option, - * so don't check/set sock->options since that optimization + * so don't check sock->options since that optimization * won't work */ if (setsockopt(sock->socketdes, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&on, sizeof(int)) == -1) { return errno; } + apr_set_option(sock, APR_IPV6_V6ONLY, on); #else return APR_ENOTIMPL; #endif diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 86339da7962..05f32b81ea0 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -169,13 +169,14 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, case APR_IPV6_V6ONLY: #if APR_HAVE_IPV6 && defined(IPV6_V6ONLY) /* we don't know the initial setting of this option, - * so don't check/set sock->options since that optimization + * so don't check sock->options since that optimization * won't work */ if (setsockopt(sock->socketdes, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&on, sizeof(int)) == -1) { return apr_get_netos_error(); } + apr_set_option(sock, APR_IPV6_V6ONLY, on); #else return APR_ENOTIMPL; #endif From 26511798265fe4ab5537bc89b94f716958937a60 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 4 Apr 2004 11:50:17 +0000 Subject: [PATCH 4934/7878] * string/apr_snprintf.c (conv_10_quad): Fix formatting of integers smaller than LONG_MIN. * test/testfmt.c (more_int64_fmts): Add regression test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65037 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 3 ++- test/testfmt.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index b000eb8d12b..73856a257d8 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -393,7 +393,8 @@ static char *conv_10_quad(widest_int num, register bool_int is_unsigned, * number against the largest long value it can be. If <=, we * punt to the quicker version. */ - if ((num <= ULONG_MAX && is_unsigned) || (num <= LONG_MAX && !is_unsigned)) + if ((num <= ULONG_MAX && is_unsigned) + || (num <= LONG_MAX && num >= LONG_MIN && !is_unsigned)) return(conv_10( (wide_int)num, is_unsigned, is_negative, buf_end, len)); diff --git a/test/testfmt.c b/test/testfmt.c index f01858d6963..20af8b9d00f 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -99,6 +99,7 @@ static void more_int64_fmts(CuTest *tc) { char buf[100]; apr_int64_t i = APR_INT64_C(-42); + apr_int64_t ibig = APR_INT64_C(-314159265358979323); apr_uint64_t ui = APR_UINT64_C(42); apr_uint64_t big = APR_UINT64_C(3141592653589793238); @@ -110,6 +111,9 @@ static void more_int64_fmts(CuTest *tc) apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, big); CuAssertStrEquals(tc, buf, "3141592653589793238"); + + apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, ibig); + CuAssertStrEquals(tc, buf, "-314159265358979323"); } CuSuite *testfmt(void) From 61e94620f38d798072ad2e9e814a25f3b24a81c1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 4 Apr 2004 12:07:46 +0000 Subject: [PATCH 4935/7878] * test/Makefile.in: Use $(LTFLAGS) when invoking libtool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65038 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 92996fa1454..4585bd51343 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -53,10 +53,10 @@ occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS) sockchild@EXEEXT@: sockchild.lo $(LOCAL_LIBS) $(LINK_PROG) sockchild.lo $(LOCAL_LIBS) $(ALL_LIBS) - + readchild@EXEEXT@: readchild.lo $(LOCAL_LIBS) $(LINK_PROG) readchild.lo $(LOCAL_LIBS) $(ALL_LIBS) - + globalmutexchild@EXEEXT@: globalmutexchild.lo $(LOCAL_LIBS) $(LINK_PROG) globalmutexchild.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -68,13 +68,13 @@ proc_child@EXEEXT@: proc_child.lo $(LOCAL_LIBS) # FIXME: -prefer-pic is only supported with libtool-1.4+ mod_test.slo: $(srcdir)/mod_test.c - $(LIBTOOL) --mode=compile $(COMPILE) -prefer-pic -c $(srcdir)/mod_test.c && touch $@ + $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -prefer-pic -c $(srcdir)/mod_test.c && touch $@ mod_test.la: mod_test.slo $(LOCAL_LIBS) - $(LIBTOOL) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ + $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ libmod_test.la: mod_test.slo $(LOCAL_LIBS) - $(LIBTOOL) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ + $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS) $(LINK_PROG) testlockperf.lo $(LOCAL_LIBS) $(ALL_LIBS) From 1152e4137a2c4c46e6bc3b88867f4326cb86b3cd Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 4 Apr 2004 14:54:17 +0000 Subject: [PATCH 4936/7878] * strings/apr_strings.c (apr_strtoi64): Fix handling of negative integers on platforms without strtoll. * test/teststr.c (string_strtoi64): New function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65039 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strings.c | 4 +- test/teststr.c | 97 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 2 deletions(-) diff --git a/strings/apr_strings.c b/strings/apr_strings.c index ee1c1f1c3a6..a88f35e0922 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -278,7 +278,7 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) } /* The classic bsd implementation requires div/mod operators - * to compute a cutoff. Benchmarking proves that iss very, very + * to compute a cutoff. Benchmarking proves that is very, very * evil to some 32 bit processors. Instead, look for underflow * in both the mult and add/sub operation. Unlike the bsd impl, * we also work strictly in a signed int64 word as we haven't @@ -319,7 +319,7 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) val *= base; if ( (any < 0) /* already noted an over/under flow - short circuit */ || (neg && (val > acc || (val -= c) > acc)) /* underflow */ - || (val < acc || (val += c) < acc)) { /* overflow */ + || (!neg && (val < acc || (val += c) < acc))) { /* overflow */ any = -1; /* once noted, over/underflows never go away */ #ifdef APR_STRTOI64_OVERFLOW_IS_BAD_CHAR break; diff --git a/test/teststr.c b/test/teststr.c index 4e538478ded..ece2b4e9f12 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -150,6 +150,102 @@ static void string_long(CuTest *tc) apr_psprintf(p, "%s", s); } +/* ### FIXME: apr.h/apr_strings.h should provide these! */ +#define MY_LLONG_MAX (APR_INT64_C(9223372036854775807)) +#define MY_LLONG_MIN (-MY_LLONG_MAX - APR_INT64_C(1)) + +static void string_strtoi64(CuTest *tc) +{ + static const struct { + int errnum, base; + const char *in, *end; + apr_int64_t result; + } ts[] = { + + /* base 10 tests */ + { 0, 10, "123545", NULL, APR_INT64_C(123545) }, + { 0, 10, " 123545", NULL, APR_INT64_C(123545) }, + { 0, 10, " +123545", NULL, APR_INT64_C(123545) }, + { 0, 10, "-123545", NULL, APR_INT64_C(-123545) }, + { 0, 10, " 00000123545", NULL, APR_INT64_C(123545) }, + { 0, 10, "123545ZZZ", "ZZZ", APR_INT64_C(123545) }, + { 0, 10, " 123545 ", " ", APR_INT64_C(123545) }, + + /* base 16 tests */ + { 0, 16, "1E299", NULL, APR_INT64_C(123545) }, + { 0, 16, "1e299", NULL, APR_INT64_C(123545) }, + { 0, 16, "0x1e299", NULL, APR_INT64_C(123545) }, + { 0, 16, "0X1E299", NULL, APR_INT64_C(123545) }, + { 0, 16, "+1e299", NULL, APR_INT64_C(123545) }, + { 0, 16, "-1e299", NULL, APR_INT64_C(-123545) }, + { 0, 16, " -1e299", NULL, APR_INT64_C(-123545) }, + + /* automatic base detection tests */ + { 0, 0, "123545", NULL, APR_INT64_C(123545) }, + { 0, 0, "0x1e299", NULL, APR_INT64_C(123545) }, + { 0, 0, " 0x1e299", NULL, APR_INT64_C(123545) }, + { 0, 0, "+0x1e299", NULL, APR_INT64_C(123545) }, + { 0, 0, "-0x1e299", NULL, APR_INT64_C(-123545) }, + + /* large number tests */ + { 0, 10, "8589934605", NULL, APR_INT64_C(8589934605) }, + { 0, 10, "-8589934605", NULL, APR_INT64_C(-8589934605) }, + { 0, 16, "0x20000000D", NULL, APR_INT64_C(8589934605) }, + { 0, 16, "-0x20000000D", NULL, APR_INT64_C(-8589934605) }, + { 0, 16, " 0x20000000D", NULL, APR_INT64_C(8589934605) }, + { 0, 16, " 0x20000000D", NULL, APR_INT64_C(8589934605) }, + + /* error cases */ + { ERANGE, 10, "999999999999999999999999999999999", "", MY_LLONG_MAX }, + { ERANGE, 10, "-999999999999999999999999999999999", "", MY_LLONG_MIN }, + +#if 0 + /* C99 doesn't require EINVAL for an invalid range. */ + { EINVAL, 99, "", (void *)-1 /* don't care */, 0 }, +#endif + + /* some strtoll implementations give EINVAL when no conversion + * is performed. */ + { -1 /* don't care */, 10, "zzz", "zzz", APR_INT64_C(0) }, + { -1 /* don't care */, 10, "", NULL, APR_INT64_C(0) } + + }; + int n; + + for (n = 0; n < sizeof(ts)/sizeof(ts[0]); n++) { + char *end = "end ptr not changed"; + apr_int64_t result; + int errnum; + + errno = 0; + result = apr_strtoi64(ts[n].in, &end, ts[n].base); + errnum = errno; + + CuAssert(tc, + apr_psprintf(p, "for '%s': result was %" APR_INT64_T_FMT + " not %" APR_INT64_T_FMT, ts[n].in, + result, ts[n].result), + result == ts[n].result); + + if (ts[n].errnum != -1) { + CuAssert(tc, + apr_psprintf(p, "for '%s': errno was %d not %d", ts[n].in, + errnum, ts[n].errnum), + ts[n].errnum == errnum); + } + + if (ts[n].end == NULL) { + /* end must point to NUL terminator of .in */ + CuAssertPtrEquals(tc, ts[n].in + strlen(ts[n].in), end); + } else if (ts[n].end != (void *)-1) { + CuAssert(tc, + apr_psprintf(p, "for '%s', end was '%s' not '%s'", + ts[n].in, end, ts[n].end), + strcmp(ts[n].end, end) == 0); + } + } +} + CuSuite *teststr(void) { CuSuite *suite = CuSuiteNew("Strings"); @@ -160,6 +256,7 @@ CuSuite *teststr(void) SUITE_ADD_TEST(suite, test_strtok); SUITE_ADD_TEST(suite, string_error); SUITE_ADD_TEST(suite, string_long); + SUITE_ADD_TEST(suite, string_strtoi64); return suite; } From 045c890dda4e000d4d6752c66834ad1e9064163e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 4 Apr 2004 15:42:29 +0000 Subject: [PATCH 4937/7878] Synch with 0.9 branch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65041 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index cd0be67dc3f..3daa58a4090 100644 --- a/CHANGES +++ b/CHANGES @@ -120,6 +120,12 @@ Changes with APR 1.0 Changes with APR 0.9.5 + *) Fix handling of negative numbers in apr_strtoi64() on platforms + without strtoll. [Joe Orton] + + *) Fix printing apr_int64_t values smaller than LONG_MIN on 32-bit + platforms in apr_vformatter. [Joe Orton] + *) Fix apr_socket_opt_set with APR_IPV6_V6ONLY flag. Fixes httpd Listen IPv6 socket behavior on FreeBSD 5.x, OpenBSD, NetBSD. [Justin Erenkrantz] @@ -127,6 +133,10 @@ Changes with APR 0.9.5 *) Fix apr_time_exp_get() for dates in 2038. [Philip Martin ] + *) Add APR_LARGEFILE flag to allow opening files with the + O_LARGEFILE flag; not recommended for general use, see + include/apr_file_io.h. [Joe Orton] + *) Various build fixes: thread_rwlock.c on some Solaris platforms (PR 22990); filestat.c on ReliantUnix (PR 22990); config.status on IRIX (PR 19251). [Various] From f7b65a3909964ed9c429c27422aa0701433e00f2 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 5 Apr 2004 14:39:40 +0000 Subject: [PATCH 4938/7878] * test/testlfs.c (test_seek): Test APR_END-relative seek; move test before testappend. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65042 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlfs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/testlfs.c b/test/testlfs.c index 8d39c9880e7..ab73629ce39 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -173,6 +173,11 @@ static void test_seek(CuTest *tc) apr_file_open(&fh, TESTFN, APR_WRITE, APR_OS_DEFAULT, p)); + pos = 0; + apr_assert_success(tc, "relative seek to end", + apr_file_seek(fh, APR_END, &pos)); + CuAssert(tc, "seek to END gave 8Gb", pos == eightGb); + pos = eightGb; apr_assert_success(tc, "seek to 8Gb", apr_file_seek(fh, APR_SET, &pos)); CuAssert(tc, "seek gave 8Gb offset", pos == eightGb); @@ -264,8 +269,8 @@ CuSuite *testlfs(void) SUITE_ADD_TEST(suite, test_reopen); SUITE_ADD_TEST(suite, test_stat); SUITE_ADD_TEST(suite, test_readdir); - SUITE_ADD_TEST(suite, test_append); SUITE_ADD_TEST(suite, test_seek); + SUITE_ADD_TEST(suite, test_append); SUITE_ADD_TEST(suite, test_write); #if APR_HAS_MMAP SUITE_ADD_TEST(suite, test_mmap); From e4564d7d1bce965b167b2ea06a3936714f3f2ab6 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 5 Apr 2004 23:37:56 +0000 Subject: [PATCH 4939/7878] NetWare make files git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65043 13f79535-47bb-0310-9956-ffa450edef68 --- test/nwgnusockchild | 255 ++++++++++++++++++++++++++++++++++++++++++++ test/nwgnutryread | 255 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 510 insertions(+) create mode 100644 test/nwgnusockchild create mode 100644 test/nwgnutryread diff --git a/test/nwgnusockchild b/test/nwgnusockchild new file mode 100644 index 00000000000..f49cfc5e572 --- /dev/null +++ b/test/nwgnusockchild @@ -0,0 +1,255 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(APR_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR_WORK)/include \ + $(APR_WORK)/include/arch/NetWare \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) + +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) + + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = sockchild + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = socket NLM to test sockets + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = sockchild + +# +# This is used by the '-screenname' directive. If left blank, +# 'Apache for NetWare' Thread will be used. +# +NLM_SCREEN_NAME = DEFAULT + +# +# If this is specified, it will override VERSION value in +# $(APR_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = 1,0,0 + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If this is specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can +# be disabled by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# Declare all target files (you must add your files here) +# + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/sockchild.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/sockchild.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + Libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override the default copyright. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + diff --git a/test/nwgnutryread b/test/nwgnutryread new file mode 100644 index 00000000000..40ceb595bf8 --- /dev/null +++ b/test/nwgnutryread @@ -0,0 +1,255 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(APR_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR_WORK)/include \ + $(APR_WORK)/include/arch/NetWare \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) + +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) + + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = tryread + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = reader NLM to test flock + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = try_read + +# +# This is used by the '-screenname' directive. If left blank, +# 'Apache for NetWare' Thread will be used. +# +NLM_SCREEN_NAME = DEFAULT + +# +# If this is specified, it will override VERSION value in +# $(APR_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = 1,0,0 + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If this is specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can +# be disabled by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# Declare all target files (you must add your files here) +# + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/tryread.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/tryread.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + Libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override the default copyright. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + From 9bb72d6f6e6696e0546cb87f7c9b9f11250eb60b Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 5 Apr 2004 23:39:11 +0000 Subject: [PATCH 4940/7878] Added sockchild and tryread to the NetWare test build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65044 13f79535-47bb-0310-9956-ffa450edef68 --- test/NWGNUmakefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/NWGNUmakefile b/test/NWGNUmakefile index c63714a57bf..ac658934e8f 100644 --- a/test/NWGNUmakefile +++ b/test/NWGNUmakefile @@ -168,6 +168,8 @@ TARGET_nlm = \ $(OBJDIR)/aprtest.nlm \ $(OBJDIR)/mod_test.nlm \ $(OBJDIR)/proc_child.nlm \ + $(OBJDIR)/sockchild.nlm \ + $(OBJDIR)/tryread.nlm \ $(OBJDIR)/testatmc.nlm \ $(EOLIST) # From 0c96442e8ff059e8dd627db0b3441bb0b23ef1c9 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 5 Apr 2004 23:40:15 +0000 Subject: [PATCH 4941/7878] Added the new tests to the NetWare test build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65045 13f79535-47bb-0310-9956-ffa450edef68 --- test/nwgnuaprtest | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/nwgnuaprtest b/test/nwgnuaprtest index aa20a144735..ad24d83dd07 100644 --- a/test/nwgnuaprtest +++ b/test/nwgnuaprtest @@ -117,7 +117,7 @@ NLM_VERSION = 1,0,0 # # If this is specified, it will override the default of 64K # -NLM_STACK_SIZE = 524288 +NLM_STACK_SIZE = 524288 # # If this is specified it will be used by the link '-entry' directive @@ -171,16 +171,21 @@ FILES_nlm_objs = \ $(OBJDIR)/cutest.o \ $(OBJDIR)/testall.o \ $(OBJDIR)/testargs.o \ + $(OBJDIR)/testatomic.o \ $(OBJDIR)/testdir.o \ $(OBJDIR)/testdup.o \ $(OBJDIR)/testdso.o \ $(OBJDIR)/testenv.o \ + $(OBJDIR)/testfilecopy.o \ $(OBJDIR)/testfileinfo.o \ $(OBJDIR)/testfile.o \ + $(OBJDIR)/testflock.o \ $(OBJDIR)/testfmt.o \ $(OBJDIR)/testfnmatch.o \ + $(OBJDIR)/testglobalmutex.o \ $(OBJDIR)/testhash.o \ $(OBJDIR)/testipsub.o \ + $(OBJDIR)/testlfs.o \ $(OBJDIR)/testlock.o \ $(OBJDIR)/testmmap.o \ $(OBJDIR)/testnames.o \ @@ -191,10 +196,15 @@ FILES_nlm_objs = \ $(OBJDIR)/testproc.o \ $(OBJDIR)/testprocmutex.o \ $(OBJDIR)/testrand.o \ + $(OBJDIR)/testrand2.o \ + $(OBJDIR)/testshm.o \ $(OBJDIR)/testsleep.o \ + $(OBJDIR)/testsock.o \ $(OBJDIR)/testsockets.o \ $(OBJDIR)/testsockopt.o \ $(OBJDIR)/teststr.o \ + $(OBJDIR)/teststrnatcmp.o \ + $(OBJDIR)/testtemp.o \ $(OBJDIR)/testthread.o \ $(OBJDIR)/testtime.o \ $(OBJDIR)/testtable.o \ @@ -203,7 +213,7 @@ FILES_nlm_objs = \ $(OBJDIR)/testvsn.o \ $(OBJDIR)/nw_misc.o \ $(OBJDIR)/testpipe.o \ - $(EOLIST) + $(EOLIST) # Pending tests From 31efbeb97dd4b68a25bd7f13700995e20ee4eefe Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 6 Apr 2004 22:47:46 +0000 Subject: [PATCH 4942/7878] Allow the NetWare makefiles to clean up some files that were missed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65046 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 + build/NWGNUhead.inc | 1 + 2 files changed, 2 insertions(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index 681019e8541..7d90af0cc5c 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -326,6 +326,7 @@ ifndef DEST @echo rem copying the docs directories > xc.bat @echo xcopy docs $(INSTALLBASE)\docs\*.* /E /Y >> xc.bat $(CMD) xc.bat + $(DEL) xc.bat endif $(INSTDIRS) :: diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc index 444b2f36436..c96b7aad74f 100644 --- a/build/NWGNUhead.inc +++ b/build/NWGNUhead.inc @@ -86,6 +86,7 @@ clean :: $(SUBDIRS) $(CHK) *.map $(DEL) *.map $(CHK) *.d $(DEL) *.d $(CHK) *.tmp $(DEL) *.tmp + $(CHK) xc.bat $(DEL) xc.bat -$(DELTREE) $(OBJDIR) 2> NUL $(OBJDIR) :: From bb51c8599b6f88c6e0c9cff162fe62361ff44404 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 8 Apr 2004 22:39:29 +0000 Subject: [PATCH 4943/7878] Create a separate compiler options file per NLM or library git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65048 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 92 ++++++++++++++++++++++----------------------- build/NWGNUmakefile | 8 ++-- build/NWGNUtail.inc | 8 ++-- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 7d90af0cc5c..0eb66630864 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -347,97 +347,97 @@ endif # Any specialized rules here # -$(OBJDIR)/%.o: atomic/netware/%.c $(OBJDIR)\cc.opt +$(OBJDIR)/%.o: atomic/netware/%.c $(OBJDIR)\$(NLM_NAME)_cc.opt @echo Compiling $< - $(CC) atomic\netware\$($(APR)/aprlib.imp -nw_export.i : nw_export.inc $(FILES_prebuild_headers) cc.opt +nw_export.i : nw_export.inc $(FILES_prebuild_headers) $(NLM_NAME)_cc.opt @echo Generating $(subst /,\,$@) - $(CC) $< @cc.opt + $(CC) $< @$(NLM_NAME)_cc.opt -cc.opt : NWGNUmakefile $(APR_WORK)\build\NWGNUenvironment.inc $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUtail.inc $(CUSTOM_INI) +$(NLM_NAME)_cc.opt : NWGNUmakefile $(APR_WORK)\build\NWGNUenvironment.inc $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUtail.inc $(CUSTOM_INI) $(CHK) $@ $(DEL) $@ @echo -P >> $@ @echo -EP >> $@ @@ -78,7 +78,7 @@ install :: nlms FORCE clean :: $(CHK) nw_export.i $(DEL) nw_export.i - $(CHK) cc.opt $(DEL) cc.opt + $(CHK) $(NLM_NAME)_cc.opt $(DEL) $(NLM_NAME)_cc.opt $(CHK) NWGNUversion.inc $(DEL) NWGNUversion.inc $(CHK) $(subst /,\,$(APR))\include\apr.h $(DEL) $(subst /,\,$(APR))\include\apr.h $(CHK) $(subst /,\,$(APRUTIL))\include\apu.h $(DEL) $(subst /,\,$(APRUTIL))\include\apu.h diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 8842f466ed6..ad3cd4ac626 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -25,7 +25,7 @@ NLM_SCREEN_NAME = DEFAULT endif ifndef NLM_COPYRIGHT -NLM_COPYRIGHT = Copyright (c) 2000-2003 The Apache Software Foundation. All rights reserved. +NLM_COPYRIGHT = Copyright (c) 2000-2004 The Apache Software Foundation. All rights reserved. endif # @@ -97,11 +97,11 @@ VERSION_STR = 1.0.0 endif -$(OBJDIR)/%.o: %.c $(OBJDIR)\cc.opt +$(OBJDIR)/%.o: %.c $(OBJDIR)\$(NLM_NAME)_cc.opt @echo Compiling $< - $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\$(NLM_NAME)_cc.opt -$(OBJDIR)\cc.opt: $(CCOPT_DEPENDS) +$(OBJDIR)\$(NLM_NAME)_cc.opt: $(CCOPT_DEPENDS) @echo CCOPT_DEPENDS=$(CCOPT_DEPENDS) $(CHK) $@ $(DEL) $@ @echo Generating $@ From c7a3dfd5dcf173589340e3e08e7cfdbf86736d72 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 9 Apr 2004 01:36:32 +0000 Subject: [PATCH 4944/7878] Deprecated APR_ETIMEDOUT. Everything should be using APR_TIMESUP git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65049 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 +------ include/apr_errno.h | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/STATUS b/STATUS index 897a24a8524..3989bc893a8 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2004/03/18 18:19:07 $] +Last modified at [$Date: 2004/04/09 01:36:32 $] Release: @@ -25,11 +25,6 @@ RELEASE 0.9 SHOWSTOPPERS: RELEASE 1.0 SHOWSTOPPERS: - * Timeout status codes aren't consistant across platforms. Some use - APR_TIMEUP while others use APR_ETIMEDOUT. These need to be combined into - one code (APR_TIMEUP), and APR_ETIMEDOUT needs to be removed and - deprecated. - * apr_global_mutex_child_init and apr_proc_mutex_child_init aren't portable. There are a variety of problems with the locking API when it is used with apr_create_proc instead of apr_fork. First, _child_init diff --git a/include/apr_errno.h b/include/apr_errno.h index 094d1fbe098..8aeb223eee6 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -709,7 +709,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_ECONNRESET (APR_OS_START_CANONERR + 19) #endif -/** @see APR_STATUS_IS_ETIMEDOUT */ +/** @see APR_STATUS_IS_ETIMEDOUT + * @deprecated */ #ifdef ETIMEDOUT #define APR_ETIMEDOUT ETIMEDOUT #else @@ -884,7 +885,10 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + SOCECONNABORTED) #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + SOCECONNRESET) -#define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ +// XXX deprecated +#define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ + || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT) +#define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT) #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ || (s) == APR_OS_START_SYSERR + SOCEHOSTUNREACH) @@ -1019,7 +1023,11 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + ERROR_NETNAME_DELETED \ || (s) == APR_OS_START_SYSERR + WSAECONNRESET) -#define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ +// XXX deprecated +#define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ + || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ + || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) +#define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ @@ -1084,7 +1092,11 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + WSAECONNRESET) -#define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ +// XXX deprecated +#define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ + || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ + || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) +#define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ @@ -1189,8 +1201,9 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, /** Connection Reset by peer */ #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET) -/** Operation timed out */ -#define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT) +/** Operation timed out + * @deprecated */ +#define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT) /** no route to host */ #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH) /** network is unreachable */ From f4380f030f06bdc2d4845f98fedb60a4011d7e52 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 9 Apr 2004 02:03:12 +0000 Subject: [PATCH 4945/7878] Add testlfs to the Windows test build system git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65050 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.win b/test/Makefile.win index 19eb0d10cca..72580a019f3 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -87,7 +87,7 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj \ testatomic.obj testflock.obj testshm.obj testsock.obj \ testglobalmutex.obj teststrnatcmp.obj testfilecopy.obj \ - testtemp.obj + testtemp.obj testlfs.obj testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS) $(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ From 4db7ba8b6e42fb465d0bb7d0d02b6bcf9485deed Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 9 Apr 2004 02:03:48 +0000 Subject: [PATCH 4946/7878] #undef APR_STATUS_IS_TIMESUP on non-unix platforms before redefining it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65051 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/apr_errno.h b/include/apr_errno.h index 8aeb223eee6..cd2a2b4c902 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -888,6 +888,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, // XXX deprecated #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT) +#undef APR_STATUS_IS_TIMEUP #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT) #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ @@ -1027,6 +1028,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) +#undef APR_STATUS_IS_TIMEUP #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) @@ -1096,6 +1098,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) +#undef APR_STATUS_IS_TIMEUP #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) From 0a27de28fb2d1216859b2e7621cbb4a916b495dc Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 10 Apr 2004 21:30:55 +0000 Subject: [PATCH 4947/7878] sync with apr 0.9.5 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65053 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 3daa58a4090..37966717c15 100644 --- a/CHANGES +++ b/CHANGES @@ -20,10 +20,6 @@ Changes with APR 1.0 *) Switch to a single, top-level make. [Greg Stein] - *) Return an error instead of silently failing when apr_poll() is - used with file descriptors >= FD_SETSIZE. (Unix systems with - no native poll()) [Jeff Trawick, Brad Nicholes] - *) new error status APR_STATUS_IS_ENOTENOUGHENTROPY, Doxygen fixes [Sander Temme = FD_SETSIZE. (Unix systems with + no native poll()) [Jeff Trawick, Brad Nicholes] + *) Fix handling of negative numbers in apr_strtoi64() on platforms without strtoll. [Joe Orton] From 7e3750f6dcc9d065f2156680d32499a368790555 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 12 Apr 2004 20:52:46 +0000 Subject: [PATCH 4948/7878] Add a check to make sure that we handle multiple makefile per directory conditions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65055 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index ad3cd4ac626..b625704d5c8 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -97,6 +97,8 @@ VERSION_STR = 1.0.0 endif +ifeq "$(words $(strip $(TARGET_nlm)))" "1" + $(OBJDIR)/%.o: %.c $(OBJDIR)\$(NLM_NAME)_cc.opt @echo Compiling $< $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\$(NLM_NAME)_cc.opt @@ -150,6 +152,8 @@ ifneq "$(strip $(XDEFINES))" "" @echo $(XDEFINES) >> $@ endif +endif # one target nlm + # # Rules to build libraries # From 3e83cb58589d39afe3e9b6f413f0622116b268e7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 13 Apr 2004 08:52:52 +0000 Subject: [PATCH 4949/7878] Ready to blame bad datestamps on a bad tarball... we can only touch mak/dep file dates that correspond to a dsp file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65056 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl index fa2d1b4ebdb..9ee8918e90b 100644 --- a/build/fixwin32mak.pl +++ b/build/fixwin32mak.pl @@ -60,14 +60,14 @@ sub fixcwd { $dname =~ s/.mak$/.dsp/; @dstat = stat($dname); @ostat = stat($oname); - if ($ostat[9] != $dstat[9]) { + if ($ostat[9] && $dstat[9] && ($ostat[9] != $dstat[9])) { @onames = ($oname); utime $dstat[9], $dstat[9], @onames; print "Touched datestamp for " . $oname . " in " . $File::Find::dir . "\n"; } $oname =~ s/.mak$/.dep/; @ostat = stat($oname); - if ($ostat[9] != $dstat[9]) { + if ($ostat[9] && $dstat[9] && ($ostat[9] != $dstat[9])) { @onames = ($oname); utime $dstat[9], $dstat[9], @onames; print "Touched datestamp for " . $oname . " in " . $File::Find::dir . "\n"; From d4827e2875df2f6e551a85fa1f27702b7c208216 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 13 Apr 2004 20:25:12 +0000 Subject: [PATCH 4950/7878] Reverting the multiple makefile check git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65058 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index b625704d5c8..ad3cd4ac626 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -97,8 +97,6 @@ VERSION_STR = 1.0.0 endif -ifeq "$(words $(strip $(TARGET_nlm)))" "1" - $(OBJDIR)/%.o: %.c $(OBJDIR)\$(NLM_NAME)_cc.opt @echo Compiling $< $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\$(NLM_NAME)_cc.opt @@ -152,8 +150,6 @@ ifneq "$(strip $(XDEFINES))" "" @echo $(XDEFINES) >> $@ endif -endif # one target nlm - # # Rules to build libraries # From b2e434f7c87024c31a4982f2fb840ab78a82c469 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 16 Apr 2004 12:40:05 +0000 Subject: [PATCH 4951/7878] +DAportable is not valid for HP-UX native compiler on ia64 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65061 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 547fa871747..f9455e16925 100644 --- a/configure.in +++ b/configure.in @@ -330,10 +330,16 @@ fi case "$host:$CC" in *-hp-hpux*:cc ) APR_ADDTO(CFLAGS,[-Ae +Z]) - if echo "$CFLAGS " | grep '+DA' >/dev/null; then : - else - APR_ADDTO(CFLAGS,[+DAportable]) - fi + case $host in + ia64-* ) + ;; + * ) + if echo "$CFLAGS " | grep '+DA' >/dev/null; then : + else + APR_ADDTO(CFLAGS,[+DAportable]) + fi + ;; + esac ;; powerpc-*-beos:mwcc* ) APR_SETVAR(CPP,[mwcc -E]) From 280600466522ee7b34578c87f5ae4bcb3735ff33 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 16 Apr 2004 12:49:59 +0000 Subject: [PATCH 4952/7878] -mt is the threading option to use with HP-UX vendor compiler on ia64; check for that prior to -mthreads since it is a prefix of -mthreads prior to this, -mthreads would pass the test but the extra "hreads" would be treated as separate options, most/all of which were ignored with a warning (on every compile) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65062 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_threads.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index fe38290e628..1d2d2a849a5 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -110,7 +110,7 @@ AC_DEFUN(APR_PTHREADS_CHECK,[ AC_CACHE_CHECK([for CFLAGS needed for pthreads], [apr_cv_pthreads_cflags], [apr_ptc_cflags=$CFLAGS - for flag in none -kthread -pthread -pthreads -mthreads -Kthread -threads; do + for flag in none -kthread -pthread -pthreads -mt -mthreads -Kthread -threads; do CFLAGS=$apr_ptc_cflags test "x$flag" != "xnone" && CFLAGS="$CFLAGS $flag" APR_PTHREADS_TRY_RUN([ From a3238965d0d14f38846cda352adea932ad491d93 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 16 Apr 2004 13:54:19 +0000 Subject: [PATCH 4953/7878] Quiet build breakage on VC6 with the originally shipped includes (InterlockedCompareExchangePointer available in later SDK headers.) Few should be compiling on 64 bit cpu's under VC6 anymore, so ignore that edge case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65063 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/win32/apr_atomic.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index 5ca8145afcd..d83d60c89d8 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -22,11 +22,6 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) return APR_SUCCESS; } -APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) -{ - return InterlockedCompareExchangePointer(mem, with, cmp); -} - /* * Remapping function pointer type to accept apr_uint32_t's type-safely * as the arguments for as our apr_atomic_foo32 Functions @@ -39,12 +34,18 @@ typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_fn) typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_val_fn) (apr_uint32_t volatile *, apr_uint32_t, apr_uint32_t); +typedef WINBASEAPI void * (WINAPI * apr_atomic_win32_ptr_ptr_ptr_fn) + (volatile void **, + void *, const void *); APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { return ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val); } +/* Of course we want the 2's compliment of the unsigned value, val */ +#pragma warning(disable: 4146) + APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) { ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, -val); @@ -77,6 +78,16 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3 return ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem, with, cmp); } +APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ +#if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) + return InterlockedCompareExchangePointer(mem, with, cmp); +#else + /* Too many VC6 users have stale win32 API files, stub this */ + return ((apr_atomic_win32_ptr_ptr_ptr_fn)InterlockedCompareExchange)(mem, with, cmp); +#endif +} + APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) { return ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); From 9fdbfd7894a1085d37ed994dcfbc85a41ce1dc85 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 16 Apr 2004 16:32:25 +0000 Subject: [PATCH 4954/7878] Provide workaround for socklen_t declaration problem with 64-bit build on HP-UX. also, mention these prior commits which clean up 64-bit compiles on HP-UX ia64: Stop setting a PA-RISC-specific compile option on ia64. Look for -mt thread option, which is used with HP-UX vendor compiler on ia64. Alluded to before by: Madhusudan Mathihalli git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65064 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ configure.in | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/CHANGES b/CHANGES index 37966717c15..a281d01165d 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,12 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Provide workaround for socklen_t declaration problem with 64-bit + build on HP-UX. Stop setting a PA-RISC-specific compile option + on ia64. Look for -mt thread option, which is used with HP-UX + vendor compiler on ia64. [Jeff Trawick, based on idea from + Madhusudan Mathihalli] + *) Support "large files" by default on 32-bit Unix platforms which implement the LFS standard. [Joe Orton] diff --git a/configure.in b/configure.in index f9455e16925..e5cf082c3ac 100644 --- a/configure.in +++ b/configure.in @@ -1171,6 +1171,18 @@ else fi if test "$ac_cv_socklen_t" = "yes"; then socklen_t_value="socklen_t" + case $host in + *-hp-hpux*) + if test "$ac_cv_sizeof_long" = "8"; then + # 64-bit HP-UX requires 32-bit socklens in + # kernel, but user-space declarations say + # 64-bit (socklen_t == size_t == long). + # This will result in many compile warnings, + # but we're functionally busted otherwise. + socklen_t_value="int" + fi + ;; + esac else socklen_t_value="int" fi From 7753c49c77f85a4bf3eb151b80caefe73fb9718e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 16 Apr 2004 17:14:16 +0000 Subject: [PATCH 4955/7878] sync with apr 0.9 branch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65066 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index a281d01165d..bc2fe4a8321 100644 --- a/CHANGES +++ b/CHANGES @@ -7,12 +7,6 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 - *) Provide workaround for socklen_t declaration problem with 64-bit - build on HP-UX. Stop setting a PA-RISC-specific compile option - on ia64. Look for -mt thread option, which is used with HP-UX - vendor compiler on ia64. [Jeff Trawick, based on idea from - Madhusudan Mathihalli] - *) Support "large files" by default on 32-bit Unix platforms which implement the LFS standard. [Joe Orton] @@ -122,6 +116,12 @@ Changes with APR 1.0 Changes with APR 0.9.5 + *) Provide workaround for socklen_t declaration problem with 64-bit + build on HP-UX. Stop setting a PA-RISC-specific compile option + on ia64. Look for -mt thread option, which is used with HP-UX + vendor compiler on ia64. [Jeff Trawick, based on idea from + Madhusudan Mathihalli] + *) Return an error instead of silently failing when apr_poll() is used with file descriptors >= FD_SETSIZE. (Unix systems with no native poll()) [Jeff Trawick, Brad Nicholes] From c80ab9a73a9bfd264c904099067667bb9fdaf8ed Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 18 Apr 2004 12:12:49 +0000 Subject: [PATCH 4956/7878] Allow developers to specify their own hash function for hash tables using the apr_hash_make_custom API. Submitted by: Ami Ganguli Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65067 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_hash.h | 21 ++++++++++++++++ tables/apr_hash.c | 61 +++++++++++++++++++++++++++++++--------------- test/testhash.c | 30 ++++++++++++++++++++++- 4 files changed, 94 insertions(+), 21 deletions(-) diff --git a/CHANGES b/CHANGES index bc2fe4a8321..9f47062f3a9 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Add support for developers to use their own hashing function with + apr_hash_make_custom. [Ami Ganguli ] + *) Support "large files" by default on 32-bit Unix platforms which implement the LFS standard. [Joe Orton] diff --git a/include/apr_hash.h b/include/apr_hash.h index 4b3dfb83fd1..32a415e938d 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -55,6 +55,18 @@ typedef struct apr_hash_t apr_hash_t; */ typedef struct apr_hash_index_t apr_hash_index_t; +/** + * Callback functions for calculating hash values. + * @param key The key. + * @param klen The length of the key, or APR_HASH_KEY_STRING to use the string length. If APR_HASH_KEY_STRING then returns the actual key length. + */ +typedef unsigned int (*apr_hashfunc_t)(const char *key, apr_ssize_t *klen); + +/** + * The default hash function. + */ +unsigned int apr_hashfunc_default( const char *key, apr_ssize_t *klen); + /** * Create a hash table. * @param pool The pool to allocate the hash table out of @@ -62,6 +74,15 @@ typedef struct apr_hash_index_t apr_hash_index_t; */ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool); +/** + * Create a hash table with a custom hash function + * @param pool The pool to allocate the hash table out of + * @param hash_func A custom hash function. + * @return The hash table just created + */ +APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool, + apr_hashfunc_t hash_func); + /** * Make a copy of a hash table * @param pool The pool from which to allocate the new hash table diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 42a860d353f..153442188fd 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -72,6 +72,7 @@ struct apr_hash_t { apr_hash_entry_t **array; apr_hash_index_t iterator; /* For apr_hash_first(NULL, ...) */ unsigned int count, max; + apr_hashfunc_t hash_func; }; #define INITIAL_MAX 15 /* tunable == 2^n - 1 */ @@ -94,6 +95,15 @@ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) ht->count = 0; ht->max = INITIAL_MAX; ht->array = alloc_array(ht, ht->max); + ht->hash_func = apr_hashfunc_default; + return ht; +} + +APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool, + apr_hashfunc_t hash_func) +{ + ht = apr_hash_make(p); + ht->hash_func = hash_func; return ht; } @@ -162,25 +172,12 @@ static void expand_array(apr_hash_t *ht) ht->max = new_max; } -/* - * This is where we keep the details of the hash function and control - * the maximum collision rate. - * - * If val is non-NULL it creates and initializes a new hash entry if - * there isn't already one there; it returns an updatable pointer so - * that hash entries can be removed. - */ - -static apr_hash_entry_t **find_entry(apr_hash_t *ht, - const void *key, - apr_ssize_t klen, - const void *val) +unsigned int apr_hashfunc_default( const char *key, apr_ssize_t *klen) { - apr_hash_entry_t **hep, *he; + unsigned int hash = 0; const unsigned char *p; - unsigned int hash; apr_ssize_t i; - + /* * This is the popular `times 33' hash algorithm which is used by * perl and also appears in Berkeley DB. This is one of the best @@ -218,19 +215,42 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, * * -- Ralf S. Engelschall */ - hash = 0; - if (klen == APR_HASH_KEY_STRING) { + + if (*klen == APR_HASH_KEY_STRING) { for (p = key; *p; p++) { hash = hash * 33 + *p; } - klen = p - (const unsigned char *)key; + *klen = p - (const unsigned char *)key; } else { - for (p = key, i = klen; i; i--, p++) { + for (p = key, i = *klen; i; i--, p++) { hash = hash * 33 + *p; } } + return hash; +} + + +/* + * This is where we keep the details of the hash function and control + * the maximum collision rate. + * + * If val is non-NULL it creates and initializes a new hash entry if + * there isn't already one there; it returns an updatable pointer so + * that hash entries can be removed. + */ + +static apr_hash_entry_t **find_entry(apr_hash_t *ht, + const void *key, + apr_ssize_t klen, + const void *val) +{ + apr_hash_entry_t **hep, *he; + unsigned int hash; + + hash = ht->hash_func( key, &klen ); + /* scan linked list */ for (hep = &ht->array[hash & ht->max], he = *hep; he; hep = &he->next, he = *hep) { @@ -267,6 +287,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, ht->pool = pool; ht->count = orig->count; ht->max = orig->max; + ht->hash_func = orig->hash_func; ht->array = (apr_hash_entry_t **)((char *)ht + sizeof(apr_hash_t)); new_vals = (apr_hash_entry_t *)((char *)(ht) + sizeof(apr_hash_t) + diff --git a/test/testhash.c b/test/testhash.c index 078b76ac7be..f49ff8ec6bb 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -111,6 +111,33 @@ static void same_value(CuTest *tc) CuAssertStrEquals(tc, "same", result); } +static unsigned int hash_custom( const char *key, apr_ssize_t *klen) +{ + unsigned int hash = 0; + while( *klen ) { + (*klen) --; + hash = hash * 33 + key[ *klen ]; + } + return hash; +} + +static void same_value_custom(CuTest *tc) +{ + apr_hash_t *h = NULL; + char *result = NULL; + + h = apr_hash_make_custom(p, hash_custom); + CuAssertPtrNotNull(tc, h); + + apr_hash_set(h, "same1", 5, "same"); + result = apr_hash_get(h, "same1", 5); + CuAssertStrEquals(tc, "same", result); + + apr_hash_set(h, "same2", 5, "same"); + result = apr_hash_get(h, "same2", 5); + CuAssertStrEquals(tc, "same", result); +} + static void key_space(CuTest *tc) { apr_hash_t *h = NULL; @@ -374,7 +401,7 @@ static void overlay_same(CuTest *tc) "Key base4 (5) Value value4\n" "#entries 5\n", str); } - + CuSuite *testhash(void) { CuSuite *suite = CuSuiteNew("Hash"); @@ -383,6 +410,7 @@ CuSuite *testhash(void) SUITE_ADD_TEST(suite, hash_set); SUITE_ADD_TEST(suite, hash_reset); SUITE_ADD_TEST(suite, same_value); + SUITE_ADD_TEST(suite, same_value_custom); SUITE_ADD_TEST(suite, key_space); SUITE_ADD_TEST(suite, delete_key); From dd6f8c13eafb961e71b2d31b50219f225abaa4b3 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 18 Apr 2004 17:07:43 +0000 Subject: [PATCH 4957/7878] Fix the compile errors. I thought I compiled this after making my changes to the patch, but I must have just re-compiled the test programs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Submitted by: Andr� Malo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65068 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 153442188fd..d7b73bdb5c4 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -102,7 +102,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool, apr_hashfunc_t hash_func) { - ht = apr_hash_make(p); + apr_hash_t *ht = apr_hash_make(pool); ht->hash_func = hash_func; return ht; } From 44d86a552bbb80322b9beb695586a8c6fb89432c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 19 Apr 2004 08:54:48 +0000 Subject: [PATCH 4958/7878] * tables/apr_hash.c (apr_hash_merge): Copy the hash_func. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65069 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index d7b73bdb5c4..c3f3240a361 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -172,7 +172,7 @@ static void expand_array(apr_hash_t *ht) ht->max = new_max; } -unsigned int apr_hashfunc_default( const char *key, apr_ssize_t *klen) +unsigned int apr_hashfunc_default(const char *key, apr_ssize_t *klen) { unsigned int hash = 0; const unsigned char *p; @@ -249,7 +249,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, apr_hash_entry_t **hep, *he; unsigned int hash; - hash = ht->hash_func( key, &klen ); + hash = ht->hash_func(key, &klen); /* scan linked list */ for (hep = &ht->array[hash & ht->max], he = *hep; @@ -395,6 +395,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, res = apr_palloc(p, sizeof(apr_hash_t)); res->pool = p; + res->hash_func = base->hash_func; res->count = base->count; res->max = (overlay->max > base->max) ? overlay->max : base->max; if (base->count + overlay->count > res->max) { From 6bd7102bea0254bcd72dba6997f5b20d02a29ae2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 19 Apr 2004 11:44:37 +0000 Subject: [PATCH 4959/7878] fix some unsigned char/signed char discrepancies git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65070 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index c3f3240a361..8b8a7f3d15d 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -172,9 +172,10 @@ static void expand_array(apr_hash_t *ht) ht->max = new_max; } -unsigned int apr_hashfunc_default(const char *key, apr_ssize_t *klen) +unsigned int apr_hashfunc_default(const char *char_key, apr_ssize_t *klen) { unsigned int hash = 0; + const unsigned char *key = (const unsigned char *)char_key; const unsigned char *p; apr_ssize_t i; @@ -220,7 +221,7 @@ unsigned int apr_hashfunc_default(const char *key, apr_ssize_t *klen) for (p = key; *p; p++) { hash = hash * 33 + *p; } - *klen = p - (const unsigned char *)key; + *klen = p - key; } else { for (p = key, i = *klen; i; i--, p++) { From c6cbcae63f89a16009686adc902e4ddc1160e953 Mon Sep 17 00:00:00 2001 From: Madhusudan Mathihalli Date: Wed, 21 Apr 2004 01:01:28 +0000 Subject: [PATCH 4960/7878] Added two new functions apr_signal_block and apr_signal_unblock to block/unblock only certain signals. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65071 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ threadproc/unix/signals.c | 46 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/CHANGES b/CHANGES index 9f47062f3a9..9d20b74196f 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Add new functions apr_signal_block, apr_signal_unblock to block/unblock + the delivery of a particular signal. [Madhusudan Mathihalli] + *) Add support for developers to use their own hashing function with apr_hash_make_custom. [Ami Ganguli ] diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index ae87a861b0d..9b0174cdd4e 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -423,4 +423,50 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) return rv; } +APR_DECLARE(apr_status_t) apr_signal_block(int signum) +{ + sigset_t sig_mask; + int rv; + + sigemptyset(&sig_mask); + + sigaddset(&sig_mask, signum); + +#if defined(SIGPROCMASK_SETS_THREAD_MASK) + if ((rv = sigprocmask(SIG_BLOCK, &sig_mask, NULL)) != 0) { + rv = errno; + } +#else + if ((rv = pthread_sigmask(SIG_BLOCK, &sig_mask, NULL)) != 0) { +#ifdef PTHREAD_SETS_ERRNO + rv = errno; +#endif + } +#endif + return rv; +} + +APR_DECLARE(apr_status_t) apr_signal_unblock(int signum) +{ + sigset_t sig_mask; + int rv; + + sigemptyset(&sig_mask); + + sigaddset(&sig_mask, signum); + +#if defined(SIGPROCMASK_SETS_THREAD_MASK) + if ((rv = sigprocmask(SIG_UNBLOCK, &sig_mask, NULL)) != 0) { + rv = errno; + } +#else + if ((rv = pthread_sigmask(SIG_UNBLOCK, &sig_mask, NULL)) != 0) { +#ifdef PTHREAD_SETS_ERRNO + rv = errno; +#endif + } +#endif + return rv; +} + #endif From aeea33b87d8040bd8e38f92c64e917b82d8e8462 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 21 Apr 2004 20:56:31 +0000 Subject: [PATCH 4961/7878] * include/apr_hash.h: Fix some NUL/null confusion, document restriction on use of apr_hash_merge and apr_hash_overlay with custom hash functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65072 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index 32a415e938d..0a47961acfc 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -38,10 +38,10 @@ extern "C" { * passed to indicate a string-valued key, and have apr_hash compute the * length automatically. * - * @remark apr_hash will use strlen(key) for the length. The null-terminator + * @remark apr_hash will use strlen(key) for the length. The NUL terminator * is not included in the hash value (why throw a constant in?). * Since the hash table merely references the provided key (rather - * than copying it), apr_hash_this() will return the null-term'd key. + * than copying it), apr_hash_this() will return the NUL-term'd key. */ #define APR_HASH_KEY_STRING (-1) @@ -173,7 +173,8 @@ APR_DECLARE(unsigned int) apr_hash_count(apr_hash_t *ht); /** * Merge two hash tables into one new hash table. The values of the overlay - * hash override the values of the base if both have the same key. + * hash override the values of the base if both have the same key. Both + * hash tables must use the same hash function. * @param p The pool to use for the new hash table * @param overlay The table to add to the initial table * @param base The table that represents the initial values of the new table @@ -186,7 +187,8 @@ APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p, /** * Merge two hash tables into one new hash table. If the same key * is present in both tables, call the supplied merge function to - * produce a merged value for the key in the new table. + * produce a merged value for the key in the new table. Both + * hash tables must use the same hash function. * @param p The pool to use for the new hash table * @param h1 The first of the tables to merge * @param h2 The second of the tables to merge From c10d3ae94f37993de28443fbab19540ea5e05293 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 21 Apr 2004 20:58:56 +0000 Subject: [PATCH 4962/7878] * include/apr_time.h: More null/NUL confusion. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65073 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_time.h b/include/apr_time.h index 02797f4cc81..887d905621e 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -182,7 +182,7 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t); * apr_rfc822_date formats dates in the RFC822 * format in an efficient manner. It is a fixed length * format which requires the indicated amount of storage, - * including the trailing null byte. + * including the trailing NUL terminator. * @param date_str String to write to. * @param t the time to convert */ @@ -194,7 +194,7 @@ APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t); * apr_ctime formats dates in the ctime() format * in an efficient manner. it is a fixed length format * and requires the indicated amount of storage including - * the trailing null byte. + * the trailing NUL terminator. * Unlike ANSI/ISO C ctime(), apr_ctime() does not include * a \n at the end of the string. * @param date_str String to write to. From 7e05e5d046b9a6e01d69c34ff922788d4e7871ca Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 21 Apr 2004 21:11:21 +0000 Subject: [PATCH 4963/7878] * include/apr_file_info.h, file_io/unix/fileacc.c (apr_unix_mode2perms, apr_unix_perms2mode): Support setuid, setgid and sticky bits. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Submitted by: Andr�� Malo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65074 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++++- file_io/unix/fileacc.c | 16 ++++++++++++++++ include/apr_file_info.h | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 9d20b74196f..83ae19a33fd 100644 --- a/CHANGES +++ b/CHANGES @@ -7,8 +7,11 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Support setuid, setgid and sticky file permissions bits on Unix. + [André Malo] + *) Add new functions apr_signal_block, apr_signal_unblock to block/unblock - the delivery of a particular signal. [Madhusudan Mathihalli] + the delivery of a particular signal. [Madhusudan Mathihalli] *) Add support for developers to use their own hashing function with apr_hash_make_custom. [Ami Ganguli ] diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index bcd207c8974..2f20c0bfbf0 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -35,6 +35,8 @@ mode_t apr_unix_perms2mode(apr_fileperms_t perms) { mode_t mode = 0; + if (perms & APR_USETID) + mode |= S_ISUID; if (perms & APR_UREAD) mode |= S_IRUSR; if (perms & APR_UWRITE) @@ -42,6 +44,8 @@ mode_t apr_unix_perms2mode(apr_fileperms_t perms) if (perms & APR_UEXECUTE) mode |= S_IXUSR; + if (perms & APR_GSETID) + mode |= S_ISGID; if (perms & APR_GREAD) mode |= S_IRGRP; if (perms & APR_GWRITE) @@ -49,6 +53,10 @@ mode_t apr_unix_perms2mode(apr_fileperms_t perms) if (perms & APR_GEXECUTE) mode |= S_IXGRP; +#ifdef S_ISVTX + if (perms & APR_WSTICKY) + mode |= S_ISVTX; +#endif if (perms & APR_WREAD) mode |= S_IROTH; if (perms & APR_WWRITE) @@ -63,6 +71,8 @@ apr_fileperms_t apr_unix_mode2perms(mode_t mode) { apr_fileperms_t perms = 0; + if (mode & S_ISUID) + perms |= APR_USETID; if (mode & S_IRUSR) perms |= APR_UREAD; if (mode & S_IWUSR) @@ -70,6 +80,8 @@ apr_fileperms_t apr_unix_mode2perms(mode_t mode) if (mode & S_IXUSR) perms |= APR_UEXECUTE; + if (mode & S_ISGID) + perms |= APR_GSETID; if (mode & S_IRGRP) perms |= APR_GREAD; if (mode & S_IWGRP) @@ -77,6 +89,10 @@ apr_fileperms_t apr_unix_mode2perms(mode_t mode) if (mode & S_IXGRP) perms |= APR_GEXECUTE; +#ifdef S_ISVTX + if (mode & S_ISVTX) + perms |= APR_WSTICKY; +#endif if (mode & S_IROTH) perms |= APR_WREAD; if (mode & S_IWOTH) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index c608fb8788e..6ec130d798b 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -75,14 +75,17 @@ typedef enum { * @{ */ +#define APR_USETID 0x0800 /**< Set user id */ #define APR_UREAD 0x0400 /**< Read by user */ #define APR_UWRITE 0x0200 /**< Write by user */ #define APR_UEXECUTE 0x0100 /**< Execute by user */ +#define APR_GSETID 0x0080 /**< Set group id */ #define APR_GREAD 0x0040 /**< Read by group */ #define APR_GWRITE 0x0020 /**< Write by group */ #define APR_GEXECUTE 0x0010 /**< Execute by group */ +#define APR_WSTICKY 0x0008 /**< Sticky bit */ #define APR_WREAD 0x0004 /**< Read by others */ #define APR_WWRITE 0x0002 /**< Write by others */ #define APR_WEXECUTE 0x0001 /**< Execute by others */ From 087631d6394e220071b4c2855d7e36cf26802911 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 21 Apr 2004 21:18:17 +0000 Subject: [PATCH 4964/7878] * include/apr_hash.h: Fix formatting. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65075 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index 0a47961acfc..5365c0a2060 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -58,14 +58,15 @@ typedef struct apr_hash_index_t apr_hash_index_t; /** * Callback functions for calculating hash values. * @param key The key. - * @param klen The length of the key, or APR_HASH_KEY_STRING to use the string length. If APR_HASH_KEY_STRING then returns the actual key length. + * @param klen The length of the key, or APR_HASH_KEY_STRING to use the string + * length. If APR_HASH_KEY_STRING then returns the actual key length. */ typedef unsigned int (*apr_hashfunc_t)(const char *key, apr_ssize_t *klen); /** * The default hash function. */ -unsigned int apr_hashfunc_default( const char *key, apr_ssize_t *klen); +unsigned int apr_hashfunc_default(const char *key, apr_ssize_t *klen); /** * Create a hash table. From 76c834c97c1ad3c85c4bc24274302a3ed6fc5cac Mon Sep 17 00:00:00 2001 From: Madhusudan Mathihalli Date: Wed, 21 Apr 2004 21:45:38 +0000 Subject: [PATCH 4965/7878] Added two new functions apr_signal_block and apr_signal_unblock to block/unblock only certain signals. The functions are currently enabled for Unix (beos, os2). It's a null function for win32 and netware (I really don't know if they even require such a feature) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65076 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_signal.h | 14 ++++++++++++++ threadproc/netware/signals.c | 10 ++++++++++ threadproc/win32/signals.c | 10 ++++++++++ 3 files changed, 34 insertions(+) diff --git a/include/apr_signal.h b/include/apr_signal.h index ff885352f7a..173044bb781 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -85,6 +85,20 @@ APR_DECLARE(const char *) apr_signal_description_get(int signum); */ void apr_signal_init(apr_pool_t *pglobal); +/** + * Block the delivery of a particular signal + * @param signum The signal number + * @return status + */ +APR_DECLARE(apr_status_t) apr_signal_block(int signum); + +/** + * Enable the delivery of a particular signal + * @param signum The signal number + * @return status + */ +APR_DECLARE(apr_status_t) apr_signal_unblock(int signum); + /** @} */ #ifdef __cplusplus diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c index 3ef521003d4..dc94cf5f25a 100644 --- a/threadproc/netware/signals.c +++ b/threadproc/netware/signals.c @@ -69,3 +69,13 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) return rv; } + +APR_DECLARE(apr_status_t) apr_signal_block(int signum) +{ + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_signal_unblock(int signum) +{ + return APR_SUCCESS; +} diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 6fab4fabf9d..14cd9232ad5 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -53,3 +53,13 @@ const char *apr_signal_description_get(int signum) { return "unknown signal (not supported)"; } + +APR_DECLARE(apr_status_t) apr_signal_block(int signum) +{ + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_signal_unblock(int signum) +{ + return APR_SUCCESS; +} From 97c452e686e9d7d066ef9f026a2b92fdd55fbb6c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 22 Apr 2004 08:23:23 +0000 Subject: [PATCH 4966/7878] * threadproc/unix/signals.c (apr_signal_block, apr_signal_unblock): Move outside #if APR_HAS_THREADS to fix non-threaded build; return ENOTIMPL for !APR_HAS_SIGACTION case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65077 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 9b0174cdd4e..3cafd8532e2 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -423,8 +423,11 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) return rv; } +#endif /* APR_HAS_THREADS && ... */ + APR_DECLARE(apr_status_t) apr_signal_block(int signum) { +#if APR_HAS_SIGACTION sigset_t sig_mask; int rv; @@ -444,10 +447,14 @@ APR_DECLARE(apr_status_t) apr_signal_block(int signum) } #endif return rv; +#else + return APR_ENOTIMPL; +#endif } APR_DECLARE(apr_status_t) apr_signal_unblock(int signum) { +#if APR_HAS_SIGACTION sigset_t sig_mask; int rv; @@ -467,6 +474,7 @@ APR_DECLARE(apr_status_t) apr_signal_unblock(int signum) } #endif return rv; -} - +#else + return APR_ENOTIMPL; #endif +} From 9ad84ed29646158cf7f047f82de12a47542f4adb Mon Sep 17 00:00:00 2001 From: Madhusudan Mathihalli Date: Thu, 22 Apr 2004 15:55:53 +0000 Subject: [PATCH 4967/7878] APR_ENOTIMPL is more appropriate (rather than APR_SUCCESS) for apr_signal_block, apr_signal_unblock (since they're not implemented) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65078 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/signals.c | 4 ++-- threadproc/win32/signals.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c index dc94cf5f25a..1ac51c70a19 100644 --- a/threadproc/netware/signals.c +++ b/threadproc/netware/signals.c @@ -72,10 +72,10 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) APR_DECLARE(apr_status_t) apr_signal_block(int signum) { - return APR_SUCCESS; + return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_signal_unblock(int signum) { - return APR_SUCCESS; + return APR_ENOTIMPL; } diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 14cd9232ad5..12d865edbb6 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -56,10 +56,10 @@ const char *apr_signal_description_get(int signum) APR_DECLARE(apr_status_t) apr_signal_block(int signum) { - return APR_SUCCESS; + return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_signal_unblock(int signum) { - return APR_SUCCESS; + return APR_ENOTIMPL; } From a61f246737ee1c2c56519dbe2c4474fd57238f6f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 28 Apr 2004 20:40:22 +0000 Subject: [PATCH 4968/7878] Fix the XLFLAGS define in the NetWare makefiles so that the contents are added to the _link.opt file rather than the _link.def file Submitted by: Guenter Knauf , Brad Nicholes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65080 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index ad3cd4ac626..0ed83289e42 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -253,6 +253,9 @@ endif ifneq "$(NLM_FLAGS)" "" @echo -flags $(NLM_FLAGS) >> $@ endif +ifneq "$(strip $(XLFLAGS))" "" + @echo $(XLFLAGS) >> $@ +endif ifneq "$(strip $(FILES_nlm_objs))" "" @echo $(foreach objfile,$(strip $(FILES_nlm_objs)),$(subst /,\,$(objfile))) >> $@ endif @@ -275,9 +278,6 @@ endif ifneq "$(FILES_nlm_exports)" "" @echo Export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(subst /,\,$(export))) >> $(OBJDIR)\$(NLM_NAME)_link.def endif -ifneq "$(strip $(XLFLAGS))" "" - @echo $(XLFLAGS) >> $(OBJDIR)\$(NLM_NAME)_link.def -endif # if APACHE_UNIPROC is defined, don't include XDCData ifndef APACHE_UNIPROC From 466246495da236c1d3fe352656f582eb15a5b076 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 29 Apr 2004 16:49:50 +0000 Subject: [PATCH 4969/7878] Remove the hardcoded /Y parameter when doing a xcopy Submitted by: Guenter Knauf git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65082 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 2 +- build/NWGNUenvironment.inc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 0eb66630864..7b9f3b0a163 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -324,7 +324,7 @@ ifndef DEST -copy $(subst /,\,$(APRUTIL))\STATUS $(INSTALLBASE)\*.apu -copy $(subst /,\,$(APRUTIL))\CHANGES $(INSTALLBASE)\*.apu @echo rem copying the docs directories > xc.bat - @echo xcopy docs $(INSTALLBASE)\docs\*.* /E /Y >> xc.bat + @echo xcopy docs $(INSTALLBASE)\docs\*.* $(XCOPYSW) >> xc.bat $(CMD) xc.bat $(DEL) xc.bat endif diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 44417d65819..b3aff53b1c2 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -243,12 +243,14 @@ CHKNOT=cmd /C if not exist DEL = del /F DELTREE = cmd /C rd /s/q WINNT=1 +XCOPYSW = /E else CMD=command /C CHK=command /C if exist CHKNOT=command /C if not exist DEL = del DELTREE = deltree /y +XCOPYSW = /E /Y endif From 20bed3fcaea1f00c7f7d1dda446e29c57f4b64f5 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 29 Apr 2004 17:02:15 +0000 Subject: [PATCH 4970/7878] Add the installdev target to the help list Submitted by: Guenter Knauf git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65084 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUhead.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc index c96b7aad74f..17f149cadde 100644 --- a/build/NWGNUhead.inc +++ b/build/NWGNUhead.inc @@ -46,6 +46,8 @@ help : @echo nlms. . . . . . . builds all nlms @echo install . . . . . builds libs and nlms and copies install files to @echo "$(INSTALL)" + @echo installdev. . . . copies headers and files needed for development to + @echo "$(INSTALL)" @echo clean . . . . . . deletes $(OBJDIR) dirs, *.err, and *.map @echo clobber_all . . . deletes all possible output from the make @echo clobber_install . deletes all files in $(INSTALL) From 5aa2cb5ee89735d4eb3dd5ec7b3a0e392f41b92c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 4 May 2004 00:07:32 +0000 Subject: [PATCH 4971/7878] Fix sign error in apr_file_seek(). Submitted by: Greg Hudson Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65086 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/os2/seek.c | 2 +- file_io/unix/seek.c | 2 +- file_io/win32/seek.c | 2 +- test/testfile.c | 21 +++++++++++++++++++++ 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 83ae19a33fd..4722ed41db6 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Fix sign error in apr_file_seek(APR_END). + [Greg Hudson ] + *) Support setuid, setgid and sticky file permissions bits on Unix. [André Malo] diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index f393b9d1c19..98f2ea5b035 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -70,7 +70,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh case APR_END: rc = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); if (rc == APR_SUCCESS) - rc = setptr(thefile, finfo.size - *offset); + rc = setptr(thefile, finfo.size + *offset); break; } diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index cac4e9331fd..0d115243252 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -69,7 +69,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh case APR_END: rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); if (rc == APR_SUCCESS) - rc = setptr(thefile, finfo.size - *offset); + rc = setptr(thefile, finfo.size + *offset); break; } diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 55d42a39e10..61fe6264c9e 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -73,7 +73,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh case APR_END: rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); if (rc == APR_SUCCESS) - rc = setptr(thefile, finfo.size - *offset); + rc = setptr(thefile, finfo.size + *offset); break; default: diff --git a/test/testfile.c b/test/testfile.c index 1305efc10fe..ce02faf7b0c 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -228,6 +228,27 @@ static void test_seek(CuTest *tc) CuAssertStrEquals(tc, TESTSTR + 5, str); apr_file_close(filetest); + + /* Test for regression of sign error bug with SEEK_END and + buffered files. */ + rv = apr_file_open(&filetest, FILENAME, + APR_READ | APR_BUFFERED, + APR_UREAD | APR_UWRITE | APR_GREAD, p); + apr_assert_success(tc, "Open test file " FILENAME, rv); + + offset = -5; + rv = apr_file_seek(filetest, SEEK_END, &offset); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, strlen(TESTSTR) - 5, nbytes); + + memset(str, 0, nbytes + 1); + nbytes = 256; + rv = apr_file_read(filetest, str, &nbytes); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 5, nbytes); + CuAssertStrEquals(tc, TESTSTR + strlen(TESTSTR) - 5, str); + + apr_file_close(filetest); } static void test_userdata_set(CuTest *tc) From 31e4f915c80bcbe7b6fcccb433108a87d06b7b0e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 4 May 2004 00:47:05 +0000 Subject: [PATCH 4972/7878] sync git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65088 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 4722ed41db6..7125794e967 100644 --- a/CHANGES +++ b/CHANGES @@ -7,9 +7,6 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 - *) Fix sign error in apr_file_seek(APR_END). - [Greg Hudson ] - *) Support setuid, setgid and sticky file permissions bits on Unix. [André Malo] @@ -128,6 +125,9 @@ Changes with APR 1.0 Changes with APR 0.9.5 + *) Fix sign error in apr_file_seek(APR_END). + [Greg Hudson ] + *) Provide workaround for socklen_t declaration problem with 64-bit build on HP-UX. Stop setting a PA-RISC-specific compile option on ia64. Look for -mt thread option, which is used with HP-UX From 085c6de6d737b25597c0b88d16adaf1720e95628 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 5 May 2004 03:00:28 +0000 Subject: [PATCH 4973/7878] sync with 0.9 branch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65090 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 7125794e967..5c65dcbbc6a 100644 --- a/CHANGES +++ b/CHANGES @@ -7,9 +7,6 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 - *) Support setuid, setgid and sticky file permissions bits on Unix. - [André Malo] - *) Add new functions apr_signal_block, apr_signal_unblock to block/unblock the delivery of a particular signal. [Madhusudan Mathihalli] @@ -125,6 +122,9 @@ Changes with APR 1.0 Changes with APR 0.9.5 + *) Support setuid, setgid and sticky file permissions bits on Unix. + [André Malo] + *) Fix sign error in apr_file_seek(APR_END). [Greg Hudson ] From 8105442bed17758de90690cad0a26d5414ef8452 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 13 May 2004 00:50:20 +0000 Subject: [PATCH 4974/7878] Move the APR test suite from CuTest to abts. The output is cleaner, and it prints output while running the test. Also, if a test fails the rest of the test function is run, allowing for proper cleanup. Finally, it is possible to call the same function multiple times with different data, and each call is considered a separate test. This is the first of a multi-step process to get a more useful test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65091 13f79535-47bb-0310-9956-ffa450edef68 --- test/CuTest.c | 475 ----------------------------------------- test/CuTest.h | 140 ------------ test/Makefile.in | 8 +- test/abts.c | 365 +++++++++++++++++++++++++++++++ test/abts.h | 86 ++++++++ test/abts_tests.h | 69 ++++++ test/testall.c | 177 --------------- test/testargs.c | 106 ++++----- test/testatomic.c | 120 +++++------ test/testdir.c | 136 ++++++------ test/testdso.c | 110 +++++----- test/testdup.c | 110 +++++----- test/testenv.c | 34 +-- test/testfile.c | 292 ++++++++++++------------- test/testfilecopy.c | 28 +-- test/testfileinfo.c | 90 ++++---- test/testflock.c | 32 +-- test/testfmt.c | 76 +++---- test/testfnmatch.c | 26 +-- test/testglobalmutex.c | 20 +- test/testhash.c | 158 +++++++------- test/testipsub.c | 50 ++--- test/testlfs.c | 76 +++---- test/testlock.c | 78 +++---- test/testlockperf.c | 2 +- test/testmmap.c | 82 +++---- test/testnames.c | 128 +++++------ test/testoc.c | 32 +-- test/testpath.c | 54 ++--- test/testpipe.c | 116 +++++----- test/testpoll.c | 272 +++++++++++------------ test/testpools.c | 52 ++--- test/testproc.c | 76 +++---- test/testprocmutex.c | 24 +-- test/testrand.c | 12 +- test/testrand2.c | 58 ++--- test/testshm.c | 66 +++--- test/testsleep.c | 14 +- test/testsock.c | 52 ++--- test/testsockets.c | 108 +++++----- test/testsockopt.c | 82 +++---- test/teststr.c | 66 +++--- test/teststrnatcmp.c | 48 ++--- test/testtable.c | 86 ++++---- test/testtemp.c | 16 +- test/testthread.c | 56 ++--- test/testtime.c | 132 ++++++------ test/testud.c | 36 ++-- test/testuser.c | 32 +-- test/testutil.c | 44 ++++ test/testutil.h | 88 ++++++++ test/testutil.lo | Bin 0 -> 30080 bytes test/testutil.o | Bin 0 -> 29796 bytes test/testvsn.c | 22 +- 54 files changed, 2289 insertions(+), 2429 deletions(-) delete mode 100644 test/CuTest.c delete mode 100644 test/CuTest.h create mode 100644 test/abts.c create mode 100644 test/abts.h create mode 100644 test/abts_tests.h delete mode 100644 test/testall.c create mode 100644 test/testutil.c create mode 100644 test/testutil.h create mode 100644 test/testutil.lo create mode 100644 test/testutil.o diff --git a/test/CuTest.c b/test/CuTest.c deleted file mode 100644 index 8356b9b2808..00000000000 --- a/test/CuTest.c +++ /dev/null @@ -1,475 +0,0 @@ -/* - * Copyright (c) 2002-2006 Asim Jalis - * - * This library is released under the zlib/libpng license as described at - * - * http://www.opensource.org/licenses/zlib-license.html - * - * Here is the statement of the license: - * - * This software is provided 'as-is', without any express or implied warranty. - * In no event will the authors be held liable for any damages arising from - * the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software in a - * product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source distribution. - */ -/* - * This file has been modified from the original distribution. - */ - -#include -#include -#include -#include -#include - -#include "CuTest.h" - -static int verbose = 0; - -void CuInit(int argc, char *argv[]) -{ - int i; - - /* Windows doesn't have getopt, so we have to fake it. We can't use - * apr_getopt, because CuTest is meant to be a stand-alone test suite - */ - for (i = 0; i < argc; i++) { - if (!strcmp(argv[i], "-v")) { - verbose = 1; - } - } -} - -/*-------------------------------------------------------------------------* - * CuStr - *-------------------------------------------------------------------------*/ - -char* CuStrAlloc(int size) -{ - char* new = (char*) malloc( sizeof(char) * (size) ); - return new; -} - -char* CuStrCopy(const char* old) -{ - int len = strlen(old); - char* new = CuStrAlloc(len + 1); - strcpy(new, old); - return new; -} - -/*-------------------------------------------------------------------------* - * CuString - *-------------------------------------------------------------------------*/ - -void CuStringInit(CuString* str) -{ - str->length = 0; - str->size = STRING_MAX; - str->buffer = (char*) malloc(sizeof(char) * str->size); - str->buffer[0] = '\0'; -} - -CuString* CuStringNew(void) -{ - CuString* str = (CuString*) malloc(sizeof(CuString)); - str->length = 0; - str->size = STRING_MAX; - str->buffer = (char*) malloc(sizeof(char) * str->size); - str->buffer[0] = '\0'; - return str; -} - -void CuStringResize(CuString* str, int newSize) -{ - str->buffer = (char*) realloc(str->buffer, sizeof(char) * newSize); - str->size = newSize; -} - -void CuStringAppend(CuString* str, const char* text) -{ - int length = strlen(text); - if (str->length + length + 1 >= str->size) - CuStringResize(str, str->length + length + 1 + STRING_INC); - str->length += length; - strcat(str->buffer, text); -} - -void CuStringAppendChar(CuString* str, char ch) -{ - char text[2]; - text[0] = ch; - text[1] = '\0'; - CuStringAppend(str, text); -} - -void CuStringAppendFormat(CuString* str, const char* format, ...) -{ - va_list argp; - char buf[HUGE_STRING_LEN]; - va_start(argp, format); - vsprintf(buf, format, argp); - va_end(argp); - CuStringAppend(str, buf); -} - -void CuStringRead(CuString *str, char *path) -{ - path = strdup(str->buffer); -} - -/*-------------------------------------------------------------------------* - * CuTest - *-------------------------------------------------------------------------*/ - -void CuTestInit(CuTest* t, char* name, TestFunction function) -{ - t->name = CuStrCopy(name); - t->notimpl = 0; - t->failed = 0; - t->ran = 0; - t->message = NULL; - t->function = function; - t->jumpBuf = NULL; -} - -CuTest* CuTestNew(char* name, TestFunction function) -{ - CuTest* tc = CU_ALLOC(CuTest); - CuTestInit(tc, name, function); - return tc; -} - -void CuNotImpl(CuTest* tc, const char* message) -{ - CuString* newstr = CuStringNew(); - CuStringAppend(newstr, message); - CuStringAppend(newstr, " not implemented on this platform"); - tc->notimpl = 1; - tc->message = CuStrCopy(newstr->buffer); - if (tc->jumpBuf != 0) longjmp(*(tc->jumpBuf), 0); -} - -void CuFail(CuTest* tc, const char* message) -{ - tc->failed = 1; - tc->message = CuStrCopy(message); - if (tc->jumpBuf != 0) longjmp(*(tc->jumpBuf), 0); -} - -void CuAssert(CuTest* tc, const char* message, int condition) -{ - if (condition) return; - CuFail(tc, message); -} - -void CuAssertTrue(CuTest* tc, int condition) -{ - if (condition) return; - CuFail(tc, "assert failed"); -} - -void CuAssertStrNEquals(CuTest* tc, const char* expected, const char* actual, - int n) -{ - CuString* message; - if (strncmp(expected, actual, n) == 0) return; - message = CuStringNew(); - CuStringAppend(message, "expected\n---->\n"); - CuStringAppend(message, expected); - CuStringAppend(message, "\n<----\nbut saw\n---->\n"); - CuStringAppend(message, actual); - CuStringAppend(message, "\n<----"); - CuFail(tc, message->buffer); -} - -void CuAssertStrEquals(CuTest* tc, const char* expected, const char* actual) -{ - CuString* message; - if (strcmp(expected, actual) == 0) return; - message = CuStringNew(); - CuStringAppend(message, "expected\n---->\n"); - CuStringAppend(message, expected); - CuStringAppend(message, "\n<----\nbut saw\n---->\n"); - CuStringAppend(message, actual); - CuStringAppend(message, "\n<----"); - CuFail(tc, message->buffer); -} - -void CuAssertIntEquals(CuTest* tc, int expected, int actual) -{ - char buf[STRING_MAX]; - if (expected == actual) return; - sprintf(buf, "expected <%d> but was <%d>", expected, actual); - CuFail(tc, buf); -} - -void CuAssertPtrEquals(CuTest* tc, const void* expected, const void* actual) -{ - char buf[STRING_MAX]; - if (expected == actual) return; - sprintf(buf, "expected pointer <%p> but was <%p>", expected, actual); - CuFail(tc, buf); -} - -void CuAssertPtrNotNull(CuTest* tc, const void* pointer) -{ - char buf[STRING_MAX]; - if (pointer != NULL ) return; - sprintf(buf, "null pointer unexpected, but was <%p>", pointer); - CuFail(tc, buf); -} - -void CuTestRun(CuTest* tc) -{ - jmp_buf buf; - tc->jumpBuf = &buf; - if (setjmp(buf) == 0) - { - tc->ran = 1; - (tc->function)(tc); - } - tc->jumpBuf = 0; -} - -/*-------------------------------------------------------------------------* - * CuSuite - *-------------------------------------------------------------------------*/ - -void CuSuiteInit(CuSuite* testSuite, char *name) -{ - testSuite->name = strdup(name); - testSuite->count = 0; - testSuite->failCount = 0; - testSuite->notimplCount = 0; -} - -CuSuite* CuSuiteNew(char *name) -{ - CuSuite* testSuite = CU_ALLOC(CuSuite); - CuSuiteInit(testSuite, name); - return testSuite; -} - -void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase) -{ - assert(testSuite->count < MAX_TEST_CASES); - testSuite->list[testSuite->count] = testCase; - testSuite->count++; -} - -void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2) -{ - int i; - for (i = 0 ; i < testSuite2->count ; ++i) - { - CuTest* testCase = testSuite2->list[i]; - CuSuiteAdd(testSuite, testCase); - } -} - -void CuSuiteRun(CuSuite* testSuite) -{ - int i; - for (i = 0 ; i < testSuite->count ; ++i) - { - CuTest* testCase = testSuite->list[i]; - CuTestRun(testCase); - if (testCase->failed) { testSuite->failCount += 1; } - if (testCase->notimpl) { testSuite->notimplCount += 1; } - } -} - -void CuSuiteSummary(CuSuite* testSuite, CuString* summary) -{ - int i; - for (i = 0 ; i < testSuite->count ; ++i) - { - CuTest* testCase = testSuite->list[i]; - CuStringAppend(summary, testCase->failed ? "F" : - testCase->notimpl ? "N": "."); - } - CuStringAppend(summary, "\n"); -} - -void CuSuiteOverView(CuSuite* testSuite, CuString* details) -{ - CuStringAppendFormat(details, "%d %s run: %d passed, %d failed, " - "%d not implemented.\n", - testSuite->count, - testSuite->count == 1 ? "test" : "tests", - testSuite->count - testSuite->failCount - - testSuite->notimplCount, - testSuite->failCount, testSuite->notimplCount); -} - -void CuSuiteDetails(CuSuite* testSuite, CuString* details) -{ - int i; - int failCount = 0; - - if (testSuite->failCount != 0 && verbose) - { - CuStringAppendFormat(details, "\nFailed tests in %s:\n", testSuite->name); - for (i = 0 ; i < testSuite->count ; ++i) - { - CuTest* testCase = testSuite->list[i]; - if (testCase->failed) - { - failCount++; - CuStringAppendFormat(details, "%d) %s: %s\n", - failCount, testCase->name, testCase->message); - } - } - } - if (testSuite->notimplCount != 0 && verbose) - { - CuStringAppendFormat(details, "\nNot Implemented tests in %s:\n", testSuite->name); - for (i = 0 ; i < testSuite->count ; ++i) - { - CuTest* testCase = testSuite->list[i]; - if (testCase->notimpl) - { - failCount++; - CuStringAppendFormat(details, "%d) %s: %s\n", - failCount, testCase->name, testCase->message); - } - } - } -} - -/*-------------------------------------------------------------------------* - * CuSuiteList - *-------------------------------------------------------------------------*/ - -CuSuiteList* CuSuiteListNew(char *name) -{ - CuSuiteList* testSuite = CU_ALLOC(CuSuiteList); - testSuite->name = strdup(name); - testSuite->count = 0; - return testSuite; -} - -void CuSuiteListAdd(CuSuiteList *suites, CuSuite *origsuite) -{ - assert(suites->count < MAX_TEST_CASES); - suites->list[suites->count] = origsuite; - suites->count++; -} - -void CuSuiteListRun(CuSuiteList* testSuite) -{ - int i; - for (i = 0 ; i < testSuite->count ; ++i) - { - CuSuite* testCase = testSuite->list[i]; - CuSuiteRun(testCase); - } -} - -static const char *genspaces(int i) -{ - char *str = malloc((i + 1) * sizeof(char)); - memset(str, ' ', i); - str[i] = '\0'; - return str; -} - -void CuSuiteListRunWithSummary(CuSuiteList* testSuite) -{ - int i; - - printf("%s:\n", testSuite->name); - for (i = 0 ; i < testSuite->count ; ++i) - { - CuSuite* testCase = testSuite->list[i]; - CuString *str = CuStringNew(); - - printf(" %s:%s", testCase->name, - genspaces(21 - strlen(testCase->name))); - fflush(stdout); - CuSuiteRun(testCase); - CuSuiteSummary(testCase, str); - printf(" %s", str->buffer); - - } - printf("\n"); -} - -void CuSuiteListSummary(CuSuiteList* testSuite, CuString* summary) -{ - int i; - CuStringAppendFormat(summary, "%s:\n", testSuite->name); - for (i = 0 ; i < testSuite->count ; ++i) - { - CuSuite* testCase = testSuite->list[i]; - CuString *str = CuStringNew(); - CuSuiteSummary(testCase, str); - CuStringAppend(summary, " "); - CuStringAppend(summary, str->buffer); - } - CuStringAppend(summary, "\n"); -} - -int CuSuiteListDetails(CuSuiteList* testSuite, CuString* details) -{ - int i; - int failCount = 0; - int notImplCount = 0; - int count = 0; - - for (i = 0 ; i < testSuite->count ; ++i) - { - failCount += testSuite->list[i]->failCount; - notImplCount += testSuite->list[i]->notimplCount; - count += testSuite->list[i]->count; - } - CuStringAppendFormat(details, "%d %s run: %d passed, %d failed, " - "%d not implemented.\n", - count, - count == 1 ? "test" : "tests", - count - failCount - notImplCount, - failCount, notImplCount); - - if (failCount != 0 && verbose) - { - for (i = 0 ; i < testSuite->count ; ++i) - { - CuString *str = CuStringNew(); - CuSuite* testCase = testSuite->list[i]; - if (testCase->failCount) - { - CuSuiteDetails(testCase, str); - CuStringAppend(details, str->buffer); - } - } - } - if (notImplCount != 0 && verbose) - { - for (i = 0 ; i < testSuite->count ; ++i) - { - CuString *str = CuStringNew(); - CuSuite* testCase = testSuite->list[i]; - if (testCase->notimplCount) - { - CuSuiteDetails(testCase, str); - CuStringAppend(details, str->buffer); - } - } - } - return failCount; -} - diff --git a/test/CuTest.h b/test/CuTest.h deleted file mode 100644 index e607d3ac9d4..00000000000 --- a/test/CuTest.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2002-2006 Asim Jalis - * - * This library is released under the zlib/libpng license as described at - * - * http://www.opensource.org/licenses/zlib-license.html - * - * Here is the statement of the license: - * - * This software is provided 'as-is', without any express or implied warranty. - * In no event will the authors be held liable for any damages arising from - * the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software in a - * product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source distribution. - */ -/* - * This file has been modified from the original distribution. - */ - -#ifndef CU_TEST_H -#define CU_TEST_H - -#include -#include - -/* CuString */ - -char* CuStrAlloc(int size); -char* CuStrCopy(const char* old); - -#define CU_ALLOC(TYPE) ((TYPE*) malloc(sizeof(TYPE))) - -#define HUGE_STRING_LEN 8192 -#define STRING_MAX 256 -#define STRING_INC 256 - -typedef struct -{ - int length; - int size; - char* buffer; -} CuString; - -void CuStringInit(CuString* str); -CuString* CuStringNew(void); -void CuStringRead(CuString* str, char* path); -void CuStringAppend(CuString* str, const char* text); -void CuStringAppendChar(CuString* str, char ch); -void CuStringAppendFormat(CuString* str, const char* format, ...); -void CuStringResize(CuString* str, int newSize); - -/* CuTest */ - -typedef struct CuTest CuTest; - -typedef void (*TestFunction)(CuTest *); - -struct CuTest -{ - char* name; - TestFunction function; - int notimpl; - int failed; - int ran; - char* message; - jmp_buf *jumpBuf; -}; - -void CuInit(int argc, char *argv[]); -void CuTestInit(CuTest* t, char* name, TestFunction function); -CuTest* CuTestNew(char* name, TestFunction function); -void CuFail(CuTest* tc, const char* message); -void CuNotImpl(CuTest* tc, const char* message); -void CuAssert(CuTest* tc, const char* message, int condition); -void CuAssertTrue(CuTest* tc, int condition); -void CuAssertStrEquals(CuTest* tc, const char* expected, const char* actual); -void CuAssertStrNEquals(CuTest* tc, const char* expected, const char* actual, - int n); -void CuAssertIntEquals(CuTest* tc, int expected, int actual); -void CuAssertPtrEquals(CuTest* tc, const void* expected, const void* actual); -void CuAssertPtrNotNull(CuTest* tc, const void* pointer); - -void CuTestRun(CuTest* tc); - -/* CuSuite */ - -#define MAX_TEST_CASES 1024 - -#define SUITE_ADD_TEST(SUITE,TEST) CuSuiteAdd(SUITE, CuTestNew(#TEST, TEST)) - -typedef struct -{ - char *name; - int count; - CuTest* list[MAX_TEST_CASES]; - int failCount; - int notimplCount; - -} CuSuite; - - -void CuSuiteInit(CuSuite* testSuite, char* name); -CuSuite* CuSuiteNew(char* name); -void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase); -void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2); -void CuSuiteRun(CuSuite* testSuite); -void CuSuiteSummary(CuSuite* testSuite, CuString* summary); -void CuSuiteOverView(CuSuite* testSuite, CuString* details); -void CuSuiteDetails(CuSuite* testSuite, CuString* details); - -typedef struct -{ - char *name; - int count; - CuSuite* list[MAX_TEST_CASES]; -} CuSuiteList; - - -CuSuiteList* CuSuiteListNew(char* name); -void CuSuiteListAdd(CuSuiteList* testSuite, CuSuite *testCase); -void CuSuiteListRun(CuSuiteList* testSuite); -void CuSuiteListRunWithSummary(CuSuiteList* testSuite); -void CuSuiteListSummary(CuSuiteList* testSuite, CuString* summary); -/* Print details of test suite results; returns total number of - * tests which failed. */ -int CuSuiteListDetails(CuSuiteList* testSuite, CuString* details); -#endif /* CU_TEST_H */ - diff --git a/test/Makefile.in b/test/Makefile.in index 4585bd51343..84548b83d77 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -94,7 +94,7 @@ testprocmutex@EXEEXT@: testprocmutex.lo $(LOCAL_LIBS) testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) $(LINK_PROG) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) -TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ +TESTS = testutil.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ @@ -104,11 +104,11 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testatomic.lo testflock.lo testshm.lo testsock.lo testglobalmutex.lo \ teststrnatcmp.lo testfilecopy.lo testtemp.lo testlfs.lo -testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ - readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ \ +testall@EXEEXT@: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ + readchild@EXEEXT@ abts.lo proc_child@EXEEXT@ \ tryread@EXEEXT@ sockchild@EXEEXT@ globalmutexchild@EXEEXT@ \ $(LOCAL_LIBS) - $(LINK_PROG) $(TESTS) CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) $(TESTS) abts.lo $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/abts.c b/test/abts.c new file mode 100644 index 00000000000..c60ac6e8036 --- /dev/null +++ b/test/abts.c @@ -0,0 +1,365 @@ +/* Copyright 2000-2004 Ryan Bloom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Portions of this file were taken from testall.c in the APR test suite, + * written by members of the Apache Software Foundation. + */ + +#include "abts.h" +#include "abts_tests.h" +#include "testutil.h" + +#define ABTS_STAT_SIZE 6 +static char status[ABTS_STAT_SIZE] = {'|', '/', '-', '|', '\\', '-'}; +static int curr_char; +static int verbose = 0; +static int exclude = 0; + +const char **testlist = NULL; + +static int find_test_name(const char *testname) { + int i; + for (i = 0; testlist[i] != NULL; i++) { + if (!strcmp(testlist[i], testname)) { + return 1; + } + } + return 0; +} + +/* Determine if the test should be run at all */ +static int should_test_run(const char *testname) { + int found = 0; + if (testlist == NULL) { + return 1; + } + found = find_test_name(testname); + if ((found && !exclude) || (!found && exclude)) { + return 1; + } + return 0; +} + +static void reset_status(void) +{ + curr_char = 0; +} + +static void update_status(void) +{ + curr_char = (curr_char + 1) % ABTS_STAT_SIZE; + fprintf(stdout, "\b%c", status[curr_char]); + fflush(stdout); +} + +static void end_suite(abts_suite *suite) +{ + if (suite != NULL) { + sub_suite *last = suite->tail; + fprintf(stdout, "\b"); + fflush(stdout); + if (last->failed == 0) { + fprintf(stdout, "SUCCESS\n"); + fflush(stdout); + } + else { + fprintf(stdout, "FAILED %d of %d\n", last->failed, last->num_test); + fflush(stdout); + } + } +} + +abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name) +{ + sub_suite *subsuite; + curr_char = 0; + + /* Only end the suite if we actually ran it */ + if (suite && suite->tail &&!suite->tail->not_run) { + end_suite(suite); + } + + subsuite = malloc(sizeof(*subsuite)); + subsuite->num_test = 0; + subsuite->failed = 0; + subsuite->next = NULL; + subsuite->name = suite_name; + subsuite->not_run = 0; + + if (suite == NULL) { + suite = malloc(sizeof(*suite)); + suite->head = subsuite; + suite->tail = subsuite; + } + else { + suite->tail->next = subsuite; + suite->tail = subsuite; + } + + if (!should_test_run(suite_name)) { + subsuite->not_run = 1; + return suite; + } + + reset_status(); + fprintf(stdout, "%s: %c", suite_name, status[curr_char]); + fflush(stdout); + + return suite; +} + +void abts_run_test(abts_suite *ts, test_func f, void *value) +{ + abts_case *tc; + sub_suite *ss; + + if (!should_test_run(ts->tail->name)) { + return; + } + ss = ts->tail; + + tc = malloc(sizeof(tc)); + tc->failed = 0; + tc->suite = ss; + + ss->num_test++; + update_status(); + + f(tc, value); + + if (tc->failed) { + ss->failed++; + } + free(tc); +} + +static int report(abts_suite *suite) +{ + int return_failed = 0; + sub_suite *dptr; + + if (suite && suite->tail &&!suite->tail->not_run) { + end_suite(suite); + } + + dptr = suite->head; + fprintf(stdout, "%-15s\t\tTotal\tFail\tFailed %%\n", "Failed Tests"); + fprintf(stdout, "===================================================\n"); + while (dptr != NULL) { + if (dptr->failed != 0) { + float percent = ((float)dptr->failed / (float)dptr->num_test); + fprintf(stdout, "%-15s\t\t%5d\t%4d\t%6.2f%%\n", dptr->name, + dptr->num_test, dptr->failed, percent * 100); + return_failed = 1; + } + dptr = dptr->next; + } + return return_failed; +} + +void abts_log_message(const char *fmt, ...) +{ + va_list args; + update_status(); + + if (verbose) { + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); + fprintf(stderr, "\n"); + fflush(stderr); + } +} + +void abts_int_equal(abts_case *tc, const int expected, const int actual) +{ + update_status(); + if (tc->failed) return; + + if (expected == actual) return; + + tc->failed = TRUE; + if (verbose) { + fprintf(stderr, "expected <%d>, but saw <%d>\n", expected, actual); + fflush(stderr); + } +} + +void abts_int_nequal(abts_case *tc, const int expected, const int actual) +{ + update_status(); + if (tc->failed) return; + + if (expected != actual) return; + + tc->failed = TRUE; + if (verbose) { + fprintf(stderr, "expected <%d>, but saw <%d>\n", expected, actual); + fflush(stderr); + } +} + +void abts_str_equal(abts_case *tc, const char *expected, const char *actual) +{ + update_status(); + if (tc->failed) return; + + if (!strcmp(expected, actual)) return; + + tc->failed = TRUE; + if (verbose) { + fprintf(stderr, "expected <%s>, but saw <%s>\n", expected, actual); + fflush(stderr); + } +} + +void abts_str_nequal(abts_case *tc, const char *expected, const char *actual, + size_t n) +{ + update_status(); + if (tc->failed) return; + + if (!strncmp(expected, actual, n)) return; + + tc->failed = TRUE; + if (verbose) { + fprintf(stderr, "expected <%s>, but saw <%s>\n", expected, actual); + fflush(stderr); + } +} + +void abts_ptr_notnull(abts_case *tc, const void *ptr) +{ + update_status(); + if (tc->failed) return; + + if (ptr != NULL) return; + + tc->failed = TRUE; + if (verbose) { + fprintf(stderr, "Expected NULL, but saw <%p>", ptr); + fflush(stderr); + } +} + +void abts_ptr_equal(abts_case *tc, const void *expected, const void *actual) +{ + update_status(); + if (tc->failed) return; + + if (expected == actual) return; + + tc->failed = TRUE; + if (verbose) { + fprintf(stderr, "expected <%p>, but saw <%p>\n", expected, actual); + fflush(stderr); + } +} + +void abts_fail(abts_case *tc, const char *message) +{ + update_status(); + if (tc->failed) return; + + tc->failed = TRUE; + if (verbose) { + fprintf(stderr, "%s\n", message); + fflush(stderr); + } +} + +void abts_assert(abts_case *tc, const char *message, int condition) +{ + update_status(); + if (tc->failed) return; + + if (condition) return; + + tc->failed = TRUE; + if (verbose) { + fprintf(stderr, "%s", message); + fflush(stderr); + } +} + +void abts_true(abts_case *tc, int condition) +{ + update_status(); + if (tc->failed) return; + + if (condition) return; + + tc->failed = TRUE; + if (verbose) { + fprintf(stderr, "Condition is false, but expected true"); + fflush(stderr); + } +} + +void abts_not_impl(abts_case *tc, const char *message) +{ + update_status(); + + tc->suite->not_impl++; + if (verbose) { + fprintf(stderr, "%s", message); + fflush(stderr); + } +} + +int main(int argc, const char *const argv[]) { + int i; + int rv; + int list_provided = 0; + abts_suite *suite = NULL; + + initialize(); + for (i = 1; i < argc; i++) { + if (!strcmp(argv[i], "-v")) { + verbose = 1; + continue; + } + if (!strcmp(argv[i], "-x")) { + exclude = 1; + continue; + } + if (!strcmp(argv[i], "-l")) { + /* print the list. */ + continue; + } + if (argv[i][0] == '-') { + fprintf(stderr, "Invalid option: `%s'\n", argv[i]); + exit(1); + } + list_provided = 1; + } + + if (list_provided) { + /* Waste a little space here, because it is easier than counting the + * number of tests listed. Besides it is at most three char *. + */ + testlist = calloc(0, sizeof(char *) * (argc + 1)); + for (i = 1; i < argc; i++) { + testlist[i - 1] = argv[i]; + } + } + + for (i = 0; i < (sizeof(alltests) / sizeof(struct testlist *)); i++) { + suite = alltests[i].func(suite); + } + + rv = report(suite); + return rv; +} + diff --git a/test/abts.h b/test/abts.h new file mode 100644 index 00000000000..0785402dc1e --- /dev/null +++ b/test/abts.h @@ -0,0 +1,86 @@ +/* Copyright 2000-2004 Ryan Bloom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include + +#ifndef ABTS_H +#define ABTS_H + +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif + +struct sub_suite { + const char *name; + int num_test; + int failed; + int not_run; + int not_impl; + struct sub_suite *next; +}; +typedef struct sub_suite sub_suite; + +struct abts_suite { + sub_suite *head; + sub_suite *tail; +}; +typedef struct abts_suite abts_suite; + +struct abts_case { + int failed; + sub_suite *suite; +}; +typedef struct abts_case abts_case; + +typedef void (*test_func)(abts_case *tc, void *data); + +#define ADD_SUITE(suite) abts_add_suite(suite, __FILE__); + +abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name); +void abts_run_test(abts_suite *ts, test_func f, void *value); +void abts_log_message(const char *fmt, ...); + +void abts_int_equal(abts_case *tc, const int expected, const int actual); +void abts_int_nequal(abts_case *tc, const int expected, const int actual); +void abts_str_equal(abts_case *tc, const char *expected, const char *actual); +void abts_str_nequal(abts_case *tc, const char *expected, const char *actual, + size_t n); +void abts_ptr_notnull(abts_case *tc, const void *ptr); +void abts_ptr_equal(abts_case *tc, const void *expected, const void *actual); +void abts_true(abts_case *tc, int condition); +void abts_fail(abts_case *tc, const char *message); +void abts_not_impl(abts_case *tc, const char *message); +void abts_assert(abts_case *tc, const char *message, int condition); + +abts_suite *run_tests(abts_suite *suite); +abts_suite *run_tests1(abts_suite *suite); + + +#endif + +#ifdef __cplusplus +} +#endif + diff --git a/test/abts_tests.h b/test/abts_tests.h new file mode 100644 index 00000000000..4086fd3fef4 --- /dev/null +++ b/test/abts_tests.h @@ -0,0 +1,69 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_TEST_INCLUDES +#define APR_TEST_INCLUDES + +#include "abts.h" +#include "testutil.h" + +const struct testlist { + abts_suite *(*func)(abts_suite *suite); +} alltests[] = { + {testatomic}, + {testdir}, + {testdso}, + {testdup}, + {testenv}, + {testfile}, + {testfilecopy}, + {testfileinfo}, + {testflock}, + {testfmt}, + {testfnmatch}, + {testgetopt}, + {testglobalmutex}, + {testhash}, + {testipsub}, + {testlock}, + {testlfs}, + {testmmap}, + {testnames}, + {testoc}, + {testpath}, + {testpipe}, + {testpoll}, + {testpool}, + {testproc}, + {testprocmutex}, + {testrand}, + {testrand2}, + {testsleep}, + {testshm}, + {testsock}, + {testsockets}, + {testsockopt}, + {teststr}, + {teststrnatcmp}, + {testtable}, + {testtemp}, + {testthread}, + {testtime}, + {testud}, + {testuser}, + {testvsn} +}; + +#endif /* APR_TEST_INCLUDES */ diff --git a/test/testall.c b/test/testall.c deleted file mode 100644 index ad5d23b94d7..00000000000 --- a/test/testall.c +++ /dev/null @@ -1,177 +0,0 @@ -/* Copyright 2000-2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#include "test_apr.h" - -/* Top-level pool which can be used by tests. */ -apr_pool_t *p; - -void apr_assert_success(CuTest* tc, const char* context, apr_status_t rv) -{ - if (rv == APR_ENOTIMPL) { - CuNotImpl(tc, context); - } - - if (rv != APR_SUCCESS) { - char buf[STRING_MAX], ebuf[128]; - sprintf(buf, "%s (%d): %s\n", context, rv, - apr_strerror(rv, ebuf, sizeof ebuf)); - CuFail(tc, buf); - } -} - -static const struct testlist { - const char *testname; - CuSuite *(*func)(void); -} tests[] = { - {"testargs", testgetopt}, - {"testatomic", testatomic}, - {"testdir", testdir}, - {"testdso", testdso}, - {"testdup", testdup}, - {"testenv", testenv}, - {"testfile", testfile}, - {"testfilecopy", testfilecopy}, - {"testfileinfo", testfileinfo}, - {"testflock", testflock}, - {"testfmt", testfmt}, - {"testfnmatch", testfnmatch}, - {"testglobalmutex", testglobalmutex}, - {"testhash", testhash}, - {"testipsub", testipsub}, - {"testlfs", testlfs}, - {"testlock", testlock}, - {"testmmap", testmmap}, - {"testnames", testnames}, - {"testoc", testoc}, - {"testpath", testpath}, - {"testpipe", testpipe}, - {"testpoll", testpoll}, - {"testpool", testpool}, - {"testproc", testproc}, - {"testprocmutex", testprocmutex}, - {"testrand", testrand}, - {"testrand2", testrand2}, - {"testsleep", testsleep}, - {"testshm", testshm}, - {"testsock", testsock}, - {"testsockets", testsockets}, - {"testsockopt", testsockopt}, - {"teststr", teststr}, - {"teststrnatcmp", teststrnatcmp}, - {"testtable", testtable}, - {"testtemp", testtemp}, - {"testthread", testthread}, - {"testtime", testtime}, - {"testud", testud}, - {"testuser", testuser}, - {"testvsn", testvsn}, - {"LastTest", NULL} -}; - -int main(int argc, char *argv[]) -{ - CuSuiteList *alltests = NULL; - CuString *output = CuStringNew(); - int i; - int exclude = 0; - int list_provided = 0; - - apr_initialize(); - atexit(apr_terminate); - - CuInit(argc, argv); - - apr_pool_create(&p, NULL); - - /* see if we're in exclude mode, see if list of testcases provided */ - for (i = 1; i < argc; i++) { - if (!strcmp(argv[i], "-v")) { - continue; - } - if (!strcmp(argv[i], "-x")) { - exclude = 1; - continue; - } - if (!strcmp(argv[i], "-l")) { - for (i = 0; tests[i].func != NULL; i++) { - printf("%s\n", tests[i].testname); - } - exit(0); - } - if (argv[i][0] == '-') { - fprintf(stderr, "invalid option: `%s'\n", argv[i]); - exit(1); - } - list_provided = 1; - } - - if (!list_provided) { - /* add everything */ - alltests = CuSuiteListNew("All APR Tests"); - for (i = 0; tests[i].func != NULL; i++) { - CuSuiteListAdd(alltests, tests[i].func()); - } - } - else if (exclude) { - /* add everything but the tests listed */ - alltests = CuSuiteListNew("Partial APR Tests"); - for (i = 0; tests[i].func != NULL; i++) { - int this_test_excluded = 0; - int j; - - for (j = 1; j < argc && !this_test_excluded; j++) { - if (!strcmp(argv[j], tests[i].testname)) { - this_test_excluded = 1; - } - } - if (!this_test_excluded) { - CuSuiteListAdd(alltests, tests[i].func()); - } - } - } - else { - /* add only the tests listed */ - alltests = CuSuiteListNew("Partial APR Tests"); - for (i = 1; i < argc; i++) { - int j; - int found = 0; - - if (argv[i][0] == '-') { - continue; - } - for (j = 0; tests[j].func != NULL; j++) { - if (!strcmp(argv[i], tests[j].testname)) { - CuSuiteListAdd(alltests, tests[j].func()); - found = 1; - } - } - if (!found) { - fprintf(stderr, "invalid test name: `%s'\n", argv[i]); - exit(1); - } - } - } - - CuSuiteListRunWithSummary(alltests); - i = CuSuiteListDetails(alltests, output); - printf("%s\n", output->buffer); - - return i > 0 ? 1 : 0; -} - diff --git a/test/testargs.c b/test/testargs.c index a3dc4416f33..2c8205ec8e6 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -17,7 +17,7 @@ #include "apr_general.h" #include "apr_getopt.h" #include "apr_strings.h" -#include "test_apr.h" +#include "testutil.h" static void format_arg(char *str, char option, const char *arg) { @@ -38,176 +38,176 @@ static void unknown_arg(void *str, const char *err, ...) va_end(va); } -static void no_options_found(CuTest *tc) +static void no_options_found(abts_case *tc, void *data) { int largc = 5; const char * const largv[] = {"testprog", "-a", "-b", "-c", "-d"}; apr_getopt_t *opt; apr_status_t rv; - char data; + char ch; const char *optarg; char str[8196]; str[0] = '\0'; rv = apr_getopt_init(&opt, p, largc, largv); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); - while (apr_getopt(opt, "abcd", &data, &optarg) == APR_SUCCESS) { - switch (data) { + while (apr_getopt(opt, "abcd", &ch, &optarg) == APR_SUCCESS) { + switch (ch) { case 'a': case 'b': case 'c': case 'd': default: - format_arg(str, data, optarg); + format_arg(str, ch, optarg); } } - CuAssertStrEquals(tc, "option: a\n" + abts_str_equal(tc, "option: a\n" "option: b\n" "option: c\n" "option: d\n", str); } -static void no_options(CuTest *tc) +static void no_options(abts_case *tc, void *data) { int largc = 5; const char * const largv[] = {"testprog", "-a", "-b", "-c", "-d"}; apr_getopt_t *opt; apr_status_t rv; - char data; + char ch; const char *optarg; char str[8196]; str[0] = '\0'; rv = apr_getopt_init(&opt, p, largc, largv); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "efgh", &data, &optarg) == APR_SUCCESS) { - switch (data) { + while (apr_getopt(opt, "efgh", &ch, &optarg) == APR_SUCCESS) { + switch (ch) { case 'a': case 'b': case 'c': case 'd': - format_arg(str, data, optarg); + format_arg(str, ch, optarg); break; default: break; } } - CuAssertStrEquals(tc, "testprog: illegal option -- a\n", str); + abts_str_equal(tc, "testprog: illegal option -- a\n", str); } -static void required_option(CuTest *tc) +static void required_option(abts_case *tc, void *data) { int largc = 3; const char * const largv[] = {"testprog", "-a", "foo"}; apr_getopt_t *opt; apr_status_t rv; - char data; + char ch; const char *optarg; char str[8196]; str[0] = '\0'; rv = apr_getopt_init(&opt, p, largc, largv); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "a:", &data, &optarg) == APR_SUCCESS) { - switch (data) { + while (apr_getopt(opt, "a:", &ch, &optarg) == APR_SUCCESS) { + switch (ch) { case 'a': - format_arg(str, data, optarg); + format_arg(str, ch, optarg); break; default: break; } } - CuAssertStrEquals(tc, "option: a with foo\n", str); + abts_str_equal(tc, "option: a with foo\n", str); } -static void required_option_notgiven(CuTest *tc) +static void required_option_notgiven(abts_case *tc, void *data) { int largc = 2; const char * const largv[] = {"testprog", "-a"}; apr_getopt_t *opt; apr_status_t rv; - char data; + char ch; const char *optarg; char str[8196]; str[0] = '\0'; rv = apr_getopt_init(&opt, p, largc, largv); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "a:", &data, &optarg) == APR_SUCCESS) { - switch (data) { + while (apr_getopt(opt, "a:", &ch, &optarg) == APR_SUCCESS) { + switch (ch) { case 'a': - format_arg(str, data, optarg); + format_arg(str, ch, optarg); break; default: break; } } - CuAssertStrEquals(tc, "testprog: option requires an argument -- a\n", str); + abts_str_equal(tc, "testprog: option requires an argument -- a\n", str); } -static void optional_option(CuTest *tc) +static void optional_option(abts_case *tc, void *data) { int largc = 3; const char * const largv[] = {"testprog", "-a", "foo"}; apr_getopt_t *opt; apr_status_t rv; - char data; + char ch; const char *optarg; char str[8196]; str[0] = '\0'; rv = apr_getopt_init(&opt, p, largc, largv); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "a::", &data, &optarg) == APR_SUCCESS) { - switch (data) { + while (apr_getopt(opt, "a::", &ch, &optarg) == APR_SUCCESS) { + switch (ch) { case 'a': - format_arg(str, data, optarg); + format_arg(str, ch, optarg); break; default: break; } } - CuAssertStrEquals(tc, "option: a with foo\n", str); + abts_str_equal(tc, "option: a with foo\n", str); } -static void optional_option_notgiven(CuTest *tc) +static void optional_option_notgiven(abts_case *tc, void *data) { int largc = 2; const char * const largv[] = {"testprog", "-a"}; apr_getopt_t *opt; apr_status_t rv; - char data; + char ch; const char *optarg; char str[8196]; str[0] = '\0'; rv = apr_getopt_init(&opt, p, largc, largv); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "a::", &data, &optarg) == APR_SUCCESS) { - switch (data) { + while (apr_getopt(opt, "a::", &ch, &optarg) == APR_SUCCESS) { + switch (ch) { case 'a': - format_arg(str, data, optarg); + format_arg(str, ch, optarg); break; default: break; @@ -215,21 +215,21 @@ static void optional_option_notgiven(CuTest *tc) } #if 0 /* Our version of getopt doesn't allow for optional arguments. */ - CuAssertStrEquals(tc, "option: a\n", str); + abts_str_equal(tc, "option: a\n", str); #endif - CuAssertStrEquals(tc, "testprog: option requires an argument -- a\n", str); + abts_str_equal(tc, "testprog: option requires an argument -- a\n", str); } -CuSuite *testgetopt(void) +abts_suite *testgetopt(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Getopt"); - - SUITE_ADD_TEST(suite, no_options); - SUITE_ADD_TEST(suite, no_options_found); - SUITE_ADD_TEST(suite, required_option); - SUITE_ADD_TEST(suite, required_option_notgiven); - SUITE_ADD_TEST(suite, optional_option); - SUITE_ADD_TEST(suite, optional_option_notgiven); + suite = ADD_SUITE(suite) + + abts_run_test(suite, no_options, NULL); + abts_run_test(suite, no_options_found, NULL); + abts_run_test(suite, required_option, NULL); + abts_run_test(suite, required_option_notgiven, NULL); + abts_run_test(suite, optional_option, NULL); + abts_run_test(suite, optional_option_notgiven, NULL); return suite; } diff --git a/test/testatomic.c b/test/testatomic.c index ccd33d416fe..86f58f3b7d8 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr_strings.h" #include "apr_thread_proc.h" #include "apr_errno.h" @@ -33,26 +33,26 @@ #include #endif -static void test_init(CuTest *tc) +static void test_init(abts_case *tc, void *data) { apr_assert_success(tc, "Could not initliaze atomics", apr_atomic_init(p)); } -static void test_set32(CuTest *tc) +static void test_set32(abts_case *tc, void *data) { apr_uint32_t y32; apr_atomic_set32(&y32, 2); - CuAssertIntEquals(tc, 2, y32); + abts_int_equal(tc, 2, y32); } -static void test_read32(CuTest *tc) +static void test_read32(abts_case *tc, void *data) { apr_uint32_t y32; apr_atomic_set32(&y32, 2); - CuAssertIntEquals(tc, 2, apr_atomic_read32(&y32)); + abts_int_equal(tc, 2, apr_atomic_read32(&y32)); } -static void test_dec32(CuTest *tc) +static void test_dec32(abts_case *tc, void *data) { apr_uint32_t y32; int rv; @@ -60,15 +60,15 @@ static void test_dec32(CuTest *tc) apr_atomic_set32(&y32, 2); rv = apr_atomic_dec32(&y32); - CuAssertIntEquals(tc, 1, y32); - CuAssert(tc, "atomic_dec returned zero when it shouldn't", rv != 0); + abts_int_equal(tc, 1, y32); + abts_assert(tc, "atomic_dec returned zero when it shouldn't", rv != 0); rv = apr_atomic_dec32(&y32); - CuAssertIntEquals(tc, 0, y32); - CuAssert(tc, "atomic_dec didn't returned zero when it should", rv == 0); + abts_int_equal(tc, 0, y32); + abts_assert(tc, "atomic_dec didn't returned zero when it should", rv == 0); } -static void test_xchg32(CuTest *tc) +static void test_xchg32(abts_case *tc, void *data) { apr_uint32_t oldval; apr_uint32_t y32; @@ -76,63 +76,63 @@ static void test_xchg32(CuTest *tc) apr_atomic_set32(&y32, 100); oldval = apr_atomic_xchg32(&y32, 50); - CuAssertIntEquals(tc, 100, oldval); - CuAssertIntEquals(tc, 50, y32); + abts_int_equal(tc, 100, oldval); + abts_int_equal(tc, 50, y32); } -static void test_cas_equal(CuTest *tc) +static void test_cas_equal(abts_case *tc, void *data) { apr_uint32_t casval = 0; apr_uint32_t oldval; oldval = apr_atomic_cas32(&casval, 12, 0); - CuAssertIntEquals(tc, 0, oldval); - CuAssertIntEquals(tc, 12, casval); + abts_int_equal(tc, 0, oldval); + abts_int_equal(tc, 12, casval); } -static void test_cas_equal_nonnull(CuTest *tc) +static void test_cas_equal_nonnull(abts_case *tc, void *data) { apr_uint32_t casval = 12; apr_uint32_t oldval; oldval = apr_atomic_cas32(&casval, 23, 12); - CuAssertIntEquals(tc, 12, oldval); - CuAssertIntEquals(tc, 23, casval); + abts_int_equal(tc, 12, oldval); + abts_int_equal(tc, 23, casval); } -static void test_cas_notequal(CuTest *tc) +static void test_cas_notequal(abts_case *tc, void *data) { apr_uint32_t casval = 12; apr_uint32_t oldval; oldval = apr_atomic_cas32(&casval, 23, 2); - CuAssertIntEquals(tc, 12, oldval); - CuAssertIntEquals(tc, 12, casval); + abts_int_equal(tc, 12, oldval); + abts_int_equal(tc, 12, casval); } -static void test_add32(CuTest *tc) +static void test_add32(abts_case *tc, void *data) { apr_uint32_t oldval; apr_uint32_t y32; apr_atomic_set32(&y32, 23); oldval = apr_atomic_add32(&y32, 4); - CuAssertIntEquals(tc, 23, oldval); - CuAssertIntEquals(tc, 27, y32); + abts_int_equal(tc, 23, oldval); + abts_int_equal(tc, 27, y32); } -static void test_inc32(CuTest *tc) +static void test_inc32(abts_case *tc, void *data) { apr_uint32_t oldval; apr_uint32_t y32; apr_atomic_set32(&y32, 23); oldval = apr_atomic_inc32(&y32); - CuAssertIntEquals(tc, 23, oldval); - CuAssertIntEquals(tc, 24, y32); + abts_int_equal(tc, 23, oldval); + abts_int_equal(tc, 24, y32); } -static void test_set_add_inc_sub(CuTest *tc) +static void test_set_add_inc_sub(abts_case *tc, void *data) { apr_uint32_t y32; @@ -141,10 +141,10 @@ static void test_set_add_inc_sub(CuTest *tc) apr_atomic_inc32(&y32); apr_atomic_sub32(&y32, 10); - CuAssertIntEquals(tc, 11, y32); + abts_int_equal(tc, 11, y32); } -static void test_wrap_zero(CuTest *tc) +static void test_wrap_zero(abts_case *tc, void *data) { apr_uint32_t y32; apr_uint32_t rv; @@ -154,12 +154,12 @@ static void test_wrap_zero(CuTest *tc) apr_atomic_set32(&y32, 0); rv = apr_atomic_dec32(&y32); - CuAssert(tc, "apr_atomic_dec32 on zero returned zero.", rv != 0); + abts_assert(tc, "apr_atomic_dec32 on zero returned zero.", rv != 0); str = apr_psprintf(p, "zero wrap failed: 0 - 1 = %d", y32); - CuAssert(tc, str, y32 == minus1); + abts_assert(tc, str, y32 == minus1); } -static void test_inc_neg1(CuTest *tc) +static void test_inc_neg1(abts_case *tc, void *data) { apr_uint32_t y32 = -1; apr_uint32_t minus1 = -1; @@ -168,9 +168,9 @@ static void test_inc_neg1(CuTest *tc) rv = apr_atomic_inc32(&y32); - CuAssert(tc, "apr_atomic_dec32 on zero returned zero.", rv == minus1); + abts_assert(tc, "apr_atomic_dec32 on zero returned zero.", rv == minus1); str = apr_psprintf(p, "zero wrap failed: -1 + 1 = %d", y32); - CuAssert(tc, str, y32 == 0); + abts_assert(tc, str, y32 == 0); } @@ -226,7 +226,7 @@ void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data) return NULL; } -static void test_atomics_threaded(CuTest *tc) +static void test_atomics_threaded(abts_case *tc, void *data) { apr_thread_t *t1[NUM_THREADS]; apr_thread_t *t2[NUM_THREADS]; @@ -249,7 +249,7 @@ static void test_atomics_threaded(CuTest *tc) r1 = apr_thread_create(&t1[i], NULL, thread_func_mutex, NULL, p); r2 = apr_thread_create(&t2[i], NULL, thread_func_atomic, NULL, p); r3 = apr_thread_create(&t3[i], NULL, thread_func_none, NULL, p); - CuAssert(tc, "Failed creating threads", + abts_assert(tc, "Failed creating threads", r1 == APR_SUCCESS && r2 == APR_SUCCESS && r3 == APR_SUCCESS); } @@ -259,17 +259,17 @@ static void test_atomics_threaded(CuTest *tc) apr_thread_join(&s2[i], t2[i]); apr_thread_join(&s3[i], t3[i]); - CuAssert(tc, "Invalid return value from thread_join", + abts_assert(tc, "Invalid return value from thread_join", s1[i] == exit_ret_val && s2[i] == exit_ret_val && s3[i] == exit_ret_val); } - CuAssertIntEquals(tc, x, NUM_THREADS * NUM_ITERATIONS); - CuAssertIntEquals(tc, apr_atomic_read32(&y), NUM_THREADS * NUM_ITERATIONS); + abts_int_equal(tc, x, NUM_THREADS * NUM_ITERATIONS); + abts_int_equal(tc, apr_atomic_read32(&y), NUM_THREADS * NUM_ITERATIONS); /* Comment out this test, because I have no clue what this test is * actually telling us. We are checking something that may or may not * be true, and it isn't really testing APR at all. - CuAssert(tc, "We expect this to fail, because we tried to update " + abts_assert(tc, "We expect this to fail, because we tried to update " "an integer in a non-thread-safe manner.", z != NUM_THREADS * NUM_ITERATIONS); */ @@ -277,26 +277,26 @@ static void test_atomics_threaded(CuTest *tc) #endif /* !APR_HAS_THREADS */ -CuSuite *testatomic(void) +abts_suite *testatomic(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Atomic"); - - SUITE_ADD_TEST(suite, test_init); - SUITE_ADD_TEST(suite, test_set32); - SUITE_ADD_TEST(suite, test_read32); - SUITE_ADD_TEST(suite, test_dec32); - SUITE_ADD_TEST(suite, test_xchg32); - SUITE_ADD_TEST(suite, test_cas_equal); - SUITE_ADD_TEST(suite, test_cas_equal_nonnull); - SUITE_ADD_TEST(suite, test_cas_notequal); - SUITE_ADD_TEST(suite, test_add32); - SUITE_ADD_TEST(suite, test_inc32); - SUITE_ADD_TEST(suite, test_set_add_inc_sub); - SUITE_ADD_TEST(suite, test_wrap_zero); - SUITE_ADD_TEST(suite, test_inc_neg1); + suite = ADD_SUITE(suite) + + abts_run_test(suite, test_init, NULL); + abts_run_test(suite, test_set32, NULL); + abts_run_test(suite, test_read32, NULL); + abts_run_test(suite, test_dec32, NULL); + abts_run_test(suite, test_xchg32, NULL); + abts_run_test(suite, test_cas_equal, NULL); + abts_run_test(suite, test_cas_equal_nonnull, NULL); + abts_run_test(suite, test_cas_notequal, NULL); + abts_run_test(suite, test_add32, NULL); + abts_run_test(suite, test_inc32, NULL); + abts_run_test(suite, test_set_add_inc_sub, NULL); + abts_run_test(suite, test_wrap_zero, NULL); + abts_run_test(suite, test_inc_neg1, NULL); #if APR_HAS_THREADS - SUITE_ADD_TEST(suite, test_atomics_threaded); + abts_run_test(suite, test_atomics_threaded, NULL); #endif return suite; diff --git a/test/testdir.c b/test/testdir.c index 09c41802282..b9a5bb2e415 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -21,130 +21,130 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" -#include "test_apr.h" +#include "testutil.h" -static void test_mkdir(CuTest *tc) +static void test_mkdir(abts_case *tc, void *data) { apr_status_t rv; apr_finfo_t finfo; rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, APR_DIR, finfo.filetype); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_DIR, finfo.filetype); } -static void test_mkdir_recurs(CuTest *tc) +static void test_mkdir_recurs(abts_case *tc, void *data) { apr_status_t rv; apr_finfo_t finfo; rv = apr_dir_make_recursive("data/one/two/three", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, "data/one", APR_FINFO_TYPE, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, APR_DIR, finfo.filetype); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_DIR, finfo.filetype); rv = apr_stat(&finfo, "data/one/two", APR_FINFO_TYPE, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, APR_DIR, finfo.filetype); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_DIR, finfo.filetype); rv = apr_stat(&finfo, "data/one/two/three", APR_FINFO_TYPE, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, APR_DIR, finfo.filetype); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_DIR, finfo.filetype); } -static void test_remove(CuTest *tc) +static void test_remove(abts_case *tc, void *data) { apr_status_t rv; apr_finfo_t finfo; rv = apr_dir_remove("data/testdir", p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); } -static void test_removeall_fail(CuTest *tc) +static void test_removeall_fail(abts_case *tc, void *data) { apr_status_t rv; rv = apr_dir_remove("data/one", p); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv)); } -static void test_removeall(CuTest *tc) +static void test_removeall(abts_case *tc, void *data) { apr_status_t rv; rv = apr_dir_remove("data/one/two/three", p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_dir_remove("data/one/two", p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_dir_remove("data/one", p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } -static void test_remove_notthere(CuTest *tc) +static void test_remove_notthere(abts_case *tc, void *data) { apr_status_t rv; rv = apr_dir_remove("data/notthere", p); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); } -static void test_mkdir_twice(CuTest *tc) +static void test_mkdir_twice(abts_case *tc, void *data) { apr_status_t rv; rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_EEXIST(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_EEXIST(rv)); rv = apr_dir_remove("data/testdir", p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } -static void test_opendir(CuTest *tc) +static void test_opendir(abts_case *tc, void *data) { apr_status_t rv; apr_dir_t *dir; rv = apr_dir_open(&dir, "data", p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); apr_dir_close(dir); } -static void test_opendir_notthere(CuTest *tc) +static void test_opendir_notthere(abts_case *tc, void *data) { apr_status_t rv; apr_dir_t *dir; rv = apr_dir_open(&dir, "notthere", p); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); } -static void test_closedir(CuTest *tc) +static void test_closedir(abts_case *tc, void *data) { apr_status_t rv; apr_dir_t *dir; rv = apr_dir_open(&dir, "data", p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_dir_close(dir); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } -static void test_rewind(CuTest *tc) +static void test_rewind(abts_case *tc, void *data) { apr_dir_t *dir; apr_finfo_t first, second; @@ -161,12 +161,12 @@ static void test_rewind(CuTest *tc) apr_assert_success(tc, "apr_dir_close failed", apr_dir_close(dir)); - CuAssertStrEquals(tc, first.name, second.name); + abts_str_equal(tc, first.name, second.name); } /* Test for a (fixed) bug in apr_dir_read(). This bug only happened in threadless cases. */ -static void test_uncleared_errno(CuTest *tc) +static void test_uncleared_errno(abts_case *tc, void *data) { apr_file_t *thefile = NULL; apr_finfo_t finfo; @@ -175,67 +175,67 @@ static void test_uncleared_errno(CuTest *tc) apr_status_t rv; rv = apr_dir_make("dir1", APR_OS_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_dir_make("dir2", APR_OS_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_open(&thefile, "dir1/file1", APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_close(thefile); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); /* Try to remove dir1. This should fail because it's not empty. However, on a platform with threads disabled (such as FreeBSD), `errno' will be set as a result. */ rv = apr_dir_remove("dir1", p); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv)); /* Read `.' and `..' out of dir2. */ rv = apr_dir_open(&this_dir, "dir2", p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_dir_read(&finfo, finfo_flags, this_dir); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_dir_read(&finfo, finfo_flags, this_dir); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); /* Now, when we attempt to do a third read of empty dir2, and the underlying system readdir() returns NULL, the old value of errno shouldn't cause a false alarm. We should get an ENOENT back from apr_dir_read, and *not* the old errno. */ rv = apr_dir_read(&finfo, finfo_flags, this_dir); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); rv = apr_dir_close(this_dir); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); /* Cleanup */ rv = apr_file_remove("dir1/file1", p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_dir_remove("dir1", p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_dir_remove("dir2", p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } -CuSuite *testdir(void) +abts_suite *testdir(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Directory"); - - SUITE_ADD_TEST(suite, test_mkdir); - SUITE_ADD_TEST(suite, test_mkdir_recurs); - SUITE_ADD_TEST(suite, test_remove); - SUITE_ADD_TEST(suite, test_removeall_fail); - SUITE_ADD_TEST(suite, test_removeall); - SUITE_ADD_TEST(suite, test_remove_notthere); - SUITE_ADD_TEST(suite, test_mkdir_twice); - - SUITE_ADD_TEST(suite, test_rewind); - - SUITE_ADD_TEST(suite, test_opendir); - SUITE_ADD_TEST(suite, test_opendir_notthere); - SUITE_ADD_TEST(suite, test_closedir); - SUITE_ADD_TEST(suite, test_uncleared_errno); + suite = ADD_SUITE(suite) + + abts_run_test(suite, test_mkdir, NULL); + abts_run_test(suite, test_mkdir_recurs, NULL); + abts_run_test(suite, test_remove, NULL); + abts_run_test(suite, test_removeall_fail, NULL); + abts_run_test(suite, test_removeall, NULL); + abts_run_test(suite, test_remove_notthere, NULL); + abts_run_test(suite, test_mkdir_twice, NULL); + + abts_run_test(suite, test_rewind, NULL); + + abts_run_test(suite, test_opendir, NULL); + abts_run_test(suite, test_opendir_notthere, NULL); + abts_run_test(suite, test_closedir, NULL); + abts_run_test(suite, test_uncleared_errno, NULL); return suite; } diff --git a/test/testdso.c b/test/testdso.c index 1316821da92..7b466daaf4d 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -14,7 +14,7 @@ */ -#include "test_apr.h" +#include "testutil.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_errno.h" @@ -47,20 +47,20 @@ static char *modname; -static void test_load_module(CuTest *tc) +static void test_load_module(abts_case *tc, void *data) { apr_dso_handle_t *h = NULL; apr_status_t status; char errstr[256]; status = apr_dso_load(&h, modname, p); - CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - CuAssertPtrNotNull(tc, h); + abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + abts_ptr_notnull(tc, h); apr_dso_unload(h); } -static void test_dso_sym(CuTest *tc) +static void test_dso_sym(abts_case *tc, void *data) { apr_dso_handle_t *h = NULL; apr_dso_handle_sym_t func1 = NULL; @@ -70,21 +70,21 @@ static void test_dso_sym(CuTest *tc) char errstr[256]; status = apr_dso_load(&h, modname, p); - CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - CuAssertPtrNotNull(tc, h); + abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + abts_ptr_notnull(tc, h); status = apr_dso_sym(&func1, h, "print_hello"); - CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - CuAssertPtrNotNull(tc, func1); + abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + abts_ptr_notnull(tc, func1); function = (void (*)(char *))func1; (*function)(teststr); - CuAssertStrEquals(tc, "Hello - I'm a DSO!\n", teststr); + abts_str_equal(tc, "Hello - I'm a DSO!\n", teststr); apr_dso_unload(h); } -static void test_dso_sym_return_value(CuTest *tc) +static void test_dso_sym_return_value(abts_case *tc, void *data) { apr_dso_handle_t *h = NULL; apr_dso_handle_sym_t func1 = NULL; @@ -93,21 +93,21 @@ static void test_dso_sym_return_value(CuTest *tc) char errstr[256]; status = apr_dso_load(&h, modname, p); - CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - CuAssertPtrNotNull(tc, h); + abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + abts_ptr_notnull(tc, h); status = apr_dso_sym(&func1, h, "count_reps"); - CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - CuAssertPtrNotNull(tc, func1); + abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + abts_ptr_notnull(tc, func1); function = (int (*)(int))func1; status = (*function)(5); - CuAssertIntEquals(tc, 5, status); + abts_int_equal(tc, 5, status); apr_dso_unload(h); } -static void test_unload_module(CuTest *tc) +static void test_unload_module(abts_case *tc, void *data) { apr_dso_handle_t *h = NULL; apr_status_t status; @@ -115,34 +115,34 @@ static void test_unload_module(CuTest *tc) apr_dso_handle_sym_t func1 = NULL; status = apr_dso_load(&h, modname, p); - CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - CuAssertPtrNotNull(tc, h); + abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + abts_ptr_notnull(tc, h); status = apr_dso_unload(h); - CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); status = apr_dso_sym(&func1, h, "print_hello"); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status)); + abts_int_equal(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status)); } #ifdef LIB_NAME static char *libname; -static void test_load_library(CuTest *tc) +static void test_load_library(abts_case *tc, void *data) { apr_dso_handle_t *h = NULL; apr_status_t status; char errstr[256]; status = apr_dso_load(&h, libname, p); - CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - CuAssertPtrNotNull(tc, h); + abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + abts_ptr_notnull(tc, h); apr_dso_unload(h); } -static void test_dso_sym_library(CuTest *tc) +static void test_dso_sym_library(abts_case *tc, void *data) { apr_dso_handle_t *h = NULL; apr_dso_handle_sym_t func1 = NULL; @@ -152,21 +152,21 @@ static void test_dso_sym_library(CuTest *tc) char errstr[256]; status = apr_dso_load(&h, libname, p); - CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - CuAssertPtrNotNull(tc, h); + abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + abts_ptr_notnull(tc, h); status = apr_dso_sym(&func1, h, "print_hello"); - CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - CuAssertPtrNotNull(tc, func1); + abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + abts_ptr_notnull(tc, func1); function = (void (*)(char *))func1; (*function)(teststr); - CuAssertStrEquals(tc, "Hello - I'm a DSO!\n", teststr); + abts_str_equal(tc, "Hello - I'm a DSO!\n", teststr); apr_dso_unload(h); } -static void test_dso_sym_return_value_library(CuTest *tc) +static void test_dso_sym_return_value_library(abts_case *tc, void *data) { apr_dso_handle_t *h = NULL; apr_dso_handle_sym_t func1 = NULL; @@ -175,21 +175,21 @@ static void test_dso_sym_return_value_library(CuTest *tc) char errstr[256]; status = apr_dso_load(&h, libname, p); - CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - CuAssertPtrNotNull(tc, h); + abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + abts_ptr_notnull(tc, h); status = apr_dso_sym(&func1, h, "count_reps"); - CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - CuAssertPtrNotNull(tc, func1); + abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + abts_ptr_notnull(tc, func1); function = (int (*)(int))func1; status = (*function)(5); - CuAssertIntEquals(tc, 5, status); + abts_int_equal(tc, 5, status); apr_dso_unload(h); } -static void test_unload_library(CuTest *tc) +static void test_unload_library(abts_case *tc, void *data) { apr_dso_handle_t *h = NULL; apr_status_t status; @@ -197,57 +197,57 @@ static void test_unload_library(CuTest *tc) apr_dso_handle_sym_t func1 = NULL; status = apr_dso_load(&h, libname, p); - CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - CuAssertPtrNotNull(tc, h); + abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + abts_ptr_notnull(tc, h); status = apr_dso_unload(h); - CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); status = apr_dso_sym(&func1, h, "print_hello"); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status)); + abts_int_equal(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status)); } #endif /* def(LIB_NAME) */ -static void test_load_notthere(CuTest *tc) +static void test_load_notthere(abts_case *tc, void *data) { apr_dso_handle_t *h = NULL; apr_status_t status; status = apr_dso_load(&h, "No_File.so", p); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_EDSOOPEN(status)); - CuAssertPtrNotNull(tc, h); + abts_int_equal(tc, 1, APR_STATUS_IS_EDSOOPEN(status)); + abts_ptr_notnull(tc, h); } #endif /* APR_HAS_DSO */ -CuSuite *testdso(void) +abts_suite *testdso(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("DSO"); + suite = ADD_SUITE(suite) #if APR_HAS_DSO modname = apr_pcalloc(p, 256); getcwd(modname, 256); modname = apr_pstrcat(p, modname, "/", MOD_NAME, NULL); - SUITE_ADD_TEST(suite, test_load_module); - SUITE_ADD_TEST(suite, test_dso_sym); - SUITE_ADD_TEST(suite, test_dso_sym_return_value); - SUITE_ADD_TEST(suite, test_unload_module); + abts_run_test(suite, test_load_module, NULL); + abts_run_test(suite, test_dso_sym, NULL); + abts_run_test(suite, test_dso_sym_return_value, NULL); + abts_run_test(suite, test_unload_module, NULL); #ifdef LIB_NAME libname = apr_pcalloc(p, 256); getcwd(libname, 256); libname = apr_pstrcat(p, libname, "/", LIB_NAME, NULL); - SUITE_ADD_TEST(suite, test_load_library); - SUITE_ADD_TEST(suite, test_dso_sym_library); - SUITE_ADD_TEST(suite, test_dso_sym_return_value_library); - SUITE_ADD_TEST(suite, test_unload_library); + abts_run_test(suite, test_load_library, NULL); + abts_run_test(suite, test_dso_sym_library, NULL); + abts_run_test(suite, test_dso_sym_return_value_library, NULL); + abts_run_test(suite, test_unload_library, NULL); #endif - SUITE_ADD_TEST(suite, test_load_notthere); + abts_run_test(suite, test_load_notthere, NULL); #endif /* APR_HAS_DSO */ return suite; diff --git a/test/testdup.c b/test/testdup.c index 166164f548c..acf830ce4f9 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -18,13 +18,13 @@ #include "apr_pools.h" #include "apr_errno.h" #include "apr_file_io.h" -#include "test_apr.h" +#include "testutil.h" #define TEST "Testing\n" #define TEST2 "Testing again\n" #define FILEPATH "data/" -static void test_file_dup(CuTest *tc) +static void test_file_dup(abts_case *tc, void *data) { apr_file_t *file1 = NULL; apr_file_t *file3 = NULL; @@ -35,24 +35,24 @@ static void test_file_dup(CuTest *tc) rv = apr_file_open(&file1, FILEPATH "testdup.file", APR_READ | APR_WRITE | APR_CREATE | APR_DELONCLOSE, APR_OS_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, file1); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, file1); rv = apr_file_dup(&file3, file1, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, file3); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, file3); rv = apr_file_close(file1); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); /* cleanup after ourselves */ rv = apr_file_close(file3); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, FILEPATH "testdup.file", APR_FINFO_NORM, p); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); } -static void test_file_readwrite(CuTest *tc) +static void test_file_readwrite(abts_case *tc, void *data) { apr_file_t *file1 = NULL; apr_file_t *file3 = NULL; @@ -66,38 +66,38 @@ static void test_file_readwrite(CuTest *tc) rv = apr_file_open(&file1, FILEPATH "testdup.readwrite.file", APR_READ | APR_WRITE | APR_CREATE | APR_DELONCLOSE, APR_OS_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, file1); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, file1); rv = apr_file_dup(&file3, file1, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, file3); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, file3); rv = apr_file_write(file3, TEST, &txtlen); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, sizeof(TEST), txtlen); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, sizeof(TEST), txtlen); fpos = 0; rv = apr_file_seek(file1, APR_SET, &fpos); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 0, fpos); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 0, fpos); txtlen = 50; rv = apr_file_read(file1, buff, &txtlen); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, TEST, buff); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, TEST, buff); /* cleanup after ourselves */ rv = apr_file_close(file1); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_close(file3); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, FILEPATH "testdup.readwrite.file", APR_FINFO_NORM, p); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); } -static void test_dup2(CuTest *tc) +static void test_dup2(abts_case *tc, void *data) { apr_file_t *testfile = NULL; apr_file_t *errfile = NULL; @@ -107,29 +107,29 @@ static void test_dup2(CuTest *tc) rv = apr_file_open(&testfile, FILEPATH "testdup2.file", APR_READ | APR_WRITE | APR_CREATE | APR_DELONCLOSE, APR_OS_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, testfile); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, testfile); rv = apr_file_open_stderr(&errfile, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); /* Set aside the real errfile */ rv = apr_file_dup(&saveerr, errfile, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, saveerr); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, saveerr); rv = apr_file_dup2(errfile, testfile, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, errfile); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, errfile); apr_file_close(testfile); rv = apr_file_dup2(errfile, saveerr, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, errfile); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, errfile); } -static void test_dup2_readwrite(CuTest *tc) +static void test_dup2_readwrite(abts_case *tc, void *data) { apr_file_t *errfile = NULL; apr_file_t *testfile = NULL; @@ -142,51 +142,51 @@ static void test_dup2_readwrite(CuTest *tc) rv = apr_file_open(&testfile, FILEPATH "testdup2.readwrite.file", APR_READ | APR_WRITE | APR_CREATE | APR_DELONCLOSE, APR_OS_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, testfile); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, testfile); rv = apr_file_open_stderr(&errfile, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); /* Set aside the real errfile */ rv = apr_file_dup(&saveerr, errfile, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, saveerr); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, saveerr); rv = apr_file_dup2(errfile, testfile, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, errfile); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, errfile); txtlen = sizeof(TEST2); rv = apr_file_write(errfile, TEST2, &txtlen); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, sizeof(TEST2), txtlen); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, sizeof(TEST2), txtlen); fpos = 0; rv = apr_file_seek(testfile, APR_SET, &fpos); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 0, fpos); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 0, fpos); txtlen = 50; rv = apr_file_read(testfile, buff, &txtlen); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, TEST2, buff); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, TEST2, buff); apr_file_close(testfile); rv = apr_file_dup2(errfile, saveerr, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, errfile); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, errfile); } -CuSuite *testdup(void) +abts_suite *testdup(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("File duplication"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, test_file_dup); - SUITE_ADD_TEST(suite, test_file_readwrite); - SUITE_ADD_TEST(suite, test_dup2); - SUITE_ADD_TEST(suite, test_dup2_readwrite); + abts_run_test(suite, test_file_dup, NULL); + abts_run_test(suite, test_file_readwrite, NULL); + abts_run_test(suite, test_dup2, NULL); + abts_run_test(suite, test_dup2_readwrite, NULL); return suite; } diff --git a/test/testenv.c b/test/testenv.c index 07a2d59c873..348a4987cad 100644 --- a/test/testenv.c +++ b/test/testenv.c @@ -15,7 +15,7 @@ #include "apr_env.h" #include "apr_errno.h" -#include "test_apr.h" +#include "testutil.h" #define TEST_ENVVAR_NAME "apr_test_envvar" #define TEST_ENVVAR_VALUE "Just a value that we'll check" @@ -23,65 +23,65 @@ static int have_env_set; static int have_env_get; -static void test_setenv(CuTest *tc) +static void test_setenv(abts_case *tc, void *data) { apr_status_t rv; rv = apr_env_set(TEST_ENVVAR_NAME, TEST_ENVVAR_VALUE, p); have_env_set = (rv != APR_ENOTIMPL); if (!have_env_set) { - CuNotImpl(tc, "apr_env_set"); + abts_not_impl(tc, "apr_env_set"); } apr_assert_success(tc, "set environment variable", rv); } -static void test_getenv(CuTest *tc) +static void test_getenv(abts_case *tc, void *data) { char *value; apr_status_t rv; if (!have_env_set) { - CuNotImpl(tc, "apr_env_set (skip test for apr_env_get)"); + abts_not_impl(tc, "apr_env_set (skip test for apr_env_get)"); } rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); have_env_get = (rv != APR_ENOTIMPL); if (!have_env_get) { - CuNotImpl(tc, "apr_env_get"); + abts_not_impl(tc, "apr_env_get"); } apr_assert_success(tc, "get environment variable", rv); - CuAssertStrEquals(tc, TEST_ENVVAR_VALUE, value); + abts_str_equal(tc, TEST_ENVVAR_VALUE, value); } -static void test_delenv(CuTest *tc) +static void test_delenv(abts_case *tc, void *data) { char *value; apr_status_t rv; if (!have_env_set) { - CuNotImpl(tc, "apr_env_set (skip test for apr_env_delete)"); + abts_not_impl(tc, "apr_env_set (skip test for apr_env_delete)"); } rv = apr_env_delete(TEST_ENVVAR_NAME, p); if (rv == APR_ENOTIMPL) { - CuNotImpl(tc, "apr_env_delete"); + abts_not_impl(tc, "apr_env_delete"); } apr_assert_success(tc, "delete environment variable", rv); if (!have_env_get) { - CuNotImpl(tc, "apr_env_get (skip sanity check for apr_env_delete)"); + abts_not_impl(tc, "apr_env_get (skip sanity check for apr_env_delete)"); } rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); - CuAssertIntEquals(tc, APR_ENOENT, rv); + abts_int_equal(tc, APR_ENOENT, rv); } -CuSuite *testenv(void) +abts_suite *testenv(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Environment"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, test_setenv); - SUITE_ADD_TEST(suite, test_getenv); - SUITE_ADD_TEST(suite, test_delenv); + abts_run_test(suite, test_setenv, NULL); + abts_run_test(suite, test_getenv, NULL); + abts_run_test(suite, test_delenv, NULL); return suite; } diff --git a/test/testfile.c b/test/testfile.c index ce02faf7b0c..357b4a67405 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -20,7 +20,7 @@ #include "apr_general.h" #include "apr_poll.h" #include "apr_lib.h" -#include "test_apr.h" +#include "testutil.h" #define DIRNAME "data" #define FILENAME DIRNAME "/file_datafile.txt" @@ -31,7 +31,7 @@ -static void test_open_noreadwrite(CuTest *tc) +static void test_open_noreadwrite(abts_case *tc, void *data) { apr_status_t rv; apr_file_t *thefile = NULL; @@ -39,12 +39,12 @@ static void test_open_noreadwrite(CuTest *tc) rv = apr_file_open(&thefile, FILENAME, APR_CREATE | APR_EXCL, APR_UREAD | APR_UWRITE | APR_GREAD, p); - CuAssertTrue(tc, rv != APR_SUCCESS); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_EACCES(rv)); - CuAssertPtrEquals(tc, NULL, thefile); + abts_true(tc, rv != APR_SUCCESS); + abts_int_equal(tc, 1, APR_STATUS_IS_EACCES(rv)); + abts_ptr_equal(tc, NULL, thefile); } -static void test_open_excl(CuTest *tc) +static void test_open_excl(abts_case *tc, void *data) { apr_status_t rv; apr_file_t *thefile = NULL; @@ -52,12 +52,12 @@ static void test_open_excl(CuTest *tc) rv = apr_file_open(&thefile, FILENAME, APR_CREATE | APR_EXCL | APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - CuAssertTrue(tc, rv != APR_SUCCESS); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_EEXIST(rv)); - CuAssertPtrEquals(tc, NULL, thefile); + abts_true(tc, rv != APR_SUCCESS); + abts_int_equal(tc, 1, APR_STATUS_IS_EEXIST(rv)); + abts_ptr_equal(tc, NULL, thefile); } -static void test_open_read(CuTest *tc) +static void test_open_read(abts_case *tc, void *data) { apr_status_t rv; apr_file_t *filetest = NULL; @@ -65,12 +65,12 @@ static void test_open_read(CuTest *tc) rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, filetest); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, filetest); apr_file_close(filetest); } -static void test_read(CuTest *tc) +static void test_read(abts_case *tc, void *data) { apr_status_t rv; apr_size_t nbytes = 256; @@ -83,14 +83,14 @@ static void test_read(CuTest *tc) apr_assert_success(tc, "Opening test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, strlen(TESTSTR), nbytes); - CuAssertStrEquals(tc, TESTSTR, str); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, strlen(TESTSTR), nbytes); + abts_str_equal(tc, TESTSTR, str); apr_file_close(filetest); } -static void test_filename(CuTest *tc) +static void test_filename(abts_case *tc, void *data) { const char *str; apr_status_t rv; @@ -102,13 +102,13 @@ static void test_filename(CuTest *tc) apr_assert_success(tc, "Opening test file " FILENAME, rv); rv = apr_file_name_get(&str, filetest); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, FILENAME, str); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, FILENAME, str); apr_file_close(filetest); } -static void test_fileclose(CuTest *tc) +static void test_fileclose(abts_case *tc, void *data) { char str; apr_status_t rv; @@ -121,26 +121,26 @@ static void test_fileclose(CuTest *tc) apr_assert_success(tc, "Opening test file " FILENAME, rv); rv = apr_file_close(filetest); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); /* We just closed the file, so this should fail */ rv = apr_file_read(filetest, &str, &one); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_EBADF(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_EBADF(rv)); } -static void test_file_remove(CuTest *tc) +static void test_file_remove(abts_case *tc, void *data) { apr_status_t rv; apr_file_t *filetest = NULL; rv = apr_file_remove(FILENAME, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); } -static void test_open_write(CuTest *tc) +static void test_open_write(abts_case *tc, void *data) { apr_status_t rv; apr_file_t *filetest = NULL; @@ -149,11 +149,11 @@ static void test_open_write(CuTest *tc) rv = apr_file_open(&filetest, FILENAME, APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv)); - CuAssertPtrEquals(tc, NULL, filetest); + abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); + abts_ptr_equal(tc, NULL, filetest); } -static void test_open_writecreate(CuTest *tc) +static void test_open_writecreate(abts_case *tc, void *data) { apr_status_t rv; apr_file_t *filetest = NULL; @@ -162,12 +162,12 @@ static void test_open_writecreate(CuTest *tc) rv = apr_file_open(&filetest, FILENAME, APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); apr_file_close(filetest); } -static void test_write(CuTest *tc) +static void test_write(abts_case *tc, void *data) { apr_status_t rv; apr_size_t bytes = strlen(TESTSTR); @@ -176,15 +176,15 @@ static void test_write(CuTest *tc) rv = apr_file_open(&filetest, FILENAME, APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_write(filetest, TESTSTR, &bytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); apr_file_close(filetest); } -static void test_open_readwrite(CuTest *tc) +static void test_open_readwrite(abts_case *tc, void *data) { apr_status_t rv; apr_file_t *filetest = NULL; @@ -193,13 +193,13 @@ static void test_open_readwrite(CuTest *tc) rv = apr_file_open(&filetest, FILENAME, APR_READ | APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, filetest); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, filetest); apr_file_close(filetest); } -static void test_seek(CuTest *tc) +static void test_seek(abts_case *tc, void *data) { apr_status_t rv; apr_off_t offset = 5; @@ -213,19 +213,19 @@ static void test_seek(CuTest *tc) apr_assert_success(tc, "Open test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, strlen(TESTSTR), nbytes); - CuAssertStrEquals(tc, TESTSTR, str); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, strlen(TESTSTR), nbytes); + abts_str_equal(tc, TESTSTR, str); memset(str, 0, nbytes + 1); rv = apr_file_seek(filetest, SEEK_SET, &offset); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_read(filetest, str, &nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, strlen(TESTSTR) - 5, nbytes); - CuAssertStrEquals(tc, TESTSTR + 5, str); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, strlen(TESTSTR) - 5, nbytes); + abts_str_equal(tc, TESTSTR + 5, str); apr_file_close(filetest); @@ -238,20 +238,20 @@ static void test_seek(CuTest *tc) offset = -5; rv = apr_file_seek(filetest, SEEK_END, &offset); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, strlen(TESTSTR) - 5, nbytes); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, strlen(TESTSTR) - 5, nbytes); memset(str, 0, nbytes + 1); nbytes = 256; rv = apr_file_read(filetest, str, &nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 5, nbytes); - CuAssertStrEquals(tc, TESTSTR + strlen(TESTSTR) - 5, str); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 5, nbytes); + abts_str_equal(tc, TESTSTR + strlen(TESTSTR) - 5, str); apr_file_close(filetest); } -static void test_userdata_set(CuTest *tc) +static void test_userdata_set(abts_case *tc, void *data) { apr_status_t rv; apr_file_t *filetest = NULL; @@ -259,15 +259,15 @@ static void test_userdata_set(CuTest *tc) rv = apr_file_open(&filetest, FILENAME, APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_data_set(filetest, "This is a test", "test", apr_pool_cleanup_null); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); apr_file_close(filetest); } -static void test_userdata_get(CuTest *tc) +static void test_userdata_get(abts_case *tc, void *data) { apr_status_t rv; char *teststr; @@ -276,20 +276,20 @@ static void test_userdata_get(CuTest *tc) rv = apr_file_open(&filetest, FILENAME, APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_data_set(filetest, "This is a test", "test", apr_pool_cleanup_null); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_data_get((void **)&teststr, "test", filetest); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, "This is a test", teststr); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, "This is a test", teststr); apr_file_close(filetest); } -static void test_userdata_getnokey(CuTest *tc) +static void test_userdata_getnokey(abts_case *tc, void *data) { apr_status_t rv; char *teststr; @@ -298,75 +298,75 @@ static void test_userdata_getnokey(CuTest *tc) rv = apr_file_open(&filetest, FILENAME, APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_data_get((void **)&teststr, "nokey", filetest); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrEquals(tc, NULL, teststr); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_equal(tc, NULL, teststr); apr_file_close(filetest); } -static void test_getc(CuTest *tc) +static void test_getc(abts_case *tc, void *data) { apr_file_t *f = NULL; apr_status_t rv; char ch; rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); apr_file_getc(&ch, f); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, (int)TESTSTR[0], (int)ch); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, (int)TESTSTR[0], (int)ch); apr_file_close(f); } -static void test_ungetc(CuTest *tc) +static void test_ungetc(abts_case *tc, void *data) { apr_file_t *f = NULL; apr_status_t rv; char ch; rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); apr_file_getc(&ch, f); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, (int)TESTSTR[0], (int)ch); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, (int)TESTSTR[0], (int)ch); apr_file_ungetc('X', f); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); apr_file_getc(&ch, f); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 'X', (int)ch); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 'X', (int)ch); apr_file_close(f); } -static void test_gets(CuTest *tc) +static void test_gets(abts_case *tc, void *data) { apr_file_t *f = NULL; apr_status_t rv; char *str = apr_palloc(p, 256); rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_gets(str, 256, f); /* Only one line in the test file, so APR will encounter EOF on the first * call to gets, but we should get APR_SUCCESS on this call and * APR_EOF on the next. */ - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, TESTSTR, str); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, TESTSTR, str); rv = apr_file_gets(str, 256, f); - CuAssertIntEquals(tc, APR_EOF, rv); - CuAssertStrEquals(tc, "", str); + abts_int_equal(tc, APR_EOF, rv); + abts_str_equal(tc, "", str); apr_file_close(f); } -static void test_bigread(CuTest *tc) +static void test_bigread(abts_case *tc, void *data) { apr_file_t *f = NULL; apr_status_t rv; @@ -378,38 +378,38 @@ static void test_bigread(CuTest *tc) rv = apr_file_open(&f, "data/created_file", APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); nbytes = APR_BUFFERSIZE; memset(buf, 0xFE, nbytes); rv = apr_file_write(f, buf, &nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, APR_BUFFERSIZE, nbytes); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_BUFFERSIZE, nbytes); rv = apr_file_close(f); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); f = NULL; rv = apr_file_open(&f, "data/created_file", APR_READ, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); nbytes = sizeof buf; rv = apr_file_read(f, buf, &nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, APR_BUFFERSIZE, nbytes); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_BUFFERSIZE, nbytes); rv = apr_file_close(f); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_remove("data/created_file", p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } /* This is a horrible name for this function. We are testing APR, not how * Apache uses APR. And, this function tests _way_ too much stuff. */ -static void test_mod_neg(CuTest *tc) +static void test_mod_neg(abts_case *tc, void *data) { apr_status_t rv; apr_file_t *f; @@ -422,73 +422,73 @@ static void test_mod_neg(CuTest *tc) rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); s = "body56789\n"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, strlen(s), nbytes); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, strlen(s), nbytes); for (i = 0; i < 7980; i++) { s = "0"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, strlen(s), nbytes); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, strlen(s), nbytes); } s = "end456789\n"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, strlen(s), nbytes); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, strlen(s), nbytes); for (i = 0; i < 10000; i++) { s = "1"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, strlen(s), nbytes); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, strlen(s), nbytes); } rv = apr_file_close(f); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_open(&f, fname, APR_READ, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_gets(buf, 11, f); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, "body56789\n", buf); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, "body56789\n", buf); cur = 0; rv = apr_file_seek(f, APR_CUR, &cur); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 10, cur); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 10, cur); nbytes = sizeof(buf); rv = apr_file_read(f, buf, &nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, nbytes, sizeof(buf)); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, nbytes, sizeof(buf)); cur = -((apr_off_t)nbytes - 7980); rv = apr_file_seek(f, APR_CUR, &cur); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 7990, cur); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 7990, cur); rv = apr_file_gets(buf, 11, f); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, "end456789\n", buf); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, "end456789\n", buf); rv = apr_file_close(f); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_remove(fname, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } -static void test_truncate(CuTest *tc) +static void test_truncate(abts_case *tc, void *data) { apr_status_t rv; apr_file_t *f; @@ -501,57 +501,57 @@ static void test_truncate(CuTest *tc) rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); s = "some data"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, strlen(s), nbytes); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, strlen(s), nbytes); rv = apr_file_close(f); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_open(&f, fname, APR_TRUNCATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_close(f); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, fname, APR_FINFO_SIZE, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 0, finfo.size); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 0, finfo.size); rv = apr_file_remove(fname, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } -CuSuite *testfile(void) +abts_suite *testfile(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("File I/O"); - - SUITE_ADD_TEST(suite, test_open_noreadwrite); - SUITE_ADD_TEST(suite, test_open_excl); - SUITE_ADD_TEST(suite, test_open_read); - SUITE_ADD_TEST(suite, test_open_readwrite); - SUITE_ADD_TEST(suite, test_read); - SUITE_ADD_TEST(suite, test_seek); - SUITE_ADD_TEST(suite, test_filename); - SUITE_ADD_TEST(suite, test_fileclose); - SUITE_ADD_TEST(suite, test_file_remove); - SUITE_ADD_TEST(suite, test_open_write); - SUITE_ADD_TEST(suite, test_open_writecreate); - SUITE_ADD_TEST(suite, test_write); - SUITE_ADD_TEST(suite, test_userdata_set); - SUITE_ADD_TEST(suite, test_userdata_get); - SUITE_ADD_TEST(suite, test_userdata_getnokey); - SUITE_ADD_TEST(suite, test_getc); - SUITE_ADD_TEST(suite, test_ungetc); - SUITE_ADD_TEST(suite, test_gets); - SUITE_ADD_TEST(suite, test_bigread); - SUITE_ADD_TEST(suite, test_mod_neg); - SUITE_ADD_TEST(suite, test_truncate); + suite = ADD_SUITE(suite) + + abts_run_test(suite, test_open_noreadwrite, NULL); + abts_run_test(suite, test_open_excl, NULL); + abts_run_test(suite, test_open_read, NULL); + abts_run_test(suite, test_open_readwrite, NULL); + abts_run_test(suite, test_read, NULL); + abts_run_test(suite, test_seek, NULL); + abts_run_test(suite, test_filename, NULL); + abts_run_test(suite, test_fileclose, NULL); + abts_run_test(suite, test_file_remove, NULL); + abts_run_test(suite, test_open_write, NULL); + abts_run_test(suite, test_open_writecreate, NULL); + abts_run_test(suite, test_write, NULL); + abts_run_test(suite, test_userdata_set, NULL); + abts_run_test(suite, test_userdata_get, NULL); + abts_run_test(suite, test_userdata_getnokey, NULL); + abts_run_test(suite, test_getc, NULL); + abts_run_test(suite, test_ungetc, NULL); + abts_run_test(suite, test_gets, NULL); + abts_run_test(suite, test_bigread, NULL); + abts_run_test(suite, test_mod_neg, NULL); + abts_run_test(suite, test_truncate, NULL); return suite; } diff --git a/test/testfilecopy.c b/test/testfilecopy.c index 2a2abb356f0..e63c9daa4b8 100644 --- a/test/testfilecopy.c +++ b/test/testfilecopy.c @@ -13,13 +13,13 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr_file_io.h" #include "apr_file_info.h" #include "apr_errno.h" #include "apr_pools.h" -static void copy_helper(CuTest *tc, const char *from, const char * to, +static void copy_helper(abts_case *tc, const char *from, const char * to, apr_fileperms_t perms, int append, apr_pool_t *p) { apr_status_t rv; @@ -45,16 +45,16 @@ static void copy_helper(CuTest *tc, const char *from, const char * to, apr_assert_success(tc, "Couldn't stat copy file", rv); if (!append) { - CuAssertIntEquals(tc, orig.size, copy.size); + abts_int_equal(tc, orig.size, copy.size); } else { - CuAssertIntEquals(tc, + abts_int_equal(tc, ((dest_rv == APR_SUCCESS) ? dest.size : 0) + orig.size, copy.size); } } -static void copy_short_file(CuTest *tc) +static void copy_short_file(abts_case *tc, void *data) { apr_status_t rv; @@ -67,7 +67,7 @@ static void copy_short_file(CuTest *tc) apr_assert_success(tc, "Couldn't remove copy file", rv); } -static void copy_over_existing(CuTest *tc) +static void copy_over_existing(abts_case *tc, void *data) { apr_status_t rv; @@ -88,7 +88,7 @@ static void copy_over_existing(CuTest *tc) apr_assert_success(tc, "Couldn't remove copy file", rv); } -static void append_nonexist(CuTest *tc) +static void append_nonexist(abts_case *tc, void *data) { apr_status_t rv; @@ -101,7 +101,7 @@ static void append_nonexist(CuTest *tc) apr_assert_success(tc, "Couldn't remove copy file", rv); } -static void append_exist(CuTest *tc) +static void append_exist(abts_case *tc, void *data) { apr_status_t rv; @@ -122,15 +122,15 @@ static void append_exist(CuTest *tc) apr_assert_success(tc, "Couldn't remove copy file", rv); } -CuSuite *testfilecopy(void) +abts_suite *testfilecopy(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("File Copy"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, copy_short_file); - SUITE_ADD_TEST(suite, copy_over_existing); + abts_run_test(suite, copy_short_file, NULL); + abts_run_test(suite, copy_over_existing, NULL); - SUITE_ADD_TEST(suite, append_nonexist); - SUITE_ADD_TEST(suite, append_exist); + abts_run_test(suite, append_nonexist, NULL); + abts_run_test(suite, append_exist, NULL); return suite; } diff --git a/test/testfileinfo.c b/test/testfileinfo.c index 0c1149f08ea..bf0ce682e81 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -20,7 +20,7 @@ #include "apr_general.h" #include "apr_poll.h" #include "apr_lib.h" -#include "test_apr.h" +#include "testutil.h" #define FILENAME "data/file_datafile.txt" #define NEWFILENAME "data/new_datafile.txt" @@ -47,69 +47,69 @@ static const struct view_fileinfo {0, NULL} }; -static void finfo_equal(CuTest *tc, apr_finfo_t *f1, apr_finfo_t *f2) +static void finfo_equal(abts_case *tc, apr_finfo_t *f1, apr_finfo_t *f2) { /* Minimum supported flags across all platforms (APR_FINFO_MIN) */ - CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_TYPE", + abts_assert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_TYPE", (f1->valid & f2->valid & APR_FINFO_TYPE)); - CuAssert(tc, "apr_stat and apr_getfileinfo differ in filetype", + abts_assert(tc, "apr_stat and apr_getfileinfo differ in filetype", f1->filetype == f2->filetype); - CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_SIZE", + abts_assert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_SIZE", (f1->valid & f2->valid & APR_FINFO_SIZE)); - CuAssert(tc, "apr_stat and apr_getfileinfo differ in size", + abts_assert(tc, "apr_stat and apr_getfileinfo differ in size", f1->size == f2->size); - CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_ATIME", + abts_assert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_ATIME", (f1->valid & f2->valid & APR_FINFO_ATIME)); - CuAssert(tc, "apr_stat and apr_getfileinfo differ in atime", + abts_assert(tc, "apr_stat and apr_getfileinfo differ in atime", f1->atime == f2->atime); - CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_MTIME", + abts_assert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_MTIME", (f1->valid & f2->valid & APR_FINFO_MTIME)); - CuAssert(tc, "apr_stat and apr_getfileinfo differ in mtime", + abts_assert(tc, "apr_stat and apr_getfileinfo differ in mtime", f1->mtime == f2->mtime); - CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_CTIME", + abts_assert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_CTIME", (f1->valid & f2->valid & APR_FINFO_CTIME)); - CuAssert(tc, "apr_stat and apr_getfileinfo differ in ctime", + abts_assert(tc, "apr_stat and apr_getfileinfo differ in ctime", f1->ctime == f2->ctime); if (f1->valid & f2->valid & APR_FINFO_NAME) - CuAssert(tc, "apr_stat and apr_getfileinfo differ in name", + abts_assert(tc, "apr_stat and apr_getfileinfo differ in name", !strcmp(f1->name, f2->name)); if (f1->fname && f2->fname) - CuAssert(tc, "apr_stat and apr_getfileinfo differ in fname", + abts_assert(tc, "apr_stat and apr_getfileinfo differ in fname", !strcmp(f1->fname, f2->fname)); /* Additional supported flags not supported on all platforms */ if (f1->valid & f2->valid & APR_FINFO_USER) - CuAssert(tc, "apr_stat and apr_getfileinfo differ in user", + abts_assert(tc, "apr_stat and apr_getfileinfo differ in user", !apr_uid_compare(f1->user, f2->user)); if (f1->valid & f2->valid & APR_FINFO_GROUP) - CuAssert(tc, "apr_stat and apr_getfileinfo differ in group", + abts_assert(tc, "apr_stat and apr_getfileinfo differ in group", !apr_gid_compare(f1->group, f2->group)); if (f1->valid & f2->valid & APR_FINFO_INODE) - CuAssert(tc, "apr_stat and apr_getfileinfo differ in inode", + abts_assert(tc, "apr_stat and apr_getfileinfo differ in inode", f1->inode == f2->inode); if (f1->valid & f2->valid & APR_FINFO_DEV) - CuAssert(tc, "apr_stat and apr_getfileinfo differ in device", + abts_assert(tc, "apr_stat and apr_getfileinfo differ in device", f1->device == f2->device); if (f1->valid & f2->valid & APR_FINFO_NLINK) - CuAssert(tc, "apr_stat and apr_getfileinfo differ in nlink", + abts_assert(tc, "apr_stat and apr_getfileinfo differ in nlink", f1->nlink == f2->nlink); if (f1->valid & f2->valid & APR_FINFO_CSIZE) - CuAssert(tc, "apr_stat and apr_getfileinfo differ in csize", + abts_assert(tc, "apr_stat and apr_getfileinfo differ in csize", f1->csize == f2->csize); if (f1->valid & f2->valid & APR_FINFO_PROT) - CuAssert(tc, "apr_stat and apr_getfileinfo differ in protection", + abts_assert(tc, "apr_stat and apr_getfileinfo differ in protection", f1->protection == f2->protection); } -static void test_info_get(CuTest *tc) +static void test_info_get(abts_case *tc, void *data) { apr_file_t *thefile; apr_finfo_t finfo; apr_status_t rv; rv = apr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); if (rv == APR_INCOMPLETE) { @@ -121,13 +121,13 @@ static void test_info_get(CuTest *tc) str = apr_pstrcat(p, str, vfi[i].description, " ", NULL); } } - CuFail(tc, str); + abts_fail(tc, str); } - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); apr_file_close(thefile); } -static void test_stat(CuTest *tc) +static void test_stat(abts_case *tc, void *data) { apr_finfo_t finfo; apr_status_t rv; @@ -142,12 +142,12 @@ static void test_stat(CuTest *tc) str = apr_pstrcat(p, str, vfi[i].description, " ", NULL); } } - CuFail(tc, str); + abts_fail(tc, str); } - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } -static void test_stat_eq_finfo(CuTest *tc) +static void test_stat_eq_finfo(abts_case *tc, void *data) { apr_file_t *thefile; apr_finfo_t finfo; @@ -155,7 +155,7 @@ static void test_stat_eq_finfo(CuTest *tc) apr_status_t rv; rv = apr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); /* Opening the file may have toggled the atime member (time last @@ -163,14 +163,14 @@ static void test_stat_eq_finfo(CuTest *tc) * of the open file... */ rv = apr_stat(&stat_finfo, FILENAME, APR_FINFO_NORM, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); apr_file_close(thefile); finfo_equal(tc, &stat_finfo, &finfo); } -static void test_buffered_write_size(CuTest *tc) +static void test_buffered_write_size(abts_case *tc, void *data) { const apr_size_t data_len = strlen(NEWFILEDATA); apr_file_t *thefile; @@ -192,15 +192,15 @@ static void test_buffered_write_size(CuTest *tc) bytes = data_len; rv = apr_file_write(thefile, NEWFILEDATA, &bytes); apr_assert_success(tc, "write file contents", rv); - CuAssertTrue(tc, data_len == bytes); + abts_true(tc, data_len == bytes); rv = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); apr_assert_success(tc, "get file size", rv); - CuAssertTrue(tc, bytes == (apr_size_t) finfo.size); + abts_true(tc, bytes == (apr_size_t) finfo.size); apr_file_close(thefile); } -static void test_mtime_set(CuTest *tc) +static void test_mtime_set(abts_case *tc, void *data) { apr_file_t *thefile; apr_finfo_t finfo; @@ -228,10 +228,10 @@ static void test_mtime_set(CuTest *tc) str = apr_pstrcat(p, str, vfi[i].description, " ", NULL); } } - CuFail(tc, str); + abts_fail(tc, str); } apr_assert_success(tc, "get initial mtime", rv); - CuAssertTrue(tc, finfo.mtime != epoch); + abts_true(tc, finfo.mtime != epoch); /* Reset the mtime to the epoch and verify the result. * Note: we blindly assume that if the first apr_stat succeeded, @@ -242,20 +242,20 @@ static void test_mtime_set(CuTest *tc) rv = apr_stat(&finfo, NEWFILENAME, APR_FINFO_MTIME, p); apr_assert_success(tc, "get modified mtime", rv); - CuAssertTrue(tc, finfo.mtime == epoch); + abts_true(tc, finfo.mtime == epoch); apr_file_close(thefile); } -CuSuite *testfileinfo(void) +abts_suite *testfileinfo(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("File Info"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, test_info_get); - SUITE_ADD_TEST(suite, test_stat); - SUITE_ADD_TEST(suite, test_stat_eq_finfo); - SUITE_ADD_TEST(suite, test_buffered_write_size); - SUITE_ADD_TEST(suite, test_mtime_set); + abts_run_test(suite, test_info_get, NULL); + abts_run_test(suite, test_stat, NULL); + abts_run_test(suite, test_stat_eq_finfo, NULL); + abts_run_test(suite, test_buffered_write_size, NULL); + abts_run_test(suite, test_mtime_set, NULL); return suite; } diff --git a/test/testflock.c b/test/testflock.c index 79b5b032c02..d13c55e32b4 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -14,7 +14,7 @@ */ #include "testflock.h" -#include "test_apr.h" +#include "testutil.h" #include "apr_pools.h" #include "apr_thread_proc.h" #include "apr_file_io.h" @@ -22,7 +22,7 @@ #include "apr_general.h" #include "apr_strings.h" -static int launch_reader(CuTest *tc) +static int launch_reader(abts_case *tc) { apr_proc_t proc = {0}; apr_procattr_t *procattr; @@ -46,14 +46,14 @@ static int launch_reader(CuTest *tc) rv = apr_proc_create(&proc, "./tryread" EXTENSION, args, NULL, procattr, p); apr_assert_success(tc, "Couldn't launch program", rv); - CuAssert(tc, "wait for child process", + abts_assert(tc, "wait for child process", apr_proc_wait(&proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); - CuAssert(tc, "child terminated normally", why == APR_PROC_EXIT); + abts_assert(tc, "child terminated normally", why == APR_PROC_EXIT); return exitcode; } -static void test_withlock(CuTest *tc) +static void test_withlock(abts_case *tc, void *data) { apr_file_t *file; apr_status_t rv; @@ -62,39 +62,39 @@ static void test_withlock(CuTest *tc) rv = apr_file_open(&file, TESTFILE, APR_WRITE|APR_CREATE, APR_OS_DEFAULT, p); apr_assert_success(tc, "Could not create file.", rv); - CuAssertPtrNotNull(tc, file); + abts_ptr_notnull(tc, file); rv = apr_file_lock(file, APR_FLOCK_EXCLUSIVE); apr_assert_success(tc, "Could not lock the file.", rv); - CuAssertPtrNotNull(tc, file); + abts_ptr_notnull(tc, file); code = launch_reader(tc); - CuAssertIntEquals(tc, FAILED_READ, code); + abts_int_equal(tc, FAILED_READ, code); (void) apr_file_close(file); } -static void test_withoutlock(CuTest *tc) +static void test_withoutlock(abts_case *tc, void *data) { int code; code = launch_reader(tc); - CuAssertIntEquals(tc, SUCCESSFUL_READ, code); + abts_int_equal(tc, SUCCESSFUL_READ, code); } -static void remove_lockfile(CuTest *tc) +static void remove_lockfile(abts_case *tc, void *data) { apr_assert_success(tc, "Couldn't remove lock file.", apr_file_remove(TESTFILE, p)); } -CuSuite *testflock(void) +abts_suite *testflock(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Flock"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, test_withlock); - SUITE_ADD_TEST(suite, test_withoutlock); - SUITE_ADD_TEST(suite, remove_lockfile); + abts_run_test(suite, test_withlock, NULL); + abts_run_test(suite, test_withoutlock, NULL); + abts_run_test(suite, remove_lockfile, NULL); return suite; } diff --git a/test/testfmt.c b/test/testfmt.c index 20af8b9d00f..2e1e38ca2ad 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -13,89 +13,89 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr.h" #include "apr_portable.h" #include "apr_strings.h" -static void ssize_t_fmt(CuTest *tc) +static void ssize_t_fmt(abts_case *tc, void *data) { char buf[100]; apr_ssize_t var = 0; sprintf(buf, "%" APR_SSIZE_T_FMT, var); - CuAssertStrEquals(tc, "0", buf); + abts_str_equal(tc, "0", buf); apr_snprintf(buf, sizeof(buf), "%" APR_SSIZE_T_FMT, var); - CuAssertStrEquals(tc, "0", buf); + abts_str_equal(tc, "0", buf); } -static void size_t_fmt(CuTest *tc) +static void size_t_fmt(abts_case *tc, void *data) { char buf[100]; apr_size_t var = 0; sprintf(buf, "%" APR_SIZE_T_FMT, var); - CuAssertStrEquals(tc, "0", buf); + abts_str_equal(tc, "0", buf); apr_snprintf(buf, sizeof(buf), "%" APR_SIZE_T_FMT, var); - CuAssertStrEquals(tc, "0", buf); + abts_str_equal(tc, "0", buf); } -static void off_t_fmt(CuTest *tc) +static void off_t_fmt(abts_case *tc, void *data) { char buf[100]; apr_off_t var = 0; sprintf(buf, "%" APR_OFF_T_FMT, var); - CuAssertStrEquals(tc, "0", buf); + abts_str_equal(tc, "0", buf); apr_snprintf(buf, sizeof(buf), "%" APR_OFF_T_FMT, var); - CuAssertStrEquals(tc, "0", buf); + abts_str_equal(tc, "0", buf); } -static void pid_t_fmt(CuTest *tc) +static void pid_t_fmt(abts_case *tc, void *data) { char buf[100]; pid_t var = 0; sprintf(buf, "%" APR_PID_T_FMT, var); - CuAssertStrEquals(tc, "0", buf); + abts_str_equal(tc, "0", buf); apr_snprintf(buf, sizeof(buf), "%" APR_PID_T_FMT, var); - CuAssertStrEquals(tc, "0", buf); + abts_str_equal(tc, "0", buf); } -static void int64_t_fmt(CuTest *tc) +static void int64_t_fmt(abts_case *tc, void *data) { char buf[100]; apr_int64_t var = 0; sprintf(buf, "%" APR_INT64_T_FMT, var); - CuAssertStrEquals(tc, "0", buf); + abts_str_equal(tc, "0", buf); apr_snprintf(buf, sizeof(buf), "%" APR_INT64_T_FMT, var); - CuAssertStrEquals(tc, "0", buf); + abts_str_equal(tc, "0", buf); } -static void uint64_t_fmt(CuTest *tc) +static void uint64_t_fmt(abts_case *tc, void *data) { char buf[100]; apr_uint64_t var = APR_UINT64_C(14000000); sprintf(buf, "%" APR_UINT64_T_FMT, var); - CuAssertStrEquals(tc, "14000000", buf); + abts_str_equal(tc, "14000000", buf); apr_snprintf(buf, sizeof(buf), "%" APR_UINT64_T_FMT, var); - CuAssertStrEquals(tc, "14000000", buf); + abts_str_equal(tc, "14000000", buf); } -static void uint64_t_hex_fmt(CuTest *tc) +static void uint64_t_hex_fmt(abts_case *tc, void *data) { char buf[100]; apr_uint64_t var = APR_UINT64_C(14000000); sprintf(buf, "%" APR_UINT64_T_HEX_FMT, var); - CuAssertStrEquals(tc, "d59f80", buf); + abts_str_equal(tc, "d59f80", buf); apr_snprintf(buf, sizeof(buf), "%" APR_UINT64_T_HEX_FMT, var); - CuAssertStrEquals(tc, "d59f80", buf); + abts_str_equal(tc, "d59f80", buf); } -static void more_int64_fmts(CuTest *tc) +static void more_int64_fmts(abts_case *tc, void *data) { char buf[100]; apr_int64_t i = APR_INT64_C(-42); @@ -104,30 +104,30 @@ static void more_int64_fmts(CuTest *tc) apr_uint64_t big = APR_UINT64_C(3141592653589793238); apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, i); - CuAssertStrEquals(tc, buf, "-42"); + abts_str_equal(tc, buf, "-42"); apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, ui); - CuAssertStrEquals(tc, buf, "42"); + abts_str_equal(tc, buf, "42"); apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, big); - CuAssertStrEquals(tc, buf, "3141592653589793238"); + abts_str_equal(tc, buf, "3141592653589793238"); apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, ibig); - CuAssertStrEquals(tc, buf, "-314159265358979323"); + abts_str_equal(tc, buf, "-314159265358979323"); } -CuSuite *testfmt(void) +abts_suite *testfmt(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Formats"); - - SUITE_ADD_TEST(suite, ssize_t_fmt); - SUITE_ADD_TEST(suite, size_t_fmt); - SUITE_ADD_TEST(suite, off_t_fmt); - SUITE_ADD_TEST(suite, pid_t_fmt); - SUITE_ADD_TEST(suite, int64_t_fmt); - SUITE_ADD_TEST(suite, uint64_t_fmt); - SUITE_ADD_TEST(suite, uint64_t_hex_fmt); - SUITE_ADD_TEST(suite, more_int64_fmts); + suite = ADD_SUITE(suite) + + abts_run_test(suite, ssize_t_fmt, NULL); + abts_run_test(suite, size_t_fmt, NULL); + abts_run_test(suite, off_t_fmt, NULL); + abts_run_test(suite, pid_t_fmt, NULL); + abts_run_test(suite, int64_t_fmt, NULL); + abts_run_test(suite, uint64_t_fmt, NULL); + abts_run_test(suite, uint64_t_hex_fmt, NULL); + abts_run_test(suite, more_int64_fmts, NULL); return suite; } diff --git a/test/testfnmatch.c b/test/testfnmatch.c index 7b099e10d73..ac5c5347fa8 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -13,32 +13,32 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr_file_info.h" #include "apr_fnmatch.h" #include "apr_tables.h" -static void test_glob(CuTest *tc) +static void test_glob(abts_case *tc, void *data) { int i; char **list; apr_array_header_t *result; apr_status_t rv = apr_match_glob("data\\*.txt", &result, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); /* XXX If we ever add a file that matches *.txt to data, then we need * to increase this. */ - CuAssertIntEquals(tc, 2, result->nelts); + abts_int_equal(tc, 2, result->nelts); list = (char **)result->elts; for (i = 0; i < result->nelts; i++) { char *dot = strrchr(list[i], '.'); - CuAssertStrEquals(tc, dot, ".txt"); + abts_str_equal(tc, dot, ".txt"); } } -static void test_glob_currdir(CuTest *tc) +static void test_glob_currdir(abts_case *tc, void *data) { int i; char **list; @@ -47,26 +47,26 @@ static void test_glob_currdir(CuTest *tc) apr_filepath_set("data", p); rv = apr_match_glob("*.txt", &result, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); /* XXX If we ever add a file that matches *.txt to data, then we need * to increase this. */ - CuAssertIntEquals(tc, 2, result->nelts); + abts_int_equal(tc, 2, result->nelts); list = (char **)result->elts; for (i = 0; i < result->nelts; i++) { char *dot = strrchr(list[i], '.'); - CuAssertStrEquals(tc, dot, ".txt"); + abts_str_equal(tc, dot, ".txt"); } apr_filepath_set("..", p); } -CuSuite *testfnmatch(void) +abts_suite *testfnmatch(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Fnmatch"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, test_glob); - SUITE_ADD_TEST(suite, test_glob_currdir); + abts_run_test(suite, test_glob, NULL); + abts_run_test(suite, test_glob_currdir, NULL); return suite; } diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index 5b9bd7ee610..7a2d345e6cd 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -17,9 +17,9 @@ #include "apr_thread_proc.h" #include "apr_global_mutex.h" #include "apr_errno.h" -#include "test_apr.h" +#include "testutil.h" -static void launch_child(CuTest *tc, apr_proc_t *proc, apr_pool_t *p) +static void launch_child(abts_case *tc, apr_proc_t *proc, apr_pool_t *p) { apr_procattr_t *procattr; const char *args[2]; @@ -42,19 +42,19 @@ static void launch_child(CuTest *tc, apr_proc_t *proc, apr_pool_t *p) apr_assert_success(tc, "Couldn't launch program", rv); } -static int wait_child(CuTest *tc, apr_proc_t *proc) +static int wait_child(abts_case *tc, apr_proc_t *proc) { int exitcode; apr_exit_why_e why; - CuAssert(tc, "Error waiting for child process", + abts_assert(tc, "Error waiting for child process", apr_proc_wait(proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); - CuAssert(tc, "child didn't terminate normally", why == APR_PROC_EXIT); + abts_assert(tc, "child didn't terminate normally", why == APR_PROC_EXIT); return exitcode; } -static void test_exclusive(CuTest *tc) +static void test_exclusive(abts_case *tc, void *data) { apr_proc_t p1, p2, p3, p4; apr_status_t rv; @@ -75,14 +75,14 @@ static void test_exclusive(CuTest *tc) x += wait_child(tc, &p3); x += wait_child(tc, &p4); - CuAssertIntEquals(tc, MAX_COUNTER, x); + abts_int_equal(tc, MAX_COUNTER, x); } -CuSuite *testglobalmutex(void) +abts_suite *testglobalmutex(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Global Mutex"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, test_exclusive); + abts_run_test(suite, test_exclusive, NULL); return suite; } diff --git a/test/testhash.c b/test/testhash.c index f49ff8ec6bb..c7243c064b3 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr.h" #include "apr_strings.h" #include "apr_general.h" @@ -56,59 +56,59 @@ static void sum_hash(apr_pool_t *p, apr_hash_t *h, int *pcount, int *keySum, int *pcount=count; } -static void hash_make(CuTest *tc) +static void hash_make(abts_case *tc, void *data) { apr_hash_t *h = NULL; h = apr_hash_make(p); - CuAssertPtrNotNull(tc, h); + abts_ptr_notnull(tc, h); } -static void hash_set(CuTest *tc) +static void hash_set(abts_case *tc, void *data) { apr_hash_t *h = NULL; char *result = NULL; h = apr_hash_make(p); - CuAssertPtrNotNull(tc, h); + abts_ptr_notnull(tc, h); apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); - CuAssertStrEquals(tc, "value", result); + abts_str_equal(tc, "value", result); } -static void hash_reset(CuTest *tc) +static void hash_reset(abts_case *tc, void *data) { apr_hash_t *h = NULL; char *result = NULL; h = apr_hash_make(p); - CuAssertPtrNotNull(tc, h); + abts_ptr_notnull(tc, h); apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); - CuAssertStrEquals(tc, "value", result); + abts_str_equal(tc, "value", result); apr_hash_set(h, "key", APR_HASH_KEY_STRING, "new"); result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); - CuAssertStrEquals(tc, "new", result); + abts_str_equal(tc, "new", result); } -static void same_value(CuTest *tc) +static void same_value(abts_case *tc, void *data) { apr_hash_t *h = NULL; char *result = NULL; h = apr_hash_make(p); - CuAssertPtrNotNull(tc, h); + abts_ptr_notnull(tc, h); apr_hash_set(h, "same1", APR_HASH_KEY_STRING, "same"); result = apr_hash_get(h, "same1", APR_HASH_KEY_STRING); - CuAssertStrEquals(tc, "same", result); + abts_str_equal(tc, "same", result); apr_hash_set(h, "same2", APR_HASH_KEY_STRING, "same"); result = apr_hash_get(h, "same2", APR_HASH_KEY_STRING); - CuAssertStrEquals(tc, "same", result); + abts_str_equal(tc, "same", result); } static unsigned int hash_custom( const char *key, apr_ssize_t *klen) @@ -121,47 +121,47 @@ static unsigned int hash_custom( const char *key, apr_ssize_t *klen) return hash; } -static void same_value_custom(CuTest *tc) +static void same_value_custom(abts_case *tc, void *data) { apr_hash_t *h = NULL; char *result = NULL; h = apr_hash_make_custom(p, hash_custom); - CuAssertPtrNotNull(tc, h); + abts_ptr_notnull(tc, h); apr_hash_set(h, "same1", 5, "same"); result = apr_hash_get(h, "same1", 5); - CuAssertStrEquals(tc, "same", result); + abts_str_equal(tc, "same", result); apr_hash_set(h, "same2", 5, "same"); result = apr_hash_get(h, "same2", 5); - CuAssertStrEquals(tc, "same", result); + abts_str_equal(tc, "same", result); } -static void key_space(CuTest *tc) +static void key_space(abts_case *tc, void *data) { apr_hash_t *h = NULL; char *result = NULL; h = apr_hash_make(p); - CuAssertPtrNotNull(tc, h); + abts_ptr_notnull(tc, h); apr_hash_set(h, "key with space", APR_HASH_KEY_STRING, "value"); result = apr_hash_get(h, "key with space", APR_HASH_KEY_STRING); - CuAssertStrEquals(tc, "value", result); + abts_str_equal(tc, "value", result); } /* This is kind of a hack, but I am just keeping an existing test. This is * really testing apr_hash_first, apr_hash_next, and apr_hash_this which * should be tested in three separate tests, but this will do for now. */ -static void hash_traverse(CuTest *tc) +static void hash_traverse(abts_case *tc, void *data) { apr_hash_t *h; char str[8196]; h = apr_hash_make(p); - CuAssertPtrNotNull(tc, h); + abts_ptr_notnull(tc, h); apr_hash_set(h, "OVERWRITE", APR_HASH_KEY_STRING, "should not see this"); apr_hash_set(h, "FOO3", APR_HASH_KEY_STRING, "bar3"); @@ -174,7 +174,7 @@ static void hash_traverse(CuTest *tc) apr_hash_set(h, "OVERWRITE", APR_HASH_KEY_STRING, "Overwrite key"); dump_hash(p, h, str); - CuAssertStrEquals(tc, "Key FOO1 (4) Value bar1\n" + abts_str_equal(tc, "Key FOO1 (4) Value bar1\n" "Key FOO2 (4) Value bar2\n" "Key OVERWRITE (9) Value Overwrite key\n" "Key FOO3 (4) Value bar3\n" @@ -188,14 +188,14 @@ static void hash_traverse(CuTest *tc) * really testing apr_hash_first, apr_hash_next, and apr_hash_this which * should be tested in three separate tests, but this will do for now. */ -static void summation_test(CuTest *tc) +static void summation_test(abts_case *tc, void *data) { apr_hash_t *h; int sumKeys, sumVal, trySumKey, trySumVal; int i, j, *val, *key; h =apr_hash_make(p); - CuAssertPtrNotNull(tc, h); + abts_ptr_notnull(tc, h); sumKeys = 0; sumVal = 0; @@ -214,70 +214,70 @@ static void summation_test(CuTest *tc) } sum_hash(p, h, &i, &trySumKey, &trySumVal); - CuAssertIntEquals(tc, 100, i); - CuAssertIntEquals(tc, sumVal, trySumVal); - CuAssertIntEquals(tc, sumKeys, trySumKey); + abts_int_equal(tc, 100, i); + abts_int_equal(tc, sumVal, trySumVal); + abts_int_equal(tc, sumKeys, trySumKey); } -static void delete_key(CuTest *tc) +static void delete_key(abts_case *tc, void *data) { apr_hash_t *h = NULL; char *result = NULL; h = apr_hash_make(p); - CuAssertPtrNotNull(tc, h); + abts_ptr_notnull(tc, h); apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); apr_hash_set(h, "key2", APR_HASH_KEY_STRING, "value2"); result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); - CuAssertStrEquals(tc, "value", result); + abts_str_equal(tc, "value", result); result = apr_hash_get(h, "key2", APR_HASH_KEY_STRING); - CuAssertStrEquals(tc, "value2", result); + abts_str_equal(tc, "value2", result); apr_hash_set(h, "key", APR_HASH_KEY_STRING, NULL); result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); - CuAssertPtrEquals(tc, NULL, result); + abts_ptr_equal(tc, NULL, result); result = apr_hash_get(h, "key2", APR_HASH_KEY_STRING); - CuAssertStrEquals(tc, "value2", result); + abts_str_equal(tc, "value2", result); } -static void hash_count_0(CuTest *tc) +static void hash_count_0(abts_case *tc, void *data) { apr_hash_t *h = NULL; int count; h = apr_hash_make(p); - CuAssertPtrNotNull(tc, h); + abts_ptr_notnull(tc, h); count = apr_hash_count(h); - CuAssertIntEquals(tc, 0, count); + abts_int_equal(tc, 0, count); } -static void hash_count_1(CuTest *tc) +static void hash_count_1(abts_case *tc, void *data) { apr_hash_t *h = NULL; int count; h = apr_hash_make(p); - CuAssertPtrNotNull(tc, h); + abts_ptr_notnull(tc, h); apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); count = apr_hash_count(h); - CuAssertIntEquals(tc, 1, count); + abts_int_equal(tc, 1, count); } -static void hash_count_5(CuTest *tc) +static void hash_count_5(abts_case *tc, void *data) { apr_hash_t *h = NULL; int count; h = apr_hash_make(p); - CuAssertPtrNotNull(tc, h); + abts_ptr_notnull(tc, h); apr_hash_set(h, "key1", APR_HASH_KEY_STRING, "value1"); apr_hash_set(h, "key2", APR_HASH_KEY_STRING, "value2"); @@ -286,10 +286,10 @@ static void hash_count_5(CuTest *tc) apr_hash_set(h, "key5", APR_HASH_KEY_STRING, "value5"); count = apr_hash_count(h); - CuAssertIntEquals(tc, 5, count); + abts_int_equal(tc, 5, count); } -static void overlay_empty(CuTest *tc) +static void overlay_empty(abts_case *tc, void *data) { apr_hash_t *base = NULL; apr_hash_t *overlay = NULL; @@ -299,8 +299,8 @@ static void overlay_empty(CuTest *tc) base = apr_hash_make(p); overlay = apr_hash_make(p); - CuAssertPtrNotNull(tc, base); - CuAssertPtrNotNull(tc, overlay); + abts_ptr_notnull(tc, base); + abts_ptr_notnull(tc, overlay); apr_hash_set(base, "key1", APR_HASH_KEY_STRING, "value1"); apr_hash_set(base, "key2", APR_HASH_KEY_STRING, "value2"); @@ -311,10 +311,10 @@ static void overlay_empty(CuTest *tc) result = apr_hash_overlay(p, overlay, base); count = apr_hash_count(result); - CuAssertIntEquals(tc, 5, count); + abts_int_equal(tc, 5, count); dump_hash(p, result, str); - CuAssertStrEquals(tc, "Key key1 (4) Value value1\n" + abts_str_equal(tc, "Key key1 (4) Value value1\n" "Key key2 (4) Value value2\n" "Key key3 (4) Value value3\n" "Key key4 (4) Value value4\n" @@ -322,7 +322,7 @@ static void overlay_empty(CuTest *tc) "#entries 5\n", str); } -static void overlay_2unique(CuTest *tc) +static void overlay_2unique(abts_case *tc, void *data) { apr_hash_t *base = NULL; apr_hash_t *overlay = NULL; @@ -332,8 +332,8 @@ static void overlay_2unique(CuTest *tc) base = apr_hash_make(p); overlay = apr_hash_make(p); - CuAssertPtrNotNull(tc, base); - CuAssertPtrNotNull(tc, overlay); + abts_ptr_notnull(tc, base); + abts_ptr_notnull(tc, overlay); apr_hash_set(base, "base1", APR_HASH_KEY_STRING, "value1"); apr_hash_set(base, "base2", APR_HASH_KEY_STRING, "value2"); @@ -350,13 +350,13 @@ static void overlay_2unique(CuTest *tc) result = apr_hash_overlay(p, overlay, base); count = apr_hash_count(result); - CuAssertIntEquals(tc, 10, count); + abts_int_equal(tc, 10, count); dump_hash(p, result, str); /* I don't know why these are out of order, but they are. I would probably * consider this a bug, but others should comment. */ - CuAssertStrEquals(tc, "Key base5 (5) Value value5\n" + abts_str_equal(tc, "Key base5 (5) Value value5\n" "Key overlay1 (8) Value value1\n" "Key overlay2 (8) Value value2\n" "Key overlay3 (8) Value value3\n" @@ -369,7 +369,7 @@ static void overlay_2unique(CuTest *tc) "#entries 10\n", str); } -static void overlay_same(CuTest *tc) +static void overlay_same(abts_case *tc, void *data) { apr_hash_t *base = NULL; apr_hash_t *result = NULL; @@ -377,7 +377,7 @@ static void overlay_same(CuTest *tc) char str[8196]; base = apr_hash_make(p); - CuAssertPtrNotNull(tc, base); + abts_ptr_notnull(tc, base); apr_hash_set(base, "base1", APR_HASH_KEY_STRING, "value1"); apr_hash_set(base, "base2", APR_HASH_KEY_STRING, "value2"); @@ -388,13 +388,13 @@ static void overlay_same(CuTest *tc) result = apr_hash_overlay(p, base, base); count = apr_hash_count(result); - CuAssertIntEquals(tc, 5, count); + abts_int_equal(tc, 5, count); dump_hash(p, result, str); /* I don't know why these are out of order, but they are. I would probably * consider this a bug, but others should comment. */ - CuAssertStrEquals(tc, "Key base5 (5) Value value5\n" + abts_str_equal(tc, "Key base5 (5) Value value5\n" "Key base1 (5) Value value1\n" "Key base2 (5) Value value2\n" "Key base3 (5) Value value3\n" @@ -402,28 +402,28 @@ static void overlay_same(CuTest *tc) "#entries 5\n", str); } -CuSuite *testhash(void) +abts_suite *testhash(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Hash"); - - SUITE_ADD_TEST(suite, hash_make); - SUITE_ADD_TEST(suite, hash_set); - SUITE_ADD_TEST(suite, hash_reset); - SUITE_ADD_TEST(suite, same_value); - SUITE_ADD_TEST(suite, same_value_custom); - SUITE_ADD_TEST(suite, key_space); - SUITE_ADD_TEST(suite, delete_key); - - SUITE_ADD_TEST(suite, hash_count_0); - SUITE_ADD_TEST(suite, hash_count_1); - SUITE_ADD_TEST(suite, hash_count_5); - - SUITE_ADD_TEST(suite, hash_traverse); - SUITE_ADD_TEST(suite, summation_test); - - SUITE_ADD_TEST(suite, overlay_empty); - SUITE_ADD_TEST(suite, overlay_2unique); - SUITE_ADD_TEST(suite, overlay_same); + suite = ADD_SUITE(suite) + + abts_run_test(suite, hash_make, NULL); + abts_run_test(suite, hash_set, NULL); + abts_run_test(suite, hash_reset, NULL); + abts_run_test(suite, same_value, NULL); + abts_run_test(suite, same_value_custom, NULL); + abts_run_test(suite, key_space, NULL); + abts_run_test(suite, delete_key, NULL); + + abts_run_test(suite, hash_count_0, NULL); + abts_run_test(suite, hash_count_1, NULL); + abts_run_test(suite, hash_count_5, NULL); + + abts_run_test(suite, hash_traverse, NULL); + abts_run_test(suite, summation_test, NULL); + + abts_run_test(suite, overlay_empty, NULL); + abts_run_test(suite, overlay_2unique, NULL); + abts_run_test(suite, overlay_same, NULL); return suite; } diff --git a/test/testipsub.c b/test/testipsub.c index 63d56783ee6..d9f8f6708a3 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -13,12 +13,12 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr_general.h" #include "apr_network_io.h" #include "apr_errno.h" -static void test_bad_input(CuTest *tc) +static void test_bad_input(abts_case *tc, void *data) { struct { const char *ipstr; @@ -67,11 +67,11 @@ static void test_bad_input(CuTest *tc) for (i = 0; i < (sizeof testcases / sizeof testcases[0]); i++) { rv = apr_ipsubnet_create(&ipsub, testcases[i].ipstr, testcases[i].mask, p); - CuAssertIntEquals(tc, rv, testcases[i].expected_rv); + abts_int_equal(tc, rv, testcases[i].expected_rv); } } -static void test_singleton_subnets(CuTest *tc) +static void test_singleton_subnets(abts_case *tc, void *data) { const char *v4addrs[] = { "127.0.0.1", "129.42.18.99", "63.161.155.20", "207.46.230.229", "64.208.42.36", @@ -85,16 +85,16 @@ static void test_singleton_subnets(CuTest *tc) for (i = 0; i < sizeof v4addrs / sizeof v4addrs[0]; i++) { rv = apr_ipsubnet_create(&ipsub, v4addrs[i], NULL, p); - CuAssertTrue(tc, rv == APR_SUCCESS); + abts_true(tc, rv == APR_SUCCESS); for (j = 0; j < sizeof v4addrs / sizeof v4addrs[0]; j++) { rv = apr_sockaddr_info_get(&sa, v4addrs[j], APR_INET, 0, 0, p); - CuAssertTrue(tc, rv == APR_SUCCESS); + abts_true(tc, rv == APR_SUCCESS); rc = apr_ipsubnet_test(ipsub, sa); if (!strcmp(v4addrs[i], v4addrs[j])) { - CuAssertTrue(tc, rc != 0); + abts_true(tc, rc != 0); } else { - CuAssertTrue(tc, rc == 0); + abts_true(tc, rc == 0); } } } @@ -102,7 +102,7 @@ static void test_singleton_subnets(CuTest *tc) /* same for v6? */ } -static void test_interesting_subnets(CuTest *tc) +static void test_interesting_subnets(abts_case *tc, void *data) { struct { const char *ipstr, *mask; @@ -130,43 +130,43 @@ static void test_interesting_subnets(CuTest *tc) for (i = 0; i < sizeof testcases / sizeof testcases[0]; i++) { rv = apr_ipsubnet_create(&ipsub, testcases[i].ipstr, testcases[i].mask, p); - CuAssertTrue(tc, rv == APR_SUCCESS); + abts_true(tc, rv == APR_SUCCESS); rv = apr_sockaddr_info_get(&sa, testcases[i].in_subnet, testcases[i].family, 0, 0, p); - CuAssertTrue(tc, rv == APR_SUCCESS); + abts_true(tc, rv == APR_SUCCESS); rc = apr_ipsubnet_test(ipsub, sa); - CuAssertTrue(tc, rc != 0); + abts_true(tc, rc != 0); rv = apr_sockaddr_info_get(&sa, testcases[i].not_in_subnet, testcases[i].family, 0, 0, p); - CuAssertTrue(tc, rv == APR_SUCCESS); + abts_true(tc, rv == APR_SUCCESS); rc = apr_ipsubnet_test(ipsub, sa); - CuAssertTrue(tc, rc == 0); + abts_true(tc, rc == 0); } } -static void test_badmask_str(CuTest *tc) +static void test_badmask_str(abts_case *tc, void *data) { char buf[128]; - CuAssertStrEquals(tc, apr_strerror(APR_EBADMASK, buf, sizeof buf), + abts_str_equal(tc, apr_strerror(APR_EBADMASK, buf, sizeof buf), "The specified network mask is invalid."); } -static void test_badip_str(CuTest *tc) +static void test_badip_str(abts_case *tc, void *data) { char buf[128]; - CuAssertStrEquals(tc, apr_strerror(APR_EBADIP, buf, sizeof buf), + abts_str_equal(tc, apr_strerror(APR_EBADIP, buf, sizeof buf), "The specified IP address is invalid."); } -CuSuite *testipsub(void) +abts_suite *testipsub(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("IP subnets"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, test_bad_input); - SUITE_ADD_TEST(suite, test_singleton_subnets); - SUITE_ADD_TEST(suite, test_interesting_subnets); - SUITE_ADD_TEST(suite, test_badmask_str); - SUITE_ADD_TEST(suite, test_badip_str); + abts_run_test(suite, test_bad_input, NULL); + abts_run_test(suite, test_singleton_subnets, NULL); + abts_run_test(suite, test_interesting_subnets, NULL); + abts_run_test(suite, test_badmask_str, NULL); + abts_run_test(suite, test_badip_str, NULL); return suite; } diff --git a/test/testlfs.c b/test/testlfs.c index ab73629ce39..c9992221b37 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -21,7 +21,7 @@ #include "apr_strings.h" #include "apr_lib.h" #include "apr_mmap.h" -#include "test_apr.h" +#include "testutil.h" /* Only enable these tests by default on platforms which support sparse * files... just Unixes? */ @@ -35,13 +35,13 @@ static apr_off_t eightGb = APR_INT64_C(2) << 32; static int madefile = 0; -#define PRECOND if (!madefile) CuNotImpl(tc, "Large file tests not enabled") +#define PRECOND if (!madefile) abts_not_impl(tc, "Large file tests not enabled") #define TESTDIR "lfstests" #define TESTFILE "large.bin" #define TESTFN "lfstests/large.bin" -static void test_open(CuTest *tc) +static void test_open(abts_case *tc, void *data) { apr_file_t *f; apr_status_t rv; @@ -67,7 +67,7 @@ static void test_open(CuTest *tc) || rv == EFBIG #endif ) { - CuNotImpl(tc, "Creation of large file (limited by rlimit or fs?)"); + abts_not_impl(tc, "Creation of large file (limited by rlimit or fs?)"); } else { apr_assert_success(tc, "truncate file to 8gb", rv); @@ -76,7 +76,7 @@ static void test_open(CuTest *tc) madefile = 1; } -static void test_reopen(CuTest *tc) +static void test_reopen(abts_case *tc, void *data) { apr_file_t *fh; apr_finfo_t finfo; @@ -89,13 +89,13 @@ static void test_reopen(CuTest *tc) apr_assert_success(tc, "file_info_get failed", apr_file_info_get(&finfo, APR_FINFO_NORM, fh)); - CuAssert(tc, "file_info_get gave incorrect size", + abts_assert(tc, "file_info_get gave incorrect size", finfo.size == eightGb); apr_assert_success(tc, "re-close large file", apr_file_close(fh)); } -static void test_stat(CuTest *tc) +static void test_stat(abts_case *tc, void *data) { apr_finfo_t finfo; @@ -104,10 +104,10 @@ static void test_stat(CuTest *tc) apr_assert_success(tc, "stat large file", apr_stat(&finfo, TESTFN, APR_FINFO_NORM, p)); - CuAssert(tc, "stat gave incorrect size", finfo.size == eightGb); + abts_assert(tc, "stat gave incorrect size", finfo.size == eightGb); } -static void test_readdir(CuTest *tc) +static void test_readdir(abts_case *tc, void *data) { apr_dir_t *dh; apr_status_t rv; @@ -123,7 +123,7 @@ static void test_readdir(CuTest *tc) rv = apr_dir_read(&finfo, APR_FINFO_NORM, dh); if (rv == APR_SUCCESS && strcmp(finfo.name, TESTFILE) == 0) { - CuAssert(tc, "apr_dir_read gave incorrect size for large file", + abts_assert(tc, "apr_dir_read gave incorrect size for large file", finfo.size == eightGb); } @@ -139,7 +139,7 @@ static void test_readdir(CuTest *tc) #define TESTSTR "Hello, world." -static void test_append(CuTest *tc) +static void test_append(abts_case *tc, void *data) { apr_file_t *fh; apr_finfo_t finfo; @@ -156,13 +156,13 @@ static void test_append(CuTest *tc) apr_assert_success(tc, "file_info_get failed", apr_file_info_get(&finfo, APR_FINFO_NORM, fh)); - CuAssert(tc, "file_info_get gave incorrect size", + abts_assert(tc, "file_info_get gave incorrect size", finfo.size == eightGb + strlen(TESTSTR)); apr_assert_success(tc, "close 8Gb file", apr_file_close(fh)); } -static void test_seek(CuTest *tc) +static void test_seek(abts_case *tc, void *data) { apr_file_t *fh; apr_off_t pos; @@ -176,20 +176,20 @@ static void test_seek(CuTest *tc) pos = 0; apr_assert_success(tc, "relative seek to end", apr_file_seek(fh, APR_END, &pos)); - CuAssert(tc, "seek to END gave 8Gb", pos == eightGb); + abts_assert(tc, "seek to END gave 8Gb", pos == eightGb); pos = eightGb; apr_assert_success(tc, "seek to 8Gb", apr_file_seek(fh, APR_SET, &pos)); - CuAssert(tc, "seek gave 8Gb offset", pos == eightGb); + abts_assert(tc, "seek gave 8Gb offset", pos == eightGb); pos = 0; apr_assert_success(tc, "relative seek to 0", apr_file_seek(fh, APR_CUR, &pos)); - CuAssert(tc, "relative seek gave 8Gb offset", pos == eightGb); + abts_assert(tc, "relative seek gave 8Gb offset", pos == eightGb); apr_file_close(fh); } -static void test_write(CuTest *tc) +static void test_write(abts_case *tc, void *data) { apr_file_t *fh; apr_off_t pos = eightGb - 4; @@ -201,7 +201,7 @@ static void test_write(CuTest *tc) apr_assert_success(tc, "seek to 8Gb - 4", apr_file_seek(fh, APR_SET, &pos)); - CuAssert(tc, "seek gave 8Gb-4 offset", pos == eightGb - 4); + abts_assert(tc, "seek gave 8Gb-4 offset", pos == eightGb - 4); apr_assert_success(tc, "write magic string to 8Gb-4", apr_file_write_full(fh, "FISH", 4, NULL)); @@ -211,7 +211,7 @@ static void test_write(CuTest *tc) #if APR_HAS_MMAP -static void test_mmap(CuTest *tc) +static void test_mmap(abts_case *tc, void *data) { apr_mmap_t *map; apr_file_t *fh; @@ -229,19 +229,19 @@ static void test_mmap(CuTest *tc) apr_assert_success(tc, "close file", apr_file_close(fh)); - CuAssert(tc, "mapped a 16K block", map->size == len); + abts_assert(tc, "mapped a 16K block", map->size == len); apr_assert_success(tc, "get pointer into mmaped region", apr_mmap_offset(&ptr, map, len - 4)); - CuAssert(tc, "pointer was not NULL", ptr != NULL); + abts_assert(tc, "pointer was not NULL", ptr != NULL); - CuAssert(tc, "found the magic string", memcmp(ptr, "FISH", 4) == 0); + abts_assert(tc, "found the magic string", memcmp(ptr, "FISH", 4) == 0); apr_assert_success(tc, "delete mmap handle", apr_mmap_delete(map)); } #endif /* APR_HAS_MMAP */ -static void test_format(CuTest *tc) +static void test_format(abts_case *tc, void *data) { apr_off_t off; @@ -249,35 +249,35 @@ static void test_format(CuTest *tc) off = apr_atoi64(apr_off_t_toa(p, eightGb)); - CuAssert(tc, "apr_atoi64 parsed apr_off_t_toa result incorrectly", + abts_assert(tc, "apr_atoi64 parsed apr_off_t_toa result incorrectly", off == eightGb); } #else -static void test_nolfs(CuTest *tc) +static void test_nolfs(abts_case *tc, void *data) { - CuNotImpl(tc, "Large Files not supported"); + abts_not_impl(tc, "Large Files not supported"); } #endif -CuSuite *testlfs(void) +abts_suite *testlfs(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Large File Support"); + suite = ADD_SUITE(suite) #ifdef USE_LFS_TESTS - SUITE_ADD_TEST(suite, test_open); - SUITE_ADD_TEST(suite, test_reopen); - SUITE_ADD_TEST(suite, test_stat); - SUITE_ADD_TEST(suite, test_readdir); - SUITE_ADD_TEST(suite, test_seek); - SUITE_ADD_TEST(suite, test_append); - SUITE_ADD_TEST(suite, test_write); + abts_run_test(suite, test_open, NULL); + abts_run_test(suite, test_reopen, NULL); + abts_run_test(suite, test_stat, NULL); + abts_run_test(suite, test_readdir, NULL); + abts_run_test(suite, test_seek, NULL); + abts_run_test(suite, test_append, NULL); + abts_run_test(suite, test_write, NULL); #if APR_HAS_MMAP - SUITE_ADD_TEST(suite, test_mmap); + abts_run_test(suite, test_mmap, NULL); #endif - SUITE_ADD_TEST(suite, test_format); + abts_run_test(suite, test_format, NULL); #else - SUITE_ADD_TEST(suite, test_nolfs); + abts_run_test(suite, test_nolfs, NULL); #endif return suite; diff --git a/test/testlock.c b/test/testlock.c index 0bd226a465c..7609c7ec172 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -21,7 +21,7 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_getopt.h" -#include "test_apr.h" +#include "testutil.h" #if APR_HAS_THREADS @@ -148,43 +148,43 @@ static void *APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data) return NULL; } -static void test_thread_mutex(CuTest *tc) +static void test_thread_mutex(abts_case *tc, void *data) { apr_thread_t *t1, *t2, *t3, *t4; apr_status_t s1, s2, s3, s4; s1 = apr_thread_mutex_create(&thread_mutex, APR_THREAD_MUTEX_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, s1); - CuAssertPtrNotNull(tc, thread_mutex); + abts_int_equal(tc, APR_SUCCESS, s1); + abts_ptr_notnull(tc, thread_mutex); i = 0; x = 0; s1 = apr_thread_create(&t1, NULL, thread_mutex_function, NULL, p); - CuAssertIntEquals(tc, APR_SUCCESS, s1); + abts_int_equal(tc, APR_SUCCESS, s1); s2 = apr_thread_create(&t2, NULL, thread_mutex_function, NULL, p); - CuAssertIntEquals(tc, APR_SUCCESS, s2); + abts_int_equal(tc, APR_SUCCESS, s2); s3 = apr_thread_create(&t3, NULL, thread_mutex_function, NULL, p); - CuAssertIntEquals(tc, APR_SUCCESS, s3); + abts_int_equal(tc, APR_SUCCESS, s3); s4 = apr_thread_create(&t4, NULL, thread_mutex_function, NULL, p); - CuAssertIntEquals(tc, APR_SUCCESS, s4); + abts_int_equal(tc, APR_SUCCESS, s4); apr_thread_join(&s1, t1); apr_thread_join(&s2, t2); apr_thread_join(&s3, t3); apr_thread_join(&s4, t4); - CuAssertIntEquals(tc, MAX_ITER, x); + abts_int_equal(tc, MAX_ITER, x); } -static void test_thread_rwlock(CuTest *tc) +static void test_thread_rwlock(abts_case *tc, void *data) { apr_thread_t *t1, *t2, *t3, *t4; apr_status_t s1, s2, s3, s4; s1 = apr_thread_rwlock_create(&rwlock, p); apr_assert_success(tc, "rwlock_create", s1); - CuAssertPtrNotNull(tc, rwlock); + abts_ptr_notnull(tc, rwlock); i = 0; x = 0; @@ -203,10 +203,10 @@ static void test_thread_rwlock(CuTest *tc) apr_thread_join(&s3, t3); apr_thread_join(&s4, t4); - CuAssertIntEquals(tc, MAX_ITER, x); + abts_int_equal(tc, MAX_ITER, x); } -static void test_cond(CuTest *tc) +static void test_cond(abts_case *tc, void *data) { apr_thread_t *p1, *p2, *p3, *p4, *c1; apr_status_t s0, s1, s2, s3, s4; @@ -216,16 +216,16 @@ static void test_cond(CuTest *tc) apr_assert_success(tc, "create put mutex", apr_thread_mutex_create(&put.mutex, APR_THREAD_MUTEX_DEFAULT, p)); - CuAssertPtrNotNull(tc, put.mutex); + abts_ptr_notnull(tc, put.mutex); apr_assert_success(tc, "create nready mutex", apr_thread_mutex_create(&nready.mutex, APR_THREAD_MUTEX_DEFAULT, p)); - CuAssertPtrNotNull(tc, nready.mutex); + abts_ptr_notnull(tc, nready.mutex); apr_assert_success(tc, "create condvar", apr_thread_cond_create(&nready.cond, p)); - CuAssertPtrNotNull(tc, nready.cond); + abts_ptr_notnull(tc, nready.cond); count1 = count2 = count3 = count4 = 0; put.nput = put.nval = 0; @@ -234,15 +234,15 @@ static void test_cond(CuTest *tc) x = 0; s0 = apr_thread_create(&p1, NULL, thread_cond_producer, &count1, p); - CuAssertIntEquals(tc, APR_SUCCESS, s0); + abts_int_equal(tc, APR_SUCCESS, s0); s1 = apr_thread_create(&p2, NULL, thread_cond_producer, &count2, p); - CuAssertIntEquals(tc, APR_SUCCESS, s1); + abts_int_equal(tc, APR_SUCCESS, s1); s2 = apr_thread_create(&p3, NULL, thread_cond_producer, &count3, p); - CuAssertIntEquals(tc, APR_SUCCESS, s2); + abts_int_equal(tc, APR_SUCCESS, s2); s3 = apr_thread_create(&p4, NULL, thread_cond_producer, &count4, p); - CuAssertIntEquals(tc, APR_SUCCESS, s3); + abts_int_equal(tc, APR_SUCCESS, s3); s4 = apr_thread_create(&c1, NULL, thread_cond_consumer, NULL, p); - CuAssertIntEquals(tc, APR_SUCCESS, s4); + abts_int_equal(tc, APR_SUCCESS, s4); apr_thread_join(&s0, p1); apr_thread_join(&s1, p2); @@ -258,10 +258,10 @@ static void test_cond(CuTest *tc) printf("count1 = %d count2 = %d count3 = %d count4 = %d\n", count1, count2, count3, count4); */ - CuAssertIntEquals(tc, MAX_COUNTER, sum); + abts_int_equal(tc, MAX_COUNTER, sum); } -static void test_timeoutcond(CuTest *tc) +static void test_timeoutcond(abts_case *tc, void *data) { apr_status_t s; apr_interval_time_t timeout; @@ -269,12 +269,12 @@ static void test_timeoutcond(CuTest *tc) int i; s = apr_thread_mutex_create(&timeout_mutex, APR_THREAD_MUTEX_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, s); - CuAssertPtrNotNull(tc, timeout_mutex); + abts_int_equal(tc, APR_SUCCESS, s); + abts_ptr_notnull(tc, timeout_mutex); s = apr_thread_cond_create(&timeout_cond, p); - CuAssertIntEquals(tc, APR_SUCCESS, s); - CuAssertPtrNotNull(tc, timeout_cond); + abts_int_equal(tc, APR_SUCCESS, s); + abts_ptr_notnull(tc, timeout_cond); timeout = apr_time_from_sec(5); @@ -289,34 +289,34 @@ static void test_timeoutcond(CuTest *tc) if (s != APR_SUCCESS && !APR_STATUS_IS_TIMEUP(s)) { continue; } - CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(s)); - CuAssert(tc, "Timer returned too late", end - begin - timeout < 100000); + abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(s)); + abts_assert(tc, "Timer returned too late", end - begin - timeout < 100000); break; } - CuAssert(tc, "Too many retries", i < MAX_RETRY); + abts_assert(tc, "Too many retries", i < MAX_RETRY); } #endif /* !APR_HAS_THREADS */ #if !APR_HAS_THREADS -static void threads_not_impl(CuTest *tc) +static void threads_not_impl(abts_case *tc, void *data) { - CuNotImpl(tc, "Threads not implemented on this platform"); + abts_not_impl(tc, "Threads not implemented on this platform"); } #endif -CuSuite *testlock(void) +abts_suite *testlock(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Thread Locks"); + suite = ADD_SUITE(suite) #if !APR_HAS_THREADS - SUITE_ADD_TEST(suite, threads_not_impl); + abts_run_test(suite, threads_not_impl, NULL); #else - SUITE_ADD_TEST(suite, test_thread_mutex); - SUITE_ADD_TEST(suite, test_thread_rwlock); - SUITE_ADD_TEST(suite, test_cond); - SUITE_ADD_TEST(suite, test_timeoutcond); + abts_run_test(suite, test_thread_mutex, NULL); + abts_run_test(suite, test_thread_rwlock, NULL); + abts_run_test(suite, test_cond, NULL); + abts_run_test(suite, test_timeoutcond, NULL); #endif return suite; diff --git a/test/testlockperf.c b/test/testlockperf.c index 1ebaa552dad..ea2da439430 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -23,7 +23,7 @@ #include "errno.h" #include #include -#include "test_apr.h" +#include "testutil.h" #if !APR_HAS_THREADS int main(void) diff --git a/test/testmmap.c b/test/testmmap.c index 60e74c73d66..4b402a8e624 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr_mmap.h" #include "apr_errno.h" #include "apr_general.h" @@ -28,9 +28,9 @@ #define TEST_STRING "This is the MMAP data file."APR_EOL_STR #if !APR_HAS_MMAP -static void not_implemented(CuTest *tc) +static void not_implemented(abts_case *tc, void *data) { - CuNotImpl(tc, "User functions"); + abts_not_impl(tc, "User functions"); } #else @@ -41,110 +41,110 @@ static char *file1; static apr_finfo_t finfo; static int fsize; -static void create_filename(CuTest *tc) +static void create_filename(abts_case *tc, void *data) { char *oldfileptr; apr_filepath_get(&file1, 0, p); #ifndef NETWARE #ifdef WIN32 - CuAssertTrue(tc, file1[1] == ':'); + abts_true(tc, file1[1] == ':'); #else - CuAssertTrue(tc, file1[0] == '/'); + abts_true(tc, file1[0] == '/'); #endif #endif - CuAssertTrue(tc, file1[strlen(file1) - 1] != '/'); + abts_true(tc, file1[strlen(file1) - 1] != '/'); oldfileptr = file1; file1 = apr_pstrcat(p, file1,"/data/mmap_datafile.txt" ,NULL); - CuAssertTrue(tc, oldfileptr != file1); + abts_true(tc, oldfileptr != file1); } -static void test_file_close(CuTest *tc) +static void test_file_close(abts_case *tc, void *data) { apr_status_t rv; rv = apr_file_close(thefile); - CuAssertIntEquals(tc, rv, APR_SUCCESS); + abts_int_equal(tc, rv, APR_SUCCESS); } -static void test_file_open(CuTest *tc) +static void test_file_open(abts_case *tc, void *data) { apr_status_t rv; rv = apr_file_open(&thefile, file1, APR_READ, APR_UREAD | APR_GREAD, p); - CuAssertIntEquals(tc, rv, APR_SUCCESS); - CuAssertPtrNotNull(tc, thefile); + abts_int_equal(tc, rv, APR_SUCCESS); + abts_ptr_notnull(tc, thefile); } -static void test_get_filesize(CuTest *tc) +static void test_get_filesize(abts_case *tc, void *data) { apr_status_t rv; rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); - CuAssertIntEquals(tc, rv, APR_SUCCESS); - CuAssertIntEquals(tc, fsize, finfo.size); + abts_int_equal(tc, rv, APR_SUCCESS); + abts_int_equal(tc, fsize, finfo.size); } -static void test_mmap_create(CuTest *tc) +static void test_mmap_create(abts_case *tc, void *data) { apr_status_t rv; rv = apr_mmap_create(&themmap, thefile, 0, finfo.size, APR_MMAP_READ, p); - CuAssertPtrNotNull(tc, themmap); - CuAssertIntEquals(tc, rv, APR_SUCCESS); + abts_ptr_notnull(tc, themmap); + abts_int_equal(tc, rv, APR_SUCCESS); } -static void test_mmap_contents(CuTest *tc) +static void test_mmap_contents(abts_case *tc, void *data) { - CuAssertPtrNotNull(tc, themmap); - CuAssertPtrNotNull(tc, themmap->mm); - CuAssertIntEquals(tc, fsize, themmap->size); + abts_ptr_notnull(tc, themmap); + abts_ptr_notnull(tc, themmap->mm); + abts_int_equal(tc, fsize, themmap->size); /* Must use nEquals since the string is not guaranteed to be NULL terminated */ - CuAssertStrNEquals(tc, themmap->mm, TEST_STRING, fsize); + abts_str_nequal(tc, themmap->mm, TEST_STRING, fsize); } -static void test_mmap_delete(CuTest *tc) +static void test_mmap_delete(abts_case *tc, void *data) { apr_status_t rv; - CuAssertPtrNotNull(tc, themmap); + abts_ptr_notnull(tc, themmap); rv = apr_mmap_delete(themmap); - CuAssertIntEquals(tc, rv, APR_SUCCESS); + abts_int_equal(tc, rv, APR_SUCCESS); } -static void test_mmap_offset(CuTest *tc) +static void test_mmap_offset(abts_case *tc, void *data) { apr_status_t rv; void *addr; - CuAssertPtrNotNull(tc, themmap); + abts_ptr_notnull(tc, themmap); rv = apr_mmap_offset(&addr, themmap, 5); /* Must use nEquals since the string is not guaranteed to be NULL terminated */ - CuAssertStrNEquals(tc, addr, TEST_STRING + 5, fsize-5); + abts_str_nequal(tc, addr, TEST_STRING + 5, fsize-5); } #endif -CuSuite *testmmap(void) +abts_suite *testmmap(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("MMAP"); + suite = ADD_SUITE(suite) #if APR_HAS_MMAP fsize = strlen(TEST_STRING); - SUITE_ADD_TEST(suite, create_filename); - SUITE_ADD_TEST(suite, test_file_open); - SUITE_ADD_TEST(suite, test_get_filesize); - SUITE_ADD_TEST(suite, test_mmap_create); - SUITE_ADD_TEST(suite, test_mmap_contents); - SUITE_ADD_TEST(suite, test_mmap_offset); - SUITE_ADD_TEST(suite, test_mmap_delete); - SUITE_ADD_TEST(suite, test_file_close); + abts_run_test(suite, create_filename, NULL); + abts_run_test(suite, test_file_open, NULL); + abts_run_test(suite, test_get_filesize, NULL); + abts_run_test(suite, test_mmap_create, NULL); + abts_run_test(suite, test_mmap_contents, NULL); + abts_run_test(suite, test_mmap_offset, NULL); + abts_run_test(suite, test_mmap_delete, NULL); + abts_run_test(suite, test_file_close, NULL); #else - SUITE_ADD_TEST(suite, not_implemented); + abts_run_test(suite, not_implemented, NULL); #endif return suite; diff --git a/test/testnames.c b/test/testnames.c index e2166a8eb26..705656a8ffd 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr_file_io.h" #include "apr_file_info.h" #include "apr_errno.h" @@ -29,7 +29,7 @@ #define ABS_ROOT "/" #endif -static void merge_aboveroot(CuTest *tc) +static void merge_aboveroot(abts_case *tc, void *data) { apr_status_t rv; char *dstpath = NULL; @@ -38,47 +38,47 @@ static void merge_aboveroot(CuTest *tc) rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"bar", APR_FILEPATH_NOTABOVEROOT, p); apr_strerror(rv, errmsg, sizeof(errmsg)); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_EABOVEROOT(rv)); - CuAssertPtrEquals(tc, NULL, dstpath); - CuAssertStrEquals(tc, "The given path was above the root path", errmsg); + abts_int_equal(tc, 1, APR_STATUS_IS_EABOVEROOT(rv)); + abts_ptr_equal(tc, NULL, dstpath); + abts_str_equal(tc, "The given path was above the root path", errmsg); } -static void merge_belowroot(CuTest *tc) +static void merge_belowroot(abts_case *tc, void *data) { apr_status_t rv; char *dstpath = NULL; rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"foo/bar", APR_FILEPATH_NOTABOVEROOT, p); - CuAssertPtrNotNull(tc, dstpath); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, ABS_ROOT"foo/bar", dstpath); + abts_ptr_notnull(tc, dstpath); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, ABS_ROOT"foo/bar", dstpath); } -static void merge_noflag(CuTest *tc) +static void merge_noflag(abts_case *tc, void *data) { apr_status_t rv; char *dstpath = NULL; rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"foo/bar", 0, p); - CuAssertPtrNotNull(tc, dstpath); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, ABS_ROOT"foo/bar", dstpath); + abts_ptr_notnull(tc, dstpath); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, ABS_ROOT"foo/bar", dstpath); } -static void merge_dotdot(CuTest *tc) +static void merge_dotdot(abts_case *tc, void *data) { apr_status_t rv; char *dstpath = NULL; rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz", 0, p); - CuAssertPtrNotNull(tc, dstpath); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, ABS_ROOT"foo/baz", dstpath); + abts_ptr_notnull(tc, dstpath); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, ABS_ROOT"foo/baz", dstpath); rv = apr_filepath_merge(&dstpath, "", "../test", 0, p); - CuAssertIntEquals(tc, 0, APR_SUCCESS); - CuAssertStrEquals(tc, "../test", dstpath); + abts_int_equal(tc, 0, APR_SUCCESS); + abts_str_equal(tc, "../test", dstpath); /* Very dangerous assumptions here about what the cwd is. However, let's assume * that the testall is invoked from within apr/test/ so the following test should @@ -86,34 +86,34 @@ static void merge_dotdot(CuTest *tc) * the case of the test directory: */ rv = apr_filepath_merge(&dstpath, "", "../test", APR_FILEPATH_TRUENAME, p); - CuAssertIntEquals(tc, 0, APR_SUCCESS); - CuAssertStrEquals(tc, "../test", dstpath); + abts_int_equal(tc, 0, APR_SUCCESS); + abts_str_equal(tc, "../test", dstpath); } -static void merge_secure(CuTest *tc) +static void merge_secure(abts_case *tc, void *data) { apr_status_t rv; char *dstpath = NULL; rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../bar/baz", 0, p); - CuAssertPtrNotNull(tc, dstpath); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, ABS_ROOT"foo/bar/baz", dstpath); + abts_ptr_notnull(tc, dstpath); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, ABS_ROOT"foo/bar/baz", dstpath); } -static void merge_notrel(CuTest *tc) +static void merge_notrel(abts_case *tc, void *data) { apr_status_t rv; char *dstpath = NULL; rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz", APR_FILEPATH_NOTRELATIVE, p); - CuAssertPtrNotNull(tc, dstpath); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, ABS_ROOT"foo/baz", dstpath); + abts_ptr_notnull(tc, dstpath); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, ABS_ROOT"foo/baz", dstpath); } -static void merge_notrelfail(CuTest *tc) +static void merge_notrelfail(abts_case *tc, void *data) { apr_status_t rv; char *dstpath = NULL; @@ -123,12 +123,12 @@ static void merge_notrelfail(CuTest *tc) APR_FILEPATH_NOTRELATIVE, p); apr_strerror(rv, errmsg, sizeof(errmsg)); - CuAssertPtrEquals(tc, NULL, dstpath); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_ERELATIVE(rv)); - CuAssertStrEquals(tc, "The given path is relative", errmsg); + abts_ptr_equal(tc, NULL, dstpath); + abts_int_equal(tc, 1, APR_STATUS_IS_ERELATIVE(rv)); + abts_str_equal(tc, "The given path is relative", errmsg); } -static void merge_notabsfail(CuTest *tc) +static void merge_notabsfail(abts_case *tc, void *data) { apr_status_t rv; char *dstpath = NULL; @@ -138,12 +138,12 @@ static void merge_notabsfail(CuTest *tc) APR_FILEPATH_NOTABSOLUTE, p); apr_strerror(rv, errmsg, sizeof(errmsg)); - CuAssertPtrEquals(tc, NULL, dstpath); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_EABSOLUTE(rv)); - CuAssertStrEquals(tc, "The given path is absolute", errmsg); + abts_ptr_equal(tc, NULL, dstpath); + abts_int_equal(tc, 1, APR_STATUS_IS_EABSOLUTE(rv)); + abts_str_equal(tc, "The given path is absolute", errmsg); } -static void merge_notabs(CuTest *tc) +static void merge_notabs(abts_case *tc, void *data) { apr_status_t rv; char *dstpath = NULL; @@ -151,12 +151,12 @@ static void merge_notabs(CuTest *tc) rv = apr_filepath_merge(&dstpath, "foo/bar", "../baz", APR_FILEPATH_NOTABSOLUTE, p); - CuAssertPtrNotNull(tc, dstpath); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, "foo/baz", dstpath); + abts_ptr_notnull(tc, dstpath); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, "foo/baz", dstpath); } -static void root_absolute(CuTest *tc) +static void root_absolute(abts_case *tc, void *data) { apr_status_t rv; const char *root = NULL; @@ -164,12 +164,12 @@ static void root_absolute(CuTest *tc) rv = apr_filepath_root(&root, &path, 0, p); - CuAssertPtrNotNull(tc, root); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, ABS_ROOT, root); + abts_ptr_notnull(tc, root); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, ABS_ROOT, root); } -static void root_relative(CuTest *tc) +static void root_relative(abts_case *tc, void *data) { apr_status_t rv; const char *root = NULL; @@ -179,9 +179,9 @@ static void root_relative(CuTest *tc) rv = apr_filepath_root(&root, &path, 0, p); apr_strerror(rv, errmsg, sizeof(errmsg)); - CuAssertPtrEquals(tc, NULL, root); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_ERELATIVE(rv)); - CuAssertStrEquals(tc, "The given path is relative", errmsg); + abts_ptr_equal(tc, NULL, root); + abts_int_equal(tc, 1, APR_STATUS_IS_ERELATIVE(rv)); + abts_str_equal(tc, "The given path is relative", errmsg); } @@ -191,22 +191,22 @@ static void root_relative(CuTest *tc) } #endif -CuSuite *testnames(void) +abts_suite *testnames(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Path names"); - - SUITE_ADD_TEST(suite, merge_aboveroot); - SUITE_ADD_TEST(suite, merge_belowroot); - SUITE_ADD_TEST(suite, merge_noflag); - SUITE_ADD_TEST(suite, merge_dotdot); - SUITE_ADD_TEST(suite, merge_secure); - SUITE_ADD_TEST(suite, merge_notrel); - SUITE_ADD_TEST(suite, merge_notrelfail); - SUITE_ADD_TEST(suite, merge_notabs); - SUITE_ADD_TEST(suite, merge_notabsfail); - - SUITE_ADD_TEST(suite, root_absolute); - SUITE_ADD_TEST(suite, root_relative); + suite = ADD_SUITE(suite) + + abts_run_test(suite, merge_aboveroot, NULL); + abts_run_test(suite, merge_belowroot, NULL); + abts_run_test(suite, merge_noflag, NULL); + abts_run_test(suite, merge_dotdot, NULL); + abts_run_test(suite, merge_secure, NULL); + abts_run_test(suite, merge_notrel, NULL); + abts_run_test(suite, merge_notrelfail, NULL); + abts_run_test(suite, merge_notabs, NULL); + abts_run_test(suite, merge_notabsfail, NULL); + + abts_run_test(suite, root_absolute, NULL); + abts_run_test(suite, root_relative, NULL); return suite; } diff --git a/test/testoc.c b/test/testoc.c index f5c79fba28d..e5fec431b77 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr_thread_proc.h" #include "apr_errno.h" #include "apr_general.h" @@ -53,7 +53,7 @@ static void ocmaint(int reason, void *data, int status) /* It would be great if we could stress this stuff more, and make the test * more granular. */ -static void test_child_kill(CuTest *tc) +static void test_child_kill(abts_case *tc, void *data) { apr_file_t *std = NULL; apr_proc_t newproc; @@ -66,17 +66,17 @@ static void test_child_kill(CuTest *tc) args[2] = NULL; rv = apr_procattr_create(&procattr, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_NO_PIPE, APR_NO_PIPE); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_proc_create(&newproc, "./occhild" EXTENSION, args, NULL, procattr, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, newproc.in); - CuAssertPtrEquals(tc, NULL, newproc.out); - CuAssertPtrEquals(tc, NULL, newproc.err); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, newproc.in); + abts_ptr_equal(tc, NULL, newproc.out); + abts_ptr_equal(tc, NULL, newproc.err); std = newproc.in; @@ -84,31 +84,31 @@ static void test_child_kill(CuTest *tc) apr_sleep(apr_time_from_sec(1)); rv = apr_proc_kill(&newproc, SIGKILL); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); /* allow time for things to settle... */ apr_sleep(apr_time_from_sec(3)); apr_proc_other_child_refresh_all(APR_OC_REASON_RUNNING); - CuAssertStrEquals(tc, "APR_OC_REASON_DEATH", reasonstr); + abts_str_equal(tc, "APR_OC_REASON_DEATH", reasonstr); } #else -static void oc_not_impl(CuTest *tc) +static void oc_not_impl(abts_case *tc, void *data) { - CuNotImpl(tc, "Other child logic not implemented on this platform"); + abts_not_impl(tc, "Other child logic not implemented on this platform"); } #endif -CuSuite *testoc(void) +abts_suite *testoc(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Other Child"); + suite = ADD_SUITE(suite) #if !APR_HAS_OTHER_CHILD - SUITE_ADD_TEST(suite, oc_not_impl); + abts_run_test(suite, oc_not_impl, NULL); #else - SUITE_ADD_TEST(suite, test_child_kill); + abts_run_test(suite, test_child_kill, NULL); #endif return suite; diff --git a/test/testpath.c b/test/testpath.c index 5dd81ef80ec..944cdc2e278 100644 --- a/test/testpath.c +++ b/test/testpath.c @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr_file_info.h" #include "apr_errno.h" #include "apr_pools.h" @@ -42,7 +42,7 @@ static const char *parts_out[] = { P1, P2, P3, P4, P5 }; static const char *path_out = P1 PSEP P2 PSEP P3 PSEP P4 PSEP P5; static const int parts_out_count = sizeof(parts_out)/sizeof(*parts_out); -static void list_split_multi(CuTest *tc) +static void list_split_multi(abts_case *tc, void *data) { int i; apr_status_t rv; @@ -50,14 +50,14 @@ static void list_split_multi(CuTest *tc) pathelts = NULL; rv = apr_filepath_list_split(&pathelts, path_in, p); - CuAssertPtrNotNull(tc, pathelts); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, parts_out_count, pathelts->nelts); + abts_ptr_notnull(tc, pathelts); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, parts_out_count, pathelts->nelts); for (i = 0; i < pathelts->nelts; ++i) - CuAssertStrEquals(tc, parts_out[i], ((char**)pathelts->elts)[i]); + abts_str_equal(tc, parts_out[i], ((char**)pathelts->elts)[i]); } -static void list_split_single(CuTest *tc) +static void list_split_single(abts_case *tc, void *data) { int i; apr_status_t rv; @@ -67,19 +67,19 @@ static void list_split_single(CuTest *tc) { pathelts = NULL; rv = apr_filepath_list_split(&pathelts, parts_in[i], p); - CuAssertPtrNotNull(tc, pathelts); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, pathelts); + abts_int_equal(tc, APR_SUCCESS, rv); if (parts_in[i][0] == '\0') - CuAssertIntEquals(tc, 0, pathelts->nelts); + abts_int_equal(tc, 0, pathelts->nelts); else { - CuAssertIntEquals(tc, 1, pathelts->nelts); - CuAssertStrEquals(tc, parts_in[i], *(char**)pathelts->elts); + abts_int_equal(tc, 1, pathelts->nelts); + abts_str_equal(tc, parts_in[i], *(char**)pathelts->elts); } } } -static void list_merge_multi(CuTest *tc) +static void list_merge_multi(abts_case *tc, void *data) { int i; char *liststr; @@ -92,12 +92,12 @@ static void list_merge_multi(CuTest *tc) liststr = NULL; rv = apr_filepath_list_merge(&liststr, pathelts, p); - CuAssertPtrNotNull(tc, liststr); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, liststr, path_out); + abts_ptr_notnull(tc, liststr); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, liststr, path_out); } -static void list_merge_single(CuTest *tc) +static void list_merge_single(abts_case *tc, void *data) { int i; char *liststr; @@ -112,25 +112,25 @@ static void list_merge_single(CuTest *tc) liststr = NULL; rv = apr_filepath_list_merge(&liststr, pathelts, p); if (parts_in[i][0] == '\0') - CuAssertPtrEquals(tc, NULL, liststr); + abts_ptr_equal(tc, NULL, liststr); else { - CuAssertPtrNotNull(tc, liststr); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, liststr, parts_in[i]); + abts_ptr_notnull(tc, liststr); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, liststr, parts_in[i]); } } } -CuSuite *testpath(void) +abts_suite *testpath(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Path lists"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, list_split_multi); - SUITE_ADD_TEST(suite, list_split_single); - SUITE_ADD_TEST(suite, list_merge_multi); - SUITE_ADD_TEST(suite, list_merge_single); + abts_run_test(suite, list_split_multi, NULL); + abts_run_test(suite, list_split_single, NULL); + abts_run_test(suite, list_merge_multi, NULL); + abts_run_test(suite, list_merge_single, NULL); return suite; } diff --git a/test/testpipe.c b/test/testpipe.c index b8c891a96b5..fb30ddb12f8 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -15,7 +15,7 @@ #include -#include "test_apr.h" +#include "testutil.h" #include "apr_file_io.h" #include "apr_errno.h" #include "apr_general.h" @@ -26,17 +26,17 @@ static apr_file_t *readp = NULL; static apr_file_t *writep = NULL; -static void create_pipe(CuTest *tc) +static void create_pipe(abts_case *tc, void *data) { apr_status_t rv; rv = apr_file_pipe_create(&readp, &writep, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, readp); - CuAssertPtrNotNull(tc, writep); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, readp); + abts_ptr_notnull(tc, writep); } -static void close_pipe(CuTest *tc) +static void close_pipe(abts_case *tc, void *data) { apr_status_t rv; apr_size_t nbytes = 256; @@ -44,35 +44,35 @@ static void close_pipe(CuTest *tc) rv = apr_file_close(readp); rv = apr_file_close(writep); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_read(readp, buf, &nbytes); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_EBADF(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_EBADF(rv)); } -static void set_timeout(CuTest *tc) +static void set_timeout(abts_case *tc, void *data) { apr_status_t rv; apr_interval_time_t timeout; rv = apr_file_pipe_create(&readp, &writep, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, readp); - CuAssertPtrNotNull(tc, writep); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, readp); + abts_ptr_notnull(tc, writep); rv = apr_file_pipe_timeout_get(readp, &timeout); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, -1, timeout); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, -1, timeout); rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_pipe_timeout_get(readp, &timeout); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, apr_time_from_sec(1), timeout); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, apr_time_from_sec(1), timeout); } -static void read_write(CuTest *tc) +static void read_write(abts_case *tc, void *data) { apr_status_t rv; char *buf; @@ -82,19 +82,19 @@ static void read_write(CuTest *tc) buf = (char *)apr_palloc(p, nbytes + 1); rv = apr_file_pipe_create(&readp, &writep, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, readp); - CuAssertPtrNotNull(tc, writep); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, readp); + abts_ptr_notnull(tc, writep); rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_read(readp, buf, &nbytes); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - CuAssertIntEquals(tc, 0, nbytes); + abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + abts_int_equal(tc, 0, nbytes); } -static void read_write_notimeout(CuTest *tc) +static void read_write_notimeout(abts_case *tc, void *data) { apr_status_t rv; char *buf = "this is a test"; @@ -104,23 +104,23 @@ static void read_write_notimeout(CuTest *tc) nbytes = strlen("this is a test"); rv = apr_file_pipe_create(&readp, &writep, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, readp); - CuAssertPtrNotNull(tc, writep); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, readp); + abts_ptr_notnull(tc, writep); rv = apr_file_write(writep, buf, &nbytes); - CuAssertIntEquals(tc, strlen("this is a test"), nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, strlen("this is a test"), nbytes); + abts_int_equal(tc, APR_SUCCESS, rv); nbytes = 256; input = apr_pcalloc(p, nbytes + 1); rv = apr_file_read(readp, input, &nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, strlen("this is a test"), nbytes); - CuAssertStrEquals(tc, "this is a test", input); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, strlen("this is a test"), nbytes); + abts_str_equal(tc, "this is a test", input); } -static void test_pipe_writefull(CuTest *tc) +static void test_pipe_writefull(abts_case *tc, void *data) { int iterations = 1000; int i; @@ -136,62 +136,62 @@ static void test_pipe_writefull(CuTest *tc) apr_exit_why_e why; rv = apr_procattr_create(&procattr, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_procattr_io_set(procattr, APR_CHILD_BLOCK, APR_CHILD_BLOCK, APR_CHILD_BLOCK); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_procattr_error_check_set(procattr, 1); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); args[0] = "readchild" EXTENSION; args[1] = NULL; rv = apr_proc_create(&proc, "./readchild" EXTENSION, args, NULL, procattr, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_pipe_timeout_set(proc.in, apr_time_from_sec(10)); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_file_pipe_timeout_set(proc.out, apr_time_from_sec(10)); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); i = iterations; do { rv = apr_file_write_full(proc.in, buf, bytes_per_iteration, NULL); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } while (--i); free(buf); rv = apr_file_close(proc.in); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); nbytes = sizeof(responsebuf); rv = apr_file_read(proc.out, responsebuf, &nbytes); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); bytes_processed = (int)apr_strtoi64(responsebuf, NULL, 10); - CuAssertIntEquals(tc, iterations * bytes_per_iteration, bytes_processed); + abts_int_equal(tc, iterations * bytes_per_iteration, bytes_processed); - CuAssert(tc, "wait for child process", + abts_assert(tc, "wait for child process", apr_proc_wait(&proc, NULL, &why, APR_WAIT) == APR_CHILD_DONE); - CuAssert(tc, "child terminated normally", why == APR_PROC_EXIT); + abts_assert(tc, "child terminated normally", why == APR_PROC_EXIT); } -CuSuite *testpipe(void) +abts_suite *testpipe(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Pipes"); - - SUITE_ADD_TEST(suite, create_pipe); - SUITE_ADD_TEST(suite, close_pipe); - SUITE_ADD_TEST(suite, set_timeout); - SUITE_ADD_TEST(suite, close_pipe); - SUITE_ADD_TEST(suite, read_write); - SUITE_ADD_TEST(suite, close_pipe); - SUITE_ADD_TEST(suite, read_write_notimeout); - SUITE_ADD_TEST(suite, test_pipe_writefull); - SUITE_ADD_TEST(suite, close_pipe); + suite = ADD_SUITE(suite) + + abts_run_test(suite, create_pipe, NULL); + abts_run_test(suite, close_pipe, NULL); + abts_run_test(suite, set_timeout, NULL); + abts_run_test(suite, close_pipe, NULL); + abts_run_test(suite, read_write, NULL); + abts_run_test(suite, close_pipe, NULL); + abts_run_test(suite, read_write_notimeout, NULL); + abts_run_test(suite, test_pipe_writefull, NULL); + abts_run_test(suite, close_pipe, NULL); return suite; } diff --git a/test/testpoll.c b/test/testpoll.c index 440d0a03054..f96268e4bba 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr_strings.h" #include "apr_errno.h" #include "apr_general.h" @@ -41,24 +41,24 @@ static apr_pollfd_t *pollarray_large; #endif static void make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, - apr_port_t port, apr_pool_t *p, CuTest *tc) + apr_port_t port, apr_pool_t *p, abts_case *tc) { apr_status_t rv; rv = apr_sockaddr_info_get(sa, "127.0.0.1", APR_UNSPEC, port, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_socket_create(sock, (*sa)->family, SOCK_DGRAM, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv =apr_socket_bind((*sock), (*sa)); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } #ifdef OLD_POLL_INTERFACE static void check_sockets(const apr_pollfd_t *pollarray, apr_socket_t **sockarray, int which, int pollin, - CuTest *tc) + abts_case *tc) { apr_status_t rv; apr_int16_t event; @@ -66,52 +66,52 @@ static void check_sockets(const apr_pollfd_t *pollarray, rv = apr_poll_revents_get(&event, sockarray[which], (apr_pollfd_t *)pollarray); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); if (pollin) { str = apr_psprintf(p, "Socket %d not signalled when it should be", which); - CuAssert(tc, str, event & APR_POLLIN); + abts_assert(tc, str, event & APR_POLLIN); } else { str = apr_psprintf(p, "Socket %d signalled when it should not be", which); - CuAssert(tc, str, !(event & APR_POLLIN)); + abts_assert(tc, str, !(event & APR_POLLIN)); } } #endif static void send_msg(apr_socket_t **sockarray, apr_sockaddr_t **sas, int which, - CuTest *tc) + abts_case *tc) { apr_size_t len = 5; apr_status_t rv; - CuAssertPtrNotNull(tc, sockarray[which]); + abts_ptr_notnull(tc, sockarray[which]); rv = apr_socket_sendto(sockarray[which], sas[which], 0, "hello", &len); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, strlen("hello"), len); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, strlen("hello"), len); } static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p, - CuTest *tc) + abts_case *tc) { apr_size_t buflen = 5; char *buffer = apr_pcalloc(p, sizeof(char) * (buflen + 1)); apr_sockaddr_t *recsa; apr_status_t rv; - CuAssertPtrNotNull(tc, sockarray[which]); + abts_ptr_notnull(tc, sockarray[which]); apr_sockaddr_info_get(&recsa, "127.0.0.1", APR_UNSPEC, 7770, 0, p); rv = apr_socket_recvfrom(recsa, sockarray[which], 0, buffer, &buflen); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, strlen("hello"), buflen); - CuAssertStrEquals(tc, "hello", buffer); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, strlen("hello"), buflen); + abts_str_equal(tc, "hello", buffer); } -static void create_all_sockets(CuTest *tc) +static void create_all_sockets(abts_case *tc, void *data) { int i; @@ -121,55 +121,55 @@ static void create_all_sockets(CuTest *tc) } #ifdef OLD_POLL_INTERFACE -static void setup_small_poll(CuTest *tc) +static void setup_small_poll(abts_case *tc, void *data) { apr_status_t rv; int i; rv = apr_poll_setup(&pollarray, SMALL_NUM_SOCKETS, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); for (i = 0; i < SMALL_NUM_SOCKETS;i++){ - CuAssertIntEquals(tc, 0, pollarray[i].reqevents); - CuAssertIntEquals(tc, 0, pollarray[i].rtnevents); + abts_int_equal(tc, 0, pollarray[i].reqevents); + abts_int_equal(tc, 0, pollarray[i].rtnevents); rv = apr_poll_socket_add(pollarray, s[i], APR_POLLIN); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrEquals(tc, s[i], pollarray[i].desc.s); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_equal(tc, s[i], pollarray[i].desc.s); } } -static void setup_large_poll(CuTest *tc) +static void setup_large_poll(abts_case *tc, void *data) { apr_status_t rv; int i; rv = apr_poll_setup(&pollarray_large, LARGE_NUM_SOCKETS, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); for (i = 0; i < LARGE_NUM_SOCKETS;i++){ - CuAssertIntEquals(tc, 0, pollarray_large[i].reqevents); - CuAssertIntEquals(tc, 0, pollarray_large[i].rtnevents); + abts_int_equal(tc, 0, pollarray_large[i].reqevents); + abts_int_equal(tc, 0, pollarray_large[i].rtnevents); rv = apr_poll_socket_add(pollarray_large, s[i], APR_POLLIN); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrEquals(tc, s[i], pollarray_large[i].desc.s); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_equal(tc, s[i], pollarray_large[i].desc.s); } } -static void nomessage(CuTest *tc) +static void nomessage(abts_case *tc, void *data) { apr_status_t rv; int srv = SMALL_NUM_SOCKETS; rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 0, tc); check_sockets(pollarray, s, 2, 0, tc); } -static void send_2(CuTest *tc) +static void send_2(abts_case *tc, void *data) { apr_status_t rv; int srv = SMALL_NUM_SOCKETS; @@ -177,13 +177,13 @@ static void send_2(CuTest *tc) send_msg(s, sa, 2, tc); rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 0, tc); check_sockets(pollarray, s, 2, 1, tc); } -static void recv_2_send_1(CuTest *tc) +static void recv_2_send_1(abts_case *tc, void *data) { apr_status_t rv; int srv = SMALL_NUM_SOCKETS; @@ -192,13 +192,13 @@ static void recv_2_send_1(CuTest *tc) send_msg(s, sa, 1, tc); rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 1, tc); check_sockets(pollarray, s, 2, 0, tc); } -static void send_2_signaled_1(CuTest *tc) +static void send_2_signaled_1(abts_case *tc, void *data) { apr_status_t rv; int srv = SMALL_NUM_SOCKETS; @@ -206,13 +206,13 @@ static void send_2_signaled_1(CuTest *tc) send_msg(s, sa, 2, tc); rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 1, tc); check_sockets(pollarray, s, 2, 1, tc); } -static void recv_1_send_0(CuTest *tc) +static void recv_1_send_0(abts_case *tc, void *data) { apr_status_t rv; int srv = SMALL_NUM_SOCKETS; @@ -221,13 +221,13 @@ static void recv_1_send_0(CuTest *tc) send_msg(s, sa, 0, tc); rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); check_sockets(pollarray, s, 0, 1, tc); check_sockets(pollarray, s, 1, 0, tc); check_sockets(pollarray, s, 2, 1, tc); } -static void clear_all_signalled(CuTest *tc) +static void clear_all_signalled(abts_case *tc, void *data) { apr_status_t rv; int srv = SMALL_NUM_SOCKETS; @@ -236,13 +236,13 @@ static void clear_all_signalled(CuTest *tc) recv_msg(s, 2, p, tc); rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 0, tc); check_sockets(pollarray, s, 2, 0, tc); } -static void send_large_pollarray(CuTest *tc) +static void send_large_pollarray(abts_case *tc, void *data) { apr_status_t rv; int lrv = LARGE_NUM_SOCKETS; @@ -252,7 +252,7 @@ static void send_large_pollarray(CuTest *tc) rv = apr_poll(pollarray_large, LARGE_NUM_SOCKETS, &lrv, 2 * APR_USEC_PER_SEC); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); for (i = 0; i < LARGE_NUM_SOCKETS; i++) { if (i == (LARGE_NUM_SOCKETS - 1)) { @@ -264,7 +264,7 @@ static void send_large_pollarray(CuTest *tc) } } -static void recv_large_pollarray(CuTest *tc) +static void recv_large_pollarray(abts_case *tc, void *data) { apr_status_t rv; int lrv = LARGE_NUM_SOCKETS; @@ -274,7 +274,7 @@ static void recv_large_pollarray(CuTest *tc) rv = apr_poll(pollarray_large, LARGE_NUM_SOCKETS, &lrv, 2 * APR_USEC_PER_SEC); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); for (i = 0; i < LARGE_NUM_SOCKETS; i++) { check_sockets(pollarray_large, s, i, 0, tc); @@ -282,14 +282,14 @@ static void recv_large_pollarray(CuTest *tc) } #endif -static void setup_pollset(CuTest *tc) +static void setup_pollset(abts_case *tc, void *data) { apr_status_t rv; rv = apr_pollset_create(&pollset, LARGE_NUM_SOCKETS, p, 0); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } -static void add_sockets_pollset(CuTest *tc) +static void add_sockets_pollset(abts_case *tc, void *data) { apr_status_t rv; int i; @@ -297,30 +297,30 @@ static void add_sockets_pollset(CuTest *tc) for (i = 0; i < LARGE_NUM_SOCKETS;i++){ apr_pollfd_t socket_pollfd; - CuAssertPtrNotNull(tc, s[i]); + abts_ptr_notnull(tc, s[i]); socket_pollfd.desc_type = APR_POLL_SOCKET; socket_pollfd.reqevents = APR_POLLIN; socket_pollfd.desc.s = s[i]; socket_pollfd.client_data = s[i]; rv = apr_pollset_add(pollset, &socket_pollfd); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } } -static void nomessage_pollset(CuTest *tc) +static void nomessage_pollset(abts_case *tc, void *data) { apr_status_t rv; int lrv; const apr_pollfd_t *descs = NULL; rv = apr_pollset_poll(pollset, 0, &lrv, &descs); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - CuAssertIntEquals(tc, 0, lrv); - CuAssertPtrEquals(tc, NULL, descs); + abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + abts_int_equal(tc, 0, lrv); + abts_ptr_equal(tc, NULL, descs); } -static void send0_pollset(CuTest *tc) +static void send0_pollset(abts_case *tc, void *data) { apr_status_t rv; const apr_pollfd_t *descs = NULL; @@ -328,15 +328,15 @@ static void send0_pollset(CuTest *tc) send_msg(s, sa, 0, tc); rv = apr_pollset_poll(pollset, 0, &num, &descs); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 1, num); - CuAssertPtrNotNull(tc, descs); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 1, num); + abts_ptr_notnull(tc, descs); - CuAssertPtrEquals(tc, s[0], descs[0].desc.s); - CuAssertPtrEquals(tc, s[0], descs[0].client_data); + abts_ptr_equal(tc, s[0], descs[0].desc.s); + abts_ptr_equal(tc, s[0], descs[0].client_data); } -static void recv0_pollset(CuTest *tc) +static void recv0_pollset(abts_case *tc, void *data) { apr_status_t rv; int lrv; @@ -344,12 +344,12 @@ static void recv0_pollset(CuTest *tc) recv_msg(s, 0, p, tc); rv = apr_pollset_poll(pollset, 0, &lrv, &descs); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - CuAssertIntEquals(tc, 0, lrv); - CuAssertPtrEquals(tc, NULL, descs); + abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + abts_int_equal(tc, 0, lrv); + abts_ptr_equal(tc, NULL, descs); } -static void send_middle_pollset(CuTest *tc) +static void send_middle_pollset(abts_case *tc, void *data) { apr_status_t rv; const apr_pollfd_t *descs = NULL; @@ -358,16 +358,16 @@ static void send_middle_pollset(CuTest *tc) send_msg(s, sa, 2, tc); send_msg(s, sa, 5, tc); rv = apr_pollset_poll(pollset, 0, &num, &descs); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 2, num); - CuAssertPtrNotNull(tc, descs); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 2, num); + abts_ptr_notnull(tc, descs); - CuAssert(tc, "Incorrect socket in result set", + abts_assert(tc, "Incorrect socket in result set", ((descs[0].desc.s == s[2]) && (descs[1].desc.s == s[5])) || ((descs[0].desc.s == s[5]) && (descs[1].desc.s == s[2]))); } -static void clear_middle_pollset(CuTest *tc) +static void clear_middle_pollset(abts_case *tc, void *data) { apr_status_t rv; int lrv; @@ -377,12 +377,12 @@ static void clear_middle_pollset(CuTest *tc) recv_msg(s, 5, p, tc); rv = apr_pollset_poll(pollset, 0, &lrv, &descs); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - CuAssertIntEquals(tc, 0, lrv); - CuAssertPtrEquals(tc, NULL, descs); + abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + abts_int_equal(tc, 0, lrv); + abts_ptr_equal(tc, NULL, descs); } -static void send_last_pollset(CuTest *tc) +static void send_last_pollset(abts_case *tc, void *data) { apr_status_t rv; const apr_pollfd_t *descs = NULL; @@ -390,15 +390,15 @@ static void send_last_pollset(CuTest *tc) send_msg(s, sa, LARGE_NUM_SOCKETS - 1, tc); rv = apr_pollset_poll(pollset, 0, &num, &descs); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 1, num); - CuAssertPtrNotNull(tc, descs); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 1, num); + abts_ptr_notnull(tc, descs); - CuAssertPtrEquals(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].desc.s); - CuAssertPtrEquals(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].client_data); + abts_ptr_equal(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].desc.s); + abts_ptr_equal(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].client_data); } -static void clear_last_pollset(CuTest *tc) +static void clear_last_pollset(abts_case *tc, void *data) { apr_status_t rv; int lrv; @@ -407,23 +407,23 @@ static void clear_last_pollset(CuTest *tc) recv_msg(s, LARGE_NUM_SOCKETS - 1, p, tc); rv = apr_pollset_poll(pollset, 0, &lrv, &descs); - CuAssertIntEquals(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - CuAssertIntEquals(tc, 0, lrv); - CuAssertPtrEquals(tc, NULL, descs); + abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + abts_int_equal(tc, 0, lrv); + abts_ptr_equal(tc, NULL, descs); } -static void close_all_sockets(CuTest *tc) +static void close_all_sockets(abts_case *tc, void *data) { apr_status_t rv; int i; for (i = 0; i < LARGE_NUM_SOCKETS; i++){ rv = apr_socket_close(s[i]); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } } -static void pollset_remove(CuTest *tc) +static void pollset_remove(abts_case *tc, void *data) { apr_status_t rv; apr_pollset_t *pollset; @@ -432,7 +432,7 @@ static void pollset_remove(CuTest *tc) apr_int32_t num; rv = apr_pollset_create(&pollset, 5, p, 0); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); pfd.p = p; pfd.desc_type = APR_POLL_SOCKET; @@ -441,92 +441,92 @@ static void pollset_remove(CuTest *tc) pfd.desc.s = s[0]; pfd.client_data = (void *)1; rv = apr_pollset_add(pollset, &pfd); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); pfd.desc.s = s[1]; pfd.client_data = (void *)2; rv = apr_pollset_add(pollset, &pfd); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); pfd.desc.s = s[2]; pfd.client_data = (void *)3; rv = apr_pollset_add(pollset, &pfd); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); pfd.desc.s = s[3]; pfd.client_data = (void *)4; rv = apr_pollset_add(pollset, &pfd); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 4, num); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 4, num); /* now remove the pollset element referring to desc s[1] */ pfd.desc.s = s[1]; pfd.client_data = (void *)999; /* not used on this call */ rv = apr_pollset_remove(pollset, &pfd); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); /* this time only three should match */ rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 3, num); - CuAssertPtrEquals(tc, (void *)1, hot_files[0].client_data); - CuAssertPtrEquals(tc, s[0], hot_files[0].desc.s); - CuAssertPtrEquals(tc, (void *)3, hot_files[1].client_data); - CuAssertPtrEquals(tc, s[2], hot_files[1].desc.s); - CuAssertPtrEquals(tc, (void *)4, hot_files[2].client_data); - CuAssertPtrEquals(tc, s[3], hot_files[2].desc.s); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 3, num); + abts_ptr_equal(tc, (void *)1, hot_files[0].client_data); + abts_ptr_equal(tc, s[0], hot_files[0].desc.s); + abts_ptr_equal(tc, (void *)3, hot_files[1].client_data); + abts_ptr_equal(tc, s[2], hot_files[1].desc.s); + abts_ptr_equal(tc, (void *)4, hot_files[2].client_data); + abts_ptr_equal(tc, s[3], hot_files[2].desc.s); /* now remove the pollset elements referring to desc s[2] */ pfd.desc.s = s[2]; pfd.client_data = (void *)999; /* not used on this call */ rv = apr_pollset_remove(pollset, &pfd); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); /* this time only two should match */ rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 2, num); - CuAssertPtrEquals(tc, (void *)1, hot_files[0].client_data); - CuAssertPtrEquals(tc, s[0], hot_files[0].desc.s); - CuAssertPtrEquals(tc, (void *)4, hot_files[1].client_data); - CuAssertPtrEquals(tc, s[3], hot_files[1].desc.s); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 2, num); + abts_ptr_equal(tc, (void *)1, hot_files[0].client_data); + abts_ptr_equal(tc, s[0], hot_files[0].desc.s); + abts_ptr_equal(tc, (void *)4, hot_files[1].client_data); + abts_ptr_equal(tc, s[3], hot_files[1].desc.s); } -CuSuite *testpoll(void) +abts_suite *testpoll(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Poll"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, create_all_sockets); + abts_run_test(suite, create_all_sockets, NULL); #ifdef OLD_POLL_INTERFACE - SUITE_ADD_TEST(suite, setup_small_poll); - SUITE_ADD_TEST(suite, setup_large_poll); - SUITE_ADD_TEST(suite, nomessage); - SUITE_ADD_TEST(suite, send_2); - SUITE_ADD_TEST(suite, recv_2_send_1); - SUITE_ADD_TEST(suite, send_2_signaled_1); - SUITE_ADD_TEST(suite, recv_1_send_0); - SUITE_ADD_TEST(suite, clear_all_signalled); - SUITE_ADD_TEST(suite, send_large_pollarray); - SUITE_ADD_TEST(suite, recv_large_pollarray); + abts_run_test(suite, setup_small_poll, NULL); + abts_run_test(suite, setup_large_poll, NULL); + abts_run_test(suite, nomessage, NULL); + abts_run_test(suite, send_2, NULL); + abts_run_test(suite, recv_2_send_1, NULL); + abts_run_test(suite, send_2_signaled_1, NULL); + abts_run_test(suite, recv_1_send_0, NULL); + abts_run_test(suite, clear_all_signalled, NULL); + abts_run_test(suite, send_large_pollarray, NULL); + abts_run_test(suite, recv_large_pollarray, NULL); #endif - SUITE_ADD_TEST(suite, setup_pollset); - SUITE_ADD_TEST(suite, add_sockets_pollset); - SUITE_ADD_TEST(suite, nomessage_pollset); - SUITE_ADD_TEST(suite, send0_pollset); - SUITE_ADD_TEST(suite, recv0_pollset); - SUITE_ADD_TEST(suite, send_middle_pollset); - SUITE_ADD_TEST(suite, clear_middle_pollset); - SUITE_ADD_TEST(suite, send_last_pollset); - SUITE_ADD_TEST(suite, clear_last_pollset); - - SUITE_ADD_TEST(suite, pollset_remove); + abts_run_test(suite, setup_pollset, NULL); + abts_run_test(suite, add_sockets_pollset, NULL); + abts_run_test(suite, nomessage_pollset, NULL); + abts_run_test(suite, send0_pollset, NULL); + abts_run_test(suite, recv0_pollset, NULL); + abts_run_test(suite, send_middle_pollset, NULL); + abts_run_test(suite, clear_middle_pollset, NULL); + abts_run_test(suite, send_last_pollset, NULL); + abts_run_test(suite, clear_last_pollset, NULL); + + abts_run_test(suite, pollset_remove, NULL); - SUITE_ADD_TEST(suite, close_all_sockets); + abts_run_test(suite, close_all_sockets, NULL); return suite; } diff --git a/test/testpools.c b/test/testpools.c index f77670653cb..a51879a8b47 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -24,20 +24,20 @@ #if APR_HAVE_UNISTD_H #include #endif -#include "test_apr.h" +#include "testutil.h" #define ALLOC_BYTES 1024 static apr_pool_t *pmain = NULL; static apr_pool_t *pchild = NULL; -static void alloc_bytes(CuTest *tc) +static void alloc_bytes(abts_case *tc, void *data) { int i; char *alloc; alloc = apr_palloc(pmain, ALLOC_BYTES); - CuAssertPtrNotNull(tc, alloc); + abts_ptr_notnull(tc, alloc); for (i=0;i #include -#include "test_apr.h" +#include "testutil.h" #if APR_HAS_FORK @@ -41,7 +41,7 @@ static int increment(int n) return n+1; } -static void make_child(CuTest *tc, apr_proc_t **proc, apr_pool_t *p) +static void make_child(abts_case *tc, apr_proc_t **proc, apr_pool_t *p) { apr_status_t rv; @@ -77,22 +77,22 @@ static void make_child(CuTest *tc, apr_proc_t **proc, apr_pool_t *p) exit(0); } - CuAssert(tc, "fork failed", rv == APR_INPARENT); + abts_assert(tc, "fork failed", rv == APR_INPARENT); } /* Wait for a child process and check it terminated with success. */ -static void await_child(CuTest *tc, apr_proc_t *proc) +static void await_child(abts_case *tc, apr_proc_t *proc) { int code; apr_exit_why_e why; apr_status_t rv; rv = apr_proc_wait(proc, &code, &why, APR_WAIT); - CuAssert(tc, "child did not terminate with success", + abts_assert(tc, "child did not terminate with success", rv == APR_CHILD_DONE && why == APR_PROC_EXIT && code == 0); } -static void test_exclusive(CuTest *tc, const char *lockname) +static void test_exclusive(abts_case *tc, const char *lockname) { apr_proc_t *child[CHILDREN]; apr_status_t rv; @@ -107,11 +107,11 @@ static void test_exclusive(CuTest *tc, const char *lockname) for (n = 0; n < CHILDREN; n++) await_child(tc, child[n]); - CuAssert(tc, "Locks don't appear to work", *x == MAX_COUNTER); + abts_assert(tc, "Locks don't appear to work", *x == MAX_COUNTER); } #endif -static void proc_mutex(CuTest *tc) +static void proc_mutex(abts_case *tc, void *data) { #if APR_HAS_FORK apr_status_t rv; @@ -130,16 +130,16 @@ static void proc_mutex(CuTest *tc) x = apr_shm_baseaddr_get(shm); test_exclusive(tc, NULL); #else - CuNotImpl(tc, "APR lacks fork() support"); + abts_not_impl(tc, "APR lacks fork() support"); #endif } -CuSuite *testprocmutex(void) +abts_suite *testprocmutex(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Cross-Process Mutexes"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, proc_mutex); + abts_run_test(suite, proc_mutex, NULL); return suite; } diff --git a/test/testrand.c b/test/testrand.c index 0c5dfc61cdf..9a07ae76b24 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -17,12 +17,12 @@ #include #include #include -#include "test_apr.h" +#include "testutil.h" -static void rand_exists(CuTest *tc) +static void rand_exists(abts_case *tc, void *data) { #if !APR_HAS_RANDOM - CuNotImpl(tc, "apr_generate_random_bytes"); + abts_not_impl(tc, "apr_generate_random_bytes"); #else unsigned char c[42]; @@ -34,11 +34,11 @@ static void rand_exists(CuTest *tc) #endif } -CuSuite *testrand(void) +abts_suite *testrand(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Random"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, rand_exists); + abts_run_test(suite, rand_exists, NULL); return suite; } diff --git a/test/testrand2.c b/test/testrand2.c index 03de48feebc..62056ee65e3 100644 --- a/test/testrand2.c +++ b/test/testrand2.c @@ -58,7 +58,7 @@ #include #include #include -#include "test_apr.h" +#include "testutil.h" static void hexdump(const unsigned char *b,int n) { @@ -85,21 +85,21 @@ static apr_random_t *r; typedef apr_status_t APR_THREAD_FUNC rnd_fn(apr_random_t *r,void *b,apr_size_t n); -static void rand_run_kat(CuTest *tc,rnd_fn *f,apr_random_t *r, +static void rand_run_kat(abts_case *tc,rnd_fn *f,apr_random_t *r, const unsigned char expected[128]) { unsigned char c[128]; apr_status_t rv; rv=f(r,c,128); - CuAssertIntEquals(tc,0,rv); + abts_int_equal(tc,0,rv); if(rv) return; if(memcmp(c,expected,128)) { hexdump(c,128); hexdump(expected,128); - CuFail(tc,"Randomness mismatch"); + abts_fail(tc,"Randomness mismatch"); } } @@ -124,7 +124,7 @@ static void rand_add_zeroes(apr_random_t *r) apr_random_add_entropy(r,c,sizeof c); } -static void rand_run_seed_short(CuTest *tc,rnd_fn *f,apr_random_t *r, +static void rand_run_seed_short(abts_case *tc,rnd_fn *f,apr_random_t *r, int count) { int i; @@ -134,16 +134,16 @@ static void rand_run_seed_short(CuTest *tc,rnd_fn *f,apr_random_t *r, for(i=0 ; i < count ; ++i) rand_add_zeroes(r); rv=f(r,c,1); - CuAssertIntEquals(tc,1,APR_STATUS_IS_ENOTENOUGHENTROPY(rv)); + abts_int_equal(tc,1,APR_STATUS_IS_ENOTENOUGHENTROPY(rv)); } -static void rand_seed_short(CuTest *tc) +static void rand_seed_short(abts_case *tc, void *data) { r=apr_random_standard_new(p); rand_run_seed_short(tc,apr_random_insecure_bytes,r,32); } -static void rand_kat(CuTest *tc) +static void rand_kat(abts_case *tc, void *data) { unsigned char expected[128]= { 0x82,0x04,0xad,0xd2,0x0b,0xd5,0xac,0xda, @@ -167,12 +167,12 @@ static void rand_kat(CuTest *tc) rand_run_kat(tc,apr_random_insecure_bytes,r,expected); } -static void rand_seed_short2(CuTest *tc) +static void rand_seed_short2(abts_case *tc, void *data) { rand_run_seed_short(tc,apr_random_secure_bytes,r,320); } -static void rand_kat2(CuTest *tc) +static void rand_kat2(abts_case *tc, void *data) { unsigned char expected[128]= { 0x38,0x8f,0x01,0x29,0x5a,0x5c,0x1f,0xa8, @@ -196,13 +196,13 @@ static void rand_kat2(CuTest *tc) rand_run_kat(tc,apr_random_secure_bytes,r,expected); } -static void rand_barrier(CuTest *tc) +static void rand_barrier(abts_case *tc, void *data) { apr_random_barrier(r); rand_run_seed_short(tc,apr_random_secure_bytes,r,320); } -static void rand_kat3(CuTest *tc) +static void rand_kat3(abts_case *tc, void *data) { unsigned char expected[128]= { 0xe8,0xe7,0xc9,0x45,0xe2,0x2a,0x54,0xb2, @@ -225,7 +225,7 @@ static void rand_kat3(CuTest *tc) rand_run_kat(tc,apr_random_insecure_bytes,r,expected); } -static void rand_kat4(CuTest *tc) +static void rand_kat4(abts_case *tc, void *data) { unsigned char expected[128]= { 0x7d,0x0e,0xc4,0x4e,0x3e,0xac,0x86,0x50, @@ -250,7 +250,7 @@ static void rand_kat4(CuTest *tc) } #if APR_HAS_FORK -static void rand_fork(CuTest *tc) +static void rand_fork(abts_case *tc, void *data) { apr_proc_t proc; apr_status_t rv; @@ -290,46 +290,46 @@ static void rand_fork(CuTest *tc) apr_proc_wait(&proc,&exitcode,&why,APR_WAIT); if(why != APR_PROC_EXIT) { - CuFail(tc,"Child terminated abnormally"); + abts_fail(tc,"Child terminated abnormally"); return; } if(exitcode == 0) { - CuFail(tc,"Child produced our randomness"); + abts_fail(tc,"Child produced our randomness"); return; } else if(exitcode == 2) { - CuFail(tc,"Child randomness failed"); + abts_fail(tc,"Child randomness failed"); return; } else if(exitcode != 1) { - CuFail(tc,"Uknown child error"); + abts_fail(tc,"Uknown child error"); return; } } else { - CuFail(tc,"Fork failed"); + abts_fail(tc,"Fork failed"); return; } } #endif -CuSuite *testrand2(void) +abts_suite *testrand2(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Random2"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, rand_seed_short); - SUITE_ADD_TEST(suite, rand_kat); - SUITE_ADD_TEST(suite, rand_seed_short2); - SUITE_ADD_TEST(suite, rand_kat2); - SUITE_ADD_TEST(suite, rand_barrier); - SUITE_ADD_TEST(suite, rand_kat3); - SUITE_ADD_TEST(suite, rand_kat4); + abts_run_test(suite, rand_seed_short, NULL); + abts_run_test(suite, rand_kat, NULL); + abts_run_test(suite, rand_seed_short2, NULL); + abts_run_test(suite, rand_kat2, NULL); + abts_run_test(suite, rand_barrier, NULL); + abts_run_test(suite, rand_kat3, NULL); + abts_run_test(suite, rand_kat4, NULL); #if APR_HAS_FORK - SUITE_ADD_TEST(suite, rand_fork); + abts_run_test(suite, rand_fork, NULL); #endif return suite; diff --git a/test/testshm.c b/test/testshm.c index de2f049f2f7..25a5a661394 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr_shm.h" #include "apr_errno.h" #include "apr_general.h" @@ -58,20 +58,20 @@ static void msgput(int boxnum, char *msg) boxes[boxnum].msgavail = 1; } -static void test_anon_create(CuTest *tc) +static void test_anon_create(abts_case *tc, void *data) { apr_status_t rv; apr_shm_t *shm = NULL; rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); apr_assert_success(tc, "Error allocating shared memory block", rv); - CuAssertPtrNotNull(tc, shm); + abts_ptr_notnull(tc, shm); rv = apr_shm_destroy(shm); apr_assert_success(tc, "Error destroying shared memory block", rv); } -static void test_check_size(CuTest *tc) +static void test_check_size(abts_case *tc, void *data) { apr_status_t rv; apr_shm_t *shm = NULL; @@ -79,33 +79,33 @@ static void test_check_size(CuTest *tc) rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); apr_assert_success(tc, "Error allocating shared memory block", rv); - CuAssertPtrNotNull(tc, shm); + abts_ptr_notnull(tc, shm); retsize = apr_shm_size_get(shm); - CuAssertIntEquals(tc, SHARED_SIZE, retsize); + abts_int_equal(tc, SHARED_SIZE, retsize); rv = apr_shm_destroy(shm); apr_assert_success(tc, "Error destroying shared memory block", rv); } -static void test_shm_allocate(CuTest *tc) +static void test_shm_allocate(abts_case *tc, void *data) { apr_status_t rv; apr_shm_t *shm = NULL; rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); apr_assert_success(tc, "Error allocating shared memory block", rv); - CuAssertPtrNotNull(tc, shm); + abts_ptr_notnull(tc, shm); boxes = apr_shm_baseaddr_get(shm); - CuAssertPtrNotNull(tc, boxes); + abts_ptr_notnull(tc, boxes); rv = apr_shm_destroy(shm); apr_assert_success(tc, "Error destroying shared memory block", rv); } #if APR_HAS_FORK -static void test_anon(CuTest *tc) +static void test_anon(abts_case *tc, void *data) { apr_proc_t proc; apr_status_t rv; @@ -116,13 +116,13 @@ static void test_anon(CuTest *tc) rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); apr_assert_success(tc, "Error allocating shared memory block", rv); - CuAssertPtrNotNull(tc, shm); + abts_ptr_notnull(tc, shm); retsize = apr_shm_size_get(shm); - CuAssertIntEquals(tc, SHARED_SIZE, retsize); + abts_int_equal(tc, SHARED_SIZE, retsize); boxes = apr_shm_baseaddr_get(shm); - CuAssertPtrNotNull(tc, boxes); + abts_ptr_notnull(tc, boxes); rv = apr_proc_fork(&proc, p); if (rv == APR_INCHILD) { /* child */ @@ -144,18 +144,18 @@ static void test_anon(CuTest *tc) } } else { - CuFail(tc, "apr_proc_fork failed"); + abts_fail(tc, "apr_proc_fork failed"); } /* wait for the child */ rv = apr_proc_wait(&proc, &recvd, NULL, APR_WAIT); - CuAssertIntEquals(tc, N_MESSAGES, recvd); + abts_int_equal(tc, N_MESSAGES, recvd); rv = apr_shm_destroy(shm); apr_assert_success(tc, "Error destroying shared memory block", rv); } #endif -static void test_named(CuTest *tc) +static void test_named(abts_case *tc, void *data) { apr_status_t rv; apr_shm_t *shm = NULL; @@ -168,16 +168,16 @@ static void test_named(CuTest *tc) rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); apr_assert_success(tc, "Error allocating shared memory block", rv); - CuAssertPtrNotNull(tc, shm); + abts_ptr_notnull(tc, shm); retsize = apr_shm_size_get(shm); - CuAssertIntEquals(tc, SHARED_SIZE, retsize); + abts_int_equal(tc, SHARED_SIZE, retsize); boxes = apr_shm_baseaddr_get(shm); - CuAssertPtrNotNull(tc, boxes); + abts_ptr_notnull(tc, boxes); rv = apr_procattr_create(&attr1, p); - CuAssertPtrNotNull(tc, attr1); + abts_ptr_notnull(tc, attr1); apr_assert_success(tc, "Couldn't create attr1", rv); args[0] = apr_pstrdup(p, "testshmproducer" EXTENSION); args[1] = NULL; @@ -186,7 +186,7 @@ static void test_named(CuTest *tc) apr_assert_success(tc, "Couldn't launch producer", rv); rv = apr_procattr_create(&attr2, p); - CuAssertPtrNotNull(tc, attr2); + abts_ptr_notnull(tc, attr2); apr_assert_success(tc, "Couldn't create attr2", rv); args[0] = apr_pstrdup(p, "testshmconsumer" EXTENSION); rv = apr_proc_create(&pidconsumer, "./testshmconsumer" EXTENSION, args, @@ -194,12 +194,12 @@ static void test_named(CuTest *tc) apr_assert_success(tc, "Couldn't launch consumer", rv); rv = apr_proc_wait(&pidconsumer, &received, &why, APR_WAIT); - CuAssertIntEquals(tc, APR_CHILD_DONE, rv); - CuAssertIntEquals(tc, APR_PROC_EXIT, why); + abts_int_equal(tc, APR_CHILD_DONE, rv); + abts_int_equal(tc, APR_PROC_EXIT, why); rv = apr_proc_wait(&pidproducer, &sent, &why, APR_WAIT); - CuAssertIntEquals(tc, APR_CHILD_DONE, rv); - CuAssertIntEquals(tc, APR_PROC_EXIT, why); + abts_int_equal(tc, APR_CHILD_DONE, rv); + abts_int_equal(tc, APR_PROC_EXIT, why); /* Cleanup before testing that producer and consumer worked correctly. * This way, if they didn't succeed, we can just run this test again @@ -208,23 +208,23 @@ static void test_named(CuTest *tc) apr_assert_success(tc, "Error destroying shared memory", apr_shm_destroy(shm)); - CuAssertIntEquals(tc, sent, received); + abts_int_equal(tc, sent, received); } #endif -CuSuite *testshm(void) +abts_suite *testshm(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Shared Memory"); + suite = ADD_SUITE(suite) #if APR_HAS_SHARED_MEMORY - SUITE_ADD_TEST(suite, test_anon_create); - SUITE_ADD_TEST(suite, test_check_size); - SUITE_ADD_TEST(suite, test_shm_allocate); + abts_run_test(suite, test_anon_create, NULL); + abts_run_test(suite, test_check_size, NULL); + abts_run_test(suite, test_shm_allocate, NULL); #if APR_HAS_FORK - SUITE_ADD_TEST(suite, test_anon); + abts_run_test(suite, test_anon, NULL); #endif - SUITE_ADD_TEST(suite, test_named); + abts_run_test(suite, test_named, NULL); #endif return suite; diff --git a/test/testsleep.c b/test/testsleep.c index cd0dab19935..c8f895298f0 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -21,11 +21,11 @@ #include #include #include -#include "test_apr.h" +#include "testutil.h" #define SLEEP_INTERVAL 5 -static void sleep_one(CuTest *tc) +static void sleep_one(abts_case *tc, void *data) { time_t pretime = time(NULL); time_t posttime; @@ -38,15 +38,15 @@ static void sleep_one(CuTest *tc) * we should just subtract that out. */ timediff = posttime - pretime - SLEEP_INTERVAL; - CuAssertTrue(tc, timediff >= 0); - CuAssertTrue(tc, timediff <= 1); + abts_true(tc, timediff >= 0); + abts_true(tc, timediff <= 1); } -CuSuite *testsleep(void) +abts_suite *testsleep(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Sleep"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, sleep_one); + abts_run_test(suite, sleep_one, NULL); return suite; } diff --git a/test/testsock.c b/test/testsock.c index fad2b72a162..ad5f25a6624 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "testsock.h" #include "apr_thread_proc.h" #include "apr_network_io.h" @@ -22,7 +22,7 @@ #include "apr_lib.h" #include "apr_strings.h" -static void launch_child(CuTest *tc, apr_proc_t *proc, const char *arg1, apr_pool_t *p) +static void launch_child(abts_case *tc, apr_proc_t *proc, const char *arg1, apr_pool_t *p) { apr_procattr_t *procattr; const char *args[3]; @@ -46,19 +46,19 @@ static void launch_child(CuTest *tc, apr_proc_t *proc, const char *arg1, apr_poo apr_assert_success(tc, "Couldn't launch program", rv); } -static int wait_child(CuTest *tc, apr_proc_t *proc) +static int wait_child(abts_case *tc, apr_proc_t *proc) { int exitcode; apr_exit_why_e why; - CuAssert(tc, "Error waiting for child process", + abts_assert(tc, "Error waiting for child process", apr_proc_wait(proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); - CuAssert(tc, "child terminated normally", why == APR_PROC_EXIT); + abts_assert(tc, "child terminated normally", why == APR_PROC_EXIT); return exitcode; } -static void test_addr_info(CuTest *tc) +static void test_addr_info(abts_case *tc, void *data) { apr_status_t rv; apr_sockaddr_t *sa; @@ -68,10 +68,10 @@ static void test_addr_info(CuTest *tc) rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, 80, 0, p); apr_assert_success(tc, "Problem generating sockaddr", rv); - CuAssertStrEquals(tc, "127.0.0.1", sa->hostname); + abts_str_equal(tc, "127.0.0.1", sa->hostname); } -static apr_socket_t *setup_socket(CuTest *tc) +static apr_socket_t *setup_socket(abts_case *tc) { apr_status_t rv; apr_sockaddr_t *sa; @@ -92,7 +92,7 @@ static apr_socket_t *setup_socket(CuTest *tc) return sock; } -static void test_create_bind_listen(CuTest *tc) +static void test_create_bind_listen(abts_case *tc, void *data) { apr_status_t rv; apr_socket_t *sock = setup_socket(tc); @@ -101,7 +101,7 @@ static void test_create_bind_listen(CuTest *tc) apr_assert_success(tc, "Problem closing socket", rv); } -static void test_send(CuTest *tc) +static void test_send(abts_case *tc, void *data) { apr_status_t rv; apr_socket_t *sock; @@ -118,13 +118,13 @@ static void test_send(CuTest *tc) apr_assert_success(tc, "Problem with receiving connection", rv); apr_socket_protocol_get(sock2, &protocol); - CuAssertIntEquals(tc, APR_PROTO_TCP, protocol); + abts_int_equal(tc, APR_PROTO_TCP, protocol); length = strlen(DATASTR); apr_socket_send(sock2, DATASTR, &length); /* Make sure that the client received the data we sent */ - CuAssertIntEquals(tc, strlen(DATASTR), wait_child(tc, &proc)); + abts_int_equal(tc, strlen(DATASTR), wait_child(tc, &proc)); rv = apr_socket_close(sock2); apr_assert_success(tc, "Problem closing connected socket", rv); @@ -132,7 +132,7 @@ static void test_send(CuTest *tc) apr_assert_success(tc, "Problem closing socket", rv); } -static void test_recv(CuTest *tc) +static void test_recv(abts_case *tc, void *data) { apr_status_t rv; apr_socket_t *sock; @@ -150,14 +150,14 @@ static void test_recv(CuTest *tc) apr_assert_success(tc, "Problem with receiving connection", rv); apr_socket_protocol_get(sock2, &protocol); - CuAssertIntEquals(tc, APR_PROTO_TCP, protocol); + abts_int_equal(tc, APR_PROTO_TCP, protocol); memset(datastr, 0, STRLEN); apr_socket_recv(sock2, datastr, &length); /* Make sure that the server received the data we sent */ - CuAssertStrEquals(tc, DATASTR, datastr); - CuAssertIntEquals(tc, strlen(datastr), wait_child(tc, &proc)); + abts_str_equal(tc, DATASTR, datastr); + abts_int_equal(tc, strlen(datastr), wait_child(tc, &proc)); rv = apr_socket_close(sock2); apr_assert_success(tc, "Problem closing connected socket", rv); @@ -165,7 +165,7 @@ static void test_recv(CuTest *tc) apr_assert_success(tc, "Problem closing socket", rv); } -static void test_timeout(CuTest *tc) +static void test_timeout(abts_case *tc, void *data) { apr_status_t rv; apr_socket_t *sock; @@ -182,10 +182,10 @@ static void test_timeout(CuTest *tc) apr_assert_success(tc, "Problem with receiving connection", rv); apr_socket_protocol_get(sock2, &protocol); - CuAssertIntEquals(tc, APR_PROTO_TCP, protocol); + abts_int_equal(tc, APR_PROTO_TCP, protocol); exit = wait_child(tc, &proc); - CuAssertIntEquals(tc, SOCKET_TIMEOUT, exit); + abts_int_equal(tc, SOCKET_TIMEOUT, exit); /* We didn't write any data, so make sure the child program returns * an error. @@ -196,15 +196,15 @@ static void test_timeout(CuTest *tc) apr_assert_success(tc, "Problem closing socket", rv); } -CuSuite *testsock(void) +abts_suite *testsock(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Socket operations"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, test_addr_info); - SUITE_ADD_TEST(suite, test_create_bind_listen); - SUITE_ADD_TEST(suite, test_send); - SUITE_ADD_TEST(suite, test_recv); - SUITE_ADD_TEST(suite, test_timeout); + abts_run_test(suite, test_addr_info, NULL); + abts_run_test(suite, test_create_bind_listen, NULL); + abts_run_test(suite, test_send, NULL); + abts_run_test(suite, test_recv, NULL); + abts_run_test(suite, test_timeout, NULL); return suite; } diff --git a/test/testsockets.c b/test/testsockets.c index 24b667fcf29..58744509750 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -17,7 +17,7 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" -#include "test_apr.h" +#include "testutil.h" #if APR_HAVE_IPV6 #define US "::1" @@ -29,71 +29,71 @@ #define STRLEN 21 -static void tcp_socket(CuTest *tc) +static void tcp_socket(abts_case *tc, void *data) { apr_status_t rv; apr_socket_t *sock = NULL; int type; rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, sock); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, sock); rv = apr_socket_type_get(sock, &type); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, SOCK_STREAM, type); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, SOCK_STREAM, type); apr_socket_close(sock); } -static void udp_socket(CuTest *tc) +static void udp_socket(abts_case *tc, void *data) { apr_status_t rv; apr_socket_t *sock = NULL; int type; rv = apr_socket_create(&sock, APR_INET, SOCK_DGRAM, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, sock); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, sock); rv = apr_socket_type_get(sock, &type); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, SOCK_DGRAM, type); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, SOCK_DGRAM, type); apr_socket_close(sock); } -static void tcp6_socket(CuTest *tc) +static void tcp6_socket(abts_case *tc, void *data) { #if APR_HAVE_IPV6 apr_status_t rv; apr_socket_t *sock = NULL; rv = apr_socket_create(&sock, APR_INET6, SOCK_STREAM, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, sock); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, sock); apr_socket_close(sock); #else - CuNotImpl(tc, "IPv6"); + abts_not_impl(tc, "IPv6"); #endif } -static void udp6_socket(CuTest *tc) +static void udp6_socket(abts_case *tc, void *data) { #if APR_HAVE_IPV6 apr_status_t rv; apr_socket_t *sock = NULL; rv = apr_socket_create(&sock, APR_INET6, SOCK_DGRAM, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, sock); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, sock); apr_socket_close(sock); #else - CuNotImpl(tc, "IPv6"); + abts_not_impl(tc, "IPv6"); #endif } -static void sendto_receivefrom(CuTest *tc) +static void sendto_receivefrom(abts_case *tc, void *data) { apr_status_t rv; apr_socket_t *sock = NULL; @@ -107,78 +107,78 @@ static void sendto_receivefrom(CuTest *tc) apr_size_t len = 30; rv = apr_socket_create(&sock, FAMILY, SOCK_DGRAM, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_socket_create(&sock2, FAMILY, SOCK_DGRAM, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_sockaddr_info_get(&to, US, APR_UNSPEC, 7772, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_sockaddr_info_get(&from, US, APR_UNSPEC, 7771, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_socket_bind(sock, to); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_socket_bind(sock2, from); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); len = STRLEN; rv = apr_socket_sendto(sock2, to, 0, sendbuf, &len); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, STRLEN, len); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, STRLEN, len); len = 80; rv = apr_socket_recvfrom(from, sock, 0, recvbuf, &len); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, STRLEN, len); - CuAssertStrEquals(tc, "APR_INET, SOCK_DGRAM", recvbuf); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, STRLEN, len); + abts_str_equal(tc, "APR_INET, SOCK_DGRAM", recvbuf); apr_sockaddr_ip_get(&ip_addr, from); fromport = from->port; - CuAssertStrEquals(tc, US, ip_addr); - CuAssertIntEquals(tc, 7771, fromport); + abts_str_equal(tc, US, ip_addr); + abts_int_equal(tc, 7771, fromport); apr_socket_close(sock); apr_socket_close(sock2); } -static void socket_userdata(CuTest *tc) +static void socket_userdata(abts_case *tc, void *data) { apr_socket_t *sock1, *sock2; apr_status_t rv; - char *data; + char *user; const char *key = "GENERICKEY"; rv = apr_socket_create(&sock1, AF_INET, SOCK_STREAM, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_socket_create(&sock2, AF_INET, SOCK_STREAM, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_socket_data_set(sock1, "SOCK1", key, NULL); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_socket_data_set(sock2, "SOCK2", key, NULL); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - - rv = apr_socket_data_get((void **)&data, key, sock1); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, "SOCK1", data); - rv = apr_socket_data_get((void **)&data, key, sock2); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertStrEquals(tc, "SOCK2", data); + abts_int_equal(tc, APR_SUCCESS, rv); + + rv = apr_socket_data_get((void **)&user, key, sock1); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, "SOCK1", user); + rv = apr_socket_data_get((void **)&user, key, sock2); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_str_equal(tc, "SOCK2", user); } -CuSuite *testsockets(void) +abts_suite *testsockets(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Socket Creation"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, tcp_socket); - SUITE_ADD_TEST(suite, udp_socket); + abts_run_test(suite, tcp_socket, NULL); + abts_run_test(suite, udp_socket, NULL); - SUITE_ADD_TEST(suite, tcp6_socket); - SUITE_ADD_TEST(suite, udp6_socket); + abts_run_test(suite, tcp6_socket, NULL); + abts_run_test(suite, udp6_socket, NULL); - SUITE_ADD_TEST(suite, sendto_receivefrom); + abts_run_test(suite, sendto_receivefrom, NULL); - SUITE_ADD_TEST(suite, socket_userdata); + abts_run_test(suite, socket_userdata, NULL); return suite; } diff --git a/test/testsockopt.c b/test/testsockopt.c index 2dad2c6ef8f..a272ba94b48 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -17,33 +17,33 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" -#include "test_apr.h" +#include "testutil.h" static apr_socket_t *sock = NULL; -static void create_socket(CuTest *tc) +static void create_socket(abts_case *tc, void *data) { apr_status_t rv; rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, 0, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertPtrNotNull(tc, sock); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_ptr_notnull(tc, sock); } -static void set_keepalive(CuTest *tc) +static void set_keepalive(abts_case *tc, void *data) { apr_status_t rv; apr_int32_t ck; rv = apr_socket_opt_set(sock, APR_SO_KEEPALIVE, 1); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 1, ck); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 1, ck); } -static void set_debug(CuTest *tc) +static void set_debug(abts_case *tc, void *data) { apr_status_t rv1, rv2; apr_int32_t ck; @@ -54,82 +54,82 @@ static void set_debug(CuTest *tc) rv2 = apr_socket_opt_get(sock, APR_SO_DEBUG, &ck); apr_assert_success(tc, "get SO_DEBUG option", rv2); if (APR_STATUS_IS_SUCCESS(rv1)) { - CuAssertIntEquals(tc, 1, ck); + abts_int_equal(tc, 1, ck); } else { - CuAssertIntEquals(tc, 0, ck); + abts_int_equal(tc, 0, ck); } } -static void remove_keepalive(CuTest *tc) +static void remove_keepalive(abts_case *tc, void *data) { apr_status_t rv; apr_int32_t ck; rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 1, ck); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 1, ck); rv = apr_socket_opt_set(sock, APR_SO_KEEPALIVE, 0); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 0, ck); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 0, ck); } -static void corkable(CuTest *tc) +static void corkable(abts_case *tc, void *data) { #if !APR_HAVE_CORKABLE_TCP - CuNotImpl(tc, "TCP isn't corkable"); + abts_not_impl(tc, "TCP isn't corkable"); #else apr_status_t rv; apr_int32_t ck; rv = apr_socket_opt_set(sock, APR_TCP_NODELAY, 1); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 1, ck); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 1, ck); rv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 1); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_socket_opt_get(sock, APR_TCP_NOPUSH, &ck); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 1, ck); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 1, ck); rv = apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 0, ck); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 0, ck); rv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); - CuAssertIntEquals(tc, APR_SUCCESS, rv); - CuAssertIntEquals(tc, 1, ck); + abts_int_equal(tc, APR_SUCCESS, rv); + abts_int_equal(tc, 1, ck); #endif } -static void close_socket(CuTest *tc) +static void close_socket(abts_case *tc, void *data) { apr_status_t rv; rv = apr_socket_close(sock); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } -CuSuite *testsockopt(void) +abts_suite *testsockopt(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Socket Options"); - - SUITE_ADD_TEST(suite, create_socket); - SUITE_ADD_TEST(suite, set_keepalive); - SUITE_ADD_TEST(suite, set_debug); - SUITE_ADD_TEST(suite, remove_keepalive); - SUITE_ADD_TEST(suite, corkable); - SUITE_ADD_TEST(suite, close_socket); + suite = ADD_SUITE(suite) + + abts_run_test(suite, create_socket, NULL); + abts_run_test(suite, set_keepalive, NULL); + abts_run_test(suite, set_debug, NULL); + abts_run_test(suite, remove_keepalive, NULL); + abts_run_test(suite, corkable, NULL); + abts_run_test(suite, close_socket, NULL); return suite; } diff --git a/test/teststr.c b/test/teststr.c index ece2b4e9f12..fd5ff89a0ec 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include #include @@ -28,7 +28,7 @@ * functions exist on all platforms. */ -static void test_strtok(CuTest *tc) +static void test_strtok(abts_case *tc, void *data) { struct { char *input; @@ -77,11 +77,11 @@ static void test_strtok(CuTest *tc) retval2 = strtok(str2, cases[curtc].sep); if (!retval1) { - CuAssertTrue(tc, retval2 == NULL); + abts_true(tc, retval2 == NULL); } else { - CuAssertTrue(tc, retval2 != NULL); - CuAssertStrEquals(tc, retval2, retval1); + abts_true(tc, retval2 != NULL); + abts_str_equal(tc, retval2, retval1); } str1 = str2 = NULL; /* make sure we pass NULL on subsequent calls */ @@ -89,7 +89,7 @@ static void test_strtok(CuTest *tc) } } -static void snprintf_noNULL(CuTest *tc) +static void snprintf_noNULL(abts_case *tc, void *data) { char buff[100]; char *testing = apr_palloc(p, 10); @@ -104,43 +104,43 @@ static void snprintf_noNULL(CuTest *tc) /* If this test fails, we are going to seg fault. */ apr_snprintf(buff, sizeof(buff), "%.*s", 7, testing); - CuAssertStrNEquals(tc, buff, testing, 7); + abts_str_nequal(tc, buff, testing, 7); } -static void snprintf_0NULL(CuTest *tc) +static void snprintf_0NULL(abts_case *tc, void *data) { int rv; rv = apr_snprintf(NULL, 0, "%sBAR", "FOO"); - CuAssertIntEquals(tc, 6, rv); + abts_int_equal(tc, 6, rv); } -static void snprintf_0nonNULL(CuTest *tc) +static void snprintf_0nonNULL(abts_case *tc, void *data) { int rv; char *buff = "testing"; rv = apr_snprintf(buff, 0, "%sBAR", "FOO"); - CuAssertIntEquals(tc, 6, rv); - CuAssert(tc, "buff unmangled", strcmp(buff, "FOOBAR") != 0); + abts_int_equal(tc, 6, rv); + abts_assert(tc, "buff unmangled", strcmp(buff, "FOOBAR") != 0); } -static void string_error(CuTest *tc) +static void string_error(abts_case *tc, void *data) { char buf[128], *rv; buf[0] = '\0'; rv = apr_strerror(APR_ENOENT, buf, sizeof buf); - CuAssertPtrEquals(tc, buf, rv); - CuAssertTrue(tc, strlen(buf) > 0); + abts_ptr_equal(tc, buf, rv); + abts_true(tc, strlen(buf) > 0); rv = apr_strerror(APR_TIMEUP, buf, sizeof buf); - CuAssertPtrEquals(tc, buf, rv); - CuAssertStrEquals(tc, "The timeout specified has expired", buf); + abts_ptr_equal(tc, buf, rv); + abts_str_equal(tc, "The timeout specified has expired", buf); } #define SIZE 180000 -static void string_long(CuTest *tc) +static void string_long(abts_case *tc, void *data) { char s[SIZE + 1]; @@ -154,7 +154,7 @@ static void string_long(CuTest *tc) #define MY_LLONG_MAX (APR_INT64_C(9223372036854775807)) #define MY_LLONG_MIN (-MY_LLONG_MAX - APR_INT64_C(1)) -static void string_strtoi64(CuTest *tc) +static void string_strtoi64(abts_case *tc, void *data) { static const struct { int errnum, base; @@ -221,14 +221,14 @@ static void string_strtoi64(CuTest *tc) result = apr_strtoi64(ts[n].in, &end, ts[n].base); errnum = errno; - CuAssert(tc, + abts_assert(tc, apr_psprintf(p, "for '%s': result was %" APR_INT64_T_FMT " not %" APR_INT64_T_FMT, ts[n].in, result, ts[n].result), result == ts[n].result); if (ts[n].errnum != -1) { - CuAssert(tc, + abts_assert(tc, apr_psprintf(p, "for '%s': errno was %d not %d", ts[n].in, errnum, ts[n].errnum), ts[n].errnum == errnum); @@ -236,9 +236,9 @@ static void string_strtoi64(CuTest *tc) if (ts[n].end == NULL) { /* end must point to NUL terminator of .in */ - CuAssertPtrEquals(tc, ts[n].in + strlen(ts[n].in), end); + abts_ptr_equal(tc, ts[n].in + strlen(ts[n].in), end); } else if (ts[n].end != (void *)-1) { - CuAssert(tc, + abts_assert(tc, apr_psprintf(p, "for '%s', end was '%s' not '%s'", ts[n].in, end, ts[n].end), strcmp(ts[n].end, end) == 0); @@ -246,17 +246,17 @@ static void string_strtoi64(CuTest *tc) } } -CuSuite *teststr(void) +abts_suite *teststr(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Strings"); - - SUITE_ADD_TEST(suite, snprintf_0NULL); - SUITE_ADD_TEST(suite, snprintf_0nonNULL); - SUITE_ADD_TEST(suite, snprintf_noNULL); - SUITE_ADD_TEST(suite, test_strtok); - SUITE_ADD_TEST(suite, string_error); - SUITE_ADD_TEST(suite, string_long); - SUITE_ADD_TEST(suite, string_strtoi64); + suite = ADD_SUITE(suite) + + abts_run_test(suite, snprintf_0NULL, NULL); + abts_run_test(suite, snprintf_0nonNULL, NULL); + abts_run_test(suite, snprintf_noNULL, NULL); + abts_run_test(suite, test_strtok, NULL); + abts_run_test(suite, string_error, NULL); + abts_run_test(suite, string_long, NULL); + abts_run_test(suite, string_strtoi64, NULL); return suite; } diff --git a/test/teststrnatcmp.c b/test/teststrnatcmp.c index 194aa11f2cf..11d9bfca815 100644 --- a/test/teststrnatcmp.c +++ b/test/teststrnatcmp.c @@ -16,61 +16,61 @@ #include "apr_file_io.h" #include "apr_errno.h" #include "apr_strings.h" -#include "test_apr.h" +#include "testutil.h" -static void less0(CuTest *tc) +static void less0(abts_case *tc, void *data) { int rv = apr_strnatcmp("a", "b"); - CuAssert(tc, "didn't compare simple strings properly", rv < 0); + abts_assert(tc, "didn't compare simple strings properly", rv < 0); } -static void str_equal(CuTest *tc) +static void str_equal(abts_case *tc, void *data) { int rv = apr_strnatcmp("a", "a"); - CuAssert(tc, "didn't compare simple strings properly", rv == 0); + abts_assert(tc, "didn't compare simple strings properly", rv == 0); } -static void more0(CuTest *tc) +static void more0(abts_case *tc, void *data) { int rv = apr_strnatcmp("b", "a"); - CuAssert(tc, "didn't compare simple strings properly", rv > 0); + abts_assert(tc, "didn't compare simple strings properly", rv > 0); } -static void less_ignore_case(CuTest *tc) +static void less_ignore_case(abts_case *tc, void *data) { int rv = apr_strnatcasecmp("a", "B"); - CuAssert(tc, "didn't compare simple strings properly", rv < 0); + abts_assert(tc, "didn't compare simple strings properly", rv < 0); } -static void str_equal_ignore_case(CuTest *tc) +static void str_equal_ignore_case(abts_case *tc, void *data) { int rv = apr_strnatcasecmp("a", "A"); - CuAssert(tc, "didn't compare simple strings properly", rv == 0); + abts_assert(tc, "didn't compare simple strings properly", rv == 0); } -static void more_ignore_case(CuTest *tc) +static void more_ignore_case(abts_case *tc, void *data) { int rv = apr_strnatcasecmp("b", "A"); - CuAssert(tc, "didn't compare simple strings properly", rv > 0); + abts_assert(tc, "didn't compare simple strings properly", rv > 0); } -static void natcmp(CuTest *tc) +static void natcmp(abts_case *tc, void *data) { int rv = apr_strnatcasecmp("a2", "a10"); - CuAssert(tc, "didn't compare simple strings properly", rv < 0); + abts_assert(tc, "didn't compare simple strings properly", rv < 0); } -CuSuite *teststrnatcmp(void) +abts_suite *teststrnatcmp(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Natural String Cmp"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, less0); - SUITE_ADD_TEST(suite, str_equal); - SUITE_ADD_TEST(suite, more0); - SUITE_ADD_TEST(suite, less_ignore_case); - SUITE_ADD_TEST(suite, str_equal_ignore_case); - SUITE_ADD_TEST(suite, more_ignore_case); - SUITE_ADD_TEST(suite, natcmp); + abts_run_test(suite, less0, NULL); + abts_run_test(suite, str_equal, NULL); + abts_run_test(suite, more0, NULL); + abts_run_test(suite, less_ignore_case, NULL); + abts_run_test(suite, str_equal_ignore_case, NULL); + abts_run_test(suite, more_ignore_case, NULL); + abts_run_test(suite, natcmp, NULL); return suite; } diff --git a/test/testtable.c b/test/testtable.c index ea2dec6528f..66c0c40edc6 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr.h" #include "apr_strings.h" #include "apr_general.h" @@ -31,51 +31,51 @@ static apr_table_t *t1 = NULL; -static void table_make(CuTest *tc) +static void table_make(abts_case *tc, void *data) { t1 = apr_table_make(p, 5); - CuAssertPtrNotNull(tc, t1); + abts_ptr_notnull(tc, t1); } -static void table_get(CuTest *tc) +static void table_get(abts_case *tc, void *data) { const char *val; apr_table_set(t1, "foo", "bar"); val = apr_table_get(t1, "foo"); - CuAssertStrEquals(tc, val, "bar"); + abts_str_equal(tc, val, "bar"); } -static void table_set(CuTest *tc) +static void table_set(abts_case *tc, void *data) { const char *val; apr_table_set(t1, "setkey", "bar"); apr_table_set(t1, "setkey", "2ndtry"); val = apr_table_get(t1, "setkey"); - CuAssertStrEquals(tc, val, "2ndtry"); + abts_str_equal(tc, val, "2ndtry"); } -static void table_getnotthere(CuTest *tc) +static void table_getnotthere(abts_case *tc, void *data) { const char *val; val = apr_table_get(t1, "keynotthere"); - CuAssertPtrEquals(tc, NULL, (void *)val); + abts_ptr_equal(tc, NULL, (void *)val); } -static void table_add(CuTest *tc) +static void table_add(abts_case *tc, void *data) { const char *val; apr_table_add(t1, "addkey", "bar"); apr_table_add(t1, "addkey", "foo"); val = apr_table_get(t1, "addkey"); - CuAssertStrEquals(tc, val, "bar"); + abts_str_equal(tc, val, "bar"); } -static void table_nelts(CuTest *tc) +static void table_nelts(abts_case *tc, void *data) { const char *val; apr_table_t *t = apr_table_make(p, 1); @@ -84,21 +84,21 @@ static void table_nelts(CuTest *tc) apr_table_set(t, "def", "abc"); apr_table_set(t, "foo", "zzz"); val = apr_table_get(t, "foo"); - CuAssertStrEquals(tc, val, "zzz"); + abts_str_equal(tc, val, "zzz"); val = apr_table_get(t, "abc"); - CuAssertStrEquals(tc, val, "def"); + abts_str_equal(tc, val, "def"); val = apr_table_get(t, "def"); - CuAssertStrEquals(tc, val, "abc"); - CuAssertIntEquals(tc, 3, apr_table_elts(t)->nelts); + abts_str_equal(tc, val, "abc"); + abts_int_equal(tc, 3, apr_table_elts(t)->nelts); } -static void table_clear(CuTest *tc) +static void table_clear(abts_case *tc, void *data) { apr_table_clear(t1); - CuAssertIntEquals(tc, 0, apr_table_elts(t1)->nelts); + abts_int_equal(tc, 0, apr_table_elts(t1)->nelts); } -static void table_unset(CuTest *tc) +static void table_unset(abts_case *tc, void *data) { const char *val; apr_table_t *t = apr_table_make(p, 1); @@ -106,14 +106,14 @@ static void table_unset(CuTest *tc) apr_table_set(t, "a", "1"); apr_table_set(t, "b", "2"); apr_table_unset(t, "b"); - CuAssertIntEquals(tc, 1, apr_table_elts(t)->nelts); + abts_int_equal(tc, 1, apr_table_elts(t)->nelts); val = apr_table_get(t, "a"); - CuAssertStrEquals(tc, val, "1"); + abts_str_equal(tc, val, "1"); val = apr_table_get(t, "b"); - CuAssertPtrEquals(tc, (void *)val, (void *)NULL); + abts_ptr_equal(tc, (void *)val, (void *)NULL); } -static void table_overlap(CuTest *tc) +static void table_overlap(abts_case *tc, void *data) { const char *val; apr_table_t *t1 = apr_table_make(p, 1); @@ -131,36 +131,36 @@ static void table_overlap(CuTest *tc) apr_table_addn(t2, "f", "6"); apr_table_overlap(t1, t2, APR_OVERLAP_TABLES_SET); - CuAssertIntEquals(tc, apr_table_elts(t1)->nelts, 7); + abts_int_equal(tc, apr_table_elts(t1)->nelts, 7); val = apr_table_get(t1, "a"); - CuAssertStrEquals(tc, val, "1"); + abts_str_equal(tc, val, "1"); val = apr_table_get(t1, "b"); - CuAssertStrEquals(tc, val, "2."); + abts_str_equal(tc, val, "2."); val = apr_table_get(t1, "c"); - CuAssertStrEquals(tc, val, "3"); + abts_str_equal(tc, val, "3"); val = apr_table_get(t1, "d"); - CuAssertStrEquals(tc, val, "4"); + abts_str_equal(tc, val, "4"); val = apr_table_get(t1, "e"); - CuAssertStrEquals(tc, val, "5"); + abts_str_equal(tc, val, "5"); val = apr_table_get(t1, "f"); - CuAssertStrEquals(tc, val, "6"); + abts_str_equal(tc, val, "6"); val = apr_table_get(t1, "g"); - CuAssertStrEquals(tc, val, "7"); + abts_str_equal(tc, val, "7"); } -CuSuite *testtable(void) +abts_suite *testtable(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Table"); - - SUITE_ADD_TEST(suite, table_make); - SUITE_ADD_TEST(suite, table_get); - SUITE_ADD_TEST(suite, table_set); - SUITE_ADD_TEST(suite, table_getnotthere); - SUITE_ADD_TEST(suite, table_add); - SUITE_ADD_TEST(suite, table_nelts); - SUITE_ADD_TEST(suite, table_clear); - SUITE_ADD_TEST(suite, table_unset); - SUITE_ADD_TEST(suite, table_overlap); + suite = ADD_SUITE(suite) + + abts_run_test(suite, table_make, NULL); + abts_run_test(suite, table_get, NULL); + abts_run_test(suite, table_set, NULL); + abts_run_test(suite, table_getnotthere, NULL); + abts_run_test(suite, table_add, NULL); + abts_run_test(suite, table_nelts, NULL); + abts_run_test(suite, table_clear, NULL); + abts_run_test(suite, table_unset, NULL); + abts_run_test(suite, table_overlap, NULL); return suite; } diff --git a/test/testtemp.c b/test/testtemp.c index a76182ca043..161baa23a67 100644 --- a/test/testtemp.c +++ b/test/testtemp.c @@ -13,21 +13,21 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr_file_io.h" #include "apr_strings.h" -static void test_temp_dir(CuTest *tc) +static void test_temp_dir(abts_case *tc, void *data) { const char *tempdir = NULL; apr_status_t rv; rv = apr_temp_dir_get(&tempdir, p); apr_assert_success(tc, "Error finding Temporary Directory", rv); - CuAssertPtrNotNull(tc, tempdir); + abts_ptr_notnull(tc, tempdir); } -static void test_mktemp(CuTest *tc) +static void test_mktemp(abts_case *tc, void *data) { apr_file_t *f = NULL; const char *tempdir = NULL; @@ -42,12 +42,12 @@ static void test_mktemp(CuTest *tc) apr_assert_success(tc, "Error opening Temporary file", rv); } -CuSuite *testtemp(void) +abts_suite *testtemp(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Temp Dir"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, test_temp_dir); - SUITE_ADD_TEST(suite, test_mktemp); + abts_run_test(suite, test_temp_dir, NULL); + abts_run_test(suite, test_mktemp, NULL); return suite; } diff --git a/test/testthread.c b/test/testthread.c index 8d29b95d7cd..cb4d10a8e01 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -18,7 +18,7 @@ #include "apr_general.h" #include "errno.h" #include "apr_time.h" -#include "test_apr.h" +#include "testutil.h" #if APR_HAS_THREADS @@ -55,76 +55,76 @@ static void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data) return NULL; } -static void thread_init(CuTest *tc) +static void thread_init(abts_case *tc, void *data) { apr_status_t rv; rv = apr_thread_once_init(&control, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } -static void create_threads(CuTest *tc) +static void create_threads(abts_case *tc, void *data) { apr_status_t rv; rv = apr_thread_create(&t1, NULL, thread_func1, NULL, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_thread_create(&t2, NULL, thread_func1, NULL, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_thread_create(&t3, NULL, thread_func1, NULL, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); rv = apr_thread_create(&t4, NULL, thread_func1, NULL, p); - CuAssertIntEquals(tc, APR_SUCCESS, rv); + abts_int_equal(tc, APR_SUCCESS, rv); } -static void join_threads(CuTest *tc) +static void join_threads(abts_case *tc, void *data) { apr_status_t s; apr_thread_join(&s, t1); - CuAssertIntEquals(tc, exit_ret_val, s); + abts_int_equal(tc, exit_ret_val, s); apr_thread_join(&s, t2); - CuAssertIntEquals(tc, exit_ret_val, s); + abts_int_equal(tc, exit_ret_val, s); apr_thread_join(&s, t3); - CuAssertIntEquals(tc, exit_ret_val, s); + abts_int_equal(tc, exit_ret_val, s); apr_thread_join(&s, t4); - CuAssertIntEquals(tc, exit_ret_val, s); + abts_int_equal(tc, exit_ret_val, s); } -static void check_locks(CuTest *tc) +static void check_locks(abts_case *tc, void *data) { - CuAssertIntEquals(tc, 40000, x); + abts_int_equal(tc, 40000, x); } -static void check_thread_once(CuTest *tc) +static void check_thread_once(abts_case *tc, void *data) { - CuAssertIntEquals(tc, 1, value); + abts_int_equal(tc, 1, value); } #else -static void threads_not_impl(CuTest *tc) +static void threads_not_impl(abts_case *tc, void *data) { - CuNotImpl(tc, "Threads not implemented on this platform"); + abts_not_impl(tc, "Threads not implemented on this platform"); } #endif -CuSuite *testthread(void) +abts_suite *testthread(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Threads"); + suite = ADD_SUITE(suite) #if !APR_HAS_THREADS - SUITE_ADD_TEST(suite, threads_not_impl); + abts_run_test(suite, threads_not_impl, NULL); #else - SUITE_ADD_TEST(suite, thread_init); - SUITE_ADD_TEST(suite, create_threads); - SUITE_ADD_TEST(suite, join_threads); - SUITE_ADD_TEST(suite, check_locks); - SUITE_ADD_TEST(suite, check_thread_once); + abts_run_test(suite, thread_init, NULL); + abts_run_test(suite, create_threads, NULL); + abts_run_test(suite, join_threads, NULL); + abts_run_test(suite, check_locks, NULL); + abts_run_test(suite, check_thread_once, NULL); #endif return suite; diff --git a/test/testtime.c b/test/testtime.c index a84da164c23..e9392e5d57f 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -17,7 +17,7 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" -#include "test_apr.h" +#include "testutil.h" #include "apr_strings.h" #include @@ -49,7 +49,7 @@ static char* print_time (apr_pool_t *pool, const apr_time_exp_t *xt) } -static void test_now(CuTest *tc) +static void test_now(abts_case *tc, void *data) { apr_time_t timediff; apr_time_t current; @@ -63,25 +63,25 @@ static void test_now(CuTest *tc) * that the time will be slightly off, so accept anything between -1 and * 1 second. */ - CuAssert(tc, "apr_time and OS time do not agree", + abts_assert(tc, "apr_time and OS time do not agree", (timediff > -2) && (timediff < 2)); } -static void test_gmtstr(CuTest *tc) +static void test_gmtstr(abts_case *tc, void *data) { apr_status_t rv; apr_time_exp_t xt; rv = apr_time_exp_gmt(&xt, now); if (rv == APR_ENOTIMPL) { - CuNotImpl(tc, "apr_time_exp_gmt"); + abts_not_impl(tc, "apr_time_exp_gmt"); } - CuAssertTrue(tc, rv == APR_SUCCESS); - CuAssertStrEquals(tc, "2002-08-14 19:05:36.186711 +0000 [257 Sat]", + abts_true(tc, rv == APR_SUCCESS); + abts_str_equal(tc, "2002-08-14 19:05:36.186711 +0000 [257 Sat]", print_time(p, &xt)); } -static void test_exp_lt(CuTest *tc) +static void test_exp_lt(abts_case *tc, void *data) { apr_status_t rv; apr_time_exp_t xt; @@ -90,14 +90,14 @@ static void test_exp_lt(CuTest *tc) rv = apr_time_exp_lt(&xt, now); if (rv == APR_ENOTIMPL) { - CuNotImpl(tc, "apr_time_exp_lt"); + abts_not_impl(tc, "apr_time_exp_lt"); } - CuAssertTrue(tc, rv == APR_SUCCESS); + abts_true(tc, rv == APR_SUCCESS); libc_exp = localtime(&now_secs); #define CHK_FIELD(f) \ - CuAssertIntEquals(tc, libc_exp->f, xt.f) + abts_int_equal(tc, libc_exp->f, xt.f) CHK_FIELD(tm_sec); CHK_FIELD(tm_min); @@ -111,7 +111,7 @@ static void test_exp_lt(CuTest *tc) #undef CHK_FIELD } -static void test_exp_get_gmt(CuTest *tc) +static void test_exp_get_gmt(abts_case *tc, void *data) { apr_status_t rv; apr_time_exp_t xt; @@ -119,17 +119,17 @@ static void test_exp_get_gmt(CuTest *tc) apr_int64_t hr_off_64; rv = apr_time_exp_gmt(&xt, now); - CuAssertTrue(tc, rv == APR_SUCCESS); + abts_true(tc, rv == APR_SUCCESS); rv = apr_time_exp_get(&imp, &xt); if (rv == APR_ENOTIMPL) { - CuNotImpl(tc, "apr_time_exp_get"); + abts_not_impl(tc, "apr_time_exp_get"); } - CuAssertTrue(tc, rv == APR_SUCCESS); + abts_true(tc, rv == APR_SUCCESS); hr_off_64 = (apr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC; - CuAssertTrue(tc, now + hr_off_64 == imp); + abts_true(tc, now + hr_off_64 == imp); } -static void test_exp_get_lt(CuTest *tc) +static void test_exp_get_lt(abts_case *tc, void *data) { apr_status_t rv; apr_time_exp_t xt; @@ -137,46 +137,46 @@ static void test_exp_get_lt(CuTest *tc) apr_int64_t hr_off_64; rv = apr_time_exp_lt(&xt, now); - CuAssertTrue(tc, rv == APR_SUCCESS); + abts_true(tc, rv == APR_SUCCESS); rv = apr_time_exp_get(&imp, &xt); if (rv == APR_ENOTIMPL) { - CuNotImpl(tc, "apr_time_exp_get"); + abts_not_impl(tc, "apr_time_exp_get"); } - CuAssertTrue(tc, rv == APR_SUCCESS); + abts_true(tc, rv == APR_SUCCESS); hr_off_64 = (apr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC; - CuAssertTrue(tc, now + hr_off_64 == imp); + abts_true(tc, now + hr_off_64 == imp); } -static void test_imp_gmt(CuTest *tc) +static void test_imp_gmt(abts_case *tc, void *data) { apr_status_t rv; apr_time_exp_t xt; apr_time_t imp; rv = apr_time_exp_gmt(&xt, now); - CuAssertTrue(tc, rv == APR_SUCCESS); + abts_true(tc, rv == APR_SUCCESS); rv = apr_time_exp_gmt_get(&imp, &xt); if (rv == APR_ENOTIMPL) { - CuNotImpl(tc, "apr_time_exp_gmt_get"); + abts_not_impl(tc, "apr_time_exp_gmt_get"); } - CuAssertTrue(tc, rv == APR_SUCCESS); - CuAssertTrue(tc, now == imp); + abts_true(tc, rv == APR_SUCCESS); + abts_true(tc, now == imp); } -static void test_rfcstr(CuTest *tc) +static void test_rfcstr(abts_case *tc, void *data) { apr_status_t rv; char str[STR_SIZE]; rv = apr_rfc822_date(str, now); if (rv == APR_ENOTIMPL) { - CuNotImpl(tc, "apr_rfc822_date"); + abts_not_impl(tc, "apr_rfc822_date"); } - CuAssertTrue(tc, rv == APR_SUCCESS); - CuAssertStrEquals(tc, "Sat, 14 Sep 2002 19:05:36 GMT", str); + abts_true(tc, rv == APR_SUCCESS); + abts_str_equal(tc, "Sat, 14 Sep 2002 19:05:36 GMT", str); } -static void test_ctime(CuTest *tc) +static void test_ctime(abts_case *tc, void *data) { apr_status_t rv; char apr_str[STR_SIZE]; @@ -185,16 +185,16 @@ static void test_ctime(CuTest *tc) rv = apr_ctime(apr_str, now); if (rv == APR_ENOTIMPL) { - CuNotImpl(tc, "apr_ctime"); + abts_not_impl(tc, "apr_ctime"); } - CuAssertTrue(tc, rv == APR_SUCCESS); + abts_true(tc, rv == APR_SUCCESS); strcpy(libc_str, ctime(&now_sec)); *strchr(libc_str, '\n') = '\0'; - CuAssertStrEquals(tc, libc_str, apr_str); + abts_str_equal(tc, libc_str, apr_str); } -static void test_strftime(CuTest *tc) +static void test_strftime(abts_case *tc, void *data) { apr_status_t rv; apr_time_exp_t xt; @@ -205,13 +205,13 @@ static void test_strftime(CuTest *tc) str = apr_palloc(p, STR_SIZE + 1); rv = apr_strftime(str, &sz, STR_SIZE, "%R %A %d %B %Y", &xt); if (rv == APR_ENOTIMPL) { - CuNotImpl(tc, "apr_strftime"); + abts_not_impl(tc, "apr_strftime"); } - CuAssertTrue(tc, rv == APR_SUCCESS); - CuAssertStrEquals(tc, "19:05 Saturday 14 September 2002", str); + abts_true(tc, rv == APR_SUCCESS); + abts_str_equal(tc, "19:05 Saturday 14 September 2002", str); } -static void test_strftimesmall(CuTest *tc) +static void test_strftimesmall(abts_case *tc, void *data) { apr_status_t rv; apr_time_exp_t xt; @@ -221,13 +221,13 @@ static void test_strftimesmall(CuTest *tc) rv = apr_time_exp_gmt(&xt, now); rv = apr_strftime(str, &sz, STR_SIZE, "%T", &xt); if (rv == APR_ENOTIMPL) { - CuNotImpl(tc, "apr_strftime"); + abts_not_impl(tc, "apr_strftime"); } - CuAssertTrue(tc, rv == APR_SUCCESS); - CuAssertStrEquals(tc, "19:05:36", str); + abts_true(tc, rv == APR_SUCCESS); + abts_str_equal(tc, "19:05:36", str); } -static void test_exp_tz(CuTest *tc) +static void test_exp_tz(abts_case *tc, void *data) { apr_status_t rv; apr_time_exp_t xt; @@ -235,10 +235,10 @@ static void test_exp_tz(CuTest *tc) rv = apr_time_exp_tz(&xt, now, hr_off); if (rv == APR_ENOTIMPL) { - CuNotImpl(tc, "apr_time_exp_tz"); + abts_not_impl(tc, "apr_time_exp_tz"); } - CuAssertTrue(tc, rv == APR_SUCCESS); - CuAssertTrue(tc, (xt.tm_usec == 186711) && + abts_true(tc, rv == APR_SUCCESS); + abts_true(tc, (xt.tm_usec == 186711) && (xt.tm_sec == 36) && (xt.tm_min == 5) && (xt.tm_hour == 14) && @@ -249,7 +249,7 @@ static void test_exp_tz(CuTest *tc) (xt.tm_yday == 256)); } -static void test_strftimeoffset(CuTest *tc) +static void test_strftimeoffset(abts_case *tc, void *data) { apr_status_t rv; apr_time_exp_t xt; @@ -260,13 +260,13 @@ static void test_strftimeoffset(CuTest *tc) apr_time_exp_tz(&xt, now, hr_off); rv = apr_strftime(str, &sz, STR_SIZE, "%T", &xt); if (rv == APR_ENOTIMPL) { - CuNotImpl(tc, "apr_strftime"); + abts_not_impl(tc, "apr_strftime"); } - CuAssertTrue(tc, rv == APR_SUCCESS); + abts_true(tc, rv == APR_SUCCESS); } /* 0.9.4 and earlier rejected valid dates in 2038 */ -static void test_2038(CuTest *tc) +static void test_2038(abts_case *tc, void *data) { apr_time_exp_t xt; apr_time_t t; @@ -283,23 +283,23 @@ static void test_2038(CuTest *tc) apr_time_exp_get(&t, &xt)); } -CuSuite *testtime(void) +abts_suite *testtime(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Time"); - - SUITE_ADD_TEST(suite, test_now); - SUITE_ADD_TEST(suite, test_gmtstr); - SUITE_ADD_TEST(suite, test_exp_lt); - SUITE_ADD_TEST(suite, test_exp_get_gmt); - SUITE_ADD_TEST(suite, test_exp_get_lt); - SUITE_ADD_TEST(suite, test_imp_gmt); - SUITE_ADD_TEST(suite, test_rfcstr); - SUITE_ADD_TEST(suite, test_ctime); - SUITE_ADD_TEST(suite, test_strftime); - SUITE_ADD_TEST(suite, test_strftimesmall); - SUITE_ADD_TEST(suite, test_exp_tz); - SUITE_ADD_TEST(suite, test_strftimeoffset); - SUITE_ADD_TEST(suite, test_2038); + suite = ADD_SUITE(suite) + + abts_run_test(suite, test_now, NULL); + abts_run_test(suite, test_gmtstr, NULL); + abts_run_test(suite, test_exp_lt, NULL); + abts_run_test(suite, test_exp_get_gmt, NULL); + abts_run_test(suite, test_exp_get_lt, NULL); + abts_run_test(suite, test_imp_gmt, NULL); + abts_run_test(suite, test_rfcstr, NULL); + abts_run_test(suite, test_ctime, NULL); + abts_run_test(suite, test_strftime, NULL); + abts_run_test(suite, test_strftimesmall, NULL); + abts_run_test(suite, test_exp_tz, NULL); + abts_run_test(suite, test_strftimeoffset, NULL); + abts_run_test(suite, test_2038, NULL); return suite; } diff --git a/test/testud.c b/test/testud.c index 0f8737becb6..e5e1b6e1884 100644 --- a/test/testud.c +++ b/test/testud.c @@ -20,7 +20,7 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" -#include "test_apr.h" +#include "testutil.h" static apr_pool_t *pool; static char *testdata; @@ -32,58 +32,58 @@ static apr_status_t string_cleanup(void *data) return APR_SUCCESS; } -static void set_userdata(CuTest *tc) +static void set_userdata(abts_case *tc, void *data) { apr_status_t rv; rv = apr_pool_userdata_set(testdata, "TEST", string_cleanup, pool); - CuAssertIntEquals(tc, rv, APR_SUCCESS); + abts_int_equal(tc, rv, APR_SUCCESS); } -static void get_userdata(CuTest *tc) +static void get_userdata(abts_case *tc, void *data) { apr_status_t rv; char *retdata; rv = apr_pool_userdata_get((void **)&retdata, "TEST", pool); - CuAssertIntEquals(tc, rv, APR_SUCCESS); - CuAssertStrEquals(tc, retdata, testdata); + abts_int_equal(tc, rv, APR_SUCCESS); + abts_str_equal(tc, retdata, testdata); } -static void get_nonexistkey(CuTest *tc) +static void get_nonexistkey(abts_case *tc, void *data) { apr_status_t rv; char *retdata; rv = apr_pool_userdata_get((void **)&retdata, "DOESNTEXIST", pool); - CuAssertIntEquals(tc, rv, APR_SUCCESS); - CuAssertPtrEquals(tc, retdata, NULL); + abts_int_equal(tc, rv, APR_SUCCESS); + abts_ptr_equal(tc, retdata, NULL); } -static void post_pool_clear(CuTest *tc) +static void post_pool_clear(abts_case *tc, void *data) { apr_status_t rv; char *retdata; rv = apr_pool_userdata_get((void **)&retdata, "DOESNTEXIST", pool); - CuAssertIntEquals(tc, rv, APR_SUCCESS); - CuAssertPtrEquals(tc, retdata, NULL); + abts_int_equal(tc, rv, APR_SUCCESS); + abts_ptr_equal(tc, retdata, NULL); } -CuSuite *testud(void) +abts_suite *testud(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("User Data"); + suite = ADD_SUITE(suite) apr_pool_create(&pool, p); testdata = apr_pstrdup(pool, "This is a test\n"); - SUITE_ADD_TEST(suite, set_userdata); - SUITE_ADD_TEST(suite, get_userdata); - SUITE_ADD_TEST(suite, get_nonexistkey); + abts_run_test(suite, set_userdata, NULL); + abts_run_test(suite, get_userdata, NULL); + abts_run_test(suite, get_nonexistkey, NULL); apr_pool_clear(pool); - SUITE_ADD_TEST(suite, post_pool_clear); + abts_run_test(suite, post_pool_clear, NULL); return suite; } diff --git a/test/testuser.c b/test/testuser.c index ed944903b4d..58c55a37b3d 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -13,13 +13,13 @@ * limitations under the License. */ -#include "test_apr.h" +#include "testutil.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_user.h" #if APR_HAS_USER -static void uid_current(CuTest *tc) +static void uid_current(abts_case *tc, void *data) { apr_uid_t uid; apr_gid_t gid; @@ -28,7 +28,7 @@ static void uid_current(CuTest *tc) apr_uid_current(&uid, &gid, p)); } -static void username(CuTest *tc) +static void username(abts_case *tc, void *data) { apr_uid_t uid; apr_gid_t gid; @@ -41,7 +41,7 @@ static void username(CuTest *tc) apr_assert_success(tc, "apr_uid_name_get failed", apr_uid_name_get(&uname, uid, p)); - CuAssertPtrNotNull(tc, uname); + abts_ptr_notnull(tc, uname); apr_assert_success(tc, "apr_uid_get failed", apr_uid_get(&retreived_uid, &retreived_gid, uname, p)); @@ -57,10 +57,10 @@ static void username(CuTest *tc) * also return apr_gid_t values, which was bogus. */ if (!gid) { - CuNotImpl(tc, "Groups from apr_uid_current"); + abts_not_impl(tc, "Groups from apr_uid_current"); } else { - CuNotImpl(tc, "Groups from apr_uid_get"); + abts_not_impl(tc, "Groups from apr_uid_get"); } } else { @@ -72,7 +72,7 @@ static void username(CuTest *tc) #endif } -static void groupname(CuTest *tc) +static void groupname(abts_case *tc, void *data) { apr_uid_t uid; apr_gid_t gid; @@ -84,7 +84,7 @@ static void groupname(CuTest *tc) apr_assert_success(tc, "apr_gid_name_get failed", apr_gid_name_get(&gname, gid, p)); - CuAssertPtrNotNull(tc, gname); + abts_ptr_notnull(tc, gname); apr_assert_success(tc, "apr_gid_get failed", apr_gid_get(&retreived_gid, gname, p)); @@ -93,22 +93,22 @@ static void groupname(CuTest *tc) apr_gid_compare(gid, retreived_gid)); } #else -static void users_not_impl(CuTest *tc) +static void users_not_impl(abts_case *tc, void *data) { - CuNotImpl(tc, "Users not implemented on this platform"); + abts_not_impl(tc, "Users not implemented on this platform"); } #endif -CuSuite *testuser(void) +abts_suite *testuser(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Users"); + suite = ADD_SUITE(suite) #if !APR_HAS_USER - SUITE_ADD_TEST(suite, users_not_impl); + abts_run_test(suite, users_not_impl, NULL); #else - SUITE_ADD_TEST(suite, uid_current); - SUITE_ADD_TEST(suite, username); - SUITE_ADD_TEST(suite, groupname); + abts_run_test(suite, uid_current, NULL); + abts_run_test(suite, username, NULL); + abts_run_test(suite, groupname, NULL); #endif return suite; diff --git a/test/testutil.c b/test/testutil.c new file mode 100644 index 00000000000..2974709cfe9 --- /dev/null +++ b/test/testutil.c @@ -0,0 +1,44 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "abts.h" +#include "testutil.h" +#include "apr_pools.h" + +apr_pool_t *p; + +void apr_assert_success(abts_case* tc, const char* context, apr_status_t rv) +{ + if (rv == APR_ENOTIMPL) { + abts_not_impl(tc, context); + } + + if (rv != APR_SUCCESS) { + char buf[STRING_MAX], ebuf[128]; + sprintf(buf, "%s (%d): %s\n", context, rv, + apr_strerror(rv, ebuf, sizeof ebuf)); + abts_fail(tc, buf); + } +} + +void initialize(void) { + apr_initialize(); + atexit(apr_terminate); + + apr_pool_create(&p, NULL); +} diff --git a/test/testutil.h b/test/testutil.h new file mode 100644 index 00000000000..ea9c1aeca1a --- /dev/null +++ b/test/testutil.h @@ -0,0 +1,88 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_pools.h" +#include "abts.h" + +#ifndef APR_TEST_UTIL +#define APR_TEST_UTIL + +/* XXX FIXME */ +#ifdef WIN32 +#define EXTENSION ".exe" +#elif NETWARE +#define EXTENSION ".nlm" +#else +#define EXTENSION +#endif + +#define STRING_MAX 8096 + +/* Some simple functions to make the test apps easier to write and + * a bit more consistent... + */ + +extern apr_pool_t *p; + +/* Assert that RV is an APR_SUCCESS value; else fail giving strerror + * for RV and CONTEXT message. */ +void apr_assert_success(abts_case* tc, const char *context, apr_status_t rv); + +void initialize(void); + +abts_suite *testatomic(abts_suite *suite); +abts_suite *testdir(abts_suite *suite); +abts_suite *testdso(abts_suite *suite); +abts_suite *testdup(abts_suite *suite); +abts_suite *testenv(abts_suite *suite); +abts_suite *testfile(abts_suite *suite); +abts_suite *testfilecopy(abts_suite *suite); +abts_suite *testfileinfo(abts_suite *suite); +abts_suite *testflock(abts_suite *suite); +abts_suite *testfmt(abts_suite *suite); +abts_suite *testfnmatch(abts_suite *suite); +abts_suite *testgetopt(abts_suite *suite); +abts_suite *testglobalmutex(abts_suite *suite); +abts_suite *testhash(abts_suite *suite); +abts_suite *testipsub(abts_suite *suite); +abts_suite *testlock(abts_suite *suite); +abts_suite *testlfs(abts_suite *suite); +abts_suite *testmmap(abts_suite *suite); +abts_suite *testnames(abts_suite *suite); +abts_suite *testoc(abts_suite *suite); +abts_suite *testpath(abts_suite *suite); +abts_suite *testpipe(abts_suite *suite); +abts_suite *testpoll(abts_suite *suite); +abts_suite *testpool(abts_suite *suite); +abts_suite *testproc(abts_suite *suite); +abts_suite *testprocmutex(abts_suite *suite); +abts_suite *testrand(abts_suite *suite); +abts_suite *testrand2(abts_suite *suite); +abts_suite *testsleep(abts_suite *suite); +abts_suite *testshm(abts_suite *suite); +abts_suite *testsock(abts_suite *suite); +abts_suite *testsockets(abts_suite *suite); +abts_suite *testsockopt(abts_suite *suite); +abts_suite *teststr(abts_suite *suite); +abts_suite *teststrnatcmp(abts_suite *suite); +abts_suite *testtable(abts_suite *suite); +abts_suite *testtemp(abts_suite *suite); +abts_suite *testthread(abts_suite *suite); +abts_suite *testtime(abts_suite *suite); +abts_suite *testud(abts_suite *suite); +abts_suite *testuser(abts_suite *suite); +abts_suite *testvsn(abts_suite *suite); + +#endif /* APR_TEST_INCLUDES */ diff --git a/test/testutil.lo b/test/testutil.lo new file mode 100644 index 0000000000000000000000000000000000000000..62c213b3810e96ba3960ebc6a5624045d039704d GIT binary patch literal 30080 zcmbV#30R!f_4j>WhL;&;Aa4K>0t6CBLN-EHqe(Rc2*D(PEGC-7aeyHi0}PoNvZ#r1 zjWJsHt!nF5wbp&9OSRS1R&A?Ytk&Ars@?2g?dDeZ@Atd+yu-wQzvp|NZ=NUb@1A?l zJ@?#m&pmgUm&s|(t5;Z-rM!=&veX!*)P^2YvOq(vDp7}ctQvdv{rU8_*HtOCZ}dO= zN8NoJ-+S}ZFTVKV^dHzL-nZ-1(?8!k-ctK_g;LS8KNuaqf8%@m!MN+weQ$64!3C+Q zYTtsIhxd@Rsm6c7+0Xppi!YG!X&Fek7o3SQwJ%i@y5PZ;uc7eN8b29O&G4jZeEXaI z`+SCc>lbnS_|iZAuvt_wXj@Pqc~GBC>66?3t2HF?SfP)@6e1E^2b_G zYMd{l#H~f!ZZN|jRb zn0gb^oy=CMY)pkr0aGz3)%lXQC0RQSha-3t^} zr~3w?W=xz?Q#4DSQd8500n0SeN}H_q5H$_`nl9~S8zaxCgN{dq%!p14jkgM{Wl(Nr zc3M{(n^TwEu3en>8$AldfVl!w6 z?nYETJ!wDJX{GK2HyQqZC_L1D2W9q)^(f1_1|#Upv9~%%PhQTPJ``Gh`%p~ltmUJn3i@WvdK^h#Y&fNS+4k2deYS3BM>&%7USZ7*sOitPPb@-u{@cvSg%E#^ zJ)P`J$YY=GM{+3(?fK+5S0`Ub&8&S|UUoi`=jr5=6Or7{KG=Z?NS?2GKV(Z@dy#Im8y3jAm>tNz931|vOPosbUqZ^R#svN*5-j&K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woS$c(34(1s@aKFZhh$i-NBRzA5-u!OsN$Ef|<&#x+K8g5Vs%2Ek^*4#Cxe zJ%as$rwX1Yc%|Sif)5Dp7ko+ZEx`kVUkUmq8~F+aD+Ol>E)r}LTrC(8TqoEsxK;2h z!7Bu>6TDII4#5Wn_X$2P_?qB5f(HcuCFq@E -#include "test_apr.h" +#include "testutil.h" #include "apr_version.h" #include "apr_general.h" -static void test_strings(CuTest *tc) +static void test_strings(abts_case *tc, void *data) { - CuAssertStrEquals(tc, APR_VERSION_STRING, apr_version_string()); + abts_str_equal(tc, APR_VERSION_STRING, apr_version_string()); } -static void test_ints(CuTest *tc) +static void test_ints(abts_case *tc, void *data) { apr_version_t vsn; apr_version(&vsn); - CuAssertIntEquals(tc, APR_MAJOR_VERSION, vsn.major); - CuAssertIntEquals(tc, APR_MINOR_VERSION, vsn.minor); - CuAssertIntEquals(tc, APR_PATCH_VERSION, vsn.patch); + abts_int_equal(tc, APR_MAJOR_VERSION, vsn.major); + abts_int_equal(tc, APR_MINOR_VERSION, vsn.minor); + abts_int_equal(tc, APR_PATCH_VERSION, vsn.patch); } -CuSuite *testvsn(void) +abts_suite *testvsn(abts_suite *suite) { - CuSuite *suite = CuSuiteNew("Versioning"); + suite = ADD_SUITE(suite) - SUITE_ADD_TEST(suite, test_strings); - SUITE_ADD_TEST(suite, test_ints); + abts_run_test(suite, test_strings, NULL); + abts_run_test(suite, test_ints, NULL); return suite; } From 699315c53a1a17374583a5ae9eb31c68e0d6d8e7 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 14 May 2004 06:53:48 +0000 Subject: [PATCH 4975/7878] Remove object files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65093 13f79535-47bb-0310-9956-ffa450edef68 --- test/testutil.lo | Bin 30080 -> 0 bytes test/testutil.o | Bin 29796 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test/testutil.lo delete mode 100644 test/testutil.o diff --git a/test/testutil.lo b/test/testutil.lo deleted file mode 100644 index 62c213b3810e96ba3960ebc6a5624045d039704d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30080 zcmbV#30R!f_4j>WhL;&;Aa4K>0t6CBLN-EHqe(Rc2*D(PEGC-7aeyHi0}PoNvZ#r1 zjWJsHt!nF5wbp&9OSRS1R&A?Ytk&Ars@?2g?dDeZ@Atd+yu-wQzvp|NZ=NUb@1A?l zJ@?#m&pmgUm&s|(t5;Z-rM!=&veX!*)P^2YvOq(vDp7}ctQvdv{rU8_*HtOCZ}dO= zN8NoJ-+S}ZFTVKV^dHzL-nZ-1(?8!k-ctK_g;LS8KNuaqf8%@m!MN+weQ$64!3C+Q zYTtsIhxd@Rsm6c7+0Xppi!YG!X&Fek7o3SQwJ%i@y5PZ;uc7eN8b29O&G4jZeEXaI z`+SCc>lbnS_|iZAuvt_wXj@Pqc~GBC>66?3t2HF?SfP)@6e1E^2b_G zYMd{l#H~f!ZZN|jRb zn0gb^oy=CMY)pkr0aGz3)%lXQC0RQSha-3t^} zr~3w?W=xz?Q#4DSQd8500n0SeN}H_q5H$_`nl9~S8zaxCgN{dq%!p14jkgM{Wl(Nr zc3M{(n^TwEu3en>8$AldfVl!w6 z?nYETJ!wDJX{GK2HyQqZC_L1D2W9q)^(f1_1|#Upv9~%%PhQTPJ``Gh`%p~ltmUJn3i@WvdK^h#Y&fNS+4k2deYS3BM>&%7USZ7*sOitPPb@-u{@cvSg%E#^ zJ)P`J$YY=GM{+3(?fK+5S0`Ub&8&S|UUoi`=jr5=6Or7{KG=Z?NS?2GKV(Z@dy#Im8y3jAm>tNz931|vOPosbUqZ^R#svN*5-j&K zfq*JTzljwu*-fsu%8UE+I`=&?T(6UlhmgEUCs$+gX5FHB%Q)2E*2!X8;SSx= zw|q$6tu?!yX1Ygfb^*ulew}+alMm?J9wxt|U6adlP)Qr$86l_cC8ya1hLafTg*sRq$7E zf-|T7K1DhvMBg88VnQ)SrXieUI&VV zED!zzBNaGA$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@E Date: Fri, 14 May 2004 07:13:46 +0000 Subject: [PATCH 4976/7878] * test/abts.c (report): Just print "success" if there were no failures. (update_status, main): Suppress the spinning bar if -q is used, and fix calloc usage. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65094 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/test/abts.c b/test/abts.c index c60ac6e8036..c0e1ce0b1f0 100644 --- a/test/abts.c +++ b/test/abts.c @@ -25,6 +25,7 @@ static char status[ABTS_STAT_SIZE] = {'|', '/', '-', '|', '\\', '-'}; static int curr_char; static int verbose = 0; static int exclude = 0; +static int quiet = 0; const char **testlist = NULL; @@ -58,9 +59,11 @@ static void reset_status(void) static void update_status(void) { - curr_char = (curr_char + 1) % ABTS_STAT_SIZE; - fprintf(stdout, "\b%c", status[curr_char]); - fflush(stdout); + if (!quiet) { + curr_char = (curr_char + 1) % ABTS_STAT_SIZE; + fprintf(stdout, "\b%c", status[curr_char]); + fflush(stdout); + } } static void end_suite(abts_suite *suite) @@ -146,13 +149,22 @@ void abts_run_test(abts_suite *ts, test_func f, void *value) static int report(abts_suite *suite) { - int return_failed = 0; + int count = 0; sub_suite *dptr; if (suite && suite->tail &&!suite->tail->not_run) { end_suite(suite); } + for (dptr = suite->head; dptr; dptr = dptr->next) { + count += dptr->failed; + } + + if (count == 0) { + printf("All tests passed.\n"); + return 0; + } + dptr = suite->head; fprintf(stdout, "%-15s\t\tTotal\tFail\tFailed %%\n", "Failed Tests"); fprintf(stdout, "===================================================\n"); @@ -161,11 +173,10 @@ static int report(abts_suite *suite) float percent = ((float)dptr->failed / (float)dptr->num_test); fprintf(stdout, "%-15s\t\t%5d\t%4d\t%6.2f%%\n", dptr->name, dptr->num_test, dptr->failed, percent * 100); - return_failed = 1; } dptr = dptr->next; } - return return_failed; + return 1; } void abts_log_message(const char *fmt, ...) @@ -338,6 +349,10 @@ int main(int argc, const char *const argv[]) { /* print the list. */ continue; } + if (!strcmp(argv[i], "-q")) { + quiet = 1; + continue; + } if (argv[i][0] == '-') { fprintf(stderr, "Invalid option: `%s'\n", argv[i]); exit(1); @@ -349,7 +364,7 @@ int main(int argc, const char *const argv[]) { /* Waste a little space here, because it is easier than counting the * number of tests listed. Besides it is at most three char *. */ - testlist = calloc(0, sizeof(char *) * (argc + 1)); + testlist = calloc(argc + 1, sizeof(char *)); for (i = 1; i < argc; i++) { testlist[i - 1] = argv[i]; } From ba1279fa37737aaab3752c86c0c1317baf569105 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 14 May 2004 14:43:22 +0000 Subject: [PATCH 4977/7878] Add the line number to the verbose output from abts. This also removes a test that is segfaulting in testshm. That will need to be fixed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65095 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 40 ++++----- test/abts.h | 32 ++++--- test/testargs.c | 26 +++--- test/testatomic.c | 56 ++++++------ test/testdir.c | 76 ++++++++-------- test/testdso.c | 68 +++++++------- test/testdup.c | 88 +++++++++--------- test/testenv.c | 16 ++-- test/testfile.c | 200 ++++++++++++++++++++--------------------- test/testfilecopy.c | 4 +- test/testfileinfo.c | 62 ++++++------- test/testflock.c | 12 +-- test/testfmt.c | 36 ++++---- test/testfnmatch.c | 12 +-- test/testglobalmutex.c | 6 +- test/testhash.c | 84 ++++++++--------- test/testipsub.c | 24 ++--- test/testlfs.c | 30 +++---- test/testlock.c | 52 +++++------ test/testmmap.c | 40 ++++----- test/testnames.c | 74 +++++++-------- test/testoc.c | 18 ++-- test/testpath.c | 32 +++---- test/testpipe.c | 78 ++++++++-------- test/testpoll.c | 168 +++++++++++++++++----------------- test/testpools.c | 20 ++--- test/testproc.c | 58 ++++++------ test/testprocmutex.c | 8 +- test/testrand.c | 2 +- test/testrand2.c | 16 ++-- test/testshm.c | 42 ++++----- test/testsleep.c | 4 +- test/testsock.c | 20 ++--- test/testsockets.c | 70 +++++++-------- test/testsockopt.c | 50 +++++------ test/teststr.c | 30 +++---- test/teststrnatcmp.c | 14 +-- test/testtable.c | 42 ++++----- test/testtemp.c | 2 +- test/testthread.c | 26 +++--- test/testtime.c | 72 +++++++-------- test/testud.c | 14 +-- test/testuser.c | 10 +-- test/testutil.c | 4 +- test/testvsn.c | 8 +- 45 files changed, 929 insertions(+), 917 deletions(-) diff --git a/test/abts.c b/test/abts.c index c0e1ce0b1f0..469a6429c77 100644 --- a/test/abts.c +++ b/test/abts.c @@ -193,7 +193,7 @@ void abts_log_message(const char *fmt, ...) } } -void abts_int_equal(abts_case *tc, const int expected, const int actual) +void abts_int_equal(abts_case *tc, const int expected, const int actual, int lineno) { update_status(); if (tc->failed) return; @@ -202,12 +202,12 @@ void abts_int_equal(abts_case *tc, const int expected, const int actual) tc->failed = TRUE; if (verbose) { - fprintf(stderr, "expected <%d>, but saw <%d>\n", expected, actual); + fprintf(stderr, "Line %d: expected <%d>, but saw <%d>\n", lineno, expected, actual); fflush(stderr); } } -void abts_int_nequal(abts_case *tc, const int expected, const int actual) +void abts_int_nequal(abts_case *tc, const int expected, const int actual, int lineno) { update_status(); if (tc->failed) return; @@ -216,12 +216,12 @@ void abts_int_nequal(abts_case *tc, const int expected, const int actual) tc->failed = TRUE; if (verbose) { - fprintf(stderr, "expected <%d>, but saw <%d>\n", expected, actual); + fprintf(stderr, "Line %d: expected <%d>, but saw <%d>\n", lineno, expected, actual); fflush(stderr); } } -void abts_str_equal(abts_case *tc, const char *expected, const char *actual) +void abts_str_equal(abts_case *tc, const char *expected, const char *actual, int lineno) { update_status(); if (tc->failed) return; @@ -230,13 +230,13 @@ void abts_str_equal(abts_case *tc, const char *expected, const char *actual) tc->failed = TRUE; if (verbose) { - fprintf(stderr, "expected <%s>, but saw <%s>\n", expected, actual); + fprintf(stderr, "Line %d: expected <%s>, but saw <%s>\n", lineno, expected, actual); fflush(stderr); } } void abts_str_nequal(abts_case *tc, const char *expected, const char *actual, - size_t n) + size_t n, int lineno) { update_status(); if (tc->failed) return; @@ -245,12 +245,12 @@ void abts_str_nequal(abts_case *tc, const char *expected, const char *actual, tc->failed = TRUE; if (verbose) { - fprintf(stderr, "expected <%s>, but saw <%s>\n", expected, actual); + fprintf(stderr, "Line %d: expected <%s>, but saw <%s>\n", lineno, expected, actual); fflush(stderr); } } -void abts_ptr_notnull(abts_case *tc, const void *ptr) +void abts_ptr_notnull(abts_case *tc, const void *ptr, int lineno) { update_status(); if (tc->failed) return; @@ -259,12 +259,12 @@ void abts_ptr_notnull(abts_case *tc, const void *ptr) tc->failed = TRUE; if (verbose) { - fprintf(stderr, "Expected NULL, but saw <%p>", ptr); + fprintf(stderr, "Line %d: Expected NULL, but saw <%p>", lineno, ptr); fflush(stderr); } } -void abts_ptr_equal(abts_case *tc, const void *expected, const void *actual) +void abts_ptr_equal(abts_case *tc, const void *expected, const void *actual, int lineno) { update_status(); if (tc->failed) return; @@ -273,24 +273,24 @@ void abts_ptr_equal(abts_case *tc, const void *expected, const void *actual) tc->failed = TRUE; if (verbose) { - fprintf(stderr, "expected <%p>, but saw <%p>\n", expected, actual); + fprintf(stderr, "Line %d: expected <%p>, but saw <%p>\n", lineno, expected, actual); fflush(stderr); } } -void abts_fail(abts_case *tc, const char *message) +void abts_fail(abts_case *tc, const char *message, int lineno) { update_status(); if (tc->failed) return; tc->failed = TRUE; if (verbose) { - fprintf(stderr, "%s\n", message); + fprintf(stderr, "Line %d: %s\n", lineno, message); fflush(stderr); } } -void abts_assert(abts_case *tc, const char *message, int condition) +void abts_assert(abts_case *tc, const char *message, int condition, int lineno) { update_status(); if (tc->failed) return; @@ -299,12 +299,12 @@ void abts_assert(abts_case *tc, const char *message, int condition) tc->failed = TRUE; if (verbose) { - fprintf(stderr, "%s", message); + fprintf(stderr, "Line %d: %s", lineno, message); fflush(stderr); } } -void abts_true(abts_case *tc, int condition) +void abts_true(abts_case *tc, int condition, int lineno) { update_status(); if (tc->failed) return; @@ -313,18 +313,18 @@ void abts_true(abts_case *tc, int condition) tc->failed = TRUE; if (verbose) { - fprintf(stderr, "Condition is false, but expected true"); + fprintf(stderr, "Line %d: Condition is false, but expected true", lineno); fflush(stderr); } } -void abts_not_impl(abts_case *tc, const char *message) +void abts_not_impl(abts_case *tc, const char *message, int lineno) { update_status(); tc->suite->not_impl++; if (verbose) { - fprintf(stderr, "%s", message); + fprintf(stderr, "Line %d: %s", lineno, message); fflush(stderr); } } diff --git a/test/abts.h b/test/abts.h index 0785402dc1e..51123ff079f 100644 --- a/test/abts.h +++ b/test/abts.h @@ -62,17 +62,29 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name); void abts_run_test(abts_suite *ts, test_func f, void *value); void abts_log_message(const char *fmt, ...); -void abts_int_equal(abts_case *tc, const int expected, const int actual); -void abts_int_nequal(abts_case *tc, const int expected, const int actual); -void abts_str_equal(abts_case *tc, const char *expected, const char *actual); +void abts_int_equal(abts_case *tc, const int expected, const int actual, int lineno); +void abts_int_nequal(abts_case *tc, const int expected, const int actual, int lineno); +void abts_str_equal(abts_case *tc, const char *expected, const char *actual, int lineno); void abts_str_nequal(abts_case *tc, const char *expected, const char *actual, - size_t n); -void abts_ptr_notnull(abts_case *tc, const void *ptr); -void abts_ptr_equal(abts_case *tc, const void *expected, const void *actual); -void abts_true(abts_case *tc, int condition); -void abts_fail(abts_case *tc, const char *message); -void abts_not_impl(abts_case *tc, const char *message); -void abts_assert(abts_case *tc, const char *message, int condition); + size_t n, int lineno); +void abts_ptr_notnull(abts_case *tc, const void *ptr, int lineno); +void abts_ptr_equal(abts_case *tc, const void *expected, const void *actual, int lineno); +void abts_true(abts_case *tc, int condition, int lineno); +void abts_fail(abts_case *tc, const char *message, int lineno); +void abts_not_impl(abts_case *tc, const char *message, int lineno); +void abts_assert(abts_case *tc, const char *message, int condition, int lineno); + +/* Convenience macros. Ryan hates these! */ +#define ABTS_INT_EQUAL(a, b, c) abts_int_equal(a, b, c, __LINE__) +#define ABTS_INT_NEQUAL(a, b, c) abts_int_nequal(a, b, c, __LINE__) +#define ABTS_STR_EQUAL(a, b, c) abts_str_equal(a, b, c, __LINE__) +#define ABTS_STR_NEQUAL(a, b, c, d) abts_str_nequal(a, b, c, d, __LINE__) +#define ABTS_PTR_NOTNULL(a, b) abts_ptr_notnull(a, b, __LINE__) +#define ABTS_PTR_EQUAL(a, b, c) abts_ptr_equal(a, b, c, __LINE__) +#define ABTS_TRUE(a, b) abts_true(a, b, __LINE__); +#define ABTS_FAIL(a, b) abts_fail(a, b, __LINE__); +#define ABTS_NOT_IMPL(a, b) abts_not_impl(a, b, __LINE__); +#define ABTS_ASSERT(a, b, c) abts_assert(a, b, c, __LINE__); abts_suite *run_tests(abts_suite *suite); abts_suite *run_tests1(abts_suite *suite); diff --git a/test/testargs.c b/test/testargs.c index 2c8205ec8e6..6c136aac422 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -50,7 +50,7 @@ static void no_options_found(abts_case *tc, void *data) str[0] = '\0'; rv = apr_getopt_init(&opt, p, largc, largv); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); while (apr_getopt(opt, "abcd", &ch, &optarg) == APR_SUCCESS) { switch (ch) { @@ -62,7 +62,7 @@ static void no_options_found(abts_case *tc, void *data) format_arg(str, ch, optarg); } } - abts_str_equal(tc, "option: a\n" + ABTS_STR_EQUAL(tc, "option: a\n" "option: b\n" "option: c\n" "option: d\n", str); @@ -80,7 +80,7 @@ static void no_options(abts_case *tc, void *data) str[0] = '\0'; rv = apr_getopt_init(&opt, p, largc, largv); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; @@ -97,7 +97,7 @@ static void no_options(abts_case *tc, void *data) break; } } - abts_str_equal(tc, "testprog: illegal option -- a\n", str); + ABTS_STR_EQUAL(tc, "testprog: illegal option -- a\n", str); } static void required_option(abts_case *tc, void *data) @@ -112,7 +112,7 @@ static void required_option(abts_case *tc, void *data) str[0] = '\0'; rv = apr_getopt_init(&opt, p, largc, largv); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; @@ -126,7 +126,7 @@ static void required_option(abts_case *tc, void *data) break; } } - abts_str_equal(tc, "option: a with foo\n", str); + ABTS_STR_EQUAL(tc, "option: a with foo\n", str); } static void required_option_notgiven(abts_case *tc, void *data) @@ -141,7 +141,7 @@ static void required_option_notgiven(abts_case *tc, void *data) str[0] = '\0'; rv = apr_getopt_init(&opt, p, largc, largv); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; @@ -155,7 +155,7 @@ static void required_option_notgiven(abts_case *tc, void *data) break; } } - abts_str_equal(tc, "testprog: option requires an argument -- a\n", str); + ABTS_STR_EQUAL(tc, "testprog: option requires an argument -- a\n", str); } static void optional_option(abts_case *tc, void *data) @@ -170,7 +170,7 @@ static void optional_option(abts_case *tc, void *data) str[0] = '\0'; rv = apr_getopt_init(&opt, p, largc, largv); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; @@ -184,7 +184,7 @@ static void optional_option(abts_case *tc, void *data) break; } } - abts_str_equal(tc, "option: a with foo\n", str); + ABTS_STR_EQUAL(tc, "option: a with foo\n", str); } static void optional_option_notgiven(abts_case *tc, void *data) @@ -199,7 +199,7 @@ static void optional_option_notgiven(abts_case *tc, void *data) str[0] = '\0'; rv = apr_getopt_init(&opt, p, largc, largv); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; @@ -215,9 +215,9 @@ static void optional_option_notgiven(abts_case *tc, void *data) } #if 0 /* Our version of getopt doesn't allow for optional arguments. */ - abts_str_equal(tc, "option: a\n", str); + ABTS_STR_EQUAL(tc, "option: a\n", str); #endif - abts_str_equal(tc, "testprog: option requires an argument -- a\n", str); + ABTS_STR_EQUAL(tc, "testprog: option requires an argument -- a\n", str); } abts_suite *testgetopt(abts_suite *suite) diff --git a/test/testatomic.c b/test/testatomic.c index 86f58f3b7d8..eb8f2a24b3d 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -42,14 +42,14 @@ static void test_set32(abts_case *tc, void *data) { apr_uint32_t y32; apr_atomic_set32(&y32, 2); - abts_int_equal(tc, 2, y32); + ABTS_INT_EQUAL(tc, 2, y32); } static void test_read32(abts_case *tc, void *data) { apr_uint32_t y32; apr_atomic_set32(&y32, 2); - abts_int_equal(tc, 2, apr_atomic_read32(&y32)); + ABTS_INT_EQUAL(tc, 2, apr_atomic_read32(&y32)); } static void test_dec32(abts_case *tc, void *data) @@ -60,12 +60,12 @@ static void test_dec32(abts_case *tc, void *data) apr_atomic_set32(&y32, 2); rv = apr_atomic_dec32(&y32); - abts_int_equal(tc, 1, y32); - abts_assert(tc, "atomic_dec returned zero when it shouldn't", rv != 0); + ABTS_INT_EQUAL(tc, 1, y32); + ABTS_ASSERT(tc, "atomic_dec returned zero when it shouldn't", rv != 0); rv = apr_atomic_dec32(&y32); - abts_int_equal(tc, 0, y32); - abts_assert(tc, "atomic_dec didn't returned zero when it should", rv == 0); + ABTS_INT_EQUAL(tc, 0, y32); + ABTS_ASSERT(tc, "atomic_dec didn't returned zero when it should", rv == 0); } static void test_xchg32(abts_case *tc, void *data) @@ -76,8 +76,8 @@ static void test_xchg32(abts_case *tc, void *data) apr_atomic_set32(&y32, 100); oldval = apr_atomic_xchg32(&y32, 50); - abts_int_equal(tc, 100, oldval); - abts_int_equal(tc, 50, y32); + ABTS_INT_EQUAL(tc, 100, oldval); + ABTS_INT_EQUAL(tc, 50, y32); } static void test_cas_equal(abts_case *tc, void *data) @@ -86,8 +86,8 @@ static void test_cas_equal(abts_case *tc, void *data) apr_uint32_t oldval; oldval = apr_atomic_cas32(&casval, 12, 0); - abts_int_equal(tc, 0, oldval); - abts_int_equal(tc, 12, casval); + ABTS_INT_EQUAL(tc, 0, oldval); + ABTS_INT_EQUAL(tc, 12, casval); } static void test_cas_equal_nonnull(abts_case *tc, void *data) @@ -96,8 +96,8 @@ static void test_cas_equal_nonnull(abts_case *tc, void *data) apr_uint32_t oldval; oldval = apr_atomic_cas32(&casval, 23, 12); - abts_int_equal(tc, 12, oldval); - abts_int_equal(tc, 23, casval); + ABTS_INT_EQUAL(tc, 12, oldval); + ABTS_INT_EQUAL(tc, 23, casval); } static void test_cas_notequal(abts_case *tc, void *data) @@ -106,8 +106,8 @@ static void test_cas_notequal(abts_case *tc, void *data) apr_uint32_t oldval; oldval = apr_atomic_cas32(&casval, 23, 2); - abts_int_equal(tc, 12, oldval); - abts_int_equal(tc, 12, casval); + ABTS_INT_EQUAL(tc, 12, oldval); + ABTS_INT_EQUAL(tc, 12, casval); } static void test_add32(abts_case *tc, void *data) @@ -117,8 +117,8 @@ static void test_add32(abts_case *tc, void *data) apr_atomic_set32(&y32, 23); oldval = apr_atomic_add32(&y32, 4); - abts_int_equal(tc, 23, oldval); - abts_int_equal(tc, 27, y32); + ABTS_INT_EQUAL(tc, 23, oldval); + ABTS_INT_EQUAL(tc, 27, y32); } static void test_inc32(abts_case *tc, void *data) @@ -128,8 +128,8 @@ static void test_inc32(abts_case *tc, void *data) apr_atomic_set32(&y32, 23); oldval = apr_atomic_inc32(&y32); - abts_int_equal(tc, 23, oldval); - abts_int_equal(tc, 24, y32); + ABTS_INT_EQUAL(tc, 23, oldval); + ABTS_INT_EQUAL(tc, 24, y32); } static void test_set_add_inc_sub(abts_case *tc, void *data) @@ -141,7 +141,7 @@ static void test_set_add_inc_sub(abts_case *tc, void *data) apr_atomic_inc32(&y32); apr_atomic_sub32(&y32, 10); - abts_int_equal(tc, 11, y32); + ABTS_INT_EQUAL(tc, 11, y32); } static void test_wrap_zero(abts_case *tc, void *data) @@ -154,9 +154,9 @@ static void test_wrap_zero(abts_case *tc, void *data) apr_atomic_set32(&y32, 0); rv = apr_atomic_dec32(&y32); - abts_assert(tc, "apr_atomic_dec32 on zero returned zero.", rv != 0); + ABTS_ASSERT(tc, "apr_atomic_dec32 on zero returned zero.", rv != 0); str = apr_psprintf(p, "zero wrap failed: 0 - 1 = %d", y32); - abts_assert(tc, str, y32 == minus1); + ABTS_ASSERT(tc, str, y32 == minus1); } static void test_inc_neg1(abts_case *tc, void *data) @@ -168,9 +168,9 @@ static void test_inc_neg1(abts_case *tc, void *data) rv = apr_atomic_inc32(&y32); - abts_assert(tc, "apr_atomic_dec32 on zero returned zero.", rv == minus1); + ABTS_ASSERT(tc, "apr_atomic_dec32 on zero returned zero.", rv == minus1); str = apr_psprintf(p, "zero wrap failed: -1 + 1 = %d", y32); - abts_assert(tc, str, y32 == 0); + ABTS_ASSERT(tc, str, y32 == 0); } @@ -249,7 +249,7 @@ static void test_atomics_threaded(abts_case *tc, void *data) r1 = apr_thread_create(&t1[i], NULL, thread_func_mutex, NULL, p); r2 = apr_thread_create(&t2[i], NULL, thread_func_atomic, NULL, p); r3 = apr_thread_create(&t3[i], NULL, thread_func_none, NULL, p); - abts_assert(tc, "Failed creating threads", + ABTS_ASSERT(tc, "Failed creating threads", r1 == APR_SUCCESS && r2 == APR_SUCCESS && r3 == APR_SUCCESS); } @@ -259,17 +259,17 @@ static void test_atomics_threaded(abts_case *tc, void *data) apr_thread_join(&s2[i], t2[i]); apr_thread_join(&s3[i], t3[i]); - abts_assert(tc, "Invalid return value from thread_join", + ABTS_ASSERT(tc, "Invalid return value from thread_join", s1[i] == exit_ret_val && s2[i] == exit_ret_val && s3[i] == exit_ret_val); } - abts_int_equal(tc, x, NUM_THREADS * NUM_ITERATIONS); - abts_int_equal(tc, apr_atomic_read32(&y), NUM_THREADS * NUM_ITERATIONS); + ABTS_INT_EQUAL(tc, x, NUM_THREADS * NUM_ITERATIONS); + ABTS_INT_EQUAL(tc, apr_atomic_read32(&y), NUM_THREADS * NUM_ITERATIONS); /* Comment out this test, because I have no clue what this test is * actually telling us. We are checking something that may or may not * be true, and it isn't really testing APR at all. - abts_assert(tc, "We expect this to fail, because we tried to update " + ABTS_ASSERT(tc, "We expect this to fail, because we tried to update " "an integer in a non-thread-safe manner.", z != NUM_THREADS * NUM_ITERATIONS); */ diff --git a/test/testdir.c b/test/testdir.c index b9a5bb2e415..3eb9a26319b 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -29,11 +29,11 @@ static void test_mkdir(abts_case *tc, void *data) apr_finfo_t finfo; rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, APR_DIR, finfo.filetype); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype); } static void test_mkdir_recurs(abts_case *tc, void *data) @@ -43,19 +43,19 @@ static void test_mkdir_recurs(abts_case *tc, void *data) rv = apr_dir_make_recursive("data/one/two/three", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, "data/one", APR_FINFO_TYPE, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, APR_DIR, finfo.filetype); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype); rv = apr_stat(&finfo, "data/one/two", APR_FINFO_TYPE, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, APR_DIR, finfo.filetype); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype); rv = apr_stat(&finfo, "data/one/two/three", APR_FINFO_TYPE, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, APR_DIR, finfo.filetype); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype); } static void test_remove(abts_case *tc, void *data) @@ -64,10 +64,10 @@ static void test_remove(abts_case *tc, void *data) apr_finfo_t finfo; rv = apr_dir_remove("data/testdir", p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p); - abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_removeall_fail(abts_case *tc, void *data) @@ -75,7 +75,7 @@ static void test_removeall_fail(abts_case *tc, void *data) apr_status_t rv; rv = apr_dir_remove("data/one", p); - abts_int_equal(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv)); } static void test_removeall(abts_case *tc, void *data) @@ -83,13 +83,13 @@ static void test_removeall(abts_case *tc, void *data) apr_status_t rv; rv = apr_dir_remove("data/one/two/three", p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_dir_remove("data/one/two", p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_dir_remove("data/one", p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void test_remove_notthere(abts_case *tc, void *data) @@ -97,7 +97,7 @@ static void test_remove_notthere(abts_case *tc, void *data) apr_status_t rv; rv = apr_dir_remove("data/notthere", p); - abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_mkdir_twice(abts_case *tc, void *data) @@ -105,13 +105,13 @@ static void test_mkdir_twice(abts_case *tc, void *data) apr_status_t rv; rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); - abts_int_equal(tc, 1, APR_STATUS_IS_EEXIST(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EEXIST(rv)); rv = apr_dir_remove("data/testdir", p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void test_opendir(abts_case *tc, void *data) @@ -120,7 +120,7 @@ static void test_opendir(abts_case *tc, void *data) apr_dir_t *dir; rv = apr_dir_open(&dir, "data", p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); apr_dir_close(dir); } @@ -130,7 +130,7 @@ static void test_opendir_notthere(abts_case *tc, void *data) apr_dir_t *dir; rv = apr_dir_open(&dir, "notthere", p); - abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_closedir(abts_case *tc, void *data) @@ -139,9 +139,9 @@ static void test_closedir(abts_case *tc, void *data) apr_dir_t *dir; rv = apr_dir_open(&dir, "data", p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_dir_close(dir); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void test_rewind(abts_case *tc, void *data) @@ -161,7 +161,7 @@ static void test_rewind(abts_case *tc, void *data) apr_assert_success(tc, "apr_dir_close failed", apr_dir_close(dir)); - abts_str_equal(tc, first.name, second.name); + ABTS_STR_EQUAL(tc, first.name, second.name); } /* Test for a (fixed) bug in apr_dir_read(). This bug only happened @@ -175,46 +175,46 @@ static void test_uncleared_errno(abts_case *tc, void *data) apr_status_t rv; rv = apr_dir_make("dir1", APR_OS_DEFAULT, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_dir_make("dir2", APR_OS_DEFAULT, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_open(&thefile, "dir1/file1", APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_close(thefile); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* Try to remove dir1. This should fail because it's not empty. However, on a platform with threads disabled (such as FreeBSD), `errno' will be set as a result. */ rv = apr_dir_remove("dir1", p); - abts_int_equal(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv)); /* Read `.' and `..' out of dir2. */ rv = apr_dir_open(&this_dir, "dir2", p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_dir_read(&finfo, finfo_flags, this_dir); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_dir_read(&finfo, finfo_flags, this_dir); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* Now, when we attempt to do a third read of empty dir2, and the underlying system readdir() returns NULL, the old value of errno shouldn't cause a false alarm. We should get an ENOENT back from apr_dir_read, and *not* the old errno. */ rv = apr_dir_read(&finfo, finfo_flags, this_dir); - abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); rv = apr_dir_close(this_dir); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* Cleanup */ rv = apr_file_remove("dir1/file1", p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_dir_remove("dir1", p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_dir_remove("dir2", p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } diff --git a/test/testdso.c b/test/testdso.c index 7b466daaf4d..8f67fccd506 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -54,8 +54,8 @@ static void test_load_module(abts_case *tc, void *data) char errstr[256]; status = apr_dso_load(&h, modname, p); - abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - abts_ptr_notnull(tc, h); + ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + ABTS_PTR_NOTNULL(tc, h); apr_dso_unload(h); } @@ -70,16 +70,16 @@ static void test_dso_sym(abts_case *tc, void *data) char errstr[256]; status = apr_dso_load(&h, modname, p); - abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - abts_ptr_notnull(tc, h); + ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + ABTS_PTR_NOTNULL(tc, h); status = apr_dso_sym(&func1, h, "print_hello"); - abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - abts_ptr_notnull(tc, func1); + ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + ABTS_PTR_NOTNULL(tc, func1); function = (void (*)(char *))func1; (*function)(teststr); - abts_str_equal(tc, "Hello - I'm a DSO!\n", teststr); + ABTS_STR_EQUAL(tc, "Hello - I'm a DSO!\n", teststr); apr_dso_unload(h); } @@ -93,16 +93,16 @@ static void test_dso_sym_return_value(abts_case *tc, void *data) char errstr[256]; status = apr_dso_load(&h, modname, p); - abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - abts_ptr_notnull(tc, h); + ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + ABTS_PTR_NOTNULL(tc, h); status = apr_dso_sym(&func1, h, "count_reps"); - abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - abts_ptr_notnull(tc, func1); + ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + ABTS_PTR_NOTNULL(tc, func1); function = (int (*)(int))func1; status = (*function)(5); - abts_int_equal(tc, 5, status); + ABTS_INT_EQUAL(tc, 5, status); apr_dso_unload(h); } @@ -115,14 +115,14 @@ static void test_unload_module(abts_case *tc, void *data) apr_dso_handle_sym_t func1 = NULL; status = apr_dso_load(&h, modname, p); - abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - abts_ptr_notnull(tc, h); + ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + ABTS_PTR_NOTNULL(tc, h); status = apr_dso_unload(h); - abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); status = apr_dso_sym(&func1, h, "print_hello"); - abts_int_equal(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status)); } @@ -136,8 +136,8 @@ static void test_load_library(abts_case *tc, void *data) char errstr[256]; status = apr_dso_load(&h, libname, p); - abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - abts_ptr_notnull(tc, h); + ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + ABTS_PTR_NOTNULL(tc, h); apr_dso_unload(h); } @@ -152,16 +152,16 @@ static void test_dso_sym_library(abts_case *tc, void *data) char errstr[256]; status = apr_dso_load(&h, libname, p); - abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - abts_ptr_notnull(tc, h); + ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + ABTS_PTR_NOTNULL(tc, h); status = apr_dso_sym(&func1, h, "print_hello"); - abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - abts_ptr_notnull(tc, func1); + ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + ABTS_PTR_NOTNULL(tc, func1); function = (void (*)(char *))func1; (*function)(teststr); - abts_str_equal(tc, "Hello - I'm a DSO!\n", teststr); + ABTS_STR_EQUAL(tc, "Hello - I'm a DSO!\n", teststr); apr_dso_unload(h); } @@ -175,16 +175,16 @@ static void test_dso_sym_return_value_library(abts_case *tc, void *data) char errstr[256]; status = apr_dso_load(&h, libname, p); - abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - abts_ptr_notnull(tc, h); + ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + ABTS_PTR_NOTNULL(tc, h); status = apr_dso_sym(&func1, h, "count_reps"); - abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - abts_ptr_notnull(tc, func1); + ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + ABTS_PTR_NOTNULL(tc, func1); function = (int (*)(int))func1; status = (*function)(5); - abts_int_equal(tc, 5, status); + ABTS_INT_EQUAL(tc, 5, status); apr_dso_unload(h); } @@ -197,14 +197,14 @@ static void test_unload_library(abts_case *tc, void *data) apr_dso_handle_sym_t func1 = NULL; status = apr_dso_load(&h, libname, p); - abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); - abts_ptr_notnull(tc, h); + ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + ABTS_PTR_NOTNULL(tc, h); status = apr_dso_unload(h); - abts_assert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); status = apr_dso_sym(&func1, h, "print_hello"); - abts_int_equal(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status)); } #endif /* def(LIB_NAME) */ @@ -216,8 +216,8 @@ static void test_load_notthere(abts_case *tc, void *data) status = apr_dso_load(&h, "No_File.so", p); - abts_int_equal(tc, 1, APR_STATUS_IS_EDSOOPEN(status)); - abts_ptr_notnull(tc, h); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EDSOOPEN(status)); + ABTS_PTR_NOTNULL(tc, h); } #endif /* APR_HAS_DSO */ diff --git a/test/testdup.c b/test/testdup.c index acf830ce4f9..7f4409ea46f 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -35,21 +35,21 @@ static void test_file_dup(abts_case *tc, void *data) rv = apr_file_open(&file1, FILEPATH "testdup.file", APR_READ | APR_WRITE | APR_CREATE | APR_DELONCLOSE, APR_OS_DEFAULT, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, file1); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, file1); rv = apr_file_dup(&file3, file1, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, file3); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, file3); rv = apr_file_close(file1); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* cleanup after ourselves */ rv = apr_file_close(file3); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, FILEPATH "testdup.file", APR_FINFO_NORM, p); - abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_file_readwrite(abts_case *tc, void *data) @@ -66,35 +66,35 @@ static void test_file_readwrite(abts_case *tc, void *data) rv = apr_file_open(&file1, FILEPATH "testdup.readwrite.file", APR_READ | APR_WRITE | APR_CREATE | APR_DELONCLOSE, APR_OS_DEFAULT, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, file1); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, file1); rv = apr_file_dup(&file3, file1, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, file3); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, file3); rv = apr_file_write(file3, TEST, &txtlen); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, sizeof(TEST), txtlen); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, sizeof(TEST), txtlen); fpos = 0; rv = apr_file_seek(file1, APR_SET, &fpos); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 0, fpos); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 0, fpos); txtlen = 50; rv = apr_file_read(file1, buff, &txtlen); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, TEST, buff); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, TEST, buff); /* cleanup after ourselves */ rv = apr_file_close(file1); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_close(file3); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, FILEPATH "testdup.readwrite.file", APR_FINFO_NORM, p); - abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_dup2(abts_case *tc, void *data) @@ -107,26 +107,26 @@ static void test_dup2(abts_case *tc, void *data) rv = apr_file_open(&testfile, FILEPATH "testdup2.file", APR_READ | APR_WRITE | APR_CREATE | APR_DELONCLOSE, APR_OS_DEFAULT, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, testfile); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, testfile); rv = apr_file_open_stderr(&errfile, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* Set aside the real errfile */ rv = apr_file_dup(&saveerr, errfile, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, saveerr); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, saveerr); rv = apr_file_dup2(errfile, testfile, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, errfile); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, errfile); apr_file_close(testfile); rv = apr_file_dup2(errfile, saveerr, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, errfile); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, errfile); } static void test_dup2_readwrite(abts_case *tc, void *data) @@ -142,41 +142,41 @@ static void test_dup2_readwrite(abts_case *tc, void *data) rv = apr_file_open(&testfile, FILEPATH "testdup2.readwrite.file", APR_READ | APR_WRITE | APR_CREATE | APR_DELONCLOSE, APR_OS_DEFAULT, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, testfile); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, testfile); rv = apr_file_open_stderr(&errfile, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* Set aside the real errfile */ rv = apr_file_dup(&saveerr, errfile, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, saveerr); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, saveerr); rv = apr_file_dup2(errfile, testfile, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, errfile); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, errfile); txtlen = sizeof(TEST2); rv = apr_file_write(errfile, TEST2, &txtlen); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, sizeof(TEST2), txtlen); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, sizeof(TEST2), txtlen); fpos = 0; rv = apr_file_seek(testfile, APR_SET, &fpos); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 0, fpos); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 0, fpos); txtlen = 50; rv = apr_file_read(testfile, buff, &txtlen); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, TEST2, buff); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, TEST2, buff); apr_file_close(testfile); rv = apr_file_dup2(errfile, saveerr, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, errfile); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, errfile); } abts_suite *testdup(abts_suite *suite) diff --git a/test/testenv.c b/test/testenv.c index 348a4987cad..6a134d3536d 100644 --- a/test/testenv.c +++ b/test/testenv.c @@ -30,7 +30,7 @@ static void test_setenv(abts_case *tc, void *data) rv = apr_env_set(TEST_ENVVAR_NAME, TEST_ENVVAR_VALUE, p); have_env_set = (rv != APR_ENOTIMPL); if (!have_env_set) { - abts_not_impl(tc, "apr_env_set"); + ABTS_NOT_IMPL(tc, "apr_env_set"); } apr_assert_success(tc, "set environment variable", rv); } @@ -41,16 +41,16 @@ static void test_getenv(abts_case *tc, void *data) apr_status_t rv; if (!have_env_set) { - abts_not_impl(tc, "apr_env_set (skip test for apr_env_get)"); + ABTS_NOT_IMPL(tc, "apr_env_set (skip test for apr_env_get)"); } rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); have_env_get = (rv != APR_ENOTIMPL); if (!have_env_get) { - abts_not_impl(tc, "apr_env_get"); + ABTS_NOT_IMPL(tc, "apr_env_get"); } apr_assert_success(tc, "get environment variable", rv); - abts_str_equal(tc, TEST_ENVVAR_VALUE, value); + ABTS_STR_EQUAL(tc, TEST_ENVVAR_VALUE, value); } static void test_delenv(abts_case *tc, void *data) @@ -59,20 +59,20 @@ static void test_delenv(abts_case *tc, void *data) apr_status_t rv; if (!have_env_set) { - abts_not_impl(tc, "apr_env_set (skip test for apr_env_delete)"); + ABTS_NOT_IMPL(tc, "apr_env_set (skip test for apr_env_delete)"); } rv = apr_env_delete(TEST_ENVVAR_NAME, p); if (rv == APR_ENOTIMPL) { - abts_not_impl(tc, "apr_env_delete"); + ABTS_NOT_IMPL(tc, "apr_env_delete"); } apr_assert_success(tc, "delete environment variable", rv); if (!have_env_get) { - abts_not_impl(tc, "apr_env_get (skip sanity check for apr_env_delete)"); + ABTS_NOT_IMPL(tc, "apr_env_get (skip sanity check for apr_env_delete)"); } rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); - abts_int_equal(tc, APR_ENOENT, rv); + ABTS_INT_EQUAL(tc, APR_ENOENT, rv); } abts_suite *testenv(abts_suite *suite) diff --git a/test/testfile.c b/test/testfile.c index 357b4a67405..55814bd4c11 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -39,9 +39,9 @@ static void test_open_noreadwrite(abts_case *tc, void *data) rv = apr_file_open(&thefile, FILENAME, APR_CREATE | APR_EXCL, APR_UREAD | APR_UWRITE | APR_GREAD, p); - abts_true(tc, rv != APR_SUCCESS); - abts_int_equal(tc, 1, APR_STATUS_IS_EACCES(rv)); - abts_ptr_equal(tc, NULL, thefile); + ABTS_TRUE(tc, rv != APR_SUCCESS); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EACCES(rv)); + ABTS_PTR_EQUAL(tc, NULL, thefile); } static void test_open_excl(abts_case *tc, void *data) @@ -52,9 +52,9 @@ static void test_open_excl(abts_case *tc, void *data) rv = apr_file_open(&thefile, FILENAME, APR_CREATE | APR_EXCL | APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - abts_true(tc, rv != APR_SUCCESS); - abts_int_equal(tc, 1, APR_STATUS_IS_EEXIST(rv)); - abts_ptr_equal(tc, NULL, thefile); + ABTS_TRUE(tc, rv != APR_SUCCESS); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EEXIST(rv)); + ABTS_PTR_EQUAL(tc, NULL, thefile); } static void test_open_read(abts_case *tc, void *data) @@ -65,8 +65,8 @@ static void test_open_read(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, filetest); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, filetest); apr_file_close(filetest); } @@ -83,9 +83,9 @@ static void test_read(abts_case *tc, void *data) apr_assert_success(tc, "Opening test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, strlen(TESTSTR), nbytes); - abts_str_equal(tc, TESTSTR, str); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, strlen(TESTSTR), nbytes); + ABTS_STR_EQUAL(tc, TESTSTR, str); apr_file_close(filetest); } @@ -102,8 +102,8 @@ static void test_filename(abts_case *tc, void *data) apr_assert_success(tc, "Opening test file " FILENAME, rv); rv = apr_file_name_get(&str, filetest); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, FILENAME, str); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, FILENAME, str); apr_file_close(filetest); } @@ -121,10 +121,10 @@ static void test_fileclose(abts_case *tc, void *data) apr_assert_success(tc, "Opening test file " FILENAME, rv); rv = apr_file_close(filetest); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* We just closed the file, so this should fail */ rv = apr_file_read(filetest, &str, &one); - abts_int_equal(tc, 1, APR_STATUS_IS_EBADF(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EBADF(rv)); } static void test_file_remove(abts_case *tc, void *data) @@ -133,11 +133,11 @@ static void test_file_remove(abts_case *tc, void *data) apr_file_t *filetest = NULL; rv = apr_file_remove(FILENAME, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); - abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_open_write(abts_case *tc, void *data) @@ -149,8 +149,8 @@ static void test_open_write(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - abts_int_equal(tc, 1, APR_STATUS_IS_ENOENT(rv)); - abts_ptr_equal(tc, NULL, filetest); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); + ABTS_PTR_EQUAL(tc, NULL, filetest); } static void test_open_writecreate(abts_case *tc, void *data) @@ -162,7 +162,7 @@ static void test_open_writecreate(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); apr_file_close(filetest); } @@ -176,10 +176,10 @@ static void test_write(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_write(filetest, TESTSTR, &bytes); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); apr_file_close(filetest); } @@ -193,8 +193,8 @@ static void test_open_readwrite(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_READ | APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, filetest); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, filetest); apr_file_close(filetest); } @@ -213,19 +213,19 @@ static void test_seek(abts_case *tc, void *data) apr_assert_success(tc, "Open test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, strlen(TESTSTR), nbytes); - abts_str_equal(tc, TESTSTR, str); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, strlen(TESTSTR), nbytes); + ABTS_STR_EQUAL(tc, TESTSTR, str); memset(str, 0, nbytes + 1); rv = apr_file_seek(filetest, SEEK_SET, &offset); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_read(filetest, str, &nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, strlen(TESTSTR) - 5, nbytes); - abts_str_equal(tc, TESTSTR + 5, str); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, strlen(TESTSTR) - 5, nbytes); + ABTS_STR_EQUAL(tc, TESTSTR + 5, str); apr_file_close(filetest); @@ -238,15 +238,15 @@ static void test_seek(abts_case *tc, void *data) offset = -5; rv = apr_file_seek(filetest, SEEK_END, &offset); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, strlen(TESTSTR) - 5, nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, strlen(TESTSTR) - 5, nbytes); memset(str, 0, nbytes + 1); nbytes = 256; rv = apr_file_read(filetest, str, &nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 5, nbytes); - abts_str_equal(tc, TESTSTR + strlen(TESTSTR) - 5, str); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 5, nbytes); + ABTS_STR_EQUAL(tc, TESTSTR + strlen(TESTSTR) - 5, str); apr_file_close(filetest); } @@ -259,11 +259,11 @@ static void test_userdata_set(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_data_set(filetest, "This is a test", "test", apr_pool_cleanup_null); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); apr_file_close(filetest); } @@ -276,15 +276,15 @@ static void test_userdata_get(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_data_set(filetest, "This is a test", "test", apr_pool_cleanup_null); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_data_get((void **)&teststr, "test", filetest); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, "This is a test", teststr); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, "This is a test", teststr); apr_file_close(filetest); } @@ -298,11 +298,11 @@ static void test_userdata_getnokey(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_data_get((void **)&teststr, "nokey", filetest); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_equal(tc, NULL, teststr); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_EQUAL(tc, NULL, teststr); apr_file_close(filetest); } @@ -313,11 +313,11 @@ static void test_getc(abts_case *tc, void *data) char ch; rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); apr_file_getc(&ch, f); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, (int)TESTSTR[0], (int)ch); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, (int)TESTSTR[0], (int)ch); apr_file_close(f); } @@ -328,18 +328,18 @@ static void test_ungetc(abts_case *tc, void *data) char ch; rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); apr_file_getc(&ch, f); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, (int)TESTSTR[0], (int)ch); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, (int)TESTSTR[0], (int)ch); apr_file_ungetc('X', f); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); apr_file_getc(&ch, f); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 'X', (int)ch); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 'X', (int)ch); apr_file_close(f); } @@ -351,18 +351,18 @@ static void test_gets(abts_case *tc, void *data) char *str = apr_palloc(p, 256); rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_gets(str, 256, f); /* Only one line in the test file, so APR will encounter EOF on the first * call to gets, but we should get APR_SUCCESS on this call and * APR_EOF on the next. */ - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, TESTSTR, str); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, TESTSTR, str); rv = apr_file_gets(str, 256, f); - abts_int_equal(tc, APR_EOF, rv); - abts_str_equal(tc, "", str); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", str); apr_file_close(f); } @@ -378,32 +378,32 @@ static void test_bigread(abts_case *tc, void *data) rv = apr_file_open(&f, "data/created_file", APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); nbytes = APR_BUFFERSIZE; memset(buf, 0xFE, nbytes); rv = apr_file_write(f, buf, &nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, APR_BUFFERSIZE, nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_BUFFERSIZE, nbytes); rv = apr_file_close(f); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); f = NULL; rv = apr_file_open(&f, "data/created_file", APR_READ, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); nbytes = sizeof buf; rv = apr_file_read(f, buf, &nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, APR_BUFFERSIZE, nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_BUFFERSIZE, nbytes); rv = apr_file_close(f); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_remove("data/created_file", p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } /* This is a horrible name for this function. We are testing APR, not how @@ -422,70 +422,70 @@ static void test_mod_neg(abts_case *tc, void *data) rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); s = "body56789\n"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, strlen(s), nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, strlen(s), nbytes); for (i = 0; i < 7980; i++) { s = "0"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, strlen(s), nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, strlen(s), nbytes); } s = "end456789\n"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, strlen(s), nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, strlen(s), nbytes); for (i = 0; i < 10000; i++) { s = "1"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, strlen(s), nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, strlen(s), nbytes); } rv = apr_file_close(f); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_open(&f, fname, APR_READ, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_gets(buf, 11, f); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, "body56789\n", buf); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, "body56789\n", buf); cur = 0; rv = apr_file_seek(f, APR_CUR, &cur); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 10, cur); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 10, cur); nbytes = sizeof(buf); rv = apr_file_read(f, buf, &nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, nbytes, sizeof(buf)); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, nbytes, sizeof(buf)); cur = -((apr_off_t)nbytes - 7980); rv = apr_file_seek(f, APR_CUR, &cur); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 7990, cur); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 7990, cur); rv = apr_file_gets(buf, 11, f); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, "end456789\n", buf); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, "end456789\n", buf); rv = apr_file_close(f); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_remove(fname, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void test_truncate(abts_case *tc, void *data) @@ -501,30 +501,30 @@ static void test_truncate(abts_case *tc, void *data) rv = apr_file_open(&f, fname, APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); s = "some data"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, strlen(s), nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, strlen(s), nbytes); rv = apr_file_close(f); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_open(&f, fname, APR_TRUNCATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_close(f); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, fname, APR_FINFO_SIZE, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 0, finfo.size); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 0, finfo.size); rv = apr_file_remove(fname, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } abts_suite *testfile(abts_suite *suite) diff --git a/test/testfilecopy.c b/test/testfilecopy.c index e63c9daa4b8..7db0b208221 100644 --- a/test/testfilecopy.c +++ b/test/testfilecopy.c @@ -45,10 +45,10 @@ static void copy_helper(abts_case *tc, const char *from, const char * to, apr_assert_success(tc, "Couldn't stat copy file", rv); if (!append) { - abts_int_equal(tc, orig.size, copy.size); + ABTS_INT_EQUAL(tc, orig.size, copy.size); } else { - abts_int_equal(tc, + ABTS_INT_EQUAL(tc, ((dest_rv == APR_SUCCESS) ? dest.size : 0) + orig.size, copy.size); } diff --git a/test/testfileinfo.c b/test/testfileinfo.c index bf0ce682e81..2166d31fe76 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -50,55 +50,55 @@ static const struct view_fileinfo static void finfo_equal(abts_case *tc, apr_finfo_t *f1, apr_finfo_t *f2) { /* Minimum supported flags across all platforms (APR_FINFO_MIN) */ - abts_assert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_TYPE", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_TYPE", (f1->valid & f2->valid & APR_FINFO_TYPE)); - abts_assert(tc, "apr_stat and apr_getfileinfo differ in filetype", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in filetype", f1->filetype == f2->filetype); - abts_assert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_SIZE", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_SIZE", (f1->valid & f2->valid & APR_FINFO_SIZE)); - abts_assert(tc, "apr_stat and apr_getfileinfo differ in size", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in size", f1->size == f2->size); - abts_assert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_ATIME", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_ATIME", (f1->valid & f2->valid & APR_FINFO_ATIME)); - abts_assert(tc, "apr_stat and apr_getfileinfo differ in atime", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in atime", f1->atime == f2->atime); - abts_assert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_MTIME", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_MTIME", (f1->valid & f2->valid & APR_FINFO_MTIME)); - abts_assert(tc, "apr_stat and apr_getfileinfo differ in mtime", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in mtime", f1->mtime == f2->mtime); - abts_assert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_CTIME", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_CTIME", (f1->valid & f2->valid & APR_FINFO_CTIME)); - abts_assert(tc, "apr_stat and apr_getfileinfo differ in ctime", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in ctime", f1->ctime == f2->ctime); if (f1->valid & f2->valid & APR_FINFO_NAME) - abts_assert(tc, "apr_stat and apr_getfileinfo differ in name", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in name", !strcmp(f1->name, f2->name)); if (f1->fname && f2->fname) - abts_assert(tc, "apr_stat and apr_getfileinfo differ in fname", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in fname", !strcmp(f1->fname, f2->fname)); /* Additional supported flags not supported on all platforms */ if (f1->valid & f2->valid & APR_FINFO_USER) - abts_assert(tc, "apr_stat and apr_getfileinfo differ in user", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in user", !apr_uid_compare(f1->user, f2->user)); if (f1->valid & f2->valid & APR_FINFO_GROUP) - abts_assert(tc, "apr_stat and apr_getfileinfo differ in group", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in group", !apr_gid_compare(f1->group, f2->group)); if (f1->valid & f2->valid & APR_FINFO_INODE) - abts_assert(tc, "apr_stat and apr_getfileinfo differ in inode", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in inode", f1->inode == f2->inode); if (f1->valid & f2->valid & APR_FINFO_DEV) - abts_assert(tc, "apr_stat and apr_getfileinfo differ in device", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in device", f1->device == f2->device); if (f1->valid & f2->valid & APR_FINFO_NLINK) - abts_assert(tc, "apr_stat and apr_getfileinfo differ in nlink", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in nlink", f1->nlink == f2->nlink); if (f1->valid & f2->valid & APR_FINFO_CSIZE) - abts_assert(tc, "apr_stat and apr_getfileinfo differ in csize", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in csize", f1->csize == f2->csize); if (f1->valid & f2->valid & APR_FINFO_PROT) - abts_assert(tc, "apr_stat and apr_getfileinfo differ in protection", + ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in protection", f1->protection == f2->protection); } @@ -109,7 +109,7 @@ static void test_info_get(abts_case *tc, void *data) apr_status_t rv; rv = apr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); if (rv == APR_INCOMPLETE) { @@ -121,9 +121,9 @@ static void test_info_get(abts_case *tc, void *data) str = apr_pstrcat(p, str, vfi[i].description, " ", NULL); } } - abts_fail(tc, str); + ABTS_FAIL(tc, str); } - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); apr_file_close(thefile); } @@ -142,9 +142,9 @@ static void test_stat(abts_case *tc, void *data) str = apr_pstrcat(p, str, vfi[i].description, " ", NULL); } } - abts_fail(tc, str); + ABTS_FAIL(tc, str); } - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void test_stat_eq_finfo(abts_case *tc, void *data) @@ -155,7 +155,7 @@ static void test_stat_eq_finfo(abts_case *tc, void *data) apr_status_t rv; rv = apr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); /* Opening the file may have toggled the atime member (time last @@ -163,7 +163,7 @@ static void test_stat_eq_finfo(abts_case *tc, void *data) * of the open file... */ rv = apr_stat(&stat_finfo, FILENAME, APR_FINFO_NORM, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); apr_file_close(thefile); @@ -192,11 +192,11 @@ static void test_buffered_write_size(abts_case *tc, void *data) bytes = data_len; rv = apr_file_write(thefile, NEWFILEDATA, &bytes); apr_assert_success(tc, "write file contents", rv); - abts_true(tc, data_len == bytes); + ABTS_TRUE(tc, data_len == bytes); rv = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); apr_assert_success(tc, "get file size", rv); - abts_true(tc, bytes == (apr_size_t) finfo.size); + ABTS_TRUE(tc, bytes == (apr_size_t) finfo.size); apr_file_close(thefile); } @@ -228,10 +228,10 @@ static void test_mtime_set(abts_case *tc, void *data) str = apr_pstrcat(p, str, vfi[i].description, " ", NULL); } } - abts_fail(tc, str); + ABTS_FAIL(tc, str); } apr_assert_success(tc, "get initial mtime", rv); - abts_true(tc, finfo.mtime != epoch); + ABTS_TRUE(tc, finfo.mtime != epoch); /* Reset the mtime to the epoch and verify the result. * Note: we blindly assume that if the first apr_stat succeeded, @@ -242,7 +242,7 @@ static void test_mtime_set(abts_case *tc, void *data) rv = apr_stat(&finfo, NEWFILENAME, APR_FINFO_MTIME, p); apr_assert_success(tc, "get modified mtime", rv); - abts_true(tc, finfo.mtime == epoch); + ABTS_TRUE(tc, finfo.mtime == epoch); apr_file_close(thefile); } diff --git a/test/testflock.c b/test/testflock.c index d13c55e32b4..91e3ff51c98 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -46,10 +46,10 @@ static int launch_reader(abts_case *tc) rv = apr_proc_create(&proc, "./tryread" EXTENSION, args, NULL, procattr, p); apr_assert_success(tc, "Couldn't launch program", rv); - abts_assert(tc, "wait for child process", + ABTS_ASSERT(tc, "wait for child process", apr_proc_wait(&proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); - abts_assert(tc, "child terminated normally", why == APR_PROC_EXIT); + ABTS_ASSERT(tc, "child terminated normally", why == APR_PROC_EXIT); return exitcode; } @@ -62,14 +62,14 @@ static void test_withlock(abts_case *tc, void *data) rv = apr_file_open(&file, TESTFILE, APR_WRITE|APR_CREATE, APR_OS_DEFAULT, p); apr_assert_success(tc, "Could not create file.", rv); - abts_ptr_notnull(tc, file); + ABTS_PTR_NOTNULL(tc, file); rv = apr_file_lock(file, APR_FLOCK_EXCLUSIVE); apr_assert_success(tc, "Could not lock the file.", rv); - abts_ptr_notnull(tc, file); + ABTS_PTR_NOTNULL(tc, file); code = launch_reader(tc); - abts_int_equal(tc, FAILED_READ, code); + ABTS_INT_EQUAL(tc, FAILED_READ, code); (void) apr_file_close(file); } @@ -79,7 +79,7 @@ static void test_withoutlock(abts_case *tc, void *data) int code; code = launch_reader(tc); - abts_int_equal(tc, SUCCESSFUL_READ, code); + ABTS_INT_EQUAL(tc, SUCCESSFUL_READ, code); } static void remove_lockfile(abts_case *tc, void *data) diff --git a/test/testfmt.c b/test/testfmt.c index 2e1e38ca2ad..9d40a1c0324 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -24,9 +24,9 @@ static void ssize_t_fmt(abts_case *tc, void *data) apr_ssize_t var = 0; sprintf(buf, "%" APR_SSIZE_T_FMT, var); - abts_str_equal(tc, "0", buf); + ABTS_STR_EQUAL(tc, "0", buf); apr_snprintf(buf, sizeof(buf), "%" APR_SSIZE_T_FMT, var); - abts_str_equal(tc, "0", buf); + ABTS_STR_EQUAL(tc, "0", buf); } static void size_t_fmt(abts_case *tc, void *data) @@ -35,9 +35,9 @@ static void size_t_fmt(abts_case *tc, void *data) apr_size_t var = 0; sprintf(buf, "%" APR_SIZE_T_FMT, var); - abts_str_equal(tc, "0", buf); + ABTS_STR_EQUAL(tc, "0", buf); apr_snprintf(buf, sizeof(buf), "%" APR_SIZE_T_FMT, var); - abts_str_equal(tc, "0", buf); + ABTS_STR_EQUAL(tc, "0", buf); } static void off_t_fmt(abts_case *tc, void *data) @@ -46,9 +46,9 @@ static void off_t_fmt(abts_case *tc, void *data) apr_off_t var = 0; sprintf(buf, "%" APR_OFF_T_FMT, var); - abts_str_equal(tc, "0", buf); + ABTS_STR_EQUAL(tc, "0", buf); apr_snprintf(buf, sizeof(buf), "%" APR_OFF_T_FMT, var); - abts_str_equal(tc, "0", buf); + ABTS_STR_EQUAL(tc, "0", buf); } static void pid_t_fmt(abts_case *tc, void *data) @@ -57,9 +57,9 @@ static void pid_t_fmt(abts_case *tc, void *data) pid_t var = 0; sprintf(buf, "%" APR_PID_T_FMT, var); - abts_str_equal(tc, "0", buf); + ABTS_STR_EQUAL(tc, "0", buf); apr_snprintf(buf, sizeof(buf), "%" APR_PID_T_FMT, var); - abts_str_equal(tc, "0", buf); + ABTS_STR_EQUAL(tc, "0", buf); } static void int64_t_fmt(abts_case *tc, void *data) @@ -68,9 +68,9 @@ static void int64_t_fmt(abts_case *tc, void *data) apr_int64_t var = 0; sprintf(buf, "%" APR_INT64_T_FMT, var); - abts_str_equal(tc, "0", buf); + ABTS_STR_EQUAL(tc, "0", buf); apr_snprintf(buf, sizeof(buf), "%" APR_INT64_T_FMT, var); - abts_str_equal(tc, "0", buf); + ABTS_STR_EQUAL(tc, "0", buf); } static void uint64_t_fmt(abts_case *tc, void *data) @@ -79,9 +79,9 @@ static void uint64_t_fmt(abts_case *tc, void *data) apr_uint64_t var = APR_UINT64_C(14000000); sprintf(buf, "%" APR_UINT64_T_FMT, var); - abts_str_equal(tc, "14000000", buf); + ABTS_STR_EQUAL(tc, "14000000", buf); apr_snprintf(buf, sizeof(buf), "%" APR_UINT64_T_FMT, var); - abts_str_equal(tc, "14000000", buf); + ABTS_STR_EQUAL(tc, "14000000", buf); } static void uint64_t_hex_fmt(abts_case *tc, void *data) @@ -90,9 +90,9 @@ static void uint64_t_hex_fmt(abts_case *tc, void *data) apr_uint64_t var = APR_UINT64_C(14000000); sprintf(buf, "%" APR_UINT64_T_HEX_FMT, var); - abts_str_equal(tc, "d59f80", buf); + ABTS_STR_EQUAL(tc, "d59f80", buf); apr_snprintf(buf, sizeof(buf), "%" APR_UINT64_T_HEX_FMT, var); - abts_str_equal(tc, "d59f80", buf); + ABTS_STR_EQUAL(tc, "d59f80", buf); } static void more_int64_fmts(abts_case *tc, void *data) @@ -104,16 +104,16 @@ static void more_int64_fmts(abts_case *tc, void *data) apr_uint64_t big = APR_UINT64_C(3141592653589793238); apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, i); - abts_str_equal(tc, buf, "-42"); + ABTS_STR_EQUAL(tc, buf, "-42"); apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, ui); - abts_str_equal(tc, buf, "42"); + ABTS_STR_EQUAL(tc, buf, "42"); apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, big); - abts_str_equal(tc, buf, "3141592653589793238"); + ABTS_STR_EQUAL(tc, buf, "3141592653589793238"); apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, ibig); - abts_str_equal(tc, buf, "-314159265358979323"); + ABTS_STR_EQUAL(tc, buf, "-314159265358979323"); } abts_suite *testfmt(abts_suite *suite) diff --git a/test/testfnmatch.c b/test/testfnmatch.c index ac5c5347fa8..1442fff96f1 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -25,16 +25,16 @@ static void test_glob(abts_case *tc, void *data) apr_array_header_t *result; apr_status_t rv = apr_match_glob("data\\*.txt", &result, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* XXX If we ever add a file that matches *.txt to data, then we need * to increase this. */ - abts_int_equal(tc, 2, result->nelts); + ABTS_INT_EQUAL(tc, 2, result->nelts); list = (char **)result->elts; for (i = 0; i < result->nelts; i++) { char *dot = strrchr(list[i], '.'); - abts_str_equal(tc, dot, ".txt"); + ABTS_STR_EQUAL(tc, dot, ".txt"); } } @@ -47,16 +47,16 @@ static void test_glob_currdir(abts_case *tc, void *data) apr_filepath_set("data", p); rv = apr_match_glob("*.txt", &result, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* XXX If we ever add a file that matches *.txt to data, then we need * to increase this. */ - abts_int_equal(tc, 2, result->nelts); + ABTS_INT_EQUAL(tc, 2, result->nelts); list = (char **)result->elts; for (i = 0; i < result->nelts; i++) { char *dot = strrchr(list[i], '.'); - abts_str_equal(tc, dot, ".txt"); + ABTS_STR_EQUAL(tc, dot, ".txt"); } apr_filepath_set("..", p); } diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index 7a2d345e6cd..718e729531e 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -47,10 +47,10 @@ static int wait_child(abts_case *tc, apr_proc_t *proc) int exitcode; apr_exit_why_e why; - abts_assert(tc, "Error waiting for child process", + ABTS_ASSERT(tc, "Error waiting for child process", apr_proc_wait(proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); - abts_assert(tc, "child didn't terminate normally", why == APR_PROC_EXIT); + ABTS_ASSERT(tc, "child didn't terminate normally", why == APR_PROC_EXIT); return exitcode; } @@ -75,7 +75,7 @@ static void test_exclusive(abts_case *tc, void *data) x += wait_child(tc, &p3); x += wait_child(tc, &p4); - abts_int_equal(tc, MAX_COUNTER, x); + ABTS_INT_EQUAL(tc, MAX_COUNTER, x); } abts_suite *testglobalmutex(abts_suite *suite) diff --git a/test/testhash.c b/test/testhash.c index c7243c064b3..61e9f26157c 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -61,7 +61,7 @@ static void hash_make(abts_case *tc, void *data) apr_hash_t *h = NULL; h = apr_hash_make(p); - abts_ptr_notnull(tc, h); + ABTS_PTR_NOTNULL(tc, h); } static void hash_set(abts_case *tc, void *data) @@ -70,11 +70,11 @@ static void hash_set(abts_case *tc, void *data) char *result = NULL; h = apr_hash_make(p); - abts_ptr_notnull(tc, h); + ABTS_PTR_NOTNULL(tc, h); apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); - abts_str_equal(tc, "value", result); + ABTS_STR_EQUAL(tc, "value", result); } static void hash_reset(abts_case *tc, void *data) @@ -83,15 +83,15 @@ static void hash_reset(abts_case *tc, void *data) char *result = NULL; h = apr_hash_make(p); - abts_ptr_notnull(tc, h); + ABTS_PTR_NOTNULL(tc, h); apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); - abts_str_equal(tc, "value", result); + ABTS_STR_EQUAL(tc, "value", result); apr_hash_set(h, "key", APR_HASH_KEY_STRING, "new"); result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); - abts_str_equal(tc, "new", result); + ABTS_STR_EQUAL(tc, "new", result); } static void same_value(abts_case *tc, void *data) @@ -100,15 +100,15 @@ static void same_value(abts_case *tc, void *data) char *result = NULL; h = apr_hash_make(p); - abts_ptr_notnull(tc, h); + ABTS_PTR_NOTNULL(tc, h); apr_hash_set(h, "same1", APR_HASH_KEY_STRING, "same"); result = apr_hash_get(h, "same1", APR_HASH_KEY_STRING); - abts_str_equal(tc, "same", result); + ABTS_STR_EQUAL(tc, "same", result); apr_hash_set(h, "same2", APR_HASH_KEY_STRING, "same"); result = apr_hash_get(h, "same2", APR_HASH_KEY_STRING); - abts_str_equal(tc, "same", result); + ABTS_STR_EQUAL(tc, "same", result); } static unsigned int hash_custom( const char *key, apr_ssize_t *klen) @@ -127,15 +127,15 @@ static void same_value_custom(abts_case *tc, void *data) char *result = NULL; h = apr_hash_make_custom(p, hash_custom); - abts_ptr_notnull(tc, h); + ABTS_PTR_NOTNULL(tc, h); apr_hash_set(h, "same1", 5, "same"); result = apr_hash_get(h, "same1", 5); - abts_str_equal(tc, "same", result); + ABTS_STR_EQUAL(tc, "same", result); apr_hash_set(h, "same2", 5, "same"); result = apr_hash_get(h, "same2", 5); - abts_str_equal(tc, "same", result); + ABTS_STR_EQUAL(tc, "same", result); } static void key_space(abts_case *tc, void *data) @@ -144,11 +144,11 @@ static void key_space(abts_case *tc, void *data) char *result = NULL; h = apr_hash_make(p); - abts_ptr_notnull(tc, h); + ABTS_PTR_NOTNULL(tc, h); apr_hash_set(h, "key with space", APR_HASH_KEY_STRING, "value"); result = apr_hash_get(h, "key with space", APR_HASH_KEY_STRING); - abts_str_equal(tc, "value", result); + ABTS_STR_EQUAL(tc, "value", result); } /* This is kind of a hack, but I am just keeping an existing test. This is @@ -161,7 +161,7 @@ static void hash_traverse(abts_case *tc, void *data) char str[8196]; h = apr_hash_make(p); - abts_ptr_notnull(tc, h); + ABTS_PTR_NOTNULL(tc, h); apr_hash_set(h, "OVERWRITE", APR_HASH_KEY_STRING, "should not see this"); apr_hash_set(h, "FOO3", APR_HASH_KEY_STRING, "bar3"); @@ -174,7 +174,7 @@ static void hash_traverse(abts_case *tc, void *data) apr_hash_set(h, "OVERWRITE", APR_HASH_KEY_STRING, "Overwrite key"); dump_hash(p, h, str); - abts_str_equal(tc, "Key FOO1 (4) Value bar1\n" + ABTS_STR_EQUAL(tc, "Key FOO1 (4) Value bar1\n" "Key FOO2 (4) Value bar2\n" "Key OVERWRITE (9) Value Overwrite key\n" "Key FOO3 (4) Value bar3\n" @@ -195,7 +195,7 @@ static void summation_test(abts_case *tc, void *data) int i, j, *val, *key; h =apr_hash_make(p); - abts_ptr_notnull(tc, h); + ABTS_PTR_NOTNULL(tc, h); sumKeys = 0; sumVal = 0; @@ -214,9 +214,9 @@ static void summation_test(abts_case *tc, void *data) } sum_hash(p, h, &i, &trySumKey, &trySumVal); - abts_int_equal(tc, 100, i); - abts_int_equal(tc, sumVal, trySumVal); - abts_int_equal(tc, sumKeys, trySumKey); + ABTS_INT_EQUAL(tc, 100, i); + ABTS_INT_EQUAL(tc, sumVal, trySumVal); + ABTS_INT_EQUAL(tc, sumKeys, trySumKey); } static void delete_key(abts_case *tc, void *data) @@ -225,24 +225,24 @@ static void delete_key(abts_case *tc, void *data) char *result = NULL; h = apr_hash_make(p); - abts_ptr_notnull(tc, h); + ABTS_PTR_NOTNULL(tc, h); apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); apr_hash_set(h, "key2", APR_HASH_KEY_STRING, "value2"); result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); - abts_str_equal(tc, "value", result); + ABTS_STR_EQUAL(tc, "value", result); result = apr_hash_get(h, "key2", APR_HASH_KEY_STRING); - abts_str_equal(tc, "value2", result); + ABTS_STR_EQUAL(tc, "value2", result); apr_hash_set(h, "key", APR_HASH_KEY_STRING, NULL); result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); - abts_ptr_equal(tc, NULL, result); + ABTS_PTR_EQUAL(tc, NULL, result); result = apr_hash_get(h, "key2", APR_HASH_KEY_STRING); - abts_str_equal(tc, "value2", result); + ABTS_STR_EQUAL(tc, "value2", result); } static void hash_count_0(abts_case *tc, void *data) @@ -251,10 +251,10 @@ static void hash_count_0(abts_case *tc, void *data) int count; h = apr_hash_make(p); - abts_ptr_notnull(tc, h); + ABTS_PTR_NOTNULL(tc, h); count = apr_hash_count(h); - abts_int_equal(tc, 0, count); + ABTS_INT_EQUAL(tc, 0, count); } static void hash_count_1(abts_case *tc, void *data) @@ -263,12 +263,12 @@ static void hash_count_1(abts_case *tc, void *data) int count; h = apr_hash_make(p); - abts_ptr_notnull(tc, h); + ABTS_PTR_NOTNULL(tc, h); apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); count = apr_hash_count(h); - abts_int_equal(tc, 1, count); + ABTS_INT_EQUAL(tc, 1, count); } static void hash_count_5(abts_case *tc, void *data) @@ -277,7 +277,7 @@ static void hash_count_5(abts_case *tc, void *data) int count; h = apr_hash_make(p); - abts_ptr_notnull(tc, h); + ABTS_PTR_NOTNULL(tc, h); apr_hash_set(h, "key1", APR_HASH_KEY_STRING, "value1"); apr_hash_set(h, "key2", APR_HASH_KEY_STRING, "value2"); @@ -286,7 +286,7 @@ static void hash_count_5(abts_case *tc, void *data) apr_hash_set(h, "key5", APR_HASH_KEY_STRING, "value5"); count = apr_hash_count(h); - abts_int_equal(tc, 5, count); + ABTS_INT_EQUAL(tc, 5, count); } static void overlay_empty(abts_case *tc, void *data) @@ -299,8 +299,8 @@ static void overlay_empty(abts_case *tc, void *data) base = apr_hash_make(p); overlay = apr_hash_make(p); - abts_ptr_notnull(tc, base); - abts_ptr_notnull(tc, overlay); + ABTS_PTR_NOTNULL(tc, base); + ABTS_PTR_NOTNULL(tc, overlay); apr_hash_set(base, "key1", APR_HASH_KEY_STRING, "value1"); apr_hash_set(base, "key2", APR_HASH_KEY_STRING, "value2"); @@ -311,10 +311,10 @@ static void overlay_empty(abts_case *tc, void *data) result = apr_hash_overlay(p, overlay, base); count = apr_hash_count(result); - abts_int_equal(tc, 5, count); + ABTS_INT_EQUAL(tc, 5, count); dump_hash(p, result, str); - abts_str_equal(tc, "Key key1 (4) Value value1\n" + ABTS_STR_EQUAL(tc, "Key key1 (4) Value value1\n" "Key key2 (4) Value value2\n" "Key key3 (4) Value value3\n" "Key key4 (4) Value value4\n" @@ -332,8 +332,8 @@ static void overlay_2unique(abts_case *tc, void *data) base = apr_hash_make(p); overlay = apr_hash_make(p); - abts_ptr_notnull(tc, base); - abts_ptr_notnull(tc, overlay); + ABTS_PTR_NOTNULL(tc, base); + ABTS_PTR_NOTNULL(tc, overlay); apr_hash_set(base, "base1", APR_HASH_KEY_STRING, "value1"); apr_hash_set(base, "base2", APR_HASH_KEY_STRING, "value2"); @@ -350,13 +350,13 @@ static void overlay_2unique(abts_case *tc, void *data) result = apr_hash_overlay(p, overlay, base); count = apr_hash_count(result); - abts_int_equal(tc, 10, count); + ABTS_INT_EQUAL(tc, 10, count); dump_hash(p, result, str); /* I don't know why these are out of order, but they are. I would probably * consider this a bug, but others should comment. */ - abts_str_equal(tc, "Key base5 (5) Value value5\n" + ABTS_STR_EQUAL(tc, "Key base5 (5) Value value5\n" "Key overlay1 (8) Value value1\n" "Key overlay2 (8) Value value2\n" "Key overlay3 (8) Value value3\n" @@ -377,7 +377,7 @@ static void overlay_same(abts_case *tc, void *data) char str[8196]; base = apr_hash_make(p); - abts_ptr_notnull(tc, base); + ABTS_PTR_NOTNULL(tc, base); apr_hash_set(base, "base1", APR_HASH_KEY_STRING, "value1"); apr_hash_set(base, "base2", APR_HASH_KEY_STRING, "value2"); @@ -388,13 +388,13 @@ static void overlay_same(abts_case *tc, void *data) result = apr_hash_overlay(p, base, base); count = apr_hash_count(result); - abts_int_equal(tc, 5, count); + ABTS_INT_EQUAL(tc, 5, count); dump_hash(p, result, str); /* I don't know why these are out of order, but they are. I would probably * consider this a bug, but others should comment. */ - abts_str_equal(tc, "Key base5 (5) Value value5\n" + ABTS_STR_EQUAL(tc, "Key base5 (5) Value value5\n" "Key base1 (5) Value value1\n" "Key base2 (5) Value value2\n" "Key base3 (5) Value value3\n" diff --git a/test/testipsub.c b/test/testipsub.c index d9f8f6708a3..caf1d46cc06 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -67,7 +67,7 @@ static void test_bad_input(abts_case *tc, void *data) for (i = 0; i < (sizeof testcases / sizeof testcases[0]); i++) { rv = apr_ipsubnet_create(&ipsub, testcases[i].ipstr, testcases[i].mask, p); - abts_int_equal(tc, rv, testcases[i].expected_rv); + ABTS_INT_EQUAL(tc, rv, testcases[i].expected_rv); } } @@ -85,16 +85,16 @@ static void test_singleton_subnets(abts_case *tc, void *data) for (i = 0; i < sizeof v4addrs / sizeof v4addrs[0]; i++) { rv = apr_ipsubnet_create(&ipsub, v4addrs[i], NULL, p); - abts_true(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, rv == APR_SUCCESS); for (j = 0; j < sizeof v4addrs / sizeof v4addrs[0]; j++) { rv = apr_sockaddr_info_get(&sa, v4addrs[j], APR_INET, 0, 0, p); - abts_true(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, rv == APR_SUCCESS); rc = apr_ipsubnet_test(ipsub, sa); if (!strcmp(v4addrs[i], v4addrs[j])) { - abts_true(tc, rc != 0); + ABTS_TRUE(tc, rc != 0); } else { - abts_true(tc, rc == 0); + ABTS_TRUE(tc, rc == 0); } } } @@ -130,15 +130,15 @@ static void test_interesting_subnets(abts_case *tc, void *data) for (i = 0; i < sizeof testcases / sizeof testcases[0]; i++) { rv = apr_ipsubnet_create(&ipsub, testcases[i].ipstr, testcases[i].mask, p); - abts_true(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, rv == APR_SUCCESS); rv = apr_sockaddr_info_get(&sa, testcases[i].in_subnet, testcases[i].family, 0, 0, p); - abts_true(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, rv == APR_SUCCESS); rc = apr_ipsubnet_test(ipsub, sa); - abts_true(tc, rc != 0); + ABTS_TRUE(tc, rc != 0); rv = apr_sockaddr_info_get(&sa, testcases[i].not_in_subnet, testcases[i].family, 0, 0, p); - abts_true(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, rv == APR_SUCCESS); rc = apr_ipsubnet_test(ipsub, sa); - abts_true(tc, rc == 0); + ABTS_TRUE(tc, rc == 0); } } @@ -146,7 +146,7 @@ static void test_badmask_str(abts_case *tc, void *data) { char buf[128]; - abts_str_equal(tc, apr_strerror(APR_EBADMASK, buf, sizeof buf), + ABTS_STR_EQUAL(tc, apr_strerror(APR_EBADMASK, buf, sizeof buf), "The specified network mask is invalid."); } @@ -154,7 +154,7 @@ static void test_badip_str(abts_case *tc, void *data) { char buf[128]; - abts_str_equal(tc, apr_strerror(APR_EBADIP, buf, sizeof buf), + ABTS_STR_EQUAL(tc, apr_strerror(APR_EBADIP, buf, sizeof buf), "The specified IP address is invalid."); } diff --git a/test/testlfs.c b/test/testlfs.c index c9992221b37..5011cd218cf 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -35,7 +35,7 @@ static apr_off_t eightGb = APR_INT64_C(2) << 32; static int madefile = 0; -#define PRECOND if (!madefile) abts_not_impl(tc, "Large file tests not enabled") +#define PRECOND if (!madefile) ABTS_NOT_IMPL(tc, "Large file tests not enabled") #define TESTDIR "lfstests" #define TESTFILE "large.bin" @@ -67,7 +67,7 @@ static void test_open(abts_case *tc, void *data) || rv == EFBIG #endif ) { - abts_not_impl(tc, "Creation of large file (limited by rlimit or fs?)"); + ABTS_NOT_IMPL(tc, "Creation of large file (limited by rlimit or fs?)"); } else { apr_assert_success(tc, "truncate file to 8gb", rv); @@ -89,7 +89,7 @@ static void test_reopen(abts_case *tc, void *data) apr_assert_success(tc, "file_info_get failed", apr_file_info_get(&finfo, APR_FINFO_NORM, fh)); - abts_assert(tc, "file_info_get gave incorrect size", + ABTS_ASSERT(tc, "file_info_get gave incorrect size", finfo.size == eightGb); apr_assert_success(tc, "re-close large file", apr_file_close(fh)); @@ -104,7 +104,7 @@ static void test_stat(abts_case *tc, void *data) apr_assert_success(tc, "stat large file", apr_stat(&finfo, TESTFN, APR_FINFO_NORM, p)); - abts_assert(tc, "stat gave incorrect size", finfo.size == eightGb); + ABTS_ASSERT(tc, "stat gave incorrect size", finfo.size == eightGb); } static void test_readdir(abts_case *tc, void *data) @@ -123,7 +123,7 @@ static void test_readdir(abts_case *tc, void *data) rv = apr_dir_read(&finfo, APR_FINFO_NORM, dh); if (rv == APR_SUCCESS && strcmp(finfo.name, TESTFILE) == 0) { - abts_assert(tc, "apr_dir_read gave incorrect size for large file", + ABTS_ASSERT(tc, "apr_dir_read gave incorrect size for large file", finfo.size == eightGb); } @@ -156,7 +156,7 @@ static void test_append(abts_case *tc, void *data) apr_assert_success(tc, "file_info_get failed", apr_file_info_get(&finfo, APR_FINFO_NORM, fh)); - abts_assert(tc, "file_info_get gave incorrect size", + ABTS_ASSERT(tc, "file_info_get gave incorrect size", finfo.size == eightGb + strlen(TESTSTR)); apr_assert_success(tc, "close 8Gb file", apr_file_close(fh)); @@ -176,15 +176,15 @@ static void test_seek(abts_case *tc, void *data) pos = 0; apr_assert_success(tc, "relative seek to end", apr_file_seek(fh, APR_END, &pos)); - abts_assert(tc, "seek to END gave 8Gb", pos == eightGb); + ABTS_ASSERT(tc, "seek to END gave 8Gb", pos == eightGb); pos = eightGb; apr_assert_success(tc, "seek to 8Gb", apr_file_seek(fh, APR_SET, &pos)); - abts_assert(tc, "seek gave 8Gb offset", pos == eightGb); + ABTS_ASSERT(tc, "seek gave 8Gb offset", pos == eightGb); pos = 0; apr_assert_success(tc, "relative seek to 0", apr_file_seek(fh, APR_CUR, &pos)); - abts_assert(tc, "relative seek gave 8Gb offset", pos == eightGb); + ABTS_ASSERT(tc, "relative seek gave 8Gb offset", pos == eightGb); apr_file_close(fh); } @@ -201,7 +201,7 @@ static void test_write(abts_case *tc, void *data) apr_assert_success(tc, "seek to 8Gb - 4", apr_file_seek(fh, APR_SET, &pos)); - abts_assert(tc, "seek gave 8Gb-4 offset", pos == eightGb - 4); + ABTS_ASSERT(tc, "seek gave 8Gb-4 offset", pos == eightGb - 4); apr_assert_success(tc, "write magic string to 8Gb-4", apr_file_write_full(fh, "FISH", 4, NULL)); @@ -229,13 +229,13 @@ static void test_mmap(abts_case *tc, void *data) apr_assert_success(tc, "close file", apr_file_close(fh)); - abts_assert(tc, "mapped a 16K block", map->size == len); + ABTS_ASSERT(tc, "mapped a 16K block", map->size == len); apr_assert_success(tc, "get pointer into mmaped region", apr_mmap_offset(&ptr, map, len - 4)); - abts_assert(tc, "pointer was not NULL", ptr != NULL); + ABTS_ASSERT(tc, "pointer was not NULL", ptr != NULL); - abts_assert(tc, "found the magic string", memcmp(ptr, "FISH", 4) == 0); + ABTS_ASSERT(tc, "found the magic string", memcmp(ptr, "FISH", 4) == 0); apr_assert_success(tc, "delete mmap handle", apr_mmap_delete(map)); } @@ -249,14 +249,14 @@ static void test_format(abts_case *tc, void *data) off = apr_atoi64(apr_off_t_toa(p, eightGb)); - abts_assert(tc, "apr_atoi64 parsed apr_off_t_toa result incorrectly", + ABTS_ASSERT(tc, "apr_atoi64 parsed apr_off_t_toa result incorrectly", off == eightGb); } #else static void test_nolfs(abts_case *tc, void *data) { - abts_not_impl(tc, "Large Files not supported"); + ABTS_NOT_IMPL(tc, "Large Files not supported"); } #endif diff --git a/test/testlock.c b/test/testlock.c index 7609c7ec172..9fbf8c6bf11 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -154,27 +154,27 @@ static void test_thread_mutex(abts_case *tc, void *data) apr_status_t s1, s2, s3, s4; s1 = apr_thread_mutex_create(&thread_mutex, APR_THREAD_MUTEX_DEFAULT, p); - abts_int_equal(tc, APR_SUCCESS, s1); - abts_ptr_notnull(tc, thread_mutex); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); + ABTS_PTR_NOTNULL(tc, thread_mutex); i = 0; x = 0; s1 = apr_thread_create(&t1, NULL, thread_mutex_function, NULL, p); - abts_int_equal(tc, APR_SUCCESS, s1); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); s2 = apr_thread_create(&t2, NULL, thread_mutex_function, NULL, p); - abts_int_equal(tc, APR_SUCCESS, s2); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s2); s3 = apr_thread_create(&t3, NULL, thread_mutex_function, NULL, p); - abts_int_equal(tc, APR_SUCCESS, s3); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s3); s4 = apr_thread_create(&t4, NULL, thread_mutex_function, NULL, p); - abts_int_equal(tc, APR_SUCCESS, s4); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s4); apr_thread_join(&s1, t1); apr_thread_join(&s2, t2); apr_thread_join(&s3, t3); apr_thread_join(&s4, t4); - abts_int_equal(tc, MAX_ITER, x); + ABTS_INT_EQUAL(tc, MAX_ITER, x); } static void test_thread_rwlock(abts_case *tc, void *data) @@ -184,7 +184,7 @@ static void test_thread_rwlock(abts_case *tc, void *data) s1 = apr_thread_rwlock_create(&rwlock, p); apr_assert_success(tc, "rwlock_create", s1); - abts_ptr_notnull(tc, rwlock); + ABTS_PTR_NOTNULL(tc, rwlock); i = 0; x = 0; @@ -203,7 +203,7 @@ static void test_thread_rwlock(abts_case *tc, void *data) apr_thread_join(&s3, t3); apr_thread_join(&s4, t4); - abts_int_equal(tc, MAX_ITER, x); + ABTS_INT_EQUAL(tc, MAX_ITER, x); } static void test_cond(abts_case *tc, void *data) @@ -216,16 +216,16 @@ static void test_cond(abts_case *tc, void *data) apr_assert_success(tc, "create put mutex", apr_thread_mutex_create(&put.mutex, APR_THREAD_MUTEX_DEFAULT, p)); - abts_ptr_notnull(tc, put.mutex); + ABTS_PTR_NOTNULL(tc, put.mutex); apr_assert_success(tc, "create nready mutex", apr_thread_mutex_create(&nready.mutex, APR_THREAD_MUTEX_DEFAULT, p)); - abts_ptr_notnull(tc, nready.mutex); + ABTS_PTR_NOTNULL(tc, nready.mutex); apr_assert_success(tc, "create condvar", apr_thread_cond_create(&nready.cond, p)); - abts_ptr_notnull(tc, nready.cond); + ABTS_PTR_NOTNULL(tc, nready.cond); count1 = count2 = count3 = count4 = 0; put.nput = put.nval = 0; @@ -234,15 +234,15 @@ static void test_cond(abts_case *tc, void *data) x = 0; s0 = apr_thread_create(&p1, NULL, thread_cond_producer, &count1, p); - abts_int_equal(tc, APR_SUCCESS, s0); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s0); s1 = apr_thread_create(&p2, NULL, thread_cond_producer, &count2, p); - abts_int_equal(tc, APR_SUCCESS, s1); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); s2 = apr_thread_create(&p3, NULL, thread_cond_producer, &count3, p); - abts_int_equal(tc, APR_SUCCESS, s2); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s2); s3 = apr_thread_create(&p4, NULL, thread_cond_producer, &count4, p); - abts_int_equal(tc, APR_SUCCESS, s3); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s3); s4 = apr_thread_create(&c1, NULL, thread_cond_consumer, NULL, p); - abts_int_equal(tc, APR_SUCCESS, s4); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s4); apr_thread_join(&s0, p1); apr_thread_join(&s1, p2); @@ -258,7 +258,7 @@ static void test_cond(abts_case *tc, void *data) printf("count1 = %d count2 = %d count3 = %d count4 = %d\n", count1, count2, count3, count4); */ - abts_int_equal(tc, MAX_COUNTER, sum); + ABTS_INT_EQUAL(tc, MAX_COUNTER, sum); } static void test_timeoutcond(abts_case *tc, void *data) @@ -269,12 +269,12 @@ static void test_timeoutcond(abts_case *tc, void *data) int i; s = apr_thread_mutex_create(&timeout_mutex, APR_THREAD_MUTEX_DEFAULT, p); - abts_int_equal(tc, APR_SUCCESS, s); - abts_ptr_notnull(tc, timeout_mutex); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s); + ABTS_PTR_NOTNULL(tc, timeout_mutex); s = apr_thread_cond_create(&timeout_cond, p); - abts_int_equal(tc, APR_SUCCESS, s); - abts_ptr_notnull(tc, timeout_cond); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s); + ABTS_PTR_NOTNULL(tc, timeout_cond); timeout = apr_time_from_sec(5); @@ -289,11 +289,11 @@ static void test_timeoutcond(abts_case *tc, void *data) if (s != APR_SUCCESS && !APR_STATUS_IS_TIMEUP(s)) { continue; } - abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(s)); - abts_assert(tc, "Timer returned too late", end - begin - timeout < 100000); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(s)); + ABTS_ASSERT(tc, "Timer returned too late", end - begin - timeout < 100000); break; } - abts_assert(tc, "Too many retries", i < MAX_RETRY); + ABTS_ASSERT(tc, "Too many retries", i < MAX_RETRY); } #endif /* !APR_HAS_THREADS */ @@ -301,7 +301,7 @@ static void test_timeoutcond(abts_case *tc, void *data) #if !APR_HAS_THREADS static void threads_not_impl(abts_case *tc, void *data) { - abts_not_impl(tc, "Threads not implemented on this platform"); + ABTS_NOT_IMPL(tc, "Threads not implemented on this platform"); } #endif diff --git a/test/testmmap.c b/test/testmmap.c index 4b402a8e624..96de1abf331 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -30,7 +30,7 @@ #if !APR_HAS_MMAP static void not_implemented(abts_case *tc, void *data) { - abts_not_impl(tc, "User functions"); + ABTS_NOT_IMPL(tc, "User functions"); } #else @@ -48,16 +48,16 @@ static void create_filename(abts_case *tc, void *data) apr_filepath_get(&file1, 0, p); #ifndef NETWARE #ifdef WIN32 - abts_true(tc, file1[1] == ':'); + ABTS_TRUE(tc, file1[1] == ':'); #else - abts_true(tc, file1[0] == '/'); + ABTS_TRUE(tc, file1[0] == '/'); #endif #endif - abts_true(tc, file1[strlen(file1) - 1] != '/'); + ABTS_TRUE(tc, file1[strlen(file1) - 1] != '/'); oldfileptr = file1; file1 = apr_pstrcat(p, file1,"/data/mmap_datafile.txt" ,NULL); - abts_true(tc, oldfileptr != file1); + ABTS_TRUE(tc, oldfileptr != file1); } static void test_file_close(abts_case *tc, void *data) @@ -65,7 +65,7 @@ static void test_file_close(abts_case *tc, void *data) apr_status_t rv; rv = apr_file_close(thefile); - abts_int_equal(tc, rv, APR_SUCCESS); + ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); } static void test_file_open(abts_case *tc, void *data) @@ -73,8 +73,8 @@ static void test_file_open(abts_case *tc, void *data) apr_status_t rv; rv = apr_file_open(&thefile, file1, APR_READ, APR_UREAD | APR_GREAD, p); - abts_int_equal(tc, rv, APR_SUCCESS); - abts_ptr_notnull(tc, thefile); + ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); + ABTS_PTR_NOTNULL(tc, thefile); } static void test_get_filesize(abts_case *tc, void *data) @@ -82,8 +82,8 @@ static void test_get_filesize(abts_case *tc, void *data) apr_status_t rv; rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); - abts_int_equal(tc, rv, APR_SUCCESS); - abts_int_equal(tc, fsize, finfo.size); + ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); + ABTS_INT_EQUAL(tc, fsize, finfo.size); } static void test_mmap_create(abts_case *tc, void *data) @@ -91,28 +91,28 @@ static void test_mmap_create(abts_case *tc, void *data) apr_status_t rv; rv = apr_mmap_create(&themmap, thefile, 0, finfo.size, APR_MMAP_READ, p); - abts_ptr_notnull(tc, themmap); - abts_int_equal(tc, rv, APR_SUCCESS); + ABTS_PTR_NOTNULL(tc, themmap); + ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); } static void test_mmap_contents(abts_case *tc, void *data) { - abts_ptr_notnull(tc, themmap); - abts_ptr_notnull(tc, themmap->mm); - abts_int_equal(tc, fsize, themmap->size); + ABTS_PTR_NOTNULL(tc, themmap); + ABTS_PTR_NOTNULL(tc, themmap->mm); + ABTS_INT_EQUAL(tc, fsize, themmap->size); /* Must use nEquals since the string is not guaranteed to be NULL terminated */ - abts_str_nequal(tc, themmap->mm, TEST_STRING, fsize); + ABTS_STR_NEQUAL(tc, themmap->mm, TEST_STRING, fsize); } static void test_mmap_delete(abts_case *tc, void *data) { apr_status_t rv; - abts_ptr_notnull(tc, themmap); + ABTS_PTR_NOTNULL(tc, themmap); rv = apr_mmap_delete(themmap); - abts_int_equal(tc, rv, APR_SUCCESS); + ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); } static void test_mmap_offset(abts_case *tc, void *data) @@ -120,11 +120,11 @@ static void test_mmap_offset(abts_case *tc, void *data) apr_status_t rv; void *addr; - abts_ptr_notnull(tc, themmap); + ABTS_PTR_NOTNULL(tc, themmap); rv = apr_mmap_offset(&addr, themmap, 5); /* Must use nEquals since the string is not guaranteed to be NULL terminated */ - abts_str_nequal(tc, addr, TEST_STRING + 5, fsize-5); + ABTS_STR_NEQUAL(tc, addr, TEST_STRING + 5, fsize-5); } #endif diff --git a/test/testnames.c b/test/testnames.c index 705656a8ffd..e0f7ec822cb 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -38,9 +38,9 @@ static void merge_aboveroot(abts_case *tc, void *data) rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"bar", APR_FILEPATH_NOTABOVEROOT, p); apr_strerror(rv, errmsg, sizeof(errmsg)); - abts_int_equal(tc, 1, APR_STATUS_IS_EABOVEROOT(rv)); - abts_ptr_equal(tc, NULL, dstpath); - abts_str_equal(tc, "The given path was above the root path", errmsg); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EABOVEROOT(rv)); + ABTS_PTR_EQUAL(tc, NULL, dstpath); + ABTS_STR_EQUAL(tc, "The given path was above the root path", errmsg); } static void merge_belowroot(abts_case *tc, void *data) @@ -50,9 +50,9 @@ static void merge_belowroot(abts_case *tc, void *data) rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"foo/bar", APR_FILEPATH_NOTABOVEROOT, p); - abts_ptr_notnull(tc, dstpath); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, ABS_ROOT"foo/bar", dstpath); + ABTS_PTR_NOTNULL(tc, dstpath); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, ABS_ROOT"foo/bar", dstpath); } static void merge_noflag(abts_case *tc, void *data) @@ -61,9 +61,9 @@ static void merge_noflag(abts_case *tc, void *data) char *dstpath = NULL; rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"foo/bar", 0, p); - abts_ptr_notnull(tc, dstpath); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, ABS_ROOT"foo/bar", dstpath); + ABTS_PTR_NOTNULL(tc, dstpath); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, ABS_ROOT"foo/bar", dstpath); } static void merge_dotdot(abts_case *tc, void *data) @@ -72,13 +72,13 @@ static void merge_dotdot(abts_case *tc, void *data) char *dstpath = NULL; rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz", 0, p); - abts_ptr_notnull(tc, dstpath); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, ABS_ROOT"foo/baz", dstpath); + ABTS_PTR_NOTNULL(tc, dstpath); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, ABS_ROOT"foo/baz", dstpath); rv = apr_filepath_merge(&dstpath, "", "../test", 0, p); - abts_int_equal(tc, 0, APR_SUCCESS); - abts_str_equal(tc, "../test", dstpath); + ABTS_INT_EQUAL(tc, 0, APR_SUCCESS); + ABTS_STR_EQUAL(tc, "../test", dstpath); /* Very dangerous assumptions here about what the cwd is. However, let's assume * that the testall is invoked from within apr/test/ so the following test should @@ -86,8 +86,8 @@ static void merge_dotdot(abts_case *tc, void *data) * the case of the test directory: */ rv = apr_filepath_merge(&dstpath, "", "../test", APR_FILEPATH_TRUENAME, p); - abts_int_equal(tc, 0, APR_SUCCESS); - abts_str_equal(tc, "../test", dstpath); + ABTS_INT_EQUAL(tc, 0, APR_SUCCESS); + ABTS_STR_EQUAL(tc, "../test", dstpath); } static void merge_secure(abts_case *tc, void *data) @@ -96,9 +96,9 @@ static void merge_secure(abts_case *tc, void *data) char *dstpath = NULL; rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../bar/baz", 0, p); - abts_ptr_notnull(tc, dstpath); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, ABS_ROOT"foo/bar/baz", dstpath); + ABTS_PTR_NOTNULL(tc, dstpath); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, ABS_ROOT"foo/bar/baz", dstpath); } static void merge_notrel(abts_case *tc, void *data) @@ -108,9 +108,9 @@ static void merge_notrel(abts_case *tc, void *data) rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz", APR_FILEPATH_NOTRELATIVE, p); - abts_ptr_notnull(tc, dstpath); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, ABS_ROOT"foo/baz", dstpath); + ABTS_PTR_NOTNULL(tc, dstpath); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, ABS_ROOT"foo/baz", dstpath); } static void merge_notrelfail(abts_case *tc, void *data) @@ -123,9 +123,9 @@ static void merge_notrelfail(abts_case *tc, void *data) APR_FILEPATH_NOTRELATIVE, p); apr_strerror(rv, errmsg, sizeof(errmsg)); - abts_ptr_equal(tc, NULL, dstpath); - abts_int_equal(tc, 1, APR_STATUS_IS_ERELATIVE(rv)); - abts_str_equal(tc, "The given path is relative", errmsg); + ABTS_PTR_EQUAL(tc, NULL, dstpath); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ERELATIVE(rv)); + ABTS_STR_EQUAL(tc, "The given path is relative", errmsg); } static void merge_notabsfail(abts_case *tc, void *data) @@ -138,9 +138,9 @@ static void merge_notabsfail(abts_case *tc, void *data) APR_FILEPATH_NOTABSOLUTE, p); apr_strerror(rv, errmsg, sizeof(errmsg)); - abts_ptr_equal(tc, NULL, dstpath); - abts_int_equal(tc, 1, APR_STATUS_IS_EABSOLUTE(rv)); - abts_str_equal(tc, "The given path is absolute", errmsg); + ABTS_PTR_EQUAL(tc, NULL, dstpath); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EABSOLUTE(rv)); + ABTS_STR_EQUAL(tc, "The given path is absolute", errmsg); } static void merge_notabs(abts_case *tc, void *data) @@ -151,9 +151,9 @@ static void merge_notabs(abts_case *tc, void *data) rv = apr_filepath_merge(&dstpath, "foo/bar", "../baz", APR_FILEPATH_NOTABSOLUTE, p); - abts_ptr_notnull(tc, dstpath); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, "foo/baz", dstpath); + ABTS_PTR_NOTNULL(tc, dstpath); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, "foo/baz", dstpath); } static void root_absolute(abts_case *tc, void *data) @@ -164,9 +164,9 @@ static void root_absolute(abts_case *tc, void *data) rv = apr_filepath_root(&root, &path, 0, p); - abts_ptr_notnull(tc, root); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, ABS_ROOT, root); + ABTS_PTR_NOTNULL(tc, root); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, ABS_ROOT, root); } static void root_relative(abts_case *tc, void *data) @@ -179,9 +179,9 @@ static void root_relative(abts_case *tc, void *data) rv = apr_filepath_root(&root, &path, 0, p); apr_strerror(rv, errmsg, sizeof(errmsg)); - abts_ptr_equal(tc, NULL, root); - abts_int_equal(tc, 1, APR_STATUS_IS_ERELATIVE(rv)); - abts_str_equal(tc, "The given path is relative", errmsg); + ABTS_PTR_EQUAL(tc, NULL, root); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ERELATIVE(rv)); + ABTS_STR_EQUAL(tc, "The given path is relative", errmsg); } diff --git a/test/testoc.c b/test/testoc.c index e5fec431b77..335acab8a9f 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -66,17 +66,17 @@ static void test_child_kill(abts_case *tc, void *data) args[2] = NULL; rv = apr_procattr_create(&procattr, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_NO_PIPE, APR_NO_PIPE); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_proc_create(&newproc, "./occhild" EXTENSION, args, NULL, procattr, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, newproc.in); - abts_ptr_equal(tc, NULL, newproc.out); - abts_ptr_equal(tc, NULL, newproc.err); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, newproc.in); + ABTS_PTR_EQUAL(tc, NULL, newproc.out); + ABTS_PTR_EQUAL(tc, NULL, newproc.err); std = newproc.in; @@ -84,19 +84,19 @@ static void test_child_kill(abts_case *tc, void *data) apr_sleep(apr_time_from_sec(1)); rv = apr_proc_kill(&newproc, SIGKILL); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* allow time for things to settle... */ apr_sleep(apr_time_from_sec(3)); apr_proc_other_child_refresh_all(APR_OC_REASON_RUNNING); - abts_str_equal(tc, "APR_OC_REASON_DEATH", reasonstr); + ABTS_STR_EQUAL(tc, "APR_OC_REASON_DEATH", reasonstr); } #else static void oc_not_impl(abts_case *tc, void *data) { - abts_not_impl(tc, "Other child logic not implemented on this platform"); + ABTS_NOT_IMPL(tc, "Other child logic not implemented on this platform"); } #endif diff --git a/test/testpath.c b/test/testpath.c index 944cdc2e278..68fa3798ca7 100644 --- a/test/testpath.c +++ b/test/testpath.c @@ -50,11 +50,11 @@ static void list_split_multi(abts_case *tc, void *data) pathelts = NULL; rv = apr_filepath_list_split(&pathelts, path_in, p); - abts_ptr_notnull(tc, pathelts); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, parts_out_count, pathelts->nelts); + ABTS_PTR_NOTNULL(tc, pathelts); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, parts_out_count, pathelts->nelts); for (i = 0; i < pathelts->nelts; ++i) - abts_str_equal(tc, parts_out[i], ((char**)pathelts->elts)[i]); + ABTS_STR_EQUAL(tc, parts_out[i], ((char**)pathelts->elts)[i]); } static void list_split_single(abts_case *tc, void *data) @@ -67,14 +67,14 @@ static void list_split_single(abts_case *tc, void *data) { pathelts = NULL; rv = apr_filepath_list_split(&pathelts, parts_in[i], p); - abts_ptr_notnull(tc, pathelts); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, pathelts); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); if (parts_in[i][0] == '\0') - abts_int_equal(tc, 0, pathelts->nelts); + ABTS_INT_EQUAL(tc, 0, pathelts->nelts); else { - abts_int_equal(tc, 1, pathelts->nelts); - abts_str_equal(tc, parts_in[i], *(char**)pathelts->elts); + ABTS_INT_EQUAL(tc, 1, pathelts->nelts); + ABTS_STR_EQUAL(tc, parts_in[i], *(char**)pathelts->elts); } } } @@ -92,9 +92,9 @@ static void list_merge_multi(abts_case *tc, void *data) liststr = NULL; rv = apr_filepath_list_merge(&liststr, pathelts, p); - abts_ptr_notnull(tc, liststr); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, liststr, path_out); + ABTS_PTR_NOTNULL(tc, liststr); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, liststr, path_out); } static void list_merge_single(abts_case *tc, void *data) @@ -112,12 +112,12 @@ static void list_merge_single(abts_case *tc, void *data) liststr = NULL; rv = apr_filepath_list_merge(&liststr, pathelts, p); if (parts_in[i][0] == '\0') - abts_ptr_equal(tc, NULL, liststr); + ABTS_PTR_EQUAL(tc, NULL, liststr); else { - abts_ptr_notnull(tc, liststr); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, liststr, parts_in[i]); + ABTS_PTR_NOTNULL(tc, liststr); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, liststr, parts_in[i]); } } } diff --git a/test/testpipe.c b/test/testpipe.c index fb30ddb12f8..5e9a339eefe 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -31,9 +31,9 @@ static void create_pipe(abts_case *tc, void *data) apr_status_t rv; rv = apr_file_pipe_create(&readp, &writep, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, readp); - abts_ptr_notnull(tc, writep); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, readp); + ABTS_PTR_NOTNULL(tc, writep); } static void close_pipe(abts_case *tc, void *data) @@ -44,10 +44,10 @@ static void close_pipe(abts_case *tc, void *data) rv = apr_file_close(readp); rv = apr_file_close(writep); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_read(readp, buf, &nbytes); - abts_int_equal(tc, 1, APR_STATUS_IS_EBADF(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EBADF(rv)); } static void set_timeout(abts_case *tc, void *data) @@ -56,20 +56,20 @@ static void set_timeout(abts_case *tc, void *data) apr_interval_time_t timeout; rv = apr_file_pipe_create(&readp, &writep, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, readp); - abts_ptr_notnull(tc, writep); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, readp); + ABTS_PTR_NOTNULL(tc, writep); rv = apr_file_pipe_timeout_get(readp, &timeout); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, -1, timeout); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, -1, timeout); rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_pipe_timeout_get(readp, &timeout); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, apr_time_from_sec(1), timeout); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, apr_time_from_sec(1), timeout); } static void read_write(abts_case *tc, void *data) @@ -82,16 +82,16 @@ static void read_write(abts_case *tc, void *data) buf = (char *)apr_palloc(p, nbytes + 1); rv = apr_file_pipe_create(&readp, &writep, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, readp); - abts_ptr_notnull(tc, writep); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, readp); + ABTS_PTR_NOTNULL(tc, writep); rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_read(readp, buf, &nbytes); - abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - abts_int_equal(tc, 0, nbytes); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 0, nbytes); } static void read_write_notimeout(abts_case *tc, void *data) @@ -104,20 +104,20 @@ static void read_write_notimeout(abts_case *tc, void *data) nbytes = strlen("this is a test"); rv = apr_file_pipe_create(&readp, &writep, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, readp); - abts_ptr_notnull(tc, writep); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, readp); + ABTS_PTR_NOTNULL(tc, writep); rv = apr_file_write(writep, buf, &nbytes); - abts_int_equal(tc, strlen("this is a test"), nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, strlen("this is a test"), nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); nbytes = 256; input = apr_pcalloc(p, nbytes + 1); rv = apr_file_read(readp, input, &nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, strlen("this is a test"), nbytes); - abts_str_equal(tc, "this is a test", input); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, strlen("this is a test"), nbytes); + ABTS_STR_EQUAL(tc, "this is a test", input); } static void test_pipe_writefull(abts_case *tc, void *data) @@ -136,47 +136,47 @@ static void test_pipe_writefull(abts_case *tc, void *data) apr_exit_why_e why; rv = apr_procattr_create(&procattr, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_procattr_io_set(procattr, APR_CHILD_BLOCK, APR_CHILD_BLOCK, APR_CHILD_BLOCK); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_procattr_error_check_set(procattr, 1); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); args[0] = "readchild" EXTENSION; args[1] = NULL; rv = apr_proc_create(&proc, "./readchild" EXTENSION, args, NULL, procattr, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_pipe_timeout_set(proc.in, apr_time_from_sec(10)); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_pipe_timeout_set(proc.out, apr_time_from_sec(10)); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); i = iterations; do { rv = apr_file_write_full(proc.in, buf, bytes_per_iteration, NULL); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } while (--i); free(buf); rv = apr_file_close(proc.in); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); nbytes = sizeof(responsebuf); rv = apr_file_read(proc.out, responsebuf, &nbytes); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); bytes_processed = (int)apr_strtoi64(responsebuf, NULL, 10); - abts_int_equal(tc, iterations * bytes_per_iteration, bytes_processed); + ABTS_INT_EQUAL(tc, iterations * bytes_per_iteration, bytes_processed); - abts_assert(tc, "wait for child process", + ABTS_ASSERT(tc, "wait for child process", apr_proc_wait(&proc, NULL, &why, APR_WAIT) == APR_CHILD_DONE); - abts_assert(tc, "child terminated normally", why == APR_PROC_EXIT); + ABTS_ASSERT(tc, "child terminated normally", why == APR_PROC_EXIT); } abts_suite *testpipe(abts_suite *suite) diff --git a/test/testpoll.c b/test/testpoll.c index f96268e4bba..23a824dbd8a 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -46,13 +46,13 @@ static void make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, apr_status_t rv; rv = apr_sockaddr_info_get(sa, "127.0.0.1", APR_UNSPEC, port, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_create(sock, (*sa)->family, SOCK_DGRAM, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv =apr_socket_bind((*sock), (*sa)); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } #ifdef OLD_POLL_INTERFACE @@ -66,15 +66,15 @@ static void check_sockets(const apr_pollfd_t *pollarray, rv = apr_poll_revents_get(&event, sockarray[which], (apr_pollfd_t *)pollarray); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); if (pollin) { str = apr_psprintf(p, "Socket %d not signalled when it should be", which); - abts_assert(tc, str, event & APR_POLLIN); + ABTS_ASSERT(tc, str, event & APR_POLLIN); } else { str = apr_psprintf(p, "Socket %d signalled when it should not be", which); - abts_assert(tc, str, !(event & APR_POLLIN)); + ABTS_ASSERT(tc, str, !(event & APR_POLLIN)); } } #endif @@ -85,11 +85,11 @@ static void send_msg(apr_socket_t **sockarray, apr_sockaddr_t **sas, int which, apr_size_t len = 5; apr_status_t rv; - abts_ptr_notnull(tc, sockarray[which]); + ABTS_PTR_NOTNULL(tc, sockarray[which]); rv = apr_socket_sendto(sockarray[which], sas[which], 0, "hello", &len); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, strlen("hello"), len); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, strlen("hello"), len); } static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p, @@ -100,14 +100,14 @@ static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p, apr_sockaddr_t *recsa; apr_status_t rv; - abts_ptr_notnull(tc, sockarray[which]); + ABTS_PTR_NOTNULL(tc, sockarray[which]); apr_sockaddr_info_get(&recsa, "127.0.0.1", APR_UNSPEC, 7770, 0, p); rv = apr_socket_recvfrom(recsa, sockarray[which], 0, buffer, &buflen); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, strlen("hello"), buflen); - abts_str_equal(tc, "hello", buffer); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, strlen("hello"), buflen); + ABTS_STR_EQUAL(tc, "hello", buffer); } @@ -127,15 +127,15 @@ static void setup_small_poll(abts_case *tc, void *data) int i; rv = apr_poll_setup(&pollarray, SMALL_NUM_SOCKETS, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); for (i = 0; i < SMALL_NUM_SOCKETS;i++){ - abts_int_equal(tc, 0, pollarray[i].reqevents); - abts_int_equal(tc, 0, pollarray[i].rtnevents); + ABTS_INT_EQUAL(tc, 0, pollarray[i].reqevents); + ABTS_INT_EQUAL(tc, 0, pollarray[i].rtnevents); rv = apr_poll_socket_add(pollarray, s[i], APR_POLLIN); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_equal(tc, s[i], pollarray[i].desc.s); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_EQUAL(tc, s[i], pollarray[i].desc.s); } } @@ -145,15 +145,15 @@ static void setup_large_poll(abts_case *tc, void *data) int i; rv = apr_poll_setup(&pollarray_large, LARGE_NUM_SOCKETS, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); for (i = 0; i < LARGE_NUM_SOCKETS;i++){ - abts_int_equal(tc, 0, pollarray_large[i].reqevents); - abts_int_equal(tc, 0, pollarray_large[i].rtnevents); + ABTS_INT_EQUAL(tc, 0, pollarray_large[i].reqevents); + ABTS_INT_EQUAL(tc, 0, pollarray_large[i].rtnevents); rv = apr_poll_socket_add(pollarray_large, s[i], APR_POLLIN); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_equal(tc, s[i], pollarray_large[i].desc.s); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_EQUAL(tc, s[i], pollarray_large[i].desc.s); } } @@ -163,7 +163,7 @@ static void nomessage(abts_case *tc, void *data) int srv = SMALL_NUM_SOCKETS; rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 0, tc); check_sockets(pollarray, s, 2, 0, tc); @@ -177,7 +177,7 @@ static void send_2(abts_case *tc, void *data) send_msg(s, sa, 2, tc); rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 0, tc); check_sockets(pollarray, s, 2, 1, tc); @@ -192,7 +192,7 @@ static void recv_2_send_1(abts_case *tc, void *data) send_msg(s, sa, 1, tc); rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 1, tc); check_sockets(pollarray, s, 2, 0, tc); @@ -206,7 +206,7 @@ static void send_2_signaled_1(abts_case *tc, void *data) send_msg(s, sa, 2, tc); rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 1, tc); check_sockets(pollarray, s, 2, 1, tc); @@ -221,7 +221,7 @@ static void recv_1_send_0(abts_case *tc, void *data) send_msg(s, sa, 0, tc); rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); check_sockets(pollarray, s, 0, 1, tc); check_sockets(pollarray, s, 1, 0, tc); check_sockets(pollarray, s, 2, 1, tc); @@ -236,7 +236,7 @@ static void clear_all_signalled(abts_case *tc, void *data) recv_msg(s, 2, p, tc); rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); - abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 0, tc); check_sockets(pollarray, s, 2, 0, tc); @@ -252,7 +252,7 @@ static void send_large_pollarray(abts_case *tc, void *data) rv = apr_poll(pollarray_large, LARGE_NUM_SOCKETS, &lrv, 2 * APR_USEC_PER_SEC); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); for (i = 0; i < LARGE_NUM_SOCKETS; i++) { if (i == (LARGE_NUM_SOCKETS - 1)) { @@ -274,7 +274,7 @@ static void recv_large_pollarray(abts_case *tc, void *data) rv = apr_poll(pollarray_large, LARGE_NUM_SOCKETS, &lrv, 2 * APR_USEC_PER_SEC); - abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); for (i = 0; i < LARGE_NUM_SOCKETS; i++) { check_sockets(pollarray_large, s, i, 0, tc); @@ -286,7 +286,7 @@ static void setup_pollset(abts_case *tc, void *data) { apr_status_t rv; rv = apr_pollset_create(&pollset, LARGE_NUM_SOCKETS, p, 0); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void add_sockets_pollset(abts_case *tc, void *data) @@ -297,14 +297,14 @@ static void add_sockets_pollset(abts_case *tc, void *data) for (i = 0; i < LARGE_NUM_SOCKETS;i++){ apr_pollfd_t socket_pollfd; - abts_ptr_notnull(tc, s[i]); + ABTS_PTR_NOTNULL(tc, s[i]); socket_pollfd.desc_type = APR_POLL_SOCKET; socket_pollfd.reqevents = APR_POLLIN; socket_pollfd.desc.s = s[i]; socket_pollfd.client_data = s[i]; rv = apr_pollset_add(pollset, &socket_pollfd); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } } @@ -315,9 +315,9 @@ static void nomessage_pollset(abts_case *tc, void *data) const apr_pollfd_t *descs = NULL; rv = apr_pollset_poll(pollset, 0, &lrv, &descs); - abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - abts_int_equal(tc, 0, lrv); - abts_ptr_equal(tc, NULL, descs); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 0, lrv); + ABTS_PTR_EQUAL(tc, NULL, descs); } static void send0_pollset(abts_case *tc, void *data) @@ -328,12 +328,12 @@ static void send0_pollset(abts_case *tc, void *data) send_msg(s, sa, 0, tc); rv = apr_pollset_poll(pollset, 0, &num, &descs); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 1, num); - abts_ptr_notnull(tc, descs); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 1, num); + ABTS_PTR_NOTNULL(tc, descs); - abts_ptr_equal(tc, s[0], descs[0].desc.s); - abts_ptr_equal(tc, s[0], descs[0].client_data); + ABTS_PTR_EQUAL(tc, s[0], descs[0].desc.s); + ABTS_PTR_EQUAL(tc, s[0], descs[0].client_data); } static void recv0_pollset(abts_case *tc, void *data) @@ -344,9 +344,9 @@ static void recv0_pollset(abts_case *tc, void *data) recv_msg(s, 0, p, tc); rv = apr_pollset_poll(pollset, 0, &lrv, &descs); - abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - abts_int_equal(tc, 0, lrv); - abts_ptr_equal(tc, NULL, descs); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 0, lrv); + ABTS_PTR_EQUAL(tc, NULL, descs); } static void send_middle_pollset(abts_case *tc, void *data) @@ -358,11 +358,11 @@ static void send_middle_pollset(abts_case *tc, void *data) send_msg(s, sa, 2, tc); send_msg(s, sa, 5, tc); rv = apr_pollset_poll(pollset, 0, &num, &descs); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 2, num); - abts_ptr_notnull(tc, descs); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 2, num); + ABTS_PTR_NOTNULL(tc, descs); - abts_assert(tc, "Incorrect socket in result set", + ABTS_ASSERT(tc, "Incorrect socket in result set", ((descs[0].desc.s == s[2]) && (descs[1].desc.s == s[5])) || ((descs[0].desc.s == s[5]) && (descs[1].desc.s == s[2]))); } @@ -377,9 +377,9 @@ static void clear_middle_pollset(abts_case *tc, void *data) recv_msg(s, 5, p, tc); rv = apr_pollset_poll(pollset, 0, &lrv, &descs); - abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - abts_int_equal(tc, 0, lrv); - abts_ptr_equal(tc, NULL, descs); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 0, lrv); + ABTS_PTR_EQUAL(tc, NULL, descs); } static void send_last_pollset(abts_case *tc, void *data) @@ -390,12 +390,12 @@ static void send_last_pollset(abts_case *tc, void *data) send_msg(s, sa, LARGE_NUM_SOCKETS - 1, tc); rv = apr_pollset_poll(pollset, 0, &num, &descs); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 1, num); - abts_ptr_notnull(tc, descs); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 1, num); + ABTS_PTR_NOTNULL(tc, descs); - abts_ptr_equal(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].desc.s); - abts_ptr_equal(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].client_data); + ABTS_PTR_EQUAL(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].desc.s); + ABTS_PTR_EQUAL(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].client_data); } static void clear_last_pollset(abts_case *tc, void *data) @@ -407,9 +407,9 @@ static void clear_last_pollset(abts_case *tc, void *data) recv_msg(s, LARGE_NUM_SOCKETS - 1, p, tc); rv = apr_pollset_poll(pollset, 0, &lrv, &descs); - abts_int_equal(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - abts_int_equal(tc, 0, lrv); - abts_ptr_equal(tc, NULL, descs); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 0, lrv); + ABTS_PTR_EQUAL(tc, NULL, descs); } static void close_all_sockets(abts_case *tc, void *data) @@ -419,7 +419,7 @@ static void close_all_sockets(abts_case *tc, void *data) for (i = 0; i < LARGE_NUM_SOCKETS; i++){ rv = apr_socket_close(s[i]); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } } @@ -432,7 +432,7 @@ static void pollset_remove(abts_case *tc, void *data) apr_int32_t num; rv = apr_pollset_create(&pollset, 5, p, 0); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); pfd.p = p; pfd.desc_type = APR_POLL_SOCKET; @@ -441,58 +441,58 @@ static void pollset_remove(abts_case *tc, void *data) pfd.desc.s = s[0]; pfd.client_data = (void *)1; rv = apr_pollset_add(pollset, &pfd); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); pfd.desc.s = s[1]; pfd.client_data = (void *)2; rv = apr_pollset_add(pollset, &pfd); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); pfd.desc.s = s[2]; pfd.client_data = (void *)3; rv = apr_pollset_add(pollset, &pfd); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); pfd.desc.s = s[3]; pfd.client_data = (void *)4; rv = apr_pollset_add(pollset, &pfd); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 4, num); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 4, num); /* now remove the pollset element referring to desc s[1] */ pfd.desc.s = s[1]; pfd.client_data = (void *)999; /* not used on this call */ rv = apr_pollset_remove(pollset, &pfd); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* this time only three should match */ rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 3, num); - abts_ptr_equal(tc, (void *)1, hot_files[0].client_data); - abts_ptr_equal(tc, s[0], hot_files[0].desc.s); - abts_ptr_equal(tc, (void *)3, hot_files[1].client_data); - abts_ptr_equal(tc, s[2], hot_files[1].desc.s); - abts_ptr_equal(tc, (void *)4, hot_files[2].client_data); - abts_ptr_equal(tc, s[3], hot_files[2].desc.s); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 3, num); + ABTS_PTR_EQUAL(tc, (void *)1, hot_files[0].client_data); + ABTS_PTR_EQUAL(tc, s[0], hot_files[0].desc.s); + ABTS_PTR_EQUAL(tc, (void *)3, hot_files[1].client_data); + ABTS_PTR_EQUAL(tc, s[2], hot_files[1].desc.s); + ABTS_PTR_EQUAL(tc, (void *)4, hot_files[2].client_data); + ABTS_PTR_EQUAL(tc, s[3], hot_files[2].desc.s); /* now remove the pollset elements referring to desc s[2] */ pfd.desc.s = s[2]; pfd.client_data = (void *)999; /* not used on this call */ rv = apr_pollset_remove(pollset, &pfd); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* this time only two should match */ rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 2, num); - abts_ptr_equal(tc, (void *)1, hot_files[0].client_data); - abts_ptr_equal(tc, s[0], hot_files[0].desc.s); - abts_ptr_equal(tc, (void *)4, hot_files[1].client_data); - abts_ptr_equal(tc, s[3], hot_files[1].desc.s); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 2, num); + ABTS_PTR_EQUAL(tc, (void *)1, hot_files[0].client_data); + ABTS_PTR_EQUAL(tc, s[0], hot_files[0].desc.s); + ABTS_PTR_EQUAL(tc, (void *)4, hot_files[1].client_data); + ABTS_PTR_EQUAL(tc, s[3], hot_files[1].desc.s); } abts_suite *testpoll(abts_suite *suite) diff --git a/test/testpools.c b/test/testpools.c index a51879a8b47..18f2aa820d3 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -37,7 +37,7 @@ static void alloc_bytes(abts_case *tc, void *data) char *alloc; alloc = apr_palloc(pmain, ALLOC_BYTES); - abts_ptr_notnull(tc, alloc); + ABTS_PTR_NOTNULL(tc, alloc); for (i=0;i= 0); - abts_true(tc, timediff <= 1); + ABTS_TRUE(tc, timediff >= 0); + ABTS_TRUE(tc, timediff <= 1); } abts_suite *testsleep(abts_suite *suite) diff --git a/test/testsock.c b/test/testsock.c index ad5f25a6624..1489e6f1863 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -51,10 +51,10 @@ static int wait_child(abts_case *tc, apr_proc_t *proc) int exitcode; apr_exit_why_e why; - abts_assert(tc, "Error waiting for child process", + ABTS_ASSERT(tc, "Error waiting for child process", apr_proc_wait(proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); - abts_assert(tc, "child terminated normally", why == APR_PROC_EXIT); + ABTS_ASSERT(tc, "child terminated normally", why == APR_PROC_EXIT); return exitcode; } @@ -68,7 +68,7 @@ static void test_addr_info(abts_case *tc, void *data) rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, 80, 0, p); apr_assert_success(tc, "Problem generating sockaddr", rv); - abts_str_equal(tc, "127.0.0.1", sa->hostname); + ABTS_STR_EQUAL(tc, "127.0.0.1", sa->hostname); } static apr_socket_t *setup_socket(abts_case *tc) @@ -118,13 +118,13 @@ static void test_send(abts_case *tc, void *data) apr_assert_success(tc, "Problem with receiving connection", rv); apr_socket_protocol_get(sock2, &protocol); - abts_int_equal(tc, APR_PROTO_TCP, protocol); + ABTS_INT_EQUAL(tc, APR_PROTO_TCP, protocol); length = strlen(DATASTR); apr_socket_send(sock2, DATASTR, &length); /* Make sure that the client received the data we sent */ - abts_int_equal(tc, strlen(DATASTR), wait_child(tc, &proc)); + ABTS_INT_EQUAL(tc, strlen(DATASTR), wait_child(tc, &proc)); rv = apr_socket_close(sock2); apr_assert_success(tc, "Problem closing connected socket", rv); @@ -150,14 +150,14 @@ static void test_recv(abts_case *tc, void *data) apr_assert_success(tc, "Problem with receiving connection", rv); apr_socket_protocol_get(sock2, &protocol); - abts_int_equal(tc, APR_PROTO_TCP, protocol); + ABTS_INT_EQUAL(tc, APR_PROTO_TCP, protocol); memset(datastr, 0, STRLEN); apr_socket_recv(sock2, datastr, &length); /* Make sure that the server received the data we sent */ - abts_str_equal(tc, DATASTR, datastr); - abts_int_equal(tc, strlen(datastr), wait_child(tc, &proc)); + ABTS_STR_EQUAL(tc, DATASTR, datastr); + ABTS_INT_EQUAL(tc, strlen(datastr), wait_child(tc, &proc)); rv = apr_socket_close(sock2); apr_assert_success(tc, "Problem closing connected socket", rv); @@ -182,10 +182,10 @@ static void test_timeout(abts_case *tc, void *data) apr_assert_success(tc, "Problem with receiving connection", rv); apr_socket_protocol_get(sock2, &protocol); - abts_int_equal(tc, APR_PROTO_TCP, protocol); + ABTS_INT_EQUAL(tc, APR_PROTO_TCP, protocol); exit = wait_child(tc, &proc); - abts_int_equal(tc, SOCKET_TIMEOUT, exit); + ABTS_INT_EQUAL(tc, SOCKET_TIMEOUT, exit); /* We didn't write any data, so make sure the child program returns * an error. diff --git a/test/testsockets.c b/test/testsockets.c index 58744509750..15ecc9ef2a1 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -36,12 +36,12 @@ static void tcp_socket(abts_case *tc, void *data) int type; rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, sock); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, sock); rv = apr_socket_type_get(sock, &type); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, SOCK_STREAM, type); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, SOCK_STREAM, type); apr_socket_close(sock); } @@ -53,12 +53,12 @@ static void udp_socket(abts_case *tc, void *data) int type; rv = apr_socket_create(&sock, APR_INET, SOCK_DGRAM, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, sock); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, sock); rv = apr_socket_type_get(sock, &type); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, SOCK_DGRAM, type); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, SOCK_DGRAM, type); apr_socket_close(sock); } @@ -70,11 +70,11 @@ static void tcp6_socket(abts_case *tc, void *data) apr_socket_t *sock = NULL; rv = apr_socket_create(&sock, APR_INET6, SOCK_STREAM, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, sock); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, sock); apr_socket_close(sock); #else - abts_not_impl(tc, "IPv6"); + ABTS_NOT_IMPL(tc, "IPv6"); #endif } @@ -85,11 +85,11 @@ static void udp6_socket(abts_case *tc, void *data) apr_socket_t *sock = NULL; rv = apr_socket_create(&sock, APR_INET6, SOCK_DGRAM, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, sock); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, sock); apr_socket_close(sock); #else - abts_not_impl(tc, "IPv6"); + ABTS_NOT_IMPL(tc, "IPv6"); #endif } @@ -107,35 +107,35 @@ static void sendto_receivefrom(abts_case *tc, void *data) apr_size_t len = 30; rv = apr_socket_create(&sock, FAMILY, SOCK_DGRAM, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_create(&sock2, FAMILY, SOCK_DGRAM, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_sockaddr_info_get(&to, US, APR_UNSPEC, 7772, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_sockaddr_info_get(&from, US, APR_UNSPEC, 7771, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_bind(sock, to); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_bind(sock2, from); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); len = STRLEN; rv = apr_socket_sendto(sock2, to, 0, sendbuf, &len); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, STRLEN, len); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, STRLEN, len); len = 80; rv = apr_socket_recvfrom(from, sock, 0, recvbuf, &len); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, STRLEN, len); - abts_str_equal(tc, "APR_INET, SOCK_DGRAM", recvbuf); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, STRLEN, len); + ABTS_STR_EQUAL(tc, "APR_INET, SOCK_DGRAM", recvbuf); apr_sockaddr_ip_get(&ip_addr, from); fromport = from->port; - abts_str_equal(tc, US, ip_addr); - abts_int_equal(tc, 7771, fromport); + ABTS_STR_EQUAL(tc, US, ip_addr); + ABTS_INT_EQUAL(tc, 7771, fromport); apr_socket_close(sock); apr_socket_close(sock2); @@ -149,21 +149,21 @@ static void socket_userdata(abts_case *tc, void *data) const char *key = "GENERICKEY"; rv = apr_socket_create(&sock1, AF_INET, SOCK_STREAM, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_create(&sock2, AF_INET, SOCK_STREAM, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_data_set(sock1, "SOCK1", key, NULL); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_data_set(sock2, "SOCK2", key, NULL); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_data_get((void **)&user, key, sock1); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, "SOCK1", user); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, "SOCK1", user); rv = apr_socket_data_get((void **)&user, key, sock2); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_str_equal(tc, "SOCK2", user); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, "SOCK2", user); } abts_suite *testsockets(abts_suite *suite) diff --git a/test/testsockopt.c b/test/testsockopt.c index a272ba94b48..b04399900a0 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -26,8 +26,8 @@ static void create_socket(abts_case *tc, void *data) apr_status_t rv; rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, 0, p); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_ptr_notnull(tc, sock); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, sock); } static void set_keepalive(abts_case *tc, void *data) @@ -36,11 +36,11 @@ static void set_keepalive(abts_case *tc, void *data) apr_int32_t ck; rv = apr_socket_opt_set(sock, APR_SO_KEEPALIVE, 1); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 1, ck); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 1, ck); } static void set_debug(abts_case *tc, void *data) @@ -54,9 +54,9 @@ static void set_debug(abts_case *tc, void *data) rv2 = apr_socket_opt_get(sock, APR_SO_DEBUG, &ck); apr_assert_success(tc, "get SO_DEBUG option", rv2); if (APR_STATUS_IS_SUCCESS(rv1)) { - abts_int_equal(tc, 1, ck); + ABTS_INT_EQUAL(tc, 1, ck); } else { - abts_int_equal(tc, 0, ck); + ABTS_INT_EQUAL(tc, 0, ck); } } @@ -66,49 +66,49 @@ static void remove_keepalive(abts_case *tc, void *data) apr_int32_t ck; rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 1, ck); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 1, ck); rv = apr_socket_opt_set(sock, APR_SO_KEEPALIVE, 0); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 0, ck); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 0, ck); } static void corkable(abts_case *tc, void *data) { #if !APR_HAVE_CORKABLE_TCP - abts_not_impl(tc, "TCP isn't corkable"); + ABTS_NOT_IMPL(tc, "TCP isn't corkable"); #else apr_status_t rv; apr_int32_t ck; rv = apr_socket_opt_set(sock, APR_TCP_NODELAY, 1); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 1, ck); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 1, ck); rv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 1); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_opt_get(sock, APR_TCP_NOPUSH, &ck); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 1, ck); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 1, ck); rv = apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 0, ck); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 0, ck); rv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); - abts_int_equal(tc, APR_SUCCESS, rv); - abts_int_equal(tc, 1, ck); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 1, ck); #endif } @@ -117,7 +117,7 @@ static void close_socket(abts_case *tc, void *data) apr_status_t rv; rv = apr_socket_close(sock); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } abts_suite *testsockopt(abts_suite *suite) diff --git a/test/teststr.c b/test/teststr.c index fd5ff89a0ec..02ede380f96 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -77,11 +77,11 @@ static void test_strtok(abts_case *tc, void *data) retval2 = strtok(str2, cases[curtc].sep); if (!retval1) { - abts_true(tc, retval2 == NULL); + ABTS_TRUE(tc, retval2 == NULL); } else { - abts_true(tc, retval2 != NULL); - abts_str_equal(tc, retval2, retval1); + ABTS_TRUE(tc, retval2 != NULL); + ABTS_STR_EQUAL(tc, retval2, retval1); } str1 = str2 = NULL; /* make sure we pass NULL on subsequent calls */ @@ -104,7 +104,7 @@ static void snprintf_noNULL(abts_case *tc, void *data) /* If this test fails, we are going to seg fault. */ apr_snprintf(buff, sizeof(buff), "%.*s", 7, testing); - abts_str_nequal(tc, buff, testing, 7); + ABTS_STR_NEQUAL(tc, buff, testing, 7); } static void snprintf_0NULL(abts_case *tc, void *data) @@ -112,7 +112,7 @@ static void snprintf_0NULL(abts_case *tc, void *data) int rv; rv = apr_snprintf(NULL, 0, "%sBAR", "FOO"); - abts_int_equal(tc, 6, rv); + ABTS_INT_EQUAL(tc, 6, rv); } static void snprintf_0nonNULL(abts_case *tc, void *data) @@ -121,8 +121,8 @@ static void snprintf_0nonNULL(abts_case *tc, void *data) char *buff = "testing"; rv = apr_snprintf(buff, 0, "%sBAR", "FOO"); - abts_int_equal(tc, 6, rv); - abts_assert(tc, "buff unmangled", strcmp(buff, "FOOBAR") != 0); + ABTS_INT_EQUAL(tc, 6, rv); + ABTS_ASSERT(tc, "buff unmangled", strcmp(buff, "FOOBAR") != 0); } static void string_error(abts_case *tc, void *data) @@ -131,12 +131,12 @@ static void string_error(abts_case *tc, void *data) buf[0] = '\0'; rv = apr_strerror(APR_ENOENT, buf, sizeof buf); - abts_ptr_equal(tc, buf, rv); - abts_true(tc, strlen(buf) > 0); + ABTS_PTR_EQUAL(tc, buf, rv); + ABTS_TRUE(tc, strlen(buf) > 0); rv = apr_strerror(APR_TIMEUP, buf, sizeof buf); - abts_ptr_equal(tc, buf, rv); - abts_str_equal(tc, "The timeout specified has expired", buf); + ABTS_PTR_EQUAL(tc, buf, rv); + ABTS_STR_EQUAL(tc, "The timeout specified has expired", buf); } #define SIZE 180000 @@ -221,14 +221,14 @@ static void string_strtoi64(abts_case *tc, void *data) result = apr_strtoi64(ts[n].in, &end, ts[n].base); errnum = errno; - abts_assert(tc, + ABTS_ASSERT(tc, apr_psprintf(p, "for '%s': result was %" APR_INT64_T_FMT " not %" APR_INT64_T_FMT, ts[n].in, result, ts[n].result), result == ts[n].result); if (ts[n].errnum != -1) { - abts_assert(tc, + ABTS_ASSERT(tc, apr_psprintf(p, "for '%s': errno was %d not %d", ts[n].in, errnum, ts[n].errnum), ts[n].errnum == errnum); @@ -236,9 +236,9 @@ static void string_strtoi64(abts_case *tc, void *data) if (ts[n].end == NULL) { /* end must point to NUL terminator of .in */ - abts_ptr_equal(tc, ts[n].in + strlen(ts[n].in), end); + ABTS_PTR_EQUAL(tc, ts[n].in + strlen(ts[n].in), end); } else if (ts[n].end != (void *)-1) { - abts_assert(tc, + ABTS_ASSERT(tc, apr_psprintf(p, "for '%s', end was '%s' not '%s'", ts[n].in, end, ts[n].end), strcmp(ts[n].end, end) == 0); diff --git a/test/teststrnatcmp.c b/test/teststrnatcmp.c index 11d9bfca815..bd25cb31372 100644 --- a/test/teststrnatcmp.c +++ b/test/teststrnatcmp.c @@ -21,43 +21,43 @@ static void less0(abts_case *tc, void *data) { int rv = apr_strnatcmp("a", "b"); - abts_assert(tc, "didn't compare simple strings properly", rv < 0); + ABTS_ASSERT(tc, "didn't compare simple strings properly", rv < 0); } static void str_equal(abts_case *tc, void *data) { int rv = apr_strnatcmp("a", "a"); - abts_assert(tc, "didn't compare simple strings properly", rv == 0); + ABTS_ASSERT(tc, "didn't compare simple strings properly", rv == 0); } static void more0(abts_case *tc, void *data) { int rv = apr_strnatcmp("b", "a"); - abts_assert(tc, "didn't compare simple strings properly", rv > 0); + ABTS_ASSERT(tc, "didn't compare simple strings properly", rv > 0); } static void less_ignore_case(abts_case *tc, void *data) { int rv = apr_strnatcasecmp("a", "B"); - abts_assert(tc, "didn't compare simple strings properly", rv < 0); + ABTS_ASSERT(tc, "didn't compare simple strings properly", rv < 0); } static void str_equal_ignore_case(abts_case *tc, void *data) { int rv = apr_strnatcasecmp("a", "A"); - abts_assert(tc, "didn't compare simple strings properly", rv == 0); + ABTS_ASSERT(tc, "didn't compare simple strings properly", rv == 0); } static void more_ignore_case(abts_case *tc, void *data) { int rv = apr_strnatcasecmp("b", "A"); - abts_assert(tc, "didn't compare simple strings properly", rv > 0); + ABTS_ASSERT(tc, "didn't compare simple strings properly", rv > 0); } static void natcmp(abts_case *tc, void *data) { int rv = apr_strnatcasecmp("a2", "a10"); - abts_assert(tc, "didn't compare simple strings properly", rv < 0); + ABTS_ASSERT(tc, "didn't compare simple strings properly", rv < 0); } abts_suite *teststrnatcmp(abts_suite *suite) diff --git a/test/testtable.c b/test/testtable.c index 66c0c40edc6..82a0120c2f5 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -34,7 +34,7 @@ static apr_table_t *t1 = NULL; static void table_make(abts_case *tc, void *data) { t1 = apr_table_make(p, 5); - abts_ptr_notnull(tc, t1); + ABTS_PTR_NOTNULL(tc, t1); } static void table_get(abts_case *tc, void *data) @@ -43,7 +43,7 @@ static void table_get(abts_case *tc, void *data) apr_table_set(t1, "foo", "bar"); val = apr_table_get(t1, "foo"); - abts_str_equal(tc, val, "bar"); + ABTS_STR_EQUAL(tc, val, "bar"); } static void table_set(abts_case *tc, void *data) @@ -53,7 +53,7 @@ static void table_set(abts_case *tc, void *data) apr_table_set(t1, "setkey", "bar"); apr_table_set(t1, "setkey", "2ndtry"); val = apr_table_get(t1, "setkey"); - abts_str_equal(tc, val, "2ndtry"); + ABTS_STR_EQUAL(tc, val, "2ndtry"); } static void table_getnotthere(abts_case *tc, void *data) @@ -61,7 +61,7 @@ static void table_getnotthere(abts_case *tc, void *data) const char *val; val = apr_table_get(t1, "keynotthere"); - abts_ptr_equal(tc, NULL, (void *)val); + ABTS_PTR_EQUAL(tc, NULL, (void *)val); } static void table_add(abts_case *tc, void *data) @@ -71,7 +71,7 @@ static void table_add(abts_case *tc, void *data) apr_table_add(t1, "addkey", "bar"); apr_table_add(t1, "addkey", "foo"); val = apr_table_get(t1, "addkey"); - abts_str_equal(tc, val, "bar"); + ABTS_STR_EQUAL(tc, val, "bar"); } @@ -84,18 +84,18 @@ static void table_nelts(abts_case *tc, void *data) apr_table_set(t, "def", "abc"); apr_table_set(t, "foo", "zzz"); val = apr_table_get(t, "foo"); - abts_str_equal(tc, val, "zzz"); + ABTS_STR_EQUAL(tc, val, "zzz"); val = apr_table_get(t, "abc"); - abts_str_equal(tc, val, "def"); + ABTS_STR_EQUAL(tc, val, "def"); val = apr_table_get(t, "def"); - abts_str_equal(tc, val, "abc"); - abts_int_equal(tc, 3, apr_table_elts(t)->nelts); + ABTS_STR_EQUAL(tc, val, "abc"); + ABTS_INT_EQUAL(tc, 3, apr_table_elts(t)->nelts); } static void table_clear(abts_case *tc, void *data) { apr_table_clear(t1); - abts_int_equal(tc, 0, apr_table_elts(t1)->nelts); + ABTS_INT_EQUAL(tc, 0, apr_table_elts(t1)->nelts); } static void table_unset(abts_case *tc, void *data) @@ -106,11 +106,11 @@ static void table_unset(abts_case *tc, void *data) apr_table_set(t, "a", "1"); apr_table_set(t, "b", "2"); apr_table_unset(t, "b"); - abts_int_equal(tc, 1, apr_table_elts(t)->nelts); + ABTS_INT_EQUAL(tc, 1, apr_table_elts(t)->nelts); val = apr_table_get(t, "a"); - abts_str_equal(tc, val, "1"); + ABTS_STR_EQUAL(tc, val, "1"); val = apr_table_get(t, "b"); - abts_ptr_equal(tc, (void *)val, (void *)NULL); + ABTS_PTR_EQUAL(tc, (void *)val, (void *)NULL); } static void table_overlap(abts_case *tc, void *data) @@ -131,21 +131,21 @@ static void table_overlap(abts_case *tc, void *data) apr_table_addn(t2, "f", "6"); apr_table_overlap(t1, t2, APR_OVERLAP_TABLES_SET); - abts_int_equal(tc, apr_table_elts(t1)->nelts, 7); + ABTS_INT_EQUAL(tc, apr_table_elts(t1)->nelts, 7); val = apr_table_get(t1, "a"); - abts_str_equal(tc, val, "1"); + ABTS_STR_EQUAL(tc, val, "1"); val = apr_table_get(t1, "b"); - abts_str_equal(tc, val, "2."); + ABTS_STR_EQUAL(tc, val, "2."); val = apr_table_get(t1, "c"); - abts_str_equal(tc, val, "3"); + ABTS_STR_EQUAL(tc, val, "3"); val = apr_table_get(t1, "d"); - abts_str_equal(tc, val, "4"); + ABTS_STR_EQUAL(tc, val, "4"); val = apr_table_get(t1, "e"); - abts_str_equal(tc, val, "5"); + ABTS_STR_EQUAL(tc, val, "5"); val = apr_table_get(t1, "f"); - abts_str_equal(tc, val, "6"); + ABTS_STR_EQUAL(tc, val, "6"); val = apr_table_get(t1, "g"); - abts_str_equal(tc, val, "7"); + ABTS_STR_EQUAL(tc, val, "7"); } abts_suite *testtable(abts_suite *suite) diff --git a/test/testtemp.c b/test/testtemp.c index 161baa23a67..811e31bc7a2 100644 --- a/test/testtemp.c +++ b/test/testtemp.c @@ -24,7 +24,7 @@ static void test_temp_dir(abts_case *tc, void *data) rv = apr_temp_dir_get(&tempdir, p); apr_assert_success(tc, "Error finding Temporary Directory", rv); - abts_ptr_notnull(tc, tempdir); + ABTS_PTR_NOTNULL(tc, tempdir); } static void test_mktemp(abts_case *tc, void *data) diff --git a/test/testthread.c b/test/testthread.c index cb4d10a8e01..8a49e82cd1a 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -60,10 +60,10 @@ static void thread_init(abts_case *tc, void *data) apr_status_t rv; rv = apr_thread_once_init(&control, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void create_threads(abts_case *tc, void *data) @@ -71,13 +71,13 @@ static void create_threads(abts_case *tc, void *data) apr_status_t rv; rv = apr_thread_create(&t1, NULL, thread_func1, NULL, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_thread_create(&t2, NULL, thread_func1, NULL, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_thread_create(&t3, NULL, thread_func1, NULL, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_thread_create(&t4, NULL, thread_func1, NULL, p); - abts_int_equal(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void join_threads(abts_case *tc, void *data) @@ -85,30 +85,30 @@ static void join_threads(abts_case *tc, void *data) apr_status_t s; apr_thread_join(&s, t1); - abts_int_equal(tc, exit_ret_val, s); + ABTS_INT_EQUAL(tc, exit_ret_val, s); apr_thread_join(&s, t2); - abts_int_equal(tc, exit_ret_val, s); + ABTS_INT_EQUAL(tc, exit_ret_val, s); apr_thread_join(&s, t3); - abts_int_equal(tc, exit_ret_val, s); + ABTS_INT_EQUAL(tc, exit_ret_val, s); apr_thread_join(&s, t4); - abts_int_equal(tc, exit_ret_val, s); + ABTS_INT_EQUAL(tc, exit_ret_val, s); } static void check_locks(abts_case *tc, void *data) { - abts_int_equal(tc, 40000, x); + ABTS_INT_EQUAL(tc, 40000, x); } static void check_thread_once(abts_case *tc, void *data) { - abts_int_equal(tc, 1, value); + ABTS_INT_EQUAL(tc, 1, value); } #else static void threads_not_impl(abts_case *tc, void *data) { - abts_not_impl(tc, "Threads not implemented on this platform"); + ABTS_NOT_IMPL(tc, "Threads not implemented on this platform"); } #endif diff --git a/test/testtime.c b/test/testtime.c index e9392e5d57f..78a5078b25d 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -63,7 +63,7 @@ static void test_now(abts_case *tc, void *data) * that the time will be slightly off, so accept anything between -1 and * 1 second. */ - abts_assert(tc, "apr_time and OS time do not agree", + ABTS_ASSERT(tc, "apr_time and OS time do not agree", (timediff > -2) && (timediff < 2)); } @@ -74,10 +74,10 @@ static void test_gmtstr(abts_case *tc, void *data) rv = apr_time_exp_gmt(&xt, now); if (rv == APR_ENOTIMPL) { - abts_not_impl(tc, "apr_time_exp_gmt"); + ABTS_NOT_IMPL(tc, "apr_time_exp_gmt"); } - abts_true(tc, rv == APR_SUCCESS); - abts_str_equal(tc, "2002-08-14 19:05:36.186711 +0000 [257 Sat]", + ABTS_TRUE(tc, rv == APR_SUCCESS); + ABTS_STR_EQUAL(tc, "2002-08-14 19:05:36.186711 +0000 [257 Sat]", print_time(p, &xt)); } @@ -90,14 +90,14 @@ static void test_exp_lt(abts_case *tc, void *data) rv = apr_time_exp_lt(&xt, now); if (rv == APR_ENOTIMPL) { - abts_not_impl(tc, "apr_time_exp_lt"); + ABTS_NOT_IMPL(tc, "apr_time_exp_lt"); } - abts_true(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, rv == APR_SUCCESS); libc_exp = localtime(&now_secs); #define CHK_FIELD(f) \ - abts_int_equal(tc, libc_exp->f, xt.f) + ABTS_INT_EQUAL(tc, libc_exp->f, xt.f) CHK_FIELD(tm_sec); CHK_FIELD(tm_min); @@ -119,14 +119,14 @@ static void test_exp_get_gmt(abts_case *tc, void *data) apr_int64_t hr_off_64; rv = apr_time_exp_gmt(&xt, now); - abts_true(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, rv == APR_SUCCESS); rv = apr_time_exp_get(&imp, &xt); if (rv == APR_ENOTIMPL) { - abts_not_impl(tc, "apr_time_exp_get"); + ABTS_NOT_IMPL(tc, "apr_time_exp_get"); } - abts_true(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, rv == APR_SUCCESS); hr_off_64 = (apr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC; - abts_true(tc, now + hr_off_64 == imp); + ABTS_TRUE(tc, now + hr_off_64 == imp); } static void test_exp_get_lt(abts_case *tc, void *data) @@ -137,14 +137,14 @@ static void test_exp_get_lt(abts_case *tc, void *data) apr_int64_t hr_off_64; rv = apr_time_exp_lt(&xt, now); - abts_true(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, rv == APR_SUCCESS); rv = apr_time_exp_get(&imp, &xt); if (rv == APR_ENOTIMPL) { - abts_not_impl(tc, "apr_time_exp_get"); + ABTS_NOT_IMPL(tc, "apr_time_exp_get"); } - abts_true(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, rv == APR_SUCCESS); hr_off_64 = (apr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC; - abts_true(tc, now + hr_off_64 == imp); + ABTS_TRUE(tc, now + hr_off_64 == imp); } static void test_imp_gmt(abts_case *tc, void *data) @@ -154,13 +154,13 @@ static void test_imp_gmt(abts_case *tc, void *data) apr_time_t imp; rv = apr_time_exp_gmt(&xt, now); - abts_true(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, rv == APR_SUCCESS); rv = apr_time_exp_gmt_get(&imp, &xt); if (rv == APR_ENOTIMPL) { - abts_not_impl(tc, "apr_time_exp_gmt_get"); + ABTS_NOT_IMPL(tc, "apr_time_exp_gmt_get"); } - abts_true(tc, rv == APR_SUCCESS); - abts_true(tc, now == imp); + ABTS_TRUE(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, now == imp); } static void test_rfcstr(abts_case *tc, void *data) @@ -170,10 +170,10 @@ static void test_rfcstr(abts_case *tc, void *data) rv = apr_rfc822_date(str, now); if (rv == APR_ENOTIMPL) { - abts_not_impl(tc, "apr_rfc822_date"); + ABTS_NOT_IMPL(tc, "apr_rfc822_date"); } - abts_true(tc, rv == APR_SUCCESS); - abts_str_equal(tc, "Sat, 14 Sep 2002 19:05:36 GMT", str); + ABTS_TRUE(tc, rv == APR_SUCCESS); + ABTS_STR_EQUAL(tc, "Sat, 14 Sep 2002 19:05:36 GMT", str); } static void test_ctime(abts_case *tc, void *data) @@ -185,13 +185,13 @@ static void test_ctime(abts_case *tc, void *data) rv = apr_ctime(apr_str, now); if (rv == APR_ENOTIMPL) { - abts_not_impl(tc, "apr_ctime"); + ABTS_NOT_IMPL(tc, "apr_ctime"); } - abts_true(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, rv == APR_SUCCESS); strcpy(libc_str, ctime(&now_sec)); *strchr(libc_str, '\n') = '\0'; - abts_str_equal(tc, libc_str, apr_str); + ABTS_STR_EQUAL(tc, libc_str, apr_str); } static void test_strftime(abts_case *tc, void *data) @@ -205,10 +205,10 @@ static void test_strftime(abts_case *tc, void *data) str = apr_palloc(p, STR_SIZE + 1); rv = apr_strftime(str, &sz, STR_SIZE, "%R %A %d %B %Y", &xt); if (rv == APR_ENOTIMPL) { - abts_not_impl(tc, "apr_strftime"); + ABTS_NOT_IMPL(tc, "apr_strftime"); } - abts_true(tc, rv == APR_SUCCESS); - abts_str_equal(tc, "19:05 Saturday 14 September 2002", str); + ABTS_TRUE(tc, rv == APR_SUCCESS); + ABTS_STR_EQUAL(tc, "19:05 Saturday 14 September 2002", str); } static void test_strftimesmall(abts_case *tc, void *data) @@ -221,10 +221,10 @@ static void test_strftimesmall(abts_case *tc, void *data) rv = apr_time_exp_gmt(&xt, now); rv = apr_strftime(str, &sz, STR_SIZE, "%T", &xt); if (rv == APR_ENOTIMPL) { - abts_not_impl(tc, "apr_strftime"); + ABTS_NOT_IMPL(tc, "apr_strftime"); } - abts_true(tc, rv == APR_SUCCESS); - abts_str_equal(tc, "19:05:36", str); + ABTS_TRUE(tc, rv == APR_SUCCESS); + ABTS_STR_EQUAL(tc, "19:05:36", str); } static void test_exp_tz(abts_case *tc, void *data) @@ -235,10 +235,10 @@ static void test_exp_tz(abts_case *tc, void *data) rv = apr_time_exp_tz(&xt, now, hr_off); if (rv == APR_ENOTIMPL) { - abts_not_impl(tc, "apr_time_exp_tz"); + ABTS_NOT_IMPL(tc, "apr_time_exp_tz"); } - abts_true(tc, rv == APR_SUCCESS); - abts_true(tc, (xt.tm_usec == 186711) && + ABTS_TRUE(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, (xt.tm_usec == 186711) && (xt.tm_sec == 36) && (xt.tm_min == 5) && (xt.tm_hour == 14) && @@ -260,9 +260,9 @@ static void test_strftimeoffset(abts_case *tc, void *data) apr_time_exp_tz(&xt, now, hr_off); rv = apr_strftime(str, &sz, STR_SIZE, "%T", &xt); if (rv == APR_ENOTIMPL) { - abts_not_impl(tc, "apr_strftime"); + ABTS_NOT_IMPL(tc, "apr_strftime"); } - abts_true(tc, rv == APR_SUCCESS); + ABTS_TRUE(tc, rv == APR_SUCCESS); } /* 0.9.4 and earlier rejected valid dates in 2038 */ diff --git a/test/testud.c b/test/testud.c index e5e1b6e1884..357cb292498 100644 --- a/test/testud.c +++ b/test/testud.c @@ -37,7 +37,7 @@ static void set_userdata(abts_case *tc, void *data) apr_status_t rv; rv = apr_pool_userdata_set(testdata, "TEST", string_cleanup, pool); - abts_int_equal(tc, rv, APR_SUCCESS); + ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); } static void get_userdata(abts_case *tc, void *data) @@ -46,8 +46,8 @@ static void get_userdata(abts_case *tc, void *data) char *retdata; rv = apr_pool_userdata_get((void **)&retdata, "TEST", pool); - abts_int_equal(tc, rv, APR_SUCCESS); - abts_str_equal(tc, retdata, testdata); + ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); + ABTS_STR_EQUAL(tc, retdata, testdata); } static void get_nonexistkey(abts_case *tc, void *data) @@ -56,8 +56,8 @@ static void get_nonexistkey(abts_case *tc, void *data) char *retdata; rv = apr_pool_userdata_get((void **)&retdata, "DOESNTEXIST", pool); - abts_int_equal(tc, rv, APR_SUCCESS); - abts_ptr_equal(tc, retdata, NULL); + ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); + ABTS_PTR_EQUAL(tc, retdata, NULL); } static void post_pool_clear(abts_case *tc, void *data) @@ -66,8 +66,8 @@ static void post_pool_clear(abts_case *tc, void *data) char *retdata; rv = apr_pool_userdata_get((void **)&retdata, "DOESNTEXIST", pool); - abts_int_equal(tc, rv, APR_SUCCESS); - abts_ptr_equal(tc, retdata, NULL); + ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); + ABTS_PTR_EQUAL(tc, retdata, NULL); } abts_suite *testud(abts_suite *suite) diff --git a/test/testuser.c b/test/testuser.c index 58c55a37b3d..2f6cd760bb4 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -41,7 +41,7 @@ static void username(abts_case *tc, void *data) apr_assert_success(tc, "apr_uid_name_get failed", apr_uid_name_get(&uname, uid, p)); - abts_ptr_notnull(tc, uname); + ABTS_PTR_NOTNULL(tc, uname); apr_assert_success(tc, "apr_uid_get failed", apr_uid_get(&retreived_uid, &retreived_gid, uname, p)); @@ -57,10 +57,10 @@ static void username(abts_case *tc, void *data) * also return apr_gid_t values, which was bogus. */ if (!gid) { - abts_not_impl(tc, "Groups from apr_uid_current"); + ABTS_NOT_IMPL(tc, "Groups from apr_uid_current"); } else { - abts_not_impl(tc, "Groups from apr_uid_get"); + ABTS_NOT_IMPL(tc, "Groups from apr_uid_get"); } } else { @@ -84,7 +84,7 @@ static void groupname(abts_case *tc, void *data) apr_assert_success(tc, "apr_gid_name_get failed", apr_gid_name_get(&gname, gid, p)); - abts_ptr_notnull(tc, gname); + ABTS_PTR_NOTNULL(tc, gname); apr_assert_success(tc, "apr_gid_get failed", apr_gid_get(&retreived_gid, gname, p)); @@ -95,7 +95,7 @@ static void groupname(abts_case *tc, void *data) #else static void users_not_impl(abts_case *tc, void *data) { - abts_not_impl(tc, "Users not implemented on this platform"); + ABTS_NOT_IMPL(tc, "Users not implemented on this platform"); } #endif diff --git a/test/testutil.c b/test/testutil.c index 2974709cfe9..43835c15280 100644 --- a/test/testutil.c +++ b/test/testutil.c @@ -25,14 +25,14 @@ apr_pool_t *p; void apr_assert_success(abts_case* tc, const char* context, apr_status_t rv) { if (rv == APR_ENOTIMPL) { - abts_not_impl(tc, context); + ABTS_NOT_IMPL(tc, context); } if (rv != APR_SUCCESS) { char buf[STRING_MAX], ebuf[128]; sprintf(buf, "%s (%d): %s\n", context, rv, apr_strerror(rv, ebuf, sizeof ebuf)); - abts_fail(tc, buf); + ABTS_FAIL(tc, buf); } } diff --git a/test/testvsn.c b/test/testvsn.c index a6b7d8dc17f..32c0bd5b399 100644 --- a/test/testvsn.c +++ b/test/testvsn.c @@ -22,7 +22,7 @@ static void test_strings(abts_case *tc, void *data) { - abts_str_equal(tc, APR_VERSION_STRING, apr_version_string()); + ABTS_STR_EQUAL(tc, APR_VERSION_STRING, apr_version_string()); } static void test_ints(abts_case *tc, void *data) @@ -31,9 +31,9 @@ static void test_ints(abts_case *tc, void *data) apr_version(&vsn); - abts_int_equal(tc, APR_MAJOR_VERSION, vsn.major); - abts_int_equal(tc, APR_MINOR_VERSION, vsn.minor); - abts_int_equal(tc, APR_PATCH_VERSION, vsn.patch); + ABTS_INT_EQUAL(tc, APR_MAJOR_VERSION, vsn.major); + ABTS_INT_EQUAL(tc, APR_MINOR_VERSION, vsn.minor); + ABTS_INT_EQUAL(tc, APR_PATCH_VERSION, vsn.patch); } abts_suite *testvsn(abts_suite *suite) From 81b894a814f5abcce73656c41adec5e084d1833b Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 15 May 2004 19:51:50 +0000 Subject: [PATCH 4978/7878] If we can't create the shared memory segment, don't try to keep going through the test. Doing so causes a segfault to occur. Re-enable this test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65096 13f79535-47bb-0310-9956-ffa450edef68 --- test/testshm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/testshm.c b/test/testshm.c index eee09a51341..795255691e8 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -168,6 +168,9 @@ static void test_named(abts_case *tc, void *data) rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); apr_assert_success(tc, "Error allocating shared memory block", rv); + if (rv != APR_SUCCESS) { + return; + } ABTS_PTR_NOTNULL(tc, shm); retsize = apr_shm_size_get(shm); @@ -224,7 +227,7 @@ abts_suite *testshm(abts_suite *suite) #if APR_HAS_FORK abts_run_test(suite, test_anon, NULL); #endif - /* abts_run_test(suite, test_named, NULL); */ + abts_run_test(suite, test_named, NULL); #endif return suite; From a59d71c86c70f2330225301528aa3740b7b1d7ab Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 17 May 2004 20:08:15 +0000 Subject: [PATCH 4979/7878] * include/apr_file_io.h: apr_file_open has not required a NULL-initialized apr_file_t for years. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65097 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 86692ca7f71..e46449baef2 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -175,8 +175,7 @@ typedef struct apr_file_t apr_file_t; * @param perm Access permissions for file. * @param cont The pool to use. * @remark If perm is APR_OS_DEFAULT and the file is being created, appropriate - * default permissions will be used. *arg1 must point to a valid file_t, - * or NULL (in which case it will be allocated) + * default permissions will be used. */ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, apr_fileperms_t perm, From eff73c4f14d37965bd4bd0c7afa65ff520888424 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 17 May 2004 20:09:59 +0000 Subject: [PATCH 4980/7878] * include/apr_strings.h: Document that apr_strtoi64 sets errno on errors, fix a "nil". git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65098 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index 474d357512e..7934ff6cd4f 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -302,12 +302,13 @@ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); * character, followed by an optional '0x' prefix if base is 0 or 16, * followed by numeric digits appropriate for base. * @param end A pointer to the end of the valid character in buf. If - * not nil, it is set to the first invalid character in buf. + * not NULL, it is set to the first invalid character in buf. * @param base A numeric base in the range between 2 and 36 inclusive, * or 0. If base is zero, buf will be treated as base ten unless its * digits are prefixed with '0x', in which case it will be treated as * base 16. - * @return The numeric value of the string. + * @return The numeric value of the string. On overflow, errno is set + * to ERANGE. */ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base); From 7b60c01614408dd014eb32c8eef2bfacfbefa6ab Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 17 May 2004 20:14:49 +0000 Subject: [PATCH 4981/7878] * include/apr_file_io.h, include/apr_file_info.h: cont->pool conversions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65099 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 8 +++---- include/apr_file_io.h | 46 ++++++++++++++++++++--------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 6ec130d798b..74e0592bc90 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -208,10 +208,10 @@ struct apr_finfo_t { * never touched if the call fails. * @param fname The name of the file to stat. * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values - * @param cont the pool to use to allocate the new file. + * @param pool the pool to use to allocate the new file. */ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont); + apr_int32_t wanted, apr_pool_t *pool); /** @} */ /** @@ -223,11 +223,11 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * Open the specified directory. * @param new_dir The opened directory descriptor. * @param dirname The full path to the directory (use / on all systems) - * @param cont The pool to use. + * @param pool The pool to use. */ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir, const char *dirname, - apr_pool_t *cont); + apr_pool_t *pool); /** * close the specified directory. diff --git a/include/apr_file_io.h b/include/apr_file_io.h index e46449baef2..c1d32bcdf16 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -165,7 +165,7 @@ typedef struct apr_file_t apr_file_t; * level locked read/write access to support * writes across process/machines * APR_FILE_NOCLEANUP Do not register a cleanup with the pool - * passed in on the cont argument (see below). + * passed in on the pool argument (see below). * The apr_os_file_t handle in apr_file_t will not * be closed when the pool is destroyed. * APR_SENDFILE_ENABLED Open with appropriate platform semantics @@ -173,13 +173,13 @@ typedef struct apr_file_t apr_file_t; * apr_socket_sendfile does not check this flag. * * @param perm Access permissions for file. - * @param cont The pool to use. + * @param pool The pool to use. * @remark If perm is APR_OS_DEFAULT and the file is being created, appropriate * default permissions will be used. */ -APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new_file, const char *fname, - apr_int32_t flag, apr_fileperms_t perm, - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **newf, const char *fname, + apr_int32_t flag, apr_fileperms_t perm, + apr_pool_t *pool); /** * Close the specified file. @@ -190,10 +190,10 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file); /** * delete the specified file. * @param path The full path to the file (using / on all systems) - * @param cont The pool to use. + * @param pool The pool to use. * @remark If the file is open, it won't be removed until all instances are closed. */ -APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool); /** * rename the specified file. @@ -250,7 +250,7 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); /** * open standard error as an apr file pointer. * @param thefile The apr file to use as stderr. - * @param cont The pool to allocate the file out of. + * @param pool The pool to allocate the file out of. * * @remark The only reason that the apr_file_open_std* functions exist * is that you may not always have a stderr/out/in on Windows. This @@ -263,12 +263,12 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); * platforms. */ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, - apr_pool_t *cont); + apr_pool_t *pool); /** * open standard output as an apr file pointer. * @param thefile The apr file to use as stdout. - * @param cont The pool to allocate the file out of. + * @param pool The pool to allocate the file out of. * * @remark The only reason that the apr_file_open_std* functions exist * is that you may not always have a stderr/out/in on Windows. This @@ -281,12 +281,12 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, * platforms. */ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, - apr_pool_t *cont); + apr_pool_t *pool); /** * open standard input as an apr file pointer. * @param thefile The apr file to use as stdin. - * @param cont The pool to allocate the file out of. + * @param pool The pool to allocate the file out of. * * @remark The only reason that the apr_file_open_std* functions exist * is that you may not always have a stderr/out/in on Windows. This @@ -299,7 +299,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, * platforms. */ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, - apr_pool_t *cont); + apr_pool_t *pool); /** * Read data from the specified file. @@ -505,20 +505,20 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, * Create an anonymous pipe. * @param in The file descriptor to use as input to the pipe. * @param out The file descriptor to use as output from the pipe. - * @param cont The pool to operate on. + * @param pool The pool to operate on. */ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, - apr_pool_t *cont); + apr_pool_t *pool); /** * Create a named pipe. * @param filename The filename of the named pipe * @param perm The permissions for the newly created pipe. - * @param cont The pool to operate on. + * @param pool The pool to operate on. */ APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, - apr_pool_t *cont); + apr_pool_t *pool); /** * Get the timeout value for a pipe or manipulate the blocking state. @@ -620,7 +620,7 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, * APR_FILE_ATTR_HIDDEN - make the file hidden * * @param attr_mask Mask of valid bits in attributes. - * @param cont the pool to use. + * @param pool the pool to use. * @remark This function should be used in preference to explict manipulation * of the file permissions, because the operations to provide these * attributes are platform specific and may involve more than simply @@ -631,7 +631,7 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, apr_fileattrs_t attr_mask, - apr_pool_t *cont); + apr_pool_t *pool); /** * Set the mtime of the specified file. @@ -649,10 +649,10 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, * Create a new directory on the file system. * @param path the path for the directory to be created. (use / on all systems) * @param perm Permissions for the new direcoty. - * @param cont the pool to use. + * @param pool the pool to use. */ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, - apr_pool_t *cont); + apr_pool_t *pool); /** Creates a new directory on the file system, but behaves like * 'mkdir -p'. Creates intermediate directories as required. No error @@ -668,9 +668,9 @@ APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, /** * Remove directory from the file system. * @param path the path for the directory to be removed. (use / on all systems) - * @param cont the pool to use. + * @param pool the pool to use. */ -APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool); /** * get the specified file's stats. From e0fced501c542b4bcfc3a61068a7240c6b61856e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 19 May 2004 19:30:40 +0000 Subject: [PATCH 4982/7878] * build/apr_hints.m4: Don't add -lprot for *-sco3.2v5*, thanks to Martin J Evans on users@subversion. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65101 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 1 - 1 file changed, 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 9c83a47e524..43df16c139f 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -184,7 +184,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-sco3.2v5*) APR_ADDTO(CPPFLAGS, [-DSCO5 -D_REENTRANT]) - APR_ADDTO(LIBS, [-lprot]) ;; *-sco_sv*|*-SCO_SV*) APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT]) From 5c55b28be56f91ac7741234a6f87219835fec41c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 20 May 2004 14:53:21 +0000 Subject: [PATCH 4983/7878] Don't assume getnameinfo() can handle IPv4-mapped IPv6 addresses on any platforms. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Submitted by: Jeff Trawick, Joe Orton, Colm MacC�rthaigh git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65103 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++ build/apr_network.m4 | 74 -------------------------------------- configure.in | 1 - network_io/unix/sockaddr.c | 7 ++-- 4 files changed, 7 insertions(+), 79 deletions(-) diff --git a/CHANGES b/CHANGES index 5c65dcbbc6a..211431e582f 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,10 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Don't assume getnameinfo() can handle IPv4-mapped IPv6 addresses + on any platforms. + [Jeff Trawick, Joe Orton, Colm MacCárthaigh ] + *) Add new functions apr_signal_block, apr_signal_unblock to block/unblock the delivery of a particular signal. [Madhusudan Mathihalli] diff --git a/build/apr_network.m4 b/build/apr_network.m4 index ff875773f73..bf46bbf3bf7 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -174,80 +174,6 @@ if test "$ac_cv_negative_eai" = "yes"; then fi ]) -dnl -dnl check for getnameinfo() that properly resolves IPv4-mapped IPv6 addresses -dnl -dnl Darwin is known not to map them correctly -dnl -AC_DEFUN(APR_CHECK_GETNAMEINFO_IPV4_MAPPED,[ - AC_CACHE_CHECK(whether getnameinfo resolves IPv4-mapped IPv6 addresses, - ac_cv_getnameinfo_ipv4_mapped,[ - AC_TRY_RUN( [ -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif - -void main(void) { - struct sockaddr_in6 sa = {0}; - struct in_addr ipv4; -#if defined(NI_MAXHOST) - char hbuf[NI_MAXHOST]; -#else - char hbuf[256]; -#endif - unsigned int *addr32; - int error; - - ipv4.s_addr = inet_addr("127.0.0.1"); - - sa.sin6_family = AF_INET6; - sa.sin6_port = 0; - - addr32 = (unsigned int *)&sa.sin6_addr; - addr32[2] = htonl(0x0000FFFF); - addr32[3] = ipv4.s_addr; - -#ifdef SIN6_LEN - sa.sin6_len = sizeof(sa); -#endif - - error = getnameinfo((const struct sockaddr *)&sa, sizeof(sa), - hbuf, sizeof(hbuf), NULL, 0, - NI_NAMEREQD); - if (error) { - exit(1); - } else { - exit(0); - } -} -],[ - ac_cv_getnameinfo_ipv4_mapped="yes" -],[ - ac_cv_getnameinfo_ipv4_mapped="no" -],[ - ac_cv_getnameinfo_ipv4_mapped="yes" -])]) -if test "$ac_cv_getnameinfo_ipv4_mapped" = "no"; then - AC_DEFINE(GETNAMEINFO_IPV4_MAPPED_FAILS, 1, - [Define if getnameinfo does not map IPv4 address correctly]) -fi -]) - dnl dnl Checks the definition of gethostbyname_r and gethostbyaddr_r dnl which are different for glibc, solaris and assorted other operating diff --git a/configure.in b/configure.in index e5cf082c3ac..0817ff3fab9 100644 --- a/configure.in +++ b/configure.in @@ -1885,7 +1885,6 @@ else if test "x$have_sockaddr_in6" = "x1"; then if test "x$ac_cv_working_getaddrinfo" = "xyes"; then if test "x$ac_cv_working_getnameinfo" = "xyes"; then - APR_CHECK_GETNAMEINFO_IPV4_MAPPED APR_CHECK_GETADDRINFO_ADDRCONFIG have_ipv6="1" ipv6_result="yes" diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 8593725e826..fbaaeae5789 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -575,11 +575,10 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, * a numeric address string if it fails to resolve the host name; * that is *not* what we want here * - * Additionally, if we know getnameinfo() doesn't handle IPv4-mapped - * IPv6 addresses correctly, drop down to IPv4 before calling - * getnameinfo(). + * For IPv4-mapped IPv6 addresses, drop down to IPv4 before calling + * getnameinfo() to avoid getnameinfo bugs (MacOS X, glibc). */ -#ifdef GETNAMEINFO_IPV4_MAPPED_FAILS +#if APR_HAVE_IPV6 if (sockaddr->family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&sockaddr->sa.sin6.sin6_addr)) { struct apr_sockaddr_t tmpsa; From 2911d713ff7be461be03e5b54932fd73066e32c5 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 20 May 2004 23:07:45 +0000 Subject: [PATCH 4984/7878] Get the APR tests building again on NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65104 13f79535-47bb-0310-9956-ffa450edef68 --- test/nw_misc.c | 4 +++- test/nwgnuaprtest | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/test/nw_misc.c b/test/nw_misc.c index aa211ea9f45..cf68692bded 100644 --- a/test/nw_misc.c +++ b/test/nw_misc.c @@ -1,14 +1,16 @@ #include #include -#include "test_apr.h" +#include "testutil.h" void _NonAppStop( void ) { pressanykey(); } +/* static void test_not_impl(CuTest *tc) { CuNotImpl(tc, "Test not implemented on this platform yet"); } +*/ diff --git a/test/nwgnuaprtest b/test/nwgnuaprtest index ad24d83dd07..11f7e3af668 100644 --- a/test/nwgnuaprtest +++ b/test/nwgnuaprtest @@ -167,9 +167,9 @@ TARGET_lib = \ # These are the OBJ files needed to create the NLM target above. # Paths must all use the '/' character # + FILES_nlm_objs = \ - $(OBJDIR)/cutest.o \ - $(OBJDIR)/testall.o \ + $(OBJDIR)/abts.o \ $(OBJDIR)/testargs.o \ $(OBJDIR)/testatomic.o \ $(OBJDIR)/testdir.o \ @@ -191,6 +191,7 @@ FILES_nlm_objs = \ $(OBJDIR)/testnames.o \ $(OBJDIR)/testoc.o \ $(OBJDIR)/testpath.o \ + $(OBJDIR)/testpipe.o \ $(OBJDIR)/testpoll.o \ $(OBJDIR)/testpools.o \ $(OBJDIR)/testproc.o \ @@ -204,15 +205,15 @@ FILES_nlm_objs = \ $(OBJDIR)/testsockopt.o \ $(OBJDIR)/teststr.o \ $(OBJDIR)/teststrnatcmp.o \ + $(OBJDIR)/testtable.o \ $(OBJDIR)/testtemp.o \ $(OBJDIR)/testthread.o \ $(OBJDIR)/testtime.o \ - $(OBJDIR)/testtable.o \ $(OBJDIR)/testud.o \ $(OBJDIR)/testuser.o \ + $(OBJDIR)/testutil.o \ $(OBJDIR)/testvsn.o \ $(OBJDIR)/nw_misc.o \ - $(OBJDIR)/testpipe.o \ $(EOLIST) # Pending tests From b7d147f2cd78ebe479b2b816d00697e8fa578cce Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 20 May 2004 23:09:24 +0000 Subject: [PATCH 4985/7878] Check for both multiple NLM or LIB targets before allowing the compiler options to be included git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65105 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 0ed83289e42..6ac21b90b2f 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -96,6 +96,15 @@ VERSION = 1,0,0 VERSION_STR = 1.0.0 endif +ifeq "$(words $(strip $(TARGET_nlm)))" "1" +INCLUDE_BLDCMDS=1 +endif + +ifeq "$(words $(strip $(TARGET_lib)))" "1" +INCLUDE_BLDCMDS=1 +endif + +ifeq "$(INCLUDE_BLDCMDS)" "1" $(OBJDIR)/%.o: %.c $(OBJDIR)\$(NLM_NAME)_cc.opt @echo Compiling $< @@ -150,6 +159,8 @@ ifneq "$(strip $(XDEFINES))" "" @echo $(XDEFINES) >> $@ endif +endif # one target nlm + # # Rules to build libraries # From 940d8af8964219d3e3ab818954c266eb8aefac60 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 21 May 2004 22:11:27 +0000 Subject: [PATCH 4986/7878] sync with 0.9 branch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65107 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 211431e582f..587d7d1c5ce 100644 --- a/CHANGES +++ b/CHANGES @@ -7,10 +7,6 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 - *) Don't assume getnameinfo() can handle IPv4-mapped IPv6 addresses - on any platforms. - [Jeff Trawick, Joe Orton, Colm MacCárthaigh ] - *) Add new functions apr_signal_block, apr_signal_unblock to block/unblock the delivery of a particular signal. [Madhusudan Mathihalli] @@ -126,6 +122,10 @@ Changes with APR 1.0 Changes with APR 0.9.5 + *) Don't assume getnameinfo() can handle IPv4-mapped IPv6 addresses + on any platforms. + [Jeff Trawick, Joe Orton, Colm MacCárthaigh ] + *) Support setuid, setgid and sticky file permissions bits on Unix. [André Malo] From 8bcfceb39349e8a6922b1d44a1f180a095740df2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 21 May 2004 22:21:13 +0000 Subject: [PATCH 4987/7878] Fix stack overflow with IPv6 apr_socket_accept() on Win32. PR: 28471 Submitted by: inoue Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65108 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ network_io/win32/sockets.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index 587d7d1c5ce..1389d9e6d5a 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Fix stack overflow with IPv6 apr_socket_accept() on Win32. + PR 28471. [inoue ] + *) Add new functions apr_signal_block, apr_signal_unblock to block/unblock the delivery of a particular signal. [Madhusudan Mathihalli] diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 00cb9ae5616..d194a5bc0bc 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -212,7 +212,11 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *p) { SOCKET s; +#if APR_HAVE_IPV6 + struct sockaddr_storage sa; +#else struct sockaddr sa; +#endif int salen = sizeof(sock->remote_addr->sa); /* Don't allocate the memory until after we call accept. This allows From e358bec71e8d6e063f75b4aeb263e57cf89f2866 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 22 May 2004 04:36:40 +0000 Subject: [PATCH 4988/7878] OS/2: Fix incorrect return of APR_EOF when a 0 length read is requested Found while porting subversion. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65109 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 65fee785435..38855b03548 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -74,7 +74,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size *nbytes = rc == 0 ? pos - (char *)buf : 0; apr_thread_mutex_unlock(thefile->mutex); - if (*nbytes == 0 && rc == 0) { + if (*nbytes == 0 && rc == 0 && thefile->eof_hit) { return APR_EOF; } From 199a06e5a56a8aa2e524ca039407ca27e518637f Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 22 May 2004 07:26:10 +0000 Subject: [PATCH 4989/7878] OS/2: In apr_file_info_get(), flush any unwritten buffered data before querying the file's details to ensure the file size is correct. This matches the behaviour of the unix implementation & make subversion happy. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65111 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filestat.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index e32b2906cea..cafdf4f1b62 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -91,8 +91,17 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want ULONG rc; FILESTATUS3 fstatus; - if (thefile->isopen) + if (thefile->isopen) { + if (thefile->buffered) { + apr_status_t rv = apr_file_flush(thefile); + + if (rv != APR_SUCCESS) { + return rv; + } + } + rc = DosQueryFileInfo(thefile->filedes, FIL_STANDARD, &fstatus, sizeof(fstatus)); + } else rc = DosQueryPathInfo(thefile->fname, FIL_STANDARD, &fstatus, sizeof(fstatus)); From b2e881b13e6a8ee78df3eb11101aeefe34578bbe Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 23 May 2004 17:26:38 +0000 Subject: [PATCH 4990/7878] * network_io/unix/sockaddr.c (apr_getnameinfo): Use apr_uint32_t to fix build on platforms without uint32_t; use struct sockaddr_in rather than struct apr_sockaddr_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65114 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index fbaaeae5789..b44af84dad4 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -581,12 +581,11 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, #if APR_HAVE_IPV6 if (sockaddr->family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&sockaddr->sa.sin6.sin6_addr)) { - struct apr_sockaddr_t tmpsa; - tmpsa.sa.sin.sin_family = AF_INET; - tmpsa.sa.sin.sin_addr.s_addr = ((uint32_t *)sockaddr->ipaddr_ptr)[3]; + struct sockaddr_in tmpsa; + tmpsa.sin_family = AF_INET; + tmpsa.sin_addr.s_addr = ((apr_uint32_t *)sockaddr->ipaddr_ptr)[3]; - rc = getnameinfo((const struct sockaddr *)&tmpsa.sa, - sizeof(struct sockaddr_in), + rc = getnameinfo((const struct sockaddr *)&tmpsa, sizeof(tmpsa), tmphostname, sizeof(tmphostname), NULL, 0, flags != 0 ? flags : NI_NAMEREQD); } From 2cb312f249a4155c26da7892d23bffdbff71e3a5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 23 May 2004 19:51:56 +0000 Subject: [PATCH 4991/7878] Fix the output from -q. Now, there are no control characters printed when using -q mode. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65115 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/abts.c b/test/abts.c index 469a6429c77..0656b33f20b 100644 --- a/test/abts.c +++ b/test/abts.c @@ -70,8 +70,10 @@ static void end_suite(abts_suite *suite) { if (suite != NULL) { sub_suite *last = suite->tail; - fprintf(stdout, "\b"); - fflush(stdout); + if (!quiet) { + fprintf(stdout, "\b"); + fflush(stdout); + } if (last->failed == 0) { fprintf(stdout, "SUCCESS\n"); fflush(stdout); @@ -116,7 +118,8 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name) } reset_status(); - fprintf(stdout, "%s: %c", suite_name, status[curr_char]); + fprintf(stdout, "%s: ", suite_name); + update_status(); fflush(stdout); return suite; From 26bc98ae31ce89a7c04cac781e61dd4e1cfa72b4 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 24 May 2004 06:01:07 +0000 Subject: [PATCH 4992/7878] * test/testenv.c: Return after ENOTIMPL checks trigger to prevent spurious test failures since ABTS_NOT_IMPL doesn't longjmp away. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65116 13f79535-47bb-0310-9956-ffa450edef68 --- test/testenv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/testenv.c b/test/testenv.c index 6a134d3536d..0e341aa39a5 100644 --- a/test/testenv.c +++ b/test/testenv.c @@ -31,8 +31,9 @@ static void test_setenv(abts_case *tc, void *data) have_env_set = (rv != APR_ENOTIMPL); if (!have_env_set) { ABTS_NOT_IMPL(tc, "apr_env_set"); + } else { + apr_assert_success(tc, "set environment variable", rv); } - apr_assert_success(tc, "set environment variable", rv); } static void test_getenv(abts_case *tc, void *data) @@ -42,12 +43,14 @@ static void test_getenv(abts_case *tc, void *data) if (!have_env_set) { ABTS_NOT_IMPL(tc, "apr_env_set (skip test for apr_env_get)"); + return; } rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); have_env_get = (rv != APR_ENOTIMPL); if (!have_env_get) { ABTS_NOT_IMPL(tc, "apr_env_get"); + return; } apr_assert_success(tc, "get environment variable", rv); ABTS_STR_EQUAL(tc, TEST_ENVVAR_VALUE, value); @@ -60,16 +63,19 @@ static void test_delenv(abts_case *tc, void *data) if (!have_env_set) { ABTS_NOT_IMPL(tc, "apr_env_set (skip test for apr_env_delete)"); + return; } rv = apr_env_delete(TEST_ENVVAR_NAME, p); if (rv == APR_ENOTIMPL) { ABTS_NOT_IMPL(tc, "apr_env_delete"); + return; } apr_assert_success(tc, "delete environment variable", rv); if (!have_env_get) { ABTS_NOT_IMPL(tc, "apr_env_get (skip sanity check for apr_env_delete)"); + return; } rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); ABTS_INT_EQUAL(tc, APR_ENOENT, rv); From 0cdda98f3938adab295a868ce4d3913394d1b426 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 24 May 2004 06:06:20 +0000 Subject: [PATCH 4993/7878] * test/testlfs.c (PRECOND): Return after ENOTIMPL checks trigger to prevent spurious test failures since ABTS_NOT_IMPL doesn't longjmp away. (test_open): Only set 'madefile' on success. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65117 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testlfs.c b/test/testlfs.c index 5011cd218cf..d512558be0c 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -35,7 +35,7 @@ static apr_off_t eightGb = APR_INT64_C(2) << 32; static int madefile = 0; -#define PRECOND if (!madefile) ABTS_NOT_IMPL(tc, "Large file tests not enabled") +#define PRECOND if (!madefile) { ABTS_NOT_IMPL(tc, "Large file tests not enabled"); return; } #define TESTDIR "lfstests" #define TESTFILE "large.bin" @@ -73,7 +73,7 @@ static void test_open(abts_case *tc, void *data) apr_assert_success(tc, "truncate file to 8gb", rv); } - madefile = 1; + madefile = rv == APR_SUCCESS; } static void test_reopen(abts_case *tc, void *data) From 4bbd1410ad8a2bdcbc4d44bc819ded075ad629ad Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 24 May 2004 08:44:37 +0000 Subject: [PATCH 4994/7878] Fix failures/segfaults on Linux systems with IPv6 disabled: * test/testsockets.c (V6_NOT_ENABLED): New macro (tcp6_socket, udp6_socket): Call NOT_IMPL if IPv6 is not enabled. (sendto_receivefrom): Fall back to IPv4 if IPv6 is not enabled. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65118 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +----- test/testsockets.c | 48 +++++++++++++++++++++++++++++++++------------- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/STATUS b/STATUS index 3989bc893a8..577613f1737 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2004/04/09 01:36:32 $] +Last modified at [$Date: 2004/05/24 08:44:37 $] Release: @@ -68,10 +68,6 @@ CURRENT test/testall -v EXCEPTIONS: * various tests fail on Unix in VPATH builds. - * 'testsockets' will fail on some systems such as Linux where IPv6 - can be "supported" but not "enabled", and socket(PF_INET6, ...) - can fail. - * 'testipsub' will tickle an Solaris 8 getaddrinfo() IPv6 bug, causing the test to hang. Configure with --disable-ipv6 if using an unpatched Solaris 8 installation. diff --git a/test/testsockets.c b/test/testsockets.c index 15ecc9ef2a1..8035207da09 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -19,14 +19,6 @@ #include "apr_lib.h" #include "testutil.h" -#if APR_HAVE_IPV6 -#define US "::1" -#define FAMILY APR_INET6 -#else -#define US "127.0.0.1" -#define FAMILY APR_INET -#endif - #define STRLEN 21 static void tcp_socket(abts_case *tc, void *data) @@ -63,6 +55,15 @@ static void udp_socket(abts_case *tc, void *data) apr_socket_close(sock); } +/* On recent Linux systems, whilst IPv6 is always supported by glibc, + * socket(AF_INET6, ...) calls will fail with EAFNOSUPPORT if the + * "ipv6" kernel module is not loaded. */ +#ifdef EAFNOSUPPORT +#define V6_NOT_ENABLED(e) ((e) == EAFNOSUPPORT) +#else +#define V6_NOT_ENABLED(e) (0) +#endif + static void tcp6_socket(abts_case *tc, void *data) { #if APR_HAVE_IPV6 @@ -70,6 +71,10 @@ static void tcp6_socket(abts_case *tc, void *data) apr_socket_t *sock = NULL; rv = apr_socket_create(&sock, APR_INET6, SOCK_STREAM, 0, p); + if (V6_NOT_ENABLED(rv)) { + ABTS_NOT_IMPL(tc, "IPv6 not enabled"); + return; + } ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, sock); apr_socket_close(sock); @@ -85,6 +90,10 @@ static void udp6_socket(abts_case *tc, void *data) apr_socket_t *sock = NULL; rv = apr_socket_create(&sock, APR_INET6, SOCK_DGRAM, 0, p); + if (V6_NOT_ENABLED(rv)) { + ABTS_NOT_IMPL(tc, "IPv6 not enabled"); + return; + } ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, sock); apr_socket_close(sock); @@ -105,15 +114,28 @@ static void sendto_receivefrom(abts_case *tc, void *data) apr_sockaddr_t *from; apr_sockaddr_t *to; apr_size_t len = 30; + int family; + const char *addr; - rv = apr_socket_create(&sock, FAMILY, SOCK_DGRAM, 0, p); +#if APR_HAVE_IPV6 + family = APR_INET6; + addr = "::1"; + rv = apr_socket_create(&sock, family, SOCK_DGRAM, 0, p); + if (V6_NOT_ENABLED(rv)) { +#endif + family = APR_INET; + addr = "127.0.0.1"; + rv = apr_socket_create(&sock, family, SOCK_DGRAM, 0, p); +#if APR_HAVE_IPV6 + } +#endif ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_socket_create(&sock2, FAMILY, SOCK_DGRAM, 0, p); + rv = apr_socket_create(&sock2, family, SOCK_DGRAM, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_sockaddr_info_get(&to, US, APR_UNSPEC, 7772, 0, p); + rv = apr_sockaddr_info_get(&to, addr, APR_UNSPEC, 7772, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_sockaddr_info_get(&from, US, APR_UNSPEC, 7771, 0, p); + rv = apr_sockaddr_info_get(&from, addr, APR_UNSPEC, 7771, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_bind(sock, to); @@ -134,7 +156,7 @@ static void sendto_receivefrom(abts_case *tc, void *data) apr_sockaddr_ip_get(&ip_addr, from); fromport = from->port; - ABTS_STR_EQUAL(tc, US, ip_addr); + ABTS_STR_EQUAL(tc, addr, ip_addr); ABTS_INT_EQUAL(tc, 7771, fromport); apr_socket_close(sock); From a2f354a625e58470929477c0a156f14ee97a8c5f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 24 May 2004 09:19:02 +0000 Subject: [PATCH 4995/7878] * test/abts.c (abts_ptr_notnull, abts_assert, abts_true, abts_not_impl): Consistently add a newline after an error message. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65119 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/abts.c b/test/abts.c index 0656b33f20b..272da3f6409 100644 --- a/test/abts.c +++ b/test/abts.c @@ -262,7 +262,7 @@ void abts_ptr_notnull(abts_case *tc, const void *ptr, int lineno) tc->failed = TRUE; if (verbose) { - fprintf(stderr, "Line %d: Expected NULL, but saw <%p>", lineno, ptr); + fprintf(stderr, "Line %d: Expected NULL, but saw <%p>\n", lineno, ptr); fflush(stderr); } } @@ -302,7 +302,7 @@ void abts_assert(abts_case *tc, const char *message, int condition, int lineno) tc->failed = TRUE; if (verbose) { - fprintf(stderr, "Line %d: %s", lineno, message); + fprintf(stderr, "Line %d: %s\n", lineno, message); fflush(stderr); } } @@ -316,7 +316,7 @@ void abts_true(abts_case *tc, int condition, int lineno) tc->failed = TRUE; if (verbose) { - fprintf(stderr, "Line %d: Condition is false, but expected true", lineno); + fprintf(stderr, "Line %d: Condition is false, but expected true\n", lineno); fflush(stderr); } } @@ -327,7 +327,7 @@ void abts_not_impl(abts_case *tc, const char *message, int lineno) tc->suite->not_impl++; if (verbose) { - fprintf(stderr, "Line %d: %s", lineno, message); + fprintf(stderr, "Line %d: %s\n", lineno, message); fflush(stderr); } } From c0888be67160ea95366089aa1b899348c0c521f1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 24 May 2004 09:33:27 +0000 Subject: [PATCH 4996/7878] * configure.in, include/arch/win32/apr_private.h, include/arch/netware/apr_private.h: Define APR_OFF_T_STRFN. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * include/apr_strings.h, strings/apr_strings.c: Add apr_strtoff() function. * test/teststr.c (string_strtoff): Add test. Submitted by: Andr�� Malo, Joe Orton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65120 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 11 +++++++++++ include/apr_strings.h | 17 +++++++++++++++++ include/arch/netware/apr_private.h | 6 ++++++ include/arch/win32/apr_private.h | 10 ++++++++++ strings/apr_strings.c | 8 ++++++++ test/teststr.c | 15 +++++++++++++++ 7 files changed, 70 insertions(+) diff --git a/CHANGES b/CHANGES index 1389d9e6d5a..8ad43b57c74 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Add apr_strtoff() function for converting numeric strings into + apr_off_t values. [André Malo , Joe Orton] + *) Fix stack overflow with IPv6 apr_socket_accept() on Win32. PR 28471. [inoue ] diff --git a/configure.in b/configure.in index 0817ff3fab9..b25abe6eb04 100644 --- a/configure.in +++ b/configure.in @@ -1222,6 +1222,7 @@ if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then # LFS is go! off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' off_t_value='off64_t' + off_t_strfn='apr_strtoi64' elif test "${ac_cv_sizeof_off_t}x${ac_cv_sizeof_long}" = "4x4"; then # Special case: off_t may change size with _FILE_OFFSET_BITS # on 32-bit systems with LFS support. To avoid compatibility @@ -1229,16 +1230,20 @@ elif test "${ac_cv_sizeof_off_t}x${ac_cv_sizeof_long}" = "4x4"; then # hard-code apr_off_t to long. off_t_value=long off_t_fmt='#define APR_OFF_T_FMT "ld"' + off_t_strfn='strtol' elif test "$ac_cv_type_off_t" = "yes"; then off_t_value=off_t # off_t is more commonly a long than an int; prefer that case # where int and long are the same size. if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then off_t_fmt='#define APR_OFF_T_FMT "ld"' + off_t_strfn='strtol' elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then off_t_fmt='#define APR_OFF_T_FMT "d"' + off_t_strfn='strtoi' elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' + off_t_strfn='apr_strtoi64' else AC_ERROR([could not determine the size of off_t]) fi @@ -1246,6 +1251,7 @@ else # Fallback on int off_t_value=apr_int32_t off_t_fmt=d + off_t_strfn='strtoi' fi AC_MSG_RESULT($off_t_value) @@ -1346,6 +1352,11 @@ AC_SUBST(have_strstr) AC_SUBST(have_memchr) AC_SUBST(have_int64_strfn) AC_SUBST(int64_strfn) +if test "$off_t_strfn" = "apr_strtoi64" && test "$have_int64_strfn" = "1"; then + off_t_strfn=$int64_strfn +fi +AC_DEFINE_UNQUOTED(APR_OFF_T_STRFN, [$off_t_strfn], + [Define as function used for conversion of strings to apr_off_t]) dnl ----------------------------- Checking for DSO support echo "${nl}Checking for DSO..." diff --git a/include/apr_strings.h b/include/apr_strings.h index 7934ff6cd4f..c189cb6a494 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -295,6 +295,23 @@ APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n); */ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); +/** + * Convert a numeric string into an apr_off_t numeric value. + * @param offset The value of the parsed string. + * @param buf The string to parse. It may contain optional whitespace, + * followed by an optional '+' (positive, default) or '-' (negative) + * character, followed by an optional '0x' prefix if base is 0 or 16, + * followed by numeric digits appropriate for base. + * @param end A pointer to the end of the valid character in buf. If + * not NULL, it is set to the first invalid character in buf. + * @param base A numeric base in the range between 2 and 36 inclusive, + * or 0. If base is zero, buf will be treated as base ten unless its + * digits are prefixed with '0x', in which case it will be treated as + * base 16. + */ +APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *buf, + char **end, int base); + /** * parse a numeric string into a 64-bit numeric value * @param buf The string to parse. It may contain optional whitespace, diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index b24758b0389..c334509aea6 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -156,6 +156,12 @@ void* getStatCache(); #undef malloc #define malloc(x) library_malloc(gLibHandle,x) +#if APR_HAS_LARGE_FILES +#define APR_OFF_T_STRFN strtoll +#else +#define APR_OFF_T_STRFN strtol +#endif + /* * Include common private declarations. */ diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 700d853cec2..98d88b99c58 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -143,6 +143,16 @@ APR_DECLARE_DATA int errno; #define HAVE_GETNAMEINFO 1 #endif +#if APR_HAS_LARGE_FILES +#if APR_HAVE_INT64_STRFN +#define APR_OFF_T_STRFN APR_INT64_STRFN +#else +#define APR_OFF_T_STRFN apr_strtoi64 +#endif +#else +#define APR_OFF_T_STRFN strtoi +#endif + /* * Include common private declarations. */ diff --git a/strings/apr_strings.c b/strings/apr_strings.c index a88f35e0922..811599c28c0 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -233,6 +233,14 @@ void *memchr(const void *s, int c, size_t n) #define INT64_MIN (-APR_INT64_C(0x7fffffffffffffff) - APR_INT64_C(1)) #endif +APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *nptr, + char **endptr, int base) +{ + errno = 0; + *offset = APR_OFF_T_STRFN(nptr, endptr, base); + return APR_FROM_OS_ERROR(errno); +} + APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) { #if (APR_HAVE_INT64_STRFN) diff --git a/test/teststr.c b/test/teststr.c index 02ede380f96..a01bce07b9a 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -246,6 +246,20 @@ static void string_strtoi64(abts_case *tc, void *data) } } +static void string_strtoff(abts_case *tc, void *data) +{ + apr_off_t off; + + ABTS_ASSERT(tc, "strtoff fails on out-of-range integer", + apr_strtoff(&off, "999999999999999999999999999999", + NULL, 10) != APR_SUCCESS); + + ABTS_ASSERT(tc, "strtoff does not fail on 1234", + apr_strtoff(&off, "1234", NULL, 10) == APR_SUCCESS); + + ABTS_ASSERT(tc, "strtoff parsed 1234 correctly,", off == 1234); +} + abts_suite *teststr(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -257,6 +271,7 @@ abts_suite *teststr(abts_suite *suite) abts_run_test(suite, string_error, NULL); abts_run_test(suite, string_long, NULL); abts_run_test(suite, string_strtoi64, NULL); + abts_run_test(suite, string_strtoff, NULL); return suite; } From 5c4d80aadc4842d3f4ae8357fbe7815fd9ac5db8 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 24 May 2004 09:56:24 +0000 Subject: [PATCH 4997/7878] * file_io/unix/copy.c (apr_file_transfer_contents): Remove redundant NULL-initializers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65121 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index 4f990e48484..55d34dd5094 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -22,7 +22,7 @@ static apr_status_t apr_file_transfer_contents(const char *from_path, apr_fileperms_t to_perms, apr_pool_t *pool) { - apr_file_t *s = NULL, *d = NULL; /* init to null important for APR */ + apr_file_t *s, *d; apr_status_t status; apr_finfo_t finfo; apr_fileperms_t perms; From 3d5b9e708de997d065b939385d2cdbbffb509772 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 24 May 2004 12:45:29 +0000 Subject: [PATCH 4998/7878] * test/abts.c (abts_add_suite): Strip .c extension from subsuite name. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65124 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/abts.c b/test/abts.c index 272da3f6409..140ccd7e51e 100644 --- a/test/abts.c +++ b/test/abts.c @@ -89,6 +89,7 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name) { sub_suite *subsuite; curr_char = 0; + char *p; /* Only end the suite if we actually ran it */ if (suite && suite->tail &&!suite->tail->not_run) { @@ -99,7 +100,11 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name) subsuite->num_test = 0; subsuite->failed = 0; subsuite->next = NULL; - subsuite->name = suite_name; + p = strchr(suite_name, '.'); + if (p) + subsuite->name = strndup(suite_name, p - suite_name); + else + subsuite->name = suite_name; subsuite->not_run = 0; if (suite == NULL) { @@ -112,13 +117,13 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name) suite->tail = subsuite; } - if (!should_test_run(suite_name)) { + if (!should_test_run(subsuite->name)) { subsuite->not_run = 1; return suite; } reset_status(); - fprintf(stdout, "%s: ", suite_name); + fprintf(stdout, "%s: ", subsuite->name); update_status(); fflush(stdout); From 6ce769ca31c858c22d376beac531cd12c91f3dac Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 24 May 2004 12:54:25 +0000 Subject: [PATCH 4999/7878] * test/abts.c (abts_add_suite): Use calloc/memcpy rather than strndup. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65125 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/abts.c b/test/abts.c index 140ccd7e51e..fbe662e3f95 100644 --- a/test/abts.c +++ b/test/abts.c @@ -102,7 +102,8 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name) subsuite->next = NULL; p = strchr(suite_name, '.'); if (p) - subsuite->name = strndup(suite_name, p - suite_name); + subsuite->name = memcpy(calloc(p - suite_name + 1, 1), + suite_name, p - suite_name); else subsuite->name = suite_name; subsuite->not_run = 0; From 8eb36c25fd310f7a464ecae6c4726d7c2aa086ed Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 24 May 2004 14:12:11 +0000 Subject: [PATCH 5000/7878] * test/testfile.c (test_readzero): New test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65126 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/testfile.c b/test/testfile.c index 55814bd4c11..98ef42fbcba 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -90,6 +90,23 @@ static void test_read(abts_case *tc, void *data) apr_file_close(filetest); } +static void test_readzero(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_size_t nbytes = 0; + char *str = NULL; + apr_file_t *filetest; + + rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_OS_DEFAULT, p); + apr_assert_success(tc, "Opening test file " FILENAME, rv); + + rv = apr_file_read(filetest, str, &nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 0, nbytes); + + apr_file_close(filetest); +} + static void test_filename(abts_case *tc, void *data) { const char *str; @@ -536,6 +553,7 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_open_read, NULL); abts_run_test(suite, test_open_readwrite, NULL); abts_run_test(suite, test_read, NULL); + abts_run_test(suite, test_readzero, NULL); abts_run_test(suite, test_seek, NULL); abts_run_test(suite, test_filename, NULL); abts_run_test(suite, test_fileclose, NULL); From 812f5a0d755bbe2256018f9f79f39e11495927e4 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 24 May 2004 18:39:50 +0000 Subject: [PATCH 5001/7878] List all local variable first otherwise the Metrowerks compiler complains git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65127 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/abts.c b/test/abts.c index fbe662e3f95..602d12cf166 100644 --- a/test/abts.c +++ b/test/abts.c @@ -88,8 +88,8 @@ static void end_suite(abts_suite *suite) abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name) { sub_suite *subsuite; - curr_char = 0; char *p; + curr_char = 0; /* Only end the suite if we actually ran it */ if (suite && suite->tail &&!suite->tail->not_run) { From 93964d37624bcc47eac046af48db41c7b163f755 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 25 May 2004 08:07:41 +0000 Subject: [PATCH 5002/7878] * test/testlock.c (test_thread_rwlock): Catch ENOTIMPL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65128 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testlock.c b/test/testlock.c index 9fbf8c6bf11..259c5beaeeb 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -183,6 +183,10 @@ static void test_thread_rwlock(abts_case *tc, void *data) apr_status_t s1, s2, s3, s4; s1 = apr_thread_rwlock_create(&rwlock, p); + if (s1 == APR_ENOTIMPL) { + ABTS_NOT_IMPL(tc, "rwlocks not implemented"); + return; + } apr_assert_success(tc, "rwlock_create", s1); ABTS_PTR_NOTNULL(tc, rwlock); From 839fda6f9b7f677195878193f7c92343a223048f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 25 May 2004 12:46:15 +0000 Subject: [PATCH 5003/7878] * test/teststr.c (string_strtoff): Fix failure messages. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65129 13f79535-47bb-0310-9956-ffa450edef68 --- test/teststr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/teststr.c b/test/teststr.c index a01bce07b9a..a046660cb53 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -254,10 +254,10 @@ static void string_strtoff(abts_case *tc, void *data) apr_strtoff(&off, "999999999999999999999999999999", NULL, 10) != APR_SUCCESS); - ABTS_ASSERT(tc, "strtoff does not fail on 1234", + ABTS_ASSERT(tc, "strtoff failed for 1234", apr_strtoff(&off, "1234", NULL, 10) == APR_SUCCESS); - ABTS_ASSERT(tc, "strtoff parsed 1234 correctly,", off == 1234); + ABTS_ASSERT(tc, "strtoff failed to parse 1234", off == 1234); } abts_suite *teststr(abts_suite *suite) From 37ce1729aa28adaa56c587a38d4679f1767bc2b3 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 25 May 2004 22:29:33 +0000 Subject: [PATCH 5004/7878] A timeout value of 0 causes select() on NetWare to return immediately with a timeout error. So give NetWare a little time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65130 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/test/testpoll.c b/test/testpoll.c index 23a824dbd8a..0b866c618a7 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -27,6 +27,11 @@ * 64, the test will fail even though the code is correct. */ #define LARGE_NUM_SOCKETS 50 +#ifdef NETWARE +#define SOCK_TIMEOUT 1000 +#else +#define SOCK_TIMEOUT 0 +#endif static apr_socket_t *s[LARGE_NUM_SOCKETS]; static apr_sockaddr_t *sa[LARGE_NUM_SOCKETS]; @@ -314,7 +319,7 @@ static void nomessage_pollset(abts_case *tc, void *data) int lrv; const apr_pollfd_t *descs = NULL; - rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + rv = apr_pollset_poll(pollset, SOCK_TIMEOUT, &lrv, &descs); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, lrv); ABTS_PTR_EQUAL(tc, NULL, descs); @@ -327,7 +332,7 @@ static void send0_pollset(abts_case *tc, void *data) int num; send_msg(s, sa, 0, tc); - rv = apr_pollset_poll(pollset, 0, &num, &descs); + rv = apr_pollset_poll(pollset, SOCK_TIMEOUT, &num, &descs); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 1, num); ABTS_PTR_NOTNULL(tc, descs); @@ -343,7 +348,7 @@ static void recv0_pollset(abts_case *tc, void *data) const apr_pollfd_t *descs = NULL; recv_msg(s, 0, p, tc); - rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + rv = apr_pollset_poll(pollset, SOCK_TIMEOUT, &lrv, &descs); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, lrv); ABTS_PTR_EQUAL(tc, NULL, descs); @@ -357,7 +362,7 @@ static void send_middle_pollset(abts_case *tc, void *data) send_msg(s, sa, 2, tc); send_msg(s, sa, 5, tc); - rv = apr_pollset_poll(pollset, 0, &num, &descs); + rv = apr_pollset_poll(pollset, SOCK_TIMEOUT, &num, &descs); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 2, num); ABTS_PTR_NOTNULL(tc, descs); @@ -376,7 +381,7 @@ static void clear_middle_pollset(abts_case *tc, void *data) recv_msg(s, 2, p, tc); recv_msg(s, 5, p, tc); - rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + rv = apr_pollset_poll(pollset, SOCK_TIMEOUT, &lrv, &descs); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, lrv); ABTS_PTR_EQUAL(tc, NULL, descs); @@ -389,7 +394,7 @@ static void send_last_pollset(abts_case *tc, void *data) int num; send_msg(s, sa, LARGE_NUM_SOCKETS - 1, tc); - rv = apr_pollset_poll(pollset, 0, &num, &descs); + rv = apr_pollset_poll(pollset, SOCK_TIMEOUT, &num, &descs); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 1, num); ABTS_PTR_NOTNULL(tc, descs); @@ -406,7 +411,7 @@ static void clear_last_pollset(abts_case *tc, void *data) recv_msg(s, LARGE_NUM_SOCKETS - 1, p, tc); - rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + rv = apr_pollset_poll(pollset, SOCK_TIMEOUT, &lrv, &descs); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, lrv); ABTS_PTR_EQUAL(tc, NULL, descs); From 0f5562a6fc3792e8a7f6e1c0bf7f65289b13a76e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 25 May 2004 22:31:36 +0000 Subject: [PATCH 5005/7878] Build the supporting testing apps on NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65131 13f79535-47bb-0310-9956-ffa450edef68 --- test/NWGNUmakefile | 2 + test/nwgnuglobalmutexchild | 255 +++++++++++++++++++++++++++++++++++++ test/nwgnureadchild | 255 +++++++++++++++++++++++++++++++++++++ 3 files changed, 512 insertions(+) create mode 100644 test/nwgnuglobalmutexchild create mode 100644 test/nwgnureadchild diff --git a/test/NWGNUmakefile b/test/NWGNUmakefile index ac658934e8f..869a7618ea6 100644 --- a/test/NWGNUmakefile +++ b/test/NWGNUmakefile @@ -168,6 +168,8 @@ TARGET_nlm = \ $(OBJDIR)/aprtest.nlm \ $(OBJDIR)/mod_test.nlm \ $(OBJDIR)/proc_child.nlm \ + $(OBJDIR)/readchild.nlm \ + $(OBJDIR)/globalmutexchild.nlm \ $(OBJDIR)/sockchild.nlm \ $(OBJDIR)/tryread.nlm \ $(OBJDIR)/testatmc.nlm \ diff --git a/test/nwgnuglobalmutexchild b/test/nwgnuglobalmutexchild new file mode 100644 index 00000000000..8979d27a9ba --- /dev/null +++ b/test/nwgnuglobalmutexchild @@ -0,0 +1,255 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(APR_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR_WORK)/include \ + $(APR_WORK)/include/arch/NetWare \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) + +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) + + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = globalmutexchild + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = child NLM to test the global Mutex layer + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = globalmutexchild + +# +# This is used by the '-screenname' directive. If left blank, +# 'Apache for NetWare' Thread will be used. +# +NLM_SCREEN_NAME = DEFAULT + +# +# If this is specified, it will override VERSION value in +# $(APR_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = 1,0,0 + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If this is specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can +# be disabled by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# Declare all target files (you must add your files here) +# + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/globalmutexchild.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/globalmutexchild.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + Libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override the default copyright. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + diff --git a/test/nwgnureadchild b/test/nwgnureadchild new file mode 100644 index 00000000000..e539b789b28 --- /dev/null +++ b/test/nwgnureadchild @@ -0,0 +1,255 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(APR_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR_WORK)/include \ + $(APR_WORK)/include/arch/NetWare \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) + +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) + + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = readchild + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = child NLM to test the pipe layer + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = readchild + +# +# This is used by the '-screenname' directive. If left blank, +# 'Apache for NetWare' Thread will be used. +# +NLM_SCREEN_NAME = DEFAULT + +# +# If this is specified, it will override VERSION value in +# $(APR_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = 1,0,0 + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If this is specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can +# be disabled by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# Declare all target files (you must add your files here) +# + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/readchild.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/readchild.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + Libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override the default copyright. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + From 44f085590650564211be3874b459604b864fb68a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 26 May 2004 14:50:27 +0000 Subject: [PATCH 5006/7878] Reverting a NetWare timeout patch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65132 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/test/testpoll.c b/test/testpoll.c index 0b866c618a7..23a824dbd8a 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -27,11 +27,6 @@ * 64, the test will fail even though the code is correct. */ #define LARGE_NUM_SOCKETS 50 -#ifdef NETWARE -#define SOCK_TIMEOUT 1000 -#else -#define SOCK_TIMEOUT 0 -#endif static apr_socket_t *s[LARGE_NUM_SOCKETS]; static apr_sockaddr_t *sa[LARGE_NUM_SOCKETS]; @@ -319,7 +314,7 @@ static void nomessage_pollset(abts_case *tc, void *data) int lrv; const apr_pollfd_t *descs = NULL; - rv = apr_pollset_poll(pollset, SOCK_TIMEOUT, &lrv, &descs); + rv = apr_pollset_poll(pollset, 0, &lrv, &descs); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, lrv); ABTS_PTR_EQUAL(tc, NULL, descs); @@ -332,7 +327,7 @@ static void send0_pollset(abts_case *tc, void *data) int num; send_msg(s, sa, 0, tc); - rv = apr_pollset_poll(pollset, SOCK_TIMEOUT, &num, &descs); + rv = apr_pollset_poll(pollset, 0, &num, &descs); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 1, num); ABTS_PTR_NOTNULL(tc, descs); @@ -348,7 +343,7 @@ static void recv0_pollset(abts_case *tc, void *data) const apr_pollfd_t *descs = NULL; recv_msg(s, 0, p, tc); - rv = apr_pollset_poll(pollset, SOCK_TIMEOUT, &lrv, &descs); + rv = apr_pollset_poll(pollset, 0, &lrv, &descs); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, lrv); ABTS_PTR_EQUAL(tc, NULL, descs); @@ -362,7 +357,7 @@ static void send_middle_pollset(abts_case *tc, void *data) send_msg(s, sa, 2, tc); send_msg(s, sa, 5, tc); - rv = apr_pollset_poll(pollset, SOCK_TIMEOUT, &num, &descs); + rv = apr_pollset_poll(pollset, 0, &num, &descs); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 2, num); ABTS_PTR_NOTNULL(tc, descs); @@ -381,7 +376,7 @@ static void clear_middle_pollset(abts_case *tc, void *data) recv_msg(s, 2, p, tc); recv_msg(s, 5, p, tc); - rv = apr_pollset_poll(pollset, SOCK_TIMEOUT, &lrv, &descs); + rv = apr_pollset_poll(pollset, 0, &lrv, &descs); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, lrv); ABTS_PTR_EQUAL(tc, NULL, descs); @@ -394,7 +389,7 @@ static void send_last_pollset(abts_case *tc, void *data) int num; send_msg(s, sa, LARGE_NUM_SOCKETS - 1, tc); - rv = apr_pollset_poll(pollset, SOCK_TIMEOUT, &num, &descs); + rv = apr_pollset_poll(pollset, 0, &num, &descs); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 1, num); ABTS_PTR_NOTNULL(tc, descs); @@ -411,7 +406,7 @@ static void clear_last_pollset(abts_case *tc, void *data) recv_msg(s, LARGE_NUM_SOCKETS - 1, p, tc); - rv = apr_pollset_poll(pollset, SOCK_TIMEOUT, &lrv, &descs); + rv = apr_pollset_poll(pollset, 0, &lrv, &descs); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, lrv); ABTS_PTR_EQUAL(tc, NULL, descs); From 361c10ccbdb807b92bb99f0e56499a4eed806cb8 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 27 May 2004 15:49:59 +0000 Subject: [PATCH 5007/7878] * shmem/unix/shm.c (shm_cleanup_owner): Simplify error handling. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65133 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 655fca98971..8262524384e 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -45,16 +45,10 @@ static apr_status_t shm_cleanup_owner(void *m_) /* name-based shared memory */ else { #if APR_USE_SHMEM_MMAP_TMP - apr_status_t rv; - if (munmap(m->base, m->realsize) == -1) { return errno; } - rv = apr_file_remove(m->filename, m->pool); - if (rv != APR_SUCCESS) { - return rv; - } - return APR_SUCCESS; + return apr_file_remove(m->filename, m->pool); #endif #if APR_USE_SHMEM_MMAP_SHM if (munmap(m->base, m->realsize) == -1) { @@ -66,8 +60,6 @@ static apr_status_t shm_cleanup_owner(void *m_) return APR_SUCCESS; #endif #if APR_USE_SHMEM_SHMGET - apr_status_t rv; - /* Indicate that the segment is to be destroyed as soon * as all processes have detached. This also disallows any * new attachments to the segment. */ @@ -77,11 +69,7 @@ static apr_status_t shm_cleanup_owner(void *m_) if (shmdt(m->base) == -1) { return errno; } - rv = apr_file_remove(m->filename, m->pool); - if (rv != APR_SUCCESS) { - return rv; - } - return APR_SUCCESS; + return apr_file_remove(m->filename, m->pool); #endif } From c27975e0c701ec8d12d0c43e6116f9167924720c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 27 May 2004 15:52:46 +0000 Subject: [PATCH 5008/7878] * shmem/unix/shm.c (apr_shm_attach): Remove palloc->ENOMEM checking. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65134 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 8262524384e..e78ea1113d8 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -105,9 +105,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, if (filename == NULL) { #if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_MMAP_ANON new_m = apr_palloc(pool, sizeof(apr_shm_t)); - if (!new_m) { - return APR_ENOMEM; - } new_m->pool = pool; new_m->reqsize = reqsize; new_m->realsize = reqsize + @@ -168,9 +165,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #if APR_USE_SHMEM_SHMGET_ANON new_m = apr_palloc(pool, sizeof(apr_shm_t)); - if (!new_m) { - return APR_ENOMEM; - } new_m->pool = pool; new_m->reqsize = reqsize; new_m->realsize = reqsize; @@ -216,9 +210,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* Name-based shared memory */ else { new_m = apr_palloc(pool, sizeof(apr_shm_t)); - if (!new_m) { - return APR_ENOMEM; - } new_m->pool = pool; new_m->reqsize = reqsize; new_m->filename = apr_pstrdup(pool, filename); @@ -414,9 +405,6 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, apr_size_t nbytes; new_m = apr_palloc(pool, sizeof(apr_shm_t)); - if (!new_m) { - return APR_ENOMEM; - } new_m->pool = pool; new_m->filename = apr_pstrdup(pool, filename); @@ -473,9 +461,6 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, key_t shmkey; new_m = apr_palloc(pool, sizeof(apr_shm_t)); - if (!new_m) { - return APR_ENOMEM; - } /* FIXME: does APR_OS_DEFAULT matter for reading? */ status = apr_file_open(&file, filename, From 7b9aaacc953ab9addf920bd1ba2bbf4d330e0271 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 27 May 2004 16:00:05 +0000 Subject: [PATCH 5009/7878] * shmem/unix/shm.c (apr_shm_create): Answer some FIXMEs: wrong, yes, no. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65135 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index e78ea1113d8..f76d3c1809c 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -254,8 +254,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, } #endif /* APR_USE_SHMEM_MMAP_TMP */ #if APR_USE_SHMEM_MMAP_SHM - /* FIXME: Is APR_OS_DEFAULT sufficient? */ - tmpfd = shm_open(filename, O_RDWR | O_CREAT | O_EXCL, APR_OS_DEFAULT); + tmpfd = shm_open(filename, O_RDWR | O_CREAT | O_EXCL, 0644); if (tmpfd == -1) { return errno; } @@ -277,7 +276,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* FIXME: check for errors */ - /* FIXME: Is it ok to close this file when using shm_open?? */ status = apr_file_close(file); if (status != APR_SUCCESS) { return status; @@ -462,7 +460,6 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, new_m = apr_palloc(pool, sizeof(apr_shm_t)); - /* FIXME: does APR_OS_DEFAULT matter for reading? */ status = apr_file_open(&file, filename, APR_READ, APR_OS_DEFAULT, pool); if (status != APR_SUCCESS) { From 610f3bed77083b5118faac783d0aca12dba68af9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 27 May 2004 20:12:47 +0000 Subject: [PATCH 5010/7878] * Makefile.in: Rename export_vars.h to export_vars.c to fix build on SINIX, where cc -E fails on header files. PR: 29169 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65136 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index 16c065d51c8..486382d3264 100644 --- a/Makefile.in +++ b/Makefile.in @@ -32,13 +32,13 @@ TARGET_LIB = lib@APR_LIBNAME@.la # Rules for building specific targets, starting with 'all' for # building the entire package. # -TARGETS = $(TARGET_LIB) export_vars.h apr.exp +TARGETS = $(TARGET_LIB) export_vars.c apr.exp # bring in rules.mk for standard functionality @INCLUDE_RULES@ @INCLUDE_OUTPUTS@ -CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.h .make.dirs +CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ libtool apr-config build/apr_rules.mk @@ -100,15 +100,15 @@ $(TARGET_LIB): $(OBJECTS) exports.c: $(HEADERS) $(AWK) -f $(top_srcdir)/build/make_exports.awk $(HEADERS) > $@ -export_vars.h: $(HEADERS) +export_vars.c: $(HEADERS) $(AWK) -f $(top_srcdir)/build/make_var_export.awk $(HEADERS) > $@ -apr.exp: exports.c export_vars.h +apr.exp: exports.c export_vars.c @echo "#! lib@APR_LIBNAME@.so" > $@ @echo "* This file was AUTOGENERATED at build time." >> $@ @echo "* Please do not edit by hand." >> $@ $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@ - $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) export_vars.h | sed -e 's/^\#[^!]*//' | sed -e '/^$$/d' >> $@ + $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) export_vars.c | sed -e 's/^\#[^!]*//' | sed -e '/^$$/d' >> $@ dox: doxygen $(top_srcdir)/docs/doxygen.conf From da42bfc0a2585d1fa06302e101e39bc3b39cff28 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 27 May 2004 20:29:01 +0000 Subject: [PATCH 5011/7878] * include/apr_file_io.h: Doxygen/formatting/whitespace cleanups. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65137 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 220 ++++++++++++++++++++---------------------- 1 file changed, 107 insertions(+), 113 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index c1d32bcdf16..5e7f0d28266 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -113,7 +113,7 @@ extern "C" { /** File attributes */ typedef apr_uint32_t apr_fileattrs_t; -/** should be same as whence type in lseek, POSIX defines this as int */ +/** Type to pass as whence argument to apr_file_seek. */ typedef int apr_seek_where_t; /** @@ -145,7 +145,7 @@ typedef struct apr_file_t apr_file_t; /** * Open the specified file. - * @param new_file The opened file descriptor. + * @param newf The opened file descriptor. * @param fname The full path to the file (using / on all systems) * @param flag Or'ed value of: *
    @@ -174,8 +174,8 @@ typedef struct apr_file_t         apr_file_t;
      * 
    * @param perm Access permissions for file. * @param pool The pool to use. - * @remark If perm is APR_OS_DEFAULT and the file is being created, appropriate - * default permissions will be used. + * @remark If perm is APR_OS_DEFAULT and the file is being created, + * appropriate default permissions will be used. */ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **newf, const char *fname, apr_int32_t flag, apr_fileperms_t perm, @@ -188,27 +188,29 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **newf, const char *fname, APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file); /** - * delete the specified file. + * Delete the specified file. * @param path The full path to the file (using / on all systems) * @param pool The pool to use. - * @remark If the file is open, it won't be removed until all instances are closed. + * @remark If the file is open, it won't be removed until all + * instances are closed. */ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool); /** - * rename the specified file. + * Rename the specified file. * @param from_path The full path to the original file (using / on all systems) * @param to_path The full path to the new file (using / on all systems) * @param pool The pool to use. - * @warning If a file exists at the new location, then it will be overwritten. - * Moving files or directories across devices may not be possible. + * @warning If a file exists at the new location, then it will be + * overwritten. Moving files or directories across devices may not be + * possible. */ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_path, apr_pool_t *pool); /** - * copy the specified file to another file. + * Copy the specified file to another file. * @param from_path The full path to the original file (using / on all systems) * @param to_path The full path to the new file (using / on all systems) * @param perms Access permissions for the new file if it is created. @@ -225,9 +227,9 @@ APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path, apr_pool_t *pool); /** - * append the specified file to another file. - * @param from_path The full path to the source file (using / on all systems) - * @param to_path The full path to the destination file (using / on all systems) + * Append the specified file to another file. + * @param from_path The full path to the source file (use / on all systems) + * @param to_path The full path to the destination file (use / on all systems) * @param perms Access permissions for the destination file if it is created. * In place of the usual or'd combination of file permissions, the * value APR_FILE_SOURCE_PERMS may be given, in which case the source @@ -248,7 +250,7 @@ APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); /** - * open standard error as an apr file pointer. + * Open standard error as an apr file pointer. * @param thefile The apr file to use as stderr. * @param pool The pool to allocate the file out of. * @@ -256,7 +258,7 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); * is that you may not always have a stderr/out/in on Windows. This * is generally a problem with newer versions of Windows and services. * - * The other problem is that the C library functions generally work + * @remark The other problem is that the C library functions generally work * differently on Windows and Unix. So, by using apr_file_open_std* * functions, you can get a handle to an APR struct that works with * the APR functions which are supposed to work identically on all @@ -270,15 +272,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, * @param thefile The apr file to use as stdout. * @param pool The pool to allocate the file out of. * - * @remark The only reason that the apr_file_open_std* functions exist - * is that you may not always have a stderr/out/in on Windows. This - * is generally a problem with newer versions of Windows and services. - * - * The other problem is that the C library functions generally work - * differently on Windows and Unix. So, by using apr_file_open_std* - * functions, you can get a handle to an APR struct that works with - * the APR functions which are supposed to work identically on all - * platforms. + * @remark See remarks for apr_file_open_stdout. */ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *pool); @@ -288,15 +282,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, * @param thefile The apr file to use as stdin. * @param pool The pool to allocate the file out of. * - * @remark The only reason that the apr_file_open_std* functions exist - * is that you may not always have a stderr/out/in on Windows. This - * is generally a problem with newer versions of Windows and services. - * - * The other problem is that the C library functions generally work - * differently on Windows and Unix. So, by using apr_file_open_std* - * functions, you can get a handle to an APR struct that works with - * the APR functions which are supposed to work identically on all - * platforms. + * @remark See remarks for apr_file_open_stdout. */ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool); @@ -305,21 +291,21 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, * Read data from the specified file. * @param thefile The file descriptor to read from. * @param buf The buffer to store the data to. - * @param nbytes On entry, the number of bytes to read; on exit, the number of bytes read. - * @remark apr_file_read will read up to the specified number of bytes, but - * never more. If there isn't enough data to fill that number of - * bytes, all of the available data is read. The third argument is - * modified to reflect the number of bytes read. If a char was put - * back into the stream via ungetc, it will be the first character - * returned. + * @param nbytes On entry, the number of bytes to read; on exit, the number + * of bytes read. * - * It is not possible for both bytes to be read and an APR_EOF or other - * error to be returned. + * @remark apr_file_read will read up to the specified number of + * bytes, but never more. If there isn't enough data to fill that + * number of bytes, all of the available data is read. The third + * argument is modified to reflect the number of bytes read. If a + * char was put back into the stream via ungetc, it will be the first + * character returned. * - * APR_EINTR is never returned. + * @remark It is not possible for both bytes to be read and an APR_EOF + * or other error to be returned. APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, - apr_size_t *nbytes); + apr_size_t *nbytes); /** * Write data to the specified file. @@ -327,17 +313,17 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, * @param buf The buffer which contains the data. * @param nbytes On entry, the number of bytes to write; on exit, the number * of bytes written. - * @remark apr_file_write will write up to the specified number of bytes, but never - * more. If the OS cannot write that many bytes, it will write as many - * as it can. The third argument is modified to reflect the * number - * of bytes written. * - * It is possible for both bytes to be written and an error to be returned. + * @remark apr_file_write will write up to the specified number of + * bytes, but never more. If the OS cannot write that many bytes, it + * will write as many as it can. The third argument is modified to + * reflect the * number of bytes written. * - * APR_EINTR is never returned. + * @remark It is possible for both bytes to be written and an error to + * be returned. APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, - apr_size_t *nbytes); + apr_size_t *nbytes); /** * Write data from iovec array to the specified file. @@ -347,16 +333,16 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, * be smaller than APR_MAX_IOVEC_SIZE. If it isn't, the function * will fail with APR_EINVAL. * @param nbytes The number of bytes written. - * @remark It is possible for both bytes to be written and an error to be returned. - * APR_EINTR is never returned. * - * apr_file_writev is available even if the underlying operating system + * @remark It is possible for both bytes to be written and an error to + * be returned. APR_EINTR is never returned. * - * doesn't provide writev(). + * @remark apr_file_writev is available even if the underlying + * operating system doesn't provide writev(). */ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, - const struct iovec *vec, - apr_size_t nvec, apr_size_t *nbytes); + const struct iovec *vec, + apr_size_t nvec, apr_size_t *nbytes); /** * Read data from the specified file, ensuring that the buffer is filled @@ -365,21 +351,22 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, * @param buf The buffer to store the data to. * @param nbytes The number of bytes to read. * @param bytes_read If non-NULL, this will contain the number of bytes read. - * @remark apr_file_read will read up to the specified number of bytes, but never - * more. If there isn't enough data to fill that number of bytes, - * then the process/thread will block until it is available or EOF - * is reached. If a char was put back into the stream via ungetc, - * it will be the first character returned. * - * It is possible for both bytes to be read and an error to be - * returned. And if *bytes_read is less than nbytes, an - * accompanying error is _always_ returned. + * @remark apr_file_read will read up to the specified number of + * bytes, but never more. If there isn't enough data to fill that + * number of bytes, then the process/thread will block until it is + * available or EOF is reached. If a char was put back into the + * stream via ungetc, it will be the first character returned. + * + * @remark It is possible for both bytes to be read and an error to be + * returned. And if *bytes_read is less than nbytes, an accompanying + * error is _always_ returned. * - * APR_EINTR is never returned. + * @remark APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, - apr_size_t nbytes, - apr_size_t *bytes_read); + apr_size_t nbytes, + apr_size_t *bytes_read); /** * Write data to the specified file, ensuring that all of the data is @@ -387,54 +374,58 @@ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, * @param thefile The file descriptor to write to. * @param buf The buffer which contains the data. * @param nbytes The number of bytes to write. - * @param bytes_written If non-NULL, this will contain the number of bytes written. - * @remark apr_file_write will write up to the specified number of bytes, but never - * more. If the OS cannot write that many bytes, the process/thread - * will block until they can be written. Exceptional error such as - * "out of space" or "pipe closed" will terminate with an error. + * @param bytes_written If non-NULL, set to the number of bytes written. + * + * @remark apr_file_write will write up to the specified number of + * bytes, but never more. If the OS cannot write that many bytes, the + * process/thread will block until they can be written. Exceptional + * error such as "out of space" or "pipe closed" will terminate with + * an error. * - * It is possible for both bytes to be written and an error to be - * returned. And if *bytes_written is less than nbytes, an - * accompanying error is _always_ returned. + * @remark It is possible for both bytes to be written and an error to + * be returned. And if *bytes_written is less than nbytes, an + * accompanying error is _always_ returned. * - * APR_EINTR is never returned. + * @remark APR_EINTR is never returned. */ -APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, const void *buf, - apr_size_t nbytes, - apr_size_t *bytes_written); +APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, + const void *buf, + apr_size_t nbytes, + apr_size_t *bytes_written); /** - * put a character into the specified file. + * Write a character into the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to */ APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile); /** - * get a character from the specified file. + * Read a character from the specified file. * @param ch The character to read into * @param thefile The file descriptor to read from */ APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile); /** - * put a character back onto a specified stream. + * Put a character back onto a specified stream. * @param ch The character to write. * @param thefile The file descriptor to write to */ APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile); /** - * Get a string from a specified file. + * Read a string from the specified file. * @param str The buffer to store the string in. * @param len The length of the string * @param thefile The file descriptor to read from * @remark The buffer will be NUL-terminated if any characters are stored. */ -APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, + apr_file_t *thefile); /** - * Put the string into a specified file. + * Write the string into the specified file. * @param str The string to write. * @param thefile The file descriptor to write to */ @@ -447,30 +438,30 @@ APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile); APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile); /** - * duplicate the specified file descriptor. + * Duplicate the specified file descriptor. * @param new_file The structure to duplicate into. * @param old_file The file to duplicate. * @param p The pool to use for the new file. - * @remark *new_file must point to a valid apr_file_t, or point to NULL + * @remark *new_file must point to a valid apr_file_t, or point to NULL. */ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, - apr_file_t *old_file, - apr_pool_t *p); + apr_file_t *old_file, + apr_pool_t *p); /** - * duplicate the specified file descriptor and close the original + * Duplicate the specified file descriptor and close the original * @param new_file The old file that is to be closed and reused * @param old_file The file to duplicate * @param p The pool to use for the new file * - * @remark new_file MUST point at a valid apr_file_t. It cannot be NULL + * @remark new_file MUST point at a valid apr_file_t. It cannot be NULL. */ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p); /** - * move the specified file descriptor to a new pool + * Move the specified file descriptor to a new pool * @param new_file Pointer in which to return the new apr_file_t * @param old_file The file to move * @param p The pool to which the descriptor is to be moved @@ -507,7 +498,8 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, * @param out The file descriptor to use as output from the pipe. * @param pool The pool to operate on. */ -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, + apr_file_t **out, apr_pool_t *pool); /** @@ -517,8 +509,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out * @param pool The pool to operate on. */ APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, - apr_fileperms_t perm, - apr_pool_t *pool); + apr_fileperms_t perm, + apr_pool_t *pool); /** * Get the timeout value for a pipe or manipulate the blocking state. @@ -535,7 +527,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, * forever, 0 means do not wait at all. */ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, - apr_interval_time_t timeout); + apr_interval_time_t timeout); /** file (un)locking functions. */ @@ -564,8 +556,8 @@ APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile); * @param thefile The currently open file. */ APR_DECLARE(apr_status_t) apr_file_name_get(const char **new_path, - apr_file_t *thefile); - + apr_file_t *thefile); + /** * Return the data associated with the current file. * @param data The user data associated with the file. @@ -573,7 +565,7 @@ APR_DECLARE(apr_status_t) apr_file_name_get(const char **new_path, * @param file The currently open file. */ APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, - apr_file_t *file); + apr_file_t *file); /** * Set the data associated with the current file. @@ -583,8 +575,8 @@ APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, * @param cleanup The cleanup routine to use when the file is destroyed. */ APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, - const char *key, - apr_status_t (*cleanup)(void *)); + const char *key, + apr_status_t (*cleanup)(void *)); /** * Write a string to a file using a printf format. @@ -601,14 +593,16 @@ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, * set the specified file's permission bits. * @param fname The file (name) to apply the permissions to. * @param perms The permission bits to apply to the file. - * @warning Some platforms may not be able to apply all of the available - * permission bits; APR_INCOMPLETE will be returned if some permissions - * are specified which could not be set. * - * Platforms which do not implement this feature will return APR_ENOTIMPL. + * @warning Some platforms may not be able to apply all of the + * available permission bits; APR_INCOMPLETE will be returned if some + * permissions are specified which could not be set. + * + * @warning Platforms which do not implement this feature will return + * APR_ENOTIMPL. */ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, - apr_fileperms_t perms); + apr_fileperms_t perms); /** * Set attributes of the specified file. @@ -647,7 +641,7 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, /** * Create a new directory on the file system. - * @param path the path for the directory to be created. (use / on all systems) + * @param path the path for the directory to be created. (use / on all systems) * @param perm Permissions for the new direcoty. * @param pool the pool to use. */ @@ -657,7 +651,7 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, /** Creates a new directory on the file system, but behaves like * 'mkdir -p'. Creates intermediate directories as required. No error * will be reported if PATH already exists. - * @param path the path for the directory to be created. (use / on all systems) + * @param path the path for the directory to be created. (use / on all systems) * @param perm Permissions for the new direcoty. * @param pool the pool to use. */ @@ -667,7 +661,7 @@ APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, /** * Remove directory from the file system. - * @param path the path for the directory to be removed. (use / on all systems) + * @param path the path for the directory to be removed. (use / on all systems) * @param pool the pool to use. */ APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool); @@ -679,9 +673,9 @@ APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool); * @param thefile The file to get information about. */ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, - apr_int32_t wanted, - apr_file_t *thefile); - + apr_int32_t wanted, + apr_file_t *thefile); + /** * Truncate the file's length to the specified offset From 6e6205b34d90dd66603e0e9969ae6426d4bdb42a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 27 May 2004 20:34:30 +0000 Subject: [PATCH 5012/7878] * include/apr_thread_proc.h: Fix copy'n'past'o. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65138 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index ce793f6d2dc..77586910c30 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -218,7 +218,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr); /** * Set the stack size of newly created threads. * @param attr The threadattr to affect - * @param on The stack size in bytes + * @param stacksize The stack size in bytes */ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, apr_size_t stacksize); From a123aedeb7c52b74ad82f256806b4d25ac7c26f1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 27 May 2004 20:37:34 +0000 Subject: [PATCH 5013/7878] Ignore more. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65139 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cvsignore b/.cvsignore index 9ec5b6b69a9..22f7fd790ec 100644 --- a/.cvsignore +++ b/.cvsignore @@ -15,7 +15,7 @@ Release *.plg apr.exp exports.c -export_vars.h +export_vars.[ch] .libs .deps *.la From 480c561cb4741abaea20dfedc421fb3dd0d28c6f Mon Sep 17 00:00:00 2001 From: Thom May Date: Sat, 29 May 2004 23:16:38 +0000 Subject: [PATCH 5014/7878] Add pkg-config APR file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65141 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 1 + Makefile.in | 4 ++++ apr.pc.in | 14 ++++++++++++++ configure.in | 1 + 4 files changed, 20 insertions(+) create mode 100644 apr.pc.in diff --git a/.cvsignore b/.cvsignore index 22f7fd790ec..4b17e2735b6 100644 --- a/.cvsignore +++ b/.cvsignore @@ -38,3 +38,4 @@ build-outputs.mk *.bbg *.da coverage +apr.pc diff --git a/Makefile.in b/Makefile.in index 486382d3264..19a6703b03b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -70,6 +70,10 @@ install: $(TARGET_LIB) apr-config.out fi; $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(DESTDIR)$(libdir) $(LIBTOOL) --mode=install cp apr.exp $(DESTDIR)$(libdir) + if [ ! -d $(DESTDIR)$(libdir)/pkgconfig ]; then \ + $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(libdir)/pkgconfig; \ + fi; + cp -p apr.pc $(DESTDIR)$(libdir)/pkgconfig; if [ ! -d $(DESTDIR)$(installbuilddir) ]; then \ $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(installbuilddir); \ fi; diff --git a/apr.pc.in b/apr.pc.in new file mode 100644 index 00000000000..d3cbe971330 --- /dev/null +++ b/apr.pc.in @@ -0,0 +1,14 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@ +libdir=@libdir@ +datadir=@datadir@ +installbuilddir=@installbuilddir@ +APR_MAJOR_VERSION=@APR_MAJOR_VERSION@ +includedir=@includedir@ + +Name: APR +Description: The Apache Portable Runtime library +Version: @APR_DOTTED_VERSION@ +Libs: -L${libdir} -l@APR_LIBNAME@ @EXTRA_LIBS@ +Cflags: @EXTRA_CFLAGS@ -I${includedir} diff --git a/configure.in b/configure.in index b25abe6eb04..96c8a6ba846 100644 --- a/configure.in +++ b/configure.in @@ -1998,6 +1998,7 @@ AC_OUTPUT([ include/apr.h build/apr_rules.mk apr-config + apr.pc ],[ for i in $SAVE_FILES; do if cmp -s $i $i.save 2>/dev/null; then From 8d4f7c76570056c37c61d231d0847bfdfb6b1d67 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 31 May 2004 20:30:06 +0000 Subject: [PATCH 5015/7878] * Makefile.in (DISTCLEAN_TARGETS): Add apr.pc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65142 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 19a6703b03b..2da5152fe57 100644 --- a/Makefile.in +++ b/Makefile.in @@ -41,7 +41,7 @@ TARGETS = $(TARGET_LIB) export_vars.c apr.exp CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ - libtool apr-config build/apr_rules.mk + libtool apr-config build/apr_rules.mk apr.pc EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in \ build-outputs.mk build/ltcf-c.sh build/ltmain.sh build/libtool.m4 From d1abb736f7012094a000ad6c05c9e54f81b4210c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 1 Jun 2004 10:03:51 +0000 Subject: [PATCH 5016/7878] * include/apr_shm.c (apr_shm_remove): Add prototype. * shmem/unix/shm.c (apr_shm_remove): New function. * shmem/beos/shm.c, shmem/win32/shm.c, shmem/os2/shm.c (apr_shm_remove): APR_ENOTIMPL stubs. Submitted by: Amit Athavale git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65143 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_shm.h | 12 +++++++++++ shmem/beos/shm.c | 5 +++++ shmem/os2/shm.c | 6 ++++++ shmem/unix/shm.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++ shmem/win32/shm.c | 6 ++++++ test/testshm.c | 31 ++++++++++++++++++++++++++++ 7 files changed, 114 insertions(+) diff --git a/CHANGES b/CHANGES index 8ad43b57c74..011924ffaf9 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Add apr_shm_remove() function for removing a named shared + memory segment. [Amit Athavale ] + *) Add apr_strtoff() function for converting numeric strings into apr_off_t values. [André Malo , Joe Orton] diff --git a/include/apr_shm.h b/include/apr_shm.h index 3507d8450dd..64dbafe1bcd 100644 --- a/include/apr_shm.h +++ b/include/apr_shm.h @@ -69,6 +69,18 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, const char *filename, apr_pool_t *pool); +/** + * Remove shared memory segment associated with a filename. + * @param filename The filename associated with shared-memory segment which + * needs to be removed + * @param pool The pool used for file operations + * @remark This function is only supported on platforms which support + * name-based shared memory segments, and will return APR_ENOTIMPL on + * platforms without such support. + */ +APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, + apr_pool_t *pool); + /** * Destroy a shared memory segment and associated memory. * @param m The shared memory segment structure to destroy. diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index 58b1f0d8767..735be3467c6 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -69,6 +69,11 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, const char *filename, diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c index 149a8737b6c..03f381d7a74 100644 --- a/shmem/os2/shm.c +++ b/shmem/os2/shm.c @@ -61,6 +61,12 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, const char *filename, apr_pool_t *pool) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index f76d3c1809c..ec6e2b41f02 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -354,6 +354,57 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return APR_ENOTIMPL; } +APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, + apr_pool_t *pool) +{ +#if APR_USE_SHMEM_SHMGET + apr_status_t status; + apr_file_t *file; + key_t shmkey; + int shmid; +#endif + +#if APR_USE_SHMEM_MMAP_TMP + return apr_file_remove(filename, pool); +#endif +#if APR_USE_SHMEM_MMAP_SHM + if (shm_unlink(filename) == -1) { + return errno; + } + return APR_SUCCESS; +#endif +#if APR_USE_SHMEM_SHMGET + /* Presume that the file already exists; just open for writing */ + status = apr_file_open(&file, filename, APR_WRITE, + APR_OS_DEFAULT, pool); + if (status) { + return status; + } + + /* ftok() (on solaris at least) requires that the file actually + * exist before calling ftok(). */ + shmkey = ftok(filename, 1); + if (shmkey == (key_t)-1) { + return errno; + } + + if ((shmid = shmget(shmkey, 0, SHM_R | SHM_W)) < 0) { + return errno; + } + + /* Indicate that the segment is to be destroyed as soon + * as all processes have detached. This also disallows any + * new attachments to the segment. */ + if (shmctl(shmid, IPC_RMID, NULL) == -1) { + return errno; + } + return apr_file_remove(filename, pool); +#endif + + /* No support for anonymous shm */ + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) { return apr_pool_cleanup_run(m->pool, m, shm_cleanup_owner); diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index dc6d80e731d..56ddae7c5ec 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -162,6 +162,12 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) return rv; } +APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, const char *file, apr_pool_t *pool) diff --git a/test/testshm.c b/test/testshm.c index 795255691e8..d26bb289e34 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -214,6 +214,36 @@ static void test_named(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, sent, received); } + +static void test_named_remove(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_shm_t *shm; + + rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); + apr_assert_success(tc, "Error allocating shared memory block", rv); + if (rv != APR_SUCCESS) { + return; + } + ABTS_PTR_NOTNULL(tc, shm); + + rv = apr_shm_remove(SHARED_FILENAME, p); + apr_assert_success(tc, "Error removing shared memory block", rv); + if (rv != APR_SUCCESS) { + return ; + } + + rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); + apr_assert_success(tc, "Error allocating shared memory block", rv); + if (rv != APR_SUCCESS) { + return; + } + ABTS_PTR_NOTNULL(tc, shm); + + rv = apr_shm_destroy(shm); + apr_assert_success(tc, "Error destroying shared memory block", rv); +} + #endif abts_suite *testshm(abts_suite *suite) @@ -228,6 +258,7 @@ abts_suite *testshm(abts_suite *suite) abts_run_test(suite, test_anon, NULL); #endif abts_run_test(suite, test_named, NULL); + abts_run_test(suite, test_named_remove, NULL); #endif return suite; From 56062e8daffe728639ef1ab3ae0f45f134884dae Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 1 Jun 2004 17:48:21 +0000 Subject: [PATCH 5017/7878] Eliminate the redundant compiler rules Submitted by: Guenter Knauf , Brad Nicholes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65144 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 91 +++------------------------------------------------ 1 file changed, 4 insertions(+), 87 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 7b9f3b0a163..658accdc7d2 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -347,98 +347,15 @@ endif # Any specialized rules here # -$(OBJDIR)/%.o: atomic/netware/%.c $(OBJDIR)\$(NLM_NAME)_cc.opt - @echo Compiling $< - $(CC) atomic\netware\$( Date: Tue, 1 Jun 2004 19:50:14 +0000 Subject: [PATCH 5018/7878] * network_io/unix/sockaddr.c (call_resolver): Fix lookups with NULL hostname for Tru64 5.0 getaddrinfo(), which doesn't handle non-NULL servname arguments very well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65145 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index b44af84dad4..f7d0e34be80 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -309,6 +309,17 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, /* getaddrinfo according to RFC 2553 must have either hostname * or servname non-NULL. */ +#ifdef OSF1 + /* The Tru64 5.0 getaddrinfo() can only resolve services given + * by the name listed in /etc/services; a numeric or unknown + * servname gets an EAI_SERVICE error. So just resolve the + * appropriate anyaddr and fill in the port later. */ + hostname = family == AF_INET6 ? "::" : "0.0.0.0"; + servname = NULL; +#ifdef AI_NUMERICHOST + hints.ai_flags |= AI_NUMERICHOST; +#endif +#else #ifdef _AIX /* But current AIX getaddrinfo() doesn't like servname = "0"; * the "1" won't hurt since we use the port parameter to fill @@ -318,8 +329,9 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, servname = "1"; } else -#endif +#endif /* _AIX */ servname = apr_itoa(p, port); +#endif /* OSF1 */ } error = getaddrinfo(hostname, servname, &hints, &ai_list); #ifdef HAVE_GAI_ADDRCONFIG From 13d61e7a9908a7df4ca8312d7a4c5076800c6fc1 Mon Sep 17 00:00:00 2001 From: Thom May Date: Tue, 1 Jun 2004 21:51:21 +0000 Subject: [PATCH 5019/7878] clean out some unused variables git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65146 13f79535-47bb-0310-9956-ffa450edef68 --- apr.pc.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apr.pc.in b/apr.pc.in index d3cbe971330..39db911ed51 100644 --- a/apr.pc.in +++ b/apr.pc.in @@ -1,9 +1,5 @@ prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ libdir=@libdir@ -datadir=@datadir@ -installbuilddir=@installbuilddir@ APR_MAJOR_VERSION=@APR_MAJOR_VERSION@ includedir=@includedir@ From 28efa2eef61660d2a1bafd813b11b4fe1cdc2296 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 2 Jun 2004 08:27:43 +0000 Subject: [PATCH 5020/7878] * test/testsock.c (setup_socket): Return NULL if bind fails, fixing test suite hang if port 8021 is in use; all callers updated. (come back longjmp, all is forgiven). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65147 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/testsock.c b/test/testsock.c index 1489e6f1863..9853a8cc658 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -85,7 +85,8 @@ static apr_socket_t *setup_socket(abts_case *tc) rv = apr_socket_bind(sock, sa); apr_assert_success(tc, "Problem binding to port", rv); - + if (rv) return NULL; + rv = apr_socket_listen(sock, 5); apr_assert_success(tc, "Problem listening on socket", rv); @@ -97,7 +98,9 @@ static void test_create_bind_listen(abts_case *tc, void *data) apr_status_t rv; apr_socket_t *sock = setup_socket(tc); - rv = apr_socket_close(sock) ; + if (!sock) return; + + rv = apr_socket_close(sock); apr_assert_success(tc, "Problem closing socket", rv); } @@ -111,6 +114,7 @@ static void test_send(abts_case *tc, void *data) apr_size_t length; sock = setup_socket(tc); + if (!sock) return; launch_child(tc, &proc, "read", p); @@ -143,6 +147,7 @@ static void test_recv(abts_case *tc, void *data) char datastr[STRLEN]; sock = setup_socket(tc); + if (!sock) return; launch_child(tc, &proc, "write", p); @@ -175,6 +180,7 @@ static void test_timeout(abts_case *tc, void *data) int exit; sock = setup_socket(tc); + if (!sock) return; launch_child(tc, &proc, "read", p); From f1428496a86393698d39c964e3ef041b13ac4c2e Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 4 Jun 2004 08:44:15 +0000 Subject: [PATCH 5021/7878] Various test suite improvements to actually test the global mutex code with all of the available methods. abts.c: Properly strip prefix and .c extension (was broken if . character is in your path!); specify 'testfoo' rather than 'path/to/testfoo' now globalmutexchild.c: Pass along the mutex mechanism to the child via args[1]. testglobalmutex.c: Invoke test for every global mutex method available. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65148 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 10 ++++-- test/globalmutexchild.c | 13 +++++++- test/testglobalmutex.c | 68 ++++++++++++++++++++++++++++++++++------- 3 files changed, 77 insertions(+), 14 deletions(-) diff --git a/test/abts.c b/test/abts.c index 602d12cf166..f4f69d53a68 100644 --- a/test/abts.c +++ b/test/abts.c @@ -85,10 +85,11 @@ static void end_suite(abts_suite *suite) } } -abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name) +abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name_full) { sub_suite *subsuite; char *p; + const char *suite_name; curr_char = 0; /* Only end the suite if we actually ran it */ @@ -100,7 +101,12 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name) subsuite->num_test = 0; subsuite->failed = 0; subsuite->next = NULL; - p = strchr(suite_name, '.'); + /* suite_name_full is the complete path of the source code; strip out. */ + suite_name = strrchr(suite_name_full, '/') + 1; + if (!suite_name) { + suite_name = suite_name_full; + } + p = strrchr(suite_name, '.'); if (p) subsuite->name = memcpy(calloc(p - suite_name + 1, 1), suite_name, p - suite_name); diff --git a/test/globalmutexchild.c b/test/globalmutexchild.c index 34ba178db48..c4032bf4137 100644 --- a/test/globalmutexchild.c +++ b/test/globalmutexchild.c @@ -29,13 +29,24 @@ int main(int argc, const char * const argv[]) { apr_pool_t *p; int i = 0; + apr_lockmech_e mech; apr_global_mutex_t *global_lock; + apr_status_t rv; apr_initialize(); atexit(apr_terminate); apr_pool_create(&p, NULL); - apr_global_mutex_create(&global_lock, LOCKNAME, APR_LOCK_DEFAULT, p); + if (argc >= 2) { + mech = (apr_lockmech_e)apr_strtoi64(argv[1], NULL, 0); + } + else { + mech = APR_LOCK_DEFAULT; + } + rv = apr_global_mutex_create(&global_lock, LOCKNAME, mech, p); + if (rv != APR_SUCCESS) { + exit(-rv); + } apr_global_mutex_child_init(&global_lock, LOCKNAME, p); while (1) { diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index 718e729531e..08ebc39d624 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -19,10 +19,11 @@ #include "apr_errno.h" #include "testutil.h" -static void launch_child(abts_case *tc, apr_proc_t *proc, apr_pool_t *p) +static void launch_child(abts_case *tc, apr_lockmech_e mech, + apr_proc_t *proc, apr_pool_t *p) { apr_procattr_t *procattr; - const char *args[2]; + const char *args[3]; apr_status_t rv; rv = apr_procattr_create(&procattr, p); @@ -36,7 +37,8 @@ static void launch_child(abts_case *tc, apr_proc_t *proc, apr_pool_t *p) apr_assert_success(tc, "Couldn't set error check in procattr", rv); args[0] = "globalmutexchild" EXTENSION; - args[1] = NULL; + args[1] = (const char*)apr_itoa(p, (int)mech); + args[2] = NULL; rv = apr_proc_create(proc, "./globalmutexchild" EXTENSION, args, NULL, procattr, p); apr_assert_success(tc, "Couldn't launch program", rv); @@ -54,21 +56,20 @@ static int wait_child(abts_case *tc, apr_proc_t *proc) return exitcode; } -static void test_exclusive(abts_case *tc, void *data) +static void test_exclusive(abts_case *tc, void *data, apr_lockmech_e mech) { apr_proc_t p1, p2, p3, p4; apr_status_t rv; apr_global_mutex_t *global_lock; int x = 0; - rv = apr_global_mutex_create(&global_lock, LOCKNAME, APR_LOCK_DEFAULT, p); + rv = apr_global_mutex_create(&global_lock, LOCKNAME, mech, p); apr_assert_success(tc, "Error creating mutex", rv); - - launch_child(tc, &p1, p); - launch_child(tc, &p2, p); - launch_child(tc, &p3, p); - launch_child(tc, &p4, p); + launch_child(tc, mech, &p1, p); + launch_child(tc, mech, &p2, p); + launch_child(tc, mech, &p3, p); + launch_child(tc, mech, &p4, p); x += wait_child(tc, &p1); x += wait_child(tc, &p2); @@ -78,11 +79,56 @@ static void test_exclusive(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, MAX_COUNTER, x); } +static void test_exclusive_default(abts_case *tc, void *data) +{ + test_exclusive(tc, data, APR_LOCK_DEFAULT); +} + +static void test_exclusive_posixsem(abts_case *tc, void *data) +{ + test_exclusive(tc, data, APR_LOCK_POSIXSEM); +} + +static void test_exclusive_sysvsem(abts_case *tc, void *data) +{ + test_exclusive(tc, data, APR_LOCK_SYSVSEM); +} + +static void test_exclusive_proc_pthread(abts_case *tc, void *data) +{ + test_exclusive(tc, data, APR_LOCK_PROC_PTHREAD); +} + +static void test_exclusive_fcntl(abts_case *tc, void *data) +{ + test_exclusive(tc, data, APR_LOCK_FCNTL); +} + +static void test_exclusive_flock(abts_case *tc, void *data) +{ + test_exclusive(tc, data, APR_LOCK_FLOCK); +} + abts_suite *testglobalmutex(abts_suite *suite) { suite = ADD_SUITE(suite) - abts_run_test(suite, test_exclusive, NULL); + abts_run_test(suite, test_exclusive_default, NULL); +#if APR_HAS_POSIXSEM_SERIALIZE + abts_run_test(suite, test_exclusive_posixsem, NULL); +#endif +#if APR_HAS_SYSVSEM_SERIALIZE + abts_run_test(suite, test_exclusive_sysvsem, NULL); +#endif +#if APR_HAS_PROC_PTHREAD_SERIALIZE + abts_run_test(suite, test_exclusive_proc_pthread, NULL); +#endif +#if APR_HAS_FCNTL_SERIALIZE + abts_run_test(suite, test_exclusive_fcntl, NULL); +#endif +#if APR_HAS_FLOCK_SERIALIZE + abts_run_test(suite, test_exclusive_flock, NULL); +#endif return suite; } From 5161a4dfb9cfc6e5dae06d660872c3cd123b0f8e Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 4 Jun 2004 09:38:50 +0000 Subject: [PATCH 5022/7878] My rationale as to why this isn't a showstopper. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65149 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 577613f1737..8c837240973 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2004/05/24 08:44:37 $] +Last modified at [$Date: 2004/06/04 09:38:50 $] Release: @@ -35,6 +35,23 @@ RELEASE 1.0 SHOWSTOPPERS: example, sys V semaphores don't have a file to open, so the child process can't reaquire the lock. + jerenkrantz says: This is not a showstopper and I believe the above + analysis is slightly confusing. The real problem here is that + apr_*_mutex_child_init assumes a shared memory space - that is, the + children processes have access to the parent apr_*_mutex_t pointer. The + children just call child_init on the original, inherited apr_*_mutex_t. + Unlike globalmutexchild in test, apr_*_mutex_create is *not* intended to + be called from the child and subsequently call child_init. Instead, + apr_create_proc is intended to exec separate processes with disjoint + memory addresses. Currently, APR does not provide a cross-platform + mechanism for joining an already existing lock. A simple + 'apr_*_mutex_join' which is intended to be called from separate + processes to an already-existing lock would solve this problem. + child_init is not intended to be used this way. Even with SysV + semaphores, using IPC_PRIVATE should still work due to the parent-child + relationship. A strawman has been posted to dev@apr: + Message-Id: <213031CF0406DE1AC426A411@[10.0.1.137]> + * Must namespace protect all include/apr_foo.h headers. Jon Travis has especially observed these including apr within Apache-1.3. Message-ID: <20020128100116.A4288@covalent.net> From 523675f6573ee02681d197f8dd01ff91cf5c7111 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Jun 2004 11:29:03 +0000 Subject: [PATCH 5023/7878] * test/abts.c (abts_add_suite): Fix for non-absolute __FILE__ expansion; NULL + 1 != NULL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65150 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/abts.c b/test/abts.c index f4f69d53a68..edc99e276dd 100644 --- a/test/abts.c +++ b/test/abts.c @@ -101,9 +101,11 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name_full) subsuite->num_test = 0; subsuite->failed = 0; subsuite->next = NULL; - /* suite_name_full is the complete path of the source code; strip out. */ - suite_name = strrchr(suite_name_full, '/') + 1; - if (!suite_name) { + /* suite_name_full may be an absolute path depending on __FILE__ expansion */ + suite_name = strrchr(suite_name_full, '/'); + if (suite_name) { + suite_name++; + } else { suite_name = suite_name_full; } p = strrchr(suite_name, '.'); From f76da2ee0ca1e98035f8e29a23bf45b488ee16e8 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Jun 2004 11:38:46 +0000 Subject: [PATCH 5024/7878] * test/testglobalmutex.c: Fix compiler warnings. (test_exclusive): Give a useful failure message. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65151 13f79535-47bb-0310-9956-ffa450edef68 --- test/testglobalmutex.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index 08ebc39d624..bebcb20ac7c 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -16,6 +16,7 @@ #include "testglobalmutex.h" #include "apr_thread_proc.h" #include "apr_global_mutex.h" +#include "apr_strings.h" #include "apr_errno.h" #include "testutil.h" @@ -56,6 +57,20 @@ static int wait_child(abts_case *tc, apr_proc_t *proc) return exitcode; } +/* return symbolic name for a locking meechanism */ +static const char *mutexname(apr_lockmech_e mech) +{ + switch (mech) { + case APR_LOCK_FCNTL: return "fcntl"; + case APR_LOCK_FLOCK: return "flock"; + case APR_LOCK_SYSVSEM: return "sysvsem"; + case APR_LOCK_PROC_PTHREAD: return "proc_pthread"; + case APR_LOCK_POSIXSEM: return "posixsem"; + case APR_LOCK_DEFAULT: return "default"; + default: return "unknown"; + } +} + static void test_exclusive(abts_case *tc, void *data, apr_lockmech_e mech) { apr_proc_t p1, p2, p3, p4; @@ -76,7 +91,12 @@ static void test_exclusive(abts_case *tc, void *data, apr_lockmech_e mech) x += wait_child(tc, &p3); x += wait_child(tc, &p4); - ABTS_INT_EQUAL(tc, MAX_COUNTER, x); + if (x != MAX_COUNTER) { + char buf[200]; + sprintf(buf, "global mutex '%s' failed: %d not %d", + mutexname(mech), x, MAX_COUNTER); + abts_fail(tc, buf, __LINE__); + } } static void test_exclusive_default(abts_case *tc, void *data) @@ -84,30 +104,40 @@ static void test_exclusive_default(abts_case *tc, void *data) test_exclusive(tc, data, APR_LOCK_DEFAULT); } +#if APR_HAS_POSIXSEM_SERIALIZE static void test_exclusive_posixsem(abts_case *tc, void *data) { test_exclusive(tc, data, APR_LOCK_POSIXSEM); } +#endif +#if APR_HAS_SYSVSEM_SERIALIZE static void test_exclusive_sysvsem(abts_case *tc, void *data) { test_exclusive(tc, data, APR_LOCK_SYSVSEM); } +#endif +#if APR_HAS_PROC_PTHREAD_SERIALIZE static void test_exclusive_proc_pthread(abts_case *tc, void *data) { test_exclusive(tc, data, APR_LOCK_PROC_PTHREAD); } +#endif +#if APR_HAS_FCNTL_SERIALIZE static void test_exclusive_fcntl(abts_case *tc, void *data) { test_exclusive(tc, data, APR_LOCK_FCNTL); } +#endif +#if APR_HAS_FLOCK_SERIALIZE static void test_exclusive_flock(abts_case *tc, void *data) { test_exclusive(tc, data, APR_LOCK_FLOCK); } +#endif abts_suite *testglobalmutex(abts_suite *suite) { From 5b57c10b9e41c7fd741fe6ee0c5f7a0ec32c0ac1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Jun 2004 11:40:27 +0000 Subject: [PATCH 5025/7878] * test/globalmutexchild.c: Fix compiler warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65152 13f79535-47bb-0310-9956-ffa450edef68 --- test/globalmutexchild.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/globalmutexchild.c b/test/globalmutexchild.c index c4032bf4137..6c8924f1089 100644 --- a/test/globalmutexchild.c +++ b/test/globalmutexchild.c @@ -18,6 +18,7 @@ #include "apr_file_io.h" #include "apr_general.h" #include "apr_global_mutex.h" +#include "apr_strings.h" #include "apr.h" #if APR_HAVE_STDLIB_H From aacea8041087341d2955814385608fac365099e3 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Jun 2004 13:15:53 +0000 Subject: [PATCH 5026/7878] * build/apr_network.m4 (APR_CHECK_SCTP): Safer check for SCTP support and cleanup macro. PR: 28576 Submitted by: Paul Querna , Joe Orton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65153 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index bf46bbf3bf7..5d9c8e740e5 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -624,8 +624,8 @@ dnl dnl check for presence of SCTP protocol support dnl AC_DEFUN(APR_CHECK_SCTP,[ - AC_CACHE_CHECK(if SCTP protocol is supported, ac_cv_sctp,[ - AC_TRY_RUN( [ + AC_CACHE_CHECK([whether SCTP is supported], [apr_cv_sctp], [ + AC_TRY_RUN([ #ifdef HAVE_SYS_TYPES_H #include #endif @@ -635,21 +635,17 @@ AC_DEFUN(APR_CHECK_SCTP,[ #ifdef HAVE_NETINET_IN_H #include #endif +#include int main(void) { - int s = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); - if (s < 0) { - exit(1); - } + int s, opt = 1; + if ((s = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP)) < 0) + exit(1); + if (setsockopt(s, IPPROTO_SCTP, SCTP_NODELAY, &opt, sizeof(int)) < 0) + exit(2); exit(0); -} -],[ - ac_cv_sctp="yes" -],[ - ac_cv_sctp="no" -],[ - ac_cv_sctp="yes" -])]) -if test "$ac_cv_sctp" = "yes"; then +}], [apr_cv_sctp=yes], [apr_cv_sctp=no], [apr_cv_sctp=no])]) + +if test "$apr_cv_sctp" = "yes"; then have_sctp=1 else have_sctp=0 From c462812d6c6e975d4ce74126100ccdca4ef7d771 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Jun 2004 13:28:21 +0000 Subject: [PATCH 5027/7878] * include/apr_thread_proc.h: apr_proc_create() API clarification. PR: 28397 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65155 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 77586910c30..bd783bf90f0 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -525,14 +525,16 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont); * of commands. * @param attr the procattr we should use to determine how to create the new * process - * @param cont The pool to use. + * @param pool The pool to use. + * @note This function returns without waiting for the new process to terminate; + * use apr_proc_wait for that. */ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc, - const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, - apr_pool_t *cont); + const char *progname, + const char * const *args, + const char * const *env, + apr_procattr_t *attr, + apr_pool_t *pool); /** * Wait for a child process to die From 17af3dab7b6c1808fc5ffa5ccbfd08ce22e5e70a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Jun 2004 13:43:50 +0000 Subject: [PATCH 5028/7878] * include/apr_tables.h: Clarify that array push/pop work as a LIFO stack. PR: 29064 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65156 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index d4d451931d3..03e4915bfba 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -111,7 +111,7 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, int nelts, int elt_size); /** - * Add a new element to an array + * Add a new element to an array (as a first-in, last-out stack) * @param arr The array to add an element to. * @return Location for the new element in the array. * @remark If there are no free spots in the array, then this function will @@ -120,7 +120,7 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr); /** - * Remove an element from an array + * Remove an element from an array (as a first-in, last-out stack) * @param arr The array to remove an element from. * @return Location of the element in the array. * @remark If there are no elements in the array, NULL is returned. From e0cbc5b8ceb134dcb1f7372eedd235fde986b034 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Jun 2004 15:23:34 +0000 Subject: [PATCH 5029/7878] Drop racy/broken Unix nested mutex implementation; use SUSv3-style recursive mutex support if available: * build/apr_threads.m4 (APR_CHECK_PTHREAD_RECURSIVE_MUTEX): New macro. * configure.in: Use it. * include/arch/unix/apr_arch_thread_mutex.h (struct apr_thread_mutex_t): Drop nested mutex tracking fields. * locks/unix/thread_mutex.c (apr_thread_mutex_create): Return ENOTIMPL if lacking recursive mutex support, else create a recursive mutex. (apr_thread_mutex_lock, apr_thread_mutex_unlock, apr_thread_mutex_trylock): Remove nested mutex tracking. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65157 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_threads.m4 | 21 ++++ configure.in | 1 + include/arch/unix/apr_arch_thread_mutex.h | 3 - locks/unix/thread_mutex.c | 145 ++++++---------------- 4 files changed, 58 insertions(+), 112 deletions(-) diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index 1d2d2a849a5..d4c6ab558a1 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -204,3 +204,24 @@ AC_DEFUN(APR_CHECK_SIGWAIT_ONE_ARG,[ AC_DEFINE(SIGWAIT_TAKES_ONE_ARG,1,[ ]) fi ]) + +dnl Check for recursive mutex support (per SUSv3). +AC_DEFUN([APR_CHECK_PTHREAD_RECURSIVE_MUTEX], [ + AC_CACHE_CHECK([for recursive mutex support], [apr_cv_mutex_recursive], +[AC_TRY_COMPILE([#include +#include +#include ], [ + pthread_mutexattr_t attr; + pthread_mutex_t m; + + exit (pthread_mutexattr_init(&attr) + || pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) + || pthread_mutex_init(&m, &attr));], +[apr_cv_mutex_recursive=yes], [apr_cv_mutex_recursive=no], +[apr_cv_mutex_recursive=no])]) + +if test "$apr_cv_mutex_recursive" = "yes"; then + AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1, + [Define if recursive pthread mutexes are available]) +fi +]) diff --git a/configure.in b/configure.in index 96c8a6ba846..976e966a0d4 100644 --- a/configure.in +++ b/configure.in @@ -577,6 +577,7 @@ else if test "$pthreadh" = "1"; then APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG + APR_CHECK_PTHREAD_RECURSIVE_MUTEX AC_CHECK_FUNCS(pthread_key_delete pthread_rwlock_init) if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then diff --git a/include/arch/unix/apr_arch_thread_mutex.h b/include/arch/unix/apr_arch_thread_mutex.h index 0b2fb2192d3..a682b3ec953 100644 --- a/include/arch/unix/apr_arch_thread_mutex.h +++ b/include/arch/unix/apr_arch_thread_mutex.h @@ -31,9 +31,6 @@ struct apr_thread_mutex_t { apr_pool_t *pool; pthread_mutex_t mutex; - volatile apr_os_thread_t owner; - volatile apr_uint32_t owner_ref; - char nested; /* a boolean */ }; #endif diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 854213e4dd9..66de2d1962d 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -39,17 +39,37 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, { apr_thread_mutex_t *new_mutex; apr_status_t rv; + +#ifndef HAVE_PTHREAD_MUTEX_RECURSIVE + if (flags & APR_THREAD_MUTEX_NESTED) { + return APR_ENOTIMPL; + } +#endif new_mutex = apr_pcalloc(pool, sizeof(apr_thread_mutex_t)); - new_mutex->pool = pool; - /* Optimal default is APR_THREAD_MUTEX_UNNESTED, - * no additional checks required for either flag. - */ - new_mutex->nested = flags & APR_THREAD_MUTEX_NESTED; +#ifdef HAVE_PTHREAD_MUTEX_RECURSIVE + if (flags & APR_THREAD_MUTEX_NESTED) { + pthread_mutexattr_t mattr; + + rv = pthread_mutexattr_init(&mattr); + if (rv) return rv; + + rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE); + if (rv) { + pthread_mutexattr_destroy(&mattr); + return rv; + } + + rv = pthread_mutex_init(&new_mutex->mutex, &mattr); + + pthread_mutexattr_destroy(&mattr); + } else +#endif + rv = pthread_mutex_init(&new_mutex->mutex, NULL); - if ((rv = pthread_mutex_init(&new_mutex->mutex, NULL))) { + if (rv) { #ifdef PTHREAD_SETS_ERRNO rv = errno; #endif @@ -68,128 +88,35 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { apr_status_t rv; - if (mutex->nested) { - /* - * Although threadsafe, this test is NOT reentrant. - * The thread's main and reentrant attempts will both mismatch - * testing the mutex is owned by this thread, so a deadlock is expected. - */ - if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { - apr_atomic_inc32(&mutex->owner_ref); - return APR_SUCCESS; - } - - rv = pthread_mutex_lock(&mutex->mutex); - if (rv) { + rv = pthread_mutex_lock(&mutex->mutex); #ifdef PTHREAD_SETS_ERRNO - rv = errno; -#endif - return rv; - } - - if (apr_atomic_cas32(&mutex->owner_ref, 1, 0) != 0) { - /* The owner_ref should be zero when the lock is not held, - * if owner_ref was non-zero we have a mutex reference bug. - * XXX: so now what? - */ - mutex->owner_ref = 1; - } - /* Note; do not claim ownership until the owner_ref has been - * incremented; limits a subtle race in reentrant code. - */ - mutex->owner = apr_os_thread_current(); - return rv; + if (rv) { + rv = errno; } - else { - rv = pthread_mutex_lock(&mutex->mutex); -#ifdef PTHREAD_SETS_ERRNO - if (rv) { - rv = errno; - } #endif - return rv; - } + + return rv; } APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { apr_status_t rv; - if (mutex->nested) { - /* - * Although threadsafe, this test is NOT reentrant. - * The thread's main and reentrant attempts will both mismatch - * testing the mutex is owned by this thread, so one will fail - * the trylock. - */ - if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { - apr_atomic_inc32(&mutex->owner_ref); - return APR_SUCCESS; - } - - rv = pthread_mutex_trylock(&mutex->mutex); - if (rv) { -#ifdef PTHREAD_SETS_ERRNO - rv = errno; -#endif - return (rv == EBUSY) ? APR_EBUSY : rv; - } - - if (apr_atomic_cas32(&mutex->owner_ref, 1, 0) != 0) { - /* The owner_ref should be zero when the lock is not held, - * if owner_ref was non-zero we have a mutex reference bug. - * XXX: so now what? - */ - mutex->owner_ref = 1; - } - /* Note; do not claim ownership until the owner_ref has been - * incremented; limits a subtle race in reentrant code. - */ - mutex->owner = apr_os_thread_current(); - } - else { - rv = pthread_mutex_trylock(&mutex->mutex); - if (rv) { + rv = pthread_mutex_trylock(&mutex->mutex); + if (rv) { #ifdef PTHREAD_SETS_ERRNO - rv = errno; + rv = errno; #endif - return (rv == EBUSY) ? APR_EBUSY : rv; - } + return (rv == EBUSY) ? APR_EBUSY : rv; } - return rv; + return APR_SUCCESS; } -static apr_os_thread_t invalid_thread_id; /* all zeroes */ - APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { apr_status_t status; - if (mutex->nested) { - /* - * The code below is threadsafe and reentrant. - */ - if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { - /* - * This should never occur, and indicates an application error - */ - if (mutex->owner_ref == 0) { - return APR_EINVAL; - } - - if (apr_atomic_dec32(&mutex->owner_ref) != 0) - return APR_SUCCESS; - mutex->owner = invalid_thread_id; - } - /* - * This should never occur, and indicates an application error - */ - else { - return APR_EINVAL; - } - } - status = pthread_mutex_unlock(&mutex->mutex); #ifdef PTHREAD_SETS_ERRNO if (status) { From f4c410fb7e61b7b34de07ee444dc75ce2403c419 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Jun 2004 15:41:24 +0000 Subject: [PATCH 5030/7878] * build/apr_threads.m4 (APR_CHECK_PTHREAD_RECURSIVE_MUTEX): Run rather than just compile the test program. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65158 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_threads.m4 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index d4c6ab558a1..80f7f2eb67d 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -208,16 +208,18 @@ AC_DEFUN(APR_CHECK_SIGWAIT_ONE_ARG,[ dnl Check for recursive mutex support (per SUSv3). AC_DEFUN([APR_CHECK_PTHREAD_RECURSIVE_MUTEX], [ AC_CACHE_CHECK([for recursive mutex support], [apr_cv_mutex_recursive], -[AC_TRY_COMPILE([#include +[AC_TRY_RUN([#include #include -#include ], [ +#include + +int main() { pthread_mutexattr_t attr; pthread_mutex_t m; exit (pthread_mutexattr_init(&attr) || pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) - || pthread_mutex_init(&m, &attr));], -[apr_cv_mutex_recursive=yes], [apr_cv_mutex_recursive=no], + || pthread_mutex_init(&m, &attr)); +}], [apr_cv_mutex_recursive=yes], [apr_cv_mutex_recursive=no], [apr_cv_mutex_recursive=no])]) if test "$apr_cv_mutex_recursive" = "yes"; then From 7473c78bef6cebccc70664d524e4f6904d2281b2 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Jun 2004 23:07:05 +0000 Subject: [PATCH 5031/7878] * test/test_apr.h: Remove now-unused file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65159 13f79535-47bb-0310-9956-ffa450edef68 --- test/test_apr.h | 88 ------------------------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 test/test_apr.h diff --git a/test/test_apr.h b/test/test_apr.h deleted file mode 100644 index 00fd9829fef..00000000000 --- a/test/test_apr.h +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright 2000-2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef APR_TEST_INCLUDES -#define APR_TEST_INCLUDES - -#include "CuTest.h" -#include "apr_pools.h" - -/* XXX FIXME */ -#ifdef WIN32 -#define EXTENSION ".exe" -#elif NETWARE -#define EXTENSION ".nlm" -#else -#define EXTENSION -#endif - -/* Some simple functions to make the test apps easier to write and - * a bit more consistent... - */ - -extern apr_pool_t *p; - -CuSuite *getsuite(void); - -CuSuite *testatomic(void); -CuSuite *testdir(void); -CuSuite *testdso(void); -CuSuite *testdup(void); -CuSuite *testenv(void); -CuSuite *testfile(void); -CuSuite *testfilecopy(void); -CuSuite *testfileinfo(void); -CuSuite *testflock(void); -CuSuite *testfmt(void); -CuSuite *testfnmatch(void); -CuSuite *testgetopt(void); -CuSuite *testglobalmutex(void); -CuSuite *testhash(void); -CuSuite *testipsub(void); -CuSuite *testlock(void); -CuSuite *testlfs(void); -CuSuite *testmmap(void); -CuSuite *testnames(void); -CuSuite *testoc(void); -CuSuite *testpath(void); -CuSuite *testpipe(void); -CuSuite *testpoll(void); -CuSuite *testpool(void); -CuSuite *testproc(void); -CuSuite *testprocmutex(void); -CuSuite *testrand(void); -CuSuite *testrand2(void); -CuSuite *testsleep(void); -CuSuite *testshm(void); -CuSuite *testsock(void); -CuSuite *testsockets(void); -CuSuite *testsockopt(void); -CuSuite *teststr(void); -CuSuite *teststrnatcmp(void); -CuSuite *testtable(void); -CuSuite *testtemp(void); -CuSuite *testthread(void); -CuSuite *testtime(void); -CuSuite *testud(void); -CuSuite *testuser(void); -CuSuite *testvsn(void); - - -/* Assert that RV is an APR_SUCCESS value; else fail giving strerror - * for RV and CONTEXT message. */ -void apr_assert_success(CuTest* tc, const char *context, apr_status_t rv); - - -#endif /* APR_TEST_INCLUDES */ From 11c93dac835d9f119362159cb2b217f9c18522fa Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Jun 2004 23:22:00 +0000 Subject: [PATCH 5032/7878] Move APR_INT64_STRFN to apr_private.h and remove redundant APR_HAVE_INT64_STRFN macro. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * configure.in: Define APR_HAVE_INT64 macro. * include/apr.h.in, include/apr.hw, include/apr.hnw: Remove APR_INT64_STRFN, APR_HAVE_INT64_STRFN macros. * include/arch/win32/apr_private.h, include/arch/netware/apr_private.h: Define APR_INT64_STRFN (and correctly for Win32, fix from Andr��). * strings/apr_strings.c (apr_strtoi64): Just use APR_INT64_STRFN. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65160 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 12 ++++++++---- include/apr.h.in | 4 ---- include/apr.hnw | 4 ---- include/apr.hw | 10 ---------- include/arch/netware/apr_private.h | 3 +++ include/arch/win32/apr_private.h | 8 +++++++- strings/apr_strings.c | 2 +- 7 files changed, 19 insertions(+), 24 deletions(-) diff --git a/configure.in b/configure.in index 976e966a0d4..a7161dd6eb4 100644 --- a/configure.in +++ b/configure.in @@ -1336,12 +1336,17 @@ AC_CHECK_FUNCS(strcasecmp, have_strcasecmp="1", have_strcasecmp="0") AC_CHECK_FUNCS(strdup, have_strdup="1", have_strdup="0") AC_CHECK_FUNCS(strstr, have_strstr="1", have_strstr="0") AC_CHECK_FUNCS(memchr, have_memchr="1", have_memchr="0") -AC_CHECK_FUNCS($int64_strfn, have_int64_strfn="1", have_int64_strfn="0") +AC_CHECK_FUNC($int64_strfn, have_int64_strfn="1", have_int64_strfn="0") dnl ----------------------------- We have a fallback position if test "$have_int64_strfn" = "0" && test "$int64_strfn" = "strtoll"; then int64_strfn="strtoq" - AC_CHECK_FUNCS($int64_strfn, have_int64_strfn="1", have_int64_strfn="0") + AC_CHECK_FUNC(strtoq, [have_int64_strfn=1], [have_int64_strfn=0]) +fi + +if test "$have_int64_strfn" = "1"; then + AC_DEFINE_UNQUOTED(APR_INT64_STRFN, [$int64_strfn], + [Define as function which can be used for conversion of strings to apr_int64_t]) fi AC_SUBST(have_strnicmp) @@ -1351,8 +1356,7 @@ AC_SUBST(have_strcasecmp) AC_SUBST(have_strdup) AC_SUBST(have_strstr) AC_SUBST(have_memchr) -AC_SUBST(have_int64_strfn) -AC_SUBST(int64_strfn) + if test "$off_t_strfn" = "apr_strtoi64" && test "$have_int64_strfn" = "1"; then off_t_strfn=$int64_strfn fi diff --git a/include/apr.h.in b/include/apr.h.in index 32e7407ebf4..f8331fbd6f5 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -356,10 +356,6 @@ typedef @socklen_t_value@ apr_socklen_t; /* And APR_UINT64_T_HEX_FMT */ @uint64_t_hex_fmt@ -/* Deal with atoi64 variables ... these should move to apr_private.h */ -#define APR_HAVE_INT64_STRFN @have_int64_strfn@ -#define APR_INT64_STRFN @int64_strfn@ - /* Does the proc mutex lock threads too */ #define APR_PROC_MUTEX_IS_GLOBAL @proc_mutex_is_global@ diff --git a/include/apr.hnw b/include/apr.hnw index 8711d1f64b9..13a84e6d27c 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -330,10 +330,6 @@ typedef int apr_wait_t; #define APR_UINT64_T_HEX_FMT "llx" #define APR_TIME_T_FMT APR_INT64_T_FMT -/* Deal with atoi64 variables ... these should move to apr_private.h */ -#define APR_HAVE_INT64_STRFN 1 -#define APR_INT64_STRFN strtoll - /** @} */ #ifdef __cplusplus diff --git a/include/apr.hw b/include/apr.hw index 7f2a26a4d59..53ee01137bd 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -464,16 +464,6 @@ typedef int gid_t; #define APR_UINT64_T_FMT "I64u" #define APR_UINT64_T_HEX_FMT "I64x" -/* Deal with atoi64 variables ... these should move to apr_private.h */ -/* MSVC 7.0 introduced _strtoui64 */ -#if _MSC_VER >= 1300 && _INTEGRAL_MAX_BITS >= 64 -#define APR_HAVE_INT64_STRFN 1 -#define APR_INT64_STRFN _strtoui64 -#else -#define APR_HAVE_INT64_STRFN 0 -#define APR_INT64_STRFN undef -#endif - /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index c334509aea6..f41427de019 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -62,6 +62,9 @@ #define HAVE_SETENV 1 #define HAVE_UNSETENV 1 +/* 64-bit integer conversion function */ +#define APR_INT64_STRFN strtoll + /*#define DSO_USE_DLFCN */ #ifdef NW_BUILD_IPV6 diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 98d88b99c58..f5dfc7b6565 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -143,8 +143,14 @@ APR_DECLARE_DATA int errno; #define HAVE_GETNAMEINFO 1 #endif +/* Deal with atoi64 variables ... these should move to apr_private.h */ +/* MSVC 7.0 introduced _strtoui64 */ +#if _MSC_VER >= 1300 && _INTEGRAL_MAX_BITS >= 64 +#define APR_INT64_STRFN _strtoi64 +#endif + #if APR_HAS_LARGE_FILES -#if APR_HAVE_INT64_STRFN +#ifdef APR_INT64_STRFN #define APR_OFF_T_STRFN APR_INT64_STRFN #else #define APR_OFF_T_STRFN apr_strtoi64 diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 811599c28c0..ddf43ba1057 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -243,7 +243,7 @@ APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *nptr, APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) { -#if (APR_HAVE_INT64_STRFN) +#ifdef APR_INT64_STRFN return APR_INT64_STRFN(nptr, endptr, base); #else const char *s; From 00ea4e9381492c7051fe765268eba7fcd7c7d762 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Jun 2004 23:26:02 +0000 Subject: [PATCH 5033/7878] Update the comment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65161 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_private.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index f5dfc7b6565..de23360b3cd 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -143,8 +143,7 @@ APR_DECLARE_DATA int errno; #define HAVE_GETNAMEINFO 1 #endif -/* Deal with atoi64 variables ... these should move to apr_private.h */ -/* MSVC 7.0 introduced _strtoui64 */ +/* MSVC 7.0 introduced _strtoi64 */ #if _MSC_VER >= 1300 && _INTEGRAL_MAX_BITS >= 64 #define APR_INT64_STRFN _strtoi64 #endif From 6b383b641957bfa2b4f948b32f186035f30dad2b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 5 Jun 2004 11:24:05 +0000 Subject: [PATCH 5034/7878] * locks/unix/proc_mutex.c (proc_mutex_flock_child_init): If open() fails in a child, the lock file should not be unlink()ed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65162 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 1 - 1 file changed, 1 deletion(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index b8b9ceaccb0..87312408320 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -654,7 +654,6 @@ static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, APR_WRITE, 0, new_mutex->pool); if (rv != APR_SUCCESS) { - proc_mutex_flock_cleanup(new_mutex); return rv; } *mutex = new_mutex; From 69b40730fe1fa24bbf8af89ab47201a5b6233c0b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 5 Jun 2004 11:39:03 +0000 Subject: [PATCH 5035/7878] * locks/unix/proc_mutex.c (proc_mutex_no_child_init): Use single noop _child_init function. (proc_mutex_posix_setup, proc_mutex_proc_pthread_setup, proc_mutex_flock_setup): Remove empty functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65163 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 66 ++++++++++------------------------------- 1 file changed, 15 insertions(+), 51 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 87312408320..666df393fb4 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -28,16 +28,22 @@ static apr_status_t proc_mutex_no_tryacquire(apr_proc_mutex_t *new_mutex) return APR_ENOTIMPL; } +#if APR_HAS_POSIXSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || \ + APR_HAS_PROC_PTHREAD_SERIALIZE || APR_HAS_SYSVSEM_SERIALIZE +static apr_status_t proc_mutex_no_child_init(apr_proc_mutex_t **mutex, + apr_pool_t *cont, + const char *fname) +{ + return APR_SUCCESS; +} +#endif + #if APR_HAS_POSIXSEM_SERIALIZE #ifndef SEM_FAILED #define SEM_FAILED (-1) #endif -static void proc_mutex_posix_setup(void) -{ -} - static apr_status_t proc_mutex_posix_cleanup(void *mutex_) { apr_proc_mutex_t *mutex=mutex_; @@ -137,13 +143,6 @@ static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_posix_child_init(apr_proc_mutex_t **mutex, - apr_pool_t *cont, - const char *fname) -{ - return APR_SUCCESS; -} - const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_posix_methods = { #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(POSIXSEM_IS_GLOBAL) @@ -156,7 +155,7 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_posix_methods = proc_mutex_no_tryacquire, proc_mutex_posix_release, proc_mutex_posix_cleanup, - proc_mutex_posix_child_init, + proc_mutex_no_child_init, "posixsem" }; @@ -244,11 +243,6 @@ static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_sysv_child_init(apr_proc_mutex_t **mutex, apr_pool_t *cont, const char *fname) -{ - return APR_SUCCESS; -} - const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods = { #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(SYSVSEM_IS_GLOBAL) @@ -261,7 +255,7 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods = proc_mutex_no_tryacquire, proc_mutex_sysv_release, proc_mutex_sysv_cleanup, - proc_mutex_sysv_child_init, + proc_mutex_no_child_init, "sysvsem" }; @@ -269,10 +263,6 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods = #if APR_HAS_PROC_PTHREAD_SERIALIZE -static void proc_mutex_proc_pthread_setup(void) -{ -} - static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_) { apr_proc_mutex_t *mutex=mutex_; @@ -409,13 +399,6 @@ static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_proc_pthread_child_init(apr_proc_mutex_t **mutex, - apr_pool_t *cont, - const char *fname) -{ - return APR_SUCCESS; -} - const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_proc_pthread_methods = { APR_PROCESS_LOCK_MECH_IS_GLOBAL, @@ -424,7 +407,7 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_proc_pthread_method proc_mutex_no_tryacquire, proc_mutex_proc_pthread_release, proc_mutex_proc_pthread_cleanup, - proc_mutex_proc_pthread_child_init, + proc_mutex_no_child_init, "pthread" }; @@ -528,13 +511,6 @@ static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_fcntl_child_init(apr_proc_mutex_t **mutex, - apr_pool_t *pool, - const char *fname) -{ - return APR_SUCCESS; -} - const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods = { #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(FCNTL_IS_GLOBAL) @@ -547,7 +523,7 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods = proc_mutex_no_tryacquire, proc_mutex_fcntl_release, proc_mutex_fcntl_cleanup, - proc_mutex_fcntl_child_init, + proc_mutex_no_child_init, "fcntl" }; @@ -557,10 +533,6 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods = static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *); -static void proc_mutex_flock_setup(void) -{ -} - static apr_status_t proc_mutex_flock_cleanup(void *mutex_) { apr_status_t status; @@ -680,21 +652,13 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_flock_methods = void apr_proc_mutex_unix_setup_lock(void) { -#if APR_HAS_POSIXSEM_SERIALIZE - proc_mutex_posix_setup(); -#endif + /* setup only needed for sysvsem and fnctl */ #if APR_HAS_SYSVSEM_SERIALIZE proc_mutex_sysv_setup(); #endif -#if APR_HAS_PROC_PTHREAD_SERIALIZE - proc_mutex_proc_pthread_setup(); -#endif #if APR_HAS_FCNTL_SERIALIZE proc_mutex_fcntl_setup(); #endif -#if APR_HAS_FLOCK_SERIALIZE - proc_mutex_flock_setup(); -#endif } static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lockmech_e mech) From 824c690b198969f6cf81365b877755a7b0523135 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 5 Jun 2004 11:52:43 +0000 Subject: [PATCH 5036/7878] * configure.in, include/arch/unix/apr_arch_proc_mutex.h, include/apr.h.in: Remove unimplemented "rwlock" serialization definitions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65164 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 -- include/apr.h.in | 1 - include/arch/unix/apr_arch_proc_mutex.h | 4 ---- 3 files changed, 7 deletions(-) diff --git a/configure.in b/configure.in index a7161dd6eb4..ddead0505a4 100644 --- a/configure.in +++ b/configure.in @@ -1594,7 +1594,6 @@ APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl func:pthread_mutexattr_setpshared dnl file:/dev/zero, hasprocpthreadser="1", hasprocpthreadser="0") -APR_IFALLYES(struct:pthread_rw, hasrwlockser="1", hasrwlockser="0") # See which lock mechanism we'll select by default on this system. # The last APR_DECIDE to execute sets the default. @@ -1650,7 +1649,6 @@ AC_SUBST(hassysvser) AC_SUBST(hasposixser) AC_SUBST(hasfcntlser) AC_SUBST(hasprocpthreadser) -AC_SUBST(hasrwlockser) AC_SUBST(flockser) AC_SUBST(sysvser) AC_SUBST(posixser) diff --git a/include/apr.h.in b/include/apr.h.in index f8331fbd6f5..858037b48d5 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -178,7 +178,6 @@ extern "C" { #define APR_HAS_POSIXSEM_SERIALIZE @hasposixser@ #define APR_HAS_FCNTL_SERIALIZE @hasfcntlser@ #define APR_HAS_PROC_PTHREAD_SERIALIZE @hasprocpthreadser@ -#define APR_HAS_RWLOCK_SERIALIZE @hasrwlockser@ #define APR_PROCESS_LOCK_IS_GLOBAL @proclockglobal@ diff --git a/include/arch/unix/apr_arch_proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h index 4c7cd4e317e..7da97b7a8d7 100644 --- a/include/arch/unix/apr_arch_proc_mutex.h +++ b/include/arch/unix/apr_arch_proc_mutex.h @@ -96,10 +96,6 @@ extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_flock_method #if APR_HAS_PROC_PTHREAD_SERIALIZE extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_proc_pthread_methods; #endif -#if APR_HAS_RWLOCK_SERIALIZE -extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_rwlock_methods; -#endif - #if !APR_HAVE_UNION_SEMUN && defined(APR_HAS_SYSVSEM_SERIALIZE) union semun { From 5edbbdb710cfa9936a85a6c49b5cf8128a6e2548 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 5 Jun 2004 13:33:19 +0000 Subject: [PATCH 5037/7878] * include/arch/unix/apr_arch_proc_mutex.h, locks/unix/proc_mutex.c: Don't define global symbols for the _methods structures. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65165 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_proc_mutex.h | 16 ------------- locks/unix/proc_mutex.c | 30 ++++++++++++------------- 2 files changed, 15 insertions(+), 31 deletions(-) diff --git a/include/arch/unix/apr_arch_proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h index 7da97b7a8d7..40dcc7e1f72 100644 --- a/include/arch/unix/apr_arch_proc_mutex.h +++ b/include/arch/unix/apr_arch_proc_mutex.h @@ -81,22 +81,6 @@ typedef struct apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_lock_metho /* bit values for flags field in apr_unix_lock_methods_t */ #define APR_PROCESS_LOCK_MECH_IS_GLOBAL 1 -#if APR_HAS_POSIXSEM_SERIALIZE -extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_posix_methods; -#endif -#if APR_HAS_SYSVSEM_SERIALIZE -extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods; -#endif -#if APR_HAS_FCNTL_SERIALIZE -extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods; -#endif -#if APR_HAS_FLOCK_SERIALIZE -extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_flock_methods; -#endif -#if APR_HAS_PROC_PTHREAD_SERIALIZE -extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_proc_pthread_methods; -#endif - #if !APR_HAVE_UNION_SEMUN && defined(APR_HAS_SYSVSEM_SERIALIZE) union semun { int val; diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 666df393fb4..a401f15fc63 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -143,7 +143,7 @@ static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_posix_methods = +static const apr_proc_mutex_unix_lock_methods_t mutex_posixsem_methods = { #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(POSIXSEM_IS_GLOBAL) APR_PROCESS_LOCK_MECH_IS_GLOBAL, @@ -243,7 +243,7 @@ static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods = +static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = { #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(SYSVSEM_IS_GLOBAL) APR_PROCESS_LOCK_MECH_IS_GLOBAL, @@ -399,7 +399,7 @@ static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_proc_pthread_methods = +static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_methods = { APR_PROCESS_LOCK_MECH_IS_GLOBAL, proc_mutex_proc_pthread_create, @@ -511,7 +511,7 @@ static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods = +static const apr_proc_mutex_unix_lock_methods_t mutex_fcntl_methods = { #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(FCNTL_IS_GLOBAL) APR_PROCESS_LOCK_MECH_IS_GLOBAL, @@ -632,7 +632,7 @@ static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, return APR_SUCCESS; } -const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_flock_methods = +static const apr_proc_mutex_unix_lock_methods_t mutex_flock_methods = { #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(FLOCK_IS_GLOBAL) APR_PROCESS_LOCK_MECH_IS_GLOBAL, @@ -666,50 +666,50 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lo switch (mech) { case APR_LOCK_FCNTL: #if APR_HAS_FCNTL_SERIALIZE - new_mutex->inter_meth = &apr_proc_mutex_unix_fcntl_methods; + new_mutex->inter_meth = &mutex_fcntl_methods; #else return APR_ENOTIMPL; #endif break; case APR_LOCK_FLOCK: #if APR_HAS_FLOCK_SERIALIZE - new_mutex->inter_meth = &apr_proc_mutex_unix_flock_methods; + new_mutex->inter_meth = &mutex_flock_methods; #else return APR_ENOTIMPL; #endif break; case APR_LOCK_SYSVSEM: #if APR_HAS_SYSVSEM_SERIALIZE - new_mutex->inter_meth = &apr_proc_mutex_unix_sysv_methods; + new_mutex->inter_meth = &mutex_sysv_methods; #else return APR_ENOTIMPL; #endif break; case APR_LOCK_POSIXSEM: #if APR_HAS_POSIXSEM_SERIALIZE - new_mutex->inter_meth = &apr_proc_mutex_unix_posix_methods; + new_mutex->inter_meth = &mutex_posixsem_methods; #else return APR_ENOTIMPL; #endif break; case APR_LOCK_PROC_PTHREAD: #if APR_HAS_PROC_PTHREAD_SERIALIZE - new_mutex->inter_meth = &apr_proc_mutex_unix_proc_pthread_methods; + new_mutex->inter_meth = &mutex_proc_pthread_methods; #else return APR_ENOTIMPL; #endif break; case APR_LOCK_DEFAULT: #if APR_USE_FLOCK_SERIALIZE - new_mutex->inter_meth = &apr_proc_mutex_unix_flock_methods; + new_mutex->inter_meth = &mutex_flock_methods; #elif APR_USE_SYSVSEM_SERIALIZE - new_mutex->inter_meth = &apr_proc_mutex_unix_sysv_methods; + new_mutex->inter_meth = &mutex_sysv_methods; #elif APR_USE_FCNTL_SERIALIZE - new_mutex->inter_meth = &apr_proc_mutex_unix_fcntl_methods; + new_mutex->inter_meth = &mutex_fcntl_methods; #elif APR_USE_PROC_PTHREAD_SERIALIZE - new_mutex->inter_meth = &apr_proc_mutex_unix_proc_pthread_methods; + new_mutex->inter_meth = &mutex_proc_pthread_methods; #elif APR_USE_POSIXSEM_SERIALIZE - new_mutex->inter_meth = &apr_proc_mutex_unix_posix_methods; + new_mutex->inter_meth = &mutex_posixsem_methods; #else return APR_ENOTIMPL; #endif From 9f7f2af8dbb316350117799919b3ced5191e7bfe Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 5 Jun 2004 19:20:12 +0000 Subject: [PATCH 5038/7878] Add back the -l option to the apr test suite. This allows the test suite to list all available tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65166 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test/abts.c b/test/abts.c index edc99e276dd..b8e594e3762 100644 --- a/test/abts.c +++ b/test/abts.c @@ -26,6 +26,7 @@ static int curr_char; static int verbose = 0; static int exclude = 0; static int quiet = 0; +static int list_tests = 0; const char **testlist = NULL; @@ -42,6 +43,9 @@ static int find_test_name(const char *testname) { /* Determine if the test should be run at all */ static int should_test_run(const char *testname) { int found = 0; + if (list_tests == 1) { + return 0; + } if (testlist == NULL) { return 1; } @@ -101,7 +105,8 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name_full) subsuite->num_test = 0; subsuite->failed = 0; subsuite->next = NULL; - /* suite_name_full may be an absolute path depending on __FILE__ expansion */ + /* suite_name_full may be an absolute path depending on __FILE__ + * expansion */ suite_name = strrchr(suite_name_full, '/'); if (suite_name) { suite_name++; @@ -109,11 +114,18 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name_full) suite_name = suite_name_full; } p = strrchr(suite_name, '.'); - if (p) + if (p) { subsuite->name = memcpy(calloc(p - suite_name + 1, 1), suite_name, p - suite_name); - else + } + else { subsuite->name = suite_name; + } + + if (list_tests) { + fprintf(stdout, "%s\n", subsuite->name); + } + subsuite->not_run = 0; if (suite == NULL) { @@ -363,7 +375,7 @@ int main(int argc, const char *const argv[]) { continue; } if (!strcmp(argv[i], "-l")) { - /* print the list. */ + list_tests = 1; continue; } if (!strcmp(argv[i], "-q")) { From fd094b4a8052b127ad9e2bfc64733d5819bcb932 Mon Sep 17 00:00:00 2001 From: Thom May Date: Sun, 6 Jun 2004 15:46:59 +0000 Subject: [PATCH 5039/7878] oops, I was a little too enthusiastic with removing stuff... Submitted by: Greg, Joe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65168 13f79535-47bb-0310-9956-ffa450edef68 --- apr.pc.in | 1 + 1 file changed, 1 insertion(+) diff --git a/apr.pc.in b/apr.pc.in index 39db911ed51..b7cdae4e625 100644 --- a/apr.pc.in +++ b/apr.pc.in @@ -1,4 +1,5 @@ prefix=@prefix@ +execprefix=@exec_prefix@ libdir=@libdir@ APR_MAJOR_VERSION=@APR_MAJOR_VERSION@ includedir=@includedir@ From 960d9f67b1315db27901d65b1cf8fe3252c1aeeb Mon Sep 17 00:00:00 2001 From: Thom May Date: Sun, 6 Jun 2004 15:58:40 +0000 Subject: [PATCH 5040/7878] jet lag bad - this might actually be right now git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65169 13f79535-47bb-0310-9956-ffa450edef68 --- apr.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apr.pc.in b/apr.pc.in index b7cdae4e625..91e4993d290 100644 --- a/apr.pc.in +++ b/apr.pc.in @@ -1,5 +1,5 @@ prefix=@prefix@ -execprefix=@exec_prefix@ +exec_prefix=@exec_prefix@ libdir=@libdir@ APR_MAJOR_VERSION=@APR_MAJOR_VERSION@ includedir=@includedir@ From 80fad879e4254ec550653c35477280bdd3436613 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 6 Jun 2004 21:19:19 +0000 Subject: [PATCH 5041/7878] Add libtool* as installed by FreeBSD ports. No 'libtool' is installed, all are suffixed by version number. Prefer 1.5 over 1.4, if available. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65170 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 2 +- buildconf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 728cd02cc6c..cd1d593aa4a 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -38,7 +38,7 @@ fi # output is multiline from 1.5 onwards # Require libtool 1.3.3 or newer -libtool=`build/PrintPath glibtool libtool` +libtool=`build/PrintPath glibtool libtool libtool15 libtool14` lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` if test -z "$lt_pversion"; then echo "buildconf: libtool not found." diff --git a/buildconf b/buildconf index f64d5451edf..e3ecfff6559 100755 --- a/buildconf +++ b/buildconf @@ -22,7 +22,7 @@ # build/buildcheck.sh || exit 1 -libtoolize=`build/PrintPath glibtoolize libtoolize` +libtoolize=`build/PrintPath glibtoolize libtoolize libtoolize15 libtoolize14` if [ "x$libtoolize" = "x" ]; then echo "libtoolize not found in path" exit 1 From a909b6728debd2c24358ad297639dbf43cccaca8 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 7 Jun 2004 21:21:35 +0000 Subject: [PATCH 5042/7878] Presently if we fail in apr_assert_success we get the line number for testutil.c reported. Not very useful. This change adds the passing of the (correct) line number and also a macro to ease said passing. I've changed all instances of apr_assert_success to use the new macro, but not all the tests build on this platform so others should check that all is well for them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65171 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 +++ test/testapp.c | 2 +- test/testatomic.c | 4 +-- test/testdir.c | 10 ++++---- test/testenv.c | 6 ++--- test/testfile.c | 12 ++++----- test/testfilecopy.c | 14 +++++------ test/testfileinfo.c | 14 +++++------ test/testflock.c | 14 +++++------ test/testglobalmutex.c | 10 ++++---- test/testlfs.c | 56 +++++++++++++++++++++--------------------- test/testlock.c | 18 +++++++------- test/testprocmutex.c | 4 +-- test/testrand.c | 2 +- test/testshm.c | 36 +++++++++++++-------------- test/testsock.c | 40 +++++++++++++++--------------- test/testsockopt.c | 2 +- test/testtemp.c | 6 ++--- test/testtime.c | 2 +- test/testuser.c | 20 +++++++-------- test/testutil.c | 7 +++--- test/testutil.h | 5 +++- 22 files changed, 148 insertions(+), 140 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 84548b83d77..e77ce9a612f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -71,7 +71,11 @@ mod_test.slo: $(srcdir)/mod_test.c $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -prefer-pic -c $(srcdir)/mod_test.c && touch $@ mod_test.la: mod_test.slo $(LOCAL_LIBS) +<<<<<<< Makefile.in + $(LIBTOOL) --mode=link $(COMPILE) -rpath $(srcdir) -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ +======= $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ +>>>>>>> 1.159 libmod_test.la: mod_test.slo $(LOCAL_LIBS) $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ diff --git a/test/testapp.c b/test/testapp.c index 9e5bec3c5ff..77607aa388f 100644 --- a/test/testapp.c +++ b/test/testapp.c @@ -7,4 +7,4 @@ int main(int argc, const char * const * argv, const char * const *env) apr_terminate(); -} \ No newline at end of file +} diff --git a/test/testatomic.c b/test/testatomic.c index eb8f2a24b3d..62fc4c60e02 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -35,7 +35,7 @@ static void test_init(abts_case *tc, void *data) { - apr_assert_success(tc, "Could not initliaze atomics", apr_atomic_init(p)); + APR_ASSERT_SUCCESS(tc, "Could not initliaze atomics", apr_atomic_init(p)); } static void test_set32(abts_case *tc, void *data) @@ -242,7 +242,7 @@ static void test_atomics_threaded(abts_case *tc, void *data) #endif rv = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, p); - apr_assert_success(tc, "Could not create lock", rv); + APR_ASSERT_SUCCESS(tc, "Could not create lock", rv); for (i = 0; i < NUM_THREADS; i++) { apr_status_t r1, r2, r3; diff --git a/test/testdir.c b/test/testdir.c index 3eb9a26319b..0bb5f3b5a33 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -149,17 +149,17 @@ static void test_rewind(abts_case *tc, void *data) apr_dir_t *dir; apr_finfo_t first, second; - apr_assert_success(tc, "apr_dir_open failed", apr_dir_open(&dir, "data", p)); + APR_ASSERT_SUCCESS(tc, "apr_dir_open failed", apr_dir_open(&dir, "data", p)); - apr_assert_success(tc, "apr_dir_read failed", + APR_ASSERT_SUCCESS(tc, "apr_dir_read failed", apr_dir_read(&first, APR_FINFO_DIRENT, dir)); - apr_assert_success(tc, "apr_dir_rewind failed", apr_dir_rewind(dir)); + APR_ASSERT_SUCCESS(tc, "apr_dir_rewind failed", apr_dir_rewind(dir)); - apr_assert_success(tc, "second apr_dir_read failed", + APR_ASSERT_SUCCESS(tc, "second apr_dir_read failed", apr_dir_read(&second, APR_FINFO_DIRENT, dir)); - apr_assert_success(tc, "apr_dir_close failed", apr_dir_close(dir)); + APR_ASSERT_SUCCESS(tc, "apr_dir_close failed", apr_dir_close(dir)); ABTS_STR_EQUAL(tc, first.name, second.name); } diff --git a/test/testenv.c b/test/testenv.c index 0e341aa39a5..592f59ccdb8 100644 --- a/test/testenv.c +++ b/test/testenv.c @@ -32,7 +32,7 @@ static void test_setenv(abts_case *tc, void *data) if (!have_env_set) { ABTS_NOT_IMPL(tc, "apr_env_set"); } else { - apr_assert_success(tc, "set environment variable", rv); + APR_ASSERT_SUCCESS(tc, "set environment variable", rv); } } @@ -52,7 +52,7 @@ static void test_getenv(abts_case *tc, void *data) ABTS_NOT_IMPL(tc, "apr_env_get"); return; } - apr_assert_success(tc, "get environment variable", rv); + APR_ASSERT_SUCCESS(tc, "get environment variable", rv); ABTS_STR_EQUAL(tc, TEST_ENVVAR_VALUE, value); } @@ -71,7 +71,7 @@ static void test_delenv(abts_case *tc, void *data) ABTS_NOT_IMPL(tc, "apr_env_delete"); return; } - apr_assert_success(tc, "delete environment variable", rv); + APR_ASSERT_SUCCESS(tc, "delete environment variable", rv); if (!have_env_get) { ABTS_NOT_IMPL(tc, "apr_env_get (skip sanity check for apr_env_delete)"); diff --git a/test/testfile.c b/test/testfile.c index 98ef42fbcba..13bc1028d2f 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -81,7 +81,7 @@ static void test_read(abts_case *tc, void *data) APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); - apr_assert_success(tc, "Opening test file " FILENAME, rv); + APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, strlen(TESTSTR), nbytes); @@ -98,7 +98,7 @@ static void test_readzero(abts_case *tc, void *data) apr_file_t *filetest; rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_OS_DEFAULT, p); - apr_assert_success(tc, "Opening test file " FILENAME, rv); + APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -116,7 +116,7 @@ static void test_filename(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); - apr_assert_success(tc, "Opening test file " FILENAME, rv); + APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); rv = apr_file_name_get(&str, filetest); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -135,7 +135,7 @@ static void test_fileclose(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); - apr_assert_success(tc, "Opening test file " FILENAME, rv); + APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); rv = apr_file_close(filetest); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -227,7 +227,7 @@ static void test_seek(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); - apr_assert_success(tc, "Open test file " FILENAME, rv); + APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -251,7 +251,7 @@ static void test_seek(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_READ | APR_BUFFERED, APR_UREAD | APR_UWRITE | APR_GREAD, p); - apr_assert_success(tc, "Open test file " FILENAME, rv); + APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv); offset = -5; rv = apr_file_seek(filetest, SEEK_END, &offset); diff --git a/test/testfilecopy.c b/test/testfilecopy.c index 7db0b208221..21db4bcacaf 100644 --- a/test/testfilecopy.c +++ b/test/testfilecopy.c @@ -36,13 +36,13 @@ static void copy_helper(abts_case *tc, const char *from, const char * to, else { rv = apr_file_append(from, to, perms, p); } - apr_assert_success(tc, "Error copying file", rv); + APR_ASSERT_SUCCESS(tc, "Error copying file", rv); rv = apr_stat(&orig, from, APR_FINFO_SIZE, p); - apr_assert_success(tc, "Couldn't stat original file", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't stat original file", rv); rv = apr_stat(©, to, APR_FINFO_SIZE, p); - apr_assert_success(tc, "Couldn't stat copy file", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't stat copy file", rv); if (!append) { ABTS_INT_EQUAL(tc, orig.size, copy.size); @@ -64,7 +64,7 @@ static void copy_short_file(abts_case *tc, void *data) copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", APR_FILE_SOURCE_PERMS, 0, p); rv = apr_file_remove("data/file_copy.txt", p); - apr_assert_success(tc, "Couldn't remove copy file", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } static void copy_over_existing(abts_case *tc, void *data) @@ -85,7 +85,7 @@ static void copy_over_existing(abts_case *tc, void *data) APR_FILE_SOURCE_PERMS, 0, p); rv = apr_file_remove("data/file_copy.txt", p); - apr_assert_success(tc, "Couldn't remove copy file", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } static void append_nonexist(abts_case *tc, void *data) @@ -98,7 +98,7 @@ static void append_nonexist(abts_case *tc, void *data) copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", APR_FILE_SOURCE_PERMS, 0, p); rv = apr_file_remove("data/file_copy.txt", p); - apr_assert_success(tc, "Couldn't remove copy file", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } static void append_exist(abts_case *tc, void *data) @@ -119,7 +119,7 @@ static void append_exist(abts_case *tc, void *data) APR_FILE_SOURCE_PERMS, 1, p); rv = apr_file_remove("data/file_copy.txt", p); - apr_assert_success(tc, "Couldn't remove copy file", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } abts_suite *testfilecopy(abts_suite *suite) diff --git a/test/testfileinfo.c b/test/testfileinfo.c index 2166d31fe76..abb08920129 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -182,7 +182,7 @@ static void test_buffered_write_size(abts_case *tc, void *data) APR_READ | APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BUFFERED | APR_DELONCLOSE, APR_OS_DEFAULT, p); - apr_assert_success(tc, "open file", rv); + APR_ASSERT_SUCCESS(tc, "open file", rv); /* A funny thing happened to me the other day: I wrote something * into a buffered file, then asked for its size using @@ -191,11 +191,11 @@ static void test_buffered_write_size(abts_case *tc, void *data) */ bytes = data_len; rv = apr_file_write(thefile, NEWFILEDATA, &bytes); - apr_assert_success(tc, "write file contents", rv); + APR_ASSERT_SUCCESS(tc, "write file contents", rv); ABTS_TRUE(tc, data_len == bytes); rv = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); - apr_assert_success(tc, "get file size", rv); + APR_ASSERT_SUCCESS(tc, "get file size", rv); ABTS_TRUE(tc, bytes == (apr_size_t) finfo.size); apr_file_close(thefile); } @@ -215,7 +215,7 @@ static void test_mtime_set(abts_case *tc, void *data) APR_READ | APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BUFFERED | APR_DELONCLOSE, APR_OS_DEFAULT, p); - apr_assert_success(tc, "open file", rv); + APR_ASSERT_SUCCESS(tc, "open file", rv); /* Check that the current mtime is not the epoch */ rv = apr_stat(&finfo, NEWFILENAME, APR_FINFO_MTIME, p); @@ -230,7 +230,7 @@ static void test_mtime_set(abts_case *tc, void *data) } ABTS_FAIL(tc, str); } - apr_assert_success(tc, "get initial mtime", rv); + APR_ASSERT_SUCCESS(tc, "get initial mtime", rv); ABTS_TRUE(tc, finfo.mtime != epoch); /* Reset the mtime to the epoch and verify the result. @@ -238,10 +238,10 @@ static void test_mtime_set(abts_case *tc, void *data) * the second one will, too. */ rv = apr_file_mtime_set(NEWFILENAME, epoch, p); - apr_assert_success(tc, "set mtime", rv); + APR_ASSERT_SUCCESS(tc, "set mtime", rv); rv = apr_stat(&finfo, NEWFILENAME, APR_FINFO_MTIME, p); - apr_assert_success(tc, "get modified mtime", rv); + APR_ASSERT_SUCCESS(tc, "get modified mtime", rv); ABTS_TRUE(tc, finfo.mtime == epoch); apr_file_close(thefile); diff --git a/test/testflock.c b/test/testflock.c index 91e3ff51c98..dc679e2e762 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -32,19 +32,19 @@ static int launch_reader(abts_case *tc) int exitcode; rv = apr_procattr_create(&procattr, p); - apr_assert_success(tc, "Couldn't create procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't create procattr", rv); rv = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, APR_NO_PIPE); - apr_assert_success(tc, "Couldn't set io in procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't set io in procattr", rv); rv = apr_procattr_error_check_set(procattr, 1); - apr_assert_success(tc, "Couldn't set error check in procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't set error check in procattr", rv); args[0] = "tryread" EXTENSION; args[1] = NULL; rv = apr_proc_create(&proc, "./tryread" EXTENSION, args, NULL, procattr, p); - apr_assert_success(tc, "Couldn't launch program", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv); ABTS_ASSERT(tc, "wait for child process", apr_proc_wait(&proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); @@ -61,11 +61,11 @@ static void test_withlock(abts_case *tc, void *data) rv = apr_file_open(&file, TESTFILE, APR_WRITE|APR_CREATE, APR_OS_DEFAULT, p); - apr_assert_success(tc, "Could not create file.", rv); + APR_ASSERT_SUCCESS(tc, "Could not create file.", rv); ABTS_PTR_NOTNULL(tc, file); rv = apr_file_lock(file, APR_FLOCK_EXCLUSIVE); - apr_assert_success(tc, "Could not lock the file.", rv); + APR_ASSERT_SUCCESS(tc, "Could not lock the file.", rv); ABTS_PTR_NOTNULL(tc, file); code = launch_reader(tc); @@ -84,7 +84,7 @@ static void test_withoutlock(abts_case *tc, void *data) static void remove_lockfile(abts_case *tc, void *data) { - apr_assert_success(tc, "Couldn't remove lock file.", + APR_ASSERT_SUCCESS(tc, "Couldn't remove lock file.", apr_file_remove(TESTFILE, p)); } diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index bebcb20ac7c..dc79848a7e6 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -28,21 +28,21 @@ static void launch_child(abts_case *tc, apr_lockmech_e mech, apr_status_t rv; rv = apr_procattr_create(&procattr, p); - apr_assert_success(tc, "Couldn't create procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't create procattr", rv); rv = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, APR_NO_PIPE); - apr_assert_success(tc, "Couldn't set io in procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't set io in procattr", rv); rv = apr_procattr_error_check_set(procattr, 1); - apr_assert_success(tc, "Couldn't set error check in procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't set error check in procattr", rv); args[0] = "globalmutexchild" EXTENSION; args[1] = (const char*)apr_itoa(p, (int)mech); args[2] = NULL; rv = apr_proc_create(proc, "./globalmutexchild" EXTENSION, args, NULL, procattr, p); - apr_assert_success(tc, "Couldn't launch program", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv); } static int wait_child(abts_case *tc, apr_proc_t *proc) @@ -79,7 +79,7 @@ static void test_exclusive(abts_case *tc, void *data, apr_lockmech_e mech) int x = 0; rv = apr_global_mutex_create(&global_lock, LOCKNAME, mech, p); - apr_assert_success(tc, "Error creating mutex", rv); + APR_ASSERT_SUCCESS(tc, "Error creating mutex", rv); launch_child(tc, mech, &p1, p); launch_child(tc, mech, &p2, p); diff --git a/test/testlfs.c b/test/testlfs.c index d512558be0c..5f83b453b45 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -48,17 +48,17 @@ static void test_open(abts_case *tc, void *data) rv = apr_dir_make(TESTDIR, APR_OS_DEFAULT, p); if (rv && !APR_STATUS_IS_EEXIST(rv)) { - apr_assert_success(tc, "make test directory", rv); + APR_ASSERT_SUCCESS(tc, "make test directory", rv); } - apr_assert_success(tc, "open file", + APR_ASSERT_SUCCESS(tc, "open file", apr_file_open(&f, TESTFN, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_OS_DEFAULT, p)); rv = apr_file_trunc(f, eightGb); - apr_assert_success(tc, "close large file", apr_file_close(f)); + APR_ASSERT_SUCCESS(tc, "close large file", apr_file_close(f)); /* 8Gb may pass rlimits or filesystem limits */ @@ -70,7 +70,7 @@ static void test_open(abts_case *tc, void *data) ABTS_NOT_IMPL(tc, "Creation of large file (limited by rlimit or fs?)"); } else { - apr_assert_success(tc, "truncate file to 8gb", rv); + APR_ASSERT_SUCCESS(tc, "truncate file to 8gb", rv); } madefile = rv == APR_SUCCESS; @@ -83,16 +83,16 @@ static void test_reopen(abts_case *tc, void *data) PRECOND; - apr_assert_success(tc, "re-open 8Gb file", + APR_ASSERT_SUCCESS(tc, "re-open 8Gb file", apr_file_open(&fh, TESTFN, APR_READ, APR_OS_DEFAULT, p)); - apr_assert_success(tc, "file_info_get failed", + APR_ASSERT_SUCCESS(tc, "file_info_get failed", apr_file_info_get(&finfo, APR_FINFO_NORM, fh)); ABTS_ASSERT(tc, "file_info_get gave incorrect size", finfo.size == eightGb); - apr_assert_success(tc, "re-close large file", apr_file_close(fh)); + APR_ASSERT_SUCCESS(tc, "re-close large file", apr_file_close(fh)); } static void test_stat(abts_case *tc, void *data) @@ -101,7 +101,7 @@ static void test_stat(abts_case *tc, void *data) PRECOND; - apr_assert_success(tc, "stat large file", + APR_ASSERT_SUCCESS(tc, "stat large file", apr_stat(&finfo, TESTFN, APR_FINFO_NORM, p)); ABTS_ASSERT(tc, "stat gave incorrect size", finfo.size == eightGb); @@ -114,7 +114,7 @@ static void test_readdir(abts_case *tc, void *data) PRECOND; - apr_assert_success(tc, "open test directory", + APR_ASSERT_SUCCESS(tc, "open test directory", apr_dir_open(&dh, TESTDIR, p)); do { @@ -130,10 +130,10 @@ static void test_readdir(abts_case *tc, void *data) } while (rv == APR_SUCCESS); if (!APR_STATUS_IS_ENOENT(rv)) { - apr_assert_success(tc, "apr_dir_read failed", rv); + APR_ASSERT_SUCCESS(tc, "apr_dir_read failed", rv); } - apr_assert_success(tc, "close test directory", + APR_ASSERT_SUCCESS(tc, "close test directory", apr_dir_close(dh)); } @@ -146,20 +146,20 @@ static void test_append(abts_case *tc, void *data) PRECOND; - apr_assert_success(tc, "open 8Gb file for append", + APR_ASSERT_SUCCESS(tc, "open 8Gb file for append", apr_file_open(&fh, TESTFN, APR_WRITE | APR_APPEND, APR_OS_DEFAULT, p)); - apr_assert_success(tc, "append to 8Gb file", + APR_ASSERT_SUCCESS(tc, "append to 8Gb file", apr_file_write_full(fh, TESTSTR, strlen(TESTSTR), NULL)); - apr_assert_success(tc, "file_info_get failed", + APR_ASSERT_SUCCESS(tc, "file_info_get failed", apr_file_info_get(&finfo, APR_FINFO_NORM, fh)); ABTS_ASSERT(tc, "file_info_get gave incorrect size", finfo.size == eightGb + strlen(TESTSTR)); - apr_assert_success(tc, "close 8Gb file", apr_file_close(fh)); + APR_ASSERT_SUCCESS(tc, "close 8Gb file", apr_file_close(fh)); } static void test_seek(abts_case *tc, void *data) @@ -169,21 +169,21 @@ static void test_seek(abts_case *tc, void *data) PRECOND; - apr_assert_success(tc, "open 8Gb file for writing", + APR_ASSERT_SUCCESS(tc, "open 8Gb file for writing", apr_file_open(&fh, TESTFN, APR_WRITE, APR_OS_DEFAULT, p)); pos = 0; - apr_assert_success(tc, "relative seek to end", + APR_ASSERT_SUCCESS(tc, "relative seek to end", apr_file_seek(fh, APR_END, &pos)); ABTS_ASSERT(tc, "seek to END gave 8Gb", pos == eightGb); pos = eightGb; - apr_assert_success(tc, "seek to 8Gb", apr_file_seek(fh, APR_SET, &pos)); + APR_ASSERT_SUCCESS(tc, "seek to 8Gb", apr_file_seek(fh, APR_SET, &pos)); ABTS_ASSERT(tc, "seek gave 8Gb offset", pos == eightGb); pos = 0; - apr_assert_success(tc, "relative seek to 0", apr_file_seek(fh, APR_CUR, &pos)); + APR_ASSERT_SUCCESS(tc, "relative seek to 0", apr_file_seek(fh, APR_CUR, &pos)); ABTS_ASSERT(tc, "relative seek gave 8Gb offset", pos == eightGb); apr_file_close(fh); @@ -196,17 +196,17 @@ static void test_write(abts_case *tc, void *data) PRECOND; - apr_assert_success(tc, "re-open 8Gb file", + APR_ASSERT_SUCCESS(tc, "re-open 8Gb file", apr_file_open(&fh, TESTFN, APR_WRITE, APR_OS_DEFAULT, p)); - apr_assert_success(tc, "seek to 8Gb - 4", + APR_ASSERT_SUCCESS(tc, "seek to 8Gb - 4", apr_file_seek(fh, APR_SET, &pos)); ABTS_ASSERT(tc, "seek gave 8Gb-4 offset", pos == eightGb - 4); - apr_assert_success(tc, "write magic string to 8Gb-4", + APR_ASSERT_SUCCESS(tc, "write magic string to 8Gb-4", apr_file_write_full(fh, "FISH", 4, NULL)); - apr_assert_success(tc, "close 8Gb file", apr_file_close(fh)); + APR_ASSERT_SUCCESS(tc, "close 8Gb file", apr_file_close(fh)); } @@ -221,23 +221,23 @@ static void test_mmap(abts_case *tc, void *data) PRECOND; - apr_assert_success(tc, "open 8gb file for mmap", + APR_ASSERT_SUCCESS(tc, "open 8gb file for mmap", apr_file_open(&fh, TESTFN, APR_READ, APR_OS_DEFAULT, p)); - apr_assert_success(tc, "mmap 8Gb file", + APR_ASSERT_SUCCESS(tc, "mmap 8Gb file", apr_mmap_create(&map, fh, off, len, APR_MMAP_READ, p)); - apr_assert_success(tc, "close file", apr_file_close(fh)); + APR_ASSERT_SUCCESS(tc, "close file", apr_file_close(fh)); ABTS_ASSERT(tc, "mapped a 16K block", map->size == len); - apr_assert_success(tc, "get pointer into mmaped region", + APR_ASSERT_SUCCESS(tc, "get pointer into mmaped region", apr_mmap_offset(&ptr, map, len - 4)); ABTS_ASSERT(tc, "pointer was not NULL", ptr != NULL); ABTS_ASSERT(tc, "found the magic string", memcmp(ptr, "FISH", 4) == 0); - apr_assert_success(tc, "delete mmap handle", apr_mmap_delete(map)); + APR_ASSERT_SUCCESS(tc, "delete mmap handle", apr_mmap_delete(map)); } #endif /* APR_HAS_MMAP */ diff --git a/test/testlock.c b/test/testlock.c index 259c5beaeeb..9c8a14dfcd0 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -187,20 +187,20 @@ static void test_thread_rwlock(abts_case *tc, void *data) ABTS_NOT_IMPL(tc, "rwlocks not implemented"); return; } - apr_assert_success(tc, "rwlock_create", s1); + APR_ASSERT_SUCCESS(tc, "rwlock_create", s1); ABTS_PTR_NOTNULL(tc, rwlock); i = 0; x = 0; s1 = apr_thread_create(&t1, NULL, thread_rwlock_func, NULL, p); - apr_assert_success(tc, "create thread 1", s1); + APR_ASSERT_SUCCESS(tc, "create thread 1", s1); s2 = apr_thread_create(&t2, NULL, thread_rwlock_func, NULL, p); - apr_assert_success(tc, "create thread 2", s2); + APR_ASSERT_SUCCESS(tc, "create thread 2", s2); s3 = apr_thread_create(&t3, NULL, thread_rwlock_func, NULL, p); - apr_assert_success(tc, "create thread 3", s3); + APR_ASSERT_SUCCESS(tc, "create thread 3", s3); s4 = apr_thread_create(&t4, NULL, thread_rwlock_func, NULL, p); - apr_assert_success(tc, "create thread 4", s4); + APR_ASSERT_SUCCESS(tc, "create thread 4", s4); apr_thread_join(&s1, t1); apr_thread_join(&s2, t2); @@ -217,17 +217,17 @@ static void test_cond(abts_case *tc, void *data) int count1, count2, count3, count4; int sum; - apr_assert_success(tc, "create put mutex", + APR_ASSERT_SUCCESS(tc, "create put mutex", apr_thread_mutex_create(&put.mutex, APR_THREAD_MUTEX_DEFAULT, p)); ABTS_PTR_NOTNULL(tc, put.mutex); - apr_assert_success(tc, "create nready mutex", + APR_ASSERT_SUCCESS(tc, "create nready mutex", apr_thread_mutex_create(&nready.mutex, APR_THREAD_MUTEX_DEFAULT, p)); ABTS_PTR_NOTNULL(tc, nready.mutex); - apr_assert_success(tc, "create condvar", + APR_ASSERT_SUCCESS(tc, "create condvar", apr_thread_cond_create(&nready.cond, p)); ABTS_PTR_NOTNULL(tc, nready.cond); @@ -254,7 +254,7 @@ static void test_cond(abts_case *tc, void *data) apr_thread_join(&s3, p4); apr_thread_join(&s4, c1); - apr_assert_success(tc, "destroy condvar", + APR_ASSERT_SUCCESS(tc, "destroy condvar", apr_thread_cond_destroy(nready.cond)); sum = count1 + count2 + count3 + count4; diff --git a/test/testprocmutex.c b/test/testprocmutex.c index f0354449460..10e0e62e412 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -99,7 +99,7 @@ static void test_exclusive(abts_case *tc, const char *lockname) int n; rv = apr_proc_mutex_create(&proc_lock, lockname, APR_LOCK_DEFAULT, p); - apr_assert_success(tc, "create the mutex", rv); + APR_ASSERT_SUCCESS(tc, "create the mutex", rv); for (n = 0; n < CHILDREN; n++) make_child(tc, &child[n], p); @@ -125,7 +125,7 @@ static void proc_mutex(abts_case *tc, void *data) rv = apr_shm_create(&shm, sizeof(int), shmname, p); } - apr_assert_success(tc, "create shm segment", rv); + APR_ASSERT_SUCCESS(tc, "create shm segment", rv); x = apr_shm_baseaddr_get(shm); test_exclusive(tc, NULL); diff --git a/test/testrand.c b/test/testrand.c index 89f500685ef..ceb127f14c0 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -29,7 +29,7 @@ static void rand_exists(abts_case *tc, void *data) /* There must be a better way to test random-ness, but I don't know * what it is right now. */ - apr_assert_success(tc, "apr_generate_random_bytes failed", + APR_ASSERT_SUCCESS(tc, "apr_generate_random_bytes failed", apr_generate_random_bytes(c, sizeof c)); #endif } diff --git a/test/testshm.c b/test/testshm.c index d26bb289e34..7f3fe6556b7 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -64,11 +64,11 @@ static void test_anon_create(abts_case *tc, void *data) apr_shm_t *shm = NULL; rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); - apr_assert_success(tc, "Error allocating shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); ABTS_PTR_NOTNULL(tc, shm); rv = apr_shm_destroy(shm); - apr_assert_success(tc, "Error destroying shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } static void test_check_size(abts_case *tc, void *data) @@ -78,14 +78,14 @@ static void test_check_size(abts_case *tc, void *data) apr_size_t retsize; rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); - apr_assert_success(tc, "Error allocating shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); ABTS_PTR_NOTNULL(tc, shm); retsize = apr_shm_size_get(shm); ABTS_INT_EQUAL(tc, SHARED_SIZE, retsize); rv = apr_shm_destroy(shm); - apr_assert_success(tc, "Error destroying shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } static void test_shm_allocate(abts_case *tc, void *data) @@ -94,14 +94,14 @@ static void test_shm_allocate(abts_case *tc, void *data) apr_shm_t *shm = NULL; rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); - apr_assert_success(tc, "Error allocating shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); ABTS_PTR_NOTNULL(tc, shm); boxes = apr_shm_baseaddr_get(shm); ABTS_PTR_NOTNULL(tc, boxes); rv = apr_shm_destroy(shm); - apr_assert_success(tc, "Error destroying shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } #if APR_HAS_FORK @@ -115,7 +115,7 @@ static void test_anon(abts_case *tc, void *data) int recvd; rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); - apr_assert_success(tc, "Error allocating shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); ABTS_PTR_NOTNULL(tc, shm); retsize = apr_shm_size_get(shm); @@ -151,7 +151,7 @@ static void test_anon(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, N_MESSAGES, recvd); rv = apr_shm_destroy(shm); - apr_assert_success(tc, "Error destroying shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } #endif @@ -167,7 +167,7 @@ static void test_named(abts_case *tc, void *data) const char *args[4]; rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); - apr_assert_success(tc, "Error allocating shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); if (rv != APR_SUCCESS) { return; } @@ -181,20 +181,20 @@ static void test_named(abts_case *tc, void *data) rv = apr_procattr_create(&attr1, p); ABTS_PTR_NOTNULL(tc, attr1); - apr_assert_success(tc, "Couldn't create attr1", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't create attr1", rv); args[0] = apr_pstrdup(p, "testshmproducer" EXTENSION); args[1] = NULL; rv = apr_proc_create(&pidproducer, "./testshmproducer" EXTENSION, args, NULL, attr1, p); - apr_assert_success(tc, "Couldn't launch producer", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't launch producer", rv); rv = apr_procattr_create(&attr2, p); ABTS_PTR_NOTNULL(tc, attr2); - apr_assert_success(tc, "Couldn't create attr2", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't create attr2", rv); args[0] = apr_pstrdup(p, "testshmconsumer" EXTENSION); rv = apr_proc_create(&pidconsumer, "./testshmconsumer" EXTENSION, args, NULL, attr2, p); - apr_assert_success(tc, "Couldn't launch consumer", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't launch consumer", rv); rv = apr_proc_wait(&pidconsumer, &received, &why, APR_WAIT); ABTS_INT_EQUAL(tc, APR_CHILD_DONE, rv); @@ -208,7 +208,7 @@ static void test_named(abts_case *tc, void *data) * This way, if they didn't succeed, we can just run this test again * without having to cleanup manually. */ - apr_assert_success(tc, "Error destroying shared memory", + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory", apr_shm_destroy(shm)); ABTS_INT_EQUAL(tc, sent, received); @@ -221,27 +221,27 @@ static void test_named_remove(abts_case *tc, void *data) apr_shm_t *shm; rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); - apr_assert_success(tc, "Error allocating shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); if (rv != APR_SUCCESS) { return; } ABTS_PTR_NOTNULL(tc, shm); rv = apr_shm_remove(SHARED_FILENAME, p); - apr_assert_success(tc, "Error removing shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error removing shared memory block", rv); if (rv != APR_SUCCESS) { return ; } rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); - apr_assert_success(tc, "Error allocating shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); if (rv != APR_SUCCESS) { return; } ABTS_PTR_NOTNULL(tc, shm); rv = apr_shm_destroy(shm); - apr_assert_success(tc, "Error destroying shared memory block", rv); + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } #endif diff --git a/test/testsock.c b/test/testsock.c index 9853a8cc658..e541da2eda2 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -29,21 +29,21 @@ static void launch_child(abts_case *tc, apr_proc_t *proc, const char *arg1, apr_ apr_status_t rv; rv = apr_procattr_create(&procattr, p); - apr_assert_success(tc, "Couldn't create procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't create procattr", rv); rv = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, APR_NO_PIPE); - apr_assert_success(tc, "Couldn't set io in procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't set io in procattr", rv); rv = apr_procattr_error_check_set(procattr, 1); - apr_assert_success(tc, "Couldn't set error check in procattr", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't set error check in procattr", rv); args[0] = "sockchild" EXTENSION; args[1] = arg1; args[2] = NULL; rv = apr_proc_create(proc, "./sockchild" EXTENSION, args, NULL, procattr, p); - apr_assert_success(tc, "Couldn't launch program", rv); + APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv); } static int wait_child(abts_case *tc, apr_proc_t *proc) @@ -64,10 +64,10 @@ static void test_addr_info(abts_case *tc, void *data) apr_sockaddr_t *sa; rv = apr_sockaddr_info_get(&sa, NULL, APR_UNSPEC, 80, 0, p); - apr_assert_success(tc, "Problem generating sockaddr", rv); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, 80, 0, p); - apr_assert_success(tc, "Problem generating sockaddr", rv); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); ABTS_STR_EQUAL(tc, "127.0.0.1", sa->hostname); } @@ -78,17 +78,17 @@ static apr_socket_t *setup_socket(abts_case *tc) apr_socket_t *sock; rv = apr_sockaddr_info_get(&sa, NULL, APR_INET, 8021, 0, p); - apr_assert_success(tc, "Problem generating sockaddr", rv); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); rv = apr_socket_create(&sock, sa->family, SOCK_STREAM, APR_PROTO_TCP, p); - apr_assert_success(tc, "Problem creating socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem creating socket", rv); rv = apr_socket_bind(sock, sa); - apr_assert_success(tc, "Problem binding to port", rv); + APR_ASSERT_SUCCESS(tc, "Problem binding to port", rv); if (rv) return NULL; rv = apr_socket_listen(sock, 5); - apr_assert_success(tc, "Problem listening on socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem listening on socket", rv); return sock; } @@ -101,7 +101,7 @@ static void test_create_bind_listen(abts_case *tc, void *data) if (!sock) return; rv = apr_socket_close(sock); - apr_assert_success(tc, "Problem closing socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } static void test_send(abts_case *tc, void *data) @@ -119,7 +119,7 @@ static void test_send(abts_case *tc, void *data) launch_child(tc, &proc, "read", p); rv = apr_socket_accept(&sock2, sock, p); - apr_assert_success(tc, "Problem with receiving connection", rv); + APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); apr_socket_protocol_get(sock2, &protocol); ABTS_INT_EQUAL(tc, APR_PROTO_TCP, protocol); @@ -131,9 +131,9 @@ static void test_send(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, strlen(DATASTR), wait_child(tc, &proc)); rv = apr_socket_close(sock2); - apr_assert_success(tc, "Problem closing connected socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); rv = apr_socket_close(sock); - apr_assert_success(tc, "Problem closing socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } static void test_recv(abts_case *tc, void *data) @@ -152,7 +152,7 @@ static void test_recv(abts_case *tc, void *data) launch_child(tc, &proc, "write", p); rv = apr_socket_accept(&sock2, sock, p); - apr_assert_success(tc, "Problem with receiving connection", rv); + APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); apr_socket_protocol_get(sock2, &protocol); ABTS_INT_EQUAL(tc, APR_PROTO_TCP, protocol); @@ -165,9 +165,9 @@ static void test_recv(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, strlen(datastr), wait_child(tc, &proc)); rv = apr_socket_close(sock2); - apr_assert_success(tc, "Problem closing connected socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); rv = apr_socket_close(sock); - apr_assert_success(tc, "Problem closing socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } static void test_timeout(abts_case *tc, void *data) @@ -185,7 +185,7 @@ static void test_timeout(abts_case *tc, void *data) launch_child(tc, &proc, "read", p); rv = apr_socket_accept(&sock2, sock, p); - apr_assert_success(tc, "Problem with receiving connection", rv); + APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); apr_socket_protocol_get(sock2, &protocol); ABTS_INT_EQUAL(tc, APR_PROTO_TCP, protocol); @@ -197,9 +197,9 @@ static void test_timeout(abts_case *tc, void *data) * an error. */ rv = apr_socket_close(sock2); - apr_assert_success(tc, "Problem closing connected socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); rv = apr_socket_close(sock); - apr_assert_success(tc, "Problem closing socket", rv); + APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } abts_suite *testsock(abts_suite *suite) diff --git a/test/testsockopt.c b/test/testsockopt.c index b04399900a0..0d7a67e25cf 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -52,7 +52,7 @@ static void set_debug(abts_case *tc, void *data) * for get/set consistency of this option. */ rv1 = apr_socket_opt_set(sock, APR_SO_DEBUG, 1); rv2 = apr_socket_opt_get(sock, APR_SO_DEBUG, &ck); - apr_assert_success(tc, "get SO_DEBUG option", rv2); + APR_ASSERT_SUCCESS(tc, "get SO_DEBUG option", rv2); if (APR_STATUS_IS_SUCCESS(rv1)) { ABTS_INT_EQUAL(tc, 1, ck); } else { diff --git a/test/testtemp.c b/test/testtemp.c index 811e31bc7a2..03bcfb436f3 100644 --- a/test/testtemp.c +++ b/test/testtemp.c @@ -23,7 +23,7 @@ static void test_temp_dir(abts_case *tc, void *data) apr_status_t rv; rv = apr_temp_dir_get(&tempdir, p); - apr_assert_success(tc, "Error finding Temporary Directory", rv); + APR_ASSERT_SUCCESS(tc, "Error finding Temporary Directory", rv); ABTS_PTR_NOTNULL(tc, tempdir); } @@ -35,11 +35,11 @@ static void test_mktemp(abts_case *tc, void *data) apr_status_t rv; rv = apr_temp_dir_get(&tempdir, p); - apr_assert_success(tc, "Error finding Temporary Directory", rv); + APR_ASSERT_SUCCESS(tc, "Error finding Temporary Directory", rv); filetemplate = apr_pstrcat(p, tempdir, "/tempfileXXXXXX", NULL); rv = apr_file_mktemp(&f, filetemplate, 0, p); - apr_assert_success(tc, "Error opening Temporary file", rv); + APR_ASSERT_SUCCESS(tc, "Error opening Temporary file", rv); } abts_suite *testtemp(abts_suite *suite) diff --git a/test/testtime.c b/test/testtime.c index 78a5078b25d..9803ebdfd12 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -279,7 +279,7 @@ static void test_2038(abts_case *tc, void *data) xt.tm_min = 14; xt.tm_sec = 7; - apr_assert_success(tc, "explode January 19th, 2038", + APR_ASSERT_SUCCESS(tc, "explode January 19th, 2038", apr_time_exp_get(&t, &xt)); } diff --git a/test/testuser.c b/test/testuser.c index 2f6cd760bb4..b3ca3e16fd3 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -24,7 +24,7 @@ static void uid_current(abts_case *tc, void *data) apr_uid_t uid; apr_gid_t gid; - apr_assert_success(tc, "apr_uid_current failed", + APR_ASSERT_SUCCESS(tc, "apr_uid_current failed", apr_uid_current(&uid, &gid, p)); } @@ -36,17 +36,17 @@ static void username(abts_case *tc, void *data) apr_gid_t retreived_gid; char *uname = NULL; - apr_assert_success(tc, "apr_uid_current failed", + APR_ASSERT_SUCCESS(tc, "apr_uid_current failed", apr_uid_current(&uid, &gid, p)); - apr_assert_success(tc, "apr_uid_name_get failed", + APR_ASSERT_SUCCESS(tc, "apr_uid_name_get failed", apr_uid_name_get(&uname, uid, p)); ABTS_PTR_NOTNULL(tc, uname); - apr_assert_success(tc, "apr_uid_get failed", + APR_ASSERT_SUCCESS(tc, "apr_uid_get failed", apr_uid_get(&retreived_uid, &retreived_gid, uname, p)); - apr_assert_success(tc, "apr_uid_compare failed", + APR_ASSERT_SUCCESS(tc, "apr_uid_compare failed", apr_uid_compare(uid, retreived_uid)); #ifdef WIN32 /* ### this fudge was added for Win32 but makes the test return NotImpl @@ -65,7 +65,7 @@ static void username(abts_case *tc, void *data) } else { #endif - apr_assert_success(tc, "apr_gid_compare failed", + APR_ASSERT_SUCCESS(tc, "apr_gid_compare failed", apr_gid_compare(gid, retreived_gid)); #ifdef WIN32 } @@ -79,17 +79,17 @@ static void groupname(abts_case *tc, void *data) apr_gid_t retreived_gid; char *gname = NULL; - apr_assert_success(tc, "apr_uid_current failed", + APR_ASSERT_SUCCESS(tc, "apr_uid_current failed", apr_uid_current(&uid, &gid, p)); - apr_assert_success(tc, "apr_gid_name_get failed", + APR_ASSERT_SUCCESS(tc, "apr_gid_name_get failed", apr_gid_name_get(&gname, gid, p)); ABTS_PTR_NOTNULL(tc, gname); - apr_assert_success(tc, "apr_gid_get failed", + APR_ASSERT_SUCCESS(tc, "apr_gid_get failed", apr_gid_get(&retreived_gid, gname, p)); - apr_assert_success(tc, "apr_gid_compare failed", + APR_ASSERT_SUCCESS(tc, "apr_gid_compare failed", apr_gid_compare(gid, retreived_gid)); } #else diff --git a/test/testutil.c b/test/testutil.c index 43835c15280..f15b7db7471 100644 --- a/test/testutil.c +++ b/test/testutil.c @@ -22,17 +22,18 @@ apr_pool_t *p; -void apr_assert_success(abts_case* tc, const char* context, apr_status_t rv) +void apr_assert_success(abts_case* tc, const char* context, apr_status_t rv, + int lineno) { if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, context); + abts_not_impl(tc, context, lineno); } if (rv != APR_SUCCESS) { char buf[STRING_MAX], ebuf[128]; sprintf(buf, "%s (%d): %s\n", context, rv, apr_strerror(rv, ebuf, sizeof ebuf)); - ABTS_FAIL(tc, buf); + abts_fail(tc, buf, lineno); } } diff --git a/test/testutil.h b/test/testutil.h index ea9c1aeca1a..3e6118db6bf 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -38,7 +38,10 @@ extern apr_pool_t *p; /* Assert that RV is an APR_SUCCESS value; else fail giving strerror * for RV and CONTEXT message. */ -void apr_assert_success(abts_case* tc, const char *context, apr_status_t rv); +void apr_assert_success(abts_case* tc, const char *context, + apr_status_t rv, int lineno); +#define APR_ASSERT_SUCCESS(tc, ctxt, rv) \ + apr_assert_success(tc, ctxt, rv, __LINE__) void initialize(void); From 83341d2fbbf11e60e346c90af546ba817bdf27f9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 7 Jun 2004 21:33:25 +0000 Subject: [PATCH 5043/7878] * test/abts_tests.h: Disable tests for API combination which doesn't currently work. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65172 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts_tests.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/abts_tests.h b/test/abts_tests.h index 4086fd3fef4..18ef20773ec 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -34,7 +34,9 @@ const struct testlist { {testfmt}, {testfnmatch}, {testgetopt}, +#if 0 /* not ready yet due to API issues */ {testglobalmutex}, +#endif {testhash}, {testipsub}, {testlock}, From fa7c42695a95c7d82405cc1dfdd9c8befa8365d0 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 8 Jun 2004 00:35:10 +0000 Subject: [PATCH 5044/7878] Merge from ABTS svn repo. Don't pring success message when -l is used. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65173 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/abts.c b/test/abts.c index b8e594e3762..18c6bc646ce 100644 --- a/test/abts.c +++ b/test/abts.c @@ -189,6 +189,10 @@ static int report(abts_suite *suite) count += dptr->failed; } + if (list_tests) { + return 0; + } + if (count == 0) { printf("All tests passed.\n"); return 0; From 33bcc4fe23122e1bc49d7b6f225e04325966883a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 8 Jun 2004 06:25:13 +0000 Subject: [PATCH 5045/7878] * test/Makefile.in: Revert broken r1.161. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65174 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index e77ce9a612f..84548b83d77 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -71,11 +71,7 @@ mod_test.slo: $(srcdir)/mod_test.c $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -prefer-pic -c $(srcdir)/mod_test.c && touch $@ mod_test.la: mod_test.slo $(LOCAL_LIBS) -<<<<<<< Makefile.in - $(LIBTOOL) --mode=link $(COMPILE) -rpath $(srcdir) -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ -======= $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ ->>>>>>> 1.159 libmod_test.la: mod_test.slo $(LOCAL_LIBS) $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ From e428998741e5611b428532af11cf956d46fe5612 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 9 Jun 2004 19:33:02 +0000 Subject: [PATCH 5046/7878] Use the void *data parameter to test functions to pass in the lock mechanism. The removes a bunch of functions that didn't really do anything except dictate which lock mechanism to use, and it uses a feature that CuTest didn't have but ABTS does to solve this problem. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65175 13f79535-47bb-0310-9956-ffa450edef68 --- test/testglobalmutex.c | 63 +++++++++++------------------------------- 1 file changed, 16 insertions(+), 47 deletions(-) diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index dc79848a7e6..917ad92af53 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -71,8 +71,9 @@ static const char *mutexname(apr_lockmech_e mech) } } -static void test_exclusive(abts_case *tc, void *data, apr_lockmech_e mech) +static void test_exclusive(abts_case *tc, void *data) { + apr_lockmech_e mech = *(apr_lockmech_e *)data; apr_proc_t p1, p2, p3, p4; apr_status_t rv; apr_global_mutex_t *global_lock; @@ -99,65 +100,33 @@ static void test_exclusive(abts_case *tc, void *data, apr_lockmech_e mech) } } -static void test_exclusive_default(abts_case *tc, void *data) -{ - test_exclusive(tc, data, APR_LOCK_DEFAULT); -} - -#if APR_HAS_POSIXSEM_SERIALIZE -static void test_exclusive_posixsem(abts_case *tc, void *data) -{ - test_exclusive(tc, data, APR_LOCK_POSIXSEM); -} -#endif - -#if APR_HAS_SYSVSEM_SERIALIZE -static void test_exclusive_sysvsem(abts_case *tc, void *data) -{ - test_exclusive(tc, data, APR_LOCK_SYSVSEM); -} -#endif - -#if APR_HAS_PROC_PTHREAD_SERIALIZE -static void test_exclusive_proc_pthread(abts_case *tc, void *data) -{ - test_exclusive(tc, data, APR_LOCK_PROC_PTHREAD); -} -#endif - -#if APR_HAS_FCNTL_SERIALIZE -static void test_exclusive_fcntl(abts_case *tc, void *data) -{ - test_exclusive(tc, data, APR_LOCK_FCNTL); -} -#endif - -#if APR_HAS_FLOCK_SERIALIZE -static void test_exclusive_flock(abts_case *tc, void *data) -{ - test_exclusive(tc, data, APR_LOCK_FLOCK); -} -#endif - abts_suite *testglobalmutex(abts_suite *suite) { suite = ADD_SUITE(suite) - abts_run_test(suite, test_exclusive_default, NULL); + apr_lockmech_e mech; + + mech = APR_LOCK_DEFAULT; + abts_run_test(suite, test_exclusive, &mech); #if APR_HAS_POSIXSEM_SERIALIZE - abts_run_test(suite, test_exclusive_posixsem, NULL); + mech = APR_LOCK_POSIXSEM; + abts_run_test(suite, test_exclusive, &mech); #endif #if APR_HAS_SYSVSEM_SERIALIZE - abts_run_test(suite, test_exclusive_sysvsem, NULL); + mech = APR_LOCK_SYSVSEM; + abts_run_test(suite, test_exclusive, &mech); #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE - abts_run_test(suite, test_exclusive_proc_pthread, NULL); + mech = APR_LOCK_PROC_PTHREAD; + abts_run_test(suite, test_exclusive, &mech); #endif #if APR_HAS_FCNTL_SERIALIZE - abts_run_test(suite, test_exclusive_fcntl, NULL); + mech = APR_LOCK_FCNTL; + abts_run_test(suite, test_exclusive, &mech); #endif #if APR_HAS_FLOCK_SERIALIZE - abts_run_test(suite, test_exclusive_flock, NULL); + mech = APR_LOCK_FLOCK; + abts_run_test(suite, test_exclusive, &mech); #endif return suite; From b17a481cc3fc063a80973c03dbf66d58a92985c9 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 9 Jun 2004 19:39:53 +0000 Subject: [PATCH 5047/7878] Use abts_log_message to log data about which test is being run. (This highlites a problem with abts which will be fixed shortly, namely it is too hard to use abts_log_message with a format string). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65176 13f79535-47bb-0310-9956-ffa450edef68 --- test/testglobalmutex.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index 917ad92af53..7248c3dda8a 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -78,6 +78,8 @@ static void test_exclusive(abts_case *tc, void *data) apr_status_t rv; apr_global_mutex_t *global_lock; int x = 0; + abts_log_message("lock mechanism is: "); + abts_log_message(mutexname(mech)); rv = apr_global_mutex_create(&global_lock, LOCKNAME, mech, p); APR_ASSERT_SUCCESS(tc, "Error creating mutex", rv); From 30478924d5a3a79a2004dfc0da21291806b56506 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 10 Jun 2004 08:31:45 +0000 Subject: [PATCH 5048/7878] * test/testglobalmutex.c (testglobalmutex): Fix declaration. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65177 13f79535-47bb-0310-9956-ffa450edef68 --- test/testglobalmutex.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index 7248c3dda8a..1a7901ab225 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -104,11 +104,9 @@ static void test_exclusive(abts_case *tc, void *data) abts_suite *testglobalmutex(abts_suite *suite) { - suite = ADD_SUITE(suite) - - apr_lockmech_e mech; + apr_lockmech_e mech = APR_LOCK_DEFAULT; - mech = APR_LOCK_DEFAULT; + suite = ADD_SUITE(suite) abts_run_test(suite, test_exclusive, &mech); #if APR_HAS_POSIXSEM_SERIALIZE mech = APR_LOCK_POSIXSEM; From f2bd98f55e34d66e3d39f6a6c66742e4700a7c00 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 10 Jun 2004 09:05:07 +0000 Subject: [PATCH 5049/7878] * test/Makefile.in (libmod_test.la): Link against dependencies for platforms where libraries can have no undefined symbols. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65178 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index 84548b83d77..1c0c324d194 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -74,7 +74,7 @@ mod_test.la: mod_test.slo $(LOCAL_LIBS) $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ libmod_test.la: mod_test.slo $(LOCAL_LIBS) - $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ + $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $(LOCAL_LIBS) $(ALL_LIBS) testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS) $(LINK_PROG) testlockperf.lo $(LOCAL_LIBS) $(ALL_LIBS) From 277662fe8e5caa548ca573c0b0c92bd7f6b98a4e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 10 Jun 2004 10:57:25 +0000 Subject: [PATCH 5050/7878] Add apr_threadattr_guardsize_set function, which allows changing the thread guard area size attribute for newly created threads. * configure.in: Check for pthread_attr_setguardsize. * include/apr_thread_proc.h (apr_threadattr_guardsize_set): Add prototype. * threadproc/unix/thread.c (apr_threadattr_guardsize_set): Add function. * threadproc/os2/thread.c, threadproc/win32/thread.c, threadproc/beos/thread.c, threadproc/netware/thread.c (apr_threadattr_guardsize_set): Add ENOTIMPL stubs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65179 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 +++------- include/apr_thread_proc.h | 13 +++++++++++++ threadproc/beos/thread.c | 6 ++++++ threadproc/netware/thread.c | 6 ++++++ threadproc/os2/thread.c | 6 ++++++ threadproc/unix/thread.c | 19 +++++++++++++++++++ threadproc/win32/thread.c | 6 ++++++ 7 files changed, 59 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index ddead0505a4..9a0b9ab514e 100644 --- a/configure.in +++ b/configure.in @@ -578,7 +578,8 @@ else APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG APR_CHECK_PTHREAD_RECURSIVE_MUTEX - AC_CHECK_FUNCS(pthread_key_delete pthread_rwlock_init) + AC_CHECK_FUNCS([pthread_key_delete pthread_rwlock_init \ + pthread_attr_setguardsize]) if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then dnl ----------------------------- Checking for pthread_rwlock_t @@ -1598,7 +1599,7 @@ APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl # See which lock mechanism we'll select by default on this system. # The last APR_DECIDE to execute sets the default. # At this stage, we match the ordering in Apache 1.3 -# which is (highest to lowest): pthread -> posixsem -> sysvsem -> fcntl -> flock +# which is (highest to lowest): posixsem -> sysvsem -> fcntl -> flock # APR_BEGIN_DECISION([apr_lock implementation method]) APR_IFALLYES(func:flock define:LOCK_EX, @@ -1610,11 +1611,6 @@ APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, APR_IFALLYES(header:semaphore.h func:sem_open func_sem_close dnl func_sem_unlink func:sem_post func_sem_wait, APR_DECIDE(USE_POSIXSEM_SERIALIZE, [POSIX sem_open()])) -# note: the current APR use of shared mutex requires /dev/zero -APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl - func:pthread_mutexattr_setpshared dnl - file:/dev/zero, - APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) fi diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index bd783bf90f0..ab7b2fed3f9 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -223,6 +223,19 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr); APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, apr_size_t stacksize); +/** + * Set the stack guard area size of newly created threads. + * @param attr The threadattr to affect + * @param guardsize The stack guard area size in bytes + * @note Thread library implementations commonly use a "guard area" + * after each thread's stack which is not readable or writable such that + * stack overflows cause a segfault; this consumes e.g. 4K of memory + * and increases memory management overhead. Setting the guard area + * size to zero hence trades off reliable behaviour on stack overflow + * for performance. */ +APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, + apr_size_t guardsize); + /** * Create a new thread of execution * @param new_thread The newly created thread handle. diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 15f1ca09102..7c63bf7af4a 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -55,6 +55,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, return APR_ENOTIMPL; } +APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, + apr_size_t size) +{ + return APR_ENOTIMPL; +} + static void *dummy_worker(void *opaque) { apr_thread_t *thd = (apr_thread_t*)opaque; diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 1703b55b123..466d9911557 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -57,6 +57,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, + apr_size_t size) +{ + return APR_ENOTIMPL; +} + static void *dummy_worker(void *opaque) { apr_thread_t *thd = (apr_thread_t *)opaque; diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 24b29f680b0..582ad78a25b 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -59,6 +59,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, + apr_size_t size) +{ + return APR_ENOTIMPL; +} + static void apr_thread_begin(void *arg) { apr_thread_t *thread = (apr_thread_t *)arg; diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 00eee7ea3a2..d906e095464 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -94,6 +94,25 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, return stat; } +APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, + apr_size_t size) +{ +#ifdef HAVE_PTHREAD_ATTR_SETGUARDSIZE + apr_status_t rv; + + rv = pthread_attr_setguardsize(&attr->attr, size); + if (rv == 0) { + return APR_SUCCESS; + } +#ifdef PTHREAD_SETS_ERRNO + rv = errno; +#endif + return rv; +#else + return APR_ENOTIMPL; +#endif +} + static void *dummy_worker(void *opaque) { apr_thread_t *thread = (apr_thread_t*)opaque; diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 92b6755a6a0..364d23274be 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -65,6 +65,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, + apr_size_t size) +{ + return APR_ENOTIMPL; +} + static void *dummy_worker(void *opaque) { apr_thread_t *thd = (apr_thread_t *)opaque; From 8f58af9eca8f293f22361ba662d2d6690d5becec Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 10 Jun 2004 10:59:03 +0000 Subject: [PATCH 5051/7878] Revert accidental commit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65180 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 9a0b9ab514e..01f600490e8 100644 --- a/configure.in +++ b/configure.in @@ -1599,7 +1599,7 @@ APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl # See which lock mechanism we'll select by default on this system. # The last APR_DECIDE to execute sets the default. # At this stage, we match the ordering in Apache 1.3 -# which is (highest to lowest): posixsem -> sysvsem -> fcntl -> flock +# which is (highest to lowest): pthread -> posixsem -> sysvsem -> fcntl -> flock # APR_BEGIN_DECISION([apr_lock implementation method]) APR_IFALLYES(func:flock define:LOCK_EX, @@ -1611,6 +1611,11 @@ APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, APR_IFALLYES(header:semaphore.h func:sem_open func_sem_close dnl func_sem_unlink func:sem_post func_sem_wait, APR_DECIDE(USE_POSIXSEM_SERIALIZE, [POSIX sem_open()])) +# note: the current APR use of shared mutex requires /dev/zero +APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl + func:pthread_mutexattr_setpshared dnl + file:/dev/zero, + APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) fi From 7e687a3503f8d79a93f93d3aefdaff718efac3dc Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 11 Jun 2004 15:00:21 +0000 Subject: [PATCH 5052/7878] Don't try to enable run-time linking on AIX < 4.2, as this results in invalid linker options being used. PR: 29170 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65182 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 43df16c139f..e6e7a9c8670 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -63,7 +63,13 @@ if test "x$apr_preload_done" != "xyes" ; then fi APR_SETIFNULL(apr_sysvsem_is_global, [yes]) APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE]) - APR_ADDTO(LDFLAGS, [-Wl,-brtl]) + case $host in + *-ibm-aix3* | *-ibm-aix4.1.*) + ;; + *) + APR_ADDTO(LDFLAGS, [-Wl,-brtl]) + ;; + esac ;; *-apollo-*) APR_ADDTO(CPPFLAGS, [-DAPOLLO]) From b63e407dc14be14abdf1df55af6ce17b372ea19c Mon Sep 17 00:00:00 2001 From: Jean-Jacques Clar Date: Fri, 11 Jun 2004 20:13:19 +0000 Subject: [PATCH 5053/7878] Added NetWare specific option in apr_cmdtype_e to start program in a separate address space for cmdtype field in apr_procattr_t struct git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65183 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index ab7b2fed3f9..c3c8289edf4 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -42,10 +42,13 @@ extern "C" { */ typedef enum { - APR_SHELLCMD, /**< use the shell to invoke the program */ - APR_PROGRAM, /**< invoke the program directly, no copied env */ - APR_PROGRAM_ENV, /**< invoke the program, replicating our environment */ - APR_PROGRAM_PATH /**< find program on PATH, use our environment */ +#ifdef NETWARE + APR_PROGRAM_ADDRSPACE, /**< invoke the program in its own address space */ +#endif + APR_SHELLCMD, /**< use the shell to invoke the program */ + APR_PROGRAM, /**< invoke the program directly, no copied env */ + APR_PROGRAM_ENV, /**< invoke the program, replicating our environment */ + APR_PROGRAM_PATH /**< find program on PATH, use our environment */ } apr_cmdtype_e; typedef enum { From 7c4a77fde370f5cfe6f70eaaa97594bbe6cc20ca Mon Sep 17 00:00:00 2001 From: Jean-Jacques Clar Date: Fri, 11 Jun 2004 20:23:09 +0000 Subject: [PATCH 5054/7878] Replaced APR_PROGRAM_ENV with new enum APR_PROGRAM_ADDRSPACE when starting a child program git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65184 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index dce5758f758..2b397357686 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -173,9 +173,8 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) { - if ((cmd != APR_PROGRAM) && (cmd != APR_PROGRAM_ENV)) - return APR_ENOTIMPL; - attr->cmdtype = cmd; + if (cmd == APR_PROGRAM_ADDRSPACE) + attr->cmdtype = cmd; return APR_SUCCESS; } @@ -288,7 +287,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, /* attr->detached and PROC_DETACHED do not mean the same thing. attr->detached means * start the NLM in a separate address space. PROC_DETACHED means don't wait for the * NLM to unload by calling wait() or waitpid(), just clean up */ - addr_space = PROC_LOAD_SILENT | ((attr->cmdtype == APR_PROGRAM_ENV) ? 0 : PROC_CURRENT_SPACE); + addr_space = PROC_LOAD_SILENT | ((attr->cmdtype == APR_PROGRAM_ADDRSPACE) ? 0 : PROC_CURRENT_SPACE); addr_space |= (attr->detached ? PROC_DETACHED : 0); if (attr->currdir) { From 16fc61822f628fe539c6702291f8c30a4f531033 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Jun 2004 08:53:31 +0000 Subject: [PATCH 5055/7878] Support POSIX semaphores on LP64 platforms: * configure.in: Don't disable POSIX semaphore support on LP64 platforms. * include/arch/unix/apr_arch_proc_mutex.h (struct apr_proc_mutex_t): Add a sem_t pointer field. * locks/unix/proc_mutex.c (proc_mutex_posix_create, proc_mutex_posix_cleanup, proc_mutex_posix_acquire, prox_mutex_posix_release): Use the sem_t pointer not the fd for the semaphore. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65185 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 -- include/arch/unix/apr_arch_proc_mutex.h | 3 +++ locks/unix/proc_mutex.c | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 01f600490e8..01871721ce9 100644 --- a/configure.in +++ b/configure.in @@ -1492,8 +1492,6 @@ main() sem_t *psem; const char *sem_name = "/apr_autoconf"; - if (sizeof(int) < sizeof(sem_t *)) - exit(1); psem = sem_open(sem_name, O_CREAT, 0644, 1); if (psem == (sem_t *)SEM_FAILED) { exit(1); diff --git a/include/arch/unix/apr_arch_proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h index 40dcc7e1f72..1a3a4fc0115 100644 --- a/include/arch/unix/apr_arch_proc_mutex.h +++ b/include/arch/unix/apr_arch_proc_mutex.h @@ -98,6 +98,9 @@ struct apr_proc_mutex_t { #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE apr_file_t *interproc; #endif +#if APR_HAS_POSIXSEM_SERIALIZE + sem_t *psem_interproc; +#endif #if APR_HAS_PROC_PTHREAD_SERIALIZE pthread_mutex_t *pthread_interproc; #endif diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index a401f15fc63..9d1c90b6391 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -50,7 +50,7 @@ static apr_status_t proc_mutex_posix_cleanup(void *mutex_) apr_status_t stat = APR_SUCCESS; if (mutex->interproc->filedes != -1) { - if (sem_close((sem_t *)mutex->interproc->filedes) < 0) { + if (sem_close(mutex->psem_interproc) < 0) { stat = errno; } } @@ -113,7 +113,7 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, } /* Ahhh. The joys of Posix sems. Predelete it... */ sem_unlink((const char *) semname); - new_mutex->interproc->filedes = (int)psem; /* Ugg */ + new_mutex->psem_interproc = psem; new_mutex->fname = apr_pstrdup(new_mutex->pool, semname); apr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, apr_proc_mutex_cleanup, @@ -125,7 +125,7 @@ static apr_status_t proc_mutex_posix_acquire(apr_proc_mutex_t *mutex) { int rc; - if ((rc = sem_wait((sem_t *)mutex->interproc->filedes)) < 0) { + if ((rc = sem_wait(mutex->psem_interproc)) < 0) { return errno; } mutex->curr_locked = 1; @@ -137,7 +137,7 @@ static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) int rc; mutex->curr_locked = 0; - if ((rc = sem_post((sem_t *)mutex->interproc->filedes)) < 0) { + if ((rc = sem_post(mutex->psem_interproc)) < 0) { return errno; } return APR_SUCCESS; From 748433585b01e6b56417d5ba968f343bc15f45af Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Jun 2004 09:09:05 +0000 Subject: [PATCH 5056/7878] * test/testprocmutex.c (test_exclusive): Take lock type parameter. (proc_mutex): Pass lock type parameter. (testprocmutex): Test all supported mutex types. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65186 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 10e0e62e412..17e9dbeda06 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -92,13 +92,14 @@ static void await_child(abts_case *tc, apr_proc_t *proc) rv == APR_CHILD_DONE && why == APR_PROC_EXIT && code == 0); } -static void test_exclusive(abts_case *tc, const char *lockname) +static void test_exclusive(abts_case *tc, const char *lockname, + apr_lockmech_e mech) { apr_proc_t *child[CHILDREN]; apr_status_t rv; int n; - rv = apr_proc_mutex_create(&proc_lock, lockname, APR_LOCK_DEFAULT, p); + rv = apr_proc_mutex_create(&proc_lock, lockname, mech, p); APR_ASSERT_SUCCESS(tc, "create the mutex", rv); for (n = 0; n < CHILDREN; n++) @@ -117,6 +118,7 @@ static void proc_mutex(abts_case *tc, void *data) apr_status_t rv; const char *shmname = "tpm.shm"; apr_shm_t *shm; + apr_lockmech_e *mech = data; /* Use anonymous shm if available. */ rv = apr_shm_create(&shm, sizeof(int), NULL, p); @@ -128,7 +130,7 @@ static void proc_mutex(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "create shm segment", rv); x = apr_shm_baseaddr_get(shm); - test_exclusive(tc, NULL); + test_exclusive(tc, NULL, *mech); #else ABTS_NOT_IMPL(tc, "APR lacks fork() support"); #endif @@ -137,9 +139,30 @@ static void proc_mutex(abts_case *tc, void *data) abts_suite *testprocmutex(abts_suite *suite) { - suite = ADD_SUITE(suite) + apr_lockmech_e mech = APR_LOCK_DEFAULT; - abts_run_test(suite, proc_mutex, NULL); + suite = ADD_SUITE(suite) + abts_run_test(suite, proc_mutex, &mech); +#if APR_HAS_POSIXSEM_SERIALIZE + mech = APR_LOCK_POSIXSEM; + abts_run_test(suite, proc_mutex, &mech); +#endif +#if APR_HAS_SYSVSEM_SERIALIZE + mech = APR_LOCK_SYSVSEM; + abts_run_test(suite, proc_mutex, &mech); +#endif +#if APR_HAS_PROC_PTHREAD_SERIALIZE + mech = APR_LOCK_PROC_PTHREAD; + abts_run_test(suite, proc_mutex, &mech); +#endif +#if APR_HAS_FCNTL_SERIALIZE + mech = APR_LOCK_FCNTL; + abts_run_test(suite, proc_mutex, &mech); +#endif +#if APR_HAS_FLOCK_SERIALIZE + mech = APR_LOCK_FLOCK; + abts_run_test(suite, proc_mutex, &mech); +#endif return suite; } From 0adc14385bab66591f4011568809629e897a2675 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Jun 2004 09:09:55 +0000 Subject: [PATCH 5057/7878] * locks/unix/proc_mutex.c (proc_mutex_posix_cleanup): Ignore interproc->filedes, always close the semaphore. (proc_mutex_posix_create): Don't call cleanup if sem_open failed, don't set interproc->filedes to -1. (proc_mutex_posix_acquire): Simplify error handling. (proc_mutex_posix_release): Simplify. Only clear curr_locked flag on success. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65187 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 9d1c90b6391..fda7d6ba5f6 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -46,22 +46,19 @@ static apr_status_t proc_mutex_no_child_init(apr_proc_mutex_t **mutex, static apr_status_t proc_mutex_posix_cleanup(void *mutex_) { - apr_proc_mutex_t *mutex=mutex_; - apr_status_t stat = APR_SUCCESS; + apr_proc_mutex_t *mutex = mutex_; - if (mutex->interproc->filedes != -1) { - if (sem_close(mutex->psem_interproc) < 0) { - stat = errno; - } + if (sem_close(mutex->psem_interproc) < 0) { + return errno; } - return stat; + + return APR_SUCCESS; } static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, const char *fname) { sem_t *psem; - apr_status_t stat; char semname[31]; apr_time_t now; unsigned long sec; @@ -69,7 +66,6 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, new_mutex->interproc = apr_palloc(new_mutex->pool, sizeof(*new_mutex->interproc)); - new_mutex->interproc->filedes = -1; /* * This bogusness is to follow what appears to be the * lowest common denominator in Posix semaphore naming: @@ -107,9 +103,7 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, } if (psem == (sem_t *)SEM_FAILED) { - stat = errno; - proc_mutex_posix_cleanup(new_mutex); - return stat; + return errno; } /* Ahhh. The joys of Posix sems. Predelete it... */ sem_unlink((const char *) semname); @@ -123,9 +117,7 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, static apr_status_t proc_mutex_posix_acquire(apr_proc_mutex_t *mutex) { - int rc; - - if ((rc = sem_wait(mutex->psem_interproc)) < 0) { + if (sem_wait(mutex->psem_interproc) < 0) { return errno; } mutex->curr_locked = 1; @@ -134,12 +126,10 @@ static apr_status_t proc_mutex_posix_acquire(apr_proc_mutex_t *mutex) static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) { - int rc; - - mutex->curr_locked = 0; - if ((rc = sem_post(mutex->psem_interproc)) < 0) { + if (sem_post(mutex->psem_interproc) < 0) { return errno; } + mutex->curr_locked = 0; return APR_SUCCESS; } From db77c328eeb69491b33dc020680e08c7238a9037 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Jun 2004 09:13:36 +0000 Subject: [PATCH 5058/7878] * locks/unix/proc_mutex.c (proc_mutex_pthread_create): Don't leak an fd on mmap failure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65188 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index fda7d6ba5f6..541743accbc 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -290,6 +290,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (new_mutex->pthread_interproc == (pthread_mutex_t *) (caddr_t) -1) { + close(fd); return errno; } close(fd); From 0fba8c0366c97d62e94a84e3c48ac87fbdfb8798 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Jun 2004 09:19:15 +0000 Subject: [PATCH 5059/7878] * locks/unix/proc_mutex.c (proc_mutex_proc_pthread_cleanup): Fix memory leakup; always unmap the mmap'ed region. PR: 24049 Submitted by: Kohn Emil Dan git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65189 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 541743accbc..ddc581caa22 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -264,13 +264,13 @@ static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_) rv = errno; #endif return rv; - } - if (munmap((caddr_t)mutex->pthread_interproc, sizeof(pthread_mutex_t))){ - return errno; } } + if (munmap((caddr_t)mutex->pthread_interproc, sizeof(pthread_mutex_t))) { + return errno; + } return APR_SUCCESS; -} +} static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, const char *fname) From e9ef0ace6a61068114023805038d8c70f0a5bd9c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Jun 2004 09:41:04 +0000 Subject: [PATCH 5060/7878] * locks/unix/proc_mutex.c (proc_mutex_proc_pthread_cleanup): Fix resource leak: destroy the mutex here, if it was ever initialized. (proc_mutex_proc_pthread_create): Destroy the mutexattr object on error paths; ensure that _cleanup destroys the mutex on error paths iff necessary. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65190 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index ddc581caa22..abc73291472 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -262,6 +262,15 @@ static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_) if ((rv = pthread_mutex_unlock(mutex->pthread_interproc))) { #ifdef PTHREAD_SETS_ERRNO rv = errno; +#endif + return rv; + } + } + /* curr_locked is set to -1 until the mutex has been created */ + if (mutex->curr_locked != -1) { + if ((rv = pthread_mutex_destroy(mutex->pthread_interproc))) { +#ifdef PTHREAD_SETS_ERRNO + rv = errno; #endif return rv; } @@ -294,6 +303,9 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, return errno; } close(fd); + + new_mutex->curr_locked = -1; /* until the mutex has been created */ + if ((rv = pthread_mutexattr_init(&mattr))) { #ifdef PTHREAD_SETS_ERRNO rv = errno; @@ -306,6 +318,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, rv = errno; #endif proc_mutex_proc_pthread_cleanup(new_mutex); + pthread_mutexattr_destroy(&mattr); return rv; } @@ -316,6 +329,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, rv = errno; #endif proc_mutex_proc_pthread_cleanup(new_mutex); + pthread_mutexattr_destroy(&mattr); return rv; } if ((rv = pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT))) { @@ -323,6 +337,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, rv = errno; #endif proc_mutex_proc_pthread_cleanup(new_mutex); + pthread_mutexattr_destroy(&mattr); return rv; } #endif @@ -332,9 +347,12 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, rv = errno; #endif proc_mutex_proc_pthread_cleanup(new_mutex); + pthread_mutexattr_destroy(&mattr); return rv; } + new_mutex->curr_locked = 0; /* mutex created now */ + if ((rv = pthread_mutexattr_destroy(&mattr))) { #ifdef PTHREAD_SETS_ERRNO rv = errno; @@ -343,7 +361,6 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, return rv; } - new_mutex->curr_locked = 0; apr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, apr_proc_mutex_cleanup, From 1e82a3db7cc81aeb2c305fd51782816b81ca6c47 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Jun 2004 10:59:17 +0000 Subject: [PATCH 5061/7878] * locks/unix/proc_mutex.c (apr_proc_mutex_lockfile): Avoid unnecessary strcmp calls. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65191 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index abc73291472..1dfd806d939 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -815,11 +815,10 @@ APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) { - /* posix sems use the fname field but don't use a file, - * so be careful - */ - if (!strcmp(mutex->meth->name, "flock") || - !strcmp(mutex->meth->name, "fcntl")) { + /* POSIX sems use the fname field but don't use a file, + * so be careful. */ + if (mutex->meth == &mutex_flock_methods + || mutex->meth == &mutex_fcntl_methods) { return mutex->fname; } return NULL; From 0c70ecd1c5733dfdd285833be77ef04fd623d8a0 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Jun 2004 11:35:53 +0000 Subject: [PATCH 5062/7878] * locks/unix/proc_mutex.c (proc_mutex_posix_release): Revert previous change, move ->curr_locked manipulation back inside critical section. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65192 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 1dfd806d939..d80ccee5960 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -126,10 +126,12 @@ static apr_status_t proc_mutex_posix_acquire(apr_proc_mutex_t *mutex) static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) { + mutex->curr_locked = 0; if (sem_post(mutex->psem_interproc) < 0) { + /* any failure is probably fatal, so no big deal to leave + * ->curr_locked at 0. */ return errno; } - mutex->curr_locked = 0; return APR_SUCCESS; } From 0b21cc056168d56e78aea1d244e86cd49631467e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Jun 2004 12:04:42 +0000 Subject: [PATCH 5063/7878] * locks/unix/proc_mutex.c (proc_mutex_fcntl_cleanup): Always close the file. (proc_mutex_fcntl_create): Don't call _cleanup on file open failure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65193 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index d80ccee5960..4156d537fe5 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -454,10 +454,8 @@ static apr_status_t proc_mutex_fcntl_cleanup(void *mutex_) if (status != APR_SUCCESS) return status; } - if (mutex->interproc) { /* if it was opened successfully */ - apr_file_close(mutex->interproc); - } - return APR_SUCCESS; + + return apr_file_close(mutex->interproc); } static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, @@ -480,7 +478,6 @@ static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, } if (rv != APR_SUCCESS) { - proc_mutex_fcntl_cleanup(new_mutex); return rv; } From af5c620925c0570cf82ff2457701ad1335c5b47d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Jun 2004 12:16:23 +0000 Subject: [PATCH 5064/7878] * locks/unix/proc_mutex.c (apr_proc_mutex_create): Remove redundant NULL-initialization of zero-initialized field; remove redundant cast. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65194 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 4156d537fe5..5de0040e3d7 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -765,13 +765,8 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, apr_proc_mutex_t *new_mutex; apr_status_t rv; - new_mutex = (apr_proc_mutex_t *)apr_pcalloc(pool, - sizeof(apr_proc_mutex_t)); - - new_mutex->pool = pool; -#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE - new_mutex->interproc = NULL; -#endif + new_mutex = apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); + new_mutex->pool = pool; if ((rv = proc_mutex_create(new_mutex, mech, fname)) != APR_SUCCESS) return rv; From 13f514722dcef175a11134dd745fb52a301a86ce Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Jun 2004 15:08:43 +0000 Subject: [PATCH 5065/7878] * threadproc/unix/thread.c (threadattr_cleanup): New function. (apr_threadattr_create): Register cleanup for threadattr object, fix possible memory leak. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65195 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/thread.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index d906e095464..68faebeaacf 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -19,9 +19,23 @@ #if APR_HAS_THREADS -/* XXX: missing a cleanup, pthread_attr_destroy is never called! */ - #if APR_HAVE_PTHREAD_H + +/* Destroy the threadattr object */ +static apr_status_t threadattr_cleanup(void *data) +{ + apr_threadattr_t *attr = data; + apr_status_t rv; + + rv = pthread_attr_destroy(&attr->attr); +#ifdef PTHREAD_SETS_ERRNO + if (rv) { + rv = errno; + } +#endif + return rv; +} + APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *pool) { @@ -32,6 +46,8 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, stat = pthread_attr_init(&(*new)->attr); if (stat == 0) { + apr_pool_cleanup_register(pool, *new, threadattr_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } #ifdef PTHREAD_SETS_ERRNO From cb1fc6d07b7b885c10b4a28f53e69a468740a414 Mon Sep 17 00:00:00 2001 From: Jean-Jacques Clar Date: Mon, 14 Jun 2004 17:26:20 +0000 Subject: [PATCH 5066/7878] Added new APR API to load child process in current or new address space (NetWare ONLY). Replaced changes that added APR_PROGRAM_ADDRSPACE committed 6/11/04. Reviewed by Brad Nicholes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65196 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 12 +++++++++--- include/arch/netware/apr_arch_threadproc.h | 1 + threadproc/beos/proc.c | 7 +++++++ threadproc/netware/proc.c | 12 +++++++++--- threadproc/os2/proc.c | 7 +++++++ threadproc/unix/proc.c | 7 +++++++ threadproc/win32/proc.c | 7 +++++++ 7 files changed, 47 insertions(+), 6 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index c3c8289edf4..fd3ba8b5a02 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -42,9 +42,6 @@ extern "C" { */ typedef enum { -#ifdef NETWARE - APR_PROGRAM_ADDRSPACE, /**< invoke the program in its own address space */ -#endif APR_SHELLCMD, /**< use the shell to invoke the program */ APR_PROGRAM, /**< invoke the program directly, no copied env */ APR_PROGRAM_ENV, /**< invoke the program, replicating our environment */ @@ -517,6 +514,15 @@ APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, apr_int32_t chk); +/** + * Determine if the child should start in its own address space or using the + * current one from its parent + * @param attr The procattr we care about. + * @param addrspace Should the child start in ouw address space? Default is no. + */ +APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, + apr_int32_t addrspace); + #if APR_HAS_FORK /** * This is currently the only non-portable call in APR. This executes diff --git a/include/arch/netware/apr_arch_threadproc.h b/include/arch/netware/apr_arch_threadproc.h index 39b79aeb11e..5f5ddcff6ba 100644 --- a/include/arch/netware/apr_arch_threadproc.h +++ b/include/arch/netware/apr_arch_threadproc.h @@ -60,6 +60,7 @@ struct apr_procattr_t { char *currdir; apr_int32_t cmdtype; apr_int32_t detached; + apr_int32_t addrspace; }; struct apr_thread_once_t { diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index ff6ac1e0da9..d3eb4cd7d5e 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -178,6 +178,13 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, + apr_int32_t addrspace) +{ + /* won't ever be used on this platform, so don't save the flag */ + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, const char * const *env, diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 2b397357686..52c1495b7f9 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -173,8 +173,7 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd) { - if (cmd == APR_PROGRAM_ADDRSPACE) - attr->cmdtype = cmd; + /* won't ever be called on this platform, so don't save the function pointer */ return APR_SUCCESS; } @@ -266,6 +265,13 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, + apr_int32_t addrspace) +{ + attr->addrspace = addrspace; + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, const char *progname, const char * const *args, @@ -287,7 +293,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, /* attr->detached and PROC_DETACHED do not mean the same thing. attr->detached means * start the NLM in a separate address space. PROC_DETACHED means don't wait for the * NLM to unload by calling wait() or waitpid(), just clean up */ - addr_space = PROC_LOAD_SILENT | ((attr->cmdtype == APR_PROGRAM_ADDRSPACE) ? 0 : PROC_CURRENT_SPACE); + addr_space = PROC_LOAD_SILENT | (attr->addrspace ? 0 : PROC_CURRENT_SPACE); addr_space |= (attr->detached ? PROC_DETACHED : 0); if (attr->currdir) { diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 8fa508fef45..c0ff5840765 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -255,6 +255,13 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, + apr_int32_t addrspace) +{ + /* won't ever be used on this platform, so don't save the flag */ + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname, diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index ab5018cf64c..5c5536b2211 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -273,6 +273,13 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, + apr_int32_t addrspace) +{ + /* won't ever be used on this platform, so don't save the flag */ + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 777367304b0..3073b1a2712 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -256,6 +256,13 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, + apr_int32_t addrspace) +{ + /* won't ever be used on this platform, so don't save the flag */ + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, From 48b446d3698363aecbf2dfcab6f3461b22289a6f Mon Sep 17 00:00:00 2001 From: Jean-Jacques Clar Date: Mon, 14 Jun 2004 19:36:58 +0000 Subject: [PATCH 5067/7878] Fixed typo in API description git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65197 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index fd3ba8b5a02..558cf50015c 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -518,7 +518,7 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, * Determine if the child should start in its own address space or using the * current one from its parent * @param attr The procattr we care about. - * @param addrspace Should the child start in ouw address space? Default is no. + * @param addrspace Should the child start in its own address space? Default is no. */ APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, apr_int32_t addrspace); From 62854399293cf2664494fd0fc1472b9e19fc33b9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Jun 2004 21:16:40 +0000 Subject: [PATCH 5068/7878] * configure.in: Don't use POSIX semaphores or cross-process pthread mutexes as the default inter-process locking mechanism. * build/apr_hints.m4: Force default inter-process locking mechanism to fcntl for Solaris, as per 1.3. Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65198 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++++++ build/apr_hints.m4 | 1 + configure.in | 14 ++++---------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 011924ffaf9..23499f34732 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,14 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Change default inter-process locking mechanisms: POSIX semaphores + and pthread cross-process mutexes are not used by default; on + Solaris, fcntl locks are used by default. [Joe Orton] + + *) Add apr_threadattr_guardsize_set() for overriding the default stack + guard area size for created created by apr_thread_create(). + [Joe Orton] + *) Add apr_shm_remove() function for removing a named shared memory segment. [Amit Athavale ] diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index e6e7a9c8670..00316d00b08 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -198,6 +198,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-solaris2*) PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT]) + APR_SETIFNULL(apr_lock_method, [USE_FCNTL_SERIALIZE]) ;; *-sunos4*) APR_ADDTO(CPPFLAGS, [-DSUNOS4]) diff --git a/configure.in b/configure.in index 01871721ce9..493669abf74 100644 --- a/configure.in +++ b/configure.in @@ -1597,8 +1597,10 @@ APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl # See which lock mechanism we'll select by default on this system. # The last APR_DECIDE to execute sets the default. # At this stage, we match the ordering in Apache 1.3 -# which is (highest to lowest): pthread -> posixsem -> sysvsem -> fcntl -> flock -# +# which is (highest to lowest): sysvsem -> fcntl -> flock. +# POSIX semaphores and cross-process pthread mutexes are not +# used by default since they have less desirable behaviour when +# e.g. a process holding the mutex segfaults. APR_BEGIN_DECISION([apr_lock implementation method]) APR_IFALLYES(func:flock define:LOCK_EX, APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) @@ -1606,14 +1608,6 @@ APR_IFALLYES(header:fcntl.h define:F_SETLK, APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) -APR_IFALLYES(header:semaphore.h func:sem_open func_sem_close dnl - func_sem_unlink func:sem_post func_sem_wait, - APR_DECIDE(USE_POSIXSEM_SERIALIZE, [POSIX sem_open()])) -# note: the current APR use of shared mutex requires /dev/zero -APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl - func:pthread_mutexattr_setpshared dnl - file:/dev/zero, - APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) fi From 606f07b3223216e80fce30d8db7aaaab99bfdc2a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Jun 2004 22:24:56 +0000 Subject: [PATCH 5069/7878] * threadproc/unix/thread.c (apr_threadattr_detach_set): Fix for Mac OS X: pass valid arguments to pthread_attr_setdetachstate. * include/apr_thread_proc.h: Clarify apr_threadattr_detach_{set,get} interfaces. PR: 28472 Submitted by: INOUE Seiichiro git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65199 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_thread_proc.h | 8 +++++--- threadproc/unix/thread.c | 8 +++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 23499f34732..77c0efed2ea 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Fix apr_threadattr_detach_set() on Mac OS X. PR 28472. + [INOUE Seiichiro ] + *) Change default inter-process locking mechanisms: POSIX semaphores and pthread cross-process mutexes are not used by default; on Solaris, fcntl locks are used by default. [Joe Orton] diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 558cf50015c..090f6bfb180 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -204,14 +204,16 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new_attr, /** * Set if newly created threads should be created in detached state. * @param attr The threadattr to affect - * @param on Thread detach state on or off + * @param on Non-zero if detached threads should be created. */ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, - apr_int32_t on); + apr_int32_t on); /** * Get the detach state for this threadattr. - * @param attr The threadattr to reference + * @param attr The threadattr to reference + * @return APR_DETACH if threads are to be detached, or APR_NOTDETACH + * if threads are to be joinable. */ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr); diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 68faebeaacf..ef0aa21b940 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -57,18 +57,20 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, return stat; } +#define DETACH_ARG(v) ((v) ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE) + APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) { apr_status_t stat; #ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR - int arg = on; + int arg = DETACH_ARG(v); if ((stat = pthread_attr_setdetachstate(&attr->attr, &arg)) == 0) { #else - if ((stat = pthread_attr_setdetachstate(&attr->attr, on)) == 0) { + if ((stat = pthread_attr_setdetachstate(&attr->attr, + DETACH_ARG(on))) == 0) { #endif - return APR_SUCCESS; } else { From 8a1d73daa0ea629d5dc1d0a4efa1e40d6d45655c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 15 Jun 2004 08:21:22 +0000 Subject: [PATCH 5070/7878] * locks/unix/proc_mutex.c (apr_proc_mutex_lockfile): Fix build on platforms without flock. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65200 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 5de0040e3d7..2e614b2322f 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -811,10 +811,16 @@ APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) { /* POSIX sems use the fname field but don't use a file, * so be careful. */ - if (mutex->meth == &mutex_flock_methods - || mutex->meth == &mutex_fcntl_methods) { +#if APR_HAS_FLOCK_SERIALIZE + if (mutex->meth == &mutex_flock_methods) { + return mutex->fname; + } +#endif +#if APR_HAS_FCNTL_SERIALIZE + if (mutex->meth == &mutex_fcntl_methods) { return mutex->fname; } +#endif return NULL; } From 3a9b49eee0e71406d5d9be8a290b8dcf8d80fd63 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 15 Jun 2004 10:27:58 +0000 Subject: [PATCH 5071/7878] Update STATUS damn it's hot again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65201 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/STATUS b/STATUS index 8c837240973..7915ef8e82f 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2004/06/04 09:38:50 $] +Last modified at [$Date: 2004/06/15 10:27:58 $] Release: @@ -119,7 +119,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: as apr_thread_exit(). See Message-Id: for thread discussing this. - +1: BrianH, Aaron + +1: BrianH, Aaron, david * Need some architecture/OS specific versions of the atomic operations. progress: generic, solaris Sparc, FreeBSD5, linux, and OS/390 done @@ -191,6 +191,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: in the production code require more thought. Status: Sander Striker is looking into this (low priority) + David says this is a 1.1 issue. + * Deal with largefiles properly on those platforms that support it. Justin says: Linux refuses to have sendfile support and largefiles @@ -433,10 +435,10 @@ Stuff waiting for code thawing after Beta 1: (Not sure if the negatives would stay negative given that the change would now wait for the library versioning thing described above, though.) - Justin says: If you do this, please move it into apr-util where md5 - belongs! You'll have to address the random issue in - misc/unix/getuuid.c that forces md5 to be in APR. - Sander: +1 for the move. + + david: making the change for 1.0 should be safe. HTTPD 2.0.x will use + apr-0 which will have the apr_status_t return values. + +1 on the change. Stuff for post 1.0: From 245653f492af57cf4b3f4174bfaae848ff0d3ec9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 15 Jun 2004 10:32:16 +0000 Subject: [PATCH 5072/7878] LFS support is complete. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65202 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/STATUS b/STATUS index 7915ef8e82f..26aaa5ac41c 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2004/06/15 10:27:58 $] +Last modified at [$Date: 2004/06/15 10:32:16 $] Release: @@ -193,12 +193,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: David says this is a 1.1 issue. - * Deal with largefiles properly on those platforms that support it. - - Justin says: Linux refuses to have sendfile support and largefiles - at the same time. Largefile autoconf patch: - http://www.apache.org/~jerenkrantz/apr_largefile.m4 - * Get OTHER_CHILD support into Win32 Status: Bill S. is looking into this From ff492bc0b63b482ec2339c61e98e392dae9cddfc Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 15 Jun 2004 10:41:19 +0000 Subject: [PATCH 5073/7878] Continue campaign to kill showstoppers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65203 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 26aaa5ac41c..cce57c64028 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2004/06/15 10:32:16 $] +Last modified at [$Date: 2004/06/15 10:41:19 $] Release: @@ -62,6 +62,8 @@ RELEASE 1.0 SHOWSTOPPERS: apr.hnw (READDIR_IS_THREAD_SAFE, ENUM_BITFIELD, _POSIX_THREAD_SAFE_FUNCTIONS (?)) + Not a showstopper: Justin + * Flush out the test suite and make sure it passes on all platforms. We currently have about 450 functions in APR and 147 tests. That @@ -70,11 +72,15 @@ RELEASE 1.0 SHOWSTOPPERS: unified test suite, and adding more tests to make the suite comprehensive. + Not a showstopper: Justin + * Eliminate the TODO's and XXX's by using the doxygen @bug feature to allow us to better track the open issues, and provide historical bug lists that help porters understand what was wrong in the old versions of APR that they would be upgrading from. + Not a showstopper: Justin + CURRENT VOTES: @@ -119,7 +125,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: as apr_thread_exit(). See Message-Id: for thread discussing this. - +1: BrianH, Aaron, david + +1: BrianH, Aaron, david, jerenkrantz * Need some architecture/OS specific versions of the atomic operations. progress: generic, solaris Sparc, FreeBSD5, linux, and OS/390 done From 30d8cd5f6339a8db7f62050ab081957e0bd5c14d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 15 Jun 2004 20:51:25 +0000 Subject: [PATCH 5074/7878] indicate that default on address space differs among platforms git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65204 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 090f6bfb180..47e443c3b3c 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -520,7 +520,8 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, * Determine if the child should start in its own address space or using the * current one from its parent * @param attr The procattr we care about. - * @param addrspace Should the child start in its own address space? Default is no. + * @param addrspace Should the child start in its own address space? Default + * is no on NetWare and yes on other platforms. */ APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, apr_int32_t addrspace); From 9a6eba631759cb3659229cfb2207949e1a594600 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 16 Jun 2004 12:13:50 +0000 Subject: [PATCH 5075/7878] 3cents git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65205 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/STATUS b/STATUS index cce57c64028..9c23726c9ea 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2004/06/15 10:41:19 $] +Last modified at [$Date: 2004/06/16 12:13:50 $] Release: @@ -62,7 +62,7 @@ RELEASE 1.0 SHOWSTOPPERS: apr.hnw (READDIR_IS_THREAD_SAFE, ENUM_BITFIELD, _POSIX_THREAD_SAFE_FUNCTIONS (?)) - Not a showstopper: Justin + Not a showstopper: Justin, trawick * Flush out the test suite and make sure it passes on all platforms. @@ -72,14 +72,14 @@ RELEASE 1.0 SHOWSTOPPERS: unified test suite, and adding more tests to make the suite comprehensive. - Not a showstopper: Justin + Not a showstopper: Justin, trawick * Eliminate the TODO's and XXX's by using the doxygen @bug feature to allow us to better track the open issues, and provide historical bug lists that help porters understand what was wrong in the old versions of APR that they would be upgrading from. - Not a showstopper: Justin + Not a showstopper: Justin, trawick CURRENT VOTES: From f586c81c5192badba93ddae41015cb4e5acaeadc Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 17 Jun 2004 14:13:58 +0000 Subject: [PATCH 5076/7878] Reuse cleanup structures to prevent memory consumption from repeated register/kill of a cleanup against a single pool: * memory/unix/apr_pools.c (struct apr_pool_t): Add freelist for cleanup structures. (apr_pool_cleanup_kill): Move used cleanup structures onto the freelist. (apr_pool_cleanup_register): Reuse cleanup structure if available. (apr_pool_clear, pool_clear_debug, apr_pool_create): Clear the freelist. * test/testpools.c (checker_cleanup, success_cleanup, test_cleanups): Add tests for cleanups. PR: 23567 (the easy half) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65206 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 15 ++++++++++++- test/testpools.c | 48 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 5368546794d..2ed524eb3be 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -435,6 +435,7 @@ struct apr_pool_t { apr_pool_t *sibling; apr_pool_t **ref; cleanup_t *cleanups; + cleanup_t *free_cleanups; apr_allocator_t *allocator; struct process_chain *subprocesses; apr_abortfunc_t abort_fn; @@ -674,6 +675,7 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) /* Run cleanups */ run_cleanups(&pool->cleanups); pool->cleanups = NULL; + pool->free_cleanups = NULL; /* Free subprocesses */ free_proc_chain(pool->subprocesses); @@ -801,6 +803,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, pool->abort_fn = abort_fn; pool->child = NULL; pool->cleanups = NULL; + pool->free_cleanups = NULL; pool->subprocesses = NULL; pool->user_data = NULL; pool->tag = NULL; @@ -1340,6 +1343,7 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) /* Run cleanups */ run_cleanups(&pool->cleanups); + pool->free_cleanups = NULL; pool->cleanups = NULL; /* If new child pools showed up, this is a reason to raise a flag */ @@ -1886,7 +1890,13 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, #endif /* APR_POOL_DEBUG */ if (p != NULL) { - c = (cleanup_t *)apr_palloc(p, sizeof(cleanup_t)); + if (p->free_cleanups) { + /* reuse a cleanup structure */ + c = p->free_cleanups; + p->free_cleanups = c->next; + } else { + c = apr_palloc(p, sizeof(cleanup_t)); + } c->data = data; c->plain_cleanup_fn = plain_cleanup_fn; c->child_cleanup_fn = child_cleanup_fn; @@ -1912,6 +1922,9 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, while (c) { if (c->data == data && c->plain_cleanup_fn == cleanup_fn) { *lastp = c->next; + /* move to freelist */ + c->next = p->free_cleanups; + p->free_cleanups = c; break; } diff --git a/test/testpools.c b/test/testpools.c index 18f2aa820d3..5ef6a7ef322 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -91,6 +91,53 @@ static void test_notancestor(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, 0, apr_pool_is_ancestor(pchild, pmain)); } +static apr_status_t success_cleanup(void *data) +{ + return APR_SUCCESS; +} + +static char *checker_data = "Hello, world."; + +static apr_status_t checker_cleanup(void *data) +{ + return data == checker_data ? APR_SUCCESS : APR_EGENERAL; +} + +static void test_cleanups(abts_case *tc, void *data) +{ + apr_status_t rv; + int n; + + /* do this several times to test the cleanup freelist handling. */ + for (n = 0; n < 5; n++) { + apr_pool_cleanup_register(pchild, NULL, success_cleanup, + success_cleanup); + apr_pool_cleanup_register(pchild, checker_data, checker_cleanup, + success_cleanup); + apr_pool_cleanup_register(pchild, NULL, checker_cleanup, + success_cleanup); + + rv = apr_pool_cleanup_run(p, NULL, success_cleanup); + ABTS_ASSERT(tc, "nullop cleanup run OK", rv == APR_SUCCESS); + rv = apr_pool_cleanup_run(p, checker_data, checker_cleanup); + ABTS_ASSERT(tc, "cleanup passed correct data", rv == APR_SUCCESS); + rv = apr_pool_cleanup_run(p, NULL, checker_cleanup); + ABTS_ASSERT(tc, "cleanup passed correct data", rv == APR_EGENERAL); + + if (n == 2) { + /* clear the pool to check that works */ + apr_pool_clear(pchild); + } + + if (n % 2 == 0) { + /* throw another random cleanup into the mix */ + apr_pool_cleanup_register(pchild, NULL, + apr_pool_cleanup_null, + apr_pool_cleanup_null); + } + } +} + abts_suite *testpool(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -101,6 +148,7 @@ abts_suite *testpool(abts_suite *suite) abts_run_test(suite, test_notancestor, NULL); abts_run_test(suite, alloc_bytes, NULL); abts_run_test(suite, calloc_bytes, NULL); + abts_run_test(suite, test_cleanups, NULL); return suite; } From e0a391b643f3b48279127099dbb42e980235dc92 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 18 Jun 2004 11:46:35 +0000 Subject: [PATCH 5077/7878] Following the last 2 weeks discussions, there are now no showstoppers for 1.0. Reflect that fact and add soem more comments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65207 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 129 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 65 insertions(+), 64 deletions(-) diff --git a/STATUS b/STATUS index 9c23726c9ea..e4ac93627ab 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2004/06/16 12:13:50 $] +Last modified at [$Date: 2004/06/18 11:46:35 $] Release: @@ -22,64 +22,10 @@ Release: RELEASE 0.9 SHOWSTOPPERS: - RELEASE 1.0 SHOWSTOPPERS: - * apr_global_mutex_child_init and apr_proc_mutex_child_init aren't - portable. There are a variety of problems with the locking API when it - is used with apr_create_proc instead of apr_fork. First, _child_init - doesn't take a lockmech_e parameter so it causes a segfault after the - apr_proc_create, because the proc_mutex field hasn't been initialized. - When the lockmech_e parameter is added, it _still_ doesn't work, because - some lock mechanisms expect to inherit from the parent process. For - example, sys V semaphores don't have a file to open, so the child process - can't reaquire the lock. - - jerenkrantz says: This is not a showstopper and I believe the above - analysis is slightly confusing. The real problem here is that - apr_*_mutex_child_init assumes a shared memory space - that is, the - children processes have access to the parent apr_*_mutex_t pointer. The - children just call child_init on the original, inherited apr_*_mutex_t. - Unlike globalmutexchild in test, apr_*_mutex_create is *not* intended to - be called from the child and subsequently call child_init. Instead, - apr_create_proc is intended to exec separate processes with disjoint - memory addresses. Currently, APR does not provide a cross-platform - mechanism for joining an already existing lock. A simple - 'apr_*_mutex_join' which is intended to be called from separate - processes to an already-existing lock would solve this problem. - child_init is not intended to be used this way. Even with SysV - semaphores, using IPC_PRIVATE should still work due to the parent-child - relationship. A strawman has been posted to dev@apr: - Message-Id: <213031CF0406DE1AC426A411@[10.0.1.137]> - - * Must namespace protect all include/apr_foo.h headers. Jon Travis - has especially observed these including apr within Apache-1.3. - Message-ID: <20020128100116.A4288@covalent.net> - Deprecating the symbols in 0.9, eliminating them with 1.0. - (Those problems have been fixed, but it is a good example of - what to look for.) - Some headers with issues: - apr.hnw (READDIR_IS_THREAD_SAFE, ENUM_BITFIELD, - _POSIX_THREAD_SAFE_FUNCTIONS (?)) - - Not a showstopper: Justin, trawick - - - * Flush out the test suite and make sure it passes on all platforms. - We currently have about 450 functions in APR and 147 tests. That - means we have a large number of functions that we can't verify are - actually portable. This TODO includes finishing the migration to the - unified test suite, and adding more tests to make the suite - comprehensive. - - Not a showstopper: Justin, trawick - - * Eliminate the TODO's and XXX's by using the doxygen @bug feature - to allow us to better track the open issues, and provide historical - bug lists that help porters understand what was wrong in the old - versions of APR that they would be upgrading from. - Not a showstopper: Justin, trawick +RELEASE 1.1 SHOWSTOPPERS: CURRENT VOTES: @@ -126,6 +72,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: See Message-Id: for thread discussing this. +1: BrianH, Aaron, david, jerenkrantz + Status: Will Rowe was working on this. * Need some architecture/OS specific versions of the atomic operations. progress: generic, solaris Sparc, FreeBSD5, linux, and OS/390 done @@ -403,11 +350,11 @@ Documentation that needs writing: * API documentation Ian Says: APR Stuff in now in Doxygen format, which is the first step. + David says: are we planning on doing any more? I'm tempted to remove this + item. * apr-site needs to be revamped with Anakia/XHTML. -Stuff waiting for code thawing after Beta 1: - * Identify and implement those protection bits that have general usefulness, perhaps hidden, generic read-only [immutable], effective current user permissions, etc. @@ -432,13 +379,10 @@ Stuff waiting for code thawing after Beta 1: Sander Striker +1 Greg Stein +1 Karl Fogel +1 - (Not sure if the negatives would stay negative given that the - change would now wait for the library versioning thing described - above, though.) - david: making the change for 1.0 should be safe. HTTPD 2.0.x will use - apr-0 which will have the apr_status_t return values. - +1 on the change. + david: This was rejected for 1.0 following Ben L's comment that + should we ever start using any other form of md5 (e.g. + openssl) then errors would become a distinct possibility. Stuff for post 1.0: @@ -447,3 +391,60 @@ Stuff for post 1.0: a way to support alternate allocators polymorphically without a significant performance penalty. + * apr_global_mutex_child_init and apr_proc_mutex_child_init aren't + portable. There are a variety of problems with the locking API when it + is used with apr_create_proc instead of apr_fork. First, _child_init + doesn't take a lockmech_e parameter so it causes a segfault after the + apr_proc_create, because the proc_mutex field hasn't been initialized. + When the lockmech_e parameter is added, it _still_ doesn't work, because + some lock mechanisms expect to inherit from the parent process. For + example, sys V semaphores don't have a file to open, so the child process + can't reaquire the lock. + + jerenkrantz says: This is not a showstopper and I believe the above + analysis is slightly confusing. The real problem here is that + apr_*_mutex_child_init assumes a shared memory space - that is, the + children processes have access to the parent apr_*_mutex_t pointer. The + children just call child_init on the original, inherited apr_*_mutex_t. + Unlike globalmutexchild in test, apr_*_mutex_create is *not* intended to + be called from the child and subsequently call child_init. Instead, + apr_create_proc is intended to exec separate processes with disjoint + memory addresses. Currently, APR does not provide a cross-platform + mechanism for joining an already existing lock. A simple + 'apr_*_mutex_join' which is intended to be called from separate + processes to an already-existing lock would solve this problem. + child_init is not intended to be used this way. Even with SysV + semaphores, using IPC_PRIVATE should still work due to the parent-child + relationship. A strawman has been posted to dev@apr: + Message-Id: <213031CF0406DE1AC426A411@[10.0.1.137]> + + This was listed as a showstopper for 1.0, but while the 2 patches above + exist neither was able to garner enough votes to be included in 1.0. + Will Rowe commented that a combination of the 2 would probably be the right + approach, a view that seems to have a lot of merit. Hopefully we can solve + this post 1.0. There were also enough people who felt that it wasn't a + real showstopper for it to be bumped. + + * Must namespace protect all include/apr_foo.h headers. Jon Travis + has especially observed these including apr within Apache-1.3. + Message-ID: <20020128100116.A4288@covalent.net> + Deprecating the symbols in 0.9, eliminating them with 1.0. + (Those problems have been fixed, but it is a good example of + what to look for.) + Some headers with issues: + apr.hnw (READDIR_IS_THREAD_SAFE, ENUM_BITFIELD, + _POSIX_THREAD_SAFE_FUNCTIONS (?)) + + * Flush out the test suite and make sure it passes on all platforms. + We currently have about 450 functions in APR and 147 tests. That + means we have a large number of functions that we can't verify are + actually portable. This TODO includes finishing the migration to the + unified test suite, and adding more tests to make the suite + comprehensive. + + * Eliminate the TODO's and XXX's by using the doxygen @bug feature + to allow us to better track the open issues, and provide historical + bug lists that help porters understand what was wrong in the old + versions of APR that they would be upgrading from. + + From 9529cf697c8af2352c36dcb0b610ce8dfc4bc0c7 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 18 Jun 2004 13:13:34 +0000 Subject: [PATCH 5078/7878] Add details of the releases and include the fact that 1.0.0.rc1 has been T&R'd git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65209 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/STATUS b/STATUS index e4ac93627ab..c96ce97f5cd 100644 --- a/STATUS +++ b/STATUS @@ -1,22 +1,25 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2004/06/18 11:46:35 $] - -Release: - - 0.9.3 : tagged March 30, 2003 - 0.9.2 : released March 22, 2003 - 0.9.1 : released September 11, 2002 - 0.9.0 : released August 28, 2002 - - 2.0a9 : released December 12, 2000 - 2.0a8 : released November 20, 2000 - 2.0a7 : released October 8, 2000 - 2.0a6 : released August 18, 2000 - 2.0a5 : released August 4, 2000 - 2.0a4 : released June 7, 2000 - 2.0a3 : released April 28, 2000 - 2.0a2 : released March 31, 2000 - 2.0a1 : released March 10, 2000 +Last modified at [$Date: 2004/06/18 13:13:34 $] + +Releases: + +Standalone + 1.0.0 rc1 : tagged June 18th June 2004 (APR_1_0_RC1) + 0.9.3 : tagged March 30, 2003 + 0.9.2 : released March 22, 2003 + 0.9.1 : released September 11, 2002 + 0.9.0 : released August 28, 2002 + +Bundled with httpd + 2.0a9 : released December 12, 2000 + 2.0a8 : released November 20, 2000 + 2.0a7 : released October 8, 2000 + 2.0a6 : released August 18, 2000 + 2.0a5 : released August 4, 2000 + 2.0a4 : released June 7, 2000 + 2.0a3 : released April 28, 2000 + 2.0a2 : released March 31, 2000 + 2.0a1 : released March 10, 2000 RELEASE 0.9 SHOWSTOPPERS: From 5090ed67ba7b0c65b76a72545ab7764ef4f7ed17 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 21 Jun 2004 16:08:57 +0000 Subject: [PATCH 5079/7878] Bring in the patch from apr-util that allows for NULL strings to be passed into abts_str_equal. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65210 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/abts.c b/test/abts.c index 18c6bc646ce..d10dda4d95f 100644 --- a/test/abts.c +++ b/test/abts.c @@ -259,7 +259,9 @@ void abts_str_equal(abts_case *tc, const char *expected, const char *actual, int update_status(); if (tc->failed) return; - if (!strcmp(expected, actual)) return; + if (!expected && !actual) return; + if (expected && actual) + if (!strcmp(expected, actual)) return; tc->failed = TRUE; if (verbose) { From bdf579a709bb9577cdb513d26e073ac25186fcd4 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 23 Jun 2004 11:45:41 +0000 Subject: [PATCH 5080/7878] * Makefile.in (install): Install mkdir.sh and awk scripts into installbuilddir so the standalone apr-util build can use them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65212 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index 2da5152fe57..7d9e437d07c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -82,11 +82,10 @@ install: $(TARGET_LIB) apr-config.out fi; if [ -f shlibtool ]; then \ $(LIBTOOL) --mode=install cp shlibtool $(DESTDIR)$(installbuilddir); \ - fi; - if [ -f build/apr_rules.mk ]; then \ - cp build/apr_rules.mk $(DESTDIR)$(installbuilddir); \ - fi; - + fi + for f in mkdir.sh make_exports.awk make_var_export.awk apr_rules.mk; do \ + test -f build/$${f} && cp build/$${f} $(DESTDIR)$(installbuilddir); \ + done if [ ! -d $(DESTDIR)$(bindir) ]; then \ $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(bindir); \ fi; From ac35106af4810dc3a1f66b0f68d454bea0c33058 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 23 Jun 2004 12:20:44 +0000 Subject: [PATCH 5081/7878] Add command type APR_SHELLCMD_ENV for creating a process which is started by the shell and which inherits the parent's environment variables. The immediate use for this is with Apache httpd's piped loggers, correcting a regression since 1.3. In general, applications starting child processes often want the child to run with the same environment variables, so this plugs a hole in the API. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65213 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_thread_proc.h | 9 ++++++--- threadproc/os2/proc.c | 4 +++- threadproc/unix/proc.c | 10 ++++++++-- threadproc/win32/proc.c | 6 ++++-- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 77c0efed2ea..939d52d241b 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,10 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Add command type APR_SHELLCMD_ENV for creating a process + which is started by the shell and which inherits the parent's + environment variables. [Jeff Trawick] + *) Fix apr_threadattr_detach_set() on Mac OS X. PR 28472. [INOUE Seiichiro ] diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 47e443c3b3c..68ced433b7e 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -45,7 +45,10 @@ typedef enum { APR_SHELLCMD, /**< use the shell to invoke the program */ APR_PROGRAM, /**< invoke the program directly, no copied env */ APR_PROGRAM_ENV, /**< invoke the program, replicating our environment */ - APR_PROGRAM_PATH /**< find program on PATH, use our environment */ + APR_PROGRAM_PATH, /**< find program on PATH, use our environment */ + APR_SHELLCMD_ENV, /**< use the shell to invoke the program, + * replicating our environment + */ } apr_cmdtype_e; typedef enum { @@ -546,8 +549,8 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont); * one should be the program name. * @param env The new environment table for the new process. This * should be a list of NULL-terminated strings. This argument - * is ignored for APR_PROGRAM_ENV and APR_PROGRAM_PATH types - * of commands. + * is ignored for APR_PROGRAM_ENV, APR_PROGRAM_PATH, and + * APR_SHELLCMD_ENV types of commands. * @param attr the procattr we should use to determine how to create the new * process * @param pool The pool to use. diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index c0ff5840765..4edb4522115 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -333,7 +333,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname /* ### how to handle APR_PROGRAM_ENV and APR_PROGRAM_PATH? */ - if (attr->cmdtype == APR_SHELLCMD || strcasecmp(extension, ".cmd") == 0) { + if (attr->cmdtype == APR_SHELLCMD || + attr->cmdtype == APR_SHELLCMD_ENV || + strcasecmp(extension, ".cmd") == 0) { strcpy(interpreter, "#!" SHELL_PATH); extra_arg = "/C"; } else if (stricmp(extension, ".exe") != 0) { diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 5c5536b2211..7f01425bccc 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -392,7 +392,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, exit(-1); /* We have big problems, the child should exit. */ } - if (attr->cmdtype == APR_SHELLCMD) { + if (attr->cmdtype == APR_SHELLCMD || + attr->cmdtype == APR_SHELLCMD_ENV) { int onearg_len = 0; const char *newargs[4]; @@ -443,7 +444,12 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_proc_detach(APR_PROC_DETACH_DAEMONIZE); } - execve(SHELL_PATH, (char * const *) newargs, (char * const *)env); + if (attr->cmdtype == APR_SHELLCMD) { + execve(SHELL_PATH, (char * const *) newargs, (char * const *)env); + } + else { + execv(SHELL_PATH, (char * const *)newargs); + } } else if (attr->cmdtype == APR_PROGRAM) { if (attr->detached) { diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 3073b1a2712..e7c21c10596 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -349,7 +349,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } #ifndef _WIN32_WCE - if (attr->cmdtype == APR_SHELLCMD) { + if (attr->cmdtype == APR_SHELLCMD || attr->cmdtype == APR_SHELLCMD_ENV) { char *shellcmd = getenv("COMSPEC"); if (!shellcmd) { return APR_EINVAL; @@ -445,8 +445,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } } - if (!env || attr->cmdtype == APR_PROGRAM_ENV) + if (!env || attr->cmdtype == APR_PROGRAM_ENV || + attr->cmdtype == APR_SHELLCMD_ENV) { pEnvBlock = NULL; + } else { apr_size_t iEnvBlockLen; /* From 1f1ef656b7048c30398b4458230370c7daa2ded7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 23 Jun 2004 12:52:49 +0000 Subject: [PATCH 5082/7878] fix a dangling comma (jorton mentioned "dangling slash" when I posted to the list; I never saw what was dangling until after committing :) ) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65214 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 68ced433b7e..db591699f20 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -46,7 +46,7 @@ typedef enum { APR_PROGRAM, /**< invoke the program directly, no copied env */ APR_PROGRAM_ENV, /**< invoke the program, replicating our environment */ APR_PROGRAM_PATH, /**< find program on PATH, use our environment */ - APR_SHELLCMD_ENV, /**< use the shell to invoke the program, + APR_SHELLCMD_ENV /**< use the shell to invoke the program, * replicating our environment */ } apr_cmdtype_e; From 022bc7f2213aba8fe1fd1ee7b922d5094d19e23f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 23 Jun 2004 15:28:45 +0000 Subject: [PATCH 5083/7878] sync with 0.9 branch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65216 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 939d52d241b..c5e3ff8f063 100644 --- a/CHANGES +++ b/CHANGES @@ -7,10 +7,6 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 - *) Add command type APR_SHELLCMD_ENV for creating a process - which is started by the shell and which inherits the parent's - environment variables. [Jeff Trawick] - *) Fix apr_threadattr_detach_set() on Mac OS X. PR 28472. [INOUE Seiichiro ] @@ -146,6 +142,10 @@ Changes with APR 1.0 Changes with APR 0.9.5 + *) Add command type APR_SHELLCMD_ENV for creating a process + which is started by the shell and which inherits the parent's + environment variables. [Jeff Trawick] + *) Don't assume getnameinfo() can handle IPv4-mapped IPv6 addresses on any platforms. [Jeff Trawick, Joe Orton, Colm MacCárthaigh ] From 355da2853abf7c818ccf1624fd0eb00c6d97d9fd Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 23 Jun 2004 15:32:32 +0000 Subject: [PATCH 5084/7878] add missing mention of a bug fix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65217 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index c5e3ff8f063..0c504ed3c3e 100644 --- a/CHANGES +++ b/CHANGES @@ -146,6 +146,10 @@ Changes with APR 0.9.5 which is started by the shell and which inherits the parent's environment variables. [Jeff Trawick] + *) Don't try to enable run-time linking on AIX < 4.2, as this + results in invalid linker options being used. PR 29170. + [Jeff Trawick] + *) Don't assume getnameinfo() can handle IPv4-mapped IPv6 addresses on any platforms. [Jeff Trawick, Joe Orton, Colm MacCárthaigh ] From 74f8a7846321de516a7224ffdb13d03a0619246a Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Fri, 25 Jun 2004 13:51:46 +0000 Subject: [PATCH 5085/7878] Reminder for bugginess git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65218 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index f7d0e34be80..6ab4e0322f8 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -767,6 +767,19 @@ static apr_status_t parse_network(apr_ipsubnet_t *ipsub, const char *network) if (shift < 0) { return APR_EBADIP; } +/*@@@ WARNING: BEWARE: +The man page for inet_pton()/inet_aton() et.al. says: + All numbers supplied as ``parts'' in a `.' notation may be decimal, + octal, or hexadecimal, as specified in the C language (i.e., a leading 0x + or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- + wise, the number is interpreted as decimal). +OTOH, "man atoi" says: + The atoi() function [...] is equivalent to: + (int)strtol(nptr, (char **)NULL, 10); +which forces interpretation as _decimal_. As a result, this routine will +interpret a string 0177.0000.0000.0001 as 177.0.0.1, while inet_pton() +will interpret it as 127.0.0.1! +@@@*/ octet = atoi(s); if (octet < 0 || octet > 255) { return APR_EBADIP; From 4d0995a2b60886f3f74570e8690ce5d0f346f353 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 25 Jun 2004 15:28:42 +0000 Subject: [PATCH 5086/7878] * include/apr_file_info.h: Move new APR_USETID, APR_GSETID and APR_WSTICKY constants outside 0xFFF so they are not implied by APR_OS_DEFAULT. Submitted by: Greg Hudson git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65219 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 74e0592bc90..46db6c25b65 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -75,17 +75,17 @@ typedef enum { * @{ */ -#define APR_USETID 0x0800 /**< Set user id */ +#define APR_USETID 0x8000 /**< Set user id */ #define APR_UREAD 0x0400 /**< Read by user */ #define APR_UWRITE 0x0200 /**< Write by user */ #define APR_UEXECUTE 0x0100 /**< Execute by user */ -#define APR_GSETID 0x0080 /**< Set group id */ +#define APR_GSETID 0x4000 /**< Set group id */ #define APR_GREAD 0x0040 /**< Read by group */ #define APR_GWRITE 0x0020 /**< Write by group */ #define APR_GEXECUTE 0x0010 /**< Execute by group */ -#define APR_WSTICKY 0x0008 /**< Sticky bit */ +#define APR_WSTICKY 0x2000 /**< Sticky bit */ #define APR_WREAD 0x0004 /**< Read by others */ #define APR_WWRITE 0x0002 /**< Write by others */ #define APR_WEXECUTE 0x0001 /**< Execute by others */ From 00ace26cc55e4a53e8711487602b15a6e4ac5b13 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 27 Jun 2004 11:46:42 +0000 Subject: [PATCH 5087/7878] Fix apr_snprintf() to respect precision for small floating point numbers. PR: 29621 Submitted by: Artur Zaprzala Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65222 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ strings/apr_snprintf.c | 3 ++- test/teststr.c | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 0c504ed3c3e..2e82371e1aa 100644 --- a/CHANGES +++ b/CHANGES @@ -142,6 +142,9 @@ Changes with APR 1.0 Changes with APR 0.9.5 + *) Fix apr_snprintf() to respect precision for small floating point + numbers. PR 29621. [Artur Zaprzala ] + *) Add command type APR_SHELLCMD_ENV for creating a process which is started by the shell and which inherits the parent's environment variables. [Jeff Trawick] diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 73856a257d8..fa4cee3a09d 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -132,11 +132,12 @@ static char *apr_cvt(double arg, int ndigits, int *decpt, int *sign, p1 = &buf[ndigits]; if (eflag == 0) p1 += r2; - *decpt = r2; if (p1 < &buf[0]) { + *decpt = -ndigits; buf[0] = '\0'; return (buf); } + *decpt = r2; while (p <= p1 && p < &buf[NDIG]) { arg *= 10; arg = modf(arg, &fj); diff --git a/test/teststr.c b/test/teststr.c index a046660cb53..300a1b576e6 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -125,6 +125,24 @@ static void snprintf_0nonNULL(abts_case *tc, void *data) ABTS_ASSERT(tc, "buff unmangled", strcmp(buff, "FOOBAR") != 0); } +static void snprintf_underflow(abts_case *tc, void *data) +{ + char buf[20]; + int rv; + + rv = apr_snprintf(buf, sizeof buf, "%.2f", (double)0.0001); + ABTS_INT_EQUAL(tc, 4, rv); + ABTS_STR_EQUAL(tc, "0.00", buf); + + rv = apr_snprintf(buf, sizeof buf, "%.2f", (double)0.001); + ABTS_INT_EQUAL(tc, 4, rv); + ABTS_STR_EQUAL(tc, "0.00", buf); + + rv = apr_snprintf(buf, sizeof buf, "%.2f", (double)0.01); + ABTS_INT_EQUAL(tc, 4, rv); + ABTS_STR_EQUAL(tc, "0.01", buf); +} + static void string_error(abts_case *tc, void *data) { char buf[128], *rv; @@ -267,6 +285,7 @@ abts_suite *teststr(abts_suite *suite) abts_run_test(suite, snprintf_0NULL, NULL); abts_run_test(suite, snprintf_0nonNULL, NULL); abts_run_test(suite, snprintf_noNULL, NULL); + abts_run_test(suite, snprintf_underflow, NULL); abts_run_test(suite, test_strtok, NULL); abts_run_test(suite, string_error, NULL); abts_run_test(suite, string_long, NULL); From 81221e376c4a10444fe454a26bb7b5269eca8d9b Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 28 Jun 2004 11:18:36 +0000 Subject: [PATCH 5088/7878] Incorporate suggested changes from Martin Kraemer and Will Rowe. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65223 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/proc.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index d3eb4cd7d5e..ecbb302caa2 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -114,12 +114,10 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { char * cwd; - if (strncmp("/",dir,1) != 0 ) { + if (dir[0] != '/') { cwd = (char*)malloc(sizeof(char) * PATH_MAX); getcwd(cwd, PATH_MAX); - strncat(cwd,"/\0",2); - strcat(cwd,dir); - attr->currdir = (char *)apr_pstrdup(attr->pool, cwd); + attr->currdir = (char *)apr_pstrcat(attr->pool, cwd, "/", dir, NULL); free(cwd); } else { attr->currdir = (char *)apr_pstrdup(attr->pool, dir); @@ -154,7 +152,7 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) proc->pid = pid; proc->in = NULL; proc->out = NULL; - proc->err = NULL; + proc->err = NULL; return APR_INCHILD; } proc->pid = pid; @@ -188,7 +186,8 @@ APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, const char * const *env, - apr_procattr_t *attr, apr_pool_t *pool) + apr_procattr_t *attr, + apr_pool_t *pool) { int i=0,nargs=0; char **newargs = NULL; @@ -239,7 +238,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, free (newargs[nargs]); free(newargs); - if ( newproc < B_NO_ERROR) { + if (newproc < B_NO_ERROR) { return errno; } @@ -297,7 +296,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, if (waithow != APR_WAIT) { waitpid_options |= WNOHANG; } - + if ((pstatus = waitpid(proc->pid, &exit_int, waitpid_options)) > 0) { proc->pid = pstatus; if (WIFEXITED(exit_int)) { @@ -309,6 +308,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, *exitcode = WTERMSIG(exit_int); } else { + /* unexpected condition */ return APR_EGENERAL; } @@ -317,6 +317,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, else if (pstatus == 0) { return APR_CHILD_NOTDONE; } + return errno; } From 0b4a8fb83cdbe671e14d3f40e1bfe7dd70d4c1b3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 28 Jun 2004 18:06:11 +0000 Subject: [PATCH 5089/7878] Simplify excessive copies when the string isn't transformed to upper. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65224 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filesys.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c index b323e488d96..ef597b38e0f 100644 --- a/file_io/os2/filesys.c +++ b/file_io/os2/filesys.c @@ -94,12 +94,13 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) { - char path[APR_PATH_MAX]; - - strcpy(path, root); - if (path[1] == ':') - path[0] = apr_toupper(path[0]); - *rootpath = apr_pstrdup(p, path); + if (root[0] && apr_islower(root[0]) && root[1] == ':') { + *rootpath = apr_pstrdup(p, root); + (*rootpath)[0] = apr_toupper((*rootpath)[0]); + } + else { + *rootpath = root; + } return APR_SUCCESS; } From 4ef21ebb996dd39970939886cf10e863c8b98bf7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 28 Jun 2004 18:09:09 +0000 Subject: [PATCH 5090/7878] Avoid any edge case or clib bug that might result in a string overflow of the fixed 5-byte buffer for our size function. Returns the '****' string when the buffer would overflow. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65226 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strings.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/strings/apr_strings.c b/strings/apr_strings.c index ddf43ba1057..23531022e3c 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -437,7 +437,8 @@ APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf) return strcpy(buf, " - "); } if (size < 973) { - sprintf(buf, "%3d ", (int) size); + if (apr_snprintf(buf, 5, "%3d ", (int) size) < 0) + return strcpy(buf, "****"); return buf; } do { @@ -450,12 +451,14 @@ APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf) if (size < 9 || (size == 9 && remain < 973)) { if ((remain = ((remain * 5) + 256) / 512) >= 10) ++size, remain = 0; - sprintf(buf, "%d.%d%c", (int) size, remain, *o); + if (apr_snprintf(buf, 5, "%d.%d%c", (int) size, remain, *o) < 0) + return strcpy(buf, "****"); return buf; } if (remain >= 512) ++size; - sprintf(buf, "%3d%c", (int) size, *o); + if (apr_snprintf(buf, 5, "%3d%c", (int) size, *o) < 0) + return strcpy(buf, "****"); return buf; } while (1); } From 4620daa59b3488cfbc3c30f15e5fdad031c6f897 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Tue, 29 Jun 2004 12:41:11 +0000 Subject: [PATCH 5091/7878] Commit the missing jlibtool.c from Justin's http://www.apache.org/~jerenkrantz/jlibtool.c -- It was referenced by "configure --enable-experimental-libtool" already. Also, it helps in building on platforms not directly supported by libtool (for those, libtools behaves utterly stupidly). Obtained from: http://www.apache.org/~jerenkrantz/jlibtool.c Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65230 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 1472 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1472 insertions(+) create mode 100644 build/jlibtool.c diff --git a/build/jlibtool.c b/build/jlibtool.c new file mode 100644 index 00000000000..3f20024e5a0 --- /dev/null +++ b/build/jlibtool.c @@ -0,0 +1,1472 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __EMX__ +# define SHELL_CMD "sh" +# define GEN_EXPORTS "emxexp" +# define DEF2IMPLIB_CMD "emximp" +# define SHARE_SW "-Zdll -Zmtd" +# define USE_OMF 1 +# define TRUNCATE_DLL_NAME +# define DYNAMIC_LIB_EXT "dll" +# define EXE_EXT ".exe" + +# if USE_OMF + /* OMF is the native format under OS/2 */ +# define STATIC_LIB_EXT "lib" +# define OBJECT_EXT "obj" +# define LIBRARIAN "emxomfar" +# define LIBRARIAN_OPTS "cr" +# else + /* but the alternative, a.out, can fork() which is sometimes necessary */ +# define STATIC_LIB_EXT "a" +# define OBJECT_EXT "o" +# define LIBRARIAN "ar" +# define LIBRARIAN_OPTS "cr" +# endif +#endif + +#if defined(__APPLE__) +# define SHELL_CMD "/bin/sh" +# define DYNAMIC_LIB_EXT "dylib" +# define MODULE_LIB_EXT "so" +# define STATIC_LIB_EXT "a" +# define OBJECT_EXT "o" +# define LIBRARIAN "ar" +# define LIBRARIAN_OPTS "cr" +/* man libtool(1) documents ranlib option of -c. */ +# define RANLIB "ranlib" +# define PIC_FLAG "-fPIC -fno-common" +# define RPATH "-rpath" +# define SHARED_OPTS "-dynamiclib" +# define MODULE_OPTS "-bundle" +# define DYNAMIC_LINK_OPTS "-flat_namespace -undefined suppress" +# define dynamic_link_version_func darwin_dynamic_link_function +# define DYNAMIC_INSTALL_NAME "-install_name" +//-install_name /Users/jerenk/apache-2.0-cvs/lib/libapr.0.dylib -compatibility_version 1 -current_version 1.0 +#endif + +#if defined(__linux__) +# define SHELL_CMD "/bin/sh" +# define DYNAMIC_LIB_EXT "so" +# define MODULE_LIB_EXT "so" +# define STATIC_LIB_EXT "a" +# define OBJECT_EXT "o" +# define LIBRARIAN "ar" +# define LIBRARIAN_OPTS "cr" +# define RANLIB "ranlib" +# define PIC_FLAG "-fPIC" +# define RPATH "-rpath" +# define DYNAMIC_LINK_OPTS "-shared" +# define LINKER_FLAG_PREFIX "-Wl," +#endif + +#ifdef __EMX__ +#include +#endif + +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif + +/* We want to say we are libtool 1.4 for shlibtool compatibility. */ +#define VERSION "1.4" + +enum tool_mode_t { + mUnknown, + mCompile, + mLink, + mInstall, +}; + +enum output_t { + otGeneral, + otObject, + otProgram, + otLibrary, + otStaticLibraryOnly, + otDynamicLibraryOnly, + otModule, +}; + +enum pic_mode_e { + UNKNOWN, + PREFER, + AVOID, +}; + +typedef struct { + const char **vals; + int num; +} count_chars; + +typedef struct { + const char *normal; + const char *install; +} library_name; + +typedef struct { + count_chars *normal; + count_chars *install; + count_chars *dependencies; +} library_opts; + +typedef struct { + int silent; + int shared; + int export_all; + int dry_run; + enum pic_mode_e pic_mode; + int export_dynamic; +} options_t; + +typedef struct { + enum tool_mode_t mode; + enum output_t output; + options_t options; + + char *output_name; + char *fake_output_name; + char *basename; + + const char *install_path; + const char *compiler; + const char *program; + count_chars *program_opts; + + count_chars *arglist; + count_chars *tmp_dirs; + count_chars *obj_files; + count_chars *dep_rpaths; + count_chars *rpaths; + + library_name static_name; + library_name shared_name; + library_name module_name; + + library_opts static_opts; + library_opts shared_opts; + + const char *version_info; +} command_t; + +void init_count_chars(count_chars *cc) +{ + cc->vals = (const char**)malloc(PATH_MAX); + cc->num = 0; +} + +void clear_count_chars(count_chars *cc) +{ + int i; + for (i = 0; i < cc->num; i++) { + cc->vals[i] = 0; + } + + cc->num = 0; +} + +void push_count_chars(count_chars *cc, const char *newval) +{ + cc->vals[cc->num++] = newval; +} + +void insert_count_chars(count_chars *cc, const char *newval, int position) +{ + int i; + + for (i = cc->num; i > position; i--) { + cc->vals[i] = cc->vals[i-1]; + } + + cc->vals[position] = newval; + cc->num++; +} + +void append_count_chars(count_chars *cc, count_chars *cctoadd) +{ + int i; + for (i = 0; i < cctoadd->num; i++) { + if (cctoadd->vals[i]) { + push_count_chars(cc, cctoadd->vals[i]); + } + } +} + +const char *flatten_count_chars(count_chars *cc) +{ + int i, size; + char *newval; + + size = 0; + for (i = 0; i < cc->num; i++) { + if (cc->vals[i]) { + size += strlen(cc->vals[i]) + 1; + } + } + + newval = (char*)malloc(size + 1); + newval[size] = 0; + + for (i = 0; i < cc->num; i++) { + if (cc->vals[i]) { + strcat(newval, cc->vals[i]); + strcat(newval, " "); + } + } + + return newval; +} + +char *shell_esc(const char *str) +{ + char *cmd; + unsigned char *d; + const unsigned char *s; + + cmd = (char *)malloc(2 * strlen(str) + 1); + d = (unsigned char *)cmd; + s = (const unsigned char *)str; + + for (; *s; ++s) { + if (*s == '"' || *s == '\\') { + *d++ = '\\'; + } + *d++ = *s; + } + + *d = '\0'; + return cmd; +} + +int external_spawn(command_t *cmd, const char *file, const char **argv) +{ + if (!cmd->options.silent) { + const char **argument = argv; + printf("Executing: "); + while (*argument) { + printf("%s ", *argument); + argument++; + } + puts(""); + } + + if (cmd->options.dry_run) { + return 0; + } +#ifdef __EMX__ + return spawnvp(P_WAIT, file, argv); +#else + { + pid_t pid; + pid = fork(); + if (pid == 0) { + return execvp(argv[0], (char**)argv); + } + else { + int statuscode; + waitpid(pid, &statuscode, 0); + if (WIFEXITED(statuscode)) { + return WEXITSTATUS(statuscode); + } + return 0; + } + } +#endif +} + +int run_command(command_t *cmd_data, count_chars *cc) +{ + char *command; + const char *spawn_args[4]; + count_chars tmpcc; + + init_count_chars(&tmpcc); + + if (cmd_data->program) { + push_count_chars(&tmpcc, cmd_data->program); + } + + append_count_chars(&tmpcc, cmd_data->program_opts); + + append_count_chars(&tmpcc, cc); + + command = shell_esc(flatten_count_chars(&tmpcc)); + + spawn_args[0] = SHELL_CMD; + spawn_args[1] = "-c"; + spawn_args[2] = command; + spawn_args[3] = NULL; + return external_spawn(cmd_data, spawn_args[0], (const char**)spawn_args); +} + +int parse_long_opt(char *arg, command_t *cmd_data) +{ + char *equal_pos = strchr(arg, '='); + char var[50]; + char value[500]; + + if (equal_pos) { + strncpy(var, arg, equal_pos - arg); + var[equal_pos - arg] = 0; + strcpy(value, equal_pos + 1); + } else { + strcpy(var, arg); + } + + if (strcmp(var, "silent") == 0) { + cmd_data->options.silent = 1; + } else if (strcmp(var, "mode") == 0) { + if (strcmp(value, "compile") == 0) { + cmd_data->mode = mCompile; + cmd_data->output = otObject; + } + + if (strcmp(value, "link") == 0) { + cmd_data->mode = mLink; + cmd_data->output = otLibrary; + } + + if (strcmp(value, "install") == 0) { + cmd_data->mode = mInstall; + } + } else if (strcmp(var, "shared") == 0) { + if (cmd_data->mode == mLink) { + cmd_data->output = otDynamicLibraryOnly; + } + cmd_data->options.shared = 1; + } else if (strcmp(var, "export-all") == 0) { + cmd_data->options.export_all = 1; + } else if (strcmp(var, "dry-run") == 0) { + printf("Dry-run mode on!\n"); + cmd_data->options.dry_run = 1; + } else if (strcmp(var, "version") == 0) { + printf("Version " VERSION "\n"); + } else if (strcmp(var, "help") == 0) { + printf("Sorry. No help available.\n"); + } else { + return 0; + } + + return 1; +} + +/* Return 1 if we eat it. */ +int parse_short_opt(char *arg, command_t *cmd_data) +{ + if (strcmp(arg, "export-dynamic") == 0) { + cmd_data->options.export_dynamic = 1; + return 1; + } + + if (strcmp(arg, "module") == 0) { + cmd_data->output = otModule; + return 1; + } + + if (strcmp(arg, "Zexe") == 0) { + return 1; + } + + if (strcmp(arg, "avoid-version") == 0) { + return 1; + } + + if (strcmp(arg, "prefer-pic") == 0) { + cmd_data->options.pic_mode = PREFER; + return 1; + } + + if (strcmp(arg, "prefer-non-pic") == 0) { + cmd_data->options.pic_mode = AVOID; + return 1; + } + + if (strcmp(arg, "static") == 0) { + /* Don't respect it for now. */ + return 1; + } + + if (cmd_data->mode == mLink) { + if (arg[0] == 'L' || arg[0] == 'l') { + /* Hack... */ + arg--; + push_count_chars(cmd_data->shared_opts.dependencies, arg); + return 1; + } + } + return 0; +} + +char *truncate_dll_name(char *path) +{ + /* Cut DLL name down to 8 characters after removing any mod_ prefix */ + char *tmppath = strdup(path); + char *newname = strrchr(tmppath, '/') + 1; + char *ext = strrchr(tmppath, '.'); + int len; + + if (ext == NULL) + return tmppath; + + len = ext - newname; + + if (strncmp(newname, "mod_", 4) == 0) { + strcpy(newname, newname + 4); + len -= 4; + } + + if (len > 8) { + strcpy(newname + 8, strchr(newname, '.')); + } + + return tmppath; +} + +long safe_strtol(const char *nptr, const char **endptr, int base) +{ + long rv; + + errno = 0; + + rv = strtol(nptr, (char**)endptr, 10); + + if (errno == ERANGE) { + return 0; + } + + return rv; +} + +/* version_info is in the form of MAJOR:MINOR:PATCH */ +const char *darwin_dynamic_link_function(const char *version_info) +{ + char *newarg; + long major, minor, patch; + + major = 0; + minor = 0; + patch = 0; + + if (version_info) { + major = safe_strtol(version_info, &version_info, 10); + + if (version_info) { + if (version_info[0] == ':') { + version_info++; + } + + minor = safe_strtol(version_info, &version_info, 10); + + if (version_info) { + if (version_info[0] == ':') { + version_info++; + } + + patch = safe_strtol(version_info, &version_info, 10); + + } + } + } + + /* Avoid -dylib_compatibility_version must be greater than zero errors. */ + if (major == 0) { + major = 1; + } + newarg = (char*)malloc(100); + snprintf(newarg, 99, + "-compatibility_version %ld -current_version %ld.%ld", + major, major, minor); + + return newarg; +} + +/* genlib values + * 0 - static + * 1 - dynamic + * 2 - module + */ +char *gen_library_name(const char *name, int genlib) +{ + char *newarg, *newext; + + newarg = (char *)malloc(strlen(name) + 10); + strcpy(newarg, ".libs/"); + + if (genlib == 2 && strncmp(name, "lib", 3) == 0) { + name += 3; + } + + strcat(newarg, name); + + newext = strrchr(newarg, '.') + 1; + + switch (genlib) { + case 0: + strcpy(newext, STATIC_LIB_EXT); + break; + case 1: + strcpy(newext, DYNAMIC_LIB_EXT); + break; + case 2: + strcpy(newext, MODULE_LIB_EXT); + break; + } + + return newarg; +} + +/* genlib values + * 0 - static + * 1 - dynamic + * 2 - module + */ +char *gen_install_name(const char *name, int genlib) +{ + struct stat sb; + char *newname; + int rv; + + newname = gen_library_name(name, genlib); + + /* Check if it exists. If not, return NULL. */ + rv = stat(newname, &sb); + + if (rv) { + return NULL; + } + + return newname; +} + +char *check_object_exists(command_t *cmd, const char *arg, int arglen) +{ + char *newarg, *ext; + int pass, rv; + + newarg = (char *)malloc(arglen + 10); + memcpy(newarg, arg, arglen); + newarg[arglen] = 0; + ext = newarg + arglen; + + pass = 0; + + do { + struct stat sb; + + switch (pass) { + case 0: + strcpy(ext, OBJECT_EXT); + break; +/* + case 1: + strcpy(ext, NO_PIC_EXT); + break; +*/ + default: + break; + } + + if (!cmd->options.silent) { + printf("Checking: %s\n", newarg); + } + rv = stat(newarg, &sb); + } + while (rv != 0 && ++pass < 1); + + if (rv == 0) { + if (pass == 1) { + cmd->options.pic_mode = AVOID; + } + return newarg; + } + + return NULL; +} + +/* libdircheck values: + * 0 - no .libs suffix + * 1 - .libs suffix + */ +char *check_library_exists(command_t *cmd, const char *arg, int pathlen, + int libdircheck) +{ + char *newarg, *ext; + int pass, rv, newpathlen; + + newarg = (char *)malloc(strlen(arg) + 10); + strcpy(newarg, arg); + newarg[pathlen] = 0; + + newpathlen = pathlen; + if (libdircheck) { + strcat(newarg, ".libs/"); + newpathlen += sizeof(".libs/") - 1; + } + + strcpy(newarg+newpathlen, arg+pathlen); + ext = strrchr(newarg, '.') + 1; + + pass = 0; + + do { + struct stat sb; + + switch (pass) { + case 0: + if (cmd->options.pic_mode != AVOID || cmd->options.shared) { + strcpy(ext, DYNAMIC_LIB_EXT); + break; + } + pass = 1; + case 1: + strcpy(ext, STATIC_LIB_EXT); + break; + case 2: + strcpy(ext, MODULE_LIB_EXT); + break; + case 3: + strcpy(ext, OBJECT_EXT); + break; + default: + break; + } + + if (!cmd->options.silent) { + printf("Checking: %s\n", newarg); + } + rv = stat(newarg, &sb); + } + while (rv != 0 && ++pass < 4); + + if (rv == 0) { + return newarg; + } + + return NULL; +} + +void add_linker_flag_prefix(count_chars *cc, const char *arg) +{ +#ifndef LINKER_FLAG_PREFIX + push_count_chars(cc, arg); +#else + char *newarg; + newarg = (char*)malloc(strlen(arg) + sizeof(LINKER_FLAG_PREFIX)); + strcpy(newarg, LINKER_FLAG_PREFIX); + strcpy(newarg, arg); + push_count_chars(cc, newarg); +#endif +} + +int parse_input_file_name(char *arg, command_t *cmd_data) +{ + char *ext = strrchr(arg, '.'); + char *name = strrchr(arg, '/'); + int pathlen; + char *newarg; + + if (!ext) { + return 0; + } + + ext++; + + if (name == NULL) { + name = strrchr(arg, '\\'); + + if (name == NULL) { + name = arg; + } else { + name++; + } + } else { + name++; + } + + pathlen = name - arg; + + if (strcmp(ext, "lo") == 0) { + newarg = check_object_exists(cmd_data, arg, ext - arg); + if (!newarg) { + printf("Can not find suitable object file for %s\n", arg); + exit(1); + } + if (cmd_data->mode != mLink) { + push_count_chars(cmd_data->arglist, newarg); + } + else { + push_count_chars(cmd_data->obj_files, newarg); + } + return 1; + } + + if (strcmp(ext, "la") == 0) { + switch (cmd_data->mode) { + case mLink: + /* Try the .libs dir first! */ + newarg = check_library_exists(cmd_data, arg, pathlen, 1); + if (!newarg) { + /* Try the normal dir next. */ + newarg = check_library_exists(cmd_data, arg, pathlen, 0); + if (!newarg) { + printf("Can not find suitable library for %s\n", arg); + exit(1); + } + } + + if (cmd_data->mode != mLink) { + push_count_chars(cmd_data->arglist, newarg); + } + else { + push_count_chars(cmd_data->shared_opts.dependencies, newarg); + } + break; + case mInstall: + /* If we've already recorded a library to install, we're most + * likely getting the .la file that we want to install as. + * The problem is that we need to add it as the directory, + * not the .la file itself. Otherwise, we'll do odd things. + */ + if (cmd_data->output == otLibrary) { + arg[pathlen] = '\0'; + push_count_chars(cmd_data->arglist, arg); + } + else { + cmd_data->output = otLibrary; + cmd_data->output_name = arg; + cmd_data->static_name.install = gen_install_name(arg, 0); + cmd_data->shared_name.install = gen_install_name(arg, 1); + cmd_data->module_name.install = gen_install_name(arg, 2); + } + break; + default: + break; + } + return 1; + } + + if (strcmp(ext, "c") == 0) { + /* If we don't already have an idea what our output name will be. */ + if (cmd_data->basename == NULL) { + cmd_data->basename = (char *)malloc(strlen(arg) + 4); + strcpy(cmd_data->basename, arg); + strcpy(strrchr(cmd_data->basename, '.') + 1, "lo"); + + cmd_data->fake_output_name = strrchr(cmd_data->basename, '/'); + if (cmd_data->fake_output_name) { + cmd_data->fake_output_name++; + } + else { + cmd_data->fake_output_name = cmd_data->basename; + } + } + } + + return 0; +} + +int parse_output_file_name(char *arg, command_t *cmd_data) +{ + char *name = strrchr(arg, '/'); + char *ext = strrchr(arg, '.'); + char *newarg = NULL; + int pathlen; + + cmd_data->fake_output_name = arg; + + if (name) { + name++; + } + else { + name = strrchr(arg, '\\'); + + if (name == NULL) { + name = arg; + } + else { + name++; + } + } + + if (!ext) { + cmd_data->basename = arg; + cmd_data->output = otProgram; + newarg = (char *)malloc(strlen(arg) + 5); + strcpy(newarg, arg); +#ifdef EXE_EXT + strcat(newarg, EXE_EXT); +#endif + cmd_data->output_name = newarg; + return 1; + } + + ext++; + pathlen = name - arg; + + if (strcmp(ext, "la") == 0) { + assert(cmd_data->mode == mLink); + + cmd_data->basename = arg; + cmd_data->static_name.normal = gen_library_name(arg, 0); + cmd_data->shared_name.normal = gen_library_name(arg, 1); + cmd_data->module_name.normal = gen_library_name(arg, 2); + cmd_data->static_name.install = gen_install_name(arg, 0); + cmd_data->shared_name.install = gen_install_name(arg, 1); + cmd_data->module_name.install = gen_install_name(arg, 2); + +#ifdef TRUNCATE_DLL_NAME + if (shared) { + arg = truncate_dll_name(arg); + } +#endif + + cmd_data->output_name = arg; + return 1; + } + + if (strcmp(ext, "lo") == 0) { + cmd_data->basename = arg; + cmd_data->output = otObject; + newarg = (char *)malloc(strlen(arg) + 2); + strcpy(newarg, arg); + ext = strrchr(newarg, '.') + 1; + strcpy(ext, OBJECT_EXT); + cmd_data->output_name = newarg; + return 1; + } + + return 0; +} + +/* returns just a file's name without path or extension */ +char *nameof(char *fullpath) +{ + char buffer[1024]; + char *ext; + char *name = strrchr(fullpath, '/'); + + if (name == NULL) { + name = strrchr(fullpath, '\\'); + } + + if (name == NULL) { + name = fullpath; + } else { + name++; + } + + strcpy(buffer, name); + ext = strrchr(buffer, '.'); + + if (ext) { + *ext = 0; + return strdup(buffer); + } + + return name; +} + +void parse_args(int argc, char *argv[], command_t *cmd_data) +{ + int a; + char *arg; + int argused; + + for (a=1; a < argc; a++) { + arg = argv[a]; + argused = 1; + + if (arg[0] == '-') { + if (arg[1] == '-') { + argused = parse_long_opt(arg + 2, cmd_data); + } + else { + argused = parse_short_opt(arg + 1, cmd_data); + } + + /* We haven't done anything with it yet, try some of the + * more complicated short opts... */ + if (argused == 0 && a + 1 < argc) { + if (arg[1] == 'o' && !arg[2]) { + arg = argv[++a]; + argused = parse_output_file_name(arg, cmd_data); + } else if (strcmp(arg+1, "rpath") == 0) { + /* Aha, we should try to link both! */ + cmd_data->install_path = argv[++a]; + argused = 1; + } else if (strcmp(arg+1, "version-info") == 0) { + /* Store for later deciphering */ + cmd_data->version_info = argv[++a]; + argused = 1; + } + } + } else { + argused = parse_input_file_name(arg, cmd_data); + } + + if (!argused) { + if (!cmd_data->options.silent) { + printf("Adding: %s\n", arg); + } + push_count_chars(cmd_data->arglist, arg); + } + } + +} + +int explode_static_lib(const char *lib, command_t *cmd_data) +{ + char tmpdir[1024]; + char savewd[1024]; + char cmd[1024]; + const char *name; + DIR *dir; + struct dirent *entry; + + /* Bah! */ + if (cmd_data->options.dry_run) { + return 0; + } + + strcpy(tmpdir, lib); + strcat(tmpdir, ".exploded"); + + mkdir(tmpdir, 0); + push_count_chars(cmd_data->tmp_dirs, strdup(tmpdir)); + getcwd(savewd, sizeof(savewd)); + + if (chdir(tmpdir) != 0) + return 1; + + strcpy(cmd, LIBRARIAN " x "); + name = strrchr(lib, '/'); + + if (name) { + name++; + } else { + name = lib; + } + + strcat(cmd, "../"); + strcat(cmd, name); + system(cmd); + chdir(savewd); + dir = opendir(tmpdir); + + while ((entry = readdir(dir)) != NULL) { + if (entry->d_name[0] != '.') { + strcpy(cmd, tmpdir); + strcat(cmd, "/"); + strcat(cmd, entry->d_name); + push_count_chars(cmd_data->arglist, strdup(cmd)); + } + } + + closedir(dir); + return 0; +} + +#ifdef GEN_EXPORTS +void generate_def_file(command_t *cmd_data) +{ + char def_file[1024]; + char implib_file[1024]; + char *ext; + FILE *hDef; + char *export_args[1024]; + int num_export_args = 0; + char *cmd; + int cmd_size = 0; + int a; + + if (cmd_data->output_name) { + strcpy(def_file, cmd_data->output_name); + strcat(def_file, ".def"); + hDef = fopen(def_file, "w"); + + if (hDef != NULL) { + fprintf(hDef, "LIBRARY '%s' INITINSTANCE\n", nameof(cmd_data->output_name)); + fprintf(hDef, "DATA NONSHARED\n"); + fprintf(hDef, "EXPORTS\n"); + fclose(hDef); + + for (a = 0; a < cmd_data->num_obj_files; a++) { + cmd_size += strlen(cmd_data->obj_files[a]) + 1; + } + + cmd_size += strlen(GEN_EXPORTS) + strlen(def_file) + 3; + cmd = (char *)malloc(cmd_size); + strcpy(cmd, GEN_EXPORTS); + + for (a=0; a < cmd_data->num_obj_files; a++) { + strcat(cmd, " "); + strcat(cmd, cmd_data->obj_files[a] ); + } + + strcat(cmd, ">>"); + strcat(cmd, def_file); + puts(cmd); + export_args[num_export_args++] = SHELL_CMD; + export_args[num_export_args++] = "-c"; + export_args[num_export_args++] = cmd; + export_args[num_export_args++] = NULL; + external_spawn(cmd_data, export_args[0], (const char**)export_args); + cmd_data->arglist[cmd_data->num_args++] = strdup(def_file); + + /* Now make an import library for the dll */ + num_export_args = 0; + export_args[num_export_args++] = DEF2IMPLIB_CMD; + export_args[num_export_args++] = "-o"; + + strcpy(implib_file, ".libs/"); + strcat(implib_file, cmd_data->basename); + ext = strrchr(implib_file, '.'); + + if (ext) + *ext = 0; + + strcat(implib_file, "."); + strcat(implib_file, STATIC_LIB_EXT); + + export_args[num_export_args++] = implib_file; + export_args[num_export_args++] = def_file; + export_args[num_export_args++] = NULL; + external_spawn(cmd_data, export_args[0], (const char**)export_args); + + } + } +} +#endif + +const char* expand_path(const char *relpath) +{ + char foo[PATH_MAX], *newpath; + + getcwd(foo, PATH_MAX-1); + newpath = (char*)malloc(strlen(foo)+strlen(relpath)+2); + strcat(newpath, foo); + strcat(newpath, "/"); + strcat(newpath, relpath); + return newpath; +} + +void link_fixup(command_t *c) +{ + /* If we were passed an -rpath directive, we need to build + * shared objects too. Otherwise, we should only create static + * libraries. + */ + if (!c->install_path && (c->output == otDynamicLibraryOnly || + c->output == otModule || c->output == otLibrary)) { + c->output = otStaticLibraryOnly; + } + + if (c->output == otDynamicLibraryOnly || + c->output == otModule || + c->output == otLibrary) { + + push_count_chars(c->shared_opts.normal, "-o"); + if (c->output == otModule) { + push_count_chars(c->shared_opts.normal, c->module_name.normal); + } + else { + char *tmp; + push_count_chars(c->shared_opts.normal, c->shared_name.normal); +#ifdef DYNAMIC_INSTALL_NAME + push_count_chars(c->shared_opts.normal, DYNAMIC_INSTALL_NAME); + + tmp = (char*)malloc(PATH_MAX); + strcat(tmp, c->install_path); + strcat(tmp, strrchr(c->shared_name.normal, '/')); + push_count_chars(c->shared_opts.normal, tmp); +#endif + } + + append_count_chars(c->shared_opts.normal, c->obj_files); + append_count_chars(c->shared_opts.normal, c->shared_opts.dependencies); + + if (c->options.export_all) { +#ifdef GEN_EXPORTS + generate_def_file(c); +#endif + } + } + + if (c->output == otLibrary || c->output == otStaticLibraryOnly) { + push_count_chars(c->static_opts.normal, "-o"); + push_count_chars(c->static_opts.normal, c->output_name); + } + + if (c->output == otProgram) { + if (c->output_name) { + push_count_chars(c->arglist, "-o"); + push_count_chars(c->arglist, c->output_name); + append_count_chars(c->arglist, c->obj_files); + append_count_chars(c->arglist, c->shared_opts.dependencies); +#ifdef DYNAMIC_LINK_OPTS + if (c->options.pic_mode != AVOID) { + push_count_chars(c->arglist, DYNAMIC_LINK_OPTS); + } +#endif + } + } +} + +void post_parse_fixup(command_t *cmd_data) +{ + switch (cmd_data->mode) + { + case mCompile: +#ifdef PIC_FLAG + if (cmd_data->options.pic_mode != AVOID) { + push_count_chars(cmd_data->arglist, PIC_FLAG); + } +#endif + if (cmd_data->output_name) { + push_count_chars(cmd_data->arglist, "-o"); + push_count_chars(cmd_data->arglist, cmd_data->output_name); + } + break; + case mLink: + link_fixup(cmd_data); + break; + case mInstall: + if (cmd_data->output == otLibrary) { + link_fixup(cmd_data); + } + default: + break; + } + +#if USE_OMF + if (cmd_data->output == otObject || + cmd_data->output == otProgram || + cmd_data->output == otLibrary || + cmd_data->output == otDynamicLibraryOnly) { + push_count_chars(cmd_data->arglist, "-Zomf"); + } +#endif + + if (cmd_data->options.shared && + (cmd_data->output == otObject || + cmd_data->output == otLibrary || + cmd_data->output == otDynamicLibraryOnly)) { +#ifdef SHARE_SW + push_count_chars(cmd_data->arglist, SHARE_SW); +#endif + } +} + +int run_mode(command_t *cmd_data) +{ + int rv; + count_chars *cctemp; + + cctemp = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cctemp); + + switch (cmd_data->mode) + { + case mCompile: + rv = run_command(cmd_data, cmd_data->arglist); + if (rv) { + return rv; + } + break; + case mInstall: + /* Well, we'll assume it's a file going to a directory... */ + /* For brain-dead install-sh based scripts, we have to repeat + * the command N-times. install-sh should die. + */ + if (!cmd_data->output_name) { + rv = run_command(cmd_data, cmd_data->arglist); + if (rv) { + return rv; + } + } + if (cmd_data->output_name) { + append_count_chars(cctemp, cmd_data->arglist); + insert_count_chars(cctemp, + cmd_data->output_name, + cctemp->num - 1); + rv = run_command(cmd_data, cctemp); + if (rv) { + return rv; + } + clear_count_chars(cctemp); + } + if (cmd_data->static_name.install) { + append_count_chars(cctemp, cmd_data->arglist); + insert_count_chars(cctemp, + cmd_data->static_name.install, + cctemp->num - 1); + rv = run_command(cmd_data, cctemp); + if (rv) { + return rv; + } + clear_count_chars(cctemp); + } + if (cmd_data->shared_name.install) { + append_count_chars(cctemp, cmd_data->arglist); + insert_count_chars(cctemp, + cmd_data->shared_name.install, + cctemp->num - 1); + rv = run_command(cmd_data, cctemp); + if (rv) { + return rv; + } + clear_count_chars(cctemp); + } + if (cmd_data->module_name.install) { + append_count_chars(cctemp, cmd_data->arglist); + insert_count_chars(cctemp, + cmd_data->module_name.install, + cctemp->num - 1); + rv = run_command(cmd_data, cctemp); + if (rv) { + return rv; + } + clear_count_chars(cctemp); + } + break; + case mLink: + if (!cmd_data->options.dry_run) { + /* Check first to see if the dir already exists! */ + mode_t old_umask; + + old_umask = umask(0); + umask(old_umask); + + mkdir(".libs", ~old_umask); + } + + if (cmd_data->output == otStaticLibraryOnly || + cmd_data->output == otLibrary) { +#ifdef RANLIB + const char *lib_args[3]; +#endif + /* Removes compiler! */ + cmd_data->program = LIBRARIAN; + push_count_chars(cmd_data->program_opts, LIBRARIAN_OPTS); + push_count_chars(cmd_data->program_opts, + cmd_data->static_name.normal); + + rv = run_command(cmd_data, cmd_data->obj_files); + if (rv) { + return rv; + } + +#ifdef RANLIB + lib_args[0] = RANLIB; + lib_args[1] = cmd_data->static_name.normal; + lib_args[2] = NULL; + external_spawn(cmd_data, RANLIB, lib_args); +#endif + if (!cmd_data->options.dry_run) { + //link( + } + } + + if (cmd_data->output == otDynamicLibraryOnly || + cmd_data->output == otModule || + cmd_data->output == otLibrary) { + cmd_data->program = NULL; + clear_count_chars(cmd_data->program_opts); + + append_count_chars(cmd_data->program_opts, cmd_data->arglist); + if (cmd_data->output != otModule) { +#ifdef SHARED_OPTS + push_count_chars(cmd_data->program_opts, SHARED_OPTS); +#endif +#ifdef dynamic_link_version_func + push_count_chars(cmd_data->program_opts, + dynamic_link_version_func(cmd_data->version_info)); +#endif + } + if (cmd_data->output == otModule) { +#ifdef MODULE_OPTS + push_count_chars(cmd_data->program_opts, MODULE_OPTS); +#endif + } +#ifdef DYNAMIC_LINK_OPTS + if (cmd_data->options.pic_mode != AVOID) { + push_count_chars(cmd_data->program_opts, + DYNAMIC_LINK_OPTS); + } +#endif + rv = run_command(cmd_data, cmd_data->shared_opts.normal); + if (rv) { + return rv; + } + } + if (cmd_data->output == otProgram) { + rv = run_command(cmd_data, cmd_data->arglist); + if (rv) { + return rv; + } + } + break; + default: + break; + } + + return 0; +} + +void cleanup_tmp_dir(const char *dirname) +{ + DIR *dir; + struct dirent *entry; + char fullname[1024]; + + dir = opendir(dirname); + + if (dir == NULL) + return; + + while ((entry = readdir(dir)) != NULL) { + if (entry->d_name[0] != '.') { + strcpy(fullname, dirname); + strcat(fullname, "/"); + strcat(fullname, entry->d_name); + remove(fullname); + } + } + + rmdir(dirname); +} + +void cleanup_tmp_dirs(command_t *cmd_data) +{ + int d; + + for (d = 0; d < cmd_data->tmp_dirs->num; d++) { + cleanup_tmp_dir(cmd_data->tmp_dirs->vals[d]); + } +} + +int ensure_fake_uptodate(command_t *cmd_data) +{ + /* FIXME: could do the stat/touch here, but nah... */ + const char *touch_args[3]; + + if (cmd_data->mode == mInstall) { + return 0; + } + + touch_args[0] = "touch"; + touch_args[1] = cmd_data->fake_output_name; + touch_args[2] = NULL; + return external_spawn(cmd_data, "touch", touch_args); +} + +int main(int argc, char *argv[]) +{ + int rc; + command_t cmd_data; + + memset(&cmd_data, 0, sizeof(cmd_data)); + + cmd_data.options.pic_mode = UNKNOWN; + + cmd_data.program_opts = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.program_opts); + cmd_data.arglist = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.arglist); + cmd_data.tmp_dirs = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.tmp_dirs); + cmd_data.obj_files = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.obj_files); + cmd_data.dep_rpaths = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.dep_rpaths); + cmd_data.rpaths = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.rpaths); + cmd_data.static_opts.normal = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.static_opts.normal); + cmd_data.shared_opts.normal = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.shared_opts.normal); + cmd_data.shared_opts.dependencies = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.shared_opts.dependencies); + + cmd_data.mode = mUnknown; + cmd_data.output = otGeneral; + + parse_args(argc, argv, &cmd_data); + post_parse_fixup(&cmd_data); + + if (cmd_data.mode == mUnknown) { + exit(0); + } + + rc = run_mode(&cmd_data); + + if (!rc) { + ensure_fake_uptodate(&cmd_data); + } + + cleanup_tmp_dirs(&cmd_data); + return rc; +} From 3443e92b35009e4604b9fa539cff7ced61423204 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Tue, 29 Jun 2004 13:33:23 +0000 Subject: [PATCH 5092/7878] Use standardized names for ISO-8859-1, see http://www.iana.org/assignments/character-sets (Using the name iso8859-1 may still work, because it is aliased in apr-iconv/ccs/charset.aliases) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65231 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/charset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/unix/charset.c b/misc/unix/charset.c index 5e1842fac75..6acb4e157d9 100644 --- a/misc/unix/charset.c +++ b/misc/unix/charset.c @@ -55,7 +55,7 @@ APR_DECLARE(const char*) apr_os_default_encoding (apr_pool_t *pool) } if ('A' == 0x41) { - return "ISO8859-1"; /* not necessarily true */ + return "ISO-8859-1"; /* not necessarily true */ } return "unknown"; From 1efe92bf3742708ec81638523087ae6f3ede9e1c Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Tue, 29 Jun 2004 13:44:29 +0000 Subject: [PATCH 5093/7878] Add FreeBSD platform, and catch unsupported platforms by #error exit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65232 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index 3f20024e5a0..a3fd9138b91 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -108,7 +108,7 @@ //-install_name /Users/jerenk/apache-2.0-cvs/lib/libapr.0.dylib -compatibility_version 1 -current_version 1.0 #endif -#if defined(__linux__) +#if defined(__linux__) || defined(__FreeBSD__) # define SHELL_CMD "/bin/sh" # define DYNAMIC_LIB_EXT "so" # define MODULE_LIB_EXT "so" @@ -123,6 +123,10 @@ # define LINKER_FLAG_PREFIX "-Wl," #endif +#ifndef SHELL_CMD +#error Unsupported platform: Please add defines for SHELL_CMD etc. for your platform. +#endif + #ifdef __EMX__ #include #endif @@ -131,6 +135,7 @@ #define PATH_MAX 1024 #endif + /* We want to say we are libtool 1.4 for shlibtool compatibility. */ #define VERSION "1.4" From d1aff06f6efa8658babf18586ca8c7896de8c447 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Tue, 29 Jun 2004 14:10:48 +0000 Subject: [PATCH 5094/7878] Use libbind/libresolv when available. Check before checking other special headers; Substitute INCLUDES git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65233 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 493669abf74..7b38ff18c34 100644 --- a/configure.in +++ b/configure.in @@ -522,6 +522,8 @@ dnl end up LIBS="-lm -lcrypt -lnsl -ldl" which is an annoyance. AC_SEARCH_LIBS(gethostbyname, nsl) AC_SEARCH_LIBS(gethostname, nsl) AC_SEARCH_LIBS(socket, socket) +dnl Search for -lbind / -lresolv only after having added -lsocket and -lnsl +AC_SEARCH_LIBS(res_init, bind resolv) AC_SEARCH_LIBS(crypt, crypt ufc) AC_CHECK_LIB(truerand, main) AC_SEARCH_LIBS(modf, m) @@ -656,7 +658,7 @@ case $host in #endif";; esac -AC_CHECK_HEADERS([sys/mman.h sys/ipc.h sys/mutex.h sys/shm.h sys/file.h kernel/OS.h os2.h]) +AC_CHECK_HEADERS([sys/types.h sys/mman.h sys/ipc.h sys/mutex.h sys/shm.h sys/file.h kernel/OS.h os2.h]) AC_CHECK_FUNCS([mmap munmap shm_open shm_unlink shmget shmat shmdt shmctl \ create_area]) APR_CHECK_DEFINE(MAP_ANON, sys/mman.h) @@ -1944,6 +1946,7 @@ AC_SUBST(NOTEST_INCLUDES) dnl ----------------------------- Construct the files AC_SUBST(LDLIBS) +AC_SUBST(INCLUDES) AC_SUBST(AR) AC_SUBST(RM) AC_SUBST(OSDIR) From 66a81fd466afeaea78a319b37e057caf652355d4 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Tue, 29 Jun 2004 15:25:56 +0000 Subject: [PATCH 5095/7878] Add support for BS2000 (_OSD_POSIX). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65234 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/build/jlibtool.c b/build/jlibtool.c index a3fd9138b91..0d49cce9eed 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -53,6 +53,9 @@ */ #include +#if defined(_OSD_POSIX) +#include +#endif #include #include #include @@ -123,6 +126,18 @@ # define LINKER_FLAG_PREFIX "-Wl," #endif +#if defined(_OSD_POSIX) +# define SHELL_CMD "/usr/bin/sh" +# define DYNAMIC_LIB_EXT "so" +# define MODULE_LIB_EXT "so" +# define STATIC_LIB_EXT "a" +# define OBJECT_EXT "o" +# define LIBRARIAN "ar" +# define LIBRARIAN_OPTS "cr" +# define DYNAMIC_LINK_OPTS "-G" +# define LINKER_FLAG_PREFIX "-Wl," +#endif + #ifndef SHELL_CMD #error Unsupported platform: Please add defines for SHELL_CMD etc. for your platform. #endif @@ -217,6 +232,44 @@ typedef struct { const char *version_info; } command_t; +#if defined(_OSD_POSIX) +/* Write at most n characters to the buffer in str, return the + * number of chars written or -1 if the buffer would have been + * overflowed. + * + * This is portable to any POSIX-compliant system has /dev/null + */ +static FILE *f=NULL; +static int vsnprintf( char *str, size_t n, const char *fmt, va_list ap ) +{ + int res; + + if (f == NULL) + f = fopen("/dev/null","w"); + if (f == NULL) + return -1; + + setvbuf( f, str, _IOFBF, n ); + + res = vfprintf( f, fmt, ap ); + + if ( res > 0 && res < n ) { + res = vsprintf( str, fmt, ap ); + } + return res; +} +static int snprintf( char *str, size_t n, const char *fmt, ... ) +{ + va_list ap; + int res; + + va_start( ap, fmt ); + res = vsnprintf( str, n, fmt, ap ); + va_end( ap ); + return res; +} +#endif + void init_count_chars(count_chars *cc) { cc->vals = (const char**)malloc(PATH_MAX); @@ -859,6 +912,9 @@ int parse_output_file_name(char *arg, command_t *cmd_data) if (!ext) { cmd_data->basename = arg; cmd_data->output = otProgram; +#if defined(_OSD_POSIX) + cmd_data->options.pic_mode = AVOID; +#endif newarg = (char *)malloc(strlen(arg) + 5); strcpy(newarg, arg); #ifdef EXE_EXT From 95ab9b88d6793f81ac80112aa3215233bdee24b7 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 29 Jun 2004 16:35:57 +0000 Subject: [PATCH 5096/7878] Allow shared memory to work across forks in the way it was intended. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65235 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/.cvsignore | 1 + threadproc/beos/proc.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/threadproc/beos/.cvsignore b/threadproc/beos/.cvsignore index 11f54a84329..f82426797b8 100644 --- a/threadproc/beos/.cvsignore +++ b/threadproc/beos/.cvsignore @@ -1,5 +1,6 @@ Makefile apr_proc_stub *.lo +*.slo .libs .deps diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index ecbb302caa2..71dd5a88f21 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -149,6 +149,38 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) return errno; } else if (pid == 0) { + /* This is really ugly... + * The semantics of BeOS's fork() are that areas (used for shared + * memory) get COW'd :-( The only way we can make shared memory + * work across fork() is therefore to find any areas that have + * been created and then clone them into our address space. + * Thankfully only COW'd areas have the lock variable set at + * anything but 0, so we can use that to find the areas we need to + * copy. Of course what makes it even worse is that the loop through + * the area's will go into an infinite loop, eating memory and then + * eventually segfault unless we know when we reach then end of the + * "original" areas and stop. Why? Well, we delete the area and then + * add another to the end of the list... + */ + area_info ai; + int32 cookie = 0; + area_id highest = 0; + + while (get_next_area_info(0, &cookie, &ai) == B_OK) + if (ai.area > highest) + highest = ai.area; + cookie = 0; + while (get_next_area_info(0, &cookie, &ai) == B_OK) { + if (ai.area > highest) + break; + if (ai.lock > 0) { + area_id original = find_area(ai.name); + delete_area(ai.area); + clone_area(ai.name, &ai.address, B_CLONE_ADDRESS, + ai.protection, original); + } + } + proc->pid = pid; proc->in = NULL; proc->out = NULL; From a5610f77c799173a8fa21fb0b00fa7d7715b96f3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 29 Jun 2004 16:38:16 +0000 Subject: [PATCH 5097/7878] Continue clearing my TODO list. This provides for better "naming" of anon areas, adds a missing function and tidies up some code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65236 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/beos/shm.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index 735be3467c6..d9a0d139980 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -34,19 +34,28 @@ struct apr_shm_t { APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, apr_size_t reqsize, - const char *file, + const char *filename, apr_pool_t *p) { apr_size_t pagesize; area_id newid; char *addr; + char shname[B_OS_NAME_LENGTH]; (*m) = (apr_shm_t *)apr_pcalloc(p, sizeof(apr_shm_t)); /* we MUST allocate in pages, so calculate how big an area we need... */ pagesize = ((reqsize + B_PAGE_SIZE - 1) / B_PAGE_SIZE) * B_PAGE_SIZE; - newid = create_area("apr_shmem", (void*)&addr, B_ANY_ADDRESS, - pagesize, B_CONTIGUOUS, B_READ_AREA|B_WRITE_AREA); + if (!filename) { + int num = 0; + snprintf(shname, B_OS_NAME_LENGTH, "apr_shmem_%ld", find_thread(NULL)); + while (find_area(shname) >= 0) + snprintf(shname, B_OS_NAME_LENGTH, "apr_shmem_%ld_%d", + find_thread(NULL), num++); + } + newid = create_area(filename ? filename : shname, + (void*)&addr, B_ANY_ADDRESS, + pagesize, B_LAZY_LOCK, B_READ_AREA|B_WRITE_AREA); if (newid < 0) return errno; @@ -72,7 +81,13 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, apr_pool_t *pool) { - return APR_ENOTIMPL; + area_id deleteme = find_area(filename); + + if (deleteme == B_NAME_NOT_FOUND) + return APR_EINVAL; + + delete_area(deleteme); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, @@ -81,10 +96,9 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, { area_info ai; thread_info ti; - area_id deleteme; apr_shm_t *new_m; - - deleteme = find_area(filename); + area_id deleteme = find_area(filename); + if (deleteme == B_NAME_NOT_FOUND) return APR_EINVAL; From b099b9315b6be47b3accde09234e5ab801cff247 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 29 Jun 2004 17:14:49 +0000 Subject: [PATCH 5098/7878] If a test fails due to be not implemented, then record it as such and not a failure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65237 13f79535-47bb-0310-9956-ffa450edef68 --- test/testutil.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/testutil.c b/test/testutil.c index f15b7db7471..51f0326b6c6 100644 --- a/test/testutil.c +++ b/test/testutil.c @@ -27,9 +27,7 @@ void apr_assert_success(abts_case* tc, const char* context, apr_status_t rv, { if (rv == APR_ENOTIMPL) { abts_not_impl(tc, context, lineno); - } - - if (rv != APR_SUCCESS) { + } else if (rv != APR_SUCCESS) { char buf[STRING_MAX], ebuf[128]; sprintf(buf, "%s (%d): %s\n", context, rv, apr_strerror(rv, ebuf, sizeof ebuf)); From e202771abe336a3f179f1d784e91a985e34266ec Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 29 Jun 2004 17:15:17 +0000 Subject: [PATCH 5099/7878] Bring over the display fix from apr-util. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65238 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/abts.c b/test/abts.c index d10dda4d95f..290435d6784 100644 --- a/test/abts.c +++ b/test/abts.c @@ -144,7 +144,7 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name_full) } reset_status(); - fprintf(stdout, "%s: ", subsuite->name); + fprintf(stdout, "%-20s: ", subsuite->name); update_status(); fflush(stdout); From 0b140fd0c58191a71c7d405bc48e0cbcac42b02a Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 29 Jun 2004 17:16:18 +0000 Subject: [PATCH 5100/7878] Destroy the shared memory once the test finishes. Exit if we fail tests rather than pressing on. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65239 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 17e9dbeda06..407a7d9f759 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -101,6 +101,8 @@ static void test_exclusive(abts_case *tc, const char *lockname, rv = apr_proc_mutex_create(&proc_lock, lockname, mech, p); APR_ASSERT_SUCCESS(tc, "create the mutex", rv); + if (rv != APR_SUCCESS) + return; for (n = 0; n < CHILDREN; n++) make_child(tc, &child[n], p); @@ -128,9 +130,13 @@ static void proc_mutex(abts_case *tc, void *data) } APR_ASSERT_SUCCESS(tc, "create shm segment", rv); + if (rv != APR_SUCCESS) + return; x = apr_shm_baseaddr_get(shm); test_exclusive(tc, NULL, *mech); + rv = apr_shm_destroy(shm); + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); #else ABTS_NOT_IMPL(tc, "APR lacks fork() support"); #endif @@ -166,4 +172,3 @@ abts_suite *testprocmutex(abts_suite *suite) return suite; } - From b9c56a3ab7a08d255b9825eb431bae471a0c17cb Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 29 Jun 2004 22:53:23 +0000 Subject: [PATCH 5101/7878] Generate a tag file. Submitted by: Bojan Smojver < bojan rexursive com > Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65240 13f79535-47bb-0310-9956-ffa450edef68 --- docs/doxygen.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/doxygen.conf b/docs/doxygen.conf index c427859fa2d..69d41c44eae 100644 --- a/docs/doxygen.conf +++ b/docs/doxygen.conf @@ -32,3 +32,6 @@ STRIP_FROM_PATH=/buildpath/apr EXCLUDE_PATTERNS="*/acconfig.h" \ "*/test/*" \ "*/arch/*" + +GENERATE_TAGFILE=docs/dox/apr.tag + From 89a26c026104a17890eab2750aff726ef1385362 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 29 Jun 2004 23:02:05 +0000 Subject: [PATCH 5102/7878] Get the correct setting for which locking mechanism to use. This gets the headers to agree with the actual code - which is usually a good thing :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65241 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 7b38ff18c34..d4b6e0ef004 100644 --- a/configure.in +++ b/configure.in @@ -1479,8 +1479,8 @@ dnl ----------------------------- Checking for Locking Characteristics echo "${nl}Checking for Locking..." AC_CHECK_FUNCS(semget semctl flock) -AC_CHECK_HEADERS(semaphore.h) -AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait) +AC_CHECK_HEADERS(semaphore.h OS.h) +AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait create_sem) # Some systems return ENOSYS from sem_open. AC_CACHE_CHECK(for working sem_open,ac_cv_func_sem_open,[ @@ -1595,6 +1595,7 @@ APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl func:pthread_mutexattr_setpshared dnl file:/dev/zero, hasprocpthreadser="1", hasprocpthreadser="0") +APR_IFALLYES(header:OS.h func:create_sem, hasbeossem="1", hasbeossem="0") # See which lock mechanism we'll select by default on this system. # The last APR_DECIDE to execute sets the default. @@ -1603,6 +1604,9 @@ APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl # POSIX semaphores and cross-process pthread mutexes are not # used by default since they have less desirable behaviour when # e.g. a process holding the mutex segfaults. +# The BEOSSEM decision doesn't require any substitutions but is +# included here to prevent the fcntl() branch being selected +# from the decision making. APR_BEGIN_DECISION([apr_lock implementation method]) APR_IFALLYES(func:flock define:LOCK_EX, APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) @@ -1610,6 +1614,8 @@ APR_IFALLYES(header:fcntl.h define:F_SETLK, APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) +APR_IFALLYES(header:OS.h func:create_sem, + APR_DECIDE(USE_BEOSSEM, [BeOS Semaphores])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) fi @@ -1637,6 +1643,9 @@ case $ac_decision in USE_PROC_PTHREAD_SERIALIZE ) procpthreadser="1" ;; + USE_BEOSSEM ) + beossem="1" + ;; esac AC_SUBST(hasflockser) From ac493c4f9268d858029b6aae4f531b516d4e8082 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 30 Jun 2004 08:46:10 +0000 Subject: [PATCH 5103/7878] * Makefile.in (APR_PCFILE): New target. (install): Install pkgconfig .pc file with -N suffix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65242 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 2 +- Makefile.in | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.cvsignore b/.cvsignore index 4b17e2735b6..29ab2740fd7 100644 --- a/.cvsignore +++ b/.cvsignore @@ -38,4 +38,4 @@ build-outputs.mk *.bbg *.da coverage -apr.pc +apr*.pc diff --git a/Makefile.in b/Makefile.in index 7d9e437d07c..74ce32c1881 100644 --- a/Makefile.in +++ b/Makefile.in @@ -27,6 +27,7 @@ CLEAN_SUBDIRS= test INSTALL_SUBDIRS=@INSTALL_SUBDIRS@ TARGET_LIB = lib@APR_LIBNAME@.la +APR_PCFILE = apr-$(APR_MAJOR_VERSION).pc # # Rules for building specific targets, starting with 'all' for @@ -38,7 +39,8 @@ TARGETS = $(TARGET_LIB) export_vars.c apr.exp @INCLUDE_RULES@ @INCLUDE_OUTPUTS@ -CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs +CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ + $(APR_PCFILE) DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ libtool apr-config build/apr_rules.mk apr.pc @@ -56,7 +58,11 @@ installbuilddir=@installbuilddir@ apr-config.out: apr-config sed 's,^\(location=\).*$$,\1installed,' < apr-config > $@ -install: $(TARGET_LIB) apr-config.out +$(APR_PCFILE): apr.pc + @rm -f $@ + cp apr.pc $@ + +install: $(TARGET_LIB) apr-config.out $(APR_PCFILE) if [ ! -d $(DESTDIR)$(includedir) ]; then \ $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(includedir); \ fi; @@ -73,7 +79,7 @@ install: $(TARGET_LIB) apr-config.out if [ ! -d $(DESTDIR)$(libdir)/pkgconfig ]; then \ $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(libdir)/pkgconfig; \ fi; - cp -p apr.pc $(DESTDIR)$(libdir)/pkgconfig; + cp -p $(APR_PCFILE) $(DESTDIR)$(libdir)/pkgconfig if [ ! -d $(DESTDIR)$(installbuilddir) ]; then \ $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(installbuilddir); \ fi; From 5224a30658fc97d0f24d3b512aa24b7b4810dcb3 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 30 Jun 2004 09:10:42 +0000 Subject: [PATCH 5104/7878] * Makefile.in (install): Simplify stupid over-engineering. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65243 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Makefile.in b/Makefile.in index 74ce32c1881..defaa2f1013 100644 --- a/Makefile.in +++ b/Makefile.in @@ -39,8 +39,7 @@ TARGETS = $(TARGET_LIB) export_vars.c apr.exp @INCLUDE_RULES@ @INCLUDE_OUTPUTS@ -CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ - $(APR_PCFILE) +CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ libtool apr-config build/apr_rules.mk apr.pc @@ -58,11 +57,7 @@ installbuilddir=@installbuilddir@ apr-config.out: apr-config sed 's,^\(location=\).*$$,\1installed,' < apr-config > $@ -$(APR_PCFILE): apr.pc - @rm -f $@ - cp apr.pc $@ - -install: $(TARGET_LIB) apr-config.out $(APR_PCFILE) +install: $(TARGET_LIB) apr-config.out if [ ! -d $(DESTDIR)$(includedir) ]; then \ $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(includedir); \ fi; @@ -79,7 +74,7 @@ install: $(TARGET_LIB) apr-config.out $(APR_PCFILE) if [ ! -d $(DESTDIR)$(libdir)/pkgconfig ]; then \ $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(libdir)/pkgconfig; \ fi; - cp -p $(APR_PCFILE) $(DESTDIR)$(libdir)/pkgconfig + cp -p apr.pc $(DESTDIR)$(libdir)/pkgconfig/$(APR_PCFILE) if [ ! -d $(DESTDIR)$(installbuilddir) ]; then \ $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(installbuilddir); \ fi; From c70ba903d00fd87df575e3248c81553786f1bbba Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 30 Jun 2004 09:30:33 +0000 Subject: [PATCH 5105/7878] * configure.in: Remove check for res_init again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65244 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure.in b/configure.in index d4b6e0ef004..68ab6dbee68 100644 --- a/configure.in +++ b/configure.in @@ -522,8 +522,6 @@ dnl end up LIBS="-lm -lcrypt -lnsl -ldl" which is an annoyance. AC_SEARCH_LIBS(gethostbyname, nsl) AC_SEARCH_LIBS(gethostname, nsl) AC_SEARCH_LIBS(socket, socket) -dnl Search for -lbind / -lresolv only after having added -lsocket and -lnsl -AC_SEARCH_LIBS(res_init, bind resolv) AC_SEARCH_LIBS(crypt, crypt ufc) AC_CHECK_LIB(truerand, main) AC_SEARCH_LIBS(modf, m) From bc43dbed368a30f4bfccb92b439bd5463dfb7688 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 30 Jun 2004 10:37:57 +0000 Subject: [PATCH 5106/7878] The failure to delete the conditional lock ws causing a hang on BeOS, so delete the lock when we're done and all is well again. As the tests don't run in isolation there may be other places we should clean up better. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65245 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/testlock.c b/test/testlock.c index 9c8a14dfcd0..6fef9b7130d 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -298,6 +298,8 @@ static void test_timeoutcond(abts_case *tc, void *data) break; } ABTS_ASSERT(tc, "Too many retries", i < MAX_RETRY); + APR_ASSERT_SUCCESS(tc, "Unable to destroy the conditional", + apr_thread_cond_destroy(timeout_cond)); } #endif /* !APR_HAS_THREADS */ From 0a3235a9faa427a8eee1463d1f227acb88d41473 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 30 Jun 2004 11:10:24 +0000 Subject: [PATCH 5107/7878] * test/teststr.c (string_strfsize, overflow_strfsize): Add apr_strfsize() tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65246 13f79535-47bb-0310-9956-ffa450edef68 --- test/teststr.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/test/teststr.c b/test/teststr.c index 300a1b576e6..f4b956eeea1 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -278,6 +278,66 @@ static void string_strtoff(abts_case *tc, void *data) ABTS_ASSERT(tc, "strtoff failed to parse 1234", off == 1234); } +/* random-ish checks for strfsize buffer overflows */ +static void overflow_strfsize(abts_case *tc, void *data) +{ + apr_off_t off; + char buf[7]; + + buf[5] = '$'; + buf[6] = '@'; + + for (off = -9999; off < 20000; off++) { + apr_strfsize(off, buf); + } + for (; off < 9999999; off += 9) { + apr_strfsize(off, buf); + } + for (; off < 999999999; off += 999) { + apr_strfsize(off, buf); + } + for (off = 1; off < LONG_MAX && off > 0; off *= 2) { + apr_strfsize(off, buf); + apr_strfsize(off + 1, buf); + apr_strfsize(off - 1, buf); + } + + ABTS_ASSERT(tc, "strfsize overflowed", buf[5] == '$'); + ABTS_ASSERT(tc, "strfsize overflowed", buf[6] == '@'); +} + +static void string_strfsize(abts_case *tc, void *data) +{ + static const struct { + apr_off_t size; + const char *buf; + } ts[] = { + { -1, " - " }, + { 0, " 0 " }, + { 666, "666 " }, + { 1024, "1.0K" }, + { 1536, "1.5K" }, + { 2048, "2.0K" }, + { 1293874, "1.2M" }, + { 9999999, "9.5M" }, + { 103809024, " 99M" }, + { 1047527424, "1.0G" } /* "999M" would be more correct */ + }; + apr_size_t n; + + for (n = 0; n < sizeof(ts)/sizeof(ts[0]); n++) { + char buf[6], *ret; + + buf[5] = '%'; + + ret = apr_strfsize(ts[n].size, buf); + ABTS_ASSERT(tc, "strfsize returned wrong buffer", ret == buf); + ABTS_ASSERT(tc, "strfsize overflowed", buf[5] == '%'); + + ABTS_STR_EQUAL(tc, ts[n].buf, ret); + } +} + abts_suite *teststr(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -291,6 +351,8 @@ abts_suite *teststr(abts_suite *suite) abts_run_test(suite, string_long, NULL); abts_run_test(suite, string_strtoi64, NULL); abts_run_test(suite, string_strtoff, NULL); + abts_run_test(suite, overflow_strfsize, NULL); + abts_run_test(suite, string_strfsize, NULL); return suite; } From 5eb8e1e7fcaa9b94232f8ab519c21c189166a47c Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 30 Jun 2004 11:29:48 +0000 Subject: [PATCH 5108/7878] Add that RC2 was tagged. :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65247 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/STATUS b/STATUS index c96ce97f5cd..1dd148758e4 100644 --- a/STATUS +++ b/STATUS @@ -1,10 +1,11 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2004/06/18 13:13:34 $] +Last modified at [$Date: 2004/06/30 11:29:48 $] Releases: Standalone - 1.0.0 rc1 : tagged June 18th June 2004 (APR_1_0_RC1) + 1.0.0 rc2 : tagged June 30th 2004 (APR_1_0_RC2) + 1.0.0 rc1 : tagged June 18th 2004 (APR_1_0_RC1) 0.9.3 : tagged March 30, 2003 0.9.2 : released March 22, 2003 0.9.1 : released September 11, 2002 @@ -28,9 +29,6 @@ RELEASE 0.9 SHOWSTOPPERS: RELEASE 1.0 SHOWSTOPPERS: -RELEASE 1.1 SHOWSTOPPERS: - - CURRENT VOTES: From bfa9e5d2aebbcd710a26731d16f172bc05954fa1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 30 Jun 2004 13:16:54 +0000 Subject: [PATCH 5109/7878] * configure.in, config.layout: Add -version suffix to default installbuilddir directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65248 13f79535-47bb-0310-9956-ffa450edef68 --- config.layout | 2 +- configure.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.layout b/config.layout index 731710bd3ac..0f42e84e273 100644 --- a/config.layout +++ b/config.layout @@ -20,7 +20,7 @@ mandir: ${prefix}/man sysconfdir: ${prefix}/conf datadir: ${prefix} - installbuilddir: ${datadir}/build + installbuilddir: ${datadir}/build-${APR_MAJOR_VERSION} includedir: ${prefix}/include/apr-${APR_MAJOR_VERSION} localstatedir: ${prefix} libsuffix: -${APR_MAJOR_VERSION} diff --git a/configure.in b/configure.in index 68ab6dbee68..3d2f311cfdb 100644 --- a/configure.in +++ b/configure.in @@ -171,7 +171,7 @@ AC_PROG_LIBTOOL esac AC_ARG_WITH(installbuilddir, [ --with-installbuilddir=DIR location to store APR build files (defaults to '${datadir}/build')], - [ installbuilddir=$withval ], [ installbuilddir="${datadir}/build" ] ) + [ installbuilddir=$withval ], [ installbuilddir="${datadir}/build-${APR_MAJOR_VERSION}" ] ) AC_SUBST(installbuilddir) AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the library], From ad75c90bee61f9498f7841a118e1270d48315335 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 30 Jun 2004 14:06:21 +0000 Subject: [PATCH 5110/7878] * build/apr_rules.mk.in: Define APR_MKEXPORT and APR_MKVAREXPORT to point at each of the awk scripts (MKEXPORT wasn't used and pointed at the wrong filename). * Makefile.in (install): Make the installed apr_rules.mk point at the installed libtool and AWK scripts. (exports.c, export_vars.c): Use new APR_*EXPORT macros. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65249 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 16 +++++++++++----- build/apr_rules.mk.in | 5 +++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Makefile.in b/Makefile.in index defaa2f1013..b059611cc27 100644 --- a/Makefile.in +++ b/Makefile.in @@ -39,7 +39,8 @@ TARGETS = $(TARGET_LIB) export_vars.c apr.exp @INCLUDE_RULES@ @INCLUDE_OUTPUTS@ -CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs +CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ + build/apr_rules.out DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ libtool apr-config build/apr_rules.mk apr.pc @@ -57,7 +58,11 @@ installbuilddir=@installbuilddir@ apr-config.out: apr-config sed 's,^\(location=\).*$$,\1installed,' < apr-config > $@ -install: $(TARGET_LIB) apr-config.out +# Create apr_rules.mk suitable for the install tree +build/apr_rules.out: build/apr_rules.mk + sed 's,^\(apr_build.*=\).*$$,\1$(installbuilddir),' < build/apr_rules.mk > $@ + +install: $(TARGET_LIB) apr-config.out build/apr_rules.out if [ ! -d $(DESTDIR)$(includedir) ]; then \ $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(includedir); \ fi; @@ -84,9 +89,10 @@ install: $(TARGET_LIB) apr-config.out if [ -f shlibtool ]; then \ $(LIBTOOL) --mode=install cp shlibtool $(DESTDIR)$(installbuilddir); \ fi - for f in mkdir.sh make_exports.awk make_var_export.awk apr_rules.mk; do \ + for f in mkdir.sh make_exports.awk make_var_export.awk; do \ test -f build/$${f} && cp build/$${f} $(DESTDIR)$(installbuilddir); \ done + cp build/apr_rules.out $(DESTDIR)$(installbuilddir)/apr_rules.mk if [ ! -d $(DESTDIR)$(bindir) ]; then \ $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(bindir); \ fi; @@ -102,10 +108,10 @@ $(TARGET_LIB): $(OBJECTS) $(LINK) @lib_target@ $(ALL_LIBS) exports.c: $(HEADERS) - $(AWK) -f $(top_srcdir)/build/make_exports.awk $(HEADERS) > $@ + $(APR_MKEXPORT) $(HEADERS) > $@ export_vars.c: $(HEADERS) - $(AWK) -f $(top_srcdir)/build/make_var_export.awk $(HEADERS) > $@ + $(APR_MKVAREXPORT) $(HEADERS) > $@ apr.exp: exports.c export_vars.c @echo "#! lib@APR_LIBNAME@.so" > $@ diff --git a/build/apr_rules.mk.in b/build/apr_rules.mk.in index 661c1bf5325..cac7e874955 100644 --- a/build/apr_rules.mk.in +++ b/build/apr_rules.mk.in @@ -91,8 +91,9 @@ LT_COMPILE = @lt_compile@ LINK = @link@ -MKEXPORT = $(AWK) -f $(apr_builders)/make_export.awk -MKDEP = @MKDEP@ +APR_MKEXPORT = $(AWK) -f $(apr_builders)/make_exports.awk +APR_MKVAREXPORT = $(AWK) -f $(apr_builders)/make_var_export.awk +MKDEP = @MKDEP@ # # Standard build rules From aae3fff1083d7b9dde7b30110acca168d9ec84fb Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 30 Jun 2004 14:11:30 +0000 Subject: [PATCH 5111/7878] * build/apr_rules.mk.in: Define APR_MKDIR macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65250 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_rules.mk.in | 1 + 1 file changed, 1 insertion(+) diff --git a/build/apr_rules.mk.in b/build/apr_rules.mk.in index cac7e874955..b95982f5aee 100644 --- a/build/apr_rules.mk.in +++ b/build/apr_rules.mk.in @@ -91,6 +91,7 @@ LT_COMPILE = @lt_compile@ LINK = @link@ +APR_MKDIR = $(apr_builders)/mkdir.sh APR_MKEXPORT = $(AWK) -f $(apr_builders)/make_exports.awk APR_MKVAREXPORT = $(AWK) -f $(apr_builders)/make_var_export.awk MKDEP = @MKDEP@ From 520479019a8995fdf36259a629df465e482fd9a1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 30 Jun 2004 14:23:59 +0000 Subject: [PATCH 5112/7878] * Makefile.in (install): Install the awk scripts & mkdir.sh for a VPATH build too. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65251 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index b059611cc27..9908354dc1a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -90,7 +90,7 @@ install: $(TARGET_LIB) apr-config.out build/apr_rules.out $(LIBTOOL) --mode=install cp shlibtool $(DESTDIR)$(installbuilddir); \ fi for f in mkdir.sh make_exports.awk make_var_export.awk; do \ - test -f build/$${f} && cp build/$${f} $(DESTDIR)$(installbuilddir); \ + cp $(top_srcdir)/build/$${f} $(DESTDIR)$(installbuilddir); \ done cp build/apr_rules.out $(DESTDIR)$(installbuilddir)/apr_rules.mk if [ ! -d $(DESTDIR)$(bindir) ]; then \ From 2e441e58085230aa1a7a4834994085a87fab52f8 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 30 Jun 2004 16:08:09 +0000 Subject: [PATCH 5113/7878] * build/get-version.sh: Fix handling of multi-digit version components. Submitted by: Joe Schaefer git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65253 13f79535-47bb-0310-9956-ffa450edef68 --- build/get-version.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/get-version.sh b/build/get-version.sh index c29bceb01db..fd685b22a8d 100755 --- a/build/get-version.sh +++ b/build/get-version.sh @@ -12,14 +12,14 @@ # if test $# != 3; then - echo "USAGE: $0 CMD INCLUDEDIR PREFIX" - echo " where CMD is one of: all, major" + echo "USAGE: $0 CMD VERSION_HEADER PREFIX" + echo " where CMD is one of: all, major, libtool" exit 1 fi -major_sed="/#define.*$3_MAJOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p" -minor_sed="/#define.*$3_MINOR_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p" -patch_sed="/#define.*$3_PATCH_VERSION/s/^.*\([0-9][0-9]*\).*$/\1/p" +major_sed="/#define.*$3_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p" +minor_sed="/#define.*$3_MINOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p" +patch_sed="/#define.*$3_PATCH_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p" major="`sed -n $major_sed $2`" minor="`sed -n $minor_sed $2`" patch="`sed -n $patch_sed $2`" From 995667cab1baed0a0b62847b5369e697275e4ead Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 1 Jul 2004 14:34:48 +0000 Subject: [PATCH 5114/7878] * Makefile.in (install): Install an apr-1-config script alongside apr-config, more parallel install safety. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65254 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 9908354dc1a..356630faa02 100644 --- a/Makefile.in +++ b/Makefile.in @@ -28,6 +28,7 @@ INSTALL_SUBDIRS=@INSTALL_SUBDIRS@ TARGET_LIB = lib@APR_LIBNAME@.la APR_PCFILE = apr-$(APR_MAJOR_VERSION).pc +APR_CONFIG = apr-$(APR_MAJOR_VERSION)-config # # Rules for building specific targets, starting with 'all' for @@ -97,7 +98,8 @@ install: $(TARGET_LIB) apr-config.out build/apr_rules.out $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(bindir); \ fi; $(LIBTOOL) --mode=install cp apr-config.out $(DESTDIR)$(bindir)/apr-config - chmod 755 $(DESTDIR)$(bindir)/apr-config + $(LIBTOOL) --mode=install cp apr-config.out $(DESTDIR)$(bindir)/$(APR_CONFIG) + chmod 755 $(DESTDIR)$(bindir)/apr-config $(DESTDIR)$(bindir)/$(APR_CONFIG) @if [ $(INSTALL_SUBDIRS) != "none" ]; then \ for i in $(INSTALL_SUBDIRS); do \ ( cd $$i ; $(MAKE) DESTDIR=$(DESTDIR) install ); \ From 84dea03c51cbf485b911ccc76200956704f854ac Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Thu, 1 Jul 2004 21:21:59 +0000 Subject: [PATCH 5115/7878] Add an RPM spec file derived from Fedora Core. PR: Obtained from: Submitted by: Reviewed by: jorton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65255 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ build/rpm/apr.spec.in | 103 ++++++++++++++++++++++++++++++++++++++++++ buildconf | 16 +++++++ 3 files changed, 122 insertions(+) create mode 100644 build/rpm/apr.spec.in diff --git a/CHANGES b/CHANGES index 2e82371e1aa..d59e09436ce 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Add an RPM spec file derived from Fedora Core. + [Graham Leggett, Joe Orton] + *) Fix apr_threadattr_detach_set() on Mac OS X. PR 28472. [INOUE Seiichiro ] diff --git a/build/rpm/apr.spec.in b/build/rpm/apr.spec.in new file mode 100644 index 00000000000..050cf31bd9a --- /dev/null +++ b/build/rpm/apr.spec.in @@ -0,0 +1,103 @@ + +%define aprver 1 + +Summary: Apache Portable Runtime library +Name: apr +Version: APR_VERSION +Release: APR_RELEASE +License: Apache Software License +Group: System Environment/Libraries +URL: http://apr.apache.org/ +Source0: %{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot +BuildPrereq: autoconf, libtool, doxygen +Conflicts: subversion < 0.20.1-2 + +%description +The mission of the Apache Portable Runtime (APR) is to provide a +free library of C data structures and routines, forming a system +portability layer to as many operating systems as possible, +including Unices, MS Win32, BeOS and OS/2. + +%package devel +Group: Development/Libraries +Summary: APR library development kit +Requires: apr = %{version} +Conflicts: subversion-devel < 0.20.1-2 + +%description devel +This package provides the support files which can be used to +build applications using the APR library. The mission of the +Apache Portable Runtime (APR) is to provide a free library of +C data structures and routines. + +%prep +%setup -q + +%build +# regenerate configure script etc. +./buildconf +%configure \ + --prefix=/usr \ + --includedir=%{_includedir}/apr-%{aprver} \ + --with-installbuilddir=%{_libdir}/apr/build \ + --with-devrandom=/dev/urandom \ + CC=gcc CXX=g++ +make %{?_smp_mflags} && make dox + +%check +# Run non-interactive tests +%ifarch x86_64 +# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=97611 +excludes=testlock +%endif +pushd test +make %{?_smp_mflags} testall CFLAGS=-fno-strict-aliasing +TZ=PST8PDT ./testall -v ${excludes+-x $excludes} || exit 1 +popd + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT + +# Move docs to more convenient location +mv docs/dox/html html + +# Unpackaged files: +rm -f $RPM_BUILD_ROOT%{_libdir}/apr.exp + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +%doc CHANGES LICENSE +%{_libdir}/libapr-%{aprver}.so.* + +%files devel +%defattr(-,root,root,-) +%doc docs/APRDesign.html docs/canonical_filenames.html +%doc docs/incomplete_types docs/non_apr_programs +%doc --parents html +%{_bindir}/apr-config +%{_bindir}/apr-%{aprver}-config +%{_libdir}/libapr-%{aprver}.*a +%{_libdir}/libapr-%{aprver}.so +%dir %{_libdir}/apr +%dir %{_libdir}/apr/build +%{_libdir}/apr/build/* +%{_libdir}/pkgconfig/apr-%{aprver}.pc +%dir %{_includedir}/apr-%{aprver} +%{_includedir}/apr-%{aprver}/*.h + +%changelog +* Tue Jun 22 2004 Graham Leggett 1.0.0-1 +- update to support v1.0.0 of APR + +* Tue Jun 22 2004 Graham Leggett 1.0.0-1 +- derived from Fedora Core apr.spec + diff --git a/buildconf b/buildconf index e3ecfff6559..b16441f4ab3 100755 --- a/buildconf +++ b/buildconf @@ -83,4 +83,20 @@ rm -rf autom4te*.cache echo "Generating 'make' outputs ..." build/gen-build.py make +# Create RPM Spec file +if [ -f `which cut` ]; then + echo rebuilding rpm spec file + ( REVISION=`build/get-version.sh all include/apr_version.h APR` + VERSION=`echo $REVISION | cut -d- -s -f1` + RELEASE=`echo $REVISION | cut -d- -s -f2` + if [ "x$VERSION" = "x" ]; then + VERSION=$REVISION + RELEASE=1 + fi + cat ./build/rpm/apr.spec.in | \ + sed -e "s/APR_VERSION/$VERSION/" \ + -e "s/APR_RELEASE/$RELEASE/" \ + > apr.spec ) +fi + exit 0 From 01b0bbf10d3bf68141538ed8dd8a64501d1f8ba9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 1 Jul 2004 21:50:46 +0000 Subject: [PATCH 5116/7878] * build/rpm/apr.spec.in: Move installbuilddir to %{_libdir}/apr/build-1, remove unnecessary TZ setting for testall and old x86_64 pthreads workaround. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65256 13f79535-47bb-0310-9956-ffa450edef68 --- build/rpm/apr.spec.in | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/build/rpm/apr.spec.in b/build/rpm/apr.spec.in index 050cf31bd9a..7d113c35a65 100644 --- a/build/rpm/apr.spec.in +++ b/build/rpm/apr.spec.in @@ -11,7 +11,6 @@ URL: http://apr.apache.org/ Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildPrereq: autoconf, libtool, doxygen -Conflicts: subversion < 0.20.1-2 %description The mission of the Apache Portable Runtime (APR) is to provide a @@ -23,7 +22,6 @@ including Unices, MS Win32, BeOS and OS/2. Group: Development/Libraries Summary: APR library development kit Requires: apr = %{version} -Conflicts: subversion-devel < 0.20.1-2 %description devel This package provides the support files which can be used to @@ -40,20 +38,16 @@ C data structures and routines. %configure \ --prefix=/usr \ --includedir=%{_includedir}/apr-%{aprver} \ - --with-installbuilddir=%{_libdir}/apr/build \ + --with-installbuilddir=%{_libdir}/apr/build-%{aprver} \ --with-devrandom=/dev/urandom \ CC=gcc CXX=g++ make %{?_smp_mflags} && make dox %check # Run non-interactive tests -%ifarch x86_64 -# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=97611 -excludes=testlock -%endif pushd test make %{?_smp_mflags} testall CFLAGS=-fno-strict-aliasing -TZ=PST8PDT ./testall -v ${excludes+-x $excludes} || exit 1 +./testall -v || exit 1 popd %install @@ -75,7 +69,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -%doc CHANGES LICENSE +%doc CHANGES LICENSE NOTICE %{_libdir}/libapr-%{aprver}.so.* %files devel @@ -83,13 +77,12 @@ rm -rf $RPM_BUILD_ROOT %doc docs/APRDesign.html docs/canonical_filenames.html %doc docs/incomplete_types docs/non_apr_programs %doc --parents html -%{_bindir}/apr-config -%{_bindir}/apr-%{aprver}-config +%{_bindir}/apr*config %{_libdir}/libapr-%{aprver}.*a %{_libdir}/libapr-%{aprver}.so %dir %{_libdir}/apr -%dir %{_libdir}/apr/build -%{_libdir}/apr/build/* +%dir %{_libdir}/apr/build-%{aprver} +%{_libdir}/apr/build-%{aprver}/* %{_libdir}/pkgconfig/apr-%{aprver}.pc %dir %{_includedir}/apr-%{aprver} %{_includedir}/apr-%{aprver}/*.h From 8b038cd41d1ffb5266c0a3fbfe64d00d7efdfdcd Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 4 Jul 2004 23:38:18 +0000 Subject: [PATCH 5117/7878] Support threading on FreeBSD 5.x where kern.osreldate >= 502102. 5.3 will be the first release with this enabled by default (current -CURRENT will also be enabled); 5.2 and earlier still use the broken libc_r by default. Those people on 5.2 can pass --enable-threads and setup libmap.conf to use libkse instead. As for the 502102 magic number, from http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html: "5.2-CURRENT after change of default thread library from libc_r to libpthread. 502102" Submitted by: Craig Rodrigues Reviewed by: Justin Erenkrantz, Aaron Bannert (concept) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65257 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ build/apr_hints.m4 | 16 +++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index d59e09436ce..0942e902a9e 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Support threading on FreeBSD 5.x where kern.osreldate >= 502102. + [Craig Rodrigues ] + *) Add an RPM spec file derived from Fedora Core. [Graham Leggett, Joe Orton] diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 00316d00b08..4ba64a8cff9 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -136,14 +136,16 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DNETBSD]) ;; *-freebsd*) - case $host in - *freebsd[[2345]]*) - APR_ADDTO(CFLAGS, [-funsigned-char]) - ;; - esac - APR_SETIFNULL(enable_threads, [no]) APR_SETIFNULL(apr_lock_method, [USE_FLOCK_SERIALIZE]) - APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_THREAD_SAFE]) + os_version=`sysctl -n kern.osreldate` + dnl 502102 is when libc_r switched to libpthread (aka libkse). + if test $os_version -ge "502102"; then + apr_cv_pthreads_cflags="none" + apr_cv_pthreads_lib="-lpthread" + else + apr_cv_pthreads_cflags="-D_THREAD_SAFE -D_REENTRANT" + APR_SETIFNULL(enable_threads, [no]) + fi ;; *-next-nextstep*) APR_SETIFNULL(CFLAGS, [-O]) From 2cedcb54d7202b3ef78525d65a17a1dd603b428c Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Mon, 5 Jul 2004 07:38:38 +0000 Subject: [PATCH 5118/7878] Update the license, plus minor portability changes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65258 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 93 +++++++++++++++--------------------------------- 1 file changed, 28 insertions(+), 65 deletions(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index 0d49cce9eed..6b1c35d692a 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -1,61 +1,19 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 +/* Copyright 2000-2004 The Apache Software Foundation * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include -#if defined(_OSD_POSIX) -#include -#endif #include #include #include @@ -136,12 +94,17 @@ # define LIBRARIAN_OPTS "cr" # define DYNAMIC_LINK_OPTS "-G" # define LINKER_FLAG_PREFIX "-Wl," +# define NEED_SNPRINTF #endif #ifndef SHELL_CMD #error Unsupported platform: Please add defines for SHELL_CMD etc. for your platform. #endif +#ifdef NEED_SNPRINTF +#include +#endif + #ifdef __EMX__ #include #endif @@ -172,9 +135,9 @@ enum output_t { }; enum pic_mode_e { - UNKNOWN, - PREFER, - AVOID, + pic_UNKNOWN, + pic_PREFER, + pic_AVOID, }; typedef struct { @@ -232,7 +195,7 @@ typedef struct { const char *version_info; } command_t; -#if defined(_OSD_POSIX) +#if defined(NEED_SNPRINTF) /* Write at most n characters to the buffer in str, return the * number of chars written or -1 if the buffer would have been * overflowed. @@ -493,12 +456,12 @@ int parse_short_opt(char *arg, command_t *cmd_data) } if (strcmp(arg, "prefer-pic") == 0) { - cmd_data->options.pic_mode = PREFER; + cmd_data->options.pic_mode = pic_PREFER; return 1; } if (strcmp(arg, "prefer-non-pic") == 0) { - cmd_data->options.pic_mode = AVOID; + cmd_data->options.pic_mode = pic_AVOID; return 1; } @@ -696,7 +659,7 @@ char *check_object_exists(command_t *cmd, const char *arg, int arglen) if (rv == 0) { if (pass == 1) { - cmd->options.pic_mode = AVOID; + cmd->options.pic_mode = pic_AVOID; } return newarg; } @@ -734,7 +697,7 @@ char *check_library_exists(command_t *cmd, const char *arg, int pathlen, switch (pass) { case 0: - if (cmd->options.pic_mode != AVOID || cmd->options.shared) { + if (cmd->options.pic_mode != pic_AVOID || cmd->options.shared) { strcpy(ext, DYNAMIC_LIB_EXT); break; } @@ -913,7 +876,7 @@ int parse_output_file_name(char *arg, command_t *cmd_data) cmd_data->basename = arg; cmd_data->output = otProgram; #if defined(_OSD_POSIX) - cmd_data->options.pic_mode = AVOID; + cmd_data->options.pic_mode = pic_AVOID; #endif newarg = (char *)malloc(strlen(arg) + 5); strcpy(newarg, arg); @@ -1228,7 +1191,7 @@ void link_fixup(command_t *c) append_count_chars(c->arglist, c->obj_files); append_count_chars(c->arglist, c->shared_opts.dependencies); #ifdef DYNAMIC_LINK_OPTS - if (c->options.pic_mode != AVOID) { + if (c->options.pic_mode != pic_AVOID) { push_count_chars(c->arglist, DYNAMIC_LINK_OPTS); } #endif @@ -1242,7 +1205,7 @@ void post_parse_fixup(command_t *cmd_data) { case mCompile: #ifdef PIC_FLAG - if (cmd_data->options.pic_mode != AVOID) { + if (cmd_data->options.pic_mode != pic_AVOID) { push_count_chars(cmd_data->arglist, PIC_FLAG); } #endif @@ -1413,7 +1376,7 @@ int run_mode(command_t *cmd_data) #endif } #ifdef DYNAMIC_LINK_OPTS - if (cmd_data->options.pic_mode != AVOID) { + if (cmd_data->options.pic_mode != pic_AVOID) { push_count_chars(cmd_data->program_opts, DYNAMIC_LINK_OPTS); } @@ -1491,7 +1454,7 @@ int main(int argc, char *argv[]) memset(&cmd_data, 0, sizeof(cmd_data)); - cmd_data.options.pic_mode = UNKNOWN; + cmd_data.options.pic_mode = pic_UNKNOWN; cmd_data.program_opts = (count_chars*)malloc(sizeof(count_chars)); init_count_chars(cmd_data.program_opts); From 0264b11b248241d81ed396e58109c2649d94591d Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Mon, 5 Jul 2004 08:29:31 +0000 Subject: [PATCH 5119/7878] My excuses for the commit of jlibtool without prior discussion. I was mistakenly thinking that it was okay to add Justin's jlibtool, because it was referenced in the configure.in script, even with its own switch, and by reference to apr's build/ directory. Plus, it worked purrfectly for our OSD/POSIX platform... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65259 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 1496 ---------------------------------------------- 1 file changed, 1496 deletions(-) delete mode 100644 build/jlibtool.c diff --git a/build/jlibtool.c b/build/jlibtool.c deleted file mode 100644 index 6b1c35d692a..00000000000 --- a/build/jlibtool.c +++ /dev/null @@ -1,1496 +0,0 @@ -/* Copyright 2000-2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __EMX__ -# define SHELL_CMD "sh" -# define GEN_EXPORTS "emxexp" -# define DEF2IMPLIB_CMD "emximp" -# define SHARE_SW "-Zdll -Zmtd" -# define USE_OMF 1 -# define TRUNCATE_DLL_NAME -# define DYNAMIC_LIB_EXT "dll" -# define EXE_EXT ".exe" - -# if USE_OMF - /* OMF is the native format under OS/2 */ -# define STATIC_LIB_EXT "lib" -# define OBJECT_EXT "obj" -# define LIBRARIAN "emxomfar" -# define LIBRARIAN_OPTS "cr" -# else - /* but the alternative, a.out, can fork() which is sometimes necessary */ -# define STATIC_LIB_EXT "a" -# define OBJECT_EXT "o" -# define LIBRARIAN "ar" -# define LIBRARIAN_OPTS "cr" -# endif -#endif - -#if defined(__APPLE__) -# define SHELL_CMD "/bin/sh" -# define DYNAMIC_LIB_EXT "dylib" -# define MODULE_LIB_EXT "so" -# define STATIC_LIB_EXT "a" -# define OBJECT_EXT "o" -# define LIBRARIAN "ar" -# define LIBRARIAN_OPTS "cr" -/* man libtool(1) documents ranlib option of -c. */ -# define RANLIB "ranlib" -# define PIC_FLAG "-fPIC -fno-common" -# define RPATH "-rpath" -# define SHARED_OPTS "-dynamiclib" -# define MODULE_OPTS "-bundle" -# define DYNAMIC_LINK_OPTS "-flat_namespace -undefined suppress" -# define dynamic_link_version_func darwin_dynamic_link_function -# define DYNAMIC_INSTALL_NAME "-install_name" -//-install_name /Users/jerenk/apache-2.0-cvs/lib/libapr.0.dylib -compatibility_version 1 -current_version 1.0 -#endif - -#if defined(__linux__) || defined(__FreeBSD__) -# define SHELL_CMD "/bin/sh" -# define DYNAMIC_LIB_EXT "so" -# define MODULE_LIB_EXT "so" -# define STATIC_LIB_EXT "a" -# define OBJECT_EXT "o" -# define LIBRARIAN "ar" -# define LIBRARIAN_OPTS "cr" -# define RANLIB "ranlib" -# define PIC_FLAG "-fPIC" -# define RPATH "-rpath" -# define DYNAMIC_LINK_OPTS "-shared" -# define LINKER_FLAG_PREFIX "-Wl," -#endif - -#if defined(_OSD_POSIX) -# define SHELL_CMD "/usr/bin/sh" -# define DYNAMIC_LIB_EXT "so" -# define MODULE_LIB_EXT "so" -# define STATIC_LIB_EXT "a" -# define OBJECT_EXT "o" -# define LIBRARIAN "ar" -# define LIBRARIAN_OPTS "cr" -# define DYNAMIC_LINK_OPTS "-G" -# define LINKER_FLAG_PREFIX "-Wl," -# define NEED_SNPRINTF -#endif - -#ifndef SHELL_CMD -#error Unsupported platform: Please add defines for SHELL_CMD etc. for your platform. -#endif - -#ifdef NEED_SNPRINTF -#include -#endif - -#ifdef __EMX__ -#include -#endif - -#ifndef PATH_MAX -#define PATH_MAX 1024 -#endif - - -/* We want to say we are libtool 1.4 for shlibtool compatibility. */ -#define VERSION "1.4" - -enum tool_mode_t { - mUnknown, - mCompile, - mLink, - mInstall, -}; - -enum output_t { - otGeneral, - otObject, - otProgram, - otLibrary, - otStaticLibraryOnly, - otDynamicLibraryOnly, - otModule, -}; - -enum pic_mode_e { - pic_UNKNOWN, - pic_PREFER, - pic_AVOID, -}; - -typedef struct { - const char **vals; - int num; -} count_chars; - -typedef struct { - const char *normal; - const char *install; -} library_name; - -typedef struct { - count_chars *normal; - count_chars *install; - count_chars *dependencies; -} library_opts; - -typedef struct { - int silent; - int shared; - int export_all; - int dry_run; - enum pic_mode_e pic_mode; - int export_dynamic; -} options_t; - -typedef struct { - enum tool_mode_t mode; - enum output_t output; - options_t options; - - char *output_name; - char *fake_output_name; - char *basename; - - const char *install_path; - const char *compiler; - const char *program; - count_chars *program_opts; - - count_chars *arglist; - count_chars *tmp_dirs; - count_chars *obj_files; - count_chars *dep_rpaths; - count_chars *rpaths; - - library_name static_name; - library_name shared_name; - library_name module_name; - - library_opts static_opts; - library_opts shared_opts; - - const char *version_info; -} command_t; - -#if defined(NEED_SNPRINTF) -/* Write at most n characters to the buffer in str, return the - * number of chars written or -1 if the buffer would have been - * overflowed. - * - * This is portable to any POSIX-compliant system has /dev/null - */ -static FILE *f=NULL; -static int vsnprintf( char *str, size_t n, const char *fmt, va_list ap ) -{ - int res; - - if (f == NULL) - f = fopen("/dev/null","w"); - if (f == NULL) - return -1; - - setvbuf( f, str, _IOFBF, n ); - - res = vfprintf( f, fmt, ap ); - - if ( res > 0 && res < n ) { - res = vsprintf( str, fmt, ap ); - } - return res; -} -static int snprintf( char *str, size_t n, const char *fmt, ... ) -{ - va_list ap; - int res; - - va_start( ap, fmt ); - res = vsnprintf( str, n, fmt, ap ); - va_end( ap ); - return res; -} -#endif - -void init_count_chars(count_chars *cc) -{ - cc->vals = (const char**)malloc(PATH_MAX); - cc->num = 0; -} - -void clear_count_chars(count_chars *cc) -{ - int i; - for (i = 0; i < cc->num; i++) { - cc->vals[i] = 0; - } - - cc->num = 0; -} - -void push_count_chars(count_chars *cc, const char *newval) -{ - cc->vals[cc->num++] = newval; -} - -void insert_count_chars(count_chars *cc, const char *newval, int position) -{ - int i; - - for (i = cc->num; i > position; i--) { - cc->vals[i] = cc->vals[i-1]; - } - - cc->vals[position] = newval; - cc->num++; -} - -void append_count_chars(count_chars *cc, count_chars *cctoadd) -{ - int i; - for (i = 0; i < cctoadd->num; i++) { - if (cctoadd->vals[i]) { - push_count_chars(cc, cctoadd->vals[i]); - } - } -} - -const char *flatten_count_chars(count_chars *cc) -{ - int i, size; - char *newval; - - size = 0; - for (i = 0; i < cc->num; i++) { - if (cc->vals[i]) { - size += strlen(cc->vals[i]) + 1; - } - } - - newval = (char*)malloc(size + 1); - newval[size] = 0; - - for (i = 0; i < cc->num; i++) { - if (cc->vals[i]) { - strcat(newval, cc->vals[i]); - strcat(newval, " "); - } - } - - return newval; -} - -char *shell_esc(const char *str) -{ - char *cmd; - unsigned char *d; - const unsigned char *s; - - cmd = (char *)malloc(2 * strlen(str) + 1); - d = (unsigned char *)cmd; - s = (const unsigned char *)str; - - for (; *s; ++s) { - if (*s == '"' || *s == '\\') { - *d++ = '\\'; - } - *d++ = *s; - } - - *d = '\0'; - return cmd; -} - -int external_spawn(command_t *cmd, const char *file, const char **argv) -{ - if (!cmd->options.silent) { - const char **argument = argv; - printf("Executing: "); - while (*argument) { - printf("%s ", *argument); - argument++; - } - puts(""); - } - - if (cmd->options.dry_run) { - return 0; - } -#ifdef __EMX__ - return spawnvp(P_WAIT, file, argv); -#else - { - pid_t pid; - pid = fork(); - if (pid == 0) { - return execvp(argv[0], (char**)argv); - } - else { - int statuscode; - waitpid(pid, &statuscode, 0); - if (WIFEXITED(statuscode)) { - return WEXITSTATUS(statuscode); - } - return 0; - } - } -#endif -} - -int run_command(command_t *cmd_data, count_chars *cc) -{ - char *command; - const char *spawn_args[4]; - count_chars tmpcc; - - init_count_chars(&tmpcc); - - if (cmd_data->program) { - push_count_chars(&tmpcc, cmd_data->program); - } - - append_count_chars(&tmpcc, cmd_data->program_opts); - - append_count_chars(&tmpcc, cc); - - command = shell_esc(flatten_count_chars(&tmpcc)); - - spawn_args[0] = SHELL_CMD; - spawn_args[1] = "-c"; - spawn_args[2] = command; - spawn_args[3] = NULL; - return external_spawn(cmd_data, spawn_args[0], (const char**)spawn_args); -} - -int parse_long_opt(char *arg, command_t *cmd_data) -{ - char *equal_pos = strchr(arg, '='); - char var[50]; - char value[500]; - - if (equal_pos) { - strncpy(var, arg, equal_pos - arg); - var[equal_pos - arg] = 0; - strcpy(value, equal_pos + 1); - } else { - strcpy(var, arg); - } - - if (strcmp(var, "silent") == 0) { - cmd_data->options.silent = 1; - } else if (strcmp(var, "mode") == 0) { - if (strcmp(value, "compile") == 0) { - cmd_data->mode = mCompile; - cmd_data->output = otObject; - } - - if (strcmp(value, "link") == 0) { - cmd_data->mode = mLink; - cmd_data->output = otLibrary; - } - - if (strcmp(value, "install") == 0) { - cmd_data->mode = mInstall; - } - } else if (strcmp(var, "shared") == 0) { - if (cmd_data->mode == mLink) { - cmd_data->output = otDynamicLibraryOnly; - } - cmd_data->options.shared = 1; - } else if (strcmp(var, "export-all") == 0) { - cmd_data->options.export_all = 1; - } else if (strcmp(var, "dry-run") == 0) { - printf("Dry-run mode on!\n"); - cmd_data->options.dry_run = 1; - } else if (strcmp(var, "version") == 0) { - printf("Version " VERSION "\n"); - } else if (strcmp(var, "help") == 0) { - printf("Sorry. No help available.\n"); - } else { - return 0; - } - - return 1; -} - -/* Return 1 if we eat it. */ -int parse_short_opt(char *arg, command_t *cmd_data) -{ - if (strcmp(arg, "export-dynamic") == 0) { - cmd_data->options.export_dynamic = 1; - return 1; - } - - if (strcmp(arg, "module") == 0) { - cmd_data->output = otModule; - return 1; - } - - if (strcmp(arg, "Zexe") == 0) { - return 1; - } - - if (strcmp(arg, "avoid-version") == 0) { - return 1; - } - - if (strcmp(arg, "prefer-pic") == 0) { - cmd_data->options.pic_mode = pic_PREFER; - return 1; - } - - if (strcmp(arg, "prefer-non-pic") == 0) { - cmd_data->options.pic_mode = pic_AVOID; - return 1; - } - - if (strcmp(arg, "static") == 0) { - /* Don't respect it for now. */ - return 1; - } - - if (cmd_data->mode == mLink) { - if (arg[0] == 'L' || arg[0] == 'l') { - /* Hack... */ - arg--; - push_count_chars(cmd_data->shared_opts.dependencies, arg); - return 1; - } - } - return 0; -} - -char *truncate_dll_name(char *path) -{ - /* Cut DLL name down to 8 characters after removing any mod_ prefix */ - char *tmppath = strdup(path); - char *newname = strrchr(tmppath, '/') + 1; - char *ext = strrchr(tmppath, '.'); - int len; - - if (ext == NULL) - return tmppath; - - len = ext - newname; - - if (strncmp(newname, "mod_", 4) == 0) { - strcpy(newname, newname + 4); - len -= 4; - } - - if (len > 8) { - strcpy(newname + 8, strchr(newname, '.')); - } - - return tmppath; -} - -long safe_strtol(const char *nptr, const char **endptr, int base) -{ - long rv; - - errno = 0; - - rv = strtol(nptr, (char**)endptr, 10); - - if (errno == ERANGE) { - return 0; - } - - return rv; -} - -/* version_info is in the form of MAJOR:MINOR:PATCH */ -const char *darwin_dynamic_link_function(const char *version_info) -{ - char *newarg; - long major, minor, patch; - - major = 0; - minor = 0; - patch = 0; - - if (version_info) { - major = safe_strtol(version_info, &version_info, 10); - - if (version_info) { - if (version_info[0] == ':') { - version_info++; - } - - minor = safe_strtol(version_info, &version_info, 10); - - if (version_info) { - if (version_info[0] == ':') { - version_info++; - } - - patch = safe_strtol(version_info, &version_info, 10); - - } - } - } - - /* Avoid -dylib_compatibility_version must be greater than zero errors. */ - if (major == 0) { - major = 1; - } - newarg = (char*)malloc(100); - snprintf(newarg, 99, - "-compatibility_version %ld -current_version %ld.%ld", - major, major, minor); - - return newarg; -} - -/* genlib values - * 0 - static - * 1 - dynamic - * 2 - module - */ -char *gen_library_name(const char *name, int genlib) -{ - char *newarg, *newext; - - newarg = (char *)malloc(strlen(name) + 10); - strcpy(newarg, ".libs/"); - - if (genlib == 2 && strncmp(name, "lib", 3) == 0) { - name += 3; - } - - strcat(newarg, name); - - newext = strrchr(newarg, '.') + 1; - - switch (genlib) { - case 0: - strcpy(newext, STATIC_LIB_EXT); - break; - case 1: - strcpy(newext, DYNAMIC_LIB_EXT); - break; - case 2: - strcpy(newext, MODULE_LIB_EXT); - break; - } - - return newarg; -} - -/* genlib values - * 0 - static - * 1 - dynamic - * 2 - module - */ -char *gen_install_name(const char *name, int genlib) -{ - struct stat sb; - char *newname; - int rv; - - newname = gen_library_name(name, genlib); - - /* Check if it exists. If not, return NULL. */ - rv = stat(newname, &sb); - - if (rv) { - return NULL; - } - - return newname; -} - -char *check_object_exists(command_t *cmd, const char *arg, int arglen) -{ - char *newarg, *ext; - int pass, rv; - - newarg = (char *)malloc(arglen + 10); - memcpy(newarg, arg, arglen); - newarg[arglen] = 0; - ext = newarg + arglen; - - pass = 0; - - do { - struct stat sb; - - switch (pass) { - case 0: - strcpy(ext, OBJECT_EXT); - break; -/* - case 1: - strcpy(ext, NO_PIC_EXT); - break; -*/ - default: - break; - } - - if (!cmd->options.silent) { - printf("Checking: %s\n", newarg); - } - rv = stat(newarg, &sb); - } - while (rv != 0 && ++pass < 1); - - if (rv == 0) { - if (pass == 1) { - cmd->options.pic_mode = pic_AVOID; - } - return newarg; - } - - return NULL; -} - -/* libdircheck values: - * 0 - no .libs suffix - * 1 - .libs suffix - */ -char *check_library_exists(command_t *cmd, const char *arg, int pathlen, - int libdircheck) -{ - char *newarg, *ext; - int pass, rv, newpathlen; - - newarg = (char *)malloc(strlen(arg) + 10); - strcpy(newarg, arg); - newarg[pathlen] = 0; - - newpathlen = pathlen; - if (libdircheck) { - strcat(newarg, ".libs/"); - newpathlen += sizeof(".libs/") - 1; - } - - strcpy(newarg+newpathlen, arg+pathlen); - ext = strrchr(newarg, '.') + 1; - - pass = 0; - - do { - struct stat sb; - - switch (pass) { - case 0: - if (cmd->options.pic_mode != pic_AVOID || cmd->options.shared) { - strcpy(ext, DYNAMIC_LIB_EXT); - break; - } - pass = 1; - case 1: - strcpy(ext, STATIC_LIB_EXT); - break; - case 2: - strcpy(ext, MODULE_LIB_EXT); - break; - case 3: - strcpy(ext, OBJECT_EXT); - break; - default: - break; - } - - if (!cmd->options.silent) { - printf("Checking: %s\n", newarg); - } - rv = stat(newarg, &sb); - } - while (rv != 0 && ++pass < 4); - - if (rv == 0) { - return newarg; - } - - return NULL; -} - -void add_linker_flag_prefix(count_chars *cc, const char *arg) -{ -#ifndef LINKER_FLAG_PREFIX - push_count_chars(cc, arg); -#else - char *newarg; - newarg = (char*)malloc(strlen(arg) + sizeof(LINKER_FLAG_PREFIX)); - strcpy(newarg, LINKER_FLAG_PREFIX); - strcpy(newarg, arg); - push_count_chars(cc, newarg); -#endif -} - -int parse_input_file_name(char *arg, command_t *cmd_data) -{ - char *ext = strrchr(arg, '.'); - char *name = strrchr(arg, '/'); - int pathlen; - char *newarg; - - if (!ext) { - return 0; - } - - ext++; - - if (name == NULL) { - name = strrchr(arg, '\\'); - - if (name == NULL) { - name = arg; - } else { - name++; - } - } else { - name++; - } - - pathlen = name - arg; - - if (strcmp(ext, "lo") == 0) { - newarg = check_object_exists(cmd_data, arg, ext - arg); - if (!newarg) { - printf("Can not find suitable object file for %s\n", arg); - exit(1); - } - if (cmd_data->mode != mLink) { - push_count_chars(cmd_data->arglist, newarg); - } - else { - push_count_chars(cmd_data->obj_files, newarg); - } - return 1; - } - - if (strcmp(ext, "la") == 0) { - switch (cmd_data->mode) { - case mLink: - /* Try the .libs dir first! */ - newarg = check_library_exists(cmd_data, arg, pathlen, 1); - if (!newarg) { - /* Try the normal dir next. */ - newarg = check_library_exists(cmd_data, arg, pathlen, 0); - if (!newarg) { - printf("Can not find suitable library for %s\n", arg); - exit(1); - } - } - - if (cmd_data->mode != mLink) { - push_count_chars(cmd_data->arglist, newarg); - } - else { - push_count_chars(cmd_data->shared_opts.dependencies, newarg); - } - break; - case mInstall: - /* If we've already recorded a library to install, we're most - * likely getting the .la file that we want to install as. - * The problem is that we need to add it as the directory, - * not the .la file itself. Otherwise, we'll do odd things. - */ - if (cmd_data->output == otLibrary) { - arg[pathlen] = '\0'; - push_count_chars(cmd_data->arglist, arg); - } - else { - cmd_data->output = otLibrary; - cmd_data->output_name = arg; - cmd_data->static_name.install = gen_install_name(arg, 0); - cmd_data->shared_name.install = gen_install_name(arg, 1); - cmd_data->module_name.install = gen_install_name(arg, 2); - } - break; - default: - break; - } - return 1; - } - - if (strcmp(ext, "c") == 0) { - /* If we don't already have an idea what our output name will be. */ - if (cmd_data->basename == NULL) { - cmd_data->basename = (char *)malloc(strlen(arg) + 4); - strcpy(cmd_data->basename, arg); - strcpy(strrchr(cmd_data->basename, '.') + 1, "lo"); - - cmd_data->fake_output_name = strrchr(cmd_data->basename, '/'); - if (cmd_data->fake_output_name) { - cmd_data->fake_output_name++; - } - else { - cmd_data->fake_output_name = cmd_data->basename; - } - } - } - - return 0; -} - -int parse_output_file_name(char *arg, command_t *cmd_data) -{ - char *name = strrchr(arg, '/'); - char *ext = strrchr(arg, '.'); - char *newarg = NULL; - int pathlen; - - cmd_data->fake_output_name = arg; - - if (name) { - name++; - } - else { - name = strrchr(arg, '\\'); - - if (name == NULL) { - name = arg; - } - else { - name++; - } - } - - if (!ext) { - cmd_data->basename = arg; - cmd_data->output = otProgram; -#if defined(_OSD_POSIX) - cmd_data->options.pic_mode = pic_AVOID; -#endif - newarg = (char *)malloc(strlen(arg) + 5); - strcpy(newarg, arg); -#ifdef EXE_EXT - strcat(newarg, EXE_EXT); -#endif - cmd_data->output_name = newarg; - return 1; - } - - ext++; - pathlen = name - arg; - - if (strcmp(ext, "la") == 0) { - assert(cmd_data->mode == mLink); - - cmd_data->basename = arg; - cmd_data->static_name.normal = gen_library_name(arg, 0); - cmd_data->shared_name.normal = gen_library_name(arg, 1); - cmd_data->module_name.normal = gen_library_name(arg, 2); - cmd_data->static_name.install = gen_install_name(arg, 0); - cmd_data->shared_name.install = gen_install_name(arg, 1); - cmd_data->module_name.install = gen_install_name(arg, 2); - -#ifdef TRUNCATE_DLL_NAME - if (shared) { - arg = truncate_dll_name(arg); - } -#endif - - cmd_data->output_name = arg; - return 1; - } - - if (strcmp(ext, "lo") == 0) { - cmd_data->basename = arg; - cmd_data->output = otObject; - newarg = (char *)malloc(strlen(arg) + 2); - strcpy(newarg, arg); - ext = strrchr(newarg, '.') + 1; - strcpy(ext, OBJECT_EXT); - cmd_data->output_name = newarg; - return 1; - } - - return 0; -} - -/* returns just a file's name without path or extension */ -char *nameof(char *fullpath) -{ - char buffer[1024]; - char *ext; - char *name = strrchr(fullpath, '/'); - - if (name == NULL) { - name = strrchr(fullpath, '\\'); - } - - if (name == NULL) { - name = fullpath; - } else { - name++; - } - - strcpy(buffer, name); - ext = strrchr(buffer, '.'); - - if (ext) { - *ext = 0; - return strdup(buffer); - } - - return name; -} - -void parse_args(int argc, char *argv[], command_t *cmd_data) -{ - int a; - char *arg; - int argused; - - for (a=1; a < argc; a++) { - arg = argv[a]; - argused = 1; - - if (arg[0] == '-') { - if (arg[1] == '-') { - argused = parse_long_opt(arg + 2, cmd_data); - } - else { - argused = parse_short_opt(arg + 1, cmd_data); - } - - /* We haven't done anything with it yet, try some of the - * more complicated short opts... */ - if (argused == 0 && a + 1 < argc) { - if (arg[1] == 'o' && !arg[2]) { - arg = argv[++a]; - argused = parse_output_file_name(arg, cmd_data); - } else if (strcmp(arg+1, "rpath") == 0) { - /* Aha, we should try to link both! */ - cmd_data->install_path = argv[++a]; - argused = 1; - } else if (strcmp(arg+1, "version-info") == 0) { - /* Store for later deciphering */ - cmd_data->version_info = argv[++a]; - argused = 1; - } - } - } else { - argused = parse_input_file_name(arg, cmd_data); - } - - if (!argused) { - if (!cmd_data->options.silent) { - printf("Adding: %s\n", arg); - } - push_count_chars(cmd_data->arglist, arg); - } - } - -} - -int explode_static_lib(const char *lib, command_t *cmd_data) -{ - char tmpdir[1024]; - char savewd[1024]; - char cmd[1024]; - const char *name; - DIR *dir; - struct dirent *entry; - - /* Bah! */ - if (cmd_data->options.dry_run) { - return 0; - } - - strcpy(tmpdir, lib); - strcat(tmpdir, ".exploded"); - - mkdir(tmpdir, 0); - push_count_chars(cmd_data->tmp_dirs, strdup(tmpdir)); - getcwd(savewd, sizeof(savewd)); - - if (chdir(tmpdir) != 0) - return 1; - - strcpy(cmd, LIBRARIAN " x "); - name = strrchr(lib, '/'); - - if (name) { - name++; - } else { - name = lib; - } - - strcat(cmd, "../"); - strcat(cmd, name); - system(cmd); - chdir(savewd); - dir = opendir(tmpdir); - - while ((entry = readdir(dir)) != NULL) { - if (entry->d_name[0] != '.') { - strcpy(cmd, tmpdir); - strcat(cmd, "/"); - strcat(cmd, entry->d_name); - push_count_chars(cmd_data->arglist, strdup(cmd)); - } - } - - closedir(dir); - return 0; -} - -#ifdef GEN_EXPORTS -void generate_def_file(command_t *cmd_data) -{ - char def_file[1024]; - char implib_file[1024]; - char *ext; - FILE *hDef; - char *export_args[1024]; - int num_export_args = 0; - char *cmd; - int cmd_size = 0; - int a; - - if (cmd_data->output_name) { - strcpy(def_file, cmd_data->output_name); - strcat(def_file, ".def"); - hDef = fopen(def_file, "w"); - - if (hDef != NULL) { - fprintf(hDef, "LIBRARY '%s' INITINSTANCE\n", nameof(cmd_data->output_name)); - fprintf(hDef, "DATA NONSHARED\n"); - fprintf(hDef, "EXPORTS\n"); - fclose(hDef); - - for (a = 0; a < cmd_data->num_obj_files; a++) { - cmd_size += strlen(cmd_data->obj_files[a]) + 1; - } - - cmd_size += strlen(GEN_EXPORTS) + strlen(def_file) + 3; - cmd = (char *)malloc(cmd_size); - strcpy(cmd, GEN_EXPORTS); - - for (a=0; a < cmd_data->num_obj_files; a++) { - strcat(cmd, " "); - strcat(cmd, cmd_data->obj_files[a] ); - } - - strcat(cmd, ">>"); - strcat(cmd, def_file); - puts(cmd); - export_args[num_export_args++] = SHELL_CMD; - export_args[num_export_args++] = "-c"; - export_args[num_export_args++] = cmd; - export_args[num_export_args++] = NULL; - external_spawn(cmd_data, export_args[0], (const char**)export_args); - cmd_data->arglist[cmd_data->num_args++] = strdup(def_file); - - /* Now make an import library for the dll */ - num_export_args = 0; - export_args[num_export_args++] = DEF2IMPLIB_CMD; - export_args[num_export_args++] = "-o"; - - strcpy(implib_file, ".libs/"); - strcat(implib_file, cmd_data->basename); - ext = strrchr(implib_file, '.'); - - if (ext) - *ext = 0; - - strcat(implib_file, "."); - strcat(implib_file, STATIC_LIB_EXT); - - export_args[num_export_args++] = implib_file; - export_args[num_export_args++] = def_file; - export_args[num_export_args++] = NULL; - external_spawn(cmd_data, export_args[0], (const char**)export_args); - - } - } -} -#endif - -const char* expand_path(const char *relpath) -{ - char foo[PATH_MAX], *newpath; - - getcwd(foo, PATH_MAX-1); - newpath = (char*)malloc(strlen(foo)+strlen(relpath)+2); - strcat(newpath, foo); - strcat(newpath, "/"); - strcat(newpath, relpath); - return newpath; -} - -void link_fixup(command_t *c) -{ - /* If we were passed an -rpath directive, we need to build - * shared objects too. Otherwise, we should only create static - * libraries. - */ - if (!c->install_path && (c->output == otDynamicLibraryOnly || - c->output == otModule || c->output == otLibrary)) { - c->output = otStaticLibraryOnly; - } - - if (c->output == otDynamicLibraryOnly || - c->output == otModule || - c->output == otLibrary) { - - push_count_chars(c->shared_opts.normal, "-o"); - if (c->output == otModule) { - push_count_chars(c->shared_opts.normal, c->module_name.normal); - } - else { - char *tmp; - push_count_chars(c->shared_opts.normal, c->shared_name.normal); -#ifdef DYNAMIC_INSTALL_NAME - push_count_chars(c->shared_opts.normal, DYNAMIC_INSTALL_NAME); - - tmp = (char*)malloc(PATH_MAX); - strcat(tmp, c->install_path); - strcat(tmp, strrchr(c->shared_name.normal, '/')); - push_count_chars(c->shared_opts.normal, tmp); -#endif - } - - append_count_chars(c->shared_opts.normal, c->obj_files); - append_count_chars(c->shared_opts.normal, c->shared_opts.dependencies); - - if (c->options.export_all) { -#ifdef GEN_EXPORTS - generate_def_file(c); -#endif - } - } - - if (c->output == otLibrary || c->output == otStaticLibraryOnly) { - push_count_chars(c->static_opts.normal, "-o"); - push_count_chars(c->static_opts.normal, c->output_name); - } - - if (c->output == otProgram) { - if (c->output_name) { - push_count_chars(c->arglist, "-o"); - push_count_chars(c->arglist, c->output_name); - append_count_chars(c->arglist, c->obj_files); - append_count_chars(c->arglist, c->shared_opts.dependencies); -#ifdef DYNAMIC_LINK_OPTS - if (c->options.pic_mode != pic_AVOID) { - push_count_chars(c->arglist, DYNAMIC_LINK_OPTS); - } -#endif - } - } -} - -void post_parse_fixup(command_t *cmd_data) -{ - switch (cmd_data->mode) - { - case mCompile: -#ifdef PIC_FLAG - if (cmd_data->options.pic_mode != pic_AVOID) { - push_count_chars(cmd_data->arglist, PIC_FLAG); - } -#endif - if (cmd_data->output_name) { - push_count_chars(cmd_data->arglist, "-o"); - push_count_chars(cmd_data->arglist, cmd_data->output_name); - } - break; - case mLink: - link_fixup(cmd_data); - break; - case mInstall: - if (cmd_data->output == otLibrary) { - link_fixup(cmd_data); - } - default: - break; - } - -#if USE_OMF - if (cmd_data->output == otObject || - cmd_data->output == otProgram || - cmd_data->output == otLibrary || - cmd_data->output == otDynamicLibraryOnly) { - push_count_chars(cmd_data->arglist, "-Zomf"); - } -#endif - - if (cmd_data->options.shared && - (cmd_data->output == otObject || - cmd_data->output == otLibrary || - cmd_data->output == otDynamicLibraryOnly)) { -#ifdef SHARE_SW - push_count_chars(cmd_data->arglist, SHARE_SW); -#endif - } -} - -int run_mode(command_t *cmd_data) -{ - int rv; - count_chars *cctemp; - - cctemp = (count_chars*)malloc(sizeof(count_chars)); - init_count_chars(cctemp); - - switch (cmd_data->mode) - { - case mCompile: - rv = run_command(cmd_data, cmd_data->arglist); - if (rv) { - return rv; - } - break; - case mInstall: - /* Well, we'll assume it's a file going to a directory... */ - /* For brain-dead install-sh based scripts, we have to repeat - * the command N-times. install-sh should die. - */ - if (!cmd_data->output_name) { - rv = run_command(cmd_data, cmd_data->arglist); - if (rv) { - return rv; - } - } - if (cmd_data->output_name) { - append_count_chars(cctemp, cmd_data->arglist); - insert_count_chars(cctemp, - cmd_data->output_name, - cctemp->num - 1); - rv = run_command(cmd_data, cctemp); - if (rv) { - return rv; - } - clear_count_chars(cctemp); - } - if (cmd_data->static_name.install) { - append_count_chars(cctemp, cmd_data->arglist); - insert_count_chars(cctemp, - cmd_data->static_name.install, - cctemp->num - 1); - rv = run_command(cmd_data, cctemp); - if (rv) { - return rv; - } - clear_count_chars(cctemp); - } - if (cmd_data->shared_name.install) { - append_count_chars(cctemp, cmd_data->arglist); - insert_count_chars(cctemp, - cmd_data->shared_name.install, - cctemp->num - 1); - rv = run_command(cmd_data, cctemp); - if (rv) { - return rv; - } - clear_count_chars(cctemp); - } - if (cmd_data->module_name.install) { - append_count_chars(cctemp, cmd_data->arglist); - insert_count_chars(cctemp, - cmd_data->module_name.install, - cctemp->num - 1); - rv = run_command(cmd_data, cctemp); - if (rv) { - return rv; - } - clear_count_chars(cctemp); - } - break; - case mLink: - if (!cmd_data->options.dry_run) { - /* Check first to see if the dir already exists! */ - mode_t old_umask; - - old_umask = umask(0); - umask(old_umask); - - mkdir(".libs", ~old_umask); - } - - if (cmd_data->output == otStaticLibraryOnly || - cmd_data->output == otLibrary) { -#ifdef RANLIB - const char *lib_args[3]; -#endif - /* Removes compiler! */ - cmd_data->program = LIBRARIAN; - push_count_chars(cmd_data->program_opts, LIBRARIAN_OPTS); - push_count_chars(cmd_data->program_opts, - cmd_data->static_name.normal); - - rv = run_command(cmd_data, cmd_data->obj_files); - if (rv) { - return rv; - } - -#ifdef RANLIB - lib_args[0] = RANLIB; - lib_args[1] = cmd_data->static_name.normal; - lib_args[2] = NULL; - external_spawn(cmd_data, RANLIB, lib_args); -#endif - if (!cmd_data->options.dry_run) { - //link( - } - } - - if (cmd_data->output == otDynamicLibraryOnly || - cmd_data->output == otModule || - cmd_data->output == otLibrary) { - cmd_data->program = NULL; - clear_count_chars(cmd_data->program_opts); - - append_count_chars(cmd_data->program_opts, cmd_data->arglist); - if (cmd_data->output != otModule) { -#ifdef SHARED_OPTS - push_count_chars(cmd_data->program_opts, SHARED_OPTS); -#endif -#ifdef dynamic_link_version_func - push_count_chars(cmd_data->program_opts, - dynamic_link_version_func(cmd_data->version_info)); -#endif - } - if (cmd_data->output == otModule) { -#ifdef MODULE_OPTS - push_count_chars(cmd_data->program_opts, MODULE_OPTS); -#endif - } -#ifdef DYNAMIC_LINK_OPTS - if (cmd_data->options.pic_mode != pic_AVOID) { - push_count_chars(cmd_data->program_opts, - DYNAMIC_LINK_OPTS); - } -#endif - rv = run_command(cmd_data, cmd_data->shared_opts.normal); - if (rv) { - return rv; - } - } - if (cmd_data->output == otProgram) { - rv = run_command(cmd_data, cmd_data->arglist); - if (rv) { - return rv; - } - } - break; - default: - break; - } - - return 0; -} - -void cleanup_tmp_dir(const char *dirname) -{ - DIR *dir; - struct dirent *entry; - char fullname[1024]; - - dir = opendir(dirname); - - if (dir == NULL) - return; - - while ((entry = readdir(dir)) != NULL) { - if (entry->d_name[0] != '.') { - strcpy(fullname, dirname); - strcat(fullname, "/"); - strcat(fullname, entry->d_name); - remove(fullname); - } - } - - rmdir(dirname); -} - -void cleanup_tmp_dirs(command_t *cmd_data) -{ - int d; - - for (d = 0; d < cmd_data->tmp_dirs->num; d++) { - cleanup_tmp_dir(cmd_data->tmp_dirs->vals[d]); - } -} - -int ensure_fake_uptodate(command_t *cmd_data) -{ - /* FIXME: could do the stat/touch here, but nah... */ - const char *touch_args[3]; - - if (cmd_data->mode == mInstall) { - return 0; - } - - touch_args[0] = "touch"; - touch_args[1] = cmd_data->fake_output_name; - touch_args[2] = NULL; - return external_spawn(cmd_data, "touch", touch_args); -} - -int main(int argc, char *argv[]) -{ - int rc; - command_t cmd_data; - - memset(&cmd_data, 0, sizeof(cmd_data)); - - cmd_data.options.pic_mode = pic_UNKNOWN; - - cmd_data.program_opts = (count_chars*)malloc(sizeof(count_chars)); - init_count_chars(cmd_data.program_opts); - cmd_data.arglist = (count_chars*)malloc(sizeof(count_chars)); - init_count_chars(cmd_data.arglist); - cmd_data.tmp_dirs = (count_chars*)malloc(sizeof(count_chars)); - init_count_chars(cmd_data.tmp_dirs); - cmd_data.obj_files = (count_chars*)malloc(sizeof(count_chars)); - init_count_chars(cmd_data.obj_files); - cmd_data.dep_rpaths = (count_chars*)malloc(sizeof(count_chars)); - init_count_chars(cmd_data.dep_rpaths); - cmd_data.rpaths = (count_chars*)malloc(sizeof(count_chars)); - init_count_chars(cmd_data.rpaths); - cmd_data.static_opts.normal = (count_chars*)malloc(sizeof(count_chars)); - init_count_chars(cmd_data.static_opts.normal); - cmd_data.shared_opts.normal = (count_chars*)malloc(sizeof(count_chars)); - init_count_chars(cmd_data.shared_opts.normal); - cmd_data.shared_opts.dependencies = (count_chars*)malloc(sizeof(count_chars)); - init_count_chars(cmd_data.shared_opts.dependencies); - - cmd_data.mode = mUnknown; - cmd_data.output = otGeneral; - - parse_args(argc, argv, &cmd_data); - post_parse_fixup(&cmd_data); - - if (cmd_data.mode == mUnknown) { - exit(0); - } - - rc = run_mode(&cmd_data); - - if (!rc) { - ensure_fake_uptodate(&cmd_data); - } - - cleanup_tmp_dirs(&cmd_data); - return rc; -} From 92ed230f017a8581825821548e08e95e297d4a1a Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Mon, 5 Jul 2004 08:35:49 +0000 Subject: [PATCH 5120/7878] [Comment change only]: Allright. The warning was based on FreeBSD's man pages, meant to make users aware of subtleties in the format of IP addresses on different platforms, but Joe Orton showed in the link http://www.opengroup.org/onlinepubs/009695399/functions/inet_ntop.html that FreeBSD is not right in that respect. Remove comment again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65260 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 6ab4e0322f8..f7d0e34be80 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -767,19 +767,6 @@ static apr_status_t parse_network(apr_ipsubnet_t *ipsub, const char *network) if (shift < 0) { return APR_EBADIP; } -/*@@@ WARNING: BEWARE: -The man page for inet_pton()/inet_aton() et.al. says: - All numbers supplied as ``parts'' in a `.' notation may be decimal, - octal, or hexadecimal, as specified in the C language (i.e., a leading 0x - or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- - wise, the number is interpreted as decimal). -OTOH, "man atoi" says: - The atoi() function [...] is equivalent to: - (int)strtol(nptr, (char **)NULL, 10); -which forces interpretation as _decimal_. As a result, this routine will -interpret a string 0177.0000.0000.0001 as 177.0.0.1, while inet_pton() -will interpret it as 127.0.0.1! -@@@*/ octet = atoi(s); if (octet < 0 || octet > 255) { return APR_EBADIP; From ae1f07171d85aab3d3004947c052914c6fe22ab8 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 6 Jul 2004 03:38:06 +0000 Subject: [PATCH 5121/7878] Add support for KQueue and sys_epoll to apr_pollset. (Justin tweaked the cleanup code from Paul's last posted patch.) Submitted by: Paul Querna Reviewed by: Justin Erenkrantz, Joe Orton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65261 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + configure.in | 19 +++ poll/unix/poll.c | 367 +++++++++++++++++++++++++++++++++++++++++++++-- test/testpoll.c | 12 +- 4 files changed, 384 insertions(+), 16 deletions(-) diff --git a/CHANGES b/CHANGES index 0942e902a9e..6b57fbb2763 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,8 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Add support for KQueue and sys_epoll to apr_pollset. [Paul Querna] + *) Support threading on FreeBSD 5.x where kern.osreldate >= 502102. [Craig Rodrigues ] diff --git a/configure.in b/configure.in index 3d2f311cfdb..0e38b1911c1 100644 --- a/configure.in +++ b/configure.in @@ -638,6 +638,25 @@ AC_SUBST(have_sigwait) AC_CHECK_FUNCS(poll) +# Checks for the FreeBSD KQueue and Linux epoll interfaces: +AC_CHECK_FUNC(kevent, + [AC_DEFINE([HAVE_KQUEUE], 1, [Define if the KQueue interface is supported])]) + +# epoll* may be available in libc but return ENOSYS on a pre-2.6 kernel. +AC_CACHE_CHECK([for epoll support], [apr_cv_epoll], +[AC_TRY_RUN([ +#include +#include + +int main() +{ + return epoll_create(5) == -1; +}], [apr_cv_epoll=yes], [apr_cv_epoll=no], [apr_cv_epoll=no])]) + +if test "$apr_cv_epoll" = "yes"; then + AC_DEFINE([HAVE_EPOLL], 1, [Define if the epoll interface is supported]) +fi + dnl ----------------------------- Checking for missing POSIX thread functions AC_CHECK_FUNCS([getpwnam_r getpwuid_r getgrnam_r getgrgid_r]) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index c792d0a6546..4e36c322507 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -26,12 +26,77 @@ #include #endif +#ifdef HAVE_KQUEUE +#include +#include +#include +#endif + +#ifdef HAVE_EPOLL +#include +#endif #ifdef NETWARE #define HAS_SOCKETS(dt) (dt == APR_POLL_SOCKET) ? 1 : 0 #define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0 #endif +#ifdef HAVE_KQUEUE +static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags) +{ + apr_int16_t rv = 0; + + if (event & EVFILT_READ) + rv |= APR_POLLIN; + if (event & EVFILT_WRITE) + rv |= APR_POLLOUT; + if (flags & EV_ERROR || flags & EV_EOF) + rv |= APR_POLLERR; + + return rv; +} + +#endif + +#ifdef HAVE_EPOLL +static apr_int16_t get_epoll_event(apr_int16_t event) +{ + apr_int16_t rv = 0; + + if (event & APR_POLLIN) + rv |= EPOLLIN; + if (event & APR_POLLPRI) + rv |= EPOLLPRI; + if (event & APR_POLLOUT) + rv |= EPOLLOUT; + if (event & APR_POLLERR) + rv |= EPOLLERR; + if (event & APR_POLLHUP) + rv |= EPOLLHUP; + /* APR_POLLNVAL is not handled by epoll. */ + + return rv; +} + +static apr_int16_t get_epoll_revent(apr_int16_t event) +{ + apr_int16_t rv = 0; + + if (event & EPOLLIN) + rv |= APR_POLLIN; + if (event & EPOLLPRI) + rv |= APR_POLLPRI; + if (event & EPOLLOUT) + rv |= APR_POLLOUT; + if (event & EPOLLERR) + rv |= APR_POLLERR; + if (event & EPOLLHUP) + rv |= APR_POLLHUP; + /* APR_POLLNVAL is not handled by epoll. */ + + return rv; +} +#endif #ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ @@ -284,9 +349,18 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *n #endif struct apr_pollset_t { + apr_pool_t *pool; + apr_uint32_t nelts; apr_uint32_t nalloc; -#ifdef HAVE_POLL +#ifdef HAVE_KQUEUE + int kqueue_fd; + struct kevent kevent; + struct kevent *ke_set; +#elif defined(HAVE_EPOLL) + int epoll_fd; + struct epoll_event *pollset; +#elif defined(HAVE_POLL) struct pollfd *pollset; #else fd_set readset, writeset, exceptset; @@ -300,12 +374,23 @@ struct apr_pollset_t { #endif }; +static apr_status_t backend_cleanup(void *p_) +{ + apr_pollset_t *pollset = (apr_pollset_t *)p_; +#ifdef HAVE_KQUEUE + close(pollset->kqueue_fd); +#elif defined(HAVE_EPOLL) + close(pollset->epoll_fd); +#endif + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags) { -#if !defined(HAVE_POLL) && defined(FD_SETSIZE) +#if !defined(HAVE_KQUEUE) && !defined(HAVE_EPOLL) && !defined(HAVE_POLL) && defined(FD_SETSIZE) if (size > FD_SETSIZE) { *pollset = NULL; return APR_EINVAL; @@ -314,7 +399,22 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, *pollset = apr_palloc(p, sizeof(**pollset)); (*pollset)->nelts = 0; (*pollset)->nalloc = size; -#ifdef HAVE_POLL + (*pollset)->pool = p; +#ifdef HAVE_KQUEUE + (*pollset)->ke_set = (struct kevent*)apr_palloc(p, size * sizeof(struct kevent)); + memset((*pollset)->ke_set, 0, size * sizeof(struct kevent)); + (*pollset)->kqueue_fd = kqueue(); + if ((*pollset)->kqueue_fd == -1) { + return APR_ENOMEM; + } + apr_pool_cleanup_register(p, (void*)(*pollset), backend_cleanup, + apr_pool_cleanup_null); +#elif defined(HAVE_EPOLL) + (*pollset)->epoll_fd = epoll_create(size); + (*pollset)->pollset = apr_palloc(p, size * sizeof(struct epoll_event)); + apr_pool_cleanup_register(p, (void*)(*pollset), backend_cleanup, + apr_pool_cleanup_null); +#elif defined(HAVE_POLL) (*pollset)->pollset = apr_palloc(p, size * sizeof(struct pollfd)); #else FD_ZERO(&((*pollset)->readset)); @@ -333,17 +433,21 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) { - /* A no-op function for now. If we later implement /dev/poll - * support, we'll need to close the /dev/poll fd here - */ - return APR_SUCCESS; + return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup); } APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { -#ifndef HAVE_POLL +#ifdef HAVE_KQUEUE + apr_os_sock_t fd; +#elif defined(HAVE_EPOLL) + struct epoll_event ev; + int ret = -1; +#else +#if !defined(HAVE_POLL) apr_os_sock_t fd; +#endif #endif if (pollset->nelts == pollset->nalloc) { @@ -351,7 +455,49 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, } pollset->query_set[pollset->nelts] = *descriptor; -#ifdef HAVE_POLL + +#ifdef HAVE_KQUEUE + if (descriptor->desc_type == APR_POLL_SOCKET) { + fd = descriptor->desc.s->socketdes; + } + else { + fd = descriptor->desc.f->filedes; + } + + if (descriptor->reqevents & APR_POLLIN) { + EV_SET(&pollset->kevent, fd, EVFILT_READ, EV_ADD, 0, 0, NULL); + + if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0, + NULL) == -1) { + return APR_ENOMEM; + } + } + + if (descriptor->reqevents & APR_POLLOUT) { + EV_SET(&pollset->kevent, fd, EVFILT_WRITE, EV_ADD, 0, 0, NULL); + + if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0, + NULL) == -1) { + return APR_ENOMEM; + } + } + +#elif defined(HAVE_EPOLL) + ev.events = get_epoll_event(descriptor->reqevents); + if (descriptor->desc_type == APR_POLL_SOCKET) { + ev.data.fd = descriptor->desc.s->socketdes; + ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_ADD, + descriptor->desc.s->socketdes, &ev); + } + else { + ev.data.fd = descriptor->desc.f->filedes; + ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_ADD, + descriptor->desc.f->filedes, &ev); + } + if (0 != ret) { + return APR_EBADF; + } +#elif defined(HAVE_POLL) if (descriptor->desc_type == APR_POLL_SOCKET) { pollset->pollset[pollset->nelts].fd = descriptor->desc.s->socketdes; @@ -420,11 +566,97 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { apr_uint32_t i; -#ifndef HAVE_POLL +#ifdef HAVE_KQUEUE + apr_os_sock_t fd; +#elif defined(HAVE_EPOLL) + struct epoll_event ev; + int ret = -1; +#elif defined(HAVE_POLL) apr_os_sock_t fd; #endif -#ifdef HAVE_POLL +#ifdef HAVE_KQUEUE + for (i = 0; i < pollset->nelts; i++) { + if (descriptor->desc.s == pollset->query_set[i].desc.s) { + /* Found an instance of the fd: remove this and any other copies */ + apr_uint32_t dst = i; + apr_uint32_t old_nelts = pollset->nelts; + pollset->nelts--; + for (i++; i < old_nelts; i++) { + if (descriptor->desc.s == pollset->query_set[i].desc.s) { + pollset->nelts--; + } + else { + pollset->query_set[dst] = pollset->query_set[i]; + dst++; + } + } + + if (descriptor->desc_type == APR_POLL_SOCKET) { + fd = descriptor->desc.s->socketdes; + } + else { + fd = descriptor->desc.f->filedes; + } + + if (descriptor->reqevents & APR_POLLIN) { + EV_SET(&pollset->kevent, fd, + EVFILT_READ, EV_DELETE, 0, 0, NULL); + + if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0, + NULL) == -1) { + return APR_EBADF; + } + } + + if (descriptor->reqevents & APR_POLLOUT) { + EV_SET(&pollset->kevent, fd, + EVFILT_WRITE, EV_DELETE, 0, 0, NULL); + + if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0, + NULL) == -1) { + return APR_EBADF; + } + } + + return APR_SUCCESS; + } + } +#elif defined(HAVE_EPOLL) + for (i = 0; i < pollset->nelts; i++) { + if (descriptor->desc.s == pollset->query_set[i].desc.s) { + /* Found an instance of the fd: remove this and any other copies */ + apr_uint32_t dst = i; + apr_uint32_t old_nelts = pollset->nelts; + pollset->nelts--; + for (i++; i < old_nelts; i++) { + if (descriptor->desc.s == pollset->query_set[i].desc.s) { + pollset->nelts--; + } + else { + pollset->query_set[dst] = pollset->query_set[i]; + dst++; + } + } + ev.events = get_epoll_event(descriptor->reqevents); + if (descriptor->desc_type == APR_POLL_SOCKET) { + ev.data.fd = descriptor->desc.s->socketdes; + ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_DEL, + descriptor->desc.s->socketdes, &ev); + } + else { + ev.data.fd = descriptor->desc.f->filedes; + ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_DEL, + descriptor->desc.f->filedes, &ev); + } + if (ret < 0) { + return APR_EBADF; + } + + return APR_SUCCESS; + } + } +#elif defined(HAVE_POLL) for (i = 0; i < pollset->nelts; i++) { if (descriptor->desc.s == pollset->query_set[i].desc.s) { /* Found an instance of the fd: remove this and any other copies */ @@ -485,8 +717,119 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, return APR_NOTFOUND; } +#ifdef HAVE_KQUEUE +APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, + apr_interval_time_t timeout, + apr_int32_t *num, + const apr_pollfd_t **descriptors) +{ + int rv; + apr_uint32_t i, j, r = 0; + struct timespec tv, *tvptr; + + if (timeout < 0) { + tvptr = NULL; + } + else { + tv.tv_sec = (long)apr_time_sec(timeout); + tv.tv_nsec = (long)apr_time_msec(timeout); + tvptr = &tv; + } + + rv = kevent(pollset->kqueue_fd, NULL, 0, pollset->ke_set, pollset->nelts, + tvptr); + (*num) = rv; + if (rv < 0) { + return apr_get_netos_error(); + } + if (rv == 0) { + return APR_TIMEUP; + } + + /* TODO: Is there a better way to re-associate our data? */ + for (i = 0; i < pollset->nelts; i++) { + apr_os_sock_t fd; + if (pollset->query_set[i].desc_type == APR_POLL_SOCKET) { + fd = pollset->query_set[i].desc.s->socketdes; + } + else { + fd = pollset->query_set[i].desc.f->filedes; + } + for (j = 0; j < rv; j++) { + if (pollset->ke_set[j].ident == fd ) { + pollset->result_set[r] = pollset->query_set[i]; + pollset->result_set[r].rtnevents = + get_kqueue_revent(pollset->ke_set[j].filter, + pollset->ke_set[j].flags); + r++; + } + } + } + + (*num) = r; + + if (descriptors) { + *descriptors = pollset->result_set; + } + + return APR_SUCCESS; +} + +#elif defined(HAVE_EPOLL) + +APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, + apr_interval_time_t timeout, + apr_int32_t *num, + const apr_pollfd_t **descriptors) +{ + int rv; + apr_uint32_t i, j, k; + + if (timeout > 0) { + timeout /= 1000; + } -#ifdef HAVE_POLL + rv = epoll_wait(pollset->epoll_fd, pollset->pollset, pollset->nelts, + timeout); + (*num) = rv; + if (rv < 0) { + return apr_get_netos_error(); + } + if (rv == 0) { + return APR_TIMEUP; + } + j = 0; + for (i = 0; i < pollset->nelts; i++) { + if (pollset->pollset[i].events != 0) { + /* TODO: Is there a better way to re-associate our data? */ + for (k = 0; k < pollset->nelts; k++) { + if (pollset->query_set[k].desc_type == APR_POLL_SOCKET && + pollset->query_set[k].desc.s->socketdes == + pollset->pollset[i].data.fd) { + pollset->result_set[j] = pollset->query_set[k]; + pollset->result_set[j].rtnevents = + get_epoll_revent(pollset->pollset[i].events); + j++; + break; + } + else if (pollset->query_set[k].desc_type == APR_POLL_FILE + && pollset->query_set[k].desc.f->filedes == + pollset->pollset[i].data.fd) { + pollset->result_set[j] = pollset->query_set[k]; + pollset->result_set[j].rtnevents = + get_epoll_revent(pollset->pollset[i].events); + j++; + break; + } + } + } + } + if (descriptors) { + *descriptors = pollset->result_set; + } + return APR_SUCCESS; +} +#elif defined(HAVE_POLL) APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_interval_time_t timeout, apr_int32_t *num, diff --git a/test/testpoll.c b/test/testpoll.c index 23a824dbd8a..690884a9153 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -489,10 +489,14 @@ static void pollset_remove(abts_case *tc, void *data) rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 2, num); - ABTS_PTR_EQUAL(tc, (void *)1, hot_files[0].client_data); - ABTS_PTR_EQUAL(tc, s[0], hot_files[0].desc.s); - ABTS_PTR_EQUAL(tc, (void *)4, hot_files[1].client_data); - ABTS_PTR_EQUAL(tc, s[3], hot_files[1].desc.s); + ABTS_ASSERT(tc, "Incorrect socket in result set", + ((hot_files[0].desc.s == s[0]) && (hot_files[1].desc.s == s[3])) || + ((hot_files[0].desc.s == s[3]) && (hot_files[1].desc.s == s[0]))); + ABTS_ASSERT(tc, "Incorrect client data in result set", + ((hot_files[0].client_data == (void *)1) && + (hot_files[1].client_data == (void *)4)) || + ((hot_files[0].client_data == (void *)4) && + (hot_files[1].client_data == (void *)1))); } abts_suite *testpoll(abts_suite *suite) From db91e6140f97612d4c3c496b6afa0e93d8c4f98d Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 6 Jul 2004 22:40:49 +0000 Subject: [PATCH 5122/7878] Make sure that Winsock is started up properly for all NLMs that link to aprlib.nlm git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65262 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_private.h | 7 ++ misc/netware/libprews.c | 1 + misc/netware/start.c | 113 +++++++++++++++++++++++++---- 3 files changed, 106 insertions(+), 15 deletions(-) diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index f41427de019..5251cb0e286 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -35,6 +35,7 @@ #include #include #include +#include /* Use this section to define all of the HAVE_FOO_H * that are required to build properly. @@ -146,6 +147,12 @@ typedef struct app_data { void* gs_aHooksToSort; void* gs_phOptionalHooks; void* gs_phOptionalFunctions; + void* gs_nlmhandle; + rtag_t gs_startup_rtag; + rtag_t gs_socket_rtag; + rtag_t gs_lookup_rtag; + rtag_t gs_event_rtag; + rtag_t gs_pcp_rtag; } APP_DATA; int setGlobalPool(void *data); diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index 6246e1e4a25..01467aab069 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -112,6 +112,7 @@ int register_NLM(void *NLMHandle) if (app_data) { memset (app_data, 0, sizeof(APP_DATA)); set_app_data(gLibId, app_data); + app_data->gs_nlmhandle = NLMHandle; } } diff --git a/misc/netware/start.c b/misc/netware/start.c index ab011734829..5e36684b0e6 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -22,6 +22,90 @@ #include "apr_arch_proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ #include "apr_arch_internal_time.h" +/* +** Resource tag signatures for using NetWare WinSock 2. These will no longer +** be needed by anyone once the new WSAStartupWithNlmHandle() is available +** since WinSock will make the calls to AllocateResourceTag(). +*/ +#define WS_LOAD_ENTRY_SIGNATURE (*(unsigned long *) "WLDE") +#define WS_SKT_SIGNATURE (*(unsigned long *) "WSKT") +#define WS_LOOKUP_SERVICE_SIGNATURE (*(unsigned long *) "WLUP") +#define WS_WSAEVENT_SIGNATURE (*(unsigned long *) "WEVT") +#define WS_CPORT_SIGNATURE (*(unsigned long *) "WCPT") + + +int (*WSAStartupWithNLMHandle)( WORD version, LPWSADATA data, void *handle ) = NULL; +int (*WSACleanupWithNLMHandle)( void *handle ) = NULL; + +static int wsa_startup_with_handle (WORD wVersionRequested, LPWSADATA data, void *handle) +{ + APP_DATA *app_data; + + if (!(app_data = (APP_DATA*) get_app_data(gLibId))) + return APR_EGENERAL; + + app_data->gs_startup_rtag = AllocateResourceTag(handle, "WinSock Start-up", WS_LOAD_ENTRY_SIGNATURE); + app_data->gs_socket_rtag = AllocateResourceTag(handle, "WinSock socket()", WS_SKT_SIGNATURE); + app_data->gs_lookup_rtag = AllocateResourceTag(handle, "WinSock Look-up", WS_LOOKUP_SERVICE_SIGNATURE); + app_data->gs_event_rtag = AllocateResourceTag(handle, "WinSock Event", WS_WSAEVENT_SIGNATURE); + app_data->gs_pcp_rtag = AllocateResourceTag(handle, "WinSock C-Port", WS_CPORT_SIGNATURE); + + return WSAStartupRTags(wVersionRequested, data, + app_data->gs_startup_rtag, + app_data->gs_socket_rtag, + app_data->gs_lookup_rtag, + app_data->gs_event_rtag, + app_data->gs_pcp_rtag); +} + +static int wsa_cleanup_with_handle (void *handle) +{ + APP_DATA *app_data; + + if (!(app_data = (APP_DATA*) get_app_data(gLibId))) + return APR_EGENERAL; + + return WSACleanupRTag(app_data->gs_startup_rtag); +} + +static int UnregisterAppWithWinSock (void *nlm_handle) +{ + if (!WSACleanupWithNLMHandle) + { + if (!(WSACleanupWithNLMHandle = ImportPublicObject(gLibHandle, "WSACleanupWithNLMHandle"))) + WSACleanupWithNLMHandle = wsa_cleanup_with_handle; + } + + // don't know where that 'data' thing comes from... + return (*WSACleanupWithNLMHandle)(nlm_handle); +} + +static int RegisterAppWithWinSock (void *nlm_handle) +{ + int err; + WSADATA wsaData; + WORD wVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); + + if (!WSAStartupWithNLMHandle) + { + if (!(WSAStartupWithNLMHandle = ImportPublicObject(gLibHandle, "WSAStartupWithNLMHandle"))) + WSAStartupWithNLMHandle = wsa_startup_with_handle; + } + + // don't know where that 'data' thing comes from... + err = (*WSAStartupWithNLMHandle)(wVersionRequested, &wsaData, nlm_handle); + + if (LOBYTE(wsaData.wVersion) != WSAHighByte || + HIBYTE(wsaData.wVersion) != WSALowByte) { + + UnregisterAppWithWinSock (nlm_handle); + return APR_EEXIST; + } + + return err; +} + + APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, const char * const * *argv, @@ -38,14 +122,12 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, APR_DECLARE(apr_status_t) apr_initialize(void) { apr_pool_t *pool; - apr_status_t status; - int iVersionRequested; - WSADATA wsaData; int err; + void *nlmhandle = getnlmhandle(); /* Register the NLM as using APR. If it is already registered then just return. */ - if (register_NLM(getnlmhandle()) != 0) { + if (register_NLM(nlmhandle) != 0) { return APR_SUCCESS; } @@ -59,28 +141,28 @@ APR_DECLARE(apr_status_t) apr_initialize(void) apr_pool_tag(pool, "apr_initilialize"); - iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); - err = WSAStartup((WORD) iVersionRequested, &wsaData); + err = RegisterAppWithWinSock (nlmhandle); + if (err) { return err; } - if (LOBYTE(wsaData.wVersion) != WSAHighByte || - HIBYTE(wsaData.wVersion) != WSALowByte) { - WSACleanup(); - return APR_EEXIST; - } - + apr_signal_init(pool); -// setGlobalPool((void*)pool); return APR_SUCCESS; } APR_DECLARE_NONSTD(void) apr_terminate(void) { + APP_DATA *app_data; + + /* Get our instance data for shutting down. */ + if (!(app_data = (APP_DATA*) get_app_data(gLibId))) + return; + /* Unregister the NLM. If it is not registered then just return. */ - if (unregister_NLM(getnlmhandle()) != 0) { + if (unregister_NLM(app_data->gs_nlmhandle) != 0) { return; } @@ -91,7 +173,8 @@ APR_DECLARE_NONSTD(void) apr_terminate(void) /* Just clean up the memory for the app that is going away. */ netware_pool_proc_cleanup (); - WSACleanup(); + + UnregisterAppWithWinSock (app_data->gs_nlmhandle); } APR_DECLARE(void) apr_terminate2(void) From 02f8c9959ea0a90c0fd177bd30a74d1ec76b7a21 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 6 Jul 2004 22:54:30 +0000 Subject: [PATCH 5123/7878] Make sure that Winsock is started up properly for all NLMs that link to aprlib.nlm git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65263 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index 658accdc7d2..901df374f6c 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -222,6 +222,8 @@ FILES_nlm_Ximports = \ @libc.imp \ @ws2nlm.imp \ @netware.imp \ + WSAStartupRTags \ + WSACleanupRTag \ $(EOLIST) # From 1782cdf34244a37b7624017e6140a9a7117351e6 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 7 Jul 2004 07:40:12 +0000 Subject: [PATCH 5124/7878] * poll/unix/poll.c (backend_cleanup): Only define if using epoll/kqueue. (apr_pollset_destroy): Only run cleanup if using epoll/kqueue. (apr_pollset_add): Fix warning for ye olde platforms still using poll(). * configure.in: Just check for kqueue() in an AC_CHECK_FUNCS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65265 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 +++------ poll/unix/poll.c | 8 +++++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 0e38b1911c1..f9e0ea39608 100644 --- a/configure.in +++ b/configure.in @@ -636,13 +636,10 @@ AC_SUBST(threads) AC_SUBST(have_sigsuspend) AC_SUBST(have_sigwait) -AC_CHECK_FUNCS(poll) +AC_CHECK_FUNCS(poll kqueue) -# Checks for the FreeBSD KQueue and Linux epoll interfaces: -AC_CHECK_FUNC(kevent, - [AC_DEFINE([HAVE_KQUEUE], 1, [Define if the KQueue interface is supported])]) - -# epoll* may be available in libc but return ENOSYS on a pre-2.6 kernel. +# Check for the Linux epoll interface; epoll* may be available in libc +# but return ENOSYS on a pre-2.6 kernel, so do a run-time check. AC_CACHE_CHECK([for epoll support], [apr_cv_epoll], [AC_TRY_RUN([ #include diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 4e36c322507..a04866fcdfb 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -374,6 +374,7 @@ struct apr_pollset_t { #endif }; +#if defined(HAVE_KQUEUE) || defined(HAVE_EPOLL) static apr_status_t backend_cleanup(void *p_) { apr_pollset_t *pollset = (apr_pollset_t *)p_; @@ -384,6 +385,7 @@ static apr_status_t backend_cleanup(void *p_) #endif return APR_SUCCESS; } +#endif /* HAVE_KQUEUE || HAVE_EPOLL */ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, @@ -433,7 +435,11 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) { +#if defined(HAVE_KQUEUE) || defined(HAVE_EPOLL) return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup); +#else + return APR_SUCCESS; +#endif } APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, @@ -571,7 +577,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, #elif defined(HAVE_EPOLL) struct epoll_event ev; int ret = -1; -#elif defined(HAVE_POLL) +#elif !defined(HAVE_POLL) apr_os_sock_t fd; #endif From 049bd54e995c1198217f5f3ae13e1c45e5dd75d9 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 7 Jul 2004 15:47:09 +0000 Subject: [PATCH 5125/7878] Clean up leftover comments git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65266 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/start.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/misc/netware/start.c b/misc/netware/start.c index 5e36684b0e6..e7ca10312f9 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -76,7 +76,6 @@ static int UnregisterAppWithWinSock (void *nlm_handle) WSACleanupWithNLMHandle = wsa_cleanup_with_handle; } - // don't know where that 'data' thing comes from... return (*WSACleanupWithNLMHandle)(nlm_handle); } @@ -92,7 +91,6 @@ static int RegisterAppWithWinSock (void *nlm_handle) WSAStartupWithNLMHandle = wsa_startup_with_handle; } - // don't know where that 'data' thing comes from... err = (*WSAStartupWithNLMHandle)(wVersionRequested, &wsaData, nlm_handle); if (LOBYTE(wsaData.wVersion) != WSAHighByte || From 932942af4b2e29523a5b067e82e929819c7e476e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 7 Jul 2004 19:16:35 +0000 Subject: [PATCH 5126/7878] * build/apr_hints.m4 (APR_PRELOAD): Prevent use of kqueue before FreeBSD 4.8 (thanks to Craig Rodrigues). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65269 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 4ba64a8cff9..eb80c8f5a1b 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -138,7 +138,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-freebsd*) APR_SETIFNULL(apr_lock_method, [USE_FLOCK_SERIALIZE]) os_version=`sysctl -n kern.osreldate` - dnl 502102 is when libc_r switched to libpthread (aka libkse). + # 502102 is when libc_r switched to libpthread (aka libkse). if test $os_version -ge "502102"; then apr_cv_pthreads_cflags="none" apr_cv_pthreads_lib="-lpthread" @@ -146,6 +146,10 @@ dnl # Not a problem in 10.20. Otherwise, who knows? apr_cv_pthreads_cflags="-D_THREAD_SAFE -D_REENTRANT" APR_SETIFNULL(enable_threads, [no]) fi + # prevent use of KQueue before FreeBSD 4.8 + if test $os_version -lt "480000"; then + APR_SETIFNULL(ac_cv_func_kqueue, no) + fi ;; *-next-nextstep*) APR_SETIFNULL(CFLAGS, [-O]) From 67595afad9af59f4ec755496c29d4a9be1178ed5 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 8 Jul 2004 10:38:47 +0000 Subject: [PATCH 5127/7878] * build/apr_hints.m4 (APR_PRELOAD): Use full path to sysctl in case $PATH does not contain /sbin, or fail gracefully if /sbin/sysctl is missing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65270 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index eb80c8f5a1b..928474a692c 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -137,7 +137,11 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-freebsd*) APR_SETIFNULL(apr_lock_method, [USE_FLOCK_SERIALIZE]) - os_version=`sysctl -n kern.osreldate` + if test -x /sbin/sysctl; then + os_version=`sysctl -n kern.osreldate` + else + os_version=000000 + fi # 502102 is when libc_r switched to libpthread (aka libkse). if test $os_version -ge "502102"; then apr_cv_pthreads_cflags="none" From 5cdff627e3b78780ce312b6531988b8c7c0b6de6 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 8 Jul 2004 10:46:02 +0000 Subject: [PATCH 5128/7878] * build/apr_hints.m4 (APR_PRELOAD): Really, do, use a full path to sysctl. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65271 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 928474a692c..75a65ed24c9 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -138,7 +138,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-freebsd*) APR_SETIFNULL(apr_lock_method, [USE_FLOCK_SERIALIZE]) if test -x /sbin/sysctl; then - os_version=`sysctl -n kern.osreldate` + os_version=`/sbin/sysctl -n kern.osreldate` else os_version=000000 fi From 17f5d578b02f416a79df502aefad0890cea5810b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 8 Jul 2004 10:53:44 +0000 Subject: [PATCH 5129/7878] * test/abts.c (abts_run_test): Avoid the malloc/free. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65272 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/abts.c b/test/abts.c index 290435d6784..2905a2592df 100644 --- a/test/abts.c +++ b/test/abts.c @@ -153,7 +153,7 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name_full) void abts_run_test(abts_suite *ts, test_func f, void *value) { - abts_case *tc; + abts_case tc; sub_suite *ss; if (!should_test_run(ts->tail->name)) { @@ -161,19 +161,17 @@ void abts_run_test(abts_suite *ts, test_func f, void *value) } ss = ts->tail; - tc = malloc(sizeof(tc)); - tc->failed = 0; - tc->suite = ss; + tc.failed = 0; + tc.suite = ss; ss->num_test++; update_status(); - f(tc, value); + f(&tc, value); - if (tc->failed) { + if (tc.failed) { ss->failed++; } - free(tc); } static int report(abts_suite *suite) From 648f7dbd802fe25e1fb1f6f23dd50c7db231f780 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 8 Jul 2004 23:18:52 +0000 Subject: [PATCH 5130/7878] Re-instate jlibtool from deleted revision 1.5. Paperwork filed. All is well. * configure.in: We now include jlibtool in our base distribution. * build/jlibtool.c: Restore deleted revision 1.5. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65273 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + build/jlibtool.c | 1496 ++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 5 +- 3 files changed, 1500 insertions(+), 4 deletions(-) create mode 100644 build/jlibtool.c diff --git a/CHANGES b/CHANGES index 6b57fbb2763..3b06601c176 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Add jlibtool - enabled with '--enable-experimental-libtool' option. + [Justin Erenkrantz] + *) Add support for KQueue and sys_epoll to apr_pollset. [Paul Querna] *) Support threading on FreeBSD 5.x where kern.osreldate >= 502102. diff --git a/build/jlibtool.c b/build/jlibtool.c new file mode 100644 index 00000000000..6b1c35d692a --- /dev/null +++ b/build/jlibtool.c @@ -0,0 +1,1496 @@ +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __EMX__ +# define SHELL_CMD "sh" +# define GEN_EXPORTS "emxexp" +# define DEF2IMPLIB_CMD "emximp" +# define SHARE_SW "-Zdll -Zmtd" +# define USE_OMF 1 +# define TRUNCATE_DLL_NAME +# define DYNAMIC_LIB_EXT "dll" +# define EXE_EXT ".exe" + +# if USE_OMF + /* OMF is the native format under OS/2 */ +# define STATIC_LIB_EXT "lib" +# define OBJECT_EXT "obj" +# define LIBRARIAN "emxomfar" +# define LIBRARIAN_OPTS "cr" +# else + /* but the alternative, a.out, can fork() which is sometimes necessary */ +# define STATIC_LIB_EXT "a" +# define OBJECT_EXT "o" +# define LIBRARIAN "ar" +# define LIBRARIAN_OPTS "cr" +# endif +#endif + +#if defined(__APPLE__) +# define SHELL_CMD "/bin/sh" +# define DYNAMIC_LIB_EXT "dylib" +# define MODULE_LIB_EXT "so" +# define STATIC_LIB_EXT "a" +# define OBJECT_EXT "o" +# define LIBRARIAN "ar" +# define LIBRARIAN_OPTS "cr" +/* man libtool(1) documents ranlib option of -c. */ +# define RANLIB "ranlib" +# define PIC_FLAG "-fPIC -fno-common" +# define RPATH "-rpath" +# define SHARED_OPTS "-dynamiclib" +# define MODULE_OPTS "-bundle" +# define DYNAMIC_LINK_OPTS "-flat_namespace -undefined suppress" +# define dynamic_link_version_func darwin_dynamic_link_function +# define DYNAMIC_INSTALL_NAME "-install_name" +//-install_name /Users/jerenk/apache-2.0-cvs/lib/libapr.0.dylib -compatibility_version 1 -current_version 1.0 +#endif + +#if defined(__linux__) || defined(__FreeBSD__) +# define SHELL_CMD "/bin/sh" +# define DYNAMIC_LIB_EXT "so" +# define MODULE_LIB_EXT "so" +# define STATIC_LIB_EXT "a" +# define OBJECT_EXT "o" +# define LIBRARIAN "ar" +# define LIBRARIAN_OPTS "cr" +# define RANLIB "ranlib" +# define PIC_FLAG "-fPIC" +# define RPATH "-rpath" +# define DYNAMIC_LINK_OPTS "-shared" +# define LINKER_FLAG_PREFIX "-Wl," +#endif + +#if defined(_OSD_POSIX) +# define SHELL_CMD "/usr/bin/sh" +# define DYNAMIC_LIB_EXT "so" +# define MODULE_LIB_EXT "so" +# define STATIC_LIB_EXT "a" +# define OBJECT_EXT "o" +# define LIBRARIAN "ar" +# define LIBRARIAN_OPTS "cr" +# define DYNAMIC_LINK_OPTS "-G" +# define LINKER_FLAG_PREFIX "-Wl," +# define NEED_SNPRINTF +#endif + +#ifndef SHELL_CMD +#error Unsupported platform: Please add defines for SHELL_CMD etc. for your platform. +#endif + +#ifdef NEED_SNPRINTF +#include +#endif + +#ifdef __EMX__ +#include +#endif + +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif + + +/* We want to say we are libtool 1.4 for shlibtool compatibility. */ +#define VERSION "1.4" + +enum tool_mode_t { + mUnknown, + mCompile, + mLink, + mInstall, +}; + +enum output_t { + otGeneral, + otObject, + otProgram, + otLibrary, + otStaticLibraryOnly, + otDynamicLibraryOnly, + otModule, +}; + +enum pic_mode_e { + pic_UNKNOWN, + pic_PREFER, + pic_AVOID, +}; + +typedef struct { + const char **vals; + int num; +} count_chars; + +typedef struct { + const char *normal; + const char *install; +} library_name; + +typedef struct { + count_chars *normal; + count_chars *install; + count_chars *dependencies; +} library_opts; + +typedef struct { + int silent; + int shared; + int export_all; + int dry_run; + enum pic_mode_e pic_mode; + int export_dynamic; +} options_t; + +typedef struct { + enum tool_mode_t mode; + enum output_t output; + options_t options; + + char *output_name; + char *fake_output_name; + char *basename; + + const char *install_path; + const char *compiler; + const char *program; + count_chars *program_opts; + + count_chars *arglist; + count_chars *tmp_dirs; + count_chars *obj_files; + count_chars *dep_rpaths; + count_chars *rpaths; + + library_name static_name; + library_name shared_name; + library_name module_name; + + library_opts static_opts; + library_opts shared_opts; + + const char *version_info; +} command_t; + +#if defined(NEED_SNPRINTF) +/* Write at most n characters to the buffer in str, return the + * number of chars written or -1 if the buffer would have been + * overflowed. + * + * This is portable to any POSIX-compliant system has /dev/null + */ +static FILE *f=NULL; +static int vsnprintf( char *str, size_t n, const char *fmt, va_list ap ) +{ + int res; + + if (f == NULL) + f = fopen("/dev/null","w"); + if (f == NULL) + return -1; + + setvbuf( f, str, _IOFBF, n ); + + res = vfprintf( f, fmt, ap ); + + if ( res > 0 && res < n ) { + res = vsprintf( str, fmt, ap ); + } + return res; +} +static int snprintf( char *str, size_t n, const char *fmt, ... ) +{ + va_list ap; + int res; + + va_start( ap, fmt ); + res = vsnprintf( str, n, fmt, ap ); + va_end( ap ); + return res; +} +#endif + +void init_count_chars(count_chars *cc) +{ + cc->vals = (const char**)malloc(PATH_MAX); + cc->num = 0; +} + +void clear_count_chars(count_chars *cc) +{ + int i; + for (i = 0; i < cc->num; i++) { + cc->vals[i] = 0; + } + + cc->num = 0; +} + +void push_count_chars(count_chars *cc, const char *newval) +{ + cc->vals[cc->num++] = newval; +} + +void insert_count_chars(count_chars *cc, const char *newval, int position) +{ + int i; + + for (i = cc->num; i > position; i--) { + cc->vals[i] = cc->vals[i-1]; + } + + cc->vals[position] = newval; + cc->num++; +} + +void append_count_chars(count_chars *cc, count_chars *cctoadd) +{ + int i; + for (i = 0; i < cctoadd->num; i++) { + if (cctoadd->vals[i]) { + push_count_chars(cc, cctoadd->vals[i]); + } + } +} + +const char *flatten_count_chars(count_chars *cc) +{ + int i, size; + char *newval; + + size = 0; + for (i = 0; i < cc->num; i++) { + if (cc->vals[i]) { + size += strlen(cc->vals[i]) + 1; + } + } + + newval = (char*)malloc(size + 1); + newval[size] = 0; + + for (i = 0; i < cc->num; i++) { + if (cc->vals[i]) { + strcat(newval, cc->vals[i]); + strcat(newval, " "); + } + } + + return newval; +} + +char *shell_esc(const char *str) +{ + char *cmd; + unsigned char *d; + const unsigned char *s; + + cmd = (char *)malloc(2 * strlen(str) + 1); + d = (unsigned char *)cmd; + s = (const unsigned char *)str; + + for (; *s; ++s) { + if (*s == '"' || *s == '\\') { + *d++ = '\\'; + } + *d++ = *s; + } + + *d = '\0'; + return cmd; +} + +int external_spawn(command_t *cmd, const char *file, const char **argv) +{ + if (!cmd->options.silent) { + const char **argument = argv; + printf("Executing: "); + while (*argument) { + printf("%s ", *argument); + argument++; + } + puts(""); + } + + if (cmd->options.dry_run) { + return 0; + } +#ifdef __EMX__ + return spawnvp(P_WAIT, file, argv); +#else + { + pid_t pid; + pid = fork(); + if (pid == 0) { + return execvp(argv[0], (char**)argv); + } + else { + int statuscode; + waitpid(pid, &statuscode, 0); + if (WIFEXITED(statuscode)) { + return WEXITSTATUS(statuscode); + } + return 0; + } + } +#endif +} + +int run_command(command_t *cmd_data, count_chars *cc) +{ + char *command; + const char *spawn_args[4]; + count_chars tmpcc; + + init_count_chars(&tmpcc); + + if (cmd_data->program) { + push_count_chars(&tmpcc, cmd_data->program); + } + + append_count_chars(&tmpcc, cmd_data->program_opts); + + append_count_chars(&tmpcc, cc); + + command = shell_esc(flatten_count_chars(&tmpcc)); + + spawn_args[0] = SHELL_CMD; + spawn_args[1] = "-c"; + spawn_args[2] = command; + spawn_args[3] = NULL; + return external_spawn(cmd_data, spawn_args[0], (const char**)spawn_args); +} + +int parse_long_opt(char *arg, command_t *cmd_data) +{ + char *equal_pos = strchr(arg, '='); + char var[50]; + char value[500]; + + if (equal_pos) { + strncpy(var, arg, equal_pos - arg); + var[equal_pos - arg] = 0; + strcpy(value, equal_pos + 1); + } else { + strcpy(var, arg); + } + + if (strcmp(var, "silent") == 0) { + cmd_data->options.silent = 1; + } else if (strcmp(var, "mode") == 0) { + if (strcmp(value, "compile") == 0) { + cmd_data->mode = mCompile; + cmd_data->output = otObject; + } + + if (strcmp(value, "link") == 0) { + cmd_data->mode = mLink; + cmd_data->output = otLibrary; + } + + if (strcmp(value, "install") == 0) { + cmd_data->mode = mInstall; + } + } else if (strcmp(var, "shared") == 0) { + if (cmd_data->mode == mLink) { + cmd_data->output = otDynamicLibraryOnly; + } + cmd_data->options.shared = 1; + } else if (strcmp(var, "export-all") == 0) { + cmd_data->options.export_all = 1; + } else if (strcmp(var, "dry-run") == 0) { + printf("Dry-run mode on!\n"); + cmd_data->options.dry_run = 1; + } else if (strcmp(var, "version") == 0) { + printf("Version " VERSION "\n"); + } else if (strcmp(var, "help") == 0) { + printf("Sorry. No help available.\n"); + } else { + return 0; + } + + return 1; +} + +/* Return 1 if we eat it. */ +int parse_short_opt(char *arg, command_t *cmd_data) +{ + if (strcmp(arg, "export-dynamic") == 0) { + cmd_data->options.export_dynamic = 1; + return 1; + } + + if (strcmp(arg, "module") == 0) { + cmd_data->output = otModule; + return 1; + } + + if (strcmp(arg, "Zexe") == 0) { + return 1; + } + + if (strcmp(arg, "avoid-version") == 0) { + return 1; + } + + if (strcmp(arg, "prefer-pic") == 0) { + cmd_data->options.pic_mode = pic_PREFER; + return 1; + } + + if (strcmp(arg, "prefer-non-pic") == 0) { + cmd_data->options.pic_mode = pic_AVOID; + return 1; + } + + if (strcmp(arg, "static") == 0) { + /* Don't respect it for now. */ + return 1; + } + + if (cmd_data->mode == mLink) { + if (arg[0] == 'L' || arg[0] == 'l') { + /* Hack... */ + arg--; + push_count_chars(cmd_data->shared_opts.dependencies, arg); + return 1; + } + } + return 0; +} + +char *truncate_dll_name(char *path) +{ + /* Cut DLL name down to 8 characters after removing any mod_ prefix */ + char *tmppath = strdup(path); + char *newname = strrchr(tmppath, '/') + 1; + char *ext = strrchr(tmppath, '.'); + int len; + + if (ext == NULL) + return tmppath; + + len = ext - newname; + + if (strncmp(newname, "mod_", 4) == 0) { + strcpy(newname, newname + 4); + len -= 4; + } + + if (len > 8) { + strcpy(newname + 8, strchr(newname, '.')); + } + + return tmppath; +} + +long safe_strtol(const char *nptr, const char **endptr, int base) +{ + long rv; + + errno = 0; + + rv = strtol(nptr, (char**)endptr, 10); + + if (errno == ERANGE) { + return 0; + } + + return rv; +} + +/* version_info is in the form of MAJOR:MINOR:PATCH */ +const char *darwin_dynamic_link_function(const char *version_info) +{ + char *newarg; + long major, minor, patch; + + major = 0; + minor = 0; + patch = 0; + + if (version_info) { + major = safe_strtol(version_info, &version_info, 10); + + if (version_info) { + if (version_info[0] == ':') { + version_info++; + } + + minor = safe_strtol(version_info, &version_info, 10); + + if (version_info) { + if (version_info[0] == ':') { + version_info++; + } + + patch = safe_strtol(version_info, &version_info, 10); + + } + } + } + + /* Avoid -dylib_compatibility_version must be greater than zero errors. */ + if (major == 0) { + major = 1; + } + newarg = (char*)malloc(100); + snprintf(newarg, 99, + "-compatibility_version %ld -current_version %ld.%ld", + major, major, minor); + + return newarg; +} + +/* genlib values + * 0 - static + * 1 - dynamic + * 2 - module + */ +char *gen_library_name(const char *name, int genlib) +{ + char *newarg, *newext; + + newarg = (char *)malloc(strlen(name) + 10); + strcpy(newarg, ".libs/"); + + if (genlib == 2 && strncmp(name, "lib", 3) == 0) { + name += 3; + } + + strcat(newarg, name); + + newext = strrchr(newarg, '.') + 1; + + switch (genlib) { + case 0: + strcpy(newext, STATIC_LIB_EXT); + break; + case 1: + strcpy(newext, DYNAMIC_LIB_EXT); + break; + case 2: + strcpy(newext, MODULE_LIB_EXT); + break; + } + + return newarg; +} + +/* genlib values + * 0 - static + * 1 - dynamic + * 2 - module + */ +char *gen_install_name(const char *name, int genlib) +{ + struct stat sb; + char *newname; + int rv; + + newname = gen_library_name(name, genlib); + + /* Check if it exists. If not, return NULL. */ + rv = stat(newname, &sb); + + if (rv) { + return NULL; + } + + return newname; +} + +char *check_object_exists(command_t *cmd, const char *arg, int arglen) +{ + char *newarg, *ext; + int pass, rv; + + newarg = (char *)malloc(arglen + 10); + memcpy(newarg, arg, arglen); + newarg[arglen] = 0; + ext = newarg + arglen; + + pass = 0; + + do { + struct stat sb; + + switch (pass) { + case 0: + strcpy(ext, OBJECT_EXT); + break; +/* + case 1: + strcpy(ext, NO_PIC_EXT); + break; +*/ + default: + break; + } + + if (!cmd->options.silent) { + printf("Checking: %s\n", newarg); + } + rv = stat(newarg, &sb); + } + while (rv != 0 && ++pass < 1); + + if (rv == 0) { + if (pass == 1) { + cmd->options.pic_mode = pic_AVOID; + } + return newarg; + } + + return NULL; +} + +/* libdircheck values: + * 0 - no .libs suffix + * 1 - .libs suffix + */ +char *check_library_exists(command_t *cmd, const char *arg, int pathlen, + int libdircheck) +{ + char *newarg, *ext; + int pass, rv, newpathlen; + + newarg = (char *)malloc(strlen(arg) + 10); + strcpy(newarg, arg); + newarg[pathlen] = 0; + + newpathlen = pathlen; + if (libdircheck) { + strcat(newarg, ".libs/"); + newpathlen += sizeof(".libs/") - 1; + } + + strcpy(newarg+newpathlen, arg+pathlen); + ext = strrchr(newarg, '.') + 1; + + pass = 0; + + do { + struct stat sb; + + switch (pass) { + case 0: + if (cmd->options.pic_mode != pic_AVOID || cmd->options.shared) { + strcpy(ext, DYNAMIC_LIB_EXT); + break; + } + pass = 1; + case 1: + strcpy(ext, STATIC_LIB_EXT); + break; + case 2: + strcpy(ext, MODULE_LIB_EXT); + break; + case 3: + strcpy(ext, OBJECT_EXT); + break; + default: + break; + } + + if (!cmd->options.silent) { + printf("Checking: %s\n", newarg); + } + rv = stat(newarg, &sb); + } + while (rv != 0 && ++pass < 4); + + if (rv == 0) { + return newarg; + } + + return NULL; +} + +void add_linker_flag_prefix(count_chars *cc, const char *arg) +{ +#ifndef LINKER_FLAG_PREFIX + push_count_chars(cc, arg); +#else + char *newarg; + newarg = (char*)malloc(strlen(arg) + sizeof(LINKER_FLAG_PREFIX)); + strcpy(newarg, LINKER_FLAG_PREFIX); + strcpy(newarg, arg); + push_count_chars(cc, newarg); +#endif +} + +int parse_input_file_name(char *arg, command_t *cmd_data) +{ + char *ext = strrchr(arg, '.'); + char *name = strrchr(arg, '/'); + int pathlen; + char *newarg; + + if (!ext) { + return 0; + } + + ext++; + + if (name == NULL) { + name = strrchr(arg, '\\'); + + if (name == NULL) { + name = arg; + } else { + name++; + } + } else { + name++; + } + + pathlen = name - arg; + + if (strcmp(ext, "lo") == 0) { + newarg = check_object_exists(cmd_data, arg, ext - arg); + if (!newarg) { + printf("Can not find suitable object file for %s\n", arg); + exit(1); + } + if (cmd_data->mode != mLink) { + push_count_chars(cmd_data->arglist, newarg); + } + else { + push_count_chars(cmd_data->obj_files, newarg); + } + return 1; + } + + if (strcmp(ext, "la") == 0) { + switch (cmd_data->mode) { + case mLink: + /* Try the .libs dir first! */ + newarg = check_library_exists(cmd_data, arg, pathlen, 1); + if (!newarg) { + /* Try the normal dir next. */ + newarg = check_library_exists(cmd_data, arg, pathlen, 0); + if (!newarg) { + printf("Can not find suitable library for %s\n", arg); + exit(1); + } + } + + if (cmd_data->mode != mLink) { + push_count_chars(cmd_data->arglist, newarg); + } + else { + push_count_chars(cmd_data->shared_opts.dependencies, newarg); + } + break; + case mInstall: + /* If we've already recorded a library to install, we're most + * likely getting the .la file that we want to install as. + * The problem is that we need to add it as the directory, + * not the .la file itself. Otherwise, we'll do odd things. + */ + if (cmd_data->output == otLibrary) { + arg[pathlen] = '\0'; + push_count_chars(cmd_data->arglist, arg); + } + else { + cmd_data->output = otLibrary; + cmd_data->output_name = arg; + cmd_data->static_name.install = gen_install_name(arg, 0); + cmd_data->shared_name.install = gen_install_name(arg, 1); + cmd_data->module_name.install = gen_install_name(arg, 2); + } + break; + default: + break; + } + return 1; + } + + if (strcmp(ext, "c") == 0) { + /* If we don't already have an idea what our output name will be. */ + if (cmd_data->basename == NULL) { + cmd_data->basename = (char *)malloc(strlen(arg) + 4); + strcpy(cmd_data->basename, arg); + strcpy(strrchr(cmd_data->basename, '.') + 1, "lo"); + + cmd_data->fake_output_name = strrchr(cmd_data->basename, '/'); + if (cmd_data->fake_output_name) { + cmd_data->fake_output_name++; + } + else { + cmd_data->fake_output_name = cmd_data->basename; + } + } + } + + return 0; +} + +int parse_output_file_name(char *arg, command_t *cmd_data) +{ + char *name = strrchr(arg, '/'); + char *ext = strrchr(arg, '.'); + char *newarg = NULL; + int pathlen; + + cmd_data->fake_output_name = arg; + + if (name) { + name++; + } + else { + name = strrchr(arg, '\\'); + + if (name == NULL) { + name = arg; + } + else { + name++; + } + } + + if (!ext) { + cmd_data->basename = arg; + cmd_data->output = otProgram; +#if defined(_OSD_POSIX) + cmd_data->options.pic_mode = pic_AVOID; +#endif + newarg = (char *)malloc(strlen(arg) + 5); + strcpy(newarg, arg); +#ifdef EXE_EXT + strcat(newarg, EXE_EXT); +#endif + cmd_data->output_name = newarg; + return 1; + } + + ext++; + pathlen = name - arg; + + if (strcmp(ext, "la") == 0) { + assert(cmd_data->mode == mLink); + + cmd_data->basename = arg; + cmd_data->static_name.normal = gen_library_name(arg, 0); + cmd_data->shared_name.normal = gen_library_name(arg, 1); + cmd_data->module_name.normal = gen_library_name(arg, 2); + cmd_data->static_name.install = gen_install_name(arg, 0); + cmd_data->shared_name.install = gen_install_name(arg, 1); + cmd_data->module_name.install = gen_install_name(arg, 2); + +#ifdef TRUNCATE_DLL_NAME + if (shared) { + arg = truncate_dll_name(arg); + } +#endif + + cmd_data->output_name = arg; + return 1; + } + + if (strcmp(ext, "lo") == 0) { + cmd_data->basename = arg; + cmd_data->output = otObject; + newarg = (char *)malloc(strlen(arg) + 2); + strcpy(newarg, arg); + ext = strrchr(newarg, '.') + 1; + strcpy(ext, OBJECT_EXT); + cmd_data->output_name = newarg; + return 1; + } + + return 0; +} + +/* returns just a file's name without path or extension */ +char *nameof(char *fullpath) +{ + char buffer[1024]; + char *ext; + char *name = strrchr(fullpath, '/'); + + if (name == NULL) { + name = strrchr(fullpath, '\\'); + } + + if (name == NULL) { + name = fullpath; + } else { + name++; + } + + strcpy(buffer, name); + ext = strrchr(buffer, '.'); + + if (ext) { + *ext = 0; + return strdup(buffer); + } + + return name; +} + +void parse_args(int argc, char *argv[], command_t *cmd_data) +{ + int a; + char *arg; + int argused; + + for (a=1; a < argc; a++) { + arg = argv[a]; + argused = 1; + + if (arg[0] == '-') { + if (arg[1] == '-') { + argused = parse_long_opt(arg + 2, cmd_data); + } + else { + argused = parse_short_opt(arg + 1, cmd_data); + } + + /* We haven't done anything with it yet, try some of the + * more complicated short opts... */ + if (argused == 0 && a + 1 < argc) { + if (arg[1] == 'o' && !arg[2]) { + arg = argv[++a]; + argused = parse_output_file_name(arg, cmd_data); + } else if (strcmp(arg+1, "rpath") == 0) { + /* Aha, we should try to link both! */ + cmd_data->install_path = argv[++a]; + argused = 1; + } else if (strcmp(arg+1, "version-info") == 0) { + /* Store for later deciphering */ + cmd_data->version_info = argv[++a]; + argused = 1; + } + } + } else { + argused = parse_input_file_name(arg, cmd_data); + } + + if (!argused) { + if (!cmd_data->options.silent) { + printf("Adding: %s\n", arg); + } + push_count_chars(cmd_data->arglist, arg); + } + } + +} + +int explode_static_lib(const char *lib, command_t *cmd_data) +{ + char tmpdir[1024]; + char savewd[1024]; + char cmd[1024]; + const char *name; + DIR *dir; + struct dirent *entry; + + /* Bah! */ + if (cmd_data->options.dry_run) { + return 0; + } + + strcpy(tmpdir, lib); + strcat(tmpdir, ".exploded"); + + mkdir(tmpdir, 0); + push_count_chars(cmd_data->tmp_dirs, strdup(tmpdir)); + getcwd(savewd, sizeof(savewd)); + + if (chdir(tmpdir) != 0) + return 1; + + strcpy(cmd, LIBRARIAN " x "); + name = strrchr(lib, '/'); + + if (name) { + name++; + } else { + name = lib; + } + + strcat(cmd, "../"); + strcat(cmd, name); + system(cmd); + chdir(savewd); + dir = opendir(tmpdir); + + while ((entry = readdir(dir)) != NULL) { + if (entry->d_name[0] != '.') { + strcpy(cmd, tmpdir); + strcat(cmd, "/"); + strcat(cmd, entry->d_name); + push_count_chars(cmd_data->arglist, strdup(cmd)); + } + } + + closedir(dir); + return 0; +} + +#ifdef GEN_EXPORTS +void generate_def_file(command_t *cmd_data) +{ + char def_file[1024]; + char implib_file[1024]; + char *ext; + FILE *hDef; + char *export_args[1024]; + int num_export_args = 0; + char *cmd; + int cmd_size = 0; + int a; + + if (cmd_data->output_name) { + strcpy(def_file, cmd_data->output_name); + strcat(def_file, ".def"); + hDef = fopen(def_file, "w"); + + if (hDef != NULL) { + fprintf(hDef, "LIBRARY '%s' INITINSTANCE\n", nameof(cmd_data->output_name)); + fprintf(hDef, "DATA NONSHARED\n"); + fprintf(hDef, "EXPORTS\n"); + fclose(hDef); + + for (a = 0; a < cmd_data->num_obj_files; a++) { + cmd_size += strlen(cmd_data->obj_files[a]) + 1; + } + + cmd_size += strlen(GEN_EXPORTS) + strlen(def_file) + 3; + cmd = (char *)malloc(cmd_size); + strcpy(cmd, GEN_EXPORTS); + + for (a=0; a < cmd_data->num_obj_files; a++) { + strcat(cmd, " "); + strcat(cmd, cmd_data->obj_files[a] ); + } + + strcat(cmd, ">>"); + strcat(cmd, def_file); + puts(cmd); + export_args[num_export_args++] = SHELL_CMD; + export_args[num_export_args++] = "-c"; + export_args[num_export_args++] = cmd; + export_args[num_export_args++] = NULL; + external_spawn(cmd_data, export_args[0], (const char**)export_args); + cmd_data->arglist[cmd_data->num_args++] = strdup(def_file); + + /* Now make an import library for the dll */ + num_export_args = 0; + export_args[num_export_args++] = DEF2IMPLIB_CMD; + export_args[num_export_args++] = "-o"; + + strcpy(implib_file, ".libs/"); + strcat(implib_file, cmd_data->basename); + ext = strrchr(implib_file, '.'); + + if (ext) + *ext = 0; + + strcat(implib_file, "."); + strcat(implib_file, STATIC_LIB_EXT); + + export_args[num_export_args++] = implib_file; + export_args[num_export_args++] = def_file; + export_args[num_export_args++] = NULL; + external_spawn(cmd_data, export_args[0], (const char**)export_args); + + } + } +} +#endif + +const char* expand_path(const char *relpath) +{ + char foo[PATH_MAX], *newpath; + + getcwd(foo, PATH_MAX-1); + newpath = (char*)malloc(strlen(foo)+strlen(relpath)+2); + strcat(newpath, foo); + strcat(newpath, "/"); + strcat(newpath, relpath); + return newpath; +} + +void link_fixup(command_t *c) +{ + /* If we were passed an -rpath directive, we need to build + * shared objects too. Otherwise, we should only create static + * libraries. + */ + if (!c->install_path && (c->output == otDynamicLibraryOnly || + c->output == otModule || c->output == otLibrary)) { + c->output = otStaticLibraryOnly; + } + + if (c->output == otDynamicLibraryOnly || + c->output == otModule || + c->output == otLibrary) { + + push_count_chars(c->shared_opts.normal, "-o"); + if (c->output == otModule) { + push_count_chars(c->shared_opts.normal, c->module_name.normal); + } + else { + char *tmp; + push_count_chars(c->shared_opts.normal, c->shared_name.normal); +#ifdef DYNAMIC_INSTALL_NAME + push_count_chars(c->shared_opts.normal, DYNAMIC_INSTALL_NAME); + + tmp = (char*)malloc(PATH_MAX); + strcat(tmp, c->install_path); + strcat(tmp, strrchr(c->shared_name.normal, '/')); + push_count_chars(c->shared_opts.normal, tmp); +#endif + } + + append_count_chars(c->shared_opts.normal, c->obj_files); + append_count_chars(c->shared_opts.normal, c->shared_opts.dependencies); + + if (c->options.export_all) { +#ifdef GEN_EXPORTS + generate_def_file(c); +#endif + } + } + + if (c->output == otLibrary || c->output == otStaticLibraryOnly) { + push_count_chars(c->static_opts.normal, "-o"); + push_count_chars(c->static_opts.normal, c->output_name); + } + + if (c->output == otProgram) { + if (c->output_name) { + push_count_chars(c->arglist, "-o"); + push_count_chars(c->arglist, c->output_name); + append_count_chars(c->arglist, c->obj_files); + append_count_chars(c->arglist, c->shared_opts.dependencies); +#ifdef DYNAMIC_LINK_OPTS + if (c->options.pic_mode != pic_AVOID) { + push_count_chars(c->arglist, DYNAMIC_LINK_OPTS); + } +#endif + } + } +} + +void post_parse_fixup(command_t *cmd_data) +{ + switch (cmd_data->mode) + { + case mCompile: +#ifdef PIC_FLAG + if (cmd_data->options.pic_mode != pic_AVOID) { + push_count_chars(cmd_data->arglist, PIC_FLAG); + } +#endif + if (cmd_data->output_name) { + push_count_chars(cmd_data->arglist, "-o"); + push_count_chars(cmd_data->arglist, cmd_data->output_name); + } + break; + case mLink: + link_fixup(cmd_data); + break; + case mInstall: + if (cmd_data->output == otLibrary) { + link_fixup(cmd_data); + } + default: + break; + } + +#if USE_OMF + if (cmd_data->output == otObject || + cmd_data->output == otProgram || + cmd_data->output == otLibrary || + cmd_data->output == otDynamicLibraryOnly) { + push_count_chars(cmd_data->arglist, "-Zomf"); + } +#endif + + if (cmd_data->options.shared && + (cmd_data->output == otObject || + cmd_data->output == otLibrary || + cmd_data->output == otDynamicLibraryOnly)) { +#ifdef SHARE_SW + push_count_chars(cmd_data->arglist, SHARE_SW); +#endif + } +} + +int run_mode(command_t *cmd_data) +{ + int rv; + count_chars *cctemp; + + cctemp = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cctemp); + + switch (cmd_data->mode) + { + case mCompile: + rv = run_command(cmd_data, cmd_data->arglist); + if (rv) { + return rv; + } + break; + case mInstall: + /* Well, we'll assume it's a file going to a directory... */ + /* For brain-dead install-sh based scripts, we have to repeat + * the command N-times. install-sh should die. + */ + if (!cmd_data->output_name) { + rv = run_command(cmd_data, cmd_data->arglist); + if (rv) { + return rv; + } + } + if (cmd_data->output_name) { + append_count_chars(cctemp, cmd_data->arglist); + insert_count_chars(cctemp, + cmd_data->output_name, + cctemp->num - 1); + rv = run_command(cmd_data, cctemp); + if (rv) { + return rv; + } + clear_count_chars(cctemp); + } + if (cmd_data->static_name.install) { + append_count_chars(cctemp, cmd_data->arglist); + insert_count_chars(cctemp, + cmd_data->static_name.install, + cctemp->num - 1); + rv = run_command(cmd_data, cctemp); + if (rv) { + return rv; + } + clear_count_chars(cctemp); + } + if (cmd_data->shared_name.install) { + append_count_chars(cctemp, cmd_data->arglist); + insert_count_chars(cctemp, + cmd_data->shared_name.install, + cctemp->num - 1); + rv = run_command(cmd_data, cctemp); + if (rv) { + return rv; + } + clear_count_chars(cctemp); + } + if (cmd_data->module_name.install) { + append_count_chars(cctemp, cmd_data->arglist); + insert_count_chars(cctemp, + cmd_data->module_name.install, + cctemp->num - 1); + rv = run_command(cmd_data, cctemp); + if (rv) { + return rv; + } + clear_count_chars(cctemp); + } + break; + case mLink: + if (!cmd_data->options.dry_run) { + /* Check first to see if the dir already exists! */ + mode_t old_umask; + + old_umask = umask(0); + umask(old_umask); + + mkdir(".libs", ~old_umask); + } + + if (cmd_data->output == otStaticLibraryOnly || + cmd_data->output == otLibrary) { +#ifdef RANLIB + const char *lib_args[3]; +#endif + /* Removes compiler! */ + cmd_data->program = LIBRARIAN; + push_count_chars(cmd_data->program_opts, LIBRARIAN_OPTS); + push_count_chars(cmd_data->program_opts, + cmd_data->static_name.normal); + + rv = run_command(cmd_data, cmd_data->obj_files); + if (rv) { + return rv; + } + +#ifdef RANLIB + lib_args[0] = RANLIB; + lib_args[1] = cmd_data->static_name.normal; + lib_args[2] = NULL; + external_spawn(cmd_data, RANLIB, lib_args); +#endif + if (!cmd_data->options.dry_run) { + //link( + } + } + + if (cmd_data->output == otDynamicLibraryOnly || + cmd_data->output == otModule || + cmd_data->output == otLibrary) { + cmd_data->program = NULL; + clear_count_chars(cmd_data->program_opts); + + append_count_chars(cmd_data->program_opts, cmd_data->arglist); + if (cmd_data->output != otModule) { +#ifdef SHARED_OPTS + push_count_chars(cmd_data->program_opts, SHARED_OPTS); +#endif +#ifdef dynamic_link_version_func + push_count_chars(cmd_data->program_opts, + dynamic_link_version_func(cmd_data->version_info)); +#endif + } + if (cmd_data->output == otModule) { +#ifdef MODULE_OPTS + push_count_chars(cmd_data->program_opts, MODULE_OPTS); +#endif + } +#ifdef DYNAMIC_LINK_OPTS + if (cmd_data->options.pic_mode != pic_AVOID) { + push_count_chars(cmd_data->program_opts, + DYNAMIC_LINK_OPTS); + } +#endif + rv = run_command(cmd_data, cmd_data->shared_opts.normal); + if (rv) { + return rv; + } + } + if (cmd_data->output == otProgram) { + rv = run_command(cmd_data, cmd_data->arglist); + if (rv) { + return rv; + } + } + break; + default: + break; + } + + return 0; +} + +void cleanup_tmp_dir(const char *dirname) +{ + DIR *dir; + struct dirent *entry; + char fullname[1024]; + + dir = opendir(dirname); + + if (dir == NULL) + return; + + while ((entry = readdir(dir)) != NULL) { + if (entry->d_name[0] != '.') { + strcpy(fullname, dirname); + strcat(fullname, "/"); + strcat(fullname, entry->d_name); + remove(fullname); + } + } + + rmdir(dirname); +} + +void cleanup_tmp_dirs(command_t *cmd_data) +{ + int d; + + for (d = 0; d < cmd_data->tmp_dirs->num; d++) { + cleanup_tmp_dir(cmd_data->tmp_dirs->vals[d]); + } +} + +int ensure_fake_uptodate(command_t *cmd_data) +{ + /* FIXME: could do the stat/touch here, but nah... */ + const char *touch_args[3]; + + if (cmd_data->mode == mInstall) { + return 0; + } + + touch_args[0] = "touch"; + touch_args[1] = cmd_data->fake_output_name; + touch_args[2] = NULL; + return external_spawn(cmd_data, "touch", touch_args); +} + +int main(int argc, char *argv[]) +{ + int rc; + command_t cmd_data; + + memset(&cmd_data, 0, sizeof(cmd_data)); + + cmd_data.options.pic_mode = pic_UNKNOWN; + + cmd_data.program_opts = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.program_opts); + cmd_data.arglist = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.arglist); + cmd_data.tmp_dirs = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.tmp_dirs); + cmd_data.obj_files = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.obj_files); + cmd_data.dep_rpaths = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.dep_rpaths); + cmd_data.rpaths = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.rpaths); + cmd_data.static_opts.normal = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.static_opts.normal); + cmd_data.shared_opts.normal = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.shared_opts.normal); + cmd_data.shared_opts.dependencies = (count_chars*)malloc(sizeof(count_chars)); + init_count_chars(cmd_data.shared_opts.dependencies); + + cmd_data.mode = mUnknown; + cmd_data.output = otGeneral; + + parse_args(argc, argv, &cmd_data); + post_parse_fixup(&cmd_data); + + if (cmd_data.mode == mUnknown) { + exit(0); + } + + rc = run_mode(&cmd_data); + + if (!rc) { + ensure_fake_uptodate(&cmd_data); + } + + cleanup_tmp_dirs(&cmd_data); + return rc; +} diff --git a/configure.in b/configure.in index f9e0ea39608..8f8d2236b61 100644 --- a/configure.in +++ b/configure.in @@ -135,7 +135,7 @@ dnl prep libtool dnl echo "performing libtool configuration..." -AC_ARG_ENABLE(experimental-libtool,[ --experimental-libtool Use experimental custom libtool (not included in source distribution)], +AC_ARG_ENABLE(experimental-libtool,[ --experimental-libtool Use experimental custom libtool], [experimental_libtool=$enableval],[experimental_libtool=no]) case $host in @@ -154,9 +154,6 @@ case $host in echo "using jlibtool" LIBTOOL="$apr_builddir/libtool" LIBTOOL_SRC="$apr_srcdir/build/jlibtool.c" - if test ! -f $LIBTOOL_SRC; then - AC_MSG_ERROR([Experimental libtool source not found. It is not included with APR by default.]) - fi $CC $CFLAGS $CPPFLAGS -o $LIBTOOL $LIBTOOL_SRC else dnl libtoolize requires that the following not be indented From 52cbc18aa116069a16ee98af58fcdf1f189ed737 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 9 Jul 2004 10:15:10 +0000 Subject: [PATCH 5131/7878] * build/config.guess, build/config.sub: Update from gnu.org. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65274 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 57 +++++++++++++++++++++++----------------------- build/config.sub | 45 ++++++++++++++++++++---------------- 2 files changed, 54 insertions(+), 48 deletions(-) diff --git a/build/config.guess b/build/config.guess index 00ccf89e18b..a6d8a945f68 100755 --- a/build/config.guess +++ b/build/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -timestamp='2004-02-16' +timestamp='2004-06-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -212,6 +212,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + luna88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -227,9 +230,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - pegasos:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -255,9 +255,14 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then + case $UNAME_RELEASE in + *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU @@ -295,14 +300,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac + # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha*:OpenVMS:*:*) - echo alpha-hp-vms + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? @@ -758,7 +761,7 @@ EOF echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) - echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` @@ -781,21 +784,7 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) - # Determine whether the default compiler uses glibc. - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #if __GLIBC__ >= 2 - LIBC=gnu - #else - LIBC= - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - # GNU/KFreeBSD systems have a "k" prefix to indicate we are using - # FreeBSD's kernel, but not the complete OS. - case ${LIBC} in gnu) kernel_only='k' ;; esac - echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -847,6 +836,9 @@ EOF ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -1087,7 +1079,7 @@ EOF M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; - M68*:*:R3V[567]*:*) + M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' @@ -1251,6 +1243,13 @@ EOF *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms && exit 0 ;; + I*) echo ia64-dec-vms && exit 0 ;; + V*) echo vax-dec-vms && exit 0 ;; + esac esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/build/config.sub b/build/config.sub index d2e3557ac40..ac6de9869c9 100755 --- a/build/config.sub +++ b/build/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -timestamp='2004-02-16' +timestamp='2004-06-24' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -70,7 +70,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -145,7 +145,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis) + -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; @@ -237,7 +237,7 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | m32r | m68000 | m68k | m88k | mcore \ + | m32r | m32rle | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -262,7 +262,7 @@ case $basic_machine in | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ @@ -300,7 +300,7 @@ case $basic_machine in | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | cydra-* \ + | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ @@ -308,7 +308,7 @@ case $basic_machine in | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | m32r-* \ + | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ @@ -326,8 +326,9 @@ case $basic_machine in | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ + | mmix-* \ | msp430-* \ - | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ @@ -336,7 +337,7 @@ case $basic_machine in | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ @@ -445,6 +446,10 @@ case $basic_machine in basic_machine=j90-cray os=-unicos ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; cr16c) basic_machine=cr16c-unknown os=-elf @@ -455,6 +460,10 @@ case $basic_machine in cris | cris-* | etrax*) basic_machine=cris-axis ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; da30 | da30-*) basic_machine=m68k-da30 ;; @@ -655,10 +664,6 @@ case $basic_machine in mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; monitor) basic_machine=m68k-rom68k os=-coff @@ -739,10 +744,6 @@ case $basic_machine in np1) basic_machine=np1-gould ;; - nv1) - basic_machine=nv1-cray - os=-unicosmp - ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -1055,6 +1056,9 @@ case $basic_machine in romp) basic_machine=romp-ibm ;; + mmix) + basic_machine=mmix-knuth + ;; rs6000) basic_machine=rs6000-ibm ;; @@ -1077,7 +1081,7 @@ case $basic_machine in sh64) basic_machine=sh64-unknown ;; - sparc | sparcv9 | sparcv9b) + sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) @@ -1370,6 +1374,9 @@ case $basic_machine in *-ibm) os=-aix ;; + *-knuth) + os=-mmixware + ;; *-wec) os=-proelf ;; From d64301b5d8e1bf9114125dba75cbb0aa84de7ece Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 9 Jul 2004 15:51:58 +0000 Subject: [PATCH 5132/7878] Ignore generated spec file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65275 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.cvsignore b/.cvsignore index 29ab2740fd7..f207ee24b13 100644 --- a/.cvsignore +++ b/.cvsignore @@ -39,3 +39,4 @@ build-outputs.mk *.da coverage apr*.pc +apr.spec From 77cd84ab2f5c9affd5d04192af35c8de8aba0ecc Mon Sep 17 00:00:00 2001 From: Jean-Jacques Clar Date: Fri, 9 Jul 2004 20:29:05 +0000 Subject: [PATCH 5133/7878] Added bit mask operation for detach and addrspace fields to make possible overloading on fcts parameter. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65276 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 52c1495b7f9..4959838c603 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -179,7 +179,7 @@ APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) { - attr->detached = detach; + attr->detached = (detach & 1); return APR_SUCCESS; } @@ -268,7 +268,7 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, apr_int32_t addrspace) { - attr->addrspace = addrspace; + attr->addrspace = (addrspace & 2); return APR_SUCCESS; } From ba20b5e477eab5584cb0a3d5bece3db03785a132 Mon Sep 17 00:00:00 2001 From: Jean-Jacques Clar Date: Mon, 12 Jul 2004 16:57:12 +0000 Subject: [PATCH 5134/7878] rev back to r1.29 , removing changes to addrspace and detach set functions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65277 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 4959838c603..52c1495b7f9 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -179,7 +179,7 @@ APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) { - attr->detached = (detach & 1); + attr->detached = detach; return APR_SUCCESS; } @@ -268,7 +268,7 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, apr_int32_t addrspace) { - attr->addrspace = (addrspace & 2); + attr->addrspace = addrspace; return APR_SUCCESS; } From dc4ad2cf051cc96a53b6ff309a2d875f7391ac78 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 13 Jul 2004 09:15:50 +0000 Subject: [PATCH 5135/7878] * network_io/unix/sockaddr.c (apr_getnameinfo): Fix getnameinfo on v4mapped addresses for *BSD. PR: 30066 Submitted by: Tsurutani Naoki git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65278 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index f7d0e34be80..593ab994886 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -596,6 +596,9 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, struct sockaddr_in tmpsa; tmpsa.sin_family = AF_INET; tmpsa.sin_addr.s_addr = ((apr_uint32_t *)sockaddr->ipaddr_ptr)[3]; +#ifdef SIN6_LEN + tmpsa.sin_len = sizeof(tmpsa); +#endif rc = getnameinfo((const struct sockaddr *)&tmpsa, sizeof(tmpsa), tmphostname, sizeof(tmphostname), NULL, 0, From 3b9ff07442ebcebb17de6f8539e4f8e57ad9b3e7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 15 Jul 2004 01:12:16 +0000 Subject: [PATCH 5136/7878] Update the license language to asl 2.0, and correctly grab apr[u|i] revisions from the usual version files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65281 13f79535-47bb-0310-9956-ffa450edef68 --- build/win32ver.awk | 56 +++++++++++++++++++++++++--------------------- libapr.dsp | 6 +++-- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/build/win32ver.awk b/build/win32ver.awk index e41811df01f..2cd31eba948 100644 --- a/build/win32ver.awk +++ b/build/win32ver.awk @@ -40,30 +40,28 @@ BEGIN { } while ((getline < rel_h) > 0) { - if (match ($0, /^#define AP_SERVER_BASEREVISION "[^"]+"/)) { - ver = substr($0, RSTART + 32, RLENGTH - 33); + if (match ($0, /^#define AP._MAJOR_VERSION/)) { + ver_major = $3; } - } - if (ver) { - verc = ver; - gsub(/\./, ",", verc); - if (build) { - sub(/-.*/, "", verc) - verc = verc "," build; - } else if (sub(/-dev/, ",0", verc)) { - ff = ff + 2; - } else if (!sub(/-alpha/, ",10", verc) \ - && !sub(/-beta/, ",100", verc) \ - && !sub(/-gold/, ",200", verc)) { - sub(/-.*/, "", verc); - verc = verc "," 0; + if (match ($0, /^#define AP._MINOR_VERSION/)) { + ver_minor = $3; + } + if (match ($0, /^#define AP._PATCH_VERSION/)) { + ver_patch = $3; + } + if (match ($0, /^#define AP._IS_DEV_VERSION/)) { + ver_suffix = "-dev"; + ver_build = "0"; + } + if (match ($0, /^#undef AP._IS_DEV_VERSION/)) { + ver_build = "100"; + } + if (match ($0, /^.*Copyright /)) { + copyright = substr($0, RLENGTH + 1); } - } else { -# XXX Gotta fix this for non-httpd installs :( - ver = "0.0.0.0" - verc = "0,0,0,0" - ff = ff + 2; } + ver = ver_major "." ver_minor "." ver_patch ver_suffix; + verc = ver_major "," ver_minor "," ver_patch "," ver_build; if (length(vendor)) { ff = ff + 8; @@ -89,15 +87,21 @@ BEGIN { print " BEGIN"; print " BLOCK \"040904b0\""; print " BEGIN"; - print " VALUE \"Comments\", \"All rights reserved. The "\ - "license is available at . "\ - "The APR project pages are at .\\0\""; + print " VALUE \"Comments\", "\ + "\"Licensed under the Apache License, Version 2.0 (the \"\"License\"\"); "\ + "you may not use this file except in compliance with the License. "\ + "You may obtain a copy of the License at\\r\\n\\r\\n"\ + "http://www.apache.org/licenses/LICENSE-2.0\\r\\n\\r\\n"\ + "Unless required by applicable law or agreed to in writing, "\ + "software distributed under the License is distributed on an "\ + "\"\"AS IS\"\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, "\ + "either express or implied. See the License for the specific "\ + "language governing permissions and limitations under the License.\\0\""; print " VALUE \"CompanyName\", \"Apache Software Foundation\\0\""; print " VALUE \"FileDescription\", \"" desc "\\0\""; print " VALUE \"FileVersion\", \"" ver "\\0\""; print " VALUE \"InternalName\", \"" file "\\0\""; - print " VALUE \"LegalCopyright\", \"Copyright © 2000-2003 "\ - "The Apache Software Foundation.\\0\""; + print " VALUE \"LegalCopyright\", \"Copyright " copyright "\\0\""; print " VALUE \"OriginalFilename\", \"" filename "\\0\""; if (vendor) { print " VALUE \"PrivateBuild\", \"" vendor "\\0\""; diff --git a/libapr.dsp b/libapr.dsp index 7132691a30d..35c0b8a0c12 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -644,22 +644,24 @@ SOURCE=.\build\win32ver.awk !IF "$(CFG)" == "libapr - Win32 Release" # PROP Ignore_Default_Tool 1 +USERDEP__WIN32="./include/apr_version.h" # Begin Custom Build - Creating Version Resource InputPath=.\build\win32ver.awk ".\libapr.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - awk -f ./build/win32ver.awk libapr.dll "Apache Portability Runtime Library" ../../include/ap_release.h > .\libapr.rc + awk -f ./build/win32ver.awk libapr.dll "Apache Portability Runtime Library" ./include/apr_version.h > .\libapr.rc # End Custom Build !ELSEIF "$(CFG)" == "libapr - Win32 Debug" # PROP Ignore_Default_Tool 1 +USERDEP__WIN32="./include/apr_version.h" # Begin Custom Build - Creating Version Resource InputPath=.\build\win32ver.awk ".\libapr.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - awk -f ./build/win32ver.awk libapr.dll "Apache Portability Runtime Library" ../../include/ap_release.h > .\libapr.rc + awk -f ./build/win32ver.awk libapr.dll "Apache Portability Runtime Library" ./include/apr_version.h > .\libapr.rc # End Custom Build From 0a17ce437960ef025836bbf3eb5b8b21a4180110 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 19 Jul 2004 15:39:54 +0000 Subject: [PATCH 5137/7878] Win32: Fix bug in tracking the file pointer in files opened for overlapped/xthread io git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65283 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/win32/seek.c | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 3b06601c176..eb0f0a7679d 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] and upgrading it to do SHA-256. Not yet ready for prime time. [Ben Laurie] + *) Win32: Fix bug tracking the file pointer on a file opened for + overlapped/APR_XTHREAD io. [Bill Stoddard] + Changes with APR 1.0 *) Add jlibtool - enabled with '--enable-experimental-libtool' option. diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 61fe6264c9e..b8f2bcfd432 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -82,8 +82,11 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh *offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; return rc; - } - else if (thefile->pOverlapped) { + } + /* A file opened with APR_XTHREAD has been opened for overlapped i/o. + * APR must explicitly track the file pointer in this case. + */ + else if (thefile->pOverlapped || thefile->flags & APR_XTHREAD) { switch(where) { case APR_SET: thefile->filePtr = *offset; From 3aaf31e059d4ffca58c5b9869a8dbae605acf9e9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 20 Jul 2004 03:31:57 +0000 Subject: [PATCH 5138/7878] apr_proc_create() on Unix: Remove unnecessary check for read access to the working directory of the child process. PR: 30137 Submitted by: Jeremy Chadwick Reviewed by: jorton, trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65285 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ threadproc/unix/proc.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index eb0f0a7679d..a210ec3b60f 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,10 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) apr_proc_create() on Unix: Remove unnecessary check for read + access to the working directory of the child process. + PR 30137. [Jeremy Chadwick ] + *) Add jlibtool - enabled with '--enable-experimental-libtool' option. [Justin Erenkrantz] diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 7f01425bccc..9273c11240e 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -295,7 +295,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->errchk) { if (attr->currdir) { - if (access(attr->currdir, R_OK|X_OK) == -1) { + if (access(attr->currdir, X_OK) == -1) { /* chdir() in child wouldn't have worked */ return errno; } From 11f1f27eaab35b033659a65d8222c3ec8ba63260 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Thu, 22 Jul 2004 01:48:35 +0000 Subject: [PATCH 5139/7878] Win32: Fix bug in apr_socket_sendfile that interferred with LSPs. PR 23982 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65288 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ include/arch/win32/apr_arch_networkio.h | 5 +++ network_io/win32/sendrecv.c | 47 +++++++++---------------- network_io/win32/sockets.c | 4 +++ 4 files changed, 28 insertions(+), 30 deletions(-) diff --git a/CHANGES b/CHANGES index a210ec3b60f..bfd23fb9789 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] + *) Win32: Fix bug in apr_socket_sendfile that interferred with + Win32 LSPs. PR 23982 [Jan Bilek, Bill Stoddard] *) Add a new PRNG. Note that the implementation of SHA-256 is a stop-gap pending snarfing the SHA-1 implementation from apr-util diff --git a/include/arch/win32/apr_arch_networkio.h b/include/arch/win32/apr_arch_networkio.h index 0e18f08637f..65726a5562c 100644 --- a/include/arch/win32/apr_arch_networkio.h +++ b/include/arch/win32/apr_arch_networkio.h @@ -42,6 +42,11 @@ struct apr_socket_t { int remote_addr_unknown; apr_int32_t options; apr_int32_t inherit; + /* As of 07.20.04, the overlapped structure is only used by + * apr_socket_sendfile and that's where it will be allocated + * and initialized. + */ + OVERLAPPED *overlapped; sock_userdata_t *userdata; /* if there is a timeout set, then this pollset is used */ diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index bd2eb6e34b0..d7a68cd9cb4 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -205,16 +205,6 @@ static apr_status_t collapse_iovec(char **off, apr_size_t *len, #if APR_HAS_SENDFILE -/* - *#define WAIT_FOR_EVENT - * Note: Waiting for the socket directly is much faster than creating a seperate - * wait event. There are a couple of dangerous aspects to waiting directly - * for the socket. First, we should not wait on the socket if concurrent threads - * can wait-on/signal the same socket. This shouldn't be happening with Apache since - * a socket is uniquely tied to a thread. This will change when we begin using - * async I/O with completion ports on the socket. - */ - /* * apr_status_t apr_socket_sendfile(apr_socket_t *, apr_file_t *, apr_hdtr_t *, * apr_off_t *, apr_size_t *, apr_int32_t flags) @@ -239,13 +229,11 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, apr_off_t curoff = *offset; DWORD dwFlags = 0; DWORD nbytes; - OVERLAPPED overlapped; TRANSMIT_FILE_BUFFERS tfb, *ptfb = NULL; int ptr = 0; int bytes_to_send; /* Bytes to send out of the file (not including headers) */ int disconnected = 0; int sendv_trailers = 0; - HANDLE wait_event; char hdtrbuf[4096]; if (apr_os_level < APR_WIN_NT) { @@ -275,14 +263,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, return APR_SUCCESS; } - /* Initialize the header/trailer and overlapped structures */ memset(&tfb, '\0', sizeof (tfb)); - memset(&overlapped,'\0', sizeof(overlapped)); -#ifdef WAIT_FOR_EVENT - wait_event = overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); -#else - wait_event = (HANDLE) sock->socketdes; -#endif /* Collapse the headers into a single buffer */ if (hdtr && hdtr->numheaders) { @@ -301,6 +282,12 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, } } + /* Initialize the overlapped structure used on TransmitFile + */ + if (!sock->overlapped) { + sock->overlapped = apr_pcalloc(sock->cntxt, sizeof(OVERLAPPED)); + sock->overlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + } while (bytes_to_send) { if (bytes_to_send > MAX_SEGMENT_SIZE) { nbytes = MAX_SEGMENT_SIZE; @@ -329,16 +316,16 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, } } - overlapped.Offset = (DWORD)(curoff); + sock->overlapped->Offset = (DWORD)(curoff); #if APR_HAS_LARGE_FILES - overlapped.OffsetHigh = (DWORD)(curoff >> 32); + sock->overlapped->OffsetHigh = (DWORD)(curoff >> 32); #endif /* XXX BoundsChecker claims dwFlags must not be zero. */ rv = TransmitFile(sock->socketdes, /* socket */ file->filehand, /* open file descriptor of the file to be sent */ nbytes, /* number of bytes to send. 0=send all */ 0, /* Number of bytes per send. 0=use default */ - &overlapped, /* OVERLAPPED structure */ + sock->overlapped, /* OVERLAPPED structure */ ptfb, /* header and trailer buffers */ dwFlags); /* flags to control various aspects of TransmitFile */ if (!rv) { @@ -346,17 +333,20 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, if ((status == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) || (status == APR_FROM_OS_ERROR(WSA_IO_PENDING))) { - rv = WaitForSingleObject(wait_event, + rv = WaitForSingleObject(sock->overlapped->hEvent, (DWORD)(sock->timeout >= 0 ? sock->timeout_ms : INFINITE)); if (rv == WAIT_OBJECT_0) { status = APR_SUCCESS; if (!disconnected) { - if (!GetOverlappedResult(wait_event, &overlapped, - &nbytes, FALSE)) { - status = apr_get_os_error(); + if (!WSAGetOverlappedResult(sock->socketdes, + sock->overlapped, + &nbytes, + FALSE, + &dwFlags)) { + status = apr_get_netos_error(); } - /* Ugly code alert: GetOverlappedResult returns + /* Ugly code alert: WSAGetOverlappedResult returns * a count of all bytes sent. This loop only * tracks bytes sent out of the file. */ @@ -415,9 +405,6 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, } } -#ifdef WAIT_FOR_EVENT - CloseHandle(overlapped.hEvent); -#endif return status; } diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index d194a5bc0bc..50e9a66808d 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -35,6 +35,10 @@ static apr_status_t socket_cleanup(void *sock) } thesocket->socketdes = INVALID_SOCKET; } + if (thesocket->overlapped) { + CloseHandle(thesocket->overlapped->hEvent); + thesocket->overlapped = NULL; + } return APR_SUCCESS; } From a98ed25ac0363fdc504c5820ecbe4d4d520bf385 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Mon, 26 Jul 2004 15:21:59 +0000 Subject: [PATCH 5140/7878] Win32: Fix compile break in apr tests. PR: 30103 by Craig Rodrigues git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65289 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 8 ++++---- test/teststr.c | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/Makefile.win b/test/Makefile.win index 72580a019f3..2772edff184 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -78,7 +78,7 @@ globalmutexchild.exe: globalmutexchild.obj $(LOCAL_LIBS) testmutexscope.exe: testmutexscope.obj $(LOCAL_LIBS) $(LINK) testmutexscope.obj $(LOCAL_LIBS) $(ALL_LIBS) -TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ +TESTS = abts.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testmmap.obj testud.obj testtable.obj testsleep.obj testpools.obj \ testfmt.obj testfile.obj testdir.obj testfileinfo.obj testrand.obj \ testdso.obj testoc.obj testdup.obj testsockets.obj testproc.obj \ @@ -87,10 +87,10 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj \ testatomic.obj testflock.obj testshm.obj testsock.obj \ testglobalmutex.obj teststrnatcmp.obj testfilecopy.obj \ - testtemp.obj testlfs.obj + testtemp.obj testlfs.obj testutil.obj -testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS) - $(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ +testall.exe: $(TESTS) $(LOCAL_LIBS) + $(LINK) /debug /subsystem:console /machine:I386 /out:$@ $(TESTS) \ $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/teststr.c b/test/teststr.c index f4b956eeea1..2121da41ab5 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -20,6 +20,10 @@ #include #include +#if APR_HAVE_LIMITS_H +#include +#endif + #include "apr_general.h" #include "apr_strings.h" #include "apr_errno.h" From 2c7d1b508544aaab8831bf5b9e5b7877c360bd41 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 26 Jul 2004 23:11:17 +0000 Subject: [PATCH 5141/7878] Since this code only applies to sendfile, make sure that it is properly #ifdef'ed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65291 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_networkio.h | 2 ++ network_io/win32/sockets.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/arch/win32/apr_arch_networkio.h b/include/arch/win32/apr_arch_networkio.h index 65726a5562c..c2dd0b6e90e 100644 --- a/include/arch/win32/apr_arch_networkio.h +++ b/include/arch/win32/apr_arch_networkio.h @@ -42,11 +42,13 @@ struct apr_socket_t { int remote_addr_unknown; apr_int32_t options; apr_int32_t inherit; +#if APR_HAS_SENDFILE /* As of 07.20.04, the overlapped structure is only used by * apr_socket_sendfile and that's where it will be allocated * and initialized. */ OVERLAPPED *overlapped; +#endif sock_userdata_t *userdata; /* if there is a timeout set, then this pollset is used */ diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 50e9a66808d..94676b8c18d 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -35,10 +35,12 @@ static apr_status_t socket_cleanup(void *sock) } thesocket->socketdes = INVALID_SOCKET; } +#if APR_HAS_SENDFILE if (thesocket->overlapped) { CloseHandle(thesocket->overlapped->hEvent); thesocket->overlapped = NULL; } +#endif return APR_SUCCESS; } From afaab90584fc1ec7a8993f27f3354a3c73ac1c1b Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 31 Jul 2004 22:36:03 +0000 Subject: [PATCH 5142/7878] Eliminate APR_STATUS_IS_SUCCESS macro. Reviewed by (conceptually): Ryan, Greg, Fitz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65292 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ file_io/netware/filestat.c | 4 ++-- file_io/unix/filestat.c | 4 ++-- include/apr_errno.h | 12 +----------- test/testsockopt.c | 2 +- 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/CHANGES b/CHANGES index bfd23fb9789..ff4b4816659 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,8 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Remove APR_STATUS_IS_SUCCESS() macro. [Justin Erenkrantz] + *) apr_proc_create() on Unix: Remove unnecessary check for read access to the working directory of the child process. PR 30137. [Jeremy Chadwick ] diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index ef393275b11..5c43bb93709 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -123,7 +123,7 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, return APR_SUCCESS; status = apr_stat(&finfo, fname, APR_FINFO_PROT, pool); - if (!APR_STATUS_IS_SUCCESS(status)) + if (status) return status; /* ### TODO: should added bits be umask'd? */ @@ -352,7 +352,7 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, apr_finfo_t finfo; status = apr_stat(&finfo, fname, APR_FINFO_ATIME, pool); - if (!APR_STATUS_IS_SUCCESS(status)) { + if (status) { return status; } diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 4e56f99487e..ff16164e188 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -137,7 +137,7 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, return APR_SUCCESS; status = apr_stat(&finfo, fname, APR_FINFO_PROT, pool); - if (!APR_STATUS_IS_SUCCESS(status)) + if (status) return status; /* ### TODO: should added bits be umask'd? */ @@ -187,7 +187,7 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, apr_finfo_t finfo; status = apr_stat(&finfo, fname, APR_FINFO_ATIME, pool); - if (!APR_STATUS_IS_SUCCESS(status)) { + if (status) { return status; } diff --git a/include/apr_errno.h b/include/apr_errno.h index cd2a2b4c902..dced627f86b 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -154,7 +154,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, */ #define APR_OS_START_SYSERR (APR_OS_START_EAIERR + APR_OS_ERRSPACE_SIZE) -/** no error. @see APR_STATUS_IS_SUCCESS */ +/** no error. */ #define APR_SUCCESS 0 /** @@ -787,9 +787,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, */ #define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e)) -#define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS \ - || (s) == APR_OS_START_SYSERR + NO_ERROR) - /* These can't sit in a private header, so in spite of the extra size, * they need to be made available here. */ @@ -948,9 +945,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e))) -#define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS \ - || (s) == APR_OS_START_SYSERR + ERROR_SUCCESS) - /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \ @@ -1063,8 +1057,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e))) -#define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) - /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) @@ -1132,8 +1124,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * @addtogroup APR_STATUS_IS * @{ */ -/** no error */ -#define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) /** permission denied */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) diff --git a/test/testsockopt.c b/test/testsockopt.c index 0d7a67e25cf..1a97c1454a9 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -53,7 +53,7 @@ static void set_debug(abts_case *tc, void *data) rv1 = apr_socket_opt_set(sock, APR_SO_DEBUG, 1); rv2 = apr_socket_opt_get(sock, APR_SO_DEBUG, &ck); APR_ASSERT_SUCCESS(tc, "get SO_DEBUG option", rv2); - if (APR_STATUS_IS_SUCCESS(rv1)) { + if (rv1 == APR_SUCCESS) { ABTS_INT_EQUAL(tc, 1, ck); } else { ABTS_INT_EQUAL(tc, 0, ck); From 0523f76ea987af9cb44576a44656f140f903eba8 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 1 Aug 2004 00:52:20 +0000 Subject: [PATCH 5143/7878] Only install apr-$MAJOR-config and add appropriate detection code to find_apr.m4 (APR_FIND_APR). Justin made a few changes to Max's latest patch: - Emit a warning at autoconf-time and default to [0 1] if 4th arg is missing. - Fix some tpyos - Change apr-config.in to not use multiple @APR_MAJOR_VERSION@ substs. Submitted by: Max Bowsher Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65293 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 1 + CHANGES | 3 ++ Makefile.in | 9 ++-- apr-config.in | 6 +-- build/find_apr.m4 | 106 +++++++++++++++++++++++++++++++++------------- configure.in | 6 ++- 6 files changed, 92 insertions(+), 39 deletions(-) diff --git a/.cvsignore b/.cvsignore index f207ee24b13..13ef1e0e251 100644 --- a/.cvsignore +++ b/.cvsignore @@ -6,6 +6,7 @@ config.status configure libtool apr-config +apr-*-config apr-config.out LibD LibR diff --git a/CHANGES b/CHANGES index ff4b4816659..6a871e3f9ce 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] Changes with APR 1.0 + *) Only install apr-$MAJOR-config and add appropriate detection code to + find_apr.m4 (APR_FIND_APR). [Max Bowsher ] + *) Remove APR_STATUS_IS_SUCCESS() macro. [Justin Erenkrantz] *) apr_proc_create() on Unix: Remove unnecessary check for read diff --git a/Makefile.in b/Makefile.in index 356630faa02..fcd3caaaa2b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -44,7 +44,7 @@ CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ build/apr_rules.out DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ - libtool apr-config build/apr_rules.mk apr.pc + libtool $(APR_CONFIG) build/apr_rules.mk apr.pc EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in \ build-outputs.mk build/ltcf-c.sh build/ltmain.sh build/libtool.m4 @@ -56,8 +56,8 @@ includedir=@includedir@ installbuilddir=@installbuilddir@ # Create apr-config script suitable for the install tree -apr-config.out: apr-config - sed 's,^\(location=\).*$$,\1installed,' < apr-config > $@ +apr-config.out: $(APR_CONFIG) + sed 's,^\(location=\).*$$,\1installed,' < $(APR_CONFIG) > $@ # Create apr_rules.mk suitable for the install tree build/apr_rules.out: build/apr_rules.mk @@ -97,9 +97,8 @@ install: $(TARGET_LIB) apr-config.out build/apr_rules.out if [ ! -d $(DESTDIR)$(bindir) ]; then \ $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(bindir); \ fi; - $(LIBTOOL) --mode=install cp apr-config.out $(DESTDIR)$(bindir)/apr-config $(LIBTOOL) --mode=install cp apr-config.out $(DESTDIR)$(bindir)/$(APR_CONFIG) - chmod 755 $(DESTDIR)$(bindir)/apr-config $(DESTDIR)$(bindir)/$(APR_CONFIG) + chmod 755 $(DESTDIR)$(bindir)/$(APR_CONFIG) @if [ $(INSTALL_SUBDIRS) != "none" ]; then \ for i in $(INSTALL_SUBDIRS); do \ ( cd $$i ; $(MAKE) DESTDIR=$(DESTDIR) install ); \ diff --git a/apr-config.in b/apr-config.in index 230ad40cb71..870cf888a21 100644 --- a/apr-config.in +++ b/apr-config.in @@ -49,7 +49,7 @@ location=@APR_CONFIG_LOCATION@ show_usage() { cat << EOF -Usage: apr-config [OPTION] +Usage: apr-$APR_MAJOR_VERSION-config [OPTION] Known values for OPTION are: --prefix[=DIR] change prefix to DIR @@ -75,9 +75,9 @@ Known values for OPTION are: --help print this help When linking with libtool, an application should do something like: - APR_LIBS="\`apr-config --link-libtool --libs\`" + APR_LIBS="\`apr-$APR_MAJOR_VERSION-config --link-libtool --libs\`" or when linking directly: - APR_LIBS="\`apr-config --link-ld --libs\`" + APR_LIBS="\`apr-$APR_MAJOR_VERSION-config --link-ld --libs\`" An application should use the results of --cflags, --cppflags, --includes, and --ldflags in their build process. diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 90865aeca9c..5ff75a7c78b 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -6,17 +6,23 @@ dnl library. It provides a standardized mechanism for using APR. It supports dnl embedding APR into the application source, or locating an installed dnl copy of APR. dnl -dnl APR_FIND_APR([srcdir [, builddir, implicit-install-check]]) +dnl APR_FIND_APR(srcdir, builddir, implicit-install-check, acceptable-majors) dnl dnl where srcdir is the location of the bundled APR source directory, or dnl empty if source is not bundled. dnl -dnl where blddir is the location where the bundled APR will will be built, +dnl where builddir is the location where the bundled APR will will be built, dnl or empty if the build will occur in the srcdir. dnl dnl where implicit-install-check set to 1 indicates if there is no dnl --with-apr option specified, we will look for installed copies. dnl +dnl where acceptable-majors is a space separated list of acceptable major +dnl version numbers. Often only a single major version will be acceptable. +dnl If multiple versions are specified, and --with-apr=PREFIX or the +dnl implicit installed search are used, then the first (leftmost) version +dnl in the list that is found will be used. Currently defaults to [0 1]. +dnl dnl Sets the following variables on exit: dnl dnl apr_found : "yes", "no", "reconfig" @@ -47,56 +53,98 @@ AC_DEFUN(APR_FIND_APR, [ TEST_X="test -x" fi + m4_if([$4], [], + [ + AC_WARNING([$0: missing argument 4 (acceptable-majors): Defaulting to APR 0.x then APR 1.x]) + acceptable_majors="0 1" + ], [acceptable_majors="$4"]) + + apr_temp_acceptable_apr_config="" + for apr_temp_major in $acceptable_majors + do + case $apr_temp_major in + 0) + apr_temp_acceptable_apr_config="$apr_temp_acceptable_apr_config apr-config" + ;; + *) + apr_temp_acceptable_apr_config="$apr_temp_acceptable_apr_config apr-$apr_temp_major-config" + ;; + esac + done + AC_MSG_CHECKING(for APR) AC_ARG_WITH(apr, - [ --with-apr=DIR|FILE prefix for installed APR, path to APR build tree, + [ --with-apr=PATH prefix for installed APR, path to APR build tree, or the full path to apr-config], [ if test "$withval" = "no" || test "$withval" = "yes"; then - AC_MSG_ERROR([--with-apr requires a directory to be provided]) + AC_MSG_ERROR([--with-apr requires a directory or file to be provided]) fi - if $TEST_X "$withval/bin/apr-config"; then - apr_found="yes" - apr_config="$withval/bin/apr-config" - elif $TEST_X "$withval/apr-config"; then - apr_found="yes" - apr_config="$withval/apr-config" - elif $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then + for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config + do + for lookdir in "$withval/bin" "$withval" + do + if $TEST_X "$lookdir/$apr_temp_apr_config_file"; then + apr_found="yes" + apr_config="$lookdir/$apr_temp_apr_config_file" + break 2 + fi + done + done + + if test "$apr_found" != "yes" && $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then apr_found="yes" apr_config="$withval" fi - dnl if --with-apr is used, then the target prefix/directory must be valid + dnl if --with-apr is used, it is a fatal error for its argument + dnl to be invalid if test "$apr_found" != "yes"; then - AC_MSG_ERROR([the --with-apr parameter is incorrect. It must specify an install prefix, a -build directory, or an apr-config file.]) + AC_MSG_ERROR([the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.]) fi ],[ dnl if we have a bundled source directory, use it if test -d "$1"; then apr_temp_abs_srcdir="`cd $1 && pwd`" apr_found="reconfig" + echo "sed -n '/#define.*APR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"$1/include/apr_version.h\"" + apr_bundled_major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"$1/include/apr_version.h\"`" + case $apr_bundled_major in + "") + AC_MSG_ERROR([failed to find major version of bundled APR]) + ;; + 0) + apr_temp_apr_config_file="apr-config" + ;; + *) + apr_temp_apr_config_file="apr-$apr_bundled_major-config" + ;; + esac if test -n "$2"; then - apr_config="$2/apr-config" + apr_config="$2/$apr_temp_apr_config_file" else - apr_config="$1/apr-config" + apr_config="$1/$apr_temp_apr_config_file" fi fi if test "$apr_found" = "no" && test -n "$3" && test "$3" = "1"; then - if apr-config --help > /dev/null 2>&1 ; then - apr_found="yes" - apr_config="apr-config" - else - dnl look in some standard places (apparently not in builtin/default) - for lookdir in /usr /usr/local /opt/apr /usr/local/apache2 ; do - if $TEST_X "$lookdir/bin/apr-config"; then - apr_found="yes" - apr_config="$lookdir/bin/apr-config" - break - fi - done - fi + for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config + do + if $apr_temp_apr_config_file --help > /dev/null 2>&1 ; then + apr_found="yes" + apr_config="$apr_temp_apr_config_file" + break + else + dnl look in some standard places (apparently not in builtin/default) + for lookdir in /usr /usr/local /opt/apr /usr/local/apache2 ; do + if $TEST_X "$lookdir/bin/$apr_temp_apr_config_file"; then + apr_found="yes" + apr_config="$lookdir/bin/$apr_temp_apr_config_file" + break 2 + fi + done + fi + done fi ]) diff --git a/configure.in b/configure.in index 8f8d2236b61..0722a3a68d0 100644 --- a/configure.in +++ b/configure.in @@ -2016,7 +2016,7 @@ AC_OUTPUT([ $MAKEFILES include/apr.h build/apr_rules.mk - apr-config + apr-$APR_MAJOR_VERSION-config:apr-config.in apr.pc ],[ for i in $SAVE_FILES; do @@ -2026,5 +2026,7 @@ for i in $SAVE_FILES; do fi rm -f $i.save done -chmod +x apr-config +chmod +x apr-$APR_MAJOR_VERSION-config +],[ +APR_MAJOR_VERSION=$APR_MAJOR_VERSION ]) From b5a3d114c10c1833e608ec3ffb664a6e39dba9f5 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 2 Aug 2004 09:47:48 +0000 Subject: [PATCH 5144/7878] Improve apr_file_gets() performance on buffered files by not calling apr_file_read() on each byte if we don't have to. (mod_negotiation requests call apr_file_gets() for each line in the map file, which can get to be quite expensive to have repeated memcpy()'s for one byte!) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65294 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ file_io/unix/readwrite.c | 66 +++++++++++++++++++++++++++++++++------- 2 files changed, 58 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index 6a871e3f9ce..70a71eb2df5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] + + *) Improve apr_file_gets() performance on buffered files. [Justin Erenkrantz] + *) Win32: Fix bug in apr_socket_sendfile that interferred with Win32 LSPs. PR 23982 [Jan Bilek, Bill Stoddard] diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 1e6a6e66542..98a11421de4 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -24,9 +24,6 @@ #define USE_WAIT_FOR_IO #endif -/* problems: - * 1) ungetchar not used for buffered files - */ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) { apr_ssize_t rv; @@ -311,18 +308,65 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) return APR_SUCCESS; } - while (str < final) { /* leave room for trailing '\0' */ - nbytes = 1; - rv = apr_file_read(thefile, str, &nbytes); - if (rv != APR_SUCCESS) { - break; + /* If we have an underlying buffer, we can be *much* more efficient + * and skip over the apr_file_read calls. + */ + if (thefile->buffered) { + +#if APR_HAS_THREADS + if (thefile->thlock) { + apr_thread_mutex_lock(thefile->thlock); + } +#endif + + if (thefile->direction == 1) { + apr_file_flush(thefile); + thefile->direction = 0; + thefile->bufpos = 0; + thefile->dataRead = 0; } - if (*str == '\n') { + + while (str < final) { /* leave room for trailing '\0' */ + /* Force ungetc leftover to call apr_file_read. */ + if (thefile->bufpos < thefile->dataRead && + thefile->ungetchar == -1) { + *str = thefile->buffer[thefile->bufpos++]; + } + else { + nbytes = 1; + rv = apr_file_read(thefile, str, &nbytes); + if (rv != APR_SUCCESS) { + break; + } + } + if (*str == '\n') { + ++str; + break; + } + ++str; + } + +#if APR_HAS_THREADS + if (thefile->thlock) { + apr_thread_mutex_unlock(thefile->thlock); + } +#endif + } + else { + while (str < final) { /* leave room for trailing '\0' */ + nbytes = 1; + rv = apr_file_read(thefile, str, &nbytes); + if (rv != APR_SUCCESS) { + break; + } + if (*str == '\n') { + ++str; + break; + } ++str; - break; } - ++str; } + /* We must store a terminating '\0' if we've stored any chars. We can * get away with storing it if we hit an error first. */ From 56f1e7d0652916168e576ffd7fa9b506195f1ef9 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 3 Aug 2004 09:15:55 +0000 Subject: [PATCH 5145/7878] OK, so there was probably an easier way to do this, but... APR 1.0.0 is a release, not a dev release, so remove the define that we are a dev release. Submitted by: William Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65295 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_version.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/apr_version.h b/include/apr_version.h index 8d922841789..af307b48fdf 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -63,12 +63,6 @@ extern "C" { #define APR_PATCH_VERSION 0 -/** - * This symbol is defined for internal, "development" copies of APR. This - * symbol will be #undef'd for releases. - */ -#define APR_IS_DEV_VERSION - /** The formatted string of APR's version */ #define APR_VERSION_STRING \ APR_STRINGIFY(APR_MAJOR_VERSION) "." \ From f3d332932a86aafafb6656ef5e57f44c20bfe4b7 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 3 Aug 2004 09:28:07 +0000 Subject: [PATCH 5146/7878] HEAD is now 1.0.1 and is once again a dev version When testing this apr-1-config didn't show the "-dev" as I'd have expected. Don't have time to trace more than that! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65297 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_version.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/apr_version.h b/include/apr_version.h index af307b48fdf..08d5f3a26a0 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -60,8 +60,13 @@ extern "C" { #define APR_MINOR_VERSION 0 /** patch level */ -#define APR_PATCH_VERSION 0 +#define APR_PATCH_VERSION 1 +/** + * This symbol is defined for internal, "development" copies of APR. + * This symbol should be #undef'd for releases. + */ +#define APR_IS_DEV_VERSION /** The formatted string of APR's version */ #define APR_VERSION_STRING \ From f4006b6103fe615573b3590ea71a0bdb181f20a9 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 4 Aug 2004 16:20:02 +0000 Subject: [PATCH 5147/7878] Update the NetWare makefiles to conform with the LDAP overhaul git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65298 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 8 ++++++++ build/NWGNUmakefile | 3 +++ build/nw_export.inc | 2 ++ 3 files changed, 13 insertions(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index 901df374f6c..1e679fb697c 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -225,6 +225,14 @@ FILES_nlm_Ximports = \ WSAStartupRTags \ WSACleanupRTag \ $(EOLIST) + +#If the LDAP support is defined then add the imports +ifneq "$(LDAPSDK)" "" +FILES_nlm_Ximports += \ + @$(LDAPSDK)/imports/lldapsdk.imp \ + @$(LDAPSDK)/imports/lldapssl.imp \ + $(EOLIST) +endif # # Any symbols exported to here diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index b12384cd4a4..eb9d4c6aedf 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -48,6 +48,9 @@ $(NLM_NAME)_cc.opt : NWGNUmakefile $(APR_WORK)\build\NWGNUenvironment.inc $(APR_ @echo -I..\include\arch\unix >> $@ @echo -I..\..\apr-util\include >> $@ @echo -ir $(NOVELLLIBC) >> $@ +ifneq "$(LDAPSDK)" "" + @echo -ir $(LDAPSDK) >> $@ +endif $(APR)/include/%.h: $(subst /,\,$(APR))\include\%.hnw @echo Creating $(subst /,\,$@) diff --git a/build/nw_export.inc b/build/nw_export.inc index 1aa7140cb38..91c177a1edc 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -63,6 +63,8 @@ #include "apr_date.h" #include "apr_dbm.h" #include "apr_hooks.h" +#include "apr_ldap.h" +#include "apr_ldap_url.h" #include "apr_md4.h" #include "apr_md5.h" #include "apr_optional.h" From a01c399c0e77cee337fc9da5ccce99a2e7d4d8a9 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 9 Aug 2004 06:31:59 +0000 Subject: [PATCH 5148/7878] Ditch autoconf-2.5x+ syntax (m4_*) and only print the warning on ac-2.5x+ (apr-util now configures correctly on autoconf-2.13) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65299 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 5ff75a7c78b..a74681636af 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -53,11 +53,10 @@ AC_DEFUN(APR_FIND_APR, [ TEST_X="test -x" fi - m4_if([$4], [], - [ - AC_WARNING([$0: missing argument 4 (acceptable-majors): Defaulting to APR 0.x then APR 1.x]) - acceptable_majors="0 1" - ], [acceptable_majors="$4"]) + ifelse([$4], [], [ + ifdef(AC_WARNING,AC_WARNING([$0: missing argument 4 (acceptable-majors): Defaulting to APR 0.x then APR 1.x])) + acceptable_majors="0 1"], + [acceptable_majors="$4"]) apr_temp_acceptable_apr_config="" for apr_temp_major in $acceptable_majors From 0bbef4d77baffd40d37a111c14cb643e067e2321 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 9 Aug 2004 16:52:00 +0000 Subject: [PATCH 5149/7878] Make sure that we auto-load the LDAPSDK NLMs so that APRLIB can run in protected address space git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65300 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index 1e679fb697c..b977bb0d651 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -199,6 +199,16 @@ FILES_nlm_modules = \ Libc \ ws2_32 \ $(EOLIST) + +#If the LDAP support is defined then add the auto-load modules +ifneq "$(LDAPSDK)" "" +FILES_nlm_modules += \ + lldapsdk \ + lldapssl \ + lldapx \ + $(EOLIST) +endif + # # If the nlm has a msg file, put it's path here From b6c24c056741e7446e911b0e33345f02359b44ea Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 10 Aug 2004 10:09:37 +0000 Subject: [PATCH 5150/7878] * build/find_apr.m4 (APR_FIND_APR): Remove echo (debugging aid?) and quote AC_DEFUN properly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65301 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index a74681636af..555fca59ed8 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -43,7 +43,7 @@ dnl If apr_found is "yes" or "reconfig", then the caller should use the dnl value of apr_config to fetch any necessary build/link information. dnl -AC_DEFUN(APR_FIND_APR, [ +AC_DEFUN([APR_FIND_APR], [ apr_found="no" if test "$ac_cv_emxos2" = "yes"; then @@ -107,7 +107,6 @@ AC_DEFUN(APR_FIND_APR, [ if test -d "$1"; then apr_temp_abs_srcdir="`cd $1 && pwd`" apr_found="reconfig" - echo "sed -n '/#define.*APR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"$1/include/apr_version.h\"" apr_bundled_major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"$1/include/apr_version.h\"`" case $apr_bundled_major in "") From 4ba28e269ea4d1d989c80abda5131f9c8a55366d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Aug 2004 06:18:29 +0000 Subject: [PATCH 5151/7878] This must hit 1.0 - note the ambiguity of ctime. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65302 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 46db6c25b65..7bd31a31293 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -133,7 +133,7 @@ typedef struct apr_finfo_t apr_finfo_t; #define APR_FINFO_LINK 0x00000001 /**< Stat the link not the file itself if it is a link */ #define APR_FINFO_MTIME 0x00000010 /**< Modification Time */ -#define APR_FINFO_CTIME 0x00000020 /**< Creation Time */ +#define APR_FINFO_CTIME 0x00000020 /**< Creation or inode-changed time */ #define APR_FINFO_ATIME 0x00000040 /**< Access Time */ #define APR_FINFO_SIZE 0x00000100 /**< Size of the file */ #define APR_FINFO_CSIZE 0x00000200 /**< Storage size consumed by the file */ @@ -191,7 +191,7 @@ struct apr_finfo_t { apr_time_t atime; /** The time the file was last modified */ apr_time_t mtime; - /** The time the file was last changed */ + /** The time the file was created, or the inode was last changed */ apr_time_t ctime; /** The pathname of the file (possibly unrooted) */ const char *fname; From 41e31f39ce45bb4e71e9812fcf4bf0770ca2eda3 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 12 Aug 2004 13:44:29 +0000 Subject: [PATCH 5152/7878] * build/apr_hints.m4 (APR_PRELOAD): Don't preempt APR_PTHREADS_CHECK on older FreeBSDs to fix --enable-threads. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65303 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 75a65ed24c9..5aa03c95205 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -147,7 +147,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? apr_cv_pthreads_cflags="none" apr_cv_pthreads_lib="-lpthread" else - apr_cv_pthreads_cflags="-D_THREAD_SAFE -D_REENTRANT" + APR_ADDTO(CPPFLAGS, [-D_THREAD_SAFE -D_REENTRANT]) APR_SETIFNULL(enable_threads, [no]) fi # prevent use of KQueue before FreeBSD 4.8 From 3cf8a7b094d650998c908884cc0a49aa60b1289e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 18 Aug 2004 13:09:55 +0000 Subject: [PATCH 5153/7878] Spelling fix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65304 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index 03e4915bfba..9cba568c741 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -403,7 +403,7 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags); /** - * Eliminate redunandant entries in a table by either overwriting + * Eliminate redundant entries in a table by either overwriting * or merging duplicates * * @param t Table. From 7ef56343f0dd5b10a9fbfee287f393d114173ad1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 19 Aug 2004 12:45:32 +0000 Subject: [PATCH 5154/7878] Improve support for configure --silent (aka --quiet): * build/apr_common.m4 (APR_SUBDIR_CONFIG): Explicitly pass --silent down to sub-configure. (APR_SETIFNULL, APR_ADDTO, APR_REMOVEFROM, APR_SETVAR, APR_RESTORE_THE_ENVIRONMENT): Don't print messages if invoked with --silent. PR: 30725 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65305 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index fc0ae549381..8dd0ac156ec 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -136,6 +136,9 @@ changequote([, ])dnl done ]) + # autoconf doesn't add --silent to ac_configure_args; explicitly pass it + test "x$silent" = "xyes" && apr_configure_args="$apr_configure_args --silent" + dnl The eval makes quoting arguments work - specifically $2 where the dnl quoting mechanisms used is "" rather than []. dnl @@ -185,8 +188,10 @@ else $1="$apr_ste_save_$1" fi fi -echo " restoring $1 to \"$$1\"" -echo " setting $2$1 to \"$$2$1\"" +if test "x$silent" != "xyes"; then + echo " restoring $1 to \"$$1\"" + echo " setting $2$1 to \"$$2$1\"" +fi AC_SUBST($2$1) ])dnl @@ -197,7 +202,7 @@ dnl Set variable iff it's currently null dnl AC_DEFUN(APR_SETIFNULL,[ if test -z "$$1"; then - echo " setting $1 to \"$2\"" + test "x$silent" != "xyes" && echo " setting $1 to \"$2\"" $1="$2" fi ])dnl @@ -208,7 +213,7 @@ dnl dnl Set variable no matter what dnl AC_DEFUN(APR_SETVAR,[ - echo " forcing $1 to \"$2\"" + test "x$silent" != "xyes" && echo " forcing $1 to \"$2\"" $1="$2" ])dnl @@ -219,7 +224,7 @@ dnl Add value to variable dnl AC_DEFUN(APR_ADDTO,[ if test "x$$1" = "x"; then - echo " setting $1 to \"$2\"" + test "x$silent" != "xyes" && echo " setting $1 to \"$2\"" $1="$2" else apr_addto_bugger="$2" @@ -232,7 +237,7 @@ AC_DEFUN(APR_ADDTO,[ fi done if test $apr_addto_duplicate = "0"; then - echo " adding \"$i\" to $1" + test "x$silent" != "xyes" && echo " adding \"$i\" to $1" $1="$$1 $i" fi done @@ -246,7 +251,7 @@ dnl Remove a value from a variable dnl AC_DEFUN(APR_REMOVEFROM,[ if test "x$$1" = "x$2"; then - echo " nulling $1" + test "x$silent" != "xyes" && echo " nulling $1" $1="" else apr_new_bugger="" @@ -259,7 +264,7 @@ AC_DEFUN(APR_REMOVEFROM,[ fi done if test $apr_removed = "1"; then - echo " removed \"$2\" from $1" + test "x$silent" != "xyes" && echo " removed \"$2\" from $1" $1=$apr_new_bugger fi fi From a8c62b3b0c02eb4a5d425c6e14c40b267a1f40ce Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 20 Aug 2004 16:42:16 +0000 Subject: [PATCH 5155/7878] * Makefile.in (install): Simplify; use INSTALL and INSTALL_DATA rather than cp; use APR_MKDIR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65306 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 51 +++++++++++++++++---------------------------------- 1 file changed, 17 insertions(+), 34 deletions(-) diff --git a/Makefile.in b/Makefile.in index fcd3caaaa2b..4397c96fcb7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -29,6 +29,8 @@ INSTALL_SUBDIRS=@INSTALL_SUBDIRS@ TARGET_LIB = lib@APR_LIBNAME@.la APR_PCFILE = apr-$(APR_MAJOR_VERSION).pc APR_CONFIG = apr-$(APR_MAJOR_VERSION)-config +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ # # Rules for building specific targets, starting with 'all' for @@ -64,41 +66,22 @@ build/apr_rules.out: build/apr_rules.mk sed 's,^\(apr_build.*=\).*$$,\1$(installbuilddir),' < build/apr_rules.mk > $@ install: $(TARGET_LIB) apr-config.out build/apr_rules.out - if [ ! -d $(DESTDIR)$(includedir) ]; then \ - $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(includedir); \ - fi; - cp -p $(top_srcdir)/include/*.h $(DESTDIR)$(includedir); - - if test -n "$(top_blddir)"; then \ - cp -p $(top_blddir)/include/*.h $(DESTDIR)$(includedir); \ - fi; - if [ ! -d $(DESTDIR)$(libdir) ]; then \ - $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(libdir); \ - fi; - $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(DESTDIR)$(libdir) - $(LIBTOOL) --mode=install cp apr.exp $(DESTDIR)$(libdir) - if [ ! -d $(DESTDIR)$(libdir)/pkgconfig ]; then \ - $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(libdir)/pkgconfig; \ - fi; - cp -p apr.pc $(DESTDIR)$(libdir)/pkgconfig/$(APR_PCFILE) - if [ ! -d $(DESTDIR)$(installbuilddir) ]; then \ - $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(installbuilddir); \ - fi; - if [ -f libtool ]; then \ - $(LIBTOOL) --mode=install cp libtool $(DESTDIR)$(installbuilddir); \ - fi; - if [ -f shlibtool ]; then \ - $(LIBTOOL) --mode=install cp shlibtool $(DESTDIR)$(installbuilddir); \ - fi - for f in mkdir.sh make_exports.awk make_var_export.awk; do \ - cp $(top_srcdir)/build/$${f} $(DESTDIR)$(installbuilddir); \ + $(APR_MKDIR) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(installbuilddir) \ + $(DESTDIR)$(libdir)/pkgconfig $(DESTDIR)$(includedir) + $(INSTALL_DATA) $(top_blddir)/include/apr.h $(DESTDIR)$(includedir) + $(INSTALL_DATA) $(top_srcdir)/include/apr_*.h $(DESTDIR)$(includedir) + $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(TARGET_LIB) $(DESTDIR)$(libdir) + $(INSTALL_DATA) apr.exp $(DESTDIR)$(libdir)/apr.exp + $(INSTALL_DATA) apr.pc $(DESTDIR)$(libdir)/pkgconfig/$(APR_PCFILE) + for f in libtool shlibtool; do \ + if test -f $${f}; then $(INSTALL) -m 755 $${f} $(DESTDIR)$(installbuilddir); fi; \ + done + $(INSTALL) -m 755 build/mkdir.sh $(DESTDIR)$(installbuilddir) + for f in make_exports.awk make_var_export.awk; do \ + $(INSTALL_DATA) $(top_srcdir)/build/$${f} $(DESTDIR)$(installbuilddir); \ done - cp build/apr_rules.out $(DESTDIR)$(installbuilddir)/apr_rules.mk - if [ ! -d $(DESTDIR)$(bindir) ]; then \ - $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(bindir); \ - fi; - $(LIBTOOL) --mode=install cp apr-config.out $(DESTDIR)$(bindir)/$(APR_CONFIG) - chmod 755 $(DESTDIR)$(bindir)/$(APR_CONFIG) + $(INSTALL_DATA) build/apr_rules.out $(DESTDIR)$(installbuilddir)/apr_rules.mk + $(INSTALL) -m 755 apr-config.out $(DESTDIR)$(bindir)/$(APR_CONFIG) @if [ $(INSTALL_SUBDIRS) != "none" ]; then \ for i in $(INSTALL_SUBDIRS); do \ ( cd $$i ; $(MAKE) DESTDIR=$(DESTDIR) install ); \ From 0f4de3f3ad8b5b29e2ca0dbc0f30366cae83481d Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 24 Aug 2004 01:43:34 +0000 Subject: [PATCH 5156/7878] Win32: Implement apr_procattr_child_errfn_set()and apr_procattr_error_check_set() on Windows git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65307 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_threadproc.h | 2 ++ threadproc/win32/proc.c | 40 ++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/include/arch/win32/apr_arch_threadproc.h b/include/arch/win32/apr_arch_threadproc.h index 6e8ac8d5411..f752fd7df4e 100644 --- a/include/arch/win32/apr_arch_threadproc.h +++ b/include/arch/win32/apr_arch_threadproc.h @@ -54,6 +54,8 @@ struct apr_procattr_t { char *currdir; apr_int32_t cmdtype; apr_int32_t detached; + apr_child_errfn_t *errfn; + apr_int32_t errchk; }; struct apr_thread_once_t { diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index e7c21c10596..191d682d489 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -245,14 +245,14 @@ static char *apr_caret_escape_args(apr_pool_t *p, const char *str) APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, apr_child_errfn_t *errfn) { - /* won't ever be called on this platform, so don't save the function pointer */ + attr->errfn = errfn; return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, apr_int32_t chk) { - /* won't ever be used on this platform, so don't save the flag */ + attr->errchk = chk; return APR_SUCCESS; } @@ -311,6 +311,12 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, char *fullpath = NULL; if ((rv = apr_filepath_merge(&fullpath, attr->currdir, progname, APR_FILEPATH_NATIVE, pool)) != APR_SUCCESS) { + if (attr->errfn) { + attr->errfn(pool, rv, + apr_pstrcat(pool, "filepath_merge failed.", + " currdir: ", attr->currdir, + " progname: ", progname, NULL)); + } return rv; } progname = fullpath; @@ -352,6 +358,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->cmdtype == APR_SHELLCMD || attr->cmdtype == APR_SHELLCMD_ENV) { char *shellcmd = getenv("COMSPEC"); if (!shellcmd) { + if (attr->errfn) { + attr->errfn(pool, APR_EINVAL, "COMSPEC envar is not set"); + } return APR_EINVAL; } if (shellcmd[0] == '"') { @@ -388,6 +397,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, { char *shellcmd = getenv("COMSPEC"); if (!shellcmd) { + if (attr->errfn) { + attr->errfn(pool, APR_EINVAL, "COMSPEC envar is not set"); + } return APR_EINVAL; } if (shellcmd[0] == '"') { @@ -479,6 +491,12 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if ((rv = apr_conv_utf8_to_ucs2(env[i], &in, pNext, &iEnvBlockLen)) != APR_SUCCESS) { + if (attr->errfn) { + attr->errfn(pool, rv, + apr_pstrcat(pool, + "utf8 to ucs2 conversion failed" + " on this string: ", env[i], NULL)); + } return rv; } pNext = wcschr(pNext, L'\0') + 1; @@ -525,6 +543,12 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, wprg = apr_palloc(pool, nwprg * sizeof(wprg[0])); if ((rv = apr_conv_utf8_to_ucs2(progname, &nprg, wprg, &nwprg)) != APR_SUCCESS) { + if (attr->errfn) { + attr->errfn(pool, rv, + apr_pstrcat(pool, + "utf8 to ucs2 conversion failed" + " on progname: ", progname, NULL)); + } return rv; } } @@ -535,6 +559,12 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, wcmd = apr_palloc(pool, nwcmd * sizeof(wcmd[0])); if ((rv = apr_conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd)) != APR_SUCCESS) { + if (attr->errfn) { + attr->errfn(pool, rv, + apr_pstrcat(pool, + "utf8 to ucs2 conversion failed" + " on cmdline: ", cmdline, NULL)); + } return rv; } } @@ -547,6 +577,12 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if ((rv = apr_conv_utf8_to_ucs2(attr->currdir, &ncwd, wcwd, &nwcwd)) != APR_SUCCESS) { + if (attr->errfn) { + attr->errfn(pool, rv, + apr_pstrcat(pool, + "utf8 to ucs2 conversion failed" + " on currdir: ", attr->currdir, NULL)); + } return rv; } } From 1a9cd8d9c5a869e0fba332edc1961362eb994fff Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 24 Aug 2004 20:01:11 +0000 Subject: [PATCH 5157/7878] Remove the 1.1 changes from this file for the RC6 T&R Happy Jo? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65308 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/CHANGES b/CHANGES index 70a71eb2df5..04a92d3ff7b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,18 +1,3 @@ -Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] - - *) Improve apr_file_gets() performance on buffered files. [Justin Erenkrantz] - - *) Win32: Fix bug in apr_socket_sendfile that interferred with - Win32 LSPs. PR 23982 [Jan Bilek, Bill Stoddard] - - *) Add a new PRNG. Note that the implementation of SHA-256 is a - stop-gap pending snarfing the SHA-1 implementation from apr-util - and upgrading it to do SHA-256. Not yet ready for prime time. - [Ben Laurie] - - *) Win32: Fix bug tracking the file pointer on a file opened for - overlapped/APR_XTHREAD io. [Bill Stoddard] - Changes with APR 1.0 *) Only install apr-$MAJOR-config and add appropriate detection code to From d44482213ebd10f79553cd47c4ec40b3edf0f58a Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 24 Aug 2004 20:01:58 +0000 Subject: [PATCH 5158/7878] "And as if by magic the shop keeper appeared" git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65311 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGES b/CHANGES index 04a92d3ff7b..70a71eb2df5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,18 @@ +Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] + + *) Improve apr_file_gets() performance on buffered files. [Justin Erenkrantz] + + *) Win32: Fix bug in apr_socket_sendfile that interferred with + Win32 LSPs. PR 23982 [Jan Bilek, Bill Stoddard] + + *) Add a new PRNG. Note that the implementation of SHA-256 is a + stop-gap pending snarfing the SHA-1 implementation from apr-util + and upgrading it to do SHA-256. Not yet ready for prime time. + [Ben Laurie] + + *) Win32: Fix bug tracking the file pointer on a file opened for + overlapped/APR_XTHREAD io. [Bill Stoddard] + Changes with APR 1.0 *) Only install apr-$MAJOR-config and add appropriate detection code to From d442b8298518fddd3f078b6587e6142ce23979b2 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 28 Aug 2004 16:17:35 +0000 Subject: [PATCH 5159/7878] * build/apr_hints.m4 (APR_PRELOAD): Override the test for O_NONBLOCK inheritance on OpenBSD since binding to an ephemeral port fails on that platform. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65314 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 5aa03c95205..edd5f9770f2 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -131,6 +131,9 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-openbsd*) APR_ADDTO(CPPFLAGS, [-D_POSIX_THREADS]) + # binding to an ephemeral port fails on OpenBSD so override + # the test for O_NONBLOCK inheritance across accept(). + APR_SETIFNULL(ac_cv_o_nonblock_inherited, [yes]) ;; *-netbsd*) APR_ADDTO(CPPFLAGS, [-DNETBSD]) From e65893b9c5386b6933556326b3550fafdf88c951 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Thu, 2 Sep 2004 03:49:03 +0000 Subject: [PATCH 5160/7878] :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65323 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 1dd148758e4..472fe689e64 100644 --- a/STATUS +++ b/STATUS @@ -1,11 +1,10 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2004/06/30 11:29:48 $] +Last modified at [$Date: 2004/09/02 03:49:03 $] Releases: Standalone - 1.0.0 rc2 : tagged June 30th 2004 (APR_1_0_RC2) - 1.0.0 rc1 : tagged June 18th 2004 (APR_1_0_RC1) + 1.0.0 : released September 1, 2004 0.9.3 : tagged March 30, 2003 0.9.2 : released March 22, 2003 0.9.1 : released September 11, 2002 From 75fc4087ac0aa6843367c8f5eef159deb16ae432 Mon Sep 17 00:00:00 2001 From: Jean-Jacques Clar Date: Thu, 2 Sep 2004 20:48:05 +0000 Subject: [PATCH 5161/7878] Fixed apr_atomic_dec on NetWare to be thread safe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65325 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/netware/apr_atomic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index 17ffe14d515..069b1bd1672 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -60,8 +60,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) { - atomic_dec((unsigned long *)mem); - return *mem; + return (atomic_xchgadd((unsigned long *)mem, 0xFFFFFFFF) - 1); } APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) From 411333d02436f05f826b914dbbcf067cd1fd1ed0 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 9 Sep 2004 15:42:02 +0000 Subject: [PATCH 5162/7878] As per 0.9 branch: * misc/unix/errorcodes.c (native_strerror): Gracefully handle strerror() returning NULL on Solaris. * test/teststr.c (string_error): Throw some randomish numbers at apr_strerror to check for robustness. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65327 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 8 +++++++- test/teststr.c | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 447b8d85908..5c318d5306e 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -374,7 +374,13 @@ static char *native_strerror(apr_status_t statcode, char *buf, sprintf(err, "Native Error #%d", statcode); return stuffbuffer(buf, bufsize, err); #else - return stuffbuffer(buf, bufsize, strerror(statcode)); + const char *err = strerror(statcode); + if (err) { + return stuffbuffer(buf, bufsize, err); + } else { + return stuffbuffer(buf, bufsize, + "APR does not understand this error code"); + } #endif } #endif diff --git a/test/teststr.c b/test/teststr.c index 2121da41ab5..99aa8af4164 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -150,6 +150,7 @@ static void snprintf_underflow(abts_case *tc, void *data) static void string_error(abts_case *tc, void *data) { char buf[128], *rv; + apr_status_t n; buf[0] = '\0'; rv = apr_strerror(APR_ENOENT, buf, sizeof buf); @@ -159,6 +160,11 @@ static void string_error(abts_case *tc, void *data) rv = apr_strerror(APR_TIMEUP, buf, sizeof buf); ABTS_PTR_EQUAL(tc, buf, rv); ABTS_STR_EQUAL(tc, "The timeout specified has expired", buf); + + /* throw some randomish numbers at it to check for robustness */ + for (n = 1; n < 1000000; n *= 2) { + apr_strerror(n, buf, sizeof buf); + } } #define SIZE 180000 From 82e01183c66178e7cfbc937e4880e4bad5b440c7 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 13 Sep 2004 11:21:03 +0000 Subject: [PATCH 5163/7878] * atomic/unix/apr_atomic.c: Force use of generic atomics if gcc defines __STRICT_ANSI__ (e.g. with -std=c89), since inline asm is not supported in that case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65328 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 5827ba091ae..bf457c1ea9b 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -21,6 +21,12 @@ #include +#if defined(__GNUC__) && defined(__STRICT_ANSI__) && !defined(USE_GENERIC_ATOMICS) +/* force use of generic atomics if building e.g. with -std=c89, which + * doesn't allow inline asm */ +#define USE_GENERIC_ATOMICS +#endif + #if (defined(__i386__) || defined(__x86_64__)) \ && defined(__GNUC__) && !defined(USE_GENERIC_ATOMICS) From e90095ff9d4ccadd05fd9bddcfe510fc28bc61b8 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Fri, 17 Sep 2004 11:09:40 +0000 Subject: [PATCH 5164/7878] Strange... That is too late to test for dry_run after ranlib. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65330 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index 6b1c35d692a..ff76777ba20 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -1349,9 +1349,6 @@ int run_mode(command_t *cmd_data) lib_args[2] = NULL; external_spawn(cmd_data, RANLIB, lib_args); #endif - if (!cmd_data->options.dry_run) { - //link( - } } if (cmd_data->output == otDynamicLibraryOnly || From 0a0ee1d7be871257fce74e86f17363024a0df3bb Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Fri, 17 Sep 2004 15:47:43 +0000 Subject: [PATCH 5165/7878] SHARED_OPTS are the options to give to the compile to get a shared library. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65331 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index ff76777ba20..96d6d74f23d 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -80,7 +80,7 @@ # define RANLIB "ranlib" # define PIC_FLAG "-fPIC" # define RPATH "-rpath" -# define DYNAMIC_LINK_OPTS "-shared" +# define SHARED_OPTS "-shared" # define LINKER_FLAG_PREFIX "-Wl," #endif @@ -92,7 +92,7 @@ # define OBJECT_EXT "o" # define LIBRARIAN "ar" # define LIBRARIAN_OPTS "cr" -# define DYNAMIC_LINK_OPTS "-G" +# define SHARED_OPTS "-G" # define LINKER_FLAG_PREFIX "-Wl," # define NEED_SNPRINTF #endif From ca2f428ed52a33ab08fd2daa485de12cd43a428f Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Fri, 17 Sep 2004 16:47:24 +0000 Subject: [PATCH 5166/7878] Add options to build modules. Note that on moof cc does not pass correctly the -bundle option... May be ld has to be called directly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65332 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/jlibtool.c b/build/jlibtool.c index 96d6d74f23d..dba70ed9820 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -81,6 +81,7 @@ # define PIC_FLAG "-fPIC" # define RPATH "-rpath" # define SHARED_OPTS "-shared" +# define MODULE_OPTS "-shared" # define LINKER_FLAG_PREFIX "-Wl," #endif @@ -93,6 +94,7 @@ # define LIBRARIAN "ar" # define LIBRARIAN_OPTS "cr" # define SHARED_OPTS "-G" +# define MODULE_OPTS "-G" # define LINKER_FLAG_PREFIX "-Wl," # define NEED_SNPRINTF #endif From b0b4d36b2830af8c7ee1d0a4e6e181dd5451a2c9 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 19 Sep 2004 17:44:17 +0000 Subject: [PATCH 5167/7878] The apr/test/Makefile.win is missing a target to build a readchild.exe that test is depending on but is never built. PR: Obtained from: Submitted by: mturk Reviewed by: wrowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65333 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ test/Makefile.win | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 70a71eb2df5..d2b7313108b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] + *) The apr/test/Makefile.win is missing a target to build a + readchild.exe that test is depending on but is never built. + [Mladen Turk] + *) Improve apr_file_gets() performance on buffered files. [Justin Erenkrantz] *) Win32: Fix bug in apr_socket_sendfile that interferred with diff --git a/test/Makefile.win b/test/Makefile.win index 2772edff184..7e5644e9b14 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -6,7 +6,8 @@ PROGRAMS = \ sendfile.exe \ proc_child.exe \ tryread.exe \ - occhild.exe\ + occhild.exe \ + readchild.exe \ sockchild.exe \ testlockperf.exe \ testshmproducer.exe \ @@ -40,6 +41,9 @@ tryread.exe: tryread.obj $(LOCAL_LIBS) occhild.exe: occhild.obj $(LOCAL_LIBS) $(LINK) occhild.obj $(LOCAL_LIBS) $(ALL_LIBS) +readchild.exe: readchild.obj $(LOCAL_LIBS) + $(LINK) readchild.obj $(LOCAL_LIBS) $(ALL_LIBS) + proc_child.exe: proc_child.obj $(LOCAL_LIBS) $(LINK) /debug /subsystem:console /machine:I386 \ proc_child.obj $(LOCAL_LIBS) $(ALL_LIBS) From 22dc2231c421314290238723166d43b4fe17293a Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 19 Sep 2004 19:15:12 +0000 Subject: [PATCH 5168/7878] Makes the threads to behave like on posix. If the thread is created without APR_DETACH expect that the thread_join will be called, so don't close the handle in advance, if the thread has already finished. PR: Obtained from: Submitted by: mturk Reviewed by: wrowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65335 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ threadproc/win32/thread.c | 39 +++++++++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/CHANGES b/CHANGES index d2b7313108b..90a429fba5c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] + *) Makes the threads to behave like on posix. If the thread is created + without APR_DETACH expect that the thread_join will be called, so don't + close the handle in advance, if the thread has already finished. + [Mladen Turk] + *) The apr/test/Makefile.win is missing a target to build a readchild.exe that test is depending on but is never built. [Mladen Turk] diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 364d23274be..95132cb4b52 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -85,6 +85,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, { apr_status_t stat; unsigned temp; + HANDLE handle; (*new) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t)); @@ -95,7 +96,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, (*new)->pool = pool; (*new)->data = data; (*new)->func = func; - + (*new)->td = NULL; stat = apr_pool_create(&(*new)->pool, pool); if (stat != APR_SUCCESS) { return stat; @@ -105,14 +106,14 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, * same size as the calling thread. */ #ifndef _WIN32_WCE - if (((*new)->td = (HANDLE)_beginthreadex(NULL, + if ((handle = (HANDLE)_beginthreadex(NULL, attr && attr->stacksize > 0 ? attr->stacksize : 0, (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker, (*new), 0, &temp)) == 0) { return APR_FROM_OS_ERROR(_doserrno); } #else - if (((*new)->td = CreateThread(NULL, + if ((handle = CreateThread(NULL, attr && attr->stacksize > 0 ? attr->stacksize : 0, (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker, (*new), 0, &temp)) == 0) { @@ -120,9 +121,10 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, } #endif if (attr && attr->detach) { - CloseHandle((*new)->td); - (*new)->td = NULL; + CloseHandle(handle); } + else + (*new)->td = handle; return APR_SUCCESS; } @@ -132,10 +134,8 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, { thd->exitval = retval; apr_pool_destroy(thd->pool); + thd->pool = NULL; #ifndef _WIN32_WCE - if (thd->td) { - CloseHandle(thd->td); - } _endthreadex(0); #else ExitThread(0); @@ -146,15 +146,26 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { - apr_status_t rv; - + apr_status_t rv = APR_SUCCESS; + + if (!thd->td) { + /* Can not join on detached threads */ + return APR_DETACH; + } rv = WaitForSingleObject(thd->td, INFINITE); if ( rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) { - *retval = thd->exitval; - return APR_SUCCESS; + /* If the thread_exit has been called */ + if (!thd->pool) + *retval = thd->exitval; + else + rv = APR_INCOMPLETE; } - /* Wait failed */ - return apr_get_os_error();; + else + rv = apr_get_os_error(); + CloseHandle(thd->td); + thd->td = NULL; + + return rv; } APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) From 6110653a34e09a8db6f9dcb38992ce570a24815b Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" Date: Mon, 20 Sep 2004 19:20:12 +0000 Subject: [PATCH 5169/7878] WIN64: avoid unresolved external error with 64 bit build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65336 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/win32/apr_atomic.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index d83d60c89d8..b42a2028ee3 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -40,7 +40,11 @@ typedef WINBASEAPI void * (WINAPI * apr_atomic_win32_ptr_ptr_ptr_fn) APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { +#if (defined(_M_IA64) || defined(_M_AMD64)) + return InterlockedExchangeAdd(mem, val); +#else return ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val); +#endif } /* Of course we want the 2's compliment of the unsigned value, val */ @@ -48,7 +52,11 @@ APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint3 APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) { +#if (defined(_M_IA64) || defined(_M_AMD64)) + InterlockedExchangeAdd(mem, -val); +#else ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, -val); +#endif } APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) From 3d97d844e4f5ca36984df48c60a4a5cbc3e54646 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 21 Sep 2004 15:02:00 +0000 Subject: [PATCH 5170/7878] * shmem/unix/shm.c (apr_shm_remove): Ensure that the file is removed even if the shm segment has already been destroyed; close the file before returning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65337 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index ec6e2b41f02..db0dc5e7972 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -385,20 +385,28 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, * exist before calling ftok(). */ shmkey = ftok(filename, 1); if (shmkey == (key_t)-1) { - return errno; + goto shm_remove_failed; } + apr_file_close(file); + if ((shmid = shmget(shmkey, 0, SHM_R | SHM_W)) < 0) { - return errno; + goto shm_remove_failed; } /* Indicate that the segment is to be destroyed as soon * as all processes have detached. This also disallows any * new attachments to the segment. */ if (shmctl(shmid, IPC_RMID, NULL) == -1) { - return errno; + goto shm_remove_failed; } return apr_file_remove(filename, pool); + +shm_remove_failed: + status = errno; + /* ensure the file has been removed anyway. */ + apr_file_remove(filename, pool); + return status; #endif /* No support for anonymous shm */ From b2194c6ac653d2bdf6efa21a1f817c1540c728e5 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 21 Sep 2004 19:52:46 +0000 Subject: [PATCH 5171/7878] Fix VPATH install broken in 1.108. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65338 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 4397c96fcb7..0c29cba8a8f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -76,7 +76,7 @@ install: $(TARGET_LIB) apr-config.out build/apr_rules.out for f in libtool shlibtool; do \ if test -f $${f}; then $(INSTALL) -m 755 $${f} $(DESTDIR)$(installbuilddir); fi; \ done - $(INSTALL) -m 755 build/mkdir.sh $(DESTDIR)$(installbuilddir) + $(INSTALL) -m 755 $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(installbuilddir) for f in make_exports.awk make_var_export.awk; do \ $(INSTALL_DATA) $(top_srcdir)/build/$${f} $(DESTDIR)$(installbuilddir); \ done From 4b093173660f80387071d243c2ecf5918ab02176 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 22 Sep 2004 09:02:53 +0000 Subject: [PATCH 5172/7878] * include/apr_shm.h: Document alignment guarantee from apr_shm_baseaddr_get(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65339 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_shm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr_shm.h b/include/apr_shm.h index 64dbafe1bcd..88d184b0e2e 100644 --- a/include/apr_shm.h +++ b/include/apr_shm.h @@ -114,6 +114,7 @@ APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m); * processes will maintain the same address mapping. * @param m The shared memory segment from which to retrieve * the base address. + * @return address, aligned by APR_ALIGN_DEFAULT. */ APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m); From f455d0f6b6c423e9a0c36e90e9c361af7b45abc8 Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" Date: Wed, 22 Sep 2004 18:21:30 +0000 Subject: [PATCH 5173/7878] WIN64: first in a series to get Windows IA64 builds clean, this serves pages git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65340 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 4 +- file_io/win32/open.c | 4 +- file_io/win32/readwrite.c | 51 ++++++++++++++++------ include/apr.hw | 4 +- network_io/win32/sendrecv.c | 86 ++++++++++++++++++++++++++----------- 5 files changed, 106 insertions(+), 43 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index ab2d080472b..19fe15e8cf1 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -49,7 +49,7 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, { apr_status_t rv; - int len = strlen(dirname); + apr_size_t len = strlen(dirname); (*new) = apr_pcalloc(pool, sizeof(apr_dir_t)); /* Leave room here to add and pop the '*' wildcard for FindFirstFile * and double-null terminate so we have one character to change. @@ -243,7 +243,7 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, #else char fspec[APR_PATH_MAX]; #endif - int dirlen = strlen(thedir->dirname); + apr_size_t dirlen = strlen(thedir->dirname); if (dirlen >= sizeof(fspec)) dirlen = sizeof(fspec) - 1; apr_cpystrn(fspec, thedir->dirname, sizeof(fspec)); diff --git a/file_io/win32/open.c b/file_io/win32/open.c index e937801f8a3..973cf3bf508 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -47,7 +47,7 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, * Note that the \\?\ form only works for local drive paths, and * \\?\UNC\ is needed UNC paths. */ - int srcremains = strlen(srcstr) + 1; + apr_size_t srcremains = strlen(srcstr) + 1; apr_wchar_t *t = retstr; apr_status_t rv; @@ -101,7 +101,7 @@ apr_status_t unicode_to_utf8_path(char* retstr, apr_size_t retlen, * then transform \\'s back into /'s since the \\?\ form never * allows '/' path seperators, and APR always uses '/'s. */ - int srcremains = wcslen(srcstr) + 1; + apr_size_t srcremains = wcslen(srcstr) + 1; apr_status_t rv; char *t = retstr; if (srcstr[0] == L'\\' && srcstr[1] == L'\\' && diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index b8a5e4be80a..4062969b5e9 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -27,9 +27,10 @@ * read_with_timeout() * Uses async i/o to emulate unix non-blocking i/o with timeouts. */ -static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t len, apr_size_t *nbytes) +static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t len_in, apr_size_t *nbytes) { apr_status_t rv; + DWORD len = (DWORD)len_in; *nbytes = 0; /* Handle the zero timeout non-blocking case */ @@ -68,7 +69,8 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le file->pOverlapped->OffsetHigh = (DWORD)(file->filePtr >> 32); } - rv = ReadFile(file->filehand, buf, len, nbytes, file->pOverlapped); + *nbytes = 0; + rv = ReadFile(file->filehand, buf, len, (LPDWORD)nbytes, file->pOverlapped); if (!rv) { rv = apr_get_os_error(); @@ -85,7 +87,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le switch (rv) { case WAIT_OBJECT_0: GetOverlappedResult(file->filehand, file->pOverlapped, - nbytes, TRUE); + (LPDWORD)nbytes, TRUE); rv = APR_SUCCESS; break; case WAIT_TIMEOUT: @@ -286,7 +288,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a thefile->pOverlapped->Offset = (DWORD)thefile->filePtr; thefile->pOverlapped->OffsetHigh = (DWORD)(thefile->filePtr >> 32); } - rv = WriteFile(thefile->filehand, buf, *nbytes, &bwrote, + rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote, thefile->pOverlapped); if (thefile->append) { apr_file_unlock(thefile); @@ -294,7 +296,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } } else { - rv = WriteFile(thefile->filehand, buf, *nbytes, &bwrote, + rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote, thefile->pOverlapped); } if (rv) { @@ -309,7 +311,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = WaitForSingleObject(thefile->pOverlapped->hEvent, INFINITE); switch (rv) { case WAIT_OBJECT_0: - GetOverlappedResult(thefile->filehand, thefile->pOverlapped, nbytes, TRUE); + GetOverlappedResult(thefile->filehand, thefile->pOverlapped, (LPDWORD)nbytes, TRUE); rv = APR_SUCCESS; break; case WAIT_TIMEOUT: @@ -343,7 +345,7 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, { apr_status_t rv = APR_SUCCESS; apr_size_t i; - DWORD bwrote = 0; + apr_size_t bwrote = 0; char *buf; *nbytes = 0; @@ -361,7 +363,7 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile) { - DWORD len = 1; + apr_size_t len = 1; return apr_file_write(thefile, &ch, &len); } @@ -375,7 +377,7 @@ APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile) APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile) { apr_status_t rc; - int bread; + apr_size_t bread; bread = 1; rc = apr_file_read(thefile, ch, &bread); @@ -393,7 +395,7 @@ APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile) APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile) { - DWORD len = strlen(str); + apr_size_t len = strlen(str); return apr_file_write(thefile, str, &len); } @@ -431,13 +433,34 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) { if (thefile->buffered) { - DWORD written = 0; + DWORD numbytes, written = 0; apr_status_t rc = 0; + char *buffer; + apr_size_t bytesleft; if (thefile->direction == 1 && thefile->bufpos) { - if (!WriteFile(thefile->filehand, thefile->buffer, thefile->bufpos, &written, NULL)) - rc = apr_get_os_error(); - thefile->filePtr += written; + buffer = thefile->buffer; + bytesleft = thefile->bufpos; + + do { + if (bytesleft > DWORD_MAX) { + numbytes = DWORD_MAX; + } + else { + numbytes = (DWORD)bytesleft; + } + + if (!WriteFile(thefile->filehand, buffer, numbytes, &written, NULL)) { + rc = apr_get_os_error(); + thefile->filePtr += written; + break; + } + + thefile->filePtr += written; + bytesleft -= written; + buffer += written; + + } while (bytesleft > 0); if (rc == 0) thefile->bufpos = 0; diff --git a/include/apr.hw b/include/apr.hw index 53ee01137bd..372008338af 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -342,6 +342,8 @@ typedef int apr_socklen_t; #define APR_SIZEOF_VOIDP 4 #endif +#define DWORD_MAX 4294967295 + /* XXX These simply don't belong here, perhaps in apr_portable.h * based on some APR_HAVE_PID/GID/UID? */ @@ -363,7 +365,7 @@ typedef int gid_t; #endif #ifndef WS2TCPIP_INLINE -6:09 PM 11/16/2003#define IN6_IS_ADDR_V4MAPPED(a) \ +#define IN6_IS_ADDR_V4MAPPED(a) \ ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \ && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) #endif diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index d7a68cd9cb4..80297992aad 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -43,7 +43,7 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, int lasterror; DWORD dwBytes = 0; - wsaData.len = *len; + wsaData.len = (u_long)*len; wsaData.buf = (char*) buf; #ifndef _WIN32_WCE @@ -72,7 +72,7 @@ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, DWORD dwBytes = 0; DWORD flags = 0; - wsaData.len = *len; + wsaData.len = (u_long)*len; wsaData.buf = (char*) buf; #ifndef _WIN32_WCE @@ -94,21 +94,49 @@ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, const struct iovec *vec, - apr_int32_t nvec, apr_size_t *nbytes) + apr_int32_t in_vec, apr_size_t *nbytes) { apr_status_t rc = APR_SUCCESS; apr_ssize_t rv; - int i; + apr_size_t cur_len; + apr_int32_t nvec = 0; + int i, j = 0; DWORD dwBytes = 0; - WSABUF *pWsaBuf = (nvec <= WSABUF_ON_STACK) ? _alloca(sizeof(WSABUF) * (nvec)) - : malloc(sizeof(WSABUF) * (nvec)); + WSABUF *pWsaBuf; + + for (i = 0; i < in_vec; i++) { + cur_len = vec[i].iov_len; + nvec++; + while (cur_len > DWORD_MAX) { + nvec++; + cur_len -= DWORD_MAX; + } + } + pWsaBuf = (nvec <= WSABUF_ON_STACK) ? _alloca(sizeof(WSABUF) * (nvec)) + : malloc(sizeof(WSABUF) * (nvec)); if (!pWsaBuf) return APR_ENOMEM; - for (i = 0; i < nvec; i++) { - pWsaBuf[i].buf = vec[i].iov_base; - pWsaBuf[i].len = vec[i].iov_len; + for (i = 0; i < in_vec; i++) { + char * base = vec[i].iov_base; + cur_len = vec[i].iov_len; + + do { + if (cur_len > DWORD_MAX) { + pWsaBuf[j].buf = base; + pWsaBuf[j].len = DWORD_MAX; + cur_len -= DWORD_MAX; + base += DWORD_MAX; + } + else { + pWsaBuf[j].buf = base; + pWsaBuf[j].len = (DWORD)cur_len; + cur_len = 0; + } + j++; + + } while (cur_len > 0); } #ifndef _WIN32_WCE rv = WSASend(sock->socketdes, pWsaBuf, nvec, &dwBytes, 0, NULL, NULL); @@ -140,7 +168,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, { apr_ssize_t rv; - rv = sendto(sock->socketdes, buf, (*len), flags, + rv = sendto(sock->socketdes, buf, (int)*len, flags, (const struct sockaddr*)&where->sa, where->salen); if (rv == SOCKET_ERROR) { @@ -160,7 +188,7 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, { apr_ssize_t rv; - rv = recvfrom(sock->socketdes, buf, (*len), flags, + rv = recvfrom(sock->socketdes, buf, (int)*len, flags, (struct sockaddr*)&from->sa, &from->salen); if (rv == SOCKET_ERROR) { (*len) = 0; @@ -225,13 +253,13 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, apr_int32_t flags) { apr_status_t status = APR_SUCCESS; - apr_ssize_t rv; + apr_status_t rv; apr_off_t curoff = *offset; DWORD dwFlags = 0; - DWORD nbytes; + apr_size_t nbytes; TRANSMIT_FILE_BUFFERS tfb, *ptfb = NULL; int ptr = 0; - int bytes_to_send; /* Bytes to send out of the file (not including headers) */ + apr_size_t bytes_to_send; /* Bytes to send out of the file (not including headers) */ int disconnected = 0; int sendv_trailers = 0; char hdtrbuf[4096]; @@ -267,11 +295,15 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, /* Collapse the headers into a single buffer */ if (hdtr && hdtr->numheaders) { + apr_size_t head_length = tfb.HeadLength; ptfb = &tfb; nbytes = 0; - rv = collapse_iovec((char **)&ptfb->Head, &ptfb->HeadLength, + rv = collapse_iovec((char **)&ptfb->Head, &head_length, hdtr->headers, hdtr->numheaders, hdtrbuf, sizeof(hdtrbuf)); + + tfb.HeadLength = (DWORD)head_length; + /* If not enough buffer, punt to sendv */ if (rv == APR_INCOMPLETE) { rv = apr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, &nbytes); @@ -289,19 +321,25 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, sock->overlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); } while (bytes_to_send) { + DWORD xmitbytes; + if (bytes_to_send > MAX_SEGMENT_SIZE) { - nbytes = MAX_SEGMENT_SIZE; + xmitbytes = MAX_SEGMENT_SIZE; } else { /* Last call to TransmitFile() */ - nbytes = bytes_to_send; + xmitbytes = (DWORD)bytes_to_send; /* Collapse the trailers into a single buffer */ if (hdtr && hdtr->numtrailers) { + apr_size_t tail_length = tfb.TailLength; ptfb = &tfb; - rv = collapse_iovec((char**) &ptfb->Tail, &ptfb->TailLength, + rv = collapse_iovec((char**) &ptfb->Tail, &tail_length, hdtr->trailers, hdtr->numtrailers, hdtrbuf + ptfb->HeadLength, sizeof(hdtrbuf) - ptfb->HeadLength); + + tfb.TailLength = (DWORD)tail_length; + if (rv == APR_INCOMPLETE) { /* If not enough buffer, punt to sendv, later */ sendv_trailers = 1; @@ -323,7 +361,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, /* XXX BoundsChecker claims dwFlags must not be zero. */ rv = TransmitFile(sock->socketdes, /* socket */ file->filehand, /* open file descriptor of the file to be sent */ - nbytes, /* number of bytes to send. 0=send all */ + xmitbytes, /* number of bytes to send. 0=send all */ 0, /* Number of bytes per send. 0=use default */ sock->overlapped, /* OVERLAPPED structure */ ptfb, /* header and trailer buffers */ @@ -341,7 +379,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, if (!disconnected) { if (!WSAGetOverlappedResult(sock->socketdes, sock->overlapped, - &nbytes, + &xmitbytes, FALSE, &dwFlags)) { status = apr_get_netos_error(); @@ -351,7 +389,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, * tracks bytes sent out of the file. */ else if (ptfb) { - nbytes -= (ptfb->HeadLength + ptfb->TailLength); + xmitbytes -= (ptfb->HeadLength + ptfb->TailLength); } } } @@ -374,9 +412,9 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, if (status != APR_SUCCESS) break; - bytes_to_send -= nbytes; - curoff += nbytes; - *len += nbytes; + bytes_to_send -= xmitbytes; + curoff += xmitbytes; + *len += xmitbytes; /* Adjust len for any headers/trailers sent */ if (ptfb) { *len += (ptfb->HeadLength + ptfb->TailLength); From 157803c9c9c11f156a16c9bf0ace434d30ee736e Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 23 Sep 2004 06:22:48 +0000 Subject: [PATCH 5174/7878] Fix obtaining security info on files for NT+. The current implementation works only with directories, but for files we need the READ_CONTROL open flag. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65343 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 973cf3bf508..1b950fc210b 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -324,6 +324,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, else { return APR_EACCES; } + if (flag & APR_READCONTROL) + oflags |= READ_CONTROL; } if (flag & APR_XTHREAD) { From c22c216dc6eaa79eb9d5720004a144c48709da75 Mon Sep 17 00:00:00 2001 From: Jean-Jacques Clar Date: Fri, 24 Sep 2004 16:33:03 +0000 Subject: [PATCH 5175/7878] added define for DWORD_MAX git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65348 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr.hnw b/include/apr.hnw index 13a84e6d27c..1fab3814f93 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -330,6 +330,7 @@ typedef int apr_wait_t; #define APR_UINT64_T_HEX_FMT "llx" #define APR_TIME_T_FMT APR_INT64_T_FMT +#define DWORD_MAX 4294967295 /* 2^32*/ /** @} */ #ifdef __cplusplus From b059eb204e10a3f002b37897016f6c43fee41673 Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Fri, 24 Sep 2004 23:18:06 +0000 Subject: [PATCH 5176/7878] fix apr_file_dup and apr_file_dup2 win32 implementations to create a mutex PR: Obtained from: Submitted by: Steve Hay Reviewed by: stas git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65350 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/win32/filedup.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGES b/CHANGES index 90a429fba5c..5819235645e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.] + *) fix apr_file_dup and apr_file_dup2 win32 implementations + to create a mutex [Steve Hay ] + *) Makes the threads to behave like on posix. If the thread is created without APR_DETACH expect that the thread_join will be called, so don't close the handle in advance, if the thread has already finished. diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 57c57ea0230..63aa250891a 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -44,6 +44,13 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, (*new_file)->buffered = FALSE; (*new_file)->ungetchar = old_file->ungetchar; +#if APR_HAS_THREADS + if (old_file->mutex) { + apr_thread_mutex_create(&((*new_file)->mutex), + APR_THREAD_MUTEX_DEFAULT, p); + } +#endif + apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), file_cleanup, apr_pool_cleanup_null); @@ -118,6 +125,13 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, new_file->buffered = FALSE; new_file->ungetchar = old_file->ungetchar; +#if APR_HAS_THREADS + if (old_file->mutex) { + apr_thread_mutex_create(&(new_file->mutex), + APR_THREAD_MUTEX_DEFAULT, p); + } +#endif + return APR_SUCCESS; #endif /* !defined(_WIN32_WCE) */ } From 48dea1ab505dbee18acfd5bcb88e8fc6bdfac3de Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 27 Sep 2004 10:43:13 +0000 Subject: [PATCH 5177/7878] Relicense. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65351 13f79535-47bb-0310-9956-ffa450edef68 --- test/testrand2.c | 59 ++++++++---------------------------------------- 1 file changed, 10 insertions(+), 49 deletions(-) diff --git a/test/testrand2.c b/test/testrand2.c index 2d2e8a625f6..8d5b7b07c1b 100644 --- a/test/testrand2.c +++ b/test/testrand2.c @@ -1,55 +1,16 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 +/* Copyright 2000-2004 The Apache Software Foundation * - * Copyright (c) 2000-2003 The Apache Software Foundation. All rights - * reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include "apr_general.h" From 7fc3e0572fbb99b29be6f0ad3697b7dae887bdc7 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Mon, 27 Sep 2004 16:21:16 +0000 Subject: [PATCH 5178/7878] Use -L path -llib_name instead of path/"lib"lib_name."ext". That is still not ok because httpd would need something like: -Brpath=pathname or -Wl,-Brpath-pathname but we only have this information when building the library (when libtool is called with -rpath pathname). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65352 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 63 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 10 deletions(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index dba70ed9820..1cdb1ace3ea 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -83,6 +83,7 @@ # define SHARED_OPTS "-shared" # define MODULE_OPTS "-shared" # define LINKER_FLAG_PREFIX "-Wl," +# define ADD_MINUS_L #endif #if defined(_OSD_POSIX) @@ -142,6 +143,14 @@ enum pic_mode_e { pic_AVOID, }; +enum lib_type { + type_UNKNOWN, + type_DYNAMIC_LIB, + type_STATIC_LIB, + type_MODULE_LIB, + type_OBJECT, +}; + typedef struct { const char **vals; int num; @@ -653,7 +662,7 @@ char *check_object_exists(command_t *cmd, const char *arg, int arglen) } if (!cmd->options.silent) { - printf("Checking: %s\n", newarg); + printf("Checking (obj): %s\n", newarg); } rv = stat(newarg, &sb); } @@ -674,7 +683,7 @@ char *check_object_exists(command_t *cmd, const char *arg, int arglen) * 1 - .libs suffix */ char *check_library_exists(command_t *cmd, const char *arg, int pathlen, - int libdircheck) + int libdircheck, enum lib_type *libtype) { char *newarg, *ext; int pass, rv, newpathlen; @@ -701,24 +710,29 @@ char *check_library_exists(command_t *cmd, const char *arg, int pathlen, case 0: if (cmd->options.pic_mode != pic_AVOID || cmd->options.shared) { strcpy(ext, DYNAMIC_LIB_EXT); + *libtype = type_DYNAMIC_LIB; break; } pass = 1; case 1: strcpy(ext, STATIC_LIB_EXT); + *libtype = type_STATIC_LIB; break; case 2: strcpy(ext, MODULE_LIB_EXT); + *libtype = type_MODULE_LIB; break; case 3: strcpy(ext, OBJECT_EXT); + *libtype = type_OBJECT; break; default: + *libtype = type_UNKNOWN; break; } if (!cmd->options.silent) { - printf("Checking: %s\n", newarg); + printf("Checking (lib): %s\n", newarg); } rv = stat(newarg, &sb); } @@ -731,6 +745,27 @@ char *check_library_exists(command_t *cmd, const char *arg, int pathlen, return NULL; } +/* use -L -llibname to allow to use installed libraries */ +void add_minus_l(count_chars *cc, const char *arg) +{ + char *name = strrchr(arg, '/'); + char *file = strrchr(arg, '.'); + char *lib = strstr(name, "lib"); + + if (name !=NULL && file != NULL && lib == name+1) { + *name = '\0'; + *file = '\0'; + file = name; + file = file+4; + push_count_chars(cc, "-L "); + push_count_chars(cc, arg); + push_count_chars(cc, "-l"); + push_count_chars(cc, file); + } else { + push_count_chars(cc, arg); + } +} + void add_linker_flag_prefix(count_chars *cc, const char *arg) { #ifndef LINKER_FLAG_PREFIX @@ -749,6 +784,7 @@ int parse_input_file_name(char *arg, command_t *cmd_data) char *ext = strrchr(arg, '.'); char *name = strrchr(arg, '/'); int pathlen; + enum lib_type libtype; char *newarg; if (!ext) { @@ -790,22 +826,29 @@ int parse_input_file_name(char *arg, command_t *cmd_data) switch (cmd_data->mode) { case mLink: /* Try the .libs dir first! */ - newarg = check_library_exists(cmd_data, arg, pathlen, 1); + newarg = check_library_exists(cmd_data, arg, pathlen, 1, &libtype); if (!newarg) { /* Try the normal dir next. */ - newarg = check_library_exists(cmd_data, arg, pathlen, 0); + newarg = check_library_exists(cmd_data, arg, pathlen, 0, &libtype); if (!newarg) { printf("Can not find suitable library for %s\n", arg); exit(1); } } - if (cmd_data->mode != mLink) { - push_count_chars(cmd_data->arglist, newarg); - } - else { - push_count_chars(cmd_data->shared_opts.dependencies, newarg); + /* It is not ok to just add the file: a library may added with: + 1 - -L path library_name. (For *.so in Linux). + 2 - library_name. + */ +#ifdef ADD_MINUS_L + if (libtype == type_DYNAMIC_LIB) { + add_minus_l(cmd_data->shared_opts.dependencies, newarg); + } else { + push_count_chars(cmd_data->shared_opts.dependencies, newarg); } +#else + push_count_chars(cmd_data->shared_opts.dependencies, newarg); +#endif break; case mInstall: /* If we've already recorded a library to install, we're most From fef785abb9654066673e85ed00bcf80715ea2d78 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Tue, 28 Sep 2004 14:22:40 +0000 Subject: [PATCH 5179/7878] Arrange rpath handling. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65353 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index 1cdb1ace3ea..cb6ebc13779 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -66,7 +66,7 @@ # define DYNAMIC_LINK_OPTS "-flat_namespace -undefined suppress" # define dynamic_link_version_func darwin_dynamic_link_function # define DYNAMIC_INSTALL_NAME "-install_name" -//-install_name /Users/jerenk/apache-2.0-cvs/lib/libapr.0.dylib -compatibility_version 1 -current_version 1.0 +/*-install_name /Users/jerenk/apache-2.0-cvs/lib/libapr.0.dylib -compatibility_version 1 -current_version 1.0 */ #endif #if defined(__linux__) || defined(__FreeBSD__) @@ -745,6 +745,51 @@ char *check_library_exists(command_t *cmd, const char *arg, int pathlen, return NULL; } +/* Read the final install location and add it to runtime library search path. */ +#ifdef RPATH +void add_rpath(count_chars *cc, const char *arg) +{ + FILE *f; + char path[256]; + char *tmp; + int size=0; + + f = fopen(arg,"r"); + if (f == NULL) { + return; + } + fgets(path,sizeof(path), f); + fclose(f); + if (path[strlen(path)-1] == '\n') { + path[strlen(path)-1] = '\0'; + } + /* Check that we have an absolut path. + * Otherwise the file could be a GNU libtool file. + */ + if (path[0] != '/') { + return; + } +#ifdef LINKER_FLAG_PREFIX + size = strlen(LINKER_FLAG_PREFIX); +#endif + size = size + strlen(path) + strlen(RPATH) + 2; + tmp = malloc(size); + if (tmp == NULL) { + return; + } +#ifdef LINKER_FLAG_PREFIX + strcpy(tmp, LINKER_FLAG_PREFIX); + strcat(tmp, RPATH); +#else + strcpy(tmp, RPATH); +#endif + strcat(tmp, "="); + strcat(tmp, path); + + push_count_chars(cc, tmp); +} +#endif + /* use -L -llibname to allow to use installed libraries */ void add_minus_l(count_chars *cc, const char *arg) { @@ -848,6 +893,11 @@ int parse_input_file_name(char *arg, command_t *cmd_data) } #else push_count_chars(cmd_data->shared_opts.dependencies, newarg); +#endif +#ifdef RPATH + if (libtype == type_DYNAMIC_LIB) { + add_rpath(cmd_data->shared_opts.dependencies, arg); + } #endif break; case mInstall: @@ -1488,6 +1538,27 @@ int ensure_fake_uptodate(command_t *cmd_data) touch_args[2] = NULL; return external_spawn(cmd_data, "touch", touch_args); } +#ifdef RPATH +/* Store the install path in the *.la file */ +int add_for_runtime(command_t *cmd_data) +{ + if (cmd_data->mode == mInstall) { + return 0; + } + if (cmd_data->output == otDynamicLibraryOnly || + cmd_data->output == otLibrary) { + FILE *f=fopen(cmd_data->fake_output_name,"w"); + if (f == NULL) { + return -1; + } + fprintf(f,"%s\n", cmd_data->install_path); + fclose(f); + return(0); + } else { + return(ensure_fake_uptodate(cmd_data)); + } +} +#endif int main(int argc, char *argv[]) { @@ -1530,7 +1601,11 @@ int main(int argc, char *argv[]) rc = run_mode(&cmd_data); if (!rc) { +#ifdef RPATH + add_for_runtime(&cmd_data); +#else ensure_fake_uptodate(&cmd_data); +#endif } cleanup_tmp_dirs(&cmd_data); From d1c6ef5bb5ff2599ab0162fb147e633ae2025b9e Mon Sep 17 00:00:00 2001 From: Jean-Jacques Clar Date: Tue, 28 Sep 2004 16:16:17 +0000 Subject: [PATCH 5180/7878] replaced define for DWORD_MAX with APR_DWORD_MAX git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65354 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 4 ++-- include/apr.hnw | 2 +- include/apr.hw | 2 +- network_io/win32/sendrecv.c | 12 ++++++------ 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 4062969b5e9..7a593138727 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -443,8 +443,8 @@ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) bytesleft = thefile->bufpos; do { - if (bytesleft > DWORD_MAX) { - numbytes = DWORD_MAX; + if (bytesleft > APR_DWORD_MAX) { + numbytes = APR_DWORD_MAX; } else { numbytes = (DWORD)bytesleft; diff --git a/include/apr.hnw b/include/apr.hnw index 1fab3814f93..2938f8fd1f1 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -330,7 +330,7 @@ typedef int apr_wait_t; #define APR_UINT64_T_HEX_FMT "llx" #define APR_TIME_T_FMT APR_INT64_T_FMT -#define DWORD_MAX 4294967295 /* 2^32*/ +#define APR_DWORD_MAX 4294967295 /* 2^32*/ /** @} */ #ifdef __cplusplus diff --git a/include/apr.hw b/include/apr.hw index 372008338af..b6897525dc7 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -342,7 +342,7 @@ typedef int apr_socklen_t; #define APR_SIZEOF_VOIDP 4 #endif -#define DWORD_MAX 4294967295 +#define APR_DWORD_MAX 4294967295 /* XXX These simply don't belong here, perhaps in apr_portable.h * based on some APR_HAVE_PID/GID/UID? diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 80297992aad..11573fdad57 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -107,9 +107,9 @@ APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, for (i = 0; i < in_vec; i++) { cur_len = vec[i].iov_len; nvec++; - while (cur_len > DWORD_MAX) { + while (cur_len > APR_DWORD_MAX) { nvec++; - cur_len -= DWORD_MAX; + cur_len -= APR_DWORD_MAX; } } @@ -123,11 +123,11 @@ APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, cur_len = vec[i].iov_len; do { - if (cur_len > DWORD_MAX) { + if (cur_len > APR_DWORD_MAX) { pWsaBuf[j].buf = base; - pWsaBuf[j].len = DWORD_MAX; - cur_len -= DWORD_MAX; - base += DWORD_MAX; + pWsaBuf[j].len = APR_DWORD_MAX; + cur_len -= APR_DWORD_MAX; + base += APR_DWORD_MAX; } else { pWsaBuf[j].buf = base; From 1ad84b7df36a8d5c6ea85b253b1d5238c609dffb Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Wed, 29 Sep 2004 14:58:03 +0000 Subject: [PATCH 5181/7878] Add support for ReliantUnix (5.43). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65355 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/build/jlibtool.c b/build/jlibtool.c index cb6ebc13779..fe4d4ac82fc 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -100,6 +100,22 @@ # define NEED_SNPRINTF #endif +#if defined(sinix) && defined(mips) && defined(__SNI_TARG_UNIX) +# define SHELL_CMD "/usr/bin/sh" +# define DYNAMIC_LIB_EXT "so" +# define MODULE_LIB_EXT "so" +# define STATIC_LIB_EXT "a" +# define OBJECT_EXT "o" +# define LIBRARIAN "ar" +# define LIBRARIAN_OPTS "cr" +# define RPATH "-Brpath" +# define SHARED_OPTS "-G" +# define MODULE_OPTS "-G" +# define DYNAMIC_LINK_OPTS "-Wl,-Blargedynsym" +# define LINKER_FLAG_PREFIX "-Wl," +# define NEED_SNPRINTF +#endif + #ifndef SHELL_CMD #error Unsupported platform: Please add defines for SHELL_CMD etc. for your platform. #endif From b775578c945e29462315f062f50b15d958605607 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 29 Sep 2004 17:39:01 +0000 Subject: [PATCH 5182/7878] * test/Makefile.in (CLEAN_TARGETS): Clean up more files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65356 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index 1c0c324d194..5455361020c 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -29,7 +29,8 @@ TARGETS = $(PROGRAMS) LOCAL_LIBS=../lib@APR_LIBNAME@.la CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \ -readchild@EXEEXT@ tryread@EXEEXT@ sockchid@EXEEXT@ + readchild@EXEEXT@ tryread@EXEEXT@ sockchild@EXEEXT@ \ + globalmutexchild@EXEEXT@ lfstests/large.bin CLEAN_SUBDIRS = internal INCDIR=../include From 9d47a2628bc5cfaec29f14ce8517334395b7d48b Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Thu, 30 Sep 2004 09:18:32 +0000 Subject: [PATCH 5183/7878] Add --config to jlibtool to fill shlibpath_var in configure. BTW: Why do we grep in (GNU) libtool instead using --config? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65357 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 24 ++++++++++++++++++++++++ configure.in | 4 ++++ 2 files changed, 28 insertions(+) diff --git a/build/jlibtool.c b/build/jlibtool.c index fe4d4ac82fc..27a31120c58 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -67,6 +67,7 @@ # define dynamic_link_version_func darwin_dynamic_link_function # define DYNAMIC_INSTALL_NAME "-install_name" /*-install_name /Users/jerenk/apache-2.0-cvs/lib/libapr.0.dylib -compatibility_version 1 -current_version 1.0 */ +# define LD_LIBRARY_PATH "DYLD_LIBRARY_PATH" #endif #if defined(__linux__) || defined(__FreeBSD__) @@ -84,6 +85,8 @@ # define MODULE_OPTS "-shared" # define LINKER_FLAG_PREFIX "-Wl," # define ADD_MINUS_L +# define LD_RUN_PATH "LD_RUN_PATH" +# define LD_LIBRARY_PATH "LD_LIBRARY_PATH" #endif #if defined(_OSD_POSIX) @@ -114,6 +117,8 @@ # define DYNAMIC_LINK_OPTS "-Wl,-Blargedynsym" # define LINKER_FLAG_PREFIX "-Wl," # define NEED_SNPRINTF +# define LD_RUN_PATH "LD_RUN_PATH" +# define LD_LIBRARY_PATH "LD_LIBRARY_PATH" #endif #ifndef SHELL_CMD @@ -410,6 +415,23 @@ int run_command(command_t *cmd_data, count_chars *cc) return external_spawn(cmd_data, spawn_args[0], (const char**)spawn_args); } +/* + * print configuration + * shlibpath_var is used in configure. + */ +void print_config() +{ +#ifdef LD_RUN_PATH + printf("runpath_var=%s\n", LD_RUN_PATH); +#endif +#ifdef LD_LIBRARY_PATH + printf("shlibpath_var=%s\n", LD_LIBRARY_PATH); +#endif +#ifdef SHELL_CMD + printf("SHELL=\"%s\"\n", SHELL_CMD); +#endif +} + int parse_long_opt(char *arg, command_t *cmd_data) { char *equal_pos = strchr(arg, '='); @@ -454,6 +476,8 @@ int parse_long_opt(char *arg, command_t *cmd_data) printf("Version " VERSION "\n"); } else if (strcmp(var, "help") == 0) { printf("Sorry. No help available.\n"); + } else if (strcmp(var, "config") == 0) { + print_config(); } else { return 0; } diff --git a/configure.in b/configure.in index 0722a3a68d0..227972a97bf 100644 --- a/configure.in +++ b/configure.in @@ -155,6 +155,10 @@ case $host in LIBTOOL="$apr_builddir/libtool" LIBTOOL_SRC="$apr_srcdir/build/jlibtool.c" $CC $CFLAGS $CPPFLAGS -o $LIBTOOL $LIBTOOL_SRC + eval `$apr_builddir/libtool --config | grep "^shlibpath_var=[[A-Z_]]*$"` + if test "x$shlibpath_var" = "x"; then + shlibpath_var=REPLACE_WITH_YOUR_SHLIBPATH_VAR + fi else dnl libtoolize requires that the following not be indented AC_PROG_LIBTOOL From 963a08d2119cd421e2776dd9d34d9ac0ac0acb5c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 30 Sep 2004 17:47:06 +0000 Subject: [PATCH 5184/7878] add some hints about non-blocking sockets git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65358 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index b160b3f7f5d..0157a46b6e4 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -456,7 +456,8 @@ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, * @remark *
      * This functions acts like a blocking write by default.  To change 
    - * this behavior, use apr_socket_timeout_set().
    + * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
    + * socket option.
      *
      * It is possible for both bytes to be sent and an error to be returned.
      *
    @@ -475,7 +476,8 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf,
      * @remark
      * 
      * This functions acts like a blocking write by default.  To change 
    - * this behavior, use apr_socket_timeout_set().
    + * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
    + * socket option.
      * The number of bytes actually sent is stored in argument 3.
      *
      * It is possible for both bytes to be sent and an error to be returned.
    @@ -526,7 +528,8 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from,
      *                       including headers, file, and trailers
      * @param flags APR flags that are mapped to OS specific flags
      * @remark This functions acts like a blocking write by default.  To change 
    - *         this behavior, use apr_socket_timeout_set().
    + *         this behavior, use apr_socket_timeout_set() or the
    + *         APR_SO_NONBLOCK socket option.
      *         The number of bytes actually sent is stored in argument 5.
      */
     APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, 
    @@ -547,8 +550,9 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock,
      * @remark
      * 
      * This functions acts like a blocking read by default.  To change 
    - * this behavior, use apr_socket_timeout_set().
    - * The number of bytes actually sent is stored in argument 3.
    + * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
    + * socket option.
    + * The number of bytes actually received is stored in argument 3.
      *
      * It is possible for both bytes to be received and an APR_EOF or
      * other error to be returned.
    @@ -568,6 +572,11 @@ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock,
      *            APR_SO_KEEPALIVE  --  keep connections active
      *            APR_SO_LINGER     --  lingers on close if data is present
      *            APR_SO_NONBLOCK   --  Turns blocking on/off for socket
    + *                                  When this option is enabled, use
    + *                                  the APR_STATUS_IS_EAGAIN() macro to
    + *                                  see if a send or receive function
    + *                                  could not transfer data without
    + *                                  blocking.
      *            APR_SO_REUSEADDR  --  The rules used in validating addresses
      *                                  supplied to bind should allow reuse
      *                                  of local addresses.
    
    From 271b2f637429b7f43b3606c8328f09cdcc258cb3 Mon Sep 17 00:00:00 2001
    From: Jean-Frederic Clere 
    Date: Fri, 1 Oct 2004 10:23:31 +0000
    Subject: [PATCH 5185/7878] Add DYNAMIC_LINK_OPTS for Linux and FreeBSD.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65359 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/jlibtool.c | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/build/jlibtool.c b/build/jlibtool.c
    index 27a31120c58..051648da6ce 100644
    --- a/build/jlibtool.c
    +++ b/build/jlibtool.c
    @@ -83,6 +83,7 @@
     #  define RPATH "-rpath"
     #  define SHARED_OPTS "-shared"
     #  define MODULE_OPTS "-shared"
    +#  define DYNAMIC_LINK_OPTS "-export-dynamic"
     #  define LINKER_FLAG_PREFIX "-Wl,"
     #  define ADD_MINUS_L
     #  define LD_RUN_PATH "LD_RUN_PATH"
    
    From 4e3d4f2b3326b8f3aed1f19629e7adc3a3cda083 Mon Sep 17 00:00:00 2001
    From: "Allan K. Edwards" 
    Date: Fri, 1 Oct 2004 19:24:03 +0000
    Subject: [PATCH 5186/7878] clarify APR_DWORD_MAX
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65360 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr.hnw | 2 +-
     include/apr.hw  | 2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/include/apr.hnw b/include/apr.hnw
    index 2938f8fd1f1..06073ebbdac 100644
    --- a/include/apr.hnw
    +++ b/include/apr.hnw
    @@ -330,7 +330,7 @@ typedef int apr_wait_t;
     #define APR_UINT64_T_HEX_FMT     "llx"
     #define APR_TIME_T_FMT APR_INT64_T_FMT
     
    -#define APR_DWORD_MAX 4294967295    /* 2^32*/
    +#define APR_DWORD_MAX 0xFFFFFFFFUL    /* 2^32*/
     /** @} */
     
     #ifdef __cplusplus
    diff --git a/include/apr.hw b/include/apr.hw
    index b6897525dc7..be59f66272f 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -342,7 +342,7 @@ typedef  int         apr_socklen_t;
     #define APR_SIZEOF_VOIDP   4
     #endif
     
    -#define APR_DWORD_MAX 4294967295
    +#define APR_DWORD_MAX 0xFFFFFFFFUL
     
     /* XXX These simply don't belong here, perhaps in apr_portable.h
      * based on some APR_HAVE_PID/GID/UID?
    
    From 2b4299bbfb865534af293c062a05ca1d93193ca6 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Wed, 6 Oct 2004 06:51:33 +0000
    Subject: [PATCH 5187/7878] * random/unix/apr_random.c (apr_random_init):
     Zero-initialize H and H_waiting fields to fix spurious test failures.
    
    Submitted by: Mladen Turk
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65361 13f79535-47bb-0310-9956-ffa450edef68
    ---
     random/unix/apr_random.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c
    index b4daeb2f504..49af4907938 100644
    --- a/random/unix/apr_random.c
    +++ b/random/unix/apr_random.c
    @@ -111,8 +111,8 @@ APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p,
                         /2)*g->pool_hash->size*2;
         g->reseed_size = APR_RANDOM_DEFAULT_RESEED_SIZE;
     
    -    g->H = apr_palloc(p,H_size(g));
    -    g->H_waiting = apr_palloc(p,H_size(g));
    +    g->H = apr_pcalloc(p,H_size(g));
    +    g->H_waiting = apr_pcalloc(p,H_size(g));
     
         g->randomness = apr_palloc(p,B_size(g));
         g->random_bytes = 0;
    
    From 57e009b1153a1208aa900e5cfafcf9c0a403df81 Mon Sep 17 00:00:00 2001
    From: Jean-Jacques Clar 
    Date: Wed, 6 Oct 2004 22:20:22 +0000
    Subject: [PATCH 5188/7878] added define to enable writev capabilities in
     NetWare
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65362 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/netware/apr_private.h | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h
    index 5251cb0e286..ac16037507c 100644
    --- a/include/arch/netware/apr_private.h
    +++ b/include/arch/netware/apr_private.h
    @@ -63,6 +63,8 @@
     #define HAVE_SETENV     1
     #define HAVE_UNSETENV   1
     
    +#define HAVE_WRITEV     1
    +
     /* 64-bit integer conversion function */
     #define APR_INT64_STRFN	      strtoll
     
    
    From 5762e6423ff85e01af19ae209654271536c95870 Mon Sep 17 00:00:00 2001
    From: Jean-Jacques Clar 
    Date: Wed, 6 Oct 2004 22:33:39 +0000
    Subject: [PATCH 5189/7878] removed the O_EXCL bit from the passed-in flag to
     allow create then open on temp file
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65363 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/netware/mktemp.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/file_io/netware/mktemp.c b/file_io/netware/mktemp.c
    index 884a8c40bf3..58e89386b91 100644
    --- a/file_io/netware/mktemp.c
    +++ b/file_io/netware/mktemp.c
    @@ -27,7 +27,7 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i
         apr_status_t rv;
     
         flags = (!flags) ? APR_CREATE | APR_READ | APR_WRITE |  
    -                       APR_DELONCLOSE : flags;
    +                       APR_DELONCLOSE : flags & ~APR_EXCL;
     
         fd = mkstemp(template);
         if (fd == -1) {
    
    From 05132a32a1e4b9da3b5a6219dfa52abb0a1a8544 Mon Sep 17 00:00:00 2001
    From: "Allan K. Edwards" 
    Date: Thu, 7 Oct 2004 19:28:55 +0000
    Subject: [PATCH 5190/7878] WIN64: update pools code for 64 bit compiles
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65364 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr.hnw                    |  1 -
     include/apr.hw                     |  2 --
     include/arch/apr_private_common.h  |  5 +++++
     include/arch/netware/apr_private.h |  3 +++
     include/arch/win32/apr_private.h   |  3 +++
     memory/unix/apr_pools.c            | 24 +++++++++++++++---------
     6 files changed, 26 insertions(+), 12 deletions(-)
    
    diff --git a/include/apr.hnw b/include/apr.hnw
    index 06073ebbdac..13a84e6d27c 100644
    --- a/include/apr.hnw
    +++ b/include/apr.hnw
    @@ -330,7 +330,6 @@ typedef int apr_wait_t;
     #define APR_UINT64_T_HEX_FMT     "llx"
     #define APR_TIME_T_FMT APR_INT64_T_FMT
     
    -#define APR_DWORD_MAX 0xFFFFFFFFUL    /* 2^32*/
     /** @} */
     
     #ifdef __cplusplus
    diff --git a/include/apr.hw b/include/apr.hw
    index be59f66272f..7797ed97d96 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -342,8 +342,6 @@ typedef  int         apr_socklen_t;
     #define APR_SIZEOF_VOIDP   4
     #endif
     
    -#define APR_DWORD_MAX 0xFFFFFFFFUL
    -
     /* XXX These simply don't belong here, perhaps in apr_portable.h
      * based on some APR_HAVE_PID/GID/UID?
      */
    diff --git a/include/arch/apr_private_common.h b/include/arch/apr_private_common.h
    index b2a02a8e4fb..912813b0d87 100644
    --- a/include/arch/apr_private_common.h
    +++ b/include/arch/apr_private_common.h
    @@ -33,4 +33,9 @@ apr_status_t apr_filepath_list_merge_impl(char **liststr,
                                               char separator,
                                               apr_pool_t *p);
     
    +/* temporary defines to handle 64bit compile mismatches */
    +#define APR_INT_TRUNC_CAST    int
    +#define APR_UINT32_TRUNC_CAST apr_uint32_t
    +#define APR_UINT32_MAX        0xFFFFFFFFUL
    +
     #endif  /*APR_PRIVATE_COMMON_H*/
    diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h
    index ac16037507c..917b6fa4500 100644
    --- a/include/arch/netware/apr_private.h
    +++ b/include/arch/netware/apr_private.h
    @@ -174,6 +174,9 @@ void* getStatCache();
     #define APR_OFF_T_STRFN       strtol
     #endif
     
    +/* used to check DWORD overflow for 64bit compiles */
    +#define APR_DWORD_MAX 0xFFFFFFFFUL
    +
     /*
      * Include common private declarations.
      */
    diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h
    index de23360b3cd..0dee29348af 100644
    --- a/include/arch/win32/apr_private.h
    +++ b/include/arch/win32/apr_private.h
    @@ -158,6 +158,9 @@ APR_DECLARE_DATA int errno;
     #define APR_OFF_T_STRFN         strtoi
     #endif
     
    +/* used to check for DWORD overflow in 64bit compiles */
    +#define APR_DWORD_MAX 0xFFFFFFFFUL
    +
     /*
      * Include common private declarations.
      */
    diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
    index 2ed524eb3be..9bf8fa290a7 100644
    --- a/memory/unix/apr_pools.c
    +++ b/memory/unix/apr_pools.c
    @@ -139,9 +139,10 @@ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator)
     }
     
     APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator,
    -                                             apr_size_t size)
    +                                             apr_size_t in_size)
     {
         apr_uint32_t max_free_index;
    +    apr_uint32_t size = (APR_UINT32_TRUNC_CAST)in_size;
     
     #if APR_HAS_THREADS
         apr_thread_mutex_t *mutex;
    @@ -168,7 +169,8 @@ static APR_INLINE
     apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size)
     {
         apr_memnode_t *node, **ref;
    -    apr_uint32_t i, index, max_index;
    +    apr_uint32_t max_index;
    +    apr_size_t i, index;
     
         /* Round up the block size to the next boundary, but always
          * allocate at least a certain size (MIN_ALLOC).
    @@ -181,6 +183,10 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size)
          * dividing its size by the boundary size
          */
         index = (size >> BOUNDARY_INDEX) - 1;
    +    
    +    if (index > APR_UINT32_MAX) {
    +        return NULL;
    +    }
     
         /* First see if there are any nodes in the area we know
          * our node will fit into.
    @@ -293,7 +299,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size)
             return NULL;
     
         node->next = NULL;
    -    node->index = index;
    +    node->index = (APR_UINT32_TRUNC_CAST)index;
         node->first_avail = (char *)node + APR_MEMNODE_T_SIZE;
         node->endp = (char *)node + size;
     
    @@ -582,7 +588,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size)
     {
         apr_memnode_t *active, *node;
         void *mem;
    -    apr_uint32_t free_index;
    +    apr_size_t free_index;
     
         size = APR_ALIGN_DEFAULT(size);
         active = pool->active;
    @@ -620,7 +626,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size)
         free_index = (APR_ALIGN(active->endp - active->first_avail + 1,
                                 BOUNDARY_SIZE) - BOUNDARY_SIZE) >> BOUNDARY_INDEX;
     
    -    active->free_index = free_index;
    +    active->free_index = (APR_UINT32_TRUNC_CAST)free_index;
         node = active->next;
         if (free_index >= node->free_index)
             return mem;
    @@ -877,7 +883,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff)
         apr_size_t cur_len, size;
         char *strp;
         apr_pool_t *pool;
    -    apr_uint32_t free_index;
    +    apr_size_t free_index;
     
         pool = ps->pool;
         active = ps->node;
    @@ -907,7 +913,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff)
             free_index = (APR_ALIGN(active->endp - active->first_avail + 1,
                                     BOUNDARY_SIZE) - BOUNDARY_SIZE) >> BOUNDARY_INDEX;
     
    -        active->free_index = free_index;
    +        active->free_index = (APR_UINT32_TRUNC_CAST)free_index;
             node = active->next;
             if (free_index < node->free_index) {
                 do {
    @@ -948,7 +954,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap)
         char *strp;
         apr_size_t size;
         apr_memnode_t *active, *node;
    -    apr_uint32_t free_index;
    +    apr_size_t free_index;
     
         ps.node = active = pool->active;
         ps.pool = pool;
    @@ -1008,7 +1014,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap)
         free_index = (APR_ALIGN(active->endp - active->first_avail + 1,
                                 BOUNDARY_SIZE) - BOUNDARY_SIZE) >> BOUNDARY_INDEX;
     
    -    active->free_index = free_index;
    +    active->free_index = (APR_UINT32_TRUNC_CAST)free_index;
         node = active->next;
     
         if (free_index >= node->free_index)
    
    From 07d2fdc9537a95be4f996f656c27dd699b26ad1e Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Fri, 12 Nov 2004 16:34:10 +0000
    Subject: [PATCH 5191/7878] Get jlibtool to build httpd-2.1 successfully as
     mod_ssl now require -export-symbols-regexp option to be handled...
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65367 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES          | 3 +++
     build/jlibtool.c | 6 +++++-
     2 files changed, 8 insertions(+), 1 deletion(-)
    
    diff --git a/CHANGES b/CHANGES
    index 5819235645e..2385daca2b5 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,8 @@
     Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.]
     
    +  *) jlibtool: Ignore '-export-symbols-regexp' option.
    +     [Justin Erenkrantz]
    +
       *) fix apr_file_dup and apr_file_dup2 win32 implementations
          to create a mutex [Steve Hay ]
     
    diff --git a/build/jlibtool.c b/build/jlibtool.c
    index 051648da6ce..5f38b6db626 100644
    --- a/build/jlibtool.c
    +++ b/build/jlibtool.c
    @@ -1095,7 +1095,7 @@ void parse_args(int argc, char *argv[], command_t *cmd_data)
         char *arg;
         int argused;
     
    -    for (a=1; a < argc; a++) {
    +    for (a = 1; a < argc; a++) {
             arg = argv[a];
             argused = 1;
     
    @@ -1121,6 +1121,10 @@ void parse_args(int argc, char *argv[], command_t *cmd_data)
                         /* Store for later deciphering */
                         cmd_data->version_info = argv[++a];
                         argused = 1;
    +                } else if (strcmp(arg+1, "export-symbols-regex") == 0) {
    +                    /* Skip the argument. */
    +                    ++a;
    +                    argused = 1;
                     }
                 }
             } else {
    
    From 2729cdd5660b43788fc60908e5df8ed1239938c2 Mon Sep 17 00:00:00 2001
    From: Cliff Woolley 
    Date: Sun, 14 Nov 2004 01:36:16 +0000
    Subject: [PATCH 5192/7878] meaningless change to test the mail archives
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65562 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 7 ++-----
     1 file changed, 2 insertions(+), 5 deletions(-)
    
    diff --git a/STATUS b/STATUS
    index 472fe689e64..c5db6c071b9 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -1,5 +1,5 @@
     APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS:			-*-text-*-
    -Last modified at [$Date: 2004/09/02 03:49:03 $]
    +Last modified at [$Date$]
     
     Releases:
     
    @@ -22,10 +22,7 @@ Bundled with httpd
         2.0a1     : released March 10, 2000
     
     
    -RELEASE 0.9 SHOWSTOPPERS:
    -
    -
    -RELEASE 1.0 SHOWSTOPPERS:
    +RELEASE 1.0.1 SHOWSTOPPERS:
     
     
     CURRENT VOTES:
    
    From a362f45b06670acf39ba2c45281fa3d4168c372e Mon Sep 17 00:00:00 2001
    From: Cliff Woolley 
    Date: Sun, 14 Nov 2004 01:50:27 +0000
    Subject: [PATCH 5193/7878] don't make me mad.  arrrr
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65567 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index 2385daca2b5..5c9112bfa7d 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,8 @@
     Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.]
     
    +  *) Moved repository to SVN
    +     [Hackathon]
    +
       *) jlibtool: Ignore '-export-symbols-regexp' option.
          [Justin Erenkrantz]
     
    
    From 90755514e71a577f4d897e095b7b9a92b7da7ca2 Mon Sep 17 00:00:00 2001
    From: Thom May 
    Date: Sun, 14 Nov 2004 02:33:07 +0000
    Subject: [PATCH 5194/7878] Prevent unbounded memory use during repeated
     operations on a hash table.
    
    The hash table was allocating new memory for each new insertion of an entry,
    and not reclaiming it on deletions, so repetition of (insert, delete) caused
    the memory use to keep growing.  This fix causes the memory freed by a deletion
    to be reused by a subsequent insertion, so that the memory used by the hash
    table is proportional to the maximum number of entries that it has ever held
    simultaneously, rather than the number of insertions that have been performed.
    
    * apr/tables/apr_hash.c:
      (apr_hash_t): Add new field "free", a free-list.
      (apr_hash_make, apr_hash_copy, apr_hash_merge): Initialise the free-list.
      (find_entry): Use an entry from the free-list if there is one.
      (apr_hash_set): Return a deleted entry to the free-list.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65572 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES           |  3 +++
     tables/apr_hash.c | 12 +++++++++++-
     2 files changed, 14 insertions(+), 1 deletion(-)
    
    diff --git a/CHANGES b/CHANGES
    index 5c9112bfa7d..ea1f5cdcda8 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,8 @@
     Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.]
     
    +  *) Prevent unbounded memory use during repeated operations on a hash table.
    +     [Julian Foad 
    +
       *) Moved repository to SVN
          [Hackathon]
     
    diff --git a/tables/apr_hash.c b/tables/apr_hash.c
    index 8b8a7f3d15d..03bdfd7ce2c 100644
    --- a/tables/apr_hash.c
    +++ b/tables/apr_hash.c
    @@ -73,6 +73,7 @@ struct apr_hash_t {
         apr_hash_index_t     iterator;  /* For apr_hash_first(NULL, ...) */
         unsigned int         count, max;
         apr_hashfunc_t       hash_func;
    +    apr_hash_entry_t    *free;  /* List of recycled entries */
     };
     
     #define INITIAL_MAX 15 /* tunable == 2^n - 1 */
    @@ -92,6 +93,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool)
         apr_hash_t *ht;
         ht = apr_palloc(pool, sizeof(apr_hash_t));
         ht->pool = pool;
    +    ht->free = NULL;
         ht->count = 0;
         ht->max = INITIAL_MAX;
         ht->array = alloc_array(ht, ht->max);
    @@ -264,7 +266,10 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht,
             return hep;
     
         /* add a new entry for non-NULL values */
    -    he = apr_palloc(ht->pool, sizeof(*he));
    +    if (he = ht->free)
    +        ht->free = he->next;
    +    else
    +        he = apr_palloc(ht->pool, sizeof(*he));
         he->next = NULL;
         he->hash = hash;
         he->key  = key;
    @@ -286,6 +291,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool,
                         sizeof(*ht->array) * (orig->max + 1) +
                         sizeof(apr_hash_entry_t) * orig->count);
         ht->pool = pool;
    +    ht->free = NULL;
         ht->count = orig->count;
         ht->max = orig->max;
         ht->hash_func = orig->hash_func;
    @@ -333,7 +339,10 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht,
         if (*hep) {
             if (!val) {
                 /* delete entry */
    +            apr_hash_entry_t *old = *hep;
                 *hep = (*hep)->next;
    +            old->next = ht->free;
    +            ht->free = old;
                 --ht->count;
             }
             else {
    @@ -396,6 +405,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p,
     
         res = apr_palloc(p, sizeof(apr_hash_t));
         res->pool = p;
    +    res->free = NULL;
         res->hash_func = base->hash_func;
         res->count = base->count;
         res->max = (overlay->max > base->max) ? overlay->max : base->max;
    
    From 9e28b442cfc5b8cd302199f1f9cc0f1c1b60fd2a Mon Sep 17 00:00:00 2001
    From: Paul Querna 
    Date: Sun, 14 Nov 2004 02:35:00 +0000
    Subject: [PATCH 5195/7878] Fix KQueue for Pollset. Now you don't get an Error
     when you should of gotten a HUP.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65573 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES          | 3 +++
     poll/unix/poll.c | 4 +++-
     2 files changed, 6 insertions(+), 1 deletion(-)
    
    diff --git a/CHANGES b/CHANGES
    index ea1f5cdcda8..6b88273fdb8 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,5 +1,8 @@
     Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.]
     
    +  *) Fix HUP return codes in pollset when using KQueue.
    +     [Paul Querna]
    +
       *) Prevent unbounded memory use during repeated operations on a hash table.
          [Julian Foad 
     
    diff --git a/poll/unix/poll.c b/poll/unix/poll.c
    index a04866fcdfb..b03b086f3ec 100644
    --- a/poll/unix/poll.c
    +++ b/poll/unix/poll.c
    @@ -50,7 +50,9 @@ static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags)
             rv |= APR_POLLIN;
         if (event & EVFILT_WRITE)
             rv |= APR_POLLOUT;
    -    if (flags & EV_ERROR || flags & EV_EOF)
    +    if (flags & EV_EOF)
    +        rv |= APR_POLLHUP;
    +    if (flags & EV_ERROR)
             rv |= APR_POLLERR;
     
         return rv;
    
    From 35780b65a032f5c281861a03373b82a2dc38c7ef Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Sun, 14 Nov 2004 02:47:00 +0000
    Subject: [PATCH 5196/7878] Remove threadcancel.c which was somehow ressurected
     by the CVS->SVN conversion. Looks like CVS is dodgy as its log shows that it
     was modified after deletion but a checkout doesn't get it and it's in the
     Attic.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65576 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/os2/threadcancel.c | 85 -----------------------------------
     1 file changed, 85 deletions(-)
     delete mode 100644 threadproc/os2/threadcancel.c
    
    diff --git a/threadproc/os2/threadcancel.c b/threadproc/os2/threadcancel.c
    deleted file mode 100644
    index ca7a187538e..00000000000
    --- a/threadproc/os2/threadcancel.c
    +++ /dev/null
    @@ -1,85 +0,0 @@
    -/* ====================================================================
    - * The Apache Software License, Version 1.1
    - *
    - * Copyright (c) 2000 The Apache Software Foundation.  All rights
    - * reserved.
    - *
    - * Redistribution and use in source and binary forms, with or without
    - * modification, are permitted provided that the following conditions
    - * are met:
    - *
    - * 1. Redistributions of source code must retain the above copyright
    - *    notice, this list of conditions and the following disclaimer.
    - *
    - * 2. Redistributions in binary form must reproduce the above copyright
    - *    notice, this list of conditions and the following disclaimer in
    - *    the documentation and/or other materials provided with the
    - *    distribution.
    - *
    - * 3. The end-user documentation included with the redistribution,
    - *    if any, must include the following acknowledgment:
    - *       "This product includes software developed by the
    - *        Apache Software Foundation (http://www.apache.org/)."
    - *    Alternately, this acknowledgment may appear in the software itself,
    - *    if and wherever such third-party acknowledgments normally appear.
    - *
    - * 4. The names "Apache" and "Apache Software Foundation" must
    - *    not be used to endorse or promote products derived from this
    - *    software without prior written permission. For written
    - *    permission, please contact apache@apache.org.
    - *
    - * 5. Products derived from this software may not be called "Apache",
    - *    nor may "Apache" appear in their name, without prior written
    - *    permission of the Apache Software Foundation.
    - *
    - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    - * SUCH DAMAGE.
    - * ====================================================================
    - *
    - * This software consists of voluntary contributions made by many
    - * individuals on behalf of the Apache Software Foundation.  For more
    - * information on the Apache Software Foundation, please see
    - * .
    - */
    -
    -#include "threadproc.h"
    -#include "apr_thread_proc.h"
    -#include "apr_general.h"
    -#include "fileio.h"
    -
    -ap_status_t ap_cancel_thread(ap_thread_t *thd)
    -{
    -    return APR_OS2_STATUS(DosKillThread(thd->tid));
    -}
    -
    -    
    -
    -ap_status_t ap_setcanceltype(ap_int32_t type, ap_pool_t *cont)
    -{
    -    ULONG rc, nesting;
    -
    -    if (type == APR_CANCEL_DEFER)
    -        rc = DosEnterMustComplete(&nesting);
    -    else
    -        rc = DosExitMustComplete(&nesting);
    -
    -    return APR_OS2_STATUS(rc);
    -}
    -
    -
    -
    -ap_status_t ap_setcancelstate(ap_int32_t type, ap_pool_t *cont)
    -{
    -/* There's no way to ignore thread kills altogether in OS/2 (that I know of) */
    -    return APR_ENOTIMPL;
    -}
    
    From 71a5861d2193356a9d3d5e37f18f348828a4ad05 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Mon, 15 Nov 2004 13:33:04 +0000
    Subject: [PATCH 5197/7878] * tables/apr_hash.c (find_entry): Fix gcc warning.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@71501 13f79535-47bb-0310-9956-ffa450edef68
    ---
     tables/apr_hash.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/tables/apr_hash.c b/tables/apr_hash.c
    index 03bdfd7ce2c..fba4ff16293 100644
    --- a/tables/apr_hash.c
    +++ b/tables/apr_hash.c
    @@ -266,7 +266,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht,
             return hep;
     
         /* add a new entry for non-NULL values */
    -    if (he = ht->free)
    +    if ((he = ht->free) != NULL)
             ht->free = he->next;
         else
             he = apr_palloc(ht->pool, sizeof(*he));
    
    From 34f3392b0e9232240688d5b1d5e8c15b19c76c4f Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Wed, 17 Nov 2004 01:16:19 +0000
    Subject: [PATCH 5198/7878] Bump trunk to 1.1.0-dev so that we can try to
     isolate incompatible changes.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@76076 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES               | 14 ++++++++------
     include/apr_version.h |  4 ++--
     2 files changed, 10 insertions(+), 8 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 6b88273fdb8..53e83639283 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,4 +1,11 @@
    -Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.]
    +Changes for APR 1.1.0
    +
    +  *) [NOT COMMITTED?] Add a new PRNG. Note that the implementation of SHA-256
    +     is a stop-gap pending snarfing the SHA-1 implementation from apr-util
    +     and upgrading it to do SHA-256. Not yet ready for prime time.
    +     [Ben Laurie]
    +
    +Changes for APR 1.0.1
     
       *) Fix HUP return codes in pollset when using KQueue.
          [Paul Querna]
    @@ -29,11 +36,6 @@ Changes for APR 1.1 [Deferring these features when 1.0 is rolled out.]
       *) Win32: Fix bug in apr_socket_sendfile that interferred with
          Win32 LSPs. PR 23982 [Jan Bilek, Bill Stoddard]
     
    -  *) Add a new PRNG. Note that the implementation of SHA-256 is a
    -     stop-gap pending snarfing the SHA-1 implementation from apr-util
    -     and upgrading it to do SHA-256. Not yet ready for prime time.
    -     [Ben Laurie]
    -
       *) Win32: Fix bug tracking the file pointer on a file opened for 
          overlapped/APR_XTHREAD io. [Bill Stoddard]
     
    diff --git a/include/apr_version.h b/include/apr_version.h
    index 08d5f3a26a0..cbf2e82ffbc 100644
    --- a/include/apr_version.h
    +++ b/include/apr_version.h
    @@ -57,10 +57,10 @@ extern "C" {
      * Minor API changes that do not cause binary compatibility problems.
      * Should be reset to 0 when upgrading APR_MAJOR_VERSION
      */
    -#define APR_MINOR_VERSION       0
    +#define APR_MINOR_VERSION       1
     
     /** patch level */
    -#define APR_PATCH_VERSION       1
    +#define APR_PATCH_VERSION       0
     
     /**
      * This symbol is defined for internal, "development" copies of APR.
    
    From 65ca8a82701501a26abc8457080562b6c4aae47f Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Wed, 17 Nov 2004 12:00:08 +0000
    Subject: [PATCH 5199/7878] * file_io/unix/readwrite.c (apr_file_puts): Use
     apr_file_write_full.
    
    * test/testfile.c (test_puts, file_contents_equal): Test
    apr_file_puts.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@76115 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/readwrite.c |  4 +---
     test/testfile.c          | 47 ++++++++++++++++++++++++++++++++++++++++
     2 files changed, 48 insertions(+), 3 deletions(-)
    
    diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c
    index 98a11421de4..2334ea1a6bf 100644
    --- a/file_io/unix/readwrite.c
    +++ b/file_io/unix/readwrite.c
    @@ -268,9 +268,7 @@ APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile)
     
     APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile)
     {
    -    apr_size_t nbytes = strlen(str);
    -
    -    return apr_file_write(thefile, str, &nbytes);
    +    return apr_file_write_full(thefile, str, strlen(str), NULL);
     }
     
     APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile)
    diff --git a/test/testfile.c b/test/testfile.c
    index 13bc1028d2f..88717d1bd04 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -505,6 +505,52 @@ static void test_mod_neg(abts_case *tc, void *data)
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     }
     
    +/* Test that the contents of file FNAME are equal to data EXPECT of
    + * length EXPECTLEN. */
    +static void file_contents_equal(abts_case *tc,
    +                                const char *fname,
    +                                const void *expect,
    +                                apr_size_t expectlen)
    +{
    +    void *actual = apr_palloc(p, expectlen);
    +    apr_file_t *f;
    +
    +    APR_ASSERT_SUCCESS(tc, "open file",
    +                       apr_file_open(&f, fname, APR_READ|APR_BUFFERED,
    +                                     0, p));
    +    APR_ASSERT_SUCCESS(tc, "read from file",
    +                       apr_file_read_full(f, actual, expectlen, NULL));
    +    
    +    ABTS_ASSERT(tc, "matched expected file contents",
    +                memcmp(expect, actual, expectlen) == 0);
    +
    +    APR_ASSERT_SUCCESS(tc, "close file", apr_file_close(f));
    +}
    +
    +#define LINE1 "this is a line of text\n"
    +#define LINE2 "this is a second line of text\n"
    +
    +static void test_puts(abts_case *tc, void *data)
    +{
    +    apr_file_t *f;
    +    const char *fname = "data/testputs.txt";
    +
    +    APR_ASSERT_SUCCESS(tc, "open file for writing",
    +                       apr_file_open(&f, fname, 
    +                                     APR_WRITE|APR_CREATE|APR_TRUNCATE, 
    +                                     APR_OS_DEFAULT, p));
    +    
    +    APR_ASSERT_SUCCESS(tc, "write line to file", 
    +                       apr_file_puts(LINE1, f));
    +    APR_ASSERT_SUCCESS(tc, "write second line to file", 
    +                       apr_file_puts(LINE2, f));
    +    
    +    APR_ASSERT_SUCCESS(tc, "close for writing",
    +                       apr_file_close(f));
    +
    +    file_contents_equal(tc, fname, LINE1 LINE2, strlen(LINE1 LINE2));
    +}
    +
     static void test_truncate(abts_case *tc, void *data)
     {
         apr_status_t rv;
    @@ -567,6 +613,7 @@ abts_suite *testfile(abts_suite *suite)
         abts_run_test(suite, test_getc, NULL);
         abts_run_test(suite, test_ungetc, NULL);
         abts_run_test(suite, test_gets, NULL);
    +    abts_run_test(suite, test_puts, NULL);
         abts_run_test(suite, test_bigread, NULL);
         abts_run_test(suite, test_mod_neg, NULL);
         abts_run_test(suite, test_truncate, NULL);
    
    From 85ab89ed76dd02f71934369dfb14781af82bf8b7 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Wed, 17 Nov 2004 12:13:00 +0000
    Subject: [PATCH 5200/7878] * test/testud.c (get_userdata, get_nonexistkey,
     post_pool_clear): Fix GCC strict-aliasing warnings.
    
    * test/testfile.c (test_userdata_get, test_userdata_set,
    test_userdata_getnokey): Likewise.
    
    * test/testsockets.c (socket_userdata): Likewise.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@76117 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfile.c    |  8 +++++---
     test/testsockets.c |  6 +++---
     test/testud.c      | 12 ++++++------
     3 files changed, 14 insertions(+), 12 deletions(-)
    
    diff --git a/test/testfile.c b/test/testfile.c
    index 88717d1bd04..8d83ae5d0ce 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -287,6 +287,7 @@ static void test_userdata_set(abts_case *tc, void *data)
     static void test_userdata_get(abts_case *tc, void *data)
     {
         apr_status_t rv;
    +    void *udata;
         char *teststr;
         apr_file_t *filetest = NULL;
     
    @@ -299,8 +300,9 @@ static void test_userdata_get(abts_case *tc, void *data)
                                "test", apr_pool_cleanup_null);
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     
    -    rv = apr_file_data_get((void **)&teststr, "test", filetest);
    +    rv = apr_file_data_get(&udata, "test", filetest);
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
    +    teststr = udata;
         ABTS_STR_EQUAL(tc, "This is a test", teststr);
     
         apr_file_close(filetest);
    @@ -309,7 +311,7 @@ static void test_userdata_get(abts_case *tc, void *data)
     static void test_userdata_getnokey(abts_case *tc, void *data)
     {
         apr_status_t rv;
    -    char *teststr;
    +    void *teststr;
         apr_file_t *filetest = NULL;
     
         rv = apr_file_open(&filetest, FILENAME, 
    @@ -317,7 +319,7 @@ static void test_userdata_getnokey(abts_case *tc, void *data)
                            APR_UREAD | APR_UWRITE | APR_GREAD, p);
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     
    -    rv = apr_file_data_get((void **)&teststr, "nokey", filetest);
    +    rv = apr_file_data_get(&teststr, "nokey", filetest);
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_PTR_EQUAL(tc, NULL, teststr);
         apr_file_close(filetest);
    diff --git a/test/testsockets.c b/test/testsockets.c
    index 8035207da09..d6ed4bb5ab4 100644
    --- a/test/testsockets.c
    +++ b/test/testsockets.c
    @@ -167,7 +167,7 @@ static void socket_userdata(abts_case *tc, void *data)
     {
         apr_socket_t *sock1, *sock2;
         apr_status_t rv;
    -    char *user;
    +    void *user;
         const char *key = "GENERICKEY";
     
         rv = apr_socket_create(&sock1, AF_INET, SOCK_STREAM, 0, p);
    @@ -180,10 +180,10 @@ static void socket_userdata(abts_case *tc, void *data)
         rv = apr_socket_data_set(sock2, "SOCK2", key, NULL);
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     
    -    rv = apr_socket_data_get((void **)&user, key, sock1);
    +    rv = apr_socket_data_get(&user, key, sock1);
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_STR_EQUAL(tc, "SOCK1", user);
    -    rv = apr_socket_data_get((void **)&user, key, sock2);
    +    rv = apr_socket_data_get(&user, key, sock2);
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_STR_EQUAL(tc, "SOCK2", user);
     }
    diff --git a/test/testud.c b/test/testud.c
    index 357cb292498..8c66d023af4 100644
    --- a/test/testud.c
    +++ b/test/testud.c
    @@ -43,9 +43,9 @@ static void set_userdata(abts_case *tc, void *data)
     static void get_userdata(abts_case *tc, void *data)
     {
         apr_status_t rv;
    -    char *retdata;
    +    void *retdata;
     
    -    rv = apr_pool_userdata_get((void **)&retdata, "TEST", pool);
    +    rv = apr_pool_userdata_get(&retdata, "TEST", pool);
         ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
         ABTS_STR_EQUAL(tc, retdata, testdata);
     }
    @@ -53,9 +53,9 @@ static void get_userdata(abts_case *tc, void *data)
     static void get_nonexistkey(abts_case *tc, void *data)
     {
         apr_status_t rv;
    -    char *retdata;
    +    void *retdata;
     
    -    rv = apr_pool_userdata_get((void **)&retdata, "DOESNTEXIST", pool);
    +    rv = apr_pool_userdata_get(&retdata, "DOESNTEXIST", pool);
         ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
         ABTS_PTR_EQUAL(tc, retdata, NULL);
     }
    @@ -63,9 +63,9 @@ static void get_nonexistkey(abts_case *tc, void *data)
     static void post_pool_clear(abts_case *tc, void *data)
     {
         apr_status_t rv;
    -    char *retdata;
    +    void *retdata;
     
    -    rv = apr_pool_userdata_get((void **)&retdata, "DOESNTEXIST", pool);
    +    rv = apr_pool_userdata_get(&retdata, "DOESNTEXIST", pool);
         ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
         ABTS_PTR_EQUAL(tc, retdata, NULL);
     }
    
    From 3c53843e287a479230b39c5dd04ed488ff0ce620 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Wed, 17 Nov 2004 12:15:14 +0000
    Subject: [PATCH 5201/7878] Avoid casting away "const".  No functional change.
    
    * apr/file_io/unix/tempdir.c
      (test_tempdir): Remove "const" to avoid casting it away.
    
    Submitted by: Julian Foad 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@76118 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/tempdir.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/file_io/unix/tempdir.c b/file_io/unix/tempdir.c
    index e64c4838dbf..f7a7a7d42af 100644
    --- a/file_io/unix/tempdir.c
    +++ b/file_io/unix/tempdir.c
    @@ -23,9 +23,9 @@
     static int test_tempdir(const char *temp_dir, apr_pool_t *p)
     {
         apr_file_t *dummy_file;
    -    const char *path = apr_pstrcat(p, temp_dir, "/apr-tmp.XXXXXX", NULL);
    +    char *path = apr_pstrcat(p, temp_dir, "/apr-tmp.XXXXXX", NULL);
     
    -    if (apr_file_mktemp(&dummy_file, (char *)path, 0, p) == APR_SUCCESS) {
    +    if (apr_file_mktemp(&dummy_file, path, 0, p) == APR_SUCCESS) {
             if (apr_file_putc('!', dummy_file) == APR_SUCCESS) {
                 if (apr_file_close(dummy_file) == APR_SUCCESS) {
                     return 1;
    
    From 74abd3a7e389fb2246af5caedef8f4df560a35e4 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Wed, 17 Nov 2004 12:23:00 +0000
    Subject: [PATCH 5202/7878] Fix enabling of signal blocking and unblocking
     code.
    
    * apr/threadproc/unix/signals.c
      (apr_signal_block, apr_signal_unblock): Test the correct symbol, so that
        these functions will actually be implemented on appropriate platforms.
    
    Submitted by: Julian Foad 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@76119 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/unix/signals.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c
    index 3cafd8532e2..85b8ef05356 100644
    --- a/threadproc/unix/signals.c
    +++ b/threadproc/unix/signals.c
    @@ -427,7 +427,7 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void)
     
     APR_DECLARE(apr_status_t) apr_signal_block(int signum)
     {
    -#if APR_HAS_SIGACTION
    +#if APR_HAVE_SIGACTION
         sigset_t sig_mask;
         int rv;
     
    @@ -454,7 +454,7 @@ APR_DECLARE(apr_status_t) apr_signal_block(int signum)
     
     APR_DECLARE(apr_status_t) apr_signal_unblock(int signum)
     {
    -#if APR_HAS_SIGACTION
    +#if APR_HAVE_SIGACTION
         sigset_t sig_mask;
         int rv;
     
    
    From e94c0b5bd0ee01a5ef1a3b91e58521047ea1f0ef Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Wed, 17 Nov 2004 12:24:00 +0000
    Subject: [PATCH 5203/7878] * test/testfnmatch.c (test_glob,
     test_glob_currdir): Fix for presence of third .txt file in data (!?!) and use
     APR_ASSERT_SUCCESS.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@76120 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testfnmatch.c | 28 +++++++++++++++-------------
     1 file changed, 15 insertions(+), 13 deletions(-)
    
    diff --git a/test/testfnmatch.c b/test/testfnmatch.c
    index 1442fff96f1..f457923f455 100644
    --- a/test/testfnmatch.c
    +++ b/test/testfnmatch.c
    @@ -18,18 +18,22 @@
     #include "apr_fnmatch.h"
     #include "apr_tables.h"
     
    +/* XXX NUM_FILES must be equal to the nummber of expected files with a
    + * .txt extension in the data directory at the time testfnmatch
    + * happens to be run (!?!). */
    +
    +#define NUM_FILES (3)
    +
     static void test_glob(abts_case *tc, void *data)
     {
         int i;
         char **list;
         apr_array_header_t *result;
    -    apr_status_t rv = apr_match_glob("data\\*.txt", &result, p);
    +    
    +    APR_ASSERT_SUCCESS(tc, "glob match against data/*.txt",
    +                       apr_match_glob("data\\*.txt", &result, p));
     
    -    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
    -    /* XXX If we ever add a file that matches *.txt to data, then we need
    -     * to increase this.
    -     */
    -    ABTS_INT_EQUAL(tc, 2, result->nelts);
    +    ABTS_INT_EQUAL(tc, NUM_FILES, result->nelts);
     
         list = (char **)result->elts;
         for (i = 0; i < result->nelts; i++) {
    @@ -43,15 +47,13 @@ static void test_glob_currdir(abts_case *tc, void *data)
         int i;
         char **list;
         apr_array_header_t *result;
    -    apr_status_t rv;
         apr_filepath_set("data", p);
    -    rv = apr_match_glob("*.txt", &result, p);
    +    
    +    APR_ASSERT_SUCCESS(tc, "glob match against *.txt with data as current",
    +                       apr_match_glob("*.txt", &result, p));
    +
     
    -    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
    -    /* XXX If we ever add a file that matches *.txt to data, then we need
    -     * to increase this.
    -     */
    -    ABTS_INT_EQUAL(tc, 2, result->nelts);
    +    ABTS_INT_EQUAL(tc, NUM_FILES, result->nelts);
     
         list = (char **)result->elts;
         for (i = 0; i < result->nelts; i++) {
    
    From 5870fe0b59da97c1dfe1451a8734ff183913548b Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Wed, 17 Nov 2004 12:43:56 +0000
    Subject: [PATCH 5204/7878] * apr/network_io/unix/sendrecv.c  
     (apr_socket_sendfile): Remove a spurious carriage return from the source.
    
    Submitted by: Julian Foad 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@76123 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sendrecv.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c
    index 9381693ed3b..002b6e1ccd5 100644
    --- a/network_io/unix/sendrecv.c
    +++ b/network_io/unix/sendrecv.c
    @@ -316,7 +316,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file,
                           *len);   /* number of bytes to send */
         } while (rv == -1 && errno == EINTR);
     
    -    if ((rv == -1) && 
    (errno == EAGAIN || errno == EWOULDBLOCK) 
    +    if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) 
                        && (sock->timeout > 0)) {
     do_select:
             arv = apr_wait_for_io_or_timeout(NULL, sock, 0);
    
    From 262500c4c299be448a016a724b5be39fbaca2b56 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Thu, 18 Nov 2004 19:37:48 +0000
    Subject: [PATCH 5205/7878] Remove .cvsignore files.
    
    Tipped-of-by: Uwe Zeisberger
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@76269 13f79535-47bb-0310-9956-ffa450edef68
    ---
     .cvsignore                   | 43 ----------------------------------
     atomic/os390/.cvsignore      |  4 ----
     atomic/unix/.cvsignore       |  4 ----
     build/.cvsignore             | 16 -------------
     docs/.cvsignore              |  2 --
     dso/aix/.cvsignore           |  4 ----
     dso/beos/.cvsignore          |  4 ----
     dso/os2/.cvsignore           |  4 ----
     dso/os390/.cvsignore         |  4 ----
     dso/unix/.cvsignore          |  4 ----
     file_io/os2/.cvsignore       |  4 ----
     file_io/unix/.cvsignore      |  4 ----
     include/.cvsignore           |  2 --
     include/arch/unix/.cvsignore |  3 ---
     locks/beos/.cvsignore        |  5 ----
     locks/os2/.cvsignore         |  4 ----
     locks/unix/.cvsignore        |  4 ----
     memory/unix/.cvsignore       |  5 ----
     misc/unix/.cvsignore         |  4 ----
     mmap/unix/.cvsignore         |  4 ----
     network_io/beos/.cvsignore   |  4 ----
     network_io/os2/.cvsignore    |  4 ----
     network_io/unix/.cvsignore   |  4 ----
     passwd/.cvsignore            |  4 ----
     poll/os2/.cvsignore          |  4 ----
     poll/unix/.cvsignore         |  4 ----
     random/unix/.cvsignore       |  4 ----
     shmem/beos/.cvsignore        |  4 ----
     shmem/os2/.cvsignore         |  4 ----
     shmem/unix/.cvsignore        |  4 ----
     strings/.cvsignore           |  4 ----
     support/unix/.cvsignore      |  4 ----
     tables/.cvsignore            |  4 ----
     test/.cvsignore              | 45 ------------------------------------
     test/internal/.cvsignore     |  5 ----
     threadproc/beos/.cvsignore   |  6 -----
     threadproc/os2/.cvsignore    |  4 ----
     threadproc/unix/.cvsignore   |  4 ----
     time/unix/.cvsignore         |  4 ----
     user/unix/.cvsignore         |  4 ----
     40 files changed, 252 deletions(-)
     delete mode 100644 .cvsignore
     delete mode 100755 atomic/os390/.cvsignore
     delete mode 100755 atomic/unix/.cvsignore
     delete mode 100644 build/.cvsignore
     delete mode 100644 docs/.cvsignore
     delete mode 100644 dso/aix/.cvsignore
     delete mode 100644 dso/beos/.cvsignore
     delete mode 100644 dso/os2/.cvsignore
     delete mode 100644 dso/os390/.cvsignore
     delete mode 100644 dso/unix/.cvsignore
     delete mode 100644 file_io/os2/.cvsignore
     delete mode 100644 file_io/unix/.cvsignore
     delete mode 100644 include/.cvsignore
     delete mode 100644 include/arch/unix/.cvsignore
     delete mode 100644 locks/beos/.cvsignore
     delete mode 100644 locks/os2/.cvsignore
     delete mode 100644 locks/unix/.cvsignore
     delete mode 100644 memory/unix/.cvsignore
     delete mode 100644 misc/unix/.cvsignore
     delete mode 100644 mmap/unix/.cvsignore
     delete mode 100644 network_io/beos/.cvsignore
     delete mode 100644 network_io/os2/.cvsignore
     delete mode 100644 network_io/unix/.cvsignore
     delete mode 100644 passwd/.cvsignore
     delete mode 100644 poll/os2/.cvsignore
     delete mode 100644 poll/unix/.cvsignore
     delete mode 100644 random/unix/.cvsignore
     delete mode 100644 shmem/beos/.cvsignore
     delete mode 100644 shmem/os2/.cvsignore
     delete mode 100644 shmem/unix/.cvsignore
     delete mode 100644 strings/.cvsignore
     delete mode 100644 support/unix/.cvsignore
     delete mode 100644 tables/.cvsignore
     delete mode 100644 test/.cvsignore
     delete mode 100644 test/internal/.cvsignore
     delete mode 100644 threadproc/beos/.cvsignore
     delete mode 100644 threadproc/os2/.cvsignore
     delete mode 100644 threadproc/unix/.cvsignore
     delete mode 100644 time/unix/.cvsignore
     delete mode 100644 user/unix/.cvsignore
    
    diff --git a/.cvsignore b/.cvsignore
    deleted file mode 100644
    index 13ef1e0e251..00000000000
    --- a/.cvsignore
    +++ /dev/null
    @@ -1,43 +0,0 @@
    -Makefile
    -config.cache
    -config.log
    -config.nice
    -config.status
    -configure
    -libtool
    -apr-config
    -apr-*-config
    -apr-config.out
    -LibD
    -LibR
    -Debug
    -Release
    -*.opt
    -*.plg
    -apr.exp
    -exports.c
    -export_vars.[ch]
    -.libs
    -.deps
    -*.la
    -libapr.rc
    -*.aps
    -*.plg
    -*.dep
    -*.mak
    -*.rc
    -BuildLog.htm
    -*.stc
    -*.stt
    -*.sto
    -*.vcproj
    -autom4te.cache
    -ltcf-c.sh
    -build-outputs.mk
    -.make.dirs
    -*.bb
    -*.bbg
    -*.da
    -coverage
    -apr*.pc
    -apr.spec
    diff --git a/atomic/os390/.cvsignore b/atomic/os390/.cvsignore
    deleted file mode 100755
    index 2ebd06d3517..00000000000
    --- a/atomic/os390/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/atomic/unix/.cvsignore b/atomic/unix/.cvsignore
    deleted file mode 100755
    index 2ebd06d3517..00000000000
    --- a/atomic/unix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/build/.cvsignore b/build/.cvsignore
    deleted file mode 100644
    index 5ec0b033ba0..00000000000
    --- a/build/.cvsignore
    +++ /dev/null
    @@ -1,16 +0,0 @@
    -Makefile
    -libtool.m4
    -ltsugar.m4
    -ltconfig
    -ltmain.sh
    -ltcf-c.sh
    -apr_rules.mk
    -LibD
    -LibR
    -Debug
    -Release
    -*.vcproj
    -*.aps
    -*.plg
    -*.dep
    -*.mak
    diff --git a/docs/.cvsignore b/docs/.cvsignore
    deleted file mode 100644
    index 84a7a796ddd..00000000000
    --- a/docs/.cvsignore
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -*.html
    -dox
    diff --git a/dso/aix/.cvsignore b/dso/aix/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/dso/aix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/dso/beos/.cvsignore b/dso/beos/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/dso/beos/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/dso/os2/.cvsignore b/dso/os2/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/dso/os2/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/dso/os390/.cvsignore b/dso/os390/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/dso/os390/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/dso/unix/.cvsignore b/dso/unix/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/dso/unix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/file_io/os2/.cvsignore b/file_io/os2/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/file_io/os2/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/file_io/unix/.cvsignore b/file_io/unix/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/file_io/unix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/include/.cvsignore b/include/.cvsignore
    deleted file mode 100644
    index 110657831bc..00000000000
    --- a/include/.cvsignore
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -apr.h
    -apr.h.save
    diff --git a/include/arch/unix/.cvsignore b/include/arch/unix/.cvsignore
    deleted file mode 100644
    index 5f4af30ab12..00000000000
    --- a/include/arch/unix/.cvsignore
    +++ /dev/null
    @@ -1,3 +0,0 @@
    -apr_private.h
    -apr_private.h.in
    -apr_private.h.save
    diff --git a/locks/beos/.cvsignore b/locks/beos/.cvsignore
    deleted file mode 100644
    index 7712ce79860..00000000000
    --- a/locks/beos/.cvsignore
    +++ /dev/null
    @@ -1,5 +0,0 @@
    -Makefile
    -*.lo
    -*.slo
    -.libs
    -.deps
    diff --git a/locks/os2/.cvsignore b/locks/os2/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/locks/os2/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/locks/unix/.cvsignore b/locks/unix/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/locks/unix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/memory/unix/.cvsignore b/memory/unix/.cvsignore
    deleted file mode 100644
    index f89ccf3789f..00000000000
    --- a/memory/unix/.cvsignore
    +++ /dev/null
    @@ -1,5 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    -*.o
    diff --git a/misc/unix/.cvsignore b/misc/unix/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/misc/unix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/mmap/unix/.cvsignore b/mmap/unix/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/mmap/unix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/network_io/beos/.cvsignore b/network_io/beos/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/network_io/beos/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/network_io/os2/.cvsignore b/network_io/os2/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/network_io/os2/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/network_io/unix/.cvsignore b/network_io/unix/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/network_io/unix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/passwd/.cvsignore b/passwd/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/passwd/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/poll/os2/.cvsignore b/poll/os2/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/poll/os2/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/poll/unix/.cvsignore b/poll/unix/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/poll/unix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/random/unix/.cvsignore b/random/unix/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/random/unix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/shmem/beos/.cvsignore b/shmem/beos/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/shmem/beos/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/shmem/os2/.cvsignore b/shmem/os2/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/shmem/os2/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/shmem/unix/.cvsignore b/shmem/unix/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/shmem/unix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/strings/.cvsignore b/strings/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/strings/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/support/unix/.cvsignore b/support/unix/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/support/unix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/tables/.cvsignore b/tables/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/tables/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/test/.cvsignore b/test/.cvsignore
    deleted file mode 100644
    index d5249423983..00000000000
    --- a/test/.cvsignore
    +++ /dev/null
    @@ -1,45 +0,0 @@
    -Makefile
    -Debug
    -Release
    -*.lo
    -*.swp
    -*.slo
    -*.la
    -.libs
    -.deps
    -htdigest
    -proctest
    -readchild
    -occhild
    -sendfile
    -aprtest
    -aprtest.ncb
    -aprtest.opt
    -aprtest.plg
    -aprtest.sln
    -aprtest.suo
    -aprtest.vcproj
    -*.ilk
    -*.pdb
    -*.idb
    -mod_test.exp
    -mod_test.lib
    -mod_test.so
    -*.dbg
    -*.core
    -tryread
    -testall
    -testall.ncb
    -testall.opt
    -testall.plg
    -proc_child
    -sockchild
    -globalmutexchild
    -*.bb
    -*.bbg
    -*.da
    -testlockperf
    -testmutexscope
    -testshmconsumer
    -testshmproducer
    -lfstests
    diff --git a/test/internal/.cvsignore b/test/internal/.cvsignore
    deleted file mode 100644
    index 59c0d1c4bd8..00000000000
    --- a/test/internal/.cvsignore
    +++ /dev/null
    @@ -1,5 +0,0 @@
    -Makefile
    -.libs
    -testregex
    -testregex.lo
    -
    diff --git a/threadproc/beos/.cvsignore b/threadproc/beos/.cvsignore
    deleted file mode 100644
    index f82426797b8..00000000000
    --- a/threadproc/beos/.cvsignore
    +++ /dev/null
    @@ -1,6 +0,0 @@
    -Makefile
    -apr_proc_stub
    -*.lo
    -*.slo
    -.libs
    -.deps
    diff --git a/threadproc/os2/.cvsignore b/threadproc/os2/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/threadproc/os2/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/threadproc/unix/.cvsignore b/threadproc/unix/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/threadproc/unix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/time/unix/.cvsignore b/time/unix/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/time/unix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    diff --git a/user/unix/.cvsignore b/user/unix/.cvsignore
    deleted file mode 100644
    index 2ebd06d3517..00000000000
    --- a/user/unix/.cvsignore
    +++ /dev/null
    @@ -1,4 +0,0 @@
    -Makefile
    -*.lo
    -.libs
    -.deps
    
    From 54ecf5b938504ef340eb38ab83020bd45d4f3361 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Thu, 18 Nov 2004 21:30:59 +0000
    Subject: [PATCH 5206/7878] * file_io/unix/readwrite.c (file_printf_flush): New
     function. (apr_file_printf): Rewrite to handle arbitrary length strings.
    
    * test/testfile.c (test_bigfprintf): New function.
    
    PR: 28029
    Submitted by: Chris Knight ,
         Garrett Rooney 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@76283 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/readwrite.c | 47 +++++++++++++++++++++++++++++++---------
     test/testfile.c          | 33 ++++++++++++++++++++++++++++
     2 files changed, 70 insertions(+), 10 deletions(-)
    
    diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c
    index 2334ea1a6bf..4f35dbed512 100644
    --- a/file_io/unix/readwrite.c
    +++ b/file_io/unix/readwrite.c
    @@ -378,22 +378,49 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile)
         return rv;
     }
     
    +struct apr_file_printf_data {
    +    apr_vformatter_buff_t vbuff;
    +    apr_file_t *fptr;
    +    char *buf;
    +};
    +
    +static int file_printf_flush(apr_vformatter_buff_t *buff)
    +{
    +    struct apr_file_printf_data *data = (struct apr_file_printf_data *)buff;
    +
    +    if (apr_file_write_full(data->fptr, data->buf, 
    +                            data->vbuff.curpos - data->buf, NULL)) {
    +        return -1;
    +    }
    +
    +    data->vbuff.curpos = data->buf;
    +    return 0;
    +}
    +
     APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, 
                                             const char *format, ...)
     {
    -    apr_status_t cc;
    +    struct apr_file_printf_data data;
         va_list ap;
    -    char *buf;
    -    int len;
    +    int count;
     
    -    buf = malloc(HUGE_STRING_LEN);
    -    if (buf == NULL) {
    -        return 0;
    +    /* don't really need a HUGE_STRING_LEN anymore */
    +    data.buf = malloc(HUGE_STRING_LEN);
    +    if (data.buf == NULL) {
    +        return -1;
         }
    +    data.vbuff.curpos = data.buf;
    +    data.vbuff.endpos = data.buf + HUGE_STRING_LEN;
    +    data.fptr = fptr;
         va_start(ap, format);
    -    len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap);
    -    cc = apr_file_puts(buf, fptr);
    +    count = apr_vformatter(file_printf_flush,
    +                           (apr_vformatter_buff_t *)&data, format, ap);
    +    /* apr_vformatter does not call flush for the last bits */
    +    if (count >= 0) file_printf_flush((apr_vformatter_buff_t *)&data);
    +
         va_end(ap);
    -    free(buf);
    -    return (cc == APR_SUCCESS) ? len : -1;
    +
    +    free(data.buf);
    +
    +    return count;
     }
    diff --git a/test/testfile.c b/test/testfile.c
    index 8d83ae5d0ce..cce9efebed5 100644
    --- a/test/testfile.c
    +++ b/test/testfile.c
    @@ -592,6 +592,38 @@ static void test_truncate(abts_case *tc, void *data)
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     }
     
    +static void test_bigfprintf(abts_case *tc, void *data)
    +{
    +    apr_file_t *f;
    +    const char *fname = "data/testbigfprintf.dat";
    +    char *to_write;
    +    int i;
    +
    +    apr_file_remove(fname, p);
    +
    +    APR_ASSERT_SUCCESS(tc, "open test file",
    +                       apr_file_open(&f, fname,
    +                                     APR_CREATE|APR_WRITE,
    +                                     APR_UREAD|APR_UWRITE, p));
    +    
    +
    +    to_write = malloc(HUGE_STRING_LEN + 3);
    +
    +    for (i = 0; i < HUGE_STRING_LEN + 1; ++i)
    +        to_write[i] = 'A' + i%26;
    +
    +    strcpy(to_write + HUGE_STRING_LEN, "42");
    +
    +    i = apr_file_printf(f, "%s", to_write);
    +    ABTS_INT_EQUAL(tc, HUGE_STRING_LEN + 2, i);
    +
    +    apr_file_close(f);
    +
    +    file_contents_equal(tc, fname, to_write, HUGE_STRING_LEN + 2);
    +
    +    free(to_write);
    +}
    +
     abts_suite *testfile(abts_suite *suite)
     {
         suite = ADD_SUITE(suite)
    @@ -619,6 +651,7 @@ abts_suite *testfile(abts_suite *suite)
         abts_run_test(suite, test_bigread, NULL);
         abts_run_test(suite, test_mod_neg, NULL);
         abts_run_test(suite, test_truncate, NULL);
    +    abts_run_test(suite, test_bigfprintf, NULL);
     
         return suite;
     }
    
    From ba2bd549caf6632ce2d6fa75d38ba0518ff920ff Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Thu, 18 Nov 2004 21:31:21 +0000
    Subject: [PATCH 5207/7878] Note apr_file_printf rewrite.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@76284 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index 53e83639283..09a4d9cd54c 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -5,6 +5,10 @@ Changes for APR 1.1.0
          and upgrading it to do SHA-256. Not yet ready for prime time.
          [Ben Laurie]
     
    +  *) Rewrite apr_file_printf to handle arbitrary length strings.
    +     PR 28029.  [Chris Knight ,
    +     Garrett Rooney ]
    +
     Changes for APR 1.0.1
     
       *) Fix HUP return codes in pollset when using KQueue.
    
    From 7a38d225be8656fd659484192a19c9f84f9a3285 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Fri, 19 Nov 2004 16:25:08 +0000
    Subject: [PATCH 5208/7878] * test/testshm.c   (test_named): remove shm segment
     for SHARED_FILENAME before creating it.   (test_named_remove): ditto.
    
    Submitted by: Garrett Rooney
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@105827 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testshm.c | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/test/testshm.c b/test/testshm.c
    index 7f3fe6556b7..189f6244063 100644
    --- a/test/testshm.c
    +++ b/test/testshm.c
    @@ -166,6 +166,8 @@ static void test_named(abts_case *tc, void *data)
         apr_exit_why_e why;
         const char *args[4];
     
    +    apr_shm_remove(SHARED_FILENAME, p);
    +
         rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p);
         APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv);
         if (rv != APR_SUCCESS) {
    @@ -220,6 +222,8 @@ static void test_named_remove(abts_case *tc, void *data)
         apr_status_t rv;
         apr_shm_t *shm;
     
    +    apr_shm_remove(SHARED_FILENAME, p);
    +
         rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p);
         APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv);
         if (rv != APR_SUCCESS) {
    
    From 600732205964dfb813b60422c974ae4b10b076d7 Mon Sep 17 00:00:00 2001
    From: Paul Querna 
    Date: Fri, 19 Nov 2004 23:33:16 +0000
    Subject: [PATCH 5209/7878] Add ignores for the generated testbigfprintf.dat
     and testputs.txt
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@105897 13f79535-47bb-0310-9956-ffa450edef68
    
    From ce911b66d439e552e9b1df913be308bc0281b0a8 Mon Sep 17 00:00:00 2001
    From: Paul Querna 
    Date: Fri, 19 Nov 2004 23:38:40 +0000
    Subject: [PATCH 5210/7878] * configure.in: Fix the documentation string for
     '--enable-experimental-libtool'
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@105898 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/configure.in b/configure.in
    index 227972a97bf..e349248b92c 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -135,7 +135,7 @@ dnl prep libtool
     dnl
     echo "performing libtool configuration..."
     
    -AC_ARG_ENABLE(experimental-libtool,[  --experimental-libtool Use experimental custom libtool],
    +AC_ARG_ENABLE(experimental-libtool,[  --enable-experimental-libtool Use experimental custom libtool],
       [experimental_libtool=$enableval],[experimental_libtool=no])
     
     case $host in
    
    From 85782b3d60082689283c041c0d134e51fca0333f Mon Sep 17 00:00:00 2001
    From: Paul Querna 
    Date: Fri, 19 Nov 2004 23:53:52 +0000
    Subject: [PATCH 5211/7878] * poll/unix/poll.c: Remove Trailing Whitespace. No
     Functional Changes.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@105899 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/unix/poll.c | 12 ++++++------
     1 file changed, 6 insertions(+), 6 deletions(-)
    
    diff --git a/poll/unix/poll.c b/poll/unix/poll.c
    index b03b086f3ec..64a948cd557 100644
    --- a/poll/unix/poll.c
    +++ b/poll/unix/poll.c
    @@ -107,17 +107,17 @@ static apr_int16_t get_event(apr_int16_t event)
         apr_int16_t rv = 0;
     
         if (event & APR_POLLIN)
    -        rv |= POLLIN;        
    +        rv |= POLLIN;
         if (event & APR_POLLPRI)
    -        rv |= POLLPRI;        
    +        rv |= POLLPRI;
         if (event & APR_POLLOUT)
    -        rv |= POLLOUT;       
    +        rv |= POLLOUT;
         if (event & APR_POLLERR)
    -        rv |= POLLERR;        
    +        rv |= POLLERR;
         if (event & APR_POLLHUP)
    -        rv |= POLLHUP;        
    +        rv |= POLLHUP;
         if (event & APR_POLLNVAL)
    -        rv |= POLLNVAL;        
    +        rv |= POLLNVAL;
     
         return rv;
     }
    
    From e9cf88223e5ff75ef5d717add7bf751710605120 Mon Sep 17 00:00:00 2001
    From: Paul Querna 
    Date: Sat, 20 Nov 2004 00:05:47 +0000
    Subject: [PATCH 5212/7878] * poll/unix/poll.c: Remove trailing more whitespace
     and fix 'apr_poll' to layout the args correctly.  Style Only. No Functional
     Changes.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@105902 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/unix/poll.c | 5 +++--
     1 file changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/poll/unix/poll.c b/poll/unix/poll.c
    index 64a948cd557..42ecb480de0 100644
    --- a/poll/unix/poll.c
    +++ b/poll/unix/poll.c
    @@ -140,12 +140,13 @@ static apr_int16_t get_revent(apr_int16_t event)
             rv |= APR_POLLNVAL;
     
         return rv;
    -}        
    +}
     
     #define SMALL_POLLSET_LIMIT  8
     
     APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num,
    -                      apr_int32_t *nsds, apr_interval_time_t timeout)
    +                                   apr_int32_t *nsds, 
    +                                   apr_interval_time_t timeout)
     {
         int i, num_to_poll;
     #ifdef HAVE_VLA
    
    From 1ffebfa82ccc4de1453a064c70d51494eb83afb1 Mon Sep 17 00:00:00 2001
    From: Paul Querna 
    Date: Sat, 20 Nov 2004 00:28:19 +0000
    Subject: [PATCH 5213/7878] This commit may break the win32 or netware builds
     because of the added files.
    
    Added the APR_POLLSET_THREADSAFE flag for apr_pollset_create().
    The flag is only supported by the KQueue or EPoll backends at this time.
    All others should return ENOTIMPL.
    
    Split poll/unix/poll.c into one file for each backend to better maintain them.
    
    Tested On: FreeBSD 5.2.1, Linux 2.6 and OS X 10.3.6.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@105905 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                                   |   7 +
     include/apr_poll.h                        |   5 +
     include/arch/unix/apr_arch_poll_private.h |  92 +++
     poll/unix/epoll.c                         | 270 ++++++++
     poll/unix/kqueue.c                        | 288 +++++++++
     poll/unix/poll.c                          | 722 +---------------------
     poll/unix/select.c                        | 392 ++++++++++++
     7 files changed, 1072 insertions(+), 704 deletions(-)
     create mode 100644 include/arch/unix/apr_arch_poll_private.h
     create mode 100644 poll/unix/epoll.c
     create mode 100644 poll/unix/kqueue.c
     create mode 100644 poll/unix/select.c
    
    diff --git a/CHANGES b/CHANGES
    index 09a4d9cd54c..1a513070137 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -5,6 +5,13 @@ Changes for APR 1.1.0
          and upgrading it to do SHA-256. Not yet ready for prime time.
          [Ben Laurie]
     
    +  *) Added the APR_POLLSET_THREADSAFE flag. This allows multiple threads
    +     to call the Pollset Add or Remove functions in a thread safe manner.
    +     Currently only EPoll and KQueue support this flag. [Paul Querna]
    +
    +  *) Split poll/unix/poll.c into separate files for each Poll or Pollset 
    +     implementation. [Paul Querna]
    +
       *) Rewrite apr_file_printf to handle arbitrary length strings.
          PR 28029.  [Chris Knight ,
          Garrett Rooney ]
    diff --git a/include/apr_poll.h b/include/apr_poll.h
    index cc8920824f9..0584b09f372 100644
    --- a/include/apr_poll.h
    +++ b/include/apr_poll.h
    @@ -50,6 +50,11 @@ extern "C" {
     #define APR_POLLHUP   0x020     /**< Hangup occurred */
     #define APR_POLLNVAL  0x040     /**< Descriptior invalid */
     
    +/**
    + * Pollset Flags
    + */
    +#define APR_POLLSET_THREADSAFE 0x001 /**< Adding or Removing a Descriptor is thread safe */
    +
     /** Used in apr_pollfd_t to determine what the apr_descriptor is */
     typedef enum { 
         APR_NO_DESC,                /**< nothing here */
    diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h
    new file mode 100644
    index 00000000000..5a9ee6e6e37
    --- /dev/null
    +++ b/include/arch/unix/apr_arch_poll_private.h
    @@ -0,0 +1,92 @@
    +/* Copyright 2000-2004 The Apache Software Foundation
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +#ifndef APR_ARCH_POLL_PRIVATE_H
    +#define APR_ARCH_POLL_PRIVATE_H
    +
    +#include "apr.h"
    +#include "apr_poll.h"
    +#include "apr_time.h"
    +#include "apr_portable.h"
    +#include "apr_arch_networkio.h"
    +#include "apr_arch_file_io.h"
    +
    +#if HAVE_POLL_H
    +#include 
    +#endif
    +
    +#if HAVE_SYS_POLL_H
    +#include 
    +#endif
    +
    +#ifdef HAVE_KQUEUE
    +#include 
    +#include 
    +#include 
    +#endif
    +
    +#ifdef HAVE_EPOLL
    +#include 
    +#endif
    +
    +#ifdef NETWARE
    +#define HAS_SOCKETS(dt) (dt == APR_POLL_SOCKET) ? 1 : 0
    +#define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0
    +#endif
    +
    +/* Choose the best method platform specific to use in apr_pollset */
    +#ifdef HAVE_KQUEUE
    +#define POLLSET_USES_KQUEUE
    +#elif defined(HAVE_EPOLL)
    +#define POLLSET_USES_EPOLL
    +#elif defined(HAVE_POLL)
    +#define POLLSET_USES_POLL
    +#else
    +#define POLLSET_USES_SELECT
    +#endif
    +
    +#ifdef HAVE_POLL
    +#define POLL_USES_POLL
    +#else
    +#define POLL_USES_SELECT
    +#endif
    +
    +#if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL)
    +
    +#include "apr_ring.h"
    +
    +#if APR_HAS_THREADS
    +#include "apr_thread_mutex.h"
    +#define pollset_lock_rings() \
    +    if(pollset->flags & APR_POLLSET_THREADSAFE) \
    +        apr_thread_mutex_lock(pollset->ring_lock);
    +#define pollset_unlock_rings() \
    +    if(pollset->flags & APR_POLLSET_THREADSAFE) \
    +        apr_thread_mutex_unlock(pollset->ring_lock);
    +#else
    +#define pollset_lock_rings()
    +#define pollset_unlock_rings()
    +#endif
    +
    +typedef struct pfd_elem_t pfd_elem_t;
    +
    +struct pfd_elem_t {
    +    APR_RING_ENTRY(pfd_elem_t) link;
    +    apr_pollfd_t pfd;
    +};
    +
    +#endif
    +
    +#endif /* APR_ARCH_POLL_PRIVATE_H */
    diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c
    new file mode 100644
    index 00000000000..9bc4a7d9c2e
    --- /dev/null
    +++ b/poll/unix/epoll.c
    @@ -0,0 +1,270 @@
    +/* Copyright 2000-2004 The Apache Software Foundation
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +#include "apr_arch_poll_private.h"
    +
    +#ifdef POLLSET_USES_EPOLL
    +
    +static apr_int16_t get_epoll_event(apr_int16_t event)
    +{
    +    apr_int16_t rv = 0;
    +
    +    if (event & APR_POLLIN)
    +        rv |= EPOLLIN;
    +    if (event & APR_POLLPRI)
    +        rv |= EPOLLPRI;
    +    if (event & APR_POLLOUT)
    +        rv |= EPOLLOUT;
    +    if (event & APR_POLLERR)
    +        rv |= EPOLLERR;
    +    if (event & APR_POLLHUP)
    +        rv |= EPOLLHUP;
    +    /* APR_POLLNVAL is not handled by epoll. */
    +
    +    return rv;
    +}
    +
    +static apr_int16_t get_epoll_revent(apr_int16_t event)
    +{
    +    apr_int16_t rv = 0;
    +
    +    if (event & EPOLLIN)
    +        rv |= APR_POLLIN;
    +    if (event & EPOLLPRI)
    +        rv |= APR_POLLPRI;
    +    if (event & EPOLLOUT)
    +        rv |= APR_POLLOUT;
    +    if (event & EPOLLERR)
    +        rv |= APR_POLLERR;
    +    if (event & EPOLLHUP)
    +        rv |= APR_POLLHUP;
    +    /* APR_POLLNVAL is not handled by epoll. */
    +
    +    return rv;
    +}
    +
    +struct apr_pollset_t
    +{
    +    apr_pool_t *pool;
    +    apr_uint32_t nelts;
    +    apr_uint32_t nalloc;
    +    int epoll_fd;
    +    struct epoll_event *pollset;
    +    apr_pollfd_t *result_set;
    +    apr_uint32_t flags;
    +#if APR_HAS_THREADS
    +    /* A thread mutex to protect operations on the rings */
    +    apr_thread_mutex_t *ring_lock;
    +#endif
    +    /* A ring containing all of the pollfd_t that are active */
    +    APR_RING_HEAD(pfd_query_ring_t, pfd_elem_t) query_ring;
    +    /* A ring of pollfd_t that have been used, and then _remove()'d */
    +    APR_RING_HEAD(pfd_free_ring_t, pfd_elem_t) free_ring;
    +    /* A ring of pollfd_t where rings that have been _remove()`ed but
    +        might still be inside a _poll() */
    +    APR_RING_HEAD(pfd_dead_ring_t, pfd_elem_t) dead_ring;
    +};
    +
    +static apr_status_t backend_cleanup(void *p_)
    +{
    +    apr_pollset_t *pollset = (apr_pollset_t *) p_;
    +    close(pollset->epoll_fd);
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
    +                                             apr_uint32_t size,
    +                                             apr_pool_t *p,
    +                                             apr_uint32_t flags)
    +{
    +    apr_status_t rv;
    +
    +    *pollset = apr_palloc(p, sizeof(**pollset));
    +#if APR_HAS_THREADS
    +    if (flags & APR_POLLSET_THREADSAFE &&
    +        ((rv = apr_thread_mutex_create(&(*pollset)->ring_lock,
    +                                       APR_THREAD_MUTEX_DEFAULT,
    +                                       p) != APR_SUCCESS))) {
    +        *pollset = NULL;
    +        return rv;
    +    }
    +#else
    +    if (flags & APR_POLLSET_THREADSAFE) {
    +        *pollset = NULL;
    +        return APR_ENOTIMPL;
    +    }
    +#endif
    +    (*pollset)->nelts = 0;
    +    (*pollset)->nalloc = size;
    +    (*pollset)->flags = flags;
    +    (*pollset)->pool = p;
    +    (*pollset)->epoll_fd = epoll_create(size);
    +    (*pollset)->pollset = apr_palloc(p, size * sizeof(struct epoll_event));
    +    apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup,
    +                              apr_pool_cleanup_null);
    +    (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t));
    +
    +    APR_RING_INIT(&(*pollset)->query_ring, pfd_elem_t, link);
    +    APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link);
    +    APR_RING_INIT(&(*pollset)->dead_ring, pfd_elem_t, link);
    +
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset)
    +{
    +    return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup);
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset,
    +                                          const apr_pollfd_t *descriptor)
    +{
    +    struct epoll_event ev;
    +    int ret = -1;
    +    pfd_elem_t *elem;
    +    apr_status_t rv = APR_SUCCESS;
    +
    +    pollset_lock_rings();
    +
    +    if (!APR_RING_EMPTY(&(pollset->free_ring), pfd_elem_t, link)) {
    +        elem = APR_RING_FIRST(&(pollset->free_ring));
    +        APR_RING_REMOVE(elem, link);
    +    }
    +    else {
    +        elem = (pfd_elem_t *) apr_palloc(pollset->pool, sizeof(pfd_elem_t));
    +        APR_RING_ELEM_INIT(elem, link);
    +    }
    +    elem->pfd = *descriptor;
    +
    +    ev.events = get_epoll_event(descriptor->reqevents);
    +    ev.data.ptr = elem;
    +    if (descriptor->desc_type == APR_POLL_SOCKET) {
    +        ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_ADD,
    +                        descriptor->desc.s->socketdes, &ev);
    +    }
    +    else {
    +        ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_ADD,
    +                        descriptor->desc.f->filedes, &ev);
    +    }
    +
    +    if (0 != ret) {
    +        rv = APR_EBADF;
    +        APR_RING_INSERT_TAIL(&(pollset->free_ring), elem, pfd_elem_t, link);
    +    }
    +    else {
    +        pollset->nelts++;
    +        APR_RING_INSERT_TAIL(&(pollset->query_ring), elem, pfd_elem_t, link);
    +    }
    +
    +    pollset_unlock_rings();
    +
    +    return rv;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset,
    +                                             const apr_pollfd_t *descriptor)
    +{
    +    pfd_elem_t *ep;
    +    apr_status_t rv = APR_SUCCESS;
    +    struct epoll_event ev;
    +    int ret = -1;
    +
    +    pollset_lock_rings();
    +
    +    ev.events = get_epoll_event(descriptor->reqevents);
    +
    +    if (descriptor->desc_type == APR_POLL_SOCKET) {
    +        ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_DEL,
    +                        descriptor->desc.s->socketdes, &ev);
    +    }
    +    else {
    +        ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_DEL,
    +                        descriptor->desc.f->filedes, &ev);
    +    }
    +    if (ret < 0) {
    +        rv = APR_NOTFOUND;
    +    }
    +
    +    if (!APR_RING_EMPTY(&(pollset->query_ring), pfd_elem_t, link)) {
    +        for (ep = APR_RING_FIRST(&(pollset->query_ring));
    +             ep != APR_RING_SENTINEL(&(pollset->query_ring),
    +                                     pfd_elem_t, link);
    +             ep = APR_RING_NEXT(ep, link)) {
    +
    +            if (descriptor->desc.s == ep->pfd.desc.s) {
    +                APR_RING_REMOVE(ep, link);
    +                APR_RING_INSERT_TAIL(&(pollset->dead_ring),
    +                                     ep, pfd_elem_t, link);
    +                break;
    +            }
    +        }
    +    }
    +
    +    pollset_unlock_rings();
    +
    +    return rv;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
    +                                           apr_interval_time_t timeout,
    +                                           apr_int32_t *num,
    +                                           const apr_pollfd_t **descriptors)
    +{
    +    int ret, i;
    +    apr_status_t rv = APR_SUCCESS;
    +    pfd_elem_t *ep;
    +
    +    if (timeout > 0) {
    +        timeout /= 1000;
    +    }
    +
    +    ret = epoll_wait(pollset->epoll_fd, pollset->pollset, pollset->nalloc,
    +                     timeout);
    +    (*num) = ret;
    +
    +    if (ret < 0) {
    +        rv = apr_get_netos_error();
    +    }
    +    else if (ret == 0) {
    +        rv = APR_TIMEUP;
    +    }
    +    else {
    +        for (i = 0; i < ret; i++) {
    +            pollset->result_set[i] =
    +                (((pfd_elem_t *) (pollset->pollset[i].data.ptr))->pfd);
    +            pollset->result_set[i].rtnevents =
    +                get_epoll_revent(pollset->pollset[i].events);
    +        }
    +
    +        if (descriptors) {
    +            *descriptors = pollset->result_set;
    +        }
    +    }
    +
    +    pollset_lock_rings();
    +
    +    /* Shift all PFDs in the Dead Ring to be Free Ring */
    +    while (!APR_RING_EMPTY(&(pollset->dead_ring), pfd_elem_t, link)) {
    +        ep = APR_RING_FIRST(&(pollset->dead_ring));
    +        APR_RING_REMOVE(ep, link);
    +        APR_RING_INSERT_TAIL(&(pollset->free_ring), ep, pfd_elem_t, link);
    +    }
    +
    +    pollset_unlock_rings();
    +
    +    return rv;
    +}
    +
    +#endif /* POLLSET_USES_EPOLL */
    diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c
    new file mode 100644
    index 00000000000..daf46369db1
    --- /dev/null
    +++ b/poll/unix/kqueue.c
    @@ -0,0 +1,288 @@
    +/* Copyright 2000-2004 The Apache Software Foundation
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +#include "apr_arch_poll_private.h"
    +
    +#ifdef POLLSET_USES_KQUEUE
    +
    +static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags)
    +{
    +    apr_int16_t rv = 0;
    +
    +    if (event & EVFILT_READ)
    +        rv |= APR_POLLIN;
    +    if (event & EVFILT_WRITE)
    +        rv |= APR_POLLOUT;
    +    if (flags & EV_EOF)
    +        rv |= APR_POLLHUP;
    +    if (flags & EV_ERROR)
    +        rv |= APR_POLLERR;
    +
    +    return rv;
    +}
    +
    +struct apr_pollset_t
    +{
    +    apr_pool_t *pool;
    +    apr_uint32_t nelts;
    +    apr_uint32_t nalloc;
    +    int kqueue_fd;
    +    struct kevent kevent;
    +    struct kevent *ke_set;
    +    apr_pollfd_t *result_set;
    +    apr_uint32_t flags;
    +#if APR_HAS_THREADS
    +    /* A thread mutex to protect operations on the rings */
    +    apr_thread_mutex_t *ring_lock;
    +#endif
    +    /* A ring containing all of the pollfd_t that are active */
    +    APR_RING_HEAD(pfd_query_ring_t, pfd_elem_t) query_ring;
    +    /* A ring of pollfd_t that have been used, and then _remove'd */
    +    APR_RING_HEAD(pfd_free_ring_t, pfd_elem_t) free_ring;
    +    /* A ring of pollfd_t where rings that have been _remove'd but
    +       might still be inside a _poll */
    +    APR_RING_HEAD(pfd_dead_ring_t, pfd_elem_t) dead_ring;
    +};
    +
    +static apr_status_t backend_cleanup(void *p_)
    +{
    +    apr_pollset_t *pollset = (apr_pollset_t *) p_;
    +    close(pollset->kqueue_fd);
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
    +                                             apr_uint32_t size,
    +                                             apr_pool_t *p,
    +                                             apr_uint32_t flags)
    +{
    +    apr_status_t rv = APR_SUCCESS;
    +    *pollset = apr_palloc(p, sizeof(**pollset));
    +#if APR_HAS_THREADS
    +    if (flags & APR_POLLSET_THREADSAFE &&
    +        ((rv = apr_thread_mutex_create(&(*pollset)->ring_lock,
    +                                       APR_THREAD_MUTEX_DEFAULT,
    +                                       p) != APR_SUCCESS))) {
    +        *pollset = NULL;
    +        return rv;
    +    }
    +#else
    +    if (flags & APR_POLLSET_THREADSAFE) {
    +        *pollset = NULL;
    +        return APR_ENOTIMPL;
    +    }
    +#endif
    +    (*pollset)->nelts = 0;
    +    (*pollset)->nalloc = size;
    +    (*pollset)->flags = flags;
    +    (*pollset)->pool = p;
    +
    +    (*pollset)->ke_set =
    +        (struct kevent *) apr_palloc(p, size * sizeof(struct kevent));
    +
    +    memset((*pollset)->ke_set, 0, size * sizeof(struct kevent));
    +
    +    (*pollset)->kqueue_fd = kqueue();
    +
    +    if ((*pollset)->kqueue_fd == -1) {
    +        return APR_ENOMEM;
    +    }
    +
    +    apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup,
    +                              apr_pool_cleanup_null);
    +
    +    (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t));
    +
    +    APR_RING_INIT(&(*pollset)->query_ring, pfd_elem_t, link);
    +    APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link);
    +    APR_RING_INIT(&(*pollset)->dead_ring, pfd_elem_t, link);
    +
    +    return rv;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t * pollset)
    +{
    +    return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup);
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset,
    +                                          const apr_pollfd_t *descriptor)
    +{
    +    apr_os_sock_t fd;
    +    pfd_elem_t *elem;
    +    apr_status_t rv = APR_SUCCESS;
    +
    +    pollset_lock_rings();
    +
    +    if (!APR_RING_EMPTY(&(pollset->free_ring), pfd_elem_t, link)) {
    +        elem = APR_RING_FIRST(&(pollset->free_ring));
    +        APR_RING_REMOVE(elem, link);
    +    }
    +    else {
    +        elem = (pfd_elem_t *) apr_palloc(pollset->pool, sizeof(pfd_elem_t));
    +        APR_RING_ELEM_INIT(elem, link);
    +    }
    +    elem->pfd = *descriptor;
    +
    +    if (descriptor->desc_type == APR_POLL_SOCKET) {
    +        fd = descriptor->desc.s->socketdes;
    +    }
    +    else {
    +        fd = descriptor->desc.f->filedes;
    +    }
    +
    +    if (descriptor->reqevents & APR_POLLIN) {
    +        EV_SET(&pollset->kevent, fd, EVFILT_READ, EV_ADD, 0, 0, elem);
    +
    +        if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0,
    +                   NULL) == -1) {
    +            rv = APR_ENOMEM;
    +        }
    +    }
    +
    +    if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) {
    +        EV_SET(&pollset->kevent, fd, EVFILT_WRITE, EV_ADD, 0, 0, elem);
    +
    +        if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0,
    +                   NULL) == -1) {
    +            rv = APR_ENOMEM;
    +        }
    +    }
    +
    +    if (rv == APR_SUCCESS) {
    +        pollset->nelts++;
    +        APR_RING_INSERT_TAIL(&(pollset->query_ring), elem, pfd_elem_t, link);
    +    }
    +    else {
    +        APR_RING_INSERT_TAIL(&(pollset->free_ring), elem, pfd_elem_t, link);
    +    }
    +
    +    pollset_unlock_rings();
    +
    +    return rv;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset,
    +                                             const apr_pollfd_t *descriptor)
    +{
    +    pfd_elem_t *ep;
    +    apr_status_t rv = APR_SUCCESS;
    +    apr_os_sock_t fd;
    +
    +    pollset_lock_rings();
    +
    +    if (descriptor->desc_type == APR_POLL_SOCKET) {
    +        fd = descriptor->desc.s->socketdes;
    +    }
    +    else {
    +        fd = descriptor->desc.f->filedes;
    +    }
    +
    +    if (descriptor->reqevents & APR_POLLIN) {
    +        EV_SET(&pollset->kevent, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL);
    +
    +        if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0,
    +                   NULL) == -1) {
    +            rv = APR_NOTFOUND;
    +        }
    +    }
    +
    +    if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) {
    +        EV_SET(&pollset->kevent, fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL);
    +
    +        if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0,
    +                   NULL) == -1) {
    +            rv = APR_NOTFOUND;
    +        }
    +    }
    +
    +    if (!APR_RING_EMPTY(&(pollset->query_ring), pfd_elem_t, link)) {
    +        for (ep = APR_RING_FIRST(&(pollset->query_ring));
    +             ep != APR_RING_SENTINEL(&(pollset->query_ring),
    +                                     pfd_elem_t, link);
    +             ep = APR_RING_NEXT(ep, link)) {
    +
    +            if (descriptor->desc.s == ep->pfd.desc.s) {
    +                APR_RING_REMOVE(ep, link);
    +                APR_RING_INSERT_TAIL(&(pollset->dead_ring),
    +                                     ep, pfd_elem_t, link);
    +                break;
    +            }
    +        }
    +    }
    +
    +    pollset_unlock_rings();
    +
    +    return rv;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
    +                                           apr_interval_time_t timeout,
    +                                           apr_int32_t *num,
    +                                           const apr_pollfd_t **descriptors)
    +{
    +    int ret, i;
    +    pfd_elem_t *ep;
    +    struct timespec tv, *tvptr;
    +    apr_status_t rv = APR_SUCCESS;
    +
    +    if (timeout < 0) {
    +        tvptr = NULL;
    +    }
    +    else {
    +        tv.tv_sec = (long) apr_time_sec(timeout);
    +        tv.tv_nsec = (long) apr_time_msec(timeout);
    +        tvptr = &tv;
    +    }
    +
    +    ret = kevent(pollset->kqueue_fd, NULL, 0, pollset->ke_set, pollset->nalloc,
    +                tvptr);
    +    (*num) = ret;
    +    if (ret < 0) {
    +        rv = apr_get_netos_error();
    +    }
    +    else if (ret == 0) {
    +        rv = APR_TIMEUP;
    +    }
    +    else {
    +        for (i = 0; i < ret; i++) {
    +            pollset->result_set[i] =
    +                (((pfd_elem_t*)(pollset->ke_set[i].udata))->pfd);
    +            pollset->result_set[i].rtnevents =
    +                get_kqueue_revent(pollset->ke_set[i].filter,
    +                              pollset->ke_set[i].flags);
    +        }
    +
    +        if (descriptors) {
    +            *descriptors = pollset->result_set;
    +        }
    +    }
    +
    +
    +    pollset_lock_rings();
    +
    +    /* Shift all PFDs in the Dead Ring to be Free Ring */
    +    while (!APR_RING_EMPTY(&(pollset->dead_ring), pfd_elem_t, link)) {
    +        ep = APR_RING_FIRST(&(pollset->dead_ring));
    +        APR_RING_REMOVE(ep, link);
    +        APR_RING_INSERT_TAIL(&(pollset->free_ring), ep, pfd_elem_t, link);
    +    }
    +
    +    pollset_unlock_rings();
    +
    +    return rv;
    +}
    +
    +#endif /* POLLSET_USES_KQUEUE */
    diff --git a/poll/unix/poll.c b/poll/unix/poll.c
    index 42ecb480de0..b2da0507994 100644
    --- a/poll/unix/poll.c
    +++ b/poll/unix/poll.c
    @@ -13,94 +13,9 @@
      * limitations under the License.
      */
     
    -#include "apr.h"
    -#include "apr_poll.h"
    -#include "apr_time.h"
    -#include "apr_portable.h"
    -#include "apr_arch_networkio.h"
    -#include "apr_arch_file_io.h"
    -#if HAVE_POLL_H
    -#include 
    -#endif
    -#if HAVE_SYS_POLL_H
    -#include 
    -#endif
    -
    -#ifdef HAVE_KQUEUE
    -#include 
    -#include 
    -#include 
    -#endif
    -
    -#ifdef HAVE_EPOLL
    -#include 
    -#endif
    -
    -#ifdef NETWARE
    -#define HAS_SOCKETS(dt) (dt == APR_POLL_SOCKET) ? 1 : 0
    -#define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0
    -#endif
    -
    -#ifdef HAVE_KQUEUE
    -static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags)
    -{
    -    apr_int16_t rv = 0;
    -
    -    if (event & EVFILT_READ)
    -        rv |= APR_POLLIN;
    -    if (event & EVFILT_WRITE)
    -        rv |= APR_POLLOUT;
    -    if (flags & EV_EOF)
    -        rv |= APR_POLLHUP;
    -    if (flags & EV_ERROR)
    -        rv |= APR_POLLERR;
    -
    -    return rv;
    -}
    -
    -#endif
    +#include "apr_arch_poll_private.h"
     
    -#ifdef HAVE_EPOLL
    -static apr_int16_t get_epoll_event(apr_int16_t event)
    -{
    -    apr_int16_t rv = 0;
    -
    -    if (event & APR_POLLIN)
    -        rv |= EPOLLIN;
    -    if (event & APR_POLLPRI)
    -        rv |= EPOLLPRI;
    -    if (event & APR_POLLOUT)
    -        rv |= EPOLLOUT;
    -    if (event & APR_POLLERR)
    -        rv |= EPOLLERR;
    -    if (event & APR_POLLHUP)
    -        rv |= EPOLLHUP;
    -    /* APR_POLLNVAL is not handled by epoll. */
    -
    -    return rv;
    -}
    -
    -static apr_int16_t get_epoll_revent(apr_int16_t event)
    -{
    -    apr_int16_t rv = 0;
    -
    -    if (event & EPOLLIN)
    -        rv |= APR_POLLIN;
    -    if (event & EPOLLPRI)
    -        rv |= APR_POLLPRI;
    -    if (event & EPOLLOUT)
    -        rv |= APR_POLLOUT;
    -    if (event & EPOLLERR)
    -        rv |= APR_POLLERR;
    -    if (event & EPOLLHUP)
    -        rv |= APR_POLLHUP;
    -    /* APR_POLLNVAL is not handled by epoll. */
    -
    -    return rv;
    -}
    -#endif
    -
    -#ifdef HAVE_POLL    /* We can just use poll to do our socket polling. */
    +#if defined(POLL_USES_POLL) || defined(POLLSET_USES_POLL)
     
     static apr_int16_t get_event(apr_int16_t event)
     {
    @@ -142,6 +57,11 @@ static apr_int16_t get_revent(apr_int16_t event)
         return rv;
     }
     
    +#endif /* POLL_USES_POLL || POLLSET_USES_POLL */
    +
    +
    +#ifdef POLL_USES_POLL
    +
     #define SMALL_POLLSET_LIMIT  8
     
     APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num,
    @@ -216,298 +136,55 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num,
     }
     
     
    -#else    /* Use select to mimic poll */
    -
    -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *nsds, 
    -		    apr_interval_time_t timeout)
    -{
    -    fd_set readset, writeset, exceptset;
    -    int rv, i;
    -    int maxfd = -1;
    -    struct timeval tv, *tvptr;
    -#ifdef NETWARE
    -    apr_datatype_e set_type = APR_NO_DESC;
    -#endif
    -
    -    if (timeout < 0) {
    -        tvptr = NULL;
    -    }
    -    else {
    -        tv.tv_sec = (long)apr_time_sec(timeout);
    -        tv.tv_usec = (long)apr_time_usec(timeout);
    -        tvptr = &tv;
    -    }
    -
    -    FD_ZERO(&readset);
    -    FD_ZERO(&writeset);
    -    FD_ZERO(&exceptset);
    -
    -    for (i = 0; i < num; i++) {
    -        apr_os_sock_t fd;
    -
    -        aprset[i].rtnevents = 0;
    -
    -        if (aprset[i].desc_type == APR_POLL_SOCKET) {
    -#ifdef NETWARE
    -            if (HAS_PIPES(set_type)) {
    -                return APR_EBADF;
    -            }
    -            else {
    -                set_type = APR_POLL_SOCKET;
    -            }
    -#endif
    -            fd = aprset[i].desc.s->socketdes;
    -        }
    -        else if (aprset[i].desc_type == APR_POLL_FILE) {
    -#if !APR_FILES_AS_SOCKETS
    -            return APR_EBADF;
    -#else
    -#ifdef NETWARE
    -            if (aprset[i].desc.f->is_pipe && !HAS_SOCKETS(set_type)) {
    -                set_type = APR_POLL_FILE;
    -            }
    -            else
    -                return APR_EBADF;
    -#endif /* NETWARE */
    -
    -            fd = aprset[i].desc.f->filedes;
    -
    -#endif /* APR_FILES_AS_SOCKETS */
    -        }
    -        else {
    -            break;
    -        }
    -#if !defined(WIN32) && !defined(NETWARE) /* socket sets handled with array of handles */
    -        if (fd >= FD_SETSIZE) {
    -            /* XXX invent new error code so application has a clue */
    -            return APR_EBADF;
    -        }
    -#endif
    -        if (aprset[i].reqevents & APR_POLLIN) {
    -            FD_SET(fd, &readset);
    -        }
    -        if (aprset[i].reqevents & APR_POLLOUT) {
    -            FD_SET(fd, &writeset);
    -        }
    -        if (aprset[i].reqevents & 
    -            (APR_POLLPRI | APR_POLLERR | APR_POLLHUP | APR_POLLNVAL)) {
    -            FD_SET(fd, &exceptset);
    -        }
    -        if ((int)fd > maxfd) {
    -            maxfd = (int)fd;
    -        }
    -    }
    -
    -#ifdef NETWARE
    -    if (HAS_PIPES(set_type)) {
    -        rv = pipe_select(maxfd + 1, &readset, &writeset, &exceptset, tvptr);
    -    }
    -    else {
    -#endif
    -
    -    rv = select(maxfd + 1, &readset, &writeset, &exceptset, tvptr);
    -
    -#ifdef NETWARE
    -    }
    -#endif
    -
    -    (*nsds) = rv;
    -    if ((*nsds) == 0) {
    -        return APR_TIMEUP;
    -    }
    -    if ((*nsds) < 0) {
    -        return apr_get_netos_error();
    -    }
    -
    -    for (i = 0; i < num; i++) {
    -        apr_os_sock_t fd;
    -
    -        if (aprset[i].desc_type == APR_POLL_SOCKET) {
    -            fd = aprset[i].desc.s->socketdes;
    -        }
    -        else if (aprset[i].desc_type == APR_POLL_FILE) {
    -#if !APR_FILES_AS_SOCKETS
    -            return APR_EBADF;
    -#else
    -            fd = aprset[i].desc.f->filedes;
    -#endif
    -        }
    -        else {
    -            break;
    -        }
    -        if (FD_ISSET(fd, &readset)) {
    -            aprset[i].rtnevents |= APR_POLLIN;
    -        }
    -        if (FD_ISSET(fd, &writeset)) {
    -            aprset[i].rtnevents |= APR_POLLOUT;
    -        }
    -        if (FD_ISSET(fd, &exceptset)) {
    -            aprset[i].rtnevents |= APR_POLLERR;
    -        }
    -    }
    +#endif /* POLL_USES_POLL */
     
    -    return APR_SUCCESS;
    -}
     
    -#endif 
    +#ifdef POLLSET_USES_POLL
     
    -struct apr_pollset_t {
    +struct apr_pollset_t
    +{
         apr_pool_t *pool;
    -
         apr_uint32_t nelts;
         apr_uint32_t nalloc;
    -#ifdef HAVE_KQUEUE
    -    int kqueue_fd;
    -    struct kevent kevent;
    -    struct kevent *ke_set;
    -#elif defined(HAVE_EPOLL)
    -    int epoll_fd;
    -    struct epoll_event *pollset;
    -#elif defined(HAVE_POLL)
         struct pollfd *pollset;
    -#else
    -    fd_set readset, writeset, exceptset;
    -    int maxfd;
    -#endif
         apr_pollfd_t *query_set;
         apr_pollfd_t *result_set;
    -
    -#ifdef NETWARE
    -    int set_type;
    -#endif
     };
     
    -#if defined(HAVE_KQUEUE) || defined(HAVE_EPOLL)
    -static apr_status_t backend_cleanup(void *p_)
    -{
    -    apr_pollset_t *pollset = (apr_pollset_t *)p_;
    -#ifdef HAVE_KQUEUE
    -    close(pollset->kqueue_fd);
    -#elif defined(HAVE_EPOLL)
    -    close(pollset->epoll_fd);
    -#endif
    -    return APR_SUCCESS;
    -}
    -#endif /* HAVE_KQUEUE || HAVE_EPOLL */
    -
     APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
                                                  apr_uint32_t size,
                                                  apr_pool_t *p,
                                                  apr_uint32_t flags)
     {
    -#if !defined(HAVE_KQUEUE) && !defined(HAVE_EPOLL) && !defined(HAVE_POLL) && defined(FD_SETSIZE)
    -    if (size > FD_SETSIZE) {
    +    if (flags & APR_POLLSET_THREADSAFE) {                
             *pollset = NULL;
    -        return APR_EINVAL;
    +        return APR_ENOTIMPL;
         }
    -#endif
    +
         *pollset = apr_palloc(p, sizeof(**pollset));
         (*pollset)->nelts = 0;
         (*pollset)->nalloc = size;
         (*pollset)->pool = p;
    -#ifdef HAVE_KQUEUE
    -    (*pollset)->ke_set = (struct kevent*)apr_palloc(p, size * sizeof(struct  kevent));
    -    memset((*pollset)->ke_set, 0, size * sizeof(struct kevent));
    -    (*pollset)->kqueue_fd = kqueue();
    -    if ((*pollset)->kqueue_fd == -1) {
    -         return APR_ENOMEM;
    -    }
    -    apr_pool_cleanup_register(p, (void*)(*pollset), backend_cleanup, 
    -        apr_pool_cleanup_null);
    -#elif defined(HAVE_EPOLL)
    -    (*pollset)->epoll_fd = epoll_create(size);
    -    (*pollset)->pollset = apr_palloc(p, size * sizeof(struct epoll_event));
    -    apr_pool_cleanup_register(p, (void*)(*pollset), backend_cleanup, 
    -        apr_pool_cleanup_null);
    -#elif defined(HAVE_POLL)
         (*pollset)->pollset = apr_palloc(p, size * sizeof(struct pollfd));
    -#else
    -    FD_ZERO(&((*pollset)->readset));
    -    FD_ZERO(&((*pollset)->writeset));
    -    FD_ZERO(&((*pollset)->exceptset));
    -    (*pollset)->maxfd = 0;
    -#ifdef NETWARE
    -    (*pollset)->set_type = APR_NO_DESC;
    -#endif
    -#endif
         (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t));
         (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t));
    -
         return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset)
     {
    -#if defined(HAVE_KQUEUE) || defined(HAVE_EPOLL)
    -    return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup);
    -#else
         return APR_SUCCESS;
    -#endif
     }
     
     APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset,
                                               const apr_pollfd_t *descriptor)
     {
    -#ifdef HAVE_KQUEUE
    -    apr_os_sock_t fd;
    -#elif defined(HAVE_EPOLL)
    -    struct epoll_event ev;
    -    int ret = -1;
    -#else
    -#if !defined(HAVE_POLL)
    -    apr_os_sock_t fd;
    -#endif
    -#endif
    -
         if (pollset->nelts == pollset->nalloc) {
             return APR_ENOMEM;
         }
     
         pollset->query_set[pollset->nelts] = *descriptor;
     
    -#ifdef HAVE_KQUEUE
    -    if (descriptor->desc_type == APR_POLL_SOCKET) {
    -        fd = descriptor->desc.s->socketdes;
    -    }
    -    else {
    -        fd = descriptor->desc.f->filedes;
    -    }
    -
    -    if (descriptor->reqevents & APR_POLLIN) {
    -        EV_SET(&pollset->kevent, fd, EVFILT_READ, EV_ADD, 0, 0, NULL);
    -
    -        if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0,
    -                   NULL) == -1) {
    -            return APR_ENOMEM;
    -        }
    -    }
    -
    -    if (descriptor->reqevents & APR_POLLOUT) {
    -        EV_SET(&pollset->kevent, fd, EVFILT_WRITE, EV_ADD, 0, 0, NULL);
    -
    -        if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0,
    -                   NULL) == -1) {
    -            return APR_ENOMEM;
    -        }
    -    }
    -
    -#elif defined(HAVE_EPOLL)
    -    ev.events = get_epoll_event(descriptor->reqevents);
    -    if (descriptor->desc_type == APR_POLL_SOCKET) {
    -        ev.data.fd = descriptor->desc.s->socketdes;
    -        ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_ADD,
    -                        descriptor->desc.s->socketdes, &ev);
    -    }
    -    else {
    -        ev.data.fd = descriptor->desc.f->filedes;
    -        ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_ADD,
    -                        descriptor->desc.f->filedes, &ev);
    -    }
    -    if (0 != ret) {
    -        return APR_EBADF;
    -    }
    -#elif defined(HAVE_POLL)
    -
         if (descriptor->desc_type == APR_POLL_SOCKET) {
             pollset->pollset[pollset->nelts].fd = descriptor->desc.s->socketdes;
         }
    @@ -515,59 +192,10 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset,
             pollset->pollset[pollset->nelts].fd = descriptor->desc.f->filedes;
         }
     
    -    pollset->pollset[pollset->nelts].events = get_event(descriptor->reqevents);
    -#else
    -    if (descriptor->desc_type == APR_POLL_SOCKET) {
    -#ifdef NETWARE
    -        /* NetWare can't handle mixed descriptor types in select() */
    -        if (HAS_PIPES(pollset->set_type)) {
    -            return APR_EBADF;
    -        }
    -        else {
    -            pollset->set_type = APR_POLL_SOCKET;
    -        }
    -#endif
    -        fd = descriptor->desc.s->socketdes;
    -    }
    -    else {
    -#if !APR_FILES_AS_SOCKETS
    -        return APR_EBADF;
    -#else
    -#ifdef NETWARE
    -        /* NetWare can't handle mixed descriptor types in select() */
    -        if (descriptor->desc.f->is_pipe && !HAS_SOCKETS(pollset->set_type)) {
    -            pollset->set_type = APR_POLL_FILE;
    -            fd = descriptor->desc.f->filedes;
    -        }
    -        else {
    -            return APR_EBADF;
    -        }
    -#else
    -        fd = descriptor->desc.f->filedes;
    -#endif
    -#endif
    -    }
    -#if !defined(WIN32) && !defined(NETWARE) /* socket sets handled with array of handles */
    -    if (fd >= FD_SETSIZE) {
    -        /* XXX invent new error code so application has a clue */
    -        return APR_EBADF;
    -    }
    -#endif
    -    if (descriptor->reqevents & APR_POLLIN) {
    -        FD_SET(fd, &(pollset->readset));
    -    }
    -    if (descriptor->reqevents & APR_POLLOUT) {
    -        FD_SET(fd, &(pollset->writeset));
    -    }
    -    if (descriptor->reqevents &
    -        (APR_POLLPRI | APR_POLLERR | APR_POLLHUP | APR_POLLNVAL)) {
    -        FD_SET(fd, &(pollset->exceptset));
    -    }
    -    if ((int)fd > pollset->maxfd) {
    -        pollset->maxfd = (int)fd;
    -    }
    -#endif
    +    pollset->pollset[pollset->nelts].events =
    +        get_event(descriptor->reqevents);
         pollset->nelts++;
    +
         return APR_SUCCESS;
     }
     
    @@ -575,97 +203,8 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset,
                                                  const apr_pollfd_t *descriptor)
     {
         apr_uint32_t i;
    -#ifdef HAVE_KQUEUE
         apr_os_sock_t fd;
    -#elif defined(HAVE_EPOLL)
    -    struct epoll_event ev;
    -    int ret = -1;
    -#elif !defined(HAVE_POLL)
    -    apr_os_sock_t fd;
    -#endif
     
    -#ifdef HAVE_KQUEUE
    -    for (i = 0; i < pollset->nelts; i++) {
    -        if (descriptor->desc.s == pollset->query_set[i].desc.s) {
    -            /* Found an instance of the fd: remove this and any other copies  */
    -            apr_uint32_t dst = i;
    -            apr_uint32_t old_nelts = pollset->nelts;
    -            pollset->nelts--;
    -            for (i++; i < old_nelts; i++) {
    -                if (descriptor->desc.s == pollset->query_set[i].desc.s) {
    -                    pollset->nelts--;
    -                }
    -                else {
    -                    pollset->query_set[dst] = pollset->query_set[i];
    -                    dst++;
    -                }
    -            }
    -
    -            if (descriptor->desc_type == APR_POLL_SOCKET) {
    -                fd = descriptor->desc.s->socketdes;
    -            }
    -            else {
    -                fd = descriptor->desc.f->filedes;
    -            }
    -
    -            if (descriptor->reqevents & APR_POLLIN) {
    -                EV_SET(&pollset->kevent, fd,
    -                       EVFILT_READ, EV_DELETE, 0, 0, NULL);
    -
    -                if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0,
    -                          NULL) == -1) {
    -                    return APR_EBADF;
    -                }
    -            }
    -
    -            if (descriptor->reqevents & APR_POLLOUT) {
    -                EV_SET(&pollset->kevent, fd,
    -                       EVFILT_WRITE, EV_DELETE, 0, 0, NULL);
    -
    -                if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0,
    -                          NULL) == -1) {
    -                    return APR_EBADF;
    -                }
    -            }
    -
    -            return APR_SUCCESS;
    -        }
    -    }
    -#elif defined(HAVE_EPOLL)
    -    for (i = 0; i < pollset->nelts; i++) {
    -        if (descriptor->desc.s == pollset->query_set[i].desc.s) {
    -            /* Found an instance of the fd: remove this and any other copies  */
    -            apr_uint32_t dst = i;
    -            apr_uint32_t old_nelts = pollset->nelts;
    -            pollset->nelts--;
    -            for (i++; i < old_nelts; i++) {
    -                if (descriptor->desc.s == pollset->query_set[i].desc.s) {
    -                    pollset->nelts--;
    -                }
    -                else {
    -                    pollset->query_set[dst] = pollset->query_set[i];
    -                    dst++;
    -                }
    -            }
    -            ev.events = get_epoll_event(descriptor->reqevents);
    -            if (descriptor->desc_type == APR_POLL_SOCKET) {
    -                ev.data.fd = descriptor->desc.s->socketdes;
    -                ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_DEL,
    -                                descriptor->desc.s->socketdes, &ev);
    -            }
    -            else {
    -                ev.data.fd = descriptor->desc.f->filedes;
    -                ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_DEL,
    -                                descriptor->desc.f->filedes, &ev);
    -            }
    -            if (ret < 0) {
    -                return APR_EBADF;
    -            }
    -
    -            return APR_SUCCESS;
    -        }
    -    }
    -#elif defined(HAVE_POLL)
         for (i = 0; i < pollset->nelts; i++) {
             if (descriptor->desc.s == pollset->query_set[i].desc.s) {
                 /* Found an instance of the fd: remove this and any other copies */
    @@ -686,159 +225,9 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset,
             }
         }
     
    -#else /* no poll */
    -    if (descriptor->desc_type == APR_POLL_SOCKET) {
    -        fd = descriptor->desc.s->socketdes;
    -    }
    -    else {
    -#if !APR_FILES_AS_SOCKETS
    -        return APR_EBADF;
    -#else
    -        fd = descriptor->desc.f->filedes;
    -#endif
    -    }
    -
    -    for (i = 0; i < pollset->nelts; i++) {
    -        if (descriptor->desc.s == pollset->query_set[i].desc.s) {
    -            /* Found an instance of the fd: remove this and any other copies */
    -            apr_uint32_t dst = i;
    -            apr_uint32_t old_nelts = pollset->nelts;
    -            pollset->nelts--;
    -            for (i++; i < old_nelts; i++) {
    -                if (descriptor->desc.s == pollset->query_set[i].desc.s) {
    -                    pollset->nelts--;
    -                }
    -                else {
    -                    pollset->query_set[dst] = pollset->query_set[i];
    -                    dst++;
    -                }
    -            }
    -            FD_CLR(fd, &(pollset->readset));
    -            FD_CLR(fd, &(pollset->writeset));
    -            FD_CLR(fd, &(pollset->exceptset));
    -            if (((int)fd == pollset->maxfd) && (pollset->maxfd > 0)) {
    -                pollset->maxfd--;
    -            }
    -            return APR_SUCCESS;
    -        }
    -    }
    -#endif /* no poll */
    -
         return APR_NOTFOUND;
     }
    -#ifdef HAVE_KQUEUE
    -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
    -                                           apr_interval_time_t timeout,
    -                                           apr_int32_t *num,
    -                                           const apr_pollfd_t **descriptors)
    -{
    -    int rv;
    -    apr_uint32_t i, j, r = 0;
    -    struct timespec tv, *tvptr;
    -
    -    if (timeout < 0) {
    -        tvptr = NULL;
    -    }
    -    else {
    -        tv.tv_sec = (long)apr_time_sec(timeout);
    -        tv.tv_nsec = (long)apr_time_msec(timeout);
    -        tvptr = &tv;
    -    }
    -
    -    rv = kevent(pollset->kqueue_fd, NULL, 0, pollset->ke_set, pollset->nelts,
    -                tvptr);
    -    (*num) = rv;
    -    if (rv < 0) {
    -        return apr_get_netos_error();
    -    }
    -    if (rv == 0) {
    -        return APR_TIMEUP;
    -    }
    -
    -    /* TODO: Is there a better way to re-associate our data? */
    -    for (i = 0; i < pollset->nelts; i++) {
    -        apr_os_sock_t fd;
    -        if (pollset->query_set[i].desc_type == APR_POLL_SOCKET) {
    -            fd = pollset->query_set[i].desc.s->socketdes;
    -        }
    -        else {
    -            fd = pollset->query_set[i].desc.f->filedes;
    -        }
    -        for (j = 0; j < rv; j++) {
    -            if (pollset->ke_set[j].ident == fd ) {
    -                pollset->result_set[r] = pollset->query_set[i];
    -                pollset->result_set[r].rtnevents =
    -                    get_kqueue_revent(pollset->ke_set[j].filter,
    -                                      pollset->ke_set[j].flags);
    -                r++;
    -            }
    -        }
    -    }
    -
    -    (*num) = r;
    -
    -    if (descriptors) {
    -        *descriptors = pollset->result_set;
    -    }
    -
    -    return APR_SUCCESS;
    -}
    -
    -#elif defined(HAVE_EPOLL)
     
    -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
    -                                           apr_interval_time_t timeout,
    -                                           apr_int32_t *num,
    -                                           const apr_pollfd_t **descriptors)
    -{
    -    int rv;
    -    apr_uint32_t i, j, k;
    -
    -    if (timeout > 0) {
    -        timeout /= 1000;
    -    }
    -
    -    rv = epoll_wait(pollset->epoll_fd, pollset->pollset, pollset->nelts,
    -                    timeout);
    -    (*num) = rv;
    -    if (rv < 0) {
    -        return apr_get_netos_error();
    -    }
    -    if (rv == 0) {
    -        return APR_TIMEUP;
    -    }
    -    j = 0;
    -    for (i = 0; i < pollset->nelts; i++) {
    -        if (pollset->pollset[i].events != 0) {
    -            /* TODO: Is there a better way to re-associate our data? */
    -            for (k = 0; k < pollset->nelts; k++) {
    -                if (pollset->query_set[k].desc_type == APR_POLL_SOCKET &&
    -                    pollset->query_set[k].desc.s->socketdes ==
    -                        pollset->pollset[i].data.fd) {
    -                    pollset->result_set[j] = pollset->query_set[k];
    -                    pollset->result_set[j].rtnevents =
    -                        get_epoll_revent(pollset->pollset[i].events);
    -                    j++;
    -                    break;
    -                }
    -                else if (pollset->query_set[k].desc_type == APR_POLL_FILE 
    -                         && pollset->query_set[k].desc.f->filedes ==
    -                            pollset->pollset[i].data.fd) {
    -                    pollset->result_set[j] = pollset->query_set[k];
    -                    pollset->result_set[j].rtnevents =
    -                        get_epoll_revent(pollset->pollset[i].events);
    -                    j++;
    -                    break;
    -                }
    -            }
    -        }
    -    }
    -    if (descriptors) {
    -        *descriptors = pollset->result_set;
    -    }
    -    return APR_SUCCESS;
    -}
    -#elif defined(HAVE_POLL)
     APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
                                                apr_interval_time_t timeout,
                                                apr_int32_t *num,
    @@ -872,79 +261,4 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
         return APR_SUCCESS;
     }
     
    -#else /* no poll */
    -
    -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
    -                                           apr_interval_time_t timeout,
    -                                           apr_int32_t *num,
    -                                           const apr_pollfd_t **descriptors)
    -{
    -    int rv;
    -    apr_uint32_t i, j;
    -    struct timeval tv, *tvptr;
    -    fd_set readset, writeset, exceptset;
    -
    -    if (timeout < 0) {
    -        tvptr = NULL;
    -    }
    -    else {
    -        tv.tv_sec = (long)apr_time_sec(timeout);
    -        tv.tv_usec = (long)apr_time_usec(timeout);
    -        tvptr = &tv;
    -    }
    -
    -    memcpy(&readset, &(pollset->readset), sizeof(fd_set));
    -    memcpy(&writeset, &(pollset->writeset), sizeof(fd_set));
    -    memcpy(&exceptset, &(pollset->exceptset), sizeof(fd_set));
    -
    -#ifdef NETWARE
    -    if (HAS_PIPES(pollset->set_type)) {
    -        rv = pipe_select(pollset->maxfd + 1, &readset, &writeset, &exceptset, tvptr);
    -    }
    -    else
    -#endif
    -    rv = select(pollset->maxfd + 1, &readset, &writeset, &exceptset, tvptr);
    -
    -    (*num) = rv;
    -    if (rv < 0) {
    -        return apr_get_netos_error();
    -    }
    -    if (rv == 0) {
    -        return APR_TIMEUP;
    -    }
    -    j = 0;
    -    for (i = 0; i < pollset->nelts; i++) {
    -        apr_os_sock_t fd;
    -        if (pollset->query_set[i].desc_type == APR_POLL_SOCKET) {
    -            fd = pollset->query_set[i].desc.s->socketdes;
    -        }
    -        else {
    -#if !APR_FILES_AS_SOCKETS
    -            return APR_EBADF;
    -#else
    -            fd = pollset->query_set[i].desc.f->filedes;
    -#endif
    -        }
    -        if (FD_ISSET(fd, &readset) || FD_ISSET(fd, &writeset) ||
    -            FD_ISSET(fd, &exceptset)) {
    -            pollset->result_set[j] = pollset->query_set[i];
    -            pollset->result_set[j].rtnevents = 0;
    -            if (FD_ISSET(fd, &readset)) {
    -                pollset->result_set[j].rtnevents |= APR_POLLIN;
    -            }
    -            if (FD_ISSET(fd, &writeset)) {
    -                pollset->result_set[j].rtnevents |= APR_POLLOUT;
    -            }
    -            if (FD_ISSET(fd, &exceptset)) {
    -                pollset->result_set[j].rtnevents |= APR_POLLERR;
    -            }
    -            j++;
    -        }
    -    }
    -
    -    if (descriptors)
    -        *descriptors = pollset->result_set;
    -    return APR_SUCCESS;
    -}
    -
    -#endif /* no poll */
    +#endif /* POLLSET_USES_POLL */
    diff --git a/poll/unix/select.c b/poll/unix/select.c
    new file mode 100644
    index 00000000000..c1b657e4417
    --- /dev/null
    +++ b/poll/unix/select.c
    @@ -0,0 +1,392 @@
    +/* Copyright 2000-2004 The Apache Software Foundation
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +#include "apr_arch_poll_private.h"
    +
    +#ifdef POLL_USES_SELECT
    +
    +APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num,
    +                                   apr_int32_t *nsds,
    +                                   apr_interval_time_t timeout)
    +{
    +    fd_set readset, writeset, exceptset;
    +    int rv, i;
    +    int maxfd = -1;
    +    struct timeval tv, *tvptr;
    +#ifdef NETWARE
    +    apr_datatype_e set_type = APR_NO_DESC;
    +#endif
    +
    +    if (timeout < 0) {
    +        tvptr = NULL;
    +    }
    +    else {
    +        tv.tv_sec = (long) apr_time_sec(timeout);
    +        tv.tv_usec = (long) apr_time_usec(timeout);
    +        tvptr = &tv;
    +    }
    +
    +    FD_ZERO(&readset);
    +    FD_ZERO(&writeset);
    +    FD_ZERO(&exceptset);
    +
    +    for (i = 0; i < num; i++) {
    +        apr_os_sock_t fd;
    +
    +        aprset[i].rtnevents = 0;
    +
    +        if (aprset[i].desc_type == APR_POLL_SOCKET) {
    +#ifdef NETWARE
    +            if (HAS_PIPES(set_type)) {
    +                return APR_EBADF;
    +            }
    +            else {
    +                set_type = APR_POLL_SOCKET;
    +            }
    +#endif
    +            fd = aprset[i].desc.s->socketdes;
    +        }
    +        else if (aprset[i].desc_type == APR_POLL_FILE) {
    +#if !APR_FILES_AS_SOCKETS
    +            return APR_EBADF;
    +#else
    +#ifdef NETWARE
    +            if (aprset[i].desc.f->is_pipe && !HAS_SOCKETS(set_type)) {
    +                set_type = APR_POLL_FILE;
    +            }
    +            else
    +                return APR_EBADF;
    +#endif /* NETWARE */
    +
    +            fd = aprset[i].desc.f->filedes;
    +
    +#endif /* APR_FILES_AS_SOCKETS */
    +        }
    +        else {
    +            break;
    +        }
    +#if !defined(WIN32) && !defined(NETWARE)        /* socket sets handled with array of handles */
    +        if (fd >= FD_SETSIZE) {
    +            /* XXX invent new error code so application has a clue */
    +            return APR_EBADF;
    +        }
    +#endif
    +        if (aprset[i].reqevents & APR_POLLIN) {
    +            FD_SET(fd, &readset);
    +        }
    +        if (aprset[i].reqevents & APR_POLLOUT) {
    +            FD_SET(fd, &writeset);
    +        }
    +        if (aprset[i].reqevents &
    +            (APR_POLLPRI | APR_POLLERR | APR_POLLHUP | APR_POLLNVAL)) {
    +            FD_SET(fd, &exceptset);
    +        }
    +        if ((int) fd > maxfd) {
    +            maxfd = (int) fd;
    +        }
    +    }
    +
    +#ifdef NETWARE
    +    if (HAS_PIPES(set_type)) {
    +        rv = pipe_select(maxfd + 1, &readset, &writeset, &exceptset, tvptr);
    +    }
    +    else {
    +#endif
    +
    +        rv = select(maxfd + 1, &readset, &writeset, &exceptset, tvptr);
    +
    +#ifdef NETWARE
    +    }
    +#endif
    +
    +    (*nsds) = rv;
    +    if ((*nsds) == 0) {
    +        return APR_TIMEUP;
    +    }
    +    if ((*nsds) < 0) {
    +        return apr_get_netos_error();
    +    }
    +
    +    for (i = 0; i < num; i++) {
    +        apr_os_sock_t fd;
    +
    +        if (aprset[i].desc_type == APR_POLL_SOCKET) {
    +            fd = aprset[i].desc.s->socketdes;
    +        }
    +        else if (aprset[i].desc_type == APR_POLL_FILE) {
    +#if !APR_FILES_AS_SOCKETS
    +            return APR_EBADF;
    +#else
    +            fd = aprset[i].desc.f->filedes;
    +#endif
    +        }
    +        else {
    +            break;
    +        }
    +        if (FD_ISSET(fd, &readset)) {
    +            aprset[i].rtnevents |= APR_POLLIN;
    +        }
    +        if (FD_ISSET(fd, &writeset)) {
    +            aprset[i].rtnevents |= APR_POLLOUT;
    +        }
    +        if (FD_ISSET(fd, &exceptset)) {
    +            aprset[i].rtnevents |= APR_POLLERR;
    +        }
    +    }
    +
    +    return APR_SUCCESS;
    +}
    +
    +#endif /* POLL_USES_SELECT */
    +
    +#ifdef POLLSET_USES_SELECT
    +
    +struct apr_pollset_t
    +{
    +    apr_pool_t *pool;
    +
    +    apr_uint32_t nelts;
    +    apr_uint32_t nalloc;
    +    fd_set readset, writeset, exceptset;
    +    int maxfd;
    +    apr_pollfd_t *query_set;
    +    apr_pollfd_t *result_set;
    +#ifdef NETWARE
    +    int set_type;
    +#endif
    +};
    +
    +APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
    +                                             apr_uint32_t size,
    +                                             apr_pool_t *p,
    +                                             apr_uint32_t flags)
    +{
    +    if (flags & APR_POLLSET_THREADSAFE) {                
    +        *pollset = NULL;
    +        return APR_ENOTIMPL;
    +    }
    +#ifdef FD_SETSIZE
    +    if (size > FD_SETSIZE) {
    +        *pollset = NULL;
    +        return APR_EINVAL;
    +    }
    +#endif
    +    *pollset = apr_palloc(p, sizeof(**pollset));
    +    (*pollset)->nelts = 0;
    +    (*pollset)->nalloc = size;
    +    (*pollset)->pool = p;
    +    FD_ZERO(&((*pollset)->readset));
    +    FD_ZERO(&((*pollset)->writeset));
    +    FD_ZERO(&((*pollset)->exceptset));
    +    (*pollset)->maxfd = 0;
    +#ifdef NETWARE
    +    (*pollset)->set_type = APR_NO_DESC;
    +#endif
    +    (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t));
    +    (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t));
    +
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t * pollset)
    +{
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset,
    +                                          const apr_pollfd_t *descriptor)
    +{
    +    apr_os_sock_t fd;
    +
    +    if (pollset->nelts == pollset->nalloc) {
    +        return APR_ENOMEM;
    +    }
    +
    +    pollset->query_set[pollset->nelts] = *descriptor;
    +
    +    if (descriptor->desc_type == APR_POLL_SOCKET) {
    +#ifdef NETWARE
    +        /* NetWare can't handle mixed descriptor types in select() */
    +        if (HAS_PIPES(pollset->set_type)) {
    +            return APR_EBADF;
    +        }
    +        else {
    +            pollset->set_type = APR_POLL_SOCKET;
    +        }
    +#endif
    +        fd = descriptor->desc.s->socketdes;
    +    }
    +    else {
    +#if !APR_FILES_AS_SOCKETS
    +        return APR_EBADF;
    +#else
    +#ifdef NETWARE
    +        /* NetWare can't handle mixed descriptor types in select() */
    +        if (descriptor->desc.f->is_pipe && !HAS_SOCKETS(pollset->set_type)) {
    +            pollset->set_type = APR_POLL_FILE;
    +            fd = descriptor->desc.f->filedes;
    +        }
    +        else {
    +            return APR_EBADF;
    +        }
    +#else
    +        fd = descriptor->desc.f->filedes;
    +#endif
    +#endif
    +    }
    +#if !defined(WIN32) && !defined(NETWARE)        /* socket sets handled with array of handles */
    +    if (fd >= FD_SETSIZE) {
    +        /* XXX invent new error code so application has a clue */
    +        return APR_EBADF;
    +    }
    +#endif
    +    if (descriptor->reqevents & APR_POLLIN) {
    +        FD_SET(fd, &(pollset->readset));
    +    }
    +    if (descriptor->reqevents & APR_POLLOUT) {
    +        FD_SET(fd, &(pollset->writeset));
    +    }
    +    if (descriptor->reqevents &
    +        (APR_POLLPRI | APR_POLLERR | APR_POLLHUP | APR_POLLNVAL)) {
    +        FD_SET(fd, &(pollset->exceptset));
    +    }
    +    if ((int) fd > pollset->maxfd) {
    +        pollset->maxfd = (int) fd;
    +    }
    +    pollset->nelts++;
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t * pollset,
    +                                             const apr_pollfd_t * descriptor)
    +{
    +    apr_uint32_t i;
    +    apr_os_sock_t fd;
    +
    +    if (descriptor->desc_type == APR_POLL_SOCKET) {
    +        fd = descriptor->desc.s->socketdes;
    +    }
    +    else {
    +#if !APR_FILES_AS_SOCKETS
    +        return APR_EBADF;
    +#else
    +        fd = descriptor->desc.f->filedes;
    +#endif
    +    }
    +
    +    for (i = 0; i < pollset->nelts; i++) {
    +        if (descriptor->desc.s == pollset->query_set[i].desc.s) {
    +            /* Found an instance of the fd: remove this and any other copies */
    +            apr_uint32_t dst = i;
    +            apr_uint32_t old_nelts = pollset->nelts;
    +            pollset->nelts--;
    +            for (i++; i < old_nelts; i++) {
    +                if (descriptor->desc.s == pollset->query_set[i].desc.s) {
    +                    pollset->nelts--;
    +                }
    +                else {
    +                    pollset->query_set[dst] = pollset->query_set[i];
    +                    dst++;
    +                }
    +            }
    +            FD_CLR(fd, &(pollset->readset));
    +            FD_CLR(fd, &(pollset->writeset));
    +            FD_CLR(fd, &(pollset->exceptset));
    +            if (((int) fd == pollset->maxfd) && (pollset->maxfd > 0)) {
    +                pollset->maxfd--;
    +            }
    +            return APR_SUCCESS;
    +        }
    +    }
    +
    +    return APR_NOTFOUND;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
    +                                           apr_interval_time_t timeout,
    +                                           apr_int32_t *num,
    +                                           const apr_pollfd_t **descriptors)
    +{
    +    int rv;
    +    apr_uint32_t i, j;
    +    struct timeval tv, *tvptr;
    +    fd_set readset, writeset, exceptset;
    +
    +    if (timeout < 0) {
    +        tvptr = NULL;
    +    }
    +    else {
    +        tv.tv_sec = (long) apr_time_sec(timeout);
    +        tv.tv_usec = (long) apr_time_usec(timeout);
    +        tvptr = &tv;
    +    }
    +
    +    memcpy(&readset, &(pollset->readset), sizeof(fd_set));
    +    memcpy(&writeset, &(pollset->writeset), sizeof(fd_set));
    +    memcpy(&exceptset, &(pollset->exceptset), sizeof(fd_set));
    +
    +#ifdef NETWARE
    +    if (HAS_PIPES(pollset->set_type)) {
    +        rv = pipe_select(pollset->maxfd + 1, &readset, &writeset, &exceptset,
    +                         tvptr);
    +    }
    +    else
    +#endif
    +        rv = select(pollset->maxfd + 1, &readset, &writeset, &exceptset,
    +                    tvptr);
    +
    +    (*num) = rv;
    +    if (rv < 0) {
    +        return apr_get_netos_error();
    +    }
    +    if (rv == 0) {
    +        return APR_TIMEUP;
    +    }
    +    j = 0;
    +    for (i = 0; i < pollset->nelts; i++) {
    +        apr_os_sock_t fd;
    +        if (pollset->query_set[i].desc_type == APR_POLL_SOCKET) {
    +            fd = pollset->query_set[i].desc.s->socketdes;
    +        }
    +        else {
    +#if !APR_FILES_AS_SOCKETS
    +            return APR_EBADF;
    +#else
    +            fd = pollset->query_set[i].desc.f->filedes;
    +#endif
    +        }
    +        if (FD_ISSET(fd, &readset) || FD_ISSET(fd, &writeset) ||
    +            FD_ISSET(fd, &exceptset)) {
    +            pollset->result_set[j] = pollset->query_set[i];
    +            pollset->result_set[j].rtnevents = 0;
    +            if (FD_ISSET(fd, &readset)) {
    +                pollset->result_set[j].rtnevents |= APR_POLLIN;
    +            }
    +            if (FD_ISSET(fd, &writeset)) {
    +                pollset->result_set[j].rtnevents |= APR_POLLOUT;
    +            }
    +            if (FD_ISSET(fd, &exceptset)) {
    +                pollset->result_set[j].rtnevents |= APR_POLLERR;
    +            }
    +            j++;
    +        }
    +    }
    +
    +    if (descriptors)
    +        *descriptors = pollset->result_set;
    +    return APR_SUCCESS;
    +}
    +
    +#endif /* POLLSET_USES_SELECT */
    
    From c52059ffe185146bd618ae207500af5dc3cda918 Mon Sep 17 00:00:00 2001
    From: Cliff Woolley 
    Date: Sat, 20 Nov 2004 06:49:28 +0000
    Subject: [PATCH 5214/7878] tweak text
    
    Submitted by: Garrett Rooney
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@105943 13f79535-47bb-0310-9956-ffa450edef68
    ---
     README.dev | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/README.dev b/README.dev
    index d7167de201a..e3ffa6bdd96 100644
    --- a/README.dev
    +++ b/README.dev
    @@ -1,7 +1,7 @@
     Apache Portable Runtime
     =======================
     
    -If you are building APR from CVS, you need to use a slightly non-standard
    +If you are building APR from SVN, you need to use a slightly non-standard
     build process.  You must have autoconf and libtool installed for this to
     work.  There are three steps:
     
    
    From d1aa7ff752664a409357ba5b6bb79fccdf63555c Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 21 Nov 2004 07:15:22 +0000
    Subject: [PATCH 5215/7878]   Things get wonky on win32 with includes, because
     the included   library was in arch/unix/ msvc attempted to include the
     sub-includes   from that same path instead of from arch/win32/ which occured 
      earlier in the -I path list.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106076 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/unix/select.c | 6 ++++++
     1 file changed, 6 insertions(+)
    
    diff --git a/poll/unix/select.c b/poll/unix/select.c
    index c1b657e4417..e865e6c56b7 100644
    --- a/poll/unix/select.c
    +++ b/poll/unix/select.c
    @@ -13,6 +13,12 @@
      * limitations under the License.
      */
     
    +#include "apr.h"
    +#include "apr_poll.h"
    +#include "apr_time.h"
    +#include "apr_portable.h"
    +#include "apr_arch_networkio.h"
    +#include "apr_arch_file_io.h"
     #include "apr_arch_poll_private.h"
     
     #ifdef POLL_USES_SELECT
    
    From 5aea2649dc65a208ca2657ace67474e491768948 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 21 Nov 2004 07:27:08 +0000
    Subject: [PATCH 5216/7878]   Win32 is select() not poll() - include the
     correct sources.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106078 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr.dsp    | 2 +-
     libapr.dsp | 2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/apr.dsp b/apr.dsp
    index 67002ac07f8..406416b58d9 100644
    --- a/apr.dsp
    +++ b/apr.dsp
    @@ -274,7 +274,7 @@ SOURCE=.\network_io\unix\inet_pton.c
     # End Source File
     # Begin Source File
     
    -SOURCE=.\poll\unix\poll.c
    +SOURCE=.\poll\unix\select.c
     # End Source File
     # Begin Source File
     
    diff --git a/libapr.dsp b/libapr.dsp
    index 35c0b8a0c12..5999c3d29f5 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -280,7 +280,7 @@ SOURCE=.\network_io\unix\inet_pton.c
     # End Source File
     # Begin Source File
     
    -SOURCE=.\poll\unix\poll.c
    +SOURCE=.\poll\unix\select.c
     # End Source File
     # Begin Source File
     
    
    From d2bcb707abdd054146fd43fd8eea34c688b8b7a1 Mon Sep 17 00:00:00 2001
    From: Paul Querna 
    Date: Mon, 22 Nov 2004 05:00:03 +0000
    Subject: [PATCH 5217/7878] Added support for Solaris 10 Event Completion
     Framework as a backend to APR Pollset.
    
    Best Docs: http://developers.sun.com/solaris/articles/event_completion.html
    
    I have only been able to test this on Solaris 10 on x86 with gcc.
    If anyone could test on Sparc with other compilers that would be great.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106156 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                                   |   4 +
     configure.in                              |   2 +-
     include/arch/unix/apr_arch_poll_private.h |   9 +-
     poll/unix/port.c                          | 336 ++++++++++++++++++++++
     4 files changed, 349 insertions(+), 2 deletions(-)
     create mode 100644 poll/unix/port.c
    
    diff --git a/CHANGES b/CHANGES
    index 1a513070137..2de73a18dc9 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -5,6 +5,10 @@ Changes for APR 1.1.0
          and upgrading it to do SHA-256. Not yet ready for prime time.
          [Ben Laurie]
     
    +  *) Added Solaris 10 'Event Ports' as a backend for APR Pollset.  This 
    +     backend also supports the APR_POLLSET_THREADSAFE flag.
    +     [Paul Querna]
    +
       *) Added the APR_POLLSET_THREADSAFE flag. This allows multiple threads
          to call the Pollset Add or Remove functions in a thread safe manner.
          Currently only EPoll and KQueue support this flag. [Paul Querna]
    diff --git a/configure.in b/configure.in
    index e349248b92c..a09aafb42bc 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -637,7 +637,7 @@ AC_SUBST(threads)
     AC_SUBST(have_sigsuspend)
     AC_SUBST(have_sigwait)
     
    -AC_CHECK_FUNCS(poll kqueue)
    +AC_CHECK_FUNCS(poll kqueue port_create)
     
     # Check for the Linux epoll interface; epoll* may be available in libc
     # but return ENOSYS on a pre-2.6 kernel, so do a run-time check.
    diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h
    index 5a9ee6e6e37..c720bb2f1c8 100644
    --- a/include/arch/unix/apr_arch_poll_private.h
    +++ b/include/arch/unix/apr_arch_poll_private.h
    @@ -31,6 +31,11 @@
     #include 
     #endif
     
    +#ifdef HAVE_PORT_CREATE
    +#include 
    +#include 
    +#endif
    +
     #ifdef HAVE_KQUEUE
     #include 
     #include 
    @@ -49,6 +54,8 @@
     /* Choose the best method platform specific to use in apr_pollset */
     #ifdef HAVE_KQUEUE
     #define POLLSET_USES_KQUEUE
    +#elif defined(HAVE_PORT_CREATE)
    +#define POLLSET_USES_PORT
     #elif defined(HAVE_EPOLL)
     #define POLLSET_USES_EPOLL
     #elif defined(HAVE_POLL)
    @@ -63,7 +70,7 @@
     #define POLL_USES_SELECT
     #endif
     
    -#if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL)
    +#if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT)
     
     #include "apr_ring.h"
     
    diff --git a/poll/unix/port.c b/poll/unix/port.c
    new file mode 100644
    index 00000000000..4ab6386e6de
    --- /dev/null
    +++ b/poll/unix/port.c
    @@ -0,0 +1,336 @@
    +/* Copyright 2000-2004 The Apache Software Foundation
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +#include "apr_arch_poll_private.h"
    +
    +#ifdef POLLSET_USES_PORT
    +
    +static apr_int16_t get_event(apr_int16_t event)
    +{
    +    apr_int16_t rv = 0;
    +
    +    if (event & APR_POLLIN)
    +        rv |= POLLIN;
    +    if (event & APR_POLLPRI)
    +        rv |= POLLPRI;
    +    if (event & APR_POLLOUT)
    +        rv |= POLLOUT;
    +    if (event & APR_POLLERR)
    +        rv |= POLLERR;
    +    if (event & APR_POLLHUP)
    +        rv |= POLLHUP;
    +    if (event & APR_POLLNVAL)
    +        rv |= POLLNVAL;
    +
    +    return rv;
    +}
    +
    +static apr_int16_t get_revent(apr_int16_t event)
    +{
    +    apr_int16_t rv = 0;
    +
    +    if (event & POLLIN)
    +        rv |= APR_POLLIN;
    +    if (event & POLLPRI)
    +        rv |= APR_POLLPRI;
    +    if (event & POLLOUT)
    +        rv |= APR_POLLOUT;
    +    if (event & POLLERR)
    +        rv |= APR_POLLERR;
    +    if (event & POLLHUP)
    +        rv |= APR_POLLHUP;
    +    if (event & POLLNVAL)
    +        rv |= APR_POLLNVAL;
    +
    +    return rv;
    +}
    +
    +
    +struct apr_pollset_t
    +{
    +    apr_pool_t *pool;
    +    apr_uint32_t nelts;
    +    apr_uint32_t nalloc;
    +    int port_fd;
    +    port_event_t *port_set;
    +    apr_pollfd_t *result_set;
    +    apr_uint32_t flags;
    +#if APR_HAS_THREADS
    +    /* A thread mutex to protect operations on the rings */
    +    apr_thread_mutex_t *ring_lock;
    +#endif
    +    /* A ring containing all of the pollfd_t that are active */
    +    APR_RING_HEAD(pfd_query_ring_t, pfd_elem_t) query_ring;
    +    APR_RING_HEAD(pfd_add_ring_t, pfd_elem_t) add_ring;
    +    /* A ring of pollfd_t that have been used, and then _remove'd */
    +    APR_RING_HEAD(pfd_free_ring_t, pfd_elem_t) free_ring;
    +    /* A ring of pollfd_t where rings that have been _remove'd but
    +       might still be inside a _poll */
    +    APR_RING_HEAD(pfd_dead_ring_t, pfd_elem_t) dead_ring;
    +};
    +
    +static apr_status_t backend_cleanup(void *p_)
    +{
    +    apr_pollset_t *pollset = (apr_pollset_t *) p_;
    +    close(pollset->port_fd);
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
    +                                             apr_uint32_t size,
    +                                             apr_pool_t *p,
    +                                             apr_uint32_t flags)
    +{
    +    apr_status_t rv = APR_SUCCESS;
    +    *pollset = apr_palloc(p, sizeof(**pollset));
    +#if APR_HAS_THREADS
    +    if (flags & APR_POLLSET_THREADSAFE &&
    +        ((rv = apr_thread_mutex_create(&(*pollset)->ring_lock,
    +                                       APR_THREAD_MUTEX_DEFAULT,
    +                                       p) != APR_SUCCESS))) {
    +        *pollset = NULL;
    +        return rv;
    +    }
    +#else
    +    if (flags & APR_POLLSET_THREADSAFE) {
    +        *pollset = NULL;
    +        return APR_ENOTIMPL;
    +    }
    +#endif
    +    (*pollset)->nelts = 0;
    +    (*pollset)->nalloc = size;
    +    (*pollset)->flags = flags;
    +    (*pollset)->pool = p;
    +
    +    (*pollset)->port_set = apr_palloc(p, size * sizeof(port_event_t));
    +
    +    (*pollset)->port_fd = port_create();
    +
    +    if ((*pollset)->port_fd < 0) {
    +        return APR_ENOMEM;
    +    }
    +
    +    apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup,
    +                              apr_pool_cleanup_null);
    +
    +    (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t));
    +
    +    APR_RING_INIT(&(*pollset)->query_ring, pfd_elem_t, link);
    +    APR_RING_INIT(&(*pollset)->add_ring, pfd_elem_t, link);
    +    APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link);
    +    APR_RING_INIT(&(*pollset)->dead_ring, pfd_elem_t, link);
    +
    +    return rv;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset)
    +{
    +    return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup);
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset,
    +                                          const apr_pollfd_t *descriptor)
    +{
    +    apr_os_sock_t fd;
    +    pfd_elem_t *elem;
    +    int res;
    +    apr_status_t rv = APR_SUCCESS;
    +
    +    pollset_lock_rings();
    +
    +    if (!APR_RING_EMPTY(&(pollset->free_ring), pfd_elem_t, link)) {
    +        elem = APR_RING_FIRST(&(pollset->free_ring));
    +        APR_RING_REMOVE(elem, link);
    +    }
    +    else {
    +        elem = (pfd_elem_t *) apr_palloc(pollset->pool, sizeof(pfd_elem_t));
    +        APR_RING_ELEM_INIT(elem, link);
    +    }
    +    elem->pfd = *descriptor;
    +
    +    if (descriptor->desc_type == APR_POLL_SOCKET) {
    +        fd = descriptor->desc.s->socketdes;
    +    }
    +    else {
    +        fd = descriptor->desc.f->filedes;
    +    }
    +
    +    res = port_associate(pollset->port_fd, PORT_SOURCE_FD, fd, 
    +                         get_event(descriptor->reqevents), (void *)elem);
    +
    +    if (res < 0) {
    +        rv = APR_ENOMEM;
    +        APR_RING_INSERT_TAIL(&(pollset->free_ring), elem, pfd_elem_t, link);
    +    }
    +    else {
    +        pollset->nelts++;
    +        APR_RING_INSERT_TAIL(&(pollset->query_ring), elem, pfd_elem_t, link);
    +    }
    +
    +    pollset_unlock_rings();
    +
    +    return rv;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset,
    +                                             const apr_pollfd_t *descriptor)
    +{
    +    apr_os_sock_t fd;
    +    pfd_elem_t *ep;
    +    apr_status_t rv = APR_SUCCESS;
    +    int res;
    +
    +    pollset_lock_rings();
    +
    +    if (descriptor->desc_type == APR_POLL_SOCKET) {
    +        fd = descriptor->desc.s->socketdes;
    +    }
    +    else {
    +        fd = descriptor->desc.f->filedes;
    +    }
    +
    +    res = port_dissociate(pollset->port_fd, PORT_SOURCE_FD, fd);
    +
    +    if(res < 0) {
    +        rv = APR_NOTFOUND;
    +    }
    +
    +    if (!APR_RING_EMPTY(&(pollset->query_ring), pfd_elem_t, link)) {
    +        for (ep = APR_RING_FIRST(&(pollset->query_ring));
    +             ep != APR_RING_SENTINEL(&(pollset->query_ring),
    +                                     pfd_elem_t, link);
    +             ep = APR_RING_NEXT(ep, link)) {
    +
    +            if (descriptor->desc.s == ep->pfd.desc.s) {
    +                APR_RING_REMOVE(ep, link);
    +                APR_RING_INSERT_TAIL(&(pollset->dead_ring),
    +                                     ep, pfd_elem_t, link);
    +                break;
    +            }
    +        }
    +    }
    +
    +    if (!APR_RING_EMPTY(&(pollset->add_ring), pfd_elem_t, link)) {
    +        for (ep = APR_RING_FIRST(&(pollset->add_ring));
    +             ep != APR_RING_SENTINEL(&(pollset->add_ring),
    +                                     pfd_elem_t, link);
    +             ep = APR_RING_NEXT(ep, link)) {
    +
    +            if (descriptor->desc.s == ep->pfd.desc.s) {
    +                APR_RING_REMOVE(ep, link);
    +                APR_RING_INSERT_TAIL(&(pollset->dead_ring),
    +                                     ep, pfd_elem_t, link);
    +                break;
    +            }
    +        }
    +    }
    +
    +    pollset_unlock_rings();
    +
    +    return rv;
    +}
    +
    +APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset,
    +                                           apr_interval_time_t timeout,
    +                                           apr_int32_t *num,
    +                                           const apr_pollfd_t **descriptors)
    +{
    +    apr_os_sock_t fd;
    +    int ret, i, nget;
    +    pfd_elem_t *ep;
    +    struct timespec tv, *tvptr;
    +    apr_status_t rv = APR_SUCCESS;
    +
    +    if (timeout < 0) {
    +        tvptr = NULL;
    +    }
    +    else {
    +        tv.tv_sec = (long) apr_time_sec(timeout);
    +        tv.tv_nsec = (long) apr_time_msec(timeout);
    +        tvptr = &tv;
    +    }
    +
    +    nget = 1;
    +
    +    pollset_lock_rings();
    +
    +    while (!APR_RING_EMPTY(&(pollset->add_ring), pfd_elem_t, link)) {
    +        ep = APR_RING_FIRST(&(pollset->add_ring));
    +        APR_RING_REMOVE(ep, link);
    +
    +        if (ep->pfd.desc_type == APR_POLL_SOCKET) {
    +            fd = ep->pfd.desc.s->socketdes;
    +        }
    +        else {
    +            fd = ep->pfd.desc.f->filedes;
    +        }
    +
    +        port_associate(pollset->port_fd, PORT_SOURCE_FD, 
    +                           fd, get_event(ep->pfd.reqevents), ep);
    +
    +    }
    +
    +    pollset_unlock_rings();
    +
    +    ret = port_getn(pollset->port_fd, pollset->port_set,  pollset->nalloc, &nget, tvptr);
    +
    +    (*num) = nget;
    +
    +    if (ret == -1) {
    +        (*num) = 0;
    +        if(errno == ETIME || errno == EINTR) {
    +            rv = APR_TIMEUP;
    +        }
    +        else {
    +            rv = APR_EGENERAL;
    +        }
    +    }
    +    else if (nget == 0) {
    +        rv = APR_TIMEUP;
    +    }
    +    else {
    +
    +        for (i = 0; i < nget; i++) {
    +            pollset->result_set[i] =
    +                (((pfd_elem_t*)(pollset->port_set[i].portev_user))->pfd);
    +            pollset->result_set[i].rtnevents =
    +                get_revent(pollset->port_set[i].portev_events);
    +
    +            APR_RING_INSERT_TAIL(&(pollset->add_ring), 
    +                                 ((pfd_elem_t*)(pollset->port_set[i].portev_user)), 
    +                                 pfd_elem_t, link);
    +        }
    +
    +        if (descriptors) {
    +            *descriptors = pollset->result_set;
    +        }
    +    }
    +
    +
    +    pollset_lock_rings();
    +
    +    /* Shift all PFDs in the Dead Ring to be Free Ring */
    +    while (!APR_RING_EMPTY(&(pollset->dead_ring), pfd_elem_t, link)) {
    +        ep = APR_RING_FIRST(&(pollset->dead_ring));
    +        APR_RING_REMOVE(ep, link);
    +        APR_RING_INSERT_TAIL(&(pollset->free_ring), ep, pfd_elem_t, link);
    +    }
    +
    +    pollset_unlock_rings();
    +
    +    return rv;
    +}
    +
    +#endif /* POLLSET_USES_PORT */
    
    From 9f56bbecae19da10fc115689e2efe380adda468c Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Mon, 22 Nov 2004 10:01:38 +0000
    Subject: [PATCH 5218/7878] * include/apr_poll.h (apr_pollset_create): Document
     APR_POLLSET_THREADSAFE.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106171 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_poll.h | 10 ++++++++--
     1 file changed, 8 insertions(+), 2 deletions(-)
    
    diff --git a/include/apr_poll.h b/include/apr_poll.h
    index 0584b09f372..bd3fd9ebb61 100644
    --- a/include/apr_poll.h
    +++ b/include/apr_poll.h
    @@ -95,8 +95,14 @@ typedef struct apr_pollset_t apr_pollset_t;
      * @param pollset  The pointer in which to return the newly created object 
      * @param size The maximum number of descriptors that this pollset can hold
      * @param p The pool from which to allocate the pollset
    - * @param flags Optional flags to modify the operation of the pollset
    - *              (reserved for future expansion)
    + * @param flags Optional flags to modify the operation of the pollset.
    + *
    + * @remark If flags equals APR_POLLSET_THREADSAFE, then a pollset is
    + * created on which it is safe to make concurrent calls to
    + * apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() from
    + * separate threads.  This feature is only supported on some
    + * platforms; the apr_pollset_create() call will fail with
    + * APR_ENOTIMPL on platforms where it is not supported.
      */
     APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
                                                  apr_uint32_t size,
    
    From 5faefac84870eaa436f5e1c6fbbdb36b91788732 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Mon, 22 Nov 2004 16:58:56 +0000
    Subject: [PATCH 5219/7878] Fix a build problem on NetWare with the latest
     apr_poll patches
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106198 13f79535-47bb-0310-9956-ffa450edef68
    ---
     NWGNUmakefile | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/NWGNUmakefile b/NWGNUmakefile
    index b977bb0d651..61df7815805 100644
    --- a/NWGNUmakefile
    +++ b/NWGNUmakefile
    @@ -293,13 +293,13 @@ FILES_lib_objs = \
     	$(OBJDIR)/open.o \
     	$(OBJDIR)/pipe.o \
     	$(OBJDIR)/otherchild.o \
    -	$(OBJDIR)/poll.o \
     	$(OBJDIR)/proc.o \
     	$(OBJDIR)/procsup.o \
     	$(OBJDIR)/proc_mutex.o \
     	$(OBJDIR)/rand.o \
     	$(OBJDIR)/readwrite.o \
     	$(OBJDIR)/seek.o \
    +	$(OBJDIR)/select.o \
     	$(OBJDIR)/sendrecv.o \
     	$(OBJDIR)/sha2.o \
     	$(OBJDIR)/sha2_glue.o \
    
    From 3fef28c5de5c9e9538d64fe0807ec62e9c8e80b6 Mon Sep 17 00:00:00 2001
    From: Paul Querna 
    Date: Mon, 22 Nov 2004 20:14:25 +0000
    Subject: [PATCH 5220/7878] Use uuid_generate() and uuid_create() for the
     apr_os_uuid_get() interface on platforms that support them.
    
    Tested On: Linux 2.6 (libuuid) and FreeBSD 5.2.1 (libc has uuid_create)
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106214 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES          |  4 ++++
     configure.in     | 13 +++++++++++++
     include/apr.h.in |  2 +-
     misc/unix/rand.c | 31 +++++++++++++++++++++++++++++++
     4 files changed, 49 insertions(+), 1 deletion(-)
    
    diff --git a/CHANGES b/CHANGES
    index 2de73a18dc9..5fad85cb5c0 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -5,6 +5,10 @@ Changes for APR 1.1.0
          and upgrading it to do SHA-256. Not yet ready for prime time.
          [Ben Laurie]
     
    +  *) Added apr_os_uuid_get() support for Linux via libuuid and for modern 
    +     BSDs which have uuid_create as part of their libc.
    +     [Paul Querna]
    +
       *) Added Solaris 10 'Event Ports' as a backend for APR Pollset.  This 
          backend also supports the APR_POLLSET_THREADSAFE flag.
          [Paul Querna]
    diff --git a/configure.in b/configure.in
    index a09aafb42bc..d1769d82f0e 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -1790,6 +1790,19 @@ if test "$rand" != "1"; then
     fi
     
     AC_SUBST(rand)
    +
    +dnl ----------------------------- Checking for UUID Support 
    +echo "${nl}Checking for OS UUID Support..."
    +osuuid="0"
    +AC_CHECK_FUNCS(uuid_create, [osuuid="1"
    +    AC_DEFINE([HAVE_UUID_CREATE], 1, [Define if libc has uuid_create])], [])
    +AC_CHECK_LIB(uuid, uuid_generate, 
    +    [osuuid="1"
    +     APR_ADDTO(LIBS,-luuid)
    +     AC_DEFINE([HAVE_LIBUUID], 1, [Define if libuuid is present])], [])
    +AC_SUBST(osuuid)
    +
    +
     dnl ----------------------------- Checking for Time Support 
     echo "${nl}Checking for Time Support..."
     AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
    diff --git a/include/apr.h.in b/include/apr.h.in
    index 858037b48d5..1a52a0eff3e 100644
    --- a/include/apr.h.in
    +++ b/include/apr.h.in
    @@ -219,7 +219,7 @@ extern "C" {
     #define APR_HAS_USER              1
     #define APR_HAS_LARGE_FILES       @aprlfs@
     #define APR_HAS_XTHREAD_FILES     0
    -#define APR_HAS_OS_UUID           0
    +#define APR_HAS_OS_UUID           @osuuid@
     
     /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible
      * to poll on files/pipes.
    diff --git a/misc/unix/rand.c b/misc/unix/rand.c
    index 894022f6d73..0bdd3722fcf 100644
    --- a/misc/unix/rand.c
    +++ b/misc/unix/rand.c
    @@ -39,6 +39,37 @@
     #define SHUT_RDWR 2
     #endif
     
    +#if HAVE_UUID_CREATE
    +
    +#include 
    +
    +APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data)
    +{
    +    uuid_t g;
    +
    +    uuid_create(&g, NULL);
    +
    +    memcpy( (void*)uuid_data, (const void *)&g, sizeof( uuid_t ) );
    +
    +    return APR_SUCCESS;
    +}
    +
    +#elif HAVE_LIBUUID
    +
    +#include 
    +
    +APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data)
    +{
    +    uuid_t g;
    +
    +    uuid_generate(g);
    +
    +    memcpy((void*)uuid_data, (const void *)g, sizeof( uuid_t ) );
    +
    +    return APR_SUCCESS;
    +}
    +#endif 
    +
     #if APR_HAS_RANDOM
     
     APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, 
    
    From de4f38baa921d573a3d6c361097e2eeeb9f6a0f3 Mon Sep 17 00:00:00 2001
    From: Paul Querna 
    Date: Mon, 22 Nov 2004 23:24:51 +0000
    Subject: [PATCH 5221/7878] Fix style and remove casts for the new
     apr_os_uuid_get() interfaces.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106236 13f79535-47bb-0310-9956-ffa450edef68
    ---
     misc/unix/rand.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/misc/unix/rand.c b/misc/unix/rand.c
    index 0bdd3722fcf..83398b9b5ab 100644
    --- a/misc/unix/rand.c
    +++ b/misc/unix/rand.c
    @@ -49,7 +49,7 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data)
     
         uuid_create(&g, NULL);
     
    -    memcpy( (void*)uuid_data, (const void *)&g, sizeof( uuid_t ) );
    +    memcpy(uuid_data, &g, sizeof(uuid_t));
     
         return APR_SUCCESS;
     }
    @@ -64,7 +64,7 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data)
     
         uuid_generate(g);
     
    -    memcpy((void*)uuid_data, (const void *)g, sizeof( uuid_t ) );
    +    memcpy(uuid_data, g, sizeof(uuid_t));
     
         return APR_SUCCESS;
     }
    
    From 2f6a3d3aeef5f7f8fd6d84dc8cf2d98ff4b30b1f Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Wed, 24 Nov 2004 10:18:22 +0000
    Subject: [PATCH 5222/7878] OS/2: Add implementation of
     apr_dir_make_recursive().
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106404 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/os2/dir.c              |  8 ----
     file_io/os2/dir_make_recurse.c | 85 ++++++++++++++++++++++++++++++++++
     2 files changed, 85 insertions(+), 8 deletions(-)
     create mode 100644 file_io/os2/dir_make_recurse.c
    
    diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c
    index eb73dd99d01..0ea1d27f2c1 100644
    --- a/file_io/os2/dir.c
    +++ b/file_io/os2/dir.c
    @@ -136,14 +136,6 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, a
     
     
     
    -apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm,
    -                                    apr_pool_t *pool) 
    -{
    -    return APR_ENOTIMPL;
    -}
    -
    -
    -
     APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool)
     {
         return APR_FROM_OS_ERROR(DosDeleteDir(path));
    diff --git a/file_io/os2/dir_make_recurse.c b/file_io/os2/dir_make_recurse.c
    new file mode 100644
    index 00000000000..4090c19d100
    --- /dev/null
    +++ b/file_io/os2/dir_make_recurse.c
    @@ -0,0 +1,85 @@
    +/* Copyright 2000-2004 The Apache Software Foundation
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +#include "apr_file_io.h"
    +#include "apr_lib.h"
    +#include "apr_strings.h"
    +#include 
    +
    +#define IS_SEP(c) (c == '/' || c == '\\')
    +
    +/* Remove trailing separators that don't affect the meaning of PATH. */
    +static const char *path_canonicalize(const char *path, apr_pool_t *pool)
    +{
    +    /* At some point this could eliminate redundant components.  For
    +     * now, it just makes sure there is no trailing slash. */
    +    apr_size_t len = strlen(path);
    +    apr_size_t orig_len = len;
    +
    +    while ((len > 0) && IS_SEP(path[len - 1])) {
    +        len--;
    +    }
    +
    +    if (len != orig_len) {
    +        return apr_pstrndup(pool, path, len);
    +    }
    +    else {
    +        return path;
    +    }
    +}
    +
    +
    +
    +/* Remove one component off the end of PATH. */
    +static char *path_remove_last_component(const char *path, apr_pool_t *pool)
    +{
    +    const char *newpath = path_canonicalize(path, pool);
    +    int i;
    +
    +    for (i = strlen(newpath) - 1; i >= 0; i--) {
    +        if (IS_SEP(path[i])) {
    +            break;
    +        }
    +    }
    +
    +    return apr_pstrndup(pool, path, (i < 0) ? 0 : i);
    +}
    +
    +
    +
    +apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm,
    +                                    apr_pool_t *pool)
    +{
    +    apr_status_t apr_err = APR_SUCCESS;
    +    
    +    apr_err = apr_dir_make(path, perm, pool); /* Try to make PATH right out */
    +
    +    if (APR_STATUS_IS_EEXIST(apr_err)) { /* It's OK if PATH exists */
    +        return APR_SUCCESS;
    +    }
    +
    +    if (APR_STATUS_IS_ENOENT(apr_err)) { /* Missing an intermediate dir */
    +        char *dir;
    +
    +        dir = path_remove_last_component(path, pool);
    +        apr_err = apr_dir_make_recursive(dir, perm, pool);
    +
    +        if (!apr_err) {
    +            apr_err = apr_dir_make(path, perm, pool);
    +        }
    +    }
    +
    +    return apr_err;
    +}
    
    From ee44d11eab3f6930a590976c55d53c4f8be4bc86 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Wed, 24 Nov 2004 15:41:01 +0000
    Subject: [PATCH 5223/7878] * test/Makefile.in (CLEAN_TARGETS): Clean up after
     new tests.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106421 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index 5455361020c..10d2c1dbc43 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -30,7 +30,8 @@ LOCAL_LIBS=../lib@APR_LIBNAME@.la
     
     CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \
     	readchild@EXEEXT@ tryread@EXEEXT@ sockchild@EXEEXT@ \
    -	globalmutexchild@EXEEXT@ lfstests/large.bin
    +	globalmutexchild@EXEEXT@ lfstests/large.bin \
    +	data/testputs.txt data/testbigfprintf.dat
     CLEAN_SUBDIRS = internal
     
     INCDIR=../include
    
    From af53f0ee56adac1fa6c8e228d6d6bbd8185c6e10 Mon Sep 17 00:00:00 2001
    From: Andre Malo 
    Date: Wed, 24 Nov 2004 22:51:51 +0000
    Subject: [PATCH 5224/7878] property cleanup
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106483 13f79535-47bb-0310-9956-ffa450edef68
    ---
     docs/pool-design.html          |   2 +-
     file_io/os2/dir_make_recurse.c | 170 ++++++++++++++++-----------------
     poll/os2/poll.c                |   0
     3 files changed, 86 insertions(+), 86 deletions(-)
     mode change 100755 => 100644 poll/os2/poll.c
    
    diff --git a/docs/pool-design.html b/docs/pool-design.html
    index cb6660aac8d..0669bdfc99e 100644
    --- a/docs/pool-design.html
    +++ b/docs/pool-design.html
    @@ -4,7 +4,7 @@
       
       
         
    - Last modified at [$Date: 2003/06/25 21:50:16 $] + Last modified at [$Date$]

    Using APR Pools

    diff --git a/file_io/os2/dir_make_recurse.c b/file_io/os2/dir_make_recurse.c index 4090c19d100..4f2acaaabf9 100644 --- a/file_io/os2/dir_make_recurse.c +++ b/file_io/os2/dir_make_recurse.c @@ -1,85 +1,85 @@ -/* Copyright 2000-2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "apr_file_io.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include - -#define IS_SEP(c) (c == '/' || c == '\\') - -/* Remove trailing separators that don't affect the meaning of PATH. */ -static const char *path_canonicalize(const char *path, apr_pool_t *pool) -{ - /* At some point this could eliminate redundant components. For - * now, it just makes sure there is no trailing slash. */ - apr_size_t len = strlen(path); - apr_size_t orig_len = len; - - while ((len > 0) && IS_SEP(path[len - 1])) { - len--; - } - - if (len != orig_len) { - return apr_pstrndup(pool, path, len); - } - else { - return path; - } -} - - - -/* Remove one component off the end of PATH. */ -static char *path_remove_last_component(const char *path, apr_pool_t *pool) -{ - const char *newpath = path_canonicalize(path, pool); - int i; - - for (i = strlen(newpath) - 1; i >= 0; i--) { - if (IS_SEP(path[i])) { - break; - } - } - - return apr_pstrndup(pool, path, (i < 0) ? 0 : i); -} - - - -apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, - apr_pool_t *pool) -{ - apr_status_t apr_err = APR_SUCCESS; - - apr_err = apr_dir_make(path, perm, pool); /* Try to make PATH right out */ - - if (APR_STATUS_IS_EEXIST(apr_err)) { /* It's OK if PATH exists */ - return APR_SUCCESS; - } - - if (APR_STATUS_IS_ENOENT(apr_err)) { /* Missing an intermediate dir */ - char *dir; - - dir = path_remove_last_component(path, pool); - apr_err = apr_dir_make_recursive(dir, perm, pool); - - if (!apr_err) { - apr_err = apr_dir_make(path, perm, pool); - } - } - - return apr_err; -} +/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_file_io.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include + +#define IS_SEP(c) (c == '/' || c == '\\') + +/* Remove trailing separators that don't affect the meaning of PATH. */ +static const char *path_canonicalize(const char *path, apr_pool_t *pool) +{ + /* At some point this could eliminate redundant components. For + * now, it just makes sure there is no trailing slash. */ + apr_size_t len = strlen(path); + apr_size_t orig_len = len; + + while ((len > 0) && IS_SEP(path[len - 1])) { + len--; + } + + if (len != orig_len) { + return apr_pstrndup(pool, path, len); + } + else { + return path; + } +} + + + +/* Remove one component off the end of PATH. */ +static char *path_remove_last_component(const char *path, apr_pool_t *pool) +{ + const char *newpath = path_canonicalize(path, pool); + int i; + + for (i = strlen(newpath) - 1; i >= 0; i--) { + if (IS_SEP(path[i])) { + break; + } + } + + return apr_pstrndup(pool, path, (i < 0) ? 0 : i); +} + + + +apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, + apr_pool_t *pool) +{ + apr_status_t apr_err = APR_SUCCESS; + + apr_err = apr_dir_make(path, perm, pool); /* Try to make PATH right out */ + + if (APR_STATUS_IS_EEXIST(apr_err)) { /* It's OK if PATH exists */ + return APR_SUCCESS; + } + + if (APR_STATUS_IS_ENOENT(apr_err)) { /* Missing an intermediate dir */ + char *dir; + + dir = path_remove_last_component(path, pool); + apr_err = apr_dir_make_recursive(dir, perm, pool); + + if (!apr_err) { + apr_err = apr_dir_make(path, perm, pool); + } + } + + return apr_err; +} diff --git a/poll/os2/poll.c b/poll/os2/poll.c old mode 100755 new mode 100644 From cb57473714fdff4f5f5799429248078ac7fa126c Mon Sep 17 00:00:00 2001 From: Andre Malo Date: Wed, 24 Nov 2004 23:07:58 +0000 Subject: [PATCH 5225/7878] property cleanup git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106488 13f79535-47bb-0310-9956-ffa450edef68 From efc725875b01a0e40ae12d49ce396adecbeacf87 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 25 Nov 2004 09:41:18 +0000 Subject: [PATCH 5226/7878] * poll/unix/poll.c (apr_pollset_remove): Remove unused variable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106558 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 1 - 1 file changed, 1 deletion(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index b2da0507994..bb2ebc0938c 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -203,7 +203,6 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { apr_uint32_t i; - apr_os_sock_t fd; for (i = 0; i < pollset->nelts; i++) { if (descriptor->desc.s == pollset->query_set[i].desc.s) { From 33cac3ef01370de6233ecfe8ea39552302d2e01d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 25 Nov 2004 09:42:13 +0000 Subject: [PATCH 5227/7878] Ignore apr_rules.out. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106559 13f79535-47bb-0310-9956-ffa450edef68 From 594f261c7762642e978607548fd637886d709847 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 25 Nov 2004 17:59:42 +0000 Subject: [PATCH 5228/7878] * STATUS: Sync with actual releases. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106586 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/STATUS b/STATUS index c5db6c071b9..b3e5e1268f1 100644 --- a/STATUS +++ b/STATUS @@ -4,7 +4,10 @@ Last modified at [$Date$] Releases: Standalone + 1.0.1 : released November 18, 2004 1.0.0 : released September 1, 2004 + 0.9.5 : released November 19, 2004 + 0.9.4 : released September 25, 2003 0.9.3 : tagged March 30, 2003 0.9.2 : released March 22, 2003 0.9.1 : released September 11, 2002 From 197e716b8d0ba1faccfc630156a1d767a8fd01d6 Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Fri, 26 Nov 2004 21:26:37 +0000 Subject: [PATCH 5229/7878] rename the fopen defines (APR_READ, APR_WRITE, etc.) to have prefix APR_FOPEN_ (keeping the old defines) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106663 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_file_io.h | 62 ++++++++++++++++++++++++++++--------------- 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/CHANGES b/CHANGES index 5fad85cb5c0..cc7dc09eb79 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.1.0 + *( rename the fopen defines (APR_READ, APR_WRITE, etc.) to have + prefix APR_FOPEN_ (keeping the old defines) [Stas] + *) [NOT COMMITTED?] Add a new PRNG. Note that the implementation of SHA-256 is a stop-gap pending snarfing the SHA-1 implementation from apr-util and upgrading it to do SHA-256. Not yet ready for prime time. diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 5e7f0d28266..7ff9f10b923 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -50,27 +50,47 @@ extern "C" { /* Note to implementors: Values in the range 0x00100000--0x80000000 are reserved for platform-specific values. */ -#define APR_READ 0x00001 /**< Open the file for reading */ -#define APR_WRITE 0x00002 /**< Open the file for writing */ -#define APR_CREATE 0x00004 /**< Create the file if not there */ -#define APR_APPEND 0x00008 /**< Append to the end of the file */ -#define APR_TRUNCATE 0x00010 /**< Open the file and truncate to 0 length */ -#define APR_BINARY 0x00020 /**< Open the file in binary mode */ -#define APR_EXCL 0x00040 /**< Open should fail if APR_CREATE and file - exists. */ -#define APR_BUFFERED 0x00080 /**< Open the file for buffered I/O */ -#define APR_DELONCLOSE 0x00100 /**< Delete the file after close */ -#define APR_XTHREAD 0x00200 /**< Platform dependent tag to open the file - for use across multiple threads */ -#define APR_SHARELOCK 0x00400 /**< Platform dependent support for higher - level locked read/write access to support - writes across process/machines */ -#define APR_FILE_NOCLEANUP 0x00800 /**< Do not register a cleanup when the file - is opened */ -#define APR_SENDFILE_ENABLED 0x01000 /**< Advisory flag that this file should - support apr_socket_sendfile operation */ -#define APR_LARGEFILE 0x04000 /**< Platform dependent flag to enable large file - support; WARNING see below. */ +#define APR_FOPEN_READ 0x00001 /**< Open the file for reading */ +#define APR_FOPEN_WRITE 0x00002 /**< Open the file for writing */ +#define APR_FOPEN_CREATE 0x00004 /**< Create the file if not there */ +#define APR_FOPEN_APPEND 0x00008 /**< Append to the end of the file */ +#define APR_FOPEN_TRUNCATE 0x00010 /**< Open the file and truncate + to 0 length */ +#define APR_FOPEN_BINARY 0x00020 /**< Open the file in binary mode */ +#define APR_FOPEN_EXCL 0x00040 /**< Open should fail if APR_CREATE + and file exists. */ +#define APR_FOPEN_BUFFERED 0x00080 /**< Open the file for buffered I/O */ +#define APR_FOPEN_DELONCLOSE 0x00100 /**< Delete the file after close */ +#define APR_FOPEN_XTHREAD 0x00200 /**< Platform dependent tag to open + the file for use across multiple + threads */ +#define APR_FOPEN_SHARELOCK 0x00400 /**< Platform dependent support for + higher level locked read/write + access to support writes across + process/machines */ +#define APR_FOPEN_NOCLEANUP 0x00800 /**< Do not register a cleanup + when the file is opened */ +#define APR_FOPEN_SENDFILE_ENABLED 0x01000 /**< Advisory flag that this + file should support + apr_socket_sendfile operation */ +#define APR_FOPEN_LARGEFILE 0x04000 /**< Platform dependent flag to enable + large file support; WARNING see + below. */ +/* backcompat */ +#define APR_READ APR_FOPEN_READ +#define APR_WRITE APR_FOPEN_WRITE +#define APR_CREATE APR_FOPEN_CREATE +#define APR_APPEND APR_FOPEN_APPEND +#define APR_TRUNCATE APR_FOPEN_TRUNCATE +#define APR_BINARY APR_FOPEN_BINARY +#define APR_EXCL APR_FOPEN_EXCL +#define APR_BUFFERED APR_FOPEN_BUFFERED +#define APR_DELONCLOSE APR_FOPEN_DELONCLOSE +#define APR_XTHREAD APR_FOPEN_XTHREAD +#define APR_SHARELOCK APR_FOPEN_SHARELOCK +#define APR_FILE_NOCLEANUP APR_FOPEN_NOCLEANUP +#define APR_SENDFILE_ENABLED APR_FOPEN_SENDFILE_ENABLED +#define APR_LARGEFILE APR_FOPEN_LARGEFILE /** @warning The APR_LARGEFILE flag only has effect on some platforms * where sizeof(apr_off_t) == 4. Where implemented, it allows opening From bafe4412a4b21a32c9241de0abbbc560238d93e9 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Sat, 27 Nov 2004 22:51:47 +0000 Subject: [PATCH 5230/7878] Fixing various compiler errors when compiling against the latest version of LibC SDK git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106767 13f79535-47bb-0310-9956-ffa450edef68 --- locks/netware/thread_mutex.c | 2 +- threadproc/netware/proc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index 403e34285b1..b4f9c66a842 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -46,7 +46,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, } new_mutex->pool = pool; - new_mutex->mutex = NXMutexAlloc(NX_MUTEX_RECURSIVE, NULL, NULL); + new_mutex->mutex = NXMutexAlloc(NX_MUTEX_RECURSIVE, 0, NULL); if(new_mutex->mutex == NULL) return APR_ENOMEM; diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 52c1495b7f9..fa23af6b7ba 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -390,7 +390,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, } else if (WIFSIGNALED(exit_int)) { *exitwhy = APR_PROC_SIGNAL; - *exitcode = WTERMSIG(exit_int); + *exitcode = WIFTERMSIG(exit_int); } else { /* unexpected condition */ From e453d01137ffc0e58f55903aec228bcc571891f9 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 28 Nov 2004 08:43:58 +0000 Subject: [PATCH 5231/7878] * jlibtool.c: Add NetBSD support. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106797 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index 5f38b6db626..11139ac5185 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -70,7 +70,7 @@ # define LD_LIBRARY_PATH "DYLD_LIBRARY_PATH" #endif -#if defined(__linux__) || defined(__FreeBSD__) +#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) # define SHELL_CMD "/bin/sh" # define DYNAMIC_LIB_EXT "so" # define MODULE_LIB_EXT "so" From 34639ece3b858085ca7d4da18185c2095753b09b Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 28 Nov 2004 19:00:49 +0000 Subject: [PATCH 5232/7878] * Makefile.in: install.sh can not handle wildcards, so expand out with for loop. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106831 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 0c29cba8a8f..b5daddfdb33 100644 --- a/Makefile.in +++ b/Makefile.in @@ -69,7 +69,9 @@ install: $(TARGET_LIB) apr-config.out build/apr_rules.out $(APR_MKDIR) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(installbuilddir) \ $(DESTDIR)$(libdir)/pkgconfig $(DESTDIR)$(includedir) $(INSTALL_DATA) $(top_blddir)/include/apr.h $(DESTDIR)$(includedir) - $(INSTALL_DATA) $(top_srcdir)/include/apr_*.h $(DESTDIR)$(includedir) + for f in $(top_srcdir)/include/apr_*.h; do \ + $(INSTALL_DATA) $${f} $(DESTDIR)$(includedir); \ + done $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(TARGET_LIB) $(DESTDIR)$(libdir) $(INSTALL_DATA) apr.exp $(DESTDIR)$(libdir)/apr.exp $(INSTALL_DATA) apr.pc $(DESTDIR)$(libdir)/pkgconfig/$(APR_PCFILE) From d4ec849e7216a71bd12dc6bd2e95968b1b0ae020 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 28 Nov 2004 21:51:46 +0000 Subject: [PATCH 5233/7878] Remove the Runtime test for the different sendfile revisions on FreeBSD. PR: 25718 Submitted By: Mike Silbersack git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106850 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ network_io/unix/sendrecv.c | 59 ++++---------------------------------- 2 files changed, 9 insertions(+), 53 deletions(-) diff --git a/CHANGES b/CHANGES index cc7dc09eb79..51f50e802b2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.1.0 + *) Remove the runtime test for Sendfile versions on FreeBSD. PR 25718. + [Mike Silbersack , Paul Querna] + *( rename the fopen defines (APR_READ, APR_WRITE, etc.) to have prefix APR_FOPEN_ (keeping the old defines) [Stas] diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 002b6e1ccd5..f70c84716e7 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -21,9 +21,9 @@ #include "apr_arch_file_io.h" #endif /* APR_HAS_SENDFILE */ -/* sys/sysctl.h is only needed on FreeBSD for include_hdrs_in_length() */ -#if defined(__FreeBSD__) && defined(HAVE_SYS_SYSCTL_H) -#include +/* osreldate.h is only needed on FreeBSD for sendfile detection */ +#if defined(__FreeBSD__) +#include #endif apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, @@ -389,55 +389,6 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, #elif defined(__FreeBSD__) -static int include_hdrs_in_length(void) -{ -#ifdef HAVE_SYS_SYSCTL_H -/* this assumes: - * if the header exists, so does the sysctlbyname() syscall, and - * if the header doesn't exist, the kernel is really old - */ - -/* see - * http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/sys/param.h#rev1.61.2.29 - * for kernel version number - * - * http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/uipc_syscalls.c#rev1.65.2.10 - * for the sendfile patch - */ -#define KERNEL_WITH_SENDFILE_LENGTH_FIX 460001 - - typedef enum { UNKNOWN = 0, - NEW, - OLD - } api_e; - - static api_e api; - int kernel_version; - apr_size_t kernel_version_size; - - if (api != UNKNOWN) { - return (api == OLD); - } - kernel_version = 0; /* silence compiler warning */ - kernel_version_size = sizeof(kernel_version); - if (sysctlbyname("kern.osreldate", &kernel_version, - &kernel_version_size, NULL, NULL) == 0 && - kernel_version < KERNEL_WITH_SENDFILE_LENGTH_FIX) { - api = OLD; - return 1; - } - /* size of kern.osreldate's output might change in the future - * causing the sysctlbyname to fail, - * but if it's the future, we should use the newer API - */ - api = NEW; - return 0; -#else - /* the build system's kernel is older than 3.4. Use the old API */ - return 1; -#endif -} - /* Release 3.1 or greater */ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, apr_hdtr_t * hdtr, apr_off_t * offset, @@ -455,7 +406,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, hdtr = &no_hdtr; } - else if (hdtr->numheaders && include_hdrs_in_length()) { +#if __FreeBSD_version < 460001 + else if (hdtr->numheaders) { /* On early versions of FreeBSD sendfile, the number of bytes to send * must include the length of the headers. Don't look at the man page @@ -468,6 +420,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, bytes_to_send += hdtr->headers[i].iov_len; } } +#endif headerstruct.headers = hdtr->headers; headerstruct.hdr_cnt = hdtr->numheaders; From 2fa06ea53dd3d78c5e880a5da452f711f408582f Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Mon, 29 Nov 2004 16:48:29 +0000 Subject: [PATCH 5234/7878] add deprecated doxygen tags git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106929 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 7ff9f10b923..44912434c9b 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -77,20 +77,20 @@ extern "C" { large file support; WARNING see below. */ /* backcompat */ -#define APR_READ APR_FOPEN_READ -#define APR_WRITE APR_FOPEN_WRITE -#define APR_CREATE APR_FOPEN_CREATE -#define APR_APPEND APR_FOPEN_APPEND -#define APR_TRUNCATE APR_FOPEN_TRUNCATE -#define APR_BINARY APR_FOPEN_BINARY -#define APR_EXCL APR_FOPEN_EXCL -#define APR_BUFFERED APR_FOPEN_BUFFERED -#define APR_DELONCLOSE APR_FOPEN_DELONCLOSE -#define APR_XTHREAD APR_FOPEN_XTHREAD -#define APR_SHARELOCK APR_FOPEN_SHARELOCK -#define APR_FILE_NOCLEANUP APR_FOPEN_NOCLEANUP -#define APR_SENDFILE_ENABLED APR_FOPEN_SENDFILE_ENABLED -#define APR_LARGEFILE APR_FOPEN_LARGEFILE +#define APR_READ APR_FOPEN_READ /**< @deprecated @see APR_FOPEN_READ */ +#define APR_WRITE APR_FOPEN_WRITE /**< @deprecated @see APR_FOPEN_WRITE */ +#define APR_CREATE APR_FOPEN_CREATE /**< @deprecated @see APR_FOPEN_CREATE */ +#define APR_APPEND APR_FOPEN_APPEND /**< @deprecated @see APR_FOPEN_APPEND */ +#define APR_TRUNCATE APR_FOPEN_TRUNCATE /**< @deprecated @see APR_FOPEN_TRUNCATE */ +#define APR_BINARY APR_FOPEN_BINARY /**< @deprecated @see APR_FOPEN_BINARY */ +#define APR_EXCL APR_FOPEN_EXCL /**< @deprecated @see APR_FOPEN_EXCL */ +#define APR_BUFFERED APR_FOPEN_BUFFERED /**< @deprecated @see APR_FOPEN_BUFFERED */ +#define APR_DELONCLOSE APR_FOPEN_DELONCLOSE /**< @deprecated @see APR_FOPEN_DELONCLOSE */ +#define APR_XTHREAD APR_FOPEN_XTHREAD /**< @deprecated @see APR_FOPEN_XTHREAD */ +#define APR_SHARELOCK APR_FOPEN_SHARELOCK /**< @deprecated @see APR_FOPEN_SHARELOCK */ +#define APR_FILE_NOCLEANUP APR_FOPEN_NOCLEANUP /**< @deprecated @see APR_FOPEN_NOCLEANUP */ +#define APR_SENDFILE_ENABLED APR_FOPEN_SENDFILE_ENABLED /**< @deprecated @see APR_FOPEN_SENDFILE_ENABLED */ +#define APR_LARGEFILE APR_FOPEN_LARGEFILE /**< @deprecated @see APR_FOPEN_LARGEFILE */ /** @warning The APR_LARGEFILE flag only has effect on some platforms * where sizeof(apr_off_t) == 4. Where implemented, it allows opening From c22a762292301ee0f39d8a83a38ec64e23611a7b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 30 Nov 2004 14:41:31 +0000 Subject: [PATCH 5235/7878] apr_password_get(): Fix the check for buffer overflow. The input buffer had already been cleared by the time the length of the input buffer was checked, so overflow was never reported. Add a comment about the length checking to the docs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@107007 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ include/apr_lib.h | 2 ++ passwd/apr_getpass.c | 10 ++++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 51f50e802b2..df451fd855c 100644 --- a/CHANGES +++ b/CHANGES @@ -32,6 +32,8 @@ Changes for APR 1.1.0 Changes for APR 1.0.1 + *) apr_password_get(): Fix the check for buffer overflow. [Jeff Trawick] + *) Fix HUP return codes in pollset when using KQueue. [Paul Querna] diff --git a/include/apr_lib.h b/include/apr_lib.h index 18d83da092c..bf34457e270 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -168,6 +168,8 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), * @param prompt The prompt to display * @param pwbuf Buffer to store the password * @param bufsize The length of the password buffer. + * @remark If the password entered must be truncated to fit in + * the provided buffer, APR_ENAMETOOLONG will be returned. */ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, apr_size_t *bufsize); diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 0da9ca426d3..f3089613960 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -219,12 +219,14 @@ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, apr_ #else char *pw_got = getpass(prompt); #endif + apr_status_t rv = APR_SUCCESS; + if (!pw_got) return APR_EINVAL; - apr_cpystrn(pwbuf, pw_got, *bufsiz); - memset(pw_got, 0, strlen(pw_got)); if (strlen(pw_got) >= *bufsiz) { - return APR_ENAMETOOLONG; + rv = APR_ENAMETOOLONG; } - return APR_SUCCESS; + apr_cpystrn(pwbuf, pw_got, *bufsiz); + memset(pw_got, 0, strlen(pw_got)); + return rv; } From b62b612378ea5b57ae5f6de3f70d0710b958a4cc Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 1 Dec 2004 11:25:36 +0000 Subject: [PATCH 5236/7878] * include/apr.h.in: Define __STDC_CONSTANT_MACROS for C++ so that stdint.h exposes the {,U}INT64_C macros. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@109326 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/apr.h.in b/include/apr.h.in index 1a52a0eff3e..47a8495da9b 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -116,6 +116,12 @@ #include #endif +#if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS) +/* C99 7.18.4 requires that stdint.h only exposes INT64_C + * and UINT64_C for C++ implementations if this is defined: */ +#define __STDC_CONSTANT_MACROS +#endif + #if APR_HAVE_STDINT_H #include #endif From 40e6e1e4fea6601b40dbb2a8eb2ea43b7a30f6e2 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 1 Dec 2004 11:58:27 +0000 Subject: [PATCH 5237/7878] * include/apr_network_io.h (apr_socket_sendfile): Document that the offset parameter is pass-by-reference for no reason. * include/apr_lib.h (apr_password_get): Likewise for the bufsize parameter. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@109329 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 3 +++ include/apr_network_io.h | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index bf34457e270..cb1dcedf5a6 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -170,6 +170,9 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), * @param bufsize The length of the password buffer. * @remark If the password entered must be truncated to fit in * the provided buffer, APR_ENAMETOOLONG will be returned. + * Note that the bufsize paramater is passed by reference for no + * reason; its value will never be modified by the apr_password_get() + * function. */ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, apr_size_t *bufsize); diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 0157a46b6e4..3e147522970 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -530,7 +530,9 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, * @remark This functions acts like a blocking write by default. To change * this behavior, use apr_socket_timeout_set() or the * APR_SO_NONBLOCK socket option. - * The number of bytes actually sent is stored in argument 5. + * The number of bytes actually sent is stored in the len parameter. + * The offset parameter is passed by reference for no reason; its + * value will never be modified by the apr_socket_sendfile() function. */ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, From dd410d288d07a3e03a3ac17ec2ce37b52c9c9cea Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 2 Dec 2004 21:55:19 +0000 Subject: [PATCH 5238/7878] Allow APR-UTIL to exist and build outside of the httpd/srclib file structure git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@109561 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 12 ++++++------ build/NWGNUenvironment.inc | 2 +- build/NWGNUmakefile | 8 ++++---- test/NWGNUmakefile | 4 ++-- test/nwgnuaprtest | 4 ++-- test/nwgnuglobalmutexchild | 4 ++-- test/nwgnumod_test | 4 ++-- test/nwgnuproc_child | 4 ++-- test/nwgnureadchild | 4 ++-- test/nwgnusockchild | 4 ++-- test/nwgnutestatmc | 4 ++-- test/nwgnutryread | 4 ++-- 12 files changed, 29 insertions(+), 29 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 61df7815805..eed1d5d5bb5 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -4,7 +4,7 @@ SUBDIRS = \ build \ - ..\apr-util \ + $(APU_WORK) \ $(EOLIST) # @@ -26,11 +26,11 @@ include $(APR_WORK)\build\NWGNUhead.inc # INCDIRS # XINCDIRS += \ - $(APR_WORK)/include \ - $(APR_WORK)/include/arch/NetWare \ - $(APR_WORK)/include/arch/unix \ - $(APR_WORK)/memory/unix \ - $(APR_WORK)/random/unix \ + $(APR)/include \ + $(APR)/include/arch/NetWare \ + $(APR)/include/arch/unix \ + $(APR)/memory/unix \ + $(APR)/random/unix \ $(APRUTIL)/xml \ $(EOLIST) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index b3aff53b1c2..c6b860afbbe 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -264,7 +264,7 @@ endif APR = $(APR_WORK) APRTEST = $(APR_WORK)/test -APRUTIL = $(APR_WORK)/../apr-util +APRUTIL = $(APU_WORK) XML = $(APRUTIL)/xml # diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index eb9d4c6aedf..6a003ab657f 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -43,10 +43,10 @@ $(NLM_NAME)_cc.opt : NWGNUmakefile $(APR_WORK)\build\NWGNUenvironment.inc $(APR_ @echo -nosyspath >> $@ @echo -w nocmdline >> $@ @echo -DNETWARE >> $@ - @echo -I..\include >> $@ - @echo -I..\include\arch\netware >> $@ - @echo -I..\include\arch\unix >> $@ - @echo -I..\..\apr-util\include >> $@ + @echo -I$(APR)\include >> $@ + @echo -I$(APR)\include\arch\netware >> $@ + @echo -I$(APR)\include\arch\unix >> $@ + @echo -I$(APRUTIL)\include >> $@ @echo -ir $(NOVELLLIBC) >> $@ ifneq "$(LDAPSDK)" "" @echo -ir $(LDAPSDK) >> $@ diff --git a/test/NWGNUmakefile b/test/NWGNUmakefile index 869a7618ea6..c5bf24c1111 100644 --- a/test/NWGNUmakefile +++ b/test/NWGNUmakefile @@ -25,8 +25,8 @@ include $(APR_WORK)\build\NWGNUhead.inc # INCDIRS # XINCDIRS += \ - $(APR_WORK)/include \ - $(APR_WORK)/include/arch/NetWare \ + $(APR)/include \ + $(APR)/include/arch/NetWare \ $(EOLIST) # diff --git a/test/nwgnuaprtest b/test/nwgnuaprtest index 11f7e3af668..22b24b08494 100644 --- a/test/nwgnuaprtest +++ b/test/nwgnuaprtest @@ -16,8 +16,8 @@ endif # INCDIRS # XINCDIRS += \ - $(APR_WORK)/include \ - $(APR_WORK)/include/arch/NetWare \ + $(APR)/include \ + $(APR)/include/arch/NetWare \ $(EOLIST) # diff --git a/test/nwgnuglobalmutexchild b/test/nwgnuglobalmutexchild index 8979d27a9ba..3d683bab503 100644 --- a/test/nwgnuglobalmutexchild +++ b/test/nwgnuglobalmutexchild @@ -16,8 +16,8 @@ endif # INCDIRS # XINCDIRS += \ - $(APR_WORK)/include \ - $(APR_WORK)/include/arch/NetWare \ + $(APR)/include \ + $(APR)/include/arch/NetWare \ $(EOLIST) # diff --git a/test/nwgnumod_test b/test/nwgnumod_test index 1510ccb5252..3dfa6df4514 100644 --- a/test/nwgnumod_test +++ b/test/nwgnumod_test @@ -16,8 +16,8 @@ endif # INCDIRS # XINCDIRS += \ - $(APR_WORK)/include \ - $(APR_WORK)/include/arch/NetWare \ + $(APR)/include \ + $(APR)/include/arch/NetWare \ $(EOLIST) # diff --git a/test/nwgnuproc_child b/test/nwgnuproc_child index 51cffff21ce..49c1fab6fac 100644 --- a/test/nwgnuproc_child +++ b/test/nwgnuproc_child @@ -16,8 +16,8 @@ endif # INCDIRS # XINCDIRS += \ - $(APR_WORK)/include \ - $(APR_WORK)/include/arch/NetWare \ + $(APR)/include \ + $(APR)/include/arch/NetWare \ $(EOLIST) # diff --git a/test/nwgnureadchild b/test/nwgnureadchild index e539b789b28..0fd984da1c1 100644 --- a/test/nwgnureadchild +++ b/test/nwgnureadchild @@ -16,8 +16,8 @@ endif # INCDIRS # XINCDIRS += \ - $(APR_WORK)/include \ - $(APR_WORK)/include/arch/NetWare \ + $(APR)/include \ + $(APR)/include/arch/NetWare \ $(EOLIST) # diff --git a/test/nwgnusockchild b/test/nwgnusockchild index f49cfc5e572..16dac9e4220 100644 --- a/test/nwgnusockchild +++ b/test/nwgnusockchild @@ -16,8 +16,8 @@ endif # INCDIRS # XINCDIRS += \ - $(APR_WORK)/include \ - $(APR_WORK)/include/arch/NetWare \ + $(APR)/include \ + $(APR)/include/arch/NetWare \ $(EOLIST) # diff --git a/test/nwgnutestatmc b/test/nwgnutestatmc index afe1aaf2116..dbbe4250bd4 100644 --- a/test/nwgnutestatmc +++ b/test/nwgnutestatmc @@ -16,8 +16,8 @@ endif # INCDIRS # XINCDIRS += \ - $(APR_WORK)/include \ - $(APR_WORK)/include/arch/NetWare \ + $(APR)/include \ + $(APR)/include/arch/NetWare \ $(EOLIST) # diff --git a/test/nwgnutryread b/test/nwgnutryread index 40ceb595bf8..cc4aee0203b 100644 --- a/test/nwgnutryread +++ b/test/nwgnutryread @@ -16,8 +16,8 @@ endif # INCDIRS # XINCDIRS += \ - $(APR_WORK)/include \ - $(APR_WORK)/include/arch/NetWare \ + $(APR)/include \ + $(APR)/include/arch/NetWare \ $(EOLIST) # From be82db06e37c714925b4afe719a900ff17c97f09 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 3 Dec 2004 03:57:32 +0000 Subject: [PATCH 5239/7878] * build/jlibtool.c: Get jlibtool to work on Solaris; work on uninstalled libraries when -no-install is passed; try, albeit unsuccessfully, to get Darwin to link against an uninstalled libary - however, leave the remains there so that if I ever figure out a way to do that in the future, the ground work is there... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@109623 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 191 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 169 insertions(+), 22 deletions(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index 11139ac5185..cb1278b64bd 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -60,12 +60,13 @@ /* man libtool(1) documents ranlib option of -c. */ # define RANLIB "ranlib" # define PIC_FLAG "-fPIC -fno-common" -# define RPATH "-rpath" # define SHARED_OPTS "-dynamiclib" # define MODULE_OPTS "-bundle" # define DYNAMIC_LINK_OPTS "-flat_namespace -undefined suppress" # define dynamic_link_version_func darwin_dynamic_link_function # define DYNAMIC_INSTALL_NAME "-install_name" +# define DYNAMIC_LINK_NO_INSTALL "-dylib_file" +# define HAS_REALPATH /*-install_name /Users/jerenk/apache-2.0-cvs/lib/libapr.0.dylib -compatibility_version 1 -current_version 1.0 */ # define LD_LIBRARY_PATH "DYLD_LIBRARY_PATH" #endif @@ -90,6 +91,27 @@ # define LD_LIBRARY_PATH "LD_LIBRARY_PATH" #endif +#if defined(sun) +# define SHELL_CMD "/bin/sh" +# define DYNAMIC_LIB_EXT "so" +# define MODULE_LIB_EXT "so" +# define STATIC_LIB_EXT "a" +# define OBJECT_EXT "o" +# define LIBRARIAN "ar" +# define LIBRARIAN_OPTS "cr" +# define RANLIB "ranlib" +# define PIC_FLAG "-KPIC" +# define RPATH "-R" +# define SHARED_OPTS "-G" +# define MODULE_OPTS "-G" +# define DYNAMIC_LINK_OPTS "" +# define LINKER_FLAG_NO_EQUALS +# define ADD_MINUS_L +# define HAS_REALPATH +# define LD_RUN_PATH "LD_RUN_PATH" +# define LD_LIBRARY_PATH "LD_LIBRARY_PATH" +#endif + #if defined(_OSD_POSIX) # define SHELL_CMD "/usr/bin/sh" # define DYNAMIC_LIB_EXT "so" @@ -196,6 +218,7 @@ typedef struct { int dry_run; enum pic_mode_e pic_mode; int export_dynamic; + int no_install; } options_t; typedef struct { @@ -523,6 +546,10 @@ int parse_short_opt(char *arg, command_t *cmd_data) } if (cmd_data->mode == mLink) { + if (strcmp(arg, "no-install") == 0) { + cmd_data->options.no_install = 1; + return 1; + } if (arg[0] == 'L' || arg[0] == 'l') { /* Hack... */ arg--; @@ -786,30 +813,67 @@ char *check_library_exists(command_t *cmd, const char *arg, int pathlen, return NULL; } -/* Read the final install location and add it to runtime library search path. */ -#ifdef RPATH -void add_rpath(count_chars *cc, const char *arg) +char * load_install_path(const char *arg) { FILE *f; - char path[256]; - char *tmp; - int size=0; + char *path; + + path = malloc(PATH_MAX); f = fopen(arg,"r"); if (f == NULL) { - return; + return NULL; } - fgets(path,sizeof(path), f); + fgets(path, PATH_MAX, f); fclose(f); if (path[strlen(path)-1] == '\n') { path[strlen(path)-1] = '\0'; } - /* Check that we have an absolut path. + /* Check that we have an absolute path. * Otherwise the file could be a GNU libtool file. */ if (path[0] != '/') { - return; + return NULL; + } + return path; +} + +char * load_noinstall_path(const char *arg, int pathlen) +{ + char *newarg, *expanded_path; + int newpathlen; + + newarg = (char *)malloc(strlen(arg) + 10); + strcpy(newarg, arg); + newarg[pathlen] = 0; + + newpathlen = pathlen; + strcat(newarg, ".libs"); + newpathlen += sizeof(".libs") - 1; + newarg[newpathlen] = 0; + +#ifdef HAS_REALPATH + expanded_path = malloc(PATH_MAX); + expanded_path = realpath(newarg, expanded_path); + /* Uh, oh. There was an error. Fall back on our first guess. */ + if (!expanded_path) { + expanded_path = newarg; } +#else + /* We might get ../ or something goofy. Oh, well. */ + expanded_path = newarg; +#endif + + return expanded_path; +} + +/* Read the final install location and add it to runtime library search path. */ +#ifdef RPATH +void add_rpath(count_chars *cc, const char *path) +{ + int size = 0; + char *tmp; + #ifdef LINKER_FLAG_PREFIX size = strlen(LINKER_FLAG_PREFIX); #endif @@ -819,18 +883,87 @@ void add_rpath(count_chars *cc, const char *arg) return; } #ifdef LINKER_FLAG_PREFIX - strcpy(tmp, LINKER_FLAG_PREFIX); + strcpy(tmp, LINKER_FLAG_PREFIX); strcat(tmp, RPATH); #else strcpy(tmp, RPATH); #endif +#ifndef LINKER_FLAG_NO_EQUALS strcat(tmp, "="); +#endif strcat(tmp, path); - + push_count_chars(cc, tmp); } + +void add_rpath_file(count_chars *cc, const char *arg) +{ + const char *path; + + path = load_install_path(arg); + if (path) { + add_rpath(cc, path); + } +} + +void add_rpath_noinstall(count_chars *cc, const char *arg, int pathlen) +{ + const char *path; + + path = load_noinstall_path(arg, pathlen); + if (path) { + add_rpath(cc, path); + } +} #endif +void add_dylink_noinstall(count_chars *cc, const char *arg, int pathlen, + int extlen) +{ + const char *install_path, *current_path, *name; + char *exp_argument; + int i_p_len, c_p_len, name_len, dyext_len, cur_len; + + install_path = load_install_path(arg); + current_path = load_noinstall_path(arg, pathlen); + + if (!install_path || !current_path) { + return; + } + + push_count_chars(cc, DYNAMIC_LINK_NO_INSTALL); + + i_p_len = strlen(install_path); + c_p_len = strlen(current_path); + + name = arg+pathlen; + name_len = extlen-pathlen; + dyext_len = sizeof(DYNAMIC_LIB_EXT) - 1; + + /* No, we need to replace the extension. */ + exp_argument = (char *)malloc(i_p_len + c_p_len + (name_len*2) + + (dyext_len*2) + 2); + + cur_len = 0; + strcpy(exp_argument, install_path); + cur_len += i_p_len; + exp_argument[cur_len++] = '/'; + strncpy(exp_argument+cur_len, name, extlen-pathlen); + cur_len += name_len; + strcpy(exp_argument+cur_len, DYNAMIC_LIB_EXT); + cur_len += dyext_len; + exp_argument[cur_len++] = ':'; + strcpy(exp_argument+cur_len, current_path); + cur_len += c_p_len; + exp_argument[cur_len++] = '/'; + strncpy(exp_argument+cur_len, name, extlen-pathlen); + cur_len += name_len; + strcpy(exp_argument+cur_len, DYNAMIC_LIB_EXT); + cur_len += dyext_len; + + push_count_chars(cc, exp_argument); +} + /* use -L -llibname to allow to use installed libraries */ void add_minus_l(count_chars *cc, const char *arg) { @@ -935,11 +1068,30 @@ int parse_input_file_name(char *arg, command_t *cmd_data) #else push_count_chars(cmd_data->shared_opts.dependencies, newarg); #endif -#ifdef RPATH if (libtype == type_DYNAMIC_LIB) { - add_rpath(cmd_data->shared_opts.dependencies, arg); - } + if (cmd_data->options.no_install) { +#ifdef RPATH + add_rpath_noinstall(cmd_data->shared_opts.dependencies, + arg, pathlen); +#endif +#ifdef DYNAMIC_LINK_NO_INSTALL + /* + * This doesn't work as Darwin's linker has no way to + * override at link-time the search paths for a + * non-installed library. + */ + /* + add_dylink_noinstall(cmd_data->shared_opts.dependencies, + arg, pathlen, ext - arg); + */ +#endif + } + else { +#ifdef RPATH + add_rpath_file(cmd_data->shared_opts.dependencies, arg); #endif + } + } break; case mInstall: /* If we've already recorded a library to install, we're most @@ -1583,7 +1735,7 @@ int ensure_fake_uptodate(command_t *cmd_data) touch_args[2] = NULL; return external_spawn(cmd_data, "touch", touch_args); } -#ifdef RPATH + /* Store the install path in the *.la file */ int add_for_runtime(command_t *cmd_data) { @@ -1603,7 +1755,6 @@ int add_for_runtime(command_t *cmd_data) return(ensure_fake_uptodate(cmd_data)); } } -#endif int main(int argc, char *argv[]) { @@ -1646,11 +1797,7 @@ int main(int argc, char *argv[]) rc = run_mode(&cmd_data); if (!rc) { -#ifdef RPATH add_for_runtime(&cmd_data); -#else - ensure_fake_uptodate(&cmd_data); -#endif } cleanup_tmp_dirs(&cmd_data); From 8dcd6253a59ee09e4380bf99d4f98dfd2d4603a5 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Fri, 3 Dec 2004 04:13:42 +0000 Subject: [PATCH 5240/7878] * build/jlibtool.c: Add ifdef wrapper to fix build on Linux git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@109626 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/jlibtool.c b/build/jlibtool.c index cb1278b64bd..d24b8d44eb1 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -917,6 +917,7 @@ void add_rpath_noinstall(count_chars *cc, const char *arg, int pathlen) } #endif +#ifdef DYNAMIC_LINK_NO_INSTALL void add_dylink_noinstall(count_chars *cc, const char *arg, int pathlen, int extlen) { @@ -963,6 +964,7 @@ void add_dylink_noinstall(count_chars *cc, const char *arg, int pathlen, push_count_chars(cc, exp_argument); } +#endif /* use -L -llibname to allow to use installed libraries */ void add_minus_l(count_chars *cc, const char *arg) From ccbdc1d880b823571df2dd4e0632beb6f9a09843 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 4 Dec 2004 23:40:37 +0000 Subject: [PATCH 5241/7878] * test/testfile.c: Add a test for apr_file_writev(). * file_io/unix/readwrite.c: Try to write all iovecs out on platforms without writev. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@109832 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ file_io/unix/readwrite.c | 13 ++++++++++-- test/Makefile.in | 2 +- test/testfile.c | 43 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index df451fd855c..169d948100d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes for APR 1.1.0 + *) apr_file_writev will now at least try to write all iovecs on platforms + that do not support writev. + [Paul Querna] + *) Remove the runtime test for Sendfile versions on FreeBSD. PR 25718. [Mike Silbersack , Paul Querna] diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 4f35dbed512..edd692e4bde 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -241,8 +241,17 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove return APR_SUCCESS; } #else - *nbytes = vec[0].iov_len; - return apr_file_write(thefile, vec[0].iov_base, nbytes); + int i, tbytes; + apr_status_t rv = APR_SUCCESS; + + for(i = 0; i < nvec; i++){ + tbytes = vec[i].iov_len; + rv = apr_file_write(thefile, vec[i].iov_base, &tbytes); + *nbytes += tbytes; + if(rv != APR_SUCCESS) + break; + } + return rv; #endif } diff --git a/test/Makefile.in b/test/Makefile.in index 10d2c1dbc43..df5f5acf2c8 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -31,7 +31,7 @@ LOCAL_LIBS=../lib@APR_LIBNAME@.la CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \ readchild@EXEEXT@ tryread@EXEEXT@ sockchild@EXEEXT@ \ globalmutexchild@EXEEXT@ lfstests/large.bin \ - data/testputs.txt data/testbigfprintf.dat + data/testputs.txt data/testbigfprintf.dat data/testwritev.txt CLEAN_SUBDIRS = internal INCDIR=../include diff --git a/test/testfile.c b/test/testfile.c index cce9efebed5..d263416c133 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -553,6 +553,48 @@ static void test_puts(abts_case *tc, void *data) file_contents_equal(tc, fname, LINE1 LINE2, strlen(LINE1 LINE2)); } +static void test_writev(abts_case *tc, void *data) +{ + apr_file_t *f; + int nbytes; + struct iovec vec[5]; + const char *fname = "data/testwritev.txt"; + + APR_ASSERT_SUCCESS(tc, "open file for writing", + apr_file_open(&f, fname, + APR_WRITE|APR_CREATE|APR_TRUNCATE, + APR_OS_DEFAULT, p)); + + vec[0].iov_base = LINE1; + vec[0].iov_len = strlen(LINE1); + + APR_ASSERT_SUCCESS(tc, "writev of size 1 to file", + apr_file_writev(f, vec, 1, &nbytes)); + + file_contents_equal(tc, fname, LINE1, strlen(LINE1)); + + vec[0].iov_base = LINE1; + vec[0].iov_len = strlen(LINE1); + vec[1].iov_base = LINE2; + vec[1].iov_len = strlen(LINE2); + vec[2].iov_base = LINE1; + vec[2].iov_len = strlen(LINE1); + vec[3].iov_base = LINE1; + vec[3].iov_len = strlen(LINE1); + vec[4].iov_base = LINE2; + vec[4].iov_len = strlen(LINE2); + + APR_ASSERT_SUCCESS(tc, "writev of size 5 to file", + apr_file_writev(f, vec, 5, &nbytes)); + + APR_ASSERT_SUCCESS(tc, "close for writing", + apr_file_close(f)); + + file_contents_equal(tc, fname, LINE1 LINE1 LINE2 LINE1 LINE1 LINE2, + strlen(LINE1)*4 + strlen(LINE2)*2); + +} + static void test_truncate(abts_case *tc, void *data) { apr_status_t rv; @@ -648,6 +690,7 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_ungetc, NULL); abts_run_test(suite, test_gets, NULL); abts_run_test(suite, test_puts, NULL); + abts_run_test(suite, test_writev, NULL); abts_run_test(suite, test_bigread, NULL); abts_run_test(suite, test_mod_neg, NULL); abts_run_test(suite, test_truncate, NULL); From d42907b8eadce2c29619c152abde2221b3f08168 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 5 Dec 2004 02:17:30 +0000 Subject: [PATCH 5242/7878] * file_io/unix/fullrw.c: Add apr_file_writev_full to ensure an iovec is completely written to the file. * include/apr_file_io.h: Define APR_MAX_IOVEC_SIZE Add public def for apr_file_writev_full. * file_io/unix/readwrite.c: For systems without writev, ensure that they get the correct number of bytes written. * test/*: Add a new test for apr_file_writev_full. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@109843 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/unix/fullrw.c | 34 ++++++++++++++++++++++++++++++++++ file_io/unix/readwrite.c | 2 ++ include/apr_file_io.h | 34 ++++++++++++++++++++++++++++++++++ test/Makefile.in | 3 ++- test/testfile.c | 37 +++++++++++++++++++++++++++++++++++++ 6 files changed, 112 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 169d948100d..51e3108428b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.1.0 + *) Add apr_file_writev_full to ensure an entire iovec is writen to a file. + [Paul Querna] + *) apr_file_writev will now at least try to write all iovecs on platforms that do not support writev. [Paul Querna] diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index af7b70e3815..5412f21aff2 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -60,3 +60,37 @@ APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, return status; } + +APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile, + const struct iovec *vec, + apr_size_t nvec, + apr_size_t *bytes_written) +{ + apr_status_t status; + apr_size_t total = 0; + + do { + int i; + apr_size_t amt; + status = apr_file_writev(thefile, vec, nvec, &amt); + + /* We assume that writev will only write complete iovec areas. + * Incomplete writes inside a single area are not supported. + * This should be safe according to SuS v2. + */ + for(i = 0; i < nvec; i++) { + total += vec[i].iov_len; + if(total >= amt) { + vec = &vec[i+1]; + nvec -= i+1; + break; + } + } + } while (status == APR_SUCCESS && nvec > 0); + + if (bytes_written != NULL) + *bytes_written = total; + + return status; +} + diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index edd692e4bde..069adfa96db 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -244,6 +244,8 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove int i, tbytes; apr_status_t rv = APR_SUCCESS; + *nbytes = 0; + for(i = 0; i < nvec; i++){ tbytes = vec[i].iov_len; rv = apr_file_write(thefile, vec[i].iov_base, &tbytes); diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 44912434c9b..9a7b466c8c8 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -130,6 +130,22 @@ extern "C" { #define APR_FILE_ATTR_HIDDEN 0x04 /**< File is hidden */ /** @} */ +/** + * @defgroup apr_file_writev{_full} max iovec size + * @{ + */ +#if defined(DOXYGEN) +#define APR_MAX_IOVEC_SIZE 1024 /**< System dependent maximum + size of an iovec array */ +#elif defined(IOV_MAX) +#define APR_MAX_IOVEC_SIZE IOV_MAX +#elif defined(MAX_IOVEC) +#define APR_MAX_IOVEC_SIZE MAX_IOVEC +#else +#define APR_MAX_IOVEC_SIZE 1024 +#endif +/** @} */ + /** File attributes */ typedef apr_uint32_t apr_fileattrs_t; @@ -413,6 +429,24 @@ APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, apr_size_t nbytes, apr_size_t *bytes_written); + +/** + * Write data from iovec array to the specified file, ensuring that all of the + * data is written before returning. + * @param thefile The file descriptor to write to. + * @param vec The array from which to get the data to write to the file. + * @param nvec The number of elements in the struct iovec array. This must + * be smaller than APR_MAX_IOVEC_SIZE. If it isn't, the function + * will fail with APR_EINVAL. + * @param nbytes The number of bytes written. + * + * @remark apr_file_writev_full is available even if the underlying + * operating system doesn't provide writev(). + */ +APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile, + const struct iovec *vec, + apr_size_t nvec, + apr_size_t *nbytes); /** * Write a character into the specified file. * @param ch The character to write. diff --git a/test/Makefile.in b/test/Makefile.in index df5f5acf2c8..ca2910074bf 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -31,7 +31,8 @@ LOCAL_LIBS=../lib@APR_LIBNAME@.la CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \ readchild@EXEEXT@ tryread@EXEEXT@ sockchild@EXEEXT@ \ globalmutexchild@EXEEXT@ lfstests/large.bin \ - data/testputs.txt data/testbigfprintf.dat data/testwritev.txt + data/testputs.txt data/testbigfprintf.dat data/testwritev.txt \ + testwritev_full.txt CLEAN_SUBDIRS = internal INCDIR=../include diff --git a/test/testfile.c b/test/testfile.c index d263416c133..55907b77a07 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -595,6 +595,42 @@ static void test_writev(abts_case *tc, void *data) } +static void test_writev_full(abts_case *tc, void *data) +{ + apr_file_t *f; + int nbytes; + struct iovec vec[5]; + const char *fname = "data/testwritev_full.txt"; + + APR_ASSERT_SUCCESS(tc, "open file for writing", + apr_file_open(&f, fname, + APR_WRITE|APR_CREATE|APR_TRUNCATE, + APR_OS_DEFAULT, p)); + + vec[0].iov_base = LINE1; + vec[0].iov_len = strlen(LINE1); + vec[1].iov_base = LINE2; + vec[1].iov_len = strlen(LINE2); + vec[2].iov_base = LINE1; + vec[2].iov_len = strlen(LINE1); + vec[3].iov_base = LINE1; + vec[3].iov_len = strlen(LINE1); + vec[4].iov_base = LINE2; + vec[4].iov_len = strlen(LINE2); + + APR_ASSERT_SUCCESS(tc, "writev_full of size 5 to file", + apr_file_writev_full(f, vec, 5, &nbytes)); + + ABTS_INT_EQUAL(tc, strlen(LINE1)*3 + strlen(LINE2)*2, nbytes); + + APR_ASSERT_SUCCESS(tc, "close for writing", + apr_file_close(f)); + + file_contents_equal(tc, fname, LINE1 LINE2 LINE1 LINE1 LINE2, + strlen(LINE1)*3 + strlen(LINE2)*2); + +} + static void test_truncate(abts_case *tc, void *data) { apr_status_t rv; @@ -691,6 +727,7 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_gets, NULL); abts_run_test(suite, test_puts, NULL); abts_run_test(suite, test_writev, NULL); + abts_run_test(suite, test_writev_full, NULL); abts_run_test(suite, test_bigread, NULL); abts_run_test(suite, test_mod_neg, NULL); abts_run_test(suite, test_truncate, NULL); From f8470bd2bff2c16976d01983afcc77dfae0a8a01 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 5 Dec 2004 06:57:08 +0000 Subject: [PATCH 5243/7878] * file_io/unix/readwrite.c: use apr_file_write_full() to write all of the data to a file. On an exceptional error (See apr_file_write_full), we will add the bytes that did get written, and then exit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@109865 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 069adfa96db..a809dd6fe22 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -241,14 +241,14 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove return APR_SUCCESS; } #else - int i, tbytes; + int i; + int tbytes; apr_status_t rv = APR_SUCCESS; *nbytes = 0; - for(i = 0; i < nvec; i++){ - tbytes = vec[i].iov_len; - rv = apr_file_write(thefile, vec[i].iov_base, &tbytes); + for(i = 0; i < nvec; i++) { + rv = apr_file_write_full(thefile, vec[i].iov_base, vec[i].iov_len, &tbytes); *nbytes += tbytes; if(rv != APR_SUCCESS) break; From bda789b3018edc8ad1e660992b68023d96069cc2 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 5 Dec 2004 17:31:39 +0000 Subject: [PATCH 5244/7878] * file_io/unix/readwrite.c: Revert back to using apr_file_write, but also leave the function if tbytes < vec[i].iov_len, as Jeff Trawick suggested on dev@apr. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@109892 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index a809dd6fe22..3b7d753764e 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -248,10 +248,12 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove *nbytes = 0; for(i = 0; i < nvec; i++) { - rv = apr_file_write_full(thefile, vec[i].iov_base, vec[i].iov_len, &tbytes); + tbytes = vec[i].iov_len; + rv = apr_file_write(thefile, vec[i].iov_base, &tbytes); *nbytes += tbytes; - if(rv != APR_SUCCESS) + if(rv != APR_SUCCESS || tbytes < vec[i].iov_len) { break; + } } return rv; #endif From 99b1353e0cb6d5f1d0c0f893b002ca25ef75bc03 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Sun, 5 Dec 2004 21:12:26 +0000 Subject: [PATCH 5245/7878] Remove some unused files that appear to have been ressurected by the CVS->SVN conversion. This was already done for the os2 version of the file in revision 65576, so we might as well do it for win32 and beos. * threadproc/win32/threadcancel.c: deleted. * threadproc/beos/threadcancel.c: deleted. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@109911 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/threadcancel.c | 88 --------------------------------- threadproc/win32/threadcancel.c | 86 -------------------------------- 2 files changed, 174 deletions(-) delete mode 100644 threadproc/beos/threadcancel.c delete mode 100644 threadproc/win32/threadcancel.c diff --git a/threadproc/beos/threadcancel.c b/threadproc/beos/threadcancel.c deleted file mode 100644 index 94a7e9407c4..00000000000 --- a/threadproc/beos/threadcancel.c +++ /dev/null @@ -1,88 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "threadproc.h" - - -ap_status_t ap_cancel_thread(ap_thread_t *thd) -{ - if (kill_thread(thd->td) == 0) { - return APR_SUCCESS; - } - else { - return errno; - } -} - - -ap_status_t ap_setcanceltype(ap_int32_t type, ap_pool_t *cont) -{ -/* if (pthread_setcanceltype(type, NULL) == 0) {*/ - return APR_SUCCESS; -/* } - else { - return APR_FAILURE; - }*/ -} - -ap_status_t ap_setcancelstate(ap_int32_t type, ap_pool_t *cont) -{ -/* if (pthread_setcanceltype(type, NULL) == 0) {*/ - return APR_SUCCESS; -/* } - else { - return APR_FAILURE; - }*/ -} - diff --git a/threadproc/win32/threadcancel.c b/threadproc/win32/threadcancel.c deleted file mode 100644 index 3a509202b6e..00000000000 --- a/threadproc/win32/threadcancel.c +++ /dev/null @@ -1,86 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "threadproc.h" -#include "apr_thread_proc.h" -#include "apr_general.h" - - -ap_status_t ap_cancel_thread(ap_thread_t *thd) -{ - if (TerminateThread(thd->td, APR_SUCCESS) == 0) { - return APR_EEXIST; - } - else { - return APR_SUCCESS; - } -} - -/* Not sure of the best way to do this just yet. -ap_status_t ap_setcanceltype(ap_int32_t type, ap_pool_t *cont) -{ - -} - -ap_status_t ap_setcancelstate(ap_int32_t type, ap_pool_t *cont) -{ - ap_status_t stat; - if ((stat = pthread_setcanceltype(type, NULL)) == 0) { - return APR_SUCCESS; - } - else { - return stat; - } -} -*/ From b5027c04dd76e26f0be78410d680fe771d034e5b Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 5 Dec 2004 21:15:12 +0000 Subject: [PATCH 5246/7878] Fix style nits. No fucntional changes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@109912 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fullrw.c | 4 ++-- file_io/unix/readwrite.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index 5412f21aff2..8596d254dcb 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -78,9 +78,9 @@ APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile, * Incomplete writes inside a single area are not supported. * This should be safe according to SuS v2. */ - for(i = 0; i < nvec; i++) { + for (i = 0; i < nvec; i++) { total += vec[i].iov_len; - if(total >= amt) { + if (total >= amt) { vec = &vec[i+1]; nvec -= i+1; break; diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 3b7d753764e..8f0562b0269 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -247,11 +247,11 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove *nbytes = 0; - for(i = 0; i < nvec; i++) { + for (i = 0; i < nvec; i++) { tbytes = vec[i].iov_len; rv = apr_file_write(thefile, vec[i].iov_base, &tbytes); *nbytes += tbytes; - if(rv != APR_SUCCESS || tbytes < vec[i].iov_len) { + if (rv != APR_SUCCESS || tbytes < vec[i].iov_len) { break; } } From 18d10242d94306215aff3e7f0c10759125788693 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Sun, 5 Dec 2004 21:34:37 +0000 Subject: [PATCH 5247/7878] * LICENSE: remove the CuTest license, we haven't been distributing it in APR for quite some time anyway, and we just stopped distributing it in APR-Util. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@109914 13f79535-47bb-0310-9956-ffa450edef68 --- LICENSE | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/LICENSE b/LICENSE index a14c66e6459..6f0142f292d 100644 --- a/LICENSE +++ b/LICENSE @@ -295,31 +295,3 @@ From strings/apr_strnatcmp.c, include/apr_strings.h: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. - -From test/CuTest.c, test/CuTest.h: - - * Copyright (c) 2002-2006 Asim Jalis - * - * This library is released under the zlib/libpng license as described at - * - * http://www.opensource.org/licenses/zlib-license.html - * - * Here is the statement of the license: - * - * This software is provided 'as-is', without any express or implied warranty. - * In no event will the authors be held liable for any damages arising from - * the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software in a - * product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source distribution. From c376c2e67fbc498a6b311db2fa54fad7954d26d4 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Mon, 6 Dec 2004 02:55:31 +0000 Subject: [PATCH 5248/7878] Fix some style problems in the poll code, no functional changes. * include/arch/unix/apr_arch_poll_private.h (pollset_lock_rings, pollset_unlock_rings): add a space after the if. * poll/unix/port.c (apr_pollset_remove): add a space after an if. (apr_pollset_poll): wrap a long line, add a space after an if, remove some extraneous parentheses that caused a long line to go past 80 columns. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@109938 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_poll_private.h | 4 ++-- poll/unix/port.c | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index c720bb2f1c8..f77585f7df1 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -77,10 +77,10 @@ #if APR_HAS_THREADS #include "apr_thread_mutex.h" #define pollset_lock_rings() \ - if(pollset->flags & APR_POLLSET_THREADSAFE) \ + if (pollset->flags & APR_POLLSET_THREADSAFE) \ apr_thread_mutex_lock(pollset->ring_lock); #define pollset_unlock_rings() \ - if(pollset->flags & APR_POLLSET_THREADSAFE) \ + if (pollset->flags & APR_POLLSET_THREADSAFE) \ apr_thread_mutex_unlock(pollset->ring_lock); #else #define pollset_lock_rings() diff --git a/poll/unix/port.c b/poll/unix/port.c index 4ab6386e6de..056579e2d64 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -203,7 +203,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, res = port_dissociate(pollset->port_fd, PORT_SOURCE_FD, fd); - if(res < 0) { + if (res < 0) { rv = APR_NOTFOUND; } @@ -284,13 +284,14 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset_unlock_rings(); - ret = port_getn(pollset->port_fd, pollset->port_set, pollset->nalloc, &nget, tvptr); + ret = port_getn(pollset->port_fd, pollset->port_set, pollset->nalloc, + &nget, tvptr); (*num) = nget; if (ret == -1) { (*num) = 0; - if(errno == ETIME || errno == EINTR) { + if (errno == ETIME || errno == EINTR) { rv = APR_TIMEUP; } else { @@ -309,7 +310,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, get_revent(pollset->port_set[i].portev_events); APR_RING_INSERT_TAIL(&(pollset->add_ring), - ((pfd_elem_t*)(pollset->port_set[i].portev_user)), + (pfd_elem_t*)pollset->port_set[i].portev_user, pfd_elem_t, link); } From cbe1725a5c090536df7d3ada44768b8bc3e5e2c4 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 6 Dec 2004 11:02:59 +0000 Subject: [PATCH 5249/7878] * test/testfnmatch.c: Update silly constant again for new test file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@109969 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfnmatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testfnmatch.c b/test/testfnmatch.c index f457923f455..d1e1df66851 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -22,7 +22,7 @@ * .txt extension in the data directory at the time testfnmatch * happens to be run (!?!). */ -#define NUM_FILES (3) +#define NUM_FILES (4) static void test_glob(abts_case *tc, void *data) { From 34cfcba36ac9ccaf0784de2e85445fe9d0d7f541 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 8 Dec 2004 15:32:18 +0000 Subject: [PATCH 5250/7878] * test/testfnmatch.c: Really fix the constant. * test/Makefile.in (CLEAN_TARGETS): And really clean up after the test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111278 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- test/testfnmatch.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index ca2910074bf..14b9a37f873 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -32,7 +32,7 @@ CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \ readchild@EXEEXT@ tryread@EXEEXT@ sockchild@EXEEXT@ \ globalmutexchild@EXEEXT@ lfstests/large.bin \ data/testputs.txt data/testbigfprintf.dat data/testwritev.txt \ - testwritev_full.txt + data/testwritev_full.txt CLEAN_SUBDIRS = internal INCDIR=../include diff --git a/test/testfnmatch.c b/test/testfnmatch.c index d1e1df66851..ea71889172c 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -22,7 +22,7 @@ * .txt extension in the data directory at the time testfnmatch * happens to be run (!?!). */ -#define NUM_FILES (4) +#define NUM_FILES (5) static void test_glob(abts_case *tc, void *data) { From 7e32dcbeeae545ec58566a7052df5cf1966b7322 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 9 Dec 2004 04:22:47 +0000 Subject: [PATCH 5251/7878] Emit the run-time link path option in apr-config after installation if the user is linking with libtool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111346 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++++- apr-config.in | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 51e3108428b..462ee215948 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.1.0 + *) Emit the run-time link path option in apr-config after installation + if the user is linking with libtool. [Justin Erenkrantz] + *) Add apr_file_writev_full to ensure an entire iovec is writen to a file. [Paul Querna] @@ -10,7 +13,7 @@ Changes for APR 1.1.0 *) Remove the runtime test for Sendfile versions on FreeBSD. PR 25718. [Mike Silbersack , Paul Querna] - *( rename the fopen defines (APR_READ, APR_WRITE, etc.) to have + *) rename the fopen defines (APR_READ, APR_WRITE, etc.) to have prefix APR_FOPEN_ (keeping the old defines) [Stas] *) [NOT COMMITTED?] Add a new PRNG. Note that the implementation of SHA-256 diff --git a/apr-config.in b/apr-config.in index 870cf888a21..d2bca990c4e 100644 --- a/apr-config.in +++ b/apr-config.in @@ -196,7 +196,9 @@ while test $# -gt 0; do flags="$flags $LA_FILE" elif test "$location" = "installed"; then ### avoid using -L if libdir is a "standard" location like /usr/lib - flags="$flags -L$libdir -l${APR_LIBNAME}" + # Since the user is specifying they are linking with libtool, we + # *know* that -R will be recognized by libtool. + flags="$flags -L$libdir -R$libdir -l${APR_LIBNAME}" else flags="$flags $LA_FILE" fi From 8e8e679ff5c6c0b624d202939dbb7af4d6dfb9f0 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 9 Dec 2004 18:52:58 +0000 Subject: [PATCH 5252/7878] Note patches for a NetWare breakage. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111413 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 462ee215948..b92eba53c1b 100644 --- a/CHANGES +++ b/CHANGES @@ -40,6 +40,12 @@ Changes for APR 1.1.0 PR 28029. [Chris Knight , Garrett Rooney ] +Changes for APR 1.0.2 + + *) [NetWare] Fixed some type mismatches in threadproc/netware/proc.c and + locks/netware/thread_mutex.c that prevented APR from building with the + latest release of the LibC SDK. [Brad Nicholes] + Changes for APR 1.0.1 *) apr_password_get(): Fix the check for buffer overflow. [Jeff Trawick] From 6345d79de0053f43d7c58ef89cde62568c3b25c8 Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Fri, 10 Dec 2004 02:49:00 +0000 Subject: [PATCH 5253/7878] rename the apr_file_permissions defines (APR_UREAD, APR_FPROT_UWRITE, etc.) to have prefix APR_FPROT_ (keeping the old defines) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111457 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_file_info.h | 46 +++++++++++++++++++++++++++-------------- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index b92eba53c1b..b54ec43c0e1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes for APR 1.1.0 + *( rename the apr_file_permissions defines (APR_UREAD, + APR_FPROT_UWRITE, etc.) to have prefix APR_FPROT_ (keeping the + old defines) [Stas] + *) Emit the run-time link path option in apr-config after installation if the user is linking with libtool. [Justin Erenkrantz] diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 7bd31a31293..a06c31225ee 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -75,26 +75,42 @@ typedef enum { * @{ */ -#define APR_USETID 0x8000 /**< Set user id */ -#define APR_UREAD 0x0400 /**< Read by user */ -#define APR_UWRITE 0x0200 /**< Write by user */ -#define APR_UEXECUTE 0x0100 /**< Execute by user */ +#define APR_FPROT_USETID 0x8000 /**< Set user id */ +#define APR_FPROT_UREAD 0x0400 /**< Read by user */ +#define APR_FPROT_UWRITE 0x0200 /**< Write by user */ +#define APR_FPROT_UEXECUTE 0x0100 /**< Execute by user */ -#define APR_GSETID 0x4000 /**< Set group id */ -#define APR_GREAD 0x0040 /**< Read by group */ -#define APR_GWRITE 0x0020 /**< Write by group */ -#define APR_GEXECUTE 0x0010 /**< Execute by group */ +#define APR_FPROT_GSETID 0x4000 /**< Set group id */ +#define APR_FPROT_GREAD 0x0040 /**< Read by group */ +#define APR_FPROT_GWRITE 0x0020 /**< Write by group */ +#define APR_FPROT_GEXECUTE 0x0010 /**< Execute by group */ -#define APR_WSTICKY 0x2000 /**< Sticky bit */ -#define APR_WREAD 0x0004 /**< Read by others */ -#define APR_WWRITE 0x0002 /**< Write by others */ -#define APR_WEXECUTE 0x0001 /**< Execute by others */ +#define APR_FPROT_WSTICKY 0x2000 /**< Sticky bit */ +#define APR_FPROT_WREAD 0x0004 /**< Read by others */ +#define APR_FPROT_WWRITE 0x0002 /**< Write by others */ +#define APR_FPROT_WEXECUTE 0x0001 /**< Execute by others */ -#define APR_OS_DEFAULT 0x0FFF /**< use OS's default permissions */ +#define APR_FPROT_OS_DEFAULT 0x0FFF /**< use OS's default permissions */ /* additional permission flags for apr_file_copy and apr_file_append */ -#define APR_FILE_SOURCE_PERMS 0x1000 /**< Copy source file's permissions */ - +#define APR_FPROT_FILE_SOURCE_PERMS 0x1000 /**< Copy source file's permissions */ + +/* backcompat */ +#define APR_USETID APR_FPROT_USETID /**< @deprecated @see APR_FPROT_USETID */ +#define APR_UREAD APR_FPROT_UREAD /**< @deprecated @see APR_FPROT_UREAD */ +#define APR_UWRITE APR_FPROT_UWRITE /**< @deprecated @see APR_FPROT_UWRITE */ +#define APR_UEXECUTE APR_FPROT_UEXECUTE /**< @deprecated @see APR_FPROT_UEXECUTE */ +#define APR_GSETID APR_FPROT_GSETID /**< @deprecated @see APR_FPROT_GSETID */ +#define APR_GREAD APR_FPROT_GREAD /**< @deprecated @see APR_FPROT_GREAD */ +#define APR_GWRITE APR_FPROT_GWRITE /**< @deprecated @see APR_FPROT_GWRITE */ +#define APR_GEXECUTE APR_FPROT_GEXECUTE /**< @deprecated @see APR_FPROT_GEXECUTE */ +#define APR_WSTICKY APR_FPROT_WSTICKY /**< @deprecated @see APR_FPROT_WSTICKY */ +#define APR_WREAD APR_FPROT_WREAD /**< @deprecated @see APR_FPROT_WREAD */ +#define APR_WWRITE APR_FPROT_WWRITE /**< @deprecated @see APR_FPROT_WWRITE */ +#define APR_WEXECUTE APR_FPROT_WEXECUTE /**< @deprecated @see APR_FPROT_WEXECUTE */ +#define APR_OS_DEFAULT APR_FPROT_OS_DEFAULT /**< @deprecated @see APR_FPROT_OS_DEFAULT */ +#define APR_FILE_SOURCE_PERMS APR_FPROT_FILE_SOURCE_PERMS /**< @deprecated @see APR_FPROT_FILE_SOURCE_PERMS */ + /** @} */ From f47af82b5e124b58e86d74763a68e89710201179 Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Fri, 10 Dec 2004 02:50:06 +0000 Subject: [PATCH 5254/7878] fix the CHANGES entry: s/APR_FRPOT_UWRITE/APR_UWRITE/ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111458 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index b54ec43c0e1..5361fe6aed9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,7 @@ Changes for APR 1.1.0 *( rename the apr_file_permissions defines (APR_UREAD, - APR_FPROT_UWRITE, etc.) to have prefix APR_FPROT_ (keeping the + APR_UWRITE, etc.) to have prefix APR_FPROT_ (keeping the old defines) [Stas] *) Emit the run-time link path option in apr-config after installation From 8188e2dcbbac7d7cdd5e786904af5a47fddd3a03 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 10 Dec 2004 11:20:33 +0000 Subject: [PATCH 5255/7878] fix typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111496 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 5361fe6aed9..20746e53041 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,6 @@ Changes for APR 1.1.0 - *( rename the apr_file_permissions defines (APR_UREAD, + *) rename the apr_file_permissions defines (APR_UREAD, APR_UWRITE, etc.) to have prefix APR_FPROT_ (keeping the old defines) [Stas] From 1e9379712822653579a8987e480fc155785a88c3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 10 Dec 2004 14:11:31 +0000 Subject: [PATCH 5256/7878] Fix a check. Contributed by: Ingo Weinhold Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111508 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/pipe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 7013160cdc4..c32613f44c6 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -42,7 +42,7 @@ static apr_status_t pipeblock(apr_file_t *thepipe) fd_flags &= ~O_NONBLOCK; # elif defined(O_NDELAY) fd_flags &= ~O_NDELAY; -# elif defined(FNDELAY) +# elif defined(O_FNDELAY) fd_flags &= ~O_FNDELAY; # else /* XXXX: this breaks things, but an alternative isn't obvious...*/ @@ -77,7 +77,7 @@ static apr_status_t pipenonblock(apr_file_t *thepipe) fd_flags |= O_NONBLOCK; # elif defined(O_NDELAY) fd_flags |= O_NDELAY; -# elif defined(FNDELAY) +# elif defined(O_FNDELAY) fd_flags |= O_FNDELAY; # else /* XXXX: this breaks things, but an alternative isn't obvious...*/ From 96f3807d601055f397b8b9965e2fe57c456151aa Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 10 Dec 2004 15:19:19 +0000 Subject: [PATCH 5257/7878] s/AF_UNSPEC/APR_UNSPEC/ Proposed by: Ingo Weinhold Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111511 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 593ab994886..5c8b7b04724 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -293,7 +293,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; #ifdef HAVE_GAI_ADDRCONFIG - if (family == AF_UNSPEC) { + if (family == APR_UNSPEC) { /* By default, only look up addresses using address types for * which a local interface is configured, i.e. no IPv6 if no * IPv6 interfaces configured. */ @@ -335,7 +335,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, } error = getaddrinfo(hostname, servname, &hints, &ai_list); #ifdef HAVE_GAI_ADDRCONFIG - if (error == EAI_BADFLAGS && family == AF_UNSPEC) { + if (error == EAI_BADFLAGS && family == APR_UNSPEC) { /* Retry with no flags if AI_ADDRCONFIG was rejected. */ hints.ai_flags = 0; error = getaddrinfo(hostname, servname, &hints, &ai_list); @@ -367,7 +367,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, apr_sockaddr_t *new_sa; /* Ignore anything bogus: getaddrinfo in some old versions of - * glibc will return AF_UNIX entries for AF_UNSPEC+AI_PASSIVE + * glibc will return AF_UNIX entries for APR_UNSPEC+AI_PASSIVE * lookups. */ if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) { ai = ai->ai_next; @@ -543,7 +543,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, if ((masked = flags & (APR_IPV4_ADDR_OK | APR_IPV6_ADDR_OK))) { if (!hostname || - family != AF_UNSPEC || + family != APR_UNSPEC || masked == (APR_IPV4_ADDR_OK | APR_IPV6_ADDR_OK)) { return APR_EINVAL; } From 6fc7ca507bb3baabecad5fc34e88eb401c71da11 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 10 Dec 2004 15:30:34 +0000 Subject: [PATCH 5258/7878] On BeOS R5 we don't have the option available. Contributed by: Ingo Weinhold Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111512 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index a6c80a9a59e..036215f61a9 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -323,6 +323,7 @@ apr_status_t apr_socket_opt_get(apr_socket_t *sock, apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark) { +#ifndef BEOS_R5 int oobmark; if (ioctl(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0) @@ -331,9 +332,11 @@ apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark) *atmark = (oobmark != 0); return APR_SUCCESS; +#else /* BEOS_R5 */ + return APR_ENOTIMPL; +#endif } - apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { if (gethostname(buf, len) == -1) { From 99e0f4fa441172a6a7eaf137f5bb4d761cbac8b5 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 10 Dec 2004 15:37:36 +0000 Subject: [PATCH 5259/7878] Create the correct type of socket when using BeOS R5 with the old net_server code. Contributed by: Ingo Weinhold Reviewed by: David Reid git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111513 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index d843fdf8814..ed96168013b 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -20,9 +20,10 @@ #include "apr_portable.h" #include "apr_arch_inherit.h" -#if defined(BEOS) && !defined(BEOS_BONE) +#ifdef BEOS_R5 +#undef close #define close closesocket -#endif +#endif /* BEOS_R5 */ static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */ @@ -92,7 +93,28 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, alloc_socket(new, cont); +#ifndef BEOS_R5 (*new)->socketdes = socket(family, type, protocol); +#else + /* For some reason BeOS R5 has an unconventional protocol numbering, + * so we need to translate here. */ + switch (protocol) { + case 0: + (*new)->socketdes = socket(family, type, 0); + break; + case APR_PROTO_TCP: + (*new)->socketdes = socket(family, type, IPPROTO_TCP); + break; + case APR_PROTO_UDP: + (*new)->socketdes = socket(family, type, IPPROTO_UDP); + break; + case APR_PROTO_SCTP: + default: + errno = EPROTONOSUPPORT; + (*new)->socketdes = -1; + break; + } +#endif /* BEOS_R5 */ #if APR_HAVE_IPV6 if ((*new)->socketdes < 0 && ofamily == APR_UNSPEC) { From 6996592c0afe87b762d4a3d2a6ec7906aa69e11b Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 11 Dec 2004 03:53:06 +0000 Subject: [PATCH 5260/7878] * file_io/unix/readwrite.c: Revert to the original code for apr_file writev() in the !HAVE_WRITEV case, and a large comment explaining why we cannot use a better method without breaking writev()'s semantics. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111571 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ---- file_io/unix/readwrite.c | 31 ++++++++++++++++--------------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/CHANGES b/CHANGES index 20746e53041..8c2544c5439 100644 --- a/CHANGES +++ b/CHANGES @@ -10,10 +10,6 @@ Changes for APR 1.1.0 *) Add apr_file_writev_full to ensure an entire iovec is writen to a file. [Paul Querna] - *) apr_file_writev will now at least try to write all iovecs on platforms - that do not support writev. - [Paul Querna] - *) Remove the runtime test for Sendfile versions on FreeBSD. PR 25718. [Mike Silbersack , Paul Querna] diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 8f0562b0269..97daf3fabdf 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -241,21 +241,22 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove return APR_SUCCESS; } #else - int i; - int tbytes; - apr_status_t rv = APR_SUCCESS; - - *nbytes = 0; - - for (i = 0; i < nvec; i++) { - tbytes = vec[i].iov_len; - rv = apr_file_write(thefile, vec[i].iov_base, &tbytes); - *nbytes += tbytes; - if (rv != APR_SUCCESS || tbytes < vec[i].iov_len) { - break; - } - } - return rv; + /** + * The problem with trying to output the entire iovec is that we cannot + * maintain the behavoir that a real writev would have. If we iterate + * over the iovec one at a time, we loose the atomic properties of + * writev(). The other option is to combine the entire iovec into one + * buffer that we could then send in one call to write(). This is not + * reasonable since we do not know how much data an iocev could contain. + * + * The only reasonable option, that maintains the semantics of a real + * writev(), is to only write the first iovec. Callers of file_writev() + * must deal with partial writes as they normally would. If you want to + * ensure an entire iovec is written, use apr_file_writev_full(). + */ + + *nbytes = vec[0].iov_len; + return apr_file_write(thefile, vec[0].iov_base, nbytes); #endif } From 055506089911b4067c5f121fc561370c4ea64248 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 11 Dec 2004 04:20:42 +0000 Subject: [PATCH 5261/7878] typo in comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111574 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 97daf3fabdf..07e11227306 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -247,7 +247,7 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove * over the iovec one at a time, we loose the atomic properties of * writev(). The other option is to combine the entire iovec into one * buffer that we could then send in one call to write(). This is not - * reasonable since we do not know how much data an iocev could contain. + * reasonable since we do not know how much data an iovec could contain. * * The only reasonable option, that maintains the semantics of a real * writev(), is to only write the first iovec. Callers of file_writev() From 9c051ba6d51e0690bfda9f2f3c5a0caebbb23410 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 11 Dec 2004 09:45:06 +0000 Subject: [PATCH 5262/7878] Add support for Linux's TCP_DEFER_ACCEPT. Sort of like FreeBSD's accept filters, except defer accept isn't documented, anywhere. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111595 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_network_io.h | 4 ++++ network_io/unix/sockopt.c | 15 +++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/CHANGES b/CHANGES index 8c2544c5439..41d29a3a75f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.1.0 + *) Add support for APR_TCP_DEFER_ACCEPT. + [Paul Querna] + *) rename the apr_file_permissions defines (APR_UREAD, APR_UWRITE, etc.) to have prefix APR_FPROT_ (keeping the old defines) [Stas] diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 3e147522970..97c18330dff 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -94,6 +94,10 @@ extern "C" { #define APR_IPV6_V6ONLY 16384 /**< Don't accept IPv4 connections on an * IPv6 listening socket. */ +#define APR_TCP_DEFER_ACCEPT 32768 /**< Delay accepting of new connections + * until data is available. + * @see apr_socket_accept_filter + */ /** @} */ diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 036215f61a9..35eade0859d 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -199,6 +199,21 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, return APR_ENOTIMPL; #endif break; + case APR_TCP_DEFER_ACCEPT: +#if defined(TCP_DEFER_ACCEPT) + if (apr_is_option_set(sock, APR_TCP_DEFER_ACCEPT) != on) { + int optlevel = IPPROTO_TCP; + int optname = TCP_DEFER_ACCEPT; + + if (setsockopt(sock->socketdes, optlevel, optname, + (void *)&on, sizeof(int)) == -1) { + return errno; + } + apr_set_option(sock, APR_TCP_DEFER_ACCEPT, on); + } +#else + return APR_ENOTIMPL; +#endif case APR_TCP_NODELAY: #if defined(TCP_NODELAY) if (apr_is_option_set(sock, APR_TCP_NODELAY) != on) { From 4383e8ee4d47ada293e2dafad64fe1189eb0a14c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 13 Dec 2004 09:55:29 +0000 Subject: [PATCH 5263/7878] * test/testfile.c (test_writev, test_writev_full): Fix nbytes type. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111695 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testfile.c b/test/testfile.c index 55907b77a07..4d7dee62cdb 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -556,7 +556,7 @@ static void test_puts(abts_case *tc, void *data) static void test_writev(abts_case *tc, void *data) { apr_file_t *f; - int nbytes; + apr_size_t nbytes; struct iovec vec[5]; const char *fname = "data/testwritev.txt"; @@ -598,7 +598,7 @@ static void test_writev(abts_case *tc, void *data) static void test_writev_full(abts_case *tc, void *data) { apr_file_t *f; - int nbytes; + apr_size_t nbytes; struct iovec vec[5]; const char *fname = "data/testwritev_full.txt"; From 45e4cfd711b174fe5e03bec3d2b7dd23626ff027 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 14 Dec 2004 21:18:42 +0000 Subject: [PATCH 5264/7878] Add a build script to create Solaris packages from APR git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111877 13f79535-47bb-0310-9956-ffa450edef68 --- build/pkg/README | 20 +++++++++++++ build/pkg/buildpkg.sh | 70 +++++++++++++++++++++++++++++++++++++++++++ build/pkg/pkginfo.in | 11 +++++++ configure.in | 1 + 4 files changed, 102 insertions(+) create mode 100644 build/pkg/README create mode 100755 build/pkg/buildpkg.sh create mode 100644 build/pkg/pkginfo.in diff --git a/build/pkg/README b/build/pkg/README new file mode 100644 index 00000000000..ce1c9b73a95 --- /dev/null +++ b/build/pkg/README @@ -0,0 +1,20 @@ +The script in this directory will attempt to build a Solaris package +out of a source tree for APR. + +To build a package, make sure you are in the root of the source tree, +and run: + +build/pkg/buildpkg.sh + +A Solaris package called apr---local.gz will be +created in the root of the source tree. + +By default, if you attempt to build packages for apr-util, it will +search for the sources for apr in: + +../apr + +You may override the location of apr like so: + +build/pkg/buildpkg.sh --with-apr=some/other/path + diff --git a/build/pkg/buildpkg.sh b/build/pkg/buildpkg.sh new file mode 100755 index 00000000000..5177ef8c3ab --- /dev/null +++ b/build/pkg/buildpkg.sh @@ -0,0 +1,70 @@ +#!/bin/sh +# Copyright 2000-2004 The Apache Software Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +# buildpkg.sh: This script builds a Solaris PKG from the source tree +# provided. + +PREFIX=/usr/local +TEMPDIR=/var/tmp/$USER/apr-root +rm -rf $TEMPDIR + +apr_src_dir=. + +while test $# -gt 0 +do + # Normalize + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case "$1" in + --with-apr=*) + apr_src_dir=$optarg + ;; + esac + + shift +done + +if [ -f "$apr_src_dir/configure.in" ]; then + cd $apr_src_dir +else + echo "The apr source could not be found within $apr_src_dir" + echo "Usage: buildpkg [--with-apr=dir]" + exit 1 +fi + +./configure --prefix=$PREFIX +make +make install DESTDIR=$TEMPDIR +. build/pkg/pkginfo +cp build/pkg/pkginfo $TEMPDIR$PREFIX + +current=`pwd` +cd $TEMPDIR$PREFIX +echo "i pkginfo=./pkginfo" > prototype +find . -print | grep -v ./prototype | grep -v ./pkginfo | pkgproto | awk '{print $1" "$2" "$3" "$4" root bin"}' >> prototype +mkdir $TEMPDIR/pkg +pkgmk -r $TEMPDIR$PREFIX -d $TEMPDIR/pkg + +cd $current +pkgtrans -s $TEMPDIR/pkg $current/$NAME-$VERSION-$ARCH-local +gzip $current/$NAME-$VERSION-$ARCH-local + +rm -rf $TEMPDIR + diff --git a/build/pkg/pkginfo.in b/build/pkg/pkginfo.in new file mode 100644 index 00000000000..6110a55f6ec --- /dev/null +++ b/build/pkg/pkginfo.in @@ -0,0 +1,11 @@ +PKG="ASFapr" +NAME="apr" +ARCH="@target_cpu@" +VERSION="@APR_DOTTED_VERSION@" +CATEGORY="application" +VENDOR="Apache Software Foundation" +EMAIL="dev@apr.apache.org" +PSTAMP="dev@apr.apache.org" +BASEDIR="@prefix@" +CLASSES="none" + diff --git a/configure.in b/configure.in index d1769d82f0e..b120ebe2891 100644 --- a/configure.in +++ b/configure.in @@ -2033,6 +2033,7 @@ AC_OUTPUT([ $MAKEFILES include/apr.h build/apr_rules.mk + build/pkg/pkginfo apr-$APR_MAJOR_VERSION-config:apr-config.in apr.pc ],[ From 9778e37536d63fed318afa192b90fbb53f806365 Mon Sep 17 00:00:00 2001 From: Andre Malo Date: Tue, 14 Dec 2004 23:03:36 +0000 Subject: [PATCH 5265/7878] svn:eol-style = native git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@111897 13f79535-47bb-0310-9956-ffa450edef68 From c7a1f288baa5f8f3a31302eb2d1d235f1f977b2f Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Thu, 16 Dec 2004 00:22:01 +0000 Subject: [PATCH 5266/7878] Include the addition of the Solaris package git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@112259 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 41d29a3a75f..ec3d6e7e0bd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes for APR 1.1.0 + *) Add a build script to create a solaris package. [Graham Leggett] + *) Add support for APR_TCP_DEFER_ACCEPT. [Paul Querna] From 80dff68bd1f578661c9248c2f9682e6ec5660613 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 2 Jan 2005 06:04:07 +0000 Subject: [PATCH 5267/7878] Adding an initial Multicast API. Tested On: OS X, FreeBSD, NetBSD and Linux. Needs more Platform Specific Code: Netware, Windows git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@123883 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + configure.in | 3 + include/apr_network_io.h | 57 +++++++ network_io/unix/multicast.c | 295 ++++++++++++++++++++++++++++++++++++ 4 files changed, 357 insertions(+) create mode 100644 network_io/unix/multicast.c diff --git a/CHANGES b/CHANGES index ec3d6e7e0bd..2e5481788d5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes for APR 1.1.0 + *) Add APR Multicast Functions [Paul Querna] + *) Add a build script to create a solaris package. [Graham Leggett] *) Add support for APR_TCP_DEFER_ACCEPT. diff --git a/configure.in b/configure.in index b120ebe2891..1326b645e3f 100644 --- a/configure.in +++ b/configure.in @@ -1898,6 +1898,9 @@ AC_SUBST(have_sctp) AC_CHECK_FUNCS(set_h_errno) +dnl Used in the Multicast Code +AC_CHECK_FUNCS(getifaddrs) + echo "${nl}Checking for IPv6 Networking support..." dnl Start of checking for IPv6 support... diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 97c18330dff..cf3679b238c 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -747,6 +747,63 @@ APR_DECLARE_INHERIT_SET(socket); */ APR_DECLARE_INHERIT_UNSET(socket); +/** + * @defgroup apr_mcast IP Multicast + * @{ + */ + +/** + * Join a Multicast Group + * @param sock The socket to join a multicast group + * @param join The address of the multicast group to join + * @param iface Address of the interface to use. If NULL is passed, the + * default multicast interface will be used. (OS Dependent) + */ +APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, + apr_sockaddr_t *join, + apr_sockaddr_t *iface); + +/** + * Leave a Multicast Group. All arguments must be the same as + * apr_mcast_join. + * @param sock The socket to leave a multicast group + * @param leave The address of the multicast group to leave + * @param iface Address of the interface to use. If NULL is passed, the + * default multicast interface will be used. (OS Dependent) + */ +APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, + apr_sockaddr_t *leave, + apr_sockaddr_t *iface); + +/** + * Set the Multicast Time to Live (ttl) for a multicast transmission. + * @param sock The socket to set the multicast ttl + * @param ttl Time to live to Assign. 0-255, default=1 + * @remark If the TTL is 0, packets will only be seen by sockets on + * the local machine, and only when multicast loopback is enabled. + */ +APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, + apr_byte_t ttl); + +/** + * Toggle IP Multicast Loopback + * @param sock The socket to set multicast loopback + * @param opt 0=disable, 1=enable + */ +APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock, + apr_byte_t opt); + + +/** + * Set the Interface to be used for outgoing Multicast Transmissions. + * @param sock The socket to set the multicast interface on + * @param iface Address of the interface to use for Multicast + */ +APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock, + apr_sockaddr_t *iface); + +/** @} */ + /** @} */ #ifdef __cplusplus diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c new file mode 100644 index 00000000000..ea4fe6487b9 --- /dev/null +++ b/network_io/unix/multicast.c @@ -0,0 +1,295 @@ +/* Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_arch_networkio.h" +#include "apr_network_io.h" +#include "apr_support.h" +#include "apr_portable.h" +#include "apr_arch_inherit.h" + +#if HAVE_GETIFADDRS +#include +#include +#endif + +/* Only UDP and Raw Sockets can be used for Multicast */ +static apr_status_t mcast_check_type(apr_socket_t* sock) +{ + int type; + apr_status_t rv; + + rv = apr_socket_type_get(sock, &type); + + if (rv != APR_SUCCESS) { + return rv; + } + else if (type == SOCK_DGRAM || type == SOCK_RAW) { + return APR_SUCCESS; + } + else { + return APR_ENOTIMPL; + } +} + +static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast, + apr_sockaddr_t *iface) +{ + mip->imr_multiaddr = mcast->sa.sin.sin_addr; + if (iface == NULL) { + mip->imr_interface.s_addr = INADDR_ANY; + } + else { + mip->imr_interface = iface->sa.sin.sin_addr; + } +} + +#if APR_HAVE_IPV6 +static unsigned int find_if_index(const apr_sockaddr_t *iface) +{ + unsigned int index = 0; + struct ifaddrs *ifp, *ifs; + + /** + * TODO: getifaddrs is only portable to *BSD and OS X. Using ioctl + * and SIOCGIFCONF is needed for Linux/Solaris support. + * + * There is a wrapper that takes the messy ioctl interface into + * getifaddrs. The license is acceptable, but, It is a fairly large + * chunk of code. + */ +#if HAVE_GETIFADDRS + if (getifaddrs(&ifs) != 0) { + return 0; + } + + for (ifp = ifs; ifp; ifp = ifp->ifa_next) { + if (ifp->ifa_addr != NULL && + ifp->ifa_addr->sa_family == AF_INET6) { + /* TODO: Is this correct? */ + if (memcmp(&iface->sa.sin6.sin6_addr, + &ifp->ifa_addr->sa_data[0], + sizeof(ifp->ifa_addr)) == 0) { + index = if_nametoindex(ifp->ifa_name); + break; + } + } + } + + freeifaddrs(ifs); +#endif + return index; +} + +static void fill_mip_v6(struct ipv6_mreq *mip, const apr_sockaddr_t *mcast, + const apr_sockaddr_t *iface) +{ + memcpy(&mip->ipv6mr_multiaddr, mcast->ipaddr_ptr, + sizeof(mip->ipv6mr_multiaddr)); + + if (iface == NULL) { + mip->ipv6mr_interface = 0; + } + else { + mip->ipv6mr_interface = find_if_index(iface); + } +} + +#endif + +static int sock_is_ipv4(apr_socket_t* sock) +{ + if (sock->local_addr->family == APR_INET) + return 1; + return 0; +} + +#if APR_HAVE_IPV6 +static int sock_is_ipv6(apr_socket_t* sock) +{ + if (sock->local_addr->family == APR_INET6) + return 1; + return 0; +} +#endif + +static apr_status_t do_mcast(int type, apr_socket_t *sock, + apr_sockaddr_t *mcast, apr_sockaddr_t *iface) +{ + struct ip_mreq mip4; + apr_status_t rv = APR_SUCCESS; +#if APR_HAVE_IPV6 + struct ipv6_mreq mip6; +#endif + + rv = mcast_check_type(sock); + + if (rv != APR_SUCCESS) { + return rv; + } + + if (sock_is_ipv4(sock)) { + + fill_mip_v4(&mip4, mcast, iface); + + if (setsockopt(sock->socketdes, IPPROTO_IP, type, + &mip4, sizeof(mip4)) == -1) { + rv = errno; + } + } +#if APR_HAVE_IPV6 + else if (sock_is_ipv6(sock)) { + if (type == IP_ADD_MEMBERSHIP) { + type = IPV6_JOIN_GROUP; + } + else if (type == IP_DROP_MEMBERSHIP) { + type = IPV6_LEAVE_GROUP; + } + else { + return APR_ENOTIMPL; + } + + fill_mip_v6(&mip6, mcast, iface); + + if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, + &mip6, sizeof(mip6)) == -1) { + rv = errno; + } + } +#endif + else { + rv = APR_ENOTIMPL; + } + return rv; +} + +static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, + apr_byte_t value) +{ + apr_status_t rv = APR_SUCCESS; + + rv = mcast_check_type(sock); + + if (rv != APR_SUCCESS) { + return rv; + } + + if (sock_is_ipv4(sock)) { + if (setsockopt(sock->socketdes, IPPROTO_IP, type, + &value, sizeof(value)) == -1) { + rv = errno; + } + } +#if APR_HAVE_IPV6 + else if (sock_is_ipv6(sock) && type == IP_MULTICAST_LOOP) { + unsigned int loopopt = value; + type = IPV6_MULTICAST_LOOP; + if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, + &loopopt, sizeof(loopopt)) == -1) { + rv = errno; + } + } + else if (sock_is_ipv6(sock)) { + if (type == IP_MULTICAST_TTL) { + type = IPV6_MULTICAST_HOPS; + } + else { + return APR_ENOTIMPL; + } + + if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, + &value, sizeof(value)) == -1) { + rv = errno; + } + } +#endif + else { + rv = APR_ENOTIMPL; + } + + return rv; +} + +APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, + apr_sockaddr_t *join, + apr_sockaddr_t *iface) +{ +#ifdef IP_ADD_MEMBERSHIP + return do_mcast(IP_ADD_MEMBERSHIP, sock, join, iface); +#else + return APR_ENOTIMPL; +#endif +} + +APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, + apr_sockaddr_t *leave, + apr_sockaddr_t *iface) +{ +#ifdef IP_DROP_MEMBERSHIP + return do_mcast(IP_DROP_MEMBERSHIP, sock, leave, iface); +#else + return APR_ENOTIMPL; +#endif +} + +APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, + apr_byte_t ttl) +{ +#ifdef IP_MULTICAST_TTL + return do_mcast_opt(IP_MULTICAST_TTL, sock, ttl); +#else + return APR_ENOTIMPL; +#endif +} + +APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock, + apr_byte_t opt) +{ +#ifdef IP_MULTICAST_LOOP + return do_mcast_opt(IP_MULTICAST_LOOP, sock, opt); +#else + return APR_ENOTIMPL; +#endif +} + +APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock, + apr_sockaddr_t *iface) +{ +#ifdef IP_MULTICAST_IF + apr_status_t rv = APR_SUCCESS; + + if (sock_is_ipv4(sock)) { + if (setsockopt(sock->socketdes, IPPROTO_IP, IP_MULTICAST_IF, + &iface->sa.sin.sin_addr, + sizeof(iface->sa.sin.sin_addr)) == -1) { + rv = errno; + } + } +#if APR_HAVE_IPV6 + else if (sock_is_ipv6(sock)) { + unsigned int idx = find_if_index(iface); + if (setsockopt(sock->socketdes, IPPROTO_IPV6, IPV6_MULTICAST_IF, + &idx, sizeof(idx)) == -1) { + rv = errno; + } + } +#endif + else { + rv = APR_ENOTIMPL; + } + return rv; +#else + return APR_ENOTIMPL; +#endif +} From 665a20329873f46870f2ee53f5b02596a118abe4 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Mon, 3 Jan 2005 07:37:34 +0000 Subject: [PATCH 5268/7878] Add arguments for Single Source Multicast Support as suggested by Colm MacCarthaigh on dev@apr. SSM Support is not implemented, but I added it in the interest of making a single API that can be used in the future. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@123950 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 12 ++++++++++-- network_io/unix/multicast.c | 17 ++++++++++++----- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index cf3679b238c..8721fa166c0 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -758,10 +758,14 @@ APR_DECLARE_INHERIT_UNSET(socket); * @param join The address of the multicast group to join * @param iface Address of the interface to use. If NULL is passed, the * default multicast interface will be used. (OS Dependent) + * @param ssm Single Source Multicast Address to accept transmissions from. + * @remark Single Source Multicast is not currently implemented, and you must + * pass NULL for the argument. */ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, apr_sockaddr_t *join, - apr_sockaddr_t *iface); + apr_sockaddr_t *iface, + apr_sockaddr_t *ssm); /** * Leave a Multicast Group. All arguments must be the same as @@ -770,10 +774,14 @@ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, * @param leave The address of the multicast group to leave * @param iface Address of the interface to use. If NULL is passed, the * default multicast interface will be used. (OS Dependent) + * @param ssm Single Source Multicast Address that transmissions came from. + * @remark Single Source Multicast is not currently implemented, and you must + * pass NULL for the argument. */ APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, apr_sockaddr_t *leave, - apr_sockaddr_t *iface); + apr_sockaddr_t *iface, + apr_sockaddr_t *ssm); /** * Set the Multicast Time to Live (ttl) for a multicast transmission. diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index ea4fe6487b9..08cd522cd4f 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -125,7 +125,8 @@ static int sock_is_ipv6(apr_socket_t* sock) #endif static apr_status_t do_mcast(int type, apr_socket_t *sock, - apr_sockaddr_t *mcast, apr_sockaddr_t *iface) + apr_sockaddr_t *mcast, apr_sockaddr_t *iface, + apr_sockaddr_t *ssm) { struct ip_mreq mip4; apr_status_t rv = APR_SUCCESS; @@ -133,6 +134,10 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock, struct ipv6_mreq mip6; #endif + /* We do not currently support Single Source Multicast. */ + if (ssm != NULL) + return APR_ENOTIMPL; + rv = mcast_check_type(sock); if (rv != APR_SUCCESS) { @@ -223,10 +228,11 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, apr_sockaddr_t *join, - apr_sockaddr_t *iface) + apr_sockaddr_t *iface, + apr_sockaddr_t *ssm) { #ifdef IP_ADD_MEMBERSHIP - return do_mcast(IP_ADD_MEMBERSHIP, sock, join, iface); + return do_mcast(IP_ADD_MEMBERSHIP, sock, join, iface, ssm); #else return APR_ENOTIMPL; #endif @@ -234,10 +240,11 @@ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, apr_sockaddr_t *leave, - apr_sockaddr_t *iface) + apr_sockaddr_t *iface, + apr_sockaddr_t *ssm) { #ifdef IP_DROP_MEMBERSHIP - return do_mcast(IP_DROP_MEMBERSHIP, sock, leave, iface); + return do_mcast(IP_DROP_MEMBERSHIP, sock, leave, iface, ssm); #else return APR_ENOTIMPL; #endif From 1391fef556915b100bd017dc2a99311e5bfe0ea4 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 3 Jan 2005 18:29:22 +0000 Subject: [PATCH 5269/7878] Fix up some type mismatches git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124021 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/multicast.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index 08cd522cd4f..fc4e6b3ea8b 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -149,7 +149,7 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock, fill_mip_v4(&mip4, mcast, iface); if (setsockopt(sock->socketdes, IPPROTO_IP, type, - &mip4, sizeof(mip4)) == -1) { + (const void *)&mip4, sizeof(mip4)) == -1) { rv = errno; } } @@ -192,7 +192,7 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, if (sock_is_ipv4(sock)) { if (setsockopt(sock->socketdes, IPPROTO_IP, type, - &value, sizeof(value)) == -1) { + (const void *)&value, sizeof(value)) == -1) { rv = errno; } } @@ -278,7 +278,7 @@ APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock, if (sock_is_ipv4(sock)) { if (setsockopt(sock->socketdes, IPPROTO_IP, IP_MULTICAST_IF, - &iface->sa.sin.sin_addr, + (const void *)&iface->sa.sin.sin_addr, sizeof(iface->sa.sin.sin_addr)) == -1) { rv = errno; } From 8f4d757d2883fca378d22485c082d4e692e4e372 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 3 Jan 2005 18:29:54 +0000 Subject: [PATCH 5270/7878] Add multicast.c to the NetWare build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124022 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index eed1d5d5bb5..ed11cad6111 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -290,6 +290,7 @@ FILES_lib_objs = \ $(OBJDIR)/libprews.o \ $(OBJDIR)/mktemp.o \ $(OBJDIR)/mmap.o \ + $(OBJDIR)/multicast.o \ $(OBJDIR)/open.o \ $(OBJDIR)/pipe.o \ $(OBJDIR)/otherchild.o \ From 96e92ae1c2f6ce9de57c0a93fe612ac80263710f Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Tue, 4 Jan 2005 08:57:44 +0000 Subject: [PATCH 5271/7878] sigprocmask should be used instead pthread_sigmask on nothreaded platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124075 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 85b8ef05356..7ecac1b97f9 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -409,7 +409,7 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) sigfillset(&sig_mask); remove_sync_sigs(&sig_mask); -#if defined(SIGPROCMASK_SETS_THREAD_MASK) +#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS if ((rv = sigprocmask(SIG_SETMASK, &sig_mask, NULL)) != 0) { rv = errno; } @@ -435,7 +435,7 @@ APR_DECLARE(apr_status_t) apr_signal_block(int signum) sigaddset(&sig_mask, signum); -#if defined(SIGPROCMASK_SETS_THREAD_MASK) +#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS if ((rv = sigprocmask(SIG_BLOCK, &sig_mask, NULL)) != 0) { rv = errno; } @@ -462,7 +462,7 @@ APR_DECLARE(apr_status_t) apr_signal_unblock(int signum) sigaddset(&sig_mask, signum); -#if defined(SIGPROCMASK_SETS_THREAD_MASK) +#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS if ((rv = sigprocmask(SIG_UNBLOCK, &sig_mask, NULL)) != 0) { rv = errno; } From 631c9023ab05507d51019c273e57a952b126845c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 5 Jan 2005 19:01:20 +0000 Subject: [PATCH 5272/7878] Clean up 4 extranious emits. Because of the modulo operator, these becomes safe casts to unsigned. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124243 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/sha2.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/random/unix/sha2.c b/random/unix/sha2.c index 7e35e18f34d..7ce6d659b12 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -458,7 +458,8 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { /* Sanity check: */ assert(context != (SHA256_CTX*)0 && data != (sha2_byte*)0); - usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; + usedspace = (unsigned int)((context->bitcount >> 3) + % SHA256_BLOCK_LENGTH); if (usedspace > 0) { /* Calculate how much free space is available in the buffer */ freespace = SHA256_BLOCK_LENGTH - usedspace; @@ -504,7 +505,8 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { - usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; + usedspace = (unsigned int)((context->bitcount >> 3) + % SHA256_BLOCK_LENGTH); #if !APR_IS_BIGENDIAN /* Convert FROM host byte order */ REVERSE64(context->bitcount,context->bitcount); @@ -780,7 +782,8 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { /* Sanity check: */ assert(context != (SHA512_CTX*)0 && data != (sha2_byte*)0); - usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; + usedspace = (unsigned int)((context->bitcount[0] >> 3) + % SHA512_BLOCK_LENGTH); if (usedspace > 0) { /* Calculate how much free space is available in the buffer */ freespace = SHA512_BLOCK_LENGTH - usedspace; @@ -820,7 +823,8 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { void SHA512_Last(SHA512_CTX* context) { unsigned int usedspace; - usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; + usedspace = (unsigned int)((context->bitcount[0] >> 3) + % SHA512_BLOCK_LENGTH); #if !APR_IS_BIGENDIAN /* Convert FROM host byte order */ REVERSE64(context->bitcount[0],context->bitcount[0]); From 8b07f3b0c3b0f0efb485102fb09908f39afb0cae Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 5 Jan 2005 19:49:47 +0000 Subject: [PATCH 5273/7878] Clean up a compiler emit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124255 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fullrw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index 8596d254dcb..7d1f85b3230 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -70,8 +70,7 @@ APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile, apr_size_t total = 0; do { - int i; - apr_size_t amt; + apr_size_t i, amt; status = apr_file_writev(thefile, vec, nvec, &amt); /* We assume that writev will only write complete iovec areas. From 745a0ff594090de99704e0c04d525da4924eeb7a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 5 Jan 2005 20:07:09 +0000 Subject: [PATCH 5274/7878] Begin explicit __cdecl protection against including the apr headers from any c sources compiled /Gz (default __stdcall convention). Observed and suggested by Andre Pang . git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124262 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 7797ed97d96..cc26f3aa8d7 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -432,15 +432,15 @@ typedef int gid_t; #elif defined(APR_DECLARE_STATIC) #define APR_DECLARE(type) type __stdcall -#define APR_DECLARE_NONSTD(type) type +#define APR_DECLARE_NONSTD(type) type __cdecl #define APR_DECLARE_DATA #elif defined(APR_DECLARE_EXPORT) #define APR_DECLARE(type) __declspec(dllexport) type __stdcall -#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type +#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl #define APR_DECLARE_DATA __declspec(dllexport) #else #define APR_DECLARE(type) __declspec(dllimport) type __stdcall -#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type +#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl #define APR_DECLARE_DATA __declspec(dllimport) #endif From 10b02f4f0226052e077078744d0e5e83c7dbe9fa Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Thu, 6 Jan 2005 07:04:24 +0000 Subject: [PATCH 5275/7878] * Fix compiler warning for type mismatch on nget. * Add locking to prevent a race condition that the Event MPM hit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124350 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index 056579e2d64..4ecb56bf3eb 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -248,7 +248,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, const apr_pollfd_t **descriptors) { apr_os_sock_t fd; - int ret, i, nget; + int ret, i; + unsigned int nget; pfd_elem_t *ep; struct timespec tv, *tvptr; apr_status_t rv = APR_SUCCESS; @@ -303,6 +304,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } else { + pollset_lock_rings(); + for (i = 0; i < nget; i++) { pollset->result_set[i] = (((pfd_elem_t*)(pollset->port_set[i].portev_user))->pfd); @@ -314,6 +317,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pfd_elem_t, link); } + pollset_unlock_rings(); + if (descriptors) { *descriptors = pollset->result_set; } From 9d6d6ee0ee7647d4dc0037c99aecda3af40e68ad Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Thu, 6 Jan 2005 20:27:26 +0000 Subject: [PATCH 5276/7878] Add the major version number to the package name so that packages can be installed in parallel. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124437 13f79535-47bb-0310-9956-ffa450edef68 --- build/pkg/pkginfo.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkg/pkginfo.in b/build/pkg/pkginfo.in index 6110a55f6ec..f389b26901a 100644 --- a/build/pkg/pkginfo.in +++ b/build/pkg/pkginfo.in @@ -1,4 +1,4 @@ -PKG="ASFapr" +PKG="ASFapr-1" NAME="apr" ARCH="@target_cpu@" VERSION="@APR_DOTTED_VERSION@" From 035f1544746c987abe8277e341639d45ca2f31d9 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Mon, 10 Jan 2005 02:50:57 +0000 Subject: [PATCH 5277/7878] Add Support for Single Source Multicast. Submitted By: Colm MacCarthaigh git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124752 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + include/apr_network_io.h | 14 ++-- network_io/unix/multicast.c | 134 ++++++++++++++++++++++-------------- 3 files changed, 89 insertions(+), 61 deletions(-) diff --git a/CHANGES b/CHANGES index 2e5481788d5..94e599d8177 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes for APR 1.1.0 + *) Add Support for Source-Specific Multicast. [Colm MacCarthaigh] + *) Add APR Multicast Functions [Paul Querna] *) Add a build script to create a solaris package. [Graham Leggett] diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 8721fa166c0..9df0ec29cb4 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -758,14 +758,13 @@ APR_DECLARE_INHERIT_UNSET(socket); * @param join The address of the multicast group to join * @param iface Address of the interface to use. If NULL is passed, the * default multicast interface will be used. (OS Dependent) - * @param ssm Single Source Multicast Address to accept transmissions from. - * @remark Single Source Multicast is not currently implemented, and you must - * pass NULL for the argument. + * @param source Source Address to accept transmissions from (non-NULL + * implies Source-Specific Multicast) */ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, apr_sockaddr_t *join, apr_sockaddr_t *iface, - apr_sockaddr_t *ssm); + apr_sockaddr_t *source); /** * Leave a Multicast Group. All arguments must be the same as @@ -774,14 +773,13 @@ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, * @param leave The address of the multicast group to leave * @param iface Address of the interface to use. If NULL is passed, the * default multicast interface will be used. (OS Dependent) - * @param ssm Single Source Multicast Address that transmissions came from. - * @remark Single Source Multicast is not currently implemented, and you must - * pass NULL for the argument. + * @param source Source Address to accept transmissions from (non-NULL + * implies Source-Specific Multicast) */ APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, apr_sockaddr_t *leave, apr_sockaddr_t *iface, - apr_sockaddr_t *ssm); + apr_sockaddr_t *source); /** * Set the Multicast Time to Live (ttl) for a multicast transmission. diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index fc4e6b3ea8b..ba92bb9f400 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -25,7 +25,7 @@ #endif /* Only UDP and Raw Sockets can be used for Multicast */ -static apr_status_t mcast_check_type(apr_socket_t* sock) +static apr_status_t mcast_check_type(apr_socket_t *sock) { int type; apr_status_t rv; @@ -43,7 +43,7 @@ static apr_status_t mcast_check_type(apr_socket_t* sock) } } -static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast, +static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast, apr_sockaddr_t *iface) { mip->imr_multiaddr = mcast->sa.sin.sin_addr; @@ -56,7 +56,7 @@ static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast, } #if APR_HAVE_IPV6 -static unsigned int find_if_index(const apr_sockaddr_t *iface) +static unsigned int find_if_index(const apr_sockaddr_t *iface) { unsigned int index = 0; struct ifaddrs *ifp, *ifs; @@ -75,12 +75,10 @@ static unsigned int find_if_index(const apr_sockaddr_t *iface) } for (ifp = ifs; ifp; ifp = ifp->ifa_next) { - if (ifp->ifa_addr != NULL && - ifp->ifa_addr->sa_family == AF_INET6) { - /* TODO: Is this correct? */ + if (ifp->ifa_addr != NULL && ifp->ifa_addr->sa_family == AF_INET6) { if (memcmp(&iface->sa.sin6.sin6_addr, &ifp->ifa_addr->sa_data[0], - sizeof(ifp->ifa_addr)) == 0) { + sizeof(iface->sa.sin6.sin6_addr)) == 0) { index = if_nametoindex(ifp->ifa_name); break; } @@ -92,7 +90,7 @@ static unsigned int find_if_index(const apr_sockaddr_t *iface) return index; } -static void fill_mip_v6(struct ipv6_mreq *mip, const apr_sockaddr_t *mcast, +static void fill_mip_v6(struct ipv6_mreq *mip, const apr_sockaddr_t *mcast, const apr_sockaddr_t *iface) { memcpy(&mip->ipv6mr_multiaddr, mcast->ipaddr_ptr, @@ -108,7 +106,7 @@ static void fill_mip_v6(struct ipv6_mreq *mip, const apr_sockaddr_t *mcast, #endif -static int sock_is_ipv4(apr_socket_t* sock) +static int sock_is_ipv4(apr_socket_t *sock) { if (sock->local_addr->family == APR_INET) return 1; @@ -116,7 +114,7 @@ static int sock_is_ipv4(apr_socket_t* sock) } #if APR_HAVE_IPV6 -static int sock_is_ipv6(apr_socket_t* sock) +static int sock_is_ipv6(apr_socket_t *sock) { if (sock->local_addr->family == APR_INET6) return 1; @@ -124,19 +122,19 @@ static int sock_is_ipv6(apr_socket_t* sock) } #endif -static apr_status_t do_mcast(int type, apr_socket_t *sock, +static apr_status_t do_mcast(int type, apr_socket_t *sock, apr_sockaddr_t *mcast, apr_sockaddr_t *iface, - apr_sockaddr_t *ssm) + apr_sockaddr_t *source) { struct ip_mreq mip4; apr_status_t rv = APR_SUCCESS; #if APR_HAVE_IPV6 struct ipv6_mreq mip6; #endif - - /* We do not currently support Single Source Multicast. */ - if (ssm != NULL) - return APR_ENOTIMPL; +#if MCAST_JOIN_SOURCE_GROUP + struct group_source_req mip; + int ip_proto; +#endif rv = mcast_check_type(sock); @@ -144,37 +142,68 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock, return rv; } - if (sock_is_ipv4(sock)) { + if (source != NULL) { +#if MCAST_JOIN_SOURCE_GROUP + if (sock_is_ipv6(sock)) + ip_proto = IPPROTO_IP; + else if (sock_is_ipv6(sock)) + ip_proto = IPPROTO_IPV6; + else + return APR_ENOTIMPL; - fill_mip_v4(&mip4, mcast, iface); + if (type == IP_ADD_MEMBERSHIP) + type = MCAST_JOIN_SOURCE_GROUP; + else if (type == IP_DROP_MEMBERSHIP) + type = MCAST_LEAVE_SOURCE_GROUP; + else + return APR_ENOTIMPL; - if (setsockopt(sock->socketdes, IPPROTO_IP, type, - (const void *)&mip4, sizeof(mip4)) == -1) { + mip.gsr_interface = find_if_index(iface); + memcpy(&mip.gsr_group, mcast->ipaddr_ptr, sizeof(mip.gsr_group)); + memcpy(&mip.gsr_source, source->ipaddr_ptr, sizeof(mip.gsr_source)); + + if (setsockopt(sock->socketdes, ip_proto, type, (const void *) &mip, + sizeof(mip)) == -1) { rv = errno; } +#else + /* We do not support Source-Specific Multicast. */ + return APR_ENOTIMPL; +#endif } -#if APR_HAVE_IPV6 - else if (sock_is_ipv6(sock)) { - if (type == IP_ADD_MEMBERSHIP) { - type = IPV6_JOIN_GROUP; - } - else if (type == IP_DROP_MEMBERSHIP) { - type = IPV6_LEAVE_GROUP; - } - else { - return APR_ENOTIMPL; + else { + if (sock_is_ipv4(sock)) { + + fill_mip_v4(&mip4, mcast, iface); + + if (setsockopt(sock->socketdes, IPPROTO_IP, type, + (const void *) &mip4, sizeof(mip4)) == -1) { + rv = errno; + } } +#if APR_HAVE_IPV6 + else if (sock_is_ipv6(sock)) { + if (type == IP_ADD_MEMBERSHIP) { + type = IPV6_JOIN_GROUP; + } + else if (type == IP_DROP_MEMBERSHIP) { + type = IPV6_LEAVE_GROUP; + } + else { + return APR_ENOTIMPL; + } - fill_mip_v6(&mip6, mcast, iface); + fill_mip_v6(&mip6, mcast, iface); - if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - &mip6, sizeof(mip6)) == -1) { - rv = errno; + if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, + &mip6, sizeof(mip6)) == -1) { + rv = errno; + } } - } #endif - else { - rv = APR_ENOTIMPL; + else { + rv = APR_ENOTIMPL; + } } return rv; } @@ -183,7 +212,7 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, apr_byte_t value) { apr_status_t rv = APR_SUCCESS; - + rv = mcast_check_type(sock); if (rv != APR_SUCCESS) { @@ -192,7 +221,7 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, if (sock_is_ipv4(sock)) { if (setsockopt(sock->socketdes, IPPROTO_IP, type, - (const void *)&value, sizeof(value)) == -1) { + (const void *) &value, sizeof(value)) == -1) { rv = errno; } } @@ -201,7 +230,7 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, unsigned int loopopt = value; type = IPV6_MULTICAST_LOOP; if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - &loopopt, sizeof(loopopt)) == -1) { + &loopopt, sizeof(loopopt)) == -1) { rv = errno; } } @@ -213,8 +242,8 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, return APR_ENOTIMPL; } - if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - &value, sizeof(value)) == -1) { + if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, + &value, sizeof(value)) == -1) { rv = errno; } } @@ -229,10 +258,10 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, apr_sockaddr_t *join, apr_sockaddr_t *iface, - apr_sockaddr_t *ssm) + apr_sockaddr_t *source) { #ifdef IP_ADD_MEMBERSHIP - return do_mcast(IP_ADD_MEMBERSHIP, sock, join, iface, ssm); + return do_mcast(IP_ADD_MEMBERSHIP, sock, join, iface, source); #else return APR_ENOTIMPL; #endif @@ -241,17 +270,16 @@ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, apr_sockaddr_t *leave, apr_sockaddr_t *iface, - apr_sockaddr_t *ssm) + apr_sockaddr_t *source) { #ifdef IP_DROP_MEMBERSHIP - return do_mcast(IP_DROP_MEMBERSHIP, sock, leave, iface, ssm); + return do_mcast(IP_DROP_MEMBERSHIP, sock, leave, iface, source); #else return APR_ENOTIMPL; #endif } -APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, - apr_byte_t ttl) +APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, apr_byte_t ttl) { #ifdef IP_MULTICAST_TTL return do_mcast_opt(IP_MULTICAST_TTL, sock, ttl); @@ -260,7 +288,7 @@ APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, #endif } -APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock, +APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock, apr_byte_t opt) { #ifdef IP_MULTICAST_LOOP @@ -278,16 +306,16 @@ APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock, if (sock_is_ipv4(sock)) { if (setsockopt(sock->socketdes, IPPROTO_IP, IP_MULTICAST_IF, - (const void *)&iface->sa.sin.sin_addr, - sizeof(iface->sa.sin.sin_addr)) == -1) { + (const void *) &iface->sa.sin.sin_addr, + sizeof(iface->sa.sin.sin_addr)) == -1) { rv = errno; } } #if APR_HAVE_IPV6 else if (sock_is_ipv6(sock)) { unsigned int idx = find_if_index(iface); - if (setsockopt(sock->socketdes, IPPROTO_IPV6, IPV6_MULTICAST_IF, - &idx, sizeof(idx)) == -1) { + if (setsockopt(sock->socketdes, IPPROTO_IPV6, IPV6_MULTICAST_IF, + &idx, sizeof(idx)) == -1) { rv = errno; } } From 0d7ba71aba6e9ba4203da4d5a787bdfed8993045 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Mon, 10 Jan 2005 07:49:12 +0000 Subject: [PATCH 5278/7878] Add missing apr_proc_mutex_cleanup function call. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124774 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/proc_mutex.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index b6e55d83f38..7733ad8e5c8 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -67,7 +67,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, #endif if (!hMutex) { - return apr_get_os_error(); + return apr_get_os_error(); } *mutex = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); @@ -111,7 +111,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, #endif if (!hMutex) { - return apr_get_os_error(); + return apr_get_os_error(); } *mutex = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); @@ -166,6 +166,11 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return stat; } +APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex) +{ + return apr_proc_mutex_destroy((apr_proc_mutex_t *)mutex); +} + APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) { return NULL; From a8389f3910b3f395f63396628be791419f73ffe4 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Mon, 10 Jan 2005 07:52:01 +0000 Subject: [PATCH 5279/7878] Untabify source. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124775 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/proc_mutex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 7733ad8e5c8..a2505989371 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -67,7 +67,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, #endif if (!hMutex) { - return apr_get_os_error(); + return apr_get_os_error(); } *mutex = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); @@ -111,7 +111,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, #endif if (!hMutex) { - return apr_get_os_error(); + return apr_get_os_error(); } *mutex = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); From f6aa7992e93da3ce7e1555a1d2da99a95e503177 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 10 Jan 2005 16:21:25 +0000 Subject: [PATCH 5280/7878] * configure.in: Aggregate some AC_CHECK_FUNCS usage. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124808 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 1326b645e3f..7b3ab3552e9 100644 --- a/configure.in +++ b/configure.in @@ -861,15 +861,14 @@ AC_SUBST(sharedmem) dnl ----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) -AC_CHECK_FUNCS(alloca calloc setsid isinf isnan) -AC_CHECK_FUNCS(getenv putenv setenv unsetenv) +AC_CHECK_FUNCS([alloca calloc setsid isinf isnan \ + getenv putenv setenv unsetenv \ + writev getifaddrs utime utimes]) AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) -AC_CHECK_FUNCS(writev) sendfile="0" AC_CHECK_LIB(sendfile, sendfilev) AC_CHECK_FUNCS(sendfile send_file sendfilev, [ sendfile="1" ]) -AC_CHECK_FUNCS(utime utimes) dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a dnl threaded poll() and we don't want to use sendfile on early FreeBSD @@ -1898,9 +1897,6 @@ AC_SUBST(have_sctp) AC_CHECK_FUNCS(set_h_errno) -dnl Used in the Multicast Code -AC_CHECK_FUNCS(getifaddrs) - echo "${nl}Checking for IPv6 Networking support..." dnl Start of checking for IPv6 support... From cb1370c5841786aa4fca22d32a833d029f36fd1e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 10 Jan 2005 16:36:56 +0000 Subject: [PATCH 5281/7878] * network_io/unix/multicast.c: Use #ifdef not #if for HAVE_GETIFADDRS. (find_if_index): Fix unused variables warnings if HAVE_GETIFADDRS is undefined. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124813 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/multicast.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index ba92bb9f400..695500f196b 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -19,7 +19,7 @@ #include "apr_portable.h" #include "apr_arch_inherit.h" -#if HAVE_GETIFADDRS +#ifdef HAVE_GETIFADDRS #include #include #endif @@ -59,6 +59,7 @@ static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast, static unsigned int find_if_index(const apr_sockaddr_t *iface) { unsigned int index = 0; +#ifdef HAVE_GETIFADDRS struct ifaddrs *ifp, *ifs; /** @@ -69,7 +70,6 @@ static unsigned int find_if_index(const apr_sockaddr_t *iface) * getifaddrs. The license is acceptable, but, It is a fairly large * chunk of code. */ -#if HAVE_GETIFADDRS if (getifaddrs(&ifs) != 0) { return 0; } From d1bccd01a1bf4096797209464cbfae1a0c4c3f90 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 10 Jan 2005 16:43:35 +0000 Subject: [PATCH 5282/7878] Format consistently. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124815 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/CHANGES b/CHANGES index 94e599d8177..c37f27f4274 100644 --- a/CHANGES +++ b/CHANGES @@ -1,17 +1,15 @@ Changes for APR 1.1.0 - *) Add Support for Source-Specific Multicast. [Colm MacCarthaigh] + *) Add APR Multicast functions; including support for + Source-Specific Multicast from Colm MacCarthaigh. [Paul Querna] - *) Add APR Multicast Functions [Paul Querna] - - *) Add a build script to create a solaris package. [Graham Leggett] + *) Add a build script to create a solaris package. [Graham Leggett] - *) Add support for APR_TCP_DEFER_ACCEPT. - [Paul Querna] + *) Add support for APR_TCP_DEFER_ACCEPT. [Paul Querna] - *) rename the apr_file_permissions defines (APR_UREAD, - APR_UWRITE, etc.) to have prefix APR_FPROT_ (keeping the - old defines) [Stas] + *) Rename the apr_file_permissions macros (APR_UREAD, APR_UWRITE etc.) + to have prefix APR_FPROT_ (old names kept for compatibility). + [Stas Bekman] *) Emit the run-time link path option in apr-config after installation if the user is linking with libtool. [Justin Erenkrantz] @@ -22,25 +20,19 @@ Changes for APR 1.1.0 *) Remove the runtime test for Sendfile versions on FreeBSD. PR 25718. [Mike Silbersack , Paul Querna] - *) rename the fopen defines (APR_READ, APR_WRITE, etc.) to have - prefix APR_FOPEN_ (keeping the old defines) [Stas] - - *) [NOT COMMITTED?] Add a new PRNG. Note that the implementation of SHA-256 - is a stop-gap pending snarfing the SHA-1 implementation from apr-util - and upgrading it to do SHA-256. Not yet ready for prime time. - [Ben Laurie] + *) Rename the apr_file_open macros (APR_READ, APR_WRITE, etc.) to + have prefix APR_FOPEN_ (old names kept for compatibility). + [Stas Bekman] *) Added apr_os_uuid_get() support for Linux via libuuid and for modern - BSDs which have uuid_create as part of their libc. - [Paul Querna] + BSDs which have uuid_create as part of their libc. [Paul Querna] *) Added Solaris 10 'Event Ports' as a backend for APR Pollset. This - backend also supports the APR_POLLSET_THREADSAFE flag. - [Paul Querna] + backend also supports the APR_POLLSET_THREADSAFE flag. [Paul Querna] *) Added the APR_POLLSET_THREADSAFE flag. This allows multiple threads to call the Pollset Add or Remove functions in a thread safe manner. - Currently only EPoll and KQueue support this flag. [Paul Querna] + Currently only EPoll and KQueue support this flag. [Paul Querna] *) Split poll/unix/poll.c into separate files for each Poll or Pollset implementation. [Paul Querna] From b6d07d6f575fa448c80fb50202de9f2ae9ee0cfd Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Tue, 11 Jan 2005 07:57:42 +0000 Subject: [PATCH 5283/7878] Arrange -l logic. (-l apr-1 should be -lapr-1) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124899 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index d24b8d44eb1..c2bb891636f 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -969,6 +969,7 @@ void add_dylink_noinstall(count_chars *cc, const char *arg, int pathlen, /* use -L -llibname to allow to use installed libraries */ void add_minus_l(count_chars *cc, const char *arg) { + char *newarg; char *name = strrchr(arg, '/'); char *file = strrchr(arg, '.'); char *lib = strstr(name, "lib"); @@ -978,10 +979,13 @@ void add_minus_l(count_chars *cc, const char *arg) *file = '\0'; file = name; file = file+4; - push_count_chars(cc, "-L "); - push_count_chars(cc, arg); - push_count_chars(cc, "-l"); - push_count_chars(cc, file); + push_count_chars(cc, "-L"); + push_count_chars(cc, arg); + /* we need one argument like -lapr-1 */ + newarg = malloc(strlen(file) + 3); + strcpy(newarg, "-l"); + strcat(newarg, file); + push_count_chars(cc, newarg); } else { push_count_chars(cc, arg); } @@ -993,9 +997,9 @@ void add_linker_flag_prefix(count_chars *cc, const char *arg) push_count_chars(cc, arg); #else char *newarg; - newarg = (char*)malloc(strlen(arg) + sizeof(LINKER_FLAG_PREFIX)); + newarg = (char*)malloc(strlen(arg) + sizeof(LINKER_FLAG_PREFIX) + 1); strcpy(newarg, LINKER_FLAG_PREFIX); - strcpy(newarg, arg); + strcat(newarg, arg); push_count_chars(cc, newarg); #endif } From 4bb585655a039bb4a5edcec03f5f0f86a80af540 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Wed, 12 Jan 2005 15:59:27 +0000 Subject: [PATCH 5284/7878] Add support for the -R dir and -Rdir of libtool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@124971 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build/jlibtool.c b/build/jlibtool.c index c2bb891636f..39520aad03b 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -251,6 +251,10 @@ typedef struct { const char *version_info; } command_t; +#ifdef RPATH +void add_rpath(count_chars *cc, const char *path); +#endif + #if defined(NEED_SNPRINTF) /* Write at most n characters to the buffer in str, return the * number of chars written or -1 if the buffer would have been @@ -455,6 +459,16 @@ void print_config() printf("SHELL=\"%s\"\n", SHELL_CMD); #endif } +/* + * Add a directory to the runtime library search path. + */ +void add_runtimedirlib(char *arg, command_t *cmd_data) +{ +#ifdef RPATH + add_rpath(cmd_data->shared_opts.dependencies, arg); +#else +#endif +} int parse_long_opt(char *arg, command_t *cmd_data) { @@ -555,6 +569,10 @@ int parse_short_opt(char *arg, command_t *cmd_data) arg--; push_count_chars(cmd_data->shared_opts.dependencies, arg); return 1; + } else if (arg[0] == 'R' && arg[1]) { + /* -Rdir Add dir to runtime library search path. */ + add_runtimedirlib(&arg[1], cmd_data); + return 1; } } return 0; @@ -1283,6 +1301,10 @@ void parse_args(int argc, char *argv[], command_t *cmd_data) /* Skip the argument. */ ++a; argused = 1; + } else if (arg[1] == 'R' && !arg[2]) { + /* -R dir Add dir to runtime library search path. */ + add_runtimedirlib(argv[++a], cmd_data); + argused = 1; } } } else { From b937d241260840aeb0561a57063f83e4fb0e5c8c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 13 Jan 2005 10:48:22 +0000 Subject: [PATCH 5285/7878] * configure.in: Require autoconf 2.50. Use AC_CHECK_MEMBERS to check for struct tm members tm_gmtoff and __tm_gmtoff (the check for __tm_gmtoff seemed to be missing!). * time/unix/time.c: Define NO_GMTOFF_IN_STRUCT_TM if neither member is found. (get_offset, apr_os_exp_time_get, apr_os_exp_time_put): Use new macro names. (apr_unix_setup_time): Use NO_GMTOFF_IN_STRUCT_TM. * time/unix/timestr.c (apr_strftime): Use new macro names. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125058 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 12 +++++------- time/unix/time.c | 25 +++++++++++++------------ time/unix/timestr.c | 6 +++--- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/configure.in b/configure.in index 7b3ab3552e9..178005ac79e 100644 --- a/configure.in +++ b/configure.in @@ -4,6 +4,8 @@ dnl dnl Process this file with autoconf to produce a configure script. dnl Use ./buildconf to prepare build files and run autoconf for APR. +AC_PREREQ(2.50) + AC_INIT(build/apr_common.m4) AC_CONFIG_HEADER(include/arch/unix/apr_private.h) AC_CONFIG_AUX_DIR(build) @@ -1804,14 +1806,10 @@ AC_SUBST(osuuid) dnl ----------------------------- Checking for Time Support echo "${nl}Checking for Time Support..." -AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, -[AC_TRY_COMPILE([#include -#include ], [struct tm tm; tm.tm_gmtoff;], - ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) -if test "$ac_cv_struct_tm_gmtoff" = "yes"; then - AC_DEFINE(HAVE_GMTOFF, 1, [Define if struct tm has a tm_gmtoff field]) -fi +AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.__tm_gmtoff],,,[ +#include +#include ]) dnl ----------------------------- Checking for Networking Support echo "${nl}Checking for Networking support..." diff --git a/time/unix/time.c b/time/unix/time.c index 507d7101478..b005cf67b25 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -1,4 +1,4 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,15 +34,16 @@ #endif /* End System Headers */ -#if !defined(HAVE_GMTOFF) && !defined(HAVE___OFFSET) +#if !defined(HAVE_STRUCT_TM_TM_GMTOFF) && !defined(HAVE_STRUCT_TM___TM_GMTOFF) static apr_int32_t server_gmt_offset; -#endif /* if !defined(HAVE_GMTOFF) && !defined(HAVE___OFFSET) */ +#define NO_GMTOFF_IN_STRUCT_TM +#endif static apr_int32_t get_offset(struct tm *tm) { -#ifdef HAVE_GMTOFF +#if defined(HAVE_STRUCT_TM_TM_GMTOFF) return tm->tm_gmtoff; -#elif defined(HAVE___OFFSET) +#elif defined(HAVE_STRUCT_TM___TM_GMTOFF) return tm->__tm_gmtoff; #else #ifdef NETWARE @@ -54,7 +55,7 @@ static apr_int32_t get_offset(struct tm *tm) return server_gmt_offset + daylightOffset; } #else - if(tm->tm_isdst) + if (tm->tm_isdst) return server_gmt_offset + 3600; #endif return server_gmt_offset; @@ -189,9 +190,9 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, (*ostime)->tm_yday = aprtime->tm_yday; (*ostime)->tm_isdst = aprtime->tm_isdst; -#if HAVE_GMTOFF +#if defined(HAVE_STRUCT_TM_TM_GMTOFF) (*ostime)->tm_gmtoff = aprtime->tm_gmtoff; -#elif defined(HAVE__OFFSET) +#elif defined(HAVE_STRUCT_TM___TM_GMTOFF) (*ostime)->__tm_gmtoff = aprtime->tm_gmtoff; #endif @@ -220,9 +221,9 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, aprtime->tm_yday = (*ostime)->tm_yday; aprtime->tm_isdst = (*ostime)->tm_isdst; -#if HAVE_GMTOFF +#if defined(HAVE_STRUCT_TM_TM_GMTOFF) aprtime->tm_gmtoff = (*ostime)->tm_gmtoff; -#elif defined(HAVE__OFFSET) +#elif defined(HAVE_STRUCT_TM___TM_GMTOFF) aprtime->tm_gmtoff = (*ostime)->__tm_gmtoff; #endif @@ -276,7 +277,7 @@ APR_DECLARE(void) apr_netware_setup_time(void) #else APR_DECLARE(void) apr_unix_setup_time(void) { -#if !defined(HAVE_GMTOFF) && !defined(HAVE___OFFSET) +#ifdef NO_GMTOFF_IN_STRUCT_TM /* Precompute the offset from GMT on systems where it's not in struct tm. @@ -316,7 +317,7 @@ APR_DECLARE(void) apr_unix_setup_time(void) t.tm_isdst = 0; /* we know this GMT time isn't daylight-savings */ t2 = mktime(&t); server_gmt_offset = (apr_int32_t) difftime(t1, t2); -#endif +#endif /* NO_GMTOFF_IN_STRUCT_TM */ } #endif diff --git a/time/unix/timestr.c b/time/unix/timestr.c index b7a90164e23..06015ab660d 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -1,4 +1,4 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -142,9 +142,9 @@ apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, tm.tm_wday = xt->tm_wday; tm.tm_yday = xt->tm_yday; tm.tm_isdst = xt->tm_isdst; -#if defined(HAVE_GMTOFF) +#if defined(HAVE_STRUCT_TM_TM_GMTOFF) tm.tm_gmtoff = xt->tm_gmtoff; -#elif defined(HAVE___OFFSET) +#elif defined(HAVE_STRUCT_TM___TM_GMTOFF) tm.__tm_gmtoff = xt->tm_gmtoff; #endif (*retsize) = strftime(s, max, format, &tm); From f6fc492f99479d114580338d5584fe71cafd090f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 13 Jan 2005 11:15:04 +0000 Subject: [PATCH 5286/7878] * acconfig.h: Remove file. * configure.in: Use autoheader AH_BOTTOM macro to hard-code tail end of apr_private.h. * threadproc/unix/signals.c (apr_sigwait): Define here rather than in apr_private.h since it's only used here. * build/apr_common.m4 (APR_DECIDE): AC_DEFUN the macro, use AH_TEMPLATE to define the template for apr_private.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125062 13f79535-47bb-0310-9956-ffa450edef68 --- acconfig.h | 39 --------------------------------------- build/apr_common.m4 | 4 +++- configure.in | 21 +++++++++++++++++++++ threadproc/unix/signals.c | 8 +++++++- 4 files changed, 31 insertions(+), 41 deletions(-) delete mode 100644 acconfig.h diff --git a/acconfig.h b/acconfig.h deleted file mode 100644 index 28ac63aa1f5..00000000000 --- a/acconfig.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef APR_PRIVATE_H -#define APR_PRIVATE_H - -@TOP@ - -/* Various #defines we need to know about */ -#undef EGD_DEFAULT_SOCKET - -/* Cross process serialization techniques */ -#undef USE_FLOCK_SERIALIZE -#undef USE_SYSVSEM_SERIALIZE -#undef USE_FCNTL_SERIALIZE -#undef USE_PROC_PTHREAD_SERIALIZE -#undef USE_PTHREAD_SERIALIZE - -@BOTTOM@ - -/* Make sure we have ssize_t defined to be something */ -#undef ssize_t - -/* switch this on if we have a BeOS version below BONE */ -#if BEOS && !HAVE_BONE_VERSION -#define BEOS_R5 1 -#else -#define BEOS_BONE 1 -#endif - -#ifdef SIGWAIT_TAKES_ONE_ARG -#define apr_sigwait(a,b) ((*(b)=sigwait((a)))<0?-1:0) -#else -#define apr_sigwait(a,b) sigwait((a),(b)) -#endif - -/* - * Include common private declarations. - */ -#include "../apr_private_common.h" - -#endif /* APR_PRIVATE_H */ diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 8dd0ac156ec..82d3e087c6c 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -379,7 +379,9 @@ ac_decision='' ]) -define(APR_DECIDE,[dnl +AC_DEFUN([APR_DECIDE],[dnl +dnl Define the flag (or not) in apr_private.h via autoheader +AH_TEMPLATE($1, [Define if $2 will be used]) ac_decision='$1' ac_decision_msg='$2' ac_decision_$1=yes diff --git a/configure.in b/configure.in index 178005ac79e..f4dfeecfc60 100644 --- a/configure.in +++ b/configure.in @@ -20,6 +20,27 @@ sinclude(build/apr_hints.m4) sinclude(build/libtool.m4) sinclude(build/ltsugar.m4) +dnl Hard-coded inclusion at the tail end of apr_private.h: +AH_BOTTOM([ +/* switch this on if we have a BeOS version below BONE */ +#if BEOS && !HAVE_BONE_VERSION +#define BEOS_R5 1 +#else +#define BEOS_BONE 1 +#endif + +#ifdef SIGWAIT_TAKES_ONE_ARG +#define apr_sigwait(a,b) ((*(b)=sigwait((a)))<0?-1:0) +#else +#define apr_sigwait(a,b) sigwait((a),(b)) +#endif + +/* + * Include common private declarations. + */ +#include "../apr_private_common.h" +]) + dnl Save user-defined environment settings for later restoration dnl APR_SAVE_THE_ENVIRONMENT(CPPFLAGS) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 7ecac1b97f9..4b8f2af97ba 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -1,4 +1,4 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,12 @@ #include #endif +#ifdef SIGWAIT_TAKES_ONE_ARG +#define apr_sigwait(a,b) ((*(b)=sigwait((a)))<0?-1:0) +#else +#define apr_sigwait(a,b) sigwait((a),(b)) +#endif + APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signum) { #ifdef OS2 From 3dab9458b5b7da9045503331a53f4817ec99ed52 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 13 Jan 2005 11:17:38 +0000 Subject: [PATCH 5287/7878] * build/buildcheck.sh: Require autoconf 2.50 or later. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125063 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index cd1d593aa4a..10a68d12856 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -14,18 +14,18 @@ py_version=`python -c 'import sys; print sys.version' 2>&1|sed 's/ .*//;q'` echo "buildconf: python version $py_version (ok)" fi -# autoconf 2.13 or newer +# autoconf 2.50 or newer ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;q'` if test -z "$ac_version"; then echo "buildconf: autoconf not found." -echo " You need autoconf version 2.13 or newer installed" +echo " You need autoconf version 2.50 or newer installed" echo " to build Apache from CVS." exit 1 fi IFS=.; set $ac_version; IFS=' ' -if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then +if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then echo "buildconf: autoconf version $ac_version found." -echo " You need autoconf version 2.13 or newer installed" +echo " You need autoconf version 2.50 or newer installed" echo " to build Apache from CVS." exit 1 else From 9f0d5ae428eaebe312c2bc2ee5a6bc63575735a0 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 13 Jan 2005 11:20:53 +0000 Subject: [PATCH 5288/7878] * build/*apr*.m4: Add copyright headers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125064 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 18 +++++++++++++++++- build/apr_hints.m4 | 15 +++++++++++++++ build/apr_network.m4 | 15 +++++++++++++++ build/apr_threads.m4 | 15 +++++++++++++++ build/find_apr.m4 | 15 +++++++++++++++ 5 files changed, 77 insertions(+), 1 deletion(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 82d3e087c6c..8298022abb6 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -1,7 +1,23 @@ -dnl ----------------------------------------------------------------- +dnl -------------------------------------------------------- -*- autoconf -*- +dnl Copyright 2000-2005 The Apache Software Foundation +dnl +dnl Licensed under the Apache License, Version 2.0 (the "License"); +dnl you may not use this file except in compliance with the License. +dnl You may obtain a copy of the License at +dnl +dnl http://www.apache.org/licenses/LICENSE-2.0 +dnl +dnl Unless required by applicable law or agreed to in writing, software +dnl distributed under the License is distributed on an "AS IS" BASIS, +dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +dnl See the License for the specific language governing permissions and +dnl limitations under the License. + +dnl dnl apr_common.m4: APR's general-purpose autoconf macros dnl +dnl dnl APR_CONFIG_NICE(filename) dnl dnl Saves a snapshot of the configure command-line for later reuse diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index edd5f9770f2..15c470c695d 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -1,3 +1,18 @@ +dnl -------------------------------------------------------- -*- autoconf -*- +dnl Copyright 2000-2005 The Apache Software Foundation +dnl +dnl Licensed under the Apache License, Version 2.0 (the "License"); +dnl you may not use this file except in compliance with the License. +dnl You may obtain a copy of the License at +dnl +dnl http://www.apache.org/licenses/LICENSE-2.0 +dnl +dnl Unless required by applicable law or agreed to in writing, software +dnl distributed under the License is distributed on an "AS IS" BASIS, +dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +dnl See the License for the specific language governing permissions and +dnl limitations under the License. + dnl ----------------------------------------------------------------- dnl apr_hints.m4: APR's autoconf macros for platform-specific hints dnl diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 5d9c8e740e5..a16cf793099 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -1,3 +1,18 @@ +dnl -------------------------------------------------------- -*- autoconf -*- +dnl Copyright 2000-2005 The Apache Software Foundation +dnl +dnl Licensed under the Apache License, Version 2.0 (the "License"); +dnl you may not use this file except in compliance with the License. +dnl You may obtain a copy of the License at +dnl +dnl http://www.apache.org/licenses/LICENSE-2.0 +dnl +dnl Unless required by applicable law or agreed to in writing, software +dnl distributed under the License is distributed on an "AS IS" BASIS, +dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +dnl See the License for the specific language governing permissions and +dnl limitations under the License. + dnl ----------------------------------------------------------------- dnl apr_network.m4: APR's autoconf macros for testing network support dnl diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index 80f7f2eb67d..6fd1e2348ed 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -1,3 +1,18 @@ +dnl -------------------------------------------------------- -*- autoconf -*- +dnl Copyright 2000-2005 The Apache Software Foundation +dnl +dnl Licensed under the Apache License, Version 2.0 (the "License"); +dnl you may not use this file except in compliance with the License. +dnl You may obtain a copy of the License at +dnl +dnl http://www.apache.org/licenses/LICENSE-2.0 +dnl +dnl Unless required by applicable law or agreed to in writing, software +dnl distributed under the License is distributed on an "AS IS" BASIS, +dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +dnl See the License for the specific language governing permissions and +dnl limitations under the License. + dnl ----------------------------------------------------------------- dnl apr_threads.m4: APR's autoconf macros for testing thread support dnl diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 555fca59ed8..54e339f7474 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -1,3 +1,18 @@ +dnl -------------------------------------------------------- -*- autoconf -*- +dnl Copyright 2000-2005 The Apache Software Foundation +dnl +dnl Licensed under the Apache License, Version 2.0 (the "License"); +dnl you may not use this file except in compliance with the License. +dnl You may obtain a copy of the License at +dnl +dnl http://www.apache.org/licenses/LICENSE-2.0 +dnl +dnl Unless required by applicable law or agreed to in writing, software +dnl distributed under the License is distributed on an "AS IS" BASIS, +dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +dnl See the License for the specific language governing permissions and +dnl limitations under the License. + dnl dnl find_apr.m4 : locate the APR include files and libraries dnl From 0bc03a44d5294d45a10b169ddb150c09bfbe4ecb Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 13 Jan 2005 11:22:01 +0000 Subject: [PATCH 5289/7878] * configure.in: Really don't define apr_sigwait in apr_private.h any more. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125066 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 ------ 1 file changed, 6 deletions(-) diff --git a/configure.in b/configure.in index f4dfeecfc60..72ced022ed8 100644 --- a/configure.in +++ b/configure.in @@ -29,12 +29,6 @@ AH_BOTTOM([ #define BEOS_BONE 1 #endif -#ifdef SIGWAIT_TAKES_ONE_ARG -#define apr_sigwait(a,b) ((*(b)=sigwait((a)))<0?-1:0) -#else -#define apr_sigwait(a,b) sigwait((a),(b)) -#endif - /* * Include common private declarations. */ From 1a406d1cb15eee7f4550075420af0a1f88e1183b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 13 Jan 2005 11:43:52 +0000 Subject: [PATCH 5290/7878] * build/find_apr.m4 (APR_FIND_APR): Do look for apr-config in the default APR installation prefix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125069 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 54e339f7474..d8a29dd81c0 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -148,8 +148,8 @@ AC_DEFUN([APR_FIND_APR], [ apr_config="$apr_temp_apr_config_file" break else - dnl look in some standard places (apparently not in builtin/default) - for lookdir in /usr /usr/local /opt/apr /usr/local/apache2 ; do + dnl look in some standard places + for lookdir in /usr /usr/local /usr/local/apr /opt/apr /usr/local/apache2; do if $TEST_X "$lookdir/bin/$apr_temp_apr_config_file"; then apr_found="yes" apr_config="$lookdir/bin/$apr_temp_apr_config_file" From 2c4875b15d0fd7b38c664b1dd54020d64b1634b8 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 13 Jan 2005 12:08:10 +0000 Subject: [PATCH 5291/7878] * locks/unix/proc_mutex.c (proc_mutex_posix_create): Drop unnecessary casts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125073 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 2e614b2322f..e7a70a44c5c 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -95,18 +95,18 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, sec = apr_time_sec(now); usec = apr_time_usec(now); apr_snprintf(semname, sizeof(semname), "/ApR.%lxZ%lx", sec, usec); - psem = sem_open((const char *) semname, O_CREAT, 0644, 1); + psem = sem_open(semname, O_CREAT, 0644, 1); if ((psem == (sem_t *)SEM_FAILED) && (errno == ENAMETOOLONG)) { /* Oh well, good try */ semname[13] = '\0'; - psem = sem_open((const char *) semname, O_CREAT, 0644, 1); + psem = sem_open(semname, O_CREAT, 0644, 1); } if (psem == (sem_t *)SEM_FAILED) { return errno; } /* Ahhh. The joys of Posix sems. Predelete it... */ - sem_unlink((const char *) semname); + sem_unlink(semname); new_mutex->psem_interproc = psem; new_mutex->fname = apr_pstrdup(new_mutex->pool, semname); apr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, From 0d349a720896c534c15acf31421dccda3e3ba525 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 13 Jan 2005 13:51:14 +0000 Subject: [PATCH 5292/7878] * build/buildcheck.sh: Require libtool 1.4 or newer. s/Apache/APR/ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125076 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 10a68d12856..9694ef7de2e 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -19,14 +19,14 @@ ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[ if test -z "$ac_version"; then echo "buildconf: autoconf not found." echo " You need autoconf version 2.50 or newer installed" -echo " to build Apache from CVS." +echo " to build APR from CVS." exit 1 fi IFS=.; set $ac_version; IFS=' ' if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then echo "buildconf: autoconf version $ac_version found." echo " You need autoconf version 2.50 or newer installed" -echo " to build Apache from CVS." +echo " to build APR from CVS." exit 1 else echo "buildconf: autoconf version $ac_version (ok)" @@ -37,27 +37,21 @@ fi # ltmain.sh (GNU libtool 1.1361 2004/01/02 23:10:52) 1.5a # output is multiline from 1.5 onwards -# Require libtool 1.3.3 or newer +# Require libtool 1.4 or newer libtool=`build/PrintPath glibtool libtool libtool15 libtool14` lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` if test -z "$lt_pversion"; then echo "buildconf: libtool not found." echo " You need libtool version 1.3.3 or newer installed" -echo " to build Apache from CVS." +echo " to build APR from CVS." exit 1 fi lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` IFS=.; set $lt_version; IFS=' ' lt_status="good" if test "$1" = "1"; then - if test "$2" -lt "3"; then + if test "$2" -lt "4"; then lt_status="bad" - else - if test "$2" = "3"; then - if test -z "$3" -o "$3" = "1" -o "$3" = "2"; then - lt_status="bad" - fi - fi fi fi if test $lt_status = "good"; then @@ -66,7 +60,7 @@ if test $lt_status = "good"; then fi echo "buildconf: libtool version $lt_pversion found." -echo " You need libtool version 1.3.3 or newer installed" -echo " to build Apache from CVS." +echo " You need libtool version 1.4 or newer installed" +echo " to build APR from CVS." exit 1 From 622f7c506f1b9d7ce5b312e316155570188a70b7 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Fri, 14 Jan 2005 10:16:31 +0000 Subject: [PATCH 5293/7878] Print the version number that is really required for apr, (and not the version number for the 'libtool --version' detection method) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125161 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 9694ef7de2e..f24fa74c0b1 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -42,7 +42,7 @@ libtool=`build/PrintPath glibtool libtool libtool15 libtool14` lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` if test -z "$lt_pversion"; then echo "buildconf: libtool not found." -echo " You need libtool version 1.3.3 or newer installed" +echo " You need libtool version 1.4 or newer installed" echo " to build APR from CVS." exit 1 fi From d262daeaee7677efc706ffed3b5ed9e69026d209 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Fri, 14 Jan 2005 10:20:31 +0000 Subject: [PATCH 5294/7878] Make buildconf work on FreeBSD, where several libtool versions can coexist (libtool13, libtool14, ...), and the libtool.m4 file is named after the libtool version, too (.../aclocal/libtool14.m4). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125162 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/buildconf b/buildconf index b16441f4ab3..789ea682de3 100755 --- a/buildconf +++ b/buildconf @@ -45,8 +45,9 @@ $libtoolize --copy --automake if [ -f libtool.m4 ]; then ltfile=`pwd`/libtool.m4 else - ltpath=`dirname $libtoolize` - ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/libtool.m4} + libtool=`build/PrintPath glibtool libtool libtool15 libtool14` + ltpath=`dirname $libtool` + ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/`basename $libtool`.m4} fi if [ ! -f $ltfile ]; then @@ -54,7 +55,7 @@ if [ ! -f $ltfile ]; then exit 1 fi -echo "buildconf: Using libtool.m4 at ${ltfile}." +echo "buildconf: Using libtool.m4 from ${ltfile}." cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 From cb1ea5b6743c59abf165ea3a5574d6c66c527b6c Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sun, 16 Jan 2005 07:30:46 +0000 Subject: [PATCH 5295/7878] Added apr_procattr_user_set and apr_procattr_group_set to allow setting uid/gid for newly created processes using apr_proc_create. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125349 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + include/apr.h.in | 2 + include/apr.hnw | 2 + include/apr.hw | 2 + include/apr_thread_proc.h | 21 ++++ include/arch/unix/apr_arch_threadproc.h | 2 + include/arch/win32/apr_arch_threadproc.h | 5 + threadproc/beos/proc.c | 13 ++ threadproc/netware/proc.c | 12 ++ threadproc/os2/proc.c | 13 ++ threadproc/unix/proc.c | 52 ++++++++ threadproc/win32/proc.c | 152 +++++++++++++++++++++-- 12 files changed, 272 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index c37f27f4274..eb6a4095865 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.1.0 + *) Added apr_procattr_user_set and apr_procattr_group_set + setting the user and group for new processes. [Mladen Turk] + *) Add APR Multicast functions; including support for Source-Specific Multicast from Colm MacCarthaigh. [Paul Querna] diff --git a/include/apr.h.in b/include/apr.h.in index 47a8495da9b..d1332921dc6 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -227,6 +227,8 @@ extern "C" { #define APR_HAS_XTHREAD_FILES 0 #define APR_HAS_OS_UUID @osuuid@ +#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0 + /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible * to poll on files/pipes. */ diff --git a/include/apr.hnw b/include/apr.hnw index 13a84e6d27c..e8d14dc8b09 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -194,6 +194,8 @@ extern "C" { #define APR_HAS_XTHREAD_FILES 0 #define APR_HAS_OS_UUID 0 +#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0 + /* Netware can poll on files/pipes. */ #define APR_FILES_AS_SOCKETS 1 diff --git a/include/apr.hw b/include/apr.hw index cc26f3aa8d7..fa22e489a71 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -223,9 +223,11 @@ #ifndef _WIN32_WCE #define APR_HAVE_STRICMP 1 #define APR_HAVE_STRNICMP 1 +#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 1 #else #define APR_HAVE_STRICMP 0 #define APR_HAVE_STRNICMP 0 +#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0 #endif /** @} */ diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index db591699f20..fa0b97d3a73 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -529,6 +529,27 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, apr_int32_t addrspace); +/** + * Set the username used for running process + * @param attr The procattr we care about. + * @param username The username used + * @param password User password if needed. Password is needed on WIN32 + * or any other platform having + * APR_PROCATTR_USER_SET_REQUIRES_PASSWORD set. + */ +APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, + const char *username, + const char *password); + +/** + * Set the group used for running process + * @param attr The procattr we care about. + * @param groupname The group name used + */ +APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, + const char *groupname); + + #if APR_HAS_FORK /** * This is currently the only non-portable call in APR. This executes diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h index 6173869b472..c789bca9778 100644 --- a/include/arch/unix/apr_arch_threadproc.h +++ b/include/arch/unix/apr_arch_threadproc.h @@ -97,6 +97,8 @@ struct apr_procattr_t { #endif apr_child_errfn_t *errfn; apr_int32_t errchk; + apr_uid_t uid; + apr_gid_t gid; }; #endif /* ! THREAD_PROC_H */ diff --git a/include/arch/win32/apr_arch_threadproc.h b/include/arch/win32/apr_arch_threadproc.h index f752fd7df4e..ef8340ddddb 100644 --- a/include/arch/win32/apr_arch_threadproc.h +++ b/include/arch/win32/apr_arch_threadproc.h @@ -56,6 +56,11 @@ struct apr_procattr_t { apr_int32_t detached; apr_child_errfn_t *errfn; apr_int32_t errchk; +#ifndef _WIN32_WCE + HANDLE user_token; + LPSECURITY_ATTRIBUTES sa; + LPVOID sd; +#endif }; struct apr_thread_once_t { diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 71dd5a88f21..9f1dd4cbb3b 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -403,3 +403,16 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32 { return APR_ENOTIMPL; } + +APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, + const char *username, + const char *password) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, + const char *groupname) +{ + return APR_ENOTIMPL; +} diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index fa23af6b7ba..7db6659219f 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -435,3 +435,15 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32 return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, + const char *username, + const char *password) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, + const char *groupname) +{ + return APR_ENOTIMPL; +} diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 4edb4522115..7fa9dc7c2da 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -601,3 +601,16 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) { return APR_ENOTIMPL; } + +APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, + const char *username, + const char *password) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, + const char *groupname) +{ + return APR_ENOTIMPL; +} diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 9273c11240e..45e967614e3 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -29,6 +29,7 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, } (*new)->pool = pool; (*new)->cmdtype = APR_PROGRAM; + (*new)->uid = (*new)->gid = -1; return APR_SUCCESS; } @@ -280,6 +281,36 @@ APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, + const char *username, + const char *password) +{ + apr_status_t rv; + apr_gid_t gid; + + if ((rv = apr_uid_get(&attr->uid, &gid, username, + attr->pool)) != APR_SUCCESS) { + attr->uid = -1; + return rv; + } + + /* Use default user group if not already set */ + if (attr->gid == -1) { + attr->gid = gid; + } + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, + const char *groupname) +{ + apr_status_t rv; + + if ((rv = apr_gid_get(&attr->gid, groupname, attr->pool)) != APR_SUCCESS) + attr->gid = -1; + return rv; +} + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, @@ -385,6 +416,27 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } } + /* Only try to switch if we are running as root */ + if (attr->gid != -1 && !geteuid()) { + apr_status_t rv; + if ((status = setgid(attr->gid))) { + if (attr->errfn) { + attr->errfn(pool, errno, "setting of group failed"); + } + exit(-1); /* We have big problems, the child should exit. */ + } + } + + if (attr->uid != -1 && !geteuid()) { + apr_status_t rv; + if ((status = setuid(attr->uid))) { + if (attr->errfn) { + attr->errfn(pool, errno, "setting of user failed"); + } + exit(-1); /* We have big problems, the child should exit. */ + } + } + if ((status = limit_proc(attr)) != APR_SUCCESS) { if (attr->errfn) { attr->errfn(pool, errno, "setting of resource limits failed"); diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 191d682d489..069a8e40950 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -200,6 +200,116 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, return APR_SUCCESS; } +static apr_status_t attr_cleanup(void *theattr) +{ + apr_procattr_t *attr = (apr_procattr_t *)theattr; + if (attr->user_token) + CloseHandle(attr->user_token); + attr->user_token = NULL; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, + const char *username, + const char *password) +{ +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else + HANDLE user; + apr_wchar_t *wusername = NULL; + apr_wchar_t *wpassword = NULL; + apr_status_t rv; + apr_size_t len, wlen; + + if (apr_os_level >= APR_WIN_NT_4) + { + if (attr->user_token) { + /* Cannot set that twice */ + if (attr->errfn) { + attr->errfn(attr->pool, 0, + apr_pstrcat(attr->pool, + "function called twice" + " on username: ", username, NULL)); + } + return APR_EINVAL; + } + len = strlen(username) + 1; + wlen = len; + wusername = apr_palloc(attr->pool, wlen * sizeof(apr_wchar_t)); + if ((rv = apr_conv_utf8_to_ucs2(username, &len, wusername, &wlen)) + != APR_SUCCESS) { + if (attr->errfn) { + attr->errfn(attr->pool, rv, + apr_pstrcat(attr->pool, + "utf8 to ucs2 conversion failed" + " on username: ", username, NULL)); + } + return rv; + } + len = strlen(password) + 1; + wlen = len; + wpassword = apr_palloc(attr->pool, wlen * sizeof(apr_wchar_t)); + if ((rv = apr_conv_utf8_to_ucs2(password, &len, wpassword, &wlen)) + != APR_SUCCESS) { + if (attr->errfn) { + attr->errfn(attr->pool, rv, + apr_pstrcat(attr->pool, + "utf8 to ucs2 conversion failed" + " on password: ", password, NULL)); + } + return rv; + } + if (!LogonUserW(wusername, + NULL, + wpassword, + LOGON32_LOGON_NETWORK, + LOGON32_PROVIDER_DEFAULT, + &user)) { + /* Logon Failed */ + return apr_get_os_error(); + } + memset(wpassword, 0, wlen * sizeof(apr_wchar_t)); + /* Get the primary token for user */ + if (!DuplicateTokenEx(user, + TOKEN_QUERY | TOKEN_DUPLICATE | TOKEN_ASSIGN_PRIMARY, + NULL, + SecurityImpersonation, + TokenPrimary, + &(attr->user_token))) { + /* Failed to duplicate the user token */ + rv = apr_get_os_error(); + CloseHandle(user); + return rv; + } + CloseHandle(user); + + attr->sd = apr_pcalloc(attr->pool, SECURITY_DESCRIPTOR_MIN_LENGTH); + InitializeSecurityDescriptor(attr->sd, SECURITY_DESCRIPTOR_REVISION); + SetSecurityDescriptorDacl(attr->sd, -1, 0, 0); + attr->sa = apr_palloc(attr->pool, sizeof(SECURITY_ATTRIBUTES)); + attr->sa->nLength = sizeof (SECURITY_ATTRIBUTES); + attr->sa->lpSecurityDescriptor = attr->sd; + attr->sa->bInheritHandle = TRUE; + + /* register the cleanup */ + apr_pool_cleanup_register(attr->pool, (void *)attr, + attr_cleanup, + apr_pool_cleanup_null); + return APR_SUCCESS; + } + else + return APR_ENOTIMPL; +#endif +} + +APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, + const char *groupname) +{ + /* Always return SUCCESS cause groups are irrelevant */ + return APR_SUCCESS; +} + static const char* has_space(const char *str) { const char *ch; @@ -614,13 +724,36 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, ? attr->child_err->filehand : INVALID_HANDLE_VALUE; } - rv = CreateProcessW(wprg, wcmd, /* Executable & Command line */ - NULL, NULL, /* Proc & thread security attributes */ - TRUE, /* Inherit handles */ - dwCreationFlags, /* Creation flags */ - pEnvBlock, /* Environment block */ - wcwd, /* Current directory name */ - &si, &pi); + if (attr->user_token) { + si.lpDesktop = L"Winsta0\\Default"; + if (!ImpersonateLoggedOnUser(attr->user_token)) { + /* failed to impersonate the logged user */ + rv = apr_get_os_error(); + CloseHandle(attr->user_token); + attr->user_token = NULL; + return rv; + } + rv = CreateProcessAsUserW(attr->user_token, + wprg, wcmd, + attr->sa, + NULL, + TRUE, + dwCreationFlags, + pEnvBlock, + wcwd, + &si, &pi); + + RevertToSelf(); + } + else { + rv = CreateProcessW(wprg, wcmd, /* Executable & Command line */ + NULL, NULL, /* Proc & thread security attributes */ + TRUE, /* Inherit handles */ + dwCreationFlags, /* Creation flags */ + pEnvBlock, /* Environment block */ + wcwd, /* Current directory name */ + &si, &pi); + } #else rv = CreateProcessW(wprg, wcmd, /* Executable & Command line */ NULL, NULL, /* Proc & thread security attributes */ @@ -754,3 +887,8 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, } return apr_get_os_error(); } + +APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) +{ + return APR_ENOTIMPL; +} From 51d376c1a07f2b42747054bd563cfdd51b4f93b8 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Mon, 17 Jan 2005 10:31:49 +0000 Subject: [PATCH 5296/7878] Remove unused variable declarations. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125405 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 45e967614e3..f6773b14040 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -418,7 +418,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, /* Only try to switch if we are running as root */ if (attr->gid != -1 && !geteuid()) { - apr_status_t rv; if ((status = setgid(attr->gid))) { if (attr->errfn) { attr->errfn(pool, errno, "setting of group failed"); @@ -428,7 +427,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } if (attr->uid != -1 && !geteuid()) { - apr_status_t rv; if ((status = setuid(attr->uid))) { if (attr->errfn) { attr->errfn(pool, errno, "setting of user failed"); From 0928c06c1dd2f5ab5a27a270546156d3a87013cc Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Mon, 17 Jan 2005 10:39:21 +0000 Subject: [PATCH 5297/7878] Use zero length password if supplied password is NULL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125406 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 069a8e40950..7ff680f8c3e 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -247,29 +247,32 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, } return rv; } - len = strlen(password) + 1; - wlen = len; - wpassword = apr_palloc(attr->pool, wlen * sizeof(apr_wchar_t)); - if ((rv = apr_conv_utf8_to_ucs2(password, &len, wpassword, &wlen)) - != APR_SUCCESS) { - if (attr->errfn) { - attr->errfn(attr->pool, rv, - apr_pstrcat(attr->pool, + if (password) { + len = strlen(password) + 1; + wlen = len; + wpassword = apr_palloc(attr->pool, wlen * sizeof(apr_wchar_t)); + if ((rv = apr_conv_utf8_to_ucs2(password, &len, wpassword, &wlen)) + != APR_SUCCESS) { + if (attr->errfn) { + attr->errfn(attr->pool, rv, + apr_pstrcat(attr->pool, "utf8 to ucs2 conversion failed" " on password: ", password, NULL)); + } + return rv; } - return rv; } if (!LogonUserW(wusername, NULL, - wpassword, + wpassword ? wpassword : L"", LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, &user)) { /* Logon Failed */ return apr_get_os_error(); - } - memset(wpassword, 0, wlen * sizeof(apr_wchar_t)); + } + if (wpassword) + memset(wpassword, 0, wlen * sizeof(apr_wchar_t)); /* Get the primary token for user */ if (!DuplicateTokenEx(user, TOKEN_QUERY | TOKEN_DUPLICATE | TOKEN_ASSIGN_PRIMARY, From 4d5902bc59b5d466f3955802e4ed4699ea8d9616 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 17 Jan 2005 11:54:36 +0000 Subject: [PATCH 5298/7878] TODO list for APR 2.0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125410 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/STATUS b/STATUS index b3e5e1268f1..8038d64214d 100644 --- a/STATUS +++ b/STATUS @@ -384,6 +384,21 @@ Documentation that needs writing: should we ever start using any other form of md5 (e.g. openssl) then errors would become a distinct possibility. +API Changes Postponed for APR 2.0: + + * apr_socket_sendfile(): the offset parameter should not be + pass-by-reference, or it should be updated to do something + useful. + + * apr_password_get(): the bufsize parameter should not be + pass-by-reference. + + * apr_allocator.h: apr_memnode_t's use of uint32_t's doesn't match + well with allocation sizes being apr_size_t, possibly this can + be improved by using apr_size_t throughout. + + * apr_hash_count() should take a const apr_hash_t * argument. + Stuff for post 1.0: * Almost every API in APR depends on pools, but pool semantics From 384b546bdca9fe5bc994ff45c9951569912196ca Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Mon, 17 Jan 2005 12:26:58 +0000 Subject: [PATCH 5299/7878] Added detection for XP_SP1, XP_SP2 and 2003. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125411 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_misc.h | 5 ++++- misc/win32/misc.c | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index 171d8f7ca6b..c63d64eb0fc 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -99,7 +99,10 @@ typedef enum { APR_WIN_2000 = 50, APR_WIN_2000_SP1 = 51, APR_WIN_2000_SP2 = 52, - APR_WIN_XP = 60 + APR_WIN_XP = 60, + APR_WIN_XP_SP1 = 61, + APR_WIN_XP_SP2 = 62, + APR_WIN_2003 = 70 } apr_oslevel_e; extern APR_DECLARE_DATA apr_oslevel_e apr_os_level; diff --git a/misc/win32/misc.c b/misc/win32/misc.c index f86746214f6..743580944c7 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -79,8 +79,16 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) else apr_os_level = APR_WIN_2000_SP2; } + else if (oslev.dwMinorVersion == 2) { + apr_os_level = APR_WIN_2003; + } else { - apr_os_level = APR_WIN_XP; + if (servpack < 1) + apr_os_level = APR_WIN_XP; + else if (servpack == 1) + apr_os_level = APR_WIN_XP_SP1; + else + apr_os_level = APR_WIN_XP_SP2; } } else { From 55d484e743d89f2661a4d531000ed29b75c8d3eb Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 17 Jan 2005 14:02:42 +0000 Subject: [PATCH 5300/7878] Temporarily work around a conflict between 0.9 and 1.0 of apr.exp git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125415 13f79535-47bb-0310-9956-ffa450edef68 --- build/pkg/buildpkg.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build/pkg/buildpkg.sh b/build/pkg/buildpkg.sh index 5177ef8c3ab..3c93263a67c 100755 --- a/build/pkg/buildpkg.sh +++ b/build/pkg/buildpkg.sh @@ -52,6 +52,7 @@ fi ./configure --prefix=$PREFIX make make install DESTDIR=$TEMPDIR +rm $TEMPDIR$PREFIX/lib/apr.exp . build/pkg/pkginfo cp build/pkg/pkginfo $TEMPDIR$PREFIX From 996e2b3a9a7baa549e5f4690bb0965c78ac833c3 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 18 Jan 2005 17:44:15 +0000 Subject: [PATCH 5301/7878] NetWare implementation of apr_procattr_user_set() and apr_procattr_group_set() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125520 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 7db6659219f..e72234f74d5 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -439,11 +439,13 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, const char *username, const char *password) { - return APR_ENOTIMPL; + /* Always return SUCCESS because NetWare threads don't run as a user */ + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, const char *groupname) { - return APR_ENOTIMPL; + /* Always return SUCCESS because NetWare threads don't run within a group */ + return APR_SUCCESS; } From 695e49125b97c4ce849d8f4866f6b39e24e5512e Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 18 Jan 2005 17:57:15 +0000 Subject: [PATCH 5302/7878] Win32 support for Multicast Submmited By: Colm MacCarthaigh git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125522 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++++ include/apr.hw | 1 + 2 files changed, 5 insertions(+) diff --git a/apr.dsp b/apr.dsp index 406416b58d9..57bff7e1a2f 100644 --- a/apr.dsp +++ b/apr.dsp @@ -278,6 +278,10 @@ SOURCE=.\poll\unix\select.c # End Source File # Begin Source File +SOURCE=.\network_io\unix\multicast.c +# End Source File +# Begin Source File + SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File diff --git a/include/apr.hw b/include/apr.hw index fa22e489a71..1174a190a51 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -88,6 +88,7 @@ #ifndef _WIN32_WCE #include #include +#include #else #include #endif From f3b49e0c0efe4498eaf33e5451b3d2cf0d35d416 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 18 Jan 2005 21:56:37 +0000 Subject: [PATCH 5303/7878] Implement APR_TCP_DEFER_ACCEPT for NetWare and Win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125552 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockopt.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 05f32b81ea0..be446b0db7f 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -148,6 +148,21 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, } break; } + case APR_TCP_DEFER_ACCEPT: +#if defined(TCP_DEFER_ACCEPT) + if (apr_is_option_set(sock, APR_TCP_DEFER_ACCEPT) != on) { + int optlevel = IPPROTO_TCP; + int optname = TCP_DEFER_ACCEPT; + + if (setsockopt(sock->socketdes, optlevel, optname, + (void *)&on, sizeof(int)) == -1) { + return errno; + } + apr_set_option(sock, APR_TCP_DEFER_ACCEPT, on); + } +#else + return APR_ENOTIMPL; +#endif case APR_TCP_NODELAY: if (apr_is_option_set(sock, APR_TCP_NODELAY) != on) { int optlevel = IPPROTO_TCP; From 33187f9335efe2e1b2d1941ad0e88304b052ea9d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 20 Jan 2005 10:26:58 +0000 Subject: [PATCH 5304/7878] Fix missing quote. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125750 13f79535-47bb-0310-9956-ffa450edef68 --- README.dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.dev b/README.dev index e3ffa6bdd96..03fcc0ed20e 100644 --- a/README.dev +++ b/README.dev @@ -20,7 +20,7 @@ Generating Test Coverage information If you want to generate test coverage data, use the following steps: 1) ./buildconf -2) CFLAGS="-fprofile-arcs -ftest-coverage ./configure +2) CFLAGS="-fprofile-arcs -ftest-coverage" ./configure 3) make 4) cd test 5) make From 0c8776f3ef32c1be509c211e3729dcd5564a3c2a Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Fri, 21 Jan 2005 03:50:34 +0000 Subject: [PATCH 5305/7878] Add Support for DragonFly BSD. PR: #29858 Submitted By: Jeroen Ruigrok git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125880 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 3 ++- include/arch/unix/apr_arch_dso.h | 3 ++- network_io/unix/sendrecv.c | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 2581149fb40..ce94707760a 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -117,7 +117,8 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, #elif defined(DSO_USE_DLFCN) #if defined(OSF1) || defined(SEQUENT) || defined(SNI) ||\ - (defined(__FreeBSD_version) && (__FreeBSD_version >= 220000)) + (defined(__FreeBSD_version) && (__FreeBSD_version >= 220000)) ||\ + defined(__DragonFly__) void *os_handle = dlopen((char *)path, RTLD_NOW | RTLD_GLOBAL); #else diff --git a/include/arch/unix/apr_arch_dso.h b/include/arch/unix/apr_arch_dso.h index 2a1667876e5..30f9f8bf997 100644 --- a/include/arch/unix/apr_arch_dso.h +++ b/include/arch/unix/apr_arch_dso.h @@ -44,7 +44,8 @@ #define RTLD_GLOBAL 0 #endif -#if (defined(__FreeBSD__) ||\ +#if (defined(__DragonFly__) ||\ + defined(__FreeBSD__) ||\ defined(__OpenBSD__) ||\ defined(__NetBSD__) ) && !defined(__ELF__) #define DLSYM_NEEDS_UNDERSCORE diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index f70c84716e7..03d13238569 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -387,7 +387,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, return rv < 0 ? errno : APR_SUCCESS; } -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__DragonFly__) /* Release 3.1 or greater */ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, @@ -406,7 +406,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, hdtr = &no_hdtr; } -#if __FreeBSD_version < 460001 +#if defined(__FreeBSD_version) && __FreeBSD_version < 460001 else if (hdtr->numheaders) { /* On early versions of FreeBSD sendfile, the number of bytes to send @@ -953,6 +953,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, #error APR has detected sendfile on your system, but nobody has written a #error version of it for APR yet. To get past this, either write #error apr_socket_sendfile or change APR_HAS_SENDFILE in apr.h to 0. -#endif /* __linux__, __FreeBSD__, __HPUX__, _AIX, __MVS__, Tru64/OSF1 */ +#endif /* __linux__, __FreeBSD__, __DragonFly__, __HPUX__, _AIX, __MVS__, + Tru64/OSF1 */ #endif /* APR_HAS_SENDFILE */ From 58203c851ab2b09b1a5857e87bb457e0a97e354e Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Fri, 21 Jan 2005 04:04:32 +0000 Subject: [PATCH 5306/7878] Revert r125162 since Martin did not reply to dev@apr. Something like this needs to be done to support FreeBSD's libtool setup, but I need to be able to build on my machine. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125883 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/buildconf b/buildconf index 789ea682de3..b16441f4ab3 100755 --- a/buildconf +++ b/buildconf @@ -45,9 +45,8 @@ $libtoolize --copy --automake if [ -f libtool.m4 ]; then ltfile=`pwd`/libtool.m4 else - libtool=`build/PrintPath glibtool libtool libtool15 libtool14` - ltpath=`dirname $libtool` - ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/`basename $libtool`.m4} + ltpath=`dirname $libtoolize` + ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/libtool.m4} fi if [ ! -f $ltfile ]; then @@ -55,7 +54,7 @@ if [ ! -f $ltfile ]; then exit 1 fi -echo "buildconf: Using libtool.m4 from ${ltfile}." +echo "buildconf: Using libtool.m4 at ${ltfile}." cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 From cbe799b56cf67078e9ed5af01f866efba5e3c3c0 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Fri, 21 Jan 2005 04:18:38 +0000 Subject: [PATCH 5307/7878] bump /trunk/ to 1.2.0-dev git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125887 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_version.h b/include/apr_version.h index cbf2e82ffbc..4b95df9fe21 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -57,7 +57,7 @@ extern "C" { * Minor API changes that do not cause binary compatibility problems. * Should be reset to 0 when upgrading APR_MAJOR_VERSION */ -#define APR_MINOR_VERSION 1 +#define APR_MINOR_VERSION 2 /** patch level */ #define APR_PATCH_VERSION 0 From fee6d114c8cbf2b6f670ac23b63f8c05ab2010d5 Mon Sep 17 00:00:00 2001 From: Thom May Date: Fri, 21 Jan 2005 15:34:30 +0000 Subject: [PATCH 5308/7878] Add test as an alias to check git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125935 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.in b/Makefile.in index b5daddfdb33..e5352d30f78 100644 --- a/Makefile.in +++ b/Makefile.in @@ -112,6 +112,7 @@ dox: gcov: @build/run-gcov.sh +test: check check: $(TARGET_LIB) (cd test && $(MAKE) check) From 5d3281d7682fc1b340e1b65548c77831338b3ad3 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Wed, 26 Jan 2005 05:25:53 +0000 Subject: [PATCH 5309/7878] Update STATUS with 1.1.0 release. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@126469 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 1 + 1 file changed, 1 insertion(+) diff --git a/STATUS b/STATUS index 8038d64214d..b5bcdfc86cc 100644 --- a/STATUS +++ b/STATUS @@ -4,6 +4,7 @@ Last modified at [$Date$] Releases: Standalone + 1.1.0 : released January 25, 2005 1.0.1 : released November 18, 2004 1.0.0 : released September 1, 2004 0.9.5 : released November 19, 2004 From a235042b4a30764bd2c87d2f340da62ab3accbe5 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Feb 2005 11:09:25 +0000 Subject: [PATCH 5310/7878] * configure.in: Disable sendfile support for S/390 only in kernel versions < 2.4.0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151340 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 72ced022ed8..f5535269dbe 100644 --- a/configure.in +++ b/configure.in @@ -910,7 +910,10 @@ AC_ARG_WITH(sendfile, [ --with-sendfile Override decision to use sendfi sendfile="0" ;; s390-*-linux-gnu) - sendfile="0" + # disable sendfile support for 2.2 on S/390 + if test $os_version -lt 240; then + sendfile="0" + fi ;; *aix*) # compiler-independent check for 64-bit build From 2fef8f592e4cff68c52c9acc090e6678c7d1e329 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Feb 2005 11:52:08 +0000 Subject: [PATCH 5311/7878] * configure.in: Use autoconf 2.5x AC_CONFIG_*; allow config.status to work properly; move the apr{,_private}.h mtime preservation hack into config.status so that it works and works for every config.status invocation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151341 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/configure.in b/configure.in index f5535269dbe..1f910293ee7 100644 --- a/configure.in +++ b/configure.in @@ -2006,12 +2006,6 @@ AC_SUBST(DEFAULT_OSDIR) AC_SUBST(EXEEXT) AC_SUBST(LIBTOOL_LIBS) -echo "${nl}Construct Makefiles and header files." -MAKEFILES="Makefile" -if test -d $srcdir/test; then - MAKEFILES="$MAKEFILES test/Makefile test/internal/Makefile" -fi - # # BSD/OS (BSDi) needs to use a different include syntax in the Makefiles # @@ -2035,31 +2029,41 @@ esac AC_SUBST(INCLUDE_RULES) AC_SUBST(INCLUDE_OUTPUTS) -SAVE_FILES="include/apr.h include/arch/unix/apr_private.h" +AC_CONFIG_FILES([Makefile + include/apr.h + build/apr_rules.mk + build/pkg/pkginfo + apr-$APR_MAJOR_VERSION-config:apr-config.in + apr.pc]) -for i in $SAVE_FILES; do - test -r $i && mv $i $i.save -done +if test -d $srcdir/test; then + AC_CONFIG_FILES([test/Makefile test/internal/Makefile]) +fi dir=include/arch/unix test -d $dir || $MKDIR $dir -AC_OUTPUT([ - $MAKEFILES - include/apr.h - build/apr_rules.mk - build/pkg/pkginfo - apr-$APR_MAJOR_VERSION-config:apr-config.in - apr.pc -],[ -for i in $SAVE_FILES; do +AC_CONFIG_COMMANDS([default], [ +# Commands run at the end of config.status: +for i in $APR_SAVE_HEADERS; do if cmp -s $i $i.save 2>/dev/null; then mv $i.save $i - echo "$i is unchanged" + AC_MSG_NOTICE([$i is unchanged]) fi rm -f $i.save done chmod +x apr-$APR_MAJOR_VERSION-config ],[ +dnl This section is expanded by configure UNQUOTED so variable +dnl references must be backslash-escaped as necessary. + +# Commands run at the beginning of config.status: +APR_SAVE_HEADERS="include/apr.h include/arch/unix/apr_private.h" APR_MAJOR_VERSION=$APR_MAJOR_VERSION + +for apri in \${APR_SAVE_HEADERS}; do + test -r \${apri} && mv \${apri} \${apri}.save +done ]) + +AC_OUTPUT From b67ba2152833c700af1c853f041ad519c6b81734 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Feb 2005 11:55:44 +0000 Subject: [PATCH 5312/7878] * Makefile.in (DISTCLEAN_TARGETS): Add build/pkg/pkginfo. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151342 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index e5352d30f78..fe6ad501c92 100644 --- a/Makefile.in +++ b/Makefile.in @@ -46,7 +46,8 @@ CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ build/apr_rules.out DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ - libtool $(APR_CONFIG) build/apr_rules.mk apr.pc + libtool $(APR_CONFIG) build/apr_rules.mk apr.pc \ + build/pkg/pkginfo EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in \ build-outputs.mk build/ltcf-c.sh build/ltmain.sh build/libtool.m4 From 7a3a5a37a355e9227d624d1e6191d298d5d13107 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Feb 2005 17:42:07 +0000 Subject: [PATCH 5313/7878] * configure.in: For Linux/s390, print size_t as unsigned long int and ssize_t as signed long int (previously signed long int and signed int respectively). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151378 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 1f910293ee7..aa8442b5fe8 100644 --- a/configure.in +++ b/configure.in @@ -1321,7 +1321,10 @@ fi # you can override our decision below. case $host in s390*linux*) - size_t_fmt='#define APR_SIZE_T_FMT "ld"' + # uniquely, the 31-bit Linux/s390 uses "unsigned long int" + # for size_t rather than "unsigned int": + size_t_fmt='#define APR_SIZE_T_FMT "lu"' + ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' ;; *-os2*) size_t_fmt='#define APR_SIZE_T_FMT "lu"' From 33a18de25e08a0c8c9ab984299cdca8925e41ca9 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 4 Feb 2005 20:43:09 +0000 Subject: [PATCH 5314/7878] * build/jlibtool.c: Update to ignore --tag if CC or CXX are the values. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151411 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index 39520aad03b..b2096640369 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -516,6 +517,13 @@ int parse_long_opt(char *arg, command_t *cmd_data) printf("Sorry. No help available.\n"); } else if (strcmp(var, "config") == 0) { print_config(); + } else if (strcmp(var, "tag") == 0) { + if (strcmp(value, "CC") == 0) { + /* Do nothing. */ + } + if (strcmp(value, "CXX") == 0) { + /* Do nothing. */ + } } else { return 0; } From 562b5ad69dfce9da698961eb985af82c856a6657 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 4 Feb 2005 20:44:01 +0000 Subject: [PATCH 5315/7878] Update copyright year to 2005 and standardize on current copyright owner line. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151412 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 7 ++++--- atomic/netware/apr_atomic.c | 3 ++- atomic/os390/atomic.c | 3 ++- atomic/unix/apr_atomic.c | 3 ++- atomic/win32/apr_atomic.c | 3 ++- build/aplibtool.c | 3 ++- build/apr_rules.mk.in | 7 ++++--- build/pkg/buildpkg.sh | 7 ++++--- dso/aix/dso.c | 3 ++- dso/beos/dso.c | 3 ++- dso/netware/dso.c | 3 ++- dso/os2/dso.c | 3 ++- dso/os390/dso.c | 3 ++- dso/unix/dso.c | 3 ++- dso/win32/dso.c | 3 ++- file_io/netware/filestat.c | 3 ++- file_io/netware/filesys.c | 3 ++- file_io/netware/flock.c | 3 ++- file_io/netware/mktemp.c | 3 ++- file_io/netware/pipe.c | 3 ++- file_io/os2/dir.c | 3 ++- file_io/os2/dir_make_recurse.c | 3 ++- file_io/os2/fileacc.c | 3 ++- file_io/os2/filedup.c | 3 ++- file_io/os2/filepath.c | 3 ++- file_io/os2/filestat.c | 3 ++- file_io/os2/filesys.c | 3 ++- file_io/os2/flock.c | 3 ++- file_io/os2/maperrorcode.c | 3 ++- file_io/os2/open.c | 3 ++- file_io/os2/pipe.c | 3 ++- file_io/os2/readwrite.c | 3 ++- file_io/os2/seek.c | 3 ++- file_io/unix/copy.c | 3 ++- file_io/unix/dir.c | 3 ++- file_io/unix/fileacc.c | 3 ++- file_io/unix/filedup.c | 3 ++- file_io/unix/filepath.c | 3 ++- file_io/unix/filepath_util.c | 3 ++- file_io/unix/filestat.c | 3 ++- file_io/unix/flock.c | 3 ++- file_io/unix/fullrw.c | 3 ++- file_io/unix/mktemp.c | 3 ++- file_io/unix/open.c | 3 ++- file_io/unix/pipe.c | 3 ++- file_io/unix/readwrite.c | 3 ++- file_io/unix/seek.c | 3 ++- file_io/unix/tempdir.c | 3 ++- file_io/win32/dir.c | 3 ++- file_io/win32/filedup.c | 3 ++- file_io/win32/filepath.c | 3 ++- file_io/win32/filestat.c | 3 ++- file_io/win32/filesys.c | 3 ++- file_io/win32/flock.c | 3 ++- file_io/win32/open.c | 3 ++- file_io/win32/pipe.c | 3 ++- file_io/win32/readwrite.c | 3 ++- file_io/win32/seek.c | 3 ++- include/apr_allocator.h | 3 ++- include/apr_atomic.h | 3 ++- include/apr_dso.h | 3 ++- include/apr_env.h | 3 ++- include/apr_errno.h | 3 ++- include/apr_file_info.h | 3 ++- include/apr_file_io.h | 3 ++- include/apr_general.h | 3 ++- include/apr_getopt.h | 3 ++- include/apr_global_mutex.h | 3 ++- include/apr_hash.h | 3 ++- include/apr_inherit.h | 3 ++- include/apr_lib.h | 3 ++- include/apr_mmap.h | 3 ++- include/apr_network_io.h | 3 ++- include/apr_poll.h | 3 ++- include/apr_pools.h | 3 ++- include/apr_portable.h | 3 ++- include/apr_proc_mutex.h | 3 ++- include/apr_random.h | 3 ++- include/apr_ring.h | 3 ++- include/apr_shm.h | 3 ++- include/apr_signal.h | 3 ++- include/apr_strings.h | 3 ++- include/apr_support.h | 3 ++- include/apr_tables.h | 3 ++- include/apr_thread_cond.h | 3 ++- include/apr_thread_mutex.h | 3 ++- include/apr_thread_proc.h | 3 ++- include/apr_thread_rwlock.h | 3 ++- include/apr_time.h | 3 ++- include/apr_user.h | 3 ++- include/apr_version.h | 3 ++- include/apr_want.h | 3 ++- include/arch/aix/apr_arch_dso.h | 3 ++- include/arch/apr_private_common.h | 3 ++- include/arch/beos/apr_arch_dso.h | 3 ++- include/arch/beos/apr_arch_proc_mutex.h | 3 ++- include/arch/beos/apr_arch_thread_cond.h | 3 ++- include/arch/beos/apr_arch_thread_mutex.h | 3 ++- include/arch/beos/apr_arch_thread_rwlock.h | 3 ++- include/arch/beos/apr_arch_threadproc.h | 3 ++- include/arch/netware/apr_arch_dso.h | 3 ++- include/arch/netware/apr_arch_file_io.h | 3 ++- include/arch/netware/apr_arch_global_mutex.h | 3 ++- include/arch/netware/apr_arch_internal_time.h | 3 ++- include/arch/netware/apr_arch_networkio.h | 3 ++- include/arch/netware/apr_arch_pre_nw.h | 3 ++- include/arch/netware/apr_arch_proc_mutex.h | 3 ++- include/arch/netware/apr_arch_thread_cond.h | 3 ++- include/arch/netware/apr_arch_thread_mutex.h | 3 ++- include/arch/netware/apr_arch_thread_rwlock.h | 3 ++- include/arch/netware/apr_arch_threadproc.h | 3 ++- include/arch/netware/apr_private.h | 3 ++- include/arch/os2/apr_arch_dso.h | 3 ++- include/arch/os2/apr_arch_file_io.h | 3 ++- include/arch/os2/apr_arch_networkio.h | 3 ++- include/arch/os2/apr_arch_os2calls.h | 3 ++- include/arch/os2/apr_arch_proc_mutex.h | 3 ++- include/arch/os2/apr_arch_thread_cond.h | 3 ++- include/arch/os2/apr_arch_thread_mutex.h | 3 ++- include/arch/os2/apr_arch_thread_rwlock.h | 3 ++- include/arch/os2/apr_arch_threadproc.h | 3 ++- include/arch/os390/apr_arch_dso.h | 3 ++- include/arch/unix/apr_arch_dso.h | 3 ++- include/arch/unix/apr_arch_file_io.h | 3 ++- include/arch/unix/apr_arch_global_mutex.h | 3 ++- include/arch/unix/apr_arch_inherit.h | 3 ++- include/arch/unix/apr_arch_internal_time.h | 3 ++- include/arch/unix/apr_arch_misc.h | 3 ++- include/arch/unix/apr_arch_networkio.h | 3 ++- include/arch/unix/apr_arch_poll_private.h | 3 ++- include/arch/unix/apr_arch_proc_mutex.h | 3 ++- include/arch/unix/apr_arch_shm.h | 3 ++- include/arch/unix/apr_arch_thread_cond.h | 3 ++- include/arch/unix/apr_arch_thread_mutex.h | 3 ++- include/arch/unix/apr_arch_thread_rwlock.h | 3 ++- include/arch/unix/apr_arch_threadproc.h | 3 ++- include/arch/win32/apr_arch_atime.h | 3 ++- include/arch/win32/apr_arch_dso.h | 3 ++- include/arch/win32/apr_arch_file_io.h | 3 ++- include/arch/win32/apr_arch_inherit.h | 3 ++- include/arch/win32/apr_arch_misc.h | 3 ++- include/arch/win32/apr_arch_networkio.h | 3 ++- include/arch/win32/apr_arch_proc_mutex.h | 3 ++- include/arch/win32/apr_arch_thread_cond.h | 3 ++- include/arch/win32/apr_arch_thread_mutex.h | 3 ++- include/arch/win32/apr_arch_thread_rwlock.h | 3 ++- include/arch/win32/apr_arch_threadproc.h | 3 ++- include/arch/win32/apr_arch_utf8.h | 3 ++- include/arch/win32/apr_dbg_win32_handles.h | 3 ++- include/arch/win32/apr_private.h | 3 ++- locks/beos/proc_mutex.c | 3 ++- locks/beos/thread_cond.c | 3 ++- locks/beos/thread_mutex.c | 3 ++- locks/beos/thread_rwlock.c | 3 ++- locks/netware/proc_mutex.c | 3 ++- locks/netware/thread_cond.c | 3 ++- locks/netware/thread_mutex.c | 3 ++- locks/netware/thread_rwlock.c | 3 ++- locks/os2/proc_mutex.c | 3 ++- locks/os2/thread_cond.c | 3 ++- locks/os2/thread_mutex.c | 3 ++- locks/os2/thread_rwlock.c | 3 ++- locks/unix/global_mutex.c | 3 ++- locks/unix/proc_mutex.c | 3 ++- locks/unix/thread_cond.c | 3 ++- locks/unix/thread_mutex.c | 3 ++- locks/unix/thread_rwlock.c | 3 ++- locks/win32/proc_mutex.c | 3 ++- locks/win32/thread_cond.c | 3 ++- locks/win32/thread_mutex.c | 3 ++- locks/win32/thread_rwlock.c | 3 ++- memory/unix/apr_pools.c | 3 ++- misc/netware/charset.c | 3 ++- misc/netware/libprews.c | 3 ++- misc/netware/rand.c | 3 ++- misc/netware/start.c | 3 ++- misc/unix/charset.c | 3 ++- misc/unix/env.c | 3 ++- misc/unix/errorcodes.c | 3 ++- misc/unix/otherchild.c | 3 ++- misc/unix/rand.c | 3 ++- misc/unix/start.c | 3 ++- misc/unix/version.c | 3 ++- misc/win32/apr_app.c | 3 ++- misc/win32/charset.c | 3 ++- misc/win32/env.c | 3 ++- misc/win32/internal.c | 3 ++- misc/win32/misc.c | 3 ++- misc/win32/rand.c | 3 ++- misc/win32/start.c | 3 ++- misc/win32/utf8.c | 3 ++- mmap/unix/common.c | 3 ++- mmap/unix/mmap.c | 3 ++- mmap/win32/mmap.c | 3 ++- network_io/beos/sendrecv.c | 3 ++- network_io/os2/os2calls.c | 3 ++- network_io/os2/sendrecv.c | 3 ++- network_io/os2/sendrecv_udp.c | 3 ++- network_io/os2/sockets.c | 3 ++- network_io/os2/sockopt.c | 3 ++- network_io/unix/sendrecv.c | 3 ++- network_io/unix/sockaddr.c | 3 ++- network_io/unix/sockets.c | 3 ++- network_io/unix/sockopt.c | 3 ++- network_io/win32/sendrecv.c | 3 ++- network_io/win32/sockets.c | 3 ++- network_io/win32/sockopt.c | 3 ++- passwd/apr_getpass.c | 3 ++- poll/os2/poll.c | 3 ++- poll/os2/pollset.c | 3 ++- poll/unix/epoll.c | 3 ++- poll/unix/kqueue.c | 3 ++- poll/unix/poll.c | 3 ++- poll/unix/port.c | 3 ++- poll/unix/select.c | 3 ++- random/unix/apr_random.c | 3 ++- random/unix/sha2.c | 3 ++- random/unix/sha2.h | 3 ++- shmem/beos/shm.c | 3 ++- shmem/os2/shm.c | 3 ++- shmem/unix/shm.c | 3 ++- shmem/win32/shm.c | 3 ++- strings/apr_cpystrn.c | 3 ++- strings/apr_snprintf.c | 3 ++- strings/apr_strings.c | 3 ++- strings/apr_strtok.c | 3 ++- support/unix/waitio.c | 3 ++- tables/apr_hash.c | 3 ++- tables/apr_tables.c | 3 ++- test/abts_tests.h | 3 ++- test/globalmutexchild.c | 3 ++- test/internal/testregex.c | 3 ++- test/internal/testucs.c | 3 ++- test/mod_test.c | 3 ++- test/readchild.c | 3 ++- test/sendfile.c | 3 ++- test/sockchild.c | 3 ++- test/testargs.c | 3 ++- test/testatomic.c | 3 ++- test/testdir.c | 3 ++- test/testdso.c | 3 ++- test/testdup.c | 3 ++- test/testenv.c | 3 ++- test/testfile.c | 3 ++- test/testfilecopy.c | 3 ++- test/testfileinfo.c | 3 ++- test/testflock.c | 3 ++- test/testflock.h | 3 ++- test/testfmt.c | 3 ++- test/testfnmatch.c | 3 ++- test/testglobalmutex.c | 3 ++- test/testglobalmutex.h | 3 ++- test/testhash.c | 3 ++- test/testipsub.c | 3 ++- test/testlock.c | 3 ++- test/testlockperf.c | 3 ++- test/testmmap.c | 3 ++- test/testmutexscope.c | 3 ++- test/testnames.c | 3 ++- test/testoc.c | 3 ++- test/testpath.c | 3 ++- test/testpipe.c | 3 ++- test/testpoll.c | 3 ++- test/testpools.c | 3 ++- test/testproc.c | 3 ++- test/testprocmutex.c | 3 ++- test/testrand.c | 3 ++- test/testrand2.c | 3 ++- test/testshm.c | 3 ++- test/testshm.h | 3 ++- test/testshmconsumer.c | 3 ++- test/testshmproducer.c | 3 ++- test/testsleep.c | 3 ++- test/testsock.c | 3 ++- test/testsock.h | 3 ++- test/testsockets.c | 3 ++- test/testsockopt.c | 3 ++- test/teststr.c | 3 ++- test/teststrnatcmp.c | 3 ++- test/testtable.c | 3 ++- test/testtemp.c | 3 ++- test/testthread.c | 3 ++- test/testtime.c | 3 ++- test/testud.c | 3 ++- test/testuser.c | 3 ++- test/testutil.c | 3 ++- test/testutil.h | 3 ++- test/testvsn.c | 3 ++- test/tryread.c | 3 ++- threadproc/beos/apr_proc_stub.c | 3 ++- threadproc/beos/proc.c | 3 ++- threadproc/beos/thread.c | 3 ++- threadproc/beos/threadpriv.c | 3 ++- threadproc/beos/threadproc_common.c | 3 ++- threadproc/netware/proc.c | 3 ++- threadproc/netware/procsup.c | 3 ++- threadproc/netware/signals.c | 3 ++- threadproc/netware/thread.c | 3 ++- threadproc/netware/threadpriv.c | 3 ++- threadproc/os2/proc.c | 3 ++- threadproc/os2/thread.c | 3 ++- threadproc/os2/threadpriv.c | 3 ++- threadproc/unix/proc.c | 3 ++- threadproc/unix/procsup.c | 3 ++- threadproc/unix/signals.c | 3 ++- threadproc/unix/thread.c | 3 ++- threadproc/unix/threadpriv.c | 3 ++- threadproc/win32/proc.c | 3 ++- threadproc/win32/signals.c | 3 ++- threadproc/win32/thread.c | 3 ++- threadproc/win32/threadpriv.c | 3 ++- time/unix/time.c | 3 ++- time/unix/timestr.c | 3 ++- time/win32/access.c | 3 ++- time/win32/time.c | 3 ++- time/win32/timestr.c | 3 ++- user/netware/groupinfo.c | 3 ++- user/netware/userinfo.c | 3 ++- user/unix/groupinfo.c | 3 ++- user/unix/userinfo.c | 3 ++- user/win32/groupinfo.c | 3 ++- user/win32/userinfo.c | 3 ++- 322 files changed, 650 insertions(+), 328 deletions(-) diff --git a/apr-config.in b/apr-config.in index d2bca990c4e..7b8462ed2dd 100644 --- a/apr-config.in +++ b/apr-config.in @@ -1,11 +1,12 @@ #!/bin/sh -# Copyright 2001-2004 The Apache Software Foundation -# +# Copyright 2001-2005 The Apache Software Foundation or its licensors, as +# applicable. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index 069b1bd1672..78d14a65c1d 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c index 7c8fa484c5d..675a0457721 100644 --- a/atomic/os390/atomic.c +++ b/atomic/os390/atomic.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index bf457c1ea9b..5484eba0adc 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index b42a2028ee3..dd00abd9385 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/build/aplibtool.c b/build/aplibtool.c index 1990d7d79cb..22a316ace18 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/build/apr_rules.mk.in b/build/apr_rules.mk.in index b95982f5aee..233fecf87be 100644 --- a/build/apr_rules.mk.in +++ b/build/apr_rules.mk.in @@ -1,10 +1,11 @@ -# Copyright 2000-2004 The Apache Software Foundation -# +# Copyright 2000-2005 The Apache Software Foundation or its licensors, as +# applicable. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, diff --git a/build/pkg/buildpkg.sh b/build/pkg/buildpkg.sh index 3c93263a67c..273c664aa1f 100755 --- a/build/pkg/buildpkg.sh +++ b/build/pkg/buildpkg.sh @@ -1,11 +1,12 @@ #!/bin/sh -# Copyright 2000-2004 The Apache Software Foundation -# +# Copyright 2000-2005 The Apache Software Foundation or its licensors, as +# applicable. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 1b197003129..0b4736addea 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 41fec345092..797c11089bf 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dso/netware/dso.c b/dso/netware/dso.c index ba93d1d71a1..9bc24d72ce5 100644 --- a/dso/netware/dso.c +++ b/dso/netware/dso.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dso/os2/dso.c b/dso/os2/dso.c index da9f636c042..7e735841e26 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dso/os390/dso.c b/dso/os390/dso.c index 3022e0ea150..0dcac7a8e52 100644 --- a/dso/os390/dso.c +++ b/dso/os390/dso.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dso/unix/dso.c b/dso/unix/dso.c index ce94707760a..73908722911 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dso/win32/dso.c b/dso/win32/dso.c index bf398e46e08..17651db0120 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 5c43bb93709..1fb31d9ee13 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/netware/filesys.c b/file_io/netware/filesys.c index 532bee7c1a2..50097644214 100644 --- a/file_io/netware/filesys.c +++ b/file_io/netware/filesys.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/netware/flock.c b/file_io/netware/flock.c index 7e7d771cf0d..bd4beb037cf 100644 --- a/file_io/netware/flock.c +++ b/file_io/netware/flock.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/netware/mktemp.c b/file_io/netware/mktemp.c index 58e89386b91..f1568bdd64a 100644 --- a/file_io/netware/mktemp.c +++ b/file_io/netware/mktemp.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 2cf03ccc8c5..2763bd97f57 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 0ea1d27f2c1..8a140248d87 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/os2/dir_make_recurse.c b/file_io/os2/dir_make_recurse.c index 4f2acaaabf9..9cde1a987d4 100644 --- a/file_io/os2/dir_make_recurse.c +++ b/file_io/os2/dir_make_recurse.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/os2/fileacc.c b/file_io/os2/fileacc.c index 870c5ddd837..0b0c26d24a6 100644 --- a/file_io/os2/fileacc.c +++ b/file_io/os2/fileacc.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 2d06acdd2c3..d592033a0f1 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/os2/filepath.c b/file_io/os2/filepath.c index f4f84f76b20..827a6551d52 100644 --- a/file_io/os2/filepath.c +++ b/file_io/os2/filepath.c @@ -1,4 +1,5 @@ -/* Copyright 2004 The Apache Software Foundation +/* Copyright 2004-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index cafdf4f1b62..0414c7150cd 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c index ef597b38e0f..cf3b8329888 100644 --- a/file_io/os2/filesys.c +++ b/file_io/os2/filesys.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/os2/flock.c b/file_io/os2/flock.c index 9e452821df0..4c5e54d93f1 100644 --- a/file_io/os2/flock.c +++ b/file_io/os2/flock.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c index 9848a6e58a7..2ea84bb4d50 100644 --- a/file_io/os2/maperrorcode.c +++ b/file_io/os2/maperrorcode.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/os2/open.c b/file_io/os2/open.c index fb5f740076f..3ece062244e 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index df351122383..1e18946848f 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 38855b03548..81f50f97841 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index 98f2ea5b035..40b02a81567 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index 55d34dd5094..8ee0f590a45 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -1,4 +1,5 @@ -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 29abd523cbc..590380f2e2a 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 2f20c0bfbf0..542d90db87b 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index f9f9f1d3e06..fe792258eaf 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index dd2720e36d6..fd0b6a25001 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/filepath_util.c b/file_io/unix/filepath_util.c index 40d0cd77044..ec9b4260904 100644 --- a/file_io/unix/filepath_util.c +++ b/file_io/unix/filepath_util.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index ff16164e188..d7a48663afd 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c index 2ee7bc63e1c..9aeb4fe3ef7 100644 --- a/file_io/unix/flock.c +++ b/file_io/unix/flock.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index 7d1f85b3230..5b84d6a5ddc 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 6db13c69c7a..c516fac81b3 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/open.c b/file_io/unix/open.c index eab278f641d..55b98630247 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index c32613f44c6..ec54432f7f6 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 07e11227306..f2514bf3bdb 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 0d115243252..48368cda51b 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/unix/tempdir.c b/file_io/unix/tempdir.c index f7a7a7d42af..4409cd99d25 100644 --- a/file_io/unix/tempdir.c +++ b/file_io/unix/tempdir.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 19fe15e8cf1..92d896e6162 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 63aa250891a..d2e3af46b05 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 74d6d087998..67dcd71bd72 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 3b8529e0a52..2d688fce76b 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c index da5244baf7f..6d6c2bce8f0 100644 --- a/file_io/win32/filesys.c +++ b/file_io/win32/filesys.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index 65a158e8ce4..cdbd7e174cf 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 1b950fc210b..21b4ba76624 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 297cda2be80..f58b432408a 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 7a593138727..4e36f0eafd6 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index b8f2bcfd432..8a2db7f4add 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 965612bf7d6..de29e911d5d 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 784cd053cd1..d70106980d8 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_dso.h b/include/apr_dso.h index 9dd426f63cb..91c6d5befa4 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_env.h b/include/apr_env.h index 200ab48f270..9e3d2a72d88 100644 --- a/include/apr_env.h +++ b/include/apr_env.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_errno.h b/include/apr_errno.h index dced627f86b..2e8e63a03a8 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_file_info.h b/include/apr_file_info.h index a06c31225ee..4680caba22a 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 9a7b466c8c8..847ecb044fa 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_general.h b/include/apr_general.h index 3b6caaceb87..de415b9de8f 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 5d9639efb7f..972e14e3c73 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index 8f9e46186d4..7decb282501 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_hash.h b/include/apr_hash.h index 5365c0a2060..37f307c9fc8 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_inherit.h b/include/apr_inherit.h index 5dbbbae8171..4042c901350 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_lib.h b/include/apr_lib.h index cb1dcedf5a6..c48782d5bb0 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 606c0443eb5..f1b45e37971 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 9df0ec29cb4..a67c9bb6e5e 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_poll.h b/include/apr_poll.h index bd3fd9ebb61..c9c59730412 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_pools.h b/include/apr_pools.h index cca864bf2ce..372319f480d 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_portable.h b/include/apr_portable.h index 1daa1a905a4..b37263b787f 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index cceafcf420d..05c9f196508 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_random.h b/include/apr_random.h index fb295aa0b5c..b5c2baaa5d9 100644 --- a/include/apr_random.h +++ b/include/apr_random.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_ring.h b/include/apr_ring.h index 5bf11aaf678..ba1ac1f7a74 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_shm.h b/include/apr_shm.h index 88d184b0e2e..2acb53e344e 100644 --- a/include/apr_shm.h +++ b/include/apr_shm.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_signal.h b/include/apr_signal.h index 173044bb781..8cf65be8b00 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_strings.h b/include/apr_strings.h index c189cb6a494..94e99c3f10d 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_support.h b/include/apr_support.h index 164ce229d93..17a146a962c 100644 --- a/include/apr_support.h +++ b/include/apr_support.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_tables.h b/include/apr_tables.h index 9cba568c741..8834caa7082 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h index bc6b70562bf..8b8a553235e 100644 --- a/include/apr_thread_cond.h +++ b/include/apr_thread_cond.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 1040e700283..4d73164d411 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index fa0b97d3a73..e317083fcf7 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_thread_rwlock.h b/include/apr_thread_rwlock.h index fdb3fa8ed82..b8890b9d5c6 100644 --- a/include/apr_thread_rwlock.h +++ b/include/apr_thread_rwlock.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_time.h b/include/apr_time.h index 887d905621e..1882b283e59 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_user.h b/include/apr_user.h index a670fde9bb6..2529b79137f 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_version.h b/include/apr_version.h index 4b95df9fe21..77c17b2a820 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr_want.h b/include/apr_want.h index 23862b005ae..c7556a79262 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/aix/apr_arch_dso.h b/include/arch/aix/apr_arch_dso.h index b59e98e23b1..cc9c026639c 100644 --- a/include/arch/aix/apr_arch_dso.h +++ b/include/arch/aix/apr_arch_dso.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/apr_private_common.h b/include/arch/apr_private_common.h index 912813b0d87..c5fbbaa9fa5 100644 --- a/include/arch/apr_private_common.h +++ b/include/arch/apr_private_common.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/beos/apr_arch_dso.h b/include/arch/beos/apr_arch_dso.h index a1ed754d3c9..1bf3395c067 100644 --- a/include/arch/beos/apr_arch_dso.h +++ b/include/arch/beos/apr_arch_dso.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/beos/apr_arch_proc_mutex.h b/include/arch/beos/apr_arch_proc_mutex.h index b47076f91b7..1325e00ed07 100644 --- a/include/arch/beos/apr_arch_proc_mutex.h +++ b/include/arch/beos/apr_arch_proc_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/beos/apr_arch_thread_cond.h b/include/arch/beos/apr_arch_thread_cond.h index 1692edc854e..b4584b47ca2 100644 --- a/include/arch/beos/apr_arch_thread_cond.h +++ b/include/arch/beos/apr_arch_thread_cond.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/beos/apr_arch_thread_mutex.h b/include/arch/beos/apr_arch_thread_mutex.h index 4bd2d7e29ed..af9c96f87b1 100644 --- a/include/arch/beos/apr_arch_thread_mutex.h +++ b/include/arch/beos/apr_arch_thread_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/beos/apr_arch_thread_rwlock.h b/include/arch/beos/apr_arch_thread_rwlock.h index 377c7b7f0ad..7f911816d57 100644 --- a/include/arch/beos/apr_arch_thread_rwlock.h +++ b/include/arch/beos/apr_arch_thread_rwlock.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/beos/apr_arch_threadproc.h b/include/arch/beos/apr_arch_threadproc.h index a81f69cfebb..c11fe4e39e6 100644 --- a/include/arch/beos/apr_arch_threadproc.h +++ b/include/arch/beos/apr_arch_threadproc.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/netware/apr_arch_dso.h b/include/arch/netware/apr_arch_dso.h index 5a4ea62fe69..18d24036265 100644 --- a/include/arch/netware/apr_arch_dso.h +++ b/include/arch/netware/apr_arch_dso.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/netware/apr_arch_file_io.h b/include/arch/netware/apr_arch_file_io.h index 70ce289d97f..bcef9add985 100644 --- a/include/arch/netware/apr_arch_file_io.h +++ b/include/arch/netware/apr_arch_file_io.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/netware/apr_arch_global_mutex.h b/include/arch/netware/apr_arch_global_mutex.h index 61c91096460..f8f534fef27 100644 --- a/include/arch/netware/apr_arch_global_mutex.h +++ b/include/arch/netware/apr_arch_global_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/netware/apr_arch_internal_time.h b/include/arch/netware/apr_arch_internal_time.h index 8522d37ab36..399ac72e794 100644 --- a/include/arch/netware/apr_arch_internal_time.h +++ b/include/arch/netware/apr_arch_internal_time.h @@ -1,4 +1,5 @@ -/* Copyright 2001-2004 The Apache Software Foundation +/* Copyright 2001-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/netware/apr_arch_networkio.h b/include/arch/netware/apr_arch_networkio.h index 4ec03896030..0485b0b41e4 100644 --- a/include/arch/netware/apr_arch_networkio.h +++ b/include/arch/netware/apr_arch_networkio.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/netware/apr_arch_pre_nw.h b/include/arch/netware/apr_arch_pre_nw.h index 49ceb86bb99..6c0026c6b77 100644 --- a/include/arch/netware/apr_arch_pre_nw.h +++ b/include/arch/netware/apr_arch_pre_nw.h @@ -11,7 +11,8 @@ #define N_PLAT_NLM -/* Copyright 2004 The Apache Software Foundation +/* Copyright 2004-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/netware/apr_arch_proc_mutex.h b/include/arch/netware/apr_arch_proc_mutex.h index 5195a0a898a..09c325e4fe6 100644 --- a/include/arch/netware/apr_arch_proc_mutex.h +++ b/include/arch/netware/apr_arch_proc_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/netware/apr_arch_thread_cond.h b/include/arch/netware/apr_arch_thread_cond.h index 82607dafb94..bfb5ece393c 100644 --- a/include/arch/netware/apr_arch_thread_cond.h +++ b/include/arch/netware/apr_arch_thread_cond.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/netware/apr_arch_thread_mutex.h b/include/arch/netware/apr_arch_thread_mutex.h index 794b555ba90..d9b599a0e34 100644 --- a/include/arch/netware/apr_arch_thread_mutex.h +++ b/include/arch/netware/apr_arch_thread_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/netware/apr_arch_thread_rwlock.h b/include/arch/netware/apr_arch_thread_rwlock.h index 3844420d19b..b87e2d5dbf2 100644 --- a/include/arch/netware/apr_arch_thread_rwlock.h +++ b/include/arch/netware/apr_arch_thread_rwlock.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/netware/apr_arch_threadproc.h b/include/arch/netware/apr_arch_threadproc.h index 5f5ddcff6ba..b30d6f6e3ef 100644 --- a/include/arch/netware/apr_arch_threadproc.h +++ b/include/arch/netware/apr_arch_threadproc.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 917b6fa4500..3881f737925 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/os2/apr_arch_dso.h b/include/arch/os2/apr_arch_dso.h index 9b104609579..9a202a3fa2b 100644 --- a/include/arch/os2/apr_arch_dso.h +++ b/include/arch/os2/apr_arch_dso.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/os2/apr_arch_file_io.h b/include/arch/os2/apr_arch_file_io.h index 014438cf7a8..26045c1f652 100644 --- a/include/arch/os2/apr_arch_file_io.h +++ b/include/arch/os2/apr_arch_file_io.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/os2/apr_arch_networkio.h b/include/arch/os2/apr_arch_networkio.h index c16edfd2e36..43151ed2a0a 100644 --- a/include/arch/os2/apr_arch_networkio.h +++ b/include/arch/os2/apr_arch_networkio.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/os2/apr_arch_os2calls.h b/include/arch/os2/apr_arch_os2calls.h index 33a747a1d69..3705ee94a58 100644 --- a/include/arch/os2/apr_arch_os2calls.h +++ b/include/arch/os2/apr_arch_os2calls.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/os2/apr_arch_proc_mutex.h b/include/arch/os2/apr_arch_proc_mutex.h index 40e35b4206e..737a162da12 100644 --- a/include/arch/os2/apr_arch_proc_mutex.h +++ b/include/arch/os2/apr_arch_proc_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/os2/apr_arch_thread_cond.h b/include/arch/os2/apr_arch_thread_cond.h index 85d70eccbcb..05d56b6e21e 100644 --- a/include/arch/os2/apr_arch_thread_cond.h +++ b/include/arch/os2/apr_arch_thread_cond.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/os2/apr_arch_thread_mutex.h b/include/arch/os2/apr_arch_thread_mutex.h index fa3f279b2d1..b4454294350 100644 --- a/include/arch/os2/apr_arch_thread_mutex.h +++ b/include/arch/os2/apr_arch_thread_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/os2/apr_arch_thread_rwlock.h b/include/arch/os2/apr_arch_thread_rwlock.h index e9c2c033033..b942d595e3b 100644 --- a/include/arch/os2/apr_arch_thread_rwlock.h +++ b/include/arch/os2/apr_arch_thread_rwlock.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/os2/apr_arch_threadproc.h b/include/arch/os2/apr_arch_threadproc.h index 2efc4d32b3e..91ed2e3f93d 100644 --- a/include/arch/os2/apr_arch_threadproc.h +++ b/include/arch/os2/apr_arch_threadproc.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/os390/apr_arch_dso.h b/include/arch/os390/apr_arch_dso.h index e3084f40186..2cd2112a218 100644 --- a/include/arch/os390/apr_arch_dso.h +++ b/include/arch/os390/apr_arch_dso.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/unix/apr_arch_dso.h b/include/arch/unix/apr_arch_dso.h index 30f9f8bf997..e5d9d8305f5 100644 --- a/include/arch/unix/apr_arch_dso.h +++ b/include/arch/unix/apr_arch_dso.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index 004f59ee0bd..1d10b04903e 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/unix/apr_arch_global_mutex.h b/include/arch/unix/apr_arch_global_mutex.h index 24ee631d366..e5724dc7b0c 100644 --- a/include/arch/unix/apr_arch_global_mutex.h +++ b/include/arch/unix/apr_arch_global_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/unix/apr_arch_inherit.h b/include/arch/unix/apr_arch_inherit.h index 0f4f594606c..22914e2ef60 100644 --- a/include/arch/unix/apr_arch_inherit.h +++ b/include/arch/unix/apr_arch_inherit.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/unix/apr_arch_internal_time.h b/include/arch/unix/apr_arch_internal_time.h index 99bbb60e1c1..321921e9fc2 100644 --- a/include/arch/unix/apr_arch_internal_time.h +++ b/include/arch/unix/apr_arch_internal_time.h @@ -1,4 +1,5 @@ -/* Copyright 2001-2004 The Apache Software Foundation +/* Copyright 2001-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/unix/apr_arch_misc.h b/include/arch/unix/apr_arch_misc.h index a7c9cfbdafc..4168a2b5cc2 100644 --- a/include/arch/unix/apr_arch_misc.h +++ b/include/arch/unix/apr_arch_misc.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/unix/apr_arch_networkio.h b/include/arch/unix/apr_arch_networkio.h index d85cf6f4d30..c55616ddbf2 100644 --- a/include/arch/unix/apr_arch_networkio.h +++ b/include/arch/unix/apr_arch_networkio.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index f77585f7df1..c653a8084a6 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/unix/apr_arch_proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h index 1a3a4fc0115..3ed046cb117 100644 --- a/include/arch/unix/apr_arch_proc_mutex.h +++ b/include/arch/unix/apr_arch_proc_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/unix/apr_arch_shm.h b/include/arch/unix/apr_arch_shm.h index 6443163da93..b57df765fae 100644 --- a/include/arch/unix/apr_arch_shm.h +++ b/include/arch/unix/apr_arch_shm.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/unix/apr_arch_thread_cond.h b/include/arch/unix/apr_arch_thread_cond.h index 14f3b9b6aec..643b01d59e6 100644 --- a/include/arch/unix/apr_arch_thread_cond.h +++ b/include/arch/unix/apr_arch_thread_cond.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/unix/apr_arch_thread_mutex.h b/include/arch/unix/apr_arch_thread_mutex.h index a682b3ec953..6b1b6717b56 100644 --- a/include/arch/unix/apr_arch_thread_mutex.h +++ b/include/arch/unix/apr_arch_thread_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/unix/apr_arch_thread_rwlock.h b/include/arch/unix/apr_arch_thread_rwlock.h index a21541ee17d..c4631897c2e 100644 --- a/include/arch/unix/apr_arch_thread_rwlock.h +++ b/include/arch/unix/apr_arch_thread_rwlock.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h index c789bca9778..bb91ef7f75c 100644 --- a/include/arch/unix/apr_arch_threadproc.h +++ b/include/arch/unix/apr_arch_threadproc.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/win32/apr_arch_atime.h b/include/arch/win32/apr_arch_atime.h index dd4de786553..bf09a3289c2 100644 --- a/include/arch/win32/apr_arch_atime.h +++ b/include/arch/win32/apr_arch_atime.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/win32/apr_arch_dso.h b/include/arch/win32/apr_arch_dso.h index 6829d7993fd..e26f4ecc716 100644 --- a/include/arch/win32/apr_arch_dso.h +++ b/include/arch/win32/apr_arch_dso.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index 4e48a9416e9..3af8720b9ff 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/win32/apr_arch_inherit.h b/include/arch/win32/apr_arch_inherit.h index 911f35d8c56..b7eb1e673ff 100644 --- a/include/arch/win32/apr_arch_inherit.h +++ b/include/arch/win32/apr_arch_inherit.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index c63d64eb0fc..fc86fe22f8d 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/win32/apr_arch_networkio.h b/include/arch/win32/apr_arch_networkio.h index c2dd0b6e90e..d07e4485ab3 100644 --- a/include/arch/win32/apr_arch_networkio.h +++ b/include/arch/win32/apr_arch_networkio.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/win32/apr_arch_proc_mutex.h b/include/arch/win32/apr_arch_proc_mutex.h index 3e47b5e0431..aaac5a30c76 100644 --- a/include/arch/win32/apr_arch_proc_mutex.h +++ b/include/arch/win32/apr_arch_proc_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/win32/apr_arch_thread_cond.h b/include/arch/win32/apr_arch_thread_cond.h index 98b7adf63b7..5520ef26b09 100644 --- a/include/arch/win32/apr_arch_thread_cond.h +++ b/include/arch/win32/apr_arch_thread_cond.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/win32/apr_arch_thread_mutex.h b/include/arch/win32/apr_arch_thread_mutex.h index c801a871b2e..e180b7d42d4 100644 --- a/include/arch/win32/apr_arch_thread_mutex.h +++ b/include/arch/win32/apr_arch_thread_mutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/win32/apr_arch_thread_rwlock.h b/include/arch/win32/apr_arch_thread_rwlock.h index 57feaf11561..5a41fb97d08 100644 --- a/include/arch/win32/apr_arch_thread_rwlock.h +++ b/include/arch/win32/apr_arch_thread_rwlock.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/win32/apr_arch_threadproc.h b/include/arch/win32/apr_arch_threadproc.h index ef8340ddddb..3fb64a0e9db 100644 --- a/include/arch/win32/apr_arch_threadproc.h +++ b/include/arch/win32/apr_arch_threadproc.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/win32/apr_arch_utf8.h b/include/arch/win32/apr_arch_utf8.h index cff076f365c..c3ca62745fa 100644 --- a/include/arch/win32/apr_arch_utf8.h +++ b/include/arch/win32/apr_arch_utf8.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/win32/apr_dbg_win32_handles.h b/include/arch/win32/apr_dbg_win32_handles.h index 04f6ef314f1..291d77db07f 100644 --- a/include/arch/win32/apr_dbg_win32_handles.h +++ b/include/arch/win32/apr_dbg_win32_handles.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 0dee29348af..ac93d1ed870 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index 8d3ca31c29b..85f4e06e91b 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c index 71068facb5c..dc9ba618c3b 100644 --- a/locks/beos/thread_cond.c +++ b/locks/beos/thread_cond.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index 350e05b9b4a..5f488f16fb0 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/beos/thread_rwlock.c b/locks/beos/thread_rwlock.c index 2f81407484a..be11017a253 100644 --- a/locks/beos/thread_rwlock.c +++ b/locks/beos/thread_rwlock.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index f05cde6dc5e..72a8bfcddc3 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c index 3942b06f8a9..fdaa9587326 100644 --- a/locks/netware/thread_cond.c +++ b/locks/netware/thread_cond.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index b4f9c66a842..0d41b30e063 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/netware/thread_rwlock.c b/locks/netware/thread_rwlock.c index fdee923a054..1631012a2d6 100644 --- a/locks/netware/thread_rwlock.c +++ b/locks/netware/thread_rwlock.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index e88e35b1e71..8527e3f5509 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/os2/thread_cond.c b/locks/os2/thread_cond.c index ce0150a21bd..575d91a8da7 100644 --- a/locks/os2/thread_cond.c +++ b/locks/os2/thread_cond.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index e7f22cbabc9..0b21ea4e4a1 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/os2/thread_rwlock.c b/locks/os2/thread_rwlock.c index 5938a934110..653112dab66 100644 --- a/locks/os2/thread_rwlock.c +++ b/locks/os2/thread_rwlock.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index a14673e31b0..9a72d1438c1 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index e7a70a44c5c..98fb2eb1e67 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c index 4eaeaf35f5b..c1ebb895c06 100644 --- a/locks/unix/thread_cond.c +++ b/locks/unix/thread_cond.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 66de2d1962d..31a566f6e9b 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c index 2a4c4731a7e..18f374794a3 100644 --- a/locks/unix/thread_rwlock.c +++ b/locks/unix/thread_rwlock.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index a2505989371..9e316506a9f 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index 218da537dee..dca1e8fb651 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 125c2c2b6f3..0a848fbcf5b 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c index c4ced1ea3b1..75d79bcbeef 100644 --- a/locks/win32/thread_rwlock.c +++ b/locks/win32/thread_rwlock.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 9bf8fa290a7..d7abede33bf 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/netware/charset.c b/misc/netware/charset.c index 7250bda7fef..c771abc07d5 100644 --- a/misc/netware/charset.c +++ b/misc/netware/charset.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index 01467aab069..6395adee4c6 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -1,4 +1,5 @@ -/* Copyright 2004 The Apache Software Foundation +/* Copyright 2004-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/netware/rand.c b/misc/netware/rand.c index e21a0ebfb1f..8dd89dace2e 100644 --- a/misc/netware/rand.c +++ b/misc/netware/rand.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/netware/start.c b/misc/netware/start.c index e7ca10312f9..d359c3de41e 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/unix/charset.c b/misc/unix/charset.c index 6acb4e157d9..8a4b897413f 100644 --- a/misc/unix/charset.c +++ b/misc/unix/charset.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/unix/env.c b/misc/unix/env.c index 25c8277aaed..4b95c5d9be0 100644 --- a/misc/unix/env.c +++ b/misc/unix/env.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 5c318d5306e..d814763b585 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 17866ee8169..8ae41410c4f 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 83398b9b5ab..efcdf1fef0b 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/unix/start.c b/misc/unix/start.c index 8b6905d887b..c1176bdea13 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/unix/version.c b/misc/unix/version.c index 90a2df7d7bd..a46cf6c2c58 100644 --- a/misc/unix/version.c +++ b/misc/unix/version.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index c7a4b9348f3..eb76df35a33 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/win32/charset.c b/misc/win32/charset.c index 7760fc3ff4f..c0db7718406 100644 --- a/misc/win32/charset.c +++ b/misc/win32/charset.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/win32/env.c b/misc/win32/env.c index 3a3386b92d8..d8edc400bfd 100644 --- a/misc/win32/env.c +++ b/misc/win32/env.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/win32/internal.c b/misc/win32/internal.c index 48398dad256..239011264df 100644 --- a/misc/win32/internal.c +++ b/misc/win32/internal.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 743580944c7..5215285aa87 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/win32/rand.c b/misc/win32/rand.c index ab53d0dcfff..dddbbe04b96 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/win32/start.c b/misc/win32/start.c index 7e130afd1cf..be43f54e3c6 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/win32/utf8.c b/misc/win32/utf8.c index f7b70cb87df..d77e656d364 100644 --- a/misc/win32/utf8.c +++ b/misc/win32/utf8.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/mmap/unix/common.c b/mmap/unix/common.c index 05c753aec8e..b300a993d9a 100644 --- a/mmap/unix/common.c +++ b/mmap/unix/common.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 05d3f72efce..fdce7fa7f05 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index 36f99245e38..4db585281bc 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 1ba3fcd54a9..6378a3aaa96 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/network_io/os2/os2calls.c b/network_io/os2/os2calls.c index 70d0ca5a9d0..ef204ca7a8f 100644 --- a/network_io/os2/os2calls.c +++ b/network_io/os2/os2calls.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index 415c2a87d47..a762b7dc317 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c index 97358af7989..7a79e715dce 100644 --- a/network_io/os2/sendrecv_udp.c +++ b/network_io/os2/sendrecv_udp.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 4ad89e51f17..aeaef0db01e 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index afba0ca6f62..5f8a70371c1 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 03d13238569..3c644a9cd15 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 5c8b7b04724..f27e97fb98f 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index ed96168013b..05ae6cce3c5 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 35eade0859d..68b8cdfd0a0 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 11573fdad57..5f5df4802f8 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 94676b8c18d..d095f4bacd9 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index be446b0db7f..7f38aa70366 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index f3089613960..c8dcf3e5fd3 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/poll/os2/poll.c b/poll/os2/poll.c index a9f92b3daf2..7116babf5cf 100644 --- a/poll/os2/poll.c +++ b/poll/os2/poll.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c index f6722182bde..473f2a8a901 100644 --- a/poll/os2/pollset.c +++ b/poll/os2/pollset.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 9bc4a7d9c2e..06ad713ce4c 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index daf46369db1..bb73240b4f6 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/poll/unix/poll.c b/poll/unix/poll.c index bb2ebc0938c..b212f2940ff 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/poll/unix/port.c b/poll/unix/port.c index 4ecb56bf3eb..244ec362d8d 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/poll/unix/select.c b/poll/unix/select.c index e865e6c56b7..e6e84b59a0d 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c index 49af4907938..ae80e0bf8a1 100644 --- a/random/unix/apr_random.c +++ b/random/unix/apr_random.c @@ -1,4 +1,5 @@ -/* Copyright 2003-2004 The Apache Software Foundation +/* Copyright 2003-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/random/unix/sha2.c b/random/unix/sha2.c index 7ce6d659b12..94259ca8508 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -1,4 +1,5 @@ -/* Copyright 2003-2004 The Apache Software Foundation +/* Copyright 2003-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/random/unix/sha2.h b/random/unix/sha2.h index df99e76521a..7f582161499 100644 --- a/random/unix/sha2.h +++ b/random/unix/sha2.h @@ -1,4 +1,5 @@ -/* Copyright 2003-2004 The Apache Software Foundation +/* Copyright 2003-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index d9a0d139980..0f70eed1c81 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c index 03f381d7a74..62949233823 100644 --- a/shmem/os2/shm.c +++ b/shmem/os2/shm.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index db0dc5e7972..d5b0bc6a3d4 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 56ddae7c5ec..6f025718e33 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index 37a39c51a3b..9edba846a31 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index fa4cee3a09d..a4b14230800 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 23531022e3c..973c3209c53 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/strings/apr_strtok.c b/strings/apr_strtok.c index e1b44a9d707..b0326334624 100644 --- a/strings/apr_strtok.c +++ b/strings/apr_strtok.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/support/unix/waitio.c b/support/unix/waitio.c index dae9e38135b..81fea536b52 100644 --- a/support/unix/waitio.c +++ b/support/unix/waitio.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tables/apr_hash.c b/tables/apr_hash.c index fba4ff16293..5cabe4faa0d 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 7b208691c2d..831a71e3c9d 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -1,5 +1,6 @@ #include -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/abts_tests.h b/test/abts_tests.h index 18ef20773ec..744204d0cd8 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/globalmutexchild.c b/test/globalmutexchild.c index 6c8924f1089..e26d0a80951 100644 --- a/test/globalmutexchild.c +++ b/test/globalmutexchild.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/internal/testregex.c b/test/internal/testregex.c index 3b68a4019b1..0103d4482b2 100644 --- a/test/internal/testregex.c +++ b/test/internal/testregex.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/internal/testucs.c b/test/internal/testucs.c index 9212538eb97..80e3454503d 100644 --- a/test/internal/testucs.c +++ b/test/internal/testucs.c @@ -1,4 +1,5 @@ -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/mod_test.c b/test/mod_test.c index 3b4c12f66bf..5184d78c100 100644 --- a/test/mod_test.c +++ b/test/mod_test.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/readchild.c b/test/readchild.c index 2cc274591da..82ef82f6673 100644 --- a/test/readchild.c +++ b/test/readchild.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/sendfile.c b/test/sendfile.c index 1ee1adc83a2..efe1b89186f 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/sockchild.c b/test/sockchild.c index 0e156327f05..c81ec4a3fb0 100644 --- a/test/sockchild.c +++ b/test/sockchild.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testargs.c b/test/testargs.c index 6c136aac422..9dc68beb50b 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testatomic.c b/test/testatomic.c index 62fc4c60e02..95f31119c7e 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testdir.c b/test/testdir.c index 0bb5f3b5a33..bc2ca9ae69b 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testdso.c b/test/testdso.c index 8f67fccd506..5187cdd256e 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testdup.c b/test/testdup.c index 7f4409ea46f..9e025069c5a 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testenv.c b/test/testenv.c index 592f59ccdb8..4d6f55c1c4e 100644 --- a/test/testenv.c +++ b/test/testenv.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testfile.c b/test/testfile.c index 4d7dee62cdb..508ebaf9fa7 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testfilecopy.c b/test/testfilecopy.c index 21db4bcacaf..96b24d7fff9 100644 --- a/test/testfilecopy.c +++ b/test/testfilecopy.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testfileinfo.c b/test/testfileinfo.c index abb08920129..de5415f1159 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testflock.c b/test/testflock.c index dc679e2e762..61e469d3714 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testflock.h b/test/testflock.h index a2020ae2f5d..0c1fd1852e4 100644 --- a/test/testflock.h +++ b/test/testflock.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testfmt.c b/test/testfmt.c index 9d40a1c0324..6cc2c3db409 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testfnmatch.c b/test/testfnmatch.c index ea71889172c..3b01b0f31d7 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index 1a7901ab225..ccd7d7bea50 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testglobalmutex.h b/test/testglobalmutex.h index a8e5b629a36..87581a2dec8 100644 --- a/test/testglobalmutex.h +++ b/test/testglobalmutex.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testhash.c b/test/testhash.c index 61e9f26157c..b2e2b0ac4f5 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testipsub.c b/test/testipsub.c index caf1d46cc06..a5743b0ae3e 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testlock.c b/test/testlock.c index 6fef9b7130d..8e7943ddec6 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testlockperf.c b/test/testlockperf.c index ea2da439430..c0c7236f13b 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testmmap.c b/test/testmmap.c index 96de1abf331..917ab31f365 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testmutexscope.c b/test/testmutexscope.c index 87c135dad56..087f15d1c09 100644 --- a/test/testmutexscope.c +++ b/test/testmutexscope.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testnames.c b/test/testnames.c index e0f7ec822cb..b47cd43c6c3 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testoc.c b/test/testoc.c index 335acab8a9f..b20393b3722 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testpath.c b/test/testpath.c index 68fa3798ca7..4ada86c6232 100644 --- a/test/testpath.c +++ b/test/testpath.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testpipe.c b/test/testpipe.c index 5e9a339eefe..402aa257ecc 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testpoll.c b/test/testpoll.c index 690884a9153..ebcb8acd959 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testpools.c b/test/testpools.c index 5ef6a7ef322..2e81c154bf9 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testproc.c b/test/testproc.c index 259286f1200..68aa5a211c7 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 407a7d9f759..0b7b1310e75 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testrand.c b/test/testrand.c index ceb127f14c0..ca94b60b9df 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testrand2.c b/test/testrand2.c index 8d5b7b07c1b..6dd7b5d6c02 100644 --- a/test/testrand2.c +++ b/test/testrand2.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testshm.c b/test/testshm.c index 189f6244063..7329aa6de00 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testshm.h b/test/testshm.h index bb12f7c42d4..e61b315be43 100644 --- a/test/testshm.h +++ b/test/testshm.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testshmconsumer.c b/test/testshmconsumer.c index 14db1f5e792..bede62fe883 100644 --- a/test/testshmconsumer.c +++ b/test/testshmconsumer.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testshmproducer.c b/test/testshmproducer.c index 93cb5b5ca84..dbab1298fd8 100644 --- a/test/testshmproducer.c +++ b/test/testshmproducer.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testsleep.c b/test/testsleep.c index d933cdf7319..38a3b354d70 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testsock.c b/test/testsock.c index e541da2eda2..e6c8280ca2c 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testsock.h b/test/testsock.h index bf52178e8a8..243cbf9eef8 100644 --- a/test/testsock.h +++ b/test/testsock.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testsockets.c b/test/testsockets.c index d6ed4bb5ab4..69fdf1e5bc6 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testsockopt.c b/test/testsockopt.c index 1a97c1454a9..28d4fe31d5e 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/teststr.c b/test/teststr.c index 99aa8af4164..490d5e184ca 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/teststrnatcmp.c b/test/teststrnatcmp.c index bd25cb31372..c0b92d619df 100644 --- a/test/teststrnatcmp.c +++ b/test/teststrnatcmp.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testtable.c b/test/testtable.c index 82a0120c2f5..8803a717388 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -1,4 +1,5 @@ -/* Copyright 2002-2004 The Apache Software Foundation +/* Copyright 2002-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testtemp.c b/test/testtemp.c index 03bcfb436f3..bff48d25322 100644 --- a/test/testtemp.c +++ b/test/testtemp.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testthread.c b/test/testthread.c index 8a49e82cd1a..44ed57b282b 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testtime.c b/test/testtime.c index 9803ebdfd12..4ba09e2dcad 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testud.c b/test/testud.c index 8c66d023af4..ef9a61b32d0 100644 --- a/test/testud.c +++ b/test/testud.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testuser.c b/test/testuser.c index b3ca3e16fd3..a2ccb887ee7 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testutil.c b/test/testutil.c index 51f0326b6c6..44c0b6b583e 100644 --- a/test/testutil.c +++ b/test/testutil.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testutil.h b/test/testutil.h index 3e6118db6bf..76dd8d912e8 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testvsn.c b/test/testvsn.c index 32c0bd5b399..1840b7ac5cc 100644 --- a/test/testvsn.c +++ b/test/testvsn.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/tryread.c b/test/tryread.c index 84558806873..26274ca5e79 100644 --- a/test/tryread.c +++ b/test/tryread.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/beos/apr_proc_stub.c b/threadproc/beos/apr_proc_stub.c index dce3add7315..0c069f7ec3a 100644 --- a/threadproc/beos/apr_proc_stub.c +++ b/threadproc/beos/apr_proc_stub.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 9f1dd4cbb3b..1bde8e3c989 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 7c63bf7af4a..68cbdf1d851 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index 5f1077762b9..15dcd3a0736 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/beos/threadproc_common.c b/threadproc/beos/threadproc_common.c index 04ea270deaa..96c6e8a4ef6 100644 --- a/threadproc/beos/threadproc_common.c +++ b/threadproc/beos/threadproc_common.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index e72234f74d5..2622ba89558 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/netware/procsup.c b/threadproc/netware/procsup.c index 6bd4c9183b8..008dcaae0c8 100644 --- a/threadproc/netware/procsup.c +++ b/threadproc/netware/procsup.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c index 1ac51c70a19..c2903251b45 100644 --- a/threadproc/netware/signals.c +++ b/threadproc/netware/signals.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 466d9911557..35ae8c88c79 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/netware/threadpriv.c b/threadproc/netware/threadpriv.c index 7f7297dd142..2e99e522f72 100644 --- a/threadproc/netware/threadpriv.c +++ b/threadproc/netware/threadpriv.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 7fa9dc7c2da..3ea770d0a96 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 582ad78a25b..8235bff8a50 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index 4e5de448083..041ff182f9c 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index f6773b14040..08e4a8d5769 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index a787f5308be..5165a8f9e37 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 4b8f2af97ba..e2f0fe0f159 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2005 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index ef0aa21b940..c32869c60cc 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 5fbc450a6d4..77088a1b48c 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 7ff680f8c3e..df75b836b14 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 12d865edbb6..d4d8a640265 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 95132cb4b52..33e9afcde40 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 17687169d9f..0d45b0da23d 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/time/unix/time.c b/time/unix/time.c index b005cf67b25..ffc0c697cc4 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2005 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/time/unix/timestr.c b/time/unix/timestr.c index 06015ab660d..770cdb3b591 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2005 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/time/win32/access.c b/time/win32/access.c index 99e749b2351..e746fca1f6f 100644 --- a/time/win32/access.c +++ b/time/win32/access.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/time/win32/time.c b/time/win32/time.c index 35743b3d2b2..89d6d5e4008 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/time/win32/timestr.c b/time/win32/timestr.c index f556054f3cc..9a288ab225e 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/user/netware/groupinfo.c b/user/netware/groupinfo.c index ad19147966a..5e247474f63 100644 --- a/user/netware/groupinfo.c +++ b/user/netware/groupinfo.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/user/netware/userinfo.c b/user/netware/userinfo.c index a5cdf3f7787..a960406b4e5 100644 --- a/user/netware/userinfo.c +++ b/user/netware/userinfo.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 18d13b1efa6..91ef4df0dff 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index dfd34c528be..a15b22184ce 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index f12102b16da..622b9aa1c07 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index caf676b9306..6bee0055a40 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From da6e57f0aa5d16cf2265dd6c8c229ed7b7901dd6 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 5 Feb 2005 06:53:52 +0000 Subject: [PATCH 5316/7878] this is the C preprocessor flags. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151482 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apr-config.in b/apr-config.in index 7b8462ed2dd..718f0c62ac8 100644 --- a/apr-config.in +++ b/apr-config.in @@ -59,7 +59,7 @@ Known values for OPTION are: --cc print C compiler name --cpp print C preprocessor name and any required options --cflags print C compiler flags - --cppflags print cpp flags + --cppflags print C preprocessor flags --includes print include information --ldflags print linker flags --libs print additional libraries to link against From 14433795a0d9270140a9ace43490402d80478771 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Sat, 5 Feb 2005 09:42:46 +0000 Subject: [PATCH 5317/7878] Fix posix rwlock detection (on Darwin). PTHREAD_RWLOCK_INITIALIZER is no longer part of the posix spec, according to http://www.opengroup.org/onlinepubs/009695399/basedefs/pthread.h.html git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151487 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index aa8442b5fe8..fbba81b4445 100644 --- a/configure.in +++ b/configure.in @@ -603,7 +603,7 @@ else dnl ----------------------------- Checking for pthread_rwlock_t AC_CACHE_CHECK([for pthread_rwlock_t], [apr_cv_type_rwlock_t], AC_TRY_COMPILE([#include -#include ], [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;], +#include ], [pthread_rwlock_t *rwlock;], [apr_cv_type_rwlock_t=yes], [apr_cv_type_rwlock_t=no], [apr_cv_type_rwlock_t=no])) if test "$apr_cv_type_rwlock_t" = "yes"; then From 0e321a1ee93dc9d639f1047af9cb79a5e5680fd3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 7 Feb 2005 22:44:09 +0000 Subject: [PATCH 5318/7878] In order to remove the win32ver.awk generation of .rc files for apr, it's necessary to have a 'vanilla' c preprocessor file which doesn't have all the extra apr.h or other function declaration cruft. ap_release.h is the httpd project's convention, and it seems to fit the bill. Provide "big red warnings" (tm) to not use this new file directly, if the user wants to retain compatibility with APR 0.x/1.x. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151766 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 3 ++ include/apr_release.h | 93 +++++++++++++++++++++++++++++++++++++++++++ include/apr_version.h | 42 +------------------ 3 files changed, 98 insertions(+), 40 deletions(-) create mode 100644 include/apr_release.h diff --git a/include/apr_general.h b/include/apr_general.h index de415b9de8f..0172780712f 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -144,10 +144,13 @@ int strncasecmp(const char *a, const char *b, size_t n); * String and memory functions */ +/* APR_STRINGIFY is defined here, and also in apr_revision.h, so wrap it */ +#ifndef APR_STRINGIFY /** Properly quote a value as a string in the C preprocessor */ #define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) /** Helper macro for APR_STRINGIFY */ #define APR_STRINGIFY_HELPER(n) #n +#endif #if (!APR_HAVE_MEMMOVE) #define memmove(a,b,c) bcopy(b,a,c) diff --git a/include/apr_release.h b/include/apr_release.h new file mode 100644 index 00000000000..02dc13f9b64 --- /dev/null +++ b/include/apr_release.h @@ -0,0 +1,93 @@ +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_RELEASE_H +#define APR_RELEASE_H + +/** + * @file apr_release.h + * @brief APR Versioning Constants + * + * APR's Versioning Constants + * + * This file was introduced to support C Preprocessing without the + * heavyweight C API or apr.h prerequisite, and can only be expected + * to exist in 1.2, 2.x and later versions of APR. + * + * Do NOT directly include this file when targeting APR 0.x or 1.x, + * include apr_version.h instead. + */ + +/* The numeric compile-time version constants. These constants are the + * authoritative version numbers for APR. + */ + +/** major version + * Major API changes that could cause compatibility problems for older + * programs such as structure size changes. No binary compatibility is + * possible across a change in the major version. + */ +#define APR_MAJOR_VERSION 1 + +/** minor version + * Minor API changes that do not cause binary compatibility problems. + * Reset to 0 when upgrading APR_MAJOR_VERSION + */ +#define APR_MINOR_VERSION 2 + +/** patch level + * The Patch Level never includes API changes, simply bug fixes. + * Reset to 0 when upgrading APR_MINOR_VERSION + */ +#define APR_PATCH_VERSION 0 + +/** + * The symbol APR_IS_DEV_VERSION is only defined for internal, + * "development" copies of APR. It is undefined for released versions + * of APR. + */ +#define APR_IS_DEV_VERSION + + +#if defined(APR_IS_DEV_VERSION) || defined(DOXYGEN) +/** Internal: string form of the "is dev" flag */ +#define APR_IS_DEV_STRING "-dev" +#else +#define APR_IS_DEV_STRING "" +#endif + +/* APR_STRINGIFY is defined here, and also in apr_general.h, so wrap it */ +#ifndef APR_STRINGIFY +/** Properly quote a value as a string in the C preprocessor */ +#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) +/** Helper macro for APR_STRINGIFY */ +#define APR_STRINGIFY_HELPER(n) #n +#endif + +/** The formatted string of APR's version */ +#define APR_VERSION_STRING \ + APR_STRINGIFY(APR_MAJOR_VERSION) "." \ + APR_STRINGIFY(APR_MINOR_VERSION) "." \ + APR_STRINGIFY(APR_PATCH_VERSION) \ + APR_IS_DEV_STRING + +/** An alternative formatted string of APR's version */ +/* macro for Win32 .rc files using numeric csv representation */ +#define APR_VERSION_STRING_CSV APR_MAJOR_VERSION ##, \ + ##APR_MINOR_VERSION ##, \ + ##APR_PATCH_VERSION + +#endif /* ndef APR_RELEASE_H */ \ No newline at end of file diff --git a/include/apr_version.h b/include/apr_version.h index 77c17b2a820..ec6543741e2 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -19,6 +19,8 @@ #include "apr.h" +#include "apr_release.h" + #ifdef __cplusplus extern "C" { #endif @@ -43,39 +45,6 @@ extern "C" { * http://apr.apache.org/versioning.html */ -/* The numeric compile-time version constants. These constants are the - * authoritative version numbers for APR. - */ - -/** major version - * Major API changes that could cause compatibility problems for older - * programs such as structure size changes. No binary compatibility is - * possible across a change in the major version. - */ -#define APR_MAJOR_VERSION 1 - -/** - * Minor API changes that do not cause binary compatibility problems. - * Should be reset to 0 when upgrading APR_MAJOR_VERSION - */ -#define APR_MINOR_VERSION 2 - -/** patch level */ -#define APR_PATCH_VERSION 0 - -/** - * This symbol is defined for internal, "development" copies of APR. - * This symbol should be #undef'd for releases. - */ -#define APR_IS_DEV_VERSION - -/** The formatted string of APR's version */ -#define APR_VERSION_STRING \ - APR_STRINGIFY(APR_MAJOR_VERSION) "." \ - APR_STRINGIFY(APR_MINOR_VERSION) "." \ - APR_STRINGIFY(APR_PATCH_VERSION) \ - APR_IS_DEV_STRING - /** * The numeric version information is broken out into fields within this @@ -100,13 +69,6 @@ APR_DECLARE(void) apr_version(apr_version_t *pvsn); APR_DECLARE(const char *) apr_version_string(void); -/** Internal: string form of the "is dev" flag */ -#ifdef APR_IS_DEV_VERSION -#define APR_IS_DEV_STRING "-dev" -#else -#define APR_IS_DEV_STRING "" -#endif - #ifdef __cplusplus } #endif From 81eb7f83747e0b9458f865512bb6b2806441dcf5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 7 Feb 2005 22:49:34 +0000 Subject: [PATCH 5319/7878] apr_revision? Whoops - I rethought that, decided on apr_release.h to match httpd, and didn't revisit this comment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151767 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_general.h b/include/apr_general.h index 0172780712f..5973a986ea7 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -144,7 +144,7 @@ int strncasecmp(const char *a, const char *b, size_t n); * String and memory functions */ -/* APR_STRINGIFY is defined here, and also in apr_revision.h, so wrap it */ +/* APR_STRINGIFY is defined here, and also in apr_release.h, so wrap it */ #ifndef APR_STRINGIFY /** Properly quote a value as a string in the C preprocessor */ #define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) From 8da71f95edd65099a387af4975e7cd36617ae2c2 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 7 Feb 2005 23:12:15 +0000 Subject: [PATCH 5320/7878] * docs/doxygen.conf: Set CASE_SENSE_NAMES=NO and comment out STRIP_FROM_PATH. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151769 13f79535-47bb-0310-9956-ffa450edef68 --- docs/doxygen.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/doxygen.conf b/docs/doxygen.conf index 69d41c44eae..29c2cbf6941 100644 --- a/docs/doxygen.conf +++ b/docs/doxygen.conf @@ -25,9 +25,10 @@ OPTIMIZE_OUTPUT_FOR_C=YES STRIP_CODE_COMMENTS=NO FULL_PATH_NAMES=NO +CASE_SENSE_NAMES=NO # some autoconf guru needs to make configure set this correctly... # in the meantime, simply listing the headers should be alright -STRIP_FROM_PATH=/buildpath/apr +#STRIP_FROM_PATH=/buildpath/apr EXCLUDE_PATTERNS="*/acconfig.h" \ "*/test/*" \ From 3c9e3cec163e92def33e6fdf8565fe09ee185ac7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 7 Feb 2005 23:21:49 +0000 Subject: [PATCH 5321/7878] No newline == bad form, my bad. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151774 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_release.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_release.h b/include/apr_release.h index 02dc13f9b64..473645010f6 100644 --- a/include/apr_release.h +++ b/include/apr_release.h @@ -90,4 +90,4 @@ ##APR_MINOR_VERSION ##, \ ##APR_PATCH_VERSION -#endif /* ndef APR_RELEASE_H */ \ No newline at end of file +#endif /* ndef APR_RELEASE_H */ From 1fc947a9507c330d62339bc831f0719d4fdb6b3f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 7 Feb 2005 23:28:14 +0000 Subject: [PATCH 5322/7878] This is (part of) the point to apr_release.h, although that name is certainly subject to discussion. Elimiate use of win32ver.awk for creating libapr.rc. Simply pull in the cpp macros from apr_release.h. The issue is that we could not do this with apr_version.h due to how complex the c grammer has become. We need a lightweight c preprocessor file for the resource compiler (rc) to parse. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151780 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 35 ++--------------------------------- libapr.rc | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 33 deletions(-) create mode 100644 libapr.rc diff --git a/libapr.dsp b/libapr.dsp index 5999c3d29f5..80c415875c2 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -47,7 +47,7 @@ RSC=rc.exe # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" /I "./include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -73,7 +73,7 @@ LINK32=link.exe # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" /I "./include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -636,37 +636,6 @@ SOURCE=.\include\apr_want.h # Begin Source File SOURCE=.\libapr.rc -# End Source File -# Begin Source File - -SOURCE=.\build\win32ver.awk - -!IF "$(CFG)" == "libapr - Win32 Release" - -# PROP Ignore_Default_Tool 1 -USERDEP__WIN32="./include/apr_version.h" -# Begin Custom Build - Creating Version Resource -InputPath=.\build\win32ver.awk - -".\libapr.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - awk -f ./build/win32ver.awk libapr.dll "Apache Portability Runtime Library" ./include/apr_version.h > .\libapr.rc - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - Win32 Debug" - -# PROP Ignore_Default_Tool 1 -USERDEP__WIN32="./include/apr_version.h" -# Begin Custom Build - Creating Version Resource -InputPath=.\build\win32ver.awk - -".\libapr.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - awk -f ./build/win32ver.awk libapr.dll "Apache Portability Runtime Library" ./include/apr_version.h > .\libapr.rc - -# End Custom Build - -!ENDIF - # End Source File # End Target # End Project diff --git a/libapr.rc b/libapr.rc new file mode 100644 index 00000000000..e9a15be1c3c --- /dev/null +++ b/libapr.rc @@ -0,0 +1,35 @@ +#include "apr_release.h" + +1 VERSIONINFO + FILEVERSION APR_VERSION_STRING_CSV,0 + PRODUCTVERSION APR_VERSION_STRING_CSV,0 + FILEFLAGSMASK 0x3fL +#if defined(_DEBUG) + FILEFLAGS 0x01L +#else + FILEFLAGS 0x00L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "Licensed under the Apache License, Version 2.0 (the ""License""); you may not use this file except in compliance with the License. You may obtain a copy of the License at\r\n\r\nhttp://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an ""AS IS"" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\0" + VALUE "CompanyName", "Apache Software Foundation\0" + VALUE "FileDescription", "Apache Portability Runtime Library\0" + VALUE "FileVersion", APR_VERSION_STRING "\0" + VALUE "InternalName", "libapr\0" + VALUE "LegalCopyright", "Copyright 2000-2005 The Apache Software Foundation or its licensors, as applicable.\0" + VALUE "OriginalFilename", "libapr.dll\0" + VALUE "ProductName", "Apache Portablity Runtime Project\0" + VALUE "ProductVersion", APR_VERSION_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END From 791080e0415dcab894612b81f72135b59259feec Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 7 Feb 2005 23:40:06 +0000 Subject: [PATCH 5323/7878] Since reaction is negative to a seperate apr_release.h file for the CPP-only grammer, acknowledge APR_VERSION_ONLY in order to compile to apr_version.h without including apr.h, nor declaring the APR C runtime version API. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151788 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_release.h | 93 ------------------------------------------- include/apr_version.h | 87 +++++++++++++++++++++++++++++++++++----- libapr.dsp | 4 +- libapr.rc | 2 +- 4 files changed, 80 insertions(+), 106 deletions(-) delete mode 100644 include/apr_release.h diff --git a/include/apr_release.h b/include/apr_release.h deleted file mode 100644 index 473645010f6..00000000000 --- a/include/apr_release.h +++ /dev/null @@ -1,93 +0,0 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef APR_RELEASE_H -#define APR_RELEASE_H - -/** - * @file apr_release.h - * @brief APR Versioning Constants - * - * APR's Versioning Constants - * - * This file was introduced to support C Preprocessing without the - * heavyweight C API or apr.h prerequisite, and can only be expected - * to exist in 1.2, 2.x and later versions of APR. - * - * Do NOT directly include this file when targeting APR 0.x or 1.x, - * include apr_version.h instead. - */ - -/* The numeric compile-time version constants. These constants are the - * authoritative version numbers for APR. - */ - -/** major version - * Major API changes that could cause compatibility problems for older - * programs such as structure size changes. No binary compatibility is - * possible across a change in the major version. - */ -#define APR_MAJOR_VERSION 1 - -/** minor version - * Minor API changes that do not cause binary compatibility problems. - * Reset to 0 when upgrading APR_MAJOR_VERSION - */ -#define APR_MINOR_VERSION 2 - -/** patch level - * The Patch Level never includes API changes, simply bug fixes. - * Reset to 0 when upgrading APR_MINOR_VERSION - */ -#define APR_PATCH_VERSION 0 - -/** - * The symbol APR_IS_DEV_VERSION is only defined for internal, - * "development" copies of APR. It is undefined for released versions - * of APR. - */ -#define APR_IS_DEV_VERSION - - -#if defined(APR_IS_DEV_VERSION) || defined(DOXYGEN) -/** Internal: string form of the "is dev" flag */ -#define APR_IS_DEV_STRING "-dev" -#else -#define APR_IS_DEV_STRING "" -#endif - -/* APR_STRINGIFY is defined here, and also in apr_general.h, so wrap it */ -#ifndef APR_STRINGIFY -/** Properly quote a value as a string in the C preprocessor */ -#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) -/** Helper macro for APR_STRINGIFY */ -#define APR_STRINGIFY_HELPER(n) #n -#endif - -/** The formatted string of APR's version */ -#define APR_VERSION_STRING \ - APR_STRINGIFY(APR_MAJOR_VERSION) "." \ - APR_STRINGIFY(APR_MINOR_VERSION) "." \ - APR_STRINGIFY(APR_PATCH_VERSION) \ - APR_IS_DEV_STRING - -/** An alternative formatted string of APR's version */ -/* macro for Win32 .rc files using numeric csv representation */ -#define APR_VERSION_STRING_CSV APR_MAJOR_VERSION ##, \ - ##APR_MINOR_VERSION ##, \ - ##APR_PATCH_VERSION - -#endif /* ndef APR_RELEASE_H */ diff --git a/include/apr_version.h b/include/apr_version.h index ec6543741e2..e309bf67c73 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -17,14 +17,6 @@ #ifndef APR_VERSION_H #define APR_VERSION_H -#include "apr.h" - -#include "apr_release.h" - -#ifdef __cplusplus -extern "C" { -#endif - /** * @file apr_version.h * @brief APR Versioning Interface @@ -46,6 +38,80 @@ extern "C" { */ +/* The numeric compile-time version constants. These constants are the + * authoritative version numbers for APR. + */ + +/** major version + * Major API changes that could cause compatibility problems for older + * programs such as structure size changes. No binary compatibility is + * possible across a change in the major version. + */ +#define APR_MAJOR_VERSION 1 + +/** minor version + * Minor API changes that do not cause binary compatibility problems. + * Reset to 0 when upgrading APR_MAJOR_VERSION + */ +#define APR_MINOR_VERSION 2 + +/** patch level + * The Patch Level never includes API changes, simply bug fixes. + * Reset to 0 when upgrading APR_MINOR_VERSION + */ +#define APR_PATCH_VERSION 0 + +/** + * The symbol APR_IS_DEV_VERSION is only defined for internal, + * "development" copies of APR. It is undefined for released versions + * of APR. + */ +#define APR_IS_DEV_VERSION + + +#if defined(APR_IS_DEV_VERSION) || defined(DOXYGEN) +/** Internal: string form of the "is dev" flag */ +#define APR_IS_DEV_STRING "-dev" +#else +#define APR_IS_DEV_STRING "" +#endif + +/* APR_STRINGIFY is defined here, and also in apr_general.h, so wrap it */ +#ifndef APR_STRINGIFY +/** Properly quote a value as a string in the C preprocessor */ +#define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) +/** Helper macro for APR_STRINGIFY */ +#define APR_STRINGIFY_HELPER(n) #n +#endif + +/** The formatted string of APR's version */ +#define APR_VERSION_STRING \ + APR_STRINGIFY(APR_MAJOR_VERSION) "." \ + APR_STRINGIFY(APR_MINOR_VERSION) "." \ + APR_STRINGIFY(APR_PATCH_VERSION) \ + APR_IS_DEV_STRING + +/** An alternative formatted string of APR's version */ +/* macro for Win32 .rc files using numeric csv representation */ +#define APR_VERSION_STRING_CSV APR_MAJOR_VERSION ##, \ + ##APR_MINOR_VERSION ##, \ + ##APR_PATCH_VERSION + + +#ifndef APR_VERSION_ONLY + +/* The C language API to access the version at run time, + * as opposed to compile time. APR_VERSION_ONLY may be defined + * externally when preprocessing apr_version.h to obtain strictly + * the C Preprocessor macro declarations. + */ + +#include "apr.h" + +#ifdef __cplusplus +extern "C" { +#endif + /** * The numeric version information is broken out into fields within this * structure. @@ -68,9 +134,10 @@ APR_DECLARE(void) apr_version(apr_version_t *pvsn); /** Return APR's version information as a string. */ APR_DECLARE(const char *) apr_version_string(void); - #ifdef __cplusplus } #endif -#endif /* APR_VERSION_H */ +#endif /* ndef APR_VERSION_ONLY */ + +#endif /* ndef APR_VERSION_H */ diff --git a/libapr.dsp b/libapr.dsp index 80c415875c2..a4b1d4d3347 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -47,7 +47,7 @@ RSC=rc.exe # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" /I "./include" +# ADD RSC /l 0x409 /d "NDEBUG" /d "APR_VERSION_ONLY" /I "./include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -73,7 +73,7 @@ LINK32=link.exe # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" /I "./include" +# ADD RSC /l 0x409 /d "_DEBUG" /d "APR_VERSION_ONLY" /I "./include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/libapr.rc b/libapr.rc index e9a15be1c3c..de9feefda3e 100644 --- a/libapr.rc +++ b/libapr.rc @@ -1,4 +1,4 @@ -#include "apr_release.h" +#include "apr_version.h" 1 VERSIONINFO FILEVERSION APR_VERSION_STRING_CSV,0 From 63194d19f1a7584888f790fb816c68a79cad39ec Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 7 Feb 2005 23:53:11 +0000 Subject: [PATCH 5324/7878] Two pendantic tweaks. Use the internal library filename, with the version designator (e.g. libapr-1.dll), and fix the name of the project to agree with the website http://apr.apache.org/. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151793 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.rc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libapr.rc b/libapr.rc index de9feefda3e..adbd12fa2e5 100644 --- a/libapr.rc +++ b/libapr.rc @@ -1,5 +1,7 @@ #include "apr_version.h" +#define APR_DLL_FILENAME "libapr-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll" + 1 VERSIONINFO FILEVERSION APR_VERSION_STRING_CSV,0 PRODUCTVERSION APR_VERSION_STRING_CSV,0 @@ -19,12 +21,12 @@ BEGIN BEGIN VALUE "Comments", "Licensed under the Apache License, Version 2.0 (the ""License""); you may not use this file except in compliance with the License. You may obtain a copy of the License at\r\n\r\nhttp://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an ""AS IS"" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\0" VALUE "CompanyName", "Apache Software Foundation\0" - VALUE "FileDescription", "Apache Portability Runtime Library\0" + VALUE "FileDescription", "Apache Portable Runtime Library\0" VALUE "FileVersion", APR_VERSION_STRING "\0" - VALUE "InternalName", "libapr\0" + VALUE "InternalName", APR_DLL_FILENAME "\0" VALUE "LegalCopyright", "Copyright 2000-2005 The Apache Software Foundation or its licensors, as applicable.\0" - VALUE "OriginalFilename", "libapr.dll\0" - VALUE "ProductName", "Apache Portablity Runtime Project\0" + VALUE "OriginalFilename", APR_DLL_FILENAME "\0" + VALUE "ProductName", "Apache Portable Runtime Project\0" VALUE "ProductVersion", APR_VERSION_STRING "\0" END END From 0448ec2d19eaa585aa94b77904e501099b37908d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 8 Feb 2005 01:10:44 +0000 Subject: [PATCH 5325/7878] A brief inspection reveals that InternalName generally does not have a filename extension. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151804 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.rc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libapr.rc b/libapr.rc index adbd12fa2e5..9c0f0748b65 100644 --- a/libapr.rc +++ b/libapr.rc @@ -1,6 +1,6 @@ #include "apr_version.h" -#define APR_DLL_FILENAME "libapr-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll" +#define APR_DLL_BASENAME "libapr-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll" 1 VERSIONINFO FILEVERSION APR_VERSION_STRING_CSV,0 @@ -23,9 +23,9 @@ BEGIN VALUE "CompanyName", "Apache Software Foundation\0" VALUE "FileDescription", "Apache Portable Runtime Library\0" VALUE "FileVersion", APR_VERSION_STRING "\0" - VALUE "InternalName", APR_DLL_FILENAME "\0" + VALUE "InternalName", APR_DLL_BASENAME "\0" VALUE "LegalCopyright", "Copyright 2000-2005 The Apache Software Foundation or its licensors, as applicable.\0" - VALUE "OriginalFilename", APR_DLL_FILENAME "\0" + VALUE "OriginalFilename", APR_DLL_BASENAME ".dll\0" VALUE "ProductName", "Apache Portable Runtime Project\0" VALUE "ProductVersion", APR_VERSION_STRING "\0" END From 81d791ebe95c7ad465282c6e85b3633a21754467 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 8 Feb 2005 01:13:01 +0000 Subject: [PATCH 5326/7878] Whoops, basename includes no suffix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151805 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libapr.rc b/libapr.rc index 9c0f0748b65..f188357973e 100644 --- a/libapr.rc +++ b/libapr.rc @@ -1,6 +1,6 @@ #include "apr_version.h" -#define APR_DLL_BASENAME "libapr-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll" +#define APR_DLL_BASENAME "libapr-" APR_STRINGIFY(APR_MAJOR_VERSION) 1 VERSIONINFO FILEVERSION APR_VERSION_STRING_CSV,0 From 2a0f6c01a3bf4893a42000a9a5728ef6b0527dec Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 8 Feb 2005 01:29:52 +0000 Subject: [PATCH 5327/7878] Well, with a bit of macro magic, even .rc files can observe our 80 character terminal width guildlines. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151806 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.rc | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/libapr.rc b/libapr.rc index f188357973e..1344fc084ff 100644 --- a/libapr.rc +++ b/libapr.rc @@ -1,7 +1,24 @@ #include "apr_version.h" +#define APR_COPYRIGHT "Copyright 2000-2005 The Apache Software " \ + "Foundation or its licensors, as applicable." + +#define APR_LICENSE "Licensed under the Apache License, Version 2.0 " \ + "(the ""License""); you may not use this file except " \ + "in compliance with the License. You may obtain a " \ + "copy of the License at\r\n\r\n" \ + "http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n" \ + "Unless required by applicable law or agreed to in " \ + "writing, software distributed under the License is " \ + "distributed on an ""AS IS"" BASIS, WITHOUT " \ + "WARRANTIES OR CONDITIONS OF ANY KIND, either " \ + "express or implied. See the License for the " \ + "specific language governing permissions and " \ + "limitations under the License." + #define APR_DLL_BASENAME "libapr-" APR_STRINGIFY(APR_MAJOR_VERSION) + 1 VERSIONINFO FILEVERSION APR_VERSION_STRING_CSV,0 PRODUCTVERSION APR_VERSION_STRING_CSV,0 @@ -19,12 +36,12 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "Comments", "Licensed under the Apache License, Version 2.0 (the ""License""); you may not use this file except in compliance with the License. You may obtain a copy of the License at\r\n\r\nhttp://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an ""AS IS"" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\0" + VALUE "Comments", APR_LICENSE "\0" VALUE "CompanyName", "Apache Software Foundation\0" VALUE "FileDescription", "Apache Portable Runtime Library\0" VALUE "FileVersion", APR_VERSION_STRING "\0" VALUE "InternalName", APR_DLL_BASENAME "\0" - VALUE "LegalCopyright", "Copyright 2000-2005 The Apache Software Foundation or its licensors, as applicable.\0" + VALUE "LegalCopyright", APR_COPYRIGHT "\0" VALUE "OriginalFilename", APR_DLL_BASENAME ".dll\0" VALUE "ProductName", "Apache Portable Runtime Project\0" VALUE "ProductVersion", APR_VERSION_STRING "\0" From d7783808a0fa68e634a4e7b9bd3123bb5faa3d58 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 15 Feb 2005 08:26:46 +0000 Subject: [PATCH 5328/7878] * network_io/unix/multicast.c (apr_mcast_leave): Rename 'leave' argument to 'addr' to fix Tru64 5.0 build, where "leave" is #defined to some weird builtin. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@153917 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 4 ++-- network_io/unix/multicast.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index a67c9bb6e5e..68d8a7c49ba 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -771,14 +771,14 @@ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, * Leave a Multicast Group. All arguments must be the same as * apr_mcast_join. * @param sock The socket to leave a multicast group - * @param leave The address of the multicast group to leave + * @param addr The address of the multicast group to leave * @param iface Address of the interface to use. If NULL is passed, the * default multicast interface will be used. (OS Dependent) * @param source Source Address to accept transmissions from (non-NULL * implies Source-Specific Multicast) */ APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, - apr_sockaddr_t *leave, + apr_sockaddr_t *addr, apr_sockaddr_t *iface, apr_sockaddr_t *source); diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index 695500f196b..95b538248d9 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -268,12 +268,12 @@ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, } APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, - apr_sockaddr_t *leave, + apr_sockaddr_t *addr, apr_sockaddr_t *iface, apr_sockaddr_t *source) { #ifdef IP_DROP_MEMBERSHIP - return do_mcast(IP_DROP_MEMBERSHIP, sock, leave, iface, source); + return do_mcast(IP_DROP_MEMBERSHIP, sock, addr, iface, source); #else return APR_ENOTIMPL; #endif From e879e15b5fd953557a3f295d9775688d212e7533 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 15 Feb 2005 12:01:00 +0000 Subject: [PATCH 5329/7878] Fix HP-UX 11.00 build, where the IP multicast interfaces are not declared if _XOPEN_SOURCE_EXTENDED is defined (which apr_hints.m4 does): * build/apr_network.m4 (APR_CHECK_MCAST): New macro. * configure.in: Use APR_CHECK_MCAST. * network_io/unix/multicast.c: Make implementation conditional on HAVE_STRUCT_IPMREQ. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@153932 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 16 ++++++++++++++++ configure.in | 1 + network_io/unix/multicast.c | 12 +++++++----- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index a16cf793099..0e1b096146a 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -667,6 +667,22 @@ else fi ]) +dnl APR_CHECK_MCAST: check for multicast interfaces +AC_DEFUN([APR_CHECK_MCAST], [ +AC_CACHE_CHECK([for struct ip_mreq], [apr_cv_struct_ipmreq], [ +AC_TRY_COMPILE([ +#include +#include +], [ + struct ip_mreq mip; + mip.imr_interface.s_addr = INADDR_ANY; +], [apr_cv_struct_ipmreq=yes], [apr_cv_struct_ipmreq=no], [apr_cv_struct_ipmreq=yes])]) + +if test $apr_cv_struct_ipmreq = yes; then + AC_DEFINE([HAVE_STRUCT_IPMREQ], 1, [Define if struct impreq was found]) +fi +]) + dnl dnl APR_CHECK_H_ERRNO_FLAG dnl diff --git a/configure.in b/configure.in index fbba81b4445..186ad770c84 100644 --- a/configure.in +++ b/configure.in @@ -1908,6 +1908,7 @@ else fi APR_CHECK_SCTP +APR_CHECK_MCAST AC_SUBST(apr_tcp_nopush_flag) AC_SUBST(have_corkable_tcp) diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index 95b538248d9..eb4304f07c2 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -24,6 +24,7 @@ #include #endif +#ifdef HAVE_STRUCT_IPMREQ /* Only UDP and Raw Sockets can be used for Multicast */ static apr_status_t mcast_check_type(apr_socket_t *sock) { @@ -254,13 +255,14 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, return rv; } +#endif APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, apr_sockaddr_t *join, apr_sockaddr_t *iface, apr_sockaddr_t *source) { -#ifdef IP_ADD_MEMBERSHIP +#if defined(IP_ADD_MEMBERSHIP) && defined(HAVE_STRUCT_IPMREQ) return do_mcast(IP_ADD_MEMBERSHIP, sock, join, iface, source); #else return APR_ENOTIMPL; @@ -272,7 +274,7 @@ APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, apr_sockaddr_t *iface, apr_sockaddr_t *source) { -#ifdef IP_DROP_MEMBERSHIP +#if defined(IP_DROP_MEMBERSHIP) && defined(HAVE_STRUCT_IPMREQ) return do_mcast(IP_DROP_MEMBERSHIP, sock, addr, iface, source); #else return APR_ENOTIMPL; @@ -281,7 +283,7 @@ APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, apr_byte_t ttl) { -#ifdef IP_MULTICAST_TTL +#if defined(IP_MULTICAST_TTL) && defined(HAVE_STRUCT_IPMREQ) return do_mcast_opt(IP_MULTICAST_TTL, sock, ttl); #else return APR_ENOTIMPL; @@ -291,7 +293,7 @@ APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, apr_byte_t ttl) APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock, apr_byte_t opt) { -#ifdef IP_MULTICAST_LOOP +#if defined(IP_MULTICAST_LOOP) && defined(HAVE_STRUCT_IPMREQ) return do_mcast_opt(IP_MULTICAST_LOOP, sock, opt); #else return APR_ENOTIMPL; @@ -301,7 +303,7 @@ APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock, apr_sockaddr_t *iface) { -#ifdef IP_MULTICAST_IF +#if defined(IP_MULTICAST_IF) && defined(HAVE_STRUCT_IPMREQ) apr_status_t rv = APR_SUCCESS; if (sock_is_ipv4(sock)) { From 28f53dcb4ee90b40d61ece1435bb99ae31325713 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 24 Feb 2005 08:07:33 +0000 Subject: [PATCH 5330/7878] * build/find_apr.m4: Try installed APR before bundled copy if --with-apr not passed to configure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@155175 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ build/find_apr.m4 | 43 ++++++++++++++++++++++--------------------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/CHANGES b/CHANGES index eb6a4095865..07fc2d20f9a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Changes for APR 1.2.0 + + *) find_apr.m4: Try installed APR before bundled copy if --with-apr not + passed to configure. [Justin Erenkrantz] + Changes for APR 1.1.0 *) Added apr_procattr_user_set and apr_procattr_group_set diff --git a/build/find_apr.m4 b/build/find_apr.m4 index d8a29dd81c0..9228c769bbc 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -118,8 +118,28 @@ AC_DEFUN([APR_FIND_APR], [ AC_MSG_ERROR([the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.]) fi ],[ - dnl if we have a bundled source directory, use it - if test -d "$1"; then + dnl If we allow installed copies, check those before using bundled copy. + if test -n "$3" && test "$3" = "1"; then + for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config + do + if $apr_temp_apr_config_file --help > /dev/null 2>&1 ; then + apr_found="yes" + apr_config="$apr_temp_apr_config_file" + break + else + dnl look in some standard places + for lookdir in /usr /usr/local /usr/local/apr /opt/apr /usr/local/apache2; do + if $TEST_X "$lookdir/bin/$apr_temp_apr_config_file"; then + apr_found="yes" + apr_config="$lookdir/bin/$apr_temp_apr_config_file" + break 2 + fi + done + fi + done + fi + dnl if we have not found anything yet and have bundled source, use that + if test "$apr_found" = "no" && test -d "$1"; then apr_temp_abs_srcdir="`cd $1 && pwd`" apr_found="reconfig" apr_bundled_major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"$1/include/apr_version.h\"`" @@ -140,25 +160,6 @@ AC_DEFUN([APR_FIND_APR], [ apr_config="$1/$apr_temp_apr_config_file" fi fi - if test "$apr_found" = "no" && test -n "$3" && test "$3" = "1"; then - for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config - do - if $apr_temp_apr_config_file --help > /dev/null 2>&1 ; then - apr_found="yes" - apr_config="$apr_temp_apr_config_file" - break - else - dnl look in some standard places - for lookdir in /usr /usr/local /usr/local/apr /opt/apr /usr/local/apache2; do - if $TEST_X "$lookdir/bin/$apr_temp_apr_config_file"; then - apr_found="yes" - apr_config="$lookdir/bin/$apr_temp_apr_config_file" - break 2 - fi - done - fi - done - fi ]) AC_MSG_RESULT($apr_found) From 2a566debb66e4bd3e21f5eb9937520bb55c9bf4a Mon Sep 17 00:00:00 2001 From: Andre Malo Date: Fri, 25 Feb 2005 19:47:04 +0000 Subject: [PATCH 5331/7878] set svn:eol-style git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@155364 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.rc | 108 +++++++++++++++++++++++++++--------------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/libapr.rc b/libapr.rc index 1344fc084ff..8dc3cedfa90 100644 --- a/libapr.rc +++ b/libapr.rc @@ -1,54 +1,54 @@ -#include "apr_version.h" - -#define APR_COPYRIGHT "Copyright 2000-2005 The Apache Software " \ - "Foundation or its licensors, as applicable." - -#define APR_LICENSE "Licensed under the Apache License, Version 2.0 " \ - "(the ""License""); you may not use this file except " \ - "in compliance with the License. You may obtain a " \ - "copy of the License at\r\n\r\n" \ - "http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n" \ - "Unless required by applicable law or agreed to in " \ - "writing, software distributed under the License is " \ - "distributed on an ""AS IS"" BASIS, WITHOUT " \ - "WARRANTIES OR CONDITIONS OF ANY KIND, either " \ - "express or implied. See the License for the " \ - "specific language governing permissions and " \ - "limitations under the License." - -#define APR_DLL_BASENAME "libapr-" APR_STRINGIFY(APR_MAJOR_VERSION) - - -1 VERSIONINFO - FILEVERSION APR_VERSION_STRING_CSV,0 - PRODUCTVERSION APR_VERSION_STRING_CSV,0 - FILEFLAGSMASK 0x3fL -#if defined(_DEBUG) - FILEFLAGS 0x01L -#else - FILEFLAGS 0x00L -#endif - FILEOS 0x40004L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", APR_LICENSE "\0" - VALUE "CompanyName", "Apache Software Foundation\0" - VALUE "FileDescription", "Apache Portable Runtime Library\0" - VALUE "FileVersion", APR_VERSION_STRING "\0" - VALUE "InternalName", APR_DLL_BASENAME "\0" - VALUE "LegalCopyright", APR_COPYRIGHT "\0" - VALUE "OriginalFilename", APR_DLL_BASENAME ".dll\0" - VALUE "ProductName", "Apache Portable Runtime Project\0" - VALUE "ProductVersion", APR_VERSION_STRING "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END +#include "apr_version.h" + +#define APR_COPYRIGHT "Copyright 2000-2005 The Apache Software " \ + "Foundation or its licensors, as applicable." + +#define APR_LICENSE "Licensed under the Apache License, Version 2.0 " \ + "(the ""License""); you may not use this file except " \ + "in compliance with the License. You may obtain a " \ + "copy of the License at\r\n\r\n" \ + "http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n" \ + "Unless required by applicable law or agreed to in " \ + "writing, software distributed under the License is " \ + "distributed on an ""AS IS"" BASIS, WITHOUT " \ + "WARRANTIES OR CONDITIONS OF ANY KIND, either " \ + "express or implied. See the License for the " \ + "specific language governing permissions and " \ + "limitations under the License." + +#define APR_DLL_BASENAME "libapr-" APR_STRINGIFY(APR_MAJOR_VERSION) + + +1 VERSIONINFO + FILEVERSION APR_VERSION_STRING_CSV,0 + PRODUCTVERSION APR_VERSION_STRING_CSV,0 + FILEFLAGSMASK 0x3fL +#if defined(_DEBUG) + FILEFLAGS 0x01L +#else + FILEFLAGS 0x00L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", APR_LICENSE "\0" + VALUE "CompanyName", "Apache Software Foundation\0" + VALUE "FileDescription", "Apache Portable Runtime Library\0" + VALUE "FileVersion", APR_VERSION_STRING "\0" + VALUE "InternalName", APR_DLL_BASENAME "\0" + VALUE "LegalCopyright", APR_COPYRIGHT "\0" + VALUE "OriginalFilename", APR_DLL_BASENAME ".dll\0" + VALUE "ProductName", "Apache Portable Runtime Project\0" + VALUE "ProductVersion", APR_VERSION_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END From 9bb154606e4f3be13fade6bff6c9cf381868fba6 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 12 Mar 2005 00:14:38 +0000 Subject: [PATCH 5332/7878] Replace looping code with an O(1) APR_RING_CONCAT. This also fixes a problem on Solaris 10 with the Event Ports. Karma to Justin for telling me about APR_RING_CONCAT. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@157183 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ poll/unix/epoll.c | 6 +----- poll/unix/kqueue.c | 6 +----- poll/unix/port.c | 6 +----- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index 07fc2d20f9a..838e314d0db 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.2.0 + *) Use APR_RING_CONCAT for moving dead list in KQueue, sys_epoll, and + Event Ports. [Paul Querna] + *) find_apr.m4: Try installed APR before bundled copy if --with-apr not passed to configure. [Justin Erenkrantz] diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 06ad713ce4c..d2b61433d5f 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -257,11 +257,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); /* Shift all PFDs in the Dead Ring to be Free Ring */ - while (!APR_RING_EMPTY(&(pollset->dead_ring), pfd_elem_t, link)) { - ep = APR_RING_FIRST(&(pollset->dead_ring)); - APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->free_ring), ep, pfd_elem_t, link); - } + APR_RING_CONCAT(&(pollset->free_ring), &(pollset->dead_ring), pfd_elem_t, link); pollset_unlock_rings(); diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index bb73240b4f6..287ab18fb37 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -275,11 +275,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); /* Shift all PFDs in the Dead Ring to be Free Ring */ - while (!APR_RING_EMPTY(&(pollset->dead_ring), pfd_elem_t, link)) { - ep = APR_RING_FIRST(&(pollset->dead_ring)); - APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->free_ring), ep, pfd_elem_t, link); - } + APR_RING_CONCAT(&(pollset->free_ring), &(pollset->dead_ring), pfd_elem_t, link); pollset_unlock_rings(); diff --git a/poll/unix/port.c b/poll/unix/port.c index 244ec362d8d..f2350ee997d 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -329,11 +329,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); /* Shift all PFDs in the Dead Ring to be Free Ring */ - while (!APR_RING_EMPTY(&(pollset->dead_ring), pfd_elem_t, link)) { - ep = APR_RING_FIRST(&(pollset->dead_ring)); - APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->free_ring), ep, pfd_elem_t, link); - } + APR_RING_CONCAT(&(pollset->free_ring), &(pollset->dead_ring), pfd_elem_t, link); pollset_unlock_rings(); From 295270f7c621dea992236c0ffe1260ef9f18bd59 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 12 Mar 2005 05:21:19 +0000 Subject: [PATCH 5333/7878] rewrite apr_file_writev_full. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@157231 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fullrw.c | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index 5b84d6a5ddc..78b8d55b157 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -67,30 +67,19 @@ APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile, apr_size_t nvec, apr_size_t *bytes_written) { - apr_status_t status; + apr_status_t rv = APR_SUCCESS; + int i; + apr_size_t amt = 0; apr_size_t total = 0; - do { - apr_size_t i, amt; - status = apr_file_writev(thefile, vec, nvec, &amt); - - /* We assume that writev will only write complete iovec areas. - * Incomplete writes inside a single area are not supported. - * This should be safe according to SuS v2. - */ - for (i = 0; i < nvec; i++) { - total += vec[i].iov_len; - if (total >= amt) { - vec = &vec[i+1]; - nvec -= i+1; - break; - } - } - } while (status == APR_SUCCESS && nvec > 0); + for (i = 0; i < nvec && rv == APR_SUCCESS; i++) { + rv = apr_file_write_full(thefile, vec[i].iov_base, + vec[i].iov_len, &amt); + total += amt; + } if (bytes_written != NULL) *bytes_written = total; - return status; + return rv; } - From 5b91dab374462147e2a6b31cfd881703183681ef Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 15 Mar 2005 22:58:56 +0000 Subject: [PATCH 5334/7878] sync CHANGES with 1.1.x branch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@157606 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGES b/CHANGES index 838e314d0db..b78c3d948b3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,21 @@ Changes for APR 1.2.0 + +Changes for APR 1.1.1 + + *) Disable sendfile support for S/390 only in kernel versions < 2.4.0. + [Joe Orton] + + *) Fix posix rwlock detection on Darwin. [Aaron Bannert] + + *) Build fix for Multicast support on HP-UX 11.00 and Tru64 [Joe Orton] + + *) Fix libapr.rc for Win32 builds [William Rowe] + + *) Rewrite apr_file_writev_full using apr_file_write_full. [Paul Querna] + + *) Fix memory leak when in APR_POOL_DEBUG mode. [Joe Schaefer] + *) Use APR_RING_CONCAT for moving dead list in KQueue, sys_epoll, and Event Ports. [Paul Querna] From 84881769a5a231b4330f95b2d4b247b22502faed Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 15 Mar 2005 23:37:43 +0000 Subject: [PATCH 5335/7878] sync with 1.1.x branch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@157611 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGES b/CHANGES index b78c3d948b3..0439f04f729 100644 --- a/CHANGES +++ b/CHANGES @@ -14,8 +14,6 @@ Changes for APR 1.1.1 *) Rewrite apr_file_writev_full using apr_file_write_full. [Paul Querna] - *) Fix memory leak when in APR_POOL_DEBUG mode. [Joe Schaefer] - *) Use APR_RING_CONCAT for moving dead list in KQueue, sys_epoll, and Event Ports. [Paul Querna] From 5a9d25d884eb2a0e79211f4b89a6b633e7efd5d0 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Thu, 17 Mar 2005 18:57:42 +0000 Subject: [PATCH 5336/7878] 1.1.1 released March 17, 2005. Happy St. Patrick's Day. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@157962 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 1 + 1 file changed, 1 insertion(+) diff --git a/STATUS b/STATUS index b5bcdfc86cc..41728c5ebec 100644 --- a/STATUS +++ b/STATUS @@ -4,6 +4,7 @@ Last modified at [$Date$] Releases: Standalone + 1.1.1 : released March 17, 2005 1.1.0 : released January 25, 2005 1.0.1 : released November 18, 2004 1.0.0 : released September 1, 2004 From c6ab8f6330c0d6525ad3e200894ec498f4789d42 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 20 Mar 2005 10:16:12 +0000 Subject: [PATCH 5337/7878] * poll/unix/epoll.c (apr_pollset_poll): Remove unused variable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@158323 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 1 - 1 file changed, 1 deletion(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index d2b61433d5f..30b30dcd8e0 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -225,7 +225,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, { int ret, i; apr_status_t rv = APR_SUCCESS; - pfd_elem_t *ep; if (timeout > 0) { timeout /= 1000; From 04247ea565603b2092fc6388387f72c1a4b25b79 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Wed, 23 Mar 2005 22:04:14 +0000 Subject: [PATCH 5338/7878] Check the 'APR_POOL_DEBUG_LOG' for an alternative to stderr for debugging pools. I found this very helpful when trying to debug things that detach from the tty, like httpd when not running with -DONE_PROCESS. If 'APR_POOL_DEBUG_LOG' is not set, the original behavoir of spewing out on stderr is maintained. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@158839 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index d7abede33bf..7486e673c8e 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -29,6 +29,7 @@ #include "apr_time.h" #define APR_WANT_MEMFUNC #include "apr_want.h" +#include "apr_env.h" #if APR_HAVE_STDLIB_H #include /* for malloc, free and abort */ @@ -1198,6 +1199,9 @@ static void apr_pool_check_integrity(apr_pool_t *pool) APR_DECLARE(apr_status_t) apr_pool_initialize(void) { apr_status_t rv; +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) + char* logpath; +#endif if (apr_pools_initialized++) return APR_SUCCESS; @@ -1224,7 +1228,16 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) } #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) - apr_file_open_stderr(&file_stderr, global_pool); + rv = apr_env_get(&logpath, "APR_POOL_DEBUG_LOG", global_pool); + + if (rv == APR_SUCCESS) { + apr_file_open(&file_stderr, logpath, APR_APPEND|APR_WRITE|APR_CREATE, + APR_OS_DEFAULT, global_pool); + } + else { + apr_file_open_stderr(&file_stderr, global_pool); + } + if (file_stderr) { apr_file_printf(file_stderr, "POOL DEBUG: [PID" From f1fbcc54ccc125426580110b0b6ff8fcddfd385d Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Wed, 23 Mar 2005 22:39:55 +0000 Subject: [PATCH 5339/7878] fix the style of the variable I added. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@158849 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 7486e673c8e..bf970e2958a 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1200,7 +1200,7 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) { apr_status_t rv; #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) - char* logpath; + char *logpath; #endif if (apr_pools_initialized++) From 5d07cffc617f54f9d5ed582d2504efcfd73bdb24 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Thu, 7 Apr 2005 00:27:03 +0000 Subject: [PATCH 5340/7878] fix the apr.pc.in file to include the cppflags in the Cflags varaible. It seems braindead, but pkg-config requires this, and it is a documented behavior. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@160349 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ apr.pc.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 0439f04f729..30b7763e50d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes for APR 1.2.0 + *) Include the C preprocessor flags in --cflags for pkg-config. + [Paul Querna] Changes for APR 1.1.1 diff --git a/apr.pc.in b/apr.pc.in index 91e4993d290..318a81e26b7 100644 --- a/apr.pc.in +++ b/apr.pc.in @@ -8,4 +8,4 @@ Name: APR Description: The Apache Portable Runtime library Version: @APR_DOTTED_VERSION@ Libs: -L${libdir} -l@APR_LIBNAME@ @EXTRA_LIBS@ -Cflags: @EXTRA_CFLAGS@ -I${includedir} +Cflags: @EXTRA_CPPFLAGS@ @EXTRA_CFLAGS@ -I${includedir} From 447b43a95dafe022750335c9bf86fa9fce1cf2d8 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Wed, 13 Apr 2005 23:11:59 +0000 Subject: [PATCH 5341/7878] Yes, these are depreciated, but lets not use C++ Comments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@161234 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 2e8e63a03a8..30a047b5f9e 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -883,7 +883,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + SOCECONNABORTED) #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + SOCECONNRESET) -// XXX deprecated +/* XXX deprecated */ #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT) #undef APR_STATUS_IS_TIMEUP @@ -1019,7 +1019,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + ERROR_NETNAME_DELETED \ || (s) == APR_OS_START_SYSERR + WSAECONNRESET) -// XXX deprecated +/* XXX deprecated */ #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) @@ -1087,7 +1087,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + WSAECONNRESET) -// XXX deprecated +/* XXX deprecated */ #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) From f94a516069369506fe5c566476940fa24f1910c2 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 14 Apr 2005 23:38:52 +0000 Subject: [PATCH 5342/7878] Allow Apache on NetWare to build using either the standard socket libraries or the Winsock libraries. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@161365 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 30 ++++++++++++++++++----- build/NWGNUenvironment.inc | 9 +++++-- build/NWGNUmakefile | 2 +- build/NWGNUtail.inc | 1 + include/apr.hnw | 29 +++++++++++++++++++--- include/apr_errno.h | 2 +- include/arch/netware/apr_arch_networkio.h | 4 +++ include/arch/netware/apr_private.h | 4 +++ misc/netware/libprews.c | 10 ++++++++ misc/netware/start.c | 6 +++++ misc/unix/errorcodes.c | 2 +- 11 files changed, 84 insertions(+), 15 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index ed11cad6111..8bc6e2fdd31 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -188,6 +188,7 @@ FILES_nlm_libs = \ libcpre.o \ $(APRLIB) \ $(APRUTLIB) \ + $(APULDAPLIB) \ $(XMLLIB) \ $(EOLIST) @@ -197,9 +198,14 @@ FILES_nlm_libs = \ # FILES_nlm_modules = \ Libc \ - ws2_32 \ $(EOLIST) - + +# Include the Winsock libraries if Winsock is being used +ifndef USE_STDSOCKETS +FILES_nlm_modules += ws2_32 \ + $(EOLIST) +endif + #If the LDAP support is defined then add the auto-load modules ifneq "$(LDAPSDK)" "" FILES_nlm_modules += \ @@ -208,7 +214,6 @@ FILES_nlm_modules += \ lldapx \ $(EOLIST) endif - # # If the nlm has a msg file, put it's path here @@ -230,11 +235,17 @@ FILE_nlm_copyright = # FILES_nlm_Ximports = \ @libc.imp \ - @ws2nlm.imp \ @netware.imp \ + $(EOLIST) + +# Include the Winsock imports if Winsock is being used +ifndef USE_STDSOCKETS +FILES_nlm_Ximports += \ + @ws2nlm.imp \ WSAStartupRTags \ WSACleanupRTag \ $(EOLIST) +endif #If the LDAP support is defined then add the imports ifneq "$(LDAPSDK)" "" @@ -370,8 +381,15 @@ endif vpath %.c atomic/netware:strings:tables:passwd:lib:time/unix vpath %.c file_io/unix:locks/netware:misc/netware:misc/unix:threadproc/netware -vpath %.c dso/netware:memory/unix:mmap/unix:user/netware:network_io/win32 -vpath %.c network_io/unix:poll/unix:shmem\unix:support/unix:random/unix +vpath %.c poll/unix:shmem\unix:support/unix:random/unix +vpath %.c dso/netware:memory/unix:mmap/unix:user/netware + +# Use the win32 network_io if Winsock is being used +ifdef USE_STDSOCKETS +vpath %.c network_io/unix +else +vpath %.c network_io/win32:network_io/unix +endif $(OBJDIR)/%.o: file_io/netware/%.c $(OBJDIR)\$(NLM_NAME)_cc.opt @echo Compiling $< diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index c6b860afbbe..ada8217153b 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -116,6 +116,9 @@ NOVI = $(NOVELLLIBC)\imports INCDIRS = $(NOVELLLIBC)\include;$(NOVELLLIBC)\include\nks;$(NOVELLLIBC)\include\winsock; DEFINES = -DNETWARE +ifndef USE_STDSOCKETS +DEFINES += -DUSE_WINSOCK +endif # # MetroWerks static Libraries @@ -262,10 +265,11 @@ endif # Common directories # -APR = $(APR_WORK) +APR = $(APR_WORK) APRTEST = $(APR_WORK)/test APRUTIL = $(APU_WORK) -XML = $(APRUTIL)/xml +APULDAP = $(APU_WORK)/ldap +XML = $(APRUTIL)/xml # # Internal Libraries @@ -273,6 +277,7 @@ XML = $(APRUTIL)/xml APRLIB = $(APR)/$(OBJDIR)/aprlib.lib APRUTLIB = $(APRUTIL)/$(OBJDIR)/aprutil.lib +APULDAPLIB = $(APULDAP)/$(OBJDIR)/apuldap.lib XMLLIB = $(XML)/$(OBJDIR)/xmllib.lib # diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index 6a003ab657f..6f9b32dd043 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -42,7 +42,7 @@ $(NLM_NAME)_cc.opt : NWGNUmakefile $(APR_WORK)\build\NWGNUenvironment.inc $(APR_ @echo -EP >> $@ @echo -nosyspath >> $@ @echo -w nocmdline >> $@ - @echo -DNETWARE >> $@ + @echo $(DEFINES) -DGENEXPORTS >> $@ @echo -I$(APR)\include >> $@ @echo -I$(APR)\include\arch\netware >> $@ @echo -I$(APR)\include\arch\unix >> $@ diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 6ac21b90b2f..b2574ec0cbd 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -234,6 +234,7 @@ else endif @echo -l $(APR)/$(OBJDIR) >> $@ @echo -l $(APRUTIL)/$(OBJDIR) >> $@ + @echo -l $(APULDAP)/$(OBJDIR) >> $@ @echo -l $(XML)/$(OBJDIR) >> $@ @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime" >> $@ @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++" >> $@ diff --git a/include/apr.hnw b/include/apr.hnw index e8d14dc8b09..f1be62e1b87 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -51,7 +51,11 @@ #include #include #include +#ifdef USE_WINSOCK #include +#else +#include +#endif #include #ifdef NW_BUILD_IPV6 @@ -89,8 +93,15 @@ extern "C" { #define APR_HAVE_FCNTL_H 1 #define APR_HAVE_IO_H 0 #define APR_HAVE_LIMITS_H 1 +#ifdef USE_WINSOCK +#define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 +#else +#define APR_HAVE_ARPA_INET_H 1 +#define APR_HAVE_NETDB_H 1 +#define APR_HAVE_NETINET_IN_H 1 +#endif #define APR_HAVE_NETINET_SCTP_H 0 #define APR_HAVE_NETINET_SCTP_UIO_H 0 #define APR_HAVE_NETINET_TCP_H 0 @@ -104,15 +115,21 @@ extern "C" { #define APR_HAVE_STRINGS_H 0 #define APR_HAVE_STRTOLL 1 #define APR_HAVE_SYS_SENDFILE_H 0 -#define APR_HAVE_SYS_SIGNAL_H 0 +#define APR_HAVE_SYS_SYSLIMITS_H 0 +#ifdef USE_WINSOCK #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SOCKIO_H 0 -#define APR_HAVE_SYS_SYSLIMITS_H 0 #define APR_HAVE_SYS_TIME_H 0 +#else +#define APR_HAVE_SYS_SOCKET_H 1 +#define APR_HAVE_SYS_SOCKIO_H 1 +#define APR_HAVE_SYS_TIME_H 1 +#endif +#define APR_HAVE_SYS_SIGNAL_H 1 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 1 -#define APR_HAVE_SYS_UN_H 0 -#define APR_HAVE_SYS_WAIT_H 0 +#define APR_HAVE_SYS_UN_H 1 +#define APR_HAVE_SYS_WAIT_H 1 #define APR_HAVE_TIME_H 1 #define APR_HAVE_UNISTD_H 1 @@ -232,7 +249,11 @@ typedef off64_t apr_off_t; #else typedef off_t apr_off_t; #endif +#ifdef USE_WINSOCK typedef int apr_socklen_t; +#else +typedef size_t apr_socklen_t; +#endif /* Are we big endian? */ /* XXX: Fatal assumption on Alpha platforms */ diff --git a/include/apr_errno.h b/include/apr_errno.h index 30a047b5f9e..2046f3e2b27 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -1046,7 +1046,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \ || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY) -#elif defined(NETWARE) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */ +#elif defined(NETWARE) && defined(USE_WINSOCK) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */ #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) diff --git a/include/arch/netware/apr_arch_networkio.h b/include/arch/netware/apr_arch_networkio.h index 0485b0b41e4..a15afc586ea 100644 --- a/include/arch/netware/apr_arch_networkio.h +++ b/include/arch/netware/apr_arch_networkio.h @@ -16,12 +16,16 @@ #ifndef NETWORK_IO_H +#ifdef USE_WINSOCK /* Making sure that we include the correct networkio.h since the the project file is configured to first look for headers in arch/netware and then arch/unix. But in this specific case we want arch/win32. */ #include <../win32/apr_arch_networkio.h> +#else +#include <../unix/apr_arch_networkio.h> +#endif #endif /* ! NETWORK_IO_H */ diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 3881f737925..04a3b0b91c2 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -46,6 +46,10 @@ #define HAVE_SIGNAL_H 1 #define HAVE_STDDEF_H 1 #define HAVE_STDLIB_H 1 +#ifndef USE_WINSOCK +#define HAVE_SYS_SELECT_H 1 +#define HAVE_WRITEV 1 +#endif #define HAVE_SYS_STAT_H 1 #define HAVE_SYS_MMAN_H 1 #define HAVE_FCNTL_H 1 diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index 6395adee4c6..a1dda594ce0 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -16,7 +16,9 @@ #include #include #include +#ifdef USE_WINSOCK #include "novsock2.h" +#endif #include "apr_pools.h" #include "apr_private.h" @@ -58,7 +60,9 @@ int _NonAppStart #pragma unused(messageCount) #pragma unused(messages) +#ifdef USE_WINSOCK WSADATA wsaData; +#endif apr_status_t status; gLibId = register_library(DisposeLibraryData); @@ -84,14 +88,20 @@ int _NonAppStart if ((status = apr_pool_initialize()) != APR_SUCCESS) return status; +#ifdef USE_WINSOCK return WSAStartup((WORD) MAKEWORD(2, 0), &wsaData); +#else + return 0; +#endif } void _NonAppStop( void ) { apr_pool_terminate(); +#ifdef USE_WINSOCK WSACleanup(); +#endif unregister_library(gLibId); NXMutexFree(gLibLock); diff --git a/misc/netware/start.c b/misc/netware/start.c index d359c3de41e..2cbfe9bfce6 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -23,6 +23,7 @@ #include "apr_arch_proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ #include "apr_arch_internal_time.h" +#ifdef USE_WINSOCK /* ** Resource tag signatures for using NetWare WinSock 2. These will no longer ** be needed by anyone once the new WSAStartupWithNlmHandle() is available @@ -103,6 +104,7 @@ static int RegisterAppWithWinSock (void *nlm_handle) return err; } +#endif @@ -140,11 +142,13 @@ APR_DECLARE(apr_status_t) apr_initialize(void) apr_pool_tag(pool, "apr_initilialize"); +#ifdef USE_WINSOCK err = RegisterAppWithWinSock (nlmhandle); if (err) { return err; } +#endif apr_signal_init(pool); @@ -173,7 +177,9 @@ APR_DECLARE_NONSTD(void) apr_terminate(void) away. */ netware_pool_proc_cleanup (); +#ifdef USE_WINSOCK UnregisterAppWithWinSock (app_data->gs_nlmhandle); +#endif } APR_DECLARE(void) apr_terminate2(void) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index d814763b585..45b8e21eca3 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -183,7 +183,7 @@ static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) return stuffbuffer(buf, bufsize, result); } -#elif defined(WIN32) || defined(NETWARE) +#elif defined(WIN32) || (defined(NETWARE) && defined(USE_WINSOCK)) static const struct { apr_status_t code; From 48c036e5208956aefb3682d603fd19104c434fa7 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 15 Apr 2005 16:47:26 +0000 Subject: [PATCH 5343/7878] Update the link-time copyright statement git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@161504 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index b2574ec0cbd..a0ec6af9a0c 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -25,7 +25,7 @@ NLM_SCREEN_NAME = DEFAULT endif ifndef NLM_COPYRIGHT -NLM_COPYRIGHT = Copyright (c) 2000-2004 The Apache Software Foundation. All rights reserved. +NLM_COPYRIGHT = Copyright (c) 2000-2005 The Apache Software Foundation. All rights reserved. endif # From e90510ccca65717eb176a89da55bfe177652a384 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 20 Apr 2005 19:45:08 +0000 Subject: [PATCH 5344/7878] use BSD sockets when building for IPV6 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@162055 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUenvironment.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index ada8217153b..ce9df25e9e8 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -111,6 +111,12 @@ CPP = mwccnlm LINK = mwldnlm LIB = mwldnlm -type library -w nocmdline +ifdef IPV6 +ifndef USE_STDSOCKETS +USE_STDSOCKETS=1 +endif +endif + NOVI = $(NOVELLLIBC)\imports INCDIRS = $(NOVELLLIBC)\include;$(NOVELLLIBC)\include\nks;$(NOVELLLIBC)\include\winsock; From 95d7181bd885756349a78781869f6303ad6bf97d Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 20 Apr 2005 20:37:50 +0000 Subject: [PATCH 5345/7878] Handle BEOS_R5 weirdness with gethostname() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@162064 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 68b8cdfd0a0..565dced2b67 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -355,7 +355,11 @@ apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark) apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { - if (gethostname(buf, len) == -1) { +#ifdef BEOS_R5 + if (gethostname(buf, len) == 0) { +#else + if (gethostname(buf, len) != 0) { +#endif buf[0] = '\0'; return errno; } From a058416e080b50d808f7a3cea81cccf497d42045 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 21 Apr 2005 18:59:25 +0000 Subject: [PATCH 5346/7878] Set FD_SETSIZE to 1024 like POSIX does. This does not mean that more then 64 sockets will be allowed for select. Custom network protocol stack might dissreagard this setting. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@164100 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr.hw b/include/apr.hw index 1174a190a51..4ce5e4a385a 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -86,6 +86,8 @@ */ #define SW_HIDE 0 #ifndef _WIN32_WCE +/* POSIX defines 1024 for the FD_SETSIZE */ +#define FD_SETSIZE 1024 #include #include #include From 5ce489d04e37beace7cfd22f563ee205fcdf9fc7 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Fri, 22 Apr 2005 07:25:23 +0000 Subject: [PATCH 5347/7878] Remove setting FD_SETSIZE from apr.hw to select.c (the only place it is used). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@164182 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 -- poll/unix/select.c | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 4ce5e4a385a..1174a190a51 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -86,8 +86,6 @@ */ #define SW_HIDE 0 #ifndef _WIN32_WCE -/* POSIX defines 1024 for the FD_SETSIZE */ -#define FD_SETSIZE 1024 #include #include #include diff --git a/poll/unix/select.c b/poll/unix/select.c index e6e84b59a0d..d9212b0070d 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -14,6 +14,11 @@ * limitations under the License. */ +#ifdef WIN32 +/* POSIX defines 1024 for the FD_SETSIZE */ +#define FD_SETSIZE 1024 +#endif + #include "apr.h" #include "apr_poll.h" #include "apr_time.h" From 3cbe41cc0160fd7adebe3a24058fc6ff78391af4 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Fri, 22 Apr 2005 17:50:38 +0000 Subject: [PATCH 5348/7878] Fix the @return Docstring to say that this will return NULL if the key doesn't exist. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@164262 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index 8834caa7082..c30fdcb0539 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -214,7 +214,7 @@ APR_DECLARE(void) apr_table_clear(apr_table_t *t); * The data is still in the table * @param t The table to search for the key * @param key The key to search for - * @return The value associated with the key + * @return The value associated with the key, or NULL if the key does not exist. */ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); From 8c998ee556d99391032d676ef7d3d56ea8f359dd Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 25 Apr 2005 10:11:09 +0000 Subject: [PATCH 5349/7878] OS/2: Use autoconf 2.5x compatible test for running under OS/2 when determining how to test for scripts. $ac_cv_emxos2 was only defined by the common OS/2 port of autoconf 2.13. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@164553 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 9228c769bbc..117fb06f259 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -61,7 +61,7 @@ dnl AC_DEFUN([APR_FIND_APR], [ apr_found="no" - if test "$ac_cv_emxos2" = "yes"; then + if test "$target_os" = "os2-emx"; then # Scripts don't pass test -x on OS/2 TEST_X="test -f" else From 522a87f137baa1917b540fa55bbd096b9f22484e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 29 Apr 2005 21:13:17 +0000 Subject: [PATCH 5350/7878] Disable some default LibC debugging code when compiling optimized git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@165339 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUenvironment.inc | 3 +++ misc/netware/libprews.c | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index ce9df25e9e8..fd54b487c93 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -125,6 +125,9 @@ DEFINES = -DNETWARE ifndef USE_STDSOCKETS DEFINES += -DUSE_WINSOCK endif +ifndef DEBUG +DEFINES += -DNDEBUG +endif # # MetroWerks static Libraries diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index a1dda594ce0..23e7c7ec2cb 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -48,6 +48,11 @@ int _NonAppStart const char **messages ) { +#ifdef USE_WINSOCK + WSADATA wsaData; +#endif + apr_status_t status; + NX_LOCK_INFO_ALLOC(liblock, "Per-Application Data Lock", 0); #pragma unused(cmdLine) @@ -60,11 +65,6 @@ int _NonAppStart #pragma unused(messageCount) #pragma unused(messages) -#ifdef USE_WINSOCK - WSADATA wsaData; -#endif - apr_status_t status; - gLibId = register_library(DisposeLibraryData); if (gLibId < -1) From 8a5e110b6a14d099e71a0c515706eb239c743f88 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 3 May 2005 02:01:12 +0000 Subject: [PATCH 5351/7878] - Add support for uuid_generate on OS X 10.4. This required some extra foot work since Apple put the uuid_generate functions into their libc, while Linux keeps them in libuuid. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@167847 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ configure.in | 12 ++++++++++-- include/apr.h.in | 2 ++ misc/unix/rand.c | 12 +++++++----- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 30b7763e50d..baf8351708d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes for APR 1.2.0 + *) Add support for uuid_generate on OS X 10.4. [Paul Querna] + *) Include the C preprocessor flags in --cflags for pkg-config. [Paul Querna] diff --git a/configure.in b/configure.in index 186ad770c84..d67c73cf6e6 100644 --- a/configure.in +++ b/configure.in @@ -1005,6 +1005,7 @@ APR_FLAG_HEADERS( tpfio.h \ unistd.h \ unix.h \ + uuid.h \ arpa/inet.h \ kernel/OS.h \ net/errno.h \ @@ -1029,7 +1030,8 @@ APR_FLAG_HEADERS( sys/types.h \ sys/uio.h \ sys/un.h \ - sys/wait.h) + sys/wait.h \ + uuid/uuid.h) # IRIX 6.5 has a problem in which prevents it from # being included by itself. Check for manually, @@ -1081,6 +1083,8 @@ AC_SUBST(timeh) AC_SUBST(unistdh) AC_SUBST(signalh) AC_SUBST(sys_waith) +AC_SUBST(uuidh) +AC_SUBST(uuid_uuidh) AC_SUBST(pthreadh) AC_SUBST(semaphoreh) @@ -1818,10 +1822,14 @@ echo "${nl}Checking for OS UUID Support..." osuuid="0" AC_CHECK_FUNCS(uuid_create, [osuuid="1" AC_DEFINE([HAVE_UUID_CREATE], 1, [Define if libc has uuid_create])], []) + +AC_CHECK_FUNCS(uuid_generate, [osuuid="1" + AC_DEFINE([HAVE_UUID_GENERATE], 1, [Define if libc has uuid_generate])], []) + AC_CHECK_LIB(uuid, uuid_generate, [osuuid="1" APR_ADDTO(LIBS,-luuid) - AC_DEFINE([HAVE_LIBUUID], 1, [Define if libuuid is present])], []) + AC_DEFINE([HAVE_UUID_GENERATE], 1, [Define if libuuid is present])], []) AC_SUBST(osuuid) diff --git a/include/apr.h.in b/include/apr.h.in index d1332921dc6..d2497ff8c95 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -101,6 +101,8 @@ #define APR_HAVE_SYS_WAIT_H @sys_waith@ #define APR_HAVE_TIME_H @timeh@ #define APR_HAVE_UNISTD_H @unistdh@ +#define APR_HAVE_UUID_UUID_H @uuid_uuidh@ +#define APR_HAVE_UUID_H @uuidh@ /** @} */ diff --git a/misc/unix/rand.c b/misc/unix/rand.c index efcdf1fef0b..431fd876c38 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -35,6 +35,12 @@ #if APR_HAVE_SYS_UN_H #include #endif +#if APR_HAVE_UUID_UUID_H +#include +#endif +#if APR_HAVE_UUID_H +#include +#endif #ifndef SHUT_RDWR #define SHUT_RDWR 2 @@ -42,8 +48,6 @@ #if HAVE_UUID_CREATE -#include - APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) { uuid_t g; @@ -55,9 +59,7 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) return APR_SUCCESS; } -#elif HAVE_LIBUUID - -#include +#elif HAVE_UUID_GENERATE APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) { From 34ae4d71064060b07f3e4417a8a2199374f8d767 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 4 May 2005 11:30:27 +0000 Subject: [PATCH 5352/7878] Steal the joined-pool debug code from 1.3: * include/apr_pools.h (apr_pool_is_ancestor): Note special semantics for joined pools. * memory/unix/apr_pools.c (apr_pool_join): Implement. (apr_pool_is_ancestor): Adjust for joined pools. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@168115 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 6 +++++- memory/unix/apr_pools.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 372319f480d..5d33c410bdc 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -392,11 +392,15 @@ APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool); APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool); /** - * Determine if pool a is an ancestor of pool b + * Determine if pool a is an ancestor of pool b. * @param a The pool to search * @param b The pool to search for * @return True if a is an ancestor of b, NULL is considered an ancestor * of all pools. + * @remark if compiled with APR_POOL_DEBUG, this function will also + * return true if A is a pool which has been guaranteed by the caller + * (using apr_pool_join) to have a lifetime at least as long as some + * ancestor of pool B. */ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index bf970e2958a..623813551ff 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -456,6 +456,8 @@ struct apr_pool_t { char *self_first_avail; #else /* APR_POOL_DEBUG */ + apr_pool_t *joined; /* the caller has guaranteed that this pool + * will survive as long as ->joined */ debug_node_t *nodes; const char *file_line; apr_uint32_t creation_flags; @@ -1655,6 +1657,12 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) { +#if APR_POOL_DEBUG + if (sub->parent != p) { + abort(); + } + sub->joined = p; +#endif } static int pool_find(apr_pool_t *pool, void *data) @@ -1805,6 +1813,14 @@ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) if (a == NULL) return 1; +#if APR_POOL_DEBUG + /* Find the pool with the longest lifetime guaranteed by the + * caller: */ + while (a->joined) { + a = a->joined; + } +#endif + while (b) { if (a == b) return 1; From 6f5b4a086c3c3d078ba83669917cb5ca31c94b73 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 4 May 2005 12:12:19 +0000 Subject: [PATCH 5353/7878] * tables/apr_tables.c: Enable pool lifetime debugging checks throughout. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@168117 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 831a71e3c9d..e86c1beccd8 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -1,4 +1,3 @@ -#include /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as * applicable. * @@ -39,6 +38,10 @@ #include #endif +#if APR_POOL_DEBUG && APR_HAVE_STDIO_H +#include +#endif + /***************************************************************** * This file contains array and apr_table_t functions only. */ @@ -392,12 +395,12 @@ APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, const apr_table_t *t) { apr_table_t *new = apr_palloc(p, sizeof(apr_table_t)); -#ifdef POOL_DEBUG +#if APR_POOL_DEBUG /* we don't copy keys and values, so it's necessary that t->a.pool * have a life span at least as long as p */ if (!apr_pool_is_ancestor(t->a.pool, p)) { - fprintf(stderr, "copy_table: t's pool is not an ancestor of p\n"); + fprintf(stderr, "apr_table_copy: t's pool is not an ancestor of p\n"); abort(); } #endif @@ -705,14 +708,14 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, apr_uint32_t checksum; int hash; -#ifdef POOL_DEBUG +#if APR_POOL_DEBUG { if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) { - fprintf(stderr, "table_set: key not in ancestor pool of t\n"); + fprintf(stderr, "apr_table_mergen: key not in ancestor pool of t\n"); abort(); } if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) { - fprintf(stderr, "table_set: key not in ancestor pool of t\n"); + fprintf(stderr, "apr_table_mergen: key not in ancestor pool of t\n"); abort(); } } @@ -774,14 +777,14 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, apr_uint32_t checksum; int hash; -#ifdef POOL_DEBUG +#if APR_POOL_DEBUG { if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) { - fprintf(stderr, "table_set: key not in ancestor pool of t\n"); + fprintf(stderr, "apr_table_addn: key not in ancestor pool of t\n"); abort(); } if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) { - fprintf(stderr, "table_set: key not in ancestor pool of t\n"); + fprintf(stderr, "apr_table_addn: key not in ancestor pool of t\n"); abort(); } } @@ -806,19 +809,19 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, { apr_table_t *res; -#ifdef POOL_DEBUG +#if APR_POOL_DEBUG /* we don't copy keys and values, so it's necessary that * overlay->a.pool and base->a.pool have a life span at least * as long as p */ if (!apr_pool_is_ancestor(overlay->a.pool, p)) { fprintf(stderr, - "overlay_tables: overlay's pool is not an ancestor of p\n"); + "apr_table_overlay: overlay's pool is not an ancestor of p\n"); abort(); } if (!apr_pool_is_ancestor(base->a.pool, p)) { fprintf(stderr, - "overlay_tables: base's pool is not an ancestor of p\n"); + "apr_table_overlay: base's pool is not an ancestor of p\n"); abort(); } #endif From 5a7c4dffea0805ed243d9147663595f2de33eda0 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 4 May 2005 12:21:19 +0000 Subject: [PATCH 5354/7878] * tables/apr_tables.c (apr_table_overlap): Don't erase dest table array if the pools differ; add pool-lifetime debugging check. Submitted by: Joe Schaefer git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@168118 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ tables/apr_tables.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index baf8351708d..a69b03711af 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.2.0 + *) Fix apr_table_overlap()'s handling of tables allocated from + different pools. [Joe Schaefer ] + *) Add support for uuid_generate on OS X 10.4. [Paul Querna] *) Include the C preprocessor flags in --cflags for pkg-config. diff --git a/tables/apr_tables.c b/tables/apr_tables.c index e86c1beccd8..da17e2867eb 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -1191,18 +1191,18 @@ static void apr_table_cat(apr_table_t *t, const apr_table_t *s) APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags) { - const int m = a->a.nelts; - const int n = b->a.nelts; - apr_pool_t *p = b->a.pool; - - if (m + n == 0) { + if (a->a.nelts + b->a.nelts == 0) { return; } - /* copy (extend) a using b's pool */ - if (a->a.pool != p) { - make_array_core(&a->a, p, m+n, sizeof(apr_table_entry_t), 0); +#if APR_POOL_DEBUG + /* Since the keys and values are not copied, it's required that + * b->a.pool has a lifetime at least as long as a->a.pool. */ + if (!apr_pool_is_ancestor(b->a.pool, a->a.pool)) { + fprintf(stderr, "apr_table_overlap: b's pool is not an ancestor of a's\n"); + abort(); } +#endif apr_table_cat(a, b); From 6162c5251e2d0ad7aca6d83d15f7a29711b957c9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 4 May 2005 12:32:59 +0000 Subject: [PATCH 5355/7878] * test/testtable.c (table_overlap2): Add test case for apr_table_overlap bug based on patch from Joe Schaefer. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@168119 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtable.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/testtable.c b/test/testtable.c index 8803a717388..1ba69a53653 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -149,6 +149,27 @@ static void table_overlap(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, val, "7"); } +static void table_overlap2(abts_case *tc, void *data) +{ + apr_pool_t *subp; + apr_table_t *t1, *t2; + + apr_pool_create(&subp, p); + + t1 = apr_table_make(subp, 1); + t2 = apr_table_make(p, 1); + apr_table_addn(t1, "t1", "one"); + apr_table_addn(t2, "t2", "two"); + + apr_table_overlap(t1, t2, APR_OVERLAP_TABLES_SET); + + ABTS_INT_EQUAL(tc, 2, apr_table_elts(t1)->nelts); + + ABTS_STR_EQUAL(tc, apr_table_get(t1, "t1"), "one"); + ABTS_STR_EQUAL(tc, apr_table_get(t1, "t2"), "two"); + +} + abts_suite *testtable(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -162,6 +183,7 @@ abts_suite *testtable(abts_suite *suite) abts_run_test(suite, table_clear, NULL); abts_run_test(suite, table_unset, NULL); abts_run_test(suite, table_overlap, NULL); + abts_run_test(suite, table_overlap2, NULL); return suite; } From ff7e9fcedf828cc52d86df9a47af26bf902f588b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 4 May 2005 13:03:23 +0000 Subject: [PATCH 5356/7878] * tables/apr_hash.c (apr_hash_merge): Enable pool lifetime debugging. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@168121 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 5cabe4faa0d..574d4161a94 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -28,6 +28,9 @@ #include #endif +#if APR_POOL_DEBUG && APR_HAVE_STDIO_H +#include +#endif /* * The internal form of a hash table. @@ -387,19 +390,19 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, apr_hash_entry_t *ent; unsigned int i,j,k; -#ifdef POOL_DEBUG +#if APR_POOL_DEBUG /* we don't copy keys and values, so it's necessary that * overlay->a.pool and base->a.pool have a life span at least * as long as p */ if (!apr_pool_is_ancestor(overlay->pool, p)) { fprintf(stderr, - "apr_hash_overlay: overlay's pool is not an ancestor of p\n"); + "apr_hash_merge: overlay's pool is not an ancestor of p\n"); abort(); } if (!apr_pool_is_ancestor(base->pool, p)) { fprintf(stderr, - "apr_hash_overlay: base's pool is not an ancestor of p\n"); + "apr_hash_merge: base's pool is not an ancestor of p\n"); abort(); } #endif From 53a7836d39bdf4c711fd6fb1816c6e648c36d98b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 4 May 2005 14:38:28 +0000 Subject: [PATCH 5357/7878] * include/apr_pools.h: Remove some out-of-context references to httpd code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@168133 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 5d33c410bdc..7b6daa351b0 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -584,16 +584,14 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); * structures. * * However, sometimes this ancestor requirement is inconvenient -- - * sometimes we're forced to create a sub pool (such as through - * apr_sub_req_lookup_uri), and the sub pool is guaranteed to have - * the same lifetime as the parent pool. This is a guarantee implemented - * by the *caller*, not by the pool code. That is, the caller guarantees - * they won't destroy the sub pool individually prior to destroying the - * parent pool. + * sometimes it's necessary to create a sub pool where the sub pool is + * guaranteed to have the same lifetime as the parent pool. This is a + * guarantee implemented by the *caller*, not by the pool code. That + * is, the caller guarantees they won't destroy the sub pool + * individually prior to destroying the parent pool. * * In this case the caller must call apr_pool_join() to indicate this - * guarantee to the APR_POOL_DEBUG code. There are a few examples spread - * through the standard modules. + * guarantee to the APR_POOL_DEBUG code. * * These functions are only implemented when #APR_POOL_DEBUG is set. * From d269dd17b12dbd3f6d57a8aa71a6c65db1048d7c Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Thu, 5 May 2005 06:52:18 +0000 Subject: [PATCH 5358/7878] Use AC_CHECK_HEADERS to find the uuid header files. Suggested By: Joe Orton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@168287 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 ++++----- include/apr.h.in | 2 -- misc/unix/rand.c | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index d67c73cf6e6..eae3a91a678 100644 --- a/configure.in +++ b/configure.in @@ -1005,7 +1005,6 @@ APR_FLAG_HEADERS( tpfio.h \ unistd.h \ unix.h \ - uuid.h \ arpa/inet.h \ kernel/OS.h \ net/errno.h \ @@ -1030,8 +1029,7 @@ APR_FLAG_HEADERS( sys/types.h \ sys/uio.h \ sys/un.h \ - sys/wait.h \ - uuid/uuid.h) + sys/wait.h) # IRIX 6.5 has a problem in which prevents it from # being included by itself. Check for manually, @@ -1083,8 +1081,6 @@ AC_SUBST(timeh) AC_SUBST(unistdh) AC_SUBST(signalh) AC_SUBST(sys_waith) -AC_SUBST(uuidh) -AC_SUBST(uuid_uuidh) AC_SUBST(pthreadh) AC_SUBST(semaphoreh) @@ -1820,6 +1816,9 @@ AC_SUBST(rand) dnl ----------------------------- Checking for UUID Support echo "${nl}Checking for OS UUID Support..." osuuid="0" + +AC_CHECK_HEADERS(uuid/uuid.h uuid.h) + AC_CHECK_FUNCS(uuid_create, [osuuid="1" AC_DEFINE([HAVE_UUID_CREATE], 1, [Define if libc has uuid_create])], []) diff --git a/include/apr.h.in b/include/apr.h.in index d2497ff8c95..d1332921dc6 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -101,8 +101,6 @@ #define APR_HAVE_SYS_WAIT_H @sys_waith@ #define APR_HAVE_TIME_H @timeh@ #define APR_HAVE_UNISTD_H @unistdh@ -#define APR_HAVE_UUID_UUID_H @uuid_uuidh@ -#define APR_HAVE_UUID_H @uuidh@ /** @} */ diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 431fd876c38..fe9b7b71441 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -35,10 +35,10 @@ #if APR_HAVE_SYS_UN_H #include #endif -#if APR_HAVE_UUID_UUID_H +#if HAVE_UUID_UUID_H #include #endif -#if APR_HAVE_UUID_H +#if HAVE_UUID_H #include #endif From 867cb73257b49d8faac63f4fe39fd600e6715439 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 5 May 2005 14:44:04 +0000 Subject: [PATCH 5359/7878] * configure.in: Simplify uuid checks. * misc/unix/rand.c: Use #ifdef rather than #if for defined-or-not HAVE_UUID_* macros. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@168337 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 11 +++-------- misc/unix/rand.c | 8 ++++---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/configure.in b/configure.in index eae3a91a678..ae5fa6e9fb4 100644 --- a/configure.in +++ b/configure.in @@ -1819,16 +1819,11 @@ osuuid="0" AC_CHECK_HEADERS(uuid/uuid.h uuid.h) -AC_CHECK_FUNCS(uuid_create, [osuuid="1" - AC_DEFINE([HAVE_UUID_CREATE], 1, [Define if libc has uuid_create])], []) +# Check for uuid_generate in libc or libuuid +AC_SEARCH_LIBS(uuid_generate, uuid) -AC_CHECK_FUNCS(uuid_generate, [osuuid="1" - AC_DEFINE([HAVE_UUID_GENERATE], 1, [Define if libc has uuid_generate])], []) +AC_CHECK_FUNCS([uuid_generate uuid_create], [osuuid=1; break]) -AC_CHECK_LIB(uuid, uuid_generate, - [osuuid="1" - APR_ADDTO(LIBS,-luuid) - AC_DEFINE([HAVE_UUID_GENERATE], 1, [Define if libuuid is present])], []) AC_SUBST(osuuid) diff --git a/misc/unix/rand.c b/misc/unix/rand.c index fe9b7b71441..4691f08a19b 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -35,10 +35,10 @@ #if APR_HAVE_SYS_UN_H #include #endif -#if HAVE_UUID_UUID_H +#ifdef HAVE_UUID_UUID_H #include #endif -#if HAVE_UUID_H +#ifdef HAVE_UUID_H #include #endif @@ -46,7 +46,7 @@ #define SHUT_RDWR 2 #endif -#if HAVE_UUID_CREATE +#if defined(HAVE_UUID_CREATE) APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) { @@ -59,7 +59,7 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) return APR_SUCCESS; } -#elif HAVE_UUID_GENERATE +#elif defined(HAVE_UUID_GENERATE) APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) { From 63f66cfc9c8a233ee4402efc437981013c965161 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 6 May 2005 14:29:49 +0000 Subject: [PATCH 5360/7878] Committed to 0.9.x but missing from HEAD: * build/apr_hints.m4 (APR_PRELOAD): NetBSD fcntl() confounds O_NONBLOCK inheritance test, so work around it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@168607 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 15c470c695d..437d294a6f9 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -152,6 +152,8 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-netbsd*) APR_ADDTO(CPPFLAGS, [-DNETBSD]) + # fcntl() lies about O_NONBLOCK on an accept()ed socket (PR kern/26950) + APR_SETIFNULL(ac_cv_o_nonblock_inherited, [yes]) ;; *-freebsd*) APR_SETIFNULL(apr_lock_method, [USE_FLOCK_SERIALIZE]) From dd405576cf6928df165a5dccdd1157b865ec9558 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 May 2005 12:47:45 +0000 Subject: [PATCH 5361/7878] Reintroduce stack frame construction with /Oy- (removal was implied by /O2). This makes binaries far easier to debug, during operation and for post-crash .dmp analysis. Do not alter /Gs optimizations per brane. Reviewed by: stoddard, brane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170374 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_app.dsp | 2 +- build/libapr_app.dsp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/apr_app.dsp b/build/apr_app.dsp index b0d88531a9b..a919872e2af 100644 --- a/build/apr_app.dsp +++ b/build/apr_app.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fd"LibR\apr_app_src" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fd"LibR\apr_app_src" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe diff --git a/build/libapr_app.dsp b/build/libapr_app.dsp index b780fc7dbe1..ac80e7ea53f 100644 --- a/build/libapr_app.dsp +++ b/build/libapr_app.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"Release\libapr_app_src" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"Release\libapr_app_src" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe From d6b25a9d46a91cb27885dade025ed036565a281b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 16 May 2005 15:07:38 +0000 Subject: [PATCH 5362/7878] * threadproc/unix/proc.c (apr_procattr_child_in_set, apr_procattr_child_out_set, apr_procattr_child_err_set): Add error checking: fixes segfaults in applications when pipe() or dup2() fail (e.g. due to ulimit settings). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170395 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 44 ++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 08e4a8d5769..ce32b09bf78 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -111,16 +111,18 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { - if (attr->child_in == NULL && attr->parent_in == NULL) - apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); + apr_status_t rv = APR_SUCCESS; - if (child_in != NULL) - apr_file_dup2(attr->child_in, child_in, attr->pool); + if (attr->child_in == NULL && attr->parent_in == NULL) + rv = apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); + + if (child_in != NULL && rv == APR_SUCCESS) + rv = apr_file_dup2(attr->child_in, child_in, attr->pool); - if (parent_in != NULL) - apr_file_dup2(attr->parent_in, parent_in, attr->pool); + if (parent_in != NULL && rv == APR_SUCCESS) + rv = apr_file_dup2(attr->parent_in, parent_in, attr->pool); - return APR_SUCCESS; + return rv; } @@ -128,16 +130,18 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) { + apr_status_t rv = APR_SUCCESS; + if (attr->child_out == NULL && attr->parent_out == NULL) - apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); + rv = apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); - if (child_out != NULL) - apr_file_dup2(attr->child_out, child_out, attr->pool); + if (child_out != NULL && rv == APR_SUCCESS) + rv = apr_file_dup2(attr->child_out, child_out, attr->pool); - if (parent_out != NULL) - apr_file_dup2(attr->parent_out, parent_out, attr->pool); + if (parent_out != NULL && rv == APR_SUCCESS) + rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool); - return APR_SUCCESS; + return rv; } @@ -145,16 +149,18 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) { + apr_status_t rv = APR_SUCCESS; + if (attr->child_err == NULL && attr->parent_err == NULL) - apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); + rv = apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); - if (child_err != NULL) - apr_file_dup2(attr->child_err, child_err, attr->pool); + if (child_err != NULL && rv == APR_SUCCESS) + rv = apr_file_dup2(attr->child_err, child_err, attr->pool); - if (parent_err != NULL) - apr_file_dup2(attr->parent_err, parent_err, attr->pool); + if (parent_err != NULL && rv == APR_SUCCESS) + rv = apr_file_dup2(attr->parent_err, parent_err, attr->pool); - return APR_SUCCESS; + return rv; } From 8f8db6560d072a681f2263e057ed9fba0ce08f7a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 May 2005 21:35:45 +0000 Subject: [PATCH 5363/7878] An internal API - buffer len values should be size_t git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170455 13f79535-47bb-0310-9956-ffa450edef68 --- user/win32/userinfo.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 6bee0055a40..a102470c181 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -30,7 +30,7 @@ * depends on IsValidSid(), which internally we better test long * before we get here! */ -void get_sid_string(char *buf, int blen, apr_uid_t id) +void get_sid_string(char *buf, apr_size_t blen, apr_uid_t id) { PSID_IDENTIFIER_AUTHORITY psia; DWORD nsa; @@ -88,15 +88,14 @@ APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, strcpy(regkey, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\" "ProfileList\\"); - keylen = strlen(regkey); + keylen = (DWORD)strlen(regkey); get_sid_string(regkey + keylen, sizeof(regkey) - keylen, uid); } else { strcpy(regkey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\" "ProfileList\\"); - keylen = strlen(regkey); + keylen = (DWORD)strlen(regkey); apr_cpystrn(regkey + keylen, username, sizeof(regkey) - keylen); - } if ((rv = RegOpenKeyEx(HKEY_LOCAL_MACHINE, regkey, 0, @@ -106,7 +105,6 @@ APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - keylen = sizeof(regkey); rv = RegQueryValueExW(key, L"ProfileImagePath", NULL, &type, (void*)regkey, &keylen); From 8f971721c21c7a92ac155f7fb3b207c372d22ec5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 May 2005 21:36:32 +0000 Subject: [PATCH 5364/7878] An internal flaw - Win64 requires hi/lo buffer size args git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170456 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 6f025718e33..32c952e0a7e 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -109,13 +109,19 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - hMap = CreateFileMappingW(hFile, NULL, PAGE_READWRITE, 0, size, mapkey); + DWORD sizelo = (DWORD)size; + DWORD sizehi = (DWORD)(size >> 32); + hMap = CreateFileMappingW(hFile, NULL, PAGE_READWRITE, + sizehi, sizelo, mapkey); } #endif #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI { - hMap = CreateFileMappingA(hFile, NULL, PAGE_READWRITE, 0, size, mapkey); + DWORD sizelo = (DWORD)size; + DWORD sizehi = (DWORD)(size >> 32); + hMap = CreateFileMappingA(hFile, NULL, PAGE_READWRITE, + sizehi, sizelo, mapkey); } #endif err = apr_get_os_error(); From da8e9bef30983e5239fb9b3398c98db64272347c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 May 2005 21:38:03 +0000 Subject: [PATCH 5365/7878] Internal flaws, don't null out QWORD and DWORD values in the same pass, and the internal buff position is a mem offset, not file offset. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170458 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/seek.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 8a2db7f4add..bc075e3a848 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -21,12 +21,13 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) { - apr_off_t newbufpos; + apr_size_t newbufpos; DWORD rc; if (thefile->direction == 1) { apr_file_flush(thefile); - thefile->bufpos = thefile->direction = thefile->dataRead = 0; + thefile->bufpos = thefile->dataRead = 0; + thefile->direction = 0; } newbufpos = pos - (thefile->filePtr - thefile->dataRead); @@ -44,7 +45,8 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) else rc = APR_SUCCESS; if (rc == APR_SUCCESS) { - thefile->eof_hit = thefile->bufpos = thefile->dataRead = 0; + thefile->eof_hit = 0; + thefile->bufpos = thefile->dataRead = 0; thefile->filePtr = pos; } } From 3e249d7b98b626bc626ded6955702d2e884c6f05 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 May 2005 21:39:08 +0000 Subject: [PATCH 5366/7878] Hardcode a hack around WriteFile to the apr_dbg_log internal feature. [This function is only used for strace-like formatting.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170460 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 5215285aa87..eaf896a285a 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -209,7 +209,7 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, (sprintf)(sbuf, "%08x %08x %08x %s() %s:%d\n", (DWORD)ha, seq, GetCurrentThreadId(), fn, fl, ln); (EnterCriticalSection)(&cs); - (WriteFile)(fh, sbuf, strlen(sbuf), &wrote, NULL); + (WriteFile)(fh, sbuf, (DWORD)strlen(sbuf), &wrote, NULL); (LeaveCriticalSection)(&cs); } else { @@ -236,7 +236,7 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, (sprintf)(sbuf, "%08x %08x %08x %s(%s) %s:%d\n", (DWORD*)*hv, seq, GetCurrentThreadId(), fn, dsc, fl, ln); - (WriteFile)(fh, sbuf, strlen(sbuf), &wrote, NULL); + (WriteFile)(fh, sbuf, (DWORD)strlen(sbuf), &wrote, NULL); } while (--nh); (LeaveCriticalSection)(&cs); va_end(a); From 6704a9b7c5ef99a4a5a067890eacdfa82377957c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 May 2005 21:40:28 +0000 Subject: [PATCH 5367/7878] Presume when we grab random data, 2^31 bytes is quite alot. If this solution isn't sufficient (thus: the XXX comment), we will need a loop where sizeof(apr_size_t) > sizeof(DWORD) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170461 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/rand.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/misc/win32/rand.c b/misc/win32/rand.c index dddbbe04b96..1dd5d4f841b 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -37,7 +37,11 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, flags)) { return apr_get_os_error(); } - if (!CryptGenRandom(hProv, length, buf)) { + /* XXX: An ugly hack for Win64, randomness is such that noone should + * ever expect > 2^31 bytes of data at once without the prng + * coming to a complete halt. + */ + if (!CryptGenRandom(hProv, (DWORD)length, buf)) { res = apr_get_os_error(); } CryptReleaseContext(hProv, 0); From 0e5769e6f35c06ffab40503e587e216a736cafb8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 May 2005 21:45:52 +0000 Subject: [PATCH 5368/7878] Whitespace only - reindent to 4's git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170462 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_pton.c | 58 ++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/network_io/unix/inet_pton.c b/network_io/unix/inet_pton.c index 550ab2a44f6..480c6881e3c 100644 --- a/network_io/unix/inet_pton.c +++ b/network_io/unix/inet_pton.c @@ -105,40 +105,40 @@ apr_inet_pton(int af, const char *src, void *dst) static int inet_pton4(const char *src, unsigned char *dst) { - static const char digits[] = "0123456789"; - int saw_digit, octets, ch; - unsigned char tmp[INADDRSZ], *tp; + static const char digits[] = "0123456789"; + int saw_digit, octets, ch; + unsigned char tmp[INADDRSZ], *tp; - saw_digit = 0; - octets = 0; - *(tp = tmp) = 0; - while ((ch = *src++) != '\0') { - const char *pch; + saw_digit = 0; + octets = 0; + *(tp = tmp) = 0; + while ((ch = *src++) != '\0') { + const char *pch; - if ((pch = strchr(digits, ch)) != NULL) { - unsigned int new = *tp * 10 + (pch - digits); + if ((pch = strchr(digits, ch)) != NULL) { + unsigned int new = *tp * 10 + (pch - digits); - if (new > 255) - return (0); - *tp = new; - if (! saw_digit) { - if (++octets > 4) - return (0); - saw_digit = 1; - } - } else if (ch == '.' && saw_digit) { - if (octets == 4) - return (0); - *++tp = 0; - saw_digit = 0; - } else - return (0); - } - if (octets < 4) + if (new > 255) + return (0); + *tp = new; + if (! saw_digit) { + if (++octets > 4) + return (0); + saw_digit = 1; + } + } else if (ch == '.' && saw_digit) { + if (octets == 4) return (0); + *++tp = 0; + saw_digit = 0; + } else + return (0); + } + if (octets < 4) + return (0); - memcpy(dst, tmp, INADDRSZ); - return (1); + memcpy(dst, tmp, INADDRSZ); + return (1); } #if APR_HAVE_IPV6 From 0b05d5b4edb259605e29021a9b30ca69d94d5e4c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 May 2005 21:46:30 +0000 Subject: [PATCH 5369/7878] Safe cast to bring pointer arithmetic in line with a much smaller result set. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170464 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_pton.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/inet_pton.c b/network_io/unix/inet_pton.c index 480c6881e3c..22b15390fc3 100644 --- a/network_io/unix/inet_pton.c +++ b/network_io/unix/inet_pton.c @@ -116,7 +116,7 @@ inet_pton4(const char *src, unsigned char *dst) const char *pch; if ((pch = strchr(digits, ch)) != NULL) { - unsigned int new = *tp * 10 + (pch - digits); + unsigned int new = *tp * 10 + (unsigned int)(pch - digits); if (new > 255) return (0); From e7f6d3c9ff9b01814a219897689cc4731231e80f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 May 2005 21:48:29 +0000 Subject: [PATCH 5370/7878] These operations are NOT necessarily function-based on 64 bit architectures. Performed with inline code, these function cast wrappers broke our API. These original flavors should be present for all 64 bit compiler headers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170467 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/win32/apr_atomic.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index dd00abd9385..95db7503b97 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -63,17 +63,29 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) { /* we return old value, win32 returns new value :( */ +#if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) + return InterlockedIncrement(mem) - 1; +#else return ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem) - 1; +#endif } APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) { +#if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) + return InterlockedDecrement(mem); +#else return ((apr_atomic_win32_ptr_fn)InterlockedDecrement)(mem); +#endif } APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) { +#if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) + InterlockedExchange(mem, val); +#else ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); +#endif } APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) @@ -84,7 +96,11 @@ APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, apr_uint32_t cmp) { +#if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) + return InterlockedCompareExchange(mem, with, cmp); +#else return ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem, with, cmp); +#endif } APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) @@ -99,5 +115,9 @@ APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const voi APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) { +#if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) + return InterlockedExchange(mem, val); +#else return ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); +#endif } From 8a6400a0b3ce696197930b3924f209ea5a5e7c23 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 May 2005 21:49:49 +0000 Subject: [PATCH 5371/7878] We play pointer math with local 'i', so it must be apr_size_t. Until we decide otherwise, cast the pointer math result back to an int for a nelts result. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170468 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index da17e2867eb..c1128c65d4f 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -970,7 +970,7 @@ static apr_table_entry_t **table_mergesort(apr_pool_t *pool, */ apr_table_entry_t **values_tmp = (apr_table_entry_t **)apr_palloc(pool, n * sizeof(apr_table_entry_t*)); - int i; + apr_size_t i; int blocksize; /* First pass: sort pairs of elements (blocksize=1) */ @@ -1156,7 +1156,7 @@ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags) *dst++ = *src; } } while (++src < last_elt); - t->a.nelts -= (last_elt - dst); + t->a.nelts -= (int)(last_elt - dst); } table_reindex(t); From 92428183c2d857f39c7544d0f8e56a8c0b649ddc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 May 2005 21:51:08 +0000 Subject: [PATCH 5372/7878] A noop on Win32, this Win64 hack for our internal fn deals with memory sizes in apr_size_t git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170469 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/timestr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 9a288ab225e..ce96c867e7d 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -120,15 +120,15 @@ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t) #ifndef _WIN32_WCE -int win32_strftime_extra(char *s, size_t max, const char *format, - const struct tm *tm) +apr_size_t win32_strftime_extra(char *s, size_t max, const char *format, + const struct tm *tm) { /* If the new format string is bigger than max, the result string won't fit * anyway. If format strings are added, made sure the padding below is * enough */ char *new_format = (char *) malloc(max + 11); size_t i, j, format_length = strlen(format); - int return_value; + apr_size_t return_value; int length_written; for (i = 0, j = 0; (i < format_length && j < max);) { From 4dd40997b7e0e7bd7c8ca1e61e7802e4fba5f8dc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 May 2005 21:52:28 +0000 Subject: [PATCH 5373/7878] Buffer lengths in these internal functions must all be in apr_size_t quantums - to match the size of memory. Prevents many many ugly casts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170470 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index a4b14230800..0d5dad0bb2d 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -338,7 +338,7 @@ while (width > len) */ static char *conv_10(register wide_int num, register bool_int is_unsigned, register bool_int *is_negative, char *buf_end, - register int *len) + register apr_size_t *len) { register char *p = buf_end; register u_wide_int magnitude; @@ -385,7 +385,7 @@ static char *conv_10(register wide_int num, register bool_int is_unsigned, static char *conv_10_quad(widest_int num, register bool_int is_unsigned, register bool_int *is_negative, char *buf_end, - register int *len) + register apr_size_t *len) { register char *p = buf_end; u_widest_int magnitude; @@ -442,12 +442,12 @@ static char *conv_10_quad(widest_int num, register bool_int is_unsigned, -static char *conv_in_addr(struct in_addr *ia, char *buf_end, int *len) +static char *conv_in_addr(struct in_addr *ia, char *buf_end, apr_size_t *len) { unsigned addr = ntohl(ia->s_addr); char *p = buf_end; bool_int is_negative; - int sub_len; + apr_size_t sub_len; p = conv_10((addr & 0x000000FF) , TRUE, &is_negative, p, &sub_len); *--p = '.'; @@ -463,11 +463,11 @@ static char *conv_in_addr(struct in_addr *ia, char *buf_end, int *len) -static char *conv_apr_sockaddr(apr_sockaddr_t *sa, char *buf_end, int *len) +static char *conv_apr_sockaddr(apr_sockaddr_t *sa, char *buf_end, apr_size_t *len) { char *p = buf_end; bool_int is_negative; - int sub_len; + apr_size_t sub_len; char *ipaddr_str; p = conv_10(sa->port, TRUE, &is_negative, p, &sub_len); @@ -496,7 +496,7 @@ static char *conv_apr_sockaddr(apr_sockaddr_t *sa, char *buf_end, int *len) #if APR_HAS_THREADS -static char *conv_os_thread_t(apr_os_thread_t *tid, char *buf_end, int *len) +static char *conv_os_thread_t(apr_os_thread_t *tid, char *buf_end, apr_size_t *len) { union { apr_os_thread_t tid; @@ -527,7 +527,7 @@ static char *conv_os_thread_t(apr_os_thread_t *tid, char *buf_end, int *len) */ static char *conv_fp(register char format, register double num, boolean_e add_dp, int precision, bool_int *is_negative, - char *buf, int *len) + char *buf, apr_size_t *len) { register char *s = buf; register char *p; @@ -581,7 +581,7 @@ static char *conv_fp(register char format, register double num, if (format != 'f') { char temp[EXPONENT_LENGTH]; /* for exponent conversion */ - int t_len; + apr_size_t t_len; bool_int exponent_is_negative; *s++ = format; /* either e or E */ @@ -625,7 +625,7 @@ static char *conv_fp(register char format, register double num, * the number isn't quad size. */ static char *conv_p2(register u_wide_int num, register int nbits, - char format, char *buf_end, register int *len) + char format, char *buf_end, register apr_size_t *len) { register int mask = (1 << nbits) - 1; register char *p = buf_end; @@ -644,7 +644,7 @@ static char *conv_p2(register u_wide_int num, register int nbits, } static char *conv_p2_quad(u_widest_int num, register int nbits, - char format, char *buf_end, register int *len) + char format, char *buf_end, register apr_size_t *len) { register int mask = (1 << nbits) - 1; register char *p = buf_end; @@ -675,11 +675,11 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), register char *sp; register char *bep; register int cc = 0; - register int i; + register apr_size_t i; register char *s = NULL; char *q; - int s_len; + apr_size_t s_len; register int min_width = 0; int precision = 0; From 63828524e8f3233eff2f05b7a9f82027a17bd9f3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 May 2005 22:00:49 +0000 Subject: [PATCH 5374/7878] Reintroduce stack frame construction with /Oy- (removal was implied by /O2). This makes binaries far easier to debug, during operation and for post-crash .dmp analysis. Do not alter /Gs optimizations per brane. [I was near certain this had been committed to trunk/ but svn locally is insisting otherwise] Reviewed by: stoddard, brane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@170475 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 2 +- libapr.dsp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apr.dsp b/apr.dsp index 57bff7e1a2f..a67674148b8 100644 --- a/apr.dsp +++ b/apr.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr_src" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr_src" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe diff --git a/libapr.dsp b/libapr.dsp index a4b1d4d3347..0b79c36a658 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libapr_src" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libapr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" From 77000556b2a5194eae3a1fce7e25501116480f33 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 19 May 2005 22:09:18 +0000 Subject: [PATCH 5375/7878] Add multicast.c to build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@171002 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libapr.dsp b/libapr.dsp index 0b79c36a658..dd399a7e5e8 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -284,6 +284,10 @@ SOURCE=.\poll\unix\select.c # End Source File # Begin Source File +SOURCE=.\network_io\unix\multicast.c +# End Source File +# Begin Source File + SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File From 2ed99b93f80744c3c810c4d402d6c435ecf4aca6 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 24 May 2005 20:37:20 +0000 Subject: [PATCH 5376/7878] jlibtool: Correctly handle the '-MT' flag to set the dependency generation Makefile target. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@178277 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build/jlibtool.c b/build/jlibtool.c index b2096640369..717bf561006 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -1297,6 +1297,17 @@ void parse_args(int argc, char *argv[], command_t *cmd_data) if (arg[1] == 'o' && !arg[2]) { arg = argv[++a]; argused = parse_output_file_name(arg, cmd_data); + } else if (strcmp(arg+1, "MT") == 0) { + if (!cmd_data->options.silent) { + printf("Adding: %s", arg); + } + push_count_chars(cmd_data->arglist, arg); + arg = argv[++a]; + if (!cmd_data->options.silent) { + printf(" %s\n", arg); + } + push_count_chars(cmd_data->arglist, arg); + argused = 1; } else if (strcmp(arg+1, "rpath") == 0) { /* Aha, we should try to link both! */ cmd_data->install_path = argv[++a]; From 81f32b5bdd79ff76d10f475bde6673eab874f429 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Tue, 24 May 2005 23:59:02 +0000 Subject: [PATCH 5377/7878] clean up a comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@178326 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 565dced2b67..4c45db15631 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -76,11 +76,12 @@ apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) { apr_status_t stat; - /* If our timeout is positive or zero and our last timeout was + /* If our new timeout is non-negative and our old timeout was * negative, then we need to ensure that we are non-blocking. - * Conversely, if our timeout is negative and we had a positive - * or zero timeout, we must make sure our socket is blocking. - * We want to avoid calling fcntl more than necessary on the socket, + * Conversely, if our new timeout is negative and we had + * non-negative timeout, we must make sure our socket is blocking. + * We want to avoid calling fcntl more than necessary on the + * socket. */ if (t >= 0 && sock->timeout < 0) { if (apr_is_option_set(sock, APR_SO_NONBLOCK) != 1) { From 02328868637d27731a6f6b7fcb58c8a39d3d54c8 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Wed, 25 May 2005 01:53:00 +0000 Subject: [PATCH 5378/7878] network_io/unix/sendrecv.c: Deal with EAGAIN after poll(). Following apr_wait_for_io_or_timeout(), we were doing I/O and not dealing with EAGAIN. It is legal for poll() to indicate that a socket is available for writing and then for write() to fail with EAGAIN if the state of the socket changed in between the poll() and write() calls. This only seems to actually happen on Mac OS 10.4 (Darwin 8). Rather than trying write() only once, if we get an EAGAIN, continue to call apr_wait_for_io_or_timeout() and try writing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@178340 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ network_io/unix/sendrecv.c | 32 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CHANGES b/CHANGES index a69b03711af..00b384be1ab 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,9 @@ Changes for APR 1.2.0 *) Include the C preprocessor flags in --cflags for pkg-config. [Paul Querna] + *) Fix issue with poll() followed by net I/O yielding EAGAIN on + Mac OS 10.4 (Darwin 8). [Wilfredo Sanchez] + Changes for APR 1.1.1 *) Disable sendfile support for S/390 only in kernel versions < 2.4.0. diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 3c644a9cd15..46853a39b84 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -41,8 +41,8 @@ apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, rv = write(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR); - if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) - && (sock->timeout > 0)) { + while (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { apr_status_t arv; do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); @@ -81,8 +81,8 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len) rv = read(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR); - if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) - && (sock->timeout > 0)) { + while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { @@ -121,8 +121,8 @@ apr_status_t apr_socket_sendto(apr_socket_t *sock, apr_sockaddr_t *where, where->salen); } while (rv == -1 && errno == EINTR); - if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) - && (sock->timeout > 0)) { + while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -154,8 +154,8 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, (struct sockaddr*)&from->sa, &from->salen); } while (rv == -1 && errno == EINTR); - if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) - && (sock->timeout > 0)) { + while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { *len = 0; @@ -201,8 +201,8 @@ apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, rv = writev(sock->socketdes, vec, nvec); } while (rv == -1 && errno == EINTR); - if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) - && (sock->timeout > 0)) { + while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { apr_status_t arv; do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); @@ -317,8 +317,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, *len); /* number of bytes to send */ } while (rv == -1 && errno == EINTR); - if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) - && (sock->timeout > 0)) { + while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { @@ -627,8 +627,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } } while (rc == -1 && errno == EINTR); - if ((rc == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) - && (sock->timeout > 0)) { + while ((rc == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { @@ -774,8 +774,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, flags); /* flags */ } while (rv == -1 && errno == EINTR); - if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) - && (sock->timeout > 0)) { + while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) + && (sock->timeout > 0)) { do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { From 4c650bda4be19c9f7592326e3e8aeba2195b6841 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 25 May 2005 06:24:19 +0000 Subject: [PATCH 5379/7878] * build/apr_hints.m4 (APR_PRELOAD): Prevent use of poll() on Darwin. PR: 34332, 29985 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@178386 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 437d294a6f9..1f304f160d5 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -189,6 +189,8 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-apple-darwin*) APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp]) APR_SETIFNULL(apr_posixsem_is_global, [yes]) + # http://issues.apache.org/bugzilla/show_bug.cgi?id=34332 + APR_SETIFNULL(ac_cv_func_poll, [no]) ;; *-dec-osf*) APR_ADDTO(CPPFLAGS, [-DOSF1]) From 168c69b4051eb28e7fe14bca9f7271cf3cb77470 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Thu, 26 May 2005 16:52:56 +0000 Subject: [PATCH 5380/7878] Disable poll() only on Mac OS X < 10.4. Before 10.4, poll was emulated using select, and if it is bound by the limits of select, we want to use select ourselves. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@178650 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 1f304f160d5..dcac6bced45 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -189,8 +189,12 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-apple-darwin*) APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp]) APR_SETIFNULL(apr_posixsem_is_global, [yes]) - # http://issues.apache.org/bugzilla/show_bug.cgi?id=34332 - APR_SETIFNULL(ac_cv_func_poll, [no]) + case $host in + *-apple-darwin[[0-7]]*) + # http://issues.apache.org/bugzilla/show_bug.cgi?id=34332 + APR_SETIFNULL(ac_cv_func_poll, [no]) + ;; + esac ;; *-dec-osf*) APR_ADDTO(CPPFLAGS, [-DOSF1]) From 75195840108b63a03ab77c8159a83c360668ee45 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Thu, 26 May 2005 17:21:17 +0000 Subject: [PATCH 5381/7878] - Fix darwin version matching git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@178653 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index dcac6bced45..c26f1f096b5 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -190,7 +190,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp]) APR_SETIFNULL(apr_posixsem_is_global, [yes]) case $host in - *-apple-darwin[[0-7]]*) + *-apple-darwin[[0-7]].*) # http://issues.apache.org/bugzilla/show_bug.cgi?id=34332 APR_SETIFNULL(ac_cv_func_poll, [no]) ;; From 003ed8de0ee2c99aa8cab434bd0761f6d75098ae Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Thu, 26 May 2005 22:50:28 +0000 Subject: [PATCH 5382/7878] fix typo Submitted by: dlr git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@178703 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index e317083fcf7..edfcad10c9b 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -315,7 +315,7 @@ APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, /** * Return the pool associated with the current thread. * @param data The user data to associate with the thread. - * @param key The key to use for associating the data with the tread + * @param key The key to use for associating the data with the thread * @param cleanup The cleanup routine to use when the thread is destroyed. * @param thread The currently open thread. */ From 32d067d82feb68e63dda284e474b1531eee117f0 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 28 May 2005 00:13:27 +0000 Subject: [PATCH 5383/7878] - Remove unused variable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@178845 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/kqueue.c | 1 - 1 file changed, 1 deletion(-) diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 287ab18fb37..b2beb571a84 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -235,7 +235,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, const apr_pollfd_t **descriptors) { int ret, i; - pfd_elem_t *ep; struct timespec tv, *tvptr; apr_status_t rv = APR_SUCCESS; From 38957367447fe5f1f97e369208f99f7edf6b1a1a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 31 May 2005 11:42:40 +0000 Subject: [PATCH 5384/7878] Abort if the caller violates a joined-pool guarantee and explicitly destroys a joined pool: (catches the mod_include pool lifetime issues described in PR 12655) * memory/unix/apr_pools.c (pool_destroy_debug): Renamed from apr_pool_destroy_debug; made static. (apr_pool_destroy_debug): New function, wrapper for pool_destroy_debug; abort if called on a joined pool. (pool_clear_debug): Use pool_destroy_debug rather than the wrapper to destroy subpools. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@179208 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 623813551ff..335516fd561 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -500,6 +500,9 @@ static void run_cleanups(cleanup_t **c); static void run_child_cleanups(cleanup_t **c); static void free_proc_chain(struct process_chain *procs); +#if APR_POOL_DEBUG +static void pool_destroy_debug(apr_pool_t *pool, const char *file_line); +#endif #if !APR_POOL_DEBUG /* @@ -1361,7 +1364,7 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) * this pool thus this loop is safe and easy. */ while (pool->child) - apr_pool_destroy_debug(pool->child, file_line); + pool_destroy_debug(pool->child, file_line); /* Run cleanups */ run_cleanups(&pool->cleanups); @@ -1436,8 +1439,7 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, #endif /* APR_HAS_THREADS */ } -APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, - const char *file_line) +static void pool_destroy_debug(apr_pool_t *pool, const char *file_line) { apr_pool_check_integrity(pool); @@ -1474,6 +1476,22 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, free(pool); } +APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, + const char *file_line) +{ + if (pool->joined) { + /* Joined pools must not be explicitly destroyed; the caller + * has broken the guarantee. */ +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) + apr_pool_log_event(pool, "LIFE", + __FILE__ ":apr_pool_destroy abort on joined", 0); +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ + + abort(); + } + pool_destroy_debug(pool, file_line); +} + APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, From cdb5f2d9f2eb0b970563bd83e85a9d6fbd2dcfcd Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 31 May 2005 17:48:24 +0000 Subject: [PATCH 5385/7878] jlibtool: Fix escaping of args with spaces, for example: -DFOO="Text With Spaces". git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@179243 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index 717bf561006..b21c40dec30 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -364,6 +364,7 @@ const char *flatten_count_chars(count_chars *cc) char *shell_esc(const char *str) { + int in_quote = 0; char *cmd; unsigned char *d; const unsigned char *s; @@ -373,7 +374,11 @@ char *shell_esc(const char *str) s = (const unsigned char *)str; for (; *s; ++s) { - if (*s == '"' || *s == '\\') { + if (*s == '"') { + *d++ = '\\'; + in_quote++; + } + else if (*s == '\\' || (*s == ' ' && (in_quote % 2))) { *d++ = '\\'; } *d++ = *s; From 2bcd05cbfd6c0a43764fdf955ea416b7c7ee1aa7 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Tue, 31 May 2005 21:19:55 +0000 Subject: [PATCH 5386/7878] Disable poll() on all Darwin versions for now, because it is either broken or weak sauce. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@179282 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index c26f1f096b5..48c035b7dd1 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -189,12 +189,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-apple-darwin*) APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp]) APR_SETIFNULL(apr_posixsem_is_global, [yes]) - case $host in - *-apple-darwin[[0-7]].*) - # http://issues.apache.org/bugzilla/show_bug.cgi?id=34332 - APR_SETIFNULL(ac_cv_func_poll, [no]) - ;; - esac + APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332 ;; *-dec-osf*) APR_ADDTO(CPPFLAGS, [-DOSF1]) From 3ed031d3f18e948f4c2bce9cd217089ef428315d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 3 Jun 2005 13:36:37 +0000 Subject: [PATCH 5387/7878] * build/apr_network.m4 (APR_CHECK_SCTP): Fix check for SCTP. PR: 35021 Submitted by: Lee Begg git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@179786 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 0e1b096146a..848a5e97fac 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -638,7 +638,8 @@ dnl APR_CHECK_SCTP dnl dnl check for presence of SCTP protocol support dnl -AC_DEFUN(APR_CHECK_SCTP,[ +AC_DEFUN([APR_CHECK_SCTP], +[ AC_CACHE_CHECK([whether SCTP is supported], [apr_cv_sctp], [ AC_TRY_RUN([ #ifdef HAVE_SYS_TYPES_H @@ -650,6 +651,12 @@ AC_DEFUN(APR_CHECK_SCTP,[ #ifdef HAVE_NETINET_IN_H #include #endif +#ifdef HAVE_NETINET_SCTP_H +#include +#endif +#ifdef HAVE_NETINET_SCTP_UIO_H +#include +#endif #include int main(void) { int s, opt = 1; From f093ec370294e53dd9ad43d5b863f6d445b2db7f Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 4 Jun 2005 19:11:31 +0000 Subject: [PATCH 5388/7878] Bug #33844: OS/2: file opened with APR_CREATE would be truncated if APR_APPEND wasn't also given. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@180013 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 3ece062244e..12aa41d763f 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -67,12 +67,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr } if (flag & APR_CREATE) { - oflags |= OPEN_ACTION_CREATE_IF_NEW; - if (!(flag & APR_EXCL)) { - if (flag & APR_APPEND) - oflags |= OPEN_ACTION_OPEN_IF_EXISTS; - else - oflags |= OPEN_ACTION_REPLACE_IF_EXISTS; + oflags |= OPEN_ACTION_CREATE_IF_NEW; + + if (!(flag & APR_EXCL) && !(flag & APR_TRUNCATE)) { + oflags |= OPEN_ACTION_OPEN_IF_EXISTS; } } From b9de67ea81a90ab0c3bb900d283c4dc3b1bbd3ba Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Fri, 10 Jun 2005 14:10:40 +0000 Subject: [PATCH 5389/7878] Fix code which handles FreeBSD release numbers 1.23.4-RELEASE => 1234 1.2.3-RELEASE => 1023 1.2-RELEASE => 1020 to accomodate for .[.] numbers. Previously, configure would complain: /home/martin/apr/configure: line 27912: test: 4.11-STABLE: integer expression expected git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@189962 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index ae5fa6e9fb4..9b78dd59fd8 100644 --- a/configure.in +++ b/configure.in @@ -516,8 +516,8 @@ AC_SUBST(INSTALL_SUBDIRS) # comparisons. case $host in *freebsd*) - # 3.4-RELEASE: 340 4.1.1-RELEASE: 411 - os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/' | sed -e 's/\(.\)\.\(.\)\-.*/\1\20/'` + # 3.4-RELEASE: 3040 4.2.1-RELEASE: 4021 4.11-STABLE: 4110 + os_version=`uname -r | sed -e 's/^\([1-9]\)\.\([0-9]\)\.\([0-9]\).*/\10\2\3/' -e 's/^\([1-9]\)\.\([0-9][0-9]\)\.\([0-9]\).*/\1\2\3/' -e 's/^\([1-9]\)\.\([0-9][0-9]\)-.*/\1\20/' -e 's/^\([1-9]\)\.\([0-9][0-9]\)-.*/\1\20/' -e 's/\([1-9]\)\.\([0-9]\)\-.*/\10\20/'` ;; *linux*) os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/'` @@ -900,7 +900,7 @@ AC_ARG_WITH(sendfile, [ --with-sendfile Override decision to use sendfi orig_sendfile=$sendfile case $host in *freebsd*) - if test $os_version -le "410"; then + if test $os_version -le "4010"; then if test "$threads" = "1"; then sendfile="0" fi From c0169740fad46bced1ed92bb059ae5c044a317bf Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 11 Jun 2005 17:04:32 +0000 Subject: [PATCH 5390/7878] * Test for preferred libtoolize15/libtoolize14 before trusting that libtoolize's version is sane (at least on freebsd, it isn't) * Ask the selected libtoolize for the libtool_m4 path corresponding to *THIS* version of libtoolize, so we remain in sync. LIBTOOL_M4 continues to override the user's choice [although this should either become unconditional, e.g. replace libtool.m4 even when installed by libtoolize, or become a last resort, preferring the libtool_m4 envvar from libtoolize over LIBTOOL_M4 user choice. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@190152 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/buildconf b/buildconf index b16441f4ab3..500a8ca8e8c 100755 --- a/buildconf +++ b/buildconf @@ -22,7 +22,7 @@ # build/buildcheck.sh || exit 1 -libtoolize=`build/PrintPath glibtoolize libtoolize libtoolize15 libtoolize14` +libtoolize=`build/PrintPath glibtoolize libtoolize15 libtoolize14 libtoolize` if [ "x$libtoolize" = "x" ]; then echo "libtoolize not found in path" exit 1 @@ -45,8 +45,14 @@ $libtoolize --copy --automake if [ -f libtool.m4 ]; then ltfile=`pwd`/libtool.m4 else - ltpath=`dirname $libtoolize` - ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/libtool.m4} + ltfindcmd="`sed -n \"/=[^\\\`]/p;/libtool_m4=/{s/.*=/echo /p;q;}\" \ + < $libtoolize`" + ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`} + # Expecting the code above to be very portable, but just in case... + if [ -e "$ltfile" -o ! -f "$ltfile" ]; then + ltpath=`dirname $libtoolize` + ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 + fi fi if [ ! -f $ltfile ]; then From d1d4cde52dd8d0d4ae6c36d2e79140b468349d97 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sun, 12 Jun 2005 17:54:25 +0000 Subject: [PATCH 5391/7878] Implement pool accessor for sockets There is no functional change except changing stuct mamber from cntxt to pool to be able to use the ACCESSOR macros. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@190305 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 5 +++++ include/arch/os2/apr_arch_networkio.h | 2 +- include/arch/unix/apr_arch_networkio.h | 2 +- include/arch/win32/apr_arch_networkio.h | 2 +- network_io/os2/sockets.c | 22 ++++++++++++---------- network_io/unix/sendrecv.c | 10 +++++----- network_io/unix/sockets.c | 24 +++++++++++------------- network_io/win32/sendrecv.c | 2 +- network_io/win32/sockets.c | 22 +++++++++++----------- 9 files changed, 48 insertions(+), 43 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 68d8a7c49ba..948e1df7056 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -738,6 +738,11 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, int *protocol); +/** + * Get the pool used by the socket. + */ +APR_POOL_DECLARE_ACCESSOR(socket); + /** * Set a socket to be inherited by child processes. */ diff --git a/include/arch/os2/apr_arch_networkio.h b/include/arch/os2/apr_arch_networkio.h index 43151ed2a0a..dc8d9e700dd 100644 --- a/include/arch/os2/apr_arch_networkio.h +++ b/include/arch/os2/apr_arch_networkio.h @@ -35,7 +35,7 @@ struct sock_userdata_t { }; struct apr_socket_t { - apr_pool_t *cntxt; + apr_pool_t *pool; int socketdes; int type; int protocol; diff --git a/include/arch/unix/apr_arch_networkio.h b/include/arch/unix/apr_arch_networkio.h index c55616ddbf2..28aa1e64dff 100644 --- a/include/arch/unix/apr_arch_networkio.h +++ b/include/arch/unix/apr_arch_networkio.h @@ -101,7 +101,7 @@ struct sock_userdata_t { }; struct apr_socket_t { - apr_pool_t *cntxt; + apr_pool_t *pool; int socketdes; int type; int protocol; diff --git a/include/arch/win32/apr_arch_networkio.h b/include/arch/win32/apr_arch_networkio.h index d07e4485ab3..869f0af49e7 100644 --- a/include/arch/win32/apr_arch_networkio.h +++ b/include/arch/win32/apr_arch_networkio.h @@ -29,7 +29,7 @@ struct sock_userdata_t { }; struct apr_socket_t { - apr_pool_t *cntxt; + apr_pool_t *pool; SOCKET socketdes; int type; /* SOCK_STREAM, SOCK_DGRAM */ int protocol; diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index aeaef0db01e..343c8a51ee1 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -58,11 +58,11 @@ static void set_socket_vars(apr_socket_t *sock, int family, int type, int protoc static void alloc_socket(apr_socket_t **new, apr_pool_t *p) { *new = (apr_socket_t *)apr_pcalloc(p, sizeof(apr_socket_t)); - (*new)->cntxt = p; - (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, + (*new)->pool = p; + (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, sizeof(apr_sockaddr_t)); (*new)->local_addr->pool = p; - (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, + (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, sizeof(apr_sockaddr_t)); (*new)->remote_addr->pool = p; @@ -108,7 +108,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int (*new)->timeout = -1; (*new)->nonblock = FALSE; - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; @@ -127,7 +127,7 @@ APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket) { - apr_pool_cleanup_kill(thesocket->cntxt, thesocket, socket_cleanup); + apr_pool_cleanup_kill(thesocket->pool, thesocket, socket_cleanup); return socket_cleanup(thesocket); } @@ -180,7 +180,7 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, (*new)->local_addr->ipaddr_ptr = &(*new)->local_addr->sa.sin.sin_addr; } - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -231,15 +231,15 @@ APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - sock_userdata_t *new = apr_palloc(sock->cntxt, sizeof(sock_userdata_t)); + sock_userdata_t *new = apr_palloc(sock->pool, sizeof(sock_userdata_t)); - new->key = apr_pstrdup(sock->cntxt, key); + new->key = apr_pstrdup(sock->pool, key); new->data = data; new->next = sock->userdata; sock->userdata = new; if (cleanup) { - apr_pool_cleanup_register(sock->cntxt, data, cleanup, cleanup); + apr_pool_cleanup_register(sock->pool, data, cleanup, cleanup); } return APR_SUCCESS; @@ -280,7 +280,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, (*apr_sock)->remote_addr_unknown = 1; } - apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), + apr_pool_cleanup_register((*apr_sock)->pool, (void *)(*apr_sock), socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; @@ -303,6 +303,8 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *th return APR_SUCCESS; } +APR_POOL_IMPLEMENT_ACCESSOR(socket); + APR_IMPLEMENT_INHERIT_SET(socket, inherit, cntxt, socket_cleanup) APR_IMPLEMENT_INHERIT_UNSET(socket, inherit, cntxt, socket_cleanup) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 46853a39b84..3aba5021539 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -578,7 +578,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } /* XXX: BUHHH? wow, what a memory leak! */ - headerbuf = hdtrarray[0].iov_base = apr_palloc(sock->cntxt, headerlen); + headerbuf = hdtrarray[0].iov_base = apr_palloc(sock->pool, headerlen); hdtrarray[0].iov_len = headerlen; for (i = 0; i < hdtr->numheaders; i++) { @@ -603,7 +603,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } /* XXX: BUHHH? wow, what a memory leak! */ - trailerbuf = hdtrarray[1].iov_base = apr_palloc(sock->cntxt, trailerlen); + trailerbuf = hdtrarray[1].iov_base = apr_palloc(sock->pool, trailerlen); hdtrarray[1].iov_len = trailerlen; for (i = 0; i < hdtr->numtrailers; i++) { @@ -714,7 +714,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, /* but headers are small, so maybe we can hold on to the * memory for the life of the socket... */ - hbuf = apr_palloc(sock->cntxt, parms.header_length); + hbuf = apr_palloc(sock->pool, parms.header_length); #endif ptr = 0; for (i = 0; i < hdtr->numheaders; i++) { @@ -740,7 +740,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, /* Keepalives make apr_palloc a bad idea */ tbuf = malloc(parms.trailer_length); #else - tbuf = apr_palloc(sock->cntxt, parms.trailer_length); + tbuf = apr_palloc(sock->pool, parms.trailer_length); #endif ptr = 0; for (i = 0; i < hdtr->numtrailers; i++) { @@ -853,7 +853,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, /* Calculate how much space we need. */ vecs = hdtr->numheaders + hdtr->numtrailers + 1; - sfv = apr_palloc(sock->cntxt, sizeof(sendfilevec_t) * vecs); + sfv = apr_palloc(sock->pool, sizeof(sendfilevec_t) * vecs); curvec = 0; diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 05ae6cce3c5..665a2dc3d7a 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -59,11 +59,11 @@ static void set_socket_vars(apr_socket_t *sock, int family, int type, int protoc static void alloc_socket(apr_socket_t **new, apr_pool_t *p) { *new = (apr_socket_t *)apr_pcalloc(p, sizeof(apr_socket_t)); - (*new)->cntxt = p; - (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, + (*new)->pool = p; + (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, sizeof(apr_sockaddr_t)); (*new)->local_addr->pool = p; - (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, + (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, sizeof(apr_sockaddr_t)); (*new)->remote_addr->pool = p; #ifndef WAITIO_USES_POLL @@ -131,7 +131,7 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, (*new)->timeout = -1; (*new)->inherit = 0; - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, + apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup, socket_cleanup); return APR_SUCCESS; @@ -145,7 +145,7 @@ apr_status_t apr_socket_shutdown(apr_socket_t *thesocket, apr_status_t apr_socket_close(apr_socket_t *thesocket) { - return apr_pool_cleanup_run(thesocket->cntxt, thesocket, socket_cleanup); + return apr_pool_cleanup_run(thesocket->pool, thesocket, socket_cleanup); } apr_status_t apr_socket_bind(apr_socket_t *sock, apr_sockaddr_t *sa) @@ -245,7 +245,7 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, } (*new)->inherit = 0; - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup, + apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup, socket_cleanup); return APR_SUCCESS; } @@ -334,15 +334,15 @@ apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *soc apr_status_t apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - sock_userdata_t *new = apr_palloc(sock->cntxt, sizeof(sock_userdata_t)); + sock_userdata_t *new = apr_palloc(sock->pool, sizeof(sock_userdata_t)); - new->key = apr_pstrdup(sock->cntxt, key); + new->key = apr_pstrdup(sock->pool, key); new->data = data; new->next = sock->userdata; sock->userdata = new; if (cleanup) { - apr_pool_cleanup_register(sock->cntxt, data, cleanup, cleanup); + apr_pool_cleanup_register(sock->pool, data, cleanup, cleanup); } return APR_SUCCESS; @@ -387,7 +387,7 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, } (*apr_sock)->inherit = 0; - apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), + apr_pool_cleanup_register((*apr_sock)->pool, (void *)(*apr_sock), socket_cleanup, socket_cleanup); return APR_SUCCESS; } @@ -410,6 +410,4 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, return APR_SUCCESS; } -APR_IMPLEMENT_INHERIT_SET(socket, inherit, cntxt, socket_cleanup) - -APR_IMPLEMENT_INHERIT_UNSET(socket, inherit, cntxt, socket_cleanup) +APR_POOL_IMPLEMENT_ACCESSOR(socket); diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 5f5df4802f8..326f7122eaa 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -318,7 +318,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, /* Initialize the overlapped structure used on TransmitFile */ if (!sock->overlapped) { - sock->overlapped = apr_pcalloc(sock->cntxt, sizeof(OVERLAPPED)); + sock->overlapped = apr_pcalloc(sock->pool, sizeof(OVERLAPPED)); sock->overlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); } while (bytes_to_send) { diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index d095f4bacd9..5621241fe21 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -55,11 +55,11 @@ static void set_socket_vars(apr_socket_t *sock, int family, int type, int protoc static void alloc_socket(apr_socket_t **new, apr_pool_t *p) { *new = (apr_socket_t *)apr_pcalloc(p, sizeof(apr_socket_t)); - (*new)->cntxt = p; - (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, + (*new)->pool = p; + (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, sizeof(apr_sockaddr_t)); (*new)->local_addr->pool = p; - (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->cntxt, + (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, sizeof(apr_sockaddr_t)); (*new)->remote_addr->pool = p; @@ -146,7 +146,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, (*new)->timeout = -1; (*new)->disconnected = 0; - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; @@ -185,7 +185,7 @@ APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket) { - apr_pool_cleanup_kill(thesocket->cntxt, thesocket, socket_cleanup); + apr_pool_cleanup_kill(thesocket->pool, thesocket, socket_cleanup); return socket_cleanup(thesocket); } @@ -291,7 +291,7 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, (*new)->local_interface_unknown = 1; } - apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), + apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -401,15 +401,15 @@ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup)(void *)) { - sock_userdata_t *new = apr_palloc(sock->cntxt, sizeof(sock_userdata_t)); + sock_userdata_t *new = apr_palloc(sock->pool, sizeof(sock_userdata_t)); - new->key = apr_pstrdup(sock->cntxt, key); + new->key = apr_pstrdup(sock->pool, key); new->data = data; new->next = sock->userdata; sock->userdata = new; if (cleanup) { - apr_pool_cleanup_register(sock->cntxt, data, cleanup, cleanup); + apr_pool_cleanup_register(sock->pool, data, cleanup, cleanup); } return APR_SUCCESS; @@ -454,7 +454,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, (*apr_sock)->remote_addr_unknown = 1; } - apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), + apr_pool_cleanup_register((*apr_sock)->pool, (void *)(*apr_sock), socket_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; @@ -494,4 +494,4 @@ APR_DECLARE(apr_status_t) apr_socket_inherit_unset(apr_socket_t *socket) return APR_ENOTIMPL; } - +APR_POOL_IMPLEMENT_ACCESSOR(socket); From 29b4dca98b9f9b037ca5bbefa70c0c9326b777c4 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sun, 12 Jun 2005 17:58:56 +0000 Subject: [PATCH 5392/7878] Bring back INHERIT macros with new struct member rename. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@190306 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 665a2dc3d7a..89cee00e780 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -411,3 +411,7 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, } APR_POOL_IMPLEMENT_ACCESSOR(socket); + +APR_IMPLEMENT_INHERIT_SET(socket, inherit, pool, socket_cleanup) + +APR_IMPLEMENT_INHERIT_UNSET(socket, inherit, pool, socket_cleanup) From ac3eb4f720cd699553c47841446f51858980583b Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sun, 12 Jun 2005 18:00:16 +0000 Subject: [PATCH 5393/7878] Change INHERIT macros to use the new struct member rename. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@190307 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 343c8a51ee1..f1c00b5b108 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -305,7 +305,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *th APR_POOL_IMPLEMENT_ACCESSOR(socket); -APR_IMPLEMENT_INHERIT_SET(socket, inherit, cntxt, socket_cleanup) +APR_IMPLEMENT_INHERIT_SET(socket, inherit, pool, socket_cleanup) -APR_IMPLEMENT_INHERIT_UNSET(socket, inherit, cntxt, socket_cleanup) +APR_IMPLEMENT_INHERIT_UNSET(socket, inherit, pool, socket_cleanup) From 11c78ffee7a3a2cb4360a56048b422290446172d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 13 Jun 2005 14:38:14 +0000 Subject: [PATCH 5394/7878] jfclere points out that I ment to test for zero string, not file. this test syntax may still be too complex. perhaps -f is sufficient to verify the name is non-null? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@190411 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildconf b/buildconf index 500a8ca8e8c..fe2f0be5a22 100755 --- a/buildconf +++ b/buildconf @@ -49,7 +49,7 @@ else < $libtoolize`" ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`} # Expecting the code above to be very portable, but just in case... - if [ -e "$ltfile" -o ! -f "$ltfile" ]; then + if [ -z "$ltfile" -o ! -f "$ltfile" ]; then ltpath=`dirname $libtoolize` ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 fi From 158f4b2e90545a77608cab4d22f3043bcb850e45 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 14 Jun 2005 09:54:59 +0000 Subject: [PATCH 5395/7878] * network_io/unix/inet_ntop.c (inet_ntop6): Silence "variable may be used uninitialized" warning with gcc 4.0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@190564 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_ntop.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index 451e9a0fb7f..a96eb18f7a6 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -163,6 +163,7 @@ inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) next_dest = words; best.base = -1; cur.base = -1; + cur.len = best.len = 0; /* silence gcc4 warning */ i = 0; do { unsigned int next_word = (unsigned int)*next_src++; From 952e0f5e9942db8f19bce189185564021074f59d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 14 Jun 2005 10:22:37 +0000 Subject: [PATCH 5396/7878] send and receive buffer sizes are not flags, and caller may pass different values on different calls; so don't try to optimize this setsockopt() SO_LINGER is an odd one; the real setsockopt provides a configurable value for the timeout; but with APR, this is a flag and the timeout; so the optimization stays for this one Reviewed by: Joe Orton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@190568 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 4c45db15631..5fcc493e9f7 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -151,11 +151,8 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, break; case APR_SO_SNDBUF: #ifdef SO_SNDBUF - if (apr_is_option_set(sock, APR_SO_SNDBUF) != on) { - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { - return errno; - } - apr_set_option(sock, APR_SO_SNDBUF, on); + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { + return errno; } #else return APR_ENOTIMPL; @@ -163,11 +160,8 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, break; case APR_SO_RCVBUF: #ifdef SO_RCVBUF - if (apr_is_option_set(sock, APR_SO_RCVBUF) != on) { - if (setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVBUF, (void *)&on, sizeof(int)) == -1) { - return errno; - } - apr_set_option(sock, APR_SO_RCVBUF, on); + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVBUF, (void *)&on, sizeof(int)) == -1) { + return errno; } #else return APR_ENOTIMPL; From 449a3a3f322232462504c4a2de44c2b14826b54b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 14 Jun 2005 10:45:25 +0000 Subject: [PATCH 5397/7878] Support APR_SO_SNDBUF and APR_SO_RCVBUF on Windows. PR: 32177 Submitted by: Sim , Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@190576 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ network_io/win32/sockopt.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGES b/CHANGES index 00b384be1ab..fcafd6c5a1e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.2.0 + *) Support APR_SO_SNDBUF and APR_SO_RCVBUF on Windows. PR 32177. + [Sim , Jeff Trawick] + *) Fix apr_table_overlap()'s handling of tables allocated from different pools. [Joe Schaefer ] diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 7f38aa70366..73c7317ed76 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -113,6 +113,18 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, apr_set_option(sock, APR_SO_DEBUG, on); } break; + case APR_SO_SNDBUF: + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, + (void *)&on, sizeof(int)) == -1) { + return apr_get_netos_error(); + } + break; + case APR_SO_RCVBUF: + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVBUF, + (void *)&on, sizeof(int)) == -1) { + return apr_get_netos_error(); + } + break; case APR_SO_REUSEADDR: if (on != apr_is_option_set(sock, APR_SO_REUSEADDR)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, From bfd3cc71b0c89c9f26212876cdd68b7484c5ceae Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 14 Jun 2005 14:11:15 +0000 Subject: [PATCH 5398/7878] Update remaining 2004 copyright notices. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@190594 13f79535-47bb-0310-9956-ffa450edef68 --- build/PrintPath | 3 ++- buildconf | 3 ++- include/apr.h.in | 3 ++- include/apr.hnw | 3 ++- include/apr.hw | 3 ++- misc/unix/randbyte_os2.inc | 3 ++- network_io/unix/multicast.c | 3 ++- test/testlfs.c | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/build/PrintPath b/build/PrintPath index 0e512250f9d..eaa6c1c9782 100755 --- a/build/PrintPath +++ b/build/PrintPath @@ -1,6 +1,7 @@ #!/bin/sh # -# Copyright 1999-2004 The Apache Software Foundation +# Copyright 1999-2005 The Apache Software Foundation or its licensors, as +# applicable. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/buildconf b/buildconf index fe2f0be5a22..7f80ecd5a8c 100755 --- a/buildconf +++ b/buildconf @@ -1,5 +1,6 @@ #!/bin/sh -# Copyright 2000-2004 The Apache Software Foundation +# Copyright 2000-2005 The Apache Software Foundation or its licensors, as +# applicable. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/include/apr.h.in b/include/apr.h.in index d1332921dc6..87869b80e68 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr.hnw b/include/apr.hnw index f1be62e1b87..a907a8789ec 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/apr.hw b/include/apr.hw index 1174a190a51..1a3c67401bd 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/misc/unix/randbyte_os2.inc b/misc/unix/randbyte_os2.inc index e5c9bcb4570..ee23f8d901c 100644 --- a/misc/unix/randbyte_os2.inc +++ b/misc/unix/randbyte_os2.inc @@ -1,4 +1,5 @@ -/* Copyright 2000-2004 The Apache Software Foundation +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index eb4304f07c2..904ee404eec 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -1,4 +1,5 @@ -/* Copyright 2004 The Apache Software Foundation +/* Copyright 2004-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/testlfs.c b/test/testlfs.c index 5f83b453b45..e603968e632 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -1,4 +1,5 @@ -/* Copyright 2004 The Apache Software Foundation +/* Copyright 2004-2005 The Apache Software Foundation or its licensors, as + * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 9ca5439a3e43ac40486dad290d7b540612984470 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Fri, 17 Jun 2005 00:53:05 +0000 Subject: [PATCH 5399/7878] * build/buildcheck.sh: Replace last mentions of CVS with SVN. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@191041 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index f24fa74c0b1..62fe931aefc 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -7,7 +7,7 @@ python=`build/PrintPath python` if test -z "$python"; then echo "buildconf: python not found." echo " You need python installed" -echo " to build APR from CVS." +echo " to build APR from SVN." exit 1 else py_version=`python -c 'import sys; print sys.version' 2>&1|sed 's/ .*//;q'` @@ -19,14 +19,14 @@ ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[ if test -z "$ac_version"; then echo "buildconf: autoconf not found." echo " You need autoconf version 2.50 or newer installed" -echo " to build APR from CVS." +echo " to build APR from SVN." exit 1 fi IFS=.; set $ac_version; IFS=' ' if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then echo "buildconf: autoconf version $ac_version found." echo " You need autoconf version 2.50 or newer installed" -echo " to build APR from CVS." +echo " to build APR from SVN." exit 1 else echo "buildconf: autoconf version $ac_version (ok)" @@ -43,7 +43,7 @@ lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/ if test -z "$lt_pversion"; then echo "buildconf: libtool not found." echo " You need libtool version 1.4 or newer installed" -echo " to build APR from CVS." +echo " to build APR from SVN." exit 1 fi lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` @@ -61,6 +61,6 @@ fi echo "buildconf: libtool version $lt_pversion found." echo " You need libtool version 1.4 or newer installed" -echo " to build APR from CVS." +echo " to build APR from SVN." exit 1 From 382527f294d8773f6412ab5678b64d66d1862b4f Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Fri, 17 Jun 2005 01:42:06 +0000 Subject: [PATCH 5400/7878] * configure.in: Fix the test for ancient FreeBSD that fails on a 6.0-CURRENT Machine. Use the kern.osreldate sysctl which gives us a stable versioning method. We already use it for the FreeBSD version detection in the build hints code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@191047 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 9b78dd59fd8..0da0554dd4c 100644 --- a/configure.in +++ b/configure.in @@ -516,8 +516,11 @@ AC_SUBST(INSTALL_SUBDIRS) # comparisons. case $host in *freebsd*) - # 3.4-RELEASE: 3040 4.2.1-RELEASE: 4021 4.11-STABLE: 4110 - os_version=`uname -r | sed -e 's/^\([1-9]\)\.\([0-9]\)\.\([0-9]\).*/\10\2\3/' -e 's/^\([1-9]\)\.\([0-9][0-9]\)\.\([0-9]\).*/\1\2\3/' -e 's/^\([1-9]\)\.\([0-9][0-9]\)-.*/\1\20/' -e 's/^\([1-9]\)\.\([0-9][0-9]\)-.*/\1\20/' -e 's/\([1-9]\)\.\([0-9]\)\-.*/\10\20/'` + if test -x /sbin/sysctl; then + os_version=`/sbin/sysctl -n kern.osreldate` + else + os_version=000000 + fi ;; *linux*) os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/'` @@ -900,7 +903,8 @@ AC_ARG_WITH(sendfile, [ --with-sendfile Override decision to use sendfi orig_sendfile=$sendfile case $host in *freebsd*) - if test $os_version -le "4010"; then + # FreeBSD < 4.2 has issues with threads+sendfile + if test $os_version -le "401999"; then if test "$threads" = "1"; then sendfile="0" fi From 75f8d17321b6249ac5a5052ca3186842d15a483c Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Fri, 17 Jun 2005 01:54:47 +0000 Subject: [PATCH 5401/7878] * build/jlibtool.c: Start the string with null, and strcat will extend it correctly. This fixes jlibtool on FreeBSD 6.0-CURRENT. (and likely other platforms...) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@191048 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index b21c40dec30..7ddffc5d31a 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -350,7 +350,7 @@ const char *flatten_count_chars(count_chars *cc) } newval = (char*)malloc(size + 1); - newval[size] = 0; + newval[0] = 0; for (i = 0; i < cc->num; i++) { if (cc->vals[i]) { From b4c7a97be708e44002b30f5a151133d55d045f0e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 17 Jun 2005 12:12:36 +0000 Subject: [PATCH 5402/7878] Add %pt support to apr_snprintf() for printing an apr_os_thread_t in hex format. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@191138 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_lib.h | 2 ++ strings/apr_snprintf.c | 46 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/CHANGES b/CHANGES index fcafd6c5a1e..8d7f85b0e70 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.2.0 + *) Add %pt support to apr_snprintf() for printing an apr_os_thread_t + in hex format. [Jeff Trawick] + *) Support APR_SO_SNDBUF and APR_SO_RCVBUF on Windows. PR 32177. [Sim , Jeff Trawick] diff --git a/include/apr_lib.h b/include/apr_lib.h index c48782d5bb0..738df7a2787 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -116,6 +116,8 @@ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); * [ipv6-address]:port * %%pT takes an apr_os_thread_t * and prints it in decimal * ('0' is printed if !APR_HAS_THREADS) + * %%pt takes an apr_os_thread_t * and prints it in hexadecimal + * ('0' is printed if !APR_HAS_THREADS) * %%pp takes a void * and outputs it in hex * * The %%p hacks are to force gcc's printf warning code to skip diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 0d5dad0bb2d..313a778cf92 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -665,6 +665,27 @@ static char *conv_p2_quad(u_widest_int num, register int nbits, return (p); } +#if APR_HAS_THREADS +static char *conv_os_thread_t_hex(apr_os_thread_t *tid, char *buf_end, apr_size_t *len) +{ + union { + apr_os_thread_t tid; + apr_uint64_t alignme; + } u; + int is_negative; + + u.tid = *tid; + switch(sizeof(u.tid)) { + case sizeof(apr_int32_t): + return conv_p2(*(apr_uint32_t *)&u.tid, 4, 'x', buf_end, len); + case sizeof(apr_int64_t): + return conv_p2_quad(*(apr_uint64_t *)&u.tid, 4, 'x', buf_end, len); + default: + /* not implemented; stick 0 in the buffer */ + return conv_10(0, TRUE, &is_negative, buf_end, len); + } +} +#endif /* * Do format conversion placing the output in buffer @@ -1170,6 +1191,31 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), #endif break; + case 't': +#if APR_HAS_THREADS + { + apr_os_thread_t *tid; + + tid = va_arg(ap, apr_os_thread_t *); + if (tid != NULL) { + s = conv_os_thread_t_hex(tid, &num_buf[NUM_BUF_SIZE], &s_len); + if (adjust_precision && precision < s_len) + s_len = precision; + } + else { + s = S_NULL; + s_len = S_NULL_LEN; + } + pad_char = ' '; + } +#else + char_buf[0] = '0'; + s = &char_buf[0]; + s_len = 1; + pad_char = ' '; +#endif + break; + case NUL: /* if %p ends the string, oh well ignore it */ continue; From 9426ccbcaef0f4627aa2ef2b0a41e1544b7a8c1c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 18 Jun 2005 18:19:59 +0000 Subject: [PATCH 5403/7878] Fatal compiler quirk, you would think (DWORD)(n >> 32) == 0 if n is a DWORD. But, alas, in release builds it doesn't. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@191306 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 32c952e0a7e..1c9bca9b2f7 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -19,6 +19,7 @@ #include "apr_file_io.h" #include "apr_shm.h" #include "apr_arch_file_io.h" +#include "limits.h" typedef struct memblock_t { apr_size_t size; @@ -63,7 +64,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, apr_file_t *f; void *base; void *mapkey; - DWORD err; + DWORD err, sizelo, sizehi; reqsize += sizeof(memblock_t); @@ -76,6 +77,12 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* Compute the granualar multiple of the pagesize */ size = memblock * (1 + (reqsize - 1) / memblock); + sizelo = (DWORD)size; +#ifdef WIN64 + sizehi = (DWORD)(size >> 32); +#else + sizehi = 0; +#endif if (!file) { /* Do Anonymous, which must be passed as a duplicated handle */ @@ -109,8 +116,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - DWORD sizelo = (DWORD)size; - DWORD sizehi = (DWORD)(size >> 32); hMap = CreateFileMappingW(hFile, NULL, PAGE_READWRITE, sizehi, sizelo, mapkey); } @@ -118,8 +123,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI { - DWORD sizelo = (DWORD)size; - DWORD sizehi = (DWORD)(size >> 32); hMap = CreateFileMappingA(hFile, NULL, PAGE_READWRITE, sizehi, sizelo, mapkey); } From e3a4f9935cfd04064b954678b5d3f93870f540bb Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 25 Jun 2005 08:14:53 +0000 Subject: [PATCH 5404/7878] Fix incorrect comments describing how the index within a table works git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@201736 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index c1128c65d4f..2376a8f6b19 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -337,14 +337,13 @@ struct apr_table_t { void *creator; #endif /* An index to speed up table lookups. The way this works is: - * - Take the requested key and compute its checksum - * - Hash the checksum into the index: - * - index_first[TABLE_HASH(checksum)] is the offset within - * the table of the first entry with that key checksum - * - index_last[TABLE_HASH(checksum)] is the offset within - * the table of the first entry with that key checksum + * - Hash the key into the index: + * - index_first[TABLE_HASH(key)] is the offset within + * the table of the first entry with that key + * - index_last[TABLE_HASH(key)] is the offset within + * the table of the last entry with that key * - If (and only if) there is no entry in the table whose - * checksum hashes to index element i, then the i'th bit + * key hashes to index element i, then the i'th bit * of index_initialized will be zero. (Check this before * trying to use index_first[i] or index_last[i]!) */ From 86d249e48aa4288a086a47dee9202b3a6073960a Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 25 Jun 2005 09:26:59 +0000 Subject: [PATCH 5405/7878] Add random group like for static build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@201738 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libapr.dsp b/libapr.dsp index dd399a7e5e8..13835e4d158 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -311,6 +311,22 @@ SOURCE=.\network_io\win32\sockopt.c SOURCE=.\passwd\apr_getpass.c # End Source File # End Group +# Begin Group "random" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\random\unix\apr_random.c +# End Source File +# Begin Source File + +SOURCE=.\random\unix\sha2.c +# End Source File +# Begin Source File + +SOURCE=.\random\unix\sha2_glue.c +# End Source File +# End Group # Begin Group "shmem" # PROP Default_Filter "" From 2def5d1e2128a40a14c2b5985eb1cda607a2e917 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 29 Jun 2005 11:34:19 +0000 Subject: [PATCH 5406/7878] OS/2: Using apr_file_rename() to replace one file with another doesn't work on some types of network drive as the file system driver returns a different error code when an attempt is made to rename to an existing file name. Allow for this error code, ERROR_ALREADY_EXISTS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@202348 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 12aa41d763f..3b9760425c6 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -156,7 +156,7 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_ { ULONG rc = DosMove(from_path, to_path); - if (rc == ERROR_ACCESS_DENIED) { + if (rc == ERROR_ACCESS_DENIED || rc == ERROR_ALREADY_EXISTS) { rc = DosDelete(to_path); if (rc == 0 || rc == ERROR_FILE_NOT_FOUND) { From 7b396721c36dd78886044fc0975612fbe49ed18e Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Thu, 30 Jun 2005 00:56:39 +0000 Subject: [PATCH 5407/7878] Fix corruption of the pollset rings on Solaris 10. A pfd_elem_t was being inserted into a new ring without being removed first, corrupting the source ring. Found and tested in the httpd zone on Helios. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@202460 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ poll/unix/port.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 8d7f85b0e70..56cded80d3f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes for APR 1.2.0 + *) Fix Pollset corruption on Solaris 10. [Paul Querna] + *) Add %pt support to apr_snprintf() for printing an apr_os_thread_t in hex format. [Jeff Trawick] diff --git a/poll/unix/port.c b/poll/unix/port.c index f2350ee997d..dde105ee9f5 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -282,6 +282,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, port_associate(pollset->port_fd, PORT_SOURCE_FD, fd, get_event(ep->pfd.reqevents), ep); + APR_RING_INSERT_TAIL(&(pollset->query_ring), ep, pfd_elem_t, link); + } pollset_unlock_rings(); @@ -313,6 +315,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset->result_set[i].rtnevents = get_revent(pollset->port_set[i].portev_events); + APR_RING_REMOVE((pfd_elem_t*)pollset->port_set[i].portev_user, link); + APR_RING_INSERT_TAIL(&(pollset->add_ring), (pfd_elem_t*)pollset->port_set[i].portev_user, pfd_elem_t, link); From 24b2afee9e51787643b4b1453478403aa7fb3668 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 3 Jul 2005 03:53:13 +0000 Subject: [PATCH 5408/7878] OS/2: Fix crash in apr_proc_create with non-shell type process creation where the .exe extension is not given. Was trying to close an apr_file_t that had failed to open, causing a segfault. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@208879 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 3ea770d0a96..57f0afe6728 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -375,8 +375,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname interpreter[0] = 0; } } + + apr_file_close(progfile); } - apr_file_close(progfile); } i = 0; From e6ad07aa5aa7abe5e0ba384e278f8a30cf538806 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 5 Jul 2005 16:13:39 +0000 Subject: [PATCH 5409/7878] Realign. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@209292 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index 56cded80d3f..75b5f4b32e7 100644 --- a/CHANGES +++ b/CHANGES @@ -5,19 +5,19 @@ Changes for APR 1.2.0 *) Add %pt support to apr_snprintf() for printing an apr_os_thread_t in hex format. [Jeff Trawick] - *) Support APR_SO_SNDBUF and APR_SO_RCVBUF on Windows. PR 32177. - [Sim , Jeff Trawick] + *) Support APR_SO_SNDBUF and APR_SO_RCVBUF on Windows. PR 32177. + [Sim , Jeff Trawick] - *) Fix apr_table_overlap()'s handling of tables allocated from - different pools. [Joe Schaefer ] + *) Fix apr_table_overlap()'s handling of tables allocated from + different pools. [Joe Schaefer ] - *) Add support for uuid_generate on OS X 10.4. [Paul Querna] + *) Add support for uuid_generate on OS X 10.4. [Paul Querna] - *) Include the C preprocessor flags in --cflags for pkg-config. - [Paul Querna] + *) Include the C preprocessor flags in --cflags for pkg-config. + [Paul Querna] - *) Fix issue with poll() followed by net I/O yielding EAGAIN on - Mac OS 10.4 (Darwin 8). [Wilfredo Sanchez] + *) Fix issue with poll() followed by net I/O yielding EAGAIN on + Mac OS 10.4 (Darwin 8). [Wilfredo Sanchez] Changes for APR 1.1.1 From f7fdd243d4b8e8f60784e9b5a4b79edcdf469112 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Fri, 8 Jul 2005 09:08:21 +0000 Subject: [PATCH 5410/7878] Actually implement the multicast on the WIN32. HAVE_STRUCT_IPMREQ was missing from WIN32 definitions, so although the multicast.c was added, code was never compiled in. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@209721 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_networkio.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/arch/win32/apr_arch_networkio.h b/include/arch/win32/apr_arch_networkio.h index 869f0af49e7..e58b1d65a73 100644 --- a/include/arch/win32/apr_arch_networkio.h +++ b/include/arch/win32/apr_arch_networkio.h @@ -63,6 +63,9 @@ typedef struct _WSABUF { char FAR * buf; /* the pointer to the buffer */ } WSABUF, FAR * LPWSABUF; #endif +#else +/* Not sure if this is the right place to define this */ +#define HAVE_STRUCT_IPMREQ #endif apr_status_t status_from_res_error(int); From c3a61985c97716e3e7e5f789ebf77f0c795f5332 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 9 Jul 2005 07:07:17 +0000 Subject: [PATCH 5411/7878] Added lazy evaluation of the pollset that's used within apr_file_t on platforms where apr_wait_for_io_or_timeout does not use poll(2). This is a performance fix for httpd-2.x running on OS X, where the creation of an unused, kqueue-based apr_pollset_t on every file open and every file setaside was consuming a noticeable amount of CPU time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@209931 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ file_io/unix/filedup.c | 11 +++++------ file_io/unix/open.c | 25 +++++++++++++++++++------ file_io/unix/pipe.c | 11 ++++++----- support/unix/waitio.c | 9 ++++++++- 5 files changed, 44 insertions(+), 18 deletions(-) diff --git a/CHANGES b/CHANGES index 75b5f4b32e7..66cc6e7f0fa 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes for APR 1.2.0 + *) Switch to lazy initialization of the pollset that's used within + apr_file_t on platforms where apr_wait_for_io_or_timeout() doesn't + use poll(2). (This fixes a performance problem observed in httpd-2.x + on OS X due to the use of poll now being disabled by default on that + platform.) [Brian Pane] + *) Fix Pollset corruption on Solaris 10. [Paul Querna] *) Add %pt support to apr_snprintf() for printing an apr_os_thread_t diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index fe792258eaf..fdc0358e0a6 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -93,9 +93,10 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_unix_file_cleanup, apr_unix_file_cleanup); #ifndef WAITIO_USES_POLL - /* Create a pollset with room for one descriptor. */ - /* ### check return codes */ - (void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0); + /* Start out with no pollset. apr_wait_for_io_or_timeout() will + * initialize the pollset if needed. + */ + (*new_file)->pollset = NULL; #endif return APR_SUCCESS; } @@ -150,9 +151,7 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, apr_pool_cleanup_kill(old_file->pool, (void *)old_file, apr_unix_file_cleanup); #ifndef WAITIO_USES_POLL - /* Create a pollset with room for one descriptor. */ - /* ### check return codes */ - (void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0); + (*new_file)->pollset = NULL; #endif return APR_SUCCESS; } diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 55b98630247..e8e94ff0b1f 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -49,6 +49,17 @@ apr_status_t apr_unix_file_cleanup(void *thefile) /* Are there any error conditions other than EINTR or EBADF? */ rv = errno; } +#ifndef WAITIO_USES_POLL + if (file->pollset != NULL) { + int pollset_rv = apr_pollset_destroy(file->pollset); + /* If the file close failed, return its error value, + * not apr_pollset_destroy()'s. + */ + if (rv == APR_SUCCESS) { + rv = pollset_rv; + } + } +#endif /* !WAITIO_USES_POLL */ return rv != APR_SUCCESS ? rv : flush_rv; } @@ -159,9 +170,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, (*new)->dataRead = 0; (*new)->direction = 0; #ifndef WAITIO_USES_POLL - /* Create a pollset with room for one descriptor. */ - /* ### check return codes */ - (void) apr_pollset_create(&(*new)->pollset, 1, pool, 0); + /* Start out with no pollset. apr_wait_for_io_or_timeout() will + * initialize the pollset if needed. + */ + (*new)->pollset = NULL; #endif if (!(flag & APR_FILE_NOCLEANUP)) { apr_pool_cleanup_register((*new)->pool, (void *)(*new), @@ -220,9 +232,10 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file)->buffered = (flags & APR_BUFFERED) > 0; #ifndef WAITIO_USES_POLL - /* Create a pollset with room for one descriptor. */ - /* ### check return codes */ - (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); + /* Start out with no pollset. apr_wait_for_io_or_timeout() will + * initialize the pollset if needed. + */ + (*file)->pollset = NULL; #endif if ((*file)->buffered) { diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index ec54432f7f6..d8e52495ccf 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -161,9 +161,10 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, apr_pool_cleanup_null); } #ifndef WAITIO_USES_POLL - /* Create a pollset with room for one descriptor. */ - /* ### check return codes */ - (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); + /* Start out with no pollset. apr_wait_for_io_or_timeout() will + * initialize the pollset if needed. + */ + (*file)->pollset = NULL; #endif return APR_SUCCESS; } @@ -197,7 +198,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->thlock = NULL; #endif #ifndef WAITIO_USES_POLL - (void) apr_pollset_create(&(*in)->pollset, 1, pool, 0); + (*in)->pollset = NULL; #endif (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); (*out)->pool = pool; @@ -212,7 +213,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*out)->thlock = NULL; #endif #ifndef WAITIO_USES_POLL - (void) apr_pollset_create(&(*out)->pollset, 1, pool, 0); + (*out)->pollset = NULL; #endif apr_pool_cleanup_register((*in)->pool, (void *)(*in), apr_unix_file_cleanup, apr_pool_cleanup_null); diff --git a/support/unix/waitio.c b/support/unix/waitio.c index 81fea536b52..167ad6d0801 100644 --- a/support/unix/waitio.c +++ b/support/unix/waitio.c @@ -61,7 +61,7 @@ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, } } -#else +#else /* !WAITIO_USES_POLL */ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, int for_read) @@ -78,6 +78,13 @@ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, pfd.desc.f = f; pollset = f->pollset; + if (pollset == NULL) { + status = apr_pollset_create(&(f->pollset), 1, f->pool, 0); + if (status != APR_SUCCESS) { + return status; + } + pollset = f->pollset; + } timeout = f->timeout; } else { From 383495e19cf8760495c76b40e72525e80c4112c3 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 16 Jul 2005 08:07:53 +0000 Subject: [PATCH 5412/7878] OS/2: Implement apr_file_mtime_set(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@219295 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filestat.c | 13 ++++++++++++- include/arch/os2/apr_arch_file_io.h | 2 ++ time/unix/time.c | 17 +++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 0414c7150cd..e6410e254f7 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -225,5 +225,16 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, apr_time_t mtime, apr_pool_t *pool) { - return APR_ENOTIMPL; + FILESTATUS3 fs3; + ULONG rc; + rc = DosQueryPathInfo(fname, FIL_STANDARD, &fs3, sizeof(fs3)); + + if (rc) { + return APR_FROM_OS_ERROR(rc); + } + + apr_apr_time_to_os2_time(&fs3.fdateLastWrite, &fs3.ftimeLastWrite, mtime); + + rc = DosSetPathInfo(fname, FIL_STANDARD, &fs3, sizeof(fs3), 0); + return APR_FROM_OS_ERROR(rc); } diff --git a/include/arch/os2/apr_arch_file_io.h b/include/arch/os2/apr_arch_file_io.h index 26045c1f652..ff3b3145bad 100644 --- a/include/arch/os2/apr_arch_file_io.h +++ b/include/arch/os2/apr_arch_file_io.h @@ -66,6 +66,8 @@ struct apr_dir_t { apr_status_t apr_file_cleanup(void *); apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, FTIME os2time); +apr_status_t apr_apr_time_to_os2_time(FDATE *os2date, FTIME *os2time, + apr_time_t aprtime); /* see win32/fileio.h for description of these */ extern const char c_is_fnchar[256]; diff --git a/time/unix/time.c b/time/unix/time.c index ffc0c697cc4..a4176631f8a 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -267,6 +267,23 @@ APR_DECLARE(apr_status_t) apr_os2_time_to_apr_time(apr_time_t *result, *result = mktime(&tmpdate) * APR_USEC_PER_SEC; return APR_SUCCESS; } + +APR_DECLARE(apr_status_t) apr_apr_time_to_os2_time(FDATE *os2date, + FTIME *os2time, + apr_time_t aprtime) +{ + time_t ansitime = aprtime / APR_USEC_PER_SEC; + struct tm *lt; + lt = localtime(&ansitime); + os2time->hours = lt->tm_hour; + os2time->minutes = lt->tm_min; + os2time->twosecs = lt->tm_sec / 2; + + os2date->day = lt->tm_mday; + os2date->month = lt->tm_mon + 1; + os2date->year = lt->tm_year - 80; + return APR_SUCCESS; +} #endif #ifdef NETWARE From 82a5fe62d039e8f64565a530bcca9b8b52a19014 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 19 Jul 2005 09:38:36 +0000 Subject: [PATCH 5413/7878] These functions can return no-error, but still contain a NULL entry, on some crazy unix that some people use called Linux. PR: 34053 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@219635 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ user/unix/groupinfo.c | 2 +- user/unix/userinfo.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 66cc6e7f0fa..e0e5bb0e749 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.2.0 + *) If getpwuid_r or getgrgid_r set their results to NULL, it is an error. + PR 34053. [Paul Querna] + *) Switch to lazy initialization of the pollset that's used within apr_file_t on platforms where apr_wait_for_io_or_timeout() doesn't use poll(2). (This fixes a performance problem observed in httpd-2.x diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 91ef4df0dff..819af43ecbd 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -37,7 +37,7 @@ APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, struct group grp; char grbuf[512]; - if (getgrgid_r(groupid, &grp, grbuf, sizeof(grbuf), &gr)) { + if (getgrgid_r(groupid, &grp, grbuf, sizeof(grbuf), &gr) || gr == NULL) { #else if ((gr = getgrgid(groupid)) == NULL) { #endif diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index a15b22184ce..829a856be9c 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -115,7 +115,7 @@ APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, struct passwd pwd; char pwbuf[PWBUF_SIZE]; - if (getpwuid_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw)) { + if (getpwuid_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw) || pw == NULL) { #else if ((pw = getpwuid(userid)) == NULL) { #endif From a284ea891e4069a56005cf64ab6a921b2aa433ac Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 19 Jul 2005 12:26:24 +0000 Subject: [PATCH 5414/7878] As suggested by Joe on dev@apr, don't return errno, since its not correct according to the specs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@219667 13f79535-47bb-0310-9956-ffa450edef68 --- user/unix/userinfo.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 829a856be9c..e049f5e9bda 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -114,13 +114,22 @@ APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWUID_R) struct passwd pwd; char pwbuf[PWBUF_SIZE]; + apr_status_t rv; + + rv = getpwuid_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw); + if (rv) { + return rv; + } + + if (pw == NULL) { + return APR_ENOENT; + } - if (getpwuid_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw) || pw == NULL) { #else if ((pw = getpwuid(userid)) == NULL) { -#endif return errno; } +#endif *username = apr_pstrdup(p, pw->pw_name); return APR_SUCCESS; } From 73e16c6157de7d5c91d748b084bc2d45d1cd0dd0 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Wed, 20 Jul 2005 05:34:12 +0000 Subject: [PATCH 5415/7878] fixed a type mismatch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@219842 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index e8e94ff0b1f..589c8531405 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -51,7 +51,7 @@ apr_status_t apr_unix_file_cleanup(void *thefile) } #ifndef WAITIO_USES_POLL if (file->pollset != NULL) { - int pollset_rv = apr_pollset_destroy(file->pollset); + apr_status_t pollset_rv = apr_pollset_destroy(file->pollset); /* If the file close failed, return its error value, * not apr_pollset_destroy()'s. */ From c479a44cf77e34127844bcd0fe5c8ba55acca90f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 22 Jul 2005 21:48:35 +0000 Subject: [PATCH 5416/7878] Refactor Win32 condition variables code to address bugs. PR: 27654, 34336 Submitted by: Henry Jen and E Holyat Reviewed by: wrowe, stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@224407 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++ include/arch/win32/apr_arch_thread_cond.h | 1 - locks/win32/thread_cond.c | 83 ++++++----------------- 3 files changed, 24 insertions(+), 65 deletions(-) diff --git a/CHANGES b/CHANGES index e0e5bb0e749..2a7d0f6d118 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Changes for APR 1.2.1 + + *) Refactor Win32 condition variables code to address bugs 27654, 34336. + [Henry Jen , E Holyat ] + Changes for APR 1.2.0 *) If getpwuid_r or getgrgid_r set their results to NULL, it is an error. diff --git a/include/arch/win32/apr_arch_thread_cond.h b/include/arch/win32/apr_arch_thread_cond.h index 5520ef26b09..01252328a23 100644 --- a/include/arch/win32/apr_arch_thread_cond.h +++ b/include/arch/win32/apr_arch_thread_cond.h @@ -22,7 +22,6 @@ struct apr_thread_cond_t { apr_pool_t *pool; HANDLE event; - HANDLE mutex; int signal_all; int num_waiting; int signalled; diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index dca1e8fb651..483f3300e62 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -25,7 +25,6 @@ static apr_status_t thread_cond_cleanup(void *data) { apr_thread_cond_t *cond = data; - CloseHandle(cond->mutex); CloseHandle(cond->event); return APR_SUCCESS; } @@ -36,95 +35,61 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, *cond = apr_palloc(pool, sizeof(**cond)); (*cond)->pool = pool; (*cond)->event = CreateEvent(NULL, TRUE, FALSE, NULL); - (*cond)->mutex = CreateMutex(NULL, FALSE, NULL); (*cond)->signal_all = 0; (*cond)->num_waiting = 0; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex) +static APR_INLINE apr_status_t _thread_cond_timedwait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex, + DWORD timeout_ms ) { DWORD res; while (1) { - res = WaitForSingleObject(cond->mutex, INFINITE); - if (res != WAIT_OBJECT_0) { - return apr_get_os_error(); - } cond->num_waiting++; - ReleaseMutex(cond->mutex); apr_thread_mutex_unlock(mutex); - res = WaitForSingleObject(cond->event, INFINITE); + res = WaitForSingleObject(cond->event, timeout_ms); + apr_thread_mutex_lock(mutex); cond->num_waiting--; if (res != WAIT_OBJECT_0) { apr_status_t rv = apr_get_os_error(); - ReleaseMutex(cond->mutex); - return rv; + if (res == WAIT_TIMEOUT) { + return APR_TIMEUP; + } + return apr_get_os_error(); } if (cond->signal_all) { if (cond->num_waiting == 0) { + cond->signal_all = 0; + cond->signalled = 0; ResetEvent(cond->event); } break; } - if (cond->signalled) { + else if (cond->signalled) { cond->signalled = 0; ResetEvent(cond->event); break; } - ReleaseMutex(cond->mutex); } - apr_thread_mutex_lock(mutex); return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex) +{ + return _thread_cond_timedwait(cond, mutex, INFINITE); +} + APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, apr_interval_time_t timeout) { - DWORD res; DWORD timeout_ms = (DWORD) apr_time_as_msec(timeout); - while (1) { - res = WaitForSingleObject(cond->mutex, timeout_ms); - if (res != WAIT_OBJECT_0) { - if (res == WAIT_TIMEOUT) { - return APR_TIMEUP; - } - return apr_get_os_error(); - } - cond->num_waiting++; - ReleaseMutex(cond->mutex); - - apr_thread_mutex_unlock(mutex); - res = WaitForSingleObject(cond->event, timeout_ms); - cond->num_waiting--; - if (res != WAIT_OBJECT_0) { - apr_status_t rv = apr_get_os_error(); - ReleaseMutex(cond->mutex); - apr_thread_mutex_lock(mutex); - if (res == WAIT_TIMEOUT) { - return APR_TIMEUP; - } - return apr_get_os_error(); - } - if (cond->signal_all) { - if (cond->num_waiting == 0) { - ResetEvent(cond->event); - } - break; - } - if (cond->signalled) { - cond->signalled = 0; - ResetEvent(cond->event); - break; - } - ReleaseMutex(cond->mutex); - } - apr_thread_mutex_lock(mutex); - return APR_SUCCESS; + return _thread_cond_timedwait(cond, mutex, timeout_ms); } APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) @@ -132,16 +97,11 @@ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) apr_status_t rv = APR_SUCCESS; DWORD res; - res = WaitForSingleObject(cond->mutex, INFINITE); - if (res != WAIT_OBJECT_0) { - return apr_get_os_error(); - } cond->signalled = 1; res = SetEvent(cond->event); if (res == 0) { rv = apr_get_os_error(); } - ReleaseMutex(cond->mutex); return rv; } @@ -150,17 +110,12 @@ APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) apr_status_t rv = APR_SUCCESS; DWORD res; - res = WaitForSingleObject(cond->mutex, INFINITE); - if (res != WAIT_OBJECT_0) { - return apr_get_os_error(); - } cond->signalled = 1; cond->signal_all = 1; res = SetEvent(cond->event); if (res == 0) { rv = apr_get_os_error(); } - ReleaseMutex(cond->mutex); return rv; } From 4b84c746328a0f4bd88cd6d2d991a35f648ae1fe Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 23 Jul 2005 04:48:49 +0000 Subject: [PATCH 5417/7878] document the multithreaded semantics more explicitly, so that application code can rely on them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@224442 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/apr_poll.h b/include/apr_poll.h index c9c59730412..07d450b6fc9 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -123,6 +123,15 @@ APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset); * @remark If you set client_data in the descriptor, that value * will be returned in the client_data field whenever this * descriptor is signalled in apr_pollset_poll(). + * @remark If the pollset has been created with APR_POLLSET_THREADSAFE + * and thread T1 is blocked in a call to apr_pollset_poll() for + * this same pollset that is being modified via apr_pollset_add() + * in thread T2, the currently executing apr_pollset_poll() call in + * T1 will either: (1) automatically include the newly added descriptor + * in the set of descriptors it is watching or (2) return immediately + * with APR_EINTR. Option (1) is recommended, but option (2) is + * allowed for implementations where option (1) is impossible + * or impractical. */ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor); @@ -131,6 +140,15 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, * Remove a descriptor from a pollset * @param pollset The pollset from which to remove the descriptor * @param descriptor The descriptor to remove + * @remark If the pollset has been created with APR_POLLSET_THREADSAFE + * and thread T1 is blocked in a call to apr_pollset_poll() for + * this same pollset that is being modified via apr_pollset_remove() + * in thread T2, the currently executing apr_pollset_poll() call in + * T1 will either: (1) automatically exclude the newly added descriptor + * in the set of descriptors it is watching or (2) return immediately + * with APR_EINTR. Option (1) is recommended, but option (2) is + * allowed for implementations where option (1) is impossible + * or impractical. */ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, const apr_pollfd_t *descriptor); From bdf496781bfb994cf7d18edd778fd1ddf22a46b9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 5 Aug 2005 08:49:30 +0000 Subject: [PATCH 5418/7878] * build/apr_common.m4 (APR_TRY_COMPILE_NO_WARNING): Rewrite to use AC_COMPILE_IFELSE; fix quoting to avoid always triggering a warning in the main() definition. PR: 36032 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@230416 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 53 ++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 8298022abb6..29a90abbf6b 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -471,40 +471,29 @@ undefine([AC_CV_NAME])dnl dnl dnl APR_TRY_COMPILE_NO_WARNING(INCLUDES, FUNCTION-BODY, -dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl [ACTIONS-IF-NO-WARNINGS], [ACTIONS-IF-WARNINGS]) dnl dnl Tries a compile test with warnings activated so that the result -dnl is false if the code doesn't compile cleanly. -dnl -AC_DEFUN(APR_TRY_COMPILE_NO_WARNING, -[if test "x$CFLAGS_WARN" = "x"; then - apr_tcnw_flags="" -else - apr_tcnw_flags=$CFLAGS_WARN -fi -if test "$ac_cv_prog_gcc" = "yes"; then - apr_tcnw_flags="$apr_tcnw_flags -Werror" -fi -changequote(', ') -cat > conftest.$ac_ext <&AC_FD_CC ; then - ifelse([$3], , :, [rm -rf conftest* - $3]) -else - echo "configure: failed or warning program:" >&AC_FD_CC - cat conftest.$ac_ext >&AC_FD_CC - ifelse([$4], , , [rm -rf conftest* - $4]) -fi -rm -f conftest* -])dnl +dnl is false if the code doesn't compile cleanly. For compilers +dnl where it is not known how to activate a "fail-on-error" mode, +dnl it is undefined which of the sets of actions will be run. +dnl +AC_DEFUN([APR_TRY_COMPILE_NO_WARNING], +[apr_save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $CFLAGS_WARN" + if test "$ac_cv_prog_gcc" = "yes"; then + CFLAGS="$CFLAGS -Werror" + fi + AC_COMPILE_IFELSE( + [#include "confdefs.h" + ] + [[$1]] + [int main(int argc, const char *const *argv) {] + [[$2]] + [ return 0; }], + [$3], [$4]) + CFLAGS=$apr_save_CFLAGS +]) dnl dnl APR_CHECK_STRERROR_R_RC From 401969710946ce4ae503d5880619e8f9ec55bf4f Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 14 Aug 2005 03:11:46 +0000 Subject: [PATCH 5419/7878] Disable KQueue on OSX/Darwin. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@232572 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 48c035b7dd1..70a160a830c 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -190,6 +190,8 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp]) APR_SETIFNULL(apr_posixsem_is_global, [yes]) APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332 + # Broken in 10.4.x + APR_SETIFNULL(ac_cv_func_kqueue, [no]) ;; *-dec-osf*) APR_ADDTO(CPPFLAGS, [-DOSF1]) From 42c525506156ef4507ddfce02db9e41832578916 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Thu, 18 Aug 2005 05:00:15 +0000 Subject: [PATCH 5420/7878] Update STATUS with new releases. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@233285 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/STATUS b/STATUS index 41728c5ebec..17786db0652 100644 --- a/STATUS +++ b/STATUS @@ -4,6 +4,8 @@ Last modified at [$Date$] Releases: Standalone + 1.2.1 : released August 17, 2005 + 1.2.0 : tagged July 19, 2005 1.1.1 : released March 17, 2005 1.1.0 : released January 25, 2005 1.0.1 : released November 18, 2004 From c137b45f5f68d836ba50025885246aa47e263372 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Thu, 18 Aug 2005 05:20:41 +0000 Subject: [PATCH 5421/7878] Add two helper macros for working with variable length arrays. * include/apr_tables.h (APR_ARRAY_IDX, APR_ARRAY_PUSH): new macros. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@233287 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/apr_tables.h b/include/apr_tables.h index c30fdcb0539..4636daf731d 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -120,6 +120,25 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, */ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr); +/** A helper macro for accessing a member of an APR array. + * + * @param ary the array + * @param i the index into the array to return + * @param type the type of the objects stored in the array + * + * @return the item at index i + */ +#define APR_ARRAY_IDX(ary,i,type) (((type *)(ary)->elts)[i]) + +/** A helper macro for pushing elements into an APR array. + * + * @param ary the array + * @param type the type of the objects stored in the array + * + * @return the location where the new object should be placed + */ +#define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary))) + /** * Remove an element from an array (as a first-in, last-out stack) * @param arr The array to remove an element from. From 9e41fc940e9c8da04ca681cd886c0d5481183bae Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 18 Aug 2005 20:49:38 +0000 Subject: [PATCH 5422/7878] * file_io/unix/fullrw.c (apr_file_writev_full): Fix signed-vs-unsigned comparison. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@233376 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fullrw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index 78b8d55b157..c22b0c5597b 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -68,7 +68,7 @@ APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile, apr_size_t *bytes_written) { apr_status_t rv = APR_SUCCESS; - int i; + apr_size_t i; apr_size_t amt = 0; apr_size_t total = 0; From 4c8b935e15076a4ac94c94bc5070309962cbb927 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 18 Aug 2005 21:10:41 +0000 Subject: [PATCH 5423/7878] * poll/unix/epoll.c (apr_pollset_create): Check for errors from epoll_create(). Don't leak the epoll fd to spawned children; do register the cleanup as a child_cleanup too. Remove a cast to void *. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@233379 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 30b30dcd8e0..5d683cbd812 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -91,6 +91,13 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t flags) { apr_status_t rv; + int fd; + + fd = epoll_create(size); + if (fd < 0) { + *pollset = NULL; + return errno; + } *pollset = apr_palloc(p, sizeof(**pollset)); #if APR_HAS_THREADS @@ -111,10 +118,9 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, (*pollset)->nalloc = size; (*pollset)->flags = flags; (*pollset)->pool = p; - (*pollset)->epoll_fd = epoll_create(size); + (*pollset)->epoll_fd = fd; (*pollset)->pollset = apr_palloc(p, size * sizeof(struct epoll_event)); - apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup, - apr_pool_cleanup_null); + apr_pool_cleanup_register(p, *pollset, backend_cleanup, backend_cleanup); (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); APR_RING_INIT(&(*pollset)->query_ring, pfd_elem_t, link); From 7cbdd968ca94fcd9fa611f3350a1f8a0960397ec Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 18 Aug 2005 21:17:45 +0000 Subject: [PATCH 5424/7878] * strings/apr_snprintf.c (apr_vformatter): Add support for %pm to print the error string corresponding to an apr_status_t. * test/testfmt.c (error_fmt): New test. * include/apr_lib.h: Document %pm and note the versioning constraint. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@233381 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++++++ include/apr_lib.h | 5 +++++ strings/apr_snprintf.c | 19 +++++++++++++++++++ test/testfmt.c | 19 +++++++++++++++++++ 4 files changed, 51 insertions(+) diff --git a/CHANGES b/CHANGES index 2a7d0f6d118..c34f44fd6d1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,11 @@ +Changes for APR 1.3.0 + + *) Add %pm support to apr_snprintf() for printing the error string + corresponding to an apr_status_t value. [Joe Orton] + + *) Add APR_ARRAY_IDX() and APR_ARRAY_PUSH() convenience macros to + apr_tables.h. [Garrett Rooney] + Changes for APR 1.2.1 *) Refactor Win32 condition variables code to address bugs 27654, 34336. diff --git a/include/apr_lib.h b/include/apr_lib.h index 738df7a2787..802359419f1 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -118,8 +118,13 @@ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); * ('0' is printed if !APR_HAS_THREADS) * %%pt takes an apr_os_thread_t * and prints it in hexadecimal * ('0' is printed if !APR_HAS_THREADS) + * %%pm takes an apr_status_t * and prints the appropriate error + * string (from apr_strerror) corresponding to that error code. * %%pp takes a void * and outputs it in hex * + * %%pt is only available from APR 1.2.0 onwards. + * %%pm is only available from APR 1.3.0 onwards. + * * The %%p hacks are to force gcc's printf warning code to skip * over a pointer argument without complaining. This does * mean that the ANSI-style %%p (output a void * in hex format) won't diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 313a778cf92..e903d2d3130 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -21,6 +21,7 @@ #include "apr_strings.h" #include "apr_network_io.h" #include "apr_portable.h" +#include "apr_errno.h" #include #if APR_HAVE_CTYPE_H #include @@ -1166,6 +1167,24 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), } break; + /* print the error for an apr_status_t */ + case 'm': + { + apr_status_t *mrv; + + mrv = va_arg(ap, apr_status_t *); + if (mrv != NULL) { + s = apr_strerror(*mrv, num_buf, NUM_BUF_SIZE-1); + s_len = strlen(s); + } + else { + s = S_NULL; + s_len = S_NULL_LEN; + } + pad_char = ' '; + } + break; + case 'T': #if APR_HAS_THREADS { diff --git a/test/testfmt.c b/test/testfmt.c index 6cc2c3db409..f4548be363b 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -117,6 +117,24 @@ static void more_int64_fmts(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, buf, "-314159265358979323"); } +static void error_fmt(abts_case *tc, void *data) +{ + char ebuf[150], sbuf[150], *s; + apr_status_t rv; + + rv = APR_SUCCESS; + apr_strerror(rv, ebuf, sizeof ebuf); + apr_snprintf(sbuf, sizeof sbuf, "%pm", &rv); + ABTS_STR_EQUAL(tc, sbuf, ebuf); + + rv = APR_ENOTIMPL; + s = apr_pstrcat(p, "foo-", + apr_strerror(rv, ebuf, sizeof ebuf), + "-bar", NULL); + apr_snprintf(sbuf, sizeof sbuf, "foo-%pm-bar", &rv); + ABTS_STR_EQUAL(tc, sbuf, s); +} + abts_suite *testfmt(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -129,6 +147,7 @@ abts_suite *testfmt(abts_suite *suite) abts_run_test(suite, uint64_t_fmt, NULL); abts_run_test(suite, uint64_t_hex_fmt, NULL); abts_run_test(suite, more_int64_fmts, NULL); + abts_run_test(suite, error_fmt, NULL); return suite; } From d8d4422ad34ec9ec3325beac6374a9befc45cf5e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 20 Aug 2005 09:11:33 +0000 Subject: [PATCH 5425/7878] * file_io/unix/readwrite.c (apr_file_write): Catch apr_file_flush() failure for buffered files. * test/testfile.c (test_fail_write_flush): Add test case. Submitted by: Erik Huelsmann git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@234013 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/unix/readwrite.c | 2 +- test/testfile.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c34f44fd6d1..c1ea54de364 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Fix apr_file_write() infinite loop on write failure for buffered + files. [Erik Huelsmann ] + *) Add %pm support to apr_snprintf() for printing the error string corresponding to an apr_status_t value. [Joe Orton] diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index f2514bf3bdb..697cfa852cd 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -170,7 +170,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) /* write buffer is full*/ - apr_file_flush(thefile); + rv = apr_file_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; diff --git a/test/testfile.c b/test/testfile.c index 508ebaf9fa7..47f61d521b4 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -703,6 +703,37 @@ static void test_bigfprintf(abts_case *tc, void *data) free(to_write); } +static void test_fail_write_flush(abts_case *tc, void *data) +{ + apr_file_t *f; + const char *fname = "data/testflush.dat"; + apr_status_t rv; + char buf[APR_BUFFERSIZE]; + int n; + + apr_file_remove(fname, p); + + APR_ASSERT_SUCCESS(tc, "open test file", + apr_file_open(&f, fname, + APR_CREATE|APR_READ|APR_BUFFERED, + APR_UREAD|APR_UWRITE, p)); + + memset(buf, 'A', sizeof buf); + + /* Try three writes. One of these should fail when it exceeds the + * internal buffer and actually tries to write to the file, which + * was opened read-only and hence should be unwritable. */ + for (n = 0, rv = APR_SUCCESS; n < 4 && rv == APR_SUCCESS; n++) { + apr_size_t bytes = sizeof buf; + rv = apr_file_write(f, buf, &bytes); + } + + ABTS_ASSERT(tc, "failed to write to read-only buffered fd", + rv != APR_SUCCESS); + + apr_file_close(f); +} + abts_suite *testfile(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -733,6 +764,7 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_mod_neg, NULL); abts_run_test(suite, test_truncate, NULL); abts_run_test(suite, test_bigfprintf, NULL); + abts_run_test(suite, test_fail_write_flush, NULL); return suite; } From 72982c8534cd752b6fa4eb93c09890e04fdb1fed Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 20 Aug 2005 09:32:35 +0000 Subject: [PATCH 5426/7878] * file_io/unix/readwrite.c (apr_file_flush): Use apr_ssize_t to store the write() return value, remove casts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@234014 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 697cfa852cd..258ef726510 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -289,13 +289,13 @@ APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile) APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) { if (thefile->buffered) { - apr_int64_t written = 0; - if (thefile->direction == 1 && thefile->bufpos) { + apr_ssize_t written; + do { written = write(thefile->filedes, thefile->buffer, thefile->bufpos); - } while (written == (apr_int64_t)-1 && errno == EINTR); - if (written == (apr_int64_t)-1) { + } while (written == -1 && errno == EINTR); + if (written == -1) { return errno; } thefile->filePtr += written; From 6b84807541e1cc3050e6efcaa5f431ba29a41e81 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 20 Aug 2005 09:36:32 +0000 Subject: [PATCH 5427/7878] Remove the @ from Erik's address and ignore new test file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@234015 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c1ea54de364..87a2478e26b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,7 @@ Changes for APR 1.3.0 *) Fix apr_file_write() infinite loop on write failure for buffered - files. [Erik Huelsmann ] + files. [Erik Huelsmann ] *) Add %pm support to apr_snprintf() for printing the error string corresponding to an apr_status_t value. [Joe Orton] From 1e3b028156ca3bd18c9daea6632299559465cf67 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 21 Aug 2005 20:46:29 +0000 Subject: [PATCH 5428/7878] * test/Makefile.in: Clean more. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@234338 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 14b9a37f873..dbbe0fbc1f7 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -31,8 +31,7 @@ LOCAL_LIBS=../lib@APR_LIBNAME@.la CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \ readchild@EXEEXT@ tryread@EXEEXT@ sockchild@EXEEXT@ \ globalmutexchild@EXEEXT@ lfstests/large.bin \ - data/testputs.txt data/testbigfprintf.dat data/testwritev.txt \ - data/testwritev_full.txt + data/test*.txt data/test*.dat CLEAN_SUBDIRS = internal INCDIR=../include From 1d082c66631e2bc39ba6ff7a34deec50d4bddfe7 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 22 Aug 2005 19:12:59 +0000 Subject: [PATCH 5429/7878] * file_io/unix/readwrite.c (apr_file_read, apr_file_gets): Handle the apr_file_flush() return value when flushing buffered writes. * test/testfile.c (test_fail_read_flush): Add test case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@239221 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/unix/readwrite.c | 21 +++++++++++++++++++-- test/testfile.c | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 87a2478e26b..c173632fa77 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Fix apr_file_gets() and apr_file_read() to catch write failures + when flushing pending writes for a buffered file. [Joe Orton] + *) Fix apr_file_write() infinite loop on write failure for buffered files. [Erik Huelsmann ] diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 258ef726510..d5c66d15edb 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -47,7 +47,15 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size #endif if (thefile->direction == 1) { - apr_file_flush(thefile); + rv = apr_file_flush(thefile); + if (rv) { +#if APR_HAS_THREADS + if (thefile->thlock) { + apr_thread_mutex_unlock(thefile->thlock); + } +#endif + return rv; + } thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -333,7 +341,16 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) #endif if (thefile->direction == 1) { - apr_file_flush(thefile); + rv = apr_file_flush(thefile); + if (rv) { +#if APR_HAS_THREADS + if (thefile->thlock) { + apr_thread_mutex_unlock(thefile->thlock); + } +#endif + return rv; + } + thefile->direction = 0; thefile->bufpos = 0; thefile->dataRead = 0; diff --git a/test/testfile.c b/test/testfile.c index 47f61d521b4..9da6a671030 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -734,6 +734,42 @@ static void test_fail_write_flush(abts_case *tc, void *data) apr_file_close(f); } +static void test_fail_read_flush(abts_case *tc, void *data) +{ + apr_file_t *f; + const char *fname = "data/testflush.dat"; + apr_status_t rv; + char buf[2]; + + apr_file_remove(fname, p); + + APR_ASSERT_SUCCESS(tc, "open test file", + apr_file_open(&f, fname, + APR_CREATE|APR_READ|APR_BUFFERED, + APR_UREAD|APR_UWRITE, p)); + + /* this write should be buffered. */ + APR_ASSERT_SUCCESS(tc, "buffered write should succeed", + apr_file_puts("hello", f)); + + /* Now, trying a read should fail since the write must be flushed, + * and should fail with something other than EOF since the file is + * opened read-only. */ + rv = apr_file_read_full(f, buf, 2, NULL); + + ABTS_ASSERT(tc, "read should flush buffered write and fail", + rv != APR_SUCCESS && rv != APR_EOF); + + /* Likewise for gets */ + rv = apr_file_gets(buf, 2, f); + + ABTS_ASSERT(tc, "gets should flush buffered write and fail", + rv != APR_SUCCESS && rv != APR_EOF); + + apr_file_close(f); +} + + abts_suite *testfile(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -765,6 +801,7 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_truncate, NULL); abts_run_test(suite, test_bigfprintf, NULL); abts_run_test(suite, test_fail_write_flush, NULL); + abts_run_test(suite, test_fail_read_flush, NULL); return suite; } From 5953ae35315aa04d5db01cdfe2d9a5664f167b46 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 23 Aug 2005 01:36:26 +0000 Subject: [PATCH 5430/7878] APR_STATUS_IS_ENOENT(): check for EMVSCATLG on z/OS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@239284 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 2046f3e2b27..77b383a8c03 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -1132,8 +1132,18 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) /** path name is too long */ #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG) -/** no such file or directory */ +/** + * no such file or directory + * @remark + * EMVSCATLG can be returned by the automounter on z/OS for + * paths which do not exist. + */ +#ifdef EMVSCATLG +#define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ + || (s) == EMVSCATLG) +#else #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT) +#endif /** not a directory */ #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) /** no space left on device */ From 080f8d260ae40a50fe1c463a84f59152d6b05220 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 23 Aug 2005 11:17:36 +0000 Subject: [PATCH 5431/7878] Bring all get{pw,gr}*_r error handling in line with POSIX: * user/unix/userinfo.c (getpwnam_safe): Fix error handling; always use the getpwnam_r return value as the error code, and ignore errno, since POSIX does not require that getpwnam_r sets errno. * user/unix/groupinfo.c (apr_gid_name_get, apr_gid_get): Fix error handling as above; and check for the NULL -> "no entry" cases here too. * test/testuser.c (fail_userinfo): Add test cases for error handling (only one of them actually trips on the bugs in the old code with glibc). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@239390 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ test/testuser.c | 46 +++++++++++++++++++++++++++++++++++++++++++ user/unix/groupinfo.c | 24 ++++++++++++++++++---- user/unix/userinfo.c | 19 ++++++++++++++---- 4 files changed, 84 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index c173632fa77..8098a288945 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Fix error handling where apr_uid_* and apr_gid_* could return + APR_SUCCESS in failure cases. [Joe Orton] + *) Fix apr_file_gets() and apr_file_read() to catch write failures when flushing pending writes for a buffered file. [Joe Orton] diff --git a/test/testuser.c b/test/testuser.c index a2ccb887ee7..861c44fc897 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -93,6 +93,51 @@ static void groupname(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "apr_gid_compare failed", apr_gid_compare(gid, retreived_gid)); } + +static void fail_userinfo(abts_case *tc, void *data) +{ + apr_uid_t uid; + apr_gid_t gid; + apr_status_t rv; + char *tmp; + + errno = 0; + gid = uid = 9999999; + tmp = NULL; + rv = apr_uid_name_get(&tmp, uid, p); + ABTS_ASSERT(tc, "apr_uid_name_get should fail or " + "return a user name", + rv != APR_SUCCESS || tmp != NULL); + + errno = 0; + tmp = NULL; + rv = apr_gid_name_get(&tmp, gid, p); + ABTS_ASSERT(tc, "apr_gid_name_get should fail or " + "return a group name", + rv != APR_SUCCESS || tmp != NULL); + + gid = 424242; + errno = 0; + rv = apr_gid_get(&gid, "I_AM_NOT_A_GROUP", p); + ABTS_ASSERT(tc, "apr_gid_get should fail or " + "set a group number", + rv != APR_SUCCESS || gid == 424242); + + gid = uid = 424242; + errno = 0; + rv = apr_uid_get(&uid, &gid, "I_AM_NOT_A_USER", p); + ABTS_ASSERT(tc, "apr_gid_get should fail or " + "set a user and group number", + rv != APR_SUCCESS || uid == 424242 || gid == 4242442); + + errno = 0; + tmp = NULL; + rv = apr_uid_homepath_get(&tmp, "I_AM_NOT_A_USER", p); + ABTS_ASSERT(tc, "apr_uid_homepath_get should fail or " + "set a path name", + rv != APR_SUCCESS || tmp != NULL); +} + #else static void users_not_impl(abts_case *tc, void *data) { @@ -110,6 +155,7 @@ abts_suite *testuser(abts_suite *suite) abts_run_test(suite, uid_current, NULL); abts_run_test(suite, username, NULL); abts_run_test(suite, groupname, NULL); + abts_run_test(suite, fail_userinfo, NULL); #endif return suite; diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 819af43ecbd..9f556b20f66 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -36,13 +36,21 @@ APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) struct group grp; char grbuf[512]; + apr_status_t rv; - if (getgrgid_r(groupid, &grp, grbuf, sizeof(grbuf), &gr) || gr == NULL) { + /* See comment in getpwnam_safe on error handling. */ + rv = getgrgid_r(groupid, &grp, grbuf, sizeof(grbuf), &gr); + if (rv) { + return rv; + } + if (gr == NULL) { + return APR_ENOENT; + } #else if ((gr = getgrgid(groupid)) == NULL) { -#endif return errno; } +#endif *groupname = apr_pstrdup(p, gr->gr_name); return APR_SUCCESS; } @@ -55,13 +63,21 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRNAM_R) struct group grp; char grbuf[512]; + apr_status_t rv; - if (getgrnam_r(groupname, &grp, grbuf, sizeof(grbuf), &gr)) { + /* See comment in getpwnam_safe on error handling. */ + rv = getgrnam_r(groupname, &grp, grbuf, sizeof(grbuf), &gr); + if (rv) { + return rv; + } + if (gr == NULL) { + return APR_ENOENT; + } #else if ((gr = getgrnam(groupname)) == NULL) { -#endif return errno; } +#endif *groupid = gr->gr_gid; return APR_SUCCESS; } diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index e049f5e9bda..c2a7a1f95dd 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -38,13 +38,23 @@ static apr_status_t getpwnam_safe(const char *username, { struct passwd *pwptr; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) - /* IRIX getpwnam_r() returns 0 and sets pwptr to NULL on failure */ - if (!getpwnam_r(username, pw, pwbuf, PWBUF_SIZE, &pwptr) && pwptr) { - /* nothing extra to do on success */ + apr_status_t rv; + + /* POSIX defines getpwnam_r() et al to return the error number + * rather than set errno, and requires pwptr to be set to NULL if + * the entry is not found, imply that "not found" is not an error + * condition; some implementations do return 0 with pwptr set to + * NULL. */ + rv = getpwnam_r(username, pw, pwbuf, PWBUF_SIZE, &pwptr); + if (rv) { + return rv; + } + if (pwptr == NULL) { + return APR_ENOENT; + } #else if ((pwptr = getpwnam(username)) != NULL) { memcpy(pw, pwptr, sizeof *pw); -#endif } else { if (errno == 0) { @@ -53,6 +63,7 @@ static apr_status_t getpwnam_safe(const char *username, } return errno; } +#endif return APR_SUCCESS; } From b82fb9862e66f0c2655dba9cb0b1b3b68eed0556 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 24 Aug 2005 08:56:03 +0000 Subject: [PATCH 5432/7878] * user/unix/userinfo.c (getpwnam_safe, apr_uid_name_get): Fix error handling for platforms which do not set errno on non-threadsafe get{pw,gr}* failures; always return APR_ENOENT for that case. * user/unix/groupinfo.c (apr_gid_name_get, apr_gid_get): Likewise. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@239574 13f79535-47bb-0310-9956-ffa450edef68 --- user/unix/groupinfo.c | 6 ++++-- user/unix/userinfo.c | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 9f556b20f66..8bf97691cda 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -47,8 +47,9 @@ APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, return APR_ENOENT; } #else + errno = 0; if ((gr = getgrgid(groupid)) == NULL) { - return errno; + return errno ? errno : APR_ENOENT; } #endif *groupname = apr_pstrdup(p, gr->gr_name); @@ -74,8 +75,9 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, return APR_ENOENT; } #else + errno = 0; if ((gr = getgrnam(groupname)) == NULL) { - return errno; + return errno ? errno : APR_ENOENT; } #endif *groupid = gr->gr_gid; diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index c2a7a1f95dd..3eb74113be3 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -53,15 +53,14 @@ static apr_status_t getpwnam_safe(const char *username, return APR_ENOENT; } #else + /* Some platforms (e.g. FreeBSD 4.x) do not set errno on NULL "not + * found" return values for the non-threadsafe function either. */ + errno = 0; if ((pwptr = getpwnam(username)) != NULL) { memcpy(pw, pwptr, sizeof *pw); } else { - if (errno == 0) { - /* this can happen with getpwnam() on FreeBSD 4.3 */ - return APR_EGENERAL; - } - return errno; + return errno ? errno : APR_ENOENT; } #endif return APR_SUCCESS; @@ -137,8 +136,9 @@ APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, } #else + errno = 0; if ((pw = getpwuid(userid)) == NULL) { - return errno; + return errno ? errno : APR_ENOENT; } #endif *username = apr_pstrdup(p, pw->pw_name); From 2a93134fa010176a96aeb8157167591d9830d31c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 24 Aug 2005 12:40:33 +0000 Subject: [PATCH 5433/7878] * configure.in: Check for libefence after threads in case libefence depends on libpthread. PR: 34806 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@239640 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/configure.in b/configure.in index 0da0554dd4c..9115013a062 100644 --- a/configure.in +++ b/configure.in @@ -319,23 +319,6 @@ AC_ARG_ENABLE(pool-debug, fi ]) -dnl Electric Fence malloc checker. -dnl --with-efence specifies the path to Electric Fence -AC_ARG_WITH(efence, - [ --with-efence[[=DIR]] path to Electric Fence installation], - [ apr_efence_dir="$withval" - if test "$apr_efence_dir" != "yes"; then - APR_ADDTO(LDFLAGS,[-L$apr_efence_dir/lib]) - if test "x$apr_platform_runtime_link_flag" != "x"; then - APR_ADDTO(LDFLAGS, - [$apr_platform_runtime_link_flag$apr_efence_dir/lib]) - fi - fi - AC_CHECK_LIB(efence, malloc, - [ APR_ADDTO(LIBS,-lefence) ], - [ AC_MSG_ERROR(Electric Fence requested but not detected) ]) - ]) - if test "$host" = "i586-pc-beos"; then AC_ARG_ENABLE(malloc-debug,[ --enable-malloc-debug Switch on malloc_debug for BeOS], APR_REMOVEFROM(CFLAGS, -O2) @@ -643,6 +626,25 @@ else echo "APR will be non-threaded" fi +dnl Electric Fence malloc checker. +dnl --with-efence specifies the path to Electric Fence. +dnl This test should remain after the threads checks since libefence +dnl may depend on libpthread. +AC_ARG_WITH(efence, + [ --with-efence[[=DIR]] path to Electric Fence installation], + [ apr_efence_dir="$withval" + if test "$apr_efence_dir" != "yes"; then + APR_ADDTO(LDFLAGS,[-L$apr_efence_dir/lib]) + if test "x$apr_platform_runtime_link_flag" != "x"; then + APR_ADDTO(LDFLAGS, + [$apr_platform_runtime_link_flag$apr_efence_dir/lib]) + fi + fi + AC_CHECK_LIB(efence, malloc, + [ APR_ADDTO(LIBS,-lefence) ], + [ AC_MSG_ERROR(Electric Fence requested but not detected) ]) + ]) + AC_CHECK_FUNCS(sigsuspend, [ have_sigsuspend="1" ], [ have_sigsuspend="0" ]) AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ]) dnl AC_CHECK_FUNCS doesn't work for this on Tru64 since the function From 331279b771c3a9587c7d8e353428726acfaf356f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 24 Aug 2005 14:13:29 +0000 Subject: [PATCH 5434/7878] * memory/unix/apr_pools.c (apr_pool_cleanup_kill) [APR_POOL_DEBUG]: Add some cheap loop detection to abort if the cleanup list is corrupt. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@239666 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 335516fd561..291abc3d66e 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1974,6 +1974,15 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, c = p->cleanups; lastp = &p->cleanups; while (c) { +#if APR_POOL_DEBUG + /* Some cheap loop detection to catch a corrupt list: */ + if (c == c->next + || (c->next && c == c->next->next) + || (c->next && c->next->next && c == c->next->next->next)) { + abort(); + } +#endif + if (c->data == data && c->plain_cleanup_fn == cleanup_fn) { *lastp = c->next; /* move to freelist */ From 8aa4a30a7ae0c7b6092122a85a34cc63de91b9b5 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 24 Aug 2005 15:14:39 +0000 Subject: [PATCH 5435/7878] * threadproc/unix/proc.c (apr_proc_create): Use _exit() not exit() to prevent atexit-registered functions from being run in a failing child, and e.g. flushing stdio buffers. PR: 30913 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@239687 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ threadproc/unix/proc.c | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 8098a288945..8b346cba5ba 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes for APR 1.3.0 + *) If apr_proc_create() fails to exec in the fork()ed child, call + _exit() not exit() to avoid running atexit()-registered functions + in the child. PR 30913. [Joe Orton] + *) Fix error handling where apr_uid_* and apr_gid_* could return APR_SUCCESS in failure cases. [Joe Orton] diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index ce32b09bf78..5631e4c64a6 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -419,7 +419,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->errfn) { attr->errfn(pool, errno, "change of working directory failed"); } - exit(-1); /* We have big problems, the child should exit. */ + _exit(-1); /* We have big problems, the child should exit. */ } } @@ -429,7 +429,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->errfn) { attr->errfn(pool, errno, "setting of group failed"); } - exit(-1); /* We have big problems, the child should exit. */ + _exit(-1); /* We have big problems, the child should exit. */ } } @@ -438,7 +438,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->errfn) { attr->errfn(pool, errno, "setting of user failed"); } - exit(-1); /* We have big problems, the child should exit. */ + _exit(-1); /* We have big problems, the child should exit. */ } } @@ -446,7 +446,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->errfn) { attr->errfn(pool, errno, "setting of resource limits failed"); } - exit(-1); /* We have big problems, the child should exit. */ + _exit(-1); /* We have big problems, the child should exit. */ } if (attr->cmdtype == APR_SHELLCMD || @@ -538,8 +538,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, attr->errfn(pool, errno, desc); } - exit(-1); /* if we get here, there is a problem, so exit with an - * error code. */ + _exit(-1); /* if we get here, there is a problem, so exit with an + * error code. */ } /* Parent process */ From a8aa89aa2ce88a2ffa56bab77a0735e4239f29d9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 24 Aug 2005 15:28:40 +0000 Subject: [PATCH 5436/7878] * build/apr_hints.m4 (APR_PRELOAD): Don't explicitly add -lcrypt to LIBS on CygWin since configure will check for it anyway. PR: 17232 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@239691 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 1 - 1 file changed, 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 70a160a830c..6a5a222e1b7 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -415,7 +415,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *cygwin*) APR_ADDTO(CPPFLAGS, [-DCYGWIN]) - APR_ADDTO(LIBS, [-lcrypt]) ;; esac From 8180fdb4b0483186273733adb16b48fbbf3e7ee8 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 24 Aug 2005 15:37:45 +0000 Subject: [PATCH 5437/7878] * configure.in: Fix checks for alloca(). PR: 13037 Submitted by: Noah Misch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@239697 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 8b346cba5ba..83fd90b143c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Fix checks for alloca() support in configure. PR 13037. + [Noah Misch ] + *) If apr_proc_create() fails to exec in the fork()ed child, call _exit() not exit() to avoid running atexit()-registered functions in the child. PR 30913. [Joe Orton] diff --git a/configure.in b/configure.in index 9115013a062..8fbe420fd31 100644 --- a/configure.in +++ b/configure.in @@ -883,7 +883,10 @@ AC_SUBST(sharedmem) dnl ----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) -AC_CHECK_FUNCS([alloca calloc setsid isinf isnan \ + +AC_FUNC_ALLOCA + +AC_CHECK_FUNCS([calloc setsid isinf isnan \ getenv putenv setenv unsetenv \ writev getifaddrs utime utimes]) AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) @@ -973,7 +976,6 @@ dnl ----------------------------- Checks for Any required Headers AC_HEADER_STDC APR_FLAG_HEADERS( - alloca.h \ ByteOrder.h \ conio.h \ crypt.h \ From 01f38ad3bd7705fc90439bd7b3c2019197fc223b Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 24 Aug 2005 21:09:57 +0000 Subject: [PATCH 5438/7878] Don't bother checking empty strings when we already know that the string length is 0. This fixes a false error code of APR_EABOVEROOT when the result of the merge is just a file name with no path of any kind. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@239927 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 67dcd71bd72..6079b84b151 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -803,16 +803,16 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * is still within given basepath. Note that the root path * segment is thoroughly tested prior to path parsing. */ - if (flags & APR_FILEPATH_NOTABOVEROOT) { - if (memcmp(basepath, path + rootlen, baselen)) + if ((flags & APR_FILEPATH_NOTABOVEROOT) && (baselen || rootlen)) { + if (baselen && memcmp(basepath, path + rootlen, baselen) && + basepath[baselen - 1] != '/' && basepath[baselen - 1] != '\\') return APR_EABOVEROOT; /* Ahem... if we weren't given a trailing slash on the basepath, * we better be sure that /foo wasn't replaced with /foobar! */ - if (basepath[baselen - 1] != '/' && basepath[baselen - 1] != '\\' - && path[rootlen + baselen] && path[rootlen + baselen] != '/' - && path[rootlen + baselen] != '\\') + if (path[rootlen + baselen] && path[rootlen + baselen] != '/' + && path[rootlen + baselen] != '\\') return APR_EABOVEROOT; } From d0a6fd9b94e0b15d3200f85f2177cfd69df6fd79 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 25 Aug 2005 06:12:28 +0000 Subject: [PATCH 5439/7878] * poll/unix/poll.c: Include alloca.h if present. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@240005 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index b212f2940ff..5ea846146a4 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -18,6 +18,10 @@ #if defined(POLL_USES_POLL) || defined(POLLSET_USES_POLL) +#ifdef HAVE_ALLOCA_H +#include +#endif + static apr_int16_t get_event(apr_int16_t event) { apr_int16_t rv = 0; From 9d99af266a576d5f8cd062b5cf97a559d7edea70 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 25 Aug 2005 12:03:51 +0000 Subject: [PATCH 5440/7878] Allow setting both the TCP_NODELAY and TCP_CORK socket options for Linux >=2.6: * build/apr_network.m4 (APR_CHECK_TCP_NODELAY_WITH_CORK): New macro. * configure.in: Use it. * network_io/unix/sockopt.c (apr_socket_opt_set): If HAVE_TCP_NODELAY_WITH_CORK is defined, don't toggle TCP_NODELAY when setting TCP_CORK. * test/testsockopt.c (corkable): Don't test that TCP_NODELAY and TCP_CORK are mutually exclusive; caller shouldn't care. Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@240047 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 54 +++++++++++++++++++++++++++++++++++++++ configure.in | 1 + network_io/unix/sockopt.c | 20 ++++++++++++--- test/testsockopt.c | 4 ++- 4 files changed, 74 insertions(+), 5 deletions(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 848a5e97fac..64e80755167 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -367,6 +367,60 @@ else fi ]) +dnl +dnl Determine whether TCP_NODELAY and TCP_CORK can both be set +dnl on a TCP socket. +dnl +AC_DEFUN([APR_CHECK_TCP_NODELAY_WITH_CORK], [ +AC_CACHE_CHECK([whether TCP_NODELAY and TCP_CORK can both be enabled], +[apr_cv_tcp_nodelay_with_cork], +[AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_TCP_H +#include +#endif +#include +#include +]], [[ + int fd, flag, rc; + + fd = socket(AF_INET, SOCK_STREAM, 0); + if (fd < 0) { + exit(1); + } + + flag = 1; + rc = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof flag); + if (rc < 0) { + perror("setsockopt TCP_NODELAY"); + exit(2); + } + + flag = 1; + rc = setsockopt(fd, IPPROTO_TCP, TCP_CORK, &flag, sizeof flag); + if (rc < 0) { + perror("setsockopt TCP_CORK"); + exit(3); + } + + exit(0); +]])], [apr_cv_tcp_nodelay_with_cork=yes], [apr_cv_tcp_nodelay_with_cork=no])]) + +if test "$apr_cv_tcp_nodelay_with_cork" = "yes"; then + AC_DEFINE([HAVE_TCP_NODELAY_WITH_CORK], 1, + [Define if TCP_NODELAY and TCP_CORK can be enabled at the same time]) +fi +]) + + dnl dnl see if O_NONBLOCK setting is inherited from listening sockets dnl diff --git a/configure.in b/configure.in index 8fbe420fd31..5d93ffce204 100644 --- a/configure.in +++ b/configure.in @@ -1879,6 +1879,7 @@ fi APR_CHECK_TCP_NODELAY_INHERITED APR_CHECK_O_NONBLOCK_INHERITED +APR_CHECK_TCP_NODELAY_WITH_CORK # Look for a way of corking TCP... APR_CHECK_DEFINE(TCP_CORK, netinet/tcp.h) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 5fcc493e9f7..f0014059f91 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -242,7 +242,13 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, break; case APR_TCP_NOPUSH: #if APR_TCP_NOPUSH_FLAG + /* TCP_NODELAY and TCP_CORK are mutually exclusive on Linux + * kernels < 2.6; on newer kernels they can be used together + * and TCP_CORK takes preference, which is the desired + * behaviour. On older kernels, TCP_NODELAY must be toggled + * to "off" whilst TCP_CORK is in effect. */ if (apr_is_option_set(sock, APR_TCP_NOPUSH) != on) { +#ifndef HAVE_TCP_NODELAY_WITH_CORK int optlevel = IPPROTO_TCP; int optname = TCP_NODELAY; @@ -253,11 +259,9 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, } #endif /* OK we're going to change some settings here... */ - /* TCP_NODELAY is mutually exclusive, so do we have it set? */ if (apr_is_option_set(sock, APR_TCP_NODELAY) == 1 && on) { - /* If we want to set NOPUSH then if we have the TCP_NODELAY - * flag set we need to switch it off... - */ + /* Now toggle TCP_NODELAY to off, if TCP_CORK is being + * turned on: */ int tmpflag = 0; if (setsockopt(sock->socketdes, optlevel, optname, (void*)&tmpflag, sizeof(int)) == -1) { @@ -268,13 +272,20 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, } else if (on) { apr_set_option(sock, APR_RESET_NODELAY, 0); } +#warning fish +#endif /* HAVE_TCP_NODELAY_WITH_CORK */ + /* OK, now we can just set the TCP_NOPUSH flag accordingly...*/ if (setsockopt(sock->socketdes, IPPROTO_TCP, APR_TCP_NOPUSH_FLAG, (void*)&on, sizeof(int)) == -1) { return errno; } apr_set_option(sock, APR_TCP_NOPUSH, on); +#ifndef HAVE_TCP_NODELAY_WITH_CORK if (!on && apr_is_option_set(sock, APR_RESET_NODELAY)) { + /* Now, if TCP_CORK was just turned off, turn + * TCP_NODELAY back on again if it was earlier toggled + * to off: */ int tmpflag = 1; if (setsockopt(sock->socketdes, optlevel, optname, (void*)&tmpflag, sizeof(int)) == -1) { @@ -283,6 +294,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, apr_set_option(sock, APR_RESET_NODELAY,0); apr_set_option(sock, APR_TCP_NODELAY, 1); } +#endif /* HAVE_TCP_NODELAY_WITH_CORK */ } #else return APR_ENOTIMPL; diff --git a/test/testsockopt.c b/test/testsockopt.c index 28d4fe31d5e..41e4102d7e5 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -102,7 +102,9 @@ static void corkable(abts_case *tc, void *data) rv = apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 0, ck); + /* TCP_NODELAY is now in an unknown state; it may be zero if + * TCP_NOPUSH and TCP_NODELAY are mutually exclusive on this + * platform, e.g. Linux < 2.6. */ rv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); From 57a06142177b571eb7a2fad1716fb4ffc5555285 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 25 Aug 2005 22:42:36 +0000 Subject: [PATCH 5441/7878] Teach jlibtool to respect '-static' flag. Works around 'bug' on Darwin where static libs have to have 'ranlib' executed after installation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@240151 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ build/jlibtool.c | 83 +++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 71 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index 83fd90b143c..813d9717baa 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) jlibtool: Teach to use static libraries with -static. + [Justin Erenkrantz] + *) Fix checks for alloca() support in configure. PR 13037. [Noah Misch ] diff --git a/build/jlibtool.c b/build/jlibtool.c index 7ddffc5d31a..22753414e3e 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -188,6 +188,12 @@ enum pic_mode_e { pic_AVOID, }; +enum shared_mode_e { + share_UNSET, + share_STATIC, + share_SHARED, +}; + enum lib_type { type_UNKNOWN, type_DYNAMIC_LIB, @@ -214,7 +220,7 @@ typedef struct { typedef struct { int silent; - int shared; + enum shared_mode_e shared; int export_all; int dry_run; enum pic_mode_e pic_mode; @@ -510,7 +516,7 @@ int parse_long_opt(char *arg, command_t *cmd_data) if (cmd_data->mode == mLink) { cmd_data->output = otDynamicLibraryOnly; } - cmd_data->options.shared = 1; + cmd_data->options.shared = share_SHARED; } else if (strcmp(var, "export-all") == 0) { cmd_data->options.export_all = 1; } else if (strcmp(var, "dry-run") == 0) { @@ -568,7 +574,7 @@ int parse_short_opt(char *arg, command_t *cmd_data) } if (strcmp(arg, "static") == 0) { - /* Don't respect it for now. */ + cmd_data->options.shared = share_STATIC; return 1; } @@ -807,12 +813,14 @@ char *check_library_exists(command_t *cmd, const char *arg, int pathlen, switch (pass) { case 0: - if (cmd->options.pic_mode != pic_AVOID || cmd->options.shared) { + if (cmd->options.pic_mode != pic_AVOID && + cmd->options.shared != share_STATIC) { strcpy(ext, DYNAMIC_LIB_EXT); *libtype = type_DYNAMIC_LIB; break; } pass = 1; + /* Fall through */ case 1: strcpy(ext, STATIC_LIB_EXT); *libtype = type_STATIC_LIB; @@ -1011,8 +1019,8 @@ void add_minus_l(count_chars *cc, const char *arg) file = name; file = file+4; push_count_chars(cc, "-L"); - push_count_chars(cc, arg); - /* we need one argument like -lapr-1 */ + push_count_chars(cc, arg); + /* we need one argument like -lapr-1 */ newarg = malloc(strlen(file) + 3); strcpy(newarg, "-l"); strcat(newarg, file); @@ -1250,12 +1258,10 @@ int parse_output_file_name(char *arg, command_t *cmd_data) return 0; } -/* returns just a file's name without path or extension */ -char *nameof(char *fullpath) +/* returns just a file's name without the path */ +const char *basename(const char *fullpath) { - char buffer[1024]; - char *ext; - char *name = strrchr(fullpath, '/'); + const char *name = strrchr(fullpath, '/'); if (name == NULL) { name = strrchr(fullpath, '\\'); @@ -1267,12 +1273,24 @@ char *nameof(char *fullpath) name++; } - strcpy(buffer, name); - ext = strrchr(buffer, '.'); + return name; +} + +/* returns just a file's name without path or extension */ +const char *nameof(const char *fullpath) +{ + const char *name; + const char *ext; + + name = basename(fullpath); + ext = strrchr(name, '.'); if (ext) { - *ext = 0; - return strdup(buffer); + char *trimmed; + trimmed = malloc(ext - name + 1); + strncpy(trimmed, name, ext - name); + trimmed[ext-name] = 0; + return trimmed; } return name; @@ -1635,6 +1653,41 @@ int run_mode(command_t *cmd_data) if (rv) { return rv; } +#if defined(__APPLE__) && defined(RANLIB) + /* From the Apple libtool(1) manpage on Tiger/10.4: + * ---- + * With the way libraries used to be created, errors were possible + * if the library was modified with ar(1) and the table of + * contents was not updated by rerunning ranlib(1). Thus the + * link editor, ld, warns when the modification date of a library + * is more recent than the creation date of its table of + * contents. Unfortunately, this means that you get the warning + * even if you only copy the library. + * ---- + * + * This means that when we install the static archive, we need to + * rerun ranlib afterwards. + */ + const char *lib_args[3], *static_lib_name; + char *tmp; + size_t len1, len2; + len1 = strlen(cmd_data->arglist->vals[cmd_data->arglist->num - 1]); + + static_lib_name = basename(cmd_data->static_name.install); + len2 = strlen(static_lib_name); + + tmp = malloc(len1 + len2 + 2); + + snprintf(tmp, len1 + len2 + 2, "%s/%s", + cmd_data->arglist->vals[cmd_data->arglist->num - 1], + static_lib_name); + + lib_args[0] = RANLIB; + lib_args[1] = tmp; + lib_args[2] = NULL; + external_spawn(cmd_data, RANLIB, lib_args); + free(tmp); +#endif clear_count_chars(cctemp); } if (cmd_data->shared_name.install) { From 5f7e01e6e6cc7e3b9e11ef4b66d2292a23d1206e Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 26 Aug 2005 07:14:09 +0000 Subject: [PATCH 5442/7878] Added a missing break statement that was causing TCP_NODELAY to be set whenever TCP_DEFER_ACCEPT was set. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@240174 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index f0014059f91..9a6bf34431e 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -210,6 +210,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, #else return APR_ENOTIMPL; #endif + break; case APR_TCP_NODELAY: #if defined(TCP_NODELAY) if (apr_is_option_set(sock, APR_TCP_NODELAY) != on) { From 5f4600da5fe93c59eb0f33fda24b3bd863dcf2a9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 26 Aug 2005 07:47:21 +0000 Subject: [PATCH 5443/7878] * network_io/unix/sockopt.c (apr_socket_opt_set): Thou whilst not commit debugging code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@240181 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 9a6bf34431e..ce2c151c4e8 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -273,7 +273,6 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, } else if (on) { apr_set_option(sock, APR_RESET_NODELAY, 0); } -#warning fish #endif /* HAVE_TCP_NODELAY_WITH_CORK */ /* OK, now we can just set the TCP_NOPUSH flag accordingly...*/ From 7682202a654ea4f2c537556e251ce665ceed4045 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 27 Aug 2005 01:17:01 +0000 Subject: [PATCH 5444/7878] Decrement apr_pools_initialized in the debug version of apr_pool_termiante, making it match the non-debug version. Submitted By: Henry Jen git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@240370 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 291abc3d66e..13c60a870c3 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1264,7 +1264,8 @@ APR_DECLARE(void) apr_pool_terminate(void) if (!apr_pools_initialized) return; - apr_pools_initialized = 0; + if (--apr_pools_initialized) + return; apr_pool_destroy(global_pool); /* This will also destroy the mutex */ global_pool = NULL; From d2025d8d9cadd0f226020e44cab0123d6e450ddd Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 30 Aug 2005 10:03:53 +0000 Subject: [PATCH 5445/7878] * include/apr_pools.h: Clarify docs on cleanups. Submitted by: Jonathan Wakely git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@264750 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 50 ++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 7b6daa351b0..52880b6d162 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -476,8 +476,8 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *pool); -/* - * Cleanup +/** + * @defgroup PoolCleanup Pool Cleanup Functions * * Cleanups are performed in the reverse order they were registered. That is: * Last In, First Out. A cleanup function can safely allocate memory from @@ -486,6 +486,8 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, * terminates. Cleanups have to take caution in calling functions that * create subpools. Subpools, created during cleanup will NOT automatically * be cleaned up. In other words, cleanups are to clean up after themselves. + * + * @{ */ /** @@ -504,9 +506,13 @@ APR_DECLARE(void) apr_pool_cleanup_register( apr_status_t (*child_cleanup)(void *)); /** - * Remove a previously registered cleanup function - * @param p The pool remove the cleanup from - * @param data The data to remove from cleanup + * Remove a previously registered cleanup function. + * + * The cleanup most recently registered with @a p having the same values of + * @a data and @a cleanup will be removed. + * + * @param p The pool to remove the cleanup from + * @param data The data of the registered cleanup * @param cleanup The function to remove from cleanup * @remarks For some strange reason only the plain_cleanup is handled by this * function @@ -515,7 +521,12 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *)); /** - * Replace the child cleanup of a previously registered cleanup + * Replace the child cleanup function of a previously registered cleanup. + * + * The cleanup most recently registered with @a p having the same values of + * @a data and @a plain_cleanup will have the registered child cleanup + * function replaced with @a child_cleanup. + * * @param p The pool of the registered cleanup * @param data The data of the registered cleanup * @param plain_cleanup The plain cleanup function of the registered cleanup @@ -528,9 +539,13 @@ APR_DECLARE(void) apr_pool_child_cleanup_set( apr_status_t (*child_cleanup)(void *)); /** - * Run the specified cleanup function immediately and unregister it. Use - * @a data instead of the data that was registered with the cleanup. - * @param p The pool remove the cleanup from + * Run the specified cleanup function immediately and unregister it. + * + * The cleanup most recently registered with @a p having the same values of + * @a data and @a cleanup will be removed and @a cleanup will be called + * with @a data as the argument. + * + * @param p The pool to remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup */ @@ -540,20 +555,23 @@ APR_DECLARE(apr_status_t) apr_pool_cleanup_run( apr_status_t (*cleanup)(void *)); /** - * An empty cleanup function - * @param data The data to cleanup + * An empty cleanup function. + * + * Passed to apr_pool_cleanup_register() when no cleanup is required. + * + * @param data The data to cleanup, will not be used by this function. */ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); -/* Preparing for exec() --- close files, etc., but *don't* flush I/O - * buffers, *don't* wait for subprocesses, and *don't* free any memory. - */ /** - * Run all of the child_cleanups, so that any unnecessary files are - * closed because we are about to exec a new program + * Run all registered child cleanups, in preparation for an exec() + * call in a forked child -- close files, etc., but *don't* flush I/O + * buffers, *don't* wait for subprocesses, and *don't* free any + * memory. */ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); +/** @} */ /** * @defgroup PoolDebug Pool Debugging functions. From d6ffb863f30c9d26ab350decad18f7cd8f23cb6c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 31 Aug 2005 11:00:14 +0000 Subject: [PATCH 5446/7878] Provide APR_VERSION_AT_LEAST() macro for applications which want to enable features based on a required level of APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@265011 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_version.h | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/CHANGES b/CHANGES index 813d9717baa..1d0311f431c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes for APR 1.3.0 + *) Provide APR_VERSION_AT_LEAST() macro for applications which + want to enable features based on a required level of APR. + [Jeff Trawick] + *) jlibtool: Teach to use static libraries with -static. [Justin Erenkrantz] diff --git a/include/apr_version.h b/include/apr_version.h index e309bf67c73..3ce2473aa77 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -68,6 +68,22 @@ */ #define APR_IS_DEV_VERSION +/** + * Check at compile time if the APR version is at least a certain + * level. + * @param major The major version component of the version checked + * for (e.g., the "1" of "1.3.0"). + * @param minor The minor version component of the version checked + * for (e.g., the "3" of "1.3.0"). + * @param patch The patch level component of the version checked + * for (e.g., the "0" of "1.3.0"). + * @remark This macro is available with APR versions starting with + * 1.3.0. + */ +#define APR_VERSION_AT_LEAST(major,minor,patch) \ +(((major) < APR_MAJOR_VERSION) \ + || ((major) == APR_MAJOR_VERSION && (minor) < APR_MINOR_VERSION) \ + || ((major) == APR_MAJOR_VERSION && (minor) == APR_MINOR_VERSION && (patch) <= APR_PATCH_VERSION)) #if defined(APR_IS_DEV_VERSION) || defined(DOXYGEN) /** Internal: string form of the "is dev" flag */ From 60cf62e29a5dab1dab8deb5e0877cd68ee6177d8 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 31 Aug 2005 12:32:14 +0000 Subject: [PATCH 5447/7878] Add some workarounds for cases where readdir_r fails due to large integers in struct dirent's d_ino or d_off fields in LFS builds (seen in some peculiar NFS environments): * configure.in: Check for readdir64_r for LFS builds. * include/arch/unix/apr_arch_file_io.h (struct apr_dir_t): Use struct dirent64 for entry field if readdir64_r is present. * file_io/unix/dir.c (apr_dir_open): Use size of the entry field. (apr_dir_read): Use readdir64_r if available; check for d_ino overflow. * file_io/unix/filestat.c (fill_out_finfo): Check for inode number overflow. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@265032 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 2 ++ configure.in | 2 +- file_io/unix/dir.c | 38 +++++++++++++++++++++++++--- file_io/unix/filestat.c | 11 +++++++- include/arch/unix/apr_arch_file_io.h | 4 +++ 5 files changed, 51 insertions(+), 6 deletions(-) diff --git a/STATUS b/STATUS index 17786db0652..7bfdc99671a 100644 --- a/STATUS +++ b/STATUS @@ -403,6 +403,8 @@ API Changes Postponed for APR 2.0: * apr_hash_count() should take a const apr_hash_t * argument. + * apr_ino_t should be an ino64_t in LFS builds. + Stuff for post 1.0: * Almost every API in APR depends on pools, but pool semantics diff --git a/configure.in b/configure.in index 5d93ffce204..579fecf54b3 100644 --- a/configure.in +++ b/configure.in @@ -1258,7 +1258,7 @@ APR_CHECK_SIZEOF_EXTENDED([#include ], off_t, 8) if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then # Enable LFS aprlfs=1 - AC_CHECK_FUNCS([mmap64 sendfile64 sendfilev64 mkstemp64]) + AC_CHECK_FUNCS([mmap64 sendfile64 sendfilev64 mkstemp64 readdir64_r]) else aprlfs=0 fi diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 590380f2e2a..da7e5a1eb23 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -77,8 +77,8 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, * one-byte array. Note: gcc evaluates this at compile time. */ apr_size_t dirent_size = - (sizeof((*new)->entry->d_name) > 1 ? - sizeof(struct dirent) : sizeof (struct dirent) + 255); + sizeof(*(*new)->entry) + + (sizeof((*new)->entry->d_name) > 1 ? 0 : 255); (*new) = (apr_dir_t *)apr_palloc(pool, sizeof(apr_dir_t)); @@ -139,9 +139,28 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, #endif #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && !defined(READDIR_IS_THREAD_SAFE) +#ifdef HAVE_READDIR64_R + struct dirent64 *retent; + + /* If LFS is enabled and readdir64_r is available, readdir64_r is + * used in preference to readdir_r. This allows directories to be + * read which contain a (64-bit) inode number which doesn't fit + * into the 32-bit apr_ino_t, iff the caller doesn't actually care + * about the inode number (i.e. wanted & APR_FINFO_INODE == 0). + * (such inodes may be seen in some wonky NFS environments) + * + * Similarly, if the d_off field cannot be reprented in a 32-bit + * offset, the libc readdir_r() would barf; using readdir64_r + * bypasses that case entirely since APR does not care about + * d_off. */ + + ret = readdir64_r(thedir->dirstruct, thedir->entry, &retent); +#else + struct dirent *retent; ret = readdir_r(thedir->dirstruct, thedir->entry, &retent); +#endif /* Avoid the Linux problem where at end-of-directory thedir->entry * is set to NULL, but ret = APR_SUCCESS. @@ -191,9 +210,20 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, #endif #ifdef DIRENT_INODE if (thedir->entry->DIRENT_INODE && thedir->entry->DIRENT_INODE != -1) { - wanted &= ~APR_FINFO_INODE; +#ifdef HAVE_READDIR64_R + /* If readdir64_r is used, check for the overflow case of trying + * to fit a 64-bit integer into a 32-bit integer. */ + if (sizeof(apr_ino_t) >= sizeof(retent->DIRENT_INODE) + || (apr_ino_t)retent->DIRENT_INODE == retent->DIRENT_INODE) { + wanted &= ~APR_FINFO_INODE; + } else { + /* Prevent the fallback code below from filling in the + * inode if the stat call fails. */ + retent->DIRENT_INODE = 0; + } } -#endif +#endif /* HAVE_READDIR64_R */ +#endif /* DIRENT_INODE */ wanted &= ~APR_FINFO_NAME; diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index d7a48663afd..b1a43101a73 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -77,9 +77,18 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info, finfo->user = info->st_uid; finfo->group = info->st_gid; finfo->size = info->st_size; - finfo->inode = info->st_ino; finfo->device = info->st_dev; finfo->nlink = info->st_nlink; + + /* Check for overflow if storing a 64-bit st_ino in a 32-bit + * apr_ino_t for LFS builds: */ + if (sizeof(apr_ino_t) >= sizeof(info->st_ino) + || (apr_ino_t)info->st_ino == info->st_ino) { + finfo->inode = info->st_ino; + } else { + finfo->valid &= ~APR_FINFO_INODE; + } + apr_time_ansi_put(&finfo->atime, info->st_atime); apr_time_ansi_put(&finfo->mtime, info->st_mtime); apr_time_ansi_put(&finfo->ctime, info->st_ctime); diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index 1d10b04903e..afd72bfe05e 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -125,7 +125,11 @@ struct apr_dir_t { apr_pool_t *pool; char *dirname; DIR *dirstruct; +#ifdef HAVE_READDIR64_R + struct dirent64 *entry; +#else struct dirent *entry; +#endif }; apr_status_t apr_unix_file_cleanup(void *); From 247c8d356e90caf2a222cefecead7e3e41639ad2 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 1 Sep 2005 09:20:52 +0000 Subject: [PATCH 5448/7878] * file_io/unix/dir.c (apr_dir_read): Fix non-readdir64_r build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@265681 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index da7e5a1eb23..d0c628a930c 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -221,8 +221,10 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, * inode if the stat call fails. */ retent->DIRENT_INODE = 0; } - } +#else + wanted &= ~APR_FINFO_INODE; #endif /* HAVE_READDIR64_R */ + } #endif /* DIRENT_INODE */ wanted &= ~APR_FINFO_NAME; From e6a851f75966e000cb2a7801ac88e26359675750 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 1 Sep 2005 09:39:11 +0000 Subject: [PATCH 5449/7878] * file_io/unix/dir.c (apr_dir_open): Fix error handling; don't assume that apr_pcalloc can't change errno. Remove a redundant cast to void *. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@265684 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index d0c628a930c..276a731833b 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -79,22 +79,22 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_size_t dirent_size = sizeof(*(*new)->entry) + (sizeof((*new)->entry->d_name) > 1 ? 0 : 255); + DIR *dir = opendir(dirname); + + if (!dir) { + return errno; + } (*new) = (apr_dir_t *)apr_palloc(pool, sizeof(apr_dir_t)); (*new)->pool = pool; (*new)->dirname = apr_pstrdup(pool, dirname); - (*new)->dirstruct = opendir(dirname); + (*new)->dirstruct = dir; (*new)->entry = apr_pcalloc(pool, dirent_size); - if ((*new)->dirstruct == NULL) { - return errno; - } - else { - apr_pool_cleanup_register((*new)->pool, (void *)(*new), dir_cleanup, - apr_pool_cleanup_null); - return APR_SUCCESS; - } + apr_pool_cleanup_register((*new)->pool, *new, dir_cleanup, + apr_pool_cleanup_null); + return APR_SUCCESS; } apr_status_t apr_dir_close(apr_dir_t *thedir) From 6d8803d0bb8ddde995816c77d6917fe03b14950b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 1 Sep 2005 17:19:07 +0000 Subject: [PATCH 5450/7878] Fix an extranious emit, the file is huge (off_t) but the newbufpos is an offset in memory (size_t). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@265757 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/seek.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index bc075e3a848..be5bac932e5 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -30,7 +30,11 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) thefile->direction = 0; } - newbufpos = pos - (thefile->filePtr - thefile->dataRead); + /* We may be truncating to size here. + * XXX: testing an 'unsigned' as >= 0 below indicates a bug + */ + newbufpos = (apr_size_t)(pos - (thefile->filePtr + - thefile->dataRead)); if (newbufpos >= 0 && newbufpos <= thefile->dataRead) { thefile->bufpos = (apr_size_t)newbufpos; From 19f994e6b896b55f512ed228ce6e1c1312fcef7c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 2 Sep 2005 12:03:19 +0000 Subject: [PATCH 5451/7878] Move remaining suggested type renames to STATUS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@267189 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 9 +++++++++ renames_pending | 39 --------------------------------------- 2 files changed, 9 insertions(+), 39 deletions(-) delete mode 100644 renames_pending diff --git a/STATUS b/STATUS index 7bfdc99671a..f717bafa8e0 100644 --- a/STATUS +++ b/STATUS @@ -405,6 +405,15 @@ API Changes Postponed for APR 2.0: * apr_ino_t should be an ino64_t in LFS builds. + * possible type renames: + + apr_file_info_t from apr_finfo_t + apr_file_attrs_t from apr_fileattrs_t + apr_file_seek_where_t from apr_seek_where_t + apr_lock_mech_e from apr_lockmech_e + apr_time_interval_t from apr_interval_time_t + apr_time_interval_short_t from apr_short_interval_time_t + Stuff for post 1.0: * Almost every API in APR depends on pools, but pool semantics diff --git a/renames_pending b/renames_pending deleted file mode 100644 index ca007a729c1..00000000000 --- a/renames_pending +++ /dev/null @@ -1,39 +0,0 @@ -Pending symbol renames for APR [for some discussion yet] - -apr_file_info_t from apr_finfo_t -apr_file_attrs_t from apr_fileattrs_t -apr_file_seek_where_t from apr_seek_where_t - -#apr_filepath_name_get from apr_filename_of_pathname - -apr_lock_mech_e from apr_lockmech_e - -#apr_gid_get from apr_get_groupid -#apr_gid_name_get from apr_get_groupname -#apr_gid_name_get from apr_group_name_get -#apr_gid_compare from apr_compare_groups - -#apr_socket_shutdown from apr_shutdown -#apr_socket_bind from apr_bind -#apr_socket_listen from apr_listen -#apr_socket_accept from apr_accept -#apr_socket_connect from apr_connect -#apr_socket_send from apr_send -#apr_socket_sendv from apr_sendv -#apr_socket_sendto from apr_sendto -#apr_socket_recvfrom from apr_recvfrom -#apr_socket_sendfile from apr_sendfile -#apr_socket_recv from apr_recv -#apr_socket_inherit_set from apr_socket_set_inherit -#apr_socket_inherit_unset from apr_socket_unset_inherit - - -#apr_time_exp_gmt_get from apr_implode_gmt -apr_time_interval_t from apr_interval_time_t -apr_time_interval_short_t from apr_short_interval_time_t - -#apr_uid_homepath_get from apr_get_home_directory -#apr_uid_get from apr_get_userid -#apr_uid_current from apr_current_userid -#apr_uid_compare from apr_compare_users -#apr_uid_name_get from apr_get_username From 0c44595a2d775102433d03bc545b0b11d840cc94 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 2 Sep 2005 12:04:57 +0000 Subject: [PATCH 5452/7878] * build/apr_hints.m4 (APR_PRELOAD): Disable readdir64_r on Solaris since the error handling seems to be broken. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@267190 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 6a5a222e1b7..eef922ea9f9 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -232,6 +232,9 @@ dnl # Not a problem in 10.20. Otherwise, who knows? PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT]) APR_SETIFNULL(apr_lock_method, [USE_FCNTL_SERIALIZE]) + # readdir64_r error handling seems broken on Solaris (at least + # up till 2.8) -- it will return -1 at end-of-directory. + APR_SETIFNULL(ac_cv_func_readdir64_r, [no]) ;; *-sunos4*) APR_ADDTO(CPPFLAGS, [-DSUNOS4]) From 47cc7334f0f5a174d41636d7ad4d3ebb061e75d5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 3 Sep 2005 14:01:49 +0000 Subject: [PATCH 5453/7878] Fix multiple sign'edness issues; for %width.prec variables, neither is -ever- signed, we pull out -width as a flag, and prec is folded +. Changing the code only required special handling of %*.* variables, continuing to read them as int, and preserving the folding of negative values that's already there. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@267459 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index e903d2d3130..bfd941e35a5 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -290,7 +290,8 @@ static char *apr_gcvt(double number, int ndigit, char *buf, boolean_e altform) */ #define FIX_PRECISION(adjust, precision, s, s_len) \ if (adjust) { \ - int p = precision < NUM_BUF_SIZE - 1 ? precision : NUM_BUF_SIZE - 1; \ + apr_size_t p = (precision + 1 < NUM_BUF_SIZE) \ + ? precision : NUM_BUF_SIZE - 1; \ while (s_len < p) \ { \ *--s = '0'; \ @@ -703,8 +704,8 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), char *q; apr_size_t s_len; - register int min_width = 0; - int precision = 0; + register apr_size_t min_width = 0; + apr_size_t precision = 0; enum { LEFT, RIGHT } adjust; @@ -784,13 +785,15 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), adjust_width = YES; } else if (*fmt == '*') { - min_width = va_arg(ap, int); + int v = va_arg(ap, int); fmt++; adjust_width = YES; - if (min_width < 0) { + if (v < 0) { adjust = LEFT; - min_width = -min_width; + min_width = (apr_size_t)(-v); } + else + min_width = (apr_size_t)v; } else adjust_width = NO; @@ -805,10 +808,9 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), STR_TO_DEC(fmt, precision); } else if (*fmt == '*') { - precision = va_arg(ap, int); + int v = va_arg(ap, int); fmt++; - if (precision < 0) - precision = 0; + precision = (v < 0) ? 0 : (apr_size_t)v; } else precision = 0; From d7471839235748f9743fad6fc4a7ca6f568ece41 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 3 Sep 2005 14:22:43 +0000 Subject: [PATCH 5454/7878] The internal table_mergesort can use entirely unsigned qtys, eliminates all type conversion/signedness comparison errors. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@267461 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 2376a8f6b19..2ef93a8f49f 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -962,7 +962,8 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, } static apr_table_entry_t **table_mergesort(apr_pool_t *pool, - apr_table_entry_t **values, int n) + apr_table_entry_t **values, + apr_size_t n) { /* Bottom-up mergesort, based on design in Sedgewick's "Algorithms * in C," chapter 8 @@ -970,7 +971,7 @@ static apr_table_entry_t **table_mergesort(apr_pool_t *pool, apr_table_entry_t **values_tmp = (apr_table_entry_t **)apr_palloc(pool, n * sizeof(apr_table_entry_t*)); apr_size_t i; - int blocksize; + apr_size_t blocksize; /* First pass: sort pairs of elements (blocksize=1) */ for (i = 0; i + 1 < n; i += 2) { @@ -985,7 +986,7 @@ static apr_table_entry_t **table_mergesort(apr_pool_t *pool, blocksize = 2; while (blocksize < n) { apr_table_entry_t **dst = values_tmp; - int next_start; + apr_size_t next_start; apr_table_entry_t **swap; /* Merge consecutive pairs blocks of the next blocksize. @@ -995,10 +996,10 @@ static apr_table_entry_t **table_mergesort(apr_pool_t *pool, for (next_start = 0; next_start + blocksize < n; next_start += (blocksize + blocksize)) { - int block1_start = next_start; - int block2_start = block1_start + blocksize; - int block1_end = block2_start; - int block2_end = block2_start + blocksize; + apr_size_t block1_start = next_start; + apr_size_t block2_start = block1_start + blocksize; + apr_size_t block1_end = block2_start; + apr_size_t block2_end = block2_start + blocksize; if (block2_end > n) { /* The last block may be smaller than blocksize */ block2_end = n; From fc7a7f29abf764630223439c5a868b56df80ea22 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 5 Sep 2005 10:45:30 +0000 Subject: [PATCH 5455/7878] * file_io/unix/dir.c (apr_dir_read): Clarify handling of end-of-directory; the "Linux problem" being the behaviour required by POSIX. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@278711 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 276a731833b..2f05f640d49 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -162,11 +162,11 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, ret = readdir_r(thedir->dirstruct, thedir->entry, &retent); #endif - /* Avoid the Linux problem where at end-of-directory thedir->entry - * is set to NULL, but ret = APR_SUCCESS. - */ - if(!ret && thedir->entry != retent) + /* POSIX treats "end of directory" as a non-error case, so ret + * will be zero and retent will be set to NULL in that case. */ + if (!ret && retent == NULL) { ret = APR_ENOENT; + } /* Solaris is a bit strange, if there are no more entries in the * directory, it returns EINVAL. Since this is against POSIX, we From 26e74935f8f6882c1274daf2fdfd00b4b1bc3170 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 8 Sep 2005 13:55:29 +0000 Subject: [PATCH 5456/7878] * file_io/unix/dir.c (apr_dir_read): Avoid an unnecessary strlen(dirname) each time a stat call is required by using the apr_cpystrn return value. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@279565 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 2f05f640d49..eed7f3a41b4 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -232,12 +232,16 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if (wanted) { char fspec[APR_PATH_MAX]; - int off; - apr_cpystrn(fspec, thedir->dirname, sizeof(fspec)); - off = strlen(fspec); - if ((fspec[off - 1] != '/') && (off + 1 < sizeof(fspec))) - fspec[off++] = '/'; - apr_cpystrn(fspec + off, thedir->entry->d_name, sizeof(fspec) - off); + char *end; + + end = apr_cpystrn(fspec, thedir->dirname, sizeof fspec); + + if (end > fspec && end[-1] != '/' && (end < fspec + APR_PATH_MAX)) + *end++ = '/'; + + apr_cpystrn(end, thedir->entry->d_name, + sizeof fspec - (end - fspec)); + ret = apr_stat(finfo, fspec, APR_FINFO_LINK | wanted, thedir->pool); /* We passed a stack name that will disappear */ finfo->fname = NULL; From 12c7b046b3b7556c6a692366cf94d59cbc3482b3 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 8 Sep 2005 14:05:40 +0000 Subject: [PATCH 5457/7878] Fix handling of %pI with psprintf; the psprintf implementation assumes that the vformatter code will not palloc. * include/apr_network_io.h (apr_sockaddr_ip_getbuf): Declare new function. * network_io/unix/sockaddr.c (apr_sockaddr_ip_getbuf): Rewrite of apr_sockaddr_ip_get, taking a buffer argument. (apr_sockaddr_ip_get): Reimplement using apr_sockaddr_ip_getbuf. * strings/apr_snprintf.c (conv_apr_sockaddr): Use apr_sockaddr_ip_getbuf to avoid use of pool. * test/testsock.c (test_print_addr): New test case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@279566 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_network_io.h | 9 +++++++++ network_io/unix/sockaddr.c | 30 ++++++++++++++++++++---------- strings/apr_snprintf.c | 12 ++++++++++-- test/testsock.c | 14 ++++++++++++++ 5 files changed, 57 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 1d0311f431c..ed05e8bde77 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes for APR 1.3.0 + *) Add apr_sockaddr_ip_getbuf() function. [Joe Orton] + + *) Fix handling of %pI in apr_psprintf. [Joe Orton] + *) Provide APR_VERSION_AT_LEAST() macro for applications which want to enable features based on a required level of APR. [Jeff Trawick] diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 948e1df7056..126c4c12ff4 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -668,6 +668,15 @@ APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr); +/** + * Write the IP address (in numeric address string format) of the APR + * socket address @a sockaddr into the buffer @a buf (of size @a buflen). + * @param addr The IP address. + * @param sockaddr The socket address to reference. + */ +APR_DECLARE(apr_status_t) apr_sockaddr_ip_getbuf(char *buf, apr_size_t buflen, + apr_sockaddr_t *sockaddr); + /** * See if the IP addresses in two APR socket addresses are * equivalent. Appropriate logic is present for comparing diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index f27e97fb98f..da95b0698c2 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -98,27 +98,37 @@ static apr_status_t get_remote_addr(apr_socket_t *sock) } } -APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, - apr_sockaddr_t *sockaddr) +APR_DECLARE(apr_status_t) apr_sockaddr_ip_getbuf(char *buf, apr_size_t buflen, + apr_sockaddr_t *sockaddr) { - *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len); - apr_inet_ntop(sockaddr->family, - sockaddr->ipaddr_ptr, - *addr, - sockaddr->addr_str_len); + if (!apr_inet_ntop(sockaddr->family, sockaddr->ipaddr_ptr, buf, buflen)) { + return APR_ENOSPC; + } + #if APR_HAVE_IPV6 - if (sockaddr->family == AF_INET6 && - IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sockaddr->ipaddr_ptr)) { + if (sockaddr->family == AF_INET6 + && IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sockaddr->ipaddr_ptr) + && buflen > strlen("::ffff:")) { /* This is an IPv4-mapped IPv6 address; drop the leading * part of the address string so we're left with the familiar * IPv4 format. */ - *addr += strlen("::ffff:"); + memmove(buf, buf + strlen("::ffff:"), + strlen(buf + strlen("::ffff:"))); } #endif + /* ensure NUL termination if the buffer is too short */ + buf[buflen-1] = '\0'; return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, + apr_sockaddr_t *sockaddr) +{ + *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len); + return apr_sockaddr_ip_getbuf(*addr, sockaddr->addr_str_len, sockaddr); +} + void apr_sockaddr_vars_set(apr_sockaddr_t *addr, int family, apr_port_t port) { addr->family = family; diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index bfd941e35a5..a98799a3abb 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -464,7 +464,8 @@ static char *conv_in_addr(struct in_addr *ia, char *buf_end, apr_size_t *len) } - +/* Must be passed a buffer of size NUM_BUF_SIZE where buf_end points + * to 1 byte past the end of the buffer. */ static char *conv_apr_sockaddr(apr_sockaddr_t *sa, char *buf_end, apr_size_t *len) { char *p = buf_end; @@ -474,7 +475,14 @@ static char *conv_apr_sockaddr(apr_sockaddr_t *sa, char *buf_end, apr_size_t *le p = conv_10(sa->port, TRUE, &is_negative, p, &sub_len); *--p = ':'; - apr_sockaddr_ip_get(&ipaddr_str, sa); + ipaddr_str = buf_end - NUM_BUF_SIZE; + if (apr_sockaddr_ip_getbuf(ipaddr_str, sa->addr_str_len, sa)) { + /* Should only fail if the buffer is too small, which it + * should not be; but fail safe anyway: */ + *--p = '?'; + *len = buf_end - p; + return p; + } sub_len = strlen(ipaddr_str); #if APR_HAVE_IPV6 if (sa->family == APR_INET6 && diff --git a/test/testsock.c b/test/testsock.c index e6c8280ca2c..c6b84dc7699 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -203,6 +203,19 @@ static void test_timeout(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } +static void test_print_addr(abts_case *tc, void *data) +{ + apr_sockaddr_t *sa; + char *s; + + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", + apr_sockaddr_info_get(&sa, "0.0.0.0", APR_INET, 80, 0, p)); + + s = apr_psprintf(p, "foo %pI bar", sa); + + ABTS_STR_EQUAL(tc, "foo 0.0.0.0:80 bar", s); +} + abts_suite *testsock(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -212,6 +225,7 @@ abts_suite *testsock(abts_suite *suite) abts_run_test(suite, test_send, NULL); abts_run_test(suite, test_recv, NULL); abts_run_test(suite, test_timeout, NULL); + abts_run_test(suite, test_print_addr, NULL); return suite; } From 3027dc357c6ad6d7cd4f1a7bfdc1553139909b4a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 8 Sep 2005 14:09:04 +0000 Subject: [PATCH 5458/7878] * test/teststr.c (string_cpystrn): Add test case for apr_cpystrn. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@279567 13f79535-47bb-0310-9956-ffa450edef68 --- test/teststr.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/teststr.c b/test/teststr.c index 490d5e184ca..3ed3133b63c 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -349,6 +349,20 @@ static void string_strfsize(abts_case *tc, void *data) } } +static void string_cpystrn(abts_case *tc, void *data) +{ + char buf[6], *ret; + + buf[5] = 'Z'; + + ret = apr_cpystrn(buf, "123456", 5); + + ABTS_STR_EQUAL(tc, buf, "1234"); + ABTS_PTR_EQUAL(tc, ret, buf + 4); + ABTS_TRUE(tc, *ret == '\0'); + ABTS_TRUE(tc, ret[1] == 'Z'); +} + abts_suite *teststr(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -364,6 +378,7 @@ abts_suite *teststr(abts_suite *suite) abts_run_test(suite, string_strtoff, NULL); abts_run_test(suite, overflow_strfsize, NULL); abts_run_test(suite, string_strfsize, NULL); + abts_run_test(suite, string_cpystrn, NULL); return suite; } From 1b8b19bbe7b2cbef3f08871764f9b0b4c599d2b6 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 9 Sep 2005 08:05:04 +0000 Subject: [PATCH 5459/7878] Fix apr_socket_addr_get(APR_REMOTE) after a non-blocking connect(): * network_io/unix/sockets.c (alloc_socket): Set remote_addr_unknown. (apr_socket_accept): Clear remote_addr_unknown. (apr_socket_connect): Clear remote_addr_unknown and set remote_addr iff the passed-in address was not the inaddr_any address. * test/testsock.c (test_get_addr): New test. PR: 32737 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@279727 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++-- network_io/unix/sockets.c | 14 ++++++++- test/testsock.c | 60 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index ed05e8bde77..ed8eaf9f5b4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,11 @@ Changes for APR 1.3.0 - *) Add apr_sockaddr_ip_getbuf() function. [Joe Orton] + *) Fix apr_socket_addr_get(,APR_REMOTE,) after a non-blocking + connection is completed. [Joe Orton] - *) Fix handling of %pI in apr_psprintf. [Joe Orton] + *) Add apr_sockaddr_ip_getbuf() function. [Joe Orton] + + *) Fix handling of %pI in apr_psprintf. [Joe Orton] *) Provide APR_VERSION_AT_LEAST() macro for applications which want to enable features based on a required level of APR. diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 89cee00e780..941889bdf67 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -66,6 +66,7 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, sizeof(apr_sockaddr_t)); (*new)->remote_addr->pool = p; + (*new)->remote_addr_unknown = 1; #ifndef WAITIO_USES_POLL /* Create a pollset with room for one descriptor. */ /* ### check return codes */ @@ -197,6 +198,8 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, } #endif + (*new)->remote_addr_unknown = 0; + *(*new)->local_addr = *sock->local_addr; /* The above assignment just overwrote the pool entry. Setting the local_addr @@ -289,7 +292,16 @@ apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) return errno; } - sock->remote_addr = sa; + if (memcmp(sa->ipaddr_ptr, generic_inaddr_any, sa->ipaddr_len)) { + /* A real remote address was passed in. If the unspecified + * address was used, the actual remote addr will have to be + * determined using getpeername() if required. */ + /* ### this should probably be a structure copy + fixup as per + * _accept()'s handling of local_addr */ + sock->remote_addr = sa; + sock->remote_addr_unknown = 0; + } + if (sock->local_addr->port == 0) { /* connect() got us an ephemeral port */ sock->local_port_unknown = 1; diff --git a/test/testsock.c b/test/testsock.c index c6b84dc7699..1e022e9393a 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -22,6 +22,7 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_strings.h" +#include "apr_poll.h" static void launch_child(abts_case *tc, apr_proc_t *proc, const char *arg1, apr_pool_t *p) { @@ -216,6 +217,64 @@ static void test_print_addr(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "foo 0.0.0.0:80 bar", s); } +static void test_get_addr(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_socket_t *ld, *sd, *cd; + apr_sockaddr_t *sa, *ca; + char *a, *b; + + ld = setup_socket(tc); + + APR_ASSERT_SUCCESS(tc, + "get local address of bound socket", + apr_socket_addr_get(&sa, APR_LOCAL, ld)); + + rv = apr_socket_create(&cd, sa->family, SOCK_STREAM, + APR_PROTO_TCP, p); + APR_ASSERT_SUCCESS(tc, "create client socket", rv); + + APR_ASSERT_SUCCESS(tc, "enable non-block mode", + apr_socket_opt_set(cd, APR_SO_NONBLOCK, 1)); + + /* initiate connection */ + apr_socket_connect(cd, sa); + + APR_ASSERT_SUCCESS(tc, "accept connection", + apr_socket_accept(&sd, ld, p)); + + { + /* wait for writability */ + apr_pollfd_t pfd; + int n; + + pfd.p = p; + pfd.desc_type = APR_POLL_SOCKET; + pfd.reqevents = APR_POLLOUT|APR_POLLHUP; + pfd.desc.s = cd; + pfd.client_data = NULL; + + APR_ASSERT_SUCCESS(tc, "poll for connect completion", + apr_poll(&pfd, 1, &n, 5 * APR_USEC_PER_SEC)); + + } + + APR_ASSERT_SUCCESS(tc, "get local address of server socket", + apr_socket_addr_get(&sa, APR_LOCAL, sd)); + + APR_ASSERT_SUCCESS(tc, "get remote address of client socket", + apr_socket_addr_get(&ca, APR_REMOTE, cd)); + + a = apr_psprintf(p, "%pI", sa); + b = apr_psprintf(p, "%pI", ca); + + ABTS_STR_EQUAL(tc, a, b); + + apr_socket_close(cd); + apr_socket_close(sd); + apr_socket_close(ld); +} + abts_suite *testsock(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -226,6 +285,7 @@ abts_suite *testsock(abts_suite *suite) abts_run_test(suite, test_recv, NULL); abts_run_test(suite, test_timeout, NULL); abts_run_test(suite, test_print_addr, NULL); + abts_run_test(suite, test_get_addr, NULL); return suite; } From 1416609f4e379160efacb544a78c3f80ed0b4de3 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 9 Sep 2005 08:13:13 +0000 Subject: [PATCH 5460/7878] Add the PR reference. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@279728 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index ed8eaf9f5b4..b59606d6682 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,7 @@ Changes for APR 1.3.0 *) Fix apr_socket_addr_get(,APR_REMOTE,) after a non-blocking - connection is completed. [Joe Orton] + connection is completed. PR 32737. [Joe Orton] *) Add apr_sockaddr_ip_getbuf() function. [Joe Orton] From c94583e14bbee2358a5ec08ad4d743656737a06c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 9 Sep 2005 16:39:42 +0000 Subject: [PATCH 5461/7878] Add a thought bubble. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@279812 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/STATUS b/STATUS index f717bafa8e0..4a348a58285 100644 --- a/STATUS +++ b/STATUS @@ -67,6 +67,9 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Someone needs to port testucs to Unix. Right now it only works on Windows. + OtherBill asks; should we have a test/arch/xxx tree? + The ucs implementation is an internal for + unicode/utf-8 win32isms. * The return type of a thread function (void *) is inconsistent with the type used in apr_thread_exit()/apr_thread_join() (apr_status_t). From 45decd41a0d71a7c7b0d99e5d6c489a6bfa984da Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Sat, 10 Sep 2005 02:33:54 +0000 Subject: [PATCH 5462/7878] * include/apr_file_io.h (apr_file_open_stdout, apr_file_open_stdin): fix doxygen comments. Submitted By: Colm MacCarthaigh git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@279935 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 847ecb044fa..42078a68ec7 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -309,7 +309,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, * @param thefile The apr file to use as stdout. * @param pool The pool to allocate the file out of. * - * @remark See remarks for apr_file_open_stdout. + * @remark See remarks for apr_file_open_stderr. */ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *pool); @@ -319,7 +319,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, * @param thefile The apr file to use as stdin. * @param pool The pool to allocate the file out of. * - * @remark See remarks for apr_file_open_stdout. + * @remark See remarks for apr_file_open_stderr. */ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool); From cb4dd1be9e8f5ddf371e638f9e74337afd168fbc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 13 Sep 2005 02:43:59 +0000 Subject: [PATCH 5463/7878] The apr_dso tests are borked on win32, begin by choosing a '.dll' file, and ensure that once we decide the symbol deref has failed, it's absolutely pointless to both to call NULL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@280463 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/test/testdso.c b/test/testdso.c index 5187cdd256e..2417966477a 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -30,8 +30,10 @@ #ifdef NETWARE # define MOD_NAME "mod_test.nlm" -#elif defined(BEOS) || defined(WIN32) +#elif defined(BEOS) # define MOD_NAME "mod_test.so" +#elif defined(WIN32) +# define MOD_NAME "mod_test.dll" #elif defined(DARWIN) # define MOD_NAME ".libs/mod_test.so" # define LIB_NAME ".libs/libmod_test.dylib" @@ -78,9 +80,11 @@ static void test_dso_sym(abts_case *tc, void *data) ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, func1); - function = (void (*)(char *))func1; - (*function)(teststr); - ABTS_STR_EQUAL(tc, "Hello - I'm a DSO!\n", teststr); + if (!tc->failed) { + function = (void (*)(char *))func1; + (*function)(teststr); + ABTS_STR_EQUAL(tc, "Hello - I'm a DSO!\n", teststr); + } apr_dso_unload(h); } @@ -101,9 +105,11 @@ static void test_dso_sym_return_value(abts_case *tc, void *data) ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, func1); - function = (int (*)(int))func1; - status = (*function)(5); - ABTS_INT_EQUAL(tc, 5, status); + if (!tc->failed) { + function = (int (*)(int))func1; + status = (*function)(5); + ABTS_INT_EQUAL(tc, 5, status); + } apr_dso_unload(h); } @@ -160,9 +166,11 @@ static void test_dso_sym_library(abts_case *tc, void *data) ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, func1); - function = (void (*)(char *))func1; - (*function)(teststr); - ABTS_STR_EQUAL(tc, "Hello - I'm a DSO!\n", teststr); + if (!tc->failed) { + function = (void (*)(char *))func1; + (*function)(teststr); + ABTS_STR_EQUAL(tc, "Hello - I'm a DSO!\n", teststr); + } apr_dso_unload(h); } @@ -183,9 +191,11 @@ static void test_dso_sym_return_value_library(abts_case *tc, void *data) ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, func1); - function = (int (*)(int))func1; - status = (*function)(5); - ABTS_INT_EQUAL(tc, 5, status); + if (!tc->failed) { + function = (int (*)(int))func1; + status = (*function)(5); + ABTS_INT_EQUAL(tc, 5, status); + } apr_dso_unload(h); } From 6d87449ec34e8f12c76c6cba851fc03c52de62a1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 13 Sep 2005 02:47:10 +0000 Subject: [PATCH 5464/7878] I noted that we didn't test the is_dev flag. Do so. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@280465 13f79535-47bb-0310-9956-ffa450edef68 --- test/testvsn.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/testvsn.c b/test/testvsn.c index 1840b7ac5cc..96bba669d8a 100644 --- a/test/testvsn.c +++ b/test/testvsn.c @@ -26,6 +26,12 @@ static void test_strings(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, APR_VERSION_STRING, apr_version_string()); } +#ifdef APR_IS_DEV_VERSION +# define IS_DEV 1 +#else +# define IS_DEV 0 +#endif + static void test_ints(abts_case *tc, void *data) { apr_version_t vsn; @@ -35,6 +41,7 @@ static void test_ints(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_MAJOR_VERSION, vsn.major); ABTS_INT_EQUAL(tc, APR_MINOR_VERSION, vsn.minor); ABTS_INT_EQUAL(tc, APR_PATCH_VERSION, vsn.patch); + ABTS_INT_EQUAL(tc, IS_DEV, vsn.is_dev); } abts_suite *testvsn(abts_suite *suite) From b2925c03ef7c5d62e7a42e4275e063713350e5aa Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 13 Sep 2005 02:50:22 +0000 Subject: [PATCH 5465/7878] It's not possible anymore to keep these in sync, we've already thrown away compatibility by becoming addicted to libtool. Give it up already, and insist that the libtool addicts keep our Makefile.win in sync. Syrro git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@280467 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.awk | 53 ---------------- test/Makefile.win | 133 +++++++++++++++++++++++------------------ test/aprtest.dsp | 4 -- 3 files changed, 75 insertions(+), 115 deletions(-) delete mode 100644 test/MakeWin32Make.awk diff --git a/test/MakeWin32Make.awk b/test/MakeWin32Make.awk deleted file mode 100644 index c5529f8ffda..00000000000 --- a/test/MakeWin32Make.awk +++ /dev/null @@ -1,53 +0,0 @@ -{ - - if (match($0, /\@INCLUDE_RULES\@/ ) ) { - print "ALL: \$(TARGETS)"; - print ""; - print "CL = cl.exe"; - print "LINK = link.exe /nologo /debug /machine:I386 /subsystem:console /incremental:no "; - print ""; - print "CFLAGS = /nologo /c /MDd /W3 /Gm /GX /Zi /Od /D _DEBUG /D WIN32 /D APR_DECLARE_STATIC /FD "; - print ""; - print ".c.obj::"; - $0 = "\t\$(CL) -c \$< \$(CFLAGS) \$(INCLUDES)"; - } - if ( match( $0, /^ALL_LIBS=/ ) ) { - $0 = ""; - } - if ( match( $0, /^LOCAL_LIBS=/ ) ) { - print "LOCAL_LIBS= ../LibD/apr.lib "; - print "ALL_LIBS= kernel32\.lib user32\.lib advapi32\.lib Rpcrt4\.lib ws2_32\.lib wsock32\.lib ole32\.lib "; - $0 = "" - } - if ( match( $0, /\@CFLAGS\@/ ) ) { - $0 = ""; - } - gsub( /\$\([^\)]* [^\)]*\)/, "", $0 ); - gsub( /\$\{LD_FLAGS\}/, "", $0 ); - gsub( /\.\.\/libapr\.la/, "../LibD/apr.lib", $0 ); - gsub( /\@RM\@/, "del", $0 ); - if (gsub( /\$\(RM\) -f/, "del" ) ) { - gsub( /\*\.a/, "*.lib *.exp *.idb *.ilk *.pdb", $0 ); - gsub( /Makefile/, "Makefile *.ncb *.opt", $0 ); - } - gsub( /\@CC\@/, "cl", $0); - gsub( /\@RANLIB\@/, "", $0); - gsub( /-I\$\(INCDIR\)/, "/I \"$(INCDIR)\"", $0); - - gsub( /\.\.\/libapr\.a/, "../LibD/apr.lib", $0 ); - if ( gsub( /\@EXEEXT\@/, ".exe", $0 ) ) { - gsub( /\$\(CC\) \$\(CFLAGS\)/, "\$\(LINK\) /subsystem:console", $0 ); - gsub( /-o (\S+)/, "/out:\"$1\"", $0 ); - gsub( /--export-dynamic /, "", $0 ); - gsub( /-fPIC /, "", $0 ); - } - if ( gsub( /-shared/, "/subsystem:windows /dll", $0 ) ) { - gsub( /-o (\S+)/ "/out:\"$1\"", $0 ); - } - gsub( /\$\(NONPORTABLE\)/, "", $0 ); - gsub( /\.a /, ".lib ", $0 ); - gsub( /\.o /, ".obj ", $0 ); - gsub( /\.lo /, ".obj ", $0 ); - - print $0; -} diff --git a/test/Makefile.win b/test/Makefile.win index 7e5644e9b14..c1a352d21a2 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -1,101 +1,118 @@ - -LINK=link /nologo - -PROGRAMS = \ - globalmutexchild.exe \ - sendfile.exe \ - proc_child.exe \ - tryread.exe \ - occhild.exe \ - readchild.exe \ - sockchild.exe \ +# PROGRAMS includes all test programs built on this platform. +# STDTEST_PORTABLE +# test programs invoked via standard user interface, run on all platforms +# STDTEST_NONPORTABLE +# test programs invoked via standard user interface, not portable +# OTHER_PROGRAMS +# programs such as sendfile, that have to be invoked in a special sequence +# or with special parameters + +STDTEST_PORTABLE = \ testlockperf.exe \ testshmproducer.exe \ testshmconsumer.exe \ testmutexscope.exe \ - testall.exe \ - mod_test.so + testall.exe + +OTHER_PROGRAMS = sendfile.exe +PROGRAMS = $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS) TARGETS = $(PROGRAMS) -LOCAL_LIBS=..\LibD\apr-1.lib -ALL_LIBS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib +# bring in rules.mk for standard functionality +ALL: $(TARGETS) -CLEAN_TARGETS = mod_test.lib mod_test.exp +CL = cl.exe -INCDIR=../include -INCLUDES=/I "$(INCDIR)" +CFLAGS = /nologo /c /MDd /W3 /Gm /GX /Zi /Od /D _DEBUG /D WIN32 /D APR_DECLARE_STATIC /FD -all: $(TARGETS) +.c.obj:: + $(CL) -c $< $(CFLAGS) $(INCLUDES) -clean: - -del $(CLEAN_TARGETS) $(PROGRAMS) *.obj *.pdb *.ilk 2>NUL +LOCAL_LIBS= ../LibD/apr-1.lib +ALL_LIBS= kernel32.lib user32.lib advapi32.lib Rpcrt4.lib ws2_32.lib wsock32.lib ole32.lib -.c.obj: - cl /nologo /c /MDd /W3 /GX /Zi /Od /DWIN32 /D_DEBUG /D_WINDOWS /DAPR_DECLARE_STATIC $(INCLUDES) $< -tryread.exe: tryread.obj $(LOCAL_LIBS) - $(LINK) tryread.obj $(LOCAL_LIBS) $(ALL_LIBS) +CLEAN_TARGETS = testfile.tmp mod_test.dll proc_child.exe occhild.exe \ + readchild.exe tryread.exe sockchild.exe \ + globalmutexchild.exe lfstests/large.bin \ + data/testputs.txt data/testbigfprintf.dat data/testwritev.txt \ + data/testwritev_full.txt +CLEAN_SUBDIRS = internal + +INCDIR=../include +INCLUDES=/I "$(INCDIR)" + +# link programs using -no-install to get real executables not +# libtool wrapper scripts which link an executable when first run. +LINK_PROG = link.exe /nologo /debug /machine:I386 /subsystem:console /incremental:no +LINK_LIB = link.exe /nologo /dll /debug /machine:I386 /subsystem:windows /incremental:no + +check: $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) + for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \ + ./$$prog; \ + if test $$? = 255; then \ + echo "$$prog failed"; \ + break; \ + fi; \ + done occhild.exe: occhild.obj $(LOCAL_LIBS) - $(LINK) occhild.obj $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) occhild.obj $(LOCAL_LIBS) $(ALL_LIBS) + +sockchild.exe: sockchild.obj $(LOCAL_LIBS) + $(LINK_PROG) sockchild.obj $(LOCAL_LIBS) $(ALL_LIBS) readchild.exe: readchild.obj $(LOCAL_LIBS) - $(LINK) readchild.obj $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) readchild.obj $(LOCAL_LIBS) $(ALL_LIBS) + +globalmutexchild.exe: globalmutexchild.obj $(LOCAL_LIBS) + $(LINK_PROG) globalmutexchild.obj $(LOCAL_LIBS) $(ALL_LIBS) + +tryread.exe: tryread.obj $(LOCAL_LIBS) + $(LINK_PROG) tryread.obj $(LOCAL_LIBS) $(ALL_LIBS) proc_child.exe: proc_child.obj $(LOCAL_LIBS) - $(LINK) /debug /subsystem:console /machine:I386 \ - proc_child.obj $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) proc_child.obj $(LOCAL_LIBS) $(ALL_LIBS) -# FIXME: This is BS ... we should deal with namespace decoration within the -# apr_dso_sym() function or within the test (take y'r pick) since many platforms -# have decoration and decoration issues. -mod_test.so: mod_test.obj - $(LINK) mod_test.obj /dll /out:mod_test.so $(LOCAL_LIBS) $(ALL_LIBS) \ - /export:print_hello /export:count_reps +# FIXME: -prefer-pic is only supported with libtool-1.4+ +mod_test.dll: mod_test.obj + $(LINK_LIB) mod_test.obj /export:print_hello /export:count_reps $(LOCAL_LIBS) $(ALL_LIBS) testlockperf.exe: testlockperf.obj $(LOCAL_LIBS) - $(LINK) testlockperf.obj $(LOCAL_LIBS) $(ALL_LIBS) - -sockchild.exe: sockchild.obj $(LOCAL_LIBS) - $(LINK) sockchild.obj $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testlockperf.obj $(LOCAL_LIBS) $(ALL_LIBS) sendfile.exe: sendfile.obj $(LOCAL_LIBS) - $(LINK) sendfile.obj $(LOCAL_LIBS) $(ALL_LIBS) - -testshm.exe: testshm.obj $(LOCAL_LIBS) testshmproducer.exe testshmconsumer.exe - $(LINK) testshm.obj $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) sendfile.obj $(LOCAL_LIBS) $(ALL_LIBS) testshmproducer.exe: testshmproducer.obj $(LOCAL_LIBS) - $(LINK) testshmproducer.obj $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testshmproducer.obj $(LOCAL_LIBS) $(ALL_LIBS) testshmconsumer.exe: testshmconsumer.obj $(LOCAL_LIBS) - $(LINK) testshmconsumer.obj $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testshmconsumer.obj $(LOCAL_LIBS) $(ALL_LIBS) testprocmutex.exe: testprocmutex.obj $(LOCAL_LIBS) - $(LINK) testprocmutex.obj $(LOCAL_LIBS) $(ALL_LIBS) - -globalmutexchild.exe: globalmutexchild.obj $(LOCAL_LIBS) - $(LINK) globalmutexchild.obj $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testprocmutex.obj $(LOCAL_LIBS) $(ALL_LIBS) testmutexscope.exe: testmutexscope.obj $(LOCAL_LIBS) - $(LINK) testmutexscope.obj $(LOCAL_LIBS) $(ALL_LIBS) + $(LINK_PROG) testmutexscope.obj $(LOCAL_LIBS) $(ALL_LIBS) -TESTS = abts.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ +TESTS = testutil.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testmmap.obj testud.obj testtable.obj testsleep.obj testpools.obj \ testfmt.obj testfile.obj testdir.obj testfileinfo.obj testrand.obj \ testdso.obj testoc.obj testdup.obj testsockets.obj testproc.obj \ testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \ testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj \ - testatomic.obj testflock.obj testshm.obj testsock.obj \ - testglobalmutex.obj teststrnatcmp.obj testfilecopy.obj \ - testtemp.obj testlfs.obj testutil.obj - -testall.exe: $(TESTS) $(LOCAL_LIBS) - $(LINK) /debug /subsystem:console /machine:I386 /out:$@ $(TESTS) \ - $(LOCAL_LIBS) $(ALL_LIBS) + testatomic.obj testflock.obj testshm.obj testsock.obj testglobalmutex.obj \ + teststrnatcmp.obj testfilecopy.obj testtemp.obj testlfs.obj + +testall.exe: $(TESTS) mod_test.dll occhild.exe \ + readchild.exe abts.obj proc_child.exe \ + tryread.exe sockchild.exe globalmutexchild.exe \ + $(LOCAL_LIBS) + $(LINK_PROG) /out:testall.exe $(TESTS) abts.obj $(LOCAL_LIBS) $(ALL_LIBS) # DO NOT REMOVE diff --git a/test/aprtest.dsp b/test/aprtest.dsp index e31b898d0d2..9d6994f5f0a 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -191,9 +191,5 @@ SOURCE=.\Makefile SOURCE=.\Makefile.in # End Source File -# Begin Source File - -SOURCE=.\MakeWin32Make.awk -# End Source File # End Target # End Project From 40ff273d02804a6b9a57981d65a6c1e98bf631f3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 13 Sep 2005 02:52:00 +0000 Subject: [PATCH 5466/7878] The -v message is really wrong, here. Failure to support sparse files is irrelevant to if LARGEFILES is defined. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@280469 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlfs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/testlfs.c b/test/testlfs.c index e603968e632..ec3139d20ec 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -26,7 +26,12 @@ /* Only enable these tests by default on platforms which support sparse * files... just Unixes? */ -#if APR_HAS_LARGE_FILES && !defined(WIN32) && !defined(OS2) && !defined(NETWARE) +#if defined(WIN32) || !defined(OS2) || !defined(NETWARE) +static void test_nolfs(abts_case *tc, void *data) +{ + ABTS_NOT_IMPL(tc, "Large Files tests require Sparse file support"); +} +#elif APR_HAS_LARGE_FILES && #define USE_LFS_TESTS /* Tests which create an 8Gb sparse file and then check it can be used From cdd05157dd491979112da0b5c2d9c5924e36a727 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 13 Sep 2005 02:53:22 +0000 Subject: [PATCH 5467/7878] Lots of new, missing files in the .dsp 'pictorial' representation, add all the source files from the test/ tree. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@280471 13f79535-47bb-0310-9956-ffa450edef68 --- test/testall.dsp | 66 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/test/testall.dsp b/test/testall.dsp index 2b971d94527..8689b8773ec 100644 --- a/test/testall.dsp +++ b/test/testall.dsp @@ -83,11 +83,43 @@ CFG=testall - Win32 Debug # Begin Source File +SOURCE=.\abts.c +# End Source File +# Begin Source File + +SOURCE=.\globalmutexchild.c +# End Source File +# Begin Source File + SOURCE=.\Makefile.win # End Source File # Begin Source File -SOURCE=.\testall.c +SOURCE=.\mod_test.c +# End Source File +# Begin Source File + +SOURCE=.\nw_misc.c +# End Source File +# Begin Source File + +SOURCE=.\occhild.c +# End Source File +# Begin Source File + +SOURCE=.\proc_child.c +# End Source File +# Begin Source File + +SOURCE=.\readchild.c +# End Source File +# Begin Source File + +SOURCE=.\sendfile.c +# End Source File +# Begin Source File + +SOURCE=.\sockchild.c # End Source File # Begin Source File @@ -115,10 +147,18 @@ SOURCE=.\testdup.c # End Source File # Begin Source File +SOURCE=.\testenv.c +# End Source File +# Begin Source File + SOURCE=.\testfile.c # End Source File # Begin Source File +SOURCE=.\testfilecopy.c +# End Source File +# Begin Source File + SOURCE=.\testfileinfo.c # End Source File # Begin Source File @@ -131,6 +171,10 @@ SOURCE=.\testfmt.c # End Source File # Begin Source File +SOURCE=.\testfnmatch.c +# End Source File +# Begin Source File + SOURCE=.\testglobalmutex.c # End Source File # Begin Source File @@ -143,6 +187,10 @@ SOURCE=.\testipsub.c # End Source File # Begin Source File +SOURCE=.\testlfs.c +# End Source File +# Begin Source File + SOURCE=.\testlock.c # End Source File # Begin Source File @@ -231,10 +279,18 @@ SOURCE=.\teststr.c # End Source File # Begin Source File +SOURCE=.\teststrnatcmp.c +# End Source File +# Begin Source File + SOURCE=.\testtable.c # End Source File # Begin Source File +SOURCE=.\testtemp.c +# End Source File +# Begin Source File + SOURCE=.\testthread.c # End Source File # Begin Source File @@ -251,7 +307,15 @@ SOURCE=.\testuser.c # End Source File # Begin Source File +SOURCE=.\testutil.c +# End Source File +# Begin Source File + SOURCE=.\testvsn.c # End Source File +# Begin Source File + +SOURCE=.\tryread.c +# End Source File # End Target # End Project From e2709665c856fec485c9e0a193c006b81b7f660c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 16 Sep 2005 16:53:23 +0000 Subject: [PATCH 5468/7878] * test/testlfs.c: Fix cpp tests broken in r280469. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@289608 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testlfs.c b/test/testlfs.c index ec3139d20ec..39bef61e0dc 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -26,12 +26,12 @@ /* Only enable these tests by default on platforms which support sparse * files... just Unixes? */ -#if defined(WIN32) || !defined(OS2) || !defined(NETWARE) +#if defined(WIN32) || defined(OS2) || defined(NETWARE) static void test_nolfs(abts_case *tc, void *data) { ABTS_NOT_IMPL(tc, "Large Files tests require Sparse file support"); } -#elif APR_HAS_LARGE_FILES && +#elif APR_HAS_LARGE_FILES #define USE_LFS_TESTS /* Tests which create an 8Gb sparse file and then check it can be used From b95cb0278a464932449ab6ff091ce37306201300 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 19 Sep 2005 17:42:01 +0000 Subject: [PATCH 5469/7878] Note things fixed in the coming 1.2.2 release, distinct from 1.3-only fixes. Please review for backports not yet documented. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@290210 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index b59606d6682..408b96a46f9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,5 @@ Changes for APR 1.3.0 - *) Fix apr_socket_addr_get(,APR_REMOTE,) after a non-blocking - connection is completed. PR 32737. [Joe Orton] - *) Add apr_sockaddr_ip_getbuf() function. [Joe Orton] *) Fix handling of %pI in apr_psprintf. [Joe Orton] @@ -21,8 +18,16 @@ Changes for APR 1.3.0 _exit() not exit() to avoid running atexit()-registered functions in the child. PR 30913. [Joe Orton] - *) Fix error handling where apr_uid_* and apr_gid_* could return - APR_SUCCESS in failure cases. [Joe Orton] + *) Add %pm support to apr_snprintf() for printing the error string + corresponding to an apr_status_t value. [Joe Orton] + + *) Add APR_ARRAY_IDX() and APR_ARRAY_PUSH() convenience macros to + apr_tables.h. [Garrett Rooney] + +Changes for APR 1.2.2 + + *) Fix apr_socket_addr_get(,APR_REMOTE,) after a non-blocking + connection is completed. PR 32737. [Joe Orton] *) Fix apr_file_gets() and apr_file_read() to catch write failures when flushing pending writes for a buffered file. [Joe Orton] @@ -30,11 +35,8 @@ Changes for APR 1.3.0 *) Fix apr_file_write() infinite loop on write failure for buffered files. [Erik Huelsmann ] - *) Add %pm support to apr_snprintf() for printing the error string - corresponding to an apr_status_t value. [Joe Orton] - - *) Add APR_ARRAY_IDX() and APR_ARRAY_PUSH() convenience macros to - apr_tables.h. [Garrett Rooney] + *) Fix error handling where apr_uid_* and apr_gid_* could return + APR_SUCCESS in failure cases. PR 34053 continued. [Joe Orton] Changes for APR 1.2.1 From 10e423a507dfeeeeaa939a7a159f2807c9007e2e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 19 Sep 2005 17:53:24 +0000 Subject: [PATCH 5470/7878] Synch with 1.2.x branch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@290216 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 408b96a46f9..c8e523f21ce 100644 --- a/CHANGES +++ b/CHANGES @@ -26,6 +26,12 @@ Changes for APR 1.3.0 Changes for APR 1.2.2 + *) Fix apr_socket_opt_set() issue where TCP_NODELAY would be + set when TCP_DEFER_ACCEPT was set. [Brian Pane] + + *) Allow TCP_NODELAY and TCP_CORK to be set concurrently on + Linux 2.6 and later. [Joe Orton] + *) Fix apr_socket_addr_get(,APR_REMOTE,) after a non-blocking connection is completed. PR 32737. [Joe Orton] From 7b3473b7b65314498c0be16a3fda787cd3b57df4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 19 Sep 2005 17:58:55 +0000 Subject: [PATCH 5471/7878] Better ignore'd git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@290220 13f79535-47bb-0310-9956-ffa450edef68 From fdbd0fa29d17885731b8eb0d91bb6b88f107b379 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Tue, 20 Sep 2005 07:39:57 +0000 Subject: [PATCH 5472/7878] When converting V4MAPPED IPv6 addresses to IPv4 (by dropping the leading "::ffff:"), be sure to also copy the trailing NIL character, or we'll end up with strings like "172.25.124.236124.236" (note the appended "124.236"). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@290387 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index da95b0698c2..60121ca09ee 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -114,7 +114,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_getbuf(char *buf, apr_size_t buflen, * IPv4 format. */ memmove(buf, buf + strlen("::ffff:"), - strlen(buf + strlen("::ffff:"))); + strlen(buf + strlen("::ffff:"))+1); } #endif /* ensure NUL termination if the buffer is too short */ From e102ba48e347c0d08e20e06ffc063b9f3404162a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 20 Sep 2005 08:35:57 +0000 Subject: [PATCH 5473/7878] * test/testsock.c (test_print_addr): Add regression test for v4-mapped address handling bug in apr_sockaddr_ip_getbuf (thanks Martin for fixing it!). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@290399 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/testsock.c b/test/testsock.c index 1e022e9393a..77ca4fa65ee 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -215,6 +215,20 @@ static void test_print_addr(abts_case *tc, void *data) s = apr_psprintf(p, "foo %pI bar", sa); ABTS_STR_EQUAL(tc, "foo 0.0.0.0:80 bar", s); + +#if APR_HAVE_IPV6 + if (apr_sockaddr_info_get(&sa, "::ffff:0.0.0.0", APR_INET6, 80, 0, p) == APR_SUCCESS) { + /* sa should now be a v4-mapped IPv6 address. */ + char buf[128]; + + memset(buf, 'z', sizeof buf); + + APR_ASSERT_SUCCESS(tc, "could not get IP address", + apr_sockaddr_ip_getbuf(buf, 22, sa)); + + ABTS_STR_EQUAL(tc, "0.0.0.0", buf); + } +#endif } static void test_get_addr(abts_case *tc, void *data) From 9c88a31f30e66f3099c046b489db97f4c46a36b5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 21 Sep 2005 18:05:53 +0000 Subject: [PATCH 5474/7878] Win32: fix apr_proc_mutex_trylock() to handle WAIT_TIMEOUT, returning APR_EBUSY. Submitted by: Ronen Mizrahi Reviewed by: wrowe, Henry Jen git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@290766 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ locks/win32/proc_mutex.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index c8e523f21ce..9b57ed7dfdb 100644 --- a/CHANGES +++ b/CHANGES @@ -26,6 +26,9 @@ Changes for APR 1.3.0 Changes for APR 1.2.2 + *) Win32: fix apr_proc_mutex_trylock() to handle WAIT_TIMEOUT, + returning APR_EBUSY. [Ronen Mizrahi ] + *) Fix apr_socket_opt_set() issue where TCP_NODELAY would be set when TCP_DEFER_ACCEPT was set. [Brian Pane] diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 9e316506a9f..8a9026e4685 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -144,6 +144,9 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) if (rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) { return APR_SUCCESS; + } + else if (rv == WAIT_TIMEOUT) { + return APR_EBUSY; } return apr_get_os_error(); } From 82dc945ca667c53052f5453e23c3837d53fca0d7 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 21 Sep 2005 21:54:38 +0000 Subject: [PATCH 5475/7878] Add the DBD APIs to the NetWare export list git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@290841 13f79535-47bb-0310-9956-ffa450edef68 --- build/nw_export.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/build/nw_export.inc b/build/nw_export.inc index 91c177a1edc..89583d90f39 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -61,6 +61,7 @@ #include "apr_base64.h" #include "apr_buckets.h" #include "apr_date.h" +#include "apr_dbd.h" #include "apr_dbm.h" #include "apr_hooks.h" #include "apr_ldap.h" From 24e5e7b702bfd34ca57e746592dcfcb039a34444 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 24 Sep 2005 22:09:35 +0000 Subject: [PATCH 5476/7878] * file_io/unix/dir.c (apr_dir_make_recursive): Fix infinite recursion if mkdir fails for all path components. * test/testdir.c (test_rmkdir_nocwd): Add test case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@291339 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 5 +++++ test/testdir.c | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index eed7f3a41b4..849e89d7ef4 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -312,6 +312,11 @@ apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, char *dir; dir = path_remove_last_component(path, pool); + /* If there is no path left, give up. */ + if (dir[0] == '\0') { + return apr_err; + } + apr_err = apr_dir_make_recursive(dir, perm, pool); if (!apr_err) diff --git a/test/testdir.c b/test/testdir.c index bc2ca9ae69b..f59e3e60e56 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -219,6 +219,30 @@ static void test_uncleared_errno(abts_case *tc, void *data) } +static void test_rmkdir_nocwd(abts_case *tc, void *data) +{ + char *cwd, *path; + + APR_ASSERT_SUCCESS(tc, "make temp dir", + apr_dir_make("dir3", APR_OS_DEFAULT, p)); + + APR_ASSERT_SUCCESS(tc, "obtain cwd", apr_filepath_get(&cwd, 0, p)); + + APR_ASSERT_SUCCESS(tc, "determine path to temp dir", + apr_filepath_merge(&path, cwd, "dir3", 0, p)); + + APR_ASSERT_SUCCESS(tc, "change to temp dir", apr_filepath_set(path, p)); + + APR_ASSERT_SUCCESS(tc, "remove temp dir", apr_dir_remove(path, p)); + + ABTS_ASSERT(tc, "fail to create dir", + apr_dir_make_recursive("foobar", APR_OS_DEFAULT, + p) != APR_SUCCESS); + + APR_ASSERT_SUCCESS(tc, "restore cwd", apr_filepath_set(cwd, p)); +} + + abts_suite *testdir(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -230,6 +254,7 @@ abts_suite *testdir(abts_suite *suite) abts_run_test(suite, test_removeall, NULL); abts_run_test(suite, test_remove_notthere, NULL); abts_run_test(suite, test_mkdir_twice, NULL); + abts_run_test(suite, test_rmkdir_nocwd, NULL); abts_run_test(suite, test_rewind, NULL); From e6c62226a88b89524055d8ae565adbea99e0c364 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 26 Sep 2005 23:39:22 +0000 Subject: [PATCH 5477/7878] Fix some status dates on trunk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@291786 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/STATUS b/STATUS index 4a348a58285..56d9f04bfab 100644 --- a/STATUS +++ b/STATUS @@ -4,11 +4,13 @@ Last modified at [$Date$] Releases: Standalone - 1.2.1 : released August 17, 2005 - 1.2.0 : tagged July 19, 2005 + 1.3.0 : in development + 1.2.2 : tagged September 26, 2005 + 1.2.1 : released August 18, 2005 + 1.2.0 : not released 1.1.1 : released March 17, 2005 1.1.0 : released January 25, 2005 - 1.0.1 : released November 18, 2004 + 1.0.1 : released November 19, 2004 1.0.0 : released September 1, 2004 0.9.5 : released November 19, 2004 0.9.4 : released September 25, 2003 @@ -29,7 +31,7 @@ Bundled with httpd 2.0a1 : released March 10, 2000 -RELEASE 1.0.1 SHOWSTOPPERS: +RELEASE SHOWSTOPPERS: CURRENT VOTES: From 82ddffcb617b5dd3fd00f2cea6346e7bb521a660 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 27 Sep 2005 00:13:30 +0000 Subject: [PATCH 5478/7878] Sync to 0.9.x STATUS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@291796 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 56d9f04bfab..64d34b03c40 100644 --- a/STATUS +++ b/STATUS @@ -12,9 +12,11 @@ Standalone 1.1.0 : released January 25, 2005 1.0.1 : released November 19, 2004 1.0.0 : released September 1, 2004 + 0.9.7 : tagged September 26, 2005 + 0.9.6 : released February 4, 2005 0.9.5 : released November 19, 2004 0.9.4 : released September 25, 2003 - 0.9.3 : tagged March 30, 2003 + 0.9.3 : released April 3, 2003 0.9.2 : released March 22, 2003 0.9.1 : released September 11, 2002 0.9.0 : released August 28, 2002 From fedb2ffcabdecd38000cf506dbbaae3a3a1b75bc Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 27 Sep 2005 12:54:24 +0000 Subject: [PATCH 5479/7878] * test/testdir.c (test_rmkdir_nocwd): Avoid failures on platforms where directories in use cannot be removed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@291925 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdir.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/test/testdir.c b/test/testdir.c index f59e3e60e56..0e5cc51e041 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -222,6 +222,7 @@ static void test_uncleared_errno(abts_case *tc, void *data) static void test_rmkdir_nocwd(abts_case *tc, void *data) { char *cwd, *path; + apr_status_t rv; APR_ASSERT_SUCCESS(tc, "make temp dir", apr_dir_make("dir3", APR_OS_DEFAULT, p)); @@ -233,13 +234,20 @@ static void test_rmkdir_nocwd(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "change to temp dir", apr_filepath_set(path, p)); - APR_ASSERT_SUCCESS(tc, "remove temp dir", apr_dir_remove(path, p)); - - ABTS_ASSERT(tc, "fail to create dir", - apr_dir_make_recursive("foobar", APR_OS_DEFAULT, - p) != APR_SUCCESS); + rv = apr_dir_remove(path, p); + /* Some platforms cannot remove a directory which is in use. */ + if (rv == APR_SUCCESS) { + ABTS_ASSERT(tc, "fail to create dir", + apr_dir_make_recursive("foobar", APR_OS_DEFAULT, + p) != APR_SUCCESS); + } APR_ASSERT_SUCCESS(tc, "restore cwd", apr_filepath_set(cwd, p)); + + if (rv) { + apr_dir_remove(path, p); + ABTS_NOT_IMPL(tc, "cannot remove in-use directory"); + } } From f12f222a29fd7f03c83ad0dc52186d9ceb7aeb7e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 27 Sep 2005 15:14:37 +0000 Subject: [PATCH 5480/7878] * include/arch/unix/apr_arch_file_io.h: Define APR_USE_READDIR64_R to avoid cases where readdir() is used in place of readdir_r even if readdir64_r is available. * file_io/unix/dir.c (apr_dir_read): Use APR_USE_READDIR64_R. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@291973 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 6 +++--- include/arch/unix/apr_arch_file_io.h | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 849e89d7ef4..659a4ed5d91 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -139,7 +139,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, #endif #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && !defined(READDIR_IS_THREAD_SAFE) -#ifdef HAVE_READDIR64_R +#ifdef APR_USE_READDIR64_R struct dirent64 *retent; /* If LFS is enabled and readdir64_r is available, readdir64_r is @@ -210,7 +210,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, #endif #ifdef DIRENT_INODE if (thedir->entry->DIRENT_INODE && thedir->entry->DIRENT_INODE != -1) { -#ifdef HAVE_READDIR64_R +#ifdef APR_USE_READDIR64_R /* If readdir64_r is used, check for the overflow case of trying * to fit a 64-bit integer into a 32-bit integer. */ if (sizeof(apr_ino_t) >= sizeof(retent->DIRENT_INODE) @@ -223,7 +223,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, } #else wanted &= ~APR_FINFO_INODE; -#endif /* HAVE_READDIR64_R */ +#endif /* APR_USE_READDIR64_R */ } #endif /* DIRENT_INODE */ diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index afd72bfe05e..a2ece173a1f 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -121,11 +121,17 @@ typedef struct stat64 struct_stat; typedef struct stat struct_stat; #endif +/* readdir64_r is only used in specific cases: */ +#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ + && !defined(READDIR_IS_THREAD_SAFE) && defined(HAVE_READDIR64_R) +#define APR_USE_READDIR64_R +#endif + struct apr_dir_t { apr_pool_t *pool; char *dirname; DIR *dirstruct; -#ifdef HAVE_READDIR64_R +#ifdef APR_USE_READDIR64_R struct dirent64 *entry; #else struct dirent *entry; From 6f727404c72493ca47b0e258b2a20ef98be257a7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 2 Oct 2005 11:58:55 +0000 Subject: [PATCH 5481/7878] apr_poll() - don't promise to fill in rtnevents if no event was signalled poll() implementation: don't bother filling in rtnevents from uninitialized (accidental) data if no events were signalled git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@293094 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 16 +++++++++------- poll/unix/poll.c | 9 +++++++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index 07d450b6fc9..d708600beca 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -167,17 +167,19 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, /** - * Poll the sockets in the poll structure + * Poll the descriptors in the poll structure * @param aprset The poll structure we will be using. - * @param numsock The number of sockets we are polling - * @param nsds The number of sockets signalled. + * @param numsock The number of descriptors we are polling + * @param nsds The number of descriptors signalled. * @param timeout The amount of time in microseconds to wait. This is - * a maximum, not a minimum. If a socket is signalled, we + * a maximum, not a minimum. If a descriptor is signalled, we * will wake up before this time. A negative number means - * wait until a socket is signalled. - * @remark The number of sockets signalled is returned in the third argument. + * wait until a descriptor is signalled. + * @remark The number of descriptors signalled is returned in the third argument. * This is a blocking call, and it will not return until either a - * socket has been signalled, or the timeout has expired. + * descriptor has been signalled, or the timeout has expired. + * @remark The rtnevents field in the apr_pollfd_t array will only be filled- + * in if the return value is APR_SUCCESS. */ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, apr_int32_t *nsds, diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 5ea846146a4..717522d27de 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -121,8 +121,13 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, i = poll(pollset, num_to_poll, timeout); (*nsds) = i; - for (i = 0; i < num; i++) { - aprset[i].rtnevents = get_revent(pollset[i].revents); + if (i > 0) { /* poll() sets revents only if an event was signalled; + * we don't promise to set rtnevents unless an event + * was signalled + */ + for (i = 0; i < num; i++) { + aprset[i].rtnevents = get_revent(pollset[i].revents); + } } #if !defined(HAVE_VLA) && !defined(HAVE_ALLOCA) From e257e76dde713f7f98a7bc70bf96ff81c6b38314 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 10 Oct 2005 10:44:24 +0000 Subject: [PATCH 5482/7878] Don't pass NULL to execve() for the environment array, resolving a theoretical problem with standards compliance and an actual problem with Purify. Reviewed by: Joe Orton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@312607 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 5631e4c64a6..f7802a44cea 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -326,6 +326,14 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_pool_t *pool) { int i; + const char * const empty_envp[] = {NULL}; + + if (!env) { /* Specs require an empty array instead of NULL; + * Purify will trigger a failure, even if many + * implementations don't. + */ + env = empty_envp; + } new->in = attr->parent_in; new->err = attr->parent_err; From b2f082010e151c07cb52a43015e5da0cb9521d21 Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Wed, 12 Oct 2005 10:09:42 +0000 Subject: [PATCH 5483/7878] Remove the mcast_check_type() check from the multicast code. This check prevents callers from using mSCTP, as well as any future socket types we may support. Rather than expand the list of protocols, remove the check entirely, in-line with the APR policy of making parameter validation the caller's problem. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@314835 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ network_io/unix/multicast.c | 31 ------------------------------- 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/CHANGES b/CHANGES index 9b57ed7dfdb..738cf2cd63c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes for APR 1.3.0 + *) multicast: apr_mcast_*() no longer return APR_ENOTIMPL when invoked + for non-UDP/RAW sockets. The caller is expected to ensure that the + socket-type is suitable for multicast. [Colm MacCarthaigh] + *) Add apr_sockaddr_ip_getbuf() function. [Joe Orton] *) Fix handling of %pI in apr_psprintf. [Joe Orton] diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index 904ee404eec..8f3317ae366 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -26,25 +26,6 @@ #endif #ifdef HAVE_STRUCT_IPMREQ -/* Only UDP and Raw Sockets can be used for Multicast */ -static apr_status_t mcast_check_type(apr_socket_t *sock) -{ - int type; - apr_status_t rv; - - rv = apr_socket_type_get(sock, &type); - - if (rv != APR_SUCCESS) { - return rv; - } - else if (type == SOCK_DGRAM || type == SOCK_RAW) { - return APR_SUCCESS; - } - else { - return APR_ENOTIMPL; - } -} - static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast, apr_sockaddr_t *iface) { @@ -138,12 +119,6 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock, int ip_proto; #endif - rv = mcast_check_type(sock); - - if (rv != APR_SUCCESS) { - return rv; - } - if (source != NULL) { #if MCAST_JOIN_SOURCE_GROUP if (sock_is_ipv6(sock)) @@ -215,12 +190,6 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, { apr_status_t rv = APR_SUCCESS; - rv = mcast_check_type(sock); - - if (rv != APR_SUCCESS) { - return rv; - } - if (sock_is_ipv4(sock)) { if (setsockopt(sock->socketdes, IPPROTO_IP, type, (const void *) &value, sizeof(value)) == -1) { From 0b496dc3f705c7110d4659f1b455a7c55a0f8153 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 12 Oct 2005 10:51:14 +0000 Subject: [PATCH 5484/7878] getnameinfo() may copy the port field around, so initialize it to something to prevent unitialized memory reference warnings with Purify git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@314841 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 60121ca09ee..cef713bccc6 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -606,6 +606,7 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, IN6_IS_ADDR_V4MAPPED(&sockaddr->sa.sin6.sin6_addr)) { struct sockaddr_in tmpsa; tmpsa.sin_family = AF_INET; + tmpsa.sin_port = 0; tmpsa.sin_addr.s_addr = ((apr_uint32_t *)sockaddr->ipaddr_ptr)[3]; #ifdef SIN6_LEN tmpsa.sin_len = sizeof(tmpsa); From 7db6d102af726fcef82170e95a55f837253cd0ea Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Wed, 12 Oct 2005 12:20:05 +0000 Subject: [PATCH 5485/7878] Port r76283, the vformatter logic for unix/readwrite.c to handle arbitrary length strings, to the win32 code; one less test failure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@314856 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 47 ++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 4e36f0eafd6..e1b56ba8ffd 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -474,32 +474,47 @@ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) } } -static int printf_flush(apr_vformatter_buff_t *vbuff) +struct apr_file_printf_data { + apr_vformatter_buff_t vbuff; + apr_file_t *fptr; + char *buf; +}; + +static int file_printf_flush(apr_vformatter_buff_t *buff) { - /* I would love to print this stuff out to the file, but I will - * get that working later. :) For now, just return. - */ - return -1; + struct apr_file_printf_data *data = (struct apr_file_printf_data *)buff; + + if (apr_file_write_full(data->fptr, data->buf, + data->vbuff.curpos - data->buf, NULL)) { + return -1; + } + + data->vbuff.curpos = data->buf; + return 0; } APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) { - int cc; + struct apr_file_printf_data data; va_list ap; - char *buf; - int len; + int count; - buf = malloc(HUGE_STRING_LEN); - if (buf == NULL) { + data.buf = malloc(HUGE_STRING_LEN); + if (data.buf == NULL) { return 0; } + data.vbuff.curpos = data.buf; + data.vbuff.endpos = data.buf + HUGE_STRING_LEN; + data.fptr = fptr; va_start(ap, format); - len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = apr_file_puts(buf, fptr); - va_end(ap); - free(buf); - return (cc == APR_SUCCESS) ? len : -1; -} + count = apr_vformatter(file_printf_flush, + (apr_vformatter_buff_t *)&data, format, ap); + /* apr_vformatter does not call flush for the last bits */ + if (count >= 0) file_printf_flush((apr_vformatter_buff_t *)&data); + va_end(ap); + free(data.buf); + return count; +} From bfdbe6e67e257c29e523e11e026bc0d5e4e926d9 Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Sat, 15 Oct 2005 08:22:41 +0000 Subject: [PATCH 5486/7878] Add apr_file_open_flags_std[err|out|in]() functions, to allow the opening of the standard file descriptors with specific flags set. As a consequence we now also set APR_WRITE and APR_READ as appropriate when using the plain old apr_file_open_std[err|out|in]() functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@321314 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ file_io/os2/open.c | 37 ++++++++++++++++++++++++++++------- file_io/unix/open.c | 39 ++++++++++++++++++++++++++++--------- file_io/win32/open.c | 33 +++++++++++++++++++++++++------ include/apr_file_io.h | 45 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 138 insertions(+), 22 deletions(-) diff --git a/CHANGES b/CHANGES index 738cf2cd63c..1f4ebc9efe9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes for APR 1.3.0 + *) Add apr_file_open_flags_std[err|out|in]() functions. + [Colm MacCarthaigh] + + *) stdio: apr_file_open_std[err|out|in]() functions now set the APR_WRITE + or APR_READ flag as appropriate. [Colm MacCarthaigh] + *) multicast: apr_mcast_*() no longer return APR_ENOTIMPL when invoked for non-UDP/RAW sockets. The caller is expected to ensure that the socket-type is suitable for multicast. [Colm MacCarthaigh] diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 3b9760425c6..ef3bc06ece8 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -213,28 +213,51 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) } -APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, + apr_int32_t flags, + apr_pool_t *pool) { apr_os_file_t fd = 2; - return apr_os_file_put(thefile, &fd, 0, pool); + return apr_os_file_put(thefile, &fd, flags | APR_WRITE, pool); } - -APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, + apr_int32_t flags, + apr_pool_t *pool) { apr_os_file_t fd = 1; - return apr_os_file_put(thefile, &fd, 0, pool); + return apr_os_file_put(thefile, &fd, flags | APR_WRITE, pool); } -APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, + apr_int32_t flags, + apr_pool_t *pool) { apr_os_file_t fd = 0; - return apr_os_file_put(thefile, &fd, 0, pool); + return apr_os_file_put(thefile, &fd, flags | APR_READ, pool); +} + + +APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *pool) +{ + return apr_file_open_flags_stderr(thefile, 0, pool); +} + + +APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *pool) +{ + return apr_file_open_flags_stdout(thefile, 0, pool); +} + + +APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool) +{ + return apr_file_open_flags_stdin(thefile, 0, pool); } APR_POOL_IMPLEMENT_ACCESSOR(file); diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 589c8531405..3e3904ec003 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -262,28 +262,49 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, + apr_int32_t flags, + apr_pool_t *pool) { int fd = STDERR_FILENO; - return apr_os_file_put(thefile, &fd, 0, pool); + return apr_os_file_put(thefile, &fd, flags | APR_WRITE, pool); } -APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, + apr_int32_t flags, + apr_pool_t *pool) { int fd = STDOUT_FILENO; - return apr_os_file_put(thefile, &fd, 0, pool); + return apr_os_file_put(thefile, &fd, flags | APR_WRITE, pool); } -APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, + apr_int32_t flags, + apr_pool_t *pool) { int fd = STDIN_FILENO; - return apr_os_file_put(thefile, &fd, 0, pool); + return apr_os_file_put(thefile, &fd, flags | APR_READ, pool); +} + +APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, + apr_pool_t *pool) +{ + return apr_file_open_flags_stderr(thefile, 0, pool); +} + +APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, + apr_pool_t *pool) +{ + return apr_file_open_flags_stdout(thefile, 0, pool); +} + +APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, + apr_pool_t *pool) +{ + return apr_file_open_flags_stdin(thefile, 0, pool); } APR_IMPLEMENT_INHERIT_SET(file, flags, pool, apr_unix_file_cleanup) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 21b4ba76624..83beb977a60 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -564,7 +564,9 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, + apr_int32_t flags, + apr_pool_t *pool) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -581,11 +583,13 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t return rv; } - return apr_os_file_put(thefile, &file_handle, 0, pool); + return apr_os_file_put(thefile, &file_handle, flags | APR_WRITE, pool); #endif } -APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, + apr_int32_t flags, + apr_pool_t *pool) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -602,11 +606,13 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t return rv; } - return apr_os_file_put(thefile, &file_handle, 0, pool); + return apr_os_file_put(thefile, &file_handle, flags | APR_WRITE, pool); #endif } -APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, + apr_int32_t flags, + apr_pool_t *pool) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -623,10 +629,25 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t * return rv; } - return apr_os_file_put(thefile, &file_handle, 0, pool); + return apr_os_file_put(thefile, &file_handle, flags | APR_READ, pool); #endif } +APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *pool) +{ + return apr_file_open_flags_stderr(thefile, 0, pool); +} + +APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *pool) +{ + return apr_file_open_flags_stdout(thefile, 0, pool); +} + +APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool) +{ + return apr_file_open_flags_stdin(thefile, 0, pool); +} + APR_POOL_IMPLEMENT_ACCESSOR(file); APR_IMPLEMENT_INHERIT_SET(file, flags, pool, file_cleanup) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 42078a68ec7..4c451985157 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -324,6 +324,51 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool); +/** + * open standard error as an apr file pointer, with flags. + * @param thefile The apr file to use as stderr. + * @param flags The flags to open the file with. Only the APR_EXCL, + * APR_BUFFERED, APR_XTHREAD, APR_SHARELOCK, + * APR_SENDFILE_ENABLED and APR_LARGEFILE flags should + * be used. The APR_WRITE flag will be set unconditionally. + * @param pool The pool to allocate the file out of. + * + * @remark See remarks for apr_file_open_stderr. + */ +APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, + apr_int32_t flags, + apr_pool_t *pool); + +/** + * open standard output as an apr file pointer, with flags. + * @param thefile The apr file to use as stdout. + * @param flags The flags to open the file with. Only the APR_EXCL, + * APR_BUFFERED, APR_XTHREAD, APR_SHARELOCK, + * APR_SENDFILE_ENABLED and APR_LARGEFILE flags should + * be used. The APR_WRITE flag will be set unconditionally. + * @param pool The pool to allocate the file out of. + * + * @remark See remarks for apr_file_open_stderr. + */ +APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, + apr_int32_t flags, + apr_pool_t *pool); + +/** + * open standard input as an apr file pointer, with flags. + * @param thefile The apr file to use as stdin. + * @param flags The flags to open the file with. Only the APR_EXCL, + * APR_BUFFERED, APR_XTHREAD, APR_SHARELOCK, + * APR_SENDFILE_ENABLED and APR_LARGEFILE flags should + * be used. The APR_READ flag will be set unconditionally. + * @param pool The pool to allocate the file out of. + * + * @remark See remarks for apr_file_open_stderr. + */ +APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, + apr_int32_t flags, + apr_pool_t *pool); + /** * Read data from the specified file. * @param thefile The file descriptor to read from. From 82517ea2e9ebd74b166dabd0b61affc56bcb61d4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 17 Oct 2005 01:27:50 +0000 Subject: [PATCH 5487/7878] Add a section in the test README file about how to write a test for ABTS. Submitted By: Maxime Petazzoni git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@325831 13f79535-47bb-0310-9956-ffa450edef68 --- test/README | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 3 deletions(-) diff --git a/test/README b/test/README index f387157266a..d1c4feab082 100644 --- a/test/README +++ b/test/README @@ -60,7 +60,7 @@ To run it, run: ./testall Running individual tests ---------------------------------- +------------------------ It is not possible to build individual tests, however it is possible to run individual tests. When running the test suite, specify the name of the @@ -146,8 +146,107 @@ To add a new Suite to the full driver, you must make a couple of modifications. Once those four things are done, your tests will automatically be added to the suite. -Writing tests -------------- +Writting an ABTS unit test +-------------------------- + +The aim of this quick and dirty Howto is to give a short introduction +to APR (Apache Portable Runtime) unit tests, and how to write +one. During my Google's Summer of Code 2005 project, I discovered a +small bug in the APR-Util's date parsing routines, and I needed to +write a unit test for the fixed code. I decided to write this +documentation because I did not find any. Thanks to Garrett Rooney for +his help on writing the unit test ! + +The APR and APR-Util libraries provide a platform independent API for +software developers. They contain a lot of modules, including network +programming, threads, string and memory management, etc. All these +functions need to be heavily tested so that developers can be sure the +library is reliable. + +The ABTS give APR developers the ability to build a complete test +suite for the bunch of tests they wrote, which can then be ran under +various platforms. In this Howto, I will try teach you how to write an +ABTS unit test. + +As you may probably know, a unit test is a simple routine which tests +a very specific feature of the tested software or library. To build a +unit test, you need three different things : + + * the to-be-tested function, + * the input data that will be given to the function, + * the expected output data. + +The principle of a unit test is very simple : for each entry in your +set of input data, we pass it to our function, fetch what the function +returned and compare it to the corresponding expected output data. Of +course, the more edge cases you can test, the better your input data +set is. + +The ABTS aims to quicken the write of unit test, and make them +available to the whole test suite by providing a set of preprocessor +macros. Adding a unit test to a test suite can be easily done by the +following piece of code : + +abts_suite *testdaterfc(abts_suite *suite) +{ + suite = ADD_SUITE(suite); + abts_run_test(suite, test_date_rfc, NULL); + + return suite; +} + +Where test_date_rfc is the name of the function performing the +test. Writing such a function is, in the light of the explanation I +just gave, pretty much easy too. As I said, we need to check every +entry of our input data set. That gives us a loop. For each loop +iteration, we call our to-be-tested function, grab its result and +compare the returned value with the expected one. + +Test functions must have the following prototype : + +static void my_test_function(abts_case *tc, void *data); + +The comparison step is performed by the ABTS, thus giving the +whole test suite the correct behavior if your unit test fails. Here +comes a list of the available test methods : + +ABTS_INT_EQUAL(tc, a, b) +ABTS_INT_NEQUAL(tc, a, b) +ABTS_STR_EQUAL(tc, a, b) +ABTS_STR_NEQUAL(tc, a, b, c) +ABTS_PTR_NOTNULL(tc, b) +ABTS_PTR_EQUAL(tc, a, b) +ABTS_TRUE(tc, b) +ABTS_FAIL(tc, b) +ABTS_NOT_IMPL(tc, b) +ABTS_ASSERT(tc, a, b) + +The first argument, tc is a reference to the unit test currently +processed by the test suite (passed to your test function). The other +parameters are the data to be tested. For example, the following line +will never make your unit test fail : + +ABTS_INT_EQUAL(tc, 1, 1); + +See, it's easy ! Let's take a look at the complete example : +testdaterfc. We want to test our date string parser. For this, we will +use some chosen date strings (from mail headers for example) written +in various formats but that should all be handled by our function, and +their equivalents in correct RFC822 format. + +The function we want to test returns an apr_time_t}, which will be +directly given as input to the apr_rfc822_date() function, thus +producing the corresponding RFC822 date string. All we need to do +after this is to call the correct test method from the ABTS macros ! + +You can take a look at the apr-util/test/testdaterfc.c file for the +complete source code of this unit test. + +Although this Howto is very small and mostly dedicated to the +testdaterfc unit test, I hope you'll find it useful. Good luck ! + +Writing tests for CuTest (no longer used) +----------------------------------------- There are a couple of rules for writing good tests for the test suite. From 76ade7e4fb1a8675896510a983226c1b65d4b8a4 Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Tue, 18 Oct 2005 14:48:23 +0000 Subject: [PATCH 5488/7878] Add apr-wide definitions and unix implementation of apr_file_buffer_set() and apr_file_buffer_size_get() functions, to support variable buffer sizes for file handles. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@326116 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ file_io/unix/filedup.c | 6 ++++-- file_io/unix/open.c | 6 ++++-- file_io/unix/readwrite.c | 9 +++++---- include/apr_file_io.h | 21 +++++++++++++++++++ include/arch/unix/apr_arch_file_io.h | 7 +++++-- test/testfile.c | 30 ++++++++++++++++++++++++++++ 7 files changed, 73 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 1f4ebc9efe9..d146ee74cc7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes for APR 1.3.0 + *) Add apr_file_buffer_set() and apr_file_buffer_size_get() functions + to support variable buffer sizes with APR file handles. + [Colm MacCarthaigh] + *) Add apr_file_open_flags_std[err|out|in]() functions. [Colm MacCarthaigh] diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index fdc0358e0a6..877c64922bf 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -62,7 +62,8 @@ static apr_status_t file_dup(apr_file_t **new_file, * got one. */ if ((*new_file)->buffered && !(*new_file)->buffer) { - (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); + (*new_file)->buffer = apr_palloc(p, old_file->bufsize); + (*new_file)->bufsize = old_file->bufsize; } /* this is the way dup() works */ @@ -121,7 +122,8 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, memcpy(*new_file, old_file, sizeof(apr_file_t)); (*new_file)->pool = p; if (old_file->buffered) { - (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); + (*new_file)->buffer = apr_palloc(p, old_file->bufsize); + (*new_file)->bufsize = old_file->bufsize; if (old_file->direction == 1) { memcpy((*new_file)->buffer, old_file->buffer, old_file->bufpos); } diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 3e3904ec003..53ae256a220 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -150,7 +150,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, (*new)->buffered = (flag & APR_BUFFERED) > 0; if ((*new)->buffered) { - (*new)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); + (*new)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); + (*new)->bufsize = APR_FILE_DEFAULT_BUFSIZE; #if APR_HAS_THREADS if ((*new)->flags & APR_XTHREAD) { (*new)->thlock = thlock; @@ -239,7 +240,8 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, #endif if ((*file)->buffered) { - (*file)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); + (*file)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); + (*file)->bufsize = APR_FILE_DEFAULT_BUFSIZE; #if APR_HAS_THREADS if ((*file)->flags & APR_XTHREAD) { apr_status_t rv; diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index d5c66d15edb..131f28cb189 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -70,7 +70,8 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } while (rv == 0 && size > 0) { if (thefile->bufpos >= thefile->dataRead) { - int bytesread = read(thefile->filedes, thefile->buffer, APR_FILE_BUFSIZE); + int bytesread = read(thefile->filedes, thefile->buffer, + thefile->bufsize); if (bytesread == 0) { thefile->eof_hit = TRUE; rv = APR_EOF; @@ -177,11 +178,11 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = 0; while (rv == 0 && size > 0) { - if (thefile->bufpos == APR_FILE_BUFSIZE) /* write buffer is full*/ + if (thefile->bufpos == thefile->bufsize) /* write buffer is full*/ rv = apr_file_flush(thefile); - blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? - APR_FILE_BUFSIZE - thefile->bufpos : size; + blocksize = size > thefile->bufsize - thefile->bufpos ? + thefile->bufsize - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); thefile->bufpos += blocksize; pos += blocksize; diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 4c451985157..0c4a0bfdb8a 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -575,6 +575,27 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p); +/** + * Give the specified apr file handle a new buffer + * @param thefile The file handle that is to be modified + * @param buffer The buffer + * @param bufsize The size of the buffer + * @remark It is possible to add a buffer to previously unbuffered + * file handles, the APR_BUFFERED flag will be added to + * the file handle's flags. Likewise, with buffer=NULL and + * bufsize=0 arguments it is possible to make a previously + * buffered file handle unbuffered. + */ +APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *thefile, + char * buffer, + apr_size_t bufsize); + +/** + * Get the size of any buffer for the specified apr file handle + * @param thefile The file handle + */ +APR_DECLARE(apr_size_t) apr_file_buffer_size_get(apr_file_t *thefile); + /** * Move the read/write file offset to a specified byte within a file. * @param thefile The file descriptor diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index a2ece173a1f..510276aa5db 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -82,7 +82,9 @@ #endif /* End System headers */ -#define APR_FILE_BUFSIZE 4096 +#define APR_FILE_DEFAULT_BUFSIZE 4096 +/* For backwards-compat */ +#define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE struct apr_file_t { apr_pool_t *pool; @@ -101,7 +103,8 @@ struct apr_file_t { #endif /* Stuff for buffered mode */ char *buffer; - int bufpos; /* Read/Write position in buffer */ + apr_size_t bufpos; /* Read/Write position in buffer */ + apr_size_t bufsize; /* The size of the buffer */ unsigned long dataRead; /* amount of valid data read into buffer */ int direction; /* buffer being used for 0 = read, 1 = write */ unsigned long filePtr; /* position in file of handle */ diff --git a/test/testfile.c b/test/testfile.c index 9da6a671030..d27fb0764cc 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -326,6 +326,35 @@ static void test_userdata_getnokey(abts_case *tc, void *data) apr_file_close(filetest); } +static void test_buffer_set_get(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *filetest = NULL; + char * buffer; + + rv = apr_file_open(&filetest, FILENAME, + APR_WRITE | APR_BUFFERED, + APR_UREAD | APR_UWRITE | APR_GREAD, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_file_buffer_size_get(filetest); + ABTS_INT_EQUAL(tc, APR_BUFFERSIZE, rv); + + buffer = apr_pcalloc(p, 10240); + rv = apr_file_buffer_set(filetest, buffer, 10240); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_file_buffer_size_get(filetest); + ABTS_INT_EQUAL(tc, 10240, rv); + + rv = apr_file_buffer_set(filetest, buffer, 12); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_file_buffer_size_get(filetest); + ABTS_INT_EQUAL(tc, 12, rv); + + apr_file_close(filetest); +} static void test_getc(abts_case *tc, void *data) { apr_file_t *f = NULL; @@ -802,6 +831,7 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_bigfprintf, NULL); abts_run_test(suite, test_fail_write_flush, NULL); abts_run_test(suite, test_fail_read_flush, NULL); + abts_run_test(suite, test_buffer_set_get, NULL); return suite; } From 3c8183a5f623044aff00933a73dd30084c673574 Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Tue, 18 Oct 2005 15:03:05 +0000 Subject: [PATCH 5489/7878] buffer.c, where the new variable file buffer functions are stored. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@326117 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/buffer.c | 72 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 file_io/unix/buffer.c diff --git a/file_io/unix/buffer.c b/file_io/unix/buffer.c new file mode 100644 index 00000000000..bbd05bc1eec --- /dev/null +++ b/file_io/unix/buffer.c @@ -0,0 +1,72 @@ +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_arch_file_io.h" +#include "apr_pools.h" +#include "apr_thread_mutex.h" + +APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, + char * buffer, + apr_size_t bufsize) +{ + apr_status_t rv; + +#if APR_HAS_THREADS + if (file->thlock) { + apr_thread_mutex_lock(file->thlock); + } +#endif + + if(file->buffered) { + /* Flush the existing buffer */ + rv = apr_file_flush(file); + if (rv != APR_SUCCESS) { +#if APR_HAS_THREADS + if (file->thlock) { + apr_thread_mutex_unlock(file->thlock); + } +#endif + return rv; + } + } + + file->buffer = buffer; + file->bufsize = bufsize; + file->buffered = 1; + file->bufpos = 0; + file->direction = 0; + file->dataRead = 0; + + if (file->bufsize == 0) { + /* Setting the buffer size to zero is equivalent to turning + * buffering off. + */ + file->buffered = 0; + } + +#if APR_HAS_THREADS + if (file->thlock) { + apr_thread_mutex_unlock(file->thlock); + } +#endif + + return APR_SUCCESS; +} + +APR_DECLARE(apr_size_t) apr_file_buffer_size_get(apr_file_t *file) +{ + return file->bufsize; +} From cc62c9a2c4f92b5a87a1c34a413113ac44288aa8 Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Tue, 18 Oct 2005 15:10:53 +0000 Subject: [PATCH 5490/7878] Initial win32 implementation of the variable file-io buffer size functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@326118 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++ file_io/win32/buffer.c | 59 +++++++++++++++++++++++++++ file_io/win32/filedup.c | 3 +- file_io/win32/open.c | 6 ++- file_io/win32/readwrite.c | 7 ++-- include/arch/win32/apr_arch_file_io.h | 5 ++- libapr.dsp | 4 ++ 7 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 file_io/win32/buffer.c diff --git a/apr.dsp b/apr.dsp index a67674148b8..0004e5ebeed 100644 --- a/apr.dsp +++ b/apr.dsp @@ -105,6 +105,10 @@ SOURCE=.\dso\win32\dso.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\file_io\win32\buffer.c +# End Source File +# Begin Source File + SOURCE=.\file_io\unix\copy.c # End Source File # Begin Source File diff --git a/file_io/win32/buffer.c b/file_io/win32/buffer.c new file mode 100644 index 00000000000..e4ff676f7f0 --- /dev/null +++ b/file_io/win32/buffer.c @@ -0,0 +1,59 @@ +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "win32/apr_arch_file_io.h" +#include "apr_thread_mutex.h" + +APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, + char * buffer, + apr_size_t bufsize) +{ + apr_status_t rv; + + apr_thread_mutex_lock(file->mutex); + + if(file->buffered) { + /* Flush the existing buffer */ + rv = apr_file_flush(file); + if (rv != APR_SUCCESS) { + apr_thread_mutex_unlock(file->mutex); + return rv; + } + } + + file->buffer = buffer; + file->bufsize = bufsize; + file->buffered = 1; + file->bufpos = 0; + file->direction = 0; + file->dataRead = 0; + + if (file->bufsize == 0) { + /* Setting the buffer size to zero is equivalent to turning + * buffering off. + */ + file->buffered = 0; + } + + apr_thread_mutex_unlock(file->mutex); + + return APR_SUCCESS; +} + +APR_DECLARE(apr_size_t) apr_file_buffer_size_get(apr_file_t *file) +{ + return file->bufsize; +} \ No newline at end of file diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index d2e3af46b05..9cac74d475b 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -145,7 +145,8 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, memcpy(*new_file, old_file, sizeof(apr_file_t)); (*new_file)->pool = p; if (old_file->buffered) { - (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); + (*new_file)->buffer = apr_palloc(p, old_file->bufsize); + (*new_file)->bufsize = old_file->bufsize; if (old_file->direction == 1) { memcpy((*new_file)->buffer, old_file->buffer, old_file->bufpos); } diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 83beb977a60..56b73b51e20 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -386,7 +386,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, } if (flag & APR_BUFFERED) { (*new)->buffered = 1; - (*new)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); + (*new)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); + (*new)->bufsize = APR_FILE_DEFAULT_BUFSIZE; } /* Need the mutex to handled buffered and O_APPEND style file i/o */ if ((*new)->buffered || (*new)->append) { @@ -528,7 +529,8 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, } if (flags & APR_BUFFERED) { (*file)->buffered = 1; - (*file)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); + (*file)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); + (*file)->bufsize = APR_FILE_DEFAULT_BUFSIZE; } if ((*file)->append || (*file)->buffered) { diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index e1b56ba8ffd..23538f9c7fd 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -177,7 +177,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size if (thefile->bufpos >= thefile->dataRead) { apr_size_t read; rv = read_with_timeout(thefile, thefile->buffer, - APR_FILE_BUFSIZE, &read); + thefile->bufsize, &read); if (read == 0) { if (rv == APR_EOF) thefile->eof_hit = TRUE; @@ -251,10 +251,11 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = 0; while (rv == 0 && size > 0) { - if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full + if (thefile->bufpos == thefile->bufsize) // write buffer is full rv = apr_file_flush(thefile); - blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; + blocksize = size > thefile->bufsize - thefile->bufpos ? + thefile->bufsize - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); thefile->bufpos += blocksize; pos += blocksize; diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index 3af8720b9ff..57a4a61c751 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -84,7 +84,9 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool); #define APR_FILE_MAX MAX_PATH -#define APR_FILE_BUFSIZE 4096 +#define APR_FILE_DEFAULT_BUFSIZE 4096 +/* For backwards-compat */ +#define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE /* obscure ommissions from msvc's sys/stat.h */ #ifdef _MSC_VER @@ -173,6 +175,7 @@ struct apr_file_t { /* Stuff for buffered mode */ char *buffer; apr_size_t bufpos; // Read/Write position in buffer + apr_size_t bufsize; // The size of the buffer apr_size_t dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write apr_off_t filePtr; // position in file of handle diff --git a/libapr.dsp b/libapr.dsp index 13835e4d158..cd7098f710e 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -111,6 +111,10 @@ SOURCE=.\dso\win32\dso.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\file_io\win32\buffer.c +# End Source File +# Begin Source File + SOURCE=.\file_io\unix\copy.c # End Source File # Begin Source File From bfb9d6b210b14afa576446dce572374050d40eb4 Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Tue, 18 Oct 2005 15:14:44 +0000 Subject: [PATCH 5491/7878] Initial implementation of variable file-io buffer sizes on the Netware platform; partially guesswork based - untested. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@326119 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_arch_file_io.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/arch/netware/apr_arch_file_io.h b/include/arch/netware/apr_arch_file_io.h index bcef9add985..1d2b0a0e331 100644 --- a/include/arch/netware/apr_arch_file_io.h +++ b/include/arch/netware/apr_arch_file_io.h @@ -69,7 +69,9 @@ /* End System headers */ -#define APR_FILE_BUFSIZE 4096 +#define APR_FILE_DEFAULT_BUFSIZE 4096 +/* For backwards compat */ +#define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE #if APR_HAS_LARGE_FILES #define lseek(f,o,w) lseek64(f,o,w) @@ -95,7 +97,8 @@ struct apr_file_t { /* Stuff for buffered mode */ char *buffer; - int bufpos; /* Read/Write position in buffer */ + apr_size_t bufpos; /* Read/Write position in buffer */ + apr_size_t bufsize; /* The buffer size */ apr_off_t dataRead; /* amount of valid data read into buffer */ int direction; /* buffer being used for 0 = read, 1 = write */ apr_off_t filePtr; /* position in file of handle */ From 891317667e4e1c745c51e7f8d8066343432497b4 Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Tue, 18 Oct 2005 15:16:37 +0000 Subject: [PATCH 5492/7878] Initial implementation of the variable file-io buffer sizes functions on the OS2 platform; entirely guesswork base, untested. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@326120 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/buffer.c | 59 +++++++++++++++++++++++++++++ file_io/os2/filedup.c | 3 +- file_io/os2/open.c | 6 ++- file_io/os2/readwrite.c | 6 +-- include/arch/os2/apr_arch_file_io.h | 6 ++- 5 files changed, 72 insertions(+), 8 deletions(-) create mode 100644 file_io/os2/buffer.c diff --git a/file_io/os2/buffer.c b/file_io/os2/buffer.c new file mode 100644 index 00000000000..2e56b9933d3 --- /dev/null +++ b/file_io/os2/buffer.c @@ -0,0 +1,59 @@ +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_arch_file_io.h" +#include "apr_thread_mutex.h" + +APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, + char * buffer, + apr_size_t bufsize) +{ + apr_status_t rv; + + apr_thread_mutex_lock(file->mutex); + + if(file->buffered) { + /* Flush the existing buffer */ + rv = apr_file_flush(file); + if (rv != APR_SUCCESS) { + apr_thread_mutex_unlock(file->mutex); + return rv; + } + } + + file->buffer = buffer; + file->bufsize = bufsize; + file->buffered = 1; + file->bufpos = 0; + file->direction = 0; + file->dataRead = 0; + + if (file->bufsize == 0) { + /* Setting the buffer size to zero is equivalent to turning + * buffering off. + */ + file->buffered = 0; + } + + apr_thread_mutex_unlock(file->mutex); + + return APR_SUCCESS; +} + +APR_DECLARE(apr_size_t) apr_file_buffer_size_get(apr_file_t *file) +{ + return file->bufsize; +} diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index d592033a0f1..859b45a6ae2 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -91,7 +91,8 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, (*new_file)->pool = p; if (old_file->buffered) { - (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); + (*new_file)->buffer = apr_palloc(p, old_file->bufsize); + (*new_file)->bufsize = old_file->bufsize; if (old_file->direction == 1) { memcpy((*new_file)->buffer, old_file->buffer, old_file->bufpos); diff --git a/file_io/os2/open.c b/file_io/os2/open.c index ef3bc06ece8..4b1666bdc2d 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -59,7 +59,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->buffered = (flag & APR_BUFFERED) > 0; if (dafile->buffered) { - dafile->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); + dafile->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); + dafile->bufsize = APR_FILE_DEFAULT_BUFSIZE; rv = apr_thread_mutex_create(&dafile->mutex, 0, pool); if (rv) @@ -193,7 +194,8 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thef if ((*file)->buffered) { apr_status_t rv; - (*file)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); + (*file)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); + (*file)->bufsize = APR_FILE_DEFAULT_BUFSIZE; rv = apr_thread_mutex_create(&(*file)->mutex, 0, pool); if (rv) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 81f50f97841..b7b97931cdc 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -52,7 +52,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size if (thefile->bufpos >= thefile->dataRead) { ULONG bytesread; rc = DosRead(thefile->filedes, thefile->buffer, - APR_FILE_BUFSIZE, &bytesread); + thefile->bufsize, &bytesread); if (bytesread == 0) { if (rc == 0) @@ -143,10 +143,10 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } while (rc == 0 && size > 0) { - if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full + if (thefile->bufpos == thefile->bufsize) // write buffer is full rc = apr_file_flush(thefile); - blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; + blocksize = size > thefile->bufsize - thefile->bufpos ? thefile->bufsize - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); thefile->bufpos += blocksize; pos += blocksize; diff --git a/include/arch/os2/apr_arch_file_io.h b/include/arch/os2/apr_arch_file_io.h index ff3b3145bad..c878273b30e 100644 --- a/include/arch/os2/apr_arch_file_io.h +++ b/include/arch/os2/apr_arch_file_io.h @@ -31,7 +31,8 @@ */ #undef HAVE_MKSTEMP -#define APR_FILE_BUFSIZE 4096 +#define APR_FILE_DEFAULT_BUFSIZE 4096 +#define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE struct apr_file_t { apr_pool_t *pool; @@ -48,7 +49,8 @@ struct apr_file_t { /* Stuff for buffered mode */ char *buffer; - int bufpos; // Read/Write position in buffer + apr_size_t bufsize; // Read/Write position in buffer + apr_size_t bufpos; // Read/Write position in buffer unsigned long dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write unsigned long filePtr; // position in file of handle From 2a29414b6d739f5e7f86379145b4e61153bcedea Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 19 Oct 2005 16:05:19 +0000 Subject: [PATCH 5493/7878] * file_io/unix/seek.c (setptr): Don't ignore errors from apr_file_flush. * test/testfile.c (test_fail_read_flush): Add test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@326593 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/seek.c | 5 ++++- test/testfile.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 48368cda51b..656947af6b1 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -22,7 +22,10 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) int rc; if (thefile->direction == 1) { - apr_file_flush(thefile); + rc = apr_file_flush(thefile); + if (rc) { + return rc; + } thefile->bufpos = thefile->direction = thefile->dataRead = 0; } diff --git a/test/testfile.c b/test/testfile.c index d27fb0764cc..c6e14c965ca 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -795,6 +795,16 @@ static void test_fail_read_flush(abts_case *tc, void *data) ABTS_ASSERT(tc, "gets should flush buffered write and fail", rv != APR_SUCCESS && rv != APR_EOF); + /* Likewise for seek. */ + { + apr_off_t offset = 0; + + rv = apr_file_seek(f, APR_SET, &offset); + } + + ABTS_ASSERT(tc, "seek should flush buffered write and fail", + rv != APR_SUCCESS && rv != APR_EOF); + apr_file_close(f); } From 5a411bce48a08b389088a093216dce643cd772bc Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 19 Oct 2005 16:12:15 +0000 Subject: [PATCH 5494/7878] * file_io/unix/seek.c (setptr): Tidy up error handling a little; use apr_status_t, use rv not rc, check lseek return value directly, use explicit APR_SUCCESS. No functional change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@326597 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/seek.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 656947af6b1..568f4c11c44 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -19,12 +19,12 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) { apr_off_t newbufpos; - int rc; + apr_status_t rv; if (thefile->direction == 1) { - rc = apr_file_flush(thefile); - if (rc) { - return rc; + rv = apr_file_flush(thefile); + if (rv) { + return rv; } thefile->bufpos = thefile->direction = thefile->dataRead = 0; } @@ -32,22 +32,20 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) newbufpos = pos - (thefile->filePtr - thefile->dataRead); if (newbufpos >= 0 && newbufpos <= thefile->dataRead) { thefile->bufpos = newbufpos; - rc = 0; + rv = APR_SUCCESS; } else { - rc = lseek(thefile->filedes, pos, SEEK_SET); - - if (rc != -1 ) { + if (lseek(thefile->filedes, pos, SEEK_SET) != -1) { thefile->bufpos = thefile->dataRead = 0; thefile->filePtr = pos; - rc = 0; + rv = APR_SUCCESS; } else { - rc = errno; + rv = errno; } } - return rc; + return rv; } From b5052fafcd2e0390351883e4f9a8f27eea3e8c56 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 21 Oct 2005 09:47:09 +0000 Subject: [PATCH 5495/7878] apr_tokenize_to_argv(): Stop touching storage after the end of the input string. (Purify reports this problem when using an Apache piped logger.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@327141 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_cpystrn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index 9edba846a31..80db81107e4 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -169,6 +169,7 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, /* determine first argument */ for (argnum = 0; argnum < (numargs-1); argnum++) { + SKIP_WHITESPACE(cp); CHECK_QUOTATION(cp, isquoted); ct = cp; DETERMINE_NEXTSTRING(cp, isquoted); @@ -177,7 +178,6 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, apr_cpystrn((*argv_out)[argnum], ct, cp - ct); cleaned = dirty = (*argv_out)[argnum]; REMOVE_ESCAPE_CHARS(cleaned, dirty, escaped); - SKIP_WHITESPACE(cp); } (*argv_out)[argnum] = NULL; From d39b660b5c1bc383855081db7af7a35a4da9efc8 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 23 Oct 2005 06:43:17 +0000 Subject: [PATCH 5496/7878] Added an optional APR_POLLSET_NOCOPY flag for apr_pollset_create(). This flag prevents the pollset implementation from making an internal copy of the descriptor object passed to apr_pollset_add(). Instead, a pointer to the descriptor itself is registered as the client_data for the underlying poll mechanism. This saves the cost of a copy, and in the case of the epoll-based implementation it eliminates the O(n)-time loop that's otherwise needed in apr_pollset_remove() to find and free the structure that contains a copy of the descriptor. Note that, when an application creates a pollset using APR_POLLSET_NOCOPY, the application must ensure that all descriptors passed to apr_pollset_add() have sufficiently long lifetimes. With this commit, the epoll-based implementation of apr_pollset implements the APR_POLLSET_NOCOPY optimization. The kqueue-based implementation would benefit from the same optimization. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@327756 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++ include/apr_poll.h | 1 + poll/unix/epoll.c | 121 +++++++++++++++++++++++++++------------------ 3 files changed, 79 insertions(+), 47 deletions(-) diff --git a/CHANGES b/CHANGES index d146ee74cc7..eed5e34361e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes for APR 1.3.0 + *) Add APR_POLLSET_NOCOPY option to apr_pollset API to eliminate + O(n)-time lookup in apr_pollset_remove() (currently implemented + only for epoll). [Brian Pane] + *) Add apr_file_buffer_set() and apr_file_buffer_size_get() functions to support variable buffer sizes with APR file handles. [Colm MacCarthaigh] diff --git a/include/apr_poll.h b/include/apr_poll.h index d708600beca..e156fe8d7d6 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -55,6 +55,7 @@ extern "C" { * Pollset Flags */ #define APR_POLLSET_THREADSAFE 0x001 /**< Adding or Removing a Descriptor is thread safe */ +#define APR_POLLSET_NOCOPY 0x002 /**< Descriptors passed to apr_pollset_create() are not copied */ /** Used in apr_pollfd_t to determine what the apr_descriptor is */ typedef enum { diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 5d683cbd812..8f921776cde 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -101,7 +101,8 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, *pollset = apr_palloc(p, sizeof(**pollset)); #if APR_HAS_THREADS - if (flags & APR_POLLSET_THREADSAFE && + if ((flags & APR_POLLSET_THREADSAFE) && + !(flags & APR_POLLSET_NOCOPY) && ((rv = apr_thread_mutex_create(&(*pollset)->ring_lock, APR_THREAD_MUTEX_DEFAULT, p) != APR_SUCCESS))) { @@ -123,10 +124,11 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_pool_cleanup_register(p, *pollset, backend_cleanup, backend_cleanup); (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); - APR_RING_INIT(&(*pollset)->query_ring, pfd_elem_t, link); - APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link); - APR_RING_INIT(&(*pollset)->dead_ring, pfd_elem_t, link); - + if (!(flags & APR_POLLSET_NOCOPY)) { + APR_RING_INIT(&(*pollset)->query_ring, pfd_elem_t, link); + APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link); + APR_RING_INIT(&(*pollset)->dead_ring, pfd_elem_t, link); + } return APR_SUCCESS; } @@ -140,23 +142,28 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, { struct epoll_event ev; int ret = -1; - pfd_elem_t *elem; + pfd_elem_t *elem = NULL; apr_status_t rv = APR_SUCCESS; - pollset_lock_rings(); + ev.events = get_epoll_event(descriptor->reqevents); - if (!APR_RING_EMPTY(&(pollset->free_ring), pfd_elem_t, link)) { - elem = APR_RING_FIRST(&(pollset->free_ring)); - APR_RING_REMOVE(elem, link); + if (pollset->flags & APR_POLLSET_NOCOPY) { + ev.data.ptr = (void *)descriptor; } else { - elem = (pfd_elem_t *) apr_palloc(pollset->pool, sizeof(pfd_elem_t)); - APR_RING_ELEM_INIT(elem, link); - } - elem->pfd = *descriptor; + pollset_lock_rings(); - ev.events = get_epoll_event(descriptor->reqevents); - ev.data.ptr = elem; + if (!APR_RING_EMPTY(&(pollset->free_ring), pfd_elem_t, link)) { + elem = APR_RING_FIRST(&(pollset->free_ring)); + APR_RING_REMOVE(elem, link); + } + else { + elem = (pfd_elem_t *) apr_palloc(pollset->pool, sizeof(pfd_elem_t)); + APR_RING_ELEM_INIT(elem, link); + } + elem->pfd = *descriptor; + ev.data.ptr = elem; + } if (descriptor->desc_type == APR_POLL_SOCKET) { ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_ADD, descriptor->desc.s->socketdes, &ev); @@ -166,17 +173,23 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, descriptor->desc.f->filedes, &ev); } - if (0 != ret) { - rv = APR_EBADF; - APR_RING_INSERT_TAIL(&(pollset->free_ring), elem, pfd_elem_t, link); + if (pollset->flags & APR_POLLSET_NOCOPY) { + if (0 != ret) { + rv = APR_EBADF; + } } else { - pollset->nelts++; - APR_RING_INSERT_TAIL(&(pollset->query_ring), elem, pfd_elem_t, link); + if (0 != ret) { + rv = APR_EBADF; + APR_RING_INSERT_TAIL(&(pollset->free_ring), elem, pfd_elem_t, link); + } + else { + pollset->nelts++; + APR_RING_INSERT_TAIL(&(pollset->query_ring), elem, pfd_elem_t, link); + } + pollset_unlock_rings(); } - pollset_unlock_rings(); - return rv; } @@ -188,8 +201,6 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, struct epoll_event ev; int ret = -1; - pollset_lock_rings(); - ev.events = get_epoll_event(descriptor->reqevents); if (descriptor->desc_type == APR_POLL_SOCKET) { @@ -204,22 +215,26 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, rv = APR_NOTFOUND; } - if (!APR_RING_EMPTY(&(pollset->query_ring), pfd_elem_t, link)) { - for (ep = APR_RING_FIRST(&(pollset->query_ring)); - ep != APR_RING_SENTINEL(&(pollset->query_ring), - pfd_elem_t, link); - ep = APR_RING_NEXT(ep, link)) { - - if (descriptor->desc.s == ep->pfd.desc.s) { - APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->dead_ring), - ep, pfd_elem_t, link); - break; + if (!(pollset->flags & APR_POLLSET_NOCOPY)) { + pollset_lock_rings(); + + if (!APR_RING_EMPTY(&(pollset->query_ring), pfd_elem_t, link)) { + for (ep = APR_RING_FIRST(&(pollset->query_ring)); + ep != APR_RING_SENTINEL(&(pollset->query_ring), + pfd_elem_t, link); + ep = APR_RING_NEXT(ep, link)) { + + if (descriptor->desc.s == ep->pfd.desc.s) { + APR_RING_REMOVE(ep, link); + APR_RING_INSERT_TAIL(&(pollset->dead_ring), + ep, pfd_elem_t, link); + break; + } } } - } - pollset_unlock_rings(); + pollset_unlock_rings(); + } return rv; } @@ -247,11 +262,21 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, rv = APR_TIMEUP; } else { - for (i = 0; i < ret; i++) { - pollset->result_set[i] = - (((pfd_elem_t *) (pollset->pollset[i].data.ptr))->pfd); - pollset->result_set[i].rtnevents = - get_epoll_revent(pollset->pollset[i].events); + if (pollset->flags & APR_POLLSET_NOCOPY) { + for (i = 0; i < ret; i++) { + pollset->result_set[i] = + *((apr_pollfd_t *) (pollset->pollset[i].data.ptr)); + pollset->result_set[i].rtnevents = + get_epoll_revent(pollset->pollset[i].events); + } + } + else { + for (i = 0; i < ret; i++) { + pollset->result_set[i] = + (((pfd_elem_t *) (pollset->pollset[i].data.ptr))->pfd); + pollset->result_set[i].rtnevents = + get_epoll_revent(pollset->pollset[i].events); + } } if (descriptors) { @@ -259,12 +284,14 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } } - pollset_lock_rings(); + if (!(pollset->flags & APR_POLLSET_NOCOPY)) { + pollset_lock_rings(); - /* Shift all PFDs in the Dead Ring to be Free Ring */ - APR_RING_CONCAT(&(pollset->free_ring), &(pollset->dead_ring), pfd_elem_t, link); + /* Shift all PFDs in the Dead Ring to be Free Ring */ + APR_RING_CONCAT(&(pollset->free_ring), &(pollset->dead_ring), pfd_elem_t, link); - pollset_unlock_rings(); + pollset_unlock_rings(); + } return rv; } From 807c3edc2a9f8dd70f28667a0eb233d5b3c6b915 Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Mon, 24 Oct 2005 01:45:26 +0000 Subject: [PATCH 5497/7878] Increment the APR_MINOR_VERSION to reflect what trunk should be, and such that the overall version is higher than current release branches. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@327907 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_version.h b/include/apr_version.h index 3ce2473aa77..cd8ba052f6c 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -53,7 +53,7 @@ * Minor API changes that do not cause binary compatibility problems. * Reset to 0 when upgrading APR_MAJOR_VERSION */ -#define APR_MINOR_VERSION 2 +#define APR_MINOR_VERSION 3 /** patch level * The Patch Level never includes API changes, simply bug fixes. From 87c8abcf5a23f4997f8e901e04eb2030b92dd201 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Mon, 24 Oct 2005 13:57:16 +0000 Subject: [PATCH 5498/7878] basename() is defined in string.h, use libtool_basebase(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@328072 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index 22753414e3e..7266b0919a8 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -1259,7 +1259,7 @@ int parse_output_file_name(char *arg, command_t *cmd_data) } /* returns just a file's name without the path */ -const char *basename(const char *fullpath) +const char *jlibtool_basename(const char *fullpath) { const char *name = strrchr(fullpath, '/'); @@ -1282,7 +1282,7 @@ const char *nameof(const char *fullpath) const char *name; const char *ext; - name = basename(fullpath); + name = jlibtool_basename(fullpath); ext = strrchr(name, '.'); if (ext) { @@ -1673,7 +1673,7 @@ int run_mode(command_t *cmd_data) size_t len1, len2; len1 = strlen(cmd_data->arglist->vals[cmd_data->arglist->num - 1]); - static_lib_name = basename(cmd_data->static_name.install); + static_lib_name = jlibtool_basename(cmd_data->static_name.install); len2 = strlen(static_lib_name); tmp = malloc(len1 + len2 + 2); From fb7f1e82b7c0823c93bb1b4ad49e7f3c9f88bc14 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 25 Oct 2005 13:14:14 +0000 Subject: [PATCH 5499/7878] * memory/unix/apr_pools.c (pool_clear_debug): Scribble over blocks with a poison byte before freeing them to help highlight use-after-free bugs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@328355 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 13c60a870c3..4e6200ab9ed 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1356,6 +1356,8 @@ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *pool, apr_size_t size, * Pool creation/destruction (debug) */ +#define POOL_POISON_BYTE 'A' + static void pool_clear_debug(apr_pool_t *pool, const char *file_line) { debug_node_t *node; @@ -1383,13 +1385,18 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) /* Clear the user data. */ pool->user_data = NULL; - /* Free the blocks */ + /* Free the blocks, scribbling over them first to help highlight + * use-after-free issues. */ while ((node = pool->nodes) != NULL) { pool->nodes = node->next; - for (index = 0; index < node->index; index++) + for (index = 0; index < node->index; index++) { + memset(node->beginp[index], POOL_POISON_BYTE, + node->endp[index] - node->beginp[index]); free(node->beginp[index]); + } + memset(node, POOL_POISON_BYTE, SIZEOF_DEBUG_NODE_T); free(node); } From 6aa79a6614b0032c1703a0f4980acf1dadcac167 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 26 Oct 2005 15:18:11 +0000 Subject: [PATCH 5500/7878] Add fileio/unix/buffer.c to the NetWare build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@328656 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index 8bc6e2fdd31..0f83b6b85c8 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -279,6 +279,7 @@ FILES_lib_objs = \ $(OBJDIR)/apr_strnatcmp.o \ $(OBJDIR)/apr_strtok.o \ $(OBJDIR)/apr_tables.o \ + $(OBJDIR)/buffer.o \ $(OBJDIR)/charset.o \ $(OBJDIR)/copy.o \ $(OBJDIR)/common.o \ From 19e2088a20e3d32e99fa34155ce1a139b65053cf Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 26 Oct 2005 15:18:57 +0000 Subject: [PATCH 5501/7878] Add a missing symbol to the NetWare export list git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@328657 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_nw_export.awk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index 291ecc0b2c4..d49fcbaf12d 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -73,6 +73,7 @@ function add_symbol (sym_name) { } -#END { +END { + add_symbol("apr_wait_for_io_or_timeout"); # printf(" %s", line) -#} +} From 56512c3fc81f883b179d1bbff4bba289df7b49e8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Oct 2005 00:39:26 +0000 Subject: [PATCH 5502/7878] Note releases git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@328995 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 64d34b03c40..8da3b24d2a1 100644 --- a/STATUS +++ b/STATUS @@ -5,14 +5,14 @@ Releases: Standalone 1.3.0 : in development - 1.2.2 : tagged September 26, 2005 + 1.2.2 : released October 11, 2005 1.2.1 : released August 18, 2005 1.2.0 : not released 1.1.1 : released March 17, 2005 1.1.0 : released January 25, 2005 1.0.1 : released November 19, 2004 1.0.0 : released September 1, 2004 - 0.9.7 : tagged September 26, 2005 + 0.9.7 : released October 11, 2005 0.9.6 : released February 4, 2005 0.9.5 : released November 19, 2004 0.9.4 : released September 25, 2003 From c6c9fd77d00e44dd9387d24239f4361e1e6cafc0 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 28 Oct 2005 15:55:18 +0000 Subject: [PATCH 5503/7878] Add the apr_memcache APIs to the NetWare export list git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@329230 13f79535-47bb-0310-9956-ffa450edef68 --- build/nw_export.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/build/nw_export.inc b/build/nw_export.inc index 89583d90f39..41b05ea71ae 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -68,6 +68,7 @@ #include "apr_ldap_url.h" #include "apr_md4.h" #include "apr_md5.h" +#include "apr_memcache.h" #include "apr_optional.h" #include "apr_optional_hooks.h" #include "apr_queue.h" From 9de9d7b64412660bae914947a7501d2e23928b75 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 28 Oct 2005 16:40:38 +0000 Subject: [PATCH 5504/7878] Try to break a code dependency that the NetWare build has between APR and APR-util git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@329246 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUmakefile | 3 ++- build/nw_export.inc | 36 +----------------------------------- 2 files changed, 3 insertions(+), 36 deletions(-) diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index 6f9b32dd043..c2c06723f42 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -32,7 +32,7 @@ $(APR)/aprlib.imp : make_nw_export.awk nw_export.i @echo Generating $(subst /,\,$@) awk -f make_nw_export.awk nw_export.i | sort >$(APR)/aprlib.imp -nw_export.i : nw_export.inc $(FILES_prebuild_headers) $(NLM_NAME)_cc.opt +nw_export.i : nw_export.inc $(APRUTIL)/build/nw_apu_export.inc $(FILES_prebuild_headers) $(NLM_NAME)_cc.opt @echo Generating $(subst /,\,$@) $(CC) $< @$(NLM_NAME)_cc.opt @@ -47,6 +47,7 @@ $(NLM_NAME)_cc.opt : NWGNUmakefile $(APR_WORK)\build\NWGNUenvironment.inc $(APR_ @echo -I$(APR)\include\arch\netware >> $@ @echo -I$(APR)\include\arch\unix >> $@ @echo -I$(APRUTIL)\include >> $@ + @echo -I$(APRUTIL)\build >> $@ @echo -ir $(NOVELLLIBC) >> $@ ifneq "$(LDAPSDK)" "" @echo -ir $(LDAPSDK) >> $@ diff --git a/build/nw_export.inc b/build/nw_export.inc index 41b05ea71ae..452b40181a1 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -46,39 +46,5 @@ #include "apr_version.h" #include "apr_want.h" +#include "nw_apu_export.inc" -/* Must include apu.h first so that we can undefine - the standard prototypes macros after it messes with - them. */ -#include "apu.h" - -#undef APU_DECLARE -#undef APU_DECLARE_NONSTD -#undef APU_DECLARE_DATA - -/* Preprocess all of the standard APR headers. */ -#include "apr_anylock.h" -#include "apr_base64.h" -#include "apr_buckets.h" -#include "apr_date.h" -#include "apr_dbd.h" -#include "apr_dbm.h" -#include "apr_hooks.h" -#include "apr_ldap.h" -#include "apr_ldap_url.h" -#include "apr_md4.h" -#include "apr_md5.h" -#include "apr_memcache.h" -#include "apr_optional.h" -#include "apr_optional_hooks.h" -#include "apr_queue.h" -#include "apr_reslist.h" -#include "apr_rmm.h" -#include "apr_sdbm.h" -#include "apr_sha1.h" -#include "apr_strmatch.h" -#include "apr_uri.h" -#include "apr_uuid.h" -#include "apr_xlate.h" -#include "apr_xml.h" -#include "apu_want.h" From aa9d3726bce4b9996bf05c022fc3749c79017acb Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 8 Nov 2005 21:43:12 +0000 Subject: [PATCH 5505/7878] Remove an unnecessary module reference to LLDAPX git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@331898 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 - 1 file changed, 1 deletion(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 0f83b6b85c8..c616fdd177a 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -211,7 +211,6 @@ ifneq "$(LDAPSDK)" "" FILES_nlm_modules += \ lldapsdk \ lldapssl \ - lldapx \ $(EOLIST) endif From 250a8248947122670d201f3ea711a571088c2379 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 23 Nov 2005 10:15:59 +0000 Subject: [PATCH 5506/7878] * test/testsock.c (setup_socket): Set REUSEADDR option before binding socket. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@348405 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/testsock.c b/test/testsock.c index 77ca4fa65ee..1c648ec768a 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -84,6 +84,9 @@ static apr_socket_t *setup_socket(abts_case *tc) rv = apr_socket_create(&sock, sa->family, SOCK_STREAM, APR_PROTO_TCP, p); APR_ASSERT_SUCCESS(tc, "Problem creating socket", rv); + + rv = apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1); + APR_ASSERT_SUCCESS(tc, "Could not set REUSEADDR on socket", rv); rv = apr_socket_bind(sock, sa); APR_ASSERT_SUCCESS(tc, "Problem binding to port", rv); From cd89dbe3cd6ebf7bdd75c9577b2177d325c64cba Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Wed, 23 Nov 2005 17:38:47 +0000 Subject: [PATCH 5507/7878] Bugfix for apr_pollset_poll() on systems that implement pollsets using select(2): properly compute the number of signalled desciptors when one or more of them are both readable and writable. Submitted by: Dror Shilo , Gerry Reviewed by: Brian Pane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@348499 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ poll/unix/select.c | 1 + test/testpoll.c | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/CHANGES b/CHANGES index eed5e34361e..118349cc6d4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes for APR 1.3.0 + *) Bugfix for apr_pollset_poll() on systems that implement pollsets + using select(2): properly compute the number of signalled desciptors + when one or more of them are both readable and writable. + [Dror Shilo , Gerry ] + *) Add APR_POLLSET_NOCOPY option to apr_pollset API to eliminate O(n)-time lookup in apr_pollset_remove() (currently implemented only for epoll). [Brian Pane] diff --git a/poll/unix/select.c b/poll/unix/select.c index d9212b0070d..0392d07b77a 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -395,6 +395,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, j++; } } + (*num) = j; if (descriptors) *descriptors = pollset->result_set; diff --git a/test/testpoll.c b/test/testpoll.c index ebcb8acd959..351dcce78e5 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -290,6 +290,43 @@ static void setup_pollset(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } +static void multi_event_pollset(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_pollfd_t socket_pollfd; + int lrv; + const apr_pollfd_t *descs = NULL; + + ABTS_PTR_NOTNULL(tc, s[0]); + socket_pollfd.desc_type = APR_POLL_SOCKET; + socket_pollfd.reqevents = APR_POLLIN | APR_POLLOUT; + socket_pollfd.desc.s = s[0]; + socket_pollfd.client_data = s[0]; + rv = apr_pollset_add(pollset, &socket_pollfd); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + send_msg(s, sa, 0, tc); + + rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + ABTS_INT_EQUAL(tc, 0, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 1, lrv); + ABTS_PTR_EQUAL(tc, s[0], descs[0].desc.s); + ABTS_INT_EQUAL(tc, APR_POLLIN | APR_POLLOUT, descs[0].rtnevents); + ABTS_PTR_EQUAL(tc, s[0], descs[0].client_data); + + recv_msg(s, 0, p, tc); + + rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + ABTS_INT_EQUAL(tc, 0, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 1, lrv); + ABTS_PTR_EQUAL(tc, s[0], descs[0].desc.s); + ABTS_INT_EQUAL(tc, APR_POLLOUT, descs[0].rtnevents); + ABTS_PTR_EQUAL(tc, s[0], descs[0].client_data); + + rv = apr_pollset_remove(pollset, &socket_pollfd); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); +} + static void add_sockets_pollset(abts_case *tc, void *data) { apr_status_t rv; @@ -520,6 +557,7 @@ abts_suite *testpoll(abts_suite *suite) #endif abts_run_test(suite, setup_pollset, NULL); + abts_run_test(suite, multi_event_pollset, NULL); abts_run_test(suite, add_sockets_pollset, NULL); abts_run_test(suite, nomessage_pollset, NULL); abts_run_test(suite, send0_pollset, NULL); From f5fcac819635eaff267c90a5124eb804be1fcd3f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 24 Nov 2005 14:09:23 +0000 Subject: [PATCH 5508/7878] Strip @ symbols. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@348736 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 118349cc6d4..06ecbd2f1e6 100644 --- a/CHANGES +++ b/CHANGES @@ -3,7 +3,7 @@ Changes for APR 1.3.0 *) Bugfix for apr_pollset_poll() on systems that implement pollsets using select(2): properly compute the number of signalled desciptors when one or more of them are both readable and writable. - [Dror Shilo , Gerry ] + [Dror Shilo , Gerry ] *) Add APR_POLLSET_NOCOPY option to apr_pollset API to eliminate O(n)-time lookup in apr_pollset_remove() (currently implemented From 33ff6cbca8ac19ade3eb03a00b1bcb0ecad3abe7 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 26 Nov 2005 03:42:46 +0000 Subject: [PATCH 5509/7878] Correctly compute number of signalled descriptors in the select(2)-based implementation of apr_poll() when one or more descriptors has multiple events (e.g., is both readable and writable). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@349070 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/select.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/poll/unix/select.c b/poll/unix/select.c index 0392d07b77a..a64ddbad951 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -131,6 +131,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, return apr_get_netos_error(); } + (*nsds) = 0; for (i = 0; i < num; i++) { apr_os_sock_t fd; @@ -156,6 +157,9 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, if (FD_ISSET(fd, &exceptset)) { aprset[i].rtnevents |= APR_POLLERR; } + if (aprset[i].rtnevents) { + (*nsds)++; + } } return APR_SUCCESS; From 574e936c6863979abb576e67791f2282a61566f9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 28 Nov 2005 15:54:49 +0000 Subject: [PATCH 5510/7878] * threadproc/unix/procsup.c (apr_proc_detach): Check chdir() return value (fixes gcc warning with modern glibc and -D_FORTIFY_SOURCE=2). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@349408 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/procsup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index 5165a8f9e37..2595edf0b5e 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -20,7 +20,10 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) { int x; - chdir("/"); + if (chdir("/") == -1) { + return errno; + } + #if !defined(MPE) && !defined(OS2) && !defined(TPF) && !defined(BEOS) /* Don't detach for MPE because child processes can't survive the death of * the parent. */ From e721ced3b6ac397ef174821962acfc03c7e898e8 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Thu, 1 Dec 2005 02:57:38 +0000 Subject: [PATCH 5511/7878] Nix os_version def for darwin; it's unused and breaks if minor version is >= 10 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@350120 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/configure.in b/configure.in index 579fecf54b3..beeda49dff3 100644 --- a/configure.in +++ b/configure.in @@ -508,9 +508,6 @@ case $host in *linux*) os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/'` ;; - *darwin*) - os_version=`uname -r | sed -e 's/\(.\)\.\(.\).*/\1\2/'` - ;; *) os_version=OS_VERSION_IS_NOT_SET ;; From 54219fcdf234fe253ac06574cd39fff7ebbe465e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 6 Dec 2005 15:26:30 +0000 Subject: [PATCH 5512/7878] * build/apr_threads.m4, build/apr_common.m4, build/apr_network.m4: Quote arguments to AC_DEFUN properly. No functional change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@354452 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 50 ++++++++++++++++++++++---------------------- build/apr_network.m4 | 30 +++++++++++++------------- build/apr_threads.m4 | 4 ++-- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 29a90abbf6b..3be28c128e2 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -22,7 +22,7 @@ dnl APR_CONFIG_NICE(filename) dnl dnl Saves a snapshot of the configure command-line for later reuse dnl -AC_DEFUN(APR_CONFIG_NICE,[ +AC_DEFUN([APR_CONFIG_NICE], [ rm -f $1 cat >$1</dev/null 2>&1 @@ -112,7 +112,7 @@ dnl dnl Trying to optimize this is left as an exercise to the reader who wants dnl to put up with more autoconf craziness. I give up. dnl -AC_DEFUN(APR_SUBDIR_CONFIG, [ +AC_DEFUN([APR_SUBDIR_CONFIG], [ # save our work to this point; this allows the sub-package to use it AC_CACHE_SAVE @@ -180,7 +180,7 @@ dnl APR_SAVE_THE_ENVIRONMENT(variable_name) dnl dnl Stores the variable (usually a Makefile macro) for later restoration dnl -AC_DEFUN(APR_SAVE_THE_ENVIRONMENT,[ +AC_DEFUN([APR_SAVE_THE_ENVIRONMENT], [ apr_ste_save_$1="$$1" ])dnl @@ -192,7 +192,7 @@ dnl has added to the variable, moving the new bits to prefix_variable_name dnl and restoring the original variable contents. This makes it possible dnl for a user to override configure when it does something stupid. dnl -AC_DEFUN(APR_RESTORE_THE_ENVIRONMENT,[ +AC_DEFUN([APR_RESTORE_THE_ENVIRONMENT], [ if test "x$apr_ste_save_$1" = "x"; then $2$1="$$1" $1= @@ -216,7 +216,7 @@ dnl APR_SETIFNULL(variable, value) dnl dnl Set variable iff it's currently null dnl -AC_DEFUN(APR_SETIFNULL,[ +AC_DEFUN([APR_SETIFNULL], [ if test -z "$$1"; then test "x$silent" != "xyes" && echo " setting $1 to \"$2\"" $1="$2" @@ -228,7 +228,7 @@ dnl APR_SETVAR(variable, value) dnl dnl Set variable no matter what dnl -AC_DEFUN(APR_SETVAR,[ +AC_DEFUN([APR_SETVAR], [ test "x$silent" != "xyes" && echo " forcing $1 to \"$2\"" $1="$2" ])dnl @@ -238,7 +238,7 @@ dnl APR_ADDTO(variable, value) dnl dnl Add value to variable dnl -AC_DEFUN(APR_ADDTO,[ +AC_DEFUN([APR_ADDTO], [ if test "x$$1" = "x"; then test "x$silent" != "xyes" && echo " setting $1 to \"$2\"" $1="$2" @@ -265,7 +265,7 @@ dnl APR_REMOVEFROM(variable, value) dnl dnl Remove a value from a variable dnl -AC_DEFUN(APR_REMOVEFROM,[ +AC_DEFUN([APR_REMOVEFROM], [ if test "x$$1" = "x$2"; then test "x$silent" != "xyes" && echo " nulling $1" $1="" @@ -289,7 +289,7 @@ AC_DEFUN(APR_REMOVEFROM,[ dnl dnl APR_CHECK_DEFINE_FILES( symbol, header_file [header_file ...] ) dnl -AC_DEFUN(APR_CHECK_DEFINE_FILES,[ +AC_DEFUN([APR_CHECK_DEFINE_FILES], [ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ ac_cv_define_$1=no for curhdr in $2 @@ -311,7 +311,7 @@ YES_IS_DEFINED dnl dnl APR_CHECK_DEFINE(symbol, header_file) dnl -AC_DEFUN(APR_CHECK_DEFINE,[ +AC_DEFUN([APR_CHECK_DEFINE], [ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ AC_EGREP_CPP(YES_IS_DEFINED, [ #include <$2> @@ -328,7 +328,7 @@ YES_IS_DEFINED dnl dnl APR_CHECK_APR_DEFINE( symbol ) dnl -AC_DEFUN(APR_CHECK_APR_DEFINE,[ +AC_DEFUN([APR_CHECK_APR_DEFINE], [ apr_old_cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS $INCLUDES" AC_EGREP_CPP(YES_IS_DEFINED, [ @@ -443,7 +443,7 @@ dnl dnl A variant of AC_CHECK_SIZEOF which allows the checking of dnl sizes of non-builtin types dnl -AC_DEFUN(APR_CHECK_SIZEOF_EXTENDED, +AC_DEFUN([APR_CHECK_SIZEOF_EXTENDED], [changequote(<<,>>)dnl dnl The name to #define define(<>, translit(sizeof_$2, [a-z *], [A-Z_P]))dnl @@ -504,7 +504,7 @@ dnl for failure), or it returns a pointer to the error dnl string. dnl dnl -AC_DEFUN(APR_CHECK_STRERROR_R_RC,[ +AC_DEFUN([APR_CHECK_STRERROR_R_RC], [ AC_MSG_CHECKING(for type of return code from strerror_r) AC_TRY_RUN([ #include @@ -539,7 +539,7 @@ dnl Decide if d_fileno or d_ino are available in the dirent dnl structure on this platform. Single UNIX Spec says d_ino, dnl BSD uses d_fileno. Undef to find the real beast. dnl -AC_DEFUN(APR_CHECK_DIRENT_INODE, [ +AC_DEFUN([APR_CHECK_DIRENT_INODE], [ AC_CACHE_CHECK([for inode member of struct dirent], apr_cv_dirent_inode, [ apr_cv_dirent_inode=no AC_TRY_COMPILE([ @@ -577,7 +577,7 @@ dnl on this platform. Not part of the Single UNIX Spec. dnl Note that this is worthless without DT_xxx macros, so dnl look for one while we are at it. dnl -AC_DEFUN(APR_CHECK_DIRENT_TYPE,[ +AC_DEFUN([APR_CHECK_DIRENT_TYPE], [ AC_CACHE_CHECK([for file type member of struct dirent], apr_cv_dirent_type,[ apr_cv_dirent_type=no AC_TRY_COMPILE([ @@ -626,7 +626,7 @@ dnl by changing all "/" to "_" in the HEADER-FILE and dropping dnl all "." and "-" chars. If the 3rd parameter is "yes" then instead of dnl setting to 1 or 0, we set FLAG-TO-SET to yes or no. dnl -AC_DEFUN(APR_FLAG_HEADERS,[ +AC_DEFUN([APR_FLAG_HEADERS], [ AC_CHECK_HEADERS($1) for aprt_i in $1 do @@ -647,7 +647,7 @@ dnl we use what's provided as FLAG-TO-SET. If the 3rd parameter dnl is "yes" then instead of setting to 1 or 0, we set FLAG-TO-SET dnl to yes or no. dnl -AC_DEFUN(APR_FLAG_FUNCS,[ +AC_DEFUN([APR_FLAG_FUNCS], [ AC_CHECK_FUNCS($1) for aprt_j in $1 do @@ -672,7 +672,7 @@ dnl baz='${bar}/3' dnl APR_EXPAND_VAR(fraz, $baz) dnl $fraz is now "1/2/3" dnl -AC_DEFUN(APR_EXPAND_VAR,[ +AC_DEFUN([APR_EXPAND_VAR], [ ap_last= ap_cur="$2" while test "x${ap_cur}" != "x${ap_last}"; @@ -691,7 +691,7 @@ dnl Example: dnl orig_path="${prefix}/bar" dnl APR_PATH_RELATIVE(final_path, $orig_path, $prefix) dnl $final_path now contains "bar" -AC_DEFUN(APR_PATH_RELATIVE,[ +AC_DEFUN([APR_PATH_RELATIVE], [ ap_stripped=`echo $2 | sed -e "s#^$3##"` # check if the stripping was successful if test "x$2" != "x${ap_stripped}"; then @@ -709,12 +709,12 @@ dnl AC_HELP_STRING, so let's try to call it if we can. dnl Note: this define must be on one line so that it can be properly returned dnl as the help string. When using this macro with a multi-line RHS, ensure dnl that you surround the macro invocation with []s -AC_DEFUN(APR_HELP_STRING,[ifelse(regexp(AC_ACVERSION, 2\.1), -1, AC_HELP_STRING([$1],[$2]),[ ][$1] substr([ ],len($1))[$2])]) +AC_DEFUN([APR_HELP_STRING], [ifelse(regexp(AC_ACVERSION, 2\.1), -1, AC_HELP_STRING([$1],[$2]),[ ][$1] substr([ ],len($1))[$2])]) dnl dnl APR_LAYOUT(configlayout, layoutname [, extravars]) dnl -AC_DEFUN(APR_LAYOUT,[ +AC_DEFUN([APR_LAYOUT], [ if test ! -f $srcdir/config.layout; then echo "** Error: Layout file $srcdir/config.layout not found" echo "** Error: Cannot use undefined layout '$LAYOUT'" @@ -770,7 +770,7 @@ AC_DEFUN(APR_LAYOUT,[ dnl dnl APR_ENABLE_LAYOUT(default layout name [, extra vars]) dnl -AC_DEFUN(APR_ENABLE_LAYOUT,[ +AC_DEFUN([APR_ENABLE_LAYOUT], [ AC_ARG_ENABLE(layout, [ --enable-layout=LAYOUT],[ LAYOUT=$enableval @@ -791,7 +791,7 @@ dnl APR_PARSE_ARGUMENTS dnl a reimplementation of autoconf's argument parser, dnl used here to allow us to co-exist layouts and argument based dnl set ups. -AC_DEFUN(APR_PARSE_ARGUMENTS,[ +AC_DEFUN([APR_PARSE_ARGUMENTS], [ ac_prev= for ac_option do @@ -913,7 +913,7 @@ dnl APR_CHECK_DEPEND dnl dnl Determine what program we can use to generate .deps-style dependencies dnl -AC_DEFUN(APR_CHECK_DEPEND,[ +AC_DEFUN([APR_CHECK_DEPEND], [ dnl Try to determine what depend program we can use dnl All GCC-variants should have -MM. dnl If not, then we can check on those, too. diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 64e80755167..6d1c525ce9f 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -24,7 +24,7 @@ dnl Note that if the system doesn't have gai_strerror(), we dnl can't use getaddrinfo() because we can't get strings dnl describing the error codes. dnl -AC_DEFUN(APR_CHECK_WORKING_GETADDRINFO,[ +AC_DEFUN([APR_CHECK_WORKING_GETADDRINFO], [ AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[ AC_TRY_RUN( [ #ifdef HAVE_NETDB_H @@ -73,7 +73,7 @@ fi ]) dnl Check whether the AI_ADDRCONFIG flag can be used with getaddrinfo -AC_DEFUN(APR_CHECK_GETADDRINFO_ADDRCONFIG, [ +AC_DEFUN([APR_CHECK_GETADDRINFO_ADDRCONFIG], [ AC_CACHE_CHECK(for working AI_ADDRCONFIG, apr_cv_gai_addrconfig, [ AC_TRY_RUN([ #ifdef HAVE_NETDB_H @@ -109,7 +109,7 @@ fi dnl dnl check for working getnameinfo() dnl -AC_DEFUN(APR_CHECK_WORKING_GETNAMEINFO,[ +AC_DEFUN([APR_CHECK_WORKING_GETNAMEINFO], [ AC_CACHE_CHECK(for working getnameinfo, ac_cv_working_getnameinfo,[ AC_TRY_RUN( [ #ifdef HAVE_NETDB_H @@ -164,7 +164,7 @@ fi dnl dnl check for negative error codes for getaddrinfo() dnl -AC_DEFUN(APR_CHECK_NEGATIVE_EAI,[ +AC_DEFUN([APR_CHECK_NEGATIVE_EAI], [ AC_CACHE_CHECK(for negative error codes for getaddrinfo, ac_cv_negative_eai,[ AC_TRY_RUN( [ #ifdef HAVE_NETDB_H @@ -196,7 +196,7 @@ dnl systems dnl dnl Note that this test is executed too early to see if we have all of dnl the headers. -AC_DEFUN(APR_CHECK_GETHOSTBYNAME_R_STYLE,[ +AC_DEFUN([APR_CHECK_GETHOSTBYNAME_R_STYLE], [ dnl Try and compile a glibc2 gethostbyname_r piece of code, and set the dnl style of the routines to glibc2 on success @@ -256,7 +256,7 @@ fi dnl dnl see if TCP_NODELAY setting is inherited from listening sockets dnl -AC_DEFUN(APR_CHECK_TCP_NODELAY_INHERITED,[ +AC_DEFUN([APR_CHECK_TCP_NODELAY_INHERITED], [ AC_CACHE_CHECK(if TCP_NODELAY setting is inherited from listening sockets, ac_cv_tcp_nodelay_inherited,[ AC_TRY_RUN( [ #include @@ -424,7 +424,7 @@ fi dnl dnl see if O_NONBLOCK setting is inherited from listening sockets dnl -AC_DEFUN(APR_CHECK_O_NONBLOCK_INHERITED,[ +AC_DEFUN([APR_CHECK_O_NONBLOCK_INHERITED], [ AC_CACHE_CHECK(if O_NONBLOCK setting is inherited from listening sockets, ac_cv_o_nonblock_inherited,[ AC_TRY_RUN( [ #include @@ -537,7 +537,7 @@ fi dnl dnl check for socklen_t, fall back to unsigned int dnl -AC_DEFUN(APR_CHECK_SOCKLEN_T,[ +AC_DEFUN([APR_CHECK_SOCKLEN_T], [ AC_CACHE_CHECK(for socklen_t, ac_cv_socklen_t,[ AC_TRY_COMPILE([ #ifdef HAVE_SYS_TYPES_H @@ -561,7 +561,7 @@ fi ]) -AC_DEFUN(APR_CHECK_INET_ADDR,[ +AC_DEFUN([APR_CHECK_INET_ADDR], [ AC_CACHE_CHECK(for inet_addr, ac_cv_func_inet_addr,[ AC_TRY_COMPILE([ #ifdef HAVE_SYS_TYPES_H @@ -587,7 +587,7 @@ fi ]) -AC_DEFUN(APR_CHECK_INET_NETWORK,[ +AC_DEFUN([APR_CHECK_INET_NETWORK], [ AC_CACHE_CHECK(for inet_network, ac_cv_func_inet_network,[ AC_TRY_COMPILE([ #ifdef HAVE_SYS_TYPES_H @@ -613,7 +613,7 @@ fi ]) dnl Check for presence of struct sockaddr_storage. -AC_DEFUN(APR_CHECK_SOCKADDR_STORAGE,[ +AC_DEFUN([APR_CHECK_SOCKADDR_STORAGE], [ AC_CACHE_CHECK(for sockaddr_storage, apr_cv_define_sockaddr_storage,[ AC_TRY_COMPILE([ #ifdef HAVE_SYS_TYPES_H @@ -635,7 +635,7 @@ AC_SUBST(have_sa_storage) ]) dnl Check for presence of struct sockaddr_in6. -AC_DEFUN(APR_CHECK_SOCKADDR_IN6,[ +AC_DEFUN([APR_CHECK_SOCKADDR_IN6], [ AC_CACHE_CHECK(for sockaddr_in6, ac_cv_define_sockaddr_in6,[ AC_TRY_COMPILE([ #ifdef HAVE_SYS_TYPES_H @@ -663,7 +663,7 @@ fi dnl dnl APR_H_ERRNO_COMPILE_CHECK dnl -AC_DEFUN(APR_H_ERRNO_COMPILE_CHECK,[ +AC_DEFUN([APR_H_ERRNO_COMPILE_CHECK], [ if test x$1 != x; then CPPFLAGS="-D$1 $CPPFLAGS" fi @@ -749,7 +749,7 @@ dnl APR_CHECK_H_ERRNO_FLAG dnl dnl checks which flags are necessary for to define h_errno dnl -AC_DEFUN(APR_CHECK_H_ERRNO_FLAG,[ +AC_DEFUN([APR_CHECK_H_ERRNO_FLAG], [ AC_MSG_CHECKING([for h_errno in netdb.h]) AC_CACHE_VAL(ac_cv_h_errno_cppflags,[ APR_H_ERRNO_COMPILE_CHECK @@ -777,7 +777,7 @@ AC_DEFUN(APR_CHECK_H_ERRNO_FLAG,[ ]) -AC_DEFUN(APR_EBCDIC,[ +AC_DEFUN([APR_EBCDIC], [ AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ AC_TRY_RUN( [ int main(void) { diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index 6fd1e2348ed..7ce2f49dc4e 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -121,7 +121,7 @@ dnl dnl Try to find a way to enable POSIX threads. Sets the dnl pthreads_working variable to "yes" on success. dnl -AC_DEFUN(APR_PTHREADS_CHECK,[ +AC_DEFUN([APR_PTHREADS_CHECK], [ AC_CACHE_CHECK([for CFLAGS needed for pthreads], [apr_cv_pthreads_cflags], [apr_ptc_cflags=$CFLAGS @@ -194,7 +194,7 @@ AC_DEFUN(APR_PTHREADS_CHECK_RESTORE, [ dnl dnl APR_CHECK_SIGWAIT_ONE_ARG dnl -AC_DEFUN(APR_CHECK_SIGWAIT_ONE_ARG,[ +AC_DEFUN([APR_CHECK_SIGWAIT_ONE_ARG], [ AC_CACHE_CHECK(whether sigwait takes one argument,ac_cv_sigwait_one_arg,[ AC_TRY_COMPILE([ #if defined(__NETBSD__) || defined(DARWIN) From 49bc3c2b52425e2ce297cb35afc4f1888508f8d4 Mon Sep 17 00:00:00 2001 From: Brian Fitzpatrick Date: Wed, 7 Dec 2005 18:29:06 +0000 Subject: [PATCH 5513/7878] Prefix non-static symbols with 'apr__' to avoid namespace conflicts. * random/unix/sha2.h, random/unix/sha2_glue.c, random/unix/sha2.c: Rename SHA256_Init, SHA256_Update, SHA256_Final, SHA256_Transform, SHA384_Init, SHA512_Init, SHA512_Final, SHA384_Final, SHA512_Update, SHA384_Update, and SHA512_Transform, , to apr__SHA256_Init, apr__SHA256_Update, apr__SHA256_Final, apr__SHA256_Transform, apr__SHA384_Init, apr__SHA512_Init, apr__SHA512_Final, apr__SHA384_Final, apr__SHA512_Update, apr__SHA384_Update, and apr__SHA512_Transform. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@354824 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/sha2.c | 66 ++++++++++++++++++++--------------------- random/unix/sha2.h | 18 +++++------ random/unix/sha2_glue.c | 6 ++-- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/random/unix/sha2.c b/random/unix/sha2.c index 94259ca8508..1605b9d5aa1 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -151,8 +151,8 @@ typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ * only. */ void SHA512_Last(SHA512_CTX*); -void SHA256_Transform(SHA256_CTX*, const sha2_word32*); -void SHA512_Transform(SHA512_CTX*, const sha2_word64*); +void apr__SHA256_Transform(SHA256_CTX*, const sha2_word32*); +void apr__SHA512_Transform(SHA512_CTX*, const sha2_word64*); /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ @@ -264,7 +264,7 @@ static const char *sha2_hex_digits = "0123456789abcdef"; /*** SHA-256: *********************************************************/ -void SHA256_Init(SHA256_CTX* context) { +void apr__SHA256_Init(SHA256_CTX* context) { if (context == (SHA256_CTX*)0) { return; } @@ -310,7 +310,7 @@ void SHA256_Init(SHA256_CTX* context) { (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ -void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { +void apr__SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { sha2_word32 a, b, c, d, e, f, g, h, s0, s1; sha2_word32 T1, *W256; int j; @@ -368,7 +368,7 @@ void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { #else /* SHA2_UNROLL_TRANSFORM */ -void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { +void apr__SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { sha2_word32 a, b, c, d, e, f, g, h, s0, s1; sha2_word32 T1, T2, *W256; int j; @@ -448,7 +448,7 @@ void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { #endif /* SHA2_UNROLL_TRANSFORM */ -void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { +void apr__SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { unsigned int freespace, usedspace; if (len == 0) { @@ -471,7 +471,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { context->bitcount += freespace << 3; len -= freespace; data += freespace; - SHA256_Transform(context, (sha2_word32*)context->buffer); + apr__SHA256_Transform(context, (sha2_word32*)context->buffer); } else { /* The buffer is not yet full */ MEMCPY_BCOPY(&context->buffer[usedspace], data, len); @@ -483,7 +483,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { } while (len >= SHA256_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ - SHA256_Transform(context, (sha2_word32*)data); + apr__SHA256_Transform(context, (sha2_word32*)data); context->bitcount += SHA256_BLOCK_LENGTH << 3; len -= SHA256_BLOCK_LENGTH; data += SHA256_BLOCK_LENGTH; @@ -497,7 +497,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { usedspace = freespace = 0; } -void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { +void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { sha2_word32 *d = (sha2_word32*)digest; unsigned int usedspace; @@ -524,7 +524,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { MEMSET_BZERO(&context->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ - SHA256_Transform(context, (sha2_word32*)context->buffer); + apr__SHA256_Transform(context, (sha2_word32*)context->buffer); /* And set-up for the last transform: */ MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); @@ -540,7 +540,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; /* Final transform: */ - SHA256_Transform(context, (sha2_word32*)context->buffer); + apr__SHA256_Transform(context, (sha2_word32*)context->buffer); #if !APR_IS_BIGENDIAN { @@ -569,7 +569,7 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) { assert(context != (SHA256_CTX*)0); if (buffer != (char*)0) { - SHA256_Final(digest, context); + apr__SHA256_Final(digest, context); for (i = 0; i < SHA256_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; @@ -587,14 +587,14 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) { char* SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) { SHA256_CTX context; - SHA256_Init(&context); - SHA256_Update(&context, data, len); + apr__SHA256_Init(&context); + apr__SHA256_Update(&context, data, len); return SHA256_End(&context, digest); } /*** SHA-512: *********************************************************/ -void SHA512_Init(SHA512_CTX* context) { +void apr__SHA512_Init(SHA512_CTX* context) { if (context == (SHA512_CTX*)0) { return; } @@ -639,7 +639,7 @@ void SHA512_Init(SHA512_CTX* context) { (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ j++ -void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { +void apr__SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { sha2_word64 a, b, c, d, e, f, g, h, s0, s1; sha2_word64 T1, *W512 = (sha2_word64*)context->buffer; int j; @@ -694,7 +694,7 @@ void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { #else /* SHA2_UNROLL_TRANSFORM */ -void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { +void apr__SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { sha2_word64 a, b, c, d, e, f, g, h, s0, s1; sha2_word64 T1, T2, *W512 = (sha2_word64*)context->buffer; int j; @@ -772,7 +772,7 @@ void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { #endif /* SHA2_UNROLL_TRANSFORM */ -void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { +void apr__SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { unsigned int freespace, usedspace; if (len == 0) { @@ -795,7 +795,7 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { ADDINC128(context->bitcount, freespace << 3); len -= freespace; data += freespace; - SHA512_Transform(context, (sha2_word64*)context->buffer); + apr__SHA512_Transform(context, (sha2_word64*)context->buffer); } else { /* The buffer is not yet full */ MEMCPY_BCOPY(&context->buffer[usedspace], data, len); @@ -807,7 +807,7 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { } while (len >= SHA512_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ - SHA512_Transform(context, (sha2_word64*)data); + apr__SHA512_Transform(context, (sha2_word64*)data); ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3); len -= SHA512_BLOCK_LENGTH; data += SHA512_BLOCK_LENGTH; @@ -843,7 +843,7 @@ void SHA512_Last(SHA512_CTX* context) { MEMSET_BZERO(&context->buffer[usedspace], SHA512_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ - SHA512_Transform(context, (sha2_word64*)context->buffer); + apr__SHA512_Transform(context, (sha2_word64*)context->buffer); /* And set-up for the last transform: */ MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH - 2); @@ -860,10 +860,10 @@ void SHA512_Last(SHA512_CTX* context) { *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; /* Final transform: */ - SHA512_Transform(context, (sha2_word64*)context->buffer); + apr__SHA512_Transform(context, (sha2_word64*)context->buffer); } -void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { +void apr__SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { sha2_word64 *d = (sha2_word64*)digest; /* Sanity check: */ @@ -900,7 +900,7 @@ char *SHA512_End(SHA512_CTX* context, char buffer[]) { assert(context != (SHA512_CTX*)0); if (buffer != (char*)0) { - SHA512_Final(digest, context); + apr__SHA512_Final(digest, context); for (i = 0; i < SHA512_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; @@ -918,14 +918,14 @@ char *SHA512_End(SHA512_CTX* context, char buffer[]) { char* SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) { SHA512_CTX context; - SHA512_Init(&context); - SHA512_Update(&context, data, len); + apr__SHA512_Init(&context); + apr__SHA512_Update(&context, data, len); return SHA512_End(&context, digest); } /*** SHA-384: *********************************************************/ -void SHA384_Init(SHA384_CTX* context) { +void apr__SHA384_Init(SHA384_CTX* context) { if (context == (SHA384_CTX*)0) { return; } @@ -934,11 +934,11 @@ void SHA384_Init(SHA384_CTX* context) { context->bitcount[0] = context->bitcount[1] = 0; } -void SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) { - SHA512_Update((SHA512_CTX*)context, data, len); +void apr__SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) { + apr__SHA512_Update((SHA512_CTX*)context, data, len); } -void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { +void apr__SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { sha2_word64 *d = (sha2_word64*)digest; /* Sanity check: */ @@ -975,7 +975,7 @@ char *SHA384_End(SHA384_CTX* context, char buffer[]) { assert(context != (SHA384_CTX*)0); if (buffer != (char*)0) { - SHA384_Final(digest, context); + apr__SHA384_Final(digest, context); for (i = 0; i < SHA384_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; @@ -993,8 +993,8 @@ char *SHA384_End(SHA384_CTX* context, char buffer[]) { char* SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) { SHA384_CTX context; - SHA384_Init(&context); - SHA384_Update(&context, data, len); + apr__SHA384_Init(&context); + apr__SHA384_Update(&context, data, len); return SHA384_End(&context, digest); } diff --git a/random/unix/sha2.h b/random/unix/sha2.h index 7f582161499..ae0526fcfba 100644 --- a/random/unix/sha2.h +++ b/random/unix/sha2.h @@ -57,23 +57,23 @@ typedef SHA512_CTX SHA384_CTX; /*** SHA-256/384/512 Function Prototypes ******************************/ -void SHA256_Init(SHA256_CTX *); -void SHA256_Update(SHA256_CTX *, const apr_byte_t *, size_t); -void SHA256_Final(apr_byte_t [SHA256_DIGEST_LENGTH], SHA256_CTX *); +void apr__SHA256_Init(SHA256_CTX *); +void apr__SHA256_Update(SHA256_CTX *, const apr_byte_t *, size_t); +void apr__SHA256_Final(apr_byte_t [SHA256_DIGEST_LENGTH], SHA256_CTX *); char* SHA256_End(SHA256_CTX *, char [SHA256_DIGEST_STRING_LENGTH]); char* SHA256_Data(const apr_byte_t *, size_t, char [SHA256_DIGEST_STRING_LENGTH]); -void SHA384_Init(SHA384_CTX *); -void SHA384_Update(SHA384_CTX *, const apr_byte_t *, size_t); -void SHA384_Final(apr_byte_t [SHA384_DIGEST_LENGTH], SHA384_CTX *); +void apr__SHA384_Init(SHA384_CTX *); +void apr__SHA384_Update(SHA384_CTX *, const apr_byte_t *, size_t); +void apr__SHA384_Final(apr_byte_t [SHA384_DIGEST_LENGTH], SHA384_CTX *); char* SHA384_End(SHA384_CTX *, char [SHA384_DIGEST_STRING_LENGTH]); char* SHA384_Data(const apr_byte_t *, size_t, char [SHA384_DIGEST_STRING_LENGTH]); -void SHA512_Init(SHA512_CTX *); -void SHA512_Update(SHA512_CTX *, const apr_byte_t *, size_t); -void SHA512_Final(apr_byte_t [SHA512_DIGEST_LENGTH], SHA512_CTX *); +void apr__SHA512_Init(SHA512_CTX *); +void apr__SHA512_Update(SHA512_CTX *, const apr_byte_t *, size_t); +void apr__SHA512_Final(apr_byte_t [SHA512_DIGEST_LENGTH], SHA512_CTX *); char* SHA512_End(SHA512_CTX *, char [SHA512_DIGEST_STRING_LENGTH]); char* SHA512_Data(const apr_byte_t *, size_t, char [SHA512_DIGEST_STRING_LENGTH]); diff --git a/random/unix/sha2_glue.c b/random/unix/sha2_glue.c index 08f4de3f637..4909a8fe1f8 100644 --- a/random/unix/sha2_glue.c +++ b/random/unix/sha2_glue.c @@ -5,18 +5,18 @@ static void sha256_init(apr_crypto_hash_t *h) { - SHA256_Init(h->data); + apr__SHA256_Init(h->data); } static void sha256_add(apr_crypto_hash_t *h,const void *data, apr_size_t bytes) { - SHA256_Update(h->data,data,bytes); + apr__SHA256_Update(h->data,data,bytes); } static void sha256_finish(apr_crypto_hash_t *h,unsigned char *result) { - SHA256_Final(result,h->data); + apr__SHA256_Final(result,h->data); } APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p) From 313d0980744ba2d94a4b784008119c4e1b637be0 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Thu, 8 Dec 2005 03:17:18 +0000 Subject: [PATCH 5514/7878] Fix multicast w/ source specific groups when compiled with --disable-ipv6. PR: 37827 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@354955 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/multicast.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index 8f3317ae366..950cdf7a711 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -121,12 +121,17 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock, if (source != NULL) { #if MCAST_JOIN_SOURCE_GROUP - if (sock_is_ipv6(sock)) + if (sock_is_ipv4(sock)) { ip_proto = IPPROTO_IP; - else if (sock_is_ipv6(sock)) + } +#if APR_HAVE_IPV6 + else if (sock_is_ipv6(sock)) { ip_proto = IPPROTO_IPV6; - else + } +#endif + else { return APR_ENOTIMPL; + } if (type == IP_ADD_MEMBERSHIP) type = MCAST_JOIN_SOURCE_GROUP; From 6c4a6a3638dd18d1797c4d410bc33dea918cc27d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 8 Dec 2005 17:09:32 +0000 Subject: [PATCH 5515/7878] * network_io/unix/sockets.c: Remove stray semi-colon after APR_POOL_IMPLEMENT_ACCESSOR. PR: 37840 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@355141 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 941889bdf67..48f1cf4d856 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -422,7 +422,7 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, return APR_SUCCESS; } -APR_POOL_IMPLEMENT_ACCESSOR(socket); +APR_POOL_IMPLEMENT_ACCESSOR(socket) APR_IMPLEMENT_INHERIT_SET(socket, inherit, pool, socket_cleanup) From 67c5f6e0373bf160286a419af713489091503c9e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 9 Dec 2005 12:29:33 +0000 Subject: [PATCH 5516/7878] * random/unix/sha2.h, random/unix/sha2.c: Fix more global symbols. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@355464 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/sha2.c | 26 +++++++++++++------------- random/unix/sha2.h | 12 ++++++------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/random/unix/sha2.c b/random/unix/sha2.c index 1605b9d5aa1..63d2fe93418 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -150,7 +150,7 @@ typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ * library -- they are intended for private internal visibility/use * only. */ -void SHA512_Last(SHA512_CTX*); +void apr__SHA512_Last(SHA512_CTX*); void apr__SHA256_Transform(SHA256_CTX*, const sha2_word32*); void apr__SHA512_Transform(SHA512_CTX*, const sha2_word64*); @@ -561,7 +561,7 @@ void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { usedspace = 0; } -char *SHA256_End(SHA256_CTX* context, char buffer[]) { +char *apr__SHA256_End(SHA256_CTX* context, char buffer[]) { sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest; int i; @@ -584,12 +584,12 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) { return buffer; } -char* SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) { +char* apr__SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) { SHA256_CTX context; apr__SHA256_Init(&context); apr__SHA256_Update(&context, data, len); - return SHA256_End(&context, digest); + return apr__SHA256_End(&context, digest); } @@ -821,7 +821,7 @@ void apr__SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) usedspace = freespace = 0; } -void SHA512_Last(SHA512_CTX* context) { +void apr__SHA512_Last(SHA512_CTX* context) { unsigned int usedspace; usedspace = (unsigned int)((context->bitcount[0] >> 3) @@ -871,7 +871,7 @@ void apr__SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { - SHA512_Last(context); + apr__SHA512_Last(context); /* Save the hash data for output: */ #if !APR_IS_BIGENDIAN @@ -892,7 +892,7 @@ void apr__SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { MEMSET_BZERO(context, sizeof(context)); } -char *SHA512_End(SHA512_CTX* context, char buffer[]) { +char *apr__SHA512_End(SHA512_CTX* context, char buffer[]) { sha2_byte digest[SHA512_DIGEST_LENGTH], *d = digest; int i; @@ -915,12 +915,12 @@ char *SHA512_End(SHA512_CTX* context, char buffer[]) { return buffer; } -char* SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) { +char* apr__SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) { SHA512_CTX context; apr__SHA512_Init(&context); apr__SHA512_Update(&context, data, len); - return SHA512_End(&context, digest); + return apr__SHA512_End(&context, digest); } @@ -946,7 +946,7 @@ void apr__SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { - SHA512_Last((SHA512_CTX*)context); + apr__SHA512_Last((SHA512_CTX*)context); /* Save the hash data for output: */ #if !APR_IS_BIGENDIAN @@ -967,7 +967,7 @@ void apr__SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { MEMSET_BZERO(context, sizeof(context)); } -char *SHA384_End(SHA384_CTX* context, char buffer[]) { +char *apr__SHA384_End(SHA384_CTX* context, char buffer[]) { sha2_byte digest[SHA384_DIGEST_LENGTH], *d = digest; int i; @@ -990,11 +990,11 @@ char *SHA384_End(SHA384_CTX* context, char buffer[]) { return buffer; } -char* SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) { +char* apr__SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) { SHA384_CTX context; apr__SHA384_Init(&context); apr__SHA384_Update(&context, data, len); - return SHA384_End(&context, digest); + return apr__SHA384_End(&context, digest); } diff --git a/random/unix/sha2.h b/random/unix/sha2.h index ae0526fcfba..b1c3988d55b 100644 --- a/random/unix/sha2.h +++ b/random/unix/sha2.h @@ -60,22 +60,22 @@ typedef SHA512_CTX SHA384_CTX; void apr__SHA256_Init(SHA256_CTX *); void apr__SHA256_Update(SHA256_CTX *, const apr_byte_t *, size_t); void apr__SHA256_Final(apr_byte_t [SHA256_DIGEST_LENGTH], SHA256_CTX *); -char* SHA256_End(SHA256_CTX *, char [SHA256_DIGEST_STRING_LENGTH]); -char* SHA256_Data(const apr_byte_t *, size_t, +char* apr__SHA256_End(SHA256_CTX *, char [SHA256_DIGEST_STRING_LENGTH]); +char* apr__SHA256_Data(const apr_byte_t *, size_t, char [SHA256_DIGEST_STRING_LENGTH]); void apr__SHA384_Init(SHA384_CTX *); void apr__SHA384_Update(SHA384_CTX *, const apr_byte_t *, size_t); void apr__SHA384_Final(apr_byte_t [SHA384_DIGEST_LENGTH], SHA384_CTX *); -char* SHA384_End(SHA384_CTX *, char [SHA384_DIGEST_STRING_LENGTH]); -char* SHA384_Data(const apr_byte_t *, size_t, +char* apr__SHA384_End(SHA384_CTX *, char [SHA384_DIGEST_STRING_LENGTH]); +char* apr__SHA384_Data(const apr_byte_t *, size_t, char [SHA384_DIGEST_STRING_LENGTH]); void apr__SHA512_Init(SHA512_CTX *); void apr__SHA512_Update(SHA512_CTX *, const apr_byte_t *, size_t); void apr__SHA512_Final(apr_byte_t [SHA512_DIGEST_LENGTH], SHA512_CTX *); -char* SHA512_End(SHA512_CTX *, char [SHA512_DIGEST_STRING_LENGTH]); -char* SHA512_Data(const apr_byte_t *, size_t, +char* apr__SHA512_End(SHA512_CTX *, char [SHA512_DIGEST_STRING_LENGTH]); +char* apr__SHA512_Data(const apr_byte_t *, size_t, char [SHA512_DIGEST_STRING_LENGTH]); #ifdef __cplusplus From f6c3f7aaec5e51b051c8cf4eb3180c1b39b91da3 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Sat, 10 Dec 2005 20:53:34 +0000 Subject: [PATCH 5517/7878] Only include uuid/uuid.h if we havne't already included uuid.h, since including both can result in type conflicts depending on what packages have been installed on a machine. * misc/unix/rand.c: Only include uuid/uuid.h if we haven't included uuid.h. * CHANGES: Note change. Submitted by: Craig Rodrigues git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@355780 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ misc/unix/rand.c | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 06ecbd2f1e6..3847e8225a2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +Changes for APR ??? + + *) Only include uuid/uuid.h if we haven't already included uuid.h, since + doing so can result in type conflicts. + [Craig Rodrigues ] + Changes for APR 1.3.0 *) Bugfix for apr_pollset_poll() on systems that implement pollsets diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 4691f08a19b..1763bb41339 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -35,11 +35,10 @@ #if APR_HAVE_SYS_UN_H #include #endif -#ifdef HAVE_UUID_UUID_H -#include -#endif #ifdef HAVE_UUID_H #include +#elif defined(HAVE_UUID_UUID_H) +#include #endif #ifndef SHUT_RDWR From 767bfce5bad785c2ee43b2397816ae7d41602184 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Sat, 10 Dec 2005 22:22:12 +0000 Subject: [PATCH 5518/7878] Fix handling of EOF for unbuffered reads on win32. * file_io/win32/readwrite.c (apr_file_read): In the unbuffered case, set thefile->eof_true if we hit EOF. * CHANGES: note Change. Submitted by: Konstantin Sharenkov Reviewed by: wrowe, rooneg git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@355790 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++++- file_io/win32/readwrite.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 3847e8225a2..0b3bad67152 100644 --- a/CHANGES +++ b/CHANGES @@ -2,7 +2,10 @@ Changes for APR ??? *) Only include uuid/uuid.h if we haven't already included uuid.h, since doing so can result in type conflicts. - [Craig Rodrigues ] + [Craig Rodrigues ] + + *) Fix EOF handling for unbuffered reads on win32. + [Konstantin Sharenkov ] Changes for APR 1.3.0 diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 23538f9c7fd..9d5eb1bd041 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -206,6 +206,8 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size /* Unbuffered i/o */ apr_size_t nbytes; rv = read_with_timeout(thefile, buf, *len, &nbytes); + if (rv == APR_EOF) + thefile->eof_hit = TRUE; *len = nbytes; } From 0eff656837f876f458d76495c5ac07f15aca4073 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Sat, 10 Dec 2005 22:29:40 +0000 Subject: [PATCH 5519/7878] Fix passing "" as an argument to a new program on windows. * threadproc/win32/proc.c (apr_proc_create): Pass empty strings into CreateProcess instead of filtering them out. * CHANGES: Note change. Submitted by: Philip Martin Reviewed by: wrowe, rooneg git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@355792 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ threadproc/win32/proc.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 0b3bad67152..07e7bedcbd7 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,10 @@ Changes for APR ??? *) Fix EOF handling for unbuffered reads on win32. [Konstantin Sharenkov ] + *) Fix passing "" as an argument to the program started by apr_proc_create + on Win32. + [Philip Martin + Changes for APR 1.3.0 *) Bugfix for apr_pollset_poll() on systems that implement pollsets diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index df75b836b14..63d7e9cc57d 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -460,7 +460,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, /* Handle the args, seperate from argv0 */ cmdline = ""; for (i = 1; args && args[i]; ++i) { - if (has_space(args[i])) { + if (has_space(args[i]) || !args[i][0]) { cmdline = apr_pstrcat(pool, cmdline, " \"", args[i], "\"", NULL); } else { From 644a19240a097ff2debea45db0de5afe37f9c09c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 10 Dec 2005 23:55:06 +0000 Subject: [PATCH 5520/7878] Cause apr_file_write_full on win32 to consider the timeout value set by apr_file_pipe_timeout_set. PR 30182 [also note the last changes are all still tracking to 1.3.0] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@355812 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 +++++--- file_io/win32/readwrite.c | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 07e7bedcbd7..fc019b8450b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ -Changes for APR ??? +Changes for APR 1.3.0 + + *) Cause apr_file_write_full on win32 to consider the timeout value set by + apr_file_pipe_timeout_set. PR 30182 + [] *) Only include uuid/uuid.h if we haven't already included uuid.h, since doing so can result in type conflicts. @@ -11,8 +15,6 @@ Changes for APR ??? on Win32. [Philip Martin -Changes for APR 1.3.0 - *) Bugfix for apr_pollset_poll() on systems that implement pollsets using select(2): properly compute the number of signalled desciptors when one or more of them are both readable and writable. diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 9d5eb1bd041..6d6a077fe3b 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -311,8 +311,20 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a (*nbytes) = 0; rv = apr_get_os_error(); if (rv == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) { - /* Wait for the pending i/o (put a timeout here?) */ - rv = WaitForSingleObject(thefile->pOverlapped->hEvent, INFINITE); + + DWORD timeout_ms; + + if (thefile->timeout == 0) { + timeout_ms = 0; + } + else if (thefile->timeout < 0) { + timeout_ms = INFINITE; + } + else { + timeout_ms = thefile->timeout / 1000; + } + + rv = WaitForSingleObject(thefile->pOverlapped->hEvent, timemilliseconds); switch (rv) { case WAIT_OBJECT_0: GetOverlappedResult(thefile->filehand, thefile->pOverlapped, (LPDWORD)nbytes, TRUE); From 0dc2b4ad5438fea8ae6097e6fb4208b7a68e9ec3 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Tue, 13 Dec 2005 19:21:28 +0000 Subject: [PATCH 5521/7878] Use APR_STATUS_IS_INCOMPLETE instead of comparing directly against APR_INCOMPLETE in a few test programs. * test/testfileinfo.c (test_info_get, test_stat, test_mtime_set): Use APR_STATUS_IS_INCOMPLETE. * test/sendfile.c (create_testfile): Use APR_STATUS_IS_INCOMPLETE. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@356578 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 2 +- test/testfileinfo.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/sendfile.c b/test/sendfile.c index efe1b89186f..ae8b4cf90bf 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -147,7 +147,7 @@ static void create_testfile(apr_pool_t *p, const char *fname) } rv = apr_stat(&finfo, fname, APR_FINFO_NORM, p); - if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) { + if (rv != APR_SUCCESS && ! APR_STATUS_IS_INCOMPLETE(rv)) { fprintf(stderr, "apr_stat()->%d/%s\n", rv, apr_strerror(rv, buf, sizeof buf)); exit(1); diff --git a/test/testfileinfo.c b/test/testfileinfo.c index de5415f1159..6a6cf10f671 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -113,7 +113,7 @@ static void test_info_get(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); - if (rv == APR_INCOMPLETE) { + if (APR_STATUS_IS_INCOMPLETE(rv)) { char *str; int i; str = apr_pstrdup(p, "APR_INCOMPLETE: Missing "); @@ -134,7 +134,7 @@ static void test_stat(abts_case *tc, void *data) apr_status_t rv; rv = apr_stat(&finfo, FILENAME, APR_FINFO_NORM, p); - if (rv == APR_INCOMPLETE) { + if (APR_STATUS_IS_INCOMPLETE(rv)) { char *str; int i; str = apr_pstrdup(p, "APR_INCOMPLETE: Missing "); @@ -220,7 +220,7 @@ static void test_mtime_set(abts_case *tc, void *data) /* Check that the current mtime is not the epoch */ rv = apr_stat(&finfo, NEWFILENAME, APR_FINFO_MTIME, p); - if (rv == APR_INCOMPLETE) { + if (APR_STATUS_IS_INCOMPLETE(rv)) { char *str; int i; str = apr_pstrdup(p, "APR_INCOMPLETE: Missing "); From c37751727e07b2fa2d85f650498ee55afff57966 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Tue, 13 Dec 2005 21:00:34 +0000 Subject: [PATCH 5522/7878] Clean up the documentation surrounding the APR_INCOMPLETE status code, * include/apr_file_info.h (apr_stat, apr_dir_read): Note that APR_INCOMPLETE can be returned, and that if it is you can use the finfo->valid bitfield to determine which parts of the finfo are filled in. Also break some overly long lines. * include/apr_errno.h (APR_STATUS_IS_INCOMPLETE): Update docs since this is no longer specific to the xlate code. * CHANGES: Note change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@356615 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ include/apr_errno.h | 4 ++-- include/apr_file_info.h | 14 ++++++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index fc019b8450b..5ab9edf8ab1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes for APR 1.3.0 + *) Documented that apr_stat and apr_dir_read can return APR_INCOMPLETE, + and how to determine which parts of the resulting apr_finfo_t can be + used in such a case. + [Garrett Rooney] + *) Cause apr_file_write_full on win32 to consider the timeout value set by apr_file_pipe_timeout_set. PR 30182 [] diff --git a/include/apr_errno.h b/include/apr_errno.h index 77b383a8c03..9f4e569e9ee 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -467,8 +467,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, */ #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP) /** - * The character conversion stopped because of an incomplete character or - * shift sequence at the end of the input buffer. + * The operation was incomplete although some processing was performed + * and the results are partially valid. * @warning * always use this test, as platform-specific variances may meet this * more than one error code diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 4680caba22a..bb417041ecc 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -224,8 +224,13 @@ struct apr_finfo_t { * @param finfo Where to store the information about the file, which is * never touched if the call fails. * @param fname The name of the file to stat. - * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values + * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ + values * @param pool the pool to use to allocate the new file. + * + * @note If @c APR_INCOMPLETE is returned all the fields in @a finfo may + * not be filled in, and you need to check the @c finfo->valid bitmask + * to verify that what you're looking for is there. */ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *pool); @@ -255,9 +260,14 @@ APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir); /** * Read the next entry from the specified directory. * @param finfo the file info structure and filled in by apr_dir_read - * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values + * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ + values * @param thedir the directory descriptor returned from apr_dir_open * @remark No ordering is guaranteed for the entries read. + * + * @note If @c APR_INCOMPLETE is returned all the fields in @a finfo may + * not be filled in, and you need to check the @c finfo->valid bitmask + * to verify that what you're looking for is there. */ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_dir_t *thedir); From 600c9f4ecd8021ead4b7b331e9612f48f4f135d1 Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Tue, 13 Dec 2005 21:07:29 +0000 Subject: [PATCH 5523/7878] Remove some at symbols; I'm tired of getting spam. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@356622 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/CHANGES b/CHANGES index 5ab9edf8ab1..8cde06fab31 100644 --- a/CHANGES +++ b/CHANGES @@ -115,7 +115,7 @@ Changes for APR 1.2.0 [Sim , Jeff Trawick] *) Fix apr_table_overlap()'s handling of tables allocated from - different pools. [Joe Schaefer ] + different pools. [Joe Schaefer ] *) Add support for uuid_generate on OS X 10.4. [Paul Querna] @@ -278,7 +278,7 @@ Changes with APR 1.0 the delivery of a particular signal. [Madhusudan Mathihalli] *) Add support for developers to use their own hashing function with - apr_hash_make_custom. [Ami Ganguli ] + apr_hash_make_custom. [Ami Ganguli ] *) Support "large files" by default on 32-bit Unix platforms which implement the LFS standard. [Joe Orton] @@ -474,19 +474,19 @@ Changes with APR 0.9.4 *) Preserve leading '../' segments as when merging to an empty and unrooted path - fixes a bug observed in SVN with Win32/Netware/OS2. - [Mike Pilato , William Rowe] + [Mike Pilato , William Rowe] *) Work around a bug in Darwin when calling getnameinfo() on IPv4-mapped - IPv6-addresses. [Colm MacCárthaigh , Jeff Trawick, + IPv6-addresses. [Colm MacCárthaigh , Jeff Trawick, Justin Erenkrantz] *) Add apr_temp_dir_get() for getting the most suitable temp directory - [Mike Pilato , Thom May] + [Mike Pilato , Thom May] *) Modify apr_sockaddr_info_get to call the resolver when we do not have a hostname. Also, fix bugs in the getaddrinfo() implementation. - [Colm MacCárthaigh , Justin Erenkrantz] + [Colm MacCárthaigh , Justin Erenkrantz] *) Change the behavior of unix process 'trylock's to return APR_ENOTIMPL instead of segfaulting, consistent with the @@ -502,7 +502,7 @@ Changes with APR 0.9.4 *) Add new table function apr_table_compress() and replace red-black trees with mergesort in apr_table_overlap() - [Joe Schaefer , Brian Pane] + [Joe Schaefer , Brian Pane] *) Win32: Adopt Brian Havard's OS/2 rwlock implementation for Windows [Marc Adkins, Bill Stoddard] @@ -531,7 +531,7 @@ Changes with APR 0.9.4 write <= PIPE_BUF bytes gets EAGAIN. APR will now write whatever data will fit. APR applications that relied on the atomic nature of relatively small pipe write requests may be affected. - PR 20295 [Mark Street , Jeff Trawick] + PR 20295 [Mark Street , Jeff Trawick] *) Define _THREAD_SAFE for all compilations on AIX. Previously those of us who used the vendor compiler had it defined @@ -551,7 +551,7 @@ Changes with APR 0.9.4 *) Fix a bug in socket timeout handling on unix that left the socket non-blocking after disabling the timeout. - [Jacob Craig Lewallen ] + [Jacob Craig Lewallen ] *) Added flag APR_FILE_ATTR_HIDDEN for manipulating the "hidden" file attribute on Windows and OS/2. [Branko Cibej] @@ -559,8 +559,8 @@ Changes with APR 0.9.4 *) SECURITY [CAN-2003-0245]: Fixed a bug that could be triggered remotely through mod_dav and possibly other mechanisms, causing an Apache child process to crash. The crash was first reported - by David Endler and was researched and - fixed by Joe Orton . Details will be released + by David Endler and was researched and + fixed by Joe Orton . Details will be released on 30 May 2003. *) apr_proc_wait(): Handle interrupted waitpid(2) calls by calling @@ -599,7 +599,7 @@ Changes with APR 0.9.4 [Jeff Trawick, Justin Erenkrantz] *) Implement APR_SO_RCVBUF socket option on Unix. - [Adam Sussman ] + [Adam Sussman ] *) Don't add the math library (-lm) if the modf() function is already available via libc. [Roy Fielding] @@ -607,7 +607,7 @@ Changes with APR 0.9.4 *) Solaris cc: Don't use the -mt option for threaded builds. That is for non-Posix threading, and the use of it prevented us from linking with -lpthread, which in turn caused weird problems for - APR applications. [Kristofer Spinka ] + APR applications. [Kristofer Spinka ] *) OS/2: apr_stat() fixes - When a character device is stat'ed, fill in finfo.name if it was asked for. Return APR_INCOMPLETE @@ -619,7 +619,7 @@ Changes with APR 0.9.3 *) Don't enable posixsem, at build time, on systems where sem_t * won't "fit" into an int (sizeof-wise). Also, better error handling when we fail to create a posixsem. PR 17186 [Scott Herod - , Jim Jagielski] + , Jim Jagielski] *) Default hpux 10.x to disable threading, since if it exists at all the pthread implementation should not be trusted, while hpux 10 @@ -627,14 +627,14 @@ Changes with APR 0.9.3 PR 9457 [William Rowe] *) Fix error in apr-config when symlinks are involved. - [Garrett Rooney ] + [Garrett Rooney ] Changes with APR 0.9.2 *) Numerous bug fixes for file and socket inheritence by child processes on Unix, correcting bugs that affected the correct behavior of apr_[file|socket]_inherit_[un]set() API. - [Bjoern A. Zeeb , William Rowe, Joe Orton] + [Bjoern A. Zeeb , William Rowe, Joe Orton] *) Define APR_UINT64_T_FMT and APR_UINT64_T_FMT_LEN. Define APR_INT64_T_FMT_LEN on Windows and Netware. [Branko Cibej] From 1e65503a6c558d5dedf54f46147ec98aa31cf39e Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Tue, 13 Dec 2005 21:14:05 +0000 Subject: [PATCH 5524/7878] Remove /usr/local/apache2 from the paths the APR_FIND_APR[R|U] macros search and document the change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@356625 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ build/find_apr.m4 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8cde06fab31..da54604bd1a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) APR_FIND_APR macro no longer checks /usr/local/apache2/ + [Colm MacCarthaigh] + *) Documented that apr_stat and apr_dir_read can return APR_INCOMPLETE, and how to determine which parts of the resulting apr_finfo_t can be used in such a case. diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 117fb06f259..2f7a95fc8fe 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -128,7 +128,7 @@ AC_DEFUN([APR_FIND_APR], [ break else dnl look in some standard places - for lookdir in /usr /usr/local /usr/local/apr /opt/apr /usr/local/apache2; do + for lookdir in /usr /usr/local /usr/local/apr /opt/apr; do if $TEST_X "$lookdir/bin/$apr_temp_apr_config_file"; then apr_found="yes" apr_config="$lookdir/bin/$apr_temp_apr_config_file" From 2fdc2d47a5cb440054b4734c8ad13b55e292d73b Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Thu, 15 Dec 2005 00:15:52 +0000 Subject: [PATCH 5525/7878] Add a 5th argument to the APR_FIND_APR and the APR_FIND_APU macros which accepts a macro to perform a detailed check on each installed copy of apr/apr-util. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@356957 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 2f7a95fc8fe..6962f38b3a7 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -21,7 +21,8 @@ dnl library. It provides a standardized mechanism for using APR. It supports dnl embedding APR into the application source, or locating an installed dnl copy of APR. dnl -dnl APR_FIND_APR(srcdir, builddir, implicit-install-check, acceptable-majors) +dnl APR_FIND_APR(srcdir, builddir, implicit-install-check, acceptable-majors, +dnl detailed-check) dnl dnl where srcdir is the location of the bundled APR source directory, or dnl empty if source is not bundled. @@ -38,6 +39,14 @@ dnl If multiple versions are specified, and --with-apr=PREFIX or the dnl implicit installed search are used, then the first (leftmost) version dnl in the list that is found will be used. Currently defaults to [0 1]. dnl +dnl where detailed-check is an M4 macro which sets the apr_acceptable to +dnl either "yes" or "no". The macro will be invoked for each installed +dnl copy of APR found, with the apr_config variable set appropriately. +dnl Only installed copies of APR which are considered acceptable by +dnl this macro will be considered found. If no installed copies are +dnl considered acceptable by this macro, apr_found will be set to either +dnl either "no" or "reconfig". +dnl dnl Sets the following variables on exit: dnl dnl apr_found : "yes", "no", "reconfig" @@ -100,16 +109,28 @@ AC_DEFUN([APR_FIND_APR], [ for lookdir in "$withval/bin" "$withval" do if $TEST_X "$lookdir/$apr_temp_apr_config_file"; then - apr_found="yes" apr_config="$lookdir/$apr_temp_apr_config_file" + ifelse([$5], [], [], [ + apr_acceptable="yes" + $5 + if test "$apr_acceptable" != "yes"; then + AC_MSG_WARN([Found APR in $apr_config, but we think it is considered unacceptable) + continue + fi]) + apr_found="yes" break 2 fi done done if test "$apr_found" != "yes" && $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then - apr_found="yes" apr_config="$withval" + ifelse([$5], [], [apr_found="yes"], [ + apr_acceptable="yes" + $5 + if test "$apr_acceptable" = "yes"; then + apr_found="yes" + fi]) fi dnl if --with-apr is used, it is a fatal error for its argument @@ -123,15 +144,29 @@ AC_DEFUN([APR_FIND_APR], [ for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config do if $apr_temp_apr_config_file --help > /dev/null 2>&1 ; then - apr_found="yes" apr_config="$apr_temp_apr_config_file" + ifelse([$5], [], [], [ + apr_acceptable="yes" + $5 + if test "$apr_acceptable" != "yes"; then + AC_MSG_WARN([Found APR in $apr_config, but we think it's bad]) + continue + fi]) + apr_found="yes" break else dnl look in some standard places for lookdir in /usr /usr/local /usr/local/apr /opt/apr; do if $TEST_X "$lookdir/bin/$apr_temp_apr_config_file"; then - apr_found="yes" apr_config="$lookdir/bin/$apr_temp_apr_config_file" + ifelse([$5], [], [], [ + apr_acceptable="yes" + $5 + if test "$apr_acceptable" != "yes"; then + AC_MSG_WARN([Found APR in $apr_config, but we think it's bad]) + continue + fi]) + apr_found="yes" break 2 fi done From d1b2c8f9c5aab7410000c0c3ff3980046b4cc9c8 Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Thu, 15 Dec 2005 00:18:19 +0000 Subject: [PATCH 5526/7878] Document the change for users. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@356958 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index da54604bd1a..c9eb146640b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) APR_FIND_APR macro now supports customisable detailed checks on + each installed apr. [Justin Erenkrantz, Colm MacCarthaigh] + *) APR_FIND_APR macro no longer checks /usr/local/apache2/ [Colm MacCarthaigh] From 230f2a86e2698321026efd1a198c609af423d032 Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Thu, 15 Dec 2005 00:29:21 +0000 Subject: [PATCH 5527/7878] Reconcile our end-user instructions for the --with-apr and --with-apr-util arguments with what works. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@356960 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 6962f38b3a7..e0373fb65c0 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -97,8 +97,8 @@ AC_DEFUN([APR_FIND_APR], [ AC_MSG_CHECKING(for APR) AC_ARG_WITH(apr, - [ --with-apr=PATH prefix for installed APR, path to APR build tree, - or the full path to apr-config], + [ --with-apr=PATH prefix for installed APR or the full path to + apr-config], [ if test "$withval" = "no" || test "$withval" = "yes"; then AC_MSG_ERROR([--with-apr requires a directory or file to be provided]) From c3f828c74c941a115002d25adc93cbaf00a08c16 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 16 Dec 2005 12:00:15 +0000 Subject: [PATCH 5528/7878] * build/find_apr.m4: Fix syntax error. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@357155 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index e0373fb65c0..28fc8284f11 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -114,7 +114,7 @@ AC_DEFUN([APR_FIND_APR], [ apr_acceptable="yes" $5 if test "$apr_acceptable" != "yes"; then - AC_MSG_WARN([Found APR in $apr_config, but we think it is considered unacceptable) + AC_MSG_WARN([Found APR in $apr_config, but we think it is considered unacceptable]) continue fi]) apr_found="yes" From 4f6fc2f527bbbfc2a854752261e5d0c56a7a6b4f Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Fri, 16 Dec 2005 17:54:38 +0000 Subject: [PATCH 5529/7878] Change the warning messages as per Joe's much better suggestion. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@357198 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 28fc8284f11..fea037e2a36 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -149,7 +149,7 @@ AC_DEFUN([APR_FIND_APR], [ apr_acceptable="yes" $5 if test "$apr_acceptable" != "yes"; then - AC_MSG_WARN([Found APR in $apr_config, but we think it's bad]) + AC_MSG_WARN([skipped APR at $apr_config, version not acceptable]) continue fi]) apr_found="yes" @@ -163,7 +163,7 @@ AC_DEFUN([APR_FIND_APR], [ apr_acceptable="yes" $5 if test "$apr_acceptable" != "yes"; then - AC_MSG_WARN([Found APR in $apr_config, but we think it's bad]) + AC_MSG_WARN([skipped APR at $apr_config, version not acceptable]) continue fi]) apr_found="yes" From 15020e905cbef5de6f3ef312b0339d9894c022f0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 19 Dec 2005 05:14:30 +0000 Subject: [PATCH 5530/7878] Fix various MS VC 14 (Studio 2005) 'bugs', e.g. MS's choice of dumping the POSIX standard. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@357636 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/apr.hw b/include/apr.hw index 1a3c67401bd..0fd7bc99f44 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -56,6 +56,14 @@ */ #pragma warning(disable: 4100 4127 4163 4201 4514; once: 4057 4075 4244) +/* Ignore Microsoft's interpretation of secure development + * and the POSIX string handling API + */ +#if defined(_MSC_VER) && _MSC_VER >= 1400 +#define _CRT_SECURE_NO_DEPRECATE +#pragma warning(disable: 4996) +#endif + /* Has windows.h already been included? If so, our preferences don't matter, * but we will still need the winsock things no matter what was included. * If not, include a restricted set of windows headers to our tastes. @@ -506,6 +514,14 @@ struct iovec { #pragma warning(pop) #endif +/* Ignore Microsoft's interpretation of secure development + * and their opinion of the POSIX standard string handling API + */ +#if defined(_MSC_VER) && _MSC_VER >= 1400 +#define _CRT_SECURE_NO_DEPRECATE +#pragma warning(disable: 4996) +#endif + #endif /* WIN32 */ #endif /* APR_H */ From 82db3218b5263776906ac919fae9e1d6074b45a4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 19 Dec 2005 05:36:39 +0000 Subject: [PATCH 5531/7878] Cast away an emit (we reduced by 10 bits already) and correct a typo in the timeout-on-read patch committed last week. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@357641 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 6d6a077fe3b..dc85900495b 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -321,10 +321,10 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a timeout_ms = INFINITE; } else { - timeout_ms = thefile->timeout / 1000; + timeout_ms = (DWORD)(thefile->timeout / 1000); } - rv = WaitForSingleObject(thefile->pOverlapped->hEvent, timemilliseconds); + rv = WaitForSingleObject(thefile->pOverlapped->hEvent, timeout_ms); switch (rv) { case WAIT_OBJECT_0: GetOverlappedResult(thefile->filehand, thefile->pOverlapped, (LPDWORD)nbytes, TRUE); From 58b0fa95be4fc47b54191877ea1cd4c05e6ecbf2 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 22 Dec 2005 11:49:29 +0000 Subject: [PATCH 5532/7878] * build/config.guess, build/config.sub: Update to the latest versions from the FSF. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@358559 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 576 +++++++++++++++++++++++---------------------- build/config.sub | 113 ++++++--- 2 files changed, 379 insertions(+), 310 deletions(-) diff --git a/build/config.guess b/build/config.guess index a6d8a945f68..e3ef63f6cb4 100755 --- a/build/config.guess +++ b/build/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -timestamp='2004-06-24' +timestamp='2005-12-13' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,13 +17,15 @@ timestamp='2004-06-24' # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. + # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. @@ -53,7 +55,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -66,11 +68,11 @@ Try \`$me --help' for more information." while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -123,7 +125,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' +esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -196,64 +198,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" - exit 0 ;; - amd64:OpenBSD:*:*) - echo x86_64-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - cats:OpenBSD:*:*) - echo arm-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - luna88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mipseb-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit 0 ;; + exit ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -306,37 +264,43 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; + exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix - exit 0 ;; + exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 - exit 0 ;; + exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 - exit 0;; + exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; + exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; + exit ;; *:OS/390:*:*) echo i370-ibm-openedition - exit 0 ;; + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; *:OS400:*:*) echo powerpc-ibm-os400 - exit 0 ;; + exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp - exit 0;; + exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then @@ -344,32 +308,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in else echo pyramid-pyramid-bsd fi - exit 0 ;; + exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 - exit 0 ;; + exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 - exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7 && exit 0 ;; + sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) @@ -378,10 +342,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; + exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; + exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 @@ -393,10 +357,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo sparc-sun-sunos${UNAME_RELEASE} ;; esac - exit 0 ;; + exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; + exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -407,40 +371,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} - exit 0 ;; + exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; + exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 - exit 0 ;; + exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; + exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -464,32 +428,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; + exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax - exit 0 ;; + exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix - exit 0 ;; + exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 - exit 0 ;; + exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 - exit 0 ;; + exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` @@ -505,29 +470,29 @@ EOF else echo i586-dg-dgux${UNAME_RELEASE} fi - exit 0 ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 - exit 0 ;; + exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 - exit 0 ;; + exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd - exit 0 ;; + exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; + exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix - exit 0 ;; + exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` @@ -535,7 +500,7 @@ EOF IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build @@ -550,14 +515,18 @@ EOF exit(0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi - exit 0 ;; + exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then @@ -571,28 +540,28 @@ EOF IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:*:*) echo rs6000-ibm-aix - exit 0 ;; + exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 - exit 0 ;; + exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 + exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx - exit 0 ;; + exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 - exit 0 ;; + exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd - exit 0 ;; + exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 - exit 0 ;; + exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in @@ -654,9 +623,19 @@ EOF esac if [ ${HP_ARCH} = "hppa2.0w" ] then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else @@ -664,11 +643,11 @@ EOF fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -696,152 +675,166 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 - exit 0 ;; + exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd - exit 0 ;; + exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd - exit 0 ;; + exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix - exit 0 ;; + exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf - exit 0 ;; + exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf - exit 0 ;; + exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi - exit 0 ;; + exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites - exit 0 ;; + exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit 0 ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit 0 ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit 0 ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit 0 ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; + exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; + exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; + exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; + exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:[34]*) + exit ;; + x86:Interix*:[345]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit 0 ;; + exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks - exit 0 ;; + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix - exit 0 ;; + exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin - exit 0 ;; + exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; + exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit 0 ;; + exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; + exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu - exit 0 ;; + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -858,8 +851,8 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build @@ -877,15 +870,18 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu - exit 0 ;; + exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu - exit 0 ;; + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -899,7 +895,7 @@ EOF objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -907,25 +903,28 @@ EOF PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac - exit 0 ;; + exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu - exit 0 ;; + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; + exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu - exit 0 ;; + exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent @@ -943,15 +942,15 @@ EOF ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; + exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; + exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; + exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build @@ -968,7 +967,7 @@ EOF LIBC=gnulibc1 # endif #else - #ifdef __INTEL_COMPILER + #if defined(__INTEL_COMPILER) || defined(__PGI) LIBC=gnu #else LIBC=gnuaout @@ -978,16 +977,19 @@ EOF LIBC=dietlibc #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s: ::g;p;}'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 - exit 0 ;; + exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... @@ -995,27 +997,27 @@ EOF # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; + exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; + exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; + exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; - i*86:syllable:*:*) + exit ;; + i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable - exit 0 ;; + exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; + exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then @@ -1023,15 +1025,16 @@ EOF else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi - exit 0 ;; - i*86:*:5:[78]*) + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; + exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi - exit 0 ;; + exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv - exit 0 ;; + exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv - exit 0 ;; + exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix - exit 0 ;; + exit ;; M68*:*:R3V[5678]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; + && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 - exit 0 ;; + exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; + exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` @@ -1123,68 +1126,72 @@ EOF else echo ns32k-sni-sysv fi - exit 0 ;; + exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 - exit 0 ;; + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 - exit 0 ;; + exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 - exit 0 ;; + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos - exit 0 ;; + exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; + exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 - exit 0 ;; + exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi - exit 0 ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos - exit 0 ;; + exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos - exit 0 ;; + exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos - exit 0 ;; + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Darwin:*:*) - case `uname -p` in - *86) UNAME_PROCESSOR=i686 ;; - powerpc) UNAME_PROCESSOR=powerpc ;; + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; + exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then @@ -1192,22 +1199,25 @@ EOF UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; + exit ;; *:QNX:*:4*) echo i386-pc-qnx - exit 0 ;; + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; + exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux - exit 0 ;; + exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv - exit 0 ;; + exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1218,38 +1228,47 @@ EOF UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; + exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 - exit 0 ;; + exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex - exit 0 ;; + exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 - exit 0 ;; + exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 - exit 0 ;; + exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 - exit 0 ;; + exit ;; *:ITS:*:*) echo pdp10-unknown-its - exit 0 ;; + exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; + exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; + exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms && exit 0 ;; - I*) echo ia64-dec-vms && exit 0 ;; - V*) echo vax-dec-vms && exit 0 ;; - esac + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1281,7 +1300,7 @@ main () #endif #if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); + printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) @@ -1370,11 +1389,12 @@ main () } EOF -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) @@ -1383,22 +1403,22 @@ then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd - exit 0 ;; + exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; c34*) echo c34-convex-bsd - exit 0 ;; + exit ;; c38*) echo c38-convex-bsd - exit 0 ;; + exit ;; c4*) echo c4-convex-bsd - exit 0 ;; + exit ;; esac fi @@ -1409,7 +1429,9 @@ This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from - ftp://ftp.gnu.org/pub/gnu/config/ + http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess +and + http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub If the version you run ($0) is already up to date, please send the following data and any information you think might be diff --git a/build/config.sub b/build/config.sub index ac6de9869c9..48b4c3bed8c 100755 --- a/build/config.sub +++ b/build/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -timestamp='2004-06-24' +timestamp='2005-12-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,14 +21,15 @@ timestamp='2004-06-24' # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. + # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # @@ -70,7 +71,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -83,11 +84,11 @@ Try \`$me --help' for more information." while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -99,7 +100,7 @@ while test $# -gt 0 ; do *local*) # First pass through any local machine types. echo $1 - exit 0;; + exit ;; * ) break ;; @@ -118,8 +119,9 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ - kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -170,6 +172,10 @@ case $os in -hiux*) os=-hiuxwe2 ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -186,6 +192,10 @@ case $os in # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -231,13 +241,14 @@ case $basic_machine in | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | mcore \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -246,6 +257,7 @@ case $basic_machine in | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ @@ -254,23 +266,28 @@ case $basic_machine in | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | mt \ | msp430 \ | ns16k | ns32k \ - | openrisc | or32 \ + | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ - | x86 | xscale | xstormy16 | xtensa \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; + m32c) + basic_machine=$basic_machine-unknown + ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown @@ -278,6 +295,9 @@ case $basic_machine in ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; + ms1) + basic_machine=mt-unknown + ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and @@ -298,7 +318,7 @@ case $basic_machine in | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ - | bs2000-* \ + | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ @@ -310,7 +330,7 @@ case $basic_machine in | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -319,6 +339,7 @@ case $basic_machine in | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ @@ -327,6 +348,7 @@ case $basic_machine in | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ + | mt-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ @@ -334,20 +356,23 @@ case $basic_machine in | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; + m32c-*) + ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) @@ -457,6 +482,9 @@ case $basic_machine in crds | unos) basic_machine=m68k-crds ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; @@ -486,6 +514,10 @@ case $basic_machine in basic_machine=m88k-motorola os=-sysv3 ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx @@ -676,6 +708,9 @@ case $basic_machine in basic_machine=i386-pc os=-msdos ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; mvs) basic_machine=i370-ibm os=-mvs @@ -751,9 +786,8 @@ case $basic_machine in basic_machine=hppa1.1-oki os=-proelf ;; - or32 | or32-*) + openrisc | openrisc-*) basic_machine=or32-unknown - os=-coff ;; os400) basic_machine=powerpc-ibm @@ -840,6 +874,10 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -1026,6 +1064,10 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; xps | xps100) basic_machine=xps100-honeywell ;; @@ -1075,12 +1117,9 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; @@ -1161,13 +1200,15 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1185,7 +1226,7 @@ case $os in os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) @@ -1294,6 +1335,9 @@ case $os in -kaos*) os=-kaos ;; + -zvmoe) + os=-zvmoe + ;; -none) ;; *) @@ -1371,6 +1415,9 @@ case $basic_machine in *-be) os=-beos ;; + *-haiku) + os=-haiku + ;; *-ibm) os=-aix ;; @@ -1542,7 +1589,7 @@ case $basic_machine in esac echo $basic_machine$os -exit 0 +exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) From 0a33355ceb83dcfb046716ce3a3bae68f7286306 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 5 Jan 2006 03:05:54 +0000 Subject: [PATCH 5533/7878] The OS/2 send() function returns EINVAL if the data size is > 64k so limit the send size to 64k. As any call to apr_socket_send() must handle partial sends anyway, this will be treated just like any other partial send. This was occurring when svnserve was sending a large file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@366063 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sendrecv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index a762b7dc317..42c057d4025 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -27,6 +27,10 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, apr_ssize_t rv; int fds, err = 0; + if (*len > 65536) { + *len = 65536; + } + do { if (!sock->nonblock || err == SOCEWOULDBLOCK) { fds = sock->socketdes; From 8939498df253e51f9e81a0a49c99cdbb6ca54080 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 10 Jan 2006 13:25:09 +0000 Subject: [PATCH 5534/7878] * build/apr_common.m4 (APR_LAYOUT): Catch invalid layout names which otherwise cause sed script errors and user confusion a la PR 38209. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@367594 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 3be28c128e2..9c169d98871 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -720,6 +720,13 @@ AC_DEFUN([APR_LAYOUT], [ echo "** Error: Cannot use undefined layout '$LAYOUT'" exit 1 fi + # Catch layout names including a slash which will otherwise + # confuse the heck out of the sed script. + case $2 in + */*) + echo "** Error: $2 is not a valid layout name" + exit 1 ;; + esac pldconf=./config.pld changequote({,}) sed -e "1s/[ ]*<[lL]ayout[ ]*$2[ ]*>[ ]*//;1t" \ From 478ba67ad66d3b19555f911249a7f76967b1e05b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 13 Jan 2006 01:51:25 +0000 Subject: [PATCH 5535/7878] Eliminate a type mismatch, this is the smaller patch - changing the declaration of apr_gcvt() - an exported function, is much dicier. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@368548 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index a98799a3abb..df2bf65602c 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -1036,7 +1036,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), #endif if (!s) { s = conv_fp(*fmt, fp_num, alternate_form, - (adjust_precision == NO) ? FLOAT_DIGITS : precision, + (int)((adjust_precision == NO) ? FLOAT_DIGITS : precision), &is_negative, &num_buf[1], &s_len); if (is_negative) prefix_char = '-'; @@ -1057,7 +1057,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * * We use &num_buf[ 1 ], so that we have room for the sign */ - s = apr_gcvt(va_arg(ap, double), precision, &num_buf[1], + s = apr_gcvt(va_arg(ap, double), (int) precision, &num_buf[1], alternate_form); if (*s == '-') prefix_char = *s++; From a790f33e1314ded7333cc540a9233a3feb02f0b9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 13 Jan 2006 01:52:30 +0000 Subject: [PATCH 5536/7878] These args can't be volatile in MSVC 14. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@368549 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/win32/apr_atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index 95db7503b97..3b664a212cc 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -106,7 +106,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3 APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) - return InterlockedCompareExchangePointer(mem, with, cmp); + return InterlockedCompareExchangePointer((void**)mem, with, (void*)cmp); #else /* Too many VC6 users have stale win32 API files, stub this */ return ((apr_atomic_win32_ptr_ptr_ptr_fn)InterlockedCompareExchange)(mem, with, cmp); From 9c370451fe22ebcb984b0f1bd61f8ca809b072c7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 13 Jan 2006 01:53:19 +0000 Subject: [PATCH 5537/7878] These working sizes are never negative, always mem mapping sized. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@368550 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/apr_random.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c index ae80e0bf8a1..88a48bcb9ad 100644 --- a/random/unix/apr_random.c +++ b/random/unix/apr_random.c @@ -219,7 +219,7 @@ APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g,const void *entropy_, p->pool[p->bytes++] = entropy[n]; if (p->bytes == g->rehash_size) { - unsigned int r; + apr_size_t r; for (r = 0; r < p->bytes/2; r+=g->pool_hash->size) hash(g->pool_hash,p->pool+r,p->pool+r*2,g->pool_hash->size*2); @@ -246,7 +246,7 @@ static void apr_random_bytes(apr_random_t *g,unsigned char *random, apr_size_t n; for (n = 0; n < bytes; ) { - int l; + apr_size_t l; if (g->random_bytes == 0) { apr_random_block(g,g->randomness); From acea19ce7d49ff2b188a4a627e4c6cbf473703e6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 13 Jan 2006 01:54:01 +0000 Subject: [PATCH 5538/7878] _beginthreadex() expects no bigger than a DWORD sized stack. Noop in 32 bit, error in 64 bit builds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@368551 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 33e9afcde40..09c53c3eb29 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -108,7 +108,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, */ #ifndef _WIN32_WCE if ((handle = (HANDLE)_beginthreadex(NULL, - attr && attr->stacksize > 0 ? attr->stacksize : 0, + (DWORD) (attr ? attr->stacksize : 0), (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker, (*new), 0, &temp)) == 0) { return APR_FROM_OS_ERROR(_doserrno); From 7512b1c570bb58a1f11a24712ca8e86ffa1a8d0a Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Fri, 13 Jan 2006 16:17:06 +0000 Subject: [PATCH 5539/7878] Mark pool param for apr_file_remove and apr_file_rename as unused (because it is). Perhaps some day it will be removed from the API. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@368769 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 0c4a0bfdb8a..45bfdf40b4a 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -227,7 +227,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file); /** * Delete the specified file. * @param path The full path to the file (using / on all systems) - * @param pool The pool to use. + * @param pool Unused (can be anything). * @remark If the file is open, it won't be removed until all * instances are closed. */ @@ -237,7 +237,7 @@ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool); * Rename the specified file. * @param from_path The full path to the original file (using / on all systems) * @param to_path The full path to the new file (using / on all systems) - * @param pool The pool to use. + * @param pool Unused (can be anything). * @warning If a file exists at the new location, then it will be * overwritten. Moving files or directories across devices may not be * possible. From a3180cf3e7b2568ac7eaf5276d70c994de95acf7 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 14 Jan 2006 08:04:18 +0000 Subject: [PATCH 5540/7878] Revert note about unused pool parameter. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@368999 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 45bfdf40b4a..0c4a0bfdb8a 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -227,7 +227,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file); /** * Delete the specified file. * @param path The full path to the file (using / on all systems) - * @param pool Unused (can be anything). + * @param pool The pool to use. * @remark If the file is open, it won't be removed until all * instances are closed. */ @@ -237,7 +237,7 @@ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool); * Rename the specified file. * @param from_path The full path to the original file (using / on all systems) * @param to_path The full path to the new file (using / on all systems) - * @param pool Unused (can be anything). + * @param pool The pool to use. * @warning If a file exists at the new location, then it will be * overwritten. Moving files or directories across devices may not be * possible. From 769d460aab74f85dbb81ae2defa07c4f99915f78 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Sun, 22 Jan 2006 02:45:18 +0000 Subject: [PATCH 5541/7878] Fix an assert that occurs when you destroy a rwlock on win32 and later clear the pool it was allocated from. Submitted by: Evgueni Brevnov * locks/win32/thread_rwlock.c (apr_thread_rwlock_destroy): Use apr_pool_cleanup_run to call our cleanup function. (thread_rwlock_cleanup): Put the destruction of the rwlock here instead of in the destructor function. * test/testlock.c (test_thread_rwlocks): Destroy the rwlock explicitly so we can see this kind of problem. * CHANGES: Note change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@371172 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ locks/win32/thread_rwlock.c | 18 ++++++++++-------- test/testlock.c | 2 ++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index c9eb146640b..5688a3266f4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Fix assertion from double close of a handle with a rwlock on win32. + [Evgueni Brevnov ] + *) APR_FIND_APR macro now supports customisable detailed checks on each installed apr. [Justin Erenkrantz, Colm MacCarthaigh] diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c index 75d79bcbeef..9207d792904 100644 --- a/locks/win32/thread_rwlock.c +++ b/locks/win32/thread_rwlock.c @@ -23,7 +23,15 @@ static apr_status_t thread_rwlock_cleanup(void *data) { - return apr_thread_rwlock_destroy((apr_thread_rwlock_t *) data); + apr_thread_rwlock_t *rwlock = data; + + if (! CloseHandle(rwlock->read_event)) + return apr_get_os_error(); + + if (! CloseHandle(rwlock->write_mutex)) + return apr_get_os_error(); + + return APR_SUCCESS; } APR_DECLARE(apr_status_t)apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, @@ -151,13 +159,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) { - if (! CloseHandle(rwlock->read_event)) - return apr_get_os_error(); - - if (! CloseHandle(rwlock->write_mutex)) - return apr_get_os_error(); - - return APR_SUCCESS; + return apr_pool_cleanup_run(rwlock->pool, rwlock, thread_rwlock_cleanup); } APR_POOL_IMPLEMENT_ACCESSOR(thread_rwlock) diff --git a/test/testlock.c b/test/testlock.c index 8e7943ddec6..c74164282ab 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -209,6 +209,8 @@ static void test_thread_rwlock(abts_case *tc, void *data) apr_thread_join(&s4, t4); ABTS_INT_EQUAL(tc, MAX_ITER, x); + + apr_thread_rwlock_destroy(rwlock); } static void test_cond(abts_case *tc, void *data) From 0c9eb488c587b6a7d334e5c82a08c6d23e572e51 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Sun, 22 Jan 2006 05:18:10 +0000 Subject: [PATCH 5542/7878] Keep testpipe.c from hanging on win32. Because of the way win32 pipes work (and I totally don't understand all the details here) we don't get all the same nonblocking semantics on win32 as we do on unix. We do correctly return an error when trying to set timeouts on these kind of pipes though, so look for that and avoid falling into an uninteruptable read later if it happens. * test/testpipe.c (test_write): Don't try to make a nonblocking read if we couldn't set the timeout, it'll just hang. * CHANGES: Note change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@371198 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ test/testpipe.c | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 5688a3266f4..fd9dc3306e2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes for APR 1.3.0 + *) Keep testpipe.c from hanging on win32. [Garrett Rooney] + *) Fix assertion from double close of a handle with a rwlock on win32. [Evgueni Brevnov ] diff --git a/test/testpipe.c b/test/testpipe.c index 402aa257ecc..6ff10944fde 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -90,9 +90,11 @@ static void read_write(abts_case *tc, void *data) rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_read(readp, buf, &nbytes); - ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - ABTS_INT_EQUAL(tc, 0, nbytes); + if (!rv) { + rv = apr_file_read(readp, buf, &nbytes); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 0, nbytes); + } } static void read_write_notimeout(abts_case *tc, void *data) From b0f0c61c88cbd32b03558567941a48e08ebcd7eb Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 23 Jan 2006 09:14:39 +0000 Subject: [PATCH 5543/7878] - add a simple DOAP file for APR/APR-Util This file will be indexed by projects.apache.org, so it sould be kept up to date. we should add some instructions on this to our release procedures. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@371502 13f79535-47bb-0310-9956-ffa450edef68 --- doap_apr.rdf | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 doap_apr.rdf diff --git a/doap_apr.rdf b/doap_apr.rdf new file mode 100644 index 00000000000..a62fe0745e5 --- /dev/null +++ b/doap_apr.rdf @@ -0,0 +1,84 @@ + + + + + Apache Portable Runtime + + C + + + + + + + + Cross-platform library easing many progamming tasks in C. + + + +The mission of the Apache Portable Runtime (APR) project is to create +and maintain software libraries that provide a predictable and +consistent interface to underlying platform-specific implementations. +The primary goal is to provide an API to which software developers may +code and be assured of predictable if not identical behaviour +regardless of the platform on which their software is built, relieving +them of the need to code special-case conditions to work around or +take advantage of platform-specific deficiencies or features. + + + + + + + + + + + + + + + APR current release + 2005-10-12 + 1.2.2 + + + + + APR-util current release + 2005-10-12 + 1.2.2 + + + + + APR-iconv current release + 2004-11-18 + 1.0.1 + + + + + APR old release + 2005-10-4 + 0.9.7 + + + + + APR-util old release + 2005-10-4 + 0.9.7 + + + + + APR-iconv old release + 2004-11-4 + 0.9.7 + + + + + + From a33ff0735e6c800cbb9f67ddc65066d8ed42fd55 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 26 Jan 2006 18:02:00 +0000 Subject: [PATCH 5544/7878] Relocate our apr's doap git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@372577 13f79535-47bb-0310-9956-ffa450edef68 --- doap_apr.rdf | 84 ---------------------------------------------------- 1 file changed, 84 deletions(-) delete mode 100644 doap_apr.rdf diff --git a/doap_apr.rdf b/doap_apr.rdf deleted file mode 100644 index a62fe0745e5..00000000000 --- a/doap_apr.rdf +++ /dev/null @@ -1,84 +0,0 @@ - - - - - Apache Portable Runtime - - C - - - - - - - - Cross-platform library easing many progamming tasks in C. - - - -The mission of the Apache Portable Runtime (APR) project is to create -and maintain software libraries that provide a predictable and -consistent interface to underlying platform-specific implementations. -The primary goal is to provide an API to which software developers may -code and be assured of predictable if not identical behaviour -regardless of the platform on which their software is built, relieving -them of the need to code special-case conditions to work around or -take advantage of platform-specific deficiencies or features. - - - - - - - - - - - - - - - APR current release - 2005-10-12 - 1.2.2 - - - - - APR-util current release - 2005-10-12 - 1.2.2 - - - - - APR-iconv current release - 2004-11-18 - 1.0.1 - - - - - APR old release - 2005-10-4 - 0.9.7 - - - - - APR-util old release - 2005-10-4 - 0.9.7 - - - - - APR-iconv old release - 2004-11-4 - 0.9.7 - - - - - - From e2010972827c29dcdd167aa72f88dc60dc663fc3 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Mon, 30 Jan 2006 06:48:56 +0000 Subject: [PATCH 5545/7878] Fix bug #38438, seeks are broken for files opened for append in xthread mode on win32. Submitted by: M Joonas Pihlaja Test by: Garrett Rooney * file_io/win32/seek.c (apr_file_seek): Fix APR_END case of APR_XTHREAD case. * test/testfile.c (test_xthread): New test. (testfile): Run new test. * CHANGES: Note change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@373453 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/win32/seek.c | 4 ++-- test/testfile.c | 51 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index fd9dc3306e2..e94d5e2e815 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Fix seeks with files opened in xthread mode for append on win32. + [M Joonas Pihlaja , Garrett Rooney] + *) Keep testpipe.c from hanging on win32. [Garrett Rooney] *) Fix assertion from double close of a handle with a rwlock on win32. diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index be5bac932e5..03cee4ed1d6 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -105,8 +105,8 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh case APR_END: rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); - if (rc == APR_SUCCESS && finfo.size - *offset < 0) - thefile->filePtr = finfo.size - *offset; + if (rc == APR_SUCCESS && finfo.size + *offset >= 0) + thefile->filePtr = finfo.size + *offset; break; default: diff --git a/test/testfile.c b/test/testfile.c index c6e14c965ca..30c3b93b755 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -808,6 +808,56 @@ static void test_fail_read_flush(abts_case *tc, void *data) apr_file_close(f); } +static void test_xthread(abts_case *tc, void *data) +{ + apr_file_t *f; + const char *fname = "data/testxthread.dat"; + apr_status_t rv; + apr_int32_t flags = APR_CREATE|APR_READ|APR_WRITE|APR_APPEND|APR_XTHREAD; + char buf[128] = { 0 }; + + /* Test for bug 38438, opening file with append + xthread and seeking to + the end of the file resulted in writes going to the beginning not the + end. */ + + apr_file_remove(fname, p); + + APR_ASSERT_SUCCESS(tc, "open test file", + apr_file_open(&f, fname, flags, + APR_UREAD|APR_UWRITE, p)); + + APR_ASSERT_SUCCESS(tc, "write should succeed", + apr_file_puts("hello", f)); + + apr_file_close(f); + + APR_ASSERT_SUCCESS(tc, "open test file", + apr_file_open(&f, fname, flags, + APR_UREAD|APR_UWRITE, p)); + + /* Seek to the end. */ + { + apr_off_t offset = 0; + + rv = apr_file_seek(f, APR_END, &offset); + } + + APR_ASSERT_SUCCESS(tc, "more writes should succeed", + apr_file_puts("world", f)); + + /* Back to the beginning. */ + { + apr_off_t offset = 0; + + rv = apr_file_seek(f, APR_SET, &offset); + } + + apr_file_read_full(f, buf, sizeof(buf), NULL); + + ABTS_STR_EQUAL(tc, "helloworld", buf); + + apr_file_close(f); +} abts_suite *testfile(abts_suite *suite) { @@ -842,6 +892,7 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_fail_write_flush, NULL); abts_run_test(suite, test_fail_read_flush, NULL); abts_run_test(suite, test_buffer_set_get, NULL); + abts_run_test(suite, test_xthread, NULL); return suite; } From b48eb243a376705c230a017fe7a6184a22854b0e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 30 Jan 2006 12:52:05 +0000 Subject: [PATCH 5546/7878] * test/testsockets.c (sendto_receivefrom): Set REUSEADDR option before binding sockets. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@373504 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsockets.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/testsockets.c b/test/testsockets.c index 69fdf1e5bc6..3b867a3b802 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -139,6 +139,11 @@ static void sendto_receivefrom(abts_case *tc, void *data) rv = apr_sockaddr_info_get(&from, addr, APR_UNSPEC, 7771, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1); + APR_ASSERT_SUCCESS(tc, "Could not set REUSEADDR on socket", rv); + rv = apr_socket_opt_set(sock2, APR_SO_REUSEADDR, 1); + APR_ASSERT_SUCCESS(tc, "Could not set REUSEADDR on socket2", rv); + rv = apr_socket_bind(sock, to); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_bind(sock2, from); From 7ba6ac5be1844f7c699649e9a1d7576f0244fc2e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 4 Feb 2006 21:03:04 +0000 Subject: [PATCH 5547/7878] Zero the len out value on error, to follow the unix behavior of apr_socket_send() Submitted by: Chris Demetriou git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@374924 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 326f7122eaa..1fedfdf29a8 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -55,6 +55,7 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, #endif if (rv == SOCKET_ERROR) { lasterror = apr_get_netos_error(); + *len = 0; return lasterror; } From 6e1bc4e409ba0ee3b59e600ad89fd55e5f7d3175 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Wed, 8 Feb 2006 06:16:48 +0000 Subject: [PATCH 5548/7878] Make apr_file_t::filePtr an apr_off_t on unix so that we avoid truncating the offset into the file when working with files over 2 gigabytes in size. * include/arch/unix/apr_arch_file_io.h (apr_file_t::filePtr): Make this an apr_off_t, since we really need the full 64 bits in many cases. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@375869 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_file_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index 510276aa5db..874d790ba30 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -107,7 +107,7 @@ struct apr_file_t { apr_size_t bufsize; /* The size of the buffer */ unsigned long dataRead; /* amount of valid data read into buffer */ int direction; /* buffer being used for 0 = read, 1 = write */ - unsigned long filePtr; /* position in file of handle */ + apr_off_t filePtr; /* position in file of handle */ #if APR_HAS_THREADS struct apr_thread_mutex_t *thlock; #endif From 1956b5ef0c745f73997cd69e79926743a31f071c Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Wed, 8 Feb 2006 06:26:39 +0000 Subject: [PATCH 5549/7878] * CHANGES: Note the apr_file_t filePtr change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@375870 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index e94d5e2e815..82a787007f1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes for APR 1.3.0 + *) Make the filePtr in apr_file_t an apr_off_t on Unix, to avoid issues + truncating offsets down to 32 bits on large file systems. + [Garrett Rooney] + *) Fix seeks with files opened in xthread mode for append on win32. [M Joonas Pihlaja , Garrett Rooney] From 18f4adc17b809907130f8bf1116c02afc7b99cf9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 8 Feb 2006 10:48:25 +0000 Subject: [PATCH 5550/7878] * test/testlfs.c (test_buffered): Add tests for seeking in buffered files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@375919 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlfs.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/test/testlfs.c b/test/testlfs.c index 39bef61e0dc..cf53050a3c3 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -259,6 +259,52 @@ static void test_format(abts_case *tc, void *data) off == eightGb); } +#define TESTBUFFN TESTDIR "/buffer.bin" + +static void test_buffered(abts_case *tc, void *data) +{ + apr_off_t off; + apr_file_t *f; + + PRECOND; + + APR_ASSERT_SUCCESS(tc, "open buffered file", + apr_file_open(&f, TESTBUFFN, + APR_FOPEN_CREATE|APR_FOPEN_WRITE + |APR_FOPEN_TRUNCATE|APR_FOPEN_BUFFERED, + APR_OS_DEFAULT, p)); + + APR_ASSERT_SUCCESS(tc, "truncate to 8GB", + apr_file_trunc(f, eightGb)); + + off = eightGb; + APR_ASSERT_SUCCESS(tc, "seek to 8GB", + apr_file_seek(f, APR_SET, &off)); + ABTS_ASSERT(tc, "returned seek position still 8GB", + off == eightGb); + + off = 0; + APR_ASSERT_SUCCESS(tc, "relative seek", + apr_file_seek(f, APR_CUR, &off)); + ABTS_ASSERT(tc, "relative seek still at 8GB", + off == eightGb); + + off = 0; + APR_ASSERT_SUCCESS(tc, "end-relative seek", + apr_file_seek(f, APR_END, &off)); + ABTS_ASSERT(tc, "end-relative seek still at 8GB", + off == eightGb); + + off = -eightGb; + APR_ASSERT_SUCCESS(tc, "relative seek to beginning", + apr_file_seek(f, APR_CUR, &off)); + ABTS_ASSERT(tc, "seek to beginning got zero", + off == 0); + + APR_ASSERT_SUCCESS(tc, "close buffered file", + apr_file_close(f)); +} + #else static void test_nolfs(abts_case *tc, void *data) { @@ -282,6 +328,7 @@ abts_suite *testlfs(abts_suite *suite) abts_run_test(suite, test_mmap, NULL); #endif abts_run_test(suite, test_format, NULL); + abts_run_test(suite, test_buffered, NULL); #else abts_run_test(suite, test_nolfs, NULL); #endif From d7cc6d1e007a3f606830f5efc83e64289b956eb2 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Thu, 9 Feb 2006 05:55:22 +0000 Subject: [PATCH 5551/7878] Avoid a hang when running the tests on win32. * tesst/testsock.c (test_get_addr): Return if the apr_socket_connect fails. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@376196 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/testsock.c b/test/testsock.c index 1c648ec768a..06e4ba177f3 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -253,9 +253,11 @@ static void test_get_addr(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "enable non-block mode", apr_socket_opt_set(cd, APR_SO_NONBLOCK, 1)); - - /* initiate connection */ - apr_socket_connect(cd, sa); + + rv = apr_socket_connect(cd, sa); + APR_ASSERT_SUCCESS(tc, "make the connection", rv); + if (rv) + return; APR_ASSERT_SUCCESS(tc, "accept connection", apr_socket_accept(&sd, ld, p)); From 4936580e7f9823170f3b23f1822031a9d1c224df Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 9 Feb 2006 19:42:08 +0000 Subject: [PATCH 5552/7878] Testcase to reproduce bug 31878, incomplete partial root on UFS syntax platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@376401 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/test/testnames.c b/test/testnames.c index b47cd43c6c3..df929b8bcd8 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -185,12 +185,24 @@ static void root_relative(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "The given path is relative", errmsg); } +static void root_from_slash(abts_case *tc, void *data) +{ + apr_status_t rv; + const char *root = NULL; + const char *path = "//"; -#if 0 - root_result(rootpath); - root_result(addpath); -} + rv = apr_filepath_root(&root, &path, APR_FILEPATH_TRUENAME, p); + +#if defined(WIN32) || defined(NETWARE) || defined(OS2) + ABTS_INT_EQUAL(tc, APR_EINCOMPLETE, rv); + ABTS_STR_EQUAL(tc, "//", root); +#else + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, "/", root); #endif + ABTS_STR_EQUAL(tc, "", path); +} + abts_suite *testnames(abts_suite *suite) { @@ -208,6 +220,7 @@ abts_suite *testnames(abts_suite *suite) abts_run_test(suite, root_absolute, NULL); abts_run_test(suite, root_relative, NULL); + abts_run_test(suite, root_from_slash, NULL); return suite; } From cbca5b7ab2fbabbb33ae20131295e6bb6bc24e25 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 9 Feb 2006 19:53:18 +0000 Subject: [PATCH 5553/7878] Fix a host of tests that were using ABTS_INT_EQUAL to compare non-int results, which caused mass quantities of compile warnings that don't reflect well on a 'test suite'. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@376406 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdup.c | 4 ++-- test/testfile.c | 6 +++--- test/testfilecopy.c | 8 ++++---- test/testpipe.c | 5 +++-- test/testproc.c | 2 +- test/testtime.c | 14 +++++++------- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/test/testdup.c b/test/testdup.c index 9e025069c5a..a41f7098b39 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -81,7 +81,7 @@ static void test_file_readwrite(abts_case *tc, void *data) fpos = 0; rv = apr_file_seek(file1, APR_SET, &fpos); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 0, fpos); + ABTS_ASSERT(tc, "File position mismatch, expected 0", fpos == 0); txtlen = 50; rv = apr_file_read(file1, buff, &txtlen); @@ -166,7 +166,7 @@ static void test_dup2_readwrite(abts_case *tc, void *data) fpos = 0; rv = apr_file_seek(testfile, APR_SET, &fpos); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 0, fpos); + ABTS_ASSERT(tc, "File position mismatch, expected 0", fpos == 0); txtlen = 50; rv = apr_file_read(testfile, buff, &txtlen); diff --git a/test/testfile.c b/test/testfile.c index 30c3b93b755..3ebb6847acb 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -514,7 +514,7 @@ static void test_mod_neg(abts_case *tc, void *data) cur = 0; rv = apr_file_seek(f, APR_CUR, &cur); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 10, cur); + ABTS_ASSERT(tc, "File Pointer Mismatch, expected 10", cur == 10); nbytes = sizeof(buf); rv = apr_file_read(f, buf, &nbytes); @@ -524,7 +524,7 @@ static void test_mod_neg(abts_case *tc, void *data) cur = -((apr_off_t)nbytes - 7980); rv = apr_file_seek(f, APR_CUR, &cur); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 7990, cur); + ABTS_ASSERT(tc, "File Pointer Mismatch, expected 7990", cur == 7990); rv = apr_file_gets(buf, 11, f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -694,7 +694,7 @@ static void test_truncate(abts_case *tc, void *data) rv = apr_stat(&finfo, fname, APR_FINFO_SIZE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 0, finfo.size); + ABTS_ASSERT(tc, "File size mismatch, expected 0 (empty)", finfo.size == 0); rv = apr_file_remove(fname, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); diff --git a/test/testfilecopy.c b/test/testfilecopy.c index 96b24d7fff9..457a36128a7 100644 --- a/test/testfilecopy.c +++ b/test/testfilecopy.c @@ -46,12 +46,12 @@ static void copy_helper(abts_case *tc, const char *from, const char * to, APR_ASSERT_SUCCESS(tc, "Couldn't stat copy file", rv); if (!append) { - ABTS_INT_EQUAL(tc, orig.size, copy.size); + ABTS_ASSERT(tc, "File size differs", orig.size == copy.size); } else { - ABTS_INT_EQUAL(tc, - ((dest_rv == APR_SUCCESS) ? dest.size : 0) + orig.size, - copy.size); + ABTS_ASSERT(tc, "File size differs", + ((dest_rv == APR_SUCCESS) + ? dest.size : 0) + orig.size == copy.size); } } diff --git a/test/testpipe.c b/test/testpipe.c index 6ff10944fde..10f0f81e038 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -63,14 +63,15 @@ static void set_timeout(abts_case *tc, void *data) rv = apr_file_pipe_timeout_get(readp, &timeout); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, -1, timeout); + ABTS_ASSERT(tc, "Timeout mismatch, expected -1", timeout == -1); rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_pipe_timeout_get(readp, &timeout); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, apr_time_from_sec(1), timeout); + ABTS_ASSERT(tc, "Timeout mismatch, expected 1 second", + timeout == apr_time_from_sec(1)); } static void read_write(abts_case *tc, void *data) diff --git a/test/testproc.c b/test/testproc.c index 68aa5a211c7..aa534339b63 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -108,7 +108,7 @@ static void test_file_redir(abts_case *tc, void *data) offset = 0; rv = apr_file_seek(testfile, APR_SET, &offset); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 0, offset); + ABTS_ASSERT(tc, "File position mismatch, expected 0", offset == 0); rv = apr_procattr_create(&attr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); diff --git a/test/testtime.c b/test/testtime.c index 4ba09e2dcad..02bd6dce1a3 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -86,8 +86,9 @@ static void test_exp_lt(abts_case *tc, void *data) { apr_status_t rv; apr_time_exp_t xt; - struct tm *libc_exp; - time_t now_secs = apr_time_sec(now); + time_t posix_secs = (time_t)apr_time_sec(now); + apr_time_t now_secs = apr_time_sec(now); + struct tm *posix_exp = localtime(&posix_secs); rv = apr_time_exp_lt(&xt, now); if (rv == APR_ENOTIMPL) { @@ -95,10 +96,8 @@ static void test_exp_lt(abts_case *tc, void *data) } ABTS_TRUE(tc, rv == APR_SUCCESS); - libc_exp = localtime(&now_secs); - #define CHK_FIELD(f) \ - ABTS_INT_EQUAL(tc, libc_exp->f, xt.f) + ABTS_ASSERT(tc, "Mismatch in " #f, posix_exp->f == xt.f) CHK_FIELD(tm_sec); CHK_FIELD(tm_min); @@ -182,14 +181,15 @@ static void test_ctime(abts_case *tc, void *data) apr_status_t rv; char apr_str[STR_SIZE]; char libc_str[STR_SIZE]; - time_t now_sec = apr_time_sec(now); + apr_time_t now_sec = apr_time_sec(now); + time_t posix_sec = (time_t) now_sec; rv = apr_ctime(apr_str, now); if (rv == APR_ENOTIMPL) { ABTS_NOT_IMPL(tc, "apr_ctime"); } ABTS_TRUE(tc, rv == APR_SUCCESS); - strcpy(libc_str, ctime(&now_sec)); + strcpy(libc_str, ctime(&posix_sec)); *strchr(libc_str, '\n') = '\0'; ABTS_STR_EQUAL(tc, libc_str, apr_str); From ec81ceec5c154b089811be033e48cf3c9142c795 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 9 Feb 2006 19:54:14 +0000 Subject: [PATCH 5554/7878] getcwd() isn't portable. We can 'exercise' some more apr_ functions here anyways. [On win32, it's _getcwd(), fwiw.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@376407 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/test/testdso.c b/test/testdso.c index 2417966477a..106ab41c744 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -21,6 +21,7 @@ #include "apr_errno.h" #include "apr_dso.h" #include "apr_strings.h" +#include "apr_file_info.h" #include "apr.h" #if APR_HAVE_UNISTD_H #include @@ -238,20 +239,16 @@ abts_suite *testdso(abts_suite *suite) suite = ADD_SUITE(suite) #if APR_HAS_DSO - modname = apr_pcalloc(p, 256); - getcwd(modname, 256); - modname = apr_pstrcat(p, modname, "/", MOD_NAME, NULL); - + apr_filepath_merge(&modname, NULL, MOD_NAME, 0, p); + abts_run_test(suite, test_load_module, NULL); abts_run_test(suite, test_dso_sym, NULL); abts_run_test(suite, test_dso_sym_return_value, NULL); abts_run_test(suite, test_unload_module, NULL); #ifdef LIB_NAME - libname = apr_pcalloc(p, 256); - getcwd(libname, 256); - libname = apr_pstrcat(p, libname, "/", LIB_NAME, NULL); - + apr_filepath_merge(&libname, NULL, LIB_NAME, 0, p); + abts_run_test(suite, test_load_library, NULL); abts_run_test(suite, test_dso_sym_library, NULL); abts_run_test(suite, test_dso_sym_return_value_library, NULL); From 6311f72197ef7edf9343a32e921bf16fb310560d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 9 Feb 2006 19:55:11 +0000 Subject: [PATCH 5555/7878] Remove several more warnings, including the need to cast our file size into a size_t 'in-memory' quantity. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@376408 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmmap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/testmmap.c b/test/testmmap.c index 917ab31f365..958f2ecea8c 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -84,14 +84,15 @@ static void test_get_filesize(abts_case *tc, void *data) rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); - ABTS_INT_EQUAL(tc, fsize, finfo.size); + ABTS_ASSERT(tc, "File size mismatch", fsize == finfo.size); } static void test_mmap_create(abts_case *tc, void *data) { apr_status_t rv; - rv = apr_mmap_create(&themmap, thefile, 0, finfo.size, APR_MMAP_READ, p); + rv = apr_mmap_create(&themmap, thefile, 0, (apr_size_t) finfo.size, + APR_MMAP_READ, p); ABTS_PTR_NOTNULL(tc, themmap); ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); } From 5a456129c646b46b01f7b578e7d1033621ec4f0d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 9 Feb 2006 19:57:23 +0000 Subject: [PATCH 5556/7878] apr_uid_t and apr_gid_t ARE NOT transparent types, no matter how much our unix users wish they were. We need some APR constant if you would like to treat them this way, e.g. a symbols APR_UID_GID_NUMERIC flag or similar. Thoughts? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@376409 13f79535-47bb-0310-9956-ffa450edef68 --- test/testuser.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/testuser.c b/test/testuser.c index 861c44fc897..7c423adf1ab 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -94,6 +94,8 @@ static void groupname(abts_case *tc, void *data) apr_gid_compare(gid, retreived_gid)); } +#ifdef APR_UID_GID_NUMERIC + static void fail_userinfo(abts_case *tc, void *data) { apr_uid_t uid; @@ -138,6 +140,8 @@ static void fail_userinfo(abts_case *tc, void *data) rv != APR_SUCCESS || tmp != NULL); } +#endif + #else static void users_not_impl(abts_case *tc, void *data) { @@ -155,7 +159,9 @@ abts_suite *testuser(abts_suite *suite) abts_run_test(suite, uid_current, NULL); abts_run_test(suite, username, NULL); abts_run_test(suite, groupname, NULL); +#ifdef APR_UID_GID_NUMERIC abts_run_test(suite, fail_userinfo, NULL); +#endif #endif return suite; From 54a6e9af0c76d9e72c06e4f6e05bd2d7532509c7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 9 Feb 2006 20:25:22 +0000 Subject: [PATCH 5557/7878] This branch of the code reflects that no machine name is given, such that the entire path is '//' or '\\'. Therefore we can't tweak the 'middle' seperator e.g. '\\foo\bar' to '//foo/bar', as the bug indicates we were overwriting the trailing null with the '/' portable seperator and therefore the string was not even terminated. '\\' should become simply '//' with TRUENAME, non-native name. PR: 31878 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@376423 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 6079b84b151..ea80e14b90a 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -255,9 +255,6 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, } else { newpath = apr_pstrndup(p, testpath, delim1 - testpath); - if (flags & APR_FILEPATH_TRUENAME) { - newpath[delim1 - testpath] = seperator[0]; - } } if (flags & APR_FILEPATH_TRUENAME) { newpath[0] = seperator[0]; From b7f19ad376aca8ffa2dc18b3c885874ac104d505 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 9 Feb 2006 20:33:59 +0000 Subject: [PATCH 5558/7878] The project workspace is now testall.dsw git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@376429 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.dsw | 122 ----------------------------------------------- 1 file changed, 122 deletions(-) delete mode 100644 test/aprtest.dsw diff --git a/test/aprtest.dsw b/test/aprtest.dsw deleted file mode 100644 index d82af60f1b9..00000000000 --- a/test/aprtest.dsw +++ /dev/null @@ -1,122 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "apr"="..\apr.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "apr_app"="..\build\apr_app.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name apr - End Project Dependency -}}} - -############################################################################### - -Project: "aprtest"=".\aprtest.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name apr - End Project Dependency -}}} - -############################################################################### - -Project: "libapr"="..\libapr.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libapr_app"="..\build\libapr_app.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libapr - End Project Dependency -}}} - -############################################################################### - -Project: "testapp"=".\testapp.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name apr - End Project Dependency - Begin Project Dependency - Project_Dep_Name apr_app - End Project Dependency -}}} - -############################################################################### - -Project: "testappnt"=".\testappnt.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name apr - End Project Dependency - Begin Project Dependency - Project_Dep_Name apr_app - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - From 82de7e4869d563d9d5bb3db38974de5cbcd70364 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Thu, 9 Feb 2006 20:38:29 +0000 Subject: [PATCH 5559/7878] Don't error out if we get back EINPROGRESS from a nonblocking connect, that's the expected behavior. * test/testsock.c (test_get_addr): Look for the expected EINPROGRESS error and only bail when we get something else from apr_socket_connect. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@376433 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testsock.c b/test/testsock.c index 06e4ba177f3..a12b34be704 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -255,8 +255,8 @@ static void test_get_addr(abts_case *tc, void *data) apr_socket_opt_set(cd, APR_SO_NONBLOCK, 1)); rv = apr_socket_connect(cd, sa); - APR_ASSERT_SUCCESS(tc, "make the connection", rv); - if (rv) + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EINPROGRESS(rv)); + if (rv && ! APR_STATUS_IS_EINPROGRESS(rv)) return; APR_ASSERT_SUCCESS(tc, "accept connection", From ccf6b1651b5b101d28e718da0cd594a426ba0fa2 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 9 Feb 2006 22:49:37 +0000 Subject: [PATCH 5560/7878] * test/testtime.c (test_exp_lt): Remove unused variable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@376472 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 1 - 1 file changed, 1 deletion(-) diff --git a/test/testtime.c b/test/testtime.c index 02bd6dce1a3..f7e4d3c9fe6 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -87,7 +87,6 @@ static void test_exp_lt(abts_case *tc, void *data) apr_status_t rv; apr_time_exp_t xt; time_t posix_secs = (time_t)apr_time_sec(now); - apr_time_t now_secs = apr_time_sec(now); struct tm *posix_exp = localtime(&posix_secs); rv = apr_time_exp_lt(&xt, now); From f13824986ed42935a1d5b262e9254d7d64ec8b4e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 9 Feb 2006 22:58:14 +0000 Subject: [PATCH 5561/7878] Rules out netware from this scenario per Brad. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@376473 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testnames.c b/test/testnames.c index df929b8bcd8..6775e9519e8 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -193,7 +193,7 @@ static void root_from_slash(abts_case *tc, void *data) rv = apr_filepath_root(&root, &path, APR_FILEPATH_TRUENAME, p); -#if defined(WIN32) || defined(NETWARE) || defined(OS2) +#if defined(WIN32) || defined(OS2) ABTS_INT_EQUAL(tc, APR_EINCOMPLETE, rv); ABTS_STR_EQUAL(tc, "//", root); #else From 5eee018af39d174150ac3843155b2a52102fa84f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 10 Feb 2006 08:59:11 +0000 Subject: [PATCH 5562/7878] * test/Makefile.in (CLEAN_TARGETS): Clean more. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@376598 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index dbbe0fbc1f7..b5b9fd32b95 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -30,7 +30,7 @@ LOCAL_LIBS=../lib@APR_LIBNAME@.la CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \ readchild@EXEEXT@ tryread@EXEEXT@ sockchild@EXEEXT@ \ - globalmutexchild@EXEEXT@ lfstests/large.bin \ + globalmutexchild@EXEEXT@ lfstests/*.bin \ data/test*.txt data/test*.dat CLEAN_SUBDIRS = internal From ddab121dc76682f4d8fbe0a4ad75b7280b05b5c1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 11 Feb 2006 19:45:49 +0000 Subject: [PATCH 5563/7878] A simple typo that's come up more than once, VC accepts while sane compilers reject this. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@377025 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index fc86fe22f8d..2e032e8a624 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -133,7 +133,7 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *); #if APR_HAS_ANSI_FS && APR_HAS_UNICODE_FS #define IF_WIN_OS_IS_UNICODE if (apr_os_level >= APR_WIN_UNICODE) #define ELSE_WIN_OS_IS_ANSI else -#else APR_HAS_UNICODE_FS +#else /* APR_HAS_UNICODE_FS */ #define IF_WIN_OS_IS_UNICODE #define ELSE_WIN_OS_IS_ANSI #endif /* WINNT */ From ce789612360978d521413de35266fa931521aac0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 11 Feb 2006 19:48:18 +0000 Subject: [PATCH 5564/7878] A personally irritating quirk; add the framework .h file for easy editing of the framework inside the IDE git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@377029 13f79535-47bb-0310-9956-ffa450edef68 --- test/testall.dsp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testall.dsp b/test/testall.dsp index 8689b8773ec..cf1654ab2b6 100644 --- a/test/testall.dsp +++ b/test/testall.dsp @@ -87,6 +87,10 @@ SOURCE=.\abts.c # End Source File # Begin Source File +SOURCE=.\abts.h +# End Source File +# Begin Source File + SOURCE=.\globalmutexchild.c # End Source File # Begin Source File From bd1f9d3474f26397b1a9d247a780d859282c9554 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 11 Feb 2006 19:52:56 +0000 Subject: [PATCH 5565/7878] Ignore our apr test shm file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@377033 13f79535-47bb-0310-9956-ffa450edef68 From dd2d8311a9acd067ccbfa80e879f5a98d2b23979 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 11 Feb 2006 21:04:03 +0000 Subject: [PATCH 5566/7878] Windows 9x file locks will *never* block. Emulate this behavior in a very crufty loop. Although better than nothing, this code easily creates a starved child waiting for a high-utilization lock. Since Win9x is marginally supported, create expected faults rather than unexpected failures. PR: 28714 Author: inoue , wrowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@377054 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/flock.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index cdbd7e174cf..1950ac11296 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -36,8 +36,26 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) return apr_get_os_error(); } else { - if (!LockFile(thefile->filehand, 0, 0, len, 0)) - return apr_get_os_error(); + /* On Win9x, LockFile() never blocks. Hack in a crufty poll. + * + * Note that this hack exposes threads to being unserviced forever, + * in the situation that the given lock has low availability. + * When implemented in the kernel, LockFile will typically use + * FIFO or round robin distribution to ensure all threads get + * one crack at the lock; but in this case we can't emulate that. + * + * However Win9x are barely maintainable anyways, if the user does + * choose to build to them, this is the best we can do. + */ + while (!LockFile(thefile->filehand, 0, 0, len, 0)) { + DWORD err = GetLastError(); + if ((err == ERROR_LOCK_VIOLATION) && !(type & APR_FLOCK_NONBLOCK)) + { + Sleep(500); /* pause for a half second */ + continue; /* ... and then poll again */ + } + return APR_FROM_OS_ERROR(err); + } } return APR_SUCCESS; From 058f8526ce78a8f7c2f2dfacfcf4a76c34c5530f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 13 Feb 2006 10:02:07 +0000 Subject: [PATCH 5567/7878] * test/testsock.c (test_get_addr): Fix error handling. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@377330 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/testsock.c b/test/testsock.c index a12b34be704..e1b4bfa3d58 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -254,10 +254,19 @@ static void test_get_addr(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "enable non-block mode", apr_socket_opt_set(cd, APR_SO_NONBLOCK, 1)); + /* It is valid for a connect() on a socket with NONBLOCK set to + * succeed (if the connection can be established synchronously), + * but if it does, this test cannot proceed. */ rv = apr_socket_connect(cd, sa); - ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EINPROGRESS(rv)); - if (rv && ! APR_STATUS_IS_EINPROGRESS(rv)) + if (rv == APR_SUCCESS) { + apr_socket_close(ld); + apr_socket_close(cd); + ABTS_NOT_IMPL(tc, "Cannot test if connect completes " + "synchronously"); return; + } + + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EINPROGRESS(rv)); APR_ASSERT_SUCCESS(tc, "accept connection", apr_socket_accept(&sd, ld, p)); From d38ff4cdbe4ef2287b398c4c03862f906d3543c5 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Mon, 13 Feb 2006 22:39:43 +0000 Subject: [PATCH 5568/7878] * include/apr_support.h (apr_wait_for_io_or_timeout): Stop talking about a pool argument, we don't actually have one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@377519 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_support.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/apr_support.h b/include/apr_support.h index 17a146a962c..3e4045dd2a8 100644 --- a/include/apr_support.h +++ b/include/apr_support.h @@ -38,8 +38,6 @@ extern "C" { /** * Wait for IO to occur or timeout. - * - * Uses POOL for temporary allocations. */ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, int for_read); From cf4d4ccd6864b2a14c7e380690932e7b54a8c8d5 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Mon, 13 Feb 2006 23:04:18 +0000 Subject: [PATCH 5569/7878] Improve some documentation comments. Based on a patch from: Julian Foad * include/apr_getopt.h (apr_getopt_err_fn_t): Clarify, mention what the arg parameter is. (apr_getopt_init): Clarify how the error function is used. * include/apr_poll.h (apr_poll): Note that nsds is an output parameter. * include/apr_support.h (apr_wait_for_io_or_timeout): Document the arguments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@377527 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_getopt.h | 8 +++++--- include/apr_poll.h | 2 +- include/apr_support.h | 6 ++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 972e14e3c73..b786cbd6d76 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -35,7 +35,9 @@ extern "C" { */ /** - * defintion of a error function + * An @c apr_getopt_t error callback function. + * + * @a arg is this @c apr_getopt_t's @c errarg member. */ typedef void (apr_getopt_err_fn_t)(void *arg, const char *err, ...); @@ -95,8 +97,8 @@ struct apr_getopt_option_t { * @param cont The pool to operate on * @param argc The number of arguments to parse * @param argv The array of arguments to parse - * @remark Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) - * The errfn is initialized to fprintf(stderr... but may be overridden. + * @remark Arguments 3 and 4 are most commonly argc and argv from main(argc, argv) + * The (*os)->errfn is initialized to fprintf(stderr... but may be overridden. */ APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, int argc, const char * const *argv); diff --git a/include/apr_poll.h b/include/apr_poll.h index e156fe8d7d6..601463e50d8 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -171,7 +171,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, * Poll the descriptors in the poll structure * @param aprset The poll structure we will be using. * @param numsock The number of descriptors we are polling - * @param nsds The number of descriptors signalled. + * @param nsds The number of descriptors signalled (output parameter) * @param timeout The amount of time in microseconds to wait. This is * a maximum, not a minimum. If a descriptor is signalled, we * will wake up before this time. A negative number means diff --git a/include/apr_support.h b/include/apr_support.h index 3e4045dd2a8..98cf410e6f9 100644 --- a/include/apr_support.h +++ b/include/apr_support.h @@ -38,6 +38,12 @@ extern "C" { /** * Wait for IO to occur or timeout. + * + * @param f The file to wait on. + * @param s The socket to wait on if @a f is @c NULL. + * @param for_read If non-zero wait for data to be available to read, + * otherwise wait for data to be able to be written. + * @return APR_TIMEUP if we run out of time. */ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, int for_read); From cbca3f397a69421ba54f52993a9050624832bd67 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 14 Feb 2006 12:31:23 +0000 Subject: [PATCH 5570/7878] OS/2 requires a drive letter in the path to be absolute. This fixes all 3 failures of testnames on OS/2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@377711 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testnames.c b/test/testnames.c index 6775e9519e8..d949df2ea69 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -22,7 +22,7 @@ #include "apr_pools.h" #include "apr_lib.h" -#if WIN32 +#if defined(WIN32) || defined(OS2) #define ABS_ROOT "C:/" #elif defined(NETWARE) #define ABS_ROOT "SYS:/" From 7e8713b7838a4198abbed4209ea26fe40a632803 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 15 Feb 2006 18:43:09 +0000 Subject: [PATCH 5571/7878] Sync Win32 behavior with Unix behavior for unbuffered file i/o on apr_file_flush(). Note this also makes unbuffered file i/o on win32 consistent with the buffered i/o behavior on the same. PR: 33485 Reported by: Curt Arnold . git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@378053 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index dc85900495b..3b0f62c347b 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -483,10 +483,12 @@ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) } return rc; - } else { - FlushFileBuffers(thefile->filehand); - return APR_SUCCESS; } + + /* There isn't anything to do if we aren't buffering the output + * so just return success. + */ + return APR_SUCCESS; } struct apr_file_printf_data { From 31e36926304809e50d83859c1076fc91af358611 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 15 Feb 2006 20:51:43 +0000 Subject: [PATCH 5572/7878] Fix a typo in comment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@378089 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index f58b432408a..5f00940af5b 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -78,7 +78,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out * Why not use NamedPipes on NT which support setting pipe state to * non-blocking? On NT, even though you can set a pipe non-blocking, * there is no clean way to set event driven non-zero timeouts (e.g select(), - * WaitForSinglelObject, et. al. will not detect pipe i/o). On NT, you + * WaitForSingleObject, et. al. will not detect pipe i/o). On NT, you * have to poll the pipe to detect i/o on a non-blocking pipe. */ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, From f1c9048ab13b676a03c06f60ac3dfa37e18bf321 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 16 Feb 2006 13:37:55 +0000 Subject: [PATCH 5573/7878] * Makefile.in (TARGETS): Update to include all targets which require write access to the builddir; remove export_vars.c since that is a dependency of apr.exp. (install): Depend on TARGETS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@378244 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index fe6ad501c92..4b16d56a51a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -36,7 +36,7 @@ INSTALL_DATA = @INSTALL_DATA@ # Rules for building specific targets, starting with 'all' for # building the entire package. # -TARGETS = $(TARGET_LIB) export_vars.c apr.exp +TARGETS = $(TARGET_LIB) apr.exp apr-config.out build/apr_rules.out # bring in rules.mk for standard functionality @INCLUDE_RULES@ @@ -66,7 +66,7 @@ apr-config.out: $(APR_CONFIG) build/apr_rules.out: build/apr_rules.mk sed 's,^\(apr_build.*=\).*$$,\1$(installbuilddir),' < build/apr_rules.mk > $@ -install: $(TARGET_LIB) apr-config.out build/apr_rules.out +install: $(TARGETS) $(APR_MKDIR) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(installbuilddir) \ $(DESTDIR)$(libdir)/pkgconfig $(DESTDIR)$(includedir) $(INSTALL_DATA) $(top_blddir)/include/apr.h $(DESTDIR)$(includedir) From 61ff81f8fad6f003afa227f4c7167b73777372e5 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 22 Feb 2006 11:26:16 +0000 Subject: [PATCH 5574/7878] OS/2: Add proper error handling when internal calls to apr_file_flush() fail within apr_file_read(), apr_file_gets() and apr_file_seek(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@379754 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 12 +++++++++++- file_io/os2/seek.c | 7 ++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index b7b97931cdc..fde47589e05 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -42,7 +42,13 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size apr_thread_mutex_lock(thefile->mutex); if (thefile->direction == 1) { - apr_file_flush(thefile); + int rv = apr_file_flush(thefile); + + if (rv != APR_SUCCESS) { + apr_thread_mutex_unlock(thefile->mutex); + return rv; + } + thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -300,6 +306,10 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) readlen = 1; rv = apr_file_read(thefile, str+i, &readlen); + if (rv != APR_SUCCESS) { + break; + } + if (readlen != 1) { rv = APR_EOF; break; diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index 40b02a81567..5918a7c7521 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -27,7 +27,12 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) ULONG rc; if (thefile->direction == 1) { - apr_file_flush(thefile); + apr_status_t rv = apr_file_flush(thefile); + + if (rv != APR_SUCCESS) { + return rv; + } + thefile->bufpos = thefile->direction = thefile->dataRead = 0; } From 47a29afcf9d10ca66c3dec739c2830f486a43dba Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 23 Feb 2006 12:36:59 +0000 Subject: [PATCH 5575/7878] * strings/apr_snprintf.c (conv_os_thread_t, conv_os_thread_t_hex): Avoid strict-aliasing warnings with gcc 4.1. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@380106 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index df2bf65602c..0cfdad1f45c 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -510,16 +510,17 @@ static char *conv_os_thread_t(apr_os_thread_t *tid, char *buf_end, apr_size_t *l { union { apr_os_thread_t tid; - apr_uint64_t alignme; + apr_uint64_t u64; + apr_uint32_t u32; } u; int is_negative; u.tid = *tid; switch(sizeof(u.tid)) { case sizeof(apr_int32_t): - return conv_10(*(apr_uint32_t *)&u.tid, TRUE, &is_negative, buf_end, len); + return conv_10(u.u32, TRUE, &is_negative, buf_end, len); case sizeof(apr_int64_t): - return conv_10_quad(*(apr_uint64_t *)&u.tid, TRUE, &is_negative, buf_end, len); + return conv_10_quad(u.u64, TRUE, &is_negative, buf_end, len); default: /* not implemented; stick 0 in the buffer */ return conv_10(0, TRUE, &is_negative, buf_end, len); @@ -680,16 +681,17 @@ static char *conv_os_thread_t_hex(apr_os_thread_t *tid, char *buf_end, apr_size_ { union { apr_os_thread_t tid; - apr_uint64_t alignme; + apr_uint64_t u64; + apr_uint32_t u32; } u; int is_negative; u.tid = *tid; switch(sizeof(u.tid)) { case sizeof(apr_int32_t): - return conv_p2(*(apr_uint32_t *)&u.tid, 4, 'x', buf_end, len); + return conv_p2(u.u32, 4, 'x', buf_end, len); case sizeof(apr_int64_t): - return conv_p2_quad(*(apr_uint64_t *)&u.tid, 4, 'x', buf_end, len); + return conv_p2_quad(u.u64, 4, 'x', buf_end, len); default: /* not implemented; stick 0 in the buffer */ return conv_10(0, TRUE, &is_negative, buf_end, len); From 29853b28e5204ddf4014603034a8c6464db9fe1f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 23 Feb 2006 14:06:15 +0000 Subject: [PATCH 5576/7878] * configure.in: Remove bogus check to test whether defining _POSIX_THREAD_PRIO_INHERIT makes pthread_mutexattr_setrobust_np available; the former is a POSIX feature test macro and is defined (or not) by unistd.h, not the application. * locks/unix/proc_mutex.c (proc_mutex_proc_pthread_create): Make explicit the assumption that robust mutexes are only used if priority inheritance is supported; this prevents use of robust mutexes with glibc 2.3, which aren't supported for cross-process use. PR: 38442 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@380120 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 17 ----------------- locks/unix/proc_mutex.c | 12 ++++++++++-- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/configure.in b/configure.in index beeda49dff3..c8059db74ae 100644 --- a/configure.in +++ b/configure.in @@ -1604,23 +1604,6 @@ if test "$threads" = "1"; then if test "$ac_cv_func_pthread_mutexattr_setpshared" = "yes"; then AC_CHECK_FUNCS(pthread_mutexattr_setrobust_np) - if test "$ac_cv_func_pthread_mutexattr_setrobust_np" = "no"; then - AC_CACHE_CHECK([for pthread_mutexattr_setrobust_np with _POSIX_THREAD_PRIO_INHERIT], - [apr_cv_setrobust_with_prio_inherit], [ - AC_TRY_COMPILE([#define _POSIX_THREAD_PRIO_INHERIT -#include -#include ],[ - int main() - { - pthread_mutexattr_t attr; - pthread_mutexattr_setrobust_np(&attr, PTHREAD_MUTEX_ROBUST_NP); - return 0; - }], [apr_cv_setrobust_with_prio_inherit=yes], [apr_cv_setrobust_with_prio_inherit=no])]) - if test "$apr_cv_setrobust_with_prio_inherit" = "yes"; then - ac_cv_func_pthread_mutexattr_setrobust_np=yes - APR_ADDTO(CPPFLAGS, -D_POSIX_THREAD_PRIO_INHERIT) - fi - fi fi fi diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 98fb2eb1e67..514bebabea8 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -325,7 +325,15 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, return rv; } -#ifdef HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP + /* It is strictly not necessary to only enable robust mutexes iff + * priority inheritance is supported, but historically this always + * has been the case. glibc 2.3 supports robust mutexes, but not + * cross-process robust mutexes, so enabling the robust mutex + * support like this ensures it is only used on Solaris, for now. + * A (more complicated) configure check would be necessary + * otherwise. */ +#if defined(HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP) \ + && defined(_POSIX_THREAD_PRIO_INHERIT) && _POSIX_THREAD_PRIO_INHERIT > 0 if ((rv = pthread_mutexattr_setrobust_np(&mattr, PTHREAD_MUTEX_ROBUST_NP))) { #ifdef PTHREAD_SETS_ERRNO @@ -343,7 +351,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, pthread_mutexattr_destroy(&mattr); return rv; } -#endif +#endif /* HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP && _POSIX_THREAD_PRIO_INHERIT > 0 */ if ((rv = pthread_mutex_init(new_mutex->pthread_interproc, &mattr))) { #ifdef PTHREAD_SETS_ERRNO From d52770d2e8da28d8a8921131421705ab39f2a46c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 28 Feb 2006 21:33:54 +0000 Subject: [PATCH 5577/7878] Several readwrite fixes require this code to become legible, so pre-prettify the code to match conventional style. No effective change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@381788 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 3b0f62c347b..b57b6124164 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -86,23 +86,28 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le rv = WaitForSingleObject(file->pOverlapped->hEvent, INFINITE); } switch (rv) { - case WAIT_OBJECT_0: - GetOverlappedResult(file->filehand, file->pOverlapped, - (LPDWORD)nbytes, TRUE); - rv = APR_SUCCESS; - break; - case WAIT_TIMEOUT: - rv = APR_TIMEUP; - break; - case WAIT_FAILED: - rv = apr_get_os_error(); - break; - default: - break; + case WAIT_OBJECT_0: + GetOverlappedResult(file->filehand, file->pOverlapped, + (LPDWORD)nbytes, TRUE); + rv = APR_SUCCESS; + break; + + case WAIT_TIMEOUT: + rv = APR_TIMEUP; + break; + + case WAIT_FAILED: + rv = apr_get_os_error(); + break; + + default: + break; } + if (rv != APR_SUCCESS) { - if (apr_os_level >= APR_WIN_98) + if (apr_os_level >= APR_WIN_98) { CancelIo(file->filehand); + } } } else if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) { From b7ef4d2c30a29f6cac83829bde7e7adef0538227 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 1 Mar 2006 02:30:54 +0000 Subject: [PATCH 5578/7878] Undo dangerous, potentially lethal casts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@381874 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index b57b6124164..3faf7e0ed9e 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -71,7 +71,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le } *nbytes = 0; - rv = ReadFile(file->filehand, buf, len, (LPDWORD)nbytes, file->pOverlapped); + rv = ReadFile(file->filehand, buf, len, nbytes, file->pOverlapped); if (!rv) { rv = apr_get_os_error(); @@ -88,7 +88,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le switch (rv) { case WAIT_OBJECT_0: GetOverlappedResult(file->filehand, file->pOverlapped, - (LPDWORD)nbytes, TRUE); + nbytes, TRUE); rv = APR_SUCCESS; break; @@ -332,7 +332,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = WaitForSingleObject(thefile->pOverlapped->hEvent, timeout_ms); switch (rv) { case WAIT_OBJECT_0: - GetOverlappedResult(thefile->filehand, thefile->pOverlapped, (LPDWORD)nbytes, TRUE); + GetOverlappedResult(thefile->filehand, thefile->pOverlapped, nbytes, TRUE); rv = APR_SUCCESS; break; case WAIT_TIMEOUT: From 9ddbb7822235c6a49ab3391abeada90f8fd78f4e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 1 Mar 2006 06:11:28 +0000 Subject: [PATCH 5579/7878] Quiet the only warning in apr build on Studio 2005, /GX deprecated. /EHsc has always meant the same thing. However, I'm reverting this to /GX for VC 5.0 (if anyone still uses it) when invoking the build/cvtdsp.pl -5 command to convert these projects to Visual 5.0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@381915 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++-- build/apr_app.dsp | 4 ++-- build/cvtdsp.pl | 12 ++++++++++++ build/libapr_app.dsp | 4 ++-- libapr.dsp | 4 ++-- test/testapp.dsp | 4 ++-- test/testappnt.dsp | 4 ++-- 7 files changed, 24 insertions(+), 12 deletions(-) diff --git a/apr.dsp b/apr.dsp index 0004e5ebeed..562853e7a70 100644 --- a/apr.dsp +++ b/apr.dsp @@ -64,8 +64,8 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr_src" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr_src" /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/build/apr_app.dsp b/build/apr_app.dsp index a919872e2af..ac060a503ff 100644 --- a/build/apr_app.dsp +++ b/build/apr_app.dsp @@ -64,8 +64,8 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fd"LibD\apr_app_src" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fd"LibD\apr_app_src" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl index 524ba90b2d8..3a101f1e0a1 100644 --- a/build/cvtdsp.pl +++ b/build/cvtdsp.pl @@ -54,6 +54,12 @@ sub tovc5 { if ($src =~ s|^(# ADD BASE CPP .*)/ZI (.*)|$1/Zi $2|) { $verchg = -1; } + if ($src =~ s|^(# ADD CPP .*)/EHsc (.*)|$1/GX $2|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD BASE CPP .*)/EHsc (.*)|$1/GX $2|) { + $verchg = -1; + } if ($src !~ m|^# PROP AllowPerConfigDependencies|) { print $dstfl $src; } else { @@ -90,6 +96,12 @@ sub tovc6 { $src = $src . $cont; $verchg = -1; } + if ($src =~ s|^(# ADD CPP .*)/GX (.*)|$1/EHsc $2|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD BASE CPP .*)/GX (.*)|$1/EHsc $2|) { + $verchg = -1; + } print $dstfl $src; if ($verchg && $src =~ m|^# Begin Project|) { print $dstfl "# PROP AllowPerConfigDependencies 0\n"; diff --git a/build/libapr_app.dsp b/build/libapr_app.dsp index ac80e7ea53f..0cd962e5cd3 100644 --- a/build/libapr_app.dsp +++ b/build/libapr_app.dsp @@ -64,8 +64,8 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"Debug\libapr_app_src" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"Debug\libapr_app_src" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe diff --git a/libapr.dsp b/libapr.dsp index cd7098f710e..8e307ab7a57 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -68,8 +68,8 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr_src" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr_src" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" diff --git a/test/testapp.dsp b/test/testapp.dsp index 9c7733dd388..5d40f89cc85 100644 --- a/test/testapp.dsp +++ b/test/testapp.dsp @@ -65,8 +65,8 @@ LINK32=link.exe # PROP Intermediate_Dir "." # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /Fd"./testapp" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /Fd"./testapp" /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/test/testappnt.dsp b/test/testappnt.dsp index 54aa698cab7..dfd0d0383ed 100644 --- a/test/testappnt.dsp +++ b/test/testappnt.dsp @@ -65,8 +65,8 @@ LINK32=link.exe # PROP Intermediate_Dir "." # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../include" /D "_DEBUG" /D "WIN32" /D "WINNT" /D "_CONSOLE" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /Fd"./testappnt" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /D "_DEBUG" /D "WIN32" /D "WINNT" /D "_CONSOLE" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /Fd"./testappnt" /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe From 5a88723cc6df64f641ffd3ef3192c80a4e4c74ad Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 1 Mar 2006 07:03:13 +0000 Subject: [PATCH 5580/7878] This patch needs additional pairs of eyeballs before considering for backport. We bucket the bytecount results from ReadFile and GetOverlappedResult into a true DWORD buffer, and then pass that value across to the apr_size_t *nbytes argument, which on Win64 is a quadword. Please vote for correctness. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@381936 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 3faf7e0ed9e..66a4580b55d 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -32,7 +32,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le { apr_status_t rv; DWORD len = (DWORD)len_in; - *nbytes = 0; + DWORD bytesread = 0; /* Handle the zero timeout non-blocking case */ if (file->timeout == 0) { @@ -46,10 +46,12 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) { rv = APR_EOF; } + *nbytes = 0; return rv; } else { if (bytes == 0) { + *nbytes = 0; return APR_EAGAIN; } if (len > bytes) { @@ -70,8 +72,9 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le file->pOverlapped->OffsetHigh = (DWORD)(file->filePtr >> 32); } - *nbytes = 0; - rv = ReadFile(file->filehand, buf, len, nbytes, file->pOverlapped); + rv = ReadFile(file->filehand, buf, len, + &bytesread, file->pOverlapped); + *nbytes = bytesread; if (!rv) { rv = apr_get_os_error(); @@ -88,7 +91,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le switch (rv) { case WAIT_OBJECT_0: GetOverlappedResult(file->filehand, file->pOverlapped, - nbytes, TRUE); + &bytesread, TRUE); rv = APR_SUCCESS; break; @@ -332,7 +335,9 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = WaitForSingleObject(thefile->pOverlapped->hEvent, timeout_ms); switch (rv) { case WAIT_OBJECT_0: - GetOverlappedResult(thefile->filehand, thefile->pOverlapped, nbytes, TRUE); + GetOverlappedResult(thefile->filehand, thefile->pOverlapped, + &bwrote, TRUE); + *nbytes = bwrote; rv = APR_SUCCESS; break; case WAIT_TIMEOUT: From b0dda231dfc9c390eff08e2694ef6e02118706a5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 1 Mar 2006 14:28:46 +0000 Subject: [PATCH 5581/7878] Proveup: Bug 38801 reported by git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@382029 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/test/testnames.c b/test/testnames.c index d949df2ea69..386da8c00e2 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -203,6 +203,38 @@ static void root_from_slash(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "", path); } +static void root_from_cwd_and_back(abts_case *tc, void *data) +{ + apr_status_t rv; + const char *root = NULL; + const char *path = "//"; + char *origpath; + char *testpath; + + ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_filepath_get(&origpath, 0, p)); + path = origpath; + rv = apr_filepath_root(&root, &path, APR_FILEPATH_TRUENAME, p); + +#if defined(WIN32) || defined(OS2) + ABTS_INT_EQUAL(tc, origpath[0], root[0]); + ABTS_INT_EQUAL(tc, ':', root[1]); + ABTS_INT_EQUAL(tc, '/', root[2]); + ABTS_INT_EQUAL(tc, 0, root[3]); + ABTS_STR_EQUAL(tc, origpath + 3, path); +#else + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, '/', root); + ABTS_STR_EQUAL(tc, origpath + 1, path); +#endif + + rv = apr_filepath_merge(&testpath, root, path, + APR_FILEPATH_TRUENAME + | APR_FILEPATH_NOTABOVEROOT + | APR_FILEPATH_NOTRELATIVE, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, origpath, testpath); +} + abts_suite *testnames(abts_suite *suite) { @@ -221,6 +253,7 @@ abts_suite *testnames(abts_suite *suite) abts_run_test(suite, root_absolute, NULL); abts_run_test(suite, root_relative, NULL); abts_run_test(suite, root_from_slash, NULL); + abts_run_test(suite, root_from_cwd_and_back, NULL); return suite; } From 9a7ba0a0d9ba0e25757cec34d9df9967a2bca18d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 1 Mar 2006 14:29:43 +0000 Subject: [PATCH 5582/7878] Usse a future-proof configure check for the robust mutex support: * configure.in: Use APR_CHECK_PTHREAD_ROBUST_SHARED_MUTEX instead of just checking for pthread_mutexattr_setrobust_np. * build/apr_threads.m4 (APR_CHECK_PTHREAD_ROBUST_SHARED_MUTEX): Add macro. * unix/proc_mutex.c (proc_mutex_proc_pthread_create): Use HAVE_PTHREAD_MUTEX_ROBUST instead of the heuristic test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@382030 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_threads.m4 | 38 ++++++++++++++++++++++++++++++++++++++ configure.in | 2 +- locks/unix/proc_mutex.c | 12 ++---------- 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index 7ce2f49dc4e..01d032d52dc 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -242,3 +242,41 @@ if test "$apr_cv_mutex_recursive" = "yes"; then [Define if recursive pthread mutexes are available]) fi ]) + +dnl Check for robust process-shared mutex support +AC_DEFUN([APR_CHECK_PTHREAD_ROBUST_SHARED_MUTEX], [ +AC_CACHE_CHECK([for robust cross-process mutex support], +[apr_cv_mutex_robust_shared], +[AC_TRY_RUN([ +#include +#include +#include + +int main(int argc, char **argv) +{ + pthread_mutex_t mutex; + pthread_mutexattr_t attr; + + if (pthread_mutexattr_init(&attr)) + exit(1); + if (pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)) + exit(2); + if (pthread_mutexattr_setrobust_np(&attr, PTHREAD_MUTEX_ROBUST_NP)) + exit(3); + if (pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT)) + exit(4); + if (pthread_mutex_init(&mutex, &attr)) + exit(5); + if (pthread_mutexattr_destroy(&attr)) + exit(6); + if (pthread_mutex_destroy(&mutex)) + exit(7); + + exit(0); +}], [apr_cv_mutex_robust_shared=yes], [apr_cv_mutex_robust_shared=no])]) + +if test "$apr_cv_mutex_robust_shared" = "yes"; then + AC_DEFINE([HAVE_PTHREAD_MUTEX_ROBUST], 1, + [Define if cross-process robust mutexes are available]) +fi +]) diff --git a/configure.in b/configure.in index c8059db74ae..8d29a20aa68 100644 --- a/configure.in +++ b/configure.in @@ -1603,7 +1603,7 @@ if test "$threads" = "1"; then ac_cv_func_pthread_mutexattr_setpshared=$apr_cv_process_shared_works]) if test "$ac_cv_func_pthread_mutexattr_setpshared" = "yes"; then - AC_CHECK_FUNCS(pthread_mutexattr_setrobust_np) + APR_CHECK_PTHREAD_ROBUST_SHARED_MUTEX fi fi diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 514bebabea8..de9a5b04758 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -325,15 +325,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, return rv; } - /* It is strictly not necessary to only enable robust mutexes iff - * priority inheritance is supported, but historically this always - * has been the case. glibc 2.3 supports robust mutexes, but not - * cross-process robust mutexes, so enabling the robust mutex - * support like this ensures it is only used on Solaris, for now. - * A (more complicated) configure check would be necessary - * otherwise. */ -#if defined(HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP) \ - && defined(_POSIX_THREAD_PRIO_INHERIT) && _POSIX_THREAD_PRIO_INHERIT > 0 +#ifdef HAVE_PTHREAD_MUTEX_ROBUST if ((rv = pthread_mutexattr_setrobust_np(&mattr, PTHREAD_MUTEX_ROBUST_NP))) { #ifdef PTHREAD_SETS_ERRNO @@ -351,7 +343,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, pthread_mutexattr_destroy(&mattr); return rv; } -#endif /* HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP && _POSIX_THREAD_PRIO_INHERIT > 0 */ +#endif /* HAVE_PTHREAD_MUTEX_ROBUST */ if ((rv = pthread_mutex_init(new_mutex->pthread_interproc, &mattr))) { #ifdef PTHREAD_SETS_ERRNO From d5253866031ba86c6c4a74d9032794466f261361 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 1 Mar 2006 14:33:03 +0000 Subject: [PATCH 5583/7878] * test/testnames.c (root_from_cwd_and_back): Fix segfault on non-Win32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@382033 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testnames.c b/test/testnames.c index 386da8c00e2..68aa444807f 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -223,7 +223,7 @@ static void root_from_cwd_and_back(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, origpath + 3, path); #else ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_STR_EQUAL(tc, '/', root); + ABTS_STR_EQUAL(tc, "/", root); ABTS_STR_EQUAL(tc, origpath + 1, path); #endif From e597a66dca211d8ad45eaadbfd9d3c934fa3d3ef Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 1 Mar 2006 15:03:54 +0000 Subject: [PATCH 5584/7878] Close bug 38801; add optimization but test the slash delimit for both test cases. Passes the testnames suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@382043 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index ea80e14b90a..8b7b32445f1 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -801,16 +801,17 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * segment is thoroughly tested prior to path parsing. */ if ((flags & APR_FILEPATH_NOTABOVEROOT) && (baselen || rootlen)) { - if (baselen && memcmp(basepath, path + rootlen, baselen) && - basepath[baselen - 1] != '/' && basepath[baselen - 1] != '\\') - return APR_EABOVEROOT; + if (basepath[baselen - 1] != '/' && basepath[baselen - 1] != '\\') { + if (baselen && memcmp(basepath, path + rootlen, baselen)) + return APR_EABOVEROOT; - /* Ahem... if we weren't given a trailing slash on the basepath, - * we better be sure that /foo wasn't replaced with /foobar! - */ - if (path[rootlen + baselen] && path[rootlen + baselen] != '/' - && path[rootlen + baselen] != '\\') - return APR_EABOVEROOT; + /* Ahem... if we weren't given a trailing slash on the basepath, + * we better be sure that /foo wasn't replaced with /foobar! + */ + if (path[rootlen + baselen] && path[rootlen + baselen] != '/' + && path[rootlen + baselen] != '\\') + return APR_EABOVEROOT; + } } if (addpath && (flags & APR_FILEPATH_TRUENAME)) { From ca0130b4e4f158ade1cfcb4c38fbd3b0ca4d77fd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 1 Mar 2006 17:41:22 +0000 Subject: [PATCH 5585/7878] Revert 239927 and simplify a much more basic optimization to address if a basepath existed to compare the results to. Also reverts my attempt 382043 to fix the flaw. Any further 'features' to support alternate constructs of NOTABOVEROOT tested base and add paths must be brought up on list for discussion. PR: 38801 Reported by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@382095 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 8b7b32445f1..1912a1c80b0 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -800,18 +800,17 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * is still within given basepath. Note that the root path * segment is thoroughly tested prior to path parsing. */ - if ((flags & APR_FILEPATH_NOTABOVEROOT) && (baselen || rootlen)) { - if (basepath[baselen - 1] != '/' && basepath[baselen - 1] != '\\') { - if (baselen && memcmp(basepath, path + rootlen, baselen)) - return APR_EABOVEROOT; - - /* Ahem... if we weren't given a trailing slash on the basepath, - * we better be sure that /foo wasn't replaced with /foobar! - */ - if (path[rootlen + baselen] && path[rootlen + baselen] != '/' - && path[rootlen + baselen] != '\\') - return APR_EABOVEROOT; - } + if ((flags & APR_FILEPATH_NOTABOVEROOT) && baselen) { + if (memcmp(basepath, path + rootlen, baselen) != 0) + return APR_EABOVEROOT; + + /* Ahem... if we have a basepath without a trailing slash, + * we better be sure that /foo wasn't replaced with /foobar! + */ + if (basepath[baselen - 1] != '/' && basepath[baselen - 1] != '\\' + && path[rootlen + baselen] && path[rootlen + baselen] != '/' + && path[rootlen + baselen] != '\\') + return APR_EABOVEROOT; } if (addpath && (flags & APR_FILEPATH_TRUENAME)) { From e9a4d384e88b5b8d3320bd84c8acea2565bc5f07 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 2 Mar 2006 22:46:47 +0000 Subject: [PATCH 5586/7878] After a bit of discussion on list, it seems this flag's behavior should be documented, not changed, until APR 2.0 is released. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@382540 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index bb417041ecc..da810a396ba 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -284,7 +284,11 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); * @{ */ -/** Cause apr_filepath_merge to fail if addpath is above rootpath */ +/** Cause apr_filepath_merge to fail if addpath is above rootpath + * @bug in APR 0.9 and 1.x, this flag's behavior is undefined + * if the rootpath is NULL or empty. In APR 2.0 this should be + * changed to imply NOTABSOLUTE if the rootpath is NULL or empty. + */ #define APR_FILEPATH_NOTABOVEROOT 0x01 /** internal: Only meaningful with APR_FILEPATH_NOTABOVEROOT */ From 65da4cb04e60a7b34a615054760093c0625dabfc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 2 Mar 2006 22:53:49 +0000 Subject: [PATCH 5587/7878] Address bug 37999 and other exceptions to the existing uuid detection code; favor uuid_create or uuid_generate if they live in the clib, and perform a true compile/link test on our suspected success case, disabling the code if this fails. More sets of eyes and feedback to dev@apr requested before we backport this patch to APR 1.2.x Authored by: wrowe, maxb git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@382541 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 54 ++++++++++++++++++++++++++++++++++++++++++++---- misc/unix/rand.c | 8 ++++++- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 8d29a20aa68..999517e531e 100644 --- a/configure.in +++ b/configure.in @@ -1803,15 +1803,61 @@ AC_SUBST(rand) dnl ----------------------------- Checking for UUID Support echo "${nl}Checking for OS UUID Support..." -osuuid="0" -AC_CHECK_HEADERS(uuid/uuid.h uuid.h) +AC_CHECK_HEADERS(uuid.h sys/uuid.h uuid/uuid.h, break) -# Check for uuid_generate in libc or libuuid +apr_revert_save_LIBS=$LIBS + +# Prefer the flavor(s) that live in libc; +AC_SEARCH_LIBS(uuid_create, uuid) AC_SEARCH_LIBS(uuid_generate, uuid) +if test "$ac_cv_search_uuid_create" = "none required" -o \ + "$ac_cv_search_uuid_generate" = "none required"; then + LIBS=$apr_revert_save_LIBS +fi -AC_CHECK_FUNCS([uuid_generate uuid_create], [osuuid=1; break]) +AC_CHECK_FUNCS(uuid_create uuid_generate) + +AC_CACHE_CHECK([for os uuid usability], [apr_cv_osuuid], [ +# Ensure this test closely mirrors misc/unix/rand.c! +uuid_includes=" ${nl} +#if defined(HAVE_SYS_TYPES_H) ${nl} +#include ${nl} +#endif ${nl} +#if defined(HAVE_UNISTD_H) ${nl} +#include ${nl} +#endif ${nl} +#if defined(HAVE_UUID_H) ${nl} +#include ${nl} +#elif defined(HAVE_SYS_UUID_H) ${nl} +#include ${nl} +#elif defined(HAVE_UUID_UUID_H) ${nl} +#include ${nl} +#endif ${nl} +" + apr_cv_osuuid=no + if test $ac_cv_func_uuid_create = yes; then + AC_TRY_LINK([$uuid_includes], [ + uuid_t g; + uint32_t s; + uuid_create(&g, &s); + if (s == uuid_s_ok) s = 0; + ], [apr_cv_osuuid=yes], [apr_cv_func_uuid_create=no]) + fi + if test $ac_cv_func_uuid_generate = yes; then + AC_TRY_LINK([$uuid_includes], [ + uuid_t g; + uuid_generate(g); + ], [apr_cv_osuuid=yes], [apr_cv_func_uuid_generate=no]) + fi +]) +if test $apr_cv_osuuid = yes; then + osuuid="1" +else + osuuid="0" + LIBS=$apr_revert_save_LIBS +fi AC_SUBST(osuuid) diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 1763bb41339..2e0d8353ecb 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -35,8 +35,10 @@ #if APR_HAVE_SYS_UN_H #include #endif -#ifdef HAVE_UUID_H +#if defined(HAVE_UUID_H) #include +#elif defined(HAVE_SYS_UUID_H) +#include #elif defined(HAVE_UUID_UUID_H) #include #endif @@ -45,6 +47,8 @@ #define SHUT_RDWR 2 #endif +#if APR_HAS_OS_UUID + #if defined(HAVE_UUID_CREATE) APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) @@ -72,6 +76,8 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) } #endif +#endif /* APR_HAS_OS_UUID */ + #if APR_HAS_RANDOM APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, From 4d5c2e24640bd1270a3df681925b9aaddcc9625b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 2 Mar 2006 22:58:41 +0000 Subject: [PATCH 5588/7878] The second half of the last commit. Follow the only API we found for uuid_create and test the result value for uuid_s_ok. This matches the configure.in tests, and is therefore safe to assume it -does- build correctly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@382543 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/rand.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 2e0d8353ecb..c9723f5ff1b 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -53,9 +53,13 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) { + uint32_t rv; uuid_t g; - uuid_create(&g, NULL); + uuid_create(&g, &rv); + + if (rv != uuid_s_ok) + APR_EGENERAL; memcpy(uuid_data, &g, sizeof(uuid_t)); From c5f6e1a0cd4ed6edcdae223b0ec9dad2f0c3122c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 2 Mar 2006 23:13:37 +0000 Subject: [PATCH 5589/7878] Fix a typo caught by maxb git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@382552 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/rand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/unix/rand.c b/misc/unix/rand.c index c9723f5ff1b..8e063533b0b 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -59,7 +59,7 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) uuid_create(&g, &rv); if (rv != uuid_s_ok) - APR_EGENERAL; + return APR_EGENERAL; memcpy(uuid_data, &g, sizeof(uuid_t)); From edb97220d5490eb1df4abcba0ca2d284ab895784 Mon Sep 17 00:00:00 2001 From: Max Oliver Bowsher Date: Fri, 3 Mar 2006 10:26:58 +0000 Subject: [PATCH 5590/7878] * build/MakeEtags: Convert to be useful for APR and APR-util as well as HTTPD. Do not hardcode a specific path to etags, use ETAGS envvar, or search PATH. Update URL to "Exuberant ctags" project home. PR: 22615 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@382752 13f79535-47bb-0310-9956-ffa450edef68 --- build/MakeEtags | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build/MakeEtags b/build/MakeEtags index c4e957c97f2..cf1a48686e4 100755 --- a/build/MakeEtags +++ b/build/MakeEtags @@ -12,22 +12,24 @@ # tag-table-alist with an entry to assure it finds the single ./TAGS # file from the many source directories. Something along these lines: # (setq tag-table-alist -# '(("/home/me/work/httpd-2.0/" -# . "/home/me/work/httpd-2.0/") +# '(("/home/me/work/apr-x.y/" . "/home/me/work/apr-x.y/") +# ("/home/me/work/apr-util-x.y/" . "/home/me/work/apr-util-x.y/") +# ("/home/me/work/httpd-x.y/" . "/home/me/work/httpd-x.y/") # )) # This requires a special version of etags, i.e. the # one called "Exuberant ctags" available at: -# http://fly.hiwaay.net/~darren/ctags/ +# http://ctags.sourceforge.net/ # Once that is setup you'll need to point to the # executable here: -etags=~/local/bin/etags +etags=${ETAGS-etags} # Exuberant etags is necessary since it can ignore some defined symbols # that obscure the function signatures. -ignore=AP_DECLARE,AP_DECLARE_NONSTD,__declspec +ignore=AP_DECLARE,AP_DECLARE_NONSTD,__declspec,APR_DECLARE,APR_DECLARE_NONSTD +ignore=$ignore,APU_DECLARE,APU_DECLARE_NONSTD # Create an etags file at the root of the source # tree, then create symbol links to it from each From 5999870f29e98825d099fa8559a7e4496de1cc7e Mon Sep 17 00:00:00 2001 From: Max Oliver Bowsher Date: Tue, 7 Mar 2006 11:54:03 +0000 Subject: [PATCH 5591/7878] Copy CHANGES entries present in 1.2.x but not in trunk into trunk. * apr/CHANGES: Mention apr_dir_make_recursive() fix in r291339. Mention apr_file_seek() fix in r326593, r326597. * apr-util/CHANGES: Mention addition of BDB 4.4 support in r368482. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@383854 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGES b/CHANGES index 82a787007f1..5dc38b8b941 100644 --- a/CHANGES +++ b/CHANGES @@ -85,8 +85,16 @@ Changes for APR 1.3.0 *) Add APR_ARRAY_IDX() and APR_ARRAY_PUSH() convenience macros to apr_tables.h. [Garrett Rooney] +Changes for APR 1.2.4 + + *) Fix apr_file_seek() to catch write failures when flushing + pending writes for a buffered file. [Joe Orton] + Changes for APR 1.2.2 + *) Fix crash in apr_dir_make_recursive() for relative path + when the working directory has been deleted. [Joe Orton] + *) Win32: fix apr_proc_mutex_trylock() to handle WAIT_TIMEOUT, returning APR_EBUSY. [Ronen Mizrahi ] From 9edd0e6bda97d7535ae07e82e2a9fbfcb9356cda Mon Sep 17 00:00:00 2001 From: Max Oliver Bowsher Date: Tue, 7 Mar 2006 12:03:19 +0000 Subject: [PATCH 5592/7878] On trunk, move CHANGES items that have been backported to 1.2.x down into the appropriate 1.2.x sections. This commit only moves entries around. It does not add or remove any. * apr/CHANGES * apr-util/CHANGES git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@383858 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 66 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/CHANGES b/CHANGES index 5dc38b8b941..cc9236a9926 100644 --- a/CHANGES +++ b/CHANGES @@ -1,48 +1,15 @@ Changes for APR 1.3.0 - *) Make the filePtr in apr_file_t an apr_off_t on Unix, to avoid issues - truncating offsets down to 32 bits on large file systems. - [Garrett Rooney] - - *) Fix seeks with files opened in xthread mode for append on win32. - [M Joonas Pihlaja , Garrett Rooney] - - *) Keep testpipe.c from hanging on win32. [Garrett Rooney] - - *) Fix assertion from double close of a handle with a rwlock on win32. - [Evgueni Brevnov ] - *) APR_FIND_APR macro now supports customisable detailed checks on each installed apr. [Justin Erenkrantz, Colm MacCarthaigh] *) APR_FIND_APR macro no longer checks /usr/local/apache2/ [Colm MacCarthaigh] - *) Documented that apr_stat and apr_dir_read can return APR_INCOMPLETE, - and how to determine which parts of the resulting apr_finfo_t can be - used in such a case. - [Garrett Rooney] - - *) Cause apr_file_write_full on win32 to consider the timeout value set by - apr_file_pipe_timeout_set. PR 30182 - [] - *) Only include uuid/uuid.h if we haven't already included uuid.h, since doing so can result in type conflicts. [Craig Rodrigues ] - *) Fix EOF handling for unbuffered reads on win32. - [Konstantin Sharenkov ] - - *) Fix passing "" as an argument to the program started by apr_proc_create - on Win32. - [Philip Martin - - *) Bugfix for apr_pollset_poll() on systems that implement pollsets - using select(2): properly compute the number of signalled desciptors - when one or more of them are both readable and writable. - [Dror Shilo , Gerry ] - *) Add APR_POLLSET_NOCOPY option to apr_pollset API to eliminate O(n)-time lookup in apr_pollset_remove() (currently implemented only for epoll). [Brian Pane] @@ -87,6 +54,39 @@ Changes for APR 1.3.0 Changes for APR 1.2.4 + *) Make the filePtr in apr_file_t an apr_off_t on Unix, to avoid issues + truncating offsets down to 32 bits on large file systems. + [Garrett Rooney] + + *) Fix seeks with files opened in xthread mode for append on win32. + [M Joonas Pihlaja , Garrett Rooney] + + *) Keep testpipe.c from hanging on win32. [Garrett Rooney] + + *) Cause apr_file_write_full on win32 to consider the timeout value set by + apr_file_pipe_timeout_set. PR 30182 + [] + + *) Fix assertion from double close of a handle with a rwlock on win32. + [Evgueni Brevnov ] + + *) Fix EOF handling for unbuffered reads on win32. + [Konstantin Sharenkov ] + + *) Documented that apr_stat and apr_dir_read can return APR_INCOMPLETE, + and how to determine which parts of the resulting apr_finfo_t can be + used in such a case. + [Garrett Rooney] + + *) Fix passing "" as an argument to the program started by apr_proc_create + on Win32. + [Philip Martin + + *) Bugfix for apr_pollset_poll() on systems that implement pollsets + using select(2): properly compute the number of signalled desciptors + when one or more of them are both readable and writable. + [Dror Shilo , Gerry ] + *) Fix apr_file_seek() to catch write failures when flushing pending writes for a buffered file. [Joe Orton] From c9cab921ea4bbb7382c43517641f650ff0296f8d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 9 Mar 2006 08:53:24 +0000 Subject: [PATCH 5593/7878] * memory/unix/apr_pools.c (apr_pool_create_ex): Remove a redundant test; global_pool is guaranteed to be non-NULL, so parent is guaranteed to be non-NULL here. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@384465 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 4e6200ab9ed..b2bd54a946f 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -791,7 +791,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, if (!parent) parent = global_pool; - if (!abort_fn && parent) + if (!abort_fn) abort_fn = parent->abort_fn; if (allocator == NULL) From 6011572cfbd2bd601301ea4cd9d8a4fa49e777ba Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 10 Mar 2006 06:40:52 +0000 Subject: [PATCH 5594/7878] Throw away a horrible change; each time we layer on more garbage to libtool et al we've caused apr to fail in more peculiar ways on more platforms. In this case, let libtool do exactly what we want, which is to resolve the build-path flavor of libapr-1.la and test exactly what we've most recently changed (and, for that matter, to have make check function whatsoever before the library has been installed.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@384715 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index b5b9fd32b95..e6701e2c767 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -37,9 +37,9 @@ CLEAN_SUBDIRS = internal INCDIR=../include INCLUDES=-I$(INCDIR) -I$(srcdir)/../include -# link programs using -no-install to get real executables not -# libtool wrapper scripts which link an executable when first run. -LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) -no-install $(ALL_LDFLAGS) -o $@ +# uses libtool wrapper scripts which ensures we are testing the currently built +# library in ../.libs/, not the installed/stale flavor due to -rpath. +LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(ALL_LDFLAGS) -o $@ check: $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \ From fbb4fb31a609da539f83cd6b63e590c6f3eae262 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 10 Mar 2006 07:32:33 +0000 Subject: [PATCH 5595/7878] * memory/unix/apr_pools.c (apr_pool_create_ex): Revert previous change; add comment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@384722 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index b2bd54a946f..b4218fe1142 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -791,7 +791,11 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, if (!parent) parent = global_pool; - if (!abort_fn) + /* parent will always be non-NULL here except the first time a + * pool is created, in which case allocator is guaranteed to be + * non-NULL. */ + + if (!abort_fn && parent) abort_fn = parent->abort_fn; if (allocator == NULL) From c28f387220fcfa78ab9246e73ffbe7f85e7ef780 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 10 Mar 2006 10:09:36 +0000 Subject: [PATCH 5596/7878] * configure.in: Set LT_NO_INSTALL to -no-install on all platforms but Darwin. * test/Makefile.in: Revert r384715 and use LT_NO_INSTALL instead of hard-coding -no-install. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@384750 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 ++++++++++ test/Makefile.in | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 999517e531e..15850a1950e 100644 --- a/configure.in +++ b/configure.in @@ -2047,6 +2047,16 @@ AC_SUBST(DEFAULT_OSDIR) AC_SUBST(EXEEXT) AC_SUBST(LIBTOOL_LIBS) +# Use -no-install to link the test programs on all platforms +# but Darwin, where it would cause the programs to be linked +# against installed versions of libapr instead of those just +# built. +case $host in +*-apple-darwin*) LT_NO_INSTALL="" ;; +*) LT_NO_INSTALL="-no-install" ;; +esac +AC_SUBST(LT_NO_INSTALL) + # # BSD/OS (BSDi) needs to use a different include syntax in the Makefiles # diff --git a/test/Makefile.in b/test/Makefile.in index e6701e2c767..cafc7aa369d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -37,9 +37,9 @@ CLEAN_SUBDIRS = internal INCDIR=../include INCLUDES=-I$(INCDIR) -I$(srcdir)/../include -# uses libtool wrapper scripts which ensures we are testing the currently built -# library in ../.libs/, not the installed/stale flavor due to -rpath. -LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(ALL_LDFLAGS) -o $@ +# link programs using -no-install to get real executables not +# libtool wrapper scripts which link an executable when first run. +LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@ check: $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \ From 9c0872f0605b738e19c405afd5b9803118819302 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 10 Mar 2006 21:59:49 +0000 Subject: [PATCH 5597/7878] Restyle this code, slightly, to avoid code-not-reached warnings from the optimizer (detected on Solaris cc 5.8) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@384926 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strnatcmp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/strings/apr_strnatcmp.c b/strings/apr_strnatcmp.c index 73ce516d9f7..0e960e8a90b 100644 --- a/strings/apr_strnatcmp.c +++ b/strings/apr_strnatcmp.c @@ -44,7 +44,7 @@ compare_right(char const *a, char const *b) remember it in BIAS. */ for (;; a++, b++) { if (!apr_isdigit(*a) && !apr_isdigit(*b)) - return bias; + break; else if (!apr_isdigit(*a)) return -1; else if (!apr_isdigit(*b)) @@ -56,10 +56,10 @@ compare_right(char const *a, char const *b) if (!bias) bias = +1; } else if (!*a && !*b) - return bias; + break; } - return 0; + return bias; } @@ -70,7 +70,7 @@ compare_left(char const *a, char const *b) different value wins. */ for (;; a++, b++) { if (!apr_isdigit(*a) && !apr_isdigit(*b)) - return 0; + break; else if (!apr_isdigit(*a)) return -1; else if (!apr_isdigit(*b)) From 1525b854f0c77c3fb1eb409f77787da54f4bbd71 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 10 Mar 2006 22:04:07 +0000 Subject: [PATCH 5598/7878] One more evolution of the uuid header detection code. On Solaris, uuid/uuid.h defined uuid_generate, and itself includes sys/uuid.h which only defined the uuid_t. Therefore prefer the broadest uuid.h, followed by uuid/uuid.h, and only if those fail, fall back on sys/uuid.h which may contain nothing beyond the sys types of uuid_t entities. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@384930 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 30 +++++++++++++++--------------- misc/unix/rand.c | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/configure.in b/configure.in index 15850a1950e..3f1a99cbb88 100644 --- a/configure.in +++ b/configure.in @@ -1804,7 +1804,7 @@ AC_SUBST(rand) dnl ----------------------------- Checking for UUID Support echo "${nl}Checking for OS UUID Support..." -AC_CHECK_HEADERS(uuid.h sys/uuid.h uuid/uuid.h, break) +AC_CHECK_HEADERS(uuid.h uuid/uuid.h sys/uuid.h, break) apr_revert_save_LIBS=$LIBS @@ -1820,20 +1820,20 @@ AC_CHECK_FUNCS(uuid_create uuid_generate) AC_CACHE_CHECK([for os uuid usability], [apr_cv_osuuid], [ # Ensure this test closely mirrors misc/unix/rand.c! -uuid_includes=" ${nl} -#if defined(HAVE_SYS_TYPES_H) ${nl} -#include ${nl} -#endif ${nl} -#if defined(HAVE_UNISTD_H) ${nl} -#include ${nl} -#endif ${nl} -#if defined(HAVE_UUID_H) ${nl} -#include ${nl} -#elif defined(HAVE_SYS_UUID_H) ${nl} -#include ${nl} -#elif defined(HAVE_UUID_UUID_H) ${nl} -#include ${nl} -#endif ${nl} +uuid_includes=" +#if defined(HAVE_SYS_TYPES_H) +#include +#endif +#if defined(HAVE_UNISTD_H) +#include +#endif +#if defined(HAVE_UUID_H) +#include +#elif defined(HAVE_UUID_UUID_H) +#include +#elif defined(HAVE_SYS_UUID_H) +#include +#endif " apr_cv_osuuid=no if test $ac_cv_func_uuid_create = yes; then diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 8e063533b0b..28359b959dd 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -37,10 +37,10 @@ #endif #if defined(HAVE_UUID_H) #include -#elif defined(HAVE_SYS_UUID_H) -#include #elif defined(HAVE_UUID_UUID_H) #include +#elif defined(HAVE_SYS_UUID_H) +#include #endif #ifndef SHUT_RDWR From 12422431f90171f5a5017dfea199c99515916593 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 10 Mar 2006 22:55:49 +0000 Subject: [PATCH 5599/7878] Identify - one 2Xtransformed error result, several missing mutex sections and fix one last apr_file_flush result ignored (close the file, but return the failure to flush error.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@384941 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filestat.c | 1 + file_io/os2/open.c | 7 +++++-- file_io/os2/readwrite.c | 1 + file_io/os2/seek.c | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index e6410e254f7..259acfa1b02 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -94,6 +94,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want if (thefile->isopen) { if (thefile->buffered) { + /* XXX: flush here is not mutex protected */ apr_status_t rv = apr_file_flush(thefile); if (rv != APR_SUCCESS) { diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 4b1666bdc2d..ed2a11e75fe 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -121,16 +121,19 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) apr_status_t status; if (file && file->isopen) { - apr_file_flush(file); + /* XXX: flush here is not mutex protected */ + status = apr_file_flush(file); rc = DosClose(file->filedes); if (rc == 0) { file->isopen = FALSE; - status = APR_SUCCESS; if (file->flags & APR_DELONCLOSE) { status = APR_FROM_OS_ERROR(DosDelete(file->fname)); } + /* else we return the status of the flush attempt + * when all else succeeds + */ } else { return APR_FROM_OS_ERROR(rc); } diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index fde47589e05..d2b09bf60ff 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -150,6 +150,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a while (rc == 0 && size > 0) { if (thefile->bufpos == thefile->bufsize) // write buffer is full + /* XXX bug; - rc is double-transformed os->apr below */ rc = apr_file_flush(thefile); blocksize = size > thefile->bufsize - thefile->bufpos ? thefile->bufsize - thefile->bufpos : size; diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index 5918a7c7521..bb1e97573b0 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -27,6 +27,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) ULONG rc; if (thefile->direction == 1) { + /* XXX: flush here is not mutex protected */ apr_status_t rv = apr_file_flush(thefile); if (rv != APR_SUCCESS) { From 43978c3d34926e8746ebf54f9f323b9967f44d0c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 10 Mar 2006 22:56:26 +0000 Subject: [PATCH 5600/7878] Identify several mutex-unprotected flushes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@384942 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 1 + file_io/unix/open.c | 1 + file_io/unix/seek.c | 1 + 3 files changed, 3 insertions(+) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index b1a43101a73..93ecb608d86 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -107,6 +107,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, struct_stat info; if (thefile->buffered) { + /* XXX: flush here is not mutex protected */ apr_status_t rv = apr_file_flush(thefile); if (rv != APR_SUCCESS) return rv; diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 53ae256a220..7f550cd129c 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -32,6 +32,7 @@ apr_status_t apr_unix_file_cleanup(void *thefile) apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS; if (file->buffered) { + /* XXX: flush here is not mutex protected */ flush_rv = apr_file_flush(file); } if (close(file->filedes) == 0) { diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 568f4c11c44..73f8d25ab3e 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -22,6 +22,7 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) apr_status_t rv; if (thefile->direction == 1) { + /* XXX: flush here is not mutex protected */ rv = apr_file_flush(thefile); if (rv) { return rv; From 3044447460797258cb4e4d26ca2ab9f1117c72e1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 10 Mar 2006 22:56:57 +0000 Subject: [PATCH 5601/7878] Identify a mutex unprotected flush on netware git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@384943 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 1fb31d9ee13..010d3b3da80 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -84,6 +84,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, struct stat info; if (thefile->buffered) { + /* XXX: flush here is not mutex protected */ apr_status_t rv = apr_file_flush(thefile); if (rv != APR_SUCCESS) return rv; From 48a30505092955d80e9479b8b9209e396252d740 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 11 Mar 2006 22:25:18 +0000 Subject: [PATCH 5602/7878] fix compile break on systems like AIX 4.3.3 which have most multicast definitions but are missing IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP PR: 38922 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@385180 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/multicast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index 950cdf7a711..edbc2287085 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -163,7 +163,7 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock, rv = errno; } } -#if APR_HAVE_IPV6 +#if APR_HAVE_IPV6 && defined(IPV6_JOIN_GROUP) && defined(IPV6_LEAVE_GROUP) else if (sock_is_ipv6(sock)) { if (type == IP_ADD_MEMBERSHIP) { type = IPV6_JOIN_GROUP; From 8171fff5e404dc7ef6b9904f408c1ed5d939d20f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 13 Mar 2006 11:44:23 +0000 Subject: [PATCH 5603/7878] * locks/unix/proc_mutex.c (proc_mutex_no_tryacquire): Removed function. (proc_mutex_posix_tryacquire, proc_mutex_sysv_tryacquire, proc_mutex_proc_pthread_tryacquire, proc_mutex_fcntl_tryacquire, proc_mutex_flock_tryacquire): Added functions. PR: 38758 Submitted by: Chris Darroch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@385523 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ locks/unix/proc_mutex.c | 111 +++++++++++++++++++++++++++++++++++----- 2 files changed, 102 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index cc9236a9926..31c1a25d68a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Implement support for apr_proc_mutex_trylock() on Unix platforms. + PR 38785. [Chris Darroch ] + *) APR_FIND_APR macro now supports customisable detailed checks on each installed apr. [Justin Erenkrantz, Colm MacCarthaigh] diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index de9a5b04758..4ae4682d3db 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -24,11 +24,6 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return apr_pool_cleanup_run(mutex->pool, mutex, apr_proc_mutex_cleanup); } -static apr_status_t proc_mutex_no_tryacquire(apr_proc_mutex_t *new_mutex) -{ - return APR_ENOTIMPL; -} - #if APR_HAS_POSIXSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || \ APR_HAS_PROC_PTHREAD_SERIALIZE || APR_HAS_SYSVSEM_SERIALIZE static apr_status_t proc_mutex_no_child_init(apr_proc_mutex_t **mutex, @@ -125,6 +120,18 @@ static apr_status_t proc_mutex_posix_acquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } +static apr_status_t proc_mutex_posix_tryacquire(apr_proc_mutex_t *mutex) +{ + if (sem_trywait(mutex->psem_interproc) < 0) { + if (errno == EAGAIN) { + return APR_EBUSY; + } + return errno; + } + mutex->curr_locked = 1; + return APR_SUCCESS; +} + static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) { mutex->curr_locked = 0; @@ -145,7 +152,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_posixsem_methods = #endif proc_mutex_posix_create, proc_mutex_posix_acquire, - proc_mutex_no_tryacquire, + proc_mutex_posix_tryacquire, proc_mutex_posix_release, proc_mutex_posix_cleanup, proc_mutex_no_child_init, @@ -157,6 +164,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_posixsem_methods = #if APR_HAS_SYSVSEM_SERIALIZE static struct sembuf proc_mutex_op_on; +static struct sembuf proc_mutex_op_try; static struct sembuf proc_mutex_op_off; static void proc_mutex_sysv_setup(void) @@ -164,6 +172,9 @@ static void proc_mutex_sysv_setup(void) proc_mutex_op_on.sem_num = 0; proc_mutex_op_on.sem_op = -1; proc_mutex_op_on.sem_flg = SEM_UNDO; + proc_mutex_op_try.sem_num = 0; + proc_mutex_op_try.sem_op = -1; + proc_mutex_op_try.sem_flg = SEM_UNDO | IPC_NOWAIT; proc_mutex_op_off.sem_num = 0; proc_mutex_op_off.sem_op = 1; proc_mutex_op_off.sem_flg = SEM_UNDO; @@ -222,6 +233,23 @@ static apr_status_t proc_mutex_sysv_acquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } +static apr_status_t proc_mutex_sysv_tryacquire(apr_proc_mutex_t *mutex) +{ + int rc; + + do { + rc = semop(mutex->interproc->filedes, &proc_mutex_op_try, 1); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { + if (errno == EAGAIN) { + return APR_EBUSY; + } + return errno; + } + mutex->curr_locked = 1; + return APR_SUCCESS; +} + static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex) { int rc; @@ -245,7 +273,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = #endif proc_mutex_sysv_create, proc_mutex_sysv_acquire, - proc_mutex_no_tryacquire, + proc_mutex_sysv_tryacquire, proc_mutex_sysv_release, proc_mutex_sysv_cleanup, proc_mutex_no_child_init, @@ -379,7 +407,7 @@ static apr_status_t proc_mutex_proc_pthread_acquire(apr_proc_mutex_t *mutex) #ifdef PTHREAD_SETS_ERRNO rv = errno; #endif -#ifdef HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP +#ifdef HAVE_PTHREAD_MUTEX_ROBUST /* Okay, our owner died. Let's try to make it consistent again. */ if (rv == EOWNERDEAD) { pthread_mutex_consistent_np(mutex->pthread_interproc); @@ -394,7 +422,32 @@ static apr_status_t proc_mutex_proc_pthread_acquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -/* TODO: Add proc_mutex_proc_pthread_tryacquire(apr_proc_mutex_t *mutex) */ +static apr_status_t proc_mutex_proc_pthread_tryacquire(apr_proc_mutex_t *mutex) +{ + apr_status_t rv; + + if ((rv = pthread_mutex_trylock(mutex->pthread_interproc))) { +#ifdef PTHREAD_SETS_ERRNO + rv = errno; +#endif + if (rv == EBUSY) { + return APR_EBUSY; + } +#ifdef HAVE_PTHREAD_MUTEX_ROBUST + /* Okay, our owner died. Let's try to make it consistent again. */ + if (rv == EOWNERDEAD) { + pthread_mutex_consistent_np(mutex->pthread_interproc); + rv = APR_SUCCESS; + } + else + return rv; +#else + return rv; +#endif + } + mutex->curr_locked = 1; + return rv; +} static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex) { @@ -415,7 +468,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_methods = APR_PROCESS_LOCK_MECH_IS_GLOBAL, proc_mutex_proc_pthread_create, proc_mutex_proc_pthread_acquire, - proc_mutex_no_tryacquire, + proc_mutex_proc_pthread_tryacquire, proc_mutex_proc_pthread_release, proc_mutex_proc_pthread_cleanup, proc_mutex_no_child_init, @@ -505,6 +558,23 @@ static apr_status_t proc_mutex_fcntl_acquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } +static apr_status_t proc_mutex_fcntl_tryacquire(apr_proc_mutex_t *mutex) +{ + int rc; + + do { + rc = fcntl(mutex->interproc->filedes, F_SETLK, &proc_mutex_lock_it); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { + if (errno == EAGAIN) { + return APR_EBUSY; + } + return errno; + } + mutex->curr_locked = 1; + return APR_SUCCESS; +} + static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex) { int rc; @@ -528,7 +598,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_fcntl_methods = #endif proc_mutex_fcntl_create, proc_mutex_fcntl_acquire, - proc_mutex_no_tryacquire, + proc_mutex_fcntl_tryacquire, proc_mutex_fcntl_release, proc_mutex_fcntl_cleanup, proc_mutex_no_child_init, @@ -602,6 +672,23 @@ static apr_status_t proc_mutex_flock_acquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } +static apr_status_t proc_mutex_flock_tryacquire(apr_proc_mutex_t *mutex) +{ + int rc; + + do { + rc = flock(mutex->interproc->filedes, LOCK_EX | LOCK_NB); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { + if (errno == EWOULDBLOCK) { + return APR_EBUSY; + } + return errno; + } + mutex->curr_locked = 1; + return APR_SUCCESS; +} + static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *mutex) { int rc; @@ -649,7 +736,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_flock_methods = #endif proc_mutex_flock_create, proc_mutex_flock_acquire, - proc_mutex_no_tryacquire, + proc_mutex_flock_tryacquire, proc_mutex_flock_release, proc_mutex_flock_cleanup, proc_mutex_flock_child_init, From 3f84c4a07398998285d5ff82f17b4676d11dae06 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 13 Mar 2006 16:46:18 +0000 Subject: [PATCH 5604/7878] There are -so- many reasons this code -could- fail, and any of them will hang the remainder of the test. Better to simply fail them all, with an extra notice when the error is unusual. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@385594 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/testsock.c b/test/testsock.c index e1b4bfa3d58..d5a3e65a54b 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -258,16 +258,15 @@ static void test_get_addr(abts_case *tc, void *data) * succeed (if the connection can be established synchronously), * but if it does, this test cannot proceed. */ rv = apr_socket_connect(cd, sa); - if (rv == APR_SUCCESS) { + if (!APR_STATUS_IS_EINPROGRESS(rv)) { apr_socket_close(ld); apr_socket_close(cd); + APR_ASSERT_SUCCESS(tc, "connect to listener", rv); ABTS_NOT_IMPL(tc, "Cannot test if connect completes " "synchronously"); return; } - ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EINPROGRESS(rv)); - APR_ASSERT_SUCCESS(tc, "accept connection", apr_socket_accept(&sd, ld, p)); From b648840f50f77227e1d0d3742243b71e9750fef9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 13 Mar 2006 19:28:26 +0000 Subject: [PATCH 5605/7878] Similar to the patches for unix/netware/os - percolate the flush response code upwards to the caller, and note some mutex-unprotected flushes on win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@385626 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 1 + file_io/win32/open.c | 1 + file_io/win32/readwrite.c | 6 +++++- file_io/win32/seek.c | 6 +++++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 2d688fce76b..8419bb89f57 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -375,6 +375,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want BY_HANDLE_FILE_INFORMATION FileInfo; if (thefile->buffered) { + /* XXX: flush here is not mutex protected */ apr_status_t rv = apr_file_flush(thefile); if (rv != APR_SUCCESS) return rv; diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 56b73b51e20..fa4e1da6d4f 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -242,6 +242,7 @@ apr_status_t file_cleanup(void *thefile) } if (file->buffered) { + /* XXX: flush here is not mutex protected */ flush_rv = apr_file_flush((apr_file_t *)thefile); } CloseHandle(file->filehand); diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 66a4580b55d..8ee34ea4517 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -174,7 +174,11 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size apr_thread_mutex_lock(thefile->mutex); if (thefile->direction == 1) { - apr_file_flush(thefile); + rv = apr_file_flush(thefile); + if (rv != APR_SUCCESS) { + apr_thread_mutex_unlock(thefile->mutex); + return rv; + } thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 03cee4ed1d6..9313c29bcb9 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -22,10 +22,14 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) { apr_size_t newbufpos; + apr_status_t rv; DWORD rc; if (thefile->direction == 1) { - apr_file_flush(thefile); + /* XXX: flush here is not mutex protected */ + rv = apr_file_flush(thefile); + if (rv != APR_SUCCESS) + return rv; thefile->bufpos = thefile->dataRead = 0; thefile->direction = 0; } From 953a637c0900d6b263a63526693f4a079e413aa4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 13 Mar 2006 19:36:55 +0000 Subject: [PATCH 5606/7878] Distinguish rc from rv (DWORD v.s. apr_status_t) - a 64bit-ism. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@385631 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/seek.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 9313c29bcb9..9148181a421 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -42,24 +42,23 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) if (newbufpos >= 0 && newbufpos <= thefile->dataRead) { thefile->bufpos = (apr_size_t)newbufpos; - rc = 0; + rv = APR_SUCCESS; } else { DWORD offlo = (DWORD)pos; DWORD offhi = (DWORD)(pos >> 32); rc = SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); if (rc == 0xFFFFFFFF) - rc = apr_get_os_error(); - else - rc = APR_SUCCESS; - if (rc == APR_SUCCESS) { + rv = apr_get_os_error(); + else { + rv = APR_SUCCESS; thefile->eof_hit = 0; thefile->bufpos = thefile->dataRead = 0; thefile->filePtr = pos; } } - return rc; + return rv; } From 75e16a89b71099f292db2404c170d2983b41e0b2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 13 Mar 2006 19:58:22 +0000 Subject: [PATCH 5607/7878] Refactor the win32 apr_file_gets logic to close a newly uncovered bug following the fix to the flush logic. Man this code is suboptimal... Forward-port 385640 [whoops, ment to apply this in opposite order] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@385641 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 8ee34ea4517..d9d432a1a07 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -440,8 +440,13 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) readlen = 1; rv = apr_file_read(thefile, str+i, &readlen); - if (readlen != 1) { - rv = APR_EOF; + if (rv != APR_SUCCESS && rv != APR_EOF) + return rv; + + if (readlen == 0) { + /* If we have bytes, defer APR_EOF to the next call */ + if (i > 0) + rv = APR_SUCCESS; break; } @@ -451,12 +456,6 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) } } str[i] = 0; - if (i > 0) { - /* we stored chars; don't report EOF or any other errors; - * the app will find out about that on the next call - */ - return APR_SUCCESS; - } return rv; } From 2cc9bd16934f02d8a08e51880592a1841cb1673a Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Wed, 15 Mar 2006 19:59:51 +0000 Subject: [PATCH 5608/7878] Fix a longstanding missunderstanding in our kqueue pollset code. It turns out that the kqueue filter types are not bitfields, so checking for them via & EVFILT_READ or & EVFILT_WRITE is inappropriate. Test Fixes By: Joe Orton * poll/unix/kqueue.c (get_kqueue_revent): Use == instead of & when testing for filter types. * test/testpoll.c (multi_event_pollset): Handle the fact that we can sometimes get multiple events for a single socket. * CHANGES: Note fix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@386154 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ poll/unix/kqueue.c | 4 ++-- test/testpoll.c | 23 +++++++++++++++++++---- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 31c1a25d68a..f20aa6ccd85 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes for APR 1.3.0 + *) Correct bug in kqueue backend for apr_pollset where we would + erroneously indicate that a socket was readable or writeable. + [Garrett Rooney] + *) Implement support for apr_proc_mutex_trylock() on Unix platforms. PR 38785. [Chris Darroch ] diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index b2beb571a84..a3a00f54172 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -22,9 +22,9 @@ static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags) { apr_int16_t rv = 0; - if (event & EVFILT_READ) + if (event == EVFILT_READ) rv |= APR_POLLIN; - if (event & EVFILT_WRITE) + if (event == EVFILT_WRITE) rv |= APR_POLLOUT; if (flags & EV_EOF) rv |= APR_POLLHUP; diff --git a/test/testpoll.c b/test/testpoll.c index 351dcce78e5..3e166470c0c 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -309,10 +309,25 @@ static void multi_event_pollset(abts_case *tc, void *data) rv = apr_pollset_poll(pollset, 0, &lrv, &descs); ABTS_INT_EQUAL(tc, 0, APR_STATUS_IS_TIMEUP(rv)); - ABTS_INT_EQUAL(tc, 1, lrv); - ABTS_PTR_EQUAL(tc, s[0], descs[0].desc.s); - ABTS_INT_EQUAL(tc, APR_POLLIN | APR_POLLOUT, descs[0].rtnevents); - ABTS_PTR_EQUAL(tc, s[0], descs[0].client_data); + if (lrv == 1) { + ABTS_PTR_EQUAL(tc, s[0], descs[0].desc.s); + ABTS_INT_EQUAL(tc, APR_POLLIN | APR_POLLOUT, descs[0].rtnevents); + ABTS_PTR_EQUAL(tc, s[0], descs[0].client_data); + } + else if (lrv == 2) { + ABTS_PTR_EQUAL(tc, s[0], descs[0].desc.s); + ABTS_PTR_EQUAL(tc, s[0], descs[0].client_data); + ABTS_PTR_EQUAL(tc, s[0], descs[1].desc.s); + ABTS_PTR_EQUAL(tc, s[0], descs[1].client_data); + ABTS_ASSERT(tc, "returned events incorrect", + ((descs[0].rtnevents | descs[1].rtnevents) + == (APR_POLLIN | APR_POLLOUT)) + && descs[0].rtnevents != descs[1].rtnevents); + } + else { + ABTS_ASSERT(tc, "either one or two events returned", + lrv == 1 || lrv == 2); + } recv_msg(s, 0, p, tc); From 394c066072ce4b70d9b5bcb6d938f6bcd4001908 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Wed, 15 Mar 2006 22:54:59 +0000 Subject: [PATCH 5609/7878] * build/apr_hints.m4: Reenable kqueue on current versions of Mac OS X, as it seems to work now that we've fixed the bug in our kqueue code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@386202 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index eef922ea9f9..0ec8748a8dc 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -187,11 +187,21 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DRHAPSODY]) ;; *-apple-darwin*) + if test -x /usr/sbin/sysctl; then + os_version=`/usr/sbin/sysctl -n kern.osrelease | sed 's/\.//g'` + else + os_version=000 + fi + APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp]) APR_SETIFNULL(apr_posixsem_is_global, [yes]) APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332 - # Broken in 10.4.x - APR_SETIFNULL(ac_cv_func_kqueue, [no]) + + # kqueue has been confirmed to work in OS X 10.4.5, its status in + # earlier OS X releases is not currently known, so it is disabled. + if test $os_version -lt "850"; then + APR_SETIFNULL(ac_cv_func_kqueue, [no]) + fi ;; *-dec-osf*) APR_ADDTO(CPPFLAGS, [-DOSF1]) From 7ee22465ef3412a0b5b786451a00b4a760ec5fcd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 18 Mar 2006 01:22:36 +0000 Subject: [PATCH 5610/7878] Close a kernel layer segfault when the user attempts to lock a critical section after DeleteCriticalSection() has been invoked. There is no protection in the lock/unlock kernel code, so ensure we don't enter the critical section path at all with deleted mutex, and fail instead by attempting to wait on a bad handle, resulting in a less drastic failure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@386780 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/thread_mutex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 0a848fbcf5b..20c757f96e4 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -28,6 +28,7 @@ static apr_status_t thread_mutex_cleanup(void *data) apr_thread_mutex_t *lock = data; if (lock->type == thread_mutex_critical_section) { + lock->type = -1; DeleteCriticalSection(&lock->section); } else { @@ -60,8 +61,8 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, * use a [slower] mutex object, instead. */ IF_WIN_OS_IS_UNICODE { - (*mutex)->type = thread_mutex_critical_section; InitializeCriticalSection(&(*mutex)->section); + (*mutex)->type = thread_mutex_critical_section; } #endif #if APR_HAS_ANSI_FS From 806aa583eb3a79ada4b598add42650d6a2859e21 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Tue, 21 Mar 2006 19:15:54 +0000 Subject: [PATCH 5611/7878] Mac OS X, why do you hate kqueue so much? * build/apr_hints.m4: Disable kqueue again, it's causing problems with the socket tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@387603 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 0ec8748a8dc..5f313f53c80 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -187,21 +187,14 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DRHAPSODY]) ;; *-apple-darwin*) - if test -x /usr/sbin/sysctl; then - os_version=`/usr/sbin/sysctl -n kern.osrelease | sed 's/\.//g'` - else - os_version=000 - fi - APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp]) APR_SETIFNULL(apr_posixsem_is_global, [yes]) APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332 - # kqueue has been confirmed to work in OS X 10.4.5, its status in - # earlier OS X releases is not currently known, so it is disabled. - if test $os_version -lt "850"; then - APR_SETIFNULL(ac_cv_func_kqueue, [no]) - fi + # kqueue is broken on OS X, the poll tests work, but the socket tests + # hang when it's turned on. if you decide to reenable this please be + # sure to test that ALL the tests continue to work with it turned on. + APR_SETIFNULL(ac_cv_func_kqueue, [no]) ;; *-dec-osf*) APR_ADDTO(CPPFLAGS, [-DOSF1]) From 1bbb9e8d46a3ebd8d3e3e9143105037b6cdcad2a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 22 Mar 2006 07:09:36 +0000 Subject: [PATCH 5612/7878] A few more useful things to avoid cr/lf'ing git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@387769 13f79535-47bb-0310-9956-ffa450edef68 --- build/lineends.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/lineends.pl b/build/lineends.pl index f91a9d30c58..9b723f418d3 100644 --- a/build/lineends.pl +++ b/build/lineends.pl @@ -23,7 +23,7 @@ $ignore .= "gif-jpg-jpeg-png-ico-bmp-"; # Archive formats -$ignore .= "tar-gz-z-zip-jar-war-"; +$ignore .= "tar-gz-z-zip-jar-war-bz2-tgz-"; # Many document formats $ignore .= "eps-psd-pdf-ai-"; @@ -32,9 +32,9 @@ $ignore .= "ucs2-ucs4-"; # Some binary objects -$ignore .= "class-so-dll-exe-obj-"; +$ignore .= "class-so-dll-exe-obj-a-o-lo-slo-sl-dylib-"; -# Some build env files in NW/Win32 +# Some build env files $ignore .= "mcp-xdc-ncb-opt-pdb-ilk-sbr-"; $preservedate = 1; From 486e10a1af7eb184ba7534df067e9b6e0f81ef55 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 22 Mar 2006 07:29:46 +0000 Subject: [PATCH 5613/7878] Note one of interest to several reporters. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@387777 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index f20aa6ccd85..ce769832a81 100644 --- a/CHANGES +++ b/CHANGES @@ -61,6 +61,12 @@ Changes for APR 1.3.0 Changes for APR 1.2.4 + *) Fully test the detected libuuid or libc based uuid_create or + uuid_generate function against the detected uuid.h, uuid/uuid.h, + or sys/uuid.h (using only the first-found .h examined in that order) + for correct compilation. Resolves various apr_os_uuid issues on + multiple environments. [William Rowe] + *) Make the filePtr in apr_file_t an apr_off_t on Unix, to avoid issues truncating offsets down to 32 bits on large file systems. [Garrett Rooney] From 7bbaeb28e3958b28c1528fc08fa0de941fff8fc8 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Wed, 22 Mar 2006 21:22:49 +0000 Subject: [PATCH 5614/7878] * test/testsockets.c (sendto_receivefrom): Bail out if apr_socket_bind fails, as has been known to happen on solaris if you turn on ipv6. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@387950 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsockets.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/testsockets.c b/test/testsockets.c index 3b867a3b802..7c03283f49a 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -146,8 +146,13 @@ static void sendto_receivefrom(abts_case *tc, void *data) rv = apr_socket_bind(sock, to); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + if (rv != APR_SUCCESS) + return; + rv = apr_socket_bind(sock2, from); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + if (rv != APR_SUCCESS) + return; len = STRLEN; rv = apr_socket_sendto(sock2, to, 0, sendbuf, &len); From 1dc4bab96aebd7ba03aa72dca4f009960407eb5d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 23 Mar 2006 19:36:25 +0000 Subject: [PATCH 5615/7878] The original value before seek() certainly could be at the upper bounds of 2^32-1. Protect against this by trusting the error result. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@388241 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/seek.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 9148181a421..e4e3608d69c 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -48,9 +48,16 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) DWORD offhi = (DWORD)(pos >> 32); rc = SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); - if (rc == 0xFFFFFFFF) + if (rc == INVALID_SET_FILE_POINTER) + /* A legal value, perhaps? MSDN implies prior SetLastError isn't + * needed, googling for SetLastError SetFilePointer seems + * to confirm this. + */ rv = apr_get_os_error(); - else { + else + rv = APR_SUCCESS; + + if (rv == APR_SUCCESS) { rv = APR_SUCCESS; thefile->eof_hit = 0; thefile->bufpos = thefile->dataRead = 0; From 8abb19b349116cf6be18ec4cf7d8eced25bcb91c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 23 Mar 2006 21:49:49 +0000 Subject: [PATCH 5616/7878] Part 1 of many read_with_timeout logic fixes. Stop polluting one occurance of rv with the boolean result of ReadFile() to increase the legibility of the success/failure of ReadFile. This requires us to defer *nbytes assignment to the function's end. This fix catches additional cases of APR_EOF, as we had not tested this case from the error handling path. So any deferred read of zero bytes previously returned 0 bytes APR_SUCCESS rather than APR_EOF. (This occurs when we wait to discover the owner of the write end closes it without additional data) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@388281 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index d9d432a1a07..bdcc321640d 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -72,11 +72,11 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le file->pOverlapped->OffsetHigh = (DWORD)(file->filePtr >> 32); } - rv = ReadFile(file->filehand, buf, len, - &bytesread, file->pOverlapped); - *nbytes = bytesread; - - if (!rv) { + if (ReadFile(file->filehand, buf, len, + &bytesread, file->pOverlapped)) { + rv = APR_SUCCESS; + } + else { rv = apr_get_os_error(); if (rv == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) { /* Wait for the pending i/o */ @@ -117,16 +117,16 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le /* Assume ERROR_BROKEN_PIPE signals an EOF reading from a pipe */ rv = APR_EOF; } - } else { - /* OK and 0 bytes read ==> end of file */ - if (*nbytes == 0) - rv = APR_EOF; - else - rv = APR_SUCCESS; + } + + /* OK and 0 bytes read ==> end of file */ + if (rv == APR_SUCCESS && bytesread == 0) + rv = APR_EOF; } if (rv == APR_SUCCESS && file->pOverlapped && !file->pipe) { - file->filePtr += *nbytes; + file->filePtr += bytesread; } + *nbytes = bytesread; return rv; } From ce3b94c6e2668c4e8c2d3f3044b412bd3ad0881d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 23 Mar 2006 21:51:11 +0000 Subject: [PATCH 5617/7878] Part 2 of the necessary read_with_timeout() fixes. Catch the condition where our broken pipe occurs durring the deferred i/o completion phase. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@388282 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index bdcc321640d..7b355352921 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -113,7 +113,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le } } } - else if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) { + if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) { /* Assume ERROR_BROKEN_PIPE signals an EOF reading from a pipe */ rv = APR_EOF; } From 0c097024cd1a4e7f75a7d140f6ae0409151d7a1b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 23 Mar 2006 22:44:16 +0000 Subject: [PATCH 5618/7878] Minor typo fix to previous commit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@388285 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 7b355352921..54080b307d1 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -122,7 +122,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le /* OK and 0 bytes read ==> end of file */ if (rv == APR_SUCCESS && bytesread == 0) rv = APR_EOF; - } + if (rv == APR_SUCCESS && file->pOverlapped && !file->pipe) { file->filePtr += bytesread; } From 9603971ab2250d4756029c3ceabb34e328b793f6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 23 Mar 2006 22:47:12 +0000 Subject: [PATCH 5619/7878] Fix with additional notes for older PSDK winbase.h headers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@388287 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/seek.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index e4e3608d69c..dc25037c694 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -48,10 +48,11 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) DWORD offhi = (DWORD)(pos >> 32); rc = SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); - if (rc == INVALID_SET_FILE_POINTER) - /* A legal value, perhaps? MSDN implies prior SetLastError isn't + if (rc == (DWORD)-1) + /* A legal value, perhaps? MSDN implies prior SetLastError isn't * needed, googling for SetLastError SetFilePointer seems - * to confirm this. + * to confirm this. INVALID_SET_FILE_POINTER is too recently + * added for us to rely on it as a constant. */ rv = apr_get_os_error(); else From a19aa8edd79ffc6b9775a34a709b4d4dbe0307d6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 23 Mar 2006 23:19:32 +0000 Subject: [PATCH 5620/7878] Part three of the read_with_timeout refactoring. Loop on the WaitForSingleObject if it indicated WAIT_ABANDONED, which occurs when the thread/proc which created the event exits, and ownership of the event has been transfered. Always try to CancelIo if the wait has failed. Ignore the Wait/Cancel results and then always check the completion status of the original Read. Indicate TIMEUP when appropriate. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@388292 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 64 +++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 54080b307d1..ea85aae4b17 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -31,6 +31,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t len_in, apr_size_t *nbytes) { apr_status_t rv; + DWORD res; DWORD len = (DWORD)len_in; DWORD bytesread = 0; @@ -79,38 +80,43 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le else { rv = apr_get_os_error(); if (rv == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) { - /* Wait for the pending i/o */ - if (file->timeout > 0) { - /* timeout in milliseconds... */ - rv = WaitForSingleObject(file->pOverlapped->hEvent, - (DWORD)(file->timeout/1000)); - } - else if (file->timeout == -1) { - rv = WaitForSingleObject(file->pOverlapped->hEvent, INFINITE); + /* Wait for the pending i/o, timeout converted from us to ms + * Note that we loop if someone gives up the event, since + * folks suggest that WAIT_ABANDONED isn't actually a result + * but an alert that ownership of the event has passed from + * one owner to a new proc/thread. + */ + do { + res = WaitForSingleObject(file->pOverlapped->hEvent, + (file->timeout > 0) + ? (DWORD)(file->timeout/1000) + : ((file->timeout == -1) + ? INFINITE : 0)); + } while (res == WAIT_ABANDONED); + + /* There is one case that represents entirely + * successful operations, otherwise we will cancel + * the operation in progress. + */ + if (res != WAIT_OBJECT_0) { + CancelIo(file->filehand); } - switch (rv) { - case WAIT_OBJECT_0: - GetOverlappedResult(file->filehand, file->pOverlapped, - &bytesread, TRUE); - rv = APR_SUCCESS; - break; - - case WAIT_TIMEOUT: - rv = APR_TIMEUP; - break; - - case WAIT_FAILED: - rv = apr_get_os_error(); - break; - default: - break; + /* Ignore any failures above. Attempt to complete + * the overlapped operation and use only _its_ result. + * For example, CancelIo or WaitForSingleObject can + * fail if the handle is closed, yet the read may have + * completed before we attempted to CancelIo... + */ + if (GetOverlappedResult(file->filehand, file->pOverlapped, + &bytesread, TRUE)) { + rv = APR_SUCCESS; } - - if (rv != APR_SUCCESS) { - if (apr_os_level >= APR_WIN_98) { - CancelIo(file->filehand); - } + else { + rv = apr_get_os_error(); + if (rv == APR_FROM_OS_ERROR(ERROR_IO_INCOMPLETE) + && res == WAIT_TIMEOUT) + rv = APR_TIMEUP; } } if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) { From c00455033ed319ea120d942446903e9c9b54ce8f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 31 Mar 2006 12:41:38 +0000 Subject: [PATCH 5621/7878] * user/unix/userinfo.c (PWBUF_SIZE): Bump to 2048 to avoid issues with LDAP-backed lookups on FreeBSD. PR: 39075 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@390410 13f79535-47bb-0310-9956-ffa450edef68 --- user/unix/userinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 3eb74113be3..815bf7e50b8 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -30,7 +30,7 @@ #define APR_WANT_MEMFUNC #include "apr_want.h" -#define PWBUF_SIZE 512 +#define PWBUF_SIZE 2048 static apr_status_t getpwnam_safe(const char *username, struct passwd *pw, From a59caad9930dc396543d7a712367725555574820 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 5 Apr 2006 10:41:46 +0000 Subject: [PATCH 5622/7878] * network_io/unix/sendrecv.c (apr_socket_sendv): Implement for !HAVE_WRITEV build. PR: 38822 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@391579 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 3aba5021539..7017ec3245b 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -180,10 +180,10 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, return APR_SUCCESS; } -#ifdef HAVE_WRITEV apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len) { +#ifdef HAVE_WRITEV apr_ssize_t rv; apr_size_t requested_len = 0; apr_int32_t i; @@ -225,8 +225,11 @@ apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, } (*len) = rv; return APR_SUCCESS; -} +#else + *len = vec[0].iov_len; + return apr_socket_send(sock, vec[0].iov_base, len); #endif +} #if APR_HAS_SENDFILE From 509aa5ed128eb3fb2eb49ab44038c138e4a96d11 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 5 Apr 2006 10:54:26 +0000 Subject: [PATCH 5623/7878] * threadproc/unix/signals.c (apr_signal, avoid_zombies): Use the Darwin zombie-avoidance hack on NetBSD too. PR: 36750 Submitted by: Todd Vierling git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@391580 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ threadproc/unix/signals.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index ce769832a81..565b27099b2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) NetBSD: Avoid leaving zombie process when using apr_signal() + to ignore SIGCHLD. PR 36750. [Todd Vierling ] + *) Correct bug in kqueue backend for apr_pollset where we would erroneously indicate that a socket was readable or writeable. [Garrett Rooney] diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index e2f0fe0f159..920d8aab4d0 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -55,7 +55,7 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signum) #if APR_HAVE_SIGACTION -#ifdef DARWIN +#if defined(__NetBSD__) || defined(DARWIN) static void avoid_zombies(int signo) { int exit_status; @@ -91,7 +91,7 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func) act.sa_flags |= SA_NOCLDWAIT; } #endif -#ifdef DARWIN +#if defined(__NetBSD__) || defined(DARWIN) /* ignoring SIGCHLD or leaving the default disposition doesn't avoid zombies, * and there is no SA_NOCLDWAIT flag, so catch the signal and reap status in * the handler to avoid zombies From 290d1d286299036ad136e7fafc4f22f7711ea160 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 5 Apr 2006 11:05:51 +0000 Subject: [PATCH 5624/7878] The config.status issue was fixed recently; move a proposed API change from bugzilla to STATUS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@391582 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/STATUS b/STATUS index 8da3b24d2a1..a705a0ddc47 100644 --- a/STATUS +++ b/STATUS @@ -203,24 +203,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Status: Greg +1 (volunteers) - * configure.in does post-processing on the AC_OUTPUT files (for - VPATH support). This means that config.status doesn't do the - right thing when you re-run it. We ought to revamp the makefiles - to do the right AC_SUBST stuff rather than depend upon rewriting. - - Sascha: As the rewriter is a crude hack, I would not worry too - much about it. It is designed to go away once we have - a proper build system in place. - - One of the perceived deficiencies of automake is that it - uses AC_SUBST too often, thereby slowing down the task of - generating Makefiles significantly, because it applies - dozens of substitutions to each Makefile. And why? Make's - built-in macro processing is much more powerful, and - combined with the include facility, generating Makefiles - becomes simpler and faster. - Justin says: "I think this got fixed with Roy's build changes." - * use os_(un)cork in network_io/unix/sendrecv.c for FreeBSD's sendfile implementation. @@ -421,6 +403,20 @@ API Changes Postponed for APR 2.0: apr_time_interval_t from apr_interval_time_t apr_time_interval_short_t from apr_short_interval_time_t + * wrowe writes: + Looking at bug 32520, it occurs to me that exploding times using the + apr_time_exp_* functions; it would make more sense to split ->tm_usec into + + ->tm_msec thousandths (milleseconds) + ->tm_usec millionths (microseconds) + + for most display purposes. It's trivial to roll them together with the + format string %03d%03d if that's what's desired, or display simply + %02d.%03d if millisecond resolution is desired. It would also shrink + the fields to int's so unpacking would be slightly slower, using them + would be slightly faster, for what's likely to be little impact on + performance. + Stuff for post 1.0: * Almost every API in APR depends on pools, but pool semantics From 54db2d18d55268828ddf7417920e4178b7db1ff1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 5 Apr 2006 11:58:27 +0000 Subject: [PATCH 5625/7878] Docstring fix. * include/apr_file_io.h (apr_file_open, apr_file_pipe_create): Clarify the default inheritance rules. Submitted by: Peter N. Lundblad git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@391595 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 0c4a0bfdb8a..72c9e9bf000 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -213,6 +213,9 @@ typedef struct apr_file_t apr_file_t; * @param pool The pool to use. * @remark If perm is APR_OS_DEFAULT and the file is being created, * appropriate default permissions will be used. + * @remark By default, the returned file descriptor will not be + * inherited by child processes created by apr_proc_create(). This + * can be changed using apr_file_inherit_set(). */ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **newf, const char *fname, apr_int32_t flag, apr_fileperms_t perm, @@ -618,6 +621,9 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, * @param in The file descriptor to use as input to the pipe. * @param out The file descriptor to use as output from the pipe. * @param pool The pool to operate on. + * @remark By default, the returned file descriptors will be inherited + * by child processes created using apr_proc_create(). This can be + * changed using apr_file_inherit_unset(). */ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, From 8959ee76ead7a4bb7f393ef658a25a0d6aa91ddf Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Wed, 5 Apr 2006 18:26:31 +0000 Subject: [PATCH 5626/7878] Zero out the epoll_event structure, to make valgrind stop complaining about an unitialized read. Noticed by: Davi Arnaut git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@391696 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 8f921776cde..468b23ac7db 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -140,7 +140,7 @@ APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { - struct epoll_event ev; + struct epoll_event ev = {0}; int ret = -1; pfd_elem_t *elem = NULL; apr_status_t rv = APR_SUCCESS; From 1ba1df05169cce51a387553940789518c73288f3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 8 Apr 2006 21:05:27 +0000 Subject: [PATCH 5627/7878] jorton claims this is an exported function, although that's not necessary to set the initial hash function. _NONSTD is required to stick with the STDC calling convention for binary compatibility within apr and for external apps. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@392605 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 3 ++- tables/apr_hash.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index 37f307c9fc8..bfbd5997d49 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -67,7 +67,8 @@ typedef unsigned int (*apr_hashfunc_t)(const char *key, apr_ssize_t *klen); /** * The default hash function. */ -unsigned int apr_hashfunc_default(const char *key, apr_ssize_t *klen); +APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *key, + apr_ssize_t *klen); /** * Create a hash table. diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 574d4161a94..e852fead866 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -178,7 +178,8 @@ static void expand_array(apr_hash_t *ht) ht->max = new_max; } -unsigned int apr_hashfunc_default(const char *char_key, apr_ssize_t *klen) +APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, + apr_ssize_t *klen) { unsigned int hash = 0; const unsigned char *key = (const unsigned char *)char_key; From 76c581f2a4f8ca3a3a443d27fd638b766bde1991 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 9 Apr 2006 01:33:17 +0000 Subject: [PATCH 5628/7878] Implement apr_os_pipe_put and apr_os_pipe_put_ex on Win32, and provide a stub for apr_file_namedpipe_create, which can't be implemented as originally specced. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@392653 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 5f00940af5b..afa3341fdae 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -180,3 +180,51 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, return APR_SUCCESS; #endif /* _WIN32_WCE */ } + + +APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, + apr_fileperms_t perm, + apr_pool_t *pool) +{ + /* Not yet implemented, interface not suitable. + * Win32 requires the named pipe to be *opened* at the time it's + * created, and to do so, blocking or non blocking must be elected. + */ + return APR_ENOTIMPL; +} + + +/* XXX: Problem; we need to choose between blocking and nonblocking based + * on how *thefile was opened, and we don't have that information :-/ + * Hack; assume a blocking socket, since the most common use for the fn + * would be to handle stdio-style or blocking pipes. Win32 doesn't have + * select() blocking for pipes anyways :( + */ +APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, + apr_os_file_t *thefile, + int register_cleanup, + apr_pool_t *pool) +{ + (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file)->pool = pool; + (*file)->pipe = 1; + (*file)->timeout = -1; + (*file)->ungetchar = -1; + (*file)->filehand = *thefile; + (void) apr_pollset_create(&(*file)->pollset, 1, p, 0); + + if (register_cleanup) { + apr_pool_cleanup_register(pool, *file, apr_file_cleanup, + apr_pool_cleanup_null); + } + + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, + apr_os_file_t *thefile, + apr_pool_t *pool) +{ + return apr_os_pipe_put_ex(file, thefile, 0, pool); +} From 3e1b11306bd0887a5b6fde69dca3f9bd59d54677 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 9 Apr 2006 02:52:15 +0000 Subject: [PATCH 5629/7878] Fix cut-n-paste mismatches in adding these fn's - compiles clean on win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@392669 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index afa3341fdae..1e940f20e83 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -211,10 +211,10 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, (*file)->timeout = -1; (*file)->ungetchar = -1; (*file)->filehand = *thefile; - (void) apr_pollset_create(&(*file)->pollset, 1, p, 0); + (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); if (register_cleanup) { - apr_pool_cleanup_register(pool, *file, apr_file_cleanup, + apr_pool_cleanup_register(pool, *file, file_cleanup, apr_pool_cleanup_null); } From d17a687f98a5d0a74cd0b894ae104e126a7f7575 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 10 Apr 2006 01:22:00 +0000 Subject: [PATCH 5630/7878] Identified by Michael Jerris - work around projects where this was defined by the user in *their* build that included apr.h[w]. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@392864 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr.hw b/include/apr.hw index 0fd7bc99f44..9131521ca68 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -60,7 +60,9 @@ * and the POSIX string handling API */ #if defined(_MSC_VER) && _MSC_VER >= 1400 +#ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE +#endif #pragma warning(disable: 4996) #endif From 3b941139ac44c5e19c73a02f84c5a7f258c889f6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 10 Apr 2006 01:58:17 +0000 Subject: [PATCH 5631/7878] Eliminate second occurance, and move the disable of warning 4996 to the pop which reapplied it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@392874 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 7 ------- 1 file changed, 7 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 9131521ca68..b27b5e2bba9 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -514,13 +514,6 @@ struct iovec { */ #if defined(_MSC_VER) && _MSC_VER >= 1200 #pragma warning(pop) -#endif - -/* Ignore Microsoft's interpretation of secure development - * and their opinion of the POSIX standard string handling API - */ -#if defined(_MSC_VER) && _MSC_VER >= 1400 -#define _CRT_SECURE_NO_DEPRECATE #pragma warning(disable: 4996) #endif From 5f7ac652b2ca8f384d5eb934c05cdf39218e7235 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 10 Apr 2006 10:42:34 +0000 Subject: [PATCH 5632/7878] Synch with 1.2.x branch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@392915 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index 565b27099b2..bd5255e63f6 100644 --- a/CHANGES +++ b/CHANGES @@ -3,10 +3,6 @@ Changes for APR 1.3.0 *) NetBSD: Avoid leaving zombie process when using apr_signal() to ignore SIGCHLD. PR 36750. [Todd Vierling ] - *) Correct bug in kqueue backend for apr_pollset where we would - erroneously indicate that a socket was readable or writeable. - [Garrett Rooney] - *) Implement support for apr_proc_mutex_trylock() on Unix platforms. PR 38785. [Chris Darroch ] @@ -16,10 +12,6 @@ Changes for APR 1.3.0 *) APR_FIND_APR macro no longer checks /usr/local/apache2/ [Colm MacCarthaigh] - *) Only include uuid/uuid.h if we haven't already included uuid.h, since - doing so can result in type conflicts. - [Craig Rodrigues ] - *) Add APR_POLLSET_NOCOPY option to apr_pollset API to eliminate O(n)-time lookup in apr_pollset_remove() (currently implemented only for epoll). [Brian Pane] @@ -62,7 +54,17 @@ Changes for APR 1.3.0 *) Add APR_ARRAY_IDX() and APR_ARRAY_PUSH() convenience macros to apr_tables.h. [Garrett Rooney] -Changes for APR 1.2.4 +Changes for APR 1.2.7 + + *) Netware - add missing apu_version.c parsing for apu_version_string() + to the Netware specific builds. Unix platforms support this API + since 0.9.1. [Brad Nicholes] + + *) Fix a regression in the updated win32 apr_file_read with timeouts + since 1.2.6 which would fail to return the bytes read in specific + edge cases. [William Rowe] + +Changes for APR 1.2.6 *) Fully test the detected libuuid or libc based uuid_create or uuid_generate function against the detected uuid.h, uuid/uuid.h, @@ -70,6 +72,13 @@ Changes for APR 1.2.4 for correct compilation. Resolves various apr_os_uuid issues on multiple environments. [William Rowe] + *) Prevent detection of robust mutex support with glibc 2.4, + fixing APR_LOCK_PROC_PTHREAD locks. PR 38442. [Joe Orton] + + *) Correct bug in kqueue backend for apr_pollset where we would + erroneously indicate that a socket was readable or writeable. + [Garrett Rooney] + *) Make the filePtr in apr_file_t an apr_off_t on Unix, to avoid issues truncating offsets down to 32 bits on large file systems. [Garrett Rooney] From d0aaf2fdefa6ad84d9bfa57bbaab629cbca16e08 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Apr 2006 23:11:00 +0000 Subject: [PATCH 5633/7878] This is a VOS_APP not a VOS_EXE git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@395427 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.rc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libapr.rc b/libapr.rc index 8dc3cedfa90..925868d1e51 100644 --- a/libapr.rc +++ b/libapr.rc @@ -23,13 +23,25 @@ FILEVERSION APR_VERSION_STRING_CSV,0 PRODUCTVERSION APR_VERSION_STRING_CSV,0 FILEFLAGSMASK 0x3fL +#if defined(APR_IS_DEV_VERSION) +#if defined(_DEBUG) + FILEFLAGS 0x03L +#else + FILEFLAGS 0x02L +#endif +#else #if defined(_DEBUG) FILEFLAGS 0x01L #else FILEFLAGS 0x00L #endif +#endif +#if defined(WINNT) || defined(WIN64) FILEOS 0x40004L - FILETYPE 0x1L +#else + FILEOS 0x4L +#endif + FILETYPE 0x2L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" From c22a5da5911a2a9d68993d8f2731e1f17d6bd42f Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Wed, 19 Apr 2006 23:30:52 +0000 Subject: [PATCH 5634/7878] Documentation Clarification Submitted by: Andreas Fester afester _at_ apache.org git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@395439 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 126c4c12ff4..383d963ff3c 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -276,7 +276,7 @@ struct apr_hdtr_t { * @param family The address family of the socket (e.g., APR_INET). * @param type The type of the socket (e.g., SOCK_STREAM). * @param protocol The protocol of the socket (e.g., APR_PROTO_TCP). - * @param cont The pool to use + * @param cont The pool for the apr_socket_t and associated storage. */ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, int family, int type, From fe635b3aea334a55aec0e24ab7dfc9d664c1e56e Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Wed, 19 Apr 2006 23:51:17 +0000 Subject: [PATCH 5635/7878] doxygen fixes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@395443 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 1 + include/apr_tables.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 87869b80e68..3bf45f5235b 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -389,6 +389,7 @@ typedef @socklen_t_value@ apr_socklen_t; #error no decision has been made on APR_PATH_MAX for your platform #endif +/** @} */ /** @} */ #ifdef __cplusplus diff --git a/include/apr_tables.h b/include/apr_tables.h index 4636daf731d..6078c5d8c87 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -394,9 +394,9 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, * than a function that just loops through table b calling other functions. */ /** - *
      * Conceptually, apr_table_overlap does this:
      *
    + * 
      *  apr_array_header_t *barr = apr_table_elts(b);
      *  apr_table_entry_t *belt = (apr_table_entry_t *)barr->elts;
      *  int i;
    @@ -409,6 +409,7 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp,
      *          apr_table_setn(a, belt[i].key, belt[i].val);
      *      }
      *  }
    + * 
    * * Except that it is more efficient (less space and cpu-time) especially * when b has many elements. @@ -416,7 +417,6 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, * Notice the assumptions on the keys and values in b -- they must be * in an ancestor of a's pool. In practice b and a are usually from * the same pool. - *
    */ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, From d59db4150b2453abe5bd91d68b8bb6dd5fae0715 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Sat, 22 Apr 2006 03:58:04 +0000 Subject: [PATCH 5636/7878] * threadproc/unix/procsup.c (apr_proc_detach): Remove tabs that were screwing up the indenting. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@396070 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/procsup.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index 2595edf0b5e..da6cc4c06b4 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -28,15 +28,15 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) /* Don't detach for MPE because child processes can't survive the death of * the parent. */ if (daemonize) { - if ((x = fork()) > 0) { - exit(0); + if ((x = fork()) > 0) { + exit(0); } - else if (x == -1) { - perror("fork"); - fprintf(stderr, "unable to fork new process\n"); - exit(1); /* we can't do anything here, so just exit. */ - } - /* RAISE_SIGSTOP(DETACH); */ + else if (x == -1) { + perror("fork"); + fprintf(stderr, "unable to fork new process\n"); + exit(1); /* we can't do anything here, so just exit. */ + } + /* RAISE_SIGSTOP(DETACH); */ } #endif From 3befbd704e045937eef3dfd9b1f5400b3a6423da Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 26 Apr 2006 12:33:19 +0000 Subject: [PATCH 5637/7878] * test/testprocmutex.c (make_child): Take trylock parameter. (test_exclusive): Run tests for both normal locking and trylock Submitted by: Chris Darroch PR: 39289 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@397188 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 0b7b1310e75..ffdae2fbea2 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -31,6 +31,7 @@ #define MAX_ITER 200 #define CHILDREN 6 #define MAX_COUNTER (MAX_ITER * CHILDREN) +#define MAX_WAIT_USEC (1000*1000) static apr_proc_mutex_t *proc_lock; static volatile int *x; @@ -42,7 +43,7 @@ static int increment(int n) return n+1; } -static void make_child(abts_case *tc, apr_proc_t **proc, apr_pool_t *p) +static void make_child(abts_case *tc, int trylock, apr_proc_t **proc, apr_pool_t *p) { apr_status_t rv; @@ -68,8 +69,22 @@ static void make_child(abts_case *tc, apr_proc_t **proc, apr_pool_t *p) exit(1); do { - if (apr_proc_mutex_lock(proc_lock)) - exit(1); + if (trylock) { + int wait_usec = 0; + + while ((rv = apr_proc_mutex_trylock(proc_lock))) { + if (!APR_STATUS_IS_EBUSY(rv)) + exit(1); + if (++wait_usec >= MAX_WAIT_USEC) + exit(1); + apr_sleep(1); + } + } + else { + if (apr_proc_mutex_lock(proc_lock)) + exit(1); + } + i++; *x = increment(*x); if (apr_proc_mutex_unlock(proc_lock)) @@ -106,12 +121,33 @@ static void test_exclusive(abts_case *tc, const char *lockname, return; for (n = 0; n < CHILDREN; n++) - make_child(tc, &child[n], p); + make_child(tc, 0, &child[n], p); for (n = 0; n < CHILDREN; n++) await_child(tc, child[n]); ABTS_ASSERT(tc, "Locks don't appear to work", *x == MAX_COUNTER); + + rv = apr_proc_mutex_trylock(proc_lock); + if (rv == APR_ENOTIMPL) { + ABTS_NOT_IMPL(tc, "apr_proc_mutex_trylock not implemented"); + return; + } + APR_ASSERT_SUCCESS(tc, "check for trylock", rv); + + rv = apr_proc_mutex_unlock(proc_lock); + APR_ASSERT_SUCCESS(tc, "unlock after trylock check", rv); + + *x = 0; + + for (n = 0; n < CHILDREN; n++) + make_child(tc, 1, &child[n], p); + + for (n = 0; n < CHILDREN; n++) + await_child(tc, child[n]); + + ABTS_ASSERT(tc, "Locks don't appear to work with trylock", + *x == MAX_COUNTER); } #endif From 7b737fbde66e6738052ce1c64bc89abb30e88b8d Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Thu, 27 Apr 2006 00:01:52 +0000 Subject: [PATCH 5638/7878] Make apr_socket_recvfrom set the port in the from sockaddr. Submitted by: Anthony Minessale PR: 39325 * network_io/win32/sendrecv.c (apr_socket_recvfrom): Fill in from->port. * network_io/unix/sendrecv.c (apr_socket_recvfrom): Ditto. * network_io/beos/sendrecv.c (apr_socket_recvfrom): Ditto. * test/testsockets.c (sendto_recievefrom): Zero out the port before calling recvfrom, to confirm that it's filled in. * CHANGES: Note change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@397344 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ network_io/beos/sendrecv.c | 4 +++- network_io/unix/sendrecv.c | 2 ++ network_io/win32/sendrecv.c | 3 +++ test/testsockets.c | 3 +++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index bd5255e63f6..ccf341e1541 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Make apr_socket_recvfrom initialize the port field in the from + sockaddr. PR 39325 [Anthony Minessale ] + *) NetBSD: Avoid leaving zombie process when using apr_signal() to ignore SIGCHLD. PR 36750. [Todd Vierling ] diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 6378a3aaa96..8ffafbb9b0c 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -203,7 +203,9 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, (*len) = 0; return errno; } - + + from->port = ntohs(from->sa.sin.sin_port); + (*len) = rv; if (rv == 0) return APR_EOF; diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 7017ec3245b..4691246f2da 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -172,6 +172,8 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, return errno; } + from->port = ntohs(from->sa.sin.sin_port); + (*len) = rv; if (rv == 0 && sock->type == SOCK_STREAM) { return APR_EOF; diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 1fedfdf29a8..5a4fff14ae3 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -196,6 +196,9 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, (*len) = 0; return apr_get_netos_error(); } + + from->port = ntohs(from->sa.sin.sin_port); + (*len) = rv; if (rv == 0 && sock->type == SOCK_STREAM) return APR_EOF; diff --git a/test/testsockets.c b/test/testsockets.c index 7c03283f49a..1e23b38ad98 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -159,6 +159,9 @@ static void sendto_receivefrom(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, STRLEN, len); + /* Zero out the port so we can be sure it's been set by recvfrom. */ + from->port = 0; + len = 80; rv = apr_socket_recvfrom(from, sock, 0, recvbuf, &len); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); From b0b55f6019eca8de18f215cbc11c5a786886fa54 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 27 Apr 2006 05:33:00 +0000 Subject: [PATCH 5639/7878] How was httpd commit magic created? -2005 option, freshly minted, to clean up /GX and /machine:i386 flags. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@397409 13f79535-47bb-0310-9956-ffa450edef68 --- build/cvtdsp.pl | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl index 3a101f1e0a1..9ea63a87fce 100644 --- a/build/cvtdsp.pl +++ b/build/cvtdsp.pl @@ -7,6 +7,9 @@ elsif ($ARGV[0] eq '-5') { find(\&tovc5, '.'); } +elsif ($ARGV[0] eq '-2005') { + find(\&tovc2005, '.'); +} elsif ($ARGV[0] eq '-w3') { find(\&tow3, '.'); } @@ -120,6 +123,36 @@ sub tovc6 { } } +sub tovc2005 { + + if (m|\.dsp$| || m|\.mak$|) { + $oname = $_; + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $_, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|(\bCPP.*) /GX(.*)|$1 /EHsc$2|) { + $verchg = -1; + } + if ($src =~ s|(\bLINK32.*) /machine:I386(.*)|$1$2|) { + $verchg = -1; + } + print $dstfl $src; + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted project " . $oname . " to 2005 in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } + } +} + sub tow3 { if (m|\.dsp$| || m|\.mak$|) { From 2e343b91257994e6f13bb62f2647b0d11ef483e2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 27 Apr 2006 05:42:00 +0000 Subject: [PATCH 5640/7878] Eliminate /machine:i386 to simplify our lives when invoking other linkers, normalize the remaining /EHsc references, add the missing apr_random.h and some other side effects from saving the file (carefully replacing the bogus-missing /incremental:no flag in the release /debug flavor build.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@397415 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 85 ++++++++++++++++++++++++++++++++++--- libapr.dsp | 102 ++++++++++++++++++++++++++++++++++++++++----- test/testapp.dsp | 8 ++-- test/testappnt.dsp | 8 ++-- 4 files changed, 179 insertions(+), 24 deletions(-) diff --git a/apr.dsp b/apr.dsp index 562853e7a70..fa6cda684ab 100644 --- a/apr.dsp +++ b/apr.dsp @@ -19,6 +19,8 @@ CFG=apr - Win32 Debug !MESSAGE !MESSAGE "apr - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "apr - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "apr - Win32 ReleaseNT" (based on "Win32 (x86) Static Library") +!MESSAGE "apr - Win32 DebugNT" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project @@ -41,7 +43,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr_src" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -64,8 +66,8 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr_src" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr_src" /FD /EHsc /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -75,12 +77,61 @@ LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"LibD\apr-1.lib" +!ELSEIF "$(CFG)" == "apr - Win32 ReleaseNT" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "LibNTR" +# PROP BASE Intermediate_Dir "LibNTR" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "LibNTR" +# PROP Intermediate_Dir "LibNTR" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"LibNTR\apr_src" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"LibNTR\apr-1.lib" + +!ELSEIF "$(CFG)" == "apr - Win32 DebugNT" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "LibNTD" +# PROP BASE Intermediate_Dir "LibNTD" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "LibNTD" +# PROP Intermediate_Dir "LibNTD" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"LibNTD\apr_src" /FD /EHsc /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"LibNTD\apr-1.lib" + !ENDIF # Begin Target # Name "apr - Win32 Release" # Name "apr - Win32 Debug" +# Name "apr - Win32 ReleaseNT" +# Name "apr - Win32 DebugNT" # Begin Group "Source Files" # PROP Default_Filter ".c" @@ -278,11 +329,11 @@ SOURCE=.\network_io\unix\inet_pton.c # End Source File # Begin Source File -SOURCE=.\poll\unix\select.c +SOURCE=.\network_io\unix\multicast.c # End Source File # Begin Source File -SOURCE=.\network_io\unix\multicast.c +SOURCE=.\poll\unix\select.c # End Source File # Begin Source File @@ -511,6 +562,26 @@ InputPath=.\include\apr.hw # End Custom Build +!ELSEIF "$(CFG)" == "apr - Win32 ReleaseNT" + +# Begin Custom Build - Creating apr.h from apr.hw +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr.hw > .\include\apr.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - Win32 DebugNT" + +# Begin Custom Build - Creating apr.h from apr.hw +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr.hw > .\include\apr.h + +# End Custom Build + !ENDIF # End Source File @@ -596,6 +667,10 @@ SOURCE=.\include\apr_proc_mutex.h # End Source File # Begin Source File +SOURCE=.\include\apr_random.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_ring.h # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index 8e307ab7a57..d37898c8257 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -19,6 +19,8 @@ CFG=libapr - Win32 Debug !MESSAGE !MESSAGE "libapr - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libapr - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libapr - Win32 ReleaseNT" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libapr - Win32 DebugNT" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project @@ -43,17 +45,17 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libapr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libapr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" /d "APR_VERSION_ONLY" /I "./include" +# ADD RSC /l 0x409 /i "./include" /d "NDEBUG" /d "APR_VERSION_ONLY" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386 /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386 /out:"Release/libapr-1.dll" /opt:ref +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"Release/libapr-1.dll" /opt:ref !ELSEIF "$(CFG)" == "libapr - Win32 Debug" @@ -68,18 +70,70 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr_src" /FD /c +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" /d "APR_VERSION_ONLY" /I "./include" +# ADD RSC /l 0x409 /i "./include" /d "_DEBUG" /d "APR_VERSION_ONLY" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386 -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386 /out:"Debug/libapr-1.dll" +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"Debug/libapr-1.dll" + +!ELSEIF "$(CFG)" == "libapr - Win32 ReleaseNT" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "ReleaseNT" +# PROP BASE Intermediate_Dir "ReleaseNT" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ReleaseNT" +# PROP Intermediate_Dir "ReleaseNT" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"ReleaseNT\libapr_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /i "./include" /d "NDEBUG" /d "APR_VERSION_ONLY" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"ReleaseNT/libapr-1.dll" /opt:ref + +!ELSEIF "$(CFG)" == "libapr - Win32 DebugNT" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "DebugNT" +# PROP BASE Intermediate_Dir "DebugNT" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "DebugNT" +# PROP Intermediate_Dir "DebugNT" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"DebugNT\libapr_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /i "./include" /d "_DEBUG" /d "APR_VERSION_ONLY" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"DebugNT/libapr-1.dll" !ENDIF @@ -87,6 +141,8 @@ LINK32=link.exe # Name "libapr - Win32 Release" # Name "libapr - Win32 Debug" +# Name "libapr - Win32 ReleaseNT" +# Name "libapr - Win32 DebugNT" # Begin Group "Source Files" # PROP Default_Filter ".c" @@ -284,11 +340,11 @@ SOURCE=.\network_io\unix\inet_pton.c # End Source File # Begin Source File -SOURCE=.\poll\unix\select.c +SOURCE=.\network_io\unix\multicast.c # End Source File # Begin Source File -SOURCE=.\network_io\unix\multicast.c +SOURCE=.\poll\unix\select.c # End Source File # Begin Source File @@ -517,6 +573,26 @@ InputPath=.\include\apr.hw # End Custom Build +!ELSEIF "$(CFG)" == "libapr - Win32 ReleaseNT" + +# Begin Custom Build - Creating apr.h from apr.hw +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr.hw > .\include\apr.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 DebugNT" + +# Begin Custom Build - Creating apr.h from apr.hw +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr.hw > .\include\apr.h + +# End Custom Build + !ENDIF # End Source File @@ -602,6 +678,10 @@ SOURCE=.\include\apr_proc_mutex.h # End Source File # Begin Source File +SOURCE=.\include\apr_random.h +# End Source File +# Begin Source File + SOURCE=.\include\apr_ring.h # End Source File # Begin Source File diff --git a/test/testapp.dsp b/test/testapp.dsp index 5d40f89cc85..93c4aa283fc 100644 --- a/test/testapp.dsp +++ b/test/testapp.dsp @@ -49,8 +49,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 +# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console +# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console !ELSEIF "$(CFG)" == "testapp - Win32 Debug" @@ -73,8 +73,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 -# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 +# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug !ENDIF diff --git a/test/testappnt.dsp b/test/testappnt.dsp index dfd0d0383ed..f5cd43397aa 100644 --- a/test/testappnt.dsp +++ b/test/testappnt.dsp @@ -49,8 +49,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console /machine:I386 +# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console +# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console !ELSEIF "$(CFG)" == "testappnt - Win32 Debug" @@ -73,8 +73,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 -# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console /incremental:no /debug /machine:I386 +# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console /incremental:no /debug !ENDIF From ef2660ec5638476bbf3ddcc66ae660e3a6c29bc4 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 4 May 2006 16:17:36 +0000 Subject: [PATCH 5641/7878] * network_io/unix/sendrecv.c [__linux__] (apr_socket_sendfile): Limit each call to 2Gb. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@399750 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 4691246f2da..9bf931cc64a 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -269,6 +269,14 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, #else off_t off = *offset; + + /* Multiple reports have shown sendfile failing with EINVAL if + * passed a >=2Gb count value on some 64-bit kernels. It won't + * noticably hurt performance to limit each call to <2Gb at a + * time, so avoid that issue here: */ + if (sizeof(off_t) == 8 && *len > INT_MAX) { + *len = INT_MAX; + } #endif if (!hdtr) { From 4addfbbf9951a86c37e5866c92fb5e204e57c428 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 9 May 2006 22:34:02 +0000 Subject: [PATCH 5642/7878] Remove an unnecessary #define Submitted by git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@405558 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 1 - 1 file changed, 1 deletion(-) diff --git a/include/apr.hnw b/include/apr.hnw index a907a8789ec..ebd6ef7a52c 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -85,7 +85,6 @@ extern "C" { #endif #define ENUM_BITFIELD(e,n,w) signed int n : w -#define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_CONIO_H 0 #define APR_HAVE_CRYPT_H 0 #define APR_HAVE_CTYPE_H 1 From 26a4880aa355b431b021beb689e009d03414a630 Mon Sep 17 00:00:00 2001 From: Wilfredo Sanchez Date: Wed, 31 May 2006 18:50:06 +0000 Subject: [PATCH 5643/7878] Submitted by: breser ssize_t changes from int to long in Darwin 8. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@410634 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 3f1a99cbb88..879b63d0207 100644 --- a/configure.in +++ b/configure.in @@ -1346,7 +1346,15 @@ case $host in size_t_fmt='#define APR_SIZE_T_FMT "ld"' ;; *apple-darwin*) - ssize_t_fmt='#define APR_SSIZE_T_FMT "d"' + osver=`uname -r` + case $osver in + [0-7].*) + ssize_t_fmt='#define APR_SSIZE_T_FMT "d"' + ;; + *) + ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' + ;; + esac size_t_fmt='#define APR_SIZE_T_FMT "lu"' ;; esac From 0643c3bd2842d36ceaeaca523a27e2be0575f235 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 2 Jun 2006 21:44:40 +0000 Subject: [PATCH 5644/7878] Don't allow apr_pool_parent_get() to return a NULL pointer. Since there aren't any process boundaries on NetWare which makes the global_pool global to all applications, return the application specific pool as the global_pool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@411301 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index b4218fe1142..3b188a41cf2 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1824,7 +1824,7 @@ APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool) /* On NetWare, don't return the global_pool, return the application pool as the top most pool */ if (pool->parent == global_pool) - return NULL; + return pool; else #endif return pool->parent; From 15409d6679237317aa9da19d63b06321f35a2d54 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Mon, 5 Jun 2006 01:52:16 +0000 Subject: [PATCH 5645/7878] Fix warning about unused variables on new versions of FreeBSD. Submitted by: Philip M. Gollucci * network_io/unix/sendrecv.c (apr_socket_sendfile): Only declare i if we're on a suitable version of FreeBSD. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@411637 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 9bf931cc64a..1e1a7d552bb 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -409,7 +409,10 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, apr_size_t * len, apr_int32_t flags) { off_t nbytes = 0; - int rv, i; + int rv; +#if defined(__FreeBSD_version) && __FreeBSD_version < 460001 + int i; +#endif struct sf_hdtr headerstruct; apr_size_t bytes_to_send = *len; From 0cdbe6629a6e11b2fe118c5178bbefa052a6540e Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Tue, 13 Jun 2006 01:57:07 +0000 Subject: [PATCH 5646/7878] As per apr_hints.m4, SOLARIS2 is set to "6" for Solaris 2.6, "10" for 2.10 and so on. Reflect that in our use of the macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@413784 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testatomic.c b/test/testatomic.c index 95f31119c7e..baf32a62a5e 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -25,7 +25,7 @@ /* Use pthread_setconcurrency where it is available and not a nullop, * i.e. platforms using M:N or M:1 thread models: */ #if APR_HAS_THREADS && \ - ((defined(SOLARIS2) && SOLARIS2 > 26) || defined(_AIX)) + ((defined(SOLARIS2) && SOLARIS2 > 6) || defined(_AIX)) /* also HP-UX, IRIX? ... */ #define HAVE_PTHREAD_SETCONCURRENCY #endif From 695af5c8990f707ef9ffae9ad9a640156c2f360d Mon Sep 17 00:00:00 2001 From: Colm MacCarthaigh Date: Tue, 13 Jun 2006 02:22:05 +0000 Subject: [PATCH 5647/7878] Implement apr_atomics using Solaris' native atomic API. * Use each of the atomic_ functions that we can. * atomic_add is NOT implemented, as Solaris' implementation can handle only signed deltas. * each function is conditionalised on its corresponding APR_OVERRIDE_* macro to avoid double-implementation. On Solaris x86/x64 with gcc we implement atomics using our inline assembly. Thank to: Mads Toftum for pointing out atomic_cas git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@413786 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ atomic/unix/apr_atomic.c | 55 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/CHANGES b/CHANGES index ccf341e1541..07cbf7560c1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Utilise Solaris' native atomic_* functions for apr_atomics + where appropriate. [Colm MacCarthaigh] + *) Make apr_socket_recvfrom initialize the port field in the from sockaddr. PR 39325 [Anthony Minessale ] diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 5484eba0adc..b06bf2ac8f7 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -21,6 +21,9 @@ #include "apr_private.h" #include +#if (defined(SOLARIS2) && SOLARIS2 >= 10) +#include +#endif #if defined(__GNUC__) && defined(__STRICT_ANSI__) && !defined(USE_GENERIC_ATOMICS) /* force use of generic atomics if building e.g. with -std=c89, which @@ -162,6 +165,58 @@ APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, #endif /* __PPC__ && __GNUC__ */ +#if (defined(SOLARIS2) && SOLARIS2 >= 10) \ + && !defined(USE_GENERIC_ATOMICS) + +#if !defined(APR_OVERRIDE_ATOMIC_CAS32) +APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, + apr_uint32_t with, + apr_uint32_t cmp) +{ + return atomic_cas_32(mem, cmp, with); +} +#define APR_OVERRIDE_ATOMIC_CAS32 +#endif /* APR_OVERRIDE_ATOMIC_CAS32 */ + +#if !defined(APR_OVERRIDE_ATOMIC_DEC32) +APR_DECLARE(apr_uint32_t) apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + apr_uint32_t prev = *mem; + atomic_dec_32(mem); + return prev != 1; +} +#define APR_OVERRIDE_ATOMIC_DEC32 +#endif /* APR_OVERRIDE_ATOMIC_DEC32 */ + +#if !defined(APR_OVERRIDE_ATOMIC_INC32) +APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) +{ + apr_uint32_t prev = *mem; + atomic_inc_32(mem); + return prev; +} +#define APR_OVERRIDE_ATOMIC_INC32 +#endif /* APR_OVERRIDE_ATOMIC_INC32 */ + +#if !defined(APR_OVERRIDE_ATOMIC_SET32) +APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + *mem = val; +} +#define APR_OVERRIDE_ATOMIC_SET32 +#endif /* APR_OVERRIDE_ATOMIC_SET32 */ + +#if !defined(APR_OVERRIDE_ATOMIC_XCHG32) +APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, + apr_uint32_t val) +{ + return atomic_swap_32(mem, val); +} +#define APR_OVERRIDE_ATOMIC_XCHG32 +#endif /* APR_OVERRIDE_ATOMIC_XCHG32 */ + +#endif /* SOLARIS2 && SOLARIS2 >= 10 */ + #if !defined(APR_OVERRIDE_ATOMIC_INIT) #if APR_HAS_THREADS From 006c1c12874fcc606dc3c07895d98f6c1d6fcca1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 14 Jun 2006 11:59:31 +0000 Subject: [PATCH 5648/7878] * build/config.guess, build/config.sub: Update from http://cvs.savannah.gnu.org/viewcvs/*checkout*/config/config/. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@414212 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 47 +++++++++++++++++++++++++++++++-------- build/config.sub | 55 +++++++++++++++++++++++++++------------------- 2 files changed, 70 insertions(+), 32 deletions(-) diff --git a/build/config.guess b/build/config.guess index e3ef63f6cb4..7924ac077df 100755 --- a/build/config.guess +++ b/build/config.guess @@ -1,9 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. -timestamp='2005-12-13' +timestamp='2006-06-06' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -106,7 +107,7 @@ set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; @@ -206,6 +207,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit ;; @@ -764,7 +768,14 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -780,7 +791,10 @@ EOF echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[345]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T:Interix*:[345]*) + echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks @@ -817,6 +831,9 @@ EOF arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; @@ -851,7 +868,11 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`" + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) @@ -870,7 +891,11 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`" + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) @@ -967,7 +992,7 @@ EOF LIBC=gnulibc1 # endif #else - #if defined(__INTEL_COMPILER) || defined(__PGI) + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout @@ -977,7 +1002,11 @@ EOF LIBC=dietlibc #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s: ::g;p;}'`" + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit diff --git a/build/config.sub b/build/config.sub index 48b4c3bed8c..70584b007e2 100755 --- a/build/config.sub +++ b/build/config.sub @@ -1,9 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. -timestamp='2005-12-22' +timestamp='2006-06-06' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -240,7 +241,7 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ @@ -248,7 +249,8 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -268,16 +270,17 @@ case $basic_machine in | mn10200 | mn10300 \ | mt \ | msp430 \ + | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b \ - | strongarm \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ @@ -285,9 +288,6 @@ case $basic_machine in | z8k) basic_machine=$basic_machine-unknown ;; - m32c) - basic_machine=$basic_machine-unknown - ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown @@ -317,7 +317,7 @@ case $basic_machine in | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ + | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ @@ -328,7 +328,7 @@ case $basic_machine in | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | m32r-* | m32rle-* \ + | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ @@ -350,17 +350,18 @@ case $basic_machine in | mmix-* \ | mt-* \ | msp430-* \ + | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ @@ -371,8 +372,6 @@ case $basic_machine in | ymp-* \ | z8k-*) ;; - m32c-*) - ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) @@ -818,6 +817,12 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; @@ -1120,7 +1125,7 @@ case $basic_machine in sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sparc | sparcv8 | sparcv9 | sparcv9b) + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) @@ -1193,7 +1198,8 @@ case $os in | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ @@ -1360,6 +1366,9 @@ else # system, and we'll never get to this point. case $basic_machine in + spu-*) + os=-elf + ;; *-acorn) os=-riscix1.2 ;; @@ -1369,9 +1378,9 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; + c4x-* | tic4x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 From b3670931b3332b85a32d8ae03cb4e56b60d23f8e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 19 Jun 2006 09:21:13 +0000 Subject: [PATCH 5649/7878] * build/apr_threads.m4 (APR_CHECK_PTHREAD_ROBUST_SHARED_MUTEX): Fix detection of robust cross-process pthread mutexes. PR: 39833 Submitted by: Tsuyoshi SASAMOTO git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@415267 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_threads.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index 01d032d52dc..c7a4729de01 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -263,7 +263,7 @@ int main(int argc, char **argv) exit(2); if (pthread_mutexattr_setrobust_np(&attr, PTHREAD_MUTEX_ROBUST_NP)) exit(3); - if (pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT)) + if (pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT)) exit(4); if (pthread_mutex_init(&mutex, &attr)) exit(5); From e5d90e2d00e0f5edcfed64ead41dbff2f21719ef Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Wed, 21 Jun 2006 08:48:31 +0000 Subject: [PATCH 5650/7878] The unnecessary inclusion of errno.h causes these test programs to fail to compile on platforms, such as Windows CE, where errno.h is not supported. PR: 39848 Submitted By: Curt Arnold git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@415941 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 1 - test/testrand.c | 1 - test/testrand2.c | 1 - test/testsleep.c | 1 - test/testthread.c | 1 - 5 files changed, 5 deletions(-) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index ffdae2fbea2..0ddda096cfe 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -21,7 +21,6 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_getopt.h" -#include "errno.h" #include #include #include "testutil.h" diff --git a/test/testrand.c b/test/testrand.c index ca94b60b9df..f92a0b1ce84 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -15,7 +15,6 @@ */ #include "apr_general.h" -#include #include #include #include "testutil.h" diff --git a/test/testrand2.c b/test/testrand2.c index 6dd7b5d6c02..d271d2d5c1d 100644 --- a/test/testrand2.c +++ b/test/testrand2.c @@ -17,7 +17,6 @@ #include "apr_general.h" #include "apr_random.h" #include "apr_thread_proc.h" -#include #include #include #include "testutil.h" diff --git a/test/testsleep.c b/test/testsleep.c index 38a3b354d70..16a1519f4a8 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -19,7 +19,6 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" -#include #include #include #include "testutil.h" diff --git a/test/testthread.c b/test/testthread.c index 44ed57b282b..ef32e5d28d4 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -17,7 +17,6 @@ #include "apr_thread_proc.h" #include "apr_errno.h" #include "apr_general.h" -#include "errno.h" #include "apr_time.h" #include "testutil.h" From cbfede8a905b46a19c05d9d98db4138a69141c1e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 21 Jun 2006 21:24:34 +0000 Subject: [PATCH 5651/7878] Provide folding in autogenerated .manifest files for Win32 builders using VisualStudio 2005. This actually describes the clib that is required at run time by this build of libapr-1.dll git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@416113 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ libapr.dsp | 26 ++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 07cbf7560c1..d60de75bf5e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Provide folding in autogenerated .manifest files for Win32 builders + using VisualStudio 2005 [William Rowe] + *) Utilise Solaris' native atomic_* functions for apr_atomics where appropriate. [Colm MacCarthaigh] diff --git a/libapr.dsp b/libapr.dsp index d37898c8257..b918c5f33ba 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -56,6 +56,12 @@ BSC32=bscmake.exe LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref # ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"Release/libapr-1.dll" /opt:ref +# Begin Special Build Tool +OutDir=.\Release +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=echo if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 +# End Special Build Tool !ELSEIF "$(CFG)" == "libapr - Win32 Debug" @@ -82,6 +88,12 @@ BSC32=bscmake.exe LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug # ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"Debug/libapr-1.dll" +# Begin Special Build Tool +OutDir=.\Debug +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=echo if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 +# End Special Build Tool !ELSEIF "$(CFG)" == "libapr - Win32 ReleaseNT" @@ -106,8 +118,12 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"ReleaseNT/libapr-1.dll" /opt:ref +# Begin Special Build Tool +OutDir=.\ReleaseNT +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=echo if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 +# End Special Build Tool !ELSEIF "$(CFG)" == "libapr - Win32 DebugNT" @@ -134,6 +150,12 @@ BSC32=bscmake.exe LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug # ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"DebugNT/libapr-1.dll" +# Begin Special Build Tool +OutDir=.\DebugNT +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=echo if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 +# End Special Build Tool !ENDIF From 15607d88694d56a4f06b0e9eb430e287c202281a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 21 Jun 2006 22:36:27 +0000 Subject: [PATCH 5652/7878] An early test version; activate the response git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@416142 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libapr.dsp b/libapr.dsp index b918c5f33ba..8fb3472769f 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -60,7 +60,7 @@ LINK32=link.exe OutDir=.\Release SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest -PostBuild_Cmds=echo if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 +PostBuild_Cmds=if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 # End Special Build Tool !ELSEIF "$(CFG)" == "libapr - Win32 Debug" @@ -92,7 +92,7 @@ LINK32=link.exe OutDir=.\Debug SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest -PostBuild_Cmds=echo if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 +PostBuild_Cmds=if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 # End Special Build Tool !ELSEIF "$(CFG)" == "libapr - Win32 ReleaseNT" @@ -122,7 +122,7 @@ LINK32=link.exe OutDir=.\ReleaseNT SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest -PostBuild_Cmds=echo if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 +PostBuild_Cmds=if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 # End Special Build Tool !ELSEIF "$(CFG)" == "libapr - Win32 DebugNT" @@ -154,7 +154,7 @@ LINK32=link.exe OutDir=.\DebugNT SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest -PostBuild_Cmds=echo if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 +PostBuild_Cmds=if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 # End Special Build Tool !ENDIF From 12658d13b6ce65d1745f7913b9c1329983ddace9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 21 Jun 2006 22:49:37 +0000 Subject: [PATCH 5653/7878] Props update git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@416150 13f79535-47bb-0310-9956-ffa450edef68 From ce3b9ad8a34a83230fc6d0562b40994a9946d584 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 22 Jun 2006 16:02:45 +0000 Subject: [PATCH 5654/7878] - remove what appears to be a copy/paste error from docs in network_io - add details about ranges of status numbers used by apr git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@416407 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 47 +++++++++++++++++++++++++++++++++++++++- include/apr_network_io.h | 1 - 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 9f4e569e9ee..12587b1601a 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -131,6 +131,18 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * error immediately following this one is set ten times farther * away than usual, so that users of apr have a lot of room in * which to declare custom error codes. + * + * In general applications should try and create unique error codes. To try + * and assist in finding suitable ranges of numbers to use, the following + * ranges are known to be used by the listed applications. If your + * application defines error codes please advise the range of numbers it + * uses to dev@apr.apache.org for inclusion in this list. + * + * Ranges shown are in relation to APR_OS_START_USERERR + * + * Subversion - Defined ranges, of less than 100, at intervals of 5000 + * starting at an offset of 5000, e.g. + * +5000 to 5100, +10000 to 10100 */ #define APR_OS_START_USERERR (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE) /** @@ -155,6 +167,39 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, */ #define APR_OS_START_SYSERR (APR_OS_START_EAIERR + APR_OS_ERRSPACE_SIZE) +/** + * @defgroup APR_ERROR_map APR Error Space + *
    + * The following attempts to show the relation of the various constants
    + * used for mapping APR Status codes.
    + *
    + *       0          
    + *
    + *  20,000     APR_OS_START_ERROR
    + *
    + *         + APR_OS_ERRSPACE_SIZE (50,000)
    + *
    + *  70,000      APR_OS_START_STATUS
    + *
    + *         + APR_OS_ERRSPACE_SIZE (50,000)
    + *
    + * 120,000      APR_OS_START_USERERR
    + *
    + *         + 10 x APR_OS_ERRSPACE_SIZE (50,000 * 10)
    + *
    + * 620,000      APR_OS_START_CANONERR
    + *
    + *         + APR_OS_ERRSPACE_SIZE (50,000)
    + *
    + * 670,000      APR_OS_START_EAIERR
    + *
    + *         + APR_OS_ERRSPACE_SIZE (50,000)
    + *
    + * 720,000      APR_OS_START_SYSERR
    + *
    + * 
    + */ + /** no error. */ #define APR_SUCCESS 0 @@ -575,7 +620,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_EACCES (APR_OS_START_CANONERR + 1) #endif -/** @see APR_STATUS_IS_EXIST */ +/** @see APR_STATUS_IS_EEXIST */ #ifdef EEXIST #define APR_EEXIST EEXIST #else diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 383d963ff3c..7006abd1603 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -671,7 +671,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, /** * Write the IP address (in numeric address string format) of the APR * socket address @a sockaddr into the buffer @a buf (of size @a buflen). - * @param addr The IP address. * @param sockaddr The socket address to reference. */ APR_DECLARE(apr_status_t) apr_sockaddr_ip_getbuf(char *buf, apr_size_t buflen, From 23a8a7e4a83dca01b4dcbe105a552da3dcdda944 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 23 Jun 2006 08:35:23 +0000 Subject: [PATCH 5655/7878] Add a "small" space for apr-util to define error codes. Instead of just using APR_OS_ERRSPACE_SIZE / 2 I went with a defined size to give us more control over it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@416634 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 12587b1601a..0890196f8e1 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -121,10 +121,25 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * APR_OS_START_USERERR, which see. */ #define APR_OS_ERRSPACE_SIZE 50000 +/** + * APR_UTIL_ERRSPACE_SIZE is the size of the space that is reserved for + * use within apr-util. This space is reserved above that used by APR + * internally. + * @note This number MUST be smaller than APR_OS_ERRSPACE_SIZE by a + * large enough amount that APR has sufficient room for it's + * codes. + */ +#define APR_UTIL_ERRSPACE_SIZE 20000 /** * APR_OS_START_STATUS is where the APR specific status codes start. */ #define APR_OS_START_STATUS (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE) +/** + * APR_UTIL_START_STATUS is where APR-Util starts defining it's + * status codes. + */ +#define APR_UTIL_START_STATUS (APR_OS_START_STATUS + \ + (APR_OS_ERRSPACE_SIZE - APR_UTIL_ERRSPACE_SIZE)) /** * APR_OS_START_USERERR are reserved for applications that use APR that * layer their own error codes along with APR's. Note that the @@ -181,7 +196,11 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * * 70,000 APR_OS_START_STATUS * - * + APR_OS_ERRSPACE_SIZE (50,000) + * + APR_OS_ERRSPACE_SIZE - APR_UTIL_ERRSPACE_SIZE (30,000) + * + * 100,000 APR_UTIL_START_STATUS + * + * + APR_UTIL_ERRSPACE_SIZE (20,000) * * 120,000 APR_OS_START_USERERR * From 50d911e3c46d4c4a22aa9174a25dd184b90d2fb7 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 24 Jun 2006 12:00:58 +0000 Subject: [PATCH 5656/7878] Add a simple echod and a sockperf test that allows us to get some (very) basic timings for sockets. The only aim of these is to allow us to compare the performance of apr's network code if/when we start changing it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@416904 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 10 +- test/echod.c | 135 ++++++++++++++++++++++++++ test/sockperf.c | 241 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 385 insertions(+), 1 deletion(-) create mode 100644 test/echod.c create mode 100644 test/sockperf.c diff --git a/test/Makefile.in b/test/Makefile.in index cafc7aa369d..373c710722b 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -17,7 +17,9 @@ STDTEST_PORTABLE = \ testmutexscope@EXEEXT@ \ testall@EXEEXT@ -OTHER_PROGRAMS = sendfile@EXEEXT@ +OTHER_PROGRAMS = sendfile@EXEEXT@ \ + echod@EXEEXT@ \ + sockperf@EXEEXT@ PROGRAMS = $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS) @@ -96,6 +98,12 @@ testprocmutex@EXEEXT@: testprocmutex.lo $(LOCAL_LIBS) testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) $(LINK_PROG) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) +echod@EXEEXT@: echod.lo $(LOCAL_LIBS) + $(LINK_PROG) echod.lo $(LOCAL_LIBS) $(ALL_LIBS) + +sockperf@EXEEXT@: sockperf.lo $(LOCAL_LIBS) + $(LINK_PROG) sockperf.lo $(LOCAL_LIBS) $(ALL_LIBS) + TESTS = testutil.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \ diff --git a/test/echod.c b/test/echod.c new file mode 100644 index 00000000000..280f15ddef4 --- /dev/null +++ b/test/echod.c @@ -0,0 +1,135 @@ +/* Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* Simple echo daemon, designed to be used for network throughput + * benchmarks. The aim is to allow us to monitor changes in performance + * of APR networking code, nothing more. + */ + +#include +#include /* for atexit() */ + +#include "apr.h" +#include "apr_network_io.h" +#include "apr_strings.h" + +#define BUF_SIZE 4096 + +static void reportError(const char *msg, apr_status_t rv, + apr_pool_t *pool) +{ + fprintf(stderr, "%s\nError: %d\n'%s'\n", msg, rv, + apr_psprintf(pool, "%pm", &rv)); +} + +static apr_status_t talkTalk(apr_socket_t *socket, apr_pool_t *parent) +{ + apr_pool_t *pool; + apr_size_t len; + char *buf; + apr_status_t rv; + + if (apr_pool_create(&pool, parent) != APR_SUCCESS) + return APR_ENOPOOL; + + + buf = apr_palloc(pool, BUF_SIZE); + if (!buf) + return ENOMEM; + + do { + len = BUF_SIZE; + rv = apr_socket_recv(socket, buf, &len); + if (APR_STATUS_IS_EOF(rv) || len == 0 || rv != APR_SUCCESS) + break; + rv = apr_socket_send(socket, buf, &len); + if (len == 0 || rv != APR_SUCCESS) + break; + } while (rv == APR_SUCCESS); + + apr_pool_clear(pool); + return APR_SUCCESS; +} + +static apr_status_t glassToWall(apr_int16_t port, apr_pool_t *parent) +{ + apr_sockaddr_t *sockAddr; + apr_socket_t *listener, *accepted; + apr_status_t rv; + + rv = apr_socket_create(&listener, APR_INET, SOCK_STREAM, APR_PROTO_TCP, + parent); + if (rv != APR_SUCCESS) { + reportError("Unable to create socket", rv, parent); + return rv; + } + + rv = apr_sockaddr_info_get(&sockAddr, "127.0.0.1", APR_UNSPEC, + port, 0, parent); + if (rv != APR_SUCCESS) { + reportError("Unable to get socket info", rv, parent); + apr_socket_close(listener); + return rv; + } + + if ((rv = apr_socket_bind(listener, sockAddr)) != APR_SUCCESS || + (rv = apr_socket_listen(listener, 5)) != APR_SUCCESS) { + reportError("Unable to bind or listen to socket", rv, parent); + apr_socket_close(listener); + return rv; + } + + for (;;) { + rv = apr_socket_accept(&accepted, listener, parent); + if (rv != APR_SUCCESS) { + reportError("Error accepting on socket", rv, parent); + break; + } + printf("\tAnswering connection\n"); + rv = talkTalk(accepted, parent); + apr_socket_close(accepted); + printf("\tConnection closed\n"); + if (rv != APR_SUCCESS) + break; + } + + apr_socket_close(listener); + return APR_SUCCESS; +} + +int main(int argc, char **argv) +{ + apr_pool_t *pool; + apr_status_t rv; + apr_int16_t theport = 4747; + + printf("APR Test Application: echod\n"); + + apr_initialize(); + atexit(apr_terminate); + + apr_pool_create(&pool, NULL); + + if (argc >= 2) { + printf("argc = %d, port = '%s'\n", argc, argv[1]); + theport = atoi(argv[1]); + } + + fprintf(stdout, "Starting to listen on port %d\n", theport); + rv = glassToWall(theport, pool); + + return 0; +} diff --git a/test/sockperf.c b/test/sockperf.c new file mode 100644 index 00000000000..dc125b2de05 --- /dev/null +++ b/test/sockperf.c @@ -0,0 +1,241 @@ +/* Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* sockperf.c + * This simple network client tries to connect to an echo daemon (echod) + * listening on a port it supplies, then time how long it takes to + * reply with packets of varying sizes. + * It prints results once completed. + * + * To run, + * + * ./echod & + * ./sockperf + */ + +#include +#include /* for atexit() */ + +#include "apr.h" +#include "apr_network_io.h" +#include "apr_strings.h" + +#define MAX_ITERS 10 +#define TEST_SIZE 1024 + +struct testSet { + char c; + int size; + int iters; +} testRuns[] = { + { 'a', 1, 3 }, + { 'b', 4, 3 }, + { 'c', 16, 5 }, + { 'd', 64, 5 }, + { 'e', 256, 10 }, +}; + +struct testResult { + int size; + int iters; + apr_time_t msecs[MAX_ITERS]; + apr_time_t avg; +}; + +static apr_int16_t testPort = 4747; +static apr_sockaddr_t *sockAddr = NULL; + +static void reportError(const char *msg, apr_status_t rv, + apr_pool_t *pool) +{ + fprintf(stderr, "%s\n", msg); + if (rv != APR_SUCCESS) + fprintf(stderr, "Error: %d\n'%s'\n", rv, + apr_psprintf(pool, "%pm", &rv)); + +} + +static closeConnection(apr_socket_t *sock) +{ + apr_size_t len = 0; + apr_socket_send(sock, NULL, &len); +} + +static apr_status_t sendRecvBuffer(apr_time_t *t, const char *buf, + int size, apr_pool_t *pool) +{ + apr_socket_t *sock; + apr_status_t rv; + apr_size_t len = size, thistime = size; + char *recvBuf; + apr_time_t testStart = apr_time_now(), testEnd; + int i; + + if (! sockAddr) { + rv = apr_sockaddr_info_get(&sockAddr, "127.0.0.1", APR_UNSPEC, + testPort, 0, pool); + if (rv != APR_SUCCESS) { + reportError("Unable to get socket info", rv, pool); + return rv; + } + + /* make sure we can connect to daemon before we try tests */ + + rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, APR_PROTO_TCP, + pool); + if (rv != APR_SUCCESS) + return rv; + + rv = apr_socket_connect(sock, sockAddr); + if (rv != APR_SUCCESS) { + reportError("Unable to connect to echod!", rv, pool); + apr_socket_close(sock); + return rv; + } + apr_socket_close(sock); + + } + + recvBuf = apr_palloc(pool, size); + if (! recvBuf) + return ENOMEM; + *t = 0; + + /* START! */ + testStart = apr_time_now(); + rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, APR_PROTO_TCP, + pool); + if (rv != APR_SUCCESS) + return rv; + + rv = apr_socket_connect(sock, sockAddr); + if (rv != APR_SUCCESS) { + reportError("Unable to connect to echod!", rv, pool); + apr_socket_close(sock); + return rv; + } + + for (i = 0; i < 3; i++) { + + len = size; + thistime = size; + + rv = apr_socket_send(sock, buf, &len); + if (rv != APR_SUCCESS || len != size) { + reportError(apr_psprintf(pool, + "Unable to send data correctly (iteration %d of 3)", + i) , rv, pool); + closeConnection(sock); + apr_socket_close(sock); + return rv; + } + + do { + len = thistime; + rv = apr_socket_recv(sock, &recvBuf[size - thistime], &len); + if (rv != APR_SUCCESS) + break; + thistime -= len; + } while (thistime); + } + + closeConnection(sock); + apr_socket_close(sock); + testEnd = apr_time_now(); + /* STOP! */ + + if (thistime) { + reportError("Received less than we sent :-(", rv, pool); + return rv; + } + if (strncmp(recvBuf, buf, size) != 0) { + reportError("Received corrupt data :-(", 0, pool); + printf("We sent:\n%s\nWe received:\n%s\n", buf, recvBuf); + return EINVAL; + } + *t = testEnd - testStart; + return APR_SUCCESS; +} + +static apr_status_t runTest(struct testSet *ts, struct testResult *res, + apr_pool_t *pool) +{ + char *buffer; + apr_status_t rv; + int i, sz = ts->size * TEST_SIZE; + + buffer = apr_palloc(pool, sz); + if (!buffer) { + reportError("Unable to allocate buffer", ENOMEM, pool); + return ENOMEM; + } + memset(buffer, ts->c, sz); + + res->iters = ts->iters > MAX_ITERS ? MAX_ITERS : ts->iters; + + for (i = 0; i < res->iters; i++) { + apr_time_t iterTime; + rv = sendRecvBuffer(&iterTime, buffer, sz, pool); + if (rv != APR_SUCCESS) { + res->iters = i; + break; + } + res->msecs[i] = iterTime; + } + + return rv; +} + +int main(int argc, char **argv) +{ + apr_pool_t *pool; + apr_status_t rv; + int i; + int nTests = sizeof(testRuns) / sizeof(testRuns[0]); + struct testResult *results; + + printf("APR Test Application: sockperf\n"); + + apr_initialize(); + atexit(apr_terminate); + + apr_pool_create(&pool, NULL); + + results = (struct testResult *)apr_pcalloc(pool, + sizeof(*results) * nTests); + + for(i = 0; i < nTests; i++) { + printf("Test -> %c\n", testRuns[i].c); + results[i].size = testRuns[i].size * TEST_SIZE; + rv = runTest(&testRuns[i], &results[i], pool); + } + + printf("Tests Complete!\n"); + for(i = 0; i < nTests; i++) { + int j; + apr_time_t totTime = 0; + printf("%10d byte block:\n", results[i].size); + printf("\t%2d iterations : ", results[i].iters); + for (j = 0; j < results[i].iters; j++) { + printf("%6Ld ", results[i].msecs[j]); + totTime += results[i].msecs[j]; + } + printf("<\n"); + printf("\t Average: %6Ld\n", totTime / results[i].iters); + } + + return 0; +} From 4833f38cb39b35ddd5223a781f08ab8c3b273846 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 25 Jun 2006 18:00:49 +0000 Subject: [PATCH 5657/7878] Correct typo in docs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@417036 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index bfbd5997d49..ef8f53f2a2b 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -126,10 +126,10 @@ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, * an iteration (although the results may be unpredictable unless all you do * is delete the current entry) and multiple iterations can be in * progress at the same time. - - * @example */ /** + * @example + * *
      * 
      * int sum_values(apr_pool_t *p, apr_hash_t *ht)
    
    From ffb21521191cfbc6f3cd6ac3608c7c4321ab64d5 Mon Sep 17 00:00:00 2001
    From: David Reid 
    Date: Sun, 25 Jun 2006 18:52:27 +0000
    Subject: [PATCH 5658/7878] Remove use of @example as the resultant output
     isn't examples and looks very odd.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@417039 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr.h.in | 32 ++++++++++++++++++++------------
     1 file changed, 20 insertions(+), 12 deletions(-)
    
    diff --git a/include/apr.h.in b/include/apr.h.in
    index 3bf45f5235b..cf7b97d5a0b 100644
    --- a/include/apr.h.in
    +++ b/include/apr.h.in
    @@ -284,9 +284,11 @@ typedef  @socklen_t_value@       apr_socklen_t;
     /** 
      * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, 
      * so that they follow the platform's calling convention.
    - * @example
    - */
    -/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
    + * 
    + *
    + * void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
    + *
    + * 
    */ #define APR_THREAD_FUNC @@ -296,9 +298,10 @@ typedef @socklen_t_value@ apr_socklen_t; * variable arguments must use APR_DECLARE_NONSTD(). * * @remark Both the declaration and implementations must use the same macro. - * @example - */ -/** APR_DECLARE(rettype) apr_func(args) + * + *
    + * APR_DECLARE(rettype) apr_func(args)
    + * 
    * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA * @remark Note that when APR compiles the library itself, it passes the * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) @@ -317,9 +320,11 @@ typedef @socklen_t_value@ apr_socklen_t; * APR_DECLARE_NONSTD(), as they must follow the C language calling convention. * @see APR_DECLARE @see APR_DECLARE_DATA * @remark Both the declaration and implementations must use the same macro. - * @example - */ -/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...); + *
    + *
    + * APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
    + *
    + * 
    */ #define APR_DECLARE_NONSTD(type) type @@ -329,10 +334,13 @@ typedef @socklen_t_value@ apr_socklen_t; * @see APR_DECLARE @see APR_DECLARE_NONSTD * @remark Note that the declaration and implementations use different forms, * but both must include the macro. - * @example - */ -/** extern APR_DECLARE_DATA type apr_variable;\n + * + *
    + *
    + * extern APR_DECLARE_DATA type apr_variable;\n
      * APR_DECLARE_DATA type apr_variable = value;
    + *
    + * 
    */ #define APR_DECLARE_DATA From 335f96533aec09f562d10f27f1f10d9415b3a50b Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Fri, 30 Jun 2006 18:14:21 +0000 Subject: [PATCH 5659/7878] Implement apr_thread_yield on Unix in terms of pthread_yield or sched_yield. Submitted by: Keisuke Nishida Reviewed by: rooneg, Henry Jen * configure.in: Look for pthread_yield and sched_yield. * include/arch/unix/apr_arch_threadproc.h: Include sched.h if it's present. * threadproc/unix/thread.c (apr_thread_yield): Actually do something in here... * CHANGES: Note change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@418351 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 8 +++++++- include/arch/unix/apr_arch_threadproc.h | 3 +++ threadproc/unix/thread.c | 9 ++++++++- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index d60de75bf5e..3fc469ed7e2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Implement apr_thread_yield on Unix in terms of pthread_yield or + sched_yield. [Keisuke Nishida ] + *) Provide folding in autogenerated .manifest files for Win32 builders using VisualStudio 2005 [William Rowe] diff --git a/configure.in b/configure.in index 879b63d0207..045e9b63f08 100644 --- a/configure.in +++ b/configure.in @@ -580,7 +580,7 @@ else APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG APR_CHECK_PTHREAD_RECURSIVE_MUTEX AC_CHECK_FUNCS([pthread_key_delete pthread_rwlock_init \ - pthread_attr_setguardsize]) + pthread_attr_setguardsize pthread_yield]) if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then dnl ----------------------------- Checking for pthread_rwlock_t @@ -593,6 +593,12 @@ else AC_DEFINE(HAVE_PTHREAD_RWLOCKS, 1, [Define if pthread rwlocks are available]) fi fi + + if test "$ac_cv_func_pthread_yield" = "no"; then + dnl ----------------------------- Checking for sched_yield + AC_CHECK_HEADERS([sched.h]) + AC_CHECK_FUNCS([sched_yield]) + fi fi fi diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h index bb91ef7f75c..970b58ff4a8 100644 --- a/include/arch/unix/apr_arch_threadproc.h +++ b/include/arch/unix/apr_arch_threadproc.h @@ -39,6 +39,9 @@ #if APR_HAVE_STRING_H #include #endif +#if HAVE_SCHED_H +#include +#endif /* End System Headers */ diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index c32869c60cc..a6d671b9cd3 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -245,8 +245,15 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) } } -void apr_thread_yield() +APR_DECLARE(void) apr_thread_yield(void) { +#ifdef HAVE_PTHREAD_YIELD + pthread_yield(); +#else +#ifdef HAVE_SCHED_YIELD + sched_yield(); +#endif +#endif } APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, From f8af2735b28b171c6c64aada928bec7e67ce953d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 5 Jul 2006 01:24:47 +0000 Subject: [PATCH 5660/7878] Fix NT-specific svn-ignores git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@419130 13f79535-47bb-0310-9956-ffa450edef68 From 99f592ac198a678c55b426f21762d6790559d29b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 11 Jul 2006 14:12:29 +0000 Subject: [PATCH 5661/7878] * strings/apr_snprintf.c (apr_snprintf, apr_vsnprintf): Fix to returning number of bytes *without* NUL in overflow case. * test/teststr.c (snprintf_overflow): New test case. PR: 39996 Submitted by: Michal Luczaj git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@420858 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 4 ++-- test/teststr.c | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 0cfdad1f45c..c0510a38ba2 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -1360,7 +1360,7 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, if (len != 0) { *vbuff.curpos = '\0'; } - return (cc == -1) ? (int)len : cc; + return (cc == -1) ? (int)len - 1 : cc; } @@ -1383,5 +1383,5 @@ APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format, if (len != 0) { *vbuff.curpos = '\0'; } - return (cc == -1) ? (int)len : cc; + return (cc == -1) ? (int)len - 1 : cc; } diff --git a/test/teststr.c b/test/teststr.c index 3ed3133b63c..38cceb6f2e3 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -363,6 +363,26 @@ static void string_cpystrn(abts_case *tc, void *data) ABTS_TRUE(tc, ret[1] == 'Z'); } +static void snprintf_overflow(abts_case *tc, void *data) +{ + char buf[4]; + int rv; + + buf[2] = '4'; + buf[3] = '2'; + + rv = apr_snprintf(buf, 2, "%s", "a"); + ABTS_INT_EQUAL(tc, 1, rv); + + rv = apr_snprintf(buf, 2, "%s", "abcd"); + ABTS_INT_EQUAL(tc, 1, rv); + + ABTS_STR_EQUAL(tc, buf, "a"); + + /* Check the buffer really hasn't been overflowed. */ + ABTS_TRUE(tc, buf[2] == '4' && buf[3] == '2'); +} + abts_suite *teststr(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -379,6 +399,7 @@ abts_suite *teststr(abts_suite *suite) abts_run_test(suite, overflow_strfsize, NULL); abts_run_test(suite, string_strfsize, NULL); abts_run_test(suite, string_cpystrn, NULL); + abts_run_test(suite, snprintf_overflow, NULL); return suite; } From 4db6ae42f0b27822be03b5ee0d299ed0c8821857 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 11 Jul 2006 19:32:27 +0000 Subject: [PATCH 5662/7878] Fix up a warning with MS VC++ 8.0. Submitted by: John Mark Vandenberg Reviewed by: Bill Rowe, Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@420953 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.win b/test/Makefile.win index c1a352d21a2..35d7a172047 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -25,7 +25,7 @@ ALL: $(TARGETS) CL = cl.exe -CFLAGS = /nologo /c /MDd /W3 /Gm /GX /Zi /Od /D _DEBUG /D WIN32 /D APR_DECLARE_STATIC /FD +CFLAGS = /nologo /c /MDd /W3 /Gm /EHsc /Zi /Od /D _DEBUG /D WIN32 /D APR_DECLARE_STATIC /FD .c.obj:: $(CL) -c $< $(CFLAGS) $(INCLUDES) From dae54df03e1530337e67fbe27ece2fe17081ca51 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 11 Jul 2006 22:19:40 +0000 Subject: [PATCH 5663/7878] Allow configure to complete successfully on mingw. Originally titled: [patch 02/17] Windows library dependencies --- Windows symbols may a suffix of @. A new macro APR_CHECK_DLL_FUNC looks for a @ sign in the function name; when present it will verify a symbol exists with the correct argument count. Otherwise, APR_CHECK_DLL_FUNC falls back to emulating AC_CHECK_LIB. Enables native threads, locking, DSO loading and shared memory. --- Submitted by: John Mark Vandenberg Tweaked by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421013 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 3 +++ build/apr_win32.m4 | 33 +++++++++++++++++++++++++ configure.in | 60 +++++++++++++++++++++++++++++++++++++++------- 3 files changed, 87 insertions(+), 9 deletions(-) create mode 100644 build/apr_win32.m4 diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 5f313f53c80..6eb79794ef6 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -422,6 +422,9 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *cygwin*) APR_ADDTO(CPPFLAGS, [-DCYGWIN]) ;; + *mingw*) + APR_ADDTO(LDFLAGS, [-Wl,--enable-auto-import,--subsystem,console]) + ;; esac fi diff --git a/build/apr_win32.m4 b/build/apr_win32.m4 new file mode 100644 index 00000000000..f98137421a1 --- /dev/null +++ b/build/apr_win32.m4 @@ -0,0 +1,33 @@ + +dnl if $2 contains '@dd', links against mingw symbols +dnl otherwise calls AC_CHECK_LIB +AC_DEFUN([APR_CHECK_DLL_FUNC],[ +m4_define($1_function_name,m4_substr($2,0,m4_index($2,[@]))) +m4_define($1_function_arglength,m4_substr($2,m4_incr(m4_index($2,[@])))) +m4_define($1_[function_name]_arglength,m4_substr($2,m4_incr(m4_index($2,[@])))) +dnl m4_define(apr_check_dll_id,$1_m4_defn($1_function_name)) + +AC_CACHE_CHECK([for $2 in $1],[ac_cv_lib_$1_]$1_function_name,[ + +ac_func_search_save_LIBS=$LIBS +LIBS="$LIBS -l$1" + +AC_TRY_LINK([ +#pragma pack(1) +struct x { +]m4_for([byte_id], 1, m4_defn([$1_function_name_arglength]), 1,[[ char c]]byte_id; +)[}; +__stdcall ]$1_function_name[(]struct x[);],[ +struct x s = {0}; +]$1_function_name[(s)], +[ac_cv_lib_$1_]$1_function_name[=yes],[ac_cv_lib_$1_]$1_function_name[=no]) +LIBS=$ac_func_search_save_LIBS +])dnl AC_CACHE_CHECK + +AS_IF([test $ac_cv_lib_$1_]$1_function_name[ = yes], + [m4_default([$3], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1),,Enable if this library is available) + LIBS="-l$1 $LIBS" +])], + [$4])dnl +]) + diff --git a/configure.in b/configure.in index 045e9b63f08..cecbced9b6f 100644 --- a/configure.in +++ b/configure.in @@ -16,6 +16,7 @@ dnl sinclude(build/apr_common.m4) sinclude(build/apr_network.m4) sinclude(build/apr_threads.m4) +sinclude(build/apr_win32.m4) sinclude(build/apr_hints.m4) sinclude(build/libtool.m4) sinclude(build/ltsugar.m4) @@ -404,6 +405,12 @@ case $host in OSDIR="as400" eolstr="\\n" ;; + *mingw*) + OSDIR="win32" + enable_threads="system_threads" + eolstr="\\n" + OBJECTS_PLATFORM='$(OBJECTS_win32)' + ;; *cygwin*) OSDIR="unix" APR_ADDTO(CPPFLAGS,-DCYGWIN) @@ -520,12 +527,27 @@ dnl Note: Autoconf will always append LIBS with an extra " " in AC_CHECK_LIB. dnl It should check for LIBS being empty and set LIBS equal to the new value dnl without the extra " " in that case, but they didn't do that. So, we dnl end up LIBS="-lm -lcrypt -lnsl -ldl" which is an annoyance. -AC_SEARCH_LIBS(gethostbyname, nsl) -AC_SEARCH_LIBS(gethostname, nsl) -AC_SEARCH_LIBS(socket, socket) -AC_SEARCH_LIBS(crypt, crypt ufc) -AC_CHECK_LIB(truerand, main) -AC_SEARCH_LIBS(modf, m) +case $host in + *mingw*) + dnl APR_ADDTO(LIBS,[-lmsvcrt --lshell32 -ladvapi32 -lws2_32]) + + AC_CHECK_LIB(msvcrt, getpid) + APR_CHECK_DLL_FUNC(kernel32, SetErrorMode@4) + APR_CHECK_DLL_FUNC(advapi32, GetSecurityInfo@32) + APR_CHECK_DLL_FUNC(ws2_32, gethostbyname@4) + APR_CHECK_DLL_FUNC(shell32, CommandLineToArgvW@8) + APR_CHECK_DLL_FUNC(kernel32,[CreateFileMappingA@24], + [ac_cv_func_CreateFileMapping=$ac_cv_lib_kernel32_CreateFileMappingA]) + ;; + *) + AC_SEARCH_LIBS(gethostbyname, nsl) + AC_SEARCH_LIBS(gethostname, nsl) + AC_SEARCH_LIBS(socket, socket) + AC_SEARCH_LIBS(crypt, crypt ufc) + AC_CHECK_LIB(truerand, main) + AC_SEARCH_LIBS(modf, m) + ;; +esac dnl ----------------------------- Checking for Threads echo "${nl}Checking for Threads..." @@ -698,9 +720,10 @@ case $host in #endif";; esac -AC_CHECK_HEADERS([sys/types.h sys/mman.h sys/ipc.h sys/mutex.h sys/shm.h sys/file.h kernel/OS.h os2.h]) +AC_CHECK_HEADERS([sys/types.h sys/mman.h sys/ipc.h sys/mutex.h sys/shm.h sys/file.h kernel/OS.h os2.h windows.h]) AC_CHECK_FUNCS([mmap munmap shm_open shm_unlink shmget shmat shmdt shmctl \ create_area]) + APR_CHECK_DEFINE(MAP_ANON, sys/mman.h) APR_CHECK_FILE(/dev/zero) @@ -760,6 +783,10 @@ APR_IFALLYES(header:kernel/OS.h func:create_area, [havebeosshm="1" APR_DECIDE(USE_SHMEM_BEOS_ANON, [BeOS areas])]) +APR_IFALLYES(header:windows.h func:CreateFileMapping, + [havewin32shm="1" + APR_DECIDE(USE_SHMEM_WIN32_ANON, + [Windows CreateFileMapping()])]) case $host in *linux* ) # Linux has problems with MM_SHMT_MMANON even though it reports @@ -806,6 +833,7 @@ havemmapshm="0" haveshmget="0" havebeosarea="0" haveos2shm="0" +havewin32shm="0" APR_BEGIN_DECISION([namebased memory allocation method]) APR_IFALLYES(header:sys/mman.h func:mmap func:munmap, [havemmaptmp="1" @@ -826,6 +854,9 @@ APR_IFALLYES(header:kernel/OS.h func:create_area, APR_IFALLYES(header:os2.h, [haveos2shm="1" APR_DECIDE(USE_SHMEM_OS2, [OS/2 DosAllocSharedMem()])]) +APR_IFALLYES(header:windows.h, + [havewin32shm="1" + APR_DECIDE(USE_SHMEM_WIN32, [Windows shared memory])]) case $host in *linux* ) # Linux has problems with MM_SHMT_MMANON even though it reports @@ -846,6 +877,7 @@ usemmapshm="0" useshmget="0" usebeosarea="0" useos2shm="0" +usewin32shm="0" case $ac_decision in USE_SHMEM_MMAP_TMP ) @@ -863,10 +895,13 @@ case $ac_decision in USE_SHMEM_OS2 ) useos2shm="1" ;; + USE_SHMEM_WIN32 ) + usewin32shm="1" + ;; esac # Do we have any shared memory support? -if test "$usemmaptmp$usemmapshm$usemmapzero$useshmget$usemmapanon$usebeosarea$useos2shm" = "0000000"; then +if test "$usemmaptmp$usemmapshm$usemmapzero$useshmget$usemmapanon$usebeosarea$useos2shm$usewin32shm" = "00000000"; then sharedmem="0" else sharedmem="1" @@ -877,11 +912,13 @@ AC_SUBST(usemmapshm) AC_SUBST(useshmget) AC_SUBST(usebeosarea) AC_SUBST(useos2shm) +AC_SUBST(usewin32shm) AC_SUBST(havemmaptmp) AC_SUBST(havemmapshm) AC_SUBST(haveshmget) AC_SUBST(havebeosarea) AC_SUBST(haveos2shm) +AC_SUBST(havewin32shm) AC_SUBST(sharedmem) dnl ----------------------------- Checks for Any required Functions @@ -1462,7 +1499,7 @@ if test "$dsotype" = "any"; then # Everything else: if test "$dsotype" = "any"; then case $host in - *os390|*-os2*|*os400|*-aix*) dsotype=other ;; + *os390|*-os2*|*os400|*-aix*|*mingw*) dsotype=other ;; esac fi fi @@ -1658,6 +1695,11 @@ APR_IFALLYES(header:OS.h func:create_sem, if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) fi +case "$host" in + *mingw* ) + APR_DECISION_FORCE(win32) + ;; +esac APR_END_DECISION AC_DEFINE_UNQUOTED($ac_decision) From 9d2f21d4e78130f9a26476fada83210e25a0ced2 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 11 Jul 2006 23:50:48 +0000 Subject: [PATCH 5664/7878] Allow mingw to use make for Win32 builds. (make now does something on mingw, but it will need more patches to finish.) N.B. this determines what 'special' files we need to include for Win32 builds by looking at the libapr.dsp file we have locally. Originally titled: [patch 03/17] build conf Inspired by: John Mark Vandenberg git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421038 13f79535-47bb-0310-9956-ffa450edef68 --- build/gen-build.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/build/gen-build.py b/build/gen-build.py index 8582741de80..09161d6d734 100755 --- a/build/gen-build.py +++ b/build/gen-build.py @@ -20,7 +20,7 @@ # # legal platforms: aix, beos, netware, os2, os390, unix, win32 -# 'make' users: aix, beos, os2, os390, unix +# 'make' users: aix, beos, os2, os390, unix, win32 (mingw) # PLATFORMS = [ 'aix', 'beos', 'netware', 'os2', 'os390', 'unix', 'win32' ] MAKE_PLATFORMS = [ @@ -29,6 +29,7 @@ ('beos', 'unix'), ('os2', 'unix'), ('os390', 'unix'), + ('win32', 'unix'), ] # note: MAKE_PLATFORMS is an ordered set. we want to generate unix symbols # first, so that the later platforms can reference them. @@ -65,6 +66,25 @@ def main(): # record the object symbols to build for each platform group = [ '$(OBJECTS_all)' ] + # If we're doing win32, we're going to look in the libapr.dsp file + # for those files that we have to manually add to our list. + inherit_parent = { } + if platform == 'win32': + for line in open('libapr.dsp').readlines(): + if line[:7] != 'SOURCE=': + continue + if line[7:].find('unix') != -1: + # skip the leading .\ and split it out + inherit_files = line[9:].strip().split('\\') + # change the .c to .lo + assert inherit_files[-1][-2:] == '.c' + inherit_files[-1] = inherit_files[-1][:-2] + '.lo' + # replace the \\'s with /'s + inherit_line = '/'.join(inherit_files) + if not inherit_parent.has_key(inherit_files[0]): + inherit_parent[inherit_files[0]] = [] + inherit_parent[inherit_files[0]].append(inherit_line) + for subdir in string.split(parser.get('options', 'platform_dirs')): path = '%s/%s' % (subdir, platform) if not os.path.exists(path): @@ -81,6 +101,9 @@ def main(): files = get_files(path + '/*.c') objects, _unused = write_objects(f, legal_deps, h_deps, files) + if inherit_parent.has_key(subdir): + objects = objects + inherit_parent[subdir] + symname = 'OBJECTS_%s_%s' % (subdir, platform) # and write the symbol for the whole group From e78a8e5bc48bd333e534431d1bb333955aee59df Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Jul 2006 01:07:40 +0000 Subject: [PATCH 5665/7878] Set up apr.h and apr_private.h so that mingw can compile. Originally titled: [patch 05/17] win32api support Inspired by: John Mark Vandenberg git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421063 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 14 ++++++++++++++ include/apr.h.in | 10 ++++++++++ 2 files changed, 24 insertions(+) diff --git a/configure.in b/configure.in index cecbced9b6f..e5753f39d2b 100644 --- a/configure.in +++ b/configure.in @@ -1053,6 +1053,8 @@ APR_FLAG_HEADERS( tpfio.h \ unistd.h \ unix.h \ + windows.h \ + winsock2.h \ arpa/inet.h \ kernel/OS.h \ net/errno.h \ @@ -1131,6 +1133,8 @@ AC_SUBST(signalh) AC_SUBST(sys_waith) AC_SUBST(pthreadh) AC_SUBST(semaphoreh) +AC_SUBST(windowsh) +AC_SUBST(winsock2h) # Checking for h_errno in if test "$netdbh" = "1"; then @@ -2160,6 +2164,15 @@ for i in $APR_SAVE_HEADERS; do rm -f $i.save done chmod +x apr-$APR_MAJOR_VERSION-config +# for mingw builds, we currently won't allow the unix apr_private.h to exist. +# instead, we will rely on the manually-crafted win32 apr_private.h instead. +case $APR_PLATFORM in + *-mingw*) + rm include/arch/unix/apr_private.h + ;; + *) + ;; +esac ],[ dnl This section is expanded by configure UNQUOTED so variable dnl references must be backslash-escaped as necessary. @@ -2167,6 +2180,7 @@ dnl references must be backslash-escaped as necessary. # Commands run at the beginning of config.status: APR_SAVE_HEADERS="include/apr.h include/arch/unix/apr_private.h" APR_MAJOR_VERSION=$APR_MAJOR_VERSION +APR_PLATFORM=$host for apri in \${APR_SAVE_HEADERS}; do test -r \${apri} && mv \${apri} \${apri}.save diff --git a/include/apr.h.in b/include/apr.h.in index cf7b97d5a0b..f28c908e3ef 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -102,6 +102,8 @@ #define APR_HAVE_SYS_WAIT_H @sys_waith@ #define APR_HAVE_TIME_H @timeh@ #define APR_HAVE_UNISTD_H @unistdh@ +#define APR_HAVE_WINDOWS_H @windowsh@ +#define APR_HAVE_WINSOCK2_H @winsock2h@ /** @} */ @@ -109,6 +111,14 @@ * or the extern "C" namespace */ +#if APR_HAVE_WINDOWS_H +#include +#endif + +#if APR_HAVE_WINSOCK2_H +#include +#endif + #if APR_HAVE_SYS_TYPES_H #include #endif From 7871d2ea8d05c12ed6541dc9eb78eda81ab80507 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Jul 2006 01:39:56 +0000 Subject: [PATCH 5666/7878] Move the autoconf check for type 'in_addr' into a macro, and improve it to work for Windows as well. Originally titled: [patch 11/17] struct in_addr Submitted by: John Mark Vandenberg Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421071 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 23 +++++++++++++++++++++++ configure.in | 17 ++++++----------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 6d1c525ce9f..b7a20e5b4d7 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -17,6 +17,29 @@ dnl ----------------------------------------------------------------- dnl apr_network.m4: APR's autoconf macros for testing network support dnl +dnl +dnl check for type in_addr +dnl +AC_DEFUN(APR_TYPE_IN_ADDR,[ + AC_CACHE_CHECK(for type in_addr, ac_cv_type_in_addr,[ + AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +],[ + struct in_addr arg; + arg.s_addr = htonl(INADDR_ANY); +], [ ac_cv_type_in_addr="yes"] , [ +ac_cv_type_in_addr="no"]) +]) +]) + dnl dnl check for working getaddrinfo() dnl diff --git a/configure.in b/configure.in index e5753f39d2b..fe2a831ce7d 100644 --- a/configure.in +++ b/configure.in @@ -1930,17 +1930,12 @@ AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.__tm_gmtoff],,,[ dnl ----------------------------- Checking for Networking Support echo "${nl}Checking for Networking support..." -AC_MSG_CHECKING(for in_addr in netinet/in.h) -AC_TRY_COMPILE([ -#include -#include -],[ -struct in_addr arg; -arg.s_addr = htonl(INADDR_ANY); -], [ have_in_addr="1" -msg=yes ] , [ have_in_addr="0" -msg=no ]) -AC_MSG_RESULT([$msg]) +APR_TYPE_IN_ADDR +if test "$ac_cv_type_in_addr" = "yes"; then + have_in_addr="1" +else + have_in_addr="0" +fi AC_MSG_CHECKING([if fd == socket on this platform]) if test "x$file_as_socket" != "x0" ; then From 890fd381a7ba5586600afb48e4dd16a20105933e Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Jul 2006 02:04:17 +0000 Subject: [PATCH 5667/7878] Allow APR_CHECK_SIZEOF_EXTENDED to be called with a space in the argument. (Justin has no idea what those P's did, but this usage makes more sense.) Submitted by: John Mark Vandenberg Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421074 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 9c169d98871..7fa32b41fa9 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -446,9 +446,9 @@ dnl AC_DEFUN([APR_CHECK_SIZEOF_EXTENDED], [changequote(<<,>>)dnl dnl The name to #define -define(<>, translit(sizeof_$2, [a-z *], [A-Z_P]))dnl +define(<>, translit(sizeof_$2, [a-z ], [A-Z_]))dnl dnl The cache variable -define(<>, translit(ac_cv_sizeof_$2, [ *],[

    ]))dnl +define(<>, translit(ac_cv_sizeof_$2, [A-Z ],[a-z_]))dnl changequote([, ])dnl AC_MSG_CHECKING(size of $2) AC_CACHE_VAL(AC_CV_NAME, From 5309d481140ca368c484bb7cd51ce8fc0da291e6 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Jul 2006 02:09:05 +0000 Subject: [PATCH 5668/7878] Define struct iovec for mingw. This patch also moves the iovec 'workaround' from apr.hw into apr_want.h too. Originally titled: [patch 09/17] struct iovec Submitted by: John Mark Vandenberg Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421075 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 8 ++++++++ include/apr.h.in | 1 + include/apr.hw | 5 +---- include/apr_want.h | 18 ++++++++++++++++++ 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index fe2a831ce7d..2356acdb2b1 100644 --- a/configure.in +++ b/configure.in @@ -1406,6 +1406,13 @@ case $host in ;; esac +APR_CHECK_SIZEOF_EXTENDED([#include ],struct iovec,0) +if test "$ac_cv_sizeof_struct_iovec" = "0"; then + have_iovec=0 +else + have_iovec=1 +fi + AC_SUBST(voidp_size) AC_SUBST(short_value) AC_SUBST(int_value) @@ -1427,6 +1434,7 @@ AC_SUBST(uint64_literal) AC_SUBST(stdint) AC_SUBST(bigendian) AC_SUBST(aprlfs) +AC_SUBST(have_iovec) dnl ----------------------------- Checking for string functions AC_CHECK_FUNCS(strnicmp, have_strnicmp="1", have_strnicmp="0") diff --git a/include/apr.h.in b/include/apr.h.in index f28c908e3ef..38ab2aef19e 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -220,6 +220,7 @@ extern "C" { #define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@ #define APR_HAVE_UNION_SEMUN @have_union_semun@ #define APR_HAVE_SCTP @have_sctp@ +#define APR_HAVE_IOVEC @have_iovec@ /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY @sharedmem@ diff --git a/include/apr.hw b/include/apr.hw index b27b5e2bba9..3a33ad177df 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -487,10 +487,7 @@ typedef int gid_t; typedef int apr_wait_t; /* struct iovec is needed to emulate Unix writev */ -struct iovec { - char* iov_base; - apr_size_t iov_len; -}; +#define APR_HAVE_IOVEC 0 /* Nasty Win32 .h ommissions we really need */ #define STDIN_FILENO 0 diff --git a/include/apr_want.h b/include/apr_want.h index c7556a79262..b0da0a0c938 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -81,10 +81,28 @@ #ifdef APR_WANT_IOVEC +#if APR_HAVE_IOVEC + #if APR_HAVE_SYS_UIO_H #include #endif +#else + +struct iovec +{ + char *iov_base; + int iov_len; +}; + +#endif + +/* apr_want is included at several layers; redefining APR_HAVE_IOVEC + * now to ensure that our struct is not introduced several times. + */ +#undef APR_HAVE_IOVEC +#define APR_HAVE_IOVEC 1 + #undef APR_WANT_IOVEC #endif From 86ed5adea14d385854feabb419364984978cef97 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Jul 2006 02:52:28 +0000 Subject: [PATCH 5669/7878] Remove duplicate definition of apr_wchar_t. Originally titled: [patch 12/17] redefinition of apr_uint16_t Submitted by: John Mark Vandenberg Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421090 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_file_io.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index 57a4a61c751..c31f2f62169 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -52,8 +52,6 @@ #include "arch/win32/apr_arch_utf8.h" #include -typedef apr_uint16_t apr_wchar_t; - /* Helper functions for the WinNT ApiW() functions. APR treats all * resource identifiers (files, etc) by their UTF-8 name, to provide * access to all named identifiers. [UTF-8 completely maps Unicode From 5ac888735fdb6e5baf79a2adf7b9139e085a9a57 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Jul 2006 02:55:26 +0000 Subject: [PATCH 5670/7878] Allow mingw to have access to the Win32 'unicode' FS system. Originally titled: [patch 06/17] Win32 unicode filesystem Submitted by: John Mark Vandenberg Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421094 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 11 +++++++++++ include/apr.h.in | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 2356acdb2b1..8a0af99b399 100644 --- a/configure.in +++ b/configure.in @@ -2084,6 +2084,17 @@ dnl Check for langinfo support AC_CHECK_HEADERS(langinfo.h) AC_CHECK_FUNCS(nl_langinfo) +dnl Do we have a Win32-centric Unicode FS? + +have_unicode_fs="0" +case "$host" in + *mingw* ) + have_unicode_fs="1" + ;; +esac + +AC_SUBST(have_unicode_fs) + dnl ----------------------------- Finalize the variables echo "${nl}Restore user-defined environment settings..." diff --git a/include/apr.h.in b/include/apr.h.in index 38ab2aef19e..db6ffb46b25 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -232,7 +232,7 @@ extern "C" { #define APR_HAS_OTHER_CHILD @oc@ #define APR_HAS_DSO @aprdso@ #define APR_HAS_SO_ACCEPTFILTER @acceptfilter@ -#define APR_HAS_UNICODE_FS 0 +#define APR_HAS_UNICODE_FS @have_unicode_fs@ #define APR_HAS_PROC_INVOKED 0 #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES @aprlfs@ From cd1b4027b5c6b69c398050130f528785796adb85 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 12 Jul 2006 14:10:25 +0000 Subject: [PATCH 5671/7878] * build/gen-build.py: Make location of DSP file configurable and its use optional (hopefully fixes apr-util build). * build.conf: Define DSP file location. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421276 13f79535-47bb-0310-9956-ffa450edef68 --- build.conf | 2 ++ build/gen-build.py | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/build.conf b/build.conf index 0522a1bb783..36121883f58 100644 --- a/build.conf +++ b/build.conf @@ -24,3 +24,5 @@ headers = include/*.h # we have a recursive makefile for the test files (for now) # test/*.c + +dsp = libapr.dsp diff --git a/build/gen-build.py b/build/gen-build.py index 09161d6d734..2d127185c4f 100755 --- a/build/gen-build.py +++ b/build/gen-build.py @@ -39,6 +39,11 @@ def main(): parser = ConfigParser.ConfigParser() parser.read('build.conf') + if parser.has_option('options', 'dsp'): + dsp_file = parser.get('options', 'dsp') + else: + dsp_file = None + headers = get_files(parser.get('options', 'headers')) # compute the relevant headers, along with the implied includes @@ -69,8 +74,8 @@ def main(): # If we're doing win32, we're going to look in the libapr.dsp file # for those files that we have to manually add to our list. inherit_parent = { } - if platform == 'win32': - for line in open('libapr.dsp').readlines(): + if platform == 'win32' and dsp_file: + for line in open(dsp_file).readlines(): if line[:7] != 'SOURCE=': continue if line[7:].find('unix') != -1: From 40eab5b255c326a8c28950ecfe7b11b608036510 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 12 Jul 2006 17:32:08 +0000 Subject: [PATCH 5672/7878] Add APR_HAVE_IOVEC to the NetWare apr.h header git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421333 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr.hnw b/include/apr.hnw index ebd6ef7a52c..a9011dc1371 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -193,6 +193,7 @@ extern "C" { #define APR_HAVE_STRUCT_RLIMIT 0 #define APR_HAVE_UNION_SEMUN 0 #define APR_HAVE_SCTP 0 +#define APR_HAVE_IOVEC 1 /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY 0 From 2dad3d133dfddcb19541a248f318a4bc6c041e48 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Jul 2006 17:52:33 +0000 Subject: [PATCH 5673/7878] Fix up Win32-private includes to bring it in line with all other platforms. Originally titled: [patch 10/17] include path prefix win32/ Submitted by: John Mark Vandenberg Reviewed by: Will Rowe (concept), Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421349 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/buffer.c | 4 ++-- file_io/win32/filedup.c | 2 +- file_io/win32/pipe.c | 2 +- file_io/win32/readwrite.c | 2 +- file_io/win32/seek.c | 2 +- locks/win32/thread_cond.c | 4 ++-- locks/win32/thread_rwlock.c | 2 +- threadproc/win32/proc.c | 4 ++-- threadproc/win32/signals.c | 4 ++-- threadproc/win32/thread.c | 2 +- threadproc/win32/threadpriv.c | 2 +- time/win32/access.c | 2 +- time/win32/time.c | 2 +- time/win32/timestr.c | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/file_io/win32/buffer.c b/file_io/win32/buffer.c index e4ff676f7f0..2e56b9933d3 100644 --- a/file_io/win32/buffer.c +++ b/file_io/win32/buffer.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "win32/apr_arch_file_io.h" +#include "apr_arch_file_io.h" #include "apr_thread_mutex.h" APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, @@ -56,4 +56,4 @@ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, APR_DECLARE(apr_size_t) apr_file_buffer_size_get(apr_file_t *file) { return file->bufsize; -} \ No newline at end of file +} diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 9cac74d475b..e576d85baf4 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "win32/apr_arch_file_io.h" +#include "apr_arch_file_io.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_strings.h" diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 1e940f20e83..a080770d5e3 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "win32/apr_arch_file_io.h" +#include "apr_arch_file_io.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_strings.h" diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index ea85aae4b17..2f8ba9ecefc 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "win32/apr_arch_file_io.h" +#include "apr_arch_file_io.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_strings.h" diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index dc25037c694..a9ac5f5d90e 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "win32/apr_arch_file_io.h" +#include "apr_arch_file_io.h" #include "apr_file_io.h" #include #include diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index 483f3300e62..8e8b5b52408 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -18,8 +18,8 @@ #include "apr_private.h" #include "apr_general.h" #include "apr_strings.h" -#include "win32/apr_arch_thread_mutex.h" -#include "win32/apr_arch_thread_cond.h" +#include "apr_arch_thread_mutex.h" +#include "apr_arch_thread_cond.h" #include "apr_portable.h" static apr_status_t thread_cond_cleanup(void *data) diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c index 9207d792904..2e4ec62b802 100644 --- a/locks/win32/thread_rwlock.c +++ b/locks/win32/thread_rwlock.c @@ -18,7 +18,7 @@ #include "apr_private.h" #include "apr_general.h" #include "apr_strings.h" -#include "win32/apr_arch_thread_rwlock.h" +#include "apr_arch_thread_rwlock.h" #include "apr_portable.h" static apr_status_t thread_rwlock_cleanup(void *data) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 63d7e9cc57d..49290735a10 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "win32/apr_arch_threadproc.h" -#include "win32/apr_arch_file_io.h" +#include "apr_arch_threadproc.h" +#include "apr_arch_file_io.h" #include "apr_thread_proc.h" #include "apr_file_io.h" diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index d4d8a640265..a51cf7e258e 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "win32/apr_arch_threadproc.h" -#include "win32/apr_arch_file_io.h" +#include "apr_arch_threadproc.h" +#include "apr_arch_file_io.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_general.h" diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 09c53c3eb29..61e5d8084ed 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -15,7 +15,7 @@ */ #include "apr_private.h" -#include "win32/apr_arch_threadproc.h" +#include "apr_arch_threadproc.h" #include "apr_thread_proc.h" #include "apr_general.h" #include "apr_lib.h" diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 0d45b0da23d..d99a3e9b6a4 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "win32/apr_arch_threadproc.h" +#include "apr_arch_threadproc.h" #include "apr_thread_proc.h" #include "apr_general.h" #include "apr_lib.h" diff --git a/time/win32/access.c b/time/win32/access.c index e746fca1f6f..a4c96efd10b 100644 --- a/time/win32/access.c +++ b/time/win32/access.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "win32/apr_arch_atime.h" +#include "apr_arch_atime.h" #include "apr_time.h" #include "apr_general.h" #include "apr_lib.h" diff --git a/time/win32/time.c b/time/win32/time.c index 89d6d5e4008..3209f470ae5 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "win32/apr_arch_atime.h" +#include "apr_arch_atime.h" #include "apr_time.h" #include "apr_general.h" #include "apr_lib.h" diff --git a/time/win32/timestr.c b/time/win32/timestr.c index ce96c867e7d..a533a0aea10 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "win32/apr_arch_atime.h" +#include "apr_arch_atime.h" #include "apr_portable.h" #include "apr_strings.h" From da156b265ae1fb0772e87d80b574517bf0d80834 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Jul 2006 19:05:51 +0000 Subject: [PATCH 5674/7878] Protect usage of MS VC++ crtdbg.h functionality. Originally titled: [patch 14/17] crtdbg.h Submitted by: John Mark Vandenberg Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421373 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_misc.h | 31 ++++++++++++++++++++++++++++++ misc/win32/apr_app.c | 5 ++--- misc/win32/internal.c | 13 ++++++------- misc/win32/misc.c | 1 - misc/win32/start.c | 17 ++++++++-------- 5 files changed, 47 insertions(+), 20 deletions(-) diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index 2e032e8a624..6ecbfd4018c 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -138,6 +138,37 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *); #define ELSE_WIN_OS_IS_ANSI #endif /* WINNT */ +#if defined(_MSC_VER) +#include "crtdbg.h" + +APR_INLINE void* apr_malloc_dbg(size_t size, const char* filename, + int linenumber) +{ + return _malloc_dbg(size, _CRT_BLOCK, filename, linenumber); +} + +APR_INLINE void* apr_realloc_dbg(void* userData, size_t newSize, + const char* filename, int linenumber) +{ + return _realloc_dbg(userData, newSize, _CRT_BLOCK, filename, linenumber); +} + +#else + +APR_INLINE void* apr_malloc_dbg(size_t size, const char* filename, + int linenumber) +{ + return malloc(size); +} + +APR_INLINE void* apr_realloc_dbg(void* userData, size_t newSize, + const char* filename, int linenumber) +{ + return realloc(userData, newSize); +} + +#endif /* ! _MSC_VER */ + typedef enum { DLL_WINBASEAPI = 0, // kernel32 From WinBase.h DLL_WINADVAPI = 1, // advapi32 From WinBase.h diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index eb76df35a33..712ac793e4f 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -35,7 +35,6 @@ #include "apr_general.h" #include "ShellAPI.h" -#include "crtdbg.h" #include "wchar.h" #include "apr_arch_file_io.h" #include "assert.h" @@ -57,8 +56,8 @@ int wmain(int argc, const wchar_t **wargv, const wchar_t **wenv) dupenv = apr_wastrtoastr(&env, wenv, -1); - _environ = _malloc_dbg((dupenv + 1) * sizeof (char *), - _CRT_BLOCK, __FILE__, __LINE__ ); + _environ = apr_malloc_dbg((dupenv + 1) * sizeof (char *), + __FILE__, __LINE__ ); memcpy(_environ, env, (dupenv + 1) * sizeof (char *)); /* MSVCRT will attempt to maintain the wide environment calls diff --git a/misc/win32/internal.c b/misc/win32/internal.c index 239011264df..9d73d917c39 100644 --- a/misc/win32/internal.c +++ b/misc/win32/internal.c @@ -18,7 +18,6 @@ #include "apr_arch_misc.h" #include "apr_arch_file_io.h" -#include #include /* This module is the source of -static- helper functions that are @@ -52,8 +51,8 @@ int apr_wastrtoastr(char const * const * *retarr, ; } - newarr = _malloc_dbg((args + 1) * sizeof(char *), - _CRT_BLOCK, __FILE__, __LINE__); + newarr = apr_malloc_dbg((args + 1) * sizeof(char *), + __FILE__, __LINE__); for (arg = 0; arg < args; ++arg) { newarr[arg] = (void*)(wcslen(arr[arg]) + 1); @@ -66,8 +65,8 @@ int apr_wastrtoastr(char const * const * *retarr, * 4 ucs bytes will hold a wchar_t pair value (20 bits) */ elesize = elesize * 3 + 1; - ele = elements = _malloc_dbg(elesize * sizeof(char), - _CRT_BLOCK, __FILE__, __LINE__); + ele = elements = apr_malloc_dbg(elesize * sizeof(char), + __FILE__, __LINE__); for (arg = 0; arg < args; ++arg) { apr_size_t len = (apr_size_t)newarr[arg]; @@ -87,8 +86,8 @@ int apr_wastrtoastr(char const * const * *retarr, /* Return to the free store if the heap realloc is the least bit optimized */ - ele = _realloc_dbg(elements, ele - elements, - _CRT_BLOCK, __FILE__, __LINE__); + ele = apr_realloc_dbg(elements, ele - elements, + __FILE__, __LINE__); if (ele != elements) { apr_size_t diff = ele - elements; diff --git a/misc/win32/misc.c b/misc/win32/misc.c index eaf896a285a..815a67d033c 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -16,7 +16,6 @@ #include "apr_private.h" #include "apr_arch_misc.h" -#include "crtdbg.h" #include "apr_arch_file_io.h" #include "assert.h" #include "apr_lib.h" diff --git a/misc/win32/start.c b/misc/win32/start.c index be43f54e3c6..01da8581754 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -23,7 +23,6 @@ #include "apr_arch_misc.h" /* for WSAHighByte / WSALowByte */ #include "wchar.h" #include "apr_arch_file_io.h" -#include "crtdbg.h" #include "assert.h" /* This symbol is _private_, although it must be exported. @@ -54,8 +53,8 @@ static int warrsztoastr(const char * const * *retarr, } wsize = 1 + wch - arrsz; - newarr = _malloc_dbg((args + 1) * sizeof(char *), - _CRT_BLOCK, __FILE__, __LINE__); + newarr = apr_malloc_dbg((args + 1) * sizeof(char *), + __FILE__, __LINE__); /* This is a safe max allocation, we will realloc after * processing and return the excess to the free store. @@ -63,8 +62,8 @@ static int warrsztoastr(const char * const * *retarr, * 4 ucs bytes will hold a wchar_t pair value (20 bits) */ newlen = totlen = wsize * 3 + 1; - newarr[0] = _malloc_dbg(newlen * sizeof(char), - _CRT_BLOCK, __FILE__, __LINE__); + newarr[0] = apr_malloc_dbg(newlen * sizeof(char), + __FILE__, __LINE__); (void)apr_conv_ucs2_to_utf8(arrsz, &wsize, newarr[0], &newlen); @@ -72,8 +71,8 @@ static int warrsztoastr(const char * const * *retarr, assert(newlen && !wsize); /* Return to the free store if the heap realloc is the least bit optimized */ - newarr[0] = _realloc_dbg(newarr[0], totlen - newlen, - _CRT_BLOCK, __FILE__, __LINE__); + newarr[0] = apr_realloc_dbg(newarr[0], totlen - newlen, + __FILE__, __LINE__); for (arg = 1; arg < args; ++arg) { newarr[arg] = newarr[arg - 1] + 2; @@ -128,8 +127,8 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, dupenv = warrsztoastr(&_environ, sysstr, -1); if (env) { - *env = _malloc_dbg((dupenv + 1) * sizeof (char *), - _CRT_BLOCK, __FILE__, __LINE__ ); + *env = apr_malloc_dbg((dupenv + 1) * sizeof (char *), + __FILE__, __LINE__ ); memcpy((void*)*env, _environ, (dupenv + 1) * sizeof (char *)); } else { From 416f8eb5b81f675e2f1823504915e19602c382c8 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 12 Jul 2006 19:24:40 +0000 Subject: [PATCH 5675/7878] Do not support multicast on Win32 unless we're using MSVC++ as mingw apparently doesn't define ip_mreq in its Winsock headers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421381 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_networkio.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/arch/win32/apr_arch_networkio.h b/include/arch/win32/apr_arch_networkio.h index e58b1d65a73..a180ccf7c1d 100644 --- a/include/arch/win32/apr_arch_networkio.h +++ b/include/arch/win32/apr_arch_networkio.h @@ -64,9 +64,10 @@ typedef struct _WSABUF { } WSABUF, FAR * LPWSABUF; #endif #else -/* Not sure if this is the right place to define this */ +#ifdef _MSC_VER #define HAVE_STRUCT_IPMREQ #endif +#endif apr_status_t status_from_res_error(int); From a71fc2867c30ed6551b8d514357d0e237a6558fc Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 13 Jul 2006 08:17:33 +0000 Subject: [PATCH 5676/7878] Move some of the mingw-specific checks into the hints m4 file instead. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421539 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 ++ configure.in | 14 +++----------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 6eb79794ef6..7a69c42a05d 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -424,6 +424,8 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *mingw*) APR_ADDTO(LDFLAGS, [-Wl,--enable-auto-import,--subsystem,console]) + APR_SETIFNULL(apr_lock_method, [win32]) + APR_SETIFNULL(have_unicode_fs, [1]) ;; esac diff --git a/configure.in b/configure.in index 8a0af99b399..07a68c3e714 100644 --- a/configure.in +++ b/configure.in @@ -1707,11 +1707,6 @@ APR_IFALLYES(header:OS.h func:create_sem, if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) fi -case "$host" in - *mingw* ) - APR_DECISION_FORCE(win32) - ;; -esac APR_END_DECISION AC_DEFINE_UNQUOTED($ac_decision) @@ -2086,12 +2081,9 @@ AC_CHECK_FUNCS(nl_langinfo) dnl Do we have a Win32-centric Unicode FS? -have_unicode_fs="0" -case "$host" in - *mingw* ) - have_unicode_fs="1" - ;; -esac +if test -z "$have_unicode_fs"; then + have_unicode_fs="0" +fi AC_SUBST(have_unicode_fs) From e6fbb9acf3561dafdec32bfc6593d03e0f8f9771 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 13 Jul 2006 08:19:05 +0000 Subject: [PATCH 5677/7878] Allow APR_HAS_PROC_INVOKED to be overriden for mingw by autoconf. Originally titled: [patch 15/17] APR_HAS_PROC_INVOKED Submitted by: John Vandenberg Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421540 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 1 + configure.in | 6 ++++++ include/apr.h.in | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 7a69c42a05d..e81a477ee4b 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -426,6 +426,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(LDFLAGS, [-Wl,--enable-auto-import,--subsystem,console]) APR_SETIFNULL(apr_lock_method, [win32]) APR_SETIFNULL(have_unicode_fs, [1]) + APR_SETIFNULL(have_proc_invoked, [1]) ;; esac diff --git a/configure.in b/configure.in index 07a68c3e714..97b06678513 100644 --- a/configure.in +++ b/configure.in @@ -1550,6 +1550,12 @@ AC_ARG_ENABLE(other-child, AC_SUBST(oc) +if test -z "$have_proc_invoked"; then + have_proc_invoked="0" +fi + +AC_SUBST(have_proc_invoked) + AC_MSG_CHECKING(for Variable Length Arrays) APR_TRY_COMPILE_NO_WARNING([], [ diff --git a/include/apr.h.in b/include/apr.h.in index db6ffb46b25..eb7dc5f966c 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -233,7 +233,7 @@ extern "C" { #define APR_HAS_DSO @aprdso@ #define APR_HAS_SO_ACCEPTFILTER @acceptfilter@ #define APR_HAS_UNICODE_FS @have_unicode_fs@ -#define APR_HAS_PROC_INVOKED 0 +#define APR_HAS_PROC_INVOKED @have_proc_invoked@ #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES @aprlfs@ #define APR_HAS_XTHREAD_FILES 0 From 68b531f4b31022ae6f211e3bd962f36a8ada2d51 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 14 Jul 2006 03:02:09 +0000 Subject: [PATCH 5678/7878] Allow jlibtool to compile and link on mingw. The notable bits here are: - mingw doesn't have fork() or waitpid() - mkdir() doesn't take the umask parameter - The MSVCRT runtime is 'safe' and reparses anything that isn't separated with a double-quote; so add quotes around our escaped statement to run. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421786 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index 7266b0919a8..0d577a459b4 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -19,7 +19,9 @@ #include #include #include +#if !defined(__MINGW32__) #include +#endif #include #include #include @@ -145,6 +147,21 @@ # define LD_LIBRARY_PATH "LD_LIBRARY_PATH" #endif +#if defined(__MINGW32__) +# define SHELL_CMD "sh" +# define DYNAMIC_LIB_EXT "dll" +# define MODULE_LIB_EXT "dll" +# define STATIC_LIB_EXT "a" +# define OBJECT_EXT "o" +# define LIBRARIAN "ar" +# define LIBRARIAN_OPTS "cr" +# define RANLIB "ranlib" +# define LINKER_FLAG_PREFIX "-Wl," +# define SHARED_OPTS "-shared" +# define MODULE_OPTS "-shared" +# define MKDIR_NO_UMASK +#endif + #ifndef SHELL_CMD #error Unsupported platform: Please add defines for SHELL_CMD etc. for your platform. #endif @@ -375,10 +392,14 @@ char *shell_esc(const char *str) unsigned char *d; const unsigned char *s; - cmd = (char *)malloc(2 * strlen(str) + 1); + cmd = (char *)malloc(2 * strlen(str) + 3); d = (unsigned char *)cmd; s = (const unsigned char *)str; +#ifdef __MINGW32__ + *d++ = '\"'; +#endif + for (; *s; ++s) { if (*s == '"') { *d++ = '\\'; @@ -390,6 +411,10 @@ char *shell_esc(const char *str) *d++ = *s; } +#ifdef __MINGW32__ + *d++ = '\"'; +#endif + *d = '\0'; return cmd; } @@ -409,8 +434,8 @@ int external_spawn(command_t *cmd, const char *file, const char **argv) if (cmd->options.dry_run) { return 0; } -#ifdef __EMX__ - return spawnvp(P_WAIT, file, argv); +#if defined(__EMX__) || defined(__MINGW32__) + return spawnvp(P_WAIT, argv[0], argv); #else { pid_t pid; @@ -1380,7 +1405,11 @@ int explode_static_lib(const char *lib, command_t *cmd_data) strcpy(tmpdir, lib); strcat(tmpdir, ".exploded"); +#ifdef MKDIR_NO_UMASK + mkdir(tmpdir); +#else mkdir(tmpdir, 0); +#endif push_count_chars(cmd_data->tmp_dirs, strdup(tmpdir)); getcwd(savewd, sizeof(savewd)); @@ -1721,7 +1750,11 @@ int run_mode(command_t *cmd_data) old_umask = umask(0); umask(old_umask); +#ifdef MKDIR_NO_UMASK + mkdir(".libs"); +#else mkdir(".libs", ~old_umask); +#endif } if (cmd_data->output == otStaticLibraryOnly || From c48ecfd7775279441578042962b01268cd17a6e7 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 14 Jul 2006 04:20:33 +0000 Subject: [PATCH 5679/7878] Enable LFS on mingw. (Tweaked based on a suggestion from Joe Orton.) Originally titled: [patch 07/17] Win32 LFS Submitted by: John Vandenberg Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421800 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index e81a477ee4b..25732c182ee 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -427,6 +427,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(apr_lock_method, [win32]) APR_SETIFNULL(have_unicode_fs, [1]) APR_SETIFNULL(have_proc_invoked, [1]) + APR_SETIFNULL(apr_cv_use_lfs64, [yes]) ;; esac From 1eeba975feb6760ae5694050c9a5e901c8a0a693 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 14 Jul 2006 04:45:22 +0000 Subject: [PATCH 5680/7878] Link to librpcrt4.a. Rearrange header ordering in rand.c to ensure that the link decorations are imported correctly. Originally titled: [patch 17/17] Uuid Submitted by: John Vandenberg Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421805 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + misc/win32/rand.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 97b06678513..a5ba73fc4a1 100644 --- a/configure.in +++ b/configure.in @@ -538,6 +538,7 @@ case $host in APR_CHECK_DLL_FUNC(shell32, CommandLineToArgvW@8) APR_CHECK_DLL_FUNC(kernel32,[CreateFileMappingA@24], [ac_cv_func_CreateFileMapping=$ac_cv_lib_kernel32_CreateFileMappingA]) + APR_CHECK_DLL_FUNC(rpcrt4,[UuidCreate@4]) ;; *) AC_SEARCH_LIBS(gethostbyname, nsl) diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 1dd5d4f841b..c7a469f8fc3 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -14,12 +14,13 @@ * limitations under the License. */ +#include +#include #include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_portable.h" #include "apr_arch_misc.h" -#include APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, From 6193555be3abaf1f3647feb910cb51b3ba603e67 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 14 Jul 2006 05:32:58 +0000 Subject: [PATCH 5681/7878] Fix up Win32 private headers to use APR_INLINE consistently; use static inline declarations for those appearing in the header file. Originally titled: [patch 13/17] APR_INLINE Submitted by: John Vandenberg Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421810 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_atime.h | 4 ++-- include/arch/win32/apr_arch_misc.h | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/arch/win32/apr_arch_atime.h b/include/arch/win32/apr_arch_atime.h index bf09a3289c2..00fed32c76e 100644 --- a/include/arch/win32/apr_arch_atime.h +++ b/include/arch/win32/apr_arch_atime.h @@ -36,7 +36,7 @@ struct atime_t { #define APR_DELTA_EPOCH_IN_USEC APR_TIME_C(11644473600000000); -__inline void FileTimeToAprTime(apr_time_t *result, FILETIME *input) +static APR_INLINE void FileTimeToAprTime(apr_time_t *result, FILETIME *input) { /* Convert FILETIME one 64 bit number so we can work with it. */ *result = input->dwHighDateTime; @@ -48,7 +48,7 @@ __inline void FileTimeToAprTime(apr_time_t *result, FILETIME *input) } -__inline void AprTimeToFileTime(LPFILETIME pft, apr_time_t t) +static APR_INLINE void AprTimeToFileTime(LPFILETIME pft, apr_time_t t) { LONGLONG ll; t += APR_DELTA_EPOCH_IN_USEC; diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index 6ecbfd4018c..a6d5c00f64e 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -141,28 +141,28 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *); #if defined(_MSC_VER) #include "crtdbg.h" -APR_INLINE void* apr_malloc_dbg(size_t size, const char* filename, - int linenumber) +static APR_INLINE void* apr_malloc_dbg(size_t size, const char* filename, + int linenumber) { return _malloc_dbg(size, _CRT_BLOCK, filename, linenumber); } -APR_INLINE void* apr_realloc_dbg(void* userData, size_t newSize, - const char* filename, int linenumber) +static APR_INLINE void* apr_realloc_dbg(void* userData, size_t newSize, + const char* filename, int linenumber) { return _realloc_dbg(userData, newSize, _CRT_BLOCK, filename, linenumber); } #else -APR_INLINE void* apr_malloc_dbg(size_t size, const char* filename, - int linenumber) +static APR_INLINE void* apr_malloc_dbg(size_t size, const char* filename, + int linenumber) { return malloc(size); } -APR_INLINE void* apr_realloc_dbg(void* userData, size_t newSize, - const char* filename, int linenumber) +static APR_INLINE void* apr_realloc_dbg(void* userData, size_t newSize, + const char* filename, int linenumber) { return realloc(userData, newSize); } @@ -186,7 +186,7 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); #define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ typedef rettype (calltype *apr_winapi_fpt_##fn) args; \ static apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \ - __inline rettype apr_winapi_##fn args \ + static APR_INLINE rettype apr_winapi_##fn args \ { if (!apr_winapi_pfn_##fn) \ apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \ apr_load_dll_func(lib, #fn, ord); \ From cc3622408447ea015a820b88c74e27dd701aa6bc Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 14 Jul 2006 06:12:01 +0000 Subject: [PATCH 5682/7878] Help protect the user from bad gcc optimizations on mingw. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421812 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 25732c182ee..90b954e8d0e 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -423,6 +423,17 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DCYGWIN]) ;; *mingw*) + dnl gcc (3.4.2 at least) seems to mis-optimize at levels greater than + dnl -O0 producing link-time errors. The user can override by + dnl explicitly passing a CFLAGS value to configure. + dnl + dnl Example error messages: + dnl undefined reference to 'libmsvcrt_a_iname' + dnl undefined reference to '_nm___pctype' + if test "$ac_test_CFLAGS" != set; then + APR_REMOVEFROM(CFLAGS,-O2) + APR_ADDTO(CFLAGS,-O0) + fi APR_ADDTO(LDFLAGS, [-Wl,--enable-auto-import,--subsystem,console]) APR_SETIFNULL(apr_lock_method, [win32]) APR_SETIFNULL(have_unicode_fs, [1]) From 391c56315a41a73ca531ab63a82caccc60b0b68a Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 14 Jul 2006 18:18:47 +0000 Subject: [PATCH 5683/7878] Provide suitable hints to autoconf that mingw (Win32)'s process locks and mutexes are global. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421976 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 1 + configure.in | 1 + 2 files changed, 2 insertions(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 90b954e8d0e..4443af72ad1 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -436,6 +436,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? fi APR_ADDTO(LDFLAGS, [-Wl,--enable-auto-import,--subsystem,console]) APR_SETIFNULL(apr_lock_method, [win32]) + APR_SETIFNULL(apr_process_lock_is_global, [yes]) APR_SETIFNULL(have_unicode_fs, [1]) APR_SETIFNULL(have_proc_invoked, [1]) APR_SETIFNULL(apr_cv_use_lfs64, [yes]) diff --git a/configure.in b/configure.in index a5ba73fc4a1..5b4ef598e9b 100644 --- a/configure.in +++ b/configure.in @@ -409,6 +409,7 @@ case $host in OSDIR="win32" enable_threads="system_threads" eolstr="\\n" + proc_mutex_is_global=1 OBJECTS_PLATFORM='$(OBJECTS_win32)' ;; *cygwin*) From a4a1f449c892a5126bd11c3ca7c40c12d01da51d Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 14 Jul 2006 18:19:52 +0000 Subject: [PATCH 5684/7878] Teach jlibtool how to deal with .exe's on MinGW. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421977 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/jlibtool.c b/build/jlibtool.c index 0d577a459b4..b3ca79cae0a 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -160,6 +160,7 @@ # define SHARED_OPTS "-shared" # define MODULE_OPTS "-shared" # define MKDIR_NO_UMASK +# define EXE_EXT ".exe" #endif #ifndef SHELL_CMD @@ -1230,7 +1231,11 @@ int parse_output_file_name(char *arg, command_t *cmd_data) } } +#ifdef EXE_EXT + if (!ext || strcmp(ext, EXE_EXT) == 0) { +#else if (!ext) { +#endif cmd_data->basename = arg; cmd_data->output = otProgram; #if defined(_OSD_POSIX) @@ -1239,7 +1244,9 @@ int parse_output_file_name(char *arg, command_t *cmd_data) newarg = (char *)malloc(strlen(arg) + 5); strcpy(newarg, arg); #ifdef EXE_EXT + if (!ext) { strcat(newarg, EXE_EXT); + } #endif cmd_data->output_name = newarg; return 1; From 44ebdf72ffd49c4ca16129edb4f9a9562abb2469 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 14 Jul 2006 19:31:58 +0000 Subject: [PATCH 5685/7878] It compiles, links, and the test cases (mostly) pass. Ship it! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@422000 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 3fc469ed7e2..97c46345a3d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes for APR 1.3.0 + *) Support MinGW. [John Vandenberg, Justin Erenkrantz] + *) Implement apr_thread_yield on Unix in terms of pthread_yield or sched_yield. [Keisuke Nishida ] From 10b06989329ef3389bbb1682f598f3beb8a2b667 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 15 Jul 2006 06:06:58 +0000 Subject: [PATCH 5686/7878] Convert the backslashes generated in paths when using the native win32 build of Python to forward slashes, that the rest of the build system can understand. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@422146 13f79535-47bb-0310-9956-ffa450edef68 --- build/gen-build.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/gen-build.py b/build/gen-build.py index 2d127185c4f..321b4bad629 100755 --- a/build/gen-build.py +++ b/build/gen-build.py @@ -188,11 +188,13 @@ def resolve_deps(header_deps): if len(deps) != start: altered = 1 +def clean_path(path): + return path.replace("\\", "/") def get_files(patterns): files = [ ] for pat in string.split(patterns): - files.extend(glob.glob(pat)) + files.extend(map(clean_path, glob.glob(pat))) return files From b24e1f7f36dfcfc66a6d16ba79f82c0a832971ec Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 15 Jul 2006 07:16:32 +0000 Subject: [PATCH 5687/7878] apr_filepath_root: Remove the force upper-casing of the Drive letter on Win32. This was causing the test failure on testnames line 219. All evidence points to that the comment above the upper case switch is invalid, since everything passes after removing it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@422157 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 1912a1c80b0..28e77371d19 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -283,10 +283,6 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, { apr_status_t rv; /* Validate that D:\ drive exists, test must be rooted - * Note that posix/win32 insists a drive letter is upper case, - * so who are we to argue with a 'feature'. - * It is a safe fold, since only A-Z is legal, and has no - * side effects of legal mis-mapped non-us-ascii codes. */ newpath = apr_palloc(p, 4); newpath[0] = testpath[0]; @@ -294,7 +290,6 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, newpath[2] = seperator[0]; newpath[3] = '\0'; if (flags & APR_FILEPATH_TRUENAME) { - newpath[0] = apr_toupper(newpath[0]); rv = filepath_root_test(newpath, p); if (rv) return rv; From 456af1a89cfd714a532862170de12758e3b99b39 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 15 Jul 2006 07:40:39 +0000 Subject: [PATCH 5688/7878] Add __MINGW32__ versions of the Win32 Atomic functions, that all do their own evil casting -- but it allows 100% of the testatomic cases to pass, when previously, it aborted if you tried to call any of the atomic functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@422168 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/win32/apr_atomic.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index 3b664a212cc..9074762697a 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -43,6 +43,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint3 { #if (defined(_M_IA64) || defined(_M_AMD64)) return InterlockedExchangeAdd(mem, val); +#elif defined(__MINGW32__) + return InterlockedExchangeAdd((long *)mem, val); #else return ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val); #endif @@ -55,6 +57,8 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) { #if (defined(_M_IA64) || defined(_M_AMD64)) InterlockedExchangeAdd(mem, -val); +#elif defined(__MINGW32__) + InterlockedExchangeAdd((long *)mem, -val); #else ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, -val); #endif @@ -65,6 +69,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) /* we return old value, win32 returns new value :( */ #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedIncrement(mem) - 1; +#elif defined(__MINGW32__) + return InterlockedIncrement((long *)mem) - 1; #else return ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem) - 1; #endif @@ -74,6 +80,8 @@ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedDecrement(mem); +#elif defined(__MINGW32__) + return InterlockedDecrement((long *)mem); #else return ((apr_atomic_win32_ptr_fn)InterlockedDecrement)(mem); #endif @@ -83,6 +91,8 @@ APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) InterlockedExchange(mem, val); +#elif defined(__MINGW32__) + InterlockedExchange((long*)mem, val); #else ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); #endif @@ -98,6 +108,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3 { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedCompareExchange(mem, with, cmp); +#elif defined(__MINGW32__) + return InterlockedCompareExchange((long*)mem, with, cmp); #else return ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem, with, cmp); #endif @@ -105,7 +117,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3 APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) { -#if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) +#if (defined(_M_IA64) || defined(_M_AMD64) || defined(__MINGW32__)) && !defined(RC_INVOKED) return InterlockedCompareExchangePointer((void**)mem, with, (void*)cmp); #else /* Too many VC6 users have stale win32 API files, stub this */ @@ -117,6 +129,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedExchange(mem, val); +#elif defined(__MINGW32__) + return InterlockedExchange((long *)mem, val); #else return ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); #endif From 36f6c413aa3fb79a7ceaf64b1ea749a4c6548c0d Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 15 Jul 2006 22:46:29 +0000 Subject: [PATCH 5689/7878] Add a definition of apr_wait_t to the autoconf based build, when using mingw32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@422311 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr.h.in b/include/apr.h.in index eb7dc5f966c..63abdc62f8d 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -398,6 +398,8 @@ typedef @socklen_t_value@ apr_socklen_t; #define WEXITSTATUS(status) (int)((status).w_retcode) #define WTERMSIG(status) (int)((status).w_termsig) #endif /* !WEXITSTATUS */ +#elif defined(__MINGW32__) +typedef int apr_wait_t; #endif /* HAVE_SYS_WAIT_H */ #if defined(PATH_MAX) From 82ec39eeced7445a958850e81728df7d160d4af5 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 15 Jul 2006 22:55:06 +0000 Subject: [PATCH 5690/7878] Replicate how apr.hw hacks pid_t, uid_t, and gid_t for mingw32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@422313 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/apr.h.in b/include/apr.h.in index 63abdc62f8d..9fdc8581820 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -402,6 +402,13 @@ typedef @socklen_t_value@ apr_socklen_t; typedef int apr_wait_t; #endif /* HAVE_SYS_WAIT_H */ +/* XXXX: These don't belong here, but it is replicating what apr.hw does. */ +#ifdef __MINGW32__ +typedef int pid_t; +typedef int uid_t; +typedef int gid_t; +#endif + #if defined(PATH_MAX) #define APR_PATH_MAX PATH_MAX #elif defined(_POSIX_PATH_MAX) From b90bd74fe40de563b487d8faf5d8e4e62cb30059 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 16 Jul 2006 01:20:09 +0000 Subject: [PATCH 5691/7878] Update svn:ignore with mingw artifacts git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@422329 13f79535-47bb-0310-9956-ffa450edef68 From 23b36db7fa16e00a421a81dbd9bfaa689000114f Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 18 Jul 2006 00:08:58 +0000 Subject: [PATCH 5692/7878] Revert r422157, attempting to fix case sensitivity testnames failures, because it has been vetoed: http://mail-archives.apache.org/mod_mbox/apr-dev/200607.mbox/%3c44B9A74A.7020906@rowe-clan.net%3e git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@422924 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 28e77371d19..1912a1c80b0 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -283,6 +283,10 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, { apr_status_t rv; /* Validate that D:\ drive exists, test must be rooted + * Note that posix/win32 insists a drive letter is upper case, + * so who are we to argue with a 'feature'. + * It is a safe fold, since only A-Z is legal, and has no + * side effects of legal mis-mapped non-us-ascii codes. */ newpath = apr_palloc(p, 4); newpath[0] = testpath[0]; @@ -290,6 +294,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, newpath[2] = seperator[0]; newpath[3] = '\0'; if (flags & APR_FILEPATH_TRUENAME) { + newpath[0] = apr_toupper(newpath[0]); rv = filepath_root_test(newpath, p); if (rv) return rv; From 651d6c28a5a51c0bc0be3263bfd40330281d73b4 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Tue, 18 Jul 2006 07:45:58 +0000 Subject: [PATCH 5693/7878] Make apr compile on FreeBSD-4.x git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@423003 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 5b4ef598e9b..84ad65c7a0b 100644 --- a/configure.in +++ b/configure.in @@ -1408,7 +1408,8 @@ case $host in ;; esac -APR_CHECK_SIZEOF_EXTENDED([#include ],struct iovec,0) +APR_CHECK_SIZEOF_EXTENDED([#include +#include ],struct iovec,0) if test "$ac_cv_sizeof_struct_iovec" = "0"; then have_iovec=0 else From 2e7d607f2245857d7bcccd68d3274ec822f00795 Mon Sep 17 00:00:00 2001 From: Max Oliver Bowsher Date: Tue, 18 Jul 2006 14:38:02 +0000 Subject: [PATCH 5694/7878] Undo breakage of APR_CHECK_SIZEOF_EXTENDED when applied to pointer types or types containing upper-case letters, introduced in r421074. * build/apr_common.m4 (APR_CHECK_SIZEOF_EXTENDED): Resynchronize with upstream autoconf 2.59's AC_CHECK_SIZEOF, including reimporting correct transliterations, one of which was broken in r421074, and the other of which has been broken for many years, and was changed to a different broken form in r421074. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@423091 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 7fa32b41fa9..dacdeaf851b 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -444,11 +444,11 @@ dnl A variant of AC_CHECK_SIZEOF which allows the checking of dnl sizes of non-builtin types dnl AC_DEFUN([APR_CHECK_SIZEOF_EXTENDED], -[changequote(<<,>>)dnl -dnl The name to #define -define(<>, translit(sizeof_$2, [a-z ], [A-Z_]))dnl -dnl The cache variable -define(<>, translit(ac_cv_sizeof_$2, [A-Z ],[a-z_]))dnl +[changequote(<<, >>)dnl +dnl The name to #define. +define(<>, translit(sizeof_$2, [a-z *], [A-Z_P]))dnl +dnl The cache variable name. +define(<>, translit(ac_cv_sizeof_$2, [ *], [_p]))dnl changequote([, ])dnl AC_MSG_CHECKING(size of $2) AC_CACHE_VAL(AC_CV_NAME, @@ -456,7 +456,7 @@ AC_CACHE_VAL(AC_CV_NAME, $1 main() { - FILE *f=fopen("conftestval","w"); + FILE *f=fopen("conftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof($2)); exit(0); From 76a836e37e737ee6ce539b079a5d3d5a631ef8e7 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 19 Jul 2006 10:20:22 +0000 Subject: [PATCH 5695/7878] - Note casptr qualifier issue git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@423424 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/STATUS b/STATUS index a705a0ddc47..4610c98e237 100644 --- a/STATUS +++ b/STATUS @@ -379,6 +379,10 @@ Documentation that needs writing: API Changes Postponed for APR 2.0: + * apr_atomic_casptr() has the volatile qualifier in the wrong + place: should take "pointer to volatile pointer to void", not + "pointer to pointer to volatile void". + * apr_socket_sendfile(): the offset parameter should not be pass-by-reference, or it should be updated to do something useful. From b6d8393f509f571e227d6ae2cd3765ec59ee6c35 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 19 Jul 2006 11:07:31 +0000 Subject: [PATCH 5696/7878] * build/apr_common.m4 (APR_CONFIG_NICE, APR_PARSE_ARGUMENTS): Fix to remove assumption that $@ is preserved forever - it never was in any autoconf release; autoconf 2.60 happens to overwrite it earlier. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@423435 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index dacdeaf851b..0691c63d1e6 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -64,7 +64,12 @@ EOF echo "NOTEST_LIBS=\"$NOTEST_LIBS\"; export NOTEST_LIBS" >> $1 fi - for arg in [$]0 "[$]@"; do + # Retrieve command-line arguments. + eval "set x $[0] $ac_configure_args" + shift + + for arg + do APR_EXPAND_VAR(arg, $arg) echo "\"[$]arg\" \\" >> $1 done @@ -800,6 +805,10 @@ dnl used here to allow us to co-exist layouts and argument based dnl set ups. AC_DEFUN([APR_PARSE_ARGUMENTS], [ ac_prev= +# Retrieve the command-line arguments. The eval is needed because +# the arguments are quoted to preserve accuracy. +eval "set x $ac_configure_args" +shift for ac_option do # If the previous option needs an argument, assign it. From 2b0b202603a60b5cb084b23b62aa4483ade8db33 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 23 Jul 2006 21:45:55 +0000 Subject: [PATCH 5697/7878] From svn issue 1869, test for ../../../ as submitted, plus i've added the pattern ../../.. which breaks the reporter's assumptions about the fix. Reviewing the bug now. Submitted by: Lieven Govaerts git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@424831 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/testnames.c b/test/testnames.c index 68aa444807f..c888af5a329 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -91,6 +91,24 @@ static void merge_dotdot(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "../test", dstpath); } +static void merge_dotdot_dotdot_dotdot(abts_case *tc, void *data) +{ + apr_status_t rv; + char *dstpath = NULL; + + rv = apr_filepath_merge(&dstpath, "", + "../../..", APR_FILEPATH_TRUENAME, p); + ABTS_PTR_NOTNULL(tc, dstpath); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, "../../..", dstpath); + + rv = apr_filepath_merge(&dstpath, "", + "../../../", APR_FILEPATH_TRUENAME, p); + ABTS_PTR_NOTNULL(tc, dstpath); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, "../../../", dstpath); +} + static void merge_secure(abts_case *tc, void *data) { apr_status_t rv; @@ -249,6 +267,7 @@ abts_suite *testnames(abts_suite *suite) abts_run_test(suite, merge_notrelfail, NULL); abts_run_test(suite, merge_notabs, NULL); abts_run_test(suite, merge_notabsfail, NULL); + abts_run_test(suite, merge_dotdot_dotdot_dotdot, NULL); abts_run_test(suite, root_absolute, NULL); abts_run_test(suite, root_relative, NULL); From 40f6e89952c33c5988c8b8396d46d1b88126d1be Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Jul 2006 03:43:25 +0000 Subject: [PATCH 5698/7878] My revision should have confirmed ../../.. -> ../../../ since the truename function decorates 'directories' with '/'. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@424893 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testnames.c b/test/testnames.c index c888af5a329..28a3070fc26 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -100,7 +100,7 @@ static void merge_dotdot_dotdot_dotdot(abts_case *tc, void *data) "../../..", APR_FILEPATH_TRUENAME, p); ABTS_PTR_NOTNULL(tc, dstpath); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_STR_EQUAL(tc, "../../..", dstpath); + ABTS_STR_EQUAL(tc, "../../../", dstpath); rv = apr_filepath_merge(&dstpath, "", "../../../", APR_FILEPATH_TRUENAME, p); From 213188ac6536ac8e608c79be05d1e259756b39d1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Jul 2006 04:27:27 +0000 Subject: [PATCH 5699/7878] Revert my last commit. I've determined that data becomes data, while data/ remains data/. ../../.. should observe the same behavior, so this is effectively a bug, even if it has no negative impact. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@424900 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testnames.c b/test/testnames.c index 28a3070fc26..c888af5a329 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -100,7 +100,7 @@ static void merge_dotdot_dotdot_dotdot(abts_case *tc, void *data) "../../..", APR_FILEPATH_TRUENAME, p); ABTS_PTR_NOTNULL(tc, dstpath); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_STR_EQUAL(tc, "../../../", dstpath); + ABTS_STR_EQUAL(tc, "../../..", dstpath); rv = apr_filepath_merge(&dstpath, "", "../../../", APR_FILEPATH_TRUENAME, p); From 8e0d9a594b99b479e3491e77b4419a3bf27de9a2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Jul 2006 05:53:31 +0000 Subject: [PATCH 5700/7878] Solve svn issue 1869, avoid replacing previous ../ segments when multiple ../../.. patterns are present. This patch also normalizes the .. path seperators to use the same rules as normal paths, that is, if it's NATIVE use '\' (previous behavior), and (new behavior) if TRUENAME not NATIVE, use '/', otherwise the given slash. Adds no trailing slash if none was present on input. Solved with hints from Lieven Govaerts . Resolves test fail identified by test/testnames.c commit 424831 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@424915 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 1912a1c80b0..602cbc64832 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -677,16 +677,22 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* Otherwise this is simply a noop, above root is root. */ } - else if (pathlen == 0 || - (pathlen >= 3 && (pathlen == 3 - || path[pathlen - 4] == ':') - && path[pathlen - 3] == '.' - && path[pathlen - 2] == '.' - && (path[pathlen - 1] == '/' - || path[pathlen - 1] == '\\'))) + else if (pathlen == 0 + || (pathlen >= 3 + && (pathlen == 3 + || path[pathlen - 4] == ':' + || path[pathlen - 4] == '/' + || path[pathlen - 4] == '\\') + && path[pathlen - 3] == '.' + && path[pathlen - 2] == '.' + && (path[pathlen - 1] == '/' + || path[pathlen - 1] == '\\'))) { - /* Path is already backpathed or empty, if the - * APR_FILEPATH_SECUREROOTTEST.was given die now. + /* Verified path is empty, exactly "..[/\]", or ends + * in "[:/\]..[/\]" - these patterns we will not back + * over since they aren't 'prior segements'. + * + * If APR_FILEPATH_SECUREROOTTEST.was given, die now. */ if (flags & APR_FILEPATH_SECUREROOTTEST) return APR_EABOVEROOT; @@ -695,9 +701,13 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, */ if (pathlen + 3 >= sizeof(path)) return APR_ENAMETOOLONG; - memcpy(path + pathlen, ((flags & APR_FILEPATH_NATIVE) - ? "..\\" : "../"), 3); - pathlen += 3; + path[pathlen++] = '.'; + path[pathlen++] = '.'; + if (addpath[segend]) { + path[pathlen++] = ((flags & APR_FILEPATH_NATIVE) + ? '\\' : ((flags & APR_FILEPATH_TRUENAME) + ? '/' : addpath[segend])); + } /* The 'root' part of this path now includes the ../ path, * because that backpath will not be parsed by the truename * code below. From c6be6e50a7ad26393fc21bac3b0b51d67f4ff681 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 26 Jul 2006 04:56:35 +0000 Subject: [PATCH 5701/7878] With this patch, the finfo.protection includes the rights for the current user, and the rights for his/her primary group (plus world/Everyone), when requested by the wanted bits of either user/group id, or user/group prot. Submitted by: Andreas Magnusson Message-ID: Reviewed by: wrowe, D.J. Heap git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@425620 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 8419bb89f57..d5618da21c3 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -242,8 +242,8 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, } rv = GetNamedSecurityInfoW(wfile + fix, SE_FILE_OBJECT, sinf, - ((wanted & APR_FINFO_USER) ? &user : NULL), - ((wanted & APR_FINFO_GROUP) ? &grp : NULL), + ((wanted & (APR_FINFO_USER | APR_FINFO_UPROT)) ? &user : NULL), + ((wanted & (APR_FINFO_GROUP | APR_FINFO_GPROT)) ? &grp : NULL), ((wanted & APR_FINFO_PROT) ? &dacl : NULL), NULL, &pdesc); if (fix == 6) @@ -252,15 +252,15 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, else if (whatfile == MORE_OF_FSPEC) rv = GetNamedSecurityInfoA((char*)ufile, SE_FILE_OBJECT, sinf, - ((wanted & APR_FINFO_USER) ? &user : NULL), - ((wanted & APR_FINFO_GROUP) ? &grp : NULL), + ((wanted & (APR_FINFO_USER | APR_FINFO_UPROT)) ? &user : NULL), + ((wanted & (APR_FINFO_GROUP | APR_FINFO_GPROT)) ? &grp : NULL), ((wanted & APR_FINFO_PROT) ? &dacl : NULL), NULL, &pdesc); else if (whatfile == MORE_OF_HANDLE) rv = GetSecurityInfo((HANDLE)ufile, SE_FILE_OBJECT, sinf, - ((wanted & APR_FINFO_USER) ? &user : NULL), - ((wanted & APR_FINFO_GROUP) ? &grp : NULL), + ((wanted & (APR_FINFO_USER | APR_FINFO_UPROT)) ? &user : NULL), + ((wanted & (APR_FINFO_GROUP | APR_FINFO_GPROT)) ? &grp : NULL), ((wanted & APR_FINFO_PROT) ? &dacl : NULL), NULL, &pdesc); else From db1f5572d5e20a3d53b4a67fd45c73a25c142d98 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Jul 2006 15:41:11 +0000 Subject: [PATCH 5702/7878] Munger for VC RC (resource compile) /d Foo=Bar syntax flavors. Old VC (5/6) accepts only /d Foo="Bar Bash", 2005 only accepts /d "Foo=Bar Bash" git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@426571 13f79535-47bb-0310-9956-ffa450edef68 --- build/cvtdsp.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl index 9ea63a87fce..49f12c69804 100644 --- a/build/cvtdsp.pl +++ b/build/cvtdsp.pl @@ -63,6 +63,9 @@ sub tovc5 { if ($src =~ s|^(# ADD BASE CPP .*)/EHsc (.*)|$1/GX $2|) { $verchg = -1; } + while ($src =~ s|^(# ADD RSC .*)/d "([^ ="]+)=([^"]+)"|$1/d $2="$3"|) { + $verchg = -1; + } if ($src !~ m|^# PROP AllowPerConfigDependencies|) { print $dstfl $src; } else { @@ -105,6 +108,9 @@ sub tovc6 { if ($src =~ s|^(# ADD BASE CPP .*)/GX (.*)|$1/EHsc $2|) { $verchg = -1; } + while ($src =~ s|^(# ADD RSC .*)/d "([^ ="]+)=([^"]+)"|$1/d $2="$3"|) { + $verchg = -1; + } print $dstfl $src; if ($verchg && $src =~ m|^# Begin Project|) { print $dstfl "# PROP AllowPerConfigDependencies 0\n"; @@ -138,6 +144,9 @@ sub tovc2005 { if ($src =~ s|(\bLINK32.*) /machine:I386(.*)|$1$2|) { $verchg = -1; } + if ($src =~ s|^(# ADD RSC .*)/d ([^ ="]+)="([^"]+)"|$1/d "$2=$3"|) { + $verchg = -1; + } print $dstfl $src; } undef $srcfl; From d4a2028c6ac04347868c20ac05505d5c9c199900 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Jul 2006 15:42:44 +0000 Subject: [PATCH 5703/7878] Loop this, for multiple assignments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@426573 13f79535-47bb-0310-9956-ffa450edef68 --- build/cvtdsp.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl index 49f12c69804..5394eb58e22 100644 --- a/build/cvtdsp.pl +++ b/build/cvtdsp.pl @@ -144,7 +144,7 @@ sub tovc2005 { if ($src =~ s|(\bLINK32.*) /machine:I386(.*)|$1$2|) { $verchg = -1; } - if ($src =~ s|^(# ADD RSC .*)/d ([^ ="]+)="([^"]+)"|$1/d "$2=$3"|) { + while ($src =~ s|^(# ADD RSC .*)/d ([^ ="]+)="([^"]+)"|$1/d "$2=$3"|) { $verchg = -1; } print $dstfl $src; From 1494ca9d3f422b806bb2b95330b1adeaa7d913c8 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 3 Aug 2006 10:46:47 +0000 Subject: [PATCH 5704/7878] Update license header. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@428313 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 12 ++++++------ atomic/netware/apr_atomic.c | 12 ++++++------ atomic/os390/atomic.c | 12 ++++++------ atomic/unix/apr_atomic.c | 12 ++++++------ atomic/win32/apr_atomic.c | 12 ++++++------ build/NWGNUtail.inc | 7 ++++++- build/PrintPath | 12 ++++++------ build/aplibtool.c | 12 ++++++------ build/apr_common.m4 | 11 ++++++----- build/apr_hints.m4 | 11 ++++++----- build/apr_network.m4 | 11 ++++++----- build/apr_rules.mk.in | 12 ++++++------ build/apr_threads.m4 | 11 ++++++----- build/find_apr.m4 | 11 ++++++----- build/jlibtool.c | 12 ++++++------ build/pkg/buildpkg.sh | 12 ++++++------ buildconf | 12 ++++++------ dso/aix/dso.c | 12 ++++++------ dso/beos/dso.c | 12 ++++++------ dso/netware/dso.c | 12 ++++++------ dso/os2/dso.c | 12 ++++++------ dso/os390/dso.c | 12 ++++++------ dso/unix/dso.c | 12 ++++++------ dso/win32/dso.c | 12 ++++++------ file_io/netware/filestat.c | 12 ++++++------ file_io/netware/filesys.c | 12 ++++++------ file_io/netware/flock.c | 12 ++++++------ file_io/netware/mktemp.c | 12 ++++++------ file_io/netware/pipe.c | 12 ++++++------ file_io/os2/buffer.c | 12 ++++++------ file_io/os2/dir.c | 12 ++++++------ file_io/os2/dir_make_recurse.c | 12 ++++++------ file_io/os2/fileacc.c | 12 ++++++------ file_io/os2/filedup.c | 12 ++++++------ file_io/os2/filepath.c | 12 ++++++------ file_io/os2/filestat.c | 12 ++++++------ file_io/os2/filesys.c | 12 ++++++------ file_io/os2/flock.c | 12 ++++++------ file_io/os2/maperrorcode.c | 12 ++++++------ file_io/os2/open.c | 12 ++++++------ file_io/os2/pipe.c | 12 ++++++------ file_io/os2/readwrite.c | 12 ++++++------ file_io/os2/seek.c | 12 ++++++------ file_io/unix/buffer.c | 12 ++++++------ file_io/unix/copy.c | 12 ++++++------ file_io/unix/dir.c | 12 ++++++------ file_io/unix/fileacc.c | 12 ++++++------ file_io/unix/filedup.c | 12 ++++++------ file_io/unix/filepath.c | 12 ++++++------ file_io/unix/filepath_util.c | 12 ++++++------ file_io/unix/filestat.c | 12 ++++++------ file_io/unix/flock.c | 12 ++++++------ file_io/unix/fullrw.c | 12 ++++++------ file_io/unix/mktemp.c | 12 ++++++------ file_io/unix/open.c | 12 ++++++------ file_io/unix/pipe.c | 12 ++++++------ file_io/unix/readwrite.c | 12 ++++++------ file_io/unix/seek.c | 12 ++++++------ file_io/unix/tempdir.c | 12 ++++++------ file_io/win32/buffer.c | 12 ++++++------ file_io/win32/dir.c | 12 ++++++------ file_io/win32/filedup.c | 12 ++++++------ file_io/win32/filepath.c | 12 ++++++------ file_io/win32/filestat.c | 12 ++++++------ file_io/win32/filesys.c | 12 ++++++------ file_io/win32/flock.c | 12 ++++++------ file_io/win32/open.c | 12 ++++++------ file_io/win32/pipe.c | 12 ++++++------ file_io/win32/readwrite.c | 12 ++++++------ file_io/win32/seek.c | 12 ++++++------ include/apr.h.in | 12 ++++++------ include/apr.hnw | 12 ++++++------ include/apr.hw | 12 ++++++------ include/apr_allocator.h | 12 ++++++------ include/apr_atomic.h | 12 ++++++------ include/apr_dso.h | 12 ++++++------ include/apr_env.h | 12 ++++++------ include/apr_errno.h | 12 ++++++------ include/apr_file_info.h | 12 ++++++------ include/apr_file_io.h | 12 ++++++------ include/apr_general.h | 12 ++++++------ include/apr_getopt.h | 12 ++++++------ include/apr_global_mutex.h | 12 ++++++------ include/apr_hash.h | 12 ++++++------ include/apr_inherit.h | 12 ++++++------ include/apr_lib.h | 12 ++++++------ include/apr_mmap.h | 12 ++++++------ include/apr_network_io.h | 12 ++++++------ include/apr_poll.h | 12 ++++++------ include/apr_pools.h | 12 ++++++------ include/apr_portable.h | 12 ++++++------ include/apr_proc_mutex.h | 12 ++++++------ include/apr_random.h | 12 ++++++------ include/apr_ring.h | 12 ++++++------ include/apr_shm.h | 12 ++++++------ include/apr_signal.h | 12 ++++++------ include/apr_strings.h | 12 ++++++------ include/apr_support.h | 12 ++++++------ include/apr_tables.h | 12 ++++++------ include/apr_thread_cond.h | 12 ++++++------ include/apr_thread_mutex.h | 12 ++++++------ include/apr_thread_proc.h | 12 ++++++------ include/apr_thread_rwlock.h | 12 ++++++------ include/apr_time.h | 12 ++++++------ include/apr_user.h | 12 ++++++------ include/apr_version.h | 12 ++++++------ include/apr_want.h | 12 ++++++------ include/arch/aix/apr_arch_dso.h | 12 ++++++------ include/arch/apr_private_common.h | 12 ++++++------ include/arch/beos/apr_arch_dso.h | 12 ++++++------ include/arch/beos/apr_arch_proc_mutex.h | 12 ++++++------ include/arch/beos/apr_arch_thread_cond.h | 12 ++++++------ include/arch/beos/apr_arch_thread_mutex.h | 12 ++++++------ include/arch/beos/apr_arch_thread_rwlock.h | 12 ++++++------ include/arch/beos/apr_arch_threadproc.h | 12 ++++++------ include/arch/netware/apr_arch_dso.h | 12 ++++++------ include/arch/netware/apr_arch_file_io.h | 12 ++++++------ include/arch/netware/apr_arch_global_mutex.h | 12 ++++++------ include/arch/netware/apr_arch_internal_time.h | 12 ++++++------ include/arch/netware/apr_arch_networkio.h | 12 ++++++------ include/arch/netware/apr_arch_pre_nw.h | 12 ++++++------ include/arch/netware/apr_arch_proc_mutex.h | 12 ++++++------ include/arch/netware/apr_arch_thread_cond.h | 12 ++++++------ include/arch/netware/apr_arch_thread_mutex.h | 12 ++++++------ include/arch/netware/apr_arch_thread_rwlock.h | 12 ++++++------ include/arch/netware/apr_arch_threadproc.h | 12 ++++++------ include/arch/netware/apr_private.h | 12 ++++++------ include/arch/os2/apr_arch_dso.h | 12 ++++++------ include/arch/os2/apr_arch_file_io.h | 12 ++++++------ include/arch/os2/apr_arch_networkio.h | 12 ++++++------ include/arch/os2/apr_arch_os2calls.h | 12 ++++++------ include/arch/os2/apr_arch_proc_mutex.h | 12 ++++++------ include/arch/os2/apr_arch_thread_cond.h | 12 ++++++------ include/arch/os2/apr_arch_thread_mutex.h | 12 ++++++------ include/arch/os2/apr_arch_thread_rwlock.h | 12 ++++++------ include/arch/os2/apr_arch_threadproc.h | 12 ++++++------ include/arch/os390/apr_arch_dso.h | 12 ++++++------ include/arch/unix/apr_arch_dso.h | 12 ++++++------ include/arch/unix/apr_arch_file_io.h | 12 ++++++------ include/arch/unix/apr_arch_global_mutex.h | 12 ++++++------ include/arch/unix/apr_arch_inherit.h | 12 ++++++------ include/arch/unix/apr_arch_internal_time.h | 12 ++++++------ include/arch/unix/apr_arch_misc.h | 12 ++++++------ include/arch/unix/apr_arch_networkio.h | 12 ++++++------ include/arch/unix/apr_arch_poll_private.h | 12 ++++++------ include/arch/unix/apr_arch_proc_mutex.h | 12 ++++++------ include/arch/unix/apr_arch_shm.h | 12 ++++++------ include/arch/unix/apr_arch_thread_cond.h | 12 ++++++------ include/arch/unix/apr_arch_thread_mutex.h | 12 ++++++------ include/arch/unix/apr_arch_thread_rwlock.h | 12 ++++++------ include/arch/unix/apr_arch_threadproc.h | 12 ++++++------ include/arch/win32/apr_arch_atime.h | 12 ++++++------ include/arch/win32/apr_arch_dso.h | 12 ++++++------ include/arch/win32/apr_arch_file_io.h | 12 ++++++------ include/arch/win32/apr_arch_inherit.h | 12 ++++++------ include/arch/win32/apr_arch_misc.h | 12 ++++++------ include/arch/win32/apr_arch_networkio.h | 12 ++++++------ include/arch/win32/apr_arch_proc_mutex.h | 12 ++++++------ include/arch/win32/apr_arch_thread_cond.h | 12 ++++++------ include/arch/win32/apr_arch_thread_mutex.h | 12 ++++++------ include/arch/win32/apr_arch_thread_rwlock.h | 12 ++++++------ include/arch/win32/apr_arch_threadproc.h | 12 ++++++------ include/arch/win32/apr_arch_utf8.h | 12 ++++++------ include/arch/win32/apr_dbg_win32_handles.h | 12 ++++++------ include/arch/win32/apr_private.h | 12 ++++++------ locks/beos/proc_mutex.c | 12 ++++++------ locks/beos/thread_cond.c | 12 ++++++------ locks/beos/thread_mutex.c | 12 ++++++------ locks/beos/thread_rwlock.c | 12 ++++++------ locks/netware/proc_mutex.c | 12 ++++++------ locks/netware/thread_cond.c | 12 ++++++------ locks/netware/thread_mutex.c | 12 ++++++------ locks/netware/thread_rwlock.c | 12 ++++++------ locks/os2/proc_mutex.c | 12 ++++++------ locks/os2/thread_cond.c | 12 ++++++------ locks/os2/thread_mutex.c | 12 ++++++------ locks/os2/thread_rwlock.c | 12 ++++++------ locks/unix/global_mutex.c | 12 ++++++------ locks/unix/proc_mutex.c | 12 ++++++------ locks/unix/thread_cond.c | 12 ++++++------ locks/unix/thread_mutex.c | 12 ++++++------ locks/unix/thread_rwlock.c | 12 ++++++------ locks/win32/proc_mutex.c | 12 ++++++------ locks/win32/thread_cond.c | 12 ++++++------ locks/win32/thread_mutex.c | 12 ++++++------ locks/win32/thread_rwlock.c | 12 ++++++------ memory/unix/apr_pools.c | 12 ++++++------ misc/netware/charset.c | 12 ++++++------ misc/netware/libprews.c | 12 ++++++------ misc/netware/rand.c | 12 ++++++------ misc/netware/start.c | 12 ++++++------ misc/unix/charset.c | 12 ++++++------ misc/unix/env.c | 12 ++++++------ misc/unix/errorcodes.c | 12 ++++++------ misc/unix/otherchild.c | 12 ++++++------ misc/unix/rand.c | 12 ++++++------ misc/unix/randbyte_os2.inc | 12 ++++++------ misc/unix/start.c | 12 ++++++------ misc/unix/version.c | 12 ++++++------ misc/win32/apr_app.c | 12 ++++++------ misc/win32/charset.c | 12 ++++++------ misc/win32/env.c | 12 ++++++------ misc/win32/internal.c | 12 ++++++------ misc/win32/misc.c | 12 ++++++------ misc/win32/rand.c | 12 ++++++------ misc/win32/start.c | 12 ++++++------ misc/win32/utf8.c | 12 ++++++------ mmap/unix/common.c | 12 ++++++------ mmap/unix/mmap.c | 12 ++++++------ mmap/win32/mmap.c | 12 ++++++------ network_io/beos/sendrecv.c | 12 ++++++------ network_io/os2/os2calls.c | 12 ++++++------ network_io/os2/sendrecv.c | 12 ++++++------ network_io/os2/sendrecv_udp.c | 12 ++++++------ network_io/os2/sockets.c | 12 ++++++------ network_io/os2/sockopt.c | 12 ++++++------ network_io/unix/multicast.c | 12 ++++++------ network_io/unix/sendrecv.c | 12 ++++++------ network_io/unix/sockaddr.c | 12 ++++++------ network_io/unix/sockets.c | 12 ++++++------ network_io/unix/sockopt.c | 12 ++++++------ network_io/win32/sendrecv.c | 12 ++++++------ network_io/win32/sockets.c | 12 ++++++------ network_io/win32/sockopt.c | 12 ++++++------ passwd/apr_getpass.c | 12 ++++++------ poll/os2/poll.c | 12 ++++++------ poll/os2/pollset.c | 12 ++++++------ poll/unix/epoll.c | 12 ++++++------ poll/unix/kqueue.c | 12 ++++++------ poll/unix/poll.c | 12 ++++++------ poll/unix/port.c | 12 ++++++------ poll/unix/select.c | 12 ++++++------ random/unix/apr_random.c | 12 ++++++------ random/unix/sha2.c | 12 ++++++------ random/unix/sha2.h | 12 ++++++------ shmem/beos/shm.c | 12 ++++++------ shmem/os2/shm.c | 12 ++++++------ shmem/unix/shm.c | 12 ++++++------ shmem/win32/shm.c | 12 ++++++------ strings/apr_cpystrn.c | 12 ++++++------ strings/apr_snprintf.c | 12 ++++++------ strings/apr_strings.c | 12 ++++++------ strings/apr_strtok.c | 12 ++++++------ support/unix/waitio.c | 12 ++++++------ tables/apr_hash.c | 12 ++++++------ tables/apr_tables.c | 12 ++++++------ test/abts_tests.h | 12 ++++++------ test/echod.c | 12 ++++++------ test/globalmutexchild.c | 12 ++++++------ test/internal/testregex.c | 12 ++++++------ test/internal/testucs.c | 12 ++++++------ test/mod_test.c | 12 ++++++------ test/readchild.c | 12 ++++++------ test/sendfile.c | 12 ++++++------ test/sockchild.c | 12 ++++++------ test/sockperf.c | 12 ++++++------ test/testargs.c | 12 ++++++------ test/testatomic.c | 12 ++++++------ test/testdir.c | 12 ++++++------ test/testdso.c | 12 ++++++------ test/testdup.c | 12 ++++++------ test/testenv.c | 12 ++++++------ test/testfile.c | 12 ++++++------ test/testfilecopy.c | 12 ++++++------ test/testfileinfo.c | 12 ++++++------ test/testflock.c | 12 ++++++------ test/testflock.h | 12 ++++++------ test/testfmt.c | 12 ++++++------ test/testfnmatch.c | 12 ++++++------ test/testglobalmutex.c | 12 ++++++------ test/testglobalmutex.h | 12 ++++++------ test/testhash.c | 12 ++++++------ test/testipsub.c | 12 ++++++------ test/testlfs.c | 12 ++++++------ test/testlock.c | 12 ++++++------ test/testlockperf.c | 12 ++++++------ test/testmmap.c | 12 ++++++------ test/testmutexscope.c | 12 ++++++------ test/testnames.c | 12 ++++++------ test/testoc.c | 12 ++++++------ test/testpath.c | 12 ++++++------ test/testpipe.c | 12 ++++++------ test/testpoll.c | 12 ++++++------ test/testpools.c | 12 ++++++------ test/testproc.c | 12 ++++++------ test/testprocmutex.c | 12 ++++++------ test/testrand.c | 12 ++++++------ test/testrand2.c | 12 ++++++------ test/testshm.c | 12 ++++++------ test/testshm.h | 12 ++++++------ test/testshmconsumer.c | 12 ++++++------ test/testshmproducer.c | 12 ++++++------ test/testsleep.c | 12 ++++++------ test/testsock.c | 12 ++++++------ test/testsock.h | 12 ++++++------ test/testsockets.c | 12 ++++++------ test/testsockopt.c | 12 ++++++------ test/teststr.c | 12 ++++++------ test/teststrnatcmp.c | 12 ++++++------ test/testtable.c | 12 ++++++------ test/testtemp.c | 12 ++++++------ test/testthread.c | 12 ++++++------ test/testtime.c | 12 ++++++------ test/testud.c | 12 ++++++------ test/testuser.c | 12 ++++++------ test/testutil.c | 12 ++++++------ test/testutil.h | 12 ++++++------ test/testvsn.c | 12 ++++++------ test/tryread.c | 12 ++++++------ threadproc/beos/apr_proc_stub.c | 12 ++++++------ threadproc/beos/proc.c | 12 ++++++------ threadproc/beos/thread.c | 12 ++++++------ threadproc/beos/threadpriv.c | 12 ++++++------ threadproc/beos/threadproc_common.c | 12 ++++++------ threadproc/netware/proc.c | 12 ++++++------ threadproc/netware/procsup.c | 12 ++++++------ threadproc/netware/signals.c | 12 ++++++------ threadproc/netware/thread.c | 12 ++++++------ threadproc/netware/threadpriv.c | 12 ++++++------ threadproc/os2/proc.c | 12 ++++++------ threadproc/os2/thread.c | 12 ++++++------ threadproc/os2/threadpriv.c | 12 ++++++------ threadproc/unix/proc.c | 12 ++++++------ threadproc/unix/procsup.c | 12 ++++++------ threadproc/unix/signals.c | 12 ++++++------ threadproc/unix/thread.c | 12 ++++++------ threadproc/unix/threadpriv.c | 12 ++++++------ threadproc/win32/proc.c | 12 ++++++------ threadproc/win32/signals.c | 12 ++++++------ threadproc/win32/thread.c | 12 ++++++------ threadproc/win32/threadpriv.c | 12 ++++++------ time/unix/time.c | 12 ++++++------ time/unix/timestr.c | 12 ++++++------ time/win32/access.c | 12 ++++++------ time/win32/time.c | 12 ++++++------ time/win32/timestr.c | 12 ++++++------ user/netware/groupinfo.c | 12 ++++++------ user/netware/userinfo.c | 12 ++++++------ user/unix/groupinfo.c | 12 ++++++------ user/unix/userinfo.c | 12 ++++++------ user/win32/groupinfo.c | 12 ++++++------ user/win32/userinfo.c | 12 ++++++------ 342 files changed, 2052 insertions(+), 2042 deletions(-) diff --git a/apr-config.in b/apr-config.in index 718f0c62ac8..e0500edc90e 100644 --- a/apr-config.in +++ b/apr-config.in @@ -1,10 +1,10 @@ #!/bin/sh -# Copyright 2001-2005 The Apache Software Foundation or its licensors, as -# applicable. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index 78d14a65c1d..1937ffaaf69 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c index 675a0457721..7ebde145420 100644 --- a/atomic/os390/atomic.c +++ b/atomic/os390/atomic.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index b06bf2ac8f7..38b99ad7afb 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index 9074762697a..9f1c10b0337 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index a0ec6af9a0c..641c091b248 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -25,7 +25,12 @@ NLM_SCREEN_NAME = DEFAULT endif ifndef NLM_COPYRIGHT -NLM_COPYRIGHT = Copyright (c) 2000-2005 The Apache Software Foundation. All rights reserved. +NLM_COPYRIGHT = Licensed to the Apache Software Foundation (ASF) under one or more +NLM_COPYRIGHT = contributor license agreements. See the NOTICE file distributed with +NLM_COPYRIGHT = this work for additional information regarding copyright ownership. +NLM_COPYRIGHT = The ASF licenses this file to You under the Apache License, Version 2.0 +NLM_COPYRIGHT = (the "License"); you may not use this file except in compliance with +NLM_COPYRIGHT = the License. You may obtain a copy of the License at endif # diff --git a/build/PrintPath b/build/PrintPath index eaa6c1c9782..2a2b48b6349 100755 --- a/build/PrintPath +++ b/build/PrintPath @@ -1,11 +1,11 @@ #!/bin/sh # -# Copyright 1999-2005 The Apache Software Foundation or its licensors, as -# applicable. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # diff --git a/build/aplibtool.c b/build/aplibtool.c index 22a316ace18..858595406a7 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 0691c63d1e6..31b9cd9858f 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -1,9 +1,10 @@ dnl -------------------------------------------------------- -*- autoconf -*- -dnl Copyright 2000-2005 The Apache Software Foundation -dnl -dnl Licensed under the Apache License, Version 2.0 (the "License"); -dnl you may not use this file except in compliance with the License. -dnl You may obtain a copy of the License at +dnl Licensed to the Apache Software Foundation (ASF) under one or more +dnl contributor license agreements. See the NOTICE file distributed with +dnl this work for additional information regarding copyright ownership. +dnl The ASF licenses this file to You under the Apache License, Version 2.0 +dnl (the "License"); you may not use this file except in compliance with +dnl the License. You may obtain a copy of the License at dnl dnl http://www.apache.org/licenses/LICENSE-2.0 dnl diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 4443af72ad1..fd43a4d7967 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -1,9 +1,10 @@ dnl -------------------------------------------------------- -*- autoconf -*- -dnl Copyright 2000-2005 The Apache Software Foundation -dnl -dnl Licensed under the Apache License, Version 2.0 (the "License"); -dnl you may not use this file except in compliance with the License. -dnl You may obtain a copy of the License at +dnl Licensed to the Apache Software Foundation (ASF) under one or more +dnl contributor license agreements. See the NOTICE file distributed with +dnl this work for additional information regarding copyright ownership. +dnl The ASF licenses this file to You under the Apache License, Version 2.0 +dnl (the "License"); you may not use this file except in compliance with +dnl the License. You may obtain a copy of the License at dnl dnl http://www.apache.org/licenses/LICENSE-2.0 dnl diff --git a/build/apr_network.m4 b/build/apr_network.m4 index b7a20e5b4d7..dbef435d4ea 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -1,9 +1,10 @@ dnl -------------------------------------------------------- -*- autoconf -*- -dnl Copyright 2000-2005 The Apache Software Foundation -dnl -dnl Licensed under the Apache License, Version 2.0 (the "License"); -dnl you may not use this file except in compliance with the License. -dnl You may obtain a copy of the License at +dnl Licensed to the Apache Software Foundation (ASF) under one or more +dnl contributor license agreements. See the NOTICE file distributed with +dnl this work for additional information regarding copyright ownership. +dnl The ASF licenses this file to You under the Apache License, Version 2.0 +dnl (the "License"); you may not use this file except in compliance with +dnl the License. You may obtain a copy of the License at dnl dnl http://www.apache.org/licenses/LICENSE-2.0 dnl diff --git a/build/apr_rules.mk.in b/build/apr_rules.mk.in index 233fecf87be..80c2b433b69 100644 --- a/build/apr_rules.mk.in +++ b/build/apr_rules.mk.in @@ -1,9 +1,9 @@ -# Copyright 2000-2005 The Apache Software Foundation or its licensors, as -# applicable. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index c7a4729de01..cbc677b1467 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -1,9 +1,10 @@ dnl -------------------------------------------------------- -*- autoconf -*- -dnl Copyright 2000-2005 The Apache Software Foundation -dnl -dnl Licensed under the Apache License, Version 2.0 (the "License"); -dnl you may not use this file except in compliance with the License. -dnl You may obtain a copy of the License at +dnl Licensed to the Apache Software Foundation (ASF) under one or more +dnl contributor license agreements. See the NOTICE file distributed with +dnl this work for additional information regarding copyright ownership. +dnl The ASF licenses this file to You under the Apache License, Version 2.0 +dnl (the "License"); you may not use this file except in compliance with +dnl the License. You may obtain a copy of the License at dnl dnl http://www.apache.org/licenses/LICENSE-2.0 dnl diff --git a/build/find_apr.m4 b/build/find_apr.m4 index fea037e2a36..88f64a7e315 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -1,9 +1,10 @@ dnl -------------------------------------------------------- -*- autoconf -*- -dnl Copyright 2000-2005 The Apache Software Foundation -dnl -dnl Licensed under the Apache License, Version 2.0 (the "License"); -dnl you may not use this file except in compliance with the License. -dnl You may obtain a copy of the License at +dnl Licensed to the Apache Software Foundation (ASF) under one or more +dnl contributor license agreements. See the NOTICE file distributed with +dnl this work for additional information regarding copyright ownership. +dnl The ASF licenses this file to You under the Apache License, Version 2.0 +dnl (the "License"); you may not use this file except in compliance with +dnl the License. You may obtain a copy of the License at dnl dnl http://www.apache.org/licenses/LICENSE-2.0 dnl diff --git a/build/jlibtool.c b/build/jlibtool.c index b3ca79cae0a..6a1796ee734 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/build/pkg/buildpkg.sh b/build/pkg/buildpkg.sh index 273c664aa1f..073e89d746f 100755 --- a/build/pkg/buildpkg.sh +++ b/build/pkg/buildpkg.sh @@ -1,10 +1,10 @@ #!/bin/sh -# Copyright 2000-2005 The Apache Software Foundation or its licensors, as -# applicable. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # diff --git a/buildconf b/buildconf index 7f80ecd5a8c..bc0e9fdbaab 100755 --- a/buildconf +++ b/buildconf @@ -1,11 +1,11 @@ #!/bin/sh -# Copyright 2000-2005 The Apache Software Foundation or its licensors, as -# applicable. +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 0b4736addea..910e0238d45 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 797c11089bf..e2fe45c7c74 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/dso/netware/dso.c b/dso/netware/dso.c index 9bc24d72ce5..1ac98e8d42a 100644 --- a/dso/netware/dso.c +++ b/dso/netware/dso.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/dso/os2/dso.c b/dso/os2/dso.c index 7e735841e26..e50f4dc0982 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/dso/os390/dso.c b/dso/os390/dso.c index 0dcac7a8e52..403179085e5 100644 --- a/dso/os390/dso.c +++ b/dso/os390/dso.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 73908722911..94255ecc788 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 17651db0120..6967b73e8f7 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 010d3b3da80..35b4a406874 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/netware/filesys.c b/file_io/netware/filesys.c index 50097644214..ba7dab71111 100644 --- a/file_io/netware/filesys.c +++ b/file_io/netware/filesys.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/netware/flock.c b/file_io/netware/flock.c index bd4beb037cf..a42f7a39be0 100644 --- a/file_io/netware/flock.c +++ b/file_io/netware/flock.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/netware/mktemp.c b/file_io/netware/mktemp.c index f1568bdd64a..5fd9b9bd820 100644 --- a/file_io/netware/mktemp.c +++ b/file_io/netware/mktemp.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 2763bd97f57..f79260df6b5 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/os2/buffer.c b/file_io/os2/buffer.c index 2e56b9933d3..6734cd577b6 100644 --- a/file_io/os2/buffer.c +++ b/file_io/os2/buffer.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 8a140248d87..ae40adbad12 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/os2/dir_make_recurse.c b/file_io/os2/dir_make_recurse.c index 9cde1a987d4..eab1af8fbde 100644 --- a/file_io/os2/dir_make_recurse.c +++ b/file_io/os2/dir_make_recurse.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/os2/fileacc.c b/file_io/os2/fileacc.c index 0b0c26d24a6..c4a6916ba92 100644 --- a/file_io/os2/fileacc.c +++ b/file_io/os2/fileacc.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 859b45a6ae2..50d0e85951d 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/os2/filepath.c b/file_io/os2/filepath.c index 827a6551d52..0d917d7c25d 100644 --- a/file_io/os2/filepath.c +++ b/file_io/os2/filepath.c @@ -1,9 +1,9 @@ -/* Copyright 2004-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 259acfa1b02..16a858841be 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c index cf3b8329888..4289db14261 100644 --- a/file_io/os2/filesys.c +++ b/file_io/os2/filesys.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/os2/flock.c b/file_io/os2/flock.c index 4c5e54d93f1..34bae12cb95 100644 --- a/file_io/os2/flock.c +++ b/file_io/os2/flock.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c index 2ea84bb4d50..e218db6b919 100644 --- a/file_io/os2/maperrorcode.c +++ b/file_io/os2/maperrorcode.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/os2/open.c b/file_io/os2/open.c index ed2a11e75fe..566b38e0cd5 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 1e18946848f..d7a766d5277 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index d2b09bf60ff..19aa6916e1f 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index bb1e97573b0..c5e6bb99e82 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/buffer.c b/file_io/unix/buffer.c index bbd05bc1eec..5208740a5dc 100644 --- a/file_io/unix/buffer.c +++ b/file_io/unix/buffer.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index 8ee0f590a45..516380995ec 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -1,9 +1,9 @@ -/* Copyright 2002-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 659a4ed5d91..0cdd1fbff92 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 542d90db87b..8b795c00030 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 877c64922bf..d9945789497 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index fd0b6a25001..a29d98eb0fb 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/filepath_util.c b/file_io/unix/filepath_util.c index ec9b4260904..2109e444a8a 100644 --- a/file_io/unix/filepath_util.c +++ b/file_io/unix/filepath_util.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 93ecb608d86..88b9b97fa5c 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c index 9aeb4fe3ef7..daa443d5fc2 100644 --- a/file_io/unix/flock.c +++ b/file_io/unix/flock.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index c22b0c5597b..601f059221a 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index c516fac81b3..2032f298af0 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 7f550cd129c..5a40ca20d8c 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index d8e52495ccf..cd8d5e03608 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 131f28cb189..a72edf7cb0e 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 73f8d25ab3e..5591c0ad886 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/unix/tempdir.c b/file_io/unix/tempdir.c index 4409cd99d25..8afa8971123 100644 --- a/file_io/unix/tempdir.c +++ b/file_io/unix/tempdir.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/win32/buffer.c b/file_io/win32/buffer.c index 2e56b9933d3..6734cd577b6 100644 --- a/file_io/win32/buffer.c +++ b/file_io/win32/buffer.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 92d896e6162..284ddcd50aa 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index e576d85baf4..0fa1ced5402 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 602cbc64832..0d918a8656f 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index d5618da21c3..09cc47707d8 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c index 6d6c2bce8f0..59e0ee14cd6 100644 --- a/file_io/win32/filesys.c +++ b/file_io/win32/filesys.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index 1950ac11296..f001e89cd10 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/win32/open.c b/file_io/win32/open.c index fa4e1da6d4f..a782d6c3f47 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index a080770d5e3..577042b1e61 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 2f8ba9ecefc..7db77f29d19 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index a9ac5f5d90e..6413dd27130 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr.h.in b/include/apr.h.in index 9fdc8581820..65698b7ea74 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr.hnw b/include/apr.hnw index a9011dc1371..8f50cef8c49 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr.hw b/include/apr.hw index 3a33ad177df..b71d6cc9623 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_allocator.h b/include/apr_allocator.h index de29e911d5d..44fd55c9e8c 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_atomic.h b/include/apr_atomic.h index d70106980d8..c3f48e6ef3d 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_dso.h b/include/apr_dso.h index 91c6d5befa4..74b5bc6a071 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_env.h b/include/apr_env.h index 9e3d2a72d88..ad72495d1ee 100644 --- a/include/apr_env.h +++ b/include/apr_env.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_errno.h b/include/apr_errno.h index 0890196f8e1..5ef221f5ea2 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_file_info.h b/include/apr_file_info.h index da810a396ba..9c6202ca920 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 72c9e9bf000..34b77b58118 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_general.h b/include/apr_general.h index 5973a986ea7..f70c99baede 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_getopt.h b/include/apr_getopt.h index b786cbd6d76..9c5a10b9b69 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index 7decb282501..bce2e8c7a7b 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_hash.h b/include/apr_hash.h index ef8f53f2a2b..b63d29a2de6 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_inherit.h b/include/apr_inherit.h index 4042c901350..9056a1bea4c 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_lib.h b/include/apr_lib.h index 802359419f1..5d1c38df44b 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_mmap.h b/include/apr_mmap.h index f1b45e37971..46b10be5d86 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 7006abd1603..8317bb66d69 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_poll.h b/include/apr_poll.h index 601463e50d8..68175353c92 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_pools.h b/include/apr_pools.h index 52880b6d162..90afe41345d 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_portable.h b/include/apr_portable.h index b37263b787f..e6b5cb1b6b8 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index 05c9f196508..384bb42f08d 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_random.h b/include/apr_random.h index b5c2baaa5d9..137bb0a7388 100644 --- a/include/apr_random.h +++ b/include/apr_random.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_ring.h b/include/apr_ring.h index ba1ac1f7a74..06cfa1344ce 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_shm.h b/include/apr_shm.h index 2acb53e344e..b9321a2e3cb 100644 --- a/include/apr_shm.h +++ b/include/apr_shm.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_signal.h b/include/apr_signal.h index 8cf65be8b00..f4368e69ec8 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_strings.h b/include/apr_strings.h index 94e99c3f10d..107917c0aeb 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_support.h b/include/apr_support.h index 98cf410e6f9..eb4b639ee58 100644 --- a/include/apr_support.h +++ b/include/apr_support.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_tables.h b/include/apr_tables.h index 6078c5d8c87..9d6d02003ad 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h index 8b8a553235e..b13d7fcac69 100644 --- a/include/apr_thread_cond.h +++ b/include/apr_thread_cond.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 4d73164d411..0c86b55bf92 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index edfcad10c9b..ceaa4a46f7a 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_thread_rwlock.h b/include/apr_thread_rwlock.h index b8890b9d5c6..13d40bcd16a 100644 --- a/include/apr_thread_rwlock.h +++ b/include/apr_thread_rwlock.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_time.h b/include/apr_time.h index 1882b283e59..0fbc8fd9073 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_user.h b/include/apr_user.h index 2529b79137f..b5b17fd1fb1 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_version.h b/include/apr_version.h index cd8ba052f6c..7811537970e 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/apr_want.h b/include/apr_want.h index b0da0a0c938..19094bb8819 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/aix/apr_arch_dso.h b/include/arch/aix/apr_arch_dso.h index cc9c026639c..bdff8593478 100644 --- a/include/arch/aix/apr_arch_dso.h +++ b/include/arch/aix/apr_arch_dso.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/apr_private_common.h b/include/arch/apr_private_common.h index c5fbbaa9fa5..39dc550e649 100644 --- a/include/arch/apr_private_common.h +++ b/include/arch/apr_private_common.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/beos/apr_arch_dso.h b/include/arch/beos/apr_arch_dso.h index 1bf3395c067..da419ae9f43 100644 --- a/include/arch/beos/apr_arch_dso.h +++ b/include/arch/beos/apr_arch_dso.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/beos/apr_arch_proc_mutex.h b/include/arch/beos/apr_arch_proc_mutex.h index 1325e00ed07..b41be9144bf 100644 --- a/include/arch/beos/apr_arch_proc_mutex.h +++ b/include/arch/beos/apr_arch_proc_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/beos/apr_arch_thread_cond.h b/include/arch/beos/apr_arch_thread_cond.h index b4584b47ca2..985ab28d864 100644 --- a/include/arch/beos/apr_arch_thread_cond.h +++ b/include/arch/beos/apr_arch_thread_cond.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/beos/apr_arch_thread_mutex.h b/include/arch/beos/apr_arch_thread_mutex.h index af9c96f87b1..d9694ab0f40 100644 --- a/include/arch/beos/apr_arch_thread_mutex.h +++ b/include/arch/beos/apr_arch_thread_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/beos/apr_arch_thread_rwlock.h b/include/arch/beos/apr_arch_thread_rwlock.h index 7f911816d57..a7680206fa9 100644 --- a/include/arch/beos/apr_arch_thread_rwlock.h +++ b/include/arch/beos/apr_arch_thread_rwlock.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/beos/apr_arch_threadproc.h b/include/arch/beos/apr_arch_threadproc.h index c11fe4e39e6..3ad0e41dc79 100644 --- a/include/arch/beos/apr_arch_threadproc.h +++ b/include/arch/beos/apr_arch_threadproc.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/netware/apr_arch_dso.h b/include/arch/netware/apr_arch_dso.h index 18d24036265..cd794908858 100644 --- a/include/arch/netware/apr_arch_dso.h +++ b/include/arch/netware/apr_arch_dso.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/netware/apr_arch_file_io.h b/include/arch/netware/apr_arch_file_io.h index 1d2b0a0e331..8ecf458e5db 100644 --- a/include/arch/netware/apr_arch_file_io.h +++ b/include/arch/netware/apr_arch_file_io.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/netware/apr_arch_global_mutex.h b/include/arch/netware/apr_arch_global_mutex.h index f8f534fef27..16d0d7f989a 100644 --- a/include/arch/netware/apr_arch_global_mutex.h +++ b/include/arch/netware/apr_arch_global_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/netware/apr_arch_internal_time.h b/include/arch/netware/apr_arch_internal_time.h index 399ac72e794..55a9052977a 100644 --- a/include/arch/netware/apr_arch_internal_time.h +++ b/include/arch/netware/apr_arch_internal_time.h @@ -1,9 +1,9 @@ -/* Copyright 2001-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/netware/apr_arch_networkio.h b/include/arch/netware/apr_arch_networkio.h index a15afc586ea..6ae4083e644 100644 --- a/include/arch/netware/apr_arch_networkio.h +++ b/include/arch/netware/apr_arch_networkio.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/netware/apr_arch_pre_nw.h b/include/arch/netware/apr_arch_pre_nw.h index 6c0026c6b77..e80f140f70e 100644 --- a/include/arch/netware/apr_arch_pre_nw.h +++ b/include/arch/netware/apr_arch_pre_nw.h @@ -11,12 +11,12 @@ #define N_PLAT_NLM -/* Copyright 2004-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/netware/apr_arch_proc_mutex.h b/include/arch/netware/apr_arch_proc_mutex.h index 09c325e4fe6..842ec93e5c2 100644 --- a/include/arch/netware/apr_arch_proc_mutex.h +++ b/include/arch/netware/apr_arch_proc_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/netware/apr_arch_thread_cond.h b/include/arch/netware/apr_arch_thread_cond.h index bfb5ece393c..03469434acc 100644 --- a/include/arch/netware/apr_arch_thread_cond.h +++ b/include/arch/netware/apr_arch_thread_cond.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/netware/apr_arch_thread_mutex.h b/include/arch/netware/apr_arch_thread_mutex.h index d9b599a0e34..ee0616f394f 100644 --- a/include/arch/netware/apr_arch_thread_mutex.h +++ b/include/arch/netware/apr_arch_thread_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/netware/apr_arch_thread_rwlock.h b/include/arch/netware/apr_arch_thread_rwlock.h index b87e2d5dbf2..32d02ffb177 100644 --- a/include/arch/netware/apr_arch_thread_rwlock.h +++ b/include/arch/netware/apr_arch_thread_rwlock.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/netware/apr_arch_threadproc.h b/include/arch/netware/apr_arch_threadproc.h index b30d6f6e3ef..27d8d4a3ef0 100644 --- a/include/arch/netware/apr_arch_threadproc.h +++ b/include/arch/netware/apr_arch_threadproc.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 04a3b0b91c2..3cc9f56c435 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/os2/apr_arch_dso.h b/include/arch/os2/apr_arch_dso.h index 9a202a3fa2b..4864f1afc8d 100644 --- a/include/arch/os2/apr_arch_dso.h +++ b/include/arch/os2/apr_arch_dso.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/os2/apr_arch_file_io.h b/include/arch/os2/apr_arch_file_io.h index c878273b30e..699f29ee419 100644 --- a/include/arch/os2/apr_arch_file_io.h +++ b/include/arch/os2/apr_arch_file_io.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/os2/apr_arch_networkio.h b/include/arch/os2/apr_arch_networkio.h index dc8d9e700dd..19e52ce0f60 100644 --- a/include/arch/os2/apr_arch_networkio.h +++ b/include/arch/os2/apr_arch_networkio.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/os2/apr_arch_os2calls.h b/include/arch/os2/apr_arch_os2calls.h index 3705ee94a58..f213b6790df 100644 --- a/include/arch/os2/apr_arch_os2calls.h +++ b/include/arch/os2/apr_arch_os2calls.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/os2/apr_arch_proc_mutex.h b/include/arch/os2/apr_arch_proc_mutex.h index 737a162da12..e4dd8e50bb3 100644 --- a/include/arch/os2/apr_arch_proc_mutex.h +++ b/include/arch/os2/apr_arch_proc_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/os2/apr_arch_thread_cond.h b/include/arch/os2/apr_arch_thread_cond.h index 05d56b6e21e..f8eae8bfd0d 100644 --- a/include/arch/os2/apr_arch_thread_cond.h +++ b/include/arch/os2/apr_arch_thread_cond.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/os2/apr_arch_thread_mutex.h b/include/arch/os2/apr_arch_thread_mutex.h index b4454294350..439ab62196e 100644 --- a/include/arch/os2/apr_arch_thread_mutex.h +++ b/include/arch/os2/apr_arch_thread_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/os2/apr_arch_thread_rwlock.h b/include/arch/os2/apr_arch_thread_rwlock.h index b942d595e3b..b6414471847 100644 --- a/include/arch/os2/apr_arch_thread_rwlock.h +++ b/include/arch/os2/apr_arch_thread_rwlock.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/os2/apr_arch_threadproc.h b/include/arch/os2/apr_arch_threadproc.h index 91ed2e3f93d..01b69ce51b7 100644 --- a/include/arch/os2/apr_arch_threadproc.h +++ b/include/arch/os2/apr_arch_threadproc.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/os390/apr_arch_dso.h b/include/arch/os390/apr_arch_dso.h index 2cd2112a218..9709e09b9bd 100644 --- a/include/arch/os390/apr_arch_dso.h +++ b/include/arch/os390/apr_arch_dso.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/unix/apr_arch_dso.h b/include/arch/unix/apr_arch_dso.h index e5d9d8305f5..525de7fed70 100644 --- a/include/arch/unix/apr_arch_dso.h +++ b/include/arch/unix/apr_arch_dso.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index 874d790ba30..00896cfe7c6 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/unix/apr_arch_global_mutex.h b/include/arch/unix/apr_arch_global_mutex.h index e5724dc7b0c..d9bb7847965 100644 --- a/include/arch/unix/apr_arch_global_mutex.h +++ b/include/arch/unix/apr_arch_global_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/unix/apr_arch_inherit.h b/include/arch/unix/apr_arch_inherit.h index 22914e2ef60..eda1609551d 100644 --- a/include/arch/unix/apr_arch_inherit.h +++ b/include/arch/unix/apr_arch_inherit.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/unix/apr_arch_internal_time.h b/include/arch/unix/apr_arch_internal_time.h index 321921e9fc2..5f4f3352b1c 100644 --- a/include/arch/unix/apr_arch_internal_time.h +++ b/include/arch/unix/apr_arch_internal_time.h @@ -1,9 +1,9 @@ -/* Copyright 2001-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/unix/apr_arch_misc.h b/include/arch/unix/apr_arch_misc.h index 4168a2b5cc2..4a5e47194a4 100644 --- a/include/arch/unix/apr_arch_misc.h +++ b/include/arch/unix/apr_arch_misc.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/unix/apr_arch_networkio.h b/include/arch/unix/apr_arch_networkio.h index 28aa1e64dff..c9a5019d593 100644 --- a/include/arch/unix/apr_arch_networkio.h +++ b/include/arch/unix/apr_arch_networkio.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index c653a8084a6..bd43129241b 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/unix/apr_arch_proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h index 3ed046cb117..536b2f01b7f 100644 --- a/include/arch/unix/apr_arch_proc_mutex.h +++ b/include/arch/unix/apr_arch_proc_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/unix/apr_arch_shm.h b/include/arch/unix/apr_arch_shm.h index b57df765fae..d11b9e5750d 100644 --- a/include/arch/unix/apr_arch_shm.h +++ b/include/arch/unix/apr_arch_shm.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/unix/apr_arch_thread_cond.h b/include/arch/unix/apr_arch_thread_cond.h index 643b01d59e6..5d6dfa5838e 100644 --- a/include/arch/unix/apr_arch_thread_cond.h +++ b/include/arch/unix/apr_arch_thread_cond.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/unix/apr_arch_thread_mutex.h b/include/arch/unix/apr_arch_thread_mutex.h index 6b1b6717b56..ff2d22bf3b5 100644 --- a/include/arch/unix/apr_arch_thread_mutex.h +++ b/include/arch/unix/apr_arch_thread_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/unix/apr_arch_thread_rwlock.h b/include/arch/unix/apr_arch_thread_rwlock.h index c4631897c2e..685157d0ce0 100644 --- a/include/arch/unix/apr_arch_thread_rwlock.h +++ b/include/arch/unix/apr_arch_thread_rwlock.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h index 970b58ff4a8..1f294868cca 100644 --- a/include/arch/unix/apr_arch_threadproc.h +++ b/include/arch/unix/apr_arch_threadproc.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/win32/apr_arch_atime.h b/include/arch/win32/apr_arch_atime.h index 00fed32c76e..5ab83a3245c 100644 --- a/include/arch/win32/apr_arch_atime.h +++ b/include/arch/win32/apr_arch_atime.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/win32/apr_arch_dso.h b/include/arch/win32/apr_arch_dso.h index e26f4ecc716..3c07dbe6eb0 100644 --- a/include/arch/win32/apr_arch_dso.h +++ b/include/arch/win32/apr_arch_dso.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index c31f2f62169..d12abf35cb7 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/win32/apr_arch_inherit.h b/include/arch/win32/apr_arch_inherit.h index b7eb1e673ff..2ddb0bd61f3 100644 --- a/include/arch/win32/apr_arch_inherit.h +++ b/include/arch/win32/apr_arch_inherit.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index a6d5c00f64e..c30c7534361 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/win32/apr_arch_networkio.h b/include/arch/win32/apr_arch_networkio.h index a180ccf7c1d..96765fa2663 100644 --- a/include/arch/win32/apr_arch_networkio.h +++ b/include/arch/win32/apr_arch_networkio.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/win32/apr_arch_proc_mutex.h b/include/arch/win32/apr_arch_proc_mutex.h index aaac5a30c76..86981ce3414 100644 --- a/include/arch/win32/apr_arch_proc_mutex.h +++ b/include/arch/win32/apr_arch_proc_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/win32/apr_arch_thread_cond.h b/include/arch/win32/apr_arch_thread_cond.h index 01252328a23..facae474b46 100644 --- a/include/arch/win32/apr_arch_thread_cond.h +++ b/include/arch/win32/apr_arch_thread_cond.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/win32/apr_arch_thread_mutex.h b/include/arch/win32/apr_arch_thread_mutex.h index e180b7d42d4..99066c4d534 100644 --- a/include/arch/win32/apr_arch_thread_mutex.h +++ b/include/arch/win32/apr_arch_thread_mutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/win32/apr_arch_thread_rwlock.h b/include/arch/win32/apr_arch_thread_rwlock.h index 5a41fb97d08..c9deb29e143 100644 --- a/include/arch/win32/apr_arch_thread_rwlock.h +++ b/include/arch/win32/apr_arch_thread_rwlock.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/win32/apr_arch_threadproc.h b/include/arch/win32/apr_arch_threadproc.h index 3fb64a0e9db..ea87fe027b5 100644 --- a/include/arch/win32/apr_arch_threadproc.h +++ b/include/arch/win32/apr_arch_threadproc.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/win32/apr_arch_utf8.h b/include/arch/win32/apr_arch_utf8.h index c3ca62745fa..a658dc14efd 100644 --- a/include/arch/win32/apr_arch_utf8.h +++ b/include/arch/win32/apr_arch_utf8.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/win32/apr_dbg_win32_handles.h b/include/arch/win32/apr_dbg_win32_handles.h index 291d77db07f..0fa20418c74 100644 --- a/include/arch/win32/apr_dbg_win32_handles.h +++ b/include/arch/win32/apr_dbg_win32_handles.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index ac93d1ed870..d55080def12 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index 85f4e06e91b..f9631069a63 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c index dc9ba618c3b..74c8b58e119 100644 --- a/locks/beos/thread_cond.c +++ b/locks/beos/thread_cond.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index 5f488f16fb0..81718c23a67 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/beos/thread_rwlock.c b/locks/beos/thread_rwlock.c index be11017a253..668b81b3214 100644 --- a/locks/beos/thread_rwlock.c +++ b/locks/beos/thread_rwlock.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 72a8bfcddc3..ddc08597c07 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c index fdaa9587326..857cf424594 100644 --- a/locks/netware/thread_cond.c +++ b/locks/netware/thread_cond.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index 0d41b30e063..32968cb8fb1 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/netware/thread_rwlock.c b/locks/netware/thread_rwlock.c index 1631012a2d6..8c92c276534 100644 --- a/locks/netware/thread_rwlock.c +++ b/locks/netware/thread_rwlock.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 8527e3f5509..6cb49a2e41c 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/os2/thread_cond.c b/locks/os2/thread_cond.c index 575d91a8da7..a327077257a 100644 --- a/locks/os2/thread_cond.c +++ b/locks/os2/thread_cond.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index 0b21ea4e4a1..3ec68977f4b 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/os2/thread_rwlock.c b/locks/os2/thread_rwlock.c index 653112dab66..ba5acf55001 100644 --- a/locks/os2/thread_rwlock.c +++ b/locks/os2/thread_rwlock.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index 9a72d1438c1..add09562ecf 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 4ae4682d3db..99e58a989b1 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c index c1ebb895c06..01ecab1236d 100644 --- a/locks/unix/thread_cond.c +++ b/locks/unix/thread_cond.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 31a566f6e9b..f88417db455 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c index 18f374794a3..daf93f5711d 100644 --- a/locks/unix/thread_rwlock.c +++ b/locks/unix/thread_rwlock.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 8a9026e4685..d677016a18a 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index 8e8b5b52408..6f064222aab 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 20c757f96e4..62a4322f6ea 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c index 2e4ec62b802..363a26f7b8b 100644 --- a/locks/win32/thread_rwlock.c +++ b/locks/win32/thread_rwlock.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 3b188a41cf2..011e4f8c85d 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/netware/charset.c b/misc/netware/charset.c index c771abc07d5..84f8524b7d5 100644 --- a/misc/netware/charset.c +++ b/misc/netware/charset.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index 23e7c7ec2cb..b7d9d72dcf8 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -1,9 +1,9 @@ -/* Copyright 2004-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/netware/rand.c b/misc/netware/rand.c index 8dd89dace2e..275f9b88fb4 100644 --- a/misc/netware/rand.c +++ b/misc/netware/rand.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/netware/start.c b/misc/netware/start.c index 2cbfe9bfce6..13d1282e478 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/unix/charset.c b/misc/unix/charset.c index 8a4b897413f..f3e9cec3cb8 100644 --- a/misc/unix/charset.c +++ b/misc/unix/charset.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/unix/env.c b/misc/unix/env.c index 4b95c5d9be0..172e95e2586 100644 --- a/misc/unix/env.c +++ b/misc/unix/env.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 45b8e21eca3..764be06ee57 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 8ae41410c4f..e84b81c4795 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 28359b959dd..3a670557370 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/unix/randbyte_os2.inc b/misc/unix/randbyte_os2.inc index ee23f8d901c..8f6433fd0fb 100644 --- a/misc/unix/randbyte_os2.inc +++ b/misc/unix/randbyte_os2.inc @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/unix/start.c b/misc/unix/start.c index c1176bdea13..6832f999ed1 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/unix/version.c b/misc/unix/version.c index a46cf6c2c58..4cf252420d1 100644 --- a/misc/unix/version.c +++ b/misc/unix/version.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index 712ac793e4f..dae8e641de8 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/win32/charset.c b/misc/win32/charset.c index c0db7718406..9eb056e1f67 100644 --- a/misc/win32/charset.c +++ b/misc/win32/charset.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/win32/env.c b/misc/win32/env.c index d8edc400bfd..2afeeacae27 100644 --- a/misc/win32/env.c +++ b/misc/win32/env.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/win32/internal.c b/misc/win32/internal.c index 9d73d917c39..6d5fcf4fda2 100644 --- a/misc/win32/internal.c +++ b/misc/win32/internal.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 815a67d033c..3d106f63709 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/win32/rand.c b/misc/win32/rand.c index c7a469f8fc3..0f0954f0f4e 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/win32/start.c b/misc/win32/start.c index 01da8581754..2e133d1c17f 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/misc/win32/utf8.c b/misc/win32/utf8.c index d77e656d364..d2b60c71466 100644 --- a/misc/win32/utf8.c +++ b/misc/win32/utf8.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/mmap/unix/common.c b/mmap/unix/common.c index b300a993d9a..8fdc3e949a3 100644 --- a/mmap/unix/common.c +++ b/mmap/unix/common.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index fdce7fa7f05..9b5908dd0ab 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index 4db585281bc..b43cd111128 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 8ffafbb9b0c..84be4db8872 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/network_io/os2/os2calls.c b/network_io/os2/os2calls.c index ef204ca7a8f..ced8de4ef07 100644 --- a/network_io/os2/os2calls.c +++ b/network_io/os2/os2calls.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index 42c057d4025..9feb7cd8200 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c index 7a79e715dce..f54a91c587a 100644 --- a/network_io/os2/sendrecv_udp.c +++ b/network_io/os2/sendrecv_udp.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index f1c00b5b108..2b799e13432 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 5f8a70371c1..e05cca47459 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index edbc2287085..d8fd348dd39 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -1,9 +1,9 @@ -/* Copyright 2004-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 1e1a7d552bb..a678ce7f4d1 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index cef713bccc6..52f5278a90c 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 48f1cf4d856..0dc52a13f00 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index ce2c151c4e8..ef6ebe4d23d 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 5a4fff14ae3..f687cb9856e 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 5621241fe21..8fd0e26b861 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 73c7317ed76..0a77051d65d 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index c8dcf3e5fd3..452f8fe0eb0 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/poll/os2/poll.c b/poll/os2/poll.c index 7116babf5cf..7589dd1541b 100644 --- a/poll/os2/poll.c +++ b/poll/os2/poll.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c index 473f2a8a901..8831350db3b 100644 --- a/poll/os2/pollset.c +++ b/poll/os2/pollset.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 468b23ac7db..4c88e9aefff 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index a3a00f54172..1de35a17937 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 717522d27de..045d5a67c99 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/poll/unix/port.c b/poll/unix/port.c index dde105ee9f5..4d50198d906 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/poll/unix/select.c b/poll/unix/select.c index a64ddbad951..7c83434e0f8 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c index 88a48bcb9ad..a5a30d92059 100644 --- a/random/unix/apr_random.c +++ b/random/unix/apr_random.c @@ -1,9 +1,9 @@ -/* Copyright 2003-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/random/unix/sha2.c b/random/unix/sha2.c index 63d2fe93418..b054006491f 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -1,9 +1,9 @@ -/* Copyright 2003-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/random/unix/sha2.h b/random/unix/sha2.h index b1c3988d55b..2c990df9903 100644 --- a/random/unix/sha2.h +++ b/random/unix/sha2.h @@ -1,9 +1,9 @@ -/* Copyright 2003-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index 0f70eed1c81..3ca55e34317 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c index 62949233823..4437ca4dce6 100644 --- a/shmem/os2/shm.c +++ b/shmem/os2/shm.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index d5b0bc6a3d4..5a2182df308 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 1c9bca9b2f7..48931934ce2 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index 80db81107e4..fb06f1d207e 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index c0510a38ba2..531c1830954 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 973c3209c53..64c7623be02 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/strings/apr_strtok.c b/strings/apr_strtok.c index b0326334624..6081367302e 100644 --- a/strings/apr_strtok.c +++ b/strings/apr_strtok.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/support/unix/waitio.c b/support/unix/waitio.c index 167ad6d0801..70726b4824e 100644 --- a/support/unix/waitio.c +++ b/support/unix/waitio.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/tables/apr_hash.c b/tables/apr_hash.c index e852fead866..e6892e514b1 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 2ef93a8f49f..2ee39aff4c3 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/abts_tests.h b/test/abts_tests.h index 744204d0cd8..1dc78842863 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/echod.c b/test/echod.c index 280f15ddef4..adcd2b796ac 100644 --- a/test/echod.c +++ b/test/echod.c @@ -1,9 +1,9 @@ -/* Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/globalmutexchild.c b/test/globalmutexchild.c index e26d0a80951..3a16fa4771e 100644 --- a/test/globalmutexchild.c +++ b/test/globalmutexchild.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/internal/testregex.c b/test/internal/testregex.c index 0103d4482b2..3b08b78e059 100644 --- a/test/internal/testregex.c +++ b/test/internal/testregex.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/internal/testucs.c b/test/internal/testucs.c index 80e3454503d..0f42470c86d 100644 --- a/test/internal/testucs.c +++ b/test/internal/testucs.c @@ -1,9 +1,9 @@ -/* Copyright 2002-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/mod_test.c b/test/mod_test.c index 5184d78c100..7fa4f9b7269 100644 --- a/test/mod_test.c +++ b/test/mod_test.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/readchild.c b/test/readchild.c index 82ef82f6673..f9b3b6a36f9 100644 --- a/test/readchild.c +++ b/test/readchild.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/sendfile.c b/test/sendfile.c index ae8b4cf90bf..dd241419723 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/sockchild.c b/test/sockchild.c index c81ec4a3fb0..18ee8bdf8d1 100644 --- a/test/sockchild.c +++ b/test/sockchild.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/sockperf.c b/test/sockperf.c index dc125b2de05..8c7d1b12716 100644 --- a/test/sockperf.c +++ b/test/sockperf.c @@ -1,9 +1,9 @@ -/* Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testargs.c b/test/testargs.c index 9dc68beb50b..2c161b3a3a1 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testatomic.c b/test/testatomic.c index baf32a62a5e..58dd9edfd0f 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testdir.c b/test/testdir.c index 0e5cc51e041..5e3b120aeba 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testdso.c b/test/testdso.c index 106ab41c744..30309e7a8cf 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testdup.c b/test/testdup.c index a41f7098b39..299fe873634 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testenv.c b/test/testenv.c index 4d6f55c1c4e..d1c4d3a97e9 100644 --- a/test/testenv.c +++ b/test/testenv.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testfile.c b/test/testfile.c index 3ebb6847acb..72497f1b39b 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testfilecopy.c b/test/testfilecopy.c index 457a36128a7..ad544ae310f 100644 --- a/test/testfilecopy.c +++ b/test/testfilecopy.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testfileinfo.c b/test/testfileinfo.c index 6a6cf10f671..aad1f9bb44c 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testflock.c b/test/testflock.c index 61e469d3714..34f1f8314b4 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testflock.h b/test/testflock.h index 0c1fd1852e4..f186a01434a 100644 --- a/test/testflock.h +++ b/test/testflock.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testfmt.c b/test/testfmt.c index f4548be363b..db89d4c4a45 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testfnmatch.c b/test/testfnmatch.c index 3b01b0f31d7..926b389e381 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index ccd7d7bea50..6bcdf5d6235 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testglobalmutex.h b/test/testglobalmutex.h index 87581a2dec8..1c6ce5c9db9 100644 --- a/test/testglobalmutex.h +++ b/test/testglobalmutex.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testhash.c b/test/testhash.c index b2e2b0ac4f5..51ec9e26ea5 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testipsub.c b/test/testipsub.c index a5743b0ae3e..d2192ccd931 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testlfs.c b/test/testlfs.c index cf53050a3c3..2b2f625b722 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -1,9 +1,9 @@ -/* Copyright 2004-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testlock.c b/test/testlock.c index c74164282ab..e331e3c16e4 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testlockperf.c b/test/testlockperf.c index c0c7236f13b..f1884fee296 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testmmap.c b/test/testmmap.c index 958f2ecea8c..ab0c5857cea 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testmutexscope.c b/test/testmutexscope.c index 087f15d1c09..ba3df0b06d9 100644 --- a/test/testmutexscope.c +++ b/test/testmutexscope.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testnames.c b/test/testnames.c index c888af5a329..65474ada411 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testoc.c b/test/testoc.c index b20393b3722..5727bc2cd64 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testpath.c b/test/testpath.c index 4ada86c6232..f9b13c17e80 100644 --- a/test/testpath.c +++ b/test/testpath.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testpipe.c b/test/testpipe.c index 10f0f81e038..962d72e8aa6 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testpoll.c b/test/testpoll.c index 3e166470c0c..208308e7db6 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testpools.c b/test/testpools.c index 2e81c154bf9..88fb53d3d47 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testproc.c b/test/testproc.c index aa534339b63..dab0b773e77 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 0ddda096cfe..4bcda6f95c7 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testrand.c b/test/testrand.c index f92a0b1ce84..1b23e896087 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testrand2.c b/test/testrand2.c index d271d2d5c1d..7f6e0b0337d 100644 --- a/test/testrand2.c +++ b/test/testrand2.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testshm.c b/test/testshm.c index 7329aa6de00..ab6d4859072 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testshm.h b/test/testshm.h index e61b315be43..eea99db9938 100644 --- a/test/testshm.h +++ b/test/testshm.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testshmconsumer.c b/test/testshmconsumer.c index bede62fe883..eba36e591b7 100644 --- a/test/testshmconsumer.c +++ b/test/testshmconsumer.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testshmproducer.c b/test/testshmproducer.c index dbab1298fd8..56975155e72 100644 --- a/test/testshmproducer.c +++ b/test/testshmproducer.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testsleep.c b/test/testsleep.c index 16a1519f4a8..ad328a9ad02 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testsock.c b/test/testsock.c index d5a3e65a54b..9717e5434d1 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testsock.h b/test/testsock.h index 243cbf9eef8..e83dbec10c2 100644 --- a/test/testsock.h +++ b/test/testsock.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testsockets.c b/test/testsockets.c index 1e23b38ad98..d2874ef7a21 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testsockopt.c b/test/testsockopt.c index 41e4102d7e5..e2956d3f4d9 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/teststr.c b/test/teststr.c index 38cceb6f2e3..ccfa1175a09 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/teststrnatcmp.c b/test/teststrnatcmp.c index c0b92d619df..0639cd698bc 100644 --- a/test/teststrnatcmp.c +++ b/test/teststrnatcmp.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testtable.c b/test/testtable.c index 1ba69a53653..9cbde394a13 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -1,9 +1,9 @@ -/* Copyright 2002-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testtemp.c b/test/testtemp.c index bff48d25322..991bd0e6222 100644 --- a/test/testtemp.c +++ b/test/testtemp.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testthread.c b/test/testthread.c index ef32e5d28d4..7724e061846 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testtime.c b/test/testtime.c index f7e4d3c9fe6..b970ab4500b 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testud.c b/test/testud.c index ef9a61b32d0..a44c0d25100 100644 --- a/test/testud.c +++ b/test/testud.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testuser.c b/test/testuser.c index 7c423adf1ab..b6f847e1b13 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testutil.c b/test/testutil.c index 44c0b6b583e..e07c9a146a2 100644 --- a/test/testutil.c +++ b/test/testutil.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testutil.h b/test/testutil.h index 76dd8d912e8..8da709f50ae 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/testvsn.c b/test/testvsn.c index 96bba669d8a..88794e4f934 100644 --- a/test/testvsn.c +++ b/test/testvsn.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/test/tryread.c b/test/tryread.c index 26274ca5e79..9a874a83e27 100644 --- a/test/tryread.c +++ b/test/tryread.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/beos/apr_proc_stub.c b/threadproc/beos/apr_proc_stub.c index 0c069f7ec3a..99b6315f6d8 100644 --- a/threadproc/beos/apr_proc_stub.c +++ b/threadproc/beos/apr_proc_stub.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 1bde8e3c989..749280d4718 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 68cbdf1d851..e7f447c2d91 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index 15dcd3a0736..465fddc3d05 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/beos/threadproc_common.c b/threadproc/beos/threadproc_common.c index 96c6e8a4ef6..16e3ff36a63 100644 --- a/threadproc/beos/threadproc_common.c +++ b/threadproc/beos/threadproc_common.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 2622ba89558..442f99585c8 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/netware/procsup.c b/threadproc/netware/procsup.c index 008dcaae0c8..0ff8d39d80b 100644 --- a/threadproc/netware/procsup.c +++ b/threadproc/netware/procsup.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c index c2903251b45..4e29088271d 100644 --- a/threadproc/netware/signals.c +++ b/threadproc/netware/signals.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 35ae8c88c79..8df241a890b 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/netware/threadpriv.c b/threadproc/netware/threadpriv.c index 2e99e522f72..7317d29cb17 100644 --- a/threadproc/netware/threadpriv.c +++ b/threadproc/netware/threadpriv.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 57f0afe6728..66797e8fbff 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 8235bff8a50..b94edcfe1ac 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index 041ff182f9c..ebe22aee475 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index f7802a44cea..fec6c271084 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index da6cc4c06b4..fcd4effd406 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 920d8aab4d0..865e72ea50c 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index a6d671b9cd3..9c2676f372d 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 77088a1b48c..fd9de2bbdd6 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 49290735a10..b83e5a4c51a 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index a51cf7e258e..6982b91ff2e 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 61e5d8084ed..d78213398bf 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index d99a3e9b6a4..08ca0b66258 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/time/unix/time.c b/time/unix/time.c index a4176631f8a..48edcf49b52 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/time/unix/timestr.c b/time/unix/timestr.c index 770cdb3b591..54bd1e0cab7 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/time/win32/access.c b/time/win32/access.c index a4c96efd10b..8a94f79752e 100644 --- a/time/win32/access.c +++ b/time/win32/access.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/time/win32/time.c b/time/win32/time.c index 3209f470ae5..2123f04e4c1 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/time/win32/timestr.c b/time/win32/timestr.c index a533a0aea10..3448286282d 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/user/netware/groupinfo.c b/user/netware/groupinfo.c index 5e247474f63..92029bc0121 100644 --- a/user/netware/groupinfo.c +++ b/user/netware/groupinfo.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/user/netware/userinfo.c b/user/netware/userinfo.c index a960406b4e5..936948f05b4 100644 --- a/user/netware/userinfo.c +++ b/user/netware/userinfo.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 8bf97691cda..2fc1464e546 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 815bf7e50b8..ef0cf4a9c85 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index 622b9aa1c07..dde949d743a 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index a102470c181..2bfd69ff135 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -1,9 +1,9 @@ -/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as - * applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The AF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * From d4cfc1b36d26d0b45cc6960aff8045301da38588 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 3 Aug 2006 10:55:31 +0000 Subject: [PATCH 5705/7878] Fix the typo. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@428317 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/netware/apr_atomic.c | 2 +- atomic/os390/atomic.c | 2 +- atomic/unix/apr_atomic.c | 2 +- atomic/win32/apr_atomic.c | 2 +- build/aplibtool.c | 2 +- build/jlibtool.c | 2 +- dso/aix/dso.c | 2 +- dso/beos/dso.c | 2 +- dso/netware/dso.c | 2 +- dso/os2/dso.c | 2 +- dso/os390/dso.c | 2 +- dso/unix/dso.c | 2 +- dso/win32/dso.c | 2 +- file_io/netware/filestat.c | 2 +- file_io/netware/filesys.c | 2 +- file_io/netware/flock.c | 2 +- file_io/netware/mktemp.c | 2 +- file_io/netware/pipe.c | 2 +- file_io/os2/buffer.c | 2 +- file_io/os2/dir.c | 2 +- file_io/os2/dir_make_recurse.c | 2 +- file_io/os2/fileacc.c | 2 +- file_io/os2/filedup.c | 2 +- file_io/os2/filepath.c | 2 +- file_io/os2/filestat.c | 2 +- file_io/os2/filesys.c | 2 +- file_io/os2/flock.c | 2 +- file_io/os2/maperrorcode.c | 2 +- file_io/os2/open.c | 2 +- file_io/os2/pipe.c | 2 +- file_io/os2/readwrite.c | 2 +- file_io/os2/seek.c | 2 +- file_io/unix/buffer.c | 2 +- file_io/unix/copy.c | 2 +- file_io/unix/dir.c | 2 +- file_io/unix/fileacc.c | 2 +- file_io/unix/filedup.c | 2 +- file_io/unix/filepath.c | 2 +- file_io/unix/filepath_util.c | 2 +- file_io/unix/filestat.c | 2 +- file_io/unix/flock.c | 2 +- file_io/unix/fullrw.c | 2 +- file_io/unix/mktemp.c | 2 +- file_io/unix/open.c | 2 +- file_io/unix/pipe.c | 2 +- file_io/unix/readwrite.c | 2 +- file_io/unix/seek.c | 2 +- file_io/unix/tempdir.c | 2 +- file_io/win32/buffer.c | 2 +- file_io/win32/dir.c | 2 +- file_io/win32/filedup.c | 2 +- file_io/win32/filepath.c | 2 +- file_io/win32/filestat.c | 2 +- file_io/win32/filesys.c | 2 +- file_io/win32/flock.c | 2 +- file_io/win32/open.c | 2 +- file_io/win32/pipe.c | 2 +- file_io/win32/readwrite.c | 2 +- file_io/win32/seek.c | 2 +- include/apr.h.in | 2 +- include/apr.hnw | 2 +- include/apr.hw | 2 +- include/apr_allocator.h | 2 +- include/apr_atomic.h | 2 +- include/apr_dso.h | 2 +- include/apr_env.h | 2 +- include/apr_errno.h | 2 +- include/apr_file_info.h | 2 +- include/apr_file_io.h | 2 +- include/apr_general.h | 2 +- include/apr_getopt.h | 2 +- include/apr_global_mutex.h | 2 +- include/apr_hash.h | 2 +- include/apr_inherit.h | 2 +- include/apr_lib.h | 2 +- include/apr_mmap.h | 2 +- include/apr_network_io.h | 2 +- include/apr_poll.h | 2 +- include/apr_pools.h | 2 +- include/apr_portable.h | 2 +- include/apr_proc_mutex.h | 2 +- include/apr_random.h | 2 +- include/apr_ring.h | 2 +- include/apr_shm.h | 2 +- include/apr_signal.h | 2 +- include/apr_strings.h | 2 +- include/apr_support.h | 2 +- include/apr_tables.h | 2 +- include/apr_thread_cond.h | 2 +- include/apr_thread_mutex.h | 2 +- include/apr_thread_proc.h | 2 +- include/apr_thread_rwlock.h | 2 +- include/apr_time.h | 2 +- include/apr_user.h | 2 +- include/apr_version.h | 2 +- include/apr_want.h | 2 +- include/arch/aix/apr_arch_dso.h | 2 +- include/arch/apr_private_common.h | 2 +- include/arch/beos/apr_arch_dso.h | 2 +- include/arch/beos/apr_arch_proc_mutex.h | 2 +- include/arch/beos/apr_arch_thread_cond.h | 2 +- include/arch/beos/apr_arch_thread_mutex.h | 2 +- include/arch/beos/apr_arch_thread_rwlock.h | 2 +- include/arch/beos/apr_arch_threadproc.h | 2 +- include/arch/netware/apr_arch_dso.h | 2 +- include/arch/netware/apr_arch_file_io.h | 2 +- include/arch/netware/apr_arch_global_mutex.h | 2 +- include/arch/netware/apr_arch_internal_time.h | 2 +- include/arch/netware/apr_arch_networkio.h | 2 +- include/arch/netware/apr_arch_pre_nw.h | 2 +- include/arch/netware/apr_arch_proc_mutex.h | 2 +- include/arch/netware/apr_arch_thread_cond.h | 2 +- include/arch/netware/apr_arch_thread_mutex.h | 2 +- include/arch/netware/apr_arch_thread_rwlock.h | 2 +- include/arch/netware/apr_arch_threadproc.h | 2 +- include/arch/netware/apr_private.h | 2 +- include/arch/os2/apr_arch_dso.h | 2 +- include/arch/os2/apr_arch_file_io.h | 2 +- include/arch/os2/apr_arch_networkio.h | 2 +- include/arch/os2/apr_arch_os2calls.h | 2 +- include/arch/os2/apr_arch_proc_mutex.h | 2 +- include/arch/os2/apr_arch_thread_cond.h | 2 +- include/arch/os2/apr_arch_thread_mutex.h | 2 +- include/arch/os2/apr_arch_thread_rwlock.h | 2 +- include/arch/os2/apr_arch_threadproc.h | 2 +- include/arch/os390/apr_arch_dso.h | 2 +- include/arch/unix/apr_arch_dso.h | 2 +- include/arch/unix/apr_arch_file_io.h | 2 +- include/arch/unix/apr_arch_global_mutex.h | 2 +- include/arch/unix/apr_arch_inherit.h | 2 +- include/arch/unix/apr_arch_internal_time.h | 2 +- include/arch/unix/apr_arch_misc.h | 2 +- include/arch/unix/apr_arch_networkio.h | 2 +- include/arch/unix/apr_arch_poll_private.h | 2 +- include/arch/unix/apr_arch_proc_mutex.h | 2 +- include/arch/unix/apr_arch_shm.h | 2 +- include/arch/unix/apr_arch_thread_cond.h | 2 +- include/arch/unix/apr_arch_thread_mutex.h | 2 +- include/arch/unix/apr_arch_thread_rwlock.h | 2 +- include/arch/unix/apr_arch_threadproc.h | 2 +- include/arch/win32/apr_arch_atime.h | 2 +- include/arch/win32/apr_arch_dso.h | 2 +- include/arch/win32/apr_arch_file_io.h | 2 +- include/arch/win32/apr_arch_inherit.h | 2 +- include/arch/win32/apr_arch_misc.h | 2 +- include/arch/win32/apr_arch_networkio.h | 2 +- include/arch/win32/apr_arch_proc_mutex.h | 2 +- include/arch/win32/apr_arch_thread_cond.h | 2 +- include/arch/win32/apr_arch_thread_mutex.h | 2 +- include/arch/win32/apr_arch_thread_rwlock.h | 2 +- include/arch/win32/apr_arch_threadproc.h | 2 +- include/arch/win32/apr_arch_utf8.h | 2 +- include/arch/win32/apr_dbg_win32_handles.h | 2 +- include/arch/win32/apr_private.h | 2 +- locks/beos/proc_mutex.c | 2 +- locks/beos/thread_cond.c | 2 +- locks/beos/thread_mutex.c | 2 +- locks/beos/thread_rwlock.c | 2 +- locks/netware/proc_mutex.c | 2 +- locks/netware/thread_cond.c | 2 +- locks/netware/thread_mutex.c | 2 +- locks/netware/thread_rwlock.c | 2 +- locks/os2/proc_mutex.c | 2 +- locks/os2/thread_cond.c | 2 +- locks/os2/thread_mutex.c | 2 +- locks/os2/thread_rwlock.c | 2 +- locks/unix/global_mutex.c | 2 +- locks/unix/proc_mutex.c | 2 +- locks/unix/thread_cond.c | 2 +- locks/unix/thread_mutex.c | 2 +- locks/unix/thread_rwlock.c | 2 +- locks/win32/proc_mutex.c | 2 +- locks/win32/thread_cond.c | 2 +- locks/win32/thread_mutex.c | 2 +- locks/win32/thread_rwlock.c | 2 +- memory/unix/apr_pools.c | 2 +- misc/netware/charset.c | 2 +- misc/netware/libprews.c | 2 +- misc/netware/rand.c | 2 +- misc/netware/start.c | 2 +- misc/unix/charset.c | 2 +- misc/unix/env.c | 2 +- misc/unix/errorcodes.c | 2 +- misc/unix/otherchild.c | 2 +- misc/unix/rand.c | 2 +- misc/unix/randbyte_os2.inc | 2 +- misc/unix/start.c | 2 +- misc/unix/version.c | 2 +- misc/win32/apr_app.c | 2 +- misc/win32/charset.c | 2 +- misc/win32/env.c | 2 +- misc/win32/internal.c | 2 +- misc/win32/misc.c | 2 +- misc/win32/rand.c | 2 +- misc/win32/start.c | 2 +- misc/win32/utf8.c | 2 +- mmap/unix/common.c | 2 +- mmap/unix/mmap.c | 2 +- mmap/win32/mmap.c | 2 +- network_io/beos/sendrecv.c | 2 +- network_io/os2/os2calls.c | 2 +- network_io/os2/sendrecv.c | 2 +- network_io/os2/sendrecv_udp.c | 2 +- network_io/os2/sockets.c | 2 +- network_io/os2/sockopt.c | 2 +- network_io/unix/multicast.c | 2 +- network_io/unix/sendrecv.c | 2 +- network_io/unix/sockaddr.c | 2 +- network_io/unix/sockets.c | 2 +- network_io/unix/sockopt.c | 2 +- network_io/win32/sendrecv.c | 2 +- network_io/win32/sockets.c | 2 +- network_io/win32/sockopt.c | 2 +- passwd/apr_getpass.c | 2 +- poll/os2/poll.c | 2 +- poll/os2/pollset.c | 2 +- poll/unix/epoll.c | 2 +- poll/unix/kqueue.c | 2 +- poll/unix/poll.c | 2 +- poll/unix/port.c | 2 +- poll/unix/select.c | 2 +- random/unix/apr_random.c | 2 +- random/unix/sha2.c | 2 +- random/unix/sha2.h | 2 +- shmem/beos/shm.c | 2 +- shmem/os2/shm.c | 2 +- shmem/unix/shm.c | 2 +- shmem/win32/shm.c | 2 +- strings/apr_cpystrn.c | 2 +- strings/apr_snprintf.c | 2 +- strings/apr_strings.c | 2 +- strings/apr_strtok.c | 2 +- support/unix/waitio.c | 2 +- tables/apr_hash.c | 2 +- tables/apr_tables.c | 2 +- test/abts_tests.h | 2 +- test/echod.c | 2 +- test/globalmutexchild.c | 2 +- test/internal/testregex.c | 2 +- test/internal/testucs.c | 2 +- test/mod_test.c | 2 +- test/readchild.c | 2 +- test/sendfile.c | 2 +- test/sockchild.c | 2 +- test/sockperf.c | 2 +- test/testargs.c | 2 +- test/testatomic.c | 2 +- test/testdir.c | 2 +- test/testdso.c | 2 +- test/testdup.c | 2 +- test/testenv.c | 2 +- test/testfile.c | 2 +- test/testfilecopy.c | 2 +- test/testfileinfo.c | 2 +- test/testflock.c | 2 +- test/testflock.h | 2 +- test/testfmt.c | 2 +- test/testfnmatch.c | 2 +- test/testglobalmutex.c | 2 +- test/testglobalmutex.h | 2 +- test/testhash.c | 2 +- test/testipsub.c | 2 +- test/testlfs.c | 2 +- test/testlock.c | 2 +- test/testlockperf.c | 2 +- test/testmmap.c | 2 +- test/testmutexscope.c | 2 +- test/testnames.c | 2 +- test/testoc.c | 2 +- test/testpath.c | 2 +- test/testpipe.c | 2 +- test/testpoll.c | 2 +- test/testpools.c | 2 +- test/testproc.c | 2 +- test/testprocmutex.c | 2 +- test/testrand.c | 2 +- test/testrand2.c | 2 +- test/testshm.c | 2 +- test/testshm.h | 2 +- test/testshmconsumer.c | 2 +- test/testshmproducer.c | 2 +- test/testsleep.c | 2 +- test/testsock.c | 2 +- test/testsock.h | 2 +- test/testsockets.c | 2 +- test/testsockopt.c | 2 +- test/teststr.c | 2 +- test/teststrnatcmp.c | 2 +- test/testtable.c | 2 +- test/testtemp.c | 2 +- test/testthread.c | 2 +- test/testtime.c | 2 +- test/testud.c | 2 +- test/testuser.c | 2 +- test/testutil.c | 2 +- test/testutil.h | 2 +- test/testvsn.c | 2 +- test/tryread.c | 2 +- threadproc/beos/apr_proc_stub.c | 2 +- threadproc/beos/proc.c | 2 +- threadproc/beos/thread.c | 2 +- threadproc/beos/threadpriv.c | 2 +- threadproc/beos/threadproc_common.c | 2 +- threadproc/netware/proc.c | 2 +- threadproc/netware/procsup.c | 2 +- threadproc/netware/signals.c | 2 +- threadproc/netware/thread.c | 2 +- threadproc/netware/threadpriv.c | 2 +- threadproc/os2/proc.c | 2 +- threadproc/os2/thread.c | 2 +- threadproc/os2/threadpriv.c | 2 +- threadproc/unix/proc.c | 2 +- threadproc/unix/procsup.c | 2 +- threadproc/unix/signals.c | 2 +- threadproc/unix/thread.c | 2 +- threadproc/unix/threadpriv.c | 2 +- threadproc/win32/proc.c | 2 +- threadproc/win32/signals.c | 2 +- threadproc/win32/thread.c | 2 +- threadproc/win32/threadpriv.c | 2 +- time/unix/time.c | 2 +- time/unix/timestr.c | 2 +- time/win32/access.c | 2 +- time/win32/time.c | 2 +- time/win32/timestr.c | 2 +- user/netware/groupinfo.c | 2 +- user/netware/userinfo.c | 2 +- user/unix/groupinfo.c | 2 +- user/unix/userinfo.c | 2 +- user/win32/groupinfo.c | 2 +- user/win32/userinfo.c | 2 +- 331 files changed, 331 insertions(+), 331 deletions(-) diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index 1937ffaaf69..94a3549775e 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c index 7ebde145420..35ddf1c2266 100644 --- a/atomic/os390/atomic.c +++ b/atomic/os390/atomic.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 38b99ad7afb..23c5c6509f7 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index 9f1c10b0337..e88f2e2564c 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/build/aplibtool.c b/build/aplibtool.c index 858595406a7..8f4943c3edb 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/build/jlibtool.c b/build/jlibtool.c index 6a1796ee734..735123d5032 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 910e0238d45..25f6262af86 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/dso/beos/dso.c b/dso/beos/dso.c index e2fe45c7c74..91dd1b4e81c 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/dso/netware/dso.c b/dso/netware/dso.c index 1ac98e8d42a..4cd2ad611ed 100644 --- a/dso/netware/dso.c +++ b/dso/netware/dso.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/dso/os2/dso.c b/dso/os2/dso.c index e50f4dc0982..1a7f7de838a 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/dso/os390/dso.c b/dso/os390/dso.c index 403179085e5..293d0653e75 100644 --- a/dso/os390/dso.c +++ b/dso/os390/dso.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 94255ecc788..e3baf72ce8e 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 6967b73e8f7..d4a689387b3 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 35b4a406874..2996676a90b 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/netware/filesys.c b/file_io/netware/filesys.c index ba7dab71111..05c44cecd57 100644 --- a/file_io/netware/filesys.c +++ b/file_io/netware/filesys.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/netware/flock.c b/file_io/netware/flock.c index a42f7a39be0..c083a0ed401 100644 --- a/file_io/netware/flock.c +++ b/file_io/netware/flock.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/netware/mktemp.c b/file_io/netware/mktemp.c index 5fd9b9bd820..c5ffebd20d4 100644 --- a/file_io/netware/mktemp.c +++ b/file_io/netware/mktemp.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index f79260df6b5..4b6b8268878 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/os2/buffer.c b/file_io/os2/buffer.c index 6734cd577b6..34e4e639347 100644 --- a/file_io/os2/buffer.c +++ b/file_io/os2/buffer.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index ae40adbad12..3b08355f567 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/os2/dir_make_recurse.c b/file_io/os2/dir_make_recurse.c index eab1af8fbde..1f645b7dda7 100644 --- a/file_io/os2/dir_make_recurse.c +++ b/file_io/os2/dir_make_recurse.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/os2/fileacc.c b/file_io/os2/fileacc.c index c4a6916ba92..b5c1afd5031 100644 --- a/file_io/os2/fileacc.c +++ b/file_io/os2/fileacc.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 50d0e85951d..a9d0421e201 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/os2/filepath.c b/file_io/os2/filepath.c index 0d917d7c25d..9422faa957c 100644 --- a/file_io/os2/filepath.c +++ b/file_io/os2/filepath.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 16a858841be..cd163e41edd 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c index 4289db14261..ae43bc0a0fc 100644 --- a/file_io/os2/filesys.c +++ b/file_io/os2/filesys.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/os2/flock.c b/file_io/os2/flock.c index 34bae12cb95..ec94022081a 100644 --- a/file_io/os2/flock.c +++ b/file_io/os2/flock.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c index e218db6b919..282338bba03 100644 --- a/file_io/os2/maperrorcode.c +++ b/file_io/os2/maperrorcode.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 566b38e0cd5..62d611c4159 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index d7a766d5277..ee2b2b004ec 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 19aa6916e1f..2eb011e82ce 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index c5e6bb99e82..a8d13fe28b7 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/buffer.c b/file_io/unix/buffer.c index 5208740a5dc..5e384d21f5b 100644 --- a/file_io/unix/buffer.c +++ b/file_io/unix/buffer.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index 516380995ec..113a1081bdc 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 0cdd1fbff92..0583a4c17a6 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 8b795c00030..437f3589f55 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index d9945789497..d7a5d777533 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index a29d98eb0fb..1fc9f281ae9 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/filepath_util.c b/file_io/unix/filepath_util.c index 2109e444a8a..d8ccc567146 100644 --- a/file_io/unix/filepath_util.c +++ b/file_io/unix/filepath_util.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 88b9b97fa5c..e6f73e6fc53 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c index daa443d5fc2..f400a96701d 100644 --- a/file_io/unix/flock.c +++ b/file_io/unix/flock.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index 601f059221a..9ad27ec99b3 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 2032f298af0..e481014e5a3 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 5a40ca20d8c..f6b1a7cf4af 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index cd8d5e03608..5411f5d4078 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index a72edf7cb0e..b870ba8381f 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 5591c0ad886..03b0345c859 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/unix/tempdir.c b/file_io/unix/tempdir.c index 8afa8971123..1138e2c9006 100644 --- a/file_io/unix/tempdir.c +++ b/file_io/unix/tempdir.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/win32/buffer.c b/file_io/win32/buffer.c index 6734cd577b6..34e4e639347 100644 --- a/file_io/win32/buffer.c +++ b/file_io/win32/buffer.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 284ddcd50aa..76fe42bca89 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 0fa1ced5402..964ec680c45 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 0d918a8656f..766e35f8d82 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 09cc47707d8..af93bb933b4 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c index 59e0ee14cd6..ad31e3387ac 100644 --- a/file_io/win32/filesys.c +++ b/file_io/win32/filesys.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c index f001e89cd10..e08e08a7a40 100644 --- a/file_io/win32/flock.c +++ b/file_io/win32/flock.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/win32/open.c b/file_io/win32/open.c index a782d6c3f47..f81c9c80e54 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 577042b1e61..4b8b0d60d9b 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 7db77f29d19..2481afbfc7d 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 6413dd27130..daa48cf0fce 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr.h.in b/include/apr.h.in index 65698b7ea74..7d60c489ac2 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr.hnw b/include/apr.hnw index 8f50cef8c49..2af98b37880 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr.hw b/include/apr.hw index b71d6cc9623..dd3343afbfb 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 44fd55c9e8c..5aaeb1b2faf 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_atomic.h b/include/apr_atomic.h index c3f48e6ef3d..b169ff3dc1b 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_dso.h b/include/apr_dso.h index 74b5bc6a071..ac701cfdf55 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_env.h b/include/apr_env.h index ad72495d1ee..05419c37c16 100644 --- a/include/apr_env.h +++ b/include/apr_env.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_errno.h b/include/apr_errno.h index 5ef221f5ea2..9995446ec7e 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 9c6202ca920..135226bcef7 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 34b77b58118..96d37ecca35 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_general.h b/include/apr_general.h index f70c99baede..db1f25bc819 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_getopt.h b/include/apr_getopt.h index 9c5a10b9b69..75ad5663a0c 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index bce2e8c7a7b..9316001ce62 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_hash.h b/include/apr_hash.h index b63d29a2de6..bdf0620f62c 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_inherit.h b/include/apr_inherit.h index 9056a1bea4c..b7f7480f1ff 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_lib.h b/include/apr_lib.h index 5d1c38df44b..8b43b9402ba 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 46b10be5d86..77d697f5b55 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 8317bb66d69..52aa05198e3 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_poll.h b/include/apr_poll.h index 68175353c92..328c1229fea 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_pools.h b/include/apr_pools.h index 90afe41345d..12b843e119a 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_portable.h b/include/apr_portable.h index e6b5cb1b6b8..b1b21e37b7e 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index 384bb42f08d..ceb9c82a8dc 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_random.h b/include/apr_random.h index 137bb0a7388..9c0eac23ada 100644 --- a/include/apr_random.h +++ b/include/apr_random.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_ring.h b/include/apr_ring.h index 06cfa1344ce..eab1e69a843 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_shm.h b/include/apr_shm.h index b9321a2e3cb..4875ee1ff87 100644 --- a/include/apr_shm.h +++ b/include/apr_shm.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_signal.h b/include/apr_signal.h index f4368e69ec8..991cbadbaeb 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_strings.h b/include/apr_strings.h index 107917c0aeb..9c28f3f11e9 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_support.h b/include/apr_support.h index eb4b639ee58..79c8cb479e8 100644 --- a/include/apr_support.h +++ b/include/apr_support.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_tables.h b/include/apr_tables.h index 9d6d02003ad..855eff247e0 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h index b13d7fcac69..3744b090425 100644 --- a/include/apr_thread_cond.h +++ b/include/apr_thread_cond.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 0c86b55bf92..4596dce5d22 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index ceaa4a46f7a..c7930901b2f 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_thread_rwlock.h b/include/apr_thread_rwlock.h index 13d40bcd16a..0bd958fbfa3 100644 --- a/include/apr_thread_rwlock.h +++ b/include/apr_thread_rwlock.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_time.h b/include/apr_time.h index 0fbc8fd9073..253aa72b4ad 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_user.h b/include/apr_user.h index b5b17fd1fb1..0179e22644c 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_version.h b/include/apr_version.h index 7811537970e..58ab58c6e36 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/apr_want.h b/include/apr_want.h index 19094bb8819..be35f98972a 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/aix/apr_arch_dso.h b/include/arch/aix/apr_arch_dso.h index bdff8593478..d1cac684f6e 100644 --- a/include/arch/aix/apr_arch_dso.h +++ b/include/arch/aix/apr_arch_dso.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/apr_private_common.h b/include/arch/apr_private_common.h index 39dc550e649..9cd52ecf22c 100644 --- a/include/arch/apr_private_common.h +++ b/include/arch/apr_private_common.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/beos/apr_arch_dso.h b/include/arch/beos/apr_arch_dso.h index da419ae9f43..fbc5c2ff013 100644 --- a/include/arch/beos/apr_arch_dso.h +++ b/include/arch/beos/apr_arch_dso.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/beos/apr_arch_proc_mutex.h b/include/arch/beos/apr_arch_proc_mutex.h index b41be9144bf..c60d8c6228a 100644 --- a/include/arch/beos/apr_arch_proc_mutex.h +++ b/include/arch/beos/apr_arch_proc_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/beos/apr_arch_thread_cond.h b/include/arch/beos/apr_arch_thread_cond.h index 985ab28d864..c9420b53cb0 100644 --- a/include/arch/beos/apr_arch_thread_cond.h +++ b/include/arch/beos/apr_arch_thread_cond.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/beos/apr_arch_thread_mutex.h b/include/arch/beos/apr_arch_thread_mutex.h index d9694ab0f40..bb7d4ae80ba 100644 --- a/include/arch/beos/apr_arch_thread_mutex.h +++ b/include/arch/beos/apr_arch_thread_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/beos/apr_arch_thread_rwlock.h b/include/arch/beos/apr_arch_thread_rwlock.h index a7680206fa9..694b0d50465 100644 --- a/include/arch/beos/apr_arch_thread_rwlock.h +++ b/include/arch/beos/apr_arch_thread_rwlock.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/beos/apr_arch_threadproc.h b/include/arch/beos/apr_arch_threadproc.h index 3ad0e41dc79..13de0536345 100644 --- a/include/arch/beos/apr_arch_threadproc.h +++ b/include/arch/beos/apr_arch_threadproc.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/netware/apr_arch_dso.h b/include/arch/netware/apr_arch_dso.h index cd794908858..ea0fe8c254c 100644 --- a/include/arch/netware/apr_arch_dso.h +++ b/include/arch/netware/apr_arch_dso.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/netware/apr_arch_file_io.h b/include/arch/netware/apr_arch_file_io.h index 8ecf458e5db..3437bdaadff 100644 --- a/include/arch/netware/apr_arch_file_io.h +++ b/include/arch/netware/apr_arch_file_io.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/netware/apr_arch_global_mutex.h b/include/arch/netware/apr_arch_global_mutex.h index 16d0d7f989a..4167d378211 100644 --- a/include/arch/netware/apr_arch_global_mutex.h +++ b/include/arch/netware/apr_arch_global_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/netware/apr_arch_internal_time.h b/include/arch/netware/apr_arch_internal_time.h index 55a9052977a..59f1067208a 100644 --- a/include/arch/netware/apr_arch_internal_time.h +++ b/include/arch/netware/apr_arch_internal_time.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/netware/apr_arch_networkio.h b/include/arch/netware/apr_arch_networkio.h index 6ae4083e644..63f17abe595 100644 --- a/include/arch/netware/apr_arch_networkio.h +++ b/include/arch/netware/apr_arch_networkio.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/netware/apr_arch_pre_nw.h b/include/arch/netware/apr_arch_pre_nw.h index e80f140f70e..36d9942c1c6 100644 --- a/include/arch/netware/apr_arch_pre_nw.h +++ b/include/arch/netware/apr_arch_pre_nw.h @@ -14,7 +14,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/netware/apr_arch_proc_mutex.h b/include/arch/netware/apr_arch_proc_mutex.h index 842ec93e5c2..7a634c2e50d 100644 --- a/include/arch/netware/apr_arch_proc_mutex.h +++ b/include/arch/netware/apr_arch_proc_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/netware/apr_arch_thread_cond.h b/include/arch/netware/apr_arch_thread_cond.h index 03469434acc..b11a5f86a74 100644 --- a/include/arch/netware/apr_arch_thread_cond.h +++ b/include/arch/netware/apr_arch_thread_cond.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/netware/apr_arch_thread_mutex.h b/include/arch/netware/apr_arch_thread_mutex.h index ee0616f394f..0453799c2da 100644 --- a/include/arch/netware/apr_arch_thread_mutex.h +++ b/include/arch/netware/apr_arch_thread_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/netware/apr_arch_thread_rwlock.h b/include/arch/netware/apr_arch_thread_rwlock.h index 32d02ffb177..d2dbd42f798 100644 --- a/include/arch/netware/apr_arch_thread_rwlock.h +++ b/include/arch/netware/apr_arch_thread_rwlock.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/netware/apr_arch_threadproc.h b/include/arch/netware/apr_arch_threadproc.h index 27d8d4a3ef0..713ed295af0 100644 --- a/include/arch/netware/apr_arch_threadproc.h +++ b/include/arch/netware/apr_arch_threadproc.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 3cc9f56c435..ad659b5988b 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/os2/apr_arch_dso.h b/include/arch/os2/apr_arch_dso.h index 4864f1afc8d..2bda6b7c663 100644 --- a/include/arch/os2/apr_arch_dso.h +++ b/include/arch/os2/apr_arch_dso.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/os2/apr_arch_file_io.h b/include/arch/os2/apr_arch_file_io.h index 699f29ee419..399371237a9 100644 --- a/include/arch/os2/apr_arch_file_io.h +++ b/include/arch/os2/apr_arch_file_io.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/os2/apr_arch_networkio.h b/include/arch/os2/apr_arch_networkio.h index 19e52ce0f60..10c6de81fbb 100644 --- a/include/arch/os2/apr_arch_networkio.h +++ b/include/arch/os2/apr_arch_networkio.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/os2/apr_arch_os2calls.h b/include/arch/os2/apr_arch_os2calls.h index f213b6790df..3c739bfd19f 100644 --- a/include/arch/os2/apr_arch_os2calls.h +++ b/include/arch/os2/apr_arch_os2calls.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/os2/apr_arch_proc_mutex.h b/include/arch/os2/apr_arch_proc_mutex.h index e4dd8e50bb3..8caf3369dcc 100644 --- a/include/arch/os2/apr_arch_proc_mutex.h +++ b/include/arch/os2/apr_arch_proc_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/os2/apr_arch_thread_cond.h b/include/arch/os2/apr_arch_thread_cond.h index f8eae8bfd0d..648b85d148b 100644 --- a/include/arch/os2/apr_arch_thread_cond.h +++ b/include/arch/os2/apr_arch_thread_cond.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/os2/apr_arch_thread_mutex.h b/include/arch/os2/apr_arch_thread_mutex.h index 439ab62196e..3ae2a41db78 100644 --- a/include/arch/os2/apr_arch_thread_mutex.h +++ b/include/arch/os2/apr_arch_thread_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/os2/apr_arch_thread_rwlock.h b/include/arch/os2/apr_arch_thread_rwlock.h index b6414471847..7187d5cb2e5 100644 --- a/include/arch/os2/apr_arch_thread_rwlock.h +++ b/include/arch/os2/apr_arch_thread_rwlock.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/os2/apr_arch_threadproc.h b/include/arch/os2/apr_arch_threadproc.h index 01b69ce51b7..c8017adbff3 100644 --- a/include/arch/os2/apr_arch_threadproc.h +++ b/include/arch/os2/apr_arch_threadproc.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/os390/apr_arch_dso.h b/include/arch/os390/apr_arch_dso.h index 9709e09b9bd..4263297b407 100644 --- a/include/arch/os390/apr_arch_dso.h +++ b/include/arch/os390/apr_arch_dso.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/unix/apr_arch_dso.h b/include/arch/unix/apr_arch_dso.h index 525de7fed70..d82182d48b8 100644 --- a/include/arch/unix/apr_arch_dso.h +++ b/include/arch/unix/apr_arch_dso.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index 00896cfe7c6..11816421691 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/unix/apr_arch_global_mutex.h b/include/arch/unix/apr_arch_global_mutex.h index d9bb7847965..3add9ecfa75 100644 --- a/include/arch/unix/apr_arch_global_mutex.h +++ b/include/arch/unix/apr_arch_global_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/unix/apr_arch_inherit.h b/include/arch/unix/apr_arch_inherit.h index eda1609551d..9a6bdbca588 100644 --- a/include/arch/unix/apr_arch_inherit.h +++ b/include/arch/unix/apr_arch_inherit.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/unix/apr_arch_internal_time.h b/include/arch/unix/apr_arch_internal_time.h index 5f4f3352b1c..6e12c67439a 100644 --- a/include/arch/unix/apr_arch_internal_time.h +++ b/include/arch/unix/apr_arch_internal_time.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/unix/apr_arch_misc.h b/include/arch/unix/apr_arch_misc.h index 4a5e47194a4..823512506c6 100644 --- a/include/arch/unix/apr_arch_misc.h +++ b/include/arch/unix/apr_arch_misc.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/unix/apr_arch_networkio.h b/include/arch/unix/apr_arch_networkio.h index c9a5019d593..91018f7c6bd 100644 --- a/include/arch/unix/apr_arch_networkio.h +++ b/include/arch/unix/apr_arch_networkio.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index bd43129241b..f176eac0e54 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/unix/apr_arch_proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h index 536b2f01b7f..ec9796bc9d4 100644 --- a/include/arch/unix/apr_arch_proc_mutex.h +++ b/include/arch/unix/apr_arch_proc_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/unix/apr_arch_shm.h b/include/arch/unix/apr_arch_shm.h index d11b9e5750d..dbd9b9bc5c4 100644 --- a/include/arch/unix/apr_arch_shm.h +++ b/include/arch/unix/apr_arch_shm.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/unix/apr_arch_thread_cond.h b/include/arch/unix/apr_arch_thread_cond.h index 5d6dfa5838e..5c2b51d1f4b 100644 --- a/include/arch/unix/apr_arch_thread_cond.h +++ b/include/arch/unix/apr_arch_thread_cond.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/unix/apr_arch_thread_mutex.h b/include/arch/unix/apr_arch_thread_mutex.h index ff2d22bf3b5..40cdef3c656 100644 --- a/include/arch/unix/apr_arch_thread_mutex.h +++ b/include/arch/unix/apr_arch_thread_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/unix/apr_arch_thread_rwlock.h b/include/arch/unix/apr_arch_thread_rwlock.h index 685157d0ce0..2cb43af6a35 100644 --- a/include/arch/unix/apr_arch_thread_rwlock.h +++ b/include/arch/unix/apr_arch_thread_rwlock.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h index 1f294868cca..b76dc9be131 100644 --- a/include/arch/unix/apr_arch_threadproc.h +++ b/include/arch/unix/apr_arch_threadproc.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/win32/apr_arch_atime.h b/include/arch/win32/apr_arch_atime.h index 5ab83a3245c..35f2041a971 100644 --- a/include/arch/win32/apr_arch_atime.h +++ b/include/arch/win32/apr_arch_atime.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/win32/apr_arch_dso.h b/include/arch/win32/apr_arch_dso.h index 3c07dbe6eb0..e2e4e40f2ea 100644 --- a/include/arch/win32/apr_arch_dso.h +++ b/include/arch/win32/apr_arch_dso.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index d12abf35cb7..a0b4391f88a 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/win32/apr_arch_inherit.h b/include/arch/win32/apr_arch_inherit.h index 2ddb0bd61f3..97c7d05d0aa 100644 --- a/include/arch/win32/apr_arch_inherit.h +++ b/include/arch/win32/apr_arch_inherit.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index c30c7534361..39f7c36ca23 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/win32/apr_arch_networkio.h b/include/arch/win32/apr_arch_networkio.h index 96765fa2663..04be55595d1 100644 --- a/include/arch/win32/apr_arch_networkio.h +++ b/include/arch/win32/apr_arch_networkio.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/win32/apr_arch_proc_mutex.h b/include/arch/win32/apr_arch_proc_mutex.h index 86981ce3414..4e3e3993996 100644 --- a/include/arch/win32/apr_arch_proc_mutex.h +++ b/include/arch/win32/apr_arch_proc_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/win32/apr_arch_thread_cond.h b/include/arch/win32/apr_arch_thread_cond.h index facae474b46..840949c26a6 100644 --- a/include/arch/win32/apr_arch_thread_cond.h +++ b/include/arch/win32/apr_arch_thread_cond.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/win32/apr_arch_thread_mutex.h b/include/arch/win32/apr_arch_thread_mutex.h index 99066c4d534..13d3c1cbd57 100644 --- a/include/arch/win32/apr_arch_thread_mutex.h +++ b/include/arch/win32/apr_arch_thread_mutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/win32/apr_arch_thread_rwlock.h b/include/arch/win32/apr_arch_thread_rwlock.h index c9deb29e143..1177e529103 100644 --- a/include/arch/win32/apr_arch_thread_rwlock.h +++ b/include/arch/win32/apr_arch_thread_rwlock.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/win32/apr_arch_threadproc.h b/include/arch/win32/apr_arch_threadproc.h index ea87fe027b5..7af8ab6869b 100644 --- a/include/arch/win32/apr_arch_threadproc.h +++ b/include/arch/win32/apr_arch_threadproc.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/win32/apr_arch_utf8.h b/include/arch/win32/apr_arch_utf8.h index a658dc14efd..84f8bf775ef 100644 --- a/include/arch/win32/apr_arch_utf8.h +++ b/include/arch/win32/apr_arch_utf8.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/win32/apr_dbg_win32_handles.h b/include/arch/win32/apr_dbg_win32_handles.h index 0fa20418c74..471cd66dbfc 100644 --- a/include/arch/win32/apr_dbg_win32_handles.h +++ b/include/arch/win32/apr_dbg_win32_handles.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index d55080def12..0dc5f989634 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index f9631069a63..ce2a580bacc 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c index 74c8b58e119..e3ea4600039 100644 --- a/locks/beos/thread_cond.c +++ b/locks/beos/thread_cond.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index 81718c23a67..b87f76606ff 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/beos/thread_rwlock.c b/locks/beos/thread_rwlock.c index 668b81b3214..a540b445574 100644 --- a/locks/beos/thread_rwlock.c +++ b/locks/beos/thread_rwlock.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index ddc08597c07..77411d0bf2d 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c index 857cf424594..dcb21edc9e0 100644 --- a/locks/netware/thread_cond.c +++ b/locks/netware/thread_cond.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index 32968cb8fb1..98bf33bd223 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/netware/thread_rwlock.c b/locks/netware/thread_rwlock.c index 8c92c276534..d0bf3ddf342 100644 --- a/locks/netware/thread_rwlock.c +++ b/locks/netware/thread_rwlock.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 6cb49a2e41c..5a49356355a 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/os2/thread_cond.c b/locks/os2/thread_cond.c index a327077257a..ec6034f55d9 100644 --- a/locks/os2/thread_cond.c +++ b/locks/os2/thread_cond.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index 3ec68977f4b..5d8436be4f5 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/os2/thread_rwlock.c b/locks/os2/thread_rwlock.c index ba5acf55001..195a56bda3e 100644 --- a/locks/os2/thread_rwlock.c +++ b/locks/os2/thread_rwlock.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index add09562ecf..bfe360aa998 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 99e58a989b1..841ad6bd85f 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c index 01ecab1236d..227c1d7f649 100644 --- a/locks/unix/thread_cond.c +++ b/locks/unix/thread_cond.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index f88417db455..e146a28f593 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c index daf93f5711d..4b28bb618ce 100644 --- a/locks/unix/thread_rwlock.c +++ b/locks/unix/thread_rwlock.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index d677016a18a..1033a1c3404 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index 6f064222aab..5f3cae277bb 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 62a4322f6ea..9b10d7278d8 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c index 363a26f7b8b..fd9d579f158 100644 --- a/locks/win32/thread_rwlock.c +++ b/locks/win32/thread_rwlock.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 011e4f8c85d..c9c851f47c6 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/netware/charset.c b/misc/netware/charset.c index 84f8524b7d5..b79add10b55 100644 --- a/misc/netware/charset.c +++ b/misc/netware/charset.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index b7d9d72dcf8..624bf22cfa4 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/netware/rand.c b/misc/netware/rand.c index 275f9b88fb4..a2baae7ecd3 100644 --- a/misc/netware/rand.c +++ b/misc/netware/rand.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/netware/start.c b/misc/netware/start.c index 13d1282e478..c8ccc1c1c49 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/unix/charset.c b/misc/unix/charset.c index f3e9cec3cb8..a66724d7201 100644 --- a/misc/unix/charset.c +++ b/misc/unix/charset.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/unix/env.c b/misc/unix/env.c index 172e95e2586..9ba6b61e783 100644 --- a/misc/unix/env.c +++ b/misc/unix/env.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 764be06ee57..e953d109279 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index e84b81c4795..427a57e7e47 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 3a670557370..7af77eb5afc 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/unix/randbyte_os2.inc b/misc/unix/randbyte_os2.inc index 8f6433fd0fb..4020e31fea2 100644 --- a/misc/unix/randbyte_os2.inc +++ b/misc/unix/randbyte_os2.inc @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/unix/start.c b/misc/unix/start.c index 6832f999ed1..4b8ad990de6 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/unix/version.c b/misc/unix/version.c index 4cf252420d1..2f111bf9dc0 100644 --- a/misc/unix/version.c +++ b/misc/unix/version.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c index dae8e641de8..77390859715 100644 --- a/misc/win32/apr_app.c +++ b/misc/win32/apr_app.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/win32/charset.c b/misc/win32/charset.c index 9eb056e1f67..d54d6e645c7 100644 --- a/misc/win32/charset.c +++ b/misc/win32/charset.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/win32/env.c b/misc/win32/env.c index 2afeeacae27..5c998643f03 100644 --- a/misc/win32/env.c +++ b/misc/win32/env.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/win32/internal.c b/misc/win32/internal.c index 6d5fcf4fda2..edd7f0a0ede 100644 --- a/misc/win32/internal.c +++ b/misc/win32/internal.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 3d106f63709..0d72823c263 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 0f0954f0f4e..8af1bdad5f2 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/win32/start.c b/misc/win32/start.c index 2e133d1c17f..b0ae15aa498 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/misc/win32/utf8.c b/misc/win32/utf8.c index d2b60c71466..b37dba44dad 100644 --- a/misc/win32/utf8.c +++ b/misc/win32/utf8.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/mmap/unix/common.c b/mmap/unix/common.c index 8fdc3e949a3..a9789928809 100644 --- a/mmap/unix/common.c +++ b/mmap/unix/common.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 9b5908dd0ab..67195709674 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index b43cd111128..134417707f8 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 84be4db8872..201abf89c89 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/network_io/os2/os2calls.c b/network_io/os2/os2calls.c index ced8de4ef07..6bf1fcd02eb 100644 --- a/network_io/os2/os2calls.c +++ b/network_io/os2/os2calls.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index 9feb7cd8200..839ff3f8313 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c index f54a91c587a..c0dcd8562ec 100644 --- a/network_io/os2/sendrecv_udp.c +++ b/network_io/os2/sendrecv_udp.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 2b799e13432..aa112a60007 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index e05cca47459..101a952d980 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index d8fd348dd39..8667a1bb318 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index a678ce7f4d1..c1029a14f75 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 52f5278a90c..e70e3bcb16c 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 0dc52a13f00..6d24cdcf008 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index ef6ebe4d23d..3fc932f42f5 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index f687cb9856e..c9d7dced521 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 8fd0e26b861..327a3fdea5a 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 0a77051d65d..c8e670fa79e 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 452f8fe0eb0..7e897749486 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/poll/os2/poll.c b/poll/os2/poll.c index 7589dd1541b..3c36e5e688e 100644 --- a/poll/os2/poll.c +++ b/poll/os2/poll.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c index 8831350db3b..0680c29c099 100644 --- a/poll/os2/pollset.c +++ b/poll/os2/pollset.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 4c88e9aefff..dc9a315dc6e 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 1de35a17937..a8bea919c30 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 045d5a67c99..34aba394dd4 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/poll/unix/port.c b/poll/unix/port.c index 4d50198d906..f668912b3f8 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/poll/unix/select.c b/poll/unix/select.c index 7c83434e0f8..ca35b77db9c 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c index a5a30d92059..41887d4b0f0 100644 --- a/random/unix/apr_random.c +++ b/random/unix/apr_random.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/random/unix/sha2.c b/random/unix/sha2.c index b054006491f..7f55dac959b 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/random/unix/sha2.h b/random/unix/sha2.h index 2c990df9903..9f0d93e1e01 100644 --- a/random/unix/sha2.h +++ b/random/unix/sha2.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index 3ca55e34317..1f06f78acd2 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c index 4437ca4dce6..340cae40743 100644 --- a/shmem/os2/shm.c +++ b/shmem/os2/shm.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 5a2182df308..95d1c053f0e 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 48931934ce2..36af7439641 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index fb06f1d207e..888b2e5db6a 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 531c1830954..7ad741100e9 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 64c7623be02..ec687913c53 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/strings/apr_strtok.c b/strings/apr_strtok.c index 6081367302e..517b319d47f 100644 --- a/strings/apr_strtok.c +++ b/strings/apr_strtok.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/support/unix/waitio.c b/support/unix/waitio.c index 70726b4824e..7232cdd9cea 100644 --- a/support/unix/waitio.c +++ b/support/unix/waitio.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/tables/apr_hash.c b/tables/apr_hash.c index e6892e514b1..6f58d98bcee 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 2ee39aff4c3..54b6eb069c9 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/abts_tests.h b/test/abts_tests.h index 1dc78842863..83e847177b5 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/echod.c b/test/echod.c index adcd2b796ac..c78e90fd5dd 100644 --- a/test/echod.c +++ b/test/echod.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/globalmutexchild.c b/test/globalmutexchild.c index 3a16fa4771e..4b8737b02bd 100644 --- a/test/globalmutexchild.c +++ b/test/globalmutexchild.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/internal/testregex.c b/test/internal/testregex.c index 3b08b78e059..20dcfdebe7b 100644 --- a/test/internal/testregex.c +++ b/test/internal/testregex.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/internal/testucs.c b/test/internal/testucs.c index 0f42470c86d..ca735d233bf 100644 --- a/test/internal/testucs.c +++ b/test/internal/testucs.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/mod_test.c b/test/mod_test.c index 7fa4f9b7269..2178e94059c 100644 --- a/test/mod_test.c +++ b/test/mod_test.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/readchild.c b/test/readchild.c index f9b3b6a36f9..f8443cceb8e 100644 --- a/test/readchild.c +++ b/test/readchild.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/sendfile.c b/test/sendfile.c index dd241419723..488d26481b5 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/sockchild.c b/test/sockchild.c index 18ee8bdf8d1..5c15d113fbe 100644 --- a/test/sockchild.c +++ b/test/sockchild.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/sockperf.c b/test/sockperf.c index 8c7d1b12716..a9fcedb863f 100644 --- a/test/sockperf.c +++ b/test/sockperf.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testargs.c b/test/testargs.c index 2c161b3a3a1..cb501924f1b 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testatomic.c b/test/testatomic.c index 58dd9edfd0f..b2c8d16df4c 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testdir.c b/test/testdir.c index 5e3b120aeba..82f145d6f1f 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testdso.c b/test/testdso.c index 30309e7a8cf..b87bdf70e10 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testdup.c b/test/testdup.c index 299fe873634..9d064ec0d8d 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testenv.c b/test/testenv.c index d1c4d3a97e9..6d9dacd16b4 100644 --- a/test/testenv.c +++ b/test/testenv.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testfile.c b/test/testfile.c index 72497f1b39b..0244aa11a2d 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testfilecopy.c b/test/testfilecopy.c index ad544ae310f..5b64bc0538d 100644 --- a/test/testfilecopy.c +++ b/test/testfilecopy.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testfileinfo.c b/test/testfileinfo.c index aad1f9bb44c..ea58e12cd5b 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testflock.c b/test/testflock.c index 34f1f8314b4..6eac94a7a00 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testflock.h b/test/testflock.h index f186a01434a..554a0ce5649 100644 --- a/test/testflock.h +++ b/test/testflock.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testfmt.c b/test/testfmt.c index db89d4c4a45..30b6155d5d6 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testfnmatch.c b/test/testfnmatch.c index 926b389e381..b54502fd295 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index 6bcdf5d6235..a10742d92fe 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testglobalmutex.h b/test/testglobalmutex.h index 1c6ce5c9db9..027062843dc 100644 --- a/test/testglobalmutex.h +++ b/test/testglobalmutex.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testhash.c b/test/testhash.c index 51ec9e26ea5..c9b1cdb07c1 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testipsub.c b/test/testipsub.c index d2192ccd931..1411cd05a7c 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testlfs.c b/test/testlfs.c index 2b2f625b722..694e0ea6bbe 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testlock.c b/test/testlock.c index e331e3c16e4..dddb52f76a9 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testlockperf.c b/test/testlockperf.c index f1884fee296..e0bf75ae83d 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testmmap.c b/test/testmmap.c index ab0c5857cea..69fc85c6863 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testmutexscope.c b/test/testmutexscope.c index ba3df0b06d9..0ea08cc634a 100644 --- a/test/testmutexscope.c +++ b/test/testmutexscope.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testnames.c b/test/testnames.c index 65474ada411..39e2e7c4f29 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testoc.c b/test/testoc.c index 5727bc2cd64..9dbaff8c377 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testpath.c b/test/testpath.c index f9b13c17e80..b05ae9917e0 100644 --- a/test/testpath.c +++ b/test/testpath.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testpipe.c b/test/testpipe.c index 962d72e8aa6..fcac4d25a66 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testpoll.c b/test/testpoll.c index 208308e7db6..36dd8a06bff 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testpools.c b/test/testpools.c index 88fb53d3d47..cb45552e772 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testproc.c b/test/testproc.c index dab0b773e77..b025c8e59d1 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 4bcda6f95c7..78b2efc4c46 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testrand.c b/test/testrand.c index 1b23e896087..7c8a41fe7dc 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testrand2.c b/test/testrand2.c index 7f6e0b0337d..39f761b2c58 100644 --- a/test/testrand2.c +++ b/test/testrand2.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testshm.c b/test/testshm.c index ab6d4859072..3691dd52ce1 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testshm.h b/test/testshm.h index eea99db9938..5b24a9d4271 100644 --- a/test/testshm.h +++ b/test/testshm.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testshmconsumer.c b/test/testshmconsumer.c index eba36e591b7..6a2a3c30d3e 100644 --- a/test/testshmconsumer.c +++ b/test/testshmconsumer.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testshmproducer.c b/test/testshmproducer.c index 56975155e72..58eb94fcd3f 100644 --- a/test/testshmproducer.c +++ b/test/testshmproducer.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testsleep.c b/test/testsleep.c index ad328a9ad02..eff24ddf6ea 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testsock.c b/test/testsock.c index 9717e5434d1..60dd8137948 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testsock.h b/test/testsock.h index e83dbec10c2..12a44f76537 100644 --- a/test/testsock.h +++ b/test/testsock.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testsockets.c b/test/testsockets.c index d2874ef7a21..7a8a663bd61 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testsockopt.c b/test/testsockopt.c index e2956d3f4d9..203e2c39ff7 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/teststr.c b/test/teststr.c index ccfa1175a09..680f9edce14 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/teststrnatcmp.c b/test/teststrnatcmp.c index 0639cd698bc..3a5e4c67ba7 100644 --- a/test/teststrnatcmp.c +++ b/test/teststrnatcmp.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testtable.c b/test/testtable.c index 9cbde394a13..d377eaf5a15 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testtemp.c b/test/testtemp.c index 991bd0e6222..1f1143ee359 100644 --- a/test/testtemp.c +++ b/test/testtemp.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testthread.c b/test/testthread.c index 7724e061846..f3df3678659 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testtime.c b/test/testtime.c index b970ab4500b..84b47726956 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testud.c b/test/testud.c index a44c0d25100..77cd28faa99 100644 --- a/test/testud.c +++ b/test/testud.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testuser.c b/test/testuser.c index b6f847e1b13..2029bea84b2 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testutil.c b/test/testutil.c index e07c9a146a2..c433e92c398 100644 --- a/test/testutil.c +++ b/test/testutil.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testutil.h b/test/testutil.h index 8da709f50ae..96394c5eb03 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/testvsn.c b/test/testvsn.c index 88794e4f934..dbc218a13fe 100644 --- a/test/testvsn.c +++ b/test/testvsn.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/tryread.c b/test/tryread.c index 9a874a83e27..729f8e699b9 100644 --- a/test/tryread.c +++ b/test/tryread.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/beos/apr_proc_stub.c b/threadproc/beos/apr_proc_stub.c index 99b6315f6d8..011d793e317 100644 --- a/threadproc/beos/apr_proc_stub.c +++ b/threadproc/beos/apr_proc_stub.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 749280d4718..7af73036f52 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index e7f447c2d91..629c86def7f 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index 465fddc3d05..442235f7dd6 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/beos/threadproc_common.c b/threadproc/beos/threadproc_common.c index 16e3ff36a63..95e16254400 100644 --- a/threadproc/beos/threadproc_common.c +++ b/threadproc/beos/threadproc_common.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 442f99585c8..0f707769994 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/netware/procsup.c b/threadproc/netware/procsup.c index 0ff8d39d80b..72fa1d9764d 100644 --- a/threadproc/netware/procsup.c +++ b/threadproc/netware/procsup.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c index 4e29088271d..bc660af7dc9 100644 --- a/threadproc/netware/signals.c +++ b/threadproc/netware/signals.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 8df241a890b..dcf4993db9b 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/netware/threadpriv.c b/threadproc/netware/threadpriv.c index 7317d29cb17..54680a56342 100644 --- a/threadproc/netware/threadpriv.c +++ b/threadproc/netware/threadpriv.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 66797e8fbff..20dfffb8b8b 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index b94edcfe1ac..c1c35219d0e 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index ebe22aee475..107ec10d712 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index fec6c271084..bf743527ce7 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index fcd4effd406..376baf21fc0 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 865e72ea50c..f44c3d7859c 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 9c2676f372d..371b31d624f 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index fd9de2bbdd6..c2785203801 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index b83e5a4c51a..5a909eb1d52 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 6982b91ff2e..b97023094ea 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index d78213398bf..63dde013039 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 08ca0b66258..0cbfe620e43 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/time/unix/time.c b/time/unix/time.c index 48edcf49b52..dfa45e690c6 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/time/unix/timestr.c b/time/unix/timestr.c index 54bd1e0cab7..f74febac192 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/time/win32/access.c b/time/win32/access.c index 8a94f79752e..c3ccad6bcfa 100644 --- a/time/win32/access.c +++ b/time/win32/access.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/time/win32/time.c b/time/win32/time.c index 2123f04e4c1..c3165a72c06 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 3448286282d..11692499149 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/user/netware/groupinfo.c b/user/netware/groupinfo.c index 92029bc0121..e7cfd9b2677 100644 --- a/user/netware/groupinfo.c +++ b/user/netware/groupinfo.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/user/netware/userinfo.c b/user/netware/userinfo.c index 936948f05b4..b58991b8ea5 100644 --- a/user/netware/userinfo.c +++ b/user/netware/userinfo.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 2fc1464e546..89ae966b678 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index ef0cf4a9c85..516445b56d5 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index dde949d743a..7739a5428dd 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 2bfd69ff135..aae3f9bec08 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The AF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * From 320484def9383f5dbb6af8aae245c0f94c50d3f6 Mon Sep 17 00:00:00 2001 From: Max Oliver Bowsher Date: Sun, 6 Aug 2006 22:55:41 +0000 Subject: [PATCH 5706/7878] Retroactively bring the STATUS file up-to-date. * apr/trunk/STATUS: Add missing release information. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@429204 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 4610c98e237..0f892946838 100644 --- a/STATUS +++ b/STATUS @@ -2,16 +2,27 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- Last modified at [$Date$] Releases: - -Standalone 1.3.0 : in development + 1.2.8 : in development + 1.2.7 : released April 14, 2006 + 1.2.6 : released March 25, 2006 + 1.2.5 : not released + 1.2.4 : not released + 1.2.3 : not released 1.2.2 : released October 11, 2005 1.2.1 : released August 18, 2005 1.2.0 : not released + 1.1.2 : no such version 1.1.1 : released March 17, 2005 1.1.0 : released January 25, 2005 1.0.1 : released November 19, 2004 1.0.0 : released September 1, 2004 + 0.9.13 : in development + 0.9.12 : released April 13, 2006 + 0.9.11 : released March 30, 2006 + 0.9.10 : tagged March 22, 2006, not released + 0.9.9 : tagged January 30, 2006, not released + 0.9.8 : tagged January 27, 2006, not released 0.9.7 : released October 11, 2005 0.9.6 : released February 4, 2005 0.9.5 : released November 19, 2004 @@ -21,7 +32,7 @@ Standalone 0.9.1 : released September 11, 2002 0.9.0 : released August 28, 2002 -Bundled with httpd +Bundled with httpd: 2.0a9 : released December 12, 2000 2.0a8 : released November 20, 2000 2.0a7 : released October 8, 2000 From 63a5636bfc0b2b613b9b797fa1dccd02f0131453 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 7 Aug 2006 11:00:22 +0000 Subject: [PATCH 5707/7878] * build/config.guess, build/config.sub: Update from savannah. Obtained from: FSF git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@429300 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 8 ++++---- build/config.sub | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/config.guess b/build/config.guess index 7924ac077df..396482d6cb5 100755 --- a/build/config.guess +++ b/build/config.guess @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2006-06-06' +timestamp='2006-07-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -211,7 +211,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) - echo powerppc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} @@ -790,10 +790,10 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - x86:Interix*:[345]*) + x86:Interix*:[3456]*) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T:Interix*:[345]*) + EM64T:Interix*:[3456]*) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) diff --git a/build/config.sub b/build/config.sub index 70584b007e2..387c18d1a13 100755 --- a/build/config.sub +++ b/build/config.sub @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2006-06-06' +timestamp='2006-07-02' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -1214,7 +1214,7 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos*) + | -skyos* | -haiku* | -rdos* | -toppers*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) From 118a7a435b42b4aa84361c5225e94df9c72ccd6a Mon Sep 17 00:00:00 2001 From: Andre Malo Date: Fri, 18 Aug 2006 18:17:22 +0000 Subject: [PATCH 5708/7878] fix eol style git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@432668 13f79535-47bb-0310-9956-ffa450edef68 From b6359652907437b2b3b4505944a478c155354998 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 22 Aug 2006 17:18:29 +0000 Subject: [PATCH 5709/7878] * jlibtool.c: Support the build overriding -undefined via run-time arguments; also support -undefined dynamic_lookup on 10.3+. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@433700 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 53 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index 735123d5032..e884e20ef45 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -65,7 +65,8 @@ # define PIC_FLAG "-fPIC -fno-common" # define SHARED_OPTS "-dynamiclib" # define MODULE_OPTS "-bundle" -# define DYNAMIC_LINK_OPTS "-flat_namespace -undefined suppress" +# define DYNAMIC_LINK_OPTS "-flat_namespace" +# define DYNAMIC_LINK_UNDEFINED "-undefined suppress" # define dynamic_link_version_func darwin_dynamic_link_function # define DYNAMIC_INSTALL_NAME "-install_name" # define DYNAMIC_LINK_NO_INSTALL "-dylib_file" @@ -274,6 +275,7 @@ typedef struct { library_opts shared_opts; const char *version_info; + const char *undefined_flag; } command_t; #ifdef RPATH @@ -932,6 +934,38 @@ char * load_noinstall_path(const char *arg, int pathlen) return expanded_path; } +void add_dynamic_link_opts(command_t *cmd_data) +{ +#ifdef DYNAMIC_LINK_OPTS + if (cmd_data->options.pic_mode != pic_AVOID) { + push_count_chars(cmd_data->program_opts, + DYNAMIC_LINK_OPTS); + if (cmd_data->undefined_flag) { + push_count_chars(cmd_data->program_opts, "-undefined"); +#if defined(__APPLE__) + /* -undefined dynamic_lookup is used by the bundled Python in + * 10.4, but if we don't set MACOSX_DEPLOYMENT_TARGET to 10.3+, + * we'll get a linker error if we pass this flag. + */ + if (strcasecmp(cmd_data->undefined_flag, + "dynamic_lookup") == 0) { + insert_count_chars(cmd_data->program_opts, + "MACOSX_DEPLOYMENT_TARGET=10.3", 0); + } +#endif + push_count_chars(cmd_data->program_opts, + cmd_data->undefined_flag); + } + else { +#ifdef DYNAMIC_LINK_UNDEFINED + push_count_chars(cmd_data->program_opts, + DYNAMIC_LINK_UNDEFINED); +#endif + } + } +#endif +} + /* Read the final install location and add it to runtime library search path. */ #ifdef RPATH void add_rpath(count_chars *cc, const char *path) @@ -1375,6 +1409,9 @@ void parse_args(int argc, char *argv[], command_t *cmd_data) /* Skip the argument. */ ++a; argused = 1; + } else if (strcmp(arg+1, "undefined") == 0) { + cmd_data->undefined_flag = argv[++a]; + argused = 1; } else if (arg[1] == 'R' && !arg[2]) { /* -R dir Add dir to runtime library search path. */ add_runtimedirlib(argv[++a], cmd_data); @@ -1588,11 +1625,7 @@ void link_fixup(command_t *c) push_count_chars(c->arglist, c->output_name); append_count_chars(c->arglist, c->obj_files); append_count_chars(c->arglist, c->shared_opts.dependencies); -#ifdef DYNAMIC_LINK_OPTS - if (c->options.pic_mode != pic_AVOID) { - push_count_chars(c->arglist, DYNAMIC_LINK_OPTS); - } -#endif + add_dynamic_link_opts(c); } } } @@ -1809,12 +1842,8 @@ int run_mode(command_t *cmd_data) push_count_chars(cmd_data->program_opts, MODULE_OPTS); #endif } -#ifdef DYNAMIC_LINK_OPTS - if (cmd_data->options.pic_mode != pic_AVOID) { - push_count_chars(cmd_data->program_opts, - DYNAMIC_LINK_OPTS); - } -#endif + add_dynamic_link_opts(cmd_data); + rv = run_command(cmd_data, cmd_data->shared_opts.normal); if (rv) { return rv; From c8c71013e32a9131f41c7dde82c3940228b69585 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 24 Aug 2006 07:04:42 +0000 Subject: [PATCH 5710/7878] Tab police + Trim trailing spaces. No functional change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@434318 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/start.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/misc/win32/start.c b/misc/win32/start.c index b0ae15aa498..e15bf5d83e6 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -33,10 +33,10 @@ int APR_DECLARE_DATA apr_app_init_complete = 0; * * An internal apr function to convert a double-null terminated set * of single-null terminated strings from wide Unicode to narrow utf-8 - * as a list of strings. These are allocated from the MSVCRT's + * as a list of strings. These are allocated from the MSVCRT's * _CRT_BLOCK to trick the system into trusting our store. */ -static int warrsztoastr(const char * const * *retarr, +static int warrsztoastr(const char * const * *retarr, const wchar_t * arrsz, int args) { const apr_wchar_t *wch; @@ -48,7 +48,7 @@ static int warrsztoastr(const char * const * *retarr, if (args < 0) { for (args = 1, wch = arrsz; wch[0] || wch[1]; ++wch) - if (!*wch) + if (!*wch) ++args; } wsize = 1 + wch - arrsz; @@ -90,8 +90,8 @@ static int warrsztoastr(const char * const * *retarr, /* Reprocess the arguments to main() for a completely apr-ized application */ -APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, - const char * const * *argv, +APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, + const char * const * *argv, const char * const * *env) { apr_status_t rv = apr_initialize(); @@ -126,7 +126,7 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, sysstr = GetEnvironmentStringsW(); dupenv = warrsztoastr(&_environ, sysstr, -1); - if (env) { + if (env) { *env = apr_malloc_dbg((dupenv + 1) * sizeof (char *), __FILE__, __LINE__ ); memcpy((void*)*env, _environ, (dupenv + 1) * sizeof (char *)); @@ -176,11 +176,11 @@ APR_DECLARE(apr_status_t) apr_initialize(void) if (apr_get_oslevel(&osver) != APR_SUCCESS) { return APR_EEXIST; } - + tls_apr_thread = TlsAlloc(); if ((status = apr_pool_initialize()) != APR_SUCCESS) return status; - + if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { return APR_ENOPOOL; } @@ -197,7 +197,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) WSACleanup(); return APR_EEXIST; } - + apr_signal_init(pool); return APR_SUCCESS; @@ -210,7 +210,7 @@ APR_DECLARE_NONSTD(void) apr_terminate(void) return; } apr_pool_terminate(); - + WSACleanup(); TlsFree(tls_apr_thread); From 10e2b8c44c65861b53c9ef94e7de37cfd2fbf67e Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 24 Aug 2006 07:24:35 +0000 Subject: [PATCH 5711/7878] Implement apr_threadkey_private destructors on WIN32 instead silently ignoring them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@434327 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++ include/arch/win32/apr_arch_threadproc.h | 6 +++ misc/win32/start.c | 58 ++++++++++++++++++++++++ threadproc/win32/threadpriv.c | 17 ++++++- 4 files changed, 83 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 97c46345a3d..e957ac4b405 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes for APR 1.3.0 + *) Implement apr_threadkey_private destructors on WIN32 + instead silently ignoring them, so that they behave like on + the pthreads powered platforms. [Mladen Turk] + *) Support MinGW. [John Vandenberg, Justin Erenkrantz] *) Implement apr_thread_yield on Unix in terms of pthread_yield or diff --git a/include/arch/win32/apr_arch_threadproc.h b/include/arch/win32/apr_arch_threadproc.h index 7af8ab6869b..d4d70d5c95b 100644 --- a/include/arch/win32/apr_arch_threadproc.h +++ b/include/arch/win32/apr_arch_threadproc.h @@ -17,6 +17,7 @@ #include "apr_private.h" #include "apr_thread_proc.h" #include "apr_file_io.h" +#include "apr_hash.h" #ifndef THREAD_PROC_H #define THREAD_PROC_H @@ -68,5 +69,10 @@ struct apr_thread_once_t { long value; }; +#if defined(APR_DECLARE_EXPORT) +/* Provide to win32/start.c */ +extern apr_hash_t *apr_tls_threadkeys; +#endif + #endif /* ! THREAD_PROC_H */ diff --git a/misc/win32/start.c b/misc/win32/start.c index e15bf5d83e6..cab9da55e4b 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -18,11 +18,13 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_signal.h" +#include "apr_hash.h" #include "ShellAPI.h" #include "apr_arch_misc.h" /* for WSAHighByte / WSALowByte */ #include "wchar.h" #include "apr_arch_file_io.h" +#include "apr_arch_threadproc.h" #include "assert.h" /* This symbol is _private_, although it must be exported. @@ -187,6 +189,11 @@ APR_DECLARE(apr_status_t) apr_initialize(void) apr_pool_tag(pool, "apr_initialize"); +#if defined(APR_DECLARE_EXPORT) + /* Initialize threadpriv table */ + apr_tls_threadkeys = apr_hash_make(pool); +#endif + iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); err = WSAStartup((WORD) iVersionRequested, &wsaData); if (err) { @@ -203,12 +210,63 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_SUCCESS; } +#if defined(APR_DECLARE_EXPORT) +typedef (apr_thredkey_destfn_t)(void *data); + +static void threadkey_terminate() +{ + apr_hash_index_t *hi = apr_hash_first(NULL, apr_tls_threadkeys); + + for (; hi != NULL; hi = apr_hash_next(hi)) { + LPDWORD key; + apr_hash_this(hi, &key, NULL, NULL); + TlsFree(*key); + } +} + +static void threadkey_detach() +{ + apr_hash_index_t *hi = apr_hash_first(NULL, apr_tls_threadkeys); + + for (; hi != NULL; hi = apr_hash_next(hi)) { + apr_thredkey_destfn_t *dest = NULL; + LPDWORD key; + void *data; + apr_hash_this(hi, &key, NULL, (void **)&dest); + data = TlsGetValue(*key); + (*dest)(data); + } +} + +BOOL APIENTRY DllMain(HINSTANCE instance, + DWORD reason_for_call, + LPVOID lpReserved) +{ + switch (reason_for_call) { + case DLL_PROCESS_ATTACH: + break; + case DLL_THREAD_ATTACH: + break; + case DLL_THREAD_DETACH: + threadkey_detach(); + break; + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +#endif /* APR_DECLARE_EXPORT */ + APR_DECLARE_NONSTD(void) apr_terminate(void) { initialized--; if (initialized) { return; } +#if defined(APR_DECLARE_EXPORT) + threadkey_terminate(); +#endif apr_pool_terminate(); WSACleanup(); diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 0cbfe620e43..b1001e10737 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -16,11 +16,16 @@ #include "apr_arch_threadproc.h" #include "apr_thread_proc.h" +#include "apr_hash.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_errno.h" #include "apr_portable.h" +#if defined(APR_DECLARE_EXPORT) +apr_hash_t *apr_tls_threadkeys = NULL; +#endif + APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *pool) @@ -33,6 +38,10 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, (*key)->pool = pool; if (((*key)->key = TlsAlloc()) != 0xFFFFFFFF) { +#if defined(APR_DECLARE_EXPORT) + apr_hash_set(apr_tls_threadkeys, &((*key)->key), + sizeof(DWORD), dest); +#endif return APR_SUCCESS; } return apr_get_os_error(); @@ -59,7 +68,11 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) { if (TlsFree(key->key)) { - return APR_SUCCESS; +#if defined(APR_DECLARE_EXPORT) + apr_hash_set(apr_tls_threadkeys, &(key->key), + sizeof(DWORD), NULL); +#endif + return APR_SUCCESS; } return apr_get_os_error(); } @@ -97,5 +110,5 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, } (*key)->key = *thekey; return APR_SUCCESS; -} +} From b432723dfe3e41ba2b4a5241573163320525242b Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 24 Aug 2006 16:54:31 +0000 Subject: [PATCH 5712/7878] Follow-up to r433700 so as not to break linking executables. Doh. * build/jlibtool.c (add_dynamic_link_opts): Take parameter which indicates which arguments should receive the dynamic link flags; when not in -silent, emit info. (parse_args): Output newline when handling -MT flag. (link_fixup, run_mode): Pass args to add_dynamic_link_opts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@434433 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index e884e20ef45..132fdaaa979 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -934,14 +934,16 @@ char * load_noinstall_path(const char *arg, int pathlen) return expanded_path; } -void add_dynamic_link_opts(command_t *cmd_data) +void add_dynamic_link_opts(command_t *cmd_data, count_chars *args) { #ifdef DYNAMIC_LINK_OPTS if (cmd_data->options.pic_mode != pic_AVOID) { - push_count_chars(cmd_data->program_opts, - DYNAMIC_LINK_OPTS); + if (!cmd_data->options.silent) { + printf("Adding: %s\n", DYNAMIC_LINK_OPTS); + } + push_count_chars(args, DYNAMIC_LINK_OPTS); if (cmd_data->undefined_flag) { - push_count_chars(cmd_data->program_opts, "-undefined"); + push_count_chars(args, "-undefined"); #if defined(__APPLE__) /* -undefined dynamic_lookup is used by the bundled Python in * 10.4, but if we don't set MACOSX_DEPLOYMENT_TARGET to 10.3+, @@ -953,13 +955,14 @@ void add_dynamic_link_opts(command_t *cmd_data) "MACOSX_DEPLOYMENT_TARGET=10.3", 0); } #endif - push_count_chars(cmd_data->program_opts, - cmd_data->undefined_flag); + push_count_chars(args, cmd_data->undefined_flag); } else { #ifdef DYNAMIC_LINK_UNDEFINED - push_count_chars(cmd_data->program_opts, - DYNAMIC_LINK_UNDEFINED); + if (!cmd_data->options.silent) { + printf("Adding: %s\n", DYNAMIC_LINK_UNDEFINED); + } + push_count_chars(args, DYNAMIC_LINK_UNDEFINED); #endif } } @@ -1388,7 +1391,7 @@ void parse_args(int argc, char *argv[], command_t *cmd_data) argused = parse_output_file_name(arg, cmd_data); } else if (strcmp(arg+1, "MT") == 0) { if (!cmd_data->options.silent) { - printf("Adding: %s", arg); + printf("Adding: %s\n", arg); } push_count_chars(cmd_data->arglist, arg); arg = argv[++a]; @@ -1625,7 +1628,7 @@ void link_fixup(command_t *c) push_count_chars(c->arglist, c->output_name); append_count_chars(c->arglist, c->obj_files); append_count_chars(c->arglist, c->shared_opts.dependencies); - add_dynamic_link_opts(c); + add_dynamic_link_opts(c, c->arglist); } } } @@ -1842,7 +1845,7 @@ int run_mode(command_t *cmd_data) push_count_chars(cmd_data->program_opts, MODULE_OPTS); #endif } - add_dynamic_link_opts(cmd_data); + add_dynamic_link_opts(cmd_data, cmd_data->program_opts); rv = run_command(cmd_data, cmd_data->shared_opts.normal); if (rv) { From 75c2a4beb18df7b467f40093ae470ebf798c709d Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 26 Aug 2006 07:34:41 +0000 Subject: [PATCH 5713/7878] Check if the return value from TlsGetValue is valid before calling the provided callback. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@437115 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/start.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/misc/win32/start.c b/misc/win32/start.c index cab9da55e4b..2890aef6d82 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -234,7 +234,12 @@ static void threadkey_detach() void *data; apr_hash_this(hi, &key, NULL, (void **)&dest); data = TlsGetValue(*key); - (*dest)(data); + if (data != NULL || GetLastError() == ERROR_SUCCESS) { + /* NULL data is a valid TLS value if explicitly set + * by the TlsSetValue + */ + (*dest)(data); + } } } From d4d0ba7353cff658b011b2d99f8a0a109d6fccc1 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 31 Aug 2006 05:10:22 +0000 Subject: [PATCH 5714/7878] Fix up integer type on Solaris 10 (gcc) compiles. * atomic/unix/apr_atomic.c (apr_atomic_dec32): Match declaration in apr_atomic.h for Solaris 10 implementation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@438796 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 23c5c6509f7..7aab8787044 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -179,7 +179,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, #endif /* APR_OVERRIDE_ATOMIC_CAS32 */ #if !defined(APR_OVERRIDE_ATOMIC_DEC32) -APR_DECLARE(apr_uint32_t) apr_atomic_dec32(volatile apr_uint32_t *mem) +APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) { apr_uint32_t prev = *mem; atomic_dec_32(mem); From 8e2de52ec14aa77fd9c562ee36ca2b282322a68f Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 2 Sep 2006 21:58:27 +0000 Subject: [PATCH 5715/7878] Fix the conversion of the timeout paremeter into a timespce for the kqueue pollset backend. Submitted by: Marco Molteni git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@439667 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ poll/unix/kqueue.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index e957ac4b405..76a414486cf 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Fix the timeout converstion in apr_pollset with the KQueue + backend. [Marco Molteni ] + *) Implement apr_threadkey_private destructors on WIN32 instead silently ignoring them, so that they behave like on the pthreads powered platforms. [Mladen Turk] diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index a8bea919c30..fdabd487c7e 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -243,7 +243,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } else { tv.tv_sec = (long) apr_time_sec(timeout); - tv.tv_nsec = (long) apr_time_msec(timeout); + tv.tv_nsec = (long) apr_time_usec(timeout) * 1000; tvptr = &tv; } From b78f4683bb4a3f474cd7af91a89c503b3b5b1320 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 8 Sep 2006 16:41:45 +0000 Subject: [PATCH 5716/7878] Some rare autoconf/m4 environments translitate differently and are dropping the 'e's of our symbol, resulting in ac_cv_file__dv_zro - which then fails all the way down the line for providing pthread mechanics. Noted this especially on Solaris 8.x. Depreciate APR_CHECK_FILE, which will be shot dead with APR 2.0, thus @deprecate symbol for when we look to mass-purge dead APIs with grep. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@441558 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 1 + configure.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 31b9cd9858f..1c17591ec0c 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -348,6 +348,7 @@ CPPFLAGS=$apr_old_cppflags dnl APR_CHECK_FILE(filename); set ac_cv_file_filename to dnl "yes" if 'filename' is readable, else "no". +dnl @deprecated! - use AC_CHECK_FILE instead AC_DEFUN([APR_CHECK_FILE], [ dnl Pick a safe variable name define([apr_cvname], ac_cv_file_[]translit([$1], [./+-], [__p_])) diff --git a/configure.in b/configure.in index 84ad65c7a0b..ce72af512e1 100644 --- a/configure.in +++ b/configure.in @@ -727,7 +727,7 @@ AC_CHECK_FUNCS([mmap munmap shm_open shm_unlink shmget shmat shmdt shmctl \ create_area]) APR_CHECK_DEFINE(MAP_ANON, sys/mman.h) -APR_CHECK_FILE(/dev/zero) +AC_CHECK_FILE(/dev/zero) # Not all systems can mmap /dev/zero (such as HP-UX). Check for that. if test "$ac_cv_func_mmap" = "yes" && From 0c6be140c6519c6c9723000ca13d3228e8447cb3 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Mon, 11 Sep 2006 09:30:21 +0000 Subject: [PATCH 5717/7878] Do not allocate new socket if accept fails. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@442135 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 6d24cdcf008..a37984d7daf 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -176,30 +176,35 @@ apr_status_t apr_socket_listen(apr_socket_t *sock, apr_int32_t backlog) apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { - alloc_socket(new, connection_context); - set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM, sock->protocol); + int s; + apr_sockaddr_t sa; -#ifndef HAVE_POLL - (*new)->connected = 1; -#endif - (*new)->timeout = -1; - - (*new)->socketdes = accept(sock->socketdes, - (struct sockaddr *)&(*new)->remote_addr->sa, - &(*new)->remote_addr->salen); + apr_sockaddr_vars_set(&sa, sock->local_addr->sa.sin.sin_family, 0); + sa.pool = connection_context; + s = accept(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen); - if ((*new)->socketdes < 0) { + if (s < 0) { return errno; } #ifdef TPF - if ((*new)->socketdes == 0) { + if (s == 0) { /* 0 is an invalid socket for TPF */ return APR_EINTR; } #endif + alloc_socket(new, connection_context); + set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM, sock->protocol); + +#ifndef HAVE_POLL + (*new)->connected = 1; +#endif + (*new)->timeout = -1; (*new)->remote_addr_unknown = 0; + (*new)->socketdes = s; + *(*new)->remote_addr = sa; + *(*new)->local_addr = *sock->local_addr; /* The above assignment just overwrote the pool entry. Setting the local_addr From 2a32709faeb82776c0ef4ded27bb7ea910d13e41 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Tue, 12 Sep 2006 13:52:40 +0000 Subject: [PATCH 5718/7878] Don't try to build apr_app.c on MinGW. Submitted by: Matthias Miller Suggested by: jerenkrantz * build/gen-build.py (write_objects): Skip apr_app.c. * CHANGES: Note change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@442582 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ build/gen-build.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 76a414486cf..a7eaaba3a8f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Don't try to build apr_app.c on MinGW. + [Matthias Miller ] + *) Fix the timeout converstion in apr_pollset with the KQueue backend. [Marco Molteni ] diff --git a/build/gen-build.py b/build/gen-build.py index 321b4bad629..3df86838a36 100755 --- a/build/gen-build.py +++ b/build/gen-build.py @@ -146,6 +146,8 @@ def write_objects(f, legal_deps, h_deps, files): objects = [ ] for file in files: + if file[-10:] == '/apr_app.c': + continue assert file[-2:] == '.c' obj = file[:-2] + '.lo' objects.append(obj) From ab5d956b7481181e940e12dae38c3ad34eb014f0 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Tue, 12 Sep 2006 14:09:28 +0000 Subject: [PATCH 5719/7878] Add an apr_hash_clear() API for clearing the contents of existing hash tables (enabling their re-use without re-allocation). Submitted by: Daniel L. Rall * include/apr_hash.h (apr_hash_clear): Declare the new function. * tables/apr_hash.c (apr_hash_clear): Implement function. * test/testhash.c (hash_clear): Test the new apr_hash_clear() API. (testhash): Run the hash_clear() test function as part of the suite. * CHANGES: Note change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@442588 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 1 + include/apr_hash.h | 6 ++++++ tables/apr_hash.c | 7 +++++++ test/testhash.c | 19 +++++++++++++++++++ 4 files changed, 33 insertions(+) diff --git a/CHANGES b/CHANGES index a7eaaba3a8f..a4aceaa744d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,5 @@ Changes for APR 1.3.0 + *) Add apr_hash_clear. [Daniel L. Rall ] *) Don't try to build apr_app.c on MinGW. [Matthias Miller ] diff --git a/include/apr_hash.h b/include/apr_hash.h index bdf0620f62c..c033ed15a6a 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -174,6 +174,12 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, */ APR_DECLARE(unsigned int) apr_hash_count(apr_hash_t *ht); +/** + * Clear any key/value pairs in the hash table. + * @param ht The hash table + */ +APR_DECLARE(void) apr_hash_clear(apr_hash_t *ht); + /** * Merge two hash tables into one new hash table. The values of the overlay * hash override the values of the base if both have the same key. Both diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 6f58d98bcee..4e3723e19f1 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -367,6 +367,13 @@ APR_DECLARE(unsigned int) apr_hash_count(apr_hash_t *ht) return ht->count; } +APR_DECLARE(void) apr_hash_clear(apr_hash_t *ht) +{ + apr_hash_index_t *hi; + for (hi = apr_hash_first(NULL, ht); hi; hi = apr_hash_next(hi)) + apr_hash_set(ht, hi->this->key, hi->this->klen, NULL); +} + APR_DECLARE(apr_hash_t*) apr_hash_overlay(apr_pool_t *p, const apr_hash_t *overlay, const apr_hash_t *base) diff --git a/test/testhash.c b/test/testhash.c index c9b1cdb07c1..01fb5ecf54c 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -152,6 +152,24 @@ static void key_space(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "value", result); } +static void hash_clear(abts_case *tc, void *data) +{ + apr_hash_t *h; + int i, *e; + + h = apr_hash_make(p); + ABTS_PTR_NOTNULL(tc, h); + + for (i = 1; i <= 10; i++) { + e = apr_palloc(p, sizeof(int)); + *e = i; + apr_hash_set(h, e, sizeof(*e), e); + } + apr_hash_clear(h); + i = apr_hash_count(h); + ABTS_INT_EQUAL(tc, 0, i); +} + /* This is kind of a hack, but I am just keeping an existing test. This is * really testing apr_hash_first, apr_hash_next, and apr_hash_this which * should be tested in three separate tests, but this will do for now. @@ -419,6 +437,7 @@ abts_suite *testhash(abts_suite *suite) abts_run_test(suite, hash_count_1, NULL); abts_run_test(suite, hash_count_5, NULL); + abts_run_test(suite, hash_clear, NULL); abts_run_test(suite, hash_traverse, NULL); abts_run_test(suite, summation_test, NULL); From b524423da5b82f1e148df9ae337f787ee0462481 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 14 Sep 2006 06:28:19 +0000 Subject: [PATCH 5720/7878] Make sure the temporary remote addr is initialized to zero as it is done inside alloc_socket. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@443262 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index a37984d7daf..6da5acd1524 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -179,6 +179,7 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, int s; apr_sockaddr_t sa; + memset(&sa, 0, sizeof(apr_sockaddr_t)); apr_sockaddr_vars_set(&sa, sock->local_addr->sa.sin.sin_family, 0); sa.pool = connection_context; s = accept(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen); From 7e15c6131dbc6bf617b11aa0cb36a4ed89739f18 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Mon, 18 Sep 2006 16:16:31 +0000 Subject: [PATCH 5721/7878] Document the variant of globbing implemented by apr_fnmatch. Submitted by: David Glasser Tweaked by: me * include/apr_fnmatch.h (apr_fnmatch): Describe the recognized metacharacters, etc. * CHANGES: Note change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@447453 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_fnmatch.h | 47 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index a4aceaa744d..73755fe1e2f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ Changes for APR 1.3.0 + *) Add some documentation on the format matched by apr_fnmatch. + [David Glasser ] + *) Add apr_hash_clear. [Daniel L. Rall ] *) Don't try to build apr_app.c on MinGW. diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index 7a2811aac8f..ef6d0b25086 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -66,16 +66,57 @@ extern "C" { /** * Try to match the string to the given pattern, return APR_SUCCESS if - * match, else return APR_FNM_NOMATCH. + * match, else return APR_FNM_NOMATCH. Note that there is no such thing as + * an illegal pattern. + * + * With all flags unset, a pattern is interpreted as such: + * + * PATTERN: Backslash followed by any character, including another + * backslash.
    + * MATCHES: That character exactly. + * + *

    + * PATTERN: ?
    + * MATCHES: Any single character. + *

    + * + *

    + * PATTERN: *
    + * MATCHES: Any sequence of zero or more characters. (Note that multiple + * *s in a row are equivalent to one.) + * + * PATTERN: Any character other than \?*[ or a \ at the end of the pattern
    + * MATCHES: That character exactly. (Case sensitive.) + * + * PATTERN: [ followed by a class description followed by ]
    + * MATCHES: A single character described by the class description. + * (Never matches, if the class description reaches until the + * end of the string without a ].) If the first character of + * the class description is ^ or !, the sense of the description + * is reversed. The rest of the class description is a list of + * single characters or pairs of characters separated by -. Any + * of those characters can have a backslash in front of them, + * which is ignored; this lets you use the characters ] and - + * in the character class, as well as ^ and ! at the + * beginning. The pattern matches a single character if it + * is one of the listed characters or falls into one of the + * listed ranges (inclusive, case sensitive). Ranges with + * the first character larger than the second are legal but + * never match. Edge cases: [] never matches, and [^] and [!] + * always match without consuming a character. + * + * Note that these patterns attempt to match the entire string, not + * just find a substring matching the pattern. + * * @param pattern The pattern to match to * @param strings The string we are trying to match * @param flags flags to use in the match. Bitwise OR of: - *

    + * 
      *              APR_FNM_NOESCAPE       Disable backslash escaping
      *              APR_FNM_PATHNAME       Slash must be matched by slash
      *              APR_FNM_PERIOD         Period must be matched by period
      *              APR_FNM_CASE_BLIND     Compare characters case-insensitively.
    - * 
    + *
    */ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, From 56256bd351b3ffbc9234b16103bae75aaa2c15f1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 19 Sep 2006 16:11:07 +0000 Subject: [PATCH 5722/7878] * network_io/unix/sockets.c (apr_socket_accept): Fix remote_addr handling; just use the "struct sockaddr" + length from the apr_sockaddr_t on the stack, copy them into the ->remote_addr set up by alloc_socket(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@447894 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 6da5acd1524..94b26687cd8 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -179,9 +179,8 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, int s; apr_sockaddr_t sa; - memset(&sa, 0, sizeof(apr_sockaddr_t)); - apr_sockaddr_vars_set(&sa, sock->local_addr->sa.sin.sin_family, 0); - sa.pool = connection_context; + sa.salen = sizeof(sa.sa); + s = accept(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen); if (s < 0) { @@ -204,7 +203,10 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, (*new)->remote_addr_unknown = 0; (*new)->socketdes = s; - *(*new)->remote_addr = sa; + + /* Copy in peer's address. */ + (*new)->remote_addr->sa = sa.sa; + (*new)->remote_addr->salen = sa.salen; *(*new)->local_addr = *sock->local_addr; From cb2cee98b9dde8843ce044f548fe1148eed258af Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 21 Sep 2006 07:41:11 +0000 Subject: [PATCH 5723/7878] Solve svn issue 1869, only one symptom on the Unix platform; when a trailing .. element is present without a trailing slash, always avoid appending a trailing slash. Solved with hints from Lieven Govaerts . Resolves test fail identified by test/testnames.c commit 424831 Crossports: patch 424914 from Win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@448480 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 1fc9f281ae9..78797bd990c 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -225,10 +225,11 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, return APR_EABOVEROOT; } - /* Otherwise append another backpath. + /* Otherwise append another backpath, including + * trailing slash if present. */ - memcpy(path + pathlen, "../", 3); - pathlen += 3; + memcpy(path + pathlen, "../", *next ? 3 : 2); + pathlen += *next ? 3 : 2; } else { /* otherwise crop the prior segment From 0d2d2c5322f47890d725f051d2fbd854c6653bc0 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 21 Sep 2006 17:35:44 +0000 Subject: [PATCH 5724/7878] Handle the variable length volume names on NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@448611 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/testnames.c b/test/testnames.c index 39e2e7c4f29..dec227a8513 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -239,6 +239,18 @@ static void root_from_cwd_and_back(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, '/', root[2]); ABTS_INT_EQUAL(tc, 0, root[3]); ABTS_STR_EQUAL(tc, origpath + 3, path); +#elif defined(NETWARE) + ABTS_INT_EQUAL(tc, origpath[0], root[0]); + { + char *pt = strchr(root, ':'); + ABTS_PTR_NOTNULL(tc, pt); + ABTS_INT_EQUAL(tc, ':', pt[0]); + ABTS_INT_EQUAL(tc, '/', pt[1]); + ABTS_INT_EQUAL(tc, 0, pt[2]); + pt = strchr(origpath, ':'); + ABTS_PTR_NOTNULL(tc, pt); + ABTS_STR_EQUAL(tc, (pt+2), path); + } #else ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, "/", root); From 6bfc0883a126af64703023e1cb8d26d272f9a7fc Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Tue, 3 Oct 2006 15:07:44 +0000 Subject: [PATCH 5725/7878] Fix PR 40662. Submitted by: Larry Cipriani * poll/unix/kqueue.c (apr_pollset_create): Fix error checking. * CHANGES: Note change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@452527 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ poll/unix/kqueue.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 73755fe1e2f..0aaa421e565 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ Changes for APR 1.3.0 + *) Fix error checking in kqueue version of apr_pollset_create. + PR 40662 [Larry Cipriani lvc lucent.com] + *) Add some documentation on the format matched by apr_fnmatch. [David Glasser ] diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index fdabd487c7e..7fa85af62ee 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -75,7 +75,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, if (flags & APR_POLLSET_THREADSAFE && ((rv = apr_thread_mutex_create(&(*pollset)->ring_lock, APR_THREAD_MUTEX_DEFAULT, - p) != APR_SUCCESS))) { + p)) != APR_SUCCESS)) { *pollset = NULL; return rv; } From 015bbac28d992a712a571230d0d17ec0b5ea8deb Mon Sep 17 00:00:00 2001 From: Ken Coar Date: Sun, 8 Oct 2006 20:15:56 +0000 Subject: [PATCH 5726/7878] If *pattern == '\\', and it does since that's the case we're in, then (*pattern++ == '\0') will always fail. Need to advance the pointer *before* the comparison. Reviewed: jerenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@454200 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index 7c41ea6585e..aa250ecdcaa 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -225,7 +225,7 @@ APR_DECLARE(int) apr_fnmatch_test(const char *pattern) return 1; case '\\': - if (*pattern++ == '\0') { + if (*++pattern == '\0') { return 0; } break; From 2349cfbb039ed50a240866180616587c26a8d704 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Mon, 9 Oct 2006 14:59:23 +0000 Subject: [PATCH 5727/7878] Fix error checking in epoll version of apr_pollset_create. Submitted by: Larry Cipriani * poll/unix/epoll.c (apr_pollset_create): Fix bug in precedence in error checking for mutex creation. * CHANGES: Note change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@454400 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++++- poll/unix/epoll.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 0aaa421e565..b3e98a36c89 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ Changes for APR 1.3.0 + *) Fix error checking in epoll version of apr_pollset_create. + PR 40660 [Larry Cipriani ] + *) Fix error checking in kqueue version of apr_pollset_create. - PR 40662 [Larry Cipriani lvc lucent.com] + PR 40662 [Larry Cipriani ] *) Add some documentation on the format matched by apr_fnmatch. [David Glasser ] diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index dc9a315dc6e..d1919a5eb8b 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -105,7 +105,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, !(flags & APR_POLLSET_NOCOPY) && ((rv = apr_thread_mutex_create(&(*pollset)->ring_lock, APR_THREAD_MUTEX_DEFAULT, - p) != APR_SUCCESS))) { + p)) != APR_SUCCESS)) { *pollset = NULL; return rv; } From 5cd40f28cd32d0cb90159d4d935b00ced2f0b6fe Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Mon, 9 Oct 2006 15:22:00 +0000 Subject: [PATCH 5728/7878] Fix bug in pollset creation error checking. Submitted by: Larry Cipriani * poll/unix/port.c (apr_pollset_create): Fix typo in error checking for mutex creation. * CHANGES: Consolidate entries for the pollset typo fixes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@454403 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 +++----- poll/unix/port.c | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index b3e98a36c89..4aaa1c910ee 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,7 @@ Changes for APR 1.3.0 - *) Fix error checking in epoll version of apr_pollset_create. - PR 40660 [Larry Cipriani ] - - *) Fix error checking in kqueue version of apr_pollset_create. - PR 40662 [Larry Cipriani ] + *) Fix error checking in kqueue, epoll and event port versions of + apr_pollset_create. PR 40660, 40661, 40662 + [Larry Cipriani ] *) Add some documentation on the format matched by apr_fnmatch. [David Glasser ] diff --git a/poll/unix/port.c b/poll/unix/port.c index f668912b3f8..144442a0882 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -100,7 +100,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, if (flags & APR_POLLSET_THREADSAFE && ((rv = apr_thread_mutex_create(&(*pollset)->ring_lock, APR_THREAD_MUTEX_DEFAULT, - p) != APR_SUCCESS))) { + p)) != APR_SUCCESS)) { *pollset = NULL; return rv; } From 51f10313f7ddea5bf1a24537214eda7cefa2d263 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 10 Oct 2006 15:11:39 +0000 Subject: [PATCH 5729/7878] * passwd/apr_getpass.c: Disable getpass() support if PASS_MAX is defined and "small". PR: 40256 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@454774 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_getpass.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 7e897749486..4d6167e8a04 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -48,6 +48,12 @@ #include #endif +/* Disable getpass() support when PASS_MAX is defined and is "small", + * for an arbitrary definition of "small". */ +#if defined(HAVE_GETPASS) && defined(PASS_MAX) && PASS_MAX < 32 +#undef HAVE_GETPASS +#endif + #if defined(HAVE_TERMIOS_H) && !defined(HAVE_GETPASS) #include #endif From 8787452675772adaa53d8b6100feb0eb411093d2 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 10 Oct 2006 15:40:31 +0000 Subject: [PATCH 5730/7878] * threadprox/unix/proc.c (apr_proc_create): Relax the tests to allow executable-but-unreadable programs to be executed even if the errchk mode is active. PR: 32498 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@454787 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index bf743527ce7..0b9c8b97b87 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -355,7 +355,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * caller can choose to pass full path for other * values of cmdtype */ - if (access(progname, R_OK|X_OK) == -1) { + if (access(progname, X_OK) == -1) { /* exec*() in child wouldn't have worked */ return errno; } From 7847daf7bbb04c64fbca3906138aa8fb8a976351 Mon Sep 17 00:00:00 2001 From: Thom May Date: Thu, 12 Oct 2006 18:53:32 +0000 Subject: [PATCH 5731/7878] cope with the madness otherwise known as the "kernel" bsd variants (such as GNU/kFreeBSD) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@463377 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index fd43a4d7967..b2f8ea6575a 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -176,6 +176,9 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(ac_cv_func_kqueue, no) fi ;; + *-k*bsd*-gnu) + APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE]) + ;; *-next-nextstep*) APR_SETIFNULL(CFLAGS, [-O]) APR_ADDTO(CPPFLAGS, [-DNEXT]) From 4fb68419d2c47080b9703a0999840611d61d674e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 25 Oct 2006 10:04:59 +0000 Subject: [PATCH 5732/7878] * passwd/apr_getpass.c (get_password): Renamed from getpass() throughout to avoid any possible conflict with a system getpass() implementation which is not being used. (apr_password_get): Use get_password if not getpass() or getpassphrase(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@467596 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_getpass.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 4d6167e8a04..369c6e6037d 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -80,7 +80,7 @@ * issue the prompt and read the results with echo. (Ugh). */ -static char *getpass(const char *prompt) +static char *get_password(const char *prompt) { static char password[MAX_STRING_LEN]; @@ -93,7 +93,7 @@ static char *getpass(const char *prompt) #elif defined (HAVE_TERMIOS_H) #include -static char *getpass(const char *prompt) +static char *get_password(const char *prompt) { struct termios attr; static char password[MAX_STRING_LEN]; @@ -135,7 +135,7 @@ static char *getpass(const char *prompt) * Windows lacks getpass(). So we'll re-implement it here. */ -static char *getpass(const char *prompt) +static char *get_password(const char *prompt) { /* WCE lacks console. So the getpass is unsuported * The only way is to use the GUI so the getpass should be implemented @@ -221,10 +221,12 @@ static char *getpass(const char *prompt) APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, apr_size_t *bufsiz) { -#ifdef HAVE_GETPASSPHRASE +#if defined(HAVE_GETPASSPHRASE) char *pw_got = getpassphrase(prompt); -#else +#elif defined(HAVE_GETPASS) char *pw_got = getpass(prompt); +#else /* use the replacement implementation above */ + char *pw_got = get_password(prompt); #endif apr_status_t rv = APR_SUCCESS; From ab56b2ae6d08d408d37a311cd74da4af84cc9407 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 25 Oct 2006 10:54:41 +0000 Subject: [PATCH 5733/7878] Fixes for the implementation, documentation and test case for apr_socket_recvfrom(); * network_io/unix/sendrecv.c (apr_socket_recvfrom): Reset the socklen argument correctly before calling recvfrom. On success, update all the sockaddr variables for the address returned, not just the port. * include/apr_network_io.h (apr_socket_recvfrom): Document a little better. * test/testsockets.c (sendto_receivefrom): Check that the address is set correctly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@467600 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_network_io.h | 6 +++++- network_io/unix/sendrecv.c | 4 +++- test/testsockets.c | 5 +++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 4aaa1c910ee..522d422506e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes for APR 1.3.0 + + *) Fix apr_socket_recvfrom() to ensure the peer's address is returned + through the "from" parameter. [Joe Orton] + *) Fix error checking in kqueue, epoll and event port versions of apr_pollset_create. PR 40660, 40661, 40662 [Larry Cipriani ] diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 52aa05198e3..011ae048d43 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -507,7 +507,11 @@ APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, apr_size_t *len); /** - * @param from The apr_sockaddr_t to fill in the recipient info + * Read data from a socket. On success, the address of the peer from + * which the data was sent is copied into the @param from parameter, + * and the @param len parameter is updated to give the number of bytes + * written to @param buf. + * @param from Updated with the address from which the data was received * @param sock The socket to use * @param flags The flags to use * @param buf The buffer to use diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index c1029a14f75..5efad149efb 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -148,6 +148,8 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, apr_size_t *len) { apr_ssize_t rv; + + from->salen = sizeof(from->sa); do { rv = recvfrom(sock->socketdes, buf, (*len), flags, @@ -172,7 +174,7 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, return errno; } - from->port = ntohs(from->sa.sin.sin_port); + apr_sockaddr_vars_set(from, from->sa.sin.sin_family, ntohs(from->sa.sin.sin_port)); (*len) = rv; if (rv == 0 && sock->type == SOCK_STREAM) { diff --git a/test/testsockets.c b/test/testsockets.c index 7a8a663bd61..76725b3736e 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -159,8 +159,9 @@ static void sendto_receivefrom(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, STRLEN, len); - /* Zero out the port so we can be sure it's been set by recvfrom. */ - from->port = 0; + /* fill the "from" sockaddr with a random address to ensure that + * recvfrom sets it up properly. */ + apr_sockaddr_info_get(&from, "127.1.2.3", APR_INET, 4242, 0, p); len = 80; rv = apr_socket_recvfrom(from, sock, 0, recvbuf, &len); From a97db761d9660172c2e786ff65739e331e1c57c8 Mon Sep 17 00:00:00 2001 From: Garrett Rooney Date: Thu, 26 Oct 2006 16:22:52 +0000 Subject: [PATCH 5734/7878] Portably check for EEXIST in the mktemp code. Submitted by: Kenneth Golomb PR: 40818 * file_io/unix/mktemp.c (gettemp): Use APR_STATUS_IS_EEXIST instead of comparing directly against APR_EEXIST. * CHANGES: Note change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@468055 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ file_io/unix/mktemp.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 522d422506e..28ce1ef50d3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ Changes for APR 1.3.0 + *) Portably check for EEXIST in mktemp code. PR 40818 + [Kenneth Golomb ] *) Fix apr_socket_recvfrom() to ensure the peer's address is returned through the "from" parameter. [Joe Orton] diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index e481014e5a3..73c61dcfce4 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -142,7 +142,7 @@ static int gettemp(char *path, apr_file_t **doopen, apr_int32_t flags, apr_pool_ if ((rv = apr_file_open(doopen, path, flags, APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) return APR_SUCCESS; - if (rv != APR_EEXIST) + if (!APR_STATUS_IS_EEXIST(rv)) return rv; /* If we have a collision, cycle through the space of filenames */ From 8f7fd9fdc465eee1be84dcea1aaa506685380796 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 6 Nov 2006 21:05:26 +0000 Subject: [PATCH 5735/7878] Correctly retrieve 'empty' environment values with apr_env_get on Win32 (e.g. "VAR="), and added validation to testall suite. PR: 40764 Submitted by: Issac Goldstand Reviewed by: wrowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@471877 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ misc/win32/env.c | 19 ++++++++++++++++-- test/testenv.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 72 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 28ce1ef50d3..a41c2bb4fd3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ Changes for APR 1.3.0 + + *) Correctly retrieve 'empty' environment values with apr_env_get + on Win32 (e.g. "VAR="), and added validation to testall suite. + PR 40764. [Issac Goldstand ] + *) Portably check for EEXIST in mktemp code. PR 40818 [Kenneth Golomb ] diff --git a/misc/win32/env.c b/misc/win32/env.c index 5c998643f03..e99ff8d4765 100644 --- a/misc/win32/env.c +++ b/misc/win32/env.c @@ -22,6 +22,7 @@ #include "apr_env.h" #include "apr_errno.h" #include "apr_pools.h" +#include "apr_strings.h" #if APR_HAS_UNICODE_FS @@ -61,11 +62,18 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, if (status) return status; + SetLastError(0); size = GetEnvironmentVariableW(wenvvar, &dummy, 0); - if (size == 0) + if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) /* The environment variable doesn't exist. */ return APR_ENOENT; + if (size == 0) { + /* The environment value exists, but is zero-length. */ + *value = apr_pstrdup(pool, ""); + return APR_SUCCESS; + } + wvalue = apr_palloc(pool, size * sizeof(*wvalue)); size = GetEnvironmentVariableW(wenvvar, wvalue, size); if (size == 0) @@ -85,11 +93,18 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, { char dummy; + SetLastError(0); size = GetEnvironmentVariableA(envvar, &dummy, 0); - if (size == 0) + if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) /* The environment variable doesn't exist. */ return APR_ENOENT; + if (size == 0) { + /* The environment value exists, but is zero-length. */ + *value = apr_pstrdup(pool, ""); + return APR_SUCCESS; + } + val = apr_palloc(pool, size); size = GetEnvironmentVariableA(envvar, val, size); if (size == 0) diff --git a/test/testenv.c b/test/testenv.c index 6d9dacd16b4..f5a74c38d91 100644 --- a/test/testenv.c +++ b/test/testenv.c @@ -19,10 +19,12 @@ #include "testutil.h" #define TEST_ENVVAR_NAME "apr_test_envvar" +#define TEST_ENVVAR2_NAME "apr_test_envvar2" #define TEST_ENVVAR_VALUE "Just a value that we'll check" static int have_env_set; static int have_env_get; +static int have_env_del; static void test_setenv(abts_case *tc, void *data) { @@ -68,7 +70,8 @@ static void test_delenv(abts_case *tc, void *data) } rv = apr_env_delete(TEST_ENVVAR_NAME, p); - if (rv == APR_ENOTIMPL) { + have_env_del = (rv != APR_ENOTIMPL); + if (!have_env_del) { ABTS_NOT_IMPL(tc, "apr_env_delete"); return; } @@ -82,6 +85,51 @@ static void test_delenv(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_ENOENT, rv); } +/** http://issues.apache.org/bugzilla/show_bug.cgi?id=40764 */ +static void test_emptyenv(abts_case *tc, void *data) +{ + char *value; + apr_status_t rv; + + if (!(have_env_set && have_env_get)) { + ABTS_NOT_IMPL(tc, "apr_env_set (skip test_emptyenv)"); + return; + } + /** Set empty string and test that rv != ENOENT) */ + rv = apr_env_set(TEST_ENVVAR_NAME, "", p); + APR_ASSERT_SUCCESS(tc, "set environment variable", rv); + rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); + APR_ASSERT_SUCCESS(tc, "get environment variable", rv); + ABTS_STR_EQUAL(tc, "", value); + + if (!have_env_del) { + ABTS_NOT_IMPL(tc, "apr_env (skip recycle test_emptyenv)"); + return; + } + /** Delete and retest */ + rv = apr_env_delete(TEST_ENVVAR_NAME, p); + APR_ASSERT_SUCCESS(tc, "delete environment variable", rv); + rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); + ABTS_INT_EQUAL(tc, APR_ENOENT, rv); + + /** Set second variable + test*/ + rv = apr_env_set(TEST_ENVVAR2_NAME, TEST_ENVVAR_VALUE, p); + APR_ASSERT_SUCCESS(tc, "set second environment variable", rv); + rv = apr_env_get(&value, TEST_ENVVAR2_NAME, p); + APR_ASSERT_SUCCESS(tc, "get second environment variable", rv); + ABTS_STR_EQUAL(tc, TEST_ENVVAR_VALUE, value); + + /** Finally, test ENOENT (first variable) followed by second != ENOENT) */ + rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); + ABTS_INT_EQUAL(tc, APR_ENOENT, rv); + rv = apr_env_get(&value, TEST_ENVVAR2_NAME, p); + APR_ASSERT_SUCCESS(tc, "verify second environment variable", rv); + ABTS_STR_EQUAL(tc, TEST_ENVVAR_VALUE, value); + + /** Cleanup */ + apr_env_delete(TEST_ENVVAR2_NAME, p); +} + abts_suite *testenv(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -89,6 +137,7 @@ abts_suite *testenv(abts_suite *suite) abts_run_test(suite, test_setenv, NULL); abts_run_test(suite, test_getenv, NULL); abts_run_test(suite, test_delenv, NULL); + abts_run_test(suite, test_emptyenv, NULL); return suite; } From 3df638e999318a6cca6de3af4b6f6b48e08a26d9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 7 Nov 2006 00:39:15 +0000 Subject: [PATCH 5736/7878] Axe lines of unnecessary code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@471952 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/env.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/misc/unix/env.c b/misc/unix/env.c index 9ba6b61e783..526115fda6a 100644 --- a/misc/unix/env.c +++ b/misc/unix/env.c @@ -57,17 +57,7 @@ APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, #elif defined(HAVE_PUTENV) - apr_size_t elen = strlen(envvar); - apr_size_t vlen = strlen(value); - char *env = apr_palloc(pool, elen + vlen + 2); - char *p = env + elen; - - memcpy(env, envvar, elen); - *p++ = '='; - memcpy(p, value, vlen); - p[vlen] = '\0'; - - if (0 > putenv(env)) + if (0 > putenv(apr_pstrcat(pool, envvar, "=", value, NULL)) return APR_ENOMEM; return APR_SUCCESS; From 41982d1198a3866cb6d56aa2009d915f1688bf0c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 7 Nov 2006 12:05:51 +0000 Subject: [PATCH 5737/7878] * network_io/unix/sendrecv.c (apr_socket_sendfile) [HAVE_SENDFILEV]: Prevent EFAULT failures with Solaris sendfilev in LFS builds. PR: 39463 Submitted by: jorton, Joseph Tam git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@472076 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 5efad149efb..de644bdc7e5 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -879,7 +879,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, for (i = 0; i < hdtr->numheaders; i++, curvec++) { sfv[curvec].sfv_fd = SFV_FD_SELF; sfv[curvec].sfv_flag = 0; - sfv[curvec].sfv_off = (apr_off_t)hdtr->headers[i].iov_base; + /* Cast to unsigned long to prevent sign extension of the + * pointer value for the LFS case; see PR 39463. */ + sfv[curvec].sfv_off = (unsigned long)hdtr->headers[i].iov_base; sfv[curvec].sfv_len = hdtr->headers[i].iov_len; requested_len += sfv[curvec].sfv_len; } @@ -903,7 +905,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, for (i = 0; i < hdtr->numtrailers; i++, curvec++) { sfv[curvec].sfv_fd = SFV_FD_SELF; sfv[curvec].sfv_flag = 0; - sfv[curvec].sfv_off = (apr_off_t)hdtr->trailers[i].iov_base; + sfv[curvec].sfv_off = (unsigned long)hdtr->trailers[i].iov_base; sfv[curvec].sfv_len = hdtr->trailers[i].iov_len; requested_len += sfv[curvec].sfv_len; } From d2e28e89cda035eec4778e0c3eaf5f129290496b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 16 Nov 2006 14:33:48 +0000 Subject: [PATCH 5738/7878] Clarify the behavior of apr_pstrndup(), which differs from Apache 1.3's ap_pstrndup() in that it doesn't overallocate memory for the resulting string. Submitted by: trawick, jorton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@475750 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index 9c28f3f11e9..fcfb7777a2a 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -109,12 +109,14 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n); /** - * duplicate the first n characters of a string into memory allocated - * out of a pool; the new string will be null-terminated + * Duplicate at most n characters of a string into memory allocated + * out of a pool; the new string will be NUL-terminated * @param p The pool to allocate out of * @param s The string to duplicate - * @param n The number of characters to duplicate + * @param n The maximum number of characters to duplicate * @return The new string + * @remark The amount of memory allocated from the pool is the length + * of the returned string including the NUL terminator */ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); From 8770c495dea5c2a6315ff7bf7acf193f12c70ed5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 22 Nov 2006 11:55:12 +0000 Subject: [PATCH 5739/7878] Backout R434327, R437115, which... Implement apr_threadkey_private destructors on WIN32 instead silently ignoring them. and reviewed by wrowe, brane, jerenkrantz to need a more comprehensive solution, e.g. Windows PE destructor entry points, that does -not- break svn. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@478137 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 -- include/arch/win32/apr_arch_threadproc.h | 6 --- misc/win32/start.c | 63 ------------------------ threadproc/win32/threadpriv.c | 17 +------ 4 files changed, 2 insertions(+), 88 deletions(-) diff --git a/CHANGES b/CHANGES index a41c2bb4fd3..e5f2a4ad8e1 100644 --- a/CHANGES +++ b/CHANGES @@ -25,10 +25,6 @@ Changes for APR 1.3.0 *) Fix the timeout converstion in apr_pollset with the KQueue backend. [Marco Molteni ] - *) Implement apr_threadkey_private destructors on WIN32 - instead silently ignoring them, so that they behave like on - the pthreads powered platforms. [Mladen Turk] - *) Support MinGW. [John Vandenberg, Justin Erenkrantz] *) Implement apr_thread_yield on Unix in terms of pthread_yield or diff --git a/include/arch/win32/apr_arch_threadproc.h b/include/arch/win32/apr_arch_threadproc.h index d4d70d5c95b..7af8ab6869b 100644 --- a/include/arch/win32/apr_arch_threadproc.h +++ b/include/arch/win32/apr_arch_threadproc.h @@ -17,7 +17,6 @@ #include "apr_private.h" #include "apr_thread_proc.h" #include "apr_file_io.h" -#include "apr_hash.h" #ifndef THREAD_PROC_H #define THREAD_PROC_H @@ -69,10 +68,5 @@ struct apr_thread_once_t { long value; }; -#if defined(APR_DECLARE_EXPORT) -/* Provide to win32/start.c */ -extern apr_hash_t *apr_tls_threadkeys; -#endif - #endif /* ! THREAD_PROC_H */ diff --git a/misc/win32/start.c b/misc/win32/start.c index 2890aef6d82..e15bf5d83e6 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -18,13 +18,11 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_signal.h" -#include "apr_hash.h" #include "ShellAPI.h" #include "apr_arch_misc.h" /* for WSAHighByte / WSALowByte */ #include "wchar.h" #include "apr_arch_file_io.h" -#include "apr_arch_threadproc.h" #include "assert.h" /* This symbol is _private_, although it must be exported. @@ -189,11 +187,6 @@ APR_DECLARE(apr_status_t) apr_initialize(void) apr_pool_tag(pool, "apr_initialize"); -#if defined(APR_DECLARE_EXPORT) - /* Initialize threadpriv table */ - apr_tls_threadkeys = apr_hash_make(pool); -#endif - iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); err = WSAStartup((WORD) iVersionRequested, &wsaData); if (err) { @@ -210,68 +203,12 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_SUCCESS; } -#if defined(APR_DECLARE_EXPORT) -typedef (apr_thredkey_destfn_t)(void *data); - -static void threadkey_terminate() -{ - apr_hash_index_t *hi = apr_hash_first(NULL, apr_tls_threadkeys); - - for (; hi != NULL; hi = apr_hash_next(hi)) { - LPDWORD key; - apr_hash_this(hi, &key, NULL, NULL); - TlsFree(*key); - } -} - -static void threadkey_detach() -{ - apr_hash_index_t *hi = apr_hash_first(NULL, apr_tls_threadkeys); - - for (; hi != NULL; hi = apr_hash_next(hi)) { - apr_thredkey_destfn_t *dest = NULL; - LPDWORD key; - void *data; - apr_hash_this(hi, &key, NULL, (void **)&dest); - data = TlsGetValue(*key); - if (data != NULL || GetLastError() == ERROR_SUCCESS) { - /* NULL data is a valid TLS value if explicitly set - * by the TlsSetValue - */ - (*dest)(data); - } - } -} - -BOOL APIENTRY DllMain(HINSTANCE instance, - DWORD reason_for_call, - LPVOID lpReserved) -{ - switch (reason_for_call) { - case DLL_PROCESS_ATTACH: - break; - case DLL_THREAD_ATTACH: - break; - case DLL_THREAD_DETACH: - threadkey_detach(); - break; - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} - -#endif /* APR_DECLARE_EXPORT */ - APR_DECLARE_NONSTD(void) apr_terminate(void) { initialized--; if (initialized) { return; } -#if defined(APR_DECLARE_EXPORT) - threadkey_terminate(); -#endif apr_pool_terminate(); WSACleanup(); diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index b1001e10737..0cbfe620e43 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -16,16 +16,11 @@ #include "apr_arch_threadproc.h" #include "apr_thread_proc.h" -#include "apr_hash.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_errno.h" #include "apr_portable.h" -#if defined(APR_DECLARE_EXPORT) -apr_hash_t *apr_tls_threadkeys = NULL; -#endif - APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *pool) @@ -38,10 +33,6 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, (*key)->pool = pool; if (((*key)->key = TlsAlloc()) != 0xFFFFFFFF) { -#if defined(APR_DECLARE_EXPORT) - apr_hash_set(apr_tls_threadkeys, &((*key)->key), - sizeof(DWORD), dest); -#endif return APR_SUCCESS; } return apr_get_os_error(); @@ -68,11 +59,7 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) { if (TlsFree(key->key)) { -#if defined(APR_DECLARE_EXPORT) - apr_hash_set(apr_tls_threadkeys, &(key->key), - sizeof(DWORD), NULL); -#endif - return APR_SUCCESS; + return APR_SUCCESS; } return apr_get_os_error(); } @@ -110,5 +97,5 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, } (*key)->key = *thekey; return APR_SUCCESS; -} +} From 55bbbba2946e1e2750c6f78a7b9954907ed9016b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 22 Nov 2006 21:26:14 +0000 Subject: [PATCH 5740/7878] Better exception handling of deferred socket connect outcomes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@478327 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/testsock.c b/test/testsock.c index 60dd8137948..d6545f1f1df 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -258,15 +258,21 @@ static void test_get_addr(abts_case *tc, void *data) * succeed (if the connection can be established synchronously), * but if it does, this test cannot proceed. */ rv = apr_socket_connect(cd, sa); - if (!APR_STATUS_IS_EINPROGRESS(rv)) { + if (rv == APR_SUCCESS) { apr_socket_close(ld); apr_socket_close(cd); - APR_ASSERT_SUCCESS(tc, "connect to listener", rv); ABTS_NOT_IMPL(tc, "Cannot test if connect completes " "synchronously"); return; } + if (!APR_STATUS_IS_EINPROGRESS(rv)) { + apr_socket_close(ld); + apr_socket_close(cd); + APR_ASSERT_SUCCESS(tc, "connect to listener", rv); + return; + } + APR_ASSERT_SUCCESS(tc, "accept connection", apr_socket_accept(&sd, ld, p)); From e75eedf9e96ca1ce00c5e82322bb3e10b16322e9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 27 Nov 2006 10:50:04 +0000 Subject: [PATCH 5741/7878] * test/testsock.c (setup_socket): Bind the socket to 127.0.0.1 rather than 0.0.0.0 since a connect() to the latter apparently doesn't work on Win32; the ./sockchild-based tests only use 127.0.0.1 anyway. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@479582 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testsock.c b/test/testsock.c index d6545f1f1df..5c83d68c0e3 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -79,7 +79,7 @@ static apr_socket_t *setup_socket(abts_case *tc) apr_sockaddr_t *sa; apr_socket_t *sock; - rv = apr_sockaddr_info_get(&sa, NULL, APR_INET, 8021, 0, p); + rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_INET, 8021, 0, p); APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); rv = apr_socket_create(&sock, sa->family, SOCK_STREAM, APR_PROTO_TCP, p); From 2226d2794615b23128bab01c41d963341ac19e7b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 28 Nov 2006 21:24:40 +0000 Subject: [PATCH 5742/7878] Sync Win32/OS2 unknown remote_addr and local_port flags to unix src. Reviewed by wrowe and jorton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@480212 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 6 ++++++ network_io/win32/sockets.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index aa112a60007..bb951e4c866 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -62,9 +62,11 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, sizeof(apr_sockaddr_t)); (*new)->local_addr->pool = p; + (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, sizeof(apr_sockaddr_t)); (*new)->remote_addr->pool = p; + (*new)->remote_addr_unknown = 1; /* Create a pollset with room for one descriptor. */ /* ### check return codes */ @@ -140,6 +142,10 @@ APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, return APR_OS2_STATUS(sock_errno()); else { sock->local_addr = sa; + /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ + if (sock->local_addr->sa.sin.sin_port == 0) { /* no need for ntohs() when comparing w/ 0 */ + sock->local_port_unknown = 1; /* kernel got us an ephemeral port */ + } return APR_SUCCESS; } } diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 327a3fdea5a..eed351b04a6 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -59,9 +59,11 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p) (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, sizeof(apr_sockaddr_t)); (*new)->local_addr->pool = p; + (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, sizeof(apr_sockaddr_t)); (*new)->remote_addr->pool = p; + (*new)->remote_addr_unknown = 1; /* Create a pollset with room for one descriptor. */ /* ### check return codes */ From aea757c0b22687569e3fd23ea70c64a2288ae7d3 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 29 Nov 2006 09:40:05 +0000 Subject: [PATCH 5743/7878] * include/apr_network_io.h: Avoid inappropriate use of the word "interface". git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@480497 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 011ae048d43..3ca87b326ef 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -164,7 +164,8 @@ struct in_addr { /** @} */ /** - * Enum to tell us if we're interested in remote or local socket + * Enum used to denote either the local and remote endpoint of a + * connection. */ typedef enum { APR_LOCAL, @@ -653,9 +654,11 @@ APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark); /** - * Return an apr_sockaddr_t from an apr_socket_t + * Return an address associated with a socket; either the address to + * which the socket is bound locally or the the address of the peer + * to which the socket is connected. * @param sa The returned apr_sockaddr_t. - * @param which Which interface do we want the apr_sockaddr_t for? + * @param which Whether to retrieve the local or remote address * @param sock The socket to use */ APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, From 56eb11a44ec519c0e10096beaf9231c74bd19e2b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 1 Dec 2006 09:28:13 +0000 Subject: [PATCH 5744/7878] * test/testsockets.c (sendto_receivefrom): Give useful error messages on bind() failure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@481198 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsockets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testsockets.c b/test/testsockets.c index 76725b3736e..beb6d5a160e 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -145,12 +145,12 @@ static void sendto_receivefrom(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "Could not set REUSEADDR on socket2", rv); rv = apr_socket_bind(sock, to); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + APR_ASSERT_SUCCESS(tc, "Could not bind socket", rv); if (rv != APR_SUCCESS) return; rv = apr_socket_bind(sock2, from); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + APR_ASSERT_SUCCESS(tc, "Could not bind second socket", rv); if (rv != APR_SUCCESS) return; From 7af4cbbf696de3081783302e852b243a255b7b64 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 3 Dec 2006 06:56:14 +0000 Subject: [PATCH 5745/7878] Add a test case for formating an apr_status_t with %pm that seems to always be failing for me on darwin. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@481731 13f79535-47bb-0310-9956-ffa450edef68 --- test/teststr.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/teststr.c b/test/teststr.c index 680f9edce14..1bf8ea73566 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -120,6 +120,18 @@ static void snprintf_0NULL(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, 6, rv); } +static void snprintf_status_t(abts_case *tc, void *data) +{ + char buf[128]; + int rv; + apr_status_t t = APR_ENOPOOL; + + rv = apr_snprintf(buf, sizeof buf, "%pm", t); + + ABTS_INT_EQUAL(tc, 32, rv); + ABTS_STR_EQUAL(tc, "A new pool could not be created.", buf); +} + static void snprintf_0nonNULL(abts_case *tc, void *data) { int rv; @@ -161,7 +173,7 @@ static void string_error(abts_case *tc, void *data) rv = apr_strerror(APR_TIMEUP, buf, sizeof buf); ABTS_PTR_EQUAL(tc, buf, rv); ABTS_STR_EQUAL(tc, "The timeout specified has expired", buf); - + /* throw some randomish numbers at it to check for robustness */ for (n = 1; n < 1000000; n *= 2) { apr_strerror(n, buf, sizeof buf); @@ -387,6 +399,7 @@ abts_suite *teststr(abts_suite *suite) { suite = ADD_SUITE(suite) + abts_run_test(suite, snprintf_status_t, NULL); abts_run_test(suite, snprintf_0NULL, NULL); abts_run_test(suite, snprintf_0nonNULL, NULL); abts_run_test(suite, snprintf_noNULL, NULL); From 2482480c85fa253f885647cb97c75a5c7357a7ea Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Mon, 4 Dec 2006 23:40:17 +0000 Subject: [PATCH 5746/7878] Revert r481731, which didn't really test the right thing, and testfmt.c already had a test case for this. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@482414 13f79535-47bb-0310-9956-ffa450edef68 --- test/teststr.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/test/teststr.c b/test/teststr.c index 1bf8ea73566..680f9edce14 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -120,18 +120,6 @@ static void snprintf_0NULL(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, 6, rv); } -static void snprintf_status_t(abts_case *tc, void *data) -{ - char buf[128]; - int rv; - apr_status_t t = APR_ENOPOOL; - - rv = apr_snprintf(buf, sizeof buf, "%pm", t); - - ABTS_INT_EQUAL(tc, 32, rv); - ABTS_STR_EQUAL(tc, "A new pool could not be created.", buf); -} - static void snprintf_0nonNULL(abts_case *tc, void *data) { int rv; @@ -173,7 +161,7 @@ static void string_error(abts_case *tc, void *data) rv = apr_strerror(APR_TIMEUP, buf, sizeof buf); ABTS_PTR_EQUAL(tc, buf, rv); ABTS_STR_EQUAL(tc, "The timeout specified has expired", buf); - + /* throw some randomish numbers at it to check for robustness */ for (n = 1; n < 1000000; n *= 2) { apr_strerror(n, buf, sizeof buf); @@ -399,7 +387,6 @@ abts_suite *teststr(abts_suite *suite) { suite = ADD_SUITE(suite) - abts_run_test(suite, snprintf_status_t, NULL); abts_run_test(suite, snprintf_0NULL, NULL); abts_run_test(suite, snprintf_0nonNULL, NULL); abts_run_test(suite, snprintf_noNULL, NULL); From 7357dc7170cb7255c43b8259aa8d8a983a976272 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Thu, 14 Dec 2006 04:59:18 +0000 Subject: [PATCH 5747/7878] Versions 1.2.8/0.9.13 were released December 4, 2006 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@486963 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 0f892946838..81f0d9511ce 100644 --- a/STATUS +++ b/STATUS @@ -3,7 +3,8 @@ Last modified at [$Date$] Releases: 1.3.0 : in development - 1.2.8 : in development + 1.2.9 : in development + 1.2.8 : released December 4, 2006 1.2.7 : released April 14, 2006 1.2.6 : released March 25, 2006 1.2.5 : not released @@ -17,7 +18,8 @@ Releases: 1.1.0 : released January 25, 2005 1.0.1 : released November 19, 2004 1.0.0 : released September 1, 2004 - 0.9.13 : in development + 0.9.14 : in development + 0.9.13 : released December 4, 2006 0.9.12 : released April 13, 2006 0.9.11 : released March 30, 2006 0.9.10 : tagged March 22, 2006, not released From 5b5e4445b68bbb5637a434f103cf1c1a03792fd5 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 18 Dec 2006 00:11:30 +0000 Subject: [PATCH 5748/7878] * memory/unix/apr_pools.c (apr_allocator_t): Add comments for struct members. Submitted by: Peter Steiner PR: 40955 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@488084 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index c9c851f47c6..c615cd67c26 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -62,16 +62,39 @@ /* * Allocator + * + * @note The max_free_index and current_free_index fields are not really + * indices, but quantities of BOUNDARY_SIZE big memory blocks. */ struct apr_allocator_t { + /** largest used index into free[], always < MAX_INDEX */ apr_uint32_t max_index; + /** Total size (in BOUNDARY_SIZE multiples) of unused memory before + * blocks are given back. @see apr_allocator_max_free_set(). + * @note Initialized to APR_ALLOCATOR_MAX_FREE_UNLIMITED, + * which means to never give back blocks. + */ apr_uint32_t max_free_index; + /** + * Memory size (in BOUNDARY_SIZE multiples) that currently must be freed + * before blocks are given back. Range: 0..max_free_index + */ apr_uint32_t current_free_index; #if APR_HAS_THREADS apr_thread_mutex_t *mutex; #endif /* APR_HAS_THREADS */ apr_pool_t *owner; + /** + * Lists of free nodes. Slot 0 is used for oversized nodes, + * and the slots 1..MAX_INDEX-1 contain nodes of sizes + * (i+1) * BOUNDARY_SIZE. Example for BOUNDARY_INDEX == 12: + * slot 0: nodes larger than 81920 + * slot 1: size 8192 + * slot 2: size 12288 + * ... + * slot 19: size 81920 + */ apr_memnode_t *free[MAX_INDEX]; }; From d70d0cd94ea75f801b926125995d0c1d0c7caac4 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 7 Jan 2007 18:35:50 +0000 Subject: [PATCH 5749/7878] * file_io/unix/readwrite.c (apr_file_writev): Fix variable type and spelling in comment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@493799 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index b870ba8381f..320735d68d6 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -240,7 +240,7 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove apr_size_t nvec, apr_size_t *nbytes) { #ifdef HAVE_WRITEV - int bytes; + apr_ssize_t bytes; if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { *nbytes = 0; @@ -253,8 +253,8 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove #else /** * The problem with trying to output the entire iovec is that we cannot - * maintain the behavoir that a real writev would have. If we iterate - * over the iovec one at a time, we loose the atomic properties of + * maintain the behaviour that a real writev would have. If we iterate + * over the iovec one at a time, we lose the atomic properties of * writev(). The other option is to combine the entire iovec into one * buffer that we could then send in one call to write(). This is not * reasonable since we do not know how much data an iovec could contain. From 84d518c3a7369314b6d2b3ed6e4bf988af9fca27 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 7 Jan 2007 18:40:25 +0000 Subject: [PATCH 5750/7878] * network_io/unix/multicast.c (find_if_index): Fix build if APR_HAVE_IPV6 == 0 on platforms with getifaddrs(). PR: 39199 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@493802 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ network_io/unix/multicast.c | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index e5f2a4ad8e1..c9fbdd58f46 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Fix --disable-ipv6 build on platforms with getifaddrs(). + PR 39199. [Joe Orton] + *) Correctly retrieve 'empty' environment values with apr_env_get on Win32 (e.g. "VAR="), and added validation to testall suite. PR 40764. [Issac Goldstand ] diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index 8667a1bb318..6ae96290289 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -38,11 +38,13 @@ static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast, } } -#if APR_HAVE_IPV6 +/* This function is only interested in AF_INET6 sockets, so a noop + * "return 0" implementation for the !APR_HAVE_IPV6 build is + * sufficient. */ static unsigned int find_if_index(const apr_sockaddr_t *iface) { unsigned int index = 0; -#ifdef HAVE_GETIFADDRS +#if defined(HAVE_GETIFADDRS) && APR_HAVE_IPV6 struct ifaddrs *ifp, *ifs; /** @@ -73,6 +75,7 @@ static unsigned int find_if_index(const apr_sockaddr_t *iface) return index; } +#if APR_HAVE_IPV6 static void fill_mip_v6(struct ipv6_mreq *mip, const apr_sockaddr_t *mcast, const apr_sockaddr_t *iface) { From 10900322047b917382f3faa1b2ee9a3f1b642342 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 7 Jan 2007 20:55:19 +0000 Subject: [PATCH 5751/7878] * memory/unix/apr_pools.c (pool_clear_debug): Fix pointer subtraction. PR: 41063 Submitted by: Peter Steiner git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@493834 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index c615cd67c26..f327c67fb0e 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1419,7 +1419,7 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) for (index = 0; index < node->index; index++) { memset(node->beginp[index], POOL_POISON_BYTE, - node->endp[index] - node->beginp[index]); + (char *)node->endp[index] - (char *)node->beginp[index]); free(node->beginp[index]); } From 9c0b5cc183c055a001ac3a93f992bf03dd5268b2 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 7 Jan 2007 21:06:18 +0000 Subject: [PATCH 5752/7878] * memory/unix/apr_pools.c (apr_pool_initialize): Fix possible crash with verbose debugging enabled. PR: 41063 Submitted by: Peter Steiner git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@493838 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ memory/unix/apr_pools.c | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index c9fbdd58f46..6809eb45969 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes for APR 1.3.0 + *) Fix possible crash in apr_pool_initialize() when built with + verbose pool debugging. PR 41063. + [Peter Steiner ] + *) Fix --disable-ipv6 build on platforms with getifaddrs(). PR 39199. [Joe Orton] diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index f327c67fb0e..9394e5d2463 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1233,6 +1233,7 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) apr_status_t rv; #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) char *logpath; + apr_file_t *debug_log = NULL; #endif if (apr_pools_initialized++) @@ -1262,14 +1263,21 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) rv = apr_env_get(&logpath, "APR_POOL_DEBUG_LOG", global_pool); + /* Don't pass file_stderr directly to apr_file_open() here, since + * apr_file_open() can call back to apr_pool_log_event() and that + * may attempt to use then then non-NULL but partially set up file + * object. */ if (rv == APR_SUCCESS) { - apr_file_open(&file_stderr, logpath, APR_APPEND|APR_WRITE|APR_CREATE, + apr_file_open(&debug_log, logpath, APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, global_pool); } else { - apr_file_open_stderr(&file_stderr, global_pool); + apr_file_open_stderr(&debug_log, global_pool); } + /* debug_log is now a file handle. */ + file_stderr = debug_log; + if (file_stderr) { apr_file_printf(file_stderr, "POOL DEBUG: [PID" From b6d83a7b77245fd83eecbff6cbcd554e07cabb1b Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Mon, 8 Jan 2007 13:09:33 +0000 Subject: [PATCH 5753/7878] Add Windows Vista os version detection git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@494055 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_misc.h | 3 ++- misc/win32/misc.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index 39f7c36ca23..f34c7e65c1f 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -103,7 +103,8 @@ typedef enum { APR_WIN_XP = 60, APR_WIN_XP_SP1 = 61, APR_WIN_XP_SP2 = 62, - APR_WIN_2003 = 70 + APR_WIN_2003 = 70, + APR_WIN_VISTA = 80 } apr_oslevel_e; extern APR_DECLARE_DATA apr_oslevel_e apr_os_level; diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 0d72823c263..97b294711a5 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -80,7 +80,7 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) apr_os_level = APR_WIN_2000_SP2; } else if (oslev.dwMinorVersion == 2) { - apr_os_level = APR_WIN_2003; + apr_os_level = APR_WIN_2003; } else { if (servpack < 1) @@ -91,6 +91,9 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) apr_os_level = APR_WIN_XP_SP2; } } + else if (oslev.dwMajorVersion == 6) { + apr_os_level = APR_WIN_VISTA; + } else { apr_os_level = APR_WIN_XP; } From e30944b0ccdfa918113cecdc849b31edb4b025aa Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 9 Jan 2007 07:33:05 +0000 Subject: [PATCH 5754/7878] .svn/ files should never be touched. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@494336 13f79535-47bb-0310-9956-ffa450edef68 --- build/lineends.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/lineends.pl b/build/lineends.pl index 9b723f418d3..a3af2a316e4 100644 --- a/build/lineends.pl +++ b/build/lineends.pl @@ -102,13 +102,14 @@ sub totxt { } } } + return if ($File::Find::dir =~ m|^(.+/)?.svn(/.+)?$|); @ostat = stat($oname); $srcfl = new IO::File $oname, "r" or die; $dstfl = new IO::File $tname, "w" or die; binmode $srcfl; if ($notnative) { binmode $dstfl; - } + } undef $t; while (<$srcfl>) { if (s/(\r*)\n$/\n/) { From 489c2a3de4cb561195e169211d98bea5f75facf8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 9 Jan 2007 07:37:06 +0000 Subject: [PATCH 5755/7878] Some additional binary formats that exist in a compiled tree git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@494337 13f79535-47bb-0310-9956-ffa450edef68 --- build/lineends.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/lineends.pl b/build/lineends.pl index a3af2a316e4..8d9b2d97bf4 100644 --- a/build/lineends.pl +++ b/build/lineends.pl @@ -26,16 +26,16 @@ $ignore .= "tar-gz-z-zip-jar-war-bz2-tgz-"; # Many document formats -$ignore .= "eps-psd-pdf-ai-"; +$ignore .= "eps-psd-pdf-chm-ai-"; # Some encodings $ignore .= "ucs2-ucs4-"; # Some binary objects -$ignore .= "class-so-dll-exe-obj-a-o-lo-slo-sl-dylib-"; +$ignore .= "class-so-dll-exe-obj-lib-a-o-lo-slo-sl-dylib-"; # Some build env files -$ignore .= "mcp-xdc-ncb-opt-pdb-ilk-sbr-"; +$ignore .= "mcp-xdc-ncb-opt-pdb-ilk-exp-res-pch-idb-sbr-"; $preservedate = 1; From 9041f9cb5f9184d885d48409cfa3ae3e7a0ca538 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 9 Jan 2007 19:20:35 +0000 Subject: [PATCH 5756/7878] alloc_socket() now defaults to remote_host_unknown == 1 Solves a bug on Win 2000 where AcceptEx inhibits the proper behavior of getpeername. PR: 41321 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@494531 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index eed351b04a6..fa68ce6b2f4 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -451,9 +451,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, (*apr_sock)->remote_addr->pool = cont; /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ (*apr_sock)->remote_addr->port = ntohs((*apr_sock)->remote_addr->sa.sin.sin_port); - } - else { - (*apr_sock)->remote_addr_unknown = 1; + (*apr_sock)->remote_addr_unknown = 0; } apr_pool_cleanup_register((*apr_sock)->pool, (void *)(*apr_sock), From 87687a8eec2e20ffb4e95170003969810876e3b6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Jan 2007 01:16:58 +0000 Subject: [PATCH 5757/7878] Add an -mt option which tags a post-build mt.exe action to all Application and Dynamic-Link library projects in the tree. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@495076 13f79535-47bb-0310-9956-ffa450edef68 --- build/cvtdsp.pl | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl index 5394eb58e22..67719825d4d 100644 --- a/build/cvtdsp.pl +++ b/build/cvtdsp.pl @@ -25,6 +25,9 @@ elsif ($ARGV[0] eq '-b') { find(\&tobrowse, '.'); } +elsif ($ARGV[0] eq '-mt') { + find(\&addmt, '.'); +} elsif ($ARGV[0] eq '-m') { ## 0 - conapp, 1 - dll lib, 2 - static lib $dsptype = 2; @@ -39,6 +42,61 @@ die "Missing argument"; } +sub addmt { + my $outpath, $outtype; + + if (m|\.dsp$|) { + $oname = $_; + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $oname, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ m|^# TARGTYPE .+ Application|) { + $outtype = ".exe" + } + if ($src =~ m|^# TARGTYPE .+ Dynamic-Link|) { + $outtype = ".dll" + } + if ($src =~ m|^# PROP Output_Dir "(.+)"|) { + $outdir = $1; + $outpath = $oname; + $outpath =~ s|\.dsp||; + $outpath = "./" . $outdir . "/" . $outpath . $outtype; + } + if ($src =~ m|^# ADD LINK32 .+ /out:"([^"]+)"|) { + $outpath = $1; + $outpath = "./" . $outpath if (!($outpath =~ m|^\.|)); + } + if (defined($outpath) && ($src =~ m|^# Begin Special Build Tool|)) { + undef $outpath; + } + if (defined($outpath) && defined($outtype) && ($src =~ m|^\s*$|)) { + print $dstfl '# Begin Special Build Tool' . "\n"; + print $dstfl 'TargetPath=' . $outpath . "\n"; + print $dstfl 'SOURCE="$(InputPath)"' . "\n"; + print $dstfl 'PostBuild_Desc=Embed .manifest' . "\n"; + print $dstfl 'PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath) .manifest -outputresource:$(TargetPath);2' . "\n"; + print $dstfl '# End Special Build Tool' . "\n"; + $verchg = -1; + undef $outpath; + } + print $dstfl $src; + } + undef $outtype if (defined($outtype)); + undef $outpath if (defined($outpath)); + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Added manifest to " . $oname . " in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } + } +} sub tovc5 { if (m|\.dsp$|) { From ce70c1f0718aef372957e65d4482d0bbc9137475 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Jan 2007 01:17:52 +0000 Subject: [PATCH 5758/7878] cvtdsp.pl -mt identified these two projects for .manifest processing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@495077 13f79535-47bb-0310-9956-ffa450edef68 --- test/testapp.dsp | 12 ++++++++++++ test/testappnt.dsp | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/test/testapp.dsp b/test/testapp.dsp index 93c4aa283fc..1a469b52afa 100644 --- a/test/testapp.dsp +++ b/test/testapp.dsp @@ -51,6 +51,12 @@ BSC32=bscmake.exe LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console # ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console +# Begin Special Build Tool +TargetPath=./Release/testapp.exe +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath) .manifest -outputresource:$(TargetPath);2 +# End Special Build Tool !ELSEIF "$(CFG)" == "testapp - Win32 Debug" @@ -75,6 +81,12 @@ BSC32=bscmake.exe LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug # ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug +# Begin Special Build Tool +TargetPath=././testapp.exe +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath) .manifest -outputresource:$(TargetPath);2 +# End Special Build Tool !ENDIF diff --git a/test/testappnt.dsp b/test/testappnt.dsp index f5cd43397aa..15a672024b6 100644 --- a/test/testappnt.dsp +++ b/test/testappnt.dsp @@ -51,6 +51,12 @@ BSC32=bscmake.exe LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console # ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console +# Begin Special Build Tool +TargetPath=./Release/testappnt.exe +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath) .manifest -outputresource:$(TargetPath);2 +# End Special Build Tool !ELSEIF "$(CFG)" == "testappnt - Win32 Debug" @@ -75,6 +81,12 @@ BSC32=bscmake.exe LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug # ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console /incremental:no /debug +# Begin Special Build Tool +TargetPath=././testappnt.exe +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath) .manifest -outputresource:$(TargetPath);2 +# End Special Build Tool !ENDIF From 9359bf2bdbd2a66930540ac208274d98604be1ad Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Jan 2007 01:23:21 +0000 Subject: [PATCH 5759/7878] Correct an extranious whitespace git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@495080 13f79535-47bb-0310-9956-ffa450edef68 --- build/cvtdsp.pl | 2 +- test/testapp.dsp | 4 ++-- test/testappnt.dsp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl index 67719825d4d..adc7632f5e8 100644 --- a/build/cvtdsp.pl +++ b/build/cvtdsp.pl @@ -76,7 +76,7 @@ sub addmt { print $dstfl 'TargetPath=' . $outpath . "\n"; print $dstfl 'SOURCE="$(InputPath)"' . "\n"; print $dstfl 'PostBuild_Desc=Embed .manifest' . "\n"; - print $dstfl 'PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath) .manifest -outputresource:$(TargetPath);2' . "\n"; + print $dstfl 'PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2' . "\n"; print $dstfl '# End Special Build Tool' . "\n"; $verchg = -1; undef $outpath; diff --git a/test/testapp.dsp b/test/testapp.dsp index 1a469b52afa..5d7264ea8db 100644 --- a/test/testapp.dsp +++ b/test/testapp.dsp @@ -55,7 +55,7 @@ LINK32=link.exe TargetPath=./Release/testapp.exe SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath) .manifest -outputresource:$(TargetPath);2 +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 # End Special Build Tool !ELSEIF "$(CFG)" == "testapp - Win32 Debug" @@ -85,7 +85,7 @@ LINK32=link.exe TargetPath=././testapp.exe SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath) .manifest -outputresource:$(TargetPath);2 +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 # End Special Build Tool !ENDIF diff --git a/test/testappnt.dsp b/test/testappnt.dsp index 15a672024b6..bbf5d88b6b0 100644 --- a/test/testappnt.dsp +++ b/test/testappnt.dsp @@ -55,7 +55,7 @@ LINK32=link.exe TargetPath=./Release/testappnt.exe SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath) .manifest -outputresource:$(TargetPath);2 +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 # End Special Build Tool !ELSEIF "$(CFG)" == "testappnt - Win32 Debug" @@ -85,7 +85,7 @@ LINK32=link.exe TargetPath=././testappnt.exe SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath) .manifest -outputresource:$(TargetPath);2 +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 # End Special Build Tool !ENDIF From 9eb0274f8e81595a2a85e1dead88c1ebe635e9ec Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Jan 2007 01:41:51 +0000 Subject: [PATCH 5760/7878] Nominally, more maintainable (filename appears once, not multiple times.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@495084 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libapr.dsp b/libapr.dsp index 8fb3472769f..060608169cd 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -57,10 +57,10 @@ LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref # ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"Release/libapr-1.dll" /opt:ref # Begin Special Build Tool -OutDir=.\Release +TargetPath=./Release/libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 # End Special Build Tool !ELSEIF "$(CFG)" == "libapr - Win32 Debug" @@ -89,10 +89,10 @@ LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug # ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"Debug/libapr-1.dll" # Begin Special Build Tool -OutDir=.\Debug +TargetPath=./Debug/libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 # End Special Build Tool !ELSEIF "$(CFG)" == "libapr - Win32 ReleaseNT" @@ -119,10 +119,10 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # Begin Special Build Tool -OutDir=.\ReleaseNT +TargetPath=./ReleaseNT/libapr.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 # End Special Build Tool !ELSEIF "$(CFG)" == "libapr - Win32 DebugNT" @@ -151,10 +151,10 @@ LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug # ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"DebugNT/libapr-1.dll" # Begin Special Build Tool -OutDir=.\DebugNT +TargetPath=./DebugNT/libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDIR)\libapr-1.dll.manifest -outputresource:$(OUTDIR)\libapr-1.dll;2 +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 # End Special Build Tool !ENDIF From 6d5e1b0dc2daa380d3dc63ba44ba6b78b5dd5467 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Jan 2007 04:57:28 +0000 Subject: [PATCH 5761/7878] Spent more time observing MSVC6's default syntax, change some path delims to their 'preferred' style. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@495116 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 15 ++++++++++----- libapr.dsp | 8 ++++---- test/testapp.dsp | 12 ++++++------ test/testappnt.dsp | 12 ++++++------ 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl index 9ee8918e90b..3012984df3d 100644 --- a/build/fixwin32mak.pl +++ b/build/fixwin32mak.pl @@ -14,7 +14,9 @@ # ignore our own direcory (allowing us to move into any parallel tree) $root =~ s|^.:(.*)?$|cd "$1|; $root =~ s|/|\\\\|g; -print "Testing " . $root . "\n"; +$altroot = $root; +$altroot =~ s| ".:| "|; +print "Stripping " . $root . " and " . $altroot . "\n"; find(\&fixcwd, '.'); sub fixcwd { @@ -23,26 +25,29 @@ sub fixcwd { $thisroot =~ s|^./(.*)$|$1|; $thisroot =~ s|/|\\\\|g; $thisroot = $root . "\\\\" . $thisroot; + $thisaltroot = $altroot . "\\\\" . $thisroot; $oname = $_; $tname = '.#' . $_; $verchg = 0; -#print "Processing " . $thisroot . " of " . $_ . "\n"; $srcfl = new IO::File $_, "r" || die; $dstfl = new IO::File $tname, "w" || die; while ($src = <$srcfl>) { if ($src =~ m|^\s*($root[^\"]*)\".*$|) { -#print "Found " . $1 . "\"\n"; $orig = $thisroot; + } elsif ($src =~ m|^\s*($altroot[^\"]*)\".*$|) { + $orig = $thisaltroot; + } + if (defined($orig)) { $repl = "cd \"."; while (!($src =~ s|$orig|$repl|)) { -#print "Tried replacing " . $orig . " with " . $repl . "\n"; if (!($orig =~ s|^(.*)\\\\[^\\]+$|$1|)) { break; } $repl .= "\\.."; } -#print "Replaced " . $orig . " with " . $repl . "\n"; +print "Replaced " . $orig . " with " . $repl . "\n"; $verchg = -1; + undef $orig; } print $dstfl $src; } diff --git a/libapr.dsp b/libapr.dsp index 060608169cd..2a572423894 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -55,9 +55,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"Release/libapr-1.dll" /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\Release\libapr-1.dll" /opt:ref # Begin Special Build Tool -TargetPath=./Release/libapr-1.dll +TargetPath=.\Release\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -87,9 +87,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"Debug/libapr-1.dll" +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\Debug\libapr-1.dll" # Begin Special Build Tool -TargetPath=./Debug/libapr-1.dll +TargetPath=.\Debug\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 diff --git a/test/testapp.dsp b/test/testapp.dsp index 5d7264ea8db..153cbd3649d 100644 --- a/test/testapp.dsp +++ b/test/testapp.dsp @@ -32,13 +32,13 @@ RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" +# PROP BASE Output_Dir "." +# PROP BASE Intermediate_Dir "." # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" +# PROP Output_Dir "." +# PROP Intermediate_Dir "." # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c @@ -52,7 +52,7 @@ LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console # ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console # Begin Special Build Tool -TargetPath=./Release/testapp.exe +TargetPath=.\testapp.exe SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -82,7 +82,7 @@ LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug # ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug # Begin Special Build Tool -TargetPath=././testapp.exe +TargetPath=.\testapp.exe SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 diff --git a/test/testappnt.dsp b/test/testappnt.dsp index bbf5d88b6b0..af21c294983 100644 --- a/test/testappnt.dsp +++ b/test/testappnt.dsp @@ -32,13 +32,13 @@ RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" +# PROP BASE Output_Dir "." +# PROP BASE Intermediate_Dir "." # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" +# PROP Output_Dir "." +# PROP Intermediate_Dir "." # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "WINNT" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c @@ -52,7 +52,7 @@ LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console # ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console # Begin Special Build Tool -TargetPath=./Release/testappnt.exe +TargetPath=.\testappnt.exe SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -82,7 +82,7 @@ LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug # ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console /incremental:no /debug # Begin Special Build Tool -TargetPath=././testappnt.exe +TargetPath=.\testappnt.exe SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 From c7f57fcaa39e51f9683804002cf22e3427ba13d0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Jan 2007 04:59:01 +0000 Subject: [PATCH 5762/7878] Revert the changes to fixwin32mak.pl - not tested, and didn't intend to commit this git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@495117 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl index 3012984df3d..9ee8918e90b 100644 --- a/build/fixwin32mak.pl +++ b/build/fixwin32mak.pl @@ -14,9 +14,7 @@ # ignore our own direcory (allowing us to move into any parallel tree) $root =~ s|^.:(.*)?$|cd "$1|; $root =~ s|/|\\\\|g; -$altroot = $root; -$altroot =~ s| ".:| "|; -print "Stripping " . $root . " and " . $altroot . "\n"; +print "Testing " . $root . "\n"; find(\&fixcwd, '.'); sub fixcwd { @@ -25,29 +23,26 @@ sub fixcwd { $thisroot =~ s|^./(.*)$|$1|; $thisroot =~ s|/|\\\\|g; $thisroot = $root . "\\\\" . $thisroot; - $thisaltroot = $altroot . "\\\\" . $thisroot; $oname = $_; $tname = '.#' . $_; $verchg = 0; +#print "Processing " . $thisroot . " of " . $_ . "\n"; $srcfl = new IO::File $_, "r" || die; $dstfl = new IO::File $tname, "w" || die; while ($src = <$srcfl>) { if ($src =~ m|^\s*($root[^\"]*)\".*$|) { +#print "Found " . $1 . "\"\n"; $orig = $thisroot; - } elsif ($src =~ m|^\s*($altroot[^\"]*)\".*$|) { - $orig = $thisaltroot; - } - if (defined($orig)) { $repl = "cd \"."; while (!($src =~ s|$orig|$repl|)) { +#print "Tried replacing " . $orig . " with " . $repl . "\n"; if (!($orig =~ s|^(.*)\\\\[^\\]+$|$1|)) { break; } $repl .= "\\.."; } -print "Replaced " . $orig . " with " . $repl . "\n"; +#print "Replaced " . $orig . " with " . $repl . "\n"; $verchg = -1; - undef $orig; } print $dstfl $src; } From 174994eb8f1c318893e5961aa869bcead6f94173 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Jan 2007 05:07:47 +0000 Subject: [PATCH 5763/7878] complete change to msvc6 'preferred' syntax. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@495122 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libapr.dsp b/libapr.dsp index 2a572423894..cb12e13238e 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -118,8 +118,10 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\ReleaseNT\libapr-1.dll" /opt:ref # Begin Special Build Tool -TargetPath=./ReleaseNT/libapr.dll +TargetPath=.\ReleaseNT\libapr.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -149,9 +151,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"DebugNT/libapr-1.dll" +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\DebugNT\libapr-1.dll" # Begin Special Build Tool -TargetPath=./DebugNT/libapr-1.dll +TargetPath=.\DebugNT\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 From ce69ef45e646d3bfa0db010020e7d7a21626da7f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Jan 2007 05:37:55 +0000 Subject: [PATCH 5764/7878] Correct the path syntax for link /out: and the manifest's InputFile specification git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@495127 13f79535-47bb-0310-9956-ffa450edef68 --- build/cvtdsp.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl index adc7632f5e8..3a21eb7cd6e 100644 --- a/build/cvtdsp.pl +++ b/build/cvtdsp.pl @@ -39,6 +39,7 @@ print "Specify -w3 or -w4 for .dsp build with warning level 3 or 4 (strict)\n\n"; print "Specify -ia64 for build targeted at Itanium (req's psdk tools)\n\n"; print "Specify -p for extreme pool debugging\n\n"; + print "Specify -mt to add .manifest embedding\n\n"; die "Missing argument"; } @@ -62,11 +63,13 @@ sub addmt { $outdir = $1; $outpath = $oname; $outpath =~ s|\.dsp||; - $outpath = "./" . $outdir . "/" . $outpath . $outtype; + $outpath = ".\\" . $outdir . "\\" . $outpath . $outtype; } - if ($src =~ m|^# ADD LINK32 .+ /out:"([^"]+)"|) { - $outpath = $1; - $outpath = "./" . $outpath if (!($outpath =~ m|^\.|)); + if ($src =~ m|^# ADD (BASE )?LINK32 .+ /out:"([^"]+)"|) { + $outpath = $2; + $outpath =~ s|/|\\|; + $outpath = ".\\" . $outpath if (!($outpath =~ m|^\.|)); + $src =~ s|/out:"([^"]+)"|/out:"$outpath"|; } if (defined($outpath) && ($src =~ m|^# Begin Special Build Tool|)) { undef $outpath; From e4be13412cd5f811196b37f40d8c193083e4d432 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 12 Jan 2007 17:28:44 +0000 Subject: [PATCH 5765/7878] * memory/unix/apr_pools.c (apr_pool_log_event): Fix compiler warning with verbose pool debugging enabled on LP64 platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@495651 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 9394e5d2463..461453f3f1b 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1127,7 +1127,7 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, "] " "%7s " "(%10lu/%10lu/%10lu) " - "0x%08X \"%s\" " + "0x%pp \"%s\" " "<%s> " "(%u/%u/%u) " "\n", @@ -1139,7 +1139,7 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, (unsigned long)apr_pool_num_bytes(pool, 0), (unsigned long)apr_pool_num_bytes(pool, 1), (unsigned long)apr_pool_num_bytes(global_pool, 1), - (unsigned int)pool, pool->tag, + pool, pool->tag, file_line, pool->stat_alloc, pool->stat_total_alloc, pool->stat_clear); } @@ -1153,7 +1153,7 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, "] " "%7s " " " - "0x%08X " + "0x%pp " "<%s> " "\n", (unsigned long)getpid(), @@ -1161,7 +1161,7 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, (unsigned long)apr_os_thread_current(), #endif /* APR_HAS_THREADS */ event, - (unsigned int)pool, + pool, file_line); } } From 1e8a6896fe4aa392cba305b0383e8b5b1e28009a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 24 Jan 2007 14:30:55 +0000 Subject: [PATCH 5766/7878] slightly busted other-child API discards interesting information which should be available to the maintenance function fix in 2.0 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@499417 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/STATUS b/STATUS index 81f0d9511ce..120cdd3585a 100644 --- a/STATUS +++ b/STATUS @@ -434,6 +434,20 @@ API Changes Postponed for APR 2.0: would be slightly faster, for what's likely to be little impact on performance. + * The other-child API doesn't allow the apr_exit_why_e to be passed to the + application's maintenance function. The expected usage is that the + application calls apr_proc_wait[_all_procs]() and is given back + apr_exit_why_e and exit_code_or_signal_num, thus losing the original + (on Unix, at least) representation which held both pieces of information + in an int. Both pieces of data should be available to the maintenance + function so that it has the opportunity to take different actions. An + example would be to issue messages about probable misconfiguration when + receiving a certain exit code and trying to restart otherwise. Thus, + apr_proc_other_child_alert() should take an additional apr_exit_why_e + parameter, as should the application-provided maintenance function. The + exit-why value would be ignored in the same circumstances as the existing + status parameter: reason != APR_OC_REASON_DEATH. + Stuff for post 1.0: * Almost every API in APR depends on pools, but pool semantics From bf281b9f8447ef16027ff5a11860d132e8dbd4bc Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 26 Jan 2007 20:04:26 +0000 Subject: [PATCH 5767/7878] apr_pollset_remove: speed up the httpd Event MPM when lots of connections are in use epoll/Linux only for now. ./buildconf on FreeBSD (minotaur) spewed tons of errors; hints appreciated git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@500321 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_poll_private.h | 2 +- poll/unix/epoll.c | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index f176eac0e54..baacef2b076 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -91,8 +91,8 @@ typedef struct pfd_elem_t pfd_elem_t; struct pfd_elem_t { - APR_RING_ENTRY(pfd_elem_t) link; apr_pollfd_t pfd; + APR_RING_ENTRY(pfd_elem_t) link; }; #endif diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index d1919a5eb8b..803612b6cc3 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -219,18 +219,10 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, pollset_lock_rings(); if (!APR_RING_EMPTY(&(pollset->query_ring), pfd_elem_t, link)) { - for (ep = APR_RING_FIRST(&(pollset->query_ring)); - ep != APR_RING_SENTINEL(&(pollset->query_ring), - pfd_elem_t, link); - ep = APR_RING_NEXT(ep, link)) { + ep = (pfd_elem_t *) descriptor; - if (descriptor->desc.s == ep->pfd.desc.s) { - APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->dead_ring), - ep, pfd_elem_t, link); - break; - } - } + APR_RING_REMOVE(ep, link); + APR_RING_INSERT_TAIL(&(pollset->dead_ring), ep, pfd_elem_t, link); } pollset_unlock_rings(); From 50031e47aedd23973eded83562c679ff18469179 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Mon, 29 Jan 2007 15:56:41 +0000 Subject: [PATCH 5768/7878] reverting rev 500321 pending investigation of problem reported by jorton. This line, and those below, will be ignored-- M include/arch/unix/apr_arch_poll_private.h M poll/unix/epoll.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@501085 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_poll_private.h | 2 +- poll/unix/epoll.c | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index baacef2b076..f176eac0e54 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -91,8 +91,8 @@ typedef struct pfd_elem_t pfd_elem_t; struct pfd_elem_t { - apr_pollfd_t pfd; APR_RING_ENTRY(pfd_elem_t) link; + apr_pollfd_t pfd; }; #endif diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 803612b6cc3..d1919a5eb8b 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -219,10 +219,18 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, pollset_lock_rings(); if (!APR_RING_EMPTY(&(pollset->query_ring), pfd_elem_t, link)) { - ep = (pfd_elem_t *) descriptor; + for (ep = APR_RING_FIRST(&(pollset->query_ring)); + ep != APR_RING_SENTINEL(&(pollset->query_ring), + pfd_elem_t, link); + ep = APR_RING_NEXT(ep, link)) { - APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->dead_ring), ep, pfd_elem_t, link); + if (descriptor->desc.s == ep->pfd.desc.s) { + APR_RING_REMOVE(ep, link); + APR_RING_INSERT_TAIL(&(pollset->dead_ring), + ep, pfd_elem_t, link); + break; + } + } } pollset_unlock_rings(); From 068d2c638e7e5fa678d5ed1ffd32d53b58dac556 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 29 Jan 2007 16:31:18 +0000 Subject: [PATCH 5769/7878] * build/gen-build.py: Basic support for defining dynamically-loadable modules, in preparation for supporting APR-Util DBD drivers as DSOs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@501091 13f79535-47bb-0310-9956-ffa450edef68 --- build/gen-build.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build/gen-build.py b/build/gen-build.py index 3df86838a36..30f19182c8a 100755 --- a/build/gen-build.py +++ b/build/gen-build.py @@ -123,6 +123,23 @@ def main(): f.write('HEADERS = $(top_srcdir)/%s\n\n' % string.join(headers, ' $(top_srcdir)/')) f.write('SOURCE_DIRS = %s $(EXTRA_SOURCE_DIRS)\n\n' % string.join(dirs.keys())) + if parser.has_option('options', 'modules'): + modules = parser.get('options', 'modules') + + for mod in string.split(modules): + files = get_files(parser.get(mod, 'paths')) + objects, _unused = write_objects(f, legal_deps, h_deps, files) + flat_objects = string.join(objects) + f.write('OBJECTS_%s = %s\n' % (mod, flat_objects)) + + if parser.has_option(mod, 'target'): + target = parser.get(mod, 'target') + f.write('MODULE_%s = %s\n' % (mod, target)) + f.write('%s: %s\n' % (target, flat_objects)) + f.write('\t$(LINK_MODULE) -o $@ %s $(LDADD_%s)\n' % (flat_objects, mod)) + + f.write('\n') + # Build a list of all necessary directories in build tree alldirs = { } for dir in dirs.keys(): From 120f2e5e4a392c81f1b04428a785a32fb578978b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 29 Jan 2007 19:21:30 +0000 Subject: [PATCH 5770/7878] Fix compile failure in pthread_attr_setdetachstate() logic on z/OS. Submitted by: David Jones Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@501150 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/thread.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 371b31d624f..f62856d0e51 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -58,14 +58,18 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, return stat; } +#if defined(PTHREAD_CREATE_DETACHED) #define DETACH_ARG(v) ((v) ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE) +#else +#define DETACH_ARG(v) ((v) ? 1 : 0) +#endif APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) { apr_status_t stat; #ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR - int arg = DETACH_ARG(v); + int arg = DETACH_ARG(on); if ((stat = pthread_attr_setdetachstate(&attr->attr, &arg)) == 0) { #else From f81180e9b5e6647bfbccafbf42daec3e82001b98 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 31 Jan 2007 23:51:54 +0000 Subject: [PATCH 5771/7878] Implement a BASEDIR build environment variable to allow the NetWare build to relocate the install files Submitted by: Guenter Knauf git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@502048 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUenvironment.inc | 7 ++++++- test/NWGNUmakefile | 2 +- test/testlock.c | 8 ++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index fd54b487c93..7f6b318f995 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -214,7 +214,12 @@ endif endif ifdef DEST -INSTALLBASE := $(INSTALL)\Apache2 + +ifndef BASEDIR +BASEDIR = Apache2 +endif + +INSTALLBASE := $(INSTALL)\$(BASEDIR) INSTDEVDIRS := \ $(INSTDIRS) \ diff --git a/test/NWGNUmakefile b/test/NWGNUmakefile index c5bf24c1111..d56f426c282 100644 --- a/test/NWGNUmakefile +++ b/test/NWGNUmakefile @@ -249,7 +249,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples) # install :: nlms FORCE - copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2 + copy $(OBJDIR)\*.nlm $(INSTALLBASE) # # Any specialized rules here diff --git a/test/testlock.c b/test/testlock.c index dddb52f76a9..7ff38dbd846 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -322,10 +322,10 @@ abts_suite *testlock(abts_suite *suite) #if !APR_HAS_THREADS abts_run_test(suite, threads_not_impl, NULL); #else - abts_run_test(suite, test_thread_mutex, NULL); - abts_run_test(suite, test_thread_rwlock, NULL); - abts_run_test(suite, test_cond, NULL); - abts_run_test(suite, test_timeoutcond, NULL); +// abts_run_test(suite, test_thread_mutex, NULL); +// abts_run_test(suite, test_thread_rwlock, NULL); +// abts_run_test(suite, test_cond, NULL); +// abts_run_test(suite, test_timeoutcond, NULL); #endif return suite; From 77e645ba200a842674fda67d6bffd5c701317ac1 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 1 Feb 2007 12:30:17 +0000 Subject: [PATCH 5772/7878] Have jlibtool match GNU libtool's behavior when creating a static library that links against another static library by importing all objects into the new static library. Part of this functionality was there, but it was dormant. Also avoid 'touch'ing a file when we don't want a fake output name. * build/jlibtool.c (pop_count_chars): Make it easy to reduce the number of vals. (flatten_count_chars): Make the insertion of the space optional. (run_command): Update flatten_count_chars. (safe_mkdir): Factor out our mkdir sequence. (jlibtool_basename, nameof): Move earlier in file. (explode_static_lib): Move earlier and rewrite it so it works. (parse_input_file_name): Explode the static lib if we're creating a library. (run_mode): Call safe_mkdir. (ensure_fake_uptodate): If we don't have a fake output name specified, don't call touch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@502202 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 261 +++++++++++++++++++++++++++-------------------- 1 file changed, 153 insertions(+), 108 deletions(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index 132fdaaa979..bfa30bc074a 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -341,6 +341,11 @@ void push_count_chars(count_chars *cc, const char *newval) cc->vals[cc->num++] = newval; } +void pop_count_chars(count_chars *cc) +{ + cc->num--; +} + void insert_count_chars(count_chars *cc, const char *newval, int position) { int i; @@ -363,7 +368,7 @@ void append_count_chars(count_chars *cc, count_chars *cctoadd) } } -const char *flatten_count_chars(count_chars *cc) +const char *flatten_count_chars(count_chars *cc, int space) { int i, size; char *newval; @@ -372,6 +377,9 @@ const char *flatten_count_chars(count_chars *cc) for (i = 0; i < cc->num; i++) { if (cc->vals[i]) { size += strlen(cc->vals[i]) + 1; + if (space) { + size++; + } } } @@ -381,7 +389,9 @@ const char *flatten_count_chars(count_chars *cc) for (i = 0; i < cc->num; i++) { if (cc->vals[i]) { strcat(newval, cc->vals[i]); - strcat(newval, " "); + if (space) { + strcat(newval, " "); + } } } @@ -474,7 +484,7 @@ int run_command(command_t *cmd_data, count_chars *cc) append_count_chars(&tmpcc, cc); - command = shell_esc(flatten_count_chars(&tmpcc)); + command = shell_esc(flatten_count_chars(&tmpcc, 1)); spawn_args[0] = SHELL_CMD; spawn_args[1] = "-c"; @@ -665,6 +675,20 @@ long safe_strtol(const char *nptr, const char **endptr, int base) return rv; } +void safe_mkdir(const char *path) +{ + mode_t old_umask; + + old_umask = umask(0); + umask(old_umask); + +#ifdef MKDIR_NO_UMASK + mkdir(path); +#else + mkdir(path, ~old_umask); +#endif +} + /* version_info is in the form of MAJOR:MINOR:PATCH */ const char *darwin_dynamic_link_function(const char *version_info) { @@ -1106,6 +1130,119 @@ void add_linker_flag_prefix(count_chars *cc, const char *arg) #endif } +/* returns just a file's name without the path */ +const char *jlibtool_basename(const char *fullpath) +{ + const char *name = strrchr(fullpath, '/'); + + if (name == NULL) { + name = strrchr(fullpath, '\\'); + } + + if (name == NULL) { + name = fullpath; + } else { + name++; + } + + return name; +} + +/* returns just a file's name without path or extension */ +const char *nameof(const char *fullpath) +{ + const char *name; + const char *ext; + + name = jlibtool_basename(fullpath); + ext = strrchr(name, '.'); + + if (ext) { + char *trimmed; + trimmed = malloc(ext - name + 1); + strncpy(trimmed, name, ext - name); + trimmed[ext-name] = 0; + return trimmed; + } + + return name; +} + +int explode_static_lib(command_t *cmd_data, const char *lib) +{ + count_chars tmpdir_cc, libname_cc; + const char *tmpdir, *libname; + char savewd[PATH_MAX]; + const char *name; + DIR *dir; + struct dirent *entry; + const char *lib_args[4]; + + /* Bah! */ + if (cmd_data->options.dry_run) { + return 0; + } + + name = jlibtool_basename(lib); + + init_count_chars(&tmpdir_cc); + push_count_chars(&tmpdir_cc, ".libs/"); + push_count_chars(&tmpdir_cc, name); + push_count_chars(&tmpdir_cc, ".exploded/"); + tmpdir = flatten_count_chars(&tmpdir_cc, 0); + + if (!cmd_data->options.silent) { + printf("Making: %s\n", tmpdir); + } + safe_mkdir(tmpdir); + + push_count_chars(cmd_data->tmp_dirs, tmpdir); + + getcwd(savewd, sizeof(savewd)); + + if (chdir(tmpdir) != 0) { + if (!cmd_data->options.silent) { + printf("Warning: could not explode %s\n", lib); + } + return 1; + } + + if (lib[0] == '/') { + libname = lib; + } + else { + init_count_chars(&libname_cc); + push_count_chars(&libname_cc, "../../"); + push_count_chars(&libname_cc, lib); + libname = flatten_count_chars(&libname_cc, 0); + } + + lib_args[0] = LIBRARIAN; + lib_args[1] = "x"; + lib_args[2] = libname; + lib_args[3] = NULL; + + external_spawn(cmd_data, LIBRARIAN, lib_args); + + chdir(savewd); + dir = opendir(tmpdir); + + while ((entry = readdir(dir)) != NULL) { + if (entry->d_name[0] != '.') { + push_count_chars(&tmpdir_cc, entry->d_name); + name = flatten_count_chars(&tmpdir_cc, 0); + if (!cmd_data->options.silent) { + printf("Adding: %s\n", name); + } + push_count_chars(cmd_data->obj_files, name); + pop_count_chars(&tmpdir_cc); + } + } + + closedir(dir); + return 0; +} + int parse_input_file_name(char *arg, command_t *cmd_data) { char *ext = strrchr(arg, '.'); @@ -1170,11 +1307,19 @@ int parse_input_file_name(char *arg, command_t *cmd_data) #ifdef ADD_MINUS_L if (libtype == type_DYNAMIC_LIB) { add_minus_l(cmd_data->shared_opts.dependencies, newarg); + } else if (cmd_data->output == otLibrary && + libtype == type_STATIC_LIB) { + explode_static_lib(cmd_data, newarg); } else { push_count_chars(cmd_data->shared_opts.dependencies, newarg); } #else - push_count_chars(cmd_data->shared_opts.dependencies, newarg); + if (cmd_data->output == otLibrary && libtype == type_STATIC_LIB) { + explode_static_lib(cmd_data, newarg); + } + else { + push_count_chars(cmd_data->shared_opts.dependencies, newarg); + } #endif if (libtype == type_DYNAMIC_LIB) { if (cmd_data->options.no_install) { @@ -1327,44 +1472,6 @@ int parse_output_file_name(char *arg, command_t *cmd_data) return 0; } -/* returns just a file's name without the path */ -const char *jlibtool_basename(const char *fullpath) -{ - const char *name = strrchr(fullpath, '/'); - - if (name == NULL) { - name = strrchr(fullpath, '\\'); - } - - if (name == NULL) { - name = fullpath; - } else { - name++; - } - - return name; -} - -/* returns just a file's name without path or extension */ -const char *nameof(const char *fullpath) -{ - const char *name; - const char *ext; - - name = jlibtool_basename(fullpath); - ext = strrchr(name, '.'); - - if (ext) { - char *trimmed; - trimmed = malloc(ext - name + 1); - strncpy(trimmed, name, ext - name); - trimmed[ext-name] = 0; - return trimmed; - } - - return name; -} - void parse_args(int argc, char *argv[], command_t *cmd_data) { int a; @@ -1435,62 +1542,6 @@ void parse_args(int argc, char *argv[], command_t *cmd_data) } -int explode_static_lib(const char *lib, command_t *cmd_data) -{ - char tmpdir[1024]; - char savewd[1024]; - char cmd[1024]; - const char *name; - DIR *dir; - struct dirent *entry; - - /* Bah! */ - if (cmd_data->options.dry_run) { - return 0; - } - - strcpy(tmpdir, lib); - strcat(tmpdir, ".exploded"); - -#ifdef MKDIR_NO_UMASK - mkdir(tmpdir); -#else - mkdir(tmpdir, 0); -#endif - push_count_chars(cmd_data->tmp_dirs, strdup(tmpdir)); - getcwd(savewd, sizeof(savewd)); - - if (chdir(tmpdir) != 0) - return 1; - - strcpy(cmd, LIBRARIAN " x "); - name = strrchr(lib, '/'); - - if (name) { - name++; - } else { - name = lib; - } - - strcat(cmd, "../"); - strcat(cmd, name); - system(cmd); - chdir(savewd); - dir = opendir(tmpdir); - - while ((entry = readdir(dir)) != NULL) { - if (entry->d_name[0] != '.') { - strcpy(cmd, tmpdir); - strcat(cmd, "/"); - strcat(cmd, entry->d_name); - push_count_chars(cmd_data->arglist, strdup(cmd)); - } - } - - closedir(dir); - return 0; -} - #ifdef GEN_EXPORTS void generate_def_file(command_t *cmd_data) { @@ -1788,16 +1839,7 @@ int run_mode(command_t *cmd_data) case mLink: if (!cmd_data->options.dry_run) { /* Check first to see if the dir already exists! */ - mode_t old_umask; - - old_umask = umask(0); - umask(old_umask); - -#ifdef MKDIR_NO_UMASK - mkdir(".libs"); -#else - mkdir(".libs", ~old_umask); -#endif + safe_mkdir(".libs"); } if (cmd_data->output == otStaticLibraryOnly || @@ -1906,6 +1948,9 @@ int ensure_fake_uptodate(command_t *cmd_data) if (cmd_data->mode == mInstall) { return 0; } + if (!cmd_data->fake_output_name) { + return 0; + } touch_args[0] = "touch"; touch_args[1] = cmd_data->fake_output_name; From deab3a6eb9f97e9a690f06b9e8f61a760242917b Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 9 Feb 2007 00:01:21 +0000 Subject: [PATCH 5773/7878] add a test for apr_atomic_casptr, used in the httpd worker and event MPMs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@505091 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/testatomic.c b/test/testatomic.c index b2c8d16df4c..fff0fa937de 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -111,6 +111,39 @@ static void test_cas_notequal(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, 12, casval); } +static void test_casptr_equal(abts_case *tc, void *data) +{ + int a; + volatile void *target_ptr = NULL; + void *old_ptr; + + old_ptr = apr_atomic_casptr(&target_ptr, &a, NULL); + ABTS_PTR_EQUAL(tc, NULL, old_ptr); + ABTS_PTR_EQUAL(tc, &a, (void *) target_ptr); +} + +static void test_casptr_equal_nonnull(abts_case *tc, void *data) +{ + int a, b; + volatile void *target_ptr = &a; + void *old_ptr; + + old_ptr = apr_atomic_casptr(&target_ptr, &b, &a); + ABTS_PTR_EQUAL(tc, &a, old_ptr); + ABTS_PTR_EQUAL(tc, &b, (void *) target_ptr); +} + +static void test_casptr_notequal(abts_case *tc, void *data) +{ + int a, b; + volatile void *target_ptr = &a; + void *old_ptr; + + old_ptr = apr_atomic_casptr(&target_ptr, &a, &b); + ABTS_PTR_EQUAL(tc, &a, old_ptr); + ABTS_PTR_EQUAL(tc, &a, (void *) target_ptr); +} + static void test_add32(abts_case *tc, void *data) { apr_uint32_t oldval; @@ -290,6 +323,9 @@ abts_suite *testatomic(abts_suite *suite) abts_run_test(suite, test_cas_equal, NULL); abts_run_test(suite, test_cas_equal_nonnull, NULL); abts_run_test(suite, test_cas_notequal, NULL); + abts_run_test(suite, test_casptr_equal, NULL); + abts_run_test(suite, test_casptr_equal_nonnull, NULL); + abts_run_test(suite, test_casptr_notequal, NULL); abts_run_test(suite, test_add32, NULL); abts_run_test(suite, test_inc32, NULL); abts_run_test(suite, test_set_add_inc_sub, NULL); From ab27b20fb2bab43af8bd5a80d3f49ed0daea7b83 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 16 Feb 2007 17:32:18 +0000 Subject: [PATCH 5774/7878] * random/unix/sha2.c: Fix array declarations for C89, which requires static before const. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@508506 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/sha2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/random/unix/sha2.c b/random/unix/sha2.c index 7f55dac959b..070526d9d34 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -157,7 +157,7 @@ void apr__SHA512_Transform(SHA512_CTX*, const sha2_word64*); /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ /* Hash constant words K for SHA-256: */ -const static sha2_word32 K256[64] = { +static const sha2_word32 K256[64] = { 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, @@ -177,7 +177,7 @@ const static sha2_word32 K256[64] = { }; /* Initial hash value H for SHA-256: */ -const static sha2_word32 sha256_initial_hash_value[8] = { +static const sha2_word32 sha256_initial_hash_value[8] = { 0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, @@ -189,7 +189,7 @@ const static sha2_word32 sha256_initial_hash_value[8] = { }; /* Hash constant words K for SHA-384 and SHA-512: */ -const static sha2_word64 K512[80] = { +static const sha2_word64 K512[80] = { APR_UINT64_C(0x428a2f98d728ae22), APR_UINT64_C(0x7137449123ef65cd), APR_UINT64_C(0xb5c0fbcfec4d3b2f), APR_UINT64_C(0xe9b5dba58189dbbc), APR_UINT64_C(0x3956c25bf348b538), APR_UINT64_C(0x59f111f1b605d019), @@ -233,7 +233,7 @@ const static sha2_word64 K512[80] = { }; /* Initial hash value H for SHA-384 */ -const static sha2_word64 sha384_initial_hash_value[8] = { +static const sha2_word64 sha384_initial_hash_value[8] = { APR_UINT64_C(0xcbbb9d5dc1059ed8), APR_UINT64_C(0x629a292a367cd507), APR_UINT64_C(0x9159015a3070dd17), @@ -245,7 +245,7 @@ const static sha2_word64 sha384_initial_hash_value[8] = { }; /* Initial hash value H for SHA-512 */ -const static sha2_word64 sha512_initial_hash_value[8] = { +static const sha2_word64 sha512_initial_hash_value[8] = { APR_UINT64_C(0x6a09e667f3bcc908), APR_UINT64_C(0xbb67ae8584caa73b), APR_UINT64_C(0x3c6ef372fe94f82b), From 45bb09c2a74bde942c00da2e086154559570db33 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 17 Feb 2007 17:38:33 +0000 Subject: [PATCH 5775/7878] Add some documentation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@508781 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 3ca87b326ef..4e3789d2b2e 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -168,8 +168,8 @@ struct in_addr { * connection. */ typedef enum { - APR_LOCAL, - APR_REMOTE + APR_LOCAL, /**< Socket information for local end of connection */ + APR_REMOTE /**< Socket information for remote end of connection */ } apr_interface_e; /** From f4c56929c926183c24bb38fcfa3c20a558bdd4d8 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Mon, 19 Feb 2007 00:31:01 +0000 Subject: [PATCH 5776/7878] Add the apr_pollcb API. This was mostly sitting in the pollcb-dev branch for several months at: This commit has small improvements over the branch, and also includes a KQueue backend. This will likely break trunk for operating systems were we only have select|poll, so we will need to add some autoconf foo to define a HAVE_APR_POLLCB unless someone can implement apr_pollcb for all platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@509038 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + include/apr_poll.h | 20 ++++++ poll/unix/epoll.c | 124 ++++++++++++++++++++++++++++++++++++ poll/unix/kqueue.c | 154 +++++++++++++++++++++++++++++++++++++++++++++ test/testpoll.c | 93 +++++++++++++++++++++++++++ 5 files changed, 394 insertions(+) diff --git a/CHANGES b/CHANGES index 6809eb45969..29da43fb3b3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Add the apr_pollcb API as an alternative more efficient method + of polling sockets, compared to apr_pollset. [Paul Querna] + *) Fix possible crash in apr_pool_initialize() when built with verbose pool debugging. PR 41063. [Peter Steiner ] diff --git a/include/apr_poll.h b/include/apr_poll.h index 328c1229fea..871b1370588 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -188,7 +188,27 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, /** @} */ +/** Opaque structure used for pollset API */ +typedef struct apr_pollcb_t apr_pollcb_t; + +APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, + apr_uint32_t size, + apr_pool_t *pool, + apr_uint32_t flags); + + +APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor); + +APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor); + +typedef apr_status_t(*apr_pollcb_cb_t)(void* baton, apr_pollfd_t *descriptor); +APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, + apr_interval_time_t timeout, + apr_pollcb_cb_t func, + void *baton); #ifdef __cplusplus } #endif diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index d1919a5eb8b..7a3831bee0b 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -296,4 +296,128 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return rv; } +struct apr_pollcb_t { + apr_pool_t *pool; + apr_uint32_t nalloc; + struct epoll_event *pollset; + int epoll_fd; +}; + +static apr_status_t cb_cleanup(void *p_) +{ + apr_pollcb_t *pollcb = (apr_pollcb_t *) p_; + close(pollcb->epoll_fd); + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) +{ + int fd; + + fd = epoll_create(size); + + if (fd < 0) { + *pollcb = NULL; + return apr_get_netos_error(); + } + + *pollcb = apr_palloc(p, sizeof(**pollcb)); + (*pollcb)->nalloc = size; + (*pollcb)->pool = p; + (*pollcb)->epoll_fd = fd; + (*pollcb)->pollset = apr_palloc(p, size * sizeof(struct epoll_event)); + apr_pool_cleanup_register(p, *pollcb, cb_cleanup, cb_cleanup); + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) +{ + struct epoll_event ev; + int ret; + + ev.events = get_epoll_event(descriptor->reqevents); + ev.data.ptr = (void *)descriptor; + + if (descriptor->desc_type == APR_POLL_SOCKET) { + ret = epoll_ctl(pollcb->epoll_fd, EPOLL_CTL_ADD, + descriptor->desc.s->socketdes, &ev); + } + else { + ret = epoll_ctl(pollcb->epoll_fd, EPOLL_CTL_ADD, + descriptor->desc.f->filedes, &ev); + } + + if (ret == -1) { + return apr_get_netos_error(); + } + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) +{ + apr_status_t rv = APR_SUCCESS; + struct epoll_event ev; + int ret = -1; + + ev.events = get_epoll_event(descriptor->reqevents); + + if (descriptor->desc_type == APR_POLL_SOCKET) { + ret = epoll_ctl(pollcb->epoll_fd, EPOLL_CTL_DEL, + descriptor->desc.s->socketdes, &ev); + } + else { + ret = epoll_ctl(pollcb->epoll_fd, EPOLL_CTL_DEL, + descriptor->desc.f->filedes, &ev); + } + + if (ret < 0) { + rv = APR_NOTFOUND; + } + + return rv; +} + + +APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, + apr_interval_time_t timeout, + apr_pollcb_cb_t func, + void *baton) +{ + int ret, i; + apr_status_t rv = APR_SUCCESS; + + if (timeout > 0) { + timeout /= 1000; + } + + ret = epoll_wait(pollcb->epoll_fd, pollcb->pollset, pollcb->nalloc, + timeout); + if (ret < 0) { + rv = apr_get_netos_error(); + } + else if (ret == 0) { + rv = APR_TIMEUP; + } + else { + for (i = 0; i < ret; i++) { + apr_pollfd_t *pollfd = (apr_pollfd_t *)(pollcb->pollset[i].data.ptr); + pollfd->rtnevents = get_epoll_revent(pollcb->pollset[i].events); + + rv = func(baton, pollfd); + if (rv) { + return rv; + } + } + } + + return rv; +} + #endif /* POLLSET_USES_EPOLL */ diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 7fa85af62ee..f1e121dd152 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -281,4 +281,158 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return rv; } + +struct apr_pollcb_t { + apr_pool_t *pool; + apr_uint32_t nalloc; + struct kevent *pollset; + int kqfd; +}; + +static apr_status_t cb_cleanup(void *b_) +{ + apr_pollcb_t *pollcb = (apr_pollcb_t *) b_; + close(pollcb->kqfd); + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) +{ + int fd; + + fd = kqueue(); + if (fd < 0) { + *pollcb = NULL; + return apr_get_netos_error(); + } + + *pollcb = apr_palloc(p, sizeof(**pollcb)); + (*pollcb)->nalloc = size; + (*pollcb)->pool = p; + (*pollcb)->kqfd = fd; + (*pollcb)->pollset = (struct kevent *)apr_pcalloc(p, size * sizeof(struct kevent)); + apr_pool_cleanup_register(p, *pollcb, cb_cleanup, cb_cleanup); + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) +{ + apr_os_sock_t fd; + struct kevent ev; + apr_status_t rv = APR_SUCCESS; + + if (descriptor->desc_type == APR_POLL_SOCKET) { + fd = descriptor->desc.s->socketdes; + } + else { + fd = descriptor->desc.f->filedes; + } + + if (descriptor->reqevents & APR_POLLIN) { + EV_SET(&ev, fd, EVFILT_READ, EV_ADD, 0, 0, descriptor); + + if (kevent(pollcb->kqfd, &ev, 1, NULL, 0, NULL) == -1) { + rv = apr_get_netos_error(); + } + } + + if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) { + EV_SET(&ev, fd, EVFILT_WRITE, EV_ADD, 0, 0, descriptor); + + if (kevent(pollcb->kqfd, &ev, 1, NULL, 0, NULL) == -1) { + rv = apr_get_netos_error(); + } + } + + return rv; +} + +APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) +{ + apr_status_t rv = APR_SUCCESS; + struct kevent ev; + apr_os_sock_t fd; + + if (descriptor->desc_type == APR_POLL_SOCKET) { + fd = descriptor->desc.s->socketdes; + } + else { + fd = descriptor->desc.f->filedes; + } + + if (descriptor->reqevents & APR_POLLIN) { + EV_SET(&ev, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); + + if (kevent(pollcb->kqfd, &ev, 1, NULL, 0, NULL) == -1) { + rv = APR_NOTFOUND; + } + } + + if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) { + /* XXXX: this is less than optimal, shouldn't we still try to + * remove the FD even if it wasn't in the readset? + */ + EV_SET(&ev, fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); + + if (kevent(pollcb->kqfd, &ev, 1, NULL, 0, NULL) == -1) { + rv = APR_NOTFOUND; + } + } + + return rv; +} + + +APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, + apr_interval_time_t timeout, + apr_pollcb_cb_t func, + void *baton) +{ + int ret, i; + struct timespec tv, *tvptr; + apr_status_t rv = APR_SUCCESS; + + if (timeout < 0) { + tvptr = NULL; + } + else { + tv.tv_sec = (long) apr_time_sec(timeout); + tv.tv_nsec = (long) apr_time_usec(timeout) * 1000; + tvptr = &tv; + } + + ret = kevent(pollcb->kqfd, NULL, 0, pollcb->pollset, pollcb->nalloc, + tvptr); + + if (ret < 0) { + rv = apr_get_netos_error(); + } + else if (ret == 0) { + rv = APR_TIMEUP; + } + else { + for (i = 0; i < ret; i++) { + apr_pollfd_t *pollfd = (apr_pollfd_t *)(pollcb->pollset[i].udata); + + pollfd->rtnevents = get_kqueue_revent(pollcb->pollset[i].filter, + pollcb->pollset[i].flags); + + rv = func(baton, pollfd); + + if (rv) { + return rv; + } + } + } + + return rv; +} + #endif /* POLLSET_USES_KQUEUE */ diff --git a/test/testpoll.c b/test/testpoll.c index 36dd8a06bff..0073317b646 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -32,6 +32,7 @@ static apr_socket_t *s[LARGE_NUM_SOCKETS]; static apr_sockaddr_t *sa[LARGE_NUM_SOCKETS]; static apr_pollset_t *pollset; +static apr_pollcb_t *pollcb; /* ###: tests surrounded by ifdef OLD_POLL_INTERFACE either need to be * converted to use the pollset interface or removed. */ @@ -552,6 +553,91 @@ static void pollset_remove(abts_case *tc, void *data) (hot_files[1].client_data == (void *)1))); } +static void setup_pollcb(abts_case *tc, void *data) +{ + apr_status_t rv; + rv = apr_pollcb_create(&pollcb, LARGE_NUM_SOCKETS, p, 0); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); +} + +typedef struct pollcb_baton_t { + abts_case *tc; + int count; +} pollcb_baton_t; + +static apr_status_t trigger_pollcb_cb(void* baton, apr_pollfd_t *descriptor) +{ + pollcb_baton_t* pcb = (pollcb_baton_t*) baton; + ABTS_PTR_EQUAL(pcb->tc, s[0], descriptor->desc.s); + ABTS_PTR_EQUAL(pcb->tc, s[0], descriptor->client_data); + pcb->count++; + return APR_SUCCESS; +} + +static void trigger_pollcb(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_pollfd_t socket_pollfd; + pollcb_baton_t pcb; + + ABTS_PTR_NOTNULL(tc, s[0]); + socket_pollfd.desc_type = APR_POLL_SOCKET; + socket_pollfd.reqevents = APR_POLLIN; + socket_pollfd.desc.s = s[0]; + socket_pollfd.client_data = s[0]; + rv = apr_pollcb_add(pollcb, &socket_pollfd); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + send_msg(s, sa, 0, tc); + pcb.tc = tc; + pcb.count = 0; + rv = apr_pollcb_poll(pollcb, 0, trigger_pollcb_cb, &pcb); + ABTS_INT_EQUAL(tc, 0, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 1, pcb.count); + + rv = apr_pollcb_remove(pollcb, &socket_pollfd); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); +} + +static void timeout_pollcb(abts_case *tc, void *data) +{ + apr_status_t rv; + pollcb_baton_t pcb; + pcb.count = 0; + pcb.tc = tc; + + rv = apr_pollcb_poll(pollcb, 1, trigger_pollcb_cb, &pcb); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 0, pcb.count); +} + +static void timeout_pollin_pollcb(abts_case *tc, void *data) +{ + apr_status_t rv; + pollcb_baton_t pcb; + apr_pollfd_t socket_pollfd; + + recv_msg(s, 0, p, tc); + + ABTS_PTR_NOTNULL(tc, s[0]); + socket_pollfd.desc_type = APR_POLL_SOCKET; + socket_pollfd.reqevents = APR_POLLIN; + socket_pollfd.desc.s = s[0]; + socket_pollfd.client_data = s[0]; + rv = apr_pollcb_add(pollcb, &socket_pollfd); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + pcb.count = 0; + pcb.tc = tc; + + rv = apr_pollcb_poll(pollcb, 1, trigger_pollcb_cb, &pcb); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 0, pcb.count); + + rv = apr_pollcb_remove(pollcb, &socket_pollfd); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); +} + abts_suite *testpoll(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -586,6 +672,13 @@ abts_suite *testpoll(abts_suite *suite) abts_run_test(suite, close_all_sockets, NULL); + abts_run_test(suite, create_all_sockets, NULL); + abts_run_test(suite, setup_pollcb, NULL); + abts_run_test(suite, trigger_pollcb, NULL); + abts_run_test(suite, timeout_pollcb, NULL); + abts_run_test(suite, timeout_pollin_pollcb, NULL); + abts_run_test(suite, close_all_sockets, NULL); + return suite; } From e3c7d6ba986b88d53fb75acecc414ebe7196a163 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Mon, 19 Feb 2007 00:42:26 +0000 Subject: [PATCH 5777/7878] Improve returned errors from kevent/kqueue by using apr_get_netos_error() rather than just returning a hard coded error. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@509039 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/kqueue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index f1e121dd152..501953dc43b 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -98,7 +98,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, (*pollset)->kqueue_fd = kqueue(); if ((*pollset)->kqueue_fd == -1) { - return APR_ENOMEM; + return apr_get_netos_error(); } apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup, @@ -149,7 +149,7 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0, NULL) == -1) { - rv = APR_ENOMEM; + rv = apr_get_netos_error(); } } @@ -158,7 +158,7 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0, NULL) == -1) { - rv = APR_ENOMEM; + rv = apr_get_netos_error(); } } From 90ca84572dbcea69ad85df1a4bfd7d41c5e8bfef Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 20 Feb 2007 16:46:09 +0000 Subject: [PATCH 5778/7878] Stub out the apr_pollcb API for poll & select, always returning APR_ENOTIMPL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@509637 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 29 +++++++++++++++++++++++++++++ poll/unix/select.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 34aba394dd4..cca8bfe8a4e 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -270,4 +270,33 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) +{ + return APR_ENOTIMPL; +} + + +APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, + apr_interval_time_t timeout, + apr_pollcb_cb_t func, + void *baton) +{ + return APR_ENOTIMPL; +} + #endif /* POLLSET_USES_POLL */ diff --git a/poll/unix/select.c b/poll/unix/select.c index ca35b77db9c..42e7a3f68ec 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -406,4 +406,33 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) +{ + return APR_ENOTIMPL; +} + + +APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, + apr_interval_time_t timeout, + apr_pollcb_cb_t func, + void *baton) +{ + return APR_ENOTIMPL; +} + #endif /* POLLSET_USES_SELECT */ From a1d4e8a2cdf6f8057d663cf845061527872fef2a Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 20 Feb 2007 17:00:19 +0000 Subject: [PATCH 5779/7878] Add doxygen comments and docs for the apr_pollcb API. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@509647 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index 871b1370588..9f901bbf6e3 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -186,29 +186,67 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, apr_int32_t *nsds, apr_interval_time_t timeout); -/** @} */ - /** Opaque structure used for pollset API */ typedef struct apr_pollcb_t apr_pollcb_t; +/** + * Setup a pollcb object + * @param pollcb The pointer in which to return the newly created object + * @param size The maximum number of descriptors that a single _poll can return. + * @param p The pool from which to allocate the pollcb + * @param flags Optional flags to modify the operation of the pollcb. + * + * @remark Pollcb is only supported on some platforms; the apr_pollcb_create() + * call will fail with APR_ENOTIMPL on platforms where it is not supported. + */ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, apr_uint32_t size, apr_pool_t *pool, apr_uint32_t flags); - +/** + * Add a socket or file descriptor to a pollcb + * @param pollcb The pollcb to which to add the descriptor + * @param descriptor The descriptor to add + * @remark If you set client_data in the descriptor, that value + * will be returned in the client_data field whenever this + * descriptor is signalled in apr_pollcb_poll(). + * @remark Unlike the apr_pollset API, the descriptor is not copied, and users + * must retain the memory used by descriptor, as the same pointer will be + * returned to them from apr_pollcb_poll. + */ APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor); - +/** + * Remove a descriptor from a pollcb + * @param pollcb The pollcb from which to remove the descriptor + * @param descriptor The descriptor to remove + */ APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor); +/** Function prototype for pollcb handlers + * @param baton Opaque baotn passed into apr_pollcb_poll + * @param descriptor Contains the notification for an active descriptor, + * the rtnevents member contains what events were triggered + * for this descriptor. + */ typedef apr_status_t(*apr_pollcb_cb_t)(void* baton, apr_pollfd_t *descriptor); +/** + * Block for activity on the descriptor(s) in a pollcb + * @param pollcb The pollcb to use + * @param timeout Timeout in microseconds + * @param func Callback function to call for each active socket + * @param baton Opaque baton passed to the callback function. + */ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, apr_interval_time_t timeout, apr_pollcb_cb_t func, void *baton); + +/** @} */ + #ifdef __cplusplus } #endif From 5906dfade934a0e8674c3a92024292edc17ed7f0 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 21 Feb 2007 13:35:43 +0000 Subject: [PATCH 5780/7878] * test/testpoll.c (setup_pollcb, trigger_pollcb, timeout_pollcb, timeout_pollin_pollcb): Skip tests if pollcb interface is ENOTIMPL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@510006 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/testpoll.c b/test/testpoll.c index 0073317b646..b0875a2fd5f 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -553,11 +553,20 @@ static void pollset_remove(abts_case *tc, void *data) (hot_files[1].client_data == (void *)1))); } +#define POLLCB_PREREQ do { if (pollcb == NULL) \ +ABTS_NOT_IMPL(tc, "pollcb interface not supported"); return; } while (0) + static void setup_pollcb(abts_case *tc, void *data) { apr_status_t rv; rv = apr_pollcb_create(&pollcb, LARGE_NUM_SOCKETS, p, 0); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + if (rv == APR_ENOTIMPL) { + pollcb = NULL; + ABTS_NOT_IMPL(tc, "pollcb interface not supported"); + } + else { + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + } } typedef struct pollcb_baton_t { @@ -580,6 +589,8 @@ static void trigger_pollcb(abts_case *tc, void *data) apr_pollfd_t socket_pollfd; pollcb_baton_t pcb; + POLLCB_PREREQ; + ABTS_PTR_NOTNULL(tc, s[0]); socket_pollfd.desc_type = APR_POLL_SOCKET; socket_pollfd.reqevents = APR_POLLIN; @@ -603,6 +614,9 @@ static void timeout_pollcb(abts_case *tc, void *data) { apr_status_t rv; pollcb_baton_t pcb; + + POLLCB_PREREQ; + pcb.count = 0; pcb.tc = tc; @@ -617,6 +631,8 @@ static void timeout_pollin_pollcb(abts_case *tc, void *data) pollcb_baton_t pcb; apr_pollfd_t socket_pollfd; + POLLCB_PREREQ; + recv_msg(s, 0, p, tc); ABTS_PTR_NOTNULL(tc, s[0]); From 0daa8f9bfff22897133b3e7a1f3eec67ff3674ef Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 21 Feb 2007 13:37:05 +0000 Subject: [PATCH 5781/7878] * include/apr_poll.h: Style and spelling tweak. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@510007 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index 9f901bbf6e3..4e299ee5774 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -226,12 +226,12 @@ APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor); /** Function prototype for pollcb handlers - * @param baton Opaque baotn passed into apr_pollcb_poll + * @param baton Opaque baton passed into apr_pollcb_poll * @param descriptor Contains the notification for an active descriptor, * the rtnevents member contains what events were triggered * for this descriptor. */ -typedef apr_status_t(*apr_pollcb_cb_t)(void* baton, apr_pollfd_t *descriptor); +typedef apr_status_t (*apr_pollcb_cb_t)(void *baton, apr_pollfd_t *descriptor); /** * Block for activity on the descriptor(s) in a pollcb From 6abc4492b6c80c05adc2a183df1e3e0e186e7711 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 22 Feb 2007 15:15:04 +0000 Subject: [PATCH 5782/7878] * test/testpoll.c: Fix to only return in ENOTIMPL case. Submitted by: Ryan Phillips git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@510542 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/testpoll.c b/test/testpoll.c index b0875a2fd5f..a3030327ee5 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -553,8 +553,13 @@ static void pollset_remove(abts_case *tc, void *data) (hot_files[1].client_data == (void *)1))); } -#define POLLCB_PREREQ do { if (pollcb == NULL) \ -ABTS_NOT_IMPL(tc, "pollcb interface not supported"); return; } while (0) +#define POLLCB_PREREQ \ + do { \ + if (pollcb == NULL) { \ + ABTS_NOT_IMPL(tc, "pollcb interface not supported"); \ + return; \ + } \ + } while (0) static void setup_pollcb(abts_case *tc, void *data) { From 997ad38d71a612131ef95eaddd0d8b4bbbc34562 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 28 Feb 2007 12:44:52 +0000 Subject: [PATCH 5783/7878] * build/gen-build.py (main): Use OBJECTS_mod variable on the link line, rather than substituting its expansion. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@512734 13f79535-47bb-0310-9956-ffa450edef68 --- build/gen-build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/gen-build.py b/build/gen-build.py index 30f19182c8a..d59bf1d4369 100755 --- a/build/gen-build.py +++ b/build/gen-build.py @@ -136,7 +136,7 @@ def main(): target = parser.get(mod, 'target') f.write('MODULE_%s = %s\n' % (mod, target)) f.write('%s: %s\n' % (target, flat_objects)) - f.write('\t$(LINK_MODULE) -o $@ %s $(LDADD_%s)\n' % (flat_objects, mod)) + f.write('\t$(LINK_MODULE) -o $@ $(OBJECTS_%s) $(LDADD_%s)\n' % (mod, mod)) f.write('\n') From 5ea1a1e869d4f4e0500cda6bbad4b4b65a687f76 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Wed, 28 Feb 2007 18:05:37 +0000 Subject: [PATCH 5784/7878] Fix apr_file_writev when buffering is enabled by forcing a flush, rather than writing underneath the write buffer. PR: 41197 Submitted By: Davi Arnaut git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@512882 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 6 ++++++ file_io/unix/readwrite.c | 6 ++++++ test/testfile.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 2eb011e82ce..354641abbf9 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -197,6 +197,12 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { + apr_status_t rv = apr_file_flush(thefile); + + if (rv != APR_SUCCESS) { + return rv; + } + int bytes; if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { *nbytes = 0; diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 320735d68d6..56d9bfff61a 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -239,6 +239,12 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { + apr_status_t rv = apr_file_flush(thefile); + + if (rv != APR_SUCCESS) { + return rv; + } + #ifdef HAVE_WRITEV apr_ssize_t bytes; diff --git a/test/testfile.c b/test/testfile.c index 0244aa11a2d..a5bba865f35 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -661,6 +661,37 @@ static void test_writev_full(abts_case *tc, void *data) } +static void test_writev_buffered(abts_case *tc, void *data) +{ + apr_file_t *f; + apr_size_t nbytes; + struct iovec vec[2]; + const char *fname = "data/testwritev_buffered.txt"; + + APR_ASSERT_SUCCESS(tc, "open file for writing", + apr_file_open(&f, fname, + APR_WRITE | APR_CREATE | APR_TRUNCATE | + APR_BUFFERED, APR_OS_DEFAULT, p)); + + nbytes = strlen(TESTSTR); + APR_ASSERT_SUCCESS(tc, "buffered write", + apr_file_write(f, TESTSTR, &nbytes)); + + vec[0].iov_base = LINE1; + vec[0].iov_len = strlen(LINE1); + vec[1].iov_base = LINE2; + vec[1].iov_len = strlen(LINE2); + + APR_ASSERT_SUCCESS(tc, "writev of size 2 to file", + apr_file_writev(f, vec, 2, &nbytes)); + + APR_ASSERT_SUCCESS(tc, "close for writing", + apr_file_close(f)); + + file_contents_equal(tc, fname, TESTSTR LINE1 LINE2, + strlen(TESTSTR) + strlen(LINE1) + strlen(LINE2)); +} + static void test_truncate(abts_case *tc, void *data) { apr_status_t rv; @@ -885,6 +916,7 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_puts, NULL); abts_run_test(suite, test_writev, NULL); abts_run_test(suite, test_writev_full, NULL); + abts_run_test(suite, test_writev_buffered, NULL); abts_run_test(suite, test_bigread, NULL); abts_run_test(suite, test_mod_neg, NULL); abts_run_test(suite, test_truncate, NULL); From 614adb402a2160d83eb0e8f81d4c8988f2c3c16b Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Thu, 1 Mar 2007 07:13:54 +0000 Subject: [PATCH 5785/7878] Only try to flush when the file is in buffered mode, inside apr_file_writev. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@513205 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 10 ++++++---- file_io/unix/readwrite.c | 13 ++++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 354641abbf9..d680dcc1cd1 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -197,13 +197,15 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { - apr_status_t rv = apr_file_flush(thefile); + int bytes; - if (rv != APR_SUCCESS) { - return rv; + if (thefile->buffered) { + apr_status_t rv = apr_file_flush(thefile); + if (rv != APR_SUCCESS) { + return rv; + } } - int bytes; if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { *nbytes = 0; return errno; diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 56d9bfff61a..7ba0e0e4576 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -239,15 +239,18 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { - apr_status_t rv = apr_file_flush(thefile); +#ifdef HAVE_WRITEV + apr_ssize_t bytes; +#endif - if (rv != APR_SUCCESS) { - return rv; + if (thefile->buffered) { + apr_status_t rv = apr_file_flush(thefile); + if (rv != APR_SUCCESS) { + return rv; + } } #ifdef HAVE_WRITEV - apr_ssize_t bytes; - if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { *nbytes = 0; return errno; From ea851ad67e0639609fb731bf410a0807bf7cb873 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 1 Mar 2007 10:30:24 +0000 Subject: [PATCH 5786/7878] * test/testlock.c: Revert 502048, accidentally snuck in with Netware BASEDIR changes? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@513263 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testlock.c b/test/testlock.c index 7ff38dbd846..dddb52f76a9 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -322,10 +322,10 @@ abts_suite *testlock(abts_suite *suite) #if !APR_HAS_THREADS abts_run_test(suite, threads_not_impl, NULL); #else -// abts_run_test(suite, test_thread_mutex, NULL); -// abts_run_test(suite, test_thread_rwlock, NULL); -// abts_run_test(suite, test_cond, NULL); -// abts_run_test(suite, test_timeoutcond, NULL); + abts_run_test(suite, test_thread_mutex, NULL); + abts_run_test(suite, test_thread_rwlock, NULL); + abts_run_test(suite, test_cond, NULL); + abts_run_test(suite, test_timeoutcond, NULL); #endif return suite; From 681ec140ba448e6a95e061bd0ea8116dfc87e9fd Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 1 Mar 2007 10:34:00 +0000 Subject: [PATCH 5787/7878] * test/testfile.c (test_writev_buffered): Adjust to avoid breaking the silly testfnmatch tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@513265 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testfile.c b/test/testfile.c index a5bba865f35..eb973a662da 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -666,7 +666,7 @@ static void test_writev_buffered(abts_case *tc, void *data) apr_file_t *f; apr_size_t nbytes; struct iovec vec[2]; - const char *fname = "data/testwritev_buffered.txt"; + const char *fname = "data/testwritev_buffered.dat"; APR_ASSERT_SUCCESS(tc, "open file for writing", apr_file_open(&f, fname, From ee21c1f06a504fda67377085b98e2022dc137df9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 9 Mar 2007 17:09:02 +0000 Subject: [PATCH 5788/7878] fix build failure on platforms without setenv() Submitted by: Stefan Ruppert Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@516466 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/env.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/unix/env.c b/misc/unix/env.c index 526115fda6a..b41f8f17b52 100644 --- a/misc/unix/env.c +++ b/misc/unix/env.c @@ -19,6 +19,7 @@ #include "apr.h" #include "apr_private.h" #include "apr_env.h" +#include "apr_strings.h" #if APR_HAVE_UNISTD_H #include @@ -57,7 +58,7 @@ APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, #elif defined(HAVE_PUTENV) - if (0 > putenv(apr_pstrcat(pool, envvar, "=", value, NULL)) + if (0 > putenv(apr_pstrcat(pool, envvar, "=", value, NULL))) return APR_ENOMEM; return APR_SUCCESS; From 8f74a6325771be7b8e1a2108f116c6425c1ce4f4 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Sat, 31 Mar 2007 02:21:58 +0000 Subject: [PATCH 5789/7878] Fix locking bug with apr_file_read()/apr_file_gets() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@524355 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + file_io/unix/readwrite.c | 113 ++++++++++++++++++++------------------- 2 files changed, 60 insertions(+), 55 deletions(-) diff --git a/CHANGES b/CHANGES index 29da43fb3b3..c7ceb03bd0b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes for APR 1.3.0 + *) Fix locking bug with apr_file_read()/apr_file_gets() [Bojan Smojver] + *) Add the apr_pollcb API as an alternative more efficient method of polling sockets, compared to apr_pollset. [Paul Querna] diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 7ba0e0e4576..5099bc9b20d 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -25,6 +25,62 @@ #define USE_WAIT_FOR_IO #endif +static apr_status_t apr_file_read_buffered(apr_file_t *thefile, void *buf, apr_size_t *nbytes) +{ + apr_ssize_t rv; + char *pos = (char *)buf; + apr_uint64_t blocksize; + apr_uint64_t size = *nbytes; + + if (thefile->direction == 1) { + rv = apr_file_flush(thefile); + if (rv) { + return rv; + } + thefile->bufpos = 0; + thefile->direction = 0; + thefile->dataRead = 0; + } + + rv = 0; + if (thefile->ungetchar != -1) { + *pos = (char)thefile->ungetchar; + ++pos; + --size; + thefile->ungetchar = -1; + } + while (rv == 0 && size > 0) { + if (thefile->bufpos >= thefile->dataRead) { + int bytesread = read(thefile->filedes, thefile->buffer, + thefile->bufsize); + if (bytesread == 0) { + thefile->eof_hit = TRUE; + rv = APR_EOF; + break; + } + else if (bytesread == -1) { + rv = errno; + break; + } + thefile->dataRead = bytesread; + thefile->filePtr += thefile->dataRead; + thefile->bufpos = 0; + } + + blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size; + memcpy(pos, thefile->buffer + thefile->bufpos, blocksize); + thefile->bufpos += blocksize; + pos += blocksize; + size -= blocksize; + } + + *nbytes = pos - (char *)buf; + if (*nbytes) { + rv = 0; + } + return rv; +} + APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) { apr_ssize_t rv; @@ -36,67 +92,14 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } if (thefile->buffered) { - char *pos = (char *)buf; - apr_uint64_t blocksize; - apr_uint64_t size = *nbytes; - #if APR_HAS_THREADS if (thefile->thlock) { apr_thread_mutex_lock(thefile->thlock); } #endif - if (thefile->direction == 1) { - rv = apr_file_flush(thefile); - if (rv) { -#if APR_HAS_THREADS - if (thefile->thlock) { - apr_thread_mutex_unlock(thefile->thlock); - } -#endif - return rv; - } - thefile->bufpos = 0; - thefile->direction = 0; - thefile->dataRead = 0; - } + rv = apr_file_read_buffered(thefile, buf, nbytes); - rv = 0; - if (thefile->ungetchar != -1) { - *pos = (char)thefile->ungetchar; - ++pos; - --size; - thefile->ungetchar = -1; - } - while (rv == 0 && size > 0) { - if (thefile->bufpos >= thefile->dataRead) { - int bytesread = read(thefile->filedes, thefile->buffer, - thefile->bufsize); - if (bytesread == 0) { - thefile->eof_hit = TRUE; - rv = APR_EOF; - break; - } - else if (bytesread == -1) { - rv = errno; - break; - } - thefile->dataRead = bytesread; - thefile->filePtr += thefile->dataRead; - thefile->bufpos = 0; - } - - blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size; - memcpy(pos, thefile->buffer + thefile->bufpos, blocksize); - thefile->bufpos += blocksize; - pos += blocksize; - size -= blocksize; - } - - *nbytes = pos - (char *)buf; - if (*nbytes) { - rv = 0; - } #if APR_HAS_THREADS if (thefile->thlock) { apr_thread_mutex_unlock(thefile->thlock); @@ -374,7 +377,7 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) } else { nbytes = 1; - rv = apr_file_read(thefile, str, &nbytes); + rv = apr_file_read_buffered(thefile, str, &nbytes); if (rv != APR_SUCCESS) { break; } From d6965bba5eb789d57cfcd56370ff881dfc529723 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 2 Apr 2007 16:00:14 +0000 Subject: [PATCH 5790/7878] * test/testfile.c (test_gets_buffered): Regression test for apr_file_gets() deadlock. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@524821 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/testfile.c b/test/testfile.c index eb973a662da..df63d081fb4 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -415,6 +415,29 @@ static void test_gets(abts_case *tc, void *data) apr_file_close(f); } +static void test_gets_buffered(abts_case *tc, void *data) +{ + apr_file_t *f = NULL; + apr_status_t rv; + char *str = apr_palloc(p, 256); + + /* This will deadlock gets before the r524355 fix. */ + rv = apr_file_open(&f, FILENAME, APR_READ|APR_BUFFERED|APR_XTHREAD, 0, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_file_gets(str, 256, f); + /* Only one line in the test file, so APR will encounter EOF on the first + * call to gets, but we should get APR_SUCCESS on this call and + * APR_EOF on the next. + */ + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_STR_EQUAL(tc, TESTSTR, str); + rv = apr_file_gets(str, 256, f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", str); + apr_file_close(f); +} + static void test_bigread(abts_case *tc, void *data) { apr_file_t *f = NULL; @@ -913,6 +936,7 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_getc, NULL); abts_run_test(suite, test_ungetc, NULL); abts_run_test(suite, test_gets, NULL); + abts_run_test(suite, test_gets_buffered, NULL); abts_run_test(suite, test_puts, NULL); abts_run_test(suite, test_writev, NULL); abts_run_test(suite, test_writev_full, NULL); From 7a99fccf55f1671e00309ed516f7a3e943b761d1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 2 Apr 2007 16:02:17 +0000 Subject: [PATCH 5791/7878] * file_io/unix/readwrite.c: Minor style fixes, no functional change: non-public functions shouldn't have the apr_ prefix; wrap a long line. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@524822 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 5099bc9b20d..3511846d9f5 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -25,7 +25,8 @@ #define USE_WAIT_FOR_IO #endif -static apr_status_t apr_file_read_buffered(apr_file_t *thefile, void *buf, apr_size_t *nbytes) +static apr_status_t file_read_buffered(apr_file_t *thefile, void *buf, + apr_size_t *nbytes) { apr_ssize_t rv; char *pos = (char *)buf; @@ -98,7 +99,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } #endif - rv = apr_file_read_buffered(thefile, buf, nbytes); + rv = file_read_buffered(thefile, buf, nbytes); #if APR_HAS_THREADS if (thefile->thlock) { @@ -377,7 +378,7 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) } else { nbytes = 1; - rv = apr_file_read_buffered(thefile, str, &nbytes); + rv = file_read_buffered(thefile, str, &nbytes); if (rv != APR_SUCCESS) { break; } From c52d31953ae300853815d5c9b13839037fa7fcea Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 2 Apr 2007 16:04:10 +0000 Subject: [PATCH 5792/7878] Clarify impact of the apr_file_gets deadlock. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@524823 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c7ceb03bd0b..c0c145906b2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ Changes for APR 1.3.0 - *) Fix locking bug with apr_file_read()/apr_file_gets() [Bojan Smojver] + *) Fix deadlock in apr_file_gets() for a file opened with both the + APR_BUFFERED and APR_XTHREAD flags. [Bojan Smojver] *) Add the apr_pollcb API as an alternative more efficient method of polling sockets, compared to apr_pollset. [Paul Querna] From c648012933fa78b1bc95f193068054dafeb496ed Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 6 Apr 2007 13:40:45 +0000 Subject: [PATCH 5793/7878] moved INSTDIRS to NWGNUtail.inc; fixed copyright string. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@526160 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 3 --- build/NWGNUtail.inc | 17 +++++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index c616fdd177a..b806d116dce 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -360,9 +360,6 @@ ifndef DEST $(CMD) xc.bat $(DEL) xc.bat endif - -$(INSTDIRS) :: - $(CHKNOT) $@\NUL mkdir $@ ifndef DEST installdev :: $(INSTDEVDIRS) FORCE diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 641c091b248..a12ebc38a18 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -25,12 +25,13 @@ NLM_SCREEN_NAME = DEFAULT endif ifndef NLM_COPYRIGHT -NLM_COPYRIGHT = Licensed to the Apache Software Foundation (ASF) under one or more -NLM_COPYRIGHT = contributor license agreements. See the NOTICE file distributed with -NLM_COPYRIGHT = this work for additional information regarding copyright ownership. -NLM_COPYRIGHT = The ASF licenses this file to You under the Apache License, Version 2.0 -NLM_COPYRIGHT = (the "License"); you may not use this file except in compliance with -NLM_COPYRIGHT = the License. You may obtain a copy of the License at +NLM_COPYRIGHT = Licensed to the Apache Software Foundation (ASF) under one or more +NLM_COPYRIGHT += contributor license agreements. See the NOTICE file distributed with +NLM_COPYRIGHT += this work for additional information regarding copyright ownership. +NLM_COPYRIGHT += The ASF licenses this file to You under the Apache License, Version 2.0 +NLM_COPYRIGHT += (the "License"); you may not use this file except in compliance with +NLM_COPYRIGHT += the License. You may obtain a copy of the License at +NLM_COPYRIGHT += http://www.apache.org/licenses/LICENSE-2.0 endif # @@ -325,3 +326,7 @@ endif # NO_LICENSE_FILE endif # multiple targets +$(INSTDIRS) :: + $(CHKNOT) $@\NUL mkdir $@ + + From 2ea1ea6a89122d5505a0a24f13be0d9589e55cce Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 6 Apr 2007 19:26:55 +0000 Subject: [PATCH 5794/7878] shortened copyright string because linker claims about overlength. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@526257 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index a12ebc38a18..033b46a84b4 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -25,13 +25,7 @@ NLM_SCREEN_NAME = DEFAULT endif ifndef NLM_COPYRIGHT -NLM_COPYRIGHT = Licensed to the Apache Software Foundation (ASF) under one or more -NLM_COPYRIGHT += contributor license agreements. See the NOTICE file distributed with -NLM_COPYRIGHT += this work for additional information regarding copyright ownership. -NLM_COPYRIGHT += The ASF licenses this file to You under the Apache License, Version 2.0 -NLM_COPYRIGHT += (the "License"); you may not use this file except in compliance with -NLM_COPYRIGHT += the License. You may obtain a copy of the License at -NLM_COPYRIGHT += http://www.apache.org/licenses/LICENSE-2.0 +NLM_COPYRIGHT = Copyright 2007 The ASF. Licensed under the Apache License Version 2.0. endif # From c09169ec764010eb5778951b77162d34f54d85c3 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 6 Apr 2007 19:29:40 +0000 Subject: [PATCH 5795/7878] added generated apu_want.h to clean target. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@526260 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUmakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index c2c06723f42..abfbda7723f 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -86,6 +86,7 @@ clean :: $(CHK) NWGNUversion.inc $(DEL) NWGNUversion.inc $(CHK) $(subst /,\,$(APR))\include\apr.h $(DEL) $(subst /,\,$(APR))\include\apr.h $(CHK) $(subst /,\,$(APRUTIL))\include\apu.h $(DEL) $(subst /,\,$(APRUTIL))\include\apu.h + $(CHK) $(subst /,\,$(APRUTIL))\include\apu_want.h $(DEL) $(subst /,\,$(APRUTIL))\include\apu_want.h $(CHK) $(subst /,\,$(APRUTIL))\include\apr_ldap.h $(DEL) $(subst /,\,$(APRUTIL))\include\apr_ldap.h $(CHK) $(subst /,\,$(APRUTIL))\include\private\apu_config.h $(DEL) $(subst /,\,$(APRUTIL))\include\private\apu_config.h $(CHK) $(subst /,\,$(APRUTIL))\include\private\apu_select_dbm.h $(DEL) $(subst /,\,$(APRUTIL))\include\private\apu_select_dbm.h From 01bd64ce242038155b18a4065d0a5033db50d150 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sat, 7 Apr 2007 00:42:43 +0000 Subject: [PATCH 5796/7878] another fix to the linker copyright string. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@526333 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 033b46a84b4..d253589eba2 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -25,7 +25,7 @@ NLM_SCREEN_NAME = DEFAULT endif ifndef NLM_COPYRIGHT -NLM_COPYRIGHT = Copyright 2007 The ASF. Licensed under the Apache License Version 2.0. +NLM_COPYRIGHT = Licensed under the Apache License Version 2.0 endif # From 8cdf455a736d4a0e11c5b498831daaec33b2aa5d Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 8 Apr 2007 23:12:01 +0000 Subject: [PATCH 5797/7878] added socket build type to the description string. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@526611 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 50 +++++++++++++++++++------------------- build/NWGNUenvironment.inc | 20 +++++++++------ 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index b806d116dce..c4a0dcf7eb0 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -5,7 +5,7 @@ SUBDIRS = \ build \ $(APU_WORK) \ - $(EOLIST) + $(EOLIST) # # Get the 'head' of the build environment. This includes default targets and @@ -103,29 +103,29 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = aprlib +NLM_NAME = aprlib # -# This is used by the link '-desc ' directive. +# This is used by the link '-desc ' directive. # If left blank, NLM_NAME will be used. # -NLM_DESCRIPTION = Apache Portability Runtime Library $(VERSION_STR) +NLM_DESCRIPTION = Apache Portability Runtime Library $(VERSION_STR) $(VERSION_SKT) # # This is used by the '-threadname' directive. If left blank, # NLM_NAME Thread will be used. # -NLM_THREAD_NAME = +NLM_THREAD_NAME = # -# If this is specified, it will override VERSION value in +# If this is specified, it will override VERSION value in # $(APR_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = +NLM_VERSION = # # If this is specified, it will override the default of 64K # -NLM_STACK_SIZE = +NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive @@ -145,14 +145,14 @@ NLM_CHECK_SYM = # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION - +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + # -# If this is specified it will be linked in with the XDCData option in the def -# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can # be disabled by setting APACHE_UNIPROC in the environment # -XDCDATA = +XDCDATA = # # Declare all target files (you must add your files here) @@ -203,7 +203,7 @@ FILES_nlm_modules = \ # Include the Winsock libraries if Winsock is being used ifndef USE_STDSOCKETS FILES_nlm_modules += ws2_32 \ - $(EOLIST) + $(EOLIST) endif #If the LDAP support is defined then add the auto-load modules @@ -218,7 +218,7 @@ endif # If the nlm has a msg file, put it's path here # FILE_nlm_msg = - + # # If the nlm has a hlp file put it's path here # @@ -236,7 +236,7 @@ FILES_nlm_Ximports = \ @libc.imp \ @netware.imp \ $(EOLIST) - + # Include the Winsock imports if Winsock is being used ifndef USE_STDSOCKETS FILES_nlm_Ximports += \ @@ -253,15 +253,15 @@ FILES_nlm_Ximports += \ @$(LDAPSDK)/imports/lldapssl.imp \ $(EOLIST) endif - -# + +# # Any symbols exported to here # FILES_nlm_exports = \ - @aprlib.imp \ + @aprlib.imp \ $(EOLIST) - -# + +# # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character # @@ -344,7 +344,7 @@ libs :: $(OBJDIR) $(TARGET_lib) nlms :: libs $(TARGET_nlm) # -# Updated this target to create necessary directories and copy files to the +# Updated this target to create necessary directories and copy files to the # correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples) # install :: nlms $(INSTDIRS) FORCE @@ -359,7 +359,7 @@ ifndef DEST @echo xcopy docs $(INSTALLBASE)\docs\*.* $(XCOPYSW) >> xc.bat $(CMD) xc.bat $(DEL) xc.bat -endif +endif ifndef DEST installdev :: $(INSTDEVDIRS) FORCE @@ -367,10 +367,10 @@ installdev :: $(INSTDEVDIRS) FORCE -copy $(subst /,\,$(APRUTIL))\include\*.h $(INSTALLBASE)\include\*.* -copy $(subst /,\,$(APR))\*.imp $(INSTALLBASE)\lib\*.* -copy $(subst /,\,$(APR))\misc\netware\*.xdc $(INSTALLBASE)\lib\*.* - + $(INSTDEVDIRS) :: $(CHKNOT) $@\NUL mkdir $@ -endif +endif # # Any specialized rules here diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 7f6b318f995..8075309e269 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -106,10 +106,10 @@ endif # # MetroWerks NLM tools -CC = mwccnlm -CPP = mwccnlm +CC = mwccnlm +CPP = mwccnlm LINK = mwldnlm -LIB = mwldnlm -type library -w nocmdline +LIB = mwldnlm -type library -w nocmdline ifdef IPV6 ifndef USE_STDSOCKETS @@ -119,14 +119,20 @@ endif NOVI = $(NOVELLLIBC)\imports -INCDIRS = $(NOVELLLIBC)\include;$(NOVELLLIBC)\include\nks;$(NOVELLLIBC)\include\winsock; +INCDIRS = $(NOVELLLIBC)\include;$(NOVELLLIBC)\include\nks;$(NOVELLLIBC)\include\winsock; -DEFINES = -DNETWARE +DEFINES = -DNETWARE ifndef USE_STDSOCKETS -DEFINES += -DUSE_WINSOCK +DEFINES += -DUSE_WINSOCK endif ifndef DEBUG -DEFINES += -DNDEBUG +DEFINES += -DNDEBUG +endif + +ifdef USE_STDSOCKETS +VERSION_SKT = (BSDSOCK) +else +VERSION_SKT = (WINSOCK) endif # From be2e6cc37dd78a318c553bb88bc7d5d453ac4416 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 8 Apr 2007 23:18:10 +0000 Subject: [PATCH 5798/7878] moved a couple of options to the generated def file since -copy option seems broken; this makes the def file also compatible to other NLM linkers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@526615 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 69 +++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index d253589eba2..8d7829dd125 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -25,7 +25,7 @@ NLM_SCREEN_NAME = DEFAULT endif ifndef NLM_COPYRIGHT -NLM_COPYRIGHT = Licensed under the Apache License Version 2.0 +NLM_COPYRIGHT = Licensed under the Apache License, Version 2.0 endif # @@ -211,12 +211,9 @@ $(OBJDIR)\$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) @echo Generating $@ @echo -warnings off >> $@ @echo -zerobss >> $@ - @echo -desc "$(NLM_DESCRIPTION)" >> $@ @echo -o $(TARGET_nlm) >> $@ ifneq "$(FILE_nlm_copyright)" "" @-type $(FILE_nlm_copyright) >> $@ -else - @echo -copy "$(NLM_COPYRIGHT)" >> $@ endif ifeq "$(RELEASE)" "debug" @echo -g >> $@ @@ -225,12 +222,6 @@ ifeq "$(RELEASE)" "debug" @echo -osym $(OBJDIR)\$(NLM_NAME).sym >> $@ else @echo -sym internal >> $@ -endif - @echo -screenname "$(NLM_SCREEN_NAME)" >> $@ -ifneq "$(NLM_VERSION)" "" - @echo -nlmversion=$(NLM_VERSION) >> $@ -else - @echo -nlmversion=$(VERSION) >> $@ endif @echo -l $(APR)/$(OBJDIR) >> $@ @echo -l $(APRUTIL)/$(OBJDIR) >> $@ @@ -241,30 +232,12 @@ endif ifneq "$(IPV6)" "" @echo -l $(NOVELLLIBC)\include\winsock\IPV6 >> $@ endif - @echo -l $(NOVELLLIBC)/imports >> $@ + @echo -l $(NOVELLLIBC)/imports >> $@ ifneq "$(LDAPSDK)" "" @echo -l $(LDAPSDK)/lib/nlm >> $@ endif @echo -nodefaults >> $@ @echo -map $(OBJDIR)\$(NLM_NAME).map>> $@ - @echo -threadname "$(NLM_THREAD_NAME)" >> $@ -ifneq "$(NLM_STACK_SIZE)" "" - @echo -stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE)))) >> $@ -else - @echo -stacksize 64000 >> $@ -endif -ifneq "$(NLM_ENTRY_SYM)" "" - @echo -entry $(NLM_ENTRY_SYM) >> $@ -endif -ifneq "$(NLM_EXIT_SYM)" "" - @echo -exit $(NLM_EXIT_SYM) >> $@ -endif -ifneq "$(NLM_CHECK_SYM)" "" - @echo -check $(NLM_CHECK_SYM) >> $@ -endif -ifneq "$(NLM_FLAGS)" "" - @echo -flags $(NLM_FLAGS) >> $@ -endif ifneq "$(strip $(XLFLAGS))" "" @echo $(XLFLAGS) >> $@ endif @@ -275,28 +248,58 @@ ifneq "$(FILES_nlm_libs)" "" @echo $(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(subst /,\,$(libfile))) >> $@ endif @echo -commandfile $(OBJDIR)\$(NLM_NAME)_link.def >> $@ + @echo # Do not edit this file - it is created by make! > $(OBJDIR)\$(NLM_NAME)_link.def + @echo # All your changes will be lost!! >> $(OBJDIR)\$(NLM_NAME)_link.def ifneq "$(FILE_nlm_msg)" "" @echo Messages $(FILE_nlm_msg) >> $(OBJDIR)\$(NLM_NAME)_link.def endif ifneq "$(FILE_nlm_hlp)" "" @echo Help $(FILE_nlm_hlp) >> $(OBJDIR)\$(NLM_NAME)_link.def endif +ifeq "$(FILE_nlm_copyright)" "" + @echo copyright "$(NLM_COPYRIGHT)" >> $(OBJDIR)\$(NLM_NAME)_link.def +endif + @echo description "$(NLM_DESCRIPTION)" >> $(OBJDIR)\$(NLM_NAME)_link.def + @echo threadname "$(NLM_THREAD_NAME)" >> $(OBJDIR)\$(NLM_NAME)_link.def +ifneq "$(NLM_STACK_SIZE)" "" + @echo stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE)))) >> $(OBJDIR)\$(NLM_NAME)_link.def +else + @echo stacksize 64000 >> $(OBJDIR)\$(NLM_NAME)_link.def +endif + @echo screenname "$(NLM_SCREEN_NAME)" >> $(OBJDIR)\$(NLM_NAME)_link.def +ifneq "$(NLM_VERSION)" "" + @echo version $(NLM_VERSION) >> $(OBJDIR)\$(NLM_NAME)_link.def +else + @echo version $(VERSION) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +ifneq "$(NLM_ENTRY_SYM)" "" + @echo start $(NLM_ENTRY_SYM) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +ifneq "$(NLM_EXIT_SYM)" "" + @echo exit $(NLM_EXIT_SYM) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +ifneq "$(NLM_CHECK_SYM)" "" + @echo check $(NLM_CHECK_SYM) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +ifneq "$(NLM_FLAGS)" "" + @echo $(strip $(NLM_FLAGS)) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif ifneq "$(FILES_nlm_modules)" "" @echo module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(subst /,\,$(module))) >> $(OBJDIR)\$(NLM_NAME)_link.def endif ifneq "$(FILES_nlm_Ximports)" "" - @echo Import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(subst /,\,$(import))) >> $(OBJDIR)\$(NLM_NAME)_link.def + @echo import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(subst /,\,$(import))) >> $(OBJDIR)\$(NLM_NAME)_link.def endif ifneq "$(FILES_nlm_exports)" "" - @echo Export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(subst /,\,$(export))) >> $(OBJDIR)\$(NLM_NAME)_link.def + @echo export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(subst /,\,$(export))) >> $(OBJDIR)\$(NLM_NAME)_link.def endif # if APACHE_UNIPROC is defined, don't include XDCData ifndef APACHE_UNIPROC ifneq "$(string $(XDCDATA))" "" - @echo XDCData $(XDCDATA) >> $(OBJDIR)\$(NLM_NAME)_link.def + @echo xdcdata $(XDCDATA) >> $(OBJDIR)\$(NLM_NAME)_link.def else - @echo XDCData $(APR)\misc\netware\apr.xdc >> $(OBJDIR)\$(NLM_NAME)_link.def + @echo xdcdata $(APR)\misc\netware\apr.xdc >> $(OBJDIR)\$(NLM_NAME)_link.def endif endif From 647b162592de717e628db05e15cdaa5dcb322f0a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 13 Apr 2007 20:49:55 +0000 Subject: [PATCH 5799/7878] Fix nsec timeout value PR: 42093 Reported by: Alex Kiernan git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@528659 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index 144442a0882..e6b124fbd8a 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -260,7 +260,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } else { tv.tv_sec = (long) apr_time_sec(timeout); - tv.tv_nsec = (long) apr_time_msec(timeout); + tv.tv_nsec = (long) apr_time_usec(timeout) * 1000; tvptr = &tv; } From 87dd59a2bf1bca14c30844bddda921198cc26667 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 17 Apr 2007 21:35:33 +0000 Subject: [PATCH 5800/7878] nl_langinfo() may be transient, pstrdup it. PR: 41659 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@529774 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/charset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/unix/charset.c b/misc/unix/charset.c index a66724d7201..a16310cd0c9 100644 --- a/misc/unix/charset.c +++ b/misc/unix/charset.c @@ -75,7 +75,7 @@ APR_DECLARE(const char*) apr_os_locale_encoding (apr_pool_t *pool) /* Ignore the bogus information and use apr_os_default_encoding() */ if (charset[0] != '^') #endif - return charset; + return apr_pstrdup(pool, charset); } #endif From cd1db360c64d0620427bf19b0ad7cf176b0e81f8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 18 Apr 2007 00:29:51 +0000 Subject: [PATCH 5801/7878] apr_dir_read returned ENOENT instead of APR_ENOENT PR: 41238 Submitted by: Lucian Adrian Grijincu git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@529816 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 0583a4c17a6..f58a4496ba6 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -176,7 +176,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, * that problem. */ if (ret == EINVAL) { - ret = ENOENT; + ret = APR_ENOENT; } #else /* We're about to call a non-thread-safe readdir() that may From 99580645cb605725339d3000b316946c6bf651f9 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Wed, 18 Apr 2007 02:16:31 +0000 Subject: [PATCH 5802/7878] Fix credits for apr_file_gets() deadlock git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@529831 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c0c145906b2..3fb56fe68c7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,7 @@ Changes for APR 1.3.0 *) Fix deadlock in apr_file_gets() for a file opened with both the - APR_BUFFERED and APR_XTHREAD flags. [Bojan Smojver] + APR_BUFFERED and APR_XTHREAD flags. [Bojan Smojver, Joe Orton] *) Add the apr_pollcb API as an alternative more efficient method of polling sockets, compared to apr_pollset. [Paul Querna] From 9bc946ecc392684509f9da0f6cc809bf1b7b3f53 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 26 Apr 2007 13:10:34 +0000 Subject: [PATCH 5803/7878] * strings/apr_snprintf.c (conv_10_quad): Fix formatting of unsigned integers between 2^63 and 2^64 on 32-bit platforms. * test/testfmt.c (more_int64_fmts): Test an even bigger unsigned int64. Submitted by: Wynn Wilkes PR: 42250 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@532733 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 2 +- test/testfmt.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 7ad741100e9..a8b5db5938a 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -397,7 +397,7 @@ static char *conv_10_quad(widest_int num, register bool_int is_unsigned, * number against the largest long value it can be. If <=, we * punt to the quicker version. */ - if ((num <= ULONG_MAX && is_unsigned) + if (((u_widest_int)num <= (u_widest_int)ULONG_MAX && is_unsigned) || (num <= LONG_MAX && num >= LONG_MIN && !is_unsigned)) return(conv_10( (wide_int)num, is_unsigned, is_negative, buf_end, len)); diff --git a/test/testfmt.c b/test/testfmt.c index 30b6155d5d6..d06726a68a7 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -102,7 +102,7 @@ static void more_int64_fmts(abts_case *tc, void *data) apr_int64_t i = APR_INT64_C(-42); apr_int64_t ibig = APR_INT64_C(-314159265358979323); apr_uint64_t ui = APR_UINT64_C(42); - apr_uint64_t big = APR_UINT64_C(3141592653589793238); + apr_uint64_t big = APR_UINT64_C(10267677267010969076); apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, i); ABTS_STR_EQUAL(tc, buf, "-42"); @@ -111,7 +111,7 @@ static void more_int64_fmts(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, buf, "42"); apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, big); - ABTS_STR_EQUAL(tc, buf, "3141592653589793238"); + ABTS_STR_EQUAL(tc, "10267677267010969076", buf); apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, ibig); ABTS_STR_EQUAL(tc, buf, "-314159265358979323"); From 47dc4f954e91d25101c86f37bdb34f4fc1241f2d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 26 Apr 2007 13:26:44 +0000 Subject: [PATCH 5804/7878] * includes/apr_file_io.h: Update warning about APR_FOPEN_LARGEFILE to reference to the non-deprecated macro name. PR: 41390 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@532737 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 96d37ecca35..166e6294de0 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -93,11 +93,11 @@ extern "C" { #define APR_SENDFILE_ENABLED APR_FOPEN_SENDFILE_ENABLED /**< @deprecated @see APR_FOPEN_SENDFILE_ENABLED */ #define APR_LARGEFILE APR_FOPEN_LARGEFILE /**< @deprecated @see APR_FOPEN_LARGEFILE */ -/** @warning The APR_LARGEFILE flag only has effect on some platforms - * where sizeof(apr_off_t) == 4. Where implemented, it allows opening - * and writing to a file which exceeds the size which can be - * represented by apr_off_t (2 gigabytes). When a file's size does - * exceed 2Gb, apr_file_info_get() will fail with an error on the +/** @warning The APR_FOPEN_LARGEFILE flag only has effect on some + * platforms where sizeof(apr_off_t) == 4. Where implemented, it + * allows opening and writing to a file which exceeds the size which + * can be represented by apr_off_t (2 gigabytes). When a file's size + * does exceed 2Gb, apr_file_info_get() will fail with an error on the * descriptor, likewise apr_stat()/apr_lstat() will fail on the * filename. apr_dir_read() will fail with APR_INCOMPLETE on a * directory entry for a large file depending on the particular From bec72120678915cd259a3d399cd6a0c50b1f9111 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 26 Apr 2007 13:53:44 +0000 Subject: [PATCH 5805/7878] * tables/apr_tables.c [MAKE_TABLE_PROFILE] (do_table_push): Rename from table_push and fix implementation per 1.3's alloc.c, with extension to print invoking function name if built with GCC. PR: 41950 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@532744 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 54b6eb069c9..90fcaf88794 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -38,7 +38,7 @@ #include #endif -#if APR_POOL_DEBUG && APR_HAVE_STDIO_H +#if (APR_POOL_DEBUG || defined(MAKE_TABLE_PROFILE)) && APR_HAVE_STDIO_H #include #endif @@ -357,13 +357,19 @@ struct apr_table_t { * and table_elts() in alloc.h */ #ifdef MAKE_TABLE_PROFILE -static apr_table_entry_t *table_push(apr_table_t *t) +static apr_table_entry_t *do_table_push(const char *func, apr_table_t *t) { if (t->a.nelts == t->a.nalloc) { - return NULL; + fprintf(stderr, "%s: table created by %p hit limit of %u\n", + func ? func : "table_push", t->creator, t->a.nalloc); } return (apr_table_entry_t *) apr_array_push_noclear(&t->a); } +#if defined(__GNUC__) && __GNUC__ >= 2 +#define table_push(t) do_table_push(__FUNCTION__, t) +#else +#define table_push(t) do_table_push(NULL, t) +#endif #else /* MAKE_TABLE_PROFILE */ #define table_push(t) ((apr_table_entry_t *) apr_array_push_noclear(&(t)->a)) #endif /* MAKE_TABLE_PROFILE */ From 15bfcecc07cfb1bb2cf6385a6d543966279dc82d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 26 Apr 2007 16:13:33 +0000 Subject: [PATCH 5806/7878] * user/unix/groupinfo.c (apr_gid_name_get, apr_gid_get): Use GRBUF_SIZE for getgr*_r buffer size and bump to 8192 bytes. PR: 41105 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@532789 13f79535-47bb-0310-9956-ffa450edef68 --- user/unix/groupinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 89ae966b678..7967219f8fb 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -28,6 +28,8 @@ #include /* for _POSIX_THREAD_SAFE_FUNCTIONS */ #endif +#define GRBUF_SIZE 8192 + APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p) { @@ -35,7 +37,7 @@ APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) struct group grp; - char grbuf[512]; + char grbuf[GRBUF_SIZE]; apr_status_t rv; /* See comment in getpwnam_safe on error handling. */ @@ -63,7 +65,7 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRNAM_R) struct group grp; - char grbuf[512]; + char grbuf[GRBUF_SIZE]; apr_status_t rv; /* See comment in getpwnam_safe on error handling. */ From 16359b858092a70ea1e39258a8d649f2218dc62e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 27 Apr 2007 09:59:17 +0000 Subject: [PATCH 5807/7878] * include/apr_tables.h: Clarify documentation of apr_table_do and apr_table_vdo. PR: 41397 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@533043 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index 855eff247e0..b16b66cd137 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -342,16 +342,19 @@ typedef int (apr_table_do_callback_fn_t)(void *rec, const char *key, /** * Iterate over a table running the provided function once for every - * element in the table. If there is data passed in as a vararg, then the - * function is only run on those elements whose key matches something in - * the vararg. If the vararg is NULL, then every element is run through the - * function. Iteration continues while the function returns non-zero. + * element in the table. The varargs array must be a list of zero or + * more (char *) keys followed by a NULL pointer. If zero keys are + * given, the @param comp function will be invoked for every element + * in the table. Otherwise, the function is invoked only for those + * elements matching the keys specified. + * + * If an invocation of the @param comp function returns zero, + * iteration will continue using the next specified key, if any. + * * @param comp The function to run * @param rec The data to pass as the first argument to the function * @param t The table to iterate over - * @param ... The vararg. If this is NULL, then all elements in the table are - * run through the function, otherwise only those whose key matches - * are run. + * @param ... A varargs array of zero or more (char *) keys followed by NULL * @return FALSE if one of the comp() iterations returned zero; TRUE if all * iterations returned non-zero * @see apr_table_do_callback_fn_t @@ -361,16 +364,19 @@ APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, /** * Iterate over a table running the provided function once for every - * element in the table. If there is data passed in as a vararg, then the - * function is only run on those element's whose key matches something in - * the vararg. If the vararg is NULL, then every element is run through the - * function. Iteration continues while the function returns non-zero. + * element in the table. The @param vp varargs paramater must be a + * list of zero or more (char *) keys followed by a NULL pointer. If + * zero keys are given, the @param comp function will be invoked for + * every element in the table. Otherwise, the function is invoked + * only for those elements matching the keys specified. + * + * If an invocation of the @param comp function returns zero, + * iteration will continue using the next specified key, if any. + * * @param comp The function to run * @param rec The data to pass as the first argument to the function * @param t The table to iterate over - * @param vp The vararg table. If this is NULL, then all elements in the - * table are run through the function, otherwise only those - * whose key matches are run. + * @param vp List of zero or more (char *) keys followed by NULL * @return FALSE if one of the comp() iterations returned zero; TRUE if all * iterations returned non-zero * @see apr_table_do_callback_fn_t From 4675fef280c52ce384dfb0cf0c6e14d607fca3f8 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Fri, 11 May 2007 02:11:25 +0000 Subject: [PATCH 5808/7878] The file pointer position must be recalculated and set when writev()ing to a buffered file. Fix by Davi Arnaut for bug #40963 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@537066 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 9 +++++++++ test/testfile.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 3511846d9f5..412d7c8baad 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -252,6 +252,15 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove if (rv != APR_SUCCESS) { return rv; } + if (thefile->direction == 0) { + /* Position file pointer for writing at the offset we are + * logically reading from + */ + apr_int64_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + if (offset != thefile->filePtr) + lseek(thefile->filedes, offset, SEEK_SET); + thefile->bufpos = thefile->dataRead = 0; + } } #ifdef HAVE_WRITEV diff --git a/test/testfile.c b/test/testfile.c index df63d081fb4..9f24dcc54e9 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -715,6 +715,44 @@ static void test_writev_buffered(abts_case *tc, void *data) strlen(TESTSTR) + strlen(LINE1) + strlen(LINE2)); } +static void test_writev_buffered_seek(abts_case *tc, void *data) +{ + apr_file_t *f; + apr_status_t rv; + apr_off_t off = 0; + struct iovec vec[3]; + apr_size_t nbytes = strlen(TESTSTR); + char *str = apr_pcalloc(p, nbytes+1); + const char *fname = "data/testwritev_buffered.dat"; + + APR_ASSERT_SUCCESS(tc, "open file for writing", + apr_file_open(&f, fname, + APR_WRITE | APR_READ | APR_BUFFERED, + APR_OS_DEFAULT, p)); + + rv = apr_file_read(f, str, &nbytes); + ABTS_STR_EQUAL(tc, TESTSTR, str); + APR_ASSERT_SUCCESS(tc, "buffered seek", apr_file_seek(f, APR_SET, &off)); + + vec[0].iov_base = LINE1; + vec[0].iov_len = strlen(LINE1); + vec[1].iov_base = LINE2; + vec[1].iov_len = strlen(LINE2); + vec[2].iov_base = TESTSTR; + vec[2].iov_len = strlen(TESTSTR); + + APR_ASSERT_SUCCESS(tc, "writev of size 2 to file", + apr_file_writev(f, vec, 3, &nbytes)); + + APR_ASSERT_SUCCESS(tc, "close for writing", + apr_file_close(f)); + + file_contents_equal(tc, fname, LINE1 LINE2 TESTSTR, + strlen(LINE1) + strlen(LINE2) + strlen(TESTSTR)); + + APR_ASSERT_SUCCESS(tc, "remove file", apr_file_remove(fname, p)); +} + static void test_truncate(abts_case *tc, void *data) { apr_status_t rv; @@ -941,6 +979,7 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_writev, NULL); abts_run_test(suite, test_writev_full, NULL); abts_run_test(suite, test_writev_buffered, NULL); + abts_run_test(suite, test_writev_buffered_seek, NULL); abts_run_test(suite, test_bigread, NULL); abts_run_test(suite, test_mod_neg, NULL); abts_run_test(suite, test_truncate, NULL); From 6e058aaf49e30baf7847096186de7cc96788687d Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Sat, 12 May 2007 11:47:29 +0000 Subject: [PATCH 5809/7878] Improve thread safety of assorted file_io functions. Patches by Davi Arnaut. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@537393 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ file_io/unix/buffer.c | 22 ++------ file_io/unix/filedup.c | 4 +- file_io/unix/filestat.c | 1 - file_io/unix/open.c | 5 +- file_io/unix/readwrite.c | 75 ++++++++++------------------ file_io/unix/seek.c | 6 ++- include/arch/unix/apr_arch_file_io.h | 8 +++ 8 files changed, 52 insertions(+), 72 deletions(-) diff --git a/CHANGES b/CHANGES index 3fb56fe68c7..8576e563053 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Improve thread safety of assorted file_io functions. + PR 42400. [Davi Arnaut ] + *) Fix deadlock in apr_file_gets() for a file opened with both the APR_BUFFERED and APR_XTHREAD flags. [Bojan Smojver, Joe Orton] diff --git a/file_io/unix/buffer.c b/file_io/unix/buffer.c index 5e384d21f5b..cc8474fbe2d 100644 --- a/file_io/unix/buffer.c +++ b/file_io/unix/buffer.c @@ -24,21 +24,13 @@ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, { apr_status_t rv; -#if APR_HAS_THREADS - if (file->thlock) { - apr_thread_mutex_lock(file->thlock); - } -#endif - + file_lock(file); + if(file->buffered) { /* Flush the existing buffer */ rv = apr_file_flush(file); if (rv != APR_SUCCESS) { -#if APR_HAS_THREADS - if (file->thlock) { - apr_thread_mutex_unlock(file->thlock); - } -#endif + file_unlock(file); return rv; } } @@ -56,12 +48,8 @@ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, */ file->buffered = 0; } - -#if APR_HAS_THREADS - if (file->thlock) { - apr_thread_mutex_unlock(file->thlock); - } -#endif + + file_unlock(file); return APR_SUCCESS; } diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index d7a5d777533..3b40eab8c59 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -55,7 +55,7 @@ static apr_status_t file_dup(apr_file_t **new_file, #if APR_HAS_THREADS if ((*new_file)->buffered && !(*new_file)->thlock && old_file->thlock) { apr_thread_mutex_create(&((*new_file)->thlock), - APR_THREAD_MUTEX_DEFAULT, p); + APR_THREAD_MUTEX_NESTED, p); } #endif /* As above, only create the buffer if we haven't already @@ -133,7 +133,7 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, #if APR_HAS_THREADS if (old_file->thlock) { apr_thread_mutex_create(&((*new_file)->thlock), - APR_THREAD_MUTEX_DEFAULT, p); + APR_THREAD_MUTEX_NESTED, p); apr_thread_mutex_destroy(old_file->thlock); } #endif /* APR_HAS_THREADS */ diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index e6f73e6fc53..98ef74ec76d 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -107,7 +107,6 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, struct_stat info; if (thefile->buffered) { - /* XXX: flush here is not mutex protected */ apr_status_t rv = apr_file_flush(thefile); if (rv != APR_SUCCESS) return rv; diff --git a/file_io/unix/open.c b/file_io/unix/open.c index f6b1a7cf4af..6a712a842e6 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -32,7 +32,6 @@ apr_status_t apr_unix_file_cleanup(void *thefile) apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS; if (file->buffered) { - /* XXX: flush here is not mutex protected */ flush_rv = apr_file_flush(file); } if (close(file->filedes) == 0) { @@ -123,7 +122,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, #if APR_HAS_THREADS if ((flag & APR_BUFFERED) && (flag & APR_XTHREAD)) { rv = apr_thread_mutex_create(&thlock, - APR_THREAD_MUTEX_DEFAULT, pool); + APR_THREAD_MUTEX_NESTED, pool); if (rv) { return rv; } @@ -247,7 +246,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, if ((*file)->flags & APR_XTHREAD) { apr_status_t rv; rv = apr_thread_mutex_create(&((*file)->thlock), - APR_THREAD_MUTEX_DEFAULT, pool); + APR_THREAD_MUTEX_NESTED, pool); if (rv) { return rv; } diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 412d7c8baad..15fcd8fdf53 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -93,19 +93,9 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } if (thefile->buffered) { -#if APR_HAS_THREADS - if (thefile->thlock) { - apr_thread_mutex_lock(thefile->thlock); - } -#endif - + file_lock(thefile); rv = file_read_buffered(thefile, buf, nbytes); - -#if APR_HAS_THREADS - if (thefile->thlock) { - apr_thread_mutex_unlock(thefile->thlock); - } -#endif + file_unlock(thefile); return rv; } else { @@ -163,11 +153,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a int blocksize; int size = *nbytes; -#if APR_HAS_THREADS - if (thefile->thlock) { - apr_thread_mutex_lock(thefile->thlock); - } -#endif + file_lock(thefile); if ( thefile->direction == 0 ) { /* Position file pointer for writing at the offset we are @@ -193,11 +179,8 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a size -= blocksize; } -#if APR_HAS_THREADS - if (thefile->thlock) { - apr_thread_mutex_unlock(thefile->thlock); - } -#endif + file_unlock(thefile); + return rv; } else { @@ -243,13 +226,16 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { + apr_status_t rv; #ifdef HAVE_WRITEV apr_ssize_t bytes; -#endif + + file_lock(thefile); if (thefile->buffered) { - apr_status_t rv = apr_file_flush(thefile); + rv = apr_file_flush(thefile); if (rv != APR_SUCCESS) { + file_unlock(thefile); return rv; } if (thefile->direction == 0) { @@ -263,15 +249,17 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove } } -#ifdef HAVE_WRITEV if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { *nbytes = 0; - return errno; + rv = errno; } else { *nbytes = bytes; - return APR_SUCCESS; + rv = APR_SUCCESS; } + + file_unlock(thefile); + return rv; #else /** * The problem with trying to output the entire iovec is that we cannot @@ -319,7 +307,10 @@ APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile) APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) { + apr_status_t rv = APR_SUCCESS; + if (thefile->buffered) { + file_lock(thefile); if (thefile->direction == 1 && thefile->bufpos) { apr_ssize_t written; @@ -327,16 +318,18 @@ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) written = write(thefile->filedes, thefile->buffer, thefile->bufpos); } while (written == -1 && errno == EINTR); if (written == -1) { - return errno; + rv = errno; + } else { + thefile->filePtr += written; + thefile->bufpos = 0; } - thefile->filePtr += written; - thefile->bufpos = 0; } + file_unlock(thefile); } /* There isn't anything to do if we aren't buffering the output * so just return success. */ - return APR_SUCCESS; + return rv; } APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) @@ -356,21 +349,12 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) * and skip over the apr_file_read calls. */ if (thefile->buffered) { - -#if APR_HAS_THREADS - if (thefile->thlock) { - apr_thread_mutex_lock(thefile->thlock); - } -#endif + file_lock(thefile); if (thefile->direction == 1) { rv = apr_file_flush(thefile); if (rv) { -#if APR_HAS_THREADS - if (thefile->thlock) { - apr_thread_mutex_unlock(thefile->thlock); - } -#endif + file_unlock(thefile); return rv; } @@ -398,12 +382,7 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) } ++str; } - -#if APR_HAS_THREADS - if (thefile->thlock) { - apr_thread_mutex_unlock(thefile->thlock); - } -#endif + file_unlock(thefile); } else { while (str < final) { /* leave room for trailing '\0' */ diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 03b0345c859..3e7e33ee469 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -22,7 +22,6 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) apr_status_t rv; if (thefile->direction == 1) { - /* XXX: flush here is not mutex protected */ rv = apr_file_flush(thefile); if (rv) { return rv; @@ -60,6 +59,8 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh int rc = EINVAL; apr_finfo_t finfo; + file_lock(thefile); + switch (where) { case APR_SET: rc = setptr(thefile, *offset); @@ -77,6 +78,9 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh } *offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + + file_unlock(thefile); + return rc; } else { diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index 11816421691..9b2bbcac976 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -113,6 +113,14 @@ struct apr_file_t { #endif }; +#if APR_HAS_THREADS +#define file_lock(f) {if ((f)->thlock) apr_thread_mutex_lock((f)->thlock);} +#define file_unlock(f) {if ((f)->thlock) apr_thread_mutex_unlock((f)->thlock);} +#else +#define file_lock(f) {} +#define file_unlock(f) {} +#endif + #if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE) #define stat(f,b) stat64(f,b) #define lstat(f,b) lstat64(f,b) From dae0328ef885e610381d694c1c80f93c9375d37c Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Sat, 12 May 2007 12:39:44 +0000 Subject: [PATCH 5810/7878] Avoid compiler warning (rv only used if HAVE_WRITEV). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@537402 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 15fcd8fdf53..6936519fc8a 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -226,8 +226,8 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { - apr_status_t rv; #ifdef HAVE_WRITEV + apr_status_t rv; apr_ssize_t bytes; file_lock(thefile); @@ -242,7 +242,8 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove /* Position file pointer for writing at the offset we are * logically reading from */ - apr_int64_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + apr_int64_t offset = thefile->filePtr - thefile->dataRead + + thefile->bufpos; if (offset != thefile->filePtr) lseek(thefile->filedes, offset, SEEK_SET); thefile->bufpos = thefile->dataRead = 0; From c018d320128cd5506b8541126f49bf7c06487810 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Sat, 12 May 2007 12:57:19 +0000 Subject: [PATCH 5811/7878] Fix file_lock/unlock macros git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@537405 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_file_io.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index 9b2bbcac976..a27b89b2b3a 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -114,11 +114,17 @@ struct apr_file_t { }; #if APR_HAS_THREADS -#define file_lock(f) {if ((f)->thlock) apr_thread_mutex_lock((f)->thlock);} -#define file_unlock(f) {if ((f)->thlock) apr_thread_mutex_unlock((f)->thlock);} +#define file_lock(f) do { \ + if ((f)->thlock) \ + apr_thread_mutex_lock((f)->thlock); \ + } while (0) +#define file_unlock(f) do { \ + if ((f)->thlock) \ + apr_thread_mutex_unlock((f)->thlock); \ + } while (0) #else -#define file_lock(f) {} -#define file_unlock(f) {} +#define file_lock(f) do {} while (0) +#define file_unlock(f) do {} while (0) #endif #if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE) From 2f9639eb12b123bfede0e051d8606ff4063fce41 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Mon, 14 May 2007 22:58:16 +0000 Subject: [PATCH 5812/7878] Revert nested mutexes in Unix file_io git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@538009 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/buffer.c | 2 +- file_io/unix/filedup.c | 4 +-- file_io/unix/filestat.c | 22 ++++++++++++ file_io/unix/open.c | 4 +-- file_io/unix/readwrite.c | 51 ++++++++++++++++------------ file_io/unix/seek.c | 4 +-- include/arch/unix/apr_arch_file_io.h | 4 +++ 7 files changed, 63 insertions(+), 28 deletions(-) diff --git a/file_io/unix/buffer.c b/file_io/unix/buffer.c index cc8474fbe2d..ba2a8a7c636 100644 --- a/file_io/unix/buffer.c +++ b/file_io/unix/buffer.c @@ -28,7 +28,7 @@ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, if(file->buffered) { /* Flush the existing buffer */ - rv = apr_file_flush(file); + rv = apr_file_flush_locked(file); if (rv != APR_SUCCESS) { file_unlock(file); return rv; diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 3b40eab8c59..d7a5d777533 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -55,7 +55,7 @@ static apr_status_t file_dup(apr_file_t **new_file, #if APR_HAS_THREADS if ((*new_file)->buffered && !(*new_file)->thlock && old_file->thlock) { apr_thread_mutex_create(&((*new_file)->thlock), - APR_THREAD_MUTEX_NESTED, p); + APR_THREAD_MUTEX_DEFAULT, p); } #endif /* As above, only create the buffer if we haven't already @@ -133,7 +133,7 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, #if APR_HAS_THREADS if (old_file->thlock) { apr_thread_mutex_create(&((*new_file)->thlock), - APR_THREAD_MUTEX_NESTED, p); + APR_THREAD_MUTEX_DEFAULT, p); apr_thread_mutex_destroy(old_file->thlock); } #endif /* APR_HAS_THREADS */ diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 98ef74ec76d..dd8b3adf99b 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -100,6 +100,28 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info, */ } +apr_status_t apr_file_info_get_locked(apr_finfo_t *finfo, apr_int32_t wanted, + apr_file_t *thefile) +{ + struct_stat info; + + if (thefile->buffered) { + apr_status_t rv = apr_file_flush_locked(thefile); + if (rv != APR_SUCCESS) + return rv; + } + + if (fstat(thefile->filedes, &info) == 0) { + finfo->pool = thefile->pool; + finfo->fname = thefile->fname; + fill_out_finfo(finfo, &info, wanted); + return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; + } + else { + return errno; + } +} + APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 6a712a842e6..d1a3def34a8 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -122,7 +122,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, #if APR_HAS_THREADS if ((flag & APR_BUFFERED) && (flag & APR_XTHREAD)) { rv = apr_thread_mutex_create(&thlock, - APR_THREAD_MUTEX_NESTED, pool); + APR_THREAD_MUTEX_DEFAULT, pool); if (rv) { return rv; } @@ -246,7 +246,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, if ((*file)->flags & APR_XTHREAD) { apr_status_t rv; rv = apr_thread_mutex_create(&((*file)->thlock), - APR_THREAD_MUTEX_NESTED, pool); + APR_THREAD_MUTEX_DEFAULT, pool); if (rv) { return rv; } diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 6936519fc8a..83d8497562e 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -34,7 +34,7 @@ static apr_status_t file_read_buffered(apr_file_t *thefile, void *buf, apr_uint64_t size = *nbytes; if (thefile->direction == 1) { - rv = apr_file_flush(thefile); + rv = apr_file_flush_locked(thefile); if (rv) { return rv; } @@ -169,7 +169,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos == thefile->bufsize) /* write buffer is full*/ - rv = apr_file_flush(thefile); + rv = apr_file_flush_locked(thefile); blocksize = size > thefile->bufsize - thefile->bufpos ? thefile->bufsize - thefile->bufpos : size; @@ -230,10 +230,10 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove apr_status_t rv; apr_ssize_t bytes; - file_lock(thefile); - if (thefile->buffered) { - rv = apr_file_flush(thefile); + file_lock(thefile); + + rv = apr_file_flush_locked(thefile); if (rv != APR_SUCCESS) { file_unlock(thefile); return rv; @@ -248,6 +248,8 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove lseek(thefile->filedes, offset, SEEK_SET); thefile->bufpos = thefile->dataRead = 0; } + + file_unlock(thefile); } if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { @@ -258,8 +260,6 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove *nbytes = bytes; rv = APR_SUCCESS; } - - file_unlock(thefile); return rv; #else /** @@ -306,25 +306,34 @@ APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile) return apr_file_write_full(thefile, str, strlen(str), NULL); } +apr_status_t apr_file_flush_locked(apr_file_t *thefile) +{ + apr_status_t rv = APR_SUCCESS; + + if (thefile->direction == 1 && thefile->bufpos) { + apr_ssize_t written; + + do { + written = write(thefile->filedes, thefile->buffer, thefile->bufpos); + } while (written == -1 && errno == EINTR); + if (written == -1) { + rv = errno; + } else { + thefile->filePtr += written; + thefile->bufpos = 0; + } + } + + return rv; +} + APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) { apr_status_t rv = APR_SUCCESS; if (thefile->buffered) { file_lock(thefile); - if (thefile->direction == 1 && thefile->bufpos) { - apr_ssize_t written; - - do { - written = write(thefile->filedes, thefile->buffer, thefile->bufpos); - } while (written == -1 && errno == EINTR); - if (written == -1) { - rv = errno; - } else { - thefile->filePtr += written; - thefile->bufpos = 0; - } - } + rv = apr_file_flush_locked(thefile); file_unlock(thefile); } /* There isn't anything to do if we aren't buffering the output @@ -353,7 +362,7 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) file_lock(thefile); if (thefile->direction == 1) { - rv = apr_file_flush(thefile); + rv = apr_file_flush_locked(thefile); if (rv) { file_unlock(thefile); return rv; diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 3e7e33ee469..34bb2a55fa8 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -22,7 +22,7 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) apr_status_t rv; if (thefile->direction == 1) { - rv = apr_file_flush(thefile); + rv = apr_file_flush_locked(thefile); if (rv) { return rv; } @@ -71,7 +71,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh break; case APR_END: - rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); + rc = apr_file_info_get_locked(&finfo, APR_FINFO_SIZE, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size + *offset); break; diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index a27b89b2b3a..edcc4293b8f 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -160,6 +160,10 @@ apr_status_t apr_unix_file_cleanup(void *); mode_t apr_unix_perms2mode(apr_fileperms_t perms); apr_fileperms_t apr_unix_mode2perms(mode_t mode); +apr_status_t apr_file_flush_locked(apr_file_t *thefile); +apr_status_t apr_file_info_get_locked(apr_finfo_t *finfo, apr_int32_t wanted, + apr_file_t *thefile); + #endif /* ! FILE_IO_H */ From 1288f59efa2a138ea3939b99a735c0ed45322a57 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Mon, 14 May 2007 23:45:20 +0000 Subject: [PATCH 5813/7878] Avoid calling apr_file_flush_locked() on an unlocked file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@538019 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/seek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 34bb2a55fa8..77ef96e7d55 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -101,5 +101,5 @@ apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset) if (ftruncate(fp->filedes, offset) == -1) { return errno; } - return setptr(fp, offset); + return apr_file_seek(fp, APR_SET, &offset); } From b2ff6a14cce58d0040142a3e8c733fd62a7c498f Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Tue, 15 May 2007 02:22:06 +0000 Subject: [PATCH 5814/7878] Document what happens to file offset in apr_file_trunc(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@538042 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 166e6294de0..3fea005d120 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -808,6 +808,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, * Truncate the file's length to the specified offset * @param fp The file to truncate * @param offset The offset to truncate to. + * @remark The read/write file offset is repositioned to offset. */ APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset); From ee0a84ec113cf06a199df07389dfd5b190b527b2 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Tue, 15 May 2007 02:37:16 +0000 Subject: [PATCH 5815/7878] Discard file buffers when running cleanups for exec. PR 41119. Original patches by Davi Arnaut. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@538045 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ file_io/netware/mktemp.c | 3 +- file_io/unix/filedup.c | 4 +-- file_io/unix/mktemp.c | 3 +- file_io/unix/open.c | 47 ++++++++++++++++++++----- include/arch/netware/apr_arch_file_io.h | 1 + include/arch/unix/apr_arch_file_io.h | 1 + 7 files changed, 50 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 8576e563053..efd0c5c423b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Discard file buffers when running cleanups for exec. + PR 41119. [Davi Arnaut , Bojan Smojver] + *) Improve thread safety of assorted file_io functions. PR 42400. [Davi Arnaut ] diff --git a/file_io/netware/mktemp.c b/file_io/netware/mktemp.c index c5ffebd20d4..745eff78464 100644 --- a/file_io/netware/mktemp.c +++ b/file_io/netware/mktemp.c @@ -42,7 +42,8 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) { apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), - apr_unix_file_cleanup, apr_unix_file_cleanup); + apr_unix_file_cleanup, + apr_unix_child_file_cleanup); } return rv; diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index d7a5d777533..adecbb7f05b 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -92,7 +92,7 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), apr_unix_file_cleanup, - apr_unix_file_cleanup); + apr_unix_child_file_cleanup); #ifndef WAITIO_USES_POLL /* Start out with no pollset. apr_wait_for_io_or_timeout() will * initialize the pollset if needed. @@ -146,7 +146,7 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, apr_unix_file_cleanup, ((*new_file)->flags & APR_INHERIT) ? apr_pool_cleanup_null - : apr_unix_file_cleanup); + : apr_unix_child_file_cleanup); } old_file->filedes = -1; diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 73c61dcfce4..8ac2f91bf6e 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -203,7 +203,8 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i (*fp)->fname = apr_pstrdup(p, template); apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), - apr_unix_file_cleanup, apr_unix_file_cleanup); + apr_unix_file_cleanup, + apr_unix_child_file_cleanup); #endif return APR_SUCCESS; } diff --git a/file_io/unix/open.c b/file_io/unix/open.c index d1a3def34a8..e84045045e0 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -26,14 +26,10 @@ #include "fsio.h" #endif -apr_status_t apr_unix_file_cleanup(void *thefile) +static apr_status_t file_cleanup(apr_file_t *file) { - apr_file_t *file = thefile; - apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS; + apr_status_t rv = APR_SUCCESS; - if (file->buffered) { - flush_rv = apr_file_flush(file); - } if (close(file->filedes) == 0) { file->filedes = -1; if (file->flags & APR_DELONCLOSE) { @@ -60,9 +56,28 @@ apr_status_t apr_unix_file_cleanup(void *thefile) } } #endif /* !WAITIO_USES_POLL */ + return rv; +} + +apr_status_t apr_unix_file_cleanup(void *thefile) +{ + apr_file_t *file = thefile; + apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS; + + if (file->buffered) { + flush_rv = apr_file_flush(file); + } + + rv = file_cleanup(file); + return rv != APR_SUCCESS ? rv : flush_rv; } +apr_status_t apr_unix_child_file_cleanup(void *thefile) +{ + return file_cleanup(thefile); +} + APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, @@ -179,7 +194,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, if (!(flag & APR_FILE_NOCLEANUP)) { apr_pool_cleanup_register((*new)->pool, (void *)(*new), apr_unix_file_cleanup, - apr_unix_file_cleanup); + apr_unix_child_file_cleanup); } return APR_SUCCESS; } @@ -311,6 +326,22 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, APR_IMPLEMENT_INHERIT_SET(file, flags, pool, apr_unix_file_cleanup) -APR_IMPLEMENT_INHERIT_UNSET(file, flags, pool, apr_unix_file_cleanup) +/* We need to do this by hand instead of using APR_IMPLEMENT_INHERIT_UNSET + * because the macro sets both cleanups to the same function, which is not + * suitable on Unix (see PR 41119). */ +APR_DECLARE(apr_status_t) apr_file_inherit_unset(apr_file_t *thefile) +{ + if (thefile->flags & APR_FILE_NOCLEANUP) { + return APR_EINVAL; + } + if (thefile->flags & APR_INHERIT) { + thefile->flags &= ~APR_INHERIT; + apr_pool_child_cleanup_set(thefile->pool, + (void *)thefile, + apr_unix_file_cleanup, + apr_unix_child_file_cleanup); + } + return APR_SUCCESS; +} APR_POOL_IMPLEMENT_ACCESSOR(file) diff --git a/include/arch/netware/apr_arch_file_io.h b/include/arch/netware/apr_arch_file_io.h index 3437bdaadff..3d123f8e6e0 100644 --- a/include/arch/netware/apr_arch_file_io.h +++ b/include/arch/netware/apr_arch_file_io.h @@ -149,6 +149,7 @@ apr_status_t filepath_has_drive(const char *rootpath, int only, apr_pool_t *p); apr_status_t filepath_compare_drive(const char *path1, const char *path2, apr_pool_t *p); apr_status_t apr_unix_file_cleanup(void *); +apr_status_t apr_unix_child_file_cleanup(void *); #endif /* ! FILE_IO_H */ diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index edcc4293b8f..af602038b3c 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -156,6 +156,7 @@ struct apr_dir_t { }; apr_status_t apr_unix_file_cleanup(void *); +apr_status_t apr_unix_child_file_cleanup(void *); mode_t apr_unix_perms2mode(apr_fileperms_t perms); apr_fileperms_t apr_unix_mode2perms(mode_t mode); From 8572995def5e5fdbdd8a577297283132b53956a9 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 15 May 2007 17:51:34 +0000 Subject: [PATCH 5816/7878] Add the missing file locking APIs and macros to the NetWare build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@538266 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 22 ++++++++++++++++++++++ include/arch/netware/apr_arch_file_io.h | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 2996676a90b..bf37762080d 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -77,6 +77,28 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, */ } +apr_status_t apr_file_info_get_locked(apr_finfo_t *finfo, apr_int32_t wanted, + apr_file_t *thefile) +{ + struct_stat info; + + if (thefile->buffered) { + apr_status_t rv = apr_file_flush_locked(thefile); + if (rv != APR_SUCCESS) + return rv; + } + + if (fstat(thefile->filedes, &info) == 0) { + finfo->pool = thefile->pool; + finfo->fname = thefile->fname; + fill_out_finfo(finfo, &info, wanted); + return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; + } + else { + return errno; + } +} + APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile) diff --git a/include/arch/netware/apr_arch_file_io.h b/include/arch/netware/apr_arch_file_io.h index 3d123f8e6e0..0676eb2789e 100644 --- a/include/arch/netware/apr_arch_file_io.h +++ b/include/arch/netware/apr_arch_file_io.h @@ -73,6 +73,20 @@ /* For backwards compat */ #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE +#if APR_HAS_THREADS +#define file_lock(f) do { \ + if ((f)->thlock) \ + apr_thread_mutex_lock((f)->thlock); \ + } while (0) +#define file_unlock(f) do { \ + if ((f)->thlock) \ + apr_thread_mutex_unlock((f)->thlock); \ + } while (0) +#else +#define file_lock(f) do {} while (0) +#define file_unlock(f) do {} while (0) +#endif + #if APR_HAS_LARGE_FILES #define lseek(f,o,w) lseek64(f,o,w) #define ftruncate(f,l) ftruncate64(f,l) @@ -151,5 +165,9 @@ apr_status_t filepath_compare_drive(const char *path1, const char *path2, apr_po apr_status_t apr_unix_file_cleanup(void *); apr_status_t apr_unix_child_file_cleanup(void *); +apr_status_t apr_file_flush_locked(apr_file_t *thefile); +apr_status_t apr_file_info_get_locked(apr_finfo_t *finfo, apr_int32_t wanted, + apr_file_t *thefile); + #endif /* ! FILE_IO_H */ From 523568905867be4b9b0780d05ae5a78d07a4a71b Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Wed, 16 May 2007 00:17:03 +0000 Subject: [PATCH 5817/7878] Add apr_array_clear() API. * include/apr_tables.h * tables/apr_tables.c (apr_array_clear): Declare and define new API. * test/testtable.c (a1): Static variable for use across array tests. (array_clear): New test for apr_array_clear(). (testtable): Add array_clear() to the test suite. Submitted By: Daniel Rall git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@538391 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 8 ++++++++ tables/apr_tables.c | 5 +++++ test/testtable.c | 11 +++++++++++ 3 files changed, 24 insertions(+) diff --git a/include/apr_tables.h b/include/apr_tables.h index b16b66cd137..8f0d9ddbead 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -147,6 +147,14 @@ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr); */ APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr); +/** + * Remove all elements from an array. + * @param arr The array to remove all elements from. + * @remark As the underlying storage is allocated from a pool, no + * memory is freed by this operation, but is available for reuse. + */ +APR_DECLARE(void) apr_array_clear(apr_array_header_t *arr); + /** * Concatenate two arrays together * @param dst The destination array, and the one to go first in the combined diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 90fcaf88794..43a0794b145 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -90,6 +90,11 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, return res; } +APR_DECLARE(void) apr_array_clear(apr_array_header_t *arr) +{ + arr->nelts = 0; +} + APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr) { if (apr_is_empty_array(arr)) { diff --git a/test/testtable.c b/test/testtable.c index d377eaf5a15..90dc8d2ed29 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -30,8 +30,18 @@ #include #endif +static apr_array_header_t *a1 = NULL; static apr_table_t *t1 = NULL; +static void array_clear(abts_case *tc, void *data) +{ + a1 = apr_array_make(p, 2, sizeof(const char *)); + APR_ARRAY_PUSH(a1, const char *) = "foo"; + APR_ARRAY_PUSH(a1, const char *) = "bar"; + apr_array_clear(a1); + ABTS_INT_EQUAL(tc, 0, a1->nelts); +} + static void table_make(abts_case *tc, void *data) { t1 = apr_table_make(p, 5); @@ -174,6 +184,7 @@ abts_suite *testtable(abts_suite *suite) { suite = ADD_SUITE(suite) + abts_run_test(suite, array_clear, NULL); abts_run_test(suite, table_make, NULL); abts_run_test(suite, table_get, NULL); abts_run_test(suite, table_set, NULL); From bb35a24c9eb2e10582b5f27215d22be8eb9f60e0 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Tue, 22 May 2007 02:48:44 +0000 Subject: [PATCH 5818/7878] Fix debugging messages in apr_table_addn()/apr_table_mergen(). Patch by Dr. Peter Poeml. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@540402 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 43a0794b145..9a25e366e57 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -725,7 +725,7 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, abort(); } if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) { - fprintf(stderr, "apr_table_mergen: key not in ancestor pool of t\n"); + fprintf(stderr, "apr_table_mergen: val not in ancestor pool of t\n"); abort(); } } @@ -794,7 +794,7 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, abort(); } if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) { - fprintf(stderr, "apr_table_addn: key not in ancestor pool of t\n"); + fprintf(stderr, "apr_table_addn: val not in ancestor pool of t\n"); abort(); } } From 56e3abc1c695808a2207a998237692d0e3f1907c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 25 May 2007 14:13:30 +0000 Subject: [PATCH 5819/7878] Synch with 1.2.x branch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@541663 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 ------- 1 file changed, 7 deletions(-) diff --git a/CHANGES b/CHANGES index efd0c5c423b..97377f4c348 100644 --- a/CHANGES +++ b/CHANGES @@ -6,9 +6,6 @@ Changes for APR 1.3.0 *) Improve thread safety of assorted file_io functions. PR 42400. [Davi Arnaut ] - *) Fix deadlock in apr_file_gets() for a file opened with both the - APR_BUFFERED and APR_XTHREAD flags. [Bojan Smojver, Joe Orton] - *) Add the apr_pollcb API as an alternative more efficient method of polling sockets, compared to apr_pollset. [Paul Querna] @@ -102,10 +99,6 @@ Changes for APR 1.3.0 *) Fix checks for alloca() support in configure. PR 13037. [Noah Misch ] - *) If apr_proc_create() fails to exec in the fork()ed child, call - _exit() not exit() to avoid running atexit()-registered functions - in the child. PR 30913. [Joe Orton] - *) Add %pm support to apr_snprintf() for printing the error string corresponding to an apr_status_t value. [Joe Orton] From d8bee2f065e15d1070e24580640e9010e8f60320 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 31 May 2007 19:09:28 +0000 Subject: [PATCH 5820/7878] Stop undefining __attribute__ for GNUC (only 2.7 and prior might be interesting, and can't think of any case where native win32 binaries would be created with such an ancient compiler.) PR: 42545 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543219 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- include/arch/win32/apr_private.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index dd3343afbfb..28c98976a71 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -113,7 +113,7 @@ #define APR_INLINE __inline #define APR_HAS_INLINE 1 -#ifndef __attribute__ +#if !defined(__GNUC__) && !defined(__attribute__) #define __attribute__(__x) #endif diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 0dc5f989634..8bf9f38b16d 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -114,8 +114,6 @@ #define SIGWINCH 30 #define SIGIO 31 -#define __attribute__(__x) - /* APR COMPATABILITY FUNCTIONS * This section should be used to define functions and * macros which are need to make Windows features look From aab27f036815cc36af60910756440202511c3813 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 31 May 2007 21:58:26 +0000 Subject: [PATCH 5821/7878] APR_VOID_P_IS_QUAD is not defined anywhere and the usual way is using APR_SIZEOF_VOIDP. PR: 40758 Submitted by: Davi Arnaut git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543274 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index a8b5db5938a..bd39663ba58 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -1120,7 +1120,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), * don't handle "%p". */ case 'p': -#ifdef APR_VOID_P_IS_QUAD +#if APR_SIZEOF_VOIDP == 8 if (sizeof(void *) <= sizeof(u_widest_int)) { ui_quad = (u_widest_int) va_arg(ap, void *); s = conv_p2_quad(ui_quad, 4, 'x', From 77c1b6f60dc467455168711925554fbaec1870cf Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 31 May 2007 22:08:44 +0000 Subject: [PATCH 5822/7878] Suppress warning of unused static function. PR: 39868 Submitted by: Curt Arnold git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543279 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 5a909eb1d52..1a20638e159 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -201,6 +201,7 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, return APR_SUCCESS; } +#ifndef _WIN32_WCE static apr_status_t attr_cleanup(void *theattr) { apr_procattr_t *attr = (apr_procattr_t *)theattr; @@ -209,6 +210,7 @@ static apr_status_t attr_cleanup(void *theattr) attr->user_token = NULL; return APR_SUCCESS; } +#endif APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, const char *username, From 92ce980d2d903a5b7cdd69c3288034d31262461f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 31 May 2007 22:29:06 +0000 Subject: [PATCH 5823/7878] SetHandleInformation is not supported on WinCE, but the Win 9x code path works fine if enabled (testsockets passes). Modifes the #if's so the Win9x code path is also used for WinCE. PR: 39859 Submitted by: Curt Arnold git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543286 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index fa68ce6b2f4..408e9d05bdf 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -114,7 +114,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, * purposes, always transform the socket() created as a non-inherited * handle */ -#if APR_HAS_UNICODE_FS +#if APR_HAS_UNICODE_FS && !defined(_WIN32_WCE) IF_WIN_OS_IS_UNICODE { /* A different approach. Many users report errors such as * (32538)An operation was attempted on something that is not @@ -129,7 +129,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, HANDLE_FLAG_INHERIT, 0); } #endif -#if APR_HAS_ANSI_FS +#if APR_HAS_ANSI_FS || defined(_WIN32_WCE) ELSE_WIN_OS_IS_ANSI { HANDLE hProcess = GetCurrentProcess(); HANDLE dup; From a094a32079c790527b581d30449f3a5350de91e9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 31 May 2007 22:41:44 +0000 Subject: [PATCH 5824/7878] Mingw specific defines: ULL/LL [unsigned long long] for 64bits types pid_t is already defined PR: 33490/attachment 18103 Submitted by: Curt Arnold Reviewed by: Davi Arnaut git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543292 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index 28c98976a71..d00686e6c59 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -359,15 +359,21 @@ typedef int apr_socklen_t; /* XXX These simply don't belong here, perhaps in apr_portable.h * based on some APR_HAVE_PID/GID/UID? */ +#ifndef __GNUC__ typedef int pid_t; +#endif typedef int uid_t; typedef int gid_t; /* Mechanisms to properly type numeric literals */ +#ifndef __GNUC__ #define APR_INT64_C(val) (val##i64) #define APR_UINT64_C(val) (val##Ui64) - +#else +#define APR_INT64_C(val) (val##LL) +#define APR_UINT64_C(val) (val##ULL) +#endif #if APR_HAVE_IPV6 From 5748f5aeb9938f6e36cea4305338484d07c5c544 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 31 May 2007 23:03:53 +0000 Subject: [PATCH 5825/7878] Borland specific define for LOGON32_LOGON_NETWORK PR: 33490/attachment 18106 Submitted by: Curt Arnold Reviewed by: Davi Arnaut git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543304 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 1a20638e159..0092faeb499 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -32,6 +32,10 @@ #include #endif +#ifndef LOGON32_LOGON_NETWORK +#define LOGON32_LOGON_NETWORK 3 +#endif + #ifdef _WIN32_WCE #ifndef DETACHED_PROCESS #define DETACHED_PROCESS 0 From 0a855d70fafc3197e61c973accc38787d7769735 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 31 May 2007 23:45:51 +0000 Subject: [PATCH 5826/7878] WinCE exception to deal with local code page (in unicode, no less) PR: 39852 Submitted by: Curt Arnold git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543313 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/charset.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/misc/win32/charset.c b/misc/win32/charset.c index d54d6e645c7..41135b25d90 100644 --- a/misc/win32/charset.c +++ b/misc/win32/charset.c @@ -27,15 +27,27 @@ APR_DECLARE(const char*) apr_os_default_encoding (apr_pool_t *pool) APR_DECLARE(const char*) apr_os_locale_encoding (apr_pool_t *pool) { +#ifdef _UNICODE + int i; +#endif +#if defined(_WIN32_WCE) + LCID locale = GetUserDefaultLCID(); +#else LCID locale = GetThreadLocale(); +#endif int len = GetLocaleInfo(locale, LOCALE_IDEFAULTANSICODEPAGE, NULL, 0); - char *cp = apr_palloc(pool, len + 2); - if (0 < GetLocaleInfo(locale, LOCALE_IDEFAULTANSICODEPAGE, cp + 2, len)) + char *cp = apr_palloc(pool, (len * sizeof(TCHAR)) + 2); + if (0 < GetLocaleInfo(locale, LOCALE_IDEFAULTANSICODEPAGE, (TCHAR*) (cp + 2), len)) { /* Fix up the returned number to make a valid codepage name of the form "CPnnnn". */ cp[0] = 'C'; cp[1] = 'P'; +#ifdef _UNICODE + for(i = 0; i < len; i++) { + cp[i + 2] = (char) ((TCHAR*) (cp + 2))[i]; + } +#endif return cp; } From 8ea06cb160c205ad94ebc4b7cc9d19f49702987e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 31 May 2007 23:55:21 +0000 Subject: [PATCH 5827/7878] The attached patch modifies include/arch/win32/apr_private.h so that on WinCE strtol is used instead of strtoi and that APR_INT64_STRFN is not defined. PR: 39884 Submitted by: Curt Arnold git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543320 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_private.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 8bf9f38b16d..e2738891b3e 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -143,7 +143,7 @@ APR_DECLARE_DATA int errno; #endif /* MSVC 7.0 introduced _strtoi64 */ -#if _MSC_VER >= 1300 && _INTEGRAL_MAX_BITS >= 64 +#if _MSC_VER >= 1300 && _INTEGRAL_MAX_BITS >= 64 && !defined(_WIN32_WCE) #define APR_INT64_STRFN _strtoi64 #endif @@ -154,8 +154,12 @@ APR_DECLARE_DATA int errno; #define APR_OFF_T_STRFN apr_strtoi64 #endif #else +#if defined(_WIN32_WCE) +#define APR_OFF_T_STRFN strtol +#else #define APR_OFF_T_STRFN strtoi #endif +#endif /* used to check for DWORD overflow in 64bit compiles */ #define APR_DWORD_MAX 0xFFFFFFFFUL From 3132c2b59f0676b51806b9865f4b712cba1a1f3c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Jun 2007 00:00:13 +0000 Subject: [PATCH 5828/7878] Eliminate for WinCE the special handling of program files ending in ".bat" or ".cmd" and falls through to the general case. There is no COMSPEC on WinCE (no getenv either) and no command line shell. PR: 39869 Submitted by: Curt Arnold Reviewed by: Davi Arnaut git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543324 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 0092faeb499..3f48d15e9a8 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -505,6 +505,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, else #endif { +#if defined(_WIN32_WCE) + { +#else /* Win32 is _different_ than unix. While unix will find the given * program since it's already chdir'ed, Win32 cannot since the parent * attempts to open the program with it's own path. @@ -562,6 +565,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } } else { +#endif /* A simple command we are directly invoking. Do not pass * the first arg to CreateProc() for APR_PROGRAM_PATH * invocation, since it would need to be a literal and From 428242e7f018a71a8fc330ef6d5cbe65a7ce7f88 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Jun 2007 00:05:28 +0000 Subject: [PATCH 5829/7878] apr_env_get, apr_env_set and apr_env_delete to return APR_ENOTIMPL on Windows CE. PR: 39867 Submitted by: Curt Arnold Reviewed by: Davi Arnaut git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543329 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/env.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/misc/win32/env.c b/misc/win32/env.c index e99ff8d4765..abb983d7158 100644 --- a/misc/win32/env.c +++ b/misc/win32/env.c @@ -24,8 +24,7 @@ #include "apr_pools.h" #include "apr_strings.h" - -#if APR_HAS_UNICODE_FS +#if APR_HAS_UNICODE_FS && !defined(_WIN32_WCE) static apr_status_t widen_envvar_name (apr_wchar_t *buffer, apr_size_t bufflen, const char *envvar) @@ -47,6 +46,9 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, const char *envvar, apr_pool_t *pool) { +#if defined(_WIN32_WCE) + return APR_ENOTIMPL; +#else char *val = NULL; DWORD size; @@ -115,6 +117,7 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, *value = val; return APR_SUCCESS; +#endif } @@ -122,6 +125,9 @@ APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, const char *value, apr_pool_t *pool) { +#if defined(_WIN32_WCE) + return APR_ENOTIMPL; +#else #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { @@ -153,11 +159,15 @@ APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, #endif return APR_SUCCESS; +#endif } APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool) { +#if defined(_WIN32_WCE) + return APR_ENOTIMPL; +#else #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { @@ -181,4 +191,5 @@ APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool) #endif return APR_SUCCESS; +#endif } From b1dccafe0918d46d99da36d9fa50b4a415c22390 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Jun 2007 00:09:55 +0000 Subject: [PATCH 5830/7878] apr_proc_mutex_child_init calls unimplemented OpenMutexW and will fail to compile on Windows CE. The patch implements the expected behavior of OpenMutexW by calling CreateMutex (which will open an existing mutex or create one if it doesn't exist) and close the mutex and return an error unless CreateMutex indicated that the mutex already existed. PR: 39858 Submitted by: Curt Arnold Reviewed by: Davi Arnaut git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543333 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/proc_mutex.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 1033a1c3404..ecb6f14d486 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -98,6 +98,14 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, */ mutexkey = res_name_from_filename(fname, 1, pool); +#if defined(_WIN32_WCE) + hMutex = CreateMutex(NULL, FALSE, mutexkey); + if (hMutex && ERROR_ALREADY_EXISTS != GetLastError()) { + CloseHandle(hMutex); + hMutex = NULL; + SetLastError(ERROR_FILE_NOT_FOUND); + } +#else #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { @@ -109,6 +117,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, { hMutex = OpenMutexA(MUTEX_ALL_ACCESS, FALSE, mutexkey); } +#endif #endif if (!hMutex) { From 398e868fdf95456f099ceec8ba5117e1222266e9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Jun 2007 00:23:51 +0000 Subject: [PATCH 5831/7878] The implementation of apr_time_clock_hires calls SetTimerResolution which is not implemented on WinCE. The Unix implementation of this function is a no-op. The attached patch makes the implementation a no-op for WinCE. PR: 39857 Submitted by: Curt Arnold Reviewed by: Davi Arnaut git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543337 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/time.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/time/win32/time.c b/time/win32/time.c index c3165a72c06..6f9545c3fae 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -304,7 +304,13 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t) Sleep((DWORD)(t / 1000)); } - +#if defined(_WIN32_WCE) +/* A noop on WinCE, like Unix implementation */ +APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p) +{ + return; +} +#else static apr_status_t clock_restore(void *unsetres) { ULONG newRes; @@ -324,3 +330,4 @@ APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p) apr_pool_cleanup_null); } } +#endif From 6022055c844df8e0ea848ecc3c58aee3fc3b6857 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Jun 2007 00:27:09 +0000 Subject: [PATCH 5832/7878] SystemTimeToTzSpecificLocalTime is not implemented on Windows CE and is used in the conversion of an APR time to an expanded local time. The APR code did have fallback code for Win9x which did not call this function. The fallback code had the deficiency of using the current offset for daylight savings time, not the offset at the specified time. PR: 39856 Submitted by: Curt Arnold Reviewed by: Davi Arnaut git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543340 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/time/win32/time.c b/time/win32/time.c index 6f9545c3fae..9d2757972ed 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -139,7 +139,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, AprTimeToFileTime(&ft, input); -#if APR_HAS_UNICODE_FS +#if APR_HAS_UNICODE_FS && !defined(_WIN32_WCE) IF_WIN_OS_IS_UNICODE { TIME_ZONE_INFORMATION *tz; @@ -178,7 +178,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, - (-(tz->Bias + tz->StandardBias) / 60); } #endif -#if APR_HAS_ANSI_FS +#if APR_HAS_ANSI_FS || defined(_WIN32_WCE) ELSE_WIN_OS_IS_ANSI { TIME_ZONE_INFORMATION tz; From 55411a9c0d1df6c54c13c6e0bfb29b24b873dedf Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Jun 2007 02:32:34 +0000 Subject: [PATCH 5833/7878] include/arch/win32/apr_arch_inherit.h defines macros that are used to implement apr_mutex_inherit_set and unset and several other similar methods. The current header file will call SetHandleInformation in a block for Unicode supporting versions of Windows and has a fallback for Win 9x. The patch defines the macros as just the Win9x compatible implementation for WinCE and leaves the other definition for all other Windows variants. PR: 39886 Submitted by: Curt Arnold Reviewed by: Davi Arnaut git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543363 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_inherit.h | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/include/arch/win32/apr_arch_inherit.h b/include/arch/win32/apr_arch_inherit.h index 97c7d05d0aa..d70d5972c78 100644 --- a/include/arch/win32/apr_arch_inherit.h +++ b/include/arch/win32/apr_arch_inherit.h @@ -21,6 +21,33 @@ #define APR_INHERIT (1 << 24) /* Must not conflict with other bits */ +#if defined(_WIN32_WCE) +#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ +APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ +{ \ + HANDLE temp, hproc = GetCurrentProcess(); \ + if (!DuplicateHandle(hproc, the##name->filehand, \ + hproc, &temp, 0, TRUE, \ + DUPLICATE_SAME_ACCESS)) \ + return apr_get_os_error(); \ + CloseHandle(the##name->filehand); \ + the##name->filehand = temp; \ + return APR_SUCCESS; \ +} + +#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ +APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ +{ \ + HANDLE temp, hproc = GetCurrentProcess(); \ + if (!DuplicateHandle(hproc, the##name->filehand, \ + hproc, &temp, 0, FALSE, \ + DUPLICATE_SAME_ACCESS)) \ + return apr_get_os_error(); \ + CloseHandle(the##name->filehand); \ + the##name->filehand = temp; \ + return APR_SUCCESS; \ +} +#else #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ { \ @@ -65,5 +92,6 @@ APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ } \ return APR_SUCCESS; \ } +#endif #endif /* ! INHERIT_H */ From d63549410b47638353cc2680e7f8fea3083800ee Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Jun 2007 02:42:31 +0000 Subject: [PATCH 5834/7878] apr_app_initialize performs manipulation of environment variables (in particular converting them from Unicode to char*) whereas WinCE has no enviroment - and also updates the argv array by parsing the Unicode command line which uses the CommandLineToArgvW method which not available on WinCE. Suppress both on WinCE. PR: 39892 Submitted by: Curt Arnold Reviewed by: Davi Arnaut Forward port: 543367 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543368 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/start.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/misc/win32/start.c b/misc/win32/start.c index e15bf5d83e6..8522101e29d 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -29,6 +29,7 @@ */ int APR_DECLARE_DATA apr_app_init_complete = 0; +#if !defined(_WIN32_WCE) /* Used by apr_app_initialize to reprocess the environment * * An internal apr function to convert a double-null terminated set @@ -86,6 +87,7 @@ static int warrsztoastr(const char * const * *retarr, *retarr = newarr; return args; } +#endif /* Reprocess the arguments to main() for a completely apr-ized application */ @@ -100,7 +102,9 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, return rv; } -#if APR_HAS_UNICODE_FS +#if defined(_WIN32_WCE) + apr_app_init_complete = 1; +#elif APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { apr_wchar_t **wstrs; From 524dcaf5b1657962b5437782ed06b6d03a004923 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Jun 2007 02:46:06 +0000 Subject: [PATCH 5835/7878] Using macros defined include/arch/win32/apr_arch_misc.h to replace calls to the crtdbg malloc variants, the PR is essentially solved. Avoid using the crtdbg variants when building for Windows CE. PR: 39888 Submitted by: Curt Arnold [Note: a rollup of the original patch + this patch is needed before backporting the fix to 1.2 or 0.9 branches, something I have 0 cycles to do] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543371 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index f34c7e65c1f..874f9b10378 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -139,7 +139,7 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *); #define ELSE_WIN_OS_IS_ANSI #endif /* WINNT */ -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !defined(_WIN32_WCE) #include "crtdbg.h" static APR_INLINE void* apr_malloc_dbg(size_t size, const char* filename, From 1023f3e786858493f5333aea8dc2001ae049047a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Jun 2007 17:39:48 +0000 Subject: [PATCH 5836/7878] Explicitly call out FormatMessageA in the general case (we only return char* text) and in the WINCE case, fall into FormatMessageW and perform uglyness to transcode this into 7 bit ascii + '?' patterns for unrepresentable bytes. The right solution is to transcode to utf-8, but that's not possible while we have one fixed-size buffer to work with. Using a TLS utf-8/unicode buffer would be lovely but it's not reentrant, so defer closing PR 39895 for now (as an enhancement not a blocker). PR: 39895/Attachment Submitted by: Curt Arnold git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543549 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index e953d109279..e7c2a2ec2d5 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -247,14 +247,34 @@ static char *apr_os_strerror(char *buf, apr_size_t bufsize, apr_status_t errcode apr_size_t len=0, i; #ifndef NETWARE - len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM +#ifndef _WIN32_WCE + len = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errcode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ - (LPTSTR) buf, + buf, (DWORD)bufsize, NULL); +#else /* _WIN32_WCE speaks unicode */ + LPTSTR msg = (LPTSTR) buf; + len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + errcode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ + msg, + (DWORD) (bufsize/sizeof(TCHAR)), + NULL); + /* in-place convert to US-ASCII, substituting '?' for non ASCII */ + for(i = 0; i <= len; i++) { + if (msg[i] < 0x80 && msg[i] >= 0) { + buf[i] = (char) msg[i]; + } else { + buf[i] = '?'; + } + } +#endif #endif if (!len) { From e00b130a97bbddfc041f40b19c4c9715e466b912 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Jun 2007 17:58:04 +0000 Subject: [PATCH 5837/7878] Register a cleanup only if APR_FILE_NOCLEANUP was not flagged. Submitted by: Brian J. France Reviewed by: wrowe, bojan git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543555 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/mktemp.c | 9 ++++++--- file_io/unix/mktemp.c | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/file_io/netware/mktemp.c b/file_io/netware/mktemp.c index 745eff78464..2a71af7d6db 100644 --- a/file_io/netware/mktemp.c +++ b/file_io/netware/mktemp.c @@ -41,9 +41,12 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i if ((rv = apr_file_open(fp, template, flags|APR_FILE_NOCLEANUP, APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) { - apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), - apr_unix_file_cleanup, - apr_unix_child_file_cleanup); + + if (!(flags & APR_FILE_NOCLEANUP)) { + apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), + apr_unix_file_cleanup, + apr_unix_child_file_cleanup); + } } return rv; diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 8ac2f91bf6e..22e0bd5d3a4 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -202,9 +202,11 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i apr_os_file_put(fp, &fd, flags, p); (*fp)->fname = apr_pstrdup(p, template); - apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), - apr_unix_file_cleanup, - apr_unix_child_file_cleanup); + if (!(flags & APR_FILE_NOCLEANUP)) { + apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), + apr_unix_file_cleanup, + apr_unix_child_file_cleanup); + } #endif return APR_SUCCESS; } From 794776d42c3f13568617afb8452edcfe8ea258be Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Jun 2007 22:01:38 +0000 Subject: [PATCH 5838/7878] Don't invoke testshm* binaries from make test PR: 32972 Submitted by: Kurt Miller Reviewed by: wrowe, pquerna git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543632 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 373c710722b..dfd925e971e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -12,14 +12,15 @@ VPATH = @srcdir@ STDTEST_PORTABLE = \ testlockperf@EXEEXT@ \ - testshmproducer@EXEEXT@ \ - testshmconsumer@EXEEXT@ \ testmutexscope@EXEEXT@ \ testall@EXEEXT@ -OTHER_PROGRAMS = sendfile@EXEEXT@ \ - echod@EXEEXT@ \ - sockperf@EXEEXT@ +OTHER_PROGRAMS = \ + sendfile@EXEEXT@ \ + testshmproducer@EXEEXT@ \ + testshmconsumer@EXEEXT@ \ + echod@EXEEXT@ \ + sockperf@EXEEXT@ PROGRAMS = $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS) From 403e2355515d0b90eee774c5007ad1453f006036 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 1 Jun 2007 22:16:58 +0000 Subject: [PATCH 5839/7878] Apparently xcompiles on unix are depending on lower case names, and of course these includes are case sensitive. PR: 41916/patch segment 3/4 Submitted by: Kouhei Sutou git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543642 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/start.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/win32/start.c b/misc/win32/start.c index 8522101e29d..6be557e029c 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -18,7 +18,7 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_signal.h" -#include "ShellAPI.h" +#include "shellapi.h" #include "apr_arch_misc.h" /* for WSAHighByte / WSALowByte */ #include "wchar.h" From f9f0e3c51cfd134e81f9675aa90c737594e9b41e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 4 Jun 2007 19:58:36 +0000 Subject: [PATCH 5840/7878] Notes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@544229 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 97377f4c348..3ccfabef9d3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,19 @@ Changes for APR 1.3.0 + *) Stop invoking the testshm* helpers upon 'make test' invocation. + [Kurt Miller ] + + *) Register a cleanup only if APR_FILE_NOCLEANUP was not flagged in + apr_file_mktemp. [Brian J. France ] + + *) Numerous build fixes for non-GCC builds and GCC builds on Win32, + as well as WinCE builds. [Davi Arnaut , + Curt Arnold , John Mark Vandenberg, + Kouhei Sutou , William Rowe] + *) Discard file buffers when running cleanups for exec. PR 41119. [Davi Arnaut , Bojan Smojver] - + *) Improve thread safety of assorted file_io functions. PR 42400. [Davi Arnaut ] From d3f116b2263901d27e54e57a125a1327a00bbde5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 4 Jun 2007 22:01:31 +0000 Subject: [PATCH 5841/7878] Modulo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@544307 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 120cdd3585a..9db685e7d42 100644 --- a/STATUS +++ b/STATUS @@ -3,7 +3,8 @@ Last modified at [$Date$] Releases: 1.3.0 : in development - 1.2.9 : in development + 1.2.10 : in maintenance + 1.2.9 : tagged June 4, 2007 1.2.8 : released December 4, 2006 1.2.7 : released April 14, 2006 1.2.6 : released March 25, 2006 @@ -18,7 +19,8 @@ Releases: 1.1.0 : released January 25, 2005 1.0.1 : released November 19, 2004 1.0.0 : released September 1, 2004 - 0.9.14 : in development + 0.9.15 : in maintenance + 0.9.14 : tagged June 4, 2007 0.9.13 : released December 4, 2006 0.9.12 : released April 13, 2006 0.9.11 : released March 30, 2006 From 159dbc193de29a13951dd6383a5610498d234be8 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 26 Jun 2007 17:46:56 +0000 Subject: [PATCH 5842/7878] * define the _HPUX_SOURCE feature test macro to obtain maximum functionality The sendfile function was being used without being declared, because the _XOPEN_SOURCE_EXTENDED macro doesn't bring sendfile (and fixups) into the namespace. Checked and passes sendfile tests on: HP-UX 11i 11.11 PA-RISC 8700 HP-UX 11i v3 Itanium II PR: 42261 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@550877 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index b2f8ea6575a..02de2b550f2 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -102,7 +102,7 @@ if test "x$apr_preload_done" != "xyes" ; then APR_ADDTO(CPPFLAGS, [-DHIUX]) ;; *-hp-hpux11.*) - APR_ADDTO(CPPFLAGS, [-DHPUX11 -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED]) + APR_ADDTO(CPPFLAGS, [-DHPUX11 -D_REENTRANT -D_HPUX_SOURCE]) ;; *-hp-hpux10.*) case $host in From ab28dd04bc5e45fd6bced57c1a669a1ce2ef2250 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 26 Jun 2007 17:53:21 +0000 Subject: [PATCH 5843/7878] Sync up changes of r550877 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@550879 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 3ccfabef9d3..ea87ee11eba 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes for APR 1.3.0 + *) Define the _HPUX_SOURCE feature test macro to obtain maximum + functionality. + PR 42261. [Davi Arnaut] + *) Stop invoking the testshm* helpers upon 'make test' invocation. [Kurt Miller ] From 92ac8187b72c3f6b7e3373158983b430c4dc2d64 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 15:03:14 +0000 Subject: [PATCH 5844/7878] Define SEM_FAILED if it isn't already defined, as the proc mutex code already does it. Also search for the sem_open function in the realtime library. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551917 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ configure.in | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGES b/CHANGES index ea87ee11eba..759c5942878 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes for APR 1.3.0 + *) Define SEM_FAILED if it isn't already defined, as the proc mutex + code already does it. Also search for the sem_open function in + the realtime library. (This fixes HP-UX sem_open detection). + [Davi Arnaut] + *) Define the _HPUX_SOURCE feature test macro to obtain maximum functionality. PR 42261. [Davi Arnaut] diff --git a/configure.in b/configure.in index ce72af512e1..3705622b205 100644 --- a/configure.in +++ b/configure.in @@ -1594,6 +1594,7 @@ echo "${nl}Checking for Locking..." AC_CHECK_FUNCS(semget semctl flock) AC_CHECK_HEADERS(semaphore.h OS.h) +AC_SEARCH_LIBS(sem_open, rt) AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait create_sem) # Some systems return ENOSYS from sem_open. @@ -1603,6 +1604,9 @@ AC_TRY_RUN([ #include #include #include +#ifndef SEM_FAILED +#define SEM_FAILED (-1) +#endif main() { sem_t *psem; @@ -1613,6 +1617,11 @@ main() exit(1); } sem_close(psem); + psem = sem_open(sem_name, O_CREAT | O_EXCL, 0644, 1); + if (psem != (sem_t *)SEM_FAILED) { + sem_close(psem); + exit(1); + } sem_unlink(sem_name); exit(0); }], [ac_cv_func_sem_open=yes], [ac_cv_func_sem_open=no], From cbea2c44252307650cc737be36f94f8adc8fa99f Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 15:08:15 +0000 Subject: [PATCH 5845/7878] The use of O_EXCL does help, better fail then use a semaphore not owned by the caller. The O_EXCL flag guarantees the open will fail if the named semaphore already exists and if it fails with EEXIST, a new semaphore name is tried. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551921 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 841ad6bd85f..c6fdcd918a9 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -79,23 +79,22 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, * implementation. Versions previous to Darwin 6.2 had the 14 * char limit, but later rev's allow up to 31 characters. * - * FIXME: There is a small window of opportunity where - * instead of getting a new semaphore descriptor, we get - * a previously obtained one. This can happen if the requests - * are made at the "same time" and in the small span of time between - * the sem_open and the sem_unlink. Use of O_EXCL does not - * help here however... - * */ now = apr_time_now(); sec = apr_time_sec(now); usec = apr_time_usec(now); apr_snprintf(semname, sizeof(semname), "/ApR.%lxZ%lx", sec, usec); - psem = sem_open(semname, O_CREAT, 0644, 1); - if ((psem == (sem_t *)SEM_FAILED) && (errno == ENAMETOOLONG)) { - /* Oh well, good try */ - semname[13] = '\0'; - psem = sem_open(semname, O_CREAT, 0644, 1); + psem = sem_open(semname, O_CREAT | O_EXCL, 0644, 1); + if ((psem == (sem_t *)SEM_FAILED)) { + if (errno == ENAMETOOLONG) { + /* Oh well, good try */ + semname[13] = '\0'; + } else if (errno == EEXIST) { + apr_snprintf(semname, sizeof(semname), "/ApR.%lxZ%lx", usec, sec); + } else { + return errno; + } + psem = sem_open(semname, O_CREAT | O_EXCL, 0644, 1); } if (psem == (sem_t *)SEM_FAILED) { From 7f02efe54aba5c7608e23b7f19ebe337ba55e39c Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 15:11:32 +0000 Subject: [PATCH 5846/7878] Early assignment of the to-be-converted number yields better code and avoids ugly casts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551922 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index bd39663ba58..478e11263e1 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -343,10 +343,9 @@ static char *conv_10(register wide_int num, register bool_int is_unsigned, register apr_size_t *len) { register char *p = buf_end; - register u_wide_int magnitude; + register u_wide_int magnitude = num; if (is_unsigned) { - magnitude = (u_wide_int) num; *is_negative = FALSE; } else { @@ -363,11 +362,8 @@ static char *conv_10(register wide_int num, register bool_int is_unsigned, */ if (*is_negative) { wide_int t = num + 1; - magnitude = ((u_wide_int) -t) + 1; } - else - magnitude = (u_wide_int) num; } /* @@ -390,20 +386,19 @@ static char *conv_10_quad(widest_int num, register bool_int is_unsigned, register apr_size_t *len) { register char *p = buf_end; - u_widest_int magnitude; + u_widest_int magnitude = num; /* * We see if we can use the faster non-quad version by checking the * number against the largest long value it can be. If <=, we * punt to the quicker version. */ - if (((u_widest_int)num <= (u_widest_int)ULONG_MAX && is_unsigned) + if ((magnitude <= ULONG_MAX && is_unsigned) || (num <= LONG_MAX && num >= LONG_MIN && !is_unsigned)) return(conv_10( (wide_int)num, is_unsigned, is_negative, buf_end, len)); if (is_unsigned) { - magnitude = (u_widest_int) num; *is_negative = FALSE; } else { @@ -420,11 +415,8 @@ static char *conv_10_quad(widest_int num, register bool_int is_unsigned, */ if (*is_negative) { widest_int t = num + 1; - magnitude = ((u_widest_int) -t) + 1; } - else - magnitude = (u_widest_int) num; } /* From dd9d2455a979df1c0b28cec8f2069b2223490042 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 15:17:09 +0000 Subject: [PATCH 5847/7878] Binary size apr_vformatter as bytes, K, M, T, etc, to a four character compacted human readable form. Based upon apr_strfsize. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551923 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 3 +++ strings/apr_snprintf.c | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/include/apr_lib.h b/include/apr_lib.h index 8b43b9402ba..bae677ba565 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -121,6 +121,9 @@ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); * %%pm takes an apr_status_t * and prints the appropriate error * string (from apr_strerror) corresponding to that error code. * %%pp takes a void * and outputs it in hex + * %%pB takes a apr_uint32_t * as bytes and outputs it's apr_strfsize + * %%pF same as above, but takes a apr_off_t * + * %%pS same as above, but takes a apr_size_t * * * %%pt is only available from APR 1.2.0 onwards. * %%pm is only available from APR 1.3.0 onwards. diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 478e11263e1..5710c73c1de 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -1239,6 +1239,32 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), #endif break; + case 'B': + case 'F': + case 'S': + { + char buf[5]; + apr_off_t size = 0; + + if (*fmt == 'B') { + apr_uint32_t *arg = va_arg(ap, apr_uint32_t *); + size = (arg) ? *arg : 0; + } + else if (*fmt == 'F') { + apr_off_t *arg = va_arg(ap, apr_off_t *); + size = (arg) ? *arg : 0; + } + else { + apr_size_t *arg = va_arg(ap, apr_size_t *); + size = (arg) ? *arg : 0; + } + + s = apr_strfsize(size, buf); + s_len = strlen(s); + pad_char = ' '; + } + break; + case NUL: /* if %p ends the string, oh well ignore it */ continue; From 352c882731fbc618563fe987284a9cbdb8322385 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 15:19:42 +0000 Subject: [PATCH 5848/7878] Add apr_table_copy() warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551924 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr_tables.h b/include/apr_tables.h index 8f0d9ddbead..11213a5492c 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -226,6 +226,7 @@ APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts); * @param p The pool to allocate the new table out of * @param t The table to copy * @return A copy of the table passed in + * @warning The table keys and respective values are not copied */ APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, const apr_table_t *t); From 47fd76b461134efb065555df15954da091bcc2ab Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 16:25:13 +0000 Subject: [PATCH 5849/7878] Update @remark to reflect the availability of the extensions. Noticed by Jim Jagielski. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551943 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index bae677ba565..e09122e70a9 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -126,7 +126,7 @@ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); * %%pS same as above, but takes a apr_size_t * * * %%pt is only available from APR 1.2.0 onwards. - * %%pm is only available from APR 1.3.0 onwards. + * %%pm, %%pB, %%pF and %%pS are only available from APR 1.3.0 onwards. * * The %%p hacks are to force gcc's printf warning code to skip * over a pointer argument without complaining. This does From dd85397dcb562f68c714f6689720adab69a254e1 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 16:48:14 +0000 Subject: [PATCH 5850/7878] Note that APR_POLL_LASTDESC is deprecated. PR: 41348 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551952 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index 4e299ee5774..92a540a95e6 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -62,7 +62,7 @@ typedef enum { APR_NO_DESC, /**< nothing here */ APR_POLL_SOCKET, /**< descriptor refers to a socket */ APR_POLL_FILE, /**< descriptor refers to a file */ - APR_POLL_LASTDESC /**< descriptor is the last one in the list */ + APR_POLL_LASTDESC /**< @deprecated descriptor is the last one in the list */ } apr_datatype_e ; /** Union of either an APR file or socket. */ From 52486d5d7a7e2f77dc8c57f30ec14f0611c98e60 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 16:53:54 +0000 Subject: [PATCH 5851/7878] Remove the images directory, a left over of the ScanDoc removal (r62145, r62158) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551956 13f79535-47bb-0310-9956-ffa450edef68 --- images/ScanDocBig.jpg | Bin 5319 -> 0 bytes images/ScanDocSmall.jpg | Bin 2382 -> 0 bytes images/ball1.gif | Bin 1012 -> 0 bytes images/ball1.png | Bin 499 -> 0 bytes images/ball2.gif | Bin 1014 -> 0 bytes images/ball2.png | Bin 436 -> 0 bytes images/bug.gif | Bin 1040 -> 0 bytes images/bug.png | Bin 383 -> 0 bytes images/caution.gif | Bin 923 -> 0 bytes images/caution.png | Bin 217 -> 0 bytes images/master.gif | Bin 3955 -> 0 bytes images/master.png | Bin 3371 -> 0 bytes images/tip.gif | Bin 1018 -> 0 bytes images/tip.png | Bin 331 -> 0 bytes images/warning.gif | Bin 923 -> 0 bytes images/warning.png | Bin 217 -> 0 bytes 16 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 images/ScanDocBig.jpg delete mode 100644 images/ScanDocSmall.jpg delete mode 100644 images/ball1.gif delete mode 100644 images/ball1.png delete mode 100644 images/ball2.gif delete mode 100644 images/ball2.png delete mode 100644 images/bug.gif delete mode 100644 images/bug.png delete mode 100644 images/caution.gif delete mode 100644 images/caution.png delete mode 100644 images/master.gif delete mode 100644 images/master.png delete mode 100644 images/tip.gif delete mode 100644 images/tip.png delete mode 100644 images/warning.gif delete mode 100644 images/warning.png diff --git a/images/ScanDocBig.jpg b/images/ScanDocBig.jpg deleted file mode 100644 index 2c47fbc18a370e2e834c976beabbea29686a5efe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5319 zcmb7IXHXMNw@&E26O`TpFCbE-h=6nw#7GH9LJ{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LF2zvvHxZDKTM13ss92| C{__w3 diff --git a/images/ScanDocSmall.jpg b/images/ScanDocSmall.jpg deleted file mode 100644 index a10964aa1331c65ee1e06e20a4eb8c1eede4cc87..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2382 zcmb7=dpy&N8^^!1ixJi^%YB8INx4*Xj+2qgrre_tXO&-3)MUm==Om(E4l~R-GQ#GP z<`$!sOKHa~m0N6@TnRD#B=U`n8cXlqr*I7eD{F_S%tG0qHs~Mhzfb@Q10W!HNjDiVM|Rd-sz)OM-k9lXfB1{sAlPrW~XL0OV+j7vp;5?F>r%3_Cs z)fII=1b@Vg``$0>Kw>tQXagVuvH=$KY`qa27m(nc!63Av+z0Mv|I9m7at8H^Vuv^* z0ZD<3Z`qD-#g|Msu$S*OmT)_403CF*>Do2ZyKdA*p`uB{`i9R-^t0RE;GD$H&*`0C zOLW8{e)*<=Cx~dVujS}BJ6%kAoXIF0oip3>Q&Vo2$G7Pmb8EX#WD3Y@(+8_={U1UmJp3BI)AF&x@>EwW=fcZOsY_<~F@9 z=v=T&&|lx^o5nqRQis0SX)%8I=31#T>Wd+ECjpaS316wI6A<4sY#6I^~x^AevKyI_cAj=9Exg7K{-tp<}x zxCP?edl zr<7jDY_0nmMT_<<&QoFIc#_ADv(LN>I#(5EAI{B>xz#_TZ9{(}SY#ipUSM`EI%i{G%by`*5GxPDaZTod3=4qqOQXtC}BX|6#L z0eLsM^-kShZ|nZTQMeVXY-RIvk&+FgWW0&VPTNJjd#8)`bH7TO0@)Ghwd%XapN;u- z)APMw7csMZGdmEm7)kGxa9pTp|Hk;r564UlQpoP-PX=e!!8w+c{V81*P3(@#xO7$W z8x9^Kr-EO!9!x2z;*ew?bxAt%;KaGg?k`0BE ze=^_g*jgFP37#NEIr!YjH=L{@0#k)rMY*5We#-&9UvB5x#W;GJ&X#6hVl;bWNSMsQ zW0LqM&4bh`yE(1;x?`mHaGXX;SGDcic@+Y^xkrGl<16mV`!dGH8S6!l_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esrT@UI z_VGm`%CW|Tq7=5@fZ5*J6*|SGmlR0yA7*JR!cmIB^^M7X8PJZmhmzUvqH1 z^86?Io!>fFUmqSmp174vOf9;<#OltpNXJ%eWv6bwxOp&7VZAqyuytHFW%G!G4brncmtZNpnQ;?N(Vuvfh!zi@)8i~Q`d1Q#V-;2;D>1@Wk=rNF&$-uT$~%>WFRvJboe25Q)}l8 zYmX)=LO5)AeY0Zmd{JGD-|i@dWz>ZR@l^w)=6Eb2e5Mel7^NufBO*;iilQVz36D#J6fbaykZg}dgcS3bM3^KWfV_!**bJFO znl(_)0BOpkNDfIyS)F*~K%+WA5s=cJRKf~yNO4FO<0Q#RqL|zWkQQ+L;+E@+X|5;k zr$Jl;r?tGo2Bn zP$`m|MHzw8lSl!HXJ=7HpooSjm9(@#8bgW}phWYiIf14;wykWzNvbl0Z{Z~7Ak#v6BB0ttBB}%t7ja(2_P@V#Xjw^VsC--Wb5~i##&EcEN$-U(=WCC(bPNs9@y8c8omkoTn!M95 zm+U**exvJITf_CMPlqZGbUsO_Q7wrel0(9ula55+DpH8 zU+MWc+`6ai;8uIho3X)9cf)7vZ_bbQb&Sk>_-gGP>v`3G{O`i-hMfaPOm6q@STr2% zn{ItrQ|ER!pEUll=z|wk6LVHMOV>~T9IsBbT^l*Qd9*tju6Z;PaahxePzW0T0|OO! AqyPW_ diff --git a/images/ball1.png b/images/ball1.png deleted file mode 100644 index 311d4b3fa7a38ff77d5b8d10adace33143acee99..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 499 zcmWNMO=#0l0LPyWjd)pzNI_Wd{wdwdq<*Xt(*qu^Dic90p5qVg|($ zoWqD9^E)VtMRCM~IAKEYAQY>$XmJ};DAOG(wyt`q)We?d$Nz)>@jo4l20g9YTLA!` z&{4m_dK+^)Y++e3+upNUi1oz-wrx|YQA+3>q7Dz1Li5TfQq!p27BY{UqgsK7M87SyLvVh2>0;~Wm z0zn0W3^)xS3=lu@R-Ir6H=GIw{YSj7n!ng6g#3r&=e|S=XVgqj+vXKtHF+{|sCvgC zzjONCwecr=zf&5T-QSsi+?(HFrmpXtilqkj)P|+xvMaYQb-|I2rF4GN>iG+?{y+Yn zEAtP6!KuLy+KYd6eDJh6e=iw$9o#xvl5STo?|ygf)|+N+`o^rUBe2X5k%x(6msTn> zoiE2)!atgcNaOhPualmOB{cT*)4s^r^!-&do@q?F>+6FBpF$+?am(n4_ffnbmBQH* nLswIu`+i0bbbsq^bX9t9rp*QK+Q7!zF7^wA0#W}nX*lyAUsB7^ diff --git a/images/ball2.gif b/images/ball2.gif deleted file mode 100644 index 9adc11c6473fac16d23a998033587fcd15b834b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1014 zcmYk*Pe>F|9KiA4%A!v<;;mUsq13<ryh=SXsN z8^oao;Qv=HEGu$F8DHl_j;~9OEFETtS=lV-x{@U`i))gbHv^_@$g3e^sVo&eL(t1> zoa-UBy1{v&LY@V3J`0#RCTKozHG)(hxQ)<~tpLbwVhAslc+s(=F!qafso5x^55x{w4CV3aTlCgTiO(z75j(2*)J8#qfa zfFU9PFaXUK4A25e&;lxG2rmGrcE|!18G;TfVuAu{fPhLsF$4t^gsVUekdi==7NS4} z!T{lGf1(k9D751Y{7(S+0*xdw^5OKOj#T}=OBZQr``(et=J30L(dCA-mDzY=JpN{? zZn_IfDX(>A{^QBzfluT?N4&r3`ok;VXQQ$C?!>{ldwT{CeJi9Bk@eEE<{S0ZT6^!{ z?UB;v`6tyMi({`Ry4otQWD7fZ|^+sd%87pUw?UGs-^i?Q~S}nhUxg&?pR;<iy*Kt(M9{=T8qBqft2a4{r%bBme*a diff --git a/images/ball2.png b/images/ball2.png deleted file mode 100644 index cac3c07ab113a627c1a7d471636a9833d6b15376..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 436 zcmV;l0ZaagP)?rLX6Ha*6%T`r7@iUF1lJ_s(OBMc^PWkY^$h{ayqd<4<5qodVAbu z9MrRka9Khc+EVVId`KJ(0OL*v2Sdpb+0l)e#} zzhI_jV#a3VQ3w{)f>>Y+W`c7_kuo zXhRxWXht>p9Df>uguo$?k42;!RDyC)atb6xgGdk#LJoym*1!^&0}~k08b||4AP$77 zpoSQrK?yA6Fc{j9h8CL17xEZSR9TgLKa52rqQWZV>w*GF7G+i@Y!4{ZDv1&+VLkW( zOmxEz><Ty|ZPDLh> zOb*2}Bahw{yuQAnV|4C!Ch;m2-*sZ^a2_2Vh_y`5cXg+eXD8b-TQ(MbO(m0UGc#S4 z@s{4n@yyZgx7)AXUK=Z^pUeJor0r8}-|Fzvo0nDXH~Z=e3hz`u$#0L}J(GU8bSrm? z4*XcHNDf^}Y`oERT_&|EOGvN(QxARaqk_aS|*erm_B_{ZdhlkX>X=5*vA8(nUl v7|gj+a<%_rnkqMykD{|pGs1VIo2f;1qU zX>1H6fUGnyPD?We!Zc%`D3Acr#>Na_Xv_el85sQe&u;@#j7i?^F5=wRX7mF&hdo^! zLn>~S23{9BWWZC*Fg0+hfaC4||AR%`9$HP>Z4+^=K*rF%r*|`J!0WGNi{np3*2`ot zl}M#0iD+iZOl|(-rr_ONB=2=GW2L{O=354)+LxhhN}tTl&-jLENv%=a=NfR|+1X>+ z7k-~@oGYeyy)bQcea*L7=G6A1`Jav{N~~Rc??j$`@0V9!ZhPLWJCd_!R;vwj48yte zwe7c0ZMT*xcstGh^`_%JKb_umm3VGsh;d->W`Dov)*1#gi@31wT>rk>GYbFUI-zNr y{t@UMu@cva66gHf+|;}h2H(V#RE6@)k_-iRPv3yLRN1LO6%3xPelF{r5}E)JCzlQY diff --git a/images/caution.gif b/images/caution.gif deleted file mode 100644 index 39bac17027fb9519cadf8821790bcd5df31096c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 923 zcmchWv1`71uGqdf_ENR5WKUdxK$r<>L61bmgZ=Rz#*}TBc@7Wf2*k zVHuhsRrE;rbW7KCsa}gTPqQ>llN!}X^;ApMQ~@a^Qar^{G=&6gpuu98ZmB&L9$^t0 zA+?swJ>0@IT#5xn^Dqn3Fey^>s)t&rh6)@R4e<~Q(Ga%68Zb!15?a()3^veUF)Ssh za>CrzT}mHo$;{l;O-e2-D5|-ttDqiI^tzafx*!ifpvg3LpdS(_gf(E0h9#}=U@_Q0 zgC*r$mB|S;lQI&0tR+)56?{c5EGU|&2|nU92EdDUj7BY1;s-RD#tt|k7=^F~4AM+O z3mz;68)&H$RX1gFLbw=4qK~y?D)l(Z*LLqJwiA}k?JCvVj4s!kcQxAVs3SCmh15vb zO&X5^ZqPgju7r7LYOC5y{O>>We^0EBH#U3s@7%lH8w}U4$^4(0sber&;FJ27NXKNV zGk5Oy?7_p%>+#~&n{WHm$Io_0H*P-vG&#J~e{yAU@ALLay*o2`@nP%nnG3g;C*9qT zI}3vcqociztB=mFetq_K>HE-Ej{G`3T;4p`y|g_$_wM?SwWpW&*53E`Uw(NtIy5b- F{{RLp?QsAA diff --git a/images/caution.png b/images/caution.png deleted file mode 100644 index 965fe7eb877a16fedbfd0f3d457d0d42632a6430..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 217 zcmeAS@N?(olHy`uVBq!ia0vp^f@~ diff --git a/images/master.gif b/images/master.gif deleted file mode 100644 index 5751a4030bcc1ebba86ee205492f0ac5f5286077..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3955 zcmbV}`#;nB;bW*Fu+bD!H7l3Td%l$`*zKnoZBcMmdQr)0w zzlgM7_^L^o1N9Y$Q^R8QP^lFRh8BQ107d}l0-y!}E}yGqF;p_i2QH_Ff}b4dSrAox zzyKPRG(y4GjP!irFuF(>E|)PtqjDIO9$Ce!BE}qxRzxFJ3`iDgI5#*H85Pg1;mZbk zMyL)nSKp{HOZo1zkrAg*eefLC*CJ z2b_aMv>0woUTbSwOM5$4+R{oqeuCK6E~XujNDdv69B>LxL0lL_ggezYrRANxB5M{m zHcFbij&Hd=F*!jja0ze>aC4(h`}&4PMJ3KBM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oJo~mwEeGj%-98`aN#Ks#QLF zRO^R$z9TxlIV8^$lZmD*HEYpSKjaq>Q9^g-Vhailh1uIUy(ZE)mw8+(gF&}u;vaBv(|XXdlpVo z-ZY|S@79__;@)yR7(8$8;mF6@TPC6nJU%=lfNLzHXKOC{Gmo_ z@ccz3ly9h)gCZl1R6C-WMsrLvB>17PVT1Ioj?-&+B^>fCrH-PqQTMp#m2FPX^UY)^ zrs?s|w>0lp(lZhE-t6=`MH%ve<7dN0UNHfoY zCn1?s7$_U@#=urUTNH^5Uko)x8csV&d3uWYR-Zr2sxy%~J4z_Y^zrrUFVcM}wdIBf0lhBKWS6)NVzJ@V(I&rEcEGJ0ePf}mkoQYZpgWc}S zNI3lZ_51f6BPI5=%~}_EQKITOQBBZ=;$c^s~pKGOLETI+Un}^>IQyS*FvGrY_6QaI#!je zt*)&}mHh>%WUZa43J5+mr=n?EXfw3Ai83t~{s)c3_+!<5IFJAU002ovPDHLkV1lq| Be&_%I diff --git a/images/tip.gif b/images/tip.gif deleted file mode 100644 index 2536791237e00566f0fd60f57c8ef684cba54134..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1018 zcmchW%}dmA5XMIgTcQ$VH%JP0Nkywmj7nmJ+d(rhB3pYSP|(5EJZ021Bf?1V&>jXM zJOufYBtn-EBFIdbgV7s>hYm^*-J(MTP0#%Ph`xt~VP>BB%rn33=xjgQ(wC+*eIxRC z=C1DI&h8YEnVY(a8@o{?)m+t8T-lYPR?J0R#D!fbTG^b{S)AFKpyXsu>LgC=gaF!* zh8CJpO))2)nu!^kQH({TYAU8|N%k9Tq8oN# ze?VYEP(uvRphPJ+Fc{j9h8Bf$kw%QiA{0hqKa54hEKKkf>w*GFAr^vR8!hs`S94I z^zp{Q@6`=0*`J$b4R_x+b*G+A?A%+wzB>7-dB^g{@&2_8o%;M^bYyzA(7d(TP#CIR zE7X^_&39HEn0=gY%}Ce!fg|1X__NbZC>!b+)&yxywWjDQ4p O@{FgepUXO@geCy2gM|A4 diff --git a/images/warning.gif b/images/warning.gif deleted file mode 100644 index 5d676d752903ccda75a93ca2d87f781edcd47455..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 923 zcmc(eu}ju*5Qp!z26G7CgjyOjDNG`iTQUd1s8=IFkeXUvcstTHp`lj6#V`l)8iF9m zt%#PksHNfB8luUqHQHRdp8Nh2eR-GT?mqY2=YDT*`PQ|$epk-OFOjSlnVxBxnkf}U zWO#;UXoghMBi++2UDKs%Ez&&A(lkw~RU_3?EmczmrIbkV6id+*0<@7vi)N~&=G5~D zi_i$Eu|)3S7Ovq^6eP{VEKI|spr}<3wNMQe7-BtqRr2Zu` zZ1VQh`K5P9pSr_i)Ay%#V^K!W?R`9Z^z+O1$mM&R2cs8cYwX1KhacU^#huByXTJ|- zUVnXlapC3D<3BHM?@q1n4VKp4+}OYRSNDdTRb0zGVRlsmkN3Q;NmG|hkvx3vK)>J7xNDR4&MP6eu9@O1Ta JS?83{1OOUTN-+Qc From 5f234fa9c9732ba0b69def17aa3fe44d16a4b7a4 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 16:59:29 +0000 Subject: [PATCH 5852/7878] Something in apr_private.h when preprocessed with the MinGW Windows headers effectively redefines WINADVAPI from __stdcall to empty which results in a link failure when wincrypt.h is placed after an include to apr_private.h. Submitted by: Curt Arnold git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551958 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/rand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 8af1bdad5f2..7161bfbbd60 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -14,9 +14,8 @@ * limitations under the License. */ -#include -#include #include "apr.h" +#include #include "apr_private.h" #include "apr_general.h" #include "apr_portable.h" From 37a8aaea599361b320b8f6df51414ad8775cae98 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 17:09:33 +0000 Subject: [PATCH 5853/7878] Update apr_atomic_init documentation. PR: 42760. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551962 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 3 +++ memory/unix/apr_pools.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index b169ff3dc1b..714780fe53a 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -40,6 +40,9 @@ extern "C" { * atomic operation's internal structures * @param p pool * @return APR_SUCCESS on successful completion + * @remark Programs do NOT need to call this directly. APR will call this + * automatically from apr_initialize. + * @internal */ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p); diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 461453f3f1b..eb3639c9ddb 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -556,6 +556,9 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) /* This has to happen here because mutexes might be backed by * atomics. It used to be snug and safe in apr_initialize(). + * + * Warning: apr_atomic_init() must always be called, by any + * means possible, from apr_initialize(). */ if ((rv = apr_atomic_init(global_pool)) != APR_SUCCESS) { return rv; From b8ec33aa40931cc56120068493f801d262350716 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 17:16:58 +0000 Subject: [PATCH 5854/7878] Remove superfluous parentheses. Noticed by Joe Orton. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551964 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index c6fdcd918a9..398d71dd1c0 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -85,7 +85,7 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, usec = apr_time_usec(now); apr_snprintf(semname, sizeof(semname), "/ApR.%lxZ%lx", sec, usec); psem = sem_open(semname, O_CREAT | O_EXCL, 0644, 1); - if ((psem == (sem_t *)SEM_FAILED)) { + if (psem == (sem_t *)SEM_FAILED) { if (errno == ENAMETOOLONG) { /* Oh well, good try */ semname[13] = '\0'; From bcc990ba2942fb56d030c13d8d7d64486fa3f8cd Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 17:19:42 +0000 Subject: [PATCH 5855/7878] Rework the win32 CV code to signal the condition only if one or more threads are blocked on the condition variable. If no threads are waiting on the condition variable, nothing happens. This patch also eliminates the thundering-herd problem of the manual-reset event, which (theoretically) wakes up all threads waiting on. Now the behavior of the CV's should be the same on Unix and win32 platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551965 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_thread_cond.h | 8 +- locks/win32/thread_cond.c | 123 +++++++++++++--------- 2 files changed, 77 insertions(+), 54 deletions(-) diff --git a/include/arch/win32/apr_arch_thread_cond.h b/include/arch/win32/apr_arch_thread_cond.h index 840949c26a6..921a29375e4 100644 --- a/include/arch/win32/apr_arch_thread_cond.h +++ b/include/arch/win32/apr_arch_thread_cond.h @@ -21,10 +21,10 @@ struct apr_thread_cond_t { apr_pool_t *pool; - HANDLE event; - int signal_all; - int num_waiting; - int signalled; + HANDLE semaphore; + CRITICAL_SECTION csection; + unsigned long num_waiting; + unsigned long num_wake; }; #endif /* THREAD_COND_H */ diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index 5f3cae277bb..ca478391e6e 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -22,59 +22,78 @@ #include "apr_arch_thread_cond.h" #include "apr_portable.h" +#include + static apr_status_t thread_cond_cleanup(void *data) { apr_thread_cond_t *cond = data; - CloseHandle(cond->event); + CloseHandle(cond->semaphore); + DeleteCriticalSection(&cond->csection); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, apr_pool_t *pool) { - *cond = apr_palloc(pool, sizeof(**cond)); - (*cond)->pool = pool; - (*cond)->event = CreateEvent(NULL, TRUE, FALSE, NULL); - (*cond)->signal_all = 0; - (*cond)->num_waiting = 0; + apr_thread_cond_t *cv; + + cv = apr_pcalloc(pool, sizeof(**cond)); + if (cv == NULL) { + return APR_ENOMEM; + } + + cv->semaphore = CreateSemaphore(NULL, 0, LONG_MAX, NULL); + if (cv->semaphore == NULL) { + return apr_get_os_error(); + } + + *cond = cv; + cv->pool = pool; + InitializeCriticalSection(&cv->csection); + apr_pool_cleanup_register(cv->pool, cv, thread_cond_cleanup, + apr_pool_cleanup_null); + return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) +{ + return apr_pool_cleanup_run(cond->pool, cond, thread_cond_cleanup); +} + static APR_INLINE apr_status_t _thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, DWORD timeout_ms ) { DWORD res; + apr_status_t rv; - while (1) { - cond->num_waiting++; + EnterCriticalSection(&cond->csection); + cond->num_waiting++; + LeaveCriticalSection(&cond->csection); - apr_thread_mutex_unlock(mutex); - res = WaitForSingleObject(cond->event, timeout_ms); - apr_thread_mutex_lock(mutex); - cond->num_waiting--; - if (res != WAIT_OBJECT_0) { - apr_status_t rv = apr_get_os_error(); - if (res == WAIT_TIMEOUT) { - return APR_TIMEUP; - } - return apr_get_os_error(); - } - if (cond->signal_all) { - if (cond->num_waiting == 0) { - cond->signal_all = 0; - cond->signalled = 0; - ResetEvent(cond->event); - } + apr_thread_mutex_unlock(mutex); + + do { + res = WaitForSingleObject(cond->semaphore, timeout_ms); + EnterCriticalSection(&cond->csection); + if (cond->num_wake) { + cond->num_wake--; + rv = APR_SUCCESS; break; } - else if (cond->signalled) { - cond->signalled = 0; - ResetEvent(cond->event); + else if (res != WAIT_OBJECT_0) { + cond->num_waiting--; + rv = APR_TIMEUP; break; } - } - return APR_SUCCESS; + LeaveCriticalSection(&cond->csection); + } while (1); + + LeaveCriticalSection(&cond->csection); + apr_thread_mutex_lock(mutex); + + return rv; } APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, @@ -94,35 +113,39 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) { - apr_status_t rv = APR_SUCCESS; - DWORD res; + unsigned int wake = 0; - cond->signalled = 1; - res = SetEvent(cond->event); - if (res == 0) { - rv = apr_get_os_error(); + EnterCriticalSection(&cond->csection); + if (cond->num_waiting) { + wake = 1; + cond->num_wake++; + cond->num_waiting--; } - return rv; + LeaveCriticalSection(&cond->csection); + + if (wake) { + ReleaseSemaphore(cond->semaphore, 1, NULL); + } + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) { - apr_status_t rv = APR_SUCCESS; - DWORD res; + unsigned long num_wake = 0; - cond->signalled = 1; - cond->signal_all = 1; - res = SetEvent(cond->event); - if (res == 0) { - rv = apr_get_os_error(); + EnterCriticalSection(&cond->csection); + if (cond->num_waiting) { + cond->num_wake += num_wake = cond->num_waiting; + cond->num_waiting = 0; } - return rv; -} + LeaveCriticalSection(&cond->csection); -APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) -{ - return apr_pool_cleanup_run(cond->pool, cond, thread_cond_cleanup); + if (num_wake) { + ReleaseSemaphore(cond->semaphore, num_wake, NULL); + } + + return APR_SUCCESS; } APR_POOL_IMPLEMENT_ACCESSOR(thread_cond) - From 7e956177c9a7537b473cf9e29183ffcbe34f4a68 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 17:20:49 +0000 Subject: [PATCH 5856/7878] Update the CV docs to add a few remarks. PR: 40971. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551966 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_cond.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/apr_thread_cond.h b/include/apr_thread_cond.h index 3744b090425..199f1dedc2a 100644 --- a/include/apr_thread_cond.h +++ b/include/apr_thread_cond.h @@ -54,7 +54,7 @@ typedef struct apr_thread_cond_t apr_thread_cond_t; * and schedule threads in a single process. * @param cond the memory address where the newly created condition variable * will be stored. - * @param pool the pool from which to allocate the mutex. + * @param pool the pool from which to allocate the condition. */ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, apr_pool_t *pool); @@ -70,6 +70,9 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, * @param mutex the mutex that must be locked upon entering this function, * is released while the thread is asleep, and is again acquired before * returning from this function. + * @remark Spurious wakeups may occur. Before and after every call to wait on + * a condition variable, the caller should test whether the condition is already + * met. */ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex); @@ -100,6 +103,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, * the associated mutex. Although it is not required, if predictable scheduling * is desired, that mutex must be locked while calling this function. * @param cond the condition variable on which to produce the signal. + * @remark If no threads are waiting on the condition variable, nothing happens. */ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond); @@ -108,6 +112,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond); * Each thread that was signaled is then scheduled to wake up and acquire * the associated mutex. This will happen in a serialized manner. * @param cond the condition variable on which to produce the broadcast. + * @remark If no threads are waiting on the condition variable, nothing happens. */ APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond); From cd58e6c0adf7c0ecbf5b854edaee07f8441ae76a Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 17:22:50 +0000 Subject: [PATCH 5857/7878] Add test program for the condition variable code. There are various CV behavior tests, including fairness ones. PR: 42305 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551967 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- test/Makefile.win | 2 +- test/abts_tests.h | 1 + test/aprtest.dsp | 4 ++++ test/nwgnuaprtest | 2 ++ test/testall.dsp | 4 ++++ test/testutil.h | 1 + 7 files changed, 14 insertions(+), 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index dfd925e971e..28ae9bbd619 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -113,7 +113,7 @@ TESTS = testutil.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ testenv.lo testprocmutex.lo testrand2.lo testfnmatch.lo \ testatomic.lo testflock.lo testshm.lo testsock.lo testglobalmutex.lo \ - teststrnatcmp.lo testfilecopy.lo testtemp.lo testlfs.lo + teststrnatcmp.lo testfilecopy.lo testtemp.lo testlfs.lo testcond.lo testall@EXEEXT@: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ abts.lo proc_child@EXEEXT@ \ diff --git a/test/Makefile.win b/test/Makefile.win index 35d7a172047..d6fc30c53dd 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -106,7 +106,7 @@ TESTS = testutil.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj \ testatomic.obj testflock.obj testshm.obj testsock.obj testglobalmutex.obj \ - teststrnatcmp.obj testfilecopy.obj testtemp.obj testlfs.obj + teststrnatcmp.obj testfilecopy.obj testtemp.obj testlfs.obj testcond.obj testall.exe: $(TESTS) mod_test.dll occhild.exe \ readchild.exe abts.obj proc_child.exe \ diff --git a/test/abts_tests.h b/test/abts_tests.h index 83e847177b5..130cbeed876 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -41,6 +41,7 @@ const struct testlist { {testhash}, {testipsub}, {testlock}, + {testcond}, {testlfs}, {testmmap}, {testnames}, diff --git a/test/aprtest.dsp b/test/aprtest.dsp index 9d6994f5f0a..ca774eb6235 100644 --- a/test/aprtest.dsp +++ b/test/aprtest.dsp @@ -108,6 +108,10 @@ SOURCE=.\testargs.c # End Source File # Begin Source File +SOURCE=.\testcond.c +# End Source File +# Begin Source File + SOURCE=.\testcontext.c # End Source File # Begin Source File diff --git a/test/nwgnuaprtest b/test/nwgnuaprtest index 22b24b08494..177c61b71b8 100644 --- a/test/nwgnuaprtest +++ b/test/nwgnuaprtest @@ -187,6 +187,7 @@ FILES_nlm_objs = \ $(OBJDIR)/testipsub.o \ $(OBJDIR)/testlfs.o \ $(OBJDIR)/testlock.o \ + $(OBJDIR)/testcond.o \ $(OBJDIR)/testmmap.o \ $(OBJDIR)/testnames.o \ $(OBJDIR)/testoc.o \ @@ -297,3 +298,4 @@ install :: nlms FORCE include $(APR_WORK)\build\NWGNUtail.inc + diff --git a/test/testall.dsp b/test/testall.dsp index cf1654ab2b6..f2d9e062b15 100644 --- a/test/testall.dsp +++ b/test/testall.dsp @@ -139,6 +139,10 @@ SOURCE=.\testatomic.c # End Source File # Begin Source File +SOURCE=.\testcond.c +# End Source File +# Begin Source File + SOURCE=.\testdir.c # End Source File # Begin Source File diff --git a/test/testutil.h b/test/testutil.h index 96394c5eb03..9b979b4c723 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -62,6 +62,7 @@ abts_suite *testglobalmutex(abts_suite *suite); abts_suite *testhash(abts_suite *suite); abts_suite *testipsub(abts_suite *suite); abts_suite *testlock(abts_suite *suite); +abts_suite *testcond(abts_suite *suite); abts_suite *testlfs(abts_suite *suite); abts_suite *testmmap(abts_suite *suite); abts_suite *testnames(abts_suite *suite); From 0e4616db30ef1ef6339c3951a9e32e1bf6e4d9be Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 17:29:46 +0000 Subject: [PATCH 5858/7878] Sync up changes of the win32 CV code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@551969 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGES b/CHANGES index 759c5942878..33024acbdec 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,13 @@ Changes for APR 1.3.0 + *) Rework the WIN32 CV code to signal the condition only if one or + more threads are blocked on the condition variable. If no threads + are waiting on the condition variable, nothing happens. The change + also eliminates the thundering-herd problem of the manual-reset + event, which (theoretically) wakes up all threads waiting on. Now + the behavior of the CV's should be the same on Unix and win32 + platforms. PR 42305. [Davi Arnaut] + *) Define SEM_FAILED if it isn't already defined, as the proc mutex code already does it. Also search for the sem_open function in the realtime library. (This fixes HP-UX sem_open detection). From 113c1ec4d0af822bea6a2b3c3b1f4f502ed77998 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 20:29:50 +0000 Subject: [PATCH 5859/7878] Add new CV test program to the repository. Noticed by Joe Orton. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@552025 13f79535-47bb-0310-9956-ffa450edef68 --- test/testcond.c | 657 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 657 insertions(+) create mode 100644 test/testcond.c diff --git a/test/testcond.c b/test/testcond.c new file mode 100644 index 00000000000..0b38922eacf --- /dev/null +++ b/test/testcond.c @@ -0,0 +1,657 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_file_io.h" +#include "apr_thread_proc.h" +#include "apr_thread_mutex.h" +#include "apr_thread_cond.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_atomic.h" +#include "testutil.h" + +#define NTHREADS 10 + +#define ABTS_SUCCESS(rv) ABTS_INT_EQUAL(tc, rv, APR_SUCCESS) + +typedef struct toolbox_t toolbox_t; + +struct toolbox_t { + void *data; + abts_case *tc; + apr_thread_mutex_t *mutex; + apr_thread_cond_t *cond; + void (*func)(toolbox_t *box); +}; + +#if APR_HAS_THREADS +static void lost_signal(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_thread_cond_t *cond = NULL; + apr_thread_mutex_t *mutex = NULL; + + rv = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, p); + ABTS_SUCCESS(rv); + ABTS_PTR_NOTNULL(tc, mutex); + + rv = apr_thread_cond_create(&cond, p); + ABTS_SUCCESS(rv); + ABTS_PTR_NOTNULL(tc, cond); + + rv = apr_thread_cond_signal(cond); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_lock(mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_cond_timedwait(cond, mutex, 10000); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + + rv = apr_thread_mutex_unlock(mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_cond_broadcast(cond); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_lock(mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_cond_timedwait(cond, mutex, 10000); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + + rv = apr_thread_mutex_unlock(mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_cond_destroy(cond); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_destroy(mutex); + ABTS_SUCCESS(rv); +} + +static void *APR_THREAD_FUNC thread_routine(apr_thread_t *thd, void *data) +{ + toolbox_t *box = data; + + box->func(box); + + apr_thread_exit(thd, 0); + + return NULL; +} + +static void lock_and_signal(toolbox_t *box) +{ + apr_status_t rv; + abts_case *tc = box->tc; + + rv = apr_thread_mutex_lock(box->mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_cond_signal(box->cond); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_unlock(box->mutex); + ABTS_SUCCESS(rv); +} + +static void dynamic_binding(abts_case *tc, void *data) +{ + unsigned int i; + apr_status_t rv; + toolbox_t box[NTHREADS]; + apr_thread_t *thread[NTHREADS]; + apr_thread_mutex_t *mutex[NTHREADS]; + apr_thread_cond_t *cond = NULL; + + rv = apr_thread_cond_create(&cond, p); + ABTS_SUCCESS(rv); + ABTS_PTR_NOTNULL(tc, cond); + + for (i = 0; i < NTHREADS; i++) { + rv = apr_thread_mutex_create(&mutex[i], APR_THREAD_MUTEX_DEFAULT, p); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_lock(mutex[i]); + ABTS_SUCCESS(rv); + + box[i].tc = tc; + box[i].cond = cond; + box[i].mutex = mutex[i]; + box[i].func = lock_and_signal; + + rv = apr_thread_create(&thread[i], NULL, thread_routine, &box[i], p); + ABTS_SUCCESS(rv); + } + + /* + * The dynamic binding should be preserved because we use only one waiter + */ + + for (i = 0; i < NTHREADS; i++) { + rv = apr_thread_cond_wait(cond, mutex[i]); + ABTS_SUCCESS(rv); + } + + for (i = 0; i < NTHREADS; i++) { + rv = apr_thread_cond_timedwait(cond, mutex[i], 10000); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + + rv = apr_thread_mutex_unlock(mutex[i]); + ABTS_SUCCESS(rv); + } + + for (i = 0; i < NTHREADS; i++) { + apr_status_t retval; + rv = apr_thread_join(&retval, thread[i]); + ABTS_SUCCESS(rv); + } + + rv = apr_thread_cond_destroy(cond); + ABTS_SUCCESS(rv); + + for (i = 0; i < NTHREADS; i++) { + rv = apr_thread_mutex_destroy(mutex[i]); + ABTS_SUCCESS(rv); + } +} + +static void lock_and_wait(toolbox_t *box) +{ + apr_status_t rv; + abts_case *tc = box->tc; + apr_uint32_t *count = box->data; + + rv = apr_thread_mutex_lock(box->mutex); + ABTS_SUCCESS(rv); + + apr_atomic_inc32(count); + + rv = apr_thread_cond_wait(box->cond, box->mutex); + ABTS_SUCCESS(rv); + + apr_atomic_dec32(count); + + rv = apr_thread_mutex_unlock(box->mutex); + ABTS_SUCCESS(rv); +} + +static void broadcast_threads(abts_case *tc, void *data) +{ + toolbox_t box; + unsigned int i; + apr_status_t rv; + apr_uint32_t count = 0; + apr_thread_cond_t *cond = NULL; + apr_thread_mutex_t *mutex = NULL; + apr_thread_t *thread[NTHREADS]; + + rv = apr_thread_cond_create(&cond, p); + ABTS_SUCCESS(rv); + ABTS_PTR_NOTNULL(tc, cond); + + rv = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, p); + ABTS_SUCCESS(rv); + ABTS_PTR_NOTNULL(tc, mutex); + + rv = apr_thread_mutex_lock(mutex); + ABTS_SUCCESS(rv); + + box.tc = tc; + box.data = &count; + box.mutex = mutex; + box.cond = cond; + box.func = lock_and_wait; + + for (i = 0; i < NTHREADS; i++) { + rv = apr_thread_create(&thread[i], NULL, thread_routine, &box, p); + ABTS_SUCCESS(rv); + } + + do { + rv = apr_thread_mutex_unlock(mutex); + ABTS_SUCCESS(rv); + apr_sleep(100000); + rv = apr_thread_mutex_lock(mutex); + ABTS_SUCCESS(rv); + } while (apr_atomic_read32(&count) != NTHREADS); + + rv = apr_thread_cond_broadcast(cond); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_unlock(mutex); + ABTS_SUCCESS(rv); + + for (i = 0; i < NTHREADS; i++) { + apr_status_t retval; + rv = apr_thread_join(&retval, thread[i]); + ABTS_SUCCESS(rv); + } + + ABTS_INT_EQUAL(tc, count, 0); + + rv = apr_thread_cond_destroy(cond); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_destroy(mutex); + ABTS_SUCCESS(rv); +} + +static void nested_lock_and_wait(toolbox_t *box) +{ + apr_status_t rv; + abts_case *tc = box->tc; + + rv = apr_thread_mutex_lock(box->mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_lock(box->mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_lock(box->mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_cond_wait(box->cond, box->mutex); + ABTS_SUCCESS(rv); +} + +static void nested_lock_and_unlock(toolbox_t *box) +{ + apr_status_t rv; + abts_case *tc = box->tc; + + rv = apr_thread_mutex_lock(box->mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_lock(box->mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_lock(box->mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_cond_timedwait(box->cond, box->mutex, 2000000); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_unlock(box->mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_unlock(box->mutex); + ABTS_SUCCESS(rv); +} + +static void nested_wait(abts_case *tc, void *data) +{ + toolbox_t box; + apr_status_t rv, retval; + apr_thread_cond_t *cond = NULL; + apr_thread_t *thread = NULL; + apr_thread_mutex_t *mutex = NULL; + + rv = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_NESTED, p); + ABTS_SUCCESS(rv); + ABTS_PTR_NOTNULL(tc, mutex); + + rv = apr_thread_cond_create(&cond, p); + ABTS_SUCCESS(rv); + ABTS_PTR_NOTNULL(tc, cond); + + rv = apr_thread_mutex_lock(mutex); + ABTS_SUCCESS(rv); + + box.tc = tc; + box.cond = cond; + box.mutex = mutex; + box.func = data; + + rv = apr_thread_create(&thread, NULL, thread_routine, &box, p); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_unlock(mutex); + ABTS_SUCCESS(rv); + + /* yield the processor */ + apr_sleep(500000); + + rv = apr_thread_cond_signal(cond); + ABTS_SUCCESS(rv); + + rv = apr_thread_join(&retval, thread); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_trylock(mutex); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EBUSY(rv)); + + rv = apr_thread_mutex_trylock(mutex); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EBUSY(rv)); +} + +static volatile apr_uint64_t pipe_count; +static volatile apr_uint32_t exiting; + +static void pipe_consumer(toolbox_t *box) +{ + char ch; + apr_status_t rv; + apr_size_t nbytes; + abts_case *tc = box->tc; + apr_file_t *out = box->data; + apr_uint32_t consumed = 0; + + do { + rv = apr_thread_mutex_lock(box->mutex); + ABTS_SUCCESS(rv); + + while (!pipe_count && !exiting) { + rv = apr_thread_cond_wait(box->cond, box->mutex); + ABTS_SUCCESS(rv); + } + + if (!pipe_count && exiting) { + rv = apr_thread_mutex_unlock(box->mutex); + ABTS_SUCCESS(rv); + break; + } + + pipe_count--; + consumed++; + + rv = apr_thread_mutex_unlock(box->mutex); + ABTS_SUCCESS(rv); + + rv = apr_file_read_full(out, &ch, 1, &nbytes); + ABTS_SUCCESS(rv); + ABTS_INT_EQUAL(tc, 1, nbytes); + ABTS_INT_EQUAL(tc, 1, (ch == '.')); + } while (1); + + /* naive fairness test */ + ABTS_INT_EQUAL(tc, 1, !!consumed); +} + +static void pipe_write(toolbox_t *box, char ch) +{ + apr_status_t rv; + apr_size_t nbytes; + abts_case *tc = box->tc; + apr_file_t *in = box->data; + + rv = apr_file_write_full(in, &ch, 1, &nbytes); + ABTS_SUCCESS(rv); + ABTS_INT_EQUAL(tc, 1, nbytes); + + rv = apr_thread_mutex_lock(box->mutex); + ABTS_SUCCESS(rv); + + if (!pipe_count) { + rv = apr_thread_cond_signal(box->cond); + ABTS_SUCCESS(rv); + } + + pipe_count++; + + rv = apr_thread_mutex_unlock(box->mutex); + ABTS_SUCCESS(rv); +} + +static void pipe_producer(toolbox_t *box) +{ + apr_uint32_t loop = 500; + + do { + pipe_write(box, '.'); + } while (loop--); +} + +static void pipe_producer_consumer(abts_case *tc, void *data) +{ + apr_status_t rv; + toolbox_t boxcons, boxprod; + apr_thread_t *thread[NTHREADS]; + apr_thread_cond_t *cond = NULL; + apr_thread_mutex_t *mutex = NULL; + apr_file_t *in = NULL, *out = NULL; + apr_uint32_t i, ncons = (NTHREADS * 0.70); + + rv = apr_file_pipe_create(&in, &out, p); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, p); + ABTS_SUCCESS(rv); + ABTS_PTR_NOTNULL(tc, mutex); + + rv = apr_thread_cond_create(&cond, p); + ABTS_SUCCESS(rv); + ABTS_PTR_NOTNULL(tc, cond); + + boxcons.tc = tc; + boxcons.data = in; + boxcons.mutex = mutex; + boxcons.cond = cond; + boxcons.func = pipe_consumer; + + for (i = 0; i < ncons; i++) { + rv = apr_thread_create(&thread[i], NULL, thread_routine, &boxcons, p); + ABTS_SUCCESS(rv); + } + + boxprod.tc = tc; + boxprod.data = out; + boxprod.mutex = mutex; + boxprod.cond = cond; + boxprod.func = pipe_producer; + + for (; i < NTHREADS; i++) { + rv = apr_thread_create(&thread[i], NULL, thread_routine, &boxprod, p); + ABTS_SUCCESS(rv); + } + + for (i = ncons; i < NTHREADS; i++) { + apr_status_t retval; + rv = apr_thread_join(&retval, thread[i]); + ABTS_SUCCESS(rv); + } + + rv = apr_thread_mutex_lock(mutex); + ABTS_SUCCESS(rv); + + exiting = 1; + + rv = apr_thread_cond_broadcast(cond); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_unlock(mutex); + ABTS_SUCCESS(rv); + + for (i = 0; i < ncons; i++) { + apr_status_t retval; + rv = apr_thread_join(&retval, thread[i]); + ABTS_SUCCESS(rv); + } + + rv = apr_thread_cond_destroy(cond); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_destroy(mutex); + ABTS_SUCCESS(rv); + + rv = apr_file_close(in); + ABTS_SUCCESS(rv); + + rv = apr_file_close(out); + ABTS_SUCCESS(rv); +} + +volatile enum { + TOSS, + PING, + PONG, + OVER, +} state; + +static void ping(toolbox_t *box) +{ + apr_status_t rv; + abts_case *tc = box->tc; + + rv = apr_thread_mutex_lock(box->mutex); + ABTS_SUCCESS(rv); + + do { + state = PONG; + + rv = apr_thread_cond_signal(box->cond); + ABTS_SUCCESS(rv); + + do { + rv = apr_thread_cond_wait(box->cond, box->mutex); + ABTS_SUCCESS(rv); + if (state == OVER) { + break; + } + ABTS_INT_EQUAL(tc, 1, (state == PING)); + } while (state == PONG); + } while (state != OVER); + + rv = apr_thread_mutex_unlock(box->mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_cond_broadcast(box->cond); + ABTS_SUCCESS(rv); +} + +static void pong(toolbox_t *box) +{ + apr_status_t rv; + abts_case *tc = box->tc; + + rv = apr_thread_mutex_lock(box->mutex); + ABTS_SUCCESS(rv); + + do { + state = PING; + + rv = apr_thread_cond_signal(box->cond); + ABTS_SUCCESS(rv); + + do { + rv = apr_thread_cond_wait(box->cond, box->mutex); + ABTS_SUCCESS(rv); + if (state == OVER) { + break; + } + ABTS_INT_EQUAL(tc, 1, (state == PONG)); + } while (state == PING); + } while (state != OVER); + + rv = apr_thread_mutex_unlock(box->mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_cond_broadcast(box->cond); + ABTS_SUCCESS(rv); +} + +static void ping_pong(abts_case *tc, void *data) +{ + apr_status_t rv, retval; + toolbox_t box_ping, box_pong; + apr_thread_cond_t *cond = NULL; + apr_thread_mutex_t *mutex = NULL; + apr_thread_t *thr_ping = NULL, *thr_pong = NULL; + + rv = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, p); + ABTS_SUCCESS(rv); + ABTS_PTR_NOTNULL(tc, mutex); + + rv = apr_thread_cond_create(&cond, p); + ABTS_SUCCESS(rv); + ABTS_PTR_NOTNULL(tc, cond); + + rv = apr_thread_mutex_lock(mutex); + ABTS_SUCCESS(rv); + + box_ping.tc = tc; + box_ping.data = NULL; + box_ping.mutex = mutex; + box_ping.cond = cond; + box_ping.func = ping; + + rv = apr_thread_create(&thr_ping, NULL, thread_routine, &box_ping, p); + ABTS_SUCCESS(rv); + + box_pong.tc = tc; + box_pong.data = NULL; + box_pong.mutex = mutex; + box_pong.cond = cond; + box_pong.func = pong; + + rv = apr_thread_create(&thr_pong, NULL, thread_routine, &box_pong, p); + ABTS_SUCCESS(rv); + + state = TOSS; + + rv = apr_thread_mutex_unlock(mutex); + ABTS_SUCCESS(rv); + + apr_sleep(3000000); + + rv = apr_thread_mutex_lock(mutex); + ABTS_SUCCESS(rv); + + state = OVER; + + rv = apr_thread_mutex_unlock(mutex); + ABTS_SUCCESS(rv); + + rv = apr_thread_join(&retval, thr_ping); + ABTS_SUCCESS(rv); + + rv = apr_thread_join(&retval, thr_pong); + ABTS_SUCCESS(rv); + + rv = apr_thread_cond_destroy(cond); + ABTS_SUCCESS(rv); + + rv = apr_thread_mutex_destroy(mutex); + ABTS_SUCCESS(rv); +} +#endif /* !APR_HAS_THREADS */ + +#if !APR_HAS_THREADS +static void threads_not_impl(abts_case *tc, void *data) +{ + ABTS_NOT_IMPL(tc, "Threads not implemented on this platform"); +} +#endif + +abts_suite *testcond(abts_suite *suite) +{ + suite = ADD_SUITE(suite) + +#if !APR_HAS_THREADS + abts_run_test(suite, threads_not_impl, NULL); +#else + abts_run_test(suite, lost_signal, NULL); + abts_run_test(suite, dynamic_binding, NULL); + abts_run_test(suite, broadcast_threads, NULL); + abts_run_test(suite, nested_wait, nested_lock_and_wait); + abts_run_test(suite, nested_wait, nested_lock_and_unlock); + abts_run_test(suite, pipe_producer_consumer, NULL); + abts_run_test(suite, ping_pong, NULL); +#endif + + return suite; +} From 5754a90c5aaedad827fd09c087a2e194835b572f Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 29 Jun 2007 23:25:41 +0000 Subject: [PATCH 5860/7878] apr_gid_name and apr_uid_name return null on Win98 which causes the test to fail an ABTS_PTR_NOTNULL assertion, however the test will continue after failing that assertion which will cause a NULL pointer dereference in subsequent apr_gid_get or apr_uid_get call. Submitted by: Curt Arnold PR: 42318 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@552060 13f79535-47bb-0310-9956-ffa450edef68 --- test/testuser.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/testuser.c b/test/testuser.c index 2029bea84b2..e75782e902e 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -44,6 +44,9 @@ static void username(abts_case *tc, void *data) apr_uid_name_get(&uname, uid, p)); ABTS_PTR_NOTNULL(tc, uname); + if (uname == NULL) + return; + APR_ASSERT_SUCCESS(tc, "apr_uid_get failed", apr_uid_get(&retreived_uid, &retreived_gid, uname, p)); @@ -87,6 +90,9 @@ static void groupname(abts_case *tc, void *data) apr_gid_name_get(&gname, gid, p)); ABTS_PTR_NOTNULL(tc, gname); + if (gname == NULL) + return; + APR_ASSERT_SUCCESS(tc, "apr_gid_get failed", apr_gid_get(&retreived_gid, gname, p)); From d9c955c1148b10d88f079fa2d1ec77f42e31032a Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sat, 30 Jun 2007 12:28:23 +0000 Subject: [PATCH 5861/7878] Properly quote case pattern. Noticed by: Joe Orton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@552134 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 3705622b205..6d053e66944 100644 --- a/configure.in +++ b/configure.in @@ -1397,7 +1397,7 @@ case $host in *apple-darwin*) osver=`uname -r` case $osver in - [0-7].*) + [[0-7]].*) ssize_t_fmt='#define APR_SSIZE_T_FMT "d"' ;; *) From 7375a25726a6e1a98a1fda9b147bdb176a058ac2 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sat, 30 Jun 2007 13:30:24 +0000 Subject: [PATCH 5862/7878] Split the sendto_receivefrom test into two tests, one for IPv6 and one for IPv4, and allow the tests to fail. Previously the test would fail or succeed depending on the host IPv6 connectivity (non-localhost IPv6 address) and resolver bugs (AI_ADDRCONFIG flag), which would cause the test to core dump. The AI_ADDRCONFIG flag (and loopback addresses) issue has been reported and fixed: http://sourceware.org/bugzilla/show_bug.cgi?id=4599 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@552147 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsockets.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/test/testsockets.c b/test/testsockets.c index beb6d5a160e..4bed66e42af 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -103,7 +103,7 @@ static void udp6_socket(abts_case *tc, void *data) #endif } -static void sendto_receivefrom(abts_case *tc, void *data) +static void sendto_receivefrom_helper(abts_case *tc, const char *addr, int family) { apr_status_t rv; apr_socket_t *sock = NULL; @@ -115,28 +115,19 @@ static void sendto_receivefrom(abts_case *tc, void *data) apr_sockaddr_t *from; apr_sockaddr_t *to; apr_size_t len = 30; - int family; - const char *addr; -#if APR_HAVE_IPV6 - family = APR_INET6; - addr = "::1"; rv = apr_socket_create(&sock, family, SOCK_DGRAM, 0, p); - if (V6_NOT_ENABLED(rv)) { -#endif - family = APR_INET; - addr = "127.0.0.1"; - rv = apr_socket_create(&sock, family, SOCK_DGRAM, 0, p); -#if APR_HAVE_IPV6 - } -#endif ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + if (rv != APR_SUCCESS) + return; rv = apr_socket_create(&sock2, family, SOCK_DGRAM, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + if (rv != APR_SUCCESS) + return; - rv = apr_sockaddr_info_get(&to, addr, APR_UNSPEC, 7772, 0, p); + rv = apr_sockaddr_info_get(&to, addr, family, 7772, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_sockaddr_info_get(&from, addr, APR_UNSPEC, 7771, 0, p); + rv = apr_sockaddr_info_get(&from, addr, family, 7771, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1); @@ -147,12 +138,12 @@ static void sendto_receivefrom(abts_case *tc, void *data) rv = apr_socket_bind(sock, to); APR_ASSERT_SUCCESS(tc, "Could not bind socket", rv); if (rv != APR_SUCCESS) - return; + return; rv = apr_socket_bind(sock2, from); APR_ASSERT_SUCCESS(tc, "Could not bind second socket", rv); if (rv != APR_SUCCESS) - return; + return; len = STRLEN; rv = apr_socket_sendto(sock2, to, 0, sendbuf, &len); @@ -178,6 +169,14 @@ static void sendto_receivefrom(abts_case *tc, void *data) apr_socket_close(sock2); } +static void sendto_receivefrom(abts_case *tc, void *data) +{ +#if APR_HAVE_IPV6 + sendto_receivefrom_helper(tc, "::1", APR_INET6); +#endif + sendto_receivefrom_helper(tc, "127.0.0.1", APR_INET); +} + static void socket_userdata(abts_case *tc, void *data) { apr_socket_t *sock1, *sock2; From 8f0fbc2259c4a6dbb2d4969b6f0929fd16ef9949 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sat, 30 Jun 2007 15:20:55 +0000 Subject: [PATCH 5863/7878] Avoid overwriting the hash_mutex table for applications that incorrectly calls apr_atomic_init(). Noticied by: Tim Jones PR: 42760 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@552161 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 7aab8787044..2bd645e0570 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -226,12 +226,28 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, static apr_thread_mutex_t **hash_mutex; #endif /* APR_HAS_THREADS */ +#if APR_HAS_THREADS +static apr_status_t atomic_cleanup(void *data) +{ + if (hash_mutex == data) + hash_mutex = NULL; + + return APR_SUCCESS; +} +#endif + apr_status_t apr_atomic_init(apr_pool_t *p) { #if APR_HAS_THREADS int i; apr_status_t rv; + + if (hash_mutex != NULL) + return APR_SUCCESS; + hash_mutex = apr_palloc(p, sizeof(apr_thread_mutex_t*) * NUM_ATOMIC_HASH); + apr_pool_cleanup_register(p, hash_mutex, atomic_cleanup, + apr_pool_cleanup_null); for (i = 0; i < NUM_ATOMIC_HASH; i++) { rv = apr_thread_mutex_create(&(hash_mutex[i]), From 1be6bed4e25696923a50413afebfc0ef52617295 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sat, 30 Jun 2007 22:48:52 +0000 Subject: [PATCH 5864/7878] Add table cloning (deep copy) convenience function named apr_table_clone(). The function copies all fields of the table, and makes copies of dynamically allocated memory pointed to by the fields. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@552223 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_tables.h | 11 +++++++++++ tables/apr_tables.c | 14 ++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/CHANGES b/CHANGES index 33024acbdec..7ada1238b6d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes for APR 1.3.0 + *) Add table cloning (deep copy) convenience function. + [Davi Arnaut] + *) Rework the WIN32 CV code to signal the condition only if one or more threads are blocked on the condition variable. If no threads are waiting on the condition variable, nothing happens. The change diff --git a/include/apr_tables.h b/include/apr_tables.h index 11213a5492c..a2f450ea8c9 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -231,6 +231,17 @@ APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts); APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, const apr_table_t *t); +/** + * Create a new table whose contents are deep copied from the given + * table. A deep copy operation copies all fields, and makes copies + * of dynamically allocated memory pointed to by the fields. + * @param p The pool to allocate the new table out of + * @param t The table to clone + * @return A deep copy of the table passed in + */ +APR_DECLARE(apr_table_t *) apr_table_clone(apr_pool_t *p, + const apr_table_t *t); + /** * Delete all of the elements from a table * @param t The table to clear diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 9a25e366e57..51b23407cc0 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -423,6 +423,20 @@ APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, const apr_table_t *t) return new; } +APR_DECLARE(apr_table_t *) apr_table_clone(apr_pool_t *p, const apr_table_t *t) +{ + const apr_array_header_t *array = apr_table_elts(t); + apr_table_entry_t *elts = (apr_table_entry_t *) array->elts; + apr_table_t *new = apr_table_make(p, array->nelts); + int i; + + for (i = 0; i < array->nelts; i++) { + apr_table_add(new, elts[i].key, elts[i].val); + } + + return new; +} + static void table_reindex(apr_table_t *t) { int i; From c34d4b41abd6005dd35873977ae3e7751611b5f2 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sun, 1 Jul 2007 20:09:47 +0000 Subject: [PATCH 5865/7878] Fix assertion message, function tests apr_atomic_inc32(-1). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@552360 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testatomic.c b/test/testatomic.c index fff0fa937de..d39242db823 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -202,7 +202,7 @@ static void test_inc_neg1(abts_case *tc, void *data) rv = apr_atomic_inc32(&y32); - ABTS_ASSERT(tc, "apr_atomic_dec32 on zero returned zero.", rv == minus1); + ABTS_ASSERT(tc, "apr_atomic_inc32 didn't return the old value.", rv == minus1); str = apr_psprintf(p, "zero wrap failed: -1 + 1 = %d", y32); ABTS_ASSERT(tc, str, y32 == 0); } From 080c8a94abe73d4a531f4c9d151d639ba9560093 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Mon, 2 Jul 2007 20:30:29 +0000 Subject: [PATCH 5866/7878] Guard use of apr_thread_mutex/cond_t under APR_HAS_THREADS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@552585 13f79535-47bb-0310-9956-ffa450edef68 --- test/testcond.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/testcond.c b/test/testcond.c index 0b38922eacf..d3c330a6246 100644 --- a/test/testcond.c +++ b/test/testcond.c @@ -27,6 +27,8 @@ #define ABTS_SUCCESS(rv) ABTS_INT_EQUAL(tc, rv, APR_SUCCESS) +#if APR_HAS_THREADS + typedef struct toolbox_t toolbox_t; struct toolbox_t { @@ -37,7 +39,6 @@ struct toolbox_t { void (*func)(toolbox_t *box); }; -#if APR_HAS_THREADS static void lost_signal(abts_case *tc, void *data) { apr_status_t rv; From 0f131386c0aa7ad0bdc4b6b3ac5e00ee3527bcb6 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 3 Jul 2007 21:37:36 +0000 Subject: [PATCH 5867/7878] Solaris Event Ports backend for apr_pollcb. Also fixes the testpoll link errors on Solaris due to undefined symbols (apr_pollcb_* functions). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@552989 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 130 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/poll/unix/port.c b/poll/unix/port.c index e6b124fbd8a..51783d40b7d 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -340,4 +340,134 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return rv; } +struct apr_pollcb_t { + apr_pool_t *pool; + apr_uint32_t nalloc; + port_event_t *port_set; + int port_fd; +}; + +static apr_status_t cb_cleanup(void *p_) +{ + apr_pollcb_t *pollcb = (apr_pollcb_t *) p_; + close(pollcb->port_fd); + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) +{ + int fd; + + fd = port_create(); + + if (fd < 0) { + *pollcb = NULL; + return apr_get_netos_error(); + } + + *pollcb = apr_palloc(p, sizeof(**pollcb)); + (*pollcb)->nalloc = size; + (*pollcb)->pool = p; + (*pollcb)->port_fd = fd; + (*pollcb)->port_set = apr_palloc(p, size * sizeof(port_event_t)); + apr_pool_cleanup_register(p, *pollcb, cb_cleanup, cb_cleanup); + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) +{ + int ret, fd; + + if (descriptor->desc_type == APR_POLL_SOCKET) { + fd = descriptor->desc.s->socketdes; + } + else { + fd = descriptor->desc.f->filedes; + } + + ret = port_associate(pollcb->port_fd, PORT_SOURCE_FD, fd, + get_event(descriptor->reqevents), descriptor); + + if (ret == -1) { + return apr_get_netos_error(); + } + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) +{ + int fd, ret; + + if (descriptor->desc_type == APR_POLL_SOCKET) { + fd = descriptor->desc.s->socketdes; + } + else { + fd = descriptor->desc.f->filedes; + } + + ret = port_dissociate(pollcb->port_fd, PORT_SOURCE_FD, fd); + + if (ret < 0) { + return APR_NOTFOUND; + } + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, + apr_interval_time_t timeout, + apr_pollcb_cb_t func, + void *baton) +{ + int ret; + apr_pollfd_t *pollfd; + struct timespec tv, *tvptr; + apr_status_t rv = APR_SUCCESS; + unsigned int i, nget = pollcb->nalloc; + + if (timeout < 0) { + tvptr = NULL; + } + else { + tv.tv_sec = (long) apr_time_sec(timeout); + tv.tv_nsec = (long) apr_time_usec(timeout) * 1000; + tvptr = &tv; + } + + ret = port_getn(pollcb->port_fd, pollcb->port_set, pollcb->nalloc, + &nget, tvptr); + + if (ret == -1) { + if (errno == ETIME || errno == EINTR) { + rv = APR_TIMEUP; + } + else { + rv = APR_EGENERAL; + } + } + else if (nget == 0) { + rv = APR_TIMEUP; + } + else { + for (i = 0; i < nget; i++) { + pollfd = (apr_pollfd_t *)(pollcb->port_set[i].portev_user); + pollfd->rtnevents = get_revent(pollcb->port_set[i].portev_events); + + rv = func(baton, pollfd); + if (rv) { + return rv; + } + } + } + + return rv; +} + #endif /* POLLSET_USES_PORT */ From 95d6fc9667f91e5c2fc769d030f78bf8f2a3b742 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 4 Jul 2007 10:01:04 +0000 Subject: [PATCH 5868/7878] * misc/unix/rand.c (apr_generate_random_bytes): Handle EINTR from read(). PR: 39790 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@553146 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/rand.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 7af77eb5afc..c1e1e8f60db 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -101,7 +101,10 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, if ((fd = open(DEV_RANDOM, O_RDONLY)) == -1) return errno; - rc = read(fd, buf, length); + do { + rc = read(fd, buf, length); + } while (rc == -1 && errno == EINTR); + if (rc < 0) { int errnum = errno; close(fd); From c63bc2a81a1a4d0fab13dc1730dcb4a1ac33659a Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Wed, 4 Jul 2007 18:17:21 +0000 Subject: [PATCH 5869/7878] This patch tries to address some of the apr_atomic problems by reorganizing the various backends. The generic implementation is used when no specialized implementation fits the defined criterias, or when the user forces the choice. PR: 42806 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@553289 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 464 ---------------------------- atomic/unix/mutex.c | 192 ++++++++++++ configure.in | 2 +- include/arch/unix/apr_arch_atomic.h | 35 +++ 4 files changed, 228 insertions(+), 465 deletions(-) delete mode 100644 atomic/unix/apr_atomic.c create mode 100644 atomic/unix/mutex.c create mode 100644 include/arch/unix/apr_arch_atomic.h diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c deleted file mode 100644 index 2bd645e0570..00000000000 --- a/atomic/unix/apr_atomic.c +++ /dev/null @@ -1,464 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "apr.h" -#include "apr_atomic.h" -#include "apr_thread_mutex.h" - -#include "apr_private.h" - -#include -#if (defined(SOLARIS2) && SOLARIS2 >= 10) -#include -#endif - -#if defined(__GNUC__) && defined(__STRICT_ANSI__) && !defined(USE_GENERIC_ATOMICS) -/* force use of generic atomics if building e.g. with -std=c89, which - * doesn't allow inline asm */ -#define USE_GENERIC_ATOMICS -#endif - -#if (defined(__i386__) || defined(__x86_64__)) \ - && defined(__GNUC__) && !defined(USE_GENERIC_ATOMICS) - -APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, - apr_uint32_t with, - apr_uint32_t cmp) -{ - apr_uint32_t prev; - - asm volatile ("lock; cmpxchgl %1, %2" - : "=a" (prev) - : "r" (with), "m" (*(mem)), "0"(cmp) - : "memory", "cc"); - return prev; -} -#define APR_OVERRIDE_ATOMIC_CAS32 - -static apr_uint32_t inline intel_atomic_add32(volatile apr_uint32_t *mem, - apr_uint32_t val) -{ - asm volatile ("lock; xaddl %0,%1" - : "=r"(val), "=m"(*mem) /* outputs */ - : "0"(val), "m"(*mem) /* inputs */ - : "memory", "cc"); - return val; -} - -APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, - apr_uint32_t val) -{ - return intel_atomic_add32(mem, val); -} -#define APR_OVERRIDE_ATOMIC_ADD32 - -APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - asm volatile ("lock; subl %1, %0" - : - : "m" (*(mem)), "r" (val) - : "memory", "cc"); -} -#define APR_OVERRIDE_ATOMIC_SUB32 - -APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) -{ - unsigned char prev; - - asm volatile ("lock; decl %1;\n\t" - "setnz %%al" - : "=a" (prev) - : "m" (*(mem)) - : "memory", "cc"); - return prev; -} -#define APR_OVERRIDE_ATOMIC_DEC32 - -APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) -{ - return intel_atomic_add32(mem, 1); -} -#define APR_OVERRIDE_ATOMIC_INC32 - -APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - *mem = val; -} -#define APR_OVERRIDE_ATOMIC_SET32 - -APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - apr_uint32_t prev = val; - - asm volatile ("lock; xchgl %0, %1" - : "=r" (prev) - : "m" (*(mem)), "0"(prev) - : "memory"); - return prev; -} -#define APR_OVERRIDE_ATOMIC_XCHG32 - -/*#define apr_atomic_init(pool) APR_SUCCESS*/ - -#endif /* (__linux__ || __EMX__ || __FreeBSD__) && __i386__ */ - -#if (defined(__PPC__) || defined(__ppc__)) && defined(__GNUC__) \ - && !defined(USE_GENERIC_ATOMICS) - -APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, - apr_uint32_t swap, - apr_uint32_t cmp) -{ - apr_uint32_t prev; - - asm volatile ("0:\n\t" /* retry local label */ - "lwarx %0,0,%1\n\t" /* load prev and reserve */ - "cmpw %0,%3\n\t" /* does it match cmp? */ - "bne- 1f\n\t" /* ...no, bail out */ - "stwcx. %2,0,%1\n\t" /* ...yes, conditionally - store swap */ - "bne- 0b\n\t" /* start over if we lost - the reservation */ - "1:" /* exit local label */ - - : "=&r"(prev) /* output */ - : "b" (mem), "r" (swap), "r"(cmp) /* inputs */ - : "memory", "cc"); /* clobbered */ - return prev; -} -#define APR_OVERRIDE_ATOMIC_CAS32 - -APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, - apr_uint32_t delta) -{ - apr_uint32_t prev, temp; - - asm volatile ("0:\n\t" /* retry local label */ - "lwarx %0,0,%2\n\t" /* load prev and reserve */ - "add %1,%0,%3\n\t" /* temp = prev + delta */ - "stwcx. %1,0,%2\n\t" /* conditionally store */ - "bne- 0b" /* start over if we lost - the reservation */ - - /*XXX find a cleaner way to define the temp - * it's not an output - */ - : "=&r" (prev), "=&r" (temp) /* output, temp */ - : "b" (mem), "r" (delta) /* inputs */ - : "memory", "cc"); /* clobbered */ - return prev; -} -#define APR_OVERRIDE_ATOMIC_ADD32 - -#endif /* __PPC__ && __GNUC__ */ - -#if (defined(SOLARIS2) && SOLARIS2 >= 10) \ - && !defined(USE_GENERIC_ATOMICS) - -#if !defined(APR_OVERRIDE_ATOMIC_CAS32) -APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, - apr_uint32_t with, - apr_uint32_t cmp) -{ - return atomic_cas_32(mem, cmp, with); -} -#define APR_OVERRIDE_ATOMIC_CAS32 -#endif /* APR_OVERRIDE_ATOMIC_CAS32 */ - -#if !defined(APR_OVERRIDE_ATOMIC_DEC32) -APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) -{ - apr_uint32_t prev = *mem; - atomic_dec_32(mem); - return prev != 1; -} -#define APR_OVERRIDE_ATOMIC_DEC32 -#endif /* APR_OVERRIDE_ATOMIC_DEC32 */ - -#if !defined(APR_OVERRIDE_ATOMIC_INC32) -APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) -{ - apr_uint32_t prev = *mem; - atomic_inc_32(mem); - return prev; -} -#define APR_OVERRIDE_ATOMIC_INC32 -#endif /* APR_OVERRIDE_ATOMIC_INC32 */ - -#if !defined(APR_OVERRIDE_ATOMIC_SET32) -APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - *mem = val; -} -#define APR_OVERRIDE_ATOMIC_SET32 -#endif /* APR_OVERRIDE_ATOMIC_SET32 */ - -#if !defined(APR_OVERRIDE_ATOMIC_XCHG32) -APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, - apr_uint32_t val) -{ - return atomic_swap_32(mem, val); -} -#define APR_OVERRIDE_ATOMIC_XCHG32 -#endif /* APR_OVERRIDE_ATOMIC_XCHG32 */ - -#endif /* SOLARIS2 && SOLARIS2 >= 10 */ - -#if !defined(APR_OVERRIDE_ATOMIC_INIT) - -#if APR_HAS_THREADS -#define NUM_ATOMIC_HASH 7 -/* shift by 2 to get rid of alignment issues */ -#define ATOMIC_HASH(x) (unsigned int)(((unsigned long)(x)>>2)%(unsigned int)NUM_ATOMIC_HASH) -static apr_thread_mutex_t **hash_mutex; -#endif /* APR_HAS_THREADS */ - -#if APR_HAS_THREADS -static apr_status_t atomic_cleanup(void *data) -{ - if (hash_mutex == data) - hash_mutex = NULL; - - return APR_SUCCESS; -} -#endif - -apr_status_t apr_atomic_init(apr_pool_t *p) -{ -#if APR_HAS_THREADS - int i; - apr_status_t rv; - - if (hash_mutex != NULL) - return APR_SUCCESS; - - hash_mutex = apr_palloc(p, sizeof(apr_thread_mutex_t*) * NUM_ATOMIC_HASH); - apr_pool_cleanup_register(p, hash_mutex, atomic_cleanup, - apr_pool_cleanup_null); - - for (i = 0; i < NUM_ATOMIC_HASH; i++) { - rv = apr_thread_mutex_create(&(hash_mutex[i]), - APR_THREAD_MUTEX_DEFAULT, p); - if (rv != APR_SUCCESS) { - return rv; - } - } -#endif /* APR_HAS_THREADS */ - return APR_SUCCESS; -} -#endif /* !defined(APR_OVERRIDE_ATOMIC_INIT) */ - -/* abort() if 'x' does not evaluate to APR_SUCCESS. */ -#define CHECK(x) do { if ((x) != APR_SUCCESS) abort(); } while (0) - -#if !defined(APR_OVERRIDE_ATOMIC_ADD32) -#if defined(APR_OVERRIDE_ATOMIC_CAS32) -apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - apr_uint32_t old_value, new_value; - - do { - old_value = *mem; - new_value = old_value + val; - } while (apr_atomic_cas32(mem, new_value, old_value) != old_value); - return old_value; -} -#else -apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - apr_uint32_t old_value; - -#if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - - CHECK(apr_thread_mutex_lock(lock)); - old_value = *mem; - *mem += val; - CHECK(apr_thread_mutex_unlock(lock)); -#else - old_value = *mem; - *mem += val; -#endif /* APR_HAS_THREADS */ - return old_value; -} -#endif /* defined(APR_OVERRIDE_ATOMIC_CAS32) */ -#endif /* !defined(APR_OVERRIDE_ATOMIC_ADD32) */ - -#if !defined(APR_OVERRIDE_ATOMIC_SUB32) -#if defined(APR_OVERRIDE_ATOMIC_CAS32) -void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - apr_uint32_t old_value, new_value; - - do { - old_value = *mem; - new_value = old_value - val; - } while (apr_atomic_cas32(mem, new_value, old_value) != old_value); -} -#else -void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ -#if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - - CHECK(apr_thread_mutex_lock(lock)); - *mem -= val; - CHECK(apr_thread_mutex_unlock(lock)); -#else - *mem -= val; -#endif /* APR_HAS_THREADS */ -} -#endif /* defined(APR_OVERRIDE_ATOMIC_CAS32) */ -#endif /* !defined(APR_OVERRIDE_ATOMIC_SUB32) */ - -#if !defined(APR_OVERRIDE_ATOMIC_SET32) -void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ -#if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - - CHECK(apr_thread_mutex_lock(lock)); - *mem = val; - CHECK(apr_thread_mutex_unlock(lock)); -#else - *mem = val; -#endif /* APR_HAS_THREADS */ -} -#endif /* !defined(APR_OVERRIDE_ATOMIC_SET32) */ - -#if !defined(APR_OVERRIDE_ATOMIC_INC32) -apr_uint32_t apr_atomic_inc32(volatile apr_uint32_t *mem) -{ - return apr_atomic_add32(mem, 1); -} -#endif /* !defined(APR_OVERRIDE_ATOMIC_INC32) */ - -#if !defined(APR_OVERRIDE_ATOMIC_DEC32) -#if defined(APR_OVERRIDE_ATOMIC_CAS32) -int apr_atomic_dec32(volatile apr_uint32_t *mem) -{ - apr_uint32_t old_value, new_value; - - do { - old_value = *mem; - new_value = old_value - 1; - } while (apr_atomic_cas32(mem, new_value, old_value) != old_value); - return old_value != 1; -} -#else -int apr_atomic_dec32(volatile apr_uint32_t *mem) -{ -#if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - apr_uint32_t new; - - CHECK(apr_thread_mutex_lock(lock)); - (*mem)--; - new = *mem; - CHECK(apr_thread_mutex_unlock(lock)); - return new; -#else - (*mem)--; - return *mem; -#endif /* APR_HAS_THREADS */ -} -#endif /* defined(APR_OVERRIDE_ATOMIC_CAS32) */ -#endif /* !defined(APR_OVERRIDE_ATOMIC_DEC32) */ - -#if !defined(APR_OVERRIDE_ATOMIC_CAS32) -apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, - apr_uint32_t cmp) -{ - apr_uint32_t prev; -#if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - - CHECK(apr_thread_mutex_lock(lock)); - prev = *mem; - if (prev == cmp) { - *mem = with; - } - CHECK(apr_thread_mutex_unlock(lock)); -#else - prev = *mem; - if (prev == cmp) { - *mem = with; - } -#endif /* APR_HAS_THREADS */ - return prev; -} -#endif /* !defined(APR_OVERRIDE_ATOMIC_CAS32) */ - -#if !defined(APR_OVERRIDE_ATOMIC_XCHG32) -#if defined(APR_OVERRIDE_ATOMIC_CAS32) -apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - apr_uint32_t prev; - do { - prev = *mem; - } while (apr_atomic_cas32(mem, val, prev) != prev); - return prev; -} -#else -apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) -{ - apr_uint32_t prev; -#if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - - CHECK(apr_thread_mutex_lock(lock)); - prev = *mem; - *mem = val; - CHECK(apr_thread_mutex_unlock(lock)); -#else - prev = *mem; - *mem = val; -#endif /* APR_HAS_THREADS */ - return prev; -} -#endif /* defined(APR_OVERRIDE_ATOMIC_CAS32) */ -#endif /* !defined(APR_OVERRIDE_ATOMIC_XCHG32) */ - -#if !defined(APR_OVERRIDE_ATOMIC_CASPTR) -void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) -{ - void *prev; -#if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - - CHECK(apr_thread_mutex_lock(lock)); - prev = *(void **)mem; - if (prev == cmp) { - *mem = with; - } - CHECK(apr_thread_mutex_unlock(lock)); -#else - prev = *(void **)mem; - if (prev == cmp) { - *mem = with; - } -#endif /* APR_HAS_THREADS */ - return prev; -} -#endif /* !defined(APR_OVERRIDE_ATOMIC_CASPTR) */ - -#if !defined(APR_OVERRIDE_ATOMIC_READ32) -APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) -{ - return *mem; -} -#endif - diff --git a/atomic/unix/mutex.c b/atomic/unix/mutex.c new file mode 100644 index 00000000000..17b605fcdea --- /dev/null +++ b/atomic/unix/mutex.c @@ -0,0 +1,192 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_arch_atomic.h" + +#ifdef USE_ATOMICS_GENERIC + +#include + +#if APR_HAS_THREADS +# define DECLARE_MUTEX_LOCKED(name, mem) \ + apr_thread_mutex_t *name = mutex_hash(mem) +# define MUTEX_UNLOCK(name) \ + do { \ + if (apr_thread_mutex_unlock(name) != APR_SUCCESS) \ + abort(); \ + } while (0) +#else +# define DECLARE_MUTEX_LOCKED(name, mem) +# define MUTEX_UNLOCK(name) +# warning Be warned: using stubs for all atomic operations +#endif + +#if APR_HAS_THREADS + +static apr_thread_mutex_t **hash_mutex; + +#define NUM_ATOMIC_HASH 7 +/* shift by 2 to get rid of alignment issues */ +#define ATOMIC_HASH(x) (unsigned int)(((unsigned long)(x)>>2)%(unsigned int)NUM_ATOMIC_HASH) + +static apr_status_t atomic_cleanup(void *data) +{ + if (hash_mutex == data) + hash_mutex = NULL; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) +{ + int i; + apr_status_t rv; + + if (hash_mutex != NULL) + return APR_SUCCESS; + + hash_mutex = apr_palloc(p, sizeof(apr_thread_mutex_t*) * NUM_ATOMIC_HASH); + apr_pool_cleanup_register(p, hash_mutex, atomic_cleanup, + apr_pool_cleanup_null); + + for (i = 0; i < NUM_ATOMIC_HASH; i++) { + rv = apr_thread_mutex_create(&(hash_mutex[i]), + APR_THREAD_MUTEX_DEFAULT, p); + if (rv != APR_SUCCESS) { + return rv; + } + } + + return APR_SUCCESS; +} + +static APR_INLINE apr_thread_mutex_t *mutex_hash(volatile apr_uint32_t *mem) +{ + apr_thread_mutex_t *mutex = hash_mutex[ATOMIC_HASH(mem)]; + + if (apr_thread_mutex_lock(mutex) != APR_SUCCESS) { + abort(); + } + + return mutex; +} + +#else + +APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) +{ + return APR_SUCCESS; +} + +#endif /* APR_HAS_THREADS */ + +APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) +{ + return *mem; +} + +APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + DECLARE_MUTEX_LOCKED(mutex, mem); + + *mem = val; + + MUTEX_UNLOCK(mutex); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t old_value; + DECLARE_MUTEX_LOCKED(mutex, mem); + + old_value = *mem; + *mem += val; + + MUTEX_UNLOCK(mutex); + + return old_value; +} + +APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + DECLARE_MUTEX_LOCKED(mutex, mem); + *mem -= val; + MUTEX_UNLOCK(mutex); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) +{ + return apr_atomic_add32(mem, 1); +} + +APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + apr_uint32_t new; + DECLARE_MUTEX_LOCKED(mutex, mem); + + (*mem)--; + new = *mem; + + MUTEX_UNLOCK(mutex); + + return new; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, + apr_uint32_t cmp) +{ + apr_uint32_t prev; + DECLARE_MUTEX_LOCKED(mutex, mem); + + prev = *mem; + if (prev == cmp) { + *mem = with; + } + + MUTEX_UNLOCK(mutex); + + return prev; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t prev; + DECLARE_MUTEX_LOCKED(mutex, mem); + + prev = *mem; + *mem = val; + + MUTEX_UNLOCK(mutex); + + return prev; +} + +APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + void *prev; + DECLARE_MUTEX_LOCKED(mutex, *mem); + + prev = *(void **)mem; + if (prev == cmp) { + *mem = with; + } + + MUTEX_UNLOCK(mutex); + + return prev; +} + +#endif /* USE_ATOMICS_GENERIC */ diff --git a/configure.in b/configure.in index 6d053e66944..8c4776eec38 100644 --- a/configure.in +++ b/configure.in @@ -495,7 +495,7 @@ esac ]) if test $force_generic_atomics = yes; then - AC_DEFINE([USE_GENERIC_ATOMICS], 1, + AC_DEFINE([USE_ATOMICS_GENERIC], 1, [Define if use of generic atomics is requested]) fi diff --git a/include/arch/unix/apr_arch_atomic.h b/include/arch/unix/apr_arch_atomic.h new file mode 100644 index 00000000000..0c9f8744630 --- /dev/null +++ b/include/arch/unix/apr_arch_atomic.h @@ -0,0 +1,35 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ATOMIC_H +#define ATOMIC_H + +#include "apr.h" +#include "apr_private.h" +#include "apr_atomic.h" +#include "apr_thread_mutex.h" + +#if defined(USE_ATOMICS_GENERIC) +/* noop */ +#elif defined(__GNUC__) && defined(__STRICT_ANSI__) +/* force use of generic atomics if building e.g. with -std=c89, which + * doesn't allow inline asm */ +# define USE_ATOMICS_GENERIC +#else +# define USE_ATOMICS_GENERIC +#endif + +#endif /* ATOMIC_H */ From 3c46580c12d87ad1b0397df76e40e2d40c30d4c8 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Wed, 4 Jul 2007 18:18:51 +0000 Subject: [PATCH 5870/7878] Given a modern compiler, this patch provides fast atomic operations on various platforms (alpha, ia32, ia64, powerpc, etc). Tested on: 2x Pentium D, Ubuntu 7.04, gcc 4.1.2 16x Itanium II, RHEL 5, gcc 4.1.1 PR: 42806 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@553290 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/builtins.c | 74 +++++++++++++++++++++++++++++ configure.in | 42 ++++++++++++++++ include/arch/unix/apr_arch_atomic.h | 2 + 3 files changed, 118 insertions(+) create mode 100644 atomic/unix/builtins.c diff --git a/atomic/unix/builtins.c b/atomic/unix/builtins.c new file mode 100644 index 00000000000..27459961410 --- /dev/null +++ b/atomic/unix/builtins.c @@ -0,0 +1,74 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_arch_atomic.h" + +#ifdef USE_ATOMICS_BUILTINS + +APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) +{ + return APR_SUCCESS; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) +{ + return *mem; +} + +APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + *mem = val; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + return __sync_fetch_and_add(mem, val); +} + +APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + __sync_fetch_and_sub(mem, val); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) +{ + return __sync_fetch_and_add(mem, 1); +} + +APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + return __sync_sub_and_fetch(mem, 1); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, + apr_uint32_t cmp) +{ + return __sync_val_compare_and_swap(mem, cmp, with); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + __sync_synchronize(); + + return __sync_lock_test_and_set(mem, val); +} + +APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + return (void*) __sync_val_compare_and_swap(mem, cmp, with); +} + +#endif /* USE_ATOMICS_BUILTINS */ diff --git a/configure.in b/configure.in index 8c4776eec38..c026dc03308 100644 --- a/configure.in +++ b/configure.in @@ -350,6 +350,48 @@ case "$host:$CC" in ;; esac +AC_CACHE_CHECK([whether the compiler provides atomic builtins], [atomic_builtins], +[AC_TRY_RUN([ +int main() +{ + unsigned long val = 1010, tmp, *mem = &val; + + if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020) + return 1; + + tmp = val; + + if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010) + return 1; + + if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0) + return 1; + + tmp = 3030; + + if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp) + return 1; + + if (__sync_lock_test_and_set(&val, 4040) != 3030) + return 1; + + mem = &tmp; + + if (__sync_val_compare_and_swap(&mem, &tmp, &val) != &tmp) + return 1; + + __sync_synchronize(); + + if (mem != &val) + return 1; + + return 0; +}], [atomic_builtins=yes], [atomic_builtins=no], [atomic_builtins=no])]) + +if test "$atomic_builtins" = "yes"; then + AC_DEFINE(HAVE_ATOMIC_BUILTINS, 1, [Define if compiler provides atomic builtins]) +fi + dnl Check the depend program we can use APR_CHECK_DEPEND diff --git a/include/arch/unix/apr_arch_atomic.h b/include/arch/unix/apr_arch_atomic.h index 0c9f8744630..f081658273d 100644 --- a/include/arch/unix/apr_arch_atomic.h +++ b/include/arch/unix/apr_arch_atomic.h @@ -28,6 +28,8 @@ /* force use of generic atomics if building e.g. with -std=c89, which * doesn't allow inline asm */ # define USE_ATOMICS_GENERIC +#elif HAVE_ATOMIC_BUILTINS +# define USE_ATOMICS_BUILTINS #else # define USE_ATOMICS_GENERIC #endif From 4267c9a08ccc34483136d3b77781ded849f1fd62 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Wed, 4 Jul 2007 18:20:32 +0000 Subject: [PATCH 5871/7878] New apr_atomic implementation for ia32 (x86 and x86_64) native atomic operations, plus apr_atomic_casptr. PR: 42806 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@553291 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/ia32.c | 111 ++++++++++++++++++++++++++++ include/arch/unix/apr_arch_atomic.h | 2 + 2 files changed, 113 insertions(+) create mode 100644 atomic/unix/ia32.c diff --git a/atomic/unix/ia32.c b/atomic/unix/ia32.c new file mode 100644 index 00000000000..bcf9d5661df --- /dev/null +++ b/atomic/unix/ia32.c @@ -0,0 +1,111 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_arch_atomic.h" + +#ifdef USE_ATOMICS_IA32 + +APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) +{ + return APR_SUCCESS; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) +{ + return *mem; +} + +APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + *mem = val; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + asm volatile ("lock; xaddl %0,%1" + : "=r" (val), "=m" (*mem) + : "0" (val), "m" (*mem) + : "memory", "cc"); + return val; +} + +APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + asm volatile ("lock; subl %1, %0" + : /* no output */ + : "m" (*(mem)), "r" (val) + : "memory", "cc"); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) +{ + return apr_atomic_add32(mem, 1); +} + +APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + unsigned char prev; + + asm volatile ("lock; decl %0; setnz %1" + : "=m" (*mem), "=qm" (prev) + : "m" (*mem) + : "memory"); + + return prev; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, + apr_uint32_t cmp) +{ + apr_uint32_t prev; + + asm volatile ("lock; cmpxchgl %1, %2" + : "=a" (prev) + : "r" (with), "m" (*(mem)), "0"(cmp) + : "memory", "cc"); + return prev; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t prev = val; + + asm volatile ("lock; xchgl %0, %1" + : "=r" (prev) + : "m" (*(mem)), "0"(prev) + : "memory"); + return prev; +} + +APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + void *prev; +#if APR_SIZEOF_VOIDP == 4 + asm volatile ("lock; cmpxchgl %2, %1" + : "=a" (prev), "=m" (*mem) + : "r" (with), "m" (*mem), "0" (cmp)); +#elif APR_SIZEOF_VOIDP == 8 + asm volatile ("lock; cmpxchgq %q2, %1" + : "=a" (prev), "=m" (*mem) + : "r" ((unsigned long)with), "m" (*mem), + "0" ((unsigned long)cmp)); +#else +#error APR_SIZEOF_VOIDP value not supported +#endif + return prev; +} + +#endif /* USE_ATOMICS_IA32 */ diff --git a/include/arch/unix/apr_arch_atomic.h b/include/arch/unix/apr_arch_atomic.h index f081658273d..cadf3ff393a 100644 --- a/include/arch/unix/apr_arch_atomic.h +++ b/include/arch/unix/apr_arch_atomic.h @@ -30,6 +30,8 @@ # define USE_ATOMICS_GENERIC #elif HAVE_ATOMIC_BUILTINS # define USE_ATOMICS_BUILTINS +#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) +# define USE_ATOMICS_IA32 #else # define USE_ATOMICS_GENERIC #endif From 10faed10250edc003376f3480747ab48b745f374 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Wed, 4 Jul 2007 18:21:32 +0000 Subject: [PATCH 5872/7878] New apr_atomic implementation for Solaris 10 native atomic operations. PR: 42806 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@553292 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/solaris.c | 74 +++++++++++++++++++++++++++++ include/arch/unix/apr_arch_atomic.h | 2 + 2 files changed, 76 insertions(+) create mode 100644 atomic/unix/solaris.c diff --git a/atomic/unix/solaris.c b/atomic/unix/solaris.c new file mode 100644 index 00000000000..f74a7ef2d0c --- /dev/null +++ b/atomic/unix/solaris.c @@ -0,0 +1,74 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_arch_atomic.h" + +#ifdef USE_ATOMICS_SOLARIS + +#include + +APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) +{ + return APR_SUCCESS; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) +{ + return *mem; +} + +APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + *mem = val; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + return atomic_add_32_nv(mem, val) - val; +} + +APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + atomic_add_32(mem, -val); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) +{ + return atomic_inc_32_nv(mem) - 1; +} + +APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + return atomic_dec_32_nv(mem); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, + apr_uint32_t cmp) +{ + return atomic_cas_32(mem, cmp, with); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + return atomic_swap_32(mem, val); +} + +APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + return atomic_cas_ptr(mem, cmp, with); +} + +#endif /* USE_ATOMICS_SOLARIS */ diff --git a/include/arch/unix/apr_arch_atomic.h b/include/arch/unix/apr_arch_atomic.h index cadf3ff393a..f506fb79706 100644 --- a/include/arch/unix/apr_arch_atomic.h +++ b/include/arch/unix/apr_arch_atomic.h @@ -32,6 +32,8 @@ # define USE_ATOMICS_BUILTINS #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) # define USE_ATOMICS_IA32 +#elif defined(SOLARIS2) && SOLARIS2 >= 10 +# define USE_ATOMICS_SOLARIS #else # define USE_ATOMICS_GENERIC #endif From 1cde1834caa797dff245e536f1bdabeecfce9262 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Wed, 4 Jul 2007 18:22:26 +0000 Subject: [PATCH 5873/7878] New apr_atomic implementation for PowerPC native atomic operations. PR: 42806 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@553293 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/ppc.c | 178 ++++++++++++++++++++++++++++ configure.in | 9 ++ include/arch/unix/apr_arch_atomic.h | 2 + 3 files changed, 189 insertions(+) create mode 100644 atomic/unix/ppc.c diff --git a/atomic/unix/ppc.c b/atomic/unix/ppc.c new file mode 100644 index 00000000000..149347eae66 --- /dev/null +++ b/atomic/unix/ppc.c @@ -0,0 +1,178 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_arch_atomic.h" + +#ifdef USE_ATOMICS_PPC + +#ifdef PPC405_ERRATA +# define PPC405_ERR77_SYNC " sync\n" +#else +# define PPC405_ERR77_SYNC +#endif + +APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) +{ + return APR_SUCCESS; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) +{ + return *mem; +} + +APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + *mem = val; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t prev, temp; + + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%3\n" /* load and reserve */ + " add %1,%0,%4\n" /* add val and prev */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %1,0,%3\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + : "=&r" (prev), "=&r" (temp), "=m" (*mem) + : "b" (mem), "r" (val) + : "cc", "memory"); + + return prev; +} + +APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t temp; + + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%2\n" /* load and reserve */ + " subf %0,%3,%0\n" /* subtract val */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %0,0,%2\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + : "=&r" (temp), "=m" (*mem) + : "b" (mem), "r" (val) + : "cc", "memory"); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) +{ + apr_uint32_t prev; + + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%2\n" /* load and reserve */ + " addi %0,%0,1\n" /* add immediate */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %0,0,%2\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + " subi %0,%0,1\n" /* return old value */ + : "=&b" (prev), "=m" (*mem) + : "b" (mem), "m" (*mem) + : "cc", "memory"); + + return prev; +} + +APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + apr_uint32_t prev; + + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%2\n" /* load and reserve */ + " subi %0,%0,1\n" /* subtract immediate */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %0,0,%2\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + : "=&b" (prev), "=m" (*mem) + : "b" (mem), "m" (*mem) + : "cc", "memory"); + + return prev; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, + apr_uint32_t cmp) +{ + apr_uint32_t prev; + + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%1\n" /* load and reserve */ + " cmpw %0,%3\n" /* compare operands */ + " bne- exit_%=\n" /* skip if not equal */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %2,0,%1\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + "exit_%=:\n" /* not equal */ + : "=&r" (prev) + : "b" (mem), "r" (with), "r" (cmp) + : "cc", "memory"); + + return prev; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t prev; + + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%1\n" /* load and reserve */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %2,0,%1\n" /* store new value */ + " bne- loop_%=" /* loop if lost */ + : "=&r" (prev) + : "b" (mem), "r" (val) + : "cc", "memory"); + + return prev; +} + +APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + void *prev; +#if APR_SIZEOF_VOIDP == 4 + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%1\n" /* load and reserve */ + " cmpw %0,%3\n" /* compare operands */ + " bne- exit_%=\n" /* skip if not equal */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %2,0,%1\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + "exit_%=:\n" /* not equal */ + : "=&r" (prev) + : "b" (mem), "r" (with), "r" (cmp) + : "cc", "memory"); +#elif APR_SIZEOF_VOIDP == 8 + asm volatile ("loop_%=:\n" /* lost reservation */ + " ldarx %0,0,%1\n" /* load and reserve */ + " cmpd %0,%3\n" /* compare operands */ + " bne- exit_%=\n" /* skip if not equal */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stdcx. %2,0,%1\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + "exit_%=:\n" /* not equal */ + : "=&r" (prev) + : "b" (mem), "r" (with), "r" (cmp) + : "cc", "memory"); +#else +#error APR_SIZEOF_VOIDP value not supported +#endif + return prev; +} + +#endif /* USE_ATOMICS_PPC */ diff --git a/configure.in b/configure.in index c026dc03308..ce42501315d 100644 --- a/configure.in +++ b/configure.in @@ -392,6 +392,15 @@ if test "$atomic_builtins" = "yes"; then AC_DEFINE(HAVE_ATOMIC_BUILTINS, 1, [Define if compiler provides atomic builtins]) fi +case $host in + powerpc-405-*) + # The IBM ppc405cr processor has a bugged stwcx instruction. + AC_DEFINE(PPC405_ERRATA, 1, [Define on PowerPC 405 where errata 77 applies]) + ;; + *) + ;; +esac + dnl Check the depend program we can use APR_CHECK_DEPEND diff --git a/include/arch/unix/apr_arch_atomic.h b/include/arch/unix/apr_arch_atomic.h index f506fb79706..6b020c89875 100644 --- a/include/arch/unix/apr_arch_atomic.h +++ b/include/arch/unix/apr_arch_atomic.h @@ -34,6 +34,8 @@ # define USE_ATOMICS_IA32 #elif defined(SOLARIS2) && SOLARIS2 >= 10 # define USE_ATOMICS_SOLARIS +#elif defined(__GNUC__) && (defined(__PPC__) || defined(__ppc__)) +# define USE_ATOMICS_PPC #else # define USE_ATOMICS_GENERIC #endif From 3958f9b94b02d150f540d24e2390be2a884adcb9 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 5 Jul 2007 00:06:44 +0000 Subject: [PATCH 5874/7878] Remove test code that is commented out. While at it, clean up the code a bit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@553350 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 69 +++++++++++++++-------------------------------- 1 file changed, 21 insertions(+), 48 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index d39242db823..f67ca726878 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -210,51 +210,38 @@ static void test_inc_neg1(abts_case *tc, void *data) #if APR_HAS_THREADS -void * APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data); -void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data); -void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data); +void *APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data); +void *APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data); apr_thread_mutex_t *thread_lock; -volatile apr_uint32_t x = 0; /* mutex locks */ -volatile apr_uint32_t y = 0; /* atomic operations */ -volatile apr_uint32_t z = 0; /* no locks */ +volatile apr_uint32_t mutex_locks = 0; +volatile apr_uint32_t atomic_ops = 0; apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ #define NUM_THREADS 40 #define NUM_ITERATIONS 20000 -void * APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data) +void *APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data) { int i; for (i = 0; i < NUM_ITERATIONS; i++) { apr_thread_mutex_lock(thread_lock); - x++; + mutex_locks++; apr_thread_mutex_unlock(thread_lock); } apr_thread_exit(thd, exit_ret_val); return NULL; -} - -void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data) -{ - int i; - - for (i = 0; i < NUM_ITERATIONS ; i++) { - apr_atomic_inc32(&y); - apr_atomic_add32(&y, 2); - apr_atomic_dec32(&y); - apr_atomic_dec32(&y); - } - apr_thread_exit(thd, exit_ret_val); - return NULL; } -void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data) +void *APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data) { int i; for (i = 0; i < NUM_ITERATIONS ; i++) { - z++; + apr_atomic_inc32(&atomic_ops); + apr_atomic_add32(&atomic_ops, 2); + apr_atomic_dec32(&atomic_ops); + apr_atomic_dec32(&atomic_ops); } apr_thread_exit(thd, exit_ret_val); return NULL; @@ -264,10 +251,6 @@ static void test_atomics_threaded(abts_case *tc, void *data) { apr_thread_t *t1[NUM_THREADS]; apr_thread_t *t2[NUM_THREADS]; - apr_thread_t *t3[NUM_THREADS]; - apr_status_t s1[NUM_THREADS]; - apr_status_t s2[NUM_THREADS]; - apr_status_t s3[NUM_THREADS]; apr_status_t rv; int i; @@ -279,34 +262,24 @@ static void test_atomics_threaded(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "Could not create lock", rv); for (i = 0; i < NUM_THREADS; i++) { - apr_status_t r1, r2, r3; + apr_status_t r1, r2; r1 = apr_thread_create(&t1[i], NULL, thread_func_mutex, NULL, p); r2 = apr_thread_create(&t2[i], NULL, thread_func_atomic, NULL, p); - r3 = apr_thread_create(&t3[i], NULL, thread_func_none, NULL, p); - ABTS_ASSERT(tc, "Failed creating threads", - r1 == APR_SUCCESS && r2 == APR_SUCCESS && - r3 == APR_SUCCESS); + ABTS_ASSERT(tc, "Failed creating threads", !r1 && !r2); } for (i = 0; i < NUM_THREADS; i++) { - apr_thread_join(&s1[i], t1[i]); - apr_thread_join(&s2[i], t2[i]); - apr_thread_join(&s3[i], t3[i]); - + apr_status_t s1, s2; + apr_thread_join(&s1, t1[i]); + apr_thread_join(&s2, t2[i]); + ABTS_ASSERT(tc, "Invalid return value from thread_join", - s1[i] == exit_ret_val && s2[i] == exit_ret_val && - s3[i] == exit_ret_val); + s1 == exit_ret_val && s2 == exit_ret_val); } - ABTS_INT_EQUAL(tc, x, NUM_THREADS * NUM_ITERATIONS); - ABTS_INT_EQUAL(tc, apr_atomic_read32(&y), NUM_THREADS * NUM_ITERATIONS); - /* Comment out this test, because I have no clue what this test is - * actually telling us. We are checking something that may or may not - * be true, and it isn't really testing APR at all. - ABTS_ASSERT(tc, "We expect this to fail, because we tried to update " - "an integer in a non-thread-safe manner.", - z != NUM_THREADS * NUM_ITERATIONS); - */ + ABTS_INT_EQUAL(tc, mutex_locks, NUM_THREADS * NUM_ITERATIONS); + ABTS_INT_EQUAL(tc, apr_atomic_read32(&atomic_ops), + NUM_THREADS * NUM_ITERATIONS); } #endif /* !APR_HAS_THREADS */ From 133b807cd3edec196e87ef1d982a473e7e8e4241 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 5 Jul 2007 14:15:47 +0000 Subject: [PATCH 5875/7878] Add a threaded atomic test that busy-loops on a count variable. Once the count variable meets a predetermined value for each thread, the count will be atomically changed, triggering another busy-loop (on another thread), and so on.. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@553514 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 201 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) diff --git a/test/testatomic.c b/test/testatomic.c index f67ca726878..74409b3bd4d 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -220,6 +220,7 @@ apr_status_t exit_ret_val = 123; /* just some made up number to check on later * #define NUM_THREADS 40 #define NUM_ITERATIONS 20000 + void *APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data) { int i; @@ -280,6 +281,205 @@ static void test_atomics_threaded(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, mutex_locks, NUM_THREADS * NUM_ITERATIONS); ABTS_INT_EQUAL(tc, apr_atomic_read32(&atomic_ops), NUM_THREADS * NUM_ITERATIONS); + + rv = apr_thread_mutex_destroy(thread_lock); + ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS); +} + +#undef NUM_THREADS +#define NUM_THREADS 7 + +typedef struct tbox_t tbox_t; + +struct tbox_t { + abts_case *tc; + apr_uint32_t *mem; + apr_uint32_t preval; + apr_uint32_t postval; + apr_uint32_t loop; + void (*func)(tbox_t *box); +}; + +static void busyloop_set32(tbox_t *tbox) +{ + apr_uint32_t val; + + do { + do { + val = apr_atomic_read32(tbox->mem); + } while (val != tbox->preval); + + apr_atomic_set32(tbox->mem, tbox->postval); + } while (--tbox->loop); +} + +static void busyloop_add32(tbox_t *tbox) +{ + apr_uint32_t val; + + do { + do { + val = apr_atomic_read32(tbox->mem); + } while (val != tbox->preval); + + val = apr_atomic_add32(tbox->mem, tbox->postval); + + apr_thread_mutex_lock(thread_lock); + ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); + apr_thread_mutex_unlock(thread_lock); + } while (--tbox->loop); +} + +static void busyloop_sub32(tbox_t *tbox) +{ + apr_uint32_t val; + + do { + do { + val = apr_atomic_read32(tbox->mem); + } while (val != tbox->preval); + + apr_atomic_sub32(tbox->mem, tbox->postval); + } while (--tbox->loop); +} + +static void busyloop_inc32(tbox_t *tbox) +{ + apr_uint32_t val; + + do { + do { + val = apr_atomic_read32(tbox->mem); + } while (val != tbox->preval); + + val = apr_atomic_inc32(tbox->mem); + + apr_thread_mutex_lock(thread_lock); + ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); + apr_thread_mutex_unlock(thread_lock); + } while (--tbox->loop); +} + +static void busyloop_dec32(tbox_t *tbox) +{ + apr_uint32_t val; + + do { + do { + val = apr_atomic_read32(tbox->mem); + } while (val != tbox->preval); + + val = apr_atomic_dec32(tbox->mem); + + apr_thread_mutex_lock(thread_lock); + ABTS_INT_NEQUAL(tbox->tc, val, 0); + apr_thread_mutex_unlock(thread_lock); + } while (--tbox->loop); +} + +static void busyloop_cas32(tbox_t *tbox) +{ + apr_uint32_t val; + + do { + do { + val = apr_atomic_cas32(tbox->mem, tbox->postval, tbox->preval); + } while (val != tbox->preval); + } while (--tbox->loop); +} + +static void busyloop_xchg32(tbox_t *tbox) +{ + apr_uint32_t val; + + do { + do { + val = apr_atomic_read32(tbox->mem); + } while (val != tbox->preval); + + val = apr_atomic_xchg32(tbox->mem, tbox->postval); + + apr_thread_mutex_lock(thread_lock); + ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); + apr_thread_mutex_unlock(thread_lock); + } while (--tbox->loop); +} + +void *APR_THREAD_FUNC thread_func_busyloop(apr_thread_t *thd, void *data) +{ + tbox_t *tbox = data; + + tbox->func(tbox); + + return NULL; +} + +static void test_atomics_busyloop_threaded(abts_case *tc, void *data) +{ + unsigned int i; + apr_status_t rv; + apr_uint32_t count = 0; + tbox_t tbox[NUM_THREADS]; + apr_thread_t *thread[NUM_THREADS]; + + rv = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "Could not create lock", rv); + + /* get ready */ + for (i = 0; i < NUM_THREADS; i++) { + tbox[i].tc = tc; + tbox[i].mem = &count; + tbox[i].loop = 5; + } + + tbox[0].preval = 98; + tbox[0].postval = 3891; + tbox[0].func = busyloop_add32; + + tbox[1].preval = 3989; + tbox[1].postval = 1010; + tbox[1].func = busyloop_sub32; + + tbox[2].preval = 2979; + tbox[2].postval = 0; /* not used */ + tbox[2].func = busyloop_inc32; + + tbox[3].preval = 2980; + tbox[3].postval = 16384; + tbox[3].func = busyloop_set32; + + tbox[4].preval = 16384; + tbox[4].postval = 0; /* not used */ + tbox[4].func = busyloop_dec32; + + tbox[5].preval = 16383; + tbox[5].postval = 1048576; + tbox[5].func = busyloop_cas32; + + tbox[6].preval = 1048576; + tbox[6].postval = 98; /* goto tbox[0] */ + tbox[6].func = busyloop_xchg32; + + /* get set */ + for (i = 0; i < NUM_THREADS; i++) { + rv = apr_thread_create(&thread[i], NULL, thread_func_busyloop, + &tbox[i], p); + ABTS_ASSERT(tc, "Failed creating thread", rv == APR_SUCCESS); + } + + /* go! */ + apr_atomic_set32(tbox->mem, 98); + + for (i = 0; i < NUM_THREADS; i++) { + apr_status_t retval; + rv = apr_thread_join(&retval, thread[i]); + ABTS_ASSERT(tc, "Thread join failed", rv == APR_SUCCESS); + } + + ABTS_INT_EQUAL(tbox->tc, count, 98); + + rv = apr_thread_mutex_destroy(thread_lock); + ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS); } #endif /* !APR_HAS_THREADS */ @@ -307,6 +507,7 @@ abts_suite *testatomic(abts_suite *suite) #if APR_HAS_THREADS abts_run_test(suite, test_atomics_threaded, NULL); + abts_run_test(suite, test_atomics_busyloop_threaded, NULL); #endif return suite; From f32a971f4108d5129b9459358cd2adb8ac32e22d Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 5 Jul 2007 18:36:48 +0000 Subject: [PATCH 5876/7878] Call apr_thread_exit() on thread exit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@553604 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/testatomic.c b/test/testatomic.c index 74409b3bd4d..33a82c1fd39 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -411,6 +411,8 @@ void *APR_THREAD_FUNC thread_func_busyloop(apr_thread_t *thd, void *data) tbox->func(tbox); + apr_thread_exit(thd, 0); + return NULL; } @@ -474,6 +476,7 @@ static void test_atomics_busyloop_threaded(abts_case *tc, void *data) apr_status_t retval; rv = apr_thread_join(&retval, thread[i]); ABTS_ASSERT(tc, "Thread join failed", rv == APR_SUCCESS); + ABTS_ASSERT(tc, "Invalid return value from thread_join", retval == 0); } ABTS_INT_EQUAL(tbox->tc, count, 98); From fc0dd5d6f162816487048253462fda41bfb03c07 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 5 Jul 2007 21:59:18 +0000 Subject: [PATCH 5877/7878] open(2) reads: mode must be specified when O_CREAT is in the flags. Submitted by: Rainer Jung PR: 42821 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@553652 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index ce42501315d..4ee1b65122c 100644 --- a/configure.in +++ b/configure.in @@ -507,7 +507,7 @@ void main(void) if (sizeof(off64_t) != 8 || sizeof(off_t) != 4) exit(1); - if ((fd = open("conftest.lfs", O_LARGEFILE|O_CREAT|O_WRONLY)) < 0) + if ((fd = open("conftest.lfs", O_LARGEFILE|O_CREAT|O_WRONLY, 0644)) < 0) exit(2); if (ftruncate64(fd, off) != 0) ret = 3; From 9be30b97d82c217f9ff70ac26da9c52ad1fe5545 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 6 Jul 2007 00:46:53 +0000 Subject: [PATCH 5878/7878] Convert wide* types to the portable apr types. Conversion table: wide_int apr_int32_t u_wide_int apr_uint32_t widest_int apr_int64_t u_widest_int apr_uint64_t bool_int int Passes testfmt. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@553679 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 115 ++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 65 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 5710c73c1de..0213964e41d 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -53,18 +53,6 @@ typedef enum { #define TRUE 1 #endif #define NUL '\0' -#define WIDE_INT long - -typedef WIDE_INT wide_int; -typedef unsigned WIDE_INT u_wide_int; -typedef apr_int64_t widest_int; -#ifdef __TANDEM -/* Although Tandem supports "long long" there is no unsigned variant. */ -typedef unsigned long u_widest_int; -#else -typedef apr_uint64_t u_widest_int; -#endif -typedef int bool_int; #define S_NULL "(null)" #define S_NULL_LEN 6 @@ -338,12 +326,12 @@ while (width > len) * (conv_10_quad), the other when we don't (conv_10). We're assuming the * latter is faster. */ -static char *conv_10(register wide_int num, register bool_int is_unsigned, - register bool_int *is_negative, char *buf_end, +static char *conv_10(register apr_int32_t num, register int is_unsigned, + register int *is_negative, char *buf_end, register apr_size_t *len) { register char *p = buf_end; - register u_wide_int magnitude = num; + register apr_uint32_t magnitude = num; if (is_unsigned) { *is_negative = FALSE; @@ -361,8 +349,8 @@ static char *conv_10(register wide_int num, register bool_int is_unsigned, * d. add 1 */ if (*is_negative) { - wide_int t = num + 1; - magnitude = ((u_wide_int) -t) + 1; + apr_int32_t t = num + 1; + magnitude = ((apr_uint32_t) -t) + 1; } } @@ -370,7 +358,7 @@ static char *conv_10(register wide_int num, register bool_int is_unsigned, * We use a do-while loop so that we write at least 1 digit */ do { - register u_wide_int new_magnitude = magnitude / 10; + register apr_uint32_t new_magnitude = magnitude / 10; *--p = (char) (magnitude - new_magnitude * 10 + '0'); magnitude = new_magnitude; @@ -381,22 +369,21 @@ static char *conv_10(register wide_int num, register bool_int is_unsigned, return (p); } -static char *conv_10_quad(widest_int num, register bool_int is_unsigned, - register bool_int *is_negative, char *buf_end, +static char *conv_10_quad(apr_int64_t num, register int is_unsigned, + register int *is_negative, char *buf_end, register apr_size_t *len) { register char *p = buf_end; - u_widest_int magnitude = num; + apr_uint64_t magnitude = num; /* * We see if we can use the faster non-quad version by checking the * number against the largest long value it can be. If <=, we * punt to the quicker version. */ - if ((magnitude <= ULONG_MAX && is_unsigned) - || (num <= LONG_MAX && num >= LONG_MIN && !is_unsigned)) - return(conv_10( (wide_int)num, is_unsigned, is_negative, - buf_end, len)); + if ((magnitude <= UINT32_MAX && is_unsigned) + || (num <= INT32_MAX && num >= INT32_MIN && !is_unsigned)) + return(conv_10(num, is_unsigned, is_negative, buf_end, len)); if (is_unsigned) { *is_negative = FALSE; @@ -414,8 +401,8 @@ static char *conv_10_quad(widest_int num, register bool_int is_unsigned, * d. add 1 */ if (*is_negative) { - widest_int t = num + 1; - magnitude = ((u_widest_int) -t) + 1; + apr_int64_t t = num + 1; + magnitude = ((apr_uint64_t) -t) + 1; } } @@ -423,7 +410,7 @@ static char *conv_10_quad(widest_int num, register bool_int is_unsigned, * We use a do-while loop so that we write at least 1 digit */ do { - u_widest_int new_magnitude = magnitude / 10; + apr_uint64_t new_magnitude = magnitude / 10; *--p = (char) (magnitude - new_magnitude * 10 + '0'); magnitude = new_magnitude; @@ -434,13 +421,11 @@ static char *conv_10_quad(widest_int num, register bool_int is_unsigned, return (p); } - - static char *conv_in_addr(struct in_addr *ia, char *buf_end, apr_size_t *len) { unsigned addr = ntohl(ia->s_addr); char *p = buf_end; - bool_int is_negative; + int is_negative; apr_size_t sub_len; p = conv_10((addr & 0x000000FF) , TRUE, &is_negative, p, &sub_len); @@ -461,7 +446,7 @@ static char *conv_in_addr(struct in_addr *ia, char *buf_end, apr_size_t *len) static char *conv_apr_sockaddr(apr_sockaddr_t *sa, char *buf_end, apr_size_t *len) { char *p = buf_end; - bool_int is_negative; + int is_negative; apr_size_t sub_len; char *ipaddr_str; @@ -529,7 +514,7 @@ static char *conv_os_thread_t(apr_os_thread_t *tid, char *buf_end, apr_size_t *l * in buf). */ static char *conv_fp(register char format, register double num, - boolean_e add_dp, int precision, bool_int *is_negative, + boolean_e add_dp, int precision, int *is_negative, char *buf, apr_size_t *len) { register char *s = buf; @@ -585,12 +570,12 @@ static char *conv_fp(register char format, register double num, if (format != 'f') { char temp[EXPONENT_LENGTH]; /* for exponent conversion */ apr_size_t t_len; - bool_int exponent_is_negative; + int exponent_is_negative; *s++ = format; /* either e or E */ decimal_point--; if (decimal_point != 0) { - p = conv_10((wide_int) decimal_point, FALSE, &exponent_is_negative, + p = conv_10((apr_int32_t) decimal_point, FALSE, &exponent_is_negative, &temp[EXPONENT_LENGTH], &t_len); *s++ = exponent_is_negative ? '-' : '+'; @@ -627,7 +612,7 @@ static char *conv_fp(register char format, register double num, * As with conv_10, we have a faster version which is used when * the number isn't quad size. */ -static char *conv_p2(register u_wide_int num, register int nbits, +static char *conv_p2(register apr_uint32_t num, register int nbits, char format, char *buf_end, register apr_size_t *len) { register int mask = (1 << nbits) - 1; @@ -646,7 +631,7 @@ static char *conv_p2(register u_wide_int num, register int nbits, return (p); } -static char *conv_p2_quad(u_widest_int num, register int nbits, +static char *conv_p2_quad(apr_uint64_t num, register int nbits, char format, char *buf_end, register apr_size_t *len) { register int mask = (1 << nbits) - 1; @@ -655,8 +640,8 @@ static char *conv_p2_quad(u_widest_int num, register int nbits, static const char upper_digits[] = "0123456789ABCDEF"; register const char *digits = (format == 'X') ? upper_digits : low_digits; - if (num <= ULONG_MAX) - return(conv_p2((u_wide_int)num, nbits, format, buf_end, len)); + if (num <= UINT32_MAX) + return(conv_p2((apr_uint32_t)num, nbits, format, buf_end, len)); do { *--p = digits[num & mask]; @@ -715,10 +700,10 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), char prefix_char; double fp_num; - widest_int i_quad = (widest_int) 0; - u_widest_int ui_quad; - wide_int i_num = (wide_int) 0; - u_wide_int ui_num; + apr_int64_t i_quad = 0; + apr_uint64_t ui_quad; + apr_int32_t i_num = 0; + apr_uint32_t ui_num; char num_buf[NUM_BUF_SIZE]; char char_buf[2]; /* for printing %% and % */ @@ -736,7 +721,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), boolean_e print_blank; boolean_e adjust_precision; boolean_e adjust_width; - bool_int is_negative; + int is_negative; sp = vbuff->curpos; bep = vbuff->endpos; @@ -869,17 +854,17 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), switch (*fmt) { case 'u': if (var_type == IS_QUAD) { - i_quad = va_arg(ap, u_widest_int); + i_quad = va_arg(ap, apr_uint64_t); s = conv_10_quad(i_quad, 1, &is_negative, &num_buf[NUM_BUF_SIZE], &s_len); } else { if (var_type == IS_LONG) - i_num = (wide_int) va_arg(ap, u_wide_int); + i_num = (apr_int32_t) va_arg(ap, apr_uint32_t); else if (var_type == IS_SHORT) - i_num = (wide_int) (unsigned short) va_arg(ap, unsigned int); + i_num = (apr_int32_t) (unsigned short) va_arg(ap, unsigned int); else - i_num = (wide_int) va_arg(ap, unsigned int); + i_num = (apr_int32_t) va_arg(ap, unsigned int); s = conv_10(i_num, 1, &is_negative, &num_buf[NUM_BUF_SIZE], &s_len); } @@ -889,17 +874,17 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), case 'd': case 'i': if (var_type == IS_QUAD) { - i_quad = va_arg(ap, widest_int); + i_quad = va_arg(ap, apr_int64_t); s = conv_10_quad(i_quad, 0, &is_negative, &num_buf[NUM_BUF_SIZE], &s_len); } else { if (var_type == IS_LONG) - i_num = (wide_int) va_arg(ap, wide_int); + i_num = va_arg(ap, apr_int32_t); else if (var_type == IS_SHORT) - i_num = (wide_int) (short) va_arg(ap, int); + i_num = (short) va_arg(ap, int); else - i_num = (wide_int) va_arg(ap, int); + i_num = va_arg(ap, int); s = conv_10(i_num, 0, &is_negative, &num_buf[NUM_BUF_SIZE], &s_len); } @@ -916,17 +901,17 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), case 'o': if (var_type == IS_QUAD) { - ui_quad = va_arg(ap, u_widest_int); + ui_quad = va_arg(ap, apr_uint64_t); s = conv_p2_quad(ui_quad, 3, *fmt, &num_buf[NUM_BUF_SIZE], &s_len); } else { if (var_type == IS_LONG) - ui_num = (u_wide_int) va_arg(ap, u_wide_int); + ui_num = va_arg(ap, apr_uint32_t); else if (var_type == IS_SHORT) - ui_num = (u_wide_int) (unsigned short) va_arg(ap, unsigned int); + ui_num = (unsigned short) va_arg(ap, unsigned int); else - ui_num = (u_wide_int) va_arg(ap, unsigned int); + ui_num = va_arg(ap, unsigned int); s = conv_p2(ui_num, 3, *fmt, &num_buf[NUM_BUF_SIZE], &s_len); } @@ -941,17 +926,17 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), case 'x': case 'X': if (var_type == IS_QUAD) { - ui_quad = va_arg(ap, u_widest_int); + ui_quad = va_arg(ap, apr_uint64_t); s = conv_p2_quad(ui_quad, 4, *fmt, &num_buf[NUM_BUF_SIZE], &s_len); } else { if (var_type == IS_LONG) - ui_num = (u_wide_int) va_arg(ap, u_wide_int); + ui_num = va_arg(ap, apr_uint32_t); else if (var_type == IS_SHORT) - ui_num = (u_wide_int) (unsigned short) va_arg(ap, unsigned int); + ui_num = (unsigned short) va_arg(ap, unsigned int); else - ui_num = (u_wide_int) va_arg(ap, unsigned int); + ui_num = va_arg(ap, unsigned int); s = conv_p2(ui_num, 4, *fmt, &num_buf[NUM_BUF_SIZE], &s_len); } @@ -1089,7 +1074,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), case 'n': if (var_type == IS_QUAD) - *(va_arg(ap, widest_int *)) = cc; + *(va_arg(ap, apr_int64_t *)) = cc; else if (var_type == IS_LONG) *(va_arg(ap, long *)) = cc; else if (var_type == IS_SHORT) @@ -1113,14 +1098,14 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), */ case 'p': #if APR_SIZEOF_VOIDP == 8 - if (sizeof(void *) <= sizeof(u_widest_int)) { - ui_quad = (u_widest_int) va_arg(ap, void *); + if (sizeof(void *) <= sizeof(apr_uint64_t)) { + ui_quad = (apr_uint64_t) va_arg(ap, void *); s = conv_p2_quad(ui_quad, 4, 'x', &num_buf[NUM_BUF_SIZE], &s_len); } #else - if (sizeof(void *) <= sizeof(u_wide_int)) { - ui_num = (u_wide_int) va_arg(ap, void *); + if (sizeof(void *) <= sizeof(apr_uint32_t)) { + ui_num = (apr_uint32_t) va_arg(ap, void *); s = conv_p2(ui_num, 4, 'x', &num_buf[NUM_BUF_SIZE], &s_len); } From f8bb5181572bf9aeafc0f7a037e27c0ce8d9fc27 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 6 Jul 2007 01:01:18 +0000 Subject: [PATCH 5879/7878] Rework apr_file_writev_full so it tries to writev() data before resorting to a plain write. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@553682 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/fullrw.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index 9ad27ec99b3..59173b4a663 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -72,10 +72,36 @@ APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile, apr_size_t amt = 0; apr_size_t total = 0; - for (i = 0; i < nvec && rv == APR_SUCCESS; i++) { - rv = apr_file_write_full(thefile, vec[i].iov_base, + for (i = 0; i < nvec; i++) { + total += vec[i].iov_len; + } + + rv = apr_file_writev(thefile, vec, nvec, &amt); + + if (bytes_written != NULL) + *bytes_written = amt; + + if (rv != APR_SUCCESS || (amt == total)) { + return rv; + } + + for (i = 0; i < nvec && amt; i++) { + if (amt >= vec[i].iov_len) { + amt -= vec[i].iov_len; + } + else { + break; + } + } + + if (amt) { + rv = apr_file_write_full(thefile, vec[i].iov_base + amt, + vec[i].iov_len - amt, NULL); + } + + for (; i < nvec && rv == APR_SUCCESS; i++) { + rv = apr_file_write_full(thefile, vec[i].iov_base, vec[i].iov_len, &amt); - total += amt; } if (bytes_written != NULL) From 787f4ea02ef485e255b437f65527948d13a672b1 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 6 Jul 2007 12:31:45 +0000 Subject: [PATCH 5880/7878] The test can run faster by relinquishing the processor when the count value is not the thread pre-value. This change lets increase the number of loops. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@553863 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 57 ++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index 33a82c1fd39..66326356fe1 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -300,15 +300,26 @@ struct tbox_t { void (*func)(tbox_t *box); }; -static void busyloop_set32(tbox_t *tbox) +static APR_INLINE void busyloop_read32(tbox_t *tbox) { apr_uint32_t val; do { - do { - val = apr_atomic_read32(tbox->mem); - } while (val != tbox->preval); + val = apr_atomic_read32(tbox->mem); + + if (val != tbox->preval) + apr_thread_yield(); + else + break; + } while (1); +} + +static void busyloop_set32(tbox_t *tbox) +{ + apr_uint32_t val; + do { + busyloop_read32(tbox); apr_atomic_set32(tbox->mem, tbox->postval); } while (--tbox->loop); } @@ -318,12 +329,8 @@ static void busyloop_add32(tbox_t *tbox) apr_uint32_t val; do { - do { - val = apr_atomic_read32(tbox->mem); - } while (val != tbox->preval); - + busyloop_read32(tbox); val = apr_atomic_add32(tbox->mem, tbox->postval); - apr_thread_mutex_lock(thread_lock); ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); apr_thread_mutex_unlock(thread_lock); @@ -335,10 +342,7 @@ static void busyloop_sub32(tbox_t *tbox) apr_uint32_t val; do { - do { - val = apr_atomic_read32(tbox->mem); - } while (val != tbox->preval); - + busyloop_read32(tbox); apr_atomic_sub32(tbox->mem, tbox->postval); } while (--tbox->loop); } @@ -348,12 +352,8 @@ static void busyloop_inc32(tbox_t *tbox) apr_uint32_t val; do { - do { - val = apr_atomic_read32(tbox->mem); - } while (val != tbox->preval); - + busyloop_read32(tbox); val = apr_atomic_inc32(tbox->mem); - apr_thread_mutex_lock(thread_lock); ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); apr_thread_mutex_unlock(thread_lock); @@ -365,12 +365,8 @@ static void busyloop_dec32(tbox_t *tbox) apr_uint32_t val; do { - do { - val = apr_atomic_read32(tbox->mem); - } while (val != tbox->preval); - + busyloop_read32(tbox); val = apr_atomic_dec32(tbox->mem); - apr_thread_mutex_lock(thread_lock); ABTS_INT_NEQUAL(tbox->tc, val, 0); apr_thread_mutex_unlock(thread_lock); @@ -384,7 +380,12 @@ static void busyloop_cas32(tbox_t *tbox) do { do { val = apr_atomic_cas32(tbox->mem, tbox->postval, tbox->preval); - } while (val != tbox->preval); + + if (val != tbox->preval) + apr_thread_yield(); + else + break; + } while (1); } while (--tbox->loop); } @@ -393,12 +394,8 @@ static void busyloop_xchg32(tbox_t *tbox) apr_uint32_t val; do { - do { - val = apr_atomic_read32(tbox->mem); - } while (val != tbox->preval); - + busyloop_read32(tbox); val = apr_atomic_xchg32(tbox->mem, tbox->postval); - apr_thread_mutex_lock(thread_lock); ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); apr_thread_mutex_unlock(thread_lock); @@ -431,7 +428,7 @@ static void test_atomics_busyloop_threaded(abts_case *tc, void *data) for (i = 0; i < NUM_THREADS; i++) { tbox[i].tc = tc; tbox[i].mem = &count; - tbox[i].loop = 5; + tbox[i].loop = 50; } tbox[0].preval = 98; From 1cfe931f0d1cc1798bba030b86e797221aa6166b Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sat, 7 Jul 2007 00:11:50 +0000 Subject: [PATCH 5881/7878] New apr_atomic implementation for S/390 native atomic operations. Tested on: RHEL AS 4 (Nahant Update 4), IBM/S390, running under VM (64 bit mode), gcc 3.4.6 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@554095 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/s390.c | 132 ++++++++++++++++++++++++++++ include/arch/unix/apr_arch_atomic.h | 2 + 2 files changed, 134 insertions(+) create mode 100644 atomic/unix/s390.c diff --git a/atomic/unix/s390.c b/atomic/unix/s390.c new file mode 100644 index 00000000000..a81ffdd16a0 --- /dev/null +++ b/atomic/unix/s390.c @@ -0,0 +1,132 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_arch_atomic.h" + +#ifdef USE_ATOMICS_S390 + +APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) +{ + return APR_SUCCESS; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) +{ + return *mem; +} + +APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + *mem = val; +} + +static APR_INLINE apr_uint32_t atomic_add(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t prev = *mem, temp; + + asm volatile ("loop_%=:\n" + " lr %1,%0\n" + " alr %1,%3\n" + " cs %0,%1,%2\n" + " jl loop_%=\n" + : "+d" (prev), "+d" (temp), "=Q" (*mem) + : "d" (val), "m" (*mem) + : "cc", "memory"); + + return prev; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + return atomic_add(mem, val); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) +{ + return atomic_add(mem, 1); +} + +static APR_INLINE apr_uint32_t atomic_sub(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t prev = *mem, temp; + + asm volatile ("loop_%=:\n" + " lr %1,%0\n" + " slr %1,%3\n" + " cs %0,%1,%2\n" + " jl loop_%=\n" + : "+d" (prev), "+d" (temp), "=Q" (*mem) + : "d" (val), "m" (*mem) + : "cc", "memory"); + + return temp; +} + +APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + atomic_sub(mem, val); +} + +APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +{ + return atomic_sub(mem, 1); +} + +APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, + apr_uint32_t cmp) +{ + asm volatile (" cs %0,%2,%1\n" + : "+d" (cmp), "=Q" (*mem) + : "d" (with), "m" (*mem) + : "cc", "memory"); + + return cmp; +} + +APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t prev = *mem; + + asm volatile ("loop_%=:\n" + " cs %0,%2,%1\n" + " jl loop_%=\n" + : "+d" (prev), "=Q" (*mem) + : "d" (val), "m" (*mem) + : "cc", "memory"); + + return prev; +} + +APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + void *prev = (void *) cmp; +#if APR_SIZEOF_VOIDP == 4 + asm volatile (" cs %0,%2,%1\n" + : "+d" (prev), "=Q" (*mem) + : "d" (with), "m" (*mem) + : "cc", "memory"); +#elif APR_SIZEOF_VOIDP == 8 + asm volatile (" csg %0,%2,%1\n" + : "+d" (prev), "=Q" (*mem) + : "d" (with), "m" (*mem) + : "cc", "memory"); +#else +#error APR_SIZEOF_VOIDP value not supported +#endif + return prev; +} + +#endif /* USE_ATOMICS_S390 */ diff --git a/include/arch/unix/apr_arch_atomic.h b/include/arch/unix/apr_arch_atomic.h index 6b020c89875..0f533fac443 100644 --- a/include/arch/unix/apr_arch_atomic.h +++ b/include/arch/unix/apr_arch_atomic.h @@ -36,6 +36,8 @@ # define USE_ATOMICS_SOLARIS #elif defined(__GNUC__) && (defined(__PPC__) || defined(__ppc__)) # define USE_ATOMICS_PPC +#elif defined(__GNUC__) && (defined(__s390__) || defined(__s390x__)) +# define USE_ATOMICS_S390 #else # define USE_ATOMICS_GENERIC #endif From 6c072e42a83ee9df39707631d2b2bed543b85fa9 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sun, 8 Jul 2007 02:03:49 +0000 Subject: [PATCH 5882/7878] Remove unused variables and make thread function local. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@554294 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index 66326356fe1..b9fe6279d48 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -316,8 +316,6 @@ static APR_INLINE void busyloop_read32(tbox_t *tbox) static void busyloop_set32(tbox_t *tbox) { - apr_uint32_t val; - do { busyloop_read32(tbox); apr_atomic_set32(tbox->mem, tbox->postval); @@ -339,8 +337,6 @@ static void busyloop_add32(tbox_t *tbox) static void busyloop_sub32(tbox_t *tbox) { - apr_uint32_t val; - do { busyloop_read32(tbox); apr_atomic_sub32(tbox->mem, tbox->postval); @@ -402,7 +398,7 @@ static void busyloop_xchg32(tbox_t *tbox) } while (--tbox->loop); } -void *APR_THREAD_FUNC thread_func_busyloop(apr_thread_t *thd, void *data) +static void *APR_THREAD_FUNC thread_func_busyloop(apr_thread_t *thd, void *data) { tbox_t *tbox = data; From 0c69d04472ae05023805e0ee2b333ab2a58d851a Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Mon, 9 Jul 2007 16:05:59 +0000 Subject: [PATCH 5883/7878] Introduce macro definitions of the min/max characteristics of the apr integer types. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@554692 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 58 ++++++++++++++++++++++++++++-- include/apr.hnw | 60 +++++++++++++++++++++++++++++-- include/apr.hw | 58 ++++++++++++++++++++++++++++-- include/arch/apr_private_common.h | 1 - strings/apr_snprintf.c | 8 ++--- 5 files changed, 173 insertions(+), 12 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 7d60c489ac2..9d37d5c3f37 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -269,10 +269,10 @@ typedef unsigned char apr_byte_t; typedef @short_value@ apr_int16_t; typedef unsigned @short_value@ apr_uint16_t; - + typedef @int_value@ apr_int32_t; typedef unsigned @int_value@ apr_uint32_t; - + typedef @long_value@ apr_int64_t; typedef unsigned @long_value@ apr_uint64_t; @@ -290,6 +290,60 @@ typedef @socklen_t_value@ apr_socklen_t; @int64_literal@ @uint64_literal@ +#ifdef INT16_MIN +#define APR_INT16_MIN INT16_MIN +#else +#define APR_INT16_MIN (-0x7fff - 1) +#endif + +#ifdef INT16_MAX +#define APR_INT16_MAX INT16_MAX +#else +#define APR_INT16_MAX (0x7fff) +#endif + +#ifdef UINT16_MAX +#define APR_UINT16_MAX UINT16_MAX +#else +#define APR_UINT16_MAX (0xffff) +#endif + +#ifdef INT32_MIN +#define APR_INT32_MIN INT32_MIN +#else +#define APR_INT32_MIN (-0x7fffffff - 1) +#endif + +#ifdef INT32_MAX +#define APR_INT32_MAX INT32_MAX +#else +#define APR_INT32_MAX 0x7fffffff +#endif + +#ifdef UINT32_MAX +#define APR_UINT32_MAX UINT32_MAX +#else +#define APR_UINT32_MAX (0xffffffffU) +#endif + +#ifdef INT64_MIN +#define APR_INT64_MIN INT64_MIN +#else +#define APR_INT64_MIN (APR_INT64_C(-0x7fffffffffffffff) - 1) +#endif + +#ifdef INT64_MAX +#define APR_INT64_MAX INT64_MAX +#else +#define APR_INT64_MAX APR_INT64_C(0x7fffffffffffffff) +#endif + +#ifdef UINT64_MAX +#define APR_UINT64_MAX UINT64_MAX +#else +#define APR_UINT64_MAX APR_UINT64_C(0xffffffffffffffff) +#endif + /* Definitions that APR programs need to work properly. */ /** diff --git a/include/apr.hnw b/include/apr.hnw index 2af98b37880..5722e956bd9 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -236,11 +236,11 @@ typedef unsigned char apr_byte_t; typedef short apr_int16_t; typedef unsigned short apr_uint16_t; - + typedef int apr_int32_t; typedef unsigned int apr_uint32_t; - -typedef long long apr_int64_t; + +typedef long long apr_int64_t; typedef unsigned long long apr_uint64_t; typedef size_t apr_size_t; @@ -270,6 +270,60 @@ typedef size_t apr_socklen_t; #define APR_INT64_C(val) (val##LL) #define APR_UINT64_C(val) (val##ULL) +#ifdef INT16_MIN +#define APR_INT16_MIN INT16_MIN +#else +#define APR_INT16_MIN (-0x7fff - 1) +#endif + +#ifdef INT16_MAX +#define APR_INT16_MAX INT16_MAX +#else +#define APR_INT16_MAX (0x7fff) +#endif + +#ifdef UINT16_MAX +#define APR_UINT16_MAX UINT16_MAX +#else +#define APR_UINT16_MAX (0xffff) +#endif + +#ifdef INT32_MIN +#define APR_INT32_MIN INT32_MIN +#else +#define APR_INT32_MIN (-0x7fffffff - 1) +#endif + +#ifdef INT32_MAX +#define APR_INT32_MAX INT32_MAX +#else +#define APR_INT32_MAX 0x7fffffff +#endif + +#ifdef UINT32_MAX +#define APR_UINT32_MAX UINT32_MAX +#else +#define APR_UINT32_MAX (0xffffffffU) +#endif + +#ifdef INT64_MIN +#define APR_INT64_MIN INT64_MIN +#else +#define APR_INT64_MIN (APR_INT64_C(-0x7fffffffffffffff) - 1) +#endif + +#ifdef INT64_MAX +#define APR_INT64_MAX INT64_MAX +#else +#define APR_INT64_MAX APR_INT64_C(0x7fffffffffffffff) +#endif + +#ifdef UINT64_MAX +#define APR_UINT64_MAX UINT64_MAX +#else +#define APR_UINT64_MAX APR_UINT64_C(0xffffffffffffffff) +#endif + /* PROC mutex is a GLOBAL mutex on Netware */ #define APR_PROC_MUTEX_IS_GLOBAL 1 diff --git a/include/apr.hw b/include/apr.hw index d00686e6c59..8883c13b2be 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -326,10 +326,10 @@ typedef unsigned char apr_byte_t; typedef short apr_int16_t; typedef unsigned short apr_uint16_t; - + typedef int apr_int32_t; typedef unsigned int apr_uint32_t; - + typedef __int64 apr_int64_t; typedef unsigned __int64 apr_uint64_t; @@ -375,6 +375,60 @@ typedef int gid_t; #define APR_UINT64_C(val) (val##ULL) #endif +#ifdef INT16_MIN +#define APR_INT16_MIN INT16_MIN +#else +#define APR_INT16_MIN (-0x7fff - 1) +#endif + +#ifdef INT16_MAX +#define APR_INT16_MAX INT16_MAX +#else +#define APR_INT16_MAX (0x7fff) +#endif + +#ifdef UINT16_MAX +#define APR_UINT16_MAX UINT16_MAX +#else +#define APR_UINT16_MAX (0xffff) +#endif + +#ifdef INT32_MIN +#define APR_INT32_MIN INT32_MIN +#else +#define APR_INT32_MIN (-0x7fffffff - 1) +#endif + +#ifdef INT32_MAX +#define APR_INT32_MAX INT32_MAX +#else +#define APR_INT32_MAX 0x7fffffff +#endif + +#ifdef UINT32_MAX +#define APR_UINT32_MAX UINT32_MAX +#else +#define APR_UINT32_MAX (0xffffffffU) +#endif + +#ifdef INT64_MIN +#define APR_INT64_MIN INT64_MIN +#else +#define APR_INT64_MIN (APR_INT64_C(-0x7fffffffffffffff) - 1) +#endif + +#ifdef INT64_MAX +#define APR_INT64_MAX INT64_MAX +#else +#define APR_INT64_MAX APR_INT64_C(0x7fffffffffffffff) +#endif + +#ifdef UINT64_MAX +#define APR_UINT64_MAX UINT64_MAX +#else +#define APR_UINT64_MAX APR_UINT64_C(0xffffffffffffffff) +#endif + #if APR_HAVE_IPV6 /* Appears in later flavors, not the originals. */ diff --git a/include/arch/apr_private_common.h b/include/arch/apr_private_common.h index 9cd52ecf22c..ec850c6525e 100644 --- a/include/arch/apr_private_common.h +++ b/include/arch/apr_private_common.h @@ -37,6 +37,5 @@ apr_status_t apr_filepath_list_merge_impl(char **liststr, /* temporary defines to handle 64bit compile mismatches */ #define APR_INT_TRUNC_CAST int #define APR_UINT32_TRUNC_CAST apr_uint32_t -#define APR_UINT32_MAX 0xFFFFFFFFUL #endif /*APR_PRIVATE_COMMON_H*/ diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 0213964e41d..9ede49e2ab0 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -381,9 +381,9 @@ static char *conv_10_quad(apr_int64_t num, register int is_unsigned, * number against the largest long value it can be. If <=, we * punt to the quicker version. */ - if ((magnitude <= UINT32_MAX && is_unsigned) - || (num <= INT32_MAX && num >= INT32_MIN && !is_unsigned)) - return(conv_10(num, is_unsigned, is_negative, buf_end, len)); + if ((magnitude <= APR_UINT32_MAX && is_unsigned) + || (num <= APR_INT32_MAX && num >= APR_INT32_MIN && !is_unsigned)) + return(conv_10((apr_int32_t)num, is_unsigned, is_negative, buf_end, len)); if (is_unsigned) { *is_negative = FALSE; @@ -640,7 +640,7 @@ static char *conv_p2_quad(apr_uint64_t num, register int nbits, static const char upper_digits[] = "0123456789ABCDEF"; register const char *digits = (format == 'X') ? upper_digits : low_digits; - if (num <= UINT32_MAX) + if (num <= APR_UINT32_MAX) return(conv_p2((apr_uint32_t)num, nbits, format, buf_end, len)); do { From ffe54c88ad7b565adcbe497a868e446564f3aacf Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 10 Jul 2007 14:39:03 +0000 Subject: [PATCH 5884/7878] Improve detection of the printf format identifiers for apr_ssize_t and apr_size_t using the gcc (and icc) built-in __builtin_types_compatible_p (used to determine if two types are the same). This could also be achieved with another gcc extension (type redeclaration), but using the built-in seems more forward compatible. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@554963 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 14 ++++++ configure.in | 112 +++++++++++++++++++++++++------------------- 2 files changed, 79 insertions(+), 47 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 1c17591ec0c..1b2b15947b2 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -959,3 +959,17 @@ fi AC_SUBST(MKDEP) ]) + +dnl +dnl APR_CHECK_TYPES_COMPATIBLE(TYPE-1, TYPE-2, [ACTION-IF-TRUE]) +dnl +dnl Try to determine whether two types are the same. Only works +dnl for gcc and icc. +dnl +AC_DEFUN([APR_CHECK_TYPES_COMPATIBLE], [ +define([apr_cvname], apr_cv_typematch_[]translit([$1], [ ], [_])_[]translit([$2], [ ], [_])) +AC_CACHE_CHECK([whether $1 and $2 are the same], apr_cvname, [ +AC_TRY_COMPILE(AC_INCLUDES_DEFAULT, [ + int foo[0 - !__builtin_types_compatible_p($1, $2)]; +], [apr_cvname=yes $3], [apr_cvname=no])]) +]) diff --git a/configure.in b/configure.in index 4ee1b65122c..c1059bdf1e0 100644 --- a/configure.in +++ b/configure.in @@ -1330,26 +1330,83 @@ else socklen_t_value="int" fi +# Basically, we have tried to figure out the correct format strings +# for APR types which vary between platforms, but we don't always get +# it right. +case $host in + s390*linux*) + # uniquely, the 31-bit Linux/s390 uses "unsigned long int" + # for size_t rather than "unsigned int": + size_t_fmt="lu" + ssize_t_fmt="ld" + ;; + *-os2*) + size_t_fmt="lu" + ;; + *-solaris*) + pid_t_fmt="ld" + ;; + *aix4*|*aix5*) + ssize_t_fmt="ld" + size_t_fmt="ld" + ;; + *beos*) + ssize_t_fmt="ld" + size_t_fmt="ld" + ;; + *apple-darwin*) + osver=`uname -r` + case $osver in + [[0-7]].*) + ssize_t_fmt="d" + ;; + *) + ssize_t_fmt="ld" + ;; + esac + size_t_fmt="lu" + ;; +esac + +APR_CHECK_TYPES_COMPATIBLE(ssize_t, int, [ssize_t_fmt="d"]) +APR_CHECK_TYPES_COMPATIBLE(ssize_t, long, [ssize_t_fmt="ld"]) +APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned int, [size_t_fmt="u"]) +APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned long, [size_t_fmt="lu"]) + APR_CHECK_SIZEOF_EXTENDED([#include ], ssize_t, 8) -if test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then - ssize_t_fmt='#define APR_SSIZE_T_FMT "d"' +AC_MSG_CHECKING([which format to use for apr_ssize_t]) +if test -n "$ssize_t_fmt"; then + AC_MSG_RESULT(%$ssize_t_fmt) +elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then + ssize_t_fmt="d" + AC_MSG_RESULT(%d) elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then - ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' + ssize_t_fmt="ld" + AC_MSG_RESULT(%ld) else - ssize_t_fmt='#error Can not determine the proper size for ssize_t' + AC_ERROR([could not determine the proper format for apr_ssize_t]) fi +ssize_t_fmt="#define APR_SSIZE_T_FMT \"$ssize_t_fmt\"" + APR_CHECK_SIZEOF_EXTENDED([#include ], size_t, 8) -if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then - size_t_fmt='#define APR_SIZE_T_FMT "d"' +AC_MSG_CHECKING([which format to use for apr_size_t]) +if test -n "$size_t_fmt"; then + AC_MSG_RESULT(%$size_t_fmt) +elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then + size_t_fmt="d" + AC_MSG_RESULT(%d) elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then - size_t_fmt='#define APR_SIZE_T_FMT "ld"' + size_t_fmt="ld" + AC_MSG_RESULT(%ld) else - size_t_fmt='#error Can not determine the proper size for size_t' + AC_ERROR([could not determine the proper format for apr_size_t]) fi +size_t_fmt="#define APR_SIZE_T_FMT \"$size_t_fmt\"" + APR_CHECK_SIZEOF_EXTENDED([#include ], off_t, 8) if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then @@ -1420,45 +1477,6 @@ else bigendian=0 fi -# Basically, we have tried to figure out the correct format strings -# for APR types which vary between platforms, but we don't always get -# it right. If you find that we don't get it right for your platform, -# you can override our decision below. -case $host in - s390*linux*) - # uniquely, the 31-bit Linux/s390 uses "unsigned long int" - # for size_t rather than "unsigned int": - size_t_fmt='#define APR_SIZE_T_FMT "lu"' - ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' - ;; - *-os2*) - size_t_fmt='#define APR_SIZE_T_FMT "lu"' - ;; - *-solaris*) - pid_t_fmt='#define APR_PID_T_FMT "ld"' - ;; - *aix4*|*aix5*) - ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' - size_t_fmt='#define APR_SIZE_T_FMT "ld"' - ;; - *beos*) - ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' - size_t_fmt='#define APR_SIZE_T_FMT "ld"' - ;; - *apple-darwin*) - osver=`uname -r` - case $osver in - [[0-7]].*) - ssize_t_fmt='#define APR_SSIZE_T_FMT "d"' - ;; - *) - ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' - ;; - esac - size_t_fmt='#define APR_SIZE_T_FMT "lu"' - ;; -esac - APR_CHECK_SIZEOF_EXTENDED([#include #include ],struct iovec,0) if test "$ac_cv_sizeof_struct_iovec" = "0"; then From e0c6b33546bbc356738d51efbcbdb2e06a183e39 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 10 Jul 2007 16:35:45 +0000 Subject: [PATCH 5885/7878] Introduce apr_atomic_xchgptr, which atomically exchanges a pair of pointer values. Missing OS/390 implementation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@554995 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/netware/apr_atomic.c | 5 +++++ atomic/unix/builtins.c | 7 +++++++ atomic/unix/ia32.c | 19 +++++++++++++++++++ atomic/unix/mutex.c | 13 +++++++++++++ atomic/unix/ppc.c | 31 +++++++++++++++++++++++++++++++ atomic/unix/s390.c | 23 +++++++++++++++++++++++ atomic/unix/solaris.c | 5 +++++ atomic/win32/apr_atomic.c | 13 +++++++++++++ include/apr_atomic.h | 8 ++++++++ test/testatomic.c | 12 ++++++++++++ 10 files changed, 136 insertions(+) diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index 94a3549775e..b5d965b09b2 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -68,3 +68,8 @@ APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const voi { return (void*)atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with); } + +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +{ + return (void*)atomic_xchg((unsigned long *)mem,(unsigned long)with); +} diff --git a/atomic/unix/builtins.c b/atomic/unix/builtins.c index 27459961410..745acf155c0 100644 --- a/atomic/unix/builtins.c +++ b/atomic/unix/builtins.c @@ -71,4 +71,11 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return (void*) __sync_val_compare_and_swap(mem, cmp, with); } +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +{ + __sync_synchronize(); + + return (void*) __sync_lock_test_and_set(mem, with); +} + #endif /* USE_ATOMICS_BUILTINS */ diff --git a/atomic/unix/ia32.c b/atomic/unix/ia32.c index bcf9d5661df..191298c4aa6 100644 --- a/atomic/unix/ia32.c +++ b/atomic/unix/ia32.c @@ -108,4 +108,23 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return prev; } +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +{ + void *prev; +#if APR_SIZEOF_VOIDP == 4 + asm volatile ("lock; xchgl %2, %1" + : "=a" (prev), "=m" (*mem) + : "r" (with), "m" (*mem) + : "memory"); +#elif APR_SIZEOF_VOIDP == 8 + asm volatile ("lock; xchgq %q2, %1" + : "=a" (prev), "=m" (*mem) + : "r" ((unsigned long)with), "m" (*mem) + : "memory"); +#else +#error APR_SIZEOF_VOIDP value not supported +#endif + return prev; +} + #endif /* USE_ATOMICS_IA32 */ diff --git a/atomic/unix/mutex.c b/atomic/unix/mutex.c index 17b605fcdea..cb23ede3479 100644 --- a/atomic/unix/mutex.c +++ b/atomic/unix/mutex.c @@ -189,4 +189,17 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return prev; } +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +{ + void *prev; + DECLARE_MUTEX_LOCKED(mutex, mem); + + prev = *mem; + *mem = with; + + MUTEX_UNLOCK(mutex); + + return prev; +} + #endif /* USE_ATOMICS_GENERIC */ diff --git a/atomic/unix/ppc.c b/atomic/unix/ppc.c index 149347eae66..d7673d5ee29 100644 --- a/atomic/unix/ppc.c +++ b/atomic/unix/ppc.c @@ -175,4 +175,35 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return prev; } +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +{ + void *prev; +#if APR_SIZEOF_VOIDP == 4 + asm volatile (PPC_SYNC + "loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%1\n" /* load and reserve */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %2,0,%1\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + " isync\n" /* memory barrier */ + : "=&r" (prev) + : "b" (mem), "r" (with) + : "cc", "memory"); +#elif APR_SIZEOF_VOIDP == 8 + asm volatile (PPC_SYNC + "loop_%=:\n" /* lost reservation */ + " ldarx %0,0,%1\n" /* load and reserve */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stdcx. %2,0,%1\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + " isync\n" /* memory barrier */ + : "=&r" (prev) + : "b" (mem), "r" (with) + : "cc", "memory"); +#else +#error APR_SIZEOF_VOIDP value not supported +#endif + return prev; +} + #endif /* USE_ATOMICS_PPC */ diff --git a/atomic/unix/s390.c b/atomic/unix/s390.c index a81ffdd16a0..3e2332077f4 100644 --- a/atomic/unix/s390.c +++ b/atomic/unix/s390.c @@ -129,4 +129,27 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return prev; } +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +{ + void *prev = (void *) *mem; +#if APR_SIZEOF_VOIDP == 4 + asm volatile ("loop_%=:\n" + " cs %0,%2,%1\n" + " jl loop_%=\n" + : "+d" (prev), "=Q" (*mem) + : "d" (with), "m" (*mem) + : "cc", "memory"); +#elif APR_SIZEOF_VOIDP == 8 + asm volatile ("loop_%=:\n" + " csg %0,%2,%1\n" + " jl loop_%=\n" + : "+d" (prev), "=Q" (*mem) + : "d" (with), "m" (*mem) + : "cc", "memory"); +#else +#error APR_SIZEOF_VOIDP value not supported +#endif + return prev; +} + #endif /* USE_ATOMICS_S390 */ diff --git a/atomic/unix/solaris.c b/atomic/unix/solaris.c index f74a7ef2d0c..ba544522f4f 100644 --- a/atomic/unix/solaris.c +++ b/atomic/unix/solaris.c @@ -71,4 +71,9 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return atomic_cas_ptr(mem, cmp, with); } +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +{ + return atomic_swap_ptr(mem, with); +} + #endif /* USE_ATOMICS_SOLARIS */ diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index e88f2e2564c..44e8ca2dd36 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -38,6 +38,9 @@ typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_val_fn) typedef WINBASEAPI void * (WINAPI * apr_atomic_win32_ptr_ptr_ptr_fn) (volatile void **, void *, const void *); +typedef WINBASEAPI void * (WINAPI * apr_atomic_win32_ptr_ptr_fn) + (volatile void **, + void *); APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { @@ -135,3 +138,13 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint return ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); #endif } + +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +{ +#if (defined(_M_IA64) || defined(_M_AMD64) || defined(__MINGW32__)) && !defined(RC_INVOKED) + return InterlockedExchangePointer((void**)mem, with); +#else + /* Too many VC6 users have stale win32 API files, stub this */ + return ((apr_atomic_win32_ptr_ptr_fn)InterlockedExchangePointer)(mem, with); +#endif +} diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 714780fe53a..60e4bb54d0e 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -123,6 +123,14 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint */ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); +/** + * exchange a pair of pointer values + * @param mem pointer to the pointer + * @param with what to swap it with + * @return the old value of the pointer + */ +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with); + /** @} */ #ifdef __cplusplus diff --git a/test/testatomic.c b/test/testatomic.c index b9fe6279d48..0d09d004e09 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -81,6 +81,17 @@ static void test_xchg32(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, 50, y32); } +static void test_xchgptr(abts_case *tc, void *data) +{ + int a; + volatile void *target_ptr = NULL; + void *old_ptr; + + old_ptr = apr_atomic_xchgptr(&target_ptr, &a); + ABTS_PTR_EQUAL(tc, NULL, old_ptr); + ABTS_PTR_EQUAL(tc, &a, (void *) target_ptr); +} + static void test_cas_equal(abts_case *tc, void *data) { apr_uint32_t casval = 0; @@ -489,6 +500,7 @@ abts_suite *testatomic(abts_suite *suite) abts_run_test(suite, test_read32, NULL); abts_run_test(suite, test_dec32, NULL); abts_run_test(suite, test_xchg32, NULL); + abts_run_test(suite, test_xchgptr, NULL); abts_run_test(suite, test_cas_equal, NULL); abts_run_test(suite, test_cas_equal_nonnull, NULL); abts_run_test(suite, test_cas_notequal, NULL); From b901d52f7dffa5cb91a9cae0d3b267bb76f6fe28 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Wed, 11 Jul 2007 13:00:51 +0000 Subject: [PATCH 5886/7878] Fix a mis-merge of PPC memory barriers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@555258 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/ppc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/atomic/unix/ppc.c b/atomic/unix/ppc.c index d7673d5ee29..db9fca934d3 100644 --- a/atomic/unix/ppc.c +++ b/atomic/unix/ppc.c @@ -179,8 +179,7 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) { void *prev; #if APR_SIZEOF_VOIDP == 4 - asm volatile (PPC_SYNC - "loop_%=:\n" /* lost reservation */ + asm volatile ("loop_%=:\n" /* lost reservation */ " lwarx %0,0,%1\n" /* load and reserve */ PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ " stwcx. %2,0,%1\n" /* store new value */ @@ -190,8 +189,7 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) : "b" (mem), "r" (with) : "cc", "memory"); #elif APR_SIZEOF_VOIDP == 8 - asm volatile (PPC_SYNC - "loop_%=:\n" /* lost reservation */ + asm volatile ("loop_%=:\n" /* lost reservation */ " ldarx %0,0,%1\n" /* load and reserve */ PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ " stdcx. %2,0,%1\n" /* store new value */ From 087c3e821e0a0afe894140ac0c20b3e20df7ac50 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 12 Jul 2007 14:23:13 +0000 Subject: [PATCH 5887/7878] Add helper macros for ring walking (APR_RING_FOREACH and APR_RING_FOREACH_SAFE). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@555640 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_ring.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/apr_ring.h b/include/apr_ring.h index eab1e69a843..a796816dcca 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -377,6 +377,30 @@ #define APR_RING_REMOVE(ep, link) \ APR_RING_UNSPLICE((ep), (ep), link) +/** + * Iterate over a ring + * @param ep The current element + * @param head The head of the ring + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_FOREACH(ep, head, elem, link) \ + for (ep = APR_RING_FIRST(head); \ + ep != APR_RING_SENTINEL(head, elem, link); \ + ep = APR_RING_NEXT(ep, link)) + +/** + * Iterate over a ring safe against removal of the current element + * @param ep1 The current element + * @param ep2 Iteration cursor + * @param head The head of the ring + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_FOREACH_SAFE(ep1, ep2, head, elem, link) \ + for (ep1 = APR_RING_FIRST(head), ep2 = APR_RING_NEXT(ep1, link); \ + ep1 != APR_RING_SENTINEL(head, elem, link); \ + ep1 = ep2, ep2 = APR_RING_NEXT(ep1, link)) /* Debugging tools: */ From 086293b84b3403bbc767ebd75628b8f227a64449 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 12 Jul 2007 16:52:25 +0000 Subject: [PATCH 5888/7878] Fix win32 stub for apr_atomic_xchgptr. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@555695 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/win32/apr_atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index 44e8ca2dd36..16e10ec298a 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -145,6 +145,6 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) return InterlockedExchangePointer((void**)mem, with); #else /* Too many VC6 users have stale win32 API files, stub this */ - return ((apr_atomic_win32_ptr_ptr_fn)InterlockedExchangePointer)(mem, with); + return ((apr_atomic_win32_ptr_ptr_fn)InterlockedExchange)(mem, with); #endif } From f7c5f440868481e93e204c50ad8b46c235ad52be Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 12 Jul 2007 19:29:43 +0000 Subject: [PATCH 5889/7878] Improve WIN32 condition variables fairness by using a generation count. The count assures that one thread won't steal wakeups from other threads in the queue. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@555730 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_thread_cond.h | 1 + locks/win32/thread_cond.c | 33 ++++++++++++++++------ test/testcond.c | 34 +++++++++++------------ 3 files changed, 42 insertions(+), 26 deletions(-) diff --git a/include/arch/win32/apr_arch_thread_cond.h b/include/arch/win32/apr_arch_thread_cond.h index 921a29375e4..c7f69f80646 100644 --- a/include/arch/win32/apr_arch_thread_cond.h +++ b/include/arch/win32/apr_arch_thread_cond.h @@ -25,6 +25,7 @@ struct apr_thread_cond_t { CRITICAL_SECTION csection; unsigned long num_waiting; unsigned long num_wake; + unsigned long generation; }; #endif /* THREAD_COND_H */ diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index ca478391e6e..60286e542d1 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -67,27 +67,43 @@ static APR_INLINE apr_status_t _thread_cond_timedwait(apr_thread_cond_t *cond, { DWORD res; apr_status_t rv; + unsigned int wake = 0; + unsigned long generation; EnterCriticalSection(&cond->csection); cond->num_waiting++; + generation = cond->generation; LeaveCriticalSection(&cond->csection); apr_thread_mutex_unlock(mutex); do { res = WaitForSingleObject(cond->semaphore, timeout_ms); + EnterCriticalSection(&cond->csection); + if (cond->num_wake) { - cond->num_wake--; - rv = APR_SUCCESS; - break; + if (cond->generation != generation) { + cond->num_wake--; + cond->num_waiting--; + rv = APR_SUCCESS; + break; + } else { + wake = 1; + } } else if (res != WAIT_OBJECT_0) { cond->num_waiting--; rv = APR_TIMEUP; break; } + LeaveCriticalSection(&cond->csection); + + if (wake) { + wake = 0; + ReleaseSemaphore(cond->semaphore, 1, NULL); + } } while (1); LeaveCriticalSection(&cond->csection); @@ -116,10 +132,10 @@ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) unsigned int wake = 0; EnterCriticalSection(&cond->csection); - if (cond->num_waiting) { + if (cond->num_waiting > cond->num_wake) { wake = 1; cond->num_wake++; - cond->num_waiting--; + cond->generation++; } LeaveCriticalSection(&cond->csection); @@ -135,9 +151,10 @@ APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) unsigned long num_wake = 0; EnterCriticalSection(&cond->csection); - if (cond->num_waiting) { - cond->num_wake += num_wake = cond->num_waiting; - cond->num_waiting = 0; + if (cond->num_waiting > cond->num_wake) { + num_wake = cond->num_waiting - cond->num_wake; + cond->num_wake = cond->num_waiting; + cond->generation++; } LeaveCriticalSection(&cond->csection); diff --git a/test/testcond.c b/test/testcond.c index d3c330a6246..cab7916dde2 100644 --- a/test/testcond.c +++ b/test/testcond.c @@ -511,20 +511,19 @@ static void ping(toolbox_t *box) rv = apr_thread_mutex_lock(box->mutex); ABTS_SUCCESS(rv); + if (state == TOSS) + state = PING; + do { + rv = apr_thread_cond_signal(box->cond); + ABTS_SUCCESS(rv); + state = PONG; - rv = apr_thread_cond_signal(box->cond); + rv = apr_thread_cond_wait(box->cond, box->mutex); ABTS_SUCCESS(rv); - do { - rv = apr_thread_cond_wait(box->cond, box->mutex); - ABTS_SUCCESS(rv); - if (state == OVER) { - break; - } - ABTS_INT_EQUAL(tc, 1, (state == PING)); - } while (state == PONG); + ABTS_TRUE(tc, state == PING || state == OVER); } while (state != OVER); rv = apr_thread_mutex_unlock(box->mutex); @@ -542,20 +541,19 @@ static void pong(toolbox_t *box) rv = apr_thread_mutex_lock(box->mutex); ABTS_SUCCESS(rv); + if (state == TOSS) + state = PONG; + do { + rv = apr_thread_cond_signal(box->cond); + ABTS_SUCCESS(rv); + state = PING; - rv = apr_thread_cond_signal(box->cond); + rv = apr_thread_cond_wait(box->cond, box->mutex); ABTS_SUCCESS(rv); - do { - rv = apr_thread_cond_wait(box->cond, box->mutex); - ABTS_SUCCESS(rv); - if (state == OVER) { - break; - } - ABTS_INT_EQUAL(tc, 1, (state == PONG)); - } while (state == PING); + ABTS_TRUE(tc, state == PONG || state == OVER); } while (state != OVER); rv = apr_thread_mutex_unlock(box->mutex); From 6e2b6ee80a2c513d0108fbd954bb3bc6e776e89c Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sat, 21 Jul 2007 00:56:59 +0000 Subject: [PATCH 5890/7878] Fix testrand2.c coding style and merge into testrand.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@558209 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 6 +- test/Makefile.win | 7 +- test/abts_tests.h | 1 - test/nwgnuaprtest | 1 - test/testall.dsp | 4 - test/testrand.c | 260 +++++++++++++++++++++++++++++++++++++++- test/testrand2.c | 297 ---------------------------------------------- test/testutil.h | 1 - 8 files changed, 265 insertions(+), 312 deletions(-) delete mode 100644 test/testrand2.c diff --git a/test/Makefile.in b/test/Makefile.in index 28ae9bbd619..99cc564e996 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -111,9 +111,9 @@ TESTS = testutil.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ - testenv.lo testprocmutex.lo testrand2.lo testfnmatch.lo \ - testatomic.lo testflock.lo testshm.lo testsock.lo testglobalmutex.lo \ - teststrnatcmp.lo testfilecopy.lo testtemp.lo testlfs.lo testcond.lo + testenv.lo testprocmutex.lo testfnmatch.lo testatomic.lo testflock.lo \ + testshm.lo testsock.lo testglobalmutex.lo teststrnatcmp.lo testfilecopy.lo \ + testtemp.lo testlfs.lo testcond.lo testall@EXEEXT@: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ abts.lo proc_child@EXEEXT@ \ diff --git a/test/Makefile.win b/test/Makefile.win index d6fc30c53dd..d18290cd374 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -104,9 +104,10 @@ TESTS = testutil.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testdso.obj testoc.obj testdup.obj testsockets.obj testproc.obj \ testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \ testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ - testenv.obj testprocmutex.obj testrand2.obj testfnmatch.obj \ - testatomic.obj testflock.obj testshm.obj testsock.obj testglobalmutex.obj \ - teststrnatcmp.obj testfilecopy.obj testtemp.obj testlfs.obj testcond.obj + testenv.obj testprocmutex.obj testfnmatch.obj testatomic.obj \ + testflock.obj testshm.obj testsock.obj testglobalmutex.obj \ + teststrnatcmp.obj testfilecopy.obj testtemp.obj testlfs.obj \ + testcond.obj testall.exe: $(TESTS) mod_test.dll occhild.exe \ readchild.exe abts.obj proc_child.exe \ diff --git a/test/abts_tests.h b/test/abts_tests.h index 130cbeed876..13d8b4ee803 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -53,7 +53,6 @@ const struct testlist { {testproc}, {testprocmutex}, {testrand}, - {testrand2}, {testsleep}, {testshm}, {testsock}, diff --git a/test/nwgnuaprtest b/test/nwgnuaprtest index 177c61b71b8..0c7f8c75cfb 100644 --- a/test/nwgnuaprtest +++ b/test/nwgnuaprtest @@ -198,7 +198,6 @@ FILES_nlm_objs = \ $(OBJDIR)/testproc.o \ $(OBJDIR)/testprocmutex.o \ $(OBJDIR)/testrand.o \ - $(OBJDIR)/testrand2.o \ $(OBJDIR)/testshm.o \ $(OBJDIR)/testsleep.o \ $(OBJDIR)/testsock.o \ diff --git a/test/testall.dsp b/test/testall.dsp index f2d9e062b15..47709f4862f 100644 --- a/test/testall.dsp +++ b/test/testall.dsp @@ -251,10 +251,6 @@ SOURCE=.\testrand.c # End Source File # Begin Source File -SOURCE=.\testrand2.c -# End Source File -# Begin Source File - SOURCE=.\testshm.c # End Source File # Begin Source File diff --git a/test/testrand.c b/test/testrand.c index 7c8a41fe7dc..6ced4a34f63 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -15,10 +15,257 @@ */ #include "apr_general.h" +#include "apr_random.h" +#include "apr_thread_proc.h" #include #include #include "testutil.h" +static void hexdump(const unsigned char *b, int n) +{ + int i; + + for (i = 0; i < n; ++i) { +#if 0 + if ((i & 0xf) == 0) + printf("%04x", i); + printf(" %02x", b[i]); + if ((i & 0xf) == 0xf) + printf("\n"); +#else + printf("0x%02x,", b[i]); + if ((i & 7) == 7) + printf("\n"); +#endif + } + printf("\n"); +} + +static apr_random_t *r; + +typedef apr_status_t APR_THREAD_FUNC rnd_fn(apr_random_t * r, void *b, + apr_size_t n); + +static void rand_run_kat(abts_case *tc, rnd_fn *f, apr_random_t *r, + const unsigned char expected[128]) +{ + unsigned char c[128]; + apr_status_t rv; + + rv = f(r, c, 128); + ABTS_INT_EQUAL(tc, 0, rv); + if (rv) + return; + if (memcmp(c, expected, 128)) { + hexdump(c, 128); + hexdump(expected, 128); + ABTS_FAIL(tc, "Randomness mismatch"); + } +} + +static int rand_check_kat(rnd_fn *f, apr_random_t *r, + const unsigned char expected[128]) +{ + unsigned char c[128]; + apr_status_t rv; + + rv = f(r, c, 128); + if (rv) + return 2; + if (memcmp(c, expected, 128)) + return 1; + return 0; +} + +static void rand_add_zeroes(apr_random_t *r) +{ + static unsigned char c[2048]; + + apr_random_add_entropy(r, c, sizeof c); +} + +static void rand_run_seed_short(abts_case *tc, rnd_fn *f, apr_random_t *r, + int count) +{ + int i; + apr_status_t rv; + char c[1]; + + for (i = 0; i < count; ++i) + rand_add_zeroes(r); + rv = f(r, c, 1); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOTENOUGHENTROPY(rv)); +} + +static void rand_seed_short(abts_case *tc, void *data) +{ + r = apr_random_standard_new(p); + rand_run_seed_short(tc, apr_random_insecure_bytes, r, 32); +} + +static void rand_kat(abts_case *tc, void *data) +{ + unsigned char expected[128] = { + 0x82, 0x04, 0xad, 0xd2, 0x0b, 0xd5, 0xac, 0xda, + 0x3d, 0x85, 0x58, 0x38, 0x54, 0x6b, 0x69, 0x45, + 0x37, 0x4c, 0xc7, 0xd7, 0x87, 0xeb, 0xbf, 0xd9, + 0xb1, 0xb8, 0xb8, 0x2d, 0x9b, 0x33, 0x6e, 0x97, + 0x04, 0x1d, 0x4c, 0xb0, 0xd1, 0xdf, 0x3d, 0xac, + 0xd2, 0xaa, 0xfa, 0xcd, 0x96, 0xb7, 0xcf, 0xb1, + 0x8e, 0x3d, 0xb3, 0xe5, 0x37, 0xa9, 0x95, 0xb4, + 0xaa, 0x3d, 0x11, 0x1a, 0x08, 0x20, 0x21, 0x9f, + 0xdb, 0x08, 0x3a, 0xb9, 0x57, 0x9f, 0xf2, 0x1f, + 0x27, 0xdc, 0xb6, 0xc0, 0x85, 0x08, 0x05, 0xbb, + 0x13, 0xbe, 0xb1, 0xe9, 0x63, 0x2a, 0xe2, 0xa4, + 0x23, 0x15, 0x2a, 0x10, 0xbf, 0xdf, 0x09, 0xb3, + 0xc7, 0xfb, 0x2d, 0x87, 0x48, 0x19, 0xfb, 0xc0, + 0x15, 0x8c, 0xcb, 0xc6, 0xbd, 0x89, 0x38, 0x69, + 0xa3, 0xae, 0xa3, 0x21, 0x58, 0x50, 0xe7, 0xc4, + 0x87, 0xec, 0x2e, 0xb1, 0x2d, 0x6a, 0xbd, 0x46 + }; + + rand_add_zeroes(r); + rand_run_kat(tc, apr_random_insecure_bytes, r, expected); +} + +static void rand_seed_short2(abts_case *tc, void *data) +{ + rand_run_seed_short(tc, apr_random_secure_bytes, r, 320); +} + +static void rand_kat2(abts_case *tc, void *data) +{ + unsigned char expected[128] = { + 0x38, 0x8f, 0x01, 0x29, 0x5a, 0x5c, 0x1f, 0xa8, + 0x00, 0xde, 0x16, 0x4c, 0xe5, 0xf7, 0x1f, 0x58, + 0xc0, 0x67, 0xe2, 0x98, 0x3d, 0xde, 0x4a, 0x75, + 0x61, 0x3f, 0x23, 0xd8, 0x45, 0x7a, 0x10, 0x60, + 0x59, 0x9b, 0xd6, 0xaf, 0xcb, 0x0a, 0x2e, 0x34, + 0x9c, 0x39, 0x5b, 0xd0, 0xbc, 0x9a, 0xf0, 0x7b, + 0x7f, 0x40, 0x8b, 0x33, 0xc0, 0x0e, 0x2a, 0x56, + 0xfc, 0xe5, 0xab, 0xde, 0x7b, 0x13, 0xf5, 0xec, + 0x15, 0x68, 0xb8, 0x09, 0xbc, 0x2c, 0x15, 0xf0, + 0x7b, 0xef, 0x2a, 0x97, 0x19, 0xa8, 0x69, 0x51, + 0xdf, 0xb0, 0x5f, 0x1a, 0x4e, 0xdf, 0x42, 0x02, + 0x71, 0x36, 0xa7, 0x25, 0x64, 0x85, 0xe2, 0x72, + 0xc7, 0x87, 0x4d, 0x7d, 0x15, 0xbb, 0x15, 0xd1, + 0xb1, 0x62, 0x0b, 0x25, 0xd9, 0xd3, 0xd9, 0x5a, + 0xe3, 0x47, 0x1e, 0xae, 0x67, 0xb4, 0x19, 0x9e, + 0xed, 0xd2, 0xde, 0xce, 0x18, 0x70, 0x57, 0x12 + }; + + rand_add_zeroes(r); + rand_run_kat(tc, apr_random_secure_bytes, r, expected); +} + +static void rand_barrier(abts_case *tc, void *data) +{ + apr_random_barrier(r); + rand_run_seed_short(tc, apr_random_secure_bytes, r, 320); +} + +static void rand_kat3(abts_case *tc, void *data) +{ + unsigned char expected[128] = { + 0xe8, 0xe7, 0xc9, 0x45, 0xe2, 0x2a, 0x54, 0xb2, + 0xdd, 0xe0, 0xf9, 0xbc, 0x3d, 0xf9, 0xce, 0x3c, + 0x4c, 0xbd, 0xc9, 0xe2, 0x20, 0x4a, 0x35, 0x1c, + 0x04, 0x52, 0x7f, 0xb8, 0x0f, 0x60, 0x89, 0x63, + 0x8a, 0xbe, 0x0a, 0x44, 0xac, 0x5d, 0xd8, 0xeb, + 0x24, 0x7d, 0xd1, 0xda, 0x4d, 0x86, 0x9b, 0x94, + 0x26, 0x56, 0x4a, 0x5e, 0x30, 0xea, 0xd4, 0xa9, + 0x9a, 0xdf, 0xdd, 0xb6, 0xb1, 0x15, 0xe0, 0xfa, + 0x28, 0xa4, 0xd6, 0x95, 0xa4, 0xf1, 0xd8, 0x6e, + 0xeb, 0x8c, 0xa4, 0xac, 0x34, 0xfe, 0x06, 0x92, + 0xc5, 0x09, 0x99, 0x86, 0xdc, 0x5a, 0x3c, 0x92, + 0xc8, 0x3e, 0x52, 0x00, 0x4d, 0x01, 0x43, 0x6f, + 0x69, 0xcf, 0xe2, 0x60, 0x9c, 0x23, 0xb3, 0xa5, + 0x5f, 0x51, 0x47, 0x8c, 0x07, 0xde, 0x60, 0xc6, + 0x04, 0xbf, 0x32, 0xd6, 0xdc, 0xb7, 0x31, 0x01, + 0x29, 0x51, 0x51, 0xb3, 0x19, 0x6e, 0xe4, 0xf8 + }; + + rand_run_kat(tc, apr_random_insecure_bytes, r, expected); +} + +static void rand_kat4(abts_case *tc, void *data) +{ + unsigned char expected[128] = { + 0x7d, 0x0e, 0xc4, 0x4e, 0x3e, 0xac, 0x86, 0x50, + 0x37, 0x95, 0x7a, 0x98, 0x23, 0x26, 0xa7, 0xbf, + 0x60, 0xfb, 0xa3, 0x70, 0x90, 0xc3, 0x58, 0xc6, + 0xbd, 0xd9, 0x5e, 0xa6, 0x77, 0x62, 0x7a, 0x5c, + 0x96, 0x83, 0x7f, 0x80, 0x3d, 0xf4, 0x9c, 0xcc, + 0x9b, 0x0c, 0x8c, 0xe1, 0x72, 0xa8, 0xfb, 0xc9, + 0xc5, 0x43, 0x91, 0xdc, 0x9d, 0x92, 0xc2, 0xce, + 0x1c, 0x5e, 0x36, 0xc7, 0x87, 0xb1, 0xb4, 0xa3, + 0xc8, 0x69, 0x76, 0xfc, 0x35, 0x75, 0xcb, 0x08, + 0x2f, 0xe3, 0x98, 0x76, 0x37, 0x80, 0x04, 0x5c, + 0xb8, 0xb0, 0x7f, 0xb2, 0xda, 0xe3, 0xa3, 0xba, + 0xed, 0xff, 0xf5, 0x9d, 0x3b, 0x7b, 0xf3, 0x32, + 0x6c, 0x50, 0xa5, 0x3e, 0xcc, 0xe1, 0x84, 0x9c, + 0x17, 0x9e, 0x80, 0x64, 0x09, 0xbb, 0x62, 0xf1, + 0x95, 0xf5, 0x2c, 0xc6, 0x9f, 0x6a, 0xee, 0x6d, + 0x17, 0x35, 0x5f, 0x35, 0x8d, 0x55, 0x0c, 0x07 + }; + + rand_add_zeroes(r); + rand_run_kat(tc, apr_random_secure_bytes, r, expected); +} + +#if APR_HAS_FORK +static void rand_fork(abts_case *tc, void *data) +{ + apr_proc_t proc; + apr_status_t rv; + unsigned char expected[128] = { + 0xac, 0x93, 0xd2, 0x5c, 0xc7, 0xf5, 0x8d, 0xc2, + 0xd8, 0x8d, 0xb6, 0x7a, 0x94, 0xe1, 0x83, 0x4c, + 0x26, 0xe2, 0x38, 0x6d, 0xf5, 0xbd, 0x9d, 0x6e, + 0x91, 0x77, 0x3a, 0x4b, 0x9b, 0xef, 0x9b, 0xa3, + 0x9f, 0xf6, 0x6d, 0x0c, 0xdc, 0x4b, 0x02, 0xe9, + 0x5d, 0x3d, 0xfc, 0x92, 0x6b, 0xdf, 0xc9, 0xef, + 0xb9, 0xa8, 0x74, 0x09, 0xa3, 0xff, 0x64, 0x8d, + 0x19, 0xc1, 0x31, 0x31, 0x17, 0xe1, 0xb7, 0x7a, + 0xe7, 0x55, 0x14, 0x92, 0x05, 0xe3, 0x1e, 0xb8, + 0x9b, 0x1b, 0xdc, 0xac, 0x0e, 0x15, 0x08, 0xa2, + 0x93, 0x13, 0xf6, 0x04, 0xc6, 0x9d, 0xf8, 0x7f, + 0x26, 0x32, 0x68, 0x43, 0x2e, 0x5a, 0x4f, 0x47, + 0xe8, 0xf8, 0x59, 0xb7, 0xfb, 0xbe, 0x30, 0x04, + 0xb6, 0x63, 0x6f, 0x19, 0xf3, 0x2c, 0xd4, 0xeb, + 0x32, 0x8a, 0x54, 0x01, 0xd0, 0xaf, 0x3f, 0x13, + 0xc1, 0x7f, 0x10, 0x2e, 0x08, 0x1c, 0x28, 0x4b, + }; + + rv = apr_proc_fork(&proc, p); + if (rv == APR_INCHILD) { + int n = rand_check_kat(apr_random_secure_bytes, r, expected); + exit(n); + } + else if (rv == APR_INPARENT) { + int exitcode; + apr_exit_why_e why; + + rand_run_kat(tc, apr_random_secure_bytes, r, expected); + apr_proc_wait(&proc, &exitcode, &why, APR_WAIT); + if (why != APR_PROC_EXIT) { + ABTS_FAIL(tc, "Child terminated abnormally"); + } + else if (exitcode == 0) { + ABTS_FAIL(tc, "Child produced our randomness"); + } + else if (exitcode == 2) { + ABTS_FAIL(tc, "Child randomness failed"); + } + else if (exitcode != 1) { + ABTS_FAIL(tc, "Uknown child error"); + } + } else { + ABTS_FAIL(tc, "Fork failed"); + } +} +#endif + static void rand_exists(abts_case *tc, void *data) { #if !APR_HAS_RANDOM @@ -32,14 +279,23 @@ static void rand_exists(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "apr_generate_random_bytes failed", apr_generate_random_bytes(c, sizeof c)); #endif -} +} abts_suite *testrand(abts_suite *suite) { suite = ADD_SUITE(suite) abts_run_test(suite, rand_exists, NULL); + abts_run_test(suite, rand_seed_short, NULL); + abts_run_test(suite, rand_kat, NULL); + abts_run_test(suite, rand_seed_short2, NULL); + abts_run_test(suite, rand_kat2, NULL); + abts_run_test(suite, rand_barrier, NULL); + abts_run_test(suite, rand_kat3, NULL); + abts_run_test(suite, rand_kat4, NULL); +#if APR_HAS_FORK + abts_run_test(suite, rand_fork, NULL); +#endif return suite; } - diff --git a/test/testrand2.c b/test/testrand2.c deleted file mode 100644 index 39f761b2c58..00000000000 --- a/test/testrand2.c +++ /dev/null @@ -1,297 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "apr_general.h" -#include "apr_random.h" -#include "apr_thread_proc.h" -#include -#include -#include "testutil.h" - -static void hexdump(const unsigned char *b,int n) - { - int i; - - for(i=0 ; i < n ; ++i) - { -#if 0 - if((i&0xf) == 0) - printf("%04x",i); - printf(" %02x",b[i]); - if((i&0xf) == 0xf) - printf("\n"); -#else - printf("0x%02x,",b[i]); - if((i&7) == 7) - printf("\n"); -#endif - } - printf("\n"); - } - -static apr_random_t *r; - -typedef apr_status_t APR_THREAD_FUNC rnd_fn(apr_random_t *r,void *b,apr_size_t n); - -static void rand_run_kat(abts_case *tc,rnd_fn *f,apr_random_t *r, - const unsigned char expected[128]) - { - unsigned char c[128]; - apr_status_t rv; - - rv=f(r,c,128); - ABTS_INT_EQUAL(tc,0,rv); - if(rv) - return; - if(memcmp(c,expected,128)) - { - hexdump(c,128); - hexdump(expected,128); - ABTS_FAIL(tc,"Randomness mismatch"); - } - } - -static int rand_check_kat(rnd_fn *f,apr_random_t *r, - const unsigned char expected[128]) - { - unsigned char c[128]; - apr_status_t rv; - - rv=f(r,c,128); - if(rv) - return 2; - if(memcmp(c,expected,128)) - return 1; - return 0; - } - -static void rand_add_zeroes(apr_random_t *r) - { - static unsigned char c[2048]; - - apr_random_add_entropy(r,c,sizeof c); - } - -static void rand_run_seed_short(abts_case *tc,rnd_fn *f,apr_random_t *r, - int count) - { - int i; - apr_status_t rv; - char c[1]; - - for(i=0 ; i < count ; ++i) - rand_add_zeroes(r); - rv=f(r,c,1); - ABTS_INT_EQUAL(tc,1,APR_STATUS_IS_ENOTENOUGHENTROPY(rv)); - } - -static void rand_seed_short(abts_case *tc, void *data) - { - r=apr_random_standard_new(p); - rand_run_seed_short(tc,apr_random_insecure_bytes,r,32); - } - -static void rand_kat(abts_case *tc, void *data) - { - unsigned char expected[128]= - { 0x82,0x04,0xad,0xd2,0x0b,0xd5,0xac,0xda, - 0x3d,0x85,0x58,0x38,0x54,0x6b,0x69,0x45, - 0x37,0x4c,0xc7,0xd7,0x87,0xeb,0xbf,0xd9, - 0xb1,0xb8,0xb8,0x2d,0x9b,0x33,0x6e,0x97, - 0x04,0x1d,0x4c,0xb0,0xd1,0xdf,0x3d,0xac, - 0xd2,0xaa,0xfa,0xcd,0x96,0xb7,0xcf,0xb1, - 0x8e,0x3d,0xb3,0xe5,0x37,0xa9,0x95,0xb4, - 0xaa,0x3d,0x11,0x1a,0x08,0x20,0x21,0x9f, - 0xdb,0x08,0x3a,0xb9,0x57,0x9f,0xf2,0x1f, - 0x27,0xdc,0xb6,0xc0,0x85,0x08,0x05,0xbb, - 0x13,0xbe,0xb1,0xe9,0x63,0x2a,0xe2,0xa4, - 0x23,0x15,0x2a,0x10,0xbf,0xdf,0x09,0xb3, - 0xc7,0xfb,0x2d,0x87,0x48,0x19,0xfb,0xc0, - 0x15,0x8c,0xcb,0xc6,0xbd,0x89,0x38,0x69, - 0xa3,0xae,0xa3,0x21,0x58,0x50,0xe7,0xc4, - 0x87,0xec,0x2e,0xb1,0x2d,0x6a,0xbd,0x46 }; - - rand_add_zeroes(r); - rand_run_kat(tc,apr_random_insecure_bytes,r,expected); - } - -static void rand_seed_short2(abts_case *tc, void *data) - { - rand_run_seed_short(tc,apr_random_secure_bytes,r,320); - } - -static void rand_kat2(abts_case *tc, void *data) - { - unsigned char expected[128]= - { 0x38,0x8f,0x01,0x29,0x5a,0x5c,0x1f,0xa8, - 0x00,0xde,0x16,0x4c,0xe5,0xf7,0x1f,0x58, - 0xc0,0x67,0xe2,0x98,0x3d,0xde,0x4a,0x75, - 0x61,0x3f,0x23,0xd8,0x45,0x7a,0x10,0x60, - 0x59,0x9b,0xd6,0xaf,0xcb,0x0a,0x2e,0x34, - 0x9c,0x39,0x5b,0xd0,0xbc,0x9a,0xf0,0x7b, - 0x7f,0x40,0x8b,0x33,0xc0,0x0e,0x2a,0x56, - 0xfc,0xe5,0xab,0xde,0x7b,0x13,0xf5,0xec, - 0x15,0x68,0xb8,0x09,0xbc,0x2c,0x15,0xf0, - 0x7b,0xef,0x2a,0x97,0x19,0xa8,0x69,0x51, - 0xdf,0xb0,0x5f,0x1a,0x4e,0xdf,0x42,0x02, - 0x71,0x36,0xa7,0x25,0x64,0x85,0xe2,0x72, - 0xc7,0x87,0x4d,0x7d,0x15,0xbb,0x15,0xd1, - 0xb1,0x62,0x0b,0x25,0xd9,0xd3,0xd9,0x5a, - 0xe3,0x47,0x1e,0xae,0x67,0xb4,0x19,0x9e, - 0xed,0xd2,0xde,0xce,0x18,0x70,0x57,0x12 }; - - rand_add_zeroes(r); - rand_run_kat(tc,apr_random_secure_bytes,r,expected); - } - -static void rand_barrier(abts_case *tc, void *data) - { - apr_random_barrier(r); - rand_run_seed_short(tc,apr_random_secure_bytes,r,320); - } - -static void rand_kat3(abts_case *tc, void *data) - { - unsigned char expected[128]= - { 0xe8,0xe7,0xc9,0x45,0xe2,0x2a,0x54,0xb2, - 0xdd,0xe0,0xf9,0xbc,0x3d,0xf9,0xce,0x3c, - 0x4c,0xbd,0xc9,0xe2,0x20,0x4a,0x35,0x1c, - 0x04,0x52,0x7f,0xb8,0x0f,0x60,0x89,0x63, - 0x8a,0xbe,0x0a,0x44,0xac,0x5d,0xd8,0xeb, - 0x24,0x7d,0xd1,0xda,0x4d,0x86,0x9b,0x94, - 0x26,0x56,0x4a,0x5e,0x30,0xea,0xd4,0xa9, - 0x9a,0xdf,0xdd,0xb6,0xb1,0x15,0xe0,0xfa, - 0x28,0xa4,0xd6,0x95,0xa4,0xf1,0xd8,0x6e, - 0xeb,0x8c,0xa4,0xac,0x34,0xfe,0x06,0x92, - 0xc5,0x09,0x99,0x86,0xdc,0x5a,0x3c,0x92, - 0xc8,0x3e,0x52,0x00,0x4d,0x01,0x43,0x6f, - 0x69,0xcf,0xe2,0x60,0x9c,0x23,0xb3,0xa5, - 0x5f,0x51,0x47,0x8c,0x07,0xde,0x60,0xc6, - 0x04,0xbf,0x32,0xd6,0xdc,0xb7,0x31,0x01, - 0x29,0x51,0x51,0xb3,0x19,0x6e,0xe4,0xf8 }; - - rand_run_kat(tc,apr_random_insecure_bytes,r,expected); - } - -static void rand_kat4(abts_case *tc, void *data) - { - unsigned char expected[128]= - { 0x7d,0x0e,0xc4,0x4e,0x3e,0xac,0x86,0x50, - 0x37,0x95,0x7a,0x98,0x23,0x26,0xa7,0xbf, - 0x60,0xfb,0xa3,0x70,0x90,0xc3,0x58,0xc6, - 0xbd,0xd9,0x5e,0xa6,0x77,0x62,0x7a,0x5c, - 0x96,0x83,0x7f,0x80,0x3d,0xf4,0x9c,0xcc, - 0x9b,0x0c,0x8c,0xe1,0x72,0xa8,0xfb,0xc9, - 0xc5,0x43,0x91,0xdc,0x9d,0x92,0xc2,0xce, - 0x1c,0x5e,0x36,0xc7,0x87,0xb1,0xb4,0xa3, - 0xc8,0x69,0x76,0xfc,0x35,0x75,0xcb,0x08, - 0x2f,0xe3,0x98,0x76,0x37,0x80,0x04,0x5c, - 0xb8,0xb0,0x7f,0xb2,0xda,0xe3,0xa3,0xba, - 0xed,0xff,0xf5,0x9d,0x3b,0x7b,0xf3,0x32, - 0x6c,0x50,0xa5,0x3e,0xcc,0xe1,0x84,0x9c, - 0x17,0x9e,0x80,0x64,0x09,0xbb,0x62,0xf1, - 0x95,0xf5,0x2c,0xc6,0x9f,0x6a,0xee,0x6d, - 0x17,0x35,0x5f,0x35,0x8d,0x55,0x0c,0x07 }; - - rand_add_zeroes(r); - rand_run_kat(tc,apr_random_secure_bytes,r,expected); - } - -#if APR_HAS_FORK -static void rand_fork(abts_case *tc, void *data) - { - apr_proc_t proc; - apr_status_t rv; - unsigned char expected[128]= - { 0xac,0x93,0xd2,0x5c,0xc7,0xf5,0x8d,0xc2, - 0xd8,0x8d,0xb6,0x7a,0x94,0xe1,0x83,0x4c, - 0x26,0xe2,0x38,0x6d,0xf5,0xbd,0x9d,0x6e, - 0x91,0x77,0x3a,0x4b,0x9b,0xef,0x9b,0xa3, - 0x9f,0xf6,0x6d,0x0c,0xdc,0x4b,0x02,0xe9, - 0x5d,0x3d,0xfc,0x92,0x6b,0xdf,0xc9,0xef, - 0xb9,0xa8,0x74,0x09,0xa3,0xff,0x64,0x8d, - 0x19,0xc1,0x31,0x31,0x17,0xe1,0xb7,0x7a, - 0xe7,0x55,0x14,0x92,0x05,0xe3,0x1e,0xb8, - 0x9b,0x1b,0xdc,0xac,0x0e,0x15,0x08,0xa2, - 0x93,0x13,0xf6,0x04,0xc6,0x9d,0xf8,0x7f, - 0x26,0x32,0x68,0x43,0x2e,0x5a,0x4f,0x47, - 0xe8,0xf8,0x59,0xb7,0xfb,0xbe,0x30,0x04, - 0xb6,0x63,0x6f,0x19,0xf3,0x2c,0xd4,0xeb, - 0x32,0x8a,0x54,0x01,0xd0,0xaf,0x3f,0x13, - 0xc1,0x7f,0x10,0x2e,0x08,0x1c,0x28,0x4b, }; - - rv=apr_proc_fork(&proc,p); - if(rv == APR_INCHILD) - { - int n; - - n=rand_check_kat(apr_random_secure_bytes,r,expected); - - exit(n); - } - else if(rv == APR_INPARENT) - { - int exitcode; - apr_exit_why_e why; - - rand_run_kat(tc,apr_random_secure_bytes,r,expected); - apr_proc_wait(&proc,&exitcode,&why,APR_WAIT); - if(why != APR_PROC_EXIT) - { - ABTS_FAIL(tc,"Child terminated abnormally"); - return; - } - if(exitcode == 0) - { - ABTS_FAIL(tc,"Child produced our randomness"); - return; - } - else if(exitcode == 2) - { - ABTS_FAIL(tc,"Child randomness failed"); - return; - } - else if(exitcode != 1) - { - ABTS_FAIL(tc,"Uknown child error"); - return; - } - } - else - { - ABTS_FAIL(tc,"Fork failed"); - return; - } - } -#endif - -abts_suite *testrand2(abts_suite *suite) - { - suite = ADD_SUITE(suite) - - abts_run_test(suite, rand_seed_short, NULL); - abts_run_test(suite, rand_kat, NULL); - abts_run_test(suite, rand_seed_short2, NULL); - abts_run_test(suite, rand_kat2, NULL); - abts_run_test(suite, rand_barrier, NULL); - abts_run_test(suite, rand_kat3, NULL); - abts_run_test(suite, rand_kat4, NULL); -#if APR_HAS_FORK - abts_run_test(suite, rand_fork, NULL); -#endif - - return suite; - } diff --git a/test/testutil.h b/test/testutil.h index 9b979b4c723..d3294891dd3 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -74,7 +74,6 @@ abts_suite *testpool(abts_suite *suite); abts_suite *testproc(abts_suite *suite); abts_suite *testprocmutex(abts_suite *suite); abts_suite *testrand(abts_suite *suite); -abts_suite *testrand2(abts_suite *suite); abts_suite *testsleep(abts_suite *suite); abts_suite *testshm(abts_suite *suite); abts_suite *testsock(abts_suite *suite); From b9ebd8e04bb7f97c2fc65757cc11f0da440346a8 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sat, 21 Jul 2007 02:16:29 +0000 Subject: [PATCH 5891/7878] Document and add extern "C" linkage declaration to the apr_random.h header. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@558224 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_random.h | 109 +++++++++++++++++++++++++++++++++------ random/unix/apr_random.c | 5 +- 2 files changed, 98 insertions(+), 16 deletions(-) diff --git a/include/apr_random.h b/include/apr_random.h index 9c0eac23ada..29154358dbf 100644 --- a/include/apr_random.h +++ b/include/apr_random.h @@ -17,16 +17,33 @@ #ifndef APR_RANDOM_H #define APR_RANDOM_H -#include +/** + * @file apr_random.h + * @brief APR PRNG routines + */ + +#include "apr_pools.h" +#include "apr_thread_proc.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @defgroup apr_random PRNG Routines + * @ingroup APR + * @{ + */ typedef struct apr_crypto_hash_t apr_crypto_hash_t; typedef void apr_crypto_hash_init_t(apr_crypto_hash_t *hash); -typedef void apr_crypto_hash_add_t(apr_crypto_hash_t *hash,const void *data, +typedef void apr_crypto_hash_add_t(apr_crypto_hash_t *hash, const void *data, apr_size_t bytes); typedef void apr_crypto_hash_finish_t(apr_crypto_hash_t *hash, unsigned char *result); + /* FIXME: make this opaque */ struct apr_crypto_hash_t { apr_crypto_hash_init_t *init; @@ -36,39 +53,101 @@ struct apr_crypto_hash_t { void *data; }; +/** + * Allocate and initialize the SHA-256 context + * @param p The pool to allocate from + */ APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p); +/** Opaque PRNG structure. */ typedef struct apr_random_t apr_random_t; -APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p, +/** + * Initialize a PRNG state + * @param g The PRNG state + * @param p The pool to allocate from + * @param pool_hash Pool hash functions + * @param key_hash Key hash functions + * @param prng_hash PRNG hash functions + */ +APR_DECLARE(void) apr_random_init(apr_random_t *g, apr_pool_t *p, apr_crypto_hash_t *pool_hash, apr_crypto_hash_t *key_hash, apr_crypto_hash_t *prng_hash); +/** + * Allocate and initialize (apr_crypto_sha256_new) a new PRNG state. + * @param p The pool to allocate from + */ APR_DECLARE(apr_random_t *) apr_random_standard_new(apr_pool_t *p); + +/** + * Mix the randomness pools. + * @param g The PRNG state + * @param entropy_ Entropy buffer + * @param bytes Length of entropy_ in bytes + */ APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g, const void *entropy_, apr_size_t bytes); +/** + * Generate cryptographically insecure random bytes. + * @param g The RNG state + * @param random Buffer to fill with random bytes + * @param bytes Length of buffer in bytes + */ APR_DECLARE(apr_status_t) apr_random_insecure_bytes(apr_random_t *g, void *random, apr_size_t bytes); + +/** + * Generate cryptographically secure random bytes. + * @param g The RNG state + * @param random Buffer to fill with random bytes + * @param bytes Length of buffer in bytes + */ APR_DECLARE(apr_status_t) apr_random_secure_bytes(apr_random_t *g, void *random, apr_size_t bytes); +/** + * Ensures that E bits of conditional entropy are mixed into the PRNG + * before any further randomness is extracted. + * @param g The RNG state + */ APR_DECLARE(void) apr_random_barrier(apr_random_t *g); + +/** + * Return APR_SUCCESS if the cryptographic PRNG has been seeded with + * enough data, APR_ENOTENOUGHENTROPY otherwise. + * @param r The RNG state + */ APR_DECLARE(apr_status_t) apr_random_secure_ready(apr_random_t *r); + +/** + * Return APR_SUCCESS if the PRNG has been seeded with enough data, + * APR_ENOTENOUGHENTROPY otherwise. + * @param r The PRNG state + */ APR_DECLARE(apr_status_t) apr_random_insecure_ready(apr_random_t *r); -/* Call this in the child after forking to mix the randomness - pools. Note that its generally a bad idea to fork a process with a - real PRNG in it - better to have the PRNG externally and get the - randomness from there. However, if you really must do it, then you - should supply all your entropy to all the PRNGs - don't worry, they - won't produce the same output. +/** + * Mix the randomness pools after forking. + * @param proc The resulting process handle from apr_proc_fork() + * @remark Call this in the child after forking to mix the randomness + * pools. Note that its generally a bad idea to fork a process with a + * real PRNG in it - better to have the PRNG externally and get the + * randomness from there. However, if you really must do it, then you + * should supply all your entropy to all the PRNGs - don't worry, they + * won't produce the same output. + * @remark Note that apr_proc_fork() calls this for you, so only weird + * applications need ever call it themselves. + * @internal + */ +APR_DECLARE(void) apr_random_after_fork(apr_proc_t *proc); + +/** @} */ - Note that apr_proc_fork() calls this for you, so only weird - applications need ever call it themselves. -*/ -struct apr_proc_t; -APR_DECLARE(void) apr_random_after_fork(struct apr_proc_t *proc); +#ifdef __cplusplus +} +#endif -#endif /* ndef APR_RANDOM_H */ +#endif /* !APR_RANDOM_H */ diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c index 41887d4b0f0..c6d671c6bd2 100644 --- a/random/unix/apr_random.c +++ b/random/unix/apr_random.c @@ -14,7 +14,10 @@ * limitations under the License. */ /* - * See the paper "???" by Ben Laurie for an explanation of this PRNG. + * See the paper "On Randomness" by Ben Laurie for an explanation of this PRNG. + * http://www.apache-ssl.org/randomness.pdf + * XXX: Is there a formal proof of this PRNG? Couldn't we use the more popular + * Mersenne Twister PRNG (and BSD licensed)? */ #include "apr.h" From 39639003e5eb6e3d1a2e56258536febec951dd32 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sun, 22 Jul 2007 01:24:48 +0000 Subject: [PATCH 5892/7878] Make APR_SUBDIR_CONFIG work right if the second argument is a line-separated value. The dnl builtin discards all characters up to the first newline and since $2 was being expanded, a new line in the second argument could break the configure script. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@558445 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 1b2b15947b2..582ebaa9125 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -161,8 +161,8 @@ changequote([, ])dnl # autoconf doesn't add --silent to ac_configure_args; explicitly pass it test "x$silent" = "xyes" && apr_configure_args="$apr_configure_args --silent" - dnl The eval makes quoting arguments work - specifically $2 where the - dnl quoting mechanisms used is "" rather than []. + dnl The eval makes quoting arguments work - specifically the second argument + dnl where the quoting mechanisms used is "" rather than []. dnl dnl We need to execute another shell because some autoconf/shell combinations dnl will choke after doing repeated APR_SUBDIR_CONFIG()s. (Namely Solaris From 5461a356843e9dbca8f65bddd58c6da88577bf92 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sun, 22 Jul 2007 16:29:26 +0000 Subject: [PATCH 5893/7878] misc/win32/misc.c depends on _UNICODE not being set and all Windows API calls being char* based. On WinCE, _UNICODE is forced to be set. This patch modifies the Windows version detection code to use TCHAR and adds the explicit "A" qualifier to LoadLibrary and GetProcAddress so the char* based versions are used regardless. Submitted by: Curt Arnold PR: 39889 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@558506 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/misc.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 97b294711a5..9fc3e8422a2 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -19,6 +19,7 @@ #include "apr_arch_file_io.h" #include "assert.h" #include "apr_lib.h" +#include "tchar.h" APR_DECLARE_DATA apr_oslevel_e apr_os_level = APR_WIN_UNK; @@ -33,13 +34,17 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) { static unsigned int servpack = 0; - char *pservpack; + TCHAR *pservpack; if (pservpack = oslev.szCSDVersion) { while (*pservpack && !apr_isdigit(*pservpack)) { pservpack++; } if (*pservpack) +#ifdef _UNICODE + servpack = _wtoi(pservpack); +#else servpack = atoi(pservpack); +#endif } if (oslev.dwMajorVersion < 3) { @@ -100,22 +105,22 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) } #ifndef WINNT else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { - char *prevision; + TCHAR *prevision; if (prevision = oslev.szCSDVersion) { while (*prevision && !apr_isupper(*prevision)) { prevision++; } } - else prevision = ""; + else prevision = _T(""); if (oslev.dwMinorVersion < 10) { - if (*prevision < 'C') + if (*prevision < _T('C')) apr_os_level = APR_WIN_95; else apr_os_level = APR_WIN_95_OSR2; } else if (oslev.dwMinorVersion < 90) { - if (*prevision < 'A') + if (*prevision < _T('A')) apr_os_level = APR_WIN_98; else apr_os_level = APR_WIN_98_SE; @@ -163,14 +168,21 @@ static HMODULE lateDllHandle[DLL_defined] = { FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) { if (!lateDllHandle[fnLib]) { - lateDllHandle[fnLib] = LoadLibrary(lateDllName[fnLib]); + lateDllHandle[fnLib] = LoadLibraryA(lateDllName[fnLib]); if (!lateDllHandle[fnLib]) return NULL; } +#if defined(_WIN32_WCE) + if (ordinal) + return GetProcAddressA(lateDllHandle[fnLib], (char *) ordinal); + else + return GetProcAddressA(lateDllHandle[fnLib], fnName); +#else if (ordinal) return GetProcAddress(lateDllHandle[fnLib], (char *) ordinal); else return GetProcAddress(lateDllHandle[fnLib], fnName); +#endif } /* Declared in include/arch/win32/apr_dbg_win32_handles.h @@ -198,10 +210,10 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, (TlsSetValue)(tlsid, sbuf); sbuf[1023] = '\0'; if (!fh) { - (GetModuleFileName)(NULL, sbuf, 250); + (GetModuleFileNameA)(NULL, sbuf, 250); sprintf(strchr(sbuf, '\0'), ".%d", (GetCurrentProcessId)()); - fh = (CreateFile)(sbuf, GENERIC_WRITE, 0, NULL, + fh = (CreateFileA)(sbuf, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); (InitializeCriticalSection)(&cs); } From f4f74cdd7dab13eb98b0fe7181e34bf83cf9db3a Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 24 Jul 2007 00:34:25 +0000 Subject: [PATCH 5894/7878] SystemTimeToAprExpTime dayoffset summation is wrong, June is 30 days. PR: 42953 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@558902 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/time/win32/time.c b/time/win32/time.c index 9d2757972ed..9565fee9325 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -52,7 +52,7 @@ static DWORD get_local_timezone(TIME_ZONE_INFORMATION **tzresult) static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm) { static const int dayoffset[12] = - {0, 31, 59, 90, 120, 151, 182, 212, 243, 273, 304, 334}; + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; /* Note; the caller is responsible for filling in detailed tm_usec, * tm_gmtoff and tm_isdst data when applicable. From 9831f05bb8a14765d179946780d3bbe765049c92 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Wed, 25 Jul 2007 03:06:26 +0000 Subject: [PATCH 5895/7878] Add comment about platorm specific values of macros and typedefs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@559296 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/apr.h.in b/include/apr.h.in index 9d37d5c3f37..6949312ef02 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -40,6 +40,9 @@ /** * @defgroup apr_platform Platform Definitions * @{ + * @warning + * The actual values of macros and typedefs on this page
    + * are platform specific and should NOT be relied upon!
    */ /* So that we can use inline on some critical functions, and use From 14574916d9eee92aa0e5d91e80876027da1e5f32 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sat, 4 Aug 2007 20:54:07 +0000 Subject: [PATCH 5896/7878] Prefer solaris builtins even on x86, and fix a compiler warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@562764 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/solaris.c | 2 +- include/arch/unix/apr_arch_atomic.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/atomic/unix/solaris.c b/atomic/unix/solaris.c index ba544522f4f..b3852516b08 100644 --- a/atomic/unix/solaris.c +++ b/atomic/unix/solaris.c @@ -68,7 +68,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) { - return atomic_cas_ptr(mem, cmp, with); + return atomic_cas_ptr(mem, cmp, (void*) with); } APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) diff --git a/include/arch/unix/apr_arch_atomic.h b/include/arch/unix/apr_arch_atomic.h index 0f533fac443..f8019060e50 100644 --- a/include/arch/unix/apr_arch_atomic.h +++ b/include/arch/unix/apr_arch_atomic.h @@ -30,10 +30,10 @@ # define USE_ATOMICS_GENERIC #elif HAVE_ATOMIC_BUILTINS # define USE_ATOMICS_BUILTINS -#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) -# define USE_ATOMICS_IA32 #elif defined(SOLARIS2) && SOLARIS2 >= 10 # define USE_ATOMICS_SOLARIS +#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) +# define USE_ATOMICS_IA32 #elif defined(__GNUC__) && (defined(__PPC__) || defined(__ppc__)) # define USE_ATOMICS_PPC #elif defined(__GNUC__) && (defined(__s390__) || defined(__s390x__)) From f5c3bffc429d192d92e3b888f5c74e2f8b486187 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sat, 4 Aug 2007 21:00:43 +0000 Subject: [PATCH 5897/7878] Cleanup asm constraints (+ operand is both read and written by the instruction) and clobbers. The xchg instruction always asserts the lock signal. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@562765 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/ia32.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/atomic/unix/ia32.c b/atomic/unix/ia32.c index 191298c4aa6..3826f927550 100644 --- a/atomic/unix/ia32.c +++ b/atomic/unix/ia32.c @@ -83,10 +83,9 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint { apr_uint32_t prev = val; - asm volatile ("lock; xchgl %0, %1" - : "=r" (prev) - : "m" (*(mem)), "0"(prev) - : "memory"); + asm volatile ("xchgl %0, %1" + : "=r" (prev), "+m" (*mem) + : "0" (prev)); return prev; } @@ -112,15 +111,13 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) { void *prev; #if APR_SIZEOF_VOIDP == 4 - asm volatile ("lock; xchgl %2, %1" - : "=a" (prev), "=m" (*mem) - : "r" (with), "m" (*mem) - : "memory"); + asm volatile ("xchgl %2, %1" + : "=a" (prev), "+m" (*mem) + : "0" (with)); #elif APR_SIZEOF_VOIDP == 8 - asm volatile ("lock; xchgq %q2, %1" - : "=a" (prev), "=m" (*mem) - : "r" ((unsigned long)with), "m" (*mem) - : "memory"); + asm volatile ("xchgq %q2, %1" + : "=a" (prev), "+m" (*mem) + : "r" ((unsigned long)with)); #else #error APR_SIZEOF_VOIDP value not supported #endif From 431e2526b8305eaba869045edea7cc5334c82c10 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sun, 5 Aug 2007 15:48:27 +0000 Subject: [PATCH 5898/7878] "Signal Handling" was listed as "Handling" in the APR documentation. Submitted by: Lucian Adrian Grijincu git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@562899 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_signal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_signal.h b/include/apr_signal.h index 991cbadbaeb..20631333023 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -18,7 +18,7 @@ #define APR_SIGNAL_H /** - * @file apr_signal.h + * @file apr_signal.h * @brief APR Signal Handling */ @@ -34,8 +34,8 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_signal Handling - * @ingroup APR + * @defgroup apr_signal Signal Handling + * @ingroup APR * @{ */ From 64f5571c83c0ee72e36751eac976550684cc7cb5 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Mon, 6 Aug 2007 19:14:46 +0000 Subject: [PATCH 5899/7878] Backport revision 560480 from the eventset branch: External linkage declarations are often forgotten and also confuses indent tools. Add the APR_BEGIN_DECLS and APR_END_DECLS helper macros which are more easily remembered. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@563225 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 11 +++++++++++ include/apr.hnw | 11 +++++++++++ include/apr.hw | 11 +++++++++++ 3 files changed, 33 insertions(+) diff --git a/include/apr.h.in b/include/apr.h.in index 6949312ef02..36b6f72f3e3 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -349,6 +349,17 @@ typedef @socklen_t_value@ apr_socklen_t; /* Definitions that APR programs need to work properly. */ +/** + * APR public API wrap for C++ compilers. + */ +#ifdef __cplusplus +#define APR_BEGIN_DECLS extern "C" { +#define APR_END_DECLS } +#else +#define APR_BEGIN_DECLS +#define APR_END_DECLS +#endif + /** * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, * so that they follow the platform's calling convention. diff --git a/include/apr.hnw b/include/apr.hnw index 5722e956bd9..c793846ec74 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -329,6 +329,17 @@ typedef size_t apr_socklen_t; /* Definitions that APR programs need to work properly. */ +/** + * APR public API wrap for C++ compilers. + */ +#ifdef __cplusplus +#define APR_BEGIN_DECLS extern "C" { +#define APR_END_DECLS } +#else +#define APR_BEGIN_DECLS +#define APR_END_DECLS +#endif + /** * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, * so that they follow the platform's calling convention. diff --git a/include/apr.hw b/include/apr.hw index 8883c13b2be..f63635a2d9e 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -446,6 +446,17 @@ typedef int gid_t; /* Definitions that APR programs need to work properly. */ +/** + * APR public API wrap for C++ compilers. + */ +#ifdef __cplusplus +#define APR_BEGIN_DECLS extern "C" { +#define APR_END_DECLS } +#else +#define APR_BEGIN_DECLS +#define APR_END_DECLS +#endif + /** * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, * so that they follow the platform's calling convention. From cf94a882cde9dcd504771f6e36de43c0223100e5 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 8 Aug 2007 12:36:07 +0000 Subject: [PATCH 5900/7878] fixed version string for dev builds; added check for wanted version. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@563835 13f79535-47bb-0310-9956-ffa450edef68 --- build/nw_ver.awk | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/build/nw_ver.awk b/build/nw_ver.awk index ae82305a114..b656f2a7e5a 100644 --- a/build/nw_ver.awk +++ b/build/nw_ver.awk @@ -10,16 +10,31 @@ BEGIN { ver_minor = $3; } else if (match ($0, /^#define APR_PATCH_VERSION/)) { - ver_str_patch = $3; - if (match (ver_str_patch, /[0-9][0-9]*/)) { - ver_patch = substr(ver_str_patch, RSTART, RLENGTH); - } + ver_patch = $3; + } + else if (match ($0, /^#define APR_IS_DEV_VERSION/)) { + ver_devbuild = 1; } } - ver = ver_major "," ver_minor "," ver_patch; - ver_str = ver_major "." ver_minor "." ver_str_patch; - - print "VERSION = " ver ""; - print "VERSION_STR = " ver_str ""; + ver_str = ver_major "." ver_minor "." ver_patch (ver_devbuild ? "-dev" : ""); + if (WANTED) { + ver_num = ver_major * 1000000 + ver_minor * 1000 + ver_patch; + if (ver_num < WANTED) { + print "ERROR: APR version " ver_str " does NOT match!"; + exit 1; + } else if (ver_num > (WANTED + 1000)) { + print "WARNING: APR version " ver_str " higher than expected!"; + exit 0; + } else { + print "OK: APR version " ver_str ""; + exit 0; + } + } else { + ver_nlm = ver_major "," ver_minor "," ver_patch; + print "VERSION = " ver_nlm ""; + print "VERSION_STR = " ver_str ""; + } } + + From 33f9328ad66c3073ff639f846c784eb76bba3b1c Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 13 Aug 2007 12:34:06 +0000 Subject: [PATCH 5901/7878] In Mac OS X's VFS API file names are, by definition, canonically decomposed Unicode, encoded using UTF-8. Shortest rep also uses composed UTF-8 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@565326 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 78797bd990c..6a65b202ecf 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -305,6 +305,10 @@ APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p) { +#if defined(DARWIN) + *style = APR_FILEPATH_ENCODING_UTF8; +#else *style = APR_FILEPATH_ENCODING_LOCALE; +#endif return APR_SUCCESS; } From d20d479ef4d3e25db25613a38d60269d5bc7a6eb Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Wed, 15 Aug 2007 21:30:07 +0000 Subject: [PATCH 5902/7878] insure that an optimizing compiler will re-load the links from memory each time they are referenced. background: a loop in mod_deflate on AIX with xlc -O2 because the links from an apr_bucket_brigade head structure were not reloaded from memory after an APR_BUCKET_REMOVE macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@566349 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_ring.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_ring.h b/include/apr_ring.h index a796816dcca..867f47a596b 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -69,8 +69,8 @@ */ #define APR_RING_ENTRY(elem) \ struct { \ - struct elem *next; \ - struct elem *prev; \ + struct elem * volatile next; \ + struct elem * volatile prev; \ } /** From 5597e0431f2d6e5883fbc9588a41111d7c61a5d3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 17 Aug 2007 20:50:19 +0000 Subject: [PATCH 5903/7878] Fix altroot substitution bug. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@567137 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl index 9ee8918e90b..3012984df3d 100644 --- a/build/fixwin32mak.pl +++ b/build/fixwin32mak.pl @@ -14,7 +14,9 @@ # ignore our own direcory (allowing us to move into any parallel tree) $root =~ s|^.:(.*)?$|cd "$1|; $root =~ s|/|\\\\|g; -print "Testing " . $root . "\n"; +$altroot = $root; +$altroot =~ s| ".:| "|; +print "Stripping " . $root . " and " . $altroot . "\n"; find(\&fixcwd, '.'); sub fixcwd { @@ -23,26 +25,29 @@ sub fixcwd { $thisroot =~ s|^./(.*)$|$1|; $thisroot =~ s|/|\\\\|g; $thisroot = $root . "\\\\" . $thisroot; + $thisaltroot = $altroot . "\\\\" . $thisroot; $oname = $_; $tname = '.#' . $_; $verchg = 0; -#print "Processing " . $thisroot . " of " . $_ . "\n"; $srcfl = new IO::File $_, "r" || die; $dstfl = new IO::File $tname, "w" || die; while ($src = <$srcfl>) { if ($src =~ m|^\s*($root[^\"]*)\".*$|) { -#print "Found " . $1 . "\"\n"; $orig = $thisroot; + } elsif ($src =~ m|^\s*($altroot[^\"]*)\".*$|) { + $orig = $thisaltroot; + } + if (defined($orig)) { $repl = "cd \"."; while (!($src =~ s|$orig|$repl|)) { -#print "Tried replacing " . $orig . " with " . $repl . "\n"; if (!($orig =~ s|^(.*)\\\\[^\\]+$|$1|)) { break; } $repl .= "\\.."; } -#print "Replaced " . $orig . " with " . $repl . "\n"; +print "Replaced " . $orig . " with " . $repl . "\n"; $verchg = -1; + undef $orig; } print $dstfl $src; } From aa9c46b49713cfbab4678acbc75772386910ad22 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 17 Aug 2007 20:51:15 +0000 Subject: [PATCH 5904/7878] Tabs? **tabs???** Mea culpa. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@567138 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 60 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl index 3012984df3d..7efdc11bf1a 100644 --- a/build/fixwin32mak.pl +++ b/build/fixwin32mak.pl @@ -22,60 +22,60 @@ sub fixcwd { if (m|.mak$|) { $thisroot = $File::Find::dir; - $thisroot =~ s|^./(.*)$|$1|; - $thisroot =~ s|/|\\\\|g; + $thisroot =~ s|^./(.*)$|$1|; + $thisroot =~ s|/|\\\\|g; $thisroot = $root . "\\\\" . $thisroot; $thisaltroot = $altroot . "\\\\" . $thisroot; $oname = $_; - $tname = '.#' . $_; - $verchg = 0; - $srcfl = new IO::File $_, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - if ($src =~ m|^\s*($root[^\"]*)\".*$|) { - $orig = $thisroot; + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $_, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ m|^\s*($root[^\"]*)\".*$|) { + $orig = $thisroot; } elsif ($src =~ m|^\s*($altroot[^\"]*)\".*$|) { - $orig = $thisaltroot; + $orig = $thisaltroot; } if (defined($orig)) { $repl = "cd \"."; while (!($src =~ s|$orig|$repl|)) { - if (!($orig =~ s|^(.*)\\\\[^\\]+$|$1|)) { + if (!($orig =~ s|^(.*)\\\\[^\\]+$|$1|)) { break; } - $repl .= "\\.."; - } -print "Replaced " . $orig . " with " . $repl . "\n"; - $verchg = -1; + $repl .= "\\.."; + } + print "Replaced " . $orig . " with " . $repl . "\n"; + $verchg = -1; undef $orig; - } + } print $dstfl $src; - } - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Corrected absolute paths within " . $oname . " in " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Corrected absolute paths within " . $oname . " in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } $dname = $oname; $dname =~ s/.mak$/.dsp/; - @dstat = stat($dname); + @dstat = stat($dname); @ostat = stat($oname); if ($ostat[9] && $dstat[9] && ($ostat[9] != $dstat[9])) { @onames = ($oname); utime $dstat[9], $dstat[9], @onames; - print "Touched datestamp for " . $oname . " in " . $File::Find::dir . "\n"; + print "Touched datestamp for " . $oname . " in " . $File::Find::dir . "\n"; } $oname =~ s/.mak$/.dep/; @ostat = stat($oname); if ($ostat[9] && $dstat[9] && ($ostat[9] != $dstat[9])) { @onames = ($oname); utime $dstat[9], $dstat[9], @onames; - print "Touched datestamp for " . $oname . " in " . $File::Find::dir . "\n"; + print "Touched datestamp for " . $oname . " in " . $File::Find::dir . "\n"; } } } From 4b1eb109962ac9d1e84fd9f9dda2f25c65c97cee Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 17 Aug 2007 20:56:39 +0000 Subject: [PATCH 5905/7878] More de-tabification. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@567139 13f79535-47bb-0310-9956-ffa450edef68 --- build/cvtdsp.pl | 646 +++++++++++++++++++++++----------------------- build/lineends.pl | 82 +++--- 2 files changed, 364 insertions(+), 364 deletions(-) diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl index 3a21eb7cd6e..becb75bd5ed 100644 --- a/build/cvtdsp.pl +++ b/build/cvtdsp.pl @@ -29,10 +29,10 @@ find(\&addmt, '.'); } elsif ($ARGV[0] eq '-m') { - ## 0 - conapp, 1 - dll lib, 2 - static lib - $dsptype = 2; - $name = "apr"; - onemake(); + ## 0 - conapp, 1 - dll lib, 2 - static lib + $dsptype = 2; + $name = "apr"; + onemake(); } else { print "Specify -5 or -6 for Visual Studio 5 or 6 (98) .dsp format\n"; @@ -48,33 +48,33 @@ sub addmt { if (m|\.dsp$|) { $oname = $_; - $tname = '.#' . $_; + $tname = '.#' . $_; $verchg = 0; $srcfl = new IO::File $oname, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - if ($src =~ m|^# TARGTYPE .+ Application|) { + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ m|^# TARGTYPE .+ Application|) { $outtype = ".exe" - } - if ($src =~ m|^# TARGTYPE .+ Dynamic-Link|) { + } + if ($src =~ m|^# TARGTYPE .+ Dynamic-Link|) { $outtype = ".dll" - } - if ($src =~ m|^# PROP Output_Dir "(.+)"|) { + } + if ($src =~ m|^# PROP Output_Dir "(.+)"|) { $outdir = $1; $outpath = $oname; $outpath =~ s|\.dsp||; $outpath = ".\\" . $outdir . "\\" . $outpath . $outtype; - } - if ($src =~ m|^# ADD (BASE )?LINK32 .+ /out:"([^"]+)"|) { - $outpath = $2; + } + if ($src =~ m|^# ADD (BASE )?LINK32 .+ /out:"([^"]+)"|) { + $outpath = $2; $outpath =~ s|/|\\|; $outpath = ".\\" . $outpath if (!($outpath =~ m|^\.|)); $src =~ s|/out:"([^"]+)"|/out:"$outpath"|; - } - if (defined($outpath) && ($src =~ m|^# Begin Special Build Tool|)) { + } + if (defined($outpath) && ($src =~ m|^# Begin Special Build Tool|)) { undef $outpath; } - if (defined($outpath) && defined($outtype) && ($src =~ m|^\s*$|)) { + if (defined($outpath) && defined($outtype) && ($src =~ m|^\s*$|)) { print $dstfl '# Begin Special Build Tool' . "\n"; print $dstfl 'TargetPath=' . $outpath . "\n"; print $dstfl 'SOURCE="$(InputPath)"' . "\n"; @@ -85,64 +85,64 @@ sub addmt { undef $outpath; } print $dstfl $src; - } + } undef $outtype if (defined($outtype)); undef $outpath if (defined($outpath)); - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Added manifest to " . $oname . " in " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Added manifest to " . $oname . " in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } } } sub tovc5 { if (m|\.dsp$|) { $oname = $_; - $tname = '.#' . $_; + $tname = '.#' . $_; $verchg = 0; - $srcfl = new IO::File $oname, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - if ($src =~ s|Format Version 6\.00|Format Version 5\.00|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD CPP .*)/ZI (.*)|$1/Zi $2|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD BASE CPP .*)/ZI (.*)|$1/Zi $2|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD CPP .*)/EHsc (.*)|$1/GX $2|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD BASE CPP .*)/EHsc (.*)|$1/GX $2|) { - $verchg = -1; - } - while ($src =~ s|^(# ADD RSC .*)/d "([^ ="]+)=([^"]+)"|$1/d $2="$3"|) { - $verchg = -1; - } - if ($src !~ m|^# PROP AllowPerConfigDependencies|) { - print $dstfl $src; } - else { - $verchg = -1; - } - } - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Converted VC6 project " . $oname . " to VC5 in " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } + $srcfl = new IO::File $oname, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|Format Version 6\.00|Format Version 5\.00|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD CPP .*)/ZI (.*)|$1/Zi $2|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD BASE CPP .*)/ZI (.*)|$1/Zi $2|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD CPP .*)/EHsc (.*)|$1/GX $2|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD BASE CPP .*)/EHsc (.*)|$1/GX $2|) { + $verchg = -1; + } + while ($src =~ s|^(# ADD RSC .*)/d "([^ ="]+)=([^"]+)"|$1/d $2="$3"|) { + $verchg = -1; + } + if ($src !~ m|^# PROP AllowPerConfigDependencies|) { + print $dstfl $src; } + else { + $verchg = -1; + } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted VC6 project " . $oname . " to VC5 in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } } } @@ -150,43 +150,43 @@ sub tovc6 { if (m|\.dsp$|) { $oname = $_; - $tname = '.#' . $_; - $verchg = 0; - $srcfl = new IO::File $_, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - if ($src =~ s|Format Version 5\.00|Format Version 6\.00|) { - $verchg = -1; - } - if ($src =~ s|^(!MESSAGE .*)\\\n|$1|) { - $cont = <$srcfl>; - $src = $src . $cont; - $verchg = -1; - } - if ($src =~ s|^(# ADD CPP .*)/GX (.*)|$1/EHsc $2|) { - $verchg = -1; - } - if ($src =~ s|^(# ADD BASE CPP .*)/GX (.*)|$1/EHsc $2|) { - $verchg = -1; - } - while ($src =~ s|^(# ADD RSC .*)/d "([^ ="]+)=([^"]+)"|$1/d $2="$3"|) { - $verchg = -1; - } + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $_, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|Format Version 5\.00|Format Version 6\.00|) { + $verchg = -1; + } + if ($src =~ s|^(!MESSAGE .*)\\\n|$1|) { + $cont = <$srcfl>; + $src = $src . $cont; + $verchg = -1; + } + if ($src =~ s|^(# ADD CPP .*)/GX (.*)|$1/EHsc $2|) { + $verchg = -1; + } + if ($src =~ s|^(# ADD BASE CPP .*)/GX (.*)|$1/EHsc $2|) { + $verchg = -1; + } + while ($src =~ s|^(# ADD RSC .*)/d "([^ ="]+)=([^"]+)"|$1/d $2="$3"|) { + $verchg = -1; + } print $dstfl $src; - if ($verchg && $src =~ m|^# Begin Project|) { - print $dstfl "# PROP AllowPerConfigDependencies 0\n"; - } - } - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Converted VC5 project " . $oname . " to VC6 in " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } + if ($verchg && $src =~ m|^# Begin Project|) { + print $dstfl "# PROP AllowPerConfigDependencies 0\n"; + } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted VC5 project " . $oname . " to VC6 in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } } } @@ -194,32 +194,32 @@ sub tovc2005 { if (m|\.dsp$| || m|\.mak$|) { $oname = $_; - $tname = '.#' . $_; - $verchg = 0; - $srcfl = new IO::File $_, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - if ($src =~ s|(\bCPP.*) /GX(.*)|$1 /EHsc$2|) { - $verchg = -1; - } - if ($src =~ s|(\bLINK32.*) /machine:I386(.*)|$1$2|) { - $verchg = -1; - } - while ($src =~ s|^(# ADD RSC .*)/d ([^ ="]+)="([^"]+)"|$1/d "$2=$3"|) { - $verchg = -1; - } + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $_, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|(\bCPP.*) /GX(.*)|$1 /EHsc$2|) { + $verchg = -1; + } + if ($src =~ s|(\bLINK32.*) /machine:I386(.*)|$1$2|) { + $verchg = -1; + } + while ($src =~ s|^(# ADD RSC .*)/d ([^ ="]+)="([^"]+)"|$1/d "$2=$3"|) { + $verchg = -1; + } print $dstfl $src; - } - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Converted project " . $oname . " to 2005 in " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted project " . $oname . " to 2005 in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } } } @@ -227,29 +227,29 @@ sub tow3 { if (m|\.dsp$| || m|\.mak$|) { $oname = $_; - $tname = '.#' . $_; - $verchg = 0; - $srcfl = new IO::File $_, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - while ($src =~ m|\\\n$|) { - $src = $src . <$srcfl> - } - if ($src =~ s|(\bCPP.*) /W4(.*)|$1 /W3$2|) { - $verchg = -1; - } + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $_, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + while ($src =~ m|\\\n$|) { + $src = $src . <$srcfl> + } + if ($src =~ s|(\bCPP.*) /W4(.*)|$1 /W3$2|) { + $verchg = -1; + } print $dstfl $src; - } - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Converted project " . $oname . " to warn:3 in " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted project " . $oname . " to warn:3 in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } } } @@ -257,29 +257,29 @@ sub tow4 { if (m|\.dsp$| || m|\.mak$|) { $oname = $_; - $tname = '.#' . $_; - $verchg = 0; - $srcfl = new IO::File $_, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - while ($src =~ m|\\\n$|) { - $src = $src . <$srcfl> - } - if ($src =~ s|(\bCPP.*) /W3(.*)|$1 /W4$2|) { - $verchg = -1; - } + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $_, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + while ($src =~ m|\\\n$|) { + $src = $src . <$srcfl> + } + if ($src =~ s|(\bCPP.*) /W3(.*)|$1 /W4$2|) { + $verchg = -1; + } print $dstfl $src; - } - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Converted project " . $oname . " to warn:4 " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted project " . $oname . " to warn:4 " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } } } @@ -287,52 +287,52 @@ sub tovc64 { if (m|\.dsp$| || m|\.mak$|) { $oname = $_; - $tname = '.#' . $_; - $verchg = 0; - $srcfl = new IO::File $_, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - while ($src =~ m|\\\n$|) { - $src = $src . <$srcfl> - } - if ($src =~ s|Win32 \(x86\) (Release)|Win32 (IA64) $1|s) { - $verchg = -1; - } - if ($src =~ s|Win32 \(x86\) (Debug)|Win32 (IA64) $1|s) { - $verchg = -1; - } - if ($src =~ s| - Win32 (Release)| - Win32 (IA64) $1|s) { - $verchg = -1; - } - if ($src =~ s| - Win32 (Debug)| - Win32 (IA64) $1|s) { - $verchg = -1; - } - # Cross compilation exceptions - if (!(m|gen[^/]*$| || m|dftables[^/]*$|)) { - if ($src =~ s|(\bCPP.* /W3)(.*) /FD(.*)|$1 /As64 /Wp64$2$3|s) { - $verchg = -1; - } - if ($src =~ s|(\bLINK.*/machine):I386(.*)|$1:IA64$2|s) { - $verchg = -1; - } - } - else { - if ($src =~ s|(\bCPP.* /W3)(.*) /FD(.*)|$1 /As32 /Wp64$2$3|s) { - $verchg = -1; - } - } + $tname = '.#' . $_; + $verchg = 0; + $srcfl = new IO::File $_, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + while ($src =~ m|\\\n$|) { + $src = $src . <$srcfl> + } + if ($src =~ s|Win32 \(x86\) (Release)|Win32 (IA64) $1|s) { + $verchg = -1; + } + if ($src =~ s|Win32 \(x86\) (Debug)|Win32 (IA64) $1|s) { + $verchg = -1; + } + if ($src =~ s| - Win32 (Release)| - Win32 (IA64) $1|s) { + $verchg = -1; + } + if ($src =~ s| - Win32 (Debug)| - Win32 (IA64) $1|s) { + $verchg = -1; + } + # Cross compilation exceptions + if (!(m|gen[^/]*$| || m|dftables[^/]*$|)) { + if ($src =~ s|(\bCPP.* /W3)(.*) /FD(.*)|$1 /As64 /Wp64$2$3|s) { + $verchg = -1; + } + if ($src =~ s|(\bLINK.*/machine):I386(.*)|$1:IA64$2|s) { + $verchg = -1; + } + } + else { + if ($src =~ s|(\bCPP.* /W3)(.*) /FD(.*)|$1 /As32 /Wp64$2$3|s) { + $verchg = -1; + } + } print $dstfl $src; - } - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Converted build file " . $oname . " to Win64 in " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted build file " . $oname . " to Win64 in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } } } @@ -340,29 +340,29 @@ sub todebugpools { if (m|\.dsp$|) { $oname = $_; - $tname = '.#' . $_; + $tname = '.#' . $_; $verchg = 0; - $srcfl = new IO::File $oname, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - if ($src =~ s|^(# ADD CPP .* /D "_DEBUG" )|$1/D "APR_POOL_DEBUG" |) { - $verchg = -1; + $srcfl = new IO::File $oname, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|^(# ADD CPP .* /D "_DEBUG" )|$1/D "APR_POOL_DEBUG" |) { + $verchg = -1; if ($oname =~ /apr\.dsp$/) { - $src =~ s|^(# ADD CPP .* /D "_DEBUG" )|$1/D "POOL_DEBUG" |; + $src =~ s|^(# ADD CPP .* /D "_DEBUG" )|$1/D "POOL_DEBUG" |; } - } + } print $dstfl $src; - } - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Converted project " . $oname . " to debug pools in " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted project " . $oname . " to debug pools in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } } } @@ -370,26 +370,26 @@ sub tobrowsesources { if (m|\.dsp$|) { $oname = $_; - $tname = '.#' . $_; + $tname = '.#' . $_; $verchg = 0; - $srcfl = new IO::File $oname, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - if ($src =~ s|^(# ADD CPP .*)( /Fd)|$1 /Fr "/httpd-2.0/srclib/apr"$2|) { - $verchg = -1; - } + $srcfl = new IO::File $oname, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|^(# ADD CPP .*)( /Fd)|$1 /Fr "/httpd-2.0/srclib/apr"$2|) { + $verchg = -1; + } print $dstfl $src; - } - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Converted project " . $oname . " to browse sources in " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted project " . $oname . " to browse sources in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } } } @@ -397,27 +397,27 @@ sub frommakefiles { if (m|\.mak\.in$|) { $oname = $_; - $dname = $_; - $_ =~ s/\.mak\.in/.dsp/; + $dname = $_; + $_ =~ s/\.mak\.in/.dsp/; $verchg = 0; - $srcfl = new IO::File $oname, "r" || die; - $dstfl = new IO::File $tname, "w" || die; - while ($src = <$srcfl>) { - if ($src =~ s|^(# ADD CPP .*)( /Fd)|$1 /Fr "/httpd-2.0/srclib/apr"$2|) { - $verchg = -1; - } + $srcfl = new IO::File $oname, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ s|^(# ADD CPP .*)( /Fd)|$1 /Fr "/httpd-2.0/srclib/apr"$2|) { + $verchg = -1; + } print $dstfl $src; - } - undef $srcfl; - undef $dstfl; - if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Converted project " . $oname . " to browse sources in " . $File::Find::dir . "\n"; - } - else { - unlink $tname; - } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Converted project " . $oname . " to browse sources in " . $File::Find::dir . "\n"; + } + else { + unlink $tname; + } } } @@ -425,47 +425,47 @@ sub frommakefiles { sub onemake { if ($dsptype == 0) { - $cdefs = qq{/D "WIN32" /D "_CONSOLE"}; - $lmodel = qq{/subsystem:console}; - $targname = "Win32 (x86) Console Application"; - $targid = "0x0103"; - $debpath = "Debug"; $relpath = "Release"; + $cdefs = qq{/D "WIN32" /D "_CONSOLE"}; + $lmodel = qq{/subsystem:console}; + $targname = "Win32 (x86) Console Application"; + $targid = "0x0103"; + $debpath = "Debug"; $relpath = "Release"; } elsif ($dsptype == 1) { - $cdefs = qq{/D "WIN32" /D "_WINDOWS"}; - $lmodel = qq{/subsystem:windows /dll}; - $targname = "Win32 (x86) Dynamic-Link Library"; - $targid = "0x0102"; - $debpath = "Debug"; $relpath = "Release"; + $cdefs = qq{/D "WIN32" /D "_WINDOWS"}; + $lmodel = qq{/subsystem:windows /dll}; + $targname = "Win32 (x86) Dynamic-Link Library"; + $targid = "0x0102"; + $debpath = "Debug"; $relpath = "Release"; } elsif($dsptype == 2) { - $cdefs = qq{/D "WIN32" /D "_CONSOLE"}; - $lmodel = qq{/subsystem:console}; - $targname = "Win32 (x86) Static Library"; - $targid = "0x0104"; - $debpath = "LibD"; $relpath = "LibR"; + $cdefs = qq{/D "WIN32" /D "_CONSOLE"}; + $lmodel = qq{/subsystem:console}; + $targname = "Win32 (x86) Static Library"; + $targid = "0x0104"; + $debpath = "LibD"; $relpath = "LibR"; } - $file = dspheader(); + $file = dspheader(); - $second = ""; + $second = ""; - $model = "Release"; - $usedebuglib = "0"; - $debugdef = "NDEBUG"; - $cflags = "/MD /W3 /O2"; - $cincl = qq{/I "./include" /I "./os/win32" /I "./srclib/apr/include" /I "./srclib/apr-util/include"}; - $lflags = qq{/map}; - $file .= dsponemodel(); + $model = "Release"; + $usedebuglib = "0"; + $debugdef = "NDEBUG"; + $cflags = "/MD /W3 /O2"; + $cincl = qq{/I "./include" /I "./os/win32" /I "./srclib/apr/include" /I "./srclib/apr-util/include"}; + $lflags = qq{/map}; + $file .= dsponemodel(); - $second = "ELSE"; - $model = "Debug"; - $usedebuglib = "1"; - $debugdef = "_DEBUG"; - $cflags = "/MDd /W3 /GX /Zi /Od"; - $cincl = qq{/I "./include" /I "./os/win32" /I "./srclib/apr/include" /I "./srclib/apr-util/include"}; - $lflags = qq{/incremental:no /debug}; - $file .= dsponemodel(); + $second = "ELSE"; + $model = "Debug"; + $usedebuglib = "1"; + $debugdef = "_DEBUG"; + $cflags = "/MDd /W3 /GX /Zi /Od"; + $cincl = qq{/I "./include" /I "./os/win32" /I "./srclib/apr/include" /I "./srclib/apr-util/include"}; + $lflags = qq{/incremental:no /debug}; + $file .= dsponemodel(); - $file .= qq{ + $file .= qq{ !ENDIF # Begin Target @@ -477,24 +477,24 @@ sub onemake { $toroot = "."; #HERE IS OUR FOREACH! - $file .= qq{# Begin Source File + $file .= qq{# Begin Source File SOURCE=./server/main.c # End Source File }; if ($dsptype == 0) { - #HERE IS OUR ICON! - $icon="$toroot/build/win32/apache.ico"; - $file .= qq{# Begin Source File + #HERE IS OUR ICON! + $icon="$toroot/build/win32/apache.ico"; + $file .= qq{# Begin Source File SOURCE=$icon # End Source File }; - $icon = "icon=" . $icon . " "; + $icon = "icon=" . $icon . " "; } if ($dsptype == 0 || $dsptype == 1) { - $file .= qq{ + $file .= qq{ # Begin Source File SOURCE=./$name.rc @@ -507,24 +507,24 @@ sub onemake { InputPath=$toroot/include/ap_release.h $toroot/build/win32/win32ver.awk "./$name.rc" : \$(SOURCE) "\$(INTDIR)" "\$(OUTDIR)" - awk -f $toroot/build/win32/win32ver.awk $name "Apache HTTP Server" $toroot/include/ap_release.h $icon> ./Apache.rc + awk -f $toroot/build/win32/win32ver.awk $name "Apache HTTP Server" $toroot/include/ap_release.h $icon> ./Apache.rc # End Custom Build # End Source File }; } - $file .= qq{ + $file .= qq{ # End Target # End Project }; - print $file; + print $file; } sub dspheader { if ($dsptype == 1) { - $midl = "MTL=midl.exe\n"; + $midl = "MTL=midl.exe\n"; } else { - $midl = "" + $midl = "" } qq{# Microsoft Developer Studio Project File - Name="$name" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 @@ -559,26 +559,26 @@ sub dspheader { } sub dsponemodel { if ($model eq "Release") { - $targpath = $relpath; + $targpath = $relpath; } else { - $targpath = $debpath; + $targpath = $debpath; } if ($dsptype == 1) { - $midl = + $midl = qq{# ADD BASE MTL /nologo /D "$debugdef" /win32 # ADD MTL /nologo /D "$debugdef" /mktyplib203 /win32 }; } if ($dsptype == 2) { - $linkop = qq{LIB32=link.exe -lib + $linkop = qq{LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo }; } else { - $linkop = qq{LINK32=link.exe + $linkop = qq{LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo $lmodel $lflags /machine:I386 # ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo $lmodel $lflags /machine:I386 }; - } + } qq{ !${second}IF "\$(CFG)" == "$name - Win32 $model" diff --git a/build/lineends.pl b/build/lineends.pl index 8d9b2d97bf4..3e3067f7685 100644 --- a/build/lineends.pl +++ b/build/lineends.pl @@ -63,22 +63,22 @@ } elsif (@ARGV[0] =~ m/^-/) { die "What is " . @ARGV[0] . " supposed to mean?\n\n" - . "Syntax:\t$0 [option()s] [path(s)]\n\n" . <<'OUTCH' -Where: paths specifies the top level directory to convert (default of '.') - options are; + . "Syntax:\t$0 [option()s] [path(s)]\n\n" . <<'OUTCH' +Where: paths specifies the top level directory to convert (default of '.') + options are; - --cr keep/add one ^M - --nocr remove ^M's - --touch the datestamp (default: keeps date/attribs) - --force mismatched corrections (unbalanced ^M's) - --FORCE all files regardless of file name! + --cr keep/add one ^M + --nocr remove ^M's + --touch the datestamp (default: keeps date/attribs) + --force mismatched corrections (unbalanced ^M's) + --FORCE all files regardless of file name! OUTCH } else { find(\&totxt, @ARGV[0]); - print "scanned " . @ARGV[0] . "\n"; - $givenpaths = 1; + print "scanned " . @ARGV[0] . "\n"; + $givenpaths = 1; } shift @ARGV; } @@ -90,50 +90,50 @@ sub totxt { $oname = $_; - $tname = '.#' . $_; + $tname = '.#' . $_; if (!-f) { return; } - @exts = split /\./; - if ($forceending < 2) { + @exts = split /\./; + if ($forceending < 2) { while ($#exts && ($ext = pop(@exts))) { if ($ignore =~ m|-$ext-|i) { return; } - } + } } return if ($File::Find::dir =~ m|^(.+/)?.svn(/.+)?$|); - @ostat = stat($oname); + @ostat = stat($oname); $srcfl = new IO::File $oname, "r" or die; - $dstfl = new IO::File $tname, "w" or die; + $dstfl = new IO::File $tname, "w" or die; binmode $srcfl; - if ($notnative) { + if ($notnative) { binmode $dstfl; - } - undef $t; + } + undef $t; while (<$srcfl>) { if (s/(\r*)\n$/\n/) { - $n = length $1; - if (!defined $t) { - $t = $n; - } - if (!$forceending && (($n != $t) || m/\r/)) { - print "mismatch in " .$oname. ":" .$n. " expected " .$t. "\n"; - undef $t; - last; - } - elsif ($notnative > 0) { + $n = length $1; + if (!defined $t) { + $t = $n; + } + if (!$forceending && (($n != $t) || m/\r/)) { + print "mismatch in " .$oname. ":" .$n. " expected " .$t. "\n"; + undef $t; + last; + } + elsif ($notnative > 0) { s/\n$/\r\n/; } } - print $dstfl $_; - } - if (defined $t && (tell $srcfl == tell $dstfl)) { - undef $t; - } - undef $srcfl; - undef $dstfl; - if (defined $t) { + print $dstfl $_; + } + if (defined $t && (tell $srcfl == tell $dstfl)) { + undef $t; + } + undef $srcfl; + undef $dstfl; + if (defined $t) { unlink $oname or die; rename $tname, $oname or die; @anames = ($oname); @@ -143,8 +143,8 @@ sub totxt { chmod $ostat[2] & 07777, @anames; chown $ostat[5], $ostat[6], @anames; print "Converted file " . $oname . " to text in " . $File::Find::dir . "\n"; - } - else { - unlink $tname or die; - } + } + else { + unlink $tname or die; + } } From 2f7fe1a17ad643c8c828355c110bace04ed8ed52 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 20 Aug 2007 03:05:49 +0000 Subject: [PATCH 5906/7878] Fix vcproj per-user datastore git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@567531 13f79535-47bb-0310-9956-ffa450edef68 From 6d0667d768005be8062615ac5a79c1c87a70c964 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 23 Aug 2007 04:11:05 +0000 Subject: [PATCH 5907/7878] Make Win32 consistent with unix, in that we will inherit the default stdin/out/err if some of these handles are left unset, while one or two of them are set with apr_procattr_io_set() (with one or more APR_NO_PIPE's) and/or apr_procattr_child_XXX_set(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@568818 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 3f48d15e9a8..994c5dd766d 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -728,15 +728,15 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, si.hStdInput = (attr->child_in) ? attr->child_in->filehand - : INVALID_HANDLE_VALUE; + : GetStdHandle(STD_INPUT_HANDLE); si.hStdOutput = (attr->child_out) ? attr->child_out->filehand - : INVALID_HANDLE_VALUE; + : GetStdHandle(STD_OUTPUT_HANDLE); si.hStdError = (attr->child_err) ? attr->child_err->filehand - : INVALID_HANDLE_VALUE; + : GetStdHandle(STD_ERROR_HANDLE); } if (attr->user_token) { si.lpDesktop = L"Winsta0\\Default"; @@ -800,15 +800,15 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, si.hStdInput = (attr->child_in) ? attr->child_in->filehand - : INVALID_HANDLE_VALUE; + : GetStdHandle(STD_INPUT_HANDLE); si.hStdOutput = (attr->child_out) ? attr->child_out->filehand - : INVALID_HANDLE_VALUE; + : GetStdHandle(STD_OUTPUT_HANDLE); si.hStdError = (attr->child_err) ? attr->child_err->filehand - : INVALID_HANDLE_VALUE; + : GetStdHandle(STD_ERROR_HANDLE); } rv = CreateProcessA(progname, cmdline, /* Command line */ From ce9b24abd61f087a96d7ac4e1422781911ba6874 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 23 Aug 2007 08:13:44 +0000 Subject: [PATCH 5908/7878] We expect iov lengths to match up with a size_t, not ssize_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@568881 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_want.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_want.h b/include/apr_want.h index be35f98972a..1afed3606ea 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -92,7 +92,7 @@ struct iovec { char *iov_base; - int iov_len; + size_t iov_len; }; #endif From dd13957f9aebc9c0283ace720e9a8bb6ef64691a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 24 Aug 2007 10:42:47 +0000 Subject: [PATCH 5909/7878] We needed to fix the fix of .mak files to prevent insane amounts of recursion, because VS98 wasn't quite exporting the post-build targets appropriatly, and didn't respect the RECURSE flag. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@569339 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 60 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl index 7efdc11bf1a..6fbe36e9c4d 100644 --- a/build/fixwin32mak.pl +++ b/build/fixwin32mak.pl @@ -19,6 +19,30 @@ print "Stripping " . $root . " and " . $altroot . "\n"; find(\&fixcwd, '.'); +# Given this pattern that disregarded the RECURSE flag... +# +# !IF "$(RECURSE)" == "0" +# +# ALL : "$(OUTDIR)\mod_charset_lite.so" +# +# !ELSE +# +# ALL : "libhttpd - Win32 Release" "libaprutil - Win32 Release" "libapr - Win32 Release" "$(OUTDIR)\mod_charset_lite.so" +# +# !ENDIF +#... +# DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep +#... +# ALL : $(DS_POSTBUILD_DEP) +# +# $(DS_POSTBUILD_DEP) : "libhttpd - Win32 Release" "libaprutil - Win32 Release" "libapr - Win32 Release" "$(OUTDIR)\mod_charset_lite.so" +# +# we will axe the final ALL : clause, +# strip all but the final element from $(DS_POSTBUILD_DEP) : clause +# move the DS_POSTBUILD_DEP assignment above the IF (for true ALL : targets) +# and in pass 2, append the $(DS_POSTBUILD_DEP) to the valid ALL : targets + + sub fixcwd { if (m|.mak$|) { $thisroot = $File::Find::dir; @@ -29,9 +53,22 @@ sub fixcwd { $oname = $_; $tname = '.#' . $_; $verchg = 0; + $postdep = 0; $srcfl = new IO::File $_, "r" || die; $dstfl = new IO::File $tname, "w" || die; while ($src = <$srcfl>) { + if ($src =~ m|^(DS_POSTBUILD_DEP=.+)$|) { + $postdepval = $1 . "\n\n"; + } + if ($src =~ s|^ALL : \$\(DS_POSTBUILD_DEP\)||) { + $postdep = -1; + $verchg = -1; + $src = <$srcfl>; + $src = <$srcfl> if ($src =~ m|^$|); + } + if ($postdep) { + $src =~ s|^(\$\(DS_POSTBUILD_DEP\)) :.+(\"[^\"]+\")$|"$1" : $2|; + } if ($src =~ m|^\s*($root[^\"]*)\".*$|) { $orig = $thisroot; } elsif ($src =~ m|^\s*($altroot[^\"]*)\".*$|) { @@ -54,9 +91,26 @@ sub fixcwd { undef $srcfl; undef $dstfl; if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Corrected absolute paths within " . $oname . " in " . $File::Find::dir . "\n"; + if ($postdep) { + $srcfl = new IO::File $tname, "r" || die; + $dstfl = new IO::File $oname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ m|^\!IF "\$\(RECURSE\)" == "0".*$|) { + print $dstfl $postdepval; + } + $src =~ s|^(ALL : .+)$|$1 "\$\(DS_POSTBUILD_DEP\)"|; + print $dstfl $src; + } + undef $srcfl; + undef $dstfl; + unlink $tname || die; + print "Corrected post-dependency within " . $oname . " in " . $File::Find::dir . "\n"; + } + else { + unlink $oname || die; + rename $tname, $oname || die; + print "Corrected absolute paths within " . $oname . " in " . $File::Find::dir . "\n"; + } } else { unlink $tname; From 9727a98337d0c7e501cd47cba9fc27e0f2447d7a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 24 Aug 2007 11:01:06 +0000 Subject: [PATCH 5910/7878] Forgot to consider cases where there is no RECURSE (but we still have a somewhat bogusly constructed .mak file). Place the new target string after INTDIR is declared. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@569348 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl index 6fbe36e9c4d..2c7b7d2a2b3 100644 --- a/build/fixwin32mak.pl +++ b/build/fixwin32mak.pl @@ -57,8 +57,8 @@ sub fixcwd { $srcfl = new IO::File $_, "r" || die; $dstfl = new IO::File $tname, "w" || die; while ($src = <$srcfl>) { - if ($src =~ m|^(DS_POSTBUILD_DEP=.+)$|) { - $postdepval = $1 . "\n\n"; + if ($src =~ m|^DS_POSTBUILD_DEP=.+$|) { + $postdepval = $src; } if ($src =~ s|^ALL : \$\(DS_POSTBUILD_DEP\)||) { $postdep = -1; @@ -95,8 +95,9 @@ sub fixcwd { $srcfl = new IO::File $tname, "r" || die; $dstfl = new IO::File $oname, "w" || die; while ($src = <$srcfl>) { - if ($src =~ m|^\!IF "\$\(RECURSE\)" == "0".*$|) { - print $dstfl $postdepval; + if ($src =~ m|^INTDIR=|) { + print $dstfl $src; + $src = $postdepval; } $src =~ s|^(ALL : .+)$|$1 "\$\(DS_POSTBUILD_DEP\)"|; print $dstfl $src; From 21ad4338c503bf3f57f85670ed66862dd7ad97f9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 24 Aug 2007 21:54:30 +0000 Subject: [PATCH 5911/7878] I was experimenting with options on ELSE_WIN_OS_IS_ANSI, and realized this else combined with WCE is an oddball. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@569536 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 408e9d05bdf..88a362f71f9 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -128,9 +128,13 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, SetHandleInformation((HANDLE) (*new)->socketdes, HANDLE_FLAG_INHERIT, 0); } +#if APR_HAS_ANSI_FS + /* only if APR_HAS_ANSI_FS && APR_HAS_UNICODE_FS */ + ELSE_WIN_OS_IS_ANSI +#endif #endif #if APR_HAS_ANSI_FS || defined(_WIN32_WCE) - ELSE_WIN_OS_IS_ANSI { + { HANDLE hProcess = GetCurrentProcess(); HANDLE dup; if (DuplicateHandle(hProcess, (HANDLE) (*new)->socketdes, hProcess, From 62cbdf0c74d29250abf57b12972c6cc9e7071003 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 26 Aug 2007 19:50:26 +0000 Subject: [PATCH 5912/7878] This would be text git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@569873 13f79535-47bb-0310-9956-ffa450edef68 From 4decdde64050385d05b66aec61aa4d44b767ca38 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 26 Aug 2007 19:51:53 +0000 Subject: [PATCH 5913/7878] These would be text git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@569874 13f79535-47bb-0310-9956-ffa450edef68 From 7e7f15f991caf02a1b08ea55f88b718a5e30d0e8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 26 Aug 2007 21:19:55 +0000 Subject: [PATCH 5914/7878] Proposed; Solve win32 inherited pipe leaks by leveraging OS2 port's solution. Mutex the pipe manipulation on WinNT+++ alone (not WinCE, nor 9x) so that we toggle the inherited state of the stdin/out/err pipes. This is only possible on NT, because in CE/9x it would involve replacing the pipe handles all over the place as there is no toggle. This CRITICAL_SECTION pipe is incredibly fast in the mainline case, and only introduces contention in the threaded server after startup (for cgi, etc). Not unlike an in-process cgid. So, leave WinCE alone for now, since it doesn't follow the stdio model, and leave Win9x alone for good, as nearly abandoned. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@569882 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 10 +- include/arch/win32/apr_arch_inherit.h | 98 ++++++++++------- include/arch/win32/apr_arch_threadproc.h | 2 + misc/win32/start.c | 5 +- threadproc/win32/proc.c | 130 ++++++++++++++++++++--- 5 files changed, 195 insertions(+), 50 deletions(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 4b8b0d60d9b..31092c12ccb 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -95,7 +95,15 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, char name[50]; sa.nLength = sizeof(sa); - sa.bInheritHandle = TRUE; + +#if APR_HAS_UNICODE_FS + IF_WIN_OS_IS_UNICODE + sa.bInheritHandle = FALSE; +#endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI + sa.bInheritHandle = TRUE; +#endif sa.lpSecurityDescriptor = NULL; (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); diff --git a/include/arch/win32/apr_arch_inherit.h b/include/arch/win32/apr_arch_inherit.h index d70d5972c78..8969af664d8 100644 --- a/include/arch/win32/apr_arch_inherit.h +++ b/include/arch/win32/apr_arch_inherit.h @@ -21,43 +21,19 @@ #define APR_INHERIT (1 << 24) /* Must not conflict with other bits */ -#if defined(_WIN32_WCE) -#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ -APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ -{ \ - HANDLE temp, hproc = GetCurrentProcess(); \ - if (!DuplicateHandle(hproc, the##name->filehand, \ - hproc, &temp, 0, TRUE, \ - DUPLICATE_SAME_ACCESS)) \ - return apr_get_os_error(); \ - CloseHandle(the##name->filehand); \ - the##name->filehand = temp; \ - return APR_SUCCESS; \ -} +#if APR_HAS_UNICODE_FS && APR_HAS_ANSI_FS +/* !defined(_WIN32_WCE) is implicit here */ -#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ -APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ -{ \ - HANDLE temp, hproc = GetCurrentProcess(); \ - if (!DuplicateHandle(hproc, the##name->filehand, \ - hproc, &temp, 0, FALSE, \ - DUPLICATE_SAME_ACCESS)) \ - return apr_get_os_error(); \ - CloseHandle(the##name->filehand); \ - the##name->filehand = temp; \ - return APR_SUCCESS; \ -} -#else #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ { \ IF_WIN_OS_IS_UNICODE \ { \ - if (!SetHandleInformation(the##name->filehand, \ - HANDLE_FLAG_INHERIT, \ - HANDLE_FLAG_INHERIT)) \ - return apr_get_os_error(); \ - } \ +/* if (!SetHandleInformation(the##name->filehand, \ + * HANDLE_FLAG_INHERIT, \ + * HANDLE_FLAG_INHERIT)) \ + * return apr_get_os_error(); \ + */ } \ ELSE_WIN_OS_IS_ANSI \ { \ HANDLE temp, hproc = GetCurrentProcess(); \ @@ -76,10 +52,10 @@ APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ { \ IF_WIN_OS_IS_UNICODE \ { \ - if (!SetHandleInformation(the##name->filehand, \ - HANDLE_FLAG_INHERIT, 0)) \ - return apr_get_os_error(); \ - } \ +/* if (!SetHandleInformation(the##name->filehand, \ + * HANDLE_FLAG_INHERIT, 0)) \ + * return apr_get_os_error(); \ + */ } \ ELSE_WIN_OS_IS_ANSI \ { \ HANDLE temp, hproc = GetCurrentProcess(); \ @@ -92,6 +68,56 @@ APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ } \ return APR_SUCCESS; \ } -#endif + +#elif APR_HAS_ANSI_FS || defined(_WIN32_WCE) + +#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ +APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ +{ \ + HANDLE temp, hproc = GetCurrentProcess(); \ + if (!DuplicateHandle(hproc, the##name->filehand, \ + hproc, &temp, 0, TRUE, \ + DUPLICATE_SAME_ACCESS)) \ + return apr_get_os_error(); \ + CloseHandle(the##name->filehand); \ + the##name->filehand = temp; \ + return APR_SUCCESS; \ +} + +#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ +APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ +{ \ + HANDLE temp, hproc = GetCurrentProcess(); \ + if (!DuplicateHandle(hproc, the##name->filehand, \ + hproc, &temp, 0, FALSE, \ + DUPLICATE_SAME_ACCESS)) \ + return apr_get_os_error(); \ + CloseHandle(the##name->filehand); \ + the##name->filehand = temp; \ + return APR_SUCCESS; \ +} + +#else /* APR_HAS_UNICODE_FS && !APR_HAS_ANSI_FS && !defined(_WIN32_WCE) */ + +#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ +APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ +{ \ +/* if (!SetHandleInformation(the##name->filehand, \ + * HANDLE_FLAG_INHERIT, \ + * HANDLE_FLAG_INHERIT)) \ + * return apr_get_os_error(); \ + */ return APR_SUCCESS; \ +} + +#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ +APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ +{ \ +/* if (!SetHandleInformation(the##name->filehand, \ + * HANDLE_FLAG_INHERIT, 0)) \ + * return apr_get_os_error(); \ + */ return APR_SUCCESS; \ +} + +#endif /* defined(APR_HAS_UNICODE_FS) */ #endif /* ! INHERIT_H */ diff --git a/include/arch/win32/apr_arch_threadproc.h b/include/arch/win32/apr_arch_threadproc.h index 7af8ab6869b..d3ce9c51860 100644 --- a/include/arch/win32/apr_arch_threadproc.h +++ b/include/arch/win32/apr_arch_threadproc.h @@ -68,5 +68,7 @@ struct apr_thread_once_t { long value; }; +extern apr_status_t apr_threadproc_init(apr_pool_t *pool); + #endif /* ! THREAD_PROC_H */ diff --git a/misc/win32/start.c b/misc/win32/start.c index 6be557e029c..22820e8e556 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -22,7 +22,8 @@ #include "apr_arch_misc.h" /* for WSAHighByte / WSALowByte */ #include "wchar.h" -#include "apr_arch_file_io.h" +#include "apr_arch_file_io.h" /* bring in unicode-ness */ +#include "apr_arch_threadproc.h" /* bring in apr_threadproc_init */ #include "assert.h" /* This symbol is _private_, although it must be exported. @@ -204,6 +205,8 @@ APR_DECLARE(apr_status_t) apr_initialize(void) apr_signal_init(pool); + apr_threadproc_init(pool); + return APR_SUCCESS; } diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 994c5dd766d..362e1667648 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -300,7 +300,7 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, attr->sa = apr_palloc(attr->pool, sizeof(SECURITY_ATTRIBUTES)); attr->sa->nLength = sizeof (SECURITY_ATTRIBUTES); attr->sa->lpSecurityDescriptor = attr->sd; - attr->sa->bInheritHandle = TRUE; + attr->sa->bInheritHandle = FALSE; /* register the cleanup */ apr_pool_cleanup_register(attr->pool, (void *)attr, @@ -383,6 +383,47 @@ APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, return APR_SUCCESS; } +#if APR_HAS_UNICODE_FS && !defined(_WIN32_WCE) + +/* Used only for the NT code path, a critical section is the fastest + * implementation available. + */ +static CRITICAL_SECTION proc_lock; + +static apr_status_t threadproc_global_cleanup(void *ignored) +{ + DeleteCriticalSection(&proc_lock); + return APR_SUCCESS; +} + +/* Called from apr_initialize, we need a critical section to handle + * the pipe inheritance on win32. This will mutex any process create + * so as we change our inherited pipes, we prevent another process from + * also inheriting those alternate handles, and prevent the other process + * from failing to inherit our standard handles. + */ +apr_status_t apr_threadproc_init(apr_pool_t *pool) +{ + IF_WIN_OS_IS_UNICODE + { + InitializeCriticalSection(&proc_lock); + /* register the cleanup */ + apr_pool_cleanup_register(pool, &proc_lock, + threadproc_global_cleanup, + apr_pool_cleanup_null); + } + return APR_SUCCESS; +} + +#else /* !APR_HAS_UNICODE_FS || defined(_WIN32_WCE) */ + +apr_status_t apr_threadproc_init(apr_pool_t *pool) +{ + return APR_SUCCESS; +} + +#endif + APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, const char * const *args, @@ -657,6 +698,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, IF_WIN_OS_IS_UNICODE { STARTUPINFOW si; + DWORD stdin_reset = 0; + DWORD stdout_reset = 0; + DWORD stderr_reset = 0; apr_wchar_t *wprg = NULL; apr_wchar_t *wcmd = NULL; apr_wchar_t *wcwd = NULL; @@ -720,25 +764,65 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } #ifndef _WIN32_WCE + /* LOCK CRITICAL SECTION + * before we begin to manipulate the inherited handles + */ + EnterCriticalSection(&proc_lock); + if ((attr->child_in && attr->child_in->filehand) || (attr->child_out && attr->child_out->filehand) || (attr->child_err && attr->child_err->filehand)) { si.dwFlags |= STARTF_USESTDHANDLES; - si.hStdInput = (attr->child_in) - ? attr->child_in->filehand - : GetStdHandle(STD_INPUT_HANDLE); - - si.hStdOutput = (attr->child_out) - ? attr->child_out->filehand - : GetStdHandle(STD_OUTPUT_HANDLE); + si.hStdInput = GetStdHandle(STD_INPUT_HANDLE); + if (attr->child_in && attr->child_in->filehand) + { + if (GetHandleInformation(si.hStdInput, + &stdin_reset) + && (stdin_reset &= HANDLE_FLAG_INHERIT)) + SetHandleInformation(si.hStdInput, + HANDLE_FLAG_INHERIT, 0); + + si.hStdInput = attr->child_in->filehand; + SetHandleInformation(si.hStdInput, HANDLE_FLAG_INHERIT, + HANDLE_FLAG_INHERIT); + } + + si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); + if (attr->child_out && attr->child_out->filehand) + { + if (GetHandleInformation(si.hStdOutput, + &stdout_reset) + && (stdout_reset &= HANDLE_FLAG_INHERIT)) + SetHandleInformation(si.hStdOutput, + HANDLE_FLAG_INHERIT, 0); + + si.hStdOutput = attr->child_out->filehand; + SetHandleInformation(si.hStdInput, HANDLE_FLAG_INHERIT, + HANDLE_FLAG_INHERIT); + } - si.hStdError = (attr->child_err) - ? attr->child_err->filehand - : GetStdHandle(STD_ERROR_HANDLE); + si.hStdError = GetStdHandle(STD_ERROR_HANDLE); + if (attr->child_err && attr->child_err->filehand) + { + if (GetHandleInformation(si.hStdError, + &stderr_reset) + && (stderr_reset &= HANDLE_FLAG_INHERIT)) + SetHandleInformation(si.hStdError, + HANDLE_FLAG_INHERIT, 0); + + si.hStdError = attr->child_err->filehand; + SetHandleInformation(si.hStdError, HANDLE_FLAG_INHERIT, + HANDLE_FLAG_INHERIT); + } } if (attr->user_token) { + /* XXX: for terminal services, handles can't be cannot be + * inherited across sessions. This process must be created + * in our existing session. lpDesktop assignment appears + * to be wrong according to these rules. + */ si.lpDesktop = L"Winsta0\\Default"; if (!ImpersonateLoggedOnUser(attr->user_token)) { /* failed to impersonate the logged user */ @@ -768,7 +852,29 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, wcwd, /* Current directory name */ &si, &pi); } -#else + + if ((attr->child_in && attr->child_in->filehand) + || (attr->child_out && attr->child_out->filehand) + || (attr->child_err && attr->child_err->filehand)) + { + if (stdin_reset) + SetHandleInformation(GetStdHandle(STD_INPUT_HANDLE), + stdin_reset, stdin_reset); + + if (stdout_reset) + SetHandleInformation(GetStdHandle(STD_OUTPUT_HANDLE), + stdout_reset, stdout_reset); + + if (stderr_reset) + SetHandleInformation(GetStdHandle(STD_ERROR_HANDLE), + stderr_reset, stderr_reset); + } + /* RELEASE CRITICAL SECTION + * The state of the inherited handles has been restored. + */ + EnterCriticalSection(&proc_lock); + +#else /* defined(_WIN32_WCE) */ rv = CreateProcessW(wprg, wcmd, /* Executable & Command line */ NULL, NULL, /* Proc & thread security attributes */ FALSE, /* must be 0 */ From 3602d48efec0b2af2f391e672982eab48c1ba869 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 26 Aug 2007 21:42:09 +0000 Subject: [PATCH 5915/7878] Correct r569882 typo; we must leave what we enter. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@569890 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 362e1667648..01884bd4afb 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -767,7 +767,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, /* LOCK CRITICAL SECTION * before we begin to manipulate the inherited handles */ - EnterCriticalSection(&proc_lock); + LeaveCriticalSection(&proc_lock); if ((attr->child_in && attr->child_in->filehand) || (attr->child_out && attr->child_out->filehand) From 1acdcc5862679f88e263822e5071d64554f5c765 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 27 Aug 2007 03:47:03 +0000 Subject: [PATCH 5916/7878] Fix people-name encoding git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@569976 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 39 +++++++++++++++++++++------------------ STATUS | 2 +- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/CHANGES b/CHANGES index 7ada1238b6d..c2dab518e2f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ + -*- coding: utf-8 -*- Changes for APR 1.3.0 + *) Define the Mac OS/X filesystem_. [Branko ÄŒibej] + *) Add table cloning (deep copy) convenience function. [Davi Arnaut] @@ -81,7 +84,7 @@ Changes for APR 1.3.0 using VisualStudio 2005 [William Rowe] *) Utilise Solaris' native atomic_* functions for apr_atomics - where appropriate. [Colm MacCarthaigh] + where appropriate. [Colm MacCárthaigh] *) Make apr_socket_recvfrom initialize the port field in the from sockaddr. PR 39325 [Anthony Minessale ] @@ -93,10 +96,10 @@ Changes for APR 1.3.0 PR 38785. [Chris Darroch ] *) APR_FIND_APR macro now supports customisable detailed checks on - each installed apr. [Justin Erenkrantz, Colm MacCarthaigh] + each installed apr. [Justin Erenkrantz, Colm MacCárthaigh] *) APR_FIND_APR macro no longer checks /usr/local/apache2/ - [Colm MacCarthaigh] + [Colm MacCárthaigh] *) Add APR_POLLSET_NOCOPY option to apr_pollset API to eliminate O(n)-time lookup in apr_pollset_remove() (currently implemented @@ -104,17 +107,17 @@ Changes for APR 1.3.0 *) Add apr_file_buffer_set() and apr_file_buffer_size_get() functions to support variable buffer sizes with APR file handles. - [Colm MacCarthaigh] + [Colm MacCárthaigh] *) Add apr_file_open_flags_std[err|out|in]() functions. - [Colm MacCarthaigh] + [Colm MacCárthaigh] *) stdio: apr_file_open_std[err|out|in]() functions now set the APR_WRITE - or APR_READ flag as appropriate. [Colm MacCarthaigh] + or APR_READ flag as appropriate. [Colm MacCárthaigh] *) multicast: apr_mcast_*() no longer return APR_ENOTIMPL when invoked for non-UDP/RAW sockets. The caller is expected to ensure that the - socket-type is suitable for multicast. [Colm MacCarthaigh] + socket-type is suitable for multicast. [Colm MacCárthaigh] *) Add apr_sockaddr_ip_getbuf() function. [Joe Orton] @@ -283,7 +286,7 @@ Changes for APR 1.1.0 setting the user and group for new processes. [Mladen Turk] *) Add APR Multicast functions; including support for - Source-Specific Multicast from Colm MacCarthaigh. [Paul Querna] + Source-Specific Multicast from Colm MacCárthaigh. [Paul Querna] *) Add a build script to create a solaris package. [Graham Leggett] @@ -402,7 +405,7 @@ Changes with APR 1.0 memory segment. [Amit Athavale ] *) Add apr_strtoff() function for converting numeric strings into - apr_off_t values. [André Malo , Joe Orton] + apr_off_t values. [André Malo , Joe Orton] *) Fix stack overflow with IPv6 apr_socket_accept() on Win32. PR 28471. [inoue ] @@ -535,10 +538,10 @@ Changes with APR 0.9.5 *) Don't assume getnameinfo() can handle IPv4-mapped IPv6 addresses on any platforms. - [Jeff Trawick, Joe Orton, Colm MacCárthaigh ] + [Jeff Trawick, Joe Orton, Colm MacCárthaigh ] *) Support setuid, setgid and sticky file permissions bits on Unix. - [André Malo] + [André Malo] *) Fix sign error in apr_file_seek(APR_END). [Greg Hudson ] @@ -610,7 +613,7 @@ Changes with APR 0.9.4 [Mike Pilato , William Rowe] *) Work around a bug in Darwin when calling getnameinfo() on IPv4-mapped - IPv6-addresses. [Colm MacCárthaigh , Jeff Trawick, + IPv6-addresses. [Colm MacCárthaigh , Jeff Trawick, Justin Erenkrantz] *) Add apr_temp_dir_get() for getting the most suitable temp directory @@ -619,7 +622,7 @@ Changes with APR 0.9.4 *) Modify apr_sockaddr_info_get to call the resolver when we do not have a hostname. Also, fix bugs in the getaddrinfo() implementation. - [Colm MacCárthaigh , Justin Erenkrantz] + [Colm MacCárthaigh , Justin Erenkrantz] *) Change the behavior of unix process 'trylock's to return APR_ENOTIMPL instead of segfaulting, consistent with the @@ -687,7 +690,7 @@ Changes with APR 0.9.4 [Jacob Craig Lewallen ] *) Added flag APR_FILE_ATTR_HIDDEN for manipulating the "hidden" - file attribute on Windows and OS/2. [Branko Cibej] + file attribute on Windows and OS/2. [Branko ÄŒibej] *) SECURITY [CAN-2003-0245]: Fixed a bug that could be triggered remotely through mod_dav and possibly other mechanisms, causing @@ -770,7 +773,7 @@ Changes with APR 0.9.2 [Bjoern A. Zeeb , William Rowe, Joe Orton] *) Define APR_UINT64_T_FMT and APR_UINT64_T_FMT_LEN. - Define APR_INT64_T_FMT_LEN on Windows and Netware. [Branko Cibej] + Define APR_INT64_T_FMT_LEN on Windows and Netware. [Branko ÄŒibej] *) Correct apr_file_gets() on OS2 and Win32 so that '\r's are no longer eaten, and apr_file_gets() -> apr_file_puts() moves the contents @@ -790,14 +793,14 @@ Changes with APR 0.9.2 be a little more robust (and unique). [Jim Jagielski] *) Add functions apr_env_get, apr_env_set and apr_env_delete for - manipulating the environment. [Branko Cibej] + manipulating the environment. [Branko ÄŒibej] *) Fix APR_LAYOUT to work with layout files with no preceding blank lines and emit errors when layout is not found. PR 15679. [Justin Erenkrantz] *) Add functions apr_filepath_list_split and apr_filepath_list_merge - for managing search paths. [Branko Cibej] + for managing search paths. [Branko ÄŒibej] *) Introduce Release mode debugging symbols for Win32 builds of apr. All library builds gain /Zi for debug symbols (which are discarded @@ -831,7 +834,7 @@ Changes with APR 0.9.2 [Thom May] *) Add function apr_filepath_encoding and associated constants. - [Branko Cibej] + [Branko ÄŒibej] *) Allow apr_hash to have greater than int number of elements. [Justin Erenkrantz] diff --git a/STATUS b/STATUS index 9db685e7d42..55747d0eca1 100644 --- a/STATUS +++ b/STATUS @@ -1,4 +1,4 @@ -APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- +APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*- coding: utf-8 -*- Last modified at [$Date$] Releases: From 5b34d1387d0e5d25377e6e57d4cfb28d71940e33 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 27 Aug 2007 04:05:58 +0000 Subject: [PATCH 5917/7878] Set up svnmailer to utf-8 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@569982 13f79535-47bb-0310-9956-ffa450edef68 From ffed8c9ba443ade7b47215cb76e2f86aff693352 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 28 Aug 2007 01:23:59 +0000 Subject: [PATCH 5918/7878] apr_status_t code, not Win32 error code. PR: 43178 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@570289 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 36af7439641..a7260bdb2f3 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -133,7 +133,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, apr_file_close(f); } - if (hMap && err == ERROR_ALREADY_EXISTS) { + if (hMap && APR_STATUS_IS_EEXIST(err)) { CloseHandle(hMap); return APR_EEXIST; } From 4503311ff26c10a8655f2b45aaff5eb2f358b7fe Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 28 Aug 2007 02:21:00 +0000 Subject: [PATCH 5919/7878] Note the change to utf8 encoding git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@570293 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c2dab518e2f..1790928fd8c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 1.3.0 - *) Define the Mac OS/X filesystem_. [Branko ÄŒibej] + *) Define the Mac OS/X filesystem_encoding as utf-8 (in previous + releases the interpretation would vary). [Branko ÄŒibej] *) Add table cloning (deep copy) convenience function. [Davi Arnaut] From be2ac545fe7c49bd9b83e36abc4e7eaf13152473 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 28 Aug 2007 04:42:32 +0000 Subject: [PATCH 5920/7878] Note this (substantial) behavior change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@570302 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 1790928fd8c..b0bac1cece8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,12 @@ -*- coding: utf-8 -*- Changes for APR 1.3.0 + *) Solve winNT inherited pipe leaks by mutexing apr_proc_create calls, + on WinNT (not WinCE, nor 9x) so that we toggle the inherited state + of the stdin/out/err pipes. All other file handles are treated as + not-inherited until apr_file_dup2'ed a std handle of this process, + or while they are used by apr_proc_create. [William Rowe] + *) Define the Mac OS/X filesystem_encoding as utf-8 (in previous releases the interpretation would vary). [Branko ÄŒibej] From 8a2fbac9be47f4f665090f6c27dcfa9afb9d2991 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 1 Sep 2007 06:23:18 +0000 Subject: [PATCH 5921/7878] Fix r569890 - this error did not hit 1.2 or 0.9 branches, thankfully. Submitted by: Steven Narin git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@571712 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 01884bd4afb..c47c40ab4f8 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -767,7 +767,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, /* LOCK CRITICAL SECTION * before we begin to manipulate the inherited handles */ - LeaveCriticalSection(&proc_lock); + EnterCriticalSection(&proc_lock); if ((attr->child_in && attr->child_in->filehand) || (attr->child_out && attr->child_out->filehand) @@ -872,7 +872,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, /* RELEASE CRITICAL SECTION * The state of the inherited handles has been restored. */ - EnterCriticalSection(&proc_lock); + LeaveCriticalSection(&proc_lock); #else /* defined(_WIN32_WCE) */ rv = CreateProcessW(wprg, wcmd, /* Executable & Command line */ From eaa83acd5aa74d17c42492fbda7c7b77ffddef10 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 1 Sep 2007 07:26:19 +0000 Subject: [PATCH 5922/7878] Correctly handle completion-based read-to-EOF case. Resolves testfile, still have testpipe and testproc to contend with. Submitted by: Steven Naim git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@571728 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 2481afbfc7d..0a8af6b2090 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -122,6 +122,9 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) { /* Assume ERROR_BROKEN_PIPE signals an EOF reading from a pipe */ rv = APR_EOF; + } else if (rv == APR_FROM_OS_ERROR(ERROR_HANDLE_EOF)) { + /* Did we hit EOF reading from the handle? */ + rv = APR_EOF; } } From 260ed0d31002a1cd61f4c6c175f5978ac6e0117f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 3 Sep 2007 23:57:51 +0000 Subject: [PATCH 5923/7878] Fix the condvar trunk/test. Nothing equivilant in 1.2/0.9, so nothing to backport. Quiets nasty double->int truncation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@572455 13f79535-47bb-0310-9956-ffa450edef68 --- test/testcond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testcond.c b/test/testcond.c index cab7916dde2..0b208690204 100644 --- a/test/testcond.c +++ b/test/testcond.c @@ -425,7 +425,7 @@ static void pipe_producer_consumer(abts_case *tc, void *data) apr_thread_cond_t *cond = NULL; apr_thread_mutex_t *mutex = NULL; apr_file_t *in = NULL, *out = NULL; - apr_uint32_t i, ncons = (NTHREADS * 0.70); + apr_uint32_t i, ncons = (apr_uint32_t)(NTHREADS * 0.70); rv = apr_file_pipe_create(&in, &out, p); ABTS_SUCCESS(rv); From 71426e44937b17f7737fdbe8e4d457f58ac9e4b3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 4 Sep 2007 00:11:24 +0000 Subject: [PATCH 5924/7878] Fix cut and paste typo which scuttled the last release, this caused StdOutput to never be inherited (something not noticed, nor particularly interesting in httpd, which is how I missed it). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@572457 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index c47c40ab4f8..d9c318ef172 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -799,8 +799,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, HANDLE_FLAG_INHERIT, 0); si.hStdOutput = attr->child_out->filehand; - SetHandleInformation(si.hStdInput, HANDLE_FLAG_INHERIT, - HANDLE_FLAG_INHERIT); + SetHandleInformation(si.hStdOutput, HANDLE_FLAG_INHERIT, + HANDLE_FLAG_INHERIT); } si.hStdError = GetStdHandle(STD_ERROR_HANDLE); From 911473f192eb52addba2fd2ea70e1f150c52f9ec Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Tue, 4 Sep 2007 09:42:17 +0000 Subject: [PATCH 5925/7878] This message no verb. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@572593 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index e7c2a2ec2d5..99a81351d31 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -125,7 +125,7 @@ static char *apr_error_string(apr_status_t statcode) case APR_EABOVEROOT: return "The given path was above the root path"; case APR_EBADPATH: - return "The given path misformatted or contained invalid characters"; + return "The given path is misformatted or contained invalid characters"; case APR_EPATHWILD: return "The given path contained wildcard characters"; case APR_EPROC_UNKNOWN: From d3ceb0cebfdda119415bee5cdbbe2423adf44834 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 5 Sep 2007 20:12:33 +0000 Subject: [PATCH 5926/7878] Note an API changing facility - sparse files must be explicitly opened/created on Win32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@573044 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/STATUS b/STATUS index 55747d0eca1..439344ea3b7 100644 --- a/STATUS +++ b/STATUS @@ -84,6 +84,10 @@ CURRENT test/testall -v EXCEPTIONS: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * "testlfs: Line 32: Large Files tests require Sparse file support" + In order to portably implement LFS-Sparse files, we would have + to actually flag that upon create (open), to be portable to win32. + * Someone needs to port testucs to Unix. Right now it only works on Windows. OtherBill asks; should we have a test/arch/xxx tree? From c51cd009ccf8b068de5489f84bd6fa1f498505a2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 5 Sep 2007 20:16:37 +0000 Subject: [PATCH 5927/7878] Another API changing feature prerequesite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@573045 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/STATUS b/STATUS index 439344ea3b7..b371175b2f9 100644 --- a/STATUS +++ b/STATUS @@ -84,6 +84,15 @@ CURRENT test/testall -v EXCEPTIONS: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * testpipe: Line 69: expected <0>, but saw <22> + Line 92: expected <0>, but saw <22> + In order to use apr_file_pipe_timeout_set on Win32 we need to + create that end of the pipe as nonblocking; currently win32 + has assumed blocking pipes on apr_file_pipe_create. Inverting + this assumption would break stdhandles, the most common use case. + We must add a flag to set the reader/writer end to explicitly + blocking or nonblocking, and the choice isn't volatile. + * "testlfs: Line 32: Large Files tests require Sparse file support" In order to portably implement LFS-Sparse files, we would have to actually flag that upon create (open), to be portable to win32. From 76674d45cf1a9907677472131bdd4ec6ce4c3cda Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Fri, 7 Sep 2007 07:25:23 +0000 Subject: [PATCH 5928/7878] Code style only. Forward port struct initialization from rev 573481 of apr-0.9.x. The warning was already fixed on trunk. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@573491 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/inet_ntop.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index a96eb18f7a6..78dd3baae53 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -147,7 +147,7 @@ inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) * to use pointer overlays. All the world's not a VAX. */ char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp; - struct { int base, len; } best, cur; + struct { int base, len; } best = {-1, 0}, cur = {-1, 0}; unsigned int words[IN6ADDRSZ / INT16SZ]; int i; const unsigned char *next_src, *src_end; @@ -161,9 +161,6 @@ inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) next_src = src; src_end = src + IN6ADDRSZ; next_dest = words; - best.base = -1; - cur.base = -1; - cur.len = best.len = 0; /* silence gcc4 warning */ i = 0; do { unsigned int next_word = (unsigned int)*next_src++; From 52139eebaff907be6292a4a781ebd45790f53655 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 7 Sep 2007 20:12:49 +0000 Subject: [PATCH 5929/7878] Strip out the /machine from link.exe, in this day and age each CPU gets it's own link.exe in it's own path, e.g. you need to set up the path for amd64 and you will get that cl compiler, and that linker. Although I had already stripped /machine from the .pdb's, the silly export put one back. Axe it for good when touching up our .mak files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@573688 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl index 2c7b7d2a2b3..b559eeccfe1 100644 --- a/build/fixwin32mak.pl +++ b/build/fixwin32mak.pl @@ -86,6 +86,15 @@ sub fixcwd { $verchg = -1; undef $orig; } + # With modern LINK.EXE linkers, there is a different LINK for + # each platform, and it's determined by the file path. Best + # that here, after we compiled the code to the default CPU, + # that we also link here to the default CPU. Omitting the + # /machine spec from the .dsp was not enough, MSVC put it back. + # + if ($src =~ s#^(LINK32_FLAGS=.*) /machine:(x|IX|I3)86 #$1 #) { + $verchg = -1; + } print $dstfl $src; } undef $srcfl; From 4ccbdbb1bb28ddbc8efb04273e47c824d3e4aa51 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Mon, 10 Sep 2007 01:17:48 +0000 Subject: [PATCH 5930/7878] Any test returning non-zero should stop make git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@574113 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 99cc564e996..64d844de2e8 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -47,11 +47,13 @@ LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) @LT_NO_IN check: $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \ ./$$prog; \ - if test $$? = 255; then \ + status=$$?; \ + if test $$status != 0; then \ echo "$$prog failed"; \ break; \ fi; \ - done + done; \ + exit $$status occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS) $(LINK_PROG) occhild.lo $(LOCAL_LIBS) $(ALL_LIBS) From 4ced16de3d9e04e353469bea2ca730873c72befe Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Mon, 10 Sep 2007 05:32:35 +0000 Subject: [PATCH 5931/7878] Run all tests, then fail make if required git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@574134 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 64d844de2e8..20d3485bcc1 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -45,15 +45,20 @@ INCLUDES=-I$(INCDIR) -I$(srcdir)/../include LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@ check: $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) + teststatus=0; \ + progfailed=""; \ for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \ ./$$prog; \ status=$$?; \ if test $$status != 0; then \ - echo "$$prog failed"; \ - break; \ + teststatus=$$status; \ + progfailed="$$progfailed $$prog"; \ fi; \ done; \ - exit $$status + if test $$teststatus != 0; then \ + echo "Programs failed:$$progfailed"; \ + fi; \ + exit $$teststatus occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS) $(LINK_PROG) occhild.lo $(LOCAL_LIBS) $(ALL_LIBS) From 4bd69d2651dd12f365b5c5309996661c696308ec Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Thu, 13 Sep 2007 05:04:03 +0000 Subject: [PATCH 5932/7878] Update STATUS to match recent releases git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@575166 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index b371175b2f9..724fe258ce9 100644 --- a/STATUS +++ b/STATUS @@ -3,7 +3,9 @@ Last modified at [$Date$] Releases: 1.3.0 : in development - 1.2.10 : in maintenance + 1.2.12 : in maintenance + 1.2.11 : released September 6, 2007 + 1.2.10 : not released 1.2.9 : tagged June 4, 2007 1.2.8 : released December 4, 2006 1.2.7 : released April 14, 2006 @@ -19,7 +21,9 @@ Releases: 1.1.0 : released January 25, 2005 1.0.1 : released November 19, 2004 1.0.0 : released September 1, 2004 - 0.9.15 : in maintenance + 0.9.17 : in maintenance + 0.9.16 : released September 6, 2007 + 0.9.15 : not released 0.9.14 : tagged June 4, 2007 0.9.13 : released December 4, 2006 0.9.12 : released April 13, 2006 From a6a92370a2c1b3d89785c8b49d2052e34ebecee1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 25 Sep 2007 14:38:00 +0000 Subject: [PATCH 5933/7878] * configure.in, Makefile.in: Define the libtool versioning hint in the Makefile rather than hard-coding in the (shared) apr_rules.mk. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@579264 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 ++ configure.in | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 4b16d56a51a..f43eab070f6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -38,6 +38,8 @@ INSTALL_DATA = @INSTALL_DATA@ # TARGETS = $(TARGET_LIB) apr.exp apr-config.out build/apr_rules.out +LT_VERSION = @LT_VERSION@ + # bring in rules.mk for standard functionality @INCLUDE_RULES@ @INCLUDE_OUTPUTS@ diff --git a/configure.in b/configure.in index c1059bdf1e0..a13e8ee54a1 100644 --- a/configure.in +++ b/configure.in @@ -199,7 +199,7 @@ AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the if test "x$use_libtool" = "xyes"; then lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -o $@ -c $< && touch $@' LT_VERSION="-version-info `$get_version libtool $version_hdr APR`" - link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) ${LT_VERSION} \$(ALL_LDFLAGS) -o \$@" + link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) \$(LT_VERSION) \$(ALL_LDFLAGS) -o \$@" so_ext='lo' lib_target='-rpath $(libdir) $(OBJECTS)' export_lib_target='-rpath \$(libdir) \$(OBJECTS)' @@ -227,6 +227,7 @@ AC_SUBST(export_lib_target) AC_SUBST(shlibpath_var) AC_SUBST(LTFLAGS) AC_SUBST(LT_LDFLAGS) +AC_SUBST(LT_VERSION) dnl ----------------------------- Checks for compiler flags nl=' From 14b5ece4ac42332b0c84f995c0de7d76a9dc7297 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Sep 2007 20:57:11 +0000 Subject: [PATCH 5934/7878] Introduce APR_NO_FILE as an option for any of the three stdio streams to cause the specified streams to be closed to the child process, when the caller has chosen that flag via apr_procattr_io_set(). This is the nonportable flavor targeting 1.2.12; unix 1.3.0 specific commit to follow. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@580484 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +- file_io/win32/filedup.c | 110 +++++++++++++++++++------- file_io/win32/open.c | 39 +++------ include/apr_thread_proc.h | 9 +++ include/arch/win32/apr_arch_file_io.h | 6 +- threadproc/win32/proc.c | 66 ++++++++++------ 6 files changed, 159 insertions(+), 78 deletions(-) diff --git a/CHANGES b/CHANGES index b0bac1cece8..02e9b359b95 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ - -*- coding: utf-8 -*- + -*- coding: utf-8 -*- Changes for APR 1.3.0 + *) Introduce APR_NO_FILE as an option for any of the three stdio streams + to cause the specified streams to be closed to the child process, + when the caller has chosen that flag via apr_procattr_io_set(). + [William Rowe] + *) Solve winNT inherited pipe leaks by mutexing apr_proc_create calls, on WinNT (not WinCE, nor 9x) so that we toggle the inherited state of the stdin/out/err pipes. All other file handles are treated as diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 964ec680c45..70ed4379d56 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -20,6 +20,8 @@ #include "apr_strings.h" #include #include "apr_arch_inherit.h" +#include /* for [_open/_get]_osfhandle */ + APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) @@ -63,10 +65,6 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, #endif /* !defined(_WIN32_WCE) */ } -#define stdin_handle 0x01 -#define stdout_handle 0x02 -#define stderr_handle 0x04 - APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p) { @@ -77,32 +75,88 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, HANDLE hproc = GetCurrentProcess(); HANDLE newhand = NULL; apr_int32_t newflags; + int fd; + + if (new_file->flags & APR_STD_FLAGS) { + /* if (!DuplicateHandle(hproc, old_file->filehand, + * hproc, &newhand, 0, + * TRUE, DUPLICATE_SAME_ACCESS)) { + * return apr_get_os_error(); + * } + * if (((stdhandle & stderr_handle) && !SetStdHandle(STD_ERROR_HANDLE, newhand)) || + * ((stdhandle & stdout_handle) && !SetStdHandle(STD_OUTPUT_HANDLE, newhand)) || + * ((stdhandle & stdin_handle) && !SetStdHandle(STD_INPUT_HANDLE, newhand))) { + * return apr_get_os_error(); + * } + * newflags = old_file->flags | APR_INHERIT; + */ + + if ((new_file->flags & APR_STD_FLAGS) == APR_STDERR_FLAG) { + /* Flush stderr and unset its buffer, then commit the fd-based buffer. + * This is typically a noop for Win2K/XP since services with NULL std + * handles [but valid FILE *'s, oddly enough], but is required + * for NT 4.0 and to use this code outside of services. + */ + fflush(stderr); + setvbuf(stderr, NULL, _IONBF, 0); + _commit(2 /* stderr */); + + /* Clone a handle can _close() without harming the source handle, + * open an MSVCRT-based pseudo-fd for the file handle, then dup2 + * and close our temporary pseudo-fd once it's been duplicated. + * This will incidently keep the FILE-based stderr in sync. + * Note the apparently redundant _O_BINARY coersions are required. + */ + if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand, + 0, FALSE, DUPLICATE_SAME_ACCESS)) { + return apr_get_os_error(); + } + fd = _open_osfhandle((INT_PTR)newhand, _O_WRONLY | _O_BINARY); + _dup2(fd, 2); + _close(fd); + _setmode(2, _O_BINARY); + + /* hPipeWrite was _close()'ed above, and _dup2()'ed + * to fd 2 creating a new, inherited Win32 handle. + * Recover that real handle from fd 2. Note that + * SetStdHandle(STD_ERROR_HANDLE, _get_osfhandle(2)) + * is implicit in the dup2() call above + */ + newhand = (HANDLE)_get_osfhandle(2); + } - /* dup2 is not supported literaly with native Windows handles. - * We can, however, emulate dup2 for the standard i/o handles, - * and close and replace other handles with duped handles. - * The os_handle will change, however. - */ - if (new_file->filehand == GetStdHandle(STD_ERROR_HANDLE)) { - stdhandle |= stderr_handle; - } - if (new_file->filehand == GetStdHandle(STD_OUTPUT_HANDLE)) { - stdhandle |= stdout_handle; - } - if (new_file->filehand == GetStdHandle(STD_INPUT_HANDLE)) { - stdhandle |= stdin_handle; - } - - if (stdhandle) { - if (!DuplicateHandle(hproc, old_file->filehand, - hproc, &newhand, 0, - TRUE, DUPLICATE_SAME_ACCESS)) { - return apr_get_os_error(); + if ((new_file->flags & APR_STD_FLAGS) == APR_STDOUT_FLAG) { + /* For the process flow see the stderr case above */ + fflush(stdout); + setvbuf(stdout, NULL, _IONBF, 0); + _commit(1 /* stdout */); + + if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand, + 0, FALSE, DUPLICATE_SAME_ACCESS)) { + return apr_get_os_error(); + } + fd = _open_osfhandle((INT_PTR)newhand, _O_WRONLY | _O_BINARY); + _dup2(fd, 1); + _close(fd); + _setmode(1, _O_BINARY); + newhand = (HANDLE)_get_osfhandle(1); } - if (((stdhandle & stderr_handle) && !SetStdHandle(STD_ERROR_HANDLE, newhand)) || - ((stdhandle & stdout_handle) && !SetStdHandle(STD_OUTPUT_HANDLE, newhand)) || - ((stdhandle & stdin_handle) && !SetStdHandle(STD_INPUT_HANDLE, newhand))) { - return apr_get_os_error(); + + if ((new_file->flags & APR_STD_FLAGS) == APR_STDIN_FLAG) { + /* For the process flow see the stderr case above */ + fflush(stdin); + setvbuf(stdin, NULL, _IONBF, 0); + _commit(0 /* stdin */); + + if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand, + 0, FALSE, DUPLICATE_SAME_ACCESS)) { + return apr_get_os_error(); + } + fd = _open_osfhandle((INT_PTR)newhand, _O_RDONLY | _O_BINARY); + _dup2(fd, 0); + _close(fd); + _setmode(0, _O_BINARY); + newhand = (HANDLE)_get_osfhandle(0); } newflags = old_file->flags | APR_INHERIT; } diff --git a/file_io/win32/open.c b/file_io/win32/open.c index f81c9c80e54..0d8f88d1b12 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -550,8 +550,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, /* ### check return codes */ (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); - /* XXX... we pcalloc above so all others are zeroed. - * Should we be testing if thefile is a handle to + /* Should we be testing if thefile is a handle to * a PIPE and set up the mechanics appropriately? * * (*file)->pipe; @@ -578,15 +577,11 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, apr_set_os_error(APR_SUCCESS); file_handle = GetStdHandle(STD_ERROR_HANDLE); - if (!file_handle || (file_handle == INVALID_HANDLE_VALUE)) { - apr_status_t rv = apr_get_os_error(); - if (rv == APR_SUCCESS) { - return APR_EINVAL; - } - return rv; - } + if (!file_handle) + file_handle = INVALID_HANDLE_VALUE; - return apr_os_file_put(thefile, &file_handle, flags | APR_WRITE, pool); + return apr_os_file_put(thefile, &file_handle, + flags | APR_WRITE | APR_STDERR_FLAG, pool); #endif } @@ -601,15 +596,11 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, apr_set_os_error(APR_SUCCESS); file_handle = GetStdHandle(STD_OUTPUT_HANDLE); - if (!file_handle || (file_handle == INVALID_HANDLE_VALUE)) { - apr_status_t rv = apr_get_os_error(); - if (rv == APR_SUCCESS) { - return APR_EINVAL; - } - return rv; - } + if (!file_handle) + file_handle = INVALID_HANDLE_VALUE; - return apr_os_file_put(thefile, &file_handle, flags | APR_WRITE, pool); + return apr_os_file_put(thefile, &file_handle, + flags | APR_WRITE | APR_STDOUT_FLAG, pool); #endif } @@ -624,15 +615,11 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, apr_set_os_error(APR_SUCCESS); file_handle = GetStdHandle(STD_INPUT_HANDLE); - if (!file_handle || (file_handle == INVALID_HANDLE_VALUE)) { - apr_status_t rv = apr_get_os_error(); - if (rv == APR_SUCCESS) { - return APR_EINVAL; - } - return rv; - } + if (!file_handle) + file_handle = INVALID_HANDLE_VALUE; - return apr_os_file_put(thefile, &file_handle, flags | APR_READ, pool); + return apr_os_file_put(thefile, &file_handle, + flags | APR_READ | APR_STDIN_FLAG, pool); #endif } diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index c7930901b2f..5cdb59d427f 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -87,6 +87,15 @@ typedef enum { /** @see apr_procattr_io_set */ #define APR_CHILD_BLOCK 4 +/** @see apr_procattr_io_set + * @note introduced strictly for Win32 to apr revision 1.2.12 (to restore + * the non-portable default behavior of 1.2.9 and prior versions on Win32). + * This becomes portable to all platforms effective revision 1.3.0, ensuring + * the standard files specified in the call to apr_procattr_io_set are not + * open in the created process (on Win32 as INVALID_HANDLE_VALUEs). + */ +#define APR_NO_FILE 8 + /** @see apr_procattr_limit_set */ #define APR_LIMIT_CPU 0 /** @see apr_procattr_limit_set */ diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index a0b4391f88a..6807546bf75 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -99,8 +99,12 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool); #define APR_OPENINFO 0x00100000 /* Open without READ or WRITE access */ #define APR_OPENLINK 0x00200000 /* Open a link itself, if supported */ #define APR_READCONTROL 0x00400000 /* Read the file's owner/perms */ -#define APR_WRITECONTROL 0x00800000 /* Modifythe file's owner/perms */ +#define APR_WRITECONTROL 0x00800000 /* Modify the file's owner/perms */ #define APR_WRITEATTRS 0x01000000 /* Modify the file's attributes */ +#define APR_STDIN_FLAG 0x02000000 /* Obtained via apr_file_open_stdin() */ +#define APR_STDOUT_FLAG 0x04000000 /* Obtained via apr_file_open_stdout() */ +#define APR_STDERR_FLAG 0x06000000 /* Obtained via apr_file_open_stderr() */ +#define APR_STD_FLAGS (APR_STDIN_FLAG | APR_STDOUT_FLAG | APR_STDERR_FLAG) /* Entries missing from the MSVC 5.0 Win32 SDK: */ diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index d9c318ef172..c7f2408e975 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -32,6 +32,15 @@ #include #endif +/* Heavy on no'ops, here's what we want to pass if there is APR_NO_FILE + * requested for a specific child handle; + */ +static apr_file_t no_file = { NULL, INVALID_HANDLE_VALUE, }; + +/* We have very carefully excluded volumes of definitions from the + * Microsoft Platform SDK, which kill the build time performance. + * These the sole constants we borrow from WinBase.h and WinUser.h + */ #ifndef LOGON32_LOGON_NETWORK #define LOGON32_LOGON_NETWORK 3 #endif @@ -50,12 +59,12 @@ #define SW_HIDE 0 #endif #endif + /* * some of the ideas expressed herein are based off of Microsoft * Knowledge Base article: Q190351 * */ - APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *pool) { @@ -83,20 +92,30 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, in = APR_READ_BLOCK; else if (in == APR_PARENT_BLOCK) in = APR_WRITE_BLOCK; - stat = apr_create_nt_pipe(&attr->child_in, &attr->parent_in, in, - attr->pool); + + if (in == APR_NO_FILE) + attr->child_in = &no_file; + else + stat = apr_create_nt_pipe(&attr->child_in, &attr->parent_in, + in, attr->pool); if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_in); } if (out && stat == APR_SUCCESS) { - stat = apr_create_nt_pipe(&attr->parent_out, &attr->child_out, out, - attr->pool); + if (out == APR_NO_FILE) + attr->child_out = &no_file; + else + stat = apr_create_nt_pipe(&attr->parent_out, &attr->child_out, + out, attr->pool); if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_out); } if (err && stat == APR_SUCCESS) { - stat = apr_create_nt_pipe(&attr->parent_err, &attr->child_err, err, - attr->pool); + if (err == APR_NO_FILE) + attr->child_err = &no_file; + else + stat = apr_create_nt_pipe(&attr->parent_err, &attr->child_err, + err, attr->pool); if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_err); } @@ -110,7 +129,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_status_t rv = APR_SUCCESS; if (child_in) { - if (attr->child_in == NULL) + if ((attr->child_in == NULL) || (attr->child_in == &no_file)) rv = apr_file_dup(&attr->child_in, child_in, attr->pool); else rv = apr_file_dup2(attr->child_in, child_in, attr->pool); @@ -136,7 +155,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_status_t rv = APR_SUCCESS; if (child_out) { - if (attr->child_out == NULL) + if ((attr->child_out == NULL) || (attr->child_out == &no_file)) rv = apr_file_dup(&attr->child_out, child_out, attr->pool); else rv = apr_file_dup2(attr->child_out, child_out, attr->pool); @@ -162,7 +181,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_status_t rv = APR_SUCCESS; if (child_err) { - if (attr->child_err == NULL) + if ((attr->child_err == NULL) || (attr->child_err == &no_file)) rv = apr_file_dup(&attr->child_err, child_err, attr->pool); else rv = apr_file_dup2(attr->child_err, child_err, attr->pool); @@ -784,9 +803,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, SetHandleInformation(si.hStdInput, HANDLE_FLAG_INHERIT, 0); - si.hStdInput = attr->child_in->filehand; - SetHandleInformation(si.hStdInput, HANDLE_FLAG_INHERIT, - HANDLE_FLAG_INHERIT); + if ( (si.hStdInput = attr->child_in->filehand) + != INVALID_HANDLE_VALUE ) + SetHandleInformation(si.hStdInput, HANDLE_FLAG_INHERIT, + HANDLE_FLAG_INHERIT); } si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); @@ -798,9 +818,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, SetHandleInformation(si.hStdOutput, HANDLE_FLAG_INHERIT, 0); - si.hStdOutput = attr->child_out->filehand; - SetHandleInformation(si.hStdOutput, HANDLE_FLAG_INHERIT, - HANDLE_FLAG_INHERIT); + if ( (si.hStdOutput = attr->child_out->filehand) + != INVALID_HANDLE_VALUE ) + SetHandleInformation(si.hStdOutput, HANDLE_FLAG_INHERIT, + HANDLE_FLAG_INHERIT); } si.hStdError = GetStdHandle(STD_ERROR_HANDLE); @@ -812,9 +833,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, SetHandleInformation(si.hStdError, HANDLE_FLAG_INHERIT, 0); - si.hStdError = attr->child_err->filehand; - SetHandleInformation(si.hStdError, HANDLE_FLAG_INHERIT, - HANDLE_FLAG_INHERIT); + if ( (si.hStdError = attr->child_err->filehand) + != INVALID_HANDLE_VALUE ) + SetHandleInformation(si.hStdError, HANDLE_FLAG_INHERIT, + HANDLE_FLAG_INHERIT); } } if (attr->user_token) { @@ -937,13 +959,13 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, new->hproc = pi.hProcess; new->pid = pi.dwProcessId; - if (attr->child_in) { + if ((attr->child_in) && (attr->child_in != &no_file)) { apr_file_close(attr->child_in); } - if (attr->child_out) { + if ((attr->child_out) && (attr->child_out != &no_file)) { apr_file_close(attr->child_out); } - if (attr->child_err) { + if ((attr->child_err) && (attr->child_err != &no_file)) { apr_file_close(attr->child_err); } CloseHandle(pi.hThread); From 06280124680931bf84055f5f30962a6b7fc5e76a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Sep 2007 21:04:47 +0000 Subject: [PATCH 5935/7878] Introduce APR_NO_FILE as an option for any of the three stdio streams to cause the specified streams to be closed to the child process, when the caller has chosen that flag via apr_procattr_io_set(). ALSO; solve a serious flaw where we attempted to dup2 to a non existant file if the user had not already called apr_procattr_io_set()! The Unix implementation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@580486 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 11 ++--- threadproc/unix/proc.c | 89 ++++++++++++++++++++++++++++++--------- 2 files changed, 74 insertions(+), 26 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 5cdb59d427f..f6f3c76dac0 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -88,11 +88,7 @@ typedef enum { #define APR_CHILD_BLOCK 4 /** @see apr_procattr_io_set - * @note introduced strictly for Win32 to apr revision 1.2.12 (to restore - * the non-portable default behavior of 1.2.9 and prior versions on Win32). - * This becomes portable to all platforms effective revision 1.3.0, ensuring - * the standard files specified in the call to apr_procattr_io_set are not - * open in the created process (on Win32 as INVALID_HANDLE_VALUEs). + * @note Win32 only effective with version 1.2.12, portably introduced in 1.3.0 */ #define APR_NO_FILE 8 @@ -401,6 +397,11 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new_attr, * @param in Should stdin be a pipe back to the parent? * @param out Should stdout be a pipe back to the parent? * @param err Should stderr be a pipe back to the parent? + * @note If APR_NO_PIPE, there will be no special channel, the child + * inherit's the parent's stdio stream. If APR_NO_FILE is specified, + * that stdio stream is closed in the child (and will be INVALID_HANDLE_VALUE + * if inspected on Win32); warning this can have the ugly side effect + * that the next file opened may fall into the stdio stream role on Unix. */ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 0b9c8b97b87..624a78c4441 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -20,6 +20,11 @@ #include "apr_signal.h" #include "apr_random.h" +/* Heavy on no'ops, here's what we want to pass if there is APR_NO_FILE + * requested for a specific child handle; + */ +static apr_file_t no_file = { NULL, -1, }; + APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *pool) { @@ -40,7 +45,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t err) { apr_status_t status; - if (in != 0) { + if ((in != APR_NO_PIPE) && (in != APR_NO_FILE)) { if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool)) != APR_SUCCESS) { return status; @@ -60,8 +65,11 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_file_pipe_timeout_set(attr->parent_in, 0); } } + else if (in == APR_NO_FILE) { + attr->child_in = &no_file; + } - if (out) { + if ((out != APR_NO_PIPE) && (out != APR_NO_FILE)) { if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, attr->pool)) != APR_SUCCESS) { return status; @@ -81,8 +89,11 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_file_pipe_timeout_set(attr->parent_out, 0); } } + else if (out == APR_NO_FILE) { + attr->child_out = &no_file; + } - if (err) { + if ((err != APR_NO_PIPE) && (err != APR_NO_FILE)) { if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, attr->pool)) != APR_SUCCESS) { return status; @@ -102,6 +113,9 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_file_pipe_timeout_set(attr->parent_err, 0); } } + else if (err == APR_NO_FILE) { + attr->child_err = &no_file; + } return APR_SUCCESS; } @@ -116,11 +130,19 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, if (attr->child_in == NULL && attr->parent_in == NULL) rv = apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); - if (child_in != NULL && rv == APR_SUCCESS) - rv = apr_file_dup2(attr->child_in, child_in, attr->pool); + if (child_in != NULL && rv == APR_SUCCESS) { + if (!attr->child_in || attr->child_in->filedes == -1) + rv = apr_file_dup(&attr->child_in, child_in, attr->pool); + else + rv = apr_file_dup2(attr->child_in, child_in, attr->pool); + } - if (parent_in != NULL && rv == APR_SUCCESS) - rv = apr_file_dup2(attr->parent_in, parent_in, attr->pool); + if (parent_in != NULL && rv == APR_SUCCESS) { + if (!attr->parent_in || attr->parent_in->filedes == -1) + rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool); + else + rv = apr_file_dup2(attr->parent_in, parent_in, attr->pool); + } return rv; } @@ -135,11 +157,19 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, if (attr->child_out == NULL && attr->parent_out == NULL) rv = apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); - if (child_out != NULL && rv == APR_SUCCESS) - rv = apr_file_dup2(attr->child_out, child_out, attr->pool); + if (child_out != NULL && rv == APR_SUCCESS) { + if (!attr->child_out || attr->child_out->filedes == -1) + rv = apr_file_dup(&attr->child_out, child_out, attr->pool); + else + rv = apr_file_dup2(attr->child_out, child_out, attr->pool); + } - if (parent_out != NULL && rv == APR_SUCCESS) - rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool); + if (parent_out != NULL && rv == APR_SUCCESS) { + if (!attr->parent_out || attr->parent_out->filedes == -1) + rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool); + else + rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool); + } return rv; } @@ -154,11 +184,19 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, if (attr->child_err == NULL && attr->parent_err == NULL) rv = apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); - if (child_err != NULL && rv == APR_SUCCESS) - rv = apr_file_dup2(attr->child_err, child_err, attr->pool); + if (child_out != NULL && rv == APR_SUCCESS) { + if (!attr->child_out || attr->child_out->filedes == -1) + rv = apr_file_dup(&attr->child_out, child_out, attr->pool); + else + rv = apr_file_dup2(attr->child_out, child_out, attr->pool); + } - if (parent_err != NULL && rv == APR_SUCCESS) - rv = apr_file_dup2(attr->parent_err, parent_err, attr->pool); + if (parent_out != NULL && rv == APR_SUCCESS) { + if (!attr->parent_out || attr->parent_out->filedes == -1) + rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool); + else + rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool); + } return rv; } @@ -402,19 +440,28 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_pool_cleanup_for_exec(); - if (attr->child_in) { + if ((attr->child_in) && (attr->child_in->filedes == -1) { + close(STDIN_FILENO); + } + else if (attr->child_in) { apr_file_close(attr->parent_in); dup2(attr->child_in->filedes, STDIN_FILENO); apr_file_close(attr->child_in); } - if (attr->child_out) { + if ((attr->child_out) && (attr->child_out->filedes == -1) { + close(STDOUT_FILENO); + } + else if (attr->child_out) { apr_file_close(attr->parent_out); dup2(attr->child_out->filedes, STDOUT_FILENO); apr_file_close(attr->child_out); } - if (attr->child_err) { + if ((attr->child_err) && (attr->child_err->filedes == -1) { + close(STDERR_FILENO); + } + else if (attr->child_err) { apr_file_close(attr->parent_err); dup2(attr->child_err->filedes, STDERR_FILENO); apr_file_close(attr->child_err); @@ -551,15 +598,15 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } /* Parent process */ - if (attr->child_in) { + if ((attr->child_in && (attr->child_in->filedes == -1)) { apr_file_close(attr->child_in); } - if (attr->child_out) { + if ((attr->child_out) && (attr->child_out->filedes == -1) { apr_file_close(attr->child_out); } - if (attr->child_err) { + if ((attr->child_err) && (attr->child_err->filedes == -1) { apr_file_close(attr->child_err); } From 27e8f965ed1c14e020a5b24cdb2db3a699495d53 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Sep 2007 23:21:46 +0000 Subject: [PATCH 5936/7878] Undo the 'fix' to the unix flaw. Yes, there still are flaws; if we use apr_procattr_stderr_set() it will not close out the previous handle parked there by _io_set(). But it also does not attempt to touch the _io_set() no_file STATIC apr_file_t's so there is nothing to otherwise fix here immediately. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@580515 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 48 +++++++++++------------------------------- 1 file changed, 12 insertions(+), 36 deletions(-) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 624a78c4441..cbfe79db5e7 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -130,19 +130,11 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, if (attr->child_in == NULL && attr->parent_in == NULL) rv = apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); - if (child_in != NULL && rv == APR_SUCCESS) { - if (!attr->child_in || attr->child_in->filedes == -1) - rv = apr_file_dup(&attr->child_in, child_in, attr->pool); - else - rv = apr_file_dup2(attr->child_in, child_in, attr->pool); - } + if (child_in != NULL && rv == APR_SUCCESS) + rv = apr_file_dup2(attr->child_in, child_in, attr->pool); - if (parent_in != NULL && rv == APR_SUCCESS) { - if (!attr->parent_in || attr->parent_in->filedes == -1) - rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool); - else - rv = apr_file_dup2(attr->parent_in, parent_in, attr->pool); - } + if (parent_in != NULL && rv == APR_SUCCESS) + rv = apr_file_dup2(attr->parent_in, parent_in, attr->pool); return rv; } @@ -157,19 +149,11 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, if (attr->child_out == NULL && attr->parent_out == NULL) rv = apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); - if (child_out != NULL && rv == APR_SUCCESS) { - if (!attr->child_out || attr->child_out->filedes == -1) - rv = apr_file_dup(&attr->child_out, child_out, attr->pool); - else - rv = apr_file_dup2(attr->child_out, child_out, attr->pool); - } + if (child_out != NULL && rv == APR_SUCCESS) + rv = apr_file_dup2(attr->child_out, child_out, attr->pool); - if (parent_out != NULL && rv == APR_SUCCESS) { - if (!attr->parent_out || attr->parent_out->filedes == -1) - rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool); - else - rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool); - } + if (parent_out != NULL && rv == APR_SUCCESS) + rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool); return rv; } @@ -184,19 +168,11 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, if (attr->child_err == NULL && attr->parent_err == NULL) rv = apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); - if (child_out != NULL && rv == APR_SUCCESS) { - if (!attr->child_out || attr->child_out->filedes == -1) - rv = apr_file_dup(&attr->child_out, child_out, attr->pool); - else - rv = apr_file_dup2(attr->child_out, child_out, attr->pool); - } + if (child_err != NULL && rv == APR_SUCCESS) + rv = apr_file_dup2(attr->child_err, child_err, attr->pool); - if (parent_out != NULL && rv == APR_SUCCESS) { - if (!attr->parent_out || attr->parent_out->filedes == -1) - rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool); - else - rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool); - } + if (parent_err != NULL && rv == APR_SUCCESS) + rv = apr_file_dup2(attr->parent_err, parent_err, attr->pool); return rv; } From 2137ed27cc053f596f63387757dc8780af0da64d Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 29 Sep 2007 15:03:03 +0000 Subject: [PATCH 5937/7878] Fix compile errors introduced in r580486 due to missing ()s. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@580591 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index cbfe79db5e7..de79fafcae0 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -416,7 +416,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_pool_cleanup_for_exec(); - if ((attr->child_in) && (attr->child_in->filedes == -1) { + if ((attr->child_in) && (attr->child_in->filedes == -1)) { close(STDIN_FILENO); } else if (attr->child_in) { @@ -425,7 +425,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_file_close(attr->child_in); } - if ((attr->child_out) && (attr->child_out->filedes == -1) { + if ((attr->child_out) && (attr->child_out->filedes == -1)) { close(STDOUT_FILENO); } else if (attr->child_out) { @@ -434,7 +434,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_file_close(attr->child_out); } - if ((attr->child_err) && (attr->child_err->filedes == -1) { + if ((attr->child_err) && (attr->child_err->filedes == -1)) { close(STDERR_FILENO); } else if (attr->child_err) { @@ -574,15 +574,15 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } /* Parent process */ - if ((attr->child_in && (attr->child_in->filedes == -1)) { + if ((attr->child_in && (attr->child_in->filedes == -1))) { apr_file_close(attr->child_in); } - if ((attr->child_out) && (attr->child_out->filedes == -1) { + if ((attr->child_out) && (attr->child_out->filedes == -1)) { apr_file_close(attr->child_out); } - if ((attr->child_err) && (attr->child_err->filedes == -1) { + if ((attr->child_err) && (attr->child_err->filedes == -1)) { apr_file_close(attr->child_err); } From 19f3628002465cc123a81f5521d6537cc094d2ea Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 29 Sep 2007 19:56:47 +0000 Subject: [PATCH 5938/7878] Thanks for catching the unbalanced parens, jerenkrantz. These can be reduced further and still remain legible. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@580632 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index de79fafcae0..1dfa0fb159e 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -574,15 +574,15 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } /* Parent process */ - if ((attr->child_in && (attr->child_in->filedes == -1))) { + if (attr->child_in && (attr->child_in->filedes == -1)) { apr_file_close(attr->child_in); } - if ((attr->child_out) && (attr->child_out->filedes == -1)) { + if (attr->child_out && (attr->child_out->filedes == -1)) { apr_file_close(attr->child_out); } - if ((attr->child_err) && (attr->child_err->filedes == -1)) { + if (attr->child_err && (attr->child_err->filedes == -1)) { apr_file_close(attr->child_err); } From 5ab30661552c7cf2604ff6b80e70182309e907bc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 30 Sep 2007 00:15:21 +0000 Subject: [PATCH 5939/7878] In order to provide an easier VStudio .vcproj file transition replace most path occurances with $(IntDir)/$(OutDir) substitutions and rename LibNT[RD] directories to Lib[RD]NT directory names, ensuring NT is the suffix for dynamic and static builds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@580655 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 16 ++++++++-------- libapr.dsp | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/apr.dsp b/apr.dsp index fa6cda684ab..07f456339a6 100644 --- a/apr.dsp +++ b/apr.dsp @@ -86,11 +86,11 @@ LIB32=link.exe -lib # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "LibNTR" -# PROP Intermediate_Dir "LibNTR" +# PROP Output_Dir "LibRNT" +# PROP Intermediate_Dir "LibRNT" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"LibNTR\apr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(IntDir)\apr_src" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -98,7 +98,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"LibNTR\apr-1.lib" +# ADD LIB32 /nologo /out:"$(OutDir)\apr-1.lib" !ELSEIF "$(CFG)" == "apr - Win32 DebugNT" @@ -109,12 +109,12 @@ LIB32=link.exe -lib # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "LibNTD" -# PROP Intermediate_Dir "LibNTD" +# PROP Output_Dir "LibDNT" +# PROP Intermediate_Dir "LibDNT" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"LibNTD\apr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(IntDir)\apr_src" /FD /EHsc /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -122,7 +122,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"LibNTD\apr-1.lib" +# ADD LIB32 /nologo /out:"$(OutDir)\apr-1.lib" !ENDIF diff --git a/libapr.dsp b/libapr.dsp index cb12e13238e..1b39d76e197 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -55,9 +55,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\Release\libapr-1.dll" /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OutDir)\libapr-1.dll" /opt:ref # Begin Special Build Tool -TargetPath=.\Release\libapr-1.dll +TargetPath=$(OutDir)\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -87,9 +87,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\Debug\libapr-1.dll" +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OutDir)\libapr-1.dll" # Begin Special Build Tool -TargetPath=.\Debug\libapr-1.dll +TargetPath=$(OutDir)\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -109,7 +109,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"ReleaseNT\libapr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(IntDir)\libapr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -119,9 +119,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\ReleaseNT\libapr-1.dll" /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OutDir)\libapr-1.dll" /opt:ref # Begin Special Build Tool -TargetPath=.\ReleaseNT\libapr.dll +TargetPath=$(OutDir)\libapr.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -141,7 +141,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"DebugNT\libapr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(IntDir)\libapr_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -151,9 +151,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\DebugNT\libapr-1.dll" +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OutDir)\libapr-1.dll" # Begin Special Build Tool -TargetPath=.\DebugNT\libapr-1.dll +TargetPath=$(OutDir)\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 From afba235d4e551497225b91318d8102c3057101e3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 1 Oct 2007 04:22:44 +0000 Subject: [PATCH 5940/7878] Prepare for testing on x64 again; there is a footnote to these changes, VS6 is horribly stupid and will create (and never use) a directory explicitly named $(OUTDIR). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@580835 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 16 ++++++++-------- libapr.dsp | 24 ++++++++++++------------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/apr.dsp b/apr.dsp index 07f456339a6..a5484e1c117 100644 --- a/apr.dsp +++ b/apr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"$(OUTDIR)/apr-1" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"LibR\apr-1.lib" +# ADD LIB32 /nologo /out:"$(OUTDIR)/apr-1.lib" !ELSEIF "$(CFG)" == "apr - Win32 Debug" @@ -67,7 +67,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"$(OUTDIR)/apr-1" /FD /EHsc /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -75,7 +75,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"LibD\apr-1.lib" +# ADD LIB32 /nologo /out:"$(OUTDIR)/apr-1.lib" !ELSEIF "$(CFG)" == "apr - Win32 ReleaseNT" @@ -90,7 +90,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LibRNT" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(IntDir)\apr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(OUTDIR)/apr-1" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -98,7 +98,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"$(OutDir)\apr-1.lib" +# ADD LIB32 /nologo /out:"$(OUTDIR)/apr-1.lib" !ELSEIF "$(CFG)" == "apr - Win32 DebugNT" @@ -114,7 +114,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(IntDir)\apr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(OUTDIR)/apr-1" /FD /EHsc /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -122,7 +122,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"$(OutDir)\apr-1.lib" +# ADD LIB32 /nologo /out:"$(OUTDIR)/apr-1.lib" !ENDIF diff --git a/libapr.dsp b/libapr.dsp index 1b39d76e197..77126a300b3 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libapr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"$(INTDIR)/libapr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -55,9 +55,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OutDir)\libapr-1.dll" /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OUTDIR)/libapr-1.dll" /opt:ref # Begin Special Build Tool -TargetPath=$(OutDir)\libapr-1.dll +TargetPath=Release\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -77,7 +77,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"$(INTDIR)/libapr_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -87,9 +87,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OutDir)\libapr-1.dll" +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OUTDIR)/libapr-1.dll" # Begin Special Build Tool -TargetPath=$(OutDir)\libapr-1.dll +TargetPath=Debug\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -109,7 +109,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(IntDir)\libapr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(INTDIR)/libapr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -119,9 +119,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OutDir)\libapr-1.dll" /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OUTDIR)/libapr-1.dll" /opt:ref # Begin Special Build Tool -TargetPath=$(OutDir)\libapr.dll +TargetPath=ReleaseNT\libapr.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -141,7 +141,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(IntDir)\libapr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(INTDIR)/libapr_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -151,9 +151,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OutDir)\libapr-1.dll" +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OUTDIR)/libapr-1.dll" # Begin Special Build Tool -TargetPath=$(OutDir)\libapr-1.dll +TargetPath=DebugNT\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 From 86b20dc23297761a0bf327d03505c6add19411c8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 1 Oct 2007 19:27:49 +0000 Subject: [PATCH 5941/7878] Had inverted the logic for closing the handles in the parent, thanks to glasser for pointing this out to me on #irc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@581042 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 1dfa0fb159e..ec065ebcc81 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -416,7 +416,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_pool_cleanup_for_exec(); - if ((attr->child_in) && (attr->child_in->filedes == -1)) { + if ((attr->child_in) && (attr->child_in->filedes != -1)) { close(STDIN_FILENO); } else if (attr->child_in) { @@ -425,7 +425,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_file_close(attr->child_in); } - if ((attr->child_out) && (attr->child_out->filedes == -1)) { + if ((attr->child_out) && (attr->child_out->filedes != -1)) { close(STDOUT_FILENO); } else if (attr->child_out) { @@ -434,7 +434,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_file_close(attr->child_out); } - if ((attr->child_err) && (attr->child_err->filedes == -1)) { + if ((attr->child_err) && (attr->child_err->filedes != -1)) { close(STDERR_FILENO); } else if (attr->child_err) { @@ -574,15 +574,15 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } /* Parent process */ - if (attr->child_in && (attr->child_in->filedes == -1)) { + if (attr->child_in && (attr->child_in->filedes != -1)) { apr_file_close(attr->child_in); } - if (attr->child_out && (attr->child_out->filedes == -1)) { + if (attr->child_out && (attr->child_out->filedes != -1)) { apr_file_close(attr->child_out); } - if (attr->child_err && (attr->child_err->filedes == -1)) { + if (attr->child_err && (attr->child_err->filedes != -1)) { apr_file_close(attr->child_err); } From 02c6e92229a3a04d14f5106f43772fce37183e69 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 1 Oct 2007 19:28:09 +0000 Subject: [PATCH 5942/7878] Clearer comment. (Well, I think it's clearer :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@581043 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index f6f3c76dac0..2efad7244f8 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -77,7 +77,6 @@ typedef enum { /** @see apr_procattr_io_set */ #define APR_NO_PIPE 0 - /** @see apr_procattr_io_set */ #define APR_FULL_BLOCK 1 /** @see apr_procattr_io_set */ @@ -86,6 +85,8 @@ typedef enum { #define APR_PARENT_BLOCK 3 /** @see apr_procattr_io_set */ #define APR_CHILD_BLOCK 4 +/** @see apr_procattr_io_set */ +#define APR_NO_FILE 8 /** @see apr_procattr_io_set * @note Win32 only effective with version 1.2.12, portably introduced in 1.3.0 @@ -398,10 +399,11 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new_attr, * @param out Should stdout be a pipe back to the parent? * @param err Should stderr be a pipe back to the parent? * @note If APR_NO_PIPE, there will be no special channel, the child - * inherit's the parent's stdio stream. If APR_NO_FILE is specified, - * that stdio stream is closed in the child (and will be INVALID_HANDLE_VALUE - * if inspected on Win32); warning this can have the ugly side effect - * that the next file opened may fall into the stdio stream role on Unix. + * inherits the parent's corresponding stdio stream. If APR_NO_FILE is + * specified, that corresponding stream is closed in the child (and will + * be INVALID_HANDLE_VALUE when inspected on Win32). This can have ugly + * side effects, as the next file opened in the child on Unix will fall + * into the stdio stream fd slot on Unix! */ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, From d70b217f79a0932f53baaad94a1a524b8ae376ff Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 1 Oct 2007 19:33:51 +0000 Subject: [PATCH 5943/7878] Redundant commit to remove redundancy. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@581045 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 2efad7244f8..ae9c2f2f565 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -403,7 +403,7 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new_attr, * specified, that corresponding stream is closed in the child (and will * be INVALID_HANDLE_VALUE when inspected on Win32). This can have ugly * side effects, as the next file opened in the child on Unix will fall - * into the stdio stream fd slot on Unix! + * into the stdio stream fd slot! */ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, From 7d903edec061cb5155637ce701919257deb73fdc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 1 Oct 2007 20:14:11 +0000 Subject: [PATCH 5944/7878] Rephrase this change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@581058 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 02e9b359b95..5f1fcceb3b4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,10 @@  -*- coding: utf-8 -*- Changes for APR 1.3.0 - *) Introduce APR_NO_FILE as an option for any of the three stdio streams - to cause the specified streams to be closed to the child process, - when the caller has chosen that flag via apr_procattr_io_set(). + *) Introduce APR_NO_FILE as an option to apr_procattr_io_set() for any + of the three stdio streams to cause the corresponding streams to be + closed to the child process. This becomes effective in 1.3.0 across + platforms (equivilant to APR_NO_PIPE in 1.2.x except on Win32.) [William Rowe] *) Solve winNT inherited pipe leaks by mutexing apr_proc_create calls, From 3bbfbde94461839ac167c8f529bcad2a927f84d8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 1 Oct 2007 20:39:36 +0000 Subject: [PATCH 5945/7878] In fact, 580484 did two useful things; note the other. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@581067 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 5f1fcceb3b4..9d6af635eb3 100644 --- a/CHANGES +++ b/CHANGES @@ -152,6 +152,11 @@ Changes for APR 1.3.0 *) Add APR_ARRAY_IDX() and APR_ARRAY_PUSH() convenience macros to apr_tables.h. [Garrett Rooney] +Changes for APR 1.2.12 + + *) Cause apr_file_dup2() on Win32 to update the MSVCRT psuedo-stdio + handles for fd-based and FILE * based I/O. [William Rowe] + Changes for APR 1.2.7 *) Netware - add missing apu_version.c parsing for apu_version_string() From ab9684b5dcd7d6354087bc5f257288ecc6d1e214 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 1 Oct 2007 21:54:20 +0000 Subject: [PATCH 5946/7878] Close the standard handle in the child, *when* we tagged it with fd -1 (we aren't trying to close our child_fd's here). Submitted by: David Glasser git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@581089 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index ec065ebcc81..21b44d4b826 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -416,7 +416,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_pool_cleanup_for_exec(); - if ((attr->child_in) && (attr->child_in->filedes != -1)) { + if ((attr->child_in) && (attr->child_in->filedes == -1)) { close(STDIN_FILENO); } else if (attr->child_in) { @@ -425,7 +425,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_file_close(attr->child_in); } - if ((attr->child_out) && (attr->child_out->filedes != -1)) { + if ((attr->child_out) && (attr->child_out->filedes == -1)) { close(STDOUT_FILENO); } else if (attr->child_out) { @@ -434,7 +434,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_file_close(attr->child_out); } - if ((attr->child_err) && (attr->child_err->filedes != -1)) { + if ((attr->child_err) && (attr->child_err->filedes == -1)) { close(STDERR_FILENO); } else if (attr->child_err) { From 409aa47101019be907ec097f81e0e4cfc5f0c975 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 5 Oct 2007 06:12:06 +0000 Subject: [PATCH 5947/7878] Revert 580655+580835 in search of a better solution git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@582090 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 24 ++++++++++++------------ libapr.dsp | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/apr.dsp b/apr.dsp index a5484e1c117..fa6cda684ab 100644 --- a/apr.dsp +++ b/apr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"$(OUTDIR)/apr-1" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr_src" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"$(OUTDIR)/apr-1.lib" +# ADD LIB32 /nologo /out:"LibR\apr-1.lib" !ELSEIF "$(CFG)" == "apr - Win32 Debug" @@ -67,7 +67,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"$(OUTDIR)/apr-1" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr_src" /FD /EHsc /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -75,7 +75,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"$(OUTDIR)/apr-1.lib" +# ADD LIB32 /nologo /out:"LibD\apr-1.lib" !ELSEIF "$(CFG)" == "apr - Win32 ReleaseNT" @@ -86,11 +86,11 @@ LIB32=link.exe -lib # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "LibRNT" -# PROP Intermediate_Dir "LibRNT" +# PROP Output_Dir "LibNTR" +# PROP Intermediate_Dir "LibNTR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(OUTDIR)/apr-1" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"LibNTR\apr_src" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -98,7 +98,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"$(OUTDIR)/apr-1.lib" +# ADD LIB32 /nologo /out:"LibNTR\apr-1.lib" !ELSEIF "$(CFG)" == "apr - Win32 DebugNT" @@ -109,12 +109,12 @@ LIB32=link.exe -lib # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "LibDNT" -# PROP Intermediate_Dir "LibDNT" +# PROP Output_Dir "LibNTD" +# PROP Intermediate_Dir "LibNTD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(OUTDIR)/apr-1" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"LibNTD\apr_src" /FD /EHsc /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -122,7 +122,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"$(OUTDIR)/apr-1.lib" +# ADD LIB32 /nologo /out:"LibNTD\apr-1.lib" !ENDIF diff --git a/libapr.dsp b/libapr.dsp index 77126a300b3..cb12e13238e 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"$(INTDIR)/libapr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libapr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -55,9 +55,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OUTDIR)/libapr-1.dll" /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\Release\libapr-1.dll" /opt:ref # Begin Special Build Tool -TargetPath=Release\libapr-1.dll +TargetPath=.\Release\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -77,7 +77,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"$(INTDIR)/libapr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -87,9 +87,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OUTDIR)/libapr-1.dll" +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\Debug\libapr-1.dll" # Begin Special Build Tool -TargetPath=Debug\libapr-1.dll +TargetPath=.\Debug\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -109,7 +109,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(INTDIR)/libapr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"ReleaseNT\libapr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -119,9 +119,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OUTDIR)/libapr-1.dll" /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\ReleaseNT\libapr-1.dll" /opt:ref # Begin Special Build Tool -TargetPath=ReleaseNT\libapr.dll +TargetPath=.\ReleaseNT\libapr.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -141,7 +141,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"$(INTDIR)/libapr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"DebugNT\libapr_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -151,9 +151,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"$(OUTDIR)/libapr-1.dll" +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\DebugNT\libapr-1.dll" # Begin Special Build Tool -TargetPath=DebugNT\libapr-1.dll +TargetPath=.\DebugNT\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 From 87e79d2b73da040853f98e0a7972666326e8fbe9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 5 Oct 2007 06:56:11 +0000 Subject: [PATCH 5948/7878] Once we know apr_off_t size > 0, we know we can fold it, as off_t is signed and size_t is unsigned. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@582097 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/unix/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmap/unix/common.c b/mmap/unix/common.c index a9789928809..1172f3c89b9 100644 --- a/mmap/unix/common.c +++ b/mmap/unix/common.c @@ -32,8 +32,8 @@ APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mmap, apr_off_t offset) -{ - if (offset < 0 || offset > mmap->size) +{ + if (offset < 0 || (apr_size_t)offset > mmap->size) return APR_EINVAL; (*addr) = (char *) mmap->mm + offset; From d9d732794233af6ebd92e7ff025819d08bb51f15 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 5 Oct 2007 23:16:06 +0000 Subject: [PATCH 5949/7878] tweak case of WinNT git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@582418 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 9d6af635eb3..cecb9e39c6e 100644 --- a/CHANGES +++ b/CHANGES @@ -7,7 +7,7 @@ Changes for APR 1.3.0 platforms (equivilant to APR_NO_PIPE in 1.2.x except on Win32.) [William Rowe] - *) Solve winNT inherited pipe leaks by mutexing apr_proc_create calls, + *) Solve WinNT inherited pipe leaks by mutexing apr_proc_create calls, on WinNT (not WinCE, nor 9x) so that we toggle the inherited state of the stdin/out/err pipes. All other file handles are treated as not-inherited until apr_file_dup2'ed a std handle of this process, From 2944e00f2c5ba8703f45bc6c0b7097d945afde71 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 5 Oct 2007 23:27:21 +0000 Subject: [PATCH 5950/7878] find the mod_test shared library on z/OS Submitted by: David Jones Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@582422 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testdso.c b/test/testdso.c index b87bdf70e10..361f46dd56a 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -31,7 +31,7 @@ #ifdef NETWARE # define MOD_NAME "mod_test.nlm" -#elif defined(BEOS) +#elif defined(BEOS) || defined(__MVS__) # define MOD_NAME "mod_test.so" #elif defined(WIN32) # define MOD_NAME "mod_test.dll" From 4eaa7479c4e1d58fa7197e64a424b97ffb3b1d3f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 6 Oct 2007 22:39:23 +0000 Subject: [PATCH 5951/7878] We need to compare size_t where it's >int/long, which is true on all 64P architectures. Since %p does a very nice job, and since BenL taught me the typesafe way to cast a function, let's provide ABTS_SIZE_EQUAL tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@582541 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/abts.h b/test/abts.h index 51123ff079f..27bed8a7f49 100644 --- a/test/abts.h +++ b/test/abts.h @@ -21,6 +21,7 @@ extern "C" { #include #include #include +#include #ifndef ABTS_H #define ABTS_H @@ -74,6 +75,8 @@ void abts_fail(abts_case *tc, const char *message, int lineno); void abts_not_impl(abts_case *tc, const char *message, int lineno); void abts_assert(abts_case *tc, const char *message, int condition, int lineno); +typedef void (fn_abts_size_equal)(abts_case *tc, size_t expected, size_t actual, int lineno); + /* Convenience macros. Ryan hates these! */ #define ABTS_INT_EQUAL(a, b, c) abts_int_equal(a, b, c, __LINE__) #define ABTS_INT_NEQUAL(a, b, c) abts_int_nequal(a, b, c, __LINE__) @@ -86,6 +89,9 @@ void abts_assert(abts_case *tc, const char *message, int condition, int lineno); #define ABTS_NOT_IMPL(a, b) abts_not_impl(a, b, __LINE__); #define ABTS_ASSERT(a, b, c) abts_assert(a, b, c, __LINE__); +#define ABTS_SIZE_EQUAL(a, b, c) ((fn_abts_size_equal*)abts_ptr_equal)(a, b, c, __LINE__) + + abts_suite *run_tests(abts_suite *suite); abts_suite *run_tests1(abts_suite *suite); From 946e4eec7118a177f7e37b550f3fffb94c53891d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 6 Oct 2007 22:40:13 +0000 Subject: [PATCH 5952/7878] It's *really* nasty to pipe these results to a file, let's knock of the pretty spinning wheels for text results, ok? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@582542 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/abts.c b/test/abts.c index 2905a2592df..ff0f2ea822d 100644 --- a/test/abts.c +++ b/test/abts.c @@ -369,6 +369,9 @@ int main(int argc, const char *const argv[]) { abts_suite *suite = NULL; initialize(); + + quiet = !isatty(STDOUT_FILENO); + for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-v")) { verbose = 1; From a0779e665d8a3725da12e7408df65c0c6870856d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 6 Oct 2007 22:43:13 +0000 Subject: [PATCH 5953/7878] In preparation to be able to test multiple, parallel flavors of the apr build, we'll need to designate the path of the apr-invoked binaires. Macroize this. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@582543 13f79535-47bb-0310-9956-ffa450edef68 --- test/testutil.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/testutil.h b/test/testutil.h index d3294891dd3..5281341c3ec 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -15,12 +15,26 @@ */ #include "apr_pools.h" +#include "apr_general.h" #include "abts.h" #ifndef APR_TEST_UTIL #define APR_TEST_UTIL -/* XXX FIXME */ +/* XXX: FIXME - these all should become much more utilitarian + * and part of apr, itself + */ + +#ifdef WIN32 +ifdef BINPATH +#define TESTBINPATH APR_STRINGIFY(BINPATH) "/" +#else +#define TESTBINPATH "" +#endif +#else +#define TESTBINPATH "./" +#endif + #ifdef WIN32 #define EXTENSION ".exe" #elif NETWARE From fe2ef041f35222291237e10afa38d28912efafec Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 6 Oct 2007 22:44:46 +0000 Subject: [PATCH 5954/7878] Solve two sets of issues, only two possible changes, in one batch commit; * P64 architectures require us to use ABTS_SIZE_EQUAL * We need to localize to TESTBINPATH for win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@582544 13f79535-47bb-0310-9956-ffa450edef68 --- test/testcond.c | 6 +++--- test/testdso.c | 4 ++-- test/testdup.c | 4 ++-- test/testfile.c | 43 +++++++++++++++++++++--------------------- test/testflock.c | 2 +- test/testglobalmutex.c | 2 +- test/testmmap.c | 4 ++-- test/testoc.c | 2 +- test/testpipe.c | 8 ++++---- test/testpoll.c | 4 ++-- test/testproc.c | 6 +++--- test/testshm.c | 8 ++++---- test/testsock.c | 6 +++--- test/testsockets.c | 4 ++-- 14 files changed, 52 insertions(+), 51 deletions(-) diff --git a/test/testcond.c b/test/testcond.c index 0b208690204..77b6ea8b50b 100644 --- a/test/testcond.c +++ b/test/testcond.c @@ -375,8 +375,8 @@ static void pipe_consumer(toolbox_t *box) rv = apr_file_read_full(out, &ch, 1, &nbytes); ABTS_SUCCESS(rv); - ABTS_INT_EQUAL(tc, 1, nbytes); - ABTS_INT_EQUAL(tc, 1, (ch == '.')); + ABTS_SIZE_EQUAL(tc, 1, nbytes); + ABTS_TRUE(tc, ch == '.'); } while (1); /* naive fairness test */ @@ -392,7 +392,7 @@ static void pipe_write(toolbox_t *box, char ch) rv = apr_file_write_full(in, &ch, 1, &nbytes); ABTS_SUCCESS(rv); - ABTS_INT_EQUAL(tc, 1, nbytes); + ABTS_SIZE_EQUAL(tc, 1, nbytes); rv = apr_thread_mutex_lock(box->mutex); ABTS_SUCCESS(rv); diff --git a/test/testdso.c b/test/testdso.c index 361f46dd56a..6ab94010ab0 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -15,6 +15,7 @@ */ +#include "apr.h" #include "testutil.h" #include "apr_general.h" #include "apr_pools.h" @@ -22,7 +23,6 @@ #include "apr_dso.h" #include "apr_strings.h" #include "apr_file_info.h" -#include "apr.h" #if APR_HAVE_UNISTD_H #include #endif @@ -34,7 +34,7 @@ #elif defined(BEOS) || defined(__MVS__) # define MOD_NAME "mod_test.so" #elif defined(WIN32) -# define MOD_NAME "mod_test.dll" +# define MOD_NAME TESTBINPATH "mod_test.dll" #elif defined(DARWIN) # define MOD_NAME ".libs/mod_test.so" # define LIB_NAME ".libs/libmod_test.dylib" diff --git a/test/testdup.c b/test/testdup.c index 9d064ec0d8d..3f9ea68edcb 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -76,7 +76,7 @@ static void test_file_readwrite(abts_case *tc, void *data) rv = apr_file_write(file3, TEST, &txtlen); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, sizeof(TEST), txtlen); + ABTS_SIZE_EQUAL(tc, sizeof(TEST), txtlen); fpos = 0; rv = apr_file_seek(file1, APR_SET, &fpos); @@ -161,7 +161,7 @@ static void test_dup2_readwrite(abts_case *tc, void *data) txtlen = sizeof(TEST2); rv = apr_file_write(errfile, TEST2, &txtlen); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, sizeof(TEST2), txtlen); + ABTS_SIZE_EQUAL(tc, sizeof(TEST2), txtlen); fpos = 0; rv = apr_file_seek(testfile, APR_SET, &fpos); diff --git a/test/testfile.c b/test/testfile.c index 9f24dcc54e9..dd1d277bec9 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -85,7 +85,7 @@ static void test_read(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, strlen(TESTSTR), nbytes); + ABTS_SIZE_EQUAL(tc, strlen(TESTSTR), nbytes); ABTS_STR_EQUAL(tc, TESTSTR, str); apr_file_close(filetest); @@ -103,7 +103,7 @@ static void test_readzero(abts_case *tc, void *data) rv = apr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 0, nbytes); + ABTS_SIZE_EQUAL(tc, 0, nbytes); apr_file_close(filetest); } @@ -232,7 +232,7 @@ static void test_seek(abts_case *tc, void *data) rv = apr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, strlen(TESTSTR), nbytes); + ABTS_SIZE_EQUAL(tc, strlen(TESTSTR), nbytes); ABTS_STR_EQUAL(tc, TESTSTR, str); memset(str, 0, nbytes + 1); @@ -242,7 +242,7 @@ static void test_seek(abts_case *tc, void *data) rv = apr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, strlen(TESTSTR) - 5, nbytes); + ABTS_SIZE_EQUAL(tc, strlen(TESTSTR) - 5, nbytes); ABTS_STR_EQUAL(tc, TESTSTR + 5, str); apr_file_close(filetest); @@ -257,13 +257,13 @@ static void test_seek(abts_case *tc, void *data) offset = -5; rv = apr_file_seek(filetest, SEEK_END, &offset); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, strlen(TESTSTR) - 5, nbytes); + ABTS_SIZE_EQUAL(tc, strlen(TESTSTR) - 5, nbytes); memset(str, 0, nbytes + 1); nbytes = 256; rv = apr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 5, nbytes); + ABTS_SIZE_EQUAL(tc, 5, nbytes); ABTS_STR_EQUAL(tc, TESTSTR + strlen(TESTSTR) - 5, str); apr_file_close(filetest); @@ -329,6 +329,7 @@ static void test_userdata_getnokey(abts_case *tc, void *data) static void test_buffer_set_get(abts_case *tc, void *data) { apr_status_t rv; + apr_size_t bufsize; apr_file_t *filetest = NULL; char * buffer; @@ -337,21 +338,21 @@ static void test_buffer_set_get(abts_case *tc, void *data) APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_buffer_size_get(filetest); - ABTS_INT_EQUAL(tc, APR_BUFFERSIZE, rv); + bufsize = apr_file_buffer_size_get(filetest); + ABTS_SIZE_EQUAL(tc, APR_BUFFERSIZE, bufsize); buffer = apr_pcalloc(p, 10240); rv = apr_file_buffer_set(filetest, buffer, 10240); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_buffer_size_get(filetest); - ABTS_INT_EQUAL(tc, 10240, rv); + bufsize = apr_file_buffer_size_get(filetest); + ABTS_SIZE_EQUAL(tc, 10240, bufsize); rv = apr_file_buffer_set(filetest, buffer, 12); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_buffer_size_get(filetest); - ABTS_INT_EQUAL(tc, 12, rv); + bufsize = apr_file_buffer_size_get(filetest); + ABTS_SIZE_EQUAL(tc, 12, bufsize); apr_file_close(filetest); } @@ -457,7 +458,7 @@ static void test_bigread(abts_case *tc, void *data) rv = apr_file_write(f, buf, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, APR_BUFFERSIZE, nbytes); + ABTS_SIZE_EQUAL(tc, APR_BUFFERSIZE, nbytes); rv = apr_file_close(f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -469,7 +470,7 @@ static void test_bigread(abts_case *tc, void *data) nbytes = sizeof buf; rv = apr_file_read(f, buf, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, APR_BUFFERSIZE, nbytes); + ABTS_SIZE_EQUAL(tc, APR_BUFFERSIZE, nbytes); rv = apr_file_close(f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -500,28 +501,28 @@ static void test_mod_neg(abts_case *tc, void *data) nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, strlen(s), nbytes); + ABTS_SIZE_EQUAL(tc, strlen(s), nbytes); for (i = 0; i < 7980; i++) { s = "0"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, strlen(s), nbytes); + ABTS_SIZE_EQUAL(tc, strlen(s), nbytes); } s = "end456789\n"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, strlen(s), nbytes); + ABTS_SIZE_EQUAL(tc, strlen(s), nbytes); for (i = 0; i < 10000; i++) { s = "1"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, strlen(s), nbytes); + ABTS_SIZE_EQUAL(tc, strlen(s), nbytes); } rv = apr_file_close(f); @@ -542,7 +543,7 @@ static void test_mod_neg(abts_case *tc, void *data) nbytes = sizeof(buf); rv = apr_file_read(f, buf, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, nbytes, sizeof(buf)); + ABTS_SIZE_EQUAL(tc, nbytes, sizeof(buf)); cur = -((apr_off_t)nbytes - 7980); rv = apr_file_seek(f, APR_CUR, &cur); @@ -674,7 +675,7 @@ static void test_writev_full(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "writev_full of size 5 to file", apr_file_writev_full(f, vec, 5, &nbytes)); - ABTS_INT_EQUAL(tc, strlen(LINE1)*3 + strlen(LINE2)*2, nbytes); + ABTS_SIZE_EQUAL(tc, strlen(LINE1)*3 + strlen(LINE2)*2, nbytes); APR_ASSERT_SUCCESS(tc, "close for writing", apr_file_close(f)); @@ -772,7 +773,7 @@ static void test_truncate(abts_case *tc, void *data) nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, strlen(s), nbytes); + ABTS_SIZE_EQUAL(tc, strlen(s), nbytes); rv = apr_file_close(f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); diff --git a/test/testflock.c b/test/testflock.c index 6eac94a7a00..f4350590d86 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -44,7 +44,7 @@ static int launch_reader(abts_case *tc) args[0] = "tryread" EXTENSION; args[1] = NULL; - rv = apr_proc_create(&proc, "./tryread" EXTENSION, args, NULL, procattr, p); + rv = apr_proc_create(&proc, TESTBINPATH "tryread" EXTENSION, args, NULL, procattr, p); APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv); ABTS_ASSERT(tc, "wait for child process", diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index a10742d92fe..d6b716c09f8 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -41,7 +41,7 @@ static void launch_child(abts_case *tc, apr_lockmech_e mech, args[0] = "globalmutexchild" EXTENSION; args[1] = (const char*)apr_itoa(p, (int)mech); args[2] = NULL; - rv = apr_proc_create(proc, "./globalmutexchild" EXTENSION, args, NULL, + rv = apr_proc_create(proc, TESTBINPATH "globalmutexchild" EXTENSION, args, NULL, procattr, p); APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv); } diff --git a/test/testmmap.c b/test/testmmap.c index 69fc85c6863..ff5e2a4b2d4 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -40,7 +40,7 @@ static apr_mmap_t *themmap = NULL; static apr_file_t *thefile = NULL; static char *file1; static apr_finfo_t finfo; -static int fsize; +static apr_size_t fsize; static void create_filename(abts_case *tc, void *data) { @@ -102,7 +102,7 @@ static void test_mmap_contents(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, themmap); ABTS_PTR_NOTNULL(tc, themmap->mm); - ABTS_INT_EQUAL(tc, fsize, themmap->size); + ABTS_SIZE_EQUAL(tc, fsize, themmap->size); /* Must use nEquals since the string is not guaranteed to be NULL terminated */ ABTS_STR_NEQUAL(tc, themmap->mm, TEST_STRING, fsize); diff --git a/test/testoc.c b/test/testoc.c index 9dbaff8c377..a5342b1f2dc 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -73,7 +73,7 @@ static void test_child_kill(abts_case *tc, void *data) APR_NO_PIPE); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_proc_create(&newproc, "./occhild" EXTENSION, args, NULL, procattr, p); + rv = apr_proc_create(&newproc, TESTBINPATH "occhild" EXTENSION, args, NULL, procattr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, newproc.in); ABTS_PTR_EQUAL(tc, NULL, newproc.out); diff --git a/test/testpipe.c b/test/testpipe.c index fcac4d25a66..bb0cafef212 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -94,7 +94,7 @@ static void read_write(abts_case *tc, void *data) if (!rv) { rv = apr_file_read(readp, buf, &nbytes); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - ABTS_INT_EQUAL(tc, 0, nbytes); + ABTS_SIZE_EQUAL(tc, 0, nbytes); } } @@ -113,14 +113,14 @@ static void read_write_notimeout(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, writep); rv = apr_file_write(writep, buf, &nbytes); - ABTS_INT_EQUAL(tc, strlen("this is a test"), nbytes); + ABTS_SIZE_EQUAL(tc, strlen("this is a test"), nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); nbytes = 256; input = apr_pcalloc(p, nbytes + 1); rv = apr_file_read(readp, input, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, strlen("this is a test"), nbytes); + ABTS_SIZE_EQUAL(tc, strlen("this is a test"), nbytes); ABTS_STR_EQUAL(tc, "this is a test", input); } @@ -151,7 +151,7 @@ static void test_pipe_writefull(abts_case *tc, void *data) args[0] = "readchild" EXTENSION; args[1] = NULL; - rv = apr_proc_create(&proc, "./readchild" EXTENSION, args, NULL, procattr, p); + rv = apr_proc_create(&proc, TESTBINPATH "readchild" EXTENSION, args, NULL, procattr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_pipe_timeout_set(proc.in, apr_time_from_sec(10)); diff --git a/test/testpoll.c b/test/testpoll.c index a3030327ee5..e7792c2f11a 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -91,7 +91,7 @@ static void send_msg(apr_socket_t **sockarray, apr_sockaddr_t **sas, int which, rv = apr_socket_sendto(sockarray[which], sas[which], 0, "hello", &len); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, strlen("hello"), len); + ABTS_SIZE_EQUAL(tc, strlen("hello"), len); } static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p, @@ -108,7 +108,7 @@ static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p, rv = apr_socket_recvfrom(recsa, sockarray[which], 0, buffer, &buflen); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, strlen("hello"), buflen); + ABTS_SIZE_EQUAL(tc, strlen("hello"), buflen); ABTS_STR_EQUAL(tc, "hello", buffer); } diff --git a/test/testproc.c b/test/testproc.c index b025c8e59d1..4791b928197 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -50,7 +50,7 @@ static void test_create_proc(abts_case *tc, void *data) args[0] = "proc_child" EXTENSION; args[1] = NULL; - rv = apr_proc_create(&newproc, "../proc_child" EXTENSION, args, NULL, + rv = apr_proc_create(&newproc, "../" TESTBINPATH "proc_child" EXTENSION, args, NULL, attr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -59,7 +59,7 @@ static void test_create_proc(abts_case *tc, void *data) length = strlen(TESTSTR); rv = apr_file_write(testfile, TESTSTR, &length); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, strlen(TESTSTR), length); + ABTS_SIZE_EQUAL(tc, strlen(TESTSTR), length); testfile = newproc.out; length = 256; @@ -126,7 +126,7 @@ static void test_file_redir(abts_case *tc, void *data) args[0] = "proc_child"; args[1] = NULL; - rv = apr_proc_create(&newproc, "../proc_child" EXTENSION, args, NULL, + rv = apr_proc_create(&newproc, "../" TESTBINPATH "proc_child" EXTENSION, args, NULL, attr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); diff --git a/test/testshm.c b/test/testshm.c index 3691dd52ce1..c660abf88f3 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -83,7 +83,7 @@ static void test_check_size(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, shm); retsize = apr_shm_size_get(shm); - ABTS_INT_EQUAL(tc, SHARED_SIZE, retsize); + ABTS_SIZE_EQUAL(tc, SHARED_SIZE, retsize); rv = apr_shm_destroy(shm); APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); @@ -177,7 +177,7 @@ static void test_named(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, shm); retsize = apr_shm_size_get(shm); - ABTS_INT_EQUAL(tc, SHARED_SIZE, retsize); + ABTS_SIZE_EQUAL(tc, SHARED_SIZE, retsize); boxes = apr_shm_baseaddr_get(shm); ABTS_PTR_NOTNULL(tc, boxes); @@ -187,7 +187,7 @@ static void test_named(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "Couldn't create attr1", rv); args[0] = apr_pstrdup(p, "testshmproducer" EXTENSION); args[1] = NULL; - rv = apr_proc_create(&pidproducer, "./testshmproducer" EXTENSION, args, + rv = apr_proc_create(&pidproducer, TESTBINPATH "testshmproducer" EXTENSION, args, NULL, attr1, p); APR_ASSERT_SUCCESS(tc, "Couldn't launch producer", rv); @@ -195,7 +195,7 @@ static void test_named(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, attr2); APR_ASSERT_SUCCESS(tc, "Couldn't create attr2", rv); args[0] = apr_pstrdup(p, "testshmconsumer" EXTENSION); - rv = apr_proc_create(&pidconsumer, "./testshmconsumer" EXTENSION, args, + rv = apr_proc_create(&pidconsumer, TESTBINPATH "testshmconsumer" EXTENSION, args, NULL, attr2, p); APR_ASSERT_SUCCESS(tc, "Couldn't launch consumer", rv); diff --git a/test/testsock.c b/test/testsock.c index 5c83d68c0e3..343dbd36e14 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -43,7 +43,7 @@ static void launch_child(abts_case *tc, apr_proc_t *proc, const char *arg1, apr_ args[0] = "sockchild" EXTENSION; args[1] = arg1; args[2] = NULL; - rv = apr_proc_create(proc, "./sockchild" EXTENSION, args, NULL, + rv = apr_proc_create(proc, TESTBINPATH "sockchild" EXTENSION, args, NULL, procattr, p); APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv); } @@ -133,7 +133,7 @@ static void test_send(abts_case *tc, void *data) apr_socket_send(sock2, DATASTR, &length); /* Make sure that the client received the data we sent */ - ABTS_INT_EQUAL(tc, strlen(DATASTR), wait_child(tc, &proc)); + ABTS_SIZE_EQUAL(tc, strlen(DATASTR), wait_child(tc, &proc)); rv = apr_socket_close(sock2); APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); @@ -167,7 +167,7 @@ static void test_recv(abts_case *tc, void *data) /* Make sure that the server received the data we sent */ ABTS_STR_EQUAL(tc, DATASTR, datastr); - ABTS_INT_EQUAL(tc, strlen(datastr), wait_child(tc, &proc)); + ABTS_SIZE_EQUAL(tc, strlen(datastr), wait_child(tc, &proc)); rv = apr_socket_close(sock2); APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); diff --git a/test/testsockets.c b/test/testsockets.c index 4bed66e42af..f54a2de5f5f 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -148,7 +148,7 @@ static void sendto_receivefrom_helper(abts_case *tc, const char *addr, int famil len = STRLEN; rv = apr_socket_sendto(sock2, to, 0, sendbuf, &len); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, STRLEN, len); + ABTS_SIZE_EQUAL(tc, STRLEN, len); /* fill the "from" sockaddr with a random address to ensure that * recvfrom sets it up properly. */ @@ -157,7 +157,7 @@ static void sendto_receivefrom_helper(abts_case *tc, const char *addr, int famil len = 80; rv = apr_socket_recvfrom(from, sock, 0, recvbuf, &len); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, STRLEN, len); + ABTS_SIZE_EQUAL(tc, STRLEN, len); ABTS_STR_EQUAL(tc, "APR_INET, SOCK_DGRAM", recvbuf); apr_sockaddr_ip_get(&ip_addr, from); From 298a0f9bb7a436c34f721fbab0c207ac3b585166 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 6 Oct 2007 22:47:13 +0000 Subject: [PATCH 5955/7878] Fork testall.dsp into testdll/testlib flavors for testing either the dll flavor or lib flavor of our build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@582545 13f79535-47bb-0310-9956-ffa450edef68 --- test/testall.dsw | 17 +- test/{testall.dsp => testdll.dsp} | 0 test/testlib.dsp | 325 ++++++++++++++++++++++++++++++ 3 files changed, 341 insertions(+), 1 deletion(-) rename test/{testall.dsp => testdll.dsp} (100%) create mode 100644 test/testlib.dsp diff --git a/test/testall.dsw b/test/testall.dsw index f4be05d975b..fed974c9145 100644 --- a/test/testall.dsw +++ b/test/testall.dsw @@ -30,7 +30,22 @@ Package=<4> ############################################################################### -Project: "testall"=".\testall.dsp" - Package Owner=<4> +Project: "testdll"=".\testdll.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libapr + End Project Dependency +}}} + +############################################################################### + +Project: "testlib"=".\testlib.dsp" - Package Owner=<4> Package=<5> {{{ diff --git a/test/testall.dsp b/test/testdll.dsp similarity index 100% rename from test/testall.dsp rename to test/testdll.dsp diff --git a/test/testlib.dsp b/test/testlib.dsp new file mode 100644 index 00000000000..47709f4862f --- /dev/null +++ b/test/testlib.dsp @@ -0,0 +1,325 @@ +# Microsoft Developer Studio Project File - Name="testall" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) External Target" 0x0106 + +CFG=testall - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "testall.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "testall.mak" CFG="testall - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "testall - Win32 Release" (based on "Win32 (x86) External Target") +!MESSAGE "testall - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "testall - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win all" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "testall.exe" +# PROP BASE Bsc_Name "testall.bsc" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /f Makefile.win all" +# PROP Rebuild_Opt "/a" +# PROP Target_File "testall.exe" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "testall - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win all" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "testall.exe" +# PROP BASE Bsc_Name "testall.bsc" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /f Makefile.win all" +# PROP Rebuild_Opt "/a" +# PROP Target_File "testall.exe" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "testall - Win32 Release" +# Name "testall - Win32 Debug" + +!IF "$(CFG)" == "testall - Win32 Release" + +!ELSEIF "$(CFG)" == "testall - Win32 Debug" + +!ENDIF + +# Begin Source File + +SOURCE=.\abts.c +# End Source File +# Begin Source File + +SOURCE=.\abts.h +# End Source File +# Begin Source File + +SOURCE=.\globalmutexchild.c +# End Source File +# Begin Source File + +SOURCE=.\Makefile.win +# End Source File +# Begin Source File + +SOURCE=.\mod_test.c +# End Source File +# Begin Source File + +SOURCE=.\nw_misc.c +# End Source File +# Begin Source File + +SOURCE=.\occhild.c +# End Source File +# Begin Source File + +SOURCE=.\proc_child.c +# End Source File +# Begin Source File + +SOURCE=.\readchild.c +# End Source File +# Begin Source File + +SOURCE=.\sendfile.c +# End Source File +# Begin Source File + +SOURCE=.\sockchild.c +# End Source File +# Begin Source File + +SOURCE=.\testapp.c +# End Source File +# Begin Source File + +SOURCE=.\testargs.c +# End Source File +# Begin Source File + +SOURCE=.\testatomic.c +# End Source File +# Begin Source File + +SOURCE=.\testcond.c +# End Source File +# Begin Source File + +SOURCE=.\testdir.c +# End Source File +# Begin Source File + +SOURCE=.\testdso.c +# End Source File +# Begin Source File + +SOURCE=.\testdup.c +# End Source File +# Begin Source File + +SOURCE=.\testenv.c +# End Source File +# Begin Source File + +SOURCE=.\testfile.c +# End Source File +# Begin Source File + +SOURCE=.\testfilecopy.c +# End Source File +# Begin Source File + +SOURCE=.\testfileinfo.c +# End Source File +# Begin Source File + +SOURCE=.\testflock.c +# End Source File +# Begin Source File + +SOURCE=.\testfmt.c +# End Source File +# Begin Source File + +SOURCE=.\testfnmatch.c +# End Source File +# Begin Source File + +SOURCE=.\testglobalmutex.c +# End Source File +# Begin Source File + +SOURCE=.\testhash.c +# End Source File +# Begin Source File + +SOURCE=.\testipsub.c +# End Source File +# Begin Source File + +SOURCE=.\testlfs.c +# End Source File +# Begin Source File + +SOURCE=.\testlock.c +# End Source File +# Begin Source File + +SOURCE=.\testlockperf.c +# End Source File +# Begin Source File + +SOURCE=.\testmmap.c +# End Source File +# Begin Source File + +SOURCE=.\testmutexscope.c +# End Source File +# Begin Source File + +SOURCE=.\testnames.c +# End Source File +# Begin Source File + +SOURCE=.\testoc.c +# End Source File +# Begin Source File + +SOURCE=.\testpath.c +# End Source File +# Begin Source File + +SOURCE=.\testpipe.c +# End Source File +# Begin Source File + +SOURCE=.\testpoll.c +# End Source File +# Begin Source File + +SOURCE=.\testpools.c +# End Source File +# Begin Source File + +SOURCE=.\testproc.c +# End Source File +# Begin Source File + +SOURCE=.\testprocmutex.c +# End Source File +# Begin Source File + +SOURCE=.\testrand.c +# End Source File +# Begin Source File + +SOURCE=.\testshm.c +# End Source File +# Begin Source File + +SOURCE=.\testshmconsumer.c +# End Source File +# Begin Source File + +SOURCE=.\testshmproducer.c +# End Source File +# Begin Source File + +SOURCE=.\testsleep.c +# End Source File +# Begin Source File + +SOURCE=.\testsock.c +# End Source File +# Begin Source File + +SOURCE=.\testsockets.c +# End Source File +# Begin Source File + +SOURCE=.\testsockopt.c +# End Source File +# Begin Source File + +SOURCE=.\teststr.c +# End Source File +# Begin Source File + +SOURCE=.\teststrnatcmp.c +# End Source File +# Begin Source File + +SOURCE=.\testtable.c +# End Source File +# Begin Source File + +SOURCE=.\testtemp.c +# End Source File +# Begin Source File + +SOURCE=.\testthread.c +# End Source File +# Begin Source File + +SOURCE=.\testtime.c +# End Source File +# Begin Source File + +SOURCE=.\testud.c +# End Source File +# Begin Source File + +SOURCE=.\testuser.c +# End Source File +# Begin Source File + +SOURCE=.\testutil.c +# End Source File +# Begin Source File + +SOURCE=.\testvsn.c +# End Source File +# Begin Source File + +SOURCE=.\tryread.c +# End Source File +# End Target +# End Project From 29834bab9e4e3a55b74421d6dd24c2e76000f4fa Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 6 Oct 2007 22:48:31 +0000 Subject: [PATCH 5956/7878] These are long abandoned. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@582547 13f79535-47bb-0310-9956-ffa450edef68 --- test/aprtest.def | 3 - test/aprtest.dsp | 199 ----------------------------------------------- test/aprtest.win | 18 ----- 3 files changed, 220 deletions(-) delete mode 100644 test/aprtest.def delete mode 100644 test/aprtest.dsp delete mode 100644 test/aprtest.win diff --git a/test/aprtest.def b/test/aprtest.def deleted file mode 100644 index bfea210d864..00000000000 --- a/test/aprtest.def +++ /dev/null @@ -1,3 +0,0 @@ -MODULE LIBC.NLM -MODULE APRLIB.NLM - diff --git a/test/aprtest.dsp b/test/aprtest.dsp deleted file mode 100644 index ca774eb6235..00000000000 --- a/test/aprtest.dsp +++ /dev/null @@ -1,199 +0,0 @@ -# Microsoft Developer Studio Project File - Name="aprtest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=aprtest - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "aprtest.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "aprtest.mak" CFG="aprtest - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "aprtest - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "aprtest - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "aprtest - Win32 Release" - -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Cmd_Line "NMAKE /f Makefile" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "aprtest.exe" -# PROP BASE Bsc_Name "aprtest.bsc" -# PROP BASE Target_Dir "" -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Cmd_Line "NMAKE /f aprtest.win" -# PROP Rebuild_Opt "/a" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "aprtest - Win32 Debug" - -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Cmd_Line "NMAKE /f aprtest.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "aprtest.exe" -# PROP BASE Bsc_Name "aprtest.bsc" -# PROP BASE Target_Dir "" -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Cmd_Line "NMAKE /f aprtest.win" -# PROP Rebuild_Opt "/a" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "aprtest - Win32 Release" -# Name "aprtest - Win32 Debug" - -!IF "$(CFG)" == "aprtest - Win32 Release" - -!ELSEIF "$(CFG)" == "aprtest - Win32 Debug" - -!ENDIF - -# Begin Group "Sources" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\abc.c -# End Source File -# Begin Source File - -SOURCE=.\client.c -# End Source File -# Begin Source File - -SOURCE=.\mod_test.c -# End Source File -# Begin Source File - -SOURCE=.\occhild.c -# End Source File -# Begin Source File - -SOURCE=.\sendfile.c -# End Source File -# Begin Source File - -SOURCE=.\server.c -# End Source File -# Begin Source File - -SOURCE=.\testargs.c -# End Source File -# Begin Source File - -SOURCE=.\testcond.c -# End Source File -# Begin Source File - -SOURCE=.\testcontext.c -# End Source File -# Begin Source File - -SOURCE=.\testdso.c -# End Source File -# Begin Source File - -SOURCE=.\testfile.c -# End Source File -# Begin Source File - -SOURCE=.\testflock.c -# End Source File -# Begin Source File - -SOURCE=.\testlock.c -# End Source File -# Begin Source File - -SOURCE=.\testmmap.c -# End Source File -# Begin Source File - -SOURCE=.\testnames.c -# End Source File -# Begin Source File - -SOURCE=.\testoc.c -# End Source File -# Begin Source File - -SOURCE=.\testpath.c -# End Source File -# Begin Source File - -SOURCE=.\testpipe.c -# End Source File -# Begin Source File - -SOURCE=.\testproc.c -# End Source File -# Begin Source File - -SOURCE=.\testshm.c -# End Source File -# Begin Source File - -SOURCE=.\testsock.c -# End Source File -# Begin Source File - -SOURCE=.\testthread.c -# End Source File -# Begin Source File - -SOURCE=.\testtime.c -# End Source File -# Begin Source File - -SOURCE=.\testucs.c -# End Source File -# Begin Source File - -SOURCE=.\testuser.c -# End Source File -# Begin Source File - -SOURCE=.\testuuid.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\aprtest.win -# End Source File -# Begin Source File - -SOURCE=.\Makefile -# End Source File -# Begin Source File - -SOURCE=.\Makefile.in -# End Source File -# End Target -# End Project diff --git a/test/aprtest.win b/test/aprtest.win deleted file mode 100644 index 85ad5b4d780..00000000000 --- a/test/aprtest.win +++ /dev/null @@ -1,18 +0,0 @@ -# Note: -# -# You may need to modify the configuration of Build - Options - Directories -# for the Executable path to include the perl interpreter within DevStudio. -# E.g. add c:\program files\perl\bin to the list of directories - -!IF "$(TARGET)" == "" -TARGET=ALL -!ENDIF - -$(TARGET): Makefile - $(MAKE) /nologo /f Makefile $(TARGET) - -Makefile: Makefile.in MakeWin32Make.awk - awk -f MakeWin32Make.awk Makefile - -clean: - del Makefile *.obj *.exe *.idb *.pdb From 69990e2d535a5390be1d192154d135b1b8b345cd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 7 Oct 2007 09:55:12 +0000 Subject: [PATCH 5957/7878] Refactor Makefile.win to permit many parallel sorts of builds (e.g. testing x86 and x64, regular nt vs. 9x inclusive builds, debug vs. release and libs vs. dll's). Migrate 'testapp', the simple stub example, in order to test every flavor of apr_app.lib and libapr_app.lib. (Before you ask, this is the stub that allows apr apps to accept unicode command input, and represent it all as utf-8 to our true-char flavor libraries.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@582603 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 218 ++++++++++++++++++++++++++++----------------- test/testall.dsw | 42 ++------- test/testapp.dsp | 102 --------------------- test/testappnt.dsp | 113 ----------------------- 4 files changed, 141 insertions(+), 334 deletions(-) delete mode 100644 test/testapp.dsp delete mode 100644 test/testappnt.dsp diff --git a/test/Makefile.win b/test/Makefile.win index d18290cd374..027712bf223 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -7,113 +7,165 @@ # programs such as sendfile, that have to be invoked in a special sequence # or with special parameters -STDTEST_PORTABLE = \ - testlockperf.exe \ - testshmproducer.exe \ - testshmconsumer.exe \ - testmutexscope.exe \ - testall.exe +!IFNDEF MODEL +MODEL=dynamic +!ENDIF + +INCDIR=../include -OTHER_PROGRAMS = sendfile.exe +!IFNDEF OUTDIR +!IF "$(MODEL)" == "static" +OUTDIR=LibR +!ELSE +OUTDIR=Release +!ENDIF + +!IF [$(COMSPEC) /c cl /nologo /? | find "x64" >NUL ] == 0 +OUTDIR=x64\$(OUTDIR) +!ENDIF +!ENDIF + +!IF !EXIST("$(OUTDIR)\.") +!IF ([$(COMSPEC) /C mkdir $(OUTDIR)] == 0) +!ENDIF +!ENDIF + +!IFNDEF INTDIR +INTDIR=$(OUTDIR) +!ELSE +!IF !EXIST("$(INTDIR)\.") +!IF ([$(COMSPEC) /C mkdir $(INTDIR)] == 0) +!ENDIF +!ENDIF +!ENDIF + +!MESSAGE Building tests into $(OUTDIR) for $(MODEL) -PROGRAMS = $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS) +STDTEST_PORTABLE = \ + $(OUTDIR)\testapp.exe \ + $(OUTDIR)\testall.exe \ + $(OUTDIR)\testlockperf.exe \ + $(OUTDIR)\testmutexscope.exe + +OTHER_PROGRAMS = \ + $(OUTDIR)\sendfile.exe + +TESTALL_COMPONENTS = \ + $(OUTDIR)\mod_test.dll \ + $(OUTDIR)\occhild.exe \ + $(OUTDIR)\readchild.exe \ + $(OUTDIR)\proc_child.exe \ + $(OUTDIR)\tryread.exe \ + $(OUTDIR)\sockchild.exe \ + $(OUTDIR)\testshmproducer.exe \ + $(OUTDIR)\testshmconsumer.exe \ + $(OUTDIR)\globalmutexchild.exe + +ALL_TESTS = $(INTDIR)\testutil.obj $(INTDIR)\testtime.obj $(INTDIR)\teststr.obj \ + $(INTDIR)\testvsn.obj $(INTDIR)\testipsub.obj $(INTDIR)\testmmap.obj \ + $(INTDIR)\testud.obj $(INTDIR)\testtable.obj $(INTDIR)\testsleep.obj \ + $(INTDIR)\testpools.obj $(INTDIR)\testfmt.obj $(INTDIR)\testfile.obj \ + $(INTDIR)\testdir.obj $(INTDIR)\testfileinfo.obj $(INTDIR)\testrand.obj \ + $(INTDIR)\testdso.obj $(INTDIR)\testoc.obj $(INTDIR)\testdup.obj \ + $(INTDIR)\testsockets.obj $(INTDIR)\testproc.obj $(INTDIR)\testpoll.obj \ + $(INTDIR)\testlock.obj $(INTDIR)\testsockopt.obj $(INTDIR)\testpipe.obj \ + $(INTDIR)\testthread.obj $(INTDIR)\testhash.obj $(INTDIR)\testargs.obj \ + $(INTDIR)\testnames.obj $(INTDIR)\testuser.obj $(INTDIR)\testpath.obj \ + $(INTDIR)\testenv.obj $(INTDIR)\testprocmutex.obj $(INTDIR)\testfnmatch.obj \ + $(INTDIR)\testatomic.obj $(INTDIR)\testflock.obj $(INTDIR)\testshm.obj \ + $(INTDIR)\testsock.obj $(INTDIR)\testglobalmutex.obj $(INTDIR)\teststrnatcmp.obj \ + $(INTDIR)\testfilecopy.obj $(INTDIR)\testtemp.obj $(INTDIR)\testlfs.obj \ + $(INTDIR)\testcond.obj + +CLEAN_TARGETS = testfile.tmp lfstests/large.bin \ + data/testputs.txt data/testbigfprintf.dat \ + data/testwritev.txt data/testwritev_full.txt + +PROGRAMS = $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS) TARGETS = $(PROGRAMS) # bring in rules.mk for standard functionality ALL: $(TARGETS) -CL = cl.exe - -CFLAGS = /nologo /c /MDd /W3 /Gm /EHsc /Zi /Od /D _DEBUG /D WIN32 /D APR_DECLARE_STATIC /FD - -.c.obj:: - $(CL) -c $< $(CFLAGS) $(INCLUDES) - -LOCAL_LIBS= ../LibD/apr-1.lib -ALL_LIBS= kernel32.lib user32.lib advapi32.lib Rpcrt4.lib ws2_32.lib wsock32.lib ole32.lib +clean: +CL = cl.exe +LD = link.exe + +!IF "$(MODEL)" == "static" +LOCAL_LIB= ..\$(OUTDIR)\apr-1.lib +APP_LIB= ..\build\$(OUTDIR)\apr_app-1.lib +STATIC_CFLAGS = /D APR_DECLARE_STATIC +!ELSE +LOCAL_LIB= ..\$(OUTDIR)\libapr-1.lib +APP_LIB= ..\build\$(OUTDIR)\libapr_app-1.lib +STATIC_CFLAGS = +!ENDIF + +!IFDEF _DEBUG +DEBUG_CFLAGS = /MDd +!ELSE +DEBUG_CFLAGS = /MD +!ENDIF -CLEAN_TARGETS = testfile.tmp mod_test.dll proc_child.exe occhild.exe \ - readchild.exe tryread.exe sockchild.exe \ - globalmutexchild.exe lfstests/large.bin \ - data/testputs.txt data/testbigfprintf.dat data/testwritev.txt \ - data/testwritev_full.txt -CLEAN_SUBDIRS = internal - -INCDIR=../include INCLUDES=/I "$(INCDIR)" -# link programs using -no-install to get real executables not -# libtool wrapper scripts which link an executable when first run. -LINK_PROG = link.exe /nologo /debug /machine:I386 /subsystem:console /incremental:no -LINK_LIB = link.exe /nologo /dll /debug /machine:I386 /subsystem:windows /incremental:no - -check: $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) - for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \ - ./$$prog; \ - if test $$? = 255; then \ - echo "$$prog failed"; \ - break; \ - fi; \ - done - -occhild.exe: occhild.obj $(LOCAL_LIBS) - $(LINK_PROG) occhild.obj $(LOCAL_LIBS) $(ALL_LIBS) - -sockchild.exe: sockchild.obj $(LOCAL_LIBS) - $(LINK_PROG) sockchild.obj $(LOCAL_LIBS) $(ALL_LIBS) - -readchild.exe: readchild.obj $(LOCAL_LIBS) - $(LINK_PROG) readchild.obj $(LOCAL_LIBS) $(ALL_LIBS) +CFLAGS = /nologo /c /W3 /Gm /EHsc /Zi /Od $(INCLUDES) \ + $(STATIC_CFLAGS) $(DEBUG_CFLAGS) /D "BINPATH=$(OUTDIR:\=/)" \ + /D _DEBUG /D WIN32 /Fo"$(INTDIR)/" /FD -globalmutexchild.exe: globalmutexchild.obj $(LOCAL_LIBS) - $(LINK_PROG) globalmutexchild.obj $(LOCAL_LIBS) $(ALL_LIBS) +LD_LIBS = $(LOCAL_LIB) kernel32.lib advapi32.lib ws2_32.lib wsock32.lib \ + ole32.lib shell32.lib rpcrt4.lib -tryread.exe: tryread.obj $(LOCAL_LIBS) - $(LINK_PROG) tryread.obj $(LOCAL_LIBS) $(ALL_LIBS) +LDFLAGS = /nologo /debug /subsystem:console /incremental:no +SHLDFLAGS = /nologo /dll /debug /subsystem:windows /incremental:no -proc_child.exe: proc_child.obj $(LOCAL_LIBS) - $(LINK_PROG) proc_child.obj $(LOCAL_LIBS) $(ALL_LIBS) +.c{$(INTDIR)}.obj:: + $(CL) $(CFLAGS) -c $< -Fd$(INTDIR)\ $(INCLUDES) -# FIXME: -prefer-pic is only supported with libtool-1.4+ -mod_test.dll: mod_test.obj - $(LINK_LIB) mod_test.obj /export:print_hello /export:count_reps $(LOCAL_LIBS) $(ALL_LIBS) +.c{$(OUTDIR)}.exe: + $(CL) $(CFLAGS) -c $** -Fd$(INTDIR)\ $(INCLUDES) + $(LD) $(LDFLAGS) /out:"$@" $*.obj $(LD_LIBS) + if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;1 -testlockperf.exe: testlockperf.obj $(LOCAL_LIBS) - $(LINK_PROG) testlockperf.obj $(LOCAL_LIBS) $(ALL_LIBS) +{$(INTDIR)}.obj{$(OUTDIR)}.exe: + $(LD) $(LDFLAGS) /out:"$@" $*.obj $(LD_LIBS) + if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;1 -sendfile.exe: sendfile.obj $(LOCAL_LIBS) - $(LINK_PROG) sendfile.obj $(LOCAL_LIBS) $(ALL_LIBS) +$(OUTDIR)\mod_test.dll: $(INTDIR)/mod_test.obj + $(LD) $(SHLDFLAGS) /out:"$@" $** \ + /export:print_hello /export:count_reps $(LD_LIBS) + if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;2 -testshmproducer.exe: testshmproducer.obj $(LOCAL_LIBS) - $(LINK_PROG) testshmproducer.obj $(LOCAL_LIBS) $(ALL_LIBS) +$(OUTDIR)\testapp.exe: $(INTDIR)/testapp.obj + $(LD) $(LDFLAGS) /out:"$@" $** \ + /entry:wmainCRTStartup $(APP_LIB) $(LD_LIBS) + if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;2 -testshmconsumer.exe: testshmconsumer.obj $(LOCAL_LIBS) - $(LINK_PROG) testshmconsumer.obj $(LOCAL_LIBS) $(ALL_LIBS) +$(OUTDIR)\testall.exe: $(ALL_TESTS) $(INTDIR)\abts.obj + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) + if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;1 -testprocmutex.exe: testprocmutex.obj $(LOCAL_LIBS) - $(LINK_PROG) testprocmutex.obj $(LOCAL_LIBS) $(ALL_LIBS) -testmutexscope.exe: testmutexscope.obj $(LOCAL_LIBS) - $(LINK_PROG) testmutexscope.obj $(LOCAL_LIBS) $(ALL_LIBS) +clean: + for %f in ($(CLEAN_TARGETS)) do del /f %f + rmdir /s /q $(OUTDIR) +!IF "$(OUTDIR)" != "$(INTDIR)" + rmdir /s /q $(OUTDIR) +!ENDIF -TESTS = testutil.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ - testmmap.obj testud.obj testtable.obj testsleep.obj testpools.obj \ - testfmt.obj testfile.obj testdir.obj testfileinfo.obj testrand.obj \ - testdso.obj testoc.obj testdup.obj testsockets.obj testproc.obj \ - testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \ - testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ - testenv.obj testprocmutex.obj testfnmatch.obj testatomic.obj \ - testflock.obj testshm.obj testsock.obj testglobalmutex.obj \ - teststrnatcmp.obj testfilecopy.obj testtemp.obj testlfs.obj \ - testcond.obj -testall.exe: $(TESTS) mod_test.dll occhild.exe \ - readchild.exe abts.obj proc_child.exe \ - tryread.exe sockchild.exe globalmutexchild.exe \ - $(LOCAL_LIBS) - $(LINK_PROG) /out:testall.exe $(TESTS) abts.obj $(LOCAL_LIBS) $(ALL_LIBS) +PATH=$(OUTDIR);..\$(OUTDIR);$(PATH) +check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) + for %p in ($(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)) do @( \ + echo Testing %p && %p || echo "%p failed" \ + ) # DO NOT REMOVE diff --git a/test/testall.dsw b/test/testall.dsw index fed974c9145..d4cde7dd3cb 100644 --- a/test/testall.dsw +++ b/test/testall.dsw @@ -41,6 +41,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name libapr End Project Dependency + Begin Project Dependency + Project_Dep_Name libapr_app + End Project Dependency }}} ############################################################################### @@ -56,6 +59,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name apr End Project Dependency + Begin Project Dependency + Project_Dep_Name apr_app + End Project Dependency }}} ############################################################################### @@ -87,42 +93,6 @@ Package=<4> ############################################################################### -Project: "testapp"=".\testapp.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name apr - End Project Dependency - Begin Project Dependency - Project_Dep_Name apr_app - End Project Dependency -}}} - -############################################################################### - -Project: "testappnt"=".\testappnt.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name apr - End Project Dependency - Begin Project Dependency - Project_Dep_Name apr_app - End Project Dependency -}}} - -############################################################################### - Global: Package=<5> diff --git a/test/testapp.dsp b/test/testapp.dsp deleted file mode 100644 index 153cbd3649d..00000000000 --- a/test/testapp.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testapp" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=testapp - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testapp.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testapp.mak" CFG="testapp - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testapp - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "testapp - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testapp - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "." -# PROP BASE Intermediate_Dir "." -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /Fd"./testapp" /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console -# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console -# Begin Special Build Tool -TargetPath=.\testapp.exe -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "testapp - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "." -# PROP BASE Intermediate_Dir "." -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /Fd"./testapp" /FD /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug -# Begin Special Build Tool -TargetPath=.\testapp.exe -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "testapp - Win32 Release" -# Name "testapp - Win32 Debug" -# Begin Source File - -SOURCE=.\testapp.c -# End Source File -# End Target -# End Project diff --git a/test/testappnt.dsp b/test/testappnt.dsp deleted file mode 100644 index af21c294983..00000000000 --- a/test/testappnt.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testappnt" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=testappnt - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testappnt.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testappnt.mak" CFG="testappnt - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testappnt - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "testappnt - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testappnt - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "." -# PROP BASE Intermediate_Dir "." -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "WINNT" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "../include" /D "NDEBUG" /D "WIN32" /D "WINNT" /D "_CONSOLE" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /Fd"./testappnt" /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console -# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console -# Begin Special Build Tool -TargetPath=.\testappnt.exe -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "testappnt - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "." -# PROP BASE Intermediate_Dir "." -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /D "_DEBUG" /D "WIN32" /D "WINNT" /D "_CONSOLE" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /Fd"./testappnt" /FD /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /entry:"wmainCRTStartup" /subsystem:console /incremental:no /debug -# Begin Special Build Tool -TargetPath=.\testappnt.exe -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "testappnt - Win32 Release" -# Name "testappnt - Win32 Debug" -# Begin Source File - -SOURCE=.\testapp.c - -!IF "$(CFG)" == "testappnt - Win32 Release" - -# ADD CPP /Fo"testappnt" - -!ELSEIF "$(CFG)" == "testappnt - Win32 Debug" - -# ADD CPP /Fo"testappnt" - -!ENDIF - -# End Source File -# End Target -# End Project From 6ea0963e59e341e74b3cebb90a8464fae1d5e6d8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 7 Oct 2007 09:57:29 +0000 Subject: [PATCH 5958/7878] Refactor the build to know x64 (on Visual Studios which support it) - intended for backport, and make -DWINNT the default (not intended for backport) with new 9x compatible flavor targets. Also invoke the make test/ check from either the testdll or testlib targets of test/testall.dsw (this both builds and runs the test suite inside the studio). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@582604 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 135 ++++++++++++++++------ build/apr_app.dsp | 106 +++++++++++++++++- build/libapr_app.dsp | 106 +++++++++++++++++- libapr.dsp | 148 ++++++++++++++++++++----- test/Makefile.in | 20 +++- test/testdll.dsp | 259 +++++++++++++++++++++++++++++++------------ test/testlib.dsp | 259 +++++++++++++++++++++++++++++++------------ test/testutil.h | 2 +- 8 files changed, 820 insertions(+), 215 deletions(-) diff --git a/apr.dsp b/apr.dsp index fa6cda684ab..d4ebb55d6c5 100644 --- a/apr.dsp +++ b/apr.dsp @@ -4,7 +4,7 @@ # TARGTYPE "Win32 (x86) Static Library" 0x0104 -CFG=apr - Win32 Debug +CFG=apr - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE @@ -13,14 +13,16 @@ CFG=apr - Win32 Debug !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE -!MESSAGE NMAKE /f "apr.mak" CFG="apr - Win32 Debug" +!MESSAGE NMAKE /f "apr.mak" CFG="apr - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "apr - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "apr - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "apr - Win32 ReleaseNT" (based on "Win32 (x86) Static Library") -!MESSAGE "apr - Win32 DebugNT" (based on "Win32 (x86) Static Library") +!MESSAGE "apr - Win32 Release9x" (based on "Win32 (x86) Static Library") +!MESSAGE "apr - Win32 Debug9x" (based on "Win32 (x86) Static Library") +!MESSAGE "apr - x64 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "apr - x64 Debug" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project @@ -33,17 +35,17 @@ RSC=rc.exe !IF "$(CFG)" == "apr - Win32 Release" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Use_Debug_Releasearies 0 # PROP BASE Output_Dir "LibR" # PROP BASE Intermediate_Dir "LibR" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 +# PROP Use_Debug_Releasearies 0 # PROP Output_Dir "LibR" # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -56,18 +58,18 @@ LIB32=link.exe -lib !ELSEIF "$(CFG)" == "apr - Win32 Debug" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Use_Debug_Releasearies 1 # PROP BASE Output_Dir "LibD" # PROP BASE Intermediate_Dir "LibD" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 +# PROP Use_Debug_Releasearies 1 # PROP Output_Dir "LibD" # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /EHsc /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -77,20 +79,20 @@ LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"LibD\apr-1.lib" -!ELSEIF "$(CFG)" == "apr - Win32 ReleaseNT" +!ELSEIF "$(CFG)" == "apr - Win32 Release9x" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "LibNTR" -# PROP BASE Intermediate_Dir "LibNTR" +# PROP BASE Use_Debug_Releasearies 0 +# PROP BASE Output_Dir "9x\LibR" +# PROP BASE Intermediate_Dir "9x\LibR" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "LibNTR" -# PROP Intermediate_Dir "LibNTR" +# PROP Use_Debug_Releasearies 0 +# PROP Output_Dir "9x\LibR" +# PROP Intermediate_Dir "9x\LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"LibNTR\apr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -98,23 +100,23 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"LibNTR\apr-1.lib" +# ADD LIB32 /nologo /out:"9x\LibR\apr-1.lib" -!ELSEIF "$(CFG)" == "apr - Win32 DebugNT" +!ELSEIF "$(CFG)" == "apr - Win32 Debug9x" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "LibNTD" -# PROP BASE Intermediate_Dir "LibNTD" +# PROP BASE Use_Debug_Releasearies 1 +# PROP BASE Output_Dir "9x\LibD" +# PROP BASE Intermediate_Dir "9x\LibD" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "LibNTD" -# PROP Intermediate_Dir "LibNTD" +# PROP Use_Debug_Releasearies 1 +# PROP Output_Dir "9x\LibD" +# PROP Intermediate_Dir "9x\LibD" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"LibNTD\apr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /EHsc /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -122,7 +124,54 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"LibNTD\apr-1.lib" +# ADD LIB32 /nologo /out:"9x\LibD\apr-1.lib" + +!ELSEIF "$(CFG)" == "apr - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Releasearies 0 +# PROP BASE Output_Dir "x64\LibR" +# PROP BASE Intermediate_Dir "x64\LibR" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Releasearies 0 +# PROP Output_Dir "x64\LibR" +# PROP Intermediate_Dir "x64\LibR" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"x64\LibR\apr-1.lib" + +!ELSEIF "$(CFG)" == "apr - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Releasearies 1 +# PROP BASE Output_Dir "x64\LibD" +# PROP BASE Intermediate_Dir "x64\LibD" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Releasearies 1 +# PROP Output_Dir "x64\LibD" +# PROP Intermediate_Dir "x64\LibD" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /EHsc /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"x64\LibD\apr-1.lib" !ENDIF @@ -130,8 +179,10 @@ LIB32=link.exe -lib # Name "apr - Win32 Release" # Name "apr - Win32 Debug" -# Name "apr - Win32 ReleaseNT" -# Name "apr - Win32 DebugNT" +# Name "apr - Win32 Release9x" +# Name "apr - Win32 Debug9x" +# Name "apr - x64 Release" +# Name "apr - x64 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" @@ -562,7 +613,27 @@ InputPath=.\include\apr.hw # End Custom Build -!ELSEIF "$(CFG)" == "apr - Win32 ReleaseNT" +!ELSEIF "$(CFG)" == "apr - Win32 Release9x" + +# Begin Custom Build - Creating apr.h from apr.hw +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr.hw > .\include\apr.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - Win32 Debug9x" + +# Begin Custom Build - Creating apr.h from apr.hw +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr.hw > .\include\apr.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - x64 Release" # Begin Custom Build - Creating apr.h from apr.hw InputPath=.\include\apr.hw @@ -572,7 +643,7 @@ InputPath=.\include\apr.hw # End Custom Build -!ELSEIF "$(CFG)" == "apr - Win32 DebugNT" +!ELSEIF "$(CFG)" == "apr - x64 Debug" # Begin Custom Build - Creating apr.h from apr.hw InputPath=.\include\apr.hw diff --git a/build/apr_app.dsp b/build/apr_app.dsp index ac060a503ff..b50d83ebfc3 100644 --- a/build/apr_app.dsp +++ b/build/apr_app.dsp @@ -19,6 +19,10 @@ CFG=apr_app - Win32 Debug !MESSAGE !MESSAGE "apr_app - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "apr_app - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "apr_app - Win32 Release9x" (based on "Win32 (x86) Static Library") +!MESSAGE "apr_app - Win32 Debug9x" (based on "Win32 (x86) Static Library") +!MESSAGE "apr_app - x64 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "apr_app - x64 Debug" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project @@ -41,7 +45,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fd"LibR\apr_app_src" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr_app-1" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -65,7 +69,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fd"LibD\apr_app_src" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr_app-1" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -75,12 +79,110 @@ LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"LibD\apr_app-1.lib" +!ELSEIF "$(CFG)" == "apr_app - Win32 Release9x" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "9x\LibR" +# PROP BASE Intermediate_Dir "9x\LibR" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "9x\LibR" +# PROP Intermediate_Dir "9x\LibR" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr_app-1" /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"9x\LibR\apr_app-1.lib" + +!ELSEIF "$(CFG)" == "apr_app - Win32 Debug9x" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "9x\LibD" +# PROP BASE Intermediate_Dir "9x\LibD" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "9x\LibD" +# PROP Intermediate_Dir "9x\LibD" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr_app-1" /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"9x\LibD\apr_app-1.lib" + +!ELSEIF "$(CFG)" == "apr_app - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\LibR" +# PROP BASE Intermediate_Dir "x64\LibR" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\LibR" +# PROP Intermediate_Dir "x64\LibR" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr_app-1" /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"x64\LibR\apr_app-1.lib" + +!ELSEIF "$(CFG)" == "apr_app - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\LibD" +# PROP BASE Intermediate_Dir "x64\LibD" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\LibD" +# PROP Intermediate_Dir "x64\LibD" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr_app-1" /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"x64\LibD\apr_app-1.lib" + !ENDIF # Begin Target # Name "apr_app - Win32 Release" # Name "apr_app - Win32 Debug" +# Name "apr_app - Win32 Release9x" +# Name "apr_app - Win32 Debug9x" +# Name "apr_app - x64 Release" +# Name "apr_app - x64 Debug" # Begin Source File SOURCE=..\misc\win32\apr_app.c diff --git a/build/libapr_app.dsp b/build/libapr_app.dsp index 0cd962e5cd3..52e047ec5ef 100644 --- a/build/libapr_app.dsp +++ b/build/libapr_app.dsp @@ -19,6 +19,10 @@ CFG=libapr_app - Win32 Debug !MESSAGE !MESSAGE "libapr_app - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "libapr_app - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "libapr_app - Win32 Release9x" (based on "Win32 (x86) Static Library") +!MESSAGE "libapr_app - Win32 Debug9x" (based on "Win32 (x86) Static Library") +!MESSAGE "libapr_app - x64 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libapr_app - x64 Debug" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project @@ -41,7 +45,7 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"Release\libapr_app_src" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libapr_app-1" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -65,7 +69,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fd"Debug\libapr_app_src" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libapr_app-1" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -75,12 +79,110 @@ LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"Debug\libapr_app-1.lib" +!ELSEIF "$(CFG)" == "libapr_app - Win32 Release9x" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "9x\Release" +# PROP BASE Intermediate_Dir "9x\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "9x\Release" +# PROP Intermediate_Dir "9x\Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libapr_app-1" /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"9x\Release\libapr_app-1.lib" + +!ELSEIF "$(CFG)" == "libapr_app - Win32 Debug9x" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "9x\Debug" +# PROP BASE Intermediate_Dir "9x\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "9x\Debug" +# PROP Intermediate_Dir "9x\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libapr_app-1" /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"9x\Debug\libapr_app-1.lib" + +!ELSEIF "$(CFG)" == "libapr_app - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\Release" +# PROP BASE Intermediate_Dir "x64\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\Release" +# PROP Intermediate_Dir "x64\Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libapr_app-1" /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"x64\Release\libapr_app-1.lib" + +!ELSEIF "$(CFG)" == "libapr_app - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\Debug" +# PROP BASE Intermediate_Dir "x64\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\Debug" +# PROP Intermediate_Dir "x64\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libapr_app-1" /FD /c +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"x64\Debug\libapr_app-1.lib" + !ENDIF # Begin Target # Name "libapr_app - Win32 Release" # Name "libapr_app - Win32 Debug" +# Name "libapr_app - Win32 Release9x" +# Name "libapr_app - Win32 Debug9x" +# Name "libapr_app - x64 Release" +# Name "libapr_app - x64 Debug" # Begin Source File SOURCE=..\misc\win32\apr_app.c diff --git a/libapr.dsp b/libapr.dsp index cb12e13238e..62aba05a445 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -4,7 +4,7 @@ # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 -CFG=libapr - Win32 Debug +CFG=libapr - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE @@ -13,14 +13,16 @@ CFG=libapr - Win32 Debug !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE -!MESSAGE NMAKE /f "libapr.mak" CFG="libapr - Win32 Debug" +!MESSAGE NMAKE /f "libapr.mak" CFG="libapr - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "libapr - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libapr - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libapr - Win32 ReleaseNT" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libapr - Win32 DebugNT" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libapr - Win32 Release9x" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libapr - Win32 Debug9x" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libapr - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libapr - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project @@ -45,7 +47,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libapr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -55,9 +57,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\Release\libapr-1.dll" /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"Release\libapr-1.dll" /pdb:"Release\libapr-1.pdb" /implib:"Release\libapr-1.lib" /MACHINE:X86 /opt:ref # Begin Special Build Tool -TargetPath=.\Release\libapr-1.dll +TargetPath=Release\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -77,7 +79,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -87,29 +89,29 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\Debug\libapr-1.dll" +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\libapr-1.dll" /pdb:"Debug\libapr-1.pdb" /implib:"Debug\libapr-1.lib" /MACHINE:X86 # Begin Special Build Tool -TargetPath=.\Debug\libapr-1.dll +TargetPath=Debug\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 # End Special Build Tool -!ELSEIF "$(CFG)" == "libapr - Win32 ReleaseNT" +!ELSEIF "$(CFG)" == "libapr - Win32 Release9x" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ReleaseNT" -# PROP BASE Intermediate_Dir "ReleaseNT" +# PROP BASE Output_Dir "9x\Release" +# PROP BASE Intermediate_Dir "9x\Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ReleaseNT" -# PROP Intermediate_Dir "ReleaseNT" +# PROP Output_Dir "9x\Release" +# PROP Intermediate_Dir "9x\Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"ReleaseNT\libapr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -119,29 +121,29 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\ReleaseNT\libapr-1.dll" /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"9x\Release\libapr-1.dll" /pdb:"9x\Release\libapr-1.pdb" /implib:"9x\Release\libapr-1.lib" /MACHINE:X86 /opt:ref # Begin Special Build Tool -TargetPath=.\ReleaseNT\libapr.dll +TargetPath=9x\Release\libapr.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 # End Special Build Tool -!ELSEIF "$(CFG)" == "libapr - Win32 DebugNT" +!ELSEIF "$(CFG)" == "libapr - Win32 Debug9x" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "DebugNT" -# PROP BASE Intermediate_Dir "DebugNT" +# PROP BASE Output_Dir "9x\Debug" +# PROP BASE Intermediate_Dir "9x\Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "DebugNT" -# PROP Intermediate_Dir "DebugNT" +# PROP Output_Dir "9x\Debug" +# PROP Intermediate_Dir "9x\Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fd"DebugNT\libapr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -151,9 +153,73 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:".\DebugNT\libapr-1.dll" +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"9x\Debug\libapr-1.dll" /pdb:"9x\Debug\libapr-1.pdb" /implib:"9x\Debug\libapr-1.lib" /MACHINE:X86 # Begin Special Build Tool -TargetPath=.\DebugNT\libapr-1.dll +TargetPath=9x\Debug\libapr-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "libapr - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\Release" +# PROP BASE Intermediate_Dir "x64\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\Release" +# PROP Intermediate_Dir "x64\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /i "./include" /d "NDEBUG" /d "APR_VERSION_ONLY" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\libapr-1.dll" /pdb:"x64\Release\libapr-1.pdb" /implib:"x64\Release\libapr-1.lib" /MACHINE:X64 /opt:ref +# Begin Special Build Tool +TargetPath=x64\Release\libapr-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "libapr - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\Debug" +# PROP BASE Intermediate_Dir "x64\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\Debug" +# PROP Intermediate_Dir "x64\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /i "./include" /d "_DEBUG" /d "APR_VERSION_ONLY" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\libapr-1.dll" /pdb:"x64\Debug\libapr-1.pdb" /implib:"x64\Debug\libapr-1.lib" /MACHINE:X64 +# Begin Special Build Tool +TargetPath=x64\Debug\libapr-1.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -165,8 +231,10 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # Name "libapr - Win32 Release" # Name "libapr - Win32 Debug" -# Name "libapr - Win32 ReleaseNT" -# Name "libapr - Win32 DebugNT" +# Name "libapr - Win32 Release9x" +# Name "libapr - Win32 Debug9x" +# Name "libapr - x64 Release" +# Name "libapr - x64 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" @@ -597,7 +665,27 @@ InputPath=.\include\apr.hw # End Custom Build -!ELSEIF "$(CFG)" == "libapr - Win32 ReleaseNT" +!ELSEIF "$(CFG)" == "libapr - Win32 Release9x" + +# Begin Custom Build - Creating apr.h from apr.hw +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr.hw > .\include\apr.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug9x" + +# Begin Custom Build - Creating apr.h from apr.hw +InputPath=.\include\apr.hw + +".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr.hw > .\include\apr.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Release" # Begin Custom Build - Creating apr.h from apr.hw InputPath=.\include\apr.hw @@ -607,7 +695,7 @@ InputPath=.\include\apr.hw # End Custom Build -!ELSEIF "$(CFG)" == "libapr - Win32 DebugNT" +!ELSEIF "$(CFG)" == "libapr - x64 Debug" # Begin Custom Build - Creating apr.h from apr.hw InputPath=.\include\apr.hw diff --git a/test/Makefile.in b/test/Makefile.in index 20d3485bcc1..52c9fa2bcd4 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -22,7 +22,18 @@ OTHER_PROGRAMS = \ echod@EXEEXT@ \ sockperf@EXEEXT@ -PROGRAMS = $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS) +TESTALL_COMPONENTS = \ + mod_test.la \ + libmod_test.la \ + occhild@EXEEXT@ \ + readchild@EXEEXT@ + proc_child@EXEEXT@ \ + tryread@EXEEXT@ \ + sockchild@EXEEXT@ \ + globalmutexchild@EXEEXT@ + + +PROGRAMS = $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS) TARGETS = $(PROGRAMS) @@ -44,7 +55,7 @@ INCLUDES=-I$(INCDIR) -I$(srcdir)/../include # libtool wrapper scripts which link an executable when first run. LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@ -check: $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) +check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) teststatus=0; \ progfailed=""; \ for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \ @@ -122,10 +133,7 @@ TESTS = testutil.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testshm.lo testsock.lo testglobalmutex.lo teststrnatcmp.lo testfilecopy.lo \ testtemp.lo testlfs.lo testcond.lo -testall@EXEEXT@: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ - readchild@EXEEXT@ abts.lo proc_child@EXEEXT@ \ - tryread@EXEEXT@ sockchild@EXEEXT@ globalmutexchild@EXEEXT@ \ - $(LOCAL_LIBS) +testall@EXEEXT@: $(TESTS) abts.lo $(LINK_PROG) $(TESTS) abts.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/testdll.dsp b/test/testdll.dsp index 47709f4862f..aadf8821151 100644 --- a/test/testdll.dsp +++ b/test/testdll.dsp @@ -1,24 +1,28 @@ -# Microsoft Developer Studio Project File - Name="testall" - Package Owner=<4> +# Microsoft Developer Studio Project File - Name="testdll" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) External Target" 0x0106 -CFG=testall - Win32 Debug +CFG=testdll - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE -!MESSAGE NMAKE /f "testall.mak". +!MESSAGE NMAKE /f "testdll.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE -!MESSAGE NMAKE /f "testall.mak" CFG="testall - Win32 Debug" +!MESSAGE NMAKE /f "testdll.mak" CFG="testdll - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "testall - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "testall - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE "testdll - Win32 Release" (based on "Win32 (x86) External Target") +!MESSAGE "testdll - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE "testdll - Win32 Release9x" (based on "Win32 (x86) External Target") +!MESSAGE "testdll - Win32 Debug9x" (based on "Win32 (x86) External Target") +!MESSAGE "testdll - x64 Release" (based on "Win32 (x86) External Target") +!MESSAGE "testdll - x64 Debug" (based on "Win32 (x86) External Target") !MESSAGE # Begin Project @@ -26,104 +30,156 @@ CFG=testall - Win32 Debug # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -!IF "$(CFG)" == "testall - Win32 Release" +!IF "$(CFG)" == "testdll - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win all" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=Release OUTDIR=Release MODEL=dynamic check" # PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "testall.exe" -# PROP BASE Bsc_Name "testall.bsc" +# PROP BASE Target_File "Release\testall.exe" +# PROP BASE Bsc_Name "" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win all" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=Release OUTDIR=Release MODEL=dynamic check" # PROP Rebuild_Opt "/a" -# PROP Target_File "testall.exe" +# PROP Target_File "Release\testall.exe" # PROP Bsc_Name "" # PROP Target_Dir "" -!ELSEIF "$(CFG)" == "testall - Win32 Debug" +!ELSEIF "$(CFG)" == "testdll - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win all" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=Debug OUTDIR=Debug MODEL=dynamic _DEBUG=1 check" # PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "testall.exe" -# PROP BASE Bsc_Name "testall.bsc" +# PROP BASE Target_File "Debug\testall.exe" +# PROP BASE Bsc_Name "" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win all" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=Debug OUTDIR=Debug MODEL=dynamic _DEBUG=1 check" # PROP Rebuild_Opt "/a" -# PROP Target_File "testall.exe" +# PROP Target_File "Debug\testall.exe" # PROP Bsc_Name "" # PROP Target_Dir "" -!ENDIF - -# Begin Target +!IF "$(CFG)" == "testdll - Win32 Release9x" -# Name "testall - Win32 Release" -# Name "testall - Win32 Debug" - -!IF "$(CFG)" == "testall - Win32 Release" - -!ELSEIF "$(CFG)" == "testall - Win32 Debug" +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Release OUTDIR=9x\Release MODEL=dynamic check" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "9x\Release\testall.exe" +# PROP BASE Bsc_Name "" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Release OUTDIR=9x\Release MODEL=dynamic check" +# PROP Rebuild_Opt "/a" +# PROP Target_File "9x\Release\testall.exe" +# PROP Bsc_Name "" +# PROP Target_Dir "" -!ENDIF +!ELSEIF "$(CFG)" == "testdll - Win32 Debug9x" -# Begin Source File +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Debug OUTDIR=9x\Debug MODEL=dynamic _DEBUG=1 check" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "9x\Debug\testall.exe" +# PROP BASE Bsc_Name "" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Debug OUTDIR=9x\Debug MODEL=dynamic _DEBUG=1 check" +# PROP Rebuild_Opt "/a" +# PROP Target_File "9x\Debug\testall.exe" +# PROP Bsc_Name "" +# PROP Target_Dir "" -SOURCE=.\abts.c -# End Source File -# Begin Source File +!IF "$(CFG)" == "testdll - x64 Release" -SOURCE=.\abts.h -# End Source File -# Begin Source File +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Release OUTDIR=x64\Release MODEL=dynamic check" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "x64\Release\testall.exe" +# PROP BASE Bsc_Name "" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Release OUTDIR=x64\Release MODEL=dynamic check" +# PROP Rebuild_Opt "/a" +# PROP Target_File "x64\Release\testall.exe" +# PROP Bsc_Name "" +# PROP Target_Dir "" -SOURCE=.\globalmutexchild.c -# End Source File -# Begin Source File +!ELSEIF "$(CFG)" == "testdll - x64 Debug" -SOURCE=.\Makefile.win -# End Source File -# Begin Source File +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Debug OUTDIR=x64\Debug MODEL=dynamic _DEBUG=1 check" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "x64\Debug\testall.exe" +# PROP BASE Bsc_Name "" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Debug OUTDIR=x64\Debug MODEL=dynamic _DEBUG=1 check" +# PROP Rebuild_Opt "/a" +# PROP Target_File "x64\Debug\testall.exe" +# PROP Bsc_Name "" +# PROP Target_Dir "" -SOURCE=.\mod_test.c -# End Source File -# Begin Source File +!ENDIF -SOURCE=.\nw_misc.c -# End Source File -# Begin Source File +# Begin Target -SOURCE=.\occhild.c -# End Source File -# Begin Source File +# Name "testdll - Win32 Release" +# Name "testdll - Win32 Debug" +# Name "testdll - Win32 Release9x" +# Name "testdll - Win32 Debug9x" +# Name "testdll - x64 Release" +# Name "testdll - x64 Debug" +# Begin Group "testall Source Files" -SOURCE=.\proc_child.c -# End Source File +# PROP Default_Filter ".c" # Begin Source File -SOURCE=.\readchild.c +SOURCE=.\abts.c # End Source File # Begin Source File -SOURCE=.\sendfile.c +SOURCE=.\abts.h # End Source File # Begin Source File -SOURCE=.\sockchild.c +SOURCE=.\abts_tests.h # End Source File # Begin Source File @@ -175,6 +231,10 @@ SOURCE=.\testflock.c # End Source File # Begin Source File +SOURCE=.\testflock.h +# End Source File +# Begin Source File + SOURCE=.\testfmt.c # End Source File # Begin Source File @@ -187,6 +247,10 @@ SOURCE=.\testglobalmutex.c # End Source File # Begin Source File +SOURCE=.\testglobalmutex.h +# End Source File +# Begin Source File + SOURCE=.\testhash.c # End Source File # Begin Source File @@ -203,18 +267,10 @@ SOURCE=.\testlock.c # End Source File # Begin Source File -SOURCE=.\testlockperf.c -# End Source File -# Begin Source File - SOURCE=.\testmmap.c # End Source File # Begin Source File -SOURCE=.\testmutexscope.c -# End Source File -# Begin Source File - SOURCE=.\testnames.c # End Source File # Begin Source File @@ -243,10 +299,6 @@ SOURCE=.\testproc.c # End Source File # Begin Source File -SOURCE=.\testprocmutex.c -# End Source File -# Begin Source File - SOURCE=.\testrand.c # End Source File # Begin Source File @@ -255,19 +307,19 @@ SOURCE=.\testshm.c # End Source File # Begin Source File -SOURCE=.\testshmconsumer.c +SOURCE=.\testshm.h # End Source File # Begin Source File -SOURCE=.\testshmproducer.c +SOURCE=.\testsleep.c # End Source File # Begin Source File -SOURCE=.\testsleep.c +SOURCE=.\testsock.c # End Source File # Begin Source File -SOURCE=.\testsock.c +SOURCE=.\testsock.h # End Source File # Begin Source File @@ -315,11 +367,76 @@ SOURCE=.\testutil.c # End Source File # Begin Source File +SOURCE=.\testutil.h +# End Source File +# Begin Source File + SOURCE=.\testvsn.c # End Source File +# End Group +# Begin Group "Other Source Files" + +# PROP Default_Filter ".c" +# Begin Source File + +SOURCE=.\globalmutexchild.c +# End Source File +# Begin Source File + +SOURCE=.\mod_test.c +# End Source File +# Begin Source File + +SOURCE=.\nw_misc.c +# End Source File +# Begin Source File + +SOURCE=.\occhild.c +# End Source File +# Begin Source File + +SOURCE=.\proc_child.c +# End Source File +# Begin Source File + +SOURCE=.\readchild.c +# End Source File +# Begin Source File + +SOURCE=.\sendfile.c +# End Source File +# Begin Source File + +SOURCE=.\sockchild.c +# End Source File +# Begin Source File + +SOURCE=.\testlockperf.c +# End Source File +# Begin Source File + +SOURCE=.\testmutexscope.c +# End Source File +# Begin Source File + +SOURCE=.\testprocmutex.c +# End Source File +# Begin Source File + +SOURCE=.\testshmconsumer.c +# End Source File +# Begin Source File + +SOURCE=.\testshmproducer.c +# End Source File # Begin Source File SOURCE=.\tryread.c # End Source File +# End Group +# Begin Source File + +SOURCE=.\Makefile.win +# End Source File # End Target # End Project diff --git a/test/testlib.dsp b/test/testlib.dsp index 47709f4862f..ff58f8298f4 100644 --- a/test/testlib.dsp +++ b/test/testlib.dsp @@ -1,24 +1,28 @@ -# Microsoft Developer Studio Project File - Name="testall" - Package Owner=<4> +# Microsoft Developer Studio Project File - Name="testlib" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) External Target" 0x0106 -CFG=testall - Win32 Debug +CFG=testlib - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE -!MESSAGE NMAKE /f "testall.mak". +!MESSAGE NMAKE /f "testlib.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE -!MESSAGE NMAKE /f "testall.mak" CFG="testall - Win32 Debug" +!MESSAGE NMAKE /f "testlib.mak" CFG="testlib - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "testall - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "testall - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE "testlib - Win32 Release" (based on "Win32 (x86) External Target") +!MESSAGE "testlib - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE "testlib - Win32 Release9x" (based on "Win32 (x86) External Target") +!MESSAGE "testlib - Win32 Debug9x" (based on "Win32 (x86) External Target") +!MESSAGE "testlib - x64 Release" (based on "Win32 (x86) External Target") +!MESSAGE "testlib - x64 Debug" (based on "Win32 (x86) External Target") !MESSAGE # Begin Project @@ -26,104 +30,156 @@ CFG=testall - Win32 Debug # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -!IF "$(CFG)" == "testall - Win32 Release" +!IF "$(CFG)" == "testlib - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win all" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=LibR OUTDIR=LibR MODEL=static check" # PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "testall.exe" -# PROP BASE Bsc_Name "testall.bsc" +# PROP BASE Target_File "LibR\testall.exe" +# PROP BASE Bsc_Name "" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win all" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=LibR OUTDIR=LibR MODEL=static check" # PROP Rebuild_Opt "/a" -# PROP Target_File "testall.exe" +# PROP Target_File "LibR\testall.exe" # PROP Bsc_Name "" # PROP Target_Dir "" -!ELSEIF "$(CFG)" == "testall - Win32 Debug" +!ELSEIF "$(CFG)" == "testlib - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win all" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=LibD OUTDIR=LibD MODEL=static _DEBUG=1 check" # PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "testall.exe" -# PROP BASE Bsc_Name "testall.bsc" +# PROP BASE Target_File "LibD\testall.exe" +# PROP BASE Bsc_Name "" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win all" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=LibD OUTDIR=LibD MODEL=static _DEBUG=1 check" # PROP Rebuild_Opt "/a" -# PROP Target_File "testall.exe" +# PROP Target_File "LibD\testall.exe" # PROP Bsc_Name "" # PROP Target_Dir "" -!ENDIF - -# Begin Target +!IF "$(CFG)" == "testlib - Win32 Release9x" -# Name "testall - Win32 Release" -# Name "testall - Win32 Debug" - -!IF "$(CFG)" == "testall - Win32 Release" - -!ELSEIF "$(CFG)" == "testall - Win32 Debug" +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibR OUTDIR=9x\LibR MODEL=static check" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "9x\LibR\testall.exe" +# PROP BASE Bsc_Name "" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibR OUTDIR=9x\LibR MODEL=static check" +# PROP Rebuild_Opt "/a" +# PROP Target_File "9x\LibR\testall.exe" +# PROP Bsc_Name "" +# PROP Target_Dir "" -!ENDIF +!ELSEIF "$(CFG)" == "testlib - Win32 Debug9x" -# Begin Source File +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibD OUTDIR=9x\LibD MODEL=static _DEBUG=1 check" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "9x\LibD\testall.exe" +# PROP BASE Bsc_Name "" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibD OUTDIR=9x\LibD MODEL=static _DEBUG=1 check" +# PROP Rebuild_Opt "/a" +# PROP Target_File "9x\LibD\testall.exe" +# PROP Bsc_Name "" +# PROP Target_Dir "" -SOURCE=.\abts.c -# End Source File -# Begin Source File +!IF "$(CFG)" == "testlib - x64 Release" -SOURCE=.\abts.h -# End Source File -# Begin Source File +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibR OUTDIR=x64\LibR MODEL=static check" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "x64\LibR\testall.exe" +# PROP BASE Bsc_Name "" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibR OUTDIR=x64\LibR MODEL=static check" +# PROP Rebuild_Opt "/a" +# PROP Target_File "x64\LibR\testall.exe" +# PROP Bsc_Name "" +# PROP Target_Dir "" -SOURCE=.\globalmutexchild.c -# End Source File -# Begin Source File +!ELSEIF "$(CFG)" == "testlib - x64 Debug" -SOURCE=.\Makefile.win -# End Source File -# Begin Source File +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibD OUTDIR=x64\LibD MODEL=static _DEBUG=1 check" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "x64\LibD\testall.exe" +# PROP BASE Bsc_Name "" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibD OUTDIR=x64\LibD MODEL=static _DEBUG=1 check" +# PROP Rebuild_Opt "/a" +# PROP Target_File "x64\LibD\testall.exe" +# PROP Bsc_Name "" +# PROP Target_Dir "" -SOURCE=.\mod_test.c -# End Source File -# Begin Source File +!ENDIF -SOURCE=.\nw_misc.c -# End Source File -# Begin Source File +# Begin Target -SOURCE=.\occhild.c -# End Source File -# Begin Source File +# Name "testlib - Win32 Release" +# Name "testlib - Win32 Debug" +# Name "testlib - Win32 Release9x" +# Name "testlib - Win32 Debug9x" +# Name "testlib - x64 Release" +# Name "testlib - x64 Debug" +# Begin Group "testall Source Files" -SOURCE=.\proc_child.c -# End Source File +# PROP Default_Filter ".c" # Begin Source File -SOURCE=.\readchild.c +SOURCE=.\abts.c # End Source File # Begin Source File -SOURCE=.\sendfile.c +SOURCE=.\abts.h # End Source File # Begin Source File -SOURCE=.\sockchild.c +SOURCE=.\abts_tests.h # End Source File # Begin Source File @@ -175,6 +231,10 @@ SOURCE=.\testflock.c # End Source File # Begin Source File +SOURCE=.\testflock.h +# End Source File +# Begin Source File + SOURCE=.\testfmt.c # End Source File # Begin Source File @@ -187,6 +247,10 @@ SOURCE=.\testglobalmutex.c # End Source File # Begin Source File +SOURCE=.\testglobalmutex.h +# End Source File +# Begin Source File + SOURCE=.\testhash.c # End Source File # Begin Source File @@ -203,18 +267,10 @@ SOURCE=.\testlock.c # End Source File # Begin Source File -SOURCE=.\testlockperf.c -# End Source File -# Begin Source File - SOURCE=.\testmmap.c # End Source File # Begin Source File -SOURCE=.\testmutexscope.c -# End Source File -# Begin Source File - SOURCE=.\testnames.c # End Source File # Begin Source File @@ -243,10 +299,6 @@ SOURCE=.\testproc.c # End Source File # Begin Source File -SOURCE=.\testprocmutex.c -# End Source File -# Begin Source File - SOURCE=.\testrand.c # End Source File # Begin Source File @@ -255,19 +307,19 @@ SOURCE=.\testshm.c # End Source File # Begin Source File -SOURCE=.\testshmconsumer.c +SOURCE=.\testshm.h # End Source File # Begin Source File -SOURCE=.\testshmproducer.c +SOURCE=.\testsleep.c # End Source File # Begin Source File -SOURCE=.\testsleep.c +SOURCE=.\testsock.c # End Source File # Begin Source File -SOURCE=.\testsock.c +SOURCE=.\testsock.h # End Source File # Begin Source File @@ -315,11 +367,76 @@ SOURCE=.\testutil.c # End Source File # Begin Source File +SOURCE=.\testutil.h +# End Source File +# Begin Source File + SOURCE=.\testvsn.c # End Source File +# End Group +# Begin Group "Other Source Files" + +# PROP Default_Filter ".c" +# Begin Source File + +SOURCE=.\globalmutexchild.c +# End Source File +# Begin Source File + +SOURCE=.\mod_test.c +# End Source File +# Begin Source File + +SOURCE=.\nw_misc.c +# End Source File +# Begin Source File + +SOURCE=.\occhild.c +# End Source File +# Begin Source File + +SOURCE=.\proc_child.c +# End Source File +# Begin Source File + +SOURCE=.\readchild.c +# End Source File +# Begin Source File + +SOURCE=.\sendfile.c +# End Source File +# Begin Source File + +SOURCE=.\sockchild.c +# End Source File +# Begin Source File + +SOURCE=.\testlockperf.c +# End Source File +# Begin Source File + +SOURCE=.\testmutexscope.c +# End Source File +# Begin Source File + +SOURCE=.\testprocmutex.c +# End Source File +# Begin Source File + +SOURCE=.\testshmconsumer.c +# End Source File +# Begin Source File + +SOURCE=.\testshmproducer.c +# End Source File # Begin Source File SOURCE=.\tryread.c # End Source File +# End Group +# Begin Source File + +SOURCE=.\Makefile.win +# End Source File # End Target # End Project diff --git a/test/testutil.h b/test/testutil.h index 5281341c3ec..ee68dfb0529 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -26,7 +26,7 @@ */ #ifdef WIN32 -ifdef BINPATH +#ifdef BINPATH #define TESTBINPATH APR_STRINGIFY(BINPATH) "/" #else #define TESTBINPATH "" From f7c3d258d7f874b9e8a60275c2bb0ba339919058 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 7 Oct 2007 10:00:13 +0000 Subject: [PATCH 5959/7878] Finish refactoring to prefer Win32 Release. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@582605 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_app.dsp | 4 ++-- build/libapr_app.dsp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/apr_app.dsp b/build/apr_app.dsp index b50d83ebfc3..62a76d46f62 100644 --- a/build/apr_app.dsp +++ b/build/apr_app.dsp @@ -4,7 +4,7 @@ # TARGTYPE "Win32 (x86) Static Library" 0x0104 -CFG=apr_app - Win32 Debug +CFG=apr_app - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE @@ -13,7 +13,7 @@ CFG=apr_app - Win32 Debug !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE -!MESSAGE NMAKE /f "apr_app.mak" CFG="apr_app - Win32 Debug" +!MESSAGE NMAKE /f "apr_app.mak" CFG="apr_app - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE diff --git a/build/libapr_app.dsp b/build/libapr_app.dsp index 52e047ec5ef..6004045e0df 100644 --- a/build/libapr_app.dsp +++ b/build/libapr_app.dsp @@ -4,7 +4,7 @@ # TARGTYPE "Win32 (x86) Static Library" 0x0104 -CFG=libapr_app - Win32 Debug +CFG=libapr_app - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE @@ -13,7 +13,7 @@ CFG=libapr_app - Win32 Debug !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE -!MESSAGE NMAKE /f "libapr_app.mak" CFG="libapr_app - Win32 Debug" +!MESSAGE NMAKE /f "libapr_app.mak" CFG="libapr_app - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE From ae1350244797468ce6825bf8eeccc9d2bdd841b8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 8 Oct 2007 01:39:59 +0000 Subject: [PATCH 5960/7878] zero bytes is a LEGAL length of an envvar value (also fix a minor spelling error) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@582701 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/env.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/misc/win32/env.c b/misc/win32/env.c index abb983d7158..644f59b8801 100644 --- a/misc/win32/env.c +++ b/misc/win32/env.c @@ -78,12 +78,9 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, wvalue = apr_palloc(pool, size * sizeof(*wvalue)); size = GetEnvironmentVariableW(wenvvar, wvalue, size); - if (size == 0) - /* Mid-air collision?. Somebody must've changed the env. var. */ - return APR_INCOMPLETE; inchars = wcslen(wvalue) + 1; - outchars = 3 * inchars; /* Enougn for any UTF-8 representation */ + outchars = 3 * inchars; /* Enough for any UTF-8 representation */ val = apr_palloc(pool, outchars); status = apr_conv_ucs2_to_utf8(wvalue, &inchars, val, &outchars); if (status) From e9a481e22ad1bc028ecb41a541c7b604a83dda41 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 8 Oct 2007 23:59:13 +0000 Subject: [PATCH 5961/7878] apr_file_write() on Windows: Fix return code when writing to a non- blocking pipe would have blocked. The read equivalent already used APR_EAGAIN. This fixes a discrepancy with the Unix implementation. PR: 43563 Submitted by: Eric Covener Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@583012 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ file_io/win32/readwrite.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index cecb9e39c6e..3a2566a33c4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@  -*- coding: utf-8 -*- Changes for APR 1.3.0 + *) apr_file_write() on Windows: Fix return code when writing to a non- + blocking pipe would have blocked. PR 43563. + [Eric Covener ] + *) Introduce APR_NO_FILE as an option to apr_procattr_io_set() for any of the three stdio streams to cause the corresponding streams to be closed to the child process. This becomes effective in 1.3.0 across diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 0a8af6b2090..7aad713c3c9 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -354,7 +354,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = APR_SUCCESS; break; case WAIT_TIMEOUT: - rv = APR_TIMEUP; + rv = (timeout_ms == 0) ? APR_EAGAIN : APR_TIMEUP; break; case WAIT_FAILED: rv = apr_get_os_error(); From 771d850bfae91543231095fe0b0f41e7c6cab8b1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 9 Oct 2007 01:47:11 +0000 Subject: [PATCH 5962/7878] We don't actually want to compare files, here's a sequencer to run both series utf-8 and ucs-2 in parallel and look for anomilies. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@583033 13f79535-47bb-0310-9956-ffa450edef68 --- test/internal/testucs.c | 133 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 128 insertions(+), 5 deletions(-) diff --git a/test/internal/testucs.c b/test/internal/testucs.c index ca735d233bf..abfa21218d5 100644 --- a/test/internal/testucs.c +++ b/test/internal/testucs.c @@ -18,6 +18,7 @@ #include "arch/win32/apr_arch_utf8.h" #include #include +#include struct testval { unsigned char n[8]; @@ -32,17 +33,18 @@ void displaynw(struct testval *f, struct testval *l) int i; for (i = 0; i < f->nl; ++i) t += sprintf(t, "%02X ", f->n[i]); - *(t++) = '-'; + *(t++) = '-'; for (i = 0; i < l->nl; ++i) t += sprintf(t, " %02X", l->n[i]); *(t++) = ' '; *(t++) = '='; - *(t++) = ' '; + *(t++) = ' '; for (i = 0; i < f->wl; ++i) t += sprintf(t, "%04X ", f->w[i]); *(t++) = '-'; for (i = 0; i < l->wl; ++i) t += sprintf(t, " %04X", l->w[i]); + *t = '\0'; puts(x); } @@ -154,23 +156,144 @@ void test_wrange(struct testval *p) } while (++s.w[s.wl - 1]); } +/* + * Test every possible byte value. + * If the test passes or fails at this byte value we are done. + * Otherwise iterate test_nrange again, appending another byte. + */ +void test_ranges() +{ + struct testval ntest, wtest; + apr_status_t nrc, wrc; + apr_size_t inlen; + unsigned long matches = 0; + + memset(&ntest, 0, sizeof(ntest)); + ++ntest.nl; + + memset(&wtest, 0, sizeof(wtest)); + ++wtest.wl; + + do { + do { + inlen = ntest.nl; + ntest.wl = sizeof(ntest.w) / 2; + nrc = apr_conv_utf8_to_ucs2(ntest.n, &inlen, ntest.w, &ntest.wl); + if (nrc == APR_SUCCESS) { + ntest.wl = (sizeof(ntest.w) / 2) - ntest.wl; + break; + } + if (nrc == APR_INCOMPLETE) { + ++ntest.nl; + if (ntest.nl > 6) { + printf ("\n\nUnexpected utf8 sequence of >6 bytes;\n"); + exit(255); + } + continue; + } + else { + while (!(++ntest.n[ntest.nl - 1])) { + if (!(--ntest.nl)) + break; + } + } + } while (ntest.nl); + + do { + inlen = wtest.wl; + wtest.nl = sizeof(wtest.n); + wrc = apr_conv_ucs2_to_utf8(wtest.w, &inlen, wtest.n, &wtest.nl); + if (wrc == APR_SUCCESS) { + wtest.nl = sizeof(wtest.n) - wtest.nl; + break; + } + else { + if (!(++wtest.w[wtest.wl - 1])) { + if (wtest.wl == 1) + ++wtest.wl; + else + ++wtest.w[0]; + + /* On the second pass, ensure lead word is incomplete */ + do { + inlen = 1; + wtest.nl = sizeof(wtest.n); + if (apr_conv_ucs2_to_utf8(wtest.w, &inlen, wtest.n, &wtest.nl) + == APR_INCOMPLETE) + break; + if (!(++wtest.w[0])) { + wtest.wl = 0; + break; + } + } while (1); + } + } + } while (wtest.wl); + + if (!ntest.nl && !wtest.wl) + break; + + /* Identical? */ + if ((wtest.nl != ntest.nl) + || (memcmp(wtest.n, ntest.n, ntest.nl) != 0) + || (wtest.wl != ntest.wl) + || (memcmp(ntest.w, wtest.w, wtest.wl * 2) != 0)) { + printf ("\n\nMismatch of w/n conversion at;\n"); + displaynw(&ntest, &wtest); + exit(255); + } + ++matches; + + while (!(++ntest.n[ntest.nl - 1])) { + if (!(--ntest.nl)) + break; + } + + if (!(++wtest.w[wtest.wl - 1])) { + if (wtest.wl == 1) + ++wtest.wl; + else + ++wtest.w[0]; + + /* On the second pass, ensure lead word is incomplete */ + do { + inlen = 1; + wtest.nl = sizeof(wtest.n); + if (apr_conv_ucs2_to_utf8(wtest.w, &inlen, wtest.n, &wtest.nl) + == APR_INCOMPLETE) + break; + if (!(++wtest.w[0])) { + wtest.wl = 0; + break; + } + } while (1); + } + } while (wtest.wl || ntest.nl); + + printf ("\n\nutf8 and ucs2 sequences of %lu transformations matched OK.\n", + matches); +} + /* * Syntax: testucs [w|n] * - * If arg is not recognized, run both tests. + * If no arg or arg is not recognized, run equality sequence test. */ int main(int argc, char **argv) { struct testval s; memset (&s, 0, sizeof(s)); - if (argc < 2 || apr_tolower(*argv[1]) != 'w') { + if (argc >= 2 && apr_tolower(*argv[1]) != 'w') { printf ("\n\nTesting Narrow Char Ranges\n"); test_nrange(&s); } - if (argc < 2 || apr_tolower(*argv[1]) != 'n') { + else if (argc >= 2 && apr_tolower(*argv[1]) != 'n') { printf ("\n\nTesting Wide Char Ranges\n"); test_wrange(&s); } + else { + test_ranges(); + } return 0; } From 8b084bac1ea9bdf2c9a243cec34577b2c30b9f8f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 9 Oct 2007 02:07:33 +0000 Subject: [PATCH 5963/7878] Hook up internal/Makefile.win similarly to internal/Makefile.in on unix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@583035 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 48 ++++++++++------- test/internal/Makefile.win | 107 +++++++++++++++++++++++++++++++++++++ 2 files changed, 137 insertions(+), 18 deletions(-) create mode 100644 test/internal/Makefile.win diff --git a/test/Makefile.win b/test/Makefile.win index 027712bf223..00dc0c56517 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -77,9 +77,11 @@ ALL_TESTS = $(INTDIR)\testutil.obj $(INTDIR)\testtime.obj $(INTDIR)\teststr.obj $(INTDIR)\testfilecopy.obj $(INTDIR)\testtemp.obj $(INTDIR)\testlfs.obj \ $(INTDIR)\testcond.obj -CLEAN_TARGETS = testfile.tmp lfstests/large.bin \ - data/testputs.txt data/testbigfprintf.dat \ - data/testwritev.txt data/testwritev_full.txt +CLEAN_DATA = testfile.tmp lfstests\large.bin \ + data\testputs.txt data\testbigfprintf.dat \ + data\testwritev.txt data\testwritev_full.txt +CLEAN_SUBDIRS = internal +CLEAN_BUILDDIRS = Debug Release LibD LibR 9x x64 PROGRAMS = $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS) @@ -88,8 +90,6 @@ TARGETS = $(PROGRAMS) # bring in rules.mk for standard functionality ALL: $(TARGETS) -clean: - CL = cl.exe LD = link.exe @@ -127,45 +127,57 @@ SHLDFLAGS = /nologo /dll /debug /subsystem:windows /incremental:no .c{$(OUTDIR)}.exe: $(CL) $(CFLAGS) -c $** -Fd$(INTDIR)\ $(INCLUDES) $(LD) $(LDFLAGS) /out:"$@" $*.obj $(LD_LIBS) - if exist "$@.manifest" \ + @if exist "$@.manifest" \ mt.exe -manifest "$@.manifest" -outputresource:$@;1 {$(INTDIR)}.obj{$(OUTDIR)}.exe: $(LD) $(LDFLAGS) /out:"$@" $*.obj $(LD_LIBS) - if exist "$@.manifest" \ + @if exist "$@.manifest" \ mt.exe -manifest "$@.manifest" -outputresource:$@;1 $(OUTDIR)\mod_test.dll: $(INTDIR)/mod_test.obj $(LD) $(SHLDFLAGS) /out:"$@" $** \ /export:print_hello /export:count_reps $(LD_LIBS) - if exist "$@.manifest" \ + @if exist "$@.manifest" \ mt.exe -manifest "$@.manifest" -outputresource:$@;2 $(OUTDIR)\testapp.exe: $(INTDIR)/testapp.obj $(LD) $(LDFLAGS) /out:"$@" $** \ /entry:wmainCRTStartup $(APP_LIB) $(LD_LIBS) - if exist "$@.manifest" \ + @if exist "$@.manifest" \ mt.exe -manifest "$@.manifest" -outputresource:$@;2 $(OUTDIR)\testall.exe: $(ALL_TESTS) $(INTDIR)\abts.obj $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) - if exist "$@.manifest" \ + @if exist "$@.manifest" \ mt.exe -manifest "$@.manifest" -outputresource:$@;1 -clean: - for %f in ($(CLEAN_TARGETS)) do del /f %f - rmdir /s /q $(OUTDIR) -!IF "$(OUTDIR)" != "$(INTDIR)" - rmdir /s /q $(OUTDIR) -!ENDIF +cleandata: + @for %f in ($(CLEAN_DATA)) do @if EXIST %f del /f %f + +clean: cleandata + @if EXIST $(INTDIR)\. rmdir /s /q $(INTDIR) + @if EXIST $(OUTDIR)\. rmdir /s /q $(OUTDIR) + @for %d in ($(CLEAN_SUBDIRS)) do \ + %COMSPEC% /c "cd %%d && $(MAKE) -f Makefile.win clean" \ + +cleanall: + @for %d in ($(CLEAN_BUILDDIRS) $(INTDIR) $(OUTDIR)) do \ + @if EXIST %d\. rmdir /s /q %d + @for %d in ($(CLEAN_SUBDIRS)) do \ + %COMSPEC% /c "cd %%d & $(MAKE) -f Makefile.win cleanall" \ PATH=$(OUTDIR);..\$(OUTDIR);$(PATH) check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) - for %p in ($(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)) do @( \ - echo Testing %p && %p || echo "%p failed" \ + @for %p in ($(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)) do @( \ + echo Testing %p && %p || echo %p failed \ ) +checkall: check + @for %d in ($(CLEAN_SUBDIRS)) do \ + %COMSPEC% /c "cd %%d && $(MAKE) -f Makefile.win check" \ + # DO NOT REMOVE diff --git a/test/internal/Makefile.win b/test/internal/Makefile.win new file mode 100644 index 00000000000..efda2da878a --- /dev/null +++ b/test/internal/Makefile.win @@ -0,0 +1,107 @@ +# PROGRAMS includes all test programs built on this platform. +# STDTEST_PORTABLE +# test programs invoked via standard user interface, run on all platforms +# STDTEST_NONPORTABLE +# test programs invoked via standard user interface, not portable +# OTHER_PROGRAMS +# programs such as sendfile, that have to be invoked in a special sequence +# or with special parameters + +!IFNDEF MODEL +MODEL=dynamic +!ENDIF + +INCDIR=../../include + +!IFNDEF OUTDIR +!IF "$(MODEL)" == "static" +OUTDIR=LibR +!ELSE +OUTDIR=Release +!ENDIF + +!IF [$(COMSPEC) /c cl /nologo /? | find "x64" >NUL ] == 0 +OUTDIR=x64\$(OUTDIR) +!ENDIF +!ENDIF + +!IF !EXIST("$(OUTDIR)\.") +!IF ([$(COMSPEC) /C mkdir $(OUTDIR)] == 0) +!ENDIF +!ENDIF + +!IFNDEF INTDIR +INTDIR=$(OUTDIR) +!ELSE +!IF !EXIST("$(INTDIR)\.") +!IF ([$(COMSPEC) /C mkdir $(INTDIR)] == 0) +!ENDIF +!ENDIF +!ENDIF + +!MESSAGE Building tests into $(OUTDIR) for $(MODEL) + +NONPORTABLE = \ + $(OUTDIR)\testucs.exe + +CLEAN_BUILDDIRS = Release Debug 9x x64 + +PROGRAMS = + +TARGETS = $(PROGRAMS) $(NONPORTABLE) + +# bring in rules.mk for standard functionality +ALL: $(TARGETS) + +CL = cl.exe +LD = link.exe + +!IF "$(MODEL)" == "static" +LOCAL_LIB= ..\..\$(OUTDIR)\apr-1.lib +STATIC_CFLAGS = /D APR_DECLARE_STATIC +!ELSE +LOCAL_LIB= ..\..\$(OUTDIR)\libapr-1.lib +STATIC_CFLAGS = +!ENDIF + +!IFDEF _DEBUG +DEBUG_CFLAGS = /MDd +!ELSE +DEBUG_CFLAGS = /MD +!ENDIF + +INCLUDES=/I "$(INCDIR)" + +CFLAGS = /nologo /c /W3 /Gm /EHsc /Zi /Od $(INCLUDES) \ + $(STATIC_CFLAGS) $(DEBUG_CFLAGS) /D "BINPATH=$(OUTDIR:\=/)" \ + /D _DEBUG /D WIN32 /Fo"$(INTDIR)/" /FD + +LD_LIBS = $(LOCAL_LIB) kernel32.lib advapi32.lib ws2_32.lib wsock32.lib \ + ole32.lib shell32.lib rpcrt4.lib + +LDFLAGS = /nologo /debug /subsystem:console /incremental:no +SHLDFLAGS = /nologo /dll /debug /subsystem:windows /incremental:no + +.c{$(OUTDIR)}.exe: + $(CL) $(CFLAGS) -c $** -Fd$(INTDIR)\ $(INCLUDES) + $(LD) $(LDFLAGS) /out:"$@" $*.obj $(LD_LIBS) + @if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;1 + + +clean: + @if EXIST $(INTDIR)\. rmdir /s /q $(INTDIR) + @if EXIST $(OUTDIR)\. rmdir /s /q $(OUTDIR) + +cleanall: + @for %d in ($(CLEAN_BUILDDIRS)) do @if EXIST %d\. rmdir /s /q %d + + +PATH=$(OUTDIR);..\..\$(OUTDIR);$(PATH) + +check: $(NONPORTABLE) + @for %p in ($(NONPORTABLE)) do @( \ + echo Testing %p && %p || echo %p failed \ + ) + +# DO NOT REMOVE From 5652f6ac3f604060ac765b90b99182d6c4a947ab Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 9 Oct 2007 02:08:02 +0000 Subject: [PATCH 5964/7878] TEST_SUBDIRS makes more sense here (used for clean and check) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@583036 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Makefile.win b/test/Makefile.win index 00dc0c56517..1b7566047c9 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -80,7 +80,7 @@ ALL_TESTS = $(INTDIR)\testutil.obj $(INTDIR)\testtime.obj $(INTDIR)\teststr.obj CLEAN_DATA = testfile.tmp lfstests\large.bin \ data\testputs.txt data\testbigfprintf.dat \ data\testwritev.txt data\testwritev_full.txt -CLEAN_SUBDIRS = internal +TEST_SUBDIRS = internal CLEAN_BUILDDIRS = Debug Release LibD LibR 9x x64 PROGRAMS = $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS) @@ -159,13 +159,13 @@ cleandata: clean: cleandata @if EXIST $(INTDIR)\. rmdir /s /q $(INTDIR) @if EXIST $(OUTDIR)\. rmdir /s /q $(OUTDIR) - @for %d in ($(CLEAN_SUBDIRS)) do \ + @for %d in ($(TEST_SUBDIRS)) do \ %COMSPEC% /c "cd %%d && $(MAKE) -f Makefile.win clean" \ cleanall: @for %d in ($(CLEAN_BUILDDIRS) $(INTDIR) $(OUTDIR)) do \ @if EXIST %d\. rmdir /s /q %d - @for %d in ($(CLEAN_SUBDIRS)) do \ + @for %d in ($(TEST_SUBDIRS)) do \ %COMSPEC% /c "cd %%d & $(MAKE) -f Makefile.win cleanall" \ @@ -177,7 +177,7 @@ check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) ) checkall: check - @for %d in ($(CLEAN_SUBDIRS)) do \ + @for %d in ($(TEST_SUBDIRS)) do \ %COMSPEC% /c "cd %%d && $(MAKE) -f Makefile.win check" \ # DO NOT REMOVE From 08bd011ac73a84d4b7dd3c8e6dbc27c20ac90324 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 9 Oct 2007 10:30:06 +0000 Subject: [PATCH 5965/7878] * test/abts.h: Fix non-Win32 build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@583098 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/abts.h b/test/abts.h index 27bed8a7f49..0cbf572a6ec 100644 --- a/test/abts.h +++ b/test/abts.h @@ -21,7 +21,11 @@ extern "C" { #include #include #include +#ifdef WIN32 #include +#else +#include +#endif #ifndef ABTS_H #define ABTS_H From a2f1ff7bf107c994bd6cb1908cf2e7f9d2631873 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 9 Oct 2007 10:48:07 +0000 Subject: [PATCH 5966/7878] Fix invalid function casts (which are compiled as abort() by recent versions of gcc): * test/abts.h, test/abts.c (abts_size_equal): New function; use it in ABTS_SIZE_EQUAL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@583104 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 14 ++++++++++++++ test/abts.h | 5 ++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/test/abts.c b/test/abts.c index ff0f2ea822d..cd74badb7f1 100644 --- a/test/abts.c +++ b/test/abts.c @@ -252,6 +252,20 @@ void abts_int_nequal(abts_case *tc, const int expected, const int actual, int li } } +void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno) +{ + update_status(); + if (tc->failed) return; + + if (expected == actual) return; + + tc->failed = TRUE; + if (verbose) { + fprintf(stderr, "Line %d: expected <%lx>, but saw <%lx>\n", lineno, (unsigned long)expected, (unsigned long)actual); + fflush(stderr); + } +} + void abts_str_equal(abts_case *tc, const char *expected, const char *actual, int lineno) { update_status(); diff --git a/test/abts.h b/test/abts.h index 0cbf572a6ec..4d6470ae3f0 100644 --- a/test/abts.h +++ b/test/abts.h @@ -78,8 +78,7 @@ void abts_true(abts_case *tc, int condition, int lineno); void abts_fail(abts_case *tc, const char *message, int lineno); void abts_not_impl(abts_case *tc, const char *message, int lineno); void abts_assert(abts_case *tc, const char *message, int condition, int lineno); - -typedef void (fn_abts_size_equal)(abts_case *tc, size_t expected, size_t actual, int lineno); +void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno); /* Convenience macros. Ryan hates these! */ #define ABTS_INT_EQUAL(a, b, c) abts_int_equal(a, b, c, __LINE__) @@ -93,7 +92,7 @@ typedef void (fn_abts_size_equal)(abts_case *tc, size_t expected, size_t actual, #define ABTS_NOT_IMPL(a, b) abts_not_impl(a, b, __LINE__); #define ABTS_ASSERT(a, b, c) abts_assert(a, b, c, __LINE__); -#define ABTS_SIZE_EQUAL(a, b, c) ((fn_abts_size_equal*)abts_ptr_equal)(a, b, c, __LINE__) +#define ABTS_SIZE_EQUAL(a, b, c) abts_size_equal(a, b, c, __LINE__) abts_suite *run_tests(abts_suite *suite); From 50ba50058f6813cc3fd7ad3fcae764ef0a682922 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 9 Oct 2007 17:57:16 +0000 Subject: [PATCH 5967/7878] Add a comment, and represent in base 10 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@583243 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/abts.c b/test/abts.c index cd74badb7f1..d8cb2c9da16 100644 --- a/test/abts.c +++ b/test/abts.c @@ -261,7 +261,9 @@ void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno) tc->failed = TRUE; if (verbose) { - fprintf(stderr, "Line %d: expected <%lx>, but saw <%lx>\n", lineno, (unsigned long)expected, (unsigned long)actual); + /* Note that the comparison is type-exact, reporting must be a best-fit */ + fprintf(stderr, "Line %d: expected %lu, but saw %lu\n", lineno, + (unsigned long)expected, (unsigned long)actual); fflush(stderr); } } From a9c0e7deff059891acdbd40ff8aea233fe4c830b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 9 Oct 2007 17:58:24 +0000 Subject: [PATCH 5968/7878] A few more items to prune git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@583246 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 3 ++- test/Makefile.win | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 52c9fa2bcd4..e0397087c1f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -45,7 +45,8 @@ LOCAL_LIBS=../lib@APR_LIBNAME@.la CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \ readchild@EXEEXT@ tryread@EXEEXT@ sockchild@EXEEXT@ \ globalmutexchild@EXEEXT@ lfstests/*.bin \ - data/test*.txt data/test*.dat + data/test*.txt data/test*.dat data/apr.testshm.shm + CLEAN_SUBDIRS = internal INCDIR=../include diff --git a/test/Makefile.win b/test/Makefile.win index 1b7566047c9..2d22b97b105 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -79,10 +79,14 @@ ALL_TESTS = $(INTDIR)\testutil.obj $(INTDIR)\testtime.obj $(INTDIR)\teststr.obj CLEAN_DATA = testfile.tmp lfstests\large.bin \ data\testputs.txt data\testbigfprintf.dat \ - data\testwritev.txt data\testwritev_full.txt -TEST_SUBDIRS = internal + data\testwritev.txt data\testwritev_full.txt \ + data\testflush.dat data\testxthread.dat \ + data\apr.testshm.shm + CLEAN_BUILDDIRS = Debug Release LibD LibR 9x x64 +TEST_SUBDIRS = internal + PROGRAMS = $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS) TARGETS = $(PROGRAMS) From ad45c3e3c2c4ec69ba37878b4ad78079f253e26a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 10 Oct 2007 10:38:39 +0000 Subject: [PATCH 5969/7878] apr_procattr_io_set() on Windows: Set pipe handles non-blocking as appropriate based on the input parameters. PR: 43522 Submitted by: Eric Covener Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@583421 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++ threadproc/win32/proc.c | 54 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 3a2566a33c4..3fd69ceaac8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@  -*- coding: utf-8 -*- Changes for APR 1.3.0 + *) apr_procattr_io_set() on Windows: Set pipe handles non-blocking as + appropriate based on the input parameters. PR 43522. + [Eric Covener ] + *) apr_file_write() on Windows: Fix return code when writing to a non- blocking pipe would have blocked. PR 43563. [Eric Covener ] diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index c7f2408e975..b152a1da348 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -95,27 +95,75 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, if (in == APR_NO_FILE) attr->child_in = &no_file; - else + else { stat = apr_create_nt_pipe(&attr->child_in, &attr->parent_in, in, attr->pool); + if (stat == APR_SUCCESS) { + switch (in) { + case APR_FULL_BLOCK: + break; + case APR_READ_BLOCK: + apr_file_pipe_timeout_set(attr->parent_in, 0); + break; + case APR_WRITE_BLOCK: + apr_file_pipe_timeout_set(attr->child_in, 0); + break; + default: + apr_file_pipe_timeout_set(attr->child_in, 0); + apr_file_pipe_timeout_set(attr->parent_in, 0); + } + } + } if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_in); } if (out && stat == APR_SUCCESS) { if (out == APR_NO_FILE) attr->child_out = &no_file; - else + else { stat = apr_create_nt_pipe(&attr->parent_out, &attr->child_out, out, attr->pool); + if (stat == APR_SUCCESS) { + switch (out) { + case APR_FULL_BLOCK: + break; + case APR_PARENT_BLOCK: + apr_file_pipe_timeout_set(attr->child_out, 0); + break; + case APR_CHILD_BLOCK: + apr_file_pipe_timeout_set(attr->parent_out, 0); + break; + default: + apr_file_pipe_timeout_set(attr->child_out, 0); + apr_file_pipe_timeout_set(attr->parent_out, 0); + } + } + } if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_out); } if (err && stat == APR_SUCCESS) { if (err == APR_NO_FILE) attr->child_err = &no_file; - else + else { stat = apr_create_nt_pipe(&attr->parent_err, &attr->child_err, err, attr->pool); + if (stat == APR_SUCCESS) { + switch (err) { + case APR_FULL_BLOCK: + break; + case APR_PARENT_BLOCK: + apr_file_pipe_timeout_set(attr->child_err, 0); + break; + case APR_CHILD_BLOCK: + apr_file_pipe_timeout_set(attr->parent_err, 0); + break; + default: + apr_file_pipe_timeout_set(attr->child_err, 0); + apr_file_pipe_timeout_set(attr->parent_err, 0); + } + } + } if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_err); } From 2970723a4b825a27044901900a7f512a03c1a509 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Oct 2007 07:17:12 +0000 Subject: [PATCH 5970/7878] Altogether bogus; can't simply have an inference while we need to keep our eye on the library ball. We need to rebuild on library relink, or we lose sight of the (test) target. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@583709 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 62 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 50 insertions(+), 12 deletions(-) diff --git a/test/Makefile.win b/test/Makefile.win index 2d22b97b105..8e1033e8f7f 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -119,7 +119,7 @@ CFLAGS = /nologo /c /W3 /Gm /EHsc /Zi /Od $(INCLUDES) \ $(STATIC_CFLAGS) $(DEBUG_CFLAGS) /D "BINPATH=$(OUTDIR:\=/)" \ /D _DEBUG /D WIN32 /Fo"$(INTDIR)/" /FD -LD_LIBS = $(LOCAL_LIB) kernel32.lib advapi32.lib ws2_32.lib wsock32.lib \ +LD_LIBS = kernel32.lib advapi32.lib ws2_32.lib wsock32.lib \ ole32.lib shell32.lib rpcrt4.lib LDFLAGS = /nologo /debug /subsystem:console /incremental:no @@ -128,30 +128,68 @@ SHLDFLAGS = /nologo /dll /debug /subsystem:windows /incremental:no .c{$(INTDIR)}.obj:: $(CL) $(CFLAGS) -c $< -Fd$(INTDIR)\ $(INCLUDES) -.c{$(OUTDIR)}.exe: - $(CL) $(CFLAGS) -c $** -Fd$(INTDIR)\ $(INCLUDES) - $(LD) $(LDFLAGS) /out:"$@" $*.obj $(LD_LIBS) +$(OUTDIR)\testall.exe: $(ALL_TESTS) $(INTDIR)\abts.obj $(LOCAL_LIB) + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) + @if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;1 + +$(OUTDIR)\testapp.exe: $(INTDIR)/testapp.obj $(LOCAL_LIB) $(APP_LIB) + $(LD) $(LDFLAGS) /entry:wmainCRTStartup /out:"$@" $** $(LD_LIBS) + @if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;2 + +$(OUTDIR)\testlockperf.exe: $(INTDIR)\testlockperf.obj $(LOCAL_LIB) + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) + @if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;1 + +$(OUTDIR)\testmutexscope.exe: $(INTDIR)\testmutexscope.obj $(LOCAL_LIB) + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) @if exist "$@.manifest" \ mt.exe -manifest "$@.manifest" -outputresource:$@;1 -{$(INTDIR)}.obj{$(OUTDIR)}.exe: - $(LD) $(LDFLAGS) /out:"$@" $*.obj $(LD_LIBS) +$(OUTDIR)\globalmutexchild.exe: $(INTDIR)\globalmutexchild.obj $(LOCAL_LIB) + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) @if exist "$@.manifest" \ mt.exe -manifest "$@.manifest" -outputresource:$@;1 -$(OUTDIR)\mod_test.dll: $(INTDIR)/mod_test.obj +$(OUTDIR)\mod_test.dll: $(INTDIR)/mod_test.obj $(LOCAL_LIB) $(LD) $(SHLDFLAGS) /out:"$@" $** \ /export:print_hello /export:count_reps $(LD_LIBS) @if exist "$@.manifest" \ mt.exe -manifest "$@.manifest" -outputresource:$@;2 -$(OUTDIR)\testapp.exe: $(INTDIR)/testapp.obj - $(LD) $(LDFLAGS) /out:"$@" $** \ - /entry:wmainCRTStartup $(APP_LIB) $(LD_LIBS) +$(OUTDIR)\occhild.exe: $(INTDIR)\occhild.obj $(LOCAL_LIB) + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) @if exist "$@.manifest" \ - mt.exe -manifest "$@.manifest" -outputresource:$@;2 + mt.exe -manifest "$@.manifest" -outputresource:$@;1 + +$(OUTDIR)\proc_child.exe: $(INTDIR)\proc_child.obj $(LOCAL_LIB) + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) + @if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;1 + +$(OUTDIR)\readchild.exe: $(INTDIR)\readchild.obj $(LOCAL_LIB) + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) + @if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;1 + +$(OUTDIR)\sockchild.exe: $(INTDIR)\sockchild.obj $(LOCAL_LIB) + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) + @if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;1 + +$(OUTDIR)\testshmconsumer.exe: $(INTDIR)\testshmconsumer.obj $(LOCAL_LIB) + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) + @if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;1 + +$(OUTDIR)\testshmproducer.exe: $(INTDIR)\testshmproducer.obj $(LOCAL_LIB) + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) + @if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;1 -$(OUTDIR)\testall.exe: $(ALL_TESTS) $(INTDIR)\abts.obj +$(OUTDIR)\tryread.exe: $(INTDIR)\tryread.obj $(LOCAL_LIB) $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) @if exist "$@.manifest" \ mt.exe -manifest "$@.manifest" -outputresource:$@;1 From 3cab315bfe36ac3d794791adea0d5015a3844902 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 11 Oct 2007 12:15:38 +0000 Subject: [PATCH 5971/7878] * test/Makefile.in: Add missing backslash. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@583795 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index e0397087c1f..ec7f9b72126 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -26,7 +26,7 @@ TESTALL_COMPONENTS = \ mod_test.la \ libmod_test.la \ occhild@EXEEXT@ \ - readchild@EXEEXT@ + readchild@EXEEXT@ \ proc_child@EXEEXT@ \ tryread@EXEEXT@ \ sockchild@EXEEXT@ \ From 56354526967623882dec3a18eca36f8f598ff91b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 11 Oct 2007 16:12:10 +0000 Subject: [PATCH 5972/7878] Same change as test/Makefile.win; we need to watch for a recompiled lib. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@583864 13f79535-47bb-0310-9956-ffa450edef68 --- test/internal/Makefile.win | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/internal/Makefile.win b/test/internal/Makefile.win index efda2da878a..a881f078108 100644 --- a/test/internal/Makefile.win +++ b/test/internal/Makefile.win @@ -76,15 +76,17 @@ CFLAGS = /nologo /c /W3 /Gm /EHsc /Zi /Od $(INCLUDES) \ $(STATIC_CFLAGS) $(DEBUG_CFLAGS) /D "BINPATH=$(OUTDIR:\=/)" \ /D _DEBUG /D WIN32 /Fo"$(INTDIR)/" /FD -LD_LIBS = $(LOCAL_LIB) kernel32.lib advapi32.lib ws2_32.lib wsock32.lib \ +LD_LIBS = kernel32.lib advapi32.lib ws2_32.lib wsock32.lib \ ole32.lib shell32.lib rpcrt4.lib LDFLAGS = /nologo /debug /subsystem:console /incremental:no SHLDFLAGS = /nologo /dll /debug /subsystem:windows /incremental:no -.c{$(OUTDIR)}.exe: - $(CL) $(CFLAGS) -c $** -Fd$(INTDIR)\ $(INCLUDES) - $(LD) $(LDFLAGS) /out:"$@" $*.obj $(LD_LIBS) +.c{$(INTDIR)}.obj: + $(CL) $(CFLAGS) -c $< -Fd$(INTDIR)\ $(INCLUDES) + +$(OUTDIR)\testucs.exe: $(INTDIR)\testucs.obj $(LOCAL_LIB) + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) @if exist "$@.manifest" \ mt.exe -manifest "$@.manifest" -outputresource:$@;1 From f7caf7020075d5022577d3bd45e45e4bfe5e9135 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 12 Oct 2007 01:49:48 +0000 Subject: [PATCH 5973/7878] When we are done with apr_file_t's shall we close them? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584023 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testdup.c b/test/testdup.c index 3f9ea68edcb..a7463379fa8 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -128,6 +128,8 @@ static void test_dup2(abts_case *tc, void *data) rv = apr_file_dup2(errfile, saveerr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, errfile); + + apr_file_close(saveerr); } static void test_dup2_readwrite(abts_case *tc, void *data) @@ -178,6 +180,8 @@ static void test_dup2_readwrite(abts_case *tc, void *data) rv = apr_file_dup2(errfile, saveerr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, errfile); + + apr_file_close(saveerr); } abts_suite *testdup(abts_suite *suite) From db7e002e7191c52e3a8e8630d75bcf9421b06e6f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 12 Oct 2007 01:53:12 +0000 Subject: [PATCH 5974/7878] Group of two changes; we must keep file->flags in sync when we are apr_file_dup2()'ing into a standard handle (it has to remain marked as a standard handle), remove a redundant CloseFile() (win faux-posix _dup2 does this for us) and also close the msvcrt faux-posix file when we close std streams. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584024 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 42 +++++++++++++++++------------------------ file_io/win32/open.c | 36 ++++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 70ed4379d56..e96ef2bc570 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -40,7 +40,7 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, (*new_file) = (apr_file_t *) apr_pcalloc(p, sizeof(apr_file_t)); (*new_file)->filehand = newhand; - (*new_file)->flags = old_file->flags & ~APR_INHERIT; + (*new_file)->flags = old_file->flags & ~(APR_STD_FLAGS | APR_INHERIT); (*new_file)->pool = p; (*new_file)->fname = apr_pstrdup(p, old_file->fname); (*new_file)->append = old_file->append; @@ -77,21 +77,10 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_int32_t newflags; int fd; - if (new_file->flags & APR_STD_FLAGS) { - /* if (!DuplicateHandle(hproc, old_file->filehand, - * hproc, &newhand, 0, - * TRUE, DUPLICATE_SAME_ACCESS)) { - * return apr_get_os_error(); - * } - * if (((stdhandle & stderr_handle) && !SetStdHandle(STD_ERROR_HANDLE, newhand)) || - * ((stdhandle & stdout_handle) && !SetStdHandle(STD_OUTPUT_HANDLE, newhand)) || - * ((stdhandle & stdin_handle) && !SetStdHandle(STD_INPUT_HANDLE, newhand))) { - * return apr_get_os_error(); - * } - * newflags = old_file->flags | APR_INHERIT; - */ - - if ((new_file->flags & APR_STD_FLAGS) == APR_STDERR_FLAG) { + if (new_file->flags & APR_STD_FLAGS) + { + if ((new_file->flags & APR_STD_FLAGS) == APR_STDERR_FLAG) + { /* Flush stderr and unset its buffer, then commit the fd-based buffer. * This is typically a noop for Win2K/XP since services with NULL std * handles [but valid FILE *'s, oddly enough], but is required @@ -106,6 +95,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, * and close our temporary pseudo-fd once it's been duplicated. * This will incidently keep the FILE-based stderr in sync. * Note the apparently redundant _O_BINARY coersions are required. + * Note the _dup2 will close the previous std Win32 handle. */ if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand, 0, FALSE, DUPLICATE_SAME_ACCESS)) { @@ -124,8 +114,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, */ newhand = (HANDLE)_get_osfhandle(2); } - - if ((new_file->flags & APR_STD_FLAGS) == APR_STDOUT_FLAG) { + else if ((new_file->flags & APR_STD_FLAGS) == APR_STDOUT_FLAG) { /* For the process flow see the stderr case above */ fflush(stdout); setvbuf(stdout, NULL, _IONBF, 0); @@ -141,8 +130,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, _setmode(1, _O_BINARY); newhand = (HANDLE)_get_osfhandle(1); } - - if ((new_file->flags & APR_STD_FLAGS) == APR_STDIN_FLAG) { + else if ((new_file->flags & APR_STD_FLAGS) == APR_STDIN_FLAG) { /* For the process flow see the stderr case above */ fflush(stdin); setvbuf(stdin, NULL, _IONBF, 0); @@ -158,7 +146,10 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, _setmode(0, _O_BINARY); newhand = (HANDLE)_get_osfhandle(0); } - newflags = old_file->flags | APR_INHERIT; + newflags = (new_file->flags & APR_STD_FLAGS) + | (old_file->flags & ~APR_STD_FLAGS) | APR_INHERIT; + + /* No need to close the old file, _dup2() above did that for us */ } else { if (!DuplicateHandle(hproc, old_file->filehand, @@ -166,11 +157,12 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, FALSE, DUPLICATE_SAME_ACCESS)) { return apr_get_os_error(); } - newflags = old_file->flags & ~APR_INHERIT; - } + newflags = old_file->flags & ~(APR_STD_FLAGS | APR_INHERIT); - if (new_file->filehand && (new_file->filehand != INVALID_HANDLE_VALUE)) { - CloseHandle(new_file->filehand); + if (new_file->filehand + && (new_file->filehand != INVALID_HANDLE_VALUE)) { + CloseHandle(new_file->filehand); + } } new_file->flags = newflags; diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 0d8f88d1b12..aa3d06e090d 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -31,6 +31,7 @@ #endif #include "apr_arch_misc.h" #include "apr_arch_inherit.h" +#include #if APR_HAS_UNICODE_FS apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, @@ -227,25 +228,34 @@ apr_status_t file_cleanup(void *thefile) if (file->filehand != INVALID_HANDLE_VALUE) { + if (file->buffered) { + /* XXX: flush here is not mutex protected */ + flush_rv = apr_file_flush((apr_file_t *)thefile); + } + /* In order to avoid later segfaults with handle 'reuse', * we must protect against the case that a dup2'ed handle * is being closed, and invalidate the corresponding StdHandle + * We also tell msvcrt when stdhandles are closed. */ - if (file->filehand == GetStdHandle(STD_ERROR_HANDLE)) { - SetStdHandle(STD_ERROR_HANDLE, INVALID_HANDLE_VALUE); - } - if (file->filehand == GetStdHandle(STD_OUTPUT_HANDLE)) { - SetStdHandle(STD_OUTPUT_HANDLE, INVALID_HANDLE_VALUE); - } - if (file->filehand == GetStdHandle(STD_INPUT_HANDLE)) { - SetStdHandle(STD_INPUT_HANDLE, INVALID_HANDLE_VALUE); + if (file->flags & APR_STD_FLAGS) + { + if ((file->flags & APR_STD_FLAGS) == APR_STDERR_FLAG) { + _close(2); + SetStdHandle(STD_ERROR_HANDLE, INVALID_HANDLE_VALUE); + } + else if ((file->flags & APR_STD_FLAGS) == APR_STDOUT_FLAG) { + _close(1); + SetStdHandle(STD_OUTPUT_HANDLE, INVALID_HANDLE_VALUE); + } + else if ((file->flags & APR_STD_FLAGS) == APR_STDIN_FLAG) { + _close(0); + SetStdHandle(STD_INPUT_HANDLE, INVALID_HANDLE_VALUE); + } } + else + CloseHandle(file->filehand); - if (file->buffered) { - /* XXX: flush here is not mutex protected */ - flush_rv = apr_file_flush((apr_file_t *)thefile); - } - CloseHandle(file->filehand); file->filehand = INVALID_HANDLE_VALUE; } if (file->pOverlapped && file->pOverlapped->hEvent) { From bb59395826604e106c997b43f847b73e7bbbf34d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 12 Oct 2007 14:44:08 +0000 Subject: [PATCH 5975/7878] * build/apr_common.m4 (APR_CHECK_TYPES_COMPATIBLE): Set the cache variable correctly on success even if actions-if-true are specified. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584171 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 582ebaa9125..2afb4666dd8 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -971,5 +971,6 @@ define([apr_cvname], apr_cv_typematch_[]translit([$1], [ ], [_])_[]translit([$2] AC_CACHE_CHECK([whether $1 and $2 are the same], apr_cvname, [ AC_TRY_COMPILE(AC_INCLUDES_DEFAULT, [ int foo[0 - !__builtin_types_compatible_p($1, $2)]; -], [apr_cvname=yes $3], [apr_cvname=no])]) +], [apr_cvname=yes +$3], [apr_cvname=no])]) ]) From 01967557182360ec3aecfc9f9f33620b3de9b8f8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 12 Oct 2007 22:08:44 +0000 Subject: [PATCH 5976/7878] The joys of mass-replace errors git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584291 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apr.dsp b/apr.dsp index d4ebb55d6c5..2ce90fb7616 100644 --- a/apr.dsp +++ b/apr.dsp @@ -35,12 +35,12 @@ RSC=rc.exe !IF "$(CFG)" == "apr - Win32 Release" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Releasearies 0 +# PROP BASE Use_Debug_Libaries 0 # PROP BASE Output_Dir "LibR" # PROP BASE Intermediate_Dir "LibR" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Releasearies 0 +# PROP Use_Debug_Libaries 0 # PROP Output_Dir "LibR" # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" @@ -58,12 +58,12 @@ LIB32=link.exe -lib !ELSEIF "$(CFG)" == "apr - Win32 Debug" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Releasearies 1 +# PROP BASE Use_Debug_Libaries 1 # PROP BASE Output_Dir "LibD" # PROP BASE Intermediate_Dir "LibD" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Releasearies 1 +# PROP Use_Debug_Libaries 1 # PROP Output_Dir "LibD" # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 @@ -82,12 +82,12 @@ LIB32=link.exe -lib !ELSEIF "$(CFG)" == "apr - Win32 Release9x" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Releasearies 0 +# PROP BASE Use_Debug_Libaries 0 # PROP BASE Output_Dir "9x\LibR" # PROP BASE Intermediate_Dir "9x\LibR" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Releasearies 0 +# PROP Use_Debug_Libaries 0 # PROP Output_Dir "9x\LibR" # PROP Intermediate_Dir "9x\LibR" # PROP Target_Dir "" @@ -105,12 +105,12 @@ LIB32=link.exe -lib !ELSEIF "$(CFG)" == "apr - Win32 Debug9x" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Releasearies 1 +# PROP BASE Use_Debug_Libaries 1 # PROP BASE Output_Dir "9x\LibD" # PROP BASE Intermediate_Dir "9x\LibD" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Releasearies 1 +# PROP Use_Debug_Libaries 1 # PROP Output_Dir "9x\LibD" # PROP Intermediate_Dir "9x\LibD" # PROP Ignore_Export_Lib 0 @@ -129,12 +129,12 @@ LIB32=link.exe -lib !ELSEIF "$(CFG)" == "apr - x64 Release" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Releasearies 0 +# PROP BASE Use_Debug_Libaries 0 # PROP BASE Output_Dir "x64\LibR" # PROP BASE Intermediate_Dir "x64\LibR" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Releasearies 0 +# PROP Use_Debug_Libaries 0 # PROP Output_Dir "x64\LibR" # PROP Intermediate_Dir "x64\LibR" # PROP Target_Dir "" @@ -152,12 +152,12 @@ LIB32=link.exe -lib !ELSEIF "$(CFG)" == "apr - x64 Debug" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Releasearies 1 +# PROP BASE Use_Debug_Libaries 1 # PROP BASE Output_Dir "x64\LibD" # PROP BASE Intermediate_Dir "x64\LibD" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Releasearies 1 +# PROP Use_Debug_Libaries 1 # PROP Output_Dir "x64\LibD" # PROP Intermediate_Dir "x64\LibD" # PROP Ignore_Export_Lib 0 From c8b6f64055edc82a92e63c02ca548e779aa430ef Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 12 Oct 2007 22:11:50 +0000 Subject: [PATCH 5977/7878] testshmproducer|consumer are sub-apps of testall, not standalone. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584294 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index ec7f9b72126..99080815c87 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -16,21 +16,21 @@ STDTEST_PORTABLE = \ testall@EXEEXT@ OTHER_PROGRAMS = \ - sendfile@EXEEXT@ \ - testshmproducer@EXEEXT@ \ - testshmconsumer@EXEEXT@ \ - echod@EXEEXT@ \ - sockperf@EXEEXT@ + sendfile@EXEEXT@ \ + echod@EXEEXT@ \ + sockperf@EXEEXT@ TESTALL_COMPONENTS = \ - mod_test.la \ + globalmutexchild@EXEEXT@ \ libmod_test.la \ + mod_test.la \ occhild@EXEEXT@ \ - readchild@EXEEXT@ \ proc_child@EXEEXT@ \ - tryread@EXEEXT@ \ + readchild@EXEEXT@ \ sockchild@EXEEXT@ \ - globalmutexchild@EXEEXT@ + testshmproducer@EXEEXT@ \ + testshmconsumer@EXEEXT@ \ + tryread@EXEEXT@ PROGRAMS = $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS) From 9f5e96fcbf48af6f4942181027045e6b3345fc7f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 12 Oct 2007 22:17:41 +0000 Subject: [PATCH 5978/7878] Fix the rebroken Libaries text git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584300 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apr.dsp b/apr.dsp index 2ce90fb7616..6217f2a9d34 100644 --- a/apr.dsp +++ b/apr.dsp @@ -35,12 +35,12 @@ RSC=rc.exe !IF "$(CFG)" == "apr - Win32 Release" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libaries 0 +# PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "LibR" # PROP BASE Intermediate_Dir "LibR" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Libaries 0 +# PROP Use_Debug_Libraries 0 # PROP Output_Dir "LibR" # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" @@ -58,12 +58,12 @@ LIB32=link.exe -lib !ELSEIF "$(CFG)" == "apr - Win32 Debug" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libaries 1 +# PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "LibD" # PROP BASE Intermediate_Dir "LibD" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Libaries 1 +# PROP Use_Debug_Libraries 1 # PROP Output_Dir "LibD" # PROP Intermediate_Dir "LibD" # PROP Ignore_Export_Lib 0 @@ -82,12 +82,12 @@ LIB32=link.exe -lib !ELSEIF "$(CFG)" == "apr - Win32 Release9x" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libaries 0 +# PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "9x\LibR" # PROP BASE Intermediate_Dir "9x\LibR" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Libaries 0 +# PROP Use_Debug_Libraries 0 # PROP Output_Dir "9x\LibR" # PROP Intermediate_Dir "9x\LibR" # PROP Target_Dir "" @@ -105,12 +105,12 @@ LIB32=link.exe -lib !ELSEIF "$(CFG)" == "apr - Win32 Debug9x" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libaries 1 +# PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "9x\LibD" # PROP BASE Intermediate_Dir "9x\LibD" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Libaries 1 +# PROP Use_Debug_Libraries 1 # PROP Output_Dir "9x\LibD" # PROP Intermediate_Dir "9x\LibD" # PROP Ignore_Export_Lib 0 @@ -129,12 +129,12 @@ LIB32=link.exe -lib !ELSEIF "$(CFG)" == "apr - x64 Release" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libaries 0 +# PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "x64\LibR" # PROP BASE Intermediate_Dir "x64\LibR" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Libaries 0 +# PROP Use_Debug_Libraries 0 # PROP Output_Dir "x64\LibR" # PROP Intermediate_Dir "x64\LibR" # PROP Target_Dir "" @@ -152,12 +152,12 @@ LIB32=link.exe -lib !ELSEIF "$(CFG)" == "apr - x64 Debug" # PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libaries 1 +# PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "x64\LibD" # PROP BASE Intermediate_Dir "x64\LibD" # PROP BASE Target_Dir "" # PROP Use_MFC 0 -# PROP Use_Debug_Libaries 1 +# PROP Use_Debug_Libraries 1 # PROP Output_Dir "x64\LibD" # PROP Intermediate_Dir "x64\LibD" # PROP Ignore_Export_Lib 0 From a0a10d262cef46827444b2d64b25b4793ebbd67e Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 12 Oct 2007 23:43:14 +0000 Subject: [PATCH 5979/7878] The calls to UnmapViewOfFile() and CloseHandle() in the shm_cleanup() routine in the win32/shm.c source are not properly checking for errors. They currently assume a non-zero return is an error.Whereas these windows calls return non-zero on success and zero on failure. PR: 43065 Submitted by: Joe Mudd git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584331 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index a7260bdb2f3..7bce1331bbb 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -40,10 +40,10 @@ static apr_status_t shm_cleanup(void* shm) apr_status_t rv = APR_SUCCESS; apr_shm_t *m = shm; - if (UnmapViewOfFile(m->memblk)) { + if (!UnmapViewOfFile(m->memblk)) { rv = apr_get_os_error(); } - if (CloseHandle(m->hMap)) { + if (!CloseHandle(m->hMap)) { return (rv != APR_SUCCESS) ? rv : apr_get_os_error(); } /* ### Do we want to make a point of unlinking m->file here? From 73ce2cea663f42176d2eb3483d2e1dce4c55da05 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 13 Oct 2007 00:13:27 +0000 Subject: [PATCH 5980/7878] Correct size elt and arguments git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584345 13f79535-47bb-0310-9956-ffa450edef68 --- test/sockperf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/sockperf.c b/test/sockperf.c index a9fcedb863f..d157bd7e645 100644 --- a/test/sockperf.c +++ b/test/sockperf.c @@ -38,7 +38,7 @@ struct testSet { char c; - int size; + apr_size_t size; int iters; } testRuns[] = { { 'a', 1, 3 }, @@ -75,7 +75,7 @@ static closeConnection(apr_socket_t *sock) } static apr_status_t sendRecvBuffer(apr_time_t *t, const char *buf, - int size, apr_pool_t *pool) + apr_size_t size, apr_pool_t *pool) { apr_socket_t *sock; apr_status_t rv; @@ -175,7 +175,8 @@ static apr_status_t runTest(struct testSet *ts, struct testResult *res, { char *buffer; apr_status_t rv; - int i, sz = ts->size * TEST_SIZE; + int i; + apr_size_t sz = ts->size * TEST_SIZE; buffer = apr_palloc(pool, sz); if (!buffer) { From 067666b7523e6bb1879d313a06883d879be9e683 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 13 Oct 2007 00:16:55 +0000 Subject: [PATCH 5981/7878] Add echod / sockperf tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584346 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/test/Makefile.win b/test/Makefile.win index 8e1033e8f7f..4a377c73862 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -48,7 +48,9 @@ STDTEST_PORTABLE = \ $(OUTDIR)\testmutexscope.exe OTHER_PROGRAMS = \ - $(OUTDIR)\sendfile.exe + $(OUTDIR)\echod.exe \ + $(OUTDIR)\sendfile.exe \ + $(OUTDIR)\sockperf.exe TESTALL_COMPONENTS = \ $(OUTDIR)\mod_test.dll \ @@ -128,6 +130,8 @@ SHLDFLAGS = /nologo /dll /debug /subsystem:windows /incremental:no .c{$(INTDIR)}.obj:: $(CL) $(CFLAGS) -c $< -Fd$(INTDIR)\ $(INCLUDES) +# STDTEST_PORTABLE; + $(OUTDIR)\testall.exe: $(ALL_TESTS) $(INTDIR)\abts.obj $(LOCAL_LIB) $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) @if exist "$@.manifest" \ @@ -148,6 +152,25 @@ $(OUTDIR)\testmutexscope.exe: $(INTDIR)\testmutexscope.obj $(LOCAL_LIB) @if exist "$@.manifest" \ mt.exe -manifest "$@.manifest" -outputresource:$@;1 +# OTHER_PROGRAMS; + +$(OUTDIR)\echod.exe: $(INTDIR)\echod.obj $(LOCAL_LIB) + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) + @if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;1 + +$(OUTDIR)\sendfile.exe: $(INTDIR)\sendfile.obj $(LOCAL_LIB) + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) + @if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;1 + +$(OUTDIR)\sockperf.exe: $(INTDIR)\sockperf.obj $(LOCAL_LIB) + $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) + @if exist "$@.manifest" \ + mt.exe -manifest "$@.manifest" -outputresource:$@;1 + +# TESTALL_COMPONENTS; + $(OUTDIR)\globalmutexchild.exe: $(INTDIR)\globalmutexchild.obj $(LOCAL_LIB) $(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS) @if exist "$@.manifest" \ From 4f6c0192dfa74d78bd7ff0ee395491848fb65101 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 13 Oct 2007 00:41:35 +0000 Subject: [PATCH 5982/7878] Let's pick up all targets first before checking, we weren't building the OTHER_PROGRAMS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584351 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdll.dsp | 24 ++++++++++++------------ test/testlib.dsp | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/test/testdll.dsp b/test/testdll.dsp index aadf8821151..96f929a76ee 100644 --- a/test/testdll.dsp +++ b/test/testdll.dsp @@ -36,7 +36,7 @@ CFG=testdll - Win32 Release # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=Release OUTDIR=Release MODEL=dynamic check" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=Release OUTDIR=Release MODEL=dynamic all check" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "Release\testall.exe" # PROP BASE Bsc_Name "" @@ -45,7 +45,7 @@ CFG=testdll - Win32 Release # PROP Use_Debug_Libraries 0 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=Release OUTDIR=Release MODEL=dynamic check" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=Release OUTDIR=Release MODEL=dynamic all check" # PROP Rebuild_Opt "/a" # PROP Target_File "Release\testall.exe" # PROP Bsc_Name "" @@ -57,7 +57,7 @@ CFG=testdll - Win32 Release # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=Debug OUTDIR=Debug MODEL=dynamic _DEBUG=1 check" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=Debug OUTDIR=Debug MODEL=dynamic _DEBUG=1 all check" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "Debug\testall.exe" # PROP BASE Bsc_Name "" @@ -66,7 +66,7 @@ CFG=testdll - Win32 Release # PROP Use_Debug_Libraries 1 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=Debug OUTDIR=Debug MODEL=dynamic _DEBUG=1 check" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=Debug OUTDIR=Debug MODEL=dynamic _DEBUG=1 all check" # PROP Rebuild_Opt "/a" # PROP Target_File "Debug\testall.exe" # PROP Bsc_Name "" @@ -78,7 +78,7 @@ CFG=testdll - Win32 Release # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Release OUTDIR=9x\Release MODEL=dynamic check" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Release OUTDIR=9x\Release MODEL=dynamic all check" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "9x\Release\testall.exe" # PROP BASE Bsc_Name "" @@ -87,7 +87,7 @@ CFG=testdll - Win32 Release # PROP Use_Debug_Libraries 0 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Release OUTDIR=9x\Release MODEL=dynamic check" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Release OUTDIR=9x\Release MODEL=dynamic all check" # PROP Rebuild_Opt "/a" # PROP Target_File "9x\Release\testall.exe" # PROP Bsc_Name "" @@ -99,7 +99,7 @@ CFG=testdll - Win32 Release # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Debug OUTDIR=9x\Debug MODEL=dynamic _DEBUG=1 check" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Debug OUTDIR=9x\Debug MODEL=dynamic _DEBUG=1 all check" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "9x\Debug\testall.exe" # PROP BASE Bsc_Name "" @@ -108,7 +108,7 @@ CFG=testdll - Win32 Release # PROP Use_Debug_Libraries 1 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Debug OUTDIR=9x\Debug MODEL=dynamic _DEBUG=1 check" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Debug OUTDIR=9x\Debug MODEL=dynamic _DEBUG=1 all check" # PROP Rebuild_Opt "/a" # PROP Target_File "9x\Debug\testall.exe" # PROP Bsc_Name "" @@ -120,7 +120,7 @@ CFG=testdll - Win32 Release # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Release OUTDIR=x64\Release MODEL=dynamic check" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Release OUTDIR=x64\Release MODEL=dynamic all check" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "x64\Release\testall.exe" # PROP BASE Bsc_Name "" @@ -129,7 +129,7 @@ CFG=testdll - Win32 Release # PROP Use_Debug_Libraries 0 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Release OUTDIR=x64\Release MODEL=dynamic check" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Release OUTDIR=x64\Release MODEL=dynamic all check" # PROP Rebuild_Opt "/a" # PROP Target_File "x64\Release\testall.exe" # PROP Bsc_Name "" @@ -141,7 +141,7 @@ CFG=testdll - Win32 Release # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Debug OUTDIR=x64\Debug MODEL=dynamic _DEBUG=1 check" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Debug OUTDIR=x64\Debug MODEL=dynamic _DEBUG=1 all check" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "x64\Debug\testall.exe" # PROP BASE Bsc_Name "" @@ -150,7 +150,7 @@ CFG=testdll - Win32 Release # PROP Use_Debug_Libraries 1 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Debug OUTDIR=x64\Debug MODEL=dynamic _DEBUG=1 check" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Debug OUTDIR=x64\Debug MODEL=dynamic _DEBUG=1 all check" # PROP Rebuild_Opt "/a" # PROP Target_File "x64\Debug\testall.exe" # PROP Bsc_Name "" diff --git a/test/testlib.dsp b/test/testlib.dsp index ff58f8298f4..2c3a775d3db 100644 --- a/test/testlib.dsp +++ b/test/testlib.dsp @@ -36,7 +36,7 @@ CFG=testlib - Win32 Release # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=LibR OUTDIR=LibR MODEL=static check" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=LibR OUTDIR=LibR MODEL=static all check" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "LibR\testall.exe" # PROP BASE Bsc_Name "" @@ -45,7 +45,7 @@ CFG=testlib - Win32 Release # PROP Use_Debug_Libraries 0 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=LibR OUTDIR=LibR MODEL=static check" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=LibR OUTDIR=LibR MODEL=static all check" # PROP Rebuild_Opt "/a" # PROP Target_File "LibR\testall.exe" # PROP Bsc_Name "" @@ -57,7 +57,7 @@ CFG=testlib - Win32 Release # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=LibD OUTDIR=LibD MODEL=static _DEBUG=1 check" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=LibD OUTDIR=LibD MODEL=static _DEBUG=1 all check" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "LibD\testall.exe" # PROP BASE Bsc_Name "" @@ -66,7 +66,7 @@ CFG=testlib - Win32 Release # PROP Use_Debug_Libraries 1 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=LibD OUTDIR=LibD MODEL=static _DEBUG=1 check" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=LibD OUTDIR=LibD MODEL=static _DEBUG=1 all check" # PROP Rebuild_Opt "/a" # PROP Target_File "LibD\testall.exe" # PROP Bsc_Name "" @@ -78,7 +78,7 @@ CFG=testlib - Win32 Release # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibR OUTDIR=9x\LibR MODEL=static check" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibR OUTDIR=9x\LibR MODEL=static all check" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "9x\LibR\testall.exe" # PROP BASE Bsc_Name "" @@ -87,7 +87,7 @@ CFG=testlib - Win32 Release # PROP Use_Debug_Libraries 0 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibR OUTDIR=9x\LibR MODEL=static check" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibR OUTDIR=9x\LibR MODEL=static all check" # PROP Rebuild_Opt "/a" # PROP Target_File "9x\LibR\testall.exe" # PROP Bsc_Name "" @@ -99,7 +99,7 @@ CFG=testlib - Win32 Release # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibD OUTDIR=9x\LibD MODEL=static _DEBUG=1 check" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibD OUTDIR=9x\LibD MODEL=static _DEBUG=1 all check" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "9x\LibD\testall.exe" # PROP BASE Bsc_Name "" @@ -108,7 +108,7 @@ CFG=testlib - Win32 Release # PROP Use_Debug_Libraries 1 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibD OUTDIR=9x\LibD MODEL=static _DEBUG=1 check" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibD OUTDIR=9x\LibD MODEL=static _DEBUG=1 all check" # PROP Rebuild_Opt "/a" # PROP Target_File "9x\LibD\testall.exe" # PROP Bsc_Name "" @@ -120,7 +120,7 @@ CFG=testlib - Win32 Release # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibR OUTDIR=x64\LibR MODEL=static check" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibR OUTDIR=x64\LibR MODEL=static all check" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "x64\LibR\testall.exe" # PROP BASE Bsc_Name "" @@ -129,7 +129,7 @@ CFG=testlib - Win32 Release # PROP Use_Debug_Libraries 0 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibR OUTDIR=x64\LibR MODEL=static check" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibR OUTDIR=x64\LibR MODEL=static all check" # PROP Rebuild_Opt "/a" # PROP Target_File "x64\LibR\testall.exe" # PROP Bsc_Name "" @@ -141,7 +141,7 @@ CFG=testlib - Win32 Release # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "" # PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibD OUTDIR=x64\LibD MODEL=static _DEBUG=1 check" +# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibD OUTDIR=x64\LibD MODEL=static _DEBUG=1 all check" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "x64\LibD\testall.exe" # PROP BASE Bsc_Name "" @@ -150,7 +150,7 @@ CFG=testlib - Win32 Release # PROP Use_Debug_Libraries 1 # PROP Output_Dir "" # PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibD OUTDIR=x64\LibD MODEL=static _DEBUG=1 check" +# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibD OUTDIR=x64\LibD MODEL=static _DEBUG=1 all check" # PROP Rebuild_Opt "/a" # PROP Target_File "x64\LibD\testall.exe" # PROP Bsc_Name "" From 75b765026224bb74f0d06e2889025fd4de11c0e0 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Sat, 13 Oct 2007 15:21:40 +0000 Subject: [PATCH 5983/7878] * Remove unnecessary assignment of pool attribute. Submitted by: Lucian Adrian Grijincu Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584411 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/beos/thread.c | 1 - threadproc/netware/thread.c | 1 - threadproc/os2/thread.c | 1 - threadproc/unix/thread.c | 1 - threadproc/win32/thread.c | 1 - 5 files changed, 5 deletions(-) diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 629c86def7f..8d838394288 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -80,7 +80,6 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t return APR_ENOMEM; } - (*new)->pool = pool; (*new)->data = data; (*new)->func = func; (*new)->exitval = -1; diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index dcf4993db9b..4b5d930a0e5 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -103,7 +103,6 @@ apr_status_t apr_thread_create(apr_thread_t **new, return APR_ENOMEM; } - (*new)->pool = pool; (*new)->data = data; (*new)->func = func; (*new)->thread_name = (char*)apr_pstrdup(pool, threadName); diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index c1c35219d0e..00ec4eb5cd6 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -88,7 +88,6 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t return APR_ENOMEM; } - thread->pool = pool; thread->attr = attr; thread->func = func; thread->data = data; diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index f62856d0e51..0d5c3e2af51 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -163,7 +163,6 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, return APR_ENOMEM; } - (*new)->pool = pool; (*new)->data = data; (*new)->func = func; diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 63dde013039..e963e9aa345 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -94,7 +94,6 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, return APR_ENOMEM; } - (*new)->pool = pool; (*new)->data = data; (*new)->func = func; (*new)->td = NULL; From 64a5dbaa2fd6704a02376aad0895977058b0cbb9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 13 Oct 2007 22:26:45 +0000 Subject: [PATCH 5984/7878] Clean up spurious noise on platforms where the setsockopt's sa* is char* rather than void* (as it should be). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584458 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/multicast.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index 6ae96290289..74e1d7a732c 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -181,7 +181,7 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock, fill_mip_v6(&mip6, mcast, iface); if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - &mip6, sizeof(mip6)) == -1) { + (const void *) &mip6, sizeof(mip6)) == -1) { rv = errno; } } @@ -209,7 +209,7 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, unsigned int loopopt = value; type = IPV6_MULTICAST_LOOP; if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - &loopopt, sizeof(loopopt)) == -1) { + (const void *) &loopopt, sizeof(loopopt)) == -1) { rv = errno; } } @@ -295,7 +295,7 @@ APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock, else if (sock_is_ipv6(sock)) { unsigned int idx = find_if_index(iface); if (setsockopt(sock->socketdes, IPPROTO_IPV6, IPV6_MULTICAST_IF, - &idx, sizeof(idx)) == -1) { + (const void *) &idx, sizeof(idx)) == -1) { rv = errno; } } From 039e03c4132255d02ee8eeb618f8aad59bebb3eb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 14 Oct 2007 01:08:57 +0000 Subject: [PATCH 5985/7878] Introduce APR_FINFO_SPARSE apr_file_open() flag, and populate the win32 behavior. This flag may (AFAIK) be ignored for unix since AIUI unix doesn't require anything special? It is only necessary on Win32 to pass this flag once; but we need to anticipate that other platforms special-handling of sparse may require the apr_file_open() call subsequently to be aware that the file is to be handled in this way. FYI the style on testlfs is horrendous, but I only affected the apr_file_open() changes required of this patch. Why on earth do we illustrate deprecated constants in our own test/s ??? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584464 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlfs.c | 59 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/test/testlfs.c b/test/testlfs.c index 694e0ea6bbe..2b109f69525 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -24,9 +24,10 @@ #include "apr_mmap.h" #include "testutil.h" -/* Only enable these tests by default on platforms which support sparse +/* XXX: bullshit - this condition needs to be made a feature-detect. + * Only enable these tests by default on platforms which support sparse * files... just Unixes? */ -#if defined(WIN32) || defined(OS2) || defined(NETWARE) +#if defined(OS2) || defined(NETWARE) static void test_nolfs(abts_case *tc, void *data) { ABTS_NOT_IMPL(tc, "Large Files tests require Sparse file support"); @@ -57,10 +58,10 @@ static void test_open(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "make test directory", rv); } - APR_ASSERT_SUCCESS(tc, "open file", - apr_file_open(&f, TESTFN, - APR_CREATE | APR_WRITE | APR_TRUNCATE, - APR_OS_DEFAULT, p)); + rv = apr_file_open(&f, TESTFN, APR_FOPEN_CREATE | APR_FOPEN_WRITE + | APR_FOPEN_TRUNCATE | APR_FOPEN_SPARSE, + APR_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open file", rv); rv = apr_file_trunc(f, eightGb); @@ -86,11 +87,13 @@ static void test_reopen(abts_case *tc, void *data) { apr_file_t *fh; apr_finfo_t finfo; + apr_status_t rv; PRECOND; - APR_ASSERT_SUCCESS(tc, "re-open 8Gb file", - apr_file_open(&fh, TESTFN, APR_READ, APR_OS_DEFAULT, p)); + rv = apr_file_open(&fh, TESTFN, APR_FOPEN_SPARSE | APR_FOPEN_READ, + APR_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "re-open 8Gb file", rv); APR_ASSERT_SUCCESS(tc, "file_info_get failed", apr_file_info_get(&finfo, APR_FINFO_NORM, fh)); @@ -126,7 +129,7 @@ static void test_readdir(abts_case *tc, void *data) do { apr_finfo_t finfo; - rv = apr_dir_read(&finfo, APR_FINFO_NORM, dh); + rv = apr_dir_read(&finfo, APR_FINFO_MIN, dh); if (rv == APR_SUCCESS && strcmp(finfo.name, TESTFILE) == 0) { ABTS_ASSERT(tc, "apr_dir_read gave incorrect size for large file", @@ -149,12 +152,14 @@ static void test_append(abts_case *tc, void *data) { apr_file_t *fh; apr_finfo_t finfo; + apr_status_t rv; PRECOND; - APR_ASSERT_SUCCESS(tc, "open 8Gb file for append", - apr_file_open(&fh, TESTFN, APR_WRITE | APR_APPEND, - APR_OS_DEFAULT, p)); + rv = apr_file_open(&fh, TESTFN, APR_FOPEN_SPARSE | APR_FOPEN_WRITE + | APR_FOPEN_APPEND, + APR_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open 8Gb file for append", rv); APR_ASSERT_SUCCESS(tc, "append to 8Gb file", apr_file_write_full(fh, TESTSTR, strlen(TESTSTR), NULL)); @@ -172,12 +177,13 @@ static void test_seek(abts_case *tc, void *data) { apr_file_t *fh; apr_off_t pos; + apr_status_t rv; PRECOND; - APR_ASSERT_SUCCESS(tc, "open 8Gb file for writing", - apr_file_open(&fh, TESTFN, APR_WRITE, - APR_OS_DEFAULT, p)); + rv = apr_file_open(&fh, TESTFN, APR_FOPEN_SPARSE | APR_FOPEN_WRITE, + APR_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open 8Gb file for writing", rv); pos = 0; APR_ASSERT_SUCCESS(tc, "relative seek to end", @@ -199,11 +205,13 @@ static void test_write(abts_case *tc, void *data) { apr_file_t *fh; apr_off_t pos = eightGb - 4; + apr_status_t rv; PRECOND; - APR_ASSERT_SUCCESS(tc, "re-open 8Gb file", - apr_file_open(&fh, TESTFN, APR_WRITE, APR_OS_DEFAULT, p)); + rv = apr_file_open(&fh, TESTFN, APR_FOPEN_SPARSE | APR_FOPEN_WRITE, + APR_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "re-open 8Gb file", rv); APR_ASSERT_SUCCESS(tc, "seek to 8Gb - 4", apr_file_seek(fh, APR_SET, &pos)); @@ -223,12 +231,14 @@ static void test_mmap(abts_case *tc, void *data) apr_file_t *fh; apr_size_t len = 16384; /* hopefully a multiple of the page size */ apr_off_t off = eightGb - len; + apr_status_t rv; void *ptr; PRECOND; - APR_ASSERT_SUCCESS(tc, "open 8gb file for mmap", - apr_file_open(&fh, TESTFN, APR_READ, APR_OS_DEFAULT, p)); + rv = apr_file_open(&fh, TESTFN, APR_FOPEN_SPARSE | APR_FOPEN_READ, + APR_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open 8gb file for mmap", rv); APR_ASSERT_SUCCESS(tc, "mmap 8Gb file", apr_mmap_create(&map, fh, off, len, APR_MMAP_READ, p)); @@ -265,14 +275,15 @@ static void test_buffered(abts_case *tc, void *data) { apr_off_t off; apr_file_t *f; + apr_status_t rv; PRECOND; - APR_ASSERT_SUCCESS(tc, "open buffered file", - apr_file_open(&f, TESTBUFFN, - APR_FOPEN_CREATE|APR_FOPEN_WRITE - |APR_FOPEN_TRUNCATE|APR_FOPEN_BUFFERED, - APR_OS_DEFAULT, p)); + rv = apr_file_open(&f, TESTBUFFN, APR_FOPEN_CREATE | APR_FOPEN_WRITE + | APR_FOPEN_TRUNCATE | APR_FOPEN_BUFFERED + | APR_FOPEN_SPARSE, + APR_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open buffered file", rv); APR_ASSERT_SUCCESS(tc, "truncate to 8GB", apr_file_trunc(f, eightGb)); From f9521419bf007526e0b46753b587d19525a89e36 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 14 Oct 2007 01:12:38 +0000 Subject: [PATCH 5986/7878] With the tests committed, introduce Win32 APR_FOPEN_SPARSE handling and document the new flag. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584465 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 67 +++++++++++++++++++++++++++++++++++++++---- include/apr.hw | 4 +-- include/apr_file_io.h | 23 ++++++++++++--- 3 files changed, 82 insertions(+), 12 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index aa3d06e090d..09acd20f397 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -32,6 +32,7 @@ #include "apr_arch_misc.h" #include "apr_arch_inherit.h" #include +#include #if APR_HAS_UNICODE_FS apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, @@ -220,6 +221,55 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) #endif } +static apr_status_t make_sparse_file(apr_file_t *file) +{ + BY_HANDLE_FILE_INFORMATION info; + apr_status_t rv; + DWORD bytesread = 0; + DWORD res; + + /* test */ + + if (GetFileInformationByHandle(file->filehand, &info) + && (info.dwFileAttributes & FILE_ATTRIBUTE_SPARSE_FILE)) + return APR_SUCCESS; + + if (file->pOverlapped) { + file->pOverlapped->Offset = 0; + file->pOverlapped->OffsetHigh = 0; + } + + if (DeviceIoControl(file->filehand, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, + &bytesread, file->pOverlapped)) { + rv = APR_SUCCESS; + } + else + { + rv = apr_get_os_error(); + + if (rv == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) + { + do { + res = WaitForSingleObject(file->pOverlapped->hEvent, + (file->timeout > 0) + ? (DWORD)(file->timeout/1000) + : ((file->timeout == -1) + ? INFINITE : 0)); + } while (res == WAIT_ABANDONED); + + if (res != WAIT_OBJECT_0) { + CancelIo(file->filehand); + } + + if (GetOverlappedResult(file->filehand, file->pOverlapped, + &bytesread, TRUE)) + rv = APR_SUCCESS; + else + rv = apr_get_os_error(); + } + } + return rv; +} apr_status_t file_cleanup(void *thefile) { @@ -371,12 +421,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, ELSE_WIN_OS_IS_ANSI { handle = CreateFileA(fname, oflags, sharemode, NULL, createflags, attributes, 0); - if (flag & APR_SENDFILE_ENABLED) { - /* This feature is not supported on this platform. - */ - flag &= ~APR_SENDFILE_ENABLED; - } - + /* These features are not supported on this platform. */ + flag &= ~(APR_SENDFILE_ENABLED | APR_FOPEN_SPARSE); } #endif if (handle == INVALID_HANDLE_VALUE) { @@ -412,6 +458,15 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, } } + if ((*new)->flags & APR_FOPEN_SPARSE) { + if ((rv = make_sparse_file(*new)) != APR_SUCCESS) + /* The great mystery; do we close the file and return an error? + * Do we add a new APR_INCOMPLETE style error saying opened, but + * NOTSPARSE? For now let's simply mark the file as not-sparse. + */ + (*new)->flags &= ~APR_FOPEN_SPARSE; + } + /* Create a pollset with room for one descriptor. */ /* ### check return codes */ (void) apr_pollset_create(&(*new)->pollset, 1, pool, 0); diff --git a/include/apr.hw b/include/apr.hw index f63635a2d9e..03434f6bf8a 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -76,9 +76,9 @@ #endif #ifndef _WIN32_WINNT -/* Restrict the server to a subset of Windows NT 4.0 header files by default +/* Restrict the server to a subset of Windows 2000 header files by default */ -#define _WIN32_WINNT 0x0400 +#define _WIN32_WINNT 0x0500 #endif #ifndef NOUSER #define NOUSER diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 3fea005d120..d3c9fc77b49 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -75,8 +75,12 @@ extern "C" { file should support apr_socket_sendfile operation */ #define APR_FOPEN_LARGEFILE 0x04000 /**< Platform dependent flag to enable - large file support; WARNING see - below. */ + * large file support, see WARNING below + */ +#define APR_FOPEN_SPARSE 0x08000 /**< Platform dependent flag to enable + * sparse file support, see WARNING below + */ + /* backcompat */ #define APR_READ APR_FOPEN_READ /**< @deprecated @see APR_FOPEN_READ */ #define APR_WRITE APR_FOPEN_WRITE /**< @deprecated @see APR_FOPEN_WRITE */ @@ -93,7 +97,7 @@ extern "C" { #define APR_SENDFILE_ENABLED APR_FOPEN_SENDFILE_ENABLED /**< @deprecated @see APR_FOPEN_SENDFILE_ENABLED */ #define APR_LARGEFILE APR_FOPEN_LARGEFILE /**< @deprecated @see APR_FOPEN_LARGEFILE */ -/** @warning The APR_FOPEN_LARGEFILE flag only has effect on some +/** @warning APR_FOPEN_LARGEFILE flag only has effect on some * platforms where sizeof(apr_off_t) == 4. Where implemented, it * allows opening and writing to a file which exceeds the size which * can be represented by apr_off_t (2 gigabytes). When a file's size @@ -102,7 +106,18 @@ extern "C" { * filename. apr_dir_read() will fail with APR_INCOMPLETE on a * directory entry for a large file depending on the particular * APR_FINFO_* flags. Generally, it is not recommended to use this - * flag. */ + * flag. + * + * @warning APR_FOPEN_SPARSE may, depending on platform, convert a + * normal file to a sparse file. Some applications may be unable + * to decipher a sparse file, so it's critical that the sparse file + * flag should only be used for files accessed only by APR or other + * applications known to be able to decipher them. APR does not + * guarentee that it will compress the file into sparse segments + * if it was previously created and written without the sparse flag. + * On platforms which do not understand, or on file systems which + * cannot handle sparse files, the flag is ignored by apr_file_open(). + */ /** @} */ From 509ea4dd804caf2e8569f3c72afbd46b0ce7deb5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 14 Oct 2007 02:14:22 +0000 Subject: [PATCH 5987/7878] Cure win32 ills, apr created threads must use apr_thread_exit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584471 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmutexscope.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testmutexscope.c b/test/testmutexscope.c index 0ea08cc634a..5318a27c321 100644 --- a/test/testmutexscope.c +++ b/test/testmutexscope.c @@ -96,6 +96,7 @@ static void * APR_THREAD_FUNC eachThread(apr_thread_t *id, void *p) assert(apr_thread_mutex_lock(thread_mutex) == APR_SUCCESS); assert(apr_thread_mutex_unlock(thread_mutex) == APR_SUCCESS); lock_release(test_mode); + apr_thread_exit(id, 0); return NULL; } From 218839cfb1d72cbf9f57e98de4751162a4358550 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 14 Oct 2007 02:19:18 +0000 Subject: [PATCH 5988/7878] Even if ignored, it's nice to have all of our tests accept the -v[erbose] flag for consistency. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584473 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlockperf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/testlockperf.c b/test/testlockperf.c index e0bf75ae83d..4a612aae322 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -38,6 +38,7 @@ int main(void) #define MAX_COUNTER 1000000 #define MAX_THREADS 6 +static verbose = 0; static long mutex_counter; static apr_thread_mutex_t *thread_lock; @@ -244,7 +245,10 @@ int main(int argc, const char * const *argv) exit(-1); } - while ((rv = apr_getopt(opt, "f:", &optchar, &optarg)) == APR_SUCCESS) { + while ((rv = apr_getopt(opt, "vf:", &optchar, &optarg)) == APR_SUCCESS) { + if (optchar == 'v') { + verbose = 1; + } if (optchar == 'f') { lockname = optarg; } From a502e124f3575be9cf7948ca239eed6754b93390 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 14 Oct 2007 02:53:27 +0000 Subject: [PATCH 5989/7878] Fix bug identified by testlfs; Win32 didn't handle buffered files >size_t bytes (we cast-truncated at the wrong spot). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584480 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/seek.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index daa48cf0fce..abebde85d1e 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -21,7 +21,7 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) { - apr_size_t newbufpos; + apr_off_t newbufpos; apr_status_t rv; DWORD rc; @@ -37,8 +37,7 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) /* We may be truncating to size here. * XXX: testing an 'unsigned' as >= 0 below indicates a bug */ - newbufpos = (apr_size_t)(pos - (thefile->filePtr - - thefile->dataRead)); + newbufpos = pos - (thefile->filePtr - thefile->dataRead); if (newbufpos >= 0 && newbufpos <= thefile->dataRead) { thefile->bufpos = (apr_size_t)newbufpos; From 2d2384a42d1c094518805ee8c7195099c715dd83 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 14 Oct 2007 06:00:00 +0000 Subject: [PATCH 5990/7878] Enhance our file_io in APR 1.3 with apr_file_pipe_create_ex(), which should replace apr_file_pipe_create() in apr 2.0. Trivial, this sets up blocking and nonblocking flavors of either pipe end. Obviously this code shrinks up threadproc/*/proc.c quite nicely. This eliminates a major class of portability concerns. On Win32, I take this one step further and fix the pipe creation logic so that nonblock pipes are always set to timeout of 0, per Eric's earlier proc.c patch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584487 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 27 +++++++++++++++ file_io/os2/pipe.c | 29 +++++++++++++++++ file_io/unix/pipe.c | 27 +++++++++++++++ file_io/win32/pipe.c | 47 ++++++++++----------------- include/apr_file_io.h | 33 +++++++++++++++++-- include/apr_thread_proc.h | 9 +++-- include/arch/win32/apr_arch_file_io.h | 29 ----------------- 7 files changed, 139 insertions(+), 62 deletions(-) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 4b6b8268878..d4da1943b38 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -177,6 +177,33 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *pool) +{ + apr_status_t status; + + if ((status = apr_file_pipe_create(in, out, attr->pool)) + != APR_SUCCESS) { + return status; + } + + switch (blocking) { + case APR_FULL_BLOCK: + break; + case APR_READ_BLOCK: + apr_file_pipe_timeout_set(*in, 0); + break; + case APR_WRITE_BLOCK: + apr_file_pipe_timeout_set(*out, 0); + break; + default: + apr_file_pipe_timeout_set(*in, 0); + apr_file_pipe_timeout_set(*out, 0); + } +} + APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *pool) { diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index ee2b2b004ec..15eb7c262ed 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -104,6 +104,35 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out +APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *pool) +{ + apr_status_t status; + + if ((status = apr_file_pipe_create(in, out, attr->pool)) + != APR_SUCCESS) { + return status; + } + + switch (blocking) { + case APR_FULL_BLOCK: + break; + case APR_READ_BLOCK: + apr_file_pipe_timeout_set(*in, 0); + break; + case APR_WRITE_BLOCK: + apr_file_pipe_timeout_set(*out, 0); + break; + default: + apr_file_pipe_timeout_set(*in, 0); + apr_file_pipe_timeout_set(*out, 0); + } +} + + + APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *pool) { /* Not yet implemented, interface not suitable */ diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 5411f5d4078..884b72833b5 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -222,6 +222,33 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *pool) +{ + apr_status_t status; + + if ((status = apr_file_pipe_create(in, out, attr->pool)) + != APR_SUCCESS) { + return status; + } + + switch (blocking) { + case APR_FULL_BLOCK: + break; + case APR_READ_BLOCK: + apr_file_pipe_timeout_set(*in, 0); + break; + case APR_WRITE_BLOCK: + apr_file_pipe_timeout_set(*out, 0); + break; + default: + apr_file_pipe_timeout_set(*in, 0); + apr_file_pipe_timeout_set(*out, 0); + } +} + APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *pool) { diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 31092c12ccb..ee3a07fa1b2 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -31,7 +31,8 @@ #endif #include "apr_arch_misc.h" -APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, + apr_interval_time_t timeout) { /* Always OK to unset timeouts */ if (timeout == -1) { @@ -50,40 +51,26 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_int return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) +APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, + apr_interval_time_t *timeout) { /* Always OK to get the timeout (even if it's unset ... -1) */ *timeout = thepipe->timeout; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, + apr_file_t **out, + apr_pool_t *p) { /* Unix creates full blocking pipes. */ - return apr_create_nt_pipe(in, out, APR_FULL_BLOCK, p); + return apr_file_pipe_create_ex(in, out, APR_FULL_BLOCK, p); } -/* apr_create_nt_pipe() - * An internal (for now) APR function used by apr_proc_create() - * when setting up pipes to communicate with the child process. - * apr_create_nt_pipe() allows setting the blocking mode of each end of - * the pipe when the pipe is created (rather than after the pipe is created). - * A pipe handle must be opened in full async i/o mode in order to - * emulate Unix non-blocking pipes with timeouts. - * - * In general, we don't want to enable child side pipe handles for async i/o. - * This prevents us from enabling both ends of the pipe for async i/o in - * apr_file_pipe_create. - * - * Why not use NamedPipes on NT which support setting pipe state to - * non-blocking? On NT, even though you can set a pipe non-blocking, - * there is no clean way to set event driven non-zero timeouts (e.g select(), - * WaitForSingleObject, et. al. will not detect pipe i/o). On NT, you - * have to poll the pipe to detect i/o on a non-blocking pipe. - */ -apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, - apr_int32_t blocking_mode, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *p) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -137,11 +124,12 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, if (apr_os_level >= APR_WIN_NT) { /* Create the read end of the pipe */ dwOpenMode = PIPE_ACCESS_INBOUND; - if (blocking_mode == APR_WRITE_BLOCK /* READ_NONBLOCK */ - || blocking_mode == APR_FULL_NONBLOCK) { + if (blocking == APR_WRITE_BLOCK /* READ_NONBLOCK */ + || blocking == APR_FULL_NONBLOCK) { dwOpenMode |= FILE_FLAG_OVERLAPPED; (*in)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED)); (*in)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + (*in)->timeout = 0; } dwPipeMode = 0; @@ -159,11 +147,12 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, /* Create the write end of the pipe */ dwOpenMode = FILE_ATTRIBUTE_NORMAL; - if (blocking_mode == APR_READ_BLOCK /* WRITE_NONBLOCK */ - || blocking_mode == APR_FULL_NONBLOCK) { + if (blocking == APR_READ_BLOCK /* WRITE_NONBLOCK */ + || blocking == APR_FULL_NONBLOCK) { dwOpenMode |= FILE_FLAG_OVERLAPPED; (*out)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED)); (*out)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + (*out)->timeout = 0; } (*out)->filehand = CreateFile(name, diff --git a/include/apr_file_io.h b/include/apr_file_io.h index d3c9fc77b49..2c0962ee128 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -633,17 +633,46 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, /** * Create an anonymous pipe. - * @param in The file descriptor to use as input to the pipe. - * @param out The file descriptor to use as output from the pipe. + * @param in The newly created pipe's file for writing. + * @param out The newly created pipe's file for reading. * @param pool The pool to operate on. * @remark By default, the returned file descriptors will be inherited * by child processes created using apr_proc_create(). This can be * changed using apr_file_inherit_unset(). + * @bug Some platforms cannot toggle between blocking and nonblocking, + * and when passing a pipe as a standard handle to an application which + * does not expect it, a non-blocking stream will fluxor the client app. + * @deprecated @see apr_file_pipe_create_ex */ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool); +/** + * Create an anonymous pipe which portably supports async timeout options. + * @param in The newly created pipe's file for writing. + * @param out The newly created pipe's file for reading. + * @param blocking one of these values defined in apr_thread_proc.h; + *
    + *       APR_FULL_BLOCK
    + *       APR_READ_BLOCK
    + *       APR_WRITE_BLOCK
    + *       APR_FULL_NONBLOCK
    + * 
    + * @remark By default, the returned file descriptors will be inherited + * by child processes created using apr_proc_create(). This can be + * changed using apr_file_inherit_unset(). + * @remark Some platforms cannot toggle between blocking and nonblocking, + * and when passing a pipe as a standard handle to an application which + * does not expect it, a non-blocking stream will fluxor the client app. + * Use this function rather than apr_file_pipe_create to create pipes + * where one or both ends require non-blocking semantics. + */ +APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *p); + /** * Create a named pipe. * @param filename The filename of the named pipe diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index ae9c2f2f565..f5f7678ed8e 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -77,9 +77,9 @@ typedef enum { /** @see apr_procattr_io_set */ #define APR_NO_PIPE 0 -/** @see apr_procattr_io_set */ +/** @see apr_procattr_io_set and apr_file_pipe_create_ex */ #define APR_FULL_BLOCK 1 -/** @see apr_procattr_io_set */ +/** @see apr_procattr_io_set and apr_file_pipe_create_ex */ #define APR_FULL_NONBLOCK 2 /** @see apr_procattr_io_set */ #define APR_PARENT_BLOCK 3 @@ -88,6 +88,11 @@ typedef enum { /** @see apr_procattr_io_set */ #define APR_NO_FILE 8 +/** @see apr_file_pipe_create_ex */ +#define APR_READ_BLOCK 3 +/** @see apr_file_pipe_create_ex */ +#define APR_WRITE_BLOCK 4 + /** @see apr_procattr_io_set * @note Win32 only effective with version 1.2.12, portably introduced in 1.3.0 */ diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index 6807546bf75..3086d0fb839 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -251,33 +251,4 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p); apr_status_t file_cleanup(void *); -/** - * Internal function to create a Win32/NT pipe that respects some async - * timeout options. - * @param in new read end of the created pipe - * @param out new write end of the created pipe - * @param blocking_mode one of - *
    - *       APR_FULL_BLOCK
    - *       APR_READ_BLOCK
    - *       APR_WRITE_BLOCK
    - *       APR_FULL_NONBLOCK
    - * 
    - * @remark It so happens that APR_FULL_BLOCK and APR_FULL_NONBLOCK - * are common to apr_procattr_io_set() in, out and err modes. - * Because APR_CHILD_BLOCK and APR_WRITE_BLOCK share the same value, - * as do APR_PARENT_BLOCK and APR_READ_BLOCK, it's possible to use - * that value directly for creating the stdout/stderr pipes. When - * creating the stdin pipe, the values must be transposed. - * @see apr_procattr_io_set - */ -apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, - apr_int32_t blocking_mode, - apr_pool_t *p); - -/** @see apr_create_nt_pipe */ -#define APR_READ_BLOCK 3 -/** @see apr_create_nt_pipe */ -#define APR_WRITE_BLOCK 4 - #endif /* ! FILE_IO_H */ From 9b09507095954c69ddd90586ca21b81a47851d49 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 14 Oct 2007 06:12:00 +0000 Subject: [PATCH 5991/7878] Had inverted read/write. This is why you don't do things like this, in/out is ambiguous. (you write things in-to a pipe and read things out-of a pipe, well except in APR ;-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584489 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 6 +++--- file_io/os2/pipe.c | 6 +++--- file_io/unix/pipe.c | 6 +++--- include/apr_file_io.h | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index d4da1943b38..3bc370076f3 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -193,14 +193,14 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, case APR_FULL_BLOCK: break; case APR_READ_BLOCK: - apr_file_pipe_timeout_set(*in, 0); + apr_file_pipe_timeout_set(*out, 0); break; case APR_WRITE_BLOCK: - apr_file_pipe_timeout_set(*out, 0); + apr_file_pipe_timeout_set(*in, 0); break; default: - apr_file_pipe_timeout_set(*in, 0); apr_file_pipe_timeout_set(*out, 0); + apr_file_pipe_timeout_set(*in, 0); } } diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 15eb7c262ed..69eb9779470 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -120,14 +120,14 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, case APR_FULL_BLOCK: break; case APR_READ_BLOCK: - apr_file_pipe_timeout_set(*in, 0); + apr_file_pipe_timeout_set(*out, 0); break; case APR_WRITE_BLOCK: - apr_file_pipe_timeout_set(*out, 0); + apr_file_pipe_timeout_set(*in, 0); break; default: - apr_file_pipe_timeout_set(*in, 0); apr_file_pipe_timeout_set(*out, 0); + apr_file_pipe_timeout_set(*in, 0); } } diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 884b72833b5..4735a278b3a 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -238,14 +238,14 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, case APR_FULL_BLOCK: break; case APR_READ_BLOCK: - apr_file_pipe_timeout_set(*in, 0); + apr_file_pipe_timeout_set(*out, 0); break; case APR_WRITE_BLOCK: - apr_file_pipe_timeout_set(*out, 0); + apr_file_pipe_timeout_set(*in, 0); break; default: - apr_file_pipe_timeout_set(*in, 0); apr_file_pipe_timeout_set(*out, 0); + apr_file_pipe_timeout_set(*in, 0); } } diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 2c0962ee128..e37f95890d5 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -633,8 +633,8 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, /** * Create an anonymous pipe. - * @param in The newly created pipe's file for writing. - * @param out The newly created pipe's file for reading. + * @param in The newly created pipe's file for reading. + * @param out The newly created pipe's file for writing. * @param pool The pool to operate on. * @remark By default, the returned file descriptors will be inherited * by child processes created using apr_proc_create(). This can be @@ -650,8 +650,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, /** * Create an anonymous pipe which portably supports async timeout options. - * @param in The newly created pipe's file for writing. - * @param out The newly created pipe's file for reading. + * @param in The newly created pipe's file for reading. + * @param out The newly created pipe's file for writing. * @param blocking one of these values defined in apr_thread_proc.h; *
      *       APR_FULL_BLOCK
    
    From c4619e5f9f6b83d65c305056c726f448ad7f66b4 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 06:21:49 +0000
    Subject: [PATCH 5992/7878] Fix read, if we successfully cancel it's operation
     aborted.
    
    Write needs to be refactored!!!
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584493 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/readwrite.c | 7 +++++--
     1 file changed, 5 insertions(+), 2 deletions(-)
    
    diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c
    index 7aad713c3c9..35d3739a1bd 100644
    --- a/file_io/win32/readwrite.c
    +++ b/file_io/win32/readwrite.c
    @@ -114,8 +114,9 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le
                 }
                 else {
                     rv = apr_get_os_error();
    -                if (rv == APR_FROM_OS_ERROR(ERROR_IO_INCOMPLETE) 
    -                       && res == WAIT_TIMEOUT)
    +                if (((rv == APR_FROM_OS_ERROR(ERROR_IO_INCOMPLETE))
    +                        || (rv == APR_FROM_OS_ERROR(ERROR_OPERATION_ABORTED)))
    +                    && (res == WAIT_TIMEOUT))
                         rv = APR_TIMEUP;
                 }
             }
    @@ -331,6 +332,8 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a
             else {
                 (*nbytes) = 0;
                 rv = apr_get_os_error();
    +
    +            /* XXX: This must be corrected, per the apr_file_read logic!!! */
                 if (rv == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) {
      
                     DWORD timeout_ms;
    
    From 27614c7134756904060d8a56e01fe38065232615 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 06:22:27 +0000
    Subject: [PATCH 5993/7878] Illustrate the use of the new API which succeeds on
     all platforms (we will hope).
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584494 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testpipe.c | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/test/testpipe.c b/test/testpipe.c
    index bb0cafef212..819c8aa2769 100644
    --- a/test/testpipe.c
    +++ b/test/testpipe.c
    @@ -56,12 +56,12 @@ static void set_timeout(abts_case *tc, void *data)
         apr_status_t rv;
         apr_interval_time_t timeout;
     
    -    rv = apr_file_pipe_create(&readp, &writep, p);
    +    rv = apr_file_pipe_create_ex(&readp, &writep, APR_WRITE_BLOCK, p);
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_PTR_NOTNULL(tc, readp);
         ABTS_PTR_NOTNULL(tc, writep);
     
    -    rv = apr_file_pipe_timeout_get(readp, &timeout);
    +    rv = apr_file_pipe_timeout_get(writep, &timeout);
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_ASSERT(tc, "Timeout mismatch, expected -1", timeout == -1);
     
    @@ -83,7 +83,7 @@ static void read_write(abts_case *tc, void *data)
         nbytes = strlen("this is a test");
         buf = (char *)apr_palloc(p, nbytes + 1);
     
    -    rv = apr_file_pipe_create(&readp, &writep, p);
    +    rv = apr_file_pipe_create_ex(&readp, &writep, APR_WRITE_BLOCK, p);
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_PTR_NOTNULL(tc, readp);
         ABTS_PTR_NOTNULL(tc, writep);
    
    From 17e2dcbc398e879aa7039fe3f1b493d204dbd520 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 06:33:14 +0000
    Subject: [PATCH 5994/7878] With the correction of setting ->timeout = 0 way up
     in the apr_file_pipe_create_ex() for win32, many lines are redundant. Thanks
     to Eric for picking up on this mess in the first place!
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584496 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/win32/proc.c | 64 ++++++-----------------------------------
     1 file changed, 9 insertions(+), 55 deletions(-)
    
    diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c
    index b152a1da348..2c7dcabc80a 100644
    --- a/threadproc/win32/proc.c
    +++ b/threadproc/win32/proc.c
    @@ -83,10 +83,9 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
     
         if (in) {
             /* APR_CHILD_BLOCK maps to APR_WRITE_BLOCK, while
    -         * APR_PARENT_BLOCK maps to APR_READ_BLOCK, so we
    -         * must transpose the CHILD/PARENT blocking flags
    -         * only for the stdin pipe.  stdout/stderr naturally
    -         * map to the correct mode.
    +         * APR_PARENT_BLOCK maps to APR_READ_BLOCK, so transpose 
    +         * the CHILD/PARENT blocking flags for the stdin pipe.
    +         * stdout/stderr map to the correct mode by default.
              */
             if (in == APR_CHILD_BLOCK)
                 in = APR_READ_BLOCK;
    @@ -96,23 +95,8 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
             if (in == APR_NO_FILE)
                 attr->child_in = &no_file;
             else { 
    -            stat = apr_create_nt_pipe(&attr->child_in, &attr->parent_in,
    -                                      in, attr->pool);
    -            if (stat == APR_SUCCESS) { 
    -                switch (in) { 
    -                    case APR_FULL_BLOCK:
    -                        break;
    -                    case APR_READ_BLOCK:
    -                        apr_file_pipe_timeout_set(attr->parent_in, 0);
    -                        break;
    -                    case APR_WRITE_BLOCK:
    -                        apr_file_pipe_timeout_set(attr->child_in, 0);
    -                        break;
    -                    default:
    -                        apr_file_pipe_timeout_set(attr->child_in, 0);
    -                        apr_file_pipe_timeout_set(attr->parent_in, 0);
    -                }
    -            }
    +            stat = apr_file_pipe_create_ex(&attr->child_in, &attr->parent_in,
    +                                           in, attr->pool);
             }
             if (stat == APR_SUCCESS)
                 stat = apr_file_inherit_unset(attr->parent_in);
    @@ -121,23 +105,8 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
             if (out == APR_NO_FILE)
                 attr->child_out = &no_file;
             else { 
    -            stat = apr_create_nt_pipe(&attr->parent_out, &attr->child_out,
    -                                      out, attr->pool);
    -            if (stat == APR_SUCCESS) { 
    -                switch (out) {
    -                    case APR_FULL_BLOCK:
    -                        break;
    -                    case APR_PARENT_BLOCK:
    -                        apr_file_pipe_timeout_set(attr->child_out, 0);
    -                        break;
    -                    case APR_CHILD_BLOCK:
    -                        apr_file_pipe_timeout_set(attr->parent_out, 0);
    -                        break;
    -                    default:
    -                        apr_file_pipe_timeout_set(attr->child_out, 0);
    -                        apr_file_pipe_timeout_set(attr->parent_out, 0);
    -                }
    -            }
    +            stat = apr_file_pipe_create_ex(&attr->parent_out, &attr->child_out,
    +                                           out, attr->pool);
             }
             if (stat == APR_SUCCESS)
                 stat = apr_file_inherit_unset(attr->parent_out);
    @@ -146,23 +115,8 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
             if (err == APR_NO_FILE)
                 attr->child_err = &no_file;
             else { 
    -            stat = apr_create_nt_pipe(&attr->parent_err, &attr->child_err,
    -                                      err, attr->pool);
    -            if (stat == APR_SUCCESS) { 
    -                switch (err) {
    -                    case APR_FULL_BLOCK:
    -                        break;
    -                    case APR_PARENT_BLOCK:
    -                        apr_file_pipe_timeout_set(attr->child_err, 0);
    -                        break;
    -                    case APR_CHILD_BLOCK:
    -                        apr_file_pipe_timeout_set(attr->parent_err, 0);
    -                        break;
    -                    default:
    -                        apr_file_pipe_timeout_set(attr->child_err, 0);
    -                        apr_file_pipe_timeout_set(attr->parent_err, 0);
    -                }
    -            }
    +            stat = apr_file_pipe_create_ex(&attr->parent_err, &attr->child_err,
    +                                           err, attr->pool);
             }
             if (stat == APR_SUCCESS)
                 stat = apr_file_inherit_unset(attr->parent_err);
    
    From b5bd05a9acadac747eacefda1b415554c5fe8912 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 06:47:36 +0000
    Subject: [PATCH 5995/7878] Small cut and paste 'feature'.  (Ok, can't be a
     feature if it doesn't even compile).
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584497 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/netware/pipe.c | 4 +---
     file_io/os2/pipe.c     | 4 +---
     file_io/unix/pipe.c    | 4 +---
     3 files changed, 3 insertions(+), 9 deletions(-)
    
    diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c
    index 3bc370076f3..ecbc4522526 100644
    --- a/file_io/netware/pipe.c
    +++ b/file_io/netware/pipe.c
    @@ -184,10 +184,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in,
     {
         apr_status_t status;
     
    -    if ((status = apr_file_pipe_create(in, out, attr->pool)) 
    -               != APR_SUCCESS) {
    +    if ((status = apr_file_pipe_create(in, out, pool)) != APR_SUCCESS)
             return status;
    -    }
     
         switch (blocking) {
             case APR_FULL_BLOCK:
    diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c
    index 69eb9779470..5859c1d7d62 100644
    --- a/file_io/os2/pipe.c
    +++ b/file_io/os2/pipe.c
    @@ -111,10 +111,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in,
     {
         apr_status_t status;
     
    -    if ((status = apr_file_pipe_create(in, out, attr->pool)) 
    -               != APR_SUCCESS) {
    +    if ((status = apr_file_pipe_create(in, out, pool)) != APR_SUCCESS)
             return status;
    -    }
     
         switch (blocking) {
             case APR_FULL_BLOCK:
    diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c
    index 4735a278b3a..981170eaf59 100644
    --- a/file_io/unix/pipe.c
    +++ b/file_io/unix/pipe.c
    @@ -229,10 +229,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in,
     {
         apr_status_t status;
     
    -    if ((status = apr_file_pipe_create(in, out, attr->pool)) 
    -               != APR_SUCCESS) {
    +    if ((status = apr_file_pipe_create(in, out, pool)) != APR_SUCCESS)
             return status;
    -    }
     
         switch (blocking) {
             case APR_FULL_BLOCK:
    
    From ab9ad3909278a151d46f756e3d1a72baddfacfd5 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 06:57:18 +0000
    Subject: [PATCH 5996/7878] Solve two potential problems with one shot.
    
    First; we absolutely do NOT want to waste our time creating a pipe,
    when the caller has their own file descriptors all set up to give to
    the child process (and use itself).  We can also presume a single
    ended pipe is about as interesting as the sound of one hand clapping.
    
    Create the pipe only when we don't already have any child/parent pipes
    set up, and when the caller passes no files for us to use.  Otherwise,
    we simply dup for our own use rather than dup2.
    
    Second; we absolutely cannot dup2 into the static 'no_file' special fd,
    so we'll guard against this and also dup, instead, for this case.
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584500 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/unix/proc.c | 143 +++++++++++++++++++----------------------
     1 file changed, 66 insertions(+), 77 deletions(-)
    
    diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
    index 21b44d4b826..7ade722fa64 100644
    --- a/threadproc/unix/proc.c
    +++ b/threadproc/unix/proc.c
    @@ -44,78 +44,41 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
                                                   apr_int32_t out,
                                                   apr_int32_t err)
     {
    -    apr_status_t status;
    -    if ((in != APR_NO_PIPE) && (in != APR_NO_FILE)) {
    -        if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in,
    -                                           attr->pool)) != APR_SUCCESS) {
    -            return status;
    -        }
    +    apr_status_t rv;
     
    -        switch (in) {
    -        case APR_FULL_BLOCK:
    -            break;
    -        case APR_PARENT_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_in, 0);
    -            break;
    -        case APR_CHILD_BLOCK:
    -            apr_file_pipe_timeout_set(attr->parent_in, 0);
    -            break;
    -        default:
    -            apr_file_pipe_timeout_set(attr->child_in, 0);
    -            apr_file_pipe_timeout_set(attr->parent_in, 0);
    -        }
    +    if ((in != APR_NO_PIPE) && (in != APR_NO_FILE)) {
    +        /* APR_CHILD_BLOCK maps to APR_WRITE_BLOCK, while
    +         * APR_PARENT_BLOCK maps to APR_READ_BLOCK, so transpose 
    +         * the CHILD/PARENT blocking flags for the stdin pipe.
    +         * stdout/stderr map to the correct mode by default.
    +         */
    +        if (in == APR_CHILD_BLOCK)
    +            in = APR_READ_BLOCK;
    +        else if (in == APR_PARENT_BLOCK)
    +            in = APR_WRITE_BLOCK;
    +
    +        if ((rv = apr_file_pipe_create_ex(&attr->child_in, &attr->parent_in,
    +                                          in, attr->pool)) != APR_SUCCESS)
    +            return rv;
         }
    -    else if (in == APR_NO_FILE) {
    +    else if (in == APR_NO_FILE)
             attr->child_in = &no_file;
    -    }
     
         if ((out != APR_NO_PIPE) && (out != APR_NO_FILE)) {
    -        if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out,
    -                                           attr->pool)) != APR_SUCCESS) {
    -            return status;
    -        }
    -
    -        switch (out) {
    -        case APR_FULL_BLOCK:
    -            break;
    -        case APR_PARENT_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_out, 0);
    -            break;
    -        case APR_CHILD_BLOCK:
    -            apr_file_pipe_timeout_set(attr->parent_out, 0);
    -            break;
    -        default:
    -            apr_file_pipe_timeout_set(attr->child_out, 0);
    -            apr_file_pipe_timeout_set(attr->parent_out, 0);
    -        }
    +        if ((rv = apr_file_pipe_create_ex(&attr->parent_out, &attr->child_out,
    +                                          out, attr->pool)) != APR_SUCCESS)
    +            return rv;
         }
    -    else if (out == APR_NO_FILE) {
    +    else if (out == APR_NO_FILE)
             attr->child_out = &no_file;
    -    }
     
         if ((err != APR_NO_PIPE) && (err != APR_NO_FILE)) {
    -        if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err,
    -                                           attr->pool)) != APR_SUCCESS) {
    -            return status;
    -        }
    -
    -        switch (err) {
    -        case APR_FULL_BLOCK:
    -            break;
    -        case APR_PARENT_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_err, 0);
    -            break;
    -        case APR_CHILD_BLOCK:
    -            apr_file_pipe_timeout_set(attr->parent_err, 0);
    -            break;
    -        default:
    -            apr_file_pipe_timeout_set(attr->child_err, 0);
    -            apr_file_pipe_timeout_set(attr->parent_err, 0);
    -        }
    +        if ((rv = apr_file_pipe_create_ex(&attr->parent_err, &attr->child_err,
    +                                          err, attr->pool)) != APR_SUCCESS)
    +            return rv;
         }
    -    else if (err == APR_NO_FILE) {
    +    else if (err == APR_NO_FILE)
             attr->child_err = &no_file;
    -    }
     
         return APR_SUCCESS;
     }
    @@ -127,14 +90,23 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr,
     {
         apr_status_t rv = APR_SUCCESS;
     
    -    if (attr->child_in == NULL && attr->parent_in == NULL)
    +    if (attr->child_in == NULL && attr->parent_in == NULL
    +           && child_in == NULL && parent_in == NULL)
             rv = apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool);
         
    -    if (child_in != NULL && rv == APR_SUCCESS)
    -        rv = apr_file_dup2(attr->child_in, child_in, attr->pool);
    +    if (child_in != NULL && rv == APR_SUCCESS) {
    +        if (attr->child_in && (attr->child_in->filedes != -1))
    +            rv = apr_file_dup2(attr->child_in, child_in, attr->pool);
    +        else
    +            rv = apr_file_dup(&attr->child_in, child_in, attr->pool);
    +    }
     
    -    if (parent_in != NULL && rv == APR_SUCCESS)
    -        rv = apr_file_dup2(attr->parent_in, parent_in, attr->pool);
    +    if (parent_in != NULL && rv == APR_SUCCESS) {
    +        if (attr->parent_in)
    +            rv = apr_file_dup2(attr->parent_in, parent_in, attr->pool);
    +        else
    +            rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool);
    +    }
     
         return rv;
     }
    @@ -146,14 +118,23 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr,
     {
         apr_status_t rv = APR_SUCCESS;
     
    -    if (attr->child_out == NULL && attr->parent_out == NULL)
    +    if (attr->child_out == NULL && attr->parent_out == NULL
    +           && child_out == NULL && parent_out == NULL)
             rv = apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool);
     
    -    if (child_out != NULL && rv == APR_SUCCESS)
    -        rv = apr_file_dup2(attr->child_out, child_out, attr->pool);
    +    if (child_out != NULL && rv == APR_SUCCESS) {
    +        if (attr->child_out && (attr->child_out->filedes != -1))
    +            rv = apr_file_dup2(attr->child_out, child_out, attr->pool);
    +        else
    +            rv = apr_file_dup(&attr->child_out, child_out, attr->pool);
    +    }
     
    -    if (parent_out != NULL && rv == APR_SUCCESS)
    -        rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool);
    +    if (parent_out != NULL && rv == APR_SUCCESS) {
    +        if (attr->parent_out)
    +            rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool);
    +        else
    +            rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool);
    +    }
     
         return rv;
     }
    @@ -165,14 +146,22 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr,
     {
         apr_status_t rv = APR_SUCCESS;
     
    -    if (attr->child_err == NULL && attr->parent_err == NULL)
    +    if (attr->child_err == NULL && attr->parent_err == NULL
    +           && child_err == NULL && parent_err == NULL)
             rv = apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool);
     
    -    if (child_err != NULL && rv == APR_SUCCESS)
    -        rv = apr_file_dup2(attr->child_err, child_err, attr->pool);
    -
    -    if (parent_err != NULL && rv == APR_SUCCESS)
    -        rv = apr_file_dup2(attr->parent_err, parent_err, attr->pool);
    +    if (child_err != NULL && rv == APR_SUCCESS) {
    +        if (attr->child_err && (attr->child_err->filedes != -1))
    +            rv = apr_file_dup2(attr->child_err, child_err, attr->pool);
    +        else
    +            rv = apr_file_dup(&attr->child_err, child_err, attr->pool);
    +    }
    +    if (parent_err != NULL && rv == APR_SUCCESS) {
    +        if (attr->parent_err)
    +            rv = apr_file_dup2(attr->parent_err, parent_err, attr->pool);
    +        else
    +            rv = apr_file_dup(&attr->parent_err, parent_err, attr->pool);
    +    }
     
         return rv;
     }
    
    From f354eaa3faf3379da4f6b9d47f661328e7433876 Mon Sep 17 00:00:00 2001
    From: Ruediger Pluem 
    Date: Sun, 14 Oct 2007 09:54:48 +0000
    Subject: [PATCH 5997/7878] * Dereference mem as it is a double pointer.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584522 13f79535-47bb-0310-9956-ffa450edef68
    ---
     atomic/unix/mutex.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/atomic/unix/mutex.c b/atomic/unix/mutex.c
    index cb23ede3479..be443a44aa9 100644
    --- a/atomic/unix/mutex.c
    +++ b/atomic/unix/mutex.c
    @@ -192,7 +192,7 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void
     APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with)
     {
         void *prev;
    -    DECLARE_MUTEX_LOCKED(mutex, mem);
    +    DECLARE_MUTEX_LOCKED(mutex, *mem);
     
         prev = *mem;
         *mem = with;
    
    From 7263e6cc3179584013220cb9307901dc0173f0ea Mon Sep 17 00:00:00 2001
    From: Ruediger Pluem 
    Date: Sun, 14 Oct 2007 09:55:15 +0000
    Subject: [PATCH 5998/7878] * Fix compiler warning.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584523 13f79535-47bb-0310-9956-ffa450edef68
    ---
     atomic/unix/mutex.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/atomic/unix/mutex.c b/atomic/unix/mutex.c
    index be443a44aa9..fba3be2ba15 100644
    --- a/atomic/unix/mutex.c
    +++ b/atomic/unix/mutex.c
    @@ -194,7 +194,7 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with)
         void *prev;
         DECLARE_MUTEX_LOCKED(mutex, *mem);
     
    -    prev = *mem;
    +    prev = *(void **)mem;
         *mem = with;
     
         MUTEX_UNLOCK(mutex);
    
    From 58a7bc183c002eafb51a79a63be16d889fdb0f99 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sun, 14 Oct 2007 13:07:15 +0000
    Subject: [PATCH 5999/7878] Eric seconded Bill's description for the Windows
     apr_procattr_io_set() fix
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584538 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 5 +++--
     1 file changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 3fd69ceaac8..322875ce64f 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,8 +1,9 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 1.3.0
     
    -  *) apr_procattr_io_set() on Windows: Set pipe handles non-blocking as
    -     appropriate based on the input parameters.  PR 43522.
    +  *) apr_procattr_io_set() on Windows: Set non-blocking pipe handles
    +     to a default timeout of 0, following the Unix default.  No effect
    +     on pipe handles configured to block.  PR 43522.
          [Eric Covener ]
     
       *) apr_file_write() on Windows: Fix return code when writing to a non-
    
    From dfdd38e04933c3cae023f320677489690fb58a2d Mon Sep 17 00:00:00 2001
    From: Ruediger Pluem 
    Date: Sun, 14 Oct 2007 13:34:42 +0000
    Subject: [PATCH 6000/7878] * Return APR_SUCCESS by default.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584543 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/netware/pipe.c | 2 ++
     file_io/os2/pipe.c     | 2 ++
     file_io/unix/pipe.c    | 2 ++
     3 files changed, 6 insertions(+)
    
    diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c
    index ecbc4522526..1abf41405d3 100644
    --- a/file_io/netware/pipe.c
    +++ b/file_io/netware/pipe.c
    @@ -200,6 +200,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in,
                 apr_file_pipe_timeout_set(*out, 0);
                 apr_file_pipe_timeout_set(*in, 0);
         }
    +
    +    return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, 
    diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c
    index 5859c1d7d62..211c43cde31 100644
    --- a/file_io/os2/pipe.c
    +++ b/file_io/os2/pipe.c
    @@ -127,6 +127,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in,
                 apr_file_pipe_timeout_set(*out, 0);
                 apr_file_pipe_timeout_set(*in, 0);
         }
    +
    +    return APR_SUCCESS;
     }
     
         
    diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c
    index 981170eaf59..0411aa5f027 100644
    --- a/file_io/unix/pipe.c
    +++ b/file_io/unix/pipe.c
    @@ -245,6 +245,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in,
                 apr_file_pipe_timeout_set(*out, 0);
                 apr_file_pipe_timeout_set(*in, 0);
         }
    +
    +    return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, 
    
    From b4588c0f343b21b4708b42fb67b94607fb259386 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 16:11:57 +0000
    Subject: [PATCH 6001/7878] Davi indicates this test really isn't ready yet,
     but it would be worth introducing one if it's results become meaningful.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584563 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testcond.c | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/test/testcond.c b/test/testcond.c
    index 77b6ea8b50b..17bb0301fe7 100644
    --- a/test/testcond.c
    +++ b/test/testcond.c
    @@ -379,8 +379,10 @@ static void pipe_consumer(toolbox_t *box)
             ABTS_TRUE(tc, ch == '.');
         } while (1);
     
    -    /* naive fairness test */
    -    ABTS_INT_EQUAL(tc, 1, !!consumed);
    +    /* naive fairness test - it would be good to introduce or solidify
    +     * a solid test to ensure one thread is not starved.  
    +     * ABTS_INT_EQUAL(tc, 1, !!consumed);
    +     */
     }
     
     static void pipe_write(toolbox_t *box, char ch)
    
    From f3b4ef1a6c8fdeaf6cb73c8c0e94fbd63d59a99a Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 17:35:48 +0000
    Subject: [PATCH 6002/7878] apr_file_dup() varies from dup2 by not setting the
     child handle as inherited.  Solve this by setting the duplicated handle to
     inherit.
    
    once finished with the fork(), now that we don't waste pipe creation
    resources on a single handle, watch out for closing the parent handle
    inside the child.
    
    in fact I believe that toggling parent_* handles apr_file_inherit_unset
    way back in apr_procattr_io_set / apr_procattr_child_*_set would be
    more efficient; comments?
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584569 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/unix/proc.c | 42 ++++++++++++++++++++++++++++++------------
     1 file changed, 30 insertions(+), 12 deletions(-)
    
    diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
    index 7ade722fa64..8be773a1ece 100644
    --- a/threadproc/unix/proc.c
    +++ b/threadproc/unix/proc.c
    @@ -92,13 +92,18 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr,
     
         if (attr->child_in == NULL && attr->parent_in == NULL
                && child_in == NULL && parent_in == NULL)
    -        rv = apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool);
    +        rv = apr_file_pipe_create(&attr->child_in, &attr->parent_in,
    +                                  attr->pool);
         
         if (child_in != NULL && rv == APR_SUCCESS) {
             if (attr->child_in && (attr->child_in->filedes != -1))
                 rv = apr_file_dup2(attr->child_in, child_in, attr->pool);
    -        else
    -            rv = apr_file_dup(&attr->child_in, child_in, attr->pool);
    +        else {
    +            attr->child_in = NULL;
    +            if ((rv = apr_file_dup(&attr->child_in, child_in, attr->pool))
    +                    == APR_SUCCESS)
    +                rv = apr_file_inherit_set(attr->child_in);
    +        }
         }
     
         if (parent_in != NULL && rv == APR_SUCCESS) {
    @@ -120,13 +125,18 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr,
     
         if (attr->child_out == NULL && attr->parent_out == NULL
                && child_out == NULL && parent_out == NULL)
    -        rv = apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool);
    +        rv = apr_file_pipe_create(&attr->parent_out, &attr->child_out,
    +                                  attr->pool);
     
         if (child_out != NULL && rv == APR_SUCCESS) {
             if (attr->child_out && (attr->child_out->filedes != -1))
                 rv = apr_file_dup2(attr->child_out, child_out, attr->pool);
    -        else
    -            rv = apr_file_dup(&attr->child_out, child_out, attr->pool);
    +        else {
    +            attr->child_out = NULL;
    +            if ((rv = apr_file_dup(&attr->child_out, child_out, attr->pool))
    +                    == APR_SUCCESS)
    +                rv = apr_file_inherit_set(attr->child_out);
    +        }
         }
     
         if (parent_out != NULL && rv == APR_SUCCESS) {
    @@ -148,13 +158,18 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr,
     
         if (attr->child_err == NULL && attr->parent_err == NULL
                && child_err == NULL && parent_err == NULL)
    -        rv = apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool);
    +        rv = apr_file_pipe_create(&attr->parent_err, &attr->child_err,
    +                                  attr->pool);
     
         if (child_err != NULL && rv == APR_SUCCESS) {
             if (attr->child_err && (attr->child_err->filedes != -1))
                 rv = apr_file_dup2(attr->child_err, child_err, attr->pool);
    -        else
    -            rv = apr_file_dup(&attr->child_err, child_err, attr->pool);
    +        else {
    +            attr->child_err = NULL;
    +            if ((rv = apr_file_dup(&attr->child_err, child_err, attr->pool))
    +                    == APR_SUCCESS)
    +                rv = apr_file_inherit_set(attr->child_err);
    +        }
         }
         if (parent_err != NULL && rv == APR_SUCCESS) {
             if (attr->parent_err)
    @@ -409,7 +424,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
                 close(STDIN_FILENO);
             }
             else if (attr->child_in) {
    -            apr_file_close(attr->parent_in);
    +            if (attr->parent_in)
    +                apr_file_close(attr->parent_in);
                 dup2(attr->child_in->filedes, STDIN_FILENO);
                 apr_file_close(attr->child_in);
             }
    @@ -418,7 +434,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
                 close(STDOUT_FILENO);
             }
             else if (attr->child_out) {
    -            apr_file_close(attr->parent_out);
    +            if (attr->parent_out)
    +                apr_file_close(attr->parent_out);
                 dup2(attr->child_out->filedes, STDOUT_FILENO);
                 apr_file_close(attr->child_out);
             }
    @@ -427,7 +444,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
                 close(STDERR_FILENO);
             }
             else if (attr->child_err) {
    -            apr_file_close(attr->parent_err);
    +            if (attr->parent_err)
    +                apr_file_close(attr->parent_err);
                 dup2(attr->child_err->filedes, STDERR_FILENO);
                 apr_file_close(attr->child_err);
             }
    
    From ed85d6cd8c2a9cac4b7ebd1ae9c302c02f2dd508 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 18:00:37 +0000
    Subject: [PATCH 6003/7878] Here's my recommendation; upon opening the pipes,
     always set the parent-end of the pipe to uninherited.  Let it be closed upon
     cleanup_for_exec.
    
    The later dup2() for the parent pipe does not automagically become inherited
    again, and later dup()'s are never inherited by default.
    
    There's no longer an explicit need to close the parent-end in proc_create
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584570 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/unix/proc.c | 33 ++++++++++++++++++---------------
     1 file changed, 18 insertions(+), 15 deletions(-)
    
    diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
    index 8be773a1ece..d0754013863 100644
    --- a/threadproc/unix/proc.c
    +++ b/threadproc/unix/proc.c
    @@ -58,7 +58,9 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
                 in = APR_WRITE_BLOCK;
     
             if ((rv = apr_file_pipe_create_ex(&attr->child_in, &attr->parent_in,
    -                                          in, attr->pool)) != APR_SUCCESS)
    +                                          in, attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_in);
    +        if (rv != APR_SUCCESS)
                 return rv;
         }
         else if (in == APR_NO_FILE)
    @@ -66,7 +68,9 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
     
         if ((out != APR_NO_PIPE) && (out != APR_NO_FILE)) {
             if ((rv = apr_file_pipe_create_ex(&attr->parent_out, &attr->child_out,
    -                                          out, attr->pool)) != APR_SUCCESS)
    +                                          out, attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_out);
    +        if (rv != APR_SUCCESS)
                 return rv;
         }
         else if (out == APR_NO_FILE)
    @@ -75,6 +79,8 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
         if ((err != APR_NO_PIPE) && (err != APR_NO_FILE)) {
             if ((rv = apr_file_pipe_create_ex(&attr->parent_err, &attr->child_err,
                                               err, attr->pool)) != APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_err);
    +        if (rv != APR_SUCCESS)
                 return rv;
         }
         else if (err == APR_NO_FILE)
    @@ -92,9 +98,10 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr,
     
         if (attr->child_in == NULL && attr->parent_in == NULL
                && child_in == NULL && parent_in == NULL)
    -        rv = apr_file_pipe_create(&attr->child_in, &attr->parent_in,
    -                                  attr->pool);
    -    
    +        if ((rv = apr_file_pipe_create(&attr->child_in, &attr->parent_in,
    +                                       attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_in);
    +
         if (child_in != NULL && rv == APR_SUCCESS) {
             if (attr->child_in && (attr->child_in->filedes != -1))
                 rv = apr_file_dup2(attr->child_in, child_in, attr->pool);
    @@ -125,8 +132,9 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr,
     
         if (attr->child_out == NULL && attr->parent_out == NULL
                && child_out == NULL && parent_out == NULL)
    -        rv = apr_file_pipe_create(&attr->parent_out, &attr->child_out,
    -                                  attr->pool);
    +        if ((rv = apr_file_pipe_create(&attr->parent_out, &attr->child_out,
    +                                       attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_out);
     
         if (child_out != NULL && rv == APR_SUCCESS) {
             if (attr->child_out && (attr->child_out->filedes != -1))
    @@ -158,8 +166,9 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr,
     
         if (attr->child_err == NULL && attr->parent_err == NULL
                && child_err == NULL && parent_err == NULL)
    -        rv = apr_file_pipe_create(&attr->parent_err, &attr->child_err,
    -                                  attr->pool);
    +        if ((rv = apr_file_pipe_create(&attr->parent_err, &attr->child_err,
    +                                      attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_err);
     
         if (child_err != NULL && rv == APR_SUCCESS) {
             if (attr->child_err && (attr->child_err->filedes != -1))
    @@ -424,8 +433,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
                 close(STDIN_FILENO);
             }
             else if (attr->child_in) {
    -            if (attr->parent_in)
    -                apr_file_close(attr->parent_in);
                 dup2(attr->child_in->filedes, STDIN_FILENO);
                 apr_file_close(attr->child_in);
             }
    @@ -434,8 +441,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
                 close(STDOUT_FILENO);
             }
             else if (attr->child_out) {
    -            if (attr->parent_out)
    -                apr_file_close(attr->parent_out);
                 dup2(attr->child_out->filedes, STDOUT_FILENO);
                 apr_file_close(attr->child_out);
             }
    @@ -444,8 +449,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
                 close(STDERR_FILENO);
             }
             else if (attr->child_err) {
    -            if (attr->parent_err)
    -                apr_file_close(attr->parent_err);
                 dup2(attr->child_err->filedes, STDERR_FILENO);
                 apr_file_close(attr->child_err);
             }
    
    From e666ccddc066c49f7503b4f1a5c931af8c88ce81 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 18:01:28 +0000
    Subject: [PATCH 6004/7878] Note API change.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584571 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 6 ++++++
     1 file changed, 6 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index 322875ce64f..be62849e142 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,6 +1,12 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 1.3.0
     
    +  *) Introduce apr_file_pipe_create_ex() to portably permit one pipe
    +     end or another to be entirely blocking for non-APR applications
    +     (e.g. stdio streams) and the other (or both ends) non blocking,
    +     with a timeout of 0 by default.
    +     [William Rowe]
    +
       *) apr_procattr_io_set() on Windows: Set non-blocking pipe handles
          to a default timeout of 0, following the Unix default.  No effect
          on pipe handles configured to block.  PR 43522.
    
    From 32255b0b5c15258c11ad9b4a849a63e41df43024 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 18:04:42 +0000
    Subject: [PATCH 6005/7878] Note an anomoly that was probably not intended.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584572 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_thread_proc.h | 9 +++++++++
     1 file changed, 9 insertions(+)
    
    diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h
    index f5f7678ed8e..4bcc4eeb855 100644
    --- a/include/apr_thread_proc.h
    +++ b/include/apr_thread_proc.h
    @@ -425,6 +425,9 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
      *          process invocations - such as a log file. You can save some 
      *          extra function calls by not creating your own pipe since this
      *          creates one in the process space for you.
    + * @bug Note that calling this function with two NULL files on some platforms
    + * creates an APR_FULL_BLOCK pipe, but this behavior is neither portable nor
    + * is it supported.  @see apr_procattr_io_set instead for simple pipes.
      */
     APR_DECLARE(apr_status_t) apr_procattr_child_in_set(struct apr_procattr_t *attr,
                                                       apr_file_t *child_in,
    @@ -439,6 +442,9 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(struct apr_procattr_t *attr,
      *         useful if you have already opened a pipe (or multiple files)
      *         that you wish to use, perhaps persistently across multiple
      *         process invocations - such as a log file. 
    + * @bug Note that calling this function with two NULL files on some platforms
    + * creates an APR_FULL_BLOCK pipe, but this behavior is neither portable nor
    + * is it supported.  @see apr_procattr_io_set instead for simple pipes.
      */
     APR_DECLARE(apr_status_t) apr_procattr_child_out_set(struct apr_procattr_t *attr,
                                                        apr_file_t *child_out,
    @@ -453,6 +459,9 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(struct apr_procattr_t *attr
      *         useful if you have already opened a pipe (or multiple files)
      *         that you wish to use, perhaps persistently across multiple
      *         process invocations - such as a log file. 
    + * @bug Note that calling this function with two NULL files on some platforms
    + * creates an APR_FULL_BLOCK pipe, but this behavior is neither portable nor
    + * is it supported.  @see apr_procattr_io_set instead for simple pipes.
      */
     APR_DECLARE(apr_status_t) apr_procattr_child_err_set(struct apr_procattr_t *attr,
                                                        apr_file_t *child_err,
    
    From e866766683e217d2a3dbf9f4a6eba0c6844a2656 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 19:03:51 +0000
    Subject: [PATCH 6006/7878] When building check / test, let's make sure to
     build the modules we aren't able to automagically invoke, too.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584578 13f79535-47bb-0310-9956-ffa450edef68
    ---
     Makefile.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/Makefile.in b/Makefile.in
    index f43eab070f6..df7a171283f 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -117,7 +117,7 @@ gcov:
     
     test: check
     check: $(TARGET_LIB)
    -	(cd test && $(MAKE) check)
    +	(cd test && $(MAKE) all check)
     
     etags:
     	etags `find . -name '*.[ch]'`
    
    From b43bd4b9b4134e451bce749ee75cdde85e49eda7 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 19:12:00 +0000
    Subject: [PATCH 6007/7878] Here is the correct cast for signed-ness where
     size_t is off_t bytes long, while size_t is unsigned and off_t is usually
     signed. This is true of Windows/x64
    
    This solves the emit without causing truncation, we have the
    assumption that off_t can't possibly be smaller than size_t
    (or how would one have a swapfile :)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584581 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/seek.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c
    index abebde85d1e..53e53dd7d0f 100644
    --- a/file_io/win32/seek.c
    +++ b/file_io/win32/seek.c
    @@ -39,7 +39,7 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos )
          */
         newbufpos = pos - (thefile->filePtr - thefile->dataRead);
     
    -    if (newbufpos >= 0 && newbufpos <= thefile->dataRead) {
    +    if (newbufpos >= 0 && newbufpos <= (apr_off_t)thefile->dataRead) {
             thefile->bufpos = (apr_size_t)newbufpos;
             rv = APR_SUCCESS;
         } else {
    
    From 4c561c5df836d6b3f76b478d9d2ac91acedd6010 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 19:16:18 +0000
    Subject: [PATCH 6008/7878] Silence an emit for P64 and LP64 platforms, where
     int can't represent a pointer delta.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584584 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/inet_pton.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/network_io/unix/inet_pton.c b/network_io/unix/inet_pton.c
    index 22b15390fc3..d41f74965ab 100644
    --- a/network_io/unix/inet_pton.c
    +++ b/network_io/unix/inet_pton.c
    @@ -223,8 +223,8 @@ inet_pton6(const char *src, unsigned char *dst)
     		 * Since some memmove()'s erroneously fail to handle
     		 * overlapping regions, we'll do the shift by hand.
     		 */
    -		const int n = tp - colonp;
    -		int i;
    +		const apr_ssize_t n = tp - colonp;
    +		apr_ssize_t i;
     
     		for (i = 1; i <= n; i++) {
     			endp[- i] = colonp[n - i];
    
    From b24e1efc8a843a3e2e66e6cc8f85a93be0382162 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 19:24:12 +0000
    Subject: [PATCH 6009/7878] Solve two int-size issues on some platforms; exit
     is well defined to return an (int) while on some platforms read/write is
     still expressed as unsigned int bytes of data.  Both harmless truncations.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584587 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/proc_child.c | 6 +++---
     test/sockchild.c  | 4 ++--
     2 files changed, 5 insertions(+), 5 deletions(-)
    
    diff --git a/test/proc_child.c b/test/proc_child.c
    index 405bb7f5b6c..6cfc8fc9fb4 100644
    --- a/test/proc_child.c
    +++ b/test/proc_child.c
    @@ -11,11 +11,11 @@
     int main(void)
     {
         char buf[256];
    -    apr_ssize_t bytes;
    +    int bytes;
         
    -    bytes = read(STDIN_FILENO, buf, 256);
    +    bytes = (int)read(STDIN_FILENO, buf, 256);
         if (bytes > 0)
    -        write(STDOUT_FILENO, buf, bytes);
    +        write(STDOUT_FILENO, buf, (unsigned int)bytes);
     
         return 0; /* just to keep the compiler happy */
     }
    diff --git a/test/sockchild.c b/test/sockchild.c
    index 5c15d113fbe..3803d00afa9 100644
    --- a/test/sockchild.c
    +++ b/test/sockchild.c
    @@ -67,14 +67,14 @@ int main(int argc, char *argv[])
                 exit(-1);
             }
             
    -        exit(length);
    +        exit((int)length);
         }
         else if (!strcmp("write", argv[1])) {
             apr_size_t length = strlen(DATASTR);
             apr_socket_send(sock, DATASTR, &length);
     
             apr_socket_close(sock);
    -        exit(length);
    +        exit((int)length);
         }
         exit(-1);
     }
    
    From 07f9f028b365a7fef69bfa0032d1e2875e1f370a Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 22:16:21 +0000
    Subject: [PATCH 6010/7878] We are reasonably confident this behaves as
     expected, and while we will continue to emit noise when the strings mismatch,
     apr_filepath_get didn't promise any canonicalized correct path.
    
    mingw/cygwin users requested the drive case check already
    since those can show up as lowercase (and we canonicalize
    these 26 values to uppercase for consistency), I just
    observed the same on Windows 2003 Server SP2.
    
    But worse, the string compare is bogus, since one can
    set their path to c:\Apache~.6 when canonically the path
    is c:\Apache2.2.6, and we didn't promise otherwise.  We'll
    gently ignore this exception on OS2/Netware/Win32 where
    I presume the same can happen.
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584625 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testnames.c | 16 +++++++++++++++-
     1 file changed, 15 insertions(+), 1 deletion(-)
    
    diff --git a/test/testnames.c b/test/testnames.c
    index dec227a8513..b39d1080de4 100644
    --- a/test/testnames.c
    +++ b/test/testnames.c
    @@ -228,13 +228,18 @@ static void root_from_cwd_and_back(abts_case *tc, void *data)
         const char *path = "//";
         char *origpath;
         char *testpath;
    +    int hadfailed;
     
         ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_filepath_get(&origpath, 0, p));
         path = origpath;
         rv = apr_filepath_root(&root, &path, APR_FILEPATH_TRUENAME, p);
     
     #if defined(WIN32) || defined(OS2)
    -    ABTS_INT_EQUAL(tc, origpath[0], root[0]);
    +    hadfailed = tc->failed;
    +    /* It appears some mingw/cygwin and more modern builds can return
    +     * a lowercase drive designation, but we canonicalize to uppercase
    +     */
    +    ABTS_INT_EQUAL(tc, toupper(origpath[0]), root[0]);
         ABTS_INT_EQUAL(tc, ':', root[1]);
         ABTS_INT_EQUAL(tc, '/', root[2]);
         ABTS_INT_EQUAL(tc, 0, root[3]);
    @@ -262,7 +267,16 @@ static void root_from_cwd_and_back(abts_case *tc, void *data)
                               | APR_FILEPATH_NOTABOVEROOT
                               | APR_FILEPATH_NOTRELATIVE, p);
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
    +    hadfailed = tc->failed;
    +    /* The API doesn't promise equality!!! 
    +     * apr_filepath_get never promised a canonical filepath.
    +     * We'll emit noise under verbose so the user is aware,
    +     * but translate this back to success.
    +     */
         ABTS_STR_EQUAL(tc, origpath, testpath);
    +#if defined(WIN32) || defined(OS2) || defined(NETWARE)
    +    if (!hadfailed) tc->failed = 0;
    +#endif
     }
     
     
    
    From ef6cae3eaef2d4325571f628a87015fb144ab8ef Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 23:07:43 +0000
    Subject: [PATCH 6011/7878] recvfrom() failed on most platforms with a sockaddr
     only large enough to hold an ipv6 address.  Big shock.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584634 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testsockets.c | 10 ++++++----
     1 file changed, 6 insertions(+), 4 deletions(-)
    
    diff --git a/test/testsockets.c b/test/testsockets.c
    index f54a2de5f5f..86c92451641 100644
    --- a/test/testsockets.c
    +++ b/test/testsockets.c
    @@ -103,7 +103,8 @@ static void udp6_socket(abts_case *tc, void *data)
     #endif
     }
     
    -static void sendto_receivefrom_helper(abts_case *tc, const char *addr, int family)
    +static void sendto_receivefrom_helper(abts_case *tc, const char *addr, 
    +                                      const char *junkaddr, int family)
     {
         apr_status_t rv;
         apr_socket_t *sock = NULL;
    @@ -152,7 +153,8 @@ static void sendto_receivefrom_helper(abts_case *tc, const char *addr, int famil
     
         /* fill the "from" sockaddr with a random address to ensure that
          * recvfrom sets it up properly. */
    -    apr_sockaddr_info_get(&from, "127.1.2.3", APR_INET, 4242, 0, p);
    +    rv = apr_sockaddr_info_get(&from, junkaddr, family, 4242, 0, p);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     
         len = 80;
         rv = apr_socket_recvfrom(from, sock, 0, recvbuf, &len);
    @@ -171,10 +173,10 @@ static void sendto_receivefrom_helper(abts_case *tc, const char *addr, int famil
     
     static void sendto_receivefrom(abts_case *tc, void *data)
     {
    +    sendto_receivefrom_helper(tc, "127.0.0.1",  "127.1.2.3", APR_INET);
     #if APR_HAVE_IPV6
    -    sendto_receivefrom_helper(tc, "::1", APR_INET6);
    +    sendto_receivefrom_helper(tc, "::1", "FA0E::1234:127.1.2.3", APR_INET6);
     #endif
    -    sendto_receivefrom_helper(tc, "127.0.0.1", APR_INET);
     }
     
     static void socket_userdata(abts_case *tc, void *data)
    
    From 495ef7d887932cc6a049b3b8e3f1ccfedf498c2f Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Sun, 14 Oct 2007 23:39:06 +0000
    Subject: [PATCH 6012/7878] Patch to resolve one stray case of AF not
     available.
    
    Also patch for OS2, Windows AF codes.  What a joke.
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584637 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testsockets.c | 15 +++++++++++++--
     1 file changed, 13 insertions(+), 2 deletions(-)
    
    diff --git a/test/testsockets.c b/test/testsockets.c
    index 86c92451641..b9a26f942c6 100644
    --- a/test/testsockets.c
    +++ b/test/testsockets.c
    @@ -59,10 +59,16 @@ static void udp_socket(abts_case *tc, void *data)
     /* On recent Linux systems, whilst IPv6 is always supported by glibc,
      * socket(AF_INET6, ...) calls will fail with EAFNOSUPPORT if the
      * "ipv6" kernel module is not loaded.  */
    -#ifdef EAFNOSUPPORT
    +#if defined(WSAEAFNOSUPPORT)
    +#define V6_NOT_ENABLED(e) ((e) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT)
    +#elif defined(SOCEAFNOSUPPORT)
    +#define V6_NOT_ENABLED(e) ((e) == APR_OS_START_SYSERR + SOCEAFNOSUPPORT)
    +#elif defined(EAFNOSUPPORT)
     #define V6_NOT_ENABLED(e) ((e) == EAFNOSUPPORT)
    +#elif !APR_HAVE_IPV6
    +#define V6_NOT_ENABLED(e) (1)
     #else
    -#define V6_NOT_ENABLED(e) (0)
    +#error MUST have an EAFNOSUPPORT class of error code to enable IPv6!
     #endif
     
     static void tcp6_socket(abts_case *tc, void *data)
    @@ -118,6 +124,10 @@ static void sendto_receivefrom_helper(abts_case *tc, const char *addr,
         apr_size_t len = 30;
     
         rv = apr_socket_create(&sock, family, SOCK_DGRAM, 0, p);
    +    if ((family == APR_INET6) && V6_NOT_ENABLED(rv)) {
    +        ABTS_NOT_IMPL(tc, "IPv6 not enabled");
    +        return;
    +    }
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         if (rv != APR_SUCCESS)
             return;
    @@ -173,6 +183,7 @@ static void sendto_receivefrom_helper(abts_case *tc, const char *addr,
     
     static void sendto_receivefrom(abts_case *tc, void *data)
     {
    +    apr_status_t rv;
         sendto_receivefrom_helper(tc, "127.0.0.1",  "127.1.2.3", APR_INET);
     #if APR_HAVE_IPV6
         sendto_receivefrom_helper(tc, "::1", "FA0E::1234:127.1.2.3", APR_INET6);
    
    From 6311d30350ad92c21e48d6b9e83873f6f3e2877e Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 15 Oct 2007 00:07:22 +0000
    Subject: [PATCH 6013/7878] Test won't compile on AIX, stop overloading symbol
     names!
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584642 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testmmap.c | 18 +++++++++---------
     1 file changed, 9 insertions(+), 9 deletions(-)
    
    diff --git a/test/testmmap.c b/test/testmmap.c
    index ff5e2a4b2d4..f09d857b7f5 100644
    --- a/test/testmmap.c
    +++ b/test/testmmap.c
    @@ -39,8 +39,8 @@ static void not_implemented(abts_case *tc, void *data)
     static apr_mmap_t *themmap = NULL;
     static apr_file_t *thefile = NULL;
     static char *file1;
    -static apr_finfo_t finfo;
    -static apr_size_t fsize;
    +static apr_finfo_t thisfinfo;
    +static apr_size_t thisfsize;
     
     static void create_filename(abts_case *tc, void *data)
     {
    @@ -82,16 +82,16 @@ static void test_get_filesize(abts_case *tc, void *data)
     {
         apr_status_t rv;
     
    -    rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile);
    +    rv = apr_file_info_get(&thisfinfo, APR_FINFO_NORM, thefile);
         ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
    -    ABTS_ASSERT(tc, "File size mismatch", fsize == finfo.size);
    +    ABTS_ASSERT(tc, "File size mismatch", thisfsize == thisfinfo.size);
     }
     
     static void test_mmap_create(abts_case *tc, void *data)
     {
         apr_status_t rv;
     
    -    rv = apr_mmap_create(&themmap, thefile, 0, (apr_size_t) finfo.size, 
    +    rv = apr_mmap_create(&themmap, thefile, 0, (apr_size_t) thisfinfo.size, 
     		                 APR_MMAP_READ, p);
         ABTS_PTR_NOTNULL(tc, themmap);
         ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
    @@ -102,10 +102,10 @@ static void test_mmap_contents(abts_case *tc, void *data)
         
         ABTS_PTR_NOTNULL(tc, themmap);
         ABTS_PTR_NOTNULL(tc, themmap->mm);
    -    ABTS_SIZE_EQUAL(tc, fsize, themmap->size);
    +    ABTS_SIZE_EQUAL(tc, thisfsize, themmap->size);
     
         /* Must use nEquals since the string is not guaranteed to be NULL terminated */
    -    ABTS_STR_NEQUAL(tc, themmap->mm, TEST_STRING, fsize);
    +    ABTS_STR_NEQUAL(tc, themmap->mm, TEST_STRING, thisfsize);
     }
     
     static void test_mmap_delete(abts_case *tc, void *data)
    @@ -126,7 +126,7 @@ static void test_mmap_offset(abts_case *tc, void *data)
         rv = apr_mmap_offset(&addr, themmap, 5);
     
         /* Must use nEquals since the string is not guaranteed to be NULL terminated */
    -    ABTS_STR_NEQUAL(tc, addr, TEST_STRING + 5, fsize-5);
    +    ABTS_STR_NEQUAL(tc, addr, TEST_STRING + 5, thisfsize-5);
     }
     #endif
     
    @@ -135,7 +135,7 @@ abts_suite *testmmap(abts_suite *suite)
         suite = ADD_SUITE(suite)
     
     #if APR_HAS_MMAP    
    -    fsize = strlen(TEST_STRING);
    +    thisfsize = strlen(TEST_STRING);
     
         abts_run_test(suite, create_filename, NULL);
         abts_run_test(suite, test_file_open, NULL);
    
    From ca8c5bfc1bdc464a89f34c59dd182c8d8f6f2c00 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 15 Oct 2007 01:07:29 +0000
    Subject: [PATCH 6014/7878] Prevent the suite from crashing on win32, watch out
     for an empty sa result when using win32 with IPv6 extentions and no IPv6
     driver; it seems it leverages the driver to resolve the third class of IPv6
     addresses on Win XP SP2 at least.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584650 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testipsub.c | 6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/test/testipsub.c b/test/testipsub.c
    index 1411cd05a7c..ea29487e7c3 100644
    --- a/test/testipsub.c
    +++ b/test/testipsub.c
    @@ -111,11 +111,13 @@ static void test_interesting_subnets(abts_case *tc, void *data)
             char *in_subnet, *not_in_subnet;
         } testcases[] =
         {
    -        {"9.67",              NULL,            APR_INET,  "9.67.113.15",         "10.1.2.3"}
    +         {"9.67",             NULL,            APR_INET,  "9.67.113.15",         "10.1.2.3"}
             ,{"9.67.0.0",         "16",            APR_INET,  "9.67.113.15",         "10.1.2.3"}
             ,{"9.67.0.0",         "255.255.0.0",   APR_INET,  "9.67.113.15",         "10.1.2.3"}
             ,{"9.67.113.99",      "16",            APR_INET,  "9.67.113.15",         "10.1.2.3"}
             ,{"9.67.113.99",      "255.255.255.0", APR_INET,  "9.67.113.15",         "10.1.2.3"}
    +        ,{"127",              NULL,            APR_INET,  "127.0.0.1",           "10.1.2.3"}
    +        ,{"127.0.0.1",        "8",             APR_INET,  "127.0.0.1",           "10.1.2.3"}
     #if APR_HAVE_IPV6
             ,{"fe80::",           "8",             APR_INET6, "fe80::1",             "ff01::1"}
             ,{"ff01::",           "8",             APR_INET6, "ff01::1",             "fe80::1"}
    @@ -134,6 +136,8 @@ static void test_interesting_subnets(abts_case *tc, void *data)
             ABTS_TRUE(tc, rv == APR_SUCCESS);
             rv = apr_sockaddr_info_get(&sa, testcases[i].in_subnet, testcases[i].family, 0, 0, p);
             ABTS_TRUE(tc, rv == APR_SUCCESS);
    +        ABTS_TRUE(tc, sa != NULL);
    +        if (!sa) continue;
             rc = apr_ipsubnet_test(ipsub, sa);
             ABTS_TRUE(tc, rc != 0);
             rv = apr_sockaddr_info_get(&sa, testcases[i].not_in_subnet, testcases[i].family, 0, 0, p);
    
    From ba686ffd245326fb90b670de3f1cc20bf1abb744 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 15 Oct 2007 02:35:35 +0000
    Subject: [PATCH 6015/7878] Fix testsockets the right way, moving forwards
     share a clue with the user.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584657 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_errno.h | 16 +++++++++++++++-
     test/testsockets.c  | 22 +++-------------------
     2 files changed, 18 insertions(+), 20 deletions(-)
    
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 9995446ec7e..56014f885ab 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -824,6 +824,13 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_ENOTEMPTY     (APR_OS_START_CANONERR + 26)
     #endif
     
    +/** @see APR_STATUS_IS_EAFNOSUPPORT */
    +#ifdef EAFNOSUPPORT
    +#define APR_EAFNOSUPPORT EAFNOSUPPORT
    +#else
    +#define APR_EAFNOSUPPORT  (APR_OS_START_CANONERR + 27)
    +#endif
    +
     /** @} */
     
     #if defined(OS2) && !defined(DOXYGEN)
    @@ -966,6 +973,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_ENOTEMPTY(s)      ((s) == APR_ENOTEMPTY \
                     || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY \
                     || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED)
    +#define APR_STATUS_IS_EAFNOSUPPORT(s)   ((s) == APR_AFNOSUPPORT \
    +                || (s) == APR_OS_START_SYSERR + SOCEAFNOSUPPORT)
     
     /*
         Sorry, too tired to wrap this up for OS2... feel free to
    @@ -981,7 +990,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
         { SOCESOCKTNOSUPPORT,       ESOCKTNOSUPPORT },
         { SOCEOPNOTSUPP,            EOPNOTSUPP      },
         { SOCEPFNOSUPPORT,          EPFNOSUPPORT    },
    -    { SOCEAFNOSUPPORT,          EAFNOSUPPORT    },
         { SOCEADDRINUSE,            EADDRINUSE      },
         { SOCEADDRNOTAVAIL,         EADDRNOTAVAIL   },
         { SOCENETDOWN,              ENETDOWN        },
    @@ -1109,6 +1117,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
                     || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE)
     #define APR_STATUS_IS_ENOTEMPTY(s)      ((s) == APR_ENOTEMPTY \
                     || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY)
    +#define APR_STATUS_IS_EAFNOSUPPORT(s)   ((s) == APR_EAFNOSUPPORT \
    +                || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT)
     
     #elif defined(NETWARE) && defined(USE_WINSOCK) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */
     
    @@ -1168,6 +1178,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_STATUS_IS_EPIPE(s)          ((s) == APR_EPIPE)
     #define APR_STATUS_IS_EXDEV(s)          ((s) == APR_EXDEV)
     #define APR_STATUS_IS_ENOTEMPTY(s)      ((s) == APR_ENOTEMPTY)
    +#define APR_STATUS_IS_EAFNOSUPPORT(s)   ((s) == APR_EAFNOSUPPORT \
    +                || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT)
     
     #else /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */
     
    @@ -1285,6 +1297,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     /** Directory Not Empty */
     #define APR_STATUS_IS_ENOTEMPTY(s)       ((s) == APR_ENOTEMPTY || \
                                               (s) == APR_EEXIST)
    +/** Address Family not supported */
    +#define APR_STATUS_IS_EAFNOSUPPORT(s)    ((s) == APR_EAFNOSUPPORT)
     /** @} */
     
     #endif /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */
    diff --git a/test/testsockets.c b/test/testsockets.c
    index b9a26f942c6..bd8165b7531 100644
    --- a/test/testsockets.c
    +++ b/test/testsockets.c
    @@ -56,21 +56,6 @@ static void udp_socket(abts_case *tc, void *data)
         apr_socket_close(sock);
     }
     
    -/* On recent Linux systems, whilst IPv6 is always supported by glibc,
    - * socket(AF_INET6, ...) calls will fail with EAFNOSUPPORT if the
    - * "ipv6" kernel module is not loaded.  */
    -#if defined(WSAEAFNOSUPPORT)
    -#define V6_NOT_ENABLED(e) ((e) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT)
    -#elif defined(SOCEAFNOSUPPORT)
    -#define V6_NOT_ENABLED(e) ((e) == APR_OS_START_SYSERR + SOCEAFNOSUPPORT)
    -#elif defined(EAFNOSUPPORT)
    -#define V6_NOT_ENABLED(e) ((e) == EAFNOSUPPORT)
    -#elif !APR_HAVE_IPV6
    -#define V6_NOT_ENABLED(e) (1)
    -#else
    -#error MUST have an EAFNOSUPPORT class of error code to enable IPv6!
    -#endif
    -
     static void tcp6_socket(abts_case *tc, void *data)
     {
     #if APR_HAVE_IPV6
    @@ -78,7 +63,7 @@ static void tcp6_socket(abts_case *tc, void *data)
         apr_socket_t *sock = NULL;
     
         rv = apr_socket_create(&sock, APR_INET6, SOCK_STREAM, 0, p);
    -    if (V6_NOT_ENABLED(rv)) {
    +    if (APR_STATUS_IS_EAFNOSUPPORT(rv)) {
             ABTS_NOT_IMPL(tc, "IPv6 not enabled");
             return;
         }
    @@ -97,7 +82,7 @@ static void udp6_socket(abts_case *tc, void *data)
         apr_socket_t *sock = NULL;
     
         rv = apr_socket_create(&sock, APR_INET6, SOCK_DGRAM, 0, p);
    -    if (V6_NOT_ENABLED(rv)) {
    +    if (APR_STATUS_IS_EAFNOSUPPORT(rv)) {
             ABTS_NOT_IMPL(tc, "IPv6 not enabled");
             return;
         }
    @@ -124,7 +109,7 @@ static void sendto_receivefrom_helper(abts_case *tc, const char *addr,
         apr_size_t len = 30;
     
         rv = apr_socket_create(&sock, family, SOCK_DGRAM, 0, p);
    -    if ((family == APR_INET6) && V6_NOT_ENABLED(rv)) {
    +    if ((family == APR_INET6) && APR_STATUS_IS_EAFNOSUPPORT(rv)) {
             ABTS_NOT_IMPL(tc, "IPv6 not enabled");
             return;
         }
    @@ -183,7 +168,6 @@ static void sendto_receivefrom_helper(abts_case *tc, const char *addr,
     
     static void sendto_receivefrom(abts_case *tc, void *data)
     {
    -    apr_status_t rv;
         sendto_receivefrom_helper(tc, "127.0.0.1",  "127.1.2.3", APR_INET);
     #if APR_HAVE_IPV6
         sendto_receivefrom_helper(tc, "::1", "FA0E::1234:127.1.2.3", APR_INET6);
    
    From 03d69a49d8608fa43628363ebe7fa2e5992afbaf Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 15 Oct 2007 02:38:16 +0000
    Subject: [PATCH 6016/7878] Better isolate IPv6 tests from the rest, and split
     recvfrom tests to make clear which test failed.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584658 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testsockets.c | 26 ++++++++++++++++----------
     1 file changed, 16 insertions(+), 10 deletions(-)
    
    diff --git a/test/testsockets.c b/test/testsockets.c
    index bd8165b7531..5cd35e1e32e 100644
    --- a/test/testsockets.c
    +++ b/test/testsockets.c
    @@ -56,9 +56,9 @@ static void udp_socket(abts_case *tc, void *data)
         apr_socket_close(sock);
     }
     
    +#if APR_HAVE_IPV6
     static void tcp6_socket(abts_case *tc, void *data)
     {
    -#if APR_HAVE_IPV6
         apr_status_t rv;
         apr_socket_t *sock = NULL;
     
    @@ -70,14 +70,10 @@ static void tcp6_socket(abts_case *tc, void *data)
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_PTR_NOTNULL(tc, sock);
         apr_socket_close(sock);
    -#else
    -    ABTS_NOT_IMPL(tc, "IPv6");
    -#endif
     }
     
     static void udp6_socket(abts_case *tc, void *data)
     {
    -#if APR_HAVE_IPV6
         apr_status_t rv;
         apr_socket_t *sock = NULL;
     
    @@ -89,10 +85,8 @@ static void udp6_socket(abts_case *tc, void *data)
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_PTR_NOTNULL(tc, sock);
         apr_socket_close(sock);
    -#else
    -    ABTS_NOT_IMPL(tc, "IPv6");
    -#endif
     }
    +#endif
     
     static void sendto_receivefrom_helper(abts_case *tc, const char *addr, 
                                           const char *junkaddr, int family)
    @@ -109,10 +103,12 @@ static void sendto_receivefrom_helper(abts_case *tc, const char *addr,
         apr_size_t len = 30;
     
         rv = apr_socket_create(&sock, family, SOCK_DGRAM, 0, p);
    +#if APR_HAVE_IPV6
         if ((family == APR_INET6) && APR_STATUS_IS_EAFNOSUPPORT(rv)) {
             ABTS_NOT_IMPL(tc, "IPv6 not enabled");
             return;
         }
    +#endif
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         if (rv != APR_SUCCESS)
             return;
    @@ -169,10 +165,16 @@ static void sendto_receivefrom_helper(abts_case *tc, const char *addr,
     static void sendto_receivefrom(abts_case *tc, void *data)
     {
         sendto_receivefrom_helper(tc, "127.0.0.1",  "127.1.2.3", APR_INET);
    +    ABTS_TRUE(tc, !tc->failed);
    +}
    +
     #if APR_HAVE_IPV6
    +static void sendto_receivefrom6(abts_case *tc, void *data)
    +{
         sendto_receivefrom_helper(tc, "::1", "FA0E::1234:127.1.2.3", APR_INET6);
    -#endif
    +    ABTS_TRUE(tc, !tc->failed);
     }
    +#endif
     
     static void socket_userdata(abts_case *tc, void *data)
     {
    @@ -206,10 +208,14 @@ abts_suite *testsockets(abts_suite *suite)
         abts_run_test(suite, tcp_socket, NULL);
         abts_run_test(suite, udp_socket, NULL);
     
    +    abts_run_test(suite, sendto_receivefrom, NULL);
    +
    +#if APR_HAVE_IPV6
         abts_run_test(suite, tcp6_socket, NULL);
         abts_run_test(suite, udp6_socket, NULL);
     
    -    abts_run_test(suite, sendto_receivefrom, NULL);
    +    abts_run_test(suite, sendto_receivefrom6, NULL);
    +#endif
     
         abts_run_test(suite, socket_userdata, NULL);
         
    
    From 58c561d0defab173c8115c0492fbab052da82a11 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 15 Oct 2007 02:57:52 +0000
    Subject: [PATCH 6017/7878] Without otherwise addressing the issues on Win32
     when presented with mixed-notation addresses and no IPv6 adapter present, at
     least avoid crashing.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584660 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testsock.c | 11 ++++++++---
     1 file changed, 8 insertions(+), 3 deletions(-)
    
    diff --git a/test/testsock.c b/test/testsock.c
    index 343dbd36e14..0d1bd578b27 100644
    --- a/test/testsock.c
    +++ b/test/testsock.c
    @@ -210,17 +210,22 @@ static void test_timeout(abts_case *tc, void *data)
     static void test_print_addr(abts_case *tc, void *data)
     {
         apr_sockaddr_t *sa;
    +    apr_status_t rv;
         char *s;
     
    -    APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr",
    -                       apr_sockaddr_info_get(&sa, "0.0.0.0", APR_INET, 80, 0, p));
    +    rv = apr_sockaddr_info_get(&sa, "0.0.0.0", APR_INET, 80, 0, p);
    +    APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv);
     
         s = apr_psprintf(p, "foo %pI bar", sa);
     
         ABTS_STR_EQUAL(tc, "foo 0.0.0.0:80 bar", s);
     
     #if APR_HAVE_IPV6
    -    if (apr_sockaddr_info_get(&sa, "::ffff:0.0.0.0", APR_INET6, 80, 0, p) == APR_SUCCESS) {
    +    rv = apr_sockaddr_info_get(&sa, "::ffff:0.0.0.0", APR_INET6, 80, 0, p);
    +    APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv);
    +    if (rv == APR_SUCCESS)
    +        ABTS_TRUE(tc, sa != NULL);
    +    if (rv == APR_SUCCESS && sa) {
             /* sa should now be a v4-mapped IPv6 address. */
             char buf[128];
     
    
    From 201ab2ba6fafe40065204333deef4376d7e62d39 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 15 Oct 2007 03:55:13 +0000
    Subject: [PATCH 6018/7878] reset the fail flag or we cannot see consecutive
     failures.  We are interested in the original failure, as well as which
     section was invoked when it failed.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584663 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testsockets.c | 8 ++++++--
     1 file changed, 6 insertions(+), 2 deletions(-)
    
    diff --git a/test/testsockets.c b/test/testsockets.c
    index 5cd35e1e32e..21dcf2d24e4 100644
    --- a/test/testsockets.c
    +++ b/test/testsockets.c
    @@ -164,15 +164,19 @@ static void sendto_receivefrom_helper(abts_case *tc, const char *addr,
     
     static void sendto_receivefrom(abts_case *tc, void *data)
     {
    +    int failed;
         sendto_receivefrom_helper(tc, "127.0.0.1",  "127.1.2.3", APR_INET);
    -    ABTS_TRUE(tc, !tc->failed);
    +    failed = tc->failed; failed = 0;
    +    ABTS_TRUE(tc, failed);
     }
     
     #if APR_HAVE_IPV6
     static void sendto_receivefrom6(abts_case *tc, void *data)
     {
    +    int failed;
         sendto_receivefrom_helper(tc, "::1", "FA0E::1234:127.1.2.3", APR_INET6);
    -    ABTS_TRUE(tc, !tc->failed);
    +    failed = tc->failed; failed = 0;
    +    ABTS_TRUE(tc, failed);
     }
     #endif
     
    
    From 725ed35eff53ec73f2629332237221bfd193aa13 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 15 Oct 2007 04:54:54 +0000
    Subject: [PATCH 6019/7878] Reset (tc->)failed so we see the second failure
     message.
    
    Reported by: Lucian Adrian Grijincu 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584673 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testsockets.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/test/testsockets.c b/test/testsockets.c
    index 21dcf2d24e4..18f90e4ef70 100644
    --- a/test/testsockets.c
    +++ b/test/testsockets.c
    @@ -166,7 +166,7 @@ static void sendto_receivefrom(abts_case *tc, void *data)
     {
         int failed;
         sendto_receivefrom_helper(tc, "127.0.0.1",  "127.1.2.3", APR_INET);
    -    failed = tc->failed; failed = 0;
    +    failed = tc->failed; tc->failed = 0;
         ABTS_TRUE(tc, failed);
     }
     
    @@ -175,7 +175,7 @@ static void sendto_receivefrom6(abts_case *tc, void *data)
     {
         int failed;
         sendto_receivefrom_helper(tc, "::1", "FA0E::1234:127.1.2.3", APR_INET6);
    -    failed = tc->failed; failed = 0;
    +    failed = tc->failed; tc->failed = 0;
         ABTS_TRUE(tc, failed);
     }
     #endif
    
    From d3519ba24804cacc7b8a5c748d52cef3de384e92 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 15 Oct 2007 05:17:01 +0000
    Subject: [PATCH 6020/7878] Erm, we should /not/ fail.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584678 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testsockets.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/test/testsockets.c b/test/testsockets.c
    index 18f90e4ef70..f88a77c7c18 100644
    --- a/test/testsockets.c
    +++ b/test/testsockets.c
    @@ -167,7 +167,7 @@ static void sendto_receivefrom(abts_case *tc, void *data)
         int failed;
         sendto_receivefrom_helper(tc, "127.0.0.1",  "127.1.2.3", APR_INET);
         failed = tc->failed; tc->failed = 0;
    -    ABTS_TRUE(tc, failed);
    +    ABTS_TRUE(tc, !failed);
     }
     
     #if APR_HAVE_IPV6
    @@ -176,7 +176,7 @@ static void sendto_receivefrom6(abts_case *tc, void *data)
         int failed;
         sendto_receivefrom_helper(tc, "::1", "FA0E::1234:127.1.2.3", APR_INET6);
         failed = tc->failed; tc->failed = 0;
    -    ABTS_TRUE(tc, failed);
    +    ABTS_TRUE(tc, !failed);
     }
     #endif
     
    
    From 6c1d753444ad5ef9cb83ecd93b4a2490c7913a17 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 15 Oct 2007 20:13:31 +0000
    Subject: [PATCH 6021/7878] Apply the Unix fix to Win32 (gee thanks Joe ;-)
    
    Enhance the test introduced by Joe in 467600 to also invert
    the original IP structure as an IPv6 entity for IPv4 tests,
    if IPv6 is present.  I settled on a test IP which Win32 just
    happens to tollerate if an IPv6 adapter isn't present.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584885 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                     |  3 +++
     network_io/win32/sendrecv.c |  5 ++++-
     test/testsockets.c          | 20 +++++++++++++-------
     3 files changed, 20 insertions(+), 8 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index be62849e142..96f94aa0028 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 1.3.0
     
    +  *) Fix apr_socket_recvfrom() to ensure the peer's address is returned
    +     through the "from" parameter on Win32.  [William Rowe]
    +
       *) Introduce apr_file_pipe_create_ex() to portably permit one pipe
          end or another to be entirely blocking for non-APR applications
          (e.g. stdio streams) and the other (or both ends) non blocking,
    diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c
    index c9d7dced521..80adccdd14b 100644
    --- a/network_io/win32/sendrecv.c
    +++ b/network_io/win32/sendrecv.c
    @@ -190,6 +190,8 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from,
     {
         apr_ssize_t rv;
     
    +    from->salen = sizeof(from->sa);
    +
         rv = recvfrom(sock->socketdes, buf, (int)*len, flags, 
                       (struct sockaddr*)&from->sa, &from->salen);
         if (rv == SOCKET_ERROR) {
    @@ -197,7 +199,8 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from,
             return apr_get_netos_error();
         }
     
    -    from->port = ntohs(from->sa.sin.sin_port);
    +    apr_sockaddr_vars_set(from, from->sa.sin.sin_family, 
    +                          ntohs(from->sa.sin.sin_port));
     
         (*len) = rv;
         if (rv == 0 && sock->type == SOCK_STREAM)
    diff --git a/test/testsockets.c b/test/testsockets.c
    index f88a77c7c18..2c0bb576ac4 100644
    --- a/test/testsockets.c
    +++ b/test/testsockets.c
    @@ -88,8 +88,8 @@ static void udp6_socket(abts_case *tc, void *data)
     }
     #endif
     
    -static void sendto_receivefrom_helper(abts_case *tc, const char *addr, 
    -                                      const char *junkaddr, int family)
    +static void sendto_receivefrom_helper(abts_case *tc, const char *addr,
    +                                      int family)
     {
         apr_status_t rv;
         apr_socket_t *sock = NULL;
    @@ -142,9 +142,15 @@ static void sendto_receivefrom_helper(abts_case *tc, const char *addr,
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_SIZE_EQUAL(tc, STRLEN, len);
     
    -    /* fill the "from" sockaddr with a random address to ensure that
    -     * recvfrom sets it up properly. */
    -    rv = apr_sockaddr_info_get(&from, junkaddr, family, 4242, 0, p);
    +    /* fill the "from" sockaddr with a random address from another
    +     * family to ensure that recvfrom sets it up properly. */
    +#if APR_HAVE_IPV6
    +    if (family == APR_INET)
    +        rv = apr_sockaddr_info_get(&from, "3ffE:816e:abcd:1234::1",
    +                                   APR_INET6, 4242, 0, p);
    +    else
    +#endif
    +        rv = apr_sockaddr_info_get(&from, "127.1.2.3", APR_INET, 4242, 0, p);
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     
         len = 80;
    @@ -165,7 +171,7 @@ static void sendto_receivefrom_helper(abts_case *tc, const char *addr,
     static void sendto_receivefrom(abts_case *tc, void *data)
     {
         int failed;
    -    sendto_receivefrom_helper(tc, "127.0.0.1",  "127.1.2.3", APR_INET);
    +    sendto_receivefrom_helper(tc, "127.0.0.1", APR_INET);
         failed = tc->failed; tc->failed = 0;
         ABTS_TRUE(tc, !failed);
     }
    @@ -174,7 +180,7 @@ static void sendto_receivefrom(abts_case *tc, void *data)
     static void sendto_receivefrom6(abts_case *tc, void *data)
     {
         int failed;
    -    sendto_receivefrom_helper(tc, "::1", "FA0E::1234:127.1.2.3", APR_INET6);
    +    sendto_receivefrom_helper(tc, "::1", APR_INET6);
         failed = tc->failed; tc->failed = 0;
         ABTS_TRUE(tc, !failed);
     }
    
    From 503bf7f8c8a6465921599f6f3c93f65320355d8b Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 15 Oct 2007 21:30:06 +0000
    Subject: [PATCH 6022/7878] Backport the std handling improvements to Netware,
     OS2, BeOS. These may need massaging and do need review by their respective
     communities.
    
    Note that someone from the OS2 community needs to ping me with
    resolving the missing apr_arch_inherit.h mess; this should be
    very easy to translate into
    
       DosSetFHState(handle, OPEN_FLAGS_NOINHERIT);
    
    bits, but to more thoroughly resolve the issue, we should take
    it a step further and consider the NT implementation which
    toggles inheritance on only for handles as they hit proc_create,
    so that you don't have cross-process handle leakage into the
    wrong processes.
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584928 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/beos/proc.c    | 206 ++++++++++++++++++--------------
     threadproc/netware/proc.c | 223 ++++++++++++++++++++---------------
     threadproc/os2/proc.c     | 240 ++++++++++++++++++++++----------------
     3 files changed, 384 insertions(+), 285 deletions(-)
    
    diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c
    index 7af73036f52..2623b70d158 100644
    --- a/threadproc/beos/proc.c
    +++ b/threadproc/beos/proc.c
    @@ -17,6 +17,11 @@
     #include "apr_arch_threadproc.h"
     #include "apr_strings.h"
     
    +/* Heavy on no'ops, here's what we want to pass if there is APR_NO_FILE
    + * requested for a specific child handle;
    + */
    +static apr_file_t no_file = { NULL, -1, };
    +
     struct send_pipe {
     	int in;
     	int out;
    @@ -44,70 +49,53 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *
         return APR_SUCCESS;
     }
     
    -APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, 
    -                                              apr_int32_t out, apr_int32_t err)
    +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
    +                                              apr_int32_t in,
    +                                              apr_int32_t out,
    +                                              apr_int32_t err)
     {
    -    apr_status_t status;
    -    if (in != 0) {
    -        if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, 
    -                                   attr->pool)) != APR_SUCCESS) {
    -            return status;
    -        }
    -        switch (in) {
    -        case APR_FULL_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_in, -1);
    -            apr_file_pipe_timeout_set(attr->parent_in, -1);
    -            break;
    -        case APR_PARENT_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_in, -1);
    -            break;
    -        case APR_CHILD_BLOCK:
    -            apr_file_pipe_timeout_set(attr->parent_in, -1);
    -            break;
    -        default:
    -            break;
    -        }
    -    } 
    -    if (out) {
    -        if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, 
    -                                   attr->pool)) != APR_SUCCESS) {
    -            return status;
    -        }
    -        switch (out) {
    -        case APR_FULL_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_out, -1);
    -            apr_file_pipe_timeout_set(attr->parent_out, -1);       
    -            break;
    -        case APR_PARENT_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_out, -1);
    -            break;
    -        case APR_CHILD_BLOCK:
    -            apr_file_pipe_timeout_set(attr->parent_out, -1);
    -            break;
    -        default:
    -            break;
    -        }
    -    } 
    -    if (err) {
    -        if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, 
    -                                   attr->pool)) != APR_SUCCESS) {
    -            return status;
    -        }
    -        switch (err) {
    -        case APR_FULL_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_err, -1);
    -            apr_file_pipe_timeout_set(attr->parent_err, -1);
    -            break;
    -        case APR_PARENT_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_err, -1);
    -            break;
    -        case APR_CHILD_BLOCK:
    -            apr_file_pipe_timeout_set(attr->parent_err, -1);
    -            break;
    -        default:
    -            break;
    -        }
    -    } 
    +    apr_status_t rv;
    +
    +    if ((in != APR_NO_PIPE) && (in != APR_NO_FILE)) {
    +        /* APR_CHILD_BLOCK maps to APR_WRITE_BLOCK, while
    +         * APR_PARENT_BLOCK maps to APR_READ_BLOCK, so transpose 
    +         * the CHILD/PARENT blocking flags for the stdin pipe.
    +         * stdout/stderr map to the correct mode by default.
    +         */
    +        if (in == APR_CHILD_BLOCK)
    +            in = APR_READ_BLOCK;
    +        else if (in == APR_PARENT_BLOCK)
    +            in = APR_WRITE_BLOCK;
    +
    +        if ((rv = apr_file_pipe_create_ex(&attr->child_in, &attr->parent_in,
    +                                          in, attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_in);
    +        if (rv != APR_SUCCESS)
    +            return rv;
    +    }
    +    else if (in == APR_NO_FILE)
    +        attr->child_in = &no_file;
    +
    +    if ((out != APR_NO_PIPE) && (out != APR_NO_FILE)) {
    +        if ((rv = apr_file_pipe_create_ex(&attr->parent_out, &attr->child_out,
    +                                          out, attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_out);
    +        if (rv != APR_SUCCESS)
    +            return rv;
    +    }
    +    else if (out == APR_NO_FILE)
    +        attr->child_out = &no_file;
    +
    +    if ((err != APR_NO_PIPE) && (err != APR_NO_FILE)) {
    +        if ((rv = apr_file_pipe_create_ex(&attr->parent_err, &attr->child_err,
    +                                          err, attr->pool)) != APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_err);
    +        if (rv != APR_SUCCESS)
    +            return rv;
    +    }
    +    else if (err == APR_NO_FILE)
    +        attr->child_err = &no_file;
    +
         return APR_SUCCESS;
     }
     
    @@ -233,9 +221,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
         new->in = attr->parent_in;
         new->err = attr->parent_err;
         new->out = attr->parent_out;
    -	sp->in  = attr->child_in  ? attr->child_in->filedes  : -1;
    -	sp->out = attr->child_out ? attr->child_out->filedes : -1;
    -	sp->err = attr->child_err ? attr->child_err->filedes : -1;
    +    sp->in  = attr->child_in  ? attr->child_in->filedes  : FILENO_STDIN;
    +    sp->out = attr->child_out ? attr->child_out->filedes : FILENO_STDOUT;
    +    sp->err = attr->child_err ? attr->child_err->filedes : FILENO_STDERR;
     
         i = 0;
         while (args && args[i]) {
    @@ -277,13 +265,13 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
     
         resume_thread(newproc);
     
    -    if (attr->child_in) {
    +    if (attr->child_in && (attr->child_in->filedes != -1)) {
             apr_file_close(attr->child_in);
         }
    -    if (attr->child_out) {
    +    if (attr->child_out && (attr->child_in->filedes != -1)) {
             apr_file_close(attr->child_out);
         }
    -    if (attr->child_err) {
    +    if (attr->child_err && (attr->child_in->filedes != -1)) {
             apr_file_close(attr->child_err);
         }
     
    @@ -357,46 +345,84 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
     APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in,
                                        apr_file_t *parent_in)
     {
    -    if (attr->child_in == NULL && attr->parent_in == NULL)
    -        apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool);
    +    apr_status_t rv;
     
    -    if (child_in != NULL)
    -        apr_file_dup(&attr->child_in, child_in, attr->pool);
    +    if (attr->child_in == NULL && attr->parent_in == NULL
    +            && child_in == NULL && parent_in == NULL)
    +        if ((rv = apr_file_pipe_create(&attr->child_in, &attr->parent_in,
    +                                       attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_in);
     
    -    if (parent_in != NULL)
    -        apr_file_dup(&attr->parent_in, parent_in, attr->pool);
    +    if (child_in != NULL && rv == APR_SUCCESS) {
    +        if (attr->child_in && (attr->child_in->filedes != -1))
    +            rv = apr_file_dup2(attr->child_in, child_in, attr->pool);
    +        else {
    +            attr->child_in = NULL;
    +            if ((rv = apr_file_dup(&attr->child_in, child_in, attr->pool))
    +                    == APR_SUCCESS)
    +                rv = apr_file_inherit_set(attr->child_in);
    +        }
     
    -    return APR_SUCCESS;
    +    if (parent_in != NULL && rv == APR_SUCCESS) {
    +        rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool);
    +
    +    return rv;
     }
     
     APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out,
                                                          apr_file_t *parent_out)
     {
    -    if (attr->child_out == NULL && attr->parent_out == NULL)
    -        apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool);
    +    apr_status_t rv;
     
    -    if (child_out != NULL)
    -        apr_file_dup(&attr->child_out, child_out, attr->pool);
    +    if (attr->child_out == NULL && attr->parent_out == NULL
    +           && child_out == NULL && parent_out == NULL)
    +        if ((rv = apr_file_pipe_create(&attr->parent_out, &attr->child_out,
    +                                       attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_out);
     
    -    if (parent_out != NULL)
    -        apr_file_dup(&attr->parent_out, parent_out, attr->pool);
    +    if (child_out != NULL && rv == APR_SUCCESS) {
    +        if (attr->child_out && (attr->child_out->filedes != -1))
    +            rv = apr_file_dup2(attr->child_out, child_out, attr->pool);
    +        else {
    +            attr->child_out = NULL;
    +            if ((rv = apr_file_dup(&attr->child_out, child_out, attr->pool))
    +                    == APR_SUCCESS)
    +                rv = apr_file_inherit_set(attr->child_out);
    +        }
    +    }
    +  
    +    if (parent_out != NULL && rv == APR_SUCCESS) {
    +        rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool);
     
    -    return APR_SUCCESS;
    +    return rv;
     }
     
     APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err,
                                                          apr_file_t *parent_err)
     {
    -    if (attr->child_err == NULL && attr->parent_err == NULL)
    -        apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool);
    +    apr_status_t rv;
     
    -    if (child_err != NULL)
    -        apr_file_dup(&attr->child_err, child_err, attr->pool);
    +    if (attr->child_err == NULL && attr->parent_err == NULL
    +           && child_err == NULL && parent_err == NULL)
    +        if ((rv = apr_file_pipe_create(&attr->parent_err, &attr->child_err,
    +                                       attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_err);
     
    -    if (parent_err != NULL)
    -        apr_file_dup(&attr->parent_err, parent_err, attr->pool);
    +    if (child_err != NULL && rv == APR_SUCCESS) {
    +        if (attr->child_err && (attr->child_err->filedes != -1))
    +            rv = apr_file_dup2(attr->child_err, child_err, attr->pool);
    +        else {
    +            attr->child_err = NULL;
    +            if ((rv = apr_file_dup(&attr->child_err, child_err, attr->pool))
    +                    == APR_SUCCESS)
    +                rv = apr_file_inherit_set(attr->child_err);
    +        }
    +    }
    +  
    +    if (parent_err != NULL && rv == APR_SUCCESS) {
    +        rv = apr_file_dup(&attr->parent_err, parent_err, attr->pool);
     
    -    return APR_SUCCESS;
    +    return rv;
     }
     
     APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, 
    diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c
    index 0f707769994..bed7d2a2a29 100644
    --- a/threadproc/netware/proc.c
    +++ b/threadproc/netware/proc.c
    @@ -21,6 +21,11 @@
     
     #include 
     
    +/* Heavy on no'ops, here's what we want to pass if there is APR_NO_FILE
    + * requested for a specific child handle;
    + */
    +static apr_file_t no_file = { NULL, -1, };
    +
     apr_status_t apr_netware_proc_cleanup(void *theproc)
     {
         apr_proc_t *proc = theproc;
    @@ -51,67 +56,53 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new,apr_pool_t *p
     
     }
     
    -APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, 
    -                                 apr_int32_t out, apr_int32_t err)
    +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
    +                                              apr_int32_t in,
    +                                              apr_int32_t out,
    +                                              apr_int32_t err)
     {
    -    apr_status_t status;
    -    if (in != 0) {
    -        if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, 
    -                                   attr->pool)) != APR_SUCCESS) {
    -            return status;
    -        }
    -        switch (in) {
    -        case APR_FULL_BLOCK:
    -            break;
    -        case APR_PARENT_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_in, 0);
    -            break;
    -        case APR_CHILD_BLOCK:
    -            apr_file_pipe_timeout_set(attr->parent_in, 0);
    -            break;
    -        default:
    -            apr_file_pipe_timeout_set(attr->child_in, 0);
    -            apr_file_pipe_timeout_set(attr->parent_in, 0);
    -        }
    -    } 
    -    if (out) {
    -        if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, 
    -                                   attr->pool)) != APR_SUCCESS) {
    -            return status;
    -        }
    -        switch (out) {
    -        case APR_FULL_BLOCK:
    -            break;
    -        case APR_PARENT_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_out, 0);
    -            break;
    -        case APR_CHILD_BLOCK:
    -            apr_file_pipe_timeout_set(attr->parent_out, 0);
    -            break;
    -        default:
    -            apr_file_pipe_timeout_set(attr->child_out, 0);
    -            apr_file_pipe_timeout_set(attr->parent_out, 0);
    -        }
    -    } 
    -    if (err) {
    -        if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, 
    -                                   attr->pool)) != APR_SUCCESS) {
    -            return status;
    -        }
    -        switch (err) {
    -        case APR_FULL_BLOCK:
    -            break;
    -        case APR_PARENT_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_err, 0);
    -            break;
    -        case APR_CHILD_BLOCK:
    -            apr_file_pipe_timeout_set(attr->parent_err, 0);
    -            break;
    -        default:
    -            apr_file_pipe_timeout_set(attr->child_err, 0);
    -            apr_file_pipe_timeout_set(attr->parent_err, 0);
    -        }
    -    } 
    +    apr_status_t rv;
    +
    +    if ((in != APR_NO_PIPE) && (in != APR_NO_FILE)) {
    +        /* APR_CHILD_BLOCK maps to APR_WRITE_BLOCK, while
    +         * APR_PARENT_BLOCK maps to APR_READ_BLOCK, so transpose 
    +         * the CHILD/PARENT blocking flags for the stdin pipe.
    +         * stdout/stderr map to the correct mode by default.
    +         */
    +        if (in == APR_CHILD_BLOCK)
    +            in = APR_READ_BLOCK;
    +        else if (in == APR_PARENT_BLOCK)
    +            in = APR_WRITE_BLOCK;
    +
    +        if ((rv = apr_file_pipe_create_ex(&attr->child_in, &attr->parent_in,
    +                                          in, attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_in);
    +        if (rv != APR_SUCCESS)
    +            return rv;
    +    }
    +    else if (in == APR_NO_FILE)
    +        attr->child_in = &no_file;
    +
    +    if ((out != APR_NO_PIPE) && (out != APR_NO_FILE)) {
    +        if ((rv = apr_file_pipe_create_ex(&attr->parent_out, &attr->child_out,
    +                                          out, attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_out);
    +        if (rv != APR_SUCCESS)
    +            return rv;
    +    }
    +    else if (out == APR_NO_FILE)
    +        attr->child_out = &no_file;
    +
    +    if ((err != APR_NO_PIPE) && (err != APR_NO_FILE)) {
    +        if ((rv = apr_file_pipe_create_ex(&attr->parent_err, &attr->child_err,
    +                                          err, attr->pool)) != APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_err);
    +        if (rv != APR_SUCCESS)
    +            return rv;
    +    }
    +    else if (err == APR_NO_FILE)
    +        attr->child_err = &no_file;
    +
         return APR_SUCCESS;
     }
     
    @@ -119,48 +110,86 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t
     APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in,
                                        apr_file_t *parent_in)
     {
    -    if (attr->child_in == NULL && attr->parent_in == NULL)
    -        apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool);
    +    apr_status_t rv;
     
    -    if (child_in != NULL)
    -        apr_file_dup2(attr->child_in, child_in, attr->pool);
    +    if (attr->child_in == NULL && attr->parent_in == NULL
    +            && child_in == NULL && parent_in == NULL)
    +        if ((rv = apr_file_pipe_create(&attr->child_in, &attr->parent_in,
    +                                       attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_in);
     
    -    if (parent_in != NULL)
    -        apr_file_dup2(attr->parent_in, parent_in, attr->pool);
    +    if (child_in != NULL && rv == APR_SUCCESS) {
    +        if (attr->child_in && (attr->child_in->filedes != -1))
    +            rv = apr_file_dup2(attr->child_in, child_in, attr->pool);
    +        else {
    +            attr->child_in = NULL;
    +            if ((rv = apr_file_dup(&attr->child_in, child_in, attr->pool))
    +                    == APR_SUCCESS)
    +                rv = apr_file_inherit_set(attr->child_in);
    +        }
     
    -    return APR_SUCCESS;
    +    if (parent_in != NULL && rv == APR_SUCCESS) {
    +        rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool);
    +
    +    return rv;
     }
     
     
     APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out,
    -                                    apr_file_t *parent_out)
    +                                                     apr_file_t *parent_out)
     {
    -    if (attr->child_out == NULL && attr->parent_out == NULL)
    -        apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool);
    +    apr_status_t rv;
     
    -    if (child_out != NULL)
    -        apr_file_dup2(attr->child_out, child_out, attr->pool);
    +    if (attr->child_out == NULL && attr->parent_out == NULL
    +           && child_out == NULL && parent_out == NULL)
    +        if ((rv = apr_file_pipe_create(&attr->parent_out, &attr->child_out,
    +                                       attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_out);
     
    -    if (parent_out != NULL)
    -        apr_file_dup2(attr->parent_out, parent_out, attr->pool);
    +    if (child_out != NULL && rv == APR_SUCCESS) {
    +        if (attr->child_out && (attr->child_out->filedes != -1))
    +            rv = apr_file_dup2(attr->child_out, child_out, attr->pool);
    +        else {
    +            attr->child_out = NULL;
    +            if ((rv = apr_file_dup(&attr->child_out, child_out, attr->pool))
    +                    == APR_SUCCESS)
    +                rv = apr_file_inherit_set(attr->child_out);
    +        }
    +    }
    +  
    +    if (parent_out != NULL && rv == APR_SUCCESS) {
    +        rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool);
     
    -    return APR_SUCCESS;
    +    return rv;
     }
     
     
     APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err,
    -                                   apr_file_t *parent_err)
    +                                                     apr_file_t *parent_err)
     {
    -    if (attr->child_err == NULL && attr->parent_err == NULL)
    -        apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool);
    +    apr_status_t rv;
     
    -    if (child_err != NULL)
    -        apr_file_dup2(attr->child_err, child_err, attr->pool);
    +    if (attr->child_err == NULL && attr->parent_err == NULL
    +           && child_err == NULL && parent_err == NULL)
    +        if ((rv = apr_file_pipe_create(&attr->parent_err, &attr->child_err,
    +                                       attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_err);
     
    -    if (parent_err != NULL)
    -        apr_file_dup2(attr->parent_err, parent_err, attr->pool);
    +    if (child_err != NULL && rv == APR_SUCCESS) {
    +        if (attr->child_err && (attr->child_err->filedes != -1))
    +            rv = apr_file_dup2(attr->child_err, child_err, attr->pool);
    +        else {
    +            attr->child_err = NULL;
    +            if ((rv = apr_file_dup(&attr->child_err, child_err, attr->pool))
    +                    == APR_SUCCESS)
    +                rv = apr_file_inherit_set(attr->child_err);
    +        }
    +    }
    +  
    +    if (parent_err != NULL && rv == APR_SUCCESS) {
    +        rv = apr_file_dup(&attr->parent_err, parent_err, attr->pool);
     
    -    return APR_SUCCESS;
    +    return rv;
     }
     
     
    @@ -280,12 +309,21 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
                                   		apr_procattr_t *attr, 
                                   		apr_pool_t *pool)
     {
    -	wiring_t		wire;
    -    int             addr_space;
    -
    -    wire.infd  = attr->child_in ? attr->child_in->filedes : FD_UNUSED;
    -    wire.outfd = attr->child_out ? attr->child_out->filedes : FD_UNUSED;
    -    wire.errfd = attr->child_err ? attr->child_err->filedes : FD_UNUSED;
    +    wiring_t wire;
    +    int      addr_space;
    +
    +    wire.infd  = attr->child_in  
    +               ? (attr->child_in->filedes != -1 ? attr->child_in->filedes 
    +                                                : FD_UNUSED)
    +               : FILENO_STDIN;
    +    wire.outfd  = attr->child_out
    +                ? (attr->child_out->filedes != -1 ? attr->child_out->filedes 
    +                                                  : FD_UNUSED)
    +                : FILENO_STDOUT;
    +    wire.errfd  = attr->child_err
    +                ? (attr->child_err->filedes != -1 ? attr->child_err->filedes 
    +                                                  : FD_UNUSED)
    +                : FILENO_STDERR;
     
         newproc->in = attr->parent_in;
         newproc->out = attr->parent_out;
    @@ -313,23 +351,22 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
             return errno;
         }
     
    -    if (attr->child_in) {
    +    if (attr->child_in && (attr->child_in->filedes != -1)) {
             apr_pool_cleanup_kill(apr_file_pool_get(attr->child_in), 
                                   attr->child_in, apr_unix_file_cleanup);
             apr_file_close(attr->child_in);
         }
    -    if (attr->child_out) {
    +    if (attr->child_out && (attr->child_out->filedes != -1)) {
             apr_pool_cleanup_kill(apr_file_pool_get(attr->child_out), 
                                   attr->child_out, apr_unix_file_cleanup);
             apr_file_close(attr->child_out);
         }
    -    if (attr->child_err) {
    +    if (attr->child_err && (attr->child_err->filedes != -1)) {
             apr_pool_cleanup_kill(apr_file_pool_get(attr->child_err), 
                                   attr->child_err, apr_unix_file_cleanup);
             apr_file_close(attr->child_err);
         }
     
    -
         apr_pool_cleanup_register(pool, (void *)newproc, apr_netware_proc_cleanup,
             apr_pool_cleanup_null);
     
    diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c
    index 20dfffb8b8b..9fd9a5f5093 100644
    --- a/threadproc/os2/proc.c
    +++ b/threadproc/os2/proc.c
    @@ -34,6 +34,11 @@
     #include 
     #include 
     
    +/* Heavy on no'ops, here's what we want to pass if there is APR_NO_FILE
    + * requested for a specific child handle;
    + */
    +static apr_file_t no_file = { NULL, -1, };
    +
     APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *pool)
     {
         (*new) = (apr_procattr_t *)apr_palloc(pool, 
    @@ -55,118 +60,139 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *
         return APR_SUCCESS;
     }
     
    -APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, 
    -                                              apr_int32_t out, apr_int32_t err)
    +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
    +                                              apr_int32_t in,
    +                                              apr_int32_t out,
    +                                              apr_int32_t err)
     {
    -    apr_status_t stat;
    -    if (in) {
    -        if ((stat = apr_file_pipe_create(&attr->child_in, &attr->parent_in,
    -                                   attr->pool)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -        switch (in) {
    -        case APR_FULL_BLOCK:
    -            break;
    -        case APR_PARENT_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_in, 0);
    -            break;
    -        case APR_CHILD_BLOCK:
    -            apr_file_pipe_timeout_set(attr->parent_in, 0);
    -            break;
    -        default:
    -            apr_file_pipe_timeout_set(attr->child_in, 0);
    -            apr_file_pipe_timeout_set(attr->parent_in, 0);
    -        }
    -    } 
    -    if (out) {
    -        if ((stat = apr_file_pipe_create(&attr->parent_out, &attr->child_out,
    -                                   attr->pool)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -        switch (out) {
    -        case APR_FULL_BLOCK:
    -            break;
    -        case APR_PARENT_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_out, 0);
    -            break;
    -        case APR_CHILD_BLOCK:
    -            apr_file_pipe_timeout_set(attr->parent_out, 0);
    -            break;
    -        default:
    -            apr_file_pipe_timeout_set(attr->child_out, 0);
    -            apr_file_pipe_timeout_set(attr->parent_out, 0);
    -        }
    -    } 
    -    if (err) {
    -        if ((stat = apr_file_pipe_create(&attr->parent_err, &attr->child_err,
    -                                   attr->pool)) != APR_SUCCESS) {
    -            return stat;
    -        }
    -        switch (err) {
    -        case APR_FULL_BLOCK:
    -            break;
    -        case APR_PARENT_BLOCK:
    -            apr_file_pipe_timeout_set(attr->child_err, 0);
    -            break;
    -        case APR_CHILD_BLOCK:
    -            apr_file_pipe_timeout_set(attr->parent_err, 0);
    -            break;
    -        default:
    -            apr_file_pipe_timeout_set(attr->child_err, 0);
    -            apr_file_pipe_timeout_set(attr->parent_err, 0);
    -        }
    -    } 
    +    apr_status_t rv;
    +
    +    if ((in != APR_NO_PIPE) && (in != APR_NO_FILE)) {
    +        /* APR_CHILD_BLOCK maps to APR_WRITE_BLOCK, while
    +         * APR_PARENT_BLOCK maps to APR_READ_BLOCK, so transpose 
    +         * the CHILD/PARENT blocking flags for the stdin pipe.
    +         * stdout/stderr map to the correct mode by default.
    +         */
    +        if (in == APR_CHILD_BLOCK)
    +            in = APR_READ_BLOCK;
    +        else if (in == APR_PARENT_BLOCK)
    +            in = APR_WRITE_BLOCK;
    +
    +        if ((rv = apr_file_pipe_create_ex(&attr->child_in, &attr->parent_in,
    +                                          in, attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_in);
    +        if (rv != APR_SUCCESS)
    +            return rv;
    +    }
    +    else if (in == APR_NO_FILE)
    +        attr->child_in = &no_file;
    +
    +    if ((out != APR_NO_PIPE) && (out != APR_NO_FILE)) {
    +        if ((rv = apr_file_pipe_create_ex(&attr->parent_out, &attr->child_out,
    +                                          out, attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_out);
    +        if (rv != APR_SUCCESS)
    +            return rv;
    +    }
    +    else if (out == APR_NO_FILE)
    +        attr->child_out = &no_file;
    +
    +    if ((err != APR_NO_PIPE) && (err != APR_NO_FILE)) {
    +        if ((rv = apr_file_pipe_create_ex(&attr->parent_err, &attr->child_err,
    +                                          err, attr->pool)) != APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_err);
    +        if (rv != APR_SUCCESS)
    +            return rv;
    +    }
    +    else if (err == APR_NO_FILE)
    +        attr->child_err = &no_file;
    +
         return APR_SUCCESS;
     }
     
     APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in,
    -                                                    apr_file_t *parent_in)
    +                                   apr_file_t *parent_in)
     {
    -    if (attr->child_in == NULL && attr->parent_in == NULL)
    -        apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool);
    -
    -    if (child_in != NULL)
    -        apr_file_dup(&attr->child_in, child_in, attr->pool);
    +    apr_status_t rv;
    +
    +    if (attr->child_in == NULL && attr->parent_in == NULL
    +            && child_in == NULL && parent_in == NULL)
    +        if ((rv = apr_file_pipe_create(&attr->child_in, &attr->parent_in,
    +                                       attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_in);
    +
    +    if (child_in != NULL && rv == APR_SUCCESS) {
    +        if (attr->child_in && (attr->child_in->filedes != -1))
    +            rv = apr_file_dup2(attr->child_in, child_in, attr->pool);
    +        else {
    +            attr->child_in = NULL;
    +            if ((rv = apr_file_dup(&attr->child_in, child_in, attr->pool))
    +                    == APR_SUCCESS)
    +                rv = apr_file_inherit_set(attr->child_in);
    +        }
     
    -    if (parent_in != NULL)
    -        apr_file_dup(&attr->parent_in, parent_in, attr->pool);
    +    if (parent_in != NULL && rv == APR_SUCCESS) {
    +        rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool);
     
    -    return APR_SUCCESS;
    +    return rv;
     }
     
    -
     APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out,
                                                          apr_file_t *parent_out)
     {
    -    if (attr->child_out == NULL && attr->parent_out == NULL)
    -        apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool);
    -
    -    if (child_out != NULL)
    -        apr_file_dup(&attr->child_out, child_out, attr->pool);
    -
    -    if (parent_out != NULL)
    -        apr_file_dup(&attr->parent_out, parent_out, attr->pool);
    +    apr_status_t rv;
    +
    +    if (attr->child_out == NULL && attr->parent_out == NULL
    +           && child_out == NULL && parent_out == NULL)
    +        if ((rv = apr_file_pipe_create(&attr->parent_out, &attr->child_out,
    +                                       attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_out);
    +
    +    if (child_out != NULL && rv == APR_SUCCESS) {
    +        if (attr->child_out && (attr->child_out->filedes != -1))
    +            rv = apr_file_dup2(attr->child_out, child_out, attr->pool);
    +        else {
    +            attr->child_out = NULL;
    +            if ((rv = apr_file_dup(&attr->child_out, child_out, attr->pool))
    +                    == APR_SUCCESS)
    +                rv = apr_file_inherit_set(attr->child_out);
    +        }
    +    }
    +  
    +    if (parent_out != NULL && rv == APR_SUCCESS) {
    +        rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool);
     
    -    return APR_SUCCESS;
    +    return rv;
     }
     
    -
     APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err,
                                                          apr_file_t *parent_err)
     {
    -    if (attr->child_err == NULL && attr->parent_err == NULL)
    -        apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool);
    -
    -    if (child_err != NULL)
    -        apr_file_dup(&attr->child_err, child_err, attr->pool);
    -
    -    if (parent_err != NULL)
    -        apr_file_dup(&attr->parent_err, parent_err, attr->pool);
    +    apr_status_t rv;
    +
    +    if (attr->child_err == NULL && attr->parent_err == NULL
    +           && child_err == NULL && parent_err == NULL)
    +        if ((rv = apr_file_pipe_create(&attr->parent_err, &attr->child_err,
    +                                       attr->pool)) == APR_SUCCESS)
    +            rv = apr_file_inherit_unset(attr->parent_err);
    +
    +    if (child_err != NULL && rv == APR_SUCCESS) {
    +        if (attr->child_err && (attr->child_err->filedes != -1))
    +            rv = apr_file_dup2(attr->child_err, child_err, attr->pool);
    +        else {
    +            attr->child_err = NULL;
    +            if ((rv = apr_file_dup(&attr->child_err, child_err, attr->pool))
    +                    == APR_SUCCESS)
    +                rv = apr_file_inherit_set(attr->child_err);
    +        }
    +    }
    +  
    +    if (parent_err != NULL && rv == APR_SUCCESS) {
    +        rv = apr_file_dup(&attr->parent_err, parent_err, attr->pool);
     
    -    return APR_SUCCESS;
    +    return rv;
     }
     
    -
     APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir)
     {
         attr->currdir = apr_pstrdup(attr->pool, dir);
    @@ -284,6 +310,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname
         char *env_block, *env_block_pos;
         RESULTCODES rescodes;
     
    +    proc->in = attr->parent_in;
    +    proc->err = attr->parent_err;
    +    proc->out = attr->parent_out;
    +
         /* Prevent other threads from running while these process-wide resources are modified */
         if (attr->child_in || attr->child_out || attr->child_err || attr->currdir) {
             criticalsection = TRUE;
    @@ -294,24 +324,30 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname
             save_in = -1;
             DosDupHandle(STDIN_FILENO, &save_in);
             dup = STDIN_FILENO;
    -        DosDupHandle(attr->child_in->filedes, &dup);
    -        DosSetFHState(attr->parent_in->filedes, OPEN_FLAGS_NOINHERIT);
    +        if (attr->child_in->filedes == -1)
    +            DosClose(dup);
    +        else
    +            DosDupHandle(attr->child_in->filedes, &dup);
         }
         
         if (attr->child_out) {
             save_out = -1;
             DosDupHandle(STDOUT_FILENO, &save_out);
             dup = STDOUT_FILENO;
    -        DosDupHandle(attr->child_out->filedes, &dup);
    -        DosSetFHState(attr->parent_out->filedes, OPEN_FLAGS_NOINHERIT);
    +        if (attr->child_out->filedes == -1)
    +            DosClose(dup);
    +        else
    +            DosDupHandle(attr->child_out->filedes, &dup);
         }
         
         if (attr->child_err) {
             save_err = -1;
             DosDupHandle(STDERR_FILENO, &save_err);
             dup = STDERR_FILENO;
    -        DosDupHandle(attr->child_err->filedes, &dup);
    -        DosSetFHState(attr->parent_err->filedes, OPEN_FLAGS_NOINHERIT);
    +        if (attr->child_err->filedes == -1)
    +            DosClose(dup);
    +        else
    +            DosDupHandle(attr->child_err->filedes, &dup);
         }
     
         apr_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */
    @@ -464,21 +500,24 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname
         }
     
         if (attr->child_in) {
    -        apr_file_close(attr->child_in);
    +        (attr->child_in->filedes != -1)
    +            apr_file_close(attr->child_in);
             dup = STDIN_FILENO;
             DosDupHandle(save_in, &dup);
             DosClose(save_in);
         }
         
         if (attr->child_out) {
    -        apr_file_close(attr->child_out);
    +        (attr->child_err->filedes != -1)
    +            apr_file_close(attr->child_out);
             dup = STDOUT_FILENO;
             DosDupHandle(save_out, &dup);
             DosClose(save_out);
         }
         
         if (attr->child_err) {
    -        apr_file_close(attr->child_err);
    +        (attr->child_err->filedes != -1)
    +            apr_file_close(attr->child_err);
             dup = STDERR_FILENO;
             DosDupHandle(save_err, &dup);
             DosClose(save_err);
    @@ -487,9 +526,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname
         if (criticalsection)
             DosExitCritSec();
     
    -    proc->in = attr->parent_in;
    -    proc->err = attr->parent_err;
    -    proc->out = attr->parent_out;
         return status;
     }
     
    
    From 10aa575b542f690701610af415372ada868297db Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 15 Oct 2007 21:51:16 +0000
    Subject: [PATCH 6023/7878] Whoops, collision!  Avoid with a comment in the
     future
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584933 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/win32/apr_arch_file_io.h | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h
    index 3086d0fb839..c8c7bdee887 100644
    --- a/include/arch/win32/apr_arch_file_io.h
    +++ b/include/arch/win32/apr_arch_file_io.h
    @@ -100,11 +100,12 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool);
     #define APR_OPENLINK     0x00200000 /* Open a link itself, if supported */
     #define APR_READCONTROL  0x00400000 /* Read the file's owner/perms */
     #define APR_WRITECONTROL 0x00800000 /* Modify the file's owner/perms */
    -#define APR_WRITEATTRS   0x01000000 /* Modify the file's attributes */
    +/* #define APR_INHERIT   0x01000000 -- Defined in apr_arch_inherit.h! */
     #define APR_STDIN_FLAG   0x02000000 /* Obtained via apr_file_open_stdin() */
     #define APR_STDOUT_FLAG  0x04000000 /* Obtained via apr_file_open_stdout() */
     #define APR_STDERR_FLAG  0x06000000 /* Obtained via apr_file_open_stderr() */
     #define APR_STD_FLAGS    (APR_STDIN_FLAG | APR_STDOUT_FLAG | APR_STDERR_FLAG)
    +#define APR_WRITEATTRS   0x08000000 /* Modify the file's attributes */
     
     /* Entries missing from the MSVC 5.0 Win32 SDK:
      */
    
    From 7722b7b34ff5e5095391625289222c43a83b4621 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 15 Oct 2007 22:07:32 +0000
    Subject: [PATCH 6024/7878] OS2 fails to fork-for-exec, and therefore doesn't
     use the apr_pool_cleanup_for_exec hook, which means it's leaking like a
     sieve.  This alternate implementation of the function is sub-optimal because
     parallel threads can be setting up handles to be inherited, and this just
     isn't healthy.
    
    The best fix is to create all handles uninherited, and only
    toggle the std streams to be inherited in apr_proc_create().
    
    I'm happy to work with any OS2 folk to make that happen.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584943 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/os2/apr_arch_inherit.h | 50 +++++++++++++++++++++++++++++
     1 file changed, 50 insertions(+)
     create mode 100644 include/arch/os2/apr_arch_inherit.h
    
    diff --git a/include/arch/os2/apr_arch_inherit.h b/include/arch/os2/apr_arch_inherit.h
    new file mode 100644
    index 00000000000..494772acd63
    --- /dev/null
    +++ b/include/arch/os2/apr_arch_inherit.h
    @@ -0,0 +1,50 @@
    +/* Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +#ifndef INHERIT_H
    +#define INHERIT_H
    +
    +#include "apr_inherit.h"
    +
    +#define APR_INHERIT (1 << 24)    /* Must not conflict with other bits */
    +
    +#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup)        \
    +APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \
    +{                                                                   \
    +    int rv;                                                         \
    +    ULONG state;                                                    \
    +    if (((rv = DosQueryFHState(attr->parent_err->filedes, &state))  \
    +            != 0) ||                                                \
    +        ((rv = DosSetFHState(attr->parent_err->filedes,             \
    +                            state & ~OPEN_FLAGS_NOINHERIT)) != 0))  \
    +        return APR_FROM_OS_ERROR(rv);                               \
    +    return APR_SUCCESS;                                             \
    +}
    +
    +#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup)      \
    +APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\
    +{                                                                   \
    +    int rv;                                                         \
    +    ULONG state;                                                    \
    +    if (((rv = DosQueryFHState(attr->parent_err->filedes, &state))  \
    +            != 0) ||                                                \
    +        ((rv = DosSetFHState(attr->parent_err->filedes,             \
    +                            state | OPEN_FLAGS_NOINHERIT)) != 0))   \
    +        return APR_FROM_OS_ERROR(rv);                               \
    +    return APR_SUCCESS;                                             \
    +}
    +
    +#endif	/* ! INHERIT_H */
    
    From 30e1645a52fd98405190412e04927f4313d7cbef Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 16 Oct 2007 05:44:47 +0000
    Subject: [PATCH 6025/7878] Alphasort
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585045 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testall.dsw | 30 +++++++++++++++---------------
     1 file changed, 15 insertions(+), 15 deletions(-)
    
    diff --git a/test/testall.dsw b/test/testall.dsw
    index d4cde7dd3cb..f9abcbc5244 100644
    --- a/test/testall.dsw
    +++ b/test/testall.dsw
    @@ -30,7 +30,7 @@ Package=<4>
     
     ###############################################################################
     
    -Project: "testdll"=".\testdll.dsp" - Package Owner=<4>
    +Project: "libapr"="..\libapr.dsp" - Package Owner=<4>
     
     Package=<5>
     {{{
    @@ -38,17 +38,11 @@ Package=<5>
     
     Package=<4>
     {{{
    -    Begin Project Dependency
    -    Project_Dep_Name libapr
    -    End Project Dependency
    -    Begin Project Dependency
    -    Project_Dep_Name libapr_app
    -    End Project Dependency
     }}}
     
     ###############################################################################
     
    -Project: "testlib"=".\testlib.dsp" - Package Owner=<4>
    +Project: "libapr_app"="..\build\libapr_app.dsp" - Package Owner=<4>
     
     Package=<5>
     {{{
    @@ -57,16 +51,13 @@ Package=<5>
     Package=<4>
     {{{
         Begin Project Dependency
    -    Project_Dep_Name apr
    -    End Project Dependency
    -    Begin Project Dependency
    -    Project_Dep_Name apr_app
    +    Project_Dep_Name libapr
         End Project Dependency
     }}}
     
     ###############################################################################
     
    -Project: "libapr"="..\libapr.dsp" - Package Owner=<4>
    +Project: "testdll"=".\testdll.dsp" - Package Owner=<4>
     
     Package=<5>
     {{{
    @@ -74,11 +65,17 @@ Package=<5>
     
     Package=<4>
     {{{
    +    Begin Project Dependency
    +    Project_Dep_Name libapr
    +    End Project Dependency
    +    Begin Project Dependency
    +    Project_Dep_Name libapr_app
    +    End Project Dependency
     }}}
     
     ###############################################################################
     
    -Project: "libapr_app"="..\build\libapr_app.dsp" - Package Owner=<4>
    +Project: "testlib"=".\testlib.dsp" - Package Owner=<4>
     
     Package=<5>
     {{{
    @@ -87,7 +84,10 @@ Package=<5>
     Package=<4>
     {{{
         Begin Project Dependency
    -    Project_Dep_Name libapr
    +    Project_Dep_Name apr
    +    End Project Dependency
    +    Begin Project Dependency
    +    Project_Dep_Name apr_app
         End Project Dependency
     }}}
     
    
    From 148777a4809b444e41d7f298603b4e5c38e3624a Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Tue, 16 Oct 2007 15:17:16 +0000
    Subject: [PATCH 6026/7878] * test/testlockperf.c: Silence gcc warning from
     missing type.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585169 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testlockperf.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/testlockperf.c b/test/testlockperf.c
    index 4a612aae322..f673e5f7b19 100644
    --- a/test/testlockperf.c
    +++ b/test/testlockperf.c
    @@ -38,7 +38,7 @@ int main(void)
     #define MAX_COUNTER 1000000
     #define MAX_THREADS 6
     
    -static verbose = 0;
    +static int verbose = 0;
     static long mutex_counter;
     
     static apr_thread_mutex_t *thread_lock;
    
    From cbeec52f01f0d77c738602e86a7c47e8de39b9cb Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 16 Oct 2007 19:17:16 +0000
    Subject: [PATCH 6027/7878] Provide -v'erbose output during test-builds, and
     reflow for 80 columns.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585229 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.win | 40 ++++++++++++++++++++++++----------------
     1 file changed, 24 insertions(+), 16 deletions(-)
    
    diff --git a/test/Makefile.win b/test/Makefile.win
    index 4a377c73862..f0c04fed947 100644
    --- a/test/Makefile.win
    +++ b/test/Makefile.win
    @@ -63,20 +63,27 @@ TESTALL_COMPONENTS = \
     	$(OUTDIR)\testshmconsumer.exe \
     	$(OUTDIR)\globalmutexchild.exe
     
    -ALL_TESTS = $(INTDIR)\testutil.obj $(INTDIR)\testtime.obj $(INTDIR)\teststr.obj \
    -	$(INTDIR)\testvsn.obj $(INTDIR)\testipsub.obj $(INTDIR)\testmmap.obj \
    -	$(INTDIR)\testud.obj $(INTDIR)\testtable.obj $(INTDIR)\testsleep.obj \
    -	$(INTDIR)\testpools.obj $(INTDIR)\testfmt.obj $(INTDIR)\testfile.obj \
    -	$(INTDIR)\testdir.obj $(INTDIR)\testfileinfo.obj $(INTDIR)\testrand.obj \
    -	$(INTDIR)\testdso.obj $(INTDIR)\testoc.obj $(INTDIR)\testdup.obj \
    -	$(INTDIR)\testsockets.obj $(INTDIR)\testproc.obj $(INTDIR)\testpoll.obj \
    -	$(INTDIR)\testlock.obj $(INTDIR)\testsockopt.obj $(INTDIR)\testpipe.obj \
    -	$(INTDIR)\testthread.obj $(INTDIR)\testhash.obj $(INTDIR)\testargs.obj \
    -	$(INTDIR)\testnames.obj $(INTDIR)\testuser.obj $(INTDIR)\testpath.obj \
    -	$(INTDIR)\testenv.obj $(INTDIR)\testprocmutex.obj $(INTDIR)\testfnmatch.obj \
    -	$(INTDIR)\testatomic.obj $(INTDIR)\testflock.obj $(INTDIR)\testshm.obj \
    -	$(INTDIR)\testsock.obj $(INTDIR)\testglobalmutex.obj $(INTDIR)\teststrnatcmp.obj \
    -	$(INTDIR)\testfilecopy.obj $(INTDIR)\testtemp.obj $(INTDIR)\testlfs.obj \
    +ALL_TESTS = $(INTDIR)\testutil.obj $(INTDIR)\testtime.obj \
    +	$(INTDIR)\teststr.obj $(INTDIR)\testvsn.obj \
    +	$(INTDIR)\testipsub.obj $(INTDIR)\testmmap.obj \
    +	$(INTDIR)\testud.obj $(INTDIR)\testtable.obj \
    +	$(INTDIR)\testsleep.obj $(INTDIR)\testpools.obj \
    +	$(INTDIR)\testfmt.obj $(INTDIR)\testfile.obj \
    +	$(INTDIR)\testdir.obj $(INTDIR)\testfileinfo.obj \
    +	$(INTDIR)\testrand.obj $(INTDIR)\testdso.obj \
    +	$(INTDIR)\testoc.obj $(INTDIR)\testdup.obj \
    +	$(INTDIR)\testsockets.obj $(INTDIR)\testproc.obj \
    +	$(INTDIR)\testpoll.obj $(INTDIR)\testlock.obj \
    +	$(INTDIR)\testsockopt.obj $(INTDIR)\testpipe.obj \
    +	$(INTDIR)\testthread.obj $(INTDIR)\testhash.obj \
    +	$(INTDIR)\testargs.obj $(INTDIR)\testnames.obj \
    +	$(INTDIR)\testuser.obj $(INTDIR)\testpath.obj \
    +	$(INTDIR)\testenv.obj $(INTDIR)\testprocmutex.obj \
    +	$(INTDIR)\testfnmatch.obj $(INTDIR)\testatomic.obj \
    +	$(INTDIR)\testflock.obj $(INTDIR)\testshm.obj \
    +	$(INTDIR)\testsock.obj $(INTDIR)\testglobalmutex.obj \
    +	$(INTDIR)\teststrnatcmp.obj $(INTDIR)\testfilecopy.obj \
    +	$(INTDIR)\testtemp.obj $(INTDIR)\testlfs.obj \
     	$(INTDIR)\testcond.obj
     
     CLEAN_DATA = testfile.tmp lfstests\large.bin \
    @@ -89,7 +96,8 @@ CLEAN_BUILDDIRS = Debug Release LibD LibR 9x x64
     
     TEST_SUBDIRS = internal
     
    -PROGRAMS = $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS)
    +PROGRAMS = $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)
    +	$(OTHER_PROGRAMS)
     
     TARGETS = $(PROGRAMS)
     
    @@ -238,7 +246,7 @@ PATH=$(OUTDIR);..\$(OUTDIR);$(PATH)
     
     check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)
     	@for %p in ($(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)) do @( \
    -	    echo Testing %p && %p || echo %p failed \
    +	    echo Testing %p && %p -v || echo %p failed \
     	)
     
     checkall: check
    
    From af1eb1f8c3d774f4e231890f853123e21da581c7 Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Tue, 16 Oct 2007 20:43:03 +0000
    Subject: [PATCH 6028/7878] Fix up a few netware'isms and missing brackets left
     over from the refactoring.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585260 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/netware/proc.c | 16 ++++++++++------
     1 file changed, 10 insertions(+), 6 deletions(-)
    
    diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c
    index bed7d2a2a29..5fb26913c8b 100644
    --- a/threadproc/netware/proc.c
    +++ b/threadproc/netware/proc.c
    @@ -110,7 +110,7 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
     APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in,
                                        apr_file_t *parent_in)
     {
    -    apr_status_t rv;
    +    apr_status_t rv = APR_SUCCESS;
     
         if (attr->child_in == NULL && attr->parent_in == NULL
                 && child_in == NULL && parent_in == NULL)
    @@ -127,9 +127,11 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_fi
                         == APR_SUCCESS)
                     rv = apr_file_inherit_set(attr->child_in);
             }
    +    }
     
         if (parent_in != NULL && rv == APR_SUCCESS) {
             rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool);
    +    }
     
         return rv;
     }
    @@ -138,7 +140,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_fi
     APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out,
                                                          apr_file_t *parent_out)
     {
    -    apr_status_t rv;
    +    apr_status_t rv = APR_SUCCESS;
     
         if (attr->child_out == NULL && attr->parent_out == NULL
                && child_out == NULL && parent_out == NULL)
    @@ -159,6 +161,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_f
       
         if (parent_out != NULL && rv == APR_SUCCESS) {
             rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool);
    +    }
     
         return rv;
     }
    @@ -167,7 +170,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_f
     APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err,
                                                          apr_file_t *parent_err)
     {
    -    apr_status_t rv;
    +    apr_status_t rv = APR_SUCCESS;
     
         if (attr->child_err == NULL && attr->parent_err == NULL
                && child_err == NULL && parent_err == NULL)
    @@ -188,6 +191,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f
       
         if (parent_err != NULL && rv == APR_SUCCESS) {
             rv = apr_file_dup(&attr->parent_err, parent_err, attr->pool);
    +    }
     
         return rv;
     }
    @@ -315,15 +319,15 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
         wire.infd  = attr->child_in  
                    ? (attr->child_in->filedes != -1 ? attr->child_in->filedes 
                                                     : FD_UNUSED)
    -               : FILENO_STDIN;
    +               : fileno(stdin);
         wire.outfd  = attr->child_out
                     ? (attr->child_out->filedes != -1 ? attr->child_out->filedes 
                                                       : FD_UNUSED)
    -                : FILENO_STDOUT;
    +                : fileno(stdout);
         wire.errfd  = attr->child_err
                     ? (attr->child_err->filedes != -1 ? attr->child_err->filedes 
                                                       : FD_UNUSED)
    -                : FILENO_STDERR;
    +                : fileno(stderr);
     
         newproc->in = attr->parent_in;
         newproc->out = attr->parent_out;
    
    From 38be4f6c09a6b14371e59dc3c8bc0796e7e0c7ca Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 17 Oct 2007 03:13:55 +0000
    Subject: [PATCH 6029/7878] Fill in apr_fileinfo_t member st_csize on Netware
     and Unix
    
    And refine the file times down to apr_time_t resolution if supported
    by a st_atimensec or st_atim.tv_nsec value by the OS.  Additional
    msec implementations are possible if exposed through autoconf.
    
    PR: 41678
    Authored by: William Rowe, Nicklas Edmundsson 
    
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585343 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                              |  6 ++++++
     configure.in                         | 21 ++++++++++++++++--
     file_io/netware/filestat.c           | 17 +++++++++------
     file_io/unix/filestat.c              | 32 ++++++++++++++++++++++------
     include/arch/unix/apr_arch_file_io.h |  4 ++++
     5 files changed, 66 insertions(+), 14 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 96f94aa0028..7a16622e652 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,6 +1,12 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 1.3.0
     
    +  *) Fill in apr_fileinfo_t member st_csize on Netware and Unix (PR 41678),
    +     and refine the file times down to apr_time_t resolution if supported
    +     by a st_atimensec or st_atim.tv_nsec value by the OS.  Additional
    +     msec implementations are possible if exposed through autoconf.
    +     [William Rowe, Nicklas Edmundsson ]
    +
       *) Fix apr_socket_recvfrom() to ensure the peer's address is returned
          through the "from" parameter on Win32.  [William Rowe]
     
    diff --git a/configure.in b/configure.in
    index a13e8ee54a1..f5b5b7be3de 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -1063,8 +1063,6 @@ AC_SUBST(mmap)
     AC_SUBST(have_memmove)
     
     APR_CHECK_SIGWAIT_ONE_ARG
    -APR_CHECK_DIRENT_INODE
    -APR_CHECK_DIRENT_TYPE
     
     dnl ----------------------------- Checks for Any required Headers
     AC_HEADER_STDC
    @@ -1118,6 +1116,7 @@ APR_FLAG_HEADERS(
         sys/file.h		\
         sys/ioctl.h         \
         sys/mman.h		\
    +    sys/param.h         \
         sys/poll.h		\
         sys/resource.h	\
         sys/select.h	\
    @@ -1952,6 +1951,24 @@ fi
     
     AC_SUBST(rand)
     
    +dnl ----------------------------- Checking for File Info Support 
    +echo "${nl}Checking for File Info Support..."
    +AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_atimensec,
    +struct stat.st_ctimensec, struct stat.st_mtimensec, struct stat.st_atim.tv_nsec,
    +struct stat.st_ctim.tv_nsec, struct stat.st_mtim.tv_nsec],,,[
    +#ifdef HAVE_SYS_TYPES_H
    +#include 
    +#endif
    +#ifdef HAVE_SYS_STAT_H
    +#include 
    +#endif
    +#ifdef HAVE_UNISTD_H
    +#include 
    +#endif])
    +
    +APR_CHECK_DIRENT_INODE
    +APR_CHECK_DIRENT_TYPE
    +
     dnl ----------------------------- Checking for UUID Support 
     echo "${nl}Checking for OS UUID Support..."
     
    diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c
    index bf37762080d..662795128b1 100644
    --- a/file_io/netware/filestat.c
    +++ b/file_io/netware/filestat.c
    @@ -58,6 +58,7 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info,
     { 
         finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK 
                         | APR_FINFO_OWNER | APR_FINFO_PROT;
    +
         finfo->protection = apr_unix_mode2perms(info->st_mode);
         finfo->filetype = filetype_from_mode(info->st_mode);
         finfo->user = info->st_uid;
    @@ -66,15 +67,19 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info,
         finfo->inode = info->st_ino;
         finfo->device = info->st_dev;
         finfo->nlink = info->st_nlink;
    +
         apr_time_ansi_put(&finfo->atime, info->st_atime.tv_sec);
         apr_time_ansi_put(&finfo->mtime, info->st_mtime.tv_sec);
         apr_time_ansi_put(&finfo->ctime, info->st_ctime.tv_sec);
    -    /* ### needs to be revisited  
    -     * if (wanted & APR_FINFO_CSIZE) {
    -     *   finfo->csize = info->st_blocks * 512;
    -     *   finfo->valid |= APR_FINFO_CSIZE;
    -     * }
    -     */
    +
    +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
    +#ifdef DEV_BSIZE
    +    finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)DEV_BSIZE;
    +#else
    +    finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)512;
    +#endif
    +    finfo->valid |= APR_FINFO_CSIZE;
    +#endif
     }
     
     apr_status_t apr_file_info_get_locked(apr_finfo_t *finfo, apr_int32_t wanted,
    diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c
    index dd8b3adf99b..63dbf4d901e 100644
    --- a/file_io/unix/filestat.c
    +++ b/file_io/unix/filestat.c
    @@ -90,14 +90,34 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info,
         }
     
         apr_time_ansi_put(&finfo->atime, info->st_atime);
    +#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
    +    finfo->atime += info->st_atim.tv_nsec / APR_TIME_C(1000);
    +#elif defined(HAVE_STRUCT_STAT_ST_ATIMENSEC)
    +    finfo->atime += info->st_atimensec / APR_TIME_C(1000);
    +#endif
    +
         apr_time_ansi_put(&finfo->mtime, info->st_mtime);
    +#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
    +    finfo->mtime += info->st_mtim.tv_nsec / APR_TIME_C(1000);
    +#elif defined(HAVE_STRUCT_STAT_ST_MTIMENSEC)
    +    finfo->mtime += info->st_mtimensec / APR_TIME_C(1000);
    +#endif
    +
         apr_time_ansi_put(&finfo->ctime, info->st_ctime);
    -    /* ### needs to be revisited  
    -     * if (wanted & APR_FINFO_CSIZE) {
    -     *   finfo->csize = info->st_blocks * 512;
    -     *   finfo->valid |= APR_FINFO_CSIZE;
    -     * }
    -     */
    +#ifdef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC
    +    finfo->ctime += info->st_ctim.tv_nsec / APR_TIME_C(1000);
    +#elif defined(HAVE_STRUCT_STAT_ST_CTIMENSEC)
    +    finfo->ctime += info->st_ctimensec / APR_TIME_C(1000);
    +#endif
    +
    +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
    +#ifdef DEV_BSIZE
    +    finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)DEV_BSIZE;
    +#else
    +    finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)512;
    +#endif
    +    finfo->valid |= APR_FINFO_CSIZE;
    +#endif
     }
     
     apr_status_t apr_file_info_get_locked(apr_finfo_t *finfo, apr_int32_t wanted,
    diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h
    index af602038b3c..77a909177b4 100644
    --- a/include/arch/unix/apr_arch_file_io.h
    +++ b/include/arch/unix/apr_arch_file_io.h
    @@ -70,6 +70,10 @@
     #ifdef BEOS
     #include 
     #endif
    +/* Hunting down DEV_BSIZE if not from dirent.h, sys/stat.h etc */
    +#ifdef HAVE_SYS_PARAM_H
    +#include 
    +#endif
     
     #if BEOS_BONE
     # ifndef BONE7
    
    From 7d7cbadf7df3e2873b4e772cb92a376a0c74f372 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 17 Oct 2007 03:35:55 +0000
    Subject: [PATCH 6030/7878] Pick up AIX 5.2 onwards
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585348 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in            | 3 ++-
     file_io/unix/filestat.c | 6 ++++++
     2 files changed, 8 insertions(+), 1 deletion(-)
    
    diff --git a/configure.in b/configure.in
    index f5b5b7be3de..b7153caaf03 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -1955,7 +1955,8 @@ dnl ----------------------------- Checking for File Info Support
     echo "${nl}Checking for File Info Support..."
     AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_atimensec,
     struct stat.st_ctimensec, struct stat.st_mtimensec, struct stat.st_atim.tv_nsec,
    -struct stat.st_ctim.tv_nsec, struct stat.st_mtim.tv_nsec],,,[
    +struct stat.st_ctim.tv_nsec, struct stat.st_mtim.tv_nsec,
    +struct stat.st_atime_n, struct stat.st_ctime_n, struct stat.st_mtime_n],,,[
     #ifdef HAVE_SYS_TYPES_H
     #include 
     #endif
    diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c
    index 63dbf4d901e..9bee651120a 100644
    --- a/file_io/unix/filestat.c
    +++ b/file_io/unix/filestat.c
    @@ -94,6 +94,8 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info,
         finfo->atime += info->st_atim.tv_nsec / APR_TIME_C(1000);
     #elif defined(HAVE_STRUCT_STAT_ST_ATIMENSEC)
         finfo->atime += info->st_atimensec / APR_TIME_C(1000);
    +#elif defined(HAVE_STRUCT_STAT_ST_ATIME_N)
    +    finfo->ctime += info->st_atime_n / APR_TIME_C(1000);
     #endif
     
         apr_time_ansi_put(&finfo->mtime, info->st_mtime);
    @@ -101,6 +103,8 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info,
         finfo->mtime += info->st_mtim.tv_nsec / APR_TIME_C(1000);
     #elif defined(HAVE_STRUCT_STAT_ST_MTIMENSEC)
         finfo->mtime += info->st_mtimensec / APR_TIME_C(1000);
    +#elif defined(HAVE_STRUCT_STAT_ST_MTIME_N)
    +    finfo->ctime += info->st_mtime_n / APR_TIME_C(1000);
     #endif
     
         apr_time_ansi_put(&finfo->ctime, info->st_ctime);
    @@ -108,6 +112,8 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info,
         finfo->ctime += info->st_ctim.tv_nsec / APR_TIME_C(1000);
     #elif defined(HAVE_STRUCT_STAT_ST_CTIMENSEC)
         finfo->ctime += info->st_ctimensec / APR_TIME_C(1000);
    +#elif defined(HAVE_STRUCT_STAT_ST_CTIME_N)
    +    finfo->ctime += info->st_ctime_n / APR_TIME_C(1000);
     #endif
     
     #ifdef HAVE_STRUCT_STAT_ST_BLOCKS
    
    From c86c7ac9267753b9f004c231d27619a638292254 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 17 Oct 2007 04:14:34 +0000
    Subject: [PATCH 6031/7878] Complete commit 488084; not only the documentation,
     but detection of underflow!
    
    PR: 40955
    Submitted by: Peter Steiner 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585357 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_pools.c | 10 ++++++++--
     1 file changed, 8 insertions(+), 2 deletions(-)
    
    diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
    index eb3639c9ddb..68e095f2166 100644
    --- a/memory/unix/apr_pools.c
    +++ b/memory/unix/apr_pools.c
    @@ -368,7 +368,10 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node)
                     max_index = index;
                 }
                 allocator->free[index] = node;
    -            current_free_index -= index;
    +            if (current_free_index >= index)
    +                current_free_index -= index;
    +            else
    +                current_free_index = 0;
             }
             else {
                 /* This node is too large to keep in a specific size bucket,
    @@ -376,7 +379,10 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node)
                  */
                 node->next = allocator->free[0];
                 allocator->free[0] = node;
    -            current_free_index -= index;
    +            if (current_free_index >= index)
    +                current_free_index -= index;
    +            else
    +                current_free_index = 0;
             }
         } while ((node = next) != NULL);
     
    
    From a2b8e33b1c4644fd684ee52de028eeab3c521faa Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 17 Oct 2007 19:16:15 +0000
    Subject: [PATCH 6032/7878] THOSE other programs :)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585637 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.win | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/Makefile.win b/test/Makefile.win
    index f0c04fed947..db88659e326 100644
    --- a/test/Makefile.win
    +++ b/test/Makefile.win
    @@ -96,7 +96,7 @@ CLEAN_BUILDDIRS = Debug Release LibD LibR 9x x64
     
     TEST_SUBDIRS = internal
     
    -PROGRAMS = $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)
    +PROGRAMS = $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) \
     	$(OTHER_PROGRAMS)
     
     TARGETS = $(PROGRAMS)
    
    From 4671e1b24069ab199863866cb798ecff7f3c2f42 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 18 Oct 2007 03:31:20 +0000
    Subject: [PATCH 6033/7878] Correct typos, apr looks good
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585822 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testdll.dsp | 4 ++--
     test/testlib.dsp | 4 ++--
     2 files changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/test/testdll.dsp b/test/testdll.dsp
    index 96f929a76ee..9736fc9ba0a 100644
    --- a/test/testdll.dsp
    +++ b/test/testdll.dsp
    @@ -72,7 +72,7 @@ CFG=testdll - Win32 Release
     # PROP Bsc_Name ""
     # PROP Target_Dir ""
     
    -!IF  "$(CFG)" == "testdll - Win32 Release9x"
    +!ELSEIF  "$(CFG)" == "testdll - Win32 Release9x"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 0
    @@ -114,7 +114,7 @@ CFG=testdll - Win32 Release
     # PROP Bsc_Name ""
     # PROP Target_Dir ""
     
    -!IF  "$(CFG)" == "testdll - x64 Release"
    +!ELSEIF  "$(CFG)" == "testdll - x64 Release"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 0
    diff --git a/test/testlib.dsp b/test/testlib.dsp
    index 2c3a775d3db..d3ab7aaf5c0 100644
    --- a/test/testlib.dsp
    +++ b/test/testlib.dsp
    @@ -72,7 +72,7 @@ CFG=testlib - Win32 Release
     # PROP Bsc_Name ""
     # PROP Target_Dir ""
     
    -!IF  "$(CFG)" == "testlib - Win32 Release9x"
    +!ELSEIF  "$(CFG)" == "testlib - Win32 Release9x"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 0
    @@ -114,7 +114,7 @@ CFG=testlib - Win32 Release
     # PROP Bsc_Name ""
     # PROP Target_Dir ""
     
    -!IF  "$(CFG)" == "testlib - x64 Release"
    +!ELSEIF  "$(CFG)" == "testlib - x64 Release"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 0
    
    From 16cde0b4d72f47895716f0564c2fe318848104ee Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 18 Oct 2007 04:34:35 +0000
    Subject: [PATCH 6034/7878] At least on trunk, break out poll (make it obvious
     our poll-fu on win32 is still not 1337).
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585860 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr.dsp    | 12 ++++++++----
     libapr.dsp | 11 +++++++----
     2 files changed, 15 insertions(+), 8 deletions(-)
    
    diff --git a/apr.dsp b/apr.dsp
    index 6217f2a9d34..88a87adeb38 100644
    --- a/apr.dsp
    +++ b/apr.dsp
    @@ -384,10 +384,6 @@ SOURCE=.\network_io\unix\multicast.c
     # End Source File
     # Begin Source File
     
    -SOURCE=.\poll\unix\select.c
    -# End Source File
    -# Begin Source File
    -
     SOURCE=.\network_io\win32\sendrecv.c
     # End Source File
     # Begin Source File
    @@ -411,6 +407,14 @@ SOURCE=.\network_io\win32\sockopt.c
     SOURCE=.\passwd\apr_getpass.c
     # End Source File
     # End Group
    +# Begin Group "poll"
    +
    +# PROP Default_Filter ""
    +# Begin Source File
    +
    +SOURCE=.\poll\unix\select.c
    +# End Source File
    +# End Group
     # Begin Group "random"
     
     # PROP Default_Filter ""
    diff --git a/libapr.dsp b/libapr.dsp
    index 62aba05a445..09e7afbb4af 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -436,10 +436,6 @@ SOURCE=.\network_io\unix\multicast.c
     # End Source File
     # Begin Source File
     
    -SOURCE=.\poll\unix\select.c
    -# End Source File
    -# Begin Source File
    -
     SOURCE=.\network_io\win32\sendrecv.c
     # End Source File
     # Begin Source File
    @@ -463,6 +459,13 @@ SOURCE=.\network_io\win32\sockopt.c
     SOURCE=.\passwd\apr_getpass.c
     # End Source File
     # End Group
    +# Begin Group "poll"
    +
    +# PROP Default_Filter ""
    +# Begin Source File
    +
    +SOURCE=.\poll\unix\select.c
    +# End Source File
     # Begin Group "random"
     
     # PROP Default_Filter ""
    
    From 7afee440e2ea7579f1d3e024425def5db9816f57 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 18 Oct 2007 04:36:56 +0000
    Subject: [PATCH 6035/7878] missed a line
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585861 13f79535-47bb-0310-9956-ffa450edef68
    ---
     libapr.dsp | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/libapr.dsp b/libapr.dsp
    index 09e7afbb4af..1210013a6fd 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -466,6 +466,7 @@ SOURCE=.\passwd\apr_getpass.c
     
     SOURCE=.\poll\unix\select.c
     # End Source File
    +# End Group
     # Begin Group "random"
     
     # PROP Default_Filter ""
    
    From 56009ac12453c8c57f8d39ef079e3d143aa1b0f6 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 18 Oct 2007 05:32:07 +0000
    Subject: [PATCH 6036/7878] Rename apr_app to clearly fall in our target tree
     as [lib]aprapp-1.lib for users who want to make NT-specific binaries (and
     receive full unicode envvars and command line into their main() in utf8 as if
     nothing happened).
    
    Hook up pre-aprapp steps just like we did for apriconv.
    Although it's 'named' libaprapp, it's also a static lib
    and needs to avoid being filled with the libapriconv dll
    bindings just like other static libraries which depend
    upon another static lib (the reason for inventing these
    pre-dsp's).
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585870 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr.dsw                                 |  36 ++++-
     build/{apr_app.dsp => aprapp.dsp}       |  92 ++++++------
     build/{libapr_app.dsp => libaprapp.dsp} |  92 ++++++------
     build/preaprapp.dsp                     | 179 ++++++++++++++++++++++++
     build/prelibaprapp.dsp                  | 179 ++++++++++++++++++++++++
     test/Makefile.win                       |   4 +-
     6 files changed, 485 insertions(+), 97 deletions(-)
     rename build/{apr_app.dsp => aprapp.dsp} (62%)
     rename build/{libapr_app.dsp => libaprapp.dsp} (68%)
     create mode 100644 build/preaprapp.dsp
     create mode 100644 build/prelibaprapp.dsp
    
    diff --git a/apr.dsw b/apr.dsw
    index dc0871bbc88..6d67f34055d 100644
    --- a/apr.dsw
    +++ b/apr.dsw
    @@ -15,7 +15,7 @@ Package=<4>
     
     ###############################################################################
     
    -Project: "apr_app"=".\build\apr_app.dsp" - Package Owner=<4>
    +Project: "aprapp"=".\build\aprapp.dsp" - Package Owner=<4>
     
     Package=<5>
     {{{
    @@ -24,7 +24,7 @@ Package=<5>
     Package=<4>
     {{{
         Begin Project Dependency
    -    Project_Dep_Name apr
    +    Project_Dep_Name preaprapp
         End Project Dependency
     }}}
     
    @@ -42,7 +42,37 @@ Package=<4>
     
     ###############################################################################
     
    -Project: "libapr_app"=".\build\libapr_app.dsp" - Package Owner=<4>
    +Project: "libaprapp"=".\build\libaprapp.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +    Begin Project Dependency
    +    Project_Dep_Name prelibaprapp
    +    End Project Dependency
    +}}}
    +
    +###############################################################################
    +
    +Project: "preaprapp"=".\build\preaprapp.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +    Begin Project Dependency
    +    Project_Dep_Name apr
    +    End Project Dependency
    +}}}
    +
    +###############################################################################
    +
    +Project: "prelibaprapp"=".\build\prelibaprapp.dsp" - Package Owner=<4>
     
     Package=<5>
     {{{
    diff --git a/build/apr_app.dsp b/build/aprapp.dsp
    similarity index 62%
    rename from build/apr_app.dsp
    rename to build/aprapp.dsp
    index 62a76d46f62..b8b08ebd057 100644
    --- a/build/apr_app.dsp
    +++ b/build/aprapp.dsp
    @@ -1,28 +1,28 @@
    -# Microsoft Developer Studio Project File - Name="apr_app" - Package Owner=<4>
    +# Microsoft Developer Studio Project File - Name="aprapp" - Package Owner=<4>
     # Microsoft Developer Studio Generated Build File, Format Version 6.00
     # ** DO NOT EDIT **
     
     # TARGTYPE "Win32 (x86) Static Library" 0x0104
     
    -CFG=apr_app - Win32 Release
    +CFG=aprapp - Win32 Release
     !MESSAGE This is not a valid makefile. To build this project using NMAKE,
     !MESSAGE use the Export Makefile command and run
     !MESSAGE 
    -!MESSAGE NMAKE /f "apr_app.mak".
    +!MESSAGE NMAKE /f "aprapp.mak".
     !MESSAGE 
     !MESSAGE You can specify a configuration when running NMAKE
     !MESSAGE by defining the macro CFG on the command line. For example:
     !MESSAGE 
    -!MESSAGE NMAKE /f "apr_app.mak" CFG="apr_app - Win32 Release"
    +!MESSAGE NMAKE /f "aprapp.mak" CFG="aprapp - Win32 Release"
     !MESSAGE 
     !MESSAGE Possible choices for configuration are:
     !MESSAGE 
    -!MESSAGE "apr_app - Win32 Release" (based on "Win32 (x86) Static Library")
    -!MESSAGE "apr_app - Win32 Debug" (based on "Win32 (x86) Static Library")
    -!MESSAGE "apr_app - Win32 Release9x" (based on "Win32 (x86) Static Library")
    -!MESSAGE "apr_app - Win32 Debug9x" (based on "Win32 (x86) Static Library")
    -!MESSAGE "apr_app - x64 Release" (based on "Win32 (x86) Static Library")
    -!MESSAGE "apr_app - x64 Debug" (based on "Win32 (x86) Static Library")
    +!MESSAGE "aprapp - Win32 Release" (based on "Win32 (x86) Static Library")
    +!MESSAGE "aprapp - Win32 Debug" (based on "Win32 (x86) Static Library")
    +!MESSAGE "aprapp - Win32 Release9x" (based on "Win32 (x86) Static Library")
    +!MESSAGE "aprapp - Win32 Debug9x" (based on "Win32 (x86) Static Library")
    +!MESSAGE "aprapp - x64 Release" (based on "Win32 (x86) Static Library")
    +!MESSAGE "aprapp - x64 Debug" (based on "Win32 (x86) Static Library")
     !MESSAGE 
     
     # Begin Project
    @@ -32,20 +32,20 @@ CFG=apr_app - Win32 Release
     CPP=cl.exe
     RSC=rc.exe
     
    -!IF  "$(CFG)" == "apr_app - Win32 Release"
    +!IF  "$(CFG)" == "aprapp - Win32 Release"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 0
    -# PROP BASE Output_Dir "LibR"
    +# PROP BASE Output_Dir "..\LibR"
     # PROP BASE Intermediate_Dir "LibR"
     # PROP BASE Target_Dir ""
     # PROP Use_MFC 0
     # PROP Use_Debug_Libraries 0
    -# PROP Output_Dir "LibR"
    +# PROP Output_Dir "..\LibR"
     # PROP Intermediate_Dir "LibR"
     # PROP Target_Dir ""
     # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
    -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr_app-1" /FD /c
    +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-1" /FD /c
     # ADD BASE RSC /l 0x409
     # ADD RSC /l 0x409
     BSC32=bscmake.exe
    @@ -53,23 +53,23 @@ BSC32=bscmake.exe
     # ADD BSC32 /nologo
     LIB32=link.exe -lib
     # ADD BASE LIB32 /nologo
    -# ADD LIB32 /nologo /out:"LibR\apr_app-1.lib"
    +# ADD LIB32 /nologo /out:"..\LibR\aprapp-1.lib"
     
    -!ELSEIF  "$(CFG)" == "apr_app - Win32 Debug"
    +!ELSEIF  "$(CFG)" == "aprapp - Win32 Debug"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 1
    -# PROP BASE Output_Dir "LibD"
    +# PROP BASE Output_Dir "..\LibD"
     # PROP BASE Intermediate_Dir "LibD"
     # PROP BASE Target_Dir ""
     # PROP Use_MFC 0
     # PROP Use_Debug_Libraries 1
    -# PROP Output_Dir "LibD"
    +# PROP Output_Dir "..\LibD"
     # PROP Intermediate_Dir "LibD"
     # PROP Ignore_Export_Lib 0
     # PROP Target_Dir ""
     # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
    -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr_app-1" /FD /c
    +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-1" /FD /c
     # ADD BASE RSC /l 0x409
     # ADD RSC /l 0x409
     BSC32=bscmake.exe
    @@ -77,22 +77,22 @@ BSC32=bscmake.exe
     # ADD BSC32 /nologo
     LIB32=link.exe -lib
     # ADD BASE LIB32 /nologo
    -# ADD LIB32 /nologo /out:"LibD\apr_app-1.lib"
    +# ADD LIB32 /nologo /out:"..\LibD\aprapp-1.lib"
     
    -!ELSEIF  "$(CFG)" == "apr_app - Win32 Release9x"
    +!ELSEIF  "$(CFG)" == "aprapp - Win32 Release9x"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 0
    -# PROP BASE Output_Dir "9x\LibR"
    +# PROP BASE Output_Dir "..\9x\LibR"
     # PROP BASE Intermediate_Dir "9x\LibR"
     # PROP BASE Target_Dir ""
     # PROP Use_MFC 0
     # PROP Use_Debug_Libraries 0
    -# PROP Output_Dir "9x\LibR"
    +# PROP Output_Dir "..\9x\LibR"
     # PROP Intermediate_Dir "9x\LibR"
     # PROP Target_Dir ""
     # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
    -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr_app-1" /FD /c
    +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-1" /FD /c
     # ADD BASE RSC /l 0x409
     # ADD RSC /l 0x409
     BSC32=bscmake.exe
    @@ -100,23 +100,23 @@ BSC32=bscmake.exe
     # ADD BSC32 /nologo
     LIB32=link.exe -lib
     # ADD BASE LIB32 /nologo
    -# ADD LIB32 /nologo /out:"9x\LibR\apr_app-1.lib"
    +# ADD LIB32 /nologo /out:"..\9x\LibR\aprapp-1.lib"
     
    -!ELSEIF  "$(CFG)" == "apr_app - Win32 Debug9x"
    +!ELSEIF  "$(CFG)" == "aprapp - Win32 Debug9x"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 1
    -# PROP BASE Output_Dir "9x\LibD"
    +# PROP BASE Output_Dir "..\9x\LibD"
     # PROP BASE Intermediate_Dir "9x\LibD"
     # PROP BASE Target_Dir ""
     # PROP Use_MFC 0
     # PROP Use_Debug_Libraries 1
    -# PROP Output_Dir "9x\LibD"
    +# PROP Output_Dir "..\9x\LibD"
     # PROP Intermediate_Dir "9x\LibD"
     # PROP Ignore_Export_Lib 0
     # PROP Target_Dir ""
     # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
    -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr_app-1" /FD /c
    +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-1" /FD /c
     # ADD BASE RSC /l 0x409
     # ADD RSC /l 0x409
     BSC32=bscmake.exe
    @@ -124,22 +124,22 @@ BSC32=bscmake.exe
     # ADD BSC32 /nologo
     LIB32=link.exe -lib
     # ADD BASE LIB32 /nologo
    -# ADD LIB32 /nologo /out:"9x\LibD\apr_app-1.lib"
    +# ADD LIB32 /nologo /out:"..\9x\LibD\aprapp-1.lib"
     
    -!ELSEIF  "$(CFG)" == "apr_app - x64 Release"
    +!ELSEIF  "$(CFG)" == "aprapp - x64 Release"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 0
    -# PROP BASE Output_Dir "x64\LibR"
    +# PROP BASE Output_Dir "..\x64\LibR"
     # PROP BASE Intermediate_Dir "x64\LibR"
     # PROP BASE Target_Dir ""
     # PROP Use_MFC 0
     # PROP Use_Debug_Libraries 0
    -# PROP Output_Dir "x64\LibR"
    +# PROP Output_Dir "..\x64\LibR"
     # PROP Intermediate_Dir "x64\LibR"
     # PROP Target_Dir ""
     # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
    -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr_app-1" /FD /c
    +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-1" /FD /c
     # ADD BASE RSC /l 0x409
     # ADD RSC /l 0x409
     BSC32=bscmake.exe
    @@ -147,23 +147,23 @@ BSC32=bscmake.exe
     # ADD BSC32 /nologo
     LIB32=link.exe -lib
     # ADD BASE LIB32 /nologo
    -# ADD LIB32 /nologo /out:"x64\LibR\apr_app-1.lib"
    +# ADD LIB32 /nologo /out:"..\x64\LibR\aprapp-1.lib"
     
    -!ELSEIF  "$(CFG)" == "apr_app - x64 Debug"
    +!ELSEIF  "$(CFG)" == "aprapp - x64 Debug"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 1
    -# PROP BASE Output_Dir "x64\LibD"
    +# PROP BASE Output_Dir "..\x64\LibD"
     # PROP BASE Intermediate_Dir "x64\LibD"
     # PROP BASE Target_Dir ""
     # PROP Use_MFC 0
     # PROP Use_Debug_Libraries 1
    -# PROP Output_Dir "x64\LibD"
    +# PROP Output_Dir "..\x64\LibD"
     # PROP Intermediate_Dir "x64\LibD"
     # PROP Ignore_Export_Lib 0
     # PROP Target_Dir ""
     # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
    -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr_app-1" /FD /c
    +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-1" /FD /c
     # ADD BASE RSC /l 0x409
     # ADD RSC /l 0x409
     BSC32=bscmake.exe
    @@ -171,18 +171,18 @@ BSC32=bscmake.exe
     # ADD BSC32 /nologo
     LIB32=link.exe -lib
     # ADD BASE LIB32 /nologo
    -# ADD LIB32 /nologo /out:"x64\LibD\apr_app-1.lib"
    +# ADD LIB32 /nologo /out:"..\x64\LibD\aprapp-1.lib"
     
     !ENDIF 
     
     # Begin Target
     
    -# Name "apr_app - Win32 Release"
    -# Name "apr_app - Win32 Debug"
    -# Name "apr_app - Win32 Release9x"
    -# Name "apr_app - Win32 Debug9x"
    -# Name "apr_app - x64 Release"
    -# Name "apr_app - x64 Debug"
    +# Name "aprapp - Win32 Release"
    +# Name "aprapp - Win32 Debug"
    +# Name "aprapp - Win32 Release9x"
    +# Name "aprapp - Win32 Debug9x"
    +# Name "aprapp - x64 Release"
    +# Name "aprapp - x64 Debug"
     # Begin Source File
     
     SOURCE=..\misc\win32\apr_app.c
    diff --git a/build/libapr_app.dsp b/build/libaprapp.dsp
    similarity index 68%
    rename from build/libapr_app.dsp
    rename to build/libaprapp.dsp
    index 6004045e0df..2a9506dc90e 100644
    --- a/build/libapr_app.dsp
    +++ b/build/libaprapp.dsp
    @@ -1,28 +1,28 @@
    -# Microsoft Developer Studio Project File - Name="libapr_app" - Package Owner=<4>
    +# Microsoft Developer Studio Project File - Name="libaprapp" - Package Owner=<4>
     # Microsoft Developer Studio Generated Build File, Format Version 6.00
     # ** DO NOT EDIT **
     
     # TARGTYPE "Win32 (x86) Static Library" 0x0104
     
    -CFG=libapr_app - Win32 Release
    +CFG=libaprapp - Win32 Release
     !MESSAGE This is not a valid makefile. To build this project using NMAKE,
     !MESSAGE use the Export Makefile command and run
     !MESSAGE 
    -!MESSAGE NMAKE /f "libapr_app.mak".
    +!MESSAGE NMAKE /f "libaprapp.mak".
     !MESSAGE 
     !MESSAGE You can specify a configuration when running NMAKE
     !MESSAGE by defining the macro CFG on the command line. For example:
     !MESSAGE 
    -!MESSAGE NMAKE /f "libapr_app.mak" CFG="libapr_app - Win32 Release"
    +!MESSAGE NMAKE /f "libaprapp.mak" CFG="libaprapp - Win32 Release"
     !MESSAGE 
     !MESSAGE Possible choices for configuration are:
     !MESSAGE 
    -!MESSAGE "libapr_app - Win32 Release" (based on "Win32 (x86) Static Library")
    -!MESSAGE "libapr_app - Win32 Debug" (based on "Win32 (x86) Static Library")
    -!MESSAGE "libapr_app - Win32 Release9x" (based on "Win32 (x86) Static Library")
    -!MESSAGE "libapr_app - Win32 Debug9x" (based on "Win32 (x86) Static Library")
    -!MESSAGE "libapr_app - x64 Release" (based on "Win32 (x86) Static Library")
    -!MESSAGE "libapr_app - x64 Debug" (based on "Win32 (x86) Static Library")
    +!MESSAGE "libaprapp - Win32 Release" (based on "Win32 (x86) Static Library")
    +!MESSAGE "libaprapp - Win32 Debug" (based on "Win32 (x86) Static Library")
    +!MESSAGE "libaprapp - Win32 Release9x" (based on "Win32 (x86) Static Library")
    +!MESSAGE "libaprapp - Win32 Debug9x" (based on "Win32 (x86) Static Library")
    +!MESSAGE "libaprapp - x64 Release" (based on "Win32 (x86) Static Library")
    +!MESSAGE "libaprapp - x64 Debug" (based on "Win32 (x86) Static Library")
     !MESSAGE 
     
     # Begin Project
    @@ -32,20 +32,20 @@ CFG=libapr_app - Win32 Release
     CPP=cl.exe
     RSC=rc.exe
     
    -!IF  "$(CFG)" == "libapr_app - Win32 Release"
    +!IF  "$(CFG)" == "libaprapp - Win32 Release"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 0
    -# PROP BASE Output_Dir "Release"
    +# PROP BASE Output_Dir "..\Release"
     # PROP BASE Intermediate_Dir "Release"
     # PROP BASE Target_Dir ""
     # PROP Use_MFC 0
     # PROP Use_Debug_Libraries 0
    -# PROP Output_Dir "Release"
    +# PROP Output_Dir "..\Release"
     # PROP Intermediate_Dir "Release"
     # PROP Target_Dir ""
     # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
    -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libapr_app-1" /FD /c
    +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-1" /FD /c
     # ADD BASE RSC /l 0x409
     # ADD RSC /l 0x409
     BSC32=bscmake.exe
    @@ -53,23 +53,23 @@ BSC32=bscmake.exe
     # ADD BSC32 /nologo
     LIB32=link.exe -lib
     # ADD BASE LIB32 /nologo
    -# ADD LIB32 /nologo /out:"Release\libapr_app-1.lib"
    +# ADD LIB32 /nologo /out:"..\Release\libaprapp-1.lib"
     
    -!ELSEIF  "$(CFG)" == "libapr_app - Win32 Debug"
    +!ELSEIF  "$(CFG)" == "libaprapp - Win32 Debug"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 1
    -# PROP BASE Output_Dir "Debug"
    +# PROP BASE Output_Dir "..\Debug"
     # PROP BASE Intermediate_Dir "Debug"
     # PROP BASE Target_Dir ""
     # PROP Use_MFC 0
     # PROP Use_Debug_Libraries 1
    -# PROP Output_Dir "Debug"
    +# PROP Output_Dir "..\Debug"
     # PROP Intermediate_Dir "Debug"
     # PROP Ignore_Export_Lib 0
     # PROP Target_Dir ""
     # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
    -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libapr_app-1" /FD /c
    +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-1" /FD /c
     # ADD BASE RSC /l 0x409
     # ADD RSC /l 0x409
     BSC32=bscmake.exe
    @@ -77,22 +77,22 @@ BSC32=bscmake.exe
     # ADD BSC32 /nologo
     LIB32=link.exe -lib
     # ADD BASE LIB32 /nologo
    -# ADD LIB32 /nologo /out:"Debug\libapr_app-1.lib"
    +# ADD LIB32 /nologo /out:"..\Debug\libaprapp-1.lib"
     
    -!ELSEIF  "$(CFG)" == "libapr_app - Win32 Release9x"
    +!ELSEIF  "$(CFG)" == "libaprapp - Win32 Release9x"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 0
    -# PROP BASE Output_Dir "9x\Release"
    +# PROP BASE Output_Dir "..\9x\Release"
     # PROP BASE Intermediate_Dir "9x\Release"
     # PROP BASE Target_Dir ""
     # PROP Use_MFC 0
     # PROP Use_Debug_Libraries 0
    -# PROP Output_Dir "9x\Release"
    +# PROP Output_Dir "..\9x\Release"
     # PROP Intermediate_Dir "9x\Release"
     # PROP Target_Dir ""
     # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
    -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libapr_app-1" /FD /c
    +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-1" /FD /c
     # ADD BASE RSC /l 0x409
     # ADD RSC /l 0x409
     BSC32=bscmake.exe
    @@ -100,23 +100,23 @@ BSC32=bscmake.exe
     # ADD BSC32 /nologo
     LIB32=link.exe -lib
     # ADD BASE LIB32 /nologo
    -# ADD LIB32 /nologo /out:"9x\Release\libapr_app-1.lib"
    +# ADD LIB32 /nologo /out:"..\9x\Release\libaprapp-1.lib"
     
    -!ELSEIF  "$(CFG)" == "libapr_app - Win32 Debug9x"
    +!ELSEIF  "$(CFG)" == "libaprapp - Win32 Debug9x"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 1
    -# PROP BASE Output_Dir "9x\Debug"
    +# PROP BASE Output_Dir "..\9x\Debug"
     # PROP BASE Intermediate_Dir "9x\Debug"
     # PROP BASE Target_Dir ""
     # PROP Use_MFC 0
     # PROP Use_Debug_Libraries 1
    -# PROP Output_Dir "9x\Debug"
    +# PROP Output_Dir "..\9x\Debug"
     # PROP Intermediate_Dir "9x\Debug"
     # PROP Ignore_Export_Lib 0
     # PROP Target_Dir ""
     # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
    -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libapr_app-1" /FD /c
    +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-1" /FD /c
     # ADD BASE RSC /l 0x409
     # ADD RSC /l 0x409
     BSC32=bscmake.exe
    @@ -124,22 +124,22 @@ BSC32=bscmake.exe
     # ADD BSC32 /nologo
     LIB32=link.exe -lib
     # ADD BASE LIB32 /nologo
    -# ADD LIB32 /nologo /out:"9x\Debug\libapr_app-1.lib"
    +# ADD LIB32 /nologo /out:"..\9x\Debug\libaprapp-1.lib"
     
    -!ELSEIF  "$(CFG)" == "libapr_app - x64 Release"
    +!ELSEIF  "$(CFG)" == "libaprapp - x64 Release"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 0
    -# PROP BASE Output_Dir "x64\Release"
    +# PROP BASE Output_Dir "..\x64\Release"
     # PROP BASE Intermediate_Dir "x64\Release"
     # PROP BASE Target_Dir ""
     # PROP Use_MFC 0
     # PROP Use_Debug_Libraries 0
    -# PROP Output_Dir "x64\Release"
    +# PROP Output_Dir "..\x64\Release"
     # PROP Intermediate_Dir "x64\Release"
     # PROP Target_Dir ""
     # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
    -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libapr_app-1" /FD /c
    +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-1" /FD /c
     # ADD BASE RSC /l 0x409
     # ADD RSC /l 0x409
     BSC32=bscmake.exe
    @@ -147,23 +147,23 @@ BSC32=bscmake.exe
     # ADD BSC32 /nologo
     LIB32=link.exe -lib
     # ADD BASE LIB32 /nologo
    -# ADD LIB32 /nologo /out:"x64\Release\libapr_app-1.lib"
    +# ADD LIB32 /nologo /out:"..\x64\Release\libaprapp-1.lib"
     
    -!ELSEIF  "$(CFG)" == "libapr_app - x64 Debug"
    +!ELSEIF  "$(CFG)" == "libaprapp - x64 Debug"
     
     # PROP BASE Use_MFC 0
     # PROP BASE Use_Debug_Libraries 1
    -# PROP BASE Output_Dir "x64\Debug"
    +# PROP BASE Output_Dir "..\x64\Debug"
     # PROP BASE Intermediate_Dir "x64\Debug"
     # PROP BASE Target_Dir ""
     # PROP Use_MFC 0
     # PROP Use_Debug_Libraries 1
    -# PROP Output_Dir "x64\Debug"
    +# PROP Output_Dir "..\x64\Debug"
     # PROP Intermediate_Dir "x64\Debug"
     # PROP Ignore_Export_Lib 0
     # PROP Target_Dir ""
     # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
    -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libapr_app-1" /FD /c
    +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-1" /FD /c
     # ADD BASE RSC /l 0x409
     # ADD RSC /l 0x409
     BSC32=bscmake.exe
    @@ -171,18 +171,18 @@ BSC32=bscmake.exe
     # ADD BSC32 /nologo
     LIB32=link.exe -lib
     # ADD BASE LIB32 /nologo
    -# ADD LIB32 /nologo /out:"x64\Debug\libapr_app-1.lib"
    +# ADD LIB32 /nologo /out:"..\x64\Debug\libaprapp-1.lib"
     
     !ENDIF 
     
     # Begin Target
     
    -# Name "libapr_app - Win32 Release"
    -# Name "libapr_app - Win32 Debug"
    -# Name "libapr_app - Win32 Release9x"
    -# Name "libapr_app - Win32 Debug9x"
    -# Name "libapr_app - x64 Release"
    -# Name "libapr_app - x64 Debug"
    +# Name "libaprapp - Win32 Release"
    +# Name "libaprapp - Win32 Debug"
    +# Name "libaprapp - Win32 Release9x"
    +# Name "libaprapp - Win32 Debug9x"
    +# Name "libaprapp - x64 Release"
    +# Name "libaprapp - x64 Debug"
     # Begin Source File
     
     SOURCE=..\misc\win32\apr_app.c
    diff --git a/build/preaprapp.dsp b/build/preaprapp.dsp
    new file mode 100644
    index 00000000000..4825e2e0131
    --- /dev/null
    +++ b/build/preaprapp.dsp
    @@ -0,0 +1,179 @@
    +# Microsoft Developer Studio Project File - Name="preaprapp" - Package Owner=<4>
    +# Microsoft Developer Studio Generated Build File, Format Version 6.00
    +# ** DO NOT EDIT **
    +
    +# TARGTYPE "Win32 (x86) External Target" 0x0106
    +
    +CFG=preaprapp - Win32 Release
    +!MESSAGE This is not a valid makefile. To build this project using NMAKE,
    +!MESSAGE use the Export Makefile command and run
    +!MESSAGE 
    +!MESSAGE NMAKE /f "preaprapp.mak".
    +!MESSAGE 
    +!MESSAGE You can specify a configuration when running NMAKE
    +!MESSAGE by defining the macro CFG on the command line. For example:
    +!MESSAGE 
    +!MESSAGE NMAKE /f "preaprapp.mak" CFG="preaprapp - Win32 Release"
    +!MESSAGE 
    +!MESSAGE Possible choices for configuration are:
    +!MESSAGE 
    +!MESSAGE "preaprapp - Win32 Release" (based on "Win32 (x86) External Target")
    +!MESSAGE "preaprapp - Win32 Debug" (based on "Win32 (x86) External Target")
    +!MESSAGE "preaprapp - Win32 Release9x" (based on "Win32 (x86) External Target")
    +!MESSAGE "preaprapp - Win32 Debug9x" (based on "Win32 (x86) External Target")
    +!MESSAGE "preaprapp - x64 Release" (based on "Win32 (x86) External Target")
    +!MESSAGE "preaprapp - x64 Debug" (based on "Win32 (x86) External Target")
    +!MESSAGE 
    +
    +# Begin Project
    +# PROP AllowPerConfigDependencies 0
    +# PROP Scc_ProjName ""
    +# PROP Scc_LocalPath ""
    +
    +!IF  "$(CFG)" == "preaprapp - Win32 Release"
    +
    +# PROP BASE Use_MFC 0
    +# PROP BASE Use_Debug_Libraries 0
    +# PROP BASE Output_Dir ""
    +# PROP BASE Intermediate_Dir ""
    +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP BASE Rebuild_Opt "/a"
    +# PROP BASE Target_File "preaprapp.exe"
    +# PROP BASE Bsc_Name "preaprapp.bsc"
    +# PROP BASE Target_Dir ""
    +# PROP Use_MFC 0
    +# PROP Use_Debug_Libraries 0
    +# PROP Output_Dir ""
    +# PROP Intermediate_Dir ""
    +# PROP Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP Rebuild_Opt "/a"
    +# PROP Bsc_Name ""
    +# PROP Target_Dir ""
    +
    +!ELSEIF  "$(CFG)" == "preaprapp - Win32 Debug"
    +
    +# PROP BASE Use_MFC 0
    +# PROP BASE Use_Debug_Libraries 1
    +# PROP BASE Output_Dir ""
    +# PROP BASE Intermediate_Dir ""
    +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP BASE Rebuild_Opt "/a"
    +# PROP BASE Target_File "preaprapp.exe"
    +# PROP BASE Bsc_Name "preaprapp.bsc"
    +# PROP BASE Target_Dir ""
    +# PROP Use_MFC 0
    +# PROP Use_Debug_Libraries 1
    +# PROP Output_Dir ""
    +# PROP Intermediate_Dir ""
    +# PROP Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP Rebuild_Opt "/a"
    +# PROP Bsc_Name ""
    +# PROP Target_Dir ""
    +
    +!ELSEIF  "$(CFG)" == "preaprapp - Win32 Release9x"
    +
    +# PROP BASE Use_MFC 0
    +# PROP BASE Use_Debug_Libraries 0
    +# PROP BASE Output_Dir ""
    +# PROP BASE Intermediate_Dir ""
    +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP BASE Rebuild_Opt "/a"
    +# PROP BASE Target_File "preaprapp.exe"
    +# PROP BASE Bsc_Name "preaprapp.bsc"
    +# PROP BASE Target_Dir ""
    +# PROP Use_MFC 0
    +# PROP Use_Debug_Libraries 0
    +# PROP Output_Dir ""
    +# PROP Intermediate_Dir ""
    +# PROP Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP Rebuild_Opt "/a"
    +# PROP Bsc_Name ""
    +# PROP Target_Dir ""
    +
    +!ELSEIF  "$(CFG)" == "preaprapp - Win32 Debug9x"
    +
    +# PROP BASE Use_MFC 0
    +# PROP BASE Use_Debug_Libraries 1
    +# PROP BASE Output_Dir ""
    +# PROP BASE Intermediate_Dir ""
    +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP BASE Rebuild_Opt "/a"
    +# PROP BASE Target_File "preaprapp.exe"
    +# PROP BASE Bsc_Name "preaprapp.bsc"
    +# PROP BASE Target_Dir ""
    +# PROP Use_MFC 0
    +# PROP Use_Debug_Libraries 1
    +# PROP Output_Dir ""
    +# PROP Intermediate_Dir ""
    +# PROP Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP Rebuild_Opt "/a"
    +# PROP Bsc_Name ""
    +# PROP Target_Dir ""
    +
    +!ELSEIF  "$(CFG)" == "preaprapp - x64 Release"
    +
    +# PROP BASE Use_MFC 0
    +# PROP BASE Use_Debug_Libraries 0
    +# PROP BASE Output_Dir ""
    +# PROP BASE Intermediate_Dir ""
    +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP BASE Rebuild_Opt "/a"
    +# PROP BASE Target_File "preaprapp.exe"
    +# PROP BASE Bsc_Name "preaprapp.bsc"
    +# PROP BASE Target_Dir ""
    +# PROP Use_MFC 0
    +# PROP Use_Debug_Libraries 0
    +# PROP Output_Dir ""
    +# PROP Intermediate_Dir ""
    +# PROP Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP Rebuild_Opt "/a"
    +# PROP Bsc_Name ""
    +# PROP Target_Dir ""
    +
    +!ELSEIF  "$(CFG)" == "preaprapp - x64 Debug"
    +
    +# PROP BASE Use_MFC 0
    +# PROP BASE Use_Debug_Libraries 1
    +# PROP BASE Output_Dir ""
    +# PROP BASE Intermediate_Dir ""
    +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP BASE Rebuild_Opt "/a"
    +# PROP BASE Target_File "preaprapp.exe"
    +# PROP BASE Bsc_Name "preaprapp.bsc"
    +# PROP BASE Target_Dir ""
    +# PROP Use_MFC 0
    +# PROP Use_Debug_Libraries 1
    +# PROP Output_Dir ""
    +# PROP Intermediate_Dir ""
    +# PROP Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP Rebuild_Opt "/a"
    +# PROP Bsc_Name ""
    +# PROP Target_Dir ""
    +
    +!ENDIF 
    +
    +# Begin Target
    +
    +# Name "preaprapp - Win32 Release"
    +# Name "preaprapp - Win32 Debug"
    +# Name "preaprapp - Win32 Release9x"
    +# Name "preaprapp - Win32 Debug9x"
    +# Name "preaprapp - x64 Release"
    +# Name "preaprapp - x64 Debug"
    +
    +!IF  "$(CFG)" == "preaprapp - Win32 Release"
    +
    +!ELSEIF  "$(CFG)" == "preaprapp - Win32 Debug"
    +
    +!ELSEIF  "$(CFG)" == "preaprapp - Win32 Release9x"
    +
    +!ELSEIF  "$(CFG)" == "preaprapp - Win32 Debug9x"
    +
    +!ELSEIF  "$(CFG)" == "preaprapp - x64 Release"
    +
    +!ELSEIF  "$(CFG)" == "preaprapp - x64 Debug"
    +
    +!ENDIF 
    +
    +# End Target
    +# End Project
    diff --git a/build/prelibaprapp.dsp b/build/prelibaprapp.dsp
    new file mode 100644
    index 00000000000..3654a7fbb29
    --- /dev/null
    +++ b/build/prelibaprapp.dsp
    @@ -0,0 +1,179 @@
    +# Microsoft Developer Studio Project File - Name="prelibaprapp" - Package Owner=<4>
    +# Microsoft Developer Studio Generated Build File, Format Version 6.00
    +# ** DO NOT EDIT **
    +
    +# TARGTYPE "Win32 (x86) External Target" 0x0106
    +
    +CFG=prelibaprapp - Win32 Release
    +!MESSAGE This is not a valid makefile. To build this project using NMAKE,
    +!MESSAGE use the Export Makefile command and run
    +!MESSAGE 
    +!MESSAGE NMAKE /f "prelibaprapp.mak".
    +!MESSAGE 
    +!MESSAGE You can specify a configuration when running NMAKE
    +!MESSAGE by defining the macro CFG on the command line. For example:
    +!MESSAGE 
    +!MESSAGE NMAKE /f "prelibaprapp.mak" CFG="prelibaprapp - Win32 Release"
    +!MESSAGE 
    +!MESSAGE Possible choices for configuration are:
    +!MESSAGE 
    +!MESSAGE "prelibaprapp - Win32 Release" (based on "Win32 (x86) External Target")
    +!MESSAGE "prelibaprapp - Win32 Debug" (based on "Win32 (x86) External Target")
    +!MESSAGE "prelibaprapp - Win32 Release9x" (based on "Win32 (x86) External Target")
    +!MESSAGE "prelibaprapp - Win32 Debug9x" (based on "Win32 (x86) External Target")
    +!MESSAGE "prelibaprapp - x64 Release" (based on "Win32 (x86) External Target")
    +!MESSAGE "prelibaprapp - x64 Debug" (based on "Win32 (x86) External Target")
    +!MESSAGE 
    +
    +# Begin Project
    +# PROP AllowPerConfigDependencies 0
    +# PROP Scc_ProjName ""
    +# PROP Scc_LocalPath ""
    +
    +!IF  "$(CFG)" == "prelibaprapp - Win32 Release"
    +
    +# PROP BASE Use_MFC 0
    +# PROP BASE Use_Debug_Libraries 0
    +# PROP BASE Output_Dir ""
    +# PROP BASE Intermediate_Dir ""
    +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP BASE Rebuild_Opt "/a"
    +# PROP BASE Target_File "prelibaprapp.exe"
    +# PROP BASE Bsc_Name "prelibaprapp.bsc"
    +# PROP BASE Target_Dir ""
    +# PROP Use_MFC 0
    +# PROP Use_Debug_Libraries 0
    +# PROP Output_Dir ""
    +# PROP Intermediate_Dir ""
    +# PROP Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP Rebuild_Opt "/a"
    +# PROP Bsc_Name ""
    +# PROP Target_Dir ""
    +
    +!ELSEIF  "$(CFG)" == "prelibaprapp - Win32 Debug"
    +
    +# PROP BASE Use_MFC 0
    +# PROP BASE Use_Debug_Libraries 1
    +# PROP BASE Output_Dir ""
    +# PROP BASE Intermediate_Dir ""
    +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP BASE Rebuild_Opt "/a"
    +# PROP BASE Target_File "prelibaprapp.exe"
    +# PROP BASE Bsc_Name "prelibaprapp.bsc"
    +# PROP BASE Target_Dir ""
    +# PROP Use_MFC 0
    +# PROP Use_Debug_Libraries 1
    +# PROP Output_Dir ""
    +# PROP Intermediate_Dir ""
    +# PROP Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP Rebuild_Opt "/a"
    +# PROP Bsc_Name ""
    +# PROP Target_Dir ""
    +
    +!ELSEIF  "$(CFG)" == "prelibaprapp - Win32 Release9x"
    +
    +# PROP BASE Use_MFC 0
    +# PROP BASE Use_Debug_Libraries 0
    +# PROP BASE Output_Dir ""
    +# PROP BASE Intermediate_Dir ""
    +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP BASE Rebuild_Opt "/a"
    +# PROP BASE Target_File "prelibaprapp.exe"
    +# PROP BASE Bsc_Name "prelibaprapp.bsc"
    +# PROP BASE Target_Dir ""
    +# PROP Use_MFC 0
    +# PROP Use_Debug_Libraries 0
    +# PROP Output_Dir ""
    +# PROP Intermediate_Dir ""
    +# PROP Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP Rebuild_Opt "/a"
    +# PROP Bsc_Name ""
    +# PROP Target_Dir ""
    +
    +!ELSEIF  "$(CFG)" == "prelibaprapp - Win32 Debug9x"
    +
    +# PROP BASE Use_MFC 0
    +# PROP BASE Use_Debug_Libraries 1
    +# PROP BASE Output_Dir ""
    +# PROP BASE Intermediate_Dir ""
    +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP BASE Rebuild_Opt "/a"
    +# PROP BASE Target_File "prelibaprapp.exe"
    +# PROP BASE Bsc_Name "prelibaprapp.bsc"
    +# PROP BASE Target_Dir ""
    +# PROP Use_MFC 0
    +# PROP Use_Debug_Libraries 1
    +# PROP Output_Dir ""
    +# PROP Intermediate_Dir ""
    +# PROP Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP Rebuild_Opt "/a"
    +# PROP Bsc_Name ""
    +# PROP Target_Dir ""
    +
    +!ELSEIF  "$(CFG)" == "prelibaprapp - x64 Release"
    +
    +# PROP BASE Use_MFC 0
    +# PROP BASE Use_Debug_Libraries 0
    +# PROP BASE Output_Dir ""
    +# PROP BASE Intermediate_Dir ""
    +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP BASE Rebuild_Opt "/a"
    +# PROP BASE Target_File "prelibaprapp.exe"
    +# PROP BASE Bsc_Name "prelibaprapp.bsc"
    +# PROP BASE Target_Dir ""
    +# PROP Use_MFC 0
    +# PROP Use_Debug_Libraries 0
    +# PROP Output_Dir ""
    +# PROP Intermediate_Dir ""
    +# PROP Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP Rebuild_Opt "/a"
    +# PROP Bsc_Name ""
    +# PROP Target_Dir ""
    +
    +!ELSEIF  "$(CFG)" == "prelibaprapp - x64 Debug"
    +
    +# PROP BASE Use_MFC 0
    +# PROP BASE Use_Debug_Libraries 1
    +# PROP BASE Output_Dir ""
    +# PROP BASE Intermediate_Dir ""
    +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP BASE Rebuild_Opt "/a"
    +# PROP BASE Target_File "prelibaprapp.exe"
    +# PROP BASE Bsc_Name "prelibaprapp.bsc"
    +# PROP BASE Target_Dir ""
    +# PROP Use_MFC 0
    +# PROP Use_Debug_Libraries 1
    +# PROP Output_Dir ""
    +# PROP Intermediate_Dir ""
    +# PROP Cmd_Line "NMAKE /nologo /f NUL"
    +# PROP Rebuild_Opt "/a"
    +# PROP Bsc_Name ""
    +# PROP Target_Dir ""
    +
    +!ENDIF 
    +
    +# Begin Target
    +
    +# Name "prelibaprapp - Win32 Release"
    +# Name "prelibaprapp - Win32 Debug"
    +# Name "prelibaprapp - Win32 Release9x"
    +# Name "prelibaprapp - Win32 Debug9x"
    +# Name "prelibaprapp - x64 Release"
    +# Name "prelibaprapp - x64 Debug"
    +
    +!IF  "$(CFG)" == "prelibaprapp - Win32 Release"
    +
    +!ELSEIF  "$(CFG)" == "prelibaprapp - Win32 Debug"
    +
    +!ELSEIF  "$(CFG)" == "prelibaprapp - Win32 Release9x"
    +
    +!ELSEIF  "$(CFG)" == "prelibaprapp - Win32 Debug9x"
    +
    +!ELSEIF  "$(CFG)" == "prelibaprapp - x64 Release"
    +
    +!ELSEIF  "$(CFG)" == "prelibaprapp - x64 Debug"
    +
    +!ENDIF 
    +
    +# End Target
    +# End Project
    diff --git a/test/Makefile.win b/test/Makefile.win
    index db88659e326..4d194ae71bd 100644
    --- a/test/Makefile.win
    +++ b/test/Makefile.win
    @@ -109,11 +109,11 @@ LD = link.exe
     
     !IF "$(MODEL)" == "static"
     LOCAL_LIB= ..\$(OUTDIR)\apr-1.lib 
    -APP_LIB= ..\build\$(OUTDIR)\apr_app-1.lib 
    +APP_LIB= ..\$(OUTDIR)\aprapp-1.lib 
     STATIC_CFLAGS = /D APR_DECLARE_STATIC
     !ELSE
     LOCAL_LIB= ..\$(OUTDIR)\libapr-1.lib 
    -APP_LIB= ..\build\$(OUTDIR)\libapr_app-1.lib 
    +APP_LIB= ..\$(OUTDIR)\libaprapp-1.lib 
     STATIC_CFLAGS = 
     !ENDIF
     
    
    From 433f72fb39e14ccb653e743d09292b13990c9bbc Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 18 Oct 2007 05:32:56 +0000
    Subject: [PATCH 6037/7878] Save the user a step by providing the entry point
     to the linker, and clear up some comments
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585872 13f79535-47bb-0310-9956-ffa450edef68
    ---
     misc/win32/apr_app.c | 17 +++++++++--------
     1 file changed, 9 insertions(+), 8 deletions(-)
    
    diff --git a/misc/win32/apr_app.c b/misc/win32/apr_app.c
    index 77390859715..4e08e33d756 100644
    --- a/misc/win32/apr_app.c
    +++ b/misc/win32/apr_app.c
    @@ -16,18 +16,20 @@
     
     /* Usage Notes:
      *
    - *   this module, and the misc/win32/utf8.c modules must be 
    + *   this module, and the misc/win32/utf8.c modules must be
      *   compiled APR_EXPORT_STATIC and linked to an application with
    - *   the /entry:wmainCRTStartup flag.  This module becomes the true
    - *   wmain entry point, and passes utf-8 reformatted argv and env
    - *   arrays to the application's main function.
    + *   the /entry:wmainCRTStartup flag (which this module kindly
    + *   provides to the developer who links to libaprapp-1.lib).
    + *   This module becomes the true wmain entry point, and passes
    + *   utf-8 reformatted argv and env arrays to the application's
    + *   main() function as if nothing happened.
      *
    - *   This module is only compatible with Unicode-only executables.
    + *   This module is only compatible with Unicode operating systems.
      *   Mixed (Win9x backwards compatible) binaries should refer instead
      *   to the apr_startup.c module.
      *
      *   _dbg_malloc/realloc is used in place of the usual API, in order
    - *   to convince the MSVCRT that they created these entities.  If we
    + *   to convince the MSVCRT that it created these entities.  If we
      *   do not create them as _CRT_BLOCK entities, the crt will fault
      *   on an assert.  We are not worrying about the crt's locks here, 
      *   since we are single threaded [so far].
    @@ -41,8 +43,7 @@
     #include "apr_private.h"
     #include "apr_arch_misc.h"
     
    -/* This symbol is _private_, although it must be exported.
    - */
    +#pragma comment(linker,"/ENTRY:wmainCRTStartup")
     
     extern int main(int argc, const char **argv, const char **env);
     
    
    From bab738d70be17779663aac153d5e9c8937663618 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 18 Oct 2007 05:34:21 +0000
    Subject: [PATCH 6038/7878] Missed the pre-aprapp bindings for test gui-builds
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585873 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testall.dsw | 40 +++++++++++++++++++++++++++++++++++-----
     1 file changed, 35 insertions(+), 5 deletions(-)
    
    diff --git a/test/testall.dsw b/test/testall.dsw
    index f9abcbc5244..c56452a0a89 100644
    --- a/test/testall.dsw
    +++ b/test/testall.dsw
    @@ -15,7 +15,7 @@ Package=<4>
     
     ###############################################################################
     
    -Project: "apr_app"="..\build\apr_app.dsp" - Package Owner=<4>
    +Project: "aprapp"="..\build\aprapp.dsp" - Package Owner=<4>
     
     Package=<5>
     {{{
    @@ -24,7 +24,7 @@ Package=<5>
     Package=<4>
     {{{
         Begin Project Dependency
    -    Project_Dep_Name apr
    +    Project_Dep_Name preaprapp
         End Project Dependency
     }}}
     
    @@ -42,7 +42,37 @@ Package=<4>
     
     ###############################################################################
     
    -Project: "libapr_app"="..\build\libapr_app.dsp" - Package Owner=<4>
    +Project: "libaprapp"="..\build\libaprapp.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +    Begin Project Dependency
    +    Project_Dep_Name prelibaprapp
    +    End Project Dependency
    +}}}
    +
    +###############################################################################
    +
    +Project: "preaprapp"="..\build\preaprapp.dsp" - Package Owner=<4>
    +
    +Package=<5>
    +{{{
    +}}}
    +
    +Package=<4>
    +{{{
    +    Begin Project Dependency
    +    Project_Dep_Name apr
    +    End Project Dependency
    +}}}
    +
    +###############################################################################
    +
    +Project: "prelibaprapp"="..\build\prelibaprapp.dsp" - Package Owner=<4>
     
     Package=<5>
     {{{
    @@ -69,7 +99,7 @@ Package=<4>
         Project_Dep_Name libapr
         End Project Dependency
         Begin Project Dependency
    -    Project_Dep_Name libapr_app
    +    Project_Dep_Name libaprapp
         End Project Dependency
     }}}
     
    @@ -87,7 +117,7 @@ Package=<4>
         Project_Dep_Name apr
         End Project Dependency
         Begin Project Dependency
    -    Project_Dep_Name apr_app
    +    Project_Dep_Name aprapp
         End Project Dependency
     }}}
     
    
    From d2b408e2d4fca838329fbdbf9a578c9bababdf2c Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 18 Oct 2007 12:11:46 +0000
    Subject: [PATCH 6039/7878] Implement apr_atomic_casptr() for z/OS.
    
    Submitted by: David Jones 
    Reviewed by:  trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585935 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES               |  3 +++
     atomic/os390/atomic.c | 24 ++++++++++++++++++++++++
     2 files changed, 27 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index 7a16622e652..2b2864c0775 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 1.3.0
     
    +  *) Implement apr_atomic_casptr() for z/OS.
    +     [David Jones ]
    +
       *) Fill in apr_fileinfo_t member st_csize on Netware and Unix (PR 41678),
          and refine the file times down to apr_time_t resolution if supported
          by a st_atimensec or st_atim.tv_nsec value by the OS.  Additional
    diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c
    index 35ddf1c2266..3c57668be63 100644
    --- a/atomic/os390/atomic.c
    +++ b/atomic/os390/atomic.c
    @@ -82,6 +82,30 @@ apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t swap,
         return old; /* old is automatically updated from mem on cs failure */
     }
     
    +#if APR_SIZEOF_VOIDP == 4
    +void *apr_atomic_casptr(volatile void **mem_ptr,
    +                        void *swap_ptr,
    +                        const void *cmp_ptr)
    +{
    +     __cs1(&cmp_ptr,     /* automatically updated from mem on __cs1 failure  */
    +           mem_ptr,      /* set from swap when __cs1 succeeds                */
    +           &swap_ptr);
    +     return (void *)cmp_ptr;
    +}
    +#elif APR_SIZEOF_VOIDP == 8
    +void *apr_atomic_casptr(volatile void **mem_ptr,
    +                        void *swap_ptr,
    +                        const void *cmp_ptr)
    +{
    +     __csg(&cmp_ptr,     /* automatically updated from mem on __csg failure  */
    +           mem_ptr,      /* set from swap when __csg succeeds                */
    +           &swap_ptr);  
    +     return (void *)cmp_ptr;
    +}
    +#else
    +#error APR_SIZEOF_VOIDP value not supported
    +#endif /* APR_SIZEOF_VOIDP */
    +
     apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val)
     {
         apr_uint32_t old, new_val; 
    
    From 88616429b365e080bd3f4b586b17d33414d2a75b Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 19 Oct 2007 01:36:28 +0000
    Subject: [PATCH 6040/7878] Reordering, put TESTS front and center
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@586208 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in | 26 ++++++++++++++------------
     1 file changed, 14 insertions(+), 12 deletions(-)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index 99080815c87..69fba6545df 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -4,6 +4,8 @@ VPATH = @srcdir@
     # PROGRAMS includes all test programs built on this platform.
     # STDTEST_PORTABLE
     #   test programs invoked via standard user interface, run on all platforms
    +# TESTS
    +#   test modules invoked through the abts suite (./testall)
     # STDTEST_NONPORTABLE
     #   test programs invoked via standard user interface, not portable
     # OTHER_PROGRAMS
    @@ -15,6 +17,16 @@ STDTEST_PORTABLE = \
     	testmutexscope@EXEEXT@ \
     	testall@EXEEXT@
     
    +TESTS = testtime.lo teststr.lo testvsn.lo testipsub.lo testshm.lo \
    +	testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \
    +	testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \
    +	testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \
    +	testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \
    +	testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \
    +	testenv.lo testprocmutex.lo testfnmatch.lo testatomic.lo testflock.lo \
    +	testsock.lo testglobalmutex.lo teststrnatcmp.lo testfilecopy.lo \
    +	testtemp.lo testlfs.lo testcond.lo
    +
     OTHER_PROGRAMS = \
     	sendfile@EXEEXT@ \
     	echod@EXEEXT@ \
    @@ -32,8 +44,8 @@ TESTALL_COMPONENTS = \
     	testshmconsumer@EXEEXT@ \
     	tryread@EXEEXT@
     
    -
    -PROGRAMS = $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS)
    +PROGRAMS = $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) \
    +	   $(OTHER_PROGRAMS)
     
     TARGETS = $(PROGRAMS)
     
    @@ -124,16 +136,6 @@ echod@EXEEXT@: echod.lo $(LOCAL_LIBS)
     sockperf@EXEEXT@: sockperf.lo $(LOCAL_LIBS)
     	$(LINK_PROG) sockperf.lo $(LOCAL_LIBS) $(ALL_LIBS)
     
    -TESTS = testutil.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \
    -	testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \
    -	testfmt.lo testfile.lo testdir.lo testfileinfo.lo testrand.lo \
    -	testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \
    -	testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \
    -	testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \
    -	testenv.lo testprocmutex.lo testfnmatch.lo testatomic.lo testflock.lo \
    -	testshm.lo testsock.lo testglobalmutex.lo teststrnatcmp.lo testfilecopy.lo \
    -	testtemp.lo testlfs.lo testcond.lo
    -
     testall@EXEEXT@: $(TESTS) abts.lo
     	$(LINK_PROG) $(TESTS) abts.lo $(LOCAL_LIBS) $(ALL_LIBS)
     
    
    From 3f4904111095814fc52b205701e93b43169ffea6 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 19 Oct 2007 01:36:58 +0000
    Subject: [PATCH 6041/7878] Reordering; group into logical (what a concept)
     groups of tests, and axe one that isn't stand-alone anymore.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@586209 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in | 78 +++++++++++++++++++++++++-----------------------
     1 file changed, 41 insertions(+), 37 deletions(-)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index 69fba6545df..8c343572c2c 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -84,60 +84,64 @@ check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)
     	fi; \
     	exit $$teststatus
     
    -occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) occhild.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +# STDTEST_PORTABLE;
     
    -sockchild@EXEEXT@: sockchild.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) sockchild.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +testall@EXEEXT@: $(TESTS) abts.lo testutil.lo $(LOCAL_LIBS)
    +	$(LINK_PROG) $? $(ALL_LIBS)
     
    -readchild@EXEEXT@: readchild.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) readchild.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS)
    +	$(LINK_PROG) $? $(ALL_LIBS)
     
    -globalmutexchild@EXEEXT@: globalmutexchild.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) globalmutexchild.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS)
    +	$(LINK_PROG) $? $(ALL_LIBS)
     
    -tryread@EXEEXT@: tryread.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) tryread.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +# OTHER_PROGRAMS;
     
    -proc_child@EXEEXT@: proc_child.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) proc_child.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +echod@EXEEXT@: echod.lo $(LOCAL_LIBS)
    +	$(LINK_PROG) $? $(ALL_LIBS)
     
    -# FIXME: -prefer-pic is only supported with libtool-1.4+
    -mod_test.slo: $(srcdir)/mod_test.c
    -	$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -prefer-pic -c $(srcdir)/mod_test.c && touch $@
    +sendfile@EXEEXT@: sendfile.lo $(LOCAL_LIBS)
    +	$(LINK_PROG) $? $(LOCAL_LIBS) $(ALL_LIBS)
     
    -mod_test.la: mod_test.slo $(LOCAL_LIBS)
    -	$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@
    +sockperf@EXEEXT@: sockperf.lo $(LOCAL_LIBS)
    +	$(LINK_PROG) $? $(ALL_LIBS)
     
    -libmod_test.la: mod_test.slo $(LOCAL_LIBS)
    -	$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $(LOCAL_LIBS) $(ALL_LIBS)
    +# TESTALL_COMPONENTS;
     
    -testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) testlockperf.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +globalmutexchild@EXEEXT@: globalmutexchild.lo $(LOCAL_LIBS)
    +	$(LINK_PROG) $? $(ALL_LIBS)
     
    -sendfile@EXEEXT@: sendfile.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) sendfile.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +# Note -prefer-pic is only supported with libtool-1.4+
    +mod_test.lo: $(srcdir)/mod_test.c
    +	$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -prefer-pic -c $?
     
    -testshmproducer@EXEEXT@: testshmproducer.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) testshmproducer.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +mod_test.la: mod_test.lo $(LOCAL_LIBS)
    +	$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -module \
    +	  -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $? $(ALL_LIBS)
     
    -testshmconsumer@EXEEXT@: testshmconsumer.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) testshmconsumer.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +libmod_test.la: mod_test.lo $(LOCAL_LIBS)
    +	$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` \
    +	  -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $? $(ALL_LIBS)
     
    -testprocmutex@EXEEXT@: testprocmutex.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) testprocmutex.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS)
    +	$(LINK_PROG) $? $(ALL_LIBS)
     
    -testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +proc_child@EXEEXT@: proc_child.lo $(LOCAL_LIBS)
    +	$(LINK_PROG) $? $(ALL_LIBS)
     
    -echod@EXEEXT@: echod.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) echod.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +readchild@EXEEXT@: readchild.lo $(LOCAL_LIBS)
    +	$(LINK_PROG) $? $(ALL_LIBS)
     
    -sockperf@EXEEXT@: sockperf.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) sockperf.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +sockchild@EXEEXT@: sockchild.lo $(LOCAL_LIBS)
    +	$(LINK_PROG) $? $(ALL_LIBS)
    +
    +testshmconsumer@EXEEXT@: testshmconsumer.lo $(LOCAL_LIBS)
    +	$(LINK_PROG) $? $(ALL_LIBS)
     
    -testall@EXEEXT@: $(TESTS) abts.lo
    -	$(LINK_PROG) $(TESTS) abts.lo $(LOCAL_LIBS) $(ALL_LIBS)
    +testshmproducer@EXEEXT@: testshmproducer.lo $(LOCAL_LIBS)
    +	$(LINK_PROG) $? $(ALL_LIBS)
     
    +tryread@EXEEXT@: tryread.lo $(LOCAL_LIBS)
    +	$(LINK_PROG) $? $(ALL_LIBS)
     
     # DO NOT REMOVE
    
    From 6d3a20c4558e3624255aeb87a153e0f9f69e837f Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 19 Oct 2007 02:10:06 +0000
    Subject: [PATCH 6042/7878] ./testall and ./data/, like peanut butter and
     jelly.  Am I right or what?
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@586226 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index 8c343572c2c..951c11ff52b 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -88,6 +88,9 @@ check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)
     
     testall@EXEEXT@: $(TESTS) abts.lo testutil.lo $(LOCAL_LIBS)
     	$(LINK_PROG) $? $(ALL_LIBS)
    +# For VPATH builds; where we have no ./data, copy us some data
    +# if we wait until 'make check', then 'make; ./testall' fails;
    +	if test ! -d "./data"; then cp -r $(srcdir)/data data; fi
     
     testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS)
     	$(LINK_PROG) $? $(ALL_LIBS)
    
    From 89da0f922de535583411937bc2fe80b1b3789051 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 19 Oct 2007 02:20:04 +0000
    Subject: [PATCH 6043/7878] In my recent commit (586209) I demonstrated that we
     were much too wordy in this make file, but I choose a suboptimal automatic
     pattern.  In this case, we want $+ to spew out all the obj's and
     dependency-checked lib's.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@586229 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in | 34 +++++++++++++++++-----------------
     1 file changed, 17 insertions(+), 17 deletions(-)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index 951c11ff52b..0c12ca0b843 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -87,64 +87,64 @@ check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)
     # STDTEST_PORTABLE;
     
     testall@EXEEXT@: $(TESTS) abts.lo testutil.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $? $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(ALL_LIBS)
     # For VPATH builds; where we have no ./data, copy us some data
     # if we wait until 'make check', then 'make; ./testall' fails;
     	if test ! -d "./data"; then cp -r $(srcdir)/data data; fi
     
     testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $? $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(ALL_LIBS)
     
     testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $? $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(ALL_LIBS)
     
     # OTHER_PROGRAMS;
     
     echod@EXEEXT@: echod.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $? $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(ALL_LIBS)
     
     sendfile@EXEEXT@: sendfile.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $? $(LOCAL_LIBS) $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(LOCAL_LIBS) $(ALL_LIBS)
     
     sockperf@EXEEXT@: sockperf.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $? $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(ALL_LIBS)
     
     # TESTALL_COMPONENTS;
     
     globalmutexchild@EXEEXT@: globalmutexchild.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $? $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(ALL_LIBS)
     
     # Note -prefer-pic is only supported with libtool-1.4+
     mod_test.lo: $(srcdir)/mod_test.c
    -	$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -prefer-pic -c $?
    +	$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -prefer-pic -o $@ -c $<
     
     mod_test.la: mod_test.lo $(LOCAL_LIBS)
     	$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -module \
    -	  -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $? $(ALL_LIBS)
    +	  -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $+ $(ALL_LIBS)
     
     libmod_test.la: mod_test.lo $(LOCAL_LIBS)
     	$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` \
    -	  -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $? $(ALL_LIBS)
    +	  -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $+ $(ALL_LIBS)
     
     occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $? $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(ALL_LIBS)
     
     proc_child@EXEEXT@: proc_child.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $? $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(ALL_LIBS)
     
     readchild@EXEEXT@: readchild.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $? $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(ALL_LIBS)
     
     sockchild@EXEEXT@: sockchild.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $? $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(ALL_LIBS)
     
     testshmconsumer@EXEEXT@: testshmconsumer.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $? $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(ALL_LIBS)
     
     testshmproducer@EXEEXT@: testshmproducer.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $? $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(ALL_LIBS)
     
     tryread@EXEEXT@: tryread.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $? $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(ALL_LIBS)
     
     # DO NOT REMOVE
    
    From 887294bc63d82629edffd24e2bd03178f4b01ca2 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 19 Oct 2007 02:21:19 +0000
    Subject: [PATCH 6044/7878] Push check: to the end where it's easy to find, and
     roughly matches the required precidence.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@586230 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in | 32 ++++++++++++++++----------------
     1 file changed, 16 insertions(+), 16 deletions(-)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index 0c12ca0b843..903449c1622 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -68,22 +68,6 @@ INCLUDES=-I$(INCDIR) -I$(srcdir)/../include
     # libtool wrapper scripts which link an executable when first run.
     LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@
     
    -check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)
    -	teststatus=0; \
    -	progfailed=""; \
    -	for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \
    -		./$$prog; \
    -		status=$$?; \
    -		if test $$status != 0; then \
    -			teststatus=$$status; \
    -			progfailed="$$progfailed $$prog"; \
    -		fi; \
    -	done; \
    -	if test $$teststatus != 0; then \
    -		echo "Programs failed:$$progfailed"; \
    -	fi; \
    -	exit $$teststatus
    -
     # STDTEST_PORTABLE;
     
     testall@EXEEXT@: $(TESTS) abts.lo testutil.lo $(LOCAL_LIBS)
    @@ -147,4 +131,20 @@ testshmproducer@EXEEXT@: testshmproducer.lo $(LOCAL_LIBS)
     tryread@EXEEXT@: tryread.lo $(LOCAL_LIBS)
     	$(LINK_PROG) $+ $(ALL_LIBS)
     
    +check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)
    +	teststatus=0; \
    +	progfailed=""; \
    +	for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \
    +		./$$prog; \
    +		status=$$?; \
    +		if test $$status != 0; then \
    +			teststatus=$$status; \
    +			progfailed="$$progfailed $$prog"; \
    +		fi; \
    +	done; \
    +	if test $$teststatus != 0; then \
    +		echo "Programs failed:$$progfailed"; \
    +	fi; \
    +	exit $$teststatus
    +
     # DO NOT REMOVE
    
    From 3de7a996b61b93e319c2c5028ec47a47051867df Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 19 Oct 2007 02:33:25 +0000
    Subject: [PATCH 6045/7878] Clean up the last overflow lines, and toss in some
     dependencies for abts/testutil, because I HATE BEING IGNORED when I change up
     the tests.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@586234 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in | 9 ++++++++-
     1 file changed, 8 insertions(+), 1 deletion(-)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index 903449c1622..a9f4569353a 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -66,10 +66,17 @@ INCLUDES=-I$(INCDIR) -I$(srcdir)/../include
     
     # link programs using -no-install to get real executables not
     # libtool wrapper scripts which link an executable when first run.
    -LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@
    +LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE)\
    +	    @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@
     
     # STDTEST_PORTABLE;
     
    +abts.lo: $(srcdir)/abts.c $(srcdir)/abts.h $(srcdir)/abts_tests.h \
    +	 $(srcdir)/testutil.h
    +
    +testutil.lo: $(srcdir)/abts.c $(srcdir)/abts.h $(srcdir)/abts_tests.h \
    +	     $(srcdir)/testutil.h
    +
     testall@EXEEXT@: $(TESTS) abts.lo testutil.lo $(LOCAL_LIBS)
     	$(LINK_PROG) $+ $(ALL_LIBS)
     # For VPATH builds; where we have no ./data, copy us some data
    
    From 46488bd182e2014e0966140ae5fdca0191c29330 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 19 Oct 2007 22:11:13 +0000
    Subject: [PATCH 6046/7878] Avoid a truncation emit, keep the math size_t big.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@586627 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/sockperf.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/sockperf.c b/test/sockperf.c
    index d157bd7e645..b424223322c 100644
    --- a/test/sockperf.c
    +++ b/test/sockperf.c
    @@ -220,7 +220,7 @@ int main(int argc, char **argv)
     
         for(i = 0; i < nTests; i++) {
             printf("Test -> %c\n", testRuns[i].c);
    -        results[i].size = testRuns[i].size * TEST_SIZE;
    +        results[i].size = testRuns[i].size * (apr_size_t)TEST_SIZE;
             rv = runTest(&testRuns[i], &results[i], pool);
         }
     
    
    From 36b6b5993a526f2cd44dac9f7f1418592000cbab Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 22 Oct 2007 11:08:52 +0000
    Subject: [PATCH 6047/7878] implement apr_atomic_xchgptr() for z/OS
    
    Submitted by: David Jones 
    reviewed by: trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@587057 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES               |  2 +-
     atomic/os390/atomic.c | 17 +++++++++++++++++
     2 files changed, 18 insertions(+), 1 deletion(-)
    
    diff --git a/CHANGES b/CHANGES
    index 2b2864c0775..d97705c6c6a 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,7 +1,7 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 1.3.0
     
    -  *) Implement apr_atomic_casptr() for z/OS.
    +  *) Implement apr_atomic_casptr() and apr_atomic_xchgptr() for z/OS.
          [David Jones ]
     
       *) Fill in apr_fileinfo_t member st_csize on Netware and Unix (PR 41678),
    diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c
    index 3c57668be63..1d44ca3d1a3 100644
    --- a/atomic/os390/atomic.c
    +++ b/atomic/os390/atomic.c
    @@ -118,3 +118,20 @@ apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val)
         return old;
     }
     
    +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem_ptr, void *new_ptr)
    +{
    +    void *old_ptr;
    +
    +    old_ptr = *(void **)mem_ptr; /* old is automatically updated on cs failure */
    +#if APR_SIZEOF_VOIDP == 4
    +    do {
    +    } while (__cs1(&old_ptr, mem_ptr, &new_ptr)); 
    +#elif APR_SIZEOF_VOIDP == 8
    +    do { 
    +    } while (__csg(&old_ptr, mem_ptr, &new_ptr)); 
    +#else
    +#error APR_SIZEOF_VOIDP value not supported
    +#endif /* APR_SIZEOF_VOIDP */
    +
    +    return old_ptr;
    +}
    
    From d28c47d33e0cd19119c8b40c7bb51e574a408bc2 Mon Sep 17 00:00:00 2001
    From: Guenter Knauf 
    Date: Mon, 22 Oct 2007 20:26:50 +0000
    Subject: [PATCH 6048/7878] Added apu_config.hnw (fix for r586260).
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@587238 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/NWGNUmakefile | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile
    index abfbda7723f..79720ed58c5 100644
    --- a/build/NWGNUmakefile
    +++ b/build/NWGNUmakefile
    @@ -61,7 +61,7 @@ $(APRUTIL)/include/%.h: $(subst /,\,$(APRUTIL))\include\%.hnw
     	@echo Creating $(subst /,\,$@)
     	copy $< $(subst /,\,$(APRUTIL))\include\$(@F)
     
    -$(APRUTIL)/include/private/%.h: $(subst /,\,$(APRUTIL))\include\private\%.hw
    +$(APRUTIL)/include/private/%.h: $(subst /,\,$(APRUTIL))\include\private\%.hnw
     	@echo Creating $(subst /,\,$@)
     	copy $< $(subst /,\,$(APRUTIL))\include\private\$(@F)
     
    
    From 26f13f2e62a29c10911b7b005d38fe386bf1e5ca Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 23 Oct 2007 18:33:15 +0000
    Subject: [PATCH 6049/7878] Match win32's volatility declaration (except for
     mingw)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@587593 13f79535-47bb-0310-9956-ffa450edef68
    ---
     atomic/win32/apr_atomic.c | 4 +++-
     1 file changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c
    index 16e10ec298a..d1b4e7e34f2 100644
    --- a/atomic/win32/apr_atomic.c
    +++ b/atomic/win32/apr_atomic.c
    @@ -120,7 +120,9 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3
     
     APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp)
     {
    -#if (defined(_M_IA64) || defined(_M_AMD64) || defined(__MINGW32__)) && !defined(RC_INVOKED)
    +#if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED)
    +    return InterlockedCompareExchangePointer((void* volatile*)mem, with, (void*)cmp);
    +#elseif defined(__MINGW32__)
         return InterlockedCompareExchangePointer((void**)mem, with, (void*)cmp);
     #else
         /* Too many VC6 users have stale win32 API files, stub this */
    
    From 067a8d18638c369ee8a16247a8d291390433267e Mon Sep 17 00:00:00 2001
    From: Bradley Nicholes 
    Date: Tue, 23 Oct 2007 23:27:15 +0000
    Subject: [PATCH 6050/7878] Allow the dependent .hw files in the
     include/private directory to be processed as well.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@587694 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/NWGNUmakefile | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile
    index 79720ed58c5..43d28e836fc 100644
    --- a/build/NWGNUmakefile
    +++ b/build/NWGNUmakefile
    @@ -65,6 +65,10 @@ $(APRUTIL)/include/private/%.h: $(subst /,\,$(APRUTIL))\include\private\%.hnw
     	@echo Creating $(subst /,\,$@)
     	copy $< $(subst /,\,$(APRUTIL))\include\private\$(@F)
     
    +$(APRUTIL)/include/private/%.h: $(subst /,\,$(APRUTIL))\include\private\%.hw
    +	@echo Creating $(subst /,\,$@)
    +	copy $< $(subst /,\,$(APRUTIL))\include\private\$(@F)
    +
     $(APRUTIL)/xml/expat/lib/%.h: $(subst /,\,$(APRUTIL))\xml\expat\lib\%.hnw
     	@echo Creating $(subst /,\,$@)
     	copy $< $(subst /,\,$(APRUTIL))\xml\expat\lib\$(@F)
    
    From 046e91314373b47dd2aa687b957f56dc3a1474f4 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 24 Oct 2007 04:40:33 +0000
    Subject: [PATCH 6051/7878] Define apr_ino_t in such a way that it doesn't
     change definition based on the library consumer's -D'efines to the
     filesystem.
    
    Submitted by: Lucian Adrian Grijincu 
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@587779 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                 | 24 ++++++++++++++----------
     configure.in            |  9 +++++++++
     include/apr.h.in        |  1 +
     include/apr.hnw         |  1 +
     include/apr.hw          |  1 +
     include/apr_file_info.h |  6 ------
     6 files changed, 26 insertions(+), 16 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index d97705c6c6a..f38157558b6 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,18 +1,9 @@
    -                                                     -*- coding: utf-8 -*-
    +                                                     -*- coding: utf-8 -*-
     Changes for APR 1.3.0
     
       *) Implement apr_atomic_casptr() and apr_atomic_xchgptr() for z/OS.
          [David Jones ]
     
    -  *) Fill in apr_fileinfo_t member st_csize on Netware and Unix (PR 41678),
    -     and refine the file times down to apr_time_t resolution if supported
    -     by a st_atimensec or st_atim.tv_nsec value by the OS.  Additional
    -     msec implementations are possible if exposed through autoconf.
    -     [William Rowe, Nicklas Edmundsson ]
    -
    -  *) Fix apr_socket_recvfrom() to ensure the peer's address is returned
    -     through the "from" parameter on Win32.  [William Rowe]
    -
       *) Introduce apr_file_pipe_create_ex() to portably permit one pipe
          end or another to be entirely blocking for non-APR applications
          (e.g. stdio streams) and the other (or both ends) non blocking,
    @@ -181,6 +172,19 @@ Changes for APR 1.3.0
     
     Changes for APR 1.2.12
     
    +  *) Define apr_ino_t in such a way that it doesn't change definition
    +     based on the library consumer's -D'efines to the filesystem.
    +     [Lucian Adrian Grijincu ]
    +
    +  *) Fill in apr_fileinfo_t member st_csize on Netware and Unix (PR 41678),
    +     and refine the file times down to apr_time_t resolution if supported
    +     by a st_atimensec or st_atim.tv_nsec value by the OS.  Additional
    +     msec implementations are possible if exposed through autoconf.
    +     [William Rowe, Nicklas Edmundsson ]
    +
    +  *) Fix apr_socket_recvfrom() to ensure the peer's address is returned
    +     through the "from" parameter on Win32.  [William Rowe]
    +
       *) Cause apr_file_dup2() on Win32 to update the MSVCRT psuedo-stdio
          handles for fd-based and FILE * based I/O.  [William Rowe]
     
    diff --git a/configure.in b/configure.in
    index b7153caaf03..38791a72fc7 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -530,6 +530,14 @@ void main(void)
        if test "$apr_cv_use_lfs64" = "yes"; then
           APR_ADDTO(CPPFLAGS, [-D_LARGEFILE64_SOURCE])
        fi
    +
    +
    +   dnl define apr_ino_t in a manner independent of _FILE_OFFSET_BITS setting
    +   dnl default fallback
    +   ino_t_value=ino_t
    +   APR_CHECK_TYPES_COMPATIBLE(ino_t, unsigned long long, ino_t_value="unsigned long long")
    +   APR_CHECK_TYPES_COMPATIBLE(ino_t, unsigned long, ino_t_value="unsigned long")
    +   APR_CHECK_TYPES_COMPATIBLE(ino_t, unsigned int, ino_t_value="unsigned int")
     fi
     
     AC_ARG_ENABLE(nonportable-atomics,
    @@ -1507,6 +1515,7 @@ AC_SUBST(stdint)
     AC_SUBST(bigendian)
     AC_SUBST(aprlfs)
     AC_SUBST(have_iovec)
    +AC_SUBST(ino_t_value)
     
     dnl ----------------------------- Checking for string functions
     AC_CHECK_FUNCS(strnicmp, have_strnicmp="1", have_strnicmp="0")
    diff --git a/include/apr.h.in b/include/apr.h.in
    index 36b6f72f3e3..4fe958f965a 100644
    --- a/include/apr.h.in
    +++ b/include/apr.h.in
    @@ -283,6 +283,7 @@ typedef  @size_t_value@          apr_size_t;
     typedef  @ssize_t_value@         apr_ssize_t;
     typedef  @off_t_value@           apr_off_t;
     typedef  @socklen_t_value@       apr_socklen_t;
    +typedef  @ino_t_value@           apr_ino_t;
     
     #define APR_SIZEOF_VOIDP @voidp_size@
     
    diff --git a/include/apr.hnw b/include/apr.hnw
    index c793846ec74..743da45df67 100644
    --- a/include/apr.hnw
    +++ b/include/apr.hnw
    @@ -255,6 +255,7 @@ typedef  int               apr_socklen_t;
     #else
     typedef  size_t            apr_socklen_t;
     #endif
    +typedef  apr_uint64_t      apr_ino_t;
     
     /* Are we big endian? */
     /* XXX: Fatal assumption on Alpha platforms */
    diff --git a/include/apr.hw b/include/apr.hw
    index 03434f6bf8a..de46bfa0491 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -345,6 +345,7 @@ typedef  __int64     apr_off_t;
     typedef  int         apr_off_t;
     #endif
     typedef  int         apr_socklen_t;
    +typedef  apr_uint64_t      apr_ino_t;
     
     /* Are we big endian? */
     /* XXX: Fatal assumption on Alpha platforms */
    diff --git a/include/apr_file_info.h b/include/apr_file_info.h
    index 135226bcef7..bbcff8ac0d1 100644
    --- a/include/apr_file_info.h
    +++ b/include/apr_file_info.h
    @@ -124,17 +124,11 @@ typedef struct apr_dir_t          apr_dir_t;
      */
     typedef apr_int32_t               apr_fileperms_t;
     #if (defined WIN32) || (defined NETWARE)
    -/**
    - * Structure for determining the inode of the file.
    - */
    -typedef apr_uint64_t              apr_ino_t;
     /**
      * Structure for determining the device the file is on.
      */
     typedef apr_uint32_t              apr_dev_t;
     #else
    -/** The inode of the file. */
    -typedef ino_t                     apr_ino_t;
     /**
      * Structure for determining the device the file is on.
      */
    
    From 570c6f208e87cd9d0066529571e19a3a3627d4dd Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 24 Oct 2007 22:28:18 +0000
    Subject: [PATCH 6052/7878] Perhaps smaller than long, perhaps larger than
     long, let's let ~ bit flipping work this out for us.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@588061 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr.h.in | 3 +++
     include/apr.hnw  | 2 ++
     include/apr.hw   | 2 ++
     3 files changed, 7 insertions(+)
    
    diff --git a/include/apr.h.in b/include/apr.h.in
    index 4fe958f965a..45619c5ad06 100644
    --- a/include/apr.h.in
    +++ b/include/apr.h.in
    @@ -348,6 +348,9 @@ typedef  @ino_t_value@           apr_ino_t;
     #define APR_UINT64_MAX  APR_UINT64_C(0xffffffffffffffff)
     #endif
     
    +#define APR_SIZE_MAX    (~((apr_size_t)0))
    +
    +
     /* Definitions that APR programs need to work properly. */
     
     /**
    diff --git a/include/apr.hnw b/include/apr.hnw
    index 743da45df67..f04195433a5 100644
    --- a/include/apr.hnw
    +++ b/include/apr.hnw
    @@ -325,6 +325,8 @@ typedef  apr_uint64_t      apr_ino_t;
     #define APR_UINT64_MAX  APR_UINT64_C(0xffffffffffffffff)
     #endif
     
    +#define APR_SIZE_MAX    (~((apr_size_t)0))
    +
     /* PROC mutex is a GLOBAL mutex on Netware */
     #define APR_PROC_MUTEX_IS_GLOBAL      1
     
    diff --git a/include/apr.hw b/include/apr.hw
    index de46bfa0491..8d74319419a 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -430,6 +430,8 @@ typedef  int         gid_t;
     #define APR_UINT64_MAX  APR_UINT64_C(0xffffffffffffffff)
     #endif
     
    +#define APR_SIZE_MAX    (~((apr_size_t)0))
    +
     #if APR_HAVE_IPV6
     
     /* Appears in later flavors, not the originals. */
    
    From b19e5c4de6b85a58d6b65bd9bfb548a3892b4f5d Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 24 Oct 2007 23:25:34 +0000
    Subject: [PATCH 6053/7878] Apparently I'm too wordy, even the compiler agrees.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@588081 13f79535-47bb-0310-9956-ffa450edef68
    ---
     atomic/win32/apr_atomic.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c
    index d1b4e7e34f2..973c679e5ea 100644
    --- a/atomic/win32/apr_atomic.c
    +++ b/atomic/win32/apr_atomic.c
    @@ -122,7 +122,7 @@ APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const voi
     {
     #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED)
         return InterlockedCompareExchangePointer((void* volatile*)mem, with, (void*)cmp);
    -#elseif defined(__MINGW32__)
    +#elif defined(__MINGW32__)
         return InterlockedCompareExchangePointer((void**)mem, with, (void*)cmp);
     #else
         /* Too many VC6 users have stale win32 API files, stub this */
    
    From c3de6809ef505ac5df23b50c227a16418611e9dd Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 25 Oct 2007 04:21:51 +0000
    Subject: [PATCH 6054/7878] First draft guesswork for the final implementation
     of sendfile, this needs further study so it will live on trunk util compared
     with Mac OS/X 10.5
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@588138 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sendrecv.c | 103 +++++++++++++++++++++++++++++++++++++
     1 file changed, 103 insertions(+)
    
    diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c
    index de644bdc7e5..eedf481c15d 100644
    --- a/network_io/unix/sendrecv.c
    +++ b/network_io/unix/sendrecv.c
    @@ -403,6 +403,109 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file,
         return rv < 0 ? errno : APR_SUCCESS;
     }
     
    +#elif defined(DARWIN)
    +
    +/* OS/X Release 10.5 or greater */
    +apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file,
    +                                 apr_hdtr_t * hdtr, apr_off_t * offset,
    +                                 apr_size_t * len, apr_int32_t flags)
    +{
    +    apr_off_t nbytes = *len;
    +    int rv;
    +    struct sf_hdtr headerstruct;
    +
    +    /* Ignore flags for now. */
    +    flags = 0;
    +
    +    if (!hdtr) {
    +        hdtr = &no_hdtr;
    +    }
    +
    +    headerstruct.headers = hdtr->headers;
    +    headerstruct.hdr_cnt = hdtr->numheaders;
    +    headerstruct.trailers = hdtr->trailers;
    +    headerstruct.trl_cnt = hdtr->numtrailers;
    +
    +    /* BSD can send the headers/footers as part of the system call */
    +    do {
    +        if (sock->options & APR_INCOMPLETE_WRITE) {
    +            apr_status_t arv;
    +            sock->options &= ~APR_INCOMPLETE_WRITE;
    +            arv = apr_wait_for_io_or_timeout(NULL, sock, 0);
    +            if (arv != APR_SUCCESS) {
    +                *len = 0;
    +                return arv;
    +            }
    +        }
    +        if (nbytes) {
    +            /* We won't dare call sendfile() if we don't have
    +             * header or file bytes to send because nbytes == 0
    +             * means send the remaining file to EOF.
    +             */
    +            rv = sendfile(file->filedes, /* file to be sent */
    +                          sock->socketdes, /* socket */
    +                          *offset,       /* where in the file to start */
    +                          &nbytes,       /* number of bytes to write/written */
    +                          &headerstruct, /* Headers/footers */
    +                          flags);        /* undefined, set to 0 */
    +
    +            if (rv == -1) {
    +                if (errno == EAGAIN) {
    +                    if (sock->timeout > 0) {
    +                        sock->options |= APR_INCOMPLETE_WRITE;
    +                    }
    +                    /* BSD's sendfile can return -1/EAGAIN even if it
    +                     * sent bytes.  Sanitize the result so we get normal EAGAIN
    +                     * semantics w.r.t. bytes sent.
    +                     */
    +                    if (nbytes) {
    +                        /* normal exit for a big file & non-blocking io */
    +                        (*len) = nbytes;
    +                        return APR_SUCCESS;
    +                    }
    +                }
    +            }
    +            else {       /* rv == 0 (or the kernel is broken) */
    +                if (nbytes == 0) {
    +                    /* Most likely the file got smaller after the stat.
    +                     * Return an error so the caller can do the Right Thing.
    +                     */
    +                    (*len) = nbytes;
    +                    return APR_EOF;
    +                }
    +            }
    +        }    
    +        else {
    +            /* just trailer bytes... use writev()
    +             */
    +            rv = writev(sock->socketdes,
    +                        hdtr->trailers,
    +                        hdtr->numtrailers);
    +            if (rv > 0) {
    +                nbytes = rv;
    +                rv = 0;
    +            }
    +            else {
    +                nbytes = 0;
    +            }
    +        }
    +        if ((rv == -1) && (errno == EAGAIN) 
    +                       && (sock->timeout > 0)) {
    +            apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0);
    +            if (arv != APR_SUCCESS) {
    +                *len = 0;
    +                return arv;
    +            }
    +        }
    +    } while (rv == -1 && (errno == EINTR || errno == EAGAIN));
    +
    +    (*len) = nbytes;
    +    if (rv == -1) {
    +        return errno;
    +    }
    +    return APR_SUCCESS;
    +}
    +
     #elif defined(__FreeBSD__) || defined(__DragonFly__)
     
     /* Release 3.1 or greater */
    
    From 7260b0fe88f6da648c4df266a6d7c21d4f2771d5 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 25 Oct 2007 23:50:03 +0000
    Subject: [PATCH 6055/7878] Back out this change, let libmod_test carry all
     linkage dependencies and mod_test stand alone without it's bindings.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@588394 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in | 8 +++-----
     1 file changed, 3 insertions(+), 5 deletions(-)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index a9f4569353a..075a2fc00d7 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -54,9 +54,7 @@ TARGETS = $(PROGRAMS)
     
     LOCAL_LIBS=../lib@APR_LIBNAME@.la
     
    -CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \
    -	readchild@EXEEXT@ tryread@EXEEXT@ sockchild@EXEEXT@ \
    -	globalmutexchild@EXEEXT@ lfstests/*.bin \
    +CLEAN_TARGETS = testfile.tmp lfstests/*.bin \
     	data/test*.txt data/test*.dat data/apr.testshm.shm
     
     CLEAN_SUBDIRS = internal
    @@ -66,7 +64,7 @@ INCLUDES=-I$(INCDIR) -I$(srcdir)/../include
     
     # link programs using -no-install to get real executables not
     # libtool wrapper scripts which link an executable when first run.
    -LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE)\
    +LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) \
     	    @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@
     
     # STDTEST_PORTABLE;
    @@ -109,7 +107,7 @@ globalmutexchild@EXEEXT@: globalmutexchild.lo $(LOCAL_LIBS)
     mod_test.lo: $(srcdir)/mod_test.c
     	$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -prefer-pic -o $@ -c $<
     
    -mod_test.la: mod_test.lo $(LOCAL_LIBS)
    +mod_test.la: mod_test.lo
     	$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -module \
     	  -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $+ $(ALL_LIBS)
     
    
    From e37d5e94120be9f145d511d57a323795486dfc8a Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 26 Oct 2007 00:01:18 +0000
    Subject: [PATCH 6056/7878] Finish reverting to the old manner of building
     mod_test.la
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@588420 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index 075a2fc00d7..a3d677834d3 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -109,7 +109,7 @@ mod_test.lo: $(srcdir)/mod_test.c
     
     mod_test.la: mod_test.lo
     	$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -module \
    -	  -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $+ $(ALL_LIBS)
    +	  -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $+
     
     libmod_test.la: mod_test.lo $(LOCAL_LIBS)
     	$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` \
    
    From dd6199a0c766184898144bff2434f944b9f85d2f Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 26 Oct 2007 00:06:34 +0000
    Subject: [PATCH 6057/7878] Drop redundant reference
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@588429 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index a3d677834d3..c8236b32e0e 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -93,7 +93,7 @@ echod@EXEEXT@: echod.lo $(LOCAL_LIBS)
     	$(LINK_PROG) $+ $(ALL_LIBS)
     
     sendfile@EXEEXT@: sendfile.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(LOCAL_LIBS) $(ALL_LIBS)
    +	$(LINK_PROG) $+ $(ALL_LIBS)
     
     sockperf@EXEEXT@: sockperf.lo $(LOCAL_LIBS)
     	$(LINK_PROG) $+ $(ALL_LIBS)
    
    From 7fb552f446e25314dd0b5cbc9258b35e548abbe4 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 26 Oct 2007 00:35:26 +0000
    Subject: [PATCH 6058/7878] Explanations would be good
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@588445 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in  |  3 +++
     test/Makefile.win | 15 +++++++++++++++
     2 files changed, 18 insertions(+)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index c8236b32e0e..d891bafc7a5 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -11,6 +11,9 @@ VPATH = @srcdir@
     # OTHER_PROGRAMS
     #   programs such as sendfile, that have to be invoked in a special sequence
     #   or with special parameters
    +# TESTALL_COMPONENTS
    +#   programs such as globalmutexchild which the various TESTS will invoke
    +#   to validate process creation, pipes, dso mechansims and so forth
     
     STDTEST_PORTABLE = \
     	testlockperf@EXEEXT@ \
    diff --git a/test/Makefile.win b/test/Makefile.win
    index 4d194ae71bd..4050c9aac65 100644
    --- a/test/Makefile.win
    +++ b/test/Makefile.win
    @@ -1,11 +1,24 @@
     # PROGRAMS includes all test programs built on this platform.
     # STDTEST_PORTABLE
     #   test programs invoked via standard user interface, run on all platforms
    +# TESTS
    +#   test modules invoked through the abts suite (./testall)
     # STDTEST_NONPORTABLE
     #   test programs invoked via standard user interface, not portable
     # OTHER_PROGRAMS
     #   programs such as sendfile, that have to be invoked in a special sequence
     #   or with special parameters
    +# TESTALL_COMPONENTS
    +#   programs such as globalmutexchild which the various TESTS will invoke
    +#   to validate process creation, pipes, dso mechansims and so forth
    +
    +# Windows Specific;
    +# MODEL
    +#   dynamic or static - refers to which set of bindings are desired
    +#   and controls which libraries (apr-1 or libapr-1) will be linked.
    +# OUTDIR
    +#   the library path of the libraries, and also the path within test/
    +#   where all of the tests for that library will be built
     
     !IFNDEF MODEL
     MODEL=dynamic
    @@ -242,7 +255,9 @@ cleanall:
     	    %COMSPEC% /c "cd %%d & $(MAKE) -f Makefile.win cleanall" \
     
     
    +!IF "$(MODEL)" != "static"
     PATH=$(OUTDIR);..\$(OUTDIR);$(PATH)
    +!ENDIF
     
     check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)
     	@for %p in ($(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)) do @( \
    
    From bd0168833e9c13fbe577dba7e111f23ae05900f5 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 26 Oct 2007 23:15:47 +0000
    Subject: [PATCH 6059/7878] Building PPC and linking on darwin 9 in sequence of
     _all, _atomic, _(others) .o images results in the following;
    
      ld: bc out of range (79008 max is +/-64K) from _apr_atomic_add32 in
      atomic/unix/.libs/ppc.o to _apr_atomic_add32$stub in .libs/libapr-1.0.dylib
      in _apr_atomic_add32 from atomic/unix/.libs/ppc.o
    
    Apparently (and I don't know why we are coupled to the $stub's in the first
    place) moving atomic to the end of the code segment places ppc.o in proximity
    to the $stub relocations.
    
    Of course this commit may inversely clobber another platform.  But not Linux,
    at least.  Committing before I look for various exceptions to this solution.
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@588793 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build.conf | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/build.conf b/build.conf
    index 36121883f58..c302b98be03 100644
    --- a/build.conf
    +++ b/build.conf
    @@ -13,8 +13,8 @@ paths =
     # directories that have platform-specific code in them. the resulting
     # pattern will be: SUBDIR/PLATFORM/*.c
     platform_dirs =
    -  atomic dso file_io locks memory misc mmap network_io poll random
    -  shmem support threadproc time user
    +  dso file_io locks memory misc mmap network_io poll random
    +  shmem support threadproc time user atomic
     
     # all the public headers
     headers = include/*.h
    
    From 4aef6f8c533a14b038ee0b59cb893d00bc300365 Mon Sep 17 00:00:00 2001
    From: Paul Querna 
    Date: Mon, 29 Oct 2007 06:39:54 +0000
    Subject: [PATCH 6060/7878] On 10.5/Leopard, enable KQueue and Poll, since both
     seem to work correctly, and all test cases pass.  If people could test their
     apr_pollset using applications to make sure KQueue support is solid, that
     would be very helpful.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@589519 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_hints.m4 | 20 ++++++++++++--------
     1 file changed, 12 insertions(+), 8 deletions(-)
    
    diff --git a/build/apr_hints.m4 b/build/apr_hints.m4
    index 02de2b550f2..3277949a13d 100644
    --- a/build/apr_hints.m4
    +++ b/build/apr_hints.m4
    @@ -191,14 +191,18 @@ dnl	       # Not a problem in 10.20.  Otherwise, who knows?
     	APR_ADDTO(CPPFLAGS, [-DRHAPSODY])
     	;;
         *-apple-darwin*)
    -	APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp])
    -	APR_SETIFNULL(apr_posixsem_is_global, [yes])
    -        APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332
    -
    -        # kqueue is broken on OS X, the poll tests work, but the socket tests
    -        # hang when it's turned on.  if you decide to reenable this please be
    -        # sure to test that ALL the tests continue to work with it turned on.
    -        APR_SETIFNULL(ac_cv_func_kqueue, [no]) 
    +        APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp])
    +        APR_SETIFNULL(apr_posixsem_is_global, [yes])
    +        # kqueue works in 10.5/Darwin 9.x. Disable on all older versions.
    +        case $host in
    +            *-apple-darwin[[0-8]].*)
    +            # kqueue is broken on OS X, the poll tests work, but the socket tests
    +            # hang when it's turned on.  if you decide to reenable this please be
    +            # sure to test that ALL the tests continue to work with it turned on.
    +            APR_SETIFNULL(ac_cv_func_kqueue, [no]) 
    +            APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332
    +            ;;
    +        esac
     	;;
         *-dec-osf*)
     	APR_ADDTO(CPPFLAGS, [-DOSF1])
    
    From 8e8f04a234cefc27e029804354d1f30c5f9c9b92 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Mon, 29 Oct 2007 11:19:02 +0000
    Subject: [PATCH 6061/7878] * configure.in: Move the ino_t test outside the
     enable_lfs=yes branch, and only define apr_ino_t as unsigned long in the case
     where a 32-bit ino_t is detected and hence may vary by _FILE_OFFSET_BITS;
     it's not necessary in the other cases.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@589583 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 26 ++++++++++++++++++--------
     1 file changed, 18 insertions(+), 8 deletions(-)
    
    diff --git a/configure.in b/configure.in
    index 38791a72fc7..0e8822c9459 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -530,14 +530,6 @@ void main(void)
        if test "$apr_cv_use_lfs64" = "yes"; then
           APR_ADDTO(CPPFLAGS, [-D_LARGEFILE64_SOURCE])
        fi
    -
    -
    -   dnl define apr_ino_t in a manner independent of _FILE_OFFSET_BITS setting
    -   dnl default fallback
    -   ino_t_value=ino_t
    -   APR_CHECK_TYPES_COMPATIBLE(ino_t, unsigned long long, ino_t_value="unsigned long long")
    -   APR_CHECK_TYPES_COMPATIBLE(ino_t, unsigned long, ino_t_value="unsigned long")
    -   APR_CHECK_TYPES_COMPATIBLE(ino_t, unsigned int, ino_t_value="unsigned int")
     fi
     
     AC_ARG_ENABLE(nonportable-atomics,
    @@ -1463,6 +1455,24 @@ else
     fi
     AC_MSG_RESULT($off_t_value)
     
    +# Regardless of whether _LARGEFILE64_SOURCE is used, on 32-bit
    +# platforms _FILE_OFFSET_BITS will affect the size of ino_t and hence
    +# the build-time ABI may be different from the apparent ABI when using
    +# APR with another package which *does* define _FILE_OFFSET_BITS.
    +# (Exactly as per the case above with off_t where LFS is *not* used)
    +#
    +# To be safe, hard-code apr_ino_t as 'unsigned long' iff that is
    +# exactly the size of ino_t here; otherwise use ino_t as existing
    +# releases did.  To be correct, apr_ino_t should have been made an
    +# ino64_t as apr_off_t is off64_t, but this can't be done now without
    +# breaking ABI.
    +ino_t_value=ino_t
    +if test "$ac_cv_sizeof_long" = "4"; then
    +    APR_CHECK_TYPES_COMPATIBLE(ino_t, unsigned long, 
    +                               ino_t_value="unsigned long")
    +fi
    +AC_MSG_NOTICE([using $ino_t_value for ino_t])
    +
     APR_CHECK_SIZEOF_EXTENDED([#include ], pid_t, 8)
     
     if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_short"; then
    
    From 9d040653aa126ac124894707834c361fad9d7cce Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 29 Oct 2007 20:27:03 +0000
    Subject: [PATCH 6062/7878] fix implicit return type for closeConnection()
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@589838 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/sockperf.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/sockperf.c b/test/sockperf.c
    index b424223322c..9726e568c3c 100644
    --- a/test/sockperf.c
    +++ b/test/sockperf.c
    @@ -68,7 +68,7 @@ static void reportError(const char *msg, apr_status_t rv,
         
     }
     
    -static closeConnection(apr_socket_t *sock)
    +static void closeConnection(apr_socket_t *sock)
     {
         apr_size_t len = 0;
         apr_socket_send(sock, NULL, &len);
    
    From 3cd7fe04a8069084dc2f055899b65a879433fa6f Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 29 Oct 2007 20:27:50 +0000
    Subject: [PATCH 6063/7878] size_t is unsigned long on AIX
    
    fix hard-coded format string to match
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@589841 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/configure.in b/configure.in
    index 0e8822c9459..6904edb5746 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -1348,7 +1348,7 @@ case $host in
            ;;
        *aix4*|*aix5*)
            ssize_t_fmt="ld"
    -       size_t_fmt="ld"
    +       size_t_fmt="lu"
            ;;
         *beos*)
             ssize_t_fmt="ld"
    
    From baafbed30ddab822f5ade98cb2cd3d5c4494c806 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 29 Oct 2007 20:32:33 +0000
    Subject: [PATCH 6064/7878] avoid passing function ptr in void *   (AIX c
     compiler barfs in picky mode)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@589844 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testcond.c | 20 ++++++++++++++++----
     1 file changed, 16 insertions(+), 4 deletions(-)
    
    diff --git a/test/testcond.c b/test/testcond.c
    index 17bb0301fe7..a8b7b82182b 100644
    --- a/test/testcond.c
    +++ b/test/testcond.c
    @@ -39,6 +39,12 @@ struct toolbox_t {
         void (*func)(toolbox_t *box);
     };
     
    +typedef struct toolbox_fnptr_t toolbox_fnptr_t;
    +
    +struct toolbox_fnptr_t {
    +    void (*func)(toolbox_t *box);
    +};
    +
     static void lost_signal(abts_case *tc, void *data)
     {
         apr_status_t rv;
    @@ -296,6 +302,7 @@ static void nested_lock_and_unlock(toolbox_t *box)
     
     static void nested_wait(abts_case *tc, void *data)
     {
    +    toolbox_fnptr_t *fnptr = data;
         toolbox_t box;
         apr_status_t rv, retval;
         apr_thread_cond_t *cond = NULL;
    @@ -316,7 +323,7 @@ static void nested_wait(abts_case *tc, void *data)
         box.tc = tc;
         box.cond = cond;
         box.mutex = mutex;
    -    box.func = data;
    +    box.func = fnptr->func;
     
         rv = apr_thread_create(&thread, NULL, thread_routine, &box, p);
         ABTS_SUCCESS(rv);
    @@ -502,7 +509,7 @@ volatile enum {
         TOSS,
         PING,
         PONG,
    -    OVER,
    +    OVER
     } state;
     
     static void ping(toolbox_t *box)
    @@ -640,6 +647,9 @@ static void threads_not_impl(abts_case *tc, void *data)
     
     abts_suite *testcond(abts_suite *suite)
     {
    +#if APR_HAS_THREADS
    +    toolbox_fnptr_t fnptr;
    +#endif
         suite = ADD_SUITE(suite)
     
     #if !APR_HAS_THREADS
    @@ -648,8 +658,10 @@ abts_suite *testcond(abts_suite *suite)
         abts_run_test(suite, lost_signal, NULL);
         abts_run_test(suite, dynamic_binding, NULL);
         abts_run_test(suite, broadcast_threads, NULL);
    -    abts_run_test(suite, nested_wait, nested_lock_and_wait);
    -    abts_run_test(suite, nested_wait, nested_lock_and_unlock);
    +    fnptr.func = nested_lock_and_wait;
    +    abts_run_test(suite, nested_wait, &fnptr);
    +    fnptr.func = nested_lock_and_unlock;
    +    abts_run_test(suite, nested_wait, &fnptr);
         abts_run_test(suite, pipe_producer_consumer, NULL);
         abts_run_test(suite, ping_pong, NULL);
     #endif
    
    From 39bc542008728d28de735c65a769aab2ccc3c29c Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 29 Oct 2007 20:36:08 +0000
    Subject: [PATCH 6065/7878] AIX C compiler won't add to void * in picky mode
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@589846 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/fullrw.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c
    index 59173b4a663..3c67f65904d 100644
    --- a/file_io/unix/fullrw.c
    +++ b/file_io/unix/fullrw.c
    @@ -95,7 +95,7 @@ APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile,
         }
     
         if (amt) {
    -        rv = apr_file_write_full(thefile, vec[i].iov_base + amt,
    +        rv = apr_file_write_full(thefile, (const char *)vec[i].iov_base + amt,
                                      vec[i].iov_len - amt, NULL);
         }
     
    
    From 2f1be84e696d44e49b6b74e829909415f7fc5ecf Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 29 Oct 2007 23:32:59 +0000
    Subject: [PATCH 6066/7878] Radical change that corrects a horrible
     misassumption; the feature APR_HAS_LARGE_FILES means that we support offsets
     larger than memory could contain.  An audit of the code reveals no functional
     changes in the compilation of the library.  The testlfs.c source proves that
     this is the assumption of the users of this 'undocumented feature'.
    
    In fact, it's not possible to properly determine this publicly to
    adjust testlfs.c based on any other public symbol from the library.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@589910 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES      | 6 ++++++
     configure.in | 4 ++++
     2 files changed, 10 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index f38157558b6..88f12b12304 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,6 +1,12 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 1.3.0
     
    +  *) Corrected for Darwin and others to toggle APR_HAS_LARGE_FILES
    +     where large off_t's are enabled without any extra defines, hints
    +     or additional functions.  This is binary compatible, but apps
    +     may need to be recompiled to take full advantage depending on how
    +     they detect this feature.  [William Rowe]
    +
       *) Implement apr_atomic_casptr() and apr_atomic_xchgptr() for z/OS.
          [David Jones ]
     
    diff --git a/configure.in b/configure.in
    index 6904edb5746..531bebbe391 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -1413,6 +1413,10 @@ if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then
         # Enable LFS
         aprlfs=1
         AC_CHECK_FUNCS([mmap64 sendfile64 sendfilev64 mkstemp64 readdir64_r])
    +elif test "${ac_cv_sizeof_off_t}" != "${ac_cv_sizeof_size_t}"; then
    +    # unsure of using -gt above is as portable, can can't forsee where
    +    # off_t can legitimately be smaller than size_t
    +    aprlfs=1
     else
         aprlfs=0     
     fi
    
    From 9388cce485bc846d84ed49a1a705f735b7f1b6de Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 30 Oct 2007 01:39:07 +0000
    Subject: [PATCH 6067/7878] Lots of testing on this first draft is needed. 
     Committing to make it easier for myself and others to verify that these are
     good checks to determine if we can use it.  I'd love if someone with zfs
     installed would check it out.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@589929 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testlfs.c | 137 +++++++++++++++++++++++++++++--------------------
     1 file changed, 82 insertions(+), 55 deletions(-)
    
    diff --git a/test/testlfs.c b/test/testlfs.c
    index 2b109f69525..f85b3b0708e 100644
    --- a/test/testlfs.c
    +++ b/test/testlfs.c
    @@ -24,21 +24,17 @@
     #include "apr_mmap.h"
     #include "testutil.h"
     
    -/* XXX: bullshit - this condition needs to be made a feature-detect.
    - * Only enable these tests by default on platforms which support sparse
    - * files... just Unixes? */
    -#if defined(OS2) || defined(NETWARE)
    -static void test_nolfs(abts_case *tc, void *data)
    -{
    -    ABTS_NOT_IMPL(tc, "Large Files tests require Sparse file support");
    -}
    -#elif APR_HAS_LARGE_FILES
    -#define USE_LFS_TESTS
    +/* TODO: in 1.3.0 this becomes APR_HAS_SPARSE_FILES, HOWEVER we will
    + * still need to test csize before proceeding, because having sparse
    + * file support in the OS/APR does not mean this volume supports it!
    + */
    +#if APR_HAS_LARGE_FILES
     
    -/* Tests which create an 8Gb sparse file and then check it can be used
    +/* Tests which create an 8GB sparse file and then check it can be used
      * as normal. */
     
    -static apr_off_t eightGb = APR_INT64_C(2) << 32;
    +static apr_off_t oneMB = APR_INT64_C(2) << 19;
    +static apr_off_t eightGB = APR_INT64_C(2) << 32;
     
     static int madefile = 0;
     
    @@ -51,6 +47,7 @@ static int madefile = 0;
     static void test_open(abts_case *tc, void *data)
     {
         apr_file_t *f;
    +    apr_finfo_t testsize;
         apr_status_t rv;
     
         rv = apr_dir_make(TESTDIR, APR_OS_DEFAULT, p);
    @@ -58,29 +55,57 @@ static void test_open(abts_case *tc, void *data)
             APR_ASSERT_SUCCESS(tc, "make test directory", rv);
         }
     
    +    /* First attempt a 1MB sparse file so we don't tax the poor test box */
    +
         rv = apr_file_open(&f, TESTFN, APR_FOPEN_CREATE | APR_FOPEN_WRITE
                                      | APR_FOPEN_TRUNCATE | APR_FOPEN_SPARSE,
                            APR_OS_DEFAULT, p);
    +
         APR_ASSERT_SUCCESS(tc, "open file", rv);
     
    -    rv = apr_file_trunc(f, eightGb);
    +    APR_ASSERT_SUCCESS(tc, "Truncate to 1MB", rv = apr_file_trunc(f, oneMB+1));
     
    -    APR_ASSERT_SUCCESS(tc, "close large file", apr_file_close(f));
    +    if (rv == APR_SUCCESS) {
    +        rv = apr_file_info_get(&testsize, APR_FINFO_CSIZE, f);
    +    }
     
    -    /* 8Gb may pass rlimits or filesystem limits */
    +    /* give up if we can't determine the allocation size of the file,
    +     * or if it's not an obviously small allocation but the allocation
    +     * unit doesn't appear insanely large
    +     */
    +    if ((rv != APR_SUCCESS) || ((testsize.csize > oneMB)
    +                             && (testsize.csize < oneMB * 2)))
    +    {
    +        ABTS_NOT_IMPL(tc, "Creation of large file (apparently not sparse)");
    +
    +        madefile = 0;
    +    }
    +    else
    +    {
    +        /* Proceed with our 8GB sparse file now */
     
    -    if (APR_STATUS_IS_EINVAL(rv)
    +        rv = apr_file_trunc(f, eightGB);
    +
    +        /* 8GB may pass rlimits or filesystem limits */
    +
    +        if (APR_STATUS_IS_EINVAL(rv)
     #ifdef EFBIG
    -        || rv == EFBIG
    +            || rv == EFBIG
     #endif
    -        ) {
    -        ABTS_NOT_IMPL(tc, "Creation of large file (limited by rlimit or fs?)");
    -    } 
    -    else {
    -        APR_ASSERT_SUCCESS(tc, "truncate file to 8gb", rv);
    +            ) {
    +            ABTS_NOT_IMPL(tc, "Creation of large file (rlimit, quota or fs)");
    +        } 
    +        else {
    +            APR_ASSERT_SUCCESS(tc, "truncate file to 8gb", rv);
    +        }
    +        madefile = rv == APR_SUCCESS;
         }
     
    -    madefile = rv == APR_SUCCESS;
    +    APR_ASSERT_SUCCESS(tc, "close large file", apr_file_close(f));
    +
    +    if (!madefile) {
    +        APR_ASSERT_SUCCESS(tc, "remove large file", apr_file_remove(TESTFN, p));
    +    }
     }
     
     static void test_reopen(abts_case *tc, void *data)
    @@ -93,13 +118,13 @@ static void test_reopen(abts_case *tc, void *data)
         
         rv = apr_file_open(&fh, TESTFN, APR_FOPEN_SPARSE | APR_FOPEN_READ,
                            APR_OS_DEFAULT, p);
    -    APR_ASSERT_SUCCESS(tc, "re-open 8Gb file", rv);
    +    APR_ASSERT_SUCCESS(tc, "re-open 8GB file", rv);
     
         APR_ASSERT_SUCCESS(tc, "file_info_get failed",
                            apr_file_info_get(&finfo, APR_FINFO_NORM, fh));
         
         ABTS_ASSERT(tc, "file_info_get gave incorrect size",
    -             finfo.size == eightGb);
    +             finfo.size == eightGB);
     
         APR_ASSERT_SUCCESS(tc, "re-close large file", apr_file_close(fh));
     }
    @@ -113,7 +138,7 @@ static void test_stat(abts_case *tc, void *data)
         APR_ASSERT_SUCCESS(tc, "stat large file", 
                            apr_stat(&finfo, TESTFN, APR_FINFO_NORM, p));
         
    -    ABTS_ASSERT(tc, "stat gave incorrect size", finfo.size == eightGb);
    +    ABTS_ASSERT(tc, "stat gave incorrect size", finfo.size == eightGB);
     }
     
     static void test_readdir(abts_case *tc, void *data)
    @@ -133,7 +158,7 @@ static void test_readdir(abts_case *tc, void *data)
             
             if (rv == APR_SUCCESS && strcmp(finfo.name, TESTFILE) == 0) {
                 ABTS_ASSERT(tc, "apr_dir_read gave incorrect size for large file", 
    -                     finfo.size == eightGb);
    +                     finfo.size == eightGB);
             }
     
         } while (rv == APR_SUCCESS);
    @@ -159,18 +184,18 @@ static void test_append(abts_case *tc, void *data)
         rv = apr_file_open(&fh, TESTFN, APR_FOPEN_SPARSE | APR_FOPEN_WRITE 
                                       | APR_FOPEN_APPEND, 
                            APR_OS_DEFAULT, p);
    -    APR_ASSERT_SUCCESS(tc, "open 8Gb file for append", rv);
    +    APR_ASSERT_SUCCESS(tc, "open 8GB file for append", rv);
     
    -    APR_ASSERT_SUCCESS(tc, "append to 8Gb file",
    +    APR_ASSERT_SUCCESS(tc, "append to 8GB file",
                            apr_file_write_full(fh, TESTSTR, strlen(TESTSTR), NULL));
     
         APR_ASSERT_SUCCESS(tc, "file_info_get failed",
                            apr_file_info_get(&finfo, APR_FINFO_NORM, fh));
         
         ABTS_ASSERT(tc, "file_info_get gave incorrect size",
    -             finfo.size == eightGb + strlen(TESTSTR));
    +             finfo.size == eightGB + strlen(TESTSTR));
     
    -    APR_ASSERT_SUCCESS(tc, "close 8Gb file", apr_file_close(fh));
    +    APR_ASSERT_SUCCESS(tc, "close 8GB file", apr_file_close(fh));
     }
     
     static void test_seek(abts_case *tc, void *data)
    @@ -183,20 +208,20 @@ static void test_seek(abts_case *tc, void *data)
         
         rv = apr_file_open(&fh, TESTFN, APR_FOPEN_SPARSE | APR_FOPEN_WRITE,
                            APR_OS_DEFAULT, p);
    -    APR_ASSERT_SUCCESS(tc, "open 8Gb file for writing", rv);
    +    APR_ASSERT_SUCCESS(tc, "open 8GB file for writing", rv);
     
         pos = 0;
         APR_ASSERT_SUCCESS(tc, "relative seek to end", 
                            apr_file_seek(fh, APR_END, &pos));
    -    ABTS_ASSERT(tc, "seek to END gave 8Gb", pos == eightGb);
    +    ABTS_ASSERT(tc, "seek to END gave 8GB", pos == eightGB);
         
    -    pos = eightGb;
    -    APR_ASSERT_SUCCESS(tc, "seek to 8Gb", apr_file_seek(fh, APR_SET, &pos));
    -    ABTS_ASSERT(tc, "seek gave 8Gb offset", pos == eightGb);
    +    pos = eightGB;
    +    APR_ASSERT_SUCCESS(tc, "seek to 8GB", apr_file_seek(fh, APR_SET, &pos));
    +    ABTS_ASSERT(tc, "seek gave 8GB offset", pos == eightGB);
     
         pos = 0;
         APR_ASSERT_SUCCESS(tc, "relative seek to 0", apr_file_seek(fh, APR_CUR, &pos));
    -    ABTS_ASSERT(tc, "relative seek gave 8Gb offset", pos == eightGb);
    +    ABTS_ASSERT(tc, "relative seek gave 8GB offset", pos == eightGB);
     
         apr_file_close(fh);
     }
    @@ -204,23 +229,23 @@ static void test_seek(abts_case *tc, void *data)
     static void test_write(abts_case *tc, void *data)
     {
         apr_file_t *fh;
    -    apr_off_t pos = eightGb - 4;
    +    apr_off_t pos = eightGB - 4;
         apr_status_t rv;
     
         PRECOND;
     
         rv = apr_file_open(&fh, TESTFN, APR_FOPEN_SPARSE | APR_FOPEN_WRITE,
                            APR_OS_DEFAULT, p);
    -    APR_ASSERT_SUCCESS(tc, "re-open 8Gb file", rv);
    +    APR_ASSERT_SUCCESS(tc, "re-open 8GB file", rv);
     
    -    APR_ASSERT_SUCCESS(tc, "seek to 8Gb - 4", 
    +    APR_ASSERT_SUCCESS(tc, "seek to 8GB - 4", 
                            apr_file_seek(fh, APR_SET, &pos));
    -    ABTS_ASSERT(tc, "seek gave 8Gb-4 offset", pos == eightGb - 4);
    +    ABTS_ASSERT(tc, "seek gave 8GB-4 offset", pos == eightGB - 4);
     
    -    APR_ASSERT_SUCCESS(tc, "write magic string to 8Gb-4",
    +    APR_ASSERT_SUCCESS(tc, "write magic string to 8GB-4",
                            apr_file_write_full(fh, "FISH", 4, NULL));
     
    -    APR_ASSERT_SUCCESS(tc, "close 8Gb file", apr_file_close(fh));
    +    APR_ASSERT_SUCCESS(tc, "close 8GB file", apr_file_close(fh));
     }
     
     
    @@ -230,7 +255,7 @@ static void test_mmap(abts_case *tc, void *data)
         apr_mmap_t *map;
         apr_file_t *fh;
         apr_size_t len = 16384; /* hopefully a multiple of the page size */
    -    apr_off_t off = eightGb - len; 
    +    apr_off_t off = eightGB - len; 
         apr_status_t rv;
         void *ptr;
     
    @@ -240,7 +265,7 @@ static void test_mmap(abts_case *tc, void *data)
                            APR_OS_DEFAULT, p);
         APR_ASSERT_SUCCESS(tc, "open 8gb file for mmap", rv);
         
    -    APR_ASSERT_SUCCESS(tc, "mmap 8Gb file",
    +    APR_ASSERT_SUCCESS(tc, "mmap 8GB file",
                            apr_mmap_create(&map, fh, off, len, APR_MMAP_READ, p));
     
         APR_ASSERT_SUCCESS(tc, "close file", apr_file_close(fh));
    @@ -263,10 +288,10 @@ static void test_format(abts_case *tc, void *data)
     
         PRECOND;
     
    -    off = apr_atoi64(apr_off_t_toa(p, eightGb));
    +    off = apr_atoi64(apr_off_t_toa(p, eightGB));
     
         ABTS_ASSERT(tc, "apr_atoi64 parsed apr_off_t_toa result incorrectly",
    -             off == eightGb);
    +             off == eightGB);
     }
     
     #define TESTBUFFN TESTDIR "/buffer.bin"
    @@ -286,27 +311,27 @@ static void test_buffered(abts_case *tc, void *data)
         APR_ASSERT_SUCCESS(tc, "open buffered file", rv);
     
         APR_ASSERT_SUCCESS(tc, "truncate to 8GB",
    -                       apr_file_trunc(f, eightGb));
    +                       apr_file_trunc(f, eightGB));
     
    -    off = eightGb;
    +    off = eightGB;
         APR_ASSERT_SUCCESS(tc, "seek to 8GB",
                            apr_file_seek(f, APR_SET, &off));
         ABTS_ASSERT(tc, "returned seek position still 8GB",
    -                off == eightGb);
    +                off == eightGB);
     
         off = 0;
         APR_ASSERT_SUCCESS(tc, "relative seek",
                            apr_file_seek(f, APR_CUR, &off));
         ABTS_ASSERT(tc, "relative seek still at 8GB",
    -                off == eightGb);
    +                off == eightGB);
     
         off = 0;
         APR_ASSERT_SUCCESS(tc, "end-relative seek",
                            apr_file_seek(f, APR_END, &off));
         ABTS_ASSERT(tc, "end-relative seek still at 8GB",
    -                off == eightGb);
    +                off == eightGB);
     
    -    off = -eightGb;
    +    off = -eightGB;
         APR_ASSERT_SUCCESS(tc, "relative seek to beginning",
                            apr_file_seek(f, APR_CUR, &off));
         ABTS_ASSERT(tc, "seek to beginning got zero",
    @@ -316,18 +341,20 @@ static void test_buffered(abts_case *tc, void *data)
                            apr_file_close(f));
     }
     
    -#else
    +#else /* !APR_HAS_LARGE_FILES */
    +
     static void test_nolfs(abts_case *tc, void *data)
     {
         ABTS_NOT_IMPL(tc, "Large Files not supported");
     }
    +
     #endif
     
     abts_suite *testlfs(abts_suite *suite)
     {
         suite = ADD_SUITE(suite)
     
    -#ifdef USE_LFS_TESTS
    +#if APR_HAS_LARGE_FILES
         abts_run_test(suite, test_open, NULL);
         abts_run_test(suite, test_reopen, NULL);
         abts_run_test(suite, test_stat, NULL);
    
    From e5cce6a47458ced4d82ffd29ea4c88de0271633c Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Tue, 30 Oct 2007 09:04:06 +0000
    Subject: [PATCH 6068/7878] More random notes on interfaces.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@589994 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 13 ++++++++++++-
     1 file changed, 12 insertions(+), 1 deletion(-)
    
    diff --git a/STATUS b/STATUS
    index 724fe258ce9..36719792d16 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -409,7 +409,7 @@ Documentation that needs writing:
                  should we ever start using any other form of md5 (e.g.
                  openssl) then errors would become a distinct possibility.
     
    -API Changes Postponed for APR 2.0:
    +Interface Changes Postponed for APR 2.0:
     
         * apr_atomic_casptr() has the volatile qualifier in the wrong
           place: should take "pointer to volatile pointer to void", not
    @@ -467,6 +467,17 @@ API Changes Postponed for APR 2.0:
           exit-why value would be ignored in the same circumstances as the existing 
           status parameter: reason != APR_OC_REASON_DEATH.
     
    +    * apr_file_gets() should take an apr_size_t size parameter?
    +
    +    * apr_table_vdo should not continue iterating through the keys
    +      list once the callback function returns non-zero; see JCW's
    +      comment in apr_tables.c.
    +
    +    * The library SONAME should vary for the different library ABIs - 
    +      i.e. LFS support, IPv6 support or not.
    +
    +    * remove APR_POLL_LASTDESC from apr_datatype_e.
    +
     Stuff for post 1.0:
     
         * Almost every API in APR depends on pools, but pool semantics
    
    From 4aec45de34771b605a2eba4021680125d9cb9d21 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Tue, 30 Oct 2007 11:18:10 +0000
    Subject: [PATCH 6069/7878] Fix build breakage due to syntax errors in
     threadproc/os2/proc.c. I haven't yet verified that the code works but this is
     a step in the right direction.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@590037 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/os2/proc.c | 19 ++++++++++---------
     1 file changed, 10 insertions(+), 9 deletions(-)
    
    diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c
    index 9fd9a5f5093..d05666dec49 100644
    --- a/threadproc/os2/proc.c
    +++ b/threadproc/os2/proc.c
    @@ -130,9 +130,11 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_fi
                         == APR_SUCCESS)
                     rv = apr_file_inherit_set(attr->child_in);
             }
    +    }
     
         if (parent_in != NULL && rv == APR_SUCCESS) {
             rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool);
    +    }
     
         return rv;
     }
    @@ -161,6 +163,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_f
       
         if (parent_out != NULL && rv == APR_SUCCESS) {
             rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool);
    +    }
     
         return rv;
     }
    @@ -189,6 +192,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f
       
         if (parent_err != NULL && rv == APR_SUCCESS) {
             rv = apr_file_dup(&attr->parent_err, parent_err, attr->pool);
    +    }
     
         return rv;
     }
    @@ -499,25 +503,22 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname
             chdir(savedir);
         }
     
    -    if (attr->child_in) {
    -        (attr->child_in->filedes != -1)
    -            apr_file_close(attr->child_in);
    +    if (attr->child_in && (attr->child_in->filedes != -1)) {
    +        apr_file_close(attr->child_in);
             dup = STDIN_FILENO;
             DosDupHandle(save_in, &dup);
             DosClose(save_in);
         }
         
    -    if (attr->child_out) {
    -        (attr->child_err->filedes != -1)
    -            apr_file_close(attr->child_out);
    +    if (attr->child_out && attr->child_err->filedes != -1) {
    +        apr_file_close(attr->child_out);
             dup = STDOUT_FILENO;
             DosDupHandle(save_out, &dup);
             DosClose(save_out);
         }
         
    -    if (attr->child_err) {
    -        (attr->child_err->filedes != -1)
    -            apr_file_close(attr->child_err);
    +    if (attr->child_err && attr->child_err->filedes != -1) {
    +        apr_file_close(attr->child_err);
             dup = STDERR_FILENO;
             DosDupHandle(save_err, &dup);
             DosClose(save_err);
    
    From c8a349573cc3ecc5dfe1fc2ce401d5b8b1962918 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Tue, 30 Oct 2007 16:31:33 +0000
    Subject: [PATCH 6070/7878] * test/testlfs.c (test_open): Fix style issues
     introduced in r589929; no functional change.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@590137 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testlfs.c | 12 ++++--------
     1 file changed, 4 insertions(+), 8 deletions(-)
    
    diff --git a/test/testlfs.c b/test/testlfs.c
    index f85b3b0708e..9d9dde90d15 100644
    --- a/test/testlfs.c
    +++ b/test/testlfs.c
    @@ -56,7 +56,6 @@ static void test_open(abts_case *tc, void *data)
         }
     
         /* First attempt a 1MB sparse file so we don't tax the poor test box */
    -
         rv = apr_file_open(&f, TESTFN, APR_FOPEN_CREATE | APR_FOPEN_WRITE
                                      | APR_FOPEN_TRUNCATE | APR_FOPEN_SPARSE,
                            APR_OS_DEFAULT, p);
    @@ -73,17 +72,14 @@ static void test_open(abts_case *tc, void *data)
          * or if it's not an obviously small allocation but the allocation
          * unit doesn't appear insanely large
          */
    -    if ((rv != APR_SUCCESS) || ((testsize.csize > oneMB)
    -                             && (testsize.csize < oneMB * 2)))
    -    {
    +    if (rv != APR_SUCCESS || (testsize.csize > oneMB
    +                              && testsize.csize < oneMB * 2)) {
             ABTS_NOT_IMPL(tc, "Creation of large file (apparently not sparse)");
     
             madefile = 0;
    -    }
    -    else
    -    {
    +    } 
    +    else {
             /* Proceed with our 8GB sparse file now */
    -
             rv = apr_file_trunc(f, eightGB);
     
             /* 8GB may pass rlimits or filesystem limits */
    
    From 0969ff1f4a6b0634c19dd704b8805a78dd603f8c Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Tue, 30 Oct 2007 22:09:57 +0000
    Subject: [PATCH 6071/7878] OS/2: Make opened files non-inheritable. Implement
     apr_file_inherit_set & apr_file_inherit_unset directly instead of via macros.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@590491 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/os2/open.c | 33 ++++++++++++++++++++++++++++++---
     1 file changed, 30 insertions(+), 3 deletions(-)
    
    diff --git a/file_io/os2/open.c b/file_io/os2/open.c
    index 62d611c4159..386bd073c6e 100644
    --- a/file_io/os2/open.c
    +++ b/file_io/os2/open.c
    @@ -33,7 +33,7 @@ apr_status_t apr_file_cleanup(void *thefile)
     APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag,  apr_fileperms_t perm, apr_pool_t *pool)
     {
         int oflags = 0;
    -    int mflags = OPEN_FLAGS_FAIL_ON_ERROR|OPEN_SHARE_DENYNONE;
    +    int mflags = OPEN_FLAGS_FAIL_ON_ERROR|OPEN_SHARE_DENYNONE|OPEN_FLAGS_NOINHERIT;
         int rv;
         ULONG action;
         apr_file_t *dafile = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t));
    @@ -267,7 +267,34 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *
     
     APR_POOL_IMPLEMENT_ACCESSOR(file);
     
    -APR_IMPLEMENT_INHERIT_SET(file, flags, pool, apr_file_cleanup)
     
    -APR_IMPLEMENT_INHERIT_UNSET(file, flags, pool, apr_file_cleanup)
     
    +APR_DECLARE(apr_status_t) apr_file_inherit_set(apr_file_t *thefile)
    +{
    +    int rv;
    +    ULONG state;
    +
    +    rv = DosQueryFHState(thefile->filedes, &state);
    +
    +    if (rv == 0 && (state & OPEN_FLAGS_NOINHERIT) != 0) {
    +        rv = DosSetFHState(thefile->filedes, state & ~OPEN_FLAGS_NOINHERIT);
    +    }
    +
    +    return APR_FROM_OS_ERROR(rv);
    +}
    +
    +
    +
    +APR_DECLARE(apr_status_t) apr_file_inherit_unset(apr_file_t *thefile)
    +{
    +    int rv;
    +    ULONG state;
    +
    +    rv = DosQueryFHState(thefile->filedes, &state);
    +
    +    if (rv == 0 && (state & OPEN_FLAGS_NOINHERIT) == 0) {
    +        rv = DosSetFHState(thefile->filedes, state | OPEN_FLAGS_NOINHERIT);
    +    }
    +
    +    return APR_FROM_OS_ERROR(rv);
    +}
    
    From a33631ed04b8c9923982ee9d7a8e9018a5f4d82f Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 31 Oct 2007 08:45:49 +0000
    Subject: [PATCH 6072/7878] Address the make flavor discrepancies that Joe
     Orton pointed out.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@590592 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in | 85 +++++++++++++++++++++++++++++-------------------
     1 file changed, 52 insertions(+), 33 deletions(-)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index d891bafc7a5..b3710742cae 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -78,66 +78,85 @@ abts.lo: $(srcdir)/abts.c $(srcdir)/abts.h $(srcdir)/abts_tests.h \
     testutil.lo: $(srcdir)/abts.c $(srcdir)/abts.h $(srcdir)/abts_tests.h \
     	     $(srcdir)/testutil.h
     
    -testall@EXEEXT@: $(TESTS) abts.lo testutil.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(ALL_LIBS)
    +OBJECTS_testall = abts.lo testutil.lo $(TESTS) $(LOCAL_LIBS)
    +testall@EXEEXT@: $(OBJECTS_testall)
    +	$(LINK_PROG) $(OBJECTS_testall) $(ALL_LIBS)
     # For VPATH builds; where we have no ./data, copy us some data
     # if we wait until 'make check', then 'make; ./testall' fails;
     	if test ! -d "./data"; then cp -r $(srcdir)/data data; fi
     
    -testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(ALL_LIBS)
    +OBJECTS_testlockperf = testlockperf.lo $(LOCAL_LIBS)
    +testlockperf@EXEEXT@: $(OBJECTS_testlockperf)
    +	$(LINK_PROG) $(OBJECTS_testlockperf) $(ALL_LIBS)
     
    -testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(ALL_LIBS)
    +OBJECTS_testmutexscope = testmutexscope.lo $(LOCAL_LIBS)
    +testmutexscope@EXEEXT@: $(OBJECTS_testmutexscope)
    +	$(LINK_PROG) $(OBJECTS_testmutexscope) $(ALL_LIBS)
     
     # OTHER_PROGRAMS;
     
    -echod@EXEEXT@: echod.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(ALL_LIBS)
    +OBJECTS_echod = echod.lo $(LOCAL_LIBS)
    +echod@EXEEXT@: $(OBJECTS_echod)
    +	$(LINK_PROG) $(OBJECTS_echod) $(ALL_LIBS)
     
    -sendfile@EXEEXT@: sendfile.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(ALL_LIBS)
    +OBJECTS_sendfile = sendfile.lo $(LOCAL_LIBS)
    +sendfile@EXEEXT@: $(OBJECTS_sendfile)
    +	$(LINK_PROG) $(OBJECTS_sendfile) $(ALL_LIBS)
     
    -sockperf@EXEEXT@: sockperf.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(ALL_LIBS)
    +OBJECTS_sockperf = sockperf.lo $(LOCAL_LIBS)
    +sockperf@EXEEXT@: $(OBJECTS_sockperf)
    +	$(LINK_PROG) $(OBJECTS_sockperf) $(ALL_LIBS)
     
     # TESTALL_COMPONENTS;
     
    -globalmutexchild@EXEEXT@: globalmutexchild.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(ALL_LIBS)
    +OBJECTS_globalmutexchild = globalmutexchild.lo $(LOCAL_LIBS)
    +globalmutexchild@EXEEXT@: $(OBJECTS_globalmutexchild)
    +	$(LINK_PROG) $(OBJECTS_globalmutexchild) $(ALL_LIBS)
     
     # Note -prefer-pic is only supported with libtool-1.4+
     mod_test.lo: $(srcdir)/mod_test.c
    -	$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -prefer-pic -o $@ -c $<
    +	$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -prefer-pic -o $@ \
    +	  -c $(srcdir)/mod_test.c
     
    -mod_test.la: mod_test.lo
    +OBJECTS_mod_test = mod_test.lo
    +mod_test.la: $(OBJECTS_mod_test)
     	$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -module \
    -	  -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $+
    +	  -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ \
    +	  $(OBJECTS_mod_test)
     
    -libmod_test.la: mod_test.lo $(LOCAL_LIBS)
    +OBJECTS_libmod_test = mod_test.lo $(LOCAL_LIBS)
    +libmod_test.la: $(OBJECTS_libmod_test)
     	$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` \
    -	  -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $+ $(ALL_LIBS)
    +	  -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ \
    +	  $(OBJECTS_libmod_test) $(ALL_LIBS)
     
    -occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(ALL_LIBS)
    +OBJECTS_occhild = occhild.lo $(LOCAL_LIBS)
    +occhild@EXEEXT@: $(OBJECTS_occhild)
    +	$(LINK_PROG) $(OBJECTS_occhild) $(ALL_LIBS)
     
    -proc_child@EXEEXT@: proc_child.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(ALL_LIBS)
    +OBJECTS_proc_child = proc_child.lo $(LOCAL_LIBS)
    +proc_child@EXEEXT@: $(OBJECTS_proc_child)
    +	$(LINK_PROG) $(OBJECTS_proc_child) $(ALL_LIBS)
     
    -readchild@EXEEXT@: readchild.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(ALL_LIBS)
    +OBJECTS_readchild = readchild.lo $(LOCAL_LIBS)
    +readchild@EXEEXT@: $(OBJECTS_readchild)
    +	$(LINK_PROG) $(OBJECTS_readchild) $(ALL_LIBS)
     
    -sockchild@EXEEXT@: sockchild.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(ALL_LIBS)
    +OBJECTS_sockchild = sockchild.lo $(LOCAL_LIBS)
    +sockchild@EXEEXT@: $(OBJECTS_sockchild)
    +	$(LINK_PROG) $(OBJECTS_sockchild) $(ALL_LIBS)
     
    -testshmconsumer@EXEEXT@: testshmconsumer.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(ALL_LIBS)
    +OBJECTS_testshmconsumer = testshmconsumer.lo $(LOCAL_LIBS)
    +testshmconsumer@EXEEXT@: $(OBJECTS_testshmconsumer) $(LOCAL_LIBS)
    +	$(LINK_PROG) $(OBJECTS_testshmconsumer) $(ALL_LIBS)
     
    -testshmproducer@EXEEXT@: testshmproducer.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(ALL_LIBS)
    +OBJECTS_testshmproducer = testshmproducer.lo $(LOCAL_LIBS)
    +testshmproducer@EXEEXT@: $(OBJECTS_testshmproducer)
    +	$(LINK_PROG) $(OBJECTS_testshmproducer) $(ALL_LIBS)
     
    -tryread@EXEEXT@: tryread.lo $(LOCAL_LIBS)
    -	$(LINK_PROG) $+ $(ALL_LIBS)
    +OBJECTS_tryread = tryread.lo $(LOCAL_LIBS)
    +tryread@EXEEXT@: $(OBJECTS_tryread)
    +	$(LINK_PROG) $(OBJECTS_tryread) $(ALL_LIBS)
     
     check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)
     	teststatus=0; \
    
    From 597ff92263d02dbde5b2d4f8e3d894ad7ce39b40 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Wed, 31 Oct 2007 22:06:10 +0000
    Subject: [PATCH 6073/7878] OS/2: Fix condition for restoring std handles after
     spawning a process. We still need to restore the std handles if "no file"
     (filedes == -1) is passed to the child.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@590848 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/os2/proc.c | 21 +++++++++++++++------
     1 file changed, 15 insertions(+), 6 deletions(-)
    
    diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c
    index d05666dec49..059558a909d 100644
    --- a/threadproc/os2/proc.c
    +++ b/threadproc/os2/proc.c
    @@ -503,22 +503,31 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname
             chdir(savedir);
         }
     
    -    if (attr->child_in && (attr->child_in->filedes != -1)) {
    -        apr_file_close(attr->child_in);
    +    if (attr->child_in) {
    +        if (attr->child_in->filedes != -1) {
    +            apr_file_close(attr->child_in);
    +        }
    +
             dup = STDIN_FILENO;
             DosDupHandle(save_in, &dup);
             DosClose(save_in);
         }
         
    -    if (attr->child_out && attr->child_err->filedes != -1) {
    -        apr_file_close(attr->child_out);
    +    if (attr->child_out) {
    +        if  (attr->child_err->filedes != -1) {
    +            apr_file_close(attr->child_out);
    +        }
    +
             dup = STDOUT_FILENO;
             DosDupHandle(save_out, &dup);
             DosClose(save_out);
         }
         
    -    if (attr->child_err && attr->child_err->filedes != -1) {
    -        apr_file_close(attr->child_err);
    +    if (attr->child_err) {
    +        if (attr->child_err->filedes != -1) {
    +            apr_file_close(attr->child_err);
    +        }
    +
             dup = STDERR_FILENO;
             DosDupHandle(save_err, &dup);
             DosClose(save_err);
    
    From 9f4eab1f4f7aad7371fdb34df41494f48ab34ba3 Mon Sep 17 00:00:00 2001
    From: Brian Havard 
    Date: Wed, 31 Oct 2007 22:11:18 +0000
    Subject: [PATCH 6074/7878] Fix mismatch, using child_err when dealing with
     stdout.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@590849 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/os2/proc.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c
    index 059558a909d..8e4a4a3b632 100644
    --- a/threadproc/os2/proc.c
    +++ b/threadproc/os2/proc.c
    @@ -514,7 +514,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname
         }
         
         if (attr->child_out) {
    -        if  (attr->child_err->filedes != -1) {
    +        if  (attr->child_out->filedes != -1) {
                 apr_file_close(attr->child_out);
             }
     
    
    From 2b0c2d1750e3c3bbae97557e066da64b45e2c1fd Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 1 Nov 2007 23:01:06 +0000
    Subject: [PATCH 6075/7878] Broken on EBCDIC platforms at a minimum, perhaps
     others.
    
    Previous testhash.c comments indicate an underlying problem:
    
      "I don't know why these are out of order, but they are. I would probably
      consider this a bug, but others should comment."
    
    The hash iterator functions do not promise/attempt any ordering.
    Alphabetically qsort all the dumped hashes using strcmp to provide
    a testable result set.
    
    (wrowe adds; I thought everyone knew better than to use try to
    get ordered results out of hashes ;-)
    
    Submitted by: David Jones 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@591164 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testhash.c | 118 +++++++++++++++++++++++++++---------------------
     1 file changed, 67 insertions(+), 51 deletions(-)
    
    diff --git a/test/testhash.c b/test/testhash.c
    index 01fb5ecf54c..6e7e518d507 100644
    --- a/test/testhash.c
    +++ b/test/testhash.c
    @@ -21,22 +21,40 @@
     #include "apr_pools.h"
     #include "apr_hash.h"
     
    -static void dump_hash(apr_pool_t *p, apr_hash_t *h, char *str) 
    +#define MAX_LTH 256
    +#define MAX_DEPTH 11
    +
    +static int comp_string(const void *str1, const void *str2)
    +{
    +    return strcmp(str1,str2);
    +}
    +
    +static void dump_hash(apr_pool_t *p, apr_hash_t *h, char str[][MAX_LTH]) 
     {
         apr_hash_index_t *hi;
         char *val, *key;
         apr_ssize_t len;
         int i = 0;
     
    -    str[0] = '\0';
    -
         for (hi = apr_hash_first(p, h); hi; hi = apr_hash_next(hi)) {
             apr_hash_this(hi,(void*) &key, &len, (void*) &val);
    -        apr_snprintf(str, 8196, "%sKey %s (%" APR_SSIZE_T_FMT ") Value %s\n", 
    -                     str, key, len, val);
    +        str[i][0]='\0';
    +        apr_snprintf(str[i], MAX_LTH, "%sKey %s (%" APR_SSIZE_T_FMT ") Value %s\n",
    +                 str[i], key, len, val);
             i++;
         }
    -    apr_snprintf(str, 8196, "%s#entries %d\n", str, i);
    +    str[i][0]='\0';
    +    apr_snprintf(str[i], MAX_LTH, "%s#entries %d\n", str[i], i);
    +
    +    /* Sort the result strings so that they can be checked for expected results easily,
    +     * without having to worry about platform quirks
    +     */
    +    qsort(
    +        str, /* Pointer to elements */
    +        i,   /* number of elements */
    +        MAX_LTH, /* size of one element */
    +        comp_string /* Pointer to comparison routine */
    +    );
     }
     
     static void sum_hash(apr_pool_t *p, apr_hash_t *h, int *pcount, int *keySum, int *valSum) 
    @@ -177,7 +195,7 @@ static void hash_clear(abts_case *tc, void *data)
     static void hash_traverse(abts_case *tc, void *data)
     {
         apr_hash_t *h;
    -    char str[8196];
    +    char StrArray[MAX_DEPTH][MAX_LTH];
     
         h = apr_hash_make(p);
         ABTS_PTR_NOTNULL(tc, h);
    @@ -192,15 +210,16 @@ static void hash_traverse(abts_case *tc, void *data)
         apr_hash_set(h, "SAME2", APR_HASH_KEY_STRING, "same");
         apr_hash_set(h, "OVERWRITE", APR_HASH_KEY_STRING, "Overwrite key");
     
    -    dump_hash(p, h, str);
    -    ABTS_STR_EQUAL(tc, "Key FOO1 (4) Value bar1\n"
    -                          "Key FOO2 (4) Value bar2\n"
    -                          "Key OVERWRITE (9) Value Overwrite key\n"
    -                          "Key FOO3 (4) Value bar3\n"
    -                          "Key SAME1 (5) Value same\n"
    -                          "Key FOO4 (4) Value bar4\n"
    -                          "Key SAME2 (5) Value same\n"
    -                          "#entries 7\n", str);
    +    dump_hash(p, h, StrArray);
    +
    +    ABTS_STR_EQUAL(tc, "Key FOO1 (4) Value bar1\n", StrArray[0]);
    +    ABTS_STR_EQUAL(tc, "Key FOO2 (4) Value bar2\n", StrArray[1]);
    +    ABTS_STR_EQUAL(tc, "Key FOO3 (4) Value bar3\n", StrArray[2]);
    +    ABTS_STR_EQUAL(tc, "Key FOO4 (4) Value bar4\n", StrArray[3]);
    +    ABTS_STR_EQUAL(tc, "Key OVERWRITE (9) Value Overwrite key\n", StrArray[4]);
    +    ABTS_STR_EQUAL(tc, "Key SAME1 (5) Value same\n", StrArray[5]);
    +    ABTS_STR_EQUAL(tc, "Key SAME2 (5) Value same\n", StrArray[6]);
    +    ABTS_STR_EQUAL(tc, "#entries 7\n", StrArray[7]);
     }
     
     /* This is kind of a hack, but I am just keeping an existing test.  This is
    @@ -314,7 +333,7 @@ static void overlay_empty(abts_case *tc, void *data)
         apr_hash_t *overlay = NULL;
         apr_hash_t *result = NULL;
         int count;
    -    char str[8196];
    +    char StrArray[MAX_DEPTH][MAX_LTH];
     
         base = apr_hash_make(p);
         overlay = apr_hash_make(p);
    @@ -332,13 +351,14 @@ static void overlay_empty(abts_case *tc, void *data)
         count = apr_hash_count(result);
         ABTS_INT_EQUAL(tc, 5, count);
     
    -    dump_hash(p, result, str);
    -    ABTS_STR_EQUAL(tc, "Key key1 (4) Value value1\n"
    -                          "Key key2 (4) Value value2\n"
    -                          "Key key3 (4) Value value3\n"
    -                          "Key key4 (4) Value value4\n"
    -                          "Key key5 (4) Value value5\n"
    -                          "#entries 5\n", str);
    +    dump_hash(p, result, StrArray);
    +
    +    ABTS_STR_EQUAL(tc, "Key key1 (4) Value value1\n", StrArray[0]);
    +    ABTS_STR_EQUAL(tc, "Key key2 (4) Value value2\n", StrArray[1]);
    +    ABTS_STR_EQUAL(tc, "Key key3 (4) Value value3\n", StrArray[2]);
    +    ABTS_STR_EQUAL(tc, "Key key4 (4) Value value4\n", StrArray[3]);
    +    ABTS_STR_EQUAL(tc, "Key key5 (4) Value value5\n", StrArray[4]);
    +    ABTS_STR_EQUAL(tc, "#entries 5\n", StrArray[5]);
     }
     
     static void overlay_2unique(abts_case *tc, void *data)
    @@ -347,7 +367,7 @@ static void overlay_2unique(abts_case *tc, void *data)
         apr_hash_t *overlay = NULL;
         apr_hash_t *result = NULL;
         int count;
    -    char str[8196];
    +    char StrArray[MAX_DEPTH][MAX_LTH];
     
         base = apr_hash_make(p);
         overlay = apr_hash_make(p);
    @@ -371,21 +391,19 @@ static void overlay_2unique(abts_case *tc, void *data)
         count = apr_hash_count(result);
         ABTS_INT_EQUAL(tc, 10, count);
     
    -    dump_hash(p, result, str);
    -    /* I don't know why these are out of order, but they are.  I would probably
    -     * consider this a bug, but others should comment.
    -     */
    -    ABTS_STR_EQUAL(tc, "Key base5 (5) Value value5\n"
    -                          "Key overlay1 (8) Value value1\n"
    -                          "Key overlay2 (8) Value value2\n"
    -                          "Key overlay3 (8) Value value3\n"
    -                          "Key overlay4 (8) Value value4\n"
    -                          "Key overlay5 (8) Value value5\n"
    -                          "Key base1 (5) Value value1\n"
    -                          "Key base2 (5) Value value2\n"
    -                          "Key base3 (5) Value value3\n"
    -                          "Key base4 (5) Value value4\n"
    -                          "#entries 10\n", str);
    +    dump_hash(p, result, StrArray);
    +
    +    ABTS_STR_EQUAL(tc, "Key base1 (5) Value value1\n", StrArray[0]);
    +    ABTS_STR_EQUAL(tc, "Key base2 (5) Value value2\n", StrArray[1]);
    +    ABTS_STR_EQUAL(tc, "Key base3 (5) Value value3\n", StrArray[2]);
    +    ABTS_STR_EQUAL(tc, "Key base4 (5) Value value4\n", StrArray[3]);
    +    ABTS_STR_EQUAL(tc, "Key base5 (5) Value value5\n", StrArray[4]);
    +    ABTS_STR_EQUAL(tc, "Key overlay1 (8) Value value1\n", StrArray[5]);
    +    ABTS_STR_EQUAL(tc, "Key overlay2 (8) Value value2\n", StrArray[6]);
    +    ABTS_STR_EQUAL(tc, "Key overlay3 (8) Value value3\n", StrArray[7]);
    +    ABTS_STR_EQUAL(tc, "Key overlay4 (8) Value value4\n", StrArray[8]);
    +    ABTS_STR_EQUAL(tc, "Key overlay5 (8) Value value5\n", StrArray[9]);
    +    ABTS_STR_EQUAL(tc, "#entries 10\n", StrArray[10]);
     }
     
     static void overlay_same(abts_case *tc, void *data)
    @@ -393,7 +411,7 @@ static void overlay_same(abts_case *tc, void *data)
         apr_hash_t *base = NULL;
         apr_hash_t *result = NULL;
         int count;
    -    char str[8196];
    +    char StrArray[MAX_DEPTH][MAX_LTH];
     
         base = apr_hash_make(p);
         ABTS_PTR_NOTNULL(tc, base);
    @@ -409,16 +427,14 @@ static void overlay_same(abts_case *tc, void *data)
         count = apr_hash_count(result);
         ABTS_INT_EQUAL(tc, 5, count);
     
    -    dump_hash(p, result, str);
    -    /* I don't know why these are out of order, but they are.  I would probably
    -     * consider this a bug, but others should comment.
    -     */
    -    ABTS_STR_EQUAL(tc, "Key base5 (5) Value value5\n"
    -                          "Key base1 (5) Value value1\n"
    -                          "Key base2 (5) Value value2\n"
    -                          "Key base3 (5) Value value3\n"
    -                          "Key base4 (5) Value value4\n"
    -                          "#entries 5\n", str);
    +    dump_hash(p, result, StrArray);
    +
    +    ABTS_STR_EQUAL(tc, "Key base1 (5) Value value1\n", StrArray[0]);
    +    ABTS_STR_EQUAL(tc, "Key base2 (5) Value value2\n", StrArray[1]);
    +    ABTS_STR_EQUAL(tc, "Key base3 (5) Value value3\n", StrArray[2]);
    +    ABTS_STR_EQUAL(tc, "Key base4 (5) Value value4\n", StrArray[3]);
    +    ABTS_STR_EQUAL(tc, "Key base5 (5) Value value5\n", StrArray[4]);
    +    ABTS_STR_EQUAL(tc, "#entries 5\n", StrArray[5]);
     }
     
     abts_suite *testhash(abts_suite *suite)
    
    From 1cda2f755648d5589e6e353e8c4146f4f75640a0 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 2 Nov 2007 01:54:33 +0000
    Subject: [PATCH 6076/7878] On Darwin 9.0 the NSLoad... dyld API is deprecated;
     use dlopen.
    
    On HPUX 64bit PA-RISC or IA64... shl_ API is deprecated; use dlopen.
    (Unless we can't in which case we'll jump on shl at the end.)
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@591191 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 31 ++++++++++++++++++++++++++-----
     1 file changed, 26 insertions(+), 5 deletions(-)
    
    diff --git a/configure.in b/configure.in
    index 531bebbe391..b6c47e8f261 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -1578,11 +1578,26 @@ AC_ARG_ENABLE(dso,
       ], [dsotype=any])
     
     if test "$dsotype" = "any"; then
    -    # Darwin:
    -    AC_CHECK_FUNC(NSLinkModule, [dsotype=dyld])
         if test "$dsotype" = "any"; then
    -      # Original HP-UX:
    -      AC_CHECK_LIB(dld, shl_load, [dsotype=shl; APR_ADDTO(LIBS,-ldld)])
    +      case $host in
    +        *darwin[0-8]\.*) 
    +          # Original Darwin, not for 9.0!:
    +          AC_CHECK_FUNC(NSLinkModule, [dsotype=dyld]);;
    +        *-hpux[1-9]\.*|*-hpux1[01]*)
    +          # shl is specific to hpux(?), and is suboptimal for 64 bit builds,
    +          # and most unlikely to be the choice of 12.x developers.
    +          AC_CHECK_LIB(dld, shl_load, [have_shl=1])
    +          if test "$ac_cv_sizeof_voidp$have_shl" = "41"; then
    +            dsotype=shl; APR_ADDTO(LIBS,-ldld)
    +          fi;;
    +        *mingw*|*-os2*)
    +          # several 'other's below probably belong up here.  If they always
    +          # use a platform implementation and shouldn't test the dlopen/dlfcn
    +          # features, then bring them up here.
    +          # But if they -should- optionally use dlfcn, and/or need the config
    +          # detection of dlopen/dlsym, do not move them up.
    +          dsotype=other ;;
    +      esac
         fi
         # Normal POSIX:
         if test "$dsotype" = "any"; then
    @@ -1606,7 +1621,13 @@ if test "$dsotype" = "any"; then
         # Everything else:
         if test "$dsotype" = "any"; then
             case $host in
    -        *os390|*-os2*|*os400|*-aix*|*mingw*) dsotype=other ;;
    +        *os390|*os400|*-aix*)
    +          # Some -aix5 will use dl, no hassles.  Keep that pattern here.
    +          dsotype=other ;;
    +        *-hpux*)
    +          if test "$have_shl" = "1"; then
    +            dsotype=shl; APR_ADDTO(LIBS,-ldld)
    +          fi;;
             esac
         fi
     fi
    
    From 967cc78979939cc3189a7bdc282ce9b45d41a152 Mon Sep 17 00:00:00 2001
    From: Guenter Knauf 
    Date: Fri, 2 Nov 2007 14:05:19 +0000
    Subject: [PATCH 6077/7878] fixed header target order.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@591337 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/NWGNUmakefile | 8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile
    index 43d28e836fc..1c3f4b1b6c6 100644
    --- a/build/NWGNUmakefile
    +++ b/build/NWGNUmakefile
    @@ -57,10 +57,6 @@ $(APR)/include/%.h: $(subst /,\,$(APR))\include\%.hnw
     	@echo Creating $(subst /,\,$@)
     	copy $< $(subst /,\,$(APR))\include\$(@F)
     
    -$(APRUTIL)/include/%.h: $(subst /,\,$(APRUTIL))\include\%.hnw
    -	@echo Creating $(subst /,\,$@)
    -	copy $< $(subst /,\,$(APRUTIL))\include\$(@F)
    -
     $(APRUTIL)/include/private/%.h: $(subst /,\,$(APRUTIL))\include\private\%.hnw
     	@echo Creating $(subst /,\,$@)
     	copy $< $(subst /,\,$(APRUTIL))\include\private\$(@F)
    @@ -69,6 +65,10 @@ $(APRUTIL)/include/private/%.h: $(subst /,\,$(APRUTIL))\include\private\%.hw
     	@echo Creating $(subst /,\,$@)
     	copy $< $(subst /,\,$(APRUTIL))\include\private\$(@F)
     
    +$(APRUTIL)/include/%.h: $(subst /,\,$(APRUTIL))\include\%.hnw
    +	@echo Creating $(subst /,\,$@)
    +	copy $< $(subst /,\,$(APRUTIL))\include\$(@F)
    +
     $(APRUTIL)/xml/expat/lib/%.h: $(subst /,\,$(APRUTIL))\xml\expat\lib\%.hnw
     	@echo Creating $(subst /,\,$@)
     	copy $< $(subst /,\,$(APRUTIL))\xml\expat\lib\$(@F)
    
    From 16989a9a1f51eee623ef761a31dfc35bba12d25a Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 3 Nov 2007 14:07:50 +0000
    Subject: [PATCH 6078/7878] add missing autoconf/m4 quoting to correct the dso
     implementation choice on older Darwin/OS X as well as HP-UX
    
    throw in a similar fix for detection of ancient AIX
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@591624 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/configure.in b/configure.in
    index b6c47e8f261..5d2b4173b76 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -412,7 +412,7 @@ INSTALL_SUBDIRS="none"
     OBJECTS_PLATFORM='$(OBJECTS_unix)'
     
     case $host in
    -   i386-ibm-aix* | *-ibm-aix[1-2].* | *-ibm-aix3.* | *-ibm-aix4.1 | *-ibm-aix4.1.* | *-ibm-aix4.2 | *-ibm-aix4.2.*)
    +   i386-ibm-aix* | *-ibm-aix[[1-2]].* | *-ibm-aix3.* | *-ibm-aix4.1 | *-ibm-aix4.1.* | *-ibm-aix4.2 | *-ibm-aix4.2.*)
            OSDIR="aix"
            APR_ADDTO(LDFLAGS,-lld)
            eolstr="\\n"
    @@ -1580,10 +1580,10 @@ AC_ARG_ENABLE(dso,
     if test "$dsotype" = "any"; then
         if test "$dsotype" = "any"; then
           case $host in
    -        *darwin[0-8]\.*) 
    +        *darwin[[0-8]]\.*) 
               # Original Darwin, not for 9.0!:
               AC_CHECK_FUNC(NSLinkModule, [dsotype=dyld]);;
    -        *-hpux[1-9]\.*|*-hpux1[01]*)
    +        *-hpux[[1-9]]\.*|*-hpux1[[01]]*)
               # shl is specific to hpux(?), and is suboptimal for 64 bit builds,
               # and most unlikely to be the choice of 12.x developers.
               AC_CHECK_LIB(dld, shl_load, [have_shl=1])
    
    From facb33895996f325643d3591d54daa55ff70357f Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 6 Nov 2007 00:50:41 +0000
    Subject: [PATCH 6079/7878] It is entirely pointless to have nonportable
     behaviors as examples to end users of the library.  Good point, however, for
     an @tip.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592215 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_file_io.h |  2 ++
     test/testdir.c        | 13 +------------
     2 files changed, 3 insertions(+), 12 deletions(-)
    
    diff --git a/include/apr_file_io.h b/include/apr_file_io.h
    index e37f95890d5..a78f5b947fd 100644
    --- a/include/apr_file_io.h
    +++ b/include/apr_file_io.h
    @@ -834,6 +834,8 @@ APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path,
      * Remove directory from the file system.
      * @param path the path for the directory to be removed. (use / on all systems)
      * @param pool the pool to use.
    + * @tip removing a directory which is in-use (e.g., the current working
    + * directory, or during apr_dir_read, or with an open file) is not portable.
      */                        
     APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool);
     
    diff --git a/test/testdir.c b/test/testdir.c
    index 82f145d6f1f..7cdc4bbffaa 100644
    --- a/test/testdir.c
    +++ b/test/testdir.c
    @@ -234,20 +234,9 @@ static void test_rmkdir_nocwd(abts_case *tc, void *data)
     
         APR_ASSERT_SUCCESS(tc, "change to temp dir", apr_filepath_set(path, p));
     
    -    rv = apr_dir_remove(path, p);
    -    /* Some platforms cannot remove a directory which is in use. */
    -    if (rv == APR_SUCCESS) {
    -        ABTS_ASSERT(tc, "fail to create dir",
    -                    apr_dir_make_recursive("foobar", APR_OS_DEFAULT, 
    -                                           p) != APR_SUCCESS);
    -    }
    -
         APR_ASSERT_SUCCESS(tc, "restore cwd", apr_filepath_set(cwd, p));
     
    -    if (rv) {
    -        apr_dir_remove(path, p);
    -        ABTS_NOT_IMPL(tc, "cannot remove in-use directory");
    -    }
    +    APR_ASSERT_SUCCESS(tc, "remove cwd", rv = apr_dir_remove(path, p));
     }
     
     
    
    From 4438920f7865adec5f7813b9f022e779988736ff Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 6 Nov 2007 02:56:36 +0000
    Subject: [PATCH 6080/7878] Leftover cut-n-paste junk noted by Lucian Adrian
     Grijincu 
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592232 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testdir.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/testdir.c b/test/testdir.c
    index 7cdc4bbffaa..85151d65928 100644
    --- a/test/testdir.c
    +++ b/test/testdir.c
    @@ -236,7 +236,7 @@ static void test_rmkdir_nocwd(abts_case *tc, void *data)
     
         APR_ASSERT_SUCCESS(tc, "restore cwd", apr_filepath_set(cwd, p));
     
    -    APR_ASSERT_SUCCESS(tc, "remove cwd", rv = apr_dir_remove(path, p));
    +    APR_ASSERT_SUCCESS(tc, "remove cwd", apr_dir_remove(path, p));
     }
     
     
    
    From 705283cbb36bc27b12f95993186aa3646d00ee36 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 6 Nov 2007 03:13:42 +0000
    Subject: [PATCH 6081/7878] Axe another poor illustration, apr_shm_destroy
     preceeds apr_shm_remove for portability.  (As the comment hints, a
     non-portable alternative does exist).
    
    And be consistent in the use of @remark's --- although I suspect
    that we need  to review @remarks and transition many to @warning.
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592235 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_file_io.h | 2 +-
     include/apr_shm.h     | 5 +++--
     test/testshm.c        | 9 +++------
     3 files changed, 7 insertions(+), 9 deletions(-)
    
    diff --git a/include/apr_file_io.h b/include/apr_file_io.h
    index a78f5b947fd..32a945561ec 100644
    --- a/include/apr_file_io.h
    +++ b/include/apr_file_io.h
    @@ -834,7 +834,7 @@ APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path,
      * Remove directory from the file system.
      * @param path the path for the directory to be removed. (use / on all systems)
      * @param pool the pool to use.
    - * @tip removing a directory which is in-use (e.g., the current working
    + * @remark Removing a directory which is in-use (e.g., the current working
      * directory, or during apr_dir_read, or with an open file) is not portable.
      */                        
     APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool);
    diff --git a/include/apr_shm.h b/include/apr_shm.h
    index 4875ee1ff87..651d9dbbf54 100644
    --- a/include/apr_shm.h
    +++ b/include/apr_shm.h
    @@ -71,13 +71,14 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
                                              apr_pool_t *pool);
     
     /**
    - * Remove shared memory segment associated with a filename.
    + * Remove file associated with a shared memory segment.
      * @param filename The filename associated with shared-memory segment which
      *        needs to be removed
      * @param pool The pool used for file operations
      * @remark This function is only supported on platforms which support
      * name-based shared memory segments, and will return APR_ENOTIMPL on
    - * platforms without such support.
    + * platforms without such support.  Removing the file while the shm
    + * is in use (prior to apr_shm_destroy) is non-portable.
      */
     APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename,
                                              apr_pool_t *pool);
    diff --git a/test/testshm.c b/test/testshm.c
    index c660abf88f3..5e724005cd6 100644
    --- a/test/testshm.c
    +++ b/test/testshm.c
    @@ -232,12 +232,6 @@ static void test_named_remove(abts_case *tc, void *data)
         }
         ABTS_PTR_NOTNULL(tc, shm);
     
    -    rv = apr_shm_remove(SHARED_FILENAME, p);
    -    APR_ASSERT_SUCCESS(tc, "Error removing shared memory block", rv);
    -    if (rv != APR_SUCCESS) {
    -        return ;
    -    }
    -
         rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p);
         APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv);
         if (rv != APR_SUCCESS) {
    @@ -247,6 +241,9 @@ static void test_named_remove(abts_case *tc, void *data)
     
         rv = apr_shm_destroy(shm);
         APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
    +
    +    rv = apr_shm_remove(SHARED_FILENAME, p);
    +    APR_ASSERT_SUCCESS(tc, "Error removing shared memory block", rv);
     }
     
     #endif
    
    From fcf9ff85b7c3cbd164d09aa8583a4e7b15e590fb Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 6 Nov 2007 03:35:16 +0000
    Subject: [PATCH 6082/7878] The test for remove should actually be verifying
     that we can no longer attach to a now-removed shm resource.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592245 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testshm.c | 10 +++-------
     1 file changed, 3 insertions(+), 7 deletions(-)
    
    diff --git a/test/testshm.c b/test/testshm.c
    index 5e724005cd6..d15e724748b 100644
    --- a/test/testshm.c
    +++ b/test/testshm.c
    @@ -232,18 +232,14 @@ static void test_named_remove(abts_case *tc, void *data)
         }
         ABTS_PTR_NOTNULL(tc, shm);
     
    -    rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p);
    -    APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv);
    -    if (rv != APR_SUCCESS) {
    -        return;
    -    }
    -    ABTS_PTR_NOTNULL(tc, shm);
    -
         rv = apr_shm_destroy(shm);
         APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
     
         rv = apr_shm_remove(SHARED_FILENAME, p);
         APR_ASSERT_SUCCESS(tc, "Error removing shared memory block", rv);
    +
    +    rv = apr_shm_attach(&shm, SHARED_FILENAME, p);
    +    ABTS_TRUE(tc, rv != 0);
     }
     
     #endif
    
    From edb252ea3f8a4ef8c7e05c9a3aa7d303d69a6558 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 6 Nov 2007 03:45:42 +0000
    Subject: [PATCH 6083/7878] After reviewing the code, back out the previous two
     commits and take a different approach.  _destroy appears to effect a _remove
     in the first place.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592252 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testshm.c | 17 ++++++++++++-----
     1 file changed, 12 insertions(+), 5 deletions(-)
    
    diff --git a/test/testshm.c b/test/testshm.c
    index d15e724748b..c660abf88f3 100644
    --- a/test/testshm.c
    +++ b/test/testshm.c
    @@ -232,14 +232,21 @@ static void test_named_remove(abts_case *tc, void *data)
         }
         ABTS_PTR_NOTNULL(tc, shm);
     
    -    rv = apr_shm_destroy(shm);
    -    APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
    -
         rv = apr_shm_remove(SHARED_FILENAME, p);
         APR_ASSERT_SUCCESS(tc, "Error removing shared memory block", rv);
    +    if (rv != APR_SUCCESS) {
    +        return ;
    +    }
    +
    +    rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p);
    +    APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv);
    +    if (rv != APR_SUCCESS) {
    +        return;
    +    }
    +    ABTS_PTR_NOTNULL(tc, shm);
     
    -    rv = apr_shm_attach(&shm, SHARED_FILENAME, p);
    -    ABTS_TRUE(tc, rv != 0);
    +    rv = apr_shm_destroy(shm);
    +    APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
     }
     
     #endif
    
    From 1e45dab969ab560a969b37d799678b0bc34dcef9 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 6 Nov 2007 03:58:22 +0000
    Subject: [PATCH 6084/7878] More effectively explain apr_shm_remove, and the
     hints that it provides to the caller.  Document these assumptions by way of a
     proper test case, cleaning up irrespective of which implementation is
     available on this platform.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592258 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_shm.h |  9 +++++++--
     test/testshm.c    | 29 +++++++++++++++++++----------
     2 files changed, 26 insertions(+), 12 deletions(-)
    
    diff --git a/include/apr_shm.h b/include/apr_shm.h
    index 651d9dbbf54..2b1d50f6d49 100644
    --- a/include/apr_shm.h
    +++ b/include/apr_shm.h
    @@ -71,14 +71,19 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
                                              apr_pool_t *pool);
     
     /**
    - * Remove file associated with a shared memory segment.
    + * Remove named resource associated with a shared memory segment,
    + * preventing attachments to the resource, but not destroying it.
      * @param filename The filename associated with shared-memory segment which
      *        needs to be removed
      * @param pool The pool used for file operations
      * @remark This function is only supported on platforms which support
      * name-based shared memory segments, and will return APR_ENOTIMPL on
      * platforms without such support.  Removing the file while the shm
    - * is in use (prior to apr_shm_destroy) is non-portable.
    + * is in use is not entirely portable, caller may use this to enhance
    + * obscurity of the resource, but be prepared for the the call to fail,
    + * and for concurrent attempts to create a resource of the same name
    + * to also fail.  The pool cleanup of apr_shm_create (apr_shm_destroy)
    + * also removes the named resource.
      */
     APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename,
                                              apr_pool_t *pool);
    diff --git a/test/testshm.c b/test/testshm.c
    index c660abf88f3..ab9b76c21a7 100644
    --- a/test/testshm.c
    +++ b/test/testshm.c
    @@ -221,7 +221,7 @@ static void test_named(abts_case *tc, void *data)
     static void test_named_remove(abts_case *tc, void *data)
     {
         apr_status_t rv;
    -    apr_shm_t *shm;
    +    apr_shm_t *shm, *shm2;
     
         apr_shm_remove(SHARED_FILENAME, p);
     
    @@ -233,20 +233,29 @@ static void test_named_remove(abts_case *tc, void *data)
         ABTS_PTR_NOTNULL(tc, shm);
     
         rv = apr_shm_remove(SHARED_FILENAME, p);
    -    APR_ASSERT_SUCCESS(tc, "Error removing shared memory block", rv);
    -    if (rv != APR_SUCCESS) {
    -        return ;
    -    }
     
    -    rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p);
    -    APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv);
    -    if (rv != APR_SUCCESS) {
    -        return;
    +    /* On platforms which acknowledge the removal of the shared resource,
    +     * ensure another of the same name may be created after removal;
    +     */
    +    if (rv == APR_SUCCESS)
    +    {
    +      rv = apr_shm_create(&shm2, SHARED_SIZE, SHARED_FILENAME, p);
    +      APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv);
    +      if (rv != APR_SUCCESS) {
    +          return;
    +      }
    +      ABTS_PTR_NOTNULL(tc, shm2);
    +
    +      rv = apr_shm_destroy(shm2);
    +      APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
         }
    -    ABTS_PTR_NOTNULL(tc, shm);
     
         rv = apr_shm_destroy(shm);
         APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
    +
    +    /* Now ensure no named resource remains which we may attach to */
    +    rv = apr_shm_attach(&shm, SHARED_FILENAME, p);
    +    ABTS_TRUE(tc, rv != 0);
     }
     
     #endif
    
    From 39ba2da97aed5719d6454fc9e3be3f57fa64b57f Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 6 Nov 2007 06:33:46 +0000
    Subject: [PATCH 6085/7878] Now in 1.3.0 a valid csize becomes very critical to
     enable us to run the lfs sparse file tests.  Make this so on win32 where we
     have Win2k and later, at least by filename (since it's documented that
     CompressedFileSize ~= allocation of a sparse file, yet there is no way to
     know this by-handle.)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592304 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filestat.c           | 45 +++++++++++++++++++++++++++---
     include/arch/win32/apr_arch_misc.h | 25 +++++++++++++++++
     2 files changed, 66 insertions(+), 4 deletions(-)
    
    diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
    index af93bb933b4..f008876548a 100644
    --- a/file_io/win32/filestat.c
    +++ b/file_io/win32/filestat.c
    @@ -188,7 +188,8 @@ static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname,
         return rv;
     }
     
    -static void guess_protection_bits(apr_finfo_t *finfo)
    +static apr_status_t guess_protection_bits(apr_finfo_t *finfo,
    +                                          apr_int32_t wanted)
     {
         /* Read, write execute for owner.  In the Win9x environment, any
          * readable file is executable (well, not entirely 100% true, but
    @@ -205,6 +206,8 @@ static void guess_protection_bits(apr_finfo_t *finfo)
                            | (finfo->protection << prot_scope_user);
     
         finfo->valid |= APR_FINFO_UPROT | APR_FINFO_GPROT | APR_FINFO_WPROT;
    +
    +    return ((wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS);
     }
     
     apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, 
    @@ -215,8 +218,9 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile,
         apr_status_t rv;
     
         if (apr_os_level < APR_WIN_NT)
    -        guess_protection_bits(finfo);
    -    else if (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER))
    +        return guess_protection_bits(finfo, wanted);
    +
    +    if (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER))
         {
             /* On NT this request is incredibly expensive, but accurate.
              * Since the WinNT-only functions below are protected by the
    @@ -286,9 +290,42 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile,
                 resolve_prot(finfo, wanted, dacl);
             }
             else if (wanted & APR_FINFO_PROT)
    -            guess_protection_bits(finfo);
    +            guess_protection_bits(finfo, wanted);
         }
     
    +    if ((apr_os_level >= APR_WIN_2000) && (wanted & APR_FINFO_CSIZE)
    +                                       && (finfo->filetype == APR_REG))
    +    {
    +        DWORD sizelo, sizehi;
    +        if (whatfile == MORE_OF_HANDLE) {
    +            /* Not available for development and implementation under
    +             * a reasonable license; if you review the licensing
    +             * terms and conditions of;
    +             *   http://go.microsoft.com/fwlink/?linkid=84083
    +             * you probably understand why APR chooses not to implement.
    +             */
    +            ;
    +        }
    +        else {
    +            SetLastError(NO_ERROR);
    +            if (whatfile == MORE_OF_WFSPEC)
    +                sizelo = GetCompressedFileSizeW((apr_wchar_t*)ufile, &sizehi);
    +            else if (whatfile == MORE_OF_FSPEC)
    +                sizelo = GetCompressedFileSizeA((char*)ufile, &sizehi);
    +        
    +            if (sizelo != INVALID_FILE_SIZE || GetLastError() == NO_ERROR) {
    +#if APR_HAS_LARGE_FILES
    +                finfo->csize =  (apr_off_t)sizelo
    +                             | ((apr_off_t)sizehi << 32);
    +#else
    +                finfo->csize = (apr_off_t)sizelo;
    +                if (finfo->csize < 0 || sizehi)
    +                    finfo->csize = 0x7fffffff;
    +#endif
    +                finfo->valid |= APR_FINFO_CSIZE;
    +            }
    +        }
    +    }
         return ((wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS);
     }
     
    diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h
    index 874f9b10378..b22353a5325 100644
    --- a/include/arch/win32/apr_arch_misc.h
    +++ b/include/arch/win32/apr_arch_misc.h
    @@ -213,6 +213,7 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal);
      */
     
     #if !defined(_WIN32_WCE) && !defined(WINNT)
    +/* This group is available to all versions of WINNT 4.0 SP6 and later */
     
     #ifdef GetFileAttributesExA
     #undef GetFileAttributesExA
    @@ -308,6 +309,30 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_SHSTDAPI, LPWSTR *, WINAPI, CommandLineToArgvW, 0,
     #endif /* !defined(_WIN32_WCE) && !defined(WINNT) */
     
     #if !defined(_WIN32_WCE)
    +/* This group is NOT available to all versions of WinNT,
    + * these we must always look up
    + */
    +
    +#ifdef GetCompressedFileSizeA
    +#undef GetCompressedFileSizeA
    +#endif
    +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, DWORD, WINAPI, GetCompressedFileSizeA, 0, (
    +    IN LPCSTR lpFileName,
    +    OUT LPDWORD lpFileSizeHigh),
    +    (lpFileName, lpFileSizeHigh));
    +#define GetCompressedFileSizeA apr_winapi_GetCompressedFileSizeA
    +#undef GetCompressedFileSize
    +#define GetCompressedFileSize apr_winapi_GetCompressedFileSizeA
    +
    +#ifdef GetCompressedFileSizeW
    +#undef GetCompressedFileSizeW
    +#endif
    +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, DWORD, WINAPI, GetCompressedFileSizeW, 0, (
    +    IN LPCWSTR lpFileName,
    +    OUT LPDWORD lpFileSizeHigh),
    +    (lpFileName, lpFileSizeHigh));
    +#define GetCompressedFileSizeW apr_winapi_GetCompressedFileSizeW
    +
     
     APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryTimerResolution, 0, (
         ULONG *pMaxRes,  /* Minimum NS Resolution */
    
    From f088159b3029041c0fb1d25bd879b04c03349a34 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 6 Nov 2007 06:34:18 +0000
    Subject: [PATCH 6086/7878] On some (bogus) platforms we can only discover
     csize-by-name. Ask for it, either way.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592305 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testlfs.c | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/test/testlfs.c b/test/testlfs.c
    index 9d9dde90d15..b9cc5d5a708 100644
    --- a/test/testlfs.c
    +++ b/test/testlfs.c
    @@ -66,6 +66,8 @@ static void test_open(abts_case *tc, void *data)
     
         if (rv == APR_SUCCESS) {
             rv = apr_file_info_get(&testsize, APR_FINFO_CSIZE, f);
    +        if (rv == APR_INCOMPLETE)
    +            rv = apr_stat(&testsize, TESTFN, APR_FINFO_CSIZE, p);
         }
     
         /* give up if we can't determine the allocation size of the file,
    
    From b3bc4defc215d5a536c59dffcaca65596a2a962b Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 6 Nov 2007 06:40:21 +0000
    Subject: [PATCH 6087/7878] No use for rv now.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592306 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testdir.c | 1 -
     1 file changed, 1 deletion(-)
    
    diff --git a/test/testdir.c b/test/testdir.c
    index 85151d65928..63a2f1722ef 100644
    --- a/test/testdir.c
    +++ b/test/testdir.c
    @@ -222,7 +222,6 @@ static void test_uncleared_errno(abts_case *tc, void *data)
     static void test_rmkdir_nocwd(abts_case *tc, void *data)
     {
         char *cwd, *path;
    -    apr_status_t rv;
     
         APR_ASSERT_SUCCESS(tc, "make temp dir",
                            apr_dir_make("dir3", APR_OS_DEFAULT, p));
    
    From b1e1727c1789ca880eab0958984a9b2d670a1bae Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 6 Nov 2007 06:46:36 +0000
    Subject: [PATCH 6088/7878] A huge amount of progress, axe many 0.9'ish
     generation comments, many already-implemented things, and note the current
     state of win32 test results
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592312 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 159 ++++++++++++++++-----------------------------------------
     1 file changed, 44 insertions(+), 115 deletions(-)
    
    diff --git a/STATUS b/STATUS
    index 36719792d16..d5fdd15b032 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -62,8 +62,6 @@ CURRENT test/testall -v EXCEPTIONS:
     
         Please add any platform anomilies to the following exception list.
     
    -    * various tests fail on Unix in VPATH builds.
    -
         * 'testipsub' will tickle an Solaris 8 getaddrinfo() IPv6 bug,
           causing the test to hang.  Configure with --disable-ipv6 if
           using an unpatched Solaris 8 installation.
    @@ -74,48 +72,41 @@ CURRENT test/testall -v EXCEPTIONS:
         * 'testdso' fails on older versions of OpenBSD due to dlsym(NULL,
           ...) segfaulting.
     
    -    * BUG: Win32 fails test in File Info: test_stat_eq_finfo
    -        apr_stat and apr_getfileinfo differ in protection ... wrowe
    -        guesses that we are checking the handle objects' permissions
    -        rather than the filesystem objects' permissions.
    -
         * Win32 Not Implemented tests 
    -        Pipes: set_timeout/read_write; can't timeout blocking pipes
    -        Socket Creation: tcp6_socket and udp6_socket (at least by default)
    -        Socket Options: corkable: TCP isn't corkable
    -        Users: username: Groups from apr_uid_get not implemented
    +        poll: pollcb not implemented
    +        procmutex: lacks fork() support
    +        sock : Sync behavior causes us to skip one test
    +        sockets: tcp6_socket/udp6_socket skipped for no IPv6 adapter
    +        sockopt: TCP isn't corkable
    +        users: username: Groups from apr_uid_get not implemented
     
    +    * Win32 tests are known to fail when APR_HAVE_IPV6 but there is no
    +      ipv6 adapter is loaded (even loopback is sufficient).  There are
    +      obnoxious getaddrinfo() missing results from looking up a fixed
    +      IPv4-IPv6 mixed notation address, which reflect a Win32 bug.
    +        ipsub: One test fails for IPv6 with no IPv6 adapter configured
    +        sock : One test fails for IPv6 with no IPv6 adapter configured
     
    -RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
     
    -    * testpipe: Line 69: expected <0>, but saw <22>
    -                Line 92: expected <0>, but saw <22>
    -      In order to use apr_file_pipe_timeout_set on Win32 we need to
    -      create that end of the pipe as nonblocking; currently win32 
    -      has assumed blocking pipes on apr_file_pipe_create.  Inverting
    -      this assumption would break stdhandles, the most common use case.
    -      We must add a flag to set the reader/writer end to explicitly
    -      blocking or nonblocking, and the choice isn't volatile.
    -
    -    * "testlfs: Line 32: Large Files tests require Sparse file support"
    -      In order to portably implement LFS-Sparse files, we would have
    -      to actually flag that upon create (open), to be portable to win32.
    -
    -    * Someone needs to port testucs to Unix. Right now it only works
    -      on Windows.
    -        OtherBill asks; should we have a test/arch/xxx tree?
    -                        The ucs implementation is an internal for
    -                        unicode/utf-8 win32isms.
    +ONGOING REMINDERS FOR STYLE/SUBSTANCE OF CONTRIBUTING TO APR:
     
    -    * The return type of a thread function (void *) is inconsistent with
    -      the type used in apr_thread_exit()/apr_thread_join() (apr_status_t).
    -      The thread function's return type should be changed to apr_status_t
    -      so that a return from the thread main function has the same effect
    -      as apr_thread_exit().
    -      See Message-Id:  for thread
    -      discussing this.
    -        +1: BrianH, Aaron, david, jerenkrantz
    -      Status: Will Rowe was working on this. 
    +    * Flush out the test suite and make sure it passes on all platforms.
    +      We currently have about 450 functions in APR and 147 tests.  That
    +      means we have a large number of functions that we can't verify are
    +      actually portable.  This TODO includes finishing the migration to the
    +      unified test suite, and adding more tests to make the suite
    +      comprehensive.
    +
    +    * Eliminate the TODO's and XXX's by using the doxygen @bug feature
    +      to allow us to better track the open issues, and provide historical
    +      bug lists that help porters understand what was wrong in the old
    +      versions of APR that they would be upgrading from.
    +
    +    * Continue to review, deprecate and eliminate from 2.0 all namespace
    +      un-protected names throughout include/apr_foo.h headers.
    +
    +
    +RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
     
         * Need some architecture/OS specific versions of the atomic operations.
     	progress: generic, solaris Sparc, FreeBSD5, linux, and OS/390 done
    @@ -134,8 +125,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
           Beos: apr_thread_rwlock_try*lock()
                 apr_proc_mutex_trylock()
           Unix: apr_thread_rwlock_*() for platforms w/o rwlocks in pthread
    -      Win32: apr_thread_cond_timedwait(), apr_proc_mutex_*() 
    -             (Is proc_mutex unnecessary on Win32?)
     
         * Need to contemplate apr_strftime... platforms vary.  OtherBill
           suggested this solution (but has no time to implement):
    @@ -192,12 +181,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
         * Get OTHER_CHILD support into Win32
             Status: Bill S. is looking into this
     
    -    * Win32 apr_proc_create fails to create 16 bit apps detached
    -      (a win32 bug.)  The question - test in advance (slow) or
    -      recover gracefully from failure and try again?  Only the test
    -      method will work on Win9x, since it will appear to work, only
    -      to encounter mangled pipes.  Win2K (NT?) simply fails.
    -
         * SysV semaphore support isn't usable by Apache when started as
           root because we don't have a way to allow the semaphore to be
           used by the configured User and Group.  Current work-around:
    @@ -232,8 +215,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
           crypt() function is available, and a way to call it (whether it is
           located in libc, libcrypt, or libufc)
           Justin says: Should apr_crypt() be in apr-util?
    -
    -        Status: Greg +1 (volunteers)
    +      Wrowe answers: of course!  It's called openssl DES_fcrypt ;-)
     
         * use os_(un)cork in network_io/unix/sendrecv.c for FreeBSD's
           sendfile implementation.
    @@ -257,13 +239,15 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
           descriptor.  That would allow the new/returned file to be closed
           (via pool cleanup or manually) without accidentally closing
           stderr/out.
    +      wrowe: votes -1, reasons directly manipulate this through APR
     
         * need to export (in code, not just build scripts) the shared
           library extension (e.g. ".so") for the platform. clients need to
           use this to construct filenames to pass to apr_dso_load()
           -- note on Win32 we distinguish 'apache module' names from other 
              'loadable module' names, so be careful with Apache's directive.
    -
    +         AIX, HPUX may use similar (.so for a 'module's name while the
    +         defaults .a or .sl are used for libs.)
         * Possible gmtime_r replacement in explode_time
           On Solaris (and possibly others), the gmtime_r libc function obtains
           a mutex.  We have seen 21/25 threads being blocked in this mutex on 
    @@ -360,8 +344,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
           misc/unix/errorcodes.c to get error reporting working.  Committed as
           the solution is elusive at present.
     
    -    * implement APR_PROGRAM_ENV and APR_PROGRAM_PATH on BeOS, OS/2,
    -      Netware, and Win32.
    +    * implement APR_PROGRAM_ENV and APR_PROGRAM_PATH on BeOS, OS/2, Netware
     
         * stat() on a few platforms (notably Solaris and AIX) succeeds for
           a non-directory even if a trailing '/' was specified in the
    @@ -371,43 +354,10 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
           See OtherBill's comments in this message to dev@httpd.apache.org:
           Message-Id: <5.1.0.14.2.20020315080852.00bce168@localhost>
     
    -Documentation that needs writing:
    -
    -    * API documentation
    -        Ian Says: APR Stuff in now in Doxygen format, which is the first step.
    -        David says: are we planning on doing any more? I'm tempted to remove this
    -                    item.
    -
    -    * apr-site needs to be revamped with Anakia/XHTML.
    -
         * Identify and implement those protection bits that have general 
             usefulness, perhaps hidden, generic read-only [immutable],
             effective current user permissions, etc.
     
    -    * Maybe make the following functions return void instead of
    -      apr_status_t, as they cannot ever error:
    -
    -         apr_md5_init()
    -         apr_md5_update()
    -         apr_md5_final()
    -         apr_md5_encode()
    -         apr_md5()       /* plus make the obvious code tweak in this one */
    -
    -      (Volunteer: Karl Fogel .)
    -
    -      However, don't do this until after apr and apr-util offer
    -      library version numbers, and httpd uses those numbers to
    -      indicate which version it needs.  Until the libraries are
    -      versioned, this api change is [somewhat] painful for httpd.
    -      Status: Still in discussion, current leanings appear to be
    -        Bill Stoddard -0.5 (?)
    -        Sander Striker +1
    -        Greg Stein +1
    -        Karl Fogel +1
    -
    -      david: This was rejected for 1.0 following Ben L's comment that
    -             should we ever start using any other form of md5 (e.g.
    -             openssl) then errors would become a distinct possibility.
     
     Interface Changes Postponed for APR 2.0:
     
    @@ -478,8 +428,6 @@ Interface Changes Postponed for APR 2.0:
     
         * remove APR_POLL_LASTDESC from apr_datatype_e.
     
    -Stuff for post 1.0:
    -
         * Almost every API in APR depends on pools, but pool semantics
           aren't a good match for a lot of applications.  We need to find
           a way to support alternate allocators polymorphically without
    @@ -512,33 +460,14 @@ Stuff for post 1.0:
           relationship.  A strawman has been posted to dev@apr:
           Message-Id: <213031CF0406DE1AC426A411@[10.0.1.137]>
     
    -      This was listed as a showstopper for 1.0, but while the 2 patches above
    -      exist neither was able to garner enough votes to be included in 1.0.
    -      Will Rowe commented that a combination of the 2 would probably be the right
    -      approach, a view that seems to have a lot of merit. Hopefully we can solve
    -      this post 1.0. There were also enough people who felt that it wasn't a
    -      real showstopper for it to be bumped.
    -
    -    * Must namespace protect all include/apr_foo.h headers.  Jon Travis
    -      has especially observed these including apr within Apache-1.3.
    -        Message-ID: <20020128100116.A4288@covalent.net>
    -      Deprecating the symbols in 0.9, eliminating them with 1.0.
    -      (Those problems have been fixed, but it is a good example of
    -      what to look for.)
    -      Some headers with issues:
    -        apr.hnw               (READDIR_IS_THREAD_SAFE, ENUM_BITFIELD,
    -                              _POSIX_THREAD_SAFE_FUNCTIONS (?))
    -
    -    * Flush out the test suite and make sure it passes on all platforms.
    -      We currently have about 450 functions in APR and 147 tests.  That
    -      means we have a large number of functions that we can't verify are
    -      actually portable.  This TODO includes finishing the migration to the
    -      unified test suite, and adding more tests to make the suite
    -      comprehensive.
    -
    -    * Eliminate the TODO's and XXX's by using the doxygen @bug feature
    -      to allow us to better track the open issues, and provide historical
    -      bug lists that help porters understand what was wrong in the old
    -      versions of APR that they would be upgrading from.
    +    * The return type of a thread function (void *) is inconsistent with
    +      the type used in apr_thread_exit()/apr_thread_join() (apr_status_t).
    +      The thread function's return type should be changed to apr_status_t
    +      so that a return from the thread main function has the same effect
    +      as apr_thread_exit().
    +      See Message-Id:  for thread
    +      discussing this.
    +        +1: BrianH, Aaron, david, jerenkrantz
    +      Status: Deferred to 2.0.0 (API change)
     
     
    
    From fcf2f6d52997a198eb1f62d222ab995dc6f98a51 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 6 Nov 2007 06:53:07 +0000
    Subject: [PATCH 6089/7878] Whitespace, add an item
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592313 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 5 +++++
     1 file changed, 5 insertions(+)
    
    diff --git a/STATUS b/STATUS
    index d5fdd15b032..347f448bd4c 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -149,6 +149,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
             library? It is perfectly legitimate to have apps needing
             both versions (threaded/reentrant and non-threaded/non-reentrant)
             on the same machine.
    +        Wrowe chuckles, uhm, it already is.  And seems most have shifted
    +        to shipping threaded builds, of at least apr itself.
     
         * Pools debugging
             - Find a way to do check if a pool is used in multiple
    @@ -248,6 +250,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
              'loadable module' names, so be careful with Apache's directive.
              AIX, HPUX may use similar (.so for a 'module's name while the
              defaults .a or .sl are used for libs.)
    +
         * Possible gmtime_r replacement in explode_time
           On Solaris (and possibly others), the gmtime_r libc function obtains
           a mutex.  We have seen 21/25 threads being blocked in this mutex on 
    @@ -358,6 +361,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
             usefulness, perhaps hidden, generic read-only [immutable],
             effective current user permissions, etc.
     
    +    * dso getsym implementation are becoming very strict about returning
    +      a fn pointer v.s. a data pointer, this should be split in apr_dso.
     
     Interface Changes Postponed for APR 2.0:
     
    
    From 7bdc5cc0b95c7bef72c50e62e4c1cf30fad6483c Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 7 Nov 2007 06:47:04 +0000
    Subject: [PATCH 6090/7878] In the style of apr-util/Makefile.win (and lighter
     weight), bless building apr all by it's lonesome for win32.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592629 13f79535-47bb-0310-9956-ffa450edef68
    ---
     Makefile.win | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++
     1 file changed, 180 insertions(+)
     create mode 100644 Makefile.win
    
    diff --git a/Makefile.win b/Makefile.win
    new file mode 100644
    index 00000000000..60377970d15
    --- /dev/null
    +++ b/Makefile.win
    @@ -0,0 +1,180 @@
    +# Makefile.win for Win32 APR alone
    +#
    +# Targets are:
    +#
    +#     buildall - compile everything
    +#     checkall - run APR regression tests
    +#     install  - compile everything
    +#     clean    - mop up everything
    +#
    +# You can override the build mechansim, choose only one;
    +#
    +#     USEMAK=1 - compile from exported make files
    +#     USEDSW=1 - compile from .dsw / .dsp VC6 projects
    +#     USESLN=1 - compile from converted .sln / .vcproj VC7+ files
    +#
    +# Define ARCH to your desired preference (your PATH must point
    +# to the correct compiler tools!)  Choose only one;
    +#
    +#     ARCH="Win32 Release"
    +#     ARCH="Win32 Debug"
    +#     ARCH="Win32 Release9x"
    +#     ARCH="Win32 Debug9x"
    +#     ARCH="x64 Release"
    +#     ARCH="x64 Debug"
    +#
    +# For example;
    +#
    +#   nmake -f Makefile.win PREFIX=C:\APR buildall checkall installall clean
    +#
    +
    +!IF EXIST("apr.sln") && ([devenv /help > NUL 2>&1] == 0) \
    +    && !defined(USEMAK) && !defined(USEDSW)
    +USESLN=1
    +USEMAK=0
    +USEDSW=0
    +!ELSEIF EXIST("apr.mak") && !defined(USEDSW)
    +USESLN=0
    +USEMAK=1
    +USEDSW=0
    +!ELSE
    +USESLN=0
    +USEMAK=0
    +USEDSW=1
    +!ENDIF
    +
    +PREFIX=..\apr-dist
    +
    +!IF [$(COMSPEC) /c cl /nologo /? | find "x64" >NUL ] == 0
    +ARCH=x64 Release
    +!ELSE
    +ARCH=Win32 Release
    +!ENDIF
    +
    +!MESSAGE ARCH        = $(ARCH)
    +!MESSAGE PREFIX      = $(PREFIX)  (install path)
    +
    +
    +# Utility and Translation things, nothing here for the user
    +#
    +!IF "$(ARCH)" == "Win32 Release"
    +SLNARCH=Release|Win32
    +ARCHOSPATH=Release
    +LIBSOSPATH=LibR
    +!ELSEIF "$(ARCH)" == "Win32 Debug"
    +SLNARCH=Debug|Win32
    +ARCHOSPATH=Debug
    +LIBSOSPATH=LibD
    +!ELSEIF "$(ARCH)" == "Win32 Release9x"
    +SLNARCH=Release9x|Win32
    +ARCHOSPATH=9x\Release
    +LIBSOSPATH=9x\LibR
    +!ELSEIF "$(ARCH)" == "Win32 Debug9x"
    +SLNARCH=Debug9x|Win32
    +ARCHOSPATH=9x\Debug
    +LIBSOSPATH=9x\LibD
    +!ELSEIF "$(ARCH)" == "x64 Release"
    +SLNARCH=Release|x64
    +ARCHOSPATH=x64\Release
    +LIBSOSPATH=x64\LibR
    +!ELSEIF "$(ARCH)" == "x64 Debug"
    +SLNARCH=Debug|x64
    +ARCHOSPATH=x64\Debug
    +LIBSOSPATH=x64\LibD
    +!ENDIF
    +
    +!IFNDEF MAKEOPT
    +# Only default the behavior if MAKEOPT= is omitted
    +!IFDEF _NMAKE_VER
    +# Microsoft NMake options
    +MAKEOPT=-nologo
    +!ELSEIF "$(MAKE)" == "make"
    +# Borland make options?  Not really supported (yet)
    +MAKEOPT=-s -N
    +!ENDIF
    +!ENDIF
    +
    +
    +all: buildall checkall
    +
    +!IF $(USEMAK) == 1
    +
    +clean:
    +	$(MAKE) $(MAKEOPT) -f Makefile.win ARCH="$(ARCH)" \
    +		CTARGET=CLEAN buildall
    +
    +buildall:
    +	$(MAKE) $(MAKEOPT) -f apr.mak         CFG="apr - $(ARCH)" RECURSE=0 $(CTARGET)
    +	$(MAKE) $(MAKEOPT) -f libapr.mak      CFG="libapr - $(ARCH)" RECURSE=0 $(CTARGET)
    +	cd build
    +	 $(MAKE) $(MAKEOPT) -f aprapp.mak     CFG="aprapp - $(ARCH)" RECURSE=0 $(CTARGET)
    +	 $(MAKE) $(MAKEOPT) -f libaprapp.mak  CFG="libaprapp - $(ARCH)" RECURSE=0 $(CTARGET)
    +	cd ..
    +
    +!ELSEIF $(USESLN) == 1
    +
    +clean:
    +	-devenv apr.sln /useenv /clean "$(SLNARCH)" /project libaprapp
    +	-devenv apr.sln /useenv /clean "$(SLNARCH)" /project libapr
    +	-devenv apr.sln /useenv /clean "$(SLNARCH)" /project aprapp
    +	-devenv apr.sln /useenv /clean "$(SLNARCH)" /project apr
    +
    +buildall:
    +	devenv apr.sln /useenv /build "$(SLNARCH)" /project apr
    +	devenv apr.sln /useenv /build "$(SLNARCH)" /project aprapp
    +	devenv apr.sln /useenv /build "$(SLNARCH)" /project libapr
    +	devenv apr.sln /useenv /build "$(SLNARCH)" /project libaprapp
    +
    +!ELSE
    +#	$(USEDSP) == 1
    +
    +clean:
    +	-msdev apr.dsw /USEENV /MAKE "libaprapp - $(ARCH)" /CLEAN
    +	-msdev apr.dsw /USEENV /MAKE "libapr - $(ARCH)" /CLEAN
    +	-msdev apr.dsw /USEENV /MAKE "aprapp - $(ARCH)" /CLEAN
    +	-msdev apr.dsw /USEENV /MAKE "apr - $(ARCH)" /CLEAN
    +
    +buildall:
    +	@msdev apr.dsw /USEENV /MAKE "apr - $(ARCH)"
    +	@msdev apr.dsw /USEENV /MAKE "aprapp - $(ARCH)"
    +	@msdev apr.dsw /USEENV /MAKE "libapr - $(ARCH)"
    +	@msdev apr.dsw /USEENV /MAKE "libaprapp - $(ARCH)"
    +
    +!ENDIF
    +
    +
    +checkapr:
    +	cd test
    +	 $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=static \
    +		OUTDIR=$(LIBSOSPATH) check
    +	 $(MAKE) $(MAKEOPT) -f Makefile.win MODEL=dynamic \
    +		OUTDIR=$(ARCHOSPATH) check
    +	 cd ..
    +
    +checkall: checkapr
    +
    +
    +install:
    +	echo Y >.y
    +	echo A >.A
    +	@if NOT EXIST "$(PREFIX)\."		mkdir "$(PREFIX)"
    +	@if NOT EXIST "$(PREFIX)\bin\."		mkdir "$(PREFIX)\bin"
    +	@if NOT EXIST "$(PREFIX)\include\."	mkdir "$(PREFIX)\include"
    +	@if NOT EXIST "$(PREFIX)\lib\."		mkdir "$(PREFIX)\lib"
    +	copy CHANGES "$(PREFIX)\CHANGES.txt" <.y
    +	copy LICENSE "$(PREFIX)\LICENSE.txt" <.y
    +	copy NOTICE  "$(PREFIX)\NOTICE.txt"  <.y
    +	xcopy include\*.h		"$(PREFIX)\include\" /d < .a
    +	copy $(LIBSOSPATH)\apr-1.lib		"$(PREFIX)\lib\" <.y
    +	copy $(LIBSOSPATH)\apr-1.pdb		"$(PREFIX)\lib\" <.y
    +	copy $(LIBSOSPATH)\aprapp-1.lib		"$(PREFIX)\lib\" <.y
    +	copy $(LIBSOSPATH)\aprapp-1.pdb		"$(PREFIX)\lib\" <.y
    +	copy $(LIBSOSPATH)\libaprapp-1.lib	"$(PREFIX)\lib\" <.y
    +	copy $(LIBSOSPATH)\libaprapp-1.pdb	"$(PREFIX)\lib\" <.y
    +	copy $(ARCHOSPATH)\libapr-1.lib		"$(PREFIX)\lib\" <.y
    +	copy $(ARCHOSPATH)\libapr-1.exp		"$(PREFIX)\lib\" <.y
    +	copy $(ARCHOSPATH)\libapr-1.dll		"$(PREFIX)\bin\" <.y
    +	copy $(ARCHOSPATH)\libapr-1.pdb		"$(PREFIX)\bin\" <.y
    +	del .y
    +	del .a
    +
    
    From 701a346caeecc8b43ffce3702f7f4754a3bea624 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 7 Nov 2007 07:11:23 +0000
    Subject: [PATCH 6091/7878] Unix commentary for end users and developers.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592641 13f79535-47bb-0310-9956-ffa450edef68
    ---
     README.dev | 74 ++++++++++++++++++++++++++++++++++++++++--------------
     1 file changed, 55 insertions(+), 19 deletions(-)
    
    diff --git a/README.dev b/README.dev
    index 03fcc0ed20e..9f2f8be9232 100644
    --- a/README.dev
    +++ b/README.dev
    @@ -1,30 +1,66 @@
     Apache Portable Runtime
     =======================
     
    -If you are building APR from SVN, you need to use a slightly non-standard
    -build process.  You must have autoconf and libtool installed for this to
    -work.  There are three steps:
     
    -1) ./buildconf
    -2) ./configure
    -3) make
    +Using a Subversion Checkout on Unix
    +===================================
     
    -If you are building APR from a distribution tarball, buildconf will have
    -already been run for you, and you therefore do not need to have either
    -autoconf or libtool installed, and you do not need to run buildconf.  Skip
    -step one above and just run configure then make.
    +If you are building APR from SVN, you need to perform a prerequisite
    +step.  You must have autoconf, libtool and python installed for this 
    +to work.  The prerequisite is simply;
     
    -Generating Test Coverage information
    +  ./buildconf
    +
    +If you are building APR from a distribution tarball, buildconf is
    +already run for you, and you do not need autoconf, libtool or python
    +installed or to run buildconf unless you have patched APR's buildconf 
    +inputs (such as configure.in, build.conf, virtually any file within 
    +the build/ tree, or you add or remove source files).
    +
    +Remember when updating from svn that you must rerun ./buildconf again 
    +to effect any changes made to the build schema in your fresh update.
    +
    +
    +Configuring and Building APR on Unix
     ====================================
     
    +Simply;
    +
    +   ./configure --prefix=/desired/path/of/apr
    +   make
    +   make test
    +   make install
    +
    +Configure has additional options, ./configure --help will offer you
    +those choices.  You may also add CC=compiler CFLAGS="compiler flags"
    +etc. prior to the ./configure statement (on the same line).  Please
    +be warned, some flags must be passed as part of the CC command,
    +itself, in order for autoconf to make the right determinations. Eg.;
    +
    +  CC="gcc -m64" ./configure --prefix=/desired/path/of/apr
    +
    +will inform APR that you are compiling to a 64 bit CPU, and autoconf
    +must consider that when setting up all of APR's internal and external
    +type declarations.
    +
    +For more verbose output from testall, you may wish to invoke testall
    +with the flag;
    +
    +   cd test
    +   ./testall -v
    +
    +
    +Generating Test Coverage information with gcc
    +=============================================
    +
     If you want to generate test coverage data, use the following steps:
     
    -1) ./buildconf
    -2) CFLAGS="-fprofile-arcs -ftest-coverage" ./configure
    -3) make
    -4) cd test
    -5) make
    -6) ./testall
    -7) cd ..
    -8) make gcov
    +  ./buildconf
    +  CFLAGS="-fprofile-arcs -ftest-coverage" ./configure
    +  make
    +  cd test
    +  make
    +  ./testall
    +  cd ..
    +  make gcov
     
    
    From 28020c6f5ebf5c60d0413903eb0f465141472794 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 7 Nov 2007 07:20:30 +0000
    Subject: [PATCH 6092/7878] The four most common win32 apr questions, answered.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592642 13f79535-47bb-0310-9956-ffa450edef68
    ---
     README.dev | 31 +++++++++++++++++++++++++++++++
     1 file changed, 31 insertions(+)
    
    diff --git a/README.dev b/README.dev
    index 9f2f8be9232..1b5cbcccd1c 100644
    --- a/README.dev
    +++ b/README.dev
    @@ -50,6 +50,37 @@ with the flag;
        ./testall -v
     
     
    +Configuring and Building APR on Windows
    +=======================================
    +
    +Using Visual Studio, you can build and run the test validation of APR.
    +The Makefile.win make file has a bunch of documentation about it's
    +options, but a trivial build is simply;
    +
    +  nmake -f Makefile.win 
    +  nmake -f Makefile.win PREFIX=c:\desired\path\of\apr install
    +
    +Note you must manually modify the include\apr.hw file before you
    +build to change default options, see the #define APR_HAS_... or the
    +#define APR_HAVE_... statements.  Be careful, many of these aren't
    +appropriate to be modified.  The most common change is 
    +
    +#define APR_HAVE_IPV6           1
    +
    +rather than 0 if this build of APR will be used strictly on machines
    +with the IPv6 adapter support installed.
    +
    +It's trivial to include the apr.dsp (for a static library) or the
    +libapr.dsp (for a dynamic library) in your own build project, or you
    +can load apr.dsw in Visual Studio 2002 (.NET) or later, which will
    +convert these for you into apr.sln and associated .vcproj files.
    +
    +When using APR as a dynamic library, nothing special is required,
    +simply link to libapr.lib.  To use it as a static library, simply 
    +define APR_DECLARE_STATIC before you include any apr header files 
    +in your source, and link to apr.lib instead.
    +
    +
     Generating Test Coverage information with gcc
     =============================================
     
    
    From 4c7de78cad3d1c74e1d823740d77ed78df681fa4 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 8 Nov 2007 00:21:01 +0000
    Subject: [PATCH 6093/7878] Catch a flaw on Win32 x64 platforms
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592967 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/win32/apr_arch_misc.h | 16 ++++++----------
     1 file changed, 6 insertions(+), 10 deletions(-)
    
    diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h
    index b22353a5325..3987d85cb3c 100644
    --- a/include/arch/win32/apr_arch_misc.h
    +++ b/include/arch/win32/apr_arch_misc.h
    @@ -348,16 +348,13 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtSetTimerResolution, 0, (
         (ReqRes, Acquire, pNewRes));
     #define SetTimerResolution apr_winapi_NtSetTimerResolution
     
    -/* ### These are ULONG_PTR values, but that's int32 for all we care
    - * until the Win64 port is prepared.
    - */
     typedef struct PBI {
    -    DWORD ExitStatus;
    -    PVOID PebBaseAddress;
    -    ULONG AffinityMask;
    -    LONG  BasePriority;
    -    ULONG UniqueProcessId;
    -    ULONG InheritedFromUniqueProcessId;
    +    LONG      ExitStatus;
    +    PVOID     PebBaseAddress;
    +    ULONG_PTR AffinityMask;
    +    LONG      BasePriority;
    +    ULONG_PTR UniqueProcessId;
    +    ULONG_PTR InheritedFromUniqueProcessId;
     } PBI, *PPBI;
     
     APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryInformationProcess, 0, (
    @@ -381,4 +378,3 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryObject, 0, (
     #endif /* !defined(_WIN32_WCE) */
     
     #endif  /* ! MISC_H */
    -
    
    From ac9c9bea57a1b40e5528b41e5c9428fa2d862f62 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 8 Nov 2007 00:23:38 +0000
    Subject: [PATCH 6094/7878] Learn the appropriate csize Allocation magic
     applicable to Windows 2000 (when sparse was introduced) and later.
    
    This reverts a bogus test case.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592970 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filestat.c           |  9 ++++++++-
     file_io/win32/open.c               | 28 +++++++++++++++++++---------
     include/arch/win32/apr_arch_misc.h | 25 +++++++++++++++++++++++++
     test/testlfs.c                     |  5 ++---
     4 files changed, 54 insertions(+), 13 deletions(-)
    
    diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
    index f008876548a..f409fc247c1 100644
    --- a/file_io/win32/filestat.c
    +++ b/file_io/win32/filestat.c
    @@ -304,7 +304,14 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile,
                  *   http://go.microsoft.com/fwlink/?linkid=84083
                  * you probably understand why APR chooses not to implement.
                  */
    -            ;
    +            IOSB sb;
    +            FSI fi;
    +            if ((ZwQueryInformationFile((HANDLE)ufile, &sb, 
    +                                       &fi, sizeof(fi), 5) == 0) 
    +                    && (sb.Status == 0)) {
    +                finfo->csize = fi.AllocationSize;
    +                finfo->valid |= APR_FINFO_CSIZE;
    +            }
             }
             else {
                 SetLastError(NO_ERROR);
    diff --git a/file_io/win32/open.c b/file_io/win32/open.c
    index 09acd20f397..d2768a8a258 100644
    --- a/file_io/win32/open.c
    +++ b/file_io/win32/open.c
    @@ -221,6 +221,9 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool)
     #endif
     }
     
    +#if APR_HAS_UNICODE_FS
    +    IF_WIN_OS_IS_UNICODE
    +    {
     static apr_status_t make_sparse_file(apr_file_t *file)
     {
         BY_HANDLE_FILE_INFORMATION info;
    @@ -270,6 +273,7 @@ static apr_status_t make_sparse_file(apr_file_t *file)
         }
         return rv;
     }
    +#endif
     
     apr_status_t file_cleanup(void *thefile)
     {
    @@ -421,8 +425,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname,
         ELSE_WIN_OS_IS_ANSI {
             handle = CreateFileA(fname, oflags, sharemode,
                                  NULL, createflags, attributes, 0);
    -        /* These features are not supported on this platform. */
    -        flag &= ~(APR_SENDFILE_ENABLED | APR_FOPEN_SPARSE);
    +        /* This feature is not supported on this platform. */
    +        flag &= ~APR_SENDFILE_ENABLED
         }
     #endif
         if (handle == INVALID_HANDLE_VALUE) {
    @@ -458,14 +462,20 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname,
             }
         }
     
    -    if ((*new)->flags & APR_FOPEN_SPARSE) {
    -        if ((rv = make_sparse_file(*new)) != APR_SUCCESS)
    -            /* The great mystery; do we close the file and return an error?
    -             * Do we add a new APR_INCOMPLETE style error saying opened, but
    -             * NOTSPARSE?  For now let's simply mark the file as not-sparse.
    -             */
    -            (*new)->flags &= ~APR_FOPEN_SPARSE;
    +#if APR_HAS_UNICODE_FS
    +    if ((apr_os_level >= APR_WIN_2000) && ((*new)->flags & APR_FOPEN_SPARSE)) {
    +            if ((rv = make_sparse_file(*new)) != APR_SUCCESS)
    +                /* The great mystery; do we close the file and return an error?
    +                 * Do we add a new APR_INCOMPLETE style error saying opened, but
    +                 * NOTSPARSE?  For now let's simply mark the file as not-sparse.
    +                 */
    +                (*new)->flags &= ~APR_FOPEN_SPARSE;
    +        }
         }
    +    else
    +#endif
    +        /* This feature is not supported on this platform. */
    +        (*new)->flags &= ~APR_FOPEN_SPARSE;
     
         /* Create a pollset with room for one descriptor. */
         /* ### check return codes */
    diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h
    index 3987d85cb3c..75cb17a9d36 100644
    --- a/include/arch/win32/apr_arch_misc.h
    +++ b/include/arch/win32/apr_arch_misc.h
    @@ -375,6 +375,31 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryObject, 0, (
         (hObject, info, pOI, LenOI, pSizeOI));
     #define QueryObject apr_winapi_NtQueryObject
     
    +typedef struct IOSB {
    +    union {
    +    UINT Status;
    +    PVOID reserved;
    +    };
    +    ULONG_PTR Information; /* Varies by op, consumed buffer size for FSI below */
    +} IOSB, *PIOSB;
    +
    +typedef struct FSI {
    +    LONGLONG AllocationSize;
    +    LONGLONG EndOfFile;
    +    ULONG    NumberOfLinks;
    +    BOOL     DeletePending;
    +    BOOL     Directory;
    +} FSI, *PFSI;
    +
    +APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, ZwQueryInformationFile, 0, (
    +    HANDLE hObject,    /* Obvious */
    +    PVOID  pIOSB,      /* Point to the IOSB buffer for detailed return results */
    +    PVOID  pFI,        /* The buffer, using FIB above */
    +    ULONG  LenFI,      /* Use sizeof(FI) */
    +    ULONG  info),      /* Use 5 for FSI documented above*/
    +    (hObject, pIOSB, pFI, LenFI, info));
    +#define ZwQueryInformationFile apr_winapi_ZwQueryInformationFile
    +
     #endif /* !defined(_WIN32_WCE) */
     
     #endif  /* ! MISC_H */
    diff --git a/test/testlfs.c b/test/testlfs.c
    index b9cc5d5a708..13bff9bc4cb 100644
    --- a/test/testlfs.c
    +++ b/test/testlfs.c
    @@ -66,13 +66,12 @@ static void test_open(abts_case *tc, void *data)
     
         if (rv == APR_SUCCESS) {
             rv = apr_file_info_get(&testsize, APR_FINFO_CSIZE, f);
    -        if (rv == APR_INCOMPLETE)
    -            rv = apr_stat(&testsize, TESTFN, APR_FINFO_CSIZE, p);
         }
     
         /* give up if we can't determine the allocation size of the file,
          * or if it's not an obviously small allocation but the allocation
    -     * unit doesn't appear insanely large
    +     * unit doesn't appear insanely large - on most platforms, it's just
    +     * zero physical bytes at this point.
          */
         if (rv != APR_SUCCESS || (testsize.csize > oneMB
                                   && testsize.csize < oneMB * 2)) {
    
    From f282bedfdbcb6da86f34fe2779332097dc2a91a1 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 8 Nov 2007 00:28:37 +0000
    Subject: [PATCH 6095/7878] Note API changes and support enhancements.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592973 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 12 +++++++++++-
     1 file changed, 11 insertions(+), 1 deletion(-)
    
    diff --git a/CHANGES b/CHANGES
    index 88f12b12304..fee84fb81ec 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,6 +1,16 @@
    -                                                     -*- coding: utf-8 -*-
    +                                                     -*- coding: utf-8 -*-
     Changes for APR 1.3.0
     
    +  *) Implement Darwin-semantic (9.0.0 and later) sendfile support.
    +     [William Rowe]
    +
    +  *) Implemented the APR_FOPEN_SPARSE flag, permits win32 to create
    +     sparse data files.  Also bestow apr_fileinfo_t csize field for
    +     Windows versions 2000 and later, which helps in the detection
    +     that a sparse file is truly in use (see test/testlfs.c for an
    +     example, because different filesystems can vary in behavior
    +     even on an OS supporting sparse files).  [William Rowe]
    +
       *) Corrected for Darwin and others to toggle APR_HAS_LARGE_FILES
          where large off_t's are enabled without any extra defines, hints
          or additional functions.  This is binary compatible, but apps
    
    From e5841d876c9a671b7f405acb230a2a0d74a76d02 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 8 Nov 2007 00:29:18 +0000
    Subject: [PATCH 6096/7878] Clarity (follows trunk/ STATUS).
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592974 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/STATUS b/STATUS
    index 347f448bd4c..103d24249f1 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -80,7 +80,7 @@ CURRENT test/testall -v EXCEPTIONS:
             sockopt: TCP isn't corkable
             users: username: Groups from apr_uid_get not implemented
     
    -    * Win32 tests are known to fail when APR_HAVE_IPV6 but there is no
    +    * Win32 tests are known to fail when APR_HAVE_IPV6, but there is no
           ipv6 adapter is loaded (even loopback is sufficient).  There are
           obnoxious getaddrinfo() missing results from looking up a fixed
           IPv4-IPv6 mixed notation address, which reflect a Win32 bug.
    
    From 97cf6b4fd9218500453a064110d31dfc324f7709 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 8 Nov 2007 00:32:21 +0000
    Subject: [PATCH 6097/7878] Fix two typos, I had continued to simplify this
     throughout it's development and left in this cruft.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@592976 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/open.c | 15 ++++++---------
     1 file changed, 6 insertions(+), 9 deletions(-)
    
    diff --git a/file_io/win32/open.c b/file_io/win32/open.c
    index d2768a8a258..b0d84d87b56 100644
    --- a/file_io/win32/open.c
    +++ b/file_io/win32/open.c
    @@ -222,8 +222,6 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool)
     }
     
     #if APR_HAS_UNICODE_FS
    -    IF_WIN_OS_IS_UNICODE
    -    {
     static apr_status_t make_sparse_file(apr_file_t *file)
     {
         BY_HANDLE_FILE_INFORMATION info;
    @@ -464,13 +462,12 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname,
     
     #if APR_HAS_UNICODE_FS
         if ((apr_os_level >= APR_WIN_2000) && ((*new)->flags & APR_FOPEN_SPARSE)) {
    -            if ((rv = make_sparse_file(*new)) != APR_SUCCESS)
    -                /* The great mystery; do we close the file and return an error?
    -                 * Do we add a new APR_INCOMPLETE style error saying opened, but
    -                 * NOTSPARSE?  For now let's simply mark the file as not-sparse.
    -                 */
    -                (*new)->flags &= ~APR_FOPEN_SPARSE;
    -        }
    +        if ((rv = make_sparse_file(*new)) != APR_SUCCESS)
    +            /* The great mystery; do we close the file and return an error?
    +             * Do we add a new APR_INCOMPLETE style error saying opened, but
    +             * NOTSPARSE?  For now let's simply mark the file as not-sparse.
    +             */
    +            (*new)->flags &= ~APR_FOPEN_SPARSE;
         }
         else
     #endif
    
    From 24dcce123fa608b3187441cf1f55b6c90072b42f Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 8 Nov 2007 14:28:50 +0000
    Subject: [PATCH 6098/7878] Fix DSO-related crash on z/OS caused by incorrect
     memory allocation.
    
    Submitted by: David Jones 
    Reviewed by:  trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@593166 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES         | 3 +++
     dso/os390/dso.c | 2 +-
     2 files changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/CHANGES b/CHANGES
    index fee84fb81ec..79919903deb 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 1.3.0
     
    +  *) Fix DSO-related crash on z/OS caused by incorrect memory
    +     allocation.  [David Jones ]
    +
       *) Implement Darwin-semantic (9.0.0 and later) sendfile support.
          [William Rowe]
     
    diff --git a/dso/os390/dso.c b/dso/os390/dso.c
    index 293d0653e75..034ffe843f5 100644
    --- a/dso/os390/dso.c
    +++ b/dso/os390/dso.c
    @@ -63,7 +63,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle,
         dllhandle *handle;
         int rc;
     
    -    *res_handle = apr_pcalloc(ctx, sizeof(*res_handle));
    +    *res_handle = apr_pcalloc(ctx, sizeof(**res_handle));
         (*res_handle)->pool = ctx;
         if ((handle = dllload(path)) != NULL) {
             (*res_handle)->handle  = handle;
    
    From 8ea24cee91954216a0d461053feb78ef920f3d03 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sun, 18 Nov 2007 00:27:32 +0000
    Subject: [PATCH 6099/7878] check that the library function succeeded, not that
     APR_SUCCESS == 0
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@596027 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testnames.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/test/testnames.c b/test/testnames.c
    index b39d1080de4..ae650b190aa 100644
    --- a/test/testnames.c
    +++ b/test/testnames.c
    @@ -78,7 +78,7 @@ static void merge_dotdot(abts_case *tc, void *data)
         ABTS_STR_EQUAL(tc, ABS_ROOT"foo/baz", dstpath);
     
         rv = apr_filepath_merge(&dstpath, "", "../test", 0, p);
    -    ABTS_INT_EQUAL(tc, 0, APR_SUCCESS);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_STR_EQUAL(tc, "../test", dstpath);
     
         /* Very dangerous assumptions here about what the cwd is.  However, let's assume
    @@ -87,7 +87,7 @@ static void merge_dotdot(abts_case *tc, void *data)
          * the case of the test directory:
          */
         rv = apr_filepath_merge(&dstpath, "", "../test", APR_FILEPATH_TRUENAME, p);
    -    ABTS_INT_EQUAL(tc, 0, APR_SUCCESS);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_STR_EQUAL(tc, "../test", dstpath);
     }
     
    
    From 998a0eec05ed6819a37897de0391fac8527fe360 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sun, 18 Nov 2007 00:35:57 +0000
    Subject: [PATCH 6100/7878] fix some obvious reversals of expected and actual
     values in invocations of ABTS_INT_EQUAL et al
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@596028 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testatomic.c  | 10 +++++-----
     test/testcond.c    |  4 ++--
     test/testfmt.c     |  6 +++---
     test/testfnmatch.c |  4 ++--
     test/testipsub.c   |  2 +-
     test/testmmap.c    | 10 +++++-----
     test/testpools.c   |  4 ++--
     test/teststr.c     |  6 +++---
     test/testtable.c   | 36 ++++++++++++++++++------------------
     test/testud.c      | 14 +++++++-------
     10 files changed, 48 insertions(+), 48 deletions(-)
    
    diff --git a/test/testatomic.c b/test/testatomic.c
    index 0d09d004e09..cfea2a62ca3 100644
    --- a/test/testatomic.c
    +++ b/test/testatomic.c
    @@ -289,9 +289,9 @@ static void test_atomics_threaded(abts_case *tc, void *data)
                         s1 == exit_ret_val && s2 == exit_ret_val);
         }
     
    -    ABTS_INT_EQUAL(tc, mutex_locks, NUM_THREADS * NUM_ITERATIONS);
    -    ABTS_INT_EQUAL(tc, apr_atomic_read32(&atomic_ops),
    -                   NUM_THREADS * NUM_ITERATIONS);
    +    ABTS_INT_EQUAL(tc, NUM_THREADS * NUM_ITERATIONS, mutex_locks);
    +    ABTS_INT_EQUAL(tc, NUM_THREADS * NUM_ITERATIONS,
    +                   apr_atomic_read32(&atomic_ops));
     
         rv = apr_thread_mutex_destroy(thread_lock);
         ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS);
    @@ -375,7 +375,7 @@ static void busyloop_dec32(tbox_t *tbox)
             busyloop_read32(tbox);
             val = apr_atomic_dec32(tbox->mem);
             apr_thread_mutex_lock(thread_lock);
    -        ABTS_INT_NEQUAL(tbox->tc, val, 0);
    +        ABTS_INT_NEQUAL(tbox->tc, 0, val);
             apr_thread_mutex_unlock(thread_lock);
         } while (--tbox->loop);
     }
    @@ -483,7 +483,7 @@ static void test_atomics_busyloop_threaded(abts_case *tc, void *data)
             ABTS_ASSERT(tc, "Invalid return value from thread_join", retval == 0);
         }
     
    -    ABTS_INT_EQUAL(tbox->tc, count, 98);
    +    ABTS_INT_EQUAL(tbox->tc, 98, count);
     
         rv = apr_thread_mutex_destroy(thread_lock);
         ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS);
    diff --git a/test/testcond.c b/test/testcond.c
    index a8b7b82182b..b5a20bc46dc 100644
    --- a/test/testcond.c
    +++ b/test/testcond.c
    @@ -25,7 +25,7 @@
     
     #define NTHREADS 10
     
    -#define ABTS_SUCCESS(rv)    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS)
    +#define ABTS_SUCCESS(rv)    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv)
     
     #if APR_HAS_THREADS
     
    @@ -249,7 +249,7 @@ static void broadcast_threads(abts_case *tc, void *data)
             ABTS_SUCCESS(rv);
         }
     
    -    ABTS_INT_EQUAL(tc, count, 0);
    +    ABTS_INT_EQUAL(tc, 0, count);
     
         rv = apr_thread_cond_destroy(cond);
         ABTS_SUCCESS(rv);
    diff --git a/test/testfmt.c b/test/testfmt.c
    index d06726a68a7..97dc9634bfc 100644
    --- a/test/testfmt.c
    +++ b/test/testfmt.c
    @@ -105,16 +105,16 @@ static void more_int64_fmts(abts_case *tc, void *data)
         apr_uint64_t big = APR_UINT64_C(10267677267010969076);
     
         apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, i);
    -    ABTS_STR_EQUAL(tc, buf, "-42");
    +    ABTS_STR_EQUAL(tc, "-42", buf);
     
         apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, ui);
    -    ABTS_STR_EQUAL(tc, buf, "42");
    +    ABTS_STR_EQUAL(tc, "42", buf);
     
         apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, big);
         ABTS_STR_EQUAL(tc, "10267677267010969076", buf);
     
         apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, ibig);
    -    ABTS_STR_EQUAL(tc, buf, "-314159265358979323");
    +    ABTS_STR_EQUAL(tc, "-314159265358979323", buf);
     }
     
     static void error_fmt(abts_case *tc, void *data)
    diff --git a/test/testfnmatch.c b/test/testfnmatch.c
    index b54502fd295..379619887d1 100644
    --- a/test/testfnmatch.c
    +++ b/test/testfnmatch.c
    @@ -39,7 +39,7 @@ static void test_glob(abts_case *tc, void *data)
         list = (char **)result->elts;
         for (i = 0; i < result->nelts; i++) {
             char *dot = strrchr(list[i], '.');
    -        ABTS_STR_EQUAL(tc, dot, ".txt");
    +        ABTS_STR_EQUAL(tc, ".txt", dot);
         }
     }
     
    @@ -59,7 +59,7 @@ static void test_glob_currdir(abts_case *tc, void *data)
         list = (char **)result->elts;
         for (i = 0; i < result->nelts; i++) {
             char *dot = strrchr(list[i], '.');
    -        ABTS_STR_EQUAL(tc, dot, ".txt");
    +        ABTS_STR_EQUAL(tc, ".txt", dot);
         }
         apr_filepath_set("..", p);
     }
    diff --git a/test/testipsub.c b/test/testipsub.c
    index ea29487e7c3..8fd36721dd5 100644
    --- a/test/testipsub.c
    +++ b/test/testipsub.c
    @@ -68,7 +68,7 @@ static void test_bad_input(abts_case *tc, void *data)
     
         for (i = 0; i < (sizeof testcases / sizeof testcases[0]); i++) {
             rv = apr_ipsubnet_create(&ipsub, testcases[i].ipstr, testcases[i].mask, p);
    -        ABTS_INT_EQUAL(tc, rv, testcases[i].expected_rv);
    +        ABTS_INT_EQUAL(tc, testcases[i].expected_rv, rv);
         }
     }
     
    diff --git a/test/testmmap.c b/test/testmmap.c
    index f09d857b7f5..ee87b3bfc4b 100644
    --- a/test/testmmap.c
    +++ b/test/testmmap.c
    @@ -66,7 +66,7 @@ static void test_file_close(abts_case *tc, void *data)
         apr_status_t rv;
     
         rv = apr_file_close(thefile);
    -    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     }
        
     static void test_file_open(abts_case *tc, void *data)
    @@ -74,7 +74,7 @@ static void test_file_open(abts_case *tc, void *data)
         apr_status_t rv;
     
         rv = apr_file_open(&thefile, file1, APR_READ, APR_UREAD | APR_GREAD, p);
    -    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_PTR_NOTNULL(tc, thefile);
     }
        
    @@ -83,7 +83,7 @@ static void test_get_filesize(abts_case *tc, void *data)
         apr_status_t rv;
     
         rv = apr_file_info_get(&thisfinfo, APR_FINFO_NORM, thefile);
    -    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_ASSERT(tc, "File size mismatch", thisfsize == thisfinfo.size);
     }
     
    @@ -94,7 +94,7 @@ static void test_mmap_create(abts_case *tc, void *data)
         rv = apr_mmap_create(&themmap, thefile, 0, (apr_size_t) thisfinfo.size, 
     		                 APR_MMAP_READ, p);
         ABTS_PTR_NOTNULL(tc, themmap);
    -    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     }
     
     static void test_mmap_contents(abts_case *tc, void *data)
    @@ -114,7 +114,7 @@ static void test_mmap_delete(abts_case *tc, void *data)
     
         ABTS_PTR_NOTNULL(tc, themmap);
         rv = apr_mmap_delete(themmap);
    -    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     }
     
     static void test_mmap_offset(abts_case *tc, void *data)
    diff --git a/test/testpools.c b/test/testpools.c
    index cb45552e772..dd0919d06b4 100644
    --- a/test/testpools.c
    +++ b/test/testpools.c
    @@ -69,7 +69,7 @@ static void parent_pool(abts_case *tc, void *data)
         apr_status_t rv;
     
         rv = apr_pool_create(&pmain, NULL);
    -    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_PTR_NOTNULL(tc, pmain);
     }
     
    @@ -78,7 +78,7 @@ static void child_pool(abts_case *tc, void *data)
         apr_status_t rv;
     
         rv = apr_pool_create(&pchild, pmain);
    -    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         ABTS_PTR_NOTNULL(tc, pchild);
     }
     
    diff --git a/test/teststr.c b/test/teststr.c
    index 680f9edce14..b682841deb0 100644
    --- a/test/teststr.c
    +++ b/test/teststr.c
    @@ -357,8 +357,8 @@ static void string_cpystrn(abts_case *tc, void *data)
     
         ret = apr_cpystrn(buf, "123456", 5);
     
    -    ABTS_STR_EQUAL(tc, buf, "1234");
    -    ABTS_PTR_EQUAL(tc, ret, buf + 4);
    +    ABTS_STR_EQUAL(tc, "1234", buf);
    +    ABTS_PTR_EQUAL(tc, buf + 4, ret);
         ABTS_TRUE(tc, *ret == '\0');
         ABTS_TRUE(tc, ret[1] == 'Z');
     }
    @@ -377,7 +377,7 @@ static void snprintf_overflow(abts_case *tc, void *data)
         rv = apr_snprintf(buf, 2, "%s", "abcd");
         ABTS_INT_EQUAL(tc, 1, rv);
     
    -    ABTS_STR_EQUAL(tc, buf, "a");
    +    ABTS_STR_EQUAL(tc, "a", buf);
     
         /* Check the buffer really hasn't been overflowed. */
         ABTS_TRUE(tc, buf[2] == '4' && buf[3] == '2');
    diff --git a/test/testtable.c b/test/testtable.c
    index 90dc8d2ed29..0f217787647 100644
    --- a/test/testtable.c
    +++ b/test/testtable.c
    @@ -54,7 +54,7 @@ static void table_get(abts_case *tc, void *data)
     
         apr_table_set(t1, "foo", "bar");
         val = apr_table_get(t1, "foo");
    -    ABTS_STR_EQUAL(tc, val, "bar");
    +    ABTS_STR_EQUAL(tc, "bar", val);
     }
     
     static void table_set(abts_case *tc, void *data)
    @@ -64,7 +64,7 @@ static void table_set(abts_case *tc, void *data)
         apr_table_set(t1, "setkey", "bar");
         apr_table_set(t1, "setkey", "2ndtry");
         val = apr_table_get(t1, "setkey");
    -    ABTS_STR_EQUAL(tc, val, "2ndtry");
    +    ABTS_STR_EQUAL(tc, "2ndtry", val);
     }
     
     static void table_getnotthere(abts_case *tc, void *data)
    @@ -82,7 +82,7 @@ static void table_add(abts_case *tc, void *data)
         apr_table_add(t1, "addkey", "bar");
         apr_table_add(t1, "addkey", "foo");
         val = apr_table_get(t1, "addkey");
    -    ABTS_STR_EQUAL(tc, val, "bar");
    +    ABTS_STR_EQUAL(tc, "bar", val);
     
     }
     
    @@ -95,11 +95,11 @@ static void table_nelts(abts_case *tc, void *data)
         apr_table_set(t, "def", "abc");
         apr_table_set(t, "foo", "zzz");
         val = apr_table_get(t, "foo");
    -    ABTS_STR_EQUAL(tc, val, "zzz");
    +    ABTS_STR_EQUAL(tc, "zzz", val);
         val = apr_table_get(t, "abc");
    -    ABTS_STR_EQUAL(tc, val, "def");
    +    ABTS_STR_EQUAL(tc, "def", val);
         val = apr_table_get(t, "def");
    -    ABTS_STR_EQUAL(tc, val, "abc");
    +    ABTS_STR_EQUAL(tc, "abc", val);
         ABTS_INT_EQUAL(tc, 3, apr_table_elts(t)->nelts);
     }
     
    @@ -119,9 +119,9 @@ static void table_unset(abts_case *tc, void *data)
         apr_table_unset(t, "b");
         ABTS_INT_EQUAL(tc, 1, apr_table_elts(t)->nelts);
         val = apr_table_get(t, "a");
    -    ABTS_STR_EQUAL(tc, val, "1");
    +    ABTS_STR_EQUAL(tc, "1", val);
         val = apr_table_get(t, "b");
    -    ABTS_PTR_EQUAL(tc, (void *)val, (void *)NULL);
    +    ABTS_PTR_EQUAL(tc, (void *)NULL, (void *)val);
     }
     
     static void table_overlap(abts_case *tc, void *data)
    @@ -142,21 +142,21 @@ static void table_overlap(abts_case *tc, void *data)
         apr_table_addn(t2, "f", "6");
         apr_table_overlap(t1, t2, APR_OVERLAP_TABLES_SET);
         
    -    ABTS_INT_EQUAL(tc, apr_table_elts(t1)->nelts, 7);
    +    ABTS_INT_EQUAL(tc, 7, apr_table_elts(t1)->nelts);
         val = apr_table_get(t1, "a");
    -    ABTS_STR_EQUAL(tc, val, "1");
    +    ABTS_STR_EQUAL(tc, "1", val);
         val = apr_table_get(t1, "b");
    -    ABTS_STR_EQUAL(tc, val, "2.");
    +    ABTS_STR_EQUAL(tc, "2.", val);
         val = apr_table_get(t1, "c");
    -    ABTS_STR_EQUAL(tc, val, "3");
    +    ABTS_STR_EQUAL(tc, "3", val);
         val = apr_table_get(t1, "d");
    -    ABTS_STR_EQUAL(tc, val, "4");
    +    ABTS_STR_EQUAL(tc, "4", val);
         val = apr_table_get(t1, "e");
    -    ABTS_STR_EQUAL(tc, val, "5");
    +    ABTS_STR_EQUAL(tc, "5", val);
         val = apr_table_get(t1, "f");
    -    ABTS_STR_EQUAL(tc, val, "6");
    +    ABTS_STR_EQUAL(tc, "6", val);
         val = apr_table_get(t1, "g");
    -    ABTS_STR_EQUAL(tc, val, "7");
    +    ABTS_STR_EQUAL(tc, "7", val);
     }
     
     static void table_overlap2(abts_case *tc, void *data)
    @@ -175,8 +175,8 @@ static void table_overlap2(abts_case *tc, void *data)
         
         ABTS_INT_EQUAL(tc, 2, apr_table_elts(t1)->nelts);
         
    -    ABTS_STR_EQUAL(tc, apr_table_get(t1, "t1"), "one");
    -    ABTS_STR_EQUAL(tc, apr_table_get(t1, "t2"), "two");
    +    ABTS_STR_EQUAL(tc, "one", apr_table_get(t1, "t1"));
    +    ABTS_STR_EQUAL(tc, "two", apr_table_get(t1, "t2"));
     
     }
     
    diff --git a/test/testud.c b/test/testud.c
    index 77cd28faa99..7132d6cf78e 100644
    --- a/test/testud.c
    +++ b/test/testud.c
    @@ -38,7 +38,7 @@ static void set_userdata(abts_case *tc, void *data)
         apr_status_t rv;
     
         rv = apr_pool_userdata_set(testdata, "TEST", string_cleanup, pool);
    -    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     }
     
     static void get_userdata(abts_case *tc, void *data)
    @@ -47,8 +47,8 @@ static void get_userdata(abts_case *tc, void *data)
         void *retdata;
     
         rv = apr_pool_userdata_get(&retdata, "TEST", pool);
    -    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
    -    ABTS_STR_EQUAL(tc, retdata, testdata);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
    +    ABTS_STR_EQUAL(tc, testdata, retdata);
     }
     
     static void get_nonexistkey(abts_case *tc, void *data)
    @@ -57,8 +57,8 @@ static void get_nonexistkey(abts_case *tc, void *data)
         void *retdata;
     
         rv = apr_pool_userdata_get(&retdata, "DOESNTEXIST", pool);
    -    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
    -    ABTS_PTR_EQUAL(tc, retdata, NULL);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
    +    ABTS_PTR_EQUAL(tc, NULL, retdata);
     }
     
     static void post_pool_clear(abts_case *tc, void *data)
    @@ -67,8 +67,8 @@ static void post_pool_clear(abts_case *tc, void *data)
         void *retdata;
     
         rv = apr_pool_userdata_get(&retdata, "DOESNTEXIST", pool);
    -    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
    -    ABTS_PTR_EQUAL(tc, retdata, NULL);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
    +    ABTS_PTR_EQUAL(tc, NULL, retdata);
     }
     
     abts_suite *testud(abts_suite *suite)
    
    From ab474c4417821285c9e1ce69b5d7e0d74ab6ee9e Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sun, 18 Nov 2007 20:15:22 +0000
    Subject: [PATCH 6101/7878] ignore /dev/*random on z/OS < V1R7
    
    Submitted by: David Jones; heavily modified by trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@596126 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 18 +++++++++++++++++-
     1 file changed, 17 insertions(+), 1 deletion(-)
    
    diff --git a/configure.in b/configure.in
    index 5d2b4173b76..89211724e1e 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -568,6 +568,9 @@ case $host in
         *linux*)
             os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/'`
             ;;
    +    *os390)
    +        os_version=`uname -r | sed -e 's/\.//g'`
    +        ;;
         *)
             os_version=OS_VERSION_IS_NOT_SET
             ;;
    @@ -1929,6 +1932,8 @@ fi
     dnl ----------------------------- Checking for /dev/random 
     AC_MSG_CHECKING(for entropy source)
     
    +why_no_rand=""
    +
     AC_ARG_WITH(egd, 
       [  --with-egd[[=DIR]]        use EGD-compatible socket],
       [ AC_DEFINE(HAVE_EGD, 1, [Define if EGD is supported])
    @@ -1965,6 +1970,17 @@ if test "$rand" != "1"; then
         fi
       fi
     
    +  if test "$rand" = "1"; then
    +    case $host in
    +      *os390)
    +        if test $os_version -lt 1700; then
    +          rand="0"
    +          why_no_rand=" ($apr_devrandom unusable on z/OS before V1R7)"
    +        fi
    +        ;;
    +    esac
    +  fi
    +
       if test "$rand" = "1"; then
         AC_DEFINE_UNQUOTED(DEV_RANDOM, ["$apr_devrandom"], [Define to path of random device])
         AC_MSG_RESULT([$apr_devrandom])
    @@ -1985,7 +2001,7 @@ if test "$rand" != "1"; then
                     AC_MSG_RESULT(truerand)
                     rand="1"
                   else
    -                AC_MSG_RESULT(not found)
    +                AC_MSG_RESULT(not found$why_no_rand)
                     rand="0"
                   fi
                 fi
    
    From dde919a5a3e0f5613698d1cf368048bff561fa73 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 19 Nov 2007 19:19:21 +0000
    Subject: [PATCH 6102/7878] Simplify handling of z/OS pthread API nuances. 
     Beyond the simplification, it fixes a compile error in the call to
     pthread_yield() on z/OS.
    
    Submitted by: David Jones
    
    I modified it slightly to use AC_DEFINE() as suggested
    by jorton.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@596402 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_hints.m4         |  3 ++-
     locks/unix/proc_mutex.c    | 22 +++++++++++-----------
     locks/unix/thread_cond.c   | 12 ++++++------
     locks/unix/thread_mutex.c  | 10 +++++-----
     locks/unix/thread_rwlock.c | 14 +++++++-------
     threadproc/unix/signals.c  |  6 +++---
     threadproc/unix/thread.c   | 24 ++++++++++++++----------
     7 files changed, 48 insertions(+), 43 deletions(-)
    
    diff --git a/build/apr_hints.m4 b/build/apr_hints.m4
    index 3277949a13d..d8dc3cf5f2b 100644
    --- a/build/apr_hints.m4
    +++ b/build/apr_hints.m4
    @@ -419,7 +419,8 @@ dnl	       # Not a problem in 10.20.  Otherwise, who knows?
            APR_SETIFNULL(apr_sysvsem_is_global, [yes])
            APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
            APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
    -       APR_ADDTO(CPPFLAGS, [-U_NO_PROTO -DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR -DPTHREAD_SETS_ERRNO -DPTHREAD_DETACH_ARG1_ADDR -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1])
    +       AC_DEFINE(HAVE_ZOS_PTHREADS, 1, [Define for z/OS pthread API nuances])
    +       APR_ADDTO(CPPFLAGS, [-U_NO_PROTO -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1])
            ;;
         *-ibm-as400)
            APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE])
    diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c
    index 398d71dd1c0..9358e68e17d 100644
    --- a/locks/unix/proc_mutex.c
    +++ b/locks/unix/proc_mutex.c
    @@ -290,7 +290,7 @@ static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_)
     
         if (mutex->curr_locked == 1) {
             if ((rv = pthread_mutex_unlock(mutex->pthread_interproc))) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
                 rv = errno;
     #endif
                 return rv;
    @@ -299,7 +299,7 @@ static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_)
         /* curr_locked is set to -1 until the mutex has been created */
         if (mutex->curr_locked != -1) {
             if ((rv = pthread_mutex_destroy(mutex->pthread_interproc))) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
                 rv = errno;
     #endif
                 return rv;
    @@ -337,14 +337,14 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex,
         new_mutex->curr_locked = -1; /* until the mutex has been created */
     
         if ((rv = pthread_mutexattr_init(&mattr))) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             rv = errno;
     #endif
             proc_mutex_proc_pthread_cleanup(new_mutex);
             return rv;
         }
         if ((rv = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED))) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             rv = errno;
     #endif
             proc_mutex_proc_pthread_cleanup(new_mutex);
    @@ -355,7 +355,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex,
     #ifdef HAVE_PTHREAD_MUTEX_ROBUST
         if ((rv = pthread_mutexattr_setrobust_np(&mattr, 
                                                    PTHREAD_MUTEX_ROBUST_NP))) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             rv = errno;
     #endif
             proc_mutex_proc_pthread_cleanup(new_mutex);
    @@ -363,7 +363,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex,
             return rv;
         }
         if ((rv = pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT))) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             rv = errno;
     #endif
             proc_mutex_proc_pthread_cleanup(new_mutex);
    @@ -373,7 +373,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex,
     #endif /* HAVE_PTHREAD_MUTEX_ROBUST */
     
         if ((rv = pthread_mutex_init(new_mutex->pthread_interproc, &mattr))) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             rv = errno;
     #endif
             proc_mutex_proc_pthread_cleanup(new_mutex);
    @@ -384,7 +384,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex,
         new_mutex->curr_locked = 0; /* mutex created now */
     
         if ((rv = pthread_mutexattr_destroy(&mattr))) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             rv = errno;
     #endif
             proc_mutex_proc_pthread_cleanup(new_mutex);
    @@ -403,7 +403,7 @@ static apr_status_t proc_mutex_proc_pthread_acquire(apr_proc_mutex_t *mutex)
         apr_status_t rv;
     
         if ((rv = pthread_mutex_lock(mutex->pthread_interproc))) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             rv = errno;
     #endif
     #ifdef HAVE_PTHREAD_MUTEX_ROBUST
    @@ -426,7 +426,7 @@ static apr_status_t proc_mutex_proc_pthread_tryacquire(apr_proc_mutex_t *mutex)
         apr_status_t rv;
      
         if ((rv = pthread_mutex_trylock(mutex->pthread_interproc))) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS 
             rv = errno;
     #endif
             if (rv == EBUSY) {
    @@ -454,7 +454,7 @@ static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex)
     
         mutex->curr_locked = 0;
         if ((rv = pthread_mutex_unlock(mutex->pthread_interproc))) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             rv = errno;
     #endif
             return rv;
    diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c
    index 227c1d7f649..db7dd4f0d97 100644
    --- a/locks/unix/thread_cond.c
    +++ b/locks/unix/thread_cond.c
    @@ -27,7 +27,7 @@ static apr_status_t thread_cond_cleanup(void *data)
         apr_status_t rv;
     
         rv = pthread_cond_destroy(&cond->cond);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (rv) {
             rv = errno;
         }
    @@ -46,7 +46,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond,
         new_cond->pool = pool;
     
         if ((rv = pthread_cond_init(&new_cond->cond, NULL))) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             rv = errno;
     #endif
             return rv;
    @@ -66,7 +66,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond,
         apr_status_t rv;
     
         rv = pthread_cond_wait(&cond->cond, &mutex->mutex);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (rv) {
             rv = errno;
         }
    @@ -87,7 +87,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond,
         abstime.tv_nsec = apr_time_usec(then) * 1000; /* nanoseconds */
     
         rv = pthread_cond_timedwait(&cond->cond, &mutex->mutex, &abstime);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (rv) {
             rv = errno;
         }
    @@ -104,7 +104,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond)
         apr_status_t rv;
     
         rv = pthread_cond_signal(&cond->cond);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (rv) {
             rv = errno;
         }
    @@ -117,7 +117,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond)
         apr_status_t rv;
     
         rv = pthread_cond_broadcast(&cond->cond);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (rv) {
             rv = errno;
         }
    diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c
    index e146a28f593..73fd1e14621 100644
    --- a/locks/unix/thread_mutex.c
    +++ b/locks/unix/thread_mutex.c
    @@ -26,7 +26,7 @@ static apr_status_t thread_mutex_cleanup(void *data)
         apr_status_t rv;
     
         rv = pthread_mutex_destroy(&mutex->mutex);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (rv) {
             rv = errno;
         }
    @@ -71,7 +71,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex,
             rv = pthread_mutex_init(&new_mutex->mutex, NULL);
     
         if (rv) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             rv = errno;
     #endif
             return rv;
    @@ -90,7 +90,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex)
         apr_status_t rv;
     
         rv = pthread_mutex_lock(&mutex->mutex);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (rv) {
             rv = errno;
         }
    @@ -105,7 +105,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex)
     
         rv = pthread_mutex_trylock(&mutex->mutex);
         if (rv) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             rv = errno;
     #endif
             return (rv == EBUSY) ? APR_EBUSY : rv;
    @@ -119,7 +119,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex)
         apr_status_t status;
     
         status = pthread_mutex_unlock(&mutex->mutex);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (status) {
             status = errno;
         }
    diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c
    index 4b28bb618ce..0f8b7a79ff7 100644
    --- a/locks/unix/thread_rwlock.c
    +++ b/locks/unix/thread_rwlock.c
    @@ -29,7 +29,7 @@ static apr_status_t thread_rwlock_cleanup(void *data)
         apr_status_t stat;
     
         stat = pthread_rwlock_destroy(&rwlock->rwlock);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (stat) {
             stat = errno;
         }
    @@ -47,7 +47,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock,
         new_rwlock->pool = pool;
     
         if ((stat = pthread_rwlock_init(&new_rwlock->rwlock, NULL))) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             stat = errno;
     #endif
             return stat;
    @@ -66,7 +66,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock)
         apr_status_t stat;
     
         stat = pthread_rwlock_rdlock(&rwlock->rwlock);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (stat) {
             stat = errno;
         }
    @@ -79,7 +79,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwloc
         apr_status_t stat;
     
         stat = pthread_rwlock_tryrdlock(&rwlock->rwlock);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (stat) {
             stat = errno;
         }
    @@ -95,7 +95,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock)
         apr_status_t stat;
     
         stat = pthread_rwlock_wrlock(&rwlock->rwlock);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (stat) {
             stat = errno;
         }
    @@ -108,7 +108,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwloc
         apr_status_t stat;
     
         stat = pthread_rwlock_trywrlock(&rwlock->rwlock);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (stat) {
             stat = errno;
         }
    @@ -124,7 +124,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock)
         apr_status_t stat;
     
         stat = pthread_rwlock_unlock(&rwlock->rwlock);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (stat) {
             stat = errno;
         }
    diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c
    index f44c3d7859c..46acc1d1fa6 100644
    --- a/threadproc/unix/signals.c
    +++ b/threadproc/unix/signals.c
    @@ -422,7 +422,7 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void)
         }
     #else
         if ((rv = pthread_sigmask(SIG_SETMASK, &sig_mask, NULL)) != 0) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             rv = errno;
     #endif
         }
    @@ -448,7 +448,7 @@ APR_DECLARE(apr_status_t) apr_signal_block(int signum)
         }
     #else
         if ((rv = pthread_sigmask(SIG_BLOCK, &sig_mask, NULL)) != 0) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             rv = errno;
     #endif
         }
    @@ -475,7 +475,7 @@ APR_DECLARE(apr_status_t) apr_signal_unblock(int signum)
         }
     #else
         if ((rv = pthread_sigmask(SIG_UNBLOCK, &sig_mask, NULL)) != 0) {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             rv = errno;
     #endif
         }
    diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c
    index 0d5c3e2af51..5639ac70687 100644
    --- a/threadproc/unix/thread.c
    +++ b/threadproc/unix/thread.c
    @@ -29,7 +29,7 @@ static apr_status_t threadattr_cleanup(void *data)
         apr_status_t rv;
     
         rv = pthread_attr_destroy(&attr->attr);
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         if (rv) {
             rv = errno;
         }
    @@ -51,7 +51,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new,
                                       apr_pool_cleanup_null);
             return APR_SUCCESS;
         }
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         stat = errno;
     #endif
     
    @@ -68,7 +68,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr,
                                                         apr_int32_t on)
     {
         apr_status_t stat;
    -#ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR
    +#ifdef HAVE_ZOS_PTHREADS
         int arg = DETACH_ARG(on);
     
         if ((stat = pthread_attr_setdetachstate(&attr->attr, &arg)) == 0) {
    @@ -79,7 +79,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr,
             return APR_SUCCESS;
         }
         else {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             stat = errno;
     #endif
     
    @@ -110,7 +110,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
         if (stat == 0) {
             return APR_SUCCESS;
         }
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         stat = errno;
     #endif
     
    @@ -127,7 +127,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
         if (rv == 0) {
             return APR_SUCCESS;
         }
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
         rv = errno;
     #endif
         return rv;
    @@ -180,7 +180,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new,
             return APR_SUCCESS;
         }
         else {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             stat = errno;
     #endif
     
    @@ -219,7 +219,7 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval,
             return APR_SUCCESS;
         }
         else {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             stat = errno;
     #endif
     
    @@ -231,7 +231,7 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd)
     {
         apr_status_t stat;
     
    -#ifdef PTHREAD_DETACH_ARG1_ADDR
    +#ifdef HAVE_ZOS_PTHREADS
         if ((stat = pthread_detach(thd->td)) == 0) {
     #else
         if ((stat = pthread_detach(*thd->td)) == 0) {
    @@ -240,7 +240,7 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd)
             return APR_SUCCESS;
         }
         else {
    -#ifdef PTHREAD_SETS_ERRNO
    +#ifdef HAVE_ZOS_PTHREADS
             stat = errno;
     #endif
     
    @@ -251,7 +251,11 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd)
     APR_DECLARE(void) apr_thread_yield(void)
     {
     #ifdef HAVE_PTHREAD_YIELD
    +#ifdef HAVE_ZOS_PTHREADS
    +    pthread_yield(NULL);
    +#else
         pthread_yield();
    +#endif /* HAVE_ZOS_PTHREADS */
     #else
     #ifdef HAVE_SCHED_YIELD
         sched_yield();
    
    From a2cc33e1702492e525077814ceaf289b90780b0a Mon Sep 17 00:00:00 2001
    From: Graham Leggett 
    Date: Wed, 21 Nov 2007 20:59:55 +0000
    Subject: [PATCH 6103/7878] Add error codes for the SSL EVP interface for
     apr-util.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@597206 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES             |  3 +++
     include/apr_errno.h | 20 ++++++++++++++++++++
     2 files changed, 23 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index 79919903deb..a84ac6bad44 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 1.3.0
     
    +  *) Add error codes for the SSL EVP interface for apr-util.
    +     [Graham Leggett]
    +
       *) Fix DSO-related crash on z/OS caused by incorrect memory
          allocation.  [David Jones ]
     
    diff --git a/include/apr_errno.h b/include/apr_errno.h
    index 56014f885ab..bc253e6b083 100644
    --- a/include/apr_errno.h
    +++ b/include/apr_errno.h
    @@ -245,6 +245,10 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
      * APR_EBADIP       The specified IP address is invalid
      * APR_EBADMASK     The specified netmask is invalid
      * APR_ESYMNOTFOUND Could not find the requested symbol
    + * APR_ENOCIPHER    Could not find the cipher specified
    + * APR_ENODIGEST    Could not find the digest specified
    + * APR_ENOCERT      Could not find the certificate specified
    + * APR_ENOENGINE    Could not find the engine specified
      * 
    * *
    @@ -335,6 +339,14 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_EPROC_UNKNOWN  (APR_OS_START_ERROR + 27)
     /** @see APR_STATUS_IS_ENOTENOUGHENTROPY */
     #define APR_ENOTENOUGHENTROPY (APR_OS_START_ERROR + 28)
    +/** @see APR_STATUS_IS_ENOCIPHER */
    +#define APR_ENOCIPHER      (APR_OS_START_ERROR + 29)
    +/** @see APR_STATUS_IS_ENODIGEST */
    +#define APR_ENODIGEST      (APR_OS_START_ERROR + 30)
    +/** @see APR_STATUS_IS_ENOCERT */
    +#define APR_ENOCERT        (APR_OS_START_ERROR + 31)
    +/** @see APR_STATUS_IS_ENOENGINE */
    +#define APR_ENOENGINE      (APR_OS_START_ERROR + 32)
     /** @} */
     
     /** 
    @@ -425,6 +437,14 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     
     /** APR could not gather enough entropy to continue. */
     #define APR_STATUS_IS_ENOTENOUGHENTROPY(s) ((s) == APR_ENOTENOUGHENTROPY)
    +/** APR not find the cipher specified. */
    +#define APR_STATUS_IS_ENOCIPHER(s)      ((s) == APR_ENOCIPHER)
    +/** APR not find the digest specified. */
    +#define APR_STATUS_IS_ENODIGEST(s)      ((s) == APR_ENODIGEST)
    +/** APR not find the certificate specified. */
    +#define APR_STATUS_IS_ENOCERT(s)        ((s) == APR_ENOCERT)
    +/** APR not find the engine specified. */
    +#define APR_STATUS_IS_ENOENGINE(s)      ((s) == APR_ENOENGINE)
     
     /** @} */
     
    
    From 4deee14d2819c4180f5fee437538ee171127277d Mon Sep 17 00:00:00 2001
    From: Graham Leggett 
    Date: Wed, 21 Nov 2007 21:47:07 +0000
    Subject: [PATCH 6104/7878] Fix the make test target in the spec file.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@597218 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES               | 2 ++
     build/rpm/apr.spec.in | 2 +-
     2 files changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/CHANGES b/CHANGES
    index a84ac6bad44..0afadfae912 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 1.3.0
     
    +  *) Fix the make test target in the spec file. [Graham Leggett]
    +
       *) Add error codes for the SSL EVP interface for apr-util.
          [Graham Leggett]
     
    diff --git a/build/rpm/apr.spec.in b/build/rpm/apr.spec.in
    index 7d113c35a65..7b1668c8fe7 100644
    --- a/build/rpm/apr.spec.in
    +++ b/build/rpm/apr.spec.in
    @@ -46,7 +46,7 @@ make %{?_smp_mflags} && make dox
     %check
     # Run non-interactive tests
     pushd test
    -make %{?_smp_mflags} testall CFLAGS=-fno-strict-aliasing
    +make %{?_smp_mflags} all CFLAGS=-fno-strict-aliasing
     ./testall -v || exit 1
     popd
     
    
    From e41d677b06d3e69079ce4194977ca1905ba8a6ba Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Fri, 23 Nov 2007 09:34:44 +0000
    Subject: [PATCH 6105/7878] Remove the BOM.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@597614 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/CHANGES b/CHANGES
    index 0afadfae912..6e0d956066e 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,4 +1,4 @@
    -                                                     -*- coding: utf-8 -*-
    +                                                     -*- coding: utf-8 -*-
     Changes for APR 1.3.0
     
       *) Fix the make test target in the spec file. [Graham Leggett]
    
    From be3cfb52200ae7e27e3c9b34bdba0af35f80079f Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 7 Dec 2007 18:47:29 +0000
    Subject: [PATCH 6106/7878] Where hostname is provided in ipv4 numeric form, as
     we've foolishly cooerced all of our IPV4_MAPPED_IPV6 addresses, we'll need to
     accept this as a socket lookup call!
    
    Unfortunately, we failed to resolve, for example, 127.0.0.1
    for INET6 addressing, where we would resolve ::ffff:127.0.0.1
    But the AI_V4MAPPED flag will let us resolve this address after
    attempting to resolve the IPV6 notation.
    
    Feedback and careful review is desired before this is applied
    to branches 1.2 and 0.9.  Thanks.
    
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@602176 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sockaddr.c | 5 +++++
     1 file changed, 5 insertions(+)
    
    diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
    index e70e3bcb16c..f7863a7bd52 100644
    --- a/network_io/unix/sockaddr.c
    +++ b/network_io/unix/sockaddr.c
    @@ -344,6 +344,11 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa,
             servname = apr_itoa(p, port);
     #endif /* OSF1 */
         }
    +#if APR_HAVE_IPV6 && defined(AI_V4MAPPED)
    +    else if (family == APR_INET6) {
    +        hints.ai_flags |= AI_V4MAPPED;
    +    }
    +#endif
         error = getaddrinfo(hostname, servname, &hints, &ai_list);
     #ifdef HAVE_GAI_ADDRCONFIG
         if (error == EAI_BADFLAGS && family == APR_UNSPEC) {
    
    From 84102e1af2bf525ca65f771e01e906276601abe6 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 8 Dec 2007 13:40:15 +0000
    Subject: [PATCH 6107/7878] z/OS: return standard apr_status_t codes from
     apr_dso_load() and apr_dso_sym().
    
    Submitted by: David Jones 
    Reviewed by:  trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@602460 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES         | 3 +++
     dso/os390/dso.c | 4 ++--
     2 files changed, 5 insertions(+), 2 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 6e0d956066e..db20062c13a 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 1.3.0
     
    +  *) z/OS: return standard apr_status_t codes from apr_dso_load()
    +     and apr_dso_sym().  [David Jones ]
    +
       *) Fix the make test target in the spec file. [Graham Leggett]
     
       *) Add error codes for the SSL EVP interface for apr-util.
    diff --git a/dso/os390/dso.c b/dso/os390/dso.c
    index 034ffe843f5..9344c71a154 100644
    --- a/dso/os390/dso.c
    +++ b/dso/os390/dso.c
    @@ -72,7 +72,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle,
         }
     
         (*res_handle)->failing_errno = errno;
    -    return errno;
    +    return APR_EDSOOPEN;
     }
     
     APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle)
    @@ -96,7 +96,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym,
             return APR_SUCCESS;
         }
         handle->failing_errno = errno;
    -    return errno;
    +    return APR_ESYMNOTFOUND;
     }
     
     APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *handle, char *buffer, 
    
    From 11cc6e915d3d351c5708079a8333a19dec46233e Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 10 Dec 2007 22:41:53 +0000
    Subject: [PATCH 6108/7878] Propose a patch to satisfy Joe's concerns about
     returning IPv4 mapped addresses when they are not desired.
    
    Limit the scope of resolving IPv4 addresses with IPv6 mapping to the sole case
    that the user requests APR_INET6 family, but permits APR_IPV4_ADDR_OK.
    
    Does this addition to r602176 satisfy everyone's concerns?
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@603082 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sockaddr.c | 7 ++++++-
     1 file changed, 6 insertions(+), 1 deletion(-)
    
    diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
    index f7863a7bd52..0a00afac0d6 100644
    --- a/network_io/unix/sockaddr.c
    +++ b/network_io/unix/sockaddr.c
    @@ -345,7 +345,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa,
     #endif /* OSF1 */
         }
     #if APR_HAVE_IPV6 && defined(AI_V4MAPPED)
    -    else if (family == APR_INET6) {
    +    if (flags & APR_IPV4_ADDR_OK && family == APR_INET6) {
             hints.ai_flags |= AI_V4MAPPED;
         }
     #endif
    @@ -419,6 +419,11 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa,
                                        apr_port_t port, apr_int32_t flags, 
                                        apr_pool_t *p)
     {
    +#if APR_HAVE_IPV6
    +    if (flags & APR_IPV4_ADDR_OK && family == APR_INET6) {
    +        apr_status_t error = call_resolver(sa, hostname, family, port, flags, p);
    +    else
    +#endif
         if (flags & APR_IPV4_ADDR_OK) {
             apr_status_t error = call_resolver(sa, hostname, AF_INET, port, flags, p);
     
    
    From 5caf60bf41cff544dd5d230b2808f88e43e5951f Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 10 Dec 2007 22:51:16 +0000
    Subject: [PATCH 6109/7878] One byte typo; this should build now.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@603085 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sockaddr.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
    index 0a00afac0d6..4293478ff38 100644
    --- a/network_io/unix/sockaddr.c
    +++ b/network_io/unix/sockaddr.c
    @@ -422,7 +422,7 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa,
     #if APR_HAVE_IPV6
         if (flags & APR_IPV4_ADDR_OK && family == APR_INET6) {
             apr_status_t error = call_resolver(sa, hostname, family, port, flags, p);
    -    else
    +    } else
     #endif
         if (flags & APR_IPV4_ADDR_OK) {
             apr_status_t error = call_resolver(sa, hostname, AF_INET, port, flags, p);
    
    From eaa26b546b240cd3db0525749bb842104f93657e Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 11 Dec 2007 20:34:19 +0000
    Subject: [PATCH 6110/7878] irrespective of if we back this out, prevent
     doubled resolver calls.
    
    In fact, there's no use for the else {} condition at all.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@603350 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sockaddr.c | 7 ++++---
     1 file changed, 4 insertions(+), 3 deletions(-)
    
    diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
    index 4293478ff38..791cd3b0c12 100644
    --- a/network_io/unix/sockaddr.c
    +++ b/network_io/unix/sockaddr.c
    @@ -420,10 +420,11 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa,
                                        apr_pool_t *p)
     {
     #if APR_HAVE_IPV6
    -    if (flags & APR_IPV4_ADDR_OK && family == APR_INET6) {
    -        apr_status_t error = call_resolver(sa, hostname, family, port, flags, p);
    -    } else
    +    if (flags & APR_IPV6_V4MAPPED_OK && family == APR_INET6) {
    +        return call_resolver(sa, hostname, family, port, flags, p);
    +    }
     #endif
    +
         if (flags & APR_IPV4_ADDR_OK) {
             apr_status_t error = call_resolver(sa, hostname, AF_INET, port, flags, p);
     
    
    From bd2ad899a901de76fd72a8bf293d6a79d4dbf936 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 12 Dec 2007 01:08:15 +0000
    Subject: [PATCH 6111/7878] Propose an API and it's explicit meaning.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@603434 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_network_io.h | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/include/apr_network_io.h b/include/apr_network_io.h
    index 4e3789d2b2e..1d49518d95b 100644
    --- a/include/apr_network_io.h
    +++ b/include/apr_network_io.h
    @@ -111,6 +111,7 @@ typedef enum {
     
     #define APR_IPV4_ADDR_OK  0x01  /**< @see apr_sockaddr_info_get() */
     #define APR_IPV6_ADDR_OK  0x02  /**< @see apr_sockaddr_info_get() */
    +#define APR_IPV6_V4MAPPED_OK 0x04 /**< @see apr_sockaddr_info_get() */
     
     #if (!APR_HAVE_IN_ADDR)
     /**
    @@ -367,6 +368,9 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock,
      *                                 only valid if family is APR_UNSPEC and hostname
      *                                 isn't NULL and APR_HAVE_IPV6; mutually exclusive
      *                                 with APR_IPV4_ADDR_OK
    + *       APR_IPV6_V4MAPPED_OK      Used with family APR_INET6, if no matching
    + *                                 IPv6 addresses could be matched, then 
    + *                                 accept IPv4 addresses as mapped matches.
      * 
    * @param p The pool for the apr_sockaddr_t and associated storage. */ From 00d69a46afb82f6f7298a7811c02c460b1f01ba6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 12 Dec 2007 01:20:30 +0000 Subject: [PATCH 6112/7878] Round out the implementation of APR_IPV6_V4MAPPED_OK. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@603435 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 791cd3b0c12..43fd2bc740b 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -345,7 +345,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, #endif /* OSF1 */ } #if APR_HAVE_IPV6 && defined(AI_V4MAPPED) - if (flags & APR_IPV4_ADDR_OK && family == APR_INET6) { + if (flags & APR_IPV6_V4MAPPED_OK && family == APR_INET6) { hints.ai_flags |= AI_V4MAPPED; } #endif From ac2a3ab4989550a1bd095f0a5d070049dd6b4778 Mon Sep 17 00:00:00 2001 From: Karl Fogel Date: Wed, 12 Dec 2007 01:21:26 +0000 Subject: [PATCH 6113/7878] Document that apr_is_empty_table() and apr_is_empty_array() accept NULL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@603436 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index a2f450ea8c9..c2cd7413882 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -88,14 +88,14 @@ struct apr_table_entry_t { APR_DECLARE(const apr_array_header_t *) apr_table_elts(const apr_table_t *t); /** - * Determine if the table is empty + * Determine if the table is empty (either NULL or having no elements) * @param t The table to check * @return True if empty, False otherwise */ APR_DECLARE(int) apr_is_empty_table(const apr_table_t *t); /** - * Determine if the array is empty + * Determine if the array is empty (either NULL or having no elements) * @param a The array to check * @return True if empty, False otherwise */ From 945bb66e398b5f7d7ddcf19387a9601f8d600fcf Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 15 Dec 2007 04:10:38 +0000 Subject: [PATCH 6114/7878] Revert sockaddr.c all the way back to r428317, and discard the IPv4 address resolution for APR_INET6 sockaddr resolution, per Joe's objection and no other interest. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@604389 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 4 ---- network_io/unix/sockaddr.c | 11 ----------- 2 files changed, 15 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 1d49518d95b..4e3789d2b2e 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -111,7 +111,6 @@ typedef enum { #define APR_IPV4_ADDR_OK 0x01 /**< @see apr_sockaddr_info_get() */ #define APR_IPV6_ADDR_OK 0x02 /**< @see apr_sockaddr_info_get() */ -#define APR_IPV6_V4MAPPED_OK 0x04 /**< @see apr_sockaddr_info_get() */ #if (!APR_HAVE_IN_ADDR) /** @@ -368,9 +367,6 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, * only valid if family is APR_UNSPEC and hostname * isn't NULL and APR_HAVE_IPV6; mutually exclusive * with APR_IPV4_ADDR_OK - * APR_IPV6_V4MAPPED_OK Used with family APR_INET6, if no matching - * IPv6 addresses could be matched, then - * accept IPv4 addresses as mapped matches. *
    * @param p The pool for the apr_sockaddr_t and associated storage. */ diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 43fd2bc740b..e70e3bcb16c 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -344,11 +344,6 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, servname = apr_itoa(p, port); #endif /* OSF1 */ } -#if APR_HAVE_IPV6 && defined(AI_V4MAPPED) - if (flags & APR_IPV6_V4MAPPED_OK && family == APR_INET6) { - hints.ai_flags |= AI_V4MAPPED; - } -#endif error = getaddrinfo(hostname, servname, &hints, &ai_list); #ifdef HAVE_GAI_ADDRCONFIG if (error == EAI_BADFLAGS && family == APR_UNSPEC) { @@ -419,12 +414,6 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, apr_port_t port, apr_int32_t flags, apr_pool_t *p) { -#if APR_HAVE_IPV6 - if (flags & APR_IPV6_V4MAPPED_OK && family == APR_INET6) { - return call_resolver(sa, hostname, family, port, flags, p); - } -#endif - if (flags & APR_IPV4_ADDR_OK) { apr_status_t error = call_resolver(sa, hostname, AF_INET, port, flags, p); From 367bfafebde2a79663ba476b04a7a6366da35df2 Mon Sep 17 00:00:00 2001 From: Andre Malo Date: Sat, 15 Dec 2007 19:54:11 +0000 Subject: [PATCH 6115/7878] svn:eol-style = native git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@604496 13f79535-47bb-0310-9956-ffa450edef68 --- build/preaprapp.dsp | 358 ++++++++++++++++++++++---------------------- 1 file changed, 179 insertions(+), 179 deletions(-) diff --git a/build/preaprapp.dsp b/build/preaprapp.dsp index 4825e2e0131..caa95dfab75 100644 --- a/build/preaprapp.dsp +++ b/build/preaprapp.dsp @@ -1,179 +1,179 @@ -# Microsoft Developer Studio Project File - Name="preaprapp" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=preaprapp - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "preaprapp.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "preaprapp.mak" CFG="preaprapp - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "preaprapp - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "preaprapp - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE "preaprapp - Win32 Release9x" (based on "Win32 (x86) External Target") -!MESSAGE "preaprapp - Win32 Debug9x" (based on "Win32 (x86) External Target") -!MESSAGE "preaprapp - x64 Release" (based on "Win32 (x86) External Target") -!MESSAGE "preaprapp - x64 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "preaprapp - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "preaprapp.exe" -# PROP BASE Bsc_Name "preaprapp.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /nologo /f NUL" -# PROP Rebuild_Opt "/a" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "preaprapp - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "preaprapp.exe" -# PROP BASE Bsc_Name "preaprapp.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /nologo /f NUL" -# PROP Rebuild_Opt "/a" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "preaprapp - Win32 Release9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "preaprapp.exe" -# PROP BASE Bsc_Name "preaprapp.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /nologo /f NUL" -# PROP Rebuild_Opt "/a" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "preaprapp - Win32 Debug9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "preaprapp.exe" -# PROP BASE Bsc_Name "preaprapp.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /nologo /f NUL" -# PROP Rebuild_Opt "/a" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "preaprapp - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "preaprapp.exe" -# PROP BASE Bsc_Name "preaprapp.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /nologo /f NUL" -# PROP Rebuild_Opt "/a" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "preaprapp - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "preaprapp.exe" -# PROP BASE Bsc_Name "preaprapp.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /nologo /f NUL" -# PROP Rebuild_Opt "/a" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "preaprapp - Win32 Release" -# Name "preaprapp - Win32 Debug" -# Name "preaprapp - Win32 Release9x" -# Name "preaprapp - Win32 Debug9x" -# Name "preaprapp - x64 Release" -# Name "preaprapp - x64 Debug" - -!IF "$(CFG)" == "preaprapp - Win32 Release" - -!ELSEIF "$(CFG)" == "preaprapp - Win32 Debug" - -!ELSEIF "$(CFG)" == "preaprapp - Win32 Release9x" - -!ELSEIF "$(CFG)" == "preaprapp - Win32 Debug9x" - -!ELSEIF "$(CFG)" == "preaprapp - x64 Release" - -!ELSEIF "$(CFG)" == "preaprapp - x64 Debug" - -!ENDIF - -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="preaprapp" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) External Target" 0x0106 + +CFG=preaprapp - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "preaprapp.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "preaprapp.mak" CFG="preaprapp - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "preaprapp - Win32 Release" (based on "Win32 (x86) External Target") +!MESSAGE "preaprapp - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE "preaprapp - Win32 Release9x" (based on "Win32 (x86) External Target") +!MESSAGE "preaprapp - Win32 Debug9x" (based on "Win32 (x86) External Target") +!MESSAGE "preaprapp - x64 Release" (based on "Win32 (x86) External Target") +!MESSAGE "preaprapp - x64 Debug" (based on "Win32 (x86) External Target") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "preaprapp - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "preaprapp.exe" +# PROP BASE Bsc_Name "preaprapp.bsc" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /nologo /f NUL" +# PROP Rebuild_Opt "/a" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "preaprapp - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "preaprapp.exe" +# PROP BASE Bsc_Name "preaprapp.bsc" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /nologo /f NUL" +# PROP Rebuild_Opt "/a" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "preaprapp - Win32 Release9x" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "preaprapp.exe" +# PROP BASE Bsc_Name "preaprapp.bsc" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /nologo /f NUL" +# PROP Rebuild_Opt "/a" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "preaprapp - Win32 Debug9x" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "preaprapp.exe" +# PROP BASE Bsc_Name "preaprapp.bsc" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /nologo /f NUL" +# PROP Rebuild_Opt "/a" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "preaprapp - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "preaprapp.exe" +# PROP BASE Bsc_Name "preaprapp.bsc" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /nologo /f NUL" +# PROP Rebuild_Opt "/a" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "preaprapp - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "preaprapp.exe" +# PROP BASE Bsc_Name "preaprapp.bsc" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /nologo /f NUL" +# PROP Rebuild_Opt "/a" +# PROP Bsc_Name "" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "preaprapp - Win32 Release" +# Name "preaprapp - Win32 Debug" +# Name "preaprapp - Win32 Release9x" +# Name "preaprapp - Win32 Debug9x" +# Name "preaprapp - x64 Release" +# Name "preaprapp - x64 Debug" + +!IF "$(CFG)" == "preaprapp - Win32 Release" + +!ELSEIF "$(CFG)" == "preaprapp - Win32 Debug" + +!ELSEIF "$(CFG)" == "preaprapp - Win32 Release9x" + +!ELSEIF "$(CFG)" == "preaprapp - Win32 Debug9x" + +!ELSEIF "$(CFG)" == "preaprapp - x64 Release" + +!ELSEIF "$(CFG)" == "preaprapp - x64 Debug" + +!ENDIF + +# End Target +# End Project From 0228512ff74f10bebaf9b4bd10edb2948dc370dc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 26 Dec 2007 21:40:46 +0000 Subject: [PATCH 6116/7878] win32 find.exe != bsd/gnu find, and we want the native flavor. This fails on ancient OS's, but then again, ancient flavors won't be compiling to x64. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@606955 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.win | 3 ++- test/Makefile.win | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.win b/Makefile.win index 60377970d15..b2c2f07c463 100644 --- a/Makefile.win +++ b/Makefile.win @@ -45,7 +45,8 @@ USEDSW=1 PREFIX=..\apr-dist -!IF [$(COMSPEC) /c cl /nologo /? | find "x64" >NUL ] == 0 +!IF [$(COMSPEC) /c cl /nologo /? \ + | $(SystemRoot)\System32\find.exe "x64" >NUL ] == 0 ARCH=x64 Release !ELSE ARCH=Win32 Release diff --git a/test/Makefile.win b/test/Makefile.win index 4050c9aac65..2e7842f162d 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -33,7 +33,8 @@ OUTDIR=LibR OUTDIR=Release !ENDIF -!IF [$(COMSPEC) /c cl /nologo /? | find "x64" >NUL ] == 0 +!IF [$(COMSPEC) /c cl /nologo /? \ + | $(SystemRoot)\System32\find.exe "x64" >NUL ] == 0 OUTDIR=x64\$(OUTDIR) !ENDIF !ENDIF From 897ae2ed19d654dfab54eab13b53b7f12cc0a2e5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 3 Jan 2008 03:37:18 +0000 Subject: [PATCH 6117/7878] Solve mis-handling of struct group_source_req on Win32 by using a conditional macro GROUP_FILTER_SIZE in leiu of the unconditionally declared MCAST_JOIN_SOURCE_GROUP git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@608330 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/multicast.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index 74e1d7a732c..67ab2457403 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -117,13 +117,13 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock, #if APR_HAVE_IPV6 struct ipv6_mreq mip6; #endif -#if MCAST_JOIN_SOURCE_GROUP +#ifdef GROUP_FILTER_SIZE struct group_source_req mip; int ip_proto; #endif if (source != NULL) { -#if MCAST_JOIN_SOURCE_GROUP +#ifdef GROUP_FILTER_SIZE if (sock_is_ipv4(sock)) { ip_proto = IPPROTO_IP; } From 01ce5e80c80c218bffd3a056db625d47e2fd64f1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 4 Jan 2008 17:21:25 +0000 Subject: [PATCH 6118/7878] A buggered declare that we need to fix in APR 2 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@608928 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_strings.h b/include/apr_strings.h index fcfb7777a2a..996f8ceb57e 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -311,6 +311,8 @@ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); * or 0. If base is zero, buf will be treated as base ten unless its * digits are prefixed with '0x', in which case it will be treated as * base 16. + * @bug *end breaks type safety; where *buf is const, *end needs to be + * declared as const in APR 2.0 */ APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *buf, char **end, int base); From b5d2244e811bdc031bc43fe692aefccb5012a85d Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Wed, 30 Jan 2008 20:50:40 +0000 Subject: [PATCH 6119/7878] * Add missing semi-colon in Win9x code path of apr_file_open that breaks Win9X Debug builds. PR: 44329 Submitted by: Curt Arnold Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@616895 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/win32/open.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index db20062c13a..e9052b28d20 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 1.3.0 + *) Add missing semi-colon in Win9x code path of apr_file_open that breaks + Win9X Debug builds. PR 44329. [Curt Arnold] + *) z/OS: return standard apr_status_t codes from apr_dso_load() and apr_dso_sym(). [David Jones ] diff --git a/file_io/win32/open.c b/file_io/win32/open.c index b0d84d87b56..3148a77a785 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -424,7 +424,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, handle = CreateFileA(fname, oflags, sharemode, NULL, createflags, attributes, 0); /* This feature is not supported on this platform. */ - flag &= ~APR_SENDFILE_ENABLED + flag &= ~APR_SENDFILE_ENABLED; } #endif if (handle == INVALID_HANDLE_VALUE) { From 941c2f3eff4aef2f538d85ed2095be99adaeb0ef Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 1 Feb 2008 04:45:13 +0000 Subject: [PATCH 6120/7878] Permit linkage with up to 1024 files. * build/jlibtool.c (init_count_chars): Make PATH_MAX the upper bound number of entries not PATH_MAX/4 implicitly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@617348 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index bfa30bc074a..4f5c4212b8a 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -322,7 +322,7 @@ static int snprintf( char *str, size_t n, const char *fmt, ... ) void init_count_chars(count_chars *cc) { - cc->vals = (const char**)malloc(PATH_MAX); + cc->vals = (const char**)malloc(PATH_MAX*sizeof(char*)); cc->num = 0; } From f90f2e45e5193ebc9f5a9dfe9458e6c803cda488 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Fri, 1 Feb 2008 08:56:55 +0000 Subject: [PATCH 6121/7878] Check for bogus (negative) signal numbers git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@617375 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 46acc1d1fa6..57a31af97ac 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -116,7 +116,7 @@ void apr_signal_init(apr_pool_t *pglobal) } const char *apr_signal_description_get(int signum) { - return sys_siglist[signum]; + return (signum >= 0) ? sys_siglist[signum] : "unknown signal (number)"; } #else /* !(SYS_SIGLIST_DECLARED || HAVE_DECL_SYS_SIGLIST) */ @@ -262,7 +262,7 @@ void apr_signal_init(apr_pool_t *pglobal) const char *apr_signal_description_get(int signum) { return - signum < APR_NUMSIG + (signum >= 0 && signum < APR_NUMSIG) ? signal_description[signum] : "unknown signal (number)"; } From 2cd672453d868bf045fd87c674edf5980b0d5a8e Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 6 Feb 2008 15:04:22 +0000 Subject: [PATCH 6122/7878] * build/jlibtool.c (explode_static_lib): Skip over __.SYMDEF and friends on Mac OS X. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@619010 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build/jlibtool.c b/build/jlibtool.c index 4f5c4212b8a..45233a6356f 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -1228,6 +1228,15 @@ int explode_static_lib(command_t *cmd_data, const char *lib) dir = opendir(tmpdir); while ((entry = readdir(dir)) != NULL) { +#if defined(__APPLE__) && defined(RANLIB) + /* Apple inserts __.SYMDEF which isn't needed. + * Leopard (10.5+) can also add '__.SYMDEF SORTED' which isn't + * much fun either. Just skip them. + */ + if (strstr(entry->d_name, "__.SYMDEF") != NULL) { + continue; + } +#endif if (entry->d_name[0] != '.') { push_count_chars(&tmpdir_cc, entry->d_name); name = flatten_count_chars(&tmpdir_cc, 0); From 406d456315ddeabcee3ec485efa162de995eca51 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 8 Feb 2008 12:20:17 +0000 Subject: [PATCH 6123/7878] Minor fixes to jlibtool. * build/jlibtool.c (MODULE_LIB_EXT): Use .bundle on Mac. (parse_short_opt): Recognize -shared properly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@619857 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index 45233a6356f..9bed6bd2a66 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -55,7 +55,7 @@ #if defined(__APPLE__) # define SHELL_CMD "/bin/sh" # define DYNAMIC_LIB_EXT "dylib" -# define MODULE_LIB_EXT "so" +# define MODULE_LIB_EXT "bundle" # define STATIC_LIB_EXT "a" # define OBJECT_EXT "o" # define LIBRARIAN "ar" @@ -593,6 +593,14 @@ int parse_short_opt(char *arg, command_t *cmd_data) return 1; } + if (strcmp(arg, "shared") == 0) { + if (cmd_data->mode == mLink) { + cmd_data->output = otDynamicLibraryOnly; + } + cmd_data->options.shared = share_SHARED; + return 1; + } + if (strcmp(arg, "Zexe") == 0) { return 1; } From 79a01d1f480e720a24e53ff283e52430ad7457d7 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Sat, 23 Feb 2008 20:07:07 +0000 Subject: [PATCH 6124/7878] * Fix compiler warning for uninitialized variable Spotted by: Sebastian Gottschalk Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@630528 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 9ede49e2ab0..bb6ef528a3e 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -689,7 +689,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), register char *s = NULL; char *q; - apr_size_t s_len; + apr_size_t s_len = 0; register apr_size_t min_width = 0; apr_size_t precision = 0; From 75e0aae3193dde7eb994911354fe2ce8ce85211b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 17 Mar 2008 19:14:41 +0000 Subject: [PATCH 6125/7878] Provide the correct buffer size (in wchars) to ExpandEnvironmentStringsW Reported by: Sebastian Gottschalk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@638031 13f79535-47bb-0310-9956-ffa450edef68 --- user/win32/userinfo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index aae3f9bec08..3d45df4f3ee 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -121,7 +121,8 @@ APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, else if (type == REG_EXPAND_SZ) { apr_wchar_t path[MAX_PATH]; char retdir[MAX_PATH]; - ExpandEnvironmentStringsW((apr_wchar_t*)regkey, path, sizeof(path)); + ExpandEnvironmentStringsW((apr_wchar_t*)regkey, path, + sizeof(path) / 2); if ((rv = unicode_to_utf8_path(retdir, sizeof(retdir), path)) != APR_SUCCESS) return rv; From 0f21559a28aa95377ffdd8900ae776f0cb1856b6 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Thu, 27 Mar 2008 00:46:05 +0000 Subject: [PATCH 6126/7878] PR 42580 - fix return value when apr_pollset_poll interrupted git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@641661 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ poll/unix/port.c | 7 +------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index e9052b28d20..15633f10024 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 1.3.0 + *) Fix return value when apr_pollset_poll interrupted. + PR 42580 [Basant Kumar Kukreja ] + *) Add missing semi-colon in Win9x code path of apr_file_open that breaks Win9X Debug builds. PR 44329. [Curt Arnold] diff --git a/poll/unix/port.c b/poll/unix/port.c index 51783d40b7d..05848d6180d 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -295,12 +295,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, if (ret == -1) { (*num) = 0; - if (errno == ETIME || errno == EINTR) { - rv = APR_TIMEUP; - } - else { - rv = APR_EGENERAL; - } + rv = apr_get_netos_error(); } else if (nget == 0) { rv = APR_TIMEUP; From 204b2191cb654e72670b3ff5d56e143d0b271403 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 7 Apr 2008 09:58:48 +0000 Subject: [PATCH 6127/7878] Factor out node free space calculation, and fix off-by-one in the use thereof: * memory/unix/apr_pools.c (node_free_space): New macro. (apr_palloc, psprintf_flush): Use it; correctly compare against free space using <= rather than <. Submitted by: Maxim Yegorushkin , jorton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@645436 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 68e095f2166..fc55960ef55 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -619,6 +619,9 @@ APR_DECLARE(void) apr_pool_terminate(void) node->next->ref = node->ref; \ } while (0) +/* Returns the amount of free space in the given node. */ +#define node_free_space(node_) ((apr_size_t)(node_->endp - node_->first_avail)) + /* * Memory allocation */ @@ -633,7 +636,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) active = pool->active; /* If the active node has enough bytes left, use it. */ - if (size < (apr_size_t)(active->endp - active->first_avail)) { + if (size <= node_free_space(active)) { mem = active->first_avail; active->first_avail += size; @@ -641,7 +644,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) } node = active->next; - if (size < (apr_size_t)(node->endp - node->first_avail)) { + if (size <= node_free_space(node)) { list_remove(node); } else { @@ -943,8 +946,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) size = APR_PSPRINTF_MIN_STRINGSIZE; node = active->next; - if (!ps->got_a_new_node - && size < (apr_size_t)(node->endp - node->first_avail)) { + if (!ps->got_a_new_node && size <= node_free_space(node)) { list_remove(node); list_insert(node, active); From 1f3bdb3bf73bd265938cfac06f6dcb90fbc7b339 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 9 Apr 2008 22:37:22 +0000 Subject: [PATCH 6128/7878] Static global variables are bad on NetWare. Move them into the library application data area. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@646579 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_private.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index ad659b5988b..034271b1b4e 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -160,6 +160,8 @@ typedef struct app_data { rtag_t gs_lookup_rtag; rtag_t gs_event_rtag; rtag_t gs_pcp_rtag; + void* gs_ldap_xref_lock; + void* gs_xref_head; } APP_DATA; int setGlobalPool(void *data); From 7bded5a0f8fa93079d953520f3f804b0bca0f22e Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 9 Apr 2008 22:40:14 +0000 Subject: [PATCH 6129/7878] Initialize the rebind functionality early within the APR library itself to avoid application unload issues. This ties apr to apr-util however on NetWare both libraries are combined. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@646580 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/start.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/netware/start.c b/misc/netware/start.c index c8ccc1c1c49..1e5708d1f7e 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -38,6 +38,7 @@ int (*WSAStartupWithNLMHandle)( WORD version, LPWSADATA data, void *handle ) = NULL; int (*WSACleanupWithNLMHandle)( void *handle ) = NULL; +apr_status_t apr_ldap_rebind_init(apr_pool_t *pool); static int wsa_startup_with_handle (WORD wVersionRequested, LPWSADATA data, void *handle) { @@ -151,6 +152,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) #endif apr_signal_init(pool); + apr_ldap_rebind_init(pool); return APR_SUCCESS; } From ff2414f12f0684df9928ba7947b9a442627bb360 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 12 Apr 2008 06:36:14 +0000 Subject: [PATCH 6130/7878] Introduce apr_pool_create_core_ex git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@647384 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 +++ include/apr_pools.h | 54 +++++++++++++++ memory/unix/apr_pools.c | 148 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 210 insertions(+) diff --git a/CHANGES b/CHANGES index 15633f10024..a9f0ad40804 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,14 @@ -*- coding: utf-8 -*- Changes for APR 1.3.0 + *) Introduce apr_pool_create_core_ex() for creation of standalone + pools without parent. This function should be used for short + living pools, usually ones that are created and destroyed + either in a loop or inside function call. Since the pools + created with this function doesn't have a parent they must + be explicitly destroyed when done. + [Mladen Turk] + *) Fix return value when apr_pollset_poll interrupted. PR 42580 [Basant Kumar Kukreja ] diff --git a/include/apr_pools.h b/include/apr_pools.h index 12b843e119a..0330fa75f19 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -188,6 +188,17 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator); +/** + * Create a new pool. + * @param newpool The pool we have just created. + * @param abort_fn A function to use if the pool cannot allocate more memory. + * @param allocator The allocator to use with the new pool. If NULL the + * new allocator will be crated with newpool as owner. + */ +APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator); + /** * Debug version of apr_pool_create_ex. * @param newpool @see apr_pool_create. @@ -216,6 +227,32 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, APR_POOL__FILE_LINE__) #endif +/** + * Debug version of apr_pool_create_core_ex. + * @param newpool @see apr_pool_create. + * @param abort_fn @see apr_pool_create. + * @param allocator @see apr_pool_create. + * @param file_line Where the function is called from. + * This is usually APR_POOL__FILE_LINE__. + * @remark Only available when APR_POOL_DEBUG is defined. + * Call this directly if you have you apr_pool_create_core_ex + * calls in a wrapper function and wish to override + * the file_line argument to reflect the caller of + * your wrapper function. If you do not have + * apr_pool_create_core_ex in a wrapper, trust the macro + * and don't call apr_pool_create_core_ex_debug directly. + */ +APR_DECLARE(apr_status_t) apr_pool_create_ex_core_debug(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line); + +#if APR_POOL_DEBUG +#define apr_pool_create_core_ex(newpool, abort_fn, allocator) \ + apr_pool_create_core_ex_debug(newpool, abort_fn, allocator, \ + APR_POOL__FILE_LINE__) +#endif + /** * Create a new pool. * @param newpool The pool we have just created. @@ -238,6 +275,23 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, #endif #endif +/** + * Create a new pool. + * @param newpool The pool we have just created. + */ +#if defined(DOXYGEN) +APR_DECLARE(apr_status_t) apr_pool_create_core(apr_pool_t **newpool); +#else +#if APR_POOL_DEBUG +#define apr_pool_create_core(newpool) \ + apr_pool_create_core_ex_debug(newpool, NULL, NULL, \ + APR_POOL__FILE_LINE__) +#else +#define apr_pool_create_core(newpool) \ + apr_pool_create_core_ex(newpool, NULL, NULL) +#endif +#endif + /** * Find the pools allocator * @param pool The pool to get the allocator from. diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index fc55960ef55..c8fa39d4e35 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -893,6 +893,64 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator) +{ + apr_pool_t *pool; + apr_memnode_t *node; + apr_allocator_t *pool_allocator; + + *newpool = NULL; + + if (!apr_pools_initialized) + return APR_ENOPOOL; + if ((pool_allocator = allocator) == NULL) { + if ((pool_allocator = malloc(SIZEOF_ALLOCATOR_T)) == NULL) { + if (abort_fn) + abort_fn(APR_ENOMEM); + + return APR_ENOMEM; + } + memset(pool_allocator, 0, SIZEOF_ALLOCATOR_T); + pool_allocator->max_free_index = APR_ALLOCATOR_MAX_FREE_UNLIMITED; + } + if ((node = allocator_alloc(pool_allocator, + MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { + if (abort_fn) + abort_fn(APR_ENOMEM); + + return APR_ENOMEM; + } + + node->next = node; + node->ref = &node->next; + + pool = (apr_pool_t *)node->first_avail; + node->first_avail = pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; + + pool->allocator = pool_allocator; + pool->active = pool->self = node; + pool->abort_fn = abort_fn; + pool->child = NULL; + pool->cleanups = NULL; + pool->free_cleanups = NULL; + pool->subprocesses = NULL; + pool->user_data = NULL; + pool->tag = NULL; + pool->parent = NULL; + pool->sibling = NULL; + pool->ref = NULL; + +#ifdef NETWARE + pool->owner_proc = (apr_os_proc_t)getnlmhandle(); +#endif /* defined(NETWARE) */ + if (!allocator) + pool_allocator->owner = pool; + *newpool = pool; + + return APR_SUCCESS; +} /* * "Print" functions @@ -1647,6 +1705,75 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line) +{ + apr_pool_t *pool; + apr_allocator_t *pool_allocator; + + *newpool = NULL; + + if ((pool = malloc(SIZEOF_POOL_T)) == NULL) { + if (abort_fn) + abort_fn(APR_ENOMEM); + + return APR_ENOMEM; + } + + memset(pool, 0, SIZEOF_POOL_T); + + pool->abort_fn = abort_fn; + pool->tag = file_line; + pool->file_line = file_line; + +#if APR_HAS_THREADS + pool->owner = apr_os_thread_current(); +#endif /* APR_HAS_THREADS */ +#ifdef NETWARE + pool->owner_proc = (apr_os_proc_t)getnlmhandle(); +#endif /* defined(NETWARE) */ + + if ((pool_allocator = allocator) == NULL) { + apr_status_t rv; + if ((rv = apr_allocator_create(&pool_allocator)) != APR_SUCCESS) { + if (abort_fn) + abort_fn(rv); + return rv; + } + pool_allocator->owner = pool; + } + pool->allocator = pool_allocator; + + if (pool->allocator != allocator) { +#if APR_HAS_THREADS + apr_status_t rv; + + /* No matter what the creation flags say, always create + * a lock. Without it integrity_check and apr_pool_num_bytes + * blow up (because they traverse pools child lists that + * possibly belong to another thread, in combination with + * the pool having no lock). However, this might actually + * hide problems like creating a child pool of a pool + * belonging to another thread. + */ + if ((rv = apr_thread_mutex_create(&pool->mutex, + APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) { + free(pool); + return rv; + } +#endif /* APR_HAS_THREADS */ + } + + *newpool = pool; + +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) + apr_pool_log_event(pool, "CREATE", file_line, 1); +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ + + return APR_SUCCESS; +} /* * "Print" functions (debug) @@ -2288,6 +2415,14 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, return apr_pool_create_ex(newpool, parent, abort_fn, allocator); } +APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line) +{ + return apr_pool_create_core_ex(newpool, abort_fn, allocator); +} + #else /* APR_POOL_DEBUG */ #undef apr_palloc @@ -2338,4 +2473,17 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, "undefined"); } +#undef apr_pool_create_core_ex +APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator); + +APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator) +{ + return apr_pool_create_core_ex_debug(newpool, abort_fn, + allocator, "undefined"); +} + #endif /* APR_POOL_DEBUG */ From 61213cf4dc966ea142bb37d3a39c6887e9b143b4 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 12 Apr 2008 07:22:14 +0000 Subject: [PATCH 6131/7878] Introduce apr_pool_pre_cleanup_register git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@647390 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 ++++++ include/apr_pools.h | 17 +++++++++++++++ memory/unix/apr_pools.c | 47 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) diff --git a/CHANGES b/CHANGES index a9f0ad40804..c6f693d8ae3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,13 @@ -*- coding: utf-8 -*- Changes for APR 1.3.0 + *) Introduce apr_pool_pre_cleanup_register() for registering + a cleanup that is called before any subpool is destroyed + within apr_pool_clear or apr_pool_destroy. + This allows to register a cleanup that will notify subpools + about its inevitable destruction. + [Mladen Turk] + *) Introduce apr_pool_create_core_ex() for creation of standalone pools without parent. This function should be used for short living pools, usually ones that are created and destroyed diff --git a/include/apr_pools.h b/include/apr_pools.h index 0330fa75f19..de0ba3b8e40 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -559,6 +559,23 @@ APR_DECLARE(void) apr_pool_cleanup_register( apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)); +/** + * Register a function to be called when a pool is cleared or destroyed. + * + * Unlike apr_pool_cleanup_register which register a cleanup + * that is called AFTER all subpools are destroyed this function register + * a function that will be called before any of the subpool is destoryed. + * + * @param p The pool register the cleanup with + * @param data The data to pass to the cleanup function. + * @param plain_cleanup The function to call when the pool is cleared + * or destroyed + */ +APR_DECLARE(void) apr_pool_pre_cleanup_register( + apr_pool_t *p, + const void *data, + apr_status_t (*plain_cleanup)(void *)); + /** * Remove a previously registered cleanup function. * diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index c8fa39d4e35..1276b2e926a 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -501,6 +501,8 @@ struct apr_pool_t { #ifdef NETWARE apr_os_proc_t owner_proc; #endif /* defined(NETWARE) */ + cleanup_t *pre_cleanups; + cleanup_t *free_pre_cleanups; }; #define SIZEOF_POOL_T APR_ALIGN_DEFAULT(sizeof(apr_pool_t)) @@ -714,6 +716,11 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) { apr_memnode_t *active; + /* Run pre destroy cleanups */ + run_cleanups(&pool->pre_cleanups); + pool->pre_cleanups = NULL; + pool->free_pre_cleanups = NULL; + /* Destroy the subpools. The subpools will detach themselves from * this pool thus this loop is safe and easy. */ @@ -752,6 +759,11 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) apr_memnode_t *active; apr_allocator_t *allocator; + /* Run pre destroy cleanups */ + run_cleanups(&pool->pre_cleanups); + pool->pre_cleanups = NULL; + pool->free_pre_cleanups = NULL; + /* Destroy the subpools. The subpools will detach themselve from * this pool thus this loop is safe and easy. */ @@ -856,6 +868,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, pool->child = NULL; pool->cleanups = NULL; pool->free_cleanups = NULL; + pool->pre_cleanups = NULL; + pool->free_pre_cleanups = NULL; pool->subprocesses = NULL; pool->user_data = NULL; pool->tag = NULL; @@ -935,6 +949,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, pool->child = NULL; pool->cleanups = NULL; pool->free_cleanups = NULL; + pool->pre_cleanups = NULL; + pool->free_pre_cleanups = NULL; pool->subprocesses = NULL; pool->user_data = NULL; pool->tag = NULL; @@ -1467,6 +1483,11 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) debug_node_t *node; apr_uint32_t index; + /* Run pre destroy cleanups */ + run_cleanups(&pool->pre_cleanups); + pool->pre_cleanups = NULL; + pool->free_pre_cleanups = NULL; + /* Destroy the subpools. The subpools will detach themselves from * this pool thus this loop is safe and easy. */ @@ -2175,6 +2196,32 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, lastp = &c->next; c = c->next; } + + /* Remove any pre-cleanup as well */ + c = p->pre_cleanups; + lastp = &p->pre_cleanups; + while (c) { +#if APR_POOL_DEBUG + /* Some cheap loop detection to catch a corrupt list: */ + if (c == c->next + || (c->next && c == c->next->next) + || (c->next && c->next->next && c == c->next->next->next)) { + abort(); + } +#endif + + if (c->data == data && c->plain_cleanup_fn == cleanup_fn) { + *lastp = c->next; + /* move to freelist */ + c->next = p->free_pre_cleanups; + p->free_pre_cleanups = c; + break; + } + + lastp = &c->next; + c = c->next; + } + } APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, From 2a291d960072bf159b4a3ea1f2f0453aa194e642 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 12 Apr 2008 08:42:51 +0000 Subject: [PATCH 6132/7878] Introduce apr_pool_sys_allocator_set git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@647394 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 10 +++++ include/apr_pools.h | 34 ++++++++++++++ memory/unix/apr_pools.c | 99 +++++++++++++++++++++++++++++++++-------- 3 files changed, 125 insertions(+), 18 deletions(-) diff --git a/CHANGES b/CHANGES index c6f693d8ae3..5be3a1b7d6c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,16 @@ -*- coding: utf-8 -*- Changes for APR 1.3.0 + *) Introduce apr_pool_sys_allocator_set() for registering + application provided memory allocation functions that + will APR use internally whenever malloc/free is needed. + This allows to use custom memory allocators insted + sustem default malloc/free. This is one time initialization + function and must be used before any oter APR call. + After the first allocation function is called those + callbacks cannot be changed. + [Mladen Turk] + *) Introduce apr_pool_pre_cleanup_register() for registering a cleanup that is called before any subpool is destroyed within apr_pool_clear or apr_pool_destroy. diff --git a/include/apr_pools.h b/include/apr_pools.h index de0ba3b8e40..a3cd4c19ef3 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -149,6 +149,40 @@ typedef int (*apr_abortfunc_t)(int retcode); * Initialization */ +/** A function that allocates memory from the system. */ +typedef void* (*apr_sys_alloc_t)(apr_size_t size, void *data); + +/** A function that allocates memory from the system. */ +typedef void* (*apr_sys_realloc_t)(void *mem, apr_size_t new_size, void *data); + +/** A function that frees memory. */ +typedef void (*apr_sys_free_t)(void *memory, void *data); + +/** + * Setup system memory alloc and free functions. + * + * If set APR will use those functions whenever it internally + * needs to allocate or free the memory. + * + * @param alloc_fn A function to use for allocating memory. + * @param alloc_data The data to pass to the alloc function. + * @param realloc_fn A function to use for reallocating memory. + * @param realloc_data The data to pass to the realloc function. + * @param free_fn A function to use for freeing memory. + * @param free_data The data to pass to the free function. + * @return APR_EINVAL if one of the functions is not provided. + * APR_EINIT if apr_pool_initialize was already called. + * @remark This function MUST be called before pool initializtion. + * If application don't set those functions the system + * will use malloc/realloc/free instead. + */ +APR_DECLARE(apr_status_t) apr_pool_sys_allocator_set(apr_sys_alloc_t alloc_fn, + void *alloc_data, + apr_sys_realloc_t realloc_fn, + void *realloc_data, + apr_sys_free_t free_fn, + void *free_data); + /** * Setup all of the internal structures required to use pools * @remark Programs do NOT need to call this directly. APR will call this diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 1276b2e926a..04c23990011 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -100,6 +100,44 @@ struct apr_allocator_t { #define SIZEOF_ALLOCATOR_T APR_ALIGN_DEFAULT(sizeof(apr_allocator_t)) +/* Global system allocator functions */ +static apr_sys_alloc_t global_allocfn = NULL; +static apr_sys_realloc_t global_reallocfn = NULL; +static apr_sys_free_t global_freefn = NULL; +static void *global_allocdata = NULL; +static void *global_reallocdata = NULL; +static void *global_freedata = NULL; + +/* + * System memory allocator + */ + +static APR_INLINE +void *APR_MALLOC(apr_size_t size) +{ + if (global_allocfn) + return (*global_allocfn)(size, global_allocdata); + else + return malloc(size); +} + +static APR_INLINE +void APR_FREE(void *mem) +{ + if (global_freefn) + (*global_freefn)(mem, global_freedata); + else + free(mem); +} + +static APR_INLINE +void *APR_REALLOC(void *mem, apr_size_t new_size) +{ + if (global_reallocfn) + return (*global_reallocfn)(mem, new_size, global_reallocdata); + else + return realloc(mem, new_size); +} /* * Allocator @@ -111,7 +149,7 @@ APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator) *allocator = NULL; - if ((new_allocator = malloc(SIZEOF_ALLOCATOR_T)) == NULL) + if ((new_allocator = APR_MALLOC(SIZEOF_ALLOCATOR_T)) == NULL) return APR_ENOMEM; memset(new_allocator, 0, SIZEOF_ALLOCATOR_T); @@ -131,11 +169,11 @@ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) ref = &allocator->free[index]; while ((node = *ref) != NULL) { *ref = node->next; - free(node); + APR_FREE(node); } } - free(allocator); + APR_FREE(allocator); } #if APR_HAS_THREADS @@ -320,7 +358,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size) /* If we haven't got a suitable node, malloc a new one * and initialize it. */ - if ((node = malloc(size)) == NULL) + if ((node = APR_MALLOC(size)) == NULL) return NULL; node->next = NULL; @@ -397,7 +435,7 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) while (freelist != NULL) { node = freelist; freelist = node->next; - free(node); + APR_FREE(node); } } @@ -523,6 +561,31 @@ static apr_allocator_t *global_allocator = NULL; static apr_file_t *file_stderr = NULL; #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ +APR_DECLARE(apr_status_t) apr_pool_sys_allocator_set(apr_sys_alloc_t alloc_fn, + void *alloc_data, + apr_sys_realloc_t realloc_fn, + void *realloc_data, + apr_sys_free_t free_fn, + void *free_data) +{ + if (apr_pools_initialized) { + /* We cannot intermix memory allocation functions */ + return APR_EINIT; + } + if (alloc_fn && realloc_fn && free_fn) { + global_allocfn = alloc_fn; + global_reallocfn = realloc_fn; + global_freefn = free_fn; + global_allocdata = alloc_data; + global_reallocdata = realloc_data; + global_freedata = free_data; + + return APR_SUCCESS; + } + else + return APR_EINVAL; +} + /* * Local functions */ @@ -920,7 +983,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, if (!apr_pools_initialized) return APR_ENOPOOL; if ((pool_allocator = allocator) == NULL) { - if ((pool_allocator = malloc(SIZEOF_ALLOCATOR_T)) == NULL) { + if ((pool_allocator = APR_MALLOC(SIZEOF_ALLOCATOR_T)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -1405,7 +1468,7 @@ static void *pool_alloc(apr_pool_t *pool, apr_size_t size) debug_node_t *node; void *mem; - if ((mem = malloc(size)) == NULL) { + if ((mem = APR_MALLOC(size)) == NULL) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); @@ -1414,7 +1477,7 @@ static void *pool_alloc(apr_pool_t *pool, apr_size_t size) node = pool->nodes; if (node == NULL || node->index == 64) { - if ((node = malloc(SIZEOF_DEBUG_NODE_T)) == NULL) { + if ((node = APR_MALLOC(SIZEOF_DEBUG_NODE_T)) == NULL) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); @@ -1518,11 +1581,11 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) for (index = 0; index < node->index; index++) { memset(node->beginp[index], POOL_POISON_BYTE, (char *)node->endp[index] - (char *)node->beginp[index]); - free(node->beginp[index]); + APR_FREE(node->beginp[index]); } memset(node, POOL_POISON_BYTE, SIZEOF_DEBUG_NODE_T); - free(node); + APR_FREE(node); } pool->stat_alloc = 0; @@ -1606,7 +1669,7 @@ static void pool_destroy_debug(apr_pool_t *pool, const char *file_line) } /* Free the pool itself */ - free(pool); + APR_FREE(pool); } APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, @@ -1648,7 +1711,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, if (!abort_fn && parent) abort_fn = parent->abort_fn; - if ((pool = malloc(SIZEOF_POOL_T)) == NULL) { + if ((pool = APR_MALLOC(SIZEOF_POOL_T)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -1705,7 +1768,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, */ if ((rv = apr_thread_mutex_create(&pool->mutex, APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) { - free(pool); + APR_FREE(pool); return rv; } #endif /* APR_HAS_THREADS */ @@ -1736,7 +1799,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, *newpool = NULL; - if ((pool = malloc(SIZEOF_POOL_T)) == NULL) { + if ((pool = APR_MALLOC(SIZEOF_POOL_T)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -1781,7 +1844,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, */ if ((rv = apr_thread_mutex_create(&pool->mutex, APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) { - free(pool); + APR_FREE(pool); return rv; } #endif /* APR_HAS_THREADS */ @@ -1814,7 +1877,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) size = ps->vbuff.curpos - ps->mem; ps->size <<= 1; - if ((ps->mem = realloc(ps->mem, ps->size)) == NULL) + if ((ps->mem = APR_REALLOC(ps->mem, ps->size)) == NULL) return -1; ps->vbuff.curpos = ps->mem + size; @@ -1831,7 +1894,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) apr_pool_check_integrity(pool); ps.size = 64; - ps.mem = malloc(ps.size); + ps.mem = APR_MALLOC(ps.size); ps.vbuff.curpos = ps.mem; /* Save a byte for the NUL terminator */ @@ -1851,7 +1914,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) */ node = pool->nodes; if (node == NULL || node->index == 64) { - if ((node = malloc(SIZEOF_DEBUG_NODE_T)) == NULL) { + if ((node = APR_MALLOC(SIZEOF_DEBUG_NODE_T)) == NULL) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); From 730bba643fb0632f8f4bebad05ec8cd0cd0c8b8f Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 12 Apr 2008 13:37:37 +0000 Subject: [PATCH 6133/7878] Add apr_pool_pre_cleanup_register implementation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@647447 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 04c23990011..8bb3632a42d 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -2224,6 +2224,30 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, } } +APR_DECLARE(void) apr_pool_pre_cleanup_register(apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup_fn)(void *data)) +{ + cleanup_t *c; + +#if APR_POOL_DEBUG + apr_pool_check_integrity(p); +#endif /* APR_POOL_DEBUG */ + + if (p != NULL) { + if (p->free_pre_cleanups) { + /* reuse a cleanup structure */ + c = p->free_pre_cleanups; + p->free_pre_cleanups = c->next; + } else { + c = apr_palloc(p, sizeof(cleanup_t)); + } + c->data = data; + c->plain_cleanup_fn = plain_cleanup_fn; + c->next = p->cleanups; + p->cleanups = c; + } +} + APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup_fn)(void *)) { From 8224a243b3e389510171da72b0a1af15e7da3c85 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 12 Apr 2008 13:42:33 +0000 Subject: [PATCH 6134/7878] Fix typo for r647384 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@647448 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index a3cd4c19ef3..986f261b003 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -276,7 +276,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, * apr_pool_create_core_ex in a wrapper, trust the macro * and don't call apr_pool_create_core_ex_debug directly. */ -APR_DECLARE(apr_status_t) apr_pool_create_ex_core_debug(apr_pool_t **newpool, +APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, const char *file_line); From fb5dba0ea3e5a30a810beea62ef2b6bc8d224a03 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sun, 13 Apr 2008 08:31:03 +0000 Subject: [PATCH 6135/7878] Introduce apr_pollset_wakeup() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@647540 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++ include/apr_poll.h | 6 ++ poll/unix/epoll.c | 154 ++++++++++++++++++++++++++++++++++++++++----- poll/unix/kqueue.c | 15 +++++ poll/unix/poll.c | 151 +++++++++++++++++++++++++++++++++++++++----- poll/unix/port.c | 16 +++++ poll/unix/select.c | 18 ++++++ test/testpoll.c | 17 +++++ 8 files changed, 352 insertions(+), 29 deletions(-) diff --git a/CHANGES b/CHANGES index 5be3a1b7d6c..a5bf73c4ba6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 1.3.0 + *) Introduce apr_pollset_wakeup() for interrupting + the blocking apr_pollset_poll call. + [Mladen Turk] + *) Introduce apr_pool_sys_allocator_set() for registering application provided memory allocation functions that will APR use internally whenever malloc/free is needed. diff --git a/include/apr_poll.h b/include/apr_poll.h index 92a540a95e6..f6e85735a27 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -56,6 +56,7 @@ extern "C" { */ #define APR_POLLSET_THREADSAFE 0x001 /**< Adding or Removing a Descriptor is thread safe */ #define APR_POLLSET_NOCOPY 0x002 /**< Descriptors passed to apr_pollset_create() are not copied */ +#define APR_POLLSET_WAKEABLE 0x004 /**< Pollset poll operation is interruptable */ /** Used in apr_pollfd_t to determine what the apr_descriptor is */ typedef enum { @@ -166,6 +167,11 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_int32_t *num, const apr_pollfd_t **descriptors); +/** + * Interrupt the blocked apr_pollset_poll call. + * @param pollset The pollset to use + */ +APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset); /** * Poll the descriptors in the poll structure diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 7a3831bee0b..5028e94d7c2 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -68,6 +68,8 @@ struct apr_pollset_t #if APR_HAS_THREADS /* A thread mutex to protect operations on the rings */ apr_thread_mutex_t *ring_lock; + /* Pipe descriptors used for wakeup */ + apr_file_t *wakeup_pipe[2]; #endif /* A ring containing all of the pollfd_t that are active */ APR_RING_HEAD(pfd_query_ring_t, pfd_elem_t) query_ring; @@ -80,11 +82,61 @@ struct apr_pollset_t static apr_status_t backend_cleanup(void *p_) { + apr_status_t rv = APR_SUCCESS; apr_pollset_t *pollset = (apr_pollset_t *) p_; + close(pollset->epoll_fd); - return APR_SUCCESS; +#if APR_HAS_THREADS + if (pollset->flags & APR_POLLSET_WAKEABLE) { + /* Close both sides of the wakeup pipe */ + rv |= apr_file_close(pollset->wakeup_pipe[0]); + rv |= apr_file_close(pollset->wakeup_pipe[1]); + } +#endif + return rv; } +#if APR_HAS_THREADS + +/* Create a dummy wakeup pipe for interrupting the poller + */ +static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) +{ + apr_status_t rv; + apr_pollfd_t fd; + + if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], + &pollset->wakeup_pipe[1], + pollset->pool)) != APR_SUCCESS) + return rv; + fd.reqevents = APR_POLLIN; + fd.desc_type = APR_POLL_FILE; + fd.desc.f = pollset->wakeup_pipe[0]; + /* Add the pipe to the pollset + */ + return apr_pollset_add(pollset, &fd); +} + +/* Read and discard what's ever in the wakeup pipe. + */ +static void drain_wakeup_pipe(apr_pollset_t *pollset) +{ + char rb[512]; + apr_size_t nr = sizeof(rb); + + while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { + /* Although we write just one byte to the other end of the pipe + * during wakeup, multiple treads could call the wakeup. + * So simply drain out from the input side of the pipe all + * the data. + */ + if (nr != sizeof(rb)) + break; + } +} + +#endif + APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, @@ -93,6 +145,13 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_status_t rv; int fd; +#if APR_HAS_THREADS + if (flags & APR_POLLSET_WAKEABLE) { + /* Add room for wakeup descriptor */ + size++; + } +#endif + fd = epoll_create(size); if (fd < 0) { *pollset = NULL; @@ -110,7 +169,8 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, return rv; } #else - if (flags & APR_POLLSET_THREADSAFE) { + if (flags & APR_POLLSET_THREADSAFE || + flags & APR_POLLSET_WAKEABLE) { *pollset = NULL; return APR_ENOTIMPL; } @@ -121,7 +181,6 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, (*pollset)->pool = p; (*pollset)->epoll_fd = fd; (*pollset)->pollset = apr_palloc(p, size * sizeof(struct epoll_event)); - apr_pool_cleanup_register(p, *pollset, backend_cleanup, backend_cleanup); (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); if (!(flags & APR_POLLSET_NOCOPY)) { @@ -129,6 +188,18 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link); APR_RING_INIT(&(*pollset)->dead_ring, pfd_elem_t, link); } +#if APR_HAS_THREADS + if (flags & APR_POLLSET_WAKEABLE) { + /* Create wakeup pipe */ + if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { + close(fd); + *pollset = NULL; + return rv; + } + } +#endif + apr_pool_cleanup_register(p, *pollset, backend_cleanup, backend_cleanup); + return APR_SUCCESS; } @@ -244,8 +315,9 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_int32_t *num, const apr_pollfd_t **descriptors) { - int ret, i; + int ret, i, j; apr_status_t rv = APR_SUCCESS; + apr_pollfd_t fd; if (timeout > 0) { timeout /= 1000; @@ -263,23 +335,59 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } else { if (pollset->flags & APR_POLLSET_NOCOPY) { - for (i = 0; i < ret; i++) { - pollset->result_set[i] = - *((apr_pollfd_t *) (pollset->pollset[i].data.ptr)); - pollset->result_set[i].rtnevents = - get_epoll_revent(pollset->pollset[i].events); + for (i = 0, j = 0; i < ret; i++) { + fd = *((apr_pollfd_t *) (pollset->pollset[i].data.ptr)); +#if APR_HAS_THREADS + /* Check if the polled descriptor is our + * wakeup pipe. In that case do not put it result set. + */ + if ((pollset->flags & APR_POLLSET_WAKEABLE) && + fd.desc_type == APR_POLL_FILE && + fd.desc.f == pollset->wakeup_pipe[0]) { + drain_wakeup_pipe(pollset); + /* XXX: Is this a correct return value ? + * We might simply return APR_SUCEESS. + */ + rv = APR_EINTR; + } + else +#endif + { + pollset->result_set[j] = fd; + pollset->result_set[j].rtnevents = + get_epoll_revent(pollset->pollset[i].events); + + j++; + } } + (*num) = j; } else { - for (i = 0; i < ret; i++) { - pollset->result_set[i] = - (((pfd_elem_t *) (pollset->pollset[i].data.ptr))->pfd); - pollset->result_set[i].rtnevents = - get_epoll_revent(pollset->pollset[i].events); + for (i = 0, j = 0; i < ret; i++) { + fd = (((pfd_elem_t *) (pollset->pollset[i].data.ptr))->pfd); +#if APR_HAS_THREADS + if ((pollset->flags & APR_POLLSET_WAKEABLE) && + fd.desc_type == APR_POLL_FILE && + fd.desc.f == pollset->wakeup_pipe[0]) { + drain_wakeup_pipe(pollset); + /* XXX: Is this a correct return value ? + * We might simply return APR_SUCEESS. + */ + rv = APR_EINTR; + } + else +#endif + { + pollset->result_set[j] = fd; + pollset->result_set[j].rtnevents = + get_epoll_revent(pollset->pollset[i].events); + j++; + } } + (*num) = j; } - if (descriptors) { + if (descriptors && (*num)) { *descriptors = pollset->result_set; } } @@ -296,6 +404,22 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return rv; } +APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) +{ +#if APR_HAS_THREADS + if (pollset->flags & APR_POLLSET_WAKEABLE) + return apr_file_putc(1, pollset->wakeup_pipe[1]); + else + return APR_EINIT; +#else + /* In case APR was compiled without thread support + * makes no sense to have wakeup operation usable + * only in multithreading environment. + */ + return APR_ENOTIMPL; +#endif +} + struct apr_pollcb_t { apr_pool_t *pool; apr_uint32_t nalloc; diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 501953dc43b..6547bf620f4 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -281,6 +281,21 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return rv; } +APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) +{ +#if APR_HAS_THREADS + if (pollset->flags & APR_POLLSET_WAKEABLE) + return APR_ENOTIMPL; + else + return APR_EINIT; +#else + /* In case APR was compiled without thread support + * makes no sense to have wakeup operation usable + * only in multithreading environment. + */ + return APR_ENOTIMPL; +#endif +} struct apr_pollcb_t { apr_pool_t *pool; diff --git a/poll/unix/poll.c b/poll/unix/poll.c index cca8bfe8a4e..6f43c41bae5 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -156,11 +156,70 @@ struct apr_pollset_t apr_pool_t *pool; apr_uint32_t nelts; apr_uint32_t nalloc; + apr_uint32_t flags; +#if APR_HAS_THREADS + /* Pipe descriptors used for wakeup */ + apr_file_t *wakeup_pipe[2]; +#endif struct pollfd *pollset; apr_pollfd_t *query_set; apr_pollfd_t *result_set; }; +#if APR_HAS_THREADS + +static apr_status_t wakeup_pipe_cleanup(void *p) +{ + apr_status_t rv = APR_SUCCESS; + apr_pollset_t *pollset = (apr_pollset_t *)p; + + if (pollset->flags & APR_POLLSET_WAKEABLE) { + /* Close both sides of the wakeup pipe */ + rv |= apr_file_close(pollset->wakeup_pipe[0]); + rv |= apr_file_close(pollset->wakeup_pipe[1]); + } + return rv; +} + +/* Create a dummy wakeup pipe for interrupting the poller + */ +static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) +{ + apr_status_t rv; + apr_pollfd_t fd; + + if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], + &pollset->wakeup_pipe[1], + pollset->pool)) != APR_SUCCESS) + return rv; + fd.reqevents = APR_POLLIN; + fd.desc_type = APR_POLL_FILE; + fd.desc.f = pollset->wakeup_pipe[0]; + /* Add the pipe to the pollset + */ + return apr_pollset_add(pollset, &fd); +} + +/* Read and discard what's ever in the wakeup pipe. + */ +static void drain_wakeup_pipe(apr_pollset_t *pollset) +{ + char rb[512]; + apr_size_t nr = sizeof(rb); + + while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { + /* Although we write just one byte to the other end of the pipe + * during wakeup, multiple treads could call the wakeup. + * So simply drain out from the input side of the pipe all + * the data. + */ + if (nr != sizeof(rb)) + break; + } +} + +#endif + APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, @@ -170,19 +229,46 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, *pollset = NULL; return APR_ENOTIMPL; } + if (flags & APR_POLLSET_WAKEABLE) { +#if APR_HAS_THREADS + /* Add room for wakeup descriptor */ + size++; +#else + *pollset = NULL; + return APR_ENOTIMPL; +#endif + } *pollset = apr_palloc(p, sizeof(**pollset)); (*pollset)->nelts = 0; (*pollset)->nalloc = size; (*pollset)->pool = p; + (*pollset)->flags = flags; (*pollset)->pollset = apr_palloc(p, size * sizeof(struct pollfd)); (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); +#if APR_HAS_THREADS + if (flags & APR_POLLSET_WAKEABLE) { + apr_status_t rv; + /* Create wakeup pipe */ + if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { + *pollset = NULL; + return rv; + } + apr_pool_cleanup_register(p, *pollset, wakeup_pipe_cleanup, + wakeup_pipe_cleanup); + } +#endif + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) { +#if APR_HAS_THREADS + if (pollset->flags & APR_POLLSET_WAKEABLE) + return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup); +#endif return APR_SUCCESS; } @@ -242,32 +328,69 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_int32_t *num, const apr_pollfd_t **descriptors) { - int rv; + int ret; + apr_status_t rv = APR_SUCCESS; apr_uint32_t i, j; if (timeout > 0) { timeout /= 1000; } - rv = poll(pollset->pollset, pollset->nelts, timeout); - (*num) = rv; - if (rv < 0) { + ret = poll(pollset->pollset, pollset->nelts, timeout); + (*num) = ret; + if (ret < 0) { return apr_get_netos_error(); } - if (rv == 0) { + else if (res == 0) { return APR_TIMEUP; } - j = 0; - for (i = 0; i < pollset->nelts; i++) { - if (pollset->pollset[i].revents != 0) { - pollset->result_set[j] = pollset->query_set[i]; - pollset->result_set[j].rtnevents = - get_revent(pollset->pollset[i].revents); - j++; + else { + for (i = 0, j = 0; i < pollset->nelts; i++) { + if (pollset->pollset[i].revents != 0) { +#if APR_HAS_THREADS + /* Check if the polled descriptor is our + * wakeup pipe. In that case do not put it result set. + */ + if ((pollset->flags & APR_POLLSET_WAKEABLE) && + pollset->pollset[i].desc_type == APR_POLL_FILE && + pollset->pollset[i].desc.f == pollset->wakeup_pipe[0]) { + drain_wakeup_pipe(pollset); + /* XXX: Is this a correct return value ? + * We might simply return APR_SUCEESS. + */ + rv = APR_EINTR; + } + else +#endif + { + pollset->result_set[j] = pollset->query_set[i]; + pollset->result_set[j].rtnevents = + get_revent(pollset->pollset[i].revents); + j++; + } + } } + (*num) = j; } - if (descriptors) + if (descriptors && (*num)) *descriptors = pollset->result_set; - return APR_SUCCESS; + return rv; +} + +APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) +{ +#if APR_HAS_THREADS + if (pollset->flags & APR_POLLSET_WAKEABLE) { + return apr_file_putc(1, pollset->wakeup_pipe[1]); + } + else + return APR_EINIT; +#else + /* In case APR was compiled without thread support + * makes no sense to have wakeup operation usable + * only in multithreading environment. + */ + return APR_ENOTIMPL; +#endif } APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, diff --git a/poll/unix/port.c b/poll/unix/port.c index 05848d6180d..2842e2781d5 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -335,6 +335,22 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return rv; } +APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) +{ +#if APR_HAS_THREADS + if (pollset->flags & APR_POLLSET_WAKEABLE) + return APR_ENOTIMPL; + else + return APR_EINIT; +#else + /* In case APR was compiled without thread support + * makes no sense to have wakeup operation usable + * only in multithreading environment. + */ + return APR_ENOTIMPL; +#endif +} + struct apr_pollcb_t { apr_pool_t *pool; apr_uint32_t nalloc; diff --git a/poll/unix/select.c b/poll/unix/select.c index 42e7a3f68ec..64b0f050af9 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -175,6 +175,7 @@ struct apr_pollset_t apr_uint32_t nelts; apr_uint32_t nalloc; + apr_uint32_t flags; fd_set readset, writeset, exceptset; int maxfd; apr_pollfd_t *query_set; @@ -203,6 +204,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, (*pollset)->nelts = 0; (*pollset)->nalloc = size; (*pollset)->pool = p; + (*pollset)->flags = flags; FD_ZERO(&((*pollset)->readset)); FD_ZERO(&((*pollset)->writeset)); FD_ZERO(&((*pollset)->exceptset)); @@ -406,6 +408,22 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) +{ +#if APR_HAS_THREADS + if (pollset->flags & APR_POLLSET_WAKEABLE) + return APR_ENOTIMPL; + else + return APR_EINIT; +#else + /* In case APR was compiled without thread support + * makes no sense to have wakeup operation usable + * only in multithreading environment. + */ + return APR_ENOTIMPL; +#endif +} + APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, apr_uint32_t size, apr_pool_t *p, diff --git a/test/testpoll.c b/test/testpoll.c index e7792c2f11a..a0f56a1490d 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -659,6 +659,22 @@ static void timeout_pollin_pollcb(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } +static void test_wakeup(abts_case *tc, void *data) +{ + apr_status_t rv; + int i, lrv; + const apr_pollfd_t *descs = NULL; + + for (i = 0; i < 1000; i++) { + rv = apr_pollset_wakeup(pollset); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + } + rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EINTR(rv)); + ABTS_INT_EQUAL(tc, 0, lrv); + ABTS_PTR_EQUAL(tc, NULL, descs); +} + abts_suite *testpoll(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -688,6 +704,7 @@ abts_suite *testpoll(abts_suite *suite) abts_run_test(suite, clear_middle_pollset, NULL); abts_run_test(suite, send_last_pollset, NULL); abts_run_test(suite, clear_last_pollset, NULL); + abts_run_test(suite, test_wakeup, NULL); abts_run_test(suite, pollset_remove, NULL); From b0612499248f48cd44373440296712020d9a250f Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sun, 13 Apr 2008 11:37:52 +0000 Subject: [PATCH 6136/7878] Revert r47540 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@647562 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 -- include/apr_poll.h | 6 -- poll/unix/epoll.c | 154 +++++---------------------------------------- poll/unix/kqueue.c | 15 ----- poll/unix/poll.c | 151 +++++--------------------------------------- poll/unix/port.c | 16 ----- poll/unix/select.c | 18 ------ test/testpoll.c | 17 ----- 8 files changed, 29 insertions(+), 352 deletions(-) diff --git a/CHANGES b/CHANGES index a5bf73c4ba6..5be3a1b7d6c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,10 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 1.3.0 - *) Introduce apr_pollset_wakeup() for interrupting - the blocking apr_pollset_poll call. - [Mladen Turk] - *) Introduce apr_pool_sys_allocator_set() for registering application provided memory allocation functions that will APR use internally whenever malloc/free is needed. diff --git a/include/apr_poll.h b/include/apr_poll.h index f6e85735a27..92a540a95e6 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -56,7 +56,6 @@ extern "C" { */ #define APR_POLLSET_THREADSAFE 0x001 /**< Adding or Removing a Descriptor is thread safe */ #define APR_POLLSET_NOCOPY 0x002 /**< Descriptors passed to apr_pollset_create() are not copied */ -#define APR_POLLSET_WAKEABLE 0x004 /**< Pollset poll operation is interruptable */ /** Used in apr_pollfd_t to determine what the apr_descriptor is */ typedef enum { @@ -167,11 +166,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_int32_t *num, const apr_pollfd_t **descriptors); -/** - * Interrupt the blocked apr_pollset_poll call. - * @param pollset The pollset to use - */ -APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset); /** * Poll the descriptors in the poll structure diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 5028e94d7c2..7a3831bee0b 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -68,8 +68,6 @@ struct apr_pollset_t #if APR_HAS_THREADS /* A thread mutex to protect operations on the rings */ apr_thread_mutex_t *ring_lock; - /* Pipe descriptors used for wakeup */ - apr_file_t *wakeup_pipe[2]; #endif /* A ring containing all of the pollfd_t that are active */ APR_RING_HEAD(pfd_query_ring_t, pfd_elem_t) query_ring; @@ -82,61 +80,11 @@ struct apr_pollset_t static apr_status_t backend_cleanup(void *p_) { - apr_status_t rv = APR_SUCCESS; apr_pollset_t *pollset = (apr_pollset_t *) p_; - close(pollset->epoll_fd); -#if APR_HAS_THREADS - if (pollset->flags & APR_POLLSET_WAKEABLE) { - /* Close both sides of the wakeup pipe */ - rv |= apr_file_close(pollset->wakeup_pipe[0]); - rv |= apr_file_close(pollset->wakeup_pipe[1]); - } -#endif - return rv; -} - -#if APR_HAS_THREADS - -/* Create a dummy wakeup pipe for interrupting the poller - */ -static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) -{ - apr_status_t rv; - apr_pollfd_t fd; - - if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], - &pollset->wakeup_pipe[1], - pollset->pool)) != APR_SUCCESS) - return rv; - fd.reqevents = APR_POLLIN; - fd.desc_type = APR_POLL_FILE; - fd.desc.f = pollset->wakeup_pipe[0]; - /* Add the pipe to the pollset - */ - return apr_pollset_add(pollset, &fd); -} - -/* Read and discard what's ever in the wakeup pipe. - */ -static void drain_wakeup_pipe(apr_pollset_t *pollset) -{ - char rb[512]; - apr_size_t nr = sizeof(rb); - - while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { - /* Although we write just one byte to the other end of the pipe - * during wakeup, multiple treads could call the wakeup. - * So simply drain out from the input side of the pipe all - * the data. - */ - if (nr != sizeof(rb)) - break; - } + return APR_SUCCESS; } -#endif - APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, @@ -145,13 +93,6 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_status_t rv; int fd; -#if APR_HAS_THREADS - if (flags & APR_POLLSET_WAKEABLE) { - /* Add room for wakeup descriptor */ - size++; - } -#endif - fd = epoll_create(size); if (fd < 0) { *pollset = NULL; @@ -169,8 +110,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, return rv; } #else - if (flags & APR_POLLSET_THREADSAFE || - flags & APR_POLLSET_WAKEABLE) { + if (flags & APR_POLLSET_THREADSAFE) { *pollset = NULL; return APR_ENOTIMPL; } @@ -181,6 +121,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, (*pollset)->pool = p; (*pollset)->epoll_fd = fd; (*pollset)->pollset = apr_palloc(p, size * sizeof(struct epoll_event)); + apr_pool_cleanup_register(p, *pollset, backend_cleanup, backend_cleanup); (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); if (!(flags & APR_POLLSET_NOCOPY)) { @@ -188,18 +129,6 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link); APR_RING_INIT(&(*pollset)->dead_ring, pfd_elem_t, link); } -#if APR_HAS_THREADS - if (flags & APR_POLLSET_WAKEABLE) { - /* Create wakeup pipe */ - if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { - close(fd); - *pollset = NULL; - return rv; - } - } -#endif - apr_pool_cleanup_register(p, *pollset, backend_cleanup, backend_cleanup); - return APR_SUCCESS; } @@ -315,9 +244,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_int32_t *num, const apr_pollfd_t **descriptors) { - int ret, i, j; + int ret, i; apr_status_t rv = APR_SUCCESS; - apr_pollfd_t fd; if (timeout > 0) { timeout /= 1000; @@ -335,59 +263,23 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } else { if (pollset->flags & APR_POLLSET_NOCOPY) { - for (i = 0, j = 0; i < ret; i++) { - fd = *((apr_pollfd_t *) (pollset->pollset[i].data.ptr)); -#if APR_HAS_THREADS - /* Check if the polled descriptor is our - * wakeup pipe. In that case do not put it result set. - */ - if ((pollset->flags & APR_POLLSET_WAKEABLE) && - fd.desc_type == APR_POLL_FILE && - fd.desc.f == pollset->wakeup_pipe[0]) { - drain_wakeup_pipe(pollset); - /* XXX: Is this a correct return value ? - * We might simply return APR_SUCEESS. - */ - rv = APR_EINTR; - } - else -#endif - { - pollset->result_set[j] = fd; - pollset->result_set[j].rtnevents = - get_epoll_revent(pollset->pollset[i].events); - - j++; - } + for (i = 0; i < ret; i++) { + pollset->result_set[i] = + *((apr_pollfd_t *) (pollset->pollset[i].data.ptr)); + pollset->result_set[i].rtnevents = + get_epoll_revent(pollset->pollset[i].events); } - (*num) = j; } else { - for (i = 0, j = 0; i < ret; i++) { - fd = (((pfd_elem_t *) (pollset->pollset[i].data.ptr))->pfd); -#if APR_HAS_THREADS - if ((pollset->flags & APR_POLLSET_WAKEABLE) && - fd.desc_type == APR_POLL_FILE && - fd.desc.f == pollset->wakeup_pipe[0]) { - drain_wakeup_pipe(pollset); - /* XXX: Is this a correct return value ? - * We might simply return APR_SUCEESS. - */ - rv = APR_EINTR; - } - else -#endif - { - pollset->result_set[j] = fd; - pollset->result_set[j].rtnevents = - get_epoll_revent(pollset->pollset[i].events); - j++; - } + for (i = 0; i < ret; i++) { + pollset->result_set[i] = + (((pfd_elem_t *) (pollset->pollset[i].data.ptr))->pfd); + pollset->result_set[i].rtnevents = + get_epoll_revent(pollset->pollset[i].events); } - (*num) = j; } - if (descriptors && (*num)) { + if (descriptors) { *descriptors = pollset->result_set; } } @@ -404,22 +296,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) -{ -#if APR_HAS_THREADS - if (pollset->flags & APR_POLLSET_WAKEABLE) - return apr_file_putc(1, pollset->wakeup_pipe[1]); - else - return APR_EINIT; -#else - /* In case APR was compiled without thread support - * makes no sense to have wakeup operation usable - * only in multithreading environment. - */ - return APR_ENOTIMPL; -#endif -} - struct apr_pollcb_t { apr_pool_t *pool; apr_uint32_t nalloc; diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 6547bf620f4..501953dc43b 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -281,21 +281,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) -{ -#if APR_HAS_THREADS - if (pollset->flags & APR_POLLSET_WAKEABLE) - return APR_ENOTIMPL; - else - return APR_EINIT; -#else - /* In case APR was compiled without thread support - * makes no sense to have wakeup operation usable - * only in multithreading environment. - */ - return APR_ENOTIMPL; -#endif -} struct apr_pollcb_t { apr_pool_t *pool; diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 6f43c41bae5..cca8bfe8a4e 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -156,70 +156,11 @@ struct apr_pollset_t apr_pool_t *pool; apr_uint32_t nelts; apr_uint32_t nalloc; - apr_uint32_t flags; -#if APR_HAS_THREADS - /* Pipe descriptors used for wakeup */ - apr_file_t *wakeup_pipe[2]; -#endif struct pollfd *pollset; apr_pollfd_t *query_set; apr_pollfd_t *result_set; }; -#if APR_HAS_THREADS - -static apr_status_t wakeup_pipe_cleanup(void *p) -{ - apr_status_t rv = APR_SUCCESS; - apr_pollset_t *pollset = (apr_pollset_t *)p; - - if (pollset->flags & APR_POLLSET_WAKEABLE) { - /* Close both sides of the wakeup pipe */ - rv |= apr_file_close(pollset->wakeup_pipe[0]); - rv |= apr_file_close(pollset->wakeup_pipe[1]); - } - return rv; -} - -/* Create a dummy wakeup pipe for interrupting the poller - */ -static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) -{ - apr_status_t rv; - apr_pollfd_t fd; - - if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], - &pollset->wakeup_pipe[1], - pollset->pool)) != APR_SUCCESS) - return rv; - fd.reqevents = APR_POLLIN; - fd.desc_type = APR_POLL_FILE; - fd.desc.f = pollset->wakeup_pipe[0]; - /* Add the pipe to the pollset - */ - return apr_pollset_add(pollset, &fd); -} - -/* Read and discard what's ever in the wakeup pipe. - */ -static void drain_wakeup_pipe(apr_pollset_t *pollset) -{ - char rb[512]; - apr_size_t nr = sizeof(rb); - - while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { - /* Although we write just one byte to the other end of the pipe - * during wakeup, multiple treads could call the wakeup. - * So simply drain out from the input side of the pipe all - * the data. - */ - if (nr != sizeof(rb)) - break; - } -} - -#endif - APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, @@ -229,46 +170,19 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, *pollset = NULL; return APR_ENOTIMPL; } - if (flags & APR_POLLSET_WAKEABLE) { -#if APR_HAS_THREADS - /* Add room for wakeup descriptor */ - size++; -#else - *pollset = NULL; - return APR_ENOTIMPL; -#endif - } *pollset = apr_palloc(p, sizeof(**pollset)); (*pollset)->nelts = 0; (*pollset)->nalloc = size; (*pollset)->pool = p; - (*pollset)->flags = flags; (*pollset)->pollset = apr_palloc(p, size * sizeof(struct pollfd)); (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); -#if APR_HAS_THREADS - if (flags & APR_POLLSET_WAKEABLE) { - apr_status_t rv; - /* Create wakeup pipe */ - if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { - *pollset = NULL; - return rv; - } - apr_pool_cleanup_register(p, *pollset, wakeup_pipe_cleanup, - wakeup_pipe_cleanup); - } -#endif - return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) { -#if APR_HAS_THREADS - if (pollset->flags & APR_POLLSET_WAKEABLE) - return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup); -#endif return APR_SUCCESS; } @@ -328,69 +242,32 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_int32_t *num, const apr_pollfd_t **descriptors) { - int ret; - apr_status_t rv = APR_SUCCESS; + int rv; apr_uint32_t i, j; if (timeout > 0) { timeout /= 1000; } - ret = poll(pollset->pollset, pollset->nelts, timeout); - (*num) = ret; - if (ret < 0) { + rv = poll(pollset->pollset, pollset->nelts, timeout); + (*num) = rv; + if (rv < 0) { return apr_get_netos_error(); } - else if (res == 0) { + if (rv == 0) { return APR_TIMEUP; } - else { - for (i = 0, j = 0; i < pollset->nelts; i++) { - if (pollset->pollset[i].revents != 0) { -#if APR_HAS_THREADS - /* Check if the polled descriptor is our - * wakeup pipe. In that case do not put it result set. - */ - if ((pollset->flags & APR_POLLSET_WAKEABLE) && - pollset->pollset[i].desc_type == APR_POLL_FILE && - pollset->pollset[i].desc.f == pollset->wakeup_pipe[0]) { - drain_wakeup_pipe(pollset); - /* XXX: Is this a correct return value ? - * We might simply return APR_SUCEESS. - */ - rv = APR_EINTR; - } - else -#endif - { - pollset->result_set[j] = pollset->query_set[i]; - pollset->result_set[j].rtnevents = - get_revent(pollset->pollset[i].revents); - j++; - } - } + j = 0; + for (i = 0; i < pollset->nelts; i++) { + if (pollset->pollset[i].revents != 0) { + pollset->result_set[j] = pollset->query_set[i]; + pollset->result_set[j].rtnevents = + get_revent(pollset->pollset[i].revents); + j++; } - (*num) = j; } - if (descriptors && (*num)) + if (descriptors) *descriptors = pollset->result_set; - return rv; -} - -APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) -{ -#if APR_HAS_THREADS - if (pollset->flags & APR_POLLSET_WAKEABLE) { - return apr_file_putc(1, pollset->wakeup_pipe[1]); - } - else - return APR_EINIT; -#else - /* In case APR was compiled without thread support - * makes no sense to have wakeup operation usable - * only in multithreading environment. - */ - return APR_ENOTIMPL; -#endif + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, diff --git a/poll/unix/port.c b/poll/unix/port.c index 2842e2781d5..05848d6180d 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -335,22 +335,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) -{ -#if APR_HAS_THREADS - if (pollset->flags & APR_POLLSET_WAKEABLE) - return APR_ENOTIMPL; - else - return APR_EINIT; -#else - /* In case APR was compiled without thread support - * makes no sense to have wakeup operation usable - * only in multithreading environment. - */ - return APR_ENOTIMPL; -#endif -} - struct apr_pollcb_t { apr_pool_t *pool; apr_uint32_t nalloc; diff --git a/poll/unix/select.c b/poll/unix/select.c index 64b0f050af9..42e7a3f68ec 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -175,7 +175,6 @@ struct apr_pollset_t apr_uint32_t nelts; apr_uint32_t nalloc; - apr_uint32_t flags; fd_set readset, writeset, exceptset; int maxfd; apr_pollfd_t *query_set; @@ -204,7 +203,6 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, (*pollset)->nelts = 0; (*pollset)->nalloc = size; (*pollset)->pool = p; - (*pollset)->flags = flags; FD_ZERO(&((*pollset)->readset)); FD_ZERO(&((*pollset)->writeset)); FD_ZERO(&((*pollset)->exceptset)); @@ -408,22 +406,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) -{ -#if APR_HAS_THREADS - if (pollset->flags & APR_POLLSET_WAKEABLE) - return APR_ENOTIMPL; - else - return APR_EINIT; -#else - /* In case APR was compiled without thread support - * makes no sense to have wakeup operation usable - * only in multithreading environment. - */ - return APR_ENOTIMPL; -#endif -} - APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, apr_uint32_t size, apr_pool_t *p, diff --git a/test/testpoll.c b/test/testpoll.c index a0f56a1490d..e7792c2f11a 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -659,22 +659,6 @@ static void timeout_pollin_pollcb(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } -static void test_wakeup(abts_case *tc, void *data) -{ - apr_status_t rv; - int i, lrv; - const apr_pollfd_t *descs = NULL; - - for (i = 0; i < 1000; i++) { - rv = apr_pollset_wakeup(pollset); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - } - rv = apr_pollset_poll(pollset, 0, &lrv, &descs); - ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EINTR(rv)); - ABTS_INT_EQUAL(tc, 0, lrv); - ABTS_PTR_EQUAL(tc, NULL, descs); -} - abts_suite *testpoll(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -704,7 +688,6 @@ abts_suite *testpoll(abts_suite *suite) abts_run_test(suite, clear_middle_pollset, NULL); abts_run_test(suite, send_last_pollset, NULL); abts_run_test(suite, clear_last_pollset, NULL); - abts_run_test(suite, test_wakeup, NULL); abts_run_test(suite, pollset_remove, NULL); From 58a16d76974ddfd2a4b929416e46285746de651f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Apr 2008 08:17:27 +0000 Subject: [PATCH 6137/7878] * Makefile.in (check): Remove redundant sub-shell. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@647691 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index df7a171283f..a1b786e99fb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -117,7 +117,7 @@ gcov: test: check check: $(TARGET_LIB) - (cd test && $(MAKE) all check) + cd test && $(MAKE) all check etags: etags `find . -name '*.[ch]'` From 6c0a3d04e4f3e25b7810e9712b5e598dd1c701db Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 14 Apr 2008 08:36:40 +0000 Subject: [PATCH 6138/7878] Now that 1.3.x lives on /branches, this bumps to 1.4.0-dev git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@647696 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ STATUS | 5 +++-- include/apr_version.h | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 5be3a1b7d6c..8117ca789ec 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ -*- coding: utf-8 -*- +Changes for APR 1.4.0 + + + Changes for APR 1.3.0 *) Introduce apr_pool_sys_allocator_set() for registering diff --git a/STATUS b/STATUS index 103d24249f1..571b37e2546 100644 --- a/STATUS +++ b/STATUS @@ -2,8 +2,9 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*- coding: utf-8 -*- Last modified at [$Date$] Releases: - 1.3.0 : in development - 1.2.12 : in maintenance + 1.4.0 : in development on trunk + 1.3.0 : in development on branches/1.3.x + 1.2.12 : in maintenance on branches/1.2.x 1.2.11 : released September 6, 2007 1.2.10 : not released 1.2.9 : tagged June 4, 2007 diff --git a/include/apr_version.h b/include/apr_version.h index 58ab58c6e36..4bbdf139b98 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -53,7 +53,7 @@ * Minor API changes that do not cause binary compatibility problems. * Reset to 0 when upgrading APR_MAJOR_VERSION */ -#define APR_MINOR_VERSION 3 +#define APR_MINOR_VERSION 4 /** patch level * The Patch Level never includes API changes, simply bug fixes. From e74b5d7aadb175faf4a4b93fcb4c4943f5220617 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 14 Apr 2008 08:46:35 +0000 Subject: [PATCH 6139/7878] Having written this twice, I like my second flavor better. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@647701 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 571b37e2546..3206eb3b297 100644 --- a/STATUS +++ b/STATUS @@ -2,9 +2,9 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*- coding: utf-8 -*- Last modified at [$Date$] Releases: - 1.4.0 : in development on trunk - 1.3.0 : in development on branches/1.3.x - 1.2.12 : in maintenance on branches/1.2.x + 1.4.0 : in development on trunk/ + 1.3.0 : in maintenance on branches/1.3.x/ + 1.2.12 : in maintenance on branches/1.2.x/ 1.2.11 : released September 6, 2007 1.2.10 : not released 1.2.9 : tagged June 4, 2007 From ad1120efc0ea076ea3fd55ca9bfc26e3cec6e2fd Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Wed, 16 Apr 2008 05:36:47 +0000 Subject: [PATCH 6140/7878] Revert r647394. The API is incomplete and needs more development git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@648527 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 10 ----- include/apr_pools.h | 34 -------------- memory/unix/apr_pools.c | 99 ++++++++--------------------------------- 3 files changed, 18 insertions(+), 125 deletions(-) diff --git a/CHANGES b/CHANGES index 8117ca789ec..4765d8f030c 100644 --- a/CHANGES +++ b/CHANGES @@ -5,16 +5,6 @@ Changes for APR 1.4.0 Changes for APR 1.3.0 - *) Introduce apr_pool_sys_allocator_set() for registering - application provided memory allocation functions that - will APR use internally whenever malloc/free is needed. - This allows to use custom memory allocators insted - sustem default malloc/free. This is one time initialization - function and must be used before any oter APR call. - After the first allocation function is called those - callbacks cannot be changed. - [Mladen Turk] - *) Introduce apr_pool_pre_cleanup_register() for registering a cleanup that is called before any subpool is destroyed within apr_pool_clear or apr_pool_destroy. diff --git a/include/apr_pools.h b/include/apr_pools.h index 986f261b003..eb7c6e5b1f5 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -149,40 +149,6 @@ typedef int (*apr_abortfunc_t)(int retcode); * Initialization */ -/** A function that allocates memory from the system. */ -typedef void* (*apr_sys_alloc_t)(apr_size_t size, void *data); - -/** A function that allocates memory from the system. */ -typedef void* (*apr_sys_realloc_t)(void *mem, apr_size_t new_size, void *data); - -/** A function that frees memory. */ -typedef void (*apr_sys_free_t)(void *memory, void *data); - -/** - * Setup system memory alloc and free functions. - * - * If set APR will use those functions whenever it internally - * needs to allocate or free the memory. - * - * @param alloc_fn A function to use for allocating memory. - * @param alloc_data The data to pass to the alloc function. - * @param realloc_fn A function to use for reallocating memory. - * @param realloc_data The data to pass to the realloc function. - * @param free_fn A function to use for freeing memory. - * @param free_data The data to pass to the free function. - * @return APR_EINVAL if one of the functions is not provided. - * APR_EINIT if apr_pool_initialize was already called. - * @remark This function MUST be called before pool initializtion. - * If application don't set those functions the system - * will use malloc/realloc/free instead. - */ -APR_DECLARE(apr_status_t) apr_pool_sys_allocator_set(apr_sys_alloc_t alloc_fn, - void *alloc_data, - apr_sys_realloc_t realloc_fn, - void *realloc_data, - apr_sys_free_t free_fn, - void *free_data); - /** * Setup all of the internal structures required to use pools * @remark Programs do NOT need to call this directly. APR will call this diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 8bb3632a42d..c080232e70b 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -100,44 +100,6 @@ struct apr_allocator_t { #define SIZEOF_ALLOCATOR_T APR_ALIGN_DEFAULT(sizeof(apr_allocator_t)) -/* Global system allocator functions */ -static apr_sys_alloc_t global_allocfn = NULL; -static apr_sys_realloc_t global_reallocfn = NULL; -static apr_sys_free_t global_freefn = NULL; -static void *global_allocdata = NULL; -static void *global_reallocdata = NULL; -static void *global_freedata = NULL; - -/* - * System memory allocator - */ - -static APR_INLINE -void *APR_MALLOC(apr_size_t size) -{ - if (global_allocfn) - return (*global_allocfn)(size, global_allocdata); - else - return malloc(size); -} - -static APR_INLINE -void APR_FREE(void *mem) -{ - if (global_freefn) - (*global_freefn)(mem, global_freedata); - else - free(mem); -} - -static APR_INLINE -void *APR_REALLOC(void *mem, apr_size_t new_size) -{ - if (global_reallocfn) - return (*global_reallocfn)(mem, new_size, global_reallocdata); - else - return realloc(mem, new_size); -} /* * Allocator @@ -149,7 +111,7 @@ APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator) *allocator = NULL; - if ((new_allocator = APR_MALLOC(SIZEOF_ALLOCATOR_T)) == NULL) + if ((new_allocator = malloc(SIZEOF_ALLOCATOR_T)) == NULL) return APR_ENOMEM; memset(new_allocator, 0, SIZEOF_ALLOCATOR_T); @@ -169,11 +131,11 @@ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) ref = &allocator->free[index]; while ((node = *ref) != NULL) { *ref = node->next; - APR_FREE(node); + free(node); } } - APR_FREE(allocator); + free(allocator); } #if APR_HAS_THREADS @@ -358,7 +320,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size) /* If we haven't got a suitable node, malloc a new one * and initialize it. */ - if ((node = APR_MALLOC(size)) == NULL) + if ((node = malloc(size)) == NULL) return NULL; node->next = NULL; @@ -435,7 +397,7 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) while (freelist != NULL) { node = freelist; freelist = node->next; - APR_FREE(node); + free(node); } } @@ -561,31 +523,6 @@ static apr_allocator_t *global_allocator = NULL; static apr_file_t *file_stderr = NULL; #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ -APR_DECLARE(apr_status_t) apr_pool_sys_allocator_set(apr_sys_alloc_t alloc_fn, - void *alloc_data, - apr_sys_realloc_t realloc_fn, - void *realloc_data, - apr_sys_free_t free_fn, - void *free_data) -{ - if (apr_pools_initialized) { - /* We cannot intermix memory allocation functions */ - return APR_EINIT; - } - if (alloc_fn && realloc_fn && free_fn) { - global_allocfn = alloc_fn; - global_reallocfn = realloc_fn; - global_freefn = free_fn; - global_allocdata = alloc_data; - global_reallocdata = realloc_data; - global_freedata = free_data; - - return APR_SUCCESS; - } - else - return APR_EINVAL; -} - /* * Local functions */ @@ -983,7 +920,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, if (!apr_pools_initialized) return APR_ENOPOOL; if ((pool_allocator = allocator) == NULL) { - if ((pool_allocator = APR_MALLOC(SIZEOF_ALLOCATOR_T)) == NULL) { + if ((pool_allocator = malloc(SIZEOF_ALLOCATOR_T)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -1468,7 +1405,7 @@ static void *pool_alloc(apr_pool_t *pool, apr_size_t size) debug_node_t *node; void *mem; - if ((mem = APR_MALLOC(size)) == NULL) { + if ((mem = malloc(size)) == NULL) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); @@ -1477,7 +1414,7 @@ static void *pool_alloc(apr_pool_t *pool, apr_size_t size) node = pool->nodes; if (node == NULL || node->index == 64) { - if ((node = APR_MALLOC(SIZEOF_DEBUG_NODE_T)) == NULL) { + if ((node = malloc(SIZEOF_DEBUG_NODE_T)) == NULL) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); @@ -1581,11 +1518,11 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) for (index = 0; index < node->index; index++) { memset(node->beginp[index], POOL_POISON_BYTE, (char *)node->endp[index] - (char *)node->beginp[index]); - APR_FREE(node->beginp[index]); + free(node->beginp[index]); } memset(node, POOL_POISON_BYTE, SIZEOF_DEBUG_NODE_T); - APR_FREE(node); + free(node); } pool->stat_alloc = 0; @@ -1669,7 +1606,7 @@ static void pool_destroy_debug(apr_pool_t *pool, const char *file_line) } /* Free the pool itself */ - APR_FREE(pool); + free(pool); } APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, @@ -1711,7 +1648,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, if (!abort_fn && parent) abort_fn = parent->abort_fn; - if ((pool = APR_MALLOC(SIZEOF_POOL_T)) == NULL) { + if ((pool = malloc(SIZEOF_POOL_T)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -1768,7 +1705,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, */ if ((rv = apr_thread_mutex_create(&pool->mutex, APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) { - APR_FREE(pool); + free(pool); return rv; } #endif /* APR_HAS_THREADS */ @@ -1799,7 +1736,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, *newpool = NULL; - if ((pool = APR_MALLOC(SIZEOF_POOL_T)) == NULL) { + if ((pool = malloc(SIZEOF_POOL_T)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -1844,7 +1781,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, */ if ((rv = apr_thread_mutex_create(&pool->mutex, APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) { - APR_FREE(pool); + free(pool); return rv; } #endif /* APR_HAS_THREADS */ @@ -1877,7 +1814,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) size = ps->vbuff.curpos - ps->mem; ps->size <<= 1; - if ((ps->mem = APR_REALLOC(ps->mem, ps->size)) == NULL) + if ((ps->mem = realloc(ps->mem, ps->size)) == NULL) return -1; ps->vbuff.curpos = ps->mem + size; @@ -1894,7 +1831,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) apr_pool_check_integrity(pool); ps.size = 64; - ps.mem = APR_MALLOC(ps.size); + ps.mem = malloc(ps.size); ps.vbuff.curpos = ps.mem; /* Save a byte for the NUL terminator */ @@ -1914,7 +1851,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) */ node = pool->nodes; if (node == NULL || node->index == 64) { - if ((node = APR_MALLOC(SIZEOF_DEBUG_NODE_T)) == NULL) { + if ((node = malloc(SIZEOF_DEBUG_NODE_T)) == NULL) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); From a7e1da0681322aa7994994be06a34d5c77fe24c4 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Wed, 16 Apr 2008 07:51:46 +0000 Subject: [PATCH 6141/7878] Do not core if the optional function cannot be delay loaded. Return 0 and set last error to ERROR_INVALID_FUNCTION instead git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@648601 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_misc.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index 75cb17a9d36..1382f65d15a 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -182,7 +182,9 @@ typedef enum { FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); -/* The apr_load_dll_func call WILL fault if the function cannot be loaded */ +/* The apr_load_dll_func call WILL return 0 set error to + * ERROR_INVALID_FUNCTION if the function cannot be loaded + */ #define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ typedef rettype (calltype *apr_winapi_fpt_##fn) args; \ @@ -191,7 +193,9 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); { if (!apr_winapi_pfn_##fn) \ apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \ apr_load_dll_func(lib, #fn, ord); \ - return (*(apr_winapi_pfn_##fn)) names; }; \ + if (apr_winapi_pfn_##fn) \ + return (*(apr_winapi_pfn_##fn)) names; \ + else { SetLastError(ERROR_INVALID_FUNCTION); return 0;} }; \ /* Provide late bound declarations of every API function missing from * one or more supported releases of the Win32 API From e88be63b5e26c23c4b5f9b27bad7c15f44410c78 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 17 Apr 2008 08:30:14 +0000 Subject: [PATCH 6142/7878] Fix compile time warnings by properly casting to 64 or 32 bits git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@649000 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_misc.h | 2 +- misc/win32/misc.c | 30 ++++++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index 1382f65d15a..eecee26a516 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -180,7 +180,7 @@ typedef enum { DLL_defined = 6 // must define as last idx_ + 1 } apr_dlltoken_e; -FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); +FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, const char *fnName, int ordinal); /* The apr_load_dll_func call WILL return 0 set error to * ERROR_INVALID_FUNCTION if the function cannot be loaded diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 9fc3e8422a2..263edef8598 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -165,7 +165,7 @@ static const char* const lateDllName[DLL_defined] = { static HMODULE lateDllHandle[DLL_defined] = { NULL, NULL, NULL, NULL, NULL, NULL }; -FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) +FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, const char* fnName, int ordinal) { if (!lateDllHandle[fnLib]) { lateDllHandle[fnLib] = LoadLibraryA(lateDllName[fnLib]); @@ -174,12 +174,14 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) } #if defined(_WIN32_WCE) if (ordinal) - return GetProcAddressA(lateDllHandle[fnLib], (char *) ordinal); + return GetProcAddressA(lateDllHandle[fnLib], (const char *) + (apr_ssize_t)ordinal); else return GetProcAddressA(lateDllHandle[fnLib], fnName); #else if (ordinal) - return GetProcAddress(lateDllHandle[fnLib], (char *) ordinal); + return GetProcAddress(lateDllHandle[fnLib], (const char *) + (apr_ssize_t)ordinal); else return GetProcAddress(lateDllHandle[fnLib], fnName); #endif @@ -220,8 +222,8 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, } if (!nh) { - (sprintf)(sbuf, "%08x %08x %08x %s() %s:%d\n", - (DWORD)ha, seq, GetCurrentThreadId(), fn, fl, ln); + (sprintf)(sbuf, "%p %08x %08x %s() %s:%d\n", + ha, seq, GetCurrentThreadId(), fn, fl, ln); (EnterCriticalSection)(&cs); (WriteFile)(fh, sbuf, (DWORD)strlen(sbuf), &wrote, NULL); (LeaveCriticalSection)(&cs); @@ -234,21 +236,21 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, HANDLE *hv = va_arg(a, HANDLE*); char *dsc = va_arg(a, char*); if (strcmp(dsc, "Signaled") == 0) { - if ((DWORD)ha >= STATUS_WAIT_0 - && (DWORD)ha < STATUS_ABANDONED_WAIT_0) { - hv += (DWORD)ha; + if ((apr_ssize_t)ha >= STATUS_WAIT_0 + && (apr_ssize_t)ha < STATUS_ABANDONED_WAIT_0) { + hv += (apr_ssize_t)ha; } - else if ((DWORD)ha >= STATUS_ABANDONED_WAIT_0 - && (DWORD)ha < STATUS_USER_APC) { - hv += (DWORD)ha - STATUS_ABANDONED_WAIT_0; + else if ((apr_ssize_t)ha >= STATUS_ABANDONED_WAIT_0 + && (apr_ssize_t)ha < STATUS_USER_APC) { + hv += (apr_ssize_t)ha - STATUS_ABANDONED_WAIT_0; dsc = "Abandoned"; } - else if ((DWORD)ha == WAIT_TIMEOUT) { + else if ((apr_ssize_t)ha == WAIT_TIMEOUT) { dsc = "Timed Out"; } } - (sprintf)(sbuf, "%08x %08x %08x %s(%s) %s:%d\n", - (DWORD*)*hv, seq, GetCurrentThreadId(), + (sprintf)(sbuf, "%p %08x %08x %s(%s) %s:%d\n", + *hv, seq, GetCurrentThreadId(), fn, dsc, fl, ln); (WriteFile)(fh, sbuf, (DWORD)strlen(sbuf), &wrote, NULL); } while (--nh); From 43ff5ef09d06151d4e0a8eed63f5743da0d11f8b Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 17 Apr 2008 09:34:32 +0000 Subject: [PATCH 6143/7878] Cast pointers properly trough apr_ssize_t (int or __int64) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@649022 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/time/win32/time.c b/time/win32/time.c index 9565fee9325..ecf022854cc 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -314,7 +314,7 @@ APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p) static apr_status_t clock_restore(void *unsetres) { ULONG newRes; - SetTimerResolution((ULONG)unsetres, FALSE, &newRes); + SetTimerResolution((ULONG)(apr_ssize_t)unsetres, FALSE, &newRes); return APR_SUCCESS; } From d658d19c34d861ad9125eb54fbd92701b7cb239d Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 17 Apr 2008 10:29:57 +0000 Subject: [PATCH 6144/7878] Revert function proto change git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@649042 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_misc.h | 2 +- misc/win32/misc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index eecee26a516..1382f65d15a 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -180,7 +180,7 @@ typedef enum { DLL_defined = 6 // must define as last idx_ + 1 } apr_dlltoken_e; -FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, const char *fnName, int ordinal); +FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); /* The apr_load_dll_func call WILL return 0 set error to * ERROR_INVALID_FUNCTION if the function cannot be loaded diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 263edef8598..a95a2219036 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -165,7 +165,7 @@ static const char* const lateDllName[DLL_defined] = { static HMODULE lateDllHandle[DLL_defined] = { NULL, NULL, NULL, NULL, NULL, NULL }; -FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, const char* fnName, int ordinal) +FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) { if (!lateDllHandle[fnLib]) { lateDllHandle[fnLib] = LoadLibraryA(lateDllName[fnLib]); From 70906624b1e27c9f9278624d13cef48350986542 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 17 Apr 2008 16:27:10 +0000 Subject: [PATCH 6145/7878] Fix NtXXX prototypes. They are all declared as NTSTATUS(LONG) not DWORD git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@649173 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_misc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index 1382f65d15a..e4beec27b18 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -338,14 +338,14 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, DWORD, WINAPI, GetCompressedFileSizeW, #define GetCompressedFileSizeW apr_winapi_GetCompressedFileSizeW -APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryTimerResolution, 0, ( +APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtQueryTimerResolution, 0, ( ULONG *pMaxRes, /* Minimum NS Resolution */ ULONG *pMinRes, /* Maximum NS Resolution */ ULONG *pCurRes), /* Current NS Resolution */ (pMaxRes, pMinRes, pCurRes)); #define QueryTimerResolution apr_winapi_NtQueryTimerResolution -APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtSetTimerResolution, 0, ( +APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtSetTimerResolution, 0, ( ULONG ReqRes, /* Requested NS Clock Resolution */ BOOL Acquire, /* Aquire (1) or Release (0) our interest */ ULONG *pNewRes), /* The NS Clock Resolution granted */ @@ -361,7 +361,7 @@ typedef struct PBI { ULONG_PTR InheritedFromUniqueProcessId; } PBI, *PPBI; -APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryInformationProcess, 0, ( +APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtQueryInformationProcess, 0, ( HANDLE hProcess, /* Obvious */ INT info, /* Use 0 for PBI documented above */ PVOID pPI, /* The PIB buffer */ @@ -370,7 +370,7 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryInformationProcess, 0 (hProcess, info, pPI, LenPI, pSizePI)); #define QueryInformationProcess apr_winapi_NtQueryInformationProcess -APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryObject, 0, ( +APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtQueryObject, 0, ( HANDLE hObject, /* Obvious */ INT info, /* Use 0 for PBI documented above */ PVOID pOI, /* The PIB buffer */ From d2897a45d3fa504feadcab5d3c0c21784f9fdeb5 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 17 Apr 2008 17:57:22 +0000 Subject: [PATCH 6146/7878] mplement apr_proc_wait_all_procs for windows git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@649208 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + include/apr.hw | 1 + include/arch/win32/apr_arch_misc.h | 27 ++++++ threadproc/win32/proc.c | 141 ++++++++++++++++++++++++++--- 4 files changed, 156 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index 4765d8f030c..150f67269f0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 1.4.0 + *) Implement apr_proc_wait_all_procs for windows. + [Mladen Turk] Changes for APR 1.3.0 diff --git a/include/apr.hw b/include/apr.hw index 8d74319419a..c1e2e51eeaa 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -100,6 +100,7 @@ #include #include #include +#include #else #include #endif diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index e4beec27b18..76076da34c4 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -404,6 +404,33 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, ZwQueryInformationFile, 0, ( (hObject, pIOSB, pFI, LenFI, info)); #define ZwQueryInformationFile apr_winapi_ZwQueryInformationFile +#ifdef CreateToolhelp32Snapshot +#undef CreateToolhelp32Snapshot +#endif +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, HANDLE, WINAPI, CreateToolhelp32Snapshot, 0, ( + DWORD dwFlags, + DWORD th32ProcessID), + (dwFlags, th32ProcessID)); +#define CreateToolhelp32Snapshot apr_winapi_CreateToolhelp32Snapshot + +#ifdef Process32FirstW +#undef Process32FirstW +#endif +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, Process32FirstW, 0, ( + HANDLE hSnapshot, + LPPROCESSENTRY32W lppe), + (hSnapshot, lppe)); +#define Process32FirstW apr_winapi_Process32FirstW + +#ifdef Process32NextW +#undef Process32NextW +#endif +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, Process32NextW, 0, ( + HANDLE hSnapshot, + LPPROCESSENTRY32W lppe), + (hSnapshot, lppe)); +#define Process32NextW apr_winapi_Process32NextW + #endif /* !defined(_WIN32_WCE) */ #endif /* ! MISC_H */ diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 2c7dcabc80a..79a2fd167f3 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -975,21 +975,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, - int *exitcode, - apr_exit_why_e *exitwhy, - apr_wait_how_e waithow, - apr_pool_t *p) -{ - /* Unix does apr_proc_wait(proc(-1), exitcode, exitwhy, waithow) - * but Win32's apr_proc_wait won't work that way. We can either - * register all APR created processes in some sort of AsyncWait - * thread, or simply walk from the global process pool for all - * apr_pool_note_subprocess()es registered with APR. - */ - return APR_ENOTIMPL; -} - static apr_exit_why_e why_from_exit_code(DWORD exit) { /* See WinNT.h STATUS_ACCESS_VIOLATION and family for how * this class of failures was determined @@ -1003,6 +988,132 @@ static apr_exit_why_e why_from_exit_code(DWORD exit) { /* ### No way to tell if Dr Watson grabbed a core, AFAICT. */ } +APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, + int *exitcode, + apr_exit_why_e *exitwhy, + apr_wait_how_e waithow, + apr_pool_t *p) +{ +#if APR_HAS_UNICODE_FS +#ifndef _WIN32_WCE + IF_WIN_OS_IS_UNICODE + { + DWORD dwId = GetCurrentProcessId(); + DWORD i; + DWORD nChilds = 0; + DWORD nActive = 0; + HANDLE ps32; + PROCESSENTRY32W pe32; + BOOL bHasMore = FALSE; + DWORD dwFlags = PROCESS_QUERY_INFORMATION; + apr_status_t rv = APR_EGENERAL; + + if (waithow == APR_WAIT) + dwFlags |= SYNCHRONIZE; + if (!(ps32 = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0))) { + return apr_get_os_error(); + } + pe32.dwSize = sizeof(PROCESSENTRY32W); + if (!Process32FirstW(ps32, &pe32)) { + if (GetLastError() == ERROR_NO_MORE_FILES) + return APR_EOF; + else + return apr_get_os_error(); + } + do { + DWORD dwRetval = 0; + DWORD nHandles = 0; + HANDLE hProcess = NULL; + HANDLE pHandles[MAXIMUM_WAIT_OBJECTS]; + do { + if (pe32.th32ParentProcessID == dwId) { + nChilds++; + if ((hProcess = OpenProcess(dwFlags, FALSE, + pe32.th32ProcessID)) != NULL) { + if (GetExitCodeProcess(hProcess, &dwRetval)) { + if (dwRetval == STILL_ACTIVE) { + nActive++; + if (waithow == APR_WAIT) + pHandles[nHandles++] = hProcess; + else + CloseHandle(hProcess); + } + else { + /* Process has exited. + * No need to wait for its termination. + */ + CloseHandle(hProcess); + if (exitcode) + *exitcode = dwRetval; + if (exitwhy) + *exitwhy = why_from_exit_code(dwRetval); + proc->pid = pe32.th32ProcessID; + } + } + else { + /* Unexpected error code. + * Cleanup and return; + */ + rv = apr_get_os_error(); + CloseHandle(hProcess); + for (i = 0; i < nHandles; i++) + CloseHandle(pHandles[i]); + return rv; + } + } + else { + /* This is our child, so it shouldn't happen + * that we cannot open our child's process handle. + * However if the child process increased the + * security token it might fail. + */ + } + } + } while ((bHasMore = Process32NextW(ps32, &pe32)) && + nHandles < MAXIMUM_WAIT_OBJECTS); + if (nHandles) { + /* Wait for all collected processes to finish */ + DWORD waitStatus = WaitForMultipleObjects(nHandles, pHandles, + TRUE, INFINITE); + for (i = 0; i < nHandles; i++) + CloseHandle(pHandles[i]); + if (waitStatus == WAIT_OBJECT_0) { + /* Decrease active count by the number of awaited + * processes. + */ + nActive -= nHandles; + } + else { + /* Broken from the infinite loop */ + break; + } + } + } while (bHasMore); + CloseHandle(ps32); + if (waithow != APR_WAIT) { + if (nChilds && nChilds == nActive) { + /* All child processes are running */ + rv = APR_CHILD_NOTDONE; + proc->pid = -1; + } + else { + /* proc->pid contains the pid of the + * exited processes + */ + rv = APR_CHILD_DONE; + } + } + if (nActive == 0) { + rv = APR_CHILD_DONE; + proc->pid = -1; + } + return rv; + } +#endif /* _WIN32_WCE */ +#endif /* APR_HAS_UNICODE_FS */ + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, int *exitcode, apr_exit_why_e *exitwhy, apr_wait_how_e waithow) From ff576b59aeb8bf111c73416f376a0604c36f43c0 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Fri, 18 Apr 2008 07:18:23 +0000 Subject: [PATCH 6147/7878] Implement apr_file_socket_pipe_create for windows. Private for implementing pollset_wakeup caused by !APR_FILES_AS_SOCKETS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@649390 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 183 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index ee3a07fa1b2..5598acdf892 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -225,3 +225,186 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, { return apr_os_pipe_put_ex(file, thefile, 0, pool); } + +static apr_status_t create_socket_pipe(SOCKET *rd, SOCKET *wr) +{ + static int id = 0; + + SOCKET ls; + struct sockaddr_in pa; + struct sockaddr_in la; + struct sockaddr_in ca; + int nrd; + apr_status_t rv = APR_SUCCESS; + int ll = sizeof(la); + int lc = sizeof(ca); + int bm = 1; + int uid[2]; + int iid[2]; + + *rd = INVALID_SOCKET; + *wr = INVALID_SOCKET; + + /* Create the unique socket identifier + * so that we know the connection originated + * from us. + */ + uid[0] = getpid(); + uid[1] = id++; + if ((ls = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) { + return apr_get_netos_error(); + } + + pa.sin_family = AF_INET; + pa.sin_port = 0; + pa.sin_addr.s_addr = inet_addr("127.0.0.1"); + + if (bind(ls, (SOCKADDR *)&pa, sizeof(pa)) == SOCKET_ERROR) { + rv = apr_get_netos_error(); + goto cleanup; + } + if (getsockname(ls, (SOCKADDR *)&la, &ll) == SOCKET_ERROR) { + rv = apr_get_netos_error(); + goto cleanup; + } + if (listen(ls, 1) == SOCKET_ERROR) { + rv = apr_get_netos_error(); + goto cleanup; + } + if ((*wr = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) { + rv = apr_get_netos_error(); + goto cleanup; + } + if (connect(*wr, (SOCKADDR *)&la, sizeof(la)) == SOCKET_ERROR) { + rv = apr_get_netos_error(); + goto cleanup; + } + if (send(*wr, (char *)uid, sizeof(uid), 0) != sizeof(uid)) { + if ((rv = apr_get_netos_error()) == 0) { + rv = APR_EINVAL; + } + goto cleanup; + } + if (ioctlsocket(ls, FIONBIO, &bm) == SOCKET_ERROR) { + rv = apr_get_netos_error(); + goto cleanup; + } + for (;;) { + /* Listening socket is nonblocking by now. + * The accept must create the socket + * immediatelly because we connected already. + */ + if ((*rd = accept(ls, (SOCKADDR *)&ca, &lc)) == INVALID_SOCKET) { + rv = apr_get_netos_error(); + goto cleanup; + } + /* Verify the connection by reading the send identification. + */ + nrd = recv(*rd, (char *)iid, sizeof(iid), 0); + if (nrd == sizeof(iid)) { + if (memcmp(uid, iid, sizeof(uid)) == 0) { + /* Wow, we recived what we send. + * Put read side of the pipe to the blocking + * mode and return. + */ + bm = 0; + if (ioctlsocket(*rd, FIONBIO, &bm) == SOCKET_ERROR) { + rv = apr_get_netos_error(); + goto cleanup; + } + break; + } + } + else if (nrd == SOCKET_ERROR) { + rv = apr_get_netos_error(); + goto cleanup; + } + closesocket(*rd); + } + /* We don't need the listening socket any more */ + closesocket(ls); + return 0; + +cleanup: + /* Don't leak resources */ + if (*rd != INVALID_SOCKET) + closesocket(*rd); + if (*wr != INVALID_SOCKET) + closesocket(*wr); + + *rd = INVALID_SOCKET; + *wr = INVALID_SOCKET; + closesocket(ls); + return rv; +} + +static apr_status_t socket_pipe_cleanup(void *thefile) +{ + apr_file_t *file = thefile; + if (file->filehand != INVALID_HANDLE_VALUE) { + shutdown((SOCKET)file->filehand, SD_BOTH); + closesocket((SOCKET)file->filehand); + file->filehand = INVALID_HANDLE_VALUE; + } + return APR_SUCCESS; +} + +#if 0 +/* XXX Do we need this as public API or APR private ? + * It's main usage is for interrupting pollset because + * of !APR_FILES_AS_SOCKETS. + * Duplicating sockets in child requires WSADuplicateSocket + * and passing WSAPROTOCOL_INFO data to the child, so we + * would need some sort of IPC instead DuplicateHandle used + * for files and pipes. + */ +APR_DECLARE(apr_status_t) +#else +apr_status_t +#endif +apr_file_socket_pipe_create(apr_file_t **in, + apr_file_t **out, + apr_pool_t *p) +{ + apr_status_t rv; + SOCKET rd; + SOCKET wr; + + if ((rv = create_socket_pipe(&rd, &wr)) != APR_SUCCESS) { + return rv; + } + (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); + (*in)->pool = p; + (*in)->fname = NULL; + (*in)->pipe = 1; + (*in)->timeout = -1; + (*in)->ungetchar = -1; + (*in)->eof_hit = 0; + (*in)->filePtr = 0; + (*in)->bufpos = 0; + (*in)->dataRead = 0; + (*in)->direction = 0; + (*in)->pOverlapped = (OVERLAPPED*)apr_pcalloc(p, sizeof(OVERLAPPED)); + (*in)->filehand = (HANDLE)rd; + + (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); + (*out)->pool = p; + (*out)->fname = NULL; + (*out)->pipe = 1; + (*out)->timeout = -1; + (*out)->ungetchar = -1; + (*out)->eof_hit = 0; + (*out)->filePtr = 0; + (*out)->bufpos = 0; + (*out)->dataRead = 0; + (*out)->direction = 0; + (*out)->pOverlapped = (OVERLAPPED*)apr_pcalloc(p, sizeof(OVERLAPPED)); + (*out)->filehand = (HANDLE)wr; + + apr_pool_cleanup_register(p, (void *)(*in), socket_pipe_cleanup, + apr_pool_cleanup_null); + apr_pool_cleanup_register(p, (void *)(*out), socket_pipe_cleanup, + apr_pool_cleanup_null); + + return rv; +} From 999779d51e3c367941eaf1bd7557be42cbd657be Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 19 Apr 2008 16:26:39 +0000 Subject: [PATCH 6148/7878] Introduce (again) apr_pollset_wakeup API git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@649830 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++ include/apr_poll.h | 28 +++++++-- poll/unix/epoll.c | 124 ++++++++++++++++++++++++++++++++---- poll/unix/kqueue.c | 104 +++++++++++++++++++++++++++---- poll/unix/poll.c | 133 ++++++++++++++++++++++++++++++++++----- poll/unix/port.c | 116 +++++++++++++++++++++++++++++----- poll/unix/select.c | 152 ++++++++++++++++++++++++++++++++++++++++++--- 7 files changed, 591 insertions(+), 70 deletions(-) diff --git a/CHANGES b/CHANGES index 150f67269f0..98b96c075f3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 1.4.0 + *) Introduce apr_pollset_wakeup() for interrupting + the blocking apr_pollset_poll call. + [Mladen Turk] + *) Implement apr_proc_wait_all_procs for windows. [Mladen Turk] diff --git a/include/apr_poll.h b/include/apr_poll.h index 92a540a95e6..657c4fbe36c 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -56,6 +56,7 @@ extern "C" { */ #define APR_POLLSET_THREADSAFE 0x001 /**< Adding or Removing a Descriptor is thread safe */ #define APR_POLLSET_NOCOPY 0x002 /**< Descriptors passed to apr_pollset_create() are not copied */ +#define APR_POLLSET_WAKEABLE 0x004 /**< Pollset poll operation is interruptable */ /** Used in apr_pollfd_t to determine what the apr_descriptor is */ typedef enum { @@ -100,11 +101,17 @@ typedef struct apr_pollset_t apr_pollset_t; * @param flags Optional flags to modify the operation of the pollset. * * @remark If flags equals APR_POLLSET_THREADSAFE, then a pollset is - * created on which it is safe to make concurrent calls to - * apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() from - * separate threads. This feature is only supported on some - * platforms; the apr_pollset_create() call will fail with - * APR_ENOTIMPL on platforms where it is not supported. + * created on which it is safe to make concurrent calls to + * apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() + * from separate threads. This feature is only supported on some + * platforms; the apr_pollset_create() call will fail with + * APR_ENOTIMPL on platforms where it is not supported. + * @remark If flags contain APR_POLLSET_WAKEABLE, then a pollset is + * created with additional internal pipe object used for + * apr_pollset_wakeup() call. The actual size of pollset is + * in that case size + 1. This feature is only supported on some + * platforms; the apr_pollset_create() call will fail with + * APR_ENOTIMPL on platforms where it is not supported. */ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, @@ -160,12 +167,23 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, * @param timeout Timeout in microseconds * @param num Number of signalled descriptors (output parameter) * @param descriptors Array of signalled descriptors (output parameter) + * @remark If the pollset has been created with APR_POLLSET_WAKEABLE + * and the wakeup has been called while waiting for activity + * return value is APR_EINTR and num is set to number of signalled + * descriptors at the time of wakeup call. */ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_interval_time_t timeout, apr_int32_t *num, const apr_pollfd_t **descriptors); +/** + * Interrupt the blocked apr_pollset_poll call. + * @param pollset The pollset to use + * @remark If the pollset was not created with APR_POLLSET_WAKEABLE the + * return value is APR_EINIT. + */ +APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset); /** * Poll the descriptors in the poll structure diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 7a3831bee0b..82660b4446c 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -65,6 +65,8 @@ struct apr_pollset_t struct epoll_event *pollset; apr_pollfd_t *result_set; apr_uint32_t flags; + /* Pipe descriptors used for wakeup */ + apr_file_t *wakeup_pipe[2]; #if APR_HAS_THREADS /* A thread mutex to protect operations on the rings */ apr_thread_mutex_t *ring_lock; @@ -82,9 +84,57 @@ static apr_status_t backend_cleanup(void *p_) { apr_pollset_t *pollset = (apr_pollset_t *) p_; close(pollset->epoll_fd); + if (pollset->flags & APR_POLLSET_WAKEABLE) { + /* Close both sides of the wakeup pipe */ + if (pollset->wakeup_pipe[0]) { + apr_file_close(pollset->wakeup_pipe[0]); + pollset->wakeup_pipe[0] = NULL; + } + if (pollset->wakeup_pipe[1]) { + apr_file_close(pollset->wakeup_pipe[1]); + pollset->wakeup_pipe[1] = NULL; + } + } return APR_SUCCESS; } +/* Create a dummy wakeup pipe for interrupting the poller + */ +static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) +{ + apr_status_t rv; + apr_pollfd_t fd; + + if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], + &pollset->wakeup_pipe[1], + pollset->pool)) != APR_SUCCESS) + return rv; + fd.reqevents = APR_POLLIN; + fd.desc_type = APR_POLL_FILE; + fd.desc.f = pollset->wakeup_pipe[0]; + /* Add the pipe to the pollset + */ + return apr_pollset_add(pollset, &fd); +} + +/* Read and discard what's ever in the wakeup pipe. + */ +static void drain_wakeup_pipe(apr_pollset_t *pollset) +{ + char rb[512]; + apr_size_t nr = sizeof(rb); + + while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { + /* Although we write just one byte to the other end of the pipe + * during wakeup, multiple treads could call the wakeup. + * So simply drain out from the input side of the pipe all + * the data. + */ + if (nr != sizeof(rb)) + break; + } +} + APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, @@ -93,6 +143,10 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_status_t rv; int fd; + if (flags & APR_POLLSET_WAKEABLE) { + /* Add room for wakeup descriptor */ + size++; + } fd = epoll_create(size); if (fd < 0) { *pollset = NULL; @@ -121,7 +175,6 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, (*pollset)->pool = p; (*pollset)->epoll_fd = fd; (*pollset)->pollset = apr_palloc(p, size * sizeof(struct epoll_event)); - apr_pool_cleanup_register(p, *pollset, backend_cleanup, backend_cleanup); (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); if (!(flags & APR_POLLSET_NOCOPY)) { @@ -129,6 +182,15 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link); APR_RING_INIT(&(*pollset)->dead_ring, pfd_elem_t, link); } + if (flags & APR_POLLSET_WAKEABLE) { + /* Create wakeup pipe */ + if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { + close(fd); + *pollset = NULL; + return rv; + } + } + apr_pool_cleanup_register(p, *pollset, backend_cleanup, backend_cleanup); return APR_SUCCESS; } @@ -244,8 +306,9 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_int32_t *num, const apr_pollfd_t **descriptors) { - int ret, i; + int ret, i, j; apr_status_t rv = APR_SUCCESS; + apr_pollfd_t fd; if (timeout > 0) { timeout /= 1000; @@ -263,20 +326,49 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } else { if (pollset->flags & APR_POLLSET_NOCOPY) { - for (i = 0; i < ret; i++) { - pollset->result_set[i] = - *((apr_pollfd_t *) (pollset->pollset[i].data.ptr)); - pollset->result_set[i].rtnevents = - get_epoll_revent(pollset->pollset[i].events); + for (i = 0, j = 0; i < ret; i++) { + fd = *((apr_pollfd_t *) (pollset->pollset[i].data.ptr)); + /* Check if the polled descriptor is our + * wakeup pipe. In that case do not put it result set. + */ + if ((pollset->flags & APR_POLLSET_WAKEABLE) && + fd.desc_type == APR_POLL_FILE && + fd.desc.f == pollset->wakeup_pipe[0]) { + drain_wakeup_pipe(pollset); + /* XXX: Is this a correct return value ? + * We might simply return APR_SUCEESS. + */ + rv = APR_EINTR; + } + else { + pollset->result_set[j] = fd; + pollset->result_set[j].rtnevents = + get_epoll_revent(pollset->pollset[i].events); + j++; + } } + (*num) = j; } else { - for (i = 0; i < ret; i++) { - pollset->result_set[i] = - (((pfd_elem_t *) (pollset->pollset[i].data.ptr))->pfd); - pollset->result_set[i].rtnevents = - get_epoll_revent(pollset->pollset[i].events); + for (i = 0, j = 0; i < ret; i++) { + fd = (((pfd_elem_t *) (pollset->pollset[i].data.ptr))->pfd); + if ((pollset->flags & APR_POLLSET_WAKEABLE) && + fd.desc_type == APR_POLL_FILE && + fd.desc.f == pollset->wakeup_pipe[0]) { + drain_wakeup_pipe(pollset); + /* XXX: Is this a correct return value ? + * We might simply return APR_SUCEESS. + */ + rv = APR_EINTR; + } + else { + pollset->result_set[j] = fd; + pollset->result_set[j].rtnevents = + get_epoll_revent(pollset->pollset[i].events); + j++; + } } + (*num) = j; } if (descriptors) { @@ -296,6 +388,14 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return rv; } +APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) +{ + if (pollset->flags & APR_POLLSET_WAKEABLE) + return apr_file_putc(1, pollset->wakeup_pipe[1]); + else + return APR_EINIT; +} + struct apr_pollcb_t { apr_pool_t *pool; apr_uint32_t nalloc; diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 501953dc43b..1e98656d77a 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -44,6 +44,8 @@ struct apr_pollset_t struct kevent *ke_set; apr_pollfd_t *result_set; apr_uint32_t flags; + /* Pipe descriptors used for wakeup */ + apr_file_t *wakeup_pipe[2]; #if APR_HAS_THREADS /* A thread mutex to protect operations on the rings */ apr_thread_mutex_t *ring_lock; @@ -61,9 +63,57 @@ static apr_status_t backend_cleanup(void *p_) { apr_pollset_t *pollset = (apr_pollset_t *) p_; close(pollset->kqueue_fd); + if (pollset->flags & APR_POLLSET_WAKEABLE) { + /* Close both sides of the wakeup pipe */ + if (pollset->wakeup_pipe[0]) { + apr_file_close(pollset->wakeup_pipe[0]); + pollset->wakeup_pipe[0] = NULL; + } + if (pollset->wakeup_pipe[1]) { + apr_file_close(pollset->wakeup_pipe[1]); + pollset->wakeup_pipe[1] = NULL; + } + } return APR_SUCCESS; } +/* Create a dummy wakeup pipe for interrupting the poller + */ +static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) +{ + apr_status_t rv; + apr_pollfd_t fd; + + if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], + &pollset->wakeup_pipe[1], + pollset->pool)) != APR_SUCCESS) + return rv; + fd.reqevents = APR_POLLIN; + fd.desc_type = APR_POLL_FILE; + fd.desc.f = pollset->wakeup_pipe[0]; + /* Add the pipe to the pollset + */ + return apr_pollset_add(pollset, &fd); +} + +/* Read and discard what's ever in the wakeup pipe. + */ +static void drain_wakeup_pipe(apr_pollset_t *pollset) +{ + char rb[512]; + apr_size_t nr = sizeof(rb); + + while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { + /* Although we write just one byte to the other end of the pipe + * during wakeup, multiple treads could call the wakeup. + * So simply drain out from the input side of the pipe all + * the data. + */ + if (nr != sizeof(rb)) + break; + } +} + APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, @@ -85,6 +135,11 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, return APR_ENOTIMPL; } #endif + if (flags & APR_POLLSET_WAKEABLE) { + /* Add room for wakeup descriptor */ + size++; + } + (*pollset)->nelts = 0; (*pollset)->nalloc = size; (*pollset)->flags = flags; @@ -101,14 +156,21 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, return apr_get_netos_error(); } - apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup, - apr_pool_cleanup_null); - (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); APR_RING_INIT(&(*pollset)->query_ring, pfd_elem_t, link); APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link); APR_RING_INIT(&(*pollset)->dead_ring, pfd_elem_t, link); + if (flags & APR_POLLSET_WAKEABLE) { + /* Create wakeup pipe */ + if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { + close((*pollset)->kqueue_fd); + *pollset = NULL; + return rv; + } + } + apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup, + apr_pool_cleanup_null); return rv; } @@ -234,9 +296,10 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_int32_t *num, const apr_pollfd_t **descriptors) { - int ret, i; + int ret, i, j; struct timespec tv, *tvptr; apr_status_t rv = APR_SUCCESS; + apr_pollfd_t fd; if (timeout < 0) { tvptr = NULL; @@ -257,14 +320,26 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, rv = APR_TIMEUP; } else { - for (i = 0; i < ret; i++) { - pollset->result_set[i] = - (((pfd_elem_t*)(pollset->ke_set[i].udata))->pfd); - pollset->result_set[i].rtnevents = - get_kqueue_revent(pollset->ke_set[i].filter, - pollset->ke_set[i].flags); + for (i = 0, j = 0; i < ret; i++) { + fd = (((pfd_elem_t*)(pollset->ke_set[i].udata))->pfd); + if ((pollset->flags & APR_POLLSET_WAKEABLE) && + fd.desc_type == APR_POLL_FILE && + fd.desc.f == pollset->wakeup_pipe[0]) { + drain_wakeup_pipe(pollset); + /* XXX: Is this a correct return value ? + * We might simply return APR_SUCEESS. + */ + rv = APR_EINTR; + } + else { + pollset->result_set[j] = fd; + pollset->result_set[j].rtnevents = + get_kqueue_revent(pollset->ke_set[i].filter, + pollset->ke_set[i].flags); + j++; + } } - + (*num) = j; if (descriptors) { *descriptors = pollset->result_set; } @@ -281,6 +356,13 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return rv; } +APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) +{ + if (pollset->flags & APR_POLLSET_WAKEABLE) + return apr_file_putc(1, pollset->wakeup_pipe[1]); + else + return APR_EINIT; +} struct apr_pollcb_t { apr_pool_t *pool; diff --git a/poll/unix/poll.c b/poll/unix/poll.c index cca8bfe8a4e..25b45c26918 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -156,11 +156,69 @@ struct apr_pollset_t apr_pool_t *pool; apr_uint32_t nelts; apr_uint32_t nalloc; + apr_uint32_t flags; + /* Pipe descriptors used for wakeup */ + apr_file_t *wakeup_pipe[2]; struct pollfd *pollset; apr_pollfd_t *query_set; apr_pollfd_t *result_set; }; +/* Create a dummy wakeup pipe for interrupting the poller + */ +static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) +{ + apr_status_t rv; + apr_pollfd_t fd; + + if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], + &pollset->wakeup_pipe[1], + pollset->pool)) != APR_SUCCESS) + return rv; + fd.reqevents = APR_POLLIN; + fd.desc_type = APR_POLL_FILE; + fd.desc.f = pollset->wakeup_pipe[0]; + /* Add the pipe to the pollset + */ + return apr_pollset_add(pollset, &fd); +} + +/* Read and discard what's ever in the wakeup pipe. + */ +static void drain_wakeup_pipe(apr_pollset_t *pollset) +{ + char rb[512]; + apr_size_t nr = sizeof(rb); + + while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { + /* Although we write just one byte to the other end of the pipe + * during wakeup, multiple treads could call the wakeup. + * So simply drain out from the input side of the pipe all + * the data. + */ + if (nr != sizeof(rb)) + break; + } +} + +static apr_status_t wakeup_pipe_cleanup(void *p) +{ + apr_pollset_t *pollset = (apr_pollset_t *) p; + if (pollset->flags & APR_POLLSET_WAKEABLE) { + /* Close both sides of the wakeup pipe */ + if (pollset->wakeup_pipe[0]) { + apr_file_close(pollset->wakeup_pipe[0]); + pollset->wakeup_pipe[0] = NULL; + } + if (pollset->wakeup_pipe[1]) { + apr_file_close(pollset->wakeup_pipe[1]); + pollset->wakeup_pipe[1] = NULL; + } + } + + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, @@ -170,20 +228,40 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, *pollset = NULL; return APR_ENOTIMPL; } + if (flags & APR_POLLSET_WAKEABLE) { + /* Add room for wakeup descriptor */ + size++; + } *pollset = apr_palloc(p, sizeof(**pollset)); (*pollset)->nelts = 0; (*pollset)->nalloc = size; (*pollset)->pool = p; + (*pollset)->flags = flags; (*pollset)->pollset = apr_palloc(p, size * sizeof(struct pollfd)); (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + + if (flags & APR_POLLSET_WAKEABLE) { + apr_status_t rv; + /* Create wakeup pipe */ + if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { + *pollset = NULL; + return rv; + } + apr_pool_cleanup_register(p, *pollset, wakeup_pipe_cleanup, + apr_pool_cleanup_null); + } return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) { - return APR_SUCCESS; + if (pollset->flags & APR_POLLSET_WAKEABLE) + return apr_pool_cleanup_run(pollset->pool, pollset, + wakeup_pipe_cleanup); + else + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, @@ -242,32 +320,57 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_int32_t *num, const apr_pollfd_t **descriptors) { - int rv; + int ret; + apr_status_t rv = APR_SUCCESS; apr_uint32_t i, j; if (timeout > 0) { timeout /= 1000; } - rv = poll(pollset->pollset, pollset->nelts, timeout); - (*num) = rv; - if (rv < 0) { + ret = poll(pollset->pollset, pollset->nelts, timeout); + (*num) = ret; + if (ret < 0) { return apr_get_netos_error(); } - if (rv == 0) { + else if (ret == 0) { return APR_TIMEUP; } - j = 0; - for (i = 0; i < pollset->nelts; i++) { - if (pollset->pollset[i].revents != 0) { - pollset->result_set[j] = pollset->query_set[i]; - pollset->result_set[j].rtnevents = - get_revent(pollset->pollset[i].revents); - j++; + else { + for (i = 0, j = 0; i < pollset->nelts; i++) { + if (pollset->pollset[i].revents != 0) { + /* Check if the polled descriptor is our + * wakeup pipe. In that case do not put it result set. + */ + if ((pollset->flags & APR_POLLSET_WAKEABLE) && + pollset->query_set[i].desc_type == APR_POLL_FILE && + pollset->query_set[i].desc.f == pollset->wakeup_pipe[0]) { + drain_wakeup_pipe(pollset); + /* XXX: Is this a correct return value ? + * We might simply return APR_SUCEESS. + */ + rv = APR_EINTR; + } + else { + pollset->result_set[j] = pollset->query_set[i]; + pollset->result_set[j].rtnevents = + get_revent(pollset->pollset[i].revents); + j++; + } + } } + (*num) = j; } - if (descriptors) + if (descriptors && (*num)) *descriptors = pollset->result_set; - return APR_SUCCESS; + return rv; +} + +APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) +{ + if (pollset->flags & APR_POLLSET_WAKEABLE) + return apr_file_putc(1, pollset->wakeup_pipe[1]); + else + return APR_EINIT; } APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, diff --git a/poll/unix/port.c b/poll/unix/port.c index 05848d6180d..2c1f839c2d8 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -68,6 +68,8 @@ struct apr_pollset_t port_event_t *port_set; apr_pollfd_t *result_set; apr_uint32_t flags; + /* Pipe descriptors used for wakeup */ + apr_file_t *wakeup_pipe[2]; #if APR_HAS_THREADS /* A thread mutex to protect operations on the rings */ apr_thread_mutex_t *ring_lock; @@ -86,9 +88,57 @@ static apr_status_t backend_cleanup(void *p_) { apr_pollset_t *pollset = (apr_pollset_t *) p_; close(pollset->port_fd); + if (pollset->flags & APR_POLLSET_WAKEABLE) { + /* Close both sides of the wakeup pipe */ + if (pollset->wakeup_pipe[0]) { + apr_file_close(pollset->wakeup_pipe[0]); + pollset->wakeup_pipe[0] = NULL; + } + if (pollset->wakeup_pipe[1]) { + apr_file_close(pollset->wakeup_pipe[1]); + pollset->wakeup_pipe[1] = NULL; + } + } return APR_SUCCESS; } +/* Create a dummy wakeup pipe for interrupting the poller + */ +static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) +{ + apr_status_t rv; + apr_pollfd_t fd; + + if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], + &pollset->wakeup_pipe[1], + pollset->pool)) != APR_SUCCESS) + return rv; + fd.reqevents = APR_POLLIN; + fd.desc_type = APR_POLL_FILE; + fd.desc.f = pollset->wakeup_pipe[0]; + /* Add the pipe to the pollset + */ + return apr_pollset_add(pollset, &fd); +} + +/* Read and discard what's ever in the wakeup pipe. + */ +static void drain_wakeup_pipe(apr_pollset_t *pollset) +{ + char rb[512]; + apr_size_t nr = sizeof(rb); + + while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { + /* Although we write just one byte to the other end of the pipe + * during wakeup, multiple treads could call the wakeup. + * So simply drain out from the input side of the pipe all + * the data. + */ + if (nr != sizeof(rb)) + break; + } +} + APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, @@ -110,6 +160,10 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, return APR_ENOTIMPL; } #endif + if (flags & APR_POLLSET_WAKEABLE) { + /* Add room for wakeup descriptor */ + size++; + } (*pollset)->nelts = 0; (*pollset)->nalloc = size; (*pollset)->flags = flags; @@ -123,9 +177,6 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, return APR_ENOMEM; } - apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup, - apr_pool_cleanup_null); - (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); APR_RING_INIT(&(*pollset)->query_ring, pfd_elem_t, link); @@ -133,6 +184,17 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link); APR_RING_INIT(&(*pollset)->dead_ring, pfd_elem_t, link); + if (flags & APR_POLLSET_WAKEABLE) { + /* Create wakeup pipe */ + if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { + close((*pollset)->port_fd); + *pollset = NULL; + return rv; + } + } + apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup, + apr_pool_cleanup_null); + return rv; } @@ -249,11 +311,12 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, const apr_pollfd_t **descriptors) { apr_os_sock_t fd; - int ret, i; + int ret, i, j; unsigned int nget; pfd_elem_t *ep; struct timespec tv, *tvptr; apr_status_t rv = APR_SUCCESS; + apr_pollfd_t fp; if (timeout < 0) { tvptr = NULL; @@ -304,21 +367,32 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); - for (i = 0; i < nget; i++) { - pollset->result_set[i] = - (((pfd_elem_t*)(pollset->port_set[i].portev_user))->pfd); - pollset->result_set[i].rtnevents = - get_revent(pollset->port_set[i].portev_events); - - APR_RING_REMOVE((pfd_elem_t*)pollset->port_set[i].portev_user, link); - - APR_RING_INSERT_TAIL(&(pollset->add_ring), - (pfd_elem_t*)pollset->port_set[i].portev_user, - pfd_elem_t, link); + for (i = 0, j = 0; i < nget; i++) { + fp = (((pfd_elem_t*)(pollset->port_set[i].portev_user))->pfd); + if ((pollset->flags & APR_POLLSET_WAKEABLE) && + fd.desc_type == APR_POLL_FILE && + fd.desc.f == pollset->wakeup_pipe[0]) { + drain_wakeup_pipe(pollset); + /* XXX: Is this a correct return value ? + * We might simply return APR_SUCEESS. + */ + rv = APR_EINTR; + } + else { + pollset->result_set[j] = fp; + pollset->result_set[j].rtnevents = + get_revent(pollset->port_set[i].portev_events); + + APR_RING_REMOVE((pfd_elem_t*)pollset->port_set[i].portev_user, + link); + APR_RING_INSERT_TAIL(&(pollset->add_ring), + (pfd_elem_t*)pollset->port_set[i].portev_user, + pfd_elem_t, link); + j++; + } } - pollset_unlock_rings(); - + (*num) = j; if (descriptors) { *descriptors = pollset->result_set; } @@ -335,6 +409,14 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return rv; } +APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) +{ + if (pollset->flags & APR_POLLSET_WAKEABLE) + return apr_file_putc(1, pollset->wakeup_pipe[1]); + else + return APR_EINIT; +} + struct apr_pollcb_t { apr_pool_t *pool; apr_uint32_t nalloc; diff --git a/poll/unix/select.c b/poll/unix/select.c index 42e7a3f68ec..2d736420980 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -179,11 +179,104 @@ struct apr_pollset_t int maxfd; apr_pollfd_t *query_set; apr_pollfd_t *result_set; + apr_uint32_t flags; + /* Pipe descriptors used for wakeup */ + apr_file_t *wakeup_pipe[2]; #ifdef NETWARE int set_type; #endif }; +#if !APR_FILES_AS_SOCKETS +#if defined (WIN32) + +extern apr_status_t +apr_file_socket_pipe_create(apr_file_t **in, + apr_file_t **out, + apr_pool_t *p); + +/* Create a dummy wakeup socket pipe for interrupting the poller + */ +static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) +{ + apr_status_t rv; + apr_pollfd_t fd; + + if ((rv = apr_file_socket_pipe_create(&pollset->wakeup_pipe[0], + &pollset->wakeup_pipe[1], + pollset->pool)) != APR_SUCCESS) + return rv; + fd.reqevents = APR_POLLIN; + fd.desc_type = APR_POLL_FILE; + fd.desc.f = pollset->wakeup_pipe[0]; + /* Add the pipe to the pollset + */ + return apr_pollset_add(pollset, &fd); +} +#else /* !WIN32 */ +static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) +{ + return APR_ENOTIMPL; +} +#endif /* WIN32 */ +#else /* APR_FILES_AS_SOCKETS */ + +/* Create a dummy wakeup pipe for interrupting the poller + */ +static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) +{ + apr_status_t rv; + apr_pollfd_t fd; + + if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], + &pollset->wakeup_pipe[1], + pollset->pool)) != APR_SUCCESS) + return rv; + fd.reqevents = APR_POLLIN; + fd.desc_type = APR_POLL_FILE; + fd.desc.f = pollset->wakeup_pipe[0]; + /* Add the pipe to the pollset + */ + return apr_pollset_add(pollset, &fd); +} +#endif /* !APR_FILES_AS_SOCKETS */ + +/* Read and discard what's ever in the wakeup pipe. + */ +static void drain_wakeup_pipe(apr_pollset_t *pollset) +{ + char rb[512]; + apr_size_t nr = sizeof(rb); + + while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { + /* Although we write just one byte to the other end of the pipe + * during wakeup, multiple treads could call the wakeup. + * So simply drain out from the input side of the pipe all + * the data. + */ + if (nr != sizeof(rb)) + break; + } +} + +static apr_status_t wakeup_pipe_cleanup(void *p) +{ + apr_pollset_t *pollset = (apr_pollset_t *) p; + if (pollset->flags & APR_POLLSET_WAKEABLE) { + /* Close both sides of the wakeup pipe */ + if (pollset->wakeup_pipe[0]) { + apr_file_close(pollset->wakeup_pipe[0]); + pollset->wakeup_pipe[0] = NULL; + } + if (pollset->wakeup_pipe[1]) { + apr_file_close(pollset->wakeup_pipe[1]); + pollset->wakeup_pipe[1] = NULL; + } + } + + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, @@ -193,6 +286,10 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, *pollset = NULL; return APR_ENOTIMPL; } + if (flags & APR_POLLSET_WAKEABLE) { + /* Add room for wakeup descriptor */ + size++; + } #ifdef FD_SETSIZE if (size > FD_SETSIZE) { *pollset = NULL; @@ -203,6 +300,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, (*pollset)->nelts = 0; (*pollset)->nalloc = size; (*pollset)->pool = p; + (*pollset)->flags = flags; FD_ZERO(&((*pollset)->readset)); FD_ZERO(&((*pollset)->writeset)); FD_ZERO(&((*pollset)->exceptset)); @@ -213,12 +311,26 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + if (flags & APR_POLLSET_WAKEABLE) { + apr_status_t rv; + /* Create wakeup pipe */ + if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { + *pollset = NULL; + return rv; + } + apr_pool_cleanup_register(p, *pollset, wakeup_pipe_cleanup, + apr_pool_cleanup_null); + } return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t * pollset) { - return APR_SUCCESS; + if (pollset->flags & APR_POLLSET_WAKEABLE) + return apr_pool_cleanup_run(pollset->pool, pollset, + wakeup_pipe_cleanup); + else + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, @@ -335,10 +447,11 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_int32_t *num, const apr_pollfd_t **descriptors) { - int rv; + int rs; apr_uint32_t i, j; struct timeval tv, *tvptr; fd_set readset, writeset, exceptset; + apr_status_t rv = APR_SUCCESS; if (timeout < 0) { tvptr = NULL; @@ -355,19 +468,19 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, #ifdef NETWARE if (HAS_PIPES(pollset->set_type)) { - rv = pipe_select(pollset->maxfd + 1, &readset, &writeset, &exceptset, + rs = pipe_select(pollset->maxfd + 1, &readset, &writeset, &exceptset, tvptr); } else #endif - rv = select(pollset->maxfd + 1, &readset, &writeset, &exceptset, + rs = select(pollset->maxfd + 1, &readset, &writeset, &exceptset, tvptr); - (*num) = rv; - if (rv < 0) { + (*num) = rs; + if (rs < 0) { return apr_get_netos_error(); } - if (rv == 0) { + if (rs == 0) { return APR_TIMEUP; } j = 0; @@ -377,11 +490,22 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, fd = pollset->query_set[i].desc.s->socketdes; } else { + if ((pollset->flags & APR_POLLSET_WAKEABLE) && + pollset->query_set[i].desc.f == pollset->wakeup_pipe[0]) { + drain_wakeup_pipe(pollset); + /* XXX: Is this a correct return value ? + * We might simply return APR_SUCEESS. + */ + rv = APR_EINTR; + continue; + } + else { #if !APR_FILES_AS_SOCKETS - return APR_EBADF; + return APR_EBADF; #else - fd = pollset->query_set[i].desc.f->filedes; + fd = pollset->query_set[i].desc.f->filedes; #endif + } } if (FD_ISSET(fd, &readset) || FD_ISSET(fd, &writeset) || FD_ISSET(fd, &exceptset)) { @@ -403,7 +527,15 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, if (descriptors) *descriptors = pollset->result_set; - return APR_SUCCESS; + return rv; +} + +APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) +{ + if (pollset->flags & APR_POLLSET_WAKEABLE) + return apr_file_putc(1, pollset->wakeup_pipe[1]); + else + return APR_EINIT; } APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, From 8853101ea4e9039c1cc8b8a91c2bba770eb9b50e Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Mon, 21 Apr 2008 12:04:08 +0000 Subject: [PATCH 6149/7878] Return APR_EINTR only there was no additional descriptors signaled at the time of wakeup call git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@650118 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 2 +- poll/unix/epoll.c | 12 ++++-------- poll/unix/kqueue.c | 6 ++---- poll/unix/poll.c | 6 ++---- poll/unix/port.c | 6 ++---- poll/unix/select.c | 6 ++---- 6 files changed, 13 insertions(+), 25 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index 657c4fbe36c..b330c261440 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -169,7 +169,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, * @param descriptors Array of signalled descriptors (output parameter) * @remark If the pollset has been created with APR_POLLSET_WAKEABLE * and the wakeup has been called while waiting for activity - * return value is APR_EINTR and num is set to number of signalled + * return value is APR_EINTR in case there was no signaled * descriptors at the time of wakeup call. */ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 82660b4446c..a8395fc2cee 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -335,9 +335,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, fd.desc_type == APR_POLL_FILE && fd.desc.f == pollset->wakeup_pipe[0]) { drain_wakeup_pipe(pollset); - /* XXX: Is this a correct return value ? - * We might simply return APR_SUCEESS. - */ rv = APR_EINTR; } else { @@ -347,7 +344,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, j++; } } - (*num) = j; + if ((*num) = j) + rv = APR_SUCCESS; } else { for (i = 0, j = 0; i < ret; i++) { @@ -356,9 +354,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, fd.desc_type == APR_POLL_FILE && fd.desc.f == pollset->wakeup_pipe[0]) { drain_wakeup_pipe(pollset); - /* XXX: Is this a correct return value ? - * We might simply return APR_SUCEESS. - */ rv = APR_EINTR; } else { @@ -368,7 +363,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, j++; } } - (*num) = j; + if ((*num) = j) + rv = APR_SUCCESS; } if (descriptors) { diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 1e98656d77a..95519ddd2b1 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -326,9 +326,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, fd.desc_type == APR_POLL_FILE && fd.desc.f == pollset->wakeup_pipe[0]) { drain_wakeup_pipe(pollset); - /* XXX: Is this a correct return value ? - * We might simply return APR_SUCEESS. - */ rv = APR_EINTR; } else { @@ -339,7 +336,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, j++; } } - (*num) = j; + if ((*num) = j) + rv = APR_SUCCESS; if (descriptors) { *descriptors = pollset->result_set; } diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 25b45c26918..29a5f6655b8 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -345,9 +345,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset->query_set[i].desc_type == APR_POLL_FILE && pollset->query_set[i].desc.f == pollset->wakeup_pipe[0]) { drain_wakeup_pipe(pollset); - /* XXX: Is this a correct return value ? - * We might simply return APR_SUCEESS. - */ rv = APR_EINTR; } else { @@ -358,7 +355,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } } } - (*num) = j; + if ((*num) = j) + rv = APR_SUCCESS; } if (descriptors && (*num)) *descriptors = pollset->result_set; diff --git a/poll/unix/port.c b/poll/unix/port.c index 2c1f839c2d8..f698e70fcdf 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -373,9 +373,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, fd.desc_type == APR_POLL_FILE && fd.desc.f == pollset->wakeup_pipe[0]) { drain_wakeup_pipe(pollset); - /* XXX: Is this a correct return value ? - * We might simply return APR_SUCEESS. - */ rv = APR_EINTR; } else { @@ -392,7 +389,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } } pollset_unlock_rings(); - (*num) = j; + if ((*num) = j) + rv = APR_SUCCESS; if (descriptors) { *descriptors = pollset->result_set; } diff --git a/poll/unix/select.c b/poll/unix/select.c index 2d736420980..142453fb34c 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -493,9 +493,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, if ((pollset->flags & APR_POLLSET_WAKEABLE) && pollset->query_set[i].desc.f == pollset->wakeup_pipe[0]) { drain_wakeup_pipe(pollset); - /* XXX: Is this a correct return value ? - * We might simply return APR_SUCEESS. - */ rv = APR_EINTR; continue; } @@ -523,7 +520,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, j++; } } - (*num) = j; + if ((*num) = j) + rv = APR_SUCCESS; if (descriptors) *descriptors = pollset->result_set; From e6115a83b44a890845f992111c2eac86e9ab0430 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Thu, 24 Apr 2008 07:06:28 +0000 Subject: [PATCH 6150/7878] Make copy buffer bigger PR #44193 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@651174 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/copy.c | 2 +- include/arch/netware/apr_arch_file_io.h | 6 ++++++ include/arch/os2/apr_arch_file_io.h | 6 ++++++ include/arch/unix/apr_arch_file_io.h | 6 ++++++ include/arch/win32/apr_arch_file_io.h | 6 ++++++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index 113a1081bdc..ad2e92d30da 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -54,7 +54,7 @@ static apr_status_t apr_file_transfer_contents(const char *from_path, /* Copy bytes till the cows come home. */ while (1) { - char buf[BUFSIZ]; + char buf[APR_BUFSIZ]; apr_size_t bytes_this_time = sizeof(buf); apr_status_t read_err; apr_status_t write_err; diff --git a/include/arch/netware/apr_arch_file_io.h b/include/arch/netware/apr_arch_file_io.h index 0676eb2789e..42e9ff43b01 100644 --- a/include/arch/netware/apr_arch_file_io.h +++ b/include/arch/netware/apr_arch_file_io.h @@ -73,6 +73,12 @@ /* For backwards compat */ #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE +#if BUFSIZ > APR_FILE_DEFAULT_BUFSIZE +#define APR_BUFSIZ BUFSIZ +#else +#define APR_BUFSIZ APR_FILE_DEFAULT_BUFSIZE +#endif + #if APR_HAS_THREADS #define file_lock(f) do { \ if ((f)->thlock) \ diff --git a/include/arch/os2/apr_arch_file_io.h b/include/arch/os2/apr_arch_file_io.h index 399371237a9..daa78bb7770 100644 --- a/include/arch/os2/apr_arch_file_io.h +++ b/include/arch/os2/apr_arch_file_io.h @@ -34,6 +34,12 @@ #define APR_FILE_DEFAULT_BUFSIZE 4096 #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE +#if BUFSIZ > APR_FILE_DEFAULT_BUFSIZE +#define APR_BUFSIZ BUFSIZ +#else +#define APR_BUFSIZ APR_FILE_DEFAULT_BUFSIZE +#endif + struct apr_file_t { apr_pool_t *pool; HFILE filedes; diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index 77a909177b4..a96573ce3f8 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -90,6 +90,12 @@ /* For backwards-compat */ #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE +#if BUFSIZ > APR_FILE_DEFAULT_BUFSIZE +#define APR_BUFSIZ BUFSIZ +#else +#define APR_BUFSIZ APR_FILE_DEFAULT_BUFSIZE +#endif + struct apr_file_t { apr_pool_t *pool; int filedes; diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index c8c7bdee887..a0e0d9527fb 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -86,6 +86,12 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool); /* For backwards-compat */ #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE +#if BUFSIZ > APR_FILE_DEFAULT_BUFSIZE +#define APR_BUFSIZ BUFSIZ +#else +#define APR_BUFSIZ APR_FILE_DEFAULT_BUFSIZE +#endif + /* obscure ommissions from msvc's sys/stat.h */ #ifdef _MSC_VER #define S_IFIFO _S_IFIFO /* pipe */ From 41acdbd57cdecb6e7b2718fe28e966537f35bc05 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 24 Apr 2008 20:25:55 +0000 Subject: [PATCH 6151/7878] Support OS/X sendfile by using writev rather than the miscounted sendfile's hdtr iovecs. Submitted by: Geoff Greer git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@651395 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ network_io/unix/sendrecv.c | 38 ++++++++++++++++++++++++++------------ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 98b96c075f3..9b3bf4a90a6 100644 --- a/CHANGES +++ b/CHANGES @@ -11,6 +11,9 @@ Changes for APR 1.4.0 Changes for APR 1.3.0 + *) Support OS/X sendfile by using writev in lieu of hdtr vecs + miscounted by the OS. [Geoff Greer ] + *) Introduce apr_pool_pre_cleanup_register() for registering a cleanup that is called before any subpool is destroyed within apr_pool_clear or apr_pool_destroy. diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index eedf481c15d..89e5ea7495c 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -411,8 +411,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, apr_size_t * len, apr_int32_t flags) { apr_off_t nbytes = *len; + apr_off_t bytes_to_send = *len; + apr_size_t header_bytes_written = 0; int rv; - struct sf_hdtr headerstruct; /* Ignore flags for now. */ flags = 0; @@ -421,12 +422,10 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, hdtr = &no_hdtr; } - headerstruct.headers = hdtr->headers; - headerstruct.hdr_cnt = hdtr->numheaders; - headerstruct.trailers = hdtr->trailers; - headerstruct.trl_cnt = hdtr->numtrailers; - - /* BSD can send the headers/footers as part of the system call */ + /* OS X can send the headers/footers as part of the system call, + * but how it counts bytes isn't documented properly. We use + * writev() instead. + */ do { if (sock->options & APR_INCOMPLETE_WRITE) { apr_status_t arv; @@ -437,18 +436,33 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, return arv; } } - if (nbytes) { + + if (hdtr->numheaders) { + rv = writev(sock->socketdes, + hdtr->headers, + hdtr->numheaders); + if (rv > 0) { + header_bytes_written = rv; + rv = 0; + } + else { + header_bytes_written = 0; + } + } + else if (bytes_to_send) { /* We won't dare call sendfile() if we don't have * header or file bytes to send because nbytes == 0 * means send the remaining file to EOF. */ + nbytes = bytes_to_send; rv = sendfile(file->filedes, /* file to be sent */ sock->socketdes, /* socket */ *offset, /* where in the file to start */ &nbytes, /* number of bytes to write/written */ - &headerstruct, /* Headers/footers */ + NULL, /* Headers/footers */ flags); /* undefined, set to 0 */ + bytes_to_send -= nbytes; if (rv == -1) { if (errno == EAGAIN) { if (sock->timeout > 0) { @@ -460,7 +474,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, */ if (nbytes) { /* normal exit for a big file & non-blocking io */ - (*len) = nbytes; + (*len) = nbytes + header_bytes_written; return APR_SUCCESS; } } @@ -470,11 +484,11 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, /* Most likely the file got smaller after the stat. * Return an error so the caller can do the Right Thing. */ - (*len) = nbytes; + (*len) = nbytes + header_bytes_written; return APR_EOF; } } - } + } else { /* just trailer bytes... use writev() */ From 252f3b86f95b662a5ea23b4aa3edbfaf75286589 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 25 Apr 2008 17:03:56 +0000 Subject: [PATCH 6152/7878] Correct legacy crumbs from the new OS/X sendfile changes. Submitted by: Geoff Greer ] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@651651 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 89e5ea7495c..3b43508c2ed 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -410,7 +410,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, apr_int32_t flags) { - apr_off_t nbytes = *len; + apr_off_t nbytes = 0; apr_off_t bytes_to_send = *len; apr_size_t header_bytes_written = 0; int rv; @@ -445,9 +445,6 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, header_bytes_written = rv; rv = 0; } - else { - header_bytes_written = 0; - } } else if (bytes_to_send) { /* We won't dare call sendfile() if we don't have @@ -513,7 +510,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, } } while (rv == -1 && (errno == EINTR || errno == EAGAIN)); - (*len) = nbytes; + (*len) = nbytes + header_bytes_written; if (rv == -1) { return errno; } From e3eb59c272d2d23d16ee97a370bd61be5e02d51f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 25 Apr 2008 17:05:58 +0000 Subject: [PATCH 6153/7878] Not-in 1.3.x git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@651653 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGES b/CHANGES index 9b3bf4a90a6..deb213db70f 100644 --- a/CHANGES +++ b/CHANGES @@ -40,9 +40,6 @@ Changes for APR 1.3.0 *) Fix the make test target in the spec file. [Graham Leggett] - *) Add error codes for the SSL EVP interface for apr-util. - [Graham Leggett] - *) Fix DSO-related crash on z/OS caused by incorrect memory allocation. [David Jones ] From d9bb2f3545ff5859e4880cec21afb4cdd47ef8cb Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Fri, 25 Apr 2008 21:52:36 +0000 Subject: [PATCH 6154/7878] Remove APR_BUFSIZ definition, as it would only be used in one place Put buffer sizing directly into the only function that uses it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@651704 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/copy.c | 3 ++- include/arch/netware/apr_arch_file_io.h | 6 ------ include/arch/os2/apr_arch_file_io.h | 6 ------ include/arch/unix/apr_arch_file_io.h | 6 ------ include/arch/win32/apr_arch_file_io.h | 6 ------ 5 files changed, 2 insertions(+), 25 deletions(-) diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index ad2e92d30da..c0d8021eb77 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -54,7 +54,8 @@ static apr_status_t apr_file_transfer_contents(const char *from_path, /* Copy bytes till the cows come home. */ while (1) { - char buf[APR_BUFSIZ]; + char buf[BUFSIZ > APR_FILE_DEFAULT_BUFSIZE ? BUFSIZ + : APR_FILE_DEFAULT_BUFSIZE]; apr_size_t bytes_this_time = sizeof(buf); apr_status_t read_err; apr_status_t write_err; diff --git a/include/arch/netware/apr_arch_file_io.h b/include/arch/netware/apr_arch_file_io.h index 42e9ff43b01..0676eb2789e 100644 --- a/include/arch/netware/apr_arch_file_io.h +++ b/include/arch/netware/apr_arch_file_io.h @@ -73,12 +73,6 @@ /* For backwards compat */ #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE -#if BUFSIZ > APR_FILE_DEFAULT_BUFSIZE -#define APR_BUFSIZ BUFSIZ -#else -#define APR_BUFSIZ APR_FILE_DEFAULT_BUFSIZE -#endif - #if APR_HAS_THREADS #define file_lock(f) do { \ if ((f)->thlock) \ diff --git a/include/arch/os2/apr_arch_file_io.h b/include/arch/os2/apr_arch_file_io.h index daa78bb7770..399371237a9 100644 --- a/include/arch/os2/apr_arch_file_io.h +++ b/include/arch/os2/apr_arch_file_io.h @@ -34,12 +34,6 @@ #define APR_FILE_DEFAULT_BUFSIZE 4096 #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE -#if BUFSIZ > APR_FILE_DEFAULT_BUFSIZE -#define APR_BUFSIZ BUFSIZ -#else -#define APR_BUFSIZ APR_FILE_DEFAULT_BUFSIZE -#endif - struct apr_file_t { apr_pool_t *pool; HFILE filedes; diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index a96573ce3f8..77a909177b4 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -90,12 +90,6 @@ /* For backwards-compat */ #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE -#if BUFSIZ > APR_FILE_DEFAULT_BUFSIZE -#define APR_BUFSIZ BUFSIZ -#else -#define APR_BUFSIZ APR_FILE_DEFAULT_BUFSIZE -#endif - struct apr_file_t { apr_pool_t *pool; int filedes; diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index a0e0d9527fb..c8c7bdee887 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -86,12 +86,6 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool); /* For backwards-compat */ #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE -#if BUFSIZ > APR_FILE_DEFAULT_BUFSIZE -#define APR_BUFSIZ BUFSIZ -#else -#define APR_BUFSIZ APR_FILE_DEFAULT_BUFSIZE -#endif - /* obscure ommissions from msvc's sys/stat.h */ #ifdef _MSC_VER #define S_IFIFO _S_IFIFO /* pipe */ From 950765849c5143634b118962c7f42dc02ea9b9b1 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Fri, 25 Apr 2008 22:30:33 +0000 Subject: [PATCH 6155/7878] Rework possibly non-portable constant expression git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@651721 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/copy.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index c0d8021eb77..3a1c59a62dd 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -52,10 +52,15 @@ static apr_status_t apr_file_transfer_contents(const char *from_path, return status; } +#if BUFSIZ > APR_FILE_DEFAULT_BUFSIZE +#define COPY_BUFSIZ BUFSIZ +#else +#define COPY_BUFSIZ APR_FILE_DEFAULT_BUFSIZE +#endif + /* Copy bytes till the cows come home. */ while (1) { - char buf[BUFSIZ > APR_FILE_DEFAULT_BUFSIZE ? BUFSIZ - : APR_FILE_DEFAULT_BUFSIZE]; + char buf[COPY_BUFSIZ]; apr_size_t bytes_this_time = sizeof(buf); apr_status_t read_err; apr_status_t write_err; From 5350d92566a1f459de3dbc881a99c4e297158663 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Tue, 29 Apr 2008 20:19:46 +0000 Subject: [PATCH 6156/7878] * Silence a compiler warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@652085 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index a8395fc2cee..c8ab6d63a32 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -344,7 +344,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, j++; } } - if ((*num) = j) + if (((*num) = j)) rv = APR_SUCCESS; } else { @@ -363,7 +363,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, j++; } } - if ((*num) = j) + if (((*num) = j)) rv = APR_SUCCESS; } From 479f94e14f0c283d756d49bbd368334282066306 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 1 May 2008 22:22:22 +0000 Subject: [PATCH 6157/7878] Reflow the OS/X sendfile implementation to proceed from writev(hd..iovec) to the sendfile/tr..iovec series, tallying these correctly. Submitted by: Geoff Greer and wrowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@652690 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 39 ++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 3b43508c2ed..39dd199e7df 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -413,7 +413,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, apr_off_t nbytes = 0; apr_off_t bytes_to_send = *len; apr_size_t header_bytes_written = 0; - int rv; + int rv = 0; + int sent_headers = 0; /* Ignore flags for now. */ flags = 0; @@ -436,17 +437,24 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, return arv; } } - - if (hdtr->numheaders) { - rv = writev(sock->socketdes, - hdtr->headers, - hdtr->numheaders); - if (rv > 0) { - header_bytes_written = rv; - rv = 0; + + if (!sent_headers) { + if (hdtr->numheaders) { + rv = writev(sock->socketdes, + hdtr->headers, + hdtr->numheaders); + if (rv > 0) { + header_bytes_written = rv; + sent_headers = 1; + rv = 0; + } + } + else { + sent_headers = 1; } } - else if (bytes_to_send) { + + if (bytes_to_send && sent_headers) { /* We won't dare call sendfile() if we don't have * header or file bytes to send because nbytes == 0 * means send the remaining file to EOF. @@ -464,12 +472,13 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, if (errno == EAGAIN) { if (sock->timeout > 0) { sock->options |= APR_INCOMPLETE_WRITE; + rv = 0; } /* BSD's sendfile can return -1/EAGAIN even if it * sent bytes. Sanitize the result so we get normal EAGAIN * semantics w.r.t. bytes sent. */ - if (nbytes) { + else if (nbytes) { /* normal exit for a big file & non-blocking io */ (*len) = nbytes + header_bytes_written; return APR_SUCCESS; @@ -486,19 +495,17 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, } } } - else { + + if (sent_headers && !bytes_to_send) { /* just trailer bytes... use writev() */ rv = writev(sock->socketdes, hdtr->trailers, hdtr->numtrailers); if (rv > 0) { - nbytes = rv; + nbytes += rv; rv = 0; } - else { - nbytes = 0; - } } if ((rv == -1) && (errno == EAGAIN) && (sock->timeout > 0)) { From b4b10ece3135221dd14bc0853f849ae0f0da3c8a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 1 May 2008 22:24:48 +0000 Subject: [PATCH 6158/7878] Optimize away a second poll by simply looping on the existing poll git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@652692 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 39dd199e7df..2362b215e8a 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -507,13 +507,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, rv = 0; } } - if ((rv == -1) && (errno == EAGAIN) - && (sock->timeout > 0)) { - apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } + + if ((rv == -1) && (errno == EAGAIN) && (sock->timeout > 0)) { + sock->options |= APR_INCOMPLETE_WRITE; } } while (rv == -1 && (errno == EINTR || errno == EAGAIN)); From 6c1eb24200281c05f6e96601b3e1c95fb496892c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 2 May 2008 17:04:46 +0000 Subject: [PATCH 6159/7878] Correct BeOS VPATH build for 1.x PR: 44362 Submitted by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@652824 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index a1b786e99fb..5dcb4bad3e4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -18,7 +18,7 @@ APR_MAJOR_VERSION=@APR_MAJOR_VERSION@ INCDIR=./include OSDIR=$(top_srcdir)/include/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include/arch/@DEFAULT_OSDIR@ -I$(top_srcdir)/include # # Macros for target determination From 74498bea7be0469160f6b805b812e17afe73ad23 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 2 May 2008 17:17:14 +0000 Subject: [PATCH 6160/7878] * configure.in: Prefer /dev/urandom over /dev/random. PR: 44881 Submitted by: bojan git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@652830 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 89211724e1e..24eafd3082d 100644 --- a/configure.in +++ b/configure.in @@ -1955,7 +1955,7 @@ if test "$rand" != "1"; then if test "$apr_devrandom" = "yes"; then # /dev/random on OpenBSD doesn't provide random data, so # prefer /dev/arandom, which does; see random(4). - for f in /dev/arandom /dev/random /dev/urandom; do + for f in /dev/arandom /dev/urandom /dev/random; do if test -r $f; then apr_devrandom=$f rand=1 From 94fcda53ddc3958a11fdf3f684fbd27adf0f5de7 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 2 May 2008 17:25:50 +0000 Subject: [PATCH 6161/7878] Document cvt from V7, not GNU libc, and copyright Caldera International Inc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@652832 13f79535-47bb-0310-9956-ffa450edef68 --- LICENSE | 44 ++++++++++++++++++++++++++++++++++++++++++ NOTICE | 3 +++ strings/apr_snprintf.c | 4 ++-- 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 6f0142f292d..02418e19136 100644 --- a/LICENSE +++ b/LICENSE @@ -295,3 +295,47 @@ From strings/apr_strnatcmp.c, include/apr_strings.h: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. +From strings/apr_snprintf.c: + + * + * cvt - IEEE floating point formatting routines. + * Derived from UNIX V7, Copyright(C) Caldera International Inc. + * + + Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + Redistributions of source code and documentation must retain the above + copyright notice, this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + All advertising materials mentioning features or use of this software + must display the following acknowledgement: + + This product includes software developed or owned by Caldera + International, Inc. + + Neither the name of Caldera International, Inc. nor the names of other + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA + INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE FOR ANY DIRECT, + INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + diff --git a/NOTICE b/NOTICE index 129db55ae51..d0f318469a6 100644 --- a/NOTICE +++ b/NOTICE @@ -7,3 +7,6 @@ Illinois at Urbana-Champaign. This software contains code derived from the RSA Data Security Inc. MD5 Message-Digest Algorithm. + +This software contains code derived from UNIX V7, Copyright(C) +Caldera International Inc. diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index bb6ef528a3e..bf3f58537f0 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -68,8 +68,8 @@ typedef enum { #define NUM_BUF_SIZE 512 /* - * cvt.c - IEEE floating point formatting routines for FreeBSD - * from GNU libc-4.6.27. Modified to be thread safe. + * cvt - IEEE floating point formatting routines. + * Derived from UNIX V7, Copyright(C) Caldera International Inc. */ /* From b62d0c5d94d3d61f93e48988a1718fb60ffa39fa Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 2 May 2008 18:20:09 +0000 Subject: [PATCH 6162/7878] Avert the pid "ld" format when building to huge-longs on solaris 64 bit. PR: 43388 Submitted by: Eric Covener git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@652859 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 24eafd3082d..746a12ca107 100644 --- a/configure.in +++ b/configure.in @@ -1347,7 +1347,11 @@ case $host in size_t_fmt="lu" ;; *-solaris*) - pid_t_fmt="ld" + if test "$ac_cv_sizeof_long" = "8"; then + pid_t_fmt="d" + else + pid_t_fmt="ld" + fi ;; *aix4*|*aix5*) ssize_t_fmt="ld" From 2ee280ccfcd759da73be2b379ac1511ee2a706c1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 2 May 2008 18:29:48 +0000 Subject: [PATCH 6163/7878] Leverage the new apr_uintptr_t type for our ULONG_PTR members. PR: 44327 Submitted by: Curt Arnold git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@652866 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 6 ++++++ include/apr.hnw | 6 ++++++ include/apr.hw | 7 +++++++ include/arch/win32/apr_arch_misc.h | 8 ++++---- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 45619c5ad06..50e6880542f 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -287,6 +287,12 @@ typedef @ino_t_value@ apr_ino_t; #define APR_SIZEOF_VOIDP @voidp_size@ +#if APR_SIZEOF_VOIDP == 8 +typedef apr_uint64_t apr_uintptr_t; +#else +typedef apr_uint32_t apr_uintptr_t; +#endif + /* Are we big endian? */ #define APR_IS_BIGENDIAN @bigendian@ diff --git a/include/apr.hnw b/include/apr.hnw index f04195433a5..f25509d38da 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -267,6 +267,12 @@ typedef apr_uint64_t apr_ino_t; #define APR_SIZEOF_VOIDP 4 #endif +#if APR_SIZEOF_VOIDP == 8 +typedef apr_uint64_t apr_uintptr_t; +#else +typedef apr_uint32_t apr_uintptr_t; +#endif + /* Mechanisms to properly type numeric literals */ #define APR_INT64_C(val) (val##LL) #define APR_UINT64_C(val) (val##ULL) diff --git a/include/apr.hw b/include/apr.hw index c1e2e51eeaa..4aeca41bec2 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -358,6 +358,13 @@ typedef apr_uint64_t apr_ino_t; #define APR_SIZEOF_VOIDP 4 #endif +#if APR_SIZEOF_VOIDP == 8 +typedef apr_uint64_t apr_uintptr_t; +#else +typedef apr_uint32_t apr_uintptr_t; +#endif + + /* XXX These simply don't belong here, perhaps in apr_portable.h * based on some APR_HAVE_PID/GID/UID? */ diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index 76076da34c4..9ead7b04e42 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -355,10 +355,10 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtSetTimerResolution, 0, ( typedef struct PBI { LONG ExitStatus; PVOID PebBaseAddress; - ULONG_PTR AffinityMask; + apr_uintptr_t AffinityMask; LONG BasePriority; - ULONG_PTR UniqueProcessId; - ULONG_PTR InheritedFromUniqueProcessId; + apr_uintptr_t UniqueProcessId; + apr_uintptr_t InheritedFromUniqueProcessId; } PBI, *PPBI; APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtQueryInformationProcess, 0, ( @@ -384,7 +384,7 @@ typedef struct IOSB { UINT Status; PVOID reserved; }; - ULONG_PTR Information; /* Varies by op, consumed buffer size for FSI below */ + apr_uintptr_t Information; /* Varies by op, consumed buffer size for FSI below */ } IOSB, *PIOSB; typedef struct FSI { From 463254dd15b2dced21c3dd0584bfa2d90f4b1113 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 2 May 2008 23:50:47 +0000 Subject: [PATCH 6164/7878] apr_getservbyname(): Use proper method for converting port to host byte order. PR 44903. Submitted by: Chris Taylor Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@652951 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ network_io/unix/sockaddr.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index deb213db70f..d5f05f6572d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 1.4.0 + *) apr_getservbyname(): Use proper method for converting port + to host byte order. PR 44903. + [Chris Taylor ] + *) Introduce apr_pollset_wakeup() for interrupting the blocking apr_pollset_poll call. [Mladen Turk] diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index e70e3bcb16c..ae5401adb07 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -711,7 +711,7 @@ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, return APR_EINVAL; if ((se = getservbyname(servname, NULL)) != NULL){ - sockaddr->port = htons(se->s_port); + sockaddr->port = ntohs(se->s_port); sockaddr->servname = apr_pstrdup(sockaddr->pool, servname); sockaddr->sa.sin.sin_port = se->s_port; return APR_SUCCESS; From ef721b568c0dbd87701dbdceafcea17d7e13c65f Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Sun, 4 May 2008 15:36:23 +0000 Subject: [PATCH 6165/7878] Fix typo in r649830 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@653232 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index f698e70fcdf..2feb2cccc10 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -370,8 +370,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, for (i = 0, j = 0; i < nget; i++) { fp = (((pfd_elem_t*)(pollset->port_set[i].portev_user))->pfd); if ((pollset->flags & APR_POLLSET_WAKEABLE) && - fd.desc_type == APR_POLL_FILE && - fd.desc.f == pollset->wakeup_pipe[0]) { + fp.desc_type == APR_POLL_FILE && + fp.desc.f == pollset->wakeup_pipe[0]) { drain_wakeup_pipe(pollset); rv = APR_EINTR; } From b67e5015f6e8e7172089609660d7cd84f4a07c4a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 4 May 2008 16:27:45 +0000 Subject: [PATCH 6166/7878] apr_getservbyname fix now in 1.3.x branch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@653245 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index d5f05f6572d..8ff398dd2c8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,10 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 1.4.0 - *) apr_getservbyname(): Use proper method for converting port - to host byte order. PR 44903. - [Chris Taylor ] - *) Introduce apr_pollset_wakeup() for interrupting the blocking apr_pollset_poll call. [Mladen Turk] @@ -15,6 +11,10 @@ Changes for APR 1.4.0 Changes for APR 1.3.0 + *) apr_getservbyname(): Use proper method for converting port + to host byte order. PR 44903. + [Chris Taylor ] + *) Support OS/X sendfile by using writev in lieu of hdtr vecs miscounted by the OS. [Geoff Greer ] From bdc68ab60ffb11c813938b01e79b58577e428166 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 6 May 2008 15:16:58 +0000 Subject: [PATCH 6167/7878] Reduce the point at which we use long filename manipulation to 248 characters, as "path names" are further constrained to 248 rather than MAX_PATH chars. Submitted by: Stefan git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@653805 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 3148a77a785..5735a4471dc 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -55,17 +55,20 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, apr_status_t rv; /* This is correct, we don't twist the filename if it is will - * definately be shorter than MAX_PATH. It merits some + * definately be shorter than 248 characters. It merits some * performance testing to see if this has any effect, but there * seem to be applications that get confused by the resulting * Unicode \\?\ style file names, especially if they use argv[0] * or call the Win32 API functions such as GetModuleName, etc. * Not every application is prepared to handle such names. + * + * Note also this is shorter than MAX_PATH, as directory paths + * are actually limited to 248 characters. * * Note that a utf-8 name can never result in more wide chars * than the original number of utf-8 narrow chars. */ - if (srcremains > MAX_PATH) { + if (srcremains > 248) { if (srcstr[1] == ':' && (srcstr[2] == '/' || srcstr[2] == '\\')) { wcscpy (retstr, L"\\\\?\\"); retlen -= 4; From a3d493a069eacd366122c1a0c791704256c378d9 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Tue, 6 May 2008 23:47:35 +0000 Subject: [PATCH 6168/7878] Fix poll failure on Solaris - PR 43000 Patch by Henry Jen git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@653953 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ poll/unix/port.c | 35 ++++++++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 8ff398dd2c8..abfdd4949c1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 1.4.0 + *) Fix Solaris poll failure. PR 43000 + [Henry Jen ] + *) Introduce apr_pollset_wakeup() for interrupting the blocking apr_pollset_poll call. [Mladen Turk] diff --git a/poll/unix/port.c b/poll/unix/port.c index 2feb2cccc10..a54d66ccdd4 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -15,6 +15,7 @@ */ #include "apr_arch_poll_private.h" +#include "apr_atomic.h" #ifdef POLLSET_USES_PORT @@ -82,6 +83,8 @@ struct apr_pollset_t /* A ring of pollfd_t where rings that have been _remove'd but might still be inside a _poll */ APR_RING_HEAD(pfd_dead_ring_t, pfd_elem_t) dead_ring; + /* number of threads in poll */ + volatile apr_uint32_t waiting; }; static apr_status_t backend_cleanup(void *p_) @@ -164,6 +167,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, /* Add room for wakeup descriptor */ size++; } + (*pollset)->waiting = 0; (*pollset)->nelts = 0; (*pollset)->nalloc = size; (*pollset)->flags = flags; @@ -230,16 +234,22 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, fd = descriptor->desc.f->filedes; } - res = port_associate(pollset->port_fd, PORT_SOURCE_FD, fd, - get_event(descriptor->reqevents), (void *)elem); + if (apr_atomic_read32(&pollset->waiting)) { + res = port_associate(pollset->port_fd, PORT_SOURCE_FD, fd, + get_event(descriptor->reqevents), (void *)elem); - if (res < 0) { - rv = APR_ENOMEM; - APR_RING_INSERT_TAIL(&(pollset->free_ring), elem, pfd_elem_t, link); - } + if (res < 0) { + rv = APR_ENOMEM; + APR_RING_INSERT_TAIL(&(pollset->free_ring), elem, pfd_elem_t, link); + } + else { + pollset->nelts++; + APR_RING_INSERT_TAIL(&(pollset->query_ring), elem, pfd_elem_t, link); + } + } else { pollset->nelts++; - APR_RING_INSERT_TAIL(&(pollset->query_ring), elem, pfd_elem_t, link); + APR_RING_INSERT_TAIL(&(pollset->add_ring), elem, pfd_elem_t, link); } pollset_unlock_rings(); @@ -254,6 +264,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, pfd_elem_t *ep; apr_status_t rv = APR_SUCCESS; int res; + int err; pollset_lock_rings(); @@ -267,6 +278,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, res = port_dissociate(pollset->port_fd, PORT_SOURCE_FD, fd); if (res < 0) { + err = errno; rv = APR_NOTFOUND; } @@ -280,6 +292,9 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, APR_RING_REMOVE(ep, link); APR_RING_INSERT_TAIL(&(pollset->dead_ring), ep, pfd_elem_t, link); + if (ENOENT == err) { + rv = APR_SUCCESS; + } break; } } @@ -331,6 +346,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); + apr_atomic_inc32(&pollset->waiting); + while (!APR_RING_EMPTY(&(pollset->add_ring), pfd_elem_t, link)) { ep = APR_RING_FIRST(&(pollset->add_ring)); APR_RING_REMOVE(ep, link); @@ -354,6 +371,9 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, ret = port_getn(pollset->port_fd, pollset->port_set, pollset->nalloc, &nget, tvptr); + /* decrease the waiting ASAP to reduce the window for calling + port_associate within apr_pollset_add() */ + apr_atomic_dec32(&pollset->waiting); (*num) = nget; if (ret == -1) { @@ -539,6 +559,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, if (rv) { return rv; } + rv = apr_pollcb_add(pollcb, pollfd); } } From d2f76ec2d375ed359903db8be366d70087828cd5 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Wed, 7 May 2008 08:58:47 +0000 Subject: [PATCH 6169/7878] Fix incomplete patch in r653953 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@654046 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/poll/unix/port.c b/poll/unix/port.c index a54d66ccdd4..ca4d7b28ed5 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -310,6 +310,9 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, APR_RING_REMOVE(ep, link); APR_RING_INSERT_TAIL(&(pollset->dead_ring), ep, pfd_elem_t, link); + if (ENOENT == err) { + rv = APR_SUCCESS; + } break; } } From 1fde6d1bf8c235b8233eabb8de80dde00a1e5078 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 7 May 2008 17:32:31 +0000 Subject: [PATCH 6170/7878] Make Darwin's sendfile() really work :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@654185 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- network_io/unix/sendrecv.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index abfdd4949c1..c8093bb9508 100644 --- a/CHANGES +++ b/CHANGES @@ -51,7 +51,7 @@ Changes for APR 1.3.0 allocation. [David Jones ] *) Implement Darwin-semantic (9.0.0 and later) sendfile support. - [William Rowe] + [William Rowe, Jim Jagielski] *) Implemented the APR_FOPEN_SPARSE flag, permits win32 to create sparse data files. Also bestow apr_fileinfo_t csize field for diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 2362b215e8a..ab7eba79c05 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -472,7 +472,6 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, if (errno == EAGAIN) { if (sock->timeout > 0) { sock->options |= APR_INCOMPLETE_WRITE; - rv = 0; } /* BSD's sendfile can return -1/EAGAIN even if it * sent bytes. Sanitize the result so we get normal EAGAIN From 7ab1e5ae33d9425d6d30a5f617771baa73a22aef Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 7 May 2008 20:05:21 +0000 Subject: [PATCH 6171/7878] combine all Darwin sendfile work as a "single" change git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@654245 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c8093bb9508..841a1ede910 100644 --- a/CHANGES +++ b/CHANGES @@ -51,7 +51,9 @@ Changes for APR 1.3.0 allocation. [David Jones ] *) Implement Darwin-semantic (9.0.0 and later) sendfile support. - [William Rowe, Jim Jagielski] + Use writev in lieu of hdtr vecs since how Darwin counts the + data is undocumented. [Geoff Greer , + William Rowe, Jim Jagielski] *) Implemented the APR_FOPEN_SPARSE flag, permits win32 to create sparse data files. Also bestow apr_fileinfo_t csize field for From 84c4e1cb11a62ac27475d31fb70f990d17e54120 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 7 May 2008 20:07:52 +0000 Subject: [PATCH 6172/7878] Oops... forgot to combine the CHANGES :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@654247 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 --- network_io/unix/sendrecv.c | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 841a1ede910..698fc23270e 100644 --- a/CHANGES +++ b/CHANGES @@ -18,9 +18,6 @@ Changes for APR 1.3.0 to host byte order. PR 44903. [Chris Taylor ] - *) Support OS/X sendfile by using writev in lieu of hdtr vecs - miscounted by the OS. [Geoff Greer ] - *) Introduce apr_pool_pre_cleanup_register() for registering a cleanup that is called before any subpool is destroyed within apr_pool_clear or apr_pool_destroy. diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index ab7eba79c05..a64e8211bb7 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -406,9 +406,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, #elif defined(DARWIN) /* OS/X Release 10.5 or greater */ -apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, - apr_hdtr_t * hdtr, apr_off_t * offset, - apr_size_t * len, apr_int32_t flags) +apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, + apr_size_t *len, apr_int32_t flags) { apr_off_t nbytes = 0; apr_off_t bytes_to_send = *len; @@ -468,6 +468,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, flags); /* undefined, set to 0 */ bytes_to_send -= nbytes; + (*offset) += nbytes; if (rv == -1) { if (errno == EAGAIN) { if (sock->timeout > 0) { From 2ca3273cd762a1ba7f49d06018e4abaebb12edcf Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 7 May 2008 20:13:52 +0000 Subject: [PATCH 6173/7878] this should not have been committed with the CHANGES patch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@654251 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index a64e8211bb7..79ec5c6e02b 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -468,7 +468,6 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, flags); /* undefined, set to 0 */ bytes_to_send -= nbytes; - (*offset) += nbytes; if (rv == -1) { if (errno == EAGAIN) { if (sock->timeout > 0) { From 227d607ca7fe07cee5008344eabd5db0c2b07a72 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 9 May 2008 12:47:14 +0000 Subject: [PATCH 6174/7878] Restructure Darwin's sendfile impl again. Instead of writev(), go ahead and use apr_socket_sendv(), which handles things much more cleanly, keeping the sendfile() stuff nicely contained. Yes, this is similar to how the Linux impl does it :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@654788 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 136 +++++++++++++++++++------------------ 1 file changed, 70 insertions(+), 66 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 79ec5c6e02b..8396e7de780 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -412,9 +412,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, { apr_off_t nbytes = 0; apr_off_t bytes_to_send = *len; - apr_size_t header_bytes_written = 0; + apr_off_t bytes_sent = 0; + apr_status_t arv; int rv = 0; - int sent_headers = 0; /* Ignore flags for now. */ flags = 0; @@ -425,8 +425,31 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, /* OS X can send the headers/footers as part of the system call, * but how it counts bytes isn't documented properly. We use - * writev() instead. + * apr_socket_sendv() instead. */ + if (hdtr->numheaders > 0) { + apr_size_t hbytes; + int i; + + /* Now write the headers */ + arv = apr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, + &hbytes); + if (arv != APR_SUCCESS) { + *len = 0; + return errno; + } + bytes_sent = hbytes; + + hbytes = 0; + for (i = 0; i < hdtr->numheaders; i++) { + hbytes += hdtr->headers[i].iov_len; + } + if (bytes_sent < hbytes) { + *len = bytes_sent; + return APR_SUCCESS; + } + } + do { if (sock->options & APR_INCOMPLETE_WRITE) { apr_status_t arv; @@ -438,72 +461,40 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } } - if (!sent_headers) { - if (hdtr->numheaders) { - rv = writev(sock->socketdes, - hdtr->headers, - hdtr->numheaders); - if (rv > 0) { - header_bytes_written = rv; - sent_headers = 1; - rv = 0; - } - } - else { - sent_headers = 1; - } - } - - if (bytes_to_send && sent_headers) { - /* We won't dare call sendfile() if we don't have - * header or file bytes to send because nbytes == 0 - * means send the remaining file to EOF. - */ - nbytes = bytes_to_send; - rv = sendfile(file->filedes, /* file to be sent */ - sock->socketdes, /* socket */ - *offset, /* where in the file to start */ - &nbytes, /* number of bytes to write/written */ - NULL, /* Headers/footers */ - flags); /* undefined, set to 0 */ - - bytes_to_send -= nbytes; - if (rv == -1) { - if (errno == EAGAIN) { - if (sock->timeout > 0) { - sock->options |= APR_INCOMPLETE_WRITE; - } - /* BSD's sendfile can return -1/EAGAIN even if it - * sent bytes. Sanitize the result so we get normal EAGAIN - * semantics w.r.t. bytes sent. - */ - else if (nbytes) { - /* normal exit for a big file & non-blocking io */ - (*len) = nbytes + header_bytes_written; - return APR_SUCCESS; - } + nbytes = bytes_to_send; + rv = sendfile(file->filedes, /* file to be sent */ + sock->socketdes, /* socket */ + *offset, /* where in the file to start */ + &nbytes, /* number of bytes to write/written */ + NULL, /* Headers/footers */ + flags); /* undefined, set to 0 */ + + bytes_sent += nbytes; + bytes_to_send -= nbytes; + (*offset) += nbytes; + if (rv == -1) { + if (errno == EAGAIN) { + if (sock->timeout > 0) { + sock->options |= APR_INCOMPLETE_WRITE; } - } - else { /* rv == 0 (or the kernel is broken) */ - if (nbytes == 0) { - /* Most likely the file got smaller after the stat. - * Return an error so the caller can do the Right Thing. - */ - (*len) = nbytes + header_bytes_written; - return APR_EOF; + /* BSD's sendfile can return -1/EAGAIN even if it + * sent bytes. Sanitize the result so we get normal EAGAIN + * semantics w.r.t. bytes sent. + */ + else if (nbytes) { + /* normal exit for a big file & non-blocking io */ + (*len) = bytes_sent; + return APR_SUCCESS; } } } - - if (sent_headers && !bytes_to_send) { - /* just trailer bytes... use writev() - */ - rv = writev(sock->socketdes, - hdtr->trailers, - hdtr->numtrailers); - if (rv > 0) { - nbytes += rv; - rv = 0; + else { /* rv == 0 (or the kernel is broken) */ + if (nbytes == 0) { + /* Most likely the file got smaller after the stat. + * Return an error so the caller can do the Right Thing. + */ + (*len) = bytes_sent; + return APR_EOF; } } @@ -512,7 +503,20 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } } while (rv == -1 && (errno == EINTR || errno == EAGAIN)); - (*len) = nbytes + header_bytes_written; + /* Now write the footers */ + if (hdtr->numtrailers > 0) { + apr_size_t tbytes; + arv = apr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, + &tbytes); + bytes_sent += tbytes; + if (arv != APR_SUCCESS) { + *len = bytes_sent; + rv = errno; + return rv; + } + } + + (*len) = bytes_sent; if (rv == -1) { return errno; } From ec977c39112b9a34225c3ab1b7ccf3ba70a36e4c Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Sat, 10 May 2008 18:52:28 +0000 Subject: [PATCH 6175/7878] silence warning about assignment expression git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@655138 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/select.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/select.c b/poll/unix/select.c index 142453fb34c..cf4a50692fa 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -520,7 +520,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, j++; } } - if ((*num) = j) + if (((*num) = j) != 0) rv = APR_SUCCESS; if (descriptors) From 1badd5f3a8878d650030d376f0818260086ad12e Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 14 May 2008 18:46:02 +0000 Subject: [PATCH 6176/7878] Bypass the call to sendfile if *len is 0. This means we just worry about the footers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@656355 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 8396e7de780..e3ac058c18b 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -451,6 +451,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } do { + if (!bytes_to_send) { + break; + } if (sock->options & APR_INCOMPLETE_WRITE) { apr_status_t arv; sock->options &= ~APR_INCOMPLETE_WRITE; From d3f0c55873225c2ef53f2c5df5e48c2d1089b426 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 15 May 2008 13:38:39 +0000 Subject: [PATCH 6177/7878] Darwin sendfile() cleanup. First, remove extra code. Secondly, don't update len and offset within this loop; we just want to check for errors and finally: When using a socket marked for non-blocking I/O, sendfile() may send fewer bytes than requested. In this case, the number of bytes successfully sent is returned in the via the len parameters and the error EAGAIN is returned. so when this happens, return with a success anytime we've sent data. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@656659 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index e3ac058c18b..ce6d0127611 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -472,9 +472,6 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, NULL, /* Headers/footers */ flags); /* undefined, set to 0 */ - bytes_sent += nbytes; - bytes_to_send -= nbytes; - (*offset) += nbytes; if (rv == -1) { if (errno == EAGAIN) { if (sock->timeout > 0) { @@ -484,7 +481,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, * sent bytes. Sanitize the result so we get normal EAGAIN * semantics w.r.t. bytes sent. */ - else if (nbytes) { + if (nbytes) { + bytes_sent += nbytes; /* normal exit for a big file & non-blocking io */ (*len) = bytes_sent; return APR_SUCCESS; @@ -492,6 +490,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } } else { /* rv == 0 (or the kernel is broken) */ + bytes_sent += nbytes; if (nbytes == 0) { /* Most likely the file got smaller after the stat. * Return an error so the caller can do the Right Thing. @@ -500,10 +499,6 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, return APR_EOF; } } - - if ((rv == -1) && (errno == EAGAIN) && (sock->timeout > 0)) { - sock->options |= APR_INCOMPLETE_WRITE; - } } while (rv == -1 && (errno == EINTR || errno == EAGAIN)); /* Now write the footers */ From 1e2b1ae108a2465a483c1b931317d5e38ba963b3 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sun, 18 May 2008 07:27:32 +0000 Subject: [PATCH 6178/7878] Trivial implementation of shm_remove for win32. If we have a backing file try to remove it instead returning APR_ENOTIMPL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@657500 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 7bce1331bbb..580421e33d2 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -175,7 +175,7 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, apr_pool_t *pool) { - return APR_ENOTIMPL; + return apr_file_remove(filename, pool); } APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, From afa6d0b0a3ac1bbaab8d1a1babcce4bf584aa23c Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Tue, 20 May 2008 05:40:36 +0000 Subject: [PATCH 6179/7878] Remove shm backed file on cleanup/remove for creator git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@658105 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ shmem/win32/shm.c | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 698fc23270e..912b275f6e2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 1.4.0 + *) Make sure WIN32 behaves the same as posix for file backed + shared memory by removing the file on cleanup/remove. + [Mladen Turk] + *) Fix Solaris poll failure. PR 43000 [Henry Jen ] diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 580421e33d2..da736aa625c 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -18,6 +18,7 @@ #include "apr_errno.h" #include "apr_file_io.h" #include "apr_shm.h" +#include "apr_strings.h" #include "apr_arch_file_io.h" #include "limits.h" @@ -33,6 +34,7 @@ struct apr_shm_t { apr_size_t size; apr_size_t length; HANDLE hMap; + const char *filename; }; static apr_status_t shm_cleanup(void* shm) @@ -44,11 +46,13 @@ static apr_status_t shm_cleanup(void* shm) rv = apr_get_os_error(); } if (!CloseHandle(m->hMap)) { - return (rv != APR_SUCCESS) ? rv : apr_get_os_error(); + rv = rv != APR_SUCCESS ? rv : apr_get_os_error(); + } + if (m->filename) { + /* Remove file if file backed */ + apr_status_t rc = apr_file_remove(m->filename, m->pool); + rv = rv != APR_SUCCESS ? rv : rc; } - /* ### Do we want to make a point of unlinking m->file here? - * Need to add the fname to the apr_shm_t, in that case. - */ return rv; } @@ -159,6 +163,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, (*m)->memblk->length = (*m)->length; (*m)->memblk->size = (*m)->size; + (*m)->filename = file ? apr_pstrdup(pool, file) : NULL; apr_pool_cleanup_register((*m)->pool, *m, shm_cleanup, apr_pool_cleanup_null); @@ -252,6 +257,8 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, (*m)->hMap = hMap; (*m)->length = (*m)->memblk->length; (*m)->usrmem = (char*)base + sizeof(memblock_t); + (*m)->filename = NULL; + apr_pool_cleanup_register((*m)->pool, *m, shm_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; @@ -301,6 +308,7 @@ APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **m, /* Real (*m)->mem->size could be recovered with VirtualQuery */ (*m)->size = (*m)->memblk->size; (*m)->length = (*m)->memblk->length; + (*m)->filename = NULL; apr_pool_cleanup_register((*m)->pool, *m, shm_cleanup, apr_pool_cleanup_null); From 47077f9a6ef68d943d0726807b02bd5147ceccb4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 21 May 2008 11:32:04 +0000 Subject: [PATCH 6180/7878] Add APR_DSOPATH for walking library path locations git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@658631 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 2 ++ include/apr.hnw | 2 ++ include/apr.hw | 2 ++ test/Makefile.in | 2 ++ 4 files changed, 8 insertions(+) diff --git a/include/apr.h.in b/include/apr.h.in index 50e6880542f..8a7d7c2cd92 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -495,6 +495,8 @@ typedef int gid_t; #error no decision has been made on APR_PATH_MAX for your platform #endif +#define APR_DSOPATH "@shlibpath_var@" + /** @} */ /** @} */ diff --git a/include/apr.hnw b/include/apr.hnw index f25509d38da..2b2d091e92f 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -423,6 +423,8 @@ typedef int apr_wait_t; #define APR_PATH_MAX PATH_MAX +#define APR_DSOPATH "PATH" + #define APR_INT64_T_FMT "lld" #define APR_UINT64_T_FMT "llu" #define APR_UINT64_T_HEX_FMT "llx" diff --git a/include/apr.hw b/include/apr.hw index 4aeca41bec2..af14f421674 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -583,6 +583,8 @@ typedef int apr_wait_t; #define APR_PATH_MAX MAX_PATH #endif +#define APR_DSOPATH "PATH" + /** @} */ #ifdef __cplusplus diff --git a/test/Makefile.in b/test/Makefile.in index b3710742cae..7e6ff6e35ea 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -159,6 +159,8 @@ tryread@EXEEXT@: $(OBJECTS_tryread) $(LINK_PROG) $(OBJECTS_tryread) $(ALL_LIBS) check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) + @shlibpath_var@=../.libs:$$(@shlibpath_var@);\ + export @shlibpath_var@ teststatus=0; \ progfailed=""; \ for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \ From a2b024ff69e71abfc952a9eab58ff307d2ee8b2d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 21 May 2008 11:34:33 +0000 Subject: [PATCH 6181/7878] Revert unintentional r658631 change to Makefile.in git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@658632 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 7e6ff6e35ea..b3710742cae 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -159,8 +159,6 @@ tryread@EXEEXT@: $(OBJECTS_tryread) $(LINK_PROG) $(OBJECTS_tryread) $(ALL_LIBS) check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) - @shlibpath_var@=../.libs:$$(@shlibpath_var@);\ - export @shlibpath_var@ teststatus=0; \ progfailed=""; \ for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \ From 4d1746c103c829cc5889da8803b5da6bb9d1de5b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 22 May 2008 22:32:01 +0000 Subject: [PATCH 6182/7878] Remove apr_ssl schema from apr altogether; this belongs in apr_util if ever restored. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@659285 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index bc253e6b083..f34e8d98b35 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -245,10 +245,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * APR_EBADIP The specified IP address is invalid * APR_EBADMASK The specified netmask is invalid * APR_ESYMNOTFOUND Could not find the requested symbol - * APR_ENOCIPHER Could not find the cipher specified - * APR_ENODIGEST Could not find the digest specified - * APR_ENOCERT Could not find the certificate specified - * APR_ENOENGINE Could not find the engine specified + * APR_ENOTENOUGHENTROPY Not enough entropy to continue *
    * *
    @@ -339,14 +336,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #define APR_EPROC_UNKNOWN  (APR_OS_START_ERROR + 27)
     /** @see APR_STATUS_IS_ENOTENOUGHENTROPY */
     #define APR_ENOTENOUGHENTROPY (APR_OS_START_ERROR + 28)
    -/** @see APR_STATUS_IS_ENOCIPHER */
    -#define APR_ENOCIPHER      (APR_OS_START_ERROR + 29)
    -/** @see APR_STATUS_IS_ENODIGEST */
    -#define APR_ENODIGEST      (APR_OS_START_ERROR + 30)
    -/** @see APR_STATUS_IS_ENOCERT */
    -#define APR_ENOCERT        (APR_OS_START_ERROR + 31)
    -/** @see APR_STATUS_IS_ENOENGINE */
    -#define APR_ENOENGINE      (APR_OS_START_ERROR + 32)
     /** @} */
     
     /** 
    @@ -434,17 +423,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
     #endif
     /** The given process was not recognized by APR. */
     #define APR_STATUS_IS_EPROC_UNKNOWN(s)  ((s) == APR_EPROC_UNKNOWN)
    -
     /** APR could not gather enough entropy to continue. */
     #define APR_STATUS_IS_ENOTENOUGHENTROPY(s) ((s) == APR_ENOTENOUGHENTROPY)
    -/** APR not find the cipher specified. */
    -#define APR_STATUS_IS_ENOCIPHER(s)      ((s) == APR_ENOCIPHER)
    -/** APR not find the digest specified. */
    -#define APR_STATUS_IS_ENODIGEST(s)      ((s) == APR_ENODIGEST)
    -/** APR not find the certificate specified. */
    -#define APR_STATUS_IS_ENOCERT(s)        ((s) == APR_ENOCERT)
    -/** APR not find the engine specified. */
    -#define APR_STATUS_IS_ENOENGINE(s)      ((s) == APR_ENOENGINE)
     
     /** @} */
     
    
    From e51810f0a25b940be555b9454d0fb499e2e0a793 Mon Sep 17 00:00:00 2001
    From: Bojan Smojver 
    Date: Tue, 27 May 2008 04:49:03 +0000
    Subject: [PATCH 6183/7878] Silence GCC 4.3 warning (patch by jorton).
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@660373 13f79535-47bb-0310-9956-ffa450edef68
    ---
     strings/apr_snprintf.c | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c
    index bf3f58537f0..0131007996e 100644
    --- a/strings/apr_snprintf.c
    +++ b/strings/apr_snprintf.c
    @@ -54,7 +54,8 @@ typedef enum {
     #endif
     #define NUL '\0'
     
    -#define S_NULL "(null)"
    +static const char null_string[] = "(null)";
    +#define S_NULL ((char *)null_string)
     #define S_NULL_LEN 6
     
     #define FLOAT_DIGITS 6
    
    From c05781cd4dee5a0195540d5bcf95804e083f5a54 Mon Sep 17 00:00:00 2001
    From: Bojan Smojver 
    Date: Tue, 27 May 2008 06:54:10 +0000
    Subject: [PATCH 6184/7878] Fix PR44971. Return APR_ENOENT if we cannot find
     service, errno is undefined.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@660405 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sockaddr.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
    index ae5401adb07..31a0eb5be82 100644
    --- a/network_io/unix/sockaddr.c
    +++ b/network_io/unix/sockaddr.c
    @@ -716,7 +716,7 @@ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr,
             sockaddr->sa.sin.sin_port = se->s_port;
             return APR_SUCCESS;
         }
    -    return errno;
    +    return APR_ENOENT;
     }
     
     #define V4MAPPED_EQUAL(a,b)                                   \
    
    From f26ca470893770b18c4899f8cdb821ada3b381a7 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 28 May 2008 17:15:34 +0000
    Subject: [PATCH 6185/7878] Correct license statements to the ASF labeling
     policy.  Note major parts of all of apr are already Copyright Ryan Bloom;
     this is captured in the commit history.  However this statement is no longer
     complete as the code has been modified by other committers, the generic
     statement is more appropiate.
    
    If there is a canonical home for abts, this instead should be noted in
    these source files.  I'm not aware Ryan is maintaining one, apparently
    http://rkbloom.net/os.html is the homepage, but the links are broken.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@661023 13f79535-47bb-0310-9956-ffa450edef68
    ---
     libapr.rc   | 27 ++++++++++++++-------------
     test/abts.c | 14 ++++++--------
     test/abts.h | 11 ++++++-----
     3 files changed, 26 insertions(+), 26 deletions(-)
    
    diff --git a/libapr.rc b/libapr.rc
    index 925868d1e51..cd249b97dc3 100644
    --- a/libapr.rc
    +++ b/libapr.rc
    @@ -1,20 +1,21 @@
     #include "apr_version.h"
     
    -#define APR_COPYRIGHT "Copyright 2000-2005 The Apache Software " \
    +#define APR_COPYRIGHT "Copyright (c) 2008 The Apache Software " \
                           "Foundation or its licensors, as applicable."
     
    -#define APR_LICENSE "Licensed under the Apache License, Version 2.0 " \
    -                    "(the ""License""); you may not use this file except " \
    -                    "in compliance with the License.  You may obtain a " \
    -                    "copy of the License at\r\n\r\n" \
    -                    "http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n" \
    -                    "Unless required by applicable law or agreed to in " \
    -                    "writing, software distributed under the License is " \
    -                    "distributed on an ""AS IS"" BASIS, WITHOUT " \
    -                    "WARRANTIES OR CONDITIONS OF ANY KIND, either " \
    -                    "express or implied.  See the License for the " \
    -                    "specific language governing permissions and " \
    -                    "limitations under the License."
    +#define APR_LICENSE \
    +  "Licensed to the Apache Software Foundation (ASF) under one or more " \
    +  "contributor license agreements.  See the NOTICE file distributed with " \
    +  "this work for additional information regarding copyright ownership.  " \
    +  "The ASF licenses this file to You under the Apache License, Version 2.0 " \
    +  "(the ""License""); you may not use this file except in compliance with " \
    +  "the License.  You may obtain a copy of the License at\r\n\r\n" \
    +  "http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n" \
    +  "Unless required by applicable law or agreed to in writing, software " \
    +  "distributed under the License is distributed on an ""AS IS"" BASIS, " \
    +  "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  " \
    +  "See the License for the specific language governing permissions and " \
    +  "limitations under the License."
     
     #define APR_DLL_BASENAME "libapr-" APR_STRINGIFY(APR_MAJOR_VERSION)
     
    diff --git a/test/abts.c b/test/abts.c
    index d8cb2c9da16..d23eefa9090 100644
    --- a/test/abts.c
    +++ b/test/abts.c
    @@ -1,8 +1,9 @@
    -/* Copyright 2000-2004 Ryan Bloom
    - *
    - * Licensed under the Apache License, Version 2.0 (the "License");
    - * you may not use this file except in compliance with the License.
    - * You may obtain a copy of the License at
    +/* Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
      *
      *     http://www.apache.org/licenses/LICENSE-2.0
      *
    @@ -11,9 +12,6 @@
      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      * See the License for the specific language governing permissions and
      * limitations under the License.
    - *
    - * Portions of this file were taken from testall.c in the APR test suite,
    - * written by members of the Apache Software Foundation.
      */
     
     #include "abts.h"
    diff --git a/test/abts.h b/test/abts.h
    index 4d6470ae3f0..7385ca95728 100644
    --- a/test/abts.h
    +++ b/test/abts.h
    @@ -1,8 +1,9 @@
    -/* Copyright 2000-2004 Ryan Bloom
    - *
    - * Licensed under the Apache License, Version 2.0 (the "License");
    - * you may not use this file except in compliance with the License.
    - * You may obtain a copy of the License at
    +/* Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
      *
      *     http://www.apache.org/licenses/LICENSE-2.0
      *
    
    From a2dd2a0bde0d7ac899f44ad80863a69d27349dc9 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Wed, 28 May 2008 19:23:11 +0000
    Subject: [PATCH 6186/7878] Correct license statements to the ASF labeling
     policy.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@661057 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/win32ver.awk | 21 ++++++++++++---------
     1 file changed, 12 insertions(+), 9 deletions(-)
    
    diff --git a/build/win32ver.awk b/build/win32ver.awk
    index 2cd31eba948..11be08072d0 100644
    --- a/build/win32ver.awk
    +++ b/build/win32ver.awk
    @@ -88,15 +88,18 @@ BEGIN {
       print "    BLOCK \"040904b0\"";
       print "    BEGIN";
       print "    VALUE \"Comments\", "\
    -     "\"Licensed under the Apache License, Version 2.0 (the \"\"License\"\"); "\
    -     "you may not use this file except in compliance with the License.  "\
    -     "You may obtain a copy of the License at\\r\\n\\r\\n"\
    -     "http://www.apache.org/licenses/LICENSE-2.0\\r\\n\\r\\n"\
    -     "Unless required by applicable law or agreed to in writing, "\
    -     "software distributed under the License is distributed on an "\
    -     "\"\"AS IS\"\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, "\
    -     "either express or implied.  See the License for the specific "\
    -     "language governing permissions and limitations under the License.\\0\"";
    +  "\"Licensed to the Apache Software Foundation (ASF) under one or more " \
    +  "contributor license agreements.  See the NOTICE file distributed with " \
    +  "this work for additional information regarding copyright ownership.  " \
    +  "The ASF licenses this file to You under the Apache License, Version 2.0 " \
    +  "(the \"\"License\"\"); you may not use this file except in compliance " \
    +  "with the License.  You may obtain a copy of the License at\\r\\n\\r\\n" \
    +  "http://www.apache.org/licenses/LICENSE-2.0\\r\\n\\r\\n" \
    +  "Unless required by applicable law or agreed to in writing, software " \
    +  "distributed under the License is distributed on an \"\"AS IS\"\" BASIS, " \
    +  "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  " \
    +  "See the License for the specific language governing permissions and " \
    +  "limitations under the License.\\0\"";
       print "      VALUE \"CompanyName\", \"Apache Software Foundation\\0\"";
       print "      VALUE \"FileDescription\", \"" desc "\\0\"";
       print "      VALUE \"FileVersion\", \"" ver "\\0\"";
    
    From b9c58fd427237ff1085f44ba1d64b6eb5d1d6e53 Mon Sep 17 00:00:00 2001
    From: Bojan Smojver 
    Date: Wed, 28 May 2008 23:33:00 +0000
    Subject: [PATCH 6187/7878] If the named resource was removed by
     apr_shm_remove(), it may not be there.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@661146 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/unix/apr_arch_shm.h |  3 +++
     shmem/unix/shm.c                 | 14 ++++++++++++--
     2 files changed, 15 insertions(+), 2 deletions(-)
    
    diff --git a/include/arch/unix/apr_arch_shm.h b/include/arch/unix/apr_arch_shm.h
    index dbd9b9bc5c4..bbd373e3632 100644
    --- a/include/arch/unix/apr_arch_shm.h
    +++ b/include/arch/unix/apr_arch_shm.h
    @@ -27,6 +27,9 @@
     #include "apr_network_io.h"
     #include "apr_portable.h"
     
    +#if APR_HAVE_UNISTD_H
    +#include 
    +#endif
     #ifdef HAVE_SYS_MMAN_H
     #include 
     #endif
    diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c
    index 95d1c053f0e..134807de545 100644
    --- a/shmem/unix/shm.c
    +++ b/shmem/unix/shm.c
    @@ -49,7 +49,12 @@ static apr_status_t shm_cleanup_owner(void *m_)
             if (munmap(m->base, m->realsize) == -1) {
                 return errno;
             }
    -        return apr_file_remove(m->filename, m->pool);
    +        if (access(m->filename, F_OK)) {
    +            return APR_SUCCESS;
    +        }
    +        else {
    +            return apr_file_remove(m->filename, m->pool);
    +        }
     #endif
     #if APR_USE_SHMEM_MMAP_SHM
             if (munmap(m->base, m->realsize) == -1) {
    @@ -70,7 +75,12 @@ static apr_status_t shm_cleanup_owner(void *m_)
             if (shmdt(m->base) == -1) {
                 return errno;
             }
    -        return apr_file_remove(m->filename, m->pool);
    +        if (access(m->filename, F_OK)) {
    +            return APR_SUCCESS;
    +        }
    +        else {
    +            return apr_file_remove(m->filename, m->pool);
    +        }
     #endif
         }
     
    
    From 801772b624723409e5366ccd9108900404c47698 Mon Sep 17 00:00:00 2001
    From: Bojan Smojver 
    Date: Thu, 29 May 2008 00:05:35 +0000
    Subject: [PATCH 6188/7878] If -Wall is turned on, result of compile tests may
     be altered. Use the variable to avoid warnings. Trivial style fixes.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@661159 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_hints.m4   | 24 ++++++++++++------------
     build/apr_network.m4 |  8 ++++++--
     2 files changed, 18 insertions(+), 14 deletions(-)
    
    diff --git a/build/apr_hints.m4 b/build/apr_hints.m4
    index d8dc3cf5f2b..66837b63a47 100644
    --- a/build/apr_hints.m4
    +++ b/build/apr_hints.m4
    @@ -415,19 +415,19 @@ dnl	       # Not a problem in 10.20.  Otherwise, who knows?
     	APR_ADDTO(CPPFLAGS, [-D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED=1])
     	;;
         *-ibm-os390)
    -       APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE])
    -       APR_SETIFNULL(apr_sysvsem_is_global, [yes])
    -       APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
    -       APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
    -       AC_DEFINE(HAVE_ZOS_PTHREADS, 1, [Define for z/OS pthread API nuances])
    -       APR_ADDTO(CPPFLAGS, [-U_NO_PROTO -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1])
    -       ;;
    +        APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE])
    +        APR_SETIFNULL(apr_sysvsem_is_global, [yes])
    +        APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
    +        APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
    +        AC_DEFINE(HAVE_ZOS_PTHREADS, 1, [Define for z/OS pthread API nuances])
    +        APR_ADDTO(CPPFLAGS, [-U_NO_PROTO -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1])
    +        ;;
         *-ibm-as400)
    -       APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE])
    -       APR_SETIFNULL(apr_process_lock_is_global, [yes])
    -       APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
    -       APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
    -       ;;
    +        APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE])
    +        APR_SETIFNULL(apr_process_lock_is_global, [yes])
    +        APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
    +        APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
    +        ;;
         *cygwin*)
     	APR_ADDTO(CPPFLAGS, [-DCYGWIN])
     	;;
    diff --git a/build/apr_network.m4 b/build/apr_network.m4
    index dbef435d4ea..192fcd817e5 100644
    --- a/build/apr_network.m4
    +++ b/build/apr_network.m4
    @@ -244,6 +244,8 @@ APR_TRY_COMPILE_NO_WARNING([
     ],[
     int tmp = gethostbyname_r((const char *) 0, (struct hostent *) 0, 
                               (char *) 0, 0, (struct hostent **) 0, &tmp);
    +/* use tmp to suppress the warning */
    +tmp=0;
     ], ac_cv_gethostbyname_r_style=glibc2, ac_cv_gethostbyname_r_style=none))
     
     if test "$ac_cv_gethostbyname_r_style" = "glibc2"; then
    @@ -269,8 +271,10 @@ APR_TRY_COMPILE_NO_WARNING([
     #endif
     ],[
     int tmp = gethostbyname_r((const char *) 0, (struct hostent *) 0, 
    -                          (struct hostent_data *) 0);],
    -ac_cv_gethostbyname_r_arg=hostent_data, ac_cv_gethostbyname_r_arg=char))
    +                          (struct hostent_data *) 0);
    +/* use tmp to suppress the warning */
    +tmp=0;
    +], ac_cv_gethostbyname_r_arg=hostent_data, ac_cv_gethostbyname_r_arg=char))
     
     if test "$ac_cv_gethostbyname_r_arg" = "hostent_data"; then
         AC_DEFINE(GETHOSTBYNAME_R_HOSTENT_DATA, 1, [Define if gethostbyname_r has the hostent_data for the third argument])
    
    From 594f4289b5fd246cf2e8d73c9e79cbceb4723e27 Mon Sep 17 00:00:00 2001
    From: Bojan Smojver 
    Date: Thu, 29 May 2008 01:57:16 +0000
    Subject: [PATCH 6189/7878] Fix PR44367. Caveats: - no idea if IBM's
     proprietary OSes actually have thread-safe   version of getservbyname()
     function, just assumed that by looking at   other similar functions being
     marked safe in APR detection code - works on Linux (Fedora 9, i.e. glibc2)
    
    Use thread safe versions of getservbyname().
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@661178 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_hints.m4         |  3 ++
     build/apr_network.m4       | 97 ++++++++++++++++++++++++++++++++++++++
     configure.in               | 15 +++++-
     network_io/unix/sockaddr.c | 46 ++++++++++++++++++
     4 files changed, 160 insertions(+), 1 deletion(-)
    
    diff --git a/build/apr_hints.m4 b/build/apr_hints.m4
    index 66837b63a47..626e22e37bb 100644
    --- a/build/apr_hints.m4
    +++ b/build/apr_hints.m4
    @@ -97,6 +97,7 @@ if test "x$apr_preload_done" != "xyes" ; then
     	APR_SETVAR(SHELL, [sh])
     	APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
     	APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
    +	APR_SETIFNULL(apr_getservbyname_is_thread_safe, [yes])
     	;;
         *-hi-hiux)
     	APR_ADDTO(CPPFLAGS, [-DHIUX])
    @@ -419,6 +420,7 @@ dnl	       # Not a problem in 10.20.  Otherwise, who knows?
             APR_SETIFNULL(apr_sysvsem_is_global, [yes])
             APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
             APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
    +        APR_SETIFNULL(apr_getservbyname_is_thread_safe, [yes])
             AC_DEFINE(HAVE_ZOS_PTHREADS, 1, [Define for z/OS pthread API nuances])
             APR_ADDTO(CPPFLAGS, [-U_NO_PROTO -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1])
             ;;
    @@ -427,6 +429,7 @@ dnl	       # Not a problem in 10.20.  Otherwise, who knows?
             APR_SETIFNULL(apr_process_lock_is_global, [yes])
             APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
             APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
    +        APR_SETIFNULL(apr_getservbyname_is_thread_safe, [yes])
             ;;
         *cygwin*)
     	APR_ADDTO(CPPFLAGS, [-DCYGWIN])
    diff --git a/build/apr_network.m4 b/build/apr_network.m4
    index 192fcd817e5..e864d871248 100644
    --- a/build/apr_network.m4
    +++ b/build/apr_network.m4
    @@ -281,6 +281,103 @@ if test "$ac_cv_gethostbyname_r_arg" = "hostent_data"; then
     fi
     ])
     
    +dnl
    +dnl Checks the definition of getservbyname_r
    +dnl which are different for glibc, solaris and assorted other operating
    +dnl systems
    +dnl
    +dnl Note that this test is executed too early to see if we have all of
    +dnl the headers.
    +AC_DEFUN([APR_CHECK_GETSERVBYNAME_R_STYLE], [
    +
    +dnl Try and compile a glibc2 getservbyname_r piece of code, and set the
    +dnl style of the routines to glibc2 on success
    +AC_CACHE_CHECK([style of getservbyname_r routine], ac_cv_getservbyname_r_style,
    +APR_TRY_COMPILE_NO_WARNING([
    +#ifdef HAVE_SYS_TYPES_H
    +#include 
    +#endif
    +#ifdef HAVE_NETINET_IN_H
    +#include 
    +#endif
    +#ifdef HAVE_ARPA_INET_H
    +#include 
    +#endif
    +#ifdef HAVE_NETDB_H
    +#include 
    +#endif
    +#ifdef HAVE_STDLIB_H
    +#include 
    +#endif
    +],[
    +int tmp = getservbyname_r((const char *) 0, (const char *) 0,
    +                          (struct servent *) 0, (char *) 0, 0,
    +                          (struct servent **) 0);
    +/* use tmp to suppress the warning */
    +tmp=0;
    +], ac_cv_getservbyname_r_style=glibc2, [
    +
    +dnl Try and compile a Solaris getservbyname_r piece of code, and set the
    +dnl style of the routines to solaris on success
    +AC_CACHE_VAL(ac_cv_getservbyname_r_style,
    +APR_TRY_COMPILE_NO_WARNING([
    +#ifdef HAVE_SYS_TYPES_H
    +#include 
    +#endif
    +#ifdef HAVE_NETINET_IN_H
    +#include 
    +#endif
    +#ifdef HAVE_ARPA_INET_H
    +#include 
    +#endif
    +#ifdef HAVE_NETDB_H
    +#include 
    +#endif
    +#ifdef HAVE_STDLIB_H
    +#include 
    +#endif
    +],[
    +struct servent tmp = getservbyname_r((const char *) 0, (const char *) 0,
    +                                     (struct servent *) 0, (char *) 0, 0);
    +/* use tmp to suppress the warning */
    +tmp=NULL;
    +], ac_cv_getservbyname_r_style=solaris, [
    +
    +dnl Try and compile a OSF/1 getservbyname_r piece of code, and set the
    +dnl style of the routines to osf1 on success
    +AC_CACHE_VAL( ac_cv_getservbyname_r_style,
    +APR_TRY_COMPILE_NO_WARNING([
    +#ifdef HAVE_SYS_TYPES_H
    +#include 
    +#endif
    +#ifdef HAVE_NETINET_IN_H
    +#include 
    +#endif
    +#ifdef HAVE_ARPA_INET_H
    +#include 
    +#endif
    +#ifdef HAVE_NETDB_H
    +#include 
    +#endif
    +#ifdef HAVE_STDLIB_H
    +#include 
    +#endif
    +],[
    +int tmp = getservbyname_r((const char *) 0, (const char *) 0,
    +                          (struct servent *) 0, (struct servent_data *) 0);
    +/* use tmp to suppress the warning */
    +tmp=0;
    +], ac_cv_getservbyname_r_style=osf1, ac_cv_getservbyname_r_style=none))]))]))
    +
    +if test "$ac_cv_getservbyname_r_style" = "glibc2"; then
    +    AC_DEFINE(GETSERVBYNAME_R_GLIBC2, 1, [Define if getservbyname_r has the glibc style])
    +elif test "$ac_cv_getservbyname_r_style" = "solaris"; then
    +    AC_DEFINE(GETSERVBYNAME_R_SOLARIS, 1, [Define if getservbyname_r has the Solaris style])
    +elif test "$ac_cv_getservbyname_r_style" = "osf1"; then
    +    AC_DEFINE(GETSERVBYNAME_R_OSF1, 1, [Define if getservbyname_r has the OSF/1 style])
    +fi
    +])
    +
     dnl
     dnl see if TCP_NODELAY setting is inherited from listening sockets
     dnl
    diff --git a/configure.in b/configure.in
    index 746a12ca107..db60a31fc40 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -684,6 +684,7 @@ fi
     ac_cv_define_READDIR_IS_THREAD_SAFE=no
     ac_cv_define_GETHOSTBYNAME_IS_THREAD_SAFE=no
     ac_cv_define_GETHOSTBYADDR_IS_THREAD_SAFE=no
    +ac_cv_define_GETSERVBYNAME_IS_THREAD_SAFE=no
     if test "$threads" = "1"; then
         echo "APR will use threads"
         AC_CHECK_LIB(c_r, readdir,
    @@ -703,7 +704,14 @@ if test "$threads" = "1"; then
             AC_DEFINE(GETHOSTBYADDR_IS_THREAD_SAFE, 1, 
                       [Define if gethostbyaddr is thread safe])
         fi
    -    AC_CHECK_FUNCS(gethostbyname_r gethostbyaddr_r)
    +    if test "x$apr_getservbyname_is_thread_safe" = "x"; then
    +        AC_CHECK_LIB(c_r, getservbyname, apr_getservbyname_is_thread_safe=yes)
    +    fi
    +    if test "$apr_getservbyname_is_thread_safe" = "yes"; then
    +        AC_DEFINE(GETSERVBYNAME_IS_THREAD_SAFE, 1, 
    +                  [Define if getservbyname is thread safe])
    +    fi
    +    AC_CHECK_FUNCS(gethostbyname_r gethostbyaddr_r getservbyname_r)
     else
         echo "APR will be non-threaded"
     fi
    @@ -2131,6 +2139,11 @@ if test "$ac_cv_func_gethostbyname_r" = "yes"; then
         APR_CHECK_GETHOSTBYNAME_R_STYLE
     fi
     
    +# Check the types only if we have getservbyname_r
    +if test "$ac_cv_func_getservbyname_r" = "yes"; then
    +    APR_CHECK_GETSERVBYNAME_R_STYLE
    +fi
    +
     APR_CHECK_TCP_NODELAY_INHERITED
     APR_CHECK_O_NONBLOCK_INHERITED
     APR_CHECK_TCP_NODELAY_WITH_CORK
    diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
    index 31a0eb5be82..4e79f893423 100644
    --- a/network_io/unix/sockaddr.c
    +++ b/network_io/unix/sockaddr.c
    @@ -705,17 +705,63 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname,
     APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr,
                                                 const char *servname)
     {
    +#if APR_HAS_THREADS && !defined(GETSERVBYNAME_IS_THREAD_SAFE) && \
    +    defined(HAVE_GETSERVBYNAME_R) && \
    +    (defined(GETSERVBYNAME_R_GLIBC2) || defined(GETSERVBYNAME_R_SOLARIS) || \
    +     defined(GETSERVBYNAME_R_OSF1))
    +    struct servent se;
    +#if defined(GETSERVBYNAME_R_OSF1)
    +    struct servent_data sed;
    +
    +    memset(&sed, 0, sizeof(sed)); /* must zero fill before use */
    +#else
    +#if defined(GETSERVBYNAME_R_GLIBC2)
    +    struct servent *res;
    +#endif
    +    char buf[1024];
    +#endif
    +#else
         struct servent *se;
    +#endif
     
         if (servname == NULL)
             return APR_EINVAL;
     
    +#if APR_HAS_THREADS && !defined(GETSERVBYNAME_IS_THREAD_SAFE) && \
    +    defined(HAVE_GETSERVBYNAME_R) && \
    +    (defined(GETSERVBYNAME_R_GLIBC2) || defined(GETSERVBYNAME_R_SOLARIS) || \
    +     defined(GETSERVBYNAME_R_OSF1))
    +#if defined(GETSERVBYNAME_R_GLIBC2)
    +    if (getservbyname_r(servname, NULL,
    +                        &se, buf, sizeof(buf), &res) == 0 && res != NULL) {
    +        sockaddr->port = ntohs(res->s_port);
    +        sockaddr->servname = apr_pstrdup(sockaddr->pool, servname);
    +        sockaddr->sa.sin.sin_port = res->s_port;
    +        return APR_SUCCESS;
    +    }
    +#elif defined(GETSERVBYNAME_R_SOLARIS)
    +    if (getservbyname_r(servname, NULL, &se, buf, sizeof(buf)) != NULL) {
    +        sockaddr->port = ntohs(se.s_port);
    +        sockaddr->servname = apr_pstrdup(sockaddr->pool, servname);
    +        sockaddr->sa.sin.sin_port = se.s_port;
    +        return APR_SUCCESS;
    +    }
    +#elif defined(GETSERVBYNAME_R_OSF1)
    +    if (getservbyname_r(servname, NULL, &se, &sed) == 0) {
    +        sockaddr->port = ntohs(se.s_port);
    +        sockaddr->servname = apr_pstrdup(sockaddr->pool, servname);
    +        sockaddr->sa.sin.sin_port = se.s_port;
    +        return APR_SUCCESS;
    +    }
    +#endif
    +#else
         if ((se = getservbyname(servname, NULL)) != NULL){
             sockaddr->port = ntohs(se->s_port);
             sockaddr->servname = apr_pstrdup(sockaddr->pool, servname);
             sockaddr->sa.sin.sin_port = se->s_port;
             return APR_SUCCESS;
         }
    +#endif
         return APR_ENOENT;
     }
     
    
    From f8eb0943bae40c5636cdf0ea78759692a4fcf27b Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 29 May 2008 15:46:56 +0000
    Subject: [PATCH 6190/7878] Respect the cardinal rule that non-apr stuff needs
     to be outside of the apr doxygen blocks.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@661368 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr.h.in | 23 ++++++++++++++---------
     1 file changed, 14 insertions(+), 9 deletions(-)
    
    diff --git a/include/apr.h.in b/include/apr.h.in
    index 8a7d7c2cd92..9f1fb6f9994 100644
    --- a/include/apr.h.in
    +++ b/include/apr.h.in
    @@ -108,6 +108,7 @@
     #define APR_HAVE_WINDOWS_H       @windowsh@
     #define APR_HAVE_WINSOCK2_H      @winsock2h@
     
    +/** @} */
     /** @} */
     
     /* We don't include our conditional headers within the doxyblocks 
    @@ -467,7 +468,6 @@ typedef  apr_uint32_t            apr_uintptr_t;
     /* Local machine definition for console and log output. */
     #define APR_EOL_STR              "@eolstr@"
     
    -
     #if APR_HAVE_SYS_WAIT_H
     #ifdef WEXITSTATUS
     #define apr_wait_t       int
    @@ -480,13 +480,6 @@ typedef  apr_uint32_t            apr_uintptr_t;
     typedef int apr_wait_t;
     #endif /* HAVE_SYS_WAIT_H */
     
    -/* XXXX: These don't belong here, but it is replicating what apr.hw does. */
    -#ifdef __MINGW32__
    -typedef  int         pid_t;
    -typedef  int         uid_t;
    -typedef  int         gid_t;
    -#endif
    -
     #if defined(PATH_MAX)
     #define APR_PATH_MAX       PATH_MAX
     #elif defined(_POSIX_PATH_MAX)
    @@ -498,7 +491,19 @@ typedef  int         gid_t;
     #define APR_DSOPATH "@shlibpath_var@"
     
     /** @} */
    -/** @} */
    +
    +/* Definitions that only Win32 programs need to compile properly. */
    +
    +/* XXX These simply don't belong here, perhaps in apr_portable.h
    + * based on some APR_HAVE_PID/GID/UID?
    + */
    +#ifdef __MINGW32__
    +#ifndef __GNUC__
    +typedef  int         pid_t;
    +#endif
    +typedef  int         uid_t;
    +typedef  int         gid_t;
    +#endif
     
     #ifdef __cplusplus
     }
    
    From 09eed56ab82fe3376acb6ac995e24250fc3d5e21 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 29 May 2008 16:10:15 +0000
    Subject: [PATCH 6191/7878] Refactor and update apr.hw to apr.h.in contents.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@661375 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr.hw | 256 ++++++++++++++++++++++++++++---------------------
     1 file changed, 147 insertions(+), 109 deletions(-)
    
    diff --git a/include/apr.hw b/include/apr.hw
    index af14f421674..d4c15f0cc95 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -106,10 +106,16 @@
     #endif
     #endif /* !_WINDOWS_ */
     
    +/**
    + * @defgroup APR Apache Portability Runtime library
    + * @{
    + */
     /**
      * @defgroup apr_platform Platform Definitions
    - * @ingroup APR 
      * @{
    + * @warning
    + * The actual values of macros and typedefs on this page
    + * are platform specific and should NOT be relied upon!
    */ #define APR_INLINE __inline @@ -134,6 +140,7 @@ #define APR_HAVE_NETINET_SCTP_UIO_H 0 #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 +#define APR_HAVE_SEMAPHORE_H 0 #define APR_HAVE_SIGNAL_H 1 #define APR_HAVE_STDARG_H 1 #define APR_HAVE_STDINT_H 0 @@ -141,6 +148,7 @@ #define APR_HAVE_STDLIB_H 1 #define APR_HAVE_STRING_H 1 #define APR_HAVE_STRINGS_H 0 +#define APR_HAVE_SYS_IOCTL_H 0 #define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 @@ -149,11 +157,12 @@ #define APR_HAVE_SYS_TIME_H 0 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 0 +#define APR_HAVE_SYS_UN_H 0 #define APR_HAVE_SYS_WAIT_H 0 +#define APR_HAVE_TIME_H 1 #define APR_HAVE_UNISTD_H 0 #define APR_HAVE_STDDEF_H 1 #define APR_HAVE_PROCESS_H 1 -#define APR_HAVE_TIME_H 1 #else #define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_CONIO_H 0 @@ -166,8 +175,11 @@ #define APR_HAVE_LIMITS_H 0 #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 +#define APR_HAVE_NETINET_SCTP_H 0 +#define APR_HAVE_NETINET_SCTP_UIO_H 0 #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 +#define APR_HAVE_SEMAPHORE_H 0 #define APR_HAVE_SIGNAL_H 0 #define APR_HAVE_STDARG_H 0 #define APR_HAVE_STDINT_H 0 @@ -175,21 +187,80 @@ #define APR_HAVE_STDLIB_H 1 #define APR_HAVE_STRING_H 1 #define APR_HAVE_STRINGS_H 0 +#define APR_HAVE_SYS_IOCTL_H 0 #define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 +#define APR_HAVE_SYS_SOCKIO_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 #define APR_HAVE_SYS_TIME_H 0 #define APR_HAVE_SYS_TYPES_H 0 #define APR_HAVE_SYS_UIO_H 0 +#define APR_HAVE_SYS_UN_H 0 #define APR_HAVE_SYS_WAIT_H 0 +#define APR_HAVE_TIME_H 0 #define APR_HAVE_UNISTD_H 0 #define APR_HAVE_STDDEF_H 0 #define APR_HAVE_PROCESS_H 0 -#define APR_HAVE_TIME_H 0 #endif +/** @} */ +/** @} */ + +/* We don't include our conditional headers within the doxyblocks + * or the extern "C" namespace + */ + +#if APR_HAVE_STDLIB_H +#include +#endif +#if APR_HAVE_STDIO_H +#include +#endif +#if APR_HAVE_SYS_TYPES_H +#include +#endif +#if APR_HAVE_STDDEF_H +#include +#endif +#if APR_HAVE_TIME_H +#include +#endif +#if APR_HAVE_PROCESS_H +#include +#endif +#if APR_HAVE_IPV6 +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup apr_platform + * @ingroup APR + * @{ + */ + +#define APR_HAVE_SHMEM_MMAP_TMP 0 +#define APR_HAVE_SHMEM_MMAP_SHM 0 +#define APR_HAVE_SHMEM_MMAP_ZERO 0 +#define APR_HAVE_SHMEM_SHMGET_ANON 0 +#define APR_HAVE_SHMEM_SHMGET 0 +#define APR_HAVE_SHMEM_MMAP_ANON 0 +#define APR_HAVE_SHMEM_BEOS 0 + +#define APR_USE_SHMEM_MMAP_TMP 0 +#define APR_USE_SHMEM_MMAP_SHM 0 +#define APR_USE_SHMEM_MMAP_ZERO 0 +#define APR_USE_SHMEM_SHMGET_ANON 0 +#define APR_USE_SHMEM_SHMGET 0 +#define APR_USE_SHMEM_MMAP_ANON 0 +#define APR_USE_SHMEM_BEOS 0 + #define APR_USE_FLOCK_SERIALIZE 0 +#define APR_USE_POSIXSEM_SERIALIZE 0 #define APR_USE_SYSVSEM_SERIALIZE 0 #define APR_USE_FCNTL_SERIALIZE 0 #define APR_USE_PROC_PTHREAD_SERIALIZE 0 @@ -197,28 +268,19 @@ #define APR_HAS_FLOCK_SERIALIZE 0 #define APR_HAS_SYSVSEM_SERIALIZE 0 +#define APR_HAS_POSIXSEM_SERIALIZE 0 #define APR_HAS_FCNTL_SERIALIZE 0 #define APR_HAS_PROC_PTHREAD_SERIALIZE 0 -#define APR_HAS_RWLOCK_SERIALIZE 0 - -#define APR_HAS_LOCK_CREATE_NP 0 #define APR_PROCESS_LOCK_IS_GLOBAL 0 -#define APR_USES_ANONYMOUS_SHM 0 -#define APR_USES_FILEBASED_SHM 0 -#define APR_USES_KEYBASED_SHM 0 - -#define APR_FILE_BASED_SHM 0 -#define APR_MEM_BASED_SHM 0 - #define APR_HAVE_CORKABLE_TCP 0 #define APR_HAVE_GETRLIMIT 0 #define APR_HAVE_ICONV 0 #define APR_HAVE_IN_ADDR 1 #define APR_HAVE_INET_ADDR 1 #define APR_HAVE_INET_NETWORK 0 -#define APR_HAVE_IPV6 0 +#define APR_HAVE_IPV6 1 #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 #define APR_HAVE_SIGACTION 0 @@ -232,55 +294,16 @@ #define APR_HAVE_STRUCT_RLIMIT 0 #define APR_HAVE_UNION_SEMUN 0 #define APR_HAVE_SCTP 0 +#define APR_HAVE_IOVEC 0 #ifndef _WIN32_WCE #define APR_HAVE_STRICMP 1 #define APR_HAVE_STRNICMP 1 -#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 1 #else #define APR_HAVE_STRICMP 0 #define APR_HAVE_STRNICMP 0 -#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0 -#endif - -/** @} */ - -/* We don't include our conditional headers within the doxyblocks - * or the extern "C" namespace - */ - -#if APR_HAVE_STDLIB_H -#include -#endif -#if APR_HAVE_STDIO_H -#include -#endif -#if APR_HAVE_SYS_TYPES_H -#include -#endif -#if APR_HAVE_STDDEF_H -#include -#endif -#if APR_HAVE_TIME_H -#include -#endif -#if APR_HAVE_PROCESS_H -#include -#endif -#if APR_HAVE_IPV6 -#include #endif -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @addtogroup apr_platform - * @ingroup APR - * @{ - */ - /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY 1 #define APR_HAS_THREADS 1 @@ -292,20 +315,24 @@ extern "C" { #define APR_HAS_SO_ACCEPTFILTER 0 #define APR_HAS_UNICODE_FS 1 #define APR_HAS_PROC_INVOKED 1 +#define APR_HAS_OS_UUID 1 + #ifndef _WIN32_WCE #define APR_HAS_SENDFILE 1 #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 1 #define APR_HAS_XTHREAD_FILES 1 +#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 1 #else #define APR_HAS_SENDFILE 0 #define APR_HAS_USER 0 #define APR_HAS_LARGE_FILES 0 #define APR_HAS_XTHREAD_FILES 0 +#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0 #endif -#define APR_HAS_OS_UUID 1 -/* Win32 cannot poll [just yet] on files/pipes. +/* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible + * to poll on files/pipes. */ #define APR_FILES_AS_SOCKETS 0 @@ -313,6 +340,11 @@ extern "C" { */ #define APR_CHARSET_EBCDIC 0 +/* If we have a TCP implementation that can be "corked", what flag + * do we use? + */ +#define APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@ + /* Is the TCP_NODELAY socket option inherited from listening sockets? */ #define APR_TCP_NODELAY_INHERITED 1 @@ -348,10 +380,6 @@ typedef int apr_off_t; typedef int apr_socklen_t; typedef apr_uint64_t apr_ino_t; -/* Are we big endian? */ -/* XXX: Fatal assumption on Alpha platforms */ -#define APR_IS_BIGENDIAN 0 - #ifdef WIN64 #define APR_SIZEOF_VOIDP 8 #else @@ -364,15 +392,9 @@ typedef apr_uint64_t apr_uintptr_t; typedef apr_uint32_t apr_uintptr_t; #endif - -/* XXX These simply don't belong here, perhaps in apr_portable.h - * based on some APR_HAVE_PID/GID/UID? - */ -#ifndef __GNUC__ -typedef int pid_t; -#endif -typedef int uid_t; -typedef int gid_t; +/* Are we big endian? */ +/* XXX: Fatal assumption on Alpha platforms */ +#define APR_IS_BIGENDIAN 0 /* Mechanisms to properly type numeric literals */ @@ -440,21 +462,6 @@ typedef int gid_t; #define APR_SIZE_MAX (~((apr_size_t)0)) -#if APR_HAVE_IPV6 - -/* Appears in later flavors, not the originals. */ -#ifndef in_addr6 -#define in6_addr in_addr6 -#endif - -#ifndef WS2TCPIP_INLINE -#define IN6_IS_ADDR_V4MAPPED(a) \ - ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \ - && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) -#endif - -#endif /* APR_HAS_IPV6 */ - /* Definitions that APR programs need to work properly. */ /** @@ -471,9 +478,11 @@ typedef int gid_t; /** * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, * so that they follow the platform's calling convention. - * @example - */ -/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data); + *
    + *
    + * void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
    + *
    + * 
    */ #define APR_THREAD_FUNC __stdcall @@ -486,9 +495,10 @@ typedef int gid_t; * variable arguments must use APR_DECLARE_NONSTD(). * * @remark Both the declaration and implementations must use the same macro. - * @example - */ -/** APR_DECLARE(rettype) apr_func(args) + * + *
    + * APR_DECLARE(rettype) apr_func(args)
    + * 
    * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA * @remark Note that when APR compiles the library itself, it passes the * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) @@ -507,9 +517,11 @@ typedef int gid_t; * APR_DECLARE_NONSTD(), as they must follow the C language calling convention. * @see APR_DECLARE @see APR_DECLARE_DATA * @remark Both the declaration and implementations must use the same macro. - * @example - */ -/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...); + *
    + *
    + * APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
    + *
    + * 
    */ #define APR_DECLARE_NONSTD(type) type @@ -519,10 +531,13 @@ typedef int gid_t; * @see APR_DECLARE @see APR_DECLARE_NONSTD * @remark Note that the declaration and implementations use different forms, * but both must include the macro. - * @example - */ -/** extern APR_DECLARE_DATA type apr_variable;\n + * + *
    + *
    + * extern APR_DECLARE_DATA type apr_variable;\n
      * APR_DECLARE_DATA type apr_variable = value;
    + *
    + * 
    */ #define APR_DECLARE_DATA @@ -542,10 +557,10 @@ typedef int gid_t; #ifdef WIN64 #define APR_SSIZE_T_FMT "I64d" -#define APR_SIZE_T_FMT "I64d" +#define APR_SIZE_T_FMT "I64u" #else #define APR_SSIZE_T_FMT "d" -#define APR_SIZE_T_FMT "d" +#define APR_SIZE_T_FMT "u" #endif #if APR_HAS_LARGE_FILES @@ -560,21 +575,13 @@ typedef int gid_t; #define APR_UINT64_T_FMT "I64u" #define APR_UINT64_T_HEX_FMT "I64x" -/* Local machine definition for console and log output. */ -#define APR_EOL_STR "\r\n" - /* No difference between PROC and GLOBAL mutex */ #define APR_PROC_MUTEX_IS_GLOBAL 1 -typedef int apr_wait_t; - -/* struct iovec is needed to emulate Unix writev */ -#define APR_HAVE_IOVEC 0 +/* Local machine definition for console and log output. */ +#define APR_EOL_STR "\r\n" -/* Nasty Win32 .h ommissions we really need */ -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 +typedef int apr_wait_t; #if APR_HAS_UNICODE_FS /* An arbitrary size that is digestable. True max is a bit less than 32000 */ @@ -587,6 +594,37 @@ typedef int apr_wait_t; /** @} */ +/* Definitions that only Win32 programs need to compile properly. */ + +/* XXX These simply don't belong here, perhaps in apr_portable.h + * based on some APR_HAVE_PID/GID/UID? + */ +#ifndef __GNUC__ +typedef int pid_t; +#endif +typedef int uid_t; +typedef int gid_t; + +/* Win32 .h ommissions we really need */ +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 + +#if APR_HAVE_IPV6 + +/* Appears in later flavors, not the originals. */ +#ifndef in_addr6 +#define in6_addr in_addr6 +#endif + +#ifndef WS2TCPIP_INLINE +#define IN6_IS_ADDR_V4MAPPED(a) \ + ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \ + && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) +#endif + +#endif /* APR_HAS_IPV6 */ + #ifdef __cplusplus } #endif From cf64243be99b0f6038b3c58600a92670565ed5bc Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Fri, 30 May 2008 21:18:32 +0000 Subject: [PATCH 6192/7878] add collective copyright git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@661865 13f79535-47bb-0310-9956-ffa450edef68 --- NOTICE | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NOTICE b/NOTICE index d0f318469a6..7df842dde11 100644 --- a/NOTICE +++ b/NOTICE @@ -1,3 +1,6 @@ +Apache Portable Runtime +Copyright 2008 The Apache Software Foundation. + This product includes software developed by The Apache Software Foundation (http://www.apache.org/). From e3abafa94430e777c3e8ceded40db6f1b5a3ff52 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Sun, 1 Jun 2008 00:50:23 +0000 Subject: [PATCH 6193/7878] apr_shm: fix failure in test_named_remove Supplementary to r661146: - Include the necessary unistd.h - Ignore EINVAL from shmctl in shm_cleanup_owner This fixes the testcase, but doesn't feel like the end of the story: both this and r661146 feel like sticking plaster over something deeper. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@662114 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 134807de545..68d5fd51745 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include "apr_arch_shm.h" #include "apr_general.h" @@ -69,7 +70,7 @@ static apr_status_t shm_cleanup_owner(void *m_) /* Indicate that the segment is to be destroyed as soon * as all processes have detached. This also disallows any * new attachments to the segment. */ - if (shmctl(m->shmid, IPC_RMID, NULL) == -1) { + if (shmctl(m->shmid, IPC_RMID, NULL) == -1 && errno != EINVAL) { return errno; } if (shmdt(m->base) == -1) { From 7a8764109e9b05ec4365b36a6b97f2e230f39072 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Mon, 2 Jun 2008 00:12:00 +0000 Subject: [PATCH 6194/7878] Silence GCC strict aliasing warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@662299 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_ring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_ring.h b/include/apr_ring.h index 867f47a596b..935b07fc5d0 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -157,7 +157,7 @@ * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SENTINEL(hp, elem, link) \ - (struct elem *)((char *)(hp) - APR_OFFSETOF(struct elem, link)) + (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link)) /** * The first element of the ring From e278e087dc1878e725508342eeb5835ff0033cf2 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Mon, 2 Jun 2008 00:14:07 +0000 Subject: [PATCH 6195/7878] Header unistd.h is already included in arch/unix/apr_arch_shm.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@662300 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 68d5fd51745..14bb34491cd 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -14,7 +14,6 @@ * limitations under the License. */ -#include #include "apr_arch_shm.h" #include "apr_general.h" From 8948acbb9054ec9ae727b2019ca1ab5ef1728d11 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Mon, 2 Jun 2008 05:24:14 +0000 Subject: [PATCH 6196/7878] Add test for apr_getservbyname(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@662326 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/testsock.c b/test/testsock.c index 0d1bd578b27..84121449bf5 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -73,6 +73,26 @@ static void test_addr_info(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "127.0.0.1", sa->hostname); } +static void test_serv_by_name(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_sockaddr_t *sa; + + rv = apr_sockaddr_info_get(&sa, NULL, APR_UNSPEC, 0, 0, p); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); + + rv = apr_getservbyname(sa, "ftp"); + APR_ASSERT_SUCCESS(tc, "Problem getting ftp service", rv); + ABTS_INT_EQUAL(tc, 21, sa->port); + + rv = apr_getservbyname(sa, "complete_and_utter_rubbish"); + APR_ASSERT_SUCCESS(tc, "Problem getting non-existent service", !rv); + + rv = apr_getservbyname(sa, "http"); + APR_ASSERT_SUCCESS(tc, "Problem getting http service", rv); + ABTS_INT_EQUAL(tc, 80, sa->port); +} + static apr_socket_t *setup_socket(abts_case *tc) { apr_status_t rv; @@ -318,6 +338,7 @@ abts_suite *testsock(abts_suite *suite) suite = ADD_SUITE(suite) abts_run_test(suite, test_addr_info, NULL); + abts_run_test(suite, test_serv_by_name, NULL); abts_run_test(suite, test_create_bind_listen, NULL); abts_run_test(suite, test_send, NULL); abts_run_test(suite, test_recv, NULL); From 77ffd04ab1d4d998c85f55a1dcbd3feeffc83eed Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 2 Jun 2008 19:10:14 +0000 Subject: [PATCH 6197/7878] Provide a readme - others please review and expand upon this. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@662520 13f79535-47bb-0310-9956-ffa450edef68 --- README | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 00000000000..365c0f725d8 --- /dev/null +++ b/README @@ -0,0 +1,57 @@ +Apache Portable Runtime Library (APR) +------------------------------------- + + The Apache Portable Runtime Library provides a predictable and + consistent interface to underlying platform-specific + implementations, with an API to which software developers may code + and be assured of predictable if not identical behavior regardless + of the platform on which their software is built, relieving them of + the need to code special-case conditions to work around or take + advantage of platform-specific deficiencies or features. + + APR and its companion libraries are implemented entirely in C + and provide a common programming interface across a wide variety + of operating system platforms without sacrificing performance. + Currently supported platforms include: + + UNIX variants + Windows + Netware + Mac OS X + OS/2 + + To give a brief overview, the primary core + subsystems of APR 1.3 include the following: + + Atomic operations + Dynamic Shared Object loading + File I/O + Locks (mutexes, condition variables, etc) + Memory management (high performance allocators) + Memory-mapped files + Multicast Sockets + Network I/O + Shared memory + Thread and Process management + Various data structures (tables, hashes, priority queues, etc) + + For a more complete list, please refer to the following URLs: + + http://apr.apache.org/docs/apr/modules.html + + Users of APR 0.9 should be aware that migrating to the APR 1.x + programming interfaces may require some adjustments; APR 1.x is + neither source nor binary compatible with earlier APR 0.9 releases. + Users of APR 1.x can expect consistent interfaces and binary backwards + compatibility throughout the entire APR 1.x release cycle, as defined + in our versioning rules: + + http://apr.apache.org/versioning.html + + APR is already used extensively by the Apache HTTP Server + version 2 and the Subversion revision control system, to + name but a few. We list all known projects using APR at + http://apr.apache.org/projects.html -- so please let us know + if you find our libraries useful in your own projects! + + From dc10b07737f8f408556e81a8292295bc55e71b61 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 2 Jun 2008 19:12:10 +0000 Subject: [PATCH 6198/7878] Fold into a single readme git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@662522 13f79535-47bb-0310-9956-ffa450edef68 --- README | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.dev | 97 ------------------------------------------------------ 2 files changed, 94 insertions(+), 97 deletions(-) delete mode 100644 README.dev diff --git a/README b/README index 365c0f725d8..5fa59bfb736 100644 --- a/README +++ b/README @@ -55,3 +55,97 @@ Apache Portable Runtime Library (APR) if you find our libraries useful in your own projects! +Using a Subversion Checkout on Unix +=================================== + +If you are building APR from SVN, you need to perform a prerequisite +step. You must have autoconf, libtool and python installed for this +to work. The prerequisite is simply; + + ./buildconf + +If you are building APR from a distribution tarball, buildconf is +already run for you, and you do not need autoconf, libtool or python +installed or to run buildconf unless you have patched APR's buildconf +inputs (such as configure.in, build.conf, virtually any file within +the build/ tree, or you add or remove source files). + +Remember when updating from svn that you must rerun ./buildconf again +to effect any changes made to the build schema in your fresh update. + + +Configuring and Building APR on Unix +==================================== + +Simply; + + ./configure --prefix=/desired/path/of/apr + make + make test + make install + +Configure has additional options, ./configure --help will offer you +those choices. You may also add CC=compiler CFLAGS="compiler flags" +etc. prior to the ./configure statement (on the same line). Please +be warned, some flags must be passed as part of the CC command, +itself, in order for autoconf to make the right determinations. Eg.; + + CC="gcc -m64" ./configure --prefix=/desired/path/of/apr + +will inform APR that you are compiling to a 64 bit CPU, and autoconf +must consider that when setting up all of APR's internal and external +type declarations. + +For more verbose output from testall, you may wish to invoke testall +with the flag; + + cd test + ./testall -v + + +Configuring and Building APR on Windows +======================================= + +Using Visual Studio, you can build and run the test validation of APR. +The Makefile.win make file has a bunch of documentation about it's +options, but a trivial build is simply; + + nmake -f Makefile.win + nmake -f Makefile.win PREFIX=c:\desired\path\of\apr install + +Note you must manually modify the include\apr.hw file before you +build to change default options, see the #define APR_HAS_... or the +#define APR_HAVE_... statements. Be careful, many of these aren't +appropriate to be modified. The most common change is + +#define APR_HAVE_IPV6 1 + +rather than 0 if this build of APR will be used strictly on machines +with the IPv6 adapter support installed. + +It's trivial to include the apr.dsp (for a static library) or the +libapr.dsp (for a dynamic library) in your own build project, or you +can load apr.dsw in Visual Studio 2002 (.NET) or later, which will +convert these for you into apr.sln and associated .vcproj files. + +When using APR as a dynamic library, nothing special is required, +simply link to libapr.lib. To use it as a static library, simply +define APR_DECLARE_STATIC before you include any apr header files +in your source, and link to apr.lib instead. + + +Generating Test Coverage information with gcc +============================================= + +If you want to generate test coverage data, use the following steps: + + ./buildconf + CFLAGS="-fprofile-arcs -ftest-coverage" ./configure + make + cd test + make + ./testall + cd .. + make gcov + + diff --git a/README.dev b/README.dev deleted file mode 100644 index 1b5cbcccd1c..00000000000 --- a/README.dev +++ /dev/null @@ -1,97 +0,0 @@ -Apache Portable Runtime -======================= - - -Using a Subversion Checkout on Unix -=================================== - -If you are building APR from SVN, you need to perform a prerequisite -step. You must have autoconf, libtool and python installed for this -to work. The prerequisite is simply; - - ./buildconf - -If you are building APR from a distribution tarball, buildconf is -already run for you, and you do not need autoconf, libtool or python -installed or to run buildconf unless you have patched APR's buildconf -inputs (such as configure.in, build.conf, virtually any file within -the build/ tree, or you add or remove source files). - -Remember when updating from svn that you must rerun ./buildconf again -to effect any changes made to the build schema in your fresh update. - - -Configuring and Building APR on Unix -==================================== - -Simply; - - ./configure --prefix=/desired/path/of/apr - make - make test - make install - -Configure has additional options, ./configure --help will offer you -those choices. You may also add CC=compiler CFLAGS="compiler flags" -etc. prior to the ./configure statement (on the same line). Please -be warned, some flags must be passed as part of the CC command, -itself, in order for autoconf to make the right determinations. Eg.; - - CC="gcc -m64" ./configure --prefix=/desired/path/of/apr - -will inform APR that you are compiling to a 64 bit CPU, and autoconf -must consider that when setting up all of APR's internal and external -type declarations. - -For more verbose output from testall, you may wish to invoke testall -with the flag; - - cd test - ./testall -v - - -Configuring and Building APR on Windows -======================================= - -Using Visual Studio, you can build and run the test validation of APR. -The Makefile.win make file has a bunch of documentation about it's -options, but a trivial build is simply; - - nmake -f Makefile.win - nmake -f Makefile.win PREFIX=c:\desired\path\of\apr install - -Note you must manually modify the include\apr.hw file before you -build to change default options, see the #define APR_HAS_... or the -#define APR_HAVE_... statements. Be careful, many of these aren't -appropriate to be modified. The most common change is - -#define APR_HAVE_IPV6 1 - -rather than 0 if this build of APR will be used strictly on machines -with the IPv6 adapter support installed. - -It's trivial to include the apr.dsp (for a static library) or the -libapr.dsp (for a dynamic library) in your own build project, or you -can load apr.dsw in Visual Studio 2002 (.NET) or later, which will -convert these for you into apr.sln and associated .vcproj files. - -When using APR as a dynamic library, nothing special is required, -simply link to libapr.lib. To use it as a static library, simply -define APR_DECLARE_STATIC before you include any apr header files -in your source, and link to apr.lib instead. - - -Generating Test Coverage information with gcc -============================================= - -If you want to generate test coverage data, use the following steps: - - ./buildconf - CFLAGS="-fprofile-arcs -ftest-coverage" ./configure - make - cd test - make - ./testall - cd .. - make gcov - From 77975e905defb34bd34ad60ec32ee9ec6a1b5c0b Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Wed, 4 Jun 2008 19:02:23 +0000 Subject: [PATCH 6199/7878] * Fix some gcc compiler warnings on Solaris Patch to atomic/unix/solaris.c submitted by: Henry Jen git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@663342 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/solaris.c | 2 +- passwd/apr_getpass.c | 2 +- poll/unix/port.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/atomic/unix/solaris.c b/atomic/unix/solaris.c index b3852516b08..547499a55ea 100644 --- a/atomic/unix/solaris.c +++ b/atomic/unix/solaris.c @@ -68,7 +68,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) { - return atomic_cas_ptr(mem, cmp, (void*) with); + return atomic_cas_ptr(mem, (void*) cmp, with); } APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 369c6e6037d..ac45815c3ea 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -70,7 +70,7 @@ #define ERR_OVERFLOW 5 -#ifndef HAVE_GETPASS +#if !defined(HAVE_GETPASS) && !defined(HAVE_GETPASSPHRASE) /* MPE, Win32, NetWare and BeOS all lack a native getpass() */ diff --git a/poll/unix/port.c b/poll/unix/port.c index ca4d7b28ed5..3f1ac245d5d 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -264,7 +264,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, pfd_elem_t *ep; apr_status_t rv = APR_SUCCESS; int res; - int err; + int err = 0; pollset_lock_rings(); From 3a15008e55d1dc0cf024544f96d0fc025a7b92cf Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 6 Jun 2008 13:40:55 +0000 Subject: [PATCH 6200/7878] de-tabified - no functional change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@663939 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_getpass.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index ac45815c3ea..a9d60e38ae0 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -100,13 +100,13 @@ static char *get_password(const char *prompt) int n=0; fputs(prompt, stderr); fflush(stderr); - + if (tcgetattr(STDIN_FILENO, &attr) != 0) return NULL; attr.c_lflag &= ~(ECHO); if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &attr) != 0) - return NULL; + return NULL; while ((password[n] = getchar()) != '\n') { if (n < sizeof(password) - 1 && password[n] >= ' ' && password[n] <= '~') { n++; @@ -180,7 +180,7 @@ static char *get_password(const char *prompt) fputs("^Z\n", stderr); return NULL; } - else if (ch == 27) /* ESC */ { + else if (ch == 27) /* ESC */ { fputc('\n', stderr); fputs(prompt, stderr); n = 0; @@ -189,7 +189,7 @@ static char *get_password(const char *prompt) password[n++] = ch; fputc('*', stderr); } - else { + else { fputc('\a', stderr); } } From 24f2da387f83e74dc18d1b8cb01676d8d002e162 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 6 Jun 2008 13:49:41 +0000 Subject: [PATCH 6201/7878] added usage of threadsafe getpass_r(); enabled HAVE_GETPASS_R for NetWare platform. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@663941 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_private.h | 9 +++++++++ passwd/apr_getpass.c | 11 ++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 034271b1b4e..a4e9b1e7828 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -70,6 +70,15 @@ #define HAVE_WRITEV 1 +#define HAVE_GETPASS_R 1 +/* + * check for older NDKs which have only the getpassword() function. + */ +#include +#if (CURRENT_NDK_THRESHOLD < 709060000) +#define getpass_r getpassword +#endif + /* 64-bit integer conversion function */ #define APR_INT64_STRFN strtoll diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index a9d60e38ae0..3deb08fc0e1 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -70,7 +70,7 @@ #define ERR_OVERFLOW 5 -#if !defined(HAVE_GETPASS) && !defined(HAVE_GETPASSPHRASE) +#if !defined(HAVE_GETPASS) && !defined(HAVE_GETPASSPHRASE) && !defined(HAVE_GETPASS_R) /* MPE, Win32, NetWare and BeOS all lack a native getpass() */ @@ -202,7 +202,7 @@ static char *get_password(const char *prompt) #endif /* no getchar or _getch */ -#endif /* no getpass */ +#endif /* no getpass or getpassphrase or getpass_r */ /* * Use the OS getpass() routine (or our own) to obtain a password from @@ -221,6 +221,11 @@ static char *get_password(const char *prompt) APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, apr_size_t *bufsiz) { + apr_status_t rv = APR_SUCCESS; +#if defined(HAVE_GETPASS_R) + if (getpass_r(prompt, pwbuf, *bufsiz) == NULL) + return APR_EINVAL; +#else #if defined(HAVE_GETPASSPHRASE) char *pw_got = getpassphrase(prompt); #elif defined(HAVE_GETPASS) @@ -228,7 +233,6 @@ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, apr_ #else /* use the replacement implementation above */ char *pw_got = get_password(prompt); #endif - apr_status_t rv = APR_SUCCESS; if (!pw_got) return APR_EINVAL; @@ -237,5 +241,6 @@ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, apr_ } apr_cpystrn(pwbuf, pw_got, *bufsiz); memset(pw_got, 0, strlen(pw_got)); +#endif /* HAVE_GETPASS_R */ return rv; } From 064ebd71d7a8ec526b4255e1860a22234dd54fc3 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 9 Jun 2008 13:32:45 +0000 Subject: [PATCH 6202/7878] Using AC_CACHE_CHECK. So avoid warning about: configure.in:354: warning: AC_CACHE_VAL(atomic_builtins, ...): suspicious cache-id, must contain _cv_ to be cached git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@664702 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index db60a31fc40..cd2cf069f54 100644 --- a/configure.in +++ b/configure.in @@ -351,7 +351,7 @@ case "$host:$CC" in ;; esac -AC_CACHE_CHECK([whether the compiler provides atomic builtins], [atomic_builtins], +AC_CACHE_CHECK([whether the compiler provides atomic builtins], [ap_cv_atomic_builtins], [AC_TRY_RUN([ int main() { @@ -387,9 +387,9 @@ int main() return 1; return 0; -}], [atomic_builtins=yes], [atomic_builtins=no], [atomic_builtins=no])]) +}], [ap_cv_atomic_builtins=yes], [ap_cv_atomic_builtins=no], [ap_cv_atomic_builtins=no])]) -if test "$atomic_builtins" = "yes"; then +if test "$ap_cv_atomic_builtins" = "yes"; then AC_DEFINE(HAVE_ATOMIC_BUILTINS, 1, [Define if compiler provides atomic builtins]) fi From 8497419877d39322f6819455ee8c68f3e8e39f95 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 9 Jun 2008 16:27:06 +0000 Subject: [PATCH 6203/7878] refresh git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@665745 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 3206eb3b297..fab6c40fdb5 100644 --- a/STATUS +++ b/STATUS @@ -3,8 +3,9 @@ Last modified at [$Date$] Releases: 1.4.0 : in development on trunk/ - 1.3.0 : in maintenance on branches/1.3.x/ - 1.2.12 : in maintenance on branches/1.2.x/ + 1.3.1 : in maintenance on branches/1.3.x/ + 1.3.0 : released June 3, 2008 + 1.2.12 : released November 25, 2007 1.2.11 : released September 6, 2007 1.2.10 : not released 1.2.9 : tagged June 4, 2007 From b68d9c4da435e9cc55bbe6356c5f8375bdc4feff Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 11 Jun 2008 04:54:32 +0000 Subject: [PATCH 6204/7878] Revert 1.3.0 change which mis-organized the ws2tcpip header test prior to declaring APR_HAVE_IPV6, and inadvertantly changed the default of APR_HAVE_IPV6 to 1 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@666521 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index d4c15f0cc95..a2bd54f1e7e 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -229,9 +229,6 @@ #if APR_HAVE_PROCESS_H #include #endif -#if APR_HAVE_IPV6 -#include -#endif #ifdef __cplusplus extern "C" { @@ -280,7 +277,7 @@ extern "C" { #define APR_HAVE_IN_ADDR 1 #define APR_HAVE_INET_ADDR 1 #define APR_HAVE_INET_NETWORK 0 -#define APR_HAVE_IPV6 1 +#define APR_HAVE_IPV6 0 #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 #define APR_HAVE_SIGACTION 0 @@ -611,6 +608,7 @@ typedef int gid_t; #define STDERR_FILENO 2 #if APR_HAVE_IPV6 +#include /* Appears in later flavors, not the originals. */ #ifndef in_addr6 From bc348a48590900bc96521ac235e8efcd18301087 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Jun 2008 16:31:07 +0000 Subject: [PATCH 6205/7878] This is included earlier in the file, no need to duplicate (and is the reason I had no problem with the incorrectly tested second inclusion.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@667150 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 1 - 1 file changed, 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index a2bd54f1e7e..a1cffb53971 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -608,7 +608,6 @@ typedef int gid_t; #define STDERR_FILENO 2 #if APR_HAVE_IPV6 -#include /* Appears in later flavors, not the originals. */ #ifndef in_addr6 From e0c1620dda19c764bda9b74764954efe1b67b507 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Jun 2008 16:32:44 +0000 Subject: [PATCH 6206/7878] This should not be necessary, but SDK 6.1 headers were broken (post Visual Studio 2005) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@667152 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index a1cffb53971..d391ca2acdc 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -76,9 +76,9 @@ #endif #ifndef _WIN32_WINNT -/* Restrict the server to a subset of Windows 2000 header files by default +/* Restrict the server to a subset of Windows XP header files by default */ -#define _WIN32_WINNT 0x0500 +#define _WIN32_WINNT 0x0501 #endif #ifndef NOUSER #define NOUSER From a1719749fe4f9cafee3ef3efbe040778d9831d66 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Mon, 16 Jun 2008 21:15:24 +0000 Subject: [PATCH 6207/7878] Fix getservbyname_r() detection. Patch by rpluem. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@668315 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 109 ++++++++++++++++++++++--------------------- 1 file changed, 56 insertions(+), 53 deletions(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index e864d871248..4d479a45ad7 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -292,7 +292,7 @@ AC_DEFUN([APR_CHECK_GETSERVBYNAME_R_STYLE], [ dnl Try and compile a glibc2 getservbyname_r piece of code, and set the dnl style of the routines to glibc2 on success -AC_CACHE_CHECK([style of getservbyname_r routine], ac_cv_getservbyname_r_style, +AC_CACHE_CHECK([style of getservbyname_r routine], ac_cv_getservbyname_r_style, [ APR_TRY_COMPILE_NO_WARNING([ #ifdef HAVE_SYS_TYPES_H #include @@ -315,59 +315,62 @@ int tmp = getservbyname_r((const char *) 0, (const char *) 0, (struct servent **) 0); /* use tmp to suppress the warning */ tmp=0; -], ac_cv_getservbyname_r_style=glibc2, [ - -dnl Try and compile a Solaris getservbyname_r piece of code, and set the -dnl style of the routines to solaris on success -AC_CACHE_VAL(ac_cv_getservbyname_r_style, -APR_TRY_COMPILE_NO_WARNING([ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -],[ -struct servent tmp = getservbyname_r((const char *) 0, (const char *) 0, - (struct servent *) 0, (char *) 0, 0); -/* use tmp to suppress the warning */ -tmp=NULL; -], ac_cv_getservbyname_r_style=solaris, [ +], ac_cv_getservbyname_r_style=glibc2, ac_cv_getservbyname_r_style=none) + +if test "$ac_cv_getservbyname_r_style" = "none"; then + dnl Try and compile a Solaris getservbyname_r piece of code, and set the + dnl style of the routines to solaris on success + APR_TRY_COMPILE_NO_WARNING([ + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_NETINET_IN_H + #include + #endif + #ifdef HAVE_ARPA_INET_H + #include + #endif + #ifdef HAVE_NETDB_H + #include + #endif + #ifdef HAVE_STDLIB_H + #include + #endif + ],[ + struct servent *tmp = getservbyname_r((const char *) 0, (const char *) 0, + (struct servent *) 0, (char *) 0, 0); + /* use tmp to suppress the warning */ + tmp=NULL; + ], ac_cv_getservbyname_r_style=solaris, ac_cv_getservbyname_r_style=none) +fi -dnl Try and compile a OSF/1 getservbyname_r piece of code, and set the -dnl style of the routines to osf1 on success -AC_CACHE_VAL( ac_cv_getservbyname_r_style, -APR_TRY_COMPILE_NO_WARNING([ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -],[ -int tmp = getservbyname_r((const char *) 0, (const char *) 0, - (struct servent *) 0, (struct servent_data *) 0); -/* use tmp to suppress the warning */ -tmp=0; -], ac_cv_getservbyname_r_style=osf1, ac_cv_getservbyname_r_style=none))]))])) +if test "$ac_cv_getservbyname_r_style" = "none"; then + dnl Try and compile a OSF/1 getservbyname_r piece of code, and set the + dnl style of the routines to osf1 on success + APR_TRY_COMPILE_NO_WARNING([ + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_NETINET_IN_H + #include + #endif + #ifdef HAVE_ARPA_INET_H + #include + #endif + #ifdef HAVE_NETDB_H + #include + #endif + #ifdef HAVE_STDLIB_H + #include + #endif + ],[ + int tmp = getservbyname_r((const char *) 0, (const char *) 0, + (struct servent *) 0, (struct servent_data *) 0); + /* use tmp to suppress the warning */ + tmp=0; + ], ac_cv_getservbyname_r_style=osf1, ac_cv_getservbyname_r_style=none) +fi +]) if test "$ac_cv_getservbyname_r_style" = "glibc2"; then AC_DEFINE(GETSERVBYNAME_R_GLIBC2, 1, [Define if getservbyname_r has the glibc style]) From 6ada1363495b7d5dfe6433fc606e294f4316f219 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Tue, 17 Jun 2008 23:52:34 +0000 Subject: [PATCH 6208/7878] Use correct format for apr_time_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@668878 13f79535-47bb-0310-9956-ffa450edef68 --- test/sockperf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/sockperf.c b/test/sockperf.c index 9726e568c3c..bc3d1e2f3a3 100644 --- a/test/sockperf.c +++ b/test/sockperf.c @@ -231,11 +231,12 @@ int main(int argc, char **argv) printf("%10d byte block:\n", results[i].size); printf("\t%2d iterations : ", results[i].iters); for (j = 0; j < results[i].iters; j++) { - printf("%6Ld ", results[i].msecs[j]); + printf("%6" APR_TIME_T_FMT, results[i].msecs[j]); totTime += results[i].msecs[j]; } printf("<\n"); - printf("\t Average: %6Ld\n", totTime / results[i].iters); + printf("\t Average: %6" APR_TIME_T_FMT "\n", + totTime / results[i].iters); } return 0; From bb83f424cc5b457b81a343f8c51f329d61529286 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Wed, 18 Jun 2008 04:58:40 +0000 Subject: [PATCH 6209/7878] Avoid strict aliasing warnings on HP-UX. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@669082 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dso/unix/dso.c b/dso/unix/dso.c index e3baf72ce8e..fdd56f1d338 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -178,9 +178,9 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, int status; errno = 0; - status = shl_findsym((shl_t *)&handle->handle, symname, TYPE_PROCEDURE, &symaddr); + status = shl_findsym((void *)&handle->handle, symname, TYPE_PROCEDURE, &symaddr); if (status == -1 && errno == 0) /* try TYPE_DATA instead */ - status = shl_findsym((shl_t *)&handle->handle, symname, TYPE_DATA, &symaddr); + status = shl_findsym((void *)&handle->handle, symname, TYPE_DATA, &symaddr); if (status == -1) return APR_ESYMNOTFOUND; *ressym = symaddr; From 79d1132f211f0bd469cfad277f01c6bd04e5d963 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Wed, 18 Jun 2008 08:36:17 +0000 Subject: [PATCH 6210/7878] * Increase the size of the mapped block from 16k to 64k since the default page size for linux on ppc64 architecture is sometimes 64k depending on how the kernel was compiled. The increase in the block size does not harm any platforms where this test worked before as 64k is a multiple of 16k. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@669111 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testlfs.c b/test/testlfs.c index 13bff9bc4cb..a81d5366857 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -251,7 +251,7 @@ static void test_mmap(abts_case *tc, void *data) { apr_mmap_t *map; apr_file_t *fh; - apr_size_t len = 16384; /* hopefully a multiple of the page size */ + apr_size_t len = 65536; /* hopefully a multiple of the page size */ apr_off_t off = eightGB - len; apr_status_t rv; void *ptr; @@ -267,7 +267,7 @@ static void test_mmap(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "close file", apr_file_close(fh)); - ABTS_ASSERT(tc, "mapped a 16K block", map->size == len); + ABTS_ASSERT(tc, "mapped a 64K block", map->size == len); APR_ASSERT_SUCCESS(tc, "get pointer into mmaped region", apr_mmap_offset(&ptr, map, len - 4)); From f76c71089dca276a42b42f767d7e45c31eee292a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 20 Jun 2008 15:01:12 +0000 Subject: [PATCH 6211/7878] Autoconf 2.60's 2nd birthday this coming thursday. As this is for maintainers, it's time to bump. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@669927 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 8 ++++---- configure.in | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 62fe931aefc..637ef140a0f 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -14,18 +14,18 @@ py_version=`python -c 'import sys; print sys.version' 2>&1|sed 's/ .*//;q'` echo "buildconf: python version $py_version (ok)" fi -# autoconf 2.50 or newer +# autoconf 2.60 or newer ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;q'` if test -z "$ac_version"; then echo "buildconf: autoconf not found." -echo " You need autoconf version 2.50 or newer installed" +echo " You need autoconf version 2.60 or newer installed" echo " to build APR from SVN." exit 1 fi IFS=.; set $ac_version; IFS=' ' -if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then +if test "$1" = "2" -a "$2" -lt "60" || test "$1" -lt "2"; then echo "buildconf: autoconf version $ac_version found." -echo " You need autoconf version 2.50 or newer installed" +echo " You need autoconf version 2.60 or newer installed" echo " to build APR from SVN." exit 1 else diff --git a/configure.in b/configure.in index cd2cf069f54..0d16d0e319a 100644 --- a/configure.in +++ b/configure.in @@ -139,9 +139,8 @@ AC_CHECK_PROG(ASCPP, cpp, cpp) AC_CHECK_TOOL(AR, ar, ar) dnl Various OS checks that apparently set required flags -AC_AIX +AC_USE_SYSTEM_EXTENSIONS AC_ISC_POSIX -AC_MINIX APR_EBCDIC From dffc2988a2449069b297a51aa885ffc478958b21 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 20 Jun 2008 15:43:23 +0000 Subject: [PATCH 6212/7878] Silence subpackage autoconf 2.62 warnings of unknown options git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@669950 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 2afb4666dd8..4b3f6586772 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -158,9 +158,12 @@ changequote([, ])dnl done ]) - # autoconf doesn't add --silent to ac_configure_args; explicitly pass it + dnl autoconf doesn't add --silent to ac_configure_args; explicitly pass it test "x$silent" = "xyes" && apr_configure_args="$apr_configure_args --silent" + dnl AC_CONFIG_SUBDIRS silences option warnings, emulate this for 2.62 + apr_configure_args="--disable-option-checking $apr_configure_args" + dnl The eval makes quoting arguments work - specifically the second argument dnl where the quoting mechanisms used is "" rather than []. dnl From 109dc4c992cf2e516e751f36b998c589f1d69b68 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 20 Jun 2008 15:46:02 +0000 Subject: [PATCH 6213/7878] Silence apr-config.in seems to ignore the --datarootdir setting git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@669954 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 1 + 1 file changed, 1 insertion(+) diff --git a/apr-config.in b/apr-config.in index e0500edc90e..84b407356b6 100644 --- a/apr-config.in +++ b/apr-config.in @@ -25,6 +25,7 @@ prefix="@prefix@" exec_prefix="@exec_prefix@" bindir="@bindir@" libdir="@libdir@" +datarootdir="@datadir@" datadir="@datadir@" installbuilddir="@installbuilddir@" includedir="@includedir@" From 10b40e51c034bbfa9ea8ec5de78f1fd1c1ed6128 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 20 Jun 2008 17:31:41 +0000 Subject: [PATCH 6214/7878] Back out the 2.60 requirement, adopt conditional handling for the new AC_USE_SYSTEM_EXTENSIONS as of 2.60. Submitted by: Arfrever Frehtes Taifersar Arahesis git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@670000 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 8 ++++---- configure.in | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 637ef140a0f..62fe931aefc 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -14,18 +14,18 @@ py_version=`python -c 'import sys; print sys.version' 2>&1|sed 's/ .*//;q'` echo "buildconf: python version $py_version (ok)" fi -# autoconf 2.60 or newer +# autoconf 2.50 or newer ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;q'` if test -z "$ac_version"; then echo "buildconf: autoconf not found." -echo " You need autoconf version 2.60 or newer installed" +echo " You need autoconf version 2.50 or newer installed" echo " to build APR from SVN." exit 1 fi IFS=.; set $ac_version; IFS=' ' -if test "$1" = "2" -a "$2" -lt "60" || test "$1" -lt "2"; then +if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then echo "buildconf: autoconf version $ac_version found." -echo " You need autoconf version 2.60 or newer installed" +echo " You need autoconf version 2.50 or newer installed" echo " to build APR from SVN." exit 1 else diff --git a/configure.in b/configure.in index 0d16d0e319a..6b7ce59cfbb 100644 --- a/configure.in +++ b/configure.in @@ -139,9 +139,14 @@ AC_CHECK_PROG(ASCPP, cpp, cpp) AC_CHECK_TOOL(AR, ar, ar) dnl Various OS checks that apparently set required flags +ifdef([AC_USE_SYSTEM_EXTENSIONS], [ AC_USE_SYSTEM_EXTENSIONS -AC_ISC_POSIX +], [ +AC_AIX +AC_MINIX +]) +AC_ISC_POSIX APR_EBCDIC dnl this is our library name From 4629357341c858b9317410b9377f7ff90536a3ce Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Thu, 26 Jun 2008 17:18:03 +0000 Subject: [PATCH 6215/7878] resolve testprocmutex failures on AIX and HP-UX by recognizing EACCES in fcntl-based apr_proc_mutex_trylock(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@671955 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++++ configure.in | 64 +++++++++++++++++++++++++++++++++++++++++ locks/unix/proc_mutex.c | 4 +++ 3 files changed, 73 insertions(+) diff --git a/CHANGES b/CHANGES index 912b275f6e2..b427fdea314 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ -*- coding: utf-8 -*- Changes for APR 1.4.0 + *) Use proper return code for fcntl-based apr_proc_mutex_trylock() + on platforms that return EACCES instead of EAGAIN when the lock + is already held (AIX, HP-UX). + [Eric Covener] + *) Make sure WIN32 behaves the same as posix for file backed shared memory by removing the file on cleanup/remove. [Mladen Turk] diff --git a/configure.in b/configure.in index 6b7ce59cfbb..1b688bcf31f 100644 --- a/configure.in +++ b/configure.in @@ -1886,6 +1886,70 @@ case $ac_decision in ;; esac +if test $hasfcntlser = "1"; then +AC_MSG_CHECKING(if fcntl returns EACCES when F_SETLK is already held) +AC_TRY_RUN([ +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_STAT_H +#include +#endif +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#if defined(HAVE_UNISTD_H) +#include +#endif +#include +#include + +int fd; +struct flock proc_mutex_lock_it = {0}; +const char *fname = "conftest.fcntl"; + +int main() +{ + int rc, status;; + proc_mutex_lock_it.l_whence = SEEK_SET; /* from current point */ + proc_mutex_lock_it.l_type = F_WRLCK; /* set exclusive/write lock */ + + fd = creat(fname, S_IRWXU); + unlink(fname); + + if (rc = lockit()) { + exit(-1); + } + + if (fork()) { + wait(&status); + } + else { + return(lockit()); + } + + close(fd); + exit(WEXITSTATUS(status) != EACCES); +} + +int lockit() { + int rc; + do { + rc = fcntl(fd, F_SETLK, &proc_mutex_lock_it); + } while ( rc < 0 && errno == EINTR); + + return (rc < 0) ? errno : 0; +}], [apr_fcntl_tryacquire_eacces=1], [apr_fcntl_tryacquire_eacces=0], [apr_fcntl_tryacquire_eacces=0]) +fi + +if test "$apr_fcntl_tryacquire_eacces" = "1"; then + AC_DEFINE(FCNTL_TRYACQUIRE_EACCES, 1, [Define if fcntl returns EACCES when F_SETLK is already held]) +fi + + AC_SUBST(hasflockser) AC_SUBST(hassysvser) AC_SUBST(hasposixser) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 9358e68e17d..e433230a89e 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -565,7 +565,11 @@ static apr_status_t proc_mutex_fcntl_tryacquire(apr_proc_mutex_t *mutex) rc = fcntl(mutex->interproc->filedes, F_SETLK, &proc_mutex_lock_it); } while (rc < 0 && errno == EINTR); if (rc < 0) { +#if FCNTL_TRYACQUIRE_EACCES + if (errno == EACCES) { +#else if (errno == EAGAIN) { +#endif return APR_EBUSY; } return errno; From 8f639a39d3ccd6ecd38d00202db07a700a5bd621 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Fri, 27 Jun 2008 17:47:28 +0000 Subject: [PATCH 6216/7878] Fix solaris poll bug - ref http://marc.info/?t=121438277000004&r=1&w=2 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@672344 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index 3f1ac245d5d..73d85251141 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -381,7 +381,15 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, if (ret == -1) { (*num) = 0; - rv = apr_get_netos_error(); + if (errno == EINTR) { + rv = APR_EINTR; + } + else if (errno == ETIME) { + rv = APR_TIMEUP; + } + else { + rv = apr_get_netos_error(); + } } else if (nget == 0) { rv = APR_TIMEUP; From ac622589cd19ab37299052e59d792adb7da5b834 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Wed, 9 Jul 2008 08:49:05 +0000 Subject: [PATCH 6217/7878] Rename apr_pool_create_core to apr_pool_create_unmanaged and deprecate the original API git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@675117 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_pools.h | 48 ++++++++++++++++++++++++++++++++++------- memory/unix/apr_pools.c | 43 ++++++++++++++++++++++++++++++++++-- 3 files changed, 84 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index b427fdea314..ed323e68d2d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 1.4.0 + *) Rename apr_pool_create_core to apr_pool_create_unmanaged and + deprecate the old API name. It better reflects the scope and usage + of this function. [Mladen Turk] *) Use proper return code for fcntl-based apr_proc_mutex_trylock() on platforms that return EACCES instead of EAGAIN when the lock diff --git a/include/apr_pools.h b/include/apr_pools.h index eb7c6e5b1f5..d28f6f9afc2 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -190,14 +190,26 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, /** * Create a new pool. + * @deprecated @see apr_pool_create_unmanaged_ex. + */ +APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator); + +/** + * Create a new unmanaged pool. * @param newpool The pool we have just created. * @param abort_fn A function to use if the pool cannot allocate more memory. * @param allocator The allocator to use with the new pool. If NULL the * new allocator will be crated with newpool as owner. + * @remark Unmanaged pool is special pool that does not have parent pool + * and is NOT destroyed upon apr_terminate call. + * It must be explicitly destroyed by calling apr_pool_destroy, + * otherwise the memory will leek. */ -APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator); +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator); /** * Debug version of apr_pool_create_ex. @@ -229,20 +241,29 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, /** * Debug version of apr_pool_create_core_ex. - * @param newpool @see apr_pool_create. - * @param abort_fn @see apr_pool_create. - * @param allocator @see apr_pool_create. + * @deprecated @see apr_pool_create_unmanaged_ex_debug. + */ +APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line); + +/** + * Debug version of apr_pool_create_unmanaged_ex. + * @param newpool @see apr_pool_create_unmanaged. + * @param abort_fn @see apr_pool_create_unmanaged. + * @param allocator @see apr_pool_create_unmanaged. * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. - * Call this directly if you have you apr_pool_create_core_ex + * Call this directly if you have you apr_pool_create_unmanaged_ex * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have * apr_pool_create_core_ex in a wrapper, trust the macro * and don't call apr_pool_create_core_ex_debug directly. */ -APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, const char *file_line); @@ -251,6 +272,11 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, #define apr_pool_create_core_ex(newpool, abort_fn, allocator) \ apr_pool_create_core_ex_debug(newpool, abort_fn, allocator, \ APR_POOL__FILE_LINE__) + +#define apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator) \ + apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, \ + APR_POOL__FILE_LINE__) + #endif /** @@ -281,14 +307,20 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, */ #if defined(DOXYGEN) APR_DECLARE(apr_status_t) apr_pool_create_core(apr_pool_t **newpool); +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool); #else #if APR_POOL_DEBUG #define apr_pool_create_core(newpool) \ apr_pool_create_core_ex_debug(newpool, NULL, NULL, \ APR_POOL__FILE_LINE__) +#define apr_pool_create_unmanaged(newpool) \ + apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \ + APR_POOL__FILE_LINE__) #else #define apr_pool_create_core(newpool) \ apr_pool_create_core_ex(newpool, NULL, NULL) +#define apr_pool_create_unmanaged(newpool) \ + apr_pool_create_unmanaged_ex(newpool, NULL, NULL) #endif #endif diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index c080232e70b..4612f0e634f 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -907,9 +907,18 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, return APR_SUCCESS; } +/* Deprecated. Renamed to apr_pool_create_unmanaged_ex + */ APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator) +{ + return apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator); +} + +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator) { apr_pool_t *pool; apr_memnode_t *node; @@ -1730,6 +1739,15 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, const char *file_line) +{ + return apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, + file_line); +} + +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line) { apr_pool_t *pool; apr_allocator_t *pool_allocator; @@ -2491,7 +2509,15 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, apr_allocator_t *allocator, const char *file_line) { - return apr_pool_create_core_ex(newpool, abort_fn, allocator); + return apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator); +} + +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line) +{ + return apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator); } #else /* APR_POOL_DEBUG */ @@ -2553,7 +2579,20 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator) { - return apr_pool_create_core_ex_debug(newpool, abort_fn, + return apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, + allocator, "undefined"); +} + +#undef apr_pool_create_unmanaged_ex +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator); + +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator) +{ + return apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, "undefined"); } From 33e8fd9d68af25a882eb3e8b3851b32b0d1bcb9f Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 11 Jul 2008 17:51:16 +0000 Subject: [PATCH 6218/7878] Pools: Documentation update. #define tweaks. * include/apr_pools.h (apr_pool_create_unmanaged_ex): Update docstring. Reflow, removing speling error. Word warning stronger. (apr_pool_create_core_ex, apr_pool_create_core): Update #defines to use apr_pool_create_unmanaged instead of the core counterparts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@676037 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index d28f6f9afc2..5f0b3673207 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -200,12 +200,13 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, * Create a new unmanaged pool. * @param newpool The pool we have just created. * @param abort_fn A function to use if the pool cannot allocate more memory. - * @param allocator The allocator to use with the new pool. If NULL the + * @param allocator The allocator to use with the new pool. If NULL a * new allocator will be crated with newpool as owner. - * @remark Unmanaged pool is special pool that does not have parent pool - * and is NOT destroyed upon apr_terminate call. - * It must be explicitly destroyed by calling apr_pool_destroy, - * otherwise the memory will leek. + * @remark An unmanaged pool is a special pool without a parent; it will + * NOT be destroyed upon apr_terminate. It must be explicitly + * destroyed by calling apr_pool_destroy, to prevent memory leaks. + * Use of this function is discouraged, think twice about whether + * you really really need it. */ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, @@ -270,7 +271,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpoo #if APR_POOL_DEBUG #define apr_pool_create_core_ex(newpool, abort_fn, allocator) \ - apr_pool_create_core_ex_debug(newpool, abort_fn, allocator, \ + apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, \ APR_POOL__FILE_LINE__) #define apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator) \ @@ -311,14 +312,14 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool); #else #if APR_POOL_DEBUG #define apr_pool_create_core(newpool) \ - apr_pool_create_core_ex_debug(newpool, NULL, NULL, \ + apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \ APR_POOL__FILE_LINE__) #define apr_pool_create_unmanaged(newpool) \ apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \ APR_POOL__FILE_LINE__) #else #define apr_pool_create_core(newpool) \ - apr_pool_create_core_ex(newpool, NULL, NULL) + apr_pool_create_unmanaged_ex(newpool, NULL, NULL) #define apr_pool_create_unmanaged(newpool) \ apr_pool_create_unmanaged_ex(newpool, NULL, NULL) #endif From c274db37c4488a0ad52961a8a52a1705c823a8ce Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Tue, 15 Jul 2008 06:29:29 +0000 Subject: [PATCH 6219/7878] Intruduce apr_hash_do function git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@676807 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_hash.h | 30 ++++++++++++++++++++++++++++++ tables/apr_hash.c | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) diff --git a/CHANGES b/CHANGES index ed323e68d2d..4ea334673e2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 1.4.0 + *) Intruduce apr_hash_do for iterating over a hash table. + [Mladen Turk] + *) Rename apr_pool_create_core to apr_pool_create_unmanaged and deprecate the old API name. It better reflects the scope and usage of this function. [Mladen Turk] diff --git a/include/apr_hash.h b/include/apr_hash.h index c033ed15a6a..39847c3382f 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -218,6 +218,36 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, const void *data), const void *data); +/** + * Declaration prototype for the iterator callback function of apr_hash_do(). + * + * @param rec The data passed as the first argument to apr_hash_[v]do() + * @param key The key from this iteration of the hash table + * @param klen The key length from this iteration of the hash table + * @param value The value from this iteration of the hash table + * @remark Iteration continues while this callback function returns non-zero. + * To export the callback function for apr_hash_do() it must be declared + * in the _NONSTD convention. + */ +typedef int (apr_hash_do_callback_fn_t)(void *rec, const void *key, + apr_ssize_t klen, + const void *value); + +/** + * Iterate over a hash table running the provided function once for every + * element in the hash table. The @param comp function will be invoked for + * every element in the hash table. + * + * @param comp The function to run + * @param rec The data to pass as the first argument to the function + * @param ht The hash table to iterate over + * @return FALSE if one of the comp() iterations returned zero; TRUE if all + * iterations returned non-zero + * @see apr_hash_do_callback_fn_t + */ +APR_DECLARE(int) apr_hash_do(apr_hash_do_callback_fn_t *comp, + void *rec, const apr_hash_t *ht); + /** * Get a pointer to the pool which the hash table was created in */ diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 4e3723e19f1..6f30b68fc26 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -474,4 +474,37 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, return res; } +/* This is basically the following... + * for every element in hash table { + * comp elemeny.key, element.value + * } + * + * Like with apr_table_do, the comp callback is called for each and every + * element of the hash table. + */ +APR_DECLARE(int) apr_hash_do(apr_hash_do_callback_fn_t *comp, + void *rec, const apr_hash_t *ht) +{ + apr_hash_index_t hix; + apr_hash_index_t *hi; + int rv, dorv = 1; + + hix.ht = (apr_hash_t *)ht; + hix.index = 0; + hix.this = NULL; + hix.next = NULL; + + if ((hi = apr_hash_next(&hix))) { + /* Scan the entire table */ + do { + rv = (*comp)(rec, hi->this->key, hi->this->klen, hi->this->val); + } while ((hi = apr_hash_next(hi))); + + if (rv == 0) { + dorv = 0; + } + } + return dorv; +} + APR_POOL_IMPLEMENT_ACCESSOR(hash) From 3ba01d721cfbcfc31c2ae028088ebcf3a190f1de Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 15 Jul 2008 14:48:28 +0000 Subject: [PATCH 6220/7878] Correct Win9x/ANSI mode flaw uncovered by Friedrich Dominicus . git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@676928 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 76fe42bca89..9e16bc19746 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -195,13 +195,13 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, */ thedir->bof = 0; } - else if (!FindNextFile(thedir->dirhand, thedir->n.entry)) { + else if (!FindNextFileA(thedir->dirhand, thedir->n.entry)) { return apr_get_os_error(); } while (thedir->rootlen && thedir->rootlen + strlen(thedir->n.entry->cFileName) >= MAX_PATH) { - if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) { + if (!FindNextFileA(thedir->dirhand, thedir->n.entry)) { return apr_get_os_error(); } } From 24cb9921cae1c2cf61ab8b4b6f46782eff9efd91 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Tue, 15 Jul 2008 17:55:59 +0000 Subject: [PATCH 6221/7878] Make sure we break when callback returns zero. Thanks Davi git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@676991 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 6f30b68fc26..05ee42f46e6 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -498,12 +498,12 @@ APR_DECLARE(int) apr_hash_do(apr_hash_do_callback_fn_t *comp, /* Scan the entire table */ do { rv = (*comp)(rec, hi->this->key, hi->this->klen, hi->this->val); - } while ((hi = apr_hash_next(hi))); + } while (rv && (hi = apr_hash_next(hi))); if (rv == 0) { dorv = 0; } - } + } return dorv; } From 3434fa7b7b50aa34aa4fbf8aebbd4e97cdc407aa Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 19 Jul 2008 11:53:56 +0000 Subject: [PATCH 6222/7878] Use correct array for pre_cleanups git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@678139 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 4612f0e634f..017dc8781e0 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -2198,8 +2198,8 @@ APR_DECLARE(void) apr_pool_pre_cleanup_register(apr_pool_t *p, const void *data, } c->data = data; c->plain_cleanup_fn = plain_cleanup_fn; - c->next = p->cleanups; - p->cleanups = c; + c->next = p->pre_cleanups; + p->pre_cleanups = c; } } From 835a64df55850a8349c6abfc4708ad763b209646 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Fri, 25 Jul 2008 00:17:04 +0000 Subject: [PATCH 6223/7878] Add apr_file_link() function. PR 44841. Patch by Mark Heily git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@679630 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ file_io/unix/copy.c | 10 ++++++++++ file_io/win32/open.c | 30 ++++++++++++++++++++++++++++++ include/apr_file_io.h | 9 +++++++++ test/testfilecopy.c | 20 ++++++++++++++++++++ 5 files changed, 71 insertions(+) diff --git a/CHANGES b/CHANGES index 4ea334673e2..db89b636fe8 100644 --- a/CHANGES +++ b/CHANGES @@ -26,6 +26,8 @@ Changes for APR 1.4.0 *) Implement apr_proc_wait_all_procs for windows. [Mladen Turk] + *) Add apr_file_link() function. PR 44841 + [Mark Heily ] Changes for APR 1.3.0 diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index 3a1c59a62dd..d8c1702d775 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -116,3 +116,13 @@ APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, perms, pool); } + +APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, + const char *to_path) +{ + if (link(from_path, to_path) == -1) { + return errno; + } + + return APR_SUCCESS; +} diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 5735a4471dc..0d7f0893cc5 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -581,6 +581,36 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, return apr_get_os_error(); } +APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, + const char *to_path) +{ + apr_status_t rv; + +#if APR_HAS_UNICODE_FS + IF_WIN_OS_IS_UNICODE + { + apr_wchar_t wfrom_path[APR_PATH_MAX]; + apr_wchar_t wto_path[APR_PATH_MAX]; + + if (rv = utf8_to_unicode_path(wfrom_path, sizeof(wfrom_path) + / sizeof(apr_wchar_t), from_path)) + return rv; + if (rv = utf8_to_unicode_path(wto_path, sizeof(wto_path) + / sizeof(apr_wchar_t), to_path)) + return rv; + + if (!CreateHardLinkW(wto_path, wfrom_path)) + return apr_get_os_error() + } +#endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI { + if (!CreateHardLinkA(wto_path, wfrom_path)) + return apr_get_os_error() + } +#endif +} + APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) { diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 32a945561ec..5d9f2c7ddfb 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -264,6 +264,15 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_path, apr_pool_t *pool); +/** + * Create a hard link to the specified file. + * @param from_path The full path to the original file (using / on all systems) + * @param to_path The full path to the new file (using / on all systems) + * @remark Both files must reside on the same device. + */ +APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, + const char *to_path); + /** * Copy the specified file to another file. * @param from_path The full path to the original file (using / on all systems) diff --git a/test/testfilecopy.c b/test/testfilecopy.c index 5b64bc0538d..f1a64f1f823 100644 --- a/test/testfilecopy.c +++ b/test/testfilecopy.c @@ -123,6 +123,23 @@ static void append_exist(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } +static void link_existing(abts_case *tc, void *data) +{ + apr_status_t rv; + + rv = apr_file_link("data/file_datafile.txt", "data/file_datafile2.txt"); + apr_file_remove("data/file_datafile2.txt", p); + ABTS_ASSERT(tc, "Couldn't create hardlink to file", rv == APR_SUCCESS); +} + +static void link_nonexisting(abts_case *tc, void *data) +{ + apr_status_t rv; + + rv = apr_file_link("data/does_not_exist.txt", "data/fake.txt"); + ABTS_ASSERT(tc, "", rv != APR_SUCCESS); +} + abts_suite *testfilecopy(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -133,6 +150,9 @@ abts_suite *testfilecopy(abts_suite *suite) abts_run_test(suite, append_nonexist, NULL); abts_run_test(suite, append_exist, NULL); + abts_run_test(suite, link_existing, NULL); + abts_run_test(suite, link_nonexisting, NULL); + return suite; } From 593c44057634a3b061041bd035859959f44a5924 Mon Sep 17 00:00:00 2001 From: "Thomas J. Donovan" Date: Fri, 25 Jul 2008 03:21:54 +0000 Subject: [PATCH 6224/7878] Moved new apr_file_link() function to open.c for all platforms Fixed args & return value for Windows. re: PR 44841 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@679652 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/copy.c | 10 ---------- file_io/unix/open.c | 10 ++++++++++ file_io/win32/open.c | 7 ++++--- test/testfile.c | 19 +++++++++++++++++++ test/testfilecopy.c | 20 -------------------- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index d8c1702d775..3a1c59a62dd 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -116,13 +116,3 @@ APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, perms, pool); } - -APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, - const char *to_path) -{ - if (link(from_path, to_path) == -1) { - return errno; - } - - return APR_SUCCESS; -} diff --git a/file_io/unix/open.c b/file_io/unix/open.c index e84045045e0..898d7c203c6 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -345,3 +345,13 @@ APR_DECLARE(apr_status_t) apr_file_inherit_unset(apr_file_t *thefile) } APR_POOL_IMPLEMENT_ACCESSOR(file) + +APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, + const char *to_path) +{ + if (link(from_path, to_path) == -1) { + return errno; + } + + return APR_SUCCESS; +} diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 0d7f0893cc5..930a0f3f9f9 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -584,7 +584,7 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, const char *to_path) { - apr_status_t rv; + apr_status_t rv = APR_SUCCESS; #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE @@ -599,8 +599,8 @@ APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, / sizeof(apr_wchar_t), to_path)) return rv; - if (!CreateHardLinkW(wto_path, wfrom_path)) - return apr_get_os_error() + if (!CreateHardLinkW(wto_path, wfrom_path, NULL)) + return apr_get_os_error(); } #endif #if APR_HAS_ANSI_FS @@ -609,6 +609,7 @@ APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, return apr_get_os_error() } #endif + return rv; } APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, diff --git a/test/testfile.c b/test/testfile.c index dd1d277bec9..49d9a3ac928 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -71,6 +71,23 @@ static void test_open_read(abts_case *tc, void *data) apr_file_close(filetest); } +static void link_existing(abts_case *tc, void *data) +{ + apr_status_t rv; + + rv = apr_file_link("data/file_datafile.txt", "data/file_datafile2.txt"); + apr_file_remove("data/file_datafile2.txt", p); + ABTS_ASSERT(tc, "Couldn't create hardlink to file", rv == APR_SUCCESS); +} + +static void link_nonexisting(abts_case *tc, void *data) +{ + apr_status_t rv; + + rv = apr_file_link("data/does_not_exist.txt", "data/fake.txt"); + ABTS_ASSERT(tc, "", rv != APR_SUCCESS); +} + static void test_read(abts_case *tc, void *data) { apr_status_t rv; @@ -960,6 +977,8 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_open_excl, NULL); abts_run_test(suite, test_open_read, NULL); abts_run_test(suite, test_open_readwrite, NULL); + abts_run_test(suite, link_existing, NULL); + abts_run_test(suite, link_nonexisting, NULL); abts_run_test(suite, test_read, NULL); abts_run_test(suite, test_readzero, NULL); abts_run_test(suite, test_seek, NULL); diff --git a/test/testfilecopy.c b/test/testfilecopy.c index f1a64f1f823..5b64bc0538d 100644 --- a/test/testfilecopy.c +++ b/test/testfilecopy.c @@ -123,23 +123,6 @@ static void append_exist(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } -static void link_existing(abts_case *tc, void *data) -{ - apr_status_t rv; - - rv = apr_file_link("data/file_datafile.txt", "data/file_datafile2.txt"); - apr_file_remove("data/file_datafile2.txt", p); - ABTS_ASSERT(tc, "Couldn't create hardlink to file", rv == APR_SUCCESS); -} - -static void link_nonexisting(abts_case *tc, void *data) -{ - apr_status_t rv; - - rv = apr_file_link("data/does_not_exist.txt", "data/fake.txt"); - ABTS_ASSERT(tc, "", rv != APR_SUCCESS); -} - abts_suite *testfilecopy(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -150,9 +133,6 @@ abts_suite *testfilecopy(abts_suite *suite) abts_run_test(suite, append_nonexist, NULL); abts_run_test(suite, append_exist, NULL); - abts_run_test(suite, link_existing, NULL); - abts_run_test(suite, link_nonexisting, NULL); - return suite; } From 3026eb89f3ee25e818287fd52ceffaf4a33f4780 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 6 Aug 2008 14:29:12 +0000 Subject: [PATCH 6225/7878] * include/apr_strings.h (apr_pstrcat): Mark with sentinel attribute for GCC >= 4; triggers a compiler warning if the function is called without a final NULL argument. * include/apr_tables.h (apr_table_do): Likewise. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@683278 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 6 +++++- include/apr_tables.h | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index 996f8ceb57e..019017a1d94 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -136,7 +136,11 @@ APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n); * @param ... The strings to concatenate. The final string must be NULL * @return The new string */ -APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...); +APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...) +#if defined(__GNUC__) && __GNUC__ >= 4 + __attribute__((sentinel)) +#endif + ; /** * Concatenate multiple strings specified in a writev-style vector diff --git a/include/apr_tables.h b/include/apr_tables.h index c2cd7413882..aef5c7ba818 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -380,7 +380,11 @@ typedef int (apr_table_do_callback_fn_t)(void *rec, const char *key, * @see apr_table_do_callback_fn_t */ APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, - void *rec, const apr_table_t *t, ...); + void *rec, const apr_table_t *t, ...) +#if defined(__GNUC__) && __GNUC__ >= 4 + __attribute__((sentinel)) +#endif + ; /** * Iterate over a table running the provided function once for every From 647207bde2229d4dbd6399433f125e5060b8f417 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 7 Aug 2008 17:53:39 +0000 Subject: [PATCH 6226/7878] Improve explanations, reference appropriate RFC's and add some exploratory math for the limits. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@683665 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/utf8.c | 59 +++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/misc/win32/utf8.c b/misc/win32/utf8.c index b37dba44dad..280f4064720 100644 --- a/misc/win32/utf8.c +++ b/misc/win32/utf8.c @@ -19,31 +19,32 @@ #include "apr_errno.h" #include "apr_arch_utf8.h" -/* Implement the design principal specified by RFC 2718 2.2.5 - * Guidelines for new URL Schemes - within the APR. +/* Implementation of RFC 3629, "UTF-8, a transformation format of ISO 10646" + * with particular attention to canonical translation forms (see section 10 + * "Security Considerations" of the RFC for more info). * - * Since many architectures support unicode, and UCS2 is the most - * efficient storage used by those archictures, these functions - * exist to validate a UCS string. It is up to the operating system - * to determine the validitity of the string in the context of it's - * native language support. File systems that support filename - * characters of 0x80-0xff but have no support of Unicode will find - * this function useful only for validating the character sequences - * and rejecting poorly encoded strings, if RFC 2718 2.2.5 naming is - * desired. + * Since several architectures including Windows support unicode, with UCS2 + * used as the actual storage conventions by that archicture, these functions + * exist to transform or validate UCS2 strings into APR's 'char' type + * convention. It is left up to the operating system to determine the + * validitity of the string, e.g. normative forms, in the context of + * its native language support. Other file systems which support filename + * characters of 0x80-0xff but have no explicit requirement for Unicode + * will find this function useful only for validating the character sequences + * and rejecting poorly encoded UTF8 sequences. * - * from RFC 2279 UTF-8, a transformation format of ISO 10646 + * Len UCS-4 range (hex) UTF-8 octet sequence (binary) + * 1:2 00000000-0000007F 0xxxxxxx + * 2:2 00000080-000007FF 110XXXXx 10xxxxxx + * 3:2 00000800-0000FFFF 1110XXXX 10Xxxxxx 10xxxxxx + * 4:4 00010000-001FFFFF 11110XXX 10XXxxxx 10xxxxxx 10xxxxxx + * 00200000-03FFFFFF 111110XX 10XXXxxx 10xxxxxx 10xxxxxx 10xxxxxx + * 04000000-7FFFFFFF 1111110X 10XXXXxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx * - * UCS-4 range (hex.) UTF-8 octet sequence (binary) - * 1:2 0000 0000-0000 007F 0xxxxxxx - * 2:2 0000 0080-0000 07FF 110XXXXx 10xxxxxx - * 3:2 0000 0800-0000 FFFF 1110XXXX 10Xxxxxx 10xxxxxx - * 4:4 0001 0000-001F FFFF 11110zXX 10XXxxxx 10xxxxxx 10xxxxxx - * inv 0020 0000-03FF FFFF 111110XX 10XXXxxx 10xxxxxx 10xxxxxx 10xxxxxx - * inv 0400 0000-7FFF FFFF 1111110X 10XXXXxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx + * One of the X bits must be 1 to avoid overlong representation of ucs2 values. * - * One of the X values must be one for the encoding length to be legit. - * Neither the z bit, nor the final two forms, are used for ucs-2 + * For conversion into ucs2, the 4th form is limited in range to 0010 FFFF, + * and the final two forms are used only by full ucs4, per RFC 3629; * * "Pairs of UCS-2 values between D800 and DFFF (surrogate pairs in * Unicode parlance), being actually UCS-4 characters transformed @@ -51,16 +52,20 @@ * must be undone, yielding a UCS-4 character that is then transformed * as above." * - * from RFC2781 UTF-16: the compressed ISO 10646 encoding bitmask + * From RFC2781 UTF-16: the compressed ISO 10646 encoding bitmask * * U' = U - 0x10000 - * U' = 000000000000yyyyyyyyyyxxxxxxxxxx - * W1 = 110110yyyyyyyyyy - * W2 = 110111xxxxxxxxxx + * U' = 00000000 0000yyyy yyyyyyxx xxxxxxxx + * W1 = 110110yy yyyyyyyy + * W2 = 110111xx xxxxxxxx + * Max U' = 0000 00001111 11111111 11111111 + * Max U = 0000 00010000 11111111 11111111 * - * apr_conv_utf8_to_ucs2 out bytes:sizeof(in) * 1 <= Req <= sizeof(in) * 2 + * Len is the table above is a mapping of bytes used for utf8:ucs2 values, + * which results in these conclusions of maximum allocations; * - * apr_conv_ucs2_to_utf8 out words:sizeof(in) / 2 <= Req <= sizeof(in) * 3 / 2 + * apr_conv_utf8_to_ucs2 out bytes:sizeof(in) * 1 <= Req <= sizeof(in) * 2 + * apr_conv_ucs2_to_utf8 out words:sizeof(in) / 2 <= Req <= sizeof(in) * 3 / 2 */ APR_DECLARE(apr_status_t) apr_conv_utf8_to_ucs2(const char *in, From e8c407462921d57a00d35452a39faa8c11344e33 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Fri, 8 Aug 2008 00:12:47 +0000 Subject: [PATCH 6227/7878] Fix APR_PID_T_FMT detection on Solaris. Patch by Rainer Jung . PR 45513. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@683771 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/configure.in b/configure.in index 1b688bcf31f..46b4b32a48d 100644 --- a/configure.in +++ b/configure.in @@ -1345,6 +1345,20 @@ else socklen_t_value="int" fi +APR_CHECK_SIZEOF_EXTENDED([#include ], pid_t, 8) + +if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_short"; then + pid_t_fmt='#define APR_PID_T_FMT "hd"' +elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_int"; then + pid_t_fmt='#define APR_PID_T_FMT "d"' +elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long"; then + pid_t_fmt='#define APR_PID_T_FMT "ld"' +elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long_long"; then + pid_t_fmt='#define APR_PID_T_FMT APR_INT64_T_FMT' +else + pid_t_fmt='#error Can not determine the proper size for pid_t' +fi + # Basically, we have tried to figure out the correct format strings # for APR types which vary between platforms, but we don't always get # it right. @@ -1360,9 +1374,9 @@ case $host in ;; *-solaris*) if test "$ac_cv_sizeof_long" = "8"; then - pid_t_fmt="d" + pid_t_fmt='#define APR_PID_T_FMT "d"' else - pid_t_fmt="ld" + pid_t_fmt='#define APR_PID_T_FMT "ld"' fi ;; *aix4*|*aix5*) @@ -1496,20 +1510,6 @@ if test "$ac_cv_sizeof_long" = "4"; then fi AC_MSG_NOTICE([using $ino_t_value for ino_t]) -APR_CHECK_SIZEOF_EXTENDED([#include ], pid_t, 8) - -if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_short"; then - pid_t_fmt='#define APR_PID_T_FMT "hd"' -elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_int"; then - pid_t_fmt='#define APR_PID_T_FMT "d"' -elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long"; then - pid_t_fmt='#define APR_PID_T_FMT "ld"' -elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long_long"; then - pid_t_fmt='#define APR_PID_T_FMT APR_INT64_T_FMT' -else - pid_t_fmt='#error Can not determine the proper size for pid_t' -fi - # Checks for endianness AC_C_BIGENDIAN if test $ac_cv_c_bigendian = yes; then From 23e0e8856424a67b497c3d1f927011a1db03480e Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Mon, 11 Aug 2008 00:15:24 +0000 Subject: [PATCH 6228/7878] Test for telnet service instead of http (Solaris 8 doesn't have http). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@684616 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testsock.c b/test/testsock.c index 84121449bf5..51a82e41a41 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -88,9 +88,9 @@ static void test_serv_by_name(abts_case *tc, void *data) rv = apr_getservbyname(sa, "complete_and_utter_rubbish"); APR_ASSERT_SUCCESS(tc, "Problem getting non-existent service", !rv); - rv = apr_getservbyname(sa, "http"); - APR_ASSERT_SUCCESS(tc, "Problem getting http service", rv); - ABTS_INT_EQUAL(tc, 80, sa->port); + rv = apr_getservbyname(sa, "telnet"); + APR_ASSERT_SUCCESS(tc, "Problem getting telnet service", rv); + ABTS_INT_EQUAL(tc, 23, sa->port); } static apr_socket_t *setup_socket(abts_case *tc) From bbc88f343f03833b8b984258dffc23fe23670fbf Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 27 Aug 2008 05:27:11 +0000 Subject: [PATCH 6229/7878] Win32: Match the type of our custom iovec's iov_base to match Unix's type. * include/apr_want.h (struct iovec.iov_base): Have our fake iovec structure match the Unix type definition of iov_base by being a void* not a char*. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@689360 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_want.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_want.h b/include/apr_want.h index 1afed3606ea..5df6e884bf2 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -91,7 +91,7 @@ struct iovec { - char *iov_base; + void *iov_base; size_t iov_len; }; From 00fcb6455bb7c5eb92d8a0c850ee27fc4a46b4fa Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 28 Aug 2008 17:09:06 +0000 Subject: [PATCH 6230/7878] Win32: Do not error out on apr_pollset_poll() when there are no sockets. * poll/unix/select.c (apr_pollset_poll): On Win32, short-circuit success if we have no sockets instead of returning an error. * CHANGES: Update. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@689896 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ poll/unix/select.c | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGES b/CHANGES index db89b636fe8..c3256253c6d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 1.4.0 + + *) Win32: Do not error out on apr_pollset_poll() when there are no sockets. + [Justin Erenkrantz] + *) Intruduce apr_hash_do for iterating over a hash table. [Mladen Turk] diff --git a/poll/unix/select.c b/poll/unix/select.c index cf4a50692fa..6115820b9ed 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -453,6 +453,17 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, fd_set readset, writeset, exceptset; apr_status_t rv = APR_SUCCESS; +#ifdef WIN32 + /* On Win32, select() must be presented with at least one socket to + * poll on, or select() will return WSAEINVAL. So, we'll just + * short-circuit and bail now. + */ + if (pollset->nelts == 0) { + (*num) = 0; + return APR_SUCCESS; + } +#endif + if (timeout < 0) { tvptr = NULL; } From 96f6fcb1f54948e6d3b38e43f9fd50a9752ff9b7 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 30 Aug 2008 18:26:56 +0000 Subject: [PATCH 6231/7878] Update the RPM spec file to depend on the bzip2 binary instead of the gzip binary. Include the formal path to the source, to match the Fedora spec file. The build depends on python. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@690542 13f79535-47bb-0310-9956-ffa450edef68 --- build/rpm/apr.spec.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/rpm/apr.spec.in b/build/rpm/apr.spec.in index 7b1668c8fe7..768e9fe717a 100644 --- a/build/rpm/apr.spec.in +++ b/build/rpm/apr.spec.in @@ -8,9 +8,9 @@ Release: APR_RELEASE License: Apache Software License Group: System Environment/Libraries URL: http://apr.apache.org/ -Source0: %{name}-%{version}.tar.gz +Source0: http://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot -BuildPrereq: autoconf, libtool, doxygen +BuildPrereq: autoconf, libtool, doxygen, python %description The mission of the Apache Portable Runtime (APR) is to provide a @@ -88,6 +88,10 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/apr-%{aprver}/*.h %changelog +* Sat Aug 30 2008 Graham Leggett 1.3.3 +- update to depend on the bzip2 binary +- build depends on python + * Tue Jun 22 2004 Graham Leggett 1.0.0-1 - update to support v1.0.0 of APR From ccb4ba2864f394d542c64c0ec6f13bbb7820fc87 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 22 Sep 2008 18:32:25 +0000 Subject: [PATCH 6232/7878] * apr_lib.h (apr_vformatter): Leave a breadcrumb in the docs that it is okay to depend on %%pA, %%pI, %%pT, and %%pp from APR 1.0+ (and 0.9.x too). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@697934 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index e09122e70a9..8c0fea74bd8 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -125,9 +125,10 @@ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); * %%pF same as above, but takes a apr_off_t * * %%pS same as above, but takes a apr_size_t * * + * %%pA, %%pI, %%pT, %%pp are available from APR 1.0.0 onwards (and in 0.9.x). * %%pt is only available from APR 1.2.0 onwards. * %%pm, %%pB, %%pF and %%pS are only available from APR 1.3.0 onwards. - * + * * The %%p hacks are to force gcc's printf warning code to skip * over a pointer argument without complaining. This does * mean that the ANSI-style %%p (output a void * in hex format) won't From 03b04af5f1c1b2a998f3f7ef7db1352e1c036f87 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 3 Oct 2008 14:36:40 +0000 Subject: [PATCH 6233/7878] "make testall" does not build the support programs (readchild, mod_test.la, ...) causing testdso and testflock to fail and testpipe to hang. type less, accomplish more... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@701392 13f79535-47bb-0310-9956-ffa450edef68 --- test/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/README b/test/README index d1c4feab082..408a6a22ed8 100644 --- a/test/README +++ b/test/README @@ -53,7 +53,7 @@ Building the full driver All you need to do to build the full driver is run: - make testall + make To run it, run: From de83f2332e3f5076151ccc9ab66dc233d3ddefd0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 20 Oct 2008 23:35:03 +0000 Subject: [PATCH 6234/7878] A new macro for apr 1.4/2.0, for msec resolution. - apr_time_from_sec((apr_time_t)ms / 1000) is clumsy to write git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@706458 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/apr_time.h b/include/apr_time.h index 253aa72b4ad..6dd70cc8d01 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -72,7 +72,10 @@ typedef apr_int32_t apr_short_interval_time_t; /** @return apr_time_t as a msec */ #define apr_time_as_msec(time) ((time) / 1000) -/** @return a second as an apr_time_t */ +/** @return milliseconds as an apr_time_t */ +#define apr_time_from_msec(msec) ((apr_time_t)(msec) * 1000) + +/** @return seconds as an apr_time_t */ #define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC) /** @return a second and usec combination as an apr_time_t */ From d33c5b0de041850ad1ea9b8cf3afbc5064e71d5d Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Mon, 10 Nov 2008 08:42:32 +0000 Subject: [PATCH 6235/7878] Fix apr_tokenize_to_argv parsing. PR 46128. Patch by Edward Rudd git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@712627 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_cpystrn.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index 888b2e5db6a..6311c29f3bf 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -114,8 +114,7 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, */ #define DETERMINE_NEXTSTRING(cp,isquoted) \ for ( ; *cp != '\0'; cp++) { \ - if ( (isquoted && (*cp == ' ' || *cp == '\t')) \ - || (*cp == '\\' && (*(cp+1) == ' ' || *(cp+1) == '\t' || \ + if ( (*cp == '\\' && (*(cp+1) == ' ' || *(cp+1) == '\t' || \ *(cp+1) == '"' || *(cp+1) == '\''))) { \ cp++; \ continue; \ From 4da73e652a30625df44c0aecf36f1c1e1185c99f Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 10 Nov 2008 15:20:02 +0000 Subject: [PATCH 6236/7878] Fix a bug with the APR_DELONCLOSE flag. Child processes were (also) unlinking the file. Badness ensued. * file_io/unix/open.c: (file_cleanup): add new parameter to tell whether the function was invoked by the child's cleanup, or the regular cleanup. use it to determine whether to unlink the file. (apr_unix_file_cleanup, apr_unix_child_file_cleanup): pass appropriate value to file_cleanup(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@712674 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 898d7c203c6..a4dce36aed6 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -26,13 +26,15 @@ #include "fsio.h" #endif -static apr_status_t file_cleanup(apr_file_t *file) +static apr_status_t file_cleanup(apr_file_t *file, int is_child) { apr_status_t rv = APR_SUCCESS; if (close(file->filedes) == 0) { file->filedes = -1; - if (file->flags & APR_DELONCLOSE) { + + /* Only the parent process should delete the file! */ + if (!is_child && (file->flags & APR_DELONCLOSE)) { unlink(file->fname); } #if APR_HAS_THREADS @@ -68,14 +70,14 @@ apr_status_t apr_unix_file_cleanup(void *thefile) flush_rv = apr_file_flush(file); } - rv = file_cleanup(file); + rv = file_cleanup(file, 0); return rv != APR_SUCCESS ? rv : flush_rv; } apr_status_t apr_unix_child_file_cleanup(void *thefile) { - return file_cleanup(thefile); + return file_cleanup(thefile, 1); } APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, From c6ac677e489cfc8223b805feb218287cbd4bbad5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 21 Nov 2008 19:52:44 +0000 Subject: [PATCH 6237/7878] As I had gone ahead and built this table as part of another exercise, it seems worth depositing it here, although the list is redundant for our purposes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@719690 13f79535-47bb-0310-9956-ffa450edef68 --- test/internal/testucs.c | 47 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/test/internal/testucs.c b/test/internal/testucs.c index abfa21218d5..4dc74dae853 100644 --- a/test/internal/testucs.c +++ b/test/internal/testucs.c @@ -22,11 +22,56 @@ struct testval { unsigned char n[8]; - wchar_t w[4]; int nl; + wchar_t w[4]; int wl; }; +/* For reference; a table of invalid utf-8 encoded ucs-2/ucs-4 sequences. + * The table consists of start, end pairs for all invalid ranges. + * NO_UCS2_PAIRS will pass the reservered D800-DFFF values, halting at FFFF + * FULL_UCS4_MAPPER represents all 31 bit values to 7FFF FFFF + * + * We already tested these, because we ensure there is a 1:1 mapping across + * the entire range of byte values in each position of 1 to 6 byte sequences. + */ +struct testval malformed[] = [ + [[0x80,], 1,], /* 10000000 64 invalid leading continuation values */ + [[0xBF,], 1,], /* 10111111 64 invalid leading continuation values */ + [[0xC0,0x80], 2,], /* overshort mapping of 0000 */ + [[0xC1,0xBF], 2,], /* overshort mapping of 007F */ + [[0xE0,0x80,0x80,], 3,], /* overshort mapping of 0000 */ + [[0xE0,0x9F,0xBF,], 3,], /* overshort mapping of 07FF */ +#ifndef NO_UCS2_PAIRS + [[0xED,0xA0,0x80,], 3,], /* unexpected mapping of UCS-2 literal D800 */ + [[0xED,0xBF,0xBF,], 3,], /* unexpected mapping of UCS-2 literal DFFF */ +#endif + [[0xF0,0x80,0x80,0x80,], 4,], /* overshort mapping of 0000 */ + [[0xF0,0x8F,0xBF,0xBF,], 4,], /* overshort mapping of FFFF */ +#ifdef NO_UCS2_PAIRS + [[0xF0,0x90,0x80,0x80,], 4,], /* invalid too large value 0001 0000 */ + [[0xF4,0x8F,0xBF,0xBF,], 4,], /* invalid too large value 0010 FFFF */ +#endif +#ifndef FULL_UCS4_MAPPER + [[0xF4,0x90,0x80,0x80,], 4,], /* invalid too large value 0011 0000 */ + [[0xF7,0xBF,0xBF,0xBF,], 4,], /* invalid too large value 001F FFFF */ +#endif + [[0xF8,0x80,0x80,0x80,0x80,], 5,], /* overshort mapping of 0000 0000 */ + [[0xF8,0x87,0xBF,0xBF,0xBF,], 5,], /* overshort mapping of 001F FFFF */ +#ifndef FULL_UCS4_MAPPER + [[0xF8,0x88,0x80,0x80,0x80,], 5,], /* invalid too large value 0020 0000 */ + [[0xFB,0xBF,0xBF,0xBF,0xBF,], 5,], /* invalid too large value 03FF FFFF */ +#endif + [[0xFC,0x80,0x80,0x80,0x80,0x80,], 6,], /* overshort mapping 0000 0000 */ + [[0xFC,0x83,0xBF,0xBF,0xBF,0xBF,], 6,], /* overshort mapping 03FF FFFF */ +#ifndef FULL_UCS4_MAPPER + [[0xFC,0x84,0x80,0x80,0x80,0x80,], 6,], /* overshort mapping 0400 0000 */ + [[0xFD,0xBF,0xBF,0xBF,0xBF,0xBF,], 6,], /* overshort mapping 7FFF FFFF */ +#endif + [[0xFE,], 1,], /* 11111110 invalid "too large" value, no 7 byte seq */ + [[0xFF,], 1,], /* 11111111 invalid "too large" value, no 8 byte seq */ +]; + void displaynw(struct testval *f, struct testval *l) { char x[80], *t = x; From 608635cc637ab229929e66816b4187bbe5c22916 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 22 Nov 2008 01:22:25 +0000 Subject: [PATCH 6238/7878] always include ws2 headers before attempting to pick up winsock (in fact, that later include is a no-op, but this patch is only trying to ensure we have all of the ws2 defs and none of the headaches.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@719778 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index d391ca2acdc..0370b0726f7 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -98,8 +98,8 @@ #define SW_HIDE 0 #ifndef _WIN32_WCE #include -#include #include +#include #include #else #include From 17f6ece9934b97c69a0afc17fc9f8994058147bb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 23 Nov 2008 22:19:57 +0000 Subject: [PATCH 6239/7878] Clear up this wording a bit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@720054 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index e963e9aa345..25034571ea9 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -102,8 +102,8 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, return stat; } - /* Use 0 for Thread Stack Size, because that will default the stack to the - * same size as the calling thread. + /* Use 0 for default Thread Stack Size, because that will + * default the stack to the same size as the calling thread. */ #ifndef _WIN32_WCE if ((handle = (HANDLE)_beginthreadex(NULL, From c294f50ec2c9c74013d230b436138b22aa404a70 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 25 Nov 2008 00:18:59 +0000 Subject: [PATCH 6240/7878] Export the ldap functions table for netware git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@720362 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index c4a0dcf7eb0..cb3b17caee3 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -259,6 +259,7 @@ endif # FILES_nlm_exports = \ @aprlib.imp \ + apr__ldap_fns \ $(EOLIST) # From b9e716ae9f58ee6217e2fb9fe7fee5c21a68eb4c Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 25 Nov 2008 18:13:33 +0000 Subject: [PATCH 6241/7878] Revert the export of the ldap function table. Netware will just turn off the dso build for apu. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@720557 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 - 1 file changed, 1 deletion(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index cb3b17caee3..c4a0dcf7eb0 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -259,7 +259,6 @@ endif # FILES_nlm_exports = \ @aprlib.imp \ - apr__ldap_fns \ $(EOLIST) # From 3207a5b864375765f7dc64b2f97f9e241df77a80 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Fri, 5 Dec 2008 05:29:05 +0000 Subject: [PATCH 6242/7878] jlibtool: Eat the '-release $someNumber' params that libtool 'supports' and we use in apr-util (why?) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@723590 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/jlibtool.c b/build/jlibtool.c index 9bed6bd2a66..3db1efcd548 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -1536,6 +1536,10 @@ void parse_args(int argc, char *argv[], command_t *cmd_data) /* Skip the argument. */ ++a; argused = 1; + } else if (strcmp(arg+1, "release") == 0) { + /* Skip the argument. */ + ++a; + argused = 1; } else if (strcmp(arg+1, "undefined") == 0) { cmd_data->undefined_flag = argv[++a]; argused = 1; From 43f30d6b639b5e8828dabfb35910b9b483c798aa Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Tue, 16 Dec 2008 14:02:19 +0000 Subject: [PATCH 6243/7878] * Similar to apr_strtoff reset errno to zero in apr_strtoi64. Cases were observed where apr_strtoi64 returned with a previously set errno although the operation worked fine. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@727052 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_strings.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/strings/apr_strings.c b/strings/apr_strings.c index ec687913c53..d20004eadae 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -245,6 +245,7 @@ APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *nptr, APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) { #ifdef APR_INT64_STRFN + errno = 0; return APR_INT64_STRFN(nptr, endptr, base); #else const char *s; @@ -253,6 +254,7 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) int neg, any; char c; + errno = 0; /* * Skip white space and pick up leading +/- sign if any. * If base is 0, allow 0x for hex and 0 for octal, else From 79dfd9a00648634e343ae0770416cca65ed54eba Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 3 Jan 2009 17:51:09 +0000 Subject: [PATCH 6244/7878] document paths/revs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@731043 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index fab6c40fdb5..be2e55af0bd 100644 --- a/STATUS +++ b/STATUS @@ -2,7 +2,8 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*- coding: utf-8 -*- Last modified at [$Date$] Releases: - 1.4.0 : in development on trunk/ + 2.0.0 : in development on trunk/ + 1.4.0 : in development on branches/1.4.x/ 1.3.1 : in maintenance on branches/1.3.x/ 1.3.0 : released June 3, 2008 1.2.12 : released November 25, 2007 From feb295feac218b48c7374b92ebfd71d9528148a2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 3 Jan 2009 17:54:15 +0000 Subject: [PATCH 6245/7878] current revisions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@731046 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index be2e55af0bd..3bffdef6e9d 100644 --- a/STATUS +++ b/STATUS @@ -4,7 +4,10 @@ Last modified at [$Date$] Releases: 2.0.0 : in development on trunk/ 1.4.0 : in development on branches/1.4.x/ - 1.3.1 : in maintenance on branches/1.3.x/ + 1.3.4 : in development on branches/1.3.x/ + 1.3.3 : released August 14, 2008 + 1.3.2 : released June 23, 2008 + 1.3.1 : not released 1.3.0 : released June 3, 2008 1.2.12 : released November 25, 2007 1.2.11 : released September 6, 2007 From 1e105fc3f59203b72abeffbb09cc91e814ffb873 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 3 Jan 2009 17:55:54 +0000 Subject: [PATCH 6246/7878] missed 0.9.17 rel git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@731049 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 3bffdef6e9d..7b900552305 100644 --- a/STATUS +++ b/STATUS @@ -27,7 +27,8 @@ Releases: 1.1.0 : released January 25, 2005 1.0.1 : released November 19, 2004 1.0.0 : released September 1, 2004 - 0.9.17 : in maintenance + 0.9.18 : in maintenance + 0.9.17 : released November 25, 2007 0.9.16 : released September 6, 2007 0.9.15 : not released 0.9.14 : tagged June 4, 2007 From 73a7c852288b781d906737464641c885810aa984 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 3 Jan 2009 18:01:43 +0000 Subject: [PATCH 6247/7878] we are at 2.0.0-dev on trunk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@731056 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_version.h b/include/apr_version.h index 4bbdf139b98..c3a52500912 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -47,13 +47,13 @@ * programs such as structure size changes. No binary compatibility is * possible across a change in the major version. */ -#define APR_MAJOR_VERSION 1 +#define APR_MAJOR_VERSION 2 /** minor version * Minor API changes that do not cause binary compatibility problems. * Reset to 0 when upgrading APR_MAJOR_VERSION */ -#define APR_MINOR_VERSION 4 +#define APR_MINOR_VERSION 0 /** patch level * The Patch Level never includes API changes, simply bug fixes. From 7659269d4fc89d4dbc8c5f7f090e8dfa620ebaba Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 3 Jan 2009 23:01:11 +0000 Subject: [PATCH 6248/7878] A very basic scons based build that barely works on Darwin. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@731120 13f79535-47bb-0310-9956-ffa450edef68 --- SConstruct | 48 +++++++++++++++++++++ build/__init__.py | 1 + build/aprenv.py | 103 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 SConstruct create mode 100644 build/__init__.py create mode 100644 build/aprenv.py diff --git a/SConstruct b/SConstruct new file mode 100644 index 00000000000..9878f398cd6 --- /dev/null +++ b/SConstruct @@ -0,0 +1,48 @@ +#!/usr/bin/env scons +# + +from build import APREnv + +EnsureSConsVersion(1, 1, 0) + +vars = Variables('build.py') + +vars.Add('maintainer_mode', 'Turn on debugging and compile time warnings', 0) +vars.Add('profile', 'Turn on profiling for the build (GCC)', 0) +vars.Add(EnumVariable('pool_debug', 'Turn on pools debugging', 'no', + allowed_values=('yes', 'no', 'verbose', 'verbose-alloc', 'lifetime', 'owner', 'all'))) + +env = APREnv(args=ARGUMENTS, variables=vars) + +Help(vars.GenerateHelpText(env)) + +env.APRHints() + +env.APRAutoconf() + +if env['maintainer_mode']: + if env.is_gcc(): + env.AppendUnique(CPPFLAGS = ['-g', '-Wall', '-Wmissing-prototypes', '-Wstrict-prototypes', '-Wmissing-declarations']) + +if env['profile']: + env.Filter(CPPFLAGS = '-g') + env.AppendUnique(CPPFLAGS = ['-pg']) + +if env['pool_debug'] != 'no': + flags = {'yes': 1, + 'verbose': 2, + 'lifetime': 4, + 'owner': 8, + 'verbose-alloc': 16, + 'all': 31} + env.AppendUnique(CPPFLAGS = "-DAPR_POOL_DEBUG=%d" % flags[env['pool_debug']]) + +files = env.core_lib_files() + +(major, minor, patch) = env.APRVersion() + +libapr = env.SharedLibrary('apr-%d' % (major), files) + +targets = [libapr] + +env.Default(targets) diff --git a/build/__init__.py b/build/__init__.py new file mode 100644 index 00000000000..b03ce7247f7 --- /dev/null +++ b/build/__init__.py @@ -0,0 +1 @@ +from aprenv import * diff --git a/build/aprenv.py b/build/aprenv.py new file mode 100644 index 00000000000..66fd99ca51d --- /dev/null +++ b/build/aprenv.py @@ -0,0 +1,103 @@ +# +# + +from SCons.Environment import Environment +from os.path import join as pjoin +import re +import os + + +_platforms = [ 'aix', 'beos', 'netware', 'os2', 'os390', 'unix', 'win32' ] + +_platform_dirs = ['atomic', + 'dso', + 'file_io', + 'helpers', + 'locks', + 'memory', + 'misc', + 'mmap', + 'network_io', + 'passwd', + 'poll', + 'random', + 'shmem', + 'strings', + 'support', + 'tables', + 'threadproc', + 'time', + 'user'] + +_simple_dirs = ['tables', 'strings'] + +class APREnv(Environment): + def __init__(self, parent=None, args=None, **kw): + Environment.__init__(self, ENV=os.environ, **kw) + + # See SCons/Platform/__init__.py for possible values + if self['PLATFORM'] in _platforms: + self['APR_PLATFORM'] = self['PLATFORM'] + else: + self['APR_PLATFORM'] = 'unix' + + # if no *.c files are found in the original APR_PLATFORM, we switch to + # using this fallback platform. + self['APR_FALLBACK_PLATFORM'] = 'unix' + + self.AppendUnique(CPPPATH = ['include', 'include/arch/'+self['APR_PLATFORM']]) + + def is_gcc(self): + # TOOD: This detection should be smarter, need look at SCons Internals + # for how it works/base it on the Tool selection. + return self['CC'] == 'gcc' + + def core_lib_files(self): + rv = [] + for d in _platform_dirs: + p = pjoin(d, self['APR_PLATFORM'], '*.c') + files = self.Glob(p) + if not files and self['APR_PLATFORM'] != self['APR_FALLBACK_PLATFORM']: + p = pjoin(d, self['APR_FALLBACK_PLATFORM'], '*.c') + files = self.Glob(p) + rv.extend(files) + + for d in _simple_dirs: + p = pjoin(d, '*.c') + files = self.Glob(p) + rv.extend(files) + return rv + + def APRVersion(self): + if not self.has_key('APR_VERSION'): + self['APR_VERSION'] = self.read_version('APR', 'include/apr_version.h') + return self['APR_VERSION'] + + def read_version(self, prefix, path): + version_re = re.compile("(.*)%s_(?PMAJOR|MINOR|PATCH)_VERSION(\s+)(?P\d)(.*)" % prefix) + versions = {} + fp = open(path, 'rb') + for line in fp.readlines(): + m = version_re.match(line) + if m: + versions[m.group('id')] = int(m.group('num')) + fp.close() + return (versions['MAJOR'], versions['MINOR'], versions['PATCH']) + + def Filter(self, **kw): + for k in kw.keys(): + self[k] = [x for x in self[k] if x is not kw[k]] + + def APRHints(self): + # TOOD: port more from apr_hints.m4 + if self['PLATFORM'] == 'darwin': + self.AppendUnique(CPPFLAGS=['-DDARWIN', '-DSIGPROCMASK_SETS_THREAD_MASK', '-no-cpp-precomp']) + + def APRAutoconf(self): + if self.GetOption('clean'): + return + + # TODO Port header detection here etc + conf = self.Configure() + conf.Finish() + From 9b11cdc10e97b30a4b494026f3fe361349621c7a Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sat, 3 Jan 2009 23:30:36 +0000 Subject: [PATCH 6249/7878] Port the atomic detection program, and generate apr_private.h (though the build doesn't work now) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@731125 13f79535-47bb-0310-9956-ffa450edef68 --- SConstruct | 2 +- build/aprenv.py | 66 +++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 62 insertions(+), 6 deletions(-) diff --git a/SConstruct b/SConstruct index 9878f398cd6..c9eca9a7973 100644 --- a/SConstruct +++ b/SConstruct @@ -18,7 +18,7 @@ Help(vars.GenerateHelpText(env)) env.APRHints() -env.APRAutoconf() +env = env.APRAutoconf() if env['maintainer_mode']: if env.is_gcc(): diff --git a/build/aprenv.py b/build/aprenv.py index 66fd99ca51d..94a07448cee 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -5,7 +5,7 @@ from os.path import join as pjoin import re import os - +import traceback _platforms = [ 'aix', 'beos', 'netware', 'os2', 'os390', 'unix', 'win32' ] @@ -93,11 +93,67 @@ def APRHints(self): if self['PLATFORM'] == 'darwin': self.AppendUnique(CPPFLAGS=['-DDARWIN', '-DSIGPROCMASK_SETS_THREAD_MASK', '-no-cpp-precomp']) + + def Check_apr_atomic_builtins(self, context): + context.Message('Checking whether the compiler provides atomic builtins...') + source = """ +int main() +{ + unsigned long val = 1010, tmp, *mem = &val; + + if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020) + return 1; + + tmp = val; + + if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010) + return 1; + + if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0) + return 1; + + tmp = 3030; + + if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp) + return 1; + + if (__sync_lock_test_and_set(&val, 4040) != 3030) + return 1; + + mem = &tmp; + + if (__sync_val_compare_and_swap(&mem, &tmp, &val) != &tmp) + return 1; + + __sync_synchronize(); + + if (mem != &val) + return 1; + + return 0; +} + """ + result = context.TryLink(source, '.c') + context.Result(result) + return result + + def critical(self, f, *args): + rv = f(*args) + + if not rv: + traceback.print_stack() + print "Critial Test failed." + self.Exit(1) + def APRAutoconf(self): - if self.GetOption('clean'): - return + if self.GetOption('clean') or self.GetOption('help'): + return self # TODO Port header detection here etc - conf = self.Configure() - conf.Finish() + conf = self.Configure(custom_tests = {'Check_apr_atomic_builtins': self.Check_apr_atomic_builtins}, + config_h = 'include/arch/%s/apr_private.h' % (self['APR_PLATFORM'])) + + if conf.Check_apr_atomic_builtins(): + conf.Define('HAVE_ATOMIC_BUILTINS', 1) + return conf.Finish() From c320b1a6653f4a2abe33a9ecdca392857116e173 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 4 Jan 2009 01:46:00 +0000 Subject: [PATCH 6250/7878] More SCons: - Generate include/apr.h - 64bit type detection - Test for many standard headers - Start Large file tests git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@731155 13f79535-47bb-0310-9956-ffa450edef68 --- SConstruct | 1 + build/aprenv.py | 258 ++++++++++++++++++++++++++++++++++++++++++++++-- build/subst.py | 68 +++++++++++++ 3 files changed, 319 insertions(+), 8 deletions(-) create mode 100644 build/subst.py diff --git a/SConstruct b/SConstruct index c9eca9a7973..0f914ef5f2d 100644 --- a/SConstruct +++ b/SConstruct @@ -9,6 +9,7 @@ vars = Variables('build.py') vars.Add('maintainer_mode', 'Turn on debugging and compile time warnings', 0) vars.Add('profile', 'Turn on profiling for the build (GCC)', 0) +vars.Add('lfs', 'Large file support on 32-bit platforms', 1) vars.Add(EnumVariable('pool_debug', 'Turn on pools debugging', 'no', allowed_values=('yes', 'no', 'verbose', 'verbose-alloc', 'lifetime', 'owner', 'all'))) diff --git a/build/aprenv.py b/build/aprenv.py index 94a07448cee..0b1a5231124 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -33,7 +33,10 @@ class APREnv(Environment): def __init__(self, parent=None, args=None, **kw): - Environment.__init__(self, ENV=os.environ, **kw) + Environment.__init__(self, ENV=os.environ, + tools = ['default', 'subst'], + toolpath = [pjoin(os.getcwd(), 'build')], + **kw) # See SCons/Platform/__init__.py for possible values if self['PLATFORM'] in _platforms: @@ -95,7 +98,7 @@ def APRHints(self): def Check_apr_atomic_builtins(self, context): - context.Message('Checking whether the compiler provides atomic builtins...') + context.Message('Checking whether the compiler provides atomic builtins... ') source = """ int main() { @@ -133,10 +136,62 @@ def Check_apr_atomic_builtins(self, context): return 0; } """ - result = context.TryLink(source, '.c') - context.Result(result) - return result - + result = context.TryRun(source, '.c') + context.Result(result[0]) + return result[0] + + def Check_apr_largefile64(self, context): + context.Message('Checking whether to enable -D_LARGEFILE64_SOURCE... ') + self.AppendUnique(CPPFLAGS = '-D_LARGEFILE64_SOURCE') + source = """ +#include +#include +#include +#include +#include +#include + +void main(void) +{ + int fd, ret = 0; + struct stat64 st; + off64_t off = 4242; + + if (sizeof(off64_t) != 8 || sizeof(off_t) != 4) + exit(1); + if ((fd = open("conftest.lfs", O_LARGEFILE|O_CREAT|O_WRONLY, 0644)) < 0) + exit(2); + if (ftruncate64(fd, off) != 0) + ret = 3; + else if (fstat64(fd, &st) != 0 || st.st_size != off) + ret = 4; + else if (lseek64(fd, off, SEEK_SET) != off) + ret = 5; + else if (close(fd) != 0) + ret = 6; + else if (lstat64("conftest.lfs", &st) != 0 || st.st_size != off) + ret = 7; + else if (stat64("conftest.lfs", &st) != 0 || st.st_size != off) + ret = 8; + unlink("conftest.lfs"); + + exit(ret); +} + """ + result = context.TryRun(source, '.c') + self.Filter(CPPFLAGS = '-D_LARGEFILE64_SOURCE') + context.Result(result[0]) + return result[0] + + def critical_value(self, f, value, *args): + rv = f(*args) + + if rv != value: + traceback.print_stack() + print "Critial Test failed." + self.Exit(1) + return rv + def critical(self, f, *args): rv = f(*args) @@ -146,14 +201,201 @@ def critical(self, f, *args): self.Exit(1) def APRAutoconf(self): + subst = {} + if self.GetOption('clean') or self.GetOption('help'): return self - # TODO Port header detection here etc - conf = self.Configure(custom_tests = {'Check_apr_atomic_builtins': self.Check_apr_atomic_builtins}, + conf = self.Configure(custom_tests = { + 'Check_apr_atomic_builtins': self.Check_apr_atomic_builtins, + 'Check_apr_largefile64': self.Check_apr_largefile64, + }, config_h = 'include/arch/%s/apr_private.h' % (self['APR_PLATFORM'])) + # Do we have a working C Compiler? + self.critical(conf.CheckCC) + flag_headers = self.Split("""ByteOrder.h + conio.h + crypt.h + ctype.h + dir.h + dirent.h + dl.h + dlfcn.h + errno.h + fcntl.h + grp.h + io.h + limits.h + mach-o/dyld.h + malloc.h + memory.h + netdb.h + osreldate.h + poll.h + process.h + pwd.h + semaphore.h + signal.h + stdarg.h + stddef.h + stdio.h + stdlib.h + string.h + strings.h + sysapi.h + sysgtime.h + termios.h + time.h + tpfeq.h + tpfio.h + unistd.h + unix.h + windows.h + winsock2.h + arpa/inet.h + kernel/OS.h + net/errno.h + netinet/in.h + netinet/sctp.h + netinet/tcp.h + netinet/sctp_uio.h + sys/file.h + sys/ioctl.h + sys/mman.h + sys/param.h + sys/poll.h + sys/resource.h + sys/select.h + sys/sem.h + sys/sendfile.h + sys/signal.h + sys/socket.h + sys/sockio.h + sys/stat.h + sys/sysctl.h + sys/syslimits.h + sys/time.h + sys/types.h + sys/uio.h + sys/un.h + sys/wait.h + pthread.h + """) + for x in flag_headers: + s = x.replace('/', '_').replace('.', '').replace('-', '') + if conf.CheckCHeader(x): + subst['@%s@' % (s)] = 1 + else: + subst['@%s@' % (s)] = 0 + + + sizeof_char = conf.CheckTypeSize('char') + sizeof_int = conf.CheckTypeSize('int') + sizeof_long = conf.CheckTypeSize('long') + sizeof_short = self.critical_value(conf.CheckTypeSize, 2, 'short') + sizeof_long_long = conf.CheckTypeSize('long long') + sizeof_longlong = conf.CheckTypeSize('longlong') + sizeof_pid_t = conf.CheckTypeSize('pid_t', includes='#include ') + sizeof_off_t = conf.CheckTypeSize('off_t', includes='#include ') + sizeof_size_t = conf.CheckTypeSize('size_t') + + # Now we need to find what apr_int64_t (sizeof == 8) will be. + # The first match is our preference. + if sizeof_int == 8: + subst['@int64_literal@'] = '#define APR_INT64_C(val) (val)' + subst['@uint64_literal@'] = '#define APR_UINT64_C(val) (val##U)' + subst['@int64_t_fmt@'] = '#define APR_INT64_T_FMT "d"' + subst['@uint64_t_fmt@'] = '#define APR_UINT64_T_FMT "u"' + subst['@uint64_t_hex_fmt@'] = '#define APR_UINT64_T_HEX_FMT "x"' + subst['@int64_value@'] = 'int' + subst['@long_value@'] = 'int' + subst['@int64_strfn=@'] = 'strtoi' + elif sizeof_long == 8: + subst['@int64_literal@'] = '#define APR_INT64_C(val) (val##L)' + subst['@uint64_literal@'] = '#define APR_UINT64_C(val) (val##UL)' + subst['@int64_t_fmt@'] = '#define APR_INT64_T_FMT "ld"' + subst['@uint64_t_fmt@'] = '#define APR_UINT64_T_FMT "lu"' + subst['@uint64_t_hex_fmt@'] = '#define APR_UINT64_T_HEX_FMT "lx"' + subst['@int64_value@'] = 'long' + subst['@long_value@'] = 'long' + subst['@int64_strfn=@'] = 'strtol' + elif sizeof_long_long == 8: + subst['@int64_literal@'] = '#define APR_INT64_C(val) (val##LL)' + subst['@uint64_literal@'] = '#define APR_UINT64_C(val) (val##ULL)' + # Linux, Solaris, FreeBSD all support ll with printf. + # BSD 4.4 originated 'q'. Solaris is more popular and + # doesn't support 'q'. Solaris wins. Exceptions can + # go to the OS-dependent section. + subst['@int64_t_fmt@'] = '#define APR_INT64_T_FMT "lld"' + subst['@uint64_t_fmt@'] = '#define APR_UINT64_T_FMT "llu"' + subst['@uint64_t_hex_fmt@'] = '#define APR_UINT64_T_HEX_FMT "llx"' + subst['@int64_value@'] = 'long long' + subst['@long_value@'] = 'long long' + subst['@int64_strfn=@'] = 'strtoll' + elif sizeof_longlong == 8: + subst['@int64_literal@'] = '#define APR_INT64_C(val) (val##LL)' + subst['@uint64_literal@'] = '#define APR_UINT64_C(val) (val##ULL)' + subst['@int64_t_fmt@'] = '#define APR_INT64_T_FMT "qd"' + subst['@uint64_t_fmt@'] = '#define APR_UINT64_T_FMT "qu"' + subst['@uint64_t_hex_fmt@'] = '#define APR_UINT64_T_HEX_FMT "qx"' + subst['@int64_value@'] = '__int64' + subst['@long_value@'] = '__int64' + subst['@int64_strfn=@'] = 'strtoll' + else: + print("could not detect a 64-bit integer type") + self.Exit(1) + + if conf.CheckDeclaration('INT64_C', includes='#include '): + subst['@int64_literal@'] = '#define APR_INT64_C(val) INT64_C(val)' + subst['@uint64_literal@'] = '#define APR_UINT64_C(val) UINT64_C(val)' + subst['@stdint@'] = 1 + + if sizeof_pid_t == sizeof_short: + subst['@pid_t_fmt@'] = '#define APR_PID_T_FMT "hd"' + elif sizeof_pid_t == sizeof_int: + subst['@pid_t_fmt@'] = '#define APR_PID_T_FMT "d"' + elif sizeof_pid_t == sizeof_long: + subst['@pid_t_fmt@'] = '#define APR_PID_T_FMT "ld"' + elif sizeof_pid_t == sizeof_long_long: + subst['@pid_t_fmt@'] = '#define APR_PID_T_FMT APR_INT64_T_FMT' + else: + subst['@pid_t_fmt@'] = '#error Can not determine the proper size for pid_t' + + # TODO: Per OS changing of these + + if conf.Check_apr_largefile64(): + self.AppendUnique(CPPFLAGS = '-D_LARGEFILE64_SOURCE') + + aprlfs=0 + if self['lfs'] and sizeof_off_t == 4: + # Check whether the transitional LFS API is sufficient + aprlfs=1 + for f in ['mmap64', 'sendfile64', 'sendfilev64', 'mkstemp64', 'readdir64_r']: + conf.CheckFunc(f) + elif sizeof_off_t == sizeof_size_t: + aprlfs=1 + if conf.Check_apr_atomic_builtins(): conf.Define('HAVE_ATOMIC_BUILTINS', 1) + if not conf.CheckType('size_t', includes='#include '): + subst['@size_t_value@'] = 'apr_int32_t' + + if not conf.CheckType('ssize_t', includes='#include '): + subst['@ssize_t_value@'] = 'apr_int32_t' + + if not conf.CheckType('socklen_t', includes='#include '): + subst['@socklen_t_value@'] = 'int' + else: + if self['PLATFORM'] == 'hpux' and sizeof_long == 8: + # 64-bit HP-UX requires 32-bit socklens in + # kernel, but user-space declarations say + # 64-bit (socklen_t == size_t == long). + # This will result in many compile warnings, + # but we're functionally busted otherwise. + subst['@socklen_t_value@'] = 'int' + + self.SubstFile('include/apr.h', 'include/apr.h.in', SUBST_DICT = subst) + return conf.Finish() diff --git a/build/subst.py b/build/subst.py new file mode 100644 index 00000000000..042035a8d8d --- /dev/null +++ b/build/subst.py @@ -0,0 +1,68 @@ +# +# +# Ported from +# """ This code is freely available for your use. """ +# + +import re +from SCons.Script import * + +def do_subst_in_file(targetfile, sourcefile, dict): + """Replace all instances of the keys of dict with their values. + For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'}, + then all instances of %VERSION% in the file will be replaced with 1.2345 etc. + """ + try: + f = open(sourcefile, 'rb') + contents = f.read() + f.close() + except: + raise SCons.Errors.UserError, "Can't read source file %s"%sourcefile + for (k,v) in dict.items(): + contents = re.sub(k, v, contents) + try: + f = open(targetfile, 'wb') + f.write(contents) + f.close() + except: + raise SCons.Errors.UserError, "Can't write target file %s"%targetfile + return 0 # success + +def subst_in_file(target, source, env): + if not env.has_key('SUBST_DICT'): + raise SCons.Errors.UserError, "SubstFile requires SUBST_DICT to be set." + d = dict(env['SUBST_DICT']) # copy it + for (k,v) in d.items(): + if callable(v): + d[k] = env.subst(v()) + elif SCons.Util.is_String(v): + d[k]=env.subst(v) + else: + d[k] = SCons.Util.to_String(v) + for (t,s) in zip(target, source): + return do_subst_in_file(str(t), str(s), d) + +def subst_in_file_string(target, source, env): + """This is what gets printed on the console.""" + return '\n'.join(['Substituting vars from %s into %s'%(str(s), str(t)) + for (t,s) in zip(target, source)]) + +def subst_emitter(target, source, env): + """Add dependency from substituted SUBST_DICT to target. + Returns original target, source tuple unchanged. + """ + d = env['SUBST_DICT'].copy() # copy it + for (k,v) in d.items(): + if callable(v): + d[k] = env.subst(v()) + elif SCons.Util.is_String(v): + d[k] = env.subst(v) + Depends(target, SCons.Node.Python.Value(d)) + return target, source + +def generate(env): + subst_action=SCons.Action.Action(subst_in_file, subst_in_file_string) + env['BUILDERS']['SubstFile'] = Builder(action=subst_action, emitter=subst_emitter) + +def exists(env): + return 1 From af4edf8f891afbfa1bcadd593be207a592a62930 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 4 Jan 2009 02:06:53 +0000 Subject: [PATCH 6251/7878] Add check for Big Endianess via python's struct module. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@731157 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprenv.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/build/aprenv.py b/build/aprenv.py index 0b1a5231124..39016a13da2 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -183,6 +183,18 @@ def Check_apr_largefile64(self, context): context.Result(result[0]) return result[0] + def Check_apr_big_endian(self, context): + context.Message("Checking for big endianess... ") + import struct + array = struct.pack('cccc', '\x01', '\x02', '\x03', '\x04') + i = struct.unpack('i', array) + if i == struct.unpack('>i', array): + context.Result('yes') + return 1 + else: + context.Result('no') + return 0 + def critical_value(self, f, value, *args): rv = f(*args) @@ -209,11 +221,13 @@ def APRAutoconf(self): conf = self.Configure(custom_tests = { 'Check_apr_atomic_builtins': self.Check_apr_atomic_builtins, 'Check_apr_largefile64': self.Check_apr_largefile64, + 'Check_apr_big_endian': self.Check_apr_big_endian, }, config_h = 'include/arch/%s/apr_private.h' % (self['APR_PLATFORM'])) # Do we have a working C Compiler? self.critical(conf.CheckCC) + flag_headers = self.Split("""ByteOrder.h conio.h crypt.h @@ -300,6 +314,10 @@ def APRAutoconf(self): sizeof_off_t = conf.CheckTypeSize('off_t', includes='#include ') sizeof_size_t = conf.CheckTypeSize('size_t') + if conf.Check_apr_big_endian(): + subst['@bigendian@'] = 1 + else: + subst['@bigendian@'] = 0 # Now we need to find what apr_int64_t (sizeof == 8) will be. # The first match is our preference. if sizeof_int == 8: From af0660c86138a84c13506d52dbf17210be0fd313 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 4 Jan 2009 02:36:04 +0000 Subject: [PATCH 6252/7878] SCons: - Improve LFS work. - Add conf.CheckTypesCompatible, ported from APR_CHECK_TYPES_COMPATIBLE m4 code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@731160 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprenv.py | 82 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 80 insertions(+), 2 deletions(-) diff --git a/build/aprenv.py b/build/aprenv.py index 39016a13da2..eab49207034 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -183,6 +183,20 @@ def Check_apr_largefile64(self, context): context.Result(result[0]) return result[0] + def CheckTypesCompatible(self, context, t1, t2, includes): + context.Message('Checking %s is the same as %s... ' % (t1, t2)) + source = """ + %s +void main(void) +{ + int foo[0 - !__builtin_types_compatible_p(%s, %s)]; +} + """ % (includes, t1, t2) + result = context.TryCompile(source, '.c') + self.Filter(CPPFLAGS = '-D_LARGEFILE64_SOURCE') + context.Result(result) + return result + def Check_apr_big_endian(self, context): context.Message("Checking for big endianess... ") import struct @@ -219,6 +233,7 @@ def APRAutoconf(self): return self # TODO Port header detection here etc conf = self.Configure(custom_tests = { + 'CheckTypesCompatible': self.CheckTypesCompatible, 'Check_apr_atomic_builtins': self.Check_apr_atomic_builtins, 'Check_apr_largefile64': self.Check_apr_largefile64, 'Check_apr_big_endian': self.Check_apr_big_endian, @@ -305,14 +320,27 @@ def APRAutoconf(self): sizeof_char = conf.CheckTypeSize('char') - sizeof_int = conf.CheckTypeSize('int') + sizeof_int = self.critical_value(conf.CheckTypeSize, 4, 'int') + subst['@int_value@'] = 'int' sizeof_long = conf.CheckTypeSize('long') sizeof_short = self.critical_value(conf.CheckTypeSize, 2, 'short') + subst['@short_value@'] = 'short' sizeof_long_long = conf.CheckTypeSize('long long') sizeof_longlong = conf.CheckTypeSize('longlong') sizeof_pid_t = conf.CheckTypeSize('pid_t', includes='#include ') sizeof_off_t = conf.CheckTypeSize('off_t', includes='#include ') - sizeof_size_t = conf.CheckTypeSize('size_t') + sizeof_size_t = conf.CheckTypeSize('size_t', includes='#include ') + sizeof_ssize_t = conf.CheckTypeSize('ssize_t', includes='#include ') + + if sizeof_size_t: + subst['@size_t_value@'] = 'size_t' + else: + subst['@size_t_value@'] = 'apr_int32_t' + + if sizeof_ssize_t: + subst['@ssize_t_value@'] = 'ssize_t' + else: + subst['@ssize_t_value@'] = 'apr_int32_t' if conf.Check_apr_big_endian(): subst['@bigendian@'] = 1 @@ -394,6 +422,39 @@ def APRAutoconf(self): elif sizeof_off_t == sizeof_size_t: aprlfs=1 + if aprlfs and sizeof_off_t == 4: + # LFS is go! + subst['@off_t_fmt@'] = '#define APR_OFF_T_FMT APR_INT64_T_FMT' + subst['@off_t_value@'] = 'off64_t' + subst['@off_t_strfn@'] = 'apr_strtoi64' + elif sizeof_off_t == 4 and sizeof_long == 4: + # Special case: off_t may change size with _FILE_OFFSET_BITS + # on 32-bit systems with LFS support. To avoid compatibility + # issues when other packages do define _FILE_OFFSET_BITS, + # hard-code apr_off_t to long. + subst['@off_t_fmt@'] = '#define APR_OFF_T_FMT "ld"' + subst['@off_t_value@'] = 'long' + subst['@off_t_strfn@'] = 'strtol' + elif sizeof_off_t != 0: + subst['@off_t_value@'] = 'off_t' + if sizeof_off_t == sizeof_long: + subst['@off_t_fmt@'] = '#define APR_OFF_T_FMT "ld"' + subst['@off_t_strfn@'] = 'strtol' + elif sizeof_off_t == sizeof_int: + subst['@off_t_fmt@'] = '#define APR_OFF_T_FMT "d"' + subst['@off_t_strfn@'] = 'strtoi' + elif sizeof_off_t == sizeof_long_long: + subst['@off_t_fmt@'] = '#define APR_OFF_T_FMT APR_INT64_T_FMT' + subst['@off_t_strfn@'] = 'apr_strtoi64' + else: + print("could not determine the size of off_t") + self.Exit(1) + else: + # Fallback on int + subst['@off_t_fmt@'] = '#define APR_OFF_T_FMT "d"' + subst['@off_t_value@'] = 'apr_int32_t' + subst['@off_t_strfn@'] = 'strtoi' + if conf.Check_apr_atomic_builtins(): conf.Define('HAVE_ATOMIC_BUILTINS', 1) @@ -413,7 +474,24 @@ def APRAutoconf(self): # This will result in many compile warnings, # but we're functionally busted otherwise. subst['@socklen_t_value@'] = 'int' + else: + subst['@socklen_t_value@'] = 'socklen_t' + # Regardless of whether _LARGEFILE64_SOURCE is used, on 32-bit + # platforms _FILE_OFFSET_BITS will affect the size of ino_t and hence + # the build-time ABI may be different from the apparent ABI when using + # APR with another package which *does* define _FILE_OFFSET_BITS. + # (Exactly as per the case above with off_t where LFS is *not* used) + # + # To be safe, hard-code apr_ino_t as 'unsigned long' iff that is + # exactly the size of ino_t here; otherwise use ino_t as existing + # releases did. To be correct, apr_ino_t should have been made an + # ino64_t as apr_off_t is off64_t, but this can't be done now without + # breaking ABI. + subst['@ino_t_value@'] = 'ino_t' + if sizeof_long == 4 and conf.CheckTypesCompatible('ino_t', 'unsigned long', '#include '): + subst['@ino_t_value@'] = 'unsigned long' + self.SubstFile('include/apr.h', 'include/apr.h.in', SUBST_DICT = subst) return conf.Finish() From fac3710aad3dd04978d372aa1758c924cad337c6 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 4 Jan 2009 16:44:48 +0000 Subject: [PATCH 6253/7878] We are now at major version 2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@731296 13f79535-47bb-0310-9956-ffa450edef68 --- build/rpm/apr.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/rpm/apr.spec.in b/build/rpm/apr.spec.in index 768e9fe717a..9e23e6cf070 100644 --- a/build/rpm/apr.spec.in +++ b/build/rpm/apr.spec.in @@ -1,5 +1,5 @@ -%define aprver 1 +%define aprver 2 Summary: Apache Portable Runtime library Name: apr From d19ea9fefd65e69995bca9baaae9a895d5b75f66 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Tue, 6 Jan 2009 00:22:25 +0000 Subject: [PATCH 6254/7878] Add AC_MSG_RESULT after AC_MSG_CHECKING. PR 46427 Patch by Rainer Jung git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@731783 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.in b/configure.in index 46b4b32a48d..14f55ea3c15 100644 --- a/configure.in +++ b/configure.in @@ -1947,6 +1947,9 @@ fi if test "$apr_fcntl_tryacquire_eacces" = "1"; then AC_DEFINE(FCNTL_TRYACQUIRE_EACCES, 1, [Define if fcntl returns EACCES when F_SETLK is already held]) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) fi From 41d1b5fbee4decb399d9bc1520fc266dc65b5d08 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Tue, 6 Jan 2009 00:36:01 +0000 Subject: [PATCH 6255/7878] Fix documentation for apr_temp_dir_get(). PR 46303. Patch by Carlo Marcelo Arenas Belon . git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@731793 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/tempdir.c | 5 ++--- include/apr_file_io.h | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/file_io/unix/tempdir.c b/file_io/unix/tempdir.c index 1138e2c9006..659e0bf4931 100644 --- a/file_io/unix/tempdir.c +++ b/file_io/unix/tempdir.c @@ -48,9 +48,8 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, int i; /* Our goal is to find a temporary directory suitable for writing - into. We'll only pay the price once if we're successful -- we - cache our successful find. Here's the order in which we'll try - various paths: + into. + Here's the order in which we'll try various paths: $TMP $TEMP diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 5d9f2c7ddfb..d1dd3620acc 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -916,10 +916,7 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *templ, * @param p The pool to use for any necessary allocations. * @remark * This function uses an algorithm to search for a directory that an - * an application can use for temporary storage. Once such a - * directory is found, that location is cached by the library. Thus, - * callers only pay the cost of this algorithm once if that one time - * is successful. + * an application can use for temporary storage. * */ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, From 66abde2b75d6e75a78cebc8155c432ae59f0a982 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 9 Jan 2009 14:51:43 +0000 Subject: [PATCH 6256/7878] Fix buildconf with libtool 2.2: * buildconf: Use a different Extremely Ugly Hack to extract and copy the list of .m4 files needed directly from libtoolize. * configure.in: Include more files which might be needed by libtool. * build/: Ignore more. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@733052 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 8 ++++++++ configure.in | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/buildconf b/buildconf index bc0e9fdbaab..710d5a79b71 100755 --- a/buildconf +++ b/buildconf @@ -45,6 +45,14 @@ $libtoolize --copy --automake if [ -f libtool.m4 ]; then ltfile=`pwd`/libtool.m4 +elif grep all_pkgmacro_files $libtoolize > /dev/null; then + # libtool 2.x + aclocal_dir=`sed -n '/^aclocaldir=/{s/.*=//;p;q;}' < $libtoolize` + ltfiles=`sed -n '/^all_pkgmacro_files=/{s/.*=//;;s/"//;p;q;}' < $libtoolize` + for f in $ltfiles; do + test -f "$aclocal_dir/$f" && cp "$aclocal_dir/$f" build + done + ltfile=$aclocal_dir/libtool.m4 else ltfindcmd="`sed -n \"/=[^\\\`]/p;/libtool_m4=/{s/.*=/echo /p;q;}\" \ < $libtoolize`" diff --git a/configure.in b/configure.in index 14f55ea3c15..e53d9c58d2c 100644 --- a/configure.in +++ b/configure.in @@ -20,6 +20,10 @@ sinclude(build/apr_win32.m4) sinclude(build/apr_hints.m4) sinclude(build/libtool.m4) sinclude(build/ltsugar.m4) +sinclude(build/argz.m4) +sinclude(build/ltoptions.m4) +sinclude(build/ltversion.m4) +sinclude(build/lt~obsolete.m4) dnl Hard-coded inclusion at the tail end of apr_private.h: AH_BOTTOM([ From 00fb7eb81358cabaf2609396db78e3a82e20c178 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Fri, 9 Jan 2009 18:10:01 +0000 Subject: [PATCH 6257/7878] SCons build updates: * Add APRConfigureBase and APRConfigure classes The idea is to use APRConfigure and the base class to support cross compiles... For a cross compile a user can simply subclass APRConfigureBase and return the necessary results they need. Most compiled or executed applications ran at configure time will eventually be pulled into the class. * A few bug fixes for SIZE_T formats in apr.h * Added mmap and friends to function checking * Check for semaphores * Check for F_SETLK and flock Submitted by: Ryan Phillips git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@733102 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprconf.py | 186 +++++++++++++++++++++++++++++++++++++++ build/aprenv.py | 224 ++++++++++++++++++----------------------------- 2 files changed, 270 insertions(+), 140 deletions(-) create mode 100644 build/aprconf.py diff --git a/build/aprconf.py b/build/aprconf.py new file mode 100644 index 00000000000..1c55f8eb66b --- /dev/null +++ b/build/aprconf.py @@ -0,0 +1,186 @@ +import os + +class APRConfigureBase: + def __init__(self, env): + self.env = env + + def Check_apr_big_endian(self, context): + import struct + context.Message("Checking for big endianess... ") + array = struct.pack('cccc', '\x01', '\x02', '\x03', '\x04') + i = struct.unpack('i', array) + if i == struct.unpack('>i', array): + context.Result('yes') + return 1 + else: + context.Result('no') + return 0 + + def CheckTypesCompatible(self, context, t1, t2, includes): + context.Message('Checking %s is the same as %s... ' % (t1, t2)) + source = """ + %s +void main(void) +{ + int foo[0 - !__builtin_types_compatible_p(%s, %s)]; +} + """ % (includes, t1, t2) + result = context.TryCompile(source, '.c') + self.env.Filter(CPPFLAGS = ['-D_LARGEFILE64_SOURCE']) + context.Result(result) + return result + + def Check_apr_atomic_builtins(self, context): + context.Message('Checking whether the compiler provides atomic builtins... ') + source = """ +int main() +{ + unsigned long val = 1010, tmp, *mem = &val; + + if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020) + return 1; + + tmp = val; + + if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010) + return 1; + + if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0) + return 1; + + tmp = 3030; + + if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp) + return 1; + + if (__sync_lock_test_and_set(&val, 4040) != 3030) + return 1; + + mem = &tmp; + + if (__sync_val_compare_and_swap(&mem, &tmp, &val) != &tmp) + return 1; + + __sync_synchronize(); + + if (mem != &val) + return 1; + + return 0; +} + """ + result = context.TryRun(source, '.c') + context.Result(result[0]) + return result[0] + + def Check_apr_largefile64(self, context): + context.Message('Checking whether to enable -D_LARGEFILE64_SOURCE... ') + self.env.AppendUnique(CPPFLAGS = ['-D_LARGEFILE64_SOURCE']) + source = """ +#include +#include +#include +#include +#include +#include + +void main(void) +{ + int fd, ret = 0; + struct stat64 st; + off64_t off = 4242; + + if (sizeof(off64_t) != 8 || sizeof(off_t) != 4) + exit(1); + if ((fd = open("conftest.lfs", O_LARGEFILE|O_CREAT|O_WRONLY, 0644)) < 0) + exit(2); + if (ftruncate64(fd, off) != 0) + ret = 3; + else if (fstat64(fd, &st) != 0 || st.st_size != off) + ret = 4; + else if (lseek64(fd, off, SEEK_SET) != off) + ret = 5; + else if (close(fd) != 0) + ret = 6; + else if (lstat64("conftest.lfs", &st) != 0 || st.st_size != off) + ret = 7; + else if (stat64("conftest.lfs", &st) != 0 || st.st_size != off) + ret = 8; + unlink("conftest.lfs"); + + exit(ret); +}""" + result = context.TryRun(source, '.c') + self.env.Filter(CPPFLAGS = ['-D_LARGEFILE64_SOURCE']) + context.Result(result[0]) + return result[0] + + + def Check_apr_mmap_mapping_dev_zero(self, context): + context.Message('Checking for mmap that can map /dev/zero... ') + source = """ +#include +#include +#include +#include + int main() + { + int fd; + void *m; + fd = open("/dev/zero", O_RDWR); + if (fd < 0) { + return 1; + } + m = mmap(0, sizeof(void*), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); + if (m == (void *)-1) { /* aka MAP_FAILED */ + return 2; + } + if (munmap(m, sizeof(void*)) < 0) { + return 3; + } + return 0; + } + """ + result = context.TryRun(source, '.c') + context.Result(result[0]) + return result[0] + + def Check_apr_semaphores(self, context): + context.Message('Checking for sem_open, sem_close, sem_unlink... ') + source = """ +#include +#include +#include +#include +#ifndef SEM_FAILED +#define SEM_FAILED (-1) +#endif +main() +{ + sem_t *psem; + const char *sem_name = "/apr_autoconf"; + + psem = sem_open(sem_name, O_CREAT, 0644, 1); + if (psem == (sem_t *)SEM_FAILED) { + exit(1); + } + sem_close(psem); + psem = sem_open(sem_name, O_CREAT | O_EXCL, 0644, 1); + if (psem != (sem_t *)SEM_FAILED) { + sem_close(psem); + exit(1); + } + sem_unlink(sem_name); + exit(0); +} + """ + result = context.TryCompile(source, '.c') + context.Result(result) + return result + + def CheckFile(self, filename): + return os.path.exists(filename) + +class APRConfigure(APRConfigureBase): + def __init__(self, env): + APRConfigureBase.__init__(self, env) diff --git a/build/aprenv.py b/build/aprenv.py index eab49207034..65011611e4d 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -3,31 +3,42 @@ from SCons.Environment import Environment from os.path import join as pjoin +import aprconf import re import os import traceback -_platforms = [ 'aix', 'beos', 'netware', 'os2', 'os390', 'unix', 'win32' ] - -_platform_dirs = ['atomic', - 'dso', - 'file_io', - 'helpers', - 'locks', - 'memory', - 'misc', - 'mmap', - 'network_io', - 'passwd', - 'poll', - 'random', - 'shmem', - 'strings', - 'support', - 'tables', - 'threadproc', - 'time', - 'user'] +_platforms = [ + 'aix', + 'beos', + 'netware', + 'os2', + 'os390', + 'unix', + 'win32' +] + +_platform_dirs = [ + 'atomic', + 'dso', + 'file_io', + 'helpers', + 'locks', + 'memory', + 'misc', + 'mmap', + 'network_io', + 'passwd', + 'poll', + 'random', + 'shmem', + 'strings', + 'support', + 'tables', + 'threadproc', + 'time', + 'user' +] _simple_dirs = ['tables', 'strings'] @@ -49,6 +60,7 @@ def __init__(self, parent=None, args=None, **kw): self['APR_FALLBACK_PLATFORM'] = 'unix' self.AppendUnique(CPPPATH = ['include', 'include/arch/'+self['APR_PLATFORM']]) + self.autoconf = aprconf.APRConfigure(self) def is_gcc(self): # TOOD: This detection should be smarter, need look at SCons Internals @@ -97,118 +109,6 @@ def APRHints(self): self.AppendUnique(CPPFLAGS=['-DDARWIN', '-DSIGPROCMASK_SETS_THREAD_MASK', '-no-cpp-precomp']) - def Check_apr_atomic_builtins(self, context): - context.Message('Checking whether the compiler provides atomic builtins... ') - source = """ -int main() -{ - unsigned long val = 1010, tmp, *mem = &val; - - if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020) - return 1; - - tmp = val; - - if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010) - return 1; - - if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0) - return 1; - - tmp = 3030; - - if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp) - return 1; - - if (__sync_lock_test_and_set(&val, 4040) != 3030) - return 1; - - mem = &tmp; - - if (__sync_val_compare_and_swap(&mem, &tmp, &val) != &tmp) - return 1; - - __sync_synchronize(); - - if (mem != &val) - return 1; - - return 0; -} - """ - result = context.TryRun(source, '.c') - context.Result(result[0]) - return result[0] - - def Check_apr_largefile64(self, context): - context.Message('Checking whether to enable -D_LARGEFILE64_SOURCE... ') - self.AppendUnique(CPPFLAGS = '-D_LARGEFILE64_SOURCE') - source = """ -#include -#include -#include -#include -#include -#include - -void main(void) -{ - int fd, ret = 0; - struct stat64 st; - off64_t off = 4242; - - if (sizeof(off64_t) != 8 || sizeof(off_t) != 4) - exit(1); - if ((fd = open("conftest.lfs", O_LARGEFILE|O_CREAT|O_WRONLY, 0644)) < 0) - exit(2); - if (ftruncate64(fd, off) != 0) - ret = 3; - else if (fstat64(fd, &st) != 0 || st.st_size != off) - ret = 4; - else if (lseek64(fd, off, SEEK_SET) != off) - ret = 5; - else if (close(fd) != 0) - ret = 6; - else if (lstat64("conftest.lfs", &st) != 0 || st.st_size != off) - ret = 7; - else if (stat64("conftest.lfs", &st) != 0 || st.st_size != off) - ret = 8; - unlink("conftest.lfs"); - - exit(ret); -} - """ - result = context.TryRun(source, '.c') - self.Filter(CPPFLAGS = '-D_LARGEFILE64_SOURCE') - context.Result(result[0]) - return result[0] - - def CheckTypesCompatible(self, context, t1, t2, includes): - context.Message('Checking %s is the same as %s... ' % (t1, t2)) - source = """ - %s -void main(void) -{ - int foo[0 - !__builtin_types_compatible_p(%s, %s)]; -} - """ % (includes, t1, t2) - result = context.TryCompile(source, '.c') - self.Filter(CPPFLAGS = '-D_LARGEFILE64_SOURCE') - context.Result(result) - return result - - def Check_apr_big_endian(self, context): - context.Message("Checking for big endianess... ") - import struct - array = struct.pack('cccc', '\x01', '\x02', '\x03', '\x04') - i = struct.unpack('i', array) - if i == struct.unpack('>i', array): - context.Result('yes') - return 1 - else: - context.Result('no') - return 0 - def critical_value(self, f, value, *args): rv = f(*args) @@ -231,14 +131,23 @@ def APRAutoconf(self): if self.GetOption('clean') or self.GetOption('help'): return self + # TODO Port header detection here etc conf = self.Configure(custom_tests = { - 'CheckTypesCompatible': self.CheckTypesCompatible, - 'Check_apr_atomic_builtins': self.Check_apr_atomic_builtins, - 'Check_apr_largefile64': self.Check_apr_largefile64, - 'Check_apr_big_endian': self.Check_apr_big_endian, - }, - config_h = 'include/arch/%s/apr_private.h' % (self['APR_PLATFORM'])) + 'CheckTypesCompatible': + self.autoconf.CheckTypesCompatible, + 'Check_apr_atomic_builtins': + self.autoconf.Check_apr_atomic_builtins, + 'Check_apr_largefile64': + self.autoconf.Check_apr_largefile64, + 'Check_apr_big_endian': + self.autoconf.Check_apr_big_endian, + 'Check_apr_mmap_mapping_dev_zero': + self.autoconf.Check_apr_mmap_mapping_dev_zero, + 'Check_apr_semaphores': + self.autoconf.Check_apr_semaphores, + }, + config_h = 'include/arch/%s/apr_private.h' % (self['APR_PLATFORM'])) # Do we have a working C Compiler? self.critical(conf.CheckCC) @@ -331,16 +240,21 @@ def APRAutoconf(self): sizeof_off_t = conf.CheckTypeSize('off_t', includes='#include ') sizeof_size_t = conf.CheckTypeSize('size_t', includes='#include ') sizeof_ssize_t = conf.CheckTypeSize('ssize_t', includes='#include ') + subst['@voidp_size@'] = conf.CheckTypeSize('void*') if sizeof_size_t: subst['@size_t_value@'] = 'size_t' + subst['@size_t_fmt@'] = '#define APR_SIZE_T_FMT "%lu"' else: subst['@size_t_value@'] = 'apr_int32_t' + subst['@size_t_fmt@'] = '#define APR_SIZE_T_FMT "%u"' if sizeof_ssize_t: subst['@ssize_t_value@'] = 'ssize_t' + subst['@ssize_t_fmt@'] = '#define APR_SSIZE_T_FMT "%ld"' else: subst['@ssize_t_value@'] = 'apr_int32_t' + subst['@ssize_t_fmt@'] = '#define APR_SSIZE_T_FMT "%d"' if conf.Check_apr_big_endian(): subst['@bigendian@'] = 1 @@ -411,7 +325,7 @@ def APRAutoconf(self): # TODO: Per OS changing of these if conf.Check_apr_largefile64(): - self.AppendUnique(CPPFLAGS = '-D_LARGEFILE64_SOURCE') + self.AppendUnique(CPPFLAGS = ['-D_LARGEFILE64_SOURCE']) aprlfs=0 if self['lfs'] and sizeof_off_t == 4: @@ -492,6 +406,36 @@ def APRAutoconf(self): if sizeof_long == 4 and conf.CheckTypesCompatible('ino_t', 'unsigned long', '#include '): subst['@ino_t_value@'] = 'unsigned long' + # check for mmap functions + # store the results into mmap_results dictionary for use later + mmap_funcs = ['mmap', 'mmap', 'shm_open', 'shm_unlink', 'shm_get', + 'shmat', 'shmdt', 'shmctl'] + mmap_results = dict([[k, conf.CheckFunc(k)] for k in mmap_funcs]) + + # check for mmap mapping dev zero + if mmap_results['mmap'] and \ + self.autoconf.CheckFile("/dev/zero") and \ + conf.Check_apr_mmap_mapping_dev_zero(): + subst['@havemmapzero@'] = '1' + else: + subst['@havemmapzero@'] = '0' + + # check for locking mechanisms + if conf.Check_apr_semaphores(): + subst['@hassysvser@'] = "1" + else: + subst['@hassysvser@'] = "0" + + if conf.CheckDeclaration('F_SETLK', '#include '): + subst['@hasfcntlser@'] = '1' + else: + subst['@hasfcntlser@'] = '0' + + if conf.CheckFunc('flock'): + subst['@hasflockser@'] = "1" + else: + subst['@hasflockser@'] = "0" + self.SubstFile('include/apr.h', 'include/apr.h.in', SUBST_DICT = subst) return conf.Finish() From 4997f51be99134eb812a16464feb074fdf3c9f6a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 12 Jan 2009 14:28:23 +0000 Subject: [PATCH 6258/7878] Fix the otherchild API docs to reflect the actual implementation of the 'write_fd' handling, rather than the implementation which was removed in 2001. Also fix the implementation remove pointless bit shuffling: * include/arch/win32/apr_arch_misc.h (struct apr_other_child_rec_t), include/arch/unix/apr_arch_misc.h (struct apr_other_child_rec_t): Remove unused write_fd field. * include/apr_thread_proc.h: Document that APR_OC_REASON_UNWRITABLE is unused. (apr_proc_other_child_register): Document that the unused write_fd parameter is unused. * misc/unix/otherchild.c (apr_proc_other_child_register): Ignore the write_fd parameter rather than copying it then ignoring it. * STATUS: Move comments on possible future of the write_fd argument here. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@733773 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 ++++++++ include/apr_thread_proc.h | 11 +++-------- include/arch/unix/apr_arch_misc.h | 1 - include/arch/win32/apr_arch_misc.h | 1 - misc/unix/otherchild.c | 14 -------------- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/STATUS b/STATUS index 7b900552305..f53ee2f9b2a 100644 --- a/STATUS +++ b/STATUS @@ -373,6 +373,14 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Interface Changes Postponed for APR 2.0: + * apr_proc_other_child_register()'s write_fd argument should be removed + or made used. The comment in the API previously said: + + write_fd duplicates the proc->out stream, it's really + redundant and should be replaced in the APR 1.0 API with a + bitflag of which proc->in/out/err handles should be health + checked. no platform currently tests the pipes health. + * apr_atomic_casptr() has the volatile qualifier in the wrong place: should take "pointer to volatile pointer to void", not "pointer to pointer to volatile void". diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 4bcc4eeb855..10f839fed64 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -113,7 +113,7 @@ typedef enum { */ #define APR_OC_REASON_DEATH 0 /**< child has died, caller must call * unregister still */ -#define APR_OC_REASON_UNWRITABLE 1 /**< write_fd is unwritable */ +#define APR_OC_REASON_UNWRITABLE 1 /**< currently unused. */ #define APR_OC_REASON_RESTART 2 /**< a restart is occuring, perform * any necessary cleanup (including * sending a special signal to child) @@ -693,14 +693,9 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize); * @param maintenance maintenance is a function that is invoked with a * reason and the data pointer passed here. * @param data Opaque context data passed to the maintenance function. - * @param write_fd An fd that is probed for writing. If it is ever unwritable - * then the maintenance is invoked with reason - * OC_REASON_UNWRITABLE. + * @param write_fd This argument is currently unused and should be passed + * as NULL. * @param p The pool to use for allocating memory. - * @bug write_fd duplicates the proc->out stream, it's really redundant - * and should be replaced in the APR 1.0 API with a bitflag of which - * proc->in/out/err handles should be health checked. - * @bug no platform currently tests the pipes health. */ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc, void (*maintenance) (int reason, diff --git a/include/arch/unix/apr_arch_misc.h b/include/arch/unix/apr_arch_misc.h index 823512506c6..1e8ab0b7541 100644 --- a/include/arch/unix/apr_arch_misc.h +++ b/include/arch/unix/apr_arch_misc.h @@ -55,7 +55,6 @@ struct apr_other_child_rec_t { apr_proc_t *proc; void (*maintenance) (int, void *, int); void *data; - apr_os_file_t write_fd; }; #if defined(WIN32) || defined(NETWARE) diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index 9ead7b04e42..9d0b6657111 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -52,7 +52,6 @@ struct apr_other_child_rec_t { apr_proc_t *proc; void (*maintenance) (int, void *, int); void *data; - apr_os_file_t write_fd; }; #define WSAHighByte 2 diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 427a57e7e47..ea43edfb7cd 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -63,20 +63,6 @@ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc, ocr->proc = proc; ocr->maintenance = maintenance; ocr->data = data; - if (write_fd == NULL) { - ocr->write_fd = (apr_os_file_t) -1; - } - else { -#ifdef WIN32 - /* This should either go away as part of eliminating apr_proc_probe_writable_fds - * or write_fd should point to an apr_file_t - */ - ocr->write_fd = write_fd->filehand; -#else - ocr->write_fd = write_fd->filedes; -#endif - - } ocr->next = other_children; other_children = ocr; apr_pool_cleanup_register(p, ocr->data, other_child_cleanup, From f5bed5974683af7c03a0c8f3a3df0e4305fa42d9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 15 Jan 2009 12:15:52 +0000 Subject: [PATCH 6259/7878] standardize the description of the timeout parameter on different poll APIs (a couple of them didn't describe negative timeouts) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@734680 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index b330c261440..3e5d8f96d6b 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -164,7 +164,10 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, /** * Block for activity on the descriptor(s) in a pollset * @param pollset The pollset to use - * @param timeout Timeout in microseconds + * @param timeout The amount of time in microseconds to wait. This is + * a maximum, not a minimum. If a descriptor is signalled, we + * will wake up before this time. A negative number means + * wait until a descriptor is signalled. * @param num Number of signalled descriptors (output parameter) * @param descriptors Array of signalled descriptors (output parameter) * @remark If the pollset has been created with APR_POLLSET_WAKEABLE @@ -254,7 +257,10 @@ typedef apr_status_t (*apr_pollcb_cb_t)(void *baton, apr_pollfd_t *descriptor); /** * Block for activity on the descriptor(s) in a pollcb * @param pollcb The pollcb to use - * @param timeout Timeout in microseconds + * @param timeout The amount of time in microseconds to wait. This is + * a maximum, not a minimum. If a descriptor is signalled, we + * will wake up before this time. A negative number means + * wait until a descriptor is signalled. * @param func Callback function to call for each active socket * @param baton Opaque baton passed to the callback function. */ From f692b69970280bf07f780fe296e4c76f3558fd88 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 15 Jan 2009 13:55:04 +0000 Subject: [PATCH 6260/7878] suppress gcc's warning about unexpected assignmet "gcc version 4.0.1 (Apple Inc. build 5490)" git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@734707 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/kqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 95519ddd2b1..406eba6e96c 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -336,7 +336,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, j++; } } - if ((*num) = j) + if ((*num = j)) rv = APR_SUCCESS; if (descriptors) { *descriptors = pollset->result_set; From 396b01a9c4d1644d9e056f898f07fa8d24a929fd Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 31 Jan 2009 21:49:20 +0000 Subject: [PATCH 6261/7878] fix spelling in a comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@739635 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index b3710742cae..7d627baa91d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -13,7 +13,7 @@ VPATH = @srcdir@ # or with special parameters # TESTALL_COMPONENTS # programs such as globalmutexchild which the various TESTS will invoke -# to validate process creation, pipes, dso mechansims and so forth +# to validate process creation, pipes, dso mechanisms and so forth STDTEST_PORTABLE = \ testlockperf@EXEEXT@ \ From 970ff43d89a188ea7782dbc6f28340358d1b706c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 31 Jan 2009 22:12:11 +0000 Subject: [PATCH 6262/7878] apr_socket_sendfile() on Solaris: Fix handling of files truncated after the sender determines the length. (This fixes a busy loop in httpd when a file being served is truncated.) Some other implementations of apr_socket_sendfile() were already patched along the way to handle this; some apparently remain broken. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@739640 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ network_io/unix/sendrecv.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGES b/CHANGES index c3256253c6d..0283c5b9be6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,10 @@ -*- coding: utf-8 -*- +Changes for APR 2.0.0 + + *) apr_socket_sendfile() on Solaris: Fix handling of files truncated + after the sender determines the length. (This fixes a busy loop in + httpd when a file being served is truncated.) [Jeff Trawick] + Changes for APR 1.4.0 *) Win32: Do not error out on apr_pollset_poll() when there are no sockets. diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index ce6d0127611..c133a26d9c7 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -1083,6 +1083,14 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, /* Update how much we sent */ *len = nbytes; + + if (nbytes == 0) { + /* Most likely the file got smaller after the stat. + * Return an error so the caller can do the Right Thing. + */ + return APR_EOF; + } + if ((sock->timeout > 0) && (*len < requested_len)) { sock->options |= APR_INCOMPLETE_WRITE; } From fa2dd90715fdfd68edb80e83922b83801b07de7f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 1 Feb 2009 12:55:49 +0000 Subject: [PATCH 6263/7878] This apr_socket_sendfile+Solaris fix was backported to recent 1.x branches, so remove from the as-yet-unreleased 2.0.0 section of CHANGES. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@739759 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGES b/CHANGES index 0283c5b9be6..8ea7b05df3b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,10 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) apr_socket_sendfile() on Solaris: Fix handling of files truncated - after the sender determines the length. (This fixes a busy loop in - httpd when a file being served is truncated.) [Jeff Trawick] - Changes for APR 1.4.0 *) Win32: Do not error out on apr_pollset_poll() when there are no sockets. From 70efe771c029a54eba1f1f68dd4a3aec33c2f530 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 7 Feb 2009 09:05:54 +0000 Subject: [PATCH 6264/7878] Add object perms set macros and implement them for shm and mutex git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@741862 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++ include/apr_global_mutex.h | 5 ++ include/apr_perms_set.h | 65 ++++++++++++++++++++++ include/apr_proc_mutex.h | 6 +++ include/apr_shm.h | 6 +++ include/apr_thread_proc.h | 13 +++++ include/arch/unix/apr_arch_proc_mutex.h | 1 + include/arch/unix/apr_arch_shm.h | 1 + include/arch/unix/apr_arch_threadproc.h | 10 ++++ locks/beos/proc_mutex.c | 2 + locks/netware/proc_mutex.c | 2 + locks/os2/proc_mutex.c | 2 +- locks/unix/global_mutex.c | 9 ++++ locks/unix/proc_mutex.c | 72 +++++++++++++++++++++++++ locks/win32/proc_mutex.c | 2 + shmem/beos/shm.c | 2 + shmem/os2/shm.c | 2 + shmem/unix/shm.c | 40 ++++++++++---- shmem/win32/shm.c | 2 + threadproc/beos/proc.c | 8 +++ threadproc/netware/proc.c | 8 +++ threadproc/os2/proc.c | 8 +++ threadproc/unix/proc.c | 31 ++++++++++- threadproc/win32/proc.c | 8 +++ 24 files changed, 298 insertions(+), 12 deletions(-) create mode 100644 include/apr_perms_set.h diff --git a/CHANGES b/CHANGES index 8ea7b05df3b..68dd11cca00 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Intruduce APR_PERMS_SET macros for setting the owner/group on + objects. Currently only implemented for shm, proc and global + mutexes on posix platforms. + [Mladen Turk] + Changes for APR 1.4.0 *) Win32: Do not error out on apr_pollset_poll() when there are no sockets. diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index 9316001ce62..dac9d0a0c0e 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -120,6 +120,11 @@ APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex); */ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex); +/** + * Set mutex permissions. + */ +APR_PERMS_SET_IMPLEMENT(global_mutex); + /** * Get the pool used by this global_mutex. * @return apr_pool_t the pool diff --git a/include/apr_perms_set.h b/include/apr_perms_set.h new file mode 100644 index 00000000000..92a1362b8e5 --- /dev/null +++ b/include/apr_perms_set.h @@ -0,0 +1,65 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_PERMS_SET_H +#define APR_PERMS_SET_H + +/** + * @file apr_perms_set.h + * @brief APR Process Locking Routines + */ + +#include "apr.h" +#include "apr_pools.h" +#include "apr_errno.h" +#include "apr_user.h" +#include "apr_file_info.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @defgroup apr_perms_set Object permission set functions + * @ingroup APR + * @{ + */ + +/** Permission set callback function. */ +typedef apr_status_t (apr_perms_setfn_t)(void *object, apr_fileperms_t perms, + apr_uid_t uid, apr_gid_t gid); + +#define APR_PERMS_SET_IMPLEMENT(type) \ + APR_DECLARE(apr_status_t) apr_##type##_perms_set \ + (void *the##type, apr_fileperms_t perms, \ + apr_uid_t uid, apr_gid_t gid) + +#define APR_PERMS_SET_ENOTIMPL(type) \ + APR_DECLARE(apr_status_t) apr_##type##_perms_set \ + (void *the##type, apr_fileperms_t perms, \ + apr_uid_t uid, apr_gid_t gid) \ + { return APR_ENOTIMPL ; } + +#define APR_PERMS_SET_FN(type) apr_##type##_perms_set + + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* ! APR_PERMS_SET */ diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index ceb9c82a8dc..1c6d19d6b6a 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -25,6 +25,7 @@ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" +#include "apr_perms_set.h" #ifdef __cplusplus extern "C" { @@ -151,6 +152,11 @@ APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex); */ APR_DECLARE(const char *) apr_proc_mutex_defname(void); +/** + * Set mutex permissions. + */ +APR_PERMS_SET_IMPLEMENT(proc_mutex); + /** * Get the pool used by this proc_mutex. * @return apr_pool_t the pool diff --git a/include/apr_shm.h b/include/apr_shm.h index 2b1d50f6d49..e830b96e1c8 100644 --- a/include/apr_shm.h +++ b/include/apr_shm.h @@ -25,6 +25,7 @@ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" +#include "apr_perms_set.h" #ifdef __cplusplus extern "C" { @@ -132,6 +133,11 @@ APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m); */ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m); +/** + * Set shared memory permissions. + */ +APR_PERMS_SET_IMPLEMENT(shm); + /** * Get the pool used by this shared memory segment. */ diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 10f839fed64..eeb81cde4d4 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -26,6 +26,7 @@ #include "apr_file_io.h" #include "apr_pools.h" #include "apr_errno.h" +#include "apr_perms_set.h" #if APR_HAVE_STRUCT_RLIMIT #include @@ -577,6 +578,18 @@ APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, const char *groupname); +/** + * Register permission set function + * @param attr The procattr we care about. + * @param perms_set_fn Permission set callback + * @param data Data to pass to permission callback function + * @param perms Permissions to set + */ +APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, + apr_perms_setfn_t *perms_set_fn, + void *data, + apr_fileperms_t perms); + #if APR_HAS_FORK /** * This is currently the only non-portable call in APR. This executes diff --git a/include/arch/unix/apr_arch_proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h index ec9796bc9d4..c582eeb21ee 100644 --- a/include/arch/unix/apr_arch_proc_mutex.h +++ b/include/arch/unix/apr_arch_proc_mutex.h @@ -75,6 +75,7 @@ struct apr_proc_mutex_unix_lock_methods_t { apr_status_t (*release)(apr_proc_mutex_t *); apr_status_t (*cleanup)(void *); apr_status_t (*child_init)(apr_proc_mutex_t **, apr_pool_t *, const char *); + apr_status_t (*perms_set)(apr_proc_mutex_t *, apr_fileperms_t, apr_uid_t, apr_gid_t); const char *name; }; typedef struct apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_lock_methods_t; diff --git a/include/arch/unix/apr_arch_shm.h b/include/arch/unix/apr_arch_shm.h index bbd373e3632..e9d25cadb40 100644 --- a/include/arch/unix/apr_arch_shm.h +++ b/include/arch/unix/apr_arch_shm.h @@ -67,6 +67,7 @@ struct apr_shm_t { const char *filename; /* NULL if anonymous */ #if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON int shmid; /* shmem ID returned from shmget() */ + key_t shmkey; /* shmem key IPC_ANON or returned from ftok() */ #endif }; diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h index b76dc9be131..ebe5d358a5e 100644 --- a/include/arch/unix/apr_arch_threadproc.h +++ b/include/arch/unix/apr_arch_threadproc.h @@ -19,6 +19,7 @@ #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_arch_file_io.h" +#include "apr_perms_set.h" /* System headers required for thread/process library */ #if APR_HAVE_PTHREAD_H @@ -76,6 +77,14 @@ struct apr_thread_once_t { #endif +typedef struct apr_procattr_pscb_t apr_procattr_pscb_t; +struct apr_procattr_pscb_t { + struct apr_procattr_pscb_t *next; + apr_perms_setfn_t *perms_set_fn; + apr_fileperms_t perms; + const void *data; +}; + struct apr_procattr_t { apr_pool_t *pool; apr_file_t *parent_in; @@ -103,6 +112,7 @@ struct apr_procattr_t { apr_int32_t errchk; apr_uid_t uid; apr_gid_t gid; + apr_procattr_pscb_t *perms_set_callbacks; }; #endif /* ! THREAD_PROC_H */ diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index ce2a580bacc..a02668addc2 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -140,6 +140,8 @@ APR_DECLARE(const char *) apr_proc_mutex_defname(void) return "beossem"; } +APR_PERMS_SET_ENOTIMPL(proc_mutex) + APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 77411d0bf2d..09791464544 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -97,6 +97,8 @@ APR_DECLARE(const char *) apr_proc_mutex_defname(void) return "netwarethread"; } +APR_PERMS_SET_ENOTIMPL(proc_mutex) + APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 5a49356355a..6655abb6061 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -199,7 +199,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return APR_FROM_OS_ERROR(rc); } - +APR_PERMS_SET_ENOTIMPL(proc_mutex) APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index bfe360aa998..94b8797e1d1 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -175,4 +175,13 @@ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) return apr_pool_cleanup_run(mutex->pool, mutex, global_mutex_cleanup); } +APR_PERMS_SET_IMPLEMENT(global_mutex) +{ + apr_status_t rv; + apr_global_mutex_t *mutex = (apr_global_mutex_t *)theglobal_mutex; + + rv = apr_proc_mutex_set_perms(mutex->proc_mutex, perms, uid, gid); + return rv; +} + APR_POOL_IMPLEMENT_ACCESSOR(global_mutex) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index e433230a89e..73d6f2535a4 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -34,6 +34,17 @@ static apr_status_t proc_mutex_no_child_init(apr_proc_mutex_t **mutex, } #endif +#if APR_HAS_POSIXSEM_SERIALIZE || APR_HAS_PROC_PTHREAD_SERIALIZE +static apr_status_t proc_mutex_no_perms_set(apr_proc_mutex_t *mutex, + apr_fileperms_t perms, + apr_uid_t uid, + apr_gid_t gid) +{ + return APR_ENOTIMPL; +} +#endif + + #if APR_HAS_POSIXSEM_SERIALIZE #ifndef SEM_FAILED @@ -155,6 +166,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_posixsem_methods = proc_mutex_posix_release, proc_mutex_posix_cleanup, proc_mutex_no_child_init, + proc_mutex_no_perms_set, "posixsem" }; @@ -263,6 +275,24 @@ static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } +static apr_status_t proc_mutex_sysv_perms_set(apr_proc_mutex_t *mutex, + apr_fileperms_t perms, + apr_uid_t uid, + apr_gid_t gid) +{ + + union semun ick; + struct semid_ds buf; + buf.sem_perm.uid = uid; + buf.sem_perm.gid = gid; + buf.sem_perm.mode = apr_unix_perms2mode(perms); + ick.buf = &buf; + if (semctl(mutex->interproc->filedes, 0, IPC_SET, ick) < 0) { + return errno; + } + return APR_SUCCESS; +} + static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = { #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(SYSVSEM_IS_GLOBAL) @@ -276,6 +306,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = proc_mutex_sysv_release, proc_mutex_sysv_cleanup, proc_mutex_no_child_init, + proc_mutex_sysv_perms_set, "sysvsem" }; @@ -471,6 +502,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_methods = proc_mutex_proc_pthread_release, proc_mutex_proc_pthread_cleanup, proc_mutex_no_child_init, + proc_mutex_no_perms_set, "pthread" }; @@ -592,6 +624,22 @@ static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } +static apr_status_t proc_mutex_fcntl_perms_set(apr_proc_mutex_t *mutex, + apr_fileperms_t perms, + apr_uid_t uid, + apr_gid_t gid) +{ + + if (mutex->fname) { + if (!(perms & APR_FPROT_GSETID)) + gid = -1; + if (fchown(mutex->interproc->filedes, uid, gid) < 0) { + return errno; + } + } + return APR_SUCCESS; +} + static const apr_proc_mutex_unix_lock_methods_t mutex_fcntl_methods = { #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(FCNTL_IS_GLOBAL) @@ -605,6 +653,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_fcntl_methods = proc_mutex_fcntl_release, proc_mutex_fcntl_cleanup, proc_mutex_no_child_init, + proc_mutex_fcntl_perms_set, "fcntl" }; @@ -730,6 +779,22 @@ static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, return APR_SUCCESS; } +static apr_status_t proc_mutex_flock_perms_set(apr_proc_mutex_t *mutex, + apr_fileperms_t perms, + apr_uid_t uid, + apr_gid_t gid) +{ + + if (mutex->fname) { + if (!(perms & APR_FPROT_GSETID)) + gid = -1; + if (fchown(mutex->interproc->filedes, uid, gid) < 0) { + return errno; + } + } + return APR_SUCCESS; +} + static const apr_proc_mutex_unix_lock_methods_t mutex_flock_methods = { #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(FLOCK_IS_GLOBAL) @@ -743,6 +808,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_flock_methods = proc_mutex_flock_release, proc_mutex_flock_cleanup, proc_mutex_flock_child_init, + proc_mutex_flock_perms_set, "flock" }; @@ -915,6 +981,12 @@ APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) return NULL; } +APR_PERMS_SET_IMPLEMENT(proc_mutex) +{ + apr_proc_mutex_t *mutex = (apr_proc_mutex_t *)theproc_mutex; + return mutex->meth->perms_set(mutex, perms, uid, gid); +} + APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index ecb6f14d486..13a1959f100 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -199,6 +199,8 @@ APR_DECLARE(const char *) apr_proc_mutex_defname(void) return "win32mutex"; } +APR_PERMS_SET_ENOTIMPL(proc_mutex) + APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index 1f06f78acd2..d6b888b0819 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -149,6 +149,8 @@ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) return m->reqsize; } +APR_PERMS_SET_ENOTIMPL(shm) + APR_POOL_IMPLEMENT_ACCESSOR(shm) APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c index 340cae40743..dcdb4158709 100644 --- a/shmem/os2/shm.c +++ b/shmem/os2/shm.c @@ -113,6 +113,8 @@ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) return size; } +APR_PERMS_SET_ENOTIMPL(shm) + APR_POOL_IMPLEMENT_ACCESSOR(shm) APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 14bb34491cd..db18a79df39 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -105,7 +105,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #endif #if APR_USE_SHMEM_SHMGET apr_size_t nbytes; - key_t shmkey; #endif #if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_SHMGET || \ APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM @@ -180,8 +179,8 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, new_m->reqsize = reqsize; new_m->realsize = reqsize; new_m->filename = NULL; - - if ((new_m->shmid = shmget(IPC_PRIVATE, new_m->realsize, + new_m->shmkey = IPC_PRIVATE; + if ((new_m->shmid = shmget(new_m->shmkey, new_m->realsize, SHM_R | SHM_W | IPC_CREAT)) < 0) { return errno; } @@ -318,12 +317,12 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* ftok() (on solaris at least) requires that the file actually * exist before calling ftok(). */ - shmkey = ftok(filename, 1); - if (shmkey == (key_t)-1) { + new_m->shmkey = ftok(filename, 1); + if (new_m->shmkey == (key_t)-1) { return errno; } - if ((new_m->shmid = shmget(shmkey, new_m->realsize, + if ((new_m->shmid = shmget(new_m->shmkey, new_m->realsize, SHM_R | SHM_W | IPC_CREAT | IPC_EXCL)) < 0) { return errno; } @@ -526,7 +525,6 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, apr_status_t status; apr_file_t *file; /* file where metadata is stored */ apr_size_t nbytes; - key_t shmkey; new_m = apr_palloc(pool, sizeof(apr_shm_t)); @@ -549,11 +547,11 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, new_m->filename = apr_pstrdup(pool, filename); new_m->pool = pool; - shmkey = ftok(filename, 1); - if (shmkey == (key_t)-1) { + new_m->shmkey = ftok(filename, 1); + if (new_m->shmkey == (key_t)-1) { return errno; } - if ((new_m->shmid = shmget(shmkey, 0, SHM_R | SHM_W)) == -1) { + if ((new_m->shmid = shmget(new_m->shmkey, 0, SHM_R | SHM_W)) == -1) { return errno; } if ((new_m->base = shmat(new_m->shmid, NULL, 0)) == (void *)-1) { @@ -590,6 +588,28 @@ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) return m->reqsize; } +APR_PERMS_SET_IMPLEMENT(shm) +{ +#if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON + struct shmid_ds shmbuf; + int shmid; + apr_shm_t *m = (apr_shm_t *)theshm; + + if ((shmid = shmget(m->shmkey, 0, SHM_R | SHM_W)) == -1) { + return errno; + } + shmbuf.shm_perm.uid = uid; + shmbuf.shm_perm.gid = gid; + shmbuf.shm_perm.mode = apr_unix_perms2mode(perms); + if (shmctl(shmid, IPC_SET, &shmbuf) == -1) { + return errno; + } + return APR_SUCCESS; +#else + return APR_ENOTIMPL; +#endif +} + APR_POOL_IMPLEMENT_ACCESSOR(shm) APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index da736aa625c..d16de5469fb 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -281,6 +281,8 @@ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) return m->length; } +APR_PERMS_SET_ENOTIMPL(shm) + APR_POOL_IMPLEMENT_ACCESSOR(shm) APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 2623b70d158..b4e05e58e79 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -443,3 +443,11 @@ APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, { return APR_ENOTIMPL; } + +APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, + apr_perms_setfn_t *perms_set_fn, + void *data, + apr_fileperms_t perms) +{ + return APR_ENOTIMPL; +} diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 5fb26913c8b..6ee7a1b48f5 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -491,3 +491,11 @@ APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, /* Always return SUCCESS because NetWare threads don't run within a group */ return APR_SUCCESS; } + +APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, + apr_perms_setfn_t *perms_set_fn, + void *data, + apr_fileperms_t perms) +{ + return APR_ENOTIMPL; +} diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 8e4a4a3b632..9fa94dde191 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -662,3 +662,11 @@ APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, { return APR_ENOTIMPL; } + +APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, + apr_perms_setfn_t *perms_set_fn, + void *data, + apr_fileperms_t perms) +{ + return APR_ENOTIMPL; +} diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index d0754013863..36c57b60270 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -463,7 +463,19 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, _exit(-1); /* We have big problems, the child should exit. */ } } - + if (!geteuid()) { + apr_procattr_pscb_t *c = attr->perms_set_callbacks; + + while (c) { + apr_status_t r; + r = (*c->perms_set_fn)((void *)c->data, c->perms, + attr->uid, attr->gid); + if (r != APR_SUCCESS || r != APR_ENOTIMPL) { + _exit(-1); + } + c = c->next; + } + } /* Only try to switch if we are running as root */ if (attr->gid != -1 && !geteuid()) { if ((status = setgid(attr->gid))) { @@ -708,3 +720,20 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, return APR_SUCCESS; } + +APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, + apr_perms_setfn_t *perms_set_fn, + void *data, + apr_fileperms_t perms) +{ + apr_procattr_pscb_t *c; + + c = apr_palloc(attr->pool, sizeof(apr_procattr_pscb_t)); + c->data = data; + c->perms = perms; + c->perms_set_fn = perms_set_fn; + c->next = attr->perms_set_callbacks; + attr->perms_set_callbacks = c; + + return APR_SUCCESS; +} diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 79a2fd167f3..08ea918a05e 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -1147,3 +1147,11 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) { return APR_ENOTIMPL; } + +APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, + apr_perms_setfn_t *perms_set_fn, + void *data, + apr_fileperms_t perms) +{ + return APR_ENOTIMPL; +} From dbfdf36b055f93f00f4532cb5c9c6e084ac37df7 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 7 Feb 2009 09:43:44 +0000 Subject: [PATCH 6265/7878] Fix typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@741867 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 36c57b60270..6c4786653a5 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -470,7 +470,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_status_t r; r = (*c->perms_set_fn)((void *)c->data, c->perms, attr->uid, attr->gid); - if (r != APR_SUCCESS || r != APR_ENOTIMPL) { + if (r != APR_SUCCESS && r != APR_ENOTIMPL) { _exit(-1); } c = c->next; From cb1376aed6e714a39c37862bad61a1206eaec005 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 7 Feb 2009 09:53:27 +0000 Subject: [PATCH 6266/7878] Add missing proto for apr_unix_perms2mode git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@741869 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index db18a79df39..f708a928139 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -15,6 +15,7 @@ */ #include "apr_arch_shm.h" +#include "apr_arch_file_io.h" #include "apr_general.h" #include "apr_errno.h" From e5a24b9a1dddab1b93e6d467b1eb96436128f770 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 7 Feb 2009 09:55:15 +0000 Subject: [PATCH 6267/7878] Use macro for determinig function name git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@741871 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/global_mutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index 94b8797e1d1..c5ff938c783 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -180,7 +180,7 @@ APR_PERMS_SET_IMPLEMENT(global_mutex) apr_status_t rv; apr_global_mutex_t *mutex = (apr_global_mutex_t *)theglobal_mutex; - rv = apr_proc_mutex_set_perms(mutex->proc_mutex, perms, uid, gid); + rv = APR_PERMS_SET_FN(proc_mutex)(mutex->proc_mutex, perms, uid, gid); return rv; } From 1546ed6c117f5b923547b7dcd84676d902ab7c6b Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 9 Feb 2009 21:46:28 +0000 Subject: [PATCH 6268/7878] With the release if libtool 2.x, most port managers now install as glibtool1... so prefer that. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@742752 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 2 +- buildconf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 62fe931aefc..c236810012f 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -38,7 +38,7 @@ fi # output is multiline from 1.5 onwards # Require libtool 1.4 or newer -libtool=`build/PrintPath glibtool libtool libtool15 libtool14` +libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14` lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` if test -z "$lt_pversion"; then echo "buildconf: libtool not found." diff --git a/buildconf b/buildconf index 710d5a79b71..15747f9e6f4 100755 --- a/buildconf +++ b/buildconf @@ -23,7 +23,7 @@ # build/buildcheck.sh || exit 1 -libtoolize=`build/PrintPath glibtoolize libtoolize15 libtoolize14 libtoolize` +libtoolize=`build/PrintPath glibtoolize1 glibtoolize libtoolize15 libtoolize14 libtoolize` if [ "x$libtoolize" = "x" ]; then echo "libtoolize not found in path" exit 1 From d34a9926be72734029c25e33e6afcd73476f4ff1 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Tue, 10 Feb 2009 09:56:09 +0000 Subject: [PATCH 6269/7878] Fix win32 APR_POLLSET_WAKEABLE implementation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@742921 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/select.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/poll/unix/select.c b/poll/unix/select.c index 6115820b9ed..4780665b05d 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -358,7 +358,12 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, } else { #if !APR_FILES_AS_SOCKETS - return APR_EBADF; + if ((pollset->flags & APR_POLLSET_WAKEABLE) && + descriptor->desc.f == pollset->wakeup_pipe[0]) { + fd = (apr_os_sock_t)descriptor->desc.f->filedes; + } + else + return APR_EBADF; #else #ifdef NETWARE /* NetWare can't handle mixed descriptor types in select() */ From 58055dda1e3aa4b7da1b2d9693960e62a72ab2f7 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 12 Feb 2009 12:38:02 +0000 Subject: [PATCH 6270/7878] Extend DLL late load macros to include function presence check. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@743703 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_misc.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index 9d0b6657111..c7d1cb3c8f9 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -184,18 +184,24 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); /* The apr_load_dll_func call WILL return 0 set error to * ERROR_INVALID_FUNCTION if the function cannot be loaded */ - #define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ typedef rettype (calltype *apr_winapi_fpt_##fn) args; \ static apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \ - static APR_INLINE rettype apr_winapi_##fn args \ - { if (!apr_winapi_pfn_##fn) \ + static int apr_winapi_chk_##fn = 0; \ + static APR_INLINE int apr_winapi_ld_##fn() \ + { if (apr_winapi_pfn_##fn) return 1; \ + if (apr_winapi_chk_##fn ++) return 0; \ + if (!apr_winapi_pfn_##fn) \ apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \ apr_load_dll_func(lib, #fn, ord); \ - if (apr_winapi_pfn_##fn) \ + if (apr_winapi_pfn_##fn) return 1; else return 0; }; \ + static APR_INLINE rettype apr_winapi_##fn args \ + { if (apr_winapi_ld_##fn()) \ return (*(apr_winapi_pfn_##fn)) names; \ else { SetLastError(ERROR_INVALID_FUNCTION); return 0;} }; \ +#define APR_HAVE_LATE_DLL_FUNC(fn) apr_winapi_ld_##fn() + /* Provide late bound declarations of every API function missing from * one or more supported releases of the Win32 API * From c3716f90345369f3fd88f5b02999509035d56a51 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 12 Feb 2009 13:12:10 +0000 Subject: [PATCH 6271/7878] Add close function for file_socket_pipe. The standard apr_file_close cores git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@743723 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 5598acdf892..4ee629d9fd7 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -349,22 +349,9 @@ static apr_status_t socket_pipe_cleanup(void *thefile) return APR_SUCCESS; } -#if 0 -/* XXX Do we need this as public API or APR private ? - * It's main usage is for interrupting pollset because - * of !APR_FILES_AS_SOCKETS. - * Duplicating sockets in child requires WSADuplicateSocket - * and passing WSAPROTOCOL_INFO data to the child, so we - * would need some sort of IPC instead DuplicateHandle used - * for files and pipes. - */ -APR_DECLARE(apr_status_t) -#else -apr_status_t -#endif -apr_file_socket_pipe_create(apr_file_t **in, - apr_file_t **out, - apr_pool_t *p) +apr_status_t apr_file_socket_pipe_create(apr_file_t **in, + apr_file_t **out, + apr_pool_t *p) { apr_status_t rv; SOCKET rd; @@ -408,3 +395,20 @@ apr_file_socket_pipe_create(apr_file_t **in, return rv; } + +apr_status_t apr_file_socket_pipe_close(apr_file_t *file) +{ + apr_status_t stat; + if (!file->pipe) + return apr_file_close(file); + if ((stat = socket_pipe_cleanup(file)) == APR_SUCCESS) { + apr_pool_cleanup_kill(file->pool, file, socket_pipe_cleanup); + + if (file->mutex) { + apr_thread_mutex_destroy(file->mutex); + } + + return APR_SUCCESS; + } + return stat; +} From e2800290553b3a6e26584c31db082add124e3562 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 12 Feb 2009 21:17:48 +0000 Subject: [PATCH 6272/7878] Use apr_file_socket_pipe_close for closing the WIN32 wakeup pipe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@743885 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/select.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/poll/unix/select.c b/poll/unix/select.c index 4780665b05d..c3ad8cd7bdd 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -195,6 +195,9 @@ apr_file_socket_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *p); +extern apr_status_t +apr_file_socket_pipe_close(apr_file_t *file); + /* Create a dummy wakeup socket pipe for interrupting the poller */ static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) @@ -218,6 +221,12 @@ static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) { return APR_ENOTIMPL; } + +static apr_status_t apr_file_socket_pipe_close(apr_file_t *file) +{ + return APR_ENOTIMPL; +} + #endif /* WIN32 */ #else /* APR_FILES_AS_SOCKETS */ @@ -265,11 +274,19 @@ static apr_status_t wakeup_pipe_cleanup(void *p) if (pollset->flags & APR_POLLSET_WAKEABLE) { /* Close both sides of the wakeup pipe */ if (pollset->wakeup_pipe[0]) { +#if APR_FILES_AS_SOCKETS apr_file_close(pollset->wakeup_pipe[0]); +#else + apr_file_socket_pipe_close(pollset->wakeup_pipe[0]); +#endif pollset->wakeup_pipe[0] = NULL; } if (pollset->wakeup_pipe[1]) { +#if APR_FILES_AS_SOCKETS apr_file_close(pollset->wakeup_pipe[1]); +#else + apr_file_socket_pipe_close(pollset->wakeup_pipe[1]); +#endif pollset->wakeup_pipe[1] = NULL; } } From 051152f9cc7315ef70f64d618df1cf7e270f119a Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Fri, 13 Feb 2009 12:24:00 +0000 Subject: [PATCH 6273/7878] Implement providers for apr_pollset and apr_pollcb git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@744095 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 + NWGNUmakefile | 2 + apr.dsp | 8 + include/apr_poll.h | 69 +++++ include/arch/unix/apr_arch_poll_private.h | 77 +++++- libapr.dsp | 8 + poll/os2/pollset.c | 9 +- poll/unix/epoll.c | 260 +++++++----------- poll/unix/kqueue.c | 280 ++++++++----------- poll/unix/poll.c | 310 ++++++++++----------- poll/unix/port.c | 281 ++++++++----------- poll/unix/select.c | 311 +++++----------------- 12 files changed, 701 insertions(+), 919 deletions(-) diff --git a/CHANGES b/CHANGES index 68dd11cca00..d237b5bfb82 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Make apr_pollset and apr_pollcb implementations using providers. + Added apr_pollset_create_ex and apr_pollcb_create_ex that allows + choosing non-default providers. + [Mladen Turk] + *) Intruduce APR_PERMS_SET macros for setting the owner/group on objects. Currently only implemented for shm, proc and global mutexes on posix platforms. diff --git a/NWGNUmakefile b/NWGNUmakefile index c4a0dcf7eb0..5a565637d3e 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -311,6 +311,8 @@ FILES_lib_objs = \ $(OBJDIR)/rand.o \ $(OBJDIR)/readwrite.o \ $(OBJDIR)/seek.o \ + $(OBJDIR)/pollcb.o \ + $(OBJDIR)/pollset.o \ $(OBJDIR)/select.o \ $(OBJDIR)/sendrecv.o \ $(OBJDIR)/sha2.o \ diff --git a/apr.dsp b/apr.dsp index 88a87adeb38..e1251593a63 100644 --- a/apr.dsp +++ b/apr.dsp @@ -412,6 +412,14 @@ SOURCE=.\passwd\apr_getpass.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\poll\unix\pollcb.c +# End Source File +# Begin Source File + +SOURCE=.\poll\unix\pollset.c +# End Source File +# Begin Source File + SOURCE=.\poll\unix\select.c # End Source File # End Group diff --git a/include/apr_poll.h b/include/apr_poll.h index 3e5d8f96d6b..ec3cc1c56f8 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -57,6 +57,19 @@ extern "C" { #define APR_POLLSET_THREADSAFE 0x001 /**< Adding or Removing a Descriptor is thread safe */ #define APR_POLLSET_NOCOPY 0x002 /**< Descriptors passed to apr_pollset_create() are not copied */ #define APR_POLLSET_WAKEABLE 0x004 /**< Pollset poll operation is interruptable */ +#define APR_POLLSET_NODEFAULT 0x010 /**< Do not try default method if non default fails */ + +/** + * Pollset Methods + */ +typedef enum { + APR_POLLSET_DEFAULT, /**< Platform default poll method */ + APR_POLLSET_SELECT, /**< Poll uses select method */ + APR_POLLSET_KQUEUE, + APR_POLLSET_PORT, + APR_POLLSET_EPOLL, + APR_POLLSET_POLL +} apr_pollset_method_e; /** Used in apr_pollfd_t to determine what the apr_descriptor is */ typedef enum { @@ -118,6 +131,33 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_pool_t *p, apr_uint32_t flags); +/** + * Setup a pollset object + * @param pollset The pointer in which to return the newly created object + * @param size The maximum number of descriptors that this pollset can hold + * @param p The pool from which to allocate the pollset + * @param flags Optional flags to modify the operation of the pollset. + * @param method Poll method to use. See @apr_pollset_method_e. + * + * @remark If flags equals APR_POLLSET_THREADSAFE, then a pollset is + * created on which it is safe to make concurrent calls to + * apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() + * from separate threads. This feature is only supported on some + * platforms; the apr_pollset_create() call will fail with + * APR_ENOTIMPL on platforms where it is not supported. + * @remark If flags contain APR_POLLSET_WAKEABLE, then a pollset is + * created with additional internal pipe object used for + * apr_pollset_wakeup() call. The actual size of pollset is + * in that case size + 1. This feature is only supported on some + * platforms; the apr_pollset_create() call will fail with + * APR_ENOTIMPL on platforms where it is not supported. + */ +APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags, + apr_pollset_method_e method); + /** * Destroy a pollset object * @param pollset The pollset to destroy @@ -207,6 +247,18 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, apr_int32_t *nsds, apr_interval_time_t timeout); +/** + * Display the name of the pollset method, as it relates to the actual + * method used. + * @param pollset the name of the pollset. + */ +APR_DECLARE(const char *) apr_pollset_method_name(apr_pollset_t *pollset); + +/** + * Display the name of the default poll method: APR_POLLSET_DEFAULT + */ +APR_DECLARE(const char *) apr_poll_method_defname(void); + /** Opaque structure used for pollset API */ typedef struct apr_pollcb_t apr_pollcb_t; @@ -225,6 +277,23 @@ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, apr_pool_t *pool, apr_uint32_t flags); +/** + * Setup a pollcb object + * @param pollcb The pointer in which to return the newly created object + * @param size The maximum number of descriptors that a single _poll can return. + * @param p The pool from which to allocate the pollcb + * @param flags Optional flags to modify the operation of the pollcb. + * @param method Poll method to use. See @apr_pollset_method_e. + * + * @remark Pollcb is only supported on some platforms; the apr_pollcb_create() + * call will fail with APR_ENOTIMPL on platforms where it is not supported. + */ +APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, + apr_uint32_t size, + apr_pool_t *pool, + apr_uint32_t flags, + apr_pollset_method_e method); + /** * Add a socket or file descriptor to a pollcb * @param pollcb The pollcb to which to add the descriptor diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index f176eac0e54..c2e646b464c 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -17,13 +17,6 @@ #ifndef APR_ARCH_POLL_PRIVATE_H #define APR_ARCH_POLL_PRIVATE_H -#include "apr.h" -#include "apr_poll.h" -#include "apr_time.h" -#include "apr_portable.h" -#include "apr_arch_networkio.h" -#include "apr_arch_file_io.h" - #if HAVE_POLL_H #include #endif @@ -55,14 +48,19 @@ /* Choose the best method platform specific to use in apr_pollset */ #ifdef HAVE_KQUEUE #define POLLSET_USES_KQUEUE +#define POLLSET_DEFAULT_METHOD APR_POLLSET_KQUEUE #elif defined(HAVE_PORT_CREATE) #define POLLSET_USES_PORT +#define POLLSET_DEFAULT_METHOD APR_POLLSET_PORT #elif defined(HAVE_EPOLL) #define POLLSET_USES_EPOLL +#define POLLSET_DEFAULT_METHOD APR_POLLSET_EPOLL #elif defined(HAVE_POLL) #define POLLSET_USES_POLL +#define POLLSET_DEFAULT_METHOD APR_POLLSET_POLL #else #define POLLSET_USES_SELECT +#define POLLSET_DEFAULT_METHOD APR_POLLSET_SELECT #endif #ifdef HAVE_POLL @@ -79,10 +77,10 @@ #include "apr_thread_mutex.h" #define pollset_lock_rings() \ if (pollset->flags & APR_POLLSET_THREADSAFE) \ - apr_thread_mutex_lock(pollset->ring_lock); + apr_thread_mutex_lock(pollset->p->ring_lock); #define pollset_unlock_rings() \ if (pollset->flags & APR_POLLSET_THREADSAFE) \ - apr_thread_mutex_unlock(pollset->ring_lock); + apr_thread_mutex_unlock(pollset->p->ring_lock); #else #define pollset_lock_rings() #define pollset_unlock_rings() @@ -97,4 +95,65 @@ struct pfd_elem_t { #endif +typedef struct apr_pollset_private_t apr_pollset_private_t; +typedef struct apr_pollset_provider_t apr_pollset_provider_t; +typedef struct apr_pollcb_provider_t apr_pollcb_provider_t; +struct apr_pollset_t +{ + apr_pool_t *pool; + apr_uint32_t nelts; + apr_uint32_t nalloc; + apr_uint32_t flags; + /* Pipe descriptors used for wakeup */ + apr_file_t *wakeup_pipe[2]; + apr_pollset_private_t *p; + apr_pollset_provider_t *provider; +}; + +typedef union { +#if defined(HAVE_EPOLL) + struct epoll_event *epoll; +#endif +#if defined(HAVE_PORT_CREATE) + port_event_t *port; +#endif +#if defined(HAVE_KQUEUE) + struct kevent *ke; +#endif +#if defined(HAVE_POLL) + struct pollfd *ps; +#endif + void *undef; +} apr_pollcb_pset; + +struct apr_pollcb_t { + apr_pool_t *pool; + apr_uint32_t nelts; + apr_uint32_t nalloc; + int fd; + apr_pollcb_pset pollset; + apr_pollfd_t **copyset; + apr_pollcb_provider_t *provider; +}; + +struct apr_pollset_provider_t { + apr_status_t (*create)(apr_pollset_t *, apr_uint32_t, apr_pool_t *, apr_uint32_t); + apr_status_t (*add)(apr_pollset_t *, const apr_pollfd_t *); + apr_status_t (*remove)(apr_pollset_t *, const apr_pollfd_t *); + apr_status_t (*poll)(apr_pollset_t *, apr_interval_time_t, apr_int32_t *, const apr_pollfd_t **); + apr_status_t (*cleanup)(apr_pollset_t *); + const char *name; +}; + +struct apr_pollcb_provider_t { + apr_status_t (*create)(apr_pollcb_t *, apr_uint32_t, apr_pool_t *, apr_uint32_t); + apr_status_t (*add)(apr_pollcb_t *, apr_pollfd_t *); + apr_status_t (*remove)(apr_pollcb_t *, apr_pollfd_t *); + apr_status_t (*poll)(apr_pollcb_t *, apr_interval_time_t, apr_pollcb_cb_t, void *); + const char *name; +}; + +/* Private functions */ +void apr_pollset_drain_wakeup_pipe(apr_pollset_t *pollset); + #endif /* APR_ARCH_POLL_PRIVATE_H */ diff --git a/libapr.dsp b/libapr.dsp index 1210013a6fd..485f1c76167 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -464,6 +464,14 @@ SOURCE=.\passwd\apr_getpass.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\poll\unix\pollcb.c +# End Source File +# Begin Source File + +SOURCE=.\poll\unix\pollset.c +# End Source File +# Begin Source File + SOURCE=.\poll\unix\select.c # End Source File # End Group diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c index 0680c29c099..a358fafb27c 100644 --- a/poll/os2/pollset.c +++ b/poll/os2/pollset.c @@ -51,7 +51,14 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, return APR_SUCCESS; } - +APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags, + apr_pollset_method_e method); +{ + return apr_pollset_create(pollset, size, p, flags); +} APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) { diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index c8ab6d63a32..befa73cf66c 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -14,9 +14,15 @@ * limitations under the License. */ +#include "apr.h" +#include "apr_poll.h" +#include "apr_time.h" +#include "apr_portable.h" +#include "apr_arch_file_io.h" +#include "apr_arch_networkio.h" #include "apr_arch_poll_private.h" -#ifdef POLLSET_USES_EPOLL +#if defined(HAVE_EPOLL) static apr_int16_t get_epoll_event(apr_int16_t event) { @@ -56,17 +62,11 @@ static apr_int16_t get_epoll_revent(apr_int16_t event) return rv; } -struct apr_pollset_t +struct apr_pollset_private_t { - apr_pool_t *pool; - apr_uint32_t nelts; - apr_uint32_t nalloc; int epoll_fd; struct epoll_event *pollset; apr_pollfd_t *result_set; - apr_uint32_t flags; - /* Pipe descriptors used for wakeup */ - apr_file_t *wakeup_pipe[2]; #if APR_HAS_THREADS /* A thread mutex to protect operations on the rings */ apr_thread_mutex_t *ring_lock; @@ -80,65 +80,17 @@ struct apr_pollset_t APR_RING_HEAD(pfd_dead_ring_t, pfd_elem_t) dead_ring; }; -static apr_status_t backend_cleanup(void *p_) +static apr_status_t impl_pollset_cleanup(apr_pollset_t *pollset) { - apr_pollset_t *pollset = (apr_pollset_t *) p_; - close(pollset->epoll_fd); - if (pollset->flags & APR_POLLSET_WAKEABLE) { - /* Close both sides of the wakeup pipe */ - if (pollset->wakeup_pipe[0]) { - apr_file_close(pollset->wakeup_pipe[0]); - pollset->wakeup_pipe[0] = NULL; - } - if (pollset->wakeup_pipe[1]) { - apr_file_close(pollset->wakeup_pipe[1]); - pollset->wakeup_pipe[1] = NULL; - } - } + close(pollset->p->epoll_fd); return APR_SUCCESS; } -/* Create a dummy wakeup pipe for interrupting the poller - */ -static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) -{ - apr_status_t rv; - apr_pollfd_t fd; - - if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], - &pollset->wakeup_pipe[1], - pollset->pool)) != APR_SUCCESS) - return rv; - fd.reqevents = APR_POLLIN; - fd.desc_type = APR_POLL_FILE; - fd.desc.f = pollset->wakeup_pipe[0]; - /* Add the pipe to the pollset - */ - return apr_pollset_add(pollset, &fd); -} - -/* Read and discard what's ever in the wakeup pipe. - */ -static void drain_wakeup_pipe(apr_pollset_t *pollset) -{ - char rb[512]; - apr_size_t nr = sizeof(rb); - - while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { - /* Although we write just one byte to the other end of the pipe - * during wakeup, multiple treads could call the wakeup. - * So simply drain out from the input side of the pipe all - * the data. - */ - if (nr != sizeof(rb)) - break; - } -} -APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) +static apr_status_t impl_pollset_create(apr_pollset_t *pollset, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) { apr_status_t rv; int fd; @@ -149,58 +101,40 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, } fd = epoll_create(size); if (fd < 0) { - *pollset = NULL; + pollset->p = NULL; return errno; } - *pollset = apr_palloc(p, sizeof(**pollset)); + pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t)); #if APR_HAS_THREADS if ((flags & APR_POLLSET_THREADSAFE) && !(flags & APR_POLLSET_NOCOPY) && - ((rv = apr_thread_mutex_create(&(*pollset)->ring_lock, + ((rv = apr_thread_mutex_create(&pollset->p->ring_lock, APR_THREAD_MUTEX_DEFAULT, p)) != APR_SUCCESS)) { - *pollset = NULL; + pollset->p = NULL; return rv; } #else if (flags & APR_POLLSET_THREADSAFE) { - *pollset = NULL; + pollset->p = NULL; return APR_ENOTIMPL; } #endif - (*pollset)->nelts = 0; - (*pollset)->nalloc = size; - (*pollset)->flags = flags; - (*pollset)->pool = p; - (*pollset)->epoll_fd = fd; - (*pollset)->pollset = apr_palloc(p, size * sizeof(struct epoll_event)); - (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + pollset->p->epoll_fd = fd; + pollset->p->pollset = apr_palloc(p, size * sizeof(struct epoll_event)); + pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); if (!(flags & APR_POLLSET_NOCOPY)) { - APR_RING_INIT(&(*pollset)->query_ring, pfd_elem_t, link); - APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link); - APR_RING_INIT(&(*pollset)->dead_ring, pfd_elem_t, link); + APR_RING_INIT(&pollset->p->query_ring, pfd_elem_t, link); + APR_RING_INIT(&pollset->p->free_ring, pfd_elem_t, link); + APR_RING_INIT(&pollset->p->dead_ring, pfd_elem_t, link); } - if (flags & APR_POLLSET_WAKEABLE) { - /* Create wakeup pipe */ - if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { - close(fd); - *pollset = NULL; - return rv; - } - } - apr_pool_cleanup_register(p, *pollset, backend_cleanup, backend_cleanup); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) -{ - return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup); -} - -APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +static apr_status_t impl_pollset_add(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) { struct epoll_event ev = {0}; int ret = -1; @@ -215,8 +149,8 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, else { pollset_lock_rings(); - if (!APR_RING_EMPTY(&(pollset->free_ring), pfd_elem_t, link)) { - elem = APR_RING_FIRST(&(pollset->free_ring)); + if (!APR_RING_EMPTY(&(pollset->p->free_ring), pfd_elem_t, link)) { + elem = APR_RING_FIRST(&(pollset->p->free_ring)); APR_RING_REMOVE(elem, link); } else { @@ -227,11 +161,11 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, ev.data.ptr = elem; } if (descriptor->desc_type == APR_POLL_SOCKET) { - ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_ADD, + ret = epoll_ctl(pollset->p->epoll_fd, EPOLL_CTL_ADD, descriptor->desc.s->socketdes, &ev); } else { - ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_ADD, + ret = epoll_ctl(pollset->p->epoll_fd, EPOLL_CTL_ADD, descriptor->desc.f->filedes, &ev); } @@ -243,11 +177,11 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, else { if (0 != ret) { rv = APR_EBADF; - APR_RING_INSERT_TAIL(&(pollset->free_ring), elem, pfd_elem_t, link); + APR_RING_INSERT_TAIL(&(pollset->p->free_ring), elem, pfd_elem_t, link); } else { pollset->nelts++; - APR_RING_INSERT_TAIL(&(pollset->query_ring), elem, pfd_elem_t, link); + APR_RING_INSERT_TAIL(&(pollset->p->query_ring), elem, pfd_elem_t, link); } pollset_unlock_rings(); } @@ -255,8 +189,8 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) { pfd_elem_t *ep; apr_status_t rv = APR_SUCCESS; @@ -266,11 +200,11 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, ev.events = get_epoll_event(descriptor->reqevents); if (descriptor->desc_type == APR_POLL_SOCKET) { - ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_DEL, + ret = epoll_ctl(pollset->p->epoll_fd, EPOLL_CTL_DEL, descriptor->desc.s->socketdes, &ev); } else { - ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_DEL, + ret = epoll_ctl(pollset->p->epoll_fd, EPOLL_CTL_DEL, descriptor->desc.f->filedes, &ev); } if (ret < 0) { @@ -280,15 +214,15 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, if (!(pollset->flags & APR_POLLSET_NOCOPY)) { pollset_lock_rings(); - if (!APR_RING_EMPTY(&(pollset->query_ring), pfd_elem_t, link)) { - for (ep = APR_RING_FIRST(&(pollset->query_ring)); - ep != APR_RING_SENTINEL(&(pollset->query_ring), + if (!APR_RING_EMPTY(&(pollset->p->query_ring), pfd_elem_t, link)) { + for (ep = APR_RING_FIRST(&(pollset->p->query_ring)); + ep != APR_RING_SENTINEL(&(pollset->p->query_ring), pfd_elem_t, link); ep = APR_RING_NEXT(ep, link)) { if (descriptor->desc.s == ep->pfd.desc.s) { APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->dead_ring), + APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), ep, pfd_elem_t, link); break; } @@ -301,7 +235,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, +static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, apr_interval_time_t timeout, apr_int32_t *num, const apr_pollfd_t **descriptors) @@ -314,7 +248,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, timeout /= 1000; } - ret = epoll_wait(pollset->epoll_fd, pollset->pollset, pollset->nalloc, + ret = epoll_wait(pollset->p->epoll_fd, pollset->p->pollset, pollset->nalloc, timeout); (*num) = ret; @@ -327,20 +261,20 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, else { if (pollset->flags & APR_POLLSET_NOCOPY) { for (i = 0, j = 0; i < ret; i++) { - fd = *((apr_pollfd_t *) (pollset->pollset[i].data.ptr)); + fd = *((apr_pollfd_t *)(pollset->p->pollset[i].data.ptr)); /* Check if the polled descriptor is our * wakeup pipe. In that case do not put it result set. */ if ((pollset->flags & APR_POLLSET_WAKEABLE) && fd.desc_type == APR_POLL_FILE && fd.desc.f == pollset->wakeup_pipe[0]) { - drain_wakeup_pipe(pollset); + apr_pollset_drain_wakeup_pipe(pollset); rv = APR_EINTR; } else { - pollset->result_set[j] = fd; - pollset->result_set[j].rtnevents = - get_epoll_revent(pollset->pollset[i].events); + pollset->p->result_set[j] = fd; + pollset->p->result_set[j].rtnevents = + get_epoll_revent(pollset->p->pollset[i].events); j++; } } @@ -349,17 +283,17 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } else { for (i = 0, j = 0; i < ret; i++) { - fd = (((pfd_elem_t *) (pollset->pollset[i].data.ptr))->pfd); + fd = (((pfd_elem_t *) (pollset->p->pollset[i].data.ptr))->pfd); if ((pollset->flags & APR_POLLSET_WAKEABLE) && fd.desc_type == APR_POLL_FILE && fd.desc.f == pollset->wakeup_pipe[0]) { - drain_wakeup_pipe(pollset); + apr_pollset_drain_wakeup_pipe(pollset); rv = APR_EINTR; } else { - pollset->result_set[j] = fd; - pollset->result_set[j].rtnevents = - get_epoll_revent(pollset->pollset[i].events); + pollset->p->result_set[j] = fd; + pollset->p->result_set[j].rtnevents = + get_epoll_revent(pollset->p->pollset[i].events); j++; } } @@ -368,7 +302,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } if (descriptors) { - *descriptors = pollset->result_set; + *descriptors = pollset->p->result_set; } } @@ -376,7 +310,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); /* Shift all PFDs in the Dead Ring to be Free Ring */ - APR_RING_CONCAT(&(pollset->free_ring), &(pollset->dead_ring), pfd_elem_t, link); + APR_RING_CONCAT(&(pollset->p->free_ring), &(pollset->p->dead_ring), pfd_elem_t, link); pollset_unlock_rings(); } @@ -384,54 +318,46 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) -{ - if (pollset->flags & APR_POLLSET_WAKEABLE) - return apr_file_putc(1, pollset->wakeup_pipe[1]); - else - return APR_EINIT; -} - -struct apr_pollcb_t { - apr_pool_t *pool; - apr_uint32_t nalloc; - struct epoll_event *pollset; - int epoll_fd; +static apr_pollset_provider_t impl = { + impl_pollset_create, + impl_pollset_add, + impl_pollset_remove, + impl_pollset_poll, + impl_pollset_cleanup, + "epool" }; +apr_pollset_provider_t *apr_pollset_provider_epoll = &impl; + static apr_status_t cb_cleanup(void *p_) { apr_pollcb_t *pollcb = (apr_pollcb_t *) p_; - close(pollcb->epoll_fd); + close(pollcb->fd); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) +static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) { int fd; fd = epoll_create(size); if (fd < 0) { - *pollcb = NULL; return apr_get_netos_error(); } - *pollcb = apr_palloc(p, sizeof(**pollcb)); - (*pollcb)->nalloc = size; - (*pollcb)->pool = p; - (*pollcb)->epoll_fd = fd; - (*pollcb)->pollset = apr_palloc(p, size * sizeof(struct epoll_event)); - apr_pool_cleanup_register(p, *pollcb, cb_cleanup, cb_cleanup); + pollcb->fd = fd; + pollcb->pollset.epoll = apr_palloc(p, size * sizeof(struct epoll_event)); + apr_pool_cleanup_register(p, pollcb, cb_cleanup, cb_cleanup); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, - apr_pollfd_t *descriptor) +static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) { struct epoll_event ev; int ret; @@ -440,11 +366,11 @@ APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, ev.data.ptr = (void *)descriptor; if (descriptor->desc_type == APR_POLL_SOCKET) { - ret = epoll_ctl(pollcb->epoll_fd, EPOLL_CTL_ADD, + ret = epoll_ctl(pollcb->fd, EPOLL_CTL_ADD, descriptor->desc.s->socketdes, &ev); } else { - ret = epoll_ctl(pollcb->epoll_fd, EPOLL_CTL_ADD, + ret = epoll_ctl(pollcb->fd, EPOLL_CTL_ADD, descriptor->desc.f->filedes, &ev); } @@ -455,8 +381,8 @@ APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, - apr_pollfd_t *descriptor) +static apr_status_t impl_pollcb_remove(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) { apr_status_t rv = APR_SUCCESS; struct epoll_event ev; @@ -465,11 +391,11 @@ APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, ev.events = get_epoll_event(descriptor->reqevents); if (descriptor->desc_type == APR_POLL_SOCKET) { - ret = epoll_ctl(pollcb->epoll_fd, EPOLL_CTL_DEL, + ret = epoll_ctl(pollcb->fd, EPOLL_CTL_DEL, descriptor->desc.s->socketdes, &ev); } else { - ret = epoll_ctl(pollcb->epoll_fd, EPOLL_CTL_DEL, + ret = epoll_ctl(pollcb->fd, EPOLL_CTL_DEL, descriptor->desc.f->filedes, &ev); } @@ -481,10 +407,10 @@ APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, } -APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, - apr_interval_time_t timeout, - apr_pollcb_cb_t func, - void *baton) +static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, + apr_interval_time_t timeout, + apr_pollcb_cb_t func, + void *baton) { int ret, i; apr_status_t rv = APR_SUCCESS; @@ -493,7 +419,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, timeout /= 1000; } - ret = epoll_wait(pollcb->epoll_fd, pollcb->pollset, pollcb->nalloc, + ret = epoll_wait(pollcb->fd, pollcb->pollset.epoll, pollcb->nalloc, timeout); if (ret < 0) { rv = apr_get_netos_error(); @@ -503,8 +429,8 @@ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, } else { for (i = 0; i < ret; i++) { - apr_pollfd_t *pollfd = (apr_pollfd_t *)(pollcb->pollset[i].data.ptr); - pollfd->rtnevents = get_epoll_revent(pollcb->pollset[i].events); + apr_pollfd_t *pollfd = (apr_pollfd_t *)(pollcb->pollset.epoll[i].data.ptr); + pollfd->rtnevents = get_epoll_revent(pollcb->pollset.epoll[i].events); rv = func(baton, pollfd); if (rv) { @@ -516,4 +442,14 @@ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, return rv; } -#endif /* POLLSET_USES_EPOLL */ +static apr_pollcb_provider_t impl_cb = { + impl_pollcb_create, + impl_pollcb_add, + impl_pollcb_remove, + impl_pollcb_poll, + "epoll" +}; + +apr_pollcb_provider_t *apr_pollcb_provider_epoll = &impl_cb; + +#endif /* HAVE_EPOLL */ diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 406eba6e96c..d7b67803055 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -14,9 +14,15 @@ * limitations under the License. */ +#include "apr.h" +#include "apr_poll.h" +#include "apr_time.h" +#include "apr_portable.h" +#include "apr_arch_file_io.h" +#include "apr_arch_networkio.h" #include "apr_arch_poll_private.h" -#ifdef POLLSET_USES_KQUEUE +#ifdef HAVE_KQUEUE static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags) { @@ -34,18 +40,12 @@ static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags) return rv; } -struct apr_pollset_t +struct apr_pollset_private_t { - apr_pool_t *pool; - apr_uint32_t nelts; - apr_uint32_t nalloc; int kqueue_fd; struct kevent kevent; struct kevent *ke_set; apr_pollfd_t *result_set; - apr_uint32_t flags; - /* Pipe descriptors used for wakeup */ - apr_file_t *wakeup_pipe[2]; #if APR_HAS_THREADS /* A thread mutex to protect operations on the rings */ apr_thread_mutex_t *ring_lock; @@ -59,129 +59,56 @@ struct apr_pollset_t APR_RING_HEAD(pfd_dead_ring_t, pfd_elem_t) dead_ring; }; -static apr_status_t backend_cleanup(void *p_) +static apr_status_t impl_pollset_cleanup(apr_pollset_t *pollset) { - apr_pollset_t *pollset = (apr_pollset_t *) p_; - close(pollset->kqueue_fd); - if (pollset->flags & APR_POLLSET_WAKEABLE) { - /* Close both sides of the wakeup pipe */ - if (pollset->wakeup_pipe[0]) { - apr_file_close(pollset->wakeup_pipe[0]); - pollset->wakeup_pipe[0] = NULL; - } - if (pollset->wakeup_pipe[1]) { - apr_file_close(pollset->wakeup_pipe[1]); - pollset->wakeup_pipe[1] = NULL; - } - } + close(pollset->p->kqueue_fd); return APR_SUCCESS; } -/* Create a dummy wakeup pipe for interrupting the poller - */ -static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) -{ - apr_status_t rv; - apr_pollfd_t fd; - - if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], - &pollset->wakeup_pipe[1], - pollset->pool)) != APR_SUCCESS) - return rv; - fd.reqevents = APR_POLLIN; - fd.desc_type = APR_POLL_FILE; - fd.desc.f = pollset->wakeup_pipe[0]; - /* Add the pipe to the pollset - */ - return apr_pollset_add(pollset, &fd); -} - -/* Read and discard what's ever in the wakeup pipe. - */ -static void drain_wakeup_pipe(apr_pollset_t *pollset) -{ - char rb[512]; - apr_size_t nr = sizeof(rb); - - while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { - /* Although we write just one byte to the other end of the pipe - * during wakeup, multiple treads could call the wakeup. - * So simply drain out from the input side of the pipe all - * the data. - */ - if (nr != sizeof(rb)) - break; - } -} - -APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) +static apr_status_t impl_pollset_create(apr_pollset_t *pollset, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) { apr_status_t rv = APR_SUCCESS; - *pollset = apr_palloc(p, sizeof(**pollset)); + pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t)); #if APR_HAS_THREADS if (flags & APR_POLLSET_THREADSAFE && - ((rv = apr_thread_mutex_create(&(*pollset)->ring_lock, + ((rv = apr_thread_mutex_create(&pollset->p->ring_lock, APR_THREAD_MUTEX_DEFAULT, p)) != APR_SUCCESS)) { - *pollset = NULL; + pollset->p = NULL; return rv; } #else if (flags & APR_POLLSET_THREADSAFE) { - *pollset = NULL; + pollset->p = NULL; return APR_ENOTIMPL; } #endif - if (flags & APR_POLLSET_WAKEABLE) { - /* Add room for wakeup descriptor */ - size++; - } - (*pollset)->nelts = 0; - (*pollset)->nalloc = size; - (*pollset)->flags = flags; - (*pollset)->pool = p; - - (*pollset)->ke_set = + pollset->p->ke_set = (struct kevent *) apr_palloc(p, size * sizeof(struct kevent)); - memset((*pollset)->ke_set, 0, size * sizeof(struct kevent)); + memset(pollset->p->ke_set, 0, size * sizeof(struct kevent)); - (*pollset)->kqueue_fd = kqueue(); + pollset->p->kqueue_fd = kqueue(); - if ((*pollset)->kqueue_fd == -1) { + if (pollset->p->kqueue_fd == -1) { return apr_get_netos_error(); } - (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); - APR_RING_INIT(&(*pollset)->query_ring, pfd_elem_t, link); - APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link); - APR_RING_INIT(&(*pollset)->dead_ring, pfd_elem_t, link); - if (flags & APR_POLLSET_WAKEABLE) { - /* Create wakeup pipe */ - if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { - close((*pollset)->kqueue_fd); - *pollset = NULL; - return rv; - } - } - apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup, - apr_pool_cleanup_null); + APR_RING_INIT(&pollset->p->query_ring, pfd_elem_t, link); + APR_RING_INIT(&pollset->p->free_ring, pfd_elem_t, link); + APR_RING_INIT(&pollset->p->dead_ring, pfd_elem_t, link); return rv; } -APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t * pollset) -{ - return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup); -} - -APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +static apr_status_t impl_pollset_add(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) { apr_os_sock_t fd; pfd_elem_t *elem; @@ -189,8 +116,8 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, pollset_lock_rings(); - if (!APR_RING_EMPTY(&(pollset->free_ring), pfd_elem_t, link)) { - elem = APR_RING_FIRST(&(pollset->free_ring)); + if (!APR_RING_EMPTY(&(pollset->p->free_ring), pfd_elem_t, link)) { + elem = APR_RING_FIRST(&(pollset->p->free_ring)); APR_RING_REMOVE(elem, link); } else { @@ -207,18 +134,18 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, } if (descriptor->reqevents & APR_POLLIN) { - EV_SET(&pollset->kevent, fd, EVFILT_READ, EV_ADD, 0, 0, elem); + EV_SET(&pollset->p->kevent, fd, EVFILT_READ, EV_ADD, 0, 0, elem); - if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, NULL) == -1) { rv = apr_get_netos_error(); } } if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) { - EV_SET(&pollset->kevent, fd, EVFILT_WRITE, EV_ADD, 0, 0, elem); + EV_SET(&pollset->p->kevent, fd, EVFILT_WRITE, EV_ADD, 0, 0, elem); - if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, NULL) == -1) { rv = apr_get_netos_error(); } @@ -226,10 +153,10 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, if (rv == APR_SUCCESS) { pollset->nelts++; - APR_RING_INSERT_TAIL(&(pollset->query_ring), elem, pfd_elem_t, link); + APR_RING_INSERT_TAIL(&(pollset->p->query_ring), elem, pfd_elem_t, link); } else { - APR_RING_INSERT_TAIL(&(pollset->free_ring), elem, pfd_elem_t, link); + APR_RING_INSERT_TAIL(&(pollset->p->free_ring), elem, pfd_elem_t, link); } pollset_unlock_rings(); @@ -237,8 +164,8 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) { pfd_elem_t *ep; apr_status_t rv = APR_SUCCESS; @@ -254,32 +181,32 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, } if (descriptor->reqevents & APR_POLLIN) { - EV_SET(&pollset->kevent, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); + EV_SET(&pollset->p->kevent, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); - if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, NULL) == -1) { rv = APR_NOTFOUND; } } if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) { - EV_SET(&pollset->kevent, fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); + EV_SET(&pollset->p->kevent, fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); - if (kevent(pollset->kqueue_fd, &pollset->kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, NULL) == -1) { rv = APR_NOTFOUND; } } - if (!APR_RING_EMPTY(&(pollset->query_ring), pfd_elem_t, link)) { - for (ep = APR_RING_FIRST(&(pollset->query_ring)); - ep != APR_RING_SENTINEL(&(pollset->query_ring), + if (!APR_RING_EMPTY(&(pollset->p->query_ring), pfd_elem_t, link)) { + for (ep = APR_RING_FIRST(&(pollset->p->query_ring)); + ep != APR_RING_SENTINEL(&(pollset->p->query_ring), pfd_elem_t, link); ep = APR_RING_NEXT(ep, link)) { if (descriptor->desc.s == ep->pfd.desc.s) { APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->dead_ring), + APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), ep, pfd_elem_t, link); break; } @@ -291,10 +218,10 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, - apr_interval_time_t timeout, - apr_int32_t *num, - const apr_pollfd_t **descriptors) +static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, + apr_interval_time_t timeout, + apr_int32_t *num, + const apr_pollfd_t **descriptors) { int ret, i, j; struct timespec tv, *tvptr; @@ -310,8 +237,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, tvptr = &tv; } - ret = kevent(pollset->kqueue_fd, NULL, 0, pollset->ke_set, pollset->nalloc, - tvptr); + ret = kevent(pollset->p->kqueue_fd, NULL, 0, pollset->p->ke_set, + pollset->nalloc, tvptr); (*num) = ret; if (ret < 0) { rv = apr_get_netos_error(); @@ -321,25 +248,25 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } else { for (i = 0, j = 0; i < ret; i++) { - fd = (((pfd_elem_t*)(pollset->ke_set[i].udata))->pfd); + fd = (((pfd_elem_t*)(pollset->p->ke_set[i].udata))->pfd); if ((pollset->flags & APR_POLLSET_WAKEABLE) && fd.desc_type == APR_POLL_FILE && fd.desc.f == pollset->wakeup_pipe[0]) { - drain_wakeup_pipe(pollset); + apr_pollset_drain_wakeup_pipe(pollset); rv = APR_EINTR; } else { - pollset->result_set[j] = fd; - pollset->result_set[j].rtnevents = - get_kqueue_revent(pollset->ke_set[i].filter, - pollset->ke_set[i].flags); + pollset->p->result_set[j] = fd; + pollset->p->result_set[j].rtnevents = + get_kqueue_revent(pollset->p->ke_set[i].filter, + pollset->p->ke_set[i].flags); j++; } } if ((*num = j)) rv = APR_SUCCESS; if (descriptors) { - *descriptors = pollset->result_set; + *descriptors = pollset->p->result_set; } } @@ -347,61 +274,54 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); /* Shift all PFDs in the Dead Ring to be Free Ring */ - APR_RING_CONCAT(&(pollset->free_ring), &(pollset->dead_ring), pfd_elem_t, link); + APR_RING_CONCAT(&(pollset->p->free_ring), &(pollset->p->dead_ring), + pfd_elem_t, link); pollset_unlock_rings(); return rv; } -APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) -{ - if (pollset->flags & APR_POLLSET_WAKEABLE) - return apr_file_putc(1, pollset->wakeup_pipe[1]); - else - return APR_EINIT; -} - -struct apr_pollcb_t { - apr_pool_t *pool; - apr_uint32_t nalloc; - struct kevent *pollset; - int kqfd; +static apr_pollset_provider_t impl = { + impl_pollset_create, + impl_pollset_add, + impl_pollset_remove, + impl_pollset_poll, + impl_pollset_cleanup, + "kqueue" }; +apr_pollset_provider_t *apr_pollset_provider_kqueue = &impl; + static apr_status_t cb_cleanup(void *b_) { apr_pollcb_t *pollcb = (apr_pollcb_t *) b_; - close(pollcb->kqfd); + close(pollcb->fd); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) +static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) { int fd; fd = kqueue(); if (fd < 0) { - *pollcb = NULL; return apr_get_netos_error(); } - *pollcb = apr_palloc(p, sizeof(**pollcb)); - (*pollcb)->nalloc = size; - (*pollcb)->pool = p; - (*pollcb)->kqfd = fd; - (*pollcb)->pollset = (struct kevent *)apr_pcalloc(p, size * sizeof(struct kevent)); - apr_pool_cleanup_register(p, *pollcb, cb_cleanup, cb_cleanup); + pollcb->fd = fd; + pollcb->pollset.ke = (struct kevent *)apr_pcalloc(p, size * sizeof(struct kevent)); + apr_pool_cleanup_register(p, pollcb, cb_cleanup, cb_cleanup); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, - apr_pollfd_t *descriptor) +static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) { apr_os_sock_t fd; struct kevent ev; @@ -417,7 +337,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, if (descriptor->reqevents & APR_POLLIN) { EV_SET(&ev, fd, EVFILT_READ, EV_ADD, 0, 0, descriptor); - if (kevent(pollcb->kqfd, &ev, 1, NULL, 0, NULL) == -1) { + if (kevent(pollcb->fd, &ev, 1, NULL, 0, NULL) == -1) { rv = apr_get_netos_error(); } } @@ -425,7 +345,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) { EV_SET(&ev, fd, EVFILT_WRITE, EV_ADD, 0, 0, descriptor); - if (kevent(pollcb->kqfd, &ev, 1, NULL, 0, NULL) == -1) { + if (kevent(pollcb->fd, &ev, 1, NULL, 0, NULL) == -1) { rv = apr_get_netos_error(); } } @@ -433,8 +353,8 @@ APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, return rv; } -APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, - apr_pollfd_t *descriptor) +static apr_status_t impl_pollcb_remove(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) { apr_status_t rv = APR_SUCCESS; struct kevent ev; @@ -450,7 +370,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, if (descriptor->reqevents & APR_POLLIN) { EV_SET(&ev, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); - if (kevent(pollcb->kqfd, &ev, 1, NULL, 0, NULL) == -1) { + if (kevent(pollcb->fd, &ev, 1, NULL, 0, NULL) == -1) { rv = APR_NOTFOUND; } } @@ -461,7 +381,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, */ EV_SET(&ev, fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); - if (kevent(pollcb->kqfd, &ev, 1, NULL, 0, NULL) == -1) { + if (kevent(pollcb->fd, &ev, 1, NULL, 0, NULL) == -1) { rv = APR_NOTFOUND; } } @@ -470,10 +390,10 @@ APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, } -APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, - apr_interval_time_t timeout, - apr_pollcb_cb_t func, - void *baton) +static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, + apr_interval_time_t timeout, + apr_pollcb_cb_t func, + void *baton) { int ret, i; struct timespec tv, *tvptr; @@ -488,7 +408,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, tvptr = &tv; } - ret = kevent(pollcb->kqfd, NULL, 0, pollcb->pollset, pollcb->nalloc, + ret = kevent(pollcb->fd, NULL, 0, pollcb->pollset.ke, pollcb->nalloc, tvptr); if (ret < 0) { @@ -499,10 +419,10 @@ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, } else { for (i = 0; i < ret; i++) { - apr_pollfd_t *pollfd = (apr_pollfd_t *)(pollcb->pollset[i].udata); + apr_pollfd_t *pollfd = (apr_pollfd_t *)(pollcb->pollset.ke[i].udata); - pollfd->rtnevents = get_kqueue_revent(pollcb->pollset[i].filter, - pollcb->pollset[i].flags); + pollfd->rtnevents = get_kqueue_revent(pollcb->pollset.ke[i].filter, + pollcb->pollset.ke[i].flags); rv = func(baton, pollfd); @@ -515,4 +435,14 @@ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, return rv; } -#endif /* POLLSET_USES_KQUEUE */ +static apr_pollcb_provider_t impl_cb = { + impl_pollcb_create, + impl_pollcb_add, + impl_pollcb_remove, + impl_pollcb_poll, + "kqueue" +}; + +apr_pollcb_provider_t *apr_pollcb_provider_kqueue = &impl_cb; + +#endif /* HAVE_KQUEUE */ diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 29a5f6655b8..ed0173f59d8 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -14,9 +14,16 @@ * limitations under the License. */ +#include "apr.h" +#include "apr_poll.h" +#include "apr_time.h" +#include "apr_portable.h" +#include "apr_arch_file_io.h" +#include "apr_arch_networkio.h" +#include "apr_arch_misc.h" #include "apr_arch_poll_private.h" -#if defined(POLL_USES_POLL) || defined(POLLSET_USES_POLL) +#if defined(HAVE_POLL) #ifdef HAVE_ALLOCA_H #include @@ -62,9 +69,6 @@ static apr_int16_t get_revent(apr_int16_t event) return rv; } -#endif /* POLL_USES_POLL || POLLSET_USES_POLL */ - - #ifdef POLL_USES_POLL #define SMALL_POLLSET_LIMIT 8 @@ -148,163 +152,70 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, #endif /* POLL_USES_POLL */ - -#ifdef POLLSET_USES_POLL - -struct apr_pollset_t +struct apr_pollset_private_t { - apr_pool_t *pool; - apr_uint32_t nelts; - apr_uint32_t nalloc; - apr_uint32_t flags; - /* Pipe descriptors used for wakeup */ - apr_file_t *wakeup_pipe[2]; struct pollfd *pollset; apr_pollfd_t *query_set; apr_pollfd_t *result_set; }; -/* Create a dummy wakeup pipe for interrupting the poller - */ -static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) -{ - apr_status_t rv; - apr_pollfd_t fd; - - if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], - &pollset->wakeup_pipe[1], - pollset->pool)) != APR_SUCCESS) - return rv; - fd.reqevents = APR_POLLIN; - fd.desc_type = APR_POLL_FILE; - fd.desc.f = pollset->wakeup_pipe[0]; - /* Add the pipe to the pollset - */ - return apr_pollset_add(pollset, &fd); -} - -/* Read and discard what's ever in the wakeup pipe. - */ -static void drain_wakeup_pipe(apr_pollset_t *pollset) -{ - char rb[512]; - apr_size_t nr = sizeof(rb); - - while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { - /* Although we write just one byte to the other end of the pipe - * during wakeup, multiple treads could call the wakeup. - * So simply drain out from the input side of the pipe all - * the data. - */ - if (nr != sizeof(rb)) - break; - } -} - -static apr_status_t wakeup_pipe_cleanup(void *p) -{ - apr_pollset_t *pollset = (apr_pollset_t *) p; - if (pollset->flags & APR_POLLSET_WAKEABLE) { - /* Close both sides of the wakeup pipe */ - if (pollset->wakeup_pipe[0]) { - apr_file_close(pollset->wakeup_pipe[0]); - pollset->wakeup_pipe[0] = NULL; - } - if (pollset->wakeup_pipe[1]) { - apr_file_close(pollset->wakeup_pipe[1]); - pollset->wakeup_pipe[1] = NULL; - } - } - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) +static apr_status_t impl_pollset_create(apr_pollset_t *pollset, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) { if (flags & APR_POLLSET_THREADSAFE) { - *pollset = NULL; return APR_ENOTIMPL; } - if (flags & APR_POLLSET_WAKEABLE) { - /* Add room for wakeup descriptor */ - size++; - } + pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t)); + pollset->p->pollset = apr_palloc(p, size * sizeof(struct pollfd)); + pollset->p->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); - *pollset = apr_palloc(p, sizeof(**pollset)); - (*pollset)->nelts = 0; - (*pollset)->nalloc = size; - (*pollset)->pool = p; - (*pollset)->flags = flags; - (*pollset)->pollset = apr_palloc(p, size * sizeof(struct pollfd)); - (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); - (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); - - if (flags & APR_POLLSET_WAKEABLE) { - apr_status_t rv; - /* Create wakeup pipe */ - if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { - *pollset = NULL; - return rv; - } - apr_pool_cleanup_register(p, *pollset, wakeup_pipe_cleanup, - apr_pool_cleanup_null); - } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) -{ - if (pollset->flags & APR_POLLSET_WAKEABLE) - return apr_pool_cleanup_run(pollset->pool, pollset, - wakeup_pipe_cleanup); - else - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +static apr_status_t impl_pollset_add(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) { if (pollset->nelts == pollset->nalloc) { return APR_ENOMEM; } - pollset->query_set[pollset->nelts] = *descriptor; + pollset->p->query_set[pollset->nelts] = *descriptor; if (descriptor->desc_type == APR_POLL_SOCKET) { - pollset->pollset[pollset->nelts].fd = descriptor->desc.s->socketdes; + pollset->p->pollset[pollset->nelts].fd = descriptor->desc.s->socketdes; } else { - pollset->pollset[pollset->nelts].fd = descriptor->desc.f->filedes; + pollset->p->pollset[pollset->nelts].fd = descriptor->desc.f->filedes; } - pollset->pollset[pollset->nelts].events = + pollset->p->pollset[pollset->nelts].events = get_event(descriptor->reqevents); pollset->nelts++; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) { apr_uint32_t i; for (i = 0; i < pollset->nelts; i++) { - if (descriptor->desc.s == pollset->query_set[i].desc.s) { + if (descriptor->desc.s == pollset->p->query_set[i].desc.s) { /* Found an instance of the fd: remove this and any other copies */ apr_uint32_t dst = i; apr_uint32_t old_nelts = pollset->nelts; pollset->nelts--; for (i++; i < old_nelts; i++) { - if (descriptor->desc.s == pollset->query_set[i].desc.s) { + if (descriptor->desc.s == pollset->p->query_set[i].desc.s) { pollset->nelts--; } else { - pollset->pollset[dst] = pollset->pollset[i]; - pollset->query_set[dst] = pollset->query_set[i]; + pollset->p->pollset[dst] = pollset->p->pollset[i]; + pollset->p->query_set[dst] = pollset->p->query_set[i]; dst++; } } @@ -315,10 +226,10 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, return APR_NOTFOUND; } -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, - apr_interval_time_t timeout, - apr_int32_t *num, - const apr_pollfd_t **descriptors) +static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, + apr_interval_time_t timeout, + apr_int32_t *num, + const apr_pollfd_t **descriptors) { int ret; apr_status_t rv = APR_SUCCESS; @@ -327,7 +238,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, if (timeout > 0) { timeout /= 1000; } - ret = poll(pollset->pollset, pollset->nelts, timeout); + ret = poll(pollset->p->pollset, pollset->nelts, timeout); (*num) = ret; if (ret < 0) { return apr_get_netos_error(); @@ -337,20 +248,20 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } else { for (i = 0, j = 0; i < pollset->nelts; i++) { - if (pollset->pollset[i].revents != 0) { + if (pollset->p->pollset[i].revents != 0) { /* Check if the polled descriptor is our * wakeup pipe. In that case do not put it result set. */ if ((pollset->flags & APR_POLLSET_WAKEABLE) && - pollset->query_set[i].desc_type == APR_POLL_FILE && - pollset->query_set[i].desc.f == pollset->wakeup_pipe[0]) { - drain_wakeup_pipe(pollset); + pollset->p->query_set[i].desc_type == APR_POLL_FILE && + pollset->p->query_set[i].desc.f == pollset->wakeup_pipe[0]) { + apr_pollset_drain_wakeup_pipe(pollset); rv = APR_EINTR; } else { - pollset->result_set[j] = pollset->query_set[i]; - pollset->result_set[j].rtnevents = - get_revent(pollset->pollset[i].revents); + pollset->p->result_set[j] = pollset->p->query_set[i]; + pollset->p->result_set[j].rtnevents = + get_revent(pollset->p->pollset[i].revents); j++; } } @@ -359,45 +270,134 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, rv = APR_SUCCESS; } if (descriptors && (*num)) - *descriptors = pollset->result_set; + *descriptors = pollset->p->result_set; return rv; } -APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) +static apr_pollset_provider_t impl = { + impl_pollset_create, + impl_pollset_add, + impl_pollset_remove, + impl_pollset_poll, + NULL, + "pool" +}; + +apr_pollset_provider_t *apr_pollset_provider_poll = &impl; + +/* Poll method pollcb. + * This is probably usable only for WIN32 having WSAPoll + */ +static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) { - if (pollset->flags & APR_POLLSET_WAKEABLE) - return apr_file_putc(1, pollset->wakeup_pipe[1]); - else - return APR_EINIT; + pollcb->fd = -1; + pollcb->pollset.ps = apr_palloc(p, size * sizeof(struct pollfd)); + pollcb->copyset = apr_palloc(p, size * sizeof(apr_pollfd_t *)); + + return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) +static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) { - return APR_ENOTIMPL; + if (pollcb->nelts == pollcb->nalloc) { + return APR_ENOMEM; + } + + if (descriptor->desc_type == APR_POLL_SOCKET) { + pollcb->pollset.ps[pollcb->nelts].fd = descriptor->desc.s->socketdes; + } + else { + pollcb->pollset.ps[pollcb->nelts].fd = descriptor->desc.f->filedes; + } + + pollcb->pollset.ps[pollcb->nelts].events = + get_event(descriptor->reqevents); + pollcb->copyset[pollcb->nelts] = descriptor; + pollcb->nelts++; + + return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, - apr_pollfd_t *descriptor) +static apr_status_t impl_pollcb_remove(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) { - return APR_ENOTIMPL; + int fd; + apr_uint32_t i; + + if (descriptor->desc_type == APR_POLL_SOCKET) + fd = descriptor->desc.s->socketdes; + else + fd = descriptor->desc.f->filedes; + + for (i = 0; i < pollcb->nelts; i++) { + if (descriptor->desc.s == pollcb->copyset[i]->desc.s) { + /* Found an instance of the fd: remove this and any other copies */ + apr_uint32_t dst = i; + apr_uint32_t old_nelts = pollcb->nelts; + pollcb->nelts--; + for (i++; i < old_nelts; i++) { + if (descriptor->desc.s == pollcb->copyset[i]->desc.s) { + pollcb->nelts--; + } + else { + pollcb->pollset.ps[dst] = pollcb->pollset.ps[i]; + pollcb->copyset[dst] = pollcb->copyset[i]; + dst++; + } + } + return APR_SUCCESS; + } + } + + return APR_NOTFOUND; } -APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, - apr_pollfd_t *descriptor) +static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, + apr_interval_time_t timeout, + apr_pollcb_cb_t func, + void *baton) { - return APR_ENOTIMPL; + int ret; + apr_status_t rv = APR_SUCCESS; + apr_uint32_t i, j; + + if (timeout > 0) { + timeout /= 1000; + } + ret = poll(pollcb->pollset.ps, pollcb->nelts, timeout); + if (ret < 0) { + return apr_get_netos_error(); + } + else if (ret == 0) { + return APR_TIMEUP; + } + else { + for (i = 0; i < pollcb->nelts; i++) { + if (pollcb->pollset.ps[i].revents != 0) { + apr_pollfd_t *pollfd = pollcb->copyset[i]; + pollfd->rtnevents = get_revent(pollcb->pollset.ps[i].revents); + rv = func(baton, pollfd); + if (rv) { + return rv; + } + } + } + } + return rv; } +static apr_pollcb_provider_t impl_cb = { + impl_pollcb_create, + impl_pollcb_add, + impl_pollcb_remove, + impl_pollcb_poll, + "poll" +}; -APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, - apr_interval_time_t timeout, - apr_pollcb_cb_t func, - void *baton) -{ - return APR_ENOTIMPL; -} +apr_pollcb_provider_t *apr_pollcb_provider_poll = &impl_cb; -#endif /* POLLSET_USES_POLL */ +#endif /* HAVE_POLL */ diff --git a/poll/unix/port.c b/poll/unix/port.c index 73d85251141..b1149f216df 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -14,10 +14,16 @@ * limitations under the License. */ -#include "apr_arch_poll_private.h" +#include "apr.h" +#include "apr_poll.h" +#include "apr_time.h" +#include "apr_portable.h" #include "apr_atomic.h" +#include "apr_arch_file_io.h" +#include "apr_arch_networkio.h" +#include "apr_arch_poll_private.h" -#ifdef POLLSET_USES_PORT +#if defined(HAVE_PORT_CREATE) static apr_int16_t get_event(apr_int16_t event) { @@ -60,17 +66,11 @@ static apr_int16_t get_revent(apr_int16_t event) } -struct apr_pollset_t +struct apr_pollset_private_t { - apr_pool_t *pool; - apr_uint32_t nelts; - apr_uint32_t nalloc; int port_fd; port_event_t *port_set; apr_pollfd_t *result_set; - apr_uint32_t flags; - /* Pipe descriptors used for wakeup */ - apr_file_t *wakeup_pipe[2]; #if APR_HAS_THREADS /* A thread mutex to protect operations on the rings */ apr_thread_mutex_t *ring_lock; @@ -87,79 +87,30 @@ struct apr_pollset_t volatile apr_uint32_t waiting; }; -static apr_status_t backend_cleanup(void *p_) +static apr_status_t impl_pollset_cleanup(apr_pollset_t *pollset) { - apr_pollset_t *pollset = (apr_pollset_t *) p_; - close(pollset->port_fd); - if (pollset->flags & APR_POLLSET_WAKEABLE) { - /* Close both sides of the wakeup pipe */ - if (pollset->wakeup_pipe[0]) { - apr_file_close(pollset->wakeup_pipe[0]); - pollset->wakeup_pipe[0] = NULL; - } - if (pollset->wakeup_pipe[1]) { - apr_file_close(pollset->wakeup_pipe[1]); - pollset->wakeup_pipe[1] = NULL; - } - } + close(pollset->p->port_fd); return APR_SUCCESS; } -/* Create a dummy wakeup pipe for interrupting the poller - */ -static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) -{ - apr_status_t rv; - apr_pollfd_t fd; - - if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], - &pollset->wakeup_pipe[1], - pollset->pool)) != APR_SUCCESS) - return rv; - fd.reqevents = APR_POLLIN; - fd.desc_type = APR_POLL_FILE; - fd.desc.f = pollset->wakeup_pipe[0]; - /* Add the pipe to the pollset - */ - return apr_pollset_add(pollset, &fd); -} - -/* Read and discard what's ever in the wakeup pipe. - */ -static void drain_wakeup_pipe(apr_pollset_t *pollset) -{ - char rb[512]; - apr_size_t nr = sizeof(rb); - - while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { - /* Although we write just one byte to the other end of the pipe - * during wakeup, multiple treads could call the wakeup. - * So simply drain out from the input side of the pipe all - * the data. - */ - if (nr != sizeof(rb)) - break; - } -} - -APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, +static apr_status_t impl_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags) { apr_status_t rv = APR_SUCCESS; - *pollset = apr_palloc(p, sizeof(**pollset)); + pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t)); #if APR_HAS_THREADS if (flags & APR_POLLSET_THREADSAFE && - ((rv = apr_thread_mutex_create(&(*pollset)->ring_lock, + ((rv = apr_thread_mutex_create(&pollset->p->ring_lock, APR_THREAD_MUTEX_DEFAULT, p)) != APR_SUCCESS)) { - *pollset = NULL; + pollset->p = NULL; return rv; } #else if (flags & APR_POLLSET_THREADSAFE) { - *pollset = NULL; + pollset->p = NULL; return APR_ENOTIMPL; } #endif @@ -167,48 +118,29 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, /* Add room for wakeup descriptor */ size++; } - (*pollset)->waiting = 0; - (*pollset)->nelts = 0; - (*pollset)->nalloc = size; - (*pollset)->flags = flags; - (*pollset)->pool = p; + pollset->p->waiting = 0; - (*pollset)->port_set = apr_palloc(p, size * sizeof(port_event_t)); + pollset->p->port_set = apr_palloc(p, size * sizeof(port_event_t)); - (*pollset)->port_fd = port_create(); + pollset->p->port_fd = port_create(); - if ((*pollset)->port_fd < 0) { + if (pollset->p->port_fd < 0) { + pollset->p = NULL; return APR_ENOMEM; } - (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); - APR_RING_INIT(&(*pollset)->query_ring, pfd_elem_t, link); - APR_RING_INIT(&(*pollset)->add_ring, pfd_elem_t, link); - APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link); - APR_RING_INIT(&(*pollset)->dead_ring, pfd_elem_t, link); - - if (flags & APR_POLLSET_WAKEABLE) { - /* Create wakeup pipe */ - if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { - close((*pollset)->port_fd); - *pollset = NULL; - return rv; - } - } - apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup, - apr_pool_cleanup_null); + APR_RING_INIT(&pollset->p->query_ring, pfd_elem_t, link); + APR_RING_INIT(&pollset->p->add_ring, pfd_elem_t, link); + APR_RING_INIT(&pollset->p->free_ring, pfd_elem_t, link); + APR_RING_INIT(&pollset->p->dead_ring, pfd_elem_t, link); return rv; } -APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) -{ - return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup); -} - -APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +static apr_status_t impl_pollset_add(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) { apr_os_sock_t fd; pfd_elem_t *elem; @@ -217,8 +149,8 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, pollset_lock_rings(); - if (!APR_RING_EMPTY(&(pollset->free_ring), pfd_elem_t, link)) { - elem = APR_RING_FIRST(&(pollset->free_ring)); + if (!APR_RING_EMPTY(&(pollset->p->free_ring), pfd_elem_t, link)) { + elem = APR_RING_FIRST(&(pollset->p->free_ring)); APR_RING_REMOVE(elem, link); } else { @@ -234,22 +166,22 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, fd = descriptor->desc.f->filedes; } - if (apr_atomic_read32(&pollset->waiting)) { - res = port_associate(pollset->port_fd, PORT_SOURCE_FD, fd, + if (apr_atomic_read32(&pollset->p->waiting)) { + res = port_associate(pollset->p->port_fd, PORT_SOURCE_FD, fd, get_event(descriptor->reqevents), (void *)elem); if (res < 0) { rv = APR_ENOMEM; - APR_RING_INSERT_TAIL(&(pollset->free_ring), elem, pfd_elem_t, link); + APR_RING_INSERT_TAIL(&(pollset->p->free_ring), elem, pfd_elem_t, link); } else { pollset->nelts++; - APR_RING_INSERT_TAIL(&(pollset->query_ring), elem, pfd_elem_t, link); + APR_RING_INSERT_TAIL(&(pollset->p->query_ring), elem, pfd_elem_t, link); } } else { pollset->nelts++; - APR_RING_INSERT_TAIL(&(pollset->add_ring), elem, pfd_elem_t, link); + APR_RING_INSERT_TAIL(&(pollset->p->add_ring), elem, pfd_elem_t, link); } pollset_unlock_rings(); @@ -257,8 +189,8 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) { apr_os_sock_t fd; pfd_elem_t *ep; @@ -275,22 +207,22 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, fd = descriptor->desc.f->filedes; } - res = port_dissociate(pollset->port_fd, PORT_SOURCE_FD, fd); + res = port_dissociate(pollset->p->port_fd, PORT_SOURCE_FD, fd); if (res < 0) { err = errno; rv = APR_NOTFOUND; } - if (!APR_RING_EMPTY(&(pollset->query_ring), pfd_elem_t, link)) { - for (ep = APR_RING_FIRST(&(pollset->query_ring)); - ep != APR_RING_SENTINEL(&(pollset->query_ring), + if (!APR_RING_EMPTY(&(pollset->p->query_ring), pfd_elem_t, link)) { + for (ep = APR_RING_FIRST(&(pollset->p->query_ring)); + ep != APR_RING_SENTINEL(&(pollset->p->query_ring), pfd_elem_t, link); ep = APR_RING_NEXT(ep, link)) { if (descriptor->desc.s == ep->pfd.desc.s) { APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->dead_ring), + APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), ep, pfd_elem_t, link); if (ENOENT == err) { rv = APR_SUCCESS; @@ -300,15 +232,15 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, } } - if (!APR_RING_EMPTY(&(pollset->add_ring), pfd_elem_t, link)) { - for (ep = APR_RING_FIRST(&(pollset->add_ring)); - ep != APR_RING_SENTINEL(&(pollset->add_ring), + if (!APR_RING_EMPTY(&(pollset->p->add_ring), pfd_elem_t, link)) { + for (ep = APR_RING_FIRST(&(pollset->p->add_ring)); + ep != APR_RING_SENTINEL(&(pollset->p->add_ring), pfd_elem_t, link); ep = APR_RING_NEXT(ep, link)) { if (descriptor->desc.s == ep->pfd.desc.s) { APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->dead_ring), + APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), ep, pfd_elem_t, link); if (ENOENT == err) { rv = APR_SUCCESS; @@ -323,10 +255,10 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, - apr_interval_time_t timeout, - apr_int32_t *num, - const apr_pollfd_t **descriptors) +static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, + apr_interval_time_t timeout, + apr_int32_t *num, + const apr_pollfd_t **descriptors) { apr_os_sock_t fd; int ret, i, j; @@ -349,10 +281,10 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); - apr_atomic_inc32(&pollset->waiting); + apr_atomic_inc32(&pollset->p->waiting); - while (!APR_RING_EMPTY(&(pollset->add_ring), pfd_elem_t, link)) { - ep = APR_RING_FIRST(&(pollset->add_ring)); + while (!APR_RING_EMPTY(&(pollset->p->add_ring), pfd_elem_t, link)) { + ep = APR_RING_FIRST(&(pollset->p->add_ring)); APR_RING_REMOVE(ep, link); if (ep->pfd.desc_type == APR_POLL_SOCKET) { @@ -362,21 +294,21 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, fd = ep->pfd.desc.f->filedes; } - port_associate(pollset->port_fd, PORT_SOURCE_FD, + port_associate(pollset->p->port_fd, PORT_SOURCE_FD, fd, get_event(ep->pfd.reqevents), ep); - APR_RING_INSERT_TAIL(&(pollset->query_ring), ep, pfd_elem_t, link); + APR_RING_INSERT_TAIL(&(pollset->p->query_ring), ep, pfd_elem_t, link); } pollset_unlock_rings(); - ret = port_getn(pollset->port_fd, pollset->port_set, pollset->nalloc, + ret = port_getn(pollset->p->port_fd, pollset->p->port_set, pollset->nalloc, &nget, tvptr); /* decrease the waiting ASAP to reduce the window for calling port_associate within apr_pollset_add() */ - apr_atomic_dec32(&pollset->waiting); + apr_atomic_dec32(&pollset->p->waiting); (*num) = nget; if (ret == -1) { @@ -399,22 +331,22 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); for (i = 0, j = 0; i < nget; i++) { - fp = (((pfd_elem_t*)(pollset->port_set[i].portev_user))->pfd); + fp = (((pfd_elem_t*)(pollset->p->port_set[i].portev_user))->pfd); if ((pollset->flags & APR_POLLSET_WAKEABLE) && fp.desc_type == APR_POLL_FILE && fp.desc.f == pollset->wakeup_pipe[0]) { - drain_wakeup_pipe(pollset); + apr_pollset_drain_wakeup_pipe(pollset); rv = APR_EINTR; } else { - pollset->result_set[j] = fp; - pollset->result_set[j].rtnevents = - get_revent(pollset->port_set[i].portev_events); + pollset->p->result_set[j] = fp; + pollset->p->result_set[j].rtnevents = + get_revent(pollset->p->port_set[i].portev_events); - APR_RING_REMOVE((pfd_elem_t*)pollset->port_set[i].portev_user, + APR_RING_REMOVE((pfd_elem_t*)pollset->p->port_set[i].portev_user, link); - APR_RING_INSERT_TAIL(&(pollset->add_ring), - (pfd_elem_t*)pollset->port_set[i].portev_user, + APR_RING_INSERT_TAIL(&(pollset->p->add_ring), + (pfd_elem_t*)pollset->p->port_set[i].portev_user, pfd_elem_t, link); j++; } @@ -423,7 +355,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, if ((*num) = j) rv = APR_SUCCESS; if (descriptors) { - *descriptors = pollset->result_set; + *descriptors = pollset->p->result_set; } } @@ -431,61 +363,52 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); /* Shift all PFDs in the Dead Ring to be Free Ring */ - APR_RING_CONCAT(&(pollset->free_ring), &(pollset->dead_ring), pfd_elem_t, link); + APR_RING_CONCAT(&(pollset->p->free_ring), &(pollset->p->dead_ring), pfd_elem_t, link); pollset_unlock_rings(); return rv; } -APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) -{ - if (pollset->flags & APR_POLLSET_WAKEABLE) - return apr_file_putc(1, pollset->wakeup_pipe[1]); - else - return APR_EINIT; -} - -struct apr_pollcb_t { - apr_pool_t *pool; - apr_uint32_t nalloc; - port_event_t *port_set; - int port_fd; +static apr_pollset_provider_t impl = { + impl_pollset_create, + impl_pollset_add, + impl_pollset_remove, + impl_pollset_poll, + impl_pollset_cleanup, + "port" }; +apr_pollset_provider_t *apr_pollset_provider_port = &impl; + static apr_status_t cb_cleanup(void *p_) { apr_pollcb_t *pollcb = (apr_pollcb_t *) p_; - close(pollcb->port_fd); + close(pollcb->fd); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) +static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) { int fd; fd = port_create(); if (fd < 0) { - *pollcb = NULL; return apr_get_netos_error(); } - *pollcb = apr_palloc(p, sizeof(**pollcb)); - (*pollcb)->nalloc = size; - (*pollcb)->pool = p; - (*pollcb)->port_fd = fd; - (*pollcb)->port_set = apr_palloc(p, size * sizeof(port_event_t)); - apr_pool_cleanup_register(p, *pollcb, cb_cleanup, cb_cleanup); + pollcb->pollset.port = apr_palloc(p, size * sizeof(port_event_t)); + apr_pool_cleanup_register(p, pollcb, cb_cleanup, cb_cleanup); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, - apr_pollfd_t *descriptor) +static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) { int ret, fd; @@ -496,7 +419,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, fd = descriptor->desc.f->filedes; } - ret = port_associate(pollcb->port_fd, PORT_SOURCE_FD, fd, + ret = port_associate(pollcb->fd, PORT_SOURCE_FD, fd, get_event(descriptor->reqevents), descriptor); if (ret == -1) { @@ -506,8 +429,8 @@ APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, - apr_pollfd_t *descriptor) +static apr_status_t impl_pollcb_remove(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) { int fd, ret; @@ -518,7 +441,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, fd = descriptor->desc.f->filedes; } - ret = port_dissociate(pollcb->port_fd, PORT_SOURCE_FD, fd); + ret = port_dissociate(pollcb->fd, PORT_SOURCE_FD, fd); if (ret < 0) { return APR_NOTFOUND; @@ -527,10 +450,10 @@ APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, - apr_interval_time_t timeout, - apr_pollcb_cb_t func, - void *baton) +static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, + apr_interval_time_t timeout, + apr_pollcb_cb_t func, + void *baton) { int ret; apr_pollfd_t *pollfd; @@ -547,7 +470,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, tvptr = &tv; } - ret = port_getn(pollcb->port_fd, pollcb->port_set, pollcb->nalloc, + ret = port_getn(pollcb->fd, pollcb->pollset.port, pollcb->nalloc, &nget, tvptr); if (ret == -1) { @@ -563,8 +486,8 @@ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, } else { for (i = 0; i < nget; i++) { - pollfd = (apr_pollfd_t *)(pollcb->port_set[i].portev_user); - pollfd->rtnevents = get_revent(pollcb->port_set[i].portev_events); + pollfd = (apr_pollfd_t *)(pollcb->pollset.port[i].portev_user); + pollfd->rtnevents = get_revent(pollcb->pollset.port[i].portev_events); rv = func(baton, pollfd); if (rv) { @@ -577,4 +500,14 @@ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, return rv; } -#endif /* POLLSET_USES_PORT */ +static apr_pollcb_provider_t impl_cb = { + impl_pollcb_create, + impl_pollcb_add, + impl_pollcb_remove, + impl_pollcb_poll, + "port" +}; + +apr_pollcb_provider_t *apr_pollcb_provider_port = &impl_cb; + +#endif /* HAVE_PORT_CREATE */ diff --git a/poll/unix/select.c b/poll/unix/select.c index c3ad8cd7bdd..736388bb637 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -23,8 +23,8 @@ #include "apr_poll.h" #include "apr_time.h" #include "apr_portable.h" -#include "apr_arch_networkio.h" #include "apr_arch_file_io.h" +#include "apr_arch_networkio.h" #include "apr_arch_poll_private.h" #ifdef POLL_USES_SELECT @@ -167,191 +167,49 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, #endif /* POLL_USES_SELECT */ -#ifdef POLLSET_USES_SELECT - -struct apr_pollset_t +struct apr_pollset_private_t { - apr_pool_t *pool; - - apr_uint32_t nelts; - apr_uint32_t nalloc; fd_set readset, writeset, exceptset; int maxfd; apr_pollfd_t *query_set; apr_pollfd_t *result_set; apr_uint32_t flags; - /* Pipe descriptors used for wakeup */ - apr_file_t *wakeup_pipe[2]; #ifdef NETWARE int set_type; #endif }; -#if !APR_FILES_AS_SOCKETS -#if defined (WIN32) - -extern apr_status_t -apr_file_socket_pipe_create(apr_file_t **in, - apr_file_t **out, - apr_pool_t *p); - -extern apr_status_t -apr_file_socket_pipe_close(apr_file_t *file); - -/* Create a dummy wakeup socket pipe for interrupting the poller - */ -static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) -{ - apr_status_t rv; - apr_pollfd_t fd; - - if ((rv = apr_file_socket_pipe_create(&pollset->wakeup_pipe[0], - &pollset->wakeup_pipe[1], - pollset->pool)) != APR_SUCCESS) - return rv; - fd.reqevents = APR_POLLIN; - fd.desc_type = APR_POLL_FILE; - fd.desc.f = pollset->wakeup_pipe[0]; - /* Add the pipe to the pollset - */ - return apr_pollset_add(pollset, &fd); -} -#else /* !WIN32 */ -static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) -{ - return APR_ENOTIMPL; -} - -static apr_status_t apr_file_socket_pipe_close(apr_file_t *file) -{ - return APR_ENOTIMPL; -} - -#endif /* WIN32 */ -#else /* APR_FILES_AS_SOCKETS */ - -/* Create a dummy wakeup pipe for interrupting the poller - */ -static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) -{ - apr_status_t rv; - apr_pollfd_t fd; - - if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], - &pollset->wakeup_pipe[1], - pollset->pool)) != APR_SUCCESS) - return rv; - fd.reqevents = APR_POLLIN; - fd.desc_type = APR_POLL_FILE; - fd.desc.f = pollset->wakeup_pipe[0]; - /* Add the pipe to the pollset - */ - return apr_pollset_add(pollset, &fd); -} -#endif /* !APR_FILES_AS_SOCKETS */ - -/* Read and discard what's ever in the wakeup pipe. - */ -static void drain_wakeup_pipe(apr_pollset_t *pollset) -{ - char rb[512]; - apr_size_t nr = sizeof(rb); - - while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { - /* Although we write just one byte to the other end of the pipe - * during wakeup, multiple treads could call the wakeup. - * So simply drain out from the input side of the pipe all - * the data. - */ - if (nr != sizeof(rb)) - break; - } -} - -static apr_status_t wakeup_pipe_cleanup(void *p) -{ - apr_pollset_t *pollset = (apr_pollset_t *) p; - if (pollset->flags & APR_POLLSET_WAKEABLE) { - /* Close both sides of the wakeup pipe */ - if (pollset->wakeup_pipe[0]) { -#if APR_FILES_AS_SOCKETS - apr_file_close(pollset->wakeup_pipe[0]); -#else - apr_file_socket_pipe_close(pollset->wakeup_pipe[0]); -#endif - pollset->wakeup_pipe[0] = NULL; - } - if (pollset->wakeup_pipe[1]) { -#if APR_FILES_AS_SOCKETS - apr_file_close(pollset->wakeup_pipe[1]); -#else - apr_file_socket_pipe_close(pollset->wakeup_pipe[1]); -#endif - pollset->wakeup_pipe[1] = NULL; - } - } - - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) +static apr_status_t impl_pollset_create(apr_pollset_t *pollset, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) { if (flags & APR_POLLSET_THREADSAFE) { - *pollset = NULL; + pollset->p = NULL; return APR_ENOTIMPL; } - if (flags & APR_POLLSET_WAKEABLE) { - /* Add room for wakeup descriptor */ - size++; - } #ifdef FD_SETSIZE if (size > FD_SETSIZE) { - *pollset = NULL; + pollset->p = NULL; return APR_EINVAL; } #endif - *pollset = apr_palloc(p, sizeof(**pollset)); - (*pollset)->nelts = 0; - (*pollset)->nalloc = size; - (*pollset)->pool = p; - (*pollset)->flags = flags; - FD_ZERO(&((*pollset)->readset)); - FD_ZERO(&((*pollset)->writeset)); - FD_ZERO(&((*pollset)->exceptset)); - (*pollset)->maxfd = 0; + pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t)); + FD_ZERO(&(pollset->p->readset)); + FD_ZERO(&(pollset->p->writeset)); + FD_ZERO(&(pollset->p->exceptset)); + pollset->p->maxfd = 0; #ifdef NETWARE - (*pollset)->set_type = APR_NO_DESC; + pollset->p->set_type = APR_NO_DESC; #endif - (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); - (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); - - if (flags & APR_POLLSET_WAKEABLE) { - apr_status_t rv; - /* Create wakeup pipe */ - if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { - *pollset = NULL; - return rv; - } - apr_pool_cleanup_register(p, *pollset, wakeup_pipe_cleanup, - apr_pool_cleanup_null); - } - return APR_SUCCESS; -} + pollset->p->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); -APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t * pollset) -{ - if (pollset->flags & APR_POLLSET_WAKEABLE) - return apr_pool_cleanup_run(pollset->pool, pollset, - wakeup_pipe_cleanup); - else - return APR_SUCCESS; + return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +static apr_status_t impl_pollset_add(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) { apr_os_sock_t fd; @@ -359,28 +217,23 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, return APR_ENOMEM; } - pollset->query_set[pollset->nelts] = *descriptor; + pollset->p->query_set[pollset->nelts] = *descriptor; if (descriptor->desc_type == APR_POLL_SOCKET) { #ifdef NETWARE /* NetWare can't handle mixed descriptor types in select() */ - if (HAS_PIPES(pollset->set_type)) { + if (HAS_PIPES(pollset->p->set_type)) { return APR_EBADF; } else { - pollset->set_type = APR_POLL_SOCKET; + pollset->p->set_type = APR_POLL_SOCKET; } #endif fd = descriptor->desc.s->socketdes; } else { #if !APR_FILES_AS_SOCKETS - if ((pollset->flags & APR_POLLSET_WAKEABLE) && - descriptor->desc.f == pollset->wakeup_pipe[0]) { - fd = (apr_os_sock_t)descriptor->desc.f->filedes; - } - else - return APR_EBADF; + return APR_EBADF; #else #ifdef NETWARE /* NetWare can't handle mixed descriptor types in select() */ @@ -403,24 +256,24 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, } #endif if (descriptor->reqevents & APR_POLLIN) { - FD_SET(fd, &(pollset->readset)); + FD_SET(fd, &(pollset->p->readset)); } if (descriptor->reqevents & APR_POLLOUT) { - FD_SET(fd, &(pollset->writeset)); + FD_SET(fd, &(pollset->p->writeset)); } if (descriptor->reqevents & (APR_POLLPRI | APR_POLLERR | APR_POLLHUP | APR_POLLNVAL)) { - FD_SET(fd, &(pollset->exceptset)); + FD_SET(fd, &(pollset->p->exceptset)); } - if ((int) fd > pollset->maxfd) { - pollset->maxfd = (int) fd; + if ((int) fd > pollset->p->maxfd) { + pollset->p->maxfd = (int) fd; } pollset->nelts++; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t * pollset, - const apr_pollfd_t * descriptor) +static apr_status_t impl_pollset_remove(apr_pollset_t * pollset, + const apr_pollfd_t * descriptor) { apr_uint32_t i; apr_os_sock_t fd; @@ -437,25 +290,25 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t * pollset, } for (i = 0; i < pollset->nelts; i++) { - if (descriptor->desc.s == pollset->query_set[i].desc.s) { + if (descriptor->desc.s == pollset->p->query_set[i].desc.s) { /* Found an instance of the fd: remove this and any other copies */ apr_uint32_t dst = i; apr_uint32_t old_nelts = pollset->nelts; pollset->nelts--; for (i++; i < old_nelts; i++) { - if (descriptor->desc.s == pollset->query_set[i].desc.s) { + if (descriptor->desc.s == pollset->p->query_set[i].desc.s) { pollset->nelts--; } else { - pollset->query_set[dst] = pollset->query_set[i]; + pollset->p->query_set[dst] = pollset->p->query_set[i]; dst++; } } - FD_CLR(fd, &(pollset->readset)); - FD_CLR(fd, &(pollset->writeset)); - FD_CLR(fd, &(pollset->exceptset)); - if (((int) fd == pollset->maxfd) && (pollset->maxfd > 0)) { - pollset->maxfd--; + FD_CLR(fd, &(pollset->p->readset)); + FD_CLR(fd, &(pollset->p->writeset)); + FD_CLR(fd, &(pollset->p->exceptset)); + if (((int) fd == pollset->p->maxfd) && (pollset->p->maxfd > 0)) { + pollset->p->maxfd--; } return APR_SUCCESS; } @@ -464,10 +317,10 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t * pollset, return APR_NOTFOUND; } -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, - apr_interval_time_t timeout, - apr_int32_t *num, - const apr_pollfd_t **descriptors) +static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, + apr_interval_time_t timeout, + apr_int32_t *num, + const apr_pollfd_t **descriptors) { int rs; apr_uint32_t i, j; @@ -495,18 +348,18 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, tvptr = &tv; } - memcpy(&readset, &(pollset->readset), sizeof(fd_set)); - memcpy(&writeset, &(pollset->writeset), sizeof(fd_set)); - memcpy(&exceptset, &(pollset->exceptset), sizeof(fd_set)); + memcpy(&readset, &(pollset->p->readset), sizeof(fd_set)); + memcpy(&writeset, &(pollset->p->writeset), sizeof(fd_set)); + memcpy(&exceptset, &(pollset->p->exceptset), sizeof(fd_set)); #ifdef NETWARE - if (HAS_PIPES(pollset->set_type)) { - rs = pipe_select(pollset->maxfd + 1, &readset, &writeset, &exceptset, + if (HAS_PIPES(ppollset->p->set_type)) { + rs = pipe_select(pollset->p->maxfd + 1, &readset, &writeset, &exceptset, tvptr); } else #endif - rs = select(pollset->maxfd + 1, &readset, &writeset, &exceptset, + rs = select(pollset->p->maxfd + 1, &readset, &writeset, &exceptset, tvptr); (*num) = rs; @@ -519,13 +372,13 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, j = 0; for (i = 0; i < pollset->nelts; i++) { apr_os_sock_t fd; - if (pollset->query_set[i].desc_type == APR_POLL_SOCKET) { - fd = pollset->query_set[i].desc.s->socketdes; + if (pollset->p->query_set[i].desc_type == APR_POLL_SOCKET) { + fd = pollset->p->query_set[i].desc.s->socketdes; } else { if ((pollset->flags & APR_POLLSET_WAKEABLE) && - pollset->query_set[i].desc.f == pollset->wakeup_pipe[0]) { - drain_wakeup_pipe(pollset); + pollset->p->query_set[i].desc.f == pollset->wakeup_pipe[0]) { + apr_pollset_drain_wakeup_pipe(pollset); rv = APR_EINTR; continue; } @@ -533,22 +386,22 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, #if !APR_FILES_AS_SOCKETS return APR_EBADF; #else - fd = pollset->query_set[i].desc.f->filedes; + fd = pollset->p->query_set[i].desc.f->filedes; #endif } } if (FD_ISSET(fd, &readset) || FD_ISSET(fd, &writeset) || FD_ISSET(fd, &exceptset)) { - pollset->result_set[j] = pollset->query_set[i]; - pollset->result_set[j].rtnevents = 0; + pollset->p->result_set[j] = pollset->p->query_set[i]; + pollset->p->result_set[j].rtnevents = 0; if (FD_ISSET(fd, &readset)) { - pollset->result_set[j].rtnevents |= APR_POLLIN; + pollset->p->result_set[j].rtnevents |= APR_POLLIN; } if (FD_ISSET(fd, &writeset)) { - pollset->result_set[j].rtnevents |= APR_POLLOUT; + pollset->p->result_set[j].rtnevents |= APR_POLLOUT; } if (FD_ISSET(fd, &exceptset)) { - pollset->result_set[j].rtnevents |= APR_POLLERR; + pollset->p->result_set[j].rtnevents |= APR_POLLERR; } j++; } @@ -557,45 +410,17 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, rv = APR_SUCCESS; if (descriptors) - *descriptors = pollset->result_set; + *descriptors = pollset->p->result_set; return rv; } -APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) -{ - if (pollset->flags & APR_POLLSET_WAKEABLE) - return apr_file_putc(1, pollset->wakeup_pipe[1]); - else - return APR_EINIT; -} - -APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, - apr_pollfd_t *descriptor) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, - apr_pollfd_t *descriptor) -{ - return APR_ENOTIMPL; -} - - -APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, - apr_interval_time_t timeout, - apr_pollcb_cb_t func, - void *baton) -{ - return APR_ENOTIMPL; -} +static apr_pollset_provider_t impl = { + impl_pollset_create, + impl_pollset_add, + impl_pollset_remove, + impl_pollset_poll, + NULL, + "select" +}; -#endif /* POLLSET_USES_SELECT */ +apr_pollset_provider_t *apr_pollset_provider_select = &impl; From dd8bc430dbb211771804a4fbe12aee7fc156d554 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Fri, 13 Feb 2009 12:25:00 +0000 Subject: [PATCH 6274/7878] Implement providers for apr_pollset and apr_pollcb. Add common files git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@744096 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollcb.c | 165 +++++++++++++++++++++ poll/unix/pollset.c | 349 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 514 insertions(+) create mode 100644 poll/unix/pollcb.c create mode 100644 poll/unix/pollset.c diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c new file mode 100644 index 00000000000..36c83352f46 --- /dev/null +++ b/poll/unix/pollcb.c @@ -0,0 +1,165 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifdef WIN32 +/* POSIX defines 1024 for the FD_SETSIZE */ +#define FD_SETSIZE 1024 +#endif + +#include "apr.h" +#include "apr_poll.h" +#include "apr_time.h" +#include "apr_portable.h" +#include "apr_arch_file_io.h" +#include "apr_arch_networkio.h" +#include "apr_arch_poll_private.h" + +static apr_pollset_method_e pollset_default_method = POLLSET_DEFAULT_METHOD; +#if defined(HAVE_KQUEUE) +extern apr_pollcb_provider_t *apr_pollcb_provider_kqueue; +#endif +#if defined(HAVE_PORT_CREATE) +extern apr_pollcb_provider_t *apr_pollcb_provider_port; +#endif +#if defined(HAVE_EPOLL) +extern apr_pollcb_provider_t *apr_pollcb_provider_epoll; +#endif +#if defined(HAVE_POLL) +extern apr_pollcb_provider_t *apr_pollcb_provider_poll; +#endif + + +APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags, + apr_pollset_method_e method) +{ + apr_status_t rv; + apr_pollcb_provider_t *provider = NULL; + + if (method == APR_POLLSET_DEFAULT) + method = pollset_default_method; + while (provider == NULL) { + switch (method) { + case APR_POLLSET_KQUEUE: +#if defined(HAVE_KQUEUE) + provider = apr_pollcb_provider_kqueue; +#endif + break; + case APR_POLLSET_PORT: +#if defined(HAVE_PORT_CREATE) + provider = apr_pollcb_provider_port; +#endif + break; + case APR_POLLSET_EPOLL: +#if defined(HAVE_EPOLL) + provider = apr_pollcb_provider_epoll; +#endif + break; + case APR_POLLSET_POLL: +#if defined(HAVE_POLL) + provider = apr_pollcb_provider_poll; +#endif + break; + } + if (!provider) { + *pollcb = NULL; + if ((flags & APR_POLLSET_NODEFAULT) == APR_POLLSET_NODEFAULT) + return APR_ENOTIMPL; + if (method == pollset_default_method) + return APR_ENOTIMPL; + method = pollset_default_method; + } + } + + *pollcb = apr_palloc(p, sizeof(**pollcb)); + (*pollcb)->nalloc = size; + (*pollcb)->pool = p; + (*pollcb)->provider = provider; + + rv = (*provider->create)(*pollcb, size, p, flags); + if (rv != APR_SUCCESS) { + if (method == pollset_default_method) { + *pollcb = NULL; + return rv; + } + provider = NULL; + /* Try with default provider */ + switch (pollset_default_method) { + case APR_POLLSET_KQUEUE: +#if defined(HAVE_KQUEUE) + provider = apr_pollcb_provider_kqueue; +#endif + break; + case APR_POLLSET_PORT: +#if defined(HAVE_PORT_CREATE) + provider = apr_pollcb_provider_port; +#endif + break; + case APR_POLLSET_EPOLL: +#if defined(HAVE_EPOLL) + provider = apr_pollcb_provider_epoll; +#endif + break; + case APR_POLLSET_POLL: +#if defined(HAVE_POLL) + provider = apr_pollcb_provider_poll; +#endif + break; + } + if (!provider) + return APR_ENOTIMPL; + rv = (*provider->create)(*pollcb, size, p, flags); + if (rv != APR_SUCCESS) { + *pollcb = NULL; + return rv; + } + (*pollcb)->provider = provider; + } + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) +{ + return apr_pollcb_create_ex(pollcb, size, p, flags, + APR_POLLSET_DEFAULT); +} + +APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) +{ + return (*pollcb->provider->add)(pollcb, descriptor); +} + +APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) +{ + return (*pollcb->provider->remove)(pollcb, descriptor); +} + + +APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, + apr_interval_time_t timeout, + apr_pollcb_cb_t func, + void *baton) +{ + return (*pollcb->provider->poll)(pollcb, timeout, func, baton); +} diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c new file mode 100644 index 00000000000..b927702be4c --- /dev/null +++ b/poll/unix/pollset.c @@ -0,0 +1,349 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifdef WIN32 +/* POSIX defines 1024 for the FD_SETSIZE */ +#define FD_SETSIZE 1024 +#endif + +#include "apr.h" +#include "apr_poll.h" +#include "apr_time.h" +#include "apr_portable.h" +#include "apr_arch_file_io.h" +#include "apr_arch_networkio.h" +#include "apr_arch_poll_private.h" + +static apr_pollset_method_e pollset_default_method = POLLSET_DEFAULT_METHOD; + +#if !APR_FILES_AS_SOCKETS +#if defined (WIN32) + +extern apr_status_t +apr_file_socket_pipe_create(apr_file_t **in, + apr_file_t **out, + apr_pool_t *p); + +extern apr_status_t +apr_file_socket_pipe_close(apr_file_t *file); + +/* Create a dummy wakeup socket pipe for interrupting the poller + */ +static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) +{ + apr_status_t rv; + apr_pollfd_t fd; + + if ((rv = apr_file_socket_pipe_create(&pollset->wakeup_pipe[0], + &pollset->wakeup_pipe[1], + pollset->pool)) != APR_SUCCESS) + return rv; + fd.reqevents = APR_POLLIN; + fd.desc_type = APR_POLL_FILE; + fd.desc.f = pollset->wakeup_pipe[0]; + /* Add the pipe to the pollset + */ + return apr_pollset_add(pollset, &fd); +} + +#else /* !WIN32 */ +static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) +{ + return APR_ENOTIMPL; +} + +static apr_status_t apr_file_socket_pipe_close(apr_file_t *file) +{ + return APR_ENOTIMPL; +} + +#endif /* WIN32 */ +#else /* APR_FILES_AS_SOCKETS */ + +/* Create a dummy wakeup pipe for interrupting the poller + */ +static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) +{ + apr_status_t rv; + apr_pollfd_t fd; + + if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], + &pollset->wakeup_pipe[1], + pollset->pool)) != APR_SUCCESS) + return rv; + fd.reqevents = APR_POLLIN; + fd.desc_type = APR_POLL_FILE; + fd.desc.f = pollset->wakeup_pipe[0]; + /* Add the pipe to the pollset + */ + return apr_pollset_add(pollset, &fd); +} +#endif /* !APR_FILES_AS_SOCKETS */ + +/* Read and discard what's ever in the wakeup pipe. + */ +void apr_pollset_drain_wakeup_pipe(apr_pollset_t *pollset) +{ + char rb[512]; + apr_size_t nr = sizeof(rb); + + while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { + /* Although we write just one byte to the other end of the pipe + * during wakeup, multiple treads could call the wakeup. + * So simply drain out from the input side of the pipe all + * the data. + */ + if (nr != sizeof(rb)) + break; + } +} + +static apr_status_t pollset_cleanup(void *p) +{ + apr_pollset_t *pollset = (apr_pollset_t *) p; + if (pollset->provider->cleanup) { + (*pollset->provider->cleanup)(pollset); + } + if (pollset->flags & APR_POLLSET_WAKEABLE) { + /* Close both sides of the wakeup pipe */ + if (pollset->wakeup_pipe[0]) { +#if APR_FILES_AS_SOCKETS + apr_file_close(pollset->wakeup_pipe[0]); +#else + apr_file_socket_pipe_close(pollset->wakeup_pipe[0]); +#endif + pollset->wakeup_pipe[0] = NULL; + } + if (pollset->wakeup_pipe[1]) { +#if APR_FILES_AS_SOCKETS + apr_file_close(pollset->wakeup_pipe[1]); +#else + apr_file_socket_pipe_close(pollset->wakeup_pipe[1]); +#endif + pollset->wakeup_pipe[1] = NULL; + } + } + + return APR_SUCCESS; +} + +#if defined(HAVE_KQUEUE) +extern apr_pollset_provider_t *apr_pollset_provider_kqueue; +#endif +#if defined(HAVE_PORT_CREATE) +extern apr_pollset_provider_t *apr_pollset_provider_port; +#endif +#if defined(HAVE_EPOLL) +extern apr_pollset_provider_t *apr_pollset_provider_epoll; +#endif +#if defined(HAVE_POLL) +extern apr_pollset_provider_t *apr_pollset_provider_poll; +#endif +extern apr_pollset_provider_t *apr_pollset_provider_select; + +APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags, + apr_pollset_method_e method) +{ + apr_status_t rv; + apr_pollset_provider_t *provider = NULL; + + if (method == APR_POLLSET_DEFAULT) + method = pollset_default_method; + while (provider == NULL) { + switch (method) { + case APR_POLLSET_KQUEUE: +#if defined(HAVE_KQUEUE) + provider = apr_pollset_provider_kqueue; +#endif + break; + case APR_POLLSET_PORT: +#if defined(HAVE_PORT_CREATE) + provider = apr_pollset_provider_port; +#endif + break; + case APR_POLLSET_EPOLL: +#if defined(HAVE_EPOLL) + provider = apr_pollset_provider_epoll; +#endif + break; + case APR_POLLSET_POLL: +#if defined(HAVE_POLL) + provider = apr_pollset_provider_poll; +#endif + break; + case APR_POLLSET_SELECT: + provider = apr_pollset_provider_select; + break; + } + if (!provider) { + if ((flags & APR_POLLSET_NODEFAULT) == APR_POLLSET_NODEFAULT) + return APR_ENOTIMPL; + if (method == pollset_default_method) + return APR_ENOTIMPL; + method = pollset_default_method; + } + } + if (flags & APR_POLLSET_WAKEABLE) { + /* Add room for wakeup descriptor */ + size++; + } + + *pollset = apr_palloc(p, sizeof(**pollset)); + (*pollset)->nelts = 0; + (*pollset)->nalloc = size; + (*pollset)->pool = p; + (*pollset)->flags = flags; + (*pollset)->provider = provider; + + rv = (*provider->create)(*pollset, size, p, flags); + if (rv != APR_SUCCESS) { + if (method == pollset_default_method) { + *pollset = NULL; + return rv; + } + provider = NULL; + /* Try with default provider */ + switch (pollset_default_method) { + case APR_POLLSET_KQUEUE: +#if defined(HAVE_KQUEUE) + provider = apr_pollset_provider_kqueue; +#endif + break; + case APR_POLLSET_PORT: +#if defined(HAVE_PORT_CREATE) + provider = apr_pollset_provider_port; +#endif + break; + case APR_POLLSET_EPOLL: +#if defined(HAVE_EPOLL) + provider = apr_pollset_provider_epoll; +#endif + break; + case APR_POLLSET_POLL: +#if defined(HAVE_POLL) + provider = apr_pollset_provider_poll; +#endif + break; + case APR_POLLSET_SELECT: + provider = apr_pollset_provider_select; + break; + } + if (!provider) + return APR_ENOTIMPL; + rv = (*provider->create)(*pollset, size, p, flags); + if (rv != APR_SUCCESS) { + *pollset = NULL; + return rv; + } + (*pollset)->provider = provider; + } + if (flags & APR_POLLSET_WAKEABLE) { + /* Create wakeup pipe */ + if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { + *pollset = NULL; + return rv; + } + } + if ((flags & APR_POLLSET_WAKEABLE) || provider->cleanup) + apr_pool_cleanup_register(p, *pollset, pollset_cleanup, + apr_pool_cleanup_null); + return APR_SUCCESS; +} + +APR_DECLARE(const char *) apr_pollset_method_name(apr_pollset_t *pollset) +{ + return pollset->provider->name; +} + +APR_DECLARE(const char *) apr_poll_method_defname() +{ + switch (pollset_default_method) { + case APR_POLLSET_KQUEUE: +#if defined(HAVE_KQUEUE) + return apr_pollset_provider_kqueue->name; +#endif + break; + case APR_POLLSET_PORT: +#if defined(HAVE_PORT_CREATE) + return apr_pollset_provider_port->name; +#endif + break; + case APR_POLLSET_EPOLL: +#if defined(HAVE_EPOLL) + return apr_pollset_provider_epoll->name; +#endif + break; + case APR_POLLSET_POLL: +#if defined(HAVE_POLL) + return apr_pollset_provider_poll->name; +#endif + break; + case APR_POLLSET_SELECT: + return apr_pollset_provider_select->name; + break; + } + return "unknown"; +} + +APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) +{ + return apr_pollset_create_ex(pollset, size, p, flags, + APR_POLLSET_DEFAULT); +} + +APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t * pollset) +{ + if (pollset->flags & APR_POLLSET_WAKEABLE || + pollset->provider->cleanup) + return apr_pool_cleanup_run(pollset->pool, pollset, + pollset_cleanup); + else + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) +{ + if (pollset->flags & APR_POLLSET_WAKEABLE) + return apr_file_putc(1, pollset->wakeup_pipe[1]); + else + return APR_EINIT; +} + +APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) +{ + return (*pollset->provider->add)(pollset, descriptor); +} + +APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) +{ + return (*pollset->provider->remove)(pollset, descriptor); +} + +APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, + apr_interval_time_t timeout, + apr_int32_t *num, + const apr_pollfd_t **descriptors) +{ + return (*pollset->provider->poll)(pollset, timeout, num, descriptors); +} From d2d68ea5e89bc839b574dd0304b4c120c4aa6fc3 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 14 Feb 2009 16:35:03 +0000 Subject: [PATCH 6275/7878] Fix provider name typos git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@744513 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 2 +- poll/unix/poll.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index befa73cf66c..8bbccf504d3 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -324,7 +324,7 @@ static apr_pollset_provider_t impl = { impl_pollset_remove, impl_pollset_poll, impl_pollset_cleanup, - "epool" + "epoll" }; apr_pollset_provider_t *apr_pollset_provider_epoll = &impl; diff --git a/poll/unix/poll.c b/poll/unix/poll.c index ed0173f59d8..b661e0ff74f 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -280,7 +280,7 @@ static apr_pollset_provider_t impl = { impl_pollset_remove, impl_pollset_poll, NULL, - "pool" + "poll" }; apr_pollset_provider_t *apr_pollset_provider_poll = &impl; From 0628ac774f31e3cbe55caee782b20516b6f96673 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 14 Feb 2009 16:46:20 +0000 Subject: [PATCH 6276/7878] Fix compile time warnings by adding missing enum checks git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@744519 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollcb.c | 6 ++++++ poll/unix/pollset.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c index 36c83352f46..9fe63bb7208 100644 --- a/poll/unix/pollcb.c +++ b/poll/unix/pollcb.c @@ -75,6 +75,9 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, provider = apr_pollcb_provider_poll; #endif break; + case APR_POLLSET_SELECT: + case APR_POLLSET_DEFAULT: + break; } if (!provider) { *pollcb = NULL; @@ -120,6 +123,9 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, provider = apr_pollcb_provider_poll; #endif break; + case APR_POLLSET_SELECT: + case APR_POLLSET_DEFAULT: + break; } if (!provider) return APR_ENOTIMPL; diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index b927702be4c..159b2e6d051 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -190,6 +190,8 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, case APR_POLLSET_SELECT: provider = apr_pollset_provider_select; break; + case APR_POLLSET_DEFAULT: + break; } if (!provider) { if ((flags & APR_POLLSET_NODEFAULT) == APR_POLLSET_NODEFAULT) @@ -243,6 +245,8 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, case APR_POLLSET_SELECT: provider = apr_pollset_provider_select; break; + case APR_POLLSET_DEFAULT: + break; } if (!provider) return APR_ENOTIMPL; @@ -297,6 +301,8 @@ APR_DECLARE(const char *) apr_poll_method_defname() case APR_POLLSET_SELECT: return apr_pollset_provider_select->name; break; + case APR_POLLSET_DEFAULT: + break; } return "unknown"; } From 37621a8d6eee86719727cc8177121c3925152694 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 14 Feb 2009 16:51:54 +0000 Subject: [PATCH 6277/7878] Fix compile time warning. Check if we have only wakeup socket in which case we return the APR_EINTR git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@744521 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index b661e0ff74f..7dbe395ca5b 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -266,7 +266,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, } } } - if ((*num) = j) + if (((*num) = j) > 0) rv = APR_SUCCESS; } if (descriptors && (*num)) From bcae37f01e3543cdc96f3b7ce42b48b61fbf4eda Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 14 Feb 2009 17:48:33 +0000 Subject: [PATCH 6278/7878] Remove unused code git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@744549 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 7dbe395ca5b..18bd893dcba 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -325,14 +325,8 @@ static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb, static apr_status_t impl_pollcb_remove(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor) { - int fd; apr_uint32_t i; - if (descriptor->desc_type == APR_POLL_SOCKET) - fd = descriptor->desc.s->socketdes; - else - fd = descriptor->desc.f->filedes; - for (i = 0; i < pollcb->nelts; i++) { if (descriptor->desc.s == pollcb->copyset[i]->desc.s) { /* Found an instance of the fd: remove this and any other copies */ From 644ae6607bbd8d22b641a98e20948489841cec48 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 14 Feb 2009 17:58:37 +0000 Subject: [PATCH 6279/7878] Remember the created port fd git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@744551 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index b1149f216df..48d3a7a9f40 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -393,11 +393,9 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, apr_pool_t *p, apr_uint32_t flags) { - int fd; + pollcb->fd = port_create(); - fd = port_create(); - - if (fd < 0) { + if (pollcb->fd < 0) { return apr_get_netos_error(); } From c37ac66e594c045373e0ba5427a027167ad1dd67 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 14 Feb 2009 18:55:10 +0000 Subject: [PATCH 6280/7878] Use WSApoll if supported by winsock git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@744552 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++ apr.dsp | 4 +++ include/arch/unix/apr_arch_poll_private.h | 4 +++ include/arch/win32/apr_arch_misc.h | 34 +++++++++++++++++++++++ libapr.dsp | 4 +++ poll/unix/poll.c | 28 +++++++++++++++++-- poll/unix/select.c | 6 +++- 7 files changed, 81 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index d237b5bfb82..a29703baaeb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Win32: Use WSAPoll as default pollset method if supported and + found inside winsock dll. + [Mladen Turk] + *) Make apr_pollset and apr_pollcb implementations using providers. Added apr_pollset_create_ex and apr_pollcb_create_ex that allows choosing non-default providers. diff --git a/apr.dsp b/apr.dsp index e1251593a63..191c0c81e3a 100644 --- a/apr.dsp +++ b/apr.dsp @@ -420,6 +420,10 @@ SOURCE=.\poll\unix\pollset.c # End Source File # Begin Source File +SOURCE=.\poll\unix\poll.c +# End Source File +# Begin Source File + SOURCE=.\poll\unix\select.c # End Source File # End Group diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index c2e646b464c..48fe3043637 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -63,11 +63,15 @@ #define POLLSET_DEFAULT_METHOD APR_POLLSET_SELECT #endif +#ifdef WIN32 +#define POLL_USES_SELECT +#else #ifdef HAVE_POLL #define POLL_USES_POLL #else #define POLL_USES_SELECT #endif +#endif #if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT) diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index c7d1cb3c8f9..eac6cb5ddb0 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -436,6 +436,40 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, Process32NextW, 0, ( (hSnapshot, lppe)); #define Process32NextW apr_winapi_Process32NextW +#if !defined(POLLERR) +/* Event flag definitions for WSAPoll(). */ +#define POLLRDNORM 0x0100 +#define POLLRDBAND 0x0200 +#define POLLIN (POLLRDNORM | POLLRDBAND) +#define POLLPRI 0x0400 + +#define POLLWRNORM 0x0010 +#define POLLOUT (POLLWRNORM) +#define POLLWRBAND 0x0020 + +#define POLLERR 0x0001 +#define POLLHUP 0x0002 +#define POLLNVAL 0x0004 + +typedef struct pollfd { + SOCKET fd; + SHORT events; + SHORT revents; + +} WSAPOLLFD, *PWSAPOLLFD, FAR *LPWSAPOLLFD; + +#endif /* !defined(POLLERR) */ +#ifdef WSAPoll +#undef WSAPoll +#endif +APR_DECLARE_LATE_DLL_FUNC(DLL_WINSOCK2API, int, WSAAPI, WSAPoll, 0, ( + IN OUT LPWSAPOLLFD fdArray, + IN ULONG fds, + IN INT timeout), + (fdArray, fds, timeout)); +#define WSAPoll apr_winapi_WSAPoll +#define HAVE_POLL 1 + #endif /* !defined(_WIN32_WCE) */ #endif /* ! MISC_H */ diff --git a/libapr.dsp b/libapr.dsp index 485f1c76167..a5d3db4b397 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -472,6 +472,10 @@ SOURCE=.\poll\unix\pollset.c # End Source File # Begin Source File +SOURCE=.\poll\unix\poll.c +# End Source File +# Begin Source File + SOURCE=.\poll\unix\select.c # End Source File # End Group diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 18bd893dcba..bd24efb08e3 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -167,6 +167,11 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, if (flags & APR_POLLSET_THREADSAFE) { return APR_ENOTIMPL; } +#ifdef WIN32 + if (!APR_HAVE_LATE_DLL_FUNC(WSAPoll)) { + return APR_ENOTIMPL; + } +#endif pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t)); pollset->p->pollset = apr_palloc(p, size * sizeof(struct pollfd)); pollset->p->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); @@ -188,9 +193,16 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, pollset->p->pollset[pollset->nelts].fd = descriptor->desc.s->socketdes; } else { +#if APR_FILES_AS_SOCKETS pollset->p->pollset[pollset->nelts].fd = descriptor->desc.f->filedes; +#else + if ((pollset->flags & APR_POLLSET_WAKEABLE) && + descriptor->desc.f == pollset->wakeup_pipe[0]) + pollset->p->pollset[pollset->nelts].fd = (SOCKET)descriptor->desc.f->filedes; + else + return APR_EBADF; +#endif } - pollset->p->pollset[pollset->nelts].events = get_event(descriptor->reqevents); pollset->nelts++; @@ -238,7 +250,11 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, if (timeout > 0) { timeout /= 1000; } +#ifdef WIN32 + ret = WSAPoll(pollset->p->pollset, pollset->nelts, (int)timeout); +#else ret = poll(pollset->p->pollset, pollset->nelts, timeout); +#endif (*num) = ret; if (ret < 0) { return apr_get_netos_error(); @@ -311,7 +327,11 @@ static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb, pollcb->pollset.ps[pollcb->nelts].fd = descriptor->desc.s->socketdes; } else { +#if APR_FILES_AS_SOCKETS pollcb->pollset.ps[pollcb->nelts].fd = descriptor->desc.f->filedes; +#else + return APR_EBADF; +#endif } pollcb->pollset.ps[pollcb->nelts].events = @@ -357,12 +377,16 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, { int ret; apr_status_t rv = APR_SUCCESS; - apr_uint32_t i, j; + apr_uint32_t i; if (timeout > 0) { timeout /= 1000; } +#ifdef WIN32 + ret = WSAPoll(pollcb->pollset.ps, pollcb->nelts, (int)timeout); +#else ret = poll(pollcb->pollset.ps, pollcb->nelts, timeout); +#endif if (ret < 0) { return apr_get_netos_error(); } diff --git a/poll/unix/select.c b/poll/unix/select.c index 736388bb637..1affe8151c4 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -233,7 +233,11 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, } else { #if !APR_FILES_AS_SOCKETS - return APR_EBADF; + if ((pollset->flags & APR_POLLSET_WAKEABLE) && + descriptor->desc.f == pollset->wakeup_pipe[0]) + fd = (apr_os_sock_t)descriptor->desc.f->filedes; + else + return APR_EBADF; #else #ifdef NETWARE /* NetWare can't handle mixed descriptor types in select() */ From 08388cdc0434deef38f44872dd8d5ae072d4e30a Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 14 Feb 2009 19:12:45 +0000 Subject: [PATCH 6281/7878] For win32 first try poll instead default pollset (select) method git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@744555 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_poll_private.h | 2 ++ poll/unix/pollcb.c | 7 +++++-- poll/unix/pollset.c | 7 +++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index 48fe3043637..db43127412b 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -65,6 +65,8 @@ #ifdef WIN32 #define POLL_USES_SELECT +#undef POLLSET_DEFAULT_METHOD +#define POLLSET_DEFAULT_METHOD APR_POLLSET_SELECT #else #ifdef HAVE_POLL #define POLL_USES_POLL diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c index 9fe63bb7208..f5e98c79d39 100644 --- a/poll/unix/pollcb.c +++ b/poll/unix/pollcb.c @@ -145,8 +145,11 @@ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, apr_pool_t *p, apr_uint32_t flags) { - return apr_pollcb_create_ex(pollcb, size, p, flags, - APR_POLLSET_DEFAULT); + apr_pollset_method_e method = APR_POLLSET_DEFAULT; + #ifdef WIN32 + method = APR_POLLSET_POLL; + #endif + return apr_pollcb_create_ex(pollcb, size, p, flags, method); } APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index 159b2e6d051..40ca170376f 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -312,8 +312,11 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_pool_t *p, apr_uint32_t flags) { - return apr_pollset_create_ex(pollset, size, p, flags, - APR_POLLSET_DEFAULT); + apr_pollset_method_e method = APR_POLLSET_DEFAULT; + #ifdef WIN32 + method = APR_POLLSET_POLL; + #endif + return apr_pollset_create_ex(pollset, size, p, flags, method); } APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t * pollset) From 040c63b0923f0eea9d832fa95a50a608cbd0fd02 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sun, 15 Feb 2009 07:02:03 +0000 Subject: [PATCH 6282/7878] Add common functions for obtaining the pollset methods git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@744616 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollcb.c | 85 ++++++++++++----------------- poll/unix/pollset.c | 128 +++++++++++++++----------------------------- 2 files changed, 76 insertions(+), 137 deletions(-) diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c index f5e98c79d39..569a0c65c46 100644 --- a/poll/unix/pollcb.c +++ b/poll/unix/pollcb.c @@ -41,6 +41,36 @@ extern apr_pollcb_provider_t *apr_pollcb_provider_epoll; extern apr_pollcb_provider_t *apr_pollcb_provider_poll; #endif +static apr_pollcb_provider_t *pollcb_provider(apr_pollset_method_e method) +{ + apr_pollcb_provider_t *provider = NULL; + switch (method) { + case APR_POLLSET_KQUEUE: +#if defined(HAVE_KQUEUE) + provider = apr_pollcb_provider_kqueue; +#endif + break; + case APR_POLLSET_PORT: +#if defined(HAVE_PORT_CREATE) + provider = apr_pollcb_provider_port; +#endif + break; + case APR_POLLSET_EPOLL: +#if defined(HAVE_EPOLL) + provider = apr_pollcb_provider_epoll; +#endif + break; + case APR_POLLSET_POLL: +#if defined(HAVE_POLL) + provider = apr_pollcb_provider_poll; +#endif + break; + case APR_POLLSET_SELECT: + case APR_POLLSET_DEFAULT: + break; + } + return provider; +} APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, apr_uint32_t size, @@ -54,31 +84,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, if (method == APR_POLLSET_DEFAULT) method = pollset_default_method; while (provider == NULL) { - switch (method) { - case APR_POLLSET_KQUEUE: -#if defined(HAVE_KQUEUE) - provider = apr_pollcb_provider_kqueue; -#endif - break; - case APR_POLLSET_PORT: -#if defined(HAVE_PORT_CREATE) - provider = apr_pollcb_provider_port; -#endif - break; - case APR_POLLSET_EPOLL: -#if defined(HAVE_EPOLL) - provider = apr_pollcb_provider_epoll; -#endif - break; - case APR_POLLSET_POLL: -#if defined(HAVE_POLL) - provider = apr_pollcb_provider_poll; -#endif - break; - case APR_POLLSET_SELECT: - case APR_POLLSET_DEFAULT: - break; - } + provider = pollcb_provider(method); if (!provider) { *pollcb = NULL; if ((flags & APR_POLLSET_NODEFAULT) == APR_POLLSET_NODEFAULT) @@ -95,38 +101,13 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, (*pollcb)->provider = provider; rv = (*provider->create)(*pollcb, size, p, flags); - if (rv != APR_SUCCESS) { + if (rv == APR_ENOTIMPL) { if (method == pollset_default_method) { *pollcb = NULL; return rv; } - provider = NULL; /* Try with default provider */ - switch (pollset_default_method) { - case APR_POLLSET_KQUEUE: -#if defined(HAVE_KQUEUE) - provider = apr_pollcb_provider_kqueue; -#endif - break; - case APR_POLLSET_PORT: -#if defined(HAVE_PORT_CREATE) - provider = apr_pollcb_provider_port; -#endif - break; - case APR_POLLSET_EPOLL: -#if defined(HAVE_EPOLL) - provider = apr_pollcb_provider_epoll; -#endif - break; - case APR_POLLSET_POLL: -#if defined(HAVE_POLL) - provider = apr_pollcb_provider_poll; -#endif - break; - case APR_POLLSET_SELECT: - case APR_POLLSET_DEFAULT: - break; - } + provider = pollcb_provider(pollset_default_method); if (!provider) return APR_ENOTIMPL; rv = (*provider->create)(*pollcb, size, p, flags); diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index 40ca170376f..bf5e52564ca 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -154,6 +154,39 @@ extern apr_pollset_provider_t *apr_pollset_provider_poll; #endif extern apr_pollset_provider_t *apr_pollset_provider_select; +static apr_pollset_provider_t *pollset_provider(apr_pollset_method_e method) +{ + apr_pollset_provider_t *provider = NULL; + switch (method) { + case APR_POLLSET_KQUEUE: +#if defined(HAVE_KQUEUE) + provider = apr_pollset_provider_kqueue; +#endif + break; + case APR_POLLSET_PORT: +#if defined(HAVE_PORT_CREATE) + provider = apr_pollset_provider_port; +#endif + break; + case APR_POLLSET_EPOLL: +#if defined(HAVE_EPOLL) + provider = apr_pollset_provider_epoll; +#endif + break; + case APR_POLLSET_POLL: +#if defined(HAVE_POLL) + provider = apr_pollset_provider_poll; +#endif + break; + case APR_POLLSET_SELECT: + provider = apr_pollset_provider_select; + break; + case APR_POLLSET_DEFAULT: + break; + } + return provider; +} + APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, @@ -166,33 +199,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, if (method == APR_POLLSET_DEFAULT) method = pollset_default_method; while (provider == NULL) { - switch (method) { - case APR_POLLSET_KQUEUE: -#if defined(HAVE_KQUEUE) - provider = apr_pollset_provider_kqueue; -#endif - break; - case APR_POLLSET_PORT: -#if defined(HAVE_PORT_CREATE) - provider = apr_pollset_provider_port; -#endif - break; - case APR_POLLSET_EPOLL: -#if defined(HAVE_EPOLL) - provider = apr_pollset_provider_epoll; -#endif - break; - case APR_POLLSET_POLL: -#if defined(HAVE_POLL) - provider = apr_pollset_provider_poll; -#endif - break; - case APR_POLLSET_SELECT: - provider = apr_pollset_provider_select; - break; - case APR_POLLSET_DEFAULT: - break; - } + provider = pollset_provider(method); if (!provider) { if ((flags & APR_POLLSET_NODEFAULT) == APR_POLLSET_NODEFAULT) return APR_ENOTIMPL; @@ -214,40 +221,12 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, (*pollset)->provider = provider; rv = (*provider->create)(*pollset, size, p, flags); - if (rv != APR_SUCCESS) { + if (rv == APR_ENOTIMPL) { if (method == pollset_default_method) { *pollset = NULL; return rv; } - provider = NULL; - /* Try with default provider */ - switch (pollset_default_method) { - case APR_POLLSET_KQUEUE: -#if defined(HAVE_KQUEUE) - provider = apr_pollset_provider_kqueue; -#endif - break; - case APR_POLLSET_PORT: -#if defined(HAVE_PORT_CREATE) - provider = apr_pollset_provider_port; -#endif - break; - case APR_POLLSET_EPOLL: -#if defined(HAVE_EPOLL) - provider = apr_pollset_provider_epoll; -#endif - break; - case APR_POLLSET_POLL: -#if defined(HAVE_POLL) - provider = apr_pollset_provider_poll; -#endif - break; - case APR_POLLSET_SELECT: - provider = apr_pollset_provider_select; - break; - case APR_POLLSET_DEFAULT: - break; - } + provider = pollset_provider(method); if (!provider) return APR_ENOTIMPL; rv = (*provider->create)(*pollset, size, p, flags); @@ -277,34 +256,13 @@ APR_DECLARE(const char *) apr_pollset_method_name(apr_pollset_t *pollset) APR_DECLARE(const char *) apr_poll_method_defname() { - switch (pollset_default_method) { - case APR_POLLSET_KQUEUE: -#if defined(HAVE_KQUEUE) - return apr_pollset_provider_kqueue->name; -#endif - break; - case APR_POLLSET_PORT: -#if defined(HAVE_PORT_CREATE) - return apr_pollset_provider_port->name; -#endif - break; - case APR_POLLSET_EPOLL: -#if defined(HAVE_EPOLL) - return apr_pollset_provider_epoll->name; -#endif - break; - case APR_POLLSET_POLL: -#if defined(HAVE_POLL) - return apr_pollset_provider_poll->name; -#endif - break; - case APR_POLLSET_SELECT: - return apr_pollset_provider_select->name; - break; - case APR_POLLSET_DEFAULT: - break; - } - return "unknown"; + apr_pollset_provider_t *provider = NULL; + + provider = pollset_provider(pollset_default_method); + if (provider) + return provider->name; + else + return "unknown"; } APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, From be433756433dadf483e1315794b821ddacb09c45 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sun, 15 Feb 2009 07:10:00 +0000 Subject: [PATCH 6283/7878] On Win32 use pollcb only if winsock supports WSAPoll git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@744617 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index bd24efb08e3..7869d62eeb1 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -310,6 +310,12 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, apr_uint32_t flags) { pollcb->fd = -1; +#ifdef WIN32 + if (!APR_HAVE_LATE_DLL_FUNC(WSAPoll)) { + return APR_ENOTIMPL; + } +#endif + pollcb->pollset.ps = apr_palloc(p, size * sizeof(struct pollfd)); pollcb->copyset = apr_palloc(p, size * sizeof(apr_pollfd_t *)); From 204cf96ed9995b2f9e3be8fa3d94d5a89ad575e3 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sun, 15 Feb 2009 07:43:44 +0000 Subject: [PATCH 6284/7878] Always set return object pointer to NULL if create failed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@744622 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollcb.c | 4 +++- poll/unix/pollset.c | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c index 569a0c65c46..9010415d522 100644 --- a/poll/unix/pollcb.c +++ b/poll/unix/pollcb.c @@ -108,8 +108,10 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, } /* Try with default provider */ provider = pollcb_provider(pollset_default_method); - if (!provider) + if (!provider) { + *pollcb = NULL; return APR_ENOTIMPL; + } rv = (*provider->create)(*pollcb, size, p, flags); if (rv != APR_SUCCESS) { *pollcb = NULL; diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index bf5e52564ca..e6c422c737e 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -201,6 +201,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, while (provider == NULL) { provider = pollset_provider(method); if (!provider) { + *pollset = NULL; if ((flags & APR_POLLSET_NODEFAULT) == APR_POLLSET_NODEFAULT) return APR_ENOTIMPL; if (method == pollset_default_method) @@ -226,9 +227,11 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, *pollset = NULL; return rv; } - provider = pollset_provider(method); - if (!provider) + provider = pollset_provider(pollset_default_method); + if (!provider) { + *pollset = NULL; return APR_ENOTIMPL; + } rv = (*provider->create)(*pollset, size, p, flags); if (rv != APR_SUCCESS) { *pollset = NULL; From cf8fe892a761138a832e6970c4e80a03f13b489e Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sun, 15 Feb 2009 08:05:05 +0000 Subject: [PATCH 6285/7878] Add few comments on WSAPoll runtime usage git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@744625 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollcb.c | 7 ++++++- poll/unix/pollset.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c index 9010415d522..463ba57b5e3 100644 --- a/poll/unix/pollcb.c +++ b/poll/unix/pollcb.c @@ -130,8 +130,13 @@ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, { apr_pollset_method_e method = APR_POLLSET_DEFAULT; #ifdef WIN32 + /* This will work only if ws2_32.dll has WSAPoll funtion. + * We could check the presence of the function here, + * but someone might implement other pollcb method in + * the future. + */ method = APR_POLLSET_POLL; - #endif + #endif return apr_pollcb_create_ex(pollcb, size, p, flags, method); } diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index e6c422c737e..d3ad33b7a00 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -275,8 +275,13 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, { apr_pollset_method_e method = APR_POLLSET_DEFAULT; #ifdef WIN32 + /* Favor WSAPoll if supported. + * This will work only if ws2_32.dll has WSAPoll funtion. + * In other cases it will fall back to select() method unless + * the APR_POLLSET_NODEFAULT is added to the flags. + */ method = APR_POLLSET_POLL; - #endif + #endif return apr_pollset_create_ex(pollset, size, p, flags, method); } From b1d69f9508f1bbdedece35eb67afa95989994ffd Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Tue, 17 Feb 2009 12:00:16 +0000 Subject: [PATCH 6286/7878] Use SetDllDirectory if supported by OS in case dependent .dll's are in the same path as loading .dll, but that path is not inside the system PATH. Instead failing try to reload with the .dll path hoping all dependencies can be resolved there git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@744978 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 18 +++++++++++++++++- include/arch/win32/apr_arch_misc.h | 8 ++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index d4a689387b3..085470905d3 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -77,8 +77,24 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, os_handle = LoadLibraryExW(wpath, NULL, 0); if (!os_handle) os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); - if (!os_handle) + if (!os_handle) { +#ifndef _WIN32_WCE + apr_wchar_t *ignored; + apr_wchar_t fpath[APR_PATH_MAX]; + rv = apr_get_os_error(); + if (GetFullPathNameW(wpath, sizeof(fpath) / sizeof(apr_wchar_t), fpath, &ignored)) { + if (SetDllDirectoryW(fpath)) { + os_handle = LoadLibraryExW(fpath, NULL, 0); + if (!os_handle) + os_handle = LoadLibraryExW(fpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + if (os_handle) + rv = APR_SUCCESS; + } + } +#else rv = apr_get_os_error(); +#endif + } #ifndef _WIN32_WCE SetErrorMode(em); #endif diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index eac6cb5ddb0..b647f1ebf92 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -470,6 +470,14 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINSOCK2API, int, WSAAPI, WSAPoll, 0, ( #define WSAPoll apr_winapi_WSAPoll #define HAVE_POLL 1 +#ifdef SetDllDirectoryW +#undef SetDllDirectoryW +#endif +APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, SetDllDirectoryW, 0, ( + IN LPCWSTR lpPathName), + (lpPathName)); +#define SetDllDirectoryW apr_winapi_SetDllDirectoryW + #endif /* !defined(_WIN32_WCE) */ #endif /* ! MISC_H */ From a8145cfc0e37721cd3f37c83fcf5222112a01719 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Tue, 17 Feb 2009 15:02:25 +0000 Subject: [PATCH 6287/7878] Fix copy/paste typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@745112 13f79535-47bb-0310-9956-ffa450edef68 --- dso/win32/dso.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 085470905d3..89885e5fa0f 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -84,9 +84,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, rv = apr_get_os_error(); if (GetFullPathNameW(wpath, sizeof(fpath) / sizeof(apr_wchar_t), fpath, &ignored)) { if (SetDllDirectoryW(fpath)) { - os_handle = LoadLibraryExW(fpath, NULL, 0); + os_handle = LoadLibraryExW(wpath, NULL, 0); if (!os_handle) - os_handle = LoadLibraryExW(fpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (os_handle) rv = APR_SUCCESS; } From a8ea1cc87cbda6110d8c1e269403abfa1b29b646 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Tue, 17 Feb 2009 15:27:33 +0000 Subject: [PATCH 6288/7878] Add --disable-version option to configure. This allows to create non versioned apr libs using libtool git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@745119 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index e53d9c58d2c..c6684441aae 100644 --- a/configure.in +++ b/configure.in @@ -201,12 +201,19 @@ AC_ARG_WITH(installbuilddir, [ --with-installbuilddir=DIR location to store APR [ installbuilddir=$withval ], [ installbuilddir="${datadir}/build-${APR_MAJOR_VERSION}" ] ) AC_SUBST(installbuilddir) +AC_ARG_ENABLE(version,[ --disable-version Disable library version info], +[disable_version_info=$enableval], [disable_version_info=yes]) + AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the library], [ use_libtool=$withval ], [ use_libtool="yes" ] ) if test "x$use_libtool" = "xyes"; then lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -o $@ -c $< && touch $@' - LT_VERSION="-version-info `$get_version libtool $version_hdr APR`" + if test "x$disable_version_info" = "xyes"; then + LT_VERSION="-avoid-version" + else + LT_VERSION="-version-info `$get_version libtool $version_hdr APR`" + fi link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) \$(LT_VERSION) \$(ALL_LDFLAGS) -o \$@" so_ext='lo' lib_target='-rpath $(libdir) $(OBJECTS)' From 9a82a52cb5ab7a104132ff43f41a403a19629f86 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Tue, 17 Feb 2009 15:47:41 +0000 Subject: [PATCH 6289/7878] Oops. Fix r745119 by using enable instead disable as default git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@745127 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index c6684441aae..c2c770d8315 100644 --- a/configure.in +++ b/configure.in @@ -202,17 +202,17 @@ AC_ARG_WITH(installbuilddir, [ --with-installbuilddir=DIR location to store APR AC_SUBST(installbuilddir) AC_ARG_ENABLE(version,[ --disable-version Disable library version info], -[disable_version_info=$enableval], [disable_version_info=yes]) +[enable_version_info=$enableval], [enable_version_info=yes]) AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the library], [ use_libtool=$withval ], [ use_libtool="yes" ] ) if test "x$use_libtool" = "xyes"; then lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -o $@ -c $< && touch $@' - if test "x$disable_version_info" = "xyes"; then - LT_VERSION="-avoid-version" - else + if test "x$enable_version_info" = "xyes"; then LT_VERSION="-version-info `$get_version libtool $version_hdr APR`" + else + LT_VERSION="-avoid-version" fi link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) \$(LT_VERSION) \$(ALL_LDFLAGS) -o \$@" so_ext='lo' From 9d54fb841f833c5f6259e9438bcb0321963391af Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 19 Feb 2009 07:15:23 +0000 Subject: [PATCH 6290/7878] Enable unix domain (AF_UNIX) sockets if supported by the OS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@745763 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ build/apr_network.m4 | 30 +++++++++++++ configure.in | 1 + include/apr.h.in | 1 + include/apr.hnw | 1 + include/apr.hw | 1 + include/apr_network_io.h | 34 ++++++++++++++ include/arch/unix/apr_arch_networkio.h | 3 ++ network_io/unix/sockaddr.c | 40 +++++++++++++++++ network_io/unix/sockets.c | 61 +++++++++++++++++++++++--- network_io/unix/sockopt.c | 21 +++++++++ test/sockchild.c | 4 +- test/testsock.c | 23 +++++++--- 13 files changed, 211 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index a29703baaeb..8f1def89c62 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Added Unix domain socket support. + [Mladen Turk] + *) Win32: Use WSAPoll as default pollset method if supported and found inside winsock dll. [Mladen Turk] diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 4d479a45ad7..e2fdbdae38c 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -788,6 +788,36 @@ else fi ]) +dnl Check for presence of struct sockaddr_un. +AC_DEFUN([APR_CHECK_SOCKADDR_UN], [ +AC_CACHE_CHECK(for sockaddr_un, ac_cv_define_sockaddr_un,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_SYS_UN_H +#include +#endif +],[ +struct sockaddr_un sa; +],[ + ac_cv_define_sockaddr_un=yes +],[ + ac_cv_define_sockaddr_un=no +]) +]) + +if test "$ac_cv_define_sockaddr_un" = "yes"; then + have_sockaddr_un=1 +else + have_sockaddr_un=0 +fi +AC_SUBST(have_sockaddr_un) +]) + dnl dnl APR_H_ERRNO_COMPILE_CHECK dnl diff --git a/configure.in b/configure.in index c2c770d8315..2fb4154bdf7 100644 --- a/configure.in +++ b/configure.in @@ -2301,6 +2301,7 @@ APR_CHECK_NEGATIVE_EAI APR_CHECK_WORKING_GETNAMEINFO APR_CHECK_SOCKADDR_IN6 APR_CHECK_SOCKADDR_STORAGE +APR_CHECK_SOCKADDR_UN have_ipv6="0" if test "$user_disabled_ipv6" = 1; then diff --git a/include/apr.h.in b/include/apr.h.in index 9f1fb6f9994..bbd7e7fec2e 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -208,6 +208,7 @@ extern "C" { #define APR_HAVE_INET_ADDR @have_inet_addr@ #define APR_HAVE_INET_NETWORK @have_inet_network@ #define APR_HAVE_IPV6 @have_ipv6@ +#define APR_HAVE_SOCKADDR_UN @have_sockaddr_un@ #define APR_HAVE_MEMMOVE @have_memmove@ #define APR_HAVE_SETRLIMIT @have_setrlimit@ #define APR_HAVE_SIGACTION @have_sigaction@ diff --git a/include/apr.hnw b/include/apr.hnw index 2b2d091e92f..4e332635550 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -178,6 +178,7 @@ extern "C" { #else #define APR_HAVE_IPV6 0 #endif +#define APR_HAVE_SOCKADDR_UN 0 #define APR_HAVE_MEMCHR 1 #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 diff --git a/include/apr.hw b/include/apr.hw index 0370b0726f7..d65023eaf70 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -278,6 +278,7 @@ extern "C" { #define APR_HAVE_INET_ADDR 1 #define APR_HAVE_INET_NETWORK 0 #define APR_HAVE_IPV6 0 +#define APR_HAVE_SOCKADDR_UN 0 #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 #define APR_HAVE_SIGACTION 0 diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 4e3789d2b2e..b5eea918fb5 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -26,10 +26,14 @@ #include "apr_file_io.h" #include "apr_errno.h" #include "apr_inherit.h" +#include "apr_perms_set.h" #if APR_HAVE_NETINET_IN_H #include #endif +#if APR_HAVE_SYS_UN_H +#include +#endif #ifdef __cplusplus extern "C" { @@ -154,6 +158,25 @@ struct in_addr { #define APR_INET6 AF_INET6 #endif +#if APR_HAVE_SOCKADDR_UN +#if defined (AF_UNIX) +#define APR_UNIX AF_UNIX +#elif defined(AF_LOCAL) +#define APR_UNIX AF_LOCAL +#else +#error "Neither AF_UNIX nor AF_LOCAL is defined" +#endif +#else /* !APR_HAVE_SOCKADDR_UN */ +#if defined (AF_UNIX) +#define APR_UNIX AF_UNIX +#elif defined(AF_LOCAL) +#define APR_UNIX AF_LOCAL +#else +/* TODO: Use a smarter way to detect unique APR_UNIX value */ +#define APR_UNIX 1234 +#endif +#endif + /** * @defgroup IP_Proto IP Protocol Definitions for use when creating sockets * @{ @@ -244,6 +267,10 @@ struct apr_sockaddr_t { /** Placeholder to ensure that the size of this union is not * dependent on whether APR_HAVE_IPV6 is defined. */ struct sockaddr_storage sas; +#endif +#if APR_HAVE_SOCKADDR_UN + /** Unix domain socket sockaddr structure */ + struct sockaddr_un unx; #endif } sa; }; @@ -352,6 +379,7 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, * @param sa The new apr_sockaddr_t. * @param hostname The hostname or numeric address string to resolve/parse, or * NULL to build an address that corresponds to 0.0.0.0 or :: + * or in case of APR_UNIX family it is absolute socket filename. * @param family The address family to use, or APR_UNSPEC if the system should * decide. * @param port The port number. @@ -377,6 +405,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, apr_int32_t flags, apr_pool_t *p); + /** * Look up the host name from an apr_sockaddr_t. * @param hostname The hostname. @@ -768,6 +797,11 @@ APR_DECLARE_INHERIT_SET(socket); */ APR_DECLARE_INHERIT_UNSET(socket); +/** + * Set socket permissions. + */ +APR_PERMS_SET_IMPLEMENT(global_mutex); + /** * @defgroup apr_mcast IP Multicast * @{ diff --git a/include/arch/unix/apr_arch_networkio.h b/include/arch/unix/apr_arch_networkio.h index 91018f7c6bd..5f3189d9666 100644 --- a/include/arch/unix/apr_arch_networkio.h +++ b/include/arch/unix/apr_arch_networkio.h @@ -110,6 +110,9 @@ struct apr_socket_t { apr_interval_time_t timeout; #ifndef HAVE_POLL int connected; +#endif +#if APR_HAVE_SOCKADDR_UN + int bound; #endif int local_port_unknown; int local_interface_unknown; diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 4e79f893423..c5d3d6e3190 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -153,6 +153,14 @@ void apr_sockaddr_vars_set(apr_sockaddr_t *addr, int family, apr_port_t port) addr->ipaddr_len = sizeof(struct in6_addr); } #endif +#if APR_HAVE_SOCKADDR_UN + else if (family == APR_UNIX) { + addr->salen = sizeof(struct sockaddr_un); + addr->addr_str_len = sizeof(addr->sa.unx.sun_path);; + addr->ipaddr_ptr = &(addr->sa.unx.sun_path); + addr->ipaddr_len = addr->addr_str_len; + } +#endif } APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, @@ -564,6 +572,32 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, } #endif } + if (family == APR_UNSPEC && hostname && *hostname == '/') + family = APR_UNIX; + if (family == APR_UNIX) { +#if APR_HAVE_SOCKADDR_UN + if (hostname && *hostname == '/') { + *sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); + (*sa)->pool = p; + apr_cpystrn((*sa)->sa.unx.sun_path, hostname, + sizeof((*sa)->sa.unx.sun_path)); + (*sa)->hostname = apr_pstrdup(p, hostname); + (*sa)->family = APR_UNIX; + (*sa)->sa.unx.sun_family = APR_UNIX; + (*sa)->salen = sizeof(struct sockaddr_un); + (*sa)->addr_str_len = sizeof((*sa)->sa.unx.sun_path); + (*sa)->ipaddr_ptr = &((*sa)->sa.unx.sun_path); + (*sa)->ipaddr_len = (*sa)->addr_str_len; + + return APR_SUCCESS; + } + else +#endif + { + *sa = NULL; + return APR_ENOTIMPL; + } + } #if !APR_HAVE_IPV6 /* What may happen is that APR is not IPv6-enabled, but we're still * going to call getaddrinfo(), so we have to tell the OS we only @@ -616,6 +650,12 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, tmphostname, sizeof(tmphostname), NULL, 0, flags != 0 ? flags : NI_NAMEREQD); } +#if APR_HAVE_SOCKADDR_UN + else if (sockaddr->family == APR_UNIX) { + *hostname = sockaddr->hostname; + return APR_SUCCESS; + } +#endif else #endif rc = getnameinfo((const struct sockaddr *)&sockaddr->sa, sockaddr->salen, diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 94b26687cd8..bcf6cdd7d93 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -26,12 +26,37 @@ #define close closesocket #endif /* BEOS_R5 */ -static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */ +#if APR_HAVE_SOCKADDR_UN +#define GENERIC_INADDR_ANY_LEN sizeof(struct sockaddr_un) +#else +#define GENERIC_INADDR_ANY_LEN 16 +#endif + +/* big enough for IPv4, IPv6 and optionaly sun_path */ +static char generic_inaddr_any[GENERIC_INADDR_ANY_LEN] = {0}; static apr_status_t socket_cleanup(void *sock) { apr_socket_t *thesocket = sock; +#if APR_HAVE_SOCKADDR_UN + if (thesocket->bound && thesocket->local_addr->family == APR_UNIX) { + /* XXX: Check for return values ? */ + unlink(thesocket->local_addr->hostname); + } +#endif + if (close(thesocket->socketdes) == 0) { + thesocket->socketdes = -1; + return APR_SUCCESS; + } + else { + return errno; + } +} + +static apr_status_t socket_child_cleanup(void *sock) +{ + apr_socket_t *thesocket = sock; if (close(thesocket->socketdes) == 0) { thesocket->socketdes = -1; return APR_SUCCESS; @@ -84,6 +109,7 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, int protocol, apr_pool_t *cont) { int family = ofamily; + int oprotocol = protocol; if (family == APR_UNSPEC) { #if APR_HAVE_IPV6 @@ -92,7 +118,11 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, family = APR_INET; #endif } - +#if APR_HAVE_SOCKADDR_UN + if (family == APR_UNIX) { + protocol = 0; + } +#endif alloc_socket(new, cont); #ifndef BEOS_R5 @@ -128,12 +158,12 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, if ((*new)->socketdes < 0) { return errno; } - set_socket_vars(*new, family, type, protocol); + set_socket_vars(*new, family, type, oprotocol); (*new)->timeout = -1; (*new)->inherit = 0; apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup, - socket_cleanup); + socket_child_cleanup); return APR_SUCCESS; } @@ -158,6 +188,13 @@ apr_status_t apr_socket_bind(apr_socket_t *sock, apr_sockaddr_t *sa) else { sock->local_addr = sa; /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ +#if APR_HAVE_SOCKADDR_UN + if (sock->local_addr->family == APR_UNIX) { + sock->bound = 1; + sock->local_port_unknown = 1; + } + else +#endif if (sock->local_addr->sa.sin.sin_port == 0) { /* no need for ntohs() when comparing w/ 0 */ sock->local_port_unknown = 1; /* kernel got us an ephemeral port */ } @@ -224,6 +261,14 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, else if (sock->local_addr->sa.sin.sin_family == AF_INET6) { (*new)->local_addr->ipaddr_ptr = &(*new)->local_addr->sa.sin6.sin6_addr; } +#endif +#if APR_HAVE_SOCKADDR_UN + else if (sock->local_addr->sa.sin.sin_family == AF_UNIX) { + *(*new)->remote_addr = *sock->local_addr; + (*new)->local_addr->ipaddr_ptr = &((*new)->local_addr->sa.unx.sun_path); + (*new)->remote_addr->ipaddr_ptr = &((*new)->remote_addr->sa.unx.sun_path); + } + if (sock->local_addr->sa.sin.sin_family != AF_UNIX) #endif (*new)->remote_addr->port = ntohs((*new)->remote_addr->sa.sin.sin_port); if (sock->local_port_unknown) { @@ -299,7 +344,6 @@ apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) if (rc == -1 && errno != EISCONN) { return errno; } - if (memcmp(sa->ipaddr_ptr, generic_inaddr_any, sa->ipaddr_len)) { /* A real remote address was passed in. If the unspecified * address was used, the actual remote addr will have to be @@ -314,6 +358,13 @@ apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) /* connect() got us an ephemeral port */ sock->local_port_unknown = 1; } +#if APR_HAVE_SOCKADDR_UN + if (sock->local_addr->sa.sin.sin_family == AF_UNIX) { + /* Assign connect address as local. */ + sock->local_addr = sa; + } + else +#endif if (!memcmp(sock->local_addr->ipaddr_ptr, generic_inaddr_any, sock->local_addr->ipaddr_len)) { diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 3fc932f42f5..a5885afeff0 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -395,3 +395,24 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, return APR_SUCCESS; } #endif + +APR_PERMS_SET_IMPLEMENT(socket) +{ +#if APR_HAVE_SOCKADDR_UN + apr_status_t rv = APR_SUCCESS; + apr_socket_t *socket = (apr_socket_t *)thesocket; + + if (socket->local_addr->family == APR_UNIX) { + if (!(perms & APR_FPROT_GSETID)) + gid = -1; + if (fchown(socket->socketdes, uid, gid) < 0) { + rv = errno; + } + } + else + rv = APR_EINVAL; + return rv; +#else + return APR_ENOTIMPL; +#endif +} diff --git a/test/sockchild.c b/test/sockchild.c index 3803d00afa9..e5d52ac151a 100644 --- a/test/sockchild.c +++ b/test/sockchild.c @@ -30,11 +30,11 @@ int main(int argc, char *argv[]) atexit(apr_terminate); apr_pool_create(&p, NULL); - if (argc < 2) { + if (argc < 3) { exit(-1); } - rv = apr_sockaddr_info_get(&remote_sa, "127.0.0.1", APR_UNSPEC, 8021, 0, p); + rv = apr_sockaddr_info_get(&remote_sa, argv[2], APR_UNSPEC, 8021, 0, p); if (rv != APR_SUCCESS) { exit(-1); } diff --git a/test/testsock.c b/test/testsock.c index 51a82e41a41..1b19141ad1d 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -24,10 +24,15 @@ #include "apr_strings.h" #include "apr_poll.h" +#define UNIX_SOCKET_NAME "/tmp/apr-socket" +#define IPV4_SOCKET_NAME "127.0.0.1" +static char *socket_name = NULL; +static int socket_type = APR_INET; + static void launch_child(abts_case *tc, apr_proc_t *proc, const char *arg1, apr_pool_t *p) { apr_procattr_t *procattr; - const char *args[3]; + const char *args[4]; apr_status_t rv; rv = apr_procattr_create(&procattr, p); @@ -42,7 +47,8 @@ static void launch_child(abts_case *tc, apr_proc_t *proc, const char *arg1, apr_ args[0] = "sockchild" EXTENSION; args[1] = arg1; - args[2] = NULL; + args[2] = socket_name; + args[3] = NULL; rv = apr_proc_create(proc, TESTBINPATH "sockchild" EXTENSION, args, NULL, procattr, p); APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv); @@ -99,7 +105,7 @@ static apr_socket_t *setup_socket(abts_case *tc) apr_sockaddr_t *sa; apr_socket_t *sock; - rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_INET, 8021, 0, p); + rv = apr_sockaddr_info_get(&sa, socket_name, socket_type, 8021, 0, p); APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); rv = apr_socket_create(&sock, sa->family, SOCK_STREAM, APR_PROTO_TCP, p); @@ -336,7 +342,7 @@ static void test_get_addr(abts_case *tc, void *data) abts_suite *testsock(abts_suite *suite) { suite = ADD_SUITE(suite) - + socket_name = IPV4_SOCKET_NAME; abts_run_test(suite, test_addr_info, NULL); abts_run_test(suite, test_serv_by_name, NULL); abts_run_test(suite, test_create_bind_listen, NULL); @@ -345,7 +351,14 @@ abts_suite *testsock(abts_suite *suite) abts_run_test(suite, test_timeout, NULL); abts_run_test(suite, test_print_addr, NULL); abts_run_test(suite, test_get_addr, NULL); - +#if APR_HAVE_SOCKADDR_UN + socket_name = UNIX_SOCKET_NAME; + socket_type = APR_UNIX; + abts_run_test(suite, test_create_bind_listen, NULL); + abts_run_test(suite, test_send, NULL); + abts_run_test(suite, test_recv, NULL); + abts_run_test(suite, test_timeout, NULL); +#endif return suite; } From 9102f2ca85abc9a14f98d68c65142b7c21fde30d Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 19 Feb 2009 07:20:34 +0000 Subject: [PATCH 6291/7878] Fix copy/paste typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@745764 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index b5eea918fb5..1046d9809ce 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -800,7 +800,7 @@ APR_DECLARE_INHERIT_UNSET(socket); /** * Set socket permissions. */ -APR_PERMS_SET_IMPLEMENT(global_mutex); +APR_PERMS_SET_IMPLEMENT(socket); /** * @defgroup apr_mcast IP Multicast From eb2a91e1ddb74b1733ae13bbf119da284483fe4b Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 19 Feb 2009 10:57:12 +0000 Subject: [PATCH 6292/7878] On busy systems the accept can be delayed, so use the select and wait untill fully connected git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@745813 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 4ee629d9fd7..5812fa45253 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -229,8 +229,9 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, static apr_status_t create_socket_pipe(SOCKET *rd, SOCKET *wr) { static int id = 0; - + FD_SET rs; SOCKET ls; + struct timeval socktm; struct sockaddr_in pa; struct sockaddr_in la; struct sockaddr_in ca; @@ -290,10 +291,27 @@ static apr_status_t create_socket_pipe(SOCKET *rd, SOCKET *wr) goto cleanup; } for (;;) { + int ns; /* Listening socket is nonblocking by now. - * The accept must create the socket - * immediatelly because we connected already. + * The accept should create the socket + * immediatelly because we are connected already. + * However on buys systems this can take a while + * until winsock gets a chance to handle the events. */ + FD_ZERO(&rs); + FD_SET(ls, &rs); + + socktm.tv_sec = 1; + socktm.tv_usec = 0; + if ((ns = select(0, &rs, NULL, NULL, &socktm)) == SOCKET_ERROR) { + /* Accept still not signaled */ + Sleep(100); + continue; + } + if (ns == 0) { + /* No connections in the last second */ + continue; + } if ((*rd = accept(ls, (SOCKADDR *)&ca, &lc)) == INVALID_SOCKET) { rv = apr_get_netos_error(); goto cleanup; From 17b4f1b97af34fda77a13569ba74609be11da7d7 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Fri, 20 Feb 2009 02:28:23 +0000 Subject: [PATCH 6293/7878] Fix compilation error on systems that do not have IPV6. Patch by Julien Charbon . PR 46601. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@746115 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index c5d3d6e3190..4e9783d4e3a 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -388,7 +388,11 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, /* Ignore anything bogus: getaddrinfo in some old versions of * glibc will return AF_UNIX entries for APR_UNSPEC+AI_PASSIVE * lookups. */ +#if APR_HAVE_IPV6 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) { +#else + if (ai->ai_family != AF_INET) { +#endif ai = ai->ai_next; continue; } From 3a557ee054f2b531bcb846551649a0f38e761c62 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Fri, 20 Feb 2009 11:02:54 +0000 Subject: [PATCH 6294/7878] If APR_UNIX given explicitly do not check if the hostname starts with '/' Strdup when returning our hostname. Thanks Ruediger git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@746202 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 4e9783d4e3a..77cfba98c43 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -580,7 +580,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, family = APR_UNIX; if (family == APR_UNIX) { #if APR_HAVE_SOCKADDR_UN - if (hostname && *hostname == '/') { + if (hostname) { *sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); (*sa)->pool = p; apr_cpystrn((*sa)->sa.unx.sun_path, hostname, @@ -656,7 +656,7 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, } #if APR_HAVE_SOCKADDR_UN else if (sockaddr->family == APR_UNIX) { - *hostname = sockaddr->hostname; + *hostname = apr_pstrdup(sockaddr->pool, sockaddr->hostname); return APR_SUCCESS; } #endif From 694d9938346b41e0f163dad34a4984fea3642bb0 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Fri, 20 Feb 2009 18:01:09 +0000 Subject: [PATCH 6295/7878] Do not close the original if the apr_os_file_put fails. This ensures the same behavior as on other platforms git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@746310 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 930a0f3f9f9..e282d5fc243 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -645,9 +645,6 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, rv = apr_thread_mutex_create(&(*file)->mutex, APR_THREAD_MUTEX_DEFAULT, pool); if (rv) { - if (file_cleanup(*file) == APR_SUCCESS) { - apr_pool_cleanup_kill(pool, *file, file_cleanup); - } return rv; } } From 7d31dd779da2c028bf6a1ae07fa6d922bbb2c0a1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 21 Feb 2009 18:18:55 +0000 Subject: [PATCH 6296/7878] sync with 1.4.x branch fix spelling git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@746555 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8f1def89c62..9bf9141bc52 100644 --- a/CHANGES +++ b/CHANGES @@ -13,13 +13,30 @@ Changes for APR 2.0.0 choosing non-default providers. [Mladen Turk] - *) Intruduce APR_PERMS_SET macros for setting the owner/group on + *) Introduce APR_PERMS_SET macros for setting the owner/group on objects. Currently only implemented for shm, proc and global mutexes on posix platforms. [Mladen Turk] Changes for APR 1.4.0 + *) Fix compilation error on systems that do not have IPV6. + PR 46601 [Julien Charbon ] + + *) apr_pollset_wakeup() on Windows: Fix core caused by closing the + file_socket_pipe with standard file_close. + [Arsen Chaloyan, Mladen Turk] + + *) apr_socket_sendfile() on Solaris: Fix handling of files truncated + after the sender determines the length. (This fixes a busy loop in + httpd when a file being served is truncated.) [Jeff Trawick] + + *) Fix documentation for apr_temp_dir_get(). + PR 46303 [Carlo Marcelo Arenas Belon ] + + *) Add AC_MSG_RESULT after AC_MSG_CHECKING. + PR 46427 [Rainer Jung ] + *) Win32: Do not error out on apr_pollset_poll() when there are no sockets. [Justin Erenkrantz] From dc837aedba3c3a7c0ad93c9a1a8102915ef455c5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 21 Feb 2009 18:26:33 +0000 Subject: [PATCH 6297/7878] improve documentation of APR_POLLSET_NOCOPY toggle plurality in the existing descriptions of flags-the-variable git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@746557 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index ec3cc1c56f8..89de97d9795 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -55,7 +55,7 @@ extern "C" { * Pollset Flags */ #define APR_POLLSET_THREADSAFE 0x001 /**< Adding or Removing a Descriptor is thread safe */ -#define APR_POLLSET_NOCOPY 0x002 /**< Descriptors passed to apr_pollset_create() are not copied */ +#define APR_POLLSET_NOCOPY 0x002 /**< Descriptors passed to apr_pollset_add() are not copied */ #define APR_POLLSET_WAKEABLE 0x004 /**< Pollset poll operation is interruptable */ #define APR_POLLSET_NODEFAULT 0x010 /**< Do not try default method if non default fails */ @@ -113,18 +113,21 @@ typedef struct apr_pollset_t apr_pollset_t; * @param p The pool from which to allocate the pollset * @param flags Optional flags to modify the operation of the pollset. * - * @remark If flags equals APR_POLLSET_THREADSAFE, then a pollset is + * @remark If flags contains APR_POLLSET_THREADSAFE, then a pollset is * created on which it is safe to make concurrent calls to * apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() * from separate threads. This feature is only supported on some * platforms; the apr_pollset_create() call will fail with * APR_ENOTIMPL on platforms where it is not supported. - * @remark If flags contain APR_POLLSET_WAKEABLE, then a pollset is + * @remark If flags contains APR_POLLSET_WAKEABLE, then a pollset is * created with additional internal pipe object used for * apr_pollset_wakeup() call. The actual size of pollset is * in that case size + 1. This feature is only supported on some * platforms; the apr_pollset_create() call will fail with * APR_ENOTIMPL on platforms where it is not supported. + * @remark If flags contains APR_POLLSET_NOCOPY, then the apr_pollfd_t + * structures passed to apr_pollset_add() are not copied and + * must have a lifetime at least as long as the pollset. */ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, @@ -180,6 +183,9 @@ APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset); * with APR_EINTR. Option (1) is recommended, but option (2) is * allowed for implementations where option (1) is impossible * or impractical. + * @remark If the pollset has been created with APR_POLLSET_NOCOPY, the + * apr_pollfd_t structure referenced by descriptor will not be copied + * and must have a lifetime at least as long as the pollset. */ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor); From a7b446a3c7b8b8e72c00b9d66bfd715958a17b33 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 21 Feb 2009 20:04:03 +0000 Subject: [PATCH 6298/7878] apr_pollset_create_ex() already made room for the wakeup descriptor, so the implementation-specific pollset-create can ignore that git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@746580 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 4 ---- poll/unix/port.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 8bbccf504d3..f7472240212 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -95,10 +95,6 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, apr_status_t rv; int fd; - if (flags & APR_POLLSET_WAKEABLE) { - /* Add room for wakeup descriptor */ - size++; - } fd = epoll_create(size); if (fd < 0) { pollset->p = NULL; diff --git a/poll/unix/port.c b/poll/unix/port.c index 48d3a7a9f40..57c89e1d45b 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -114,10 +114,6 @@ static apr_status_t impl_pollset_create(apr_pollset_t **pollset, return APR_ENOTIMPL; } #endif - if (flags & APR_POLLSET_WAKEABLE) { - /* Add room for wakeup descriptor */ - size++; - } pollset->p->waiting = 0; pollset->p->port_set = apr_palloc(p, size * sizeof(port_event_t)); From bf3c40916ae22e6d231fd66ec45403ac0ea5180a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 21 Feb 2009 20:46:27 +0000 Subject: [PATCH 6299/7878] don't go to any trouble to compute the ignored epoll_event parameter to epoll_ctl(EPOLL_CTL_DEL) (beyond the pathlength, it also is helpful to understand if the events specified by the caller are critical or ignored) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@746588 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index f7472240212..39c52d00201 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -190,11 +190,11 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, { pfd_elem_t *ep; apr_status_t rv = APR_SUCCESS; - struct epoll_event ev; + struct epoll_event ev = {0}; /* ignored, but must be passed with + * kernel < 2.6.9 + */ int ret = -1; - ev.events = get_epoll_event(descriptor->reqevents); - if (descriptor->desc_type == APR_POLL_SOCKET) { ret = epoll_ctl(pollset->p->epoll_fd, EPOLL_CTL_DEL, descriptor->desc.s->socketdes, &ev); @@ -381,11 +381,11 @@ static apr_status_t impl_pollcb_remove(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor) { apr_status_t rv = APR_SUCCESS; - struct epoll_event ev; + struct epoll_event ev = {0}; /* ignored, but must be passed with + * kernel < 2.6.9 + */ int ret = -1; - ev.events = get_epoll_event(descriptor->reqevents); - if (descriptor->desc_type == APR_POLL_SOCKET) { ret = epoll_ctl(pollcb->fd, EPOLL_CTL_DEL, descriptor->desc.s->socketdes, &ev); From f31c75aa1c0705410f5d9005d5f944eb4724036a Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 21 Feb 2009 20:59:46 +0000 Subject: [PATCH 6300/7878] Add simple parent/child data exchange for APR processes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@746589 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 + include/apr_thread_proc.h | 35 ++++++ include/arch/unix/apr_arch_threadproc.h | 8 ++ include/arch/win32/apr_arch_threadproc.h | 6 + misc/unix/start.c | 4 + misc/win32/start.c | 1 + threadproc/beos/proc.c | 25 ++++ threadproc/netware/proc.c | 20 ++++ threadproc/os2/proc.c | 25 ++++ threadproc/unix/proc.c | 139 +++++++++++++++++++++++ threadproc/win32/proc.c | 87 ++++++++++++++ 11 files changed, 354 insertions(+) diff --git a/CHANGES b/CHANGES index 9bf9141bc52..f41d0910b0e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Added simple interprocess data exchange API between + parent and child APR based processes. + [Mladen Turk] + *) Added Unix domain socket support. [Mladen Turk] diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index eeb81cde4d4..e4bffae2483 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -590,6 +590,41 @@ APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, void *data, apr_fileperms_t perms); +/** + * Set the ipc data for child process + * @param attr The procattr we care about. + * @param data Data to pass to child process + * @param size Data size + */ +APR_DECLARE(apr_status_t) apr_procattr_ipc_data_set(apr_procattr_t *attr, + const void *data, + apr_size_t size); + +/** + * Set the shared memory ipc data for child process + * @param attr The procattr we care about. + * @param data Shared memory data pointer + * @param size Shared memory data size + * @remark data points to the shared memory segment created by the + * parent process and initially contains the copy of the data set by + * apr_procattr_ipc_data_set function. The data is valid only after + * the child process was created. + */ +APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, + void **data, + apr_size_t *size); + +/** + * Get the shared memory ipc data segment pointer + * @param data Shared memory data pointer + * @param size Shared memory data size + * @remark data points to the shared memory segment created by the + * parent process. If the parent process didn't create ipc data + * the function returns APR_ENOMEM. + */ +APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, + apr_size_t *size); + #if APR_HAS_FORK /** * This is currently the only non-portable call in APR. This executes diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h index ebe5d358a5e..cced27f15e9 100644 --- a/include/arch/unix/apr_arch_threadproc.h +++ b/include/arch/unix/apr_arch_threadproc.h @@ -19,6 +19,8 @@ #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_arch_file_io.h" +#include "apr_arch_proc_mutex.h" +#include "apr_arch_shm.h" #include "apr_perms_set.h" /* System headers required for thread/process library */ @@ -113,7 +115,13 @@ struct apr_procattr_t { apr_uid_t uid; apr_gid_t gid; apr_procattr_pscb_t *perms_set_callbacks; + + apr_shm_t *ipc_shm; + const void *ipc_data; + apr_size_t ipc_size; }; +apr_status_t apr_proc_ipc_init(apr_pool_t *pool); + #endif /* ! THREAD_PROC_H */ diff --git a/include/arch/win32/apr_arch_threadproc.h b/include/arch/win32/apr_arch_threadproc.h index d3ce9c51860..7732b258f33 100644 --- a/include/arch/win32/apr_arch_threadproc.h +++ b/include/arch/win32/apr_arch_threadproc.h @@ -17,6 +17,8 @@ #include "apr_private.h" #include "apr_thread_proc.h" #include "apr_file_io.h" +#include "apr_arch_shm.h" +#include "apr_perms_set.h" #ifndef THREAD_PROC_H #define THREAD_PROC_H @@ -62,6 +64,9 @@ struct apr_procattr_t { LPSECURITY_ATTRIBUTES sa; LPVOID sd; #endif + apr_shm_t *ipc_shm; + const void *ipc_data; + apr_size_t ipc_size; }; struct apr_thread_once_t { @@ -69,6 +74,7 @@ struct apr_thread_once_t { }; extern apr_status_t apr_threadproc_init(apr_pool_t *pool); +extern apr_status_t apr_proc_ipc_init(apr_pool_t *pool); #endif /* ! THREAD_PROC_H */ diff --git a/misc/unix/start.c b/misc/unix/start.c index 4b8ad990de6..8ce2162449e 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -22,6 +22,7 @@ #include "apr_arch_proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ #include "apr_arch_internal_time.h" +#include "apr_arch_threadproc.h" /* for apr_procattr_ipc_after_init() */ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, @@ -70,6 +71,9 @@ APR_DECLARE(apr_status_t) apr_initialize(void) apr_signal_init(pool); + /* Try to initialize the shared memory if this is a child process. + */ + apr_proc_ipc_init(pool); return APR_SUCCESS; } diff --git a/misc/win32/start.c b/misc/win32/start.c index 22820e8e556..4cdd2b4fe64 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -206,6 +206,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) apr_signal_init(pool); apr_threadproc_init(pool); + apr_proc_ipc_init(pool); return APR_SUCCESS; } diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index b4e05e58e79..43e3aaa82b4 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -451,3 +451,28 @@ APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, { return APR_ENOTIMPL; } + +APR_DECLARE(apr_status_t) apr_procattr_ipc_data_set(apr_procattr_t *attr, + const void *data, + apr_size_t size) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, + void **data, + apr_size_t *size) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_proc_ipc_init(apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, + apr_size_t *size) +{ + return APR_ENOTIMPL; +} diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 6ee7a1b48f5..39dd0c56fc3 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -499,3 +499,23 @@ APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, { return APR_ENOTIMPL; } + +APR_DECLARE(apr_status_t) apr_procattr_ipc_data_set(apr_procattr_t *attr, + const void *data, + apr_size_t size) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, + void **data, + apr_size_t *size) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, + apr_size_t *size) +{ + return APR_ENOTIMPL; +} diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 9fa94dde191..a9090fcbb33 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -670,3 +670,28 @@ APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, { return APR_ENOTIMPL; } + +APR_DECLARE(apr_status_t) apr_procattr_ipc_data_set(apr_procattr_t *attr, + const void *data, + apr_size_t size) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, + void **data, + apr_size_t *size) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr_proc_ipc_init(apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, + apr_size_t *size) +{ + return APR_ENOTIMPL; +} diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 6c4786653a5..ed715e69417 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -19,6 +19,7 @@ #include "apr_portable.h" #include "apr_signal.h" #include "apr_random.h" +#include "apr_arch_proc_mutex.h" /* Heavy on no'ops, here's what we want to pass if there is APR_NO_FILE * requested for a specific child handle; @@ -216,6 +217,69 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_ipc_data_set(apr_procattr_t *attr, + const void *data, + apr_size_t size) +{ + attr->ipc_data = data; + attr->ipc_size = size; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, + void **data, + apr_size_t *size) +{ + if (attr->ipc_shm && attr->ipc_size) { + *data = apr_shm_baseaddr_get(attr->ipc_shm); + *size = attr->ipc_size; + return APR_SUCCESS; + } + else + return APR_EINIT; +} + +/* Global ipc data setup if we are child + * of the process that used child_data_set + * TODO: This can probably be some struct. + */ +static void *ipc_shm_data = NULL; +static apr_size_t ipc_shm_size = 0; +static int ipc_shm_init = 0; + +apr_status_t apr_proc_ipc_init(apr_pool_t *pool) +{ + apr_status_t rv; + char shmname[64]; + const char *tmpdir = NULL; + apr_shm_t *shm; + + if (ipc_shm_init++) + return APR_SUCCESS; + apr_temp_dir_get(&tmpdir, pool); + apr_snprintf(shmname, sizeof(shmname), "%s/.apripc.%" APR_PID_T_FMT, + tmpdir, getpid()); + + if ((rv = apr_shm_attach(&shm, shmname, pool)) != APR_SUCCESS) + return rv; + ipc_shm_data = apr_shm_baseaddr_get(shm); + ipc_shm_size = apr_shm_size_get(shm); + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, + apr_size_t *size) +{ + if (!ipc_shm_init) + return APR_EINIT; + if (!ipc_shm_data) + return APR_ENOMEM; + + *data = ipc_shm_data; + *size = ipc_shm_size; + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) { int pid; @@ -353,7 +417,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_pool_t *pool) { int i; + apr_status_t rc; const char * const empty_envp[] = {NULL}; + apr_proc_mutex_t *ipc_mutex = NULL; if (!env) { /* Specs require an empty array instead of NULL; * Purify will trigger a failure, even if many @@ -392,6 +458,22 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } } + if (attr->ipc_data && attr->ipc_size) { + /* Create startup ipc mutex. + * The purpose of this mutex is to enable + * the 'start suspended' process behaviour. + * We need to create the shared memory after + * fork() and we don't know in advance what + * the child pid will be. Mutex locks the child + * until we create the shared memory which + * can be then attached at child's apr_initialize. + */ + if ((rc = apr_proc_mutex_create(&ipc_mutex, NULL, + APR_LOCK_DEFAULT, attr->pool)) != APR_SUCCESS) { + return rc; + } + apr_proc_mutex_lock(ipc_mutex); + } if ((new->pid = fork()) < 0) { return errno; } @@ -399,6 +481,33 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, int status; /* child process */ + if (ipc_mutex) { + if ((rc = apr_proc_mutex_child_init(&ipc_mutex, + NULL, pool)) != APR_SUCCESS) { + /* This should never happen. + * We cannot continue. + */ + if (attr->errfn) { + attr->errfn(pool, rc, "ipc mutex init failed"); + } + _exit(-1); + } + /* Wait util the parent initializes shared memory. + */ + if ((rc = apr_proc_mutex_lock(ipc_mutex)) != APR_SUCCESS) { + /* Locking failed. + * Probably the parent ended prematurely + */ + if (attr->errfn) { + attr->errfn(pool, rc, "ipc mutex lock failed"); + } + _exit(-1); + } + /* By now we should have the ipc shared memory set up. + * We don't need the mutex any more. + */ + apr_proc_mutex_destroy(ipc_mutex); + } /* * If we do exec cleanup before the dup2() calls to set up pipes * on 0-2, we accidentally close the pipes used by programs like @@ -455,6 +564,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_signal(SIGCHLD, SIG_DFL); /* not sure if this is needed or not */ + if (attr->currdir != NULL) { if (chdir(attr->currdir) == -1) { if (attr->errfn) { @@ -594,6 +704,35 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, _exit(-1); /* if we get here, there is a problem, so exit with an * error code. */ } + if (ipc_mutex) { + char shmname[64]; + const char *tmpdir = NULL; + + apr_temp_dir_get(&tmpdir, pool); + apr_snprintf(shmname, sizeof(shmname), "%s/.apripc.%" APR_PID_T_FMT, + tmpdir, new->pid); + rc = apr_shm_create(&attr->ipc_shm, attr->ipc_size, + shmname, attr->pool); + if (rc == APR_SUCCESS) { + if (!geteuid()) { + /* Set ipc shared memory permissions for + * our child process. + */ + APR_PERMS_SET_FN(shm)(attr->ipc_shm, + APR_FPROT_UREAD | APR_FPROT_UWRITE, + attr->uid, attr->gid); + } + /* Fill in shared memory with ipc data */ + memcpy(apr_shm_baseaddr_get(attr->ipc_shm), + attr->ipc_data, attr->ipc_size); + } + /* Unlock the ipc startup mutex. + * This mutex is destroyed when attr->pool is cleared + * or destroyed because it might not yet be initialised + * inside the child. + */ + apr_proc_mutex_unlock(ipc_mutex); + } /* Parent process */ if (attr->child_in && (attr->child_in->filedes != -1)) { diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 08ea918a05e..6348ca0ef0e 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -341,6 +341,69 @@ APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_procattr_ipc_data_set(apr_procattr_t *attr, + const void *data, + apr_size_t size) +{ + attr->ipc_data = data; + attr->ipc_size = size; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, + void **data, + apr_size_t *size) +{ + if (attr->ipc_shm && attr->ipc_size) { + *data = apr_shm_baseaddr_get(attr->ipc_shm); + *size = attr->ipc_size; + return APR_SUCCESS; + } + else + return APR_EINIT; +} + +/* Global ipc data setup if we are child + * of the process that used child_data_set + * TODO: This can probably be some struct. + */ +static void *ipc_shm_data = NULL; +static apr_size_t ipc_shm_size = 0; +static int ipc_shm_init = 0; + +apr_status_t apr_proc_ipc_init(apr_pool_t *pool) +{ + apr_status_t rv; + char shmname[APR_PATH_MAX]; + const char *tmpdir = NULL; + apr_shm_t *shm; + + if (ipc_shm_init++) + return APR_SUCCESS; + apr_temp_dir_get(&tmpdir, pool); + apr_snprintf(shmname, sizeof(shmname), "%s\\APRIPC_%d", + tmpdir, GetCurrentProcessId()); + + if ((rv = apr_shm_attach(&shm, shmname, pool)) != APR_SUCCESS) + return rv; + ipc_shm_data = apr_shm_baseaddr_get(shm); + ipc_shm_size = apr_shm_size_get(shm); + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, + apr_size_t *size) +{ + if (!ipc_shm_init) + return APR_EINIT; + if (!ipc_shm_data) + return APR_ENOMEM; + + *data = ipc_shm_data; + *size = ipc_shm_size; + return APR_SUCCESS; +} + static const char* has_space(const char *str) { const char *ch; @@ -453,6 +516,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_pool_t *pool) { apr_status_t rv; + apr_status_t rc; apr_size_t i; const char *argv0; char *cmdline; @@ -782,6 +846,12 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->detached) { si.dwFlags |= STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; + } + if (attr->ipc_data && attr->ipc_size) { + /* Child will be suspended until + * we create the shared memory + */ + dwCreationFlags |= CREATE_SUSPENDED; } #ifndef _WIN32_WCE @@ -908,6 +978,23 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, NULL, /* STARTUPINFO not supported */ &pi); #endif + + if (rv && attr->ipc_data, attr->ipc_size) { + char shmname[APR_PATH_MAX]; + const char *tmpdir = NULL; + + apr_temp_dir_get(&tmpdir, pool); + apr_snprintf(shmname, sizeof(shmname), "%s\\APRIPC_%d", + tmpdir, pi.dwProcessId); + rc = apr_shm_create(&attr->ipc_shm, attr->ipc_size, + shmname, attr->pool); + if (rc == APR_SUCCESS) { + /* Fill in shared memory with ipc data */ + memcpy(apr_shm_baseaddr_get(attr->ipc_shm), + attr->ipc_data, attr->ipc_size); + } + ResumeThread(pi.hThread); + } } #endif /* APR_HAS_UNICODE_FS */ #if APR_HAS_ANSI_FS From ac0795a2a1f4e8c7d71a5ab7bd89bc9e05d65d9a Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 21 Feb 2009 21:23:00 +0000 Subject: [PATCH 6301/7878] Although compiles, it doesn't look nice ;) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@746590 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 6348ca0ef0e..23c19ddcc9f 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -979,7 +979,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, &pi); #endif - if (rv && attr->ipc_data, attr->ipc_size) { + if (rv && attr->ipc_data && attr->ipc_size) { char shmname[APR_PATH_MAX]; const char *tmpdir = NULL; From 498a52f081c9ad99d8ab2effc165d2d3cd07d3b6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 21 Feb 2009 22:22:34 +0000 Subject: [PATCH 6302/7878] simplifications and minor improvements to error reporting and pathlength impl_pollset_create: use the apr_get_netos_error() macro instead of errno for consistency with the rest of this file impl_pollset_add: return errno instead of APR_EBADF when we fail to add to the pollset (it may indeed be EBADF, but it could be more interesting) refactor a small amount of code which was duplicated for flags with/without APR_POLLSET_WAKEABLE impl_pollset_remove: axe a redundant check for APR_RING_EMPTY, as for (var = APR_RING_FIRST(); var != APR_RING_SENTINEL(); ...) makes essentially the same check impl_pollset_poll(): refactor a stretch of code which was duplicated for flags with/without APR_POLLSET_WAKEABLE, and at the same time axe an unnecessary structure copy in the usual case that the returned event was not the wakeup pipe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@746597 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 96 +++++++++++++++++++---------------------------- 1 file changed, 38 insertions(+), 58 deletions(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 39c52d00201..b695107304d 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -98,7 +98,7 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, fd = epoll_create(size); if (fd < 0) { pollset->p = NULL; - return errno; + return apr_get_netos_error(); } pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t)); @@ -165,14 +165,12 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, descriptor->desc.f->filedes, &ev); } - if (pollset->flags & APR_POLLSET_NOCOPY) { - if (0 != ret) { - rv = APR_EBADF; - } + if (0 != ret) { + rv = apr_get_netos_error(); } - else { - if (0 != ret) { - rv = APR_EBADF; + + if (!(pollset->flags & APR_POLLSET_NOCOPY)) { + if (rv != APR_SUCCESS) { APR_RING_INSERT_TAIL(&(pollset->p->free_ring), elem, pfd_elem_t, link); } else { @@ -210,18 +208,16 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, if (!(pollset->flags & APR_POLLSET_NOCOPY)) { pollset_lock_rings(); - if (!APR_RING_EMPTY(&(pollset->p->query_ring), pfd_elem_t, link)) { - for (ep = APR_RING_FIRST(&(pollset->p->query_ring)); - ep != APR_RING_SENTINEL(&(pollset->p->query_ring), - pfd_elem_t, link); - ep = APR_RING_NEXT(ep, link)) { + for (ep = APR_RING_FIRST(&(pollset->p->query_ring)); + ep != APR_RING_SENTINEL(&(pollset->p->query_ring), + pfd_elem_t, link); + ep = APR_RING_NEXT(ep, link)) { - if (descriptor->desc.s == ep->pfd.desc.s) { - APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), - ep, pfd_elem_t, link); - break; - } + if (descriptor->desc.s == ep->pfd.desc.s) { + APR_RING_REMOVE(ep, link); + APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), + ep, pfd_elem_t, link); + break; } } @@ -238,7 +234,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, { int ret, i, j; apr_status_t rv = APR_SUCCESS; - apr_pollfd_t fd; + apr_pollfd_t *fdptr; if (timeout > 0) { timeout /= 1000; @@ -255,47 +251,31 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, rv = APR_TIMEUP; } else { - if (pollset->flags & APR_POLLSET_NOCOPY) { - for (i = 0, j = 0; i < ret; i++) { - fd = *((apr_pollfd_t *)(pollset->p->pollset[i].data.ptr)); - /* Check if the polled descriptor is our - * wakeup pipe. In that case do not put it result set. - */ - if ((pollset->flags & APR_POLLSET_WAKEABLE) && - fd.desc_type == APR_POLL_FILE && - fd.desc.f == pollset->wakeup_pipe[0]) { - apr_pollset_drain_wakeup_pipe(pollset); - rv = APR_EINTR; - } - else { - pollset->p->result_set[j] = fd; - pollset->p->result_set[j].rtnevents = - get_epoll_revent(pollset->p->pollset[i].events); - j++; - } + for (i = 0, j = 0; i < ret; i++) { + if (pollset->flags & APR_POLLSET_NOCOPY) { + fdptr = (apr_pollfd_t *)(pollset->p->pollset[i].data.ptr); } - if (((*num) = j)) - rv = APR_SUCCESS; - } - else { - for (i = 0, j = 0; i < ret; i++) { - fd = (((pfd_elem_t *) (pollset->p->pollset[i].data.ptr))->pfd); - if ((pollset->flags & APR_POLLSET_WAKEABLE) && - fd.desc_type == APR_POLL_FILE && - fd.desc.f == pollset->wakeup_pipe[0]) { - apr_pollset_drain_wakeup_pipe(pollset); - rv = APR_EINTR; - } - else { - pollset->p->result_set[j] = fd; - pollset->p->result_set[j].rtnevents = - get_epoll_revent(pollset->p->pollset[i].events); - j++; - } + else { + fdptr = &(((pfd_elem_t *) (pollset->p->pollset[i].data.ptr))->pfd); + } + /* Check if the polled descriptor is our + * wakeup pipe. In that case do not put it result set. + */ + if ((pollset->flags & APR_POLLSET_WAKEABLE) && + fdptr->desc_type == APR_POLL_FILE && + fdptr->desc.f == pollset->wakeup_pipe[0]) { + apr_pollset_drain_wakeup_pipe(pollset); + rv = APR_EINTR; + } + else { + pollset->p->result_set[j] = *fdptr; + pollset->p->result_set[j].rtnevents = + get_epoll_revent(pollset->p->pollset[i].events); + j++; } - if (((*num) = j)) - rv = APR_SUCCESS; } + if (((*num) = j)) + rv = APR_SUCCESS; if (descriptors) { *descriptors = pollset->p->result_set; From f725dc12c7261695eacda701c5cfc57c2fff7adc Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 22 Feb 2009 16:10:57 +0000 Subject: [PATCH 6303/7878] clarifications and other editing of the pollset documentation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@746749 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 109 ++++++++++++++++++++++++++------------------- 1 file changed, 64 insertions(+), 45 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index 89de97d9795..ad78b9f8a3e 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -49,15 +49,24 @@ extern "C" { #define APR_POLLOUT 0x004 /**< Can write without blocking */ #define APR_POLLERR 0x010 /**< Pending error */ #define APR_POLLHUP 0x020 /**< Hangup occurred */ -#define APR_POLLNVAL 0x040 /**< Descriptior invalid */ +#define APR_POLLNVAL 0x040 /**< Descriptor invalid */ /** * Pollset Flags */ -#define APR_POLLSET_THREADSAFE 0x001 /**< Adding or Removing a Descriptor is thread safe */ -#define APR_POLLSET_NOCOPY 0x002 /**< Descriptors passed to apr_pollset_add() are not copied */ -#define APR_POLLSET_WAKEABLE 0x004 /**< Pollset poll operation is interruptable */ -#define APR_POLLSET_NODEFAULT 0x010 /**< Do not try default method if non default fails */ +#define APR_POLLSET_THREADSAFE 0x001 /**< Adding or removing a descriptor is + * thread-safe + */ +#define APR_POLLSET_NOCOPY 0x002 /**< Descriptors passed to apr_pollset_add() + * are not copied + */ +#define APR_POLLSET_WAKEABLE 0x004 /**< Poll operations are interruptable by + * apr_pollset_wakeup() + */ +#define APR_POLLSET_NODEFAULT 0x010 /**< Do not try to use the default method if + * the specified non-default method cannot be + * used + */ /** * Pollset Methods @@ -107,7 +116,7 @@ struct apr_pollfd_t { typedef struct apr_pollset_t apr_pollset_t; /** - * Setup a pollset object + * Set up a pollset object * @param pollset The pointer in which to return the newly created object * @param size The maximum number of descriptors that this pollset can hold * @param p The pool from which to allocate the pollset @@ -120,7 +129,7 @@ typedef struct apr_pollset_t apr_pollset_t; * platforms; the apr_pollset_create() call will fail with * APR_ENOTIMPL on platforms where it is not supported. * @remark If flags contains APR_POLLSET_WAKEABLE, then a pollset is - * created with additional internal pipe object used for + * created with an additional internal pipe object used for the * apr_pollset_wakeup() call. The actual size of pollset is * in that case size + 1. This feature is only supported on some * platforms; the apr_pollset_create() call will fail with @@ -135,25 +144,30 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t flags); /** - * Setup a pollset object + * Set up a pollset object * @param pollset The pointer in which to return the newly created object * @param size The maximum number of descriptors that this pollset can hold * @param p The pool from which to allocate the pollset * @param flags Optional flags to modify the operation of the pollset. - * @param method Poll method to use. See @apr_pollset_method_e. + * @param method Poll method to use. See @apr_pollset_method_e. If this + * method cannot be used, the default method will be used unless the + * APR_POLLSET_NODEFAULT flag has been specified. * - * @remark If flags equals APR_POLLSET_THREADSAFE, then a pollset is + * @remark If flags contains APR_POLLSET_THREADSAFE, then a pollset is * created on which it is safe to make concurrent calls to * apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() * from separate threads. This feature is only supported on some - * platforms; the apr_pollset_create() call will fail with + * platforms; the apr_pollset_create_ex() call will fail with * APR_ENOTIMPL on platforms where it is not supported. - * @remark If flags contain APR_POLLSET_WAKEABLE, then a pollset is - * created with additional internal pipe object used for + * @remark If flags contains APR_POLLSET_WAKEABLE, then a pollset is + * created with additional internal pipe object used for the * apr_pollset_wakeup() call. The actual size of pollset is * in that case size + 1. This feature is only supported on some - * platforms; the apr_pollset_create() call will fail with + * platforms; the apr_pollset_create_ex() call will fail with * APR_ENOTIMPL on platforms where it is not supported. + * @remark If flags contains APR_POLLSET_NOCOPY, then the apr_pollfd_t + * structures passed to apr_pollset_add() are not copied and + * must have a lifetime at least as long as the pollset. */ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, apr_uint32_t size, @@ -210,16 +224,17 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, /** * Block for activity on the descriptor(s) in a pollset * @param pollset The pollset to use - * @param timeout The amount of time in microseconds to wait. This is - * a maximum, not a minimum. If a descriptor is signalled, we - * will wake up before this time. A negative number means - * wait until a descriptor is signalled. + * @param timeout The amount of time in microseconds to wait. This is a + * maximum, not a minimum. If a descriptor is signalled, the + * function will return before this time. If timeout is + * negative, the function will block until a descriptor is + * signalled or until apr_pollset_wakeup() has been called. * @param num Number of signalled descriptors (output parameter) * @param descriptors Array of signalled descriptors (output parameter) - * @remark If the pollset has been created with APR_POLLSET_WAKEABLE - * and the wakeup has been called while waiting for activity - * return value is APR_EINTR in case there was no signaled - * descriptors at the time of wakeup call. + * @remark APR_EINTR will be returned if the pollset has been created with + * APR_POLLSET_WAKEABLE, apr_pollset_wakeup() has been called while + * waiting for activity, and there were no signalled descriptors at the + * time of the wakeup call. */ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_interval_time_t timeout, @@ -227,7 +242,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, const apr_pollfd_t **descriptors); /** - * Interrupt the blocked apr_pollset_poll call. + * Interrupt the blocked apr_pollset_poll() call. * @param pollset The pollset to use * @remark If the pollset was not created with APR_POLLSET_WAKEABLE the * return value is APR_EINIT. @@ -239,13 +254,14 @@ APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset); * @param aprset The poll structure we will be using. * @param numsock The number of descriptors we are polling * @param nsds The number of descriptors signalled (output parameter) - * @param timeout The amount of time in microseconds to wait. This is - * a maximum, not a minimum. If a descriptor is signalled, we - * will wake up before this time. A negative number means - * wait until a descriptor is signalled. + * @param timeout The amount of time in microseconds to wait. This is a + * maximum, not a minimum. If a descriptor is signalled, the + * function will return before this time. If timeout is + * negative, the function will block until a descriptor is + * signalled or until apr_pollset_wakeup() has been called. * @remark The number of descriptors signalled is returned in the third argument. * This is a blocking call, and it will not return until either a - * descriptor has been signalled, or the timeout has expired. + * descriptor has been signalled or the timeout has expired. * @remark The rtnevents field in the apr_pollfd_t array will only be filled- * in if the return value is APR_SUCCESS. */ @@ -254,14 +270,14 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, apr_interval_time_t timeout); /** - * Display the name of the pollset method, as it relates to the actual - * method used. - * @param pollset the name of the pollset. + * Return a printable representation of the pollset method. + * @param pollset The pollset to use */ APR_DECLARE(const char *) apr_pollset_method_name(apr_pollset_t *pollset); /** - * Display the name of the default poll method: APR_POLLSET_DEFAULT + * Return a printable representation of the default pollset method + * (APR_POLLSET_DEFAULT). */ APR_DECLARE(const char *) apr_poll_method_defname(void); @@ -269,7 +285,7 @@ APR_DECLARE(const char *) apr_poll_method_defname(void); typedef struct apr_pollcb_t apr_pollcb_t; /** - * Setup a pollcb object + * Set up a pollcb object * @param pollcb The pointer in which to return the newly created object * @param size The maximum number of descriptors that a single _poll can return. * @param p The pool from which to allocate the pollcb @@ -284,12 +300,14 @@ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, apr_uint32_t flags); /** - * Setup a pollcb object + * Set up a pollcb object * @param pollcb The pointer in which to return the newly created object * @param size The maximum number of descriptors that a single _poll can return. * @param p The pool from which to allocate the pollcb * @param flags Optional flags to modify the operation of the pollcb. - * @param method Poll method to use. See @apr_pollset_method_e. + * @param method Poll method to use. See @apr_pollset_method_e. If this + * method cannot be used, the default method will be used unless the + * APR_POLLSET_NODEFAULT flag has been specified. * * @remark Pollcb is only supported on some platforms; the apr_pollcb_create() * call will fail with APR_ENOTIMPL on platforms where it is not supported. @@ -304,12 +322,12 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, * Add a socket or file descriptor to a pollcb * @param pollcb The pollcb to which to add the descriptor * @param descriptor The descriptor to add - * @remark If you set client_data in the descriptor, that value - * will be returned in the client_data field whenever this - * descriptor is signalled in apr_pollcb_poll(). + * @remark If you set client_data in the descriptor, that value will be + * returned in the client_data field whenever this descriptor is + * signalled in apr_pollcb_poll(). * @remark Unlike the apr_pollset API, the descriptor is not copied, and users - * must retain the memory used by descriptor, as the same pointer will be - * returned to them from apr_pollcb_poll. + * must retain the memory used by descriptor, as the same pointer will + * be returned to them from apr_pollcb_poll. */ APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor); @@ -332,11 +350,12 @@ typedef apr_status_t (*apr_pollcb_cb_t)(void *baton, apr_pollfd_t *descriptor); /** * Block for activity on the descriptor(s) in a pollcb * @param pollcb The pollcb to use - * @param timeout The amount of time in microseconds to wait. This is - * a maximum, not a minimum. If a descriptor is signalled, we - * will wake up before this time. A negative number means - * wait until a descriptor is signalled. - * @param func Callback function to call for each active socket + * @param timeout The amount of time in microseconds to wait. This is a + * maximum, not a minimum. If a descriptor is signalled, the + * function will return before this time. If timeout is + * negative, the function will block until a descriptor is + * signalled. + * @param func Callback function to call for each active descriptor. * @param baton Opaque baton passed to the callback function. */ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, From 2df03948c2e824dbc82d04c63082b7027c9b917e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 22 Feb 2009 20:00:17 +0000 Subject: [PATCH 6304/7878] fix compile failure and warning git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@746805 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index 57c89e1d45b..7ff0fb6f6da 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -93,7 +93,7 @@ static apr_status_t impl_pollset_cleanup(apr_pollset_t *pollset) return APR_SUCCESS; } -static apr_status_t impl_pollset_create(apr_pollset_t **pollset, +static apr_status_t impl_pollset_create(apr_pollset_t *pollset, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags) @@ -348,7 +348,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, } } pollset_unlock_rings(); - if ((*num) = j) + if ((*num = j)) rv = APR_SUCCESS; if (descriptors) { *descriptors = pollset->p->result_set; From 2ac9be15162293d627a905a339f12ef190d64b57 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 23 Feb 2009 10:48:37 +0000 Subject: [PATCH 6305/7878] * include/apr_pools.h (apr_pool_create_unmanaged_ex): ... is considered harmful; child cleanups don't work. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@746955 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/apr_pools.h b/include/apr_pools.h index 5f0b3673207..071ff685ca7 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -207,6 +207,10 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, * destroyed by calling apr_pool_destroy, to prevent memory leaks. * Use of this function is discouraged, think twice about whether * you really really need it. + * @warning Any child cleanups registered against the new pool, or + * against sub-pools thereof, will not be executed during an + * invocation of apr_proc_create(), so resources created in an + * "unmanaged" pool heirarchy will leak to child processes. */ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, From 4b80cb48efd6bf84b633e80da5ff2dcd653de23a Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Mon, 23 Feb 2009 15:01:43 +0000 Subject: [PATCH 6306/7878] Remove ipc init from apr_initialize. On posix make unique tmp name and add that to child environment. The env var name made of child making it almost unique for that process instance git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@747042 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_threadproc.h | 2 - include/arch/win32/apr_arch_threadproc.h | 1 - misc/unix/start.c | 3 - misc/win32/start.c | 1 - threadproc/beos/proc.c | 5 -- threadproc/os2/proc.c | 5 -- threadproc/unix/proc.c | 100 +++++++++++++++++------ threadproc/win32/proc.c | 14 ++-- 8 files changed, 84 insertions(+), 47 deletions(-) diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h index cced27f15e9..babfbbc950a 100644 --- a/include/arch/unix/apr_arch_threadproc.h +++ b/include/arch/unix/apr_arch_threadproc.h @@ -121,7 +121,5 @@ struct apr_procattr_t { apr_size_t ipc_size; }; -apr_status_t apr_proc_ipc_init(apr_pool_t *pool); - #endif /* ! THREAD_PROC_H */ diff --git a/include/arch/win32/apr_arch_threadproc.h b/include/arch/win32/apr_arch_threadproc.h index 7732b258f33..a216db42a6f 100644 --- a/include/arch/win32/apr_arch_threadproc.h +++ b/include/arch/win32/apr_arch_threadproc.h @@ -74,7 +74,6 @@ struct apr_thread_once_t { }; extern apr_status_t apr_threadproc_init(apr_pool_t *pool); -extern apr_status_t apr_proc_ipc_init(apr_pool_t *pool); #endif /* ! THREAD_PROC_H */ diff --git a/misc/unix/start.c b/misc/unix/start.c index 8ce2162449e..6263adf5239 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -71,9 +71,6 @@ APR_DECLARE(apr_status_t) apr_initialize(void) apr_signal_init(pool); - /* Try to initialize the shared memory if this is a child process. - */ - apr_proc_ipc_init(pool); return APR_SUCCESS; } diff --git a/misc/win32/start.c b/misc/win32/start.c index 4cdd2b4fe64..22820e8e556 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -206,7 +206,6 @@ APR_DECLARE(apr_status_t) apr_initialize(void) apr_signal_init(pool); apr_threadproc_init(pool); - apr_proc_ipc_init(pool); return APR_SUCCESS; } diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 43e3aaa82b4..05e912b0681 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -466,11 +466,6 @@ APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, return APR_ENOTIMPL; } -apr_status_t apr_proc_ipc_init(apr_pool_t *pool) -{ - return APR_ENOTIMPL; -} - APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, apr_size_t *size) { diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index a9090fcbb33..803ab529eee 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -685,11 +685,6 @@ APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, return APR_ENOTIMPL; } -apr_status_t apr_proc_ipc_init(apr_pool_t *pool) -{ - return APR_ENOTIMPL; -} - APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, apr_size_t *size) { diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index ed715e69417..d3181c0db3f 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -246,21 +246,23 @@ APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, static void *ipc_shm_data = NULL; static apr_size_t ipc_shm_size = 0; static int ipc_shm_init = 0; +static apr_pool_t *ipc_pool = NULL; -apr_status_t apr_proc_ipc_init(apr_pool_t *pool) +static apr_status_t proc_ipc_init() { apr_status_t rv; - char shmname[64]; - const char *tmpdir = NULL; + char envname[64]; + const char *shmname = NULL; apr_shm_t *shm; if (ipc_shm_init++) return APR_SUCCESS; - apr_temp_dir_get(&tmpdir, pool); - apr_snprintf(shmname, sizeof(shmname), "%s/.apripc.%" APR_PID_T_FMT, - tmpdir, getpid()); - - if ((rv = apr_shm_attach(&shm, shmname, pool)) != APR_SUCCESS) + apr_pool_create(&ipc_pool, NULL); + apr_snprintf(envname, sizeof(envname), "_APRIPC%" APR_PID_T_FMT, getpid()); + shmname = getenv(envname); + if (!shmname) + return APR_ENOMEM; + if ((rv = apr_shm_attach(&shm, shmname, ipc_pool)) != APR_SUCCESS) return rv; ipc_shm_data = apr_shm_baseaddr_get(shm); ipc_shm_size = apr_shm_size_get(shm); @@ -269,9 +271,11 @@ apr_status_t apr_proc_ipc_init(apr_pool_t *pool) APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, apr_size_t *size) -{ - if (!ipc_shm_init) - return APR_EINIT; +{ + if (!ipc_shm_init) { + if (proc_ipc_init() != APR_SUCCESS) + return APR_ENOMEM; + } if (!ipc_shm_data) return APR_ENOMEM; @@ -417,9 +421,11 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_pool_t *pool) { int i; - apr_status_t rc; + apr_status_t rc = APR_SUCCESS; const char * const empty_envp[] = {NULL}; apr_proc_mutex_t *ipc_mutex = NULL; + const char *shmname = NULL; + apr_file_t *shmfile = NULL; if (!env) { /* Specs require an empty array instead of NULL; * Purify will trigger a failure, even if many @@ -459,6 +465,24 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } if (attr->ipc_data && attr->ipc_size) { + const char *tempdir; + char *template; + + rc = apr_temp_dir_get(&tempdir, pool); + if (rc != APR_SUCCESS) { + return rc; + } + apr_filepath_merge(&template, tempdir, + "apr.ipc.XXXXXX", + APR_FILEPATH_NATIVE, pool); + rc = apr_file_mktemp(&shmfile, template, 0, pool); + if (rc != APR_SUCCESS) { + return rc; + } + rc = apr_file_name_get(&shmname, shmfile); + if (rc != APR_SUCCESS) { + return rc; + } /* Create startup ipc mutex. * The purpose of this mutex is to enable * the 'start suspended' process behaviour. @@ -482,6 +506,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, /* child process */ if (ipc_mutex) { + char *env0; if ((rc = apr_proc_mutex_child_init(&ipc_mutex, NULL, pool)) != APR_SUCCESS) { /* This should never happen. @@ -503,6 +528,30 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } _exit(-1); } + env0 = apr_psprintf(pool, "_APRIPC%" APR_PID_T_FMT "=%s", + getpid(), shmname); + putenv(env0); + if (!env) { + const char const *newenv[2]; + newenv[0] = env0; + newenv[1] = NULL; + env = newenv; + } + else { + const char **newenv; + i = 0; + while (env[i]) + i++; + newenv = apr_palloc(pool, sizeof(char *) * (i + 1)); + newenv[0] = env0; + i = 0; + while (env[i]) { + newenv[i + 1] = env[i]; + i++; + } + env = newenv; + } + /* By now we should have the ipc shared memory set up. * We don't need the mutex any more. */ @@ -705,12 +754,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * error code. */ } if (ipc_mutex) { - char shmname[64]; - const char *tmpdir = NULL; - - apr_temp_dir_get(&tmpdir, pool); - apr_snprintf(shmname, sizeof(shmname), "%s/.apripc.%" APR_PID_T_FMT, - tmpdir, new->pid); + apr_file_close(shmfile); rc = apr_shm_create(&attr->ipc_shm, attr->ipc_size, shmname, attr->pool); if (rc == APR_SUCCESS) { @@ -725,13 +769,19 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, /* Fill in shared memory with ipc data */ memcpy(apr_shm_baseaddr_get(attr->ipc_shm), attr->ipc_data, attr->ipc_size); + /* Unlock the ipc startup mutex. + * This mutex is destroyed when attr->pool is cleared + * or destroyed because it might not yet be initialised + * inside the child. + */ + apr_proc_mutex_unlock(ipc_mutex); + } + else { + /* Destroy the mutex. + * This will cause the forked child to exit. + */ + apr_proc_mutex_destroy(ipc_mutex); } - /* Unlock the ipc startup mutex. - * This mutex is destroyed when attr->pool is cleared - * or destroyed because it might not yet be initialised - * inside the child. - */ - apr_proc_mutex_unlock(ipc_mutex); } /* Parent process */ @@ -747,7 +797,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_file_close(attr->child_err); } - return APR_SUCCESS; + return rc; } APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 23c19ddcc9f..d83f7bdcb8a 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -370,8 +370,9 @@ APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, static void *ipc_shm_data = NULL; static apr_size_t ipc_shm_size = 0; static int ipc_shm_init = 0; +static apr_pool_t *ipc_pool = NULL; -apr_status_t apr_proc_ipc_init(apr_pool_t *pool) +static apr_status_t proc_ipc_init(apr_pool_t *pool) { apr_status_t rv; char shmname[APR_PATH_MAX]; @@ -380,11 +381,12 @@ apr_status_t apr_proc_ipc_init(apr_pool_t *pool) if (ipc_shm_init++) return APR_SUCCESS; - apr_temp_dir_get(&tmpdir, pool); + apr_pool_create(&ipc_pool, NULL); + apr_temp_dir_get(&tmpdir, ipc_pool); apr_snprintf(shmname, sizeof(shmname), "%s\\APRIPC_%d", tmpdir, GetCurrentProcessId()); - if ((rv = apr_shm_attach(&shm, shmname, pool)) != APR_SUCCESS) + if ((rv = apr_shm_attach(&shm, shmname, ipc_pool)) != APR_SUCCESS) return rv; ipc_shm_data = apr_shm_baseaddr_get(shm); ipc_shm_size = apr_shm_size_get(shm); @@ -394,8 +396,10 @@ apr_status_t apr_proc_ipc_init(apr_pool_t *pool) APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, apr_size_t *size) { - if (!ipc_shm_init) - return APR_EINIT; + if (!ipc_shm_init) { + if (proc_ipc_init() != APR_SUCCESS) + return APR_ENOMEM; + } if (!ipc_shm_data) return APR_ENOMEM; From d2ddef88520437c50ef1ff0e010bd612b9e12807 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Mon, 23 Feb 2009 16:29:49 +0000 Subject: [PATCH 6307/7878] Remove --disable-version because of two -1 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@747069 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/configure.in b/configure.in index 2fb4154bdf7..ccb9d6d2859 100644 --- a/configure.in +++ b/configure.in @@ -201,19 +201,12 @@ AC_ARG_WITH(installbuilddir, [ --with-installbuilddir=DIR location to store APR [ installbuilddir=$withval ], [ installbuilddir="${datadir}/build-${APR_MAJOR_VERSION}" ] ) AC_SUBST(installbuilddir) -AC_ARG_ENABLE(version,[ --disable-version Disable library version info], -[enable_version_info=$enableval], [enable_version_info=yes]) - AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the library], [ use_libtool=$withval ], [ use_libtool="yes" ] ) if test "x$use_libtool" = "xyes"; then lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -o $@ -c $< && touch $@' - if test "x$enable_version_info" = "xyes"; then - LT_VERSION="-version-info `$get_version libtool $version_hdr APR`" - else - LT_VERSION="-avoid-version" - fi + LT_VERSION="-version-info `$get_version libtool $version_hdr APR`" link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) \$(LT_VERSION) \$(ALL_LDFLAGS) -o \$@" so_ext='lo' lib_target='-rpath $(libdir) $(OBJECTS)' From bb33cf0b0af70aa989baa0d8ce33245b4ffe6ce5 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Tue, 24 Feb 2009 12:32:47 +0000 Subject: [PATCH 6308/7878] Remove simple ipc because of -1 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@747357 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 - include/apr_thread_proc.h | 35 ----- include/arch/unix/apr_arch_threadproc.h | 6 - include/arch/win32/apr_arch_threadproc.h | 5 - misc/unix/start.c | 1 - threadproc/beos/proc.c | 20 --- threadproc/netware/proc.c | 20 --- threadproc/os2/proc.c | 20 --- threadproc/unix/proc.c | 191 +---------------------- threadproc/win32/proc.c | 91 ----------- 10 files changed, 1 insertion(+), 392 deletions(-) diff --git a/CHANGES b/CHANGES index f41d0910b0e..9bf9141bc52 100644 --- a/CHANGES +++ b/CHANGES @@ -1,10 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) Added simple interprocess data exchange API between - parent and child APR based processes. - [Mladen Turk] - *) Added Unix domain socket support. [Mladen Turk] diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index e4bffae2483..eeb81cde4d4 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -590,41 +590,6 @@ APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, void *data, apr_fileperms_t perms); -/** - * Set the ipc data for child process - * @param attr The procattr we care about. - * @param data Data to pass to child process - * @param size Data size - */ -APR_DECLARE(apr_status_t) apr_procattr_ipc_data_set(apr_procattr_t *attr, - const void *data, - apr_size_t size); - -/** - * Set the shared memory ipc data for child process - * @param attr The procattr we care about. - * @param data Shared memory data pointer - * @param size Shared memory data size - * @remark data points to the shared memory segment created by the - * parent process and initially contains the copy of the data set by - * apr_procattr_ipc_data_set function. The data is valid only after - * the child process was created. - */ -APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, - void **data, - apr_size_t *size); - -/** - * Get the shared memory ipc data segment pointer - * @param data Shared memory data pointer - * @param size Shared memory data size - * @remark data points to the shared memory segment created by the - * parent process. If the parent process didn't create ipc data - * the function returns APR_ENOMEM. - */ -APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, - apr_size_t *size); - #if APR_HAS_FORK /** * This is currently the only non-portable call in APR. This executes diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h index babfbbc950a..ebe5d358a5e 100644 --- a/include/arch/unix/apr_arch_threadproc.h +++ b/include/arch/unix/apr_arch_threadproc.h @@ -19,8 +19,6 @@ #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_arch_file_io.h" -#include "apr_arch_proc_mutex.h" -#include "apr_arch_shm.h" #include "apr_perms_set.h" /* System headers required for thread/process library */ @@ -115,10 +113,6 @@ struct apr_procattr_t { apr_uid_t uid; apr_gid_t gid; apr_procattr_pscb_t *perms_set_callbacks; - - apr_shm_t *ipc_shm; - const void *ipc_data; - apr_size_t ipc_size; }; #endif /* ! THREAD_PROC_H */ diff --git a/include/arch/win32/apr_arch_threadproc.h b/include/arch/win32/apr_arch_threadproc.h index a216db42a6f..d3ce9c51860 100644 --- a/include/arch/win32/apr_arch_threadproc.h +++ b/include/arch/win32/apr_arch_threadproc.h @@ -17,8 +17,6 @@ #include "apr_private.h" #include "apr_thread_proc.h" #include "apr_file_io.h" -#include "apr_arch_shm.h" -#include "apr_perms_set.h" #ifndef THREAD_PROC_H #define THREAD_PROC_H @@ -64,9 +62,6 @@ struct apr_procattr_t { LPSECURITY_ATTRIBUTES sa; LPVOID sd; #endif - apr_shm_t *ipc_shm; - const void *ipc_data; - apr_size_t ipc_size; }; struct apr_thread_once_t { diff --git a/misc/unix/start.c b/misc/unix/start.c index 6263adf5239..4b8ad990de6 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -22,7 +22,6 @@ #include "apr_arch_proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ #include "apr_arch_internal_time.h" -#include "apr_arch_threadproc.h" /* for apr_procattr_ipc_after_init() */ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 05e912b0681..b4e05e58e79 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -451,23 +451,3 @@ APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, { return APR_ENOTIMPL; } - -APR_DECLARE(apr_status_t) apr_procattr_ipc_data_set(apr_procattr_t *attr, - const void *data, - apr_size_t size) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, - void **data, - apr_size_t *size) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, - apr_size_t *size) -{ - return APR_ENOTIMPL; -} diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 39dd0c56fc3..6ee7a1b48f5 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -499,23 +499,3 @@ APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, { return APR_ENOTIMPL; } - -APR_DECLARE(apr_status_t) apr_procattr_ipc_data_set(apr_procattr_t *attr, - const void *data, - apr_size_t size) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, - void **data, - apr_size_t *size) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, - apr_size_t *size) -{ - return APR_ENOTIMPL; -} diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 803ab529eee..9fa94dde191 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -670,23 +670,3 @@ APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, { return APR_ENOTIMPL; } - -APR_DECLARE(apr_status_t) apr_procattr_ipc_data_set(apr_procattr_t *attr, - const void *data, - apr_size_t size) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, - void **data, - apr_size_t *size) -{ - return APR_ENOTIMPL; -} - -APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, - apr_size_t *size) -{ - return APR_ENOTIMPL; -} diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index d3181c0db3f..6c4786653a5 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -19,7 +19,6 @@ #include "apr_portable.h" #include "apr_signal.h" #include "apr_random.h" -#include "apr_arch_proc_mutex.h" /* Heavy on no'ops, here's what we want to pass if there is APR_NO_FILE * requested for a specific child handle; @@ -217,73 +216,6 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_ipc_data_set(apr_procattr_t *attr, - const void *data, - apr_size_t size) -{ - attr->ipc_data = data; - attr->ipc_size = size; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, - void **data, - apr_size_t *size) -{ - if (attr->ipc_shm && attr->ipc_size) { - *data = apr_shm_baseaddr_get(attr->ipc_shm); - *size = attr->ipc_size; - return APR_SUCCESS; - } - else - return APR_EINIT; -} - -/* Global ipc data setup if we are child - * of the process that used child_data_set - * TODO: This can probably be some struct. - */ -static void *ipc_shm_data = NULL; -static apr_size_t ipc_shm_size = 0; -static int ipc_shm_init = 0; -static apr_pool_t *ipc_pool = NULL; - -static apr_status_t proc_ipc_init() -{ - apr_status_t rv; - char envname[64]; - const char *shmname = NULL; - apr_shm_t *shm; - - if (ipc_shm_init++) - return APR_SUCCESS; - apr_pool_create(&ipc_pool, NULL); - apr_snprintf(envname, sizeof(envname), "_APRIPC%" APR_PID_T_FMT, getpid()); - shmname = getenv(envname); - if (!shmname) - return APR_ENOMEM; - if ((rv = apr_shm_attach(&shm, shmname, ipc_pool)) != APR_SUCCESS) - return rv; - ipc_shm_data = apr_shm_baseaddr_get(shm); - ipc_shm_size = apr_shm_size_get(shm); - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, - apr_size_t *size) -{ - if (!ipc_shm_init) { - if (proc_ipc_init() != APR_SUCCESS) - return APR_ENOMEM; - } - if (!ipc_shm_data) - return APR_ENOMEM; - - *data = ipc_shm_data; - *size = ipc_shm_size; - return APR_SUCCESS; -} - APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) { int pid; @@ -421,11 +353,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_pool_t *pool) { int i; - apr_status_t rc = APR_SUCCESS; const char * const empty_envp[] = {NULL}; - apr_proc_mutex_t *ipc_mutex = NULL; - const char *shmname = NULL; - apr_file_t *shmfile = NULL; if (!env) { /* Specs require an empty array instead of NULL; * Purify will trigger a failure, even if many @@ -464,40 +392,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } } - if (attr->ipc_data && attr->ipc_size) { - const char *tempdir; - char *template; - - rc = apr_temp_dir_get(&tempdir, pool); - if (rc != APR_SUCCESS) { - return rc; - } - apr_filepath_merge(&template, tempdir, - "apr.ipc.XXXXXX", - APR_FILEPATH_NATIVE, pool); - rc = apr_file_mktemp(&shmfile, template, 0, pool); - if (rc != APR_SUCCESS) { - return rc; - } - rc = apr_file_name_get(&shmname, shmfile); - if (rc != APR_SUCCESS) { - return rc; - } - /* Create startup ipc mutex. - * The purpose of this mutex is to enable - * the 'start suspended' process behaviour. - * We need to create the shared memory after - * fork() and we don't know in advance what - * the child pid will be. Mutex locks the child - * until we create the shared memory which - * can be then attached at child's apr_initialize. - */ - if ((rc = apr_proc_mutex_create(&ipc_mutex, NULL, - APR_LOCK_DEFAULT, attr->pool)) != APR_SUCCESS) { - return rc; - } - apr_proc_mutex_lock(ipc_mutex); - } if ((new->pid = fork()) < 0) { return errno; } @@ -505,58 +399,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, int status; /* child process */ - if (ipc_mutex) { - char *env0; - if ((rc = apr_proc_mutex_child_init(&ipc_mutex, - NULL, pool)) != APR_SUCCESS) { - /* This should never happen. - * We cannot continue. - */ - if (attr->errfn) { - attr->errfn(pool, rc, "ipc mutex init failed"); - } - _exit(-1); - } - /* Wait util the parent initializes shared memory. - */ - if ((rc = apr_proc_mutex_lock(ipc_mutex)) != APR_SUCCESS) { - /* Locking failed. - * Probably the parent ended prematurely - */ - if (attr->errfn) { - attr->errfn(pool, rc, "ipc mutex lock failed"); - } - _exit(-1); - } - env0 = apr_psprintf(pool, "_APRIPC%" APR_PID_T_FMT "=%s", - getpid(), shmname); - putenv(env0); - if (!env) { - const char const *newenv[2]; - newenv[0] = env0; - newenv[1] = NULL; - env = newenv; - } - else { - const char **newenv; - i = 0; - while (env[i]) - i++; - newenv = apr_palloc(pool, sizeof(char *) * (i + 1)); - newenv[0] = env0; - i = 0; - while (env[i]) { - newenv[i + 1] = env[i]; - i++; - } - env = newenv; - } - - /* By now we should have the ipc shared memory set up. - * We don't need the mutex any more. - */ - apr_proc_mutex_destroy(ipc_mutex); - } /* * If we do exec cleanup before the dup2() calls to set up pipes * on 0-2, we accidentally close the pipes used by programs like @@ -613,7 +455,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_signal(SIGCHLD, SIG_DFL); /* not sure if this is needed or not */ - if (attr->currdir != NULL) { if (chdir(attr->currdir) == -1) { if (attr->errfn) { @@ -753,36 +594,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, _exit(-1); /* if we get here, there is a problem, so exit with an * error code. */ } - if (ipc_mutex) { - apr_file_close(shmfile); - rc = apr_shm_create(&attr->ipc_shm, attr->ipc_size, - shmname, attr->pool); - if (rc == APR_SUCCESS) { - if (!geteuid()) { - /* Set ipc shared memory permissions for - * our child process. - */ - APR_PERMS_SET_FN(shm)(attr->ipc_shm, - APR_FPROT_UREAD | APR_FPROT_UWRITE, - attr->uid, attr->gid); - } - /* Fill in shared memory with ipc data */ - memcpy(apr_shm_baseaddr_get(attr->ipc_shm), - attr->ipc_data, attr->ipc_size); - /* Unlock the ipc startup mutex. - * This mutex is destroyed when attr->pool is cleared - * or destroyed because it might not yet be initialised - * inside the child. - */ - apr_proc_mutex_unlock(ipc_mutex); - } - else { - /* Destroy the mutex. - * This will cause the forked child to exit. - */ - apr_proc_mutex_destroy(ipc_mutex); - } - } /* Parent process */ if (attr->child_in && (attr->child_in->filedes != -1)) { @@ -797,7 +608,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_file_close(attr->child_err); } - return rc; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index d83f7bdcb8a..08ea918a05e 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -341,73 +341,6 @@ APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_ipc_data_set(apr_procattr_t *attr, - const void *data, - apr_size_t size) -{ - attr->ipc_data = data; - attr->ipc_size = size; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_procattr_ipc_data_get(apr_procattr_t *attr, - void **data, - apr_size_t *size) -{ - if (attr->ipc_shm && attr->ipc_size) { - *data = apr_shm_baseaddr_get(attr->ipc_shm); - *size = attr->ipc_size; - return APR_SUCCESS; - } - else - return APR_EINIT; -} - -/* Global ipc data setup if we are child - * of the process that used child_data_set - * TODO: This can probably be some struct. - */ -static void *ipc_shm_data = NULL; -static apr_size_t ipc_shm_size = 0; -static int ipc_shm_init = 0; -static apr_pool_t *ipc_pool = NULL; - -static apr_status_t proc_ipc_init(apr_pool_t *pool) -{ - apr_status_t rv; - char shmname[APR_PATH_MAX]; - const char *tmpdir = NULL; - apr_shm_t *shm; - - if (ipc_shm_init++) - return APR_SUCCESS; - apr_pool_create(&ipc_pool, NULL); - apr_temp_dir_get(&tmpdir, ipc_pool); - apr_snprintf(shmname, sizeof(shmname), "%s\\APRIPC_%d", - tmpdir, GetCurrentProcessId()); - - if ((rv = apr_shm_attach(&shm, shmname, ipc_pool)) != APR_SUCCESS) - return rv; - ipc_shm_data = apr_shm_baseaddr_get(shm); - ipc_shm_size = apr_shm_size_get(shm); - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_proc_parent_ipc_data_get(void **data, - apr_size_t *size) -{ - if (!ipc_shm_init) { - if (proc_ipc_init() != APR_SUCCESS) - return APR_ENOMEM; - } - if (!ipc_shm_data) - return APR_ENOMEM; - - *data = ipc_shm_data; - *size = ipc_shm_size; - return APR_SUCCESS; -} - static const char* has_space(const char *str) { const char *ch; @@ -520,7 +453,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_pool_t *pool) { apr_status_t rv; - apr_status_t rc; apr_size_t i; const char *argv0; char *cmdline; @@ -850,12 +782,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->detached) { si.dwFlags |= STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; - } - if (attr->ipc_data && attr->ipc_size) { - /* Child will be suspended until - * we create the shared memory - */ - dwCreationFlags |= CREATE_SUSPENDED; } #ifndef _WIN32_WCE @@ -982,23 +908,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, NULL, /* STARTUPINFO not supported */ &pi); #endif - - if (rv && attr->ipc_data && attr->ipc_size) { - char shmname[APR_PATH_MAX]; - const char *tmpdir = NULL; - - apr_temp_dir_get(&tmpdir, pool); - apr_snprintf(shmname, sizeof(shmname), "%s\\APRIPC_%d", - tmpdir, pi.dwProcessId); - rc = apr_shm_create(&attr->ipc_shm, attr->ipc_size, - shmname, attr->pool); - if (rc == APR_SUCCESS) { - /* Fill in shared memory with ipc data */ - memcpy(apr_shm_baseaddr_get(attr->ipc_shm), - attr->ipc_data, attr->ipc_size); - } - ResumeThread(pi.hThread); - } } #endif /* APR_HAS_UNICODE_FS */ #if APR_HAS_ANSI_FS From 4b96c14139b884a71f3cb4694de4a85b7440d10e Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Thu, 26 Feb 2009 02:41:21 +0000 Subject: [PATCH 6309/7878] Set CLOEXEC flags where appropriate. Either use new O_CLOEXEC flag and associated functions, such as dup3(), accept4(), epoll_create1() etc., or simply set CLOEXEC flag using fcntl(). Patch by Stefan Fritsch and Arkadiusz Miskiewicz . PR 46425. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@747990 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 17 +++++++++++++++++ file_io/netware/mktemp.c | 2 ++ file_io/unix/filedup.c | 13 ++++++++++++- file_io/unix/mktemp.c | 2 ++ file_io/unix/open.c | 14 +++++++++++++- include/arch/unix/apr_arch_inherit.h | 17 +++++++++++++++++ network_io/unix/sockets.c | 28 ++++++++++++++++++++++------ poll/unix/epoll.c | 19 ++++++++++++++++++- poll/unix/kqueue.c | 9 +++++++-- poll/unix/pollset.c | 5 +++++ poll/unix/port.c | 7 ++++++- 11 files changed, 121 insertions(+), 12 deletions(-) diff --git a/configure.in b/configure.in index ccb9d6d2859..5ff3aa1e634 100644 --- a/configure.in +++ b/configure.in @@ -775,6 +775,23 @@ if test "$apr_cv_epoll" = "yes"; then AC_DEFINE([HAVE_EPOLL], 1, [Define if the epoll interface is supported]) fi +dnl ----------------------------- Checking for extended file descriptor handling +AC_CHECK_FUNCS(dup3 accept4 epoll_create1) + +AC_CACHE_CHECK([for SOCK_CLOEXEC support], [apr_cv_sock_cloexec], +[AC_TRY_RUN([ +#include +#include + +int main() +{ + return socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, 0) == -1; +}], [apr_cv_sock_cloexec=yes], [apr_cv_sock_cloexec=no], [apr_cv_sock_cloexec=no])]) + +if test "$apr_cv_sock_cloexec" = "yes"; then + AC_DEFINE([HAVE_SOCK_CLOEXEC], 1, [Define if the SOCK_CLOEXEC flag is supported]) +fi + dnl ----------------------------- Checking for missing POSIX thread functions AC_CHECK_FUNCS([getpwnam_r getpwuid_r getgrnam_r getgrgid_r]) diff --git a/file_io/netware/mktemp.c b/file_io/netware/mktemp.c index 2a71af7d6db..6dc68ca118c 100644 --- a/file_io/netware/mktemp.c +++ b/file_io/netware/mktemp.c @@ -19,6 +19,7 @@ #include "apr_strings.h" /* prototype of apr_mkstemp() */ #include "apr_arch_file_io.h" /* prototype of apr_mkstemp() */ #include "apr_portable.h" /* for apr_os_file_put() */ +#include "apr_arch_inherit.h" #include /* for mkstemp() - Single Unix */ @@ -43,6 +44,7 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i if (!(flags & APR_FILE_NOCLEANUP)) { + APR_SET_FD_CLOEXEC((*fp)->filedes); apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), apr_unix_file_cleanup, apr_unix_child_file_cleanup); diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index adecbb7f05b..9bb98e77077 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -24,14 +24,25 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p, int which_dup) { - int rv; + int rv, flags = 0; if (which_dup == 2) { if ((*new_file) == NULL) { /* We can't dup2 unless we have a valid new_file */ return APR_EINVAL; } +#ifdef HAVE_DUP3 + if (!(old_file->flags & APR_INHERIT)) + flags |= O_CLOEXEC; + rv = dup3(old_file->filedes, (*new_file)->filedes, flags); +#else rv = dup2(old_file->filedes, (*new_file)->filedes); + if (!(old_file->flags & APR_INHERIT)) { + if (rv == -1) + return errno; + APR_SET_FD_CLOEXEC((*new_file)->filedes); + } +#endif } else { rv = dup(old_file->filedes); } diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 22e0bd5d3a4..7bb5f8d4aaf 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -51,6 +51,7 @@ #include "apr_strings.h" /* prototype of apr_mkstemp() */ #include "apr_arch_file_io.h" /* prototype of apr_mkstemp() */ #include "apr_portable.h" /* for apr_os_file_put() */ +#include "apr_arch_inherit.h" #ifndef HAVE_MKSTEMP @@ -203,6 +204,7 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i (*fp)->fname = apr_pstrdup(p, template); if (!(flags & APR_FILE_NOCLEANUP)) { + APR_SET_FD_CLOEXEC(fd); apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), apr_unix_file_cleanup, apr_unix_child_file_cleanup); diff --git a/file_io/unix/open.c b/file_io/unix/open.c index a4dce36aed6..84ebe3f7d5e 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -127,7 +127,15 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, oflags |= O_BINARY; } #endif - + +#ifdef O_CLOEXEC + /* Introduced in Linux 2.6.23. Silently ignored on earlier Linux kernels. + */ + if (!(flag & APR_FILE_NOCLEANUP)) { + oflags |= O_CLOEXEC; +} +#endif + #if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE) oflags |= O_LARGEFILE; #elif defined(O_LARGEFILE) @@ -155,6 +163,9 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, if (fd < 0) { return errno; } + if (!(flag & APR_FILE_NOCLEANUP)) { + APR_SET_FD_CLOEXEC(fd); + } (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); (*new)->pool = pool; @@ -337,6 +348,7 @@ APR_DECLARE(apr_status_t) apr_file_inherit_unset(apr_file_t *thefile) return APR_EINVAL; } if (thefile->flags & APR_INHERIT) { + APR_SET_FD_CLOEXEC(thefile->filedes); thefile->flags &= ~APR_INHERIT; apr_pool_child_cleanup_set(thefile->pool, (void *)thefile, diff --git a/include/arch/unix/apr_arch_inherit.h b/include/arch/unix/apr_arch_inherit.h index 9a6bdbca588..f1a5cddb459 100644 --- a/include/arch/unix/apr_arch_inherit.h +++ b/include/arch/unix/apr_arch_inherit.h @@ -27,6 +27,12 @@ apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \ if (the##name->flag & APR_FILE_NOCLEANUP) \ return APR_EINVAL; \ if (!(the##name->flag & APR_INHERIT)) { \ + int flags = fcntl(the##name->name##des, F_GETFD); \ + if (flags == -1) \ + return errno; \ + flags &= ~(FD_CLOEXEC); \ + if (fcntl(the##name->name##des, F_SETFD, flags) == -1) \ + return errno; \ the##name->flag |= APR_INHERIT; \ apr_pool_child_cleanup_set(the##name->pool, \ (void *)the##name, \ @@ -35,12 +41,23 @@ apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \ return APR_SUCCESS; \ } +#define APR_SET_FD_CLOEXEC(fd) \ +do { \ + int flags; \ + if ((flags = fcntl(fd, F_GETFD)) == -1) \ + return errno; \ + flags |= FD_CLOEXEC; \ + if (fcntl(fd, F_SETFD, flags) == -1) \ + return errno; \ +} while (0) + #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \ { \ if (the##name->flag & APR_FILE_NOCLEANUP) \ return APR_EINVAL; \ if (the##name->flag & APR_INHERIT) { \ + APR_SET_FD_CLOEXEC(the##name->name##des); \ the##name->flag &= ~APR_INHERIT; \ apr_pool_child_cleanup_set(the##name->pool, \ (void *)the##name, \ diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index bcf6cdd7d93..a46b6a443bf 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -108,9 +108,13 @@ apr_status_t apr_socket_protocol_get(apr_socket_t *sock, int *protocol) apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, int protocol, apr_pool_t *cont) { - int family = ofamily; + int family = ofamily, flags = 0; int oprotocol = protocol; +#ifdef HAVE_SOCK_CLOEXEC + flags |= SOCK_CLOEXEC; +#endif + if (family == APR_UNSPEC) { #if APR_HAVE_IPV6 family = APR_INET6; @@ -126,19 +130,19 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, alloc_socket(new, cont); #ifndef BEOS_R5 - (*new)->socketdes = socket(family, type, protocol); + (*new)->socketdes = socket(family, type|flags, protocol); #else /* For some reason BeOS R5 has an unconventional protocol numbering, * so we need to translate here. */ switch (protocol) { case 0: - (*new)->socketdes = socket(family, type, 0); + (*new)->socketdes = socket(family, type|flags, 0); break; case APR_PROTO_TCP: - (*new)->socketdes = socket(family, type, IPPROTO_TCP); + (*new)->socketdes = socket(family, type|flags, IPPROTO_TCP); break; case APR_PROTO_UDP: - (*new)->socketdes = socket(family, type, IPPROTO_UDP); + (*new)->socketdes = socket(family, type|flags, IPPROTO_UDP); break; case APR_PROTO_SCTP: default: @@ -151,7 +155,7 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, #if APR_HAVE_IPV6 if ((*new)->socketdes < 0 && ofamily == APR_UNSPEC) { family = APR_INET; - (*new)->socketdes = socket(family, type, protocol); + (*new)->socketdes = socket(family, type|flags, protocol); } #endif @@ -160,6 +164,10 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, } set_socket_vars(*new, family, type, oprotocol); +#ifndef HAVE_SOCK_CLOEXEC + APR_SET_FD_CLOEXEC((*new)->socketdes); +#endif + (*new)->timeout = -1; (*new)->inherit = 0; apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup, @@ -218,7 +226,11 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, sa.salen = sizeof(sa.sa); +#ifdef HAVE_ACCEPT4 + s = accept4(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen, SOCK_CLOEXEC); +#else s = accept(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen); +#endif if (s < 0) { return errno; @@ -300,6 +312,10 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, (*new)->local_interface_unknown = 1; } +#ifndef HAVE_ACCEPT4 + APR_SET_FD_CLOEXEC((*new)->socketdes); +#endif + (*new)->inherit = 0; apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup, socket_cleanup); diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index b695107304d..d483a37639c 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -21,6 +21,7 @@ #include "apr_arch_file_io.h" #include "apr_arch_networkio.h" #include "apr_arch_poll_private.h" +#include "apr_arch_inherit.h" #if defined(HAVE_EPOLL) @@ -95,12 +96,20 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, apr_status_t rv; int fd; +#ifdef HAVE_EPOLL_CREATE1 + fd = epoll_create1(EPOLL_CLOEXEC); +#else fd = epoll_create(size); +#endif if (fd < 0) { pollset->p = NULL; return apr_get_netos_error(); } +#ifndef HAVE_EPOLL_CREATE1 + APR_SET_FD_CLOEXEC(fd); +#endif + pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t)); #if APR_HAS_THREADS if ((flags & APR_POLLSET_THREADSAFE) && @@ -319,15 +328,23 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, { int fd; +#ifdef HAVE_EPOLL_CREATE1 + fd = epoll_create1(EPOLL_CLOEXEC); +#else fd = epoll_create(size); +#endif if (fd < 0) { return apr_get_netos_error(); } + +#ifndef HAVE_EPOLL_CREATE1 + APR_SET_FD_CLOEXEC(fd); +#endif pollcb->fd = fd; pollcb->pollset.epoll = apr_palloc(p, size * sizeof(struct epoll_event)); - apr_pool_cleanup_register(p, pollcb, cb_cleanup, cb_cleanup); + apr_pool_cleanup_register(p, pollcb, cb_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index d7b67803055..13d20bba997 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -21,6 +21,7 @@ #include "apr_arch_file_io.h" #include "apr_arch_networkio.h" #include "apr_arch_poll_private.h" +#include "apr_arch_inherit.h" #ifdef HAVE_KQUEUE @@ -98,6 +99,8 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, return apr_get_netos_error(); } + APR_SET_FD_CLOEXEC(pollset->p->kqueue_fd); + pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); APR_RING_INIT(&pollset->p->query_ring, pfd_elem_t, link); @@ -312,10 +315,12 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, if (fd < 0) { return apr_get_netos_error(); } - + + APR_SET_FD_CLOEXEC(fd); + pollcb->fd = fd; pollcb->pollset.ke = (struct kevent *)apr_pcalloc(p, size * sizeof(struct kevent)); - apr_pool_cleanup_register(p, pollcb, cb_cleanup, cb_cleanup); + apr_pool_cleanup_register(p, pollcb, cb_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index d3ad33b7a00..07f788a3b3f 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -26,6 +26,7 @@ #include "apr_arch_file_io.h" #include "apr_arch_networkio.h" #include "apr_arch_poll_private.h" +#include "apr_arch_inherit.h" static apr_pollset_method_e pollset_default_method = POLLSET_DEFAULT_METHOD; @@ -87,6 +88,10 @@ static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) fd.reqevents = APR_POLLIN; fd.desc_type = APR_POLL_FILE; fd.desc.f = pollset->wakeup_pipe[0]; + + APR_SET_FD_CLOEXEC(pollset->wakeup_pipe[0]->filedes); + APR_SET_FD_CLOEXEC(pollset->wakeup_pipe[1]->filedes); + /* Add the pipe to the pollset */ return apr_pollset_add(pollset, &fd); diff --git a/poll/unix/port.c b/poll/unix/port.c index 7ff0fb6f6da..7171a0080fd 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -22,6 +22,7 @@ #include "apr_arch_file_io.h" #include "apr_arch_networkio.h" #include "apr_arch_poll_private.h" +#include "apr_arch_inherit.h" #if defined(HAVE_PORT_CREATE) @@ -125,6 +126,8 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, return APR_ENOMEM; } + APR_SET_FD_CLOEXEC(pollset->p->port_fd); + pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); APR_RING_INIT(&pollset->p->query_ring, pfd_elem_t, link); @@ -395,8 +398,10 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, return apr_get_netos_error(); } + APR_SET_FD_CLOEXEC(fd); + pollcb->pollset.port = apr_palloc(p, size * sizeof(port_event_t)); - apr_pool_cleanup_register(p, pollcb, cb_cleanup, cb_cleanup); + apr_pool_cleanup_register(p, pollcb, cb_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } From 4e1129d3c0a6c51ca191ec9117591d2a25f2c793 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 26 Feb 2009 11:04:10 +0000 Subject: [PATCH 6310/7878] On windows files != sockets, so do not create unneeded pollset for every opened file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748080 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 6 ++++-- file_io/win32/open.c | 6 ++++-- file_io/win32/pipe.c | 9 ++++++--- include/arch/win32/apr_arch_file_io.h | 3 ++- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index e96ef2bc570..2c9a3429130 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -57,10 +57,11 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), file_cleanup, apr_pool_cleanup_null); +#if APR_FILES_AS_SOCKETS /* Create a pollset with room for one descriptor. */ /* ### check return codes */ (void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0); - +#endif return APR_SUCCESS; #endif /* !defined(_WIN32_WCE) */ } @@ -218,9 +219,10 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, apr_pool_cleanup_kill(old_file->pool, (void *)old_file, file_cleanup); +#if APR_FILES_AS_SOCKETS /* Create a pollset with room for one descriptor. */ /* ### check return codes */ (void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0); - +#endif return APR_SUCCESS; } diff --git a/file_io/win32/open.c b/file_io/win32/open.c index e282d5fc243..82dc8294e02 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -477,10 +477,11 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, /* This feature is not supported on this platform. */ (*new)->flags &= ~APR_FOPEN_SPARSE; +#if APR_FILES_AS_SOCKETS /* Create a pollset with room for one descriptor. */ /* ### check return codes */ (void) apr_pollset_create(&(*new)->pollset, 1, pool, 0); - +#endif if (!(flag & APR_FILE_NOCLEANUP)) { apr_pool_cleanup_register((*new)->pool, (void *)(*new), file_cleanup, apr_pool_cleanup_null); @@ -649,10 +650,11 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, } } +#if APR_FILES_AS_SOCKETS /* Create a pollset with room for one descriptor. */ /* ### check return codes */ (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); - +#endif /* Should we be testing if thefile is a handle to * a PIPE and set up the mechanics appropriately? * diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 5812fa45253..f1ab4895e2f 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -105,8 +105,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, (*in)->dataRead = 0; (*in)->direction = 0; (*in)->pOverlapped = NULL; +#if APR_FILES_AS_SOCKETS (void) apr_pollset_create(&(*in)->pollset, 1, p, 0); - +#endif (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*out)->pool = p; (*out)->fname = NULL; @@ -119,8 +120,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, (*out)->dataRead = 0; (*out)->direction = 0; (*out)->pOverlapped = NULL; +#if APR_FILES_AS_SOCKETS (void) apr_pollset_create(&(*out)->pollset, 1, p, 0); - +#endif if (apr_os_level >= APR_WIN_NT) { /* Create the read end of the pipe */ dwOpenMode = PIPE_ACCESS_INBOUND; @@ -208,8 +210,9 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, (*file)->timeout = -1; (*file)->ungetchar = -1; (*file)->filehand = *thefile; +#if APR_FILES_AS_SOCKETS (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); - +#endif if (register_cleanup) { apr_pool_cleanup_register(pool, *file, file_cleanup, apr_pool_cleanup_null); diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index c8c7bdee887..4ac39e9d379 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -184,9 +184,10 @@ struct apr_file_t { apr_off_t filePtr; // position in file of handle apr_thread_mutex_t *mutex; // mutex semaphore, must be owned to access the above fields +#if APR_FILES_AS_SOCKETS /* if there is a timeout set, then this pollset is used */ apr_pollset_t *pollset; - +#endif /* Pipe specific info */ }; From 3788d9f0d06ac8b9e2225935ea62578c51a338c1 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 26 Feb 2009 17:58:07 +0000 Subject: [PATCH 6311/7878] * build/buildcheck.sh: Reject libtool 2.x until someone can come back around and do the magic to support it. (As of right now, it leaves configure in a bad state.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748240 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index c236810012f..2346ce02cf9 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -44,6 +44,7 @@ if test -z "$lt_pversion"; then echo "buildconf: libtool not found." echo " You need libtool version 1.4 or newer installed" echo " to build APR from SVN." +echo " (libtool 2.x not supported yet)" exit 1 fi lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` @@ -54,6 +55,9 @@ if test "$1" = "1"; then lt_status="bad" fi fi +if test "$1" = "2"; then + lt_status="bad" +fi if test $lt_status = "good"; then echo "buildconf: libtool version $lt_pversion (ok)" exit 0 @@ -62,5 +66,6 @@ fi echo "buildconf: libtool version $lt_pversion found." echo " You need libtool version 1.4 or newer installed" echo " to build APR from SVN." +echo " (libtool 2.x not supported yet)" exit 1 From ce0a7cb981032438f066bee915d75b8260206d5b Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 26 Feb 2009 18:13:38 +0000 Subject: [PATCH 6312/7878] Fix netware build errors git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748253 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_nw_export.awk | 9 +++++++++ include/apr.hnw | 7 ++++++- poll/unix/select.c | 6 +++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index d49fcbaf12d..53062709355 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -8,6 +8,8 @@ BEGIN { # List of functions that we don't support, yet?? #/apr_##name##_set_inherit/{next} #/apr_##name##_unset_inherit/{next} +#/apr_##name##_perms_set/{next} +/apr_socket_perms_set/{next} function add_symbol (sym_name) { @@ -65,6 +67,13 @@ function add_symbol (sym_name) { next } +#/^[ \t]*APR_PERMS_SET_IMPLEMENT[^(]*[(][^)]*[)]/ { +# sub("[ \t]*APR_PERMS_SET_IMPLEMENT[^(]*[(]", "", $0) +# sub("[)].*$", "", $0) +# add_symbol("apr_" $0 "_perms_set") +# next +#} + /^[ \t]*AP[RUI]?_DECLARE_DATA .*;$/ { varname = $NF; gsub( /[*;]/, "", varname); diff --git a/include/apr.hnw b/include/apr.hnw index 4e332635550..93a2d79507e 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -120,15 +120,16 @@ extern "C" { #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SOCKIO_H 0 #define APR_HAVE_SYS_TIME_H 0 +#define APR_HAVE_SYS_UN_H 0 #else #define APR_HAVE_SYS_SOCKET_H 1 #define APR_HAVE_SYS_SOCKIO_H 1 #define APR_HAVE_SYS_TIME_H 1 +#define APR_HAVE_SYS_UN_H 1 #endif #define APR_HAVE_SYS_SIGNAL_H 1 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 1 -#define APR_HAVE_SYS_UN_H 1 #define APR_HAVE_SYS_WAIT_H 1 #define APR_HAVE_TIME_H 1 #define APR_HAVE_UNISTD_H 1 @@ -178,7 +179,11 @@ extern "C" { #else #define APR_HAVE_IPV6 0 #endif +#ifdef USE_WINSOCK #define APR_HAVE_SOCKADDR_UN 0 +#else +#define APR_HAVE_SOCKADDR_UN 1 +#endif #define APR_HAVE_MEMCHR 1 #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 diff --git a/poll/unix/select.c b/poll/unix/select.c index 1affe8151c4..9288de00cc5 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -241,8 +241,8 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, #else #ifdef NETWARE /* NetWare can't handle mixed descriptor types in select() */ - if (descriptor->desc.f->is_pipe && !HAS_SOCKETS(pollset->set_type)) { - pollset->set_type = APR_POLL_FILE; + if (descriptor->desc.f->is_pipe && !HAS_SOCKETS(pollset->p->set_type)) { + pollset->p->set_type = APR_POLL_FILE; fd = descriptor->desc.f->filedes; } else { @@ -357,7 +357,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, memcpy(&exceptset, &(pollset->p->exceptset), sizeof(fd_set)); #ifdef NETWARE - if (HAS_PIPES(ppollset->p->set_type)) { + if (HAS_PIPES(pollset->p->set_type)) { rs = pipe_select(pollset->p->maxfd + 1, &readset, &writeset, &exceptset, tvptr); } From e031de6421e5323c1be71181bdaf3448ad4b84c5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 27 Feb 2009 00:39:14 +0000 Subject: [PATCH 6313/7878] fix unused variable warning for builds without HAVE_DUP3 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748361 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 9bb98e77077..2dbeb3bfa8c 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -24,7 +24,10 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p, int which_dup) { - int rv, flags = 0; + int rv; +#ifdef HAVE_DUP3 + int flags = 0; +#endif if (which_dup == 2) { if ((*new_file) == NULL) { From 555fcdeb19ed1e13384692504b0827d91336cde1 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Fri, 27 Feb 2009 01:34:54 +0000 Subject: [PATCH 6314/7878] Unroll APR_SET_FD_CLOEXEC macro. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748371 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/mktemp.c | 10 +++++++++- file_io/unix/mktemp.c | 10 +++++++++- file_io/unix/open.c | 19 +++++++++++++++++-- include/arch/unix/apr_arch_inherit.h | 17 ++++++----------- network_io/unix/sockets.c | 22 ++++++++++++++++++++-- poll/unix/epoll.c | 22 ++++++++++++++++++++-- poll/unix/kqueue.c | 22 ++++++++++++++++++++-- poll/unix/pollset.c | 22 ++++++++++++++++++++-- poll/unix/port.c | 22 ++++++++++++++++++++-- 9 files changed, 141 insertions(+), 25 deletions(-) diff --git a/file_io/netware/mktemp.c b/file_io/netware/mktemp.c index 6dc68ca118c..c86954ff279 100644 --- a/file_io/netware/mktemp.c +++ b/file_io/netware/mktemp.c @@ -44,7 +44,15 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i if (!(flags & APR_FILE_NOCLEANUP)) { - APR_SET_FD_CLOEXEC((*fp)->filedes); + int flags; + + if ((flags = fcntl((*fp)->filedes, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl((*fp)->filedes, F_SETFD, flags) == -1) + return errno; + apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), apr_unix_file_cleanup, apr_unix_child_file_cleanup); diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 7bb5f8d4aaf..a78b73ae96c 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -204,7 +204,15 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i (*fp)->fname = apr_pstrdup(p, template); if (!(flags & APR_FILE_NOCLEANUP)) { - APR_SET_FD_CLOEXEC(fd); + int flags; + + if ((flags = fcntl(fd, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl(fd, F_SETFD, flags) == -1) + return errno; + apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), apr_unix_file_cleanup, apr_unix_child_file_cleanup); diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 84ebe3f7d5e..e10fc3ddaab 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -164,7 +164,14 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, return errno; } if (!(flag & APR_FILE_NOCLEANUP)) { - APR_SET_FD_CLOEXEC(fd); + int flags; + + if ((flags = fcntl(fd, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl(fd, F_SETFD, flags) == -1) + return errno; } (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); @@ -348,7 +355,15 @@ APR_DECLARE(apr_status_t) apr_file_inherit_unset(apr_file_t *thefile) return APR_EINVAL; } if (thefile->flags & APR_INHERIT) { - APR_SET_FD_CLOEXEC(thefile->filedes); + int flags; + + if ((flags = fcntl(thefile->filedes, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl(thefile->filedes, F_SETFD, flags) == -1) + return errno; + thefile->flags &= ~APR_INHERIT; apr_pool_child_cleanup_set(thefile->pool, (void *)thefile, diff --git a/include/arch/unix/apr_arch_inherit.h b/include/arch/unix/apr_arch_inherit.h index f1a5cddb459..6ae2435f052 100644 --- a/include/arch/unix/apr_arch_inherit.h +++ b/include/arch/unix/apr_arch_inherit.h @@ -41,23 +41,18 @@ apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \ return APR_SUCCESS; \ } -#define APR_SET_FD_CLOEXEC(fd) \ -do { \ - int flags; \ - if ((flags = fcntl(fd, F_GETFD)) == -1) \ - return errno; \ - flags |= FD_CLOEXEC; \ - if (fcntl(fd, F_SETFD, flags) == -1) \ - return errno; \ -} while (0) - #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \ { \ if (the##name->flag & APR_FILE_NOCLEANUP) \ return APR_EINVAL; \ if (the##name->flag & APR_INHERIT) { \ - APR_SET_FD_CLOEXEC(the##name->name##des); \ + int flags; \ + if ((flags = fcntl(the##name->name##des, F_GETFD)) == -1) \ + return errno; \ + flags |= FD_CLOEXEC; \ + if (fcntl(the##name->name##des, F_SETFD, flags) == -1) \ + return errno; \ the##name->flag &= ~APR_INHERIT; \ apr_pool_child_cleanup_set(the##name->pool, \ (void *)the##name, \ diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index a46b6a443bf..9852563464b 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -165,7 +165,16 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, set_socket_vars(*new, family, type, oprotocol); #ifndef HAVE_SOCK_CLOEXEC - APR_SET_FD_CLOEXEC((*new)->socketdes); + { + int flags; + + if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl((*new)->socketdes, F_SETFD, flags) == -1) + return errno; + } #endif (*new)->timeout = -1; @@ -313,7 +322,16 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, } #ifndef HAVE_ACCEPT4 - APR_SET_FD_CLOEXEC((*new)->socketdes); + { + int flags; + + if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl((*new)->socketdes, F_SETFD, flags) == -1) + return errno; + } #endif (*new)->inherit = 0; diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index d483a37639c..288ae069a48 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -107,7 +107,16 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, } #ifndef HAVE_EPOLL_CREATE1 - APR_SET_FD_CLOEXEC(fd); + { + int flags; + + if ((flags = fcntl(fd, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl(fd, F_SETFD, flags) == -1) + return errno; + } #endif pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t)); @@ -339,7 +348,16 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, } #ifndef HAVE_EPOLL_CREATE1 - APR_SET_FD_CLOEXEC(fd); + { + int flags; + + if ((flags = fcntl(fd, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl(fd, F_SETFD, flags) == -1) + return errno; + } #endif pollcb->fd = fd; diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 13d20bba997..bfd81b0b24c 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -99,7 +99,16 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, return apr_get_netos_error(); } - APR_SET_FD_CLOEXEC(pollset->p->kqueue_fd); + { + int flags; + + if ((flags = fcntl(pollset->p->kqueue_fd, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl(pollset->p->kqueue_fd, F_SETFD, flags) == -1) + return errno; + } pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); @@ -316,7 +325,16 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, return apr_get_netos_error(); } - APR_SET_FD_CLOEXEC(fd); + { + int flags; + + if ((flags = fcntl(fd, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl(fd, F_SETFD, flags) == -1) + return errno; + } pollcb->fd = fd; pollcb->pollset.ke = (struct kevent *)apr_pcalloc(p, size * sizeof(struct kevent)); diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index 07f788a3b3f..6a3fa5dfe2a 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -89,8 +89,26 @@ static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) fd.desc_type = APR_POLL_FILE; fd.desc.f = pollset->wakeup_pipe[0]; - APR_SET_FD_CLOEXEC(pollset->wakeup_pipe[0]->filedes); - APR_SET_FD_CLOEXEC(pollset->wakeup_pipe[1]->filedes); + { + int flags; + + if ((flags = fcntl(pollset->wakeup_pipe[0]->filedes, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl(pollset->wakeup_pipe[0]->filedes, F_SETFD, flags) == -1) + return errno; + } + { + int flags; + + if ((flags = fcntl(pollset->wakeup_pipe[1]->filedes, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl(pollset->wakeup_pipe[1]->filedes, F_SETFD, flags) == -1) + return errno; + } /* Add the pipe to the pollset */ diff --git a/poll/unix/port.c b/poll/unix/port.c index 7171a0080fd..91b289fc858 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -126,7 +126,16 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, return APR_ENOMEM; } - APR_SET_FD_CLOEXEC(pollset->p->port_fd); + { + int flags; + + if ((flags = fcntl(pollset->p->port_fd, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl(pollset->p->port_fd, F_SETFD, flags) == -1) + return errno; + } pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); @@ -398,7 +407,16 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, return apr_get_netos_error(); } - APR_SET_FD_CLOEXEC(fd); + { + int flags; + + if ((flags = fcntl(fd, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl(fd, F_SETFD, flags) == -1) + return errno; + } pollcb->pollset.port = apr_palloc(p, size * sizeof(port_event_t)); apr_pool_cleanup_register(p, pollcb, cb_cleanup, apr_pool_cleanup_null); From 087b83397fcaa2e9835b0b63e43439a96acde1c1 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Fri, 27 Feb 2009 15:54:37 +0000 Subject: [PATCH 6315/7878] * One missing unroll of APR_SET_FD_CLOEXEC. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748565 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 2dbeb3bfa8c..56d6ab0868f 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -28,7 +28,7 @@ static apr_status_t file_dup(apr_file_t **new_file, #ifdef HAVE_DUP3 int flags = 0; #endif - + if (which_dup == 2) { if ((*new_file) == NULL) { /* We can't dup2 unless we have a valid new_file */ @@ -41,9 +41,18 @@ static apr_status_t file_dup(apr_file_t **new_file, #else rv = dup2(old_file->filedes, (*new_file)->filedes); if (!(old_file->flags & APR_INHERIT)) { + int flags; + if (rv == -1) return errno; - APR_SET_FD_CLOEXEC((*new_file)->filedes); + + if ((flags = fcntl((*new_file)->filedes, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl((*new_file)->filedes, F_SETFD, flags) == -1) + return errno; + } #endif } else { From fa483f89a6e62e646c6a54f7e81e0d612838d3d5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 27 Feb 2009 20:29:11 +0000 Subject: [PATCH 6316/7878] no need to copy descriptors if only the wakeup pipe popped git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748684 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 288ae069a48..71a1b3087e1 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -292,18 +292,19 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, j++; } } - if (((*num) = j)) + if (((*num) = j)) { /* any event besides wakeup pipe? */ rv = APR_SUCCESS; - if (descriptors) { - *descriptors = pollset->p->result_set; + if (descriptors) { + *descriptors = pollset->p->result_set; + } } } if (!(pollset->flags & APR_POLLSET_NOCOPY)) { pollset_lock_rings(); - /* Shift all PFDs in the Dead Ring to be Free Ring */ + /* Shift all PFDs in the Dead Ring to the Free Ring */ APR_RING_CONCAT(&(pollset->p->free_ring), &(pollset->p->dead_ring), pfd_elem_t, link); pollset_unlock_rings(); From 4e179946295e4219ab087d681d42c59361dbb105 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 28 Feb 2009 16:19:46 +0000 Subject: [PATCH 6317/7878] fix compile failure on Solaris git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748879 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index 91b289fc858..c772355d122 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -410,11 +410,11 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, { int flags; - if ((flags = fcntl(fd, F_GETFD)) == -1) + if ((flags = fcntl(pollcb->fd, F_GETFD)) == -1) return errno; flags |= FD_CLOEXEC; - if (fcntl(fd, F_SETFD, flags) == -1) + if (fcntl(pollcb->fd, F_SETFD, flags) == -1) return errno; } From ead046a0f0630520d36a4903a0173b0f0b2bd608 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 28 Feb 2009 17:24:35 +0000 Subject: [PATCH 6318/7878] jlibtool: improve bundle support on Mac OS X so that Subversion's SWIG Python bindings can be built (albeit with wrong extension, but that's not our fault). * build/jlibtool.c (MODULE_OPTS): Pass -dynamic when using -bundle. (jlibtool_basename, nameof): Move earlier in file. (gen_library_name): Add one more character to avoid running over (ouch!); if we're using a module, take the basename of it. (parse_args): Take in 'release' parameter. (run_mode): Clean up if/else clauses. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748888 13f79535-47bb-0310-9956-ffa450edef68 --- build/jlibtool.c | 102 +++++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 47 deletions(-) diff --git a/build/jlibtool.c b/build/jlibtool.c index 3db1efcd548..9bd01d04157 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -64,7 +64,7 @@ # define RANLIB "ranlib" # define PIC_FLAG "-fPIC -fno-common" # define SHARED_OPTS "-dynamiclib" -# define MODULE_OPTS "-bundle" +# define MODULE_OPTS "-bundle -dynamic" # define DYNAMIC_LINK_OPTS "-flat_namespace" # define DYNAMIC_LINK_UNDEFINED "-undefined suppress" # define dynamic_link_version_func darwin_dynamic_link_function @@ -697,6 +697,44 @@ void safe_mkdir(const char *path) #endif } +/* returns just a file's name without the path */ +const char *jlibtool_basename(const char *fullpath) +{ + const char *name = strrchr(fullpath, '/'); + + if (name == NULL) { + name = strrchr(fullpath, '\\'); + } + + if (name == NULL) { + name = fullpath; + } else { + name++; + } + + return name; +} + +/* returns just a file's name without path or extension */ +const char *nameof(const char *fullpath) +{ + const char *name; + const char *ext; + + name = jlibtool_basename(fullpath); + ext = strrchr(name, '.'); + + if (ext) { + char *trimmed; + trimmed = malloc(ext - name + 1); + strncpy(trimmed, name, ext - name); + trimmed[ext-name] = 0; + return trimmed; + } + + return name; +} + /* version_info is in the form of MAJOR:MINOR:PATCH */ const char *darwin_dynamic_link_function(const char *version_info) { @@ -749,14 +787,19 @@ char *gen_library_name(const char *name, int genlib) { char *newarg, *newext; - newarg = (char *)malloc(strlen(name) + 10); + newarg = (char *)malloc(strlen(name) + 11); strcpy(newarg, ".libs/"); if (genlib == 2 && strncmp(name, "lib", 3) == 0) { name += 3; } - strcat(newarg, name); + if (genlib == 2) { + strcat(newarg, jlibtool_basename(name)); + } + else { + strcat(newarg, name); + } newext = strrchr(newarg, '.') + 1; @@ -1138,44 +1181,6 @@ void add_linker_flag_prefix(count_chars *cc, const char *arg) #endif } -/* returns just a file's name without the path */ -const char *jlibtool_basename(const char *fullpath) -{ - const char *name = strrchr(fullpath, '/'); - - if (name == NULL) { - name = strrchr(fullpath, '\\'); - } - - if (name == NULL) { - name = fullpath; - } else { - name++; - } - - return name; -} - -/* returns just a file's name without path or extension */ -const char *nameof(const char *fullpath) -{ - const char *name; - const char *ext; - - name = jlibtool_basename(fullpath); - ext = strrchr(name, '.'); - - if (ext) { - char *trimmed; - trimmed = malloc(ext - name + 1); - strncpy(trimmed, name, ext - name); - trimmed[ext-name] = 0; - return trimmed; - } - - return name; -} - int explode_static_lib(command_t *cmd_data, const char *lib) { count_chars tmpdir_cc, libname_cc; @@ -1528,6 +1533,10 @@ void parse_args(int argc, char *argv[], command_t *cmd_data) /* Aha, we should try to link both! */ cmd_data->install_path = argv[++a]; argused = 1; + } else if (strcmp(arg+1, "release") == 0) { + /* Store for later deciphering */ + cmd_data->version_info = argv[++a]; + argused = 1; } else if (strcmp(arg+1, "version-info") == 0) { /* Store for later deciphering */ cmd_data->version_info = argv[++a]; @@ -1894,18 +1903,17 @@ int run_mode(command_t *cmd_data) clear_count_chars(cmd_data->program_opts); append_count_chars(cmd_data->program_opts, cmd_data->arglist); - if (cmd_data->output != otModule) { + if (cmd_data->output == otModule) { +#ifdef MODULE_OPTS + push_count_chars(cmd_data->program_opts, MODULE_OPTS); +#endif + } else { #ifdef SHARED_OPTS push_count_chars(cmd_data->program_opts, SHARED_OPTS); #endif #ifdef dynamic_link_version_func push_count_chars(cmd_data->program_opts, dynamic_link_version_func(cmd_data->version_info)); -#endif - } - if (cmd_data->output == otModule) { -#ifdef MODULE_OPTS - push_count_chars(cmd_data->program_opts, MODULE_OPTS); #endif } add_dynamic_link_opts(cmd_data, cmd_data->program_opts); From 3a2c0b9ae48d3b71efa38291cc108ecc8804f028 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 28 Feb 2009 17:40:10 +0000 Subject: [PATCH 6319/7878] Document the restriction that you can't (successfully) add the same socket or file to the same pollset. (At present, two of the n implementations will let you do it, but the subsequent results from a poll operation can differ from when the program adds the socket/file once with all necessary request events.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748892 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/apr_poll.h b/include/apr_poll.h index ad78b9f8a3e..778f79c9853 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -200,6 +200,12 @@ APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset); * @remark If the pollset has been created with APR_POLLSET_NOCOPY, the * apr_pollfd_t structure referenced by descriptor will not be copied * and must have a lifetime at least as long as the pollset. + * @remark Do not add the same socket or file descriptor to the same pollset + * multiple times, even if the requested events differ for the + * different calls to apr_pollset_add(). If the events of interest + * for a descriptor change, you must first remove the descriptor + * from the pollset with apr_pollset_remove(), then add it again + * specifying all requested events. */ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor); From 01bd6aec2dfbd0968a20616b43e93d5af1ad8ca5 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 28 Feb 2009 18:32:55 +0000 Subject: [PATCH 6320/7878] Go back around and clean up GNU libtool 2.x detection and usage. (Tested with GNU libtool 2.2.6, 1.5.26, and jlibtool; and GNU autoconf 2.63.) * configure.in (AC_CONFIG_MACRO_DIR): Define so that glibtoolize2 knows where to plop things. (AC_PROG_SED): Always find sed. (Xsed): Define to work around libtool 2.x brokenness. * build/buildcheck.sh: Re-activate libtool 2.x * buildconf: Clean up and rationalize the entire process of importing libtool autoconf macros. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748902 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 3 --- buildconf | 55 +++++++++++++++++++-------------------------- configure.in | 8 +++++++ 3 files changed, 31 insertions(+), 35 deletions(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 2346ce02cf9..d0e2e26ed30 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -55,9 +55,6 @@ if test "$1" = "1"; then lt_status="bad" fi fi -if test "$1" = "2"; then - lt_status="bad" -fi if test $lt_status = "good"; then echo "buildconf: libtool version $lt_pversion (ok)" exit 0 diff --git a/buildconf b/buildconf index 15747f9e6f4..514a410e9df 100755 --- a/buildconf +++ b/buildconf @@ -35,25 +35,20 @@ fi # Note: APR supplies its own config.guess and config.sub -- we do not # rely on libtool's versions # -echo "Copying libtool helper files ..." +echo "buildconf: copying libtool helper files using $libtoolize" # Remove any libtool files so one can switch between libtool 1.3 # and libtool 1.4 by simply rerunning the buildconf script. -(cd build ; rm -f ltconfig ltmain.sh libtool.m4) - -$libtoolize --copy --automake - -if [ -f libtool.m4 ]; then - ltfile=`pwd`/libtool.m4 -elif grep all_pkgmacro_files $libtoolize > /dev/null; then - # libtool 2.x - aclocal_dir=`sed -n '/^aclocaldir=/{s/.*=//;p;q;}' < $libtoolize` - ltfiles=`sed -n '/^all_pkgmacro_files=/{s/.*=//;;s/"//;p;q;}' < $libtoolize` - for f in $ltfiles; do - test -f "$aclocal_dir/$f" && cp "$aclocal_dir/$f" build - done - ltfile=$aclocal_dir/libtool.m4 -else +(cd build ; rm -f ltconfig ltmain.sh libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4) + +lt_pversion=`$libtoolize --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` +lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` +IFS=.; set $lt_version; IFS=' ' +if test "$1" = "1"; then + $libtoolize --copy --automake + if [ -f libtool.m4 ]; then + ltfile=`pwd`/libtool.m4 + else ltfindcmd="`sed -n \"/=[^\\\`]/p;/libtool_m4=/{s/.*=/echo /p;q;}\" \ < $libtoolize`" ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`} @@ -62,21 +57,17 @@ else ltpath=`dirname $libtoolize` ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 fi -fi - -if [ ! -f $ltfile ]; then + fi + if [ ! -f $ltfile ]; then echo "$ltfile not found" exit 1 + fi + # Do we need this anymore? + echo "buildconf: Using libtool.m4 at ${ltfile}." + cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 fi - -echo "buildconf: Using libtool.m4 at ${ltfile}." - -cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 - -# libtool.m4 from 1.6 requires ltsugar.m4 -if [ -f ltsugar.m4 ]; then - rm -f build/ltsugar.m4 - mv ltsugar.m4 build/ltsugar.m4 +if test "$1" = "2"; then + $libtoolize --copy fi # Clean up any leftovers @@ -85,22 +76,22 @@ rm -f aclocal.m4 libtool.m4 # # Generate the autoconf header and ./configure # -echo "Creating include/arch/unix/apr_private.h.in ..." +echo "buildconf: creating include/arch/unix/apr_private.h.in ..." ${AUTOHEADER:-autoheader} -echo "Creating configure ..." +echo "buildconf: creating configure ..." ### do some work to toss config.cache? ${AUTOCONF:-autoconf} # Remove autoconf 2.5x's cache directory rm -rf autom4te*.cache -echo "Generating 'make' outputs ..." +echo "buildconf: generating 'make' outputs ..." build/gen-build.py make # Create RPM Spec file if [ -f `which cut` ]; then - echo rebuilding rpm spec file + echo "buildconf: rebuilding rpm spec file" ( REVISION=`build/get-version.sh all include/apr_version.h APR` VERSION=`echo $REVISION | cut -d- -s -f1` RELEASE=`echo $REVISION | cut -d- -s -f2` diff --git a/configure.in b/configure.in index 5ff3aa1e634..d14bcf504bd 100644 --- a/configure.in +++ b/configure.in @@ -9,6 +9,7 @@ AC_PREREQ(2.50) AC_INIT(build/apr_common.m4) AC_CONFIG_HEADER(include/arch/unix/apr_private.h) AC_CONFIG_AUX_DIR(build) +AC_CONFIG_MACRO_DIR(build) dnl dnl Include our own M4 macros along with those for libtool @@ -121,6 +122,8 @@ dnl can only be used once within a configure script, so this prevents a dnl preload section from invoking the macro to get compiler info. AC_PROG_CC +AC_PROG_SED + dnl Preload APR_PRELOAD @@ -164,6 +167,11 @@ echo "performing libtool configuration..." AC_ARG_ENABLE(experimental-libtool,[ --enable-experimental-libtool Use experimental custom libtool], [experimental_libtool=$enableval],[experimental_libtool=no]) +dnl Workarounds for busted Libtool 2.x when we don't call AC_PROG_LIBTOOL +if test "x$Xsed" = "x"; then + Xsed="$SED -e 1s/^X//" +fi + case $host in *-os2*) # Use a custom-made libtool replacement From ec2982b2190454083e713328edb52364e97a4e18 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 1 Mar 2009 02:22:38 +0000 Subject: [PATCH 6321/7878] Allow the kqueue pollset implementation to support checking both APR_POLLIN and APR_POLLOUT for the same descriptor. This requires separate kevent structures for both conditions. Importantly, if both conditions are present, they will be returned in separate apr_pollfd_t structures with this implementation (to avoid the cycles to coalesce into the minimal number of structures). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748951 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 3 +++ poll/unix/kqueue.c | 41 ++++++++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index 778f79c9853..c0f4025f6b5 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -241,6 +241,9 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, * APR_POLLSET_WAKEABLE, apr_pollset_wakeup() has been called while * waiting for activity, and there were no signalled descriptors at the * time of the wakeup call. + * @remark Multiple signalled conditions for the same descriptor may be reported + * in one or more returned apr_pollfd_t structures, depending on the + * implementation. */ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_interval_time_t timeout, diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index bfd81b0b24c..e0bd37d351a 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -44,7 +44,9 @@ static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags) struct apr_pollset_private_t { int kqueue_fd; - struct kevent kevent; + struct kevent in_kevent; + struct kevent out_kevent; + apr_uint32_t setsize; struct kevent *ke_set; apr_pollfd_t *result_set; #if APR_HAS_THREADS @@ -88,10 +90,19 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, } #endif + /* POLLIN and POLLOUT are represented in different returned + * events, so we need 2 entries per descriptor in the result set, + * both for what is returned by kevent() and what is returned to + * the caller of apr_pollset_poll() (since it doesn't spend the + * CPU to coalesce separate APR_POLLIN and APR_POLLOUT events + * for the same descriptor) + */ + pollset->p->setsize = 2 * size; + pollset->p->ke_set = - (struct kevent *) apr_palloc(p, size * sizeof(struct kevent)); + (struct kevent *) apr_palloc(p, pollset->p->setsize * sizeof(struct kevent)); - memset(pollset->p->ke_set, 0, size * sizeof(struct kevent)); + memset(pollset->p->ke_set, 0, pollset->p->setsize * sizeof(struct kevent)); pollset->p->kqueue_fd = kqueue(); @@ -110,7 +121,7 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, return errno; } - pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + pollset->p->result_set = apr_palloc(p, pollset->p->setsize * sizeof(apr_pollfd_t)); APR_RING_INIT(&pollset->p->query_ring, pfd_elem_t, link); APR_RING_INIT(&pollset->p->free_ring, pfd_elem_t, link); @@ -146,18 +157,18 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, } if (descriptor->reqevents & APR_POLLIN) { - EV_SET(&pollset->p->kevent, fd, EVFILT_READ, EV_ADD, 0, 0, elem); + EV_SET(&pollset->p->in_kevent, fd, EVFILT_READ, EV_ADD, 0, 0, elem); - if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->in_kevent, 1, NULL, 0, NULL) == -1) { rv = apr_get_netos_error(); } } if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) { - EV_SET(&pollset->p->kevent, fd, EVFILT_WRITE, EV_ADD, 0, 0, elem); + EV_SET(&pollset->p->out_kevent, fd, EVFILT_WRITE, EV_ADD, 0, 0, elem); - if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->out_kevent, 1, NULL, 0, NULL) == -1) { rv = apr_get_netos_error(); } @@ -193,18 +204,18 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, } if (descriptor->reqevents & APR_POLLIN) { - EV_SET(&pollset->p->kevent, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); + EV_SET(&pollset->p->in_kevent, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); - if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->in_kevent, 1, NULL, 0, NULL) == -1) { rv = APR_NOTFOUND; } } if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) { - EV_SET(&pollset->p->kevent, fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); + EV_SET(&pollset->p->out_kevent, fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); - if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->out_kevent, 1, NULL, 0, NULL) == -1) { rv = APR_NOTFOUND; } @@ -250,7 +261,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, } ret = kevent(pollset->p->kqueue_fd, NULL, 0, pollset->p->ke_set, - pollset->nalloc, tvptr); + pollset->p->setsize, tvptr); (*num) = ret; if (ret < 0) { rv = apr_get_netos_error(); @@ -337,7 +348,7 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, } pollcb->fd = fd; - pollcb->pollset.ke = (struct kevent *)apr_pcalloc(p, size * sizeof(struct kevent)); + pollcb->pollset.ke = (struct kevent *)apr_pcalloc(p, 2 * size * sizeof(struct kevent)); apr_pool_cleanup_register(p, pollcb, cb_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; @@ -431,7 +442,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, tvptr = &tv; } - ret = kevent(pollcb->fd, NULL, 0, pollcb->pollset.ke, pollcb->nalloc, + ret = kevent(pollcb->fd, NULL, 0, pollcb->pollset.ke, 2 * pollcb->nalloc, tvptr); if (ret < 0) { From 857f67fcc35c4850872cb8660e24c8eef50df82e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 1 Mar 2009 02:57:09 +0000 Subject: [PATCH 6322/7878] revert a non-critical part of 748951: the needless use of separate temporary kevent structures for POLLIN vs. POLLOUT git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748953 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/kqueue.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index e0bd37d351a..767880e7eb7 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -44,8 +44,7 @@ static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags) struct apr_pollset_private_t { int kqueue_fd; - struct kevent in_kevent; - struct kevent out_kevent; + struct kevent kevent; apr_uint32_t setsize; struct kevent *ke_set; apr_pollfd_t *result_set; @@ -157,18 +156,18 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, } if (descriptor->reqevents & APR_POLLIN) { - EV_SET(&pollset->p->in_kevent, fd, EVFILT_READ, EV_ADD, 0, 0, elem); + EV_SET(&pollset->p->kevent, fd, EVFILT_READ, EV_ADD, 0, 0, elem); - if (kevent(pollset->p->kqueue_fd, &pollset->p->in_kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, NULL) == -1) { rv = apr_get_netos_error(); } } if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) { - EV_SET(&pollset->p->out_kevent, fd, EVFILT_WRITE, EV_ADD, 0, 0, elem); + EV_SET(&pollset->p->kevent, fd, EVFILT_WRITE, EV_ADD, 0, 0, elem); - if (kevent(pollset->p->kqueue_fd, &pollset->p->out_kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, NULL) == -1) { rv = apr_get_netos_error(); } @@ -204,18 +203,18 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, } if (descriptor->reqevents & APR_POLLIN) { - EV_SET(&pollset->p->in_kevent, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); + EV_SET(&pollset->p->kevent, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); - if (kevent(pollset->p->kqueue_fd, &pollset->p->in_kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, NULL) == -1) { rv = APR_NOTFOUND; } } if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) { - EV_SET(&pollset->p->out_kevent, fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); + EV_SET(&pollset->p->kevent, fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); - if (kevent(pollset->p->kqueue_fd, &pollset->p->out_kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, NULL) == -1) { rv = APR_NOTFOUND; } From 1dc85065c0b598b0157a166e5743734aa27191a5 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Sun, 1 Mar 2009 09:24:36 +0000 Subject: [PATCH 6323/7878] Document CLOEXEC patch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748988 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 9bf9141bc52..6e53285c55b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,12 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Set CLOEXEC flags where appropriate. Either use new O_CLOEXEC flag and + associated functions, such as dup3(), accept4(), epoll_create1() etc., + or simply set CLOEXEC flag using fcntl(). + [Stefan Fritsch , + Arkadiusz Miskiewicz ] PR 46425. + *) Added Unix domain socket support. [Mladen Turk] From c7ae1a9b53d69cea71c75c7082e262a8ee7c2152 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 1 Mar 2009 12:10:34 +0000 Subject: [PATCH 6324/7878] Don't return failure or fail to clean up the event queue if the caller overspecifies the conditions (e.g., APR_POLLIN|APR_POLLOUT when checking only for APR_POLLOUT). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@749008 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/kqueue.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 767880e7eb7..51c8d1dd277 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -190,7 +190,7 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { pfd_elem_t *ep; - apr_status_t rv = APR_SUCCESS; + apr_status_t rv; apr_os_sock_t fd; pollset_lock_rings(); @@ -202,21 +202,22 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, fd = descriptor->desc.f->filedes; } + rv = APR_NOTFOUND; /* unless at least one of the specified conditions is */ if (descriptor->reqevents & APR_POLLIN) { EV_SET(&pollset->p->kevent, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, - NULL) == -1) { - rv = APR_NOTFOUND; + NULL) != -1) { + rv = APR_SUCCESS; } } - if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) { + if (descriptor->reqevents & APR_POLLOUT) { EV_SET(&pollset->p->kevent, fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, - NULL) == -1) { - rv = APR_NOTFOUND; + NULL) != -1) { + rv = APR_SUCCESS; } } @@ -389,7 +390,7 @@ static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb, static apr_status_t impl_pollcb_remove(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor) { - apr_status_t rv = APR_SUCCESS; + apr_status_t rv; struct kevent ev; apr_os_sock_t fd; @@ -399,23 +400,21 @@ static apr_status_t impl_pollcb_remove(apr_pollcb_t *pollcb, else { fd = descriptor->desc.f->filedes; } - + + rv = APR_NOTFOUND; /* unless at least one of the specified conditions is */ if (descriptor->reqevents & APR_POLLIN) { EV_SET(&ev, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); - if (kevent(pollcb->fd, &ev, 1, NULL, 0, NULL) == -1) { - rv = APR_NOTFOUND; + if (kevent(pollcb->fd, &ev, 1, NULL, 0, NULL) != -1) { + rv = APR_SUCCESS; } } - if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) { - /* XXXX: this is less than optimal, shouldn't we still try to - * remove the FD even if it wasn't in the readset? - */ + if (descriptor->reqevents & APR_POLLOUT) { EV_SET(&ev, fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); - if (kevent(pollcb->fd, &ev, 1, NULL, 0, NULL) == -1) { - rv = APR_NOTFOUND; + if (kevent(pollcb->fd, &ev, 1, NULL, 0, NULL) != -1) { + rv = APR_SUCCESS; } } From bd5d00e9d9ecbcd1ba678cda75683ed6ad3dd0f4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 1 Mar 2009 12:29:27 +0000 Subject: [PATCH 6325/7878] Note that apr_pollset_remove() must be instructed to remove all previously- requested events for the descriptor. (Users of the kqueue implementation may observe otherwise ... and regret it later.) Try to get the pollcb documentation caught up on such notes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@749013 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index c0f4025f6b5..9521eee923f 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -223,6 +223,9 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, * with APR_EINTR. Option (1) is recommended, but option (2) is * allowed for implementations where option (1) is impossible * or impractical. + * @remark apr_pollset_remove() cannot be used to remove a subset of requested + * events for a descriptor. The reqevents field in the apr_pollfd_t + * parameter must contain the same value when removing as when adding. */ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, const apr_pollfd_t *descriptor); @@ -318,7 +321,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, * method cannot be used, the default method will be used unless the * APR_POLLSET_NODEFAULT flag has been specified. * - * @remark Pollcb is only supported on some platforms; the apr_pollcb_create() + * @remark Pollcb is only supported on some platforms; the apr_pollcb_create_ex() * call will fail with APR_ENOTIMPL on platforms where it is not supported. */ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, @@ -337,6 +340,12 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, * @remark Unlike the apr_pollset API, the descriptor is not copied, and users * must retain the memory used by descriptor, as the same pointer will * be returned to them from apr_pollcb_poll. + * @remark Do not add the same socket or file descriptor to the same pollcb + * multiple times, even if the requested events differ for the + * different calls to apr_pollcb_add(). If the events of interest + * for a descriptor change, you must first remove the descriptor + * from the pollcb with apr_pollcb_remove(), then add it again + * specifying all requested events. */ APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor); @@ -344,6 +353,9 @@ APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, * Remove a descriptor from a pollcb * @param pollcb The pollcb from which to remove the descriptor * @param descriptor The descriptor to remove + * @remark apr_pollcb_remove() cannot be used to remove a subset of requested + * events for a descriptor. The reqevents field in the apr_pollfd_t + * parameter must contain the same value when removing as when adding. */ APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor); @@ -366,6 +378,9 @@ typedef apr_status_t (*apr_pollcb_cb_t)(void *baton, apr_pollfd_t *descriptor); * signalled. * @param func Callback function to call for each active descriptor. * @param baton Opaque baton passed to the callback function. + * @remark Multiple signalled conditions for the same descriptor may be reported + * in one or more calls to the callback function, depending on the + * implementation. */ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, apr_interval_time_t timeout, From 911d15f5e17701a94970e64e3f6568bf1fc62832 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 1 Mar 2009 12:55:13 +0000 Subject: [PATCH 6326/7878] EV_ERROR doesn't map to APR_POLLERR It might map to APR_POLLNVAL when used in conjunction with other information returned by kevent(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@749021 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/kqueue.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 51c8d1dd277..8f785c38656 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -35,9 +35,11 @@ static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags) rv |= APR_POLLOUT; if (flags & EV_EOF) rv |= APR_POLLHUP; - if (flags & EV_ERROR) - rv |= APR_POLLERR; - + /* APR_POLLPRI, APR_POLLERR, and APR_POLLNVAL are not handled by this + * implementation. + * TODO: See if EV_ERROR + certain system errors in the returned data field + * should map to APR_POLLNVAL. + */ return rv; } From 0327600823cb44d1b0ce2c253b57bb29f635acab Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 1 Mar 2009 12:58:02 +0000 Subject: [PATCH 6327/7878] Don't give the caller the list of returned events unless some event besides the wakeup pipe occurred. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@749023 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/kqueue.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 8f785c38656..fa91b61e0b7 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -288,10 +288,11 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, j++; } } - if ((*num = j)) + if ((*num = j)) { /* any event besides wakeup pipe? */ rv = APR_SUCCESS; - if (descriptors) { - *descriptors = pollset->p->result_set; + if (descriptors) { + *descriptors = pollset->p->result_set; + } } } From 5f4fdbf5086aaef783f6ea86a5a308e917cd7908 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 1 Mar 2009 13:05:32 +0000 Subject: [PATCH 6328/7878] get_kqueue_revent(): tweak the code ever so slightly to highlight a critical kqueue() characteristic: POLLIN and POLLOUT won't be reflected in a single returned event impl_pollset_remove(): axe a redundant invocation of APR_RING_EMPTY() other: trivial tweaks for consistency or readability git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@749025 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/kqueue.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index fa91b61e0b7..72be031f309 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -31,7 +31,7 @@ static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags) if (event == EVFILT_READ) rv |= APR_POLLIN; - if (event == EVFILT_WRITE) + else if (event == EVFILT_WRITE) rv |= APR_POLLOUT; if (flags & EV_EOF) rv |= APR_POLLHUP; @@ -74,7 +74,7 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, apr_pool_t *p, apr_uint32_t flags) { - apr_status_t rv = APR_SUCCESS; + apr_status_t rv; pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t)); #if APR_HAS_THREADS if (flags & APR_POLLSET_THREADSAFE && @@ -108,6 +108,7 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, pollset->p->kqueue_fd = kqueue(); if (pollset->p->kqueue_fd == -1) { + pollset->p = NULL; return apr_get_netos_error(); } @@ -128,7 +129,7 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, APR_RING_INIT(&pollset->p->free_ring, pfd_elem_t, link); APR_RING_INIT(&pollset->p->dead_ring, pfd_elem_t, link); - return rv; + return APR_SUCCESS; } static apr_status_t impl_pollset_add(apr_pollset_t *pollset, @@ -223,18 +224,16 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, } } - if (!APR_RING_EMPTY(&(pollset->p->query_ring), pfd_elem_t, link)) { - for (ep = APR_RING_FIRST(&(pollset->p->query_ring)); - ep != APR_RING_SENTINEL(&(pollset->p->query_ring), - pfd_elem_t, link); - ep = APR_RING_NEXT(ep, link)) { + for (ep = APR_RING_FIRST(&(pollset->p->query_ring)); + ep != APR_RING_SENTINEL(&(pollset->p->query_ring), + pfd_elem_t, link); + ep = APR_RING_NEXT(ep, link)) { - if (descriptor->desc.s == ep->pfd.desc.s) { - APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), - ep, pfd_elem_t, link); - break; - } + if (descriptor->desc.s == ep->pfd.desc.s) { + APR_RING_REMOVE(ep, link); + APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), + ep, pfd_elem_t, link); + break; } } @@ -299,7 +298,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); - /* Shift all PFDs in the Dead Ring to be Free Ring */ + /* Shift all PFDs in the Dead Ring to the Free Ring */ APR_RING_CONCAT(&(pollset->p->free_ring), &(pollset->p->dead_ring), pfd_elem_t, link); @@ -326,7 +325,6 @@ static apr_status_t cb_cleanup(void *b_) return APR_SUCCESS; } - static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, apr_uint32_t size, apr_pool_t *p, From 0023e7502105226b97a817e9be1a95cc5e445b1b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 1 Mar 2009 13:11:10 +0000 Subject: [PATCH 6329/7878] reformat recent CHANGES entries git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@749030 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/CHANGES b/CHANGES index 6e53285c55b..df1781540d5 100644 --- a/CHANGES +++ b/CHANGES @@ -3,26 +3,21 @@ Changes for APR 2.0.0 *) Set CLOEXEC flags where appropriate. Either use new O_CLOEXEC flag and associated functions, such as dup3(), accept4(), epoll_create1() etc., - or simply set CLOEXEC flag using fcntl(). - [Stefan Fritsch , - Arkadiusz Miskiewicz ] PR 46425. + or simply set CLOEXEC flag using fcntl(). PR 46425. [Stefan Fritsch + , Arkadiusz Miskiewicz ] - *) Added Unix domain socket support. - [Mladen Turk] + *) Added Unix domain socket support. [Mladen Turk] - *) Win32: Use WSAPoll as default pollset method if supported and - found inside winsock dll. - [Mladen Turk] + *) Win32: Use WSAPoll as default pollset method if supported and found + inside winsock dll. [Mladen Turk] *) Make apr_pollset and apr_pollcb implementations using providers. Added apr_pollset_create_ex and apr_pollcb_create_ex that allows - choosing non-default providers. - [Mladen Turk] + choosing non-default providers. [Mladen Turk] - *) Introduce APR_PERMS_SET macros for setting the owner/group on - objects. Currently only implemented for shm, proc and global - mutexes on posix platforms. - [Mladen Turk] + *) Introduce APR_PERMS_SET macros for setting the owner/group on objects + Currently only implemented for shm, proc and global mutexes on posix + platforms. [Mladen Turk] Changes for APR 1.4.0 From fac1bc54b263c119c077d7b869e375fb72cc4a99 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 1 Mar 2009 15:45:56 +0000 Subject: [PATCH 6330/7878] commentary, consistency, simplification, and minor fixes impl_pollset_create(): . return the actual port_create() failure instead of APR_ENOMEM impl_pollset_add(): . return the actual port_associate() failure instead of APR_ENOMEM impl_pollset_poll(): . catch port_associate() failures . don't report returned events to caller unless something popped besides the wakeup pipe impl_pollcb_poll(): . fix incorrect mapping of EINTR onto APR_TIMEUP . don't hide interesting error codes behind APR_EGENERAL generally: . axe redundant APR_RING_EMPTY() invocations . don't check for EINTR explicitly, as it is handled appropriately by the apr_get_netos_error() invocation (IOW, EINTR == APR_EINTR here) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@749049 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 98 ++++++++++++++++++++++++++---------------------- 1 file changed, 54 insertions(+), 44 deletions(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index c772355d122..27c99f2072d 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -36,6 +36,9 @@ static apr_int16_t get_event(apr_int16_t event) rv |= POLLPRI; if (event & APR_POLLOUT) rv |= POLLOUT; + /* TODO: Confirm that the set of return-only events is the same as with + * poll(), and axe these checks: + */ if (event & APR_POLLERR) rv |= POLLERR; if (event & APR_POLLHUP) @@ -78,6 +81,9 @@ struct apr_pollset_private_t #endif /* A ring containing all of the pollfd_t that are active */ APR_RING_HEAD(pfd_query_ring_t, pfd_elem_t) query_ring; + /* A ring containing the pollfd_t that will be added on the + * next call to apr_pollset_poll(). + */ APR_RING_HEAD(pfd_add_ring_t, pfd_elem_t) add_ring; /* A ring of pollfd_t that have been used, and then _remove'd */ APR_RING_HEAD(pfd_free_ring_t, pfd_elem_t) free_ring; @@ -123,7 +129,7 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, if (pollset->p->port_fd < 0) { pollset->p = NULL; - return APR_ENOMEM; + return apr_get_netos_error(); } { @@ -174,12 +180,15 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, fd = descriptor->desc.f->filedes; } + /* If another thread is polling, notify the kernel immediately; otherwise, + * wait until the next call to apr_pollset_poll(). + */ if (apr_atomic_read32(&pollset->p->waiting)) { res = port_associate(pollset->p->port_fd, PORT_SOURCE_FD, fd, get_event(descriptor->reqevents), (void *)elem); if (res < 0) { - rv = APR_ENOMEM; + rv = apr_get_netos_error(); APR_RING_INSERT_TAIL(&(pollset->p->free_ring), elem, pfd_elem_t, link); } else { @@ -222,39 +231,35 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, rv = APR_NOTFOUND; } - if (!APR_RING_EMPTY(&(pollset->p->query_ring), pfd_elem_t, link)) { - for (ep = APR_RING_FIRST(&(pollset->p->query_ring)); - ep != APR_RING_SENTINEL(&(pollset->p->query_ring), - pfd_elem_t, link); - ep = APR_RING_NEXT(ep, link)) { - - if (descriptor->desc.s == ep->pfd.desc.s) { - APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), - ep, pfd_elem_t, link); - if (ENOENT == err) { - rv = APR_SUCCESS; - } - break; + for (ep = APR_RING_FIRST(&(pollset->p->query_ring)); + ep != APR_RING_SENTINEL(&(pollset->p->query_ring), + pfd_elem_t, link); + ep = APR_RING_NEXT(ep, link)) { + + if (descriptor->desc.s == ep->pfd.desc.s) { + APR_RING_REMOVE(ep, link); + APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), + ep, pfd_elem_t, link); + if (ENOENT == err) { + rv = APR_SUCCESS; } + break; } } - if (!APR_RING_EMPTY(&(pollset->p->add_ring), pfd_elem_t, link)) { - for (ep = APR_RING_FIRST(&(pollset->p->add_ring)); - ep != APR_RING_SENTINEL(&(pollset->p->add_ring), - pfd_elem_t, link); - ep = APR_RING_NEXT(ep, link)) { - - if (descriptor->desc.s == ep->pfd.desc.s) { - APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), - ep, pfd_elem_t, link); - if (ENOENT == err) { - rv = APR_SUCCESS; - } - break; + for (ep = APR_RING_FIRST(&(pollset->p->add_ring)); + ep != APR_RING_SENTINEL(&(pollset->p->add_ring), + pfd_elem_t, link); + ep = APR_RING_NEXT(ep, link)) { + + if (descriptor->desc.s == ep->pfd.desc.s) { + APR_RING_REMOVE(ep, link); + APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), + ep, pfd_elem_t, link); + if (ENOENT == err) { + rv = APR_SUCCESS; } + break; } } @@ -302,15 +307,23 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, fd = ep->pfd.desc.f->filedes; } - port_associate(pollset->p->port_fd, PORT_SOURCE_FD, - fd, get_event(ep->pfd.reqevents), ep); + ret = port_associate(pollset->p->port_fd, PORT_SOURCE_FD, + fd, get_event(ep->pfd.reqevents), ep); + if (ret < 0) { + rv = apr_get_netos_error(); + break; + } APR_RING_INSERT_TAIL(&(pollset->p->query_ring), ep, pfd_elem_t, link); - } pollset_unlock_rings(); + if (rv != APR_SUCCESS) { + apr_atomic_dec32(&pollset->p->waiting); + return rv; + } + ret = port_getn(pollset->p->port_fd, pollset->p->port_set, pollset->nalloc, &nget, tvptr); @@ -321,10 +334,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, if (ret == -1) { (*num) = 0; - if (errno == EINTR) { - rv = APR_EINTR; - } - else if (errno == ETIME) { + if (errno == ETIME) { rv = APR_TIMEUP; } else { @@ -360,17 +370,17 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, } } pollset_unlock_rings(); - if ((*num = j)) + if ((*num = j)) { /* any event besides wakeup pipe? */ rv = APR_SUCCESS; - if (descriptors) { - *descriptors = pollset->p->result_set; + if (descriptors) { + *descriptors = pollset->p->result_set; + } } } - pollset_lock_rings(); - /* Shift all PFDs in the Dead Ring to be Free Ring */ + /* Shift all PFDs in the Dead Ring to the Free Ring */ APR_RING_CONCAT(&(pollset->p->free_ring), &(pollset->p->dead_ring), pfd_elem_t, link); pollset_unlock_rings(); @@ -491,11 +501,11 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, &nget, tvptr); if (ret == -1) { - if (errno == ETIME || errno == EINTR) { + if (errno == ETIME) { rv = APR_TIMEUP; } else { - rv = APR_EGENERAL; + rv = apr_get_netos_error(); } } else if (nget == 0) { From 29d79f2bef34ad7882d7be60c3a637fbde2bf801 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 3 Mar 2009 00:29:22 +0000 Subject: [PATCH 6331/7878] pollset tweaks: axe logic to set ignored conditions in the poll request structures (these conditions are return-only and are always reported when they occur) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@749490 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 6 +----- poll/unix/poll.c | 7 +------ poll/unix/port.c | 10 +--------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 71a1b3087e1..706d52ebfbc 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -35,11 +35,7 @@ static apr_int16_t get_epoll_event(apr_int16_t event) rv |= EPOLLPRI; if (event & APR_POLLOUT) rv |= EPOLLOUT; - if (event & APR_POLLERR) - rv |= EPOLLERR; - if (event & APR_POLLHUP) - rv |= EPOLLHUP; - /* APR_POLLNVAL is not handled by epoll. */ + /* APR_POLLNVAL is not handled by epoll. EPOLLERR and EPOLLHUP are return-only */ return rv; } diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 7869d62eeb1..c665948abf6 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -39,12 +39,7 @@ static apr_int16_t get_event(apr_int16_t event) rv |= POLLPRI; if (event & APR_POLLOUT) rv |= POLLOUT; - if (event & APR_POLLERR) - rv |= POLLERR; - if (event & APR_POLLHUP) - rv |= POLLHUP; - if (event & APR_POLLNVAL) - rv |= POLLNVAL; + /* POLLERR, POLLHUP, and POLLNVAL aren't valid as requested events */ return rv; } diff --git a/poll/unix/port.c b/poll/unix/port.c index 27c99f2072d..b1fe4aaa9d4 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -36,15 +36,7 @@ static apr_int16_t get_event(apr_int16_t event) rv |= POLLPRI; if (event & APR_POLLOUT) rv |= POLLOUT; - /* TODO: Confirm that the set of return-only events is the same as with - * poll(), and axe these checks: - */ - if (event & APR_POLLERR) - rv |= POLLERR; - if (event & APR_POLLHUP) - rv |= POLLHUP; - if (event & APR_POLLNVAL) - rv |= POLLNVAL; + /* POLLERR, POLLHUP, and POLLNVAL aren't valid as requested events */ return rv; } From c36c030bd98a459073099dd67b55c297cb4e77b2 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Tue, 3 Mar 2009 22:42:54 +0000 Subject: [PATCH 6332/7878] Only set CLOEXEC on dup() if both NOCLEANUP and INHERIT flags are clear. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@749810 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 56d6ab0868f..d40004faea7 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -35,12 +35,12 @@ static apr_status_t file_dup(apr_file_t **new_file, return APR_EINVAL; } #ifdef HAVE_DUP3 - if (!(old_file->flags & APR_INHERIT)) + if (!(old_file->flags & (APR_FILE_NOCLEANUP|APR_INHERIT))) flags |= O_CLOEXEC; rv = dup3(old_file->filedes, (*new_file)->filedes, flags); #else rv = dup2(old_file->filedes, (*new_file)->filedes); - if (!(old_file->flags & APR_INHERIT)) { + if (!(old_file->flags & (APR_FILE_NOCLEANUP|APR_INHERIT))) { int flags; if (rv == -1) From 8b118d87546dd23dfc6658a705b596e7902e2fb2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 5 Mar 2009 01:36:34 +0000 Subject: [PATCH 6333/7878] when removing a pollfd, don't search both the add ring and the query ring; it can be on only one of them reverse the search order of the two lists, so that we search the (often) shorter/more likelier list first git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@750277 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index b1fe4aaa9d4..d7cf5f602f8 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -206,6 +206,7 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, apr_status_t rv = APR_SUCCESS; int res; int err = 0; + int found; pollset_lock_rings(); @@ -223,12 +224,21 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, rv = APR_NOTFOUND; } - for (ep = APR_RING_FIRST(&(pollset->p->query_ring)); - ep != APR_RING_SENTINEL(&(pollset->p->query_ring), + /* Search the add ring first. This ring is often shorter, + * and it often contains the descriptor being removed. + * (For the common scenario where apr_pollset_poll() + * returns activity for the descriptor and the descriptor + * is then removed from the pollset, it will have just + * been moved to the add ring by apr_pollset_poll().) + */ + found = 0; + for (ep = APR_RING_FIRST(&(pollset->p->add_ring)); + ep != APR_RING_SENTINEL(&(pollset->p->add_ring), pfd_elem_t, link); ep = APR_RING_NEXT(ep, link)) { if (descriptor->desc.s == ep->pfd.desc.s) { + found = 1; APR_RING_REMOVE(ep, link); APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), ep, pfd_elem_t, link); @@ -239,19 +249,21 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, } } - for (ep = APR_RING_FIRST(&(pollset->p->add_ring)); - ep != APR_RING_SENTINEL(&(pollset->p->add_ring), - pfd_elem_t, link); - ep = APR_RING_NEXT(ep, link)) { - - if (descriptor->desc.s == ep->pfd.desc.s) { - APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), - ep, pfd_elem_t, link); - if (ENOENT == err) { - rv = APR_SUCCESS; + if (!found) { + for (ep = APR_RING_FIRST(&(pollset->p->query_ring)); + ep != APR_RING_SENTINEL(&(pollset->p->query_ring), + pfd_elem_t, link); + ep = APR_RING_NEXT(ep, link)) { + + if (descriptor->desc.s == ep->pfd.desc.s) { + APR_RING_REMOVE(ep, link); + APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), + ep, pfd_elem_t, link); + if (ENOENT == err) { + rv = APR_SUCCESS; + } + break; } - break; } } From 4f211626ee9f9e6ff3eac25054a0205c8ee043c3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 5 Mar 2009 01:44:27 +0000 Subject: [PATCH 6334/7878] don't lose track of a ring element when port_associate() fails git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@750279 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 1 + 1 file changed, 1 insertion(+) diff --git a/poll/unix/port.c b/poll/unix/port.c index d7cf5f602f8..eef09828b24 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -315,6 +315,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, fd, get_event(ep->pfd.reqevents), ep); if (ret < 0) { rv = apr_get_netos_error(); + APR_RING_INSERT_TAIL(&(pollset->p->free_ring), ep, pfd_elem_t, link); break; } From 109208c20dcc79eb13a7770304d191acc5391840 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 6 Mar 2009 00:35:29 +0000 Subject: [PATCH 6335/7878] elements on the add ring are not currently associated, so only call port_dissociate (sic) if it isn't on the add ring when we remove an element from the add ring, we can release it immediately to the free ring (elements removed from the query ring are the ones that have to be placed on the dead ring temporarily) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@750708 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index eef09828b24..2b9002882e8 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -217,19 +217,15 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, fd = descriptor->desc.f->filedes; } - res = port_dissociate(pollset->p->port_fd, PORT_SOURCE_FD, fd); - - if (res < 0) { - err = errno; - rv = APR_NOTFOUND; - } - /* Search the add ring first. This ring is often shorter, * and it often contains the descriptor being removed. * (For the common scenario where apr_pollset_poll() * returns activity for the descriptor and the descriptor * is then removed from the pollset, it will have just * been moved to the add ring by apr_pollset_poll().) + * + * If it is on the add ring, it isn't associated with the + * event port yet/anymore. */ found = 0; for (ep = APR_RING_FIRST(&(pollset->p->add_ring)); @@ -240,16 +236,20 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, if (descriptor->desc.s == ep->pfd.desc.s) { found = 1; APR_RING_REMOVE(ep, link); - APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), + APR_RING_INSERT_TAIL(&(pollset->p->free_ring), ep, pfd_elem_t, link); - if (ENOENT == err) { - rv = APR_SUCCESS; - } break; } } if (!found) { + res = port_dissociate(pollset->p->port_fd, PORT_SOURCE_FD, fd); + + if (res < 0) { + err = errno; + rv = APR_NOTFOUND; + } + for (ep = APR_RING_FIRST(&(pollset->p->query_ring)); ep != APR_RING_SENTINEL(&(pollset->p->query_ring), pfd_elem_t, link); From fc321834af268a54c8a7316ca78bb8d54397411b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 6 Mar 2009 01:38:58 +0000 Subject: [PATCH 6336/7878] fix a race condition between pollset_poll and pollset_remove T1: port_getn called from pollset_poll T2: pollset_remove called for fd X T2: obtains ring lock T1: port_getn returns event for fd X, kernel disassociates from port T1: blocks on ring lock T2: moves ring element for fd X from query ring to dead ring T2: releases ring lock T1: obtains ring lock T1: moves ring element for fd X to add ring, assuming still on query ring git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@750744 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_poll_private.h | 3 +++ poll/unix/port.c | 27 ++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index db43127412b..a26730490cf 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -97,6 +97,9 @@ typedef struct pfd_elem_t pfd_elem_t; struct pfd_elem_t { APR_RING_ENTRY(pfd_elem_t) link; apr_pollfd_t pfd; +#ifdef HAVE_PORT_CREATE + int on_query_ring; +#endif }; #endif diff --git a/poll/unix/port.c b/poll/unix/port.c index 2b9002882e8..7470d89a93c 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -162,6 +162,7 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, else { elem = (pfd_elem_t *) apr_palloc(pollset->pool, sizeof(pfd_elem_t)); APR_RING_ELEM_INIT(elem, link); + elem->on_query_ring = 0; } elem->pfd = *descriptor; @@ -185,6 +186,7 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, } else { pollset->nelts++; + elem->on_query_ring = 1; APR_RING_INSERT_TAIL(&(pollset->p->query_ring), elem, pfd_elem_t, link); } } @@ -246,6 +248,12 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, res = port_dissociate(pollset->p->port_fd, PORT_SOURCE_FD, fd); if (res < 0) { + /* The expected case for this failure is that another + * thread's call to port_getn() returned this fd and + * disassociated the fd from the event port, and + * impl_pollset_poll() is blocked on the ring lock, + * which this thread holds. + */ err = errno; rv = APR_NOTFOUND; } @@ -257,6 +265,7 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, if (descriptor->desc.s == ep->pfd.desc.s) { APR_RING_REMOVE(ep, link); + ep->on_query_ring = 0; APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), ep, pfd_elem_t, link); if (ENOENT == err) { @@ -319,6 +328,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, break; } + ep->on_query_ring = 1; APR_RING_INSERT_TAIL(&(pollset->p->query_ring), ep, pfd_elem_t, link); } @@ -366,11 +376,18 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, pollset->p->result_set[j].rtnevents = get_revent(pollset->p->port_set[i].portev_events); - APR_RING_REMOVE((pfd_elem_t*)pollset->p->port_set[i].portev_user, - link); - APR_RING_INSERT_TAIL(&(pollset->p->add_ring), - (pfd_elem_t*)pollset->p->port_set[i].portev_user, - pfd_elem_t, link); + /* If the ring element is still on the query ring, move it + * to the add ring for re-association with the event port + * later. (It may have already been moved to the dead ring + * by a call to pollset_remove on another thread.) + */ + ep = (pfd_elem_t *)pollset->p->port_set[i].portev_user; + if (ep->on_query_ring) { + APR_RING_REMOVE(ep, link); + ep->on_query_ring = 0; + APR_RING_INSERT_TAIL(&(pollset->p->add_ring), ep, + pfd_elem_t, link); + } j++; } } From 71202e7bd2d2397b7f4c4e64a3cc280bef4e1f71 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Fri, 6 Mar 2009 22:18:32 +0000 Subject: [PATCH 6337/7878] * The " causes the result to be double " which causes errors in the final configure scripts. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@751107 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 88f64a7e315..7929d4cfb5c 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -81,7 +81,7 @@ AC_DEFUN([APR_FIND_APR], [ ifelse([$4], [], [ ifdef(AC_WARNING,AC_WARNING([$0: missing argument 4 (acceptable-majors): Defaulting to APR 0.x then APR 1.x])) acceptable_majors="0 1"], - [acceptable_majors="$4"]) + [acceptable_majors=$4]) apr_temp_acceptable_apr_config="" for apr_temp_major in $acceptable_majors From d6d0043f67ffb6f69d8a97d96f66aaff7a510776 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 8 Mar 2009 21:08:22 +0000 Subject: [PATCH 6338/7878] Scons Updates. * Add detection of IPv6 * Fix return code checking of TryRun's... Scons expects 1 as success (meh) * Add ebcdic, nonblock inherited check, tcp_nodelay, union semun, TCP_CORK/TCP_NOPUSH, getrlimit/setrlimit, in_addr, sockaddr_storage, rlimit struct, ... and more * Add sctp check * Add accept filter check Submitted by: Ryan Phillips git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@751531 13f79535-47bb-0310-9956-ffa450edef68 --- SConstruct | 1 + build/aprconf.py | 225 ++++++++++++++++++++++++++++++++++++++++++++++- build/aprenv.py | 149 +++++++++++++++++++++++++++++-- 3 files changed, 362 insertions(+), 13 deletions(-) diff --git a/SConstruct b/SConstruct index 0f914ef5f2d..774d10188f4 100644 --- a/SConstruct +++ b/SConstruct @@ -10,6 +10,7 @@ vars = Variables('build.py') vars.Add('maintainer_mode', 'Turn on debugging and compile time warnings', 0) vars.Add('profile', 'Turn on profiling for the build (GCC)', 0) vars.Add('lfs', 'Large file support on 32-bit platforms', 1) +vars.Add('ipv6', 'IPv6 support', 1) vars.Add(EnumVariable('pool_debug', 'Turn on pools debugging', 'no', allowed_values=('yes', 'no', 'verbose', 'verbose-alloc', 'lifetime', 'owner', 'all'))) diff --git a/build/aprconf.py b/build/aprconf.py index 1c55f8eb66b..a66a6696d32 100644 --- a/build/aprconf.py +++ b/build/aprconf.py @@ -69,9 +69,119 @@ def Check_apr_atomic_builtins(self, context): return 0; } """ + result = context.TryRun(source, '.c') + context.Result(result[0] == 0) + return result[0] == 0 + + def Check_apr_ebcdic(self, context): + context.Message('Checking whether system uses EBCDIC.. ') + source = """ +int main(void) { + return (unsigned char)'A' != (unsigned char)0xC1; +}""" result = context.TryRun(source, '.c') context.Result(result[0]) return result[0] + + def Check_apr_nonblock_inherited(self, context): + context.Message('Checking whether O_NONBLOCK setting is inherited from listening sockets... ') + source = """ +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_TCP_H +#include +#endif +#ifndef HAVE_SOCKLEN_T +typedef int socklen_t; +#endif +#ifdef HAVE_FCNTL_H +#include +#endif +int main(void) { + int listen_s, connected_s, client_s; + int listen_port, rc; + struct sockaddr_in sa; + socklen_t sa_len; + + listen_s = socket(AF_INET, SOCK_STREAM, 0); + if (listen_s < 0) { + perror("socket"); + exit(1); + } + memset(&sa, 0, sizeof sa); + sa.sin_family = AF_INET; +#ifdef BEOS + sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); +#endif + /* leave port 0 to get ephemeral */ + rc = bind(listen_s, (struct sockaddr *)&sa, sizeof sa); + if (rc < 0) { + perror("bind for ephemeral port"); + exit(1); + } + /* find ephemeral port */ + sa_len = sizeof(sa); + rc = getsockname(listen_s, (struct sockaddr *)&sa, &sa_len); + if (rc < 0) { + perror("getsockname"); + exit(1); + } + listen_port = sa.sin_port; + rc = listen(listen_s, 5); + if (rc < 0) { + perror("listen"); + exit(1); + } + rc = fcntl(listen_s, F_SETFL, O_NONBLOCK); + if (rc < 0) { + perror("fcntl(F_SETFL)"); + exit(1); + } + client_s = socket(AF_INET, SOCK_STREAM, 0); + if (client_s < 0) { + perror("socket"); + exit(1); + } + memset(&sa, 0, sizeof sa); + sa.sin_family = AF_INET; + sa.sin_port = listen_port; +#ifdef BEOS + sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); +#endif + /* leave sin_addr all zeros to use loopback */ + rc = connect(client_s, (struct sockaddr *)&sa, sizeof sa); + if (rc < 0) { + perror("connect"); + exit(1); + } + sa_len = sizeof sa; + connected_s = accept(listen_s, (struct sockaddr *)&sa, &sa_len); + if (connected_s < 0) { + perror("accept"); + exit(1); + } + rc = fcntl(connected_s, F_GETFL, 0); + if (rc < 0) { + perror("fcntl(F_GETFL)"); + exit(1); + } + if (!(rc & O_NONBLOCK)) { + fprintf(stderr, "O_NONBLOCK is not set in the child.\n"); + exit(1); + } + return 0; +}""" + result = context.TryRun(source, '.c') + context.Result(result[0] == 0) + return result[0] == 0 def Check_apr_largefile64(self, context): context.Message('Checking whether to enable -D_LARGEFILE64_SOURCE... ') @@ -112,8 +222,8 @@ def Check_apr_largefile64(self, context): }""" result = context.TryRun(source, '.c') self.env.Filter(CPPFLAGS = ['-D_LARGEFILE64_SOURCE']) - context.Result(result[0]) - return result[0] + context.Result(result[0] == 0) + return result[0] == 0 def Check_apr_mmap_mapping_dev_zero(self, context): @@ -142,8 +252,8 @@ def Check_apr_mmap_mapping_dev_zero(self, context): } """ result = context.TryRun(source, '.c') - context.Result(result[0]) - return result[0] + context.Result(result[0] == 0) + return result[0] == 0 def Check_apr_semaphores(self, context): context.Message('Checking for sem_open, sem_close, sem_unlink... ') @@ -178,6 +288,113 @@ def Check_apr_semaphores(self, context): context.Result(result) return result + def Check_apr_check_tcp_nodelay_inherited(self, context): + context.Message('Checking for tcp nodelay inherited... ') + source = """ +#include +#include +#include +#include +#include +int main(void) { + int listen_s, connected_s, client_s; + int listen_port, rc; + struct sockaddr_in sa; + socklen_t sa_len; + socklen_t option_len; + int option; + + listen_s = socket(AF_INET, SOCK_STREAM, 0); + if (listen_s < 0) { + perror("socket"); + exit(1); + } + option = 1; + rc = setsockopt(listen_s, IPPROTO_TCP, TCP_NODELAY, &option, sizeof option); + if (rc < 0) { + perror("setsockopt TCP_NODELAY"); + exit(1); + } + memset(&sa, 0, sizeof sa); + sa.sin_family = AF_INET; +#ifdef BEOS + sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); +#endif + /* leave port 0 to get ephemeral */ + rc = bind(listen_s, (struct sockaddr *)&sa, sizeof sa); + if (rc < 0) { + perror("bind for ephemeral port"); + exit(1); + } + /* find ephemeral port */ + sa_len = sizeof(sa); + rc = getsockname(listen_s, (struct sockaddr *)&sa, &sa_len); + if (rc < 0) { + perror("getsockname"); + exit(1); + } + listen_port = sa.sin_port; + rc = listen(listen_s, 5); + if (rc < 0) { + perror("listen"); + exit(1); + } + client_s = socket(AF_INET, SOCK_STREAM, 0); + if (client_s < 0) { + perror("socket"); + exit(1); + } + memset(&sa, 0, sizeof sa); + sa.sin_family = AF_INET; + sa.sin_port = listen_port; +#ifdef BEOS + sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); +#endif + /* leave sin_addr all zeros to use loopback */ + rc = connect(client_s, (struct sockaddr *)&sa, sizeof sa); + if (rc < 0) { + perror("connect"); + exit(1); + } + sa_len = sizeof sa; + connected_s = accept(listen_s, (struct sockaddr *)&sa, &sa_len); + if (connected_s < 0) { + perror("accept"); + exit(1); + } + option_len = sizeof option; + rc = getsockopt(connected_s, IPPROTO_TCP, TCP_NODELAY, &option, &option_len); + if (rc < 0) { + perror("getsockopt"); + exit(1); + } + if (!option) { + fprintf(stderr, "TCP_NODELAY is not set in the child.\n"); + exit(1); + } + return 0; +} """ + result = context.TryRun(source, '.c') + context.Result(result[0] == 0) + return result[0] == 0 + + def Check_apr_semun(self, context): + context.Message('Checking for semun... ') + source = """ +#include +#include +#include +main() +{ + union semun arg; + semctl(0, 0, 0, arg); + exit(0); +} + """ + result = context.TryCompile(source, '.c') + context.Result(result) + return result + def CheckFile(self, filename): return os.path.exists(filename) diff --git a/build/aprenv.py b/build/aprenv.py index 65011611e4d..b57043ad52a 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -146,6 +146,14 @@ def APRAutoconf(self): self.autoconf.Check_apr_mmap_mapping_dev_zero, 'Check_apr_semaphores': self.autoconf.Check_apr_semaphores, + 'Check_apr_semun': + self.autoconf.Check_apr_semun, + 'Check_apr_check_tcp_nodelay_inherited': + self.autoconf.Check_apr_check_tcp_nodelay_inherited, + 'Check_apr_nonblock_inherited': + self.autoconf.Check_apr_nonblock_inherited, + 'Check_apr_ebcdic': + self.autoconf.Check_apr_ebcdic, }, config_h = 'include/arch/%s/apr_private.h' % (self['APR_PLATFORM'])) @@ -227,7 +235,6 @@ def APRAutoconf(self): else: subst['@%s@' % (s)] = 0 - sizeof_char = conf.CheckTypeSize('char') sizeof_int = self.critical_value(conf.CheckTypeSize, 4, 'int') subst['@int_value@'] = 'int' @@ -416,25 +423,149 @@ def APRAutoconf(self): if mmap_results['mmap'] and \ self.autoconf.CheckFile("/dev/zero") and \ conf.Check_apr_mmap_mapping_dev_zero(): - subst['@havemmapzero@'] = '1' + subst['@havemmapzero@'] = 1 else: - subst['@havemmapzero@'] = '0' + subst['@havemmapzero@'] = 0 # check for locking mechanisms if conf.Check_apr_semaphores(): - subst['@hassysvser@'] = "1" + subst['@hassysvser@'] = 1 else: - subst['@hassysvser@'] = "0" + subst['@hassysvser@'] = 0 if conf.CheckDeclaration('F_SETLK', '#include '): - subst['@hasfcntlser@'] = '1' + subst['@hasfcntlser@'] = 1 + else: + subst['@hasfcntlser@'] = 0 + + if conf.CheckFunc('flock'): + subst['@hasflockser@'] = 1 else: - subst['@hasfcntlser@'] = '0' + subst['@hasflockser@'] = 0 + + apr_tcp_nopush_flag="0" + if conf.CheckDeclaration('TCP_CORK', '#include '): + subst['@have_corkable_tcp@'] = 1 + apr_tcp_nopush_flag="TCP_CORK" + else: + subst['@have_corkable_tcp@'] = 0 + + if conf.CheckDeclaration('TCP_NOPUSH', '#include '): + subst['@apr_tcp_nopush_flag@'] = 3 + subst['@have_corkable_tcp@'] = 1 + + subst['@apr_tcp_nopush_flag@'] = apr_tcp_nopush_flag if conf.CheckFunc('flock'): - subst['@hasflockser@'] = "1" + subst['@hasflockser@'] = 1 + else: + subst['@hasflockser@'] = 0 + + if conf.CheckFunc('getrlimit'): + subst['@have_getrlimit@'] = 1 + else: + subst['@have_getrlimit@'] = 0 + + if conf.CheckFunc('setrlimit'): + subst['@have_setrlimit@'] = 1 + else: + subst['@have_setrlimit@'] = 0 + + if conf.CheckType('struct in_addr', includes='#include '): + subst['@have_in_addr@'] = 1 + else: + subst['@have_in_addr@'] = 0 + + if conf.CheckType('struct sockaddr_storage', includes='#include '): + subst['@have_sa_storage@'] = 1 + else: + subst['@have_sa_storage@'] = 0 + + if conf.CheckType('struct rlimit', includes='#include '): + subst['@struct_rlimit@'] = 1 + else: + subst['@struct_rlimit@'] = 0 + + if conf.Check_apr_semun(): + subst['@have_union_semun@'] = 1 + else: + subst['@have_union_semun@'] = 0 + + check_functions = [ + 'inet_addr', + 'inet_network', + 'memmove', + 'sigaction', + 'sigsuspend', + 'sigwait', + 'strdup', + 'stricmp', + 'strcasecmp', + 'strncasecmp', + 'strnicmp', + 'strstr', + 'memchr', + 'iovec' + ] + + for func in check_functions: + if conf.CheckFunc(func): + subst['@have_%s@' % func] = 1 + else: + subst['@have_%s@' % func] = 0 + + # Set Features + # TODO: Not done yet + subst['@sharedmem@'] = 0 + subst['@threads@'] = 0 + subst['@sendfile@'] = 0 + subst['@mmap@'] = 0 + subst['@fork@'] = 0 + subst['@rand@'] = 0 + subst['@oc@'] = 0 + subst['@aprdso@'] = 0 + subst['@acceptfilter@'] = 0 + subst['@have_unicode_fs@'] = 0 + subst['@have_proc_invoked@'] = 0 + subst['@aprlfs@'] = 0 + subst['@osuuid@'] = 0 + subst['@file_as_socket@'] = 1 + + # check for IPv6 (the user is allowed to disable this via commandline + # options + if self['ipv6']: + if conf.CheckType('struct sockaddr_in6', + includes='#include ') and \ + conf.CheckFunc('getaddrinfo') and \ + conf.CheckFunc('getnameinfo'): + subst['@have_ipv6@'] = 1 + else: + subst['@have_ipv6@'] = 0 + + if conf.CheckDeclaration('IPPROTO_SCTP', '#include '): + subst['@have_sctp@'] = 1 + else: + subst['@have_sctp@'] = 0 + + if conf.CheckDeclaration('SO_ACCEPTFILTER', '#include '): + subst['@acceptfilter@'] = 1 + else: + subst['@acceptfilter@'] = 0 + + if conf.Check_apr_check_tcp_nodelay_inherited(): + subst['@tcp_nodelay_inherited@'] = 1 + else: + subst['@tcp_nodelay_inherited@'] = 0 + + if conf.Check_apr_nonblock_inherited(): + subst['@o_nonblock_inherited@'] = 1 + else: + subst['@o_nonblock_inherited@'] = 0 + + if conf.Check_apr_ebcdic(): + subst['@apr_charset_ebcdic@'] = 1 else: - subst['@hasflockser@'] = "0" + subst['@apr_charset_ebcdic@'] = 0 self.SubstFile('include/apr.h', 'include/apr.h.in', SUBST_DICT = subst) From 343bce163133eee96937a1bdec14c8d2e35f0e18 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 8 Mar 2009 23:28:29 +0000 Subject: [PATCH 6339/7878] SCons: - Add missing defs - Include arch/apr_private_common.h from the platform apr_private.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@751551 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprenv.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/build/aprenv.py b/build/aprenv.py index b57043ad52a..7a6a8c8d7e1 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -567,6 +567,39 @@ def APRAutoconf(self): else: subst['@apr_charset_ebcdic@'] = 0 + subst['@have_iovec@'] = 1 + subst['@have_sockaddr_un@'] = 0 + subst['@proc_mutex_is_global@'] = 0 + subst['@hasprocpthreadser@'] = 0 + + subst['@havemmaptmp@'] = 0 + subst['@havemmapshm@'] = 0 + subst['@haveshmgetanon@'] = 0 + subst['@haveshmget@'] = 0 + subst['@havemmapanon@'] = 0 + subst['@havebeosarea@'] = 0 + + subst['@usemmaptmp@'] = 0 + subst['@usemmapshm@'] = 0 + subst['@usemmapzero@'] = 0 + subst['@useshmgetanon@'] = 0 + subst['@useshmget@'] = 0 + subst['@usemmapanon@'] = 0 + subst['@usebeosarea@'] = 0 + + subst['@flockser@'] = 0 + subst['@sysvser@'] = 0 + subst['@posixser@'] = 0 + subst['@fcntlser@'] = 0 + subst['@procpthreadser@'] = 0 + subst['@pthreadser@'] = 0 + subst['@hasposixser@'] = 0 + subst['@proclockglobal@'] = 0 + subst['@eolstr@'] = "\\\\n" + subst['@shlibpath_var@'] = "" + self.SubstFile('include/apr.h', 'include/apr.h.in', SUBST_DICT = subst) + if hasattr(conf, "config_h_text"): + conf.config_h_text = conf.config_h_text + '#include "arch/apr_private_common.h"\n' return conf.Finish() From bfa06250f446ae4b8eb6930c713ff01f3b3cfd11 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 8 Mar 2009 23:44:30 +0000 Subject: [PATCH 6340/7878] SCons: Fix usage of TryRun: """Returns (1, outputStr) on success, (0, '') otherwise.""" We were recording failure as success, which means lots of things weren't quite right. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@751554 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprconf.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/build/aprconf.py b/build/aprconf.py index a66a6696d32..e1f6b44b4b1 100644 --- a/build/aprconf.py +++ b/build/aprconf.py @@ -1,4 +1,5 @@ import os +import sys class APRConfigureBase: def __init__(self, env): @@ -70,8 +71,8 @@ def Check_apr_atomic_builtins(self, context): } """ result = context.TryRun(source, '.c') - context.Result(result[0] == 0) - return result[0] == 0 + context.Result(result[0] == 1) + return result[0] == 1 def Check_apr_ebcdic(self, context): context.Message('Checking whether system uses EBCDIC.. ') @@ -80,8 +81,8 @@ def Check_apr_ebcdic(self, context): return (unsigned char)'A' != (unsigned char)0xC1; }""" result = context.TryRun(source, '.c') - context.Result(result[0]) - return result[0] + context.Result(result[0] == 1) + return result[0] == 1 def Check_apr_nonblock_inherited(self, context): context.Message('Checking whether O_NONBLOCK setting is inherited from listening sockets... ') @@ -180,8 +181,8 @@ def Check_apr_nonblock_inherited(self, context): return 0; }""" result = context.TryRun(source, '.c') - context.Result(result[0] == 0) - return result[0] == 0 + context.Result(result[0] == 1) + return result[0] == 1 def Check_apr_largefile64(self, context): context.Message('Checking whether to enable -D_LARGEFILE64_SOURCE... ') @@ -222,8 +223,8 @@ def Check_apr_largefile64(self, context): }""" result = context.TryRun(source, '.c') self.env.Filter(CPPFLAGS = ['-D_LARGEFILE64_SOURCE']) - context.Result(result[0] == 0) - return result[0] == 0 + context.Result(result[0] == 1) + return result[0] == 1 def Check_apr_mmap_mapping_dev_zero(self, context): @@ -252,8 +253,8 @@ def Check_apr_mmap_mapping_dev_zero(self, context): } """ result = context.TryRun(source, '.c') - context.Result(result[0] == 0) - return result[0] == 0 + context.Result(result[0] == 1) + return result[0] == 1 def Check_apr_semaphores(self, context): context.Message('Checking for sem_open, sem_close, sem_unlink... ') @@ -375,8 +376,8 @@ def Check_apr_check_tcp_nodelay_inherited(self, context): return 0; } """ result = context.TryRun(source, '.c') - context.Result(result[0] == 0) - return result[0] == 0 + context.Result(result[0] == 1) + return result[0] == 1 def Check_apr_semun(self, context): context.Message('Checking for semun... ') From 0383e535c26c6204f5be1eaff8c089cdbfd822c8 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 8 Mar 2009 23:50:24 +0000 Subject: [PATCH 6341/7878] SCons: Define the off_t to string function in the config.h file too. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@751556 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprenv.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/aprenv.py b/build/aprenv.py index 7a6a8c8d7e1..3b9b328ea90 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -601,5 +601,7 @@ def APRAutoconf(self): self.SubstFile('include/apr.h', 'include/apr.h.in', SUBST_DICT = subst) if hasattr(conf, "config_h_text"): + conf.Define("APR_OFF_T_STRFN", subst['@off_t_strfn@']) conf.config_h_text = conf.config_h_text + '#include "arch/apr_private_common.h"\n' + return conf.Finish() From 4cc4a5f7b487bc1e75bf90bde26a24e2b7891a98 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Mon, 9 Mar 2009 00:10:59 +0000 Subject: [PATCH 6342/7878] SCons: Add tests for iovec and sockaddr_un. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@751558 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprenv.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build/aprenv.py b/build/aprenv.py index 3b9b328ea90..58b273834eb 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -567,8 +567,17 @@ def APRAutoconf(self): else: subst['@apr_charset_ebcdic@'] = 0 - subst['@have_iovec@'] = 1 - subst['@have_sockaddr_un@'] = 0 + if conf.CheckType('struct iovec', includes='#include \n#include '): + subst['@have_iovec@'] = 1 + else: + subst['@have_iovec@'] = 0 + + + if conf.CheckType('struct sockaddr_un', includes='#include '): + subst['@have_sockaddr_un@'] = 1 + else: + subst['@have_sockaddr_un@'] = 0 + subst['@proc_mutex_is_global@'] = 0 subst['@hasprocpthreadser@'] = 0 From 538491e628150a661c2a0bbffd547162511ce2c2 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Mon, 9 Mar 2009 00:18:15 +0000 Subject: [PATCH 6343/7878] SCons: Add test for proc_mutex_is_global. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@751561 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprenv.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/aprenv.py b/build/aprenv.py index 58b273834eb..c9490274a5d 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -579,6 +579,9 @@ def APRAutoconf(self): subst['@have_sockaddr_un@'] = 0 subst['@proc_mutex_is_global@'] = 0 + if self['PLATFORM'] in ['os2', 'beos', 'win32', 'cygwin']: + subst['@proc_mutex_is_global@'] = 1 + subst['@hasprocpthreadser@'] = 0 subst['@havemmaptmp@'] = 0 From 59acf6409d53a999673fc2e0c96de4904ef2ff17 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Mon, 9 Mar 2009 09:10:25 +0000 Subject: [PATCH 6344/7878] When creating allocator together with unmanaged pool use a single memory block for allocator and first memnode, instead calling malloc twice git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@751627 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 017dc8781e0..1b1cd6463af 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -929,7 +929,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, if (!apr_pools_initialized) return APR_ENOPOOL; if ((pool_allocator = allocator) == NULL) { - if ((pool_allocator = malloc(SIZEOF_ALLOCATOR_T)) == NULL) { + if ((pool_allocator = malloc(MIN_ALLOC + SIZEOF_ALLOCATOR_T)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -937,9 +937,14 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, } memset(pool_allocator, 0, SIZEOF_ALLOCATOR_T); pool_allocator->max_free_index = APR_ALLOCATOR_MAX_FREE_UNLIMITED; - } - if ((node = allocator_alloc(pool_allocator, - MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { + node = (apr_memnode_t *)((char *)pool_allocator + SIZEOF_ALLOCATOR_T); + node->next = NULL; + node->index = 1; + node->first_avail = (char *)node + APR_MEMNODE_T_SIZE; + node->endp = (char *)node + MIN_ALLOC; + } + else if ((node = allocator_alloc(pool_allocator, + MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); From 50b839213b96647dd45038efb9735eab97b683aa Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Mon, 9 Mar 2009 09:29:26 +0000 Subject: [PATCH 6345/7878] No need for additional allocator space. System malloc should make less fragmentation if we are aligned on MIN_ALLOC boundary. Unmanaged pool will just offer the SIZEOF_ALLOCATOR_T initial free memory less git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@751633 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 1b1cd6463af..4a7bd84de62 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -929,7 +929,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, if (!apr_pools_initialized) return APR_ENOPOOL; if ((pool_allocator = allocator) == NULL) { - if ((pool_allocator = malloc(MIN_ALLOC + SIZEOF_ALLOCATOR_T)) == NULL) { + if ((pool_allocator = malloc(MIN_ALLOC)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); From bc7a2158bececb73c14eadeba3e696c04281e576 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Mon, 9 Mar 2009 12:09:06 +0000 Subject: [PATCH 6346/7878] * Need to use pool_allocator as base instead of node as the endpointer is out of bounds otherwise. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@751657 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 4a7bd84de62..a4fe887d685 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -941,7 +941,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, node->next = NULL; node->index = 1; node->first_avail = (char *)node + APR_MEMNODE_T_SIZE; - node->endp = (char *)node + MIN_ALLOC; + node->endp = (char *)pool_allocator + MIN_ALLOC; } else if ((node = allocator_alloc(pool_allocator, MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { From ea88c36760812226e86a035d23f9b5712477d1e0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 16 Mar 2009 16:12:49 +0000 Subject: [PATCH 6347/7878] nelts, the number of elements in the pollset, was neither needed nor properly maintained by these implementations, so axe the related code git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@754924 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 1 - poll/unix/kqueue.c | 1 - poll/unix/port.c | 2 -- 3 files changed, 4 deletions(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 706d52ebfbc..326dac7b1e9 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -188,7 +188,6 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, APR_RING_INSERT_TAIL(&(pollset->p->free_ring), elem, pfd_elem_t, link); } else { - pollset->nelts++; APR_RING_INSERT_TAIL(&(pollset->p->query_ring), elem, pfd_elem_t, link); } pollset_unlock_rings(); diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 72be031f309..dbe785a1546 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -177,7 +177,6 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, } if (rv == APR_SUCCESS) { - pollset->nelts++; APR_RING_INSERT_TAIL(&(pollset->p->query_ring), elem, pfd_elem_t, link); } else { diff --git a/poll/unix/port.c b/poll/unix/port.c index 7470d89a93c..468131f4d9e 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -185,13 +185,11 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, APR_RING_INSERT_TAIL(&(pollset->p->free_ring), elem, pfd_elem_t, link); } else { - pollset->nelts++; elem->on_query_ring = 1; APR_RING_INSERT_TAIL(&(pollset->p->query_ring), elem, pfd_elem_t, link); } } else { - pollset->nelts++; APR_RING_INSERT_TAIL(&(pollset->p->add_ring), elem, pfd_elem_t, link); } From d8d45ec922f690f6038d62f2e476de337435057e Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 23 Mar 2009 09:40:11 +0000 Subject: [PATCH 6348/7878] * buildconf: Do the sed magic for libtool 2.x as well. Poked by: Joe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757363 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/buildconf b/buildconf index 514a410e9df..11554ed3466 100755 --- a/buildconf +++ b/buildconf @@ -68,6 +68,10 @@ if test "$1" = "1"; then fi if test "$1" = "2"; then $libtoolize --copy + # Wouldn't it just be better to define top_builddir?? + mv build/libtool.m4 build/libtool.m4.$$ + cat build/libtool.m4.$$ | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 + rm build/libtool.m4.$$ fi # Clean up any leftovers From 42fa57252c8e3abbbeabb5bb5a186d54a272ea11 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Mon, 23 Mar 2009 23:31:23 +0000 Subject: [PATCH 6349/7878] Improve SCTP test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757593 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprconf.py | 22 ++++++++++++++++++++++ build/aprenv.py | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/build/aprconf.py b/build/aprconf.py index e1f6b44b4b1..9aaa1e0ff52 100644 --- a/build/aprconf.py +++ b/build/aprconf.py @@ -396,6 +396,28 @@ def Check_apr_semun(self, context): context.Result(result) return result + def Check_apr_sctp(self, context): + context.Message('Checking for sctp support... ') + source = """ +#include +#include +#include +#include +#include +#include +int main(void) { + int s, opt = 1; + if ((s = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP)) < 0) + exit(1); + if (setsockopt(s, IPPROTO_SCTP, SCTP_NODELAY, &opt, sizeof(int)) < 0) + exit(2); + exit(0); +} +""" + result = context.TryRun(source, '.c') + context.Result(result[0] == 1) + return result[0] == 1 + def CheckFile(self, filename): return os.path.exists(filename) diff --git a/build/aprenv.py b/build/aprenv.py index c9490274a5d..e93aefcc723 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -542,7 +542,8 @@ def APRAutoconf(self): else: subst['@have_ipv6@'] = 0 - if conf.CheckDeclaration('IPPROTO_SCTP', '#include '): + if conf.CheckDeclaration('IPPROTO_SCTP', '#include ') and \ + self.Check_apr_sctp(): subst['@have_sctp@'] = 1 else: subst['@have_sctp@'] = 0 From 94886b30660d9fafe793f162933f9efdd171c8e5 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Mon, 23 Mar 2009 23:32:25 +0000 Subject: [PATCH 6350/7878] Make sctp test available. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757594 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprenv.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/aprenv.py b/build/aprenv.py index e93aefcc723..26faa1ec7bd 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -154,6 +154,8 @@ def APRAutoconf(self): self.autoconf.Check_apr_nonblock_inherited, 'Check_apr_ebcdic': self.autoconf.Check_apr_ebcdic, + 'Check_apr_sctp': + self.autoconf.Check_apr_sctp, }, config_h = 'include/arch/%s/apr_private.h' % (self['APR_PLATFORM'])) From f2e9cb59f8fbc608c3708ae9f1f2ada16ced0309 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Mon, 23 Mar 2009 23:33:45 +0000 Subject: [PATCH 6351/7878] Scons: oops, wrong python object. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757596 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprenv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/aprenv.py b/build/aprenv.py index 26faa1ec7bd..676ec045a45 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -545,7 +545,7 @@ def APRAutoconf(self): subst['@have_ipv6@'] = 0 if conf.CheckDeclaration('IPPROTO_SCTP', '#include ') and \ - self.Check_apr_sctp(): + conf.Check_apr_sctp(): subst['@have_sctp@'] = 1 else: subst['@have_sctp@'] = 0 From a716f7d8f15b91adfd789c5ac9fa594bd859f6af Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Mon, 23 Mar 2009 23:49:00 +0000 Subject: [PATCH 6352/7878] SCons: Make CheckFile into a proper conftest with outputs. Finish off most of the check for shared process pthread mutexes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757605 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprconf.py | 12 +++++++++--- build/aprenv.py | 13 +++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/build/aprconf.py b/build/aprconf.py index 9aaa1e0ff52..74df43f1341 100644 --- a/build/aprconf.py +++ b/build/aprconf.py @@ -17,6 +17,15 @@ def Check_apr_big_endian(self, context): context.Result('no') return 0 + def CheckFile(self, context, path): + context.Message("Checking if %s exists... " % (path)) + if os.path.exists(path): + context.Result('yes') + return 1 + else: + context.Result('no') + return 0 + def CheckTypesCompatible(self, context, t1, t2, includes): context.Message('Checking %s is the same as %s... ' % (t1, t2)) source = """ @@ -418,9 +427,6 @@ def Check_apr_sctp(self, context): context.Result(result[0] == 1) return result[0] == 1 - def CheckFile(self, filename): - return os.path.exists(filename) - class APRConfigure(APRConfigureBase): def __init__(self, env): APRConfigureBase.__init__(self, env) diff --git a/build/aprenv.py b/build/aprenv.py index 676ec045a45..227e16d71ca 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -134,6 +134,8 @@ def APRAutoconf(self): # TODO Port header detection here etc conf = self.Configure(custom_tests = { + 'CheckFile': + self.autoconf.CheckFile, 'CheckTypesCompatible': self.autoconf.CheckTypesCompatible, 'Check_apr_atomic_builtins': @@ -423,7 +425,7 @@ def APRAutoconf(self): # check for mmap mapping dev zero if mmap_results['mmap'] and \ - self.autoconf.CheckFile("/dev/zero") and \ + conf.CheckFile("/dev/zero") and \ conf.Check_apr_mmap_mapping_dev_zero(): subst['@havemmapzero@'] = 1 else: @@ -585,7 +587,14 @@ def APRAutoconf(self): if self['PLATFORM'] in ['os2', 'beos', 'win32', 'cygwin']: subst['@proc_mutex_is_global@'] = 1 - subst['@hasprocpthreadser@'] = 0 + # note: the current APR use of shared mutex requires /dev/zero + if conf.CheckFile('/dev/zero') and \ + conf.CheckDeclaration('PTHREAD_PROCESS_SHARED', includes='#include ') and \ + conf.CheckFunc('pthread_mutexattr_setpshared'): + subst['@hasprocpthreadser@'] = 1 + else: + subst['@hasprocpthreadser@'] = 0 + subst['@havemmaptmp@'] = 0 subst['@havemmapshm@'] = 0 From f476e784e3b0af6c179d6839cb4da9c0724f90fe Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 24 Mar 2009 00:01:59 +0000 Subject: [PATCH 6353/7878] Scons: Add detection of fork and mmap. Add detection of accept filters. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757607 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprenv.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/build/aprenv.py b/build/aprenv.py index 227e16d71ca..956a76c83fb 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -509,7 +509,9 @@ def APRAutoconf(self): 'strnicmp', 'strstr', 'memchr', - 'iovec' + 'iovec', + 'fork', + 'mmap' ] for func in check_functions: @@ -520,15 +522,14 @@ def APRAutoconf(self): # Set Features # TODO: Not done yet - subst['@sharedmem@'] = 0 - subst['@threads@'] = 0 + subst['@sharedmem@'] = 1 + subst['@threads@'] = 1 subst['@sendfile@'] = 0 - subst['@mmap@'] = 0 - subst['@fork@'] = 0 + subst['@mmap@'] = subst['@have_mmap@'] + subst['@fork@'] = subst['@have_fork@'] subst['@rand@'] = 0 subst['@oc@'] = 0 subst['@aprdso@'] = 0 - subst['@acceptfilter@'] = 0 subst['@have_unicode_fs@'] = 0 subst['@have_proc_invoked@'] = 0 subst['@aprlfs@'] = 0 @@ -546,6 +547,11 @@ def APRAutoconf(self): else: subst['@have_ipv6@'] = 0 + if conf.CheckDeclaration('SO_ACCEPTFILTER', '#include '): + subst['@acceptfilter@'] = 1 + else: + subst['@acceptfilter@'] = 0 + if conf.CheckDeclaration('IPPROTO_SCTP', '#include ') and \ conf.Check_apr_sctp(): subst['@have_sctp@'] = 1 From 11287b7e9ec777d174e053960d52b92dc209069f Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 24 Mar 2009 00:08:14 +0000 Subject: [PATCH 6354/7878] SCons: fixup UUID lib detection. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757609 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprenv.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/aprenv.py b/build/aprenv.py index 956a76c83fb..4e285913ece 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -511,7 +511,9 @@ def APRAutoconf(self): 'memchr', 'iovec', 'fork', - 'mmap' + 'mmap', + 'uuid_create', + 'uuid_generate', ] for func in check_functions: @@ -533,7 +535,7 @@ def APRAutoconf(self): subst['@have_unicode_fs@'] = 0 subst['@have_proc_invoked@'] = 0 subst['@aprlfs@'] = 0 - subst['@osuuid@'] = 0 + subst['@osuuid@'] = subst['@have_uuid_generate@'] or subst['@have_uuid_create@'] subst['@file_as_socket@'] = 1 # check for IPv6 (the user is allowed to disable this via commandline From d48c1cff5bab4b690a4d793a25c41053c431dad4 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 24 Mar 2009 00:13:55 +0000 Subject: [PATCH 6355/7878] SCons: When ipv6 is available, but not configured, still subst the have_ipv6 variable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757612 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprenv.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/aprenv.py b/build/aprenv.py index 4e285913ece..47a8f0de150 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -540,14 +540,13 @@ def APRAutoconf(self): # check for IPv6 (the user is allowed to disable this via commandline # options + subst['@have_ipv6@'] = 0 if self['ipv6']: if conf.CheckType('struct sockaddr_in6', includes='#include ') and \ conf.CheckFunc('getaddrinfo') and \ conf.CheckFunc('getnameinfo'): subst['@have_ipv6@'] = 1 - else: - subst['@have_ipv6@'] = 0 if conf.CheckDeclaration('SO_ACCEPTFILTER', '#include '): subst['@acceptfilter@'] = 1 From 205213f07d0af2f36c18ba0883b57ab244d7b4dd Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 24 Mar 2009 00:16:58 +0000 Subject: [PATCH 6356/7878] SCons: check for waitpid. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757613 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprenv.py | 1 + 1 file changed, 1 insertion(+) diff --git a/build/aprenv.py b/build/aprenv.py index 47a8f0de150..0cc731fa2c8 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -514,6 +514,7 @@ def APRAutoconf(self): 'mmap', 'uuid_create', 'uuid_generate', + 'waitpid' ] for func in check_functions: From 8d3d98267c0a436d52b5a1d670439982b12ea0c4 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 24 Mar 2009 00:30:53 +0000 Subject: [PATCH 6357/7878] SCons: fixup solaris where sigwait takes one arg. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757618 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprenv.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/aprenv.py b/build/aprenv.py index 0cc731fa2c8..81e669a826f 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -523,6 +523,9 @@ def APRAutoconf(self): else: subst['@have_%s@' % func] = 0 + if self['PLATFORM'] in ['sunos']: + conf.Define("SIGWAIT_TAKES_ONE_ARG") + # Set Features # TODO: Not done yet subst['@sharedmem@'] = 1 From e1fadf226019acecfdff28b3e9a752d174c6abe3 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 24 Mar 2009 00:43:08 +0000 Subject: [PATCH 6358/7878] SCons: Add Prefix path to build variables. Use prefix path to conpmute the DSO path Change eolstyle based on platform. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757622 13f79535-47bb-0310-9956-ffa450edef68 --- SConstruct | 1 + build/aprenv.py | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 774d10188f4..c7253ad7812 100644 --- a/SConstruct +++ b/SConstruct @@ -7,6 +7,7 @@ EnsureSConsVersion(1, 1, 0) vars = Variables('build.py') +vars.Add('prefix', 'Installation Prefix', '/usr/local') vars.Add('maintainer_mode', 'Turn on debugging and compile time warnings', 0) vars.Add('profile', 'Turn on profiling for the build (GCC)', 0) vars.Add('lfs', 'Large file support on 32-bit platforms', 1) diff --git a/build/aprenv.py b/build/aprenv.py index 81e669a826f..a9340fe302d 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -630,8 +630,13 @@ def APRAutoconf(self): subst['@pthreadser@'] = 0 subst['@hasposixser@'] = 0 subst['@proclockglobal@'] = 0 - subst['@eolstr@'] = "\\\\n" - subst['@shlibpath_var@'] = "" + + if self['APR_PLATFORM'] in ['win32']: + subst['@eolstr@'] = "\\\\r\\\\n" + else: + subst['@eolstr@'] = "\\\\n" + + subst['@shlibpath_var@'] = pjoin(self['prefix'], 'lib') self.SubstFile('include/apr.h', 'include/apr.h.in', SUBST_DICT = subst) From 277afab7045455ba9bac2725368186f66ff63b70 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 24 Mar 2009 09:39:18 +0000 Subject: [PATCH 6359/7878] SCons: ability to build in a variant build directory git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757694 13f79535-47bb-0310-9956-ffa450edef68 --- SConscript | 12 ++++++++++++ SConstruct | 10 ++++------ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 SConscript diff --git a/SConscript b/SConscript new file mode 100644 index 00000000000..0518feccf19 --- /dev/null +++ b/SConscript @@ -0,0 +1,12 @@ + +Import("env") + +files = env.core_lib_files() + +(major, minor, patch) = env.APRVersion() + +libapr = env.SharedLibrary('apr-%d' % (major), files) + +targets = [libapr] + +Return("targets") \ No newline at end of file diff --git a/SConstruct b/SConstruct index c7253ad7812..cdeb8b7ce39 100644 --- a/SConstruct +++ b/SConstruct @@ -17,6 +17,7 @@ vars.Add(EnumVariable('pool_debug', 'Turn on pools debugging', 'no', env = APREnv(args=ARGUMENTS, variables=vars) + Help(vars.GenerateHelpText(env)) env.APRHints() @@ -40,12 +41,9 @@ if env['pool_debug'] != 'no': 'all': 31} env.AppendUnique(CPPFLAGS = "-DAPR_POOL_DEBUG=%d" % flags[env['pool_debug']]) -files = env.core_lib_files() - -(major, minor, patch) = env.APRVersion() - -libapr = env.SharedLibrary('apr-%d' % (major), files) +Export("env") -targets = [libapr] +# TODO: Support debug/release builds +targets = SConscript("SConscript", variant_dir='builds/default', duplicate=0) env.Default(targets) From c8ece78e7aee0abd32e6eade81b81d339326629c Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 24 Mar 2009 10:32:34 +0000 Subject: [PATCH 6360/7878] Merge APR-Util trunk into APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@757704 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_brigade.c | 731 ++++++++ buckets/apr_buckets.c | 46 + buckets/apr_buckets_alloc.c | 193 +++ buckets/apr_buckets_eos.c | 54 + buckets/apr_buckets_file.c | 228 +++ buckets/apr_buckets_flush.c | 54 + buckets/apr_buckets_heap.c | 96 ++ buckets/apr_buckets_mmap.c | 144 ++ buckets/apr_buckets_pipe.c | 119 ++ buckets/apr_buckets_pool.c | 142 ++ buckets/apr_buckets_refcount.c | 64 + buckets/apr_buckets_simple.c | 137 ++ buckets/apr_buckets_socket.c | 114 ++ dbd/NWGNUdbdfreetds | 296 ++++ dbd/NWGNUdbdmysql | 297 ++++ dbd/NWGNUdbdpgsql | 297 ++++ dbd/NWGNUdbdsqli2 | 296 ++++ dbd/NWGNUdbdsqli3 | 298 ++++ dbd/NWGNUmakefile | 262 +++ dbd/apr_dbd.c | 565 +++++++ dbd/apr_dbd_freetds.c | 805 +++++++++ dbd/apr_dbd_freetds.dsp | 207 +++ dbd/apr_dbd_mysql.c | 1297 +++++++++++++++ dbd/apr_dbd_mysql.dsp | 207 +++ dbd/apr_dbd_odbc.c | 1674 +++++++++++++++++++ dbd/apr_dbd_odbc.dsp | 191 +++ dbd/apr_dbd_oracle.c | 2220 +++++++++++++++++++++++++ dbd/apr_dbd_oracle.dsp | 207 +++ dbd/apr_dbd_pgsql.c | 1315 +++++++++++++++ dbd/apr_dbd_pgsql.dsp | 207 +++ dbd/apr_dbd_sqlite2.c | 566 +++++++ dbd/apr_dbd_sqlite2.dsp | 207 +++ dbd/apr_dbd_sqlite3.c | 916 ++++++++++ dbd/apr_dbd_sqlite3.dsp | 207 +++ dbm/NWGNUdbmdb | 297 ++++ dbm/NWGNUdbmgdbm | 296 ++++ dbm/NWGNUmakefile | 251 +++ dbm/apr_dbm.c | 296 ++++ dbm/apr_dbm_berkeleydb.c | 404 +++++ dbm/apr_dbm_db.dsp | 215 +++ dbm/apr_dbm_gdbm.c | 255 +++ dbm/apr_dbm_gdbm.dsp | 215 +++ dbm/apr_dbm_ndbm.c | 238 +++ dbm/apr_dbm_sdbm.c | 224 +++ dbm/sdbm/sdbm.c | 584 +++++++ dbm/sdbm/sdbm_hash.c | 63 + dbm/sdbm/sdbm_lock.c | 79 + dbm/sdbm/sdbm_pair.c | 319 ++++ dbm/sdbm/sdbm_pair.h | 40 + dbm/sdbm/sdbm_private.h | 84 + dbm/sdbm/sdbm_tune.h | 40 + encoding/apr_base64.c | 268 +++ hooks/apr_hooks.c | 406 +++++ include/apr_anylock.h | 128 ++ include/apr_base64.h | 112 ++ include/apr_buckets.h | 1569 +++++++++++++++++ include/apr_crypto.h | 462 +++++ include/apr_date.h | 106 ++ include/apr_dbd.h | 552 ++++++ include/apr_dbm.h | 227 +++ include/apr_hooks.h | 296 ++++ include/apr_ldap.h.in | 197 +++ include/apr_ldap.hnw | 158 ++ include/apr_ldap.hw | 197 +++ include/apr_ldap_init.h | 165 ++ include/apr_ldap_option.h | 254 +++ include/apr_ldap_rebind.h | 98 ++ include/apr_ldap_url.h | 120 ++ include/apr_md4.h | 135 ++ include/apr_md5.h | 162 ++ include/apr_memcache.h | 446 +++++ include/apr_optional.h | 92 + include/apr_optional_hooks.h | 117 ++ include/apr_queue.h | 138 ++ include/apr_reslist.h | 174 ++ include/apr_rmm.h | 137 ++ include/apr_sdbm.h | 176 ++ include/apr_sha1.h | 121 ++ include/apr_strmatch.h | 81 + include/apr_thread_pool.h | 299 ++++ include/apr_uri.h | 178 ++ include/apr_uuid.h | 76 + include/apr_xlate.h | 163 ++ include/apr_xml.h | 356 ++++ include/apu.h.in | 114 ++ include/apu.hnw | 124 ++ include/apu.hw | 140 ++ include/apu_errno.h | 173 ++ include/apu_version.h | 134 ++ include/apu_want.h.in | 51 + include/apu_want.hnw | 52 + include/apu_want.hw | 52 + include/private/apr_crypto_internal.h | 253 +++ include/private/apr_dbd_internal.h | 365 ++++ include/private/apr_dbd_odbc_v2.h | 119 ++ include/private/apr_dbm_private.h | 121 ++ include/private/apu_config.hnw | 53 + include/private/apu_config.hw | 46 + include/private/apu_internal.h | 73 + include/private/apu_select_dbm.h.in | 28 + include/private/apu_select_dbm.hw | 28 + ldap/NWGNUmakefile | 263 +++ ldap/apr_ldap.dsp | 227 +++ ldap/apr_ldap_init.c | 219 +++ ldap/apr_ldap_option.c | 652 ++++++++ ldap/apr_ldap_rebind.c | 351 ++++ ldap/apr_ldap_stub.c | 145 ++ ldap/apr_ldap_url.c | 694 ++++++++ memcache/apr_memcache.c | 1701 +++++++++++++++++++ util-misc/apr_date.c | 637 +++++++ util-misc/apr_queue.c | 390 +++++ util-misc/apr_reslist.c | 473 ++++++ util-misc/apr_rmm.c | 446 +++++ util-misc/apr_thread_pool.c | 964 +++++++++++ util-misc/apu_dso.c | 199 +++ util-misc/apu_version.c | 37 + 116 files changed, 36049 insertions(+) create mode 100644 buckets/apr_brigade.c create mode 100644 buckets/apr_buckets.c create mode 100644 buckets/apr_buckets_alloc.c create mode 100644 buckets/apr_buckets_eos.c create mode 100644 buckets/apr_buckets_file.c create mode 100644 buckets/apr_buckets_flush.c create mode 100644 buckets/apr_buckets_heap.c create mode 100644 buckets/apr_buckets_mmap.c create mode 100644 buckets/apr_buckets_pipe.c create mode 100644 buckets/apr_buckets_pool.c create mode 100644 buckets/apr_buckets_refcount.c create mode 100644 buckets/apr_buckets_simple.c create mode 100644 buckets/apr_buckets_socket.c create mode 100644 dbd/NWGNUdbdfreetds create mode 100644 dbd/NWGNUdbdmysql create mode 100644 dbd/NWGNUdbdpgsql create mode 100644 dbd/NWGNUdbdsqli2 create mode 100644 dbd/NWGNUdbdsqli3 create mode 100644 dbd/NWGNUmakefile create mode 100644 dbd/apr_dbd.c create mode 100644 dbd/apr_dbd_freetds.c create mode 100644 dbd/apr_dbd_freetds.dsp create mode 100644 dbd/apr_dbd_mysql.c create mode 100644 dbd/apr_dbd_mysql.dsp create mode 100644 dbd/apr_dbd_odbc.c create mode 100644 dbd/apr_dbd_odbc.dsp create mode 100644 dbd/apr_dbd_oracle.c create mode 100644 dbd/apr_dbd_oracle.dsp create mode 100644 dbd/apr_dbd_pgsql.c create mode 100644 dbd/apr_dbd_pgsql.dsp create mode 100644 dbd/apr_dbd_sqlite2.c create mode 100644 dbd/apr_dbd_sqlite2.dsp create mode 100644 dbd/apr_dbd_sqlite3.c create mode 100644 dbd/apr_dbd_sqlite3.dsp create mode 100644 dbm/NWGNUdbmdb create mode 100644 dbm/NWGNUdbmgdbm create mode 100644 dbm/NWGNUmakefile create mode 100644 dbm/apr_dbm.c create mode 100644 dbm/apr_dbm_berkeleydb.c create mode 100644 dbm/apr_dbm_db.dsp create mode 100644 dbm/apr_dbm_gdbm.c create mode 100644 dbm/apr_dbm_gdbm.dsp create mode 100644 dbm/apr_dbm_ndbm.c create mode 100644 dbm/apr_dbm_sdbm.c create mode 100644 dbm/sdbm/sdbm.c create mode 100644 dbm/sdbm/sdbm_hash.c create mode 100644 dbm/sdbm/sdbm_lock.c create mode 100644 dbm/sdbm/sdbm_pair.c create mode 100644 dbm/sdbm/sdbm_pair.h create mode 100644 dbm/sdbm/sdbm_private.h create mode 100644 dbm/sdbm/sdbm_tune.h create mode 100644 encoding/apr_base64.c create mode 100644 hooks/apr_hooks.c create mode 100644 include/apr_anylock.h create mode 100644 include/apr_base64.h create mode 100644 include/apr_buckets.h create mode 100644 include/apr_crypto.h create mode 100644 include/apr_date.h create mode 100644 include/apr_dbd.h create mode 100644 include/apr_dbm.h create mode 100644 include/apr_hooks.h create mode 100644 include/apr_ldap.h.in create mode 100644 include/apr_ldap.hnw create mode 100644 include/apr_ldap.hw create mode 100644 include/apr_ldap_init.h create mode 100644 include/apr_ldap_option.h create mode 100644 include/apr_ldap_rebind.h create mode 100644 include/apr_ldap_url.h create mode 100644 include/apr_md4.h create mode 100644 include/apr_md5.h create mode 100644 include/apr_memcache.h create mode 100644 include/apr_optional.h create mode 100644 include/apr_optional_hooks.h create mode 100644 include/apr_queue.h create mode 100644 include/apr_reslist.h create mode 100644 include/apr_rmm.h create mode 100644 include/apr_sdbm.h create mode 100644 include/apr_sha1.h create mode 100644 include/apr_strmatch.h create mode 100644 include/apr_thread_pool.h create mode 100644 include/apr_uri.h create mode 100644 include/apr_uuid.h create mode 100644 include/apr_xlate.h create mode 100644 include/apr_xml.h create mode 100644 include/apu.h.in create mode 100644 include/apu.hnw create mode 100644 include/apu.hw create mode 100644 include/apu_errno.h create mode 100644 include/apu_version.h create mode 100644 include/apu_want.h.in create mode 100644 include/apu_want.hnw create mode 100644 include/apu_want.hw create mode 100644 include/private/apr_crypto_internal.h create mode 100644 include/private/apr_dbd_internal.h create mode 100644 include/private/apr_dbd_odbc_v2.h create mode 100644 include/private/apr_dbm_private.h create mode 100644 include/private/apu_config.hnw create mode 100644 include/private/apu_config.hw create mode 100644 include/private/apu_internal.h create mode 100644 include/private/apu_select_dbm.h.in create mode 100644 include/private/apu_select_dbm.hw create mode 100644 ldap/NWGNUmakefile create mode 100644 ldap/apr_ldap.dsp create mode 100644 ldap/apr_ldap_init.c create mode 100644 ldap/apr_ldap_option.c create mode 100644 ldap/apr_ldap_rebind.c create mode 100644 ldap/apr_ldap_stub.c create mode 100644 ldap/apr_ldap_url.c create mode 100644 memcache/apr_memcache.c create mode 100644 util-misc/apr_date.c create mode 100644 util-misc/apr_queue.c create mode 100644 util-misc/apr_reslist.c create mode 100644 util-misc/apr_rmm.c create mode 100644 util-misc/apr_thread_pool.c create mode 100644 util-misc/apu_dso.c create mode 100644 util-misc/apu_version.c diff --git a/buckets/apr_brigade.c b/buckets/apr_brigade.c new file mode 100644 index 00000000000..a5c392d1639 --- /dev/null +++ b/buckets/apr_brigade.c @@ -0,0 +1,731 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include "apr_pools.h" +#include "apr_tables.h" +#include "apr_buckets.h" +#include "apr_errno.h" +#define APR_WANT_MEMFUNC +#define APR_WANT_STRFUNC +#include "apr_want.h" + +#if APR_HAVE_SYS_UIO_H +#include +#endif + +static apr_status_t brigade_cleanup(void *data) +{ + return apr_brigade_cleanup(data); +} + +APU_DECLARE(apr_status_t) apr_brigade_cleanup(void *data) +{ + apr_bucket_brigade *b = data; + apr_bucket *e; + + while (!APR_BRIGADE_EMPTY(b)) { + e = APR_BRIGADE_FIRST(b); + apr_bucket_delete(e); + } + /* We don't need to free(bb) because it's allocated from a pool. */ + return APR_SUCCESS; +} + +APU_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b) +{ + apr_pool_cleanup_kill(b->p, b, brigade_cleanup); + return apr_brigade_cleanup(b); +} + +APU_DECLARE(apr_bucket_brigade *) apr_brigade_create(apr_pool_t *p, + apr_bucket_alloc_t *list) +{ + apr_bucket_brigade *b; + + b = apr_palloc(p, sizeof(*b)); + b->p = p; + b->bucket_alloc = list; + + APR_RING_INIT(&b->list, apr_bucket, link); + + apr_pool_cleanup_register(b->p, b, brigade_cleanup, apr_pool_cleanup_null); + return b; +} + +APU_DECLARE(apr_bucket_brigade *) apr_brigade_split_ex(apr_bucket_brigade *b, + apr_bucket *e, + apr_bucket_brigade *a) +{ + apr_bucket *f; + + if (!a) { + a = apr_brigade_create(b->p, b->bucket_alloc); + } + else if (!APR_BRIGADE_EMPTY(a)) { + apr_brigade_cleanup(a); + } + /* Return an empty brigade if there is nothing left in + * the first brigade to split off + */ + if (e != APR_BRIGADE_SENTINEL(b)) { + f = APR_RING_LAST(&b->list); + APR_RING_UNSPLICE(e, f, link); + APR_RING_SPLICE_HEAD(&a->list, e, f, apr_bucket, link); + } + + APR_BRIGADE_CHECK_CONSISTENCY(a); + APR_BRIGADE_CHECK_CONSISTENCY(b); + + return a; +} + +APU_DECLARE(apr_bucket_brigade *) apr_brigade_split(apr_bucket_brigade *b, + apr_bucket *e) +{ + return apr_brigade_split_ex(b, e, NULL); +} + +APU_DECLARE(apr_status_t) apr_brigade_partition(apr_bucket_brigade *b, + apr_off_t point, + apr_bucket **after_point) +{ + apr_bucket *e; + const char *s; + apr_size_t len; + apr_uint64_t point64; + apr_status_t rv; + + if (point < 0) { + /* this could cause weird (not necessarily SEGV) things to happen */ + return APR_EINVAL; + } + if (point == 0) { + *after_point = APR_BRIGADE_FIRST(b); + return APR_SUCCESS; + } + + /* + * Try to reduce the following casting mess: We know that point will be + * larger equal 0 now and forever and thus that point (apr_off_t) and + * apr_size_t will fit into apr_uint64_t in any case. + */ + point64 = (apr_uint64_t)point; + + APR_BRIGADE_CHECK_CONSISTENCY(b); + + for (e = APR_BRIGADE_FIRST(b); + e != APR_BRIGADE_SENTINEL(b); + e = APR_BUCKET_NEXT(e)) + { + /* For an unknown length bucket, while 'point64' is beyond the possible + * size contained in apr_size_t, read and continue... + */ + if ((e->length == (apr_size_t)(-1)) + && (point64 > (apr_uint64_t)APR_SIZE_MAX)) { + /* point64 is too far out to simply split this bucket, + * we must fix this bucket's size and keep going... */ + rv = apr_bucket_read(e, &s, &len, APR_BLOCK_READ); + if (rv != APR_SUCCESS) { + *after_point = e; + return rv; + } + } + else if ((point64 < (apr_uint64_t)e->length) + || (e->length == (apr_size_t)(-1))) { + /* We already consumed buckets where point64 is beyond + * our interest ( point64 > APR_SIZE_MAX ), above. + * Here point falls between 0 and APR_SIZE_MAX + * and is within this bucket, or this bucket's len + * is undefined, so now we are ready to split it. + * First try to split the bucket natively... */ + if ((rv = apr_bucket_split(e, (apr_size_t)point64)) + != APR_ENOTIMPL) { + *after_point = APR_BUCKET_NEXT(e); + return rv; + } + + /* if the bucket cannot be split, we must read from it, + * changing its type to one that can be split */ + rv = apr_bucket_read(e, &s, &len, APR_BLOCK_READ); + if (rv != APR_SUCCESS) { + *after_point = e; + return rv; + } + + /* this assumes that len == e->length, which is okay because e + * might have been morphed by the apr_bucket_read() above, but + * if it was, the length would have been adjusted appropriately */ + if (point64 < (apr_uint64_t)e->length) { + rv = apr_bucket_split(e, (apr_size_t)point64); + *after_point = APR_BUCKET_NEXT(e); + return rv; + } + } + if (point64 == (apr_uint64_t)e->length) { + *after_point = APR_BUCKET_NEXT(e); + return APR_SUCCESS; + } + point64 -= (apr_uint64_t)e->length; + } + *after_point = APR_BRIGADE_SENTINEL(b); + return APR_INCOMPLETE; +} + +APU_DECLARE(apr_status_t) apr_brigade_length(apr_bucket_brigade *bb, + int read_all, apr_off_t *length) +{ + apr_off_t total = 0; + apr_bucket *bkt; + apr_status_t status = APR_SUCCESS; + + for (bkt = APR_BRIGADE_FIRST(bb); + bkt != APR_BRIGADE_SENTINEL(bb); + bkt = APR_BUCKET_NEXT(bkt)) + { + if (bkt->length == (apr_size_t)(-1)) { + const char *ignore; + apr_size_t len; + + if (!read_all) { + total = -1; + break; + } + + if ((status = apr_bucket_read(bkt, &ignore, &len, + APR_BLOCK_READ)) != APR_SUCCESS) { + break; + } + } + + total += bkt->length; + } + + *length = total; + return status; +} + +APU_DECLARE(apr_status_t) apr_brigade_flatten(apr_bucket_brigade *bb, + char *c, apr_size_t *len) +{ + apr_size_t actual = 0; + apr_bucket *b; + + for (b = APR_BRIGADE_FIRST(bb); + b != APR_BRIGADE_SENTINEL(bb); + b = APR_BUCKET_NEXT(b)) + { + const char *str; + apr_size_t str_len; + apr_status_t status; + + status = apr_bucket_read(b, &str, &str_len, APR_BLOCK_READ); + if (status != APR_SUCCESS) { + return status; + } + + /* If we would overflow. */ + if (str_len + actual > *len) { + str_len = *len - actual; + } + + /* XXX: It appears that overflow of the final bucket + * is DISCARDED without any warning to the caller. + * + * No, we only copy the data up to their requested size. -- jre + */ + memcpy(c, str, str_len); + + c += str_len; + actual += str_len; + + /* This could probably be actual == *len, but be safe from stray + * photons. */ + if (actual >= *len) { + break; + } + } + + *len = actual; + return APR_SUCCESS; +} + +APU_DECLARE(apr_status_t) apr_brigade_pflatten(apr_bucket_brigade *bb, + char **c, + apr_size_t *len, + apr_pool_t *pool) +{ + apr_off_t actual; + apr_size_t total; + apr_status_t rv; + + apr_brigade_length(bb, 1, &actual); + + /* XXX: This is dangerous beyond belief. At least in the + * apr_brigade_flatten case, the user explicitly stated their + * buffer length - so we don't up and palloc 4GB for a single + * file bucket. This API must grow a useful max boundry, + * either compiled-in or preset via the *len value. + * + * Shouldn't both fn's grow an additional return value for + * the case that the brigade couldn't be flattened into the + * provided or allocated buffer (such as APR_EMOREDATA?) + * Not a failure, simply an advisory result. + */ + total = (apr_size_t)actual; + + *c = apr_palloc(pool, total); + + rv = apr_brigade_flatten(bb, *c, &total); + + if (rv != APR_SUCCESS) { + return rv; + } + + *len = total; + return APR_SUCCESS; +} + +APU_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut, + apr_bucket_brigade *bbIn, + apr_read_type_e block, + apr_off_t maxbytes) +{ + apr_off_t readbytes = 0; + + while (!APR_BRIGADE_EMPTY(bbIn)) { + const char *pos; + const char *str; + apr_size_t len; + apr_status_t rv; + apr_bucket *e; + + e = APR_BRIGADE_FIRST(bbIn); + rv = apr_bucket_read(e, &str, &len, block); + + if (rv != APR_SUCCESS) { + return rv; + } + + pos = memchr(str, APR_ASCII_LF, len); + /* We found a match. */ + if (pos != NULL) { + apr_bucket_split(e, pos - str + 1); + APR_BUCKET_REMOVE(e); + APR_BRIGADE_INSERT_TAIL(bbOut, e); + return APR_SUCCESS; + } + APR_BUCKET_REMOVE(e); + APR_BRIGADE_INSERT_TAIL(bbOut, e); + readbytes += len; + /* We didn't find an APR_ASCII_LF within the maximum line length. */ + if (readbytes >= maxbytes) { + break; + } + } + + return APR_SUCCESS; +} + + +APU_DECLARE(apr_status_t) apr_brigade_to_iovec(apr_bucket_brigade *b, + struct iovec *vec, int *nvec) +{ + int left = *nvec; + apr_bucket *e; + struct iovec *orig; + apr_size_t iov_len; + const char *iov_base; + apr_status_t rv; + + orig = vec; + + for (e = APR_BRIGADE_FIRST(b); + e != APR_BRIGADE_SENTINEL(b); + e = APR_BUCKET_NEXT(e)) + { + if (left-- == 0) + break; + + rv = apr_bucket_read(e, &iov_base, &iov_len, APR_NONBLOCK_READ); + if (rv != APR_SUCCESS) + return rv; + /* Set indirectly since types differ: */ + vec->iov_len = iov_len; + vec->iov_base = (void *)iov_base; + ++vec; + } + + *nvec = (int)(vec - orig); + return APR_SUCCESS; +} + +APU_DECLARE(apr_status_t) apr_brigade_vputstrs(apr_bucket_brigade *b, + apr_brigade_flush flush, + void *ctx, + va_list va) +{ + for (;;) { + const char *str = va_arg(va, const char *); + apr_status_t rv; + + if (str == NULL) + break; + + rv = apr_brigade_write(b, flush, ctx, str, strlen(str)); + if (rv != APR_SUCCESS) + return rv; + } + + return APR_SUCCESS; +} + +APU_DECLARE(apr_status_t) apr_brigade_putc(apr_bucket_brigade *b, + apr_brigade_flush flush, void *ctx, + const char c) +{ + return apr_brigade_write(b, flush, ctx, &c, 1); +} + +APU_DECLARE(apr_status_t) apr_brigade_write(apr_bucket_brigade *b, + apr_brigade_flush flush, + void *ctx, + const char *str, apr_size_t nbyte) +{ + apr_bucket *e = APR_BRIGADE_LAST(b); + apr_size_t remaining = APR_BUCKET_BUFF_SIZE; + char *buf = NULL; + + if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)) { + apr_bucket_heap *h = e->data; + + /* HEAP bucket start offsets are always in-memory, safe to cast */ + remaining = h->alloc_len - (e->length + (apr_size_t)e->start); + buf = h->base + e->start + e->length; + } + + if (nbyte > remaining) { + /* either a buffer bucket exists but is full, + * or no buffer bucket exists and the data is too big + * to buffer. In either case, we should flush. */ + if (flush) { + e = apr_bucket_transient_create(str, nbyte, b->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(b, e); + return flush(b, ctx); + } + else { + e = apr_bucket_heap_create(str, nbyte, NULL, b->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(b, e); + return APR_SUCCESS; + } + } + else if (!buf) { + /* we don't have a buffer, but the data is small enough + * that we don't mind making a new buffer */ + buf = apr_bucket_alloc(APR_BUCKET_BUFF_SIZE, b->bucket_alloc); + e = apr_bucket_heap_create(buf, APR_BUCKET_BUFF_SIZE, + apr_bucket_free, b->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(b, e); + e->length = 0; /* We are writing into the brigade, and + * allocating more memory than we need. This + * ensures that the bucket thinks it is empty just + * after we create it. We'll fix the length + * once we put data in it below. + */ + } + + /* there is a sufficiently big buffer bucket available now */ + memcpy(buf, str, nbyte); + e->length += nbyte; + + return APR_SUCCESS; +} + +APU_DECLARE(apr_status_t) apr_brigade_writev(apr_bucket_brigade *b, + apr_brigade_flush flush, + void *ctx, + const struct iovec *vec, + apr_size_t nvec) +{ + apr_bucket *e; + apr_size_t total_len; + apr_size_t i; + char *buf; + + /* Compute the total length of the data to be written. + */ + total_len = 0; + for (i = 0; i < nvec; i++) { + total_len += vec[i].iov_len; + } + + /* If the data to be written is very large, try to convert + * the iovec to transient buckets rather than copying. + */ + if (total_len > APR_BUCKET_BUFF_SIZE) { + if (flush) { + for (i = 0; i < nvec; i++) { + e = apr_bucket_transient_create(vec[i].iov_base, + vec[i].iov_len, + b->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(b, e); + } + return flush(b, ctx); + } + else { + for (i = 0; i < nvec; i++) { + e = apr_bucket_heap_create((const char *) vec[i].iov_base, + vec[i].iov_len, NULL, + b->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(b, e); + } + return APR_SUCCESS; + } + } + + i = 0; + + /* If there is a heap bucket at the end of the brigade + * already, copy into the existing bucket. + */ + e = APR_BRIGADE_LAST(b); + if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)) { + apr_bucket_heap *h = e->data; + apr_size_t remaining = h->alloc_len - + (e->length + (apr_size_t)e->start); + buf = h->base + e->start + e->length; + + if (remaining >= total_len) { + /* Simple case: all the data will fit in the + * existing heap bucket + */ + for (; i < nvec; i++) { + apr_size_t len = vec[i].iov_len; + memcpy(buf, (const void *) vec[i].iov_base, len); + buf += len; + } + e->length += total_len; + return APR_SUCCESS; + } + else { + /* More complicated case: not all of the data + * will fit in the existing heap bucket. The + * total data size is <= APR_BUCKET_BUFF_SIZE, + * so we'll need only one additional bucket. + */ + const char *start_buf = buf; + for (; i < nvec; i++) { + apr_size_t len = vec[i].iov_len; + if (len > remaining) { + break; + } + memcpy(buf, (const void *) vec[i].iov_base, len); + buf += len; + remaining -= len; + } + e->length += (buf - start_buf); + total_len -= (buf - start_buf); + + if (flush) { + apr_status_t rv = flush(b, ctx); + if (rv != APR_SUCCESS) { + return rv; + } + } + + /* Now fall through into the case below to + * allocate another heap bucket and copy the + * rest of the array. (Note that i is not + * reset to zero here; it holds the index + * of the first vector element to be + * written to the new bucket.) + */ + } + } + + /* Allocate a new heap bucket, and copy the data into it. + * The checks above ensure that the amount of data to be + * written here is no larger than APR_BUCKET_BUFF_SIZE. + */ + buf = apr_bucket_alloc(APR_BUCKET_BUFF_SIZE, b->bucket_alloc); + e = apr_bucket_heap_create(buf, APR_BUCKET_BUFF_SIZE, + apr_bucket_free, b->bucket_alloc); + for (; i < nvec; i++) { + apr_size_t len = vec[i].iov_len; + memcpy(buf, (const void *) vec[i].iov_base, len); + buf += len; + } + e->length = total_len; + APR_BRIGADE_INSERT_TAIL(b, e); + + return APR_SUCCESS; +} + +APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb, + apr_brigade_flush flush, void *ctx, + const char *str) +{ + apr_size_t len = strlen(str); + apr_bucket *bkt = APR_BRIGADE_LAST(bb); + if (!APR_BRIGADE_EMPTY(bb) && APR_BUCKET_IS_HEAP(bkt)) { + /* If there is enough space available in a heap bucket + * at the end of the brigade, copy the string directly + * into the heap bucket + */ + apr_bucket_heap *h = bkt->data; + apr_size_t bytes_avail = h->alloc_len - bkt->length; + + if (bytes_avail >= len) { + char *buf = h->base + bkt->start + bkt->length; + memcpy(buf, str, len); + bkt->length += len; + return APR_SUCCESS; + } + } + + /* If the string could not be copied into an existing heap + * bucket, delegate the work to apr_brigade_write(), which + * knows how to grow the brigade + */ + return apr_brigade_write(bb, flush, ctx, str, len); +} + +APU_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b, + apr_brigade_flush flush, + void *ctx, ...) +{ + va_list va; + apr_status_t rv; + + va_start(va, ctx); + rv = apr_brigade_vputstrs(b, flush, ctx, va); + va_end(va); + return rv; +} + +APU_DECLARE_NONSTD(apr_status_t) apr_brigade_printf(apr_bucket_brigade *b, + apr_brigade_flush flush, + void *ctx, + const char *fmt, ...) +{ + va_list ap; + apr_status_t rv; + + va_start(ap, fmt); + rv = apr_brigade_vprintf(b, flush, ctx, fmt, ap); + va_end(ap); + return rv; +} + +struct brigade_vprintf_data_t { + apr_vformatter_buff_t vbuff; + + apr_bucket_brigade *b; /* associated brigade */ + apr_brigade_flush *flusher; /* flushing function */ + void *ctx; + + char *cbuff; /* buffer to flush from */ +}; + +static apr_status_t brigade_flush(apr_vformatter_buff_t *buff) +{ + /* callback function passed to ap_vformatter to be + * called when vformatter needs to buff and + * buff.curpos > buff.endpos + */ + + /* "downcast," have really passed a brigade_vprintf_data_t* */ + struct brigade_vprintf_data_t *vd = (struct brigade_vprintf_data_t*)buff; + apr_status_t res = APR_SUCCESS; + + res = apr_brigade_write(vd->b, *vd->flusher, vd->ctx, vd->cbuff, + APR_BUCKET_BUFF_SIZE); + + if(res != APR_SUCCESS) { + return -1; + } + + vd->vbuff.curpos = vd->cbuff; + vd->vbuff.endpos = vd->cbuff + APR_BUCKET_BUFF_SIZE; + + return res; +} + +APU_DECLARE(apr_status_t) apr_brigade_vprintf(apr_bucket_brigade *b, + apr_brigade_flush flush, + void *ctx, + const char *fmt, va_list va) +{ + /* the cast, in order of appearance */ + struct brigade_vprintf_data_t vd; + char buf[APR_BUCKET_BUFF_SIZE]; + int written; + + vd.vbuff.curpos = buf; + vd.vbuff.endpos = buf + APR_BUCKET_BUFF_SIZE; + vd.b = b; + vd.flusher = &flush; + vd.ctx = ctx; + vd.cbuff = buf; + + written = apr_vformatter(brigade_flush, &vd.vbuff, fmt, va); + + if (written == -1) { + return -1; + } + + /* tack on null terminator to remaining string */ + *(vd.vbuff.curpos) = '\0'; + + /* write out what remains in the buffer */ + return apr_brigade_write(b, flush, ctx, buf, vd.vbuff.curpos - buf); +} + +/* A "safe" maximum bucket size, 1Gb */ +#define MAX_BUCKET_SIZE (0x40000000) + +APU_DECLARE(apr_bucket *) apr_brigade_insert_file(apr_bucket_brigade *bb, + apr_file_t *f, + apr_off_t start, + apr_off_t length, + apr_pool_t *p) +{ + apr_bucket *e; + + if (sizeof(apr_off_t) == sizeof(apr_size_t) || length < MAX_BUCKET_SIZE) { + e = apr_bucket_file_create(f, start, (apr_size_t)length, p, + bb->bucket_alloc); + } + else { + /* Several buckets are needed. */ + e = apr_bucket_file_create(f, start, MAX_BUCKET_SIZE, p, + bb->bucket_alloc); + + while (length > MAX_BUCKET_SIZE) { + apr_bucket *ce; + apr_bucket_copy(e, &ce); + APR_BRIGADE_INSERT_TAIL(bb, ce); + e->start += MAX_BUCKET_SIZE; + length -= MAX_BUCKET_SIZE; + } + e->length = (apr_size_t)length; /* Resize just the last bucket */ + } + + APR_BRIGADE_INSERT_TAIL(bb, e); + return e; +} diff --git a/buckets/apr_buckets.c b/buckets/apr_buckets.c new file mode 100644 index 00000000000..802f4e25969 --- /dev/null +++ b/buckets/apr_buckets.c @@ -0,0 +1,46 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_buckets.h" + +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_setaside_noop(apr_bucket *data, + apr_pool_t *pool) +{ + return APR_SUCCESS; +} + +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_setaside_notimpl(apr_bucket *data, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_split_notimpl(apr_bucket *data, + apr_size_t point) +{ + return APR_ENOTIMPL; +} + +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_copy_notimpl(apr_bucket *e, + apr_bucket **c) +{ + return APR_ENOTIMPL; +} + +APU_DECLARE_NONSTD(void) apr_bucket_destroy_noop(void *data) +{ + return; +} diff --git a/buckets/apr_buckets_alloc.c b/buckets/apr_buckets_alloc.c new file mode 100644 index 00000000000..60f42deaead --- /dev/null +++ b/buckets/apr_buckets_alloc.c @@ -0,0 +1,193 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "apr_buckets.h" +#include "apr_allocator.h" + +#define ALLOC_AMT (8192 - APR_MEMNODE_T_SIZE) + +typedef struct node_header_t { + apr_size_t size; + apr_bucket_alloc_t *alloc; + apr_memnode_t *memnode; + struct node_header_t *next; +} node_header_t; + +#define SIZEOF_NODE_HEADER_T APR_ALIGN_DEFAULT(sizeof(node_header_t)) +#define SMALL_NODE_SIZE (APR_BUCKET_ALLOC_SIZE + SIZEOF_NODE_HEADER_T) + +/** A list of free memory from which new buckets or private bucket + * structures can be allocated. + */ +struct apr_bucket_alloc_t { + apr_pool_t *pool; + apr_allocator_t *allocator; + node_header_t *freelist; + apr_memnode_t *blocks; +}; + +static apr_status_t alloc_cleanup(void *data) +{ + apr_bucket_alloc_t *list = data; + + apr_allocator_free(list->allocator, list->blocks); + +#if APR_POOL_DEBUG + if (list->pool && list->allocator != apr_pool_allocator_get(list->pool)) { + apr_allocator_destroy(list->allocator); + } +#endif + + return APR_SUCCESS; +} + +APU_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create(apr_pool_t *p) +{ + apr_allocator_t *allocator = apr_pool_allocator_get(p); + apr_bucket_alloc_t *list; + +#if APR_POOL_DEBUG + /* may be NULL for debug mode. */ + if (allocator == NULL) { + if (apr_allocator_create(&allocator) != APR_SUCCESS) { + abort(); + } + } +#endif + + list = apr_bucket_alloc_create_ex(allocator); + list->pool = p; + apr_pool_cleanup_register(list->pool, list, alloc_cleanup, + apr_pool_cleanup_null); + + return list; +} + +APU_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create_ex( + apr_allocator_t *allocator) +{ + apr_bucket_alloc_t *list; + apr_memnode_t *block; + + block = apr_allocator_alloc(allocator, ALLOC_AMT); + if (!block) { + return NULL; + } + list = (apr_bucket_alloc_t *)block->first_avail; + list->pool = NULL; + list->allocator = allocator; + list->freelist = NULL; + list->blocks = block; + block->first_avail += APR_ALIGN_DEFAULT(sizeof(*list)); + + return list; +} + +APU_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list) +{ + if (list->pool) { + apr_pool_cleanup_kill(list->pool, list, alloc_cleanup); + } + + apr_allocator_free(list->allocator, list->blocks); + +#if APR_POOL_DEBUG + if (list->pool && list->allocator != apr_pool_allocator_get(list->pool)) { + apr_allocator_destroy(list->allocator); + } +#endif +} + +APU_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size, + apr_bucket_alloc_t *list) +{ + node_header_t *node; + apr_memnode_t *active = list->blocks; + char *endp; + + size += SIZEOF_NODE_HEADER_T; + if (size <= SMALL_NODE_SIZE) { + if (list->freelist) { + node = list->freelist; + list->freelist = node->next; + } + else { + endp = active->first_avail + SMALL_NODE_SIZE; + if (endp >= active->endp) { + list->blocks = apr_allocator_alloc(list->allocator, ALLOC_AMT); + if (!list->blocks) { + return NULL; + } + list->blocks->next = active; + active = list->blocks; + endp = active->first_avail + SMALL_NODE_SIZE; + } + node = (node_header_t *)active->first_avail; + node->alloc = list; + node->memnode = active; + node->size = SMALL_NODE_SIZE; + active->first_avail = endp; + } + } + else { + apr_memnode_t *memnode = apr_allocator_alloc(list->allocator, size); + if (!memnode) { + return NULL; + } + node = (node_header_t *)memnode->first_avail; + node->alloc = list; + node->memnode = memnode; + node->size = size; + } + return ((char *)node) + SIZEOF_NODE_HEADER_T; +} + +#ifdef APR_BUCKET_DEBUG +#if APR_HAVE_STDLIB_H +#include +#endif +static void check_not_already_free(node_header_t *node) +{ + apr_bucket_alloc_t *list = node->alloc; + node_header_t *curr = list->freelist; + + while (curr) { + if (node == curr) { + abort(); + } + curr = curr->next; + } +} +#else +#define check_not_already_free(node) +#endif + +APU_DECLARE_NONSTD(void) apr_bucket_free(void *mem) +{ + node_header_t *node = (node_header_t *)((char *)mem - SIZEOF_NODE_HEADER_T); + apr_bucket_alloc_t *list = node->alloc; + + if (node->size == SMALL_NODE_SIZE) { + check_not_already_free(node); + node->next = list->freelist; + list->freelist = node; + } + else { + apr_allocator_free(list->allocator, node->memnode); + } +} diff --git a/buckets/apr_buckets_eos.c b/buckets/apr_buckets_eos.c new file mode 100644 index 00000000000..25cff756252 --- /dev/null +++ b/buckets/apr_buckets_eos.c @@ -0,0 +1,54 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_buckets.h" + +static apr_status_t eos_bucket_read(apr_bucket *b, const char **str, + apr_size_t *len, apr_read_type_e block) +{ + *str = NULL; + *len = 0; + return APR_SUCCESS; +} + +APU_DECLARE(apr_bucket *) apr_bucket_eos_make(apr_bucket *b) +{ + b->length = 0; + b->start = 0; + b->data = NULL; + b->type = &apr_bucket_type_eos; + + return b; +} + +APU_DECLARE(apr_bucket *) apr_bucket_eos_create(apr_bucket_alloc_t *list) +{ + apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); + + APR_BUCKET_INIT(b); + b->free = apr_bucket_free; + b->list = list; + return apr_bucket_eos_make(b); +} + +APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_eos = { + "EOS", 5, APR_BUCKET_METADATA, + apr_bucket_destroy_noop, + eos_bucket_read, + apr_bucket_setaside_noop, + apr_bucket_split_notimpl, + apr_bucket_simple_copy +}; diff --git a/buckets/apr_buckets_file.c b/buckets/apr_buckets_file.c new file mode 100644 index 00000000000..214b53d23c5 --- /dev/null +++ b/buckets/apr_buckets_file.c @@ -0,0 +1,228 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr.h" +#include "apr_general.h" +#include "apr_file_io.h" +#include "apr_buckets.h" + +#if APR_HAS_MMAP +#include "apr_mmap.h" + +/* mmap support for static files based on ideas from John Heidemann's + * patch against 1.0.5. See + * . + */ + +#endif /* APR_HAS_MMAP */ + +static void file_bucket_destroy(void *data) +{ + apr_bucket_file *f = data; + + if (apr_bucket_shared_destroy(f)) { + /* no need to close the file here; it will get + * done automatically when the pool gets cleaned up */ + apr_bucket_free(f); + } +} + +#if APR_HAS_MMAP +static int file_make_mmap(apr_bucket *e, apr_size_t filelength, + apr_off_t fileoffset, apr_pool_t *p) +{ + apr_bucket_file *a = e->data; + apr_mmap_t *mm; + + if (!a->can_mmap) { + return 0; + } + + if (filelength > APR_MMAP_LIMIT) { + if (apr_mmap_create(&mm, a->fd, fileoffset, APR_MMAP_LIMIT, + APR_MMAP_READ, p) != APR_SUCCESS) + { + return 0; + } + apr_bucket_split(e, APR_MMAP_LIMIT); + filelength = APR_MMAP_LIMIT; + } + else if ((filelength < APR_MMAP_THRESHOLD) || + (apr_mmap_create(&mm, a->fd, fileoffset, filelength, + APR_MMAP_READ, p) != APR_SUCCESS)) + { + return 0; + } + apr_bucket_mmap_make(e, mm, 0, filelength); + file_bucket_destroy(a); + return 1; +} +#endif + +static apr_status_t file_bucket_read(apr_bucket *e, const char **str, + apr_size_t *len, apr_read_type_e block) +{ + apr_bucket_file *a = e->data; + apr_file_t *f = a->fd; + apr_bucket *b = NULL; + char *buf; + apr_status_t rv; + apr_size_t filelength = e->length; /* bytes remaining in file past offset */ + apr_off_t fileoffset = e->start; +#if APR_HAS_THREADS && !APR_HAS_XTHREAD_FILES + apr_int32_t flags; +#endif + +#if APR_HAS_MMAP + if (file_make_mmap(e, filelength, fileoffset, a->readpool)) { + return apr_bucket_read(e, str, len, block); + } +#endif + +#if APR_HAS_THREADS && !APR_HAS_XTHREAD_FILES + if ((flags = apr_file_flags_get(f)) & APR_XTHREAD) { + /* this file descriptor is shared across multiple threads and + * this OS doesn't support that natively, so as a workaround + * we must reopen the file into a->readpool */ + const char *fname; + apr_file_name_get(&fname, f); + + rv = apr_file_open(&f, fname, (flags & ~APR_XTHREAD), 0, a->readpool); + if (rv != APR_SUCCESS) + return rv; + + a->fd = f; + } +#endif + + *len = (filelength > APR_BUCKET_BUFF_SIZE) + ? APR_BUCKET_BUFF_SIZE + : filelength; + *str = NULL; /* in case we die prematurely */ + buf = apr_bucket_alloc(*len, e->list); + + /* Handle offset ... */ + rv = apr_file_seek(f, APR_SET, &fileoffset); + if (rv != APR_SUCCESS) { + apr_bucket_free(buf); + return rv; + } + rv = apr_file_read(f, buf, len); + if (rv != APR_SUCCESS && rv != APR_EOF) { + apr_bucket_free(buf); + return rv; + } + filelength -= *len; + /* + * Change the current bucket to refer to what we read, + * even if we read nothing because we hit EOF. + */ + apr_bucket_heap_make(e, buf, *len, apr_bucket_free); + + /* If we have more to read from the file, then create another bucket */ + if (filelength > 0 && rv != APR_EOF) { + /* for efficiency, we can just build a new apr_bucket struct + * to wrap around the existing file bucket */ + b = apr_bucket_alloc(sizeof(*b), e->list); + b->start = fileoffset + (*len); + b->length = filelength; + b->data = a; + b->type = &apr_bucket_type_file; + b->free = apr_bucket_free; + b->list = e->list; + APR_BUCKET_INSERT_AFTER(e, b); + } + else { + file_bucket_destroy(a); + } + + *str = buf; + return rv; +} + +APU_DECLARE(apr_bucket *) apr_bucket_file_make(apr_bucket *b, apr_file_t *fd, + apr_off_t offset, + apr_size_t len, apr_pool_t *p) +{ + apr_bucket_file *f; + + f = apr_bucket_alloc(sizeof(*f), b->list); + f->fd = fd; + f->readpool = p; +#if APR_HAS_MMAP + f->can_mmap = 1; +#endif + + b = apr_bucket_shared_make(b, f, offset, len); + b->type = &apr_bucket_type_file; + + return b; +} + +APU_DECLARE(apr_bucket *) apr_bucket_file_create(apr_file_t *fd, + apr_off_t offset, + apr_size_t len, apr_pool_t *p, + apr_bucket_alloc_t *list) +{ + apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); + + APR_BUCKET_INIT(b); + b->free = apr_bucket_free; + b->list = list; + return apr_bucket_file_make(b, fd, offset, len, p); +} + +APU_DECLARE(apr_status_t) apr_bucket_file_enable_mmap(apr_bucket *e, + int enabled) +{ +#if APR_HAS_MMAP + apr_bucket_file *a = e->data; + a->can_mmap = enabled; + return APR_SUCCESS; +#else + return APR_ENOTIMPL; +#endif /* APR_HAS_MMAP */ +} + + +static apr_status_t file_bucket_setaside(apr_bucket *data, apr_pool_t *reqpool) +{ + apr_bucket_file *a = data->data; + apr_file_t *fd = NULL; + apr_file_t *f = a->fd; + apr_pool_t *curpool = apr_file_pool_get(f); + + if (apr_pool_is_ancestor(curpool, reqpool)) { + return APR_SUCCESS; + } + + if (!apr_pool_is_ancestor(a->readpool, reqpool)) { + a->readpool = reqpool; + } + + apr_file_setaside(&fd, f, reqpool); + a->fd = fd; + return APR_SUCCESS; +} + +APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_file = { + "FILE", 5, APR_BUCKET_DATA, + file_bucket_destroy, + file_bucket_read, + file_bucket_setaside, + apr_bucket_shared_split, + apr_bucket_shared_copy +}; diff --git a/buckets/apr_buckets_flush.c b/buckets/apr_buckets_flush.c new file mode 100644 index 00000000000..a5d84d7551a --- /dev/null +++ b/buckets/apr_buckets_flush.c @@ -0,0 +1,54 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_buckets.h" + +static apr_status_t flush_bucket_read(apr_bucket *b, const char **str, + apr_size_t *len, apr_read_type_e block) +{ + *str = NULL; + *len = 0; + return APR_SUCCESS; +} + +APU_DECLARE(apr_bucket *) apr_bucket_flush_make(apr_bucket *b) +{ + b->length = 0; + b->start = 0; + b->data = NULL; + b->type = &apr_bucket_type_flush; + + return b; +} + +APU_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_bucket_alloc_t *list) +{ + apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); + + APR_BUCKET_INIT(b); + b->free = apr_bucket_free; + b->list = list; + return apr_bucket_flush_make(b); +} + +APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_flush = { + "FLUSH", 5, APR_BUCKET_METADATA, + apr_bucket_destroy_noop, + flush_bucket_read, + apr_bucket_setaside_noop, + apr_bucket_split_notimpl, + apr_bucket_simple_copy +}; diff --git a/buckets/apr_buckets_heap.c b/buckets/apr_buckets_heap.c new file mode 100644 index 00000000000..00f9808b922 --- /dev/null +++ b/buckets/apr_buckets_heap.c @@ -0,0 +1,96 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_buckets.h" +#define APR_WANT_MEMFUNC +#include "apr_want.h" + +static apr_status_t heap_bucket_read(apr_bucket *b, const char **str, + apr_size_t *len, apr_read_type_e block) +{ + apr_bucket_heap *h = b->data; + + *str = h->base + b->start; + *len = b->length; + return APR_SUCCESS; +} + +static void heap_bucket_destroy(void *data) +{ + apr_bucket_heap *h = data; + + if (apr_bucket_shared_destroy(h)) { + (*h->free_func)(h->base); + apr_bucket_free(h); + } +} + +/* Warning: if you change this function, be sure to + * change apr_bucket_pool_make() too! */ +APU_DECLARE(apr_bucket *) apr_bucket_heap_make(apr_bucket *b, const char *buf, + apr_size_t length, + void (*free_func)(void *data)) +{ + apr_bucket_heap *h; + + h = apr_bucket_alloc(sizeof(*h), b->list); + + if (!free_func) { + h->alloc_len = length; + h->base = apr_bucket_alloc(h->alloc_len, b->list); + if (h->base == NULL) { + apr_bucket_free(h); + return NULL; + } + h->free_func = apr_bucket_free; + memcpy(h->base, buf, length); + } + else { + /* XXX: we lose the const qualifier here which indicates + * there's something screwy with the API... + */ + h->base = (char *) buf; + h->alloc_len = length; + h->free_func = free_func; + } + + b = apr_bucket_shared_make(b, h, 0, length); + b->type = &apr_bucket_type_heap; + + return b; +} + +APU_DECLARE(apr_bucket *) apr_bucket_heap_create(const char *buf, + apr_size_t length, + void (*free_func)(void *data), + apr_bucket_alloc_t *list) +{ + apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); + + APR_BUCKET_INIT(b); + b->free = apr_bucket_free; + b->list = list; + return apr_bucket_heap_make(b, buf, length, free_func); +} + +APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_heap = { + "HEAP", 5, APR_BUCKET_DATA, + heap_bucket_destroy, + heap_bucket_read, + apr_bucket_setaside_noop, + apr_bucket_shared_split, + apr_bucket_shared_copy +}; diff --git a/buckets/apr_buckets_mmap.c b/buckets/apr_buckets_mmap.c new file mode 100644 index 00000000000..19de291b533 --- /dev/null +++ b/buckets/apr_buckets_mmap.c @@ -0,0 +1,144 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_buckets.h" + +#if APR_HAS_MMAP + +static apr_status_t mmap_bucket_read(apr_bucket *b, const char **str, + apr_size_t *length, apr_read_type_e block) +{ + apr_bucket_mmap *m = b->data; + apr_status_t ok; + void *addr; + + if (!m->mmap) { + /* the apr_mmap_t was already cleaned up out from under us */ + return APR_EINVAL; + } + + ok = apr_mmap_offset(&addr, m->mmap, b->start); + if (ok != APR_SUCCESS) { + return ok; + } + *str = addr; + *length = b->length; + return APR_SUCCESS; +} + +static apr_status_t mmap_bucket_cleanup(void *data) +{ + /* the apr_mmap_t is about to disappear out from under us, so we + * have no choice but to pretend it doesn't exist anymore. the + * refcount is now useless because there's nothing to refer to + * anymore. so the only valid action on any remaining referrer + * is to delete it. no more reads, no more anything. */ + apr_bucket_mmap *m = data; + + m->mmap = NULL; + return APR_SUCCESS; +} + +static void mmap_bucket_destroy(void *data) +{ + apr_bucket_mmap *m = data; + + if (apr_bucket_shared_destroy(m)) { + if (m->mmap) { + apr_pool_cleanup_kill(m->mmap->cntxt, m, mmap_bucket_cleanup); + apr_mmap_delete(m->mmap); + } + apr_bucket_free(m); + } +} + +/* + * XXX: are the start and length arguments useful? + */ +APU_DECLARE(apr_bucket *) apr_bucket_mmap_make(apr_bucket *b, apr_mmap_t *mm, + apr_off_t start, + apr_size_t length) +{ + apr_bucket_mmap *m; + + m = apr_bucket_alloc(sizeof(*m), b->list); + m->mmap = mm; + + apr_pool_cleanup_register(mm->cntxt, m, mmap_bucket_cleanup, + apr_pool_cleanup_null); + + b = apr_bucket_shared_make(b, m, start, length); + b->type = &apr_bucket_type_mmap; + + return b; +} + + +APU_DECLARE(apr_bucket *) apr_bucket_mmap_create(apr_mmap_t *mm, + apr_off_t start, + apr_size_t length, + apr_bucket_alloc_t *list) +{ + apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); + + APR_BUCKET_INIT(b); + b->free = apr_bucket_free; + b->list = list; + return apr_bucket_mmap_make(b, mm, start, length); +} + +static apr_status_t mmap_bucket_setaside(apr_bucket *b, apr_pool_t *p) +{ + apr_bucket_mmap *m = b->data; + apr_mmap_t *mm = m->mmap; + apr_mmap_t *new_mm; + apr_status_t ok; + + if (!mm) { + /* the apr_mmap_t was already cleaned up out from under us */ + return APR_EINVAL; + } + + /* shortcut if possible */ + if (apr_pool_is_ancestor(mm->cntxt, p)) { + return APR_SUCCESS; + } + + /* duplicate apr_mmap_t into new pool */ + ok = apr_mmap_dup(&new_mm, mm, p); + if (ok != APR_SUCCESS) { + return ok; + } + + /* decrement refcount on old apr_bucket_mmap */ + mmap_bucket_destroy(m); + + /* create new apr_bucket_mmap pointing to new apr_mmap_t */ + apr_bucket_mmap_make(b, new_mm, b->start, b->length); + + return APR_SUCCESS; +} + +APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_mmap = { + "MMAP", 5, APR_BUCKET_DATA, + mmap_bucket_destroy, + mmap_bucket_read, + mmap_bucket_setaside, + apr_bucket_shared_split, + apr_bucket_shared_copy +}; + +#endif diff --git a/buckets/apr_buckets_pipe.c b/buckets/apr_buckets_pipe.c new file mode 100644 index 00000000000..46b469705d6 --- /dev/null +++ b/buckets/apr_buckets_pipe.c @@ -0,0 +1,119 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_buckets.h" + +static apr_status_t pipe_bucket_read(apr_bucket *a, const char **str, + apr_size_t *len, apr_read_type_e block) +{ + apr_file_t *p = a->data; + char *buf; + apr_status_t rv; + apr_interval_time_t timeout; + + if (block == APR_NONBLOCK_READ) { + apr_file_pipe_timeout_get(p, &timeout); + apr_file_pipe_timeout_set(p, 0); + } + + *str = NULL; + *len = APR_BUCKET_BUFF_SIZE; + buf = apr_bucket_alloc(*len, a->list); /* XXX: check for failure? */ + + rv = apr_file_read(p, buf, len); + + if (block == APR_NONBLOCK_READ) { + apr_file_pipe_timeout_set(p, timeout); + } + + if (rv != APR_SUCCESS && rv != APR_EOF) { + apr_bucket_free(buf); + return rv; + } + /* + * If there's more to read we have to keep the rest of the pipe + * for later. Otherwise, we'll close the pipe. + * XXX: Note that more complicated bucket types that + * refer to data not in memory and must therefore have a read() + * function similar to this one should be wary of copying this + * code because if they have a destroy function they probably + * want to migrate the bucket's subordinate structure from the + * old bucket to a raw new one and adjust it as appropriate, + * rather than destroying the old one and creating a completely + * new bucket. + */ + if (*len > 0) { + apr_bucket_heap *h; + /* Change the current bucket to refer to what we read */ + a = apr_bucket_heap_make(a, buf, *len, apr_bucket_free); + h = a->data; + h->alloc_len = APR_BUCKET_BUFF_SIZE; /* note the real buffer size */ + *str = buf; + APR_BUCKET_INSERT_AFTER(a, apr_bucket_pipe_create(p, a->list)); + } + else { + apr_bucket_free(buf); + a = apr_bucket_immortal_make(a, "", 0); + *str = a->data; + if (rv == APR_EOF) { + apr_file_close(p); + } + } + return APR_SUCCESS; +} + +APU_DECLARE(apr_bucket *) apr_bucket_pipe_make(apr_bucket *b, apr_file_t *p) +{ + /* + * A pipe is closed when the end is reached in pipe_bucket_read(). If + * the pipe isn't read to the end (e.g., error path), the pipe will be + * closed when its pool goes away. + * + * Note that typically the pipe is allocated from the request pool + * so it will disappear when the request is finished. However the + * core filter may decide to set aside the tail end of a CGI + * response if the connection is pipelined. This turns out not to + * be a problem because the core will have read to the end of the + * stream so the bucket(s) that it sets aside will be the heap + * buckets created by pipe_bucket_read() above. + */ + b->type = &apr_bucket_type_pipe; + b->length = (apr_size_t)(-1); + b->start = -1; + b->data = p; + + return b; +} + +APU_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *p, + apr_bucket_alloc_t *list) +{ + apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); + + APR_BUCKET_INIT(b); + b->free = apr_bucket_free; + b->list = list; + return apr_bucket_pipe_make(b, p); +} + +APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_pipe = { + "PIPE", 5, APR_BUCKET_DATA, + apr_bucket_destroy_noop, + pipe_bucket_read, + apr_bucket_setaside_notimpl, + apr_bucket_split_notimpl, + apr_bucket_copy_notimpl +}; diff --git a/buckets/apr_buckets_pool.c b/buckets/apr_buckets_pool.c new file mode 100644 index 00000000000..56ba585e058 --- /dev/null +++ b/buckets/apr_buckets_pool.c @@ -0,0 +1,142 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_buckets.h" +#define APR_WANT_MEMFUNC +#include "apr_want.h" + +static apr_status_t pool_bucket_cleanup(void *data) +{ + apr_bucket_pool *p = data; + + /* + * If the pool gets cleaned up, we have to copy the data out + * of the pool and onto the heap. But the apr_buckets out there + * that point to this pool bucket need to be notified such that + * they can morph themselves into a regular heap bucket the next + * time they try to read. To avoid having to manipulate + * reference counts and b->data pointers, the apr_bucket_pool + * actually _contains_ an apr_bucket_heap as its first element, + * so the two share their apr_bucket_refcount member, and you + * can typecast a pool bucket struct to make it look like a + * regular old heap bucket struct. + */ + p->heap.base = apr_bucket_alloc(p->heap.alloc_len, p->list); + memcpy(p->heap.base, p->base, p->heap.alloc_len); + p->base = NULL; + p->pool = NULL; + + return APR_SUCCESS; +} + +static apr_status_t pool_bucket_read(apr_bucket *b, const char **str, + apr_size_t *len, apr_read_type_e block) +{ + apr_bucket_pool *p = b->data; + const char *base = p->base; + + if (p->pool == NULL) { + /* + * pool has been cleaned up... masquerade as a heap bucket from now + * on. subsequent bucket operations will use the heap bucket code. + */ + b->type = &apr_bucket_type_heap; + base = p->heap.base; + } + *str = base + b->start; + *len = b->length; + return APR_SUCCESS; +} + +static void pool_bucket_destroy(void *data) +{ + apr_bucket_pool *p = data; + + /* If the pool is cleaned up before the last reference goes + * away, the data is really now on the heap; heap_destroy() takes + * over. free() in heap_destroy() thinks it's freeing + * an apr_bucket_heap, when in reality it's freeing the whole + * apr_bucket_pool for us. + */ + if (p->pool) { + /* the shared resource is still in the pool + * because the pool has not been cleaned up yet + */ + if (apr_bucket_shared_destroy(p)) { + apr_pool_cleanup_kill(p->pool, p, pool_bucket_cleanup); + apr_bucket_free(p); + } + } + else { + /* the shared resource is no longer in the pool, it's + * on the heap, but this reference still thinks it's a pool + * bucket. we should just go ahead and pass control to + * heap_destroy() for it since it doesn't know any better. + */ + apr_bucket_type_heap.destroy(p); + } +} + +APU_DECLARE(apr_bucket *) apr_bucket_pool_make(apr_bucket *b, + const char *buf, apr_size_t length, apr_pool_t *pool) +{ + apr_bucket_pool *p; + + p = apr_bucket_alloc(sizeof(*p), b->list); + + /* XXX: we lose the const qualifier here which indicates + * there's something screwy with the API... + */ + /* XXX: why is this? buf is const, p->base is const... what's + * the problem? --jcw */ + p->base = (char *) buf; + p->pool = pool; + p->list = b->list; + + b = apr_bucket_shared_make(b, p, 0, length); + b->type = &apr_bucket_type_pool; + + /* pre-initialize heap bucket member */ + p->heap.alloc_len = length; + p->heap.base = NULL; + p->heap.free_func = apr_bucket_free; + + apr_pool_cleanup_register(p->pool, p, pool_bucket_cleanup, + apr_pool_cleanup_null); + return b; +} + +APU_DECLARE(apr_bucket *) apr_bucket_pool_create(const char *buf, + apr_size_t length, + apr_pool_t *pool, + apr_bucket_alloc_t *list) +{ + apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); + + APR_BUCKET_INIT(b); + b->free = apr_bucket_free; + b->list = list; + return apr_bucket_pool_make(b, buf, length, pool); +} + +APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_pool = { + "POOL", 5, APR_BUCKET_DATA, + pool_bucket_destroy, + pool_bucket_read, + apr_bucket_setaside_noop, /* don't need to setaside thanks to the cleanup*/ + apr_bucket_shared_split, + apr_bucket_shared_copy +}; diff --git a/buckets/apr_buckets_refcount.c b/buckets/apr_buckets_refcount.c new file mode 100644 index 00000000000..0e765d94a2f --- /dev/null +++ b/buckets/apr_buckets_refcount.c @@ -0,0 +1,64 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_buckets.h" + +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_shared_split(apr_bucket *a, + apr_size_t point) +{ + apr_bucket_refcount *r = a->data; + apr_status_t rv; + + if ((rv = apr_bucket_simple_split(a, point)) != APR_SUCCESS) { + return rv; + } + r->refcount++; + + return APR_SUCCESS; +} + +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_shared_copy(apr_bucket *a, + apr_bucket **b) +{ + apr_bucket_refcount *r = a->data; + + apr_bucket_simple_copy(a, b); + r->refcount++; + + return APR_SUCCESS; +} + +APU_DECLARE(int) apr_bucket_shared_destroy(void *data) +{ + apr_bucket_refcount *r = data; + r->refcount--; + return (r->refcount == 0); +} + +APU_DECLARE(apr_bucket *) apr_bucket_shared_make(apr_bucket *b, void *data, + apr_off_t start, + apr_size_t length) +{ + apr_bucket_refcount *r = data; + + b->data = r; + b->start = start; + b->length = length; + /* caller initializes the type field */ + r->refcount = 1; + + return b; +} diff --git a/buckets/apr_buckets_simple.c b/buckets/apr_buckets_simple.c new file mode 100644 index 00000000000..cef748be79d --- /dev/null +++ b/buckets/apr_buckets_simple.c @@ -0,0 +1,137 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_buckets.h" + +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_simple_copy(apr_bucket *a, + apr_bucket **b) +{ + *b = apr_bucket_alloc(sizeof(**b), a->list); /* XXX: check for failure? */ + **b = *a; + + return APR_SUCCESS; +} + +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_simple_split(apr_bucket *a, + apr_size_t point) +{ + apr_bucket *b; + + if (point > a->length) { + return APR_EINVAL; + } + + apr_bucket_simple_copy(a, &b); + + a->length = point; + b->length -= point; + b->start += point; + + APR_BUCKET_INSERT_AFTER(a, b); + + return APR_SUCCESS; +} + +static apr_status_t simple_bucket_read(apr_bucket *b, const char **str, + apr_size_t *len, apr_read_type_e block) +{ + *str = (char *)b->data + b->start; + *len = b->length; + return APR_SUCCESS; +} + +APU_DECLARE(apr_bucket *) apr_bucket_immortal_make(apr_bucket *b, + const char *buf, + apr_size_t length) +{ + b->data = (char *)buf; + b->length = length; + b->start = 0; + b->type = &apr_bucket_type_immortal; + + return b; +} + +APU_DECLARE(apr_bucket *) apr_bucket_immortal_create(const char *buf, + apr_size_t length, + apr_bucket_alloc_t *list) +{ + apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); + + APR_BUCKET_INIT(b); + b->free = apr_bucket_free; + b->list = list; + return apr_bucket_immortal_make(b, buf, length); +} + +/* + * XXX: This function could do with some tweaking to reduce memory + * usage in various cases, e.g. share buffers in the heap between all + * the buckets that are set aside, or even spool set-aside data to + * disk if it gets too voluminous (but if it does then that's probably + * a bug elsewhere). There should probably be a apr_brigade_setaside() + * function that co-ordinates the action of all the bucket setaside + * functions to improve memory efficiency. + */ +static apr_status_t transient_bucket_setaside(apr_bucket *b, apr_pool_t *pool) +{ + b = apr_bucket_heap_make(b, (char *)b->data + b->start, b->length, NULL); + if (b == NULL) { + return APR_ENOMEM; + } + return APR_SUCCESS; +} + +APU_DECLARE(apr_bucket *) apr_bucket_transient_make(apr_bucket *b, + const char *buf, + apr_size_t length) +{ + b->data = (char *)buf; + b->length = length; + b->start = 0; + b->type = &apr_bucket_type_transient; + return b; +} + +APU_DECLARE(apr_bucket *) apr_bucket_transient_create(const char *buf, + apr_size_t length, + apr_bucket_alloc_t *list) +{ + apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); + + APR_BUCKET_INIT(b); + b->free = apr_bucket_free; + b->list = list; + return apr_bucket_transient_make(b, buf, length); +} + +const apr_bucket_type_t apr_bucket_type_immortal = { + "IMMORTAL", 5, APR_BUCKET_DATA, + apr_bucket_destroy_noop, + simple_bucket_read, + apr_bucket_setaside_noop, + apr_bucket_simple_split, + apr_bucket_simple_copy +}; + +APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_transient = { + "TRANSIENT", 5, APR_BUCKET_DATA, + apr_bucket_destroy_noop, + simple_bucket_read, + transient_bucket_setaside, + apr_bucket_simple_split, + apr_bucket_simple_copy +}; diff --git a/buckets/apr_buckets_socket.c b/buckets/apr_buckets_socket.c new file mode 100644 index 00000000000..68eae43befd --- /dev/null +++ b/buckets/apr_buckets_socket.c @@ -0,0 +1,114 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_buckets.h" + +static apr_status_t socket_bucket_read(apr_bucket *a, const char **str, + apr_size_t *len, apr_read_type_e block) +{ + apr_socket_t *p = a->data; + char *buf; + apr_status_t rv; + apr_interval_time_t timeout; + + if (block == APR_NONBLOCK_READ) { + apr_socket_timeout_get(p, &timeout); + apr_socket_timeout_set(p, 0); + } + + *str = NULL; + *len = APR_BUCKET_BUFF_SIZE; + buf = apr_bucket_alloc(*len, a->list); /* XXX: check for failure? */ + + rv = apr_socket_recv(p, buf, len); + + if (block == APR_NONBLOCK_READ) { + apr_socket_timeout_set(p, timeout); + } + + if (rv != APR_SUCCESS && rv != APR_EOF) { + apr_bucket_free(buf); + return rv; + } + /* + * If there's more to read we have to keep the rest of the socket + * for later. XXX: Note that more complicated bucket types that + * refer to data not in memory and must therefore have a read() + * function similar to this one should be wary of copying this + * code because if they have a destroy function they probably + * want to migrate the bucket's subordinate structure from the + * old bucket to a raw new one and adjust it as appropriate, + * rather than destroying the old one and creating a completely + * new bucket. + * + * Even if there is nothing more to read, don't close the socket here + * as we have to use it to send any response :) We could shut it + * down for reading, but there is no benefit to doing so. + */ + if (*len > 0) { + apr_bucket_heap *h; + /* Change the current bucket to refer to what we read */ + a = apr_bucket_heap_make(a, buf, *len, apr_bucket_free); + h = a->data; + h->alloc_len = APR_BUCKET_BUFF_SIZE; /* note the real buffer size */ + *str = buf; + APR_BUCKET_INSERT_AFTER(a, apr_bucket_socket_create(p, a->list)); + } + else { + apr_bucket_free(buf); + a = apr_bucket_immortal_make(a, "", 0); + *str = a->data; + } + return APR_SUCCESS; +} + +APU_DECLARE(apr_bucket *) apr_bucket_socket_make(apr_bucket *b, apr_socket_t *p) +{ + /* + * XXX: We rely on a cleanup on some pool or other to actually + * destroy the socket. We should probably explicitly call apr to + * destroy it instead. + * + * Note that typically the socket is allocated from the connection pool + * so it will disappear when the connection is finished. + */ + b->type = &apr_bucket_type_socket; + b->length = (apr_size_t)(-1); + b->start = -1; + b->data = p; + + return b; +} + +APU_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *p, + apr_bucket_alloc_t *list) +{ + apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); + + APR_BUCKET_INIT(b); + b->free = apr_bucket_free; + b->list = list; + return apr_bucket_socket_make(b, p); +} + +APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_socket = { + "SOCKET", 5, APR_BUCKET_DATA, + apr_bucket_destroy_noop, + socket_bucket_read, + apr_bucket_setaside_notimpl, + apr_bucket_split_notimpl, + apr_bucket_copy_notimpl +}; diff --git a/dbd/NWGNUdbdfreetds b/dbd/NWGNUdbdfreetds new file mode 100644 index 00000000000..6fe0639f1a9 --- /dev/null +++ b/dbd/NWGNUdbdfreetds @@ -0,0 +1,296 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +ifndef EnvironmentDefined +include $(APR_WORK)\build\NWGNUhead.inc +endif + +#include $(APR)\build\NWGNUcustom.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# LINK_STATIC = 1 + +# for now defined here - should finally go into build/NWGNUenvironment.inc +FREETDS_INC = $(FREETDSSDK)/include +FREETDS_IMP = $(FREETDSSDK)/lib/libfreetds.imp +FREETDS_LIB = $(FREETDSSDK)/lib/libfreetds.lib +FREETDS_NLM = libfreetds + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR)/include/arch/netware \ + $(APR)/include \ + $(APRUTIL)/include \ + $(APRUTIL)/include/private \ + $(APR) \ + $(FREETDS_INC) \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + -DAPU_HAVE_FREETDS=1 \ + -DAPU_DSO_MODULE_BUILD \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +ifdef LINK_STATIC +XLFLAGS += \ + -l $(FREETDSSDK)/lib \ + $(EOLIST) +endif + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = dbdfreetds + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Apache Portability Runtime Library $(VERSION_STR) DBD FreeTDS Driver Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = dbdfreetds + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)\$(NLM_NAME).nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/apr_dbd_freetds.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +ifeq ($(LINK_STATIC),1) +FILES_nlm_libs += \ + $(FREETDS_LIB) \ + $(EOLIST) +endif + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +ifneq ($(LINK_STATIC),1) +FILES_nlm_modules += \ + $(FREETDS_NLM) \ + $(EOLIST) +endif + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + $(EOLIST) + +ifneq ($(LINK_STATIC),1) +FILES_nlm_Ximports += \ + @$(FREETDS_IMP) \ + $(EOLIST) +endif + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + apr_dbd_freetds_driver \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + + + diff --git a/dbd/NWGNUdbdmysql b/dbd/NWGNUdbdmysql new file mode 100644 index 00000000000..151eb953bd6 --- /dev/null +++ b/dbd/NWGNUdbdmysql @@ -0,0 +1,297 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +ifndef EnvironmentDefined +include $(APR_WORK)\build\NWGNUhead.inc +endif + +#include $(APR)\build\NWGNUcustom.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# LINK_STATIC = 1 + +# for now defined here - should finally go into build/NWGNUenvironment.inc +MYSQL_INC = $(MYSQLSDK)/include +MYSQL_IMP = $(MYSQLSDK)/lib/libmysql.imp +MYSQL_LIB = $(MYSQLSDK)/lib/libmysqlclient_r.lib $(MYSQLSDK)/lib/libz.lib +MYSQL_NLM = libmysql + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR)/include/arch/netware \ + $(APR)/include \ + $(APRUTIL)/include \ + $(APRUTIL)/include/private \ + $(APR) \ + $(MYSQL_INC) \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + -DAPU_DSO_MODULE_BUILD \ + -DAPU_HAVE_MYSQL=1 \ + -DHAVE_MYSQL_H \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +ifdef LINK_STATIC +XLFLAGS += \ + -l $(MYSQLSDK)/lib \ + $(EOLIST) +endif + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = dbdmysql + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Apache Portability Runtime Library $(VERSION_STR) DBD MySQL Driver Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = dbdmysql + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)\$(NLM_NAME).nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/apr_dbd_mysql.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +ifeq ($(LINK_STATIC),1) +FILES_nlm_libs += \ + $(MYSQL_LIB) \ + $(EOLIST) +endif + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +ifneq ($(LINK_STATIC),1) +FILES_nlm_modules += \ + $(MYSQL_NLM) \ + $(EOLIST) +endif + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + $(EOLIST) + +ifneq ($(LINK_STATIC),1) +FILES_nlm_Ximports += \ + @$(MYSQL_IMP) \ + $(EOLIST) +endif + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + apr_dbd_mysql_driver \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + + + diff --git a/dbd/NWGNUdbdpgsql b/dbd/NWGNUdbdpgsql new file mode 100644 index 00000000000..8e48529f3b5 --- /dev/null +++ b/dbd/NWGNUdbdpgsql @@ -0,0 +1,297 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +ifndef EnvironmentDefined +include $(APR_WORK)\build\NWGNUhead.inc +endif + +#include $(APR)\build\NWGNUcustom.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# LINK_STATIC = 1 + +# for now defined here - should finally go into build/NWGNUenvironment.inc +PGSQL_INC = $(PGSQLSDK)/inc +PGSQL_IMP = $(PGSQLSDK)/imp/libpq.imp +PGSQL_LIB = $(PGSQLSDK)/lib/libpq.lib +PGSQL_NLM = libpq + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR)/include/arch/netware \ + $(APR)/include \ + $(APRUTIL)/include \ + $(APRUTIL)/include/private \ + $(APR) \ + $(PGSQL_INC) \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + -DAPU_DSO_MODULE_BUILD \ + -DAPU_HAVE_PGSQL=1 \ + -DHAVE_LIBPQ_FE_H \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +ifdef LINK_STATIC +XLFLAGS += \ + -l $(PGSQLSDK)/lib \ + $(EOLIST) +endif + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = dbdpgsql + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Apache Portability Runtime Library $(VERSION_STR) DBD PostgreSQL Driver Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = dbdpgsql + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)\$(NLM_NAME).nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/apr_dbd_pgsql.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +ifeq ($(LINK_STATIC),1) +FILES_nlm_libs += \ + $(PGSQL_LIB) \ + $(EOLIST) +endif + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +ifneq ($(LINK_STATIC),1) +FILES_nlm_modules += \ + $(PGSQL_NLM) \ + $(EOLIST) +endif + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + $(EOLIST) + +ifneq ($(LINK_STATIC),1) +FILES_nlm_Ximports += \ + @$(PGSQL_IMP) \ + $(EOLIST) +endif + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + apr_dbd_pgsql_driver \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + + + diff --git a/dbd/NWGNUdbdsqli2 b/dbd/NWGNUdbdsqli2 new file mode 100644 index 00000000000..b9dff276a28 --- /dev/null +++ b/dbd/NWGNUdbdsqli2 @@ -0,0 +1,296 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +ifndef EnvironmentDefined +include $(APR_WORK)\build\NWGNUhead.inc +endif + +#include $(APR)\build\NWGNUcustom.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# LINK_STATIC = 1 + +# for now defined here - should finally go into build/NWGNUenvironment.inc +SQLITE2_INC = $(SQLITE2SDK)/src +SQLITE2_IMP = $(SQLITE2SDK)/lsqlite2.imp +SQLITE2_LIB = $(SQLITE2SDK)/lsqlite2.lib +SQLITE2_NLM = lsqlite2 + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR)/include/arch/netware \ + $(APR)/include \ + $(APRUTIL)/include \ + $(APRUTIL)/include/private \ + $(APR) \ + $(SQLITE2_INC) \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + -DAPU_DSO_MODULE_BUILD \ + -DAPU_HAVE_SQLITE2=1 \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +ifdef LINK_STATIC +XLFLAGS += \ + -l $(SQLITE2SDK) \ + $(EOLIST) +endif + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = dbdsqli2 + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Apache Portability Runtime Library $(VERSION_STR) DBD SQLite2 Driver Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = dbdsqli2 + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)\$(NLM_NAME).nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/apr_dbd_sqlite2.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +ifeq ($(LINK_STATIC),1) +FILES_nlm_libs += \ + $(SQLITE2_LIB) \ + $(EOLIST) +endif + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +ifneq ($(LINK_STATIC),1) +FILES_nlm_modules += \ + $(SQLITE2_NLM) \ + $(EOLIST) +endif + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + $(EOLIST) + +ifneq ($(LINK_STATIC),1) +FILES_nlm_Ximports += \ + @$(SQLITE2_IMP) \ + $(EOLIST) +endif + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + apr_dbd_sqlite2_driver \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + + + diff --git a/dbd/NWGNUdbdsqli3 b/dbd/NWGNUdbdsqli3 new file mode 100644 index 00000000000..7a948586194 --- /dev/null +++ b/dbd/NWGNUdbdsqli3 @@ -0,0 +1,298 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +ifndef EnvironmentDefined +include $(APR_WORK)\build\NWGNUhead.inc +endif + +#include $(APR)\build\NWGNUcustom.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# LINK_STATIC = 1 + +# for now defined here - should finally go into build/NWGNUenvironment.inc +SQLITE3_INC = $(SQLITE3SDK)/src +SQLITE3_IMP = $(SQLITE3SDK)/lsqlite3.imp +SQLITE3_LIB = $(SQLITE3SDK)/lsqlite3.lib +SQLITE3_NLM = lsqlite3 + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR)/include/arch/netware \ + $(APR)/include \ + $(APRUTIL)/include \ + $(APRUTIL)/include/private \ + $(APR) \ + $(SQLITE3_INC) \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + -DAPU_DSO_MODULE_BUILD \ + -DAPU_HAVE_SQLITE3=1 \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +ifdef LINK_STATIC +XLFLAGS += \ + -l $(SQLITE3SDK) \ + $(EOLIST) +endif + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = dbdsqli3 + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Apache Portability Runtime Library $(VERSION_STR) DBD SQLite3 Driver Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = dbdsqli3 + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)\$(NLM_NAME).nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/apr_dbd_sqlite3.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +ifeq ($(LINK_STATIC),1) +FILES_nlm_libs += \ + $(SQLITE3_LIB) \ + $(EOLIST) +endif + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +ifneq ($(LINK_STATIC),1) +FILES_nlm_modules += \ + $(SQLITE3_NLM) \ + $(EOLIST) +endif + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + apr_dbd_mutex_lock \ + apr_dbd_mutex_unlock \ + $(EOLIST) + +ifneq ($(LINK_STATIC),1) +FILES_nlm_Ximports += \ + @$(SQLITE3_IMP) \ + $(EOLIST) +endif + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + apr_dbd_sqlite3_driver \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + + + diff --git a/dbd/NWGNUmakefile b/dbd/NWGNUmakefile new file mode 100644 index 00000000000..fb4b9ad7d39 --- /dev/null +++ b/dbd/NWGNUmakefile @@ -0,0 +1,262 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(APR_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(EOLIST) + +ifeq "$(APU_HAVE_MYSQL)" "1" +ifeq "$(wildcard apr_dbd_mysql.c)" "apr_dbd_mysql.c" +TARGET_nlm += $(OBJDIR)/dbdmysql.nlm $(OBJDIR)/dbdmysql.nlm $(EOLIST) +endif +endif +ifeq "$(APU_HAVE_PGSQL)" "1" +TARGET_nlm += $(OBJDIR)/dbdpgsql.nlm $(OBJDIR)/dbdpgsql.nlm $(EOLIST) +endif +ifeq "$(APU_HAVE_SQLITE2)" "1" +TARGET_nlm += $(OBJDIR)/dbdsqli2.nlm $(OBJDIR)/dbdsqli2.nlm $(EOLIST) +endif +ifeq "$(APU_HAVE_SQLITE3)" "1" +TARGET_nlm += $(OBJDIR)/dbdsqli3.nlm $(OBJDIR)/dbdsqli3.nlm $(EOLIST) +endif +ifeq "$(APU_HAVE_FREETDS)" "1" +TARGET_nlm += $(OBJDIR)/dbdfreetds.nlm $(OBJDIR)/dbdfreetds.nlm $(EOLIST) +endif + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms $(INSTDIRS) FORCE + copy $(OBJDIR)\*.nlm $(INSTALLBASE) + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + + diff --git a/dbd/apr_dbd.c b/dbd/apr_dbd.c new file mode 100644 index 00000000000..7dc30992698 --- /dev/null +++ b/dbd/apr_dbd.c @@ -0,0 +1,565 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "apu_config.h" +#include "apu.h" + +#include "apr_pools.h" +#include "apr_dso.h" +#include "apr_strings.h" +#include "apr_hash.h" +#include "apr_thread_mutex.h" +#include "apr_lib.h" + +#include "apu_internal.h" +#include "apr_dbd_internal.h" +#include "apr_dbd.h" +#include "apu_version.h" + +static apr_hash_t *drivers = NULL; + +#define CLEANUP_CAST (apr_status_t (*)(void*)) + +#if APR_HAS_THREADS +/* deprecated, but required for existing providers. Existing and new + * providers should be refactored to use a provider-specific mutex so + * that different providers do not block one another. + * In APR 1.3 this is no longer used for dso module loading, and + * apu_dso_mutex_[un]lock is used instead. + * In APR 2.0 this should become entirely local to libaprutil-2.so and + * no longer be exported. + */ +static apr_thread_mutex_t* mutex = NULL; +APU_DECLARE(apr_status_t) apr_dbd_mutex_lock() +{ + return apr_thread_mutex_lock(mutex); +} +APU_DECLARE(apr_status_t) apr_dbd_mutex_unlock() +{ + return apr_thread_mutex_unlock(mutex); +} +#else +APU_DECLARE(apr_status_t) apr_dbd_mutex_lock() { + return APR_SUCCESS; +} +APU_DECLARE(apr_status_t) apr_dbd_mutex_unlock() { + return APR_SUCCESS; +} +#endif + +#if !APU_DSO_BUILD +#define DRIVER_LOAD(name,driver,pool) \ + { \ + extern const apr_dbd_driver_t driver; \ + apr_hash_set(drivers,name,APR_HASH_KEY_STRING,&driver); \ + if (driver.init) { \ + driver.init(pool); \ + } \ + } +#endif + +static apr_status_t apr_dbd_term(void *ptr) +{ + /* set drivers to NULL so init can work again */ + drivers = NULL; + + /* Everything else we need is handled by cleanups registered + * when we created mutexes and loaded DSOs + */ + return APR_SUCCESS; +} + +APU_DECLARE(apr_status_t) apr_dbd_init(apr_pool_t *pool) +{ + apr_status_t ret = APR_SUCCESS; + apr_pool_t *parent; + + if (drivers != NULL) { + return APR_SUCCESS; + } + + /* Top level pool scope, need process-scope lifetime */ + for (parent = pool; parent; parent = apr_pool_parent_get(pool)) + pool = parent; +#if APU_DSO_BUILD + /* deprecate in 2.0 - permit implicit initialization */ + apu_dso_init(pool); +#endif + + drivers = apr_hash_make(pool); + +#if APR_HAS_THREADS + ret = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, pool); + /* This already registers a pool cleanup */ +#endif + +#if !APU_DSO_BUILD + + /* Load statically-linked drivers: */ +#if APU_HAVE_MYSQL + DRIVER_LOAD("mysql", apr_dbd_mysql_driver, pool); +#endif +#if APU_HAVE_PGSQL + DRIVER_LOAD("pgsql", apr_dbd_pgsql_driver, pool); +#endif +#if APU_HAVE_SQLITE3 + DRIVER_LOAD("sqlite3", apr_dbd_sqlite3_driver, pool); +#endif +#if APU_HAVE_SQLITE2 + DRIVER_LOAD("sqlite2", apr_dbd_sqlite2_driver, pool); +#endif +#if APU_HAVE_ORACLE + DRIVER_LOAD("oracle", apr_dbd_oracle_driver, pool); +#endif +#if APU_HAVE_FREETDS + DRIVER_LOAD("freetds", apr_dbd_freetds_driver, pool); +#endif +#if APU_HAVE_ODBC + DRIVER_LOAD("odbc", apr_dbd_odbc_driver, pool); +#endif +#if APU_HAVE_SOME_OTHER_BACKEND + DRIVER_LOAD("firebird", apr_dbd_other_driver, pool); +#endif +#endif /* APU_DSO_BUILD */ + + apr_pool_cleanup_register(pool, NULL, apr_dbd_term, + apr_pool_cleanup_null); + + return ret; +} + +APU_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name, + const apr_dbd_driver_t **driver) +{ +#if APU_DSO_BUILD + char modname[32]; + char symname[34]; + apr_dso_handle_sym_t symbol; +#endif + apr_status_t rv; + +#if APU_DSO_BUILD + rv = apu_dso_mutex_lock(); + if (rv) { + return rv; + } +#endif + *driver = apr_hash_get(drivers, name, APR_HASH_KEY_STRING); + if (*driver) { +#if APU_DSO_BUILD + apu_dso_mutex_unlock(); +#endif + return APR_SUCCESS; + } + +#if APU_DSO_BUILD + /* The driver DSO must have exactly the same lifetime as the + * drivers hash table; ignore the passed-in pool */ + pool = apr_hash_pool_get(drivers); + +#if defined(NETWARE) + apr_snprintf(modname, sizeof(modname), "dbd%s.nlm", name); +#elif defined(WIN32) + apr_snprintf(modname, sizeof(modname), + "apr_dbd_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", name); +#else + apr_snprintf(modname, sizeof(modname), + "apr_dbd_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".so", name); +#endif + apr_snprintf(symname, sizeof(symname), "apr_dbd_%s_driver", name); + rv = apu_dso_load(NULL, &symbol, modname, symname, pool); + if (rv == APR_SUCCESS || rv == APR_EINIT) { /* previously loaded?!? */ + *driver = symbol; + name = apr_pstrdup(pool, name); + apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver); + rv = APR_SUCCESS; + if ((*driver)->init) { + (*driver)->init(pool); + } + } + apu_dso_mutex_unlock(); + +#else /* not builtin and !APR_HAS_DSO => not implemented */ + rv = APR_ENOTIMPL; +#endif + + return rv; +} + +APU_DECLARE(apr_status_t) apr_dbd_open_ex(const apr_dbd_driver_t *driver, + apr_pool_t *pool, const char *params, + apr_dbd_t **handle, + const char **error) +{ + apr_status_t rv; + *handle = (driver->open)(pool, params, error); + if (*handle == NULL) { + return APR_EGENERAL; + } + rv = apr_dbd_check_conn(driver, pool, *handle); + if ((rv != APR_SUCCESS) && (rv != APR_ENOTIMPL)) { + /* XXX: rv is APR error code, but apr_dbd_error() takes int! */ + if (error) { + *error = apr_dbd_error(driver, *handle, rv); + } + apr_dbd_close(driver, *handle); + return APR_EGENERAL; + } + return APR_SUCCESS; +} + +APU_DECLARE(apr_status_t) apr_dbd_open(const apr_dbd_driver_t *driver, + apr_pool_t *pool, const char *params, + apr_dbd_t **handle) +{ + return apr_dbd_open_ex(driver,pool,params,handle,NULL); +} + +APU_DECLARE(int) apr_dbd_transaction_start(const apr_dbd_driver_t *driver, + apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_transaction_t **trans) +{ + int ret = driver->start_transaction(pool, handle, trans); + if (*trans) { + apr_pool_cleanup_register(pool, *trans, + CLEANUP_CAST driver->end_transaction, + apr_pool_cleanup_null); + } + return ret; +} + +APU_DECLARE(int) apr_dbd_transaction_end(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_transaction_t *trans) +{ + apr_pool_cleanup_kill(pool, trans, CLEANUP_CAST driver->end_transaction); + return driver->end_transaction(trans); +} + +APU_DECLARE(int) apr_dbd_transaction_mode_get(const apr_dbd_driver_t *driver, + apr_dbd_transaction_t *trans) +{ + return driver->transaction_mode_get(trans); +} + +APU_DECLARE(int) apr_dbd_transaction_mode_set(const apr_dbd_driver_t *driver, + apr_dbd_transaction_t *trans, + int mode) +{ + return driver->transaction_mode_set(trans, mode); +} + +APU_DECLARE(apr_status_t) apr_dbd_close(const apr_dbd_driver_t *driver, + apr_dbd_t *handle) +{ + return driver->close(handle); +} + +APU_DECLARE(const char*) apr_dbd_name(const apr_dbd_driver_t *driver) +{ + return driver->name; +} + +APU_DECLARE(void*) apr_dbd_native_handle(const apr_dbd_driver_t *driver, + apr_dbd_t *handle) +{ + return driver->native_handle(handle); +} + +APU_DECLARE(int) apr_dbd_check_conn(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_t *handle) +{ + return driver->check_conn(pool, handle); +} + +APU_DECLARE(int) apr_dbd_set_dbname(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_t *handle, const char *name) +{ + return driver->set_dbname(pool,handle,name); +} + +APU_DECLARE(int) apr_dbd_query(const apr_dbd_driver_t *driver, + apr_dbd_t *handle, + int *nrows, const char *statement) +{ + return driver->query(handle,nrows,statement); +} + +APU_DECLARE(int) apr_dbd_select(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_t *handle, apr_dbd_results_t **res, + const char *statement, int random) +{ + return driver->select(pool,handle,res,statement,random); +} + +APU_DECLARE(int) apr_dbd_num_cols(const apr_dbd_driver_t *driver, + apr_dbd_results_t *res) +{ + return driver->num_cols(res); +} + +APU_DECLARE(int) apr_dbd_num_tuples(const apr_dbd_driver_t *driver, + apr_dbd_results_t *res) +{ + return driver->num_tuples(res); +} + +APU_DECLARE(int) apr_dbd_get_row(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_results_t *res, apr_dbd_row_t **row, + int rownum) +{ + return driver->get_row(pool,res,row,rownum); +} + +APU_DECLARE(const char*) apr_dbd_get_entry(const apr_dbd_driver_t *driver, + apr_dbd_row_t *row, int col) +{ + return driver->get_entry(row,col); +} + +APU_DECLARE(const char*) apr_dbd_get_name(const apr_dbd_driver_t *driver, + apr_dbd_results_t *res, int col) +{ + return driver->get_name(res,col); +} + +APU_DECLARE(const char*) apr_dbd_error(const apr_dbd_driver_t *driver, + apr_dbd_t *handle, int errnum) +{ + return driver->error(handle,errnum); +} + +APU_DECLARE(const char*) apr_dbd_escape(const apr_dbd_driver_t *driver, + apr_pool_t *pool, const char *string, + apr_dbd_t *handle) +{ + return driver->escape(pool,string,handle); +} + +APU_DECLARE(int) apr_dbd_prepare(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_t *handle, const char *query, + const char *label, + apr_dbd_prepared_t **statement) +{ + size_t qlen; + int i, nargs = 0, nvals = 0; + char *p, *pq; + const char *q; + apr_dbd_type_e *t; + + if (!driver->pformat) { + return APR_ENOTIMPL; + } + + /* find the number of parameters in the query */ + for (q = query; *q; q++) { + if (q[0] == '%') { + if (apr_isalpha(q[1])) { + nargs++; + } else if (q[1] == '%') { + q++; + } + } + } + nvals = nargs; + + qlen = strlen(query) + + nargs * (strlen(driver->pformat) + sizeof(nargs) * 3 + 2) + 1; + pq = apr_palloc(pool, qlen); + t = apr_pcalloc(pool, sizeof(*t) * nargs); + + for (p = pq, q = query, i = 0; *q; q++) { + if (q[0] == '%') { + if (apr_isalpha(q[1])) { + switch (q[1]) { + case 'd': t[i] = APR_DBD_TYPE_INT; break; + case 'u': t[i] = APR_DBD_TYPE_UINT; break; + case 'f': t[i] = APR_DBD_TYPE_FLOAT; break; + case 'h': + switch (q[2]) { + case 'h': + switch (q[3]){ + case 'd': t[i] = APR_DBD_TYPE_TINY; q += 2; break; + case 'u': t[i] = APR_DBD_TYPE_UTINY; q += 2; break; + } + break; + case 'd': t[i] = APR_DBD_TYPE_SHORT; q++; break; + case 'u': t[i] = APR_DBD_TYPE_USHORT; q++; break; + } + break; + case 'l': + switch (q[2]) { + case 'l': + switch (q[3]){ + case 'd': t[i] = APR_DBD_TYPE_LONGLONG; q += 2; break; + case 'u': t[i] = APR_DBD_TYPE_ULONGLONG; q += 2; break; + } + break; + case 'd': t[i] = APR_DBD_TYPE_LONG; q++; break; + case 'u': t[i] = APR_DBD_TYPE_ULONG; q++; break; + case 'f': t[i] = APR_DBD_TYPE_DOUBLE; q++; break; + } + break; + case 'p': + if (q[2] == 'D') { + switch (q[3]) { + case 't': t[i] = APR_DBD_TYPE_TEXT; q += 2; break; + case 'i': t[i] = APR_DBD_TYPE_TIME; q += 2; break; + case 'd': t[i] = APR_DBD_TYPE_DATE; q += 2; break; + case 'a': t[i] = APR_DBD_TYPE_DATETIME; q += 2; break; + case 's': t[i] = APR_DBD_TYPE_TIMESTAMP; q += 2; break; + case 'z': t[i] = APR_DBD_TYPE_ZTIMESTAMP; q += 2; break; + case 'b': t[i] = APR_DBD_TYPE_BLOB; q += 2; break; + case 'c': t[i] = APR_DBD_TYPE_CLOB; q += 2; break; + case 'n': t[i] = APR_DBD_TYPE_NULL; q += 2; break; + } + } + break; + } + q++; + + switch (t[i]) { + case APR_DBD_TYPE_NONE: /* by default, we expect strings */ + t[i] = APR_DBD_TYPE_STRING; + break; + case APR_DBD_TYPE_BLOB: + case APR_DBD_TYPE_CLOB: /* three (3) more values passed in */ + nvals += 3; + break; + default: + break; + } + + /* insert database specific parameter reference */ + p += apr_snprintf(p, qlen - (p - pq), driver->pformat, ++i); + } else if (q[1] == '%') { /* reduce %% to % */ + *p++ = *q++; + } else { + *p++ = *q; + } + } else { + *p++ = *q; + } + } + *p = '\0'; + + return driver->prepare(pool,handle,pq,label,nargs,nvals,t,statement); +} + +APU_DECLARE(int) apr_dbd_pquery(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement, + int nargs, const char **args) +{ + return driver->pquery(pool,handle,nrows,statement,args); +} + +APU_DECLARE(int) apr_dbd_pselect(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_t *handle, apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, int random, + int nargs, const char **args) +{ + return driver->pselect(pool,handle,res,statement,random,args); +} + +APU_DECLARE_NONSTD(int) apr_dbd_pvquery(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement, ...) +{ + int ret; + va_list args; + va_start(args, statement); + ret = driver->pvquery(pool,handle,nrows,statement,args); + va_end(args); + return ret; +} + +APU_DECLARE_NONSTD(int) apr_dbd_pvselect(const apr_dbd_driver_t *driver, + apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, + int random, ...) +{ + int ret; + va_list args; + va_start(args, random); + ret = driver->pvselect(pool,handle,res,statement,random,args); + va_end(args); + return ret; +} + +APU_DECLARE(int) apr_dbd_pbquery(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement, + const void **args) +{ + return driver->pbquery(pool,handle,nrows,statement,args); +} + +APU_DECLARE(int) apr_dbd_pbselect(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_t *handle, apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, int random, + const void **args) +{ + return driver->pbselect(pool,handle,res,statement,random,args); +} + +APU_DECLARE_NONSTD(int) apr_dbd_pvbquery(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement, ...) +{ + int ret; + va_list args; + va_start(args, statement); + ret = driver->pvbquery(pool,handle,nrows,statement,args); + va_end(args); + return ret; +} + +APU_DECLARE_NONSTD(int) apr_dbd_pvbselect(const apr_dbd_driver_t *driver, + apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, + int random, ...) +{ + int ret; + va_list args; + va_start(args, random); + ret = driver->pvbselect(pool,handle,res,statement,random,args); + va_end(args); + return ret; +} + +APU_DECLARE(apr_status_t) apr_dbd_datum_get(const apr_dbd_driver_t *driver, + apr_dbd_row_t *row, int col, + apr_dbd_type_e type, void *data) +{ + return driver->datum_get(row,col,type,data); +} diff --git a/dbd/apr_dbd_freetds.c b/dbd/apr_dbd_freetds.c new file mode 100644 index 00000000000..9a0cae7939a --- /dev/null +++ b/dbd/apr_dbd_freetds.c @@ -0,0 +1,805 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apu.h" +#include "apu_config.h" + +/* COMPILE_STUBS: compile stubs for unimplemented functions. + * + * This is required to compile in /trunk/, but can be + * undefined to compile a driver for httpd-2.2 and other + * APR-1.2 applications + */ +#define COMPILE_STUBS + +#if APU_HAVE_FREETDS + +#include +#include + +#include "apr_strings.h" +#include "apr_lib.h" + +#include "apr_pools.h" +#include "apr_dbd_internal.h" + +#ifdef HAVE_FREETDS_SYBDB_H +#include +#endif +#ifdef HAVE_SYBDB_H +#include +#endif + +#include +#include +#include + +/* This probably needs to change for different applications */ +#define MAX_COL_LEN 256 + +typedef struct freetds_cell_t { + int type; + DBINT len; + BYTE *data; +} freetds_cell_t; + +struct apr_dbd_transaction_t { + int mode; + int errnum; + apr_dbd_t *handle; +}; + +struct apr_dbd_t { + DBPROCESS *proc; + apr_dbd_transaction_t *trans; + apr_pool_t *pool; + const char *params; + RETCODE err; +}; + +struct apr_dbd_results_t { + int random; + size_t ntuples; + size_t sz; + apr_pool_t *pool; + DBPROCESS *proc; +}; + +struct apr_dbd_row_t { + apr_dbd_results_t *res; + BYTE buf[MAX_COL_LEN]; +}; + +struct apr_dbd_prepared_t { + int nargs; + regex_t **taint; + int *sz; + char *fmt; +}; + +#define dbd_freetds_is_success(x) (x == SUCCEED) + +static int labelnum = 0; /* FIXME */ +static regex_t dbd_freetds_find_arg; + +/* execute a query that doesn't return a result set, mop up, + * and return and APR-flavoured status + */ +static RETCODE freetds_exec(DBPROCESS *proc, const char *query, + int want_results, int *nrows) +{ + /* TBD */ + RETCODE rv = dbcmd(proc, query); + if (rv != SUCCEED) { + return rv; + } + rv = dbsqlexec(proc); + if (rv != SUCCEED) { + return rv; + } + if (!want_results) { + while (dbresults(proc) != NO_MORE_RESULTS) { + ++*nrows; + } + } + return SUCCEED; +} +static apr_status_t clear_result(void *data) +{ + /* clear cursor */ + return (dbcanquery((DBPROCESS*)data) == SUCCEED) + ? APR_SUCCESS + : APR_EGENERAL; +} + +static int dbd_freetds_select(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + const char *query, int seek) +{ + apr_dbd_results_t *res; + if (sql->trans && (sql->trans->errnum != SUCCEED)) { + return 1; + } + /* the core of this is + * dbcmd(proc, query); + * dbsqlexec(proc); + * while (dbnextrow(dbproc) != NO_MORE_ROWS) { + * do things + * } + * + * Ignore seek + */ + + sql->err = freetds_exec(sql->proc, query, 1, NULL); + if (!dbd_freetds_is_success(sql->err)) { + if (sql->trans) { + sql->trans->errnum = sql->err; + } + return 1; + } + + sql->err = dbresults(sql->proc); + if (sql->err != SUCCEED) { + if (sql->trans) { + sql->trans->errnum = sql->err; + } + return 1; + } + + if (!*results) { + *results = apr_pcalloc(pool, sizeof(apr_dbd_results_t)); + } + res = *results; + res->proc = sql->proc; + res->random = seek; + res->pool = pool; + res->ntuples = dblastrow(sql->proc); + res->sz = dbnumcols(sql->proc); + apr_pool_cleanup_register(pool, sql->proc, clear_result, + apr_pool_cleanup_null); + +#if 0 + /* Now we have a result set. We need to bind to its vars */ + res->vars = apr_palloc(pool, res->sz * sizeof(freetds_cell_t*)); + for (i=1; i <= res->sz; ++i) { + freetds_cell_t *cell = &res->vars[i-1]; + cell->type = dbcoltype(sql->proc, i); + cell->len = dbcollen(sql->proc, i); + cell->data = apr_palloc(pool, cell->len); + sql->err = dbbind(sql->proc, i, /*cell->type */ STRINGBIND, cell->len, cell->data); + if (sql->err != SUCCEED) { + fprintf(stderr, "dbbind error: %d, %d, %d", i, cell->type, cell->len); + } + if ((sql->err != SUCCEED) && (sql->trans != NULL)) { + sql->trans->errnum = sql->err; + } + } +#endif + return (sql->err == SUCCEED) ? 0 : 1; +} +static const char *dbd_untaint(apr_pool_t *pool, regex_t *rx, const char *val) +{ + regmatch_t match[1]; + if (rx == NULL) { + /* no untaint expression */ + return val; + } + if (regexec(rx, val, 1, match, 0) == 0) { + return apr_pstrndup(pool, val+match[0].rm_so, + match[0].rm_eo - match[0].rm_so); + } + return ""; +} +static const char *dbd_statement(apr_pool_t *pool, + apr_dbd_prepared_t *stmt, + int nargs, const char **args) +{ + int i; + int len; + const char *var; + char *ret; + const char *p_in; + char *p_out; + char *q; + + /* compute upper bound on length (since untaint shrinks) */ + len = strlen(stmt->fmt) +1; + for (i=0; ifmt; + p_out = ret = apr_palloc(pool, len); + /* FIXME silly bug - this'll catch %%s */ + while (q = strstr(p_in, "%s"), q != NULL) { + len = q-p_in; + strncpy(p_out, p_in, len); + p_in += len; + p_out += len; + var = dbd_untaint(pool, stmt->taint[i], args[i]); + len = strlen(var); + strncpy(p_out, var, len); + p_in += 2; + p_out += len; + ++i; + } + strcpy(p_out, p_in); + return ret; +} +static int dbd_freetds_pselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + apr_dbd_prepared_t *statement, + int seek, const char **values) +{ + const char *query = dbd_statement(pool, statement, + statement->nargs, values); + return dbd_freetds_select(pool, sql, results, query, seek); +} +static int dbd_freetds_pvselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + apr_dbd_prepared_t *statement, + int seek, va_list args) +{ + const char **values; + int i; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nargs); + + for (i = 0; i < statement->nargs; i++) { + values[i] = va_arg(args, const char*); + } + + return dbd_freetds_pselect(pool, sql, results, statement, seek, values); +} +static int dbd_freetds_query(apr_dbd_t *sql, int *nrows, const char *query); +static int dbd_freetds_pquery(apr_pool_t *pool, apr_dbd_t *sql, + int *nrows, apr_dbd_prepared_t *statement, + const char **values) +{ + const char *query = dbd_statement(pool, statement, + statement->nargs, values); + return dbd_freetds_query(sql, nrows, query); +} +static int dbd_freetds_pvquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows, + apr_dbd_prepared_t *statement, va_list args) +{ + const char **values; + int i; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nargs); + + for (i = 0; i < statement->nargs; i++) { + values[i] = va_arg(args, const char*); + } + return dbd_freetds_pquery(pool, sql, nrows, statement, values); +} + +static int dbd_freetds_get_row(apr_pool_t *pool, apr_dbd_results_t *res, + apr_dbd_row_t **rowp, int rownum) +{ + RETCODE rv = 0; + apr_dbd_row_t *row = *rowp; + int sequential = ((rownum >= 0) && res->random) ? 0 : 1; + + if (row == NULL) { + row = apr_palloc(pool, sizeof(apr_dbd_row_t)); + *rowp = row; + row->res = res; + } + /* + else { + if ( sequential ) { + ++row->n; + } + else { + row->n = rownum; + } + } + */ + if (sequential) { + rv = dbnextrow(res->proc); + } + else { + rv = (rownum >= 0) ? dbgetrow(res->proc, rownum) : NO_MORE_ROWS; + } + switch (rv) { + case SUCCEED: return 0; + case REG_ROW: return 0; + case NO_MORE_ROWS: + apr_pool_cleanup_run(pool, res->proc, clear_result); + *rowp = NULL; + return -1; + case FAIL: return 1; + case BUF_FULL: return 2; /* FIXME */ + default: return 3; + } + + return 0; +} + +static const char *dbd_freetds_get_entry(const apr_dbd_row_t *row, int n) +{ + /* FIXME: support different data types */ + /* this fails - bind gets some vars but not others + return (const char*)row->res->vars[n].data; + */ + DBPROCESS* proc = row->res->proc; + BYTE *ptr = dbdata(proc, n+1); + int t = dbcoltype(proc, n+1); + int l = dbcollen(proc, n+1); + if (dbwillconvert(t, SYBCHAR)) { + dbconvert(proc, t, ptr, l, SYBCHAR, (BYTE *)row->buf, -1); + return (const char*)row->buf; + } + return (char*)ptr; +} + +static const char *dbd_freetds_error(apr_dbd_t *sql, int n) +{ + /* XXX this doesn't seem to exist in the API ??? */ + return apr_psprintf(sql->pool, "Error %d", sql->err); +} + +static int dbd_freetds_query(apr_dbd_t *sql, int *nrows, const char *query) +{ + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + *nrows = 0; + sql->err = freetds_exec(sql->proc, query, 0, nrows); + + if (sql->err != SUCCEED) { + if (sql->trans) { + sql->trans->errnum = sql->err; + } + return 1; + } + return 0; +} + +static const char *dbd_freetds_escape(apr_pool_t *pool, const char *arg, + apr_dbd_t *sql) +{ + return arg; +} + +static apr_status_t freetds_regfree(void *rx) +{ + regfree((regex_t*)rx); + return APR_SUCCESS; +} +static int recurse_args(apr_pool_t *pool, int n, const char *query, + apr_dbd_prepared_t *stmt, int offs) +{ + + /* we only support %s arguments for now */ + int ret; + char arg[256]; + regmatch_t matches[3]; + if (regexec(&dbd_freetds_find_arg, query, 3, matches, 0) != 0) { + /* No more args */ + stmt->nargs = n; + stmt->taint = apr_palloc(pool, n*sizeof(regex_t*)); + stmt->sz = apr_palloc(pool, n*sizeof(int)); + ret = 0; + } + else { + int i; + int sz = 0; + int len = matches[1].rm_eo - matches[1].rm_so - 2; + if (len > 255) { + return 9999; + } + + ret = recurse_args(pool, n+1, query+matches[0].rm_eo, + stmt, offs+matches[0].rm_eo); + + memmove(stmt->fmt + offs + matches[1].rm_so, + stmt->fmt + offs + matches[0].rm_eo-1, + strlen(stmt->fmt+offs+matches[0].rm_eo)+2); + + /* compile untaint to a regex if found */ + if (matches[1].rm_so == -1) { + stmt->taint[n] = NULL; + } + else { + strncpy(arg, query+matches[1].rm_so+1, + matches[1].rm_eo - matches[1].rm_so - 2); + arg[matches[1].rm_eo - matches[1].rm_so - 2] = '\0'; + stmt->taint[n] = apr_palloc(pool, sizeof(regex_t)); + if (regcomp(stmt->taint[n], arg, REG_ICASE|REG_EXTENDED) != 0) { + ++ret; + } + else { + apr_pool_cleanup_register(pool, stmt->taint[n], freetds_regfree, + apr_pool_cleanup_null); + } + } + + /* record length if specified */ + for (i=matches[2].rm_so; ifmt = apr_pstrdup(pool, query); + stmt->fmt = recurse_args(pool, 0, query, stmt, stmt->fmt); + + /* overestimate by a byte or two to simplify */ + len = strlen("CREATE PROC apr.") + + strlen(label) + + stmt->nargs * strlen(" @arg1 varchar(len1),") + + strlen(" AS begin ") + + strlen(stmt->fmt) + + strlen(" end "); /* extra byte for terminator */ + + pquery = apr_pcalloc(pool, len); + sprintf(pquery, "CREATE PROC apr.%s", label); + for (i=0; inargs; ++i) { + sprintf(pquery+strlen(pquery), " @arg%d varchar(%d)", i, stmt->sz[i]); + if (i < stmt->nargs-1) { + pquery[strlen(pquery)] = ','; + } + } + strcat(pquery, " AS BEGIN "); + strcat(pquery, stmt->fmt); + strcat(pquery, " END"); + + return (freetds_exec(sql->proc, pquery, 0, &i) == SUCCEED) ? 0 : 1; +#else + stmt->fmt = apr_pstrdup(pool, query); + return recurse_args(pool, 0, query, stmt, 0); +#endif + +} + +static int dbd_freetds_start_transaction(apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_transaction_t **trans) +{ + int dummy; + + /* XXX handle recursive transactions here */ + + handle->err = freetds_exec(handle->proc, "BEGIN TRANSACTION", 0, &dummy); + + if (dbd_freetds_is_success(handle->err)) { + if (!*trans) { + *trans = apr_pcalloc(pool, sizeof(apr_dbd_transaction_t)); + } + (*trans)->handle = handle; + handle->trans = *trans; + return 0; + } + + return 1; +} + +static int dbd_freetds_end_transaction(apr_dbd_transaction_t *trans) +{ + int dummy; + if (trans) { + /* rollback on error or explicit rollback request */ + if (trans->errnum) { + trans->errnum = 0; + trans->handle->err = freetds_exec(trans->handle->proc, + "ROLLBACK", 0, &dummy); + } + else { + trans->handle->err = freetds_exec(trans->handle->proc, + "COMMIT", 0, &dummy); + } + trans->handle->trans = NULL; + } + return (trans->handle->err == SUCCEED) ? 0 : 1; +} + +static DBPROCESS *freetds_open(apr_pool_t *pool, const char *params, + const char **error) +{ + char *server = NULL; + DBPROCESS *process; + LOGINREC *login; + static const char *delims = " \r\n\t;|,"; + char *ptr; + char *key; + char *value; + int vlen; + int klen; + char *buf; + char *databaseName = NULL; + + /* FIXME - this uses malloc */ + /* FIXME - pass error message back to the caller in case of failure */ + login = dblogin(); + if (login == NULL) { + return NULL; + } + /* now set login properties */ + for (ptr = strchr(params, '='); ptr; ptr = strchr(ptr, '=')) { + /* don't dereference memory that may not belong to us */ + if (ptr == params) { + ++ptr; + continue; + } + for (key = ptr-1; apr_isspace(*key); --key); + klen = 0; + while (apr_isalpha(*key)) { + --key; + ++klen; + } + ++key; + for (value = ptr+1; apr_isspace(*value); ++value); + + vlen = strcspn(value, delims); + buf = apr_pstrndup(pool, value, vlen); /* NULL-terminated copy */ + + if (!strncasecmp(key, "username", klen)) { + DBSETLUSER(login, buf); + } + else if (!strncasecmp(key, "password", klen)) { + DBSETLPWD(login, buf); + } + else if (!strncasecmp(key, "appname", klen)) { + DBSETLAPP(login, buf); + } + else if (!strncasecmp(key, "dbname", klen)) { + databaseName = buf; + } + else if (!strncasecmp(key, "host", klen)) { + DBSETLHOST(login, buf); + } + else if (!strncasecmp(key, "charset", klen)) { + DBSETLCHARSET(login, buf); + } + else if (!strncasecmp(key, "lang", klen)) { + DBSETLNATLANG(login, buf); + } + else if (!strncasecmp(key, "server", klen)) { + server = buf; + } + else { + /* unknown param */ + } + ptr = value+vlen; + } + + process = dbopen(login, server); + + if (process != NULL && databaseName != NULL) + { + dbuse(process, databaseName); + } + + dbloginfree(login); + if (process == NULL) { + return NULL; + } + + return process; +} +static apr_dbd_t *dbd_freetds_open(apr_pool_t *pool, const char *params, + const char **error) +{ + apr_dbd_t *sql; + /* FIXME - pass error message back to the caller in case of failure */ + DBPROCESS *process = freetds_open(pool, params, error); + if (process == NULL) { + return NULL; + } + sql = apr_palloc (pool, sizeof (apr_dbd_t)); + sql->pool = pool; + sql->proc = process; + sql->params = params; + return sql; +} + +static apr_status_t dbd_freetds_close(apr_dbd_t *handle) +{ + dbclose(handle->proc); + return APR_SUCCESS; +} + +static apr_status_t dbd_freetds_check_conn(apr_pool_t *pool, + apr_dbd_t *handle) +{ + if (dbdead(handle->proc)) { + /* try again */ + dbclose(handle->proc); + handle->proc = freetds_open(handle->pool, handle->params, NULL); + if (!handle->proc || dbdead(handle->proc)) { + return APR_EGENERAL; + } + } + /* clear it, in case this is called in error handling */ + dbcancel(handle->proc); + return APR_SUCCESS; +} + +static int dbd_freetds_select_db(apr_pool_t *pool, apr_dbd_t *handle, + const char *name) +{ + /* ouch, it's declared int. But we can use APR 0/nonzero */ + return (dbuse(handle->proc, (char*)name) == SUCCEED) ? APR_SUCCESS : APR_EGENERAL; +} + +static void *dbd_freetds_native(apr_dbd_t *handle) +{ + return handle->proc; +} + +static int dbd_freetds_num_cols(apr_dbd_results_t* res) +{ + return res->sz; +} + +static int dbd_freetds_num_tuples(apr_dbd_results_t* res) +{ + if (res->random) { + return res->ntuples; + } + else { + return -1; + } +} + +static apr_status_t freetds_term(void *dummy) +{ + dbexit(); + regfree(&dbd_freetds_find_arg); + return APR_SUCCESS; +} +static int freetds_err_handler(DBPROCESS *dbproc, int severity, int dberr, + int oserr, char *dberrstr, char *oserrstr) +{ + return INT_CANCEL; /* never exit */ +} +static void dbd_freetds_init(apr_pool_t *pool) +{ + int rv = regcomp(&dbd_freetds_find_arg, + "%(\\{[^}]*\\})?([0-9]*)[A-Za-z]", REG_EXTENDED); + if (rv != 0) { + char errmsg[256]; + regerror(rv, &dbd_freetds_find_arg, errmsg, 256); + fprintf(stderr, "regcomp failed: %s\n", errmsg); + } + dbinit(); + dberrhandle(freetds_err_handler); + apr_pool_cleanup_register(pool, NULL, freetds_term, apr_pool_cleanup_null); +} + +#ifdef COMPILE_STUBS +/* get_name is the only one of these that is implemented */ +static const char *dbd_freetds_get_name(const apr_dbd_results_t *res, int n) +{ + return (const char*) dbcolname(res->proc, n+1); /* numbering starts at 1 */ +} + +/* These are stubs: transaction modes not implemented here */ +#define DBD_NOTIMPL APR_ENOTIMPL; +static int dbd_freetds_transaction_mode_get(apr_dbd_transaction_t *trans) +{ + return trans ? trans->mode : APR_DBD_TRANSACTION_COMMIT; +} + +static int dbd_freetds_transaction_mode_set(apr_dbd_transaction_t *trans, + int mode) +{ + if (trans) { + trans->mode = mode & TXN_MODE_BITS; + return trans->mode; + } + return APR_DBD_TRANSACTION_COMMIT; +} +static int dbd_freetds_pvbquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows, + apr_dbd_prepared_t *statement, va_list args) +{ + return DBD_NOTIMPL; +} +static int dbd_freetds_pbquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows, + apr_dbd_prepared_t * statement, + const void **values) +{ + return DBD_NOTIMPL; +} + +static int dbd_freetds_pvbselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + apr_dbd_prepared_t *statement, + int seek, va_list args) +{ + return DBD_NOTIMPL; +} +static int dbd_freetds_pbselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + apr_dbd_prepared_t *statement, + int seek, const void **values) +{ + return DBD_NOTIMPL; +} +static apr_status_t dbd_freetds_datum_get(const apr_dbd_row_t *row, int n, + apr_dbd_type_e type, void *data) +{ + return APR_ENOTIMPL; +} +#endif + +APU_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_freetds_driver = { + "freetds", + dbd_freetds_init, + dbd_freetds_native, + dbd_freetds_open, + dbd_freetds_check_conn, + dbd_freetds_close, + dbd_freetds_select_db, + dbd_freetds_start_transaction, + dbd_freetds_end_transaction, + dbd_freetds_query, + dbd_freetds_select, + dbd_freetds_num_cols, + dbd_freetds_num_tuples, + dbd_freetds_get_row, + dbd_freetds_get_entry, + dbd_freetds_error, + dbd_freetds_escape, + dbd_freetds_prepare, + dbd_freetds_pvquery, + dbd_freetds_pvselect, + dbd_freetds_pquery, + dbd_freetds_pselect, + /* this is only implemented to support httpd/2.2 standard usage, + * as in the original DBD implementation. Everything else is NOTIMPL. + */ +#ifdef COMPILE_STUBS + dbd_freetds_get_name, + dbd_freetds_transaction_mode_get, + dbd_freetds_transaction_mode_set, + "", + dbd_freetds_pvbquery, + dbd_freetds_pvbselect, + dbd_freetds_pbquery, + dbd_freetds_pbselect, + dbd_freetds_datum_get +#endif +}; +#endif diff --git a/dbd/apr_dbd_freetds.dsp b/dbd/apr_dbd_freetds.dsp new file mode 100644 index 00000000000..90bf7e58c5f --- /dev/null +++ b/dbd/apr_dbd_freetds.dsp @@ -0,0 +1,207 @@ +# Microsoft Developer Studio Project File - Name="apr_dbd_freetds" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=apr_dbd_freetds - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr_dbd_freetds.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr_dbd_freetds.mak" CFG="apr_dbd_freetds - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr_dbd_freetds - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_freetds - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_freetds - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_freetds - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "apr_dbd_freetds - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"Release/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_freetds-1.dll" /pdb:"Release\apr_dbd_freetds-1.pdb" /implib:"Release\apr_dbd_freetds-1.lib" /MACHINE:X86 /opt:ref +# Begin Special Build Tool +TargetPath=Release\apr_dbd_freetds-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_freetds - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"Debug/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_freetds-1.dll" /pdb:"Debug\apr_dbd_freetds-1.pdb" /implib:"Debug\apr_dbd_freetds-1.lib" /MACHINE:X86 +# Begin Special Build Tool +TargetPath=Debug\apr_dbd_freetds-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_freetds - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\Release" +# PROP BASE Intermediate_Dir "x64\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\Release" +# PROP Intermediate_Dir "x64\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_freetds-1.dll" /pdb:"x64\Release\apr_dbd_freetds-1.pdb" /implib:"x64\Release\apr_dbd_freetds-1.lib" /MACHINE:X64 /opt:ref +# Begin Special Build Tool +TargetPath=x64\Release\apr_dbd_freetds-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_freetds - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\Debug" +# PROP BASE Intermediate_Dir "x64\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\Debug" +# PROP Intermediate_Dir "x64\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_freetds-1.dll" /pdb:"x64\Debug\apr_dbd_freetds-1.pdb" /implib:"x64\Debug\apr_dbd_freetds-1.lib" /MACHINE:X64 +# Begin Special Build Tool +TargetPath=x64\Debug\apr_dbd_freetds-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "apr_dbd_freetds - Win32 Release" +# Name "apr_dbd_freetds - Win32 Debug" +# Name "apr_dbd_freetds - x64 Release" +# Name "apr_dbd_freetds - x64 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\apr_dbd_freetds.c +# End Source File +# End Group +# Begin Group "Public Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\apr_dbd.h +# End Source File +# End Group +# Begin Group "Internal Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\private\apu_config.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_dbd_internal.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_internal.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\libaprutil.rc +# End Source File +# End Target +# End Project diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c new file mode 100644 index 00000000000..77fa5fb7526 --- /dev/null +++ b/dbd/apr_dbd_mysql.c @@ -0,0 +1,1297 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apu.h" +#define HAVE_MYSQL_MYSQL_H + +#if APU_HAVE_MYSQL + +#include "apu_version.h" +#include "apu_config.h" + +#include +#include + +#ifdef HAVE_MY_GLOBAL_H +#include +#elif defined(HAVE_MYSQL_MY_GLOBAL_H) +#include +#endif +#ifdef HAVE_MY_SYS_H +#include +#elif defined(HAVE_MYSQL_MY_SYS_H) +#include +#endif +#ifdef HAVE_MYSQL_H +#include +#include +#elif defined(HAVE_MYSQL_MYSQL_H) +#include +#include +#endif + +#include "apr_strings.h" +#include "apr_lib.h" +#include "apr_buckets.h" + +#include "apr_dbd_internal.h" + +/* default maximum field size 1 MB */ +#define FIELDSIZE 1048575 + +struct apr_dbd_prepared_t { + MYSQL_STMT* stmt; + int nargs; + int nvals; + apr_dbd_type_e *types; +}; + +struct apr_dbd_transaction_t { + int mode; + int errnum; + apr_dbd_t *handle; +}; + +struct apr_dbd_t { + MYSQL* conn ; + apr_dbd_transaction_t* trans ; + unsigned long fldsz; +}; + +struct apr_dbd_results_t { + int random; + MYSQL_RES *res; + MYSQL_STMT *statement; + MYSQL_BIND *bind; + apr_pool_t *pool; +}; +struct apr_dbd_row_t { + MYSQL_ROW row; + apr_dbd_results_t *res; + unsigned long *len; +}; + +/* MySQL specific bucket for BLOB types */ +typedef struct apr_bucket_lob apr_bucket_lob; +/** + * A bucket referring to a MySQL BLOB + */ +struct apr_bucket_lob { + /** Number of buckets using this memory */ + apr_bucket_refcount refcount; + /** The row this bucket refers to */ + const apr_dbd_row_t *row; + /** The column this bucket refers to */ + int col; + /** The pool into which any needed structures should + * be created while reading from this bucket */ + apr_pool_t *readpool; +}; + +static void lob_bucket_destroy(void *data); +static apr_status_t lob_bucket_read(apr_bucket *e, const char **str, + apr_size_t *len, apr_read_type_e block); +static apr_bucket *apr_bucket_lob_make(apr_bucket *b, + const apr_dbd_row_t *row, int col, + apr_off_t offset, apr_size_t len, + apr_pool_t *p); +static apr_bucket *apr_bucket_lob_create(const apr_dbd_row_t *row, int col, + apr_off_t offset, + apr_size_t len, apr_pool_t *p, + apr_bucket_alloc_t *list); + +static const apr_bucket_type_t apr_bucket_type_lob = { + "LOB", 5, APR_BUCKET_DATA, + lob_bucket_destroy, + lob_bucket_read, + apr_bucket_setaside_notimpl, + apr_bucket_shared_split, + apr_bucket_shared_copy +}; + +static void lob_bucket_destroy(void *data) +{ + apr_bucket_lob *f = data; + + if (apr_bucket_shared_destroy(f)) { + /* no need to destroy database objects here; it will get + * done automatically when the pool gets cleaned up */ + apr_bucket_free(f); + } +} + +static apr_status_t lob_bucket_read(apr_bucket *e, const char **str, + apr_size_t *len, apr_read_type_e block) +{ + apr_bucket_lob *a = e->data; + const apr_dbd_row_t *row = a->row; + apr_dbd_results_t *res = row->res; + int col = a->col; + apr_bucket *b = NULL; + int rv; + apr_size_t blength = e->length; /* bytes remaining in file past offset */ + apr_off_t boffset = e->start; + MYSQL_BIND *bind = &res->bind[col]; + + *str = NULL; /* in case we die prematurely */ + + /* fetch from offset if not at the beginning */ + if (boffset > 0) { + rv = mysql_stmt_fetch_column(res->statement, bind, col, + (unsigned long) boffset); + if (rv != 0) { + return APR_EGENERAL; + } + } + blength -= blength > bind->buffer_length ? bind->buffer_length : blength; + *len = e->length - blength; + *str = bind->buffer; + + /* allocate new buffer, since we used this one for the bucket */ + bind->buffer = apr_palloc(res->pool, bind->buffer_length); + + /* + * Change the current bucket to refer to what we read, + * even if we read nothing because we hit EOF. + */ + apr_bucket_pool_make(e, *str, *len, res->pool); + + /* If we have more to read from the field, then create another bucket */ + if (blength > 0) { + /* for efficiency, we can just build a new apr_bucket struct + * to wrap around the existing LOB bucket */ + b = apr_bucket_alloc(sizeof(*b), e->list); + b->start = boffset + *len; + b->length = blength; + b->data = a; + b->type = &apr_bucket_type_lob; + b->free = apr_bucket_free; + b->list = e->list; + APR_BUCKET_INSERT_AFTER(e, b); + } + else { + lob_bucket_destroy(a); + } + + return APR_SUCCESS; +} + +static apr_bucket *apr_bucket_lob_make(apr_bucket *b, + const apr_dbd_row_t *row, int col, + apr_off_t offset, apr_size_t len, + apr_pool_t *p) +{ + apr_bucket_lob *f; + + f = apr_bucket_alloc(sizeof(*f), b->list); + f->row = row; + f->col = col; + f->readpool = p; + + b = apr_bucket_shared_make(b, f, offset, len); + b->type = &apr_bucket_type_lob; + + return b; +} + +static apr_bucket *apr_bucket_lob_create(const apr_dbd_row_t *row, int col, + apr_off_t offset, + apr_size_t len, apr_pool_t *p, + apr_bucket_alloc_t *list) +{ + apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); + + APR_BUCKET_INIT(b); + b->free = apr_bucket_free; + b->list = list; + return apr_bucket_lob_make(b, row, col, offset, len, p); +} + +static apr_status_t free_result(void *data) +{ + mysql_free_result(data); + return APR_SUCCESS; +} + +static int dbd_mysql_select(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + const char *query, int seek) +{ + int sz; + int ret; + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + ret = mysql_query(sql->conn, query); + if (!ret) { + if (sz = mysql_field_count(sql->conn), sz > 0) { + if (!*results) { + *results = apr_palloc(pool, sizeof(apr_dbd_results_t)); + } + (*results)->random = seek; + (*results)->statement = NULL; + (*results)->pool = pool; + if (seek) { + (*results)->res = mysql_store_result(sql->conn); + } + else { + (*results)->res = mysql_use_result(sql->conn); + } + apr_pool_cleanup_register(pool, (*results)->res, + free_result,apr_pool_cleanup_null); + } + } else { + ret = mysql_errno(sql->conn); + } + + if (TXN_NOTICE_ERRORS(sql->trans)) { + sql->trans->errnum = ret; + } + return ret; +} + +static const char *dbd_mysql_get_name(const apr_dbd_results_t *res, int n) +{ + if ((n < 0) || (n >= (int) mysql_num_fields(res->res))) { + return NULL; + } + + return mysql_fetch_fields(res->res)[n].name; +} + +static int dbd_mysql_get_row(apr_pool_t *pool, apr_dbd_results_t *res, + apr_dbd_row_t **row, int rownum) +{ + MYSQL_ROW r = NULL; + int ret = 0; + + if (res->statement) { + if (res->random) { + if (rownum > 0) { + mysql_stmt_data_seek(res->statement, (my_ulonglong) --rownum); + } + else { + return -1; /* invalid row */ + } + } + ret = mysql_stmt_fetch(res->statement); + switch (ret) { + case 1: + ret = mysql_stmt_errno(res->statement); + break; + case MYSQL_NO_DATA: + ret = -1; + break; + default: + ret = 0; /* bad luck - get_entry will deal with this */ + break; + } + } + else { + if (res->random) { + if (rownum > 0) { + mysql_data_seek(res->res, (my_ulonglong) --rownum); + } + else { + return -1; /* invalid row */ + } + } + r = mysql_fetch_row(res->res); + if (r == NULL) { + ret = -1; + } + } + if (ret == 0) { + if (!*row) { + *row = apr_palloc(pool, sizeof(apr_dbd_row_t)); + } + (*row)->row = r; + (*row)->res = res; + (*row)->len = mysql_fetch_lengths(res->res); + } + else { + apr_pool_cleanup_run(pool, res->res, free_result); + } + return ret; +} +#if 0 +/* An improved API that was proposed but not followed up */ +static int dbd_mysql_get_entry(const apr_dbd_row_t *row, int n, + apr_dbd_datum_t *val) +{ + MYSQL_BIND *bind; + if (row->res->statement) { + bind = &row->res->bind[n]; + if (mysql_stmt_fetch_column(row->res->statement, bind, n, 0) != 0) { + val->type = APR_DBD_VALUE_NULL; + return -1; + } + if (*bind->is_null) { + val->type = APR_DBD_VALUE_NULL; + return -1; + } + else { + val->type = APR_DBD_VALUE_STRING; + val->value.stringval = bind->buffer; + } + } + else { + val->type = APR_DBD_VALUE_STRING; + val->value.stringval = row->row[n]; + } + return 0; +} +#else + +static const char *dbd_mysql_get_entry(const apr_dbd_row_t *row, int n) +{ + MYSQL_BIND *bind; + if (row->res->statement) { + bind = &row->res->bind[n]; + if (mysql_stmt_fetch_column(row->res->statement, bind, n, 0) != 0) { + return NULL; + } + if (*bind->is_null) { + return NULL; + } + else { + return bind->buffer; + } + } + else { + return row->row[n]; + } + return NULL; +} +#endif + +static apr_status_t dbd_mysql_datum_get(const apr_dbd_row_t *row, int n, + apr_dbd_type_e type, void *data) +{ + if (row->res->statement) { + MYSQL_BIND *bind = &row->res->bind[n]; + unsigned long len = *bind->length; + + if (mysql_stmt_fetch_column(row->res->statement, bind, n, 0) != 0) { + return APR_EGENERAL; + } + + if (*bind->is_null) { + return APR_ENOENT; + } + + switch (type) { + case APR_DBD_TYPE_TINY: + *(char*)data = atoi(bind->buffer); + break; + case APR_DBD_TYPE_UTINY: + *(unsigned char*)data = atoi(bind->buffer); + break; + case APR_DBD_TYPE_SHORT: + *(short*)data = atoi(bind->buffer); + break; + case APR_DBD_TYPE_USHORT: + *(unsigned short*)data = atoi(bind->buffer); + break; + case APR_DBD_TYPE_INT: + *(int*)data = atoi(bind->buffer); + break; + case APR_DBD_TYPE_UINT: + *(unsigned int*)data = atoi(bind->buffer); + break; + case APR_DBD_TYPE_LONG: + *(long*)data = atol(bind->buffer); + break; + case APR_DBD_TYPE_ULONG: + *(unsigned long*)data = atol(bind->buffer); + break; + case APR_DBD_TYPE_LONGLONG: + *(apr_int64_t*)data = apr_atoi64(bind->buffer); + break; + case APR_DBD_TYPE_ULONGLONG: + *(apr_uint64_t*)data = apr_atoi64(bind->buffer); + break; + case APR_DBD_TYPE_FLOAT: + *(float*)data = (float) atof(bind->buffer); + break; + case APR_DBD_TYPE_DOUBLE: + *(double*)data = atof(bind->buffer); + break; + case APR_DBD_TYPE_STRING: + case APR_DBD_TYPE_TEXT: + case APR_DBD_TYPE_TIME: + case APR_DBD_TYPE_DATE: + case APR_DBD_TYPE_DATETIME: + case APR_DBD_TYPE_TIMESTAMP: + case APR_DBD_TYPE_ZTIMESTAMP: + *((char*)bind->buffer+bind->buffer_length-1) = '\0'; + *(char**)data = bind->buffer; + break; + case APR_DBD_TYPE_BLOB: + case APR_DBD_TYPE_CLOB: + { + apr_bucket *e; + apr_bucket_brigade *b = (apr_bucket_brigade*)data; + + e = apr_bucket_lob_create(row, n, 0, len, + row->res->pool, b->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(b, e); + } + break; + case APR_DBD_TYPE_NULL: + *(void**)data = NULL; + break; + default: + return APR_EGENERAL; + } + } + else { + if (row->row[n] == NULL) { + return APR_ENOENT; + } + + switch (type) { + case APR_DBD_TYPE_TINY: + *(char*)data = atoi(row->row[n]); + break; + case APR_DBD_TYPE_UTINY: + *(unsigned char*)data = atoi(row->row[n]); + break; + case APR_DBD_TYPE_SHORT: + *(short*)data = atoi(row->row[n]); + break; + case APR_DBD_TYPE_USHORT: + *(unsigned short*)data = atoi(row->row[n]); + break; + case APR_DBD_TYPE_INT: + *(int*)data = atoi(row->row[n]); + break; + case APR_DBD_TYPE_UINT: + *(unsigned int*)data = atoi(row->row[n]); + break; + case APR_DBD_TYPE_LONG: + *(long*)data = atol(row->row[n]); + break; + case APR_DBD_TYPE_ULONG: + *(unsigned long*)data = atol(row->row[n]); + break; + case APR_DBD_TYPE_LONGLONG: + *(apr_int64_t*)data = apr_atoi64(row->row[n]); + break; + case APR_DBD_TYPE_ULONGLONG: + *(apr_uint64_t*)data = apr_atoi64(row->row[n]); + break; + case APR_DBD_TYPE_FLOAT: + *(float*)data = (float) atof(row->row[n]); + break; + case APR_DBD_TYPE_DOUBLE: + *(double*)data = atof(row->row[n]); + break; + case APR_DBD_TYPE_STRING: + case APR_DBD_TYPE_TEXT: + case APR_DBD_TYPE_TIME: + case APR_DBD_TYPE_DATE: + case APR_DBD_TYPE_DATETIME: + case APR_DBD_TYPE_TIMESTAMP: + case APR_DBD_TYPE_ZTIMESTAMP: + *(char**)data = row->row[n]; + break; + case APR_DBD_TYPE_BLOB: + case APR_DBD_TYPE_CLOB: + { + apr_bucket *e; + apr_bucket_brigade *b = (apr_bucket_brigade*)data; + + e = apr_bucket_pool_create(row->row[n], row->len[n], + row->res->pool, b->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(b, e); + } + break; + case APR_DBD_TYPE_NULL: + *(void**)data = NULL; + break; + default: + return APR_EGENERAL; + } + } + return 0; +} + +static const char *dbd_mysql_error(apr_dbd_t *sql, int n) +{ + return mysql_error(sql->conn); +} + +static int dbd_mysql_query(apr_dbd_t *sql, int *nrows, const char *query) +{ + int ret; + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + ret = mysql_query(sql->conn, query); + if (ret != 0) { + ret = mysql_errno(sql->conn); + } + *nrows = (int) mysql_affected_rows(sql->conn); + if (TXN_NOTICE_ERRORS(sql->trans)) { + sql->trans->errnum = ret; + } + return ret; +} + +static const char *dbd_mysql_escape(apr_pool_t *pool, const char *arg, + apr_dbd_t *sql) +{ + unsigned long len = strlen(arg); + char *ret = apr_palloc(pool, 2*len + 1); + mysql_real_escape_string(sql->conn, ret, arg, len); + return ret; +} + +static apr_status_t stmt_close(void *data) +{ + mysql_stmt_close(data); + return APR_SUCCESS; +} + +static int dbd_mysql_prepare(apr_pool_t *pool, apr_dbd_t *sql, + const char *query, const char *label, + int nargs, int nvals, apr_dbd_type_e *types, + apr_dbd_prepared_t **statement) +{ + /* Translate from apr_dbd to native query format */ + int ret; + + if (!*statement) { + *statement = apr_palloc(pool, sizeof(apr_dbd_prepared_t)); + } + (*statement)->stmt = mysql_stmt_init(sql->conn); + + if ((*statement)->stmt) { + apr_pool_cleanup_register(pool, (*statement)->stmt, + stmt_close, apr_pool_cleanup_null); + ret = mysql_stmt_prepare((*statement)->stmt, query, strlen(query)); + + if (ret != 0) { + ret = mysql_stmt_errno((*statement)->stmt); + } + + (*statement)->nargs = nargs; + (*statement)->nvals = nvals; + (*statement)->types = types; + + return ret; + } + + return CR_OUT_OF_MEMORY; +} + +static void dbd_mysql_bind(apr_dbd_prepared_t *statement, + const char **values, MYSQL_BIND *bind) +{ + int i, j; + + for (i = 0, j = 0; i < statement->nargs; i++, j++) { + bind[i].length = &bind[i].buffer_length; + bind[i].is_unsigned = 0; + bind[i].is_null = NULL; + + if (values[j] == NULL) { + bind[i].buffer_type = MYSQL_TYPE_NULL; + } + else { + switch (statement->types[i]) { + case APR_DBD_TYPE_BLOB: + case APR_DBD_TYPE_CLOB: + bind[i].buffer_type = MYSQL_TYPE_LONG_BLOB; + bind[i].buffer = (void*)values[j]; + bind[i].buffer_length = atol(values[++j]); + + /* skip table and column */ + j += 2; + break; + default: + bind[i].buffer_type = MYSQL_TYPE_VAR_STRING; + bind[i].buffer = (void*)values[j]; + bind[i].buffer_length = strlen(values[j]); + break; + } + } + } + + return; +} + +static int dbd_mysql_pquery_internal(apr_pool_t *pool, apr_dbd_t *sql, + int *nrows, apr_dbd_prepared_t *statement, + MYSQL_BIND *bind) +{ + int ret; + + ret = mysql_stmt_bind_param(statement->stmt, bind); + if (ret != 0) { + *nrows = 0; + ret = mysql_stmt_errno(statement->stmt); + } + else { + ret = mysql_stmt_execute(statement->stmt); + if (ret != 0) { + ret = mysql_stmt_errno(statement->stmt); + } + *nrows = (int) mysql_stmt_affected_rows(statement->stmt); + } + + return ret; +} + +static int dbd_mysql_pquery(apr_pool_t *pool, apr_dbd_t *sql, + int *nrows, apr_dbd_prepared_t *statement, + const char **values) +{ + MYSQL_BIND *bind; + int ret; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + bind = apr_palloc(pool, statement->nargs * sizeof(MYSQL_BIND)); + + dbd_mysql_bind(statement, values, bind); + + ret = dbd_mysql_pquery_internal(pool, sql, nrows, statement, bind); + + if (TXN_NOTICE_ERRORS(sql->trans)) { + sql->trans->errnum = ret; + } + return ret; +} + +static int dbd_mysql_pvquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows, + apr_dbd_prepared_t *statement, va_list args) +{ + const char **values; + int i; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const char*); + } + + return dbd_mysql_pquery(pool, sql, nrows, statement, values); +} + +static int dbd_mysql_pselect_internal(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, + int random, MYSQL_BIND *bind) +{ + int nfields, i; + my_bool *is_nullr; +#if MYSQL_VERSION_ID >= 50000 + my_bool *error; +#endif + int ret; + unsigned long *length, maxlen; + + ret = mysql_stmt_bind_param(statement->stmt, bind); + if (ret == 0) { + ret = mysql_stmt_execute(statement->stmt); + if (!ret) { + if (!*res) { + *res = apr_pcalloc(pool, sizeof(apr_dbd_results_t)); + } + (*res)->random = random; + (*res)->statement = statement->stmt; + (*res)->res = mysql_stmt_result_metadata(statement->stmt); + (*res)->pool = pool; + apr_pool_cleanup_register(pool, (*res)->res, + free_result, apr_pool_cleanup_null); + nfields = mysql_num_fields((*res)->res); + if (!(*res)->bind) { + (*res)->bind = apr_palloc(pool, nfields*sizeof(MYSQL_BIND)); + length = apr_pcalloc(pool, nfields*sizeof(unsigned long)); +#if MYSQL_VERSION_ID >= 50000 + error = apr_palloc(pool, nfields*sizeof(my_bool)); +#endif + is_nullr = apr_pcalloc(pool, nfields*sizeof(my_bool)); + for ( i = 0; i < nfields; ++i ) { + maxlen = ((*res)->res->fields[i].length < sql->fldsz ? + (*res)->res->fields[i].length : sql->fldsz) + 1; + if ((*res)->res->fields[i].type == MYSQL_TYPE_BLOB) { + (*res)->bind[i].buffer_type = MYSQL_TYPE_LONG_BLOB; + } + else { + (*res)->bind[i].buffer_type = MYSQL_TYPE_VAR_STRING; + } + (*res)->bind[i].buffer_length = maxlen; + (*res)->bind[i].length = &length[i]; + (*res)->bind[i].buffer = apr_palloc(pool, maxlen); + (*res)->bind[i].is_null = is_nullr+i; +#if MYSQL_VERSION_ID >= 50000 + (*res)->bind[i].error = error+i; +#endif + } + } + ret = mysql_stmt_bind_result(statement->stmt, (*res)->bind); + if (!ret) { + ret = mysql_stmt_store_result(statement->stmt); + } + } + } + if (ret != 0) { + ret = mysql_stmt_errno(statement->stmt); + } + + return ret; +} + +static int dbd_mysql_pselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, int random, + const char **args) +{ + int ret; + MYSQL_BIND *bind; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + bind = apr_palloc(pool, statement->nargs * sizeof(MYSQL_BIND)); + + dbd_mysql_bind(statement, args, bind); + + ret = dbd_mysql_pselect_internal(pool, sql, res, statement, random, bind); + + if (TXN_NOTICE_ERRORS(sql->trans)) { + sql->trans->errnum = ret; + } + return ret; +} + +static int dbd_mysql_pvselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, int random, + va_list args) +{ + const char **values; + int i; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const char*); + } + + return dbd_mysql_pselect(pool, sql, res, statement, random, values); +} + +static void dbd_mysql_bbind(apr_pool_t *pool, apr_dbd_prepared_t *statement, + const void **values, MYSQL_BIND *bind) +{ + void *arg; + int i, j; + apr_dbd_type_e type; + + for (i = 0, j = 0; i < statement->nargs; i++, j++) { + arg = (void *)values[j]; + + bind[i].length = &bind[i].buffer_length; + bind[i].is_null = NULL; + + type = (arg == NULL ? APR_DBD_TYPE_NULL : statement->types[i]); + switch (type) { + case APR_DBD_TYPE_TINY: + bind[i].buffer = arg; + bind[i].buffer_type = MYSQL_TYPE_TINY; + bind[i].is_unsigned = 0; + break; + case APR_DBD_TYPE_UTINY: + bind[i].buffer = arg; + bind[i].buffer_type = MYSQL_TYPE_TINY; + bind[i].is_unsigned = 1; + break; + case APR_DBD_TYPE_SHORT: + bind[i].buffer = arg; + bind[i].buffer_type = MYSQL_TYPE_SHORT; + bind[i].is_unsigned = 0; + break; + case APR_DBD_TYPE_USHORT: + bind[i].buffer = arg; + bind[i].buffer_type = MYSQL_TYPE_SHORT; + bind[i].is_unsigned = 1; + break; + case APR_DBD_TYPE_INT: + bind[i].buffer = arg; + bind[i].buffer_type = MYSQL_TYPE_LONG; + bind[i].is_unsigned = 0; + break; + case APR_DBD_TYPE_UINT: + bind[i].buffer = arg; + bind[i].buffer_type = MYSQL_TYPE_LONG; + bind[i].is_unsigned = 1; + break; + case APR_DBD_TYPE_LONG: + if (sizeof(int) == sizeof(long)) { + bind[i].buffer = arg; + } + else { + bind[i].buffer = apr_palloc(pool, sizeof(int)); + *(int*)bind[i].buffer = *(long*)arg; + } + bind[i].buffer_type = MYSQL_TYPE_LONG; + bind[i].is_unsigned = 0; + break; + case APR_DBD_TYPE_ULONG: + if (sizeof(unsigned int) == sizeof(unsigned long)) { + bind[i].buffer = arg; + } + else { + bind[i].buffer = apr_palloc(pool, sizeof(unsigned int)); + *(unsigned int*)bind[i].buffer = *(unsigned long*)arg; + } + bind[i].buffer_type = MYSQL_TYPE_LONG; + bind[i].is_unsigned = 1; + break; + case APR_DBD_TYPE_LONGLONG: + if (sizeof(my_ulonglong) == sizeof(apr_int64_t)) { + bind[i].buffer = arg; + bind[i].buffer_type = MYSQL_TYPE_LONGLONG; + } + else { /* have to downsize, long long is not portable */ + bind[i].buffer = apr_palloc(pool, sizeof(long)); + *(long*)bind[i].buffer = (long) *(apr_int64_t*)arg; + bind[i].buffer_type = MYSQL_TYPE_LONG; + } + bind[i].is_unsigned = 0; + break; + case APR_DBD_TYPE_ULONGLONG: + if (sizeof(my_ulonglong) == sizeof(apr_uint64_t)) { + bind[i].buffer = arg; + bind[i].buffer_type = MYSQL_TYPE_LONGLONG; + } + else { /* have to downsize, long long is not portable */ + bind[i].buffer = apr_palloc(pool, sizeof(long)); + *(unsigned long*)bind[i].buffer = + (unsigned long) *(apr_uint64_t*)arg; + bind[i].buffer_type = MYSQL_TYPE_LONG; + } + bind[i].is_unsigned = 1; + break; + case APR_DBD_TYPE_FLOAT: + bind[i].buffer = arg; + bind[i].buffer_type = MYSQL_TYPE_FLOAT; + bind[i].is_unsigned = 0; + break; + case APR_DBD_TYPE_DOUBLE: + bind[i].buffer = arg; + bind[i].buffer_type = MYSQL_TYPE_DOUBLE; + bind[i].is_unsigned = 0; + break; + case APR_DBD_TYPE_STRING: + case APR_DBD_TYPE_TEXT: + case APR_DBD_TYPE_TIME: + case APR_DBD_TYPE_DATE: + case APR_DBD_TYPE_DATETIME: + case APR_DBD_TYPE_TIMESTAMP: + case APR_DBD_TYPE_ZTIMESTAMP: + bind[i].buffer = arg; + bind[i].buffer_type = MYSQL_TYPE_VAR_STRING; + bind[i].is_unsigned = 0; + bind[i].buffer_length = strlen((const char *)arg); + break; + case APR_DBD_TYPE_BLOB: + case APR_DBD_TYPE_CLOB: + bind[i].buffer = (void *)arg; + bind[i].buffer_type = MYSQL_TYPE_LONG_BLOB; + bind[i].is_unsigned = 0; + bind[i].buffer_length = *(apr_size_t*)values[++j]; + + /* skip table and column */ + j += 2; + break; + case APR_DBD_TYPE_NULL: + default: + bind[i].buffer_type = MYSQL_TYPE_NULL; + break; + } + } + + return; +} + +static int dbd_mysql_pbquery(apr_pool_t *pool, apr_dbd_t *sql, + int *nrows, apr_dbd_prepared_t *statement, + const void **values) +{ + MYSQL_BIND *bind; + int ret; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + bind = apr_palloc(pool, statement->nargs * sizeof(MYSQL_BIND)); + + dbd_mysql_bbind(pool, statement, values, bind); + + ret = dbd_mysql_pquery_internal(pool, sql, nrows, statement, bind); + + if (TXN_NOTICE_ERRORS(sql->trans)) { + sql->trans->errnum = ret; + } + return ret; +} + +static int dbd_mysql_pvbquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows, + apr_dbd_prepared_t *statement, va_list args) +{ + const void **values; + int i; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const void*); + } + + return dbd_mysql_pbquery(pool, sql, nrows, statement, values); +} + +static int dbd_mysql_pbselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, int random, + const void **args) +{ + int ret; + MYSQL_BIND *bind; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + bind = apr_palloc(pool, statement->nargs * sizeof(MYSQL_BIND)); + + dbd_mysql_bbind(pool, statement, args, bind); + + ret = dbd_mysql_pselect_internal(pool, sql, res, statement, random, bind); + + if (TXN_NOTICE_ERRORS(sql->trans)) { + sql->trans->errnum = ret; + } + return ret; +} + +static int dbd_mysql_pvbselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, int random, + va_list args) +{ + const void **values; + int i; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const void*); + } + + return dbd_mysql_pbselect(pool, sql, res, statement, random, values); +} + +static int dbd_mysql_end_transaction(apr_dbd_transaction_t *trans) +{ + int ret = -1; + if (trans) { + /* rollback on error or explicit rollback request */ + if (trans->errnum || TXN_DO_ROLLBACK(trans)) { + trans->errnum = 0; + ret = mysql_rollback(trans->handle->conn); + } + else { + ret = mysql_commit(trans->handle->conn); + } + } + ret |= mysql_autocommit(trans->handle->conn, 1); + trans->handle->trans = NULL; + return ret; +} +/* Whether or not transactions work depends on whether the + * underlying DB supports them within MySQL. Unfortunately + * it fails silently with the default InnoDB. + */ + +static int dbd_mysql_transaction(apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_transaction_t **trans) +{ + /* Don't try recursive transactions here */ + if (handle->trans) { + dbd_mysql_end_transaction(handle->trans) ; + } + if (!*trans) { + *trans = apr_pcalloc(pool, sizeof(apr_dbd_transaction_t)); + } + (*trans)->errnum = mysql_autocommit(handle->conn, 0); + (*trans)->handle = handle; + handle->trans = *trans; + return (*trans)->errnum; +} + +static int dbd_mysql_transaction_mode_get(apr_dbd_transaction_t *trans) +{ + if (!trans) + return APR_DBD_TRANSACTION_COMMIT; + + return trans->mode; +} + +static int dbd_mysql_transaction_mode_set(apr_dbd_transaction_t *trans, + int mode) +{ + if (!trans) + return APR_DBD_TRANSACTION_COMMIT; + + return trans->mode = (mode & TXN_MODE_BITS); +} + +static apr_dbd_t *dbd_mysql_open(apr_pool_t *pool, const char *params, + const char **error) +{ + static const char *const delims = " \r\n\t;|,"; + const char *ptr; + int i; + const char *key; + size_t klen; + const char *value; + size_t vlen; +#if MYSQL_VERSION_ID >= 50013 + my_bool do_reconnect = 1; +#endif + MYSQL *real_conn; + unsigned long flags = 0; + + struct { + const char *field; + const char *value; + } fields[] = { + {"host", NULL}, + {"user", NULL}, + {"pass", NULL}, + {"dbname", NULL}, + {"port", NULL}, + {"sock", NULL}, + {"flags", NULL}, + {"fldsz", NULL}, + {"group", NULL}, + {"reconnect", NULL}, + {NULL, NULL} + }; + unsigned int port = 0; + apr_dbd_t *sql = apr_pcalloc(pool, sizeof(apr_dbd_t)); + sql->fldsz = FIELDSIZE; + sql->conn = mysql_init(sql->conn); + if ( sql->conn == NULL ) { + return NULL; + } + for (ptr = strchr(params, '='); ptr; ptr = strchr(ptr, '=')) { + /* don't dereference memory that may not belong to us */ + if (ptr == params) { + ++ptr; + continue; + } + for (key = ptr-1; apr_isspace(*key); --key); + klen = 0; + while (apr_isalpha(*key)) { + /* don't parse backwards off the start of the string */ + if (key == params) { + --key; + ++klen; + break; + } + --key; + ++klen; + } + ++key; + for (value = ptr+1; apr_isspace(*value); ++value); + vlen = strcspn(value, delims); + for (i = 0; fields[i].field != NULL; i++) { + if (!strncasecmp(fields[i].field, key, klen)) { + fields[i].value = apr_pstrndup(pool, value, vlen); + break; + } + } + ptr = value+vlen; + } + if (fields[4].value != NULL) { + port = atoi(fields[4].value); + } + if (fields[6].value != NULL && + !strcmp(fields[6].value, "CLIENT_FOUND_ROWS")) { + flags |= CLIENT_FOUND_ROWS; /* only option we know */ + } + if (fields[7].value != NULL) { + sql->fldsz = atol(fields[7].value); + } + if (fields[8].value != NULL) { + mysql_options(sql->conn, MYSQL_READ_DEFAULT_GROUP, fields[8].value); + } +#if MYSQL_VERSION_ID >= 50013 + if (fields[9].value != NULL) { + do_reconnect = atoi(fields[9].value) ? 1 : 0; + } +#endif + +#if MYSQL_VERSION_ID >= 50013 + /* the MySQL manual says this should be BEFORE mysql_real_connect */ + mysql_options(sql->conn, MYSQL_OPT_RECONNECT, &do_reconnect); +#endif + + real_conn = mysql_real_connect(sql->conn, fields[0].value, + fields[1].value, fields[2].value, + fields[3].value, port, + fields[5].value, flags); + + if(real_conn == NULL) { + if (error) { + *error = apr_pstrdup(pool, mysql_error(sql->conn)); + } + mysql_close(sql->conn); + return NULL; + } + +#if MYSQL_VERSION_ID >= 50013 + /* Some say this should be AFTER mysql_real_connect */ + mysql_options(sql->conn, MYSQL_OPT_RECONNECT, &do_reconnect); +#endif + + return sql; +} + +static apr_status_t dbd_mysql_close(apr_dbd_t *handle) +{ + mysql_close(handle->conn); + return APR_SUCCESS; +} + +static apr_status_t dbd_mysql_check_conn(apr_pool_t *pool, + apr_dbd_t *handle) +{ + return mysql_ping(handle->conn) ? APR_EGENERAL : APR_SUCCESS; +} + +static int dbd_mysql_select_db(apr_pool_t *pool, apr_dbd_t* handle, + const char* name) +{ + return mysql_select_db(handle->conn, name); +} + +static void *dbd_mysql_native(apr_dbd_t *handle) +{ + return handle->conn; +} + +static int dbd_mysql_num_cols(apr_dbd_results_t *res) +{ + if (res->statement) { + return mysql_stmt_field_count(res->statement); + } + else { + return mysql_num_fields(res->res); + } +} + +static int dbd_mysql_num_tuples(apr_dbd_results_t *res) +{ + if (res->random) { + if (res->statement) { + return (int) mysql_stmt_num_rows(res->statement); + } + else { + return (int) mysql_num_rows(res->res); + } + } + else { + return -1; + } +} + +static apr_status_t thread_end(void *data) +{ + mysql_thread_end(); + return APR_SUCCESS; +} + +static void dbd_mysql_init(apr_pool_t *pool) +{ + my_init(); + mysql_thread_init(); + + /* FIXME: this is a guess; find out what it really does */ + apr_pool_cleanup_register(pool, NULL, thread_end, apr_pool_cleanup_null); +} +APU_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_mysql_driver = { + "mysql", + dbd_mysql_init, + dbd_mysql_native, + dbd_mysql_open, + dbd_mysql_check_conn, + dbd_mysql_close, + dbd_mysql_select_db, + dbd_mysql_transaction, + dbd_mysql_end_transaction, + dbd_mysql_query, + dbd_mysql_select, + dbd_mysql_num_cols, + dbd_mysql_num_tuples, + dbd_mysql_get_row, + dbd_mysql_get_entry, + dbd_mysql_error, + dbd_mysql_escape, + dbd_mysql_prepare, + dbd_mysql_pvquery, + dbd_mysql_pvselect, + dbd_mysql_pquery, + dbd_mysql_pselect, + dbd_mysql_get_name, + dbd_mysql_transaction_mode_get, + dbd_mysql_transaction_mode_set, + "?", + dbd_mysql_pvbquery, + dbd_mysql_pvbselect, + dbd_mysql_pbquery, + dbd_mysql_pbselect, + dbd_mysql_datum_get +}; + +#endif diff --git a/dbd/apr_dbd_mysql.dsp b/dbd/apr_dbd_mysql.dsp new file mode 100644 index 00000000000..6b88d77453b --- /dev/null +++ b/dbd/apr_dbd_mysql.dsp @@ -0,0 +1,207 @@ +# Microsoft Developer Studio Project File - Name="apr_dbd_mysql" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=apr_dbd_mysql - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr_dbd_mysql.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr_dbd_mysql.mak" CFG="apr_dbd_mysql - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr_dbd_mysql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_mysql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_mysql - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_mysql - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "apr_dbd_mysql - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"Release/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_mysql-1.dll" /pdb:"Release\apr_dbd_mysql-1.pdb" /implib:"Release\apr_dbd_mysql-1.lib" /MACHINE:X86 /opt:ref +# Begin Special Build Tool +TargetPath=Release\apr_dbd_mysql-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_mysql - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"Debug/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_mysql-1.dll" /pdb:"Debug\apr_dbd_mysql-1.pdb" /implib:"Debug\apr_dbd_mysql-1.lib" /MACHINE:X86 +# Begin Special Build Tool +TargetPath=Debug\apr_dbd_mysql-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_mysql - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\Release" +# PROP BASE Intermediate_Dir "x64\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\Release" +# PROP Intermediate_Dir "x64\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_mysql-1.dll" /pdb:"x64\Release\apr_dbd_mysql-1.pdb" /implib:"x64\Release\apr_dbd_mysql-1.lib" /MACHINE:X64 /opt:ref +# Begin Special Build Tool +TargetPath=x64\Release\apr_dbd_mysql-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_mysql - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\Debug" +# PROP BASE Intermediate_Dir "x64\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\Debug" +# PROP Intermediate_Dir "x64\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_mysql-1.dll" /pdb:"x64\Debug\apr_dbd_mysql-1.pdb" /implib:"x64\Debug\apr_dbd_mysql-1.lib" /MACHINE:X64 +# Begin Special Build Tool +TargetPath=x64\Debug\apr_dbd_mysql-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "apr_dbd_mysql - Win32 Release" +# Name "apr_dbd_mysql - Win32 Debug" +# Name "apr_dbd_mysql - x64 Release" +# Name "apr_dbd_mysql - x64 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\apr_dbd_mysql.c +# End Source File +# End Group +# Begin Group "Public Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\apr_dbd.h +# End Source File +# End Group +# Begin Group "Internal Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\private\apu_config.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_dbd_internal.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_internal.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\libaprutil.rc +# End Source File +# End Target +# End Project diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c new file mode 100644 index 00000000000..7a843ba7b06 --- /dev/null +++ b/dbd/apr_dbd_odbc.c @@ -0,0 +1,1674 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apu.h" +#if APU_HAVE_ODBC + +#include "apr.h" +#include "apr_strings.h" +#include "apr_buckets.h" +#include "apr_env.h" +#include "apr_file_io.h" +#include "apr_file_info.h" +#include "apr_dbd_internal.h" +#include "apr_thread_proc.h" +#include "apu_version.h" +#include "apu_config.h" + +#include + +/* If library is ODBC-V2, use macros for limited ODBC-V2 support + * No random access in V2. + */ +#ifdef ODBCV2 +#define ODBCVER 0x0200 +#include "apr_dbd_odbc_v2.h" +#endif + +/* standard ODBC include files */ +#ifdef HAVE_SQL_H +#include +#include +#elif defined(HAVE_ODBC_SQL_H) +#include +#include +#endif + + /* Driver name is "odbc" and the entry point is 'apr_dbd_odbc_driver' + * unless ODBC_DRIVER_NAME is defined and it is linked with another db library which + * is ODBC source-compatible. e.g. DB2, Informix, TimesTen, mysql. + */ +#ifndef ODBC_DRIVER_NAME +#define ODBC_DRIVER_NAME odbc +#endif +#define STRINGIFY(x) #x +#define NAMIFY2(n) apr_dbd_##n##_driver +#define NAMIFY1(n) NAMIFY2(n) +#define ODBC_DRIVER_STRING STRINGIFY(ODBC_DRIVER_NAME) +#define ODBC_DRIVER_ENTRY NAMIFY1(ODBC_DRIVER_NAME) + +/* Required APR version for this driver */ +#define DRIVER_APU_VERSION_MAJOR APU_MAJOR_VERSION +#define DRIVER_APU_VERSION_MINOR APU_MINOR_VERSION + + +static SQLHANDLE henv = NULL; /* ODBC ENV handle is process-wide */ + +/* Use a CHECK_ERROR macro so we can grab the source line numbers + * for error reports */ +static void check_error(apr_dbd_t *a, const char *step, SQLRETURN rc, + SQLSMALLINT type, SQLHANDLE h, int line); +#define CHECK_ERROR(a,s,r,t,h) check_error(a,s,r,t,h, __LINE__) + +#define SOURCE_FILE __FILE__ /* source file for error messages */ +#define MAX_ERROR_STRING 1024 /* max length of message in dbc */ +#define MAX_COLUMN_NAME 256 /* longest column name recognized */ +#define DEFAULT_BUFFER_SIZE 1024 /* value for defaultBufferSize */ + +#define MAX_PARAMS 20 +#define DEFAULTSEPS " \t\r\n,=" +#define CSINGLEQUOTE '\'' +#define SSINGLEQUOTE "\'" + +#define TEXTMODE 1 /* used for text (APR 1.2) mode params */ +#define BINARYMODE 0 /* used for binary (APR 1.3+) mode params */ + +/* Identify datatypes which are LOBs + * - DB2 DRDA driver uses undefined types -98 and -99 for CLOB & BLOB */ +#define IS_LOB(t) (t == SQL_LONGVARCHAR \ + || t == SQL_LONGVARBINARY || t == SQL_VARBINARY \ + || t == -98 || t == -99) +/* These types are CLOBs + * - DB2 DRDA driver uses undefined type -98 for CLOB */ +#define IS_CLOB(t) \ + (t == SQL_LONGVARCHAR || t == -98) + +/* Convert a SQL result to an APR result */ +#define APR_FROM_SQL_RESULT(rc) \ + (SQL_SUCCEEDED(rc) ? APR_SUCCESS : APR_EGENERAL) + +/* DBD opaque structures */ +struct apr_dbd_t +{ + SQLHANDLE dbc; /* SQL connection handle - NULL after close */ + apr_pool_t *pool; /* connection lifetime pool */ + char *dbname; /* ODBC datasource */ + int lasterrorcode; + int lineNumber; + char lastError[MAX_ERROR_STRING]; + int defaultBufferSize; /* used for CLOBs in text mode, + * and when fld size is indeterminate */ + int transaction_mode; + int dboptions; /* driver options re SQLGetData */ + int default_transaction_mode; + int can_commit; /* controls end_trans behavior */ +}; + +struct apr_dbd_results_t +{ + SQLHANDLE stmt; /* parent sql statement handle */ + SQLHANDLE dbc; /* parent sql connection handle */ + apr_pool_t *pool; /* pool from query or select */ + apr_dbd_t *apr_dbd; /* parent DBD connection handle */ + int random; /* random access requested */ + int ncols; /* number of columns */ + int isclosed; /* cursor has been closed */ + char **colnames; /* array of column names (NULL until used) */ + SQLPOINTER *colptrs; /* pointers to column data */ + SQLINTEGER *colsizes; /* sizes for columns (enough for txt or bin) */ + SQLINTEGER *coltextsizes; /* max-sizes if converted to text */ + SQLSMALLINT *coltypes; /* array of SQL data types for columns */ + SQLLEN *colinds; /* array of SQL data indicator/strlens */ + int *colstate; /* array of column states + * - avail, bound, present, unavail + */ + int *all_data_fetched; /* flags data as all fetched, for LOBs */ + void *data; /* buffer for all data for one row */ +}; +enum /* results column states */ +{ + COL_AVAIL, /* data may be retrieved with SQLGetData */ + COL_PRESENT, /* data has been retrieved with SQLGetData */ + COL_BOUND, /* column is bound to colptr */ + COL_RETRIEVED, /* all data from column has been returned */ + COL_UNAVAIL /* column is unavailable because ODBC driver + * requires that columns be retrieved + * in ascending order and a higher col + * was accessed */ +}; + +struct apr_dbd_row_t { + SQLHANDLE stmt; /* parent ODBC statement handle */ + SQLHANDLE dbc; /* parent ODBC connection handle */ + apr_pool_t *pool; /* pool from get_row */ + apr_dbd_results_t *res; +}; + +struct apr_dbd_transaction_t { + SQLHANDLE dbc; /* parent ODBC connection handle */ + apr_dbd_t *apr_dbd; /* parent DBD connection handle */ +}; + +struct apr_dbd_prepared_t { + SQLHANDLE stmt; /* ODBC statement handle */ + SQLHANDLE dbc; /* parent ODBC connection handle */ + apr_dbd_t *apr_dbd; + int nargs; + int nvals; + int *types; /* array of DBD data types */ + +}; + +static void odbc_lob_bucket_destroy(void *data); +static apr_status_t odbc_lob_bucket_setaside(apr_bucket *e, apr_pool_t *pool); +static apr_status_t odbc_lob_bucket_read(apr_bucket *e, const char **str, + apr_size_t *len, apr_read_type_e block); + +/* the ODBC LOB bucket type */ +static const apr_bucket_type_t odbc_bucket_type = { + "ODBC_LOB", 5, APR_BUCKET_DATA, + odbc_lob_bucket_destroy, + odbc_lob_bucket_read, + odbc_lob_bucket_setaside, + apr_bucket_shared_split, + apr_bucket_shared_copy +}; + + +/* ODBC LOB bucket data */ +typedef struct { + /** Ref count for shared bucket */ + apr_bucket_refcount refcount; + const apr_dbd_row_t *row; + int col; + SQLSMALLINT type; +} odbc_bucket; + + +/* SQL datatype mappings to DBD datatypes + * These tables must correspond *exactly* to the apr_dbd_type_e enum + * in apr_dbd_internal.h + */ + +/* ODBC "C" types to DBD datatypes */ +static SQLSMALLINT const sqlCtype[] = { + SQL_C_DEFAULT, /* APR_DBD_TYPE_NONE */ + SQL_C_STINYINT, /* APR_DBD_TYPE_TINY, \%hhd */ + SQL_C_UTINYINT, /* APR_DBD_TYPE_UTINY, \%hhu */ + SQL_C_SSHORT, /* APR_DBD_TYPE_SHORT, \%hd */ + SQL_C_USHORT, /* APR_DBD_TYPE_USHORT, \%hu */ + SQL_C_SLONG, /* APR_DBD_TYPE_INT, \%d */ + SQL_C_ULONG, /* APR_DBD_TYPE_UINT, \%u */ + SQL_C_SLONG, /* APR_DBD_TYPE_LONG, \%ld */ + SQL_C_ULONG, /* APR_DBD_TYPE_ULONG, \%lu */ + SQL_C_SBIGINT, /* APR_DBD_TYPE_LONGLONG, \%lld */ + SQL_C_UBIGINT, /* APR_DBD_TYPE_ULONGLONG, \%llu */ + SQL_C_FLOAT, /* APR_DBD_TYPE_FLOAT, \%f */ + SQL_C_DOUBLE, /* APR_DBD_TYPE_DOUBLE, \%lf */ + SQL_C_CHAR, /* APR_DBD_TYPE_STRING, \%s */ + SQL_C_CHAR, /* APR_DBD_TYPE_TEXT, \%pDt */ + SQL_C_CHAR, /*SQL_C_TYPE_TIME, APR_DBD_TYPE_TIME, \%pDi */ + SQL_C_CHAR, /*SQL_C_TYPE_DATE, APR_DBD_TYPE_DATE, \%pDd */ + SQL_C_CHAR, /*SQL_C_TYPE_TIMESTAMP, APR_DBD_TYPE_DATETIME, \%pDa */ + SQL_C_CHAR, /*SQL_C_TYPE_TIMESTAMP, APR_DBD_TYPE_TIMESTAMP, \%pDs */ + SQL_C_CHAR, /*SQL_C_TYPE_TIMESTAMP, APR_DBD_TYPE_ZTIMESTAMP, \%pDz */ + SQL_LONGVARBINARY, /* APR_DBD_TYPE_BLOB, \%pDb */ + SQL_LONGVARCHAR, /* APR_DBD_TYPE_CLOB, \%pDc */ + SQL_TYPE_NULL /* APR_DBD_TYPE_NULL \%pDn */ +}; + +/* ODBC Base types to DBD datatypes */ +static SQLSMALLINT const sqlBaseType[] = { + SQL_C_DEFAULT, /* APR_DBD_TYPE_NONE */ + SQL_TINYINT, /* APR_DBD_TYPE_TINY, \%hhd */ + SQL_TINYINT, /* APR_DBD_TYPE_UTINY, \%hhu */ + SQL_SMALLINT, /* APR_DBD_TYPE_SHORT, \%hd */ + SQL_SMALLINT, /* APR_DBD_TYPE_USHORT, \%hu */ + SQL_INTEGER, /* APR_DBD_TYPE_INT, \%d */ + SQL_INTEGER, /* APR_DBD_TYPE_UINT, \%u */ + SQL_INTEGER, /* APR_DBD_TYPE_LONG, \%ld */ + SQL_INTEGER, /* APR_DBD_TYPE_ULONG, \%lu */ + SQL_BIGINT, /* APR_DBD_TYPE_LONGLONG, \%lld */ + SQL_BIGINT, /* APR_DBD_TYPE_ULONGLONG, \%llu */ + SQL_FLOAT, /* APR_DBD_TYPE_FLOAT, \%f */ + SQL_DOUBLE, /* APR_DBD_TYPE_DOUBLE, \%lf */ + SQL_CHAR, /* APR_DBD_TYPE_STRING, \%s */ + SQL_CHAR, /* APR_DBD_TYPE_TEXT, \%pDt */ + SQL_CHAR, /*SQL_TIME, APR_DBD_TYPE_TIME, \%pDi */ + SQL_CHAR, /*SQL_DATE, APR_DBD_TYPE_DATE, \%pDd */ + SQL_CHAR, /*SQL_TIMESTAMP, APR_DBD_TYPE_DATETIME, \%pDa */ + SQL_CHAR, /*SQL_TIMESTAMP, APR_DBD_TYPE_TIMESTAMP, \%pDs */ + SQL_CHAR, /*SQL_TIMESTAMP, APR_DBD_TYPE_ZTIMESTAMP, \%pDz */ + SQL_LONGVARBINARY, /* APR_DBD_TYPE_BLOB, \%pDb */ + SQL_LONGVARCHAR, /* APR_DBD_TYPE_CLOB, \%pDc */ + SQL_TYPE_NULL /* APR_DBD_TYPE_NULL \%pDn */ +}; + +/* result sizes for DBD datatypes (-1 for null-terminated) */ +static int const sqlSizes[] = { + 0, + sizeof(char), /**< \%hhd out: char* */ + sizeof(unsigned char), /**< \%hhu out: unsigned char* */ + sizeof(short), /**< \%hd out: short* */ + sizeof(unsigned short), /**< \%hu out: unsigned short* */ + sizeof(int), /**< \%d out: int* */ + sizeof(unsigned int), /**< \%u out: unsigned int* */ + sizeof(long), /**< \%ld out: long* */ + sizeof(unsigned long), /**< \%lu out: unsigned long* */ + sizeof(apr_int64_t), /**< \%lld out: apr_int64_t* */ + sizeof(apr_uint64_t), /**< \%llu out: apr_uint64_t* */ + sizeof(float), /**< \%f out: float* */ + sizeof(double), /**< \%lf out: double* */ + -1, /**< \%s out: char** */ + -1, /**< \%pDt out: char** */ + -1, /**< \%pDi out: char** */ + -1, /**< \%pDd out: char** */ + -1, /**< \%pDa out: char** */ + -1, /**< \%pDs out: char** */ + -1, /**< \%pDz out: char** */ + sizeof(apr_bucket_brigade), /**< \%pDb out: apr_bucket_brigade* */ + sizeof(apr_bucket_brigade), /**< \%pDc out: apr_bucket_brigade* */ + 0 /**< \%pDn : in: void*, out: void** */ +}; + +/* +* local functions +*/ + +/* close any open results for the connection */ +static apr_status_t odbc_close_results(void *d) +{ apr_dbd_results_t *dbr = (apr_dbd_results_t *) d; + SQLRETURN rc = SQL_SUCCESS; + + if (dbr && dbr->apr_dbd && dbr->apr_dbd->dbc) { + if (!dbr->isclosed) + rc = SQLCloseCursor(dbr->stmt); + dbr->isclosed = 1; + } + return APR_FROM_SQL_RESULT(rc); +} + +/* close the ODBC statement handle from a prepare */ +static apr_status_t odbc_close_pstmt(void *s) +{ + SQLRETURN rc = APR_SUCCESS; + apr_dbd_prepared_t *statement = s; + /* stmt is closed if connection has already been closed */ + if (statement) { + SQLHANDLE hstmt = statement->stmt; + + if (hstmt && statement->apr_dbd && statement->apr_dbd->dbc) { + rc = SQLFreeHandle(SQL_HANDLE_STMT, hstmt); + } + statement->stmt = NULL; + } + return APR_FROM_SQL_RESULT(rc); +} + +/* close: close/release a connection obtained from open() */ +static apr_status_t odbc_close(apr_dbd_t *handle) +{ + SQLRETURN rc = SQL_SUCCESS; + + if (handle->dbc) { + rc = SQLDisconnect(handle->dbc); + CHECK_ERROR(handle, "SQLDisconnect", rc, SQL_HANDLE_DBC, handle->dbc); + rc = SQLFreeHandle(SQL_HANDLE_DBC, handle->dbc); + CHECK_ERROR(handle, "SQLFreeHandle (DBC)", rc, SQL_HANDLE_ENV, henv); + handle->dbc = NULL; + } + return APR_FROM_SQL_RESULT(rc); +} + +/* odbc_close re-defined for passing to pool cleanup */ +static apr_status_t odbc_close_cleanup(void *handle) +{ + return odbc_close( (apr_dbd_t *) handle); +} + +/* close the ODBC environment handle at process termination */ +static apr_status_t odbc_close_env(SQLHANDLE henv) +{ + SQLRETURN rc; + + rc = SQLFreeHandle(SQL_HANDLE_ENV, henv); + henv = NULL; + return APR_FROM_SQL_RESULT(rc); +} + +/* setup the arrays in results for all the returned columns */ +static SQLRETURN odbc_set_result_column(int icol, apr_dbd_results_t * res, + SQLHANDLE stmt) +{ + SQLRETURN rc; + int maxsize, textsize, realsize, type, isunsigned = 1; + + /* discover the sql type */ + rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_UNSIGNED, NULL, 0, NULL, + (SQLPOINTER) &isunsigned); + isunsigned = (isunsigned == SQL_TRUE); + + rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_TYPE, NULL, 0, NULL, + (SQLPOINTER) &type); + if (!SQL_SUCCEEDED(rc) || type == SQL_UNKNOWN_TYPE) + /* MANY ODBC v2 datasources only supply CONCISE_TYPE */ + rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_CONCISE_TYPE, NULL, + 0, NULL, (SQLPOINTER) &type); + if (!SQL_SUCCEEDED(rc)) + /* if still unknown make it CHAR */ + type = SQL_C_CHAR; + + switch (type) { + case SQL_INTEGER: + case SQL_SMALLINT: + case SQL_TINYINT: + case SQL_BIGINT: + /* fix these numeric binary types up as signed/unsigned for C types */ + type += (isunsigned) ? SQL_UNSIGNED_OFFSET : SQL_SIGNED_OFFSET; + break; + /* LOB types are not changed to C types */ + case SQL_LONGVARCHAR: + type = SQL_LONGVARCHAR; + break; + case SQL_LONGVARBINARY: + type = SQL_LONGVARBINARY; + break; + case SQL_FLOAT : + type = SQL_C_FLOAT; + break; + case SQL_DOUBLE : + type = SQL_C_DOUBLE; + break; + + /* DBD wants times as strings */ + case SQL_TIMESTAMP: + case SQL_DATE: + case SQL_TIME: + default: + type = SQL_C_CHAR; + } + + res->coltypes[icol] = type; + + /* size if retrieved as text */ + rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_DISPLAY_SIZE, NULL, 0, + NULL, (SQLPOINTER) & textsize); + if (!SQL_SUCCEEDED(rc) || textsize < 0) + textsize = res->apr_dbd->defaultBufferSize; + /* for null-term, which sometimes isn't included */ + textsize++; + + /* real size */ + rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_OCTET_LENGTH, NULL, 0, + NULL, (SQLPOINTER) & realsize); + if (!SQL_SUCCEEDED(rc)) + realsize = textsize; + + maxsize = (textsize > realsize) ? textsize : realsize; + if ( IS_LOB(type) || maxsize <= 0) { + /* LOB types are never bound and have a NULL colptr for binary. + * Ingore their real (1-2gb) length & use a default - the larger + * of defaultBufferSize or APR_BUCKET_BUFF_SIZE. + * If not a LOB, but simply unknown length - always use defaultBufferSize. + */ + maxsize = res->apr_dbd->defaultBufferSize; + if ( IS_LOB(type) && maxsize < APR_BUCKET_BUFF_SIZE ) + maxsize = APR_BUCKET_BUFF_SIZE; + + res->colptrs[icol] = NULL; + res->colstate[icol] = COL_AVAIL; + res->colsizes[icol] = maxsize; + rc = SQL_SUCCESS; + } + else { + res->colptrs[icol] = apr_pcalloc(res->pool, maxsize); + res->colsizes[icol] = maxsize; + if (res->apr_dbd->dboptions & SQL_GD_BOUND) { + /* we are allowed to call SQLGetData if we need to */ + rc = SQLBindCol(stmt, icol + 1, res->coltypes[icol], + res->colptrs[icol], maxsize, + &(res->colinds[icol]) ); + CHECK_ERROR(res->apr_dbd, "SQLBindCol", rc, SQL_HANDLE_STMT, + stmt); + res->colstate[icol] = SQL_SUCCEEDED(rc) ? COL_BOUND : COL_AVAIL; + } + else { + /* this driver won't allow us to call SQLGetData on bound + * columns - so don't bind any */ + res->colstate[icol] = COL_AVAIL; + rc = SQL_SUCCESS; + } + } + return rc; +} + +/* create and populate an apr_dbd_results_t for a select */ +static SQLRETURN odbc_create_results(apr_dbd_t * handle, SQLHANDLE hstmt, + apr_pool_t * pool, const int random, + apr_dbd_results_t ** res) +{ + SQLRETURN rc; + SQLSMALLINT ncols; + + *res = apr_pcalloc(pool, sizeof(apr_dbd_results_t)); + (*res)->stmt = hstmt; + (*res)->dbc = handle->dbc; + (*res)->pool = pool; + (*res)->random = random; + (*res)->apr_dbd = handle; + rc = SQLNumResultCols(hstmt, &ncols); + CHECK_ERROR(handle, "SQLNumResultCols", rc, SQL_HANDLE_STMT, hstmt); + (*res)->ncols = ncols; + + if SQL_SUCCEEDED(rc) { + int i; + + (*res)->colnames = apr_pcalloc(pool, ncols * sizeof(char *)); + (*res)->colptrs = apr_pcalloc(pool, ncols * sizeof(void *)); + (*res)->colsizes = apr_pcalloc(pool, ncols * sizeof(SQLINTEGER)); + (*res)->coltypes = apr_pcalloc(pool, ncols * sizeof(SQLSMALLINT)); + (*res)->colinds = apr_pcalloc(pool, ncols * sizeof(SQLLEN)); + (*res)->colstate = apr_pcalloc(pool, ncols * sizeof(int)); + (*res)->ncols = ncols; + + for (i = 0 ; i < ncols ; i++) + odbc_set_result_column(i, (*res), hstmt); + } + return rc; +} + + +/* bind a parameter - input params only, does not support output parameters */ +static SQLRETURN odbc_bind_param(apr_pool_t * pool, + apr_dbd_prepared_t * statement, const int narg, + const SQLSMALLINT type, int *argp, + const void **args, const int textmode) +{ + SQLRETURN rc; + SQLSMALLINT baseType, cType; + void *ptr; + SQLULEN len; + SQLLEN *indicator; + static SQLLEN nullValue = SQL_NULL_DATA; + static SQLSMALLINT inOut = SQL_PARAM_INPUT; /* only input params */ + + /* bind a NULL data value */ + if (args[*argp] == NULL || type == APR_DBD_TYPE_NULL) { + baseType = SQL_CHAR; + cType = SQL_C_CHAR; + ptr = &nullValue; + len = sizeof(SQLINTEGER); + indicator = &nullValue; + (*argp)++; + } + /* bind a non-NULL data value */ + else { + baseType = sqlBaseType[type]; + cType = sqlCtype[type]; + indicator = NULL; + /* LOBs */ + if (IS_LOB(cType)) { + ptr = (void *) args[*argp]; + len = (SQLULEN) * (apr_size_t *) args[*argp + 1]; + cType = (IS_CLOB(cType)) ? SQL_C_CHAR : SQL_C_DEFAULT; + (*argp) += 4; /* LOBs consume 4 args (last two are unused) */ + } + /* non-LOBs */ + else { + switch (baseType) { + case SQL_CHAR: + case SQL_DATE: + case SQL_TIME: + case SQL_TIMESTAMP: + ptr = (void *) args[*argp]; + len = (SQLULEN) strlen(ptr); + break; + case SQL_TINYINT: + ptr = apr_palloc(pool, sizeof(unsigned char)); + len = sizeof(unsigned char); + *(unsigned char *) ptr = + (textmode ? + atoi(args[*argp]) : *(unsigned char *) args[*argp]); + break; + case SQL_SMALLINT: + ptr = apr_palloc(pool, sizeof(short)); + len = sizeof(short); + *(short *) ptr = + (textmode ? atoi(args[*argp]) : *(short *) args[*argp]); + break; + case SQL_INTEGER: + ptr = apr_palloc(pool, sizeof(int)); + len = sizeof(int); + *(long *) ptr = + (textmode ? atol(args[*argp]) : *(long *) args[*argp]); + break; + case SQL_FLOAT: + ptr = apr_palloc(pool, sizeof(float)); + len = sizeof(float); + *(float *) ptr = + (textmode ? + (float) atof(args[*argp]) : *(float *) args[*argp]); + break; + case SQL_DOUBLE: + ptr = apr_palloc(pool, sizeof(double)); + len = sizeof(double); + *(double *) ptr = + (textmode ? atof(args[*argp]) : *(double *) + args[*argp]); + break; + case SQL_BIGINT: + ptr = apr_palloc(pool, sizeof(apr_int64_t)); + len = sizeof(apr_int64_t); + *(apr_int64_t *) ptr = + (textmode ? + apr_atoi64(args[*argp]) : *(apr_int64_t *) args[*argp]); + break; + default: + return APR_EGENERAL; + } + (*argp)++; /* non LOBs consume one argument */ + } + } + rc = SQLBindParameter(statement->stmt, narg, inOut, cType, + baseType, len, 0, ptr, len, indicator); + CHECK_ERROR(statement->apr_dbd, "SQLBindParameter", rc, SQL_HANDLE_STMT, + statement->stmt); + return rc; +} + +/* LOB / Bucket Brigade functions */ + + + +/* bucket type specific destroy */ +static void odbc_lob_bucket_destroy(void *data) +{ + odbc_bucket *bd = data; + + if (apr_bucket_shared_destroy(bd)) + apr_bucket_free(bd); +} + +/* set aside a bucket if possible */ +static apr_status_t odbc_lob_bucket_setaside(apr_bucket *e, apr_pool_t *pool) +{ + odbc_bucket *bd = (odbc_bucket *) e->data; + + /* Unlikely - but if the row pool is ancestor of this pool then it is OK */ + if (apr_pool_is_ancestor(bd->row->pool, pool)) + return APR_SUCCESS; + + return apr_bucket_setaside_notimpl(e, pool); +} + +/* split a bucket into a heap bucket followed by a LOB bkt w/remaining data */ +static apr_status_t odbc_lob_bucket_read(apr_bucket *e, const char **str, + apr_size_t *len, apr_read_type_e block) +{ + SQLRETURN rc; + SQLLEN len_indicator; + SQLSMALLINT type; + odbc_bucket *bd = (odbc_bucket *) e->data; + apr_bucket *nxt; + void *buf; + int bufsize = bd->row->res->apr_dbd->defaultBufferSize; + int eos; + + /* C type is CHAR for CLOBs, DEFAULT for BLOBs */ + type = bd->row->res->coltypes[bd->col]; + type = (type == SQL_LONGVARCHAR) ? SQL_C_CHAR : SQL_C_DEFAULT; + + /* LOB buffers are always at least APR_BUCKET_BUFF_SIZE, + * but they may be much bigger per the BUFSIZE parameter. + */ + if (bufsize < APR_BUCKET_BUFF_SIZE) + bufsize = APR_BUCKET_BUFF_SIZE; + + buf = apr_bucket_alloc(bufsize, e->list); + *str = NULL; + *len = 0; + + rc = SQLGetData(bd->row->res->stmt, bd->col + 1, + type, buf, bufsize, + &len_indicator); + + CHECK_ERROR(bd->row->res->apr_dbd, "SQLGetData", rc, + SQL_HANDLE_STMT, bd->row->res->stmt); + + if (rc == SQL_NO_DATA || len_indicator == SQL_NULL_DATA || len_indicator < 0) + len_indicator = 0; + + if (SQL_SUCCEEDED(rc) || rc == SQL_NO_DATA) { + + if (rc == SQL_SUCCESS_WITH_INFO + && ( len_indicator == SQL_NO_TOTAL || len_indicator >= bufsize) ) { + /* not the last read = a full buffer. CLOBs have a null terminator */ + *len = bufsize - (IS_CLOB(bd->type) ? 1 : 0 ); + + eos = 0; + } + else { + /* the last read - len_indicator is supposed to be the length, + * but some driver get this wrong and return the total length. + * We try to handle both interpretations. + */ + *len = (len_indicator > bufsize + && len_indicator >= (SQLLEN) e->start) + ? (len_indicator - (SQLLEN) e->start) : len_indicator; + + eos = 1; + } + + if (!eos) { + /* Create a new LOB bucket to append and append it */ + nxt = apr_bucket_alloc(sizeof(apr_bucket *), e->list); + APR_BUCKET_INIT(nxt); + nxt->length = -1; + nxt->data = e->data; + nxt->type = &odbc_bucket_type; + nxt->free = apr_bucket_free; + nxt->list = e->list; + nxt->start = e->start + *len; + APR_BUCKET_INSERT_AFTER(e, nxt); + } + else { + odbc_lob_bucket_destroy(e->data); + } + /* make current bucket into a heap bucket */ + apr_bucket_heap_make(e, buf, *len, apr_bucket_free); + *str = buf; + + /* No data is success in this context */ + rc = SQL_SUCCESS; + } + return APR_FROM_SQL_RESULT(rc); +} + +/* Create a bucket brigade on the row pool for a LOB column */ +static apr_status_t odbc_create_bucket(const apr_dbd_row_t *row, const int col, + SQLSMALLINT type, apr_bucket_brigade *bb) +{ + apr_bucket_alloc_t *list = bb->bucket_alloc; + apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); + odbc_bucket *bd = apr_bucket_alloc(sizeof(odbc_bucket), list); + apr_bucket *eos = apr_bucket_eos_create(list); + + + bd->row = row; + bd->col = col; + bd->type = type; + + + APR_BUCKET_INIT(b); + b->type = &odbc_bucket_type; + b->free = apr_bucket_free; + b->list = list; + /* LOB lengths are unknown in ODBC */ + b = apr_bucket_shared_make(b, bd, 0, -1); + + APR_BRIGADE_INSERT_TAIL(bb, b); + APR_BRIGADE_INSERT_TAIL(bb, eos); + + return APR_SUCCESS; +} + +/* returns a data pointer for a column, returns NULL for NULL value, + * return -1 if data not available */ +static void *odbc_get(const apr_dbd_row_t *row, const int col, + const SQLSMALLINT sqltype) +{ + SQLRETURN rc; + SQLLEN indicator; + int state = row->res->colstate[col]; + int options = row->res->apr_dbd->dboptions; + + switch (state) { + case (COL_UNAVAIL) : return (void *) -1; + case (COL_RETRIEVED) : return NULL; + + case (COL_BOUND) : + case (COL_PRESENT) : + if (sqltype == row->res->coltypes[col]) { + /* same type and we already have the data */ + row->res->colstate[col] = COL_RETRIEVED; + return (row->res->colinds[col] == SQL_NULL_DATA) ? + NULL : row->res->colptrs[col]; + } + } + + /* we need to get the data now */ + if (!(options & SQL_GD_ANY_ORDER)) { + /* this ODBC driver requires columns to be retrieved in order, + * so we attempt to get every prior un-gotten non-LOB column */ + int i; + for (i = 0; i < col; i++) { + if (row->res->colstate[i] == COL_AVAIL) { + if (IS_LOB(row->res->coltypes[i])) + row->res->colstate[i] = COL_UNAVAIL; + else { + odbc_get(row, i, row->res->coltypes[i]); + row->res->colstate[i] = COL_PRESENT; + } + } + } + } + + if ((state == COL_BOUND && !(options & SQL_GD_BOUND))) + /* this driver won't let us re-get bound columns */ + return (void *) -1; + + /* a LOB might not have a buffer allocated yet - so create one */ + if (!row->res->colptrs[col]) + row->res->colptrs[col] = apr_pcalloc(row->pool, row->res->colsizes[col]); + + rc = SQLGetData(row->res->stmt, col + 1, sqltype, row->res->colptrs[col], + row->res->colsizes[col], &indicator); + CHECK_ERROR(row->res->apr_dbd, "SQLGetData", rc, SQL_HANDLE_STMT, + row->res->stmt); + if (indicator == SQL_NULL_DATA || rc == SQL_NO_DATA) + return NULL; + + if (SQL_SUCCEEDED(rc)) { + /* whatever it was originally, it is now this sqltype */ + row->res->coltypes[col] = sqltype; + /* this allows getting CLOBs in text mode by calling get_entry + * until it returns NULL */ + row->res->colstate[col] = + (rc == SQL_SUCCESS_WITH_INFO) ? COL_AVAIL : COL_RETRIEVED; + return row->res->colptrs[col]; + } + else return (void *) -1; +} + +/* Parse the parameter string for open */ +static apr_status_t odbc_parse_params(apr_pool_t *pool, const char *params, + int *connect, SQLCHAR **datasource, + SQLCHAR **user, SQLCHAR **password, + int *defaultBufferSize, int *nattrs, + int **attrs, int **attrvals) +{ + char *seps, *last, *name[MAX_PARAMS], *val[MAX_PARAMS]; + int nparams=0, i, j; + + *attrs = apr_pcalloc(pool, MAX_PARAMS * sizeof(char *)); + *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(int)); + *nattrs = 0; + seps = DEFAULTSEPS; + name[nparams] = apr_strtok(apr_pstrdup(pool, params), seps, &last); + + /* no params is OK here - let connect return a more useful error msg */ + if (!name[nparams]) + return SQL_SUCCESS; + + do { + if (last[strspn(last, seps)] == CSINGLEQUOTE) { + last += strspn(last, seps); + seps=SSINGLEQUOTE; + } + val[nparams] = apr_strtok(NULL, seps, &last); + seps = DEFAULTSEPS; + name[++nparams] = apr_strtok(NULL, seps, &last); + } while ( nparams <= MAX_PARAMS && name[nparams] != NULL); + + for(j=i=0 ; i< nparams ; i++) + { if (!apr_strnatcasecmp(name[i], "CONNECT")) + { *datasource = (SQLCHAR *)apr_pstrdup(pool, val[i]); + *connect=1; + } + else if (!apr_strnatcasecmp(name[i], "DATASOURCE")) + { *datasource = (SQLCHAR *)apr_pstrdup(pool, val[i]); + *connect=0; + } + else if (!apr_strnatcasecmp(name[i], "USER")) + *user = (SQLCHAR *)apr_pstrdup(pool, val[i]); + else if (!apr_strnatcasecmp(name[i], "PASSWORD")) + *password = (SQLCHAR *)apr_pstrdup(pool, val[i]); + else if (!apr_strnatcasecmp(name[i], "BUFSIZE")) + *defaultBufferSize = atoi(val[i]); + else if (!apr_strnatcasecmp(name[i], "ACCESS")) + { if (!apr_strnatcasecmp(val[i], "READ_ONLY")) + (*attrvals)[j] = SQL_MODE_READ_ONLY; + else if (!apr_strnatcasecmp(val[i], "READ_WRITE")) + (*attrvals)[j] = SQL_MODE_READ_WRITE; + else return SQL_ERROR; + (*attrs)[j++] = SQL_ATTR_ACCESS_MODE; + } + else if (!apr_strnatcasecmp(name[i], "CTIMEOUT")) + { (*attrvals)[j] = atoi(val[i]); + (*attrs)[j++] = SQL_ATTR_LOGIN_TIMEOUT; + } + else if (!apr_strnatcasecmp(name[i], "STIMEOUT")) + { (*attrvals)[j] = atoi(val[i]); + (*attrs)[j++] = SQL_ATTR_CONNECTION_TIMEOUT; + } + else if (!apr_strnatcasecmp(name[i], "TXMODE")) + { if (!apr_strnatcasecmp(val[i], "READ_UNCOMMITTED")) + (*attrvals)[j] = SQL_TXN_READ_UNCOMMITTED; + else if (!apr_strnatcasecmp(val[i], "READ_COMMITTED")) + (*attrvals)[j] = SQL_TXN_READ_COMMITTED; + else if (!apr_strnatcasecmp(val[i], "REPEATABLE_READ")) + (*attrvals)[j] = SQL_TXN_REPEATABLE_READ; + else if (!apr_strnatcasecmp(val[i], "SERIALIZABLE")) + (*attrvals)[j] = SQL_TXN_SERIALIZABLE; + else if (!apr_strnatcasecmp(val[i], "DEFAULT")) + continue; + else return SQL_ERROR; + (*attrs)[j++] = SQL_ATTR_TXN_ISOLATION; + } + else return SQL_ERROR; + } + *nattrs = j; + return (*datasource && *defaultBufferSize) ? APR_SUCCESS : SQL_ERROR; +} + +/* common handling after ODBC calls - save error info (code and text) in dbc */ +static void check_error(apr_dbd_t *dbc, const char *step, SQLRETURN rc, + SQLSMALLINT type, SQLHANDLE h, int line) +{ + SQLCHAR buffer[512]; + SQLCHAR sqlstate[128]; + SQLINTEGER native; + SQLSMALLINT reslength; + char *res, *p, *end, *logval=NULL; + int i; + apr_status_t r; + + /* set info about last error in dbc - fast return for SQL_SUCCESS */ + if (rc == SQL_SUCCESS) { + char successMsg[] = "[dbd_odbc] SQL_SUCCESS "; + dbc->lasterrorcode = SQL_SUCCESS; + strcpy(dbc->lastError, successMsg); + strcpy(dbc->lastError+sizeof(successMsg)-1, step); + return; + } + switch (rc) { + case SQL_INVALID_HANDLE : { res = "SQL_INVALID_HANDLE"; break; } + case SQL_ERROR : { res = "SQL_ERROR"; break; } + case SQL_SUCCESS_WITH_INFO : { res = "SQL_SUCCESS_WITH_INFO"; break; } + case SQL_STILL_EXECUTING : { res = "SQL_STILL_EXECUTING"; break; } + case SQL_NEED_DATA : { res = "SQL_NEED_DATA"; break; } + case SQL_NO_DATA : { res = "SQL_NO_DATA"; break; } + default : { res = "unrecognized SQL return code"; } + } + /* these two returns are expected during normal execution */ + if (rc != SQL_SUCCESS_WITH_INFO && rc != SQL_NO_DATA + && dbc->can_commit != APR_DBD_TRANSACTION_IGNORE_ERRORS) + { + dbc->can_commit = APR_DBD_TRANSACTION_ROLLBACK; + } + p = dbc->lastError; + end = p + sizeof(dbc->lastError); + dbc->lasterrorcode = rc; + p += sprintf(p, "[dbd_odbc] %.64s returned %.30s (%d) at %.24s:%d ", + step, res, rc, SOURCE_FILE, line-1); + for (i=1, rc=0 ; rc==0 ; i++) { + rc = SQLGetDiagRec(type, h, i, sqlstate, &native, buffer, + sizeof(buffer), &reslength); + if (SQL_SUCCEEDED(rc) && (p < (end-280))) + p += sprintf(p, "%.256s %.20s ", buffer, sqlstate); + } + r = apr_env_get(&logval, "apr_dbd_odbc_log", dbc->pool); + /* if env var was set or call was init/open (no dbname) - log to stderr */ + if (logval || !dbc->dbname ) { + char timestamp[APR_CTIME_LEN]; + apr_file_t *se; + apr_ctime(timestamp, apr_time_now()); + apr_file_open_stderr(&se, dbc->pool); + apr_file_printf(se, "[%s] %s\n", timestamp, dbc->lastError); + } +} + +static APR_INLINE int odbc_check_rollback(apr_dbd_t *handle) +{ + if (handle->can_commit == APR_DBD_TRANSACTION_ROLLBACK) { + handle->lasterrorcode = SQL_ERROR; + strcpy(handle->lastError, "[dbd_odbc] Rollback pending "); + return 1; + } + return 0; +} +/* +* public functions per DBD driver API +*/ + +/** init: allow driver to perform once-only initialisation. **/ +static void odbc_init(apr_pool_t *pool) +{ + SQLRETURN rc; + char *step; + apr_version_t apuver; + + apu_version(&apuver); + if (apuver.major != DRIVER_APU_VERSION_MAJOR + || apuver.minor != DRIVER_APU_VERSION_MINOR) { + apr_file_t *se; + + apr_file_open_stderr(&se, pool); + apr_file_printf(se, "Incorrect " ODBC_DRIVER_STRING " dbd driver version\n" + "Attempt to load APU version %d.%d driver with APU version %d.%d\n", + DRIVER_APU_VERSION_MAJOR, DRIVER_APU_VERSION_MINOR, + apuver.major, apuver.minor); + abort(); + } + + if (henv) + return; + + step = "SQLAllocHandle (SQL_HANDLE_ENV)"; + rc = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv); + apr_pool_cleanup_register(pool, henv, odbc_close_env, apr_pool_cleanup_null); + if (SQL_SUCCEEDED(rc)) + { step = "SQLSetEnvAttr"; + rc = SQLSetEnvAttr(henv,SQL_ATTR_ODBC_VERSION, + (SQLPOINTER) SQL_OV_ODBC3, 0); + } + else + { apr_dbd_t tmp_dbc; + SQLHANDLE err_h = henv; + + tmp_dbc.pool = pool; + tmp_dbc.dbname = NULL; + CHECK_ERROR(&tmp_dbc, step, rc, SQL_HANDLE_ENV, err_h); + } +} + +/** native_handle: return the native database handle of the underlying db **/ +static void* odbc_native_handle(apr_dbd_t *handle) +{ return handle->dbc; +} + +/** open: obtain a database connection from the server rec. **/ + +/* It would be more efficient to allocate a single statement handle + here - but SQL_ATTR_CURSOR_SCROLLABLE must be set before + SQLPrepare, and we don't know whether random-access is + specified until SQLExecute so we cannot. +*/ + +static apr_dbd_t* odbc_open(apr_pool_t *pool, const char *params, const char **error) +{ + SQLRETURN rc; + SQLHANDLE hdbc = NULL; + apr_dbd_t *handle; + char *err_step; + int err_htype, i; + int defaultBufferSize=DEFAULT_BUFFER_SIZE; + SQLHANDLE err_h = NULL; + SQLCHAR *datasource=(SQLCHAR *)"", *user=(SQLCHAR *)"", + *password=(SQLCHAR *)""; + int nattrs=0, *attrs=NULL, *attrvals=NULL, connect=0; + + err_step="SQLAllocHandle (SQL_HANDLE_DBC)"; + err_htype = SQL_HANDLE_ENV; + err_h = henv; + rc = SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc); + if (SQL_SUCCEEDED(rc)) { + err_step="Invalid DBD Parameters - open"; + err_htype = SQL_HANDLE_DBC; + err_h = hdbc; + rc = odbc_parse_params(pool, params, &connect, &datasource, &user, + &password, &defaultBufferSize, &nattrs, &attrs, + &attrvals); + } + if (SQL_SUCCEEDED(rc)) { + for (i=0 ; i < nattrs && SQL_SUCCEEDED(rc); i++) { + err_step="SQLSetConnectAttr (from DBD Parameters)"; + err_htype = SQL_HANDLE_DBC; + err_h = hdbc; + rc = SQLSetConnectAttr(hdbc, attrs[i], (SQLPOINTER) attrvals[i], 0); + } + } + if (SQL_SUCCEEDED(rc)) { + if (connect) { + SQLCHAR out[1024]; + SQLSMALLINT outlen; + err_step="SQLDriverConnect"; + err_htype = SQL_HANDLE_DBC; + err_h = hdbc; + rc = SQLDriverConnect(hdbc, NULL, datasource, + (SQLSMALLINT) strlen((char *)datasource), + out, sizeof(out), &outlen, SQL_DRIVER_NOPROMPT); + } + else { + err_step="SQLConnect"; + err_htype = SQL_HANDLE_DBC; + err_h = hdbc; + rc = SQLConnect(hdbc, datasource, + (SQLSMALLINT) strlen((char *)datasource), + user, (SQLSMALLINT) strlen((char *)user), + password, (SQLSMALLINT) strlen((char *)password)); + } + } + if (SQL_SUCCEEDED(rc)) { + handle = apr_pcalloc(pool, sizeof(apr_dbd_t)); + handle->dbname = apr_pstrdup(pool, (char *)datasource); + handle->dbc = hdbc; + handle->pool = pool; + handle->defaultBufferSize = defaultBufferSize; + CHECK_ERROR(handle, "SQLConnect", rc, SQL_HANDLE_DBC, handle->dbc); + handle->default_transaction_mode = 0; + handle->can_commit = APR_DBD_TRANSACTION_IGNORE_ERRORS; + SQLGetInfo(hdbc, SQL_DEFAULT_TXN_ISOLATION, + &(handle->default_transaction_mode), sizeof(int), NULL); + handle->transaction_mode = handle->default_transaction_mode; + SQLGetInfo(hdbc, SQL_GETDATA_EXTENSIONS ,&(handle->dboptions), + sizeof(int), NULL); + apr_pool_cleanup_register(pool, handle, odbc_close_cleanup, apr_pool_cleanup_null); + return handle; + } + else { + apr_dbd_t tmp_dbc; + tmp_dbc.pool = pool; + tmp_dbc.dbname = NULL; + CHECK_ERROR(&tmp_dbc, err_step, rc, err_htype, err_h); + if (error) + *error = apr_pstrdup(pool, tmp_dbc.lastError); + if (hdbc) + SQLFreeHandle(SQL_HANDLE_DBC, hdbc); + return NULL; + } +} + +/** check_conn: check status of a database connection **/ +static apr_status_t odbc_check_conn(apr_pool_t *pool, apr_dbd_t *handle) +{ + SQLUINTEGER isDead; + SQLRETURN rc; + + rc = SQLGetConnectAttr(handle->dbc, SQL_ATTR_CONNECTION_DEAD, &isDead, + sizeof(SQLUINTEGER), NULL); + CHECK_ERROR(handle, "SQLGetConnectAttr (SQL_ATTR_CONNECTION_DEAD)", rc, + SQL_HANDLE_DBC, handle->dbc); + /* if driver cannot check connection, say so */ + if (rc != SQL_SUCCESS) + return APR_ENOTIMPL; + + return (isDead == SQL_CD_FALSE) ? APR_SUCCESS : APR_EGENERAL; +} + + +/** set_dbname: select database name. May be a no-op if not supported. **/ +static int odbc_set_dbname(apr_pool_t* pool, apr_dbd_t *handle, + const char *name) +{ + if (apr_strnatcmp(name, handle->dbname)) { + return APR_EGENERAL; /* It's illegal to change dbname in ODBC */ + } + CHECK_ERROR(handle, "set_dbname (no-op)", SQL_SUCCESS, SQL_HANDLE_DBC, + handle->dbc); + return APR_SUCCESS; /* OK if it's the same name */ +} + +/** transaction: start a transaction. May be a no-op. **/ +static int odbc_start_transaction(apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_transaction_t **trans) +{ + SQLRETURN rc = SQL_SUCCESS; + + if (handle->transaction_mode) { + rc = SQLSetConnectAttr(handle->dbc, SQL_ATTR_TXN_ISOLATION, + (SQLPOINTER) handle->transaction_mode, 0); + CHECK_ERROR(handle, "SQLSetConnectAttr (SQL_ATTR_TXN_ISOLATION)", rc, + SQL_HANDLE_DBC, handle->dbc); + } + if SQL_SUCCEEDED(rc) { + /* turn off autocommit for transactions */ + rc = SQLSetConnectAttr(handle->dbc, SQL_ATTR_AUTOCOMMIT, + SQL_AUTOCOMMIT_OFF, 0); + CHECK_ERROR(handle, "SQLSetConnectAttr (SQL_ATTR_AUTOCOMMIT)", rc, + SQL_HANDLE_DBC, handle->dbc); + } + if SQL_SUCCEEDED(rc) { + *trans = apr_palloc(pool, sizeof(apr_dbd_transaction_t)); + (*trans)->dbc = handle->dbc; + (*trans)->apr_dbd = handle; + } + handle->can_commit = APR_DBD_TRANSACTION_COMMIT; + return APR_FROM_SQL_RESULT(rc); +}; + + +/** end_transaction: end a transaction **/ +static int odbc_end_transaction(apr_dbd_transaction_t *trans) +{ + SQLRETURN rc; + int action = (trans->apr_dbd->can_commit != APR_DBD_TRANSACTION_ROLLBACK) + ? SQL_COMMIT : SQL_ROLLBACK; + + rc = SQLEndTran(SQL_HANDLE_DBC, trans->dbc, action); + CHECK_ERROR(trans->apr_dbd, "SQLEndTran", rc, SQL_HANDLE_DBC, trans->dbc); + if SQL_SUCCEEDED(rc) { + rc = SQLSetConnectAttr(trans->dbc, SQL_ATTR_AUTOCOMMIT, + (SQLPOINTER) SQL_AUTOCOMMIT_ON, 0); + CHECK_ERROR(trans->apr_dbd, "SQLSetConnectAttr (SQL_ATTR_AUTOCOMMIT)", + rc, SQL_HANDLE_DBC, trans->dbc); + } + trans->apr_dbd->can_commit = APR_DBD_TRANSACTION_IGNORE_ERRORS; + return APR_FROM_SQL_RESULT(rc); +} + +/** query: execute an SQL statement which doesn't return a result set **/ +static int odbc_query(apr_dbd_t *handle, int *nrows, const char *statement) +{ + SQLRETURN rc; + SQLHANDLE hstmt = NULL; + size_t len = strlen(statement); + + if (odbc_check_rollback(handle)) + return APR_EGENERAL; + + rc = SQLAllocHandle(SQL_HANDLE_STMT, handle->dbc, &hstmt); + CHECK_ERROR(handle, "SQLAllocHandle (STMT)", rc, SQL_HANDLE_DBC, + handle->dbc); + if (!SQL_SUCCEEDED(rc)) + return APR_FROM_SQL_RESULT(rc); + + rc = SQLExecDirect(hstmt, (SQLCHAR *) statement, (SQLINTEGER) len); + CHECK_ERROR(handle, "SQLExecDirect", rc, SQL_HANDLE_STMT, hstmt); + + if SQL_SUCCEEDED(rc) { + SQLLEN rowcount; + + rc = SQLRowCount(hstmt, &rowcount); + *nrows = (int) rowcount; + CHECK_ERROR(handle, "SQLRowCount", rc, SQL_HANDLE_STMT, hstmt); + } + + SQLFreeHandle(SQL_HANDLE_STMT, hstmt); + return APR_FROM_SQL_RESULT(rc); +} + +/** select: execute an SQL statement which returns a result set **/ +static int odbc_select(apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_results_t **res, const char *statement, + int random) +{ + SQLRETURN rc; + SQLHANDLE hstmt; + apr_dbd_prepared_t *stmt; + size_t len = strlen(statement); + + if (odbc_check_rollback(handle)) + return APR_EGENERAL; + + rc = SQLAllocHandle(SQL_HANDLE_STMT, handle->dbc, &hstmt); + CHECK_ERROR(handle, "SQLAllocHandle (STMT)", rc, SQL_HANDLE_DBC, + handle->dbc); + if (!SQL_SUCCEEDED(rc)) + return APR_FROM_SQL_RESULT(rc); + /* Prepare an apr_dbd_prepared_t for pool cleanup, even though this + * is not a prepared statement. We want the same cleanup mechanism. + */ + stmt = apr_pcalloc(pool, sizeof(apr_dbd_prepared_t)); + stmt->apr_dbd = handle; + stmt->dbc = handle->dbc; + stmt->stmt = hstmt; + apr_pool_cleanup_register(pool, stmt, odbc_close_pstmt, apr_pool_cleanup_null); + if (random) { + rc = SQLSetStmtAttr(hstmt, SQL_ATTR_CURSOR_SCROLLABLE, + (SQLPOINTER) SQL_SCROLLABLE, 0); + CHECK_ERROR(handle, "SQLSetStmtAttr (SQL_ATTR_CURSOR_SCROLLABLE)", rc, + SQL_HANDLE_STMT, hstmt); + } + if SQL_SUCCEEDED(rc) { + rc = SQLExecDirect(hstmt, (SQLCHAR *) statement, (SQLINTEGER) len); + CHECK_ERROR(handle, "SQLExecDirect", rc, SQL_HANDLE_STMT, hstmt); + } + if SQL_SUCCEEDED(rc) { + rc = odbc_create_results(handle, hstmt, pool, random, res); + apr_pool_cleanup_register(pool, *res, + odbc_close_results, apr_pool_cleanup_null); + } + return APR_FROM_SQL_RESULT(rc); +} + +/** num_cols: get the number of columns in a results set **/ +static int odbc_num_cols(apr_dbd_results_t *res) +{ + return res->ncols; +} + +/** num_tuples: get the number of rows in a results set **/ +static int odbc_num_tuples(apr_dbd_results_t *res) +{ + SQLRETURN rc; + SQLLEN nrows; + + rc = SQLRowCount(res->stmt, &nrows); + CHECK_ERROR(res->apr_dbd, "SQLRowCount", rc, SQL_HANDLE_STMT, res->stmt); + return SQL_SUCCEEDED(rc) ? (int) nrows : -1; +} + +/** get_row: get a row from a result set **/ +static int odbc_get_row(apr_pool_t * pool, apr_dbd_results_t * res, + apr_dbd_row_t ** row, int rownum) +{ + SQLRETURN rc; + char *fetchtype; + int c; + + *row = apr_pcalloc(pool, sizeof(apr_dbd_row_t)); + (*row)->stmt = res->stmt; + (*row)->dbc = res->dbc; + (*row)->res = res; + (*row)->pool = res->pool; + + /* mark all the columns as needing SQLGetData unless they are bound */ + for (c = 0; c < res->ncols; c++) { + if (res->colstate[c] != COL_BOUND) + res->colstate[c] = COL_AVAIL; + /* some drivers do not null-term zero-len CHAR data */ + if (res->colptrs[c] ) + * (char *) res->colptrs[c] = 0; + } + + if (res->random && (rownum > 0)) { + fetchtype = "SQLFetchScroll"; + rc = SQLFetchScroll(res->stmt, SQL_FETCH_ABSOLUTE, rownum); + } + else { + fetchtype = "SQLFetch"; + rc = SQLFetch(res->stmt); + } + CHECK_ERROR(res->apr_dbd, fetchtype, rc, SQL_HANDLE_STMT, res->stmt); + (*row)->stmt = res->stmt; + if (!SQL_SUCCEEDED(rc) && !res->random) { + /* early close on any error (usually SQL_NO_DATA) if fetching + * sequentially to release resources ASAP */ + odbc_close_results(res); + return -1; + } + return SQL_SUCCEEDED(rc) ? 0 : -1; +} + +/** datum_get: get a binary entry from a row **/ +static apr_status_t odbc_datum_get(const apr_dbd_row_t * row, int col, + apr_dbd_type_e dbdtype, void *data) +{ + SQLSMALLINT sqltype; + void *p; + int len = sqlSizes[dbdtype]; + + if (col >= row->res->ncols) + return APR_EGENERAL; + + if (dbdtype < 0 || dbdtype >= sizeof(sqlCtype)) { + data = NULL; /* invalid type */ + return APR_EGENERAL; + } + sqltype = sqlCtype[dbdtype]; + + /* must not memcpy a brigade, sentinals are relative to orig loc */ + if (IS_LOB(sqltype)) + return odbc_create_bucket(row, col, sqltype, data); + + p = odbc_get(row, col, sqltype); + if (p == (void *) -1) + return APR_EGENERAL; + + if (p == NULL) + return APR_ENOENT; /* SQL NULL value */ + + if (len < 0) + strcpy(data, p); + else + memcpy(data, p, len); + + return APR_SUCCESS; + +} + +/** get_entry: get an entry from a row (string data) **/ +static const char *odbc_get_entry(const apr_dbd_row_t * row, int col) +{ + void *p; + + if (col >= row->res->ncols) + return NULL; + + p = odbc_get(row, col, SQL_C_CHAR); + + /* NULL or invalid (-1) */ + if (p == NULL || p == (void *) -1) + return p; + else + return apr_pstrdup(row->pool, p); +} + +/** error: get current error message (if any) **/ +static const char* odbc_error(apr_dbd_t *handle, int errnum) +{ + return (handle) ? handle->lastError : "[dbd_odbc]No error message available"; +} + +/** escape: escape a string so it is safe for use in query/select **/ +static const char* odbc_escape(apr_pool_t *pool, const char *s, + apr_dbd_t *handle) +{ + char *newstr, *src, *dst, *sq; + int qcount; + + /* return the original if there are no single-quotes */ + if (!(sq = strchr(s, '\''))) + return (char *) s; + /* count the single-quotes and allocate a new buffer */ + for (qcount = 1; (sq = strchr(sq + 1, '\'')); ) + qcount++; + newstr = apr_palloc(pool, strlen(s) + qcount + 1); + + /* move chars, doubling all single-quotes */ + src = (char *) s; + for (dst = newstr ; *src ; src++) { + if ((*dst++ = *src) == '\'') + *dst++ = '\''; + } + *dst = 0; + return newstr; +} +/** prepare: prepare a statement **/ +static int odbc_prepare(apr_pool_t * pool, apr_dbd_t * handle, + const char *query, const char *label, int nargs, + int nvals, apr_dbd_type_e * types, + apr_dbd_prepared_t ** statement) +{ + SQLRETURN rc; + size_t len = strlen(query); + + if (odbc_check_rollback(handle)) + return APR_EGENERAL; + + *statement = apr_pcalloc(pool, sizeof(apr_dbd_prepared_t)); + (*statement)->dbc = handle->dbc; + (*statement)->apr_dbd = handle; + (*statement)->nargs = nargs; + (*statement)->nvals = nvals; + (*statement)->types = + apr_pmemdup(pool, types, nargs * sizeof(apr_dbd_type_e)); + rc = SQLAllocHandle(SQL_HANDLE_STMT, handle->dbc, &((*statement)->stmt)); + apr_pool_cleanup_register(pool, *statement, + odbc_close_pstmt, apr_pool_cleanup_null); + CHECK_ERROR(handle, "SQLAllocHandle (STMT)", rc, + SQL_HANDLE_DBC, handle->dbc); + rc = SQLPrepare((*statement)->stmt, (SQLCHAR *) query, (SQLINTEGER) len); + CHECK_ERROR(handle, "SQLPrepare", rc, SQL_HANDLE_STMT, + (*statement)->stmt); + return APR_FROM_SQL_RESULT(rc); +} + +/** pquery: query using a prepared statement + args **/ +static int odbc_pquery(apr_pool_t * pool, apr_dbd_t * handle, int *nrows, + apr_dbd_prepared_t * statement, const char **args) +{ + SQLRETURN rc = SQL_SUCCESS; + int i, argp; + + if (odbc_check_rollback(handle)) + return APR_EGENERAL; + + for (i = argp = 0; i < statement->nargs && SQL_SUCCEEDED(rc); i++) { + rc = odbc_bind_param(pool, statement, i + 1, statement->types[i], + &argp, (const void **) args, TEXTMODE); + } + if (SQL_SUCCEEDED(rc)) { + rc = SQLExecute(statement->stmt); + CHECK_ERROR(handle, "SQLExecute", rc, SQL_HANDLE_STMT, + statement->stmt); + } + if (SQL_SUCCEEDED(rc)) { + SQLLEN rowcount; + + rc = SQLRowCount(statement->stmt, &rowcount); + *nrows = (int) rowcount; + CHECK_ERROR(handle, "SQLRowCount", rc, SQL_HANDLE_STMT, + statement->stmt); + } + return APR_FROM_SQL_RESULT(rc); +} + +/** pvquery: query using a prepared statement + args **/ +static int odbc_pvquery(apr_pool_t * pool, apr_dbd_t * handle, int *nrows, + apr_dbd_prepared_t * statement, va_list args) +{ + const char **values; + int i; + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + for (i = 0; i < statement->nvals; i++) + values[i] = va_arg(args, const char *); + return odbc_pquery(pool, handle, nrows, statement, values); +} + +/** pselect: select using a prepared statement + args **/ +int odbc_pselect(apr_pool_t * pool, apr_dbd_t * handle, + apr_dbd_results_t ** res, apr_dbd_prepared_t * statement, + int random, const char **args) +{ + SQLRETURN rc = SQL_SUCCESS; + int i, argp; + + if (odbc_check_rollback(handle)) + return APR_EGENERAL; + + if (random) { + rc = SQLSetStmtAttr(statement->stmt, SQL_ATTR_CURSOR_SCROLLABLE, + (SQLPOINTER) SQL_SCROLLABLE, 0); + CHECK_ERROR(handle, "SQLSetStmtAttr (SQL_ATTR_CURSOR_SCROLLABLE)", + rc, SQL_HANDLE_STMT, statement->stmt); + } + if (SQL_SUCCEEDED(rc)) { + for (i = argp = 0; i < statement->nargs && SQL_SUCCEEDED(rc); i++) + rc = odbc_bind_param(pool, statement, i + 1, statement->types[i], + &argp, (const void **) args, TEXTMODE); + } + if (SQL_SUCCEEDED(rc)) { + rc = SQLExecute(statement->stmt); + CHECK_ERROR(handle, "SQLExecute", rc, SQL_HANDLE_STMT, + statement->stmt); + } + if (SQL_SUCCEEDED(rc)) { + rc = odbc_create_results(handle, statement->stmt, pool, random, res); + apr_pool_cleanup_register(pool, *res, + odbc_close_results, apr_pool_cleanup_null); + } + return APR_FROM_SQL_RESULT(rc); +} + +/** pvselect: select using a prepared statement + args **/ +static int odbc_pvselect(apr_pool_t * pool, apr_dbd_t * handle, + apr_dbd_results_t ** res, + apr_dbd_prepared_t * statement, int random, + va_list args) +{ + const char **values; + int i; + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + for (i = 0; i < statement->nvals; i++) + values[i] = va_arg(args, const char *); + return odbc_pselect(pool, handle, res, statement, random, values); +} + +/** get_name: get a column title from a result set **/ +static const char *odbc_get_name(const apr_dbd_results_t * res, int col) +{ + SQLRETURN rc; + char buffer[MAX_COLUMN_NAME]; + SQLSMALLINT colnamelength, coltype, coldecimal, colnullable; + SQLULEN colsize; + + if (col >= res->ncols) + return NULL; /* bogus column number */ + if (res->colnames[col] != NULL) + return res->colnames[col]; /* we already retrieved it */ + rc = SQLDescribeCol(res->stmt, col + 1, + (SQLCHAR *)buffer, sizeof(buffer), &colnamelength, + &coltype, &colsize, &coldecimal, &colnullable); + CHECK_ERROR(res->apr_dbd, "SQLDescribeCol", rc, + SQL_HANDLE_STMT, res->stmt); + res->colnames[col] = apr_pstrdup(res->pool, buffer); + return res->colnames[col]; +} + +/** transaction_mode_get: get the mode of transaction **/ +static int odbc_transaction_mode_get(apr_dbd_transaction_t * trans) +{ + return (int) trans->apr_dbd->can_commit; +} + +/** transaction_mode_set: set the mode of transaction **/ +static int odbc_transaction_mode_set(apr_dbd_transaction_t * trans, int mode) +{ + int legal = ( APR_DBD_TRANSACTION_IGNORE_ERRORS + | APR_DBD_TRANSACTION_COMMIT + | APR_DBD_TRANSACTION_ROLLBACK); + + if ((mode & legal) != mode) + return APR_EGENERAL; + + trans->apr_dbd->can_commit = mode; + return APR_SUCCESS; +} + +/** pbquery: query using a prepared statement + binary args **/ +static int odbc_pbquery(apr_pool_t * pool, apr_dbd_t * handle, int *nrows, + apr_dbd_prepared_t * statement, const void **args) +{ + SQLRETURN rc = SQL_SUCCESS; + int i, argp; + + if (odbc_check_rollback(handle)) + return APR_EGENERAL; + + for (i = argp = 0; i < statement->nargs && SQL_SUCCEEDED(rc); i++) + rc = odbc_bind_param(pool, statement, i + 1, statement->types[i], + &argp, args, BINARYMODE); + + if (SQL_SUCCEEDED(rc)) { + rc = SQLExecute(statement->stmt); + CHECK_ERROR(handle, "SQLExecute", rc, SQL_HANDLE_STMT, + statement->stmt); + } + if (SQL_SUCCEEDED(rc)) { + SQLLEN rowcount; + + rc = SQLRowCount(statement->stmt, &rowcount); + *nrows = (int) rowcount; + CHECK_ERROR(handle, "SQLRowCount", rc, SQL_HANDLE_STMT, + statement->stmt); + } + return APR_FROM_SQL_RESULT(rc); +} + +/** pbselect: select using a prepared statement + binary args **/ +static int odbc_pbselect(apr_pool_t * pool, apr_dbd_t * handle, + apr_dbd_results_t ** res, + apr_dbd_prepared_t * statement, + int random, const void **args) +{ + SQLRETURN rc = SQL_SUCCESS; + int i, argp; + + if (odbc_check_rollback(handle)) + return APR_EGENERAL; + + if (random) { + rc = SQLSetStmtAttr(statement->stmt, SQL_ATTR_CURSOR_SCROLLABLE, + (SQLPOINTER) SQL_SCROLLABLE, 0); + CHECK_ERROR(handle, "SQLSetStmtAttr (SQL_ATTR_CURSOR_SCROLLABLE)", + rc, SQL_HANDLE_STMT, statement->stmt); + } + if (SQL_SUCCEEDED(rc)) { + for (i = argp = 0; i < statement->nargs && SQL_SUCCEEDED(rc); i++) { + rc = odbc_bind_param(pool, statement, i + 1, statement->types[i], + &argp, args, BINARYMODE); + } + } + if (SQL_SUCCEEDED(rc)) { + rc = SQLExecute(statement->stmt); + CHECK_ERROR(handle, "SQLExecute", rc, SQL_HANDLE_STMT, + statement->stmt); + } + if (SQL_SUCCEEDED(rc)) { + rc = odbc_create_results(handle, statement->stmt, pool, random, res); + apr_pool_cleanup_register(pool, *res, + odbc_close_results, apr_pool_cleanup_null); + } + + return APR_FROM_SQL_RESULT(rc); +} + +/** pvbquery: query using a prepared statement + binary args **/ +static int odbc_pvbquery(apr_pool_t * pool, apr_dbd_t * handle, int *nrows, + apr_dbd_prepared_t * statement, va_list args) +{ + const char **values; + int i; + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + for (i = 0; i < statement->nvals; i++) + values[i] = va_arg(args, const char *); + return odbc_pbquery(pool, handle, nrows, statement, (const void **) values); +} + +/** pvbselect: select using a prepared statement + binary args **/ +static int odbc_pvbselect(apr_pool_t * pool, apr_dbd_t * handle, + apr_dbd_results_t ** res, + apr_dbd_prepared_t * statement, + int random, va_list args) +{ + const char **values; + int i; + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + for (i = 0; i < statement->nvals; i++) + values[i] = va_arg(args, const char *); + return odbc_pbselect(pool, handle, res, statement, random, (const void **) values); +} + +APU_MODULE_DECLARE_DATA const apr_dbd_driver_t ODBC_DRIVER_ENTRY = { + ODBC_DRIVER_STRING, + odbc_init, + odbc_native_handle, + odbc_open, + odbc_check_conn, + odbc_close, + odbc_set_dbname, + odbc_start_transaction, + odbc_end_transaction, + odbc_query, + odbc_select, + odbc_num_cols, + odbc_num_tuples, + odbc_get_row, + odbc_get_entry, + odbc_error, + odbc_escape, + odbc_prepare, + odbc_pvquery, + odbc_pvselect, + odbc_pquery, + odbc_pselect, + odbc_get_name, + odbc_transaction_mode_get, + odbc_transaction_mode_set, + "?", + odbc_pvbquery, + odbc_pvbselect, + odbc_pbquery, + odbc_pbselect, + odbc_datum_get +}; + +#endif diff --git a/dbd/apr_dbd_odbc.dsp b/dbd/apr_dbd_odbc.dsp new file mode 100644 index 00000000000..4e6cf4c30d7 --- /dev/null +++ b/dbd/apr_dbd_odbc.dsp @@ -0,0 +1,191 @@ +# Microsoft Developer Studio Project File - Name="apr_dbd_odbc" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=apr_dbd_odbc - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr_dbd_odbc.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr_dbd_odbc.mak" CFG="apr_dbd_odbc - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr_dbd_odbc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_odbc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_odbc - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_odbc - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "apr_dbd_odbc - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "HAVE_SQL_H" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"Release/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_odbc-1.dll" /implib:"Release\apr_dbd_odbc-1.lib" /MACHINE:X86 /opt:ref +# Begin Special Build Tool +TargetPath=Release\apr_dbd_odbc-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_odbc - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /D "HAVE_SQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"Debug/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_odbc-1.dll" /implib:"Debug\apr_dbd_odbc-1.lib" /MACHINE:X86 +# Begin Special Build Tool +TargetPath=Debug\apr_dbd_odbc-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_odbc - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\Release" +# PROP BASE Intermediate_Dir "x64\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\Release" +# PROP Intermediate_Dir "x64\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "HAVE_SQL_H" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"x64\Release/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_odbc-1.dll" /implib:"x64\Release\apr_dbd_odbc-1.lib" /MACHINE:X64 /opt:ref +# Begin Special Build Tool +TargetPath=x64\Release\apr_dbd_odbc-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_odbc - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\Debug" +# PROP BASE Intermediate_Dir "x64\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\Debug" +# PROP Intermediate_Dir "x64\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /D "HAVE_SQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"x64/debug/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_odbc-1.dll" /implib:"x64\Debug\apr_dbd_odbc-1.lib" /MACHINE:X64 +# Begin Special Build Tool +TargetPath=x64\Debug\apr_dbd_odbc-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "apr_dbd_odbc - Win32 Release" +# Name "apr_dbd_odbc - Win32 Debug" +# Name "apr_dbd_odbc - x64 Release" +# Name "apr_dbd_odbc - x64 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\apr_dbd_odbc.c +# End Source File +# End Group +# Begin Group "Public Header Files" + +# PROP Default_Filter ".h" +# Begin Source File + +SOURCE=..\include\apr_dbd.h +# End Source File +# End Group +# Begin Group "Internal Header Files" + +# PROP Default_Filter ".h" +# End Group +# End Target +# End Project diff --git a/dbd/apr_dbd_oracle.c b/dbd/apr_dbd_oracle.c new file mode 100644 index 00000000000..7ef05f9680d --- /dev/null +++ b/dbd/apr_dbd_oracle.c @@ -0,0 +1,2220 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* Developed initially by Nick Kew and Chris Darroch. + * Contributed to the APR project by kind permission of + * Pearson Education Core Technology Group (CTG), + * formerly Central Media Group (CMG). + */ + +/* apr_dbd_oracle - a painful attempt + * + * Based first on the documentation at + * http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96584/toc.htm + * + * Those docs have a lot of internal inconsistencies, contradictions, etc + * So I've snarfed the demo programs (from Oracle 8, not included in + * the current downloadable oracle), and used code from them. + * + * Why do cdemo81.c and cdemo82.c do the same thing in very different ways? + * e.g. cdemo82 releases all its handle on shutdown; cdemo81 doesn't + * + * All the ORA* functions return a "sword". Some of them are documented; + * others aren't. So I've adopted a policy of using switch statements + * everywhere, even when we're not doing anything with the return values. + * + * This makes no attempt at performance tuning, such as setting + * prefetch cache size. We need some actual performance data + * to make that meaningful. Input from someone with experience + * as a sysop using oracle would be a good start. + */ + +/* shut compiler up */ +#ifdef DEBUG +#define int_errorcode int errorcode +#else +#define int_errorcode +#endif + +#include "apu.h" + +#if APU_HAVE_ORACLE + +#include +#include +#include + +#include + +#include "apr_strings.h" +#include "apr_lib.h" +#include "apr_time.h" +#include "apr_hash.h" +#include "apr_buckets.h" + +#define TRANS_TIMEOUT 30 +#define MAX_ARG_LEN 256 /* in line with other apr_dbd drivers. We alloc this + * lots of times, so a large value gets hungry. + * Should really make it configurable + */ +#define DEFAULT_LONG_SIZE 4096 +#define DBD_ORACLE_MAX_COLUMNS 256 +#define NUMERIC_FIELD_SIZE 32 + +#define CHECK_CONN_QUERY "SELECT 1 FROM dual" + +#define ERR_BUF_SIZE 200 + +#ifdef DEBUG +#include +#endif + +#include "apr_dbd_internal.h" + +/* declarations */ +static const char *dbd_oracle_error(apr_dbd_t *sql, int n); +static int dbd_oracle_prepare(apr_pool_t *pool, apr_dbd_t *sql, + const char *query, const char *label, + int nargs, int nvals, apr_dbd_type_e *types, + apr_dbd_prepared_t **statement); +static int outputParams(apr_dbd_t*, apr_dbd_prepared_t*); +static int dbd_oracle_pselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + apr_dbd_prepared_t *statement, + int seek, const char **values); +static int dbd_oracle_pquery(apr_pool_t *pool, apr_dbd_t *sql, + int *nrows, apr_dbd_prepared_t *statement, + const char **values); +static int dbd_oracle_start_transaction(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_transaction_t **trans); +static int dbd_oracle_end_transaction(apr_dbd_transaction_t *trans); + +struct apr_dbd_transaction_t { + int mode; + enum { TRANS_NONE, TRANS_ERROR, TRANS_1, TRANS_2 } status; + apr_dbd_t *handle; + OCITrans *trans; + OCISnapshot *snapshot1; + OCISnapshot *snapshot2; +}; + +struct apr_dbd_results_t { + apr_pool_t *pool; + apr_dbd_t* handle; + unsigned int rownum; + int seek; + int nrows; + apr_dbd_prepared_t *statement; +}; + +struct apr_dbd_t { + sword status; + OCIError *err; + OCIServer *svr; + OCISvcCtx *svc; + OCISession *auth; + apr_dbd_transaction_t* trans; + apr_pool_t *pool; + char buf[ERR_BUF_SIZE]; /* for error messages */ + apr_size_t long_size; + apr_dbd_prepared_t *check_conn_stmt; +}; + +struct apr_dbd_row_t { + int n; + apr_dbd_results_t *res; + apr_pool_t *pool; +}; + +typedef struct { + apr_dbd_type_e type; + sb2 ind; + sb4 len; + OCIBind *bind; + union { + void *raw; + char *sval; + int ival; + unsigned int uval; + double fval; + OCILobLocator *lobval; + } value; +} bind_arg; + +typedef struct { + int type; + sb2 ind; + ub2 len; /* length of actual output */ + OCIDefine *defn; + apr_size_t sz; /* length of buf for output */ + union { + void *raw; + char *sval; + OCILobLocator *lobval; + } buf; + const char *name; +} define_arg; + +struct apr_dbd_prepared_t { + OCIStmt *stmt; + int nargs; + int nvals; + bind_arg *args; + int nout; + define_arg *out; + apr_dbd_t *handle; + apr_pool_t *pool; + int type; +}; + +/* AFAICT from the docs, the OCIEnv thingey can be used async + * across threads, so lets have a global one. + * + * We'll need shorter-lived envs to deal with requests and connections + * + * Hmmm, that doesn't work: we don't have a usermem framework. + * OK, forget about using APR pools here, until we figure out + * the right way to do it (if such a thing exists). + */ +static OCIEnv *dbd_oracle_env = NULL; + +/* Oracle specific bucket for BLOB/CLOB types */ +typedef struct apr_bucket_lob apr_bucket_lob; +/** + * A bucket referring to a Oracle BLOB/CLOB + */ +struct apr_bucket_lob { + /** Number of buckets using this memory */ + apr_bucket_refcount refcount; + /** The row this bucket refers to */ + const apr_dbd_row_t *row; + /** The column this bucket refers to */ + int col; + /** The pool into which any needed structures should + * be created while reading from this bucket */ + apr_pool_t *readpool; +}; + +static void lob_bucket_destroy(void *data); +static apr_status_t lob_bucket_read(apr_bucket *e, const char **str, + apr_size_t *len, apr_read_type_e block); +static apr_bucket *apr_bucket_lob_make(apr_bucket *b, + const apr_dbd_row_t *row, int col, + apr_off_t offset, apr_size_t len, + apr_pool_t *p); +static apr_bucket *apr_bucket_lob_create(const apr_dbd_row_t *row, int col, + apr_off_t offset, + apr_size_t len, apr_pool_t *p, + apr_bucket_alloc_t *list); + +static const apr_bucket_type_t apr_bucket_type_lob = { + "LOB", 5, APR_BUCKET_DATA, + lob_bucket_destroy, + lob_bucket_read, + apr_bucket_setaside_notimpl, + apr_bucket_shared_split, + apr_bucket_shared_copy +}; + +static void lob_bucket_destroy(void *data) +{ + apr_bucket_lob *f = data; + + if (apr_bucket_shared_destroy(f)) { + /* no need to destroy database objects here; it will get + * done automatically when the pool gets cleaned up */ + apr_bucket_free(f); + } +} + +static apr_status_t lob_bucket_read(apr_bucket *e, const char **str, + apr_size_t *len, apr_read_type_e block) +{ + apr_bucket_lob *a = e->data; + const apr_dbd_row_t *row = a->row; + apr_dbd_results_t *res = row->res; + int col = a->col; + apr_bucket *b = NULL; + apr_size_t blength = e->length; /* bytes remaining in file past offset */ + apr_off_t boffset = e->start; + define_arg *val = &res->statement->out[col]; + apr_dbd_t *sql = res->handle; +/* Only with 10g, unfortunately + oraub8 length = APR_BUCKET_BUFF_SIZE; +*/ + ub4 length = APR_BUCKET_BUFF_SIZE; + char *buf = NULL; + + *str = NULL; /* in case we die prematurely */ + + /* fetch from offset if not at the beginning */ + buf = apr_palloc(row->pool, APR_BUCKET_BUFF_SIZE); + sql->status = OCILobRead(sql->svc, sql->err, val->buf.lobval, + &length, 1 + (size_t)boffset, + (dvoid*) buf, APR_BUCKET_BUFF_SIZE, + NULL, NULL, 0, SQLCS_IMPLICIT); +/* Only with 10g, unfortunately + sql->status = OCILobRead2(sql->svc, sql->err, val->buf.lobval, + &length, NULL, 1 + boffset, + (dvoid*) buf, APR_BUCKET_BUFF_SIZE, + OCI_ONE_PIECE, NULL, NULL, 0, SQLCS_IMPLICIT); +*/ + if (sql->status != OCI_SUCCESS) { + return APR_EGENERAL; + } + blength -= length; + *len = length; + *str = buf; + + /* + * Change the current bucket to refer to what we read, + * even if we read nothing because we hit EOF. + */ + apr_bucket_pool_make(e, *str, *len, res->pool); + + /* If we have more to read from the field, then create another bucket */ + if (blength > 0) { + /* for efficiency, we can just build a new apr_bucket struct + * to wrap around the existing LOB bucket */ + b = apr_bucket_alloc(sizeof(*b), e->list); + b->start = boffset + *len; + b->length = blength; + b->data = a; + b->type = &apr_bucket_type_lob; + b->free = apr_bucket_free; + b->list = e->list; + APR_BUCKET_INSERT_AFTER(e, b); + } + else { + lob_bucket_destroy(a); + } + + return APR_SUCCESS; +} + +static apr_bucket *apr_bucket_lob_make(apr_bucket *b, + const apr_dbd_row_t *row, int col, + apr_off_t offset, apr_size_t len, + apr_pool_t *p) +{ + apr_bucket_lob *f; + + f = apr_bucket_alloc(sizeof(*f), b->list); + f->row = row; + f->col = col; + f->readpool = p; + + b = apr_bucket_shared_make(b, f, offset, len); + b->type = &apr_bucket_type_lob; + + return b; +} + +static apr_bucket *apr_bucket_lob_create(const apr_dbd_row_t *row, int col, + apr_off_t offset, + apr_size_t len, apr_pool_t *p, + apr_bucket_alloc_t *list) +{ + apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); + + APR_BUCKET_INIT(b); + b->free = apr_bucket_free; + b->list = list; + return apr_bucket_lob_make(b, row, col, offset, len, p); +} + +static apr_status_t dbd_free_lobdesc(void *lob) +{ + switch (OCIDescriptorFree(lob, OCI_DTYPE_LOB)) { + case OCI_SUCCESS: + return APR_SUCCESS; + default: + return APR_EGENERAL; + } +} + +static apr_status_t dbd_free_snapshot(void *snap) +{ + switch (OCIDescriptorFree(snap, OCI_DTYPE_SNAP)) { + case OCI_SUCCESS: + return APR_SUCCESS; + default: + return APR_EGENERAL; + } +} + +static void dbd_oracle_init(apr_pool_t *pool) +{ + if (dbd_oracle_env == NULL) { + /* Sadly, OCI_SHARED seems to be impossible to use, due to + * various Oracle bugs. See, for example, Oracle MetaLink bug 2972890 + * and PHP bug http://bugs.php.net/bug.php?id=23733 + */ +#ifdef OCI_NEW_LENGTH_SEMANTICS + OCIEnvCreate(&dbd_oracle_env, OCI_THREADED|OCI_NEW_LENGTH_SEMANTICS, + NULL, NULL, NULL, NULL, 0, NULL); +#else + OCIEnvCreate(&dbd_oracle_env, OCI_THREADED, + NULL, NULL, NULL, NULL, 0, NULL); +#endif + } +} + +static apr_dbd_t *dbd_oracle_open(apr_pool_t *pool, const char *params, + const char **error) +{ + apr_dbd_t *ret = apr_pcalloc(pool, sizeof(apr_dbd_t)); + int errorcode; + + char *BLANK = ""; + struct { + const char *field; + char *value; + } fields[] = { + {"user", BLANK}, + {"pass", BLANK}, + {"dbname", BLANK}, + {"server", BLANK}, + {NULL, NULL} + }; + int i; + const char *ptr; + const char *key; + size_t klen; + const char *value; + size_t vlen; + static const char *const delims = " \r\n\t;|,"; + + ret->pool = pool; + ret->long_size = DEFAULT_LONG_SIZE; + + /* snitch parsing from the MySQL driver */ + for (ptr = strchr(params, '='); ptr; ptr = strchr(ptr, '=')) { + /* don't dereference memory that may not belong to us */ + if (ptr == params) { + ++ptr; + continue; + } + for (key = ptr-1; apr_isspace(*key); --key); + klen = 0; + while (apr_isalpha(*key)) { + if (key == params) { + /* Don't parse off the front of the params */ + --key; + ++klen; + break; + } + --key; + ++klen; + } + ++key; + for (value = ptr+1; apr_isspace(*value); ++value); + vlen = strcspn(value, delims); + for (i=0; fields[i].field != NULL; ++i) { + if (!strncasecmp(fields[i].field, key, klen)) { + fields[i].value = apr_pstrndup(pool, value, vlen); + break; + } + } + ptr = value+vlen; + } + + ret->status = OCIHandleAlloc(dbd_oracle_env, (dvoid**)&ret->err, + OCI_HTYPE_ERROR, 0, NULL); + switch (ret->status) { + default: +#ifdef DEBUG + printf("ret->status is %d\n", ret->status); + break; +#else + return NULL; +#endif + case OCI_SUCCESS: + break; + } + + ret->status = OCIHandleAlloc(dbd_oracle_env, (dvoid**)&ret->svr, + OCI_HTYPE_SERVER, 0, NULL); + switch (ret->status) { + default: +#ifdef DEBUG + OCIErrorGet(ret->err, 1, NULL, &errorcode, ret->buf, + sizeof(ret->buf), OCI_HTYPE_ERROR); + printf("OPEN ERROR %d (alloc svr): %s\n", ret->status, ret->buf); + break; +#else + if (error) { + *error = apr_pcalloc(pool, ERR_BUF_SIZE); + OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error), + ERR_BUF_SIZE, OCI_HTYPE_ERROR); + } + return NULL; +#endif + case OCI_SUCCESS: + break; + } + + ret->status = OCIHandleAlloc(dbd_oracle_env, (dvoid**)&ret->svc, + OCI_HTYPE_SVCCTX, 0, NULL); + switch (ret->status) { + default: +#ifdef DEBUG + OCIErrorGet(ret->err, 1, NULL, &errorcode, ret->buf, + sizeof(ret->buf), OCI_HTYPE_ERROR); + printf("OPEN ERROR %d (alloc svc): %s\n", ret->status, ret->buf); + break; +#else + if (error) { + *error = apr_pcalloc(pool, ERR_BUF_SIZE); + OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error), + ERR_BUF_SIZE, OCI_HTYPE_ERROR); + } + return NULL; +#endif + case OCI_SUCCESS: + break; + } + +/* All the examples use the #else */ +#if CAN_DO_LOGIN + ret->status = OCILogon(dbd_oracle_env, ret->err, &ret->svc, fields[0].value, + strlen(fields[0].value), fields[1].value, + strlen(fields[1].value), fields[2].value, + strlen(fields[2].value)); + switch (ret->status) { + default: +#ifdef DEBUG + OCIErrorGet(ret->err, 1, NULL, &errorcode, ret->buf, + sizeof(ret->buf), OCI_HTYPE_ERROR); + printf("OPEN ERROR: %s\n", ret->buf); + break; +#else + if (error) { + *error = apr_pcalloc(pool, ERR_BUF_SIZE); + OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error), + ERR_BUF_SIZE, OCI_HTYPE_ERROR); + } + return NULL; +#endif + case OCI_SUCCESS: + break; + } +#else + ret->status = OCIServerAttach(ret->svr, ret->err, (text*) fields[3].value, + strlen(fields[3].value), OCI_DEFAULT); + switch (ret->status) { + default: +#ifdef DEBUG + OCIErrorGet(ret->err, 1, NULL, &errorcode, ret->buf, + sizeof(ret->buf), OCI_HTYPE_ERROR); + printf("OPEN ERROR %d (server attach): %s\n", ret->status, ret->buf); + break; +#else + if (error) { + *error = apr_pcalloc(pool, ERR_BUF_SIZE); + OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error), + ERR_BUF_SIZE, OCI_HTYPE_ERROR); + } + return NULL; +#endif + case OCI_SUCCESS: + break; + } + ret->status = OCIAttrSet(ret->svc, OCI_HTYPE_SVCCTX, ret->svr, 0, + OCI_ATTR_SERVER, ret->err); + switch (ret->status) { + default: +#ifdef DEBUG + OCIErrorGet(ret->err, 1, NULL, &errorcode, ret->buf, + sizeof(ret->buf), OCI_HTYPE_ERROR); + printf("OPEN ERROR %d (attr set): %s\n", ret->status, ret->buf); + break; +#else + if (error) { + *error = apr_pcalloc(pool, ERR_BUF_SIZE); + OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error), + ERR_BUF_SIZE, OCI_HTYPE_ERROR); + } + return NULL; +#endif + case OCI_SUCCESS: + break; + } + ret->status = OCIHandleAlloc(dbd_oracle_env, (dvoid**)&ret->auth, + OCI_HTYPE_SESSION, 0, NULL); + switch (ret->status) { + default: +#ifdef DEBUG + OCIErrorGet(ret->err, 1, NULL, &errorcode, ret->buf, + sizeof(ret->buf), OCI_HTYPE_ERROR); + printf("OPEN ERROR %d (alloc auth): %s\n", ret->status, ret->buf); + break; +#else + if (error) { + *error = apr_pcalloc(pool, ERR_BUF_SIZE); + OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error), + ERR_BUF_SIZE, OCI_HTYPE_ERROR); + } + return NULL; +#endif + case OCI_SUCCESS: + break; + } + ret->status = OCIAttrSet(ret->auth, OCI_HTYPE_SESSION, fields[0].value, + strlen(fields[0].value), OCI_ATTR_USERNAME, ret->err); + switch (ret->status) { + default: +#ifdef DEBUG + OCIErrorGet(ret->err, 1, NULL, &errorcode, ret->buf, + sizeof(ret->buf), OCI_HTYPE_ERROR); + printf("OPEN ERROR %d (attr username): %s\n", ret->status, ret->buf); + break; +#else + if (error) { + *error = apr_pcalloc(pool, ERR_BUF_SIZE); + OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error), + ERR_BUF_SIZE, OCI_HTYPE_ERROR); + } + return NULL; +#endif + case OCI_SUCCESS: + break; + } + ret->status = OCIAttrSet(ret->auth, OCI_HTYPE_SESSION, fields[1].value, + strlen(fields[1].value), OCI_ATTR_PASSWORD, ret->err); + switch (ret->status) { + default: +#ifdef DEBUG + OCIErrorGet(ret->err, 1, NULL, &errorcode, ret->buf, + sizeof(ret->buf), OCI_HTYPE_ERROR); + printf("OPEN ERROR %d (attr password): %s\n", ret->status, ret->buf); + break; +#else + if (error) { + *error = apr_pcalloc(pool, ERR_BUF_SIZE); + OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error), + ERR_BUF_SIZE, OCI_HTYPE_ERROR); + } + return NULL; +#endif + case OCI_SUCCESS: + break; + } + ret->status = OCISessionBegin(ret->svc, ret->err, ret->auth, + OCI_CRED_RDBMS, OCI_DEFAULT); + switch (ret->status) { + default: +#ifdef DEBUG + OCIErrorGet(ret->err, 1, NULL, &errorcode, ret->buf, + sizeof(ret->buf), OCI_HTYPE_ERROR); + printf("OPEN ERROR %d (session begin): %s\n", ret->status, ret->buf); + break; +#else + if (error) { + *error = apr_pcalloc(pool, ERR_BUF_SIZE); + OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error), + ERR_BUF_SIZE, OCI_HTYPE_ERROR); + } + return NULL; +#endif + case OCI_SUCCESS: + break; + } + ret->status = OCIAttrSet(ret->svc, OCI_HTYPE_SVCCTX, ret->auth, 0, + OCI_ATTR_SESSION, ret->err); + switch (ret->status) { + default: +#ifdef DEBUG + OCIErrorGet(ret->err, 1, NULL, &errorcode, ret->buf, + sizeof(ret->buf), OCI_HTYPE_ERROR); + printf("OPEN ERROR %d (attr session): %s\n", ret->status, ret->buf); +#else + if (error) { + *error = apr_pcalloc(pool, ERR_BUF_SIZE); + OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error), + ERR_BUF_SIZE, OCI_HTYPE_ERROR); + } + return NULL; +#endif + break; + case OCI_SUCCESS: + break; + } +#endif + + if(dbd_oracle_prepare(pool, ret, CHECK_CONN_QUERY, NULL, 0, 0, NULL, + &ret->check_conn_stmt) != 0) { + return NULL; + } + + return ret; +} + +#ifdef EXPORT_NATIVE_FUNCS +static apr_size_t dbd_oracle_long_size_set(apr_dbd_t *sql, + apr_size_t long_size) +{ + apr_size_t old_size = sql->long_size; + sql->long_size = long_size; + return old_size; +} +#endif + +static const char *dbd_oracle_get_name(const apr_dbd_results_t *res, int n) +{ + define_arg *val = &res->statement->out[n]; + + if ((n < 0) || (n >= res->statement->nout)) { + return NULL; + } + return val->name; +} + +static int dbd_oracle_get_row(apr_pool_t *pool, apr_dbd_results_t *res, + apr_dbd_row_t **rowp, int rownum) +{ + apr_dbd_row_t *row = *rowp; + apr_dbd_t *sql = res->handle; + int_errorcode; + + if (row == NULL) { + row = apr_palloc(pool, sizeof(apr_dbd_row_t)); + *rowp = row; + row->res = res; + /* Oracle starts counting at 1 according to the docs */ + row->n = res->seek ? rownum : 1; + row->pool = pool; + } + else { + if (res->seek) { + row->n = rownum; + } + else { + ++row->n; + } + } + + if (res->seek) { + sql->status = OCIStmtFetch2(res->statement->stmt, res->handle->err, 1, + OCI_FETCH_ABSOLUTE, row->n, OCI_DEFAULT); + } + else { + sql->status = OCIStmtFetch2(res->statement->stmt, res->handle->err, 1, + OCI_FETCH_NEXT, 0, OCI_DEFAULT); + } + switch (sql->status) { + case OCI_SUCCESS: + (*rowp)->res = res; + return 0; + case OCI_NO_DATA: + return -1; + case OCI_ERROR: +#ifdef DEBUG + OCIErrorGet(sql->err, 1, NULL, &errorcode, + sql->buf, sizeof(sql->buf), OCI_HTYPE_ERROR); + printf("Execute error %d: %s\n", sql->status, sql->buf); +#endif + /* fallthrough */ + default: + return 1; + } + return 0; +} + +static const char *dbd_oracle_error(apr_dbd_t *sql, int n) +{ + /* This is ugly. Needs us to pass in a buffer of unknown size. + * Either we put it on the handle, or we have to keep allocing/copying + */ + sb4 errorcode; + + switch (sql->status) { + case OCI_SUCCESS: + return "OCI_SUCCESS"; + case OCI_SUCCESS_WITH_INFO: + return "OCI_SUCCESS_WITH_INFO"; + case OCI_NEED_DATA: + return "OCI_NEED_DATA"; + case OCI_NO_DATA: + return "OCI_NO_DATA"; + case OCI_INVALID_HANDLE: + return "OCI_INVALID_HANDLE"; + case OCI_STILL_EXECUTING: + return "OCI_STILL_EXECUTING"; + case OCI_CONTINUE: + return "OCI_CONTINUE"; + } + + switch (OCIErrorGet(sql->err, 1, NULL, &errorcode, + (text*) sql->buf, sizeof(sql->buf), OCI_HTYPE_ERROR)) { + case OCI_SUCCESS: + return sql->buf; + default: + return "internal error: OCIErrorGet failed"; + } +} + +static apr_status_t freeStatement(void *statement) +{ + int rv = APR_SUCCESS; + OCIStmt *stmt = ((apr_dbd_prepared_t*)statement)->stmt; + +#ifdef PREPARE2 + OCIError *err; + + if (OCIHandleAlloc(dbd_oracle_env, (dvoid**)&err, OCI_HTYPE_ERROR, + 0, NULL) != OCI_SUCCESS) { + return APR_EGENERAL; + } + if (OCIStmtRelease(stmt, err, NULL, 0, OCI_DEFAULT) != OCI_SUCCESS) { + rv = APR_EGENERAL; + } + if (OCIHandleFree(err, OCI_HTYPE_ERROR) != OCI_SUCCESS) { + rv = APR_EGENERAL; + } +#else + if (OCIHandleFree(stmt, OCI_HTYPE_STMT) != OCI_SUCCESS) { + rv = APR_EGENERAL; + } +#endif + + return rv; +} + +static int dbd_oracle_select(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + const char *query, int seek) +{ + int ret = 0; + apr_dbd_prepared_t *statement = NULL; + + ret = dbd_oracle_prepare(pool, sql, query, NULL, 0, 0, NULL, &statement); + if (ret != 0) { + return ret; + } + + ret = dbd_oracle_pselect(pool, sql, results, statement, seek, NULL); + if (ret != 0) { + return ret; + } + + return ret; +} + +static int dbd_oracle_query(apr_dbd_t *sql, int *nrows, const char *query) +{ + int ret = 0; + apr_pool_t *pool; + apr_dbd_prepared_t *statement = NULL; + + if (sql->trans && sql->trans->status == TRANS_ERROR) { + return 1; + } + + /* make our own pool so that APR allocations don't linger and so that + * both Stmt and LOB handles are cleaned up (LOB handles may be + * allocated when preparing APR_DBD_TYPE_CLOB/BLOBs) + */ + apr_pool_create(&pool, sql->pool); + + ret = dbd_oracle_prepare(pool, sql, query, NULL, 0, 0, NULL, &statement); + if (ret == 0) { + ret = dbd_oracle_pquery(pool, sql, nrows, statement, NULL); + if (ret == 0) { + sql->status = OCIAttrGet(statement->stmt, OCI_HTYPE_STMT, + nrows, 0, OCI_ATTR_ROW_COUNT, + sql->err); + } + } + + apr_pool_destroy(pool); + + return ret; +} + +static const char *dbd_oracle_escape(apr_pool_t *pool, const char *arg, + apr_dbd_t *sql) +{ + return arg; /* OCI has no concept of string escape */ +} + +static int dbd_oracle_prepare(apr_pool_t *pool, apr_dbd_t *sql, + const char *query, const char *label, + int nargs, int nvals, apr_dbd_type_e *types, + apr_dbd_prepared_t **statement) +{ + int ret = 0; + int i; + apr_dbd_prepared_t *stmt ; + + if (*statement == NULL) { + *statement = apr_pcalloc(pool, sizeof(apr_dbd_prepared_t)); + } + stmt = *statement; + stmt->handle = sql; + stmt->pool = pool; + stmt->nargs = nargs; + stmt->nvals = nvals; + + /* populate our own args, if any */ + if (nargs > 0) { + stmt->args = apr_pcalloc(pool, nargs*sizeof(bind_arg)); + for (i = 0; i < nargs; i++) { + stmt->args[i].type = types[i]; + } + } + + sql->status = OCIHandleAlloc(dbd_oracle_env, (dvoid**) &stmt->stmt, + OCI_HTYPE_STMT, 0, NULL); + if (sql->status != OCI_SUCCESS) { + return 1; + } + + sql->status = OCIStmtPrepare(stmt->stmt, sql->err, (text*) query, + strlen(query), OCI_NTV_SYNTAX, OCI_DEFAULT); + if (sql->status != OCI_SUCCESS) { + OCIHandleFree(stmt->stmt, OCI_HTYPE_STMT); + return 1; + } + + apr_pool_cleanup_register(pool, stmt, freeStatement, + apr_pool_cleanup_null); + + /* Perl gets statement type here */ + sql->status = OCIAttrGet(stmt->stmt, OCI_HTYPE_STMT, &stmt->type, 0, + OCI_ATTR_STMT_TYPE, sql->err); + if (sql->status != OCI_SUCCESS) { + return 1; + } + +/* Perl sets PREFETCH_MEMORY here, but the docs say there's a working default */ +#if 0 + sql->status = OCIAttrSet(stmt->stmt, OCI_HTYPE_STMT, &prefetch_size, + sizeof(prefetch_size), OCI_ATTR_PREFETCH_MEMORY, + sql->err); + if (sql->status != OCI_SUCCESS) { + return 1; + } +#endif + + if (stmt->type == OCI_STMT_SELECT) { + ret = outputParams(sql, stmt); + } + return ret; +} + +static void dbd_oracle_bind(apr_dbd_prepared_t *statement, const char **values) +{ + OCIStmt *stmt = statement->stmt; + apr_dbd_t *sql = statement->handle; + int i, j; + sb2 null_ind = -1; + + for (i = 0, j = 0; i < statement->nargs; i++, j++) { + if (values[j] == NULL) { + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + NULL, 0, SQLT_STR, + &null_ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + } + else { + switch (statement->args[i].type) { + case APR_DBD_TYPE_BLOB: + { + char *data = (char *)values[j]; + int size = atoi((char*)values[++j]); + + /* skip table and column for now */ + j += 2; + + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + data, size, SQLT_LBI, + &statement->args[i].ind, + NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + } + break; + case APR_DBD_TYPE_CLOB: + { + char *data = (char *)values[j]; + int size = atoi((char*)values[++j]); + + /* skip table and column for now */ + j += 2; + + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + data, size, SQLT_LNG, + &statement->args[i].ind, + NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + } + break; + default: + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + (dvoid*) values[j], + strlen(values[j]) + 1, + SQLT_STR, + &statement->args[i].ind, + NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + } + } + + if (sql->status != OCI_SUCCESS) { + return; + } + } + + return; +} + +static int outputParams(apr_dbd_t *sql, apr_dbd_prepared_t *stmt) +{ + OCIParam *parms; + int i; + ub2 paramtype[DBD_ORACLE_MAX_COLUMNS]; + ub2 paramsize[DBD_ORACLE_MAX_COLUMNS]; + char *paramname[DBD_ORACLE_MAX_COLUMNS]; + ub4 paramnamelen[DBD_ORACLE_MAX_COLUMNS]; + int_errorcode; + + /* Perl uses 0 where we used 1 */ + sql->status = OCIStmtExecute(sql->svc, stmt->stmt, sql->err, 0, 0, + NULL, NULL, OCI_DESCRIBE_ONLY); + switch (sql->status) { + case OCI_SUCCESS: + case OCI_SUCCESS_WITH_INFO: + break; + case OCI_ERROR: +#ifdef DEBUG + OCIErrorGet(sql->err, 1, NULL, &errorcode, + sql->buf, sizeof(sql->buf), OCI_HTYPE_ERROR); + printf("Describing prepared statement: %s\n", sql->buf); +#endif + default: + return 1; + } + while (sql->status == OCI_SUCCESS) { + sql->status = OCIParamGet(stmt->stmt, OCI_HTYPE_STMT, + sql->err, (dvoid**)&parms, stmt->nout+1); + switch (sql->status) { + case OCI_SUCCESS: + sql->status = OCIAttrGet(parms, OCI_DTYPE_PARAM, + ¶mtype[stmt->nout], + 0, OCI_ATTR_DATA_TYPE, sql->err); + sql->status = OCIAttrGet(parms, OCI_DTYPE_PARAM, + ¶msize[stmt->nout], + 0, OCI_ATTR_DATA_SIZE, sql->err); + sql->status = OCIAttrGet(parms, OCI_DTYPE_PARAM, + ¶mname[stmt->nout], + ¶mnamelen[stmt->nout], + OCI_ATTR_NAME, sql->err); + ++stmt->nout; + } + } + switch (sql->status) { + case OCI_SUCCESS: + break; + case OCI_ERROR: + break; /* this is what we expect at end-of-loop */ + default: + return 1; + } + + /* OK, the above works. We have the params; now OCIDefine them */ + stmt->out = apr_palloc(stmt->pool, stmt->nout*sizeof(define_arg)); + for (i=0; inout; ++i) { + stmt->out[i].type = paramtype[i]; + stmt->out[i].len = stmt->out[i].sz = paramsize[i]; + stmt->out[i].name = apr_pstrmemdup(stmt->pool, + paramname[i], paramnamelen[i]); + switch (stmt->out[i].type) { + default: + switch (stmt->out[i].type) { + case SQLT_NUM: /* 2: numeric, Perl worst case=130+38+3 */ + stmt->out[i].sz = 171; + break; + case SQLT_CHR: /* 1: char */ + case SQLT_AFC: /* 96: ANSI fixed char */ + stmt->out[i].sz *= 4; /* ugh, wasteful UCS-4 handling */ + break; + case SQLT_DAT: /* 12: date, depends on NLS date format */ + stmt->out[i].sz = 75; + break; + case SQLT_BIN: /* 23: raw binary, perhaps UTF-16? */ + stmt->out[i].sz *= 2; + break; + case SQLT_RID: /* 11: rowid */ + case SQLT_RDD: /* 104: rowid descriptor */ + stmt->out[i].sz = 20; + break; + case SQLT_TIMESTAMP: /* 187: timestamp */ + case SQLT_TIMESTAMP_TZ: /* 188: timestamp with time zone */ + case SQLT_INTERVAL_YM: /* 189: interval year-to-month */ + case SQLT_INTERVAL_DS: /* 190: interval day-to-second */ + case SQLT_TIMESTAMP_LTZ: /* 232: timestamp with local time zone */ + stmt->out[i].sz = 75; + break; + default: +#ifdef DEBUG + printf("Unsupported data type: %d\n", stmt->out[i].type); +#endif + break; + } + ++stmt->out[i].sz; + stmt->out[i].buf.raw = apr_palloc(stmt->pool, stmt->out[i].sz); + sql->status = OCIDefineByPos(stmt->stmt, &stmt->out[i].defn, + sql->err, i+1, + stmt->out[i].buf.sval, + stmt->out[i].sz, SQLT_STR, + &stmt->out[i].ind, &stmt->out[i].len, + 0, OCI_DEFAULT); + break; + case SQLT_LNG: /* 8: long */ + stmt->out[i].sz = sql->long_size * 4 + 4; /* ugh, UCS-4 handling */ + stmt->out[i].buf.raw = apr_palloc(stmt->pool, stmt->out[i].sz); + sql->status = OCIDefineByPos(stmt->stmt, &stmt->out[i].defn, + sql->err, i+1, + stmt->out[i].buf.raw, + stmt->out[i].sz, SQLT_LVC, + &stmt->out[i].ind, NULL, + 0, OCI_DEFAULT); + break; + case SQLT_LBI: /* 24: long binary, perhaps UTF-16? */ + stmt->out[i].sz = sql->long_size * 2 + 4; /* room for int prefix */ + stmt->out[i].buf.raw = apr_palloc(stmt->pool, stmt->out[i].sz); + sql->status = OCIDefineByPos(stmt->stmt, &stmt->out[i].defn, + sql->err, i+1, + stmt->out[i].buf.raw, + stmt->out[i].sz, SQLT_LVB, + &stmt->out[i].ind, NULL, + 0, OCI_DEFAULT); + break; + case SQLT_BLOB: /* 113 */ + case SQLT_CLOB: /* 112 */ +/*http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96584/oci05bnd.htm#434937*/ + sql->status = OCIDescriptorAlloc(dbd_oracle_env, + (dvoid**)&stmt->out[i].buf.lobval, + OCI_DTYPE_LOB, 0, NULL); + apr_pool_cleanup_register(stmt->pool, stmt->out[i].buf.lobval, + dbd_free_lobdesc, + apr_pool_cleanup_null); + sql->status = OCIDefineByPos(stmt->stmt, &stmt->out[i].defn, + sql->err, i+1, + (dvoid*) &stmt->out[i].buf.lobval, + -1, stmt->out[i].type, + &stmt->out[i].ind, &stmt->out[i].len, + 0, OCI_DEFAULT); + break; + } + switch (sql->status) { + case OCI_SUCCESS: + break; + default: + return 1; + } + } + return 0; +} + +static int dbd_oracle_pquery(apr_pool_t *pool, apr_dbd_t *sql, + int *nrows, apr_dbd_prepared_t *statement, + const char **values) +{ + OCISnapshot *oldsnapshot = NULL; + OCISnapshot *newsnapshot = NULL; + apr_dbd_transaction_t* trans = sql->trans; + int exec_mode; + int_errorcode; + + if (trans) { + switch (trans->status) { + case TRANS_ERROR: + return -1; + case TRANS_NONE: + trans = NULL; + break; + case TRANS_1: + oldsnapshot = trans->snapshot1; + newsnapshot = trans->snapshot2; + trans->status = TRANS_2; + break; + case TRANS_2: + oldsnapshot = trans->snapshot2; + newsnapshot = trans->snapshot1; + trans->status = TRANS_1; + break; + } + exec_mode = OCI_DEFAULT; + } + else { + exec_mode = OCI_COMMIT_ON_SUCCESS; + } + + dbd_oracle_bind(statement, values); + + sql->status = OCIStmtExecute(sql->svc, statement->stmt, sql->err, 1, 0, + oldsnapshot, newsnapshot, exec_mode); + switch (sql->status) { + case OCI_SUCCESS: + break; + case OCI_ERROR: +#ifdef DEBUG + OCIErrorGet(sql->err, 1, NULL, &errorcode, + sql->buf, sizeof(sql->buf), OCI_HTYPE_ERROR); + printf("Execute error %d: %s\n", sql->status, sql->buf); +#endif + /* fallthrough */ + default: + if (TXN_NOTICE_ERRORS(trans)) { + trans->status = TRANS_ERROR; + } + return 1; + } + + sql->status = OCIAttrGet(statement->stmt, OCI_HTYPE_STMT, nrows, 0, + OCI_ATTR_ROW_COUNT, sql->err); + return 0; +} + +static int dbd_oracle_pvquery(apr_pool_t *pool, apr_dbd_t *sql, + int *nrows, apr_dbd_prepared_t *statement, + va_list args) +{ + const char **values; + int i; + + if (sql->trans && sql->trans->status == TRANS_ERROR) { + return -1; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const char*); + } + + return dbd_oracle_pquery(pool, sql, nrows, statement, values); +} + +static int dbd_oracle_pselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + apr_dbd_prepared_t *statement, + int seek, const char **values) +{ + int exec_mode = seek ? OCI_STMT_SCROLLABLE_READONLY : OCI_DEFAULT; + OCISnapshot *oldsnapshot = NULL; + OCISnapshot *newsnapshot = NULL; + apr_dbd_transaction_t* trans = sql->trans; + int_errorcode; + + if (trans) { + switch (trans->status) { + case TRANS_ERROR: + return 1; + case TRANS_NONE: + trans = NULL; + break; + case TRANS_1: + oldsnapshot = trans->snapshot1; + newsnapshot = trans->snapshot2; + trans->status = TRANS_2; + break; + case TRANS_2: + oldsnapshot = trans->snapshot2; + newsnapshot = trans->snapshot1; + trans->status = TRANS_1; + break; + } + } + + dbd_oracle_bind(statement, values); + + sql->status = OCIStmtExecute(sql->svc, statement->stmt, sql->err, 0, 0, + oldsnapshot, newsnapshot, exec_mode); + switch (sql->status) { + case OCI_SUCCESS: + break; + case OCI_ERROR: +#ifdef DEBUG + OCIErrorGet(sql->err, 1, NULL, &errorcode, + sql->buf, sizeof(sql->buf), OCI_HTYPE_ERROR); + printf("Executing prepared statement: %s\n", sql->buf); +#endif + /* fallthrough */ + default: + if (TXN_NOTICE_ERRORS(trans)) { + trans->status = TRANS_ERROR; + } + return 1; + } + + if (!*results) { + *results = apr_palloc(pool, sizeof(apr_dbd_results_t)); + } + (*results)->handle = sql; + (*results)->statement = statement; + (*results)->seek = seek; + (*results)->rownum = seek ? 0 : -1; + (*results)->pool = pool; + + return 0; +} + +static int dbd_oracle_pvselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + apr_dbd_prepared_t *statement, + int seek, va_list args) +{ + const char **values; + int i; + + if (sql->trans && sql->trans->status == TRANS_ERROR) { + return -1; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const char*); + } + + return dbd_oracle_pselect(pool, sql, results, statement, seek, values); +} + +static void dbd_oracle_bbind(apr_dbd_prepared_t * statement, + const void **values) +{ + OCIStmt *stmt = statement->stmt; + apr_dbd_t *sql = statement->handle; + int i, j; + sb2 null_ind = -1; + apr_dbd_type_e type; + + for (i = 0, j = 0; i < statement->nargs; i++, j++) { + type = (values[j] == NULL ? APR_DBD_TYPE_NULL + : statement->args[i].type); + + switch (type) { + case APR_DBD_TYPE_TINY: + statement->args[i].value.ival = *(char*)values[j]; + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + &statement->args[i].value.ival, + sizeof(statement->args[i].value.ival), + SQLT_INT, + &statement->args[i].ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + case APR_DBD_TYPE_UTINY: + statement->args[i].value.uval = *(unsigned char*)values[j]; + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + &statement->args[i].value.uval, + sizeof(statement->args[i].value.uval), + SQLT_UIN, + &statement->args[i].ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + case APR_DBD_TYPE_SHORT: + statement->args[i].value.ival = *(short*)values[j]; + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + &statement->args[i].value.ival, + sizeof(statement->args[i].value.ival), + SQLT_INT, + &statement->args[i].ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + case APR_DBD_TYPE_USHORT: + statement->args[i].value.uval = *(unsigned short*)values[j]; + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + &statement->args[i].value.uval, + sizeof(statement->args[i].value.uval), + SQLT_UIN, + &statement->args[i].ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + case APR_DBD_TYPE_INT: + statement->args[i].value.ival = *(int*)values[j]; + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + &statement->args[i].value.ival, + sizeof(statement->args[i].value.ival), + SQLT_INT, + &statement->args[i].ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + case APR_DBD_TYPE_UINT: + statement->args[i].value.uval = *(unsigned int*)values[j]; + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + &statement->args[i].value.uval, + sizeof(statement->args[i].value.uval), + SQLT_UIN, + &statement->args[i].ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + case APR_DBD_TYPE_LONG: + statement->args[i].value.sval = + apr_psprintf(statement->pool, "%ld", *(long*)values[j]); + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + statement->args[i].value.sval, + strlen(statement->args[i].value.sval)+1, + SQLT_STR, + &statement->args[i].ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + case APR_DBD_TYPE_ULONG: + statement->args[i].value.sval = + apr_psprintf(statement->pool, "%lu", + *(unsigned long*)values[j]); + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + statement->args[i].value.sval, + strlen(statement->args[i].value.sval)+1, + SQLT_STR, + &statement->args[i].ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + case APR_DBD_TYPE_LONGLONG: + statement->args[i].value.sval = + apr_psprintf(statement->pool, "%" APR_INT64_T_FMT, + *(apr_int64_t*)values[j]); + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + statement->args[i].value.sval, + strlen(statement->args[i].value.sval)+1, + SQLT_STR, + &statement->args[i].ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + case APR_DBD_TYPE_ULONGLONG: + statement->args[i].value.sval = + apr_psprintf(statement->pool, "%" APR_UINT64_T_FMT, + *(apr_uint64_t*)values[j]); + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + statement->args[i].value.sval, + strlen(statement->args[i].value.sval)+1, + SQLT_UIN, + &statement->args[i].ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + case APR_DBD_TYPE_FLOAT: + statement->args[i].value.fval = *(float*)values[j]; + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + &statement->args[i].value.fval, + sizeof(statement->args[i].value.fval), + SQLT_FLT, + &statement->args[i].ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + case APR_DBD_TYPE_DOUBLE: + statement->args[i].value.fval = *(double*)values[j]; + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + &statement->args[i].value.fval, + sizeof(statement->args[i].value.fval), + SQLT_FLT, + &statement->args[i].ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + case APR_DBD_TYPE_STRING: + case APR_DBD_TYPE_TEXT: + case APR_DBD_TYPE_TIME: + case APR_DBD_TYPE_DATE: + case APR_DBD_TYPE_DATETIME: + case APR_DBD_TYPE_TIMESTAMP: + case APR_DBD_TYPE_ZTIMESTAMP: + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + (dvoid*) values[j], + strlen(values[j]) + 1, + SQLT_STR, + &statement->args[i].ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + case APR_DBD_TYPE_BLOB: + { + char *data = (char *)values[j]; + apr_size_t size = *(apr_size_t*)values[++j]; + + /* skip table and column for now */ + j += 2; + + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + data, size, SQLT_LBI, + &statement->args[i].ind, + NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + } + break; + case APR_DBD_TYPE_CLOB: + { + char *data = (char *)values[j]; + apr_size_t size = *(apr_size_t*)values[++j]; + + /* skip table and column for now */ + j += 2; + + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + data, size, SQLT_LNG, + &statement->args[i].ind, + NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + } + break; + case APR_DBD_TYPE_NULL: + default: + sql->status = OCIBindByPos(stmt, &statement->args[i].bind, + sql->err, i + 1, + NULL, 0, SQLT_STR, + &null_ind, NULL, + (ub2) 0, (ub4) 0, + (ub4 *) 0, OCI_DEFAULT); + break; + } + + if (sql->status != OCI_SUCCESS) { + return; + } + } + + return; +} + +static int dbd_oracle_pbquery(apr_pool_t * pool, apr_dbd_t * sql, + int *nrows, apr_dbd_prepared_t * statement, + const void **values) +{ + OCISnapshot *oldsnapshot = NULL; + OCISnapshot *newsnapshot = NULL; + apr_dbd_transaction_t* trans = sql->trans; + int exec_mode; + int_errorcode; + + if (trans) { + switch (trans->status) { + case TRANS_ERROR: + return -1; + case TRANS_NONE: + trans = NULL; + break; + case TRANS_1: + oldsnapshot = trans->snapshot1; + newsnapshot = trans->snapshot2; + trans->status = TRANS_2; + break; + case TRANS_2: + oldsnapshot = trans->snapshot2; + newsnapshot = trans->snapshot1; + trans->status = TRANS_1; + break; + } + exec_mode = OCI_DEFAULT; + } + else { + exec_mode = OCI_COMMIT_ON_SUCCESS; + } + + dbd_oracle_bbind(statement, values); + + sql->status = OCIStmtExecute(sql->svc, statement->stmt, sql->err, 1, 0, + oldsnapshot, newsnapshot, exec_mode); + switch (sql->status) { + case OCI_SUCCESS: + break; + case OCI_ERROR: +#ifdef DEBUG + OCIErrorGet(sql->err, 1, NULL, &errorcode, + sql->buf, sizeof(sql->buf), OCI_HTYPE_ERROR); + printf("Execute error %d: %s\n", sql->status, sql->buf); +#endif + /* fallthrough */ + default: + if (TXN_NOTICE_ERRORS(trans)) { + trans->status = TRANS_ERROR; + } + return 1; + } + + sql->status = OCIAttrGet(statement->stmt, OCI_HTYPE_STMT, nrows, 0, + OCI_ATTR_ROW_COUNT, sql->err); + return 0; +} + +static int dbd_oracle_pvbquery(apr_pool_t * pool, apr_dbd_t * sql, + int *nrows, apr_dbd_prepared_t * statement, + va_list args) +{ + const void **values; + int i; + + if (sql->trans && sql->trans->status == TRANS_ERROR) { + return -1; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const void*); + } + + return dbd_oracle_pbquery(pool, sql, nrows, statement, values); +} + +static int dbd_oracle_pbselect(apr_pool_t * pool, apr_dbd_t * sql, + apr_dbd_results_t ** results, + apr_dbd_prepared_t * statement, + int seek, const void **values) +{ + int exec_mode = seek ? OCI_STMT_SCROLLABLE_READONLY : OCI_DEFAULT; + OCISnapshot *oldsnapshot = NULL; + OCISnapshot *newsnapshot = NULL; + apr_dbd_transaction_t* trans = sql->trans; + int_errorcode; + + if (trans) { + switch (trans->status) { + case TRANS_ERROR: + return 1; + case TRANS_NONE: + trans = NULL; + break; + case TRANS_1: + oldsnapshot = trans->snapshot1; + newsnapshot = trans->snapshot2; + trans->status = TRANS_2; + break; + case TRANS_2: + oldsnapshot = trans->snapshot2; + newsnapshot = trans->snapshot1; + trans->status = TRANS_1; + break; + } + } + + dbd_oracle_bbind(statement, values); + + sql->status = OCIStmtExecute(sql->svc, statement->stmt, sql->err, 0, 0, + oldsnapshot, newsnapshot, exec_mode); + switch (sql->status) { + case OCI_SUCCESS: + break; + case OCI_ERROR: +#ifdef DEBUG + OCIErrorGet(sql->err, 1, NULL, &errorcode, + sql->buf, sizeof(sql->buf), OCI_HTYPE_ERROR); + printf("Executing prepared statement: %s\n", sql->buf); +#endif + /* fallthrough */ + default: + if (TXN_NOTICE_ERRORS(trans)) { + trans->status = TRANS_ERROR; + } + return 1; + } + + if (!*results) { + *results = apr_palloc(pool, sizeof(apr_dbd_results_t)); + } + (*results)->handle = sql; + (*results)->statement = statement; + (*results)->seek = seek; + (*results)->rownum = seek ? 0 : -1; + (*results)->pool = pool; + + return 0; +} + +static int dbd_oracle_pvbselect(apr_pool_t * pool, apr_dbd_t * sql, + apr_dbd_results_t ** results, + apr_dbd_prepared_t * statement, int seek, + va_list args) +{ + const void **values; + int i; + + if (sql->trans && sql->trans->status == TRANS_ERROR) { + return -1; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const void*); + } + + return dbd_oracle_pbselect(pool, sql, results, statement, seek, values); +} + +static int dbd_oracle_start_transaction(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_transaction_t **trans) +{ + int ret = 0; + int_errorcode; + if (*trans) { + dbd_oracle_end_transaction(*trans); + } + else { + *trans = apr_pcalloc(pool, sizeof(apr_dbd_transaction_t)); + OCIHandleAlloc(dbd_oracle_env, (dvoid**)&(*trans)->trans, + OCI_HTYPE_TRANS, 0, 0); + OCIAttrSet(sql->svc, OCI_HTYPE_SVCCTX, (*trans)->trans, 0, + OCI_ATTR_TRANS, sql->err); + } + + + sql->status = OCITransStart(sql->svc, sql->err, TRANS_TIMEOUT, + OCI_TRANS_NEW); + switch (sql->status) { + case OCI_ERROR: +#ifdef DEBUG + OCIErrorGet(sql->err, 1, NULL, &errorcode, sql->buf, + sizeof(sql->buf), OCI_HTYPE_ERROR); + printf("Transaction: %s\n", sql->buf); +#endif + ret = 1; + break; + case OCI_SUCCESS: + (*trans)->handle = sql; + (*trans)->status = TRANS_1; + sql->trans = *trans; + switch (OCIDescriptorAlloc(dbd_oracle_env, + (dvoid**)&(*trans)->snapshot1, + OCI_DTYPE_SNAP, 0, NULL)) { + case OCI_SUCCESS: + apr_pool_cleanup_register(pool, (*trans)->snapshot1, + dbd_free_snapshot, apr_pool_cleanup_null); + break; + case OCI_INVALID_HANDLE: + ret = 1; + break; + } + switch (OCIDescriptorAlloc(dbd_oracle_env, + (dvoid**)&(*trans)->snapshot2, + OCI_DTYPE_SNAP, 0, NULL)) { + case OCI_SUCCESS: + apr_pool_cleanup_register(pool, (*trans)->snapshot2, + dbd_free_snapshot, apr_pool_cleanup_null); + break; + case OCI_INVALID_HANDLE: + ret = 1; + break; + } + break; + default: + ret = 1; + break; + } + return ret; +} + +static int dbd_oracle_end_transaction(apr_dbd_transaction_t *trans) +{ + int ret = 1; /* no transaction is an error cond */ + sword status; + apr_dbd_t *handle = trans->handle; + if (trans) { + switch (trans->status) { + case TRANS_NONE: /* No trans is an error here */ + status = OCI_ERROR; + break; + case TRANS_ERROR: + status = OCITransRollback(handle->svc, handle->err, OCI_DEFAULT); + break; + default: + /* rollback on explicit rollback request */ + if (TXN_DO_ROLLBACK(trans)) { + status = OCITransRollback(handle->svc, handle->err, OCI_DEFAULT); + } else { + status = OCITransCommit(handle->svc, handle->err, OCI_DEFAULT); + } + break; + } + + handle->trans = NULL; + + switch (status) { + case OCI_SUCCESS: + ret = 0; + break; + default: + ret = 3; + break; + } + } + return ret; +} + +static int dbd_oracle_transaction_mode_get(apr_dbd_transaction_t *trans) +{ + if (!trans) + return APR_DBD_TRANSACTION_COMMIT; + + return trans->mode; +} + +static int dbd_oracle_transaction_mode_set(apr_dbd_transaction_t *trans, + int mode) +{ + if (!trans) + return APR_DBD_TRANSACTION_COMMIT; + + return trans->mode = (mode & TXN_MODE_BITS); +} + +/* This doesn't work for BLOB because of NULLs, but it can fake it + * if the BLOB is really a string + */ +static const char *dbd_oracle_get_entry(const apr_dbd_row_t *row, int n) +{ + ub4 len = 0; + ub1 csform = 0; + ub2 csid = 0; + apr_size_t buflen = 0; + char *buf = NULL; + define_arg *val = &row->res->statement->out[n]; + apr_dbd_t *sql = row->res->handle; + int_errorcode; + + if ((n < 0) || (n >= row->res->statement->nout) || (val->ind == -1)) { + return NULL; + } + + switch (val->type) { + case SQLT_BLOB: + case SQLT_CLOB: + sql->status = OCILobGetLength(sql->svc, sql->err, val->buf.lobval, + &len); + switch (sql->status) { + case OCI_SUCCESS: + case OCI_SUCCESS_WITH_INFO: + if (len == 0) { + buf = ""; + } + break; + case OCI_ERROR: +#ifdef DEBUG + OCIErrorGet(sql->err, 1, NULL, &errorcode, + sql->buf, sizeof(sql->buf), OCI_HTYPE_ERROR); + printf("Finding LOB length: %s\n", sql->buf); + break; +#endif + default: + break; + } + + if (len == 0) { + break; + } + + if (val->type == APR_DBD_TYPE_CLOB) { +#if 1 + /* Is this necessary, or can it be defaulted? */ + sql->status = OCILobCharSetForm(dbd_oracle_env, sql->err, + val->buf.lobval, &csform); + if (sql->status == OCI_SUCCESS) { + sql->status = OCILobCharSetId(dbd_oracle_env, sql->err, + val->buf.lobval, &csid); + } + switch (sql->status) { + case OCI_SUCCESS: + case OCI_SUCCESS_WITH_INFO: + buflen = (len+1) * 4; /* ugh, wasteful UCS-4 handling */ + /* zeroise all - where the string ends depends on charset */ + buf = apr_pcalloc(row->pool, buflen); + break; +#ifdef DEBUG + case OCI_ERROR: + OCIErrorGet(sql->err, 1, NULL, &errorcode, + sql->buf, sizeof(sql->buf), OCI_HTYPE_ERROR); + printf("Reading LOB character set: %s\n", sql->buf); + break; /*** XXX?? ***/ +#endif + default: + break; /*** XXX?? ***/ + } +#else /* ignore charset */ + buflen = (len+1) * 4; /* ugh, wasteful UCS-4 handling */ + /* zeroise all - where the string ends depends on charset */ + buf = apr_pcalloc(row->pool, buflen); +#endif + } else { + /* BUG: this'll only work if the BLOB looks like a string */ + buflen = len; + buf = apr_palloc(row->pool, buflen+1); + buf[buflen] = 0; + } + + if (!buf) { + break; + } + + sql->status = OCILobRead(sql->svc, sql->err, val->buf.lobval, + &len, 1, (dvoid*) buf, buflen, + NULL, NULL, csid, csform); + switch (sql->status) { + case OCI_SUCCESS: + case OCI_SUCCESS_WITH_INFO: + break; +#ifdef DEBUG + case OCI_ERROR: + OCIErrorGet(sql->err, 1, NULL, &errorcode, + sql->buf, sizeof(sql->buf), OCI_HTYPE_ERROR); + printf("Reading LOB: %s\n", sql->buf); + buf = NULL; /*** XXX?? ***/ + break; +#endif + default: + buf = NULL; /*** XXX?? ***/ + break; + } + + break; + case SQLT_LNG: + case SQLT_LBI: + /* raw is struct { ub4 len; char *buf; } */ + len = *(ub4*) val->buf.raw; + buf = apr_pstrndup(row->pool, val->buf.sval + sizeof(ub4), len); + break; + default: + buf = apr_pstrndup(row->pool, val->buf.sval, val->len); + break; + } + return (const char*) buf; +} + +/* XXX Should this use Oracle proper API instead of calling get_entry()? */ +static apr_status_t dbd_oracle_datum_get(const apr_dbd_row_t *row, int n, + apr_dbd_type_e type, void *data) +{ + define_arg *val = &row->res->statement->out[n]; + const char *entry; + + if ((n < 0) || (n >= row->res->statement->nout)) { + return APR_EGENERAL; + } + + if(val->ind == -1) { + return APR_ENOENT; + } + + switch (type) { + case APR_DBD_TYPE_TINY: + entry = dbd_oracle_get_entry(row, n); + if (entry == NULL) { + return APR_ENOENT; + } + *(char*)data = atoi(entry); + break; + case APR_DBD_TYPE_UTINY: + entry = dbd_oracle_get_entry(row, n); + if (entry == NULL) { + return APR_ENOENT; + } + *(unsigned char*)data = atoi(entry); + break; + case APR_DBD_TYPE_SHORT: + entry = dbd_oracle_get_entry(row, n); + if (entry == NULL) { + return APR_ENOENT; + } + *(short*)data = atoi(entry); + break; + case APR_DBD_TYPE_USHORT: + entry = dbd_oracle_get_entry(row, n); + if (entry == NULL) { + return APR_ENOENT; + } + *(unsigned short*)data = atoi(entry); + break; + case APR_DBD_TYPE_INT: + entry = dbd_oracle_get_entry(row, n); + if (entry == NULL) { + return APR_ENOENT; + } + *(int*)data = atoi(entry); + break; + case APR_DBD_TYPE_UINT: + entry = dbd_oracle_get_entry(row, n); + if (entry == NULL) { + return APR_ENOENT; + } + *(unsigned int*)data = atoi(entry); + break; + case APR_DBD_TYPE_LONG: + entry = dbd_oracle_get_entry(row, n); + if (entry == NULL) { + return APR_ENOENT; + } + *(long*)data = atol(entry); + break; + case APR_DBD_TYPE_ULONG: + entry = dbd_oracle_get_entry(row, n); + if (entry == NULL) { + return APR_ENOENT; + } + *(unsigned long*)data = atol(entry); + break; + case APR_DBD_TYPE_LONGLONG: + entry = dbd_oracle_get_entry(row, n); + if (entry == NULL) { + return APR_ENOENT; + } + *(apr_int64_t*)data = apr_atoi64(entry); + break; + case APR_DBD_TYPE_ULONGLONG: + entry = dbd_oracle_get_entry(row, n); + if (entry == NULL) { + return APR_ENOENT; + } + *(apr_uint64_t*)data = apr_atoi64(entry); + break; + case APR_DBD_TYPE_FLOAT: + entry = dbd_oracle_get_entry(row, n); + if (entry == NULL) { + return APR_ENOENT; + } + *(float*)data = (float)atof(entry); + break; + case APR_DBD_TYPE_DOUBLE: + entry = dbd_oracle_get_entry(row, n); + if (entry == NULL) { + return APR_ENOENT; + } + *(double*)data = atof(entry); + break; + case APR_DBD_TYPE_STRING: + case APR_DBD_TYPE_TEXT: + case APR_DBD_TYPE_TIME: + case APR_DBD_TYPE_DATE: + case APR_DBD_TYPE_DATETIME: + case APR_DBD_TYPE_TIMESTAMP: + case APR_DBD_TYPE_ZTIMESTAMP: + entry = dbd_oracle_get_entry(row, n); + if (entry == NULL) { + return APR_ENOENT; + } + *(char**)data = (char*)entry; + break; + case APR_DBD_TYPE_BLOB: + case APR_DBD_TYPE_CLOB: + { + apr_bucket *e; + apr_bucket_brigade *b = (apr_bucket_brigade*)data; + apr_dbd_t *sql = row->res->handle; + ub4 len = 0; + + switch (val->type) { + case SQLT_BLOB: + case SQLT_CLOB: + sql->status = OCILobGetLength(sql->svc, sql->err, + val->buf.lobval, &len); + switch(sql->status) { + case OCI_SUCCESS: + case OCI_SUCCESS_WITH_INFO: + if (len == 0) { + e = apr_bucket_eos_create(b->bucket_alloc); + } + else { + e = apr_bucket_lob_create(row, n, 0, len, + row->pool, b->bucket_alloc); + } + break; + default: + return APR_ENOENT; + } + break; + default: + entry = dbd_oracle_get_entry(row, n); + if (entry == NULL) { + return APR_ENOENT; + } + e = apr_bucket_pool_create(entry, strlen(entry), + row->pool, b->bucket_alloc); + break; + } + APR_BRIGADE_INSERT_TAIL(b, e); + } + break; + case APR_DBD_TYPE_NULL: + *(void**)data = NULL; + break; + default: + return APR_EGENERAL; + } + + return APR_SUCCESS; +} + +static apr_status_t dbd_oracle_close(apr_dbd_t *handle) +{ + /* FIXME: none of the oracle docs/examples say anything about + * closing/releasing handles. Which seems unlikely ... + */ + + /* OK, let's grab from cdemo again. + * cdemo81 does nothing; cdemo82 does OCIHandleFree on the handles + */ + switch (OCISessionEnd(handle->svc, handle->err, handle->auth, + (ub4)OCI_DEFAULT)) { + default: + break; + } + switch (OCIServerDetach(handle->svr, handle->err, (ub4) OCI_DEFAULT )) { + default: + break; + } + /* does OCISessionEnd imply this? */ + switch (OCIHandleFree((dvoid *) handle->auth, (ub4) OCI_HTYPE_SESSION)) { + default: + break; + } + switch (OCIHandleFree((dvoid *) handle->svr, (ub4) OCI_HTYPE_SERVER)) { + default: + break; + } + switch (OCIHandleFree((dvoid *) handle->svc, (ub4) OCI_HTYPE_SVCCTX)) { + default: + break; + } + switch (OCIHandleFree((dvoid *) handle->err, (ub4) OCI_HTYPE_ERROR)) { + default: + break; + } + return APR_SUCCESS; +} + +static apr_status_t dbd_oracle_check_conn(apr_pool_t *pool, apr_dbd_t *sql) +{ + apr_dbd_results_t *res = NULL; + apr_dbd_row_t *row = NULL; + + if(dbd_oracle_pselect(pool, sql, &res, sql->check_conn_stmt, + 0, NULL) != 0) { + return APR_EGENERAL; + } + + if(dbd_oracle_get_row(pool, res, &row, -1) != 0) { + return APR_EGENERAL; + } + + if(dbd_oracle_get_row(pool, res, &row, -1) != -1) { + return APR_EGENERAL; + } + + return APR_SUCCESS; +} + +static int dbd_oracle_select_db(apr_pool_t *pool, apr_dbd_t *handle, + const char *name) +{ + /* FIXME: need to find this in the docs */ + return APR_ENOTIMPL; +} + +static void *dbd_oracle_native(apr_dbd_t *handle) +{ + /* FIXME: can we do anything better? Oracle doesn't seem to have + * a concept of a handle in the sense we use it. + */ + return dbd_oracle_env; +} + +static int dbd_oracle_num_cols(apr_dbd_results_t* res) +{ + return res->statement->nout; +} + +static int dbd_oracle_num_tuples(apr_dbd_results_t* res) +{ + if (!res->seek) { + return -1; + } + if (res->nrows >= 0) { + return res->nrows; + } + res->handle->status = OCIAttrGet(res->statement->stmt, OCI_HTYPE_STMT, + &res->nrows, 0, OCI_ATTR_ROW_COUNT, + res->handle->err); + return res->nrows; +} + +APU_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_oracle_driver = { + "oracle", + dbd_oracle_init, + dbd_oracle_native, + dbd_oracle_open, + dbd_oracle_check_conn, + dbd_oracle_close, + dbd_oracle_select_db, + dbd_oracle_start_transaction, + dbd_oracle_end_transaction, + dbd_oracle_query, + dbd_oracle_select, + dbd_oracle_num_cols, + dbd_oracle_num_tuples, + dbd_oracle_get_row, + dbd_oracle_get_entry, + dbd_oracle_error, + dbd_oracle_escape, + dbd_oracle_prepare, + dbd_oracle_pvquery, + dbd_oracle_pvselect, + dbd_oracle_pquery, + dbd_oracle_pselect, + dbd_oracle_get_name, + dbd_oracle_transaction_mode_get, + dbd_oracle_transaction_mode_set, + ":apr%d", + dbd_oracle_pvbquery, + dbd_oracle_pvbselect, + dbd_oracle_pbquery, + dbd_oracle_pbselect, + dbd_oracle_datum_get +}; +#endif diff --git a/dbd/apr_dbd_oracle.dsp b/dbd/apr_dbd_oracle.dsp new file mode 100644 index 00000000000..e5b97d9feda --- /dev/null +++ b/dbd/apr_dbd_oracle.dsp @@ -0,0 +1,207 @@ +# Microsoft Developer Studio Project File - Name="apr_dbd_oracle" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=apr_dbd_oracle - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr_dbd_oracle.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr_dbd_oracle.mak" CFG="apr_dbd_oracle - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr_dbd_oracle - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_oracle - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_oracle - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_oracle - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "apr_dbd_oracle - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"Release/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_oracle-1.dll" /pdb:"Release\apr_dbd_oracle-1.pdb" /implib:"Release\apr_dbd_oracle-1.lib" /MACHINE:X86 /opt:ref +# Begin Special Build Tool +TargetPath=Release\apr_dbd_oracle-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_oracle - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"Debug/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_oracle-1.dll" /pdb:"Debug\apr_dbd_oracle-1.pdb" /implib:"Debug\apr_dbd_oracle-1.lib" /MACHINE:X86 +# Begin Special Build Tool +TargetPath=Debug\apr_dbd_oracle-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_oracle - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\Release" +# PROP BASE Intermediate_Dir "x64\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\Release" +# PROP Intermediate_Dir "x64\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_oracle-1.dll" /pdb:"x64\Release\apr_dbd_oracle-1.pdb" /implib:"x64\Release\apr_dbd_oracle-1.lib" /MACHINE:X64 /opt:ref +# Begin Special Build Tool +TargetPath=x64\Release\apr_dbd_oracle-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_oracle - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\Debug" +# PROP BASE Intermediate_Dir "x64\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\Debug" +# PROP Intermediate_Dir "x64\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_oracle-1.dll" /pdb:"x64\Debug\apr_dbd_oracle-1.pdb" /implib:"x64\Debug\apr_dbd_oracle-1.lib" /MACHINE:X64 +# Begin Special Build Tool +TargetPath=x64\Debug\apr_dbd_oracle-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "apr_dbd_oracle - Win32 Release" +# Name "apr_dbd_oracle - Win32 Debug" +# Name "apr_dbd_oracle - x64 Release" +# Name "apr_dbd_oracle - x64 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\apr_dbd_oracle.c +# End Source File +# End Group +# Begin Group "Public Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\apr_dbd.h +# End Source File +# End Group +# Begin Group "Internal Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\private\apu_config.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_dbd_internal.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_internal.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\libaprutil.rc +# End Source File +# End Target +# End Project diff --git a/dbd/apr_dbd_pgsql.c b/dbd/apr_dbd_pgsql.c new file mode 100644 index 00000000000..606accd5b75 --- /dev/null +++ b/dbd/apr_dbd_pgsql.c @@ -0,0 +1,1315 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apu.h" + +#if APU_HAVE_PGSQL + +#include "apu_config.h" + +#include +#include + +#ifdef HAVE_LIBPQ_FE_H +#include +#elif defined(HAVE_POSTGRESQL_LIBPQ_FE_H) +#include +#endif + +#include "apr_strings.h" +#include "apr_time.h" +#include "apr_buckets.h" + +#include "apr_dbd_internal.h" + +struct apr_dbd_transaction_t { + int mode; + int errnum; + apr_dbd_t *handle; +}; + +struct apr_dbd_t { + PGconn *conn; + apr_dbd_transaction_t *trans; +}; + +struct apr_dbd_results_t { + int random; + PGconn *handle; + PGresult *res; + size_t ntuples; + size_t sz; + size_t index; + apr_pool_t *pool; +}; + +struct apr_dbd_row_t { + int n; + apr_dbd_results_t *res; +}; + +struct apr_dbd_prepared_t { + const char *name; + int prepared; + int nargs; + int nvals; + apr_dbd_type_e *types; +}; + +#define dbd_pgsql_is_success(x) (((x) == PGRES_EMPTY_QUERY) \ + || ((x) == PGRES_COMMAND_OK) \ + || ((x) == PGRES_TUPLES_OK)) + +static apr_status_t clear_result(void *data) +{ + PQclear(data); + return APR_SUCCESS; +} + +static int dbd_pgsql_select(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + const char *query, int seek) +{ + PGresult *res; + int ret; + if ( sql->trans && sql->trans->errnum ) { + return sql->trans->errnum; + } + if (seek) { /* synchronous query */ + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, "SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + return sql->trans->errnum = PGRES_FATAL_ERROR; + } + } + res = PQexec(sql->conn, query); + if (res) { + ret = PQresultStatus(res); + if (dbd_pgsql_is_success(ret)) { + ret = 0; + } else { + PQclear(res); + } + } else { + ret = PGRES_FATAL_ERROR; + } + if (ret != 0) { + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, + "ROLLBACK TO SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + return sql->trans->errnum = PGRES_FATAL_ERROR; + } + } else if (TXN_NOTICE_ERRORS(sql->trans)){ + sql->trans->errnum = ret; + } + return ret; + } else { + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, + "RELEASE SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + return sql->trans->errnum = PGRES_FATAL_ERROR; + } + } + } + if (!*results) { + *results = apr_pcalloc(pool, sizeof(apr_dbd_results_t)); + } + (*results)->res = res; + (*results)->ntuples = PQntuples(res); + (*results)->sz = PQnfields(res); + (*results)->random = seek; + (*results)->pool = pool; + apr_pool_cleanup_register(pool, res, clear_result, + apr_pool_cleanup_null); + } + else { + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, "SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + return sql->trans->errnum = PGRES_FATAL_ERROR; + } + } + if (PQsendQuery(sql->conn, query) == 0) { + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, + "ROLLBACK TO SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + return sql->trans->errnum = PGRES_FATAL_ERROR; + } + } else if (TXN_NOTICE_ERRORS(sql->trans)){ + sql->trans->errnum = 1; + } + return 1; + } else { + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, + "RELEASE SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + return sql->trans->errnum = PGRES_FATAL_ERROR; + } + } + } + if (*results == NULL) { + *results = apr_pcalloc(pool, sizeof(apr_dbd_results_t)); + } + (*results)->random = seek; + (*results)->handle = sql->conn; + (*results)->pool = pool; + } + return 0; +} + +static const char *dbd_pgsql_get_name(const apr_dbd_results_t *res, int n) +{ + if (res->res) { + if ((n>=0) && (PQnfields(res->res) > n)) { + return PQfname(res->res,n); + } + } + return NULL; +} + +static int dbd_pgsql_get_row(apr_pool_t *pool, apr_dbd_results_t *res, + apr_dbd_row_t **rowp, int rownum) +{ + apr_dbd_row_t *row = *rowp; + int sequential = ((rownum >= 0) && res->random) ? 0 : 1; + + if (row == NULL) { + row = apr_palloc(pool, sizeof(apr_dbd_row_t)); + *rowp = row; + row->res = res; + if ( sequential ) { + row->n = 0; + } + else { + if (rownum > 0) { + row->n = --rownum; + } + else { + return -1; /* invalid row */ + } + } + } + else { + if ( sequential ) { + ++row->n; + } + else { + if (rownum > 0) { + row->n = --rownum; + } + else { + return -1; /* invalid row */ + } + } + } + + if (res->random) { + if ((row->n >= 0) && (size_t)row->n >= res->ntuples) { + *rowp = NULL; + apr_pool_cleanup_run(pool, res->res, clear_result); + res->res = NULL; + return -1; + } + } + else { + if ((row->n >= 0) && (size_t)row->n >= res->ntuples) { + /* no data; we have to fetch some */ + row->n -= res->ntuples; + if (res->res != NULL) { + PQclear(res->res); + } + res->res = PQgetResult(res->handle); + if (res->res) { + res->ntuples = PQntuples(res->res); + while (res->ntuples == 0) { + /* if we got an empty result, clear it, wait a mo, try + * again */ + PQclear(res->res); + apr_sleep(100000); /* 0.1 secs */ + res->res = PQgetResult(res->handle); + if (res->res) { + res->ntuples = PQntuples(res->res); + } + else { + return -1; + } + } + if (res->sz == 0) { + res->sz = PQnfields(res->res); + } + } + else { + return -1; + } + } + } + return 0; +} + +static const char *dbd_pgsql_get_entry(const apr_dbd_row_t *row, int n) +{ + return PQgetvalue(row->res->res, row->n, n); +} + +static apr_status_t dbd_pgsql_datum_get(const apr_dbd_row_t *row, int n, + apr_dbd_type_e type, void *data) +{ + if (PQgetisnull(row->res->res, row->n, n)) { + return APR_ENOENT; + } + + switch (type) { + case APR_DBD_TYPE_TINY: + *(char*)data = atoi(PQgetvalue(row->res->res, row->n, n)); + break; + case APR_DBD_TYPE_UTINY: + *(unsigned char*)data = atoi(PQgetvalue(row->res->res, row->n, n)); + break; + case APR_DBD_TYPE_SHORT: + *(short*)data = atoi(PQgetvalue(row->res->res, row->n, n)); + break; + case APR_DBD_TYPE_USHORT: + *(unsigned short*)data = atoi(PQgetvalue(row->res->res, row->n, n)); + break; + case APR_DBD_TYPE_INT: + *(int*)data = atoi(PQgetvalue(row->res->res, row->n, n)); + break; + case APR_DBD_TYPE_UINT: + *(unsigned int*)data = atoi(PQgetvalue(row->res->res, row->n, n)); + break; + case APR_DBD_TYPE_LONG: + *(long*)data = atol(PQgetvalue(row->res->res, row->n, n)); + break; + case APR_DBD_TYPE_ULONG: + *(unsigned long*)data = atol(PQgetvalue(row->res->res, row->n, n)); + break; + case APR_DBD_TYPE_LONGLONG: + *(apr_int64_t*)data = apr_atoi64(PQgetvalue(row->res->res, row->n, n)); + break; + case APR_DBD_TYPE_ULONGLONG: + *(apr_uint64_t*)data = apr_atoi64(PQgetvalue(row->res->res, row->n, n)); + break; + case APR_DBD_TYPE_FLOAT: + *(float*)data = (float)atof(PQgetvalue(row->res->res, row->n, n)); + break; + case APR_DBD_TYPE_DOUBLE: + *(double*)data = atof(PQgetvalue(row->res->res, row->n, n)); + break; + case APR_DBD_TYPE_STRING: + case APR_DBD_TYPE_TEXT: + case APR_DBD_TYPE_TIME: + case APR_DBD_TYPE_DATE: + case APR_DBD_TYPE_DATETIME: + case APR_DBD_TYPE_TIMESTAMP: + case APR_DBD_TYPE_ZTIMESTAMP: + *(char**)data = PQgetvalue(row->res->res, row->n, n); + break; + case APR_DBD_TYPE_BLOB: + case APR_DBD_TYPE_CLOB: + { + apr_bucket *e; + apr_bucket_brigade *b = (apr_bucket_brigade*)data; + + e = apr_bucket_pool_create(PQgetvalue(row->res->res, row->n, n), + PQgetlength(row->res->res, row->n, n), + row->res->pool, b->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(b, e); + } + break; + case APR_DBD_TYPE_NULL: + *(void**)data = NULL; + break; + default: + return APR_EGENERAL; + } + + return APR_SUCCESS; +} + +static const char *dbd_pgsql_error(apr_dbd_t *sql, int n) +{ + return PQerrorMessage(sql->conn); +} + +static int dbd_pgsql_query(apr_dbd_t *sql, int *nrows, const char *query) +{ + PGresult *res; + int ret; + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, "SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + return sql->trans->errnum = PGRES_FATAL_ERROR; + } + } + + res = PQexec(sql->conn, query); + if (res) { + ret = PQresultStatus(res); + if (dbd_pgsql_is_success(ret)) { + /* ugh, making 0 return-success doesn't fit */ + ret = 0; + } + *nrows = atoi(PQcmdTuples(res)); + PQclear(res); + } + else { + ret = PGRES_FATAL_ERROR; + } + + if (ret != 0){ + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, + "ROLLBACK TO SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else if (TXN_NOTICE_ERRORS(sql->trans)){ + sql->trans->errnum = ret; + } + } else { + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, + "RELEASE SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } + } + + return ret; +} + +static const char *dbd_pgsql_escape(apr_pool_t *pool, const char *arg, + apr_dbd_t *sql) +{ + size_t len = strlen(arg); + char *ret = apr_palloc(pool, 2*len + 2); + PQescapeString(ret, arg, len); + return ret; +} + +static int dbd_pgsql_prepare(apr_pool_t *pool, apr_dbd_t *sql, + const char *query, const char *label, + int nargs, int nvals, apr_dbd_type_e *types, + apr_dbd_prepared_t **statement) +{ + char *sqlcmd; + char *sqlptr; + size_t length, qlen; + int i = 0; + const char **args; + size_t alen; + int ret; + PGresult *res; + + if (!*statement) { + *statement = apr_palloc(pool, sizeof(apr_dbd_prepared_t)); + } + (*statement)->nargs = nargs; + (*statement)->nvals = nvals; + (*statement)->types = types; + + args = apr_palloc(pool, nargs * sizeof(*args)); + + qlen = strlen(query); + length = qlen + 1; + + for (i = 0; i < nargs; i++) { + switch (types[i]) { + case APR_DBD_TYPE_TINY: + case APR_DBD_TYPE_UTINY: + case APR_DBD_TYPE_SHORT: + case APR_DBD_TYPE_USHORT: + args[i] = "smallint"; + break; + case APR_DBD_TYPE_INT: + case APR_DBD_TYPE_UINT: + args[i] = "integer"; + break; + case APR_DBD_TYPE_LONG: + case APR_DBD_TYPE_ULONG: + case APR_DBD_TYPE_LONGLONG: + case APR_DBD_TYPE_ULONGLONG: + args[i] = "bigint"; + break; + case APR_DBD_TYPE_FLOAT: + args[i] = "real"; + break; + case APR_DBD_TYPE_DOUBLE: + args[i] = "double precision"; + break; + case APR_DBD_TYPE_TEXT: + args[i] = "text"; + break; + case APR_DBD_TYPE_TIME: + args[i] = "time"; + break; + case APR_DBD_TYPE_DATE: + args[i] = "date"; + break; + case APR_DBD_TYPE_DATETIME: + case APR_DBD_TYPE_TIMESTAMP: + args[i] = "timestamp"; + break; + case APR_DBD_TYPE_ZTIMESTAMP: + args[i] = "timestamp with time zone"; + break; + case APR_DBD_TYPE_BLOB: + case APR_DBD_TYPE_CLOB: + args[i] = "bytea"; + break; + case APR_DBD_TYPE_NULL: + args[i] = "varchar"; /* XXX Eh? */ + break; + default: + args[i] = "varchar"; + break; + } + length += 1 + strlen(args[i]); + } + + if (!label) { + /* don't really prepare; use in execParams instead */ + (*statement)->prepared = 0; + (*statement)->name = apr_pstrdup(pool, query); + return 0; + } + (*statement)->name = apr_pstrdup(pool, label); + + /* length of SQL query that prepares this statement */ + length = 8 + strlen(label) + 2 + 4 + length + 1; + sqlcmd = apr_palloc(pool, length); + sqlptr = sqlcmd; + memcpy(sqlptr, "PREPARE ", 8); + sqlptr += 8; + length = strlen(label); + memcpy(sqlptr, label, length); + sqlptr += length; + if (nargs > 0) { + memcpy(sqlptr, " (",2); + sqlptr += 2; + for (i=0; i < nargs; ++i) { + alen = strlen(args[i]); + memcpy(sqlptr, args[i], alen); + sqlptr += alen; + *sqlptr++ = ','; + } + sqlptr[-1] = ')'; + } + memcpy(sqlptr, " AS ", 4); + sqlptr += 4; + memcpy(sqlptr, query, qlen); + sqlptr += qlen; + *sqlptr = 0; + + res = PQexec(sql->conn, sqlcmd); + if ( res ) { + ret = PQresultStatus(res); + if (dbd_pgsql_is_success(ret)) { + ret = 0; + } + /* Hmmm, do we do this here or register it on the pool? */ + PQclear(res); + } + else { + ret = PGRES_FATAL_ERROR; + } + (*statement)->prepared = 1; + + return ret; +} + +static int dbd_pgsql_pquery_internal(apr_pool_t *pool, apr_dbd_t *sql, + int *nrows, apr_dbd_prepared_t *statement, + const char **values, + const int *len, const int *fmt) +{ + int ret; + PGresult *res; + + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, "SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + return sql->trans->errnum = PGRES_FATAL_ERROR; + } + } + + if (statement->prepared) { + res = PQexecPrepared(sql->conn, statement->name, statement->nargs, + values, len, fmt, 0); + } + else { + res = PQexecParams(sql->conn, statement->name, statement->nargs, 0, + values, len, fmt, 0); + } + if (res) { + ret = PQresultStatus(res); + if (dbd_pgsql_is_success(ret)) { + ret = 0; + } + *nrows = atoi(PQcmdTuples(res)); + PQclear(res); + } + else { + ret = PGRES_FATAL_ERROR; + } + + if (ret != 0){ + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, + "ROLLBACK TO SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else if (TXN_NOTICE_ERRORS(sql->trans)){ + sql->trans->errnum = ret; + } + } else { + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, + "RELEASE SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } + } + + return ret; +} + +static void dbd_pgsql_bind(apr_dbd_prepared_t *statement, + const char **values, + const char **val, int *len, int *fmt) +{ + int i, j; + + for (i = 0, j = 0; i < statement->nargs; i++, j++) { + if (values[j] == NULL) { + val[i] = NULL; + } + else { + switch (statement->types[i]) { + case APR_DBD_TYPE_BLOB: + case APR_DBD_TYPE_CLOB: + val[i] = (char *)values[j]; + len[i] = atoi(values[++j]); + fmt[i] = 1; + + /* skip table and column */ + j += 2; + break; + default: + val[i] = values[j]; + break; + } + } + } + + return; +} + +static int dbd_pgsql_pquery(apr_pool_t *pool, apr_dbd_t *sql, + int *nrows, apr_dbd_prepared_t *statement, + const char **values) +{ + int *len, *fmt; + const char **val; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + val = apr_palloc(pool, sizeof(*val) * statement->nargs); + len = apr_pcalloc(pool, sizeof(*len) * statement->nargs); + fmt = apr_pcalloc(pool, sizeof(*fmt) * statement->nargs); + + dbd_pgsql_bind(statement, values, val, len, fmt); + + return dbd_pgsql_pquery_internal(pool, sql, nrows, statement, + val, len, fmt); +} + +static int dbd_pgsql_pvquery(apr_pool_t *pool, apr_dbd_t *sql, + int *nrows, apr_dbd_prepared_t *statement, + va_list args) +{ + const char **values; + int i; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const char*); + } + + return dbd_pgsql_pquery(pool, sql, nrows, statement, values); +} + +static int dbd_pgsql_pselect_internal(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + apr_dbd_prepared_t *statement, + int seek, const char **values, + const int *len, const int *fmt) +{ + PGresult *res; + int rv; + int ret = 0; + + if (seek) { /* synchronous query */ + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, "SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } + if (statement->prepared) { + res = PQexecPrepared(sql->conn, statement->name, statement->nargs, + values, len, fmt, 0); + } + else { + res = PQexecParams(sql->conn, statement->name, statement->nargs, 0, + values, len, fmt, 0); + } + if (res) { + ret = PQresultStatus(res); + if (dbd_pgsql_is_success(ret)) { + ret = 0; + } + else { + PQclear(res); + } + } + else { + ret = PGRES_FATAL_ERROR; + } + if (ret != 0) { + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, + "ROLLBACK TO SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else if (TXN_NOTICE_ERRORS(sql->trans)){ + sql->trans->errnum = ret; + } + return ret; + } else { + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, + "RELEASE SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } + } + if (!*results) { + *results = apr_pcalloc(pool, sizeof(apr_dbd_results_t)); + } + (*results)->res = res; + (*results)->ntuples = PQntuples(res); + (*results)->sz = PQnfields(res); + (*results)->random = seek; + (*results)->pool = pool; + apr_pool_cleanup_register(pool, res, clear_result, + apr_pool_cleanup_null); + } + else { + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, "SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } + if (statement->prepared) { + rv = PQsendQueryPrepared(sql->conn, statement->name, + statement->nargs, values, len, fmt, 0); + } + else { + rv = PQsendQueryParams(sql->conn, statement->name, + statement->nargs, 0, values, len, fmt, 0); + } + if (rv == 0) { + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, + "ROLLBACK TO SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else if (TXN_NOTICE_ERRORS(sql->trans)){ + sql->trans->errnum = 1; + } + return 1; + } else { + if (TXN_IGNORE_ERRORS(sql->trans)) { + PGresult *res = PQexec(sql->conn, + "RELEASE SAVEPOINT APR_DBD_TXN_SP"); + if (res) { + ret = PQresultStatus(res); + PQclear(res); + if (!dbd_pgsql_is_success(ret)) { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } else { + sql->trans->errnum = ret; + return PGRES_FATAL_ERROR; + } + } + } + if (!*results) { + *results = apr_pcalloc(pool, sizeof(apr_dbd_results_t)); + } + (*results)->random = seek; + (*results)->handle = sql->conn; + (*results)->pool = pool; + } + + return ret; +} + +static int dbd_pgsql_pselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + apr_dbd_prepared_t *statement, + int seek, const char **values) +{ + int *len, *fmt; + const char **val; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + val = apr_palloc(pool, sizeof(*val) * statement->nargs); + len = apr_pcalloc(pool, sizeof(*len) * statement->nargs); + fmt = apr_pcalloc(pool, sizeof(*fmt) * statement->nargs); + + dbd_pgsql_bind(statement, values, val, len, fmt); + + return dbd_pgsql_pselect_internal(pool, sql, results, statement, + seek, val, len, fmt); +} + +static int dbd_pgsql_pvselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + apr_dbd_prepared_t *statement, + int seek, va_list args) +{ + const char **values; + int i; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const char*); + } + + return dbd_pgsql_pselect(pool, sql, results, statement, seek, values); +} + +static void dbd_pgsql_bbind(apr_pool_t *pool, apr_dbd_prepared_t * statement, + const void **values, + const char **val, int *len, int *fmt) +{ + int i, j; + apr_dbd_type_e type; + + for (i = 0, j = 0; i < statement->nargs; i++, j++) { + type = (values[j] == NULL ? APR_DBD_TYPE_NULL : statement->types[i]); + + switch (type) { + case APR_DBD_TYPE_TINY: + val[i] = apr_itoa(pool, *(char*)values[j]); + break; + case APR_DBD_TYPE_UTINY: + val[i] = apr_itoa(pool, *(unsigned char*)values[j]); + break; + case APR_DBD_TYPE_SHORT: + val[i] = apr_itoa(pool, *(short*)values[j]); + break; + case APR_DBD_TYPE_USHORT: + val[i] = apr_itoa(pool, *(unsigned short*)values[j]); + break; + case APR_DBD_TYPE_INT: + val[i] = apr_itoa(pool, *(int*)values[j]); + break; + case APR_DBD_TYPE_UINT: + val[i] = apr_itoa(pool, *(unsigned int*)values[j]); + break; + case APR_DBD_TYPE_LONG: + val[i] = apr_ltoa(pool, *(long*)values[j]); + break; + case APR_DBD_TYPE_ULONG: + val[i] = apr_ltoa(pool, *(unsigned long*)values[j]); + break; + case APR_DBD_TYPE_LONGLONG: + val[i] = apr_psprintf(pool, "%" APR_INT64_T_FMT, + *(apr_int64_t*)values[j]); + break; + case APR_DBD_TYPE_ULONGLONG: + val[i] = apr_psprintf(pool, "%" APR_UINT64_T_FMT, + *(apr_uint64_t*)values[j]); + break; + case APR_DBD_TYPE_FLOAT: + val[i] = apr_psprintf(pool, "%f", *(float*)values[j]); + break; + case APR_DBD_TYPE_DOUBLE: + val[i] = apr_psprintf(pool, "%lf", *(double*)values[j]); + break; + case APR_DBD_TYPE_STRING: + case APR_DBD_TYPE_TEXT: + case APR_DBD_TYPE_TIME: + case APR_DBD_TYPE_DATE: + case APR_DBD_TYPE_DATETIME: + case APR_DBD_TYPE_TIMESTAMP: + case APR_DBD_TYPE_ZTIMESTAMP: + val[i] = values[j]; + break; + case APR_DBD_TYPE_BLOB: + case APR_DBD_TYPE_CLOB: + val[i] = (char*)values[j]; + len[i] = *(apr_size_t*)values[++j]; + fmt[i] = 1; + + /* skip table and column */ + j += 2; + break; + case APR_DBD_TYPE_NULL: + default: + val[i] = NULL; + break; + } + } + + return; +} + +static int dbd_pgsql_pbquery(apr_pool_t * pool, apr_dbd_t * sql, + int *nrows, apr_dbd_prepared_t * statement, + const void **values) +{ + int *len, *fmt; + const char **val; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + val = apr_palloc(pool, sizeof(*val) * statement->nargs); + len = apr_pcalloc(pool, sizeof(*len) * statement->nargs); + fmt = apr_pcalloc(pool, sizeof(*fmt) * statement->nargs); + + dbd_pgsql_bbind(pool, statement, values, val, len, fmt); + + return dbd_pgsql_pquery_internal(pool, sql, nrows, statement, + val, len, fmt); +} + +static int dbd_pgsql_pvbquery(apr_pool_t * pool, apr_dbd_t * sql, + int *nrows, apr_dbd_prepared_t * statement, + va_list args) +{ + const void **values; + int i; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const void*); + } + + return dbd_pgsql_pbquery(pool, sql, nrows, statement, values); +} + +static int dbd_pgsql_pbselect(apr_pool_t * pool, apr_dbd_t * sql, + apr_dbd_results_t ** results, + apr_dbd_prepared_t * statement, + int seek, const void **values) +{ + int *len, *fmt; + const char **val; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + val = apr_palloc(pool, sizeof(*val) * statement->nargs); + len = apr_pcalloc(pool, sizeof(*len) * statement->nargs); + fmt = apr_pcalloc(pool, sizeof(*fmt) * statement->nargs); + + dbd_pgsql_bbind(pool, statement, values, val, len, fmt); + + return dbd_pgsql_pselect_internal(pool, sql, results, statement, + seek, val, len, fmt); +} + +static int dbd_pgsql_pvbselect(apr_pool_t * pool, apr_dbd_t * sql, + apr_dbd_results_t ** results, + apr_dbd_prepared_t * statement, int seek, + va_list args) +{ + const void **values; + int i; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const void*); + } + + return dbd_pgsql_pbselect(pool, sql, results, statement, seek, values); +} + +static int dbd_pgsql_start_transaction(apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_transaction_t **trans) +{ + int ret = 0; + PGresult *res; + + /* XXX handle recursive transactions here */ + + res = PQexec(handle->conn, "BEGIN TRANSACTION"); + if (res) { + ret = PQresultStatus(res); + if (dbd_pgsql_is_success(ret)) { + ret = 0; + if (!*trans) { + *trans = apr_pcalloc(pool, sizeof(apr_dbd_transaction_t)); + } + } + PQclear(res); + (*trans)->handle = handle; + handle->trans = *trans; + } + else { + ret = PGRES_FATAL_ERROR; + } + return ret; +} + +static int dbd_pgsql_end_transaction(apr_dbd_transaction_t *trans) +{ + PGresult *res; + int ret = -1; /* no transaction is an error cond */ + if (trans) { + /* rollback on error or explicit rollback request */ + if (trans->errnum || TXN_DO_ROLLBACK(trans)) { + trans->errnum = 0; + res = PQexec(trans->handle->conn, "ROLLBACK"); + } + else { + res = PQexec(trans->handle->conn, "COMMIT"); + } + if (res) { + ret = PQresultStatus(res); + if (dbd_pgsql_is_success(ret)) { + ret = 0; + } + PQclear(res); + } + else { + ret = PGRES_FATAL_ERROR; + } + trans->handle->trans = NULL; + } + return ret; +} + +static int dbd_pgsql_transaction_mode_get(apr_dbd_transaction_t *trans) +{ + if (!trans) + return APR_DBD_TRANSACTION_COMMIT; + + return trans->mode; +} + +static int dbd_pgsql_transaction_mode_set(apr_dbd_transaction_t *trans, + int mode) +{ + if (!trans) + return APR_DBD_TRANSACTION_COMMIT; + + return trans->mode = (mode & TXN_MODE_BITS); +} + +static void null_notice_receiver(void *arg, const PGresult *res) +{ + /* nothing */ +} + +static void null_notice_processor(void *arg, const char *message) +{ + /* nothing */ +} + +static apr_dbd_t *dbd_pgsql_open(apr_pool_t *pool, const char *params, + const char **error) +{ + apr_dbd_t *sql; + + PGconn *conn = PQconnectdb(params); + + /* if there's an error in the connect string or something we get + * back a * bogus connection object, and things like PQreset are + * liable to segfault, so just close it out now. it would be nice + * if we could give an indication of why we failed to connect... */ + if (PQstatus(conn) != CONNECTION_OK) { + if (error) { + *error = apr_pstrdup(pool, PQerrorMessage(conn)); + } + PQfinish(conn); + return NULL; + } + + PQsetNoticeReceiver(conn, null_notice_receiver, NULL); + PQsetNoticeProcessor(conn, null_notice_processor, NULL); + + sql = apr_pcalloc (pool, sizeof (*sql)); + + sql->conn = conn; + + return sql; +} + +static apr_status_t dbd_pgsql_close(apr_dbd_t *handle) +{ + PQfinish(handle->conn); + return APR_SUCCESS; +} + +static apr_status_t dbd_pgsql_check_conn(apr_pool_t *pool, + apr_dbd_t *handle) +{ + if (PQstatus(handle->conn) != CONNECTION_OK) { + PQreset(handle->conn); + if (PQstatus(handle->conn) != CONNECTION_OK) { + return APR_EGENERAL; + } + } + return APR_SUCCESS; +} + +static int dbd_pgsql_select_db(apr_pool_t *pool, apr_dbd_t *handle, + const char *name) +{ + return APR_ENOTIMPL; +} + +static void *dbd_pgsql_native(apr_dbd_t *handle) +{ + return handle->conn; +} + +static int dbd_pgsql_num_cols(apr_dbd_results_t* res) +{ + return res->sz; +} + +static int dbd_pgsql_num_tuples(apr_dbd_results_t* res) +{ + if (res->random) { + return res->ntuples; + } + else { + return -1; + } +} + +APU_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_pgsql_driver = { + "pgsql", + NULL, + dbd_pgsql_native, + dbd_pgsql_open, + dbd_pgsql_check_conn, + dbd_pgsql_close, + dbd_pgsql_select_db, + dbd_pgsql_start_transaction, + dbd_pgsql_end_transaction, + dbd_pgsql_query, + dbd_pgsql_select, + dbd_pgsql_num_cols, + dbd_pgsql_num_tuples, + dbd_pgsql_get_row, + dbd_pgsql_get_entry, + dbd_pgsql_error, + dbd_pgsql_escape, + dbd_pgsql_prepare, + dbd_pgsql_pvquery, + dbd_pgsql_pvselect, + dbd_pgsql_pquery, + dbd_pgsql_pselect, + dbd_pgsql_get_name, + dbd_pgsql_transaction_mode_get, + dbd_pgsql_transaction_mode_set, + "$%d", + dbd_pgsql_pvbquery, + dbd_pgsql_pvbselect, + dbd_pgsql_pbquery, + dbd_pgsql_pbselect, + dbd_pgsql_datum_get +}; +#endif diff --git a/dbd/apr_dbd_pgsql.dsp b/dbd/apr_dbd_pgsql.dsp new file mode 100644 index 00000000000..e7f146648d1 --- /dev/null +++ b/dbd/apr_dbd_pgsql.dsp @@ -0,0 +1,207 @@ +# Microsoft Developer Studio Project File - Name="apr_dbd_pgsql" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=apr_dbd_pgsql - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr_dbd_pgsql.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr_dbd_pgsql.mak" CFG="apr_dbd_pgsql - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr_dbd_pgsql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_pgsql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_pgsql - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_pgsql - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "apr_dbd_pgsql - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"Release/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_pgsql-1.dll" /pdb:"Release\apr_dbd_pgsql-1.pdb" /implib:"Release\apr_dbd_pgsql-1.lib" /MACHINE:X86 /opt:ref +# Begin Special Build Tool +TargetPath=Release\apr_dbd_pgsql-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_pgsql - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"Debug/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_pgsql-1.dll" /pdb:"Debug\apr_dbd_pgsql-1.pdb" /implib:"Debug\apr_dbd_pgsql-1.lib" /MACHINE:X86 +# Begin Special Build Tool +TargetPath=Debug\apr_dbd_pgsql-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_pgsql - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\Release" +# PROP BASE Intermediate_Dir "x64\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\Release" +# PROP Intermediate_Dir "x64\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_pgsql-1.dll" /pdb:"x64\Release\apr_dbd_pgsql-1.pdb" /implib:"x64\Release\apr_dbd_pgsql-1.lib" /MACHINE:X64 /opt:ref +# Begin Special Build Tool +TargetPath=x64\Release\apr_dbd_pgsql-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_pgsql - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\Debug" +# PROP BASE Intermediate_Dir "x64\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\Debug" +# PROP Intermediate_Dir "x64\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_pgsql-1.dll" /pdb:"x64\Debug\apr_dbd_pgsql-1.pdb" /implib:"x64\Debug\apr_dbd_pgsql-1.lib" /MACHINE:X64 +# Begin Special Build Tool +TargetPath=x64\Debug\apr_dbd_pgsql-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "apr_dbd_pgsql - Win32 Release" +# Name "apr_dbd_pgsql - Win32 Debug" +# Name "apr_dbd_pgsql - x64 Release" +# Name "apr_dbd_pgsql - x64 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\apr_dbd_pgsql.c +# End Source File +# End Group +# Begin Group "Public Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\apr_dbd.h +# End Source File +# End Group +# Begin Group "Internal Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\private\apu_config.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_dbd_internal.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_internal.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\libaprutil.rc +# End Source File +# End Target +# End Project diff --git a/dbd/apr_dbd_sqlite2.c b/dbd/apr_dbd_sqlite2.c new file mode 100644 index 00000000000..132ccc4c65a --- /dev/null +++ b/dbd/apr_dbd_sqlite2.c @@ -0,0 +1,566 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apu.h" + +#if APU_HAVE_SQLITE2 + +#include +#include + +#include + +#include "apr_strings.h" +#include "apr_time.h" +#include "apr_buckets.h" + +#include "apr_dbd_internal.h" + +struct apr_dbd_transaction_t { + int mode; + int errnum; + apr_dbd_t *handle; +}; + +struct apr_dbd_t { + sqlite *conn; + char *errmsg; + apr_dbd_transaction_t *trans; +}; + +struct apr_dbd_results_t { + int random; + sqlite *handle; + char **res; + size_t ntuples; + size_t sz; + size_t index; + apr_pool_t *pool; +}; + +struct apr_dbd_row_t { + int n; + char **data; + apr_dbd_results_t *res; +}; + +struct apr_dbd_prepared_t { + const char *name; + int prepared; +}; + +#define FREE_ERROR_MSG(dbd) \ + do { \ + if(dbd && dbd->errmsg) { \ + free(dbd->errmsg); \ + dbd->errmsg = NULL; \ + } \ + } while(0); + +static apr_status_t free_table(void *data) +{ + sqlite_free_table(data); + return APR_SUCCESS; +} + +static int dbd_sqlite_select(apr_pool_t * pool, apr_dbd_t * sql, + apr_dbd_results_t ** results, const char *query, + int seek) +{ + char **result; + int ret = 0; + int tuples = 0; + int fields = 0; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + FREE_ERROR_MSG(sql); + + ret = sqlite_get_table(sql->conn, query, &result, &tuples, &fields, + &sql->errmsg); + + if (ret == SQLITE_OK) { + if (!*results) { + *results = apr_pcalloc(pool, sizeof(apr_dbd_results_t)); + } + + (*results)->res = result; + (*results)->ntuples = tuples; + (*results)->sz = fields; + (*results)->random = seek; + (*results)->pool = pool; + + if (tuples > 0) + apr_pool_cleanup_register(pool, result, free_table, + apr_pool_cleanup_null); + + ret = 0; + } + else { + if (TXN_NOTICE_ERRORS(sql->trans)) { + sql->trans->errnum = ret; + } + } + + return ret; +} + +static const char *dbd_sqlite_get_name(const apr_dbd_results_t *res, int n) +{ + if ((n < 0) || (n >= res->sz)) { + return NULL; + } + + return res->res[n]; +} + +static int dbd_sqlite_get_row(apr_pool_t * pool, apr_dbd_results_t * res, + apr_dbd_row_t ** rowp, int rownum) +{ + apr_dbd_row_t *row = *rowp; + int sequential = ((rownum >= 0) && res->random) ? 0 : 1; + + if (row == NULL) { + row = apr_palloc(pool, sizeof(apr_dbd_row_t)); + *rowp = row; + row->res = res; + row->n = sequential ? 0 : rownum - 1; + } + else { + if (sequential) { + ++row->n; + } + else { + row->n = rownum - 1; + } + } + + if (row->n >= res->ntuples) { + *rowp = NULL; + apr_pool_cleanup_run(pool, res->res, free_table); + res->res = NULL; + return -1; + } + + /* Pointer magic explanation: + * The sqlite result is an array such that the first res->sz elements are + * the column names and each tuple follows afterwards + * ex: (from the sqlite2 documentation) + SELECT employee_name, login, host FROM users WHERE login LIKE * 'd%'; + + nrow = 2 + ncolumn = 3 + result[0] = "employee_name" + result[1] = "login" + result[2] = "host" + result[3] = "dummy" + result[4] = "No such user" + result[5] = 0 + result[6] = "D. Richard Hipp" + result[7] = "drh" + result[8] = "zadok" + */ + + row->data = res->res + res->sz + (res->sz * row->n); + + return 0; +} + +static const char *dbd_sqlite_get_entry(const apr_dbd_row_t * row, int n) +{ + if ((n < 0) || (n >= row->res->sz)) { + return NULL; + } + + return row->data[n]; +} + +static apr_status_t dbd_sqlite_datum_get(const apr_dbd_row_t *row, int n, + apr_dbd_type_e type, void *data) +{ + if ((n < 0) || (n >= row->res->sz)) { + return APR_EGENERAL; + } + + if (row->data[n] == NULL) { + return APR_ENOENT; + } + + switch (type) { + case APR_DBD_TYPE_TINY: + *(char*)data = atoi(row->data[n]); + break; + case APR_DBD_TYPE_UTINY: + *(unsigned char*)data = atoi(row->data[n]); + break; + case APR_DBD_TYPE_SHORT: + *(short*)data = atoi(row->data[n]); + break; + case APR_DBD_TYPE_USHORT: + *(unsigned short*)data = atoi(row->data[n]); + break; + case APR_DBD_TYPE_INT: + *(int*)data = atoi(row->data[n]); + break; + case APR_DBD_TYPE_UINT: + *(unsigned int*)data = atoi(row->data[n]); + break; + case APR_DBD_TYPE_LONG: + *(long*)data = atol(row->data[n]); + break; + case APR_DBD_TYPE_ULONG: + *(unsigned long*)data = atol(row->data[n]); + break; + case APR_DBD_TYPE_LONGLONG: + *(apr_int64_t*)data = apr_atoi64(row->data[n]); + break; + case APR_DBD_TYPE_ULONGLONG: + *(apr_uint64_t*)data = apr_atoi64(row->data[n]); + break; + case APR_DBD_TYPE_FLOAT: + *(float*)data = atof(row->data[n]); + break; + case APR_DBD_TYPE_DOUBLE: + *(double*)data = atof(row->data[n]); + break; + case APR_DBD_TYPE_STRING: + case APR_DBD_TYPE_TEXT: + case APR_DBD_TYPE_TIME: + case APR_DBD_TYPE_DATE: + case APR_DBD_TYPE_DATETIME: + case APR_DBD_TYPE_TIMESTAMP: + case APR_DBD_TYPE_ZTIMESTAMP: + *(char**)data = row->data[n]; + break; + case APR_DBD_TYPE_BLOB: + case APR_DBD_TYPE_CLOB: + { + apr_bucket *e; + apr_bucket_brigade *b = (apr_bucket_brigade*)data; + + e = apr_bucket_pool_create(row->data[n],strlen(row->data[n]), + row->res->pool, b->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(b, e); + } + break; + case APR_DBD_TYPE_NULL: + *(void**)data = NULL; + break; + default: + return APR_EGENERAL; + } + + return APR_SUCCESS; +} + +static const char *dbd_sqlite_error(apr_dbd_t * sql, int n) +{ + return sql->errmsg; +} + +static int dbd_sqlite_query(apr_dbd_t * sql, int *nrows, const char *query) +{ + char **result; + int ret; + int tuples = 0; + int fields = 0; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + FREE_ERROR_MSG(sql); + + ret = + sqlite_get_table(sql->conn, query, &result, &tuples, &fields, + &sql->errmsg); + if (ret == SQLITE_OK) { + *nrows = sqlite_changes(sql->conn); + + if (tuples > 0) + free(result); + + ret = 0; + } + + if (TXN_NOTICE_ERRORS(sql->trans)) { + sql->trans->errnum = ret; + } + + return ret; +} + +static apr_status_t free_mem(void *data) +{ + sqlite_freemem(data); + return APR_SUCCESS; +} + +static const char *dbd_sqlite_escape(apr_pool_t * pool, const char *arg, + apr_dbd_t * sql) +{ + char *ret = sqlite_mprintf("%q", arg); + apr_pool_cleanup_register(pool, ret, free_mem, apr_pool_cleanup_null); + return ret; +} + +static int dbd_sqlite_prepare(apr_pool_t * pool, apr_dbd_t * sql, + const char *query, const char *label, + int nargs, int nvals, apr_dbd_type_e *types, + apr_dbd_prepared_t ** statement) +{ + return APR_ENOTIMPL; +} + +static int dbd_sqlite_pquery(apr_pool_t * pool, apr_dbd_t * sql, + int *nrows, apr_dbd_prepared_t * statement, + const char **values) +{ + return APR_ENOTIMPL; +} + +static int dbd_sqlite_pvquery(apr_pool_t * pool, apr_dbd_t * sql, + int *nrows, apr_dbd_prepared_t * statement, + va_list args) +{ + return APR_ENOTIMPL; +} + +static int dbd_sqlite_pselect(apr_pool_t * pool, apr_dbd_t * sql, + apr_dbd_results_t ** results, + apr_dbd_prepared_t * statement, + int seek, const char **values) +{ + return APR_ENOTIMPL; +} + +static int dbd_sqlite_pvselect(apr_pool_t * pool, apr_dbd_t * sql, + apr_dbd_results_t ** results, + apr_dbd_prepared_t * statement, int seek, + va_list args) +{ + return APR_ENOTIMPL; +} + +static int dbd_sqlite_pbquery(apr_pool_t * pool, apr_dbd_t * sql, + int *nrows, apr_dbd_prepared_t * statement, + const void **values) +{ + return APR_ENOTIMPL; +} + +static int dbd_sqlite_pvbquery(apr_pool_t * pool, apr_dbd_t * sql, + int *nrows, apr_dbd_prepared_t * statement, + va_list args) +{ + return APR_ENOTIMPL; +} + +static int dbd_sqlite_pbselect(apr_pool_t * pool, apr_dbd_t * sql, + apr_dbd_results_t ** results, + apr_dbd_prepared_t * statement, + int seek, const void **values) +{ + return APR_ENOTIMPL; +} + +static int dbd_sqlite_pvbselect(apr_pool_t * pool, apr_dbd_t * sql, + apr_dbd_results_t ** results, + apr_dbd_prepared_t * statement, int seek, + va_list args) +{ + return APR_ENOTIMPL; +} + +static int dbd_sqlite_start_transaction(apr_pool_t * pool, apr_dbd_t * handle, + apr_dbd_transaction_t ** trans) +{ + int ret, rows; + + ret = dbd_sqlite_query(handle, &rows, "BEGIN TRANSACTION"); + if (ret == 0) { + if (!*trans) { + *trans = apr_pcalloc(pool, sizeof(apr_dbd_transaction_t)); + } + (*trans)->handle = handle; + handle->trans = *trans; + } + else { + ret = -1; + } + return ret; +} + +static int dbd_sqlite_end_transaction(apr_dbd_transaction_t * trans) +{ + int rows; + int ret = -1; /* no transaction is an error cond */ + + if (trans) { + /* rollback on error or explicit rollback request */ + if (trans->errnum || TXN_DO_ROLLBACK(trans)) { + trans->errnum = 0; + ret = + dbd_sqlite_query(trans->handle, &rows, + "ROLLBACK TRANSACTION"); + } + else { + ret = + dbd_sqlite_query(trans->handle, &rows, "COMMIT TRANSACTION"); + } + trans->handle->trans = NULL; + } + + return ret; +} + +static int dbd_sqlite_transaction_mode_get(apr_dbd_transaction_t *trans) +{ + if (!trans) + return APR_DBD_TRANSACTION_COMMIT; + + return trans->mode; +} + +static int dbd_sqlite_transaction_mode_set(apr_dbd_transaction_t *trans, + int mode) +{ + if (!trans) + return APR_DBD_TRANSACTION_COMMIT; + + return trans->mode = (mode & TXN_MODE_BITS); +} + +static apr_status_t error_free(void *data) +{ + free(data); + return APR_SUCCESS; +} + +static apr_dbd_t *dbd_sqlite_open(apr_pool_t * pool, const char *params_, + const char **error) +{ + apr_dbd_t *sql; + sqlite *conn = NULL; + char *perm; + int iperms = 600; + char* params = apr_pstrdup(pool, params_); + /* params = "[filename]:[permissions]" + * example: "shopping.db:600" + */ + + perm = strstr(params, ":"); + if (perm) { + *(perm++) = '\x00'; /* split the filename and permissions */ + + if (strlen(perm) > 0) + iperms = atoi(perm); + } + + if (error) { + *error = NULL; + + conn = sqlite_open(params, iperms, (char **)error); + + if (*error) { + apr_pool_cleanup_register(pool, *error, error_free, + apr_pool_cleanup_null); + } + } + else { + conn = sqlite_open(params, iperms, NULL); + } + + sql = apr_pcalloc(pool, sizeof(*sql)); + sql->conn = conn; + + return sql; +} + +static apr_status_t dbd_sqlite_close(apr_dbd_t * handle) +{ + if (handle->conn) { + sqlite_close(handle->conn); + handle->conn = NULL; + } + return APR_SUCCESS; +} + +static apr_status_t dbd_sqlite_check_conn(apr_pool_t * pool, + apr_dbd_t * handle) +{ + if (handle->conn == NULL) + return -1; + return APR_SUCCESS; +} + +static int dbd_sqlite_select_db(apr_pool_t * pool, apr_dbd_t * handle, + const char *name) +{ + return APR_ENOTIMPL; +} + +static void *dbd_sqlite_native(apr_dbd_t * handle) +{ + return handle->conn; +} + +static int dbd_sqlite_num_cols(apr_dbd_results_t * res) +{ + return res->sz; +} + +static int dbd_sqlite_num_tuples(apr_dbd_results_t * res) +{ + return res->ntuples; +} + +APU_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_sqlite2_driver = { + "sqlite2", + NULL, + dbd_sqlite_native, + dbd_sqlite_open, + dbd_sqlite_check_conn, + dbd_sqlite_close, + dbd_sqlite_select_db, + dbd_sqlite_start_transaction, + dbd_sqlite_end_transaction, + dbd_sqlite_query, + dbd_sqlite_select, + dbd_sqlite_num_cols, + dbd_sqlite_num_tuples, + dbd_sqlite_get_row, + dbd_sqlite_get_entry, + dbd_sqlite_error, + dbd_sqlite_escape, + dbd_sqlite_prepare, + dbd_sqlite_pvquery, + dbd_sqlite_pvselect, + dbd_sqlite_pquery, + dbd_sqlite_pselect, + dbd_sqlite_get_name, + dbd_sqlite_transaction_mode_get, + dbd_sqlite_transaction_mode_set, + NULL, + dbd_sqlite_pvbquery, + dbd_sqlite_pvbselect, + dbd_sqlite_pbquery, + dbd_sqlite_pbselect, + dbd_sqlite_datum_get +}; +#endif diff --git a/dbd/apr_dbd_sqlite2.dsp b/dbd/apr_dbd_sqlite2.dsp new file mode 100644 index 00000000000..29776067045 --- /dev/null +++ b/dbd/apr_dbd_sqlite2.dsp @@ -0,0 +1,207 @@ +# Microsoft Developer Studio Project File - Name="apr_dbd_sqlite2" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=apr_dbd_sqlite2 - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr_dbd_sqlite2.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr_dbd_sqlite2.mak" CFG="apr_dbd_sqlite2 - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr_dbd_sqlite2 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_sqlite2 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_sqlite2 - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_sqlite2 - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "apr_dbd_sqlite2 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"Release/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_sqlite2-1.dll" /pdb:"Release\apr_dbd_sqlite2-1.pdb" /implib:"Release\apr_dbd_sqlite2-1.lib" /MACHINE:X86 /opt:ref +# Begin Special Build Tool +TargetPath=Release\apr_dbd_sqlite2-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_sqlite2 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"Debug/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_sqlite2-1.dll" /pdb:"Debug\apr_dbd_sqlite2-1.pdb" /implib:"Debug\apr_dbd_sqlite2-1.lib" /MACHINE:X86 +# Begin Special Build Tool +TargetPath=Debug\apr_dbd_sqlite2-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_sqlite2 - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\Release" +# PROP BASE Intermediate_Dir "x64\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\Release" +# PROP Intermediate_Dir "x64\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_sqlite2-1.dll" /pdb:"x64\Release\apr_dbd_sqlite2-1.pdb" /implib:"x64\Release\apr_dbd_sqlite2-1.lib" /MACHINE:X64 /opt:ref +# Begin Special Build Tool +TargetPath=x64\Release\apr_dbd_sqlite2-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_sqlite2 - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\Debug" +# PROP BASE Intermediate_Dir "x64\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\Debug" +# PROP Intermediate_Dir "x64\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_sqlite2-1.dll" /pdb:"x64\Debug\apr_dbd_sqlite2-1.pdb" /implib:"x64\Debug\apr_dbd_sqlite2-1.lib" /MACHINE:X64 +# Begin Special Build Tool +TargetPath=x64\Debug\apr_dbd_sqlite2-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "apr_dbd_sqlite2 - Win32 Release" +# Name "apr_dbd_sqlite2 - Win32 Debug" +# Name "apr_dbd_sqlite2 - x64 Release" +# Name "apr_dbd_sqlite2 - x64 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\apr_dbd_sqlite2.c +# End Source File +# End Group +# Begin Group "Public Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\apr_dbd.h +# End Source File +# End Group +# Begin Group "Internal Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\private\apu_config.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_dbd_internal.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_internal.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\libaprutil.rc +# End Source File +# End Target +# End Project diff --git a/dbd/apr_dbd_sqlite3.c b/dbd/apr_dbd_sqlite3.c new file mode 100644 index 00000000000..02b2c02d35c --- /dev/null +++ b/dbd/apr_dbd_sqlite3.c @@ -0,0 +1,916 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apu.h" + +#if APU_HAVE_SQLITE3 + +#include +#include + +#include + +#include "apr_strings.h" +#include "apr_time.h" +#include "apr_buckets.h" + +#include "apr_dbd_internal.h" + +#define MAX_RETRY_COUNT 15 +#define MAX_RETRY_SLEEP 100000 + +struct apr_dbd_transaction_t { + int mode; + int errnum; + apr_dbd_t *handle; +}; + +struct apr_dbd_t { + sqlite3 *conn; + apr_dbd_transaction_t *trans; + apr_pool_t *pool; + apr_dbd_prepared_t *prep; +}; + +typedef struct { + char *name; + char *value; + int size; + int type; +} apr_dbd_column_t; + +struct apr_dbd_row_t { + apr_dbd_results_t *res; + apr_dbd_column_t **columns; + apr_dbd_row_t *next_row; + int columnCount; + int rownum; +}; + +struct apr_dbd_results_t { + int random; + sqlite3 *handle; + sqlite3_stmt *stmt; + apr_dbd_row_t *next_row; + size_t sz; + int tuples; + char **col_names; + apr_pool_t *pool; +}; + +struct apr_dbd_prepared_t { + sqlite3_stmt *stmt; + apr_dbd_prepared_t *next; + int nargs; + int nvals; + apr_dbd_type_e *types; +}; + +#define dbd_sqlite3_is_success(x) (((x) == SQLITE_DONE) || ((x) == SQLITE_OK)) + +static int dbd_sqlite3_select_internal(apr_pool_t *pool, + apr_dbd_t *sql, + apr_dbd_results_t **results, + sqlite3_stmt *stmt, int seek) +{ + int ret, retry_count = 0, column_count; + size_t i, num_tuples = 0; + int increment = 0; + apr_dbd_row_t *row = NULL; + apr_dbd_row_t *lastrow = NULL; + apr_dbd_column_t *column; + char *hold = NULL; + + column_count = sqlite3_column_count(stmt); + if (!*results) { + *results = apr_pcalloc(pool, sizeof(apr_dbd_results_t)); + } + (*results)->stmt = stmt; + (*results)->sz = column_count; + (*results)->random = seek; + (*results)->next_row = 0; + (*results)->tuples = 0; + (*results)->col_names = apr_pcalloc(pool, column_count * sizeof(char *)); + (*results)->pool = pool; + do { + ret = sqlite3_step(stmt); + if (ret == SQLITE_BUSY) { + if (retry_count++ > MAX_RETRY_COUNT) { + ret = SQLITE_ERROR; + } else { + apr_dbd_mutex_unlock(); + apr_sleep(MAX_RETRY_SLEEP); + apr_dbd_mutex_lock(); + } + } else if (ret == SQLITE_ROW) { + int length; + apr_dbd_column_t *col; + row = apr_palloc(pool, sizeof(apr_dbd_row_t)); + row->res = *results; + increment = sizeof(apr_dbd_column_t *); + length = increment * (*results)->sz; + row->columns = apr_palloc(pool, length); + row->columnCount = column_count; + for (i = 0; i < (*results)->sz; i++) { + column = apr_palloc(pool, sizeof(apr_dbd_column_t)); + row->columns[i] = column; + /* copy column name once only */ + if ((*results)->col_names[i] == NULL) { + (*results)->col_names[i] = + apr_pstrdup(pool, sqlite3_column_name(stmt, i)); + } + column->name = (*results)->col_names[i]; + column->size = sqlite3_column_bytes(stmt, i); + column->type = sqlite3_column_type(stmt, i); + column->value = NULL; + switch (column->type) { + case SQLITE_FLOAT: + case SQLITE_INTEGER: + case SQLITE_TEXT: + hold = (char *) sqlite3_column_text(stmt, i); + if (hold) { + column->value = apr_pstrmemdup(pool, hold, + column->size); + } + break; + case SQLITE_BLOB: + hold = (char *) sqlite3_column_blob(stmt, i); + if (hold) { + column->value = apr_pstrmemdup(pool, hold, + column->size); + } + break; + case SQLITE_NULL: + break; + } + col = row->columns[i]; + } + row->rownum = num_tuples++; + row->next_row = 0; + (*results)->tuples = num_tuples; + if ((*results)->next_row == 0) { + (*results)->next_row = row; + } + if (lastrow != 0) { + lastrow->next_row = row; + } + lastrow = row; + } + } while (ret == SQLITE_ROW || ret == SQLITE_BUSY); + + if (dbd_sqlite3_is_success(ret)) { + ret = 0; + } + return ret; +} + +static int dbd_sqlite3_select(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, const char *query, + int seek) +{ + sqlite3_stmt *stmt = NULL; + const char *tail = NULL; + int ret; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + apr_dbd_mutex_lock(); + + ret = sqlite3_prepare(sql->conn, query, strlen(query), &stmt, &tail); + if (dbd_sqlite3_is_success(ret)) { + ret = dbd_sqlite3_select_internal(pool, sql, results, stmt, seek); + } + sqlite3_finalize(stmt); + + apr_dbd_mutex_unlock(); + + if (TXN_NOTICE_ERRORS(sql->trans)) { + sql->trans->errnum = ret; + } + return ret; +} + +static const char *dbd_sqlite3_get_name(const apr_dbd_results_t *res, int n) +{ + if ((n < 0) || ((size_t)n >= res->sz)) { + return NULL; + } + + return res->col_names[n]; +} + +static int dbd_sqlite3_get_row(apr_pool_t *pool, apr_dbd_results_t *res, + apr_dbd_row_t **rowp, int rownum) +{ + int i = 0; + + if (rownum == -1) { + *rowp = res->next_row; + if (*rowp == 0) + return -1; + res->next_row = (*rowp)->next_row; + return 0; + } + if (rownum > res->tuples) { + return -1; + } + rownum--; + *rowp = res->next_row; + for (; *rowp != 0; i++, *rowp = (*rowp)->next_row) { + if (i == rownum) { + return 0; + } + } + + return -1; + +} + +static const char *dbd_sqlite3_get_entry(const apr_dbd_row_t *row, int n) +{ + apr_dbd_column_t *column; + const char *value; + if ((n < 0) || (n >= row->columnCount)) { + return NULL; + } + column = row->columns[n]; + value = column->value; + return value; +} + +static apr_status_t dbd_sqlite3_datum_get(const apr_dbd_row_t *row, int n, + apr_dbd_type_e type, void *data) +{ + if ((n < 0) || ((size_t)n >= row->res->sz)) { + return APR_EGENERAL; + } + + if (row->columns[n]->type == SQLITE_NULL) { + return APR_ENOENT; + } + + switch (type) { + case APR_DBD_TYPE_TINY: + *(char*)data = atoi(row->columns[n]->value); + break; + case APR_DBD_TYPE_UTINY: + *(unsigned char*)data = atoi(row->columns[n]->value); + break; + case APR_DBD_TYPE_SHORT: + *(short*)data = atoi(row->columns[n]->value); + break; + case APR_DBD_TYPE_USHORT: + *(unsigned short*)data = atoi(row->columns[n]->value); + break; + case APR_DBD_TYPE_INT: + *(int*)data = atoi(row->columns[n]->value); + break; + case APR_DBD_TYPE_UINT: + *(unsigned int*)data = atoi(row->columns[n]->value); + break; + case APR_DBD_TYPE_LONG: + *(long*)data = atol(row->columns[n]->value); + break; + case APR_DBD_TYPE_ULONG: + *(unsigned long*)data = atol(row->columns[n]->value); + break; + case APR_DBD_TYPE_LONGLONG: + *(apr_int64_t*)data = apr_atoi64(row->columns[n]->value); + break; + case APR_DBD_TYPE_ULONGLONG: + *(apr_uint64_t*)data = apr_atoi64(row->columns[n]->value); + break; + case APR_DBD_TYPE_FLOAT: + *(float*)data = (float)atof(row->columns[n]->value); + break; + case APR_DBD_TYPE_DOUBLE: + *(double*)data = atof(row->columns[n]->value); + break; + case APR_DBD_TYPE_STRING: + case APR_DBD_TYPE_TEXT: + case APR_DBD_TYPE_TIME: + case APR_DBD_TYPE_DATE: + case APR_DBD_TYPE_DATETIME: + case APR_DBD_TYPE_TIMESTAMP: + case APR_DBD_TYPE_ZTIMESTAMP: + *(char**)data = row->columns[n]->value; + break; + case APR_DBD_TYPE_BLOB: + case APR_DBD_TYPE_CLOB: + { + apr_bucket *e; + apr_bucket_brigade *b = (apr_bucket_brigade*)data; + + e = apr_bucket_pool_create(row->columns[n]->value, + row->columns[n]->size, + row->res->pool, b->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(b, e); + } + break; + case APR_DBD_TYPE_NULL: + *(void**)data = NULL; + break; + default: + return APR_EGENERAL; + } + + return APR_SUCCESS; +} + +static const char *dbd_sqlite3_error(apr_dbd_t *sql, int n) +{ + return sqlite3_errmsg(sql->conn); +} + +static int dbd_sqlite3_query_internal(apr_dbd_t *sql, sqlite3_stmt *stmt, + int *nrows) +{ + int ret = -1, retry_count = 0; + + while(retry_count++ <= MAX_RETRY_COUNT) { + ret = sqlite3_step(stmt); + if (ret != SQLITE_BUSY) + break; + + apr_dbd_mutex_unlock(); + apr_sleep(MAX_RETRY_SLEEP); + apr_dbd_mutex_lock(); + } + + *nrows = sqlite3_changes(sql->conn); + + if (dbd_sqlite3_is_success(ret)) { + ret = 0; + } + return ret; +} + +static int dbd_sqlite3_query(apr_dbd_t *sql, int *nrows, const char *query) +{ + sqlite3_stmt *stmt = NULL; + const char *tail = NULL; + int ret = -1, length = 0; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + length = strlen(query); + apr_dbd_mutex_lock(); + + do { + ret = sqlite3_prepare(sql->conn, query, length, &stmt, &tail); + if (ret != SQLITE_OK) { + sqlite3_finalize(stmt); + break; + } + + ret = dbd_sqlite3_query_internal(sql, stmt, nrows); + + sqlite3_finalize(stmt); + length -= (tail - query); + query = tail; + } while (length > 0); + + apr_dbd_mutex_unlock(); + + if (TXN_NOTICE_ERRORS(sql->trans)) { + sql->trans->errnum = ret; + } + return ret; +} + +static apr_status_t free_mem(void *data) +{ + sqlite3_free(data); + return APR_SUCCESS; +} + +static const char *dbd_sqlite3_escape(apr_pool_t *pool, const char *arg, + apr_dbd_t *sql) +{ + char *ret = sqlite3_mprintf("%q", arg); + apr_pool_cleanup_register(pool, ret, free_mem, + apr_pool_cleanup_null); + return ret; +} + +static int dbd_sqlite3_prepare(apr_pool_t *pool, apr_dbd_t *sql, + const char *query, const char *label, + int nargs, int nvals, apr_dbd_type_e *types, + apr_dbd_prepared_t **statement) +{ + sqlite3_stmt *stmt; + const char *tail = NULL; + int ret; + + apr_dbd_mutex_lock(); + + ret = sqlite3_prepare(sql->conn, query, strlen(query), &stmt, &tail); + if (ret == SQLITE_OK) { + apr_dbd_prepared_t *prep; + + prep = apr_pcalloc(sql->pool, sizeof(*prep)); + prep->stmt = stmt; + prep->next = sql->prep; + prep->nargs = nargs; + prep->nvals = nvals; + prep->types = types; + + /* link new statement to the handle */ + sql->prep = prep; + + *statement = prep; + } else { + sqlite3_finalize(stmt); + } + + apr_dbd_mutex_unlock(); + + return ret; +} + +static void dbd_sqlite3_bind(apr_dbd_prepared_t *statement, const char **values) +{ + sqlite3_stmt *stmt = statement->stmt; + int i, j; + + for (i = 0, j = 0; i < statement->nargs; i++, j++) { + if (values[j] == NULL) { + sqlite3_bind_null(stmt, i + 1); + } + else { + switch (statement->types[i]) { + case APR_DBD_TYPE_BLOB: + case APR_DBD_TYPE_CLOB: + { + char *data = (char *)values[j]; + int size = atoi((char*)values[++j]); + + /* skip table and column */ + j += 2; + + sqlite3_bind_blob(stmt, i + 1, data, size, SQLITE_STATIC); + } + break; + default: + sqlite3_bind_text(stmt, i + 1, values[j], + strlen(values[j]), SQLITE_STATIC); + break; + } + } + } + + return; +} + +static int dbd_sqlite3_pquery(apr_pool_t *pool, apr_dbd_t *sql, + int *nrows, apr_dbd_prepared_t *statement, + const char **values) +{ + sqlite3_stmt *stmt = statement->stmt; + int ret = -1; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + apr_dbd_mutex_lock(); + + ret = sqlite3_reset(stmt); + if (ret == SQLITE_OK) { + dbd_sqlite3_bind(statement, values); + + ret = dbd_sqlite3_query_internal(sql, stmt, nrows); + + sqlite3_reset(stmt); + } + + apr_dbd_mutex_unlock(); + + if (TXN_NOTICE_ERRORS(sql->trans)) { + sql->trans->errnum = ret; + } + return ret; +} + +static int dbd_sqlite3_pvquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows, + apr_dbd_prepared_t *statement, va_list args) +{ + const char **values; + int i; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const char*); + } + + return dbd_sqlite3_pquery(pool, sql, nrows, statement, values); +} + +static int dbd_sqlite3_pselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + apr_dbd_prepared_t *statement, int seek, + const char **values) +{ + sqlite3_stmt *stmt = statement->stmt; + int ret; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + apr_dbd_mutex_lock(); + + ret = sqlite3_reset(stmt); + if (ret == SQLITE_OK) { + dbd_sqlite3_bind(statement, values); + + ret = dbd_sqlite3_select_internal(pool, sql, results, stmt, seek); + + sqlite3_reset(stmt); + } + + apr_dbd_mutex_unlock(); + + if (TXN_NOTICE_ERRORS(sql->trans)) { + sql->trans->errnum = ret; + } + return ret; +} + +static int dbd_sqlite3_pvselect(apr_pool_t *pool, apr_dbd_t *sql, + apr_dbd_results_t **results, + apr_dbd_prepared_t *statement, int seek, + va_list args) +{ + const char **values; + int i; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const char*); + } + + return dbd_sqlite3_pselect(pool, sql, results, statement, seek, values); +} + +static void dbd_sqlite3_bbind(apr_dbd_prepared_t * statement, + const void **values) +{ + sqlite3_stmt *stmt = statement->stmt; + int i, j; + apr_dbd_type_e type; + + for (i = 0, j = 0; i < statement->nargs; i++, j++) { + type = (values[j] == NULL ? APR_DBD_TYPE_NULL : statement->types[i]); + + switch (type) { + case APR_DBD_TYPE_TINY: + sqlite3_bind_int(stmt, i + 1, *(char*)values[j]); + break; + case APR_DBD_TYPE_UTINY: + sqlite3_bind_int(stmt, i + 1, *(unsigned char*)values[j]); + break; + case APR_DBD_TYPE_SHORT: + sqlite3_bind_int(stmt, i + 1, *(short*)values[j]); + break; + case APR_DBD_TYPE_USHORT: + sqlite3_bind_int(stmt, i + 1, *(unsigned short*)values[j]); + break; + case APR_DBD_TYPE_INT: + sqlite3_bind_int(stmt, i + 1, *(int*)values[j]); + break; + case APR_DBD_TYPE_UINT: + sqlite3_bind_int(stmt, i + 1, *(unsigned int*)values[j]); + break; + case APR_DBD_TYPE_LONG: + sqlite3_bind_int64(stmt, i + 1, *(long*)values[j]); + break; + case APR_DBD_TYPE_ULONG: + sqlite3_bind_int64(stmt, i + 1, *(unsigned long*)values[j]); + break; + case APR_DBD_TYPE_LONGLONG: + sqlite3_bind_int64(stmt, i + 1, *(apr_int64_t*)values[j]); + break; + case APR_DBD_TYPE_ULONGLONG: + sqlite3_bind_int64(stmt, i + 1, *(apr_uint64_t*)values[j]); + break; + case APR_DBD_TYPE_FLOAT: + sqlite3_bind_double(stmt, i + 1, *(float*)values[j]); + break; + case APR_DBD_TYPE_DOUBLE: + sqlite3_bind_double(stmt, i + 1, *(double*)values[j]); + break; + case APR_DBD_TYPE_STRING: + case APR_DBD_TYPE_TEXT: + case APR_DBD_TYPE_TIME: + case APR_DBD_TYPE_DATE: + case APR_DBD_TYPE_DATETIME: + case APR_DBD_TYPE_TIMESTAMP: + case APR_DBD_TYPE_ZTIMESTAMP: + sqlite3_bind_text(stmt, i + 1, values[j], strlen(values[j]), + SQLITE_STATIC); + break; + case APR_DBD_TYPE_BLOB: + case APR_DBD_TYPE_CLOB: + { + char *data = (char*)values[j]; + apr_size_t size = *(apr_size_t*)values[++j]; + + sqlite3_bind_blob(stmt, i + 1, data, size, SQLITE_STATIC); + + /* skip table and column */ + j += 2; + } + break; + case APR_DBD_TYPE_NULL: + default: + sqlite3_bind_null(stmt, i + 1); + break; + } + } + + return; +} + +static int dbd_sqlite3_pbquery(apr_pool_t * pool, apr_dbd_t * sql, + int *nrows, apr_dbd_prepared_t * statement, + const void **values) +{ + sqlite3_stmt *stmt = statement->stmt; + int ret = -1; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + apr_dbd_mutex_lock(); + + ret = sqlite3_reset(stmt); + if (ret == SQLITE_OK) { + dbd_sqlite3_bbind(statement, values); + + ret = dbd_sqlite3_query_internal(sql, stmt, nrows); + + sqlite3_reset(stmt); + } + + apr_dbd_mutex_unlock(); + + if (TXN_NOTICE_ERRORS(sql->trans)) { + sql->trans->errnum = ret; + } + return ret; +} + +static int dbd_sqlite3_pvbquery(apr_pool_t * pool, apr_dbd_t * sql, + int *nrows, apr_dbd_prepared_t * statement, + va_list args) +{ + const void **values; + int i; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const void*); + } + + return dbd_sqlite3_pbquery(pool, sql, nrows, statement, values); +} + +static int dbd_sqlite3_pbselect(apr_pool_t * pool, apr_dbd_t * sql, + apr_dbd_results_t ** results, + apr_dbd_prepared_t * statement, + int seek, const void **values) +{ + sqlite3_stmt *stmt = statement->stmt; + int ret; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + apr_dbd_mutex_lock(); + + ret = sqlite3_reset(stmt); + if (ret == SQLITE_OK) { + dbd_sqlite3_bbind(statement, values); + + ret = dbd_sqlite3_select_internal(pool, sql, results, stmt, seek); + + sqlite3_reset(stmt); + } + + apr_dbd_mutex_unlock(); + + if (TXN_NOTICE_ERRORS(sql->trans)) { + sql->trans->errnum = ret; + } + return ret; +} + +static int dbd_sqlite3_pvbselect(apr_pool_t * pool, apr_dbd_t * sql, + apr_dbd_results_t ** results, + apr_dbd_prepared_t * statement, int seek, + va_list args) +{ + const void **values; + int i; + + if (sql->trans && sql->trans->errnum) { + return sql->trans->errnum; + } + + values = apr_palloc(pool, sizeof(*values) * statement->nvals); + + for (i = 0; i < statement->nvals; i++) { + values[i] = va_arg(args, const void*); + } + + return dbd_sqlite3_pbselect(pool, sql, results, statement, seek, values); +} + +static int dbd_sqlite3_start_transaction(apr_pool_t *pool, + apr_dbd_t *handle, + apr_dbd_transaction_t **trans) +{ + int ret = 0; + int nrows = 0; + + ret = dbd_sqlite3_query(handle, &nrows, "BEGIN IMMEDIATE"); + if (!*trans) { + *trans = apr_pcalloc(pool, sizeof(apr_dbd_transaction_t)); + (*trans)->handle = handle; + handle->trans = *trans; + } + + return ret; +} + +static int dbd_sqlite3_end_transaction(apr_dbd_transaction_t *trans) +{ + int ret = -1; /* ending transaction that was never started is an error */ + int nrows = 0; + + if (trans) { + /* rollback on error or explicit rollback request */ + if (trans->errnum || TXN_DO_ROLLBACK(trans)) { + trans->errnum = 0; + ret = dbd_sqlite3_query(trans->handle, &nrows, "ROLLBACK"); + } else { + ret = dbd_sqlite3_query(trans->handle, &nrows, "COMMIT"); + } + trans->handle->trans = NULL; + } + + return ret; +} + +static int dbd_sqlite3_transaction_mode_get(apr_dbd_transaction_t *trans) +{ + if (!trans) + return APR_DBD_TRANSACTION_COMMIT; + + return trans->mode; +} + +static int dbd_sqlite3_transaction_mode_set(apr_dbd_transaction_t *trans, + int mode) +{ + if (!trans) + return APR_DBD_TRANSACTION_COMMIT; + + return trans->mode = (mode & TXN_MODE_BITS); +} + +static apr_dbd_t *dbd_sqlite3_open(apr_pool_t *pool, const char *params, + const char **error) +{ + apr_dbd_t *sql = NULL; + sqlite3 *conn = NULL; + int sqlres; + if (!params) + return NULL; + sqlres = sqlite3_open(params, &conn); + if (sqlres != SQLITE_OK) { + if (error) { + *error = apr_pstrdup(pool, sqlite3_errmsg(conn)); + } + sqlite3_close(conn); + return NULL; + } + /* should we register rand or power functions to the sqlite VM? */ + sql = apr_pcalloc(pool, sizeof(*sql)); + sql->conn = conn; + sql->pool = pool; + sql->trans = NULL; + + return sql; +} + +static apr_status_t dbd_sqlite3_close(apr_dbd_t *handle) +{ + apr_dbd_prepared_t *prep = handle->prep; + + /* finalize all prepared statements, or we'll get SQLITE_BUSY on close */ + while (prep) { + sqlite3_finalize(prep->stmt); + prep = prep->next; + } + + sqlite3_close(handle->conn); + return APR_SUCCESS; +} + +static apr_status_t dbd_sqlite3_check_conn(apr_pool_t *pool, + apr_dbd_t *handle) +{ + return (handle->conn != NULL) ? APR_SUCCESS : APR_EGENERAL; +} + +static int dbd_sqlite3_select_db(apr_pool_t *pool, apr_dbd_t *handle, + const char *name) +{ + return APR_ENOTIMPL; +} + +static void *dbd_sqlite3_native(apr_dbd_t *handle) +{ + return handle->conn; +} + +static int dbd_sqlite3_num_cols(apr_dbd_results_t *res) +{ + return res->sz; +} + +static int dbd_sqlite3_num_tuples(apr_dbd_results_t *res) +{ + return res->tuples; +} + +APU_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_sqlite3_driver = { + "sqlite3", + NULL, + dbd_sqlite3_native, + dbd_sqlite3_open, + dbd_sqlite3_check_conn, + dbd_sqlite3_close, + dbd_sqlite3_select_db, + dbd_sqlite3_start_transaction, + dbd_sqlite3_end_transaction, + dbd_sqlite3_query, + dbd_sqlite3_select, + dbd_sqlite3_num_cols, + dbd_sqlite3_num_tuples, + dbd_sqlite3_get_row, + dbd_sqlite3_get_entry, + dbd_sqlite3_error, + dbd_sqlite3_escape, + dbd_sqlite3_prepare, + dbd_sqlite3_pvquery, + dbd_sqlite3_pvselect, + dbd_sqlite3_pquery, + dbd_sqlite3_pselect, + dbd_sqlite3_get_name, + dbd_sqlite3_transaction_mode_get, + dbd_sqlite3_transaction_mode_set, + "?", + dbd_sqlite3_pvbquery, + dbd_sqlite3_pvbselect, + dbd_sqlite3_pbquery, + dbd_sqlite3_pbselect, + dbd_sqlite3_datum_get +}; +#endif diff --git a/dbd/apr_dbd_sqlite3.dsp b/dbd/apr_dbd_sqlite3.dsp new file mode 100644 index 00000000000..8b332223ade --- /dev/null +++ b/dbd/apr_dbd_sqlite3.dsp @@ -0,0 +1,207 @@ +# Microsoft Developer Studio Project File - Name="apr_dbd_sqlite3" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=apr_dbd_sqlite3 - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr_dbd_sqlite3.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr_dbd_sqlite3.mak" CFG="apr_dbd_sqlite3 - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr_dbd_sqlite3 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_sqlite3 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_sqlite3 - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbd_sqlite3 - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "apr_dbd_sqlite3 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"Release/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_sqlite3-1.dll" /pdb:"Release\apr_dbd_sqlite3-1.pdb" /implib:"Release\apr_dbd_sqlite3-1.lib" /MACHINE:X86 /opt:ref +# Begin Special Build Tool +TargetPath=Release\apr_dbd_sqlite3-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_sqlite3 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"Debug/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_sqlite3-1.dll" /pdb:"Debug\apr_dbd_sqlite3-1.pdb" /implib:"Debug\apr_dbd_sqlite3-1.lib" /MACHINE:X86 +# Begin Special Build Tool +TargetPath=Debug\apr_dbd_sqlite3-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_sqlite3 - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\Release" +# PROP BASE Intermediate_Dir "x64\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\Release" +# PROP Intermediate_Dir "x64\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_sqlite3-1.dll" /pdb:"x64\Release\apr_dbd_sqlite3-1.pdb" /implib:"x64\Release\apr_dbd_sqlite3-1.lib" /MACHINE:X64 /opt:ref +# Begin Special Build Tool +TargetPath=x64\Release\apr_dbd_sqlite3-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbd_sqlite3 - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\Debug" +# PROP BASE Intermediate_Dir "x64\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\Debug" +# PROP Intermediate_Dir "x64\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_sqlite3-1.dll" /pdb:"x64\Debug\apr_dbd_sqlite3-1.pdb" /implib:"x64\Debug\apr_dbd_sqlite3-1.lib" /MACHINE:X64 +# Begin Special Build Tool +TargetPath=x64\Debug\apr_dbd_sqlite3-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "apr_dbd_sqlite3 - Win32 Release" +# Name "apr_dbd_sqlite3 - Win32 Debug" +# Name "apr_dbd_sqlite3 - x64 Release" +# Name "apr_dbd_sqlite3 - x64 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\apr_dbd_sqlite3.c +# End Source File +# End Group +# Begin Group "Public Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\apr_dbd.h +# End Source File +# End Group +# Begin Group "Internal Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\private\apu_config.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_dbd_internal.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_internal.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\libaprutil.rc +# End Source File +# End Target +# End Project diff --git a/dbm/NWGNUdbmdb b/dbm/NWGNUdbmdb new file mode 100644 index 00000000000..e60e108dfd5 --- /dev/null +++ b/dbm/NWGNUdbmdb @@ -0,0 +1,297 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +ifndef EnvironmentDefined +include $(APR_WORK)\build\NWGNUhead.inc +endif + +#include $(APR)\build\NWGNUcustom.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# LINK_STATIC = 1 + +# for now defined here - should finally go into build/NWGNUenvironment.inc +DB_INC = $(DBSDK)/inc +DB_IMP = $(DBSDK)/imp/libdb47.imp +DB_LIB = $(DBSDK)/lib/libdb47.lib +DB_NLM = libdb47 + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR)/include/arch/netware \ + $(APR)/include \ + $(APRUTIL)/include \ + $(APRUTIL)/include/private \ + $(APR) \ + $(DB_INC) \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + -DAPU_DSO_MODULE_BUILD \ + -DAPU_HAVE_DB=1 \ + -DAPU_HAVE_DB_VERSION=4 \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +ifdef LINK_STATIC +XLFLAGS += \ + -l $(DBSDK)/lib \ + $(EOLIST) +endif + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = dbmdb + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Apache Portability Runtime Library $(VERSION_STR) DBM Berkeley DB Driver Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = dbmdb + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)\$(NLM_NAME).nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/apr_dbm_berkeleydb.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +ifeq ($(LINK_STATIC),1) +FILES_nlm_libs += \ + $(DB_LIB) \ + $(EOLIST) +endif + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +ifneq ($(LINK_STATIC),1) +FILES_nlm_modules += \ + $(DB_NLM) \ + $(EOLIST) +endif + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + $(EOLIST) + +ifneq ($(LINK_STATIC),1) +FILES_nlm_Ximports += \ + @$(DB_IMP) \ + $(EOLIST) +endif + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + apr_dbm_type_db \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + + + diff --git a/dbm/NWGNUdbmgdbm b/dbm/NWGNUdbmgdbm new file mode 100644 index 00000000000..048f6fc793d --- /dev/null +++ b/dbm/NWGNUdbmgdbm @@ -0,0 +1,296 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +ifndef EnvironmentDefined +include $(APR_WORK)\build\NWGNUhead.inc +endif + +#include $(APR)\build\NWGNUcustom.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# LINK_STATIC = 1 + +# for now defined here - should finally go into build/NWGNUenvironment.inc +GDBM_INC = $(GDBMSDK)/inc +GDBM_IMP = $(GDBMSDK)/imp/libgdbm.imp +GDBM_LIB = $(GDBMSDK)/lib/libgdbm.lib +GDBM_NLM = libgdbm + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR)/include/arch/netware \ + $(APR)/include \ + $(APRUTIL)/include \ + $(APRUTIL)/include/private \ + $(APR) \ + $(GDBM_INC) \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + -DAPU_DSO_MODULE_BUILD \ + -DAPU_HAVE_GDBM=1 \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +ifdef LINK_STATIC +XLFLAGS += \ + -l $(GDBMSDK)/lib \ + $(EOLIST) +endif + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = dbmgdbm + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Apache Portability Runtime Library $(VERSION_STR) GDBM Driver Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = dbmgdbm + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)\$(NLM_NAME).nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/apr_dbm_gdbm.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +ifeq ($(LINK_STATIC),1) +FILES_nlm_libs += \ + $(GDBM_LIB) \ + $(EOLIST) +endif + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +ifneq ($(LINK_STATIC),1) +FILES_nlm_modules += \ + $(GDBM_NLM) \ + $(EOLIST) +endif + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + $(EOLIST) + +ifneq ($(LINK_STATIC),1) +FILES_nlm_Ximports += \ + @$(GDBM_IMP) \ + $(EOLIST) +endif + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + apr_dbm_type_gdbm \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + + + diff --git a/dbm/NWGNUmakefile b/dbm/NWGNUmakefile new file mode 100644 index 00000000000..e30372fa95b --- /dev/null +++ b/dbm/NWGNUmakefile @@ -0,0 +1,251 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(APR_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(EOLIST) + +ifeq "$(APU_HAVE_DB)" "1" +TARGET_nlm += $(OBJDIR)/dbmdb.nlm $(OBJDIR)/dbmdb.nlm $(EOLIST) +endif +ifeq "$(APU_HAVE_GDBM)" "1" +TARGET_nlm += $(OBJDIR)/dbmgdbm.nlm $(OBJDIR)/dbmgdbm.nlm $(EOLIST) +endif + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms $(INSTDIRS) FORCE + copy $(OBJDIR)\*.nlm $(INSTALLBASE) + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + + diff --git a/dbm/apr_dbm.c b/dbm/apr_dbm.c new file mode 100644 index 00000000000..613d0fe1abc --- /dev/null +++ b/dbm/apr_dbm.c @@ -0,0 +1,296 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr.h" +#include "apr_dso.h" +#include "apr_hash.h" +#include "apr_errno.h" +#include "apr_pools.h" +#include "apr_strings.h" +#define APR_WANT_MEMFUNC +#define APR_WANT_STRFUNC +#include "apr_want.h" +#include "apr_general.h" + +#include "apu_config.h" +#include "apu.h" +#include "apu_internal.h" +#include "apu_version.h" +#include "apr_dbm_private.h" +#include "apu_select_dbm.h" +#include "apr_dbm.h" +#include "apr_dbm_private.h" + +/* ### note: the setting of DBM_VTABLE will go away once we have multiple + ### DBMs in here. + ### Well, that day is here. So, do we remove DBM_VTABLE and the old + ### API entirely? Oh, what to do. We need an APU_DEFAULT_DBM #define. + ### Sounds like a job for autoconf. */ + +#if APU_USE_DB +#define DBM_VTABLE apr_dbm_type_db +#define DBM_NAME "db" +#elif APU_USE_GDBM +#define DBM_VTABLE apr_dbm_type_gdbm +#define DBM_NAME "gdbm" +#elif APU_USE_NDBM +#define DBM_VTABLE apr_dbm_type_ndbm +#define DBM_NAME "ndbm" +#elif APU_USE_SDBM +#define DBM_VTABLE apr_dbm_type_sdbm +#define DBM_NAME "sdbm" +#else /* Not in the USE_xDBM list above */ +#error a DBM implementation was not specified +#endif + +#if APU_DSO_BUILD + +static apr_hash_t *drivers = NULL; + +static apr_status_t dbm_term(void *ptr) +{ + /* set drivers to NULL so init can work again */ + drivers = NULL; + + /* Everything else we need is handled by cleanups registered + * when we created mutexes and loaded DSOs + */ + return APR_SUCCESS; +} + +#endif /* APU_DSO_BUILD */ + +static apr_status_t dbm_open_type(apr_dbm_type_t const* * vtable, + const char *type, + apr_pool_t *pool) +{ +#if !APU_DSO_BUILD + + *vtable = NULL; + if (!strcasecmp(type, "default")) *vtable = &DBM_VTABLE; +#if APU_HAVE_DB + else if (!strcasecmp(type, "db")) *vtable = &apr_dbm_type_db; +#endif + else if (*type && !strcasecmp(type + 1, "dbm")) { +#if APU_HAVE_GDBM + if (*type == 'G' || *type == 'g') *vtable = &apr_dbm_type_gdbm; +#endif +#if APU_HAVE_NDBM + if (*type == 'N' || *type == 'n') *vtable = &apr_dbm_type_ndbm; +#endif +#if APU_HAVE_SDBM + if (*type == 'S' || *type == 's') *vtable = &apr_dbm_type_sdbm; +#endif + /* avoid empty block */ ; + } + if (*vtable) + return APR_SUCCESS; + return APR_ENOTIMPL; + +#else /* APU_DSO_BUILD */ + + char modname[32]; + char symname[34]; + apr_dso_handle_sym_t symbol; + apr_status_t rv; + int usertype = 0; + + if (!strcasecmp(type, "default")) type = DBM_NAME; + else if (!strcasecmp(type, "db")) type = "db"; + else if (*type && !strcasecmp(type + 1, "dbm")) { + if (*type == 'G' || *type == 'g') type = "gdbm"; + else if (*type == 'N' || *type == 'n') type = "ndbm"; + else if (*type == 'S' || *type == 's') type = "sdbm"; + } + else usertype = 1; + + if (!drivers) + { + apr_pool_t *parent; + + /* Top level pool scope, need process-scope lifetime */ + for (parent = pool; parent; parent = apr_pool_parent_get(pool)) + pool = parent; + + /* deprecate in 2.0 - permit implicit initialization */ + apu_dso_init(pool); + + drivers = apr_hash_make(pool); + apr_hash_set(drivers, "sdbm", APR_HASH_KEY_STRING, &apr_dbm_type_sdbm); + + apr_pool_cleanup_register(pool, NULL, dbm_term, + apr_pool_cleanup_null); + } + + rv = apu_dso_mutex_lock(); + if (rv) { + *vtable = NULL; + return rv; + } + + *vtable = apr_hash_get(drivers, type, APR_HASH_KEY_STRING); + if (*vtable) { + apu_dso_mutex_unlock(); + return APR_SUCCESS; + } + + /* The driver DSO must have exactly the same lifetime as the + * drivers hash table; ignore the passed-in pool */ + pool = apr_hash_pool_get(drivers); + +#if defined(NETWARE) + apr_snprintf(modname, sizeof(modname), "dbm%s.nlm", type); +#elif defined(WIN32) + apr_snprintf(modname, sizeof(modname), + "apr_dbm_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", type); +#else + apr_snprintf(modname, sizeof(modname), + "apr_dbm_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".so", type); +#endif + apr_snprintf(symname, sizeof(symname), "apr_dbm_type_%s", type); + + rv = apu_dso_load(NULL, &symbol, modname, symname, pool); + if (rv == APR_SUCCESS || rv == APR_EINIT) { /* previously loaded?!? */ + *vtable = symbol; + if (usertype) + type = apr_pstrdup(pool, type); + apr_hash_set(drivers, type, APR_HASH_KEY_STRING, *vtable); + rv = APR_SUCCESS; + } + else + *vtable = NULL; + + apu_dso_mutex_unlock(); + return rv; + +#endif /* APU_DSO_BUILD */ +} + +APU_DECLARE(apr_status_t) apr_dbm_open_ex(apr_dbm_t **pdb, const char *type, + const char *pathname, + apr_int32_t mode, + apr_fileperms_t perm, + apr_pool_t *pool) +{ + apr_dbm_type_t const* vtable = NULL; + apr_status_t rv = dbm_open_type(&vtable, type, pool); + + if (rv == APR_SUCCESS) { + rv = (vtable->open)(pdb, pathname, mode, perm, pool); + } + return rv; +} + +APU_DECLARE(apr_status_t) apr_dbm_open(apr_dbm_t **pdb, const char *pathname, + apr_int32_t mode, apr_fileperms_t perm, + apr_pool_t *pool) +{ + return apr_dbm_open_ex(pdb, DBM_NAME, pathname, mode, perm, pool); +} + +APU_DECLARE(void) apr_dbm_close(apr_dbm_t *dbm) +{ + (*dbm->type->close)(dbm); +} + +APU_DECLARE(apr_status_t) apr_dbm_fetch(apr_dbm_t *dbm, apr_datum_t key, + apr_datum_t *pvalue) +{ + return (*dbm->type->fetch)(dbm, key, pvalue); +} + +APU_DECLARE(apr_status_t) apr_dbm_store(apr_dbm_t *dbm, apr_datum_t key, + apr_datum_t value) +{ + return (*dbm->type->store)(dbm, key, value); +} + +APU_DECLARE(apr_status_t) apr_dbm_delete(apr_dbm_t *dbm, apr_datum_t key) +{ + return (*dbm->type->del)(dbm, key); +} + +APU_DECLARE(int) apr_dbm_exists(apr_dbm_t *dbm, apr_datum_t key) +{ + return (*dbm->type->exists)(dbm, key); +} + +APU_DECLARE(apr_status_t) apr_dbm_firstkey(apr_dbm_t *dbm, apr_datum_t *pkey) +{ + return (*dbm->type->firstkey)(dbm, pkey); +} + +APU_DECLARE(apr_status_t) apr_dbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey) +{ + return (*dbm->type->nextkey)(dbm, pkey); +} + +APU_DECLARE(void) apr_dbm_freedatum(apr_dbm_t *dbm, apr_datum_t data) +{ + (*dbm->type->freedatum)(dbm, data); +} + +APU_DECLARE(char *) apr_dbm_geterror(apr_dbm_t *dbm, int *errcode, + char *errbuf, apr_size_t errbufsize) +{ + if (errcode != NULL) + *errcode = dbm->errcode; + + /* assert: errbufsize > 0 */ + + if (dbm->errmsg == NULL) + *errbuf = '\0'; + else + (void) apr_cpystrn(errbuf, dbm->errmsg, errbufsize); + return errbuf; +} + +APU_DECLARE(apr_status_t) apr_dbm_get_usednames_ex(apr_pool_t *p, + const char *type, + const char *pathname, + const char **used1, + const char **used2) +{ + apr_dbm_type_t const* vtable; + apr_status_t rv = dbm_open_type(&vtable, type, p); + + if (rv == APR_SUCCESS) { + (vtable->getusednames)(p, pathname, used1, used2); + return APR_SUCCESS; + } + return rv; +} + +APU_DECLARE(void) apr_dbm_get_usednames(apr_pool_t *p, + const char *pathname, + const char **used1, + const char **used2) +{ + apr_dbm_get_usednames_ex(p, DBM_NAME, pathname, used1, used2); +} + +/* Most DBM libraries take a POSIX mode for creating files. Don't trust + * the mode_t type, some platforms may not support it, int is safe. + */ +APU_DECLARE(int) apr_posix_perms2mode(apr_fileperms_t perm) +{ + int mode = 0; + + mode |= 0700 & (perm >> 2); /* User is off-by-2 bits */ + mode |= 0070 & (perm >> 1); /* Group is off-by-1 bit */ + mode |= 0007 & (perm); /* World maps 1 for 1 */ + return mode; +} diff --git a/dbm/apr_dbm_berkeleydb.c b/dbm/apr_dbm_berkeleydb.c new file mode 100644 index 00000000000..0cbab82ba69 --- /dev/null +++ b/dbm/apr_dbm_berkeleydb.c @@ -0,0 +1,404 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_strings.h" +#define APR_WANT_MEMFUNC +#include "apr_want.h" + +#define APU_WANT_DB +#include "apu_want.h" + +#if APR_HAVE_STDLIB_H +#include /* for abort() */ +#endif + +#include "apu_config.h" +#include "apu.h" + +#if APU_HAVE_DB +#include "apr_dbm_private.h" + +/* + * We pick up all varieties of Berkeley DB through db.h (included through + * apu_select_dbm.h). This code has been compiled/tested against DB1, + * DB_185, DB2, DB3, and DB4. + */ + +#if defined(DB_VERSION_MAJOR) && (DB_VERSION_MAJOR == 4) +/* We will treat anything greater than 4.1 as DB4. + * We can treat 4.0 as DB3. + */ +#if defined(DB_VERSION_MINOR) && (DB_VERSION_MINOR >= 1) +#define DB_VER 4 +#else +#define DB_VER 3 +#endif +#elif defined(DB_VERSION_MAJOR) && (DB_VERSION_MAJOR == 3) +#define DB_VER 3 +#elif defined(DB_VERSION_MAJOR) && (DB_VERSION_MAJOR == 2) +#define DB_VER 2 +#else +#define DB_VER 1 +#endif + +typedef struct { + DB *bdb; +#if DB_VER != 1 + DBC *curs; +#endif +} real_file_t; + + +#if DB_VER == 1 +#define TXN_ARG +#else +#define TXN_ARG NULL, +#endif + +#define GET_BDB(f) (((real_file_t *)(f))->bdb) + +#define do_fetch(bdb, k, v) ((*(bdb)->get)(bdb, TXN_ARG &(k), &(v), 0)) + +#if DB_VER == 1 +#include +#define APR_DBM_DBMODE_RO O_RDONLY +#define APR_DBM_DBMODE_RW O_RDWR +#define APR_DBM_DBMODE_RWCREATE (O_CREAT | O_RDWR) +#define APR_DBM_DBMODE_RWTRUNC (O_CREAT | O_RDWR | O_TRUNC) +#else +#define APR_DBM_DBMODE_RO DB_RDONLY +#define APR_DBM_DBMODE_RW 0 +#define APR_DBM_DBMODE_RWCREATE DB_CREATE +#define APR_DBM_DBMODE_RWTRUNC DB_TRUNCATE +#endif /* DBVER == 1 */ + +/* -------------------------------------------------------------------------- +** +** UTILITY FUNCTIONS +*/ + +/* map a DB error to an apr_status_t */ +static apr_status_t db2s(int dberr) +{ + if (dberr != 0) { + /* ### need to fix this */ + return APR_OS_START_USEERR + dberr; + } + + return APR_SUCCESS; +} + + +static apr_status_t set_error(apr_dbm_t *dbm, apr_status_t dbm_said) +{ + apr_status_t rv = APR_SUCCESS; + + /* ### ignore whatever the DBM said (dbm_said); ask it explicitly */ + + if (dbm_said == APR_SUCCESS) { + dbm->errcode = 0; + dbm->errmsg = NULL; + } + else { + /* ### need to fix. dberr was tossed in db2s(). */ + /* ### use db_strerror() */ + dbm->errcode = dbm_said; +#if DB_VER == 1 || DB_VER == 2 + dbm->errmsg = NULL; +#else + dbm->errmsg = db_strerror(dbm_said - APR_OS_START_USEERR); +#endif + rv = dbm_said; + } + + return rv; +} + +/* -------------------------------------------------------------------------- +** +** DEFINE THE VTABLE FUNCTIONS FOR BERKELEY DB +** +** ### we may need three sets of these: db1, db2, db3 +*/ + +static apr_status_t vt_db_open(apr_dbm_t **pdb, const char *pathname, + apr_int32_t mode, apr_fileperms_t perm, + apr_pool_t *pool) +{ + real_file_t file; + int dbmode; + + *pdb = NULL; + + switch (mode) { + case APR_DBM_READONLY: + dbmode = APR_DBM_DBMODE_RO; + break; + case APR_DBM_READWRITE: + dbmode = APR_DBM_DBMODE_RW; + break; + case APR_DBM_RWCREATE: + dbmode = APR_DBM_DBMODE_RWCREATE; + break; + case APR_DBM_RWTRUNC: + dbmode = APR_DBM_DBMODE_RWTRUNC; + break; + default: + return APR_EINVAL; + } + + { + int dberr; + +#if DB_VER >= 3 + if ((dberr = db_create(&file.bdb, NULL, 0)) == 0) { + if ((dberr = (*file.bdb->open)(file.bdb, +#if DB_VER == 4 + NULL, +#endif + pathname, NULL, + DB_HASH, dbmode, + apr_posix_perms2mode(perm))) != 0) { + /* close the DB handler */ + (void) (*file.bdb->close)(file.bdb, 0); + } + } + file.curs = NULL; +#elif DB_VER == 2 + dberr = db_open(pathname, DB_HASH, dbmode, apr_posix_perms2mode(perm), + NULL, NULL, &file.bdb); + file.curs = NULL; +#else + file.bdb = dbopen(pathname, dbmode, apr_posix_perms2mode(perm), + DB_HASH, NULL); + if (file.bdb == NULL) + return APR_EGENERAL; /* ### need a better error */ + dberr = 0; +#endif + if (dberr != 0) + return db2s(dberr); + } + + /* we have an open database... return it */ + *pdb = apr_pcalloc(pool, sizeof(**pdb)); + (*pdb)->pool = pool; + (*pdb)->type = &apr_dbm_type_db; + (*pdb)->file = apr_pmemdup(pool, &file, sizeof(file)); + + /* ### register a cleanup to close the DBM? */ + + return APR_SUCCESS; +} + +static void vt_db_close(apr_dbm_t *dbm) +{ + (*GET_BDB(dbm->file)->close)(GET_BDB(dbm->file) +#if DB_VER != 1 + , 0 +#endif + ); +} + +static apr_status_t vt_db_fetch(apr_dbm_t *dbm, apr_datum_t key, + apr_datum_t * pvalue) +{ + DBT ckey = { 0 }; + DBT rd = { 0 }; + int dberr; + + ckey.data = key.dptr; + ckey.size = key.dsize; + + dberr = do_fetch(GET_BDB(dbm->file), ckey, rd); + + /* "not found" is not an error. return zero'd value. */ + if (dberr == +#if DB_VER == 1 + RET_SPECIAL +#else + DB_NOTFOUND +#endif + ) { + memset(&rd, 0, sizeof(rd)); + dberr = 0; + } + + pvalue->dptr = rd.data; + pvalue->dsize = rd.size; + + /* store the error info into DBM, and return a status code. Also, note + that *pvalue should have been cleared on error. */ + return set_error(dbm, db2s(dberr)); +} + +static apr_status_t vt_db_store(apr_dbm_t *dbm, apr_datum_t key, + apr_datum_t value) +{ + apr_status_t rv; + DBT ckey = { 0 }; + DBT cvalue = { 0 }; + + ckey.data = key.dptr; + ckey.size = key.dsize; + + cvalue.data = value.dptr; + cvalue.size = value.dsize; + + rv = db2s((*GET_BDB(dbm->file)->put)(GET_BDB(dbm->file), + TXN_ARG + &ckey, + &cvalue, + 0)); + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, rv); +} + +static apr_status_t vt_db_del(apr_dbm_t *dbm, apr_datum_t key) +{ + apr_status_t rv; + DBT ckey = { 0 }; + + ckey.data = key.dptr; + ckey.size = key.dsize; + + rv = db2s((*GET_BDB(dbm->file)->del)(GET_BDB(dbm->file), + TXN_ARG + &ckey, + 0)); + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, rv); +} + +static int vt_db_exists(apr_dbm_t *dbm, apr_datum_t key) +{ + DBT ckey = { 0 }; /* converted key */ + DBT data = { 0 }; + int dberr; + + ckey.data = key.dptr; + ckey.size = key.dsize; + + dberr = do_fetch(GET_BDB(dbm->file), ckey, data); + + /* note: the result data is "loaned" to us; we don't need to free it */ + + /* DB returns DB_NOTFOUND if it doesn't exist. but we want to say + that *any* error means it doesn't exist. */ + return dberr == 0; +} + +static apr_status_t vt_db_firstkey(apr_dbm_t *dbm, apr_datum_t * pkey) +{ + real_file_t *f = dbm->file; + DBT first = { 0 }; + DBT data = { 0 }; + int dberr; + +#if DB_VER == 1 + dberr = (*f->bdb->seq)(f->bdb, &first, &data, R_FIRST); +#else + if ((dberr = (*f->bdb->cursor)(f->bdb, NULL, &f->curs +#if DB_VER >= 3 || ((DB_VERSION_MAJOR == 2) && (DB_VERSION_MINOR > 5)) + , 0 +#endif + )) == 0) { + dberr = (*f->curs->c_get)(f->curs, &first, &data, DB_FIRST); + if (dberr == DB_NOTFOUND) { + memset(&first, 0, sizeof(first)); + (*f->curs->c_close)(f->curs); + f->curs = NULL; + dberr = 0; + } + } +#endif + + pkey->dptr = first.data; + pkey->dsize = first.size; + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, db2s(dberr)); +} + +static apr_status_t vt_db_nextkey(apr_dbm_t *dbm, apr_datum_t * pkey) +{ + real_file_t *f = dbm->file; + DBT ckey = { 0 }; + DBT data = { 0 }; + int dberr; + + ckey.data = pkey->dptr; + ckey.size = pkey->dsize; + +#if DB_VER == 1 + dberr = (*f->bdb->seq)(f->bdb, &ckey, &data, R_NEXT); + if (dberr == RET_SPECIAL) { + dberr = 0; + ckey.data = NULL; + ckey.size = 0; + } +#else + if (f->curs == NULL) + return APR_EINVAL; + + dberr = (*f->curs->c_get)(f->curs, &ckey, &data, DB_NEXT); + if (dberr == DB_NOTFOUND) { + (*f->curs->c_close)(f->curs); + f->curs = NULL; + dberr = 0; + ckey.data = NULL; + ckey.size = 0; + } +#endif + + pkey->dptr = ckey.data; + pkey->dsize = ckey.size; + + /* store any error info into DBM, and return a status code. */ + /* ### or use db2s(dberr) instead of APR_SUCCESS? */ + return set_error(dbm, APR_SUCCESS); +} + +static void vt_db_freedatum(apr_dbm_t *dbm, apr_datum_t data) +{ + /* nothing to do */ +} + +static void vt_db_usednames(apr_pool_t *pool, const char *pathname, + const char **used1, const char **used2) +{ + *used1 = apr_pstrdup(pool, pathname); + *used2 = NULL; +} + + +APU_MODULE_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_db = { + "db", + + vt_db_open, + vt_db_close, + vt_db_fetch, + vt_db_store, + vt_db_del, + vt_db_exists, + vt_db_firstkey, + vt_db_nextkey, + vt_db_freedatum, + vt_db_usednames +}; + +#endif /* APU_HAVE_DB */ diff --git a/dbm/apr_dbm_db.dsp b/dbm/apr_dbm_db.dsp new file mode 100644 index 00000000000..6b7e838abb2 --- /dev/null +++ b/dbm/apr_dbm_db.dsp @@ -0,0 +1,215 @@ +# Microsoft Developer Studio Project File - Name="apr_dbm_db" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=apr_dbm_db - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr_dbm_db.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr_dbm_db.mak" CFG="apr_dbm_db - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr_dbm_db - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbm_db - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbm_db - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbm_db - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "apr_dbm_db - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"Release/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbm_db-1.dll" /pdb:"Release\apr_dbm_db-1.pdb" /implib:"Release\apr_dbm_db-1.lib" /MACHINE:X86 /opt:ref +# Begin Special Build Tool +TargetPath=Release\apr_dbm_db-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbm_db - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"Debug/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbm_db-1.dll" /pdb:"Debug\apr_dbm_db-1.pdb" /implib:"Debug\apr_dbm_db-1.lib" /MACHINE:X86 +# Begin Special Build Tool +TargetPath=Debug\apr_dbm_db-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbm_db - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\Release" +# PROP BASE Intermediate_Dir "x64\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\Release" +# PROP Intermediate_Dir "x64\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbm_db-1.dll" /pdb:"x64\Release\apr_dbm_db-1.pdb" /implib:"x64\Release\apr_dbm_db-1.lib" /MACHINE:X64 /opt:ref +# Begin Special Build Tool +TargetPath=x64\Release\apr_dbm_db-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbm_db - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\Debug" +# PROP BASE Intermediate_Dir "x64\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\Debug" +# PROP Intermediate_Dir "x64\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbm_db-1.dll" /pdb:"x64\Debug\apr_dbm_db-1.pdb" /implib:"x64\Debug\apr_dbm_db-1.lib" /MACHINE:X64 +# Begin Special Build Tool +TargetPath=x64\Debug\apr_dbm_db-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "apr_dbm_db - Win32 Release" +# Name "apr_dbm_db - Win32 Debug" +# Name "apr_dbm_db - x64 Release" +# Name "apr_dbm_db - x64 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\apr_dbm_berkeleydb.c +# End Source File +# End Group +# Begin Group "Public Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\apr_dbm.h +# End Source File +# End Group +# Begin Group "Internal Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\private\apu_dbm_private.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_config.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_dbd_internal.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_internal.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_select_dbm.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\libaprutil.rc +# End Source File +# End Target +# End Project diff --git a/dbm/apr_dbm_gdbm.c b/dbm/apr_dbm_gdbm.c new file mode 100644 index 00000000000..749447a0a31 --- /dev/null +++ b/dbm/apr_dbm_gdbm.c @@ -0,0 +1,255 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apu_config.h" +#include "apu.h" +#include "apr_strings.h" + +#if APR_HAVE_STDLIB_H +#include /* for free() */ +#endif + +#if APU_HAVE_GDBM +#include "apr_dbm_private.h" + +#include + +#define APR_DBM_DBMODE_RO GDBM_READER +#define APR_DBM_DBMODE_RW GDBM_WRITER +#define APR_DBM_DBMODE_RWCREATE GDBM_WRCREAT +#define APR_DBM_DBMODE_RWTRUNC GDBM_NEWDB + +/* map a GDBM error to an apr_status_t */ +static apr_status_t g2s(int gerr) +{ + if (gerr == -1) { + /* ### need to fix this */ + return APR_EGENERAL; + } + + return APR_SUCCESS; +} + +static apr_status_t datum_cleanup(void *dptr) +{ + if (dptr) + free(dptr); + + return APR_SUCCESS; +} + +static apr_status_t set_error(apr_dbm_t *dbm, apr_status_t dbm_said) +{ + apr_status_t rv = APR_SUCCESS; + + /* ### ignore whatever the DBM said (dbm_said); ask it explicitly */ + + if ((dbm->errcode = gdbm_errno) == GDBM_NO_ERROR) { + dbm->errmsg = NULL; + } + else { + dbm->errmsg = gdbm_strerror(gdbm_errno); + rv = APR_EGENERAL; /* ### need something better */ + } + + /* captured it. clear it now. */ + gdbm_errno = GDBM_NO_ERROR; + + return rv; +} + +/* -------------------------------------------------------------------------- +** +** DEFINE THE VTABLE FUNCTIONS FOR GDBM +*/ + +static apr_status_t vt_gdbm_open(apr_dbm_t **pdb, const char *pathname, + apr_int32_t mode, apr_fileperms_t perm, + apr_pool_t *pool) +{ + GDBM_FILE file; + int dbmode; + + *pdb = NULL; + + switch (mode) { + case APR_DBM_READONLY: + dbmode = APR_DBM_DBMODE_RO; + break; + case APR_DBM_READWRITE: + dbmode = APR_DBM_DBMODE_RW; + break; + case APR_DBM_RWCREATE: + dbmode = APR_DBM_DBMODE_RWCREATE; + break; + case APR_DBM_RWTRUNC: + dbmode = APR_DBM_DBMODE_RWTRUNC; + break; + default: + return APR_EINVAL; + } + + /* Note: stupid cast to get rid of "const" on the pathname */ + file = gdbm_open((char *) pathname, 0, dbmode, apr_posix_perms2mode(perm), + NULL); + + if (file == NULL) + return APR_EGENERAL; /* ### need a better error */ + + /* we have an open database... return it */ + *pdb = apr_pcalloc(pool, sizeof(**pdb)); + (*pdb)->pool = pool; + (*pdb)->type = &apr_dbm_type_gdbm; + (*pdb)->file = file; + + /* ### register a cleanup to close the DBM? */ + + return APR_SUCCESS; +} + +static void vt_gdbm_close(apr_dbm_t *dbm) +{ + gdbm_close(dbm->file); +} + +static apr_status_t vt_gdbm_fetch(apr_dbm_t *dbm, apr_datum_t key, + apr_datum_t *pvalue) +{ + datum kd, rd; + + kd.dptr = key.dptr; + kd.dsize = key.dsize; + + rd = gdbm_fetch(dbm->file, kd); + + pvalue->dptr = rd.dptr; + pvalue->dsize = rd.dsize; + + if (pvalue->dptr) + apr_pool_cleanup_register(dbm->pool, pvalue->dptr, datum_cleanup, + apr_pool_cleanup_null); + + /* store the error info into DBM, and return a status code. Also, note + that *pvalue should have been cleared on error. */ + return set_error(dbm, APR_SUCCESS); +} + +static apr_status_t vt_gdbm_store(apr_dbm_t *dbm, apr_datum_t key, + apr_datum_t value) +{ + int rc; + datum kd, vd; + + kd.dptr = key.dptr; + kd.dsize = key.dsize; + + vd.dptr = value.dptr; + vd.dsize = value.dsize; + + rc = gdbm_store(dbm->file, kd, vd, GDBM_REPLACE); + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, g2s(rc)); +} + +static apr_status_t vt_gdbm_del(apr_dbm_t *dbm, apr_datum_t key) +{ + int rc; + datum kd; + + kd.dptr = key.dptr; + kd.dsize = key.dsize; + + rc = gdbm_delete(dbm->file, kd); + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, g2s(rc)); +} + +static int vt_gdbm_exists(apr_dbm_t *dbm, apr_datum_t key) +{ + datum kd; + + kd.dptr = key.dptr; + kd.dsize = key.dsize; + + return gdbm_exists(dbm->file, kd) != 0; +} + +static apr_status_t vt_gdbm_firstkey(apr_dbm_t *dbm, apr_datum_t *pkey) +{ + datum rd; + + rd = gdbm_firstkey(dbm->file); + + pkey->dptr = rd.dptr; + pkey->dsize = rd.dsize; + + if (pkey->dptr) + apr_pool_cleanup_register(dbm->pool, pkey->dptr, datum_cleanup, + apr_pool_cleanup_null); + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, APR_SUCCESS); +} + +static apr_status_t vt_gdbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey) +{ + datum kd, rd; + + kd.dptr = pkey->dptr; + kd.dsize = pkey->dsize; + + rd = gdbm_nextkey(dbm->file, kd); + + pkey->dptr = rd.dptr; + pkey->dsize = rd.dsize; + + if (pkey->dptr) + apr_pool_cleanup_register(dbm->pool, pkey->dptr, datum_cleanup, + apr_pool_cleanup_null); + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, APR_SUCCESS); +} + +static void vt_gdbm_freedatum(apr_dbm_t *dbm, apr_datum_t data) +{ + (void) apr_pool_cleanup_run(dbm->pool, data.dptr, datum_cleanup); +} + +static void vt_gdbm_usednames(apr_pool_t *pool, const char *pathname, + const char **used1, const char **used2) +{ + *used1 = apr_pstrdup(pool, pathname); + *used2 = NULL; +} + +APU_MODULE_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_gdbm = { + "gdbm", + vt_gdbm_open, + vt_gdbm_close, + vt_gdbm_fetch, + vt_gdbm_store, + vt_gdbm_del, + vt_gdbm_exists, + vt_gdbm_firstkey, + vt_gdbm_nextkey, + vt_gdbm_freedatum, + vt_gdbm_usednames +}; + +#endif /* APU_HAVE_GDBM */ diff --git a/dbm/apr_dbm_gdbm.dsp b/dbm/apr_dbm_gdbm.dsp new file mode 100644 index 00000000000..061cedf552b --- /dev/null +++ b/dbm/apr_dbm_gdbm.dsp @@ -0,0 +1,215 @@ +# Microsoft Developer Studio Project File - Name="apr_dbm_gdbm" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=apr_dbm_gdbm - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr_dbm_gdbm.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr_dbm_gdbm.mak" CFG="apr_dbm_gdbm - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr_dbm_gdbm - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbm_gdbm - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbm_gdbm - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_dbm_gdbm - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "apr_dbm_gdbm - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"Release/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbm_gdbm-1.dll" /pdb:"Release\apr_dbm_gdbm-1.pdb" /implib:"Release\apr_dbm_gdbm-1.lib" /MACHINE:X86 /opt:ref +# Begin Special Build Tool +TargetPath=Release\apr_dbm_gdbm-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbm_gdbm - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"Debug/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbm_gdbm-1.dll" /pdb:"Debug\apr_dbm_gdbm-1.pdb" /implib:"Debug\apr_dbm_gdbm-1.lib" /MACHINE:X86 +# Begin Special Build Tool +TargetPath=Debug\apr_dbm_gdbm-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbm_gdbm - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\Release" +# PROP BASE Intermediate_Dir "x64\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\Release" +# PROP Intermediate_Dir "x64\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbm_gdbm-1.dll" /pdb:"x64\Release\apr_dbm_gdbm-1.pdb" /implib:"x64\Release\apr_dbm_gdbm-1.lib" /MACHINE:X64 /opt:ref +# Begin Special Build Tool +TargetPath=x64\Release\apr_dbm_gdbm-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_dbm_gdbm - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\Debug" +# PROP BASE Intermediate_Dir "x64\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\Debug" +# PROP Intermediate_Dir "x64\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbm_gdbm-1.dll" /pdb:"x64\Debug\apr_dbm_gdbm-1.pdb" /implib:"x64\Debug\apr_dbm_gdbm-1.lib" /MACHINE:X64 +# Begin Special Build Tool +TargetPath=x64\Debug\apr_dbm_gdbm-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "apr_dbm_gdbm - Win32 Release" +# Name "apr_dbm_gdbm - Win32 Debug" +# Name "apr_dbm_gdbm - x64 Release" +# Name "apr_dbm_gdbm - x64 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\apr_dbm_gdbm.c +# End Source File +# End Group +# Begin Group "Public Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\apr_dbm.h +# End Source File +# End Group +# Begin Group "Internal Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\private\apu_dbm_private.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_config.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_dbd_internal.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_internal.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_select_dbm.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\libaprutil.rc +# End Source File +# End Target +# End Project diff --git a/dbm/apr_dbm_ndbm.c b/dbm/apr_dbm_ndbm.c new file mode 100644 index 00000000000..7f381862453 --- /dev/null +++ b/dbm/apr_dbm_ndbm.c @@ -0,0 +1,238 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_strings.h" + +#if APR_HAVE_STDLIB_H +#include /* for free() */ +#endif + +#include "apu_config.h" +#include "apu.h" + +#if APU_HAVE_NDBM +#include "apr_dbm_private.h" + +#include +#include +#include +#include + +#define APR_DBM_DBMODE_RO O_RDONLY +#define APR_DBM_DBMODE_RW O_RDWR +#define APR_DBM_DBMODE_RWCREATE (O_RDWR|O_CREAT) +#define APR_DBM_DBMODE_RWTRUNC (O_RDWR|O_CREAT|O_TRUNC) + +/* map a NDBM error to an apr_status_t */ +static apr_status_t ndbm2s(int ndbmerr) +{ + if (ndbmerr == -1) { + /* ### need to fix this */ + return APR_EGENERAL; + } + + return APR_SUCCESS; +} + +static apr_status_t set_error(apr_dbm_t *dbm, apr_status_t dbm_said) +{ + apr_status_t rv = APR_SUCCESS; + + /* ### ignore whatever the DBM said (dbm_said); ask it explicitly */ + + dbm->errmsg = NULL; + if (dbm_error((DBM*)dbm->file)) { + dbm->errmsg = NULL; + rv = APR_EGENERAL; /* ### need something better */ + } + + /* captured it. clear it now. */ + dbm_clearerr((DBM*)dbm->file); + + return rv; +} + +/* -------------------------------------------------------------------------- +** +** DEFINE THE VTABLE FUNCTIONS FOR NDBM +*/ + +static apr_status_t vt_ndbm_open(apr_dbm_t **pdb, const char *pathname, + apr_int32_t mode, apr_fileperms_t perm, + apr_pool_t *pool) +{ + DBM *file; + int dbmode; + + *pdb = NULL; + + switch (mode) { + case APR_DBM_READONLY: + dbmode = APR_DBM_DBMODE_RO; + break; + case APR_DBM_READWRITE: + dbmode = APR_DBM_DBMODE_RW; + break; + case APR_DBM_RWCREATE: + dbmode = APR_DBM_DBMODE_RWCREATE; + break; + case APR_DBM_RWTRUNC: + dbmode = APR_DBM_DBMODE_RWTRUNC; + break; + default: + return APR_EINVAL; + } + + { + file = dbm_open(pathname, dbmode, apr_posix_perms2mode(perm)); + if (file == NULL) + return APR_EGENERAL; /* ### need a better error */ + } + + /* we have an open database... return it */ + *pdb = apr_pcalloc(pool, sizeof(**pdb)); + (*pdb)->pool = pool; + (*pdb)->type = &apr_dbm_type_ndbm; + (*pdb)->file = file; + + /* ### register a cleanup to close the DBM? */ + + return APR_SUCCESS; +} + +static void vt_ndbm_close(apr_dbm_t *dbm) +{ + dbm_close(dbm->file); +} + +static apr_status_t vt_ndbm_fetch(apr_dbm_t *dbm, apr_datum_t key, + apr_datum_t *pvalue) +{ + datum kd, rd; + + kd.dptr = key.dptr; + kd.dsize = key.dsize; + + rd = dbm_fetch(dbm->file, kd); + + pvalue->dptr = rd.dptr; + pvalue->dsize = rd.dsize; + + /* store the error info into DBM, and return a status code. Also, note + that *pvalue should have been cleared on error. */ + return set_error(dbm, APR_SUCCESS); +} + +static apr_status_t vt_ndbm_store(apr_dbm_t *dbm, apr_datum_t key, + apr_datum_t value) +{ + int rc; + datum kd, vd; + + kd.dptr = key.dptr; + kd.dsize = key.dsize; + + vd.dptr = value.dptr; + vd.dsize = value.dsize; + + rc = dbm_store(dbm->file, kd, vd, DBM_REPLACE); + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, ndbm2s(rc)); +} + +static apr_status_t vt_ndbm_del(apr_dbm_t *dbm, apr_datum_t key) +{ + int rc; + datum kd; + + kd.dptr = key.dptr; + kd.dsize = key.dsize; + + rc = dbm_delete(dbm->file, kd); + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, ndbm2s(rc)); +} + +static int vt_ndbm_exists(apr_dbm_t *dbm, apr_datum_t key) +{ + datum kd, rd; + + kd.dptr = key.dptr; + kd.dsize = key.dsize; + + rd = dbm_fetch(dbm->file, kd); + + return rd.dptr != NULL; +} + +static apr_status_t vt_ndbm_firstkey(apr_dbm_t *dbm, apr_datum_t *pkey) +{ + datum rd; + + rd = dbm_firstkey(dbm->file); + + pkey->dptr = rd.dptr; + pkey->dsize = rd.dsize; + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, APR_SUCCESS); +} + +static apr_status_t vt_ndbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey) +{ + datum kd, rd; + + kd.dptr = pkey->dptr; + kd.dsize = pkey->dsize; + + rd = dbm_nextkey(dbm->file); + + pkey->dptr = rd.dptr; + pkey->dsize = rd.dsize; + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, APR_SUCCESS); +} + +static void vt_ndbm_freedatum(apr_dbm_t *dbm, apr_datum_t data) +{ + /* nothing to do */ +} + +static void vt_ndbm_usednames(apr_pool_t *pool, const char *pathname, + const char **used1, const char **used2) +{ + *used1 = apr_pstrdup(pool, pathname); + *used2 = NULL; +} + +APU_MODULE_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_ndbm = { + "ndbm", + vt_ndbm_open, + vt_ndbm_close, + vt_ndbm_fetch, + vt_ndbm_store, + vt_ndbm_del, + vt_ndbm_exists, + vt_ndbm_firstkey, + vt_ndbm_nextkey, + vt_ndbm_freedatum, + vt_ndbm_usednames +}; + +#endif /* APU_HAVE_NDBM */ diff --git a/dbm/apr_dbm_sdbm.c b/dbm/apr_dbm_sdbm.c new file mode 100644 index 00000000000..6f531a17697 --- /dev/null +++ b/dbm/apr_dbm_sdbm.c @@ -0,0 +1,224 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_strings.h" +#define APR_WANT_MEMFUNC +#define APR_WANT_STRFUNC +#include "apr_want.h" + +#include "apu_config.h" +#include "apu.h" + +#if APU_HAVE_SDBM + +#include "apr_dbm_private.h" +#include "apr_sdbm.h" + +#define APR_DBM_DBMODE_RO (APR_READ | APR_BUFFERED) +#define APR_DBM_DBMODE_RW (APR_READ | APR_WRITE) +#define APR_DBM_DBMODE_RWCREATE (APR_READ | APR_WRITE | APR_CREATE) +#define APR_DBM_DBMODE_RWTRUNC (APR_READ | APR_WRITE | APR_CREATE | \ + APR_TRUNCATE) + +static apr_status_t set_error(apr_dbm_t *dbm, apr_status_t dbm_said) +{ + dbm->errcode = dbm_said; + + if (dbm_said != APR_SUCCESS) { + dbm->errmsg = apr_psprintf(dbm->pool, "%pm", &dbm_said); + } else { + dbm->errmsg = NULL; + } + + return dbm_said; +} + +/* -------------------------------------------------------------------------- +** +** DEFINE THE VTABLE FUNCTIONS FOR SDBM +*/ + +static apr_status_t vt_sdbm_open(apr_dbm_t **pdb, const char *pathname, + apr_int32_t mode, apr_fileperms_t perm, + apr_pool_t *pool) +{ + apr_sdbm_t *file; + int dbmode; + + *pdb = NULL; + + switch (mode) { + case APR_DBM_READONLY: + dbmode = APR_DBM_DBMODE_RO; + break; + case APR_DBM_READWRITE: + dbmode = APR_DBM_DBMODE_RW; + break; + case APR_DBM_RWCREATE: + dbmode = APR_DBM_DBMODE_RWCREATE; + break; + case APR_DBM_RWTRUNC: + dbmode = APR_DBM_DBMODE_RWTRUNC; + break; + default: + return APR_EINVAL; + } + + { + apr_status_t rv; + + rv = apr_sdbm_open(&file, pathname, dbmode, perm, pool); + if (rv != APR_SUCCESS) + return rv; + } + + /* we have an open database... return it */ + *pdb = apr_pcalloc(pool, sizeof(**pdb)); + (*pdb)->pool = pool; + (*pdb)->type = &apr_dbm_type_sdbm; + (*pdb)->file = file; + + /* ### register a cleanup to close the DBM? */ + + return APR_SUCCESS; +} + +static void vt_sdbm_close(apr_dbm_t *dbm) +{ + apr_sdbm_close(dbm->file); +} + +static apr_status_t vt_sdbm_fetch(apr_dbm_t *dbm, apr_datum_t key, + apr_datum_t *pvalue) +{ + apr_status_t rv; + apr_sdbm_datum_t kd, rd; + + kd.dptr = key.dptr; + kd.dsize = (int)key.dsize; + + rv = apr_sdbm_fetch(dbm->file, &rd, kd); + + pvalue->dptr = rd.dptr; + pvalue->dsize = rd.dsize; + + /* store the error info into DBM, and return a status code. Also, note + that *pvalue should have been cleared on error. */ + return set_error(dbm, rv); +} + +static apr_status_t vt_sdbm_store(apr_dbm_t *dbm, apr_datum_t key, + apr_datum_t value) +{ + apr_status_t rv; + apr_sdbm_datum_t kd, vd; + + kd.dptr = key.dptr; + kd.dsize = (int)key.dsize; + + vd.dptr = value.dptr; + vd.dsize = (int)value.dsize; + + rv = apr_sdbm_store(dbm->file, kd, vd, APR_SDBM_REPLACE); + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, rv); +} + +static apr_status_t vt_sdbm_del(apr_dbm_t *dbm, apr_datum_t key) +{ + apr_status_t rv; + apr_sdbm_datum_t kd; + + kd.dptr = key.dptr; + kd.dsize = (int)key.dsize; + + rv = apr_sdbm_delete(dbm->file, kd); + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, rv); +} + +static int vt_sdbm_exists(apr_dbm_t *dbm, apr_datum_t key) +{ + int exists; + apr_sdbm_datum_t vd, kd; + + kd.dptr = key.dptr; + kd.dsize = (int)key.dsize; + + if (apr_sdbm_fetch(dbm->file, &vd, kd) != APR_SUCCESS) + exists = 0; + else + exists = vd.dptr != NULL; + + return exists; +} + +static apr_status_t vt_sdbm_firstkey(apr_dbm_t *dbm, apr_datum_t *pkey) +{ + apr_status_t rv; + apr_sdbm_datum_t rd; + + rv = apr_sdbm_firstkey(dbm->file, &rd); + + pkey->dptr = rd.dptr; + pkey->dsize = rd.dsize; + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, rv); +} + +static apr_status_t vt_sdbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey) +{ + apr_status_t rv; + apr_sdbm_datum_t rd; + + rv = apr_sdbm_nextkey(dbm->file, &rd); + + pkey->dptr = rd.dptr; + pkey->dsize = rd.dsize; + + /* store any error info into DBM, and return a status code. */ + return set_error(dbm, APR_SUCCESS); +} + +static void vt_sdbm_freedatum(apr_dbm_t *dbm, apr_datum_t data) +{ +} + +static void vt_sdbm_usednames(apr_pool_t *pool, const char *pathname, + const char **used1, const char **used2) +{ + *used1 = apr_pstrcat(pool, pathname, APR_SDBM_DIRFEXT, NULL); + *used2 = apr_pstrcat(pool, pathname, APR_SDBM_PAGFEXT, NULL); +} + +APU_MODULE_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_sdbm = { + "sdbm", + vt_sdbm_open, + vt_sdbm_close, + vt_sdbm_fetch, + vt_sdbm_store, + vt_sdbm_del, + vt_sdbm_exists, + vt_sdbm_firstkey, + vt_sdbm_nextkey, + vt_sdbm_freedatum, + vt_sdbm_usednames +}; + +#endif /* APU_HAVE_SDBM */ diff --git a/dbm/sdbm/sdbm.c b/dbm/sdbm/sdbm.c new file mode 100644 index 00000000000..9dfcc4bcefd --- /dev/null +++ b/dbm/sdbm/sdbm.c @@ -0,0 +1,584 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * sdbm - ndbm work-alike hashed database library + * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). + * author: oz@nexus.yorku.ca + * ex-public domain, ported to APR for Apache 2 + * core routines + */ + +#include "apr.h" +#include "apr_file_io.h" +#include "apr_strings.h" +#include "apr_errno.h" +#include "apr_sdbm.h" + +#include "sdbm_tune.h" +#include "sdbm_pair.h" +#include "sdbm_private.h" + +#include /* for memset() */ +#include /* for malloc() and free() */ + +/* + * forward + */ +static int getdbit (apr_sdbm_t *, long); +static apr_status_t setdbit(apr_sdbm_t *, long); +static apr_status_t getpage(apr_sdbm_t *db, long); +static apr_status_t getnext(apr_sdbm_datum_t *key, apr_sdbm_t *db); +static apr_status_t makroom(apr_sdbm_t *, long, int); + +/* + * useful macros + */ +#define bad(x) ((x).dptr == NULL || (x).dsize <= 0) +#define exhash(item) sdbm_hash((item).dptr, (item).dsize) + +#define OFF_PAG(off) (apr_off_t) (off) * PBLKSIZ +#define OFF_DIR(off) (apr_off_t) (off) * DBLKSIZ + +static const long masks[] = { + 000000000000, 000000000001, 000000000003, 000000000007, + 000000000017, 000000000037, 000000000077, 000000000177, + 000000000377, 000000000777, 000000001777, 000000003777, + 000000007777, 000000017777, 000000037777, 000000077777, + 000000177777, 000000377777, 000000777777, 000001777777, + 000003777777, 000007777777, 000017777777, 000037777777, + 000077777777, 000177777777, 000377777777, 000777777777, + 001777777777, 003777777777, 007777777777, 017777777777 +}; + +const apr_sdbm_datum_t sdbm_nullitem = { NULL, 0 }; + +static apr_status_t database_cleanup(void *data) +{ + apr_sdbm_t *db = data; + + /* + * Can't rely on apr_sdbm_unlock, since it will merely + * decrement the refcnt if several locks are held. + */ + if (db->flags & (SDBM_SHARED_LOCK | SDBM_EXCLUSIVE_LOCK)) + (void) apr_file_unlock(db->dirf); + (void) apr_file_close(db->dirf); + (void) apr_file_close(db->pagf); + free(db); + + return APR_SUCCESS; +} + +static apr_status_t prep(apr_sdbm_t **pdb, const char *dirname, const char *pagname, + apr_int32_t flags, apr_fileperms_t perms, apr_pool_t *p) +{ + apr_sdbm_t *db; + apr_status_t status; + + *pdb = NULL; + + db = malloc(sizeof(*db)); + memset(db, 0, sizeof(*db)); + + db->pool = p; + + /* + * adjust user flags so that WRONLY becomes RDWR, + * as required by this package. Also set our internal + * flag for RDONLY if needed. + */ + if (!(flags & APR_WRITE)) { + db->flags |= SDBM_RDONLY; + } + + /* + * adjust the file open flags so that we handle locking + * on our own (don't rely on any locking behavior within + * an apr_file_t, in case it's ever introduced, and set + * our own flag. + */ + if (flags & APR_SHARELOCK) { + db->flags |= SDBM_SHARED; + flags &= ~APR_SHARELOCK; + } + + flags |= APR_BINARY | APR_READ; + + /* + * open the files in sequence, and stat the dirfile. + * If we fail anywhere, undo everything, return NULL. + */ + + if ((status = apr_file_open(&db->dirf, dirname, flags, perms, p)) + != APR_SUCCESS) + goto error; + + if ((status = apr_file_open(&db->pagf, pagname, flags, perms, p)) + != APR_SUCCESS) + goto error; + + if ((status = apr_sdbm_lock(db, (db->flags & SDBM_RDONLY) + ? APR_FLOCK_SHARED + : APR_FLOCK_EXCLUSIVE)) + != APR_SUCCESS) + goto error; + + /* apr_pcalloc zeroed the buffers + * apr_sdbm_lock stated the dirf->size and invalidated the cache + */ + + /* + * if we are opened in SHARED mode, unlock ourself + */ + if (db->flags & SDBM_SHARED) + if ((status = apr_sdbm_unlock(db)) != APR_SUCCESS) + goto error; + + /* make sure that we close the database at some point */ + apr_pool_cleanup_register(p, db, database_cleanup, apr_pool_cleanup_null); + + /* Done! */ + *pdb = db; + return APR_SUCCESS; + +error: + if (db->dirf && db->pagf) + (void) apr_sdbm_unlock(db); + if (db->dirf != NULL) + (void) apr_file_close(db->dirf); + if (db->pagf != NULL) { + (void) apr_file_close(db->pagf); + } + free(db); + return status; +} + +APU_DECLARE(apr_status_t) apr_sdbm_open(apr_sdbm_t **db, const char *file, + apr_int32_t flags, + apr_fileperms_t perms, apr_pool_t *p) +{ + char *dirname = apr_pstrcat(p, file, APR_SDBM_DIRFEXT, NULL); + char *pagname = apr_pstrcat(p, file, APR_SDBM_PAGFEXT, NULL); + + return prep(db, dirname, pagname, flags, perms, p); +} + +APU_DECLARE(apr_status_t) apr_sdbm_close(apr_sdbm_t *db) +{ + return apr_pool_cleanup_run(db->pool, db, database_cleanup); +} + +APU_DECLARE(apr_status_t) apr_sdbm_fetch(apr_sdbm_t *db, apr_sdbm_datum_t *val, + apr_sdbm_datum_t key) +{ + apr_status_t status; + + if (db == NULL || bad(key)) + return APR_EINVAL; + + if ((status = apr_sdbm_lock(db, APR_FLOCK_SHARED)) != APR_SUCCESS) + return status; + + if ((status = getpage(db, exhash(key))) == APR_SUCCESS) { + *val = getpair(db->pagbuf, key); + /* ### do we want a not-found result? */ + } + + (void) apr_sdbm_unlock(db); + + return status; +} + +static apr_status_t write_page(apr_sdbm_t *db, const char *buf, long pagno) +{ + apr_status_t status; + apr_off_t off = OFF_PAG(pagno); + + if ((status = apr_file_seek(db->pagf, APR_SET, &off)) == APR_SUCCESS) + status = apr_file_write_full(db->pagf, buf, PBLKSIZ, NULL); + + return status; +} + +APU_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db, + const apr_sdbm_datum_t key) +{ + apr_status_t status; + + if (db == NULL || bad(key)) + return APR_EINVAL; + if (apr_sdbm_rdonly(db)) + return APR_EINVAL; + + if ((status = apr_sdbm_lock(db, APR_FLOCK_EXCLUSIVE)) != APR_SUCCESS) + return status; + + if ((status = getpage(db, exhash(key))) == APR_SUCCESS) { + if (!delpair(db->pagbuf, key)) + /* ### should we define some APRUTIL codes? */ + status = APR_EGENERAL; + else + status = write_page(db, db->pagbuf, db->pagbno); + } + + (void) apr_sdbm_unlock(db); + + return status; +} + +APU_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key, + apr_sdbm_datum_t val, int flags) +{ + int need; + register long hash; + apr_status_t status; + + if (db == NULL || bad(key)) + return APR_EINVAL; + if (apr_sdbm_rdonly(db)) + return APR_EINVAL; + need = key.dsize + val.dsize; + /* + * is the pair too big (or too small) for this database ?? + */ + if (need < 0 || need > PAIRMAX) + return APR_EINVAL; + + if ((status = apr_sdbm_lock(db, APR_FLOCK_EXCLUSIVE)) != APR_SUCCESS) + return status; + + if ((status = getpage(db, (hash = exhash(key)))) == APR_SUCCESS) { + + /* + * if we need to replace, delete the key/data pair + * first. If it is not there, ignore. + */ + if (flags == APR_SDBM_REPLACE) + (void) delpair(db->pagbuf, key); + else if (!(flags & APR_SDBM_INSERTDUP) && duppair(db->pagbuf, key)) { + status = APR_EEXIST; + goto error; + } + /* + * if we do not have enough room, we have to split. + */ + if (!fitpair(db->pagbuf, need)) + if ((status = makroom(db, hash, need)) != APR_SUCCESS) + goto error; + /* + * we have enough room or split is successful. insert the key, + * and update the page file. + */ + (void) putpair(db->pagbuf, key, val); + + status = write_page(db, db->pagbuf, db->pagbno); + } + +error: + (void) apr_sdbm_unlock(db); + + return status; +} + +/* + * makroom - make room by splitting the overfull page + * this routine will attempt to make room for SPLTMAX times before + * giving up. + */ +static apr_status_t makroom(apr_sdbm_t *db, long hash, int need) +{ + long newp; + char twin[PBLKSIZ]; + char *pag = db->pagbuf; + char *new = twin; + register int smax = SPLTMAX; + apr_status_t status; + + do { + /* + * split the current page + */ + (void) splpage(pag, new, db->hmask + 1); + /* + * address of the new page + */ + newp = (hash & db->hmask) | (db->hmask + 1); + + /* + * write delay, read avoidence/cache shuffle: + * select the page for incoming pair: if key is to go to the new page, + * write out the previous one, and copy the new one over, thus making + * it the current page. If not, simply write the new page, and we are + * still looking at the page of interest. current page is not updated + * here, as sdbm_store will do so, after it inserts the incoming pair. + */ + if (hash & (db->hmask + 1)) { + if ((status = write_page(db, db->pagbuf, db->pagbno)) + != APR_SUCCESS) + return status; + + db->pagbno = newp; + (void) memcpy(pag, new, PBLKSIZ); + } + else { + if ((status = write_page(db, new, newp)) != APR_SUCCESS) + return status; + } + + if ((status = setdbit(db, db->curbit)) != APR_SUCCESS) + return status; + /* + * see if we have enough room now + */ + if (fitpair(pag, need)) + return APR_SUCCESS; + /* + * try again... update curbit and hmask as getpage would have + * done. because of our update of the current page, we do not + * need to read in anything. BUT we have to write the current + * [deferred] page out, as the window of failure is too great. + */ + db->curbit = 2 * db->curbit + + ((hash & (db->hmask + 1)) ? 2 : 1); + db->hmask |= db->hmask + 1; + + if ((status = write_page(db, db->pagbuf, db->pagbno)) + != APR_SUCCESS) + return status; + + } while (--smax); + + /* + * if we are here, this is real bad news. After SPLTMAX splits, + * we still cannot fit the key. say goodnight. + */ +#if 0 + (void) write(2, "sdbm: cannot insert after SPLTMAX attempts.\n", 44); +#endif + /* ### ENOSPC not really appropriate but better than nothing */ + return APR_ENOSPC; + +} + +/* Reads 'len' bytes from file 'f' at offset 'off' into buf. + * 'off' is given relative to the start of the file. + * If EOF is returned while reading, this is taken as success. + */ +static apr_status_t read_from(apr_file_t *f, void *buf, + apr_off_t off, apr_size_t len) +{ + apr_status_t status; + + if ((status = apr_file_seek(f, APR_SET, &off)) != APR_SUCCESS || + ((status = apr_file_read_full(f, buf, len, NULL)) != APR_SUCCESS)) { + /* if EOF is reached, pretend we read all zero's */ + if (status == APR_EOF) { + memset(buf, 0, len); + status = APR_SUCCESS; + } + } + + return status; +} + +/* + * the following two routines will break if + * deletions aren't taken into account. (ndbm bug) + */ +APU_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db, + apr_sdbm_datum_t *key) +{ + apr_status_t status; + + if ((status = apr_sdbm_lock(db, APR_FLOCK_SHARED)) != APR_SUCCESS) + return status; + + /* + * start at page 0 + */ + if ((status = read_from(db->pagf, db->pagbuf, OFF_PAG(0), PBLKSIZ)) + == APR_SUCCESS) { + db->pagbno = 0; + db->blkptr = 0; + db->keyptr = 0; + status = getnext(key, db); + } + + (void) apr_sdbm_unlock(db); + + return status; +} + +APU_DECLARE(apr_status_t) apr_sdbm_nextkey(apr_sdbm_t *db, + apr_sdbm_datum_t *key) +{ + apr_status_t status; + + if ((status = apr_sdbm_lock(db, APR_FLOCK_SHARED)) != APR_SUCCESS) + return status; + + status = getnext(key, db); + + (void) apr_sdbm_unlock(db); + + return status; +} + +/* + * all important binary tree traversal + */ +static apr_status_t getpage(apr_sdbm_t *db, long hash) +{ + register int hbit; + register long dbit; + register long pagb; + apr_status_t status; + + dbit = 0; + hbit = 0; + while (dbit < db->maxbno && getdbit(db, dbit)) + dbit = 2 * dbit + ((hash & (1 << hbit++)) ? 2 : 1); + + debug(("dbit: %d...", dbit)); + + db->curbit = dbit; + db->hmask = masks[hbit]; + + pagb = hash & db->hmask; + /* + * see if the block we need is already in memory. + * note: this lookaside cache has about 10% hit rate. + */ + if (pagb != db->pagbno) { + /* + * note: here, we assume a "hole" is read as 0s. + * if not, must zero pagbuf first. + * ### joe: this assumption was surely never correct? but + * ### we make it so in read_from anyway. + */ + if ((status = read_from(db->pagf, db->pagbuf, OFF_PAG(pagb), PBLKSIZ)) + != APR_SUCCESS) + return status; + + if (!chkpage(db->pagbuf)) + return APR_ENOSPC; /* ### better error? */ + db->pagbno = pagb; + + debug(("pag read: %d\n", pagb)); + } + return APR_SUCCESS; +} + +static int getdbit(apr_sdbm_t *db, long dbit) +{ + register long c; + register long dirb; + + c = dbit / BYTESIZ; + dirb = c / DBLKSIZ; + + if (dirb != db->dirbno) { + if (read_from(db->dirf, db->dirbuf, OFF_DIR(dirb), DBLKSIZ) + != APR_SUCCESS) + return 0; + + db->dirbno = dirb; + + debug(("dir read: %d\n", dirb)); + } + + return db->dirbuf[c % DBLKSIZ] & (1 << dbit % BYTESIZ); +} + +static apr_status_t setdbit(apr_sdbm_t *db, long dbit) +{ + register long c; + register long dirb; + apr_status_t status; + apr_off_t off; + + c = dbit / BYTESIZ; + dirb = c / DBLKSIZ; + + if (dirb != db->dirbno) { + if ((status = read_from(db->dirf, db->dirbuf, OFF_DIR(dirb), DBLKSIZ)) + != APR_SUCCESS) + return status; + + db->dirbno = dirb; + + debug(("dir read: %d\n", dirb)); + } + + db->dirbuf[c % DBLKSIZ] |= (1 << dbit % BYTESIZ); + + if (dbit >= db->maxbno) + db->maxbno += DBLKSIZ * BYTESIZ; + + off = OFF_DIR(dirb); + if ((status = apr_file_seek(db->dirf, APR_SET, &off)) == APR_SUCCESS) + status = apr_file_write_full(db->dirf, db->dirbuf, DBLKSIZ, NULL); + + return status; +} + +/* +* getnext - get the next key in the page, and if done with +* the page, try the next page in sequence +*/ +static apr_status_t getnext(apr_sdbm_datum_t *key, apr_sdbm_t *db) +{ + apr_status_t status; + for (;;) { + db->keyptr++; + *key = getnkey(db->pagbuf, db->keyptr); + if (key->dptr != NULL) + return APR_SUCCESS; + /* + * we either run out, or there is nothing on this page.. + * try the next one... If we lost our position on the + * file, we will have to seek. + */ + db->keyptr = 0; + if (db->pagbno != db->blkptr++) { + apr_off_t off = OFF_PAG(db->blkptr); + if ((status = apr_file_seek(db->pagf, APR_SET, &off)) + != APR_SUCCESS) + return status; + } + + db->pagbno = db->blkptr; + /* ### EOF acceptable here too? */ + if ((status = apr_file_read_full(db->pagf, db->pagbuf, PBLKSIZ, NULL)) + != APR_SUCCESS) + return status; + if (!chkpage(db->pagbuf)) + return APR_EGENERAL; /* ### need better error */ + } + + /* NOTREACHED */ +} + + +APU_DECLARE(int) apr_sdbm_rdonly(apr_sdbm_t *db) +{ + /* ### Should we return true if the first lock is a share lock, + * to reflect that apr_sdbm_store and apr_sdbm_delete will fail? + */ + return (db->flags & SDBM_RDONLY) != 0; +} + diff --git a/dbm/sdbm/sdbm_hash.c b/dbm/sdbm/sdbm_hash.c new file mode 100644 index 00000000000..e4d75179451 --- /dev/null +++ b/dbm/sdbm/sdbm_hash.c @@ -0,0 +1,63 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * sdbm - ndbm work-alike hashed database library + * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). + * author: oz@nexus.yorku.ca + * status: ex-public domain. keep it that way. + * + * hashing routine + */ + +#include "apr_sdbm.h" +#include "sdbm_private.h" + +/* + * polynomial conversion ignoring overflows + * [this seems to work remarkably well, in fact better + * then the ndbm hash function. Replace at your own risk] + * use: 65599 nice. + * 65587 even better. + */ +long sdbm_hash(const char *str, int len) +{ + register unsigned long n = 0; + +#define DUFF /* go ahead and use the loop-unrolled version */ +#ifdef DUFF + +#define HASHC n = *str++ + 65599 * n + + if (len > 0) { + register int loop = (len + 8 - 1) >> 3; + + switch(len & (8 - 1)) { + case 0: do { + HASHC; case 7: HASHC; + case 6: HASHC; case 5: HASHC; + case 4: HASHC; case 3: HASHC; + case 2: HASHC; case 1: HASHC; + } while (--loop); + } + + } +#else + while (len--) + n = *str++ + 65599 * n; +#endif + return n; +} diff --git a/dbm/sdbm/sdbm_lock.c b/dbm/sdbm/sdbm_lock.c new file mode 100644 index 00000000000..7d62ffd62e2 --- /dev/null +++ b/dbm/sdbm/sdbm_lock.c @@ -0,0 +1,79 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_file_info.h" +#include "apr_file_io.h" +#include "apr_sdbm.h" + +#include "sdbm_private.h" +#include "sdbm_tune.h" + +/* NOTE: this function may block until it acquires the lock */ +APU_DECLARE(apr_status_t) apr_sdbm_lock(apr_sdbm_t *db, int type) +{ + apr_status_t status; + int lock_type = type & APR_FLOCK_TYPEMASK; + + if (!(lock_type == APR_FLOCK_SHARED || lock_type == APR_FLOCK_EXCLUSIVE)) + return APR_EINVAL; + + if (db->flags & SDBM_EXCLUSIVE_LOCK) { + ++db->lckcnt; + return APR_SUCCESS; + } + else if (db->flags & SDBM_SHARED_LOCK) { + /* + * Cannot promote a shared lock to an exlusive lock + * in a cross-platform compatibile manner. + */ + if (type == APR_FLOCK_EXCLUSIVE) + return APR_EINVAL; + ++db->lckcnt; + return APR_SUCCESS; + } + /* + * zero size: either a fresh database, or one with a single, + * unsplit data page: dirpage is all zeros. + */ + if ((status = apr_file_lock(db->dirf, type)) == APR_SUCCESS) + { + apr_finfo_t finfo; + if ((status = apr_file_info_get(&finfo, APR_FINFO_SIZE, db->dirf)) + != APR_SUCCESS) { + (void) apr_file_unlock(db->dirf); + return status; + } + + SDBM_INVALIDATE_CACHE(db, finfo); + + ++db->lckcnt; + if (type == APR_FLOCK_SHARED) + db->flags |= SDBM_SHARED_LOCK; + else if (type == APR_FLOCK_EXCLUSIVE) + db->flags |= SDBM_EXCLUSIVE_LOCK; + } + return status; +} + +APU_DECLARE(apr_status_t) apr_sdbm_unlock(apr_sdbm_t *db) +{ + if (!(db->flags & (SDBM_SHARED_LOCK | SDBM_EXCLUSIVE_LOCK))) + return APR_EINVAL; + if (--db->lckcnt > 0) + return APR_SUCCESS; + db->flags &= ~(SDBM_SHARED_LOCK | SDBM_EXCLUSIVE_LOCK); + return apr_file_unlock(db->dirf); +} diff --git a/dbm/sdbm/sdbm_pair.c b/dbm/sdbm/sdbm_pair.c new file mode 100644 index 00000000000..2130200734e --- /dev/null +++ b/dbm/sdbm/sdbm_pair.c @@ -0,0 +1,319 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * sdbm - ndbm work-alike hashed database library + * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). + * author: oz@nexus.yorku.ca + * status: ex-public domain. + * + * page-level routines + */ + +#include "apr_sdbm.h" + +#include "sdbm_tune.h" +#include "sdbm_pair.h" +#include "sdbm_private.h" + +#include /* for memset() */ + + +#define exhash(item) sdbm_hash((item).dptr, (item).dsize) + +/* + * forward + */ +static int seepair(char *, int, char *, int); + +/* + * page format: + * +------------------------------+ + * ino | n | keyoff | datoff | keyoff | + * +------------+--------+--------+ + * | datoff | - - - ----> | + * +--------+---------------------+ + * | F R E E A R E A | + * +--------------+---------------+ + * | <---- - - - | data | + * +--------+-----+----+----------+ + * | key | data | key | + * +--------+----------+----------+ + * + * calculating the offsets for free area: if the number + * of entries (ino[0]) is zero, the offset to the END of + * the free area is the block size. Otherwise, it is the + * nth (ino[ino[0]]) entry's offset. + */ + +int +fitpair(pag, need) +char *pag; +int need; +{ + register int n; + register int off; + register int avail; + register short *ino = (short *) pag; + + off = ((n = ino[0]) > 0) ? ino[n] : PBLKSIZ; + avail = off - (n + 1) * sizeof(short); + need += 2 * sizeof(short); + + debug(("avail %d need %d\n", avail, need)); + + return need <= avail; +} + +void +putpair(pag, key, val) +char *pag; +apr_sdbm_datum_t key; +apr_sdbm_datum_t val; +{ + register int n; + register int off; + register short *ino = (short *) pag; + + off = ((n = ino[0]) > 0) ? ino[n] : PBLKSIZ; +/* + * enter the key first + */ + off -= key.dsize; + (void) memcpy(pag + off, key.dptr, key.dsize); + ino[n + 1] = off; +/* + * now the data + */ + off -= val.dsize; + (void) memcpy(pag + off, val.dptr, val.dsize); + ino[n + 2] = off; +/* + * adjust item count + */ + ino[0] += 2; +} + +apr_sdbm_datum_t +getpair(pag, key) +char *pag; +apr_sdbm_datum_t key; +{ + register int i; + register int n; + apr_sdbm_datum_t val; + register short *ino = (short *) pag; + + if ((n = ino[0]) == 0) + return sdbm_nullitem; + + if ((i = seepair(pag, n, key.dptr, key.dsize)) == 0) + return sdbm_nullitem; + + val.dptr = pag + ino[i + 1]; + val.dsize = ino[i] - ino[i + 1]; + return val; +} + +int +duppair(pag, key) +char *pag; +apr_sdbm_datum_t key; +{ + register short *ino = (short *) pag; + return ino[0] > 0 && seepair(pag, ino[0], key.dptr, key.dsize) > 0; +} + +apr_sdbm_datum_t +getnkey(pag, num) +char *pag; +int num; +{ + apr_sdbm_datum_t key; + register int off; + register short *ino = (short *) pag; + + num = num * 2 - 1; + if (ino[0] == 0 || num > ino[0]) + return sdbm_nullitem; + + off = (num > 1) ? ino[num - 1] : PBLKSIZ; + + key.dptr = pag + ino[num]; + key.dsize = off - ino[num]; + + return key; +} + +int +delpair(pag, key) +char *pag; +apr_sdbm_datum_t key; +{ + register int n; + register int i; + register short *ino = (short *) pag; + + if ((n = ino[0]) == 0) + return 0; + + if ((i = seepair(pag, n, key.dptr, key.dsize)) == 0) + return 0; +/* + * found the key. if it is the last entry + * [i.e. i == n - 1] we just adjust the entry count. + * hard case: move all data down onto the deleted pair, + * shift offsets onto deleted offsets, and adjust them. + * [note: 0 < i < n] + */ + if (i < n - 1) { + register int m; + register char *dst = pag + (i == 1 ? PBLKSIZ : ino[i - 1]); + register char *src = pag + ino[i + 1]; + register short zoo = (short) (dst - src); + + debug(("free-up %d ", zoo)); +/* + * shift data/keys down + */ + m = ino[i + 1] - ino[n]; + +#undef DUFF /* just use memmove. it should be plenty fast. */ +#ifdef DUFF +#define MOVB *--dst = *--src + + if (m > 0) { + register int loop = (m + 8 - 1) >> 3; + + switch (m & (8 - 1)) { + case 0: do { + MOVB; case 7: MOVB; + case 6: MOVB; case 5: MOVB; + case 4: MOVB; case 3: MOVB; + case 2: MOVB; case 1: MOVB; + } while (--loop); + } + } +#else + dst -= m; + src -= m; + memmove(dst, src, m); +#endif + +/* + * adjust offset index up + */ + while (i < n - 1) { + ino[i] = ino[i + 2] + zoo; + i++; + } + } + ino[0] -= 2; + return 1; +} + +/* + * search for the key in the page. + * return offset index in the range 0 < i < n. + * return 0 if not found. + */ +static int +seepair(pag, n, key, siz) +char *pag; +register int n; +register char *key; +register int siz; +{ + register int i; + register int off = PBLKSIZ; + register short *ino = (short *) pag; + + for (i = 1; i < n; i += 2) { + if (siz == off - ino[i] && + memcmp(key, pag + ino[i], siz) == 0) + return i; + off = ino[i + 1]; + } + return 0; +} + +void +splpage(pag, new, sbit) +char *pag; +char *new; +long sbit; +{ + apr_sdbm_datum_t key; + apr_sdbm_datum_t val; + + register int n; + register int off = PBLKSIZ; + char cur[PBLKSIZ]; + register short *ino = (short *) cur; + + (void) memcpy(cur, pag, PBLKSIZ); + (void) memset(pag, 0, PBLKSIZ); + (void) memset(new, 0, PBLKSIZ); + + n = ino[0]; + for (ino++; n > 0; ino += 2) { + key.dptr = cur + ino[0]; + key.dsize = off - ino[0]; + val.dptr = cur + ino[1]; + val.dsize = ino[0] - ino[1]; +/* + * select the page pointer (by looking at sbit) and insert + */ + (void) putpair((exhash(key) & sbit) ? new : pag, key, val); + + off = ino[1]; + n -= 2; + } + + debug(("%d split %d/%d\n", ((short *) cur)[0] / 2, + ((short *) new)[0] / 2, + ((short *) pag)[0] / 2)); +} + +/* + * check page sanity: + * number of entries should be something + * reasonable, and all offsets in the index should be in order. + * this could be made more rigorous. + */ +int +chkpage(pag) +char *pag; +{ + register int n; + register int off; + register short *ino = (short *) pag; + + if ((n = ino[0]) < 0 || n > PBLKSIZ / sizeof(short)) + return 0; + + if (n > 0) { + off = PBLKSIZ; + for (ino++; n > 0; ino += 2) { + if (ino[0] > off || ino[1] > off || + ino[1] > ino[0]) + return 0; + off = ino[1]; + n -= 2; + } + } + return 1; +} diff --git a/dbm/sdbm/sdbm_pair.h b/dbm/sdbm/sdbm_pair.h new file mode 100644 index 00000000000..222c5e17f4b --- /dev/null +++ b/dbm/sdbm/sdbm_pair.h @@ -0,0 +1,40 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SDBM_PAIR_H +#define SDBM_PAIR_H + +/* Mini EMBED (pair.c) */ +#define chkpage apu__sdbm_chkpage +#define delpair apu__sdbm_delpair +#define duppair apu__sdbm_duppair +#define fitpair apu__sdbm_fitpair +#define getnkey apu__sdbm_getnkey +#define getpair apu__sdbm_getpair +#define putpair apu__sdbm_putpair +#define splpage apu__sdbm_splpage + +int fitpair(char *, int); +void putpair(char *, apr_sdbm_datum_t, apr_sdbm_datum_t); +apr_sdbm_datum_t getpair(char *, apr_sdbm_datum_t); +int delpair(char *, apr_sdbm_datum_t); +int chkpage (char *); +apr_sdbm_datum_t getnkey(char *, int); +void splpage(char *, char *, long); +int duppair(char *, apr_sdbm_datum_t); + +#endif /* SDBM_PAIR_H */ + diff --git a/dbm/sdbm/sdbm_private.h b/dbm/sdbm/sdbm_private.h new file mode 100644 index 00000000000..f5d1ae06b56 --- /dev/null +++ b/dbm/sdbm/sdbm_private.h @@ -0,0 +1,84 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * sdbm - ndbm work-alike hashed database library + * based on Per-Ake Larson's Dynamic Hashing algorithms. BIT 18 (1978). + * author: oz@nexus.yorku.ca + */ + +#ifndef SDBM_PRIVATE_H +#define SDBM_PRIVATE_H + +#include "apr.h" +#include "apr_pools.h" +#include "apr_file_io.h" +#include "apr_errno.h" /* for apr_status_t */ + +#if 0 +/* if the block/page size is increased, it breaks perl apr_sdbm_t compatibility */ +#define DBLKSIZ 16384 +#define PBLKSIZ 8192 +#define PAIRMAX 8008 /* arbitrary on PBLKSIZ-N */ +#else +#define DBLKSIZ 4096 +#define PBLKSIZ 1024 +#define PAIRMAX 1008 /* arbitrary on PBLKSIZ-N */ +#endif +#define SPLTMAX 10 /* maximum allowed splits */ + +/* for apr_sdbm_t.flags */ +#define SDBM_RDONLY 0x1 /* data base open read-only */ +#define SDBM_SHARED 0x2 /* data base open for sharing */ +#define SDBM_SHARED_LOCK 0x4 /* data base locked for shared read */ +#define SDBM_EXCLUSIVE_LOCK 0x8 /* data base locked for write */ + +struct apr_sdbm_t { + apr_pool_t *pool; + apr_file_t *dirf; /* directory file descriptor */ + apr_file_t *pagf; /* page file descriptor */ + apr_int32_t flags; /* status/error flags, see below */ + long maxbno; /* size of dirfile in bits */ + long curbit; /* current bit number */ + long hmask; /* current hash mask */ + long blkptr; /* current block for nextkey */ + int keyptr; /* current key for nextkey */ + long blkno; /* current page to read/write */ + long pagbno; /* current page in pagbuf */ + char pagbuf[PBLKSIZ]; /* page file block buffer */ + long dirbno; /* current block in dirbuf */ + char dirbuf[DBLKSIZ]; /* directory file block buffer */ + int lckcnt; /* number of calls to sdbm_lock */ +}; + + +#define sdbm_hash apu__sdbm_hash +#define sdbm_nullitem apu__sdbm_nullitem + +extern const apr_sdbm_datum_t sdbm_nullitem; + +long sdbm_hash(const char *str, int len); + +/* + * zero the cache + */ +#define SDBM_INVALIDATE_CACHE(db, finfo) \ + do { db->dirbno = (!finfo.size) ? 0 : -1; \ + db->pagbno = -1; \ + db->maxbno = (long)(finfo.size * BYTESIZ); \ + } while (0); + +#endif /* SDBM_PRIVATE_H */ diff --git a/dbm/sdbm/sdbm_tune.h b/dbm/sdbm/sdbm_tune.h new file mode 100644 index 00000000000..9bf3d09f288 --- /dev/null +++ b/dbm/sdbm/sdbm_tune.h @@ -0,0 +1,40 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * sdbm - ndbm work-alike hashed database library + * tuning and portability constructs [not nearly enough] + * author: oz@nexus.yorku.ca + */ + +#ifndef SDBM_TUNE_H +#define SDBM_TUNE_H + +#include "apr_errno.h" + +/* ### this might be better off as sizeof(char *) */ +#define BYTESIZ 8 + +/* + * misc + */ +#ifdef DEBUG +#define debug(x) printf x +#else +#define debug(x) +#endif + +#endif /* SDBM_TUNE_H */ diff --git a/encoding/apr_base64.c b/encoding/apr_base64.c new file mode 100644 index 00000000000..1eed1530dff --- /dev/null +++ b/encoding/apr_base64.c @@ -0,0 +1,268 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* base64 encoder/decoder. Originally part of main/util.c + * but moved here so that support/ab and apr_sha1.c could + * use it. This meant removing the apr_palloc()s and adding + * ugly 'len' functions, which is quite a nasty cost. + */ + +#include "apr_base64.h" +#if APR_CHARSET_EBCDIC +#include "apr_xlate.h" +#endif /* APR_CHARSET_EBCDIC */ + +/* aaaack but it's fast and const should make it shared text page. */ +static const unsigned char pr2six[256] = +{ +#if !APR_CHARSET_EBCDIC + /* ASCII table */ + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64, + 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64, + 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 +#else /*APR_CHARSET_EBCDIC*/ + /* EBCDIC table */ + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 63, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 64, 64, 64, 64, 64, 64, + 64, 35, 36, 37, 38, 39, 40, 41, 42, 43, 64, 64, 64, 64, 64, 64, + 64, 64, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 64, 64, 64, 64, 64, 64, + 64, 9, 10, 11, 12, 13, 14, 15, 16, 17, 64, 64, 64, 64, 64, 64, + 64, 64, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64, 64, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64 +#endif /*APR_CHARSET_EBCDIC*/ +}; + +#if APR_CHARSET_EBCDIC +static apr_xlate_t *xlate_to_ebcdic; +static unsigned char os_toascii[256]; + +APU_DECLARE(apr_status_t) apr_base64init_ebcdic(apr_xlate_t *to_ascii, + apr_xlate_t *to_ebcdic) +{ + int i; + apr_size_t inbytes_left, outbytes_left; + apr_status_t rv; + int onoff; + + /* Only single-byte conversion is supported. + */ + rv = apr_xlate_sb_get(to_ascii, &onoff); + if (rv) { + return rv; + } + if (!onoff) { /* If conversion is not single-byte-only */ + return APR_EINVAL; + } + rv = apr_xlate_sb_get(to_ebcdic, &onoff); + if (rv) { + return rv; + } + if (!onoff) { /* If conversion is not single-byte-only */ + return APR_EINVAL; + } + xlate_to_ebcdic = to_ebcdic; + for (i = 0; i < sizeof(os_toascii); i++) { + os_toascii[i] = i; + } + inbytes_left = outbytes_left = sizeof(os_toascii); + apr_xlate_conv_buffer(to_ascii, os_toascii, &inbytes_left, + os_toascii, &outbytes_left); + + return APR_SUCCESS; +} +#endif /*APR_CHARSET_EBCDIC*/ + +APU_DECLARE(int) apr_base64_decode_len(const char *bufcoded) +{ + int nbytesdecoded; + register const unsigned char *bufin; + register apr_size_t nprbytes; + + bufin = (const unsigned char *) bufcoded; + while (pr2six[*(bufin++)] <= 63); + + nprbytes = (bufin - (const unsigned char *) bufcoded) - 1; + nbytesdecoded = (((int)nprbytes + 3) / 4) * 3; + + return nbytesdecoded + 1; +} + +APU_DECLARE(int) apr_base64_decode(char *bufplain, const char *bufcoded) +{ +#if APR_CHARSET_EBCDIC + apr_size_t inbytes_left, outbytes_left; +#endif /* APR_CHARSET_EBCDIC */ + int len; + + len = apr_base64_decode_binary((unsigned char *) bufplain, bufcoded); +#if APR_CHARSET_EBCDIC + inbytes_left = outbytes_left = len; + apr_xlate_conv_buffer(xlate_to_ebcdic, bufplain, &inbytes_left, + bufplain, &outbytes_left); +#endif /* APR_CHARSET_EBCDIC */ + bufplain[len] = '\0'; + return len; +} + +/* This is the same as apr_base64_decode() except on EBCDIC machines, where + * the conversion of the output to ebcdic is left out. + */ +APU_DECLARE(int) apr_base64_decode_binary(unsigned char *bufplain, + const char *bufcoded) +{ + int nbytesdecoded; + register const unsigned char *bufin; + register unsigned char *bufout; + register apr_size_t nprbytes; + + bufin = (const unsigned char *) bufcoded; + while (pr2six[*(bufin++)] <= 63); + nprbytes = (bufin - (const unsigned char *) bufcoded) - 1; + nbytesdecoded = (((int)nprbytes + 3) / 4) * 3; + + bufout = (unsigned char *) bufplain; + bufin = (const unsigned char *) bufcoded; + + while (nprbytes > 4) { + *(bufout++) = + (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4); + *(bufout++) = + (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2); + *(bufout++) = + (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]); + bufin += 4; + nprbytes -= 4; + } + + /* Note: (nprbytes == 1) would be an error, so just ingore that case */ + if (nprbytes > 1) { + *(bufout++) = + (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4); + } + if (nprbytes > 2) { + *(bufout++) = + (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2); + } + if (nprbytes > 3) { + *(bufout++) = + (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]); + } + + nbytesdecoded -= (4 - (int)nprbytes) & 3; + return nbytesdecoded; +} + +static const char basis_64[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +APU_DECLARE(int) apr_base64_encode_len(int len) +{ + return ((len + 2) / 3 * 4) + 1; +} + +APU_DECLARE(int) apr_base64_encode(char *encoded, const char *string, int len) +{ +#if !APR_CHARSET_EBCDIC + return apr_base64_encode_binary(encoded, (const unsigned char *) string, len); +#else /* APR_CHARSET_EBCDIC */ + int i; + char *p; + + p = encoded; + for (i = 0; i < len - 2; i += 3) { + *p++ = basis_64[(os_toascii[string[i]] >> 2) & 0x3F]; + *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4) | + ((int) (os_toascii[string[i + 1]] & 0xF0) >> 4)]; + *p++ = basis_64[((os_toascii[string[i + 1]] & 0xF) << 2) | + ((int) (os_toascii[string[i + 2]] & 0xC0) >> 6)]; + *p++ = basis_64[os_toascii[string[i + 2]] & 0x3F]; + } + if (i < len) { + *p++ = basis_64[(os_toascii[string[i]] >> 2) & 0x3F]; + if (i == (len - 1)) { + *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4)]; + *p++ = '='; + } + else { + *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4) | + ((int) (os_toascii[string[i + 1]] & 0xF0) >> 4)]; + *p++ = basis_64[((os_toascii[string[i + 1]] & 0xF) << 2)]; + } + *p++ = '='; + } + + *p++ = '\0'; + return p - encoded; +#endif /* APR_CHARSET_EBCDIC */ +} + +/* This is the same as apr_base64_encode() except on EBCDIC machines, where + * the conversion of the input to ascii is left out. + */ +APU_DECLARE(int) apr_base64_encode_binary(char *encoded, + const unsigned char *string, int len) +{ + int i; + char *p; + + p = encoded; + for (i = 0; i < len - 2; i += 3) { + *p++ = basis_64[(string[i] >> 2) & 0x3F]; + *p++ = basis_64[((string[i] & 0x3) << 4) | + ((int) (string[i + 1] & 0xF0) >> 4)]; + *p++ = basis_64[((string[i + 1] & 0xF) << 2) | + ((int) (string[i + 2] & 0xC0) >> 6)]; + *p++ = basis_64[string[i + 2] & 0x3F]; + } + if (i < len) { + *p++ = basis_64[(string[i] >> 2) & 0x3F]; + if (i == (len - 1)) { + *p++ = basis_64[((string[i] & 0x3) << 4)]; + *p++ = '='; + } + else { + *p++ = basis_64[((string[i] & 0x3) << 4) | + ((int) (string[i + 1] & 0xF0) >> 4)]; + *p++ = basis_64[((string[i + 1] & 0xF) << 2)]; + } + *p++ = '='; + } + + *p++ = '\0'; + return (int)(p - encoded); +} diff --git a/hooks/apr_hooks.c b/hooks/apr_hooks.c new file mode 100644 index 00000000000..d8eb82d233c --- /dev/null +++ b/hooks/apr_hooks.c @@ -0,0 +1,406 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "apr_pools.h" +#include "apr_tables.h" +#include "apr.h" +#include "apr_hooks.h" +#include "apr_hash.h" +#include "apr_optional_hooks.h" +#include "apr_optional.h" +#define APR_WANT_MEMFUNC +#define APR_WANT_STRFUNC +#include "apr_want.h" + +#if 0 +#define apr_palloc(pool,size) malloc(size) +#endif + +APU_DECLARE_DATA apr_pool_t *apr_hook_global_pool = NULL; +APU_DECLARE_DATA int apr_hook_debug_enabled = 0; +APU_DECLARE_DATA const char *apr_hook_debug_current = NULL; + +/** @deprecated @see apr_hook_global_pool */ +APU_DECLARE_DATA apr_pool_t *apr_global_hook_pool = NULL; + +/** @deprecated @see apr_hook_debug_enabled */ +APU_DECLARE_DATA int apr_debug_module_hooks = 0; + +/** @deprecated @see apr_hook_debug_current */ +APU_DECLARE_DATA const char *apr_current_hooking_module = NULL; + +/* NB: This must echo the LINK_##name structure */ +typedef struct +{ + void (*dummy)(void *); + const char *szName; + const char * const *aszPredecessors; + const char * const *aszSuccessors; + int nOrder; +} TSortData; + +typedef struct tsort_ +{ + void *pData; + int nPredecessors; + struct tsort_ **ppPredecessors; + struct tsort_ *pNext; +} TSort; + +#ifdef NETWARE +#include "apr_private.h" +#define get_apd APP_DATA* apd = (APP_DATA*)get_app_data(gLibId); +#define s_aHooksToSort ((apr_array_header_t *)(apd->gs_aHooksToSort)) +#define s_phOptionalHooks ((apr_hash_t *)(apd->gs_phOptionalHooks)) +#define s_phOptionalFunctions ((apr_hash_t *)(apd->gs_phOptionalFunctions)) +#endif + +static int crude_order(const void *a_,const void *b_) +{ + const TSortData *a=a_; + const TSortData *b=b_; + + return a->nOrder-b->nOrder; +} + +static TSort *prepare(apr_pool_t *p,TSortData *pItems,int nItems) +{ + TSort *pData=apr_palloc(p,nItems*sizeof *pData); + int n; + + qsort(pItems,nItems,sizeof *pItems,crude_order); + for(n=0 ; n < nItems ; ++n) { + pData[n].nPredecessors=0; + pData[n].ppPredecessors=apr_pcalloc(p,nItems*sizeof *pData[n].ppPredecessors); + pData[n].pNext=NULL; + pData[n].pData=&pItems[n]; + } + + for(n=0 ; n < nItems ; ++n) { + int i,k; + + for(i=0 ; pItems[n].aszPredecessors && pItems[n].aszPredecessors[i] ; ++i) + for(k=0 ; k < nItems ; ++k) + if(!strcmp(pItems[k].szName,pItems[n].aszPredecessors[i])) { + int l; + + for(l=0 ; l < pData[n].nPredecessors ; ++l) + if(pData[n].ppPredecessors[l] == &pData[k]) + goto got_it; + pData[n].ppPredecessors[pData[n].nPredecessors]=&pData[k]; + ++pData[n].nPredecessors; + got_it: + break; + } + for(i=0 ; pItems[n].aszSuccessors && pItems[n].aszSuccessors[i] ; ++i) + for(k=0 ; k < nItems ; ++k) + if(!strcmp(pItems[k].szName,pItems[n].aszSuccessors[i])) { + int l; + + for(l=0 ; l < pData[k].nPredecessors ; ++l) + if(pData[k].ppPredecessors[l] == &pData[n]) + goto got_it2; + pData[k].ppPredecessors[pData[k].nPredecessors]=&pData[n]; + ++pData[k].nPredecessors; + got_it2: + break; + } + } + + return pData; +} + +/* Topologically sort, dragging out-of-order items to the front. Note that + this tends to preserve things that want to be near the front better, and + changing that behaviour might compromise some of Apache's behaviour (in + particular, mod_log_forensic might otherwise get pushed to the end, and + core.c's log open function used to end up at the end when pushing items + to the back was the methedology). Also note that the algorithm could + go back to its original simplicity by sorting from the back instead of + the front. +*/ +static TSort *tsort(TSort *pData,int nItems) +{ + int nTotal; + TSort *pHead=NULL; + TSort *pTail=NULL; + + for(nTotal=0 ; nTotal < nItems ; ++nTotal) { + int n,i,k; + + for(n=0 ; ; ++n) { + if(n == nItems) + assert(0); /* we have a loop... */ + if(!pData[n].pNext) { + if(pData[n].nPredecessors) { + for(k=0 ; ; ++k) { + assert(k < nItems); + if(pData[n].ppPredecessors[k]) + break; + } + for(i=0 ; ; ++i) { + assert(i < nItems); + if(&pData[i] == pData[n].ppPredecessors[k]) { + n=i-1; + break; + } + } + } else + break; + } + } + if(pTail) + pTail->pNext=&pData[n]; + else + pHead=&pData[n]; + pTail=&pData[n]; + pTail->pNext=pTail; /* fudge it so it looks linked */ + for(i=0 ; i < nItems ; ++i) + for(k=0 ; k < nItems ; ++k) + if(pData[i].ppPredecessors[k] == &pData[n]) { + --pData[i].nPredecessors; + pData[i].ppPredecessors[k]=NULL; + break; + } + } + pTail->pNext=NULL; /* unfudge the tail */ + return pHead; +} + +static apr_array_header_t *sort_hook(apr_array_header_t *pHooks, + const char *szName) +{ + apr_pool_t *p; + TSort *pSort; + apr_array_header_t *pNew; + int n; + + apr_pool_create(&p, apr_hook_global_pool); + pSort=prepare(p,(TSortData *)pHooks->elts,pHooks->nelts); + pSort=tsort(pSort,pHooks->nelts); + pNew=apr_array_make(apr_hook_global_pool,pHooks->nelts,sizeof(TSortData)); + if(apr_hook_debug_enabled) + printf("Sorting %s:",szName); + for(n=0 ; pSort ; pSort=pSort->pNext,++n) { + TSortData *pHook; + assert(n < pHooks->nelts); + pHook=apr_array_push(pNew); + memcpy(pHook,pSort->pData,sizeof *pHook); + if(apr_hook_debug_enabled) + printf(" %s",pHook->szName); + } + if(apr_hook_debug_enabled) + fputc('\n',stdout); + return pNew; +} + +#ifndef NETWARE +static apr_array_header_t *s_aHooksToSort; +#endif + +typedef struct +{ + const char *szHookName; + apr_array_header_t **paHooks; +} HookSortEntry; + +APU_DECLARE(void) apr_hook_sort_register(const char *szHookName, + apr_array_header_t **paHooks) +{ +#ifdef NETWARE + get_apd +#endif + HookSortEntry *pEntry; + + if(!s_aHooksToSort) + s_aHooksToSort=apr_array_make(apr_hook_global_pool,1,sizeof(HookSortEntry)); + pEntry=apr_array_push(s_aHooksToSort); + pEntry->szHookName=szHookName; + pEntry->paHooks=paHooks; +} + +APU_DECLARE(void) apr_hook_sort_all(void) +{ +#ifdef NETWARE + get_apd +#endif + int n; + + if (!s_aHooksToSort) { + s_aHooksToSort = apr_array_make(apr_hook_global_pool, 1, sizeof(HookSortEntry)); + } + + for(n=0 ; n < s_aHooksToSort->nelts ; ++n) { + HookSortEntry *pEntry=&((HookSortEntry *)s_aHooksToSort->elts)[n]; + *pEntry->paHooks=sort_hook(*pEntry->paHooks,pEntry->szHookName); + } +} + +#ifndef NETWARE +static apr_hash_t *s_phOptionalHooks; +static apr_hash_t *s_phOptionalFunctions; +#endif + +APU_DECLARE(void) apr_hook_deregister_all(void) +{ +#ifdef NETWARE + get_apd +#endif + int n; + + for(n=0 ; n < s_aHooksToSort->nelts ; ++n) { + HookSortEntry *pEntry=&((HookSortEntry *)s_aHooksToSort->elts)[n]; + *pEntry->paHooks=NULL; + } + s_aHooksToSort=NULL; + s_phOptionalHooks=NULL; + s_phOptionalFunctions=NULL; +} + +APU_DECLARE(void) apr_hook_debug_show(const char *szName, + const char * const *aszPre, + const char * const *aszSucc) +{ + int nFirst; + + printf(" Hooked %s",szName); + if(aszPre) { + fputs(" pre(",stdout); + nFirst=1; + while(*aszPre) { + if(!nFirst) + fputc(',',stdout); + nFirst=0; + fputs(*aszPre,stdout); + ++aszPre; + } + fputc(')',stdout); + } + if(aszSucc) { + fputs(" succ(",stdout); + nFirst=1; + while(*aszSucc) { + if(!nFirst) + fputc(',',stdout); + nFirst=0; + fputs(*aszSucc,stdout); + ++aszSucc; + } + fputc(')',stdout); + } + fputc('\n',stdout); +} + +/* Optional hook support */ + +APR_DECLARE_EXTERNAL_HOOK(apr,APU,void,_optional,(void)) + +APU_DECLARE(apr_array_header_t *) apr_optional_hook_get(const char *szName) +{ +#ifdef NETWARE + get_apd +#endif + apr_array_header_t **ppArray; + + if(!s_phOptionalHooks) + return NULL; + ppArray=apr_hash_get(s_phOptionalHooks,szName,strlen(szName)); + if(!ppArray) + return NULL; + return *ppArray; +} + +APU_DECLARE(void) apr_optional_hook_add(const char *szName,void (*pfn)(void), + const char * const *aszPre, + const char * const *aszSucc,int nOrder) +{ +#ifdef NETWARE + get_apd +#endif + apr_array_header_t *pArray=apr_optional_hook_get(szName); + apr_LINK__optional_t *pHook; + + if(!pArray) { + apr_array_header_t **ppArray; + + pArray=apr_array_make(apr_hook_global_pool,1, + sizeof(apr_LINK__optional_t)); + if(!s_phOptionalHooks) + s_phOptionalHooks=apr_hash_make(apr_hook_global_pool); + ppArray=apr_palloc(apr_hook_global_pool,sizeof *ppArray); + *ppArray=pArray; + apr_hash_set(s_phOptionalHooks,szName,strlen(szName),ppArray); + apr_hook_sort_register(szName,ppArray); + } + pHook=apr_array_push(pArray); + pHook->pFunc=pfn; + pHook->aszPredecessors=aszPre; + pHook->aszSuccessors=aszSucc; + pHook->nOrder=nOrder; + pHook->szName=apr_hook_debug_current; + if(apr_hook_debug_enabled) + apr_hook_debug_show(szName,aszPre,aszSucc); +} + +/* optional function support */ + +APU_DECLARE(apr_opt_fn_t *) apr_dynamic_fn_retrieve(const char *szName) +{ +#ifdef NETWARE + get_apd +#endif + if(!s_phOptionalFunctions) + return NULL; + return (void(*)(void))apr_hash_get(s_phOptionalFunctions,szName,strlen(szName)); +} + +/* Deprecated */ +APU_DECLARE_NONSTD(void) apr_dynamic_fn_register(const char *szName, + apr_opt_fn_t *pfn) +{ +#ifdef NETWARE + get_apd +#endif + if(!s_phOptionalFunctions) + s_phOptionalFunctions=apr_hash_make(apr_hook_global_pool); + apr_hash_set(s_phOptionalFunctions,szName,strlen(szName),(void *)pfn); +} + +#if 0 +void main() +{ + const char *aszAPre[]={"b","c",NULL}; + const char *aszBPost[]={"a",NULL}; + const char *aszCPost[]={"b",NULL}; + TSortData t1[]= + { + { "a",aszAPre,NULL }, + { "b",NULL,aszBPost }, + { "c",NULL,aszCPost } + }; + TSort *pResult; + + pResult=prepare(t1,3); + pResult=tsort(pResult,3); + + for( ; pResult ; pResult=pResult->pNext) + printf("%s\n",pResult->pData->szName); +} +#endif diff --git a/include/apr_anylock.h b/include/apr_anylock.h new file mode 100644 index 00000000000..51e97ff3733 --- /dev/null +++ b/include/apr_anylock.h @@ -0,0 +1,128 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file apr_anylock.h + * @brief APR-Util transparent any lock flavor wrapper + */ +#ifndef APR_ANYLOCK_H +#define APR_ANYLOCK_H + +#include "apr_proc_mutex.h" +#include "apr_thread_mutex.h" +#include "apr_thread_rwlock.h" + +/** Structure that may contain any APR lock type */ +typedef struct apr_anylock_t { + /** Indicates what type of lock is in lock */ + enum tm_lock { + apr_anylock_none, /**< None */ + apr_anylock_procmutex, /**< Process-based */ + apr_anylock_threadmutex, /**< Thread-based */ + apr_anylock_readlock, /**< Read lock */ + apr_anylock_writelock /**< Write lock */ + } type; + /** Union of all possible APR locks */ + union apr_anylock_u_t { + apr_proc_mutex_t *pm; /**< Process mutex */ +#if APR_HAS_THREADS + apr_thread_mutex_t *tm; /**< Thread mutex */ + apr_thread_rwlock_t *rw; /**< Read-write lock */ +#endif + } lock; +} apr_anylock_t; + +#if APR_HAS_THREADS + +/** Lock an apr_anylock_t structure */ +#define APR_ANYLOCK_LOCK(lck) \ + (((lck)->type == apr_anylock_none) \ + ? APR_SUCCESS \ + : (((lck)->type == apr_anylock_threadmutex) \ + ? apr_thread_mutex_lock((lck)->lock.tm) \ + : (((lck)->type == apr_anylock_procmutex) \ + ? apr_proc_mutex_lock((lck)->lock.pm) \ + : (((lck)->type == apr_anylock_readlock) \ + ? apr_thread_rwlock_rdlock((lck)->lock.rw) \ + : (((lck)->type == apr_anylock_writelock) \ + ? apr_thread_rwlock_wrlock((lck)->lock.rw) \ + : APR_EINVAL))))) + +#else /* APR_HAS_THREADS */ + +#define APR_ANYLOCK_LOCK(lck) \ + (((lck)->type == apr_anylock_none) \ + ? APR_SUCCESS \ + : (((lck)->type == apr_anylock_procmutex) \ + ? apr_proc_mutex_lock((lck)->lock.pm) \ + : APR_EINVAL)) + +#endif /* APR_HAS_THREADS */ + +#if APR_HAS_THREADS + +/** Try to lock an apr_anylock_t structure */ +#define APR_ANYLOCK_TRYLOCK(lck) \ + (((lck)->type == apr_anylock_none) \ + ? APR_SUCCESS \ + : (((lck)->type == apr_anylock_threadmutex) \ + ? apr_thread_mutex_trylock((lck)->lock.tm) \ + : (((lck)->type == apr_anylock_procmutex) \ + ? apr_proc_mutex_trylock((lck)->lock.pm) \ + : (((lck)->type == apr_anylock_readlock) \ + ? apr_thread_rwlock_tryrdlock((lck)->lock.rw) \ + : (((lck)->type == apr_anylock_writelock) \ + ? apr_thread_rwlock_trywrlock((lck)->lock.rw) \ + : APR_EINVAL))))) + +#else /* APR_HAS_THREADS */ + +#define APR_ANYLOCK_TRYLOCK(lck) \ + (((lck)->type == apr_anylock_none) \ + ? APR_SUCCESS \ + : (((lck)->type == apr_anylock_procmutex) \ + ? apr_proc_mutex_trylock((lck)->lock.pm) \ + : APR_EINVAL)) + +#endif /* APR_HAS_THREADS */ + +#if APR_HAS_THREADS + +/** Unlock an apr_anylock_t structure */ +#define APR_ANYLOCK_UNLOCK(lck) \ + (((lck)->type == apr_anylock_none) \ + ? APR_SUCCESS \ + : (((lck)->type == apr_anylock_threadmutex) \ + ? apr_thread_mutex_unlock((lck)->lock.tm) \ + : (((lck)->type == apr_anylock_procmutex) \ + ? apr_proc_mutex_unlock((lck)->lock.pm) \ + : ((((lck)->type == apr_anylock_readlock) || \ + ((lck)->type == apr_anylock_writelock)) \ + ? apr_thread_rwlock_unlock((lck)->lock.rw) \ + : APR_EINVAL)))) + +#else /* APR_HAS_THREADS */ + +#define APR_ANYLOCK_UNLOCK(lck) \ + (((lck)->type == apr_anylock_none) \ + ? APR_SUCCESS \ + : (((lck)->type == apr_anylock_procmutex) \ + ? apr_proc_mutex_unlock((lck)->lock.pm) \ + : APR_EINVAL)) + +#endif /* APR_HAS_THREADS */ + +#endif /* !APR_ANYLOCK_H */ diff --git a/include/apr_base64.h b/include/apr_base64.h new file mode 100644 index 00000000000..b4b2b88fe46 --- /dev/null +++ b/include/apr_base64.h @@ -0,0 +1,112 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * The apr_vsnprintf/apr_snprintf functions are based on, and used with the + * permission of, the SIO stdio-replacement strx_* functions by Panos + * Tsirigotis for xinetd. + */ + +/** + * @file apr_base64.h + * @brief APR-UTIL Base64 Encoding + */ +#ifndef APR_BASE64_H +#define APR_BASE64_H + +#include "apu.h" +#include "apr_general.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup APR_Util_Base64 Base64 Encoding + * @ingroup APR_Util + * @{ + */ + +/* Simple BASE64 encode/decode functions. + * + * As we might encode binary strings, hence we require the length of + * the incoming plain source. And return the length of what we decoded. + * + * The decoding function takes any non valid char (i.e. whitespace, \0 + * or anything non A-Z,0-9 etc as terminal. + * + * plain strings/binary sequences are not assumed '\0' terminated. Encoded + * strings are neither. But probably should. + * + */ + +/** + * Given the length of an un-encrypted string, get the length of the + * encrypted string. + * @param len the length of an unencrypted string. + * @return the length of the string after it is encrypted + */ +APU_DECLARE(int) apr_base64_encode_len(int len); + +/** + * Encode a text string using base64encoding. + * @param coded_dst The destination string for the encoded string. + * @param plain_src The original string in plain text + * @param len_plain_src The length of the plain text string + * @return the length of the encoded string + */ +APU_DECLARE(int) apr_base64_encode(char * coded_dst, const char *plain_src, + int len_plain_src); + +/** + * Encode an EBCDIC string using base64encoding. + * @param coded_dst The destination string for the encoded string. + * @param plain_src The original string in plain text + * @param len_plain_src The length of the plain text string + * @return the length of the encoded string + */ +APU_DECLARE(int) apr_base64_encode_binary(char * coded_dst, + const unsigned char *plain_src, + int len_plain_src); + +/** + * Determine the maximum buffer length required to decode the plain text + * string given the encoded string. + * @param coded_src The encoded string + * @return the maximum required buffer length for the plain text string + */ +APU_DECLARE(int) apr_base64_decode_len(const char * coded_src); + +/** + * Decode a string to plain text + * @param plain_dst The destination string for the plain text + * @param coded_src The encoded string + * @return the length of the plain text string + */ +APU_DECLARE(int) apr_base64_decode(char * plain_dst, const char *coded_src); + +/** + * Decode an EBCDIC string to plain text + * @param plain_dst The destination string for the plain text + * @param coded_src The encoded string + * @return the length of the plain text string + */ +APU_DECLARE(int) apr_base64_decode_binary(unsigned char * plain_dst, + const char *coded_src); + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* !APR_BASE64_H */ diff --git a/include/apr_buckets.h b/include/apr_buckets.h new file mode 100644 index 00000000000..fb87635ca36 --- /dev/null +++ b/include/apr_buckets.h @@ -0,0 +1,1569 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file apr_buckets.h + * @brief APR-UTIL Buckets/Bucket Brigades + */ + +#ifndef APR_BUCKETS_H +#define APR_BUCKETS_H + +#if defined(APR_BUCKET_DEBUG) && !defined(APR_RING_DEBUG) +#define APR_RING_DEBUG +#endif + +#include "apu.h" +#include "apr_network_io.h" +#include "apr_file_io.h" +#include "apr_general.h" +#include "apr_mmap.h" +#include "apr_errno.h" +#include "apr_ring.h" +#include "apr.h" +#if APR_HAVE_SYS_UIO_H +#include /* for struct iovec */ +#endif +#if APR_HAVE_STDARG_H +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup APR_Util_Bucket_Brigades Bucket Brigades + * @ingroup APR_Util + * @{ + */ + +/** default bucket buffer size - 8KB minus room for memory allocator headers */ +#define APR_BUCKET_BUFF_SIZE 8000 + +/** Determines how a bucket or brigade should be read */ +typedef enum { + APR_BLOCK_READ, /**< block until data becomes available */ + APR_NONBLOCK_READ /**< return immediately if no data is available */ +} apr_read_type_e; + +/** + * The one-sentence buzzword-laden overview: Bucket brigades represent + * a complex data stream that can be passed through a layered IO + * system without unnecessary copying. A longer overview follows... + * + * A bucket brigade is a doubly linked list (ring) of buckets, so we + * aren't limited to inserting at the front and removing at the end. + * Buckets are only passed around as members of a brigade, although + * singleton buckets can occur for short periods of time. + * + * Buckets are data stores of various types. They can refer to data in + * memory, or part of a file or mmap area, or the output of a process, + * etc. Buckets also have some type-dependent accessor functions: + * read, split, copy, setaside, and destroy. + * + * read returns the address and size of the data in the bucket. If the + * data isn't in memory then it is read in and the bucket changes type + * so that it can refer to the new location of the data. If all the + * data doesn't fit in the bucket then a new bucket is inserted into + * the brigade to hold the rest of it. + * + * split divides the data in a bucket into two regions. After a split + * the original bucket refers to the first part of the data and a new + * bucket inserted into the brigade after the original bucket refers + * to the second part of the data. Reference counts are maintained as + * necessary. + * + * setaside ensures that the data in the bucket has a long enough + * lifetime. Sometimes it is convenient to create a bucket referring + * to data on the stack in the expectation that it will be consumed + * (output to the network) before the stack is unwound. If that + * expectation turns out not to be valid, the setaside function is + * called to move the data somewhere safer. + * + * copy makes a duplicate of the bucket structure as long as it's + * possible to have multiple references to a single copy of the + * data itself. Not all bucket types can be copied. + * + * destroy maintains the reference counts on the resources used by a + * bucket and frees them if necessary. + * + * Note: all of the above functions have wrapper macros (apr_bucket_read(), + * apr_bucket_destroy(), etc), and those macros should be used rather + * than using the function pointers directly. + * + * To write a bucket brigade, they are first made into an iovec, so that we + * don't write too little data at one time. Currently we ignore compacting the + * buckets into as few buckets as possible, but if we really want good + * performance, then we need to compact the buckets before we convert to an + * iovec, or possibly while we are converting to an iovec. + */ + +/* + * Forward declaration of the main types. + */ + +/** @see apr_bucket_brigade */ +typedef struct apr_bucket_brigade apr_bucket_brigade; +/** @see apr_bucket */ +typedef struct apr_bucket apr_bucket; +/** @see apr_bucket_alloc_t */ +typedef struct apr_bucket_alloc_t apr_bucket_alloc_t; + +/** @see apr_bucket_type_t */ +typedef struct apr_bucket_type_t apr_bucket_type_t; + +/** + * Basic bucket type + */ +struct apr_bucket_type_t { + /** + * The name of the bucket type + */ + const char *name; + /** + * The number of functions this bucket understands. Can not be less than + * five. + */ + int num_func; + /** + * Whether the bucket contains metadata (ie, information that + * describes the regular contents of the brigade). The metadata + * is not returned by apr_bucket_read() and is not indicated by + * the ->length of the apr_bucket itself. In other words, an + * empty bucket is safe to arbitrarily remove if and only if it + * contains no metadata. In this sense, "data" is just raw bytes + * that are the "content" of the brigade and "metadata" describes + * that data but is not a proper part of it. + */ + enum { + /** This bucket type represents actual data to send to the client. */ + APR_BUCKET_DATA = 0, + /** This bucket type represents metadata. */ + APR_BUCKET_METADATA = 1 + } is_metadata; + /** + * Free the private data and any resources used by the bucket (if they + * aren't shared with another bucket). This function is required to be + * implemented for all bucket types, though it might be a no-op on some + * of them (namely ones that never allocate any private data structures). + * @param data The private data pointer from the bucket to be destroyed + */ + void (*destroy)(void *data); + + /** + * Read the data from the bucket. This is required to be implemented + * for all bucket types. + * @param b The bucket to read from + * @param str A place to store the data read. Allocation should only be + * done if absolutely necessary. + * @param len The amount of data read. + * @param block Should this read function block if there is more data that + * cannot be read immediately. + */ + apr_status_t (*read)(apr_bucket *b, const char **str, apr_size_t *len, + apr_read_type_e block); + + /** + * Make it possible to set aside the data for at least as long as the + * given pool. Buckets containing data that could potentially die before + * this pool (e.g. the data resides on the stack, in a child pool of + * the given pool, or in a disjoint pool) must somehow copy, shift, or + * transform the data to have the proper lifetime. + * @param e The bucket to convert + * @remark Some bucket types contain data that will always outlive the + * bucket itself. For example no data (EOS and FLUSH), or the data + * resides in global, constant memory (IMMORTAL), or the data is on + * the heap (HEAP). For these buckets, apr_bucket_setaside_noop can + * be used. + */ + apr_status_t (*setaside)(apr_bucket *e, apr_pool_t *pool); + + /** + * Split one bucket in two at the specified position by duplicating + * the bucket structure (not the data) and modifying any necessary + * start/end/offset information. If it's not possible to do this + * for the bucket type (perhaps the length of the data is indeterminate, + * as with pipe and socket buckets), then APR_ENOTIMPL is returned. + * @param e The bucket to split + * @param point The offset of the first byte in the new bucket + */ + apr_status_t (*split)(apr_bucket *e, apr_size_t point); + + /** + * Copy the bucket structure (not the data), assuming that this is + * possible for the bucket type. If it's not, APR_ENOTIMPL is returned. + * @param e The bucket to copy + * @param c Returns a pointer to the new bucket + */ + apr_status_t (*copy)(apr_bucket *e, apr_bucket **c); + +}; + +/** + * apr_bucket structures are allocated on the malloc() heap and + * their lifetime is controlled by the parent apr_bucket_brigade + * structure. Buckets can move from one brigade to another e.g. by + * calling APR_BRIGADE_CONCAT(). In general the data in a bucket has + * the same lifetime as the bucket and is freed when the bucket is + * destroyed; if the data is shared by more than one bucket (e.g. + * after a split) the data is freed when the last bucket goes away. + */ +struct apr_bucket { + /** Links to the rest of the brigade */ + APR_RING_ENTRY(apr_bucket) link; + /** The type of bucket. */ + const apr_bucket_type_t *type; + /** The length of the data in the bucket. This could have been implemented + * with a function, but this is an optimization, because the most + * common thing to do will be to get the length. If the length is unknown, + * the value of this field will be (apr_size_t)(-1). + */ + apr_size_t length; + /** The start of the data in the bucket relative to the private base + * pointer. The vast majority of bucket types allow a fixed block of + * data to be referenced by multiple buckets, each bucket pointing to + * a different segment of the data. That segment starts at base+start + * and ends at base+start+length. + * If the length == (apr_size_t)(-1), then start == -1. + */ + apr_off_t start; + /** type-dependent data hangs off this pointer */ + void *data; + /** + * Pointer to function used to free the bucket. This function should + * always be defined and it should be consistent with the memory + * function used to allocate the bucket. For example, if malloc() is + * used to allocate the bucket, this pointer should point to free(). + * @param e Pointer to the bucket being freed + */ + void (*free)(void *e); + /** The freelist from which this bucket was allocated */ + apr_bucket_alloc_t *list; +}; + +/** A list of buckets */ +struct apr_bucket_brigade { + /** The pool to associate the brigade with. The data is not allocated out + * of the pool, but a cleanup is registered with this pool. If the + * brigade is destroyed by some mechanism other than pool destruction, + * the destroying function is responsible for killing the cleanup. + */ + apr_pool_t *p; + /** The buckets in the brigade are on this list. */ + /* + * The apr_bucket_list structure doesn't actually need a name tag + * because it has no existence independent of struct apr_bucket_brigade; + * the ring macros are designed so that you can leave the name tag + * argument empty in this situation but apparently the Windows compiler + * doesn't like that. + */ + APR_RING_HEAD(apr_bucket_list, apr_bucket) list; + /** The freelist from which this bucket was allocated */ + apr_bucket_alloc_t *bucket_alloc; +}; + + +/** + * Function called when a brigade should be flushed + */ +typedef apr_status_t (*apr_brigade_flush)(apr_bucket_brigade *bb, void *ctx); + +/* + * define APR_BUCKET_DEBUG if you want your brigades to be checked for + * validity at every possible instant. this will slow your code down + * substantially but is a very useful debugging tool. + */ +#ifdef APR_BUCKET_DEBUG + +#define APR_BRIGADE_CHECK_CONSISTENCY(b) \ + APR_RING_CHECK_CONSISTENCY(&(b)->list, apr_bucket, link) + +#define APR_BUCKET_CHECK_CONSISTENCY(e) \ + APR_RING_CHECK_ELEM_CONSISTENCY((e), apr_bucket, link) + +#else +/** + * checks the ring pointers in a bucket brigade for consistency. an + * abort() will be triggered if any inconsistencies are found. + * note: this is a no-op unless APR_BUCKET_DEBUG is defined. + * @param b The brigade + */ +#define APR_BRIGADE_CHECK_CONSISTENCY(b) +/** + * checks the brigade a bucket is in for ring consistency. an + * abort() will be triggered if any inconsistencies are found. + * note: this is a no-op unless APR_BUCKET_DEBUG is defined. + * @param e The bucket + */ +#define APR_BUCKET_CHECK_CONSISTENCY(e) +#endif + + +/** + * Wrappers around the RING macros to reduce the verbosity of the code + * that handles bucket brigades. + */ +/** + * The magic pointer value that indicates the head of the brigade + * @remark This is used to find the beginning and end of the brigade, eg: + *
    + *      while (e != APR_BRIGADE_SENTINEL(b)) {
    + *          ...
    + *          e = APR_BUCKET_NEXT(e);
    + *      }
    + * 
    + * @param b The brigade + * @return The magic pointer value + */ +#define APR_BRIGADE_SENTINEL(b) APR_RING_SENTINEL(&(b)->list, apr_bucket, link) + +/** + * Determine if the bucket brigade is empty + * @param b The brigade to check + * @return true or false + */ +#define APR_BRIGADE_EMPTY(b) APR_RING_EMPTY(&(b)->list, apr_bucket, link) + +/** + * Return the first bucket in a brigade + * @param b The brigade to query + * @return The first bucket in the brigade + */ +#define APR_BRIGADE_FIRST(b) APR_RING_FIRST(&(b)->list) +/** + * Return the last bucket in a brigade + * @param b The brigade to query + * @return The last bucket in the brigade + */ +#define APR_BRIGADE_LAST(b) APR_RING_LAST(&(b)->list) + +/** + * Insert a list of buckets at the front of a brigade + * @param b The brigade to add to + * @param e The first bucket in a list of buckets to insert + */ +#define APR_BRIGADE_INSERT_HEAD(b, e) do { \ + apr_bucket *ap__b = (e); \ + APR_RING_INSERT_HEAD(&(b)->list, ap__b, apr_bucket, link); \ + APR_BRIGADE_CHECK_CONSISTENCY((b)); \ + } while (0) + +/** + * Insert a list of buckets at the end of a brigade + * @param b The brigade to add to + * @param e The first bucket in a list of buckets to insert + */ +#define APR_BRIGADE_INSERT_TAIL(b, e) do { \ + apr_bucket *ap__b = (e); \ + APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link); \ + APR_BRIGADE_CHECK_CONSISTENCY((b)); \ + } while (0) + +/** + * Concatenate brigade b onto the end of brigade a, leaving brigade b empty + * @param a The first brigade + * @param b The second brigade + */ +#define APR_BRIGADE_CONCAT(a, b) do { \ + APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link); \ + APR_BRIGADE_CHECK_CONSISTENCY((a)); \ + } while (0) + +/** + * Prepend brigade b onto the beginning of brigade a, leaving brigade b empty + * @param a The first brigade + * @param b The second brigade + */ +#define APR_BRIGADE_PREPEND(a, b) do { \ + APR_RING_PREPEND(&(a)->list, &(b)->list, apr_bucket, link); \ + APR_BRIGADE_CHECK_CONSISTENCY((a)); \ + } while (0) + +/** + * Insert a list of buckets before a specified bucket + * @param a The bucket to insert before + * @param b The buckets to insert + */ +#define APR_BUCKET_INSERT_BEFORE(a, b) do { \ + apr_bucket *ap__a = (a), *ap__b = (b); \ + APR_RING_INSERT_BEFORE(ap__a, ap__b, link); \ + APR_BUCKET_CHECK_CONSISTENCY(ap__a); \ + } while (0) + +/** + * Insert a list of buckets after a specified bucket + * @param a The bucket to insert after + * @param b The buckets to insert + */ +#define APR_BUCKET_INSERT_AFTER(a, b) do { \ + apr_bucket *ap__a = (a), *ap__b = (b); \ + APR_RING_INSERT_AFTER(ap__a, ap__b, link); \ + APR_BUCKET_CHECK_CONSISTENCY(ap__a); \ + } while (0) + +/** + * Get the next bucket in the list + * @param e The current bucket + * @return The next bucket + */ +#define APR_BUCKET_NEXT(e) APR_RING_NEXT((e), link) +/** + * Get the previous bucket in the list + * @param e The current bucket + * @return The previous bucket + */ +#define APR_BUCKET_PREV(e) APR_RING_PREV((e), link) + +/** + * Remove a bucket from its bucket brigade + * @param e The bucket to remove + */ +#define APR_BUCKET_REMOVE(e) APR_RING_REMOVE((e), link) + +/** + * Initialize a new bucket's prev/next pointers + * @param e The bucket to initialize + */ +#define APR_BUCKET_INIT(e) APR_RING_ELEM_INIT((e), link) + +/** + * Determine if a bucket contains metadata. An empty bucket is + * safe to arbitrarily remove if and only if this is false. + * @param e The bucket to inspect + * @return true or false + */ +#define APR_BUCKET_IS_METADATA(e) ((e)->type->is_metadata) + +/** + * Determine if a bucket is a FLUSH bucket + * @param e The bucket to inspect + * @return true or false + */ +#define APR_BUCKET_IS_FLUSH(e) ((e)->type == &apr_bucket_type_flush) +/** + * Determine if a bucket is an EOS bucket + * @param e The bucket to inspect + * @return true or false + */ +#define APR_BUCKET_IS_EOS(e) ((e)->type == &apr_bucket_type_eos) +/** + * Determine if a bucket is a FILE bucket + * @param e The bucket to inspect + * @return true or false + */ +#define APR_BUCKET_IS_FILE(e) ((e)->type == &apr_bucket_type_file) +/** + * Determine if a bucket is a PIPE bucket + * @param e The bucket to inspect + * @return true or false + */ +#define APR_BUCKET_IS_PIPE(e) ((e)->type == &apr_bucket_type_pipe) +/** + * Determine if a bucket is a SOCKET bucket + * @param e The bucket to inspect + * @return true or false + */ +#define APR_BUCKET_IS_SOCKET(e) ((e)->type == &apr_bucket_type_socket) +/** + * Determine if a bucket is a HEAP bucket + * @param e The bucket to inspect + * @return true or false + */ +#define APR_BUCKET_IS_HEAP(e) ((e)->type == &apr_bucket_type_heap) +/** + * Determine if a bucket is a TRANSIENT bucket + * @param e The bucket to inspect + * @return true or false + */ +#define APR_BUCKET_IS_TRANSIENT(e) ((e)->type == &apr_bucket_type_transient) +/** + * Determine if a bucket is a IMMORTAL bucket + * @param e The bucket to inspect + * @return true or false + */ +#define APR_BUCKET_IS_IMMORTAL(e) ((e)->type == &apr_bucket_type_immortal) +#if APR_HAS_MMAP +/** + * Determine if a bucket is a MMAP bucket + * @param e The bucket to inspect + * @return true or false + */ +#define APR_BUCKET_IS_MMAP(e) ((e)->type == &apr_bucket_type_mmap) +#endif +/** + * Determine if a bucket is a POOL bucket + * @param e The bucket to inspect + * @return true or false + */ +#define APR_BUCKET_IS_POOL(e) ((e)->type == &apr_bucket_type_pool) + +/* + * General-purpose reference counting for the various bucket types. + * + * Any bucket type that keeps track of the resources it uses (i.e. + * most of them except for IMMORTAL, TRANSIENT, and EOS) needs to + * attach a reference count to the resource so that it can be freed + * when the last bucket that uses it goes away. Resource-sharing may + * occur because of bucket splits or buckets that refer to globally + * cached data. */ + +/** @see apr_bucket_refcount */ +typedef struct apr_bucket_refcount apr_bucket_refcount; +/** + * The structure used to manage the shared resource must start with an + * apr_bucket_refcount which is updated by the general-purpose refcount + * code. A pointer to the bucket-type-dependent private data structure + * can be cast to a pointer to an apr_bucket_refcount and vice versa. + */ +struct apr_bucket_refcount { + /** The number of references to this bucket */ + int refcount; +}; + +/* ***** Reference-counted bucket types ***** */ + +/** @see apr_bucket_heap */ +typedef struct apr_bucket_heap apr_bucket_heap; +/** + * A bucket referring to data allocated off the heap. + */ +struct apr_bucket_heap { + /** Number of buckets using this memory */ + apr_bucket_refcount refcount; + /** The start of the data actually allocated. This should never be + * modified, it is only used to free the bucket. + */ + char *base; + /** how much memory was allocated */ + apr_size_t alloc_len; + /** function to use to delete the data */ + void (*free_func)(void *data); +}; + +/** @see apr_bucket_pool */ +typedef struct apr_bucket_pool apr_bucket_pool; +/** + * A bucket referring to data allocated from a pool + */ +struct apr_bucket_pool { + /** The pool bucket must be able to be easily morphed to a heap + * bucket if the pool gets cleaned up before all references are + * destroyed. This apr_bucket_heap structure is populated automatically + * when the pool gets cleaned up, and subsequent calls to pool_read() + * will result in the apr_bucket in question being morphed into a + * regular heap bucket. (To avoid having to do many extra refcount + * manipulations and b->data manipulations, the apr_bucket_pool + * struct actually *contains* the apr_bucket_heap struct that it + * will become as its first element; the two share their + * apr_bucket_refcount members.) + */ + apr_bucket_heap heap; + /** The block of data actually allocated from the pool. + * Segments of this block are referenced by adjusting + * the start and length of the apr_bucket accordingly. + * This will be NULL after the pool gets cleaned up. + */ + const char *base; + /** The pool the data was allocated from. When the pool + * is cleaned up, this gets set to NULL as an indicator + * to pool_read() that the data is now on the heap and + * so it should morph the bucket into a regular heap + * bucket before continuing. + */ + apr_pool_t *pool; + /** The freelist this structure was allocated from, which is + * needed in the cleanup phase in order to allocate space on the heap + */ + apr_bucket_alloc_t *list; +}; + +#if APR_HAS_MMAP +/** @see apr_bucket_mmap */ +typedef struct apr_bucket_mmap apr_bucket_mmap; +/** + * A bucket referring to an mmap()ed file + */ +struct apr_bucket_mmap { + /** Number of buckets using this memory */ + apr_bucket_refcount refcount; + /** The mmap this sub_bucket refers to */ + apr_mmap_t *mmap; +}; +#endif + +/** @see apr_bucket_file */ +typedef struct apr_bucket_file apr_bucket_file; +/** + * A bucket referring to an file + */ +struct apr_bucket_file { + /** Number of buckets using this memory */ + apr_bucket_refcount refcount; + /** The file this bucket refers to */ + apr_file_t *fd; + /** The pool into which any needed structures should + * be created while reading from this file bucket */ + apr_pool_t *readpool; +#if APR_HAS_MMAP + /** Whether this bucket should be memory-mapped if + * a caller tries to read from it */ + int can_mmap; +#endif /* APR_HAS_MMAP */ +}; + +/** @see apr_bucket_structs */ +typedef union apr_bucket_structs apr_bucket_structs; +/** + * A union of all bucket structures so we know what + * the max size is. + */ +union apr_bucket_structs { + apr_bucket b; /**< Bucket */ + apr_bucket_heap heap; /**< Heap */ + apr_bucket_pool pool; /**< Pool */ +#if APR_HAS_MMAP + apr_bucket_mmap mmap; /**< MMap */ +#endif + apr_bucket_file file; /**< File */ +}; + +/** + * The amount that apr_bucket_alloc() should allocate in the common case. + * Note: this is twice as big as apr_bucket_structs to allow breathing + * room for third-party bucket types. + */ +#define APR_BUCKET_ALLOC_SIZE APR_ALIGN_DEFAULT(2*sizeof(apr_bucket_structs)) + +/* ***** Bucket Brigade Functions ***** */ +/** + * Create a new bucket brigade. The bucket brigade is originally empty. + * @param p The pool to associate with the brigade. Data is not allocated out + * of the pool, but a cleanup is registered. + * @param list The bucket allocator to use + * @return The empty bucket brigade + */ +APU_DECLARE(apr_bucket_brigade *) apr_brigade_create(apr_pool_t *p, + apr_bucket_alloc_t *list); + +/** + * destroy an entire bucket brigade. This includes destroying all of the + * buckets within the bucket brigade's bucket list. + * @param b The bucket brigade to destroy + */ +APU_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b); + +/** + * empty out an entire bucket brigade. This includes destroying all of the + * buckets within the bucket brigade's bucket list. This is similar to + * apr_brigade_destroy(), except that it does not deregister the brigade's + * pool cleanup function. + * @param data The bucket brigade to clean up + * @remark Generally, you should use apr_brigade_destroy(). This function + * can be useful in situations where you have a single brigade that + * you wish to reuse many times by destroying all of the buckets in + * the brigade and putting new buckets into it later. + */ +APU_DECLARE(apr_status_t) apr_brigade_cleanup(void *data); + +/** + * Move the buckets from the tail end of the existing brigade @param b into + * the brigade @param a. If @param a is NULL a new brigade is created. Buckets + * from @param e to the last bucket (inclusively) of brigade @param b are moved + * from @param b to the returned brigade @param a. + * @param b The brigade to split + * @param e The first bucket to move + * @param a The brigade which should be used for the result or NULL if + * a new brigade should be created. + * @return The brigade supplied in @param a or a new one if @param a was NULL. + * @warning Note that this function allocates a new brigade if @param a is + * NULL so memory consumption should be carefully considered. + */ +APU_DECLARE(apr_bucket_brigade *) apr_brigade_split_ex(apr_bucket_brigade *b, + apr_bucket *e, + apr_bucket_brigade *a); + +/** + * Create a new bucket brigade and move the buckets from the tail end + * of an existing brigade into the new brigade. Buckets from + * @param e to the last bucket (inclusively) of brigade @param b + * are moved from @param b to the returned brigade. + * @param b The brigade to split + * @param e The first bucket to move + * @return The new brigade + * @warning Note that this function always allocates a new brigade + * so memory consumption should be carefully considered. + */ +APU_DECLARE(apr_bucket_brigade *) apr_brigade_split(apr_bucket_brigade *b, + apr_bucket *e); + +/** + * Partition a bucket brigade at a given offset (in bytes from the start of + * the brigade). This is useful whenever a filter wants to use known ranges + * of bytes from the brigade; the ranges can even overlap. + * @param b The brigade to partition + * @param point The offset at which to partition the brigade + * @param after_point Returns a pointer to the first bucket after the partition + * @return APR_SUCCESS on success, APR_INCOMPLETE if the contents of the + * brigade were shorter than @a point, or an error code. + * @remark if APR_INCOMPLETE is returned, @a after_point will be set to + * the brigade sentinel. + */ +APU_DECLARE(apr_status_t) apr_brigade_partition(apr_bucket_brigade *b, + apr_off_t point, + apr_bucket **after_point); + +/** + * Return the total length of the brigade. + * @param bb The brigade to compute the length of + * @param read_all Read unknown-length buckets to force a size + * @param length Returns the length of the brigade (up to the end, or up + * to a bucket read error), or -1 if the brigade has buckets + * of indeterminate length and read_all is 0. + */ +APU_DECLARE(apr_status_t) apr_brigade_length(apr_bucket_brigade *bb, + int read_all, + apr_off_t *length); + +/** + * Take a bucket brigade and store the data in a flat char* + * @param bb The bucket brigade to create the char* from + * @param c The char* to write into + * @param len The maximum length of the char array. On return, it is the + * actual length of the char array. + */ +APU_DECLARE(apr_status_t) apr_brigade_flatten(apr_bucket_brigade *bb, + char *c, + apr_size_t *len); + +/** + * Creates a pool-allocated string representing a flat bucket brigade + * @param bb The bucket brigade to create the char array from + * @param c On return, the allocated char array + * @param len On return, the length of the char array. + * @param pool The pool to allocate the string from. + */ +APU_DECLARE(apr_status_t) apr_brigade_pflatten(apr_bucket_brigade *bb, + char **c, + apr_size_t *len, + apr_pool_t *pool); + +/** + * Split a brigade to represent one LF line. + * @param bbOut The bucket brigade that will have the LF line appended to. + * @param bbIn The input bucket brigade to search for a LF-line. + * @param block The blocking mode to be used to split the line. + * @param maxbytes The maximum bytes to read. If this many bytes are seen + * without a LF, the brigade will contain a partial line. + */ +APU_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut, + apr_bucket_brigade *bbIn, + apr_read_type_e block, + apr_off_t maxbytes); + +/** + * create an iovec of the elements in a bucket_brigade... return number + * of elements used. This is useful for writing to a file or to the + * network efficiently. + * @param b The bucket brigade to create the iovec from + * @param vec The iovec to create + * @param nvec The number of elements in the iovec. On return, it is the + * number of iovec elements actually filled out. + */ +APU_DECLARE(apr_status_t) apr_brigade_to_iovec(apr_bucket_brigade *b, + struct iovec *vec, int *nvec); + +/** + * This function writes a list of strings into a bucket brigade. + * @param b The bucket brigade to add to + * @param flush The flush function to use if the brigade is full + * @param ctx The structure to pass to the flush function + * @param va A list of strings to add + * @return APR_SUCCESS or error code. + */ +APU_DECLARE(apr_status_t) apr_brigade_vputstrs(apr_bucket_brigade *b, + apr_brigade_flush flush, + void *ctx, + va_list va); + +/** + * This function writes a string into a bucket brigade. + * + * The apr_brigade_write function attempts to be efficient with the + * handling of heap buckets. Regardless of the amount of data stored + * inside a heap bucket, heap buckets are a fixed size to promote their + * reuse. + * + * If an attempt is made to write a string to a brigade that already + * ends with a heap bucket, this function will attempt to pack the + * string into the remaining space in the previous heap bucket, before + * allocating a new heap bucket. + * + * This function always returns APR_SUCCESS, unless a flush function is + * passed, in which case the return value of the flush function will be + * returned if used. + * @param b The bucket brigade to add to + * @param flush The flush function to use if the brigade is full + * @param ctx The structure to pass to the flush function + * @param str The string to add + * @param nbyte The number of bytes to write + * @return APR_SUCCESS or error code + */ +APU_DECLARE(apr_status_t) apr_brigade_write(apr_bucket_brigade *b, + apr_brigade_flush flush, void *ctx, + const char *str, apr_size_t nbyte); + +/** + * This function writes multiple strings into a bucket brigade. + * @param b The bucket brigade to add to + * @param flush The flush function to use if the brigade is full + * @param ctx The structure to pass to the flush function + * @param vec The strings to add (address plus length for each) + * @param nvec The number of entries in iovec + * @return APR_SUCCESS or error code + */ +APU_DECLARE(apr_status_t) apr_brigade_writev(apr_bucket_brigade *b, + apr_brigade_flush flush, + void *ctx, + const struct iovec *vec, + apr_size_t nvec); + +/** + * This function writes a string into a bucket brigade. + * @param bb The bucket brigade to add to + * @param flush The flush function to use if the brigade is full + * @param ctx The structure to pass to the flush function + * @param str The string to add + * @return APR_SUCCESS or error code + */ +APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb, + apr_brigade_flush flush, void *ctx, + const char *str); + +/** + * This function writes a character into a bucket brigade. + * @param b The bucket brigade to add to + * @param flush The flush function to use if the brigade is full + * @param ctx The structure to pass to the flush function + * @param c The character to add + * @return APR_SUCCESS or error code + */ +APU_DECLARE(apr_status_t) apr_brigade_putc(apr_bucket_brigade *b, + apr_brigade_flush flush, void *ctx, + const char c); + +/** + * This function writes an unspecified number of strings into a bucket brigade. + * @param b The bucket brigade to add to + * @param flush The flush function to use if the brigade is full + * @param ctx The structure to pass to the flush function + * @param ... The strings to add + * @return APR_SUCCESS or error code + */ +APU_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b, + apr_brigade_flush flush, + void *ctx, ...); + +/** + * Evaluate a printf and put the resulting string at the end + * of the bucket brigade. + * @param b The brigade to write to + * @param flush The flush function to use if the brigade is full + * @param ctx The structure to pass to the flush function + * @param fmt The format of the string to write + * @param ... The arguments to fill out the format + * @return APR_SUCCESS or error code + */ +APU_DECLARE_NONSTD(apr_status_t) apr_brigade_printf(apr_bucket_brigade *b, + apr_brigade_flush flush, + void *ctx, + const char *fmt, ...) + __attribute__((format(printf,4,5))); + +/** + * Evaluate a printf and put the resulting string at the end + * of the bucket brigade. + * @param b The brigade to write to + * @param flush The flush function to use if the brigade is full + * @param ctx The structure to pass to the flush function + * @param fmt The format of the string to write + * @param va The arguments to fill out the format + * @return APR_SUCCESS or error code + */ +APU_DECLARE(apr_status_t) apr_brigade_vprintf(apr_bucket_brigade *b, + apr_brigade_flush flush, + void *ctx, + const char *fmt, va_list va); + +/** + * Utility function to insert a file (or a segment of a file) onto the + * end of the brigade. The file is split into multiple buckets if it + * is larger than the maximum size which can be represented by a + * single bucket. + * @param bb the brigade to insert into + * @param f the file to insert + * @param start the offset of the start of the segment + * @param len the length of the segment of the file to insert + * @param p pool from which file buckets are allocated + * @return the last bucket inserted + */ +APU_DECLARE(apr_bucket *) apr_brigade_insert_file(apr_bucket_brigade *bb, + apr_file_t *f, + apr_off_t start, + apr_off_t len, + apr_pool_t *p); + + + +/* ***** Bucket freelist functions ***** */ +/** + * Create a bucket allocator. + * @param p This pool's underlying apr_allocator_t is used to allocate memory + * for the bucket allocator. When the pool is destroyed, the bucket + * allocator's cleanup routine will free all memory that has been + * allocated from it. + * @remark The reason the allocator gets its memory from the pool's + * apr_allocator_t rather than from the pool itself is because + * the bucket allocator will free large memory blocks back to the + * allocator when it's done with them, thereby preventing memory + * footprint growth that would occur if we allocated from the pool. + * @warning The allocator must never be used by more than one thread at a time. + */ +APU_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create(apr_pool_t *p); + +/** + * Create a bucket allocator. + * @param allocator This apr_allocator_t is used to allocate both the bucket + * allocator and all memory handed out by the bucket allocator. The + * caller is responsible for destroying the bucket allocator and the + * apr_allocator_t -- no automatic cleanups will happen. + * @warning The allocator must never be used by more than one thread at a time. + */ +APU_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create_ex(apr_allocator_t *allocator); + +/** + * Destroy a bucket allocator. + * @param list The allocator to be destroyed + */ +APU_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list); + +/** + * Allocate memory for use by the buckets. + * @param size The amount to allocate. + * @param list The allocator from which to allocate the memory. + */ +APU_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size, apr_bucket_alloc_t *list); + +/** + * Free memory previously allocated with apr_bucket_alloc(). + * @param block The block of memory to be freed. + */ +APU_DECLARE_NONSTD(void) apr_bucket_free(void *block); + + +/* ***** Bucket Functions ***** */ +/** + * Free the resources used by a bucket. If multiple buckets refer to + * the same resource it is freed when the last one goes away. + * @see apr_bucket_delete() + * @param e The bucket to destroy + */ +#define apr_bucket_destroy(e) do { \ + (e)->type->destroy((e)->data); \ + (e)->free(e); \ + } while (0) + +/** + * Delete a bucket by removing it from its brigade (if any) and then + * destroying it. + * @remark This mainly acts as an aid in avoiding code verbosity. It is + * the preferred exact equivalent to: + *
    + *      APR_BUCKET_REMOVE(e);
    + *      apr_bucket_destroy(e);
    + * 
    + * @param e The bucket to delete + */ +#define apr_bucket_delete(e) do { \ + APR_BUCKET_REMOVE(e); \ + apr_bucket_destroy(e); \ + } while (0) + +/** + * Read some data from the bucket. + * + * The apr_bucket_read function returns a convenient amount of data + * from the bucket provided, writing the address and length of the + * data to the pointers provided by the caller. The function tries + * as hard as possible to avoid a memory copy. + * + * Buckets are expected to be a member of a brigade at the time they + * are read. + * + * In typical application code, buckets are read in a loop, and after + * each bucket is read and processed, it is moved or deleted from the + * brigade and the next bucket read. + * + * The definition of "convenient" depends on the type of bucket that + * is being read, and is decided by APR. In the case of memory based + * buckets such as heap and immortal buckets, a pointer will be + * returned to the location of the buffer containing the complete + * contents of the bucket. + * + * Some buckets, such as the socket bucket, might have no concept + * of length. If an attempt is made to read such a bucket, the + * apr_bucket_read function will read a convenient amount of data + * from the socket. The socket bucket is magically morphed into a + * heap bucket containing the just-read data, and a new socket bucket + * is inserted just after this heap bucket. + * + * To understand why apr_bucket_read might do this, consider the loop + * described above to read and process buckets. The current bucket + * is magically morphed into a heap bucket and returned to the caller. + * The caller processes the data, and deletes the heap bucket, moving + * onto the next bucket, the new socket bucket. This process repeats, + * giving the illusion of a bucket brigade that contains potentially + * infinite amounts of data. It is up to the caller to decide at what + * point to stop reading buckets. + * + * Some buckets, such as the file bucket, might have a fixed size, + * but be significantly larger than is practical to store in RAM in + * one go. As with the socket bucket, if an attempt is made to read + * from a file bucket, the file bucket is magically morphed into a + * heap bucket containing a convenient amount of data read from the + * current offset in the file. During the read, the offset will be + * moved forward on the file, and a new file bucket will be inserted + * directly after the current bucket representing the remainder of the + * file. If the heap bucket was large enough to store the whole + * remainder of the file, no more file buckets are inserted, and the + * file bucket will disappear completely. + * + * The pattern for reading buckets described above does create the + * illusion that the code is willing to swallow buckets that might be + * too large for the system to handle in one go. This however is just + * an illusion: APR will always ensure that large (file) or infinite + * (socket) buckets are broken into convenient bite sized heap buckets + * before data is returned to the caller. + * + * There is a potential gotcha to watch for: if buckets are read in a + * loop, and aren't deleted after being processed, the potentially large + * bucket will slowly be converted into RAM resident heap buckets. If + * the file is larger than available RAM, an out of memory condition + * could be caused if the application is not careful to manage this. + * + * @param e The bucket to read from + * @param str The location to store a pointer to the data in + * @param len The location to store the amount of data read + * @param block Whether the read function blocks + */ +#define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block) + +/** + * Setaside data so that stack data is not destroyed on returning from + * the function + * @param e The bucket to setaside + * @param p The pool to setaside into + */ +#define apr_bucket_setaside(e,p) (e)->type->setaside(e,p) + +/** + * Split one bucket in two at the point provided. + * + * Once split, the original bucket becomes the first of the two new buckets. + * + * (It is assumed that the bucket is a member of a brigade when this + * function is called). + * @param e The bucket to split + * @param point The offset to split the bucket at + */ +#define apr_bucket_split(e,point) (e)->type->split(e, point) + +/** + * Copy a bucket. + * @param e The bucket to copy + * @param c Returns a pointer to the new bucket + */ +#define apr_bucket_copy(e,c) (e)->type->copy(e, c) + +/* Bucket type handling */ + +/** + * This function simply returns APR_SUCCESS to denote that the bucket does + * not require anything to happen for its setaside() function. This is + * appropriate for buckets that have "immortal" data -- the data will live + * at least as long as the bucket. + * @param data The bucket to setaside + * @param pool The pool defining the desired lifetime of the bucket data + * @return APR_SUCCESS + */ +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_setaside_noop(apr_bucket *data, + apr_pool_t *pool); + +/** + * A place holder function that signifies that the setaside function was not + * implemented for this bucket + * @param data The bucket to setaside + * @param pool The pool defining the desired lifetime of the bucket data + * @return APR_ENOTIMPL + */ +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_setaside_notimpl(apr_bucket *data, + apr_pool_t *pool); + +/** + * A place holder function that signifies that the split function was not + * implemented for this bucket + * @param data The bucket to split + * @param point The location to split the bucket + * @return APR_ENOTIMPL + */ +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_split_notimpl(apr_bucket *data, + apr_size_t point); + +/** + * A place holder function that signifies that the copy function was not + * implemented for this bucket + * @param e The bucket to copy + * @param c Returns a pointer to the new bucket + * @return APR_ENOTIMPL + */ +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_copy_notimpl(apr_bucket *e, + apr_bucket **c); + +/** + * A place holder function that signifies that this bucket does not need + * to do anything special to be destroyed. That's only the case for buckets + * that either have no data (metadata buckets) or buckets whose data pointer + * points to something that's not a bucket-type-specific structure, as with + * simple buckets where data points to a string and pipe buckets where data + * points directly to the apr_file_t. + * @param data The bucket data to destroy + */ +APU_DECLARE_NONSTD(void) apr_bucket_destroy_noop(void *data); + +/** + * There is no apr_bucket_destroy_notimpl, because destruction is required + * to be implemented (it could be a noop, but only if that makes sense for + * the bucket type) + */ + +/* There is no apr_bucket_read_notimpl, because it is a required function + */ + + +/* All of the bucket types implemented by the core */ +/** + * The flush bucket type. This signifies that all data should be flushed to + * the next filter. The flush bucket should be sent with the other buckets. + */ +APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_flush; +/** + * The EOS bucket type. This signifies that there will be no more data, ever. + * All filters MUST send all data to the next filter when they receive a + * bucket of this type + */ +APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_eos; +/** + * The FILE bucket type. This bucket represents a file on disk + */ +APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_file; +/** + * The HEAP bucket type. This bucket represents a data allocated from the + * heap. + */ +APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_heap; +#if APR_HAS_MMAP +/** + * The MMAP bucket type. This bucket represents an MMAP'ed file + */ +APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_mmap; +#endif +/** + * The POOL bucket type. This bucket represents a data that was allocated + * from a pool. IF this bucket is still available when the pool is cleared, + * the data is copied on to the heap. + */ +APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_pool; +/** + * The PIPE bucket type. This bucket represents a pipe to another program. + */ +APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_pipe; +/** + * The IMMORTAL bucket type. This bucket represents a segment of data that + * the creator is willing to take responsibility for. The core will do + * nothing with the data in an immortal bucket + */ +APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_immortal; +/** + * The TRANSIENT bucket type. This bucket represents a data allocated off + * the stack. When the setaside function is called, this data is copied on + * to the heap + */ +APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_transient; +/** + * The SOCKET bucket type. This bucket represents a socket to another machine + */ +APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_socket; + + +/* ***** Simple buckets ***** */ + +/** + * Split a simple bucket into two at the given point. Most non-reference + * counting buckets that allow multiple references to the same block of + * data (eg transient and immortal) will use this as their split function + * without any additional type-specific handling. + * @param b The bucket to be split + * @param point The offset of the first byte in the new bucket + * @return APR_EINVAL if the point is not within the bucket; + * APR_ENOMEM if allocation failed; + * or APR_SUCCESS + */ +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_simple_split(apr_bucket *b, + apr_size_t point); + +/** + * Copy a simple bucket. Most non-reference-counting buckets that allow + * multiple references to the same block of data (eg transient and immortal) + * will use this as their copy function without any additional type-specific + * handling. + * @param a The bucket to copy + * @param b Returns a pointer to the new bucket + * @return APR_ENOMEM if allocation failed; + * or APR_SUCCESS + */ +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_simple_copy(apr_bucket *a, + apr_bucket **b); + + +/* ***** Shared, reference-counted buckets ***** */ + +/** + * Initialize a bucket containing reference-counted data that may be + * shared. The caller must allocate the bucket if necessary and + * initialize its type-dependent fields, and allocate and initialize + * its own private data structure. This function should only be called + * by type-specific bucket creation functions. + * @param b The bucket to initialize + * @param data A pointer to the private data structure + * with the reference count at the start + * @param start The start of the data in the bucket + * relative to the private base pointer + * @param length The length of the data in the bucket + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_shared_make(apr_bucket *b, void *data, + apr_off_t start, + apr_size_t length); + +/** + * Decrement the refcount of the data in the bucket. This function + * should only be called by type-specific bucket destruction functions. + * @param data The private data pointer from the bucket to be destroyed + * @return TRUE or FALSE; TRUE if the reference count is now + * zero, indicating that the shared resource itself can + * be destroyed by the caller. + */ +APU_DECLARE(int) apr_bucket_shared_destroy(void *data); + +/** + * Split a bucket into two at the given point, and adjust the refcount + * to the underlying data. Most reference-counting bucket types will + * be able to use this function as their split function without any + * additional type-specific handling. + * @param b The bucket to be split + * @param point The offset of the first byte in the new bucket + * @return APR_EINVAL if the point is not within the bucket; + * APR_ENOMEM if allocation failed; + * or APR_SUCCESS + */ +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_shared_split(apr_bucket *b, + apr_size_t point); + +/** + * Copy a refcounted bucket, incrementing the reference count. Most + * reference-counting bucket types will be able to use this function + * as their copy function without any additional type-specific handling. + * @param a The bucket to copy + * @param b Returns a pointer to the new bucket + * @return APR_ENOMEM if allocation failed; + or APR_SUCCESS + */ +APU_DECLARE_NONSTD(apr_status_t) apr_bucket_shared_copy(apr_bucket *a, + apr_bucket **b); + + +/* ***** Functions to Create Buckets of varying types ***** */ +/* + * Each bucket type foo has two initialization functions: + * apr_bucket_foo_make which sets up some already-allocated memory as a + * bucket of type foo; and apr_bucket_foo_create which allocates memory + * for the bucket, calls apr_bucket_make_foo, and initializes the + * bucket's list pointers. The apr_bucket_foo_make functions are used + * inside the bucket code to change the type of buckets in place; + * other code should call apr_bucket_foo_create. All the initialization + * functions change nothing if they fail. + */ + +/** + * Create an End of Stream bucket. This indicates that there is no more data + * coming from down the filter stack. All filters should flush at this point. + * @param list The freelist from which this bucket should be allocated + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_eos_create(apr_bucket_alloc_t *list); + +/** + * Make the bucket passed in an EOS bucket. This indicates that there is no + * more data coming from down the filter stack. All filters should flush at + * this point. + * @param b The bucket to make into an EOS bucket + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_eos_make(apr_bucket *b); + +/** + * Create a flush bucket. This indicates that filters should flush their + * data. There is no guarantee that they will flush it, but this is the + * best we can do. + * @param list The freelist from which this bucket should be allocated + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_bucket_alloc_t *list); + +/** + * Make the bucket passed in a FLUSH bucket. This indicates that filters + * should flush their data. There is no guarantee that they will flush it, + * but this is the best we can do. + * @param b The bucket to make into a FLUSH bucket + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_flush_make(apr_bucket *b); + +/** + * Create a bucket referring to long-lived data. + * @param buf The data to insert into the bucket + * @param nbyte The size of the data to insert. + * @param list The freelist from which this bucket should be allocated + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_immortal_create(const char *buf, + apr_size_t nbyte, + apr_bucket_alloc_t *list); + +/** + * Make the bucket passed in a bucket refer to long-lived data + * @param b The bucket to make into a IMMORTAL bucket + * @param buf The data to insert into the bucket + * @param nbyte The size of the data to insert. + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_immortal_make(apr_bucket *b, + const char *buf, + apr_size_t nbyte); + +/** + * Create a bucket referring to data on the stack. + * @param buf The data to insert into the bucket + * @param nbyte The size of the data to insert. + * @param list The freelist from which this bucket should be allocated + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_transient_create(const char *buf, + apr_size_t nbyte, + apr_bucket_alloc_t *list); + +/** + * Make the bucket passed in a bucket refer to stack data + * @param b The bucket to make into a TRANSIENT bucket + * @param buf The data to insert into the bucket + * @param nbyte The size of the data to insert. + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_transient_make(apr_bucket *b, + const char *buf, + apr_size_t nbyte); + +/** + * Create a bucket referring to memory on the heap. If the caller asks + * for the data to be copied, this function always allocates 4K of + * memory so that more data can be added to the bucket without + * requiring another allocation. Therefore not all the data may be put + * into the bucket. If copying is not requested then the bucket takes + * over responsibility for free()ing the memory. + * @param buf The buffer to insert into the bucket + * @param nbyte The size of the buffer to insert. + * @param free_func Function to use to free the data; NULL indicates that the + * bucket should make a copy of the data + * @param list The freelist from which this bucket should be allocated + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_heap_create(const char *buf, + apr_size_t nbyte, + void (*free_func)(void *data), + apr_bucket_alloc_t *list); +/** + * Make the bucket passed in a bucket refer to heap data + * @param b The bucket to make into a HEAP bucket + * @param buf The buffer to insert into the bucket + * @param nbyte The size of the buffer to insert. + * @param free_func Function to use to free the data; NULL indicates that the + * bucket should make a copy of the data + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_heap_make(apr_bucket *b, const char *buf, + apr_size_t nbyte, + void (*free_func)(void *data)); + +/** + * Create a bucket referring to memory allocated from a pool. + * + * @param buf The buffer to insert into the bucket + * @param length The number of bytes referred to by this bucket + * @param pool The pool the memory was allocated from + * @param list The freelist from which this bucket should be allocated + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_pool_create(const char *buf, + apr_size_t length, + apr_pool_t *pool, + apr_bucket_alloc_t *list); + +/** + * Make the bucket passed in a bucket refer to pool data + * @param b The bucket to make into a pool bucket + * @param buf The buffer to insert into the bucket + * @param length The number of bytes referred to by this bucket + * @param pool The pool the memory was allocated from + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_pool_make(apr_bucket *b, const char *buf, + apr_size_t length, + apr_pool_t *pool); + +#if APR_HAS_MMAP +/** + * Create a bucket referring to mmap()ed memory. + * @param mm The mmap to insert into the bucket + * @param start The offset of the first byte in the mmap + * that this bucket refers to + * @param length The number of bytes referred to by this bucket + * @param list The freelist from which this bucket should be allocated + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_mmap_create(apr_mmap_t *mm, + apr_off_t start, + apr_size_t length, + apr_bucket_alloc_t *list); + +/** + * Make the bucket passed in a bucket refer to an MMAP'ed file + * @param b The bucket to make into a MMAP bucket + * @param mm The mmap to insert into the bucket + * @param start The offset of the first byte in the mmap + * that this bucket refers to + * @param length The number of bytes referred to by this bucket + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_mmap_make(apr_bucket *b, apr_mmap_t *mm, + apr_off_t start, + apr_size_t length); +#endif + +/** + * Create a bucket referring to a socket. + * @param thissock The socket to put in the bucket + * @param list The freelist from which this bucket should be allocated + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *thissock, + apr_bucket_alloc_t *list); +/** + * Make the bucket passed in a bucket refer to a socket + * @param b The bucket to make into a SOCKET bucket + * @param thissock The socket to put in the bucket + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_socket_make(apr_bucket *b, + apr_socket_t *thissock); + +/** + * Create a bucket referring to a pipe. + * @param thispipe The pipe to put in the bucket + * @param list The freelist from which this bucket should be allocated + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *thispipe, + apr_bucket_alloc_t *list); + +/** + * Make the bucket passed in a bucket refer to a pipe + * @param b The bucket to make into a PIPE bucket + * @param thispipe The pipe to put in the bucket + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_pipe_make(apr_bucket *b, + apr_file_t *thispipe); + +/** + * Create a bucket referring to a file. + * @param fd The file to put in the bucket + * @param offset The offset where the data of interest begins in the file + * @param len The amount of data in the file we are interested in + * @param p The pool into which any needed structures should be created + * while reading from this file bucket + * @param list The freelist from which this bucket should be allocated + * @return The new bucket, or NULL if allocation failed + * @remark If the file is truncated such that the segment of the file + * referenced by the bucket no longer exists, an attempt to read + * from the bucket will fail with APR_EOF. + * @remark apr_brigade_insert_file() should generally be used to + * insert files into brigades, since that function can correctly + * handle large file issues. + */ +APU_DECLARE(apr_bucket *) apr_bucket_file_create(apr_file_t *fd, + apr_off_t offset, + apr_size_t len, + apr_pool_t *p, + apr_bucket_alloc_t *list); + +/** + * Make the bucket passed in a bucket refer to a file + * @param b The bucket to make into a FILE bucket + * @param fd The file to put in the bucket + * @param offset The offset where the data of interest begins in the file + * @param len The amount of data in the file we are interested in + * @param p The pool into which any needed structures should be created + * while reading from this file bucket + * @return The new bucket, or NULL if allocation failed + */ +APU_DECLARE(apr_bucket *) apr_bucket_file_make(apr_bucket *b, apr_file_t *fd, + apr_off_t offset, + apr_size_t len, apr_pool_t *p); + +/** + * Enable or disable memory-mapping for a FILE bucket (default is enabled) + * @param b The bucket + * @param enabled Whether memory-mapping should be enabled + * @return APR_SUCCESS normally, or an error code if the operation fails + */ +APU_DECLARE(apr_status_t) apr_bucket_file_enable_mmap(apr_bucket *b, + int enabled); + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* !APR_BUCKETS_H */ diff --git a/include/apr_crypto.h b/include/apr_crypto.h new file mode 100644 index 00000000000..2577248c169 --- /dev/null +++ b/include/apr_crypto.h @@ -0,0 +1,462 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_CRYPTO_H +#define APR_CRYPTO_H + +#include "apu.h" +#include "apr_pools.h" +#include "apr_tables.h" +#include "apu_errno.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file apr_crypto.h + * @brief APR-UTIL Crypto library + */ +/** + * @defgroup APR_Util_Crypto Crypto routines + * @ingroup APR_Util + * @{ + */ + +/** CA certificate type unknown */ +#define APR_CRYPTO_CA_TYPE_UNKNOWN 0 +/** binary DER encoded CA certificate */ +#define APR_CRYPTO_CA_TYPE_DER 1 +/** PEM encoded CA certificate */ +#define APR_CRYPTO_CA_TYPE_BASE64 2 +/** Netscape/Mozilla cert7.db CA certificate database */ +#define APR_CRYPTO_CA_TYPE_CERT7_DB 3 +/** Netscape/Mozilla secmod file */ +#define APR_CRYPTO_CA_TYPE_SECMOD 4 +/** Client certificate type unknown */ +#define APR_CRYPTO_CERT_TYPE_UNKNOWN 5 +/** binary DER encoded client certificate */ +#define APR_CRYPTO_CERT_TYPE_DER 6 +/** PEM encoded client certificate */ +#define APR_CRYPTO_CERT_TYPE_BASE64 7 +/** Netscape/Mozilla key3.db client certificate database */ +#define APR_CRYPTO_CERT_TYPE_KEY3_DB 8 +/** Netscape/Mozilla client certificate nickname */ +#define APR_CRYPTO_CERT_TYPE_NICKNAME 9 +/** Private key type unknown */ +#define APR_CRYPTO_KEY_TYPE_UNKNOWN 10 +/** binary DER encoded private key */ +#define APR_CRYPTO_KEY_TYPE_DER 11 +/** PEM encoded private key */ +#define APR_CRYPTO_KEY_TYPE_BASE64 12 +/** PKCS#12 encoded client certificate */ +#define APR_CRYPTO_CERT_TYPE_PFX 13 +/** PKCS#12 encoded private key */ +#define APR_CRYPTO_KEY_TYPE_PFX 14 +/** Openldap directory full of base64-encoded cert + * authorities with hashes in corresponding .0 directory + */ +#define APR_CRYPTO_CA_TYPE_CACERTDIR_BASE64 15 +/** CMS Key Database with private key and cert chain */ +#define APR_CRYPTO_CA_TYPE_CMS 16 +/** Symmetrical key */ +#define APR_CRYPTO_KEY_TYPE_SYM 17 +/** Netscape/Mozilla certificate database directory */ +#define APR_CRYPTO_CA_TYPE_DIR 18 +/** Crypto engine */ +#define APR_CRYPTO_ENGINE 101 + +#if APU_HAVE_CRYPTO + +#ifndef APU_CRYPTO_RECOMMENDED_DRIVER +#if APU_HAVE_OPENSSL +#define APU_CRYPTO_RECOMMENDED_DRIVER "openssl" +#else +#if APU_HAVE_NSS +#define APU_CRYPTO_RECOMMENDED_DRIVER "nss" +#else +#if APU_HAVE_MSCNG +#define APU_CRYPTO_RECOMMENDED_DRIVER "mscng" +#else +#if APU_HAVE_MSCAPI +#define APU_CRYPTO_RECOMMENDED_DRIVER "mscapi" +#else +#endif +#endif +#endif +#endif +#endif + +/** + * Symmetric Key types understood by the library. + * + * NOTE: It is expected that this list will grow over time. + * + * Interoperability Matrix: + * + * The matrix is based on the testcrypto.c unit test, which attempts to + * test whether a simple encrypt/decrypt will succeed, as well as testing + * whether an encrypted string by one library can be decrypted by the + * others. + * + * Some libraries will successfully encrypt and decrypt their own data, + * but won't decrypt data from another library. It is hoped that over + * time these anomalies will be found and fixed, but until then it is + * recommended that ciphers are chosen that interoperate across platform. + * + * An X below means the test passes, it does not necessarily mean that + * encryption performed is correct or secure. Applications should stick + * to ciphers that pass the interoperablity tests on the right hand side + * of the table. + * + * Aligned data is data whose length is a multiple of the block size for + * the chosen cipher. Padded data is data that is not aligned by block + * size and must be padded by the crypto library. + * + * OpenSSL NSS Interop + * Align Pad Align Pad Align Pad + * 3DES_192/CBC X X X X X X + * 3DES_192/ECB X X + * AES_256/CBC X X X X X X + * AES_256/ECB X X X X + * AES_192/CBC X X X X + * AES_192/ECB X X X + * AES_128/CBC X X X X + * AES_128/ECB X X X + * + * Conclusion: for padded data, use 3DES_192/CBC or AES_256/CBC. For + * aligned data, use 3DES_192/CBC, AES_256/CBC or AES_256/ECB. + */ + +typedef enum { + KEY_NONE, KEY_3DES_192, /** 192 bit (3-Key) 3DES */ + KEY_AES_128, /** 128 bit AES */ + KEY_AES_192, /** 192 bit AES */ + KEY_AES_256 +/** 256 bit AES */ +} apr_crypto_block_key_type_e; + +typedef enum { + MODE_NONE, /** An error condition */ + MODE_ECB, /** Electronic Code Book */ + MODE_CBC +/** Cipher Block Chaining */ +} apr_crypto_block_key_mode_e; + +/** + * Certificate and private key structure. + * + * The various crypto backends expect certificates and keys in a wide + * array of formats. This structure is analogous to apr_ldap_opt_tls_cert_t + * from the LDAP interface. Ultimately that interface should be meshed with + * this one. + * @param type Type of certificate APR_CRYPTO_*_TYPE_* + * @param path Path, file or nickname of the certificate + * @param password Optional password, can be NULL + */ +typedef struct apr_crypto_param_t { + int type; + const char *path; + const char *password; +} apr_crypto_param_t; + +/* These are opaque structs. Instantiation is up to each backend */ +typedef struct apr_crypto_driver_t apr_crypto_driver_t; +typedef struct apr_crypto_config_t apr_crypto_config_t; +typedef struct apr_crypto_key_t apr_crypto_key_t; +typedef struct apr_crypto_block_t apr_crypto_block_t; + +/** + * Public factory API, common to all backends. + */ +typedef struct apr_crypto_t { + apr_pool_t *pool; + apu_err_t *result; + apr_array_header_t *keys; + apr_crypto_config_t *config; +} apr_crypto_t; + +/** + * @brief Perform once-only initialisation. Call once only. + * + * @param pool - pool to register any shutdown cleanups, etc + * @return APR_NOTIMPL in case of no crypto support. + */ +APU_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool, + const apr_array_header_t *params); + +/** + * @brief Get the driver struct for a name + * + * @param pool - (process) pool to register cleanup + * @param name - driver name + * @param driver - pointer to driver struct. + * @return APR_SUCCESS for success + * @return APR_ENOTIMPL for no driver (when DSO not enabled) + * @return APR_EDSOOPEN if DSO driver file can't be opened + * @return APR_ESYMNOTFOUND if the driver file doesn't contain a driver + */ +APU_DECLARE(apr_status_t) apr_crypto_get_driver(apr_pool_t *pool, const char *name, + const apr_crypto_driver_t **driver, const apr_array_header_t *params, + const apu_err_t **result); + +/** + * @brief Return the name of the driver. + * + * @param driver - The driver in use. + * @return The name of the driver. + */ +APU_DECLARE(const char *)apr_crypto_driver_name (const apr_crypto_driver_t *driver); + +/** + * @brief Get the result of the last operation on a factory. If the result + * is NULL, the operation was successful. + * @param driver - driver to use + * @param factory - factory pointer will be written here + * @param result - the result structure + * @return APR_SUCCESS for success + */ +APU_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_t *f, + const apu_err_t **result); + +/** + * @brief Create a context for supporting encryption. Keys, certificates, + * algorithms and other parameters will be set per context. More than + * one context can be created at one time. A cleanup will be automatically + * registered with the given pool to guarantee a graceful shutdown. + * @param driver - driver to use + * @param pool - process pool + * @param params - array of key parameters + * @param factory - factory pointer will be written here + * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE + * if the engine cannot be initialised. + */ +APU_DECLARE(apr_status_t) apr_crypto_factory(const apr_crypto_driver_t *driver, + apr_pool_t *pool, const apr_array_header_t *params, apr_crypto_t **f); + +/** + * @brief Create a key from the given passphrase. By default, the PBKDF2 + * algorithm is used to generate the key from the passphrase. It is expected + * that the same pass phrase will generate the same key, regardless of the + * backend crypto platform used. The key is cleaned up when the context + * is cleaned, and may be reused with multiple encryption or decryption + * operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param driver - driver to use + * @param p The pool to use. + * @param f The context to use. + * @param pass The passphrase to use. + * @param passLen The passphrase length in bytes + * @param salt The salt to use. + * @param saltLen The salt length in bytes + * @param type 3DES_192, AES_128, AES_192, AES_256. + * @param mode Electronic Code Book / Cipher Block Chaining. + * @param doPad Pad if necessary. + * @param key The key returned, see note. + * @param ivSize The size of the initialisation vector will be returned, based + * on whether an IV is relevant for this type of crypto. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ +APU_DECLARE(apr_status_t) apr_crypto_passphrase(const apr_crypto_driver_t *driver, + apr_pool_t *p, const apr_crypto_t *f, const char *pass, + apr_size_t passLen, const unsigned char * salt, apr_size_t saltLen, + const apr_crypto_block_key_type_e type, + const apr_crypto_block_key_mode_e mode, const int doPad, + const int iterations, apr_crypto_key_t **key, apr_size_t *ivSize); + +/** + * @brief Initialise a context for encrypting arbitrary data using the given key. + * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If + * *ctx is not NULL, *ctx must point at a previously created structure. + * @param driver - driver to use + * @param p The pool to use. + * @param f The block factory to use. + * @param key The key structure to use. + * @param iv Optional initialisation vector. If the buffer pointed to is NULL, + * an IV will be created at random, in space allocated from the pool. + * If the buffer pointed to is not NULL, the IV in the buffer will be + * used. + * @param ctx The block context returned, see note. + * @param blockSize The block size of the cipher. + * @return Returns APR_ENOIV if an initialisation vector is required but not specified. + * Returns APR_EINIT if the backend failed to initialise the context. Returns + * APR_ENOTIMPL if not implemented. + */ +APU_DECLARE(apr_status_t) apr_crypto_block_encrypt_init( + const apr_crypto_driver_t *driver, apr_pool_t *p, + const apr_crypto_t *f, const apr_crypto_key_t *key, + const unsigned char **iv, apr_crypto_block_t **ctx, + apr_size_t *blockSize); + +/** + * @brief Encrypt data provided by in, write it to out. + * @note The number of bytes written will be written to outlen. If + * out is NULL, outlen will contain the maximum size of the + * buffer needed to hold the data, including any data + * generated by apr_crypto_block_encrypt_finish below. If *out points + * to NULL, a buffer sufficiently large will be created from + * the pool provided. If *out points to a not-NULL value, this + * value will be used as a buffer instead. + * @param driver - driver to use + * @param ctx The block context to use. + * @param out Address of a buffer to which data will be written, + * see note. + * @param outlen Length of the output will be written here. + * @param in Address of the buffer to read. + * @param inlen Length of the buffer to read. + * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if + * not implemented. + */ +APU_DECLARE(apr_status_t) apr_crypto_block_encrypt( + const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx, + unsigned char **out, apr_size_t *outlen, const unsigned char *in, + apr_size_t inlen); + +/** + * @brief Encrypt final data block, write it to out. + * @note If necessary the final block will be written out after being + * padded. Typically the final block will be written to the + * same buffer used by apr_crypto_block_encrypt, offset by the + * number of bytes returned as actually written by the + * apr_crypto_block_encrypt() call. After this call, the context + * is cleaned and can be reused by apr_crypto_block_encrypt_init(). + * @param driver - driver to use + * @param ctx The block context to use. + * @param out Address of a buffer to which data will be written. This + * buffer must already exist, and is usually the same + * buffer used by apr_evp_crypt(). See note. + * @param outlen Length of the output will be written here. + * @return APR_ECRYPT if an error occurred. + * @return APR_EPADDING if padding was enabled and the block was incorrectly + * formatted. + * @return APR_ENOTIMPL if not implemented. + */ +APU_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish( + const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx, + unsigned char *out, apr_size_t *outlen); + +/** + * @brief Initialise a context for decrypting arbitrary data using the given key. + * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If + * *ctx is not NULL, *ctx must point at a previously created structure. + * @param driver - driver to use + * @param p The pool to use. + * @param f The block factory to use. + * @param key The key structure to use. + * @param iv Optional initialisation vector. + * @param ctx The block context returned, see note. + * @param blockSize The block size of the cipher. + * @return Returns APR_ENOIV if an initialisation vector is required but not specified. + * Returns APR_EINIT if the backend failed to initialise the context. Returns + * APR_ENOTIMPL if not implemented. + */ +APU_DECLARE(apr_status_t) apr_crypto_block_decrypt_init( + const apr_crypto_driver_t *driver, apr_pool_t *p, + const apr_crypto_t *f, const apr_crypto_key_t *key, + const unsigned char *iv, apr_crypto_block_t **ctx, + apr_size_t *blockSize); + +/** + * @brief Decrypt data provided by in, write it to out. + * @note The number of bytes written will be written to outlen. If + * out is NULL, outlen will contain the maximum size of the + * buffer needed to hold the data, including any data + * generated by apr_crypto_block_decrypt_finish below. If *out points + * to NULL, a buffer sufficiently large will be created from + * the pool provided. If *out points to a not-NULL value, this + * value will be used as a buffer instead. + * @param driver - driver to use + * @param ctx The block context to use. + * @param out Address of a buffer to which data will be written, + * see note. + * @param outlen Length of the output will be written here. + * @param in Address of the buffer to read. + * @param inlen Length of the buffer to read. + * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if + * not implemented. + */ +APU_DECLARE(apr_status_t) apr_crypto_block_decrypt( + const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx, + unsigned char **out, apr_size_t *outlen, const unsigned char *in, + apr_size_t inlen); + +/** + * @brief Decrypt final data block, write it to out. + * @note If necessary the final block will be written out after being + * padded. Typically the final block will be written to the + * same buffer used by apr_crypto_block_decrypt, offset by the + * number of bytes returned as actually written by the + * apr_crypto_block_decrypt() call. After this call, the context + * is cleaned and can be reused by apr_crypto_block_decrypt_init(). + * @param driver - driver to use + * @param ctx The block context to use. + * @param out Address of a buffer to which data will be written. This + * buffer must already exist, and is usually the same + * buffer used by apr_evp_crypt(). See note. + * @param outlen Length of the output will be written here. + * @return APR_ECRYPT if an error occurred. + * @return APR_EPADDING if padding was enabled and the block was incorrectly + * formatted. + * @return APR_ENOTIMPL if not implemented. + */ +APU_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish( + const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx, + unsigned char *out, apr_size_t *outlen); + +/** + * @brief Clean encryption / decryption context. + * @note After cleanup, a context is free to be reused if necessary. + * @param driver - driver to use + * @param ctx The block context to use. + * @return Returns APR_ENOTIMPL if not supported. + */ +APU_DECLARE(apr_status_t) apr_crypto_block_cleanup( + const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx); + +/** + * @brief Clean encryption / decryption factory. + * @note After cleanup, a factory is free to be reused if necessary. + * @param driver - driver to use + * @param f The factory to use. + * @return Returns APR_ENOTIMPL if not supported. + */ +APU_DECLARE(apr_status_t) apr_crypto_cleanup(const apr_crypto_driver_t *driver, + apr_crypto_t *f); + +/** + * @brief Shutdown the crypto library. + * @note After shutdown, it is expected that the init function can be called again. + * @param driver - driver to use + * @param p The pool to use. + * @return Returns APR_ENOTIMPL if not supported. + */ +APU_DECLARE(apr_status_t) apr_crypto_shutdown(const apr_crypto_driver_t *driver, + apr_pool_t *p); + +#endif /* APU_HAVE_CRYPTO */ + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/apr_date.h b/include/apr_date.h new file mode 100644 index 00000000000..b098b542958 --- /dev/null +++ b/include/apr_date.h @@ -0,0 +1,106 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_DATE_H +#define APR_DATE_H + +/** + * @file apr_date.h + * @brief APR-UTIL date routines + */ + +/** + * @defgroup APR_Util_Date Date routines + * @ingroup APR_Util + * @{ + */ + +/* + * apr_date.h: prototypes for date parsing utility routines + */ + +#include "apu.h" +#include "apr_time.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** A bad date. */ +#define APR_DATE_BAD ((apr_time_t)0) + +/** + * Compare a string to a mask + * @param data The string to compare + * @param mask Mask characters (arbitrary maximum is 256 characters): + *
    + *   '\@' - uppercase letter
    + *   '\$' - lowercase letter
    + *   '\&' - hex digit
    + *   '#' - digit
    + *   '~' - digit or space
    + *   '*' - swallow remaining characters
    + * 
    + * @remark The mask tests for an exact match for any other character + * @return 1 if the string matches, 0 otherwise + */ +APU_DECLARE(int) apr_date_checkmask(const char *data, const char *mask); + +/** + * Parses an HTTP date in one of three standard forms: + *
    + *     Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
    + *     Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
    + *     Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
    + * 
    + * @param date The date in one of the three formats above + * @return the apr_time_t number of microseconds since 1 Jan 1970 GMT, or + * 0 if this would be out of range or if the date is invalid. + */ +APU_DECLARE(apr_time_t) apr_date_parse_http(const char *date); + +/** + * Parses a string resembling an RFC 822 date. This is meant to be + * leinent in its parsing of dates. Hence, this will parse a wider + * range of dates than apr_date_parse_http. + * + * The prominent mailer (or poster, if mailer is unknown) that has + * been seen in the wild is included for the unknown formats. + *
    + *     Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
    + *     Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
    + *     Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
    + *     Sun, 6 Nov 1994 08:49:37 GMT   ; RFC 822, updated by RFC 1123
    + *     Sun, 06 Nov 94 08:49:37 GMT    ; RFC 822
    + *     Sun, 6 Nov 94 08:49:37 GMT     ; RFC 822
    + *     Sun, 06 Nov 94 08:49 GMT       ; Unknown [drtr\@ast.cam.ac.uk] 
    + *     Sun, 6 Nov 94 08:49 GMT        ; Unknown [drtr\@ast.cam.ac.uk]
    + *     Sun, 06 Nov 94 8:49:37 GMT     ; Unknown [Elm 70.85]
    + *     Sun, 6 Nov 94 8:49:37 GMT      ; Unknown [Elm 70.85] 
    + * 
    + * + * @param date The date in one of the formats above + * @return the apr_time_t number of microseconds since 1 Jan 1970 GMT, or + * 0 if this would be out of range or if the date is invalid. + */ +APU_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date); + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* !APR_DATE_H */ diff --git a/include/apr_dbd.h b/include/apr_dbd.h new file mode 100644 index 00000000000..f30977daf4c --- /dev/null +++ b/include/apr_dbd.h @@ -0,0 +1,552 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* Overview of what this is and does: + * http://www.apache.org/~niq/dbd.html + */ + +#ifndef APR_DBD_H +#define APR_DBD_H + +#include "apu.h" +#include "apr_pools.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file apr_dbd.h + * @brief APR-UTIL DBD library + */ +/** + * @defgroup APR_Util_DBD DBD routines + * @ingroup APR_Util + * @{ + */ + +/** + * Mapping of C to SQL types, used for prepared statements. + * @remarks + * For apr_dbd_p[v]query/select functions, in and out parameters are always + * const char * (i.e. regular nul terminated strings). LOB types are passed + * with four (4) arguments: payload, length, table and column, all as const + * char *, where table and column are reserved for future use by Oracle. + * @remarks + * For apr_dbd_p[v]bquery/select functions, in and out parameters are + * described next to each enumeration constant and are generally native binary + * types or some APR data type. LOB types are passed with four (4) arguments: + * payload (char*), length (apr_size_t*), table (char*) and column (char*). + * Table and column are reserved for future use by Oracle. + */ +typedef enum { + APR_DBD_TYPE_NONE, + APR_DBD_TYPE_TINY, /**< \%hhd : in, out: char* */ + APR_DBD_TYPE_UTINY, /**< \%hhu : in, out: unsigned char* */ + APR_DBD_TYPE_SHORT, /**< \%hd : in, out: short* */ + APR_DBD_TYPE_USHORT, /**< \%hu : in, out: unsigned short* */ + APR_DBD_TYPE_INT, /**< \%d : in, out: int* */ + APR_DBD_TYPE_UINT, /**< \%u : in, out: unsigned int* */ + APR_DBD_TYPE_LONG, /**< \%ld : in, out: long* */ + APR_DBD_TYPE_ULONG, /**< \%lu : in, out: unsigned long* */ + APR_DBD_TYPE_LONGLONG, /**< \%lld : in, out: apr_int64_t* */ + APR_DBD_TYPE_ULONGLONG, /**< \%llu : in, out: apr_uint64_t* */ + APR_DBD_TYPE_FLOAT, /**< \%f : in, out: float* */ + APR_DBD_TYPE_DOUBLE, /**< \%lf : in, out: double* */ + APR_DBD_TYPE_STRING, /**< \%s : in: char*, out: char** */ + APR_DBD_TYPE_TEXT, /**< \%pDt : in: char*, out: char** */ + APR_DBD_TYPE_TIME, /**< \%pDi : in: char*, out: char** */ + APR_DBD_TYPE_DATE, /**< \%pDd : in: char*, out: char** */ + APR_DBD_TYPE_DATETIME, /**< \%pDa : in: char*, out: char** */ + APR_DBD_TYPE_TIMESTAMP, /**< \%pDs : in: char*, out: char** */ + APR_DBD_TYPE_ZTIMESTAMP, /**< \%pDz : in: char*, out: char** */ + APR_DBD_TYPE_BLOB, /**< \%pDb : in: char* apr_size_t* char* char*, out: apr_bucket_brigade* */ + APR_DBD_TYPE_CLOB, /**< \%pDc : in: char* apr_size_t* char* char*, out: apr_bucket_brigade* */ + APR_DBD_TYPE_NULL /**< \%pDn : in: void*, out: void** */ +} apr_dbd_type_e; + +/* These are opaque structs. Instantiation is up to each backend */ +typedef struct apr_dbd_driver_t apr_dbd_driver_t; +typedef struct apr_dbd_t apr_dbd_t; +typedef struct apr_dbd_transaction_t apr_dbd_transaction_t; +typedef struct apr_dbd_results_t apr_dbd_results_t; +typedef struct apr_dbd_row_t apr_dbd_row_t; +typedef struct apr_dbd_prepared_t apr_dbd_prepared_t; + +/** apr_dbd_init: perform once-only initialisation. Call once only. + * + * @param pool - pool to register any shutdown cleanups, etc + */ +APU_DECLARE(apr_status_t) apr_dbd_init(apr_pool_t *pool); + +/** apr_dbd_get_driver: get the driver struct for a name + * + * @param pool - (process) pool to register cleanup + * @param name - driver name + * @param driver - pointer to driver struct. + * @return APR_SUCCESS for success + * @return APR_ENOTIMPL for no driver (when DSO not enabled) + * @return APR_EDSOOPEN if DSO driver file can't be opened + * @return APR_ESYMNOTFOUND if the driver file doesn't contain a driver + */ +APU_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name, + const apr_dbd_driver_t **driver); + +/** apr_dbd_open_ex: open a connection to a backend + * + * @param pool - working pool + * @param params - arguments to driver (implementation-dependent) + * @param handle - pointer to handle to return + * @param driver - driver struct. + * @param error - descriptive error. + * @return APR_SUCCESS for success + * @return APR_EGENERAL if driver exists but connection failed + * @remarks PostgreSQL: the params is passed directly to the PQconnectdb() + * function (check PostgreSQL documentation for more details on the syntax). + * @remarks SQLite2: the params is split on a colon, with the first part used + * as the filename and second part converted to an integer and used as file + * mode. + * @remarks SQLite3: the params is passed directly to the sqlite3_open() + * function as a filename to be opened (check SQLite3 documentation for more + * details). + * @remarks Oracle: the params can have "user", "pass", "dbname" and "server" + * keys, each followed by an equal sign and a value. Such key/value pairs can + * be delimited by space, CR, LF, tab, semicolon, vertical bar or comma. + * @remarks MySQL: the params can have "host", "port", "user", "pass", + * "dbname", "sock", "flags" "fldsz", "group" and "reconnect" keys, each + * followed by an equal sign and a value. Such key/value pairs can be + * delimited by space, CR, LF, tab, semicolon, vertical bar or comma. For + * now, "flags" can only recognise CLIENT_FOUND_ROWS (check MySQL manual for + * details). The value associated with "fldsz" determines maximum amount of + * memory (in bytes) for each of the fields in the result set of prepared + * statements. By default, this value is 1 MB. The value associated with + * "group" determines which group from configuration file to use (see + * MYSQL_READ_DEFAULT_GROUP option of mysql_options() in MySQL manual). + * Reconnect is set to 1 by default (i.e. true). + * @remarks FreeTDS: the params can have "username", "password", "appname", + * "dbname", "host", "charset", "lang" and "server" keys, each followed by an + * equal sign and a value. + */ +APU_DECLARE(apr_status_t) apr_dbd_open_ex(const apr_dbd_driver_t *driver, + apr_pool_t *pool, const char *params, + apr_dbd_t **handle, + const char **error); + +/** apr_dbd_open: open a connection to a backend + * + * @param pool - working pool + * @param params - arguments to driver (implementation-dependent) + * @param handle - pointer to handle to return + * @param driver - driver struct. + * @return APR_SUCCESS for success + * @return APR_EGENERAL if driver exists but connection failed + * @see apr_dbd_open_ex + */ +APU_DECLARE(apr_status_t) apr_dbd_open(const apr_dbd_driver_t *driver, + apr_pool_t *pool, const char *params, + apr_dbd_t **handle); + +/** apr_dbd_close: close a connection to a backend + * + * @param handle - handle to close + * @param driver - driver struct. + * @return APR_SUCCESS for success or error status + */ +APU_DECLARE(apr_status_t) apr_dbd_close(const apr_dbd_driver_t *driver, + apr_dbd_t *handle); + +/* apr-function-shaped versions of things */ + +/** apr_dbd_name: get the name of the driver + * + * @param driver - the driver + * @return - name + */ +APU_DECLARE(const char*) apr_dbd_name(const apr_dbd_driver_t *driver); + +/** apr_dbd_native_handle: get native database handle of the underlying db + * + * @param driver - the driver + * @param handle - apr_dbd handle + * @return - native handle + */ +APU_DECLARE(void*) apr_dbd_native_handle(const apr_dbd_driver_t *driver, + apr_dbd_t *handle); + +/** check_conn: check status of a database connection + * + * @param driver - the driver + * @param pool - working pool + * @param handle - the connection to check + * @return APR_SUCCESS or error + */ +APU_DECLARE(int) apr_dbd_check_conn(const apr_dbd_driver_t *driver, apr_pool_t *pool, + apr_dbd_t *handle); + +/** apr_dbd_set_dbname: select database name. May be a no-op if not supported. + * + * @param driver - the driver + * @param pool - working pool + * @param handle - the connection + * @param name - the database to select + * @return 0 for success or error code + */ +APU_DECLARE(int) apr_dbd_set_dbname(const apr_dbd_driver_t *driver, apr_pool_t *pool, + apr_dbd_t *handle, const char *name); + +/** apr_dbd_transaction_start: start a transaction. May be a no-op. + * + * @param driver - the driver + * @param pool - a pool to use for error messages (if any). + * @param handle - the db connection + * @param trans - ptr to a transaction. May be null on entry + * @return 0 for success or error code + * @remarks Note that transaction modes, set by calling + * apr_dbd_transaction_mode_set(), will affect all query/select calls within + * a transaction. By default, any error in query/select during a transaction + * will cause the transaction to inherit the error code and any further + * query/select calls will fail immediately. Put transaction in "ignore + * errors" mode to avoid that. Use "rollback" mode to do explicit rollback. + */ +APU_DECLARE(int) apr_dbd_transaction_start(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_t *handle, + apr_dbd_transaction_t **trans); + +/** apr_dbd_transaction_end: end a transaction + * (commit on success, rollback on error). + * May be a no-op. + * + * @param driver - the driver + * @param handle - the db connection + * @param trans - the transaction. + * @return 0 for success or error code + */ +APU_DECLARE(int) apr_dbd_transaction_end(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_transaction_t *trans); + +#define APR_DBD_TRANSACTION_COMMIT 0x00 /**< commit the transaction */ +#define APR_DBD_TRANSACTION_ROLLBACK 0x01 /**< rollback the transaction */ +#define APR_DBD_TRANSACTION_IGNORE_ERRORS 0x02 /**< ignore transaction errors */ + +/** apr_dbd_transaction_mode_get: get the mode of transaction + * + * @param driver - the driver + * @param trans - the transaction + * @return mode of transaction + */ +APU_DECLARE(int) apr_dbd_transaction_mode_get(const apr_dbd_driver_t *driver, + apr_dbd_transaction_t *trans); + +/** apr_dbd_transaction_mode_set: set the mode of transaction + * + * @param driver - the driver + * @param trans - the transaction + * @param mode - new mode of the transaction + * @return the mode of transaction in force after the call + */ +APU_DECLARE(int) apr_dbd_transaction_mode_set(const apr_dbd_driver_t *driver, + apr_dbd_transaction_t *trans, + int mode); + +/** apr_dbd_query: execute an SQL query that doesn't return a result set + * + * @param driver - the driver + * @param handle - the connection + * @param nrows - number of rows affected. + * @param statement - the SQL statement to execute + * @return 0 for success or error code + */ +APU_DECLARE(int) apr_dbd_query(const apr_dbd_driver_t *driver, apr_dbd_t *handle, + int *nrows, const char *statement); + +/** apr_dbd_select: execute an SQL query that returns a result set + * + * @param driver - the driver + * @param pool - pool to allocate the result set + * @param handle - the connection + * @param res - pointer to result set pointer. May point to NULL on entry + * @param statement - the SQL statement to execute + * @param random - 1 to support random access to results (seek any row); + * 0 to support only looping through results in order + * (async access - faster) + * @return 0 for success or error code + */ +APU_DECLARE(int) apr_dbd_select(const apr_dbd_driver_t *driver, apr_pool_t *pool, + apr_dbd_t *handle, apr_dbd_results_t **res, + const char *statement, int random); + +/** apr_dbd_num_cols: get the number of columns in a results set + * + * @param driver - the driver + * @param res - result set. + * @return number of columns + */ +APU_DECLARE(int) apr_dbd_num_cols(const apr_dbd_driver_t *driver, + apr_dbd_results_t *res); + +/** apr_dbd_num_tuples: get the number of rows in a results set + * of a synchronous select + * + * @param driver - the driver + * @param res - result set. + * @return number of rows, or -1 if the results are asynchronous + */ +APU_DECLARE(int) apr_dbd_num_tuples(const apr_dbd_driver_t *driver, + apr_dbd_results_t *res); + +/** apr_dbd_get_row: get a row from a result set + * + * @param driver - the driver + * @param pool - pool to allocate the row + * @param res - result set pointer + * @param row - pointer to row pointer. May point to NULL on entry + * @param rownum - row number (counting from 1), or -1 for "next row". + * Ignored if random access is not supported. + * @return 0 for success, -1 for rownum out of range or data finished + */ +APU_DECLARE(int) apr_dbd_get_row(const apr_dbd_driver_t *driver, apr_pool_t *pool, + apr_dbd_results_t *res, apr_dbd_row_t **row, + int rownum); + +/** apr_dbd_get_entry: get an entry from a row + * + * @param driver - the driver + * @param row - row pointer + * @param col - entry number + * @return value from the row, or NULL if col is out of bounds. + */ +APU_DECLARE(const char*) apr_dbd_get_entry(const apr_dbd_driver_t *driver, + apr_dbd_row_t *row, int col); + +/** apr_dbd_get_name: get an entry name from a result set + * + * @param driver - the driver + * @param res - result set pointer + * @param col - entry number + * @return name of the entry, or NULL if col is out of bounds. + */ +APU_DECLARE(const char*) apr_dbd_get_name(const apr_dbd_driver_t *driver, + apr_dbd_results_t *res, int col); + + +/** apr_dbd_error: get current error message (if any) + * + * @param driver - the driver + * @param handle - the connection + * @param errnum - error code from operation that returned an error + * @return the database current error message, or message for errnum + * (implementation-dependent whether errnum is ignored) + */ +APU_DECLARE(const char*) apr_dbd_error(const apr_dbd_driver_t *driver, + apr_dbd_t *handle, int errnum); + +/** apr_dbd_escape: escape a string so it is safe for use in query/select + * + * @param driver - the driver + * @param pool - pool to alloc the result from + * @param string - the string to escape + * @param handle - the connection + * @return the escaped, safe string + */ +APU_DECLARE(const char*) apr_dbd_escape(const apr_dbd_driver_t *driver, + apr_pool_t *pool, const char *string, + apr_dbd_t *handle); + +/** apr_dbd_prepare: prepare a statement + * + * @param driver - the driver + * @param pool - pool to alloc the result from + * @param handle - the connection + * @param query - the SQL query + * @param label - A label for the prepared statement. + * use NULL for temporary prepared statements + * (eg within a Request in httpd) + * @param statement - statement to prepare. May point to null on entry. + * @return 0 for success or error code + * @remarks To specify parameters of the prepared query, use \%s, \%d etc. + * (see below for full list) in place of database specific parameter syntax + * (e.g. for PostgreSQL, this would be $1, $2, for SQLite3 this would be ? + * etc.). For instance: "SELECT name FROM customers WHERE name=%s" would be + * a query that this function understands. + * @remarks Here is the full list of format specifiers that this function + * understands and what they map to in SQL: \%hhd (TINY INT), \%hhu (UNSIGNED + * TINY INT), \%hd (SHORT), \%hu (UNSIGNED SHORT), \%d (INT), \%u (UNSIGNED + * INT), \%ld (LONG), \%lu (UNSIGNED LONG), \%lld (LONG LONG), \%llu + * (UNSIGNED LONG LONG), \%f (FLOAT, REAL), \%lf (DOUBLE PRECISION), \%s + * (VARCHAR), \%pDt (TEXT), \%pDi (TIME), \%pDd (DATE), \%pDa (DATETIME), + * \%pDs (TIMESTAMP), \%pDz (TIMESTAMP WITH TIME ZONE), \%pDb (BLOB), \%pDc + * (CLOB) and \%pDn (NULL). Not all databases have support for all these + * types, so the underlying driver will attempt the "best match" where + * possible. A \% followed by any letter not in the above list will be + * interpreted as VARCHAR (i.e. \%s). + */ +APU_DECLARE(int) apr_dbd_prepare(const apr_dbd_driver_t *driver, apr_pool_t *pool, + apr_dbd_t *handle, const char *query, + const char *label, + apr_dbd_prepared_t **statement); + + +/** apr_dbd_pquery: query using a prepared statement + args + * + * @param driver - the driver + * @param pool - working pool + * @param handle - the connection + * @param nrows - number of rows affected. + * @param statement - the prepared statement to execute + * @param nargs - ignored (for backward compatibility only) + * @param args - args to prepared statement + * @return 0 for success or error code + */ +APU_DECLARE(int) apr_dbd_pquery(const apr_dbd_driver_t *driver, apr_pool_t *pool, + apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement, int nargs, + const char **args); + +/** apr_dbd_pselect: select using a prepared statement + args + * + * @param driver - the driver + * @param pool - working pool + * @param handle - the connection + * @param res - pointer to query results. May point to NULL on entry + * @param statement - the prepared statement to execute + * @param random - Whether to support random-access to results + * @param nargs - ignored (for backward compatibility only) + * @param args - args to prepared statement + * @return 0 for success or error code + */ +APU_DECLARE(int) apr_dbd_pselect(const apr_dbd_driver_t *driver, apr_pool_t *pool, + apr_dbd_t *handle, apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, int random, + int nargs, const char **args); + +/** apr_dbd_pvquery: query using a prepared statement + args + * + * @param driver - the driver + * @param pool - working pool + * @param handle - the connection + * @param nrows - number of rows affected. + * @param statement - the prepared statement to execute + * @param ... - varargs list + * @return 0 for success or error code + */ +APU_DECLARE_NONSTD(int) apr_dbd_pvquery(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement, ...); + +/** apr_dbd_pvselect: select using a prepared statement + args + * + * @param driver - the driver + * @param pool - working pool + * @param handle - the connection + * @param res - pointer to query results. May point to NULL on entry + * @param statement - the prepared statement to execute + * @param random - Whether to support random-access to results + * @param ... - varargs list + * @return 0 for success or error code + */ +APU_DECLARE_NONSTD(int) apr_dbd_pvselect(const apr_dbd_driver_t *driver, + apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, + int random, ...); + +/** apr_dbd_pbquery: query using a prepared statement + binary args + * + * @param driver - the driver + * @param pool - working pool + * @param handle - the connection + * @param nrows - number of rows affected. + * @param statement - the prepared statement to execute + * @param args - binary args to prepared statement + * @return 0 for success or error code + */ +APU_DECLARE(int) apr_dbd_pbquery(const apr_dbd_driver_t *driver, + apr_pool_t *pool, apr_dbd_t *handle, + int *nrows, apr_dbd_prepared_t *statement, + const void **args); + +/** apr_dbd_pbselect: select using a prepared statement + binary args + * + * @param driver - the driver + * @param pool - working pool + * @param handle - the connection + * @param res - pointer to query results. May point to NULL on entry + * @param statement - the prepared statement to execute + * @param random - Whether to support random-access to results + * @param args - binary args to prepared statement + * @return 0 for success or error code + */ +APU_DECLARE(int) apr_dbd_pbselect(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_t *handle, apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, int random, + const void **args); + +/** apr_dbd_pvbquery: query using a prepared statement + binary args + * + * @param driver - the driver + * @param pool - working pool + * @param handle - the connection + * @param nrows - number of rows affected. + * @param statement - the prepared statement to execute + * @param ... - varargs list of binary args + * @return 0 for success or error code + */ +APU_DECLARE_NONSTD(int) apr_dbd_pvbquery(const apr_dbd_driver_t *driver, + apr_pool_t *pool, + apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement, ...); + +/** apr_dbd_pvbselect: select using a prepared statement + binary args + * + * @param driver - the driver + * @param pool - working pool + * @param handle - the connection + * @param res - pointer to query results. May point to NULL on entry + * @param statement - the prepared statement to execute + * @param random - Whether to support random-access to results + * @param ... - varargs list of binary args + * @return 0 for success or error code + */ +APU_DECLARE_NONSTD(int) apr_dbd_pvbselect(const apr_dbd_driver_t *driver, + apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, + int random, ...); + +/** apr_dbd_datum_get: get a binary entry from a row + * + * @param driver - the driver + * @param row - row pointer + * @param col - entry number + * @param type - type of data to get + * @param data - pointer to data, allocated by the caller + * @return APR_SUCCESS on success, APR_ENOENT if data is NULL or APR_EGENERAL + */ +APU_DECLARE(apr_status_t) apr_dbd_datum_get(const apr_dbd_driver_t *driver, + apr_dbd_row_t *row, int col, + apr_dbd_type_e type, void *data); + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/apr_dbm.h b/include/apr_dbm.h new file mode 100644 index 00000000000..ad1b4f391ed --- /dev/null +++ b/include/apr_dbm.h @@ -0,0 +1,227 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_DBM_H +#define APR_DBM_H + +#include "apu.h" +#include "apr.h" +#include "apr_errno.h" +#include "apr_pools.h" +#include "apr_file_info.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file apr_dbm.h + * @brief APR-UTIL DBM library + */ +/** + * @defgroup APR_Util_DBM DBM routines + * @ingroup APR_Util + * @{ + */ +/** + * Structure for referencing a dbm + */ +typedef struct apr_dbm_t apr_dbm_t; + +/** + * Structure for referencing the datum record within a dbm + */ +typedef struct +{ + /** pointer to the 'data' to retrieve/store in the DBM */ + char *dptr; + /** size of the 'data' to retrieve/store in the DBM */ + apr_size_t dsize; +} apr_datum_t; + +/* modes to open the DB */ +#define APR_DBM_READONLY 1 /**< open for read-only access */ +#define APR_DBM_READWRITE 2 /**< open for read-write access */ +#define APR_DBM_RWCREATE 3 /**< open for r/w, create if needed */ +#define APR_DBM_RWTRUNC 4 /**< open for r/w, truncating an existing + DB if present */ +/** + * Open a dbm file by file name and type of DBM + * @param dbm The newly opened database + * @param type The type of the DBM (not all may be available at run time) + *
    + *  db   for Berkeley DB files
    + *  gdbm for GDBM files
    + *  ndbm for NDBM files
    + *  sdbm for SDBM files (always available)
    + *  default for the default DBM type
    + *  
    + * @param name The dbm file name to open + * @param mode The flag value + *
    + *           APR_DBM_READONLY   open for read-only access
    + *           APR_DBM_READWRITE  open for read-write access
    + *           APR_DBM_RWCREATE   open for r/w, create if needed
    + *           APR_DBM_RWTRUNC    open for r/w, truncate if already there
    + * 
    + * @param perm Permissions to apply to if created + * @param cntxt The pool to use when creating the dbm + * @remark The dbm name may not be a true file name, as many dbm packages + * append suffixes for seperate data and index files. + * @bug In apr-util 0.9 and 1.x, the type arg was case insensitive. This + * was highly inefficient, and as of 2.x the dbm name must be provided in + * the correct case (lower case for all bundled providers) + */ + +APU_DECLARE(apr_status_t) apr_dbm_open_ex(apr_dbm_t **dbm, const char* type, + const char *name, + apr_int32_t mode, apr_fileperms_t perm, + apr_pool_t *cntxt); + + +/** + * Open a dbm file by file name + * @param dbm The newly opened database + * @param name The dbm file name to open + * @param mode The flag value + *
    + *           APR_DBM_READONLY   open for read-only access
    + *           APR_DBM_READWRITE  open for read-write access
    + *           APR_DBM_RWCREATE   open for r/w, create if needed
    + *           APR_DBM_RWTRUNC    open for r/w, truncate if already there
    + * 
    + * @param perm Permissions to apply to if created + * @param cntxt The pool to use when creating the dbm + * @remark The dbm name may not be a true file name, as many dbm packages + * append suffixes for seperate data and index files. + */ +APU_DECLARE(apr_status_t) apr_dbm_open(apr_dbm_t **dbm, const char *name, + apr_int32_t mode, apr_fileperms_t perm, + apr_pool_t *cntxt); + +/** + * Close a dbm file previously opened by apr_dbm_open + * @param dbm The database to close + */ +APU_DECLARE(void) apr_dbm_close(apr_dbm_t *dbm); + +/** + * Fetch a dbm record value by key + * @param dbm The database + * @param key The key datum to find this record + * @param pvalue The value datum retrieved for this record + */ +APU_DECLARE(apr_status_t) apr_dbm_fetch(apr_dbm_t *dbm, apr_datum_t key, + apr_datum_t *pvalue); +/** + * Store a dbm record value by key + * @param dbm The database + * @param key The key datum to store this record by + * @param value The value datum to store in this record + */ +APU_DECLARE(apr_status_t) apr_dbm_store(apr_dbm_t *dbm, apr_datum_t key, + apr_datum_t value); + +/** + * Delete a dbm record value by key + * @param dbm The database + * @param key The key datum of the record to delete + * @remark It is not an error to delete a non-existent record. + */ +APU_DECLARE(apr_status_t) apr_dbm_delete(apr_dbm_t *dbm, apr_datum_t key); + +/** + * Search for a key within the dbm + * @param dbm The database + * @param key The datum describing a key to test + */ +APU_DECLARE(int) apr_dbm_exists(apr_dbm_t *dbm, apr_datum_t key); + +/** + * Retrieve the first record key from a dbm + * @param dbm The database + * @param pkey The key datum of the first record + */ +APU_DECLARE(apr_status_t) apr_dbm_firstkey(apr_dbm_t *dbm, apr_datum_t *pkey); + +/** + * Retrieve the next record key from a dbm + * @param dbm The database + * @param pkey The key datum of the next record + */ +APU_DECLARE(apr_status_t) apr_dbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey); + +/** + * Proactively toss any memory associated with the apr_datum_t. + * @param dbm The database + * @param data The datum to free. + */ +APU_DECLARE(void) apr_dbm_freedatum(apr_dbm_t *dbm, apr_datum_t data); + +/** + * Report more information when an apr_dbm function fails. + * @param dbm The database + * @param errcode A DBM-specific value for the error (for logging). If this + * isn't needed, it may be NULL. + * @param errbuf Location to store the error text + * @param errbufsize The size of the provided buffer + * @return The errbuf parameter, for convenience. + */ +APU_DECLARE(char *) apr_dbm_geterror(apr_dbm_t *dbm, int *errcode, + char *errbuf, apr_size_t errbufsize); +/** + * If the specified file/path were passed to apr_dbm_open(), return the + * actual file/path names which would be (created and) used. At most, two + * files may be used; used2 may be NULL if only one file is used. + * @param pool The pool for allocating used1 and used2. + * @param type The type of DBM you require info on @see apr_dbm_open_ex + * @param pathname The path name to generate used-names from. + * @param used1 The first pathname used by the apr_dbm implementation. + * @param used2 The second pathname used by apr_dbm. If only one file is + * used by the specific implementation, this will be set to NULL. + * @return An error if the specified type is invalid. + * @remark The dbm file(s) don't need to exist. This function only manipulates + * the pathnames. + */ +APU_DECLARE(apr_status_t) apr_dbm_get_usednames_ex(apr_pool_t *pool, + const char *type, + const char *pathname, + const char **used1, + const char **used2); + +/** + * If the specified file/path were passed to apr_dbm_open(), return the + * actual file/path names which would be (created and) used. At most, two + * files may be used; used2 may be NULL if only one file is used. + * @param pool The pool for allocating used1 and used2. + * @param pathname The path name to generate used-names from. + * @param used1 The first pathname used by the apr_dbm implementation. + * @param used2 The second pathname used by apr_dbm. If only one file is + * used by the specific implementation, this will be set to NULL. + * @remark The dbm file(s) don't need to exist. This function only manipulates + * the pathnames. + */ +APU_DECLARE(void) apr_dbm_get_usednames(apr_pool_t *pool, + const char *pathname, + const char **used1, + const char **used2); + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* !APR_DBM_H */ diff --git a/include/apr_hooks.h b/include/apr_hooks.h new file mode 100644 index 00000000000..9f2a80751d3 --- /dev/null +++ b/include/apr_hooks.h @@ -0,0 +1,296 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_HOOKS_H +#define APR_HOOKS_H + +#include "apu.h" +/* For apr_array_header_t */ +#include "apr_tables.h" + +#ifdef APR_DTRACE_PROVIDER +#include +#ifndef OLD_DTRACE_PROBE +#define OLD_DTRACE_PROBE(name) __dtrace_ap___##name() +#endif +#ifndef OLD_DTRACE_PROBE1 +#define OLD_DTRACE_PROBE1(name,a) __dtrace_ap___##name(a) +#endif +#ifndef OLD_DTRACE_PROBE2 +#define OLD_DTRACE_PROBE2(name,a,b) __dtrace_ap___##name(a,b) +#endif +#else +#define OLD_DTRACE_PROBE(a) +#define OLD_DTRACE_PROBE1(a,b) +#define OLD_DTRACE_PROBE2(a,b,c) +#endif + +/** + * @file apr_hooks.h + * @brief Apache hook functions + */ + +#ifdef __cplusplus +extern "C" { +#endif +/** + * @defgroup APR_Util_Hook Hook Functions + * @ingroup APR_Util + * @{ + */ +/** macro to return the prototype of the hook function */ +#define APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name) \ +link##_DECLARE(apr_array_header_t *) ns##_hook_get_##name(void) + +/** macro to declare the hook correctly */ +#define APR_DECLARE_EXTERNAL_HOOK(ns,link,ret,name,args) \ +typedef ret ns##_HOOK_##name##_t args; \ +link##_DECLARE(void) ns##_hook_##name(ns##_HOOK_##name##_t *pf, \ + const char * const *aszPre, \ + const char * const *aszSucc, int nOrder); \ +link##_DECLARE(ret) ns##_run_##name args; \ +APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name); \ +typedef struct ns##_LINK_##name##_t \ + { \ + ns##_HOOK_##name##_t *pFunc; \ + const char *szName; \ + const char * const *aszPredecessors; \ + const char * const *aszSuccessors; \ + int nOrder; \ + } ns##_LINK_##name##_t; + +/** macro to declare the hook structure */ +#define APR_HOOK_STRUCT(members) \ +static struct { members } _hooks; + +/** macro to link the hook structure */ +#define APR_HOOK_LINK(name) \ + apr_array_header_t *link_##name; + +/** macro to implement the hook */ +#define APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \ +link##_DECLARE(void) ns##_hook_##name(ns##_HOOK_##name##_t *pf,const char * const *aszPre, \ + const char * const *aszSucc,int nOrder) \ + { \ + ns##_LINK_##name##_t *pHook; \ + if(!_hooks.link_##name) \ + { \ + _hooks.link_##name=apr_array_make(apr_hook_global_pool,1,sizeof(ns##_LINK_##name##_t)); \ + apr_hook_sort_register(#name,&_hooks.link_##name); \ + } \ + pHook=apr_array_push(_hooks.link_##name); \ + pHook->pFunc=pf; \ + pHook->aszPredecessors=aszPre; \ + pHook->aszSuccessors=aszSucc; \ + pHook->nOrder=nOrder; \ + pHook->szName=apr_hook_debug_current; \ + if(apr_hook_debug_enabled) \ + apr_hook_debug_show(#name,aszPre,aszSucc); \ + } \ + APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name) \ + { \ + return _hooks.link_##name; \ + } + +/** + * Implement a hook that has no return code, and therefore runs all of the + * registered functions + * @param ns The namespace prefix of the hook functions + * @param link The linkage declaration prefix of the hook + * @param name The name of the hook + * @param args_decl The declaration of the arguments for the hook + * @param args_use The names for the arguments for the hook + * @note The link prefix FOO corresponds to FOO_DECLARE() macros, which + * provide export linkage from the module that IMPLEMENTs the hook, and + * import linkage from external modules that link to the hook's module. + */ +#define APR_IMPLEMENT_EXTERNAL_HOOK_VOID(ns,link,name,args_decl,args_use) \ +APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \ +link##_DECLARE(void) ns##_run_##name args_decl \ + { \ + ns##_LINK_##name##_t *pHook; \ + int n; \ +\ + OLD_DTRACE_PROBE(name##__entry); \ +\ + if(_hooks.link_##name) \ + { \ + pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \ + for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ + { \ + OLD_DTRACE_PROBE1(name##__dispatch__invoke, (char *)pHook[n].szName); \ + pHook[n].pFunc args_use; \ + OLD_DTRACE_PROBE2(name##__dispatch__complete, (char *)pHook[n].szName, 0); \ + } \ + } \ +\ + OLD_DTRACE_PROBE1(name##__return, 0); \ +\ + } + +/* FIXME: note that this returns ok when nothing is run. I suspect it should + really return decline, but that breaks Apache currently - Ben +*/ +/** + * Implement a hook that runs until one of the functions returns something + * other than OK or DECLINE + * @param ns The namespace prefix of the hook functions + * @param link The linkage declaration prefix of the hook + * @param ret Type to return + * @param name The name of the hook + * @param args_decl The declaration of the arguments for the hook + * @param args_use The names for the arguments for the hook + * @param ok Success value + * @param decline Decline value + * @note The link prefix FOO corresponds to FOO_DECLARE() macros, which + * provide export linkage from the module that IMPLEMENTs the hook, and + * import linkage from external modules that link to the hook's module. + */ +#define APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(ns,link,ret,name,args_decl,args_use,ok,decline) \ +APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \ +link##_DECLARE(ret) ns##_run_##name args_decl \ + { \ + ns##_LINK_##name##_t *pHook; \ + int n; \ + ret rv = ok; \ +\ + OLD_DTRACE_PROBE(name##__entry); \ +\ + if(_hooks.link_##name) \ + { \ + pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \ + for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ + { \ + OLD_DTRACE_PROBE1(name##__dispatch__invoke, (char *)pHook[n].szName); \ + rv=pHook[n].pFunc args_use; \ + OLD_DTRACE_PROBE2(name##__dispatch__complete, (char *)pHook[n].szName, rv); \ + if(rv != ok && rv != decline) \ + break; \ + rv = ok; \ + } \ + } \ +\ + OLD_DTRACE_PROBE1(name##__return, rv); \ +\ + return rv; \ + } + + +/** + * Implement a hook that runs until the first function returns something + * other than the value of decline + * @param ns The namespace prefix of the hook functions + * @param link The linkage declaration prefix of the hook + * @param name The name of the hook + * @param ret Type to return + * @param args_decl The declaration of the arguments for the hook + * @param args_use The names for the arguments for the hook + * @param decline Decline value + * @note The link prefix FOO corresponds to FOO_DECLARE() macros, which + * provide export linkage from the module that IMPLEMENTs the hook, and + * import linkage from external modules that link to the hook's module. + */ +#define APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ns,link,ret,name,args_decl,args_use,decline) \ +APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \ +link##_DECLARE(ret) ns##_run_##name args_decl \ + { \ + ns##_LINK_##name##_t *pHook; \ + int n; \ + ret rv = decline; \ +\ + OLD_DTRACE_PROBE(name##__entry); \ +\ + if(_hooks.link_##name) \ + { \ + pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \ + for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ + { \ + OLD_DTRACE_PROBE1(name##__dispatch__invoke, (char *)pHook[n].szName); \ + rv=pHook[n].pFunc args_use; \ + OLD_DTRACE_PROBE2(name##__dispatch__complete, (char *)pHook[n].szName, rv); \ +\ + if(rv != decline) \ + break; \ + } \ + } \ +\ + OLD_DTRACE_PROBE1(name##__return, rv); \ +\ + return rv; \ + } + + /* Hook orderings */ +/** run this hook first, before ANYTHING */ +#define APR_HOOK_REALLY_FIRST (-10) +/** run this hook first */ +#define APR_HOOK_FIRST 0 +/** run this hook somewhere */ +#define APR_HOOK_MIDDLE 10 +/** run this hook after every other hook which is defined*/ +#define APR_HOOK_LAST 20 +/** run this hook last, after EVERYTHING */ +#define APR_HOOK_REALLY_LAST 30 + +/** + * The global pool used to allocate any memory needed by the hooks. + */ +APU_DECLARE_DATA extern apr_pool_t *apr_hook_global_pool; + +/** + * A global variable to determine if debugging information about the + * hooks functions should be printed + */ +APU_DECLARE_DATA extern int apr_hook_debug_enabled; + +/** + * The name of the module that is currently registering a function + */ +APU_DECLARE_DATA extern const char *apr_hook_debug_current; + +/** + * Register a hook function to be sorted + * @param szHookName The name of the Hook the function is registered for + * @param aHooks The array which stores all of the functions for this hook + */ +APU_DECLARE(void) apr_hook_sort_register(const char *szHookName, + apr_array_header_t **aHooks); +/** + * Sort all of the registerd functions for a given hook + */ +APU_DECLARE(void) apr_hook_sort_all(void); + +/** + * Print all of the information about the current hook. This is used for + * debugging purposes. + * @param szName The name of the hook + * @param aszPre All of the functions in the predecessor array + * @param aszSucc All of the functions in the successor array + */ +APU_DECLARE(void) apr_hook_debug_show(const char *szName, + const char * const *aszPre, + const char * const *aszSucc); + +/** + * Remove all currently registered functions. + */ +APU_DECLARE(void) apr_hook_deregister_all(void); + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* APR_HOOKS_H */ diff --git a/include/apr_ldap.h.in b/include/apr_ldap.h.in new file mode 100644 index 00000000000..6087783d86e --- /dev/null +++ b/include/apr_ldap.h.in @@ -0,0 +1,197 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h + */ +/** + * @file apr_ldap.h + * @brief APR-UTIL LDAP + */ +#ifndef APU_LDAP_H +#define APU_LDAP_H + +/** + * @defgroup APR_Util_LDAP LDAP + * @ingroup APR_Util + * @{ + */ + +/* this will be defined if LDAP support was compiled into apr-util */ +#define APR_HAS_LDAP @apu_has_ldap@ + +/* identify the LDAP toolkit used */ +#define APR_HAS_NETSCAPE_LDAPSDK @apu_has_ldap_netscape@ +#define APR_HAS_SOLARIS_LDAPSDK @apu_has_ldap_solaris@ +#define APR_HAS_NOVELL_LDAPSDK @apu_has_ldap_novell@ +#define APR_HAS_MOZILLA_LDAPSDK @apu_has_ldap_mozilla@ +#define APR_HAS_OPENLDAP_LDAPSDK @apu_has_ldap_openldap@ +#define APR_HAS_MICROSOFT_LDAPSDK @apu_has_ldap_microsoft@ +#define APR_HAS_TIVOLI_LDAPSDK @apu_has_ldap_tivoli@ +#define APR_HAS_ZOS_LDAPSDK @apu_has_ldap_zos@ +#define APR_HAS_OTHER_LDAPSDK @apu_has_ldap_other@ + + +/* + * Handle the case when LDAP is enabled + */ +#if APR_HAS_LDAP + +/* + * The following #defines are DEPRECATED and should not be used for + * anything. They remain to maintain binary compatibility. + * The original code defined the OPENLDAP SDK as present regardless + * of what really was there, which was way bogus. In addition, the + * apr_ldap_url_parse*() functions have been rewritten specifically for + * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero. + */ +#if APR_HAS_TIVOLI_LDAPSDK +#define APR_HAS_LDAP_SSL 0 +#else +#define APR_HAS_LDAP_SSL 1 +#endif +#define APR_HAS_LDAP_URL_PARSE 0 + +#if APR_HAS_OPENLDAP_LDAPSDK && !defined(LDAP_DEPRECATED) +/* Ensure that the "deprecated" interfaces are still exposed + * with OpenLDAP >= 2.3; these were exposed by default in earlier + * releases. */ +#define LDAP_DEPRECATED 1 +#endif + +/* + * Include the standard LDAP header files. + */ + +@lber_h@ +@ldap_h@ +@ldap_ssl_h@ + + +/* + * Detected standard functions + */ +#define APR_HAS_LDAPSSL_CLIENT_INIT @apu_has_ldapssl_client_init@ +#define APR_HAS_LDAPSSL_CLIENT_DEINIT @apu_has_ldapssl_client_deinit@ +#define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT @apu_has_ldapssl_add_trusted_cert@ +#define APR_HAS_LDAP_START_TLS_S @apu_has_ldap_start_tls_s@ +#define APR_HAS_LDAP_SSLINIT @apu_has_ldap_sslinit@ +#define APR_HAS_LDAPSSL_INIT @apu_has_ldapssl_init@ +#define APR_HAS_LDAPSSL_INSTALL_ROUTINES @apu_has_ldapssl_install_routines@ + +/* + * Make sure the secure LDAP port is defined + */ +#ifndef LDAPS_PORT +#define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */ +#endif + +/* + * For ldap function calls that input a size limit on the number of returned elements + * Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0) + * LDAP_DEFAULT_LIMIT is preferred as it allows inheritance from whatever the SDK + * or process is configured for. + */ +#ifdef LDAP_DEFAULT_LIMIT +#define APR_LDAP_SIZELIMIT LDAP_DEFAULT_LIMIT +#else +#ifdef LDAP_NO_LIMIT +#define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT +#endif +#endif + +#ifndef APR_LDAP_SIZELIMIT +#define APR_LDAP_SIZELIMIT 0 /* equivalent to LDAP_NO_LIMIT, and what goes on the wire */ +#endif + +/* + * z/OS is missing some defines + */ +#ifndef LDAP_VERSION_MAX +#define LDAP_VERSION_MAX LDAP_VERSION +#endif +#if APR_HAS_ZOS_LDAPSDK +#define LDAP_VENDOR_NAME "IBM z/OS" +#endif + +/* Note: Macros defining const casting has been removed in APR v1.0, + * pending real support for LDAP v2.0 toolkits. + * + * In the mean time, please use an LDAP v3.0 toolkit. + */ +#if LDAP_VERSION_MAX <= 2 +#error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit. +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * This structure allows the C LDAP API error codes to be returned + * along with plain text error messages that explain to us mere mortals + * what really happened. + */ +typedef struct apr_ldap_err_t { + const char *reason; + const char *msg; + int rc; +} apr_ldap_err_t; + +#ifdef __cplusplus +} +#endif + +/* The MS SDK returns LDAP_UNAVAILABLE when the backend has closed the connection + * between LDAP calls. Protect with APR_HAS_MICROSOFT_LDAPSDK in case someone + * manually chooses another SDK on Windows + */ +#if APR_HAS_MICROSOFT_LDAPSDK +#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN \ + || (s) == LDAP_UNAVAILABLE) +#else +#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN) +#endif + +/* These symbols are not actually exported in a DSO build, but mapped into + * a private exported function array for apr_ldap_stub to bind dynamically. + * Rename them appropriately to protect the global namespace. + */ +#ifdef APU_DSO_LDAP_BUILD + +#define apr_ldap_info apr__ldap_info +#define apr_ldap_init apr__ldap_init +#define apr_ldap_ssl_init apr__ldap_ssl_init +#define apr_ldap_ssl_deinit apr__ldap_ssl_deinit +#define apr_ldap_get_option apr__ldap_get_option +#define apr_ldap_set_option apr__ldap_set_option +#define apr_ldap_rebind_init apr__ldap_rebind_init +#define apr_ldap_rebind_add apr__ldap_rebind_add +#define apr_ldap_rebind_remove apr__ldap_rebind_remove + +#define APU_DECLARE_LDAP(type) type +#else +#define APU_DECLARE_LDAP(type) APU_DECLARE(type) +#endif + +#include "apr_ldap_url.h" +#include "apr_ldap_init.h" +#include "apr_ldap_option.h" +#include "apr_ldap_rebind.h" + +/** @} */ +#endif /* APR_HAS_LDAP */ +#endif /* APU_LDAP_H */ diff --git a/include/apr_ldap.hnw b/include/apr_ldap.hnw new file mode 100644 index 00000000000..c93014ae6d4 --- /dev/null +++ b/include/apr_ldap.hnw @@ -0,0 +1,158 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h + */ +/** + * @file apr_ldap.h + * @brief APR-UTIL LDAP + */ +#ifndef APU_LDAP_H +#define APU_LDAP_H + +/** + * @defgroup APR_Util_LDAP LDAP + * @ingroup APR_Util + * @{ + */ + +/* this will be defined if LDAP support was compiled into apr-util */ +#define APR_HAS_LDAP 1 + +/* identify the LDAP toolkit used */ +#define APR_HAS_NETSCAPE_LDAPSDK 0 +#define APR_HAS_SOLARIS_LDAPSDK 0 +#define APR_HAS_NOVELL_LDAPSDK 1 +#define APR_HAS_MOZILLA_LDAPSDK 0 +#define APR_HAS_OPENLDAP_LDAPSDK 0 +#define APR_HAS_MICROSOFT_LDAPSDK 0 +#define APR_HAS_OTHER_LDAPSDK 0 + + +/* + * Handle the case when LDAP is enabled + */ +#if APR_HAS_LDAP + +/* + * The following #defines are DEPRECATED and should not be used for + * anything. They remain to maintain binary compatibility. + * The original code defined the OPENLDAP SDK as present regardless + * of what really was there, which was way bogus. In addition, the + * apr_ldap_url_parse*() functions have been rewritten specifically for + * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero. + */ +#define APR_HAS_LDAP_SSL 1 +#define APR_HAS_LDAP_URL_PARSE 0 + + +/* + * Include the standard LDAP header files. + */ + +#ifdef GENEXPORTS +#define LDAP_VERSION_MAX 3 +#define LDAP_INSUFFICIENT_ACCESS +#else +#include +#include +#if APR_HAS_LDAP_SSL +#include +#endif +#endif + + +/* + * Detected standard functions + */ +#define APR_HAS_LDAPSSL_CLIENT_INIT 1 +#define APR_HAS_LDAPSSL_CLIENT_DEINIT 1 +#define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT 1 +#define APR_HAS_LDAP_START_TLS_S 0 +#define APR_HAS_LDAP_SSLINIT 0 +#define APR_HAS_LDAPSSL_INIT 1 +#define APR_HAS_LDAPSSL_INSTALL_ROUTINES 0 + + +/* + * Make sure the secure LDAP port is defined + */ +#ifndef LDAPS_PORT +#define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */ +#endif + + +/* Note: Macros defining const casting has been removed in APR v1.0, + * pending real support for LDAP v2.0 toolkits. + * + * In the mean time, please use an LDAP v3.0 toolkit. + */ +#if LDAP_VERSION_MAX <= 2 +#error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit. +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * This structure allows the C LDAP API error codes to be returned + * along with plain text error messages that explain to us mere mortals + * what really happened. + */ +typedef struct apr_ldap_err_t { + const char *reason; + const char *msg; + int rc; +} apr_ldap_err_t; + +#ifdef __cplusplus +} +#endif + +#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN) + +/* These symbols are not actually exported in a DSO build, but mapped into + * a private exported function array for apr_ldap_stub to bind dynamically. + * Rename them appropriately to protect the global namespace. + */ +#ifdef APU_DSO_LDAP_BUILD + +#define apr_ldap_info apr__ldap_info +#define apr_ldap_init apr__ldap_init +#define apr_ldap_ssl_init apr__ldap_ssl_init +#define apr_ldap_ssl_deinit apr__ldap_ssl_deinit +#define apr_ldap_get_option apr__ldap_get_option +#define apr_ldap_set_option apr__ldap_set_option +#define apr_ldap_rebind_init apr__ldap_rebind_init +#define apr_ldap_rebind_add apr__ldap_rebind_add +#define apr_ldap_rebind_remove apr__ldap_rebind_remove + +#define APU_DECLARE_LDAP(type) type +#else +#define APU_DECLARE_LDAP(type) APU_DECLARE(type) +#endif + +#include "apr_ldap_url.h" +#include "apr_ldap_init.h" +#include "apr_ldap_option.h" +#include "apr_ldap_rebind.h" + +/** @} */ +#endif /* APR_HAS_LDAP */ +#endif /* APU_LDAP_H */ + diff --git a/include/apr_ldap.hw b/include/apr_ldap.hw new file mode 100644 index 00000000000..c1bd0d4b676 --- /dev/null +++ b/include/apr_ldap.hw @@ -0,0 +1,197 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h + */ +/** + * @file apr_ldap.h + * @brief APR-UTIL LDAP + */ +#ifndef APU_LDAP_H +#define APU_LDAP_H + +/** + * @defgroup APR_Util_LDAP LDAP + * @ingroup APR_Util + * @{ + */ + +/* this will be defined if LDAP support was compiled into apr-util */ +#define APR_HAS_LDAP 1 + +/* identify the LDAP toolkit used */ +#define APR_HAS_NETSCAPE_LDAPSDK 0 +#define APR_HAS_SOLARIS_LDAPSDK 0 +#define APR_HAS_NOVELL_LDAPSDK 0 +#define APR_HAS_MOZILLA_LDAPSDK 0 +#define APR_HAS_OPENLDAP_LDAPSDK 0 +#define APR_HAS_MICROSOFT_LDAPSDK 1 +#define APR_HAS_TIVOLI_LDAPSDK 0 +#define APR_HAS_ZOS_LDAPSDK 0 +#define APR_HAS_OTHER_LDAPSDK 0 + + +/* + * Handle the case when LDAP is enabled + */ +#if APR_HAS_LDAP + +/* + * The following #defines are DEPRECATED and should not be used for + * anything. They remain to maintain binary compatibility. + * The original code defined the OPENLDAP SDK as present regardless + * of what really was there, which was way bogus. In addition, the + * apr_ldap_url_parse*() functions have been rewritten specifically for + * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero. + */ +#if APR_HAS_TIVOLI_LDAPSDK +#define APR_HAS_LDAP_SSL 0 +#else +#define APR_HAS_LDAP_SSL 1 +#endif +#define APR_HAS_LDAP_URL_PARSE 0 + +#if APR_HAS_OPENLDAP_LDAPSDK && !defined(LDAP_DEPRECATED) +/* Ensure that the "deprecated" interfaces are still exposed + * with OpenLDAP >= 2.3; these were exposed by default in earlier + * releases. */ +#define LDAP_DEPRECATED 1 +#endif + +/* + * Include the standard LDAP header files. + */ + +#include + + +/* + * Detected standard functions + */ +#define APR_HAS_LDAPSSL_CLIENT_INIT 0 +#define APR_HAS_LDAPSSL_CLIENT_DEINIT 0 +#define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT 0 +#define APR_HAS_LDAP_START_TLS_S 0 +#define APR_HAS_LDAP_SSLINIT 1 +#define APR_HAS_LDAPSSL_INIT 0 +#define APR_HAS_LDAPSSL_INSTALL_ROUTINES 0 + + +/* + * Make sure the secure LDAP port is defined + */ +#ifndef LDAPS_PORT +#define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */ +#endif + + +/* + * For ldap function calls that input a size limit on the number of returned elements + * Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0) + * LDAP_DEFAULT_LIMIT is preferred as it allows inheritance from whatever the SDK + * or process is configured for. + */ +#ifdef LDAP_DEFAULT_LIMIT +#define APR_LDAP_SIZELIMIT LDAP_DEFAULT_LIMIT +#else +#ifdef LDAP_NO_LIMIT +#define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT +#endif +#endif + +#ifndef APR_LDAP_SIZELIMIT +#define APR_LDAP_SIZELIMIT 0 /* equivalent to LDAP_NO_LIMIT, and what goes on the wire */ +#endif + +/* + * z/OS is missing some defines + */ +#ifndef LDAP_VERSION_MAX +#define LDAP_VERSION_MAX LDAP_VERSION +#endif +#if APR_HAS_ZOS_LDAPSDK +#define LDAP_VENDOR_NAME "IBM z/OS" +#endif + +/* Note: Macros defining const casting has been removed in APR v1.0, + * pending real support for LDAP v2.0 toolkits. + * + * In the mean time, please use an LDAP v3.0 toolkit. + */ +#if LDAP_VERSION_MAX <= 2 +#error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit. +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * This structure allows the C LDAP API error codes to be returned + * along with plain text error messages that explain to us mere mortals + * what really happened. + */ +typedef struct apr_ldap_err_t { + const char *reason; + const char *msg; + int rc; +} apr_ldap_err_t; + +#ifdef __cplusplus +} +#endif + +/* The MS SDK returns LDAP_UNAVAILABLE when the backend has closed the connection + * between LDAP calls. Protect with APR_HAS_MICROSOFT_LDAPSDK in case someone + * manually chooses another SDK on Windows + */ +#if APR_HAS_MICROSOFT_LDAPSDK +#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN \ + || (s) == LDAP_UNAVAILABLE) +#else +#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN) +#endif + +/* These symbols are not actually exported in a DSO build, but mapped into + * a private exported function array for apr_ldap_stub to bind dynamically. + * Rename them appropriately to protect the global namespace. + */ +#ifdef APU_DSO_LDAP_BUILD + +#define apr_ldap_info apr__ldap_info +#define apr_ldap_init apr__ldap_init +#define apr_ldap_ssl_init apr__ldap_ssl_init +#define apr_ldap_ssl_deinit apr__ldap_ssl_deinit +#define apr_ldap_get_option apr__ldap_get_option +#define apr_ldap_set_option apr__ldap_set_option +#define apr_ldap_rebind_init apr__ldap_rebind_init +#define apr_ldap_rebind_add apr__ldap_rebind_add +#define apr_ldap_rebind_remove apr__ldap_rebind_remove + +#define APU_DECLARE_LDAP(type) type +#else +#define APU_DECLARE_LDAP(type) APU_DECLARE(type) +#endif + +#include "apr_ldap_url.h" +#include "apr_ldap_init.h" +#include "apr_ldap_option.h" +#include "apr_ldap_rebind.h" + +/** @} */ +#endif /* APR_HAS_LDAP */ +#endif /* APU_LDAP_H */ diff --git a/include/apr_ldap_init.h b/include/apr_ldap_init.h new file mode 100644 index 00000000000..aeb6d9bb1f5 --- /dev/null +++ b/include/apr_ldap_init.h @@ -0,0 +1,165 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file apr_ldap_init.h + * @brief APR-UTIL LDAP ldap_init() functions + */ +#ifndef APR_LDAP_INIT_H +#define APR_LDAP_INIT_H + +/** + * @addtogroup APR_Util_LDAP + * @{ + */ + +#include "apr_ldap.h" + +#if APR_HAS_LDAP + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +/** + * Macro to detect security related return values. + */ +#if defined(LDAP_INSUFFICIENT_ACCESS) +#define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_ACCESS +#elif defined(LDAP_INSUFFICIENT_RIGHTS) +#define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_RIGHTS +#elif defined(APR_HAS_MICROSOFT_LDAPSDK) +/* The macros above fail to contemplate that LDAP_RETCODE values + * may be represented by an enum. autoconf tests would be much + * more robust. + */ +#define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_RIGHTS +#else +#error The security return codes must be added to support this LDAP toolkit. +#endif + +#if defined(LDAP_SECURITY_ERROR) +#define APU_LDAP_SECURITY_ERROR LDAP_SECURITY_ERROR +#else +#define APU_LDAP_SECURITY_ERROR(n) \ + (LDAP_INAPPROPRIATE_AUTH == n) ? 1 \ + : (LDAP_INVALID_CREDENTIALS == n) ? 1 \ + : (APU_LDAP_INSUFFICIENT_ACCESS == n) ? 1 \ + : 0 +#endif + + +/** + * APR LDAP SSL Initialise function + * + * This function initialises SSL on the underlying LDAP toolkit + * if this is necessary. + * + * If a CA certificate is provided, this is set, however the setting + * of certificates via this method has been deprecated and will be removed in + * APR v2.0. + * + * The apr_ldap_set_option() function with the APR_LDAP_OPT_TLS_CERT option + * should be used instead to set certificates. + * + * If SSL support is not available on this platform, or a problem + * was encountered while trying to set the certificate, the function + * will return APR_EGENERAL. Further LDAP specific error information + * can be found in result_err. + * @param pool The pool to use + * @param cert_auth_file The name of the certificate to use, can be NULL + * @param cert_file_type The type of certificate specified. See the + * apr_ldap_set_option() APR_LDAP_OPT_TLS_CERT option for details. + * @param result_err The returned result + */ +APU_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool, + const char *cert_auth_file, + int cert_file_type, + apr_ldap_err_t **result_err); + +/** + * APR LDAP SSL De-Initialise function + * + * This function tears down any SSL certificate setup previously + * set using apr_ldap_ssl_init(). It should be called to clean + * up if a graceful restart of a service is attempted. + * @todo currently we do not check whether apr_ldap_ssl_init() + * has been called first - we probably should. + */ +APU_DECLARE_LDAP(int) apr_ldap_ssl_deinit(void); + +/** + * APR LDAP initialise function + * + * This function is responsible for initialising an LDAP + * connection in a toolkit independant way. It does the + * job of ldap_init() from the C api. + * + * It handles both the SSL and non-SSL case, and attempts + * to hide the complexity setup from the user. This function + * assumes that any certificate setup necessary has already + * been done. + * + * If SSL or STARTTLS needs to be enabled, and the underlying + * toolkit supports it, the following values are accepted for + * secure: + * + * APR_LDAP_NONE: No encryption + * APR_LDAP_SSL: SSL encryption (ldaps://) + * APR_LDAP_STARTTLS: Force STARTTLS on ldap:// + * @remark The Novell toolkit is only able to set the SSL mode via this + * function. To work around this limitation, set the SSL mode here if no + * per connection client certificates are present, otherwise set secure + * APR_LDAP_NONE here, then set the per connection client certificates, + * followed by setting the SSL mode via apr_ldap_set_option(). As Novell + * does not support per connection client certificates, this problem is + * worked around while still being compatible with other LDAP toolkits. + * @param pool The pool to use + * @param ldap The LDAP handle + * @param hostname The name of the host to connect to. This can be either a + * DNS name, or an IP address. + * @param portno The port to connect to + * @param secure The security mode to set + * @param result_err The returned result + */ +APU_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool, + LDAP **ldap, + const char *hostname, + int portno, + int secure, + apr_ldap_err_t **result_err); + +/** + * APR LDAP info function + * + * This function returns a string describing the LDAP toolkit + * currently in use. The string is placed inside result_err->reason. + * @param pool The pool to use + * @param result_err The returned result + */ +APU_DECLARE_LDAP(int) apr_ldap_info(apr_pool_t *pool, + apr_ldap_err_t **result_err); + +#ifdef __cplusplus +} +#endif + +#endif /* APR_HAS_LDAP */ + +/** @} */ + +#endif /* APR_LDAP_URL_H */ diff --git a/include/apr_ldap_option.h b/include/apr_ldap_option.h new file mode 100644 index 00000000000..0ff8a862226 --- /dev/null +++ b/include/apr_ldap_option.h @@ -0,0 +1,254 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file apr_ldap_option.h + * @brief APR-UTIL LDAP ldap_*_option() functions + */ +#ifndef APR_LDAP_OPTION_H +#define APR_LDAP_OPTION_H + +/** + * @addtogroup APR_Util_LDAP + * @{ + */ + +#include "apr_ldap.h" + +#if APR_HAS_LDAP + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + * The following defines handle the different TLS certificate + * options available. If these options are missing, APR will try and + * emulate support for this using the deprecated ldap_start_tls_s() + * function. + */ +/** + * Set SSL mode to one of APR_LDAP_NONE, APR_LDAP_SSL, APR_LDAP_STARTTLS + * or APR_LDAP_STOPTLS. + */ +#define APR_LDAP_OPT_TLS 0x6fff +/** + * Set zero or more CA certificates, client certificates or private + * keys globally, or per connection (where supported). + */ +#define APR_LDAP_OPT_TLS_CERT 0x6ffe +/** + * Set the LDAP library to no verify the server certificate. This means + * all servers are considered trusted. + */ +#define APR_LDAP_OPT_VERIFY_CERT 0x6ffd +/** + * Set the LDAP library to indicate if referrals should be chased during + * LDAP searches. + */ +#define APR_LDAP_OPT_REFERRALS 0x6ffc +/** + * Set the LDAP library to indicate a maximum number of referral hops to + * chase before giving up on the search. + */ +#define APR_LDAP_OPT_REFHOPLIMIT 0x6ffb + +/** + * Structures for the apr_set_option() cases + */ + +/** + * APR_LDAP_OPT_TLS_CERT + * + * This structure includes possible options to set certificates on + * system initialisation. Different SDKs have different certificate + * requirements, and to achieve this multiple certificates must be + * specified at once passed as an (apr_array_header_t *). + * + * Netscape: + * Needs the CA cert database (cert7.db), the client cert database (key3.db) + * and the security module file (secmod.db) set at the system initialisation + * time. Three types are supported: APR_LDAP_CERT7_DB, APR_LDAP_KEY3_DB and + * APR_LDAP_SECMOD. + * + * To specify a client cert connection, a certificate nickname needs to be + * provided with a type of APR_LDAP_CERT. + * int ldapssl_enable_clientauth( LDAP *ld, char *keynickname, + * char *keypasswd, char *certnickname ); + * keynickname is currently not used, and should be set to "" + * + * Novell: + * Needs CA certificates and client certificates set at system initialisation + * time. Three types are supported: APR_LDAP_CA*, APR_LDAP_CERT* and + * APR_LDAP_KEY*. + * + * Certificates cannot be specified per connection. + * + * The functions used are: + * ldapssl_add_trusted_cert(serverTrustedRoot, serverTrustedRootEncoding); + * Clients certs and keys are set at system initialisation time with + * int ldapssl_set_client_cert ( + * void *cert, + * int type + * void *password); + * type can be LDAPSSL_CERT_FILETYPE_B64 or LDAPSSL_CERT_FILETYPE_DER + * ldapssl_set_client_private_key(clientPrivateKey, + * clientPrivateKeyEncoding, + * clientPrivateKeyPassword); + * + * OpenSSL: + * Needs one or more CA certificates to be set at system initialisation time + * with a type of APR_LDAP_CA*. + * + * May have one or more client certificates set per connection with a type of + * APR_LDAP_CERT*, and keys with APR_LDAP_KEY*. + */ +/** CA certificate type unknown */ +#define APR_LDAP_CA_TYPE_UNKNOWN 0 +/** binary DER encoded CA certificate */ +#define APR_LDAP_CA_TYPE_DER 1 +/** PEM encoded CA certificate */ +#define APR_LDAP_CA_TYPE_BASE64 2 +/** Netscape/Mozilla cert7.db CA certificate database */ +#define APR_LDAP_CA_TYPE_CERT7_DB 3 +/** Netscape/Mozilla secmod file */ +#define APR_LDAP_CA_TYPE_SECMOD 4 +/** Client certificate type unknown */ +#define APR_LDAP_CERT_TYPE_UNKNOWN 5 +/** binary DER encoded client certificate */ +#define APR_LDAP_CERT_TYPE_DER 6 +/** PEM encoded client certificate */ +#define APR_LDAP_CERT_TYPE_BASE64 7 +/** Netscape/Mozilla key3.db client certificate database */ +#define APR_LDAP_CERT_TYPE_KEY3_DB 8 +/** Netscape/Mozilla client certificate nickname */ +#define APR_LDAP_CERT_TYPE_NICKNAME 9 +/** Private key type unknown */ +#define APR_LDAP_KEY_TYPE_UNKNOWN 10 +/** binary DER encoded private key */ +#define APR_LDAP_KEY_TYPE_DER 11 +/** PEM encoded private key */ +#define APR_LDAP_KEY_TYPE_BASE64 12 +/** PKCS#12 encoded client certificate */ +#define APR_LDAP_CERT_TYPE_PFX 13 +/** PKCS#12 encoded private key */ +#define APR_LDAP_KEY_TYPE_PFX 14 +/** Openldap directory full of base64-encoded cert + * authorities with hashes in corresponding .0 directory + */ +#define APR_LDAP_CA_TYPE_CACERTDIR_BASE64 15 + + +/** + * Certificate structure. + * + * This structure is used to store certificate details. An array of + * these structures is passed to apr_ldap_set_option() to set CA + * and client certificates. + * @param type Type of certificate APR_LDAP_*_TYPE_* + * @param path Path, file or nickname of the certificate + * @param password Optional password, can be NULL + */ +typedef struct apr_ldap_opt_tls_cert_t apr_ldap_opt_tls_cert_t; +struct apr_ldap_opt_tls_cert_t { + int type; + const char *path; + const char *password; +}; + +/** + * APR_LDAP_OPT_TLS + * + * This sets the SSL level on the LDAP handle. + * + * Netscape/Mozilla: + * Supports SSL, but not STARTTLS + * SSL is enabled by calling ldapssl_install_routines(). + * + * Novell: + * Supports SSL and STARTTLS. + * SSL is enabled by calling ldapssl_install_routines(). Note that calling + * other ldap functions before ldapssl_install_routines() may cause this + * function to fail. + * STARTTLS is enabled by calling ldapssl_start_tls_s() after calling + * ldapssl_install_routines() (check this). + * + * OpenLDAP: + * Supports SSL and supports STARTTLS, but none of this is documented: + * http://www.openldap.org/lists/openldap-software/200409/msg00618.html + * Documentation for both SSL support and STARTTLS has been deleted from + * the OpenLDAP documentation and website. + */ + +/** No encryption */ +#define APR_LDAP_NONE 0 +/** SSL encryption (ldaps://) */ +#define APR_LDAP_SSL 1 +/** TLS encryption (STARTTLS) */ +#define APR_LDAP_STARTTLS 2 +/** end TLS encryption (STOPTLS) */ +#define APR_LDAP_STOPTLS 3 + +/** + * APR LDAP get option function + * + * This function gets option values from a given LDAP session if + * one was specified. It maps to the native ldap_get_option() function. + * @param pool The pool to use + * @param ldap The LDAP handle + * @param option The LDAP_OPT_* option to return + * @param outvalue The value returned (if any) + * @param result_err The apr_ldap_err_t structure contained detailed results + * of the operation. + */ +APU_DECLARE_LDAP(int) apr_ldap_get_option(apr_pool_t *pool, + LDAP *ldap, + int option, + void *outvalue, + apr_ldap_err_t **result_err); + +/** + * APR LDAP set option function + * + * This function sets option values to a given LDAP session if + * one was specified. It maps to the native ldap_set_option() function. + * + * Where an option is not supported by an LDAP toolkit, this function + * will try and apply legacy functions to achieve the same effect, + * depending on the platform. + * @param pool The pool to use + * @param ldap The LDAP handle + * @param option The LDAP_OPT_* option to set + * @param invalue The value to set + * @param result_err The apr_ldap_err_t structure contained detailed results + * of the operation. + */ +APU_DECLARE_LDAP(int) apr_ldap_set_option(apr_pool_t *pool, + LDAP *ldap, + int option, + const void *invalue, + apr_ldap_err_t **result_err); + +#ifdef __cplusplus +} +#endif + +#endif /* APR_HAS_LDAP */ + +/** @} */ + +#endif /* APR_LDAP_OPTION_H */ + diff --git a/include/apr_ldap_rebind.h b/include/apr_ldap_rebind.h new file mode 100644 index 00000000000..342a17c3893 --- /dev/null +++ b/include/apr_ldap_rebind.h @@ -0,0 +1,98 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The APR LDAP rebind functions provide an implementation of + * a rebind procedure that can be used to allow clients to chase referrals, + * using the same credentials used to log in originally. + * + * Use of this implementation is optional. + * + * @file apr_ldap_rebind.h + * @brief Apache LDAP library + */ + +#ifndef APU_LDAP_REBIND_H +#define APU_LDAP_REBIND_H + +/** + * @addtogroup APR_Util_LDAP + * @{ + **/ + +#if defined(DOXYGEN) +#include "apr_ldap.h" +#endif + +/* + * Handle the case when LDAP is enabled + */ +#if APR_HAS_LDAP + +/** + * APR LDAP initialize rebind lock + * + * This function creates the lock for controlling access to the xref list.. + * @param pool Pool to use when creating the xref_lock. + */ +APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool); + + +/** + * APR LDAP rebind_add function + * + * This function creates a cross reference entry for the specified ldap + * connection. The rebind callback function will look up this ldap + * connection so it can retrieve the bindDN and bindPW for use in any + * binds while referrals are being chased. + * + * This function will add the callback to the LDAP handle passed in. + * + * A cleanup is registered within the pool provided to remove this + * entry when the pool is removed. Alternatively apr_ldap_rebind_remove() + * can be called to explicitly remove the entry at will. + * + * @param pool The pool to use + * @param ld The LDAP connectionhandle + * @param bindDN The bind DN to be used for any binds while chasing + * referrals on this ldap connection. + * @param bindPW The bind Password to be used for any binds while + * chasing referrals on this ldap connection. + */ +APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, + LDAP *ld, + const char *bindDN, + const char *bindPW); + +/** + * APR LDAP rebind_remove function + * + * This function removes the rebind cross reference entry for the + * specified ldap connection. + * + * If not explicitly removed, this function will be called automatically + * when the pool is cleaned up. + * + * @param ld The LDAP connectionhandle + */ +APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld); + +#endif /* APR_HAS_LDAP */ + +/** @} */ + +#endif /* APU_LDAP_REBIND_H */ + diff --git a/include/apr_ldap_url.h b/include/apr_ldap_url.h new file mode 100644 index 00000000000..a71f5b3cb33 --- /dev/null +++ b/include/apr_ldap_url.h @@ -0,0 +1,120 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file apr_ldap_url.h + * @brief APR-UTIL LDAP ldap_init() functions + */ +#ifndef APR_LDAP_URL_H +#define APR_LDAP_URL_H + +/** + * @addtogroup APR_Util_LDAP + * @{ + */ + +#if defined(DOXYGEN) +#include "apr_ldap.h" +#endif + +#if APR_HAS_LDAP + +#include "apu.h" +#include "apr_pools.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** Structure to access an exploded LDAP URL */ +typedef struct apr_ldap_url_desc_t { + struct apr_ldap_url_desc_t *lud_next; + char *lud_scheme; + char *lud_host; + int lud_port; + char *lud_dn; + char **lud_attrs; + int lud_scope; + char *lud_filter; + char **lud_exts; + int lud_crit_exts; +} apr_ldap_url_desc_t; + +#ifndef APR_LDAP_URL_SUCCESS +#define APR_LDAP_URL_SUCCESS 0x00 /* Success */ +#define APR_LDAP_URL_ERR_MEM 0x01 /* can't allocate memory space */ +#define APR_LDAP_URL_ERR_PARAM 0x02 /* parameter is bad */ +#define APR_LDAP_URL_ERR_BADSCHEME 0x03 /* URL doesn't begin with "ldap[si]://" */ +#define APR_LDAP_URL_ERR_BADENCLOSURE 0x04 /* URL is missing trailing ">" */ +#define APR_LDAP_URL_ERR_BADURL 0x05 /* URL is bad */ +#define APR_LDAP_URL_ERR_BADHOST 0x06 /* host port is bad */ +#define APR_LDAP_URL_ERR_BADATTRS 0x07 /* bad (or missing) attributes */ +#define APR_LDAP_URL_ERR_BADSCOPE 0x08 /* scope string is invalid (or missing) */ +#define APR_LDAP_URL_ERR_BADFILTER 0x09 /* bad or missing filter */ +#define APR_LDAP_URL_ERR_BADEXTS 0x0a /* bad or missing extensions */ +#endif + +/** + * Is this URL an ldap url? ldap:// + * @param url The url to test + */ +APU_DECLARE(int) apr_ldap_is_ldap_url(const char *url); + +/** + * Is this URL an SSL ldap url? ldaps:// + * @param url The url to test + */ +APU_DECLARE(int) apr_ldap_is_ldaps_url(const char *url); + +/** + * Is this URL an ldap socket url? ldapi:// + * @param url The url to test + */ +APU_DECLARE(int) apr_ldap_is_ldapi_url(const char *url); + +/** + * Parse an LDAP URL. + * @param pool The pool to use + * @param url_in The URL to parse + * @param ludpp The structure to return the exploded URL + * @param result_err The result structure of the operation + */ +APU_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool, + const char *url_in, + apr_ldap_url_desc_t **ludpp, + apr_ldap_err_t **result_err); + +/** + * Parse an LDAP URL. + * @param pool The pool to use + * @param url_in The URL to parse + * @param ludpp The structure to return the exploded URL + * @param result_err The result structure of the operation + */ +APU_DECLARE(int) apr_ldap_url_parse(apr_pool_t *pool, + const char *url_in, + apr_ldap_url_desc_t **ludpp, + apr_ldap_err_t **result_err); + +#ifdef __cplusplus +} +#endif + +#endif /* APR_HAS_LDAP */ + +/** @} */ + +#endif /* APR_LDAP_URL_H */ diff --git a/include/apr_md4.h b/include/apr_md4.h new file mode 100644 index 00000000000..43fb33e3045 --- /dev/null +++ b/include/apr_md4.h @@ -0,0 +1,135 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* This is derived from material copyright RSA Data Security, Inc. + * Their notice is reproduced below in its entirety. + * + * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All + * rights reserved. + * + * License to copy and use this software is granted provided that it + * is identified as the "RSA Data Security, Inc. MD4 Message-Digest + * Algorithm" in all material mentioning or referencing this software + * or this function. + * + * License is also granted to make and use derivative works provided + * that such works are identified as "derived from the RSA Data + * Security, Inc. MD4 Message-Digest Algorithm" in all material + * mentioning or referencing the derived work. + * + * RSA Data Security, Inc. makes no representations concerning either + * the merchantability of this software or the suitability of this + * software for any particular purpose. It is provided "as is" + * without express or implied warranty of any kind. + * + * These notices must be retained in any copies of any part of this + * documentation and/or software. + */ + +#ifndef APR_MD4_H +#define APR_MD4_H + +#include "apu.h" +#include "apr_xlate.h" +/** + * @file apr_md4.h + * @brief APR-UTIL MD4 Library + */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup APR_Util_MD4 MD4 Library + * @ingroup APR_Util + * @{ + */ + +/** The digestsize for MD4 */ +#define APR_MD4_DIGESTSIZE 16 + +/** @see apr_md4_ctx_t */ +typedef struct apr_md4_ctx_t apr_md4_ctx_t; + +/** MD4 context. */ +struct apr_md4_ctx_t { + /** state (ABCD) */ + apr_uint32_t state[4]; + /** number of bits, modulo 2^64 (lsb first) */ + apr_uint32_t count[2]; + /** input buffer */ + unsigned char buffer[64]; +#if APR_HAS_XLATE + /** translation handle */ + apr_xlate_t *xlate; +#endif +}; + +/** + * MD4 Initialize. Begins an MD4 operation, writing a new context. + * @param context The MD4 context to initialize. + */ +APU_DECLARE(apr_status_t) apr_md4_init(apr_md4_ctx_t *context); + +#if APR_HAS_XLATE +/** + * MDr4 translation setup. Provides the APR translation handle to be used + * for translating the content before calculating the digest. + * @param context The MD4 content to set the translation for. + * @param xlate The translation handle to use for this MD4 context + */ +APU_DECLARE(apr_status_t) apr_md4_set_xlate(apr_md4_ctx_t *context, + apr_xlate_t *xlate); +#else +#define apr_md4_set_xlate(context, xlate) APR_ENOTIMPL +#endif + +/** + * MD4 block update operation. Continue an MD4 message-digest operation, + * processing another message block, and updating the context. + * @param context The MD4 content to update. + * @param input next message block to update + * @param inputLen The length of the next message block + */ +APU_DECLARE(apr_status_t) apr_md4_update(apr_md4_ctx_t *context, + const unsigned char *input, + apr_size_t inputLen); + +/** + * MD4 finalization. Ends an MD4 message-digest operation, writing the + * message digest and zeroing the context + * @param digest The final MD4 digest + * @param context The MD4 content we are finalizing. + */ +APU_DECLARE(apr_status_t) apr_md4_final( + unsigned char digest[APR_MD4_DIGESTSIZE], + apr_md4_ctx_t *context); + +/** + * MD4 digest computation + * @param digest The MD4 digest + * @param input message block to use + * @param inputLen The length of the message block + */ +APU_DECLARE(apr_status_t) apr_md4(unsigned char digest[APR_MD4_DIGESTSIZE], + const unsigned char *input, + apr_size_t inputLen); + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* !APR_MD4_H */ diff --git a/include/apr_md5.h b/include/apr_md5.h new file mode 100644 index 00000000000..367324a761e --- /dev/null +++ b/include/apr_md5.h @@ -0,0 +1,162 @@ +/* + * This is work is derived from material Copyright RSA Data Security, Inc. + * + * The RSA copyright statement and Licence for that original material is + * included below. This is followed by the Apache copyright statement and + * licence for the modifications made to that material. + */ + +/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All + rights reserved. + + License to copy and use this software is granted provided that it + is identified as the "RSA Data Security, Inc. MD5 Message-Digest + Algorithm" in all material mentioning or referencing this software + or this function. + + License is also granted to make and use derivative works provided + that such works are identified as "derived from the RSA Data + Security, Inc. MD5 Message-Digest Algorithm" in all material + mentioning or referencing the derived work. + + RSA Data Security, Inc. makes no representations concerning either + the merchantability of this software or the suitability of this + software for any particular purpose. It is provided "as is" + without express or implied warranty of any kind. + + These notices must be retained in any copies of any part of this + documentation and/or software. + */ + +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_MD5_H +#define APR_MD5_H + +#include "apu.h" +#include "apr_xlate.h" + +#ifdef __cplusplus +extern "C" { +#endif +/** + * @file apr_md5.h + * @brief APR MD5 Routines + */ + +/** + * @defgroup APR_MD5 MD5 Routines + * @ingroup APR + * @{ + */ + +/** The MD5 digest size */ +#define APR_MD5_DIGESTSIZE 16 + +/** @see apr_md5_ctx_t */ +typedef struct apr_md5_ctx_t apr_md5_ctx_t; + +/** MD5 context. */ +struct apr_md5_ctx_t { + /** state (ABCD) */ + apr_uint32_t state[4]; + /** number of bits, modulo 2^64 (lsb first) */ + apr_uint32_t count[2]; + /** input buffer */ + unsigned char buffer[64]; + /** translation handle + * ignored if xlate is unsupported + */ + apr_xlate_t *xlate; +}; + +/** + * MD5 Initialize. Begins an MD5 operation, writing a new context. + * @param context The MD5 context to initialize. + */ +APU_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context); + +/** + * MD5 translation setup. Provides the APR translation handle to be used + * for translating the content before calculating the digest. + * @param context The MD5 content to set the translation for. + * @param xlate The translation handle to use for this MD5 context + */ +APU_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context, + apr_xlate_t *xlate); + +/** + * MD5 block update operation. Continue an MD5 message-digest operation, + * processing another message block, and updating the context. + * @param context The MD5 content to update. + * @param input next message block to update + * @param inputLen The length of the next message block + */ +APU_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context, + const void *input, + apr_size_t inputLen); + +/** + * MD5 finalization. Ends an MD5 message-digest operation, writing the + * message digest and zeroing the context + * @param digest The final MD5 digest + * @param context The MD5 content we are finalizing. + */ +APU_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[APR_MD5_DIGESTSIZE], + apr_md5_ctx_t *context); + +/** + * MD5 in one step + * @param digest The final MD5 digest + * @param input The message block to use + * @param inputLen The length of the message block + */ +APU_DECLARE(apr_status_t) apr_md5(unsigned char digest[APR_MD5_DIGESTSIZE], + const void *input, + apr_size_t inputLen); + +/** + * Encode a password using an MD5 algorithm + * @param password The password to encode + * @param salt The salt to use for the encoding + * @param result The string to store the encoded password in + * @param nbytes The size of the result buffer + */ +APU_DECLARE(apr_status_t) apr_md5_encode(const char *password, const char *salt, + char *result, apr_size_t nbytes); + + +/** + * Validate hashes created by APR-supported algorithms: md5 and sha1. + * hashes created by crypt are supported only on platforms that provide + * crypt(3), so don't rely on that function unless you know that your + * application will be run only on platforms that support it. On platforms + * that don't support crypt(3), this falls back to a clear text string + * comparison. + * @param passwd The password to validate + * @param hash The password to validate against + */ +APU_DECLARE(apr_status_t) apr_password_validate(const char *passwd, + const char *hash); + + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* !APR_MD5_H */ diff --git a/include/apr_memcache.h b/include/apr_memcache.h new file mode 100644 index 00000000000..499d2800eab --- /dev/null +++ b/include/apr_memcache.h @@ -0,0 +1,446 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_MEMCACHE_H +#define APR_MEMCACHE_H + +/** + * @file apr_memcache.h + * @brief Client interface for memcached + * @remark To use this interface you must have a separate memcached + * server running. See the memcached website at http://www.danga.com/memcached/ + * for more information. + */ + +#include "apr.h" +#include "apr_pools.h" +#include "apr_time.h" +#include "apr_strings.h" +#include "apr_network_io.h" +#include "apr_ring.h" +#include "apr_buckets.h" +#include "apr_reslist.h" +#include "apr_hash.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @defgroup APR_Util_MC Memcached Client Routines + * @ingroup APR_Util + * @{ + */ + +/** Specifies the status of a memcached server */ +typedef enum +{ + APR_MC_SERVER_LIVE, /**< Server is alive and responding to requests */ + APR_MC_SERVER_DEAD /**< Server is not responding to requests */ +} apr_memcache_server_status_t; + +/** Opaque memcache client connection object */ +typedef struct apr_memcache_conn_t apr_memcache_conn_t; + +/** Memcache Server Info Object */ +typedef struct apr_memcache_server_t apr_memcache_server_t; +struct apr_memcache_server_t +{ + const char *host; /**< Hostname of this Server */ + apr_port_t port; /**< Port of this Server */ + apr_memcache_server_status_t status; /**< @see apr_memcache_server_status_t */ +#if APR_HAS_THREADS || defined(DOXYGEN) + apr_reslist_t *conns; /**< Resource list of actual client connections */ +#else + apr_memcache_conn_t *conn; +#endif + apr_pool_t *p; /** Pool to use for private allocations */ +#if APR_HAS_THREADS + apr_thread_mutex_t *lock; +#endif + apr_time_t btime; +}; + +/* Custom hash callback function prototype, user for server selection. +* @param baton user selected baton +* @param data data to hash +* @param data_len length of data +*/ +typedef apr_uint32_t (*apr_memcache_hash_func)(void *baton, + const char *data, + const apr_size_t data_len); + +typedef struct apr_memcache_t apr_memcache_t; + +/* Custom Server Select callback function prototype. +* @param baton user selected baton +* @param mc memcache instance, use mc->live_servers to select a node +* @param hash hash of the selected key. +*/ +typedef apr_memcache_server_t* (*apr_memcache_server_func)(void *baton, + apr_memcache_t *mc, + const apr_uint32_t hash); + +/** Container for a set of memcached servers */ +struct apr_memcache_t +{ + apr_uint32_t flags; /**< Flags, Not currently used */ + apr_uint16_t nalloc; /**< Number of Servers Allocated */ + apr_uint16_t ntotal; /**< Number of Servers Added */ + apr_memcache_server_t **live_servers; /**< Array of Servers */ + apr_pool_t *p; /** Pool to use for allocations */ + void *hash_baton; + apr_memcache_hash_func hash_func; + void *server_baton; + apr_memcache_server_func server_func; +}; + +/** Returned Data from a multiple get */ +typedef struct +{ + apr_status_t status; + const char* key; + apr_size_t len; + char *data; + apr_uint16_t flags; +} apr_memcache_value_t; + +/** + * Creates a crc32 hash used to split keys between servers + * @param data Data to be hashed + * @param data_len Length of the data to use + * @return crc32 hash of data + * @remark The crc32 hash is not compatible with old memcached clients. + */ +APU_DECLARE(apr_uint32_t) apr_memcache_hash(apr_memcache_t *mc, + const char *data, + const apr_size_t data_len); + +/** + * Pure CRC32 Hash. Used by some clients. + */ +APU_DECLARE(apr_uint32_t) apr_memcache_hash_crc32(void *baton, + const char *data, + const apr_size_t data_len); + +/** + * hash compatible with the standard Perl Client. + */ +APU_DECLARE(apr_uint32_t) apr_memcache_hash_default(void *baton, + const char *data, + const apr_size_t data_len); + +/** + * Picks a server based on a hash + * @param mc The memcache client object to use + * @param hash Hashed value of a Key + * @return server that controls specified hash + * @see apr_memcache_hash + */ +APU_DECLARE(apr_memcache_server_t *) apr_memcache_find_server_hash(apr_memcache_t *mc, + const apr_uint32_t hash); + +/** + * server selection compatible with the standard Perl Client. + */ +APU_DECLARE(apr_memcache_server_t *) +apr_memcache_find_server_hash_default(void *baton, + apr_memcache_t *mc, + const apr_uint32_t hash); + +/** + * Adds a server to a client object + * @param mc The memcache client object to use + * @param ms Server to add + * @remark Adding servers is not thread safe, and should be done once at startup. + * @warning Changing servers after startup may cause keys to go to + * different servers. + */ +APU_DECLARE(apr_status_t) apr_memcache_add_server(apr_memcache_t *mc, + apr_memcache_server_t *server); + + +/** + * Finds a Server object based on a hostname/port pair + * @param mc The memcache client object to use + * @param host Hostname of the server + * @param port Port of the server + * @return Server with matching Hostname and Port, or NULL if none was found. + */ +APU_DECLARE(apr_memcache_server_t *) apr_memcache_find_server(apr_memcache_t *mc, + const char *host, + apr_port_t port); + +/** + * Enables a Server for use again + * @param mc The memcache client object to use + * @param ms Server to Activate + */ +APU_DECLARE(apr_status_t) apr_memcache_enable_server(apr_memcache_t *mc, + apr_memcache_server_t *ms); + + +/** + * Disable a Server + * @param mc The memcache client object to use + * @param ms Server to Disable + */ +APU_DECLARE(apr_status_t) apr_memcache_disable_server(apr_memcache_t *mc, + apr_memcache_server_t *ms); + +/** + * Creates a new Server Object + * @param p Pool to use + * @param host hostname of the server + * @param port port of the server + * @param min minimum number of client sockets to open + * @param smax soft maximum number of client connections to open + * @param max hard maximum number of client connections + * @param ttl time to live in seconds of a client connection + * @param ns location of the new server object + * @see apr_reslist_create + * @remark min, smax, and max are only used when APR_HAS_THREADS + */ +APU_DECLARE(apr_status_t) apr_memcache_server_create(apr_pool_t *p, + const char *host, + apr_port_t port, + apr_uint32_t min, + apr_uint32_t smax, + apr_uint32_t max, + apr_uint32_t ttl, + apr_memcache_server_t **ns); +/** + * Creates a new memcached client object + * @param p Pool to use + * @param max_servers maximum number of servers + * @param flags Not currently used + * @param mc location of the new memcache client object + */ +APU_DECLARE(apr_status_t) apr_memcache_create(apr_pool_t *p, + apr_uint16_t max_servers, + apr_uint32_t flags, + apr_memcache_t **mc); + +/** + * Gets a value from the server, allocating the value out of p + * @param mc client to use + * @param p Pool to use + * @param key null terminated string containing the key + * @param baton location of the allocated value + * @param len length of data at baton + * @param flags any flags set by the client for this key + * @return + */ +APU_DECLARE(apr_status_t) apr_memcache_getp(apr_memcache_t *mc, + apr_pool_t *p, + const char* key, + char **baton, + apr_size_t *len, + apr_uint16_t *flags); + + +/** + * Add a key to a hash for a multiget query + * if the hash (*value) is NULL it will be created + * @param data_pool pool from where the hash and their items are created from + * @param key null terminated string containing the key + * @param values hash of keys and values that this key will be added to + * @return + */ +APU_DECLARE(void) +apr_memcache_add_multget_key(apr_pool_t *data_pool, + const char* key, + apr_hash_t **values); + +/** + * Gets multiple values from the server, allocating the values out of p + * @param mc client to use + * @param temp_pool Pool used for tempoary allocations. May be cleared inside this + * call. + * @param data_pool Pool used to allocate data for the returned values. + * @param values hash of apr_memcache_value_t keyed by strings, contains the + * result of the multiget call. + * @return + */ +APU_DECLARE(apr_status_t) +apr_memcache_multgetp(apr_memcache_t *mc, + apr_pool_t *temp_pool, + apr_pool_t *data_pool, + apr_hash_t *values); + +/** + * Sets a value by key on the server + * @param mc client to use + * @param key null terminated string containing the key + * @param baton data to store on the server + * @param len length of data at baton + * @param timeout time in seconds for the data to live on the server + * @param flags any flags set by the client for this key + */ +APU_DECLARE(apr_status_t) apr_memcache_set(apr_memcache_t *mc, + const char *key, + char *baton, + const apr_size_t data_size, + apr_uint32_t timeout, + apr_uint16_t flags); + +/** + * Adds value by key on the server + * @param mc client to use + * @param key null terminated string containing the key + * @param baton data to store on the server + * @param len length of data at baton + * @param timeout time for the data to live on the server + * @param flags any flags set by the client for this key + * @return APR_SUCCESS if the key was added, APR_EEXIST if the key + * already exists on the server. + */ +APU_DECLARE(apr_status_t) apr_memcache_add(apr_memcache_t *mc, + const char *key, + char *baton, + const apr_size_t data_size, + apr_uint32_t timeout, + apr_uint16_t flags); + +/** + * Replaces value by key on the server + * @param mc client to use + * @param key null terminated string containing the key + * @param baton data to store on the server + * @param len length of data at baton + * @param timeout time for the data to live on the server + * @param flags any flags set by the client for this key + * @return APR_SUCCESS if the key was added, APR_EEXIST if the key + * did not exist on the server. + */ +APU_DECLARE(apr_status_t) apr_memcache_replace(apr_memcache_t *mc, + const char *key, + char *data, + const apr_size_t data_size, + apr_uint32_t timeout, + apr_uint16_t flags); +/** + * Deletes a key from a server + * @param mc client to use + * @param key null terminated string containing the key + * @param timeout time for the delete to stop other clients from adding + */ +APU_DECLARE(apr_status_t) apr_memcache_delete(apr_memcache_t *mc, + const char *key, + apr_uint32_t timeout); + +/** + * Increments a value + * @param mc client to use + * @param key null terminated string containing the key + * @param n number to increment by + * @param nv new value after incrmenting + */ +APU_DECLARE(apr_status_t) apr_memcache_incr(apr_memcache_t *mc, + const char *key, + apr_int32_t n, + apr_uint32_t *nv); + +/** + * Decrements a value + * @param mc client to use + * @param key null terminated string containing the key + * @param n number to decrement by + * @param nv new value after decrementing + */ +APU_DECLARE(apr_status_t) apr_memcache_decr(apr_memcache_t *mc, + const char *key, + apr_int32_t n, + apr_uint32_t *new_value); + +/** + * Query a server's version + * @param ms server to query + * @param p Pool to allocate answer from + * @param baton location to store server version string + * @param len length of the server version string + */ +APU_DECLARE(apr_status_t) apr_memcache_version(apr_memcache_server_t *ms, + apr_pool_t *p, + char **baton); + +typedef struct +{ + /** Version string of this server */ + const char *version; + /** Process id of this server process */ + apr_uint32_t pid; + /** Number of seconds this server has been running */ + apr_uint32_t uptime; + /** current UNIX time according to the server */ + apr_time_t time; + /** The size of a pointer on the current machine */ + apr_uint32_t pointer_size; + /** Accumulated user time for this process */ + apr_time_t rusage_user; + /** Accumulated system time for this process */ + apr_time_t rusage_system; + /** Current number of items stored by the server */ + apr_uint32_t curr_items; + /** Total number of items stored by this server */ + apr_uint32_t total_items; + /** Current number of bytes used by this server to store items */ + apr_uint64_t bytes; + /** Number of open connections */ + apr_uint32_t curr_connections; + /** Total number of connections opened since the server started running */ + apr_uint32_t total_connections; + /** Number of connection structures allocated by the server */ + apr_uint32_t connection_structures; + /** Cumulative number of retrieval requests */ + apr_uint32_t cmd_get; + /** Cumulative number of storage requests */ + apr_uint32_t cmd_set; + /** Number of keys that have been requested and found present */ + apr_uint32_t get_hits; + /** Number of items that have been requested and not found */ + apr_uint32_t get_misses; + /** Number of items removed from cache because they passed their + expiration time */ + apr_uint64_t evictions; + /** Total number of bytes read by this server */ + apr_uint64_t bytes_read; + /** Total number of bytes sent by this server */ + apr_uint64_t bytes_written; + /** Number of bytes this server is allowed to use for storage. */ + apr_uint32_t limit_maxbytes; + /** Number of threads the server is running (if built with threading) */ + apr_uint32_t threads; +} apr_memcache_stats_t; + +/** + * Query a server for statistics + * @param ms server to query + * @param p Pool to allocate answer from + * @param stats location of the new statistics structure + */ +APU_DECLARE(apr_status_t) apr_memcache_stats(apr_memcache_server_t *ms, + apr_pool_t *p, + apr_memcache_stats_t **stats); + + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* APR_MEMCACHE_H */ diff --git a/include/apr_optional.h b/include/apr_optional.h new file mode 100644 index 00000000000..3301d66e6d9 --- /dev/null +++ b/include/apr_optional.h @@ -0,0 +1,92 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_OPTIONAL_H +#define APR_OPTIONAL_H + +#include "apu.h" +/** + * @file apr_optional.h + * @brief APR-UTIL registration of functions exported by modules + */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup APR_Util_Opt Optional Functions + * @ingroup APR_Util + * + * Typesafe registration and retrieval of functions that may not be present + * (i.e. functions exported by optional modules) + * @{ + */ + +/** + * The type of an optional function. + * @param name The name of the function + */ +#define APR_OPTIONAL_FN_TYPE(name) apr_OFN_##name##_t + +/** + * Declare an optional function. + * @param ret The return type of the function + * @param name The name of the function + * @param args The function arguments (including brackets) + */ +#define APR_DECLARE_OPTIONAL_FN(ret,name,args) \ +typedef ret (APR_OPTIONAL_FN_TYPE(name)) args + +/** + * XXX: This doesn't belong here, then! + * Private function! DO NOT USE! + * @internal + */ + +typedef void (apr_opt_fn_t)(void); +/** @internal */ +APU_DECLARE_NONSTD(void) apr_dynamic_fn_register(const char *szName, + apr_opt_fn_t *pfn); + +/** + * Register an optional function. This can be later retrieved, type-safely, by + * name. Like all global functions, the name must be unique. Note that, + * confusingly but correctly, the function itself can be static! + * @param name The name of the function + */ +#define APR_REGISTER_OPTIONAL_FN(name) do { \ + APR_OPTIONAL_FN_TYPE(name) *apu__opt = name; \ + apr_dynamic_fn_register(#name,(apr_opt_fn_t *)apu__opt); \ +} while (0) + +/** @internal + * Private function! DO NOT USE! + */ +APU_DECLARE(apr_opt_fn_t *) apr_dynamic_fn_retrieve(const char *szName); + +/** + * Retrieve an optional function. Returns NULL if the function is not present. + * @param name The name of the function + */ +#define APR_RETRIEVE_OPTIONAL_FN(name) \ + (APR_OPTIONAL_FN_TYPE(name) *)apr_dynamic_fn_retrieve(#name) + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* APR_OPTIONAL_H */ diff --git a/include/apr_optional_hooks.h b/include/apr_optional_hooks.h new file mode 100644 index 00000000000..54bf65effab --- /dev/null +++ b/include/apr_optional_hooks.h @@ -0,0 +1,117 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file apr_optional_hooks.h + * @brief Apache optional hook functions + */ + + +#ifndef APR_OPTIONAL_HOOK_H +#define APR_OPTIONAL_HOOK_H + +#include "apr_tables.h" + +#ifdef __cplusplus +extern "C" { +#endif +/** + * @defgroup APR_Util_OPT_HOOK Optional Hook Functions + * @ingroup APR_Util_Hook + * @{ + */ +/** + * Function to implemnt the APR_OPTIONAL_HOOK Macro + * @internal + * @see APR_OPTIONAL_HOOK + * + * @param name The name of the hook + * @param pfn A pointer to a function that will be called + * @param aszPre a NULL-terminated array of strings that name modules whose hooks should precede this one + * @param aszSucc a NULL-terminated array of strings that name modules whose hooks should succeed this one + * @param nOrder an integer determining order before honouring aszPre and aszSucc (for example HOOK_MIDDLE) + */ + + +APU_DECLARE(void) apr_optional_hook_add(const char *szName,void (*pfn)(void), + const char * const *aszPre, + const char * const *aszSucc, + int nOrder); + +/** + * Hook to an optional hook. + * + * @param ns The namespace prefix of the hook functions + * @param name The name of the hook + * @param pfn A pointer to a function that will be called + * @param aszPre a NULL-terminated array of strings that name modules whose hooks should precede this one + * @param aszSucc a NULL-terminated array of strings that name modules whose hooks should succeed this one + * @param nOrder an integer determining order before honouring aszPre and aszSucc (for example HOOK_MIDDLE) + */ + +#define APR_OPTIONAL_HOOK(ns,name,pfn,aszPre,aszSucc,nOrder) do { \ + ns##_HOOK_##name##_t *apu__hook = pfn; \ + apr_optional_hook_add(#name,(void (*)(void))apu__hook,aszPre, aszSucc, nOrder); \ +} while (0) + +/** + * @internal + * @param szName - the name of the function + * @return the hook structure for a given hook + */ +APU_DECLARE(apr_array_header_t *) apr_optional_hook_get(const char *szName); + +/** + * Implement an optional hook that runs until one of the functions + * returns something other than OK or DECLINE. + * + * @param ns The namespace prefix of the hook functions + * @param link The linkage declaration prefix of the hook + * @param ret The type of the return value of the hook + * @param ret The type of the return value of the hook + * @param name The name of the hook + * @param args_decl The declaration of the arguments for the hook + * @param args_use The names for the arguments for the hook + * @param ok Success value + * @param decline Decline value + */ +#define APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ns,link,ret,name,args_decl,args_use,ok,decline) \ +link##_DECLARE(ret) ns##_run_##name args_decl \ + { \ + ns##_LINK_##name##_t *pHook; \ + int n; \ + ret rv; \ + apr_array_header_t *pHookArray=apr_optional_hook_get(#name); \ +\ + if(!pHookArray) \ + return ok; \ +\ + pHook=(ns##_LINK_##name##_t *)pHookArray->elts; \ + for(n=0 ; n < pHookArray->nelts ; ++n) \ + { \ + rv=(pHook[n].pFunc)args_use; \ +\ + if(rv != ok && rv != decline) \ + return rv; \ + } \ + return ok; \ + } + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* APR_OPTIONAL_HOOK_H */ diff --git a/include/apr_queue.h b/include/apr_queue.h new file mode 100644 index 00000000000..5d24c67cba0 --- /dev/null +++ b/include/apr_queue.h @@ -0,0 +1,138 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_QUEUE_H +#define APR_QUEUE_H + +/** + * @file apr_queue.h + * @brief Thread Safe FIFO bounded queue + * @note Since most implementations of the queue are backed by a condition + * variable implementation, it isn't available on systems without threads. + * Although condition variables are some times available without threads. + */ + +#include "apu.h" +#include "apr_errno.h" +#include "apr_pools.h" + +#if APR_HAS_THREADS + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @defgroup APR_Util_FIFO Thread Safe FIFO bounded queue + * @ingroup APR_Util + * @{ + */ + +/** + * opaque structure + */ +typedef struct apr_queue_t apr_queue_t; + +/** + * create a FIFO queue + * @param queue The new queue + * @param queue_capacity maximum size of the queue + * @param a pool to allocate queue from + */ +APU_DECLARE(apr_status_t) apr_queue_create(apr_queue_t **queue, + unsigned int queue_capacity, + apr_pool_t *a); + +/** + * push/add a object to the queue, blocking if the queue is already full + * + * @param queue the queue + * @param data the data + * @returns APR_EINTR the blocking was interrupted (try again) + * @returns APR_EOF the queue has been terminated + * @returns APR_SUCCESS on a successfull push + */ +APU_DECLARE(apr_status_t) apr_queue_push(apr_queue_t *queue, void *data); + +/** + * pop/get an object from the queue, blocking if the queue is already empty + * + * @param queue the queue + * @param data the data + * @returns APR_EINTR the blocking was interrupted (try again) + * @returns APR_EOF if the queue has been terminated + * @returns APR_SUCCESS on a successfull pop + */ +APU_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data); + +/** + * push/add a object to the queue, returning immediatly if the queue is full + * + * @param queue the queue + * @param data the data + * @returns APR_EINTR the blocking operation was interrupted (try again) + * @returns APR_EAGAIN the queue is full + * @returns APR_EOF the queue has been terminated + * @returns APR_SUCCESS on a successfull push + */ +APU_DECLARE(apr_status_t) apr_queue_trypush(apr_queue_t *queue, void *data); + +/** + * pop/get an object to the queue, returning immediatly if the queue is empty + * + * @param queue the queue + * @param data the data + * @returns APR_EINTR the blocking operation was interrupted (try again) + * @returns APR_EAGAIN the queue is empty + * @returns APR_EOF the queue has been terminated + * @returns APR_SUCCESS on a successfull push + */ +APU_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data); + +/** + * returns the size of the queue. + * + * @warning this is not threadsafe, and is intended for reporting/monitoring + * of the queue. + * @param queue the queue + * @returns the size of the queue + */ +APU_DECLARE(unsigned int) apr_queue_size(apr_queue_t *queue); + +/** + * interrupt all the threads blocking on this queue. + * + * @param queue the queue + */ +APU_DECLARE(apr_status_t) apr_queue_interrupt_all(apr_queue_t *queue); + +/** + * terminate all queue, sendinging a interupt to all the + * blocking threads + * + * @param queue the queue + */ +APU_DECLARE(apr_status_t) apr_queue_term(apr_queue_t *queue); + +#ifdef __cplusplus +} +#endif + +/** @} */ + +#endif /* APR_HAS_THREADS */ + +#endif /* APRQUEUE_H */ diff --git a/include/apr_reslist.h b/include/apr_reslist.h new file mode 100644 index 00000000000..ad27d80cdfb --- /dev/null +++ b/include/apr_reslist.h @@ -0,0 +1,174 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_RESLIST_H +#define APR_RESLIST_H + +/** + * @file apr_reslist.h + * @brief APR-UTIL Resource List Routines + */ + +#include "apr.h" +#include "apu.h" +#include "apr_pools.h" +#include "apr_errno.h" +#include "apr_time.h" + +/** + * @defgroup APR_Util_RL Resource List Routines + * @ingroup APR_Util + * @{ + */ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** Opaque resource list object */ +typedef struct apr_reslist_t apr_reslist_t; + +/* Generic constructor called by resource list when it needs to create a + * resource. + * @param resource opaque resource + * @param param flags + * @param pool Pool + */ +typedef apr_status_t (*apr_reslist_constructor)(void **resource, void *params, + apr_pool_t *pool); + +/* Generic destructor called by resource list when it needs to destroy a + * resource. + * @param resource opaque resource + * @param param flags + * @param pool Pool + */ +typedef apr_status_t (*apr_reslist_destructor)(void *resource, void *params, + apr_pool_t *pool); + +/* Cleanup order modes */ +#define APR_RESLIST_CLEANUP_DEFAULT 0 /**< default pool cleanup */ +#define APR_RESLIST_CLEANUP_FIRST 1 /**< use pool pre cleanup */ + +/** + * Create a new resource list with the following parameters: + * @param reslist An address where the pointer to the new resource + * list will be stored. + * @param min Allowed minimum number of available resources. Zero + * creates new resources only when needed. + * @param smax Resources will be destroyed to meet this maximum + * restriction as they expire. + * @param hmax Absolute maximum limit on the number of total resources. + * @param ttl If non-zero, sets the maximum amount of time a resource + * may be available while exceeding the soft limit. + * @param con Constructor routine that is called to create a new resource. + * @param de Destructor routine that is called to destroy an expired resource. + * @param params Passed to constructor and deconstructor + * @param pool The pool from which to create this resoure list. Also the + * same pool that is passed to the constructor and destructor + * routines. + * @remark If APR has been compiled without thread support, hmax will be + * automatically set to 1 and values of min and smax will be forced to + * 1 for any non-zero value. + */ +APU_DECLARE(apr_status_t) apr_reslist_create(apr_reslist_t **reslist, + int min, int smax, int hmax, + apr_interval_time_t ttl, + apr_reslist_constructor con, + apr_reslist_destructor de, + void *params, + apr_pool_t *pool); + +/** + * Destroy the given resource list and all resources controlled by + * this list. + * FIXME: Should this block until all resources become available, + * or maybe just destroy all the free ones, or maybe destroy + * them even though they might be in use by something else? + * Currently it will abort if there are resources that haven't + * been released, so there is an assumption that all resources + * have been released to the list before calling this function. + * @param reslist The reslist to destroy + */ +APU_DECLARE(apr_status_t) apr_reslist_destroy(apr_reslist_t *reslist); + +/** + * Retrieve a resource from the list, creating a new one if necessary. + * If we have met our maximum number of resources, we will block + * until one becomes available. + */ +APU_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, + void **resource); + +/** + * Return a resource back to the list of available resources. + */ +APU_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, + void *resource); + +/** + * Set the timeout the acquire will wait for a free resource + * when the maximum number of resources is exceeded. + * @param reslist The resource list. + * @param timeout Timeout to wait. The zero waits forewer. + */ +APU_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, + apr_interval_time_t timeout); + +/** + * Return the number of outstanding resources. + * @param reslist The resource list. + */ +APU_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist); + +/** + * Invalidate a resource in the pool - e.g. a database connection + * that returns a "lost connection" error and can't be restored. + * Use this instead of apr_reslist_release if the resource is bad. + */ +APU_DECLARE(apr_status_t) apr_reslist_invalidate(apr_reslist_t *reslist, + void *resource); + +/** + * Perform routine maintenance on the resource list. This call + * may instantiate new resources or expire old resources. + * @param reslist The resource list. + */ +APU_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist); + +/** + * Set reslist cleanup order. + * @param reslist The resource list. + * @param mode Cleanup order mode + *
    + *           APR_RESLIST_CLEANUP_DEFAULT  default pool cleanup order
    + *           APR_RESLIST_CLEANUP_FIRST    use pool pre cleanup
    + * 
    + * @remark If APR_RESLIST_CLEANUP_FIRST is used the destructors will + * be called before child pools of the pool used to create the reslist + * are destroyed. This allows to explicitly destroy the child pools + * inside reslist destructors. + */ +APU_DECLARE(void) apr_reslist_cleanup_order_set(apr_reslist_t *reslist, + apr_uint32_t mode); + +#ifdef __cplusplus +} +#endif + +/** @} */ + +#endif /* ! APR_RESLIST_H */ diff --git a/include/apr_rmm.h b/include/apr_rmm.h new file mode 100644 index 00000000000..976fe9c59eb --- /dev/null +++ b/include/apr_rmm.h @@ -0,0 +1,137 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_RMM_H +#define APR_RMM_H +/** + * @file apr_rmm.h + * @brief APR-UTIL Relocatable Memory Management Routines + */ +/** + * @defgroup APR_Util_RMM Relocatable Memory Management Routines + * @ingroup APR_Util + * @{ + */ + +#include "apr.h" +#include "apr_pools.h" +#include "apr_errno.h" +#include "apu.h" +#include "apr_anylock.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** Structure to access Relocatable, Managed Memory */ +typedef struct apr_rmm_t apr_rmm_t; + +/** Fundamental allocation unit, within a specific apr_rmm_t */ +typedef apr_size_t apr_rmm_off_t; + +/** + * Initialize a relocatable memory block to be managed by the apr_rmm API. + * @param rmm The relocatable memory block + * @param lock An apr_anylock_t of the appropriate type of lock, or NULL + * if no locking is required. + * @param membuf The block of relocatable memory to be managed + * @param memsize The size of relocatable memory block to be managed + * @param cont The pool to use for local storage and management + * @remark Both @param membuf and @param memsize must be aligned + * (for instance using APR_ALIGN_DEFAULT). + */ +APU_DECLARE(apr_status_t) apr_rmm_init(apr_rmm_t **rmm, apr_anylock_t *lock, + void *membuf, apr_size_t memsize, + apr_pool_t *cont); + +/** + * Destroy a managed memory block. + * @param rmm The relocatable memory block to destroy + */ +APU_DECLARE(apr_status_t) apr_rmm_destroy(apr_rmm_t *rmm); + +/** + * Attach to a relocatable memory block already managed by the apr_rmm API. + * @param rmm The relocatable memory block + * @param lock An apr_anylock_t of the appropriate type of lock + * @param membuf The block of relocatable memory already under management + * @param cont The pool to use for local storage and management + */ +APU_DECLARE(apr_status_t) apr_rmm_attach(apr_rmm_t **rmm, apr_anylock_t *lock, + void *membuf, apr_pool_t *cont); + +/** + * Detach from the managed block of memory. + * @param rmm The relocatable memory block to detach from + */ +APU_DECLARE(apr_status_t) apr_rmm_detach(apr_rmm_t *rmm); + +/** + * Allocate memory from the block of relocatable memory. + * @param rmm The relocatable memory block + * @param reqsize How much memory to allocate + */ +APU_DECLARE(apr_rmm_off_t) apr_rmm_malloc(apr_rmm_t *rmm, apr_size_t reqsize); + +/** + * Realloc memory from the block of relocatable memory. + * @param rmm The relocatable memory block + * @param entity The memory allocation to realloc + * @param reqsize The new size + */ +APU_DECLARE(apr_rmm_off_t) apr_rmm_realloc(apr_rmm_t *rmm, void *entity, apr_size_t reqsize); + +/** + * Allocate memory from the block of relocatable memory and initialize it to zero. + * @param rmm The relocatable memory block + * @param reqsize How much memory to allocate + */ +APU_DECLARE(apr_rmm_off_t) apr_rmm_calloc(apr_rmm_t *rmm, apr_size_t reqsize); + +/** + * Free allocation returned by apr_rmm_malloc or apr_rmm_calloc. + * @param rmm The relocatable memory block + * @param entity The memory allocation to free + */ +APU_DECLARE(apr_status_t) apr_rmm_free(apr_rmm_t *rmm, apr_rmm_off_t entity); + +/** + * Retrieve the physical address of a relocatable allocation of memory + * @param rmm The relocatable memory block + * @param entity The memory allocation to free + * @return address The address, aligned with APR_ALIGN_DEFAULT. + */ +APU_DECLARE(void *) apr_rmm_addr_get(apr_rmm_t *rmm, apr_rmm_off_t entity); + +/** + * Compute the offset of a relocatable allocation of memory + * @param rmm The relocatable memory block + * @param entity The physical address to convert to an offset + */ +APU_DECLARE(apr_rmm_off_t) apr_rmm_offset_get(apr_rmm_t *rmm, void *entity); + +/** + * Compute the required overallocation of memory needed to fit n allocs + * @param n The number of alloc/calloc regions desired + */ +APU_DECLARE(apr_size_t) apr_rmm_overhead_get(int n); + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif /* ! APR_RMM_H */ + diff --git a/include/apr_sdbm.h b/include/apr_sdbm.h new file mode 100644 index 00000000000..5759508b143 --- /dev/null +++ b/include/apr_sdbm.h @@ -0,0 +1,176 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * sdbm - ndbm work-alike hashed database library + * based on Per-Ake Larson's Dynamic Hashing algorithms. BIT 18 (1978). + * author: oz@nexus.yorku.ca + * status: ex-public domain + */ + +#ifndef APR_SDBM_H +#define APR_SDBM_H + +#include "apu.h" +#include "apr_errno.h" +#include "apr_file_io.h" /* for apr_fileperms_t */ + +/** + * @file apr_sdbm.h + * @brief apr-util SDBM library + */ +/** + * @defgroup APR_Util_DBM_SDBM SDBM library + * @ingroup APR_Util_DBM + * @{ + */ + +/** + * Structure for referencing an sdbm + */ +typedef struct apr_sdbm_t apr_sdbm_t; + +/** + * Structure for referencing the datum record within an sdbm + */ +typedef struct { + /** pointer to the data stored/retrieved */ + char *dptr; + /** size of data */ + /* apr_ssize_t for release 2.0??? */ + int dsize; +} apr_sdbm_datum_t; + +/* The extensions used for the database files */ +/** SDBM Directory file extension */ +#define APR_SDBM_DIRFEXT ".dir" +/** SDBM page file extension */ +#define APR_SDBM_PAGFEXT ".pag" + +/* flags to sdbm_store */ +#define APR_SDBM_INSERT 0 /**< Insert */ +#define APR_SDBM_REPLACE 1 /**< Replace */ +#define APR_SDBM_INSERTDUP 2 /**< Insert with duplicates */ + +/** + * Open an sdbm database by file name + * @param db The newly opened database + * @param name The sdbm file to open + * @param mode The flag values (APR_READ and APR_BINARY flags are implicit) + *
    + *           APR_WRITE          open for read-write access
    + *           APR_CREATE         create the sdbm if it does not exist
    + *           APR_TRUNCATE       empty the contents of the sdbm
    + *           APR_EXCL           fail for APR_CREATE if the file exists
    + *           APR_DELONCLOSE     delete the sdbm when closed
    + *           APR_SHARELOCK      support locking across process/machines
    + * 
    + * @param perms Permissions to apply to if created + * @param p The pool to use when creating the sdbm + * @remark The sdbm name is not a true file name, as sdbm appends suffixes + * for seperate data and index files. + */ +APU_DECLARE(apr_status_t) apr_sdbm_open(apr_sdbm_t **db, const char *name, + apr_int32_t mode, + apr_fileperms_t perms, apr_pool_t *p); + +/** + * Close an sdbm file previously opened by apr_sdbm_open + * @param db The database to close + */ +APU_DECLARE(apr_status_t) apr_sdbm_close(apr_sdbm_t *db); + +/** + * Lock an sdbm database for concurency of multiple operations + * @param db The database to lock + * @param type The lock type + *
    + *           APR_FLOCK_SHARED
    + *           APR_FLOCK_EXCLUSIVE
    + * 
    + * @remark Calls to apr_sdbm_lock may be nested. All apr_sdbm functions + * perform implicit locking. Since an APR_FLOCK_SHARED lock cannot be + * portably promoted to an APR_FLOCK_EXCLUSIVE lock, apr_sdbm_store and + * apr_sdbm_delete calls will fail if an APR_FLOCK_SHARED lock is held. + * The apr_sdbm_lock call requires the database to be opened with the + * APR_SHARELOCK mode value. + */ +APU_DECLARE(apr_status_t) apr_sdbm_lock(apr_sdbm_t *db, int type); + +/** + * Release an sdbm lock previously aquired by apr_sdbm_lock + * @param db The database to unlock + */ +APU_DECLARE(apr_status_t) apr_sdbm_unlock(apr_sdbm_t *db); + +/** + * Fetch an sdbm record value by key + * @param db The database + * @param value The value datum retrieved for this record + * @param key The key datum to find this record + */ +APU_DECLARE(apr_status_t) apr_sdbm_fetch(apr_sdbm_t *db, + apr_sdbm_datum_t *value, + apr_sdbm_datum_t key); + +/** + * Store an sdbm record value by key + * @param db The database + * @param key The key datum to store this record by + * @param value The value datum to store in this record + * @param opt The method used to store the record + *
    + *           APR_SDBM_INSERT     return an error if the record exists
    + *           APR_SDBM_REPLACE    overwrite any existing record for key
    + * 
    + */ +APU_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key, + apr_sdbm_datum_t value, int opt); + +/** + * Delete an sdbm record value by key + * @param db The database + * @param key The key datum of the record to delete + * @remark It is not an error to delete a non-existent record. + */ +APU_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db, + const apr_sdbm_datum_t key); + +/** + * Retrieve the first record key from a dbm + * @param db The database + * @param key The key datum of the first record + * @remark The keys returned are not ordered. To traverse the list of keys + * for an sdbm opened with APR_SHARELOCK, the caller must use apr_sdbm_lock + * prior to retrieving the first record, and hold the lock until after the + * last call to apr_sdbm_nextkey. + */ +APU_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db, apr_sdbm_datum_t *key); + +/** + * Retrieve the next record key from an sdbm + * @param db The database + * @param key The key datum of the next record + */ +APU_DECLARE(apr_status_t) apr_sdbm_nextkey(apr_sdbm_t *db, apr_sdbm_datum_t *key); + +/** + * Returns true if the sdbm database opened for read-only access + * @param db The database to test + */ +APU_DECLARE(int) apr_sdbm_rdonly(apr_sdbm_t *db); +/** @} */ +#endif /* APR_SDBM_H */ diff --git a/include/apr_sha1.h b/include/apr_sha1.h new file mode 100644 index 00000000000..2a4edf36808 --- /dev/null +++ b/include/apr_sha1.h @@ -0,0 +1,121 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* NIST Secure Hash Algorithm + * heavily modified by Uwe Hollerbach uh@alumni.caltech edu + * from Peter C. Gutmann's implementation as found in + * Applied Cryptography by Bruce Schneier + * This code is hereby placed in the public domain + */ + +#ifndef APR_SHA1_H +#define APR_SHA1_H + +#include "apu.h" +#include "apr_general.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file apr_sha1.h + * @brief APR-UTIL SHA1 library + */ + +/** size of the SHA1 DIGEST */ +#define APR_SHA1_DIGESTSIZE 20 + +/** + * Define the Magic String prefix that identifies a password as being + * hashed using our algorithm. + */ +#define APR_SHA1PW_ID "{SHA}" + +/** length of the SHA Password */ +#define APR_SHA1PW_IDLEN 5 + +/** @see apr_sha1_ctx_t */ +typedef struct apr_sha1_ctx_t apr_sha1_ctx_t; + +/** + * SHA1 context structure + */ +struct apr_sha1_ctx_t { + /** message digest */ + apr_uint32_t digest[5]; + /** 64-bit bit counts */ + apr_uint32_t count_lo, count_hi; + /** SHA data buffer */ + apr_uint32_t data[16]; + /** unprocessed amount in data */ + int local; +}; + +/** + * Provide a means to SHA1 crypt/encode a plaintext password in a way which + * makes password file compatible with those commonly use in netscape web + * and ldap installations. + * @param clear The plaintext password + * @param len The length of the plaintext password + * @param out The encrypted/encoded password + * @note SHA1 support is useful for migration purposes, but is less + * secure than Apache's password format, since Apache's (MD5) + * password format uses a random eight character salt to generate + * one of many possible hashes for the same password. Netscape + * uses plain SHA1 without a salt, so the same password + * will always generate the same hash, making it easier + * to break since the search space is smaller. + */ +APU_DECLARE(void) apr_sha1_base64(const char *clear, int len, char *out); + +/** + * Initialize the SHA digest + * @param context The SHA context to initialize + */ +APU_DECLARE(void) apr_sha1_init(apr_sha1_ctx_t *context); + +/** + * Update the SHA digest + * @param context The SHA1 context to update + * @param input The buffer to add to the SHA digest + * @param inputLen The length of the input buffer + */ +APU_DECLARE(void) apr_sha1_update(apr_sha1_ctx_t *context, const char *input, + unsigned int inputLen); + +/** + * Update the SHA digest with binary data + * @param context The SHA1 context to update + * @param input The buffer to add to the SHA digest + * @param inputLen The length of the input buffer + */ +APU_DECLARE(void) apr_sha1_update_binary(apr_sha1_ctx_t *context, + const unsigned char *input, + unsigned int inputLen); + +/** + * Finish computing the SHA digest + * @param digest the output buffer in which to store the digest + * @param context The context to finalize + */ +APU_DECLARE(void) apr_sha1_final(unsigned char digest[APR_SHA1_DIGESTSIZE], + apr_sha1_ctx_t *context); + +#ifdef __cplusplus +} +#endif + +#endif /* APR_SHA1_H */ diff --git a/include/apr_strmatch.h b/include/apr_strmatch.h new file mode 100644 index 00000000000..53fadad5696 --- /dev/null +++ b/include/apr_strmatch.h @@ -0,0 +1,81 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_STRMATCH_H +#define APR_STRMATCH_H +/** + * @file apr_strmatch.h + * @brief APR-UTIL string matching routines + */ + +#include "apu.h" +#include "apr_pools.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup APR_Util_StrMatch String matching routines + * @ingroup APR_Util + * @{ + */ + +/** @see apr_strmatch_pattern */ +typedef struct apr_strmatch_pattern apr_strmatch_pattern; + +/** + * Precompiled search pattern + */ +struct apr_strmatch_pattern { + /** Function called to compare */ + const char *(*compare)(const apr_strmatch_pattern *this_pattern, + const char *s, apr_size_t slen); + const char *pattern; /**< Current pattern */ + apr_size_t length; /**< Current length */ + void *context; /**< hook to add precomputed metadata */ +}; + +#if defined(DOXYGEN) +/** + * Search for a precompiled pattern within a string + * @param pattern The pattern + * @param s The string in which to search for the pattern + * @param slen The length of s (excluding null terminator) + * @return A pointer to the first instance of the pattern in s, or + * NULL if not found + */ +APU_DECLARE(const char *) apr_strmatch(const apr_strmatch_pattern *pattern, + const char *s, apr_size_t slen); +#else +#define apr_strmatch(pattern, s, slen) (*((pattern)->compare))((pattern), (s), (slen)) +#endif + +/** + * Precompile a pattern for matching using the Boyer-Moore-Horspool algorithm + * @param p The pool from which to allocate the pattern + * @param s The pattern string + * @param case_sensitive Whether the matching should be case-sensitive + * @return a pointer to the compiled pattern, or NULL if compilation fails + */ +APU_DECLARE(const apr_strmatch_pattern *) apr_strmatch_precompile(apr_pool_t *p, const char *s, int case_sensitive); + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* !APR_STRMATCH_H */ diff --git a/include/apr_thread_pool.h b/include/apr_thread_pool.h new file mode 100644 index 00000000000..cbf382b3da2 --- /dev/null +++ b/include/apr_thread_pool.h @@ -0,0 +1,299 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +#ifndef APU_THREAD_POOL_H +#define APU_THREAD_POOL_H + +#include "apu.h" +#include "apr_thread_proc.h" + +/** + * @file apr_thread_pool.h + * @brief APR Thread Pool Library + + * @remarks This library implements a thread pool using apr_thread_t. A thread + * pool is a set of threads that can be created in advance or on demand until a + * maximum number. When a task is scheduled, the thread pool will find an idle + * thread to handle the task. In case all existing threads are busy and the + * number of tasks in the queue is higher than the adjustable threshold, the + * pool will try to create a new thread to serve the task if the maximum number + * has not been reached. Otherwise, the task will be put into a queue based on + * priority, which can be valued from 0 to 255, with higher values being served + * first. If there are tasks with the same priority, the new task might be put at + * the top or at the bottom - it depends on which function is used to put the task. + * + * @remarks There may be the case where the thread pool can use up to the maximum + * number of threads at peak load, but having those threads idle afterwards. A + * maximum number of idle threads can be set so that the extra idling threads will + * be terminated to save system resources. + */ +#if APR_HAS_THREADS + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @defgroup APR_Util_TP Thread Pool routines + * @ingroup APR_Util + * @{ + */ + +/** Opaque Thread Pool structure. */ +typedef struct apr_thread_pool apr_thread_pool_t; + +#define APR_THREAD_TASK_PRIORITY_LOWEST 0 +#define APR_THREAD_TASK_PRIORITY_LOW 63 +#define APR_THREAD_TASK_PRIORITY_NORMAL 127 +#define APR_THREAD_TASK_PRIORITY_HIGH 191 +#define APR_THREAD_TASK_PRIORITY_HIGHEST 255 + +/** + * Create a thread pool + * @param me The pointer in which to return the newly created apr_thread_pool + * object, or NULL if thread pool creation fails. + * @param init_threads The number of threads to be created initially, this number + * will also be used as the initial value for the maximum number of idle threads. + * @param max_threads The maximum number of threads that can be created + * @param pool The pool to use + * @return APR_SUCCESS if the thread pool was created successfully. Otherwise, + * the error code. + */ +APU_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t **me, + apr_size_t init_threads, + apr_size_t max_threads, + apr_pool_t *pool); + +/** + * Destroy the thread pool and stop all the threads + * @return APR_SUCCESS if all threads are stopped. + */ +APU_DECLARE(apr_status_t) apr_thread_pool_destroy(apr_thread_pool_t *me); + +/** + * Schedule a task to the bottom of the tasks of same priority. + * @param me The thread pool + * @param func The task function + * @param param The parameter for the task function + * @param priority The priority of the task. + * @param owner Owner of this task. + * @return APR_SUCCESS if the task had been scheduled successfully + */ +APU_DECLARE(apr_status_t) apr_thread_pool_push(apr_thread_pool_t *me, + apr_thread_start_t func, + void *param, + apr_byte_t priority, + void *owner); +/** + * Schedule a task to be run after a delay + * @param me The thread pool + * @param func The task function + * @param param The parameter for the task function + * @param time Time in microseconds + * @param owner Owner of this task. + * @return APR_SUCCESS if the task had been scheduled successfully + */ +APU_DECLARE(apr_status_t) apr_thread_pool_schedule(apr_thread_pool_t *me, + apr_thread_start_t func, + void *param, + apr_interval_time_t time, + void *owner); + +/** + * Schedule a task to the top of the tasks of same priority. + * @param me The thread pool + * @param func The task function + * @param param The parameter for the task function + * @param priority The priority of the task. + * @param owner Owner of this task. + * @return APR_SUCCESS if the task had been scheduled successfully + */ +APU_DECLARE(apr_status_t) apr_thread_pool_top(apr_thread_pool_t *me, + apr_thread_start_t func, + void *param, + apr_byte_t priority, + void *owner); + +/** + * Cancel tasks submitted by the owner. If there is any task from the owner that + * is currently running, the function will spin until the task finished. + * @param me The thread pool + * @param owner Owner of the task + * @return APR_SUCCESS if the task has been cancelled successfully + * @note The task function should not be calling cancel, otherwise the function + * may get stuck forever. The function assert if it detect such a case. + */ +APU_DECLARE(apr_status_t) apr_thread_pool_tasks_cancel(apr_thread_pool_t *me, + void *owner); + +/** + * Get the current number of tasks waiting in the queue + * @param me The thread pool + * @return Number of tasks in the queue + */ +APU_DECLARE(apr_size_t) apr_thread_pool_tasks_count(apr_thread_pool_t *me); + +/** + * Get the current number of scheduled tasks waiting in the queue + * @param me The thread pool + * @return Number of scheduled tasks in the queue + */ +APU_DECLARE(apr_size_t) apr_thread_pool_scheduled_tasks_count(apr_thread_pool_t *me); + +/** + * Get the current number of threads + * @param me The thread pool + * @return Total number of threads + */ +APU_DECLARE(apr_size_t) apr_thread_pool_threads_count(apr_thread_pool_t *me); + +/** + * Get the current number of busy threads + * @param me The thread pool + * @return Number of busy threads + */ +APU_DECLARE(apr_size_t) apr_thread_pool_busy_count(apr_thread_pool_t *me); + +/** + * Get the current number of idle threads + * @param me The thread pool + * @return Number of idle threads + */ +APU_DECLARE(apr_size_t) apr_thread_pool_idle_count(apr_thread_pool_t *me); + +/** + * Access function for the maximum number of idle threads. Number of current + * idle threads will be reduced to the new limit. + * @param me The thread pool + * @param cnt The number + * @return The number of threads that were stopped. + */ +APU_DECLARE(apr_size_t) apr_thread_pool_idle_max_set(apr_thread_pool_t *me, + apr_size_t cnt); + +/** + * Get number of tasks that have run + * @param me The thread pool + * @return Number of tasks that have run + */ +APU_DECLARE(apr_size_t) + apr_thread_pool_tasks_run_count(apr_thread_pool_t * me); + +/** + * Get high water mark of the number of tasks waiting to run + * @param me The thread pool + * @return High water mark of tasks waiting to run + */ +APU_DECLARE(apr_size_t) + apr_thread_pool_tasks_high_count(apr_thread_pool_t * me); + +/** + * Get high water mark of the number of threads + * @param me The thread pool + * @return High water mark of threads in thread pool + */ +APU_DECLARE(apr_size_t) + apr_thread_pool_threads_high_count(apr_thread_pool_t * me); + +/** + * Get the number of idle threads that were destroyed after timing out + * @param me The thread pool + * @return Number of idle threads that timed out + */ +APU_DECLARE(apr_size_t) + apr_thread_pool_threads_idle_timeout_count(apr_thread_pool_t * me); + +/** + * Access function for the maximum number of idle threads + * @param me The thread pool + * @return The current maximum number + */ +APU_DECLARE(apr_size_t) apr_thread_pool_idle_max_get(apr_thread_pool_t *me); + +/** + * Access function for the maximum number of threads. + * @param me The thread pool + * @param cnt Number of threads + * @return The original maximum number of threads + */ +APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_set(apr_thread_pool_t *me, + apr_size_t cnt); + +/** + * Access function for the maximum wait time (in microseconds) of an + * idling thread that exceeds the maximum number of idling threads. + * A non-zero value allows for the reaping of idling threads to shrink + * over time. Which helps reduce thrashing. + * @param me The thread pool + * @param timeout The number of microseconds an idle thread should wait + * till it reaps itself + * @return The original maximum wait time + */ +APU_DECLARE(apr_interval_time_t) + apr_thread_pool_idle_wait_set(apr_thread_pool_t * me, + apr_interval_time_t timeout); + +/** + * Access function for the maximum wait time (in microseconds) of an + * idling thread that exceeds the maximum number of idling threads + * @param me The thread pool + * @return The current maximum wait time + */ +APU_DECLARE(apr_interval_time_t) + apr_thread_pool_idle_wait_get(apr_thread_pool_t * me); + +/** + * Access function for the maximum number of threads + * @param me The thread pool + * @return The current maximum number + */ +APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_get(apr_thread_pool_t *me); + +/** + * Access function for the threshold of tasks in queue to trigger a new thread. + * @param me The thread pool + * @param cnt The new threshold + * @return The original threshold + */ +APU_DECLARE(apr_size_t) apr_thread_pool_threshold_set(apr_thread_pool_t *me, + apr_size_t val); + +/** + * Access function for the threshold of tasks in queue to trigger a new thread. + * @param me The thread pool + * @return The current threshold + */ +APU_DECLARE(apr_size_t) apr_thread_pool_threshold_get(apr_thread_pool_t * me); + +/** + * Get owner of the task currently been executed by the thread. + * @param thd The thread is executing a task + * @param owner Pointer to receive owner of the task. + * @return APR_SUCCESS if the owner is retrieved successfully + */ +APU_DECLARE(apr_status_t) apr_thread_pool_task_owner_get(apr_thread_t *thd, + void **owner); + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* APR_HAS_THREADS */ +#endif /* !APR_THREAD_POOL_H */ diff --git a/include/apr_uri.h b/include/apr_uri.h new file mode 100644 index 00000000000..02908a9d3be --- /dev/null +++ b/include/apr_uri.h @@ -0,0 +1,178 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * apr_uri.h: External Interface of apr_uri.c + */ + +/** + * @file apr_uri.h + * @brief APR-UTIL URI Routines + */ + +#ifndef APR_URI_H +#define APR_URI_H + +#include "apu.h" + +#include "apr_network_io.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup APR_Util_URI URI + * @ingroup APR_Util + * @{ + */ + +#define APR_URI_FTP_DEFAULT_PORT 21 /**< default FTP port */ +#define APR_URI_SSH_DEFAULT_PORT 22 /**< default SSH port */ +#define APR_URI_TELNET_DEFAULT_PORT 23 /**< default telnet port */ +#define APR_URI_GOPHER_DEFAULT_PORT 70 /**< default Gopher port */ +#define APR_URI_HTTP_DEFAULT_PORT 80 /**< default HTTP port */ +#define APR_URI_POP_DEFAULT_PORT 110 /**< default POP port */ +#define APR_URI_NNTP_DEFAULT_PORT 119 /**< default NNTP port */ +#define APR_URI_IMAP_DEFAULT_PORT 143 /**< default IMAP port */ +#define APR_URI_PROSPERO_DEFAULT_PORT 191 /**< default Prospero port */ +#define APR_URI_WAIS_DEFAULT_PORT 210 /**< default WAIS port */ +#define APR_URI_LDAP_DEFAULT_PORT 389 /**< default LDAP port */ +#define APR_URI_HTTPS_DEFAULT_PORT 443 /**< default HTTPS port */ +#define APR_URI_RTSP_DEFAULT_PORT 554 /**< default RTSP port */ +#define APR_URI_SNEWS_DEFAULT_PORT 563 /**< default SNEWS port */ +#define APR_URI_ACAP_DEFAULT_PORT 674 /**< default ACAP port */ +#define APR_URI_NFS_DEFAULT_PORT 2049 /**< default NFS port */ +#define APR_URI_TIP_DEFAULT_PORT 3372 /**< default TIP port */ +#define APR_URI_SIP_DEFAULT_PORT 5060 /**< default SIP port */ + +/** Flags passed to unparse_uri_components(): */ +/** suppress "scheme://user\@site:port" */ +#define APR_URI_UNP_OMITSITEPART (1U<<0) +/** Just omit user */ +#define APR_URI_UNP_OMITUSER (1U<<1) +/** Just omit password */ +#define APR_URI_UNP_OMITPASSWORD (1U<<2) +/** omit "user:password\@" part */ +#define APR_URI_UNP_OMITUSERINFO (APR_URI_UNP_OMITUSER | \ + APR_URI_UNP_OMITPASSWORD) +/** Show plain text password (default: show XXXXXXXX) */ +#define APR_URI_UNP_REVEALPASSWORD (1U<<3) +/** Show "scheme://user\@site:port" only */ +#define APR_URI_UNP_OMITPATHINFO (1U<<4) +/** Omit the "?queryarg" from the path */ +#define APR_URI_UNP_OMITQUERY (1U<<5) + +/** @see apr_uri_t */ +typedef struct apr_uri_t apr_uri_t; + +/** + * A structure to encompass all of the fields in a uri + */ +struct apr_uri_t { + /** scheme ("http"/"ftp"/...) */ + char *scheme; + /** combined [user[:password]\@]host[:port] */ + char *hostinfo; + /** user name, as in http://user:passwd\@host:port/ */ + char *user; + /** password, as in http://user:passwd\@host:port/ */ + char *password; + /** hostname from URI (or from Host: header) */ + char *hostname; + /** port string (integer representation is in "port") */ + char *port_str; + /** the request path (or NULL if only scheme://host was given) */ + char *path; + /** Everything after a '?' in the path, if present */ + char *query; + /** Trailing "#fragment" string, if present */ + char *fragment; + + /** structure returned from gethostbyname() */ + struct hostent *hostent; + + /** The port number, numeric, valid only if port_str != NULL */ + apr_port_t port; + + /** has the structure been initialized */ + unsigned is_initialized:1; + + /** has the DNS been looked up yet */ + unsigned dns_looked_up:1; + /** has the dns been resolved yet */ + unsigned dns_resolved:1; +}; + +/* apr_uri.c */ +/** + * Return the default port for a given scheme. The schemes recognized are + * http, ftp, https, gopher, wais, nntp, snews, and prospero + * @param scheme_str The string that contains the current scheme + * @return The default port for this scheme + */ +APU_DECLARE(apr_port_t) apr_uri_port_of_scheme(const char *scheme_str); + +/** + * Unparse a apr_uri_t structure to an URI string. Optionally + * suppress the password for security reasons. + * @param p The pool to allocate out of + * @param uptr All of the parts of the uri + * @param flags How to unparse the uri. One of: + *
    + *    APR_URI_UNP_OMITSITEPART        Suppress "scheme://user\@site:port" 
    + *    APR_URI_UNP_OMITUSER            Just omit user 
    + *    APR_URI_UNP_OMITPASSWORD        Just omit password 
    + *    APR_URI_UNP_OMITUSERINFO        Omit "user:password\@" part
    + *    APR_URI_UNP_REVEALPASSWORD      Show plain text password (default: show XXXXXXXX)
    + *    APR_URI_UNP_OMITPATHINFO        Show "scheme://user\@site:port" only 
    + *    APR_URI_UNP_OMITQUERY           Omit "?queryarg" or "#fragment" 
    + * 
    + * @return The uri as a string + */ +APU_DECLARE(char *) apr_uri_unparse(apr_pool_t *p, + const apr_uri_t *uptr, + unsigned flags); + +/** + * Parse a given URI, fill in all supplied fields of a apr_uri_t + * structure. This eliminates the necessity of extracting host, port, + * path, query info repeatedly in the modules. + * @param p The pool to allocate out of + * @param uri The uri to parse + * @param uptr The apr_uri_t to fill out + * @return APR_SUCCESS for success or error code + */ +APU_DECLARE(apr_status_t) apr_uri_parse(apr_pool_t *p, const char *uri, + apr_uri_t *uptr); + +/** + * Special case for CONNECT parsing: it comes with the hostinfo part only + * @param p The pool to allocate out of + * @param hostinfo The hostinfo string to parse + * @param uptr The apr_uri_t to fill out + * @return APR_SUCCESS for success or error code + */ +APU_DECLARE(apr_status_t) apr_uri_parse_hostinfo(apr_pool_t *p, + const char *hostinfo, + apr_uri_t *uptr); + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* APR_URI_H */ diff --git a/include/apr_uuid.h b/include/apr_uuid.h new file mode 100644 index 00000000000..5312a9f62ac --- /dev/null +++ b/include/apr_uuid.h @@ -0,0 +1,76 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file apr_uuid.h + * @brief APR UUID library + */ +#ifndef APR_UUID_H +#define APR_UUID_H + +#include "apu.h" +#include "apr_errno.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @defgroup APR_UUID UUID Handling + * @ingroup APR + * @{ + */ + +/** + * we represent a UUID as a block of 16 bytes. + */ + +typedef struct { + unsigned char data[16]; /**< the actual UUID */ +} apr_uuid_t; + +/** UUIDs are formatted as: 00112233-4455-6677-8899-AABBCCDDEEFF */ +#define APR_UUID_FORMATTED_LENGTH 36 + + +/** + * Generate and return a (new) UUID + * @param uuid The resulting UUID + */ +APU_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid); + +/** + * Format a UUID into a string, following the standard format + * @param buffer The buffer to place the formatted UUID string into. It must + * be at least APR_UUID_FORMATTED_LENGTH + 1 bytes long to hold + * the formatted UUID and a null terminator + * @param uuid The UUID to format + */ +APU_DECLARE(void) apr_uuid_format(char *buffer, const apr_uuid_t *uuid); + +/** + * Parse a standard-format string into a UUID + * @param uuid The resulting UUID + * @param uuid_str The formatted UUID + */ +APU_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str); + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* APR_UUID_H */ diff --git a/include/apr_xlate.h b/include/apr_xlate.h new file mode 100644 index 00000000000..326366853a4 --- /dev/null +++ b/include/apr_xlate.h @@ -0,0 +1,163 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_XLATE_H +#define APR_XLATE_H + +#include "apu.h" +#include "apr_pools.h" +#include "apr_errno.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @file apr_xlate.h + * @brief APR I18N translation library + */ + +/** + * @defgroup APR_XLATE I18N translation library + * @ingroup APR + * @{ + */ +/** Opaque translation buffer */ +typedef struct apr_xlate_t apr_xlate_t; + +/** + * Set up for converting text from one charset to another. + * @param convset The handle to be filled in by this function + * @param topage The name of the target charset + * @param frompage The name of the source charset + * @param pool The pool to use + * @remark + * Specify APR_DEFAULT_CHARSET for one of the charset + * names to indicate the charset of the source code at + * compile time. This is useful if there are literal + * strings in the source code which must be translated + * according to the charset of the source code. + * APR_DEFAULT_CHARSET is not useful if the source code + * of the caller was not encoded in the same charset as + * APR at compile time. + * + * @remark + * Specify APR_LOCALE_CHARSET for one of the charset + * names to indicate the charset of the current locale. + * + * @remark + * Return APR_EINVAL if unable to procure a convset, or APR_ENOTIMPL + * if charset transcoding is not available in this instance of + * apr-util at all (i.e., APR_HAS_XLATE is undefined). + */ +APU_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, + const char *topage, + const char *frompage, + apr_pool_t *pool); + +/** + * This is to indicate the charset of the sourcecode at compile time + * names to indicate the charset of the source code at + * compile time. This is useful if there are literal + * strings in the source code which must be translated + * according to the charset of the source code. + */ +#define APR_DEFAULT_CHARSET (const char *)0 +/** + * To indicate charset names of the current locale + */ +#define APR_LOCALE_CHARSET (const char *)1 + +/** + * Find out whether or not the specified conversion is single-byte-only. + * @param convset The handle allocated by apr_xlate_open, specifying the + * parameters of conversion + * @param onoff Output: whether or not the conversion is single-byte-only + * @remark + * Return APR_ENOTIMPL if charset transcoding is not available + * in this instance of apr-util (i.e., APR_HAS_XLATE is undefined). + */ +APU_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff); + +/** + * Convert a buffer of text from one codepage to another. + * @param convset The handle allocated by apr_xlate_open, specifying + * the parameters of conversion + * @param inbuf The address of the source buffer + * @param inbytes_left Input: the amount of input data to be translated + * Output: the amount of input data not yet translated + * @param outbuf The address of the destination buffer + * @param outbytes_left Input: the size of the output buffer + * Output: the amount of the output buffer not yet used + * @remark + * Returns APR_ENOTIMPL if charset transcoding is not available + * in this instance of apr-util (i.e., APR_HAS_XLATE is undefined). + * Returns APR_INCOMPLETE if the input buffer ends in an incomplete + * multi-byte character. + * + * To correctly terminate the output buffer for some multi-byte + * character set encodings, a final call must be made to this function + * after the complete input string has been converted, passing + * the inbuf and inbytes_left parameters as NULL. (Note that this + * mode only works from version 1.1.0 onwards) + */ +APU_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, + const char *inbuf, + apr_size_t *inbytes_left, + char *outbuf, + apr_size_t *outbytes_left); + +/* @see apr_file_io.h the comment in apr_file_io.h about this hack */ +#ifdef APR_NOT_DONE_YET +/** + * The purpose of apr_xlate_conv_char is to translate one character + * at a time. This needs to be written carefully so that it works + * with double-byte character sets. + * @param convset The handle allocated by apr_xlate_open, specifying the + * parameters of conversion + * @param inchar The character to convert + * @param outchar The converted character + */ +APU_DECLARE(apr_status_t) apr_xlate_conv_char(apr_xlate_t *convset, + char inchar, char outchar); +#endif + +/** + * Convert a single-byte character from one charset to another. + * @param convset The handle allocated by apr_xlate_open, specifying the + * parameters of conversion + * @param inchar The single-byte character to convert. + * @warning This only works when converting between single-byte character sets. + * -1 will be returned if the conversion can't be performed. + */ +APU_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, + unsigned char inchar); + +/** + * Close a codepage translation handle. + * @param convset The codepage translation handle to close + * @remark + * Return APR_ENOTIMPL if charset transcoding is not available + * in this instance of apr-util (i.e., APR_HAS_XLATE is undefined). + */ +APU_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset); + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* ! APR_XLATE_H */ diff --git a/include/apr_xml.h b/include/apr_xml.h new file mode 100644 index 00000000000..2a43b283e97 --- /dev/null +++ b/include/apr_xml.h @@ -0,0 +1,356 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file apr_xml.h + * @brief APR-UTIL XML Library + */ +#ifndef APR_XML_H +#define APR_XML_H + +/** + * @defgroup APR_Util_XML XML + * @ingroup APR_Util + * @{ + */ +#include "apr_pools.h" +#include "apr_tables.h" +#include "apr_file_io.h" + +#include "apu.h" +#if APR_CHARSET_EBCDIC +#include "apr_xlate.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @package Apache XML library + */ + +/* -------------------------------------------------------------------- */ + +/* ### these will need to move at some point to a more logical spot */ + +/** @see apr_text */ +typedef struct apr_text apr_text; + +/** Structure to keep a linked list of pieces of text */ +struct apr_text { + /** The current piece of text */ + const char *text; + /** a pointer to the next piece of text */ + struct apr_text *next; +}; + +/** @see apr_text_header */ +typedef struct apr_text_header apr_text_header; + +/** A list of pieces of text */ +struct apr_text_header { + /** The first piece of text in the list */ + apr_text *first; + /** The last piece of text in the list */ + apr_text *last; +}; + +/** + * Append a piece of text to the end of a list + * @param p The pool to allocate out of + * @param hdr The text header to append to + * @param text The new text to append + */ +APU_DECLARE(void) apr_text_append(apr_pool_t *p, apr_text_header *hdr, + const char *text); + + +/* -------------------------------------------------------------------- +** +** XML PARSING +*/ + +/* +** Qualified namespace values +** +** APR_XML_NS_DAV_ID +** We always insert the "DAV:" namespace URI at the head of the +** namespace array. This means that it will always be at ID==0, +** making it much easier to test for. +** +** APR_XML_NS_NONE +** This special ID is used for two situations: +** +** 1) The namespace prefix begins with "xml" (and we do not know +** what it means). Namespace prefixes with "xml" (any case) as +** their first three characters are reserved by the XML Namespaces +** specification for future use. mod_dav will pass these through +** unchanged. When this identifier is used, the prefix is LEFT in +** the element/attribute name. Downstream processing should not +** prepend another prefix. +** +** 2) The element/attribute does not have a namespace. +** +** a) No prefix was used, and a default namespace has not been +** defined. +** b) No prefix was used, and the default namespace was specified +** to mean "no namespace". This is done with a namespace +** declaration of: xmlns="" +** (this declaration is typically used to override a previous +** specification for the default namespace) +** +** In these cases, we need to record that the elem/attr has no +** namespace so that we will not attempt to prepend a prefix. +** All namespaces that are used will have a prefix assigned to +** them -- mod_dav will never set or use the default namespace +** when generating XML. This means that "no prefix" will always +** mean "no namespace". +** +** In both cases, the XML generation will avoid prepending a prefix. +** For the first case, this means the original prefix/name will be +** inserted into the output stream. For the latter case, it means +** the name will have no prefix, and since we never define a default +** namespace, this means it will have no namespace. +** +** Note: currently, mod_dav understands the "xmlns" prefix and the +** "xml:lang" attribute. These are handled specially (they aren't +** left within the XML tree), so the APR_XML_NS_NONE value won't ever +** really apply to these values. +*/ +#define APR_XML_NS_DAV_ID 0 /**< namespace ID for "DAV:" */ +#define APR_XML_NS_NONE -10 /**< no namespace for this elem/attr */ + +#define APR_XML_NS_ERROR_BASE -100 /**< used only during processing */ +/** Is this namespace an error? */ +#define APR_XML_NS_IS_ERROR(e) ((e) <= APR_XML_NS_ERROR_BASE) + +/** @see apr_xml_attr */ +typedef struct apr_xml_attr apr_xml_attr; +/** @see apr_xml_elem */ +typedef struct apr_xml_elem apr_xml_elem; +/** @see apr_xml_doc */ +typedef struct apr_xml_doc apr_xml_doc; + +/** apr_xml_attr: holds a parsed XML attribute */ +struct apr_xml_attr { + /** attribute name */ + const char *name; + /** index into namespace array */ + int ns; + + /** attribute value */ + const char *value; + + /** next attribute */ + struct apr_xml_attr *next; +}; + +/** apr_xml_elem: holds a parsed XML element */ +struct apr_xml_elem { + /** element name */ + const char *name; + /** index into namespace array */ + int ns; + /** xml:lang for attrs/contents */ + const char *lang; + + /** cdata right after start tag */ + apr_text_header first_cdata; + /** cdata after MY end tag */ + apr_text_header following_cdata; + + /** parent element */ + struct apr_xml_elem *parent; + /** next (sibling) element */ + struct apr_xml_elem *next; + /** first child element */ + struct apr_xml_elem *first_child; + /** first attribute */ + struct apr_xml_attr *attr; + + /* used only during parsing */ + /** last child element */ + struct apr_xml_elem *last_child; + /** namespaces scoped by this elem */ + struct apr_xml_ns_scope *ns_scope; + + /* used by modules during request processing */ + /** Place for modules to store private data */ + void *priv; +}; + +/** Is this XML element empty? */ +#define APR_XML_ELEM_IS_EMPTY(e) ((e)->first_child == NULL && \ + (e)->first_cdata.first == NULL) + +/** apr_xml_doc: holds a parsed XML document */ +struct apr_xml_doc { + /** root element */ + apr_xml_elem *root; + /** array of namespaces used */ + apr_array_header_t *namespaces; +}; + +/** Opaque XML parser structure */ +typedef struct apr_xml_parser apr_xml_parser; + +/** + * Create an XML parser + * @param pool The pool for allocating the parser and the parse results. + * @return The new parser. + */ +APU_DECLARE(apr_xml_parser *) apr_xml_parser_create(apr_pool_t *pool); + +/** + * Parse a File, producing a xml_doc + * @param p The pool for allocating the parse results. + * @param parser A pointer to *parser (needed so calling function can get + * errors), will be set to NULL on successfull completion. + * @param ppdoc A pointer to *apr_xml_doc (which has the parsed results in it) + * @param xmlfd A file to read from. + * @param buffer_length Buffer length which would be suitable + * @return Any errors found during parsing. + */ +APU_DECLARE(apr_status_t) apr_xml_parse_file(apr_pool_t *p, + apr_xml_parser **parser, + apr_xml_doc **ppdoc, + apr_file_t *xmlfd, + apr_size_t buffer_length); + + +/** + * Feed input into the parser + * @param parser The XML parser for parsing this data. + * @param data The data to parse. + * @param len The length of the data. + * @return Any errors found during parsing. + * @remark Use apr_xml_parser_geterror() to get more error information. + */ +APU_DECLARE(apr_status_t) apr_xml_parser_feed(apr_xml_parser *parser, + const char *data, + apr_size_t len); + +/** + * Terminate the parsing and return the result + * @param parser The XML parser for parsing this data. + * @param pdoc The resulting parse information. May be NULL to simply + * terminate the parsing without fetching the info. + * @return Any errors found during the final stage of parsing. + * @remark Use apr_xml_parser_geterror() to get more error information. + */ +APU_DECLARE(apr_status_t) apr_xml_parser_done(apr_xml_parser *parser, + apr_xml_doc **pdoc); + +/** + * Fetch additional error information from the parser. + * @param parser The XML parser to query for errors. + * @param errbuf A buffer for storing error text. + * @param errbufsize The length of the error text buffer. + * @return The error buffer + */ +APU_DECLARE(char *) apr_xml_parser_geterror(apr_xml_parser *parser, + char *errbuf, + apr_size_t errbufsize); + + +/** + * Converts an XML element tree to flat text + * @param p The pool to allocate out of + * @param elem The XML element to convert + * @param style How to covert the XML. One of: + *
    + *     APR_XML_X2T_FULL                start tag, contents, end tag 
    + *     APR_XML_X2T_INNER               contents only 
    + *     APR_XML_X2T_LANG_INNER          xml:lang + inner contents 
    + *     APR_XML_X2T_FULL_NS_LANG        FULL + ns defns + xml:lang 
    + * 
    + * @param namespaces The namespace of the current XML element + * @param ns_map Namespace mapping + * @param pbuf Buffer to put the converted text into + * @param psize Size of the converted text + */ +APU_DECLARE(void) apr_xml_to_text(apr_pool_t *p, const apr_xml_elem *elem, + int style, apr_array_header_t *namespaces, + int *ns_map, const char **pbuf, + apr_size_t *psize); + +/* style argument values: */ +#define APR_XML_X2T_FULL 0 /**< start tag, contents, end tag */ +#define APR_XML_X2T_INNER 1 /**< contents only */ +#define APR_XML_X2T_LANG_INNER 2 /**< xml:lang + inner contents */ +#define APR_XML_X2T_FULL_NS_LANG 3 /**< FULL + ns defns + xml:lang */ + +/** + * empty XML element + * @param p The pool to allocate out of + * @param elem The XML element to empty + * @return the string that was stored in the XML element + */ +APU_DECLARE(const char *) apr_xml_empty_elem(apr_pool_t *p, + const apr_xml_elem *elem); + +/** + * quote an XML string + * Replace '<', '>', and '&' with '<', '>', and '&'. + * @param p The pool to allocate out of + * @param s The string to quote + * @param quotes If quotes is true, then replace '"' with '"'. + * @return The quoted string + * @note If the string does not contain special characters, it is not + * duplicated into the pool and the original string is returned. + */ +APU_DECLARE(const char *) apr_xml_quote_string(apr_pool_t *p, const char *s, + int quotes); + +/** + * Quote an XML element + * @param p The pool to allocate out of + * @param elem The element to quote + */ +APU_DECLARE(void) apr_xml_quote_elem(apr_pool_t *p, apr_xml_elem *elem); + +/* manage an array of unique URIs: apr_xml_insert_uri() and APR_XML_URI_ITEM() */ + +/** + * return the URI's (existing) index, or insert it and return a new index + * @param uri_array array to insert into + * @param uri The uri to insert + * @return int The uri's index + */ +APU_DECLARE(int) apr_xml_insert_uri(apr_array_header_t *uri_array, + const char *uri); + +/** Get the URI item for this XML element */ +#define APR_XML_GET_URI_ITEM(ary, i) (((const char * const *)(ary)->elts)[i]) + +#if APR_CHARSET_EBCDIC +/** + * Convert parsed tree in EBCDIC + * @param p The pool to allocate out of + * @param pdoc The apr_xml_doc to convert. + * @param xlate The translation handle to use. + * @return Any errors found during conversion. + */ +APU_DECLARE(apr_status_t) apr_xml_parser_convert_doc(apr_pool_t *p, + apr_xml_doc *pdoc, + apr_xlate_t *convset); +#endif + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif /* APR_XML_H */ diff --git a/include/apu.h.in b/include/apu.h.in new file mode 100644 index 00000000000..4037094da84 --- /dev/null +++ b/include/apu.h.in @@ -0,0 +1,114 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * apu.h is generated from apu.h.in by configure -- do not edit apu.h + */ +/* @file apu.h + * @brief APR-Utility main file + */ +/** + * @defgroup APR_Util APR Utility Functions + * @{ + */ + + +#ifndef APU_H +#define APU_H + +/** + * APU_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, + * so that all public symbols are exported. + * + * APU_DECLARE_STATIC is defined when including the APR-UTIL public headers, + * to provide static linkage when the dynamic library may be unavailable. + * + * APU_DECLARE_STATIC and APU_DECLARE_EXPORT are left undefined when + * including the APR-UTIL public headers, to import and link the symbols from + * the dynamic APR-UTIL library and assure appropriate indirection and calling + * conventions at compile time. + */ + +/** + * The public APR-UTIL functions are declared with APU_DECLARE(), so they may + * use the most appropriate calling convention. Public APR functions with + * variable arguments must use APU_DECLARE_NONSTD(). + * + * @fn APU_DECLARE(rettype) apr_func(args); + */ +#define APU_DECLARE(type) type +/** + * The public APR-UTIL functions using variable arguments are declared with + * APU_DECLARE_NONSTD(), as they must use the C language calling convention. + * + * @fn APU_DECLARE_NONSTD(rettype) apr_func(args, ...); + */ +#define APU_DECLARE_NONSTD(type) type +/** + * The public APR-UTIL variables are declared with APU_DECLARE_DATA. + * This assures the appropriate indirection is invoked at compile time. + * + * @fn APU_DECLARE_DATA type apr_variable; + * @note APU_DECLARE_DATA extern type apr_variable; syntax is required for + * declarations within headers to properly import the variable. + */ +#define APU_DECLARE_DATA + +#if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) +/** + * Declare a dso module's exported module structure as APU_MODULE_DECLARE_DATA. + * + * Unless APU_MODULE_DECLARE_STATIC is defined at compile time, symbols + * declared with APU_MODULE_DECLARE_DATA are always exported. + * @code + * module APU_MODULE_DECLARE_DATA mod_tag + * @endcode + */ +#define APU_MODULE_DECLARE_DATA +#else +#define APU_MODULE_DECLARE_DATA __declspec(dllexport) +#endif + +/* + * we always have SDBM (it's in our codebase) + */ +#define APU_HAVE_SDBM @apu_have_sdbm@ +#define APU_HAVE_GDBM @apu_have_gdbm@ +#define APU_HAVE_NDBM @apu_have_ndbm@ +#define APU_HAVE_DB @apu_have_db@ + +#if APU_HAVE_DB +#define APU_HAVE_DB_VERSION @apu_db_version@ +#endif + +#define APU_HAVE_PGSQL @apu_have_pgsql@ +#define APU_HAVE_MYSQL @apu_have_mysql@ +#define APU_HAVE_SQLITE3 @apu_have_sqlite3@ +#define APU_HAVE_SQLITE2 @apu_have_sqlite2@ +#define APU_HAVE_ORACLE @apu_have_oracle@ +#define APU_HAVE_FREETDS @apu_have_freetds@ +#define APU_HAVE_ODBC @apu_have_odbc@ + +#define APU_HAVE_CRYPTO @apu_have_crypto@ +#define APU_HAVE_OPENSSL @apu_have_openssl@ +#define APU_HAVE_NSS @apu_have_nss@ + +#define APU_HAVE_APR_ICONV @have_apr_iconv@ +#define APU_HAVE_ICONV @have_iconv@ +#define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) + +#endif /* APU_H */ +/** @} */ diff --git a/include/apu.hnw b/include/apu.hnw new file mode 100644 index 00000000000..31c0dfb4155 --- /dev/null +++ b/include/apu.hnw @@ -0,0 +1,124 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Note: This is a NetWare specific version of apu.h. It is renamed to + * apu.h at the start of a NetWare build. + */ +/* @file apu.h + * @brief APR-Utility main file + */ + +#ifdef NETWARE +#ifndef APU_H +#define APU_H +/** + * @defgroup APR_Util APR Utility Functions + * @{ + */ + + +/** + * APU_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, + * so that all public symbols are exported. + * + * APU_DECLARE_STATIC is defined when including the APR-UTIL public headers, + * to provide static linkage when the dynamic library may be unavailable. + * + * APU_DECLARE_STATIC and APU_DECLARE_EXPORT are left undefined when + * including the APR-UTIL public headers, to import and link the symbols from + * the dynamic APR-UTIL library and assure appropriate indirection and calling + * conventions at compile time. + */ + +/** + * The public APR-UTIL functions are declared with APU_DECLARE(), so they may + * use the most appropriate calling convention. Public APR functions with + * variable arguments must use APU_DECLARE_NONSTD(). + * + * @fn APU_DECLARE(rettype) apr_func(args); + */ +#define APU_DECLARE(type) type +/** + * The public APR-UTIL functions using variable arguments are declared with + * APU_DECLARE_NONSTD(), as they must use the C language calling convention. + * + * @fn APU_DECLARE_NONSTD(rettype) apr_func(args, ...); + */ +#define APU_DECLARE_NONSTD(type) type +/** + * The public APR-UTIL variables are declared with APU_DECLARE_DATA. + * This assures the appropriate indirection is invoked at compile time. + * + * @fn APU_DECLARE_DATA type apr_variable; + * @note APU_DECLARE_DATA extern type apr_variable; syntax is required for + * declarations within headers to properly import the variable. + */ +#define APU_DECLARE_DATA + +/** + * Declare a dso module's exported module structure as APU_MODULE_DECLARE_DATA. + * + * Unless APU_MODULE_DECLARE_STATIC is defined at compile time, symbols + * declared with APU_MODULE_DECLARE_DATA are always exported. + * @code + * module APU_MODULE_DECLARE_DATA mod_tag + * @endcode + */ +#define APU_MODULE_DECLARE_DATA + +/* + * we always have SDBM (it's in our codebase) + */ +#define APU_HAVE_SDBM 1 + +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_GDBM 0 +#define APU_HAVE_NDBM 0 +#define APU_HAVE_DB 0 + +#if APU_HAVE_DB +#define APU_HAVE_DB_VERSION 0 +#endif +#endif + +/* + * we always enable dynamic driver loads within apr_dbd + */ +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_PGSQL 0 +#define APU_HAVE_MYSQL 0 +#define APU_HAVE_SQLITE3 0 +#define APU_HAVE_SQLITE2 0 +#define APU_HAVE_ORACLE 0 +#define APU_HAVE_FREETDS 0 +#define APU_HAVE_ODBC 0 +#endif + +#define APU_HAVE_CRYPTO 0 + +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_OPENSSL 0 +#define APU_HAVE_NSS 0 +#endif + +#define APU_HAVE_APR_ICONV 0 +#define APU_HAVE_ICONV 1 +#define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) + +#endif /* APU_H */ +#endif /* NETWARE */ + diff --git a/include/apu.hw b/include/apu.hw new file mode 100644 index 00000000000..5be70de6093 --- /dev/null +++ b/include/apu.hw @@ -0,0 +1,140 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * apu.h is duplicated from apu.hw at build time -- do not edit apu.h + */ +/* @file apu.h + * @brief APR-Utility main file + */ +/** + * @defgroup APR_Util APR Utility Functions + * @{ + */ + + +#ifndef APU_H +#define APU_H + +/** + * APU_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, + * so that all public symbols are exported. + * + * APU_DECLARE_STATIC is defined when including the APR-UTIL public headers, + * to provide static linkage when the dynamic library may be unavailable. + * + * APU_DECLARE_STATIC and APU_DECLARE_EXPORT are left undefined when + * including the APR-UTIL public headers, to import and link the symbols from + * the dynamic APR-UTIL library and assure appropriate indirection and calling + * conventions at compile time. + */ + +#if defined(DOXYGEN) || !defined(WIN32) +/** + * The public APR-UTIL functions are declared with APU_DECLARE(), so they may + * use the most appropriate calling convention. Public APR functions with + * variable arguments must use APU_DECLARE_NONSTD(). + * + * @fn APU_DECLARE(rettype) apr_func(args); + */ +#define APU_DECLARE(type) type +/** + * The public APR-UTIL functions using variable arguments are declared with + * APU_DECLARE_NONSTD(), as they must use the C language calling convention. + * + * @fn APU_DECLARE_NONSTD(rettype) apr_func(args, ...); + */ +#define APU_DECLARE_NONSTD(type) type +/** + * The public APR-UTIL variables are declared with APU_DECLARE_DATA. + * This assures the appropriate indirection is invoked at compile time. + * + * @fn APU_DECLARE_DATA type apr_variable; + * @note extern APU_DECLARE_DATA type apr_variable; syntax is required for + * declarations within headers to properly import the variable. + */ +#define APU_DECLARE_DATA +#elif defined(APU_DECLARE_STATIC) +#define APU_DECLARE(type) type __stdcall +#define APU_DECLARE_NONSTD(type) type __cdecl +#define APU_DECLARE_DATA +#elif defined(APU_DECLARE_EXPORT) +#define APU_DECLARE(type) __declspec(dllexport) type __stdcall +#define APU_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl +#define APU_DECLARE_DATA __declspec(dllexport) +#else +#define APU_DECLARE(type) __declspec(dllimport) type __stdcall +#define APU_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl +#define APU_DECLARE_DATA __declspec(dllimport) +#endif + +#if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) +/** + * Declare a dso module's exported module structure as APU_MODULE_DECLARE_DATA. + * + * Unless APU_MODULE_DECLARE_STATIC is defined at compile time, symbols + * declared with APU_MODULE_DECLARE_DATA are always exported. + * @code + * module APU_MODULE_DECLARE_DATA mod_tag + * @endcode + */ +#define APU_MODULE_DECLARE_DATA +#else +#define APU_MODULE_DECLARE_DATA __declspec(dllexport) +#endif + +/* + * we always have SDBM (it's in our codebase) + */ +#define APU_HAVE_SDBM 1 + +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_GDBM 0 +#define APU_HAVE_NDBM 0 +#define APU_HAVE_DB 0 + +#if APU_HAVE_DB +#define APU_HAVE_DB_VERSION 0 +#endif +#endif + +/* + * we always enable dynamic driver loads within apr_dbd + * Win32 always has odbc (it's always installed) + */ +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_PGSQL 0 +#define APU_HAVE_MYSQL 0 +#define APU_HAVE_SQLITE3 0 +#define APU_HAVE_SQLITE2 0 +#define APU_HAVE_ORACLE 0 +#define APU_HAVE_FREETDS 0 +#define APU_HAVE_ODBC 1 +#endif + +#define APU_HAVE_CRYPTO 0 + +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_OPENSSL 0 +#define APU_HAVE_NSS 0 +#endif + +#define APU_HAVE_APR_ICONV 1 +#define APU_HAVE_ICONV 0 +#define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) + +#endif /* APU_H */ +/** @} */ diff --git a/include/apu_errno.h b/include/apu_errno.h new file mode 100644 index 00000000000..c0a8ec7d41d --- /dev/null +++ b/include/apu_errno.h @@ -0,0 +1,173 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APU_ERRNO_H +#define APU_ERRNO_H + +/** + * @file apu_errno.h + * @brief APR-Util Error Codes + */ + +#include "apr.h" +#include "apr_errno.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @defgroup apu_errno Error Codes + * @ingroup APR_Util + * @{ + */ + +/** + * @defgroup APR_Util_Error APR_Util Error Values + *
    + * APU ERROR VALUES
    + * APR_ENOKEY         The key provided was empty or NULL
    + * APR_ENOIV          The initialisation vector provided was NULL
    + * APR_EKEYTYPE       The key type was not recognised
    + * APR_ENOSPACE       The buffer supplied was not big enough
    + * APR_ECRYPT         An error occurred while encrypting or decrypting
    + * APR_EPADDING       Padding was not supported
    + * APR_EKEYLENGTH     The key length was incorrect
    + * APR_ENOCIPHER      The cipher provided was not recognised
    + * APR_ENODIGEST      The digest provided was not recognised
    + * APR_ENOENGINE      The engine provided was not recognised
    + * APR_EINITENGINE    The engine could not be initialised
    + * APR_EREINIT        Underlying crypto has already been initialised
    + * 
    + * + *
    + * APR STATUS VALUES
    + * APR_INCHILD        Program is currently executing in the child
    + * 
    + * @{ + */ +/** @see APR_STATUS_IS_ENOKEY */ +#define APR_ENOKEY (APR_UTIL_START_STATUS + 1) +/** @see APR_STATUS_IS_ENOIV */ +#define APR_ENOIV (APR_UTIL_START_STATUS + 2) +/** @see APR_STATUS_IS_EKEYTYPE */ +#define APR_EKEYTYPE (APR_UTIL_START_STATUS + 3) +/** @see APR_STATUS_IS_ENOSPACE */ +#define APR_ENOSPACE (APR_UTIL_START_STATUS + 4) +/** @see APR_STATUS_IS_ECRYPT */ +#define APR_ECRYPT (APR_UTIL_START_STATUS + 5) +/** @see APR_STATUS_IS_EPADDING */ +#define APR_EPADDING (APR_UTIL_START_STATUS + 6) +/** @see APR_STATUS_IS_EKEYLENGTH */ +#define APR_EKEYLENGTH (APR_UTIL_START_STATUS + 7) +/** @see APR_STATUS_IS_ENOCIPHER */ +#define APR_ENOCIPHER (APR_UTIL_START_STATUS + 8) +/** @see APR_STATUS_IS_ENODIGEST */ +#define APR_ENODIGEST (APR_UTIL_START_STATUS + 9) +/** @see APR_STATUS_IS_ENOENGINE */ +#define APR_ENOENGINE (APR_UTIL_START_STATUS + 10) +/** @see APR_STATUS_IS_EINITENGINE */ +#define APR_EINITENGINE (APR_UTIL_START_STATUS + 11) +/** @see APR_STATUS_IS_EREINIT */ +#define APR_EREINIT (APR_UTIL_START_STATUS + 12) +/** @} */ + +/** + * @defgroup APU_STATUS_IS Status Value Tests + * @warning For any particular error condition, more than one of these tests + * may match. This is because platform-specific error codes may not + * always match the semantics of the POSIX codes these tests (and the + * corresponding APR error codes) are named after. A notable example + * are the APR_STATUS_IS_ENOENT and APR_STATUS_IS_ENOTDIR tests on + * Win32 platforms. The programmer should always be aware of this and + * adjust the order of the tests accordingly. + * @{ + */ + +/** @} */ + +/** + * @addtogroup APR_Util_Error + * @{ + */ +/** + * The key was empty or not provided + */ +#define APR_STATUS_IS_ENOKEY(s) ((s) == APR_ENOKEY) +/** + * The initialisation vector was not provided + */ +#define APR_STATUS_IS_ENOIV(s) ((s) == APR_ENOIV) +/** + * The key type was not recognised + */ +#define APR_STATUS_IS_EKEYTYPE(s) ((s) == APR_EKEYTYPE) +/** + * The buffer provided was not big enough + */ +#define APR_STATUS_IS_ENOSPACE(s) ((s) == APR_ENOSPACE) +/** + * An error occurred while encrypting or decrypting + */ +#define APR_STATUS_IS_ECRYPT(s) ((s) == APR_ECRYPT) +/** + * An error occurred while padding + */ +#define APR_STATUS_IS_EPADDING(s) ((s) == APR_EPADDING) +/** + * An error occurred with the key length + */ +#define APR_STATUS_IS_EKEYLENGTH(s) ((s) == APR_EKEYLENGTH) +/** + * The cipher provided was not recognised + */ +#define APR_STATUS_IS_ENOCIPHER(s) ((s) == APR_ENOCIPHER) +/** + * The digest provided was not recognised + */ +#define APR_STATUS_IS_ENODIGEST(s) ((s) == APR_ENODIGEST) +/** + * The engine provided was not recognised + */ +#define APR_STATUS_IS_ENOENGINE(s) ((s) == APR_ENOENGINE) +/** + * The engine could not be initialised + */ +#define APR_STATUS_IS_EINITENGINE(s) ((s) == APR_EINITENGINE) +/** + * Crypto has already been initialised + */ +#define APR_STATUS_IS_EREINIT(s) ((s) == APR_EREINIT) +/** @} */ + +/** + * This structure allows the underlying API error codes to be returned + * along with plain text error messages that explain to us mere mortals + * what really happened. + */ +typedef struct apu_err_t { + const char *reason; + const char *msg; + int rc; +} apu_err_t; + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* ! APU_ERRNO_H */ diff --git a/include/apu_version.h b/include/apu_version.h new file mode 100644 index 00000000000..9db3f81a135 --- /dev/null +++ b/include/apu_version.h @@ -0,0 +1,134 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APU_VERSION_H +#define APU_VERSION_H + +/** + * @file apu_version.h + * @brief APR-util Versioning Interface + * + * APR-util's Version + * + * There are several different mechanisms for accessing the version. There + * is a string form, and a set of numbers; in addition, there are constants + * which can be compiled into your application, and you can query the library + * being used for its actual version. + * + * Note that it is possible for an application to detect that it has been + * compiled against a different version of APU by use of the compile-time + * constants and the use of the run-time query function. + * + * APU version numbering follows the guidelines specified in: + * + * http://apr.apache.org/versioning.html + */ + + +/* The numeric compile-time version constants. These constants are the + * authoritative version numbers for APU. + */ + +/** major version + * Major API changes that could cause compatibility problems for older + * programs such as structure size changes. No binary compatibility is + * possible across a change in the major version. + */ +#define APU_MAJOR_VERSION 2 + +/** minor version + * Minor API changes that do not cause binary compatibility problems. + * Reset to 0 when upgrading APU_MAJOR_VERSION + */ +#define APU_MINOR_VERSION 0 + +/** patch level + * The Patch Level never includes API changes, simply bug fixes. + * Reset to 0 when upgrading APR_MINOR_VERSION + */ +#define APU_PATCH_VERSION 0 + +/** + * The symbol APU_IS_DEV_VERSION is only defined for internal, + * "development" copies of APU. It is undefined for released versions + * of APU. + */ +#define APU_IS_DEV_VERSION + + +#if defined(APU_IS_DEV_VERSION) || defined(DOXYGEN) +/** Internal: string form of the "is dev" flag */ +#define APU_IS_DEV_STRING "-dev" +#else +#define APU_IS_DEV_STRING "" +#endif + + +#ifndef APU_STRINGIFY +/** Properly quote a value as a string in the C preprocessor */ +#define APU_STRINGIFY(n) APU_STRINGIFY_HELPER(n) +/** Helper macro for APU_STRINGIFY */ +#define APU_STRINGIFY_HELPER(n) #n +#endif + +/** The formatted string of APU's version */ +#define APU_VERSION_STRING \ + APU_STRINGIFY(APU_MAJOR_VERSION) "." \ + APU_STRINGIFY(APU_MINOR_VERSION) "." \ + APU_STRINGIFY(APU_PATCH_VERSION) \ + APU_IS_DEV_STRING + +/** An alternative formatted string of APR's version */ +/* macro for Win32 .rc files using numeric csv representation */ +#define APU_VERSION_STRING_CSV APU_MAJOR_VERSION ##, \ + ##APU_MINOR_VERSION ##, \ + ##APU_PATCH_VERSION + + +#ifndef APU_VERSION_ONLY + +/* The C language API to access the version at run time, + * as opposed to compile time. APU_VERSION_ONLY may be defined + * externally when preprocessing apr_version.h to obtain strictly + * the C Preprocessor macro declarations. + */ + +#include "apr_version.h" + +#include "apu.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Return APR-util's version information information in a numeric form. + * + * @param pvsn Pointer to a version structure for returning the version + * information. + */ +APU_DECLARE(void) apu_version(apr_version_t *pvsn); + +/** Return APU's version information as a string. */ +APU_DECLARE(const char *) apu_version_string(void); + +#ifdef __cplusplus +} +#endif + +#endif /* ndef APU_VERSION_ONLY */ + +#endif /* ndef APU_VERSION_H */ diff --git a/include/apu_want.h.in b/include/apu_want.h.in new file mode 100644 index 00000000000..a296e5c5c69 --- /dev/null +++ b/include/apu_want.h.in @@ -0,0 +1,51 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apu.h" /* configuration data */ + +/** + * @file apu_want.h + * @brief APR Standard Headers Support + * + *
    + * Features:
    + *
    + *   APU_WANT_DB:       <@apu_db_header@>
    + *
    + * Typical usage:
    + *
    + *   #define APU_WANT_DB
    + *   #include "apu_want.h"
    + *
    + * The appropriate headers will be included.
    + *
    + * Note: it is safe to use this in a header (it won't interfere with other
    + *       headers' or source files' use of apu_want.h)
    + * 
    + */ + +/* --------------------------------------------------------------------- */ + +#ifdef APU_WANT_DB + +#if APU_HAVE_DB +#include <@apu_db_header@> +#endif + +#undef APU_WANT_DB +#endif + +/* --------------------------------------------------------------------- */ diff --git a/include/apu_want.hnw b/include/apu_want.hnw new file mode 100644 index 00000000000..afdc9f74ca6 --- /dev/null +++ b/include/apu_want.hnw @@ -0,0 +1,52 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apu.h" /* configuration data */ + +/** + * @file apu_want.h + * @brief APR Standard Headers Support + * + *
    + * Features:
    + *
    + *   APU_WANT_DB:       <@apu_db_header>
    + *
    + * Typical usage:
    + *
    + *   #define APU_WANT_DB
    + *   #include "apu_want.h"
    + *
    + * The appropriate headers will be included.
    + *
    + * Note: it is safe to use this in a header (it won't interfere with other
    + *       headers' or source files' use of apu_want.h)
    + * 
    + */ + +/* --------------------------------------------------------------------- */ + +#ifdef APU_WANT_DB + +#if APU_HAVE_DB +/* win32 note.. you will need to change this for db1 */ +#include +#endif + +#undef APU_WANT_DB +#endif + +/* --------------------------------------------------------------------- */ diff --git a/include/apu_want.hw b/include/apu_want.hw new file mode 100644 index 00000000000..8bb56ce79f0 --- /dev/null +++ b/include/apu_want.hw @@ -0,0 +1,52 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apu.h" /* configuration data */ + +/** + * @file apu_want.h + * @brief APR Standard Headers Support + * + *
    + * Features:
    + *
    + *   APU_WANT_DB:       
    + *
    + * Typical usage:
    + *
    + *   #define APU_WANT_DB
    + *   #include "apu_want.h"
    + *
    + * The appropriate headers will be included.
    + *
    + * Note: it is safe to use this in a header (it won't interfere with other
    + *       headers' or source files' use of apu_want.h)
    + * 
    + */ + +/* --------------------------------------------------------------------- */ + +#ifdef APU_WANT_DB + +#if APU_HAVE_DB +/* win32 note.. you will need to change this for db1 */ +#include +#endif + +#undef APU_WANT_DB +#endif + +/* --------------------------------------------------------------------- */ diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h new file mode 100644 index 00000000000..de109de576d --- /dev/null +++ b/include/private/apr_crypto_internal.h @@ -0,0 +1,253 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_CRYPTO_INTERNAL_H +#define APR_CRYPTO_INTERNAL_H + +#include + +#include "apr_crypto.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if APU_HAVE_CRYPTO + +struct apr_crypto_driver_t { + + /** name */ + const char *name; + + /** + * @brief: allow driver to perform once-only initialisation. + * Called once only. + * @param pool The pool to register the cleanup in. + * @param params An array of optional init parameters. + */ + apr_status_t (*init)(apr_pool_t *pool, const apr_array_header_t *params, int *rc); + + /** + * @brief Create a context for supporting encryption. Keys, certificates, + * algorithms and other parameters will be set per context. More than + * one context can be created at one time. A cleanup will be automatically + * registered with the given pool to guarantee a graceful shutdown. + * @param driver - driver to use + * @param pool - process pool + * @param params - array of key parameters + * @param f - context pointer will be written here + * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE + * if the engine cannot be initialised. + */ + apr_status_t (*factory)(apr_pool_t *pool, const apr_array_header_t *params, + apr_crypto_t **f); + + /** + * @brief Create a key from the given passphrase. By default, the PBKDF2 + * algorithm is used to generate the key from the passphrase. It is expected + * that the same pass phrase will generate the same key, regardless of the + * backend crypto platform used. The key is cleaned up when the context + * is cleaned, and may be reused with multiple encryption or decryption + * operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param driver - driver to use + * @param p The pool to use. + * @param f The context to use. + * @param pass The passphrase to use. + * @param passLen The passphrase length in bytes + * @param salt The salt to use. + * @param saltLen The salt length in bytes + * @param type 3DES_192, AES_128, AES_192, AES_256. + * @param mode Electronic Code Book / Cipher Block Chaining. + * @param doPad Pad if necessary. + * @param key The key returned, see note. + * @param ivSize The size of the initialisation vector will be returned, based + * on whether an IV is relevant for this type of crypto. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ + apr_status_t (*passphrase)(apr_pool_t *p, const apr_crypto_t *f, + const char *pass, apr_size_t passLen, const unsigned char * salt, + apr_size_t saltLen, const apr_crypto_block_key_type_e type, + const apr_crypto_block_key_mode_e mode, const int doPad, + const int iterations, apr_crypto_key_t **key, apr_size_t *ivSize); + + /** + * @brief Initialise a context for encrypting arbitrary data using the given key. + * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If + * *ctx is not NULL, *ctx must point at a previously created structure. + * @param p The pool to use. + * @param f The block factory to use. + * @param key The key structure. + * @param iv Optional initialisation vector. If the buffer pointed to is NULL, + * an IV will be created at random, in space allocated from the pool. + * If the buffer pointed to is not NULL, the IV in the buffer will be + * used. + * @param ctx The block context returned, see note. + * @param ivSize The size of the initialisation vector will be returned, based + * on whether an IV is relevant for this type of crypto. + * @param blockSize The block size of the cipher. + * @return Returns APR_ENOIV if an initialisation vector is required but not specified. + * Returns APR_EINIT if the backend failed to initialise the context. Returns + * APR_ENOTIMPL if not implemented. + */ + apr_status_t (*block_encrypt_init)(apr_pool_t *p, const apr_crypto_t *f, + const apr_crypto_key_t *key, const unsigned char **iv, + apr_crypto_block_t **ctx, apr_size_t *blockSize); + + /** + * @brief Encrypt data provided by in, write it to out. + * @note The number of bytes written will be written to outlen. If + * out is NULL, outlen will contain the maximum size of the + * buffer needed to hold the data, including any data + * generated by apr_crypto_block_encrypt_finish below. If *out points + * to NULL, a buffer sufficiently large will be created from + * the pool provided. If *out points to a not-NULL value, this + * value will be used as a buffer instead. + * @param ctx The block context to use. + * @param out Address of a buffer to which data will be written, + * see note. + * @param outlen Length of the output will be written here. + * @param in Address of the buffer to read. + * @param inlen Length of the buffer to read. + * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if + * not implemented. + */ + apr_status_t (*block_encrypt)(apr_crypto_block_t *ctx, unsigned char **out, + apr_size_t *outlen, const unsigned char *in, apr_size_t inlen); + + /** + * @brief Encrypt final data block, write it to out. + * @note If necessary the final block will be written out after being + * padded. Typically the final block will be written to the + * same buffer used by apr_crypto_block_encrypt, offset by the + * number of bytes returned as actually written by the + * apr_crypto_block_encrypt() call. After this call, the context + * is cleaned and can be reused by apr_crypto_block_encrypt_init(). + * @param ctx The block context to use. + * @param out Address of a buffer to which data will be written. This + * buffer must already exist, and is usually the same + * buffer used by apr_evp_crypt(). See note. + * @param outlen Length of the output will be written here. + * @return APR_ECRYPT if an error occurred. + * @return APR_EPADDING if padding was enabled and the block was incorrectly + * formatted. + * @return APR_ENOTIMPL if not implemented. + */ + apr_status_t (*block_encrypt_finish)(apr_crypto_block_t *ctx, + unsigned char *out, apr_size_t *outlen); + + /** + * @brief Initialise a context for decrypting arbitrary data using the given key. + * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If + * *ctx is not NULL, *ctx must point at a previously created structure. + * @param p The pool to use. + * @param f The block factory to use. + * @param key The key structure. + * @param iv Optional initialisation vector. If the buffer pointed to is NULL, + * an IV will be created at random, in space allocated from the pool. + * If the buffer is not NULL, the IV in the buffer will be used. + * @param ctx The block context returned, see note. + * @param blockSize The block size of the cipher. + * @return Returns APR_ENOIV if an initialisation vector is required but not specified. + * Returns APR_EINIT if the backend failed to initialise the context. Returns + * APR_ENOTIMPL if not implemented. + */ + apr_status_t (*block_decrypt_init)(apr_pool_t *p, const apr_crypto_t *f, + const apr_crypto_key_t *key, const unsigned char *iv, + apr_crypto_block_t **ctx, apr_size_t *blockSize); + + /** + * @brief Decrypt data provided by in, write it to out. + * @note The number of bytes written will be written to outlen. If + * out is NULL, outlen will contain the maximum size of the + * buffer needed to hold the data, including any data + * generated by apr_crypto_block_decrypt_finish below. If *out points + * to NULL, a buffer sufficiently large will be created from + * the pool provided. If *out points to a not-NULL value, this + * value will be used as a buffer instead. + * @param ctx The block context to use. + * @param out Address of a buffer to which data will be written, + * see note. + * @param outlen Length of the output will be written here. + * @param in Address of the buffer to read. + * @param inlen Length of the buffer to read. + * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if + * not implemented. + */ + apr_status_t (*block_decrypt)(apr_crypto_block_t *ctx, unsigned char **out, + apr_size_t *outlen, const unsigned char *in, apr_size_t inlen); + + /** + * @brief Decrypt final data block, write it to out. + * @note If necessary the final block will be written out after being + * padded. Typically the final block will be written to the + * same buffer used by apr_crypto_block_decrypt, offset by the + * number of bytes returned as actually written by the + * apr_crypto_block_decrypt() call. After this call, the context + * is cleaned and can be reused by apr_crypto_block_decrypt_init(). + * @param ctx The block context to use. + * @param out Address of a buffer to which data will be written. This + * buffer must already exist, and is usually the same + * buffer used by apr_evp_crypt(). See note. + * @param outlen Length of the output will be written here. + * @return APR_ECRYPT if an error occurred. + * @return APR_EPADDING if padding was enabled and the block was incorrectly + * formatted. + * @return APR_ENOTIMPL if not implemented. + */ + apr_status_t (*block_decrypt_finish)(apr_crypto_block_t *ctx, + unsigned char *out, apr_size_t *outlen); + + /** + * @brief Clean encryption / decryption context. + * @note After cleanup, a context is free to be reused if necessary. + * @param driver - driver to use + * @param ctx The block context to use. + * @return Returns APR_ENOTIMPL if not supported. + */ + apr_status_t (*block_cleanup)(apr_crypto_block_t *ctx); + + /** + * @brief Clean encryption / decryption factory. + * @note After cleanup, a factory is free to be reused if necessary. + * @param driver - driver to use + * @param f The factory to use. + * @return Returns APR_ENOTIMPL if not supported. + */ + apr_status_t (*cleanup)(apr_crypto_t *f); + + /** + * @brief Clean encryption / decryption factory. + * @note After cleanup, a factory is free to be reused if necessary. + * @param pool The pool to use. + * @return Returns APR_ENOTIMPL if not supported. + */ + apr_status_t (*shutdown)(apr_pool_t *p); + +}; + +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/private/apr_dbd_internal.h b/include/private/apr_dbd_internal.h new file mode 100644 index 00000000000..671ffb21881 --- /dev/null +++ b/include/private/apr_dbd_internal.h @@ -0,0 +1,365 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* Overview of what this is and does: + * http://www.apache.org/~niq/dbd.html + */ + +#ifndef APR_DBD_INTERNAL_H +#define APR_DBD_INTERNAL_H + +#include + +#include "apr_dbd.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define TXN_IGNORE_ERRORS(t) \ + ((t) && ((t)->mode & APR_DBD_TRANSACTION_IGNORE_ERRORS)) +#define TXN_NOTICE_ERRORS(t) \ + ((t) && !((t)->mode & APR_DBD_TRANSACTION_IGNORE_ERRORS)) + +#define TXN_DO_COMMIT(t) (!((t)->mode & APR_DBD_TRANSACTION_ROLLBACK)) +#define TXN_DO_ROLLBACK(t) ((t)->mode & APR_DBD_TRANSACTION_ROLLBACK) + +#define TXN_MODE_BITS \ + (APR_DBD_TRANSACTION_ROLLBACK|APR_DBD_TRANSACTION_IGNORE_ERRORS) + +struct apr_dbd_driver_t { + /** name */ + const char *name; + + /** init: allow driver to perform once-only initialisation. + * Called once only. May be NULL + */ + void (*init)(apr_pool_t *pool); + + /** native_handle: return the native database handle of the underlying db + * + * @param handle - apr_dbd handle + * @return - native handle + */ + void *(*native_handle)(apr_dbd_t *handle); + + /** open: obtain a database connection from the server rec. + * Must be explicitly closed when you're finished with it. + * WARNING: only use this when you need a connection with + * a lifetime other than a request + * + * @param pool - a pool to use for error messages (if any). + * @param params - connection parameters. + * @param error - descriptive error. + * @return database handle, or NULL on error. + */ + apr_dbd_t *(*open)(apr_pool_t *pool, const char *params, + const char **error); + + /** check_conn: check status of a database connection + * + * @param pool - a pool to use for error messages (if any). + * @param handle - the connection to check + * @return APR_SUCCESS or error + */ + apr_status_t (*check_conn)(apr_pool_t *pool, apr_dbd_t *handle); + + /** close: close/release a connection obtained from open() + * + * @param handle - the connection to release + * @return APR_SUCCESS or error + */ + apr_status_t (*close)(apr_dbd_t *handle); + + /** set_dbname: select database name. May be a no-op if not supported. + * + * @param pool - working pool + * @param handle - the connection + * @param name - the database to select + * @return 0 for success or error code + */ + int (*set_dbname)(apr_pool_t* pool, apr_dbd_t *handle, const char *name); + + /** transaction: start a transaction. May be a no-op. + * + * @param pool - a pool to use for error messages (if any). + * @param handle - the connection + * @param trans - ptr to a transaction. May be null on entry + * @return 0 for success or error code + */ + int (*start_transaction)(apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_transaction_t **trans); + + /** end_transaction: end a transaction + * (commit on success, rollback on error). + * May be a no-op. + * + * @param trans - the transaction. + * @return 0 for success or error code + */ + int (*end_transaction)(apr_dbd_transaction_t *trans); + + /** query: execute an SQL query that doesn't return a result set + * + * @param handle - the connection + * @param nrows - number of rows affected. + * @param statement - the SQL statement to execute + * @return 0 for success or error code + */ + int (*query)(apr_dbd_t *handle, int *nrows, const char *statement); + + /** select: execute an SQL query that returns a result set + * + * @param pool - pool to allocate the result set + * @param handle - the connection + * @param res - pointer to result set pointer. May point to NULL on entry + * @param statement - the SQL statement to execute + * @param random - 1 to support random access to results (seek any row); + * 0 to support only looping through results in order + * (async access - faster) + * @return 0 for success or error code + */ + int (*select)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, + const char *statement, int random); + + /** num_cols: get the number of columns in a results set + * + * @param res - result set. + * @return number of columns + */ + int (*num_cols)(apr_dbd_results_t *res); + + /** num_tuples: get the number of rows in a results set + * of a synchronous select + * + * @param res - result set. + * @return number of rows, or -1 if the results are asynchronous + */ + int (*num_tuples)(apr_dbd_results_t *res); + + /** get_row: get a row from a result set + * + * @param pool - pool to allocate the row + * @param res - result set pointer + * @param row - pointer to row pointer. May point to NULL on entry + * @param rownum - row number, or -1 for "next row". Ignored if random + * access is not supported. + * @return 0 for success, -1 for rownum out of range or data finished + */ + int (*get_row)(apr_pool_t *pool, apr_dbd_results_t *res, + apr_dbd_row_t **row, int rownum); + + /** get_entry: get an entry from a row + * + * @param row - row pointer + * @param col - entry number + * @param val - entry to fill + * @return 0 for success, -1 for no data, +1 for general error + */ + const char* (*get_entry)(const apr_dbd_row_t *row, int col); + + /** error: get current error message (if any) + * + * @param handle - the connection + * @param errnum - error code from operation that returned an error + * @return the database current error message, or message for errnum + * (implementation-dependent whether errnum is ignored) + */ + const char *(*error)(apr_dbd_t *handle, int errnum); + + /** escape: escape a string so it is safe for use in query/select + * + * @param pool - pool to alloc the result from + * @param string - the string to escape + * @param handle - the connection + * @return the escaped, safe string + */ + const char *(*escape)(apr_pool_t *pool, const char *string, + apr_dbd_t *handle); + + /** prepare: prepare a statement + * + * @param pool - pool to alloc the result from + * @param handle - the connection + * @param query - the SQL query + * @param label - A label for the prepared statement. + * use NULL for temporary prepared statements + * (eg within a Request in httpd) + * @param nargs - number of parameters in the query + * @param nvals - number of values passed in p[b]query/select + * @param types - pointer to an array with types of parameters + * @param statement - statement to prepare. May point to null on entry. + * @return 0 for success or error code + */ + int (*prepare)(apr_pool_t *pool, apr_dbd_t *handle, const char *query, + const char *label, int nargs, int nvals, + apr_dbd_type_e *types, apr_dbd_prepared_t **statement); + + /** pvquery: query using a prepared statement + args + * + * @param pool - working pool + * @param handle - the connection + * @param nrows - number of rows affected. + * @param statement - the prepared statement to execute + * @param args - args to prepared statement + * @return 0 for success or error code + */ + int (*pvquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement, va_list args); + + /** pvselect: select using a prepared statement + args + * + * @param pool - working pool + * @param handle - the connection + * @param res - pointer to query results. May point to NULL on entry + * @param statement - the prepared statement to execute + * @param random - Whether to support random-access to results + * @param args - args to prepared statement + * @return 0 for success or error code + */ + int (*pvselect)(apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, int random, va_list args); + + /** pquery: query using a prepared statement + args + * + * @param pool - working pool + * @param handle - the connection + * @param nrows - number of rows affected. + * @param statement - the prepared statement to execute + * @param args - args to prepared statement + * @return 0 for success or error code + */ + int (*pquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement, const char **args); + + /** pselect: select using a prepared statement + args + * + * @param pool - working pool + * @param handle - the connection + * @param res - pointer to query results. May point to NULL on entry + * @param statement - the prepared statement to execute + * @param random - Whether to support random-access to results + * @param args - args to prepared statement + * @return 0 for success or error code + */ + int (*pselect)(apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_results_t **res, apr_dbd_prepared_t *statement, + int random, const char **args); + + + /** get_name: get a column title from a result set + * + * @param res - result set pointer + * @param col - entry number + * @return param name, or NULL if col is out of bounds. + */ + const char* (*get_name)(const apr_dbd_results_t *res, int col); + + /** transaction_mode_get: get the mode of transaction + * + * @param trans - the transaction. + * @return mode of transaction + */ + int (*transaction_mode_get)(apr_dbd_transaction_t *trans); + + /** transaction_mode_set: get the mode of transaction + * + * @param trans - the transaction. + * @param mode - new mode of the transaction + * @return the mode of transaction in force after the call + */ + int (*transaction_mode_set)(apr_dbd_transaction_t *trans, int mode); + + /** format of prepared statement parameters */ + const char *pformat; + + /** pvbquery: query using a prepared statement + binary args + * + * @param pool - working pool + * @param handle - the connection + * @param nrows - number of rows affected. + * @param statement - the prepared statement to execute + * @param args - binary args to prepared statement + * @return 0 for success or error code + */ + int (*pvbquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement, va_list args); + + /** pvbselect: select using a prepared statement + binary args + * + * @param pool - working pool + * @param handle - the connection + * @param res - pointer to query results. May point to NULL on entry + * @param statement - the prepared statement to execute + * @param random - Whether to support random-access to results + * @param args - binary args to prepared statement + * @return 0 for success or error code + */ + int (*pvbselect)(apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, int random, va_list args); + + /** pbquery: query using a prepared statement + binary args + * + * @param pool - working pool + * @param handle - the connection + * @param nrows - number of rows affected. + * @param statement - the prepared statement to execute + * @param args - binary args to prepared statement + * @return 0 for success or error code + */ + int (*pbquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement,const void **args); + + /** pbselect: select using a prepared statement + binary args + * + * @param pool - working pool + * @param handle - the connection + * @param res - pointer to query results. May point to NULL on entry + * @param statement - the prepared statement to execute + * @param random - Whether to support random-access to results + * @param args - binary args to prepared statement + * @return 0 for success or error code + */ + int (*pbselect)(apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_results_t **res, apr_dbd_prepared_t *statement, + int random, const void **args); + + /** datum_get: get a binary entry from a row + * + * @param row - row pointer + * @param col - entry number + * @param type - type of data to get + * @param data - pointer to data, allocated by the caller + * @return APR_SUCCESS, an error code on error or if col is out of bounds + */ + apr_status_t (*datum_get)(const apr_dbd_row_t *row, int col, + apr_dbd_type_e type, void *data); +}; + +/* Export mutex lock/unlock for drivers that need it + * deprecated; create a per-dbd mutex within the (*init) function + * to avoid blocking other providers running on other threads + */ +APU_DECLARE(apr_status_t) apr_dbd_mutex_lock(void); +APU_DECLARE(apr_status_t) apr_dbd_mutex_unlock(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/private/apr_dbd_odbc_v2.h b/include/private/apr_dbd_odbc_v2.h new file mode 100644 index 00000000000..dc7bc9c9c38 --- /dev/null +++ b/include/private/apr_dbd_odbc_v2.h @@ -0,0 +1,119 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/* ONLY USED FOR ODBC Version 2 -DODBCV2 +* +* Re-define everything to work (more-or-less) in an ODBC V2 environment +* Random access to retrieved rows is not supported - i.e. calls to apr_dbd_select() cannot +* have a 'random' argument of 1. apr_dbd_get_row() must always pass rownum as 0 (get next row) +* +*/ + +#define SQLHANDLE SQLHENV // Presumes that ENV, DBC, and STMT handles are all the same datatype +#define SQL_NULL_HANDLE 0 +#define SQL_HANDLE_STMT 1 +#define SQL_HANDLE_DBC 2 +#define SQL_HANDLE_ENV 3 +#define SQL_NO_DATA SQL_NO_DATA_FOUND + +#ifndef SQL_SUCCEEDED +#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0) +#endif + +#undef SQLSetEnvAttr +#define SQLSetEnvAttr(henv, Attribute, Value, StringLength) (0) + +#undef SQLAllocHandle +#define SQLAllocHandle(type, parent, hndl) \ +( (type == SQL_HANDLE_STMT) ? SQLAllocStmt(parent, hndl) \ + : (type == SQL_HANDLE_ENV) ? SQLAllocEnv(hndl) \ + : SQLAllocConnect(parent, hndl) \ +) + +#undef SQLFreeHandle +#define SQLFreeHandle(type, hndl) \ +( (type == SQL_HANDLE_STMT) ? SQLFreeStmt(hndl, SQL_DROP) \ + : (type == SQL_HANDLE_ENV) ? SQLFreeEnv(hndl) \ + : SQLFreeConnect(hndl) \ +) + +#undef SQLGetDiagRec +#define SQLGetDiagRec(type, h, i, state, native, buffer, bufsize, reslen) \ + SQLError( (type == SQL_HANDLE_ENV) ? h : NULL, \ + (type == SQL_HANDLE_DBC) ? h : NULL, \ + (type == SQL_HANDLE_STMT) ? h : NULL, \ + state, native, buffer, bufsize, reslen) + +#undef SQLCloseCursor +#define SQLCloseCursor(stmt) SQLFreeStmt(stmt, SQL_CLOSE) + +#undef SQLGetConnectAttr +#define SQLGetConnectAttr(hdbc, fOption, ValuePtr, BufferLength, NULL) \ + SQLGetConnectOption(hdbc, fOption, ValuePtr) + +#undef SQLSetConnectAttr +#define SQLSetConnectAttr(hdbc, fOption, ValuePtr, BufferLength) \ + SQLSetConnectOption(hdbc, fOption, (SQLUINTEGER) ValuePtr) + +#undef SQLSetStmtAttr +#define SQLSetStmtAttr(hstmt, fOption, ValuePtr, BufferLength) (0); return APR_ENOTIMPL; + +#undef SQLEndTran +#define SQLEndTran(hType, hdbc,type) SQLTransact(henv, hdbc, type) + +#undef SQLFetchScroll +#define SQLFetchScroll(stmt, orient, rownum) (0); return APR_ENOTIMPL; + +#define SQL_DESC_TYPE SQL_COLUMN_TYPE +#define SQL_DESC_CONCISE_TYPE SQL_COLUMN_TYPE +#define SQL_DESC_DISPLAY_SIZE SQL_COLUMN_DISPLAY_SIZE +#define SQL_DESC_OCTET_LENGTH SQL_COLUMN_LENGTH +#define SQL_DESC_UNSIGNED SQL_COLUMN_UNSIGNED + +#undef SQLColAttribute +#define SQLColAttribute(s, c, f, a, l, m, n) SQLColAttributes(s, c, f, a, l, m, n) + +#define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE +#define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT +#define SQL_ATTR_CONNECTION_TIMEOUT 113 +#define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER +#define SQL_ATTR_DISCONNECT_BEHAVIOR 114 +#define SQL_ATTR_ENLIST_IN_DTC 1207 +#define SQL_ATTR_ENLIST_IN_XA 1208 + +#define SQL_ATTR_CONNECTION_DEAD 1209 +#define SQL_CD_TRUE 1L /* Connection is closed/dead */ +#define SQL_CD_FALSE 0L /* Connection is open/available */ + +#define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT +#define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS +#define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE +#define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE +#define SQL_ATTR_TRACE SQL_OPT_TRACE +#define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE +#define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL +#define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION +#define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION + +#define SQL_ATTR_CURSOR_SCROLLABLE -1 + +#define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */ +#define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */ + +#define SQL_FALSE 0 +#define SQL_TRUE 1 + diff --git a/include/private/apr_dbm_private.h b/include/private/apr_dbm_private.h new file mode 100644 index 00000000000..020d3a6b8c7 --- /dev/null +++ b/include/private/apr_dbm_private.h @@ -0,0 +1,121 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_DBM_PRIVATE_H +#define APR_DBM_PRIVATE_H + +#include "apr.h" +#include "apr_errno.h" +#include "apr_pools.h" +#include "apr_dbm.h" +#include "apr_file_io.h" + +#include "apu.h" + +/* ### for now, include the DBM selection; this will go away once we start + ### building and linking all of the DBMs at once. */ +#include "apu_select_dbm.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @internal */ + +/** + * Most DBM libraries take a POSIX mode for creating files. Don't trust + * the mode_t type, some platforms may not support it, int is safe. + */ +APU_DECLARE(int) apr_posix_perms2mode(apr_fileperms_t perm); + +/** + * Structure to describe the operations of the DBM + */ +typedef struct { + /** The name of the DBM Type */ + const char *name; + + /** Open the DBM */ + apr_status_t (*open)(apr_dbm_t **pdb, const char *pathname, + apr_int32_t mode, apr_fileperms_t perm, + apr_pool_t *pool); + + /** Close the DBM */ + void (*close)(apr_dbm_t *dbm); + + /** Fetch a dbm record value by key */ + apr_status_t (*fetch)(apr_dbm_t *dbm, apr_datum_t key, + apr_datum_t * pvalue); + + /** Store a dbm record value by key */ + apr_status_t (*store)(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t value); + + /** Delete a dbm record value by key */ + apr_status_t (*del)(apr_dbm_t *dbm, apr_datum_t key); + + /** Search for a key within the dbm */ + int (*exists)(apr_dbm_t *dbm, apr_datum_t key); + + /** Retrieve the first record key from a dbm */ + apr_status_t (*firstkey)(apr_dbm_t *dbm, apr_datum_t * pkey); + + /** Retrieve the next record key from a dbm */ + apr_status_t (*nextkey)(apr_dbm_t *dbm, apr_datum_t * pkey); + + /** Proactively toss any memory associated with the apr_datum_t. */ + void (*freedatum)(apr_dbm_t *dbm, apr_datum_t data); + + /** Get the names that the DBM will use for a given pathname. */ + void (*getusednames)(apr_pool_t *pool, + const char *pathname, + const char **used1, + const char **used2); + +} apr_dbm_type_t; + + +/** + * The actual DBM + */ +struct apr_dbm_t +{ + /** Associated pool */ + apr_pool_t *pool; + + /** pointer to DB Implementation Specific data */ + void *file; + + /** Current integer error code */ + int errcode; + /** Current string error code */ + const char *errmsg; + + /** the type of DBM */ + const apr_dbm_type_t *type; +}; + + +/* Declare all of the DBM provider tables */ +APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_sdbm; +APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_gdbm; +APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_ndbm; +APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db; + +#ifdef __cplusplus +} +#endif + +#endif /* APR_DBM_PRIVATE_H */ diff --git a/include/private/apu_config.hnw b/include/private/apu_config.hnw new file mode 100644 index 00000000000..9c6c73e4627 --- /dev/null +++ b/include/private/apu_config.hnw @@ -0,0 +1,53 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Note: This is a NetWare specific version of apu_config.hnw. It is copied + * as apu_config.h at the start of a NetWare build. + */ + +#ifdef NETWARE + +#ifndef APU_CONFIG_H +#define APU_CONFIG_H + +/* Always compile Netware with DSO support for .nlm builds */ +#define APU_DSO_BUILD 0 + +/* + * NetWare does not have GDBM, and we always use the bundled (new) Expat + */ + +/* Define if you have the gdbm library (-lgdbm). */ +/* #undef HAVE_LIBGDBM */ + +/* define if Expat 1.0 or 1.1 was found */ +/* #undef APR_HAVE_OLD_EXPAT */ + +/* NetWare uses its own ICONV implementation. */ +#define HAVE_ICONV_H 1 + +/* + * check for newer NDKs which use now correctly 'const char*' with iconv. + */ +#include +#if (CURRENT_NDK_THRESHOLD >= 705110000) +#define APU_ICONV_INBUF_CONST +#endif + +#endif /* APU_CONFIG_H */ +#endif /* NETWARE */ + diff --git a/include/private/apu_config.hw b/include/private/apu_config.hw new file mode 100644 index 00000000000..015dd52639f --- /dev/null +++ b/include/private/apu_config.hw @@ -0,0 +1,46 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Note: This is a Windows specific version of apu_config.hw. It is copied + * as apu_config.h at the start of a Windows build. + */ + +#ifdef WIN32 + +#ifndef APU_CONFIG_H +#define APU_CONFIG_H + +/* Compile win32 with DSO support for .dll builds */ +#ifdef APU_DECLARE_STATIC +#define APU_DSO_BUILD 0 +#else +#define APU_DSO_BUILD 1 +#endif + +/* + * Windows does not have GDBM, and we always use the bundled (new) Expat + */ + +/* Define if you have the gdbm library (-lgdbm). */ +/* #undef HAVE_LIBGDBM */ + +/* define if Expat 1.0 or 1.1 was found */ +/* #undef APR_HAVE_OLD_EXPAT */ + + +#endif /* APU_CONFIG_H */ +#endif /* WIN32 */ diff --git a/include/private/apu_internal.h b/include/private/apu_internal.h new file mode 100644 index 00000000000..c95c9d502c4 --- /dev/null +++ b/include/private/apu_internal.h @@ -0,0 +1,73 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr.h" +#include "apr_dso.h" +#include "apu.h" + +#ifndef APU_INTERNAL_H +#define APU_INTERNAL_H + +#if APU_DSO_BUILD + +#ifdef __cplusplus +extern "C" { +#endif + +/* For modular dso loading, an internal interlock to allow us to + * continue to initialize modules by multiple threads, the caller + * of apu_dso_load must lock first, and not unlock until any init + * finalization is complete. + */ +apr_status_t apu_dso_init(apr_pool_t *pool); + +apr_status_t apu_dso_mutex_lock(void); +apr_status_t apu_dso_mutex_unlock(void); + +apr_status_t apu_dso_load(apr_dso_handle_t **dso, apr_dso_handle_sym_t *dsoptr, const char *module, + const char *modsym, apr_pool_t *pool); + +#if APR_HAS_LDAP + +/* For LDAP internal builds, wrap our LDAP namespace */ + +struct apr__ldap_dso_fntable { + int (*info)(apr_pool_t *pool, apr_ldap_err_t **result_err); + int (*init)(apr_pool_t *pool, LDAP **ldap, const char *hostname, + int portno, int secure, apr_ldap_err_t **result_err); + int (*ssl_init)(apr_pool_t *pool, const char *cert_auth_file, + int cert_file_type, apr_ldap_err_t **result_err); + int (*ssl_deinit)(void); + int (*get_option)(apr_pool_t *pool, LDAP *ldap, int option, + void *outvalue, apr_ldap_err_t **result_err); + int (*set_option)(apr_pool_t *pool, LDAP *ldap, int option, + const void *invalue, apr_ldap_err_t **result_err); + apr_status_t (*rebind_init)(apr_pool_t *pool); + apr_status_t (*rebind_add)(apr_pool_t *pool, LDAP *ld, + const char *bindDN, const char *bindPW); + apr_status_t (*rebind_remove)(LDAP *ld); +}; + +#endif /* APR_HAS_LDAP */ + +#ifdef __cplusplus +} +#endif + +#endif /* APU_DSO_BUILD */ + +#endif /* APU_INTERNAL_H */ + diff --git a/include/private/apu_select_dbm.h.in b/include/private/apu_select_dbm.h.in new file mode 100644 index 00000000000..b69aec032cd --- /dev/null +++ b/include/private/apu_select_dbm.h.in @@ -0,0 +1,28 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APU_SELECT_DBM_H +#define APU_SELECT_DBM_H + +/* +** The following macros control what features APRUTIL will use +*/ +#define APU_USE_SDBM @apu_use_sdbm@ +#define APU_USE_NDBM @apu_use_ndbm@ +#define APU_USE_GDBM @apu_use_gdbm@ +#define APU_USE_DB @apu_use_db@ + +#endif /* !APU_SELECT_DBM_H */ diff --git a/include/private/apu_select_dbm.hw b/include/private/apu_select_dbm.hw new file mode 100644 index 00000000000..97c7b6c22ba --- /dev/null +++ b/include/private/apu_select_dbm.hw @@ -0,0 +1,28 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APU_SELECT_DBM_H +#define APU_SELECT_DBM_H + +/* +** The following macros control what features APRUTIL will use +*/ +#define APU_USE_SDBM 1 +#define APU_USE_GDBM 0 +#define APU_USE_NDBM 0 +#define APU_USE_DB 0 + +#endif /* !APU_SELECT_DBM_H */ diff --git a/ldap/NWGNUmakefile b/ldap/NWGNUmakefile new file mode 100644 index 00000000000..967a9f1f0ff --- /dev/null +++ b/ldap/NWGNUmakefile @@ -0,0 +1,263 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(APR_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR)/include \ + $(APR)/include/arch/NetWare \ + $(APRUTIL)/include \ + $(APRUTIL)/include/private \ + $(LDAPSDK)/inc \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +#LDAP client requires the use of Winsock +# +ifdef USE_STDSOCKETS +XDEFINES += -DUSE_WINSOCK \ + $(EOLIST) +endif + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = +# +# If this is specified, it will override VERSION value in +# $(APR_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If this is specified it will be used by the link '-flags' directive +# +NLM_FLAGS = + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can +# be disabled by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# Declare all target files (you must add your files here) +# + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(OBJDIR)/apuldap.lib \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override the default copyright. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(OBJDIR)/apr_ldap_init.o \ + $(OBJDIR)/apr_ldap_option.o \ + $(OBJDIR)/apr_ldap_url.o \ + $(OBJDIR)/apr_ldap_rebind.o \ + $(OBJDIR)/apr_ldap_stub.o \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)\build\NWGNUtail.inc + diff --git a/ldap/apr_ldap.dsp b/ldap/apr_ldap.dsp new file mode 100644 index 00000000000..095e3af5aaf --- /dev/null +++ b/ldap/apr_ldap.dsp @@ -0,0 +1,227 @@ +# Microsoft Developer Studio Project File - Name="apr_ldap" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=apr_ldap - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr_ldap.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr_ldap.mak" CFG="apr_ldap - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr_ldap - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_ldap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_ldap - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_ldap - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "apr_ldap - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_ldap_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"Release/apr_ldap-1.res" /d DLL_NAME="apr_ldap" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_ldap-1.dll" /pdb:"Release\apr_ldap-1.pdb" /implib:"Release\apr_ldap-1.lib" /MACHINE:X86 /opt:ref +# Begin Special Build Tool +TargetPath=Release\apr_ldap-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_ldap - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_ldap_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"Debug/apr_ldap-1.res" /d DLL_NAME="apr_ldap" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_ldap-1.dll" /pdb:"Debug\apr_ldap-1.pdb" /implib:"Debug\apr_ldap-1.lib" /MACHINE:X86 +# Begin Special Build Tool +TargetPath=Debug\apr_ldap-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_ldap - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\Release" +# PROP BASE Intermediate_Dir "x64\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\Release" +# PROP Intermediate_Dir "x64\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_ldap_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"x64/Release/apr_ldap-1.res" /d DLL_NAME="apr_ldap" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_ldap-1.dll" /pdb:"x64\Release\apr_ldap-1.pdb" /implib:"x64\Release\apr_ldap-1.lib" /MACHINE:X64 /opt:ref +# Begin Special Build Tool +TargetPath=x64\Release\apr_ldap-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_ldap - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\Debug" +# PROP BASE Intermediate_Dir "x64\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\Debug" +# PROP Intermediate_Dir "x64\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_ldap_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_ldap-1.res" /d DLL_NAME="apr_ldap" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_ldap-1.dll" /pdb:"x64\Debug\apr_ldap-1.pdb" /implib:"x64\Debug\apr_ldap-1.lib" /MACHINE:X64 +# Begin Special Build Tool +TargetPath=x64\Debug\apr_ldap-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "apr_ldap - Win32 Release" +# Name "apr_ldap - Win32 Debug" +# Name "apr_ldap - x64 Release" +# Name "apr_ldap - x64 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\apr_ldap_init.c +# End Source File +# Begin Source File + +SOURCE=.\apr_ldap_option.c +# End Source File +# Begin Source File + +SOURCE=.\apr_ldap_rebind.c +# End Source File +# End Group +# Begin Group "Public Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\apr_ldap.h +# End Source File +# Begin Source File + +SOURCE=..\include\apr_ldap_init.h +# End Source File +# Begin Source File + +SOURCE=..\include\apr_ldap_option.h +# End Source File +# Begin Source File + +SOURCE=..\include\apr_ldap_rebind.h +# End Source File +# Begin Source File + +SOURCE=..\include\apr_ldap_url.h +# End Source File +# End Group +# Begin Group "Internal Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\private\apu_config.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_internal.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\libaprutil.rc +# End Source File +# End Target +# End Project diff --git a/ldap/apr_ldap_init.c b/ldap/apr_ldap_init.c new file mode 100644 index 00000000000..458f281bbba --- /dev/null +++ b/ldap/apr_ldap_init.c @@ -0,0 +1,219 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * apr_ldap_init.c: LDAP v2/v3 common initialise + * + * Original code from auth_ldap module for Apache v1.3: + * Copyright 1998, 1999 Enbridge Pipelines Inc. + * Copyright 1999-2001 Dave Carrigan + */ + +#include "apr.h" +#include "apu.h" +#include "apu_config.h" + +#if APU_DSO_BUILD +#define APU_DSO_LDAP_BUILD +#endif + +#include "apr_ldap.h" +#include "apu_internal.h" +#include "apr_errno.h" +#include "apr_pools.h" +#include "apr_strings.h" + +#if APR_HAS_LDAP + +/** + * APR LDAP SSL Initialise function + * + * This function initialises SSL on the underlying LDAP toolkit + * if this is necessary. + * + * If a CA certificate is provided, this is set, however the setting + * of certificates via this method has been deprecated and will be removed in + * APR v2.0. + * + * The apr_ldap_set_option() function with the APR_LDAP_OPT_TLS_CERT option + * should be used instead to set certificates. + * + * If SSL support is not available on this platform, or a problem + * was encountered while trying to set the certificate, the function + * will return APR_EGENERAL. Further LDAP specific error information + * can be found in result_err. + */ +APU_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool, + const char *cert_auth_file, + int cert_file_type, + apr_ldap_err_t **result_err) +{ + + apr_ldap_err_t *result = (apr_ldap_err_t *)apr_pcalloc(pool, sizeof(apr_ldap_err_t)); + *result_err = result; + +#if APR_HAS_LDAP_SSL /* compiled with ssl support */ + + /* Novell */ +#if APR_HAS_NOVELL_LDAPSDK + ldapssl_client_init(NULL, NULL); +#endif + + /* if a certificate was specified, set it */ + if (cert_auth_file) { + apr_ldap_opt_tls_cert_t *cert = (apr_ldap_opt_tls_cert_t *)apr_pcalloc(pool, sizeof(apr_ldap_opt_tls_cert_t)); + cert->type = cert_file_type; + cert->path = cert_auth_file; + return apr_ldap_set_option(pool, NULL, APR_LDAP_OPT_TLS_CERT, (void *)cert, result_err); + } + +#else /* not compiled with SSL Support */ + if (cert_auth_file) { + result->reason = "LDAP: Attempt to set certificate store failed. " + "Not built with SSL support"; + result->rc = -1; + } +#endif /* APR_HAS_LDAP_SSL */ + + if (result->rc != -1) { + result->msg = ldap_err2string(result->rc); + } + + if (LDAP_SUCCESS != result->rc) { + return APR_EGENERAL; + } + + return APR_SUCCESS; + +} + + +/** + * APR LDAP SSL De-Initialise function + * + * This function tears down any SSL certificate setup previously + * set using apr_ldap_ssl_init(). It should be called to clean + * up if a graceful restart of a service is attempted. + * + * This function only does anything on Netware. + * + * @todo currently we do not check whether apr_ldap_ssl_init() + * has been called first - should we? + */ +APU_DECLARE_LDAP(int) apr_ldap_ssl_deinit(void) +{ + +#if APR_HAS_LDAP_SSL && APR_HAS_LDAPSSL_CLIENT_DEINIT + ldapssl_client_deinit(); +#endif + return APR_SUCCESS; + +} + + +/** + * APR LDAP initialise function + * + * This function is responsible for initialising an LDAP + * connection in a toolkit independant way. It does the + * job of ldap_init() from the C api. + * + * It handles both the SSL and non-SSL case, and attempts + * to hide the complexity setup from the user. This function + * assumes that any certificate setup necessary has already + * been done. + * + * If SSL or STARTTLS needs to be enabled, and the underlying + * toolkit supports it, the following values are accepted for + * secure: + * + * APR_LDAP_NONE: No encryption + * APR_LDAP_SSL: SSL encryption (ldaps://) + * APR_LDAP_STARTTLS: Force STARTTLS on ldap:// + */ +APU_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool, + LDAP **ldap, + const char *hostname, + int portno, + int secure, + apr_ldap_err_t **result_err) +{ + + apr_ldap_err_t *result = (apr_ldap_err_t *)apr_pcalloc(pool, sizeof(apr_ldap_err_t)); + *result_err = result; + +#if APR_HAS_LDAPSSL_INIT + *ldap = ldapssl_init(hostname, portno, 0); +#elif APR_HAS_LDAP_SSLINIT + *ldap = ldap_sslinit((char *)hostname, portno, 0); +#else + *ldap = ldap_init((char *)hostname, portno); +#endif + if (*ldap != NULL) { + return apr_ldap_set_option(pool, *ldap, APR_LDAP_OPT_TLS, &secure, result_err); + } + else { + /* handle the error case */ + apr_ldap_err_t *result = (apr_ldap_err_t *)apr_pcalloc(pool, sizeof(apr_ldap_err_t)); + *result_err = result; + + result->reason = "APR LDAP: Unable to initialize the LDAP connection"; + result->rc = -1; + return APR_EGENERAL; + } + +} + + +/** + * APR LDAP info function + * + * This function returns a string describing the LDAP toolkit + * currently in use. The string is placed inside result_err->reason. + */ +APU_DECLARE_LDAP(int) apr_ldap_info(apr_pool_t *pool, + apr_ldap_err_t **result_err) +{ + apr_ldap_err_t *result = (apr_ldap_err_t *)apr_pcalloc(pool, sizeof(apr_ldap_err_t)); + *result_err = result; + + result->reason = "APR LDAP: Built with " + LDAP_VENDOR_NAME + " LDAP SDK"; + return APR_SUCCESS; + +} + +#if APU_DSO_BUILD + +/* For DSO builds, export the table of entry points into the apr_ldap DSO + * See include/private/apu_internal.h for the corresponding declarations + */ +APU_MODULE_DECLARE_DATA struct apr__ldap_dso_fntable apr__ldap_fns = { + apr_ldap_info, + apr_ldap_init, + apr_ldap_ssl_init, + apr_ldap_ssl_deinit, + apr_ldap_get_option, + apr_ldap_set_option, + apr_ldap_rebind_init, + apr_ldap_rebind_add, + apr_ldap_rebind_remove +}; + +#endif /* APU_DSO_BUILD */ + +#endif /* APR_HAS_LDAP */ diff --git a/ldap/apr_ldap_option.c b/ldap/apr_ldap_option.c new file mode 100644 index 00000000000..0c055b4e001 --- /dev/null +++ b/ldap/apr_ldap_option.c @@ -0,0 +1,652 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* apr_ldap_option.c -- LDAP options + * + * The LDAP SDK allows the getting and setting of options on an LDAP + * connection. + * + */ + +#include "apr.h" +#include "apu.h" +#include "apu_config.h" + +#if APU_DSO_BUILD +#define APU_DSO_LDAP_BUILD +#endif + +#include "apr_ldap.h" +#include "apr_errno.h" +#include "apr_pools.h" +#include "apr_strings.h" +#include "apr_tables.h" + +#if APR_HAS_LDAP + +static void option_set_cert(apr_pool_t *pool, LDAP *ldap, const void *invalue, + apr_ldap_err_t *result); +static void option_set_tls(apr_pool_t *pool, LDAP *ldap, const void *invalue, + apr_ldap_err_t *result); + +/** + * APR LDAP get option function + * + * This function gets option values from a given LDAP session if + * one was specified. + */ +APU_DECLARE_LDAP(int) apr_ldap_get_option(apr_pool_t *pool, + LDAP *ldap, + int option, + void *outvalue, + apr_ldap_err_t **result_err) +{ + apr_ldap_err_t *result; + + result = apr_pcalloc(pool, sizeof(apr_ldap_err_t)); + *result_err = result; + if (!result) { + return APR_ENOMEM; + } + + /* get the option specified using the native LDAP function */ + result->rc = ldap_get_option(ldap, option, outvalue); + + /* handle the error case */ + if (result->rc != LDAP_SUCCESS) { + result->msg = ldap_err2string(result-> rc); + result->reason = apr_pstrdup(pool, "LDAP: Could not get an option"); + return APR_EGENERAL; + } + + return APR_SUCCESS; + +} + +/** + * APR LDAP set option function + * + * This function sets option values to a given LDAP session if + * one was specified. + * + * Where an option is not supported by an LDAP toolkit, this function + * will try and apply legacy functions to achieve the same effect, + * depending on the platform. + */ +APU_DECLARE_LDAP(int) apr_ldap_set_option(apr_pool_t *pool, + LDAP *ldap, + int option, + const void *invalue, + apr_ldap_err_t **result_err) +{ + apr_ldap_err_t *result; + + result = apr_pcalloc(pool, sizeof(apr_ldap_err_t)); + *result_err = result; + if (!result) { + return APR_ENOMEM; + } + + switch (option) { + case APR_LDAP_OPT_TLS_CERT: + option_set_cert(pool, ldap, invalue, result); + break; + + case APR_LDAP_OPT_TLS: + option_set_tls(pool, ldap, invalue, result); + break; + + case APR_LDAP_OPT_VERIFY_CERT: +#if APR_HAS_NETSCAPE_LDAPSDK || APR_HAS_SOLARIS_LDAPSDK || APR_HAS_MOZILLA_LDAPSK + result->reason = "LDAP: Verify certificate not yet supported by APR on the " + "Netscape, Solaris or Mozilla LDAP SDKs"; + result->rc = -1; + return APR_EGENERAL; +#endif +#if APR_HAS_NOVELL_LDAPSDK + if (*((int*)invalue)) { + result->rc = ldapssl_set_verify_mode(LDAPSSL_VERIFY_SERVER); + } + else { + result->rc = ldapssl_set_verify_mode(LDAPSSL_VERIFY_NONE); + } +#endif +#if APR_HAS_OPENLDAP_LDAPSDK +#ifdef LDAP_OPT_X_TLS + /* This is not a per-connection setting so just pass NULL for the + Ldap connection handle */ + if (*((int*)invalue)) { + int i = LDAP_OPT_X_TLS_DEMAND; + result->rc = ldap_set_option(NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &i); + } + else { + int i = LDAP_OPT_X_TLS_NEVER; + result->rc = ldap_set_option(NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &i); + } +#else + result->reason = "LDAP: SSL/TLS not yet supported by APR on this " + "version of the OpenLDAP toolkit"; + result->rc = -1; + return APR_EGENERAL; +#endif +#endif + + /* handle the error case */ + if (result->rc != LDAP_SUCCESS) { + result->msg = ldap_err2string(result->rc); + result->reason = "LDAP: Could not set verify mode"; + } + break; + + case APR_LDAP_OPT_REFERRALS: + /* Setting this option is supported on at least TIVOLI_SDK and OpenLDAP. Folks + * who know the NOVELL, NETSCAPE, MOZILLA, and SOLARIS SDKs should note here if + * the SDK at least tolerates this option being set, or add an elif to handle + * special cases (i.e. different LDAP_OPT_X value). + */ + result->rc = ldap_set_option(ldap, LDAP_OPT_REFERRALS, (void *)invalue); + + if (result->rc != LDAP_SUCCESS) { + result->reason = "Unable to set LDAP_OPT_REFERRALS."; + return(result->rc); + } + break; + + case APR_LDAP_OPT_REFHOPLIMIT: +#if !defined(LDAP_OPT_REFHOPLIMIT) || APR_HAS_NOVELL_LDAPSDK + /* If the LDAP_OPT_REFHOPLIMIT symbol is missing, assume that the + * particular LDAP library has a reasonable default. So far certain + * versions of the OpenLDAP SDK miss this symbol (but default to 5), + * and the Microsoft SDK misses the symbol (the default is not known). + */ + result->rc = LDAP_SUCCESS; +#else + /* Setting this option is supported on at least TIVOLI_SDK. Folks who know + * the NOVELL, NETSCAPE, MOZILLA, and SOLARIS SDKs should note here if + * the SDK at least tolerates this option being set, or add an elif to handle + * special cases so an error isn't returned if there is a perfectly good + * default value that just can't be changed (like openLDAP). + */ + result->rc = ldap_set_option(ldap, LDAP_OPT_REFHOPLIMIT, (void *)invalue); +#endif + + if (result->rc != LDAP_SUCCESS) { + result->reason = "Unable to set LDAP_OPT_REFHOPLIMIT."; + return(result->rc); + } + break; + + default: + /* set the option specified using the native LDAP function */ + result->rc = ldap_set_option(ldap, option, (void *)invalue); + + /* handle the error case */ + if (result->rc != LDAP_SUCCESS) { + result->msg = ldap_err2string(result->rc); + result->reason = "LDAP: Could not set an option"; + } + break; + } + + /* handle the error case */ + if (result->rc != LDAP_SUCCESS) { + return APR_EGENERAL; + } + + return APR_SUCCESS; + +} + +/** + * Handle APR_LDAP_OPT_TLS + * + * This function sets the type of TLS to be applied to this connection. + * The options are: + * APR_LDAP_NONE: no encryption + * APR_LDAP_SSL: SSL encryption (ldaps://) + * APR_LDAP_STARTTLS: STARTTLS encryption + * APR_LDAP_STOPTLS: Stop existing TLS connecttion + */ +static void option_set_tls(apr_pool_t *pool, LDAP *ldap, const void *invalue, + apr_ldap_err_t *result) +{ +#if APR_HAS_LDAP_SSL /* compiled with ssl support */ + + int tls = * (const int *)invalue; + + /* Netscape/Mozilla/Solaris SDK */ +#if APR_HAS_NETSCAPE_LDAPSDK || APR_HAS_SOLARIS_LDAPSDK || APR_HAS_MOZILLA_LDAPSK +#if APR_HAS_LDAPSSL_INSTALL_ROUTINES + if (tls == APR_LDAP_SSL) { + result->rc = ldapssl_install_routines(ldap); +#ifdef LDAP_OPT_SSL + /* apparently Netscape and Mozilla need this too, Solaris doesn't */ + if (result->rc == LDAP_SUCCESS) { + result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, LDAP_OPT_ON); + } +#endif + if (result->rc != LDAP_SUCCESS) { + result->msg = ldap_err2string(result->rc); + result->reason = "LDAP: Could not switch SSL on for this " + "connection."; + } + } + else if (tls == APR_LDAP_STARTTLS) { + result->reason = "LDAP: STARTTLS is not supported by the " + "Netscape/Mozilla/Solaris SDK"; + result->rc = -1; + } + else if (tls == APR_LDAP_STOPTLS) { + result->reason = "LDAP: STOPTLS is not supported by the " + "Netscape/Mozilla/Solaris SDK"; + result->rc = -1; + } +#else + if (tls != APR_LDAP_NONE) { + result->reason = "LDAP: SSL/TLS is not supported by this version " + "of the Netscape/Mozilla/Solaris SDK"; + result->rc = -1; + } +#endif +#endif + + /* Novell SDK */ +#if APR_HAS_NOVELL_LDAPSDK + /* ldapssl_install_routines(ldap) + * Behavior is unpredictable when other LDAP functions are called + * between the ldap_init function and the ldapssl_install_routines + * function. + * + * STARTTLS is supported by the ldap_start_tls_s() method + */ + if (tls == APR_LDAP_SSL) { + result->rc = ldapssl_install_routines(ldap); + if (result->rc != LDAP_SUCCESS) { + result->msg = ldap_err2string(result->rc); + result->reason = "LDAP: Could not switch SSL on for this " + "connection."; + } + } + if (tls == APR_LDAP_STARTTLS) { + result->rc = ldapssl_start_tls(ldap); + if (result->rc != LDAP_SUCCESS) { + result->msg = ldap_err2string(result->rc); + result->reason = "LDAP: Could not start TLS on this connection"; + } + } + else if (tls == APR_LDAP_STOPTLS) { + result->rc = ldapssl_stop_tls(ldap); + if (result->rc != LDAP_SUCCESS) { + result->msg = ldap_err2string(result->rc); + result->reason = "LDAP: Could not stop TLS on this connection"; + } + } +#endif + + /* OpenLDAP SDK */ +#if APR_HAS_OPENLDAP_LDAPSDK +#ifdef LDAP_OPT_X_TLS + if (tls == APR_LDAP_SSL) { + int SSLmode = LDAP_OPT_X_TLS_HARD; + result->rc = ldap_set_option(ldap, LDAP_OPT_X_TLS, &SSLmode); + if (result->rc != LDAP_SUCCESS) { + result->reason = "LDAP: ldap_set_option failed. " + "Could not set LDAP_OPT_X_TLS to " + "LDAP_OPT_X_TLS_HARD"; + result->msg = ldap_err2string(result->rc); + } + } + else if (tls == APR_LDAP_STARTTLS) { + result->rc = ldap_start_tls_s(ldap, NULL, NULL); + if (result->rc != LDAP_SUCCESS) { + result->reason = "LDAP: ldap_start_tls_s() failed"; + result->msg = ldap_err2string(result->rc); + } + } + else if (tls == APR_LDAP_STOPTLS) { + result->reason = "LDAP: STOPTLS is not supported by the " + "OpenLDAP SDK"; + result->rc = -1; + } +#else + if (tls != APR_LDAP_NONE) { + result->reason = "LDAP: SSL/TLS not yet supported by APR on this " + "version of the OpenLDAP toolkit"; + result->rc = -1; + } +#endif +#endif + + /* Microsoft SDK */ +#if APR_HAS_MICROSOFT_LDAPSDK + if (tls == APR_LDAP_NONE) { + ULONG ul = (ULONG) LDAP_OPT_OFF; + result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, &ul); + if (result->rc != LDAP_SUCCESS) { + result->reason = "LDAP: an attempt to set LDAP_OPT_SSL off " + "failed."; + result->msg = ldap_err2string(result->rc); + } + } + else if (tls == APR_LDAP_SSL) { + ULONG ul = (ULONG) LDAP_OPT_ON; + result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, &ul); + if (result->rc != LDAP_SUCCESS) { + result->reason = "LDAP: an attempt to set LDAP_OPT_SSL on " + "failed."; + result->msg = ldap_err2string(result->rc); + } + } +#if APR_HAS_LDAP_START_TLS_S + else if (tls == APR_LDAP_STARTTLS) { + result->rc = ldap_start_tls_s(ldap, NULL, NULL, NULL, NULL); + if (result->rc != LDAP_SUCCESS) { + result->reason = "LDAP: ldap_start_tls_s() failed"; + result->msg = ldap_err2string(result->rc); + } + } + else if (tls == APR_LDAP_STOPTLS) { + result->rc = ldap_stop_tls_s(ldap); + if (result->rc != LDAP_SUCCESS) { + result->reason = "LDAP: ldap_stop_tls_s() failed"; + result->msg = ldap_err2string(result->rc); + } + } +#endif +#endif + +#if APR_HAS_OTHER_LDAPSDK + if (tls != APR_LDAP_NONE) { + result->reason = "LDAP: SSL/TLS is currently not supported by " + "APR on this LDAP SDK"; + result->rc = -1; + } +#endif + +#endif /* APR_HAS_LDAP_SSL */ + +} + +/** + * Handle APR_LDAP_OPT_TLS_CACERTFILE + * + * This function sets the CA certificate for further SSL/TLS connections. + * + * The file provided are in different formats depending on the toolkit used: + * + * Netscape: cert7.db file + * Novell: PEM or DER + * OpenLDAP: PEM (others supported?) + * Microsoft: unknown + * Solaris: unknown + */ +static void option_set_cert(apr_pool_t *pool, LDAP *ldap, + const void *invalue, apr_ldap_err_t *result) +{ +#if APR_HAS_LDAP_SSL +#if APR_HAS_LDAPSSL_CLIENT_INIT || APR_HAS_OPENLDAP_LDAPSDK + apr_array_header_t *certs = (apr_array_header_t *)invalue; + struct apr_ldap_opt_tls_cert_t *ents = (struct apr_ldap_opt_tls_cert_t *)certs->elts; + int i = 0; +#endif + + /* Netscape/Mozilla/Solaris SDK */ +#if APR_HAS_NETSCAPE_LDAPSDK || APR_HAS_SOLARIS_LDAPSDK || APR_HAS_MOZILLA_LDAPSDK +#if APR_HAS_LDAPSSL_CLIENT_INIT + const char *nickname = NULL; + const char *secmod = NULL; + const char *key3db = NULL; + const char *cert7db = NULL; + const char *password = NULL; + + /* set up cert7.db, key3.db and secmod parameters */ + for (i = 0; i < certs->nelts; i++) { + switch (ents[i].type) { + case APR_LDAP_CA_TYPE_CERT7_DB: + cert7db = ents[i].path; + break; + case APR_LDAP_CA_TYPE_SECMOD: + secmod = ents[i].path; + break; + case APR_LDAP_CERT_TYPE_KEY3_DB: + key3db = ents[i].path; + break; + case APR_LDAP_CERT_TYPE_NICKNAME: + nickname = ents[i].path; + password = ents[i].password; + break; + default: + result->rc = -1; + result->reason = "LDAP: The Netscape/Mozilla LDAP SDK only " + "understands the CERT7, KEY3 and SECMOD " + "file types."; + break; + } + if (result->rc != LDAP_SUCCESS) { + break; + } + } + + /* actually set the certificate parameters */ + if (result->rc == LDAP_SUCCESS) { + if (nickname) { + result->rc = ldapssl_enable_clientauth(ldap, "", + (char *)password, + (char *)nickname); + if (result->rc != LDAP_SUCCESS) { + result->reason = "LDAP: could not set client certificate: " + "ldapssl_enable_clientauth() failed."; + result->msg = ldap_err2string(result->rc); + } + } + else if (secmod) { + result->rc = ldapssl_advclientauth_init(cert7db, NULL, + key3db ? 1 : 0, key3db, NULL, + 1, secmod, LDAPSSL_AUTH_CNCHECK); + if (result->rc != LDAP_SUCCESS) { + result->reason = "LDAP: ldapssl_advclientauth_init() failed."; + result->msg = ldap_err2string(result->rc); + } + } + else if (key3db) { + result->rc = ldapssl_clientauth_init(cert7db, NULL, + 1, key3db, NULL); + if (result->rc != LDAP_SUCCESS) { + result->reason = "LDAP: ldapssl_clientauth_init() failed."; + result->msg = ldap_err2string(result->rc); + } + } + else { + result->rc = ldapssl_client_init(cert7db, NULL); + if (result->rc != LDAP_SUCCESS) { + result->reason = "LDAP: ldapssl_client_init() failed."; + result->msg = ldap_err2string(result->rc); + } + } + } +#else + result->reason = "LDAP: SSL/TLS ldapssl_client_init() function not " + "supported by this Netscape/Mozilla/Solaris SDK. " + "Certificate authority file not set"; + result->rc = -1; +#endif +#endif + + /* Novell SDK */ +#if APR_HAS_NOVELL_LDAPSDK +#if APR_HAS_LDAPSSL_CLIENT_INIT && APR_HAS_LDAPSSL_ADD_TRUSTED_CERT && APR_HAS_LDAPSSL_CLIENT_DEINIT + /* The Novell library cannot support per connection certificates. Error + * out if the ldap handle is provided. + */ + if (ldap) { + result->rc = -1; + result->reason = "LDAP: The Novell LDAP SDK cannot support the setting " + "of certificates or keys on a per connection basis."; + } + /* Novell's library needs to be initialised first */ + else { + result->rc = ldapssl_client_init(NULL, NULL); + if (result->rc != LDAP_SUCCESS) { + result->msg = ldap_err2string(result-> rc); + result->reason = apr_pstrdup(pool, "LDAP: Could not " + "initialize SSL"); + } + } + /* set one or more certificates */ + for (i = 0; LDAP_SUCCESS == result->rc && i < certs->nelts; i++) { + /* Novell SDK supports DER or BASE64 files. */ + switch (ents[i].type) { + case APR_LDAP_CA_TYPE_DER: + result->rc = ldapssl_add_trusted_cert((void *)ents[i].path, + LDAPSSL_CERT_FILETYPE_DER); + result->msg = ldap_err2string(result->rc); + break; + case APR_LDAP_CA_TYPE_BASE64: + result->rc = ldapssl_add_trusted_cert((void *)ents[i].path, + LDAPSSL_CERT_FILETYPE_B64); + result->msg = ldap_err2string(result->rc); + break; + case APR_LDAP_CERT_TYPE_DER: + result->rc = ldapssl_set_client_cert((void *)ents[i].path, + LDAPSSL_CERT_FILETYPE_DER, + (void*)ents[i].password); + result->msg = ldap_err2string(result->rc); + break; + case APR_LDAP_CERT_TYPE_BASE64: + result->rc = ldapssl_set_client_cert((void *)ents[i].path, + LDAPSSL_CERT_FILETYPE_B64, + (void*)ents[i].password); + result->msg = ldap_err2string(result->rc); + break; + case APR_LDAP_CERT_TYPE_PFX: + result->rc = ldapssl_set_client_cert((void *)ents[i].path, + LDAPSSL_FILETYPE_P12, + (void*)ents[i].password); + result->msg = ldap_err2string(result->rc); + break; + case APR_LDAP_KEY_TYPE_DER: + result->rc = ldapssl_set_client_private_key((void *)ents[i].path, + LDAPSSL_CERT_FILETYPE_DER, + (void*)ents[i].password); + result->msg = ldap_err2string(result->rc); + break; + case APR_LDAP_KEY_TYPE_BASE64: + result->rc = ldapssl_set_client_private_key((void *)ents[i].path, + LDAPSSL_CERT_FILETYPE_B64, + (void*)ents[i].password); + result->msg = ldap_err2string(result->rc); + break; + case APR_LDAP_KEY_TYPE_PFX: + result->rc = ldapssl_set_client_private_key((void *)ents[i].path, + LDAPSSL_FILETYPE_P12, + (void*)ents[i].password); + result->msg = ldap_err2string(result->rc); + break; + default: + result->rc = -1; + result->reason = "LDAP: The Novell LDAP SDK only understands the " + "DER and PEM (BASE64) file types."; + break; + } + if (result->rc != LDAP_SUCCESS) { + break; + } + } +#else + result->reason = "LDAP: ldapssl_client_init(), " + "ldapssl_add_trusted_cert() or " + "ldapssl_client_deinit() functions not supported " + "by this Novell SDK. Certificate authority file " + "not set"; + result->rc = -1; +#endif +#endif + + /* OpenLDAP SDK */ +#if APR_HAS_OPENLDAP_LDAPSDK +#ifdef LDAP_OPT_X_TLS_CACERTFILE + /* set one or more certificates */ + /* FIXME: make it support setting directories as well as files */ + for (i = 0; i < certs->nelts; i++) { + /* OpenLDAP SDK supports BASE64 files. */ + switch (ents[i].type) { + case APR_LDAP_CA_TYPE_BASE64: + result->rc = ldap_set_option(ldap, LDAP_OPT_X_TLS_CACERTFILE, + (void *)ents[i].path); + result->msg = ldap_err2string(result->rc); + break; + case APR_LDAP_CERT_TYPE_BASE64: + result->rc = ldap_set_option(ldap, LDAP_OPT_X_TLS_CERTFILE, + (void *)ents[i].path); + result->msg = ldap_err2string(result->rc); + break; + case APR_LDAP_KEY_TYPE_BASE64: + result->rc = ldap_set_option(ldap, LDAP_OPT_X_TLS_KEYFILE, + (void *)ents[i].path); + result->msg = ldap_err2string(result->rc); + break; +#ifdef LDAP_OPT_X_TLS_CACERTDIR + case APR_LDAP_CA_TYPE_CACERTDIR_BASE64: + result->rc = ldap_set_option(ldap, LDAP_OPT_X_TLS_CACERTDIR, + (void *)ents[i].path); + result->msg = ldap_err2string(result->rc); + break; +#endif + default: + result->rc = -1; + result->reason = "LDAP: The OpenLDAP SDK only understands the " + "PEM (BASE64) file type."; + break; + } + if (result->rc != LDAP_SUCCESS) { + break; + } + } +#else + result->reason = "LDAP: LDAP_OPT_X_TLS_CACERTFILE not " + "defined by this OpenLDAP SDK. Certificate " + "authority file not set"; + result->rc = -1; +#endif +#endif + + /* Microsoft SDK */ +#if APR_HAS_MICROSOFT_LDAPSDK + /* Microsoft SDK use the registry certificate store - error out + * here with a message explaining this. */ + result->reason = "LDAP: CA certificates cannot be set using this method, " + "as they are stored in the registry instead."; + result->rc = -1; +#endif + + /* SDK not recognised */ +#if APR_HAS_OTHER_LDAPSDK + result->reason = "LDAP: LDAP_OPT_X_TLS_CACERTFILE not " + "defined by this LDAP SDK. Certificate " + "authority file not set"; + result->rc = -1; +#endif + +#else /* not compiled with SSL Support */ + result->reason = "LDAP: Attempt to set certificate(s) failed. " + "Not built with SSL support"; + result->rc = -1; +#endif /* APR_HAS_LDAP_SSL */ + +} + +#endif /* APR_HAS_LDAP */ + diff --git a/ldap/apr_ldap_rebind.c b/ldap/apr_ldap_rebind.c new file mode 100644 index 00000000000..4818d05cc86 --- /dev/null +++ b/ldap/apr_ldap_rebind.c @@ -0,0 +1,351 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* apr_ldap_rebind.c -- LDAP rebind callbacks for referrals + * + * The LDAP SDK allows a callback to be set to enable rebinding + * for referral processing. + * + */ + +#include "apr.h" +#include "apu.h" +#include "apu_config.h" + +#if APU_DSO_BUILD +#define APU_DSO_LDAP_BUILD +#endif + +#include "apr_ldap.h" +#include "apr_errno.h" +#include "apr_strings.h" +#include "apr_ldap_rebind.h" + +#include "stdio.h" + +#if APR_HAS_LDAP + +/* Used to store information about connections for use in the referral rebind callback. */ +struct apr_ldap_rebind_entry { + apr_pool_t *pool; + LDAP *index; + const char *bindDN; + const char *bindPW; + struct apr_ldap_rebind_entry *next; +}; +typedef struct apr_ldap_rebind_entry apr_ldap_rebind_entry_t; + + +#ifdef NETWARE +#include "apr_private.h" +#define get_apd APP_DATA* apd = (APP_DATA*)get_app_data(gLibId); +#define apr_ldap_xref_lock ((apr_thread_mutex_t *)(apd->gs_ldap_xref_lock)) +#define xref_head ((apr_ldap_rebind_entry_t *)(apd->gs_xref_head)) +#else +#if APR_HAS_THREADS +static apr_thread_mutex_t *apr_ldap_xref_lock = NULL; +#endif +static apr_ldap_rebind_entry_t *xref_head = NULL; +#endif + +static int apr_ldap_rebind_set_callback(LDAP *ld); +static apr_status_t apr_ldap_rebind_remove_helper(void *data); + +/* APR utility routine used to create the xref_lock. */ +APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool) +{ + apr_status_t retcode = APR_SUCCESS; + +#ifdef NETWARE + get_apd +#endif + +#if APR_HAS_THREADS + if (apr_ldap_xref_lock == NULL) { + retcode = apr_thread_mutex_create(&apr_ldap_xref_lock, APR_THREAD_MUTEX_DEFAULT, pool); + } +#endif + + return(retcode); +} + + +APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, + LDAP *ld, + const char *bindDN, + const char *bindPW) +{ + apr_status_t retcode = APR_SUCCESS; + apr_ldap_rebind_entry_t *new_xref; + +#ifdef NETWARE + get_apd +#endif + + new_xref = (apr_ldap_rebind_entry_t *)apr_pcalloc(pool, sizeof(apr_ldap_rebind_entry_t)); + if (new_xref) { + new_xref->pool = pool; + new_xref->index = ld; + if (bindDN) { + new_xref->bindDN = apr_pstrdup(pool, bindDN); + } + if (bindPW) { + new_xref->bindPW = apr_pstrdup(pool, bindPW); + } + +#if APR_HAS_THREADS + apr_thread_mutex_lock(apr_ldap_xref_lock); +#endif + + new_xref->next = xref_head; + xref_head = new_xref; + +#if APR_HAS_THREADS + apr_thread_mutex_unlock(apr_ldap_xref_lock); +#endif + } + else { + return(APR_ENOMEM); + } + + retcode = apr_ldap_rebind_set_callback(ld); + if (APR_SUCCESS != retcode) { + apr_ldap_rebind_remove(ld); + return retcode; + } + + apr_pool_cleanup_register(pool, ld, + apr_ldap_rebind_remove_helper, + apr_pool_cleanup_null); + + return(APR_SUCCESS); +} + + +APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld) +{ + apr_ldap_rebind_entry_t *tmp_xref, *prev = NULL; + +#ifdef NETWARE + get_apd +#endif + +#if APR_HAS_THREADS + apr_thread_mutex_lock(apr_ldap_xref_lock); +#endif + tmp_xref = xref_head; + + while ((tmp_xref) && (tmp_xref->index != ld)) { + prev = tmp_xref; + tmp_xref = tmp_xref->next; + } + + if (tmp_xref) { + if (tmp_xref == xref_head) { + xref_head = xref_head->next; + } + else { + prev->next = tmp_xref->next; + } + + /* tmp_xref and its contents were pool allocated so they don't need to be freed here. */ + + /* remove the cleanup, just in case this was done manually */ + apr_pool_cleanup_kill(tmp_xref->pool, tmp_xref->index, + apr_ldap_rebind_remove_helper); + } + +#if APR_HAS_THREADS + apr_thread_mutex_unlock(apr_ldap_xref_lock); +#endif + return APR_SUCCESS; +} + + +static apr_status_t apr_ldap_rebind_remove_helper(void *data) +{ + LDAP *ld = (LDAP *)data; + apr_ldap_rebind_remove(ld); + return APR_SUCCESS; +} + +#if APR_HAS_TIVOLI_LDAPSDK || APR_HAS_OPENLDAP_LDAPSDK || APR_HAS_NOVELL_LDAPSDK +static apr_ldap_rebind_entry_t *apr_ldap_rebind_lookup(LDAP *ld) +{ + apr_ldap_rebind_entry_t *tmp_xref, *match = NULL; + +#ifdef NETWARE + get_apd +#endif + +#if APR_HAS_THREADS + apr_thread_mutex_lock(apr_ldap_xref_lock); +#endif + tmp_xref = xref_head; + + while (tmp_xref) { + if (tmp_xref->index == ld) { + match = tmp_xref; + tmp_xref = NULL; + } + else { + tmp_xref = tmp_xref->next; + } + } + +#if APR_HAS_THREADS + apr_thread_mutex_unlock(apr_ldap_xref_lock); +#endif + + return (match); +} +#endif + +#if APR_HAS_TIVOLI_LDAPSDK + +/* LDAP_rebindproc() Tivoli LDAP style + * Rebind callback function. Called when chasing referrals. See API docs. + * ON ENTRY: + * ld Pointer to an LDAP control structure. (input only) + * binddnp Pointer to an Application DName used for binding (in *or* out) + * passwdp Pointer to the password associated with the DName (in *or* out) + * methodp Pointer to the Auth method (output only) + * freeit Flag to indicate if this is a lookup or a free request (input only) + */ +static int LDAP_rebindproc(LDAP *ld, char **binddnp, char **passwdp, int *methodp, int freeit) +{ + if (!freeit) { + apr_ldap_rebind_entry_t *my_conn; + + *methodp = LDAP_AUTH_SIMPLE; + my_conn = apr_ldap_rebind_lookup(ld); + + if ((my_conn) && (my_conn->bindDN != NULL)) { + *binddnp = strdup(my_conn->bindDN); + *passwdp = strdup(my_conn->bindPW); + } else { + *binddnp = NULL; + *passwdp = NULL; + } + } else { + if (*binddnp) { + free(*binddnp); + } + if (*passwdp) { + free(*passwdp); + } + } + + return LDAP_SUCCESS; +} + +static int apr_ldap_rebind_set_callback(LDAP *ld) +{ + ldap_set_rebind_proc(ld, (LDAPRebindProc)LDAP_rebindproc); + return APR_SUCCESS; +} + +#elif APR_HAS_OPENLDAP_LDAPSDK + +/* LDAP_rebindproc() openLDAP V3 style + * ON ENTRY: + * ld Pointer to an LDAP control structure. (input only) + * url Unused in this routine + * request Unused in this routine + * msgid Unused in this routine + * params Unused in this routine + * + * or + * + * ld Pointer to an LDAP control structure. (input only) + * url Unused in this routine + * request Unused in this routine + * msgid Unused in this routine + */ +#if defined(LDAP_SET_REBIND_PROC_THREE) +static int LDAP_rebindproc(LDAP *ld, LDAP_CONST char *url, ber_tag_t request, + ber_int_t msgid, void *params) +#else +static int LDAP_rebindproc(LDAP *ld, LDAP_CONST char *url, int request, + ber_int_t msgid) +#endif +{ + apr_ldap_rebind_entry_t *my_conn; + const char *bindDN = NULL; + const char *bindPW = NULL; + + my_conn = apr_ldap_rebind_lookup(ld); + + if ((my_conn) && (my_conn->bindDN != NULL)) { + bindDN = my_conn->bindDN; + bindPW = my_conn->bindPW; + } + + return (ldap_bind_s(ld, bindDN, bindPW, LDAP_AUTH_SIMPLE)); +} + +static int apr_ldap_rebind_set_callback(LDAP *ld) +{ +#if defined(LDAP_SET_REBIND_PROC_THREE) + ldap_set_rebind_proc(ld, LDAP_rebindproc, NULL); +#else + ldap_set_rebind_proc(ld, LDAP_rebindproc); +#endif + return APR_SUCCESS; +} + +#elif APR_HAS_NOVELL_LDAPSDK + +/* LDAP_rebindproc() openLDAP V3 style + * ON ENTRY: + * ld Pointer to an LDAP control structure. (input only) + * url Unused in this routine + * request Unused in this routine + * msgid Unused in this routine + */ +static int LDAP_rebindproc(LDAP *ld, LDAP_CONST char *url, int request, ber_int_t msgid) +{ + + apr_ldap_rebind_entry_t *my_conn; + const char *bindDN = NULL; + const char *bindPW = NULL; + + my_conn = apr_ldap_rebind_lookup(ld); + + if ((my_conn) && (my_conn->bindDN != NULL)) { + bindDN = my_conn->bindDN; + bindPW = my_conn->bindPW; + } + + return (ldap_bind_s(ld, bindDN, bindPW, LDAP_AUTH_SIMPLE)); +} + +static int apr_ldap_rebind_set_callback(LDAP *ld) +{ + ldap_set_rebind_proc(ld, LDAP_rebindproc); + return APR_SUCCESS; +} + +#else /* Implementation not recognised */ + +static int apr_ldap_rebind_set_callback(LDAP *ld) +{ + return APR_ENOTIMPL; +} + +#endif + +#endif /* APR_HAS_LDAP */ diff --git a/ldap/apr_ldap_stub.c b/ldap/apr_ldap_stub.c new file mode 100644 index 00000000000..97c15514ef8 --- /dev/null +++ b/ldap/apr_ldap_stub.c @@ -0,0 +1,145 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr.h" +#include "apu.h" +#include "apu_config.h" +#include "apr_ldap.h" +#include "apu_internal.h" +#include "apr_dso.h" +#include "apr_errno.h" +#include "apr_pools.h" +#include "apr_strings.h" +#include "apu_version.h" + +#if APR_HAS_LDAP + +#if APU_DSO_BUILD + +static struct apr__ldap_dso_fntable *lfn = NULL; + +static apr_status_t load_ldap(apr_pool_t *pool) +{ + char *modname; + apr_dso_handle_sym_t symbol; + apr_status_t rv; + + /* deprecate in 2.0 - permit implicit initialization */ + apu_dso_init(pool); + + rv = apu_dso_mutex_lock(); + if (rv) { + return rv; + } + +#if defined(WIN32) + modname = "apr_ldap-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll"; +#else + modname = "apr_ldap-" APU_STRINGIFY(APU_MAJOR_VERSION) ".so"; +#endif + rv = apu_dso_load(NULL, &symbol, modname, "apr__ldap_fns", pool); + if (rv == APR_SUCCESS) { + lfn = symbol; + } + apu_dso_mutex_unlock(); + + return rv; +} + +#define LOAD_LDAP_STUB(pool, failres) \ + if (!lfn && (load_ldap(pool) != APR_SUCCESS)) \ + return failres; + +APU_DECLARE_LDAP(int) apr_ldap_info(apr_pool_t *pool, + apr_ldap_err_t **result_err) +{ + LOAD_LDAP_STUB(pool, -1); + return lfn->info(pool, result_err); +} + +APU_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool, + LDAP **ldap, + const char *hostname, + int portno, + int secure, + apr_ldap_err_t **result_err) +{ + LOAD_LDAP_STUB(pool, -1); + return lfn->init(pool, ldap, hostname, portno, secure, result_err); +} + +APU_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool, + const char *cert_auth_file, + int cert_file_type, + apr_ldap_err_t **result_err) +{ + LOAD_LDAP_STUB(pool, -1); + return lfn->ssl_init(pool, cert_auth_file, cert_file_type, result_err); +} + +APU_DECLARE_LDAP(int) apr_ldap_ssl_deinit(void) +{ + if (!lfn) + return -1; + return lfn->ssl_deinit(); +} + +APU_DECLARE_LDAP(int) apr_ldap_get_option(apr_pool_t *pool, + LDAP *ldap, + int option, + void *outvalue, + apr_ldap_err_t **result_err) +{ + LOAD_LDAP_STUB(pool, -1); + return lfn->get_option(pool, ldap, option, outvalue, result_err); +} + +APU_DECLARE_LDAP(int) apr_ldap_set_option(apr_pool_t *pool, + LDAP *ldap, + int option, + const void *invalue, + apr_ldap_err_t **result_err) +{ + LOAD_LDAP_STUB(pool, -1); + return lfn->set_option(pool, ldap, option, invalue, result_err); +} + +APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool) +{ + LOAD_LDAP_STUB(pool, APR_EGENERAL); + return lfn->rebind_init(pool); +} + +APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, + LDAP *ld, + const char *bindDN, + const char *bindPW) +{ + LOAD_LDAP_STUB(pool, APR_EGENERAL); + return lfn->rebind_add(pool, ld, bindDN, bindPW); +} + +APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld) +{ + if (!lfn) + return APR_EGENERAL; + return lfn->rebind_remove(ld); +} + +#endif /* APU_DSO_BUILD */ + +#endif /* APR_HAS_LDAP */ + diff --git a/ldap/apr_ldap_url.c b/ldap/apr_ldap_url.c new file mode 100644 index 00000000000..52e37b253f9 --- /dev/null +++ b/ldap/apr_ldap_url.c @@ -0,0 +1,694 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* Portions Copyright 1998-2002 The OpenLDAP Foundation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. A copy of this license is available at + * http://www.OpenLDAP.org/license.html or in file LICENSE in the + * top-level directory of the distribution. + * + * OpenLDAP is a registered trademark of the OpenLDAP Foundation. + * + * Individual files and/or contributed packages may be copyright by + * other parties and subject to additional restrictions. + * + * This work is derived from the University of Michigan LDAP v3.3 + * distribution. Information concerning this software is available + * at: http://www.umich.edu/~dirsvcs/ldap/ + * + * This work also contains materials derived from public sources. + * + * Additional information about OpenLDAP can be obtained at: + * http://www.openldap.org/ + */ + +/* + * Portions Copyright (c) 1992-1996 Regents of the University of Michigan. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that this notice is preserved and that due credit is given + * to the University of Michigan at Ann Arbor. The name of the University + * may not be used to endorse or promote products derived from this + * software without specific prior written permission. This software + * is provided ``as is'' without express or implied warranty. + */ + +/* apr_ldap_url.c -- LDAP URL (RFC 2255) related routines + * + * Win32 and perhaps other non-OpenLDAP based ldap libraries may be + * missing ldap_url_* APIs. We focus here on the one significant + * aspect, which is parsing. We have [for the time being] omitted + * the ldap_url_search APIs. + * + * LDAP URLs look like this: + * ldap[is]://host:port[/[dn[?[attributes][?[scope][?[filter][?exts]]]]]] + * + * where: + * attributes is a comma separated list + * scope is one of these three strings: base one sub (default=base) + * filter is an string-represented filter as in RFC 2254 + * + * e.g., ldap://host:port/dc=com?o,cn?base?o=openldap?extension + * + * Tolerates URLs that look like: and + */ + +#include "apu.h" +#include "apr_pools.h" +#include "apr_general.h" +#include "apr_strings.h" +#include "apr_ldap.h" + +#if APR_HAS_LDAP + +#if APR_HAVE_STDLIB_H +#include +#endif + +#ifndef LDAPS_PORT +#define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */ +#endif + +#define APR_LDAP_URL_PREFIX "ldap://" +#define APR_LDAP_URL_PREFIX_LEN (sizeof(APR_LDAP_URL_PREFIX)-1) +#define APR_LDAPS_URL_PREFIX "ldaps://" +#define APR_LDAPS_URL_PREFIX_LEN (sizeof(APR_LDAPS_URL_PREFIX)-1) +#define APR_LDAPI_URL_PREFIX "ldapi://" +#define APR_LDAPI_URL_PREFIX_LEN (sizeof(APR_LDAPI_URL_PREFIX)-1) +#define APR_LDAP_URL_URLCOLON "URL:" +#define APR_LDAP_URL_URLCOLON_LEN (sizeof(APR_LDAP_URL_URLCOLON)-1) + + +/* local functions */ +static const char* skip_url_prefix(const char *url, + int *enclosedp, + const char **scheme); + +static void apr_ldap_pvt_hex_unescape(char *s); + +static int apr_ldap_pvt_unhex(int c); + +static char **apr_ldap_str2charray(apr_pool_t *pool, + const char *str, + const char *brkstr); + + +/** + * Is this URL an ldap url? + * + */ +APU_DECLARE(int) apr_ldap_is_ldap_url(const char *url) +{ + int enclosed; + const char * scheme; + + if( url == NULL ) { + return 0; + } + + if( skip_url_prefix( url, &enclosed, &scheme ) == NULL ) { + return 0; + } + + return 1; +} + +/** + * Is this URL a secure ldap url? + * + */ +APU_DECLARE(int) apr_ldap_is_ldaps_url(const char *url) +{ + int enclosed; + const char * scheme; + + if( url == NULL ) { + return 0; + } + + if( skip_url_prefix( url, &enclosed, &scheme ) == NULL ) { + return 0; + } + + return strcmp(scheme, "ldaps") == 0; +} + +/** + * Is this URL an ldap socket url? + * + */ +APU_DECLARE(int) apr_ldap_is_ldapi_url(const char *url) +{ + int enclosed; + const char * scheme; + + if( url == NULL ) { + return 0; + } + + if( skip_url_prefix( url, &enclosed, &scheme ) == NULL ) { + return 0; + } + + return strcmp(scheme, "ldapi") == 0; +} + + +static const char *skip_url_prefix(const char *url, int *enclosedp, + const char **scheme) +{ + /* + * return non-zero if this looks like a LDAP URL; zero if not + * if non-zero returned, *urlp will be moved past "ldap://" part of URL + */ + const char *p; + + if ( url == NULL ) { + return( NULL ); + } + + p = url; + + /* skip leading '<' (if any) */ + if ( *p == '<' ) { + *enclosedp = 1; + ++p; + } else { + *enclosedp = 0; + } + + /* skip leading "URL:" (if any) */ + if ( strncasecmp( p, APR_LDAP_URL_URLCOLON, APR_LDAP_URL_URLCOLON_LEN ) == 0 ) { + p += APR_LDAP_URL_URLCOLON_LEN; + } + + /* check for "ldap://" prefix */ + if ( strncasecmp( p, APR_LDAP_URL_PREFIX, APR_LDAP_URL_PREFIX_LEN ) == 0 ) { + /* skip over "ldap://" prefix and return success */ + p += APR_LDAP_URL_PREFIX_LEN; + *scheme = "ldap"; + return( p ); + } + + /* check for "ldaps://" prefix */ + if ( strncasecmp( p, APR_LDAPS_URL_PREFIX, APR_LDAPS_URL_PREFIX_LEN ) == 0 ) { + /* skip over "ldaps://" prefix and return success */ + p += APR_LDAPS_URL_PREFIX_LEN; + *scheme = "ldaps"; + return( p ); + } + + /* check for "ldapi://" prefix */ + if ( strncasecmp( p, APR_LDAPI_URL_PREFIX, APR_LDAPI_URL_PREFIX_LEN ) == 0 ) { + /* skip over "ldapi://" prefix and return success */ + p += APR_LDAPI_URL_PREFIX_LEN; + *scheme = "ldapi"; + return( p ); + } + + return( NULL ); +} + + +static int str2scope(const char *p) +{ + if ( strcasecmp( p, "one" ) == 0 ) { + return LDAP_SCOPE_ONELEVEL; + + } else if ( strcasecmp( p, "onetree" ) == 0 ) { + return LDAP_SCOPE_ONELEVEL; + + } else if ( strcasecmp( p, "base" ) == 0 ) { + return LDAP_SCOPE_BASE; + + } else if ( strcasecmp( p, "sub" ) == 0 ) { + return LDAP_SCOPE_SUBTREE; + + } else if ( strcasecmp( p, "subtree" ) == 0 ) { + return LDAP_SCOPE_SUBTREE; + } + + return( -1 ); +} + + +/** + * Parse the URL provided into an apr_ldap_url_desc_t object. + * + * APR_SUCCESS is returned on success, APR_EGENERAL on failure. + * The LDAP result code and reason string is returned in the + * apr_ldap_err_t structure. + */ +APU_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool, + const char *url_in, + apr_ldap_url_desc_t **ludpp, + apr_ldap_err_t **result_err) +{ + apr_ldap_url_desc_t *ludp; + char *p, *q, *r; + int i, enclosed; + const char *scheme = NULL; + const char *url_tmp; + char *url; + + apr_ldap_err_t *result = (apr_ldap_err_t *)apr_pcalloc(pool, sizeof(apr_ldap_err_t)); + *result_err = result; + + /* sanity check our parameters */ + if( url_in == NULL || ludpp == NULL ) { + result->reason = "Either the LDAP URL, or the URL structure was NULL. Oops."; + result->rc = APR_LDAP_URL_ERR_PARAM; + return APR_EGENERAL; + } + + *ludpp = NULL; /* pessimistic */ + + url_tmp = skip_url_prefix( url_in, &enclosed, &scheme ); + if ( url_tmp == NULL ) { + result->reason = "The scheme was not recognised as a valid LDAP URL scheme."; + result->rc = APR_LDAP_URL_ERR_BADSCHEME; + return APR_EGENERAL; + } + + /* make working copy of the remainder of the URL */ + url = (char *)apr_pstrdup(pool, url_tmp); + if ( url == NULL ) { + result->reason = "Out of memory parsing LDAP URL."; + result->rc = APR_LDAP_URL_ERR_MEM; + return APR_EGENERAL; + } + + if ( enclosed ) { + p = &url[strlen(url)-1]; + + if( *p != '>' ) { + result->reason = "Bad enclosure error while parsing LDAP URL."; + result->rc = APR_LDAP_URL_ERR_BADENCLOSURE; + return APR_EGENERAL; + } + + *p = '\0'; + } + + /* allocate return struct */ + ludp = (apr_ldap_url_desc_t *)apr_pcalloc(pool, sizeof(apr_ldap_url_desc_t)); + if ( ludp == NULL ) { + result->reason = "Out of memory parsing LDAP URL."; + result->rc = APR_LDAP_URL_ERR_MEM; + return APR_EGENERAL; + } + + ludp->lud_next = NULL; + ludp->lud_host = NULL; + ludp->lud_port = LDAP_PORT; + ludp->lud_dn = NULL; + ludp->lud_attrs = NULL; + ludp->lud_filter = NULL; + ludp->lud_scope = -1; + ludp->lud_filter = NULL; + ludp->lud_exts = NULL; + + ludp->lud_scheme = (char *)apr_pstrdup(pool, scheme); + if ( ludp->lud_scheme == NULL ) { + result->reason = "Out of memory parsing LDAP URL."; + result->rc = APR_LDAP_URL_ERR_MEM; + return APR_EGENERAL; + } + + if( strcasecmp( ludp->lud_scheme, "ldaps" ) == 0 ) { + ludp->lud_port = LDAPS_PORT; + } + + /* scan forward for '/' that marks end of hostport and begin. of dn */ + p = strchr( url, '/' ); + + if( p != NULL ) { + /* terminate hostport; point to start of dn */ + *p++ = '\0'; + } + + /* IPv6 syntax with [ip address]:port */ + if ( *url == '[' ) { + r = strchr( url, ']' ); + if ( r == NULL ) { + result->reason = "Bad LDAP URL while parsing IPV6 syntax."; + result->rc = APR_LDAP_URL_ERR_BADURL; + return APR_EGENERAL; + } + *r++ = '\0'; + q = strrchr( r, ':' ); + } else { + q = strrchr( url, ':' ); + } + + if ( q != NULL ) { + apr_ldap_pvt_hex_unescape( ++q ); + + if( *q == '\0' ) { + result->reason = "Bad LDAP URL while parsing."; + result->rc = APR_LDAP_URL_ERR_BADURL; + return APR_EGENERAL; + } + + ludp->lud_port = atoi( q ); + } + + apr_ldap_pvt_hex_unescape( url ); + + /* If [ip address]:port syntax, url is [ip and we skip the [ */ + ludp->lud_host = (char *)apr_pstrdup(pool, url + ( *url == '[' )); + if( ludp->lud_host == NULL ) { + result->reason = "Out of memory parsing LDAP URL."; + result->rc = APR_LDAP_URL_ERR_MEM; + return APR_EGENERAL; + } + + /* + * Kludge. ldap://111.222.333.444:389??cn=abc,o=company + * + * On early Novell releases, search references/referrals were returned + * in this format, i.e., the dn was kind of in the scope position, + * but the required slash is missing. The whole thing is illegal syntax, + * but we need to account for it. Fortunately it can't be confused with + * anything real. + */ + if( (p == NULL) && (q != NULL) && ((q = strchr( q, '?')) != NULL)) { + q++; + /* ? immediately followed by question */ + if( *q == '?') { + q++; + if( *q != '\0' ) { + /* parse dn part */ + apr_ldap_pvt_hex_unescape( q ); + ludp->lud_dn = (char *)apr_pstrdup(pool, q); + } else { + ludp->lud_dn = (char *)apr_pstrdup(pool, ""); + } + + if( ludp->lud_dn == NULL ) { + result->reason = "Out of memory parsing LDAP URL."; + result->rc = APR_LDAP_URL_ERR_MEM; + return APR_EGENERAL; + } + } + } + + if( p == NULL ) { + *ludpp = ludp; + return APR_SUCCESS; + } + + /* scan forward for '?' that may marks end of dn */ + q = strchr( p, '?' ); + + if( q != NULL ) { + /* terminate dn part */ + *q++ = '\0'; + } + + if( *p != '\0' ) { + /* parse dn part */ + apr_ldap_pvt_hex_unescape( p ); + ludp->lud_dn = (char *)apr_pstrdup(pool, p); + } else { + ludp->lud_dn = (char *)apr_pstrdup(pool, ""); + } + + if( ludp->lud_dn == NULL ) { + result->reason = "Out of memory parsing LDAP URL."; + result->rc = APR_LDAP_URL_ERR_MEM; + return APR_EGENERAL; + } + + if( q == NULL ) { + /* no more */ + *ludpp = ludp; + return APR_SUCCESS; + } + + /* scan forward for '?' that may marks end of attributes */ + p = q; + q = strchr( p, '?' ); + + if( q != NULL ) { + /* terminate attributes part */ + *q++ = '\0'; + } + + if( *p != '\0' ) { + /* parse attributes */ + apr_ldap_pvt_hex_unescape( p ); + ludp->lud_attrs = apr_ldap_str2charray(pool, p, ","); + + if( ludp->lud_attrs == NULL ) { + result->reason = "Bad attributes encountered while parsing LDAP URL."; + result->rc = APR_LDAP_URL_ERR_BADATTRS; + return APR_EGENERAL; + } + } + + if ( q == NULL ) { + /* no more */ + *ludpp = ludp; + return APR_SUCCESS; + } + + /* scan forward for '?' that may marks end of scope */ + p = q; + q = strchr( p, '?' ); + + if( q != NULL ) { + /* terminate the scope part */ + *q++ = '\0'; + } + + if( *p != '\0' ) { + /* parse the scope */ + apr_ldap_pvt_hex_unescape( p ); + ludp->lud_scope = str2scope( p ); + + if( ludp->lud_scope == -1 ) { + result->reason = "Bad scope encountered while parsing LDAP URL."; + result->rc = APR_LDAP_URL_ERR_BADSCOPE; + return APR_EGENERAL; + } + } + + if ( q == NULL ) { + /* no more */ + *ludpp = ludp; + return APR_SUCCESS; + } + + /* scan forward for '?' that may marks end of filter */ + p = q; + q = strchr( p, '?' ); + + if( q != NULL ) { + /* terminate the filter part */ + *q++ = '\0'; + } + + if( *p != '\0' ) { + /* parse the filter */ + apr_ldap_pvt_hex_unescape( p ); + + if( ! *p ) { + /* missing filter */ + result->reason = "Bad filter encountered while parsing LDAP URL."; + result->rc = APR_LDAP_URL_ERR_BADFILTER; + return APR_EGENERAL; + } + + ludp->lud_filter = (char *)apr_pstrdup(pool, p); + if( ludp->lud_filter == NULL ) { + result->reason = "Out of memory parsing LDAP URL."; + result->rc = APR_LDAP_URL_ERR_MEM; + return APR_EGENERAL; + } + } + + if ( q == NULL ) { + /* no more */ + *ludpp = ludp; + return APR_SUCCESS; + } + + /* scan forward for '?' that may marks end of extensions */ + p = q; + q = strchr( p, '?' ); + + if( q != NULL ) { + /* extra '?' */ + result->reason = "Bad URL encountered while parsing LDAP URL."; + result->rc = APR_LDAP_URL_ERR_BADURL; + return APR_EGENERAL; + } + + /* parse the extensions */ + ludp->lud_exts = apr_ldap_str2charray(pool, p, ","); + if( ludp->lud_exts == NULL ) { + result->reason = "Bad extensions encountered while parsing LDAP URL."; + result->rc = APR_LDAP_URL_ERR_BADEXTS; + return APR_EGENERAL; + } + + for( i=0; ludp->lud_exts[i] != NULL; i++ ) { + apr_ldap_pvt_hex_unescape( ludp->lud_exts[i] ); + + if( *ludp->lud_exts[i] == '!' ) { + /* count the number of critical extensions */ + ludp->lud_crit_exts++; + } + } + + if( i == 0 ) { + /* must have 1 or more */ + result->reason = "Bad extensions encountered while parsing LDAP URL."; + result->rc = APR_LDAP_URL_ERR_BADEXTS; + return APR_EGENERAL; + } + + /* no more */ + *ludpp = ludp; + return APR_SUCCESS; +} + + +/** + * Parse the URL provided into an apr_ldap_url_desc_t object. + * + * APR_SUCCESS is returned on success, APR_EGENERAL on failure. + * The LDAP result code and reason string is returned in the + * apr_ldap_err_t structure. + */ +APU_DECLARE(int) apr_ldap_url_parse(apr_pool_t *pool, + const char *url_in, + apr_ldap_url_desc_t **ludpp, + apr_ldap_err_t **result_err) +{ + + int rc = apr_ldap_url_parse_ext(pool, url_in, ludpp, result_err); + if( rc != APR_SUCCESS ) { + return rc; + } + + if ((*ludpp)->lud_scope == -1) { + (*ludpp)->lud_scope = LDAP_SCOPE_BASE; + } + + if ((*ludpp)->lud_host != NULL && *(*ludpp)->lud_host == '\0') { + (*ludpp)->lud_host = NULL; + } + + return rc; + +} + + +static void apr_ldap_pvt_hex_unescape(char *s) +{ + /* + * Remove URL hex escapes from s... done in place. The basic concept for + * this routine is borrowed from the WWW library HTUnEscape() routine. + */ + char *p; + + for ( p = s; *s != '\0'; ++s ) { + if ( *s == '%' ) { + if ( *++s == '\0' ) { + break; + } + *p = apr_ldap_pvt_unhex( *s ) << 4; + if ( *++s == '\0' ) { + break; + } + *p++ += apr_ldap_pvt_unhex( *s ); + } else { + *p++ = *s; + } + } + + *p = '\0'; +} + + +static int apr_ldap_pvt_unhex(int c) +{ + return( c >= '0' && c <= '9' ? c - '0' + : c >= 'A' && c <= 'F' ? c - 'A' + 10 + : c - 'a' + 10 ); +} + + +/** + * Convert a string to a character array + */ +static char **apr_ldap_str2charray(apr_pool_t *pool, + const char *str_in, + const char *brkstr) +{ + char **res; + char *str, *s; + char *lasts; + int i; + + /* protect the input string from strtok */ + str = (char *)apr_pstrdup(pool, str_in); + if( str == NULL ) { + return NULL; + } + + i = 1; + for ( s = str; *s; s++ ) { + /* Warning: this strchr was previously ldap_utf8_strchr(), check + * whether this particular code has any charset issues. + */ + if ( strchr( brkstr, *s ) != NULL ) { + i++; + } + } + + res = (char **) apr_pcalloc(pool, (i + 1) * sizeof(char *)); + if( res == NULL ) { + return NULL; + } + + i = 0; + + for ( s = (char *)apr_strtok( str, brkstr, &lasts ); + s != NULL; + s = (char *)apr_strtok( NULL, brkstr, &lasts ) ) { + + res[i] = (char *)apr_pstrdup(pool, s); + if(res[i] == NULL) { + return NULL; + } + + i++; + } + + res[i] = NULL; + + return( res ); + +} + +#endif /* APR_HAS_LDAP */ diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c new file mode 100644 index 00000000000..d244d564efc --- /dev/null +++ b/memcache/apr_memcache.c @@ -0,0 +1,1701 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_memcache.h" +#include "apr_poll.h" +#include "apr_version.h" +#include + +#define BUFFER_SIZE 512 +struct apr_memcache_conn_t +{ + char *buffer; + apr_size_t blen; + apr_pool_t *p; + apr_pool_t *tp; + apr_socket_t *sock; + apr_bucket_brigade *bb; + apr_bucket_brigade *tb; + apr_memcache_server_t *ms; +}; + +/* Strings for Client Commands */ + +#define MC_EOL "\r\n" +#define MC_EOL_LEN (sizeof(MC_EOL)-1) + +#define MC_WS " " +#define MC_WS_LEN (sizeof(MC_WS)-1) + +#define MC_GET "get " +#define MC_GET_LEN (sizeof(MC_GET)-1) + +#define MC_SET "set " +#define MC_SET_LEN (sizeof(MC_SET)-1) + +#define MC_ADD "add " +#define MC_ADD_LEN (sizeof(MC_ADD)-1) + +#define MC_REPLACE "replace " +#define MC_REPLACE_LEN (sizeof(MC_REPLACE)-1) + +#define MC_DELETE "delete " +#define MC_DELETE_LEN (sizeof(MC_DELETE)-1) + +#define MC_INCR "incr " +#define MC_INCR_LEN (sizeof(MC_INCR)-1) + +#define MC_DECR "decr " +#define MC_DECR_LEN (sizeof(MC_DECR)-1) + +#define MC_VERSION "version" +#define MC_VERSION_LEN (sizeof(MC_VERSION)-1) + +#define MC_STATS "stats" +#define MC_STATS_LEN (sizeof(MC_STATS)-1) + +#define MC_QUIT "quit" +#define MC_QUIT_LEN (sizeof(MC_QUIT)-1) + +/* Strings for Server Replies */ + +#define MS_STORED "STORED" +#define MS_STORED_LEN (sizeof(MS_STORED)-1) + +#define MS_NOT_STORED "NOT_STORED" +#define MS_NOT_STORED_LEN (sizeof(MS_NOT_STORED)-1) + +#define MS_DELETED "DELETED" +#define MS_DELETED_LEN (sizeof(MS_DELETED)-1) + +#define MS_NOT_FOUND "NOT_FOUND" +#define MS_NOT_FOUND_LEN (sizeof(MS_NOT_FOUND)-1) + +#define MS_VALUE "VALUE" +#define MS_VALUE_LEN (sizeof(MS_VALUE)-1) + +#define MS_ERROR "ERROR" +#define MS_ERROR_LEN (sizeof(MS_ERROR)-1) + +#define MS_VERSION "VERSION" +#define MS_VERSION_LEN (sizeof(MS_VERSION)-1) + +#define MS_STAT "STAT" +#define MS_STAT_LEN (sizeof(MS_STAT)-1) + +#define MS_END "END" +#define MS_END_LEN (sizeof(MS_END)-1) + +/** Server and Query Structure for a multiple get */ +struct cache_server_query_t { + apr_memcache_server_t* ms; + apr_memcache_conn_t* conn; + struct iovec* query_vec; + apr_int32_t query_vec_count; +}; + +#define MULT_GET_TIMEOUT 50000 + +static apr_status_t make_server_dead(apr_memcache_t *mc, apr_memcache_server_t *ms) +{ +#if APR_HAS_THREADS + apr_thread_mutex_lock(ms->lock); +#endif + ms->status = APR_MC_SERVER_DEAD; + ms->btime = apr_time_now(); +#if APR_HAS_THREADS + apr_thread_mutex_unlock(ms->lock); +#endif + return APR_SUCCESS; +} + +static apr_status_t make_server_live(apr_memcache_t *mc, apr_memcache_server_t *ms) +{ + ms->status = APR_MC_SERVER_LIVE; + return APR_SUCCESS; +} + + +APU_DECLARE(apr_status_t) apr_memcache_add_server(apr_memcache_t *mc, apr_memcache_server_t *ms) +{ + apr_status_t rv = APR_SUCCESS; + + if(mc->ntotal >= mc->nalloc) { + return APR_ENOMEM; + } + + mc->live_servers[mc->ntotal] = ms; + mc->ntotal++; + make_server_live(mc, ms); + return rv; +} + +static apr_status_t mc_version_ping(apr_memcache_server_t *ms); + +APU_DECLARE(apr_memcache_server_t *) +apr_memcache_find_server_hash(apr_memcache_t *mc, const apr_uint32_t hash) +{ + if (mc->server_func) { + return mc->server_func(mc->server_baton, mc, hash); + } + else { + return apr_memcache_find_server_hash_default(NULL, mc, hash); + } +} + +APU_DECLARE(apr_memcache_server_t *) +apr_memcache_find_server_hash_default(void *baton, apr_memcache_t *mc, + const apr_uint32_t hash) +{ + apr_memcache_server_t *ms = NULL; + apr_uint32_t h = hash ? hash : 1; + apr_uint32_t i = 0; + apr_time_t curtime = 0; + + if(mc->ntotal == 0) { + return NULL; + } + + do { + ms = mc->live_servers[h % mc->ntotal]; + if(ms->status == APR_MC_SERVER_LIVE) { + break; + } + else { + if (curtime == 0) { + curtime = apr_time_now(); + } +#if APR_HAS_THREADS + apr_thread_mutex_lock(ms->lock); +#endif + /* Try the the dead server, every 5 seconds */ + if (curtime - ms->btime > apr_time_from_sec(5)) { + if (mc_version_ping(ms) == APR_SUCCESS) { + ms->btime = curtime; + make_server_live(mc, ms); +#if APR_HAS_THREADS + apr_thread_mutex_unlock(ms->lock); +#endif + break; + } + } +#if APR_HAS_THREADS + apr_thread_mutex_unlock(ms->lock); +#endif + } + h++; + i++; + } while(i < mc->ntotal); + + if (i == mc->ntotal) { + ms = NULL; + } + + return ms; +} + +APU_DECLARE(apr_memcache_server_t *) apr_memcache_find_server(apr_memcache_t *mc, const char *host, apr_port_t port) +{ + int i; + + for (i = 0; i < mc->ntotal; i++) { + if (strcmp(mc->live_servers[i]->host, host) == 0 + && mc->live_servers[i]->port == port) { + + return mc->live_servers[i]; + } + } + + return NULL; +} + +static apr_status_t ms_find_conn(apr_memcache_server_t *ms, apr_memcache_conn_t **conn) +{ + apr_status_t rv; + apr_bucket_alloc_t *balloc; + apr_bucket *e; + +#if APR_HAS_THREADS + rv = apr_reslist_acquire(ms->conns, (void **)conn); +#else + *conn = ms->conn; + rv = APR_SUCCESS; +#endif + + if (rv != APR_SUCCESS) { + return rv; + } + + balloc = apr_bucket_alloc_create((*conn)->tp); + (*conn)->bb = apr_brigade_create((*conn)->tp, balloc); + (*conn)->tb = apr_brigade_create((*conn)->tp, balloc); + + e = apr_bucket_socket_create((*conn)->sock, balloc); + APR_BRIGADE_INSERT_TAIL((*conn)->bb, e); + + return rv; +} + +static apr_status_t ms_bad_conn(apr_memcache_server_t *ms, apr_memcache_conn_t *conn) +{ +#if APR_HAS_THREADS + return apr_reslist_invalidate(ms->conns, conn); +#else + return APR_SUCCESS; +#endif +} + +static apr_status_t ms_release_conn(apr_memcache_server_t *ms, apr_memcache_conn_t *conn) +{ + apr_pool_clear(conn->tp); +#if APR_HAS_THREADS + return apr_reslist_release(ms->conns, conn); +#else + return APR_SUCCESS; +#endif +} + +APU_DECLARE(apr_status_t) apr_memcache_enable_server(apr_memcache_t *mc, apr_memcache_server_t *ms) +{ + apr_status_t rv = APR_SUCCESS; + + if (ms->status == APR_MC_SERVER_LIVE) { + return rv; + } + + rv = make_server_live(mc, ms); + return rv; +} + +APU_DECLARE(apr_status_t) apr_memcache_disable_server(apr_memcache_t *mc, apr_memcache_server_t *ms) +{ + return make_server_dead(mc, ms); +} + +static apr_status_t conn_connect(apr_memcache_conn_t *conn) +{ + apr_status_t rv = APR_SUCCESS; + apr_sockaddr_t *sa; + + rv = apr_sockaddr_info_get(&sa, conn->ms->host, APR_INET, conn->ms->port, 0, conn->p); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_socket_timeout_set(conn->sock, 1 * APR_USEC_PER_SEC); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_socket_connect(conn->sock, sa); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_socket_timeout_set(conn->sock, -1); + if (rv != APR_SUCCESS) { + return rv; + } + + return rv; +} + + +static apr_status_t +mc_conn_construct(void **conn_, void *params, apr_pool_t *pool) +{ + apr_status_t rv = APR_SUCCESS; + apr_memcache_conn_t *conn; + apr_pool_t *np; + apr_pool_t *tp; + apr_memcache_server_t *ms = params; + + rv = apr_pool_create(&np, pool); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_pool_create(&tp, np); + if (rv != APR_SUCCESS) { + apr_pool_destroy(np); + return rv; + } + + conn = apr_palloc(np, sizeof( apr_memcache_conn_t )); + + conn->p = np; + conn->tp = tp; + + rv = apr_socket_create(&conn->sock, APR_INET, SOCK_STREAM, 0, np); + + if (rv != APR_SUCCESS) { + apr_pool_destroy(np); + return rv; + } + + conn->buffer = apr_palloc(conn->p, BUFFER_SIZE); + conn->blen = 0; + conn->ms = ms; + + rv = conn_connect(conn); + if (rv != APR_SUCCESS) { + apr_pool_destroy(np); + } + else { + *conn_ = conn; + } + + return rv; +} + +#if APR_HAS_THREADS +static apr_status_t +mc_conn_destruct(void *conn_, void *params, apr_pool_t *pool) +{ + apr_memcache_conn_t *conn = (apr_memcache_conn_t*)conn_; + struct iovec vec[2]; + apr_size_t written; + + /* send a quit message to the memcached server to be nice about it. */ + vec[0].iov_base = MC_QUIT; + vec[0].iov_len = MC_QUIT_LEN; + + vec[1].iov_base = MC_EOL; + vec[1].iov_len = MC_EOL_LEN; + + /* Return values not checked, since we just want to make it go away. */ + apr_socket_sendv(conn->sock, vec, 2, &written); + apr_socket_close(conn->sock); + + apr_pool_destroy(conn->p); + + return APR_SUCCESS; +} +#endif + +APU_DECLARE(apr_status_t) apr_memcache_server_create(apr_pool_t *p, + const char *host, apr_port_t port, + apr_uint32_t min, apr_uint32_t smax, + apr_uint32_t max, apr_uint32_t ttl, + apr_memcache_server_t **ms) +{ + apr_status_t rv = APR_SUCCESS; + apr_memcache_server_t *server; + apr_pool_t *np; + + rv = apr_pool_create(&np, p); + + server = apr_palloc(np, sizeof(apr_memcache_server_t)); + + server->p = np; + server->host = apr_pstrdup(np, host); + server->port = port; + server->status = APR_MC_SERVER_DEAD; +#if APR_HAS_THREADS + rv = apr_thread_mutex_create(&server->lock, APR_THREAD_MUTEX_DEFAULT, np); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_reslist_create(&server->conns, + min, /* hard minimum */ + smax, /* soft maximum */ + max, /* hard maximum */ + ttl, /* Time to live */ + mc_conn_construct, /* Make a New Connection */ + mc_conn_destruct, /* Kill Old Connection */ + server, np); + + apr_reslist_cleanup_order_set(server->conns, APR_RESLIST_CLEANUP_FIRST); +#else + rv = mc_conn_construct((void**)&(server->conn), server, np); +#endif + + if (rv != APR_SUCCESS) { + return rv; + } + + *ms = server; + + return rv; +} + +APU_DECLARE(apr_status_t) apr_memcache_create(apr_pool_t *p, + apr_uint16_t max_servers, apr_uint32_t flags, + apr_memcache_t **memcache) +{ + apr_status_t rv = APR_SUCCESS; + apr_memcache_t *mc; + + mc = apr_palloc(p, sizeof(apr_memcache_t)); + mc->p = p; + mc->nalloc = max_servers; + mc->ntotal = 0; + mc->live_servers = apr_palloc(p, mc->nalloc * sizeof(struct apr_memcache_server_t *)); + mc->hash_func = NULL; + mc->hash_baton = NULL; + mc->server_func = NULL; + mc->server_baton = NULL; + *memcache = mc; + return rv; +} + + +/* The crc32 functions and data was originally written by Spencer + * Garrett and was gleaned from the PostgreSQL source + * tree via the files contrib/ltree/crc32.[ch] and from FreeBSD at + * src/usr.bin/cksum/crc32.c. + */ + +static const apr_uint32_t crc32tab[256] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, +}; + +APU_DECLARE(apr_uint32_t) apr_memcache_hash_crc32(void *baton, + const char *data, + const apr_size_t data_len) +{ + apr_uint32_t i; + apr_uint32_t crc; + crc = ~0; + + for (i = 0; i < data_len; i++) + crc = (crc >> 8) ^ crc32tab[(crc ^ (data[i])) & 0xff]; + + return ~crc; +} + +APU_DECLARE(apr_uint32_t) apr_memcache_hash_default(void *baton, + const char *data, + const apr_size_t data_len) +{ + /* The default Perl Client doesn't actually use just crc32 -- it shifts it again + * like this.... + */ + return ((apr_memcache_hash_crc32(baton, data, data_len) >> 16) & 0x7fff); +} + +APU_DECLARE(apr_uint32_t) apr_memcache_hash(apr_memcache_t *mc, + const char *data, + const apr_size_t data_len) +{ + if (mc->hash_func) { + return mc->hash_func(mc->hash_baton, data, data_len); + } + else { + return apr_memcache_hash_default(NULL, data, data_len); + } +} + +static apr_status_t get_server_line(apr_memcache_conn_t *conn) +{ + apr_size_t bsize = BUFFER_SIZE; + apr_status_t rv = APR_SUCCESS; + + rv = apr_brigade_split_line(conn->tb, conn->bb, APR_BLOCK_READ, BUFFER_SIZE); + + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_brigade_flatten(conn->tb, conn->buffer, &bsize); + + if (rv != APR_SUCCESS) { + return rv; + } + + conn->blen = bsize; + conn->buffer[bsize] = '\0'; + + return apr_brigade_cleanup(conn->tb); +} + +static apr_status_t storage_cmd_write(apr_memcache_t *mc, + char *cmd, + const apr_size_t cmd_size, + const char *key, + char *data, + const apr_size_t data_size, + apr_uint32_t timeout, + apr_uint16_t flags) +{ + apr_uint32_t hash; + apr_memcache_server_t *ms; + apr_memcache_conn_t *conn; + apr_status_t rv; + apr_size_t written; + struct iovec vec[5]; + apr_size_t klen; + + apr_size_t key_size = strlen(key); + + hash = apr_memcache_hash(mc, key, key_size); + + ms = apr_memcache_find_server_hash(mc, hash); + + if (ms == NULL) + return APR_NOTFOUND; + + rv = ms_find_conn(ms, &conn); + + if (rv != APR_SUCCESS) { + apr_memcache_disable_server(mc, ms); + return rv; + } + + /* \r\n\r\n */ + + vec[0].iov_base = cmd; + vec[0].iov_len = cmd_size; + + vec[1].iov_base = (void*)key; + vec[1].iov_len = key_size; + + klen = apr_snprintf(conn->buffer, BUFFER_SIZE, " %u %u %" APR_SIZE_T_FMT " " MC_EOL, + flags, timeout, data_size); + + vec[2].iov_base = conn->buffer; + vec[2].iov_len = klen; + + vec[3].iov_base = data; + vec[3].iov_len = data_size; + + vec[4].iov_base = MC_EOL; + vec[4].iov_len = MC_EOL_LEN; + + rv = apr_socket_sendv(conn->sock, vec, 5, &written); + + if (rv != APR_SUCCESS) { + ms_bad_conn(ms, conn); + apr_memcache_disable_server(mc, ms); + return rv; + } + + rv = get_server_line(conn); + + if (rv != APR_SUCCESS) { + ms_bad_conn(ms, conn); + apr_memcache_disable_server(mc, ms); + return rv; + } + + if (strcmp(conn->buffer, MS_STORED MC_EOL) == 0) { + rv = APR_SUCCESS; + } + else if (strcmp(conn->buffer, MS_NOT_STORED MC_EOL) == 0) { + rv = APR_EEXIST; + } + else { + rv = APR_EGENERAL; + } + + ms_release_conn(ms, conn); + + return rv; +} + +APU_DECLARE(apr_status_t) +apr_memcache_set(apr_memcache_t *mc, + const char *key, + char *data, + const apr_size_t data_size, + apr_uint32_t timeout, + apr_uint16_t flags) +{ + return storage_cmd_write(mc, + MC_SET, MC_SET_LEN, + key, + data, data_size, + timeout, flags); +} + +APU_DECLARE(apr_status_t) +apr_memcache_add(apr_memcache_t *mc, + const char *key, + char *data, + const apr_size_t data_size, + apr_uint32_t timeout, + apr_uint16_t flags) +{ + return storage_cmd_write(mc, + MC_ADD, MC_ADD_LEN, + key, + data, data_size, + timeout, flags); +} + +APU_DECLARE(apr_status_t) +apr_memcache_replace(apr_memcache_t *mc, + const char *key, + char *data, + const apr_size_t data_size, + apr_uint32_t timeout, + apr_uint16_t flags) +{ + return storage_cmd_write(mc, + MC_REPLACE, MC_REPLACE_LEN, + key, + data, data_size, + timeout, flags); + +} + +APU_DECLARE(apr_status_t) +apr_memcache_getp(apr_memcache_t *mc, + apr_pool_t *p, + const char *key, + char **baton, + apr_size_t *new_length, + apr_uint16_t *flags_) +{ + apr_status_t rv; + apr_memcache_server_t *ms; + apr_memcache_conn_t *conn; + apr_uint32_t hash; + apr_size_t written; + apr_size_t klen = strlen(key); + struct iovec vec[3]; + + hash = apr_memcache_hash(mc, key, klen); + ms = apr_memcache_find_server_hash(mc, hash); + if (ms == NULL) + return APR_NOTFOUND; + + rv = ms_find_conn(ms, &conn); + + if (rv != APR_SUCCESS) { + apr_memcache_disable_server(mc, ms); + return rv; + } + + /* get [ [...]]\r\n */ + vec[0].iov_base = MC_GET; + vec[0].iov_len = MC_GET_LEN; + + vec[1].iov_base = (void*)key; + vec[1].iov_len = klen; + + vec[2].iov_base = MC_EOL; + vec[2].iov_len = MC_EOL_LEN; + + rv = apr_socket_sendv(conn->sock, vec, 3, &written); + + if (rv != APR_SUCCESS) { + ms_bad_conn(ms, conn); + apr_memcache_disable_server(mc, ms); + return rv; + } + + rv = get_server_line(conn); + if (rv != APR_SUCCESS) { + ms_bad_conn(ms, conn); + apr_memcache_disable_server(mc, ms); + return rv; + } + + if (strncmp(MS_VALUE, conn->buffer, MS_VALUE_LEN) == 0) { + char *flags; + char *length; + char *start; + char *last; + apr_size_t len = 0; + + start = conn->buffer; + flags = apr_strtok(conn->buffer, " ", &last); + flags = apr_strtok(NULL, " ", &last); + flags = apr_strtok(NULL, " ", &last); + + if (flags_) { + *flags_ = atoi(flags); + } + + length = apr_strtok(NULL, " ", &last); + if (length) { + len = atoi(length); + } + + if (len < 0) { + *new_length = 0; + *baton = NULL; + } + else { + apr_bucket_brigade *bbb; + apr_bucket *e; + + /* eat the trailing \r\n */ + rv = apr_brigade_partition(conn->bb, len+2, &e); + + if (rv != APR_SUCCESS) { + ms_bad_conn(ms, conn); + apr_memcache_disable_server(mc, ms); + return rv; + } + + bbb = apr_brigade_split(conn->bb, e); + + rv = apr_brigade_pflatten(conn->bb, baton, &len, p); + + if (rv != APR_SUCCESS) { + ms_bad_conn(ms, conn); + apr_memcache_disable_server(mc, ms); + return rv; + } + + rv = apr_brigade_destroy(conn->bb); + if (rv != APR_SUCCESS) { + ms_bad_conn(ms, conn); + apr_memcache_disable_server(mc, ms); + return rv; + } + + conn->bb = bbb; + + *new_length = len - 2; + (*baton)[*new_length] = '\0'; + } + + rv = get_server_line(conn); + if (rv != APR_SUCCESS) { + ms_bad_conn(ms, conn); + apr_memcache_disable_server(mc, ms); + return rv; + } + + if (strncmp(MS_END, conn->buffer, MS_END_LEN) != 0) { + rv = APR_EGENERAL; + } + } + else if (strncmp(MS_END, conn->buffer, MS_END_LEN) == 0) { + rv = APR_NOTFOUND; + } + else { + rv = APR_EGENERAL; + } + + ms_release_conn(ms, conn); + + return rv; +} + +APU_DECLARE(apr_status_t) +apr_memcache_delete(apr_memcache_t *mc, + const char *key, + apr_uint32_t timeout) +{ + apr_status_t rv; + apr_memcache_server_t *ms; + apr_memcache_conn_t *conn; + apr_uint32_t hash; + apr_size_t written; + struct iovec vec[3]; + apr_size_t klen = strlen(key); + + hash = apr_memcache_hash(mc, key, klen); + ms = apr_memcache_find_server_hash(mc, hash); + if (ms == NULL) + return APR_NOTFOUND; + + rv = ms_find_conn(ms, &conn); + + if (rv != APR_SUCCESS) { + apr_memcache_disable_server(mc, ms); + return rv; + } + + /* delete
    */ -APU_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key, +APR_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key, apr_sdbm_datum_t value, int opt); /** @@ -146,7 +146,7 @@ APU_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key, * @param key The key datum of the record to delete * @remark It is not an error to delete a non-existent record. */ -APU_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db, +APR_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db, const apr_sdbm_datum_t key); /** @@ -158,19 +158,19 @@ APU_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db, * prior to retrieving the first record, and hold the lock until after the * last call to apr_sdbm_nextkey. */ -APU_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db, apr_sdbm_datum_t *key); +APR_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db, apr_sdbm_datum_t *key); /** * Retrieve the next record key from an sdbm * @param db The database * @param key The key datum of the next record */ -APU_DECLARE(apr_status_t) apr_sdbm_nextkey(apr_sdbm_t *db, apr_sdbm_datum_t *key); +APR_DECLARE(apr_status_t) apr_sdbm_nextkey(apr_sdbm_t *db, apr_sdbm_datum_t *key); /** * Returns true if the sdbm database opened for read-only access * @param db The database to test */ -APU_DECLARE(int) apr_sdbm_rdonly(apr_sdbm_t *db); +APR_DECLARE(int) apr_sdbm_rdonly(apr_sdbm_t *db); /** @} */ #endif /* APR_SDBM_H */ diff --git a/include/apr_sha1.h b/include/apr_sha1.h index 2a4edf36808..c7ba3cf3cbf 100644 --- a/include/apr_sha1.h +++ b/include/apr_sha1.h @@ -79,13 +79,13 @@ struct apr_sha1_ctx_t { * will always generate the same hash, making it easier * to break since the search space is smaller. */ -APU_DECLARE(void) apr_sha1_base64(const char *clear, int len, char *out); +APR_DECLARE(void) apr_sha1_base64(const char *clear, int len, char *out); /** * Initialize the SHA digest * @param context The SHA context to initialize */ -APU_DECLARE(void) apr_sha1_init(apr_sha1_ctx_t *context); +APR_DECLARE(void) apr_sha1_init(apr_sha1_ctx_t *context); /** * Update the SHA digest @@ -93,7 +93,7 @@ APU_DECLARE(void) apr_sha1_init(apr_sha1_ctx_t *context); * @param input The buffer to add to the SHA digest * @param inputLen The length of the input buffer */ -APU_DECLARE(void) apr_sha1_update(apr_sha1_ctx_t *context, const char *input, +APR_DECLARE(void) apr_sha1_update(apr_sha1_ctx_t *context, const char *input, unsigned int inputLen); /** @@ -102,7 +102,7 @@ APU_DECLARE(void) apr_sha1_update(apr_sha1_ctx_t *context, const char *input, * @param input The buffer to add to the SHA digest * @param inputLen The length of the input buffer */ -APU_DECLARE(void) apr_sha1_update_binary(apr_sha1_ctx_t *context, +APR_DECLARE(void) apr_sha1_update_binary(apr_sha1_ctx_t *context, const unsigned char *input, unsigned int inputLen); @@ -111,7 +111,7 @@ APU_DECLARE(void) apr_sha1_update_binary(apr_sha1_ctx_t *context, * @param digest the output buffer in which to store the digest * @param context The context to finalize */ -APU_DECLARE(void) apr_sha1_final(unsigned char digest[APR_SHA1_DIGESTSIZE], +APR_DECLARE(void) apr_sha1_final(unsigned char digest[APR_SHA1_DIGESTSIZE], apr_sha1_ctx_t *context); #ifdef __cplusplus diff --git a/include/apr_strmatch.h b/include/apr_strmatch.h index 53fadad5696..3b23a9d6467 100644 --- a/include/apr_strmatch.h +++ b/include/apr_strmatch.h @@ -58,7 +58,7 @@ struct apr_strmatch_pattern { * @return A pointer to the first instance of the pattern in s, or * NULL if not found */ -APU_DECLARE(const char *) apr_strmatch(const apr_strmatch_pattern *pattern, +APR_DECLARE(const char *) apr_strmatch(const apr_strmatch_pattern *pattern, const char *s, apr_size_t slen); #else #define apr_strmatch(pattern, s, slen) (*((pattern)->compare))((pattern), (s), (slen)) @@ -71,7 +71,7 @@ APU_DECLARE(const char *) apr_strmatch(const apr_strmatch_pattern *pattern, * @param case_sensitive Whether the matching should be case-sensitive * @return a pointer to the compiled pattern, or NULL if compilation fails */ -APU_DECLARE(const apr_strmatch_pattern *) apr_strmatch_precompile(apr_pool_t *p, const char *s, int case_sensitive); +APR_DECLARE(const apr_strmatch_pattern *) apr_strmatch_precompile(apr_pool_t *p, const char *s, int case_sensitive); /** @} */ #ifdef __cplusplus diff --git a/include/apr_thread_pool.h b/include/apr_thread_pool.h index cbf382b3da2..8fbb19d0ec0 100644 --- a/include/apr_thread_pool.h +++ b/include/apr_thread_pool.h @@ -74,7 +74,7 @@ typedef struct apr_thread_pool apr_thread_pool_t; * @return APR_SUCCESS if the thread pool was created successfully. Otherwise, * the error code. */ -APU_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t **me, +APR_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t **me, apr_size_t init_threads, apr_size_t max_threads, apr_pool_t *pool); @@ -83,7 +83,7 @@ APU_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t **me, * Destroy the thread pool and stop all the threads * @return APR_SUCCESS if all threads are stopped. */ -APU_DECLARE(apr_status_t) apr_thread_pool_destroy(apr_thread_pool_t *me); +APR_DECLARE(apr_status_t) apr_thread_pool_destroy(apr_thread_pool_t *me); /** * Schedule a task to the bottom of the tasks of same priority. @@ -94,7 +94,7 @@ APU_DECLARE(apr_status_t) apr_thread_pool_destroy(apr_thread_pool_t *me); * @param owner Owner of this task. * @return APR_SUCCESS if the task had been scheduled successfully */ -APU_DECLARE(apr_status_t) apr_thread_pool_push(apr_thread_pool_t *me, +APR_DECLARE(apr_status_t) apr_thread_pool_push(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_byte_t priority, @@ -108,7 +108,7 @@ APU_DECLARE(apr_status_t) apr_thread_pool_push(apr_thread_pool_t *me, * @param owner Owner of this task. * @return APR_SUCCESS if the task had been scheduled successfully */ -APU_DECLARE(apr_status_t) apr_thread_pool_schedule(apr_thread_pool_t *me, +APR_DECLARE(apr_status_t) apr_thread_pool_schedule(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_interval_time_t time, @@ -123,7 +123,7 @@ APU_DECLARE(apr_status_t) apr_thread_pool_schedule(apr_thread_pool_t *me, * @param owner Owner of this task. * @return APR_SUCCESS if the task had been scheduled successfully */ -APU_DECLARE(apr_status_t) apr_thread_pool_top(apr_thread_pool_t *me, +APR_DECLARE(apr_status_t) apr_thread_pool_top(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_byte_t priority, @@ -138,7 +138,7 @@ APU_DECLARE(apr_status_t) apr_thread_pool_top(apr_thread_pool_t *me, * @note The task function should not be calling cancel, otherwise the function * may get stuck forever. The function assert if it detect such a case. */ -APU_DECLARE(apr_status_t) apr_thread_pool_tasks_cancel(apr_thread_pool_t *me, +APR_DECLARE(apr_status_t) apr_thread_pool_tasks_cancel(apr_thread_pool_t *me, void *owner); /** @@ -146,35 +146,35 @@ APU_DECLARE(apr_status_t) apr_thread_pool_tasks_cancel(apr_thread_pool_t *me, * @param me The thread pool * @return Number of tasks in the queue */ -APU_DECLARE(apr_size_t) apr_thread_pool_tasks_count(apr_thread_pool_t *me); +APR_DECLARE(apr_size_t) apr_thread_pool_tasks_count(apr_thread_pool_t *me); /** * Get the current number of scheduled tasks waiting in the queue * @param me The thread pool * @return Number of scheduled tasks in the queue */ -APU_DECLARE(apr_size_t) apr_thread_pool_scheduled_tasks_count(apr_thread_pool_t *me); +APR_DECLARE(apr_size_t) apr_thread_pool_scheduled_tasks_count(apr_thread_pool_t *me); /** * Get the current number of threads * @param me The thread pool * @return Total number of threads */ -APU_DECLARE(apr_size_t) apr_thread_pool_threads_count(apr_thread_pool_t *me); +APR_DECLARE(apr_size_t) apr_thread_pool_threads_count(apr_thread_pool_t *me); /** * Get the current number of busy threads * @param me The thread pool * @return Number of busy threads */ -APU_DECLARE(apr_size_t) apr_thread_pool_busy_count(apr_thread_pool_t *me); +APR_DECLARE(apr_size_t) apr_thread_pool_busy_count(apr_thread_pool_t *me); /** * Get the current number of idle threads * @param me The thread pool * @return Number of idle threads */ -APU_DECLARE(apr_size_t) apr_thread_pool_idle_count(apr_thread_pool_t *me); +APR_DECLARE(apr_size_t) apr_thread_pool_idle_count(apr_thread_pool_t *me); /** * Access function for the maximum number of idle threads. Number of current @@ -183,7 +183,7 @@ APU_DECLARE(apr_size_t) apr_thread_pool_idle_count(apr_thread_pool_t *me); * @param cnt The number * @return The number of threads that were stopped. */ -APU_DECLARE(apr_size_t) apr_thread_pool_idle_max_set(apr_thread_pool_t *me, +APR_DECLARE(apr_size_t) apr_thread_pool_idle_max_set(apr_thread_pool_t *me, apr_size_t cnt); /** @@ -191,7 +191,7 @@ APU_DECLARE(apr_size_t) apr_thread_pool_idle_max_set(apr_thread_pool_t *me, * @param me The thread pool * @return Number of tasks that have run */ -APU_DECLARE(apr_size_t) +APR_DECLARE(apr_size_t) apr_thread_pool_tasks_run_count(apr_thread_pool_t * me); /** @@ -199,7 +199,7 @@ APU_DECLARE(apr_size_t) * @param me The thread pool * @return High water mark of tasks waiting to run */ -APU_DECLARE(apr_size_t) +APR_DECLARE(apr_size_t) apr_thread_pool_tasks_high_count(apr_thread_pool_t * me); /** @@ -207,7 +207,7 @@ APU_DECLARE(apr_size_t) * @param me The thread pool * @return High water mark of threads in thread pool */ -APU_DECLARE(apr_size_t) +APR_DECLARE(apr_size_t) apr_thread_pool_threads_high_count(apr_thread_pool_t * me); /** @@ -215,7 +215,7 @@ APU_DECLARE(apr_size_t) * @param me The thread pool * @return Number of idle threads that timed out */ -APU_DECLARE(apr_size_t) +APR_DECLARE(apr_size_t) apr_thread_pool_threads_idle_timeout_count(apr_thread_pool_t * me); /** @@ -223,7 +223,7 @@ APU_DECLARE(apr_size_t) * @param me The thread pool * @return The current maximum number */ -APU_DECLARE(apr_size_t) apr_thread_pool_idle_max_get(apr_thread_pool_t *me); +APR_DECLARE(apr_size_t) apr_thread_pool_idle_max_get(apr_thread_pool_t *me); /** * Access function for the maximum number of threads. @@ -231,7 +231,7 @@ APU_DECLARE(apr_size_t) apr_thread_pool_idle_max_get(apr_thread_pool_t *me); * @param cnt Number of threads * @return The original maximum number of threads */ -APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_set(apr_thread_pool_t *me, +APR_DECLARE(apr_size_t) apr_thread_pool_thread_max_set(apr_thread_pool_t *me, apr_size_t cnt); /** @@ -244,7 +244,7 @@ APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_set(apr_thread_pool_t *me, * till it reaps itself * @return The original maximum wait time */ -APU_DECLARE(apr_interval_time_t) +APR_DECLARE(apr_interval_time_t) apr_thread_pool_idle_wait_set(apr_thread_pool_t * me, apr_interval_time_t timeout); @@ -254,7 +254,7 @@ APU_DECLARE(apr_interval_time_t) * @param me The thread pool * @return The current maximum wait time */ -APU_DECLARE(apr_interval_time_t) +APR_DECLARE(apr_interval_time_t) apr_thread_pool_idle_wait_get(apr_thread_pool_t * me); /** @@ -262,7 +262,7 @@ APU_DECLARE(apr_interval_time_t) * @param me The thread pool * @return The current maximum number */ -APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_get(apr_thread_pool_t *me); +APR_DECLARE(apr_size_t) apr_thread_pool_thread_max_get(apr_thread_pool_t *me); /** * Access function for the threshold of tasks in queue to trigger a new thread. @@ -270,7 +270,7 @@ APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_get(apr_thread_pool_t *me); * @param cnt The new threshold * @return The original threshold */ -APU_DECLARE(apr_size_t) apr_thread_pool_threshold_set(apr_thread_pool_t *me, +APR_DECLARE(apr_size_t) apr_thread_pool_threshold_set(apr_thread_pool_t *me, apr_size_t val); /** @@ -278,7 +278,7 @@ APU_DECLARE(apr_size_t) apr_thread_pool_threshold_set(apr_thread_pool_t *me, * @param me The thread pool * @return The current threshold */ -APU_DECLARE(apr_size_t) apr_thread_pool_threshold_get(apr_thread_pool_t * me); +APR_DECLARE(apr_size_t) apr_thread_pool_threshold_get(apr_thread_pool_t * me); /** * Get owner of the task currently been executed by the thread. @@ -286,7 +286,7 @@ APU_DECLARE(apr_size_t) apr_thread_pool_threshold_get(apr_thread_pool_t * me); * @param owner Pointer to receive owner of the task. * @return APR_SUCCESS if the owner is retrieved successfully */ -APU_DECLARE(apr_status_t) apr_thread_pool_task_owner_get(apr_thread_t *thd, +APR_DECLARE(apr_status_t) apr_thread_pool_task_owner_get(apr_thread_t *thd, void **owner); /** @} */ diff --git a/include/apr_uri.h b/include/apr_uri.h index 02908a9d3be..63b3e207fcd 100644 --- a/include/apr_uri.h +++ b/include/apr_uri.h @@ -124,7 +124,7 @@ struct apr_uri_t { * @param scheme_str The string that contains the current scheme * @return The default port for this scheme */ -APU_DECLARE(apr_port_t) apr_uri_port_of_scheme(const char *scheme_str); +APR_DECLARE(apr_port_t) apr_uri_port_of_scheme(const char *scheme_str); /** * Unparse a apr_uri_t structure to an URI string. Optionally @@ -143,7 +143,7 @@ APU_DECLARE(apr_port_t) apr_uri_port_of_scheme(const char *scheme_str); *
    * @return The uri as a string */ -APU_DECLARE(char *) apr_uri_unparse(apr_pool_t *p, +APR_DECLARE(char *) apr_uri_unparse(apr_pool_t *p, const apr_uri_t *uptr, unsigned flags); @@ -156,7 +156,7 @@ APU_DECLARE(char *) apr_uri_unparse(apr_pool_t *p, * @param uptr The apr_uri_t to fill out * @return APR_SUCCESS for success or error code */ -APU_DECLARE(apr_status_t) apr_uri_parse(apr_pool_t *p, const char *uri, +APR_DECLARE(apr_status_t) apr_uri_parse(apr_pool_t *p, const char *uri, apr_uri_t *uptr); /** @@ -166,7 +166,7 @@ APU_DECLARE(apr_status_t) apr_uri_parse(apr_pool_t *p, const char *uri, * @param uptr The apr_uri_t to fill out * @return APR_SUCCESS for success or error code */ -APU_DECLARE(apr_status_t) apr_uri_parse_hostinfo(apr_pool_t *p, +APR_DECLARE(apr_status_t) apr_uri_parse_hostinfo(apr_pool_t *p, const char *hostinfo, apr_uri_t *uptr); diff --git a/include/apr_uuid.h b/include/apr_uuid.h index 5312a9f62ac..bb8841f1cda 100644 --- a/include/apr_uuid.h +++ b/include/apr_uuid.h @@ -50,7 +50,7 @@ typedef struct { * Generate and return a (new) UUID * @param uuid The resulting UUID */ -APU_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid); +APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid); /** * Format a UUID into a string, following the standard format @@ -59,14 +59,14 @@ APU_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid); * the formatted UUID and a null terminator * @param uuid The UUID to format */ -APU_DECLARE(void) apr_uuid_format(char *buffer, const apr_uuid_t *uuid); +APR_DECLARE(void) apr_uuid_format(char *buffer, const apr_uuid_t *uuid); /** * Parse a standard-format string into a UUID * @param uuid The resulting UUID * @param uuid_str The formatted UUID */ -APU_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str); +APR_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str); /** @} */ #ifdef __cplusplus diff --git a/include/apr_xlate.h b/include/apr_xlate.h index 326366853a4..6f27fda0be8 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -63,7 +63,7 @@ typedef struct apr_xlate_t apr_xlate_t; * if charset transcoding is not available in this instance of * apr-util at all (i.e., APR_HAS_XLATE is undefined). */ -APU_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, +APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, const char *topage, const char *frompage, apr_pool_t *pool); @@ -90,7 +90,7 @@ APU_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, * Return APR_ENOTIMPL if charset transcoding is not available * in this instance of apr-util (i.e., APR_HAS_XLATE is undefined). */ -APU_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff); +APR_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff); /** * Convert a buffer of text from one codepage to another. @@ -114,7 +114,7 @@ APU_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff); * the inbuf and inbytes_left parameters as NULL. (Note that this * mode only works from version 1.1.0 onwards) */ -APU_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, +APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, apr_size_t *inbytes_left, char *outbuf, @@ -131,7 +131,7 @@ APU_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, * @param inchar The character to convert * @param outchar The converted character */ -APU_DECLARE(apr_status_t) apr_xlate_conv_char(apr_xlate_t *convset, +APR_DECLARE(apr_status_t) apr_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar); #endif @@ -143,7 +143,7 @@ APU_DECLARE(apr_status_t) apr_xlate_conv_char(apr_xlate_t *convset, * @warning This only works when converting between single-byte character sets. * -1 will be returned if the conversion can't be performed. */ -APU_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, +APR_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar); /** @@ -153,7 +153,7 @@ APU_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, * Return APR_ENOTIMPL if charset transcoding is not available * in this instance of apr-util (i.e., APR_HAS_XLATE is undefined). */ -APU_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset); +APR_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset); /** @} */ #ifdef __cplusplus diff --git a/include/apr_xml.h b/include/apr_xml.h index 2a43b283e97..62fed68d14b 100644 --- a/include/apr_xml.h +++ b/include/apr_xml.h @@ -74,7 +74,7 @@ struct apr_text_header { * @param hdr The text header to append to * @param text The new text to append */ -APU_DECLARE(void) apr_text_append(apr_pool_t *p, apr_text_header *hdr, +APR_DECLARE(void) apr_text_append(apr_pool_t *p, apr_text_header *hdr, const char *text); @@ -212,7 +212,7 @@ typedef struct apr_xml_parser apr_xml_parser; * @param pool The pool for allocating the parser and the parse results. * @return The new parser. */ -APU_DECLARE(apr_xml_parser *) apr_xml_parser_create(apr_pool_t *pool); +APR_DECLARE(apr_xml_parser *) apr_xml_parser_create(apr_pool_t *pool); /** * Parse a File, producing a xml_doc @@ -224,7 +224,7 @@ APU_DECLARE(apr_xml_parser *) apr_xml_parser_create(apr_pool_t *pool); * @param buffer_length Buffer length which would be suitable * @return Any errors found during parsing. */ -APU_DECLARE(apr_status_t) apr_xml_parse_file(apr_pool_t *p, +APR_DECLARE(apr_status_t) apr_xml_parse_file(apr_pool_t *p, apr_xml_parser **parser, apr_xml_doc **ppdoc, apr_file_t *xmlfd, @@ -239,7 +239,7 @@ APU_DECLARE(apr_status_t) apr_xml_parse_file(apr_pool_t *p, * @return Any errors found during parsing. * @remark Use apr_xml_parser_geterror() to get more error information. */ -APU_DECLARE(apr_status_t) apr_xml_parser_feed(apr_xml_parser *parser, +APR_DECLARE(apr_status_t) apr_xml_parser_feed(apr_xml_parser *parser, const char *data, apr_size_t len); @@ -251,7 +251,7 @@ APU_DECLARE(apr_status_t) apr_xml_parser_feed(apr_xml_parser *parser, * @return Any errors found during the final stage of parsing. * @remark Use apr_xml_parser_geterror() to get more error information. */ -APU_DECLARE(apr_status_t) apr_xml_parser_done(apr_xml_parser *parser, +APR_DECLARE(apr_status_t) apr_xml_parser_done(apr_xml_parser *parser, apr_xml_doc **pdoc); /** @@ -261,7 +261,7 @@ APU_DECLARE(apr_status_t) apr_xml_parser_done(apr_xml_parser *parser, * @param errbufsize The length of the error text buffer. * @return The error buffer */ -APU_DECLARE(char *) apr_xml_parser_geterror(apr_xml_parser *parser, +APR_DECLARE(char *) apr_xml_parser_geterror(apr_xml_parser *parser, char *errbuf, apr_size_t errbufsize); @@ -282,7 +282,7 @@ APU_DECLARE(char *) apr_xml_parser_geterror(apr_xml_parser *parser, * @param pbuf Buffer to put the converted text into * @param psize Size of the converted text */ -APU_DECLARE(void) apr_xml_to_text(apr_pool_t *p, const apr_xml_elem *elem, +APR_DECLARE(void) apr_xml_to_text(apr_pool_t *p, const apr_xml_elem *elem, int style, apr_array_header_t *namespaces, int *ns_map, const char **pbuf, apr_size_t *psize); @@ -299,7 +299,7 @@ APU_DECLARE(void) apr_xml_to_text(apr_pool_t *p, const apr_xml_elem *elem, * @param elem The XML element to empty * @return the string that was stored in the XML element */ -APU_DECLARE(const char *) apr_xml_empty_elem(apr_pool_t *p, +APR_DECLARE(const char *) apr_xml_empty_elem(apr_pool_t *p, const apr_xml_elem *elem); /** @@ -312,7 +312,7 @@ APU_DECLARE(const char *) apr_xml_empty_elem(apr_pool_t *p, * @note If the string does not contain special characters, it is not * duplicated into the pool and the original string is returned. */ -APU_DECLARE(const char *) apr_xml_quote_string(apr_pool_t *p, const char *s, +APR_DECLARE(const char *) apr_xml_quote_string(apr_pool_t *p, const char *s, int quotes); /** @@ -320,7 +320,7 @@ APU_DECLARE(const char *) apr_xml_quote_string(apr_pool_t *p, const char *s, * @param p The pool to allocate out of * @param elem The element to quote */ -APU_DECLARE(void) apr_xml_quote_elem(apr_pool_t *p, apr_xml_elem *elem); +APR_DECLARE(void) apr_xml_quote_elem(apr_pool_t *p, apr_xml_elem *elem); /* manage an array of unique URIs: apr_xml_insert_uri() and APR_XML_URI_ITEM() */ @@ -330,7 +330,7 @@ APU_DECLARE(void) apr_xml_quote_elem(apr_pool_t *p, apr_xml_elem *elem); * @param uri The uri to insert * @return int The uri's index */ -APU_DECLARE(int) apr_xml_insert_uri(apr_array_header_t *uri_array, +APR_DECLARE(int) apr_xml_insert_uri(apr_array_header_t *uri_array, const char *uri); /** Get the URI item for this XML element */ @@ -344,7 +344,7 @@ APU_DECLARE(int) apr_xml_insert_uri(apr_array_header_t *uri_array, * @param xlate The translation handle to use. * @return Any errors found during conversion. */ -APU_DECLARE(apr_status_t) apr_xml_parser_convert_doc(apr_pool_t *p, +APR_DECLARE(apr_status_t) apr_xml_parser_convert_doc(apr_pool_t *p, apr_xml_doc *pdoc, apr_xlate_t *convset); #endif diff --git a/include/apu.h.in b/include/apu.h.in index 4037094da84..572f3bdd084 100644 --- a/include/apu.h.in +++ b/include/apu.h.in @@ -30,42 +30,42 @@ #define APU_H /** - * APU_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, + * APR_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, * so that all public symbols are exported. * - * APU_DECLARE_STATIC is defined when including the APR-UTIL public headers, + * APR_DECLARE_STATIC is defined when including the APR-UTIL public headers, * to provide static linkage when the dynamic library may be unavailable. * - * APU_DECLARE_STATIC and APU_DECLARE_EXPORT are left undefined when + * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when * including the APR-UTIL public headers, to import and link the symbols from * the dynamic APR-UTIL library and assure appropriate indirection and calling * conventions at compile time. */ /** - * The public APR-UTIL functions are declared with APU_DECLARE(), so they may + * The public APR-UTIL functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with - * variable arguments must use APU_DECLARE_NONSTD(). + * variable arguments must use APR_DECLARE_NONSTD(). * - * @fn APU_DECLARE(rettype) apr_func(args); + * @fn APR_DECLARE(rettype) apr_func(args); */ -#define APU_DECLARE(type) type +#define APR_DECLARE(type) type /** * The public APR-UTIL functions using variable arguments are declared with - * APU_DECLARE_NONSTD(), as they must use the C language calling convention. + * APR_DECLARE_NONSTD(), as they must use the C language calling convention. * - * @fn APU_DECLARE_NONSTD(rettype) apr_func(args, ...); + * @fn APR_DECLARE_NONSTD(rettype) apr_func(args, ...); */ -#define APU_DECLARE_NONSTD(type) type +#define APR_DECLARE_NONSTD(type) type /** - * The public APR-UTIL variables are declared with APU_DECLARE_DATA. + * The public APR-UTIL variables are declared with APR_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * - * @fn APU_DECLARE_DATA type apr_variable; - * @note APU_DECLARE_DATA extern type apr_variable; syntax is required for + * @fn APR_DECLARE_DATA type apr_variable; + * @note APR_DECLARE_DATA extern type apr_variable; syntax is required for * declarations within headers to properly import the variable. */ -#define APU_DECLARE_DATA +#define APR_DECLARE_DATA #if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) /** diff --git a/include/apu.hnw b/include/apu.hnw index 31c0dfb4155..aca6227f2e9 100644 --- a/include/apu.hnw +++ b/include/apu.hnw @@ -32,42 +32,42 @@ /** - * APU_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, + * APR_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, * so that all public symbols are exported. * - * APU_DECLARE_STATIC is defined when including the APR-UTIL public headers, + * APR_DECLARE_STATIC is defined when including the APR-UTIL public headers, * to provide static linkage when the dynamic library may be unavailable. * - * APU_DECLARE_STATIC and APU_DECLARE_EXPORT are left undefined when + * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when * including the APR-UTIL public headers, to import and link the symbols from * the dynamic APR-UTIL library and assure appropriate indirection and calling * conventions at compile time. */ /** - * The public APR-UTIL functions are declared with APU_DECLARE(), so they may + * The public APR-UTIL functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with - * variable arguments must use APU_DECLARE_NONSTD(). + * variable arguments must use APR_DECLARE_NONSTD(). * - * @fn APU_DECLARE(rettype) apr_func(args); + * @fn APR_DECLARE(rettype) apr_func(args); */ -#define APU_DECLARE(type) type +#define APR_DECLARE(type) type /** * The public APR-UTIL functions using variable arguments are declared with - * APU_DECLARE_NONSTD(), as they must use the C language calling convention. + * APR_DECLARE_NONSTD(), as they must use the C language calling convention. * - * @fn APU_DECLARE_NONSTD(rettype) apr_func(args, ...); + * @fn APR_DECLARE_NONSTD(rettype) apr_func(args, ...); */ -#define APU_DECLARE_NONSTD(type) type +#define APR_DECLARE_NONSTD(type) type /** - * The public APR-UTIL variables are declared with APU_DECLARE_DATA. + * The public APR-UTIL variables are declared with APR_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * - * @fn APU_DECLARE_DATA type apr_variable; - * @note APU_DECLARE_DATA extern type apr_variable; syntax is required for + * @fn APR_DECLARE_DATA type apr_variable; + * @note APR_DECLARE_DATA extern type apr_variable; syntax is required for * declarations within headers to properly import the variable. */ -#define APU_DECLARE_DATA +#define APR_DECLARE_DATA /** * Declare a dso module's exported module structure as APU_MODULE_DECLARE_DATA. diff --git a/include/apu.hw b/include/apu.hw index 5be70de6093..591fb76aee9 100644 --- a/include/apu.hw +++ b/include/apu.hw @@ -30,13 +30,13 @@ #define APU_H /** - * APU_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, + * APR_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, * so that all public symbols are exported. * - * APU_DECLARE_STATIC is defined when including the APR-UTIL public headers, + * APR_DECLARE_STATIC is defined when including the APR-UTIL public headers, * to provide static linkage when the dynamic library may be unavailable. * - * APU_DECLARE_STATIC and APU_DECLARE_EXPORT are left undefined when + * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when * including the APR-UTIL public headers, to import and link the symbols from * the dynamic APR-UTIL library and assure appropriate indirection and calling * conventions at compile time. @@ -44,41 +44,41 @@ #if defined(DOXYGEN) || !defined(WIN32) /** - * The public APR-UTIL functions are declared with APU_DECLARE(), so they may + * The public APR-UTIL functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with - * variable arguments must use APU_DECLARE_NONSTD(). + * variable arguments must use APR_DECLARE_NONSTD(). * - * @fn APU_DECLARE(rettype) apr_func(args); + * @fn APR_DECLARE(rettype) apr_func(args); */ -#define APU_DECLARE(type) type +#define APR_DECLARE(type) type /** * The public APR-UTIL functions using variable arguments are declared with - * APU_DECLARE_NONSTD(), as they must use the C language calling convention. + * APR_DECLARE_NONSTD(), as they must use the C language calling convention. * - * @fn APU_DECLARE_NONSTD(rettype) apr_func(args, ...); + * @fn APR_DECLARE_NONSTD(rettype) apr_func(args, ...); */ -#define APU_DECLARE_NONSTD(type) type +#define APR_DECLARE_NONSTD(type) type /** - * The public APR-UTIL variables are declared with APU_DECLARE_DATA. + * The public APR-UTIL variables are declared with APR_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * - * @fn APU_DECLARE_DATA type apr_variable; - * @note extern APU_DECLARE_DATA type apr_variable; syntax is required for + * @fn APR_DECLARE_DATA type apr_variable; + * @note extern APR_DECLARE_DATA type apr_variable; syntax is required for * declarations within headers to properly import the variable. */ -#define APU_DECLARE_DATA -#elif defined(APU_DECLARE_STATIC) -#define APU_DECLARE(type) type __stdcall -#define APU_DECLARE_NONSTD(type) type __cdecl -#define APU_DECLARE_DATA -#elif defined(APU_DECLARE_EXPORT) -#define APU_DECLARE(type) __declspec(dllexport) type __stdcall -#define APU_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl -#define APU_DECLARE_DATA __declspec(dllexport) +#define APR_DECLARE_DATA +#elif defined(APR_DECLARE_STATIC) +#define APR_DECLARE(type) type __stdcall +#define APR_DECLARE_NONSTD(type) type __cdecl +#define APR_DECLARE_DATA +#elif defined(APR_DECLARE_EXPORT) +#define APR_DECLARE(type) __declspec(dllexport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl +#define APR_DECLARE_DATA __declspec(dllexport) #else -#define APU_DECLARE(type) __declspec(dllimport) type __stdcall -#define APU_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl -#define APU_DECLARE_DATA __declspec(dllimport) +#define APR_DECLARE(type) __declspec(dllimport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl +#define APR_DECLARE_DATA __declspec(dllimport) #endif #if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) diff --git a/include/apu_version.h b/include/apu_version.h index 9db3f81a135..66f3e818d45 100644 --- a/include/apu_version.h +++ b/include/apu_version.h @@ -120,10 +120,10 @@ extern "C" { * @param pvsn Pointer to a version structure for returning the version * information. */ -APU_DECLARE(void) apu_version(apr_version_t *pvsn); +APR_DECLARE(void) apu_version(apr_version_t *pvsn); /** Return APU's version information as a string. */ -APU_DECLARE(const char *) apu_version_string(void); +APR_DECLARE(const char *) apu_version_string(void); #ifdef __cplusplus } diff --git a/include/private/apr_dbd_internal.h b/include/private/apr_dbd_internal.h index 671ffb21881..3d50cc603e1 100644 --- a/include/private/apr_dbd_internal.h +++ b/include/private/apr_dbd_internal.h @@ -355,8 +355,8 @@ struct apr_dbd_driver_t { * deprecated; create a per-dbd mutex within the (*init) function * to avoid blocking other providers running on other threads */ -APU_DECLARE(apr_status_t) apr_dbd_mutex_lock(void); -APU_DECLARE(apr_status_t) apr_dbd_mutex_unlock(void); +APR_DECLARE(apr_status_t) apr_dbd_mutex_lock(void); +APR_DECLARE(apr_status_t) apr_dbd_mutex_unlock(void); #ifdef __cplusplus } diff --git a/include/private/apr_dbm_private.h b/include/private/apr_dbm_private.h index 020d3a6b8c7..a4db5fe0fc7 100644 --- a/include/private/apr_dbm_private.h +++ b/include/private/apr_dbm_private.h @@ -39,7 +39,7 @@ extern "C" { * Most DBM libraries take a POSIX mode for creating files. Don't trust * the mode_t type, some platforms may not support it, int is safe. */ -APU_DECLARE(int) apr_posix_perms2mode(apr_fileperms_t perm); +APR_DECLARE(int) apr_posix_perms2mode(apr_fileperms_t perm); /** * Structure to describe the operations of the DBM diff --git a/include/private/apu_config.hw b/include/private/apu_config.hw index 015dd52639f..45b4c2af3e1 100644 --- a/include/private/apu_config.hw +++ b/include/private/apu_config.hw @@ -25,7 +25,7 @@ #define APU_CONFIG_H /* Compile win32 with DSO support for .dll builds */ -#ifdef APU_DECLARE_STATIC +#ifdef APR_DECLARE_STATIC #define APU_DSO_BUILD 0 #else #define APU_DSO_BUILD 1 diff --git a/ldap/apr_ldap_init.c b/ldap/apr_ldap_init.c index 0b706f69b8e..339f4fe2c2f 100644 --- a/ldap/apr_ldap_init.c +++ b/ldap/apr_ldap_init.c @@ -56,7 +56,7 @@ * will return APR_EGENERAL. Further LDAP specific error information * can be found in result_err. */ -APU_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool, +APR_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool, const char *cert_auth_file, int cert_file_type, apr_ldap_err_t **result_err) @@ -113,7 +113,7 @@ APU_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool, * @todo currently we do not check whether apr_ldap_ssl_init() * has been called first - should we? */ -APU_DECLARE_LDAP(int) apr_ldap_ssl_deinit(void) +APR_DECLARE_LDAP(int) apr_ldap_ssl_deinit(void) { #if APR_HAS_LDAP_SSL && APR_HAS_LDAPSSL_CLIENT_DEINIT @@ -144,7 +144,7 @@ APU_DECLARE_LDAP(int) apr_ldap_ssl_deinit(void) * APR_LDAP_SSL: SSL encryption (ldaps://) * APR_LDAP_STARTTLS: Force STARTTLS on ldap:// */ -APU_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool, +APR_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool, LDAP **ldap, const char *hostname, int portno, @@ -184,7 +184,7 @@ APU_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool, * This function returns a string describing the LDAP toolkit * currently in use. The string is placed inside result_err->reason. */ -APU_DECLARE_LDAP(int) apr_ldap_info(apr_pool_t *pool, +APR_DECLARE_LDAP(int) apr_ldap_info(apr_pool_t *pool, apr_ldap_err_t **result_err) { apr_ldap_err_t *result = (apr_ldap_err_t *)apr_pcalloc(pool, sizeof(apr_ldap_err_t)); diff --git a/ldap/apr_ldap_option.c b/ldap/apr_ldap_option.c index 8d268d41f8c..d6dd4f1b4ac 100644 --- a/ldap/apr_ldap_option.c +++ b/ldap/apr_ldap_option.c @@ -48,7 +48,7 @@ static void option_set_tls(apr_pool_t *pool, LDAP *ldap, const void *invalue, * This function gets option values from a given LDAP session if * one was specified. */ -APU_DECLARE_LDAP(int) apr_ldap_get_option(apr_pool_t *pool, +APR_DECLARE_LDAP(int) apr_ldap_get_option(apr_pool_t *pool, LDAP *ldap, int option, void *outvalue, @@ -86,7 +86,7 @@ APU_DECLARE_LDAP(int) apr_ldap_get_option(apr_pool_t *pool, * will try and apply legacy functions to achieve the same effect, * depending on the platform. */ -APU_DECLARE_LDAP(int) apr_ldap_set_option(apr_pool_t *pool, +APR_DECLARE_LDAP(int) apr_ldap_set_option(apr_pool_t *pool, LDAP *ldap, int option, const void *invalue, diff --git a/ldap/apr_ldap_rebind.c b/ldap/apr_ldap_rebind.c index cf8eab4b906..a22cf6d6b0a 100644 --- a/ldap/apr_ldap_rebind.c +++ b/ldap/apr_ldap_rebind.c @@ -65,7 +65,7 @@ static int apr_ldap_rebind_set_callback(LDAP *ld); static apr_status_t apr_ldap_rebind_remove_helper(void *data); /* APR utility routine used to create the xref_lock. */ -APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool) +APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool) { apr_status_t retcode = APR_SUCCESS; @@ -83,7 +83,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool) } -APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, +APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, LDAP *ld, const char *bindDN, const char *bindPW) @@ -135,7 +135,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, } -APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld) +APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld) { apr_ldap_rebind_entry_t *tmp_xref, *prev = NULL; diff --git a/ldap/apr_ldap_stub.c b/ldap/apr_ldap_stub.c index 42c1e41e9f9..f32dc1e660f 100644 --- a/ldap/apr_ldap_stub.c +++ b/ldap/apr_ldap_stub.c @@ -63,14 +63,14 @@ static apr_status_t load_ldap(apr_pool_t *pool) if (!lfn && (load_ldap(pool) != APR_SUCCESS)) \ return failres; -APU_DECLARE_LDAP(int) apr_ldap_info(apr_pool_t *pool, +APR_DECLARE_LDAP(int) apr_ldap_info(apr_pool_t *pool, apr_ldap_err_t **result_err) { LOAD_LDAP_STUB(pool, -1); return lfn->info(pool, result_err); } -APU_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool, +APR_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool, LDAP **ldap, const char *hostname, int portno, @@ -81,7 +81,7 @@ APU_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool, return lfn->init(pool, ldap, hostname, portno, secure, result_err); } -APU_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool, +APR_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool, const char *cert_auth_file, int cert_file_type, apr_ldap_err_t **result_err) @@ -90,14 +90,14 @@ APU_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool, return lfn->ssl_init(pool, cert_auth_file, cert_file_type, result_err); } -APU_DECLARE_LDAP(int) apr_ldap_ssl_deinit(void) +APR_DECLARE_LDAP(int) apr_ldap_ssl_deinit(void) { if (!lfn) return -1; return lfn->ssl_deinit(); } -APU_DECLARE_LDAP(int) apr_ldap_get_option(apr_pool_t *pool, +APR_DECLARE_LDAP(int) apr_ldap_get_option(apr_pool_t *pool, LDAP *ldap, int option, void *outvalue, @@ -107,7 +107,7 @@ APU_DECLARE_LDAP(int) apr_ldap_get_option(apr_pool_t *pool, return lfn->get_option(pool, ldap, option, outvalue, result_err); } -APU_DECLARE_LDAP(int) apr_ldap_set_option(apr_pool_t *pool, +APR_DECLARE_LDAP(int) apr_ldap_set_option(apr_pool_t *pool, LDAP *ldap, int option, const void *invalue, @@ -117,13 +117,13 @@ APU_DECLARE_LDAP(int) apr_ldap_set_option(apr_pool_t *pool, return lfn->set_option(pool, ldap, option, invalue, result_err); } -APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool) +APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool) { LOAD_LDAP_STUB(pool, APR_EGENERAL); return lfn->rebind_init(pool); } -APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, +APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, LDAP *ld, const char *bindDN, const char *bindPW) @@ -132,7 +132,7 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, return lfn->rebind_add(pool, ld, bindDN, bindPW); } -APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld) +APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld) { if (!lfn) return APR_EGENERAL; diff --git a/ldap/apr_ldap_url.c b/ldap/apr_ldap_url.c index 52e37b253f9..da6efde7dff 100644 --- a/ldap/apr_ldap_url.c +++ b/ldap/apr_ldap_url.c @@ -114,7 +114,7 @@ static char **apr_ldap_str2charray(apr_pool_t *pool, * Is this URL an ldap url? * */ -APU_DECLARE(int) apr_ldap_is_ldap_url(const char *url) +APR_DECLARE(int) apr_ldap_is_ldap_url(const char *url) { int enclosed; const char * scheme; @@ -134,7 +134,7 @@ APU_DECLARE(int) apr_ldap_is_ldap_url(const char *url) * Is this URL a secure ldap url? * */ -APU_DECLARE(int) apr_ldap_is_ldaps_url(const char *url) +APR_DECLARE(int) apr_ldap_is_ldaps_url(const char *url) { int enclosed; const char * scheme; @@ -154,7 +154,7 @@ APU_DECLARE(int) apr_ldap_is_ldaps_url(const char *url) * Is this URL an ldap socket url? * */ -APU_DECLARE(int) apr_ldap_is_ldapi_url(const char *url) +APR_DECLARE(int) apr_ldap_is_ldapi_url(const char *url) { int enclosed; const char * scheme; @@ -256,7 +256,7 @@ static int str2scope(const char *p) * The LDAP result code and reason string is returned in the * apr_ldap_err_t structure. */ -APU_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool, +APR_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool, const char *url_in, apr_ldap_url_desc_t **ludpp, apr_ldap_err_t **result_err) @@ -579,7 +579,7 @@ APU_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool, * The LDAP result code and reason string is returned in the * apr_ldap_err_t structure. */ -APU_DECLARE(int) apr_ldap_url_parse(apr_pool_t *pool, +APR_DECLARE(int) apr_ldap_url_parse(apr_pool_t *pool, const char *url_in, apr_ldap_url_desc_t **ludpp, apr_ldap_err_t **result_err) diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index d244d564efc..3332841e251 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -129,7 +129,7 @@ static apr_status_t make_server_live(apr_memcache_t *mc, apr_memcache_server_t * } -APU_DECLARE(apr_status_t) apr_memcache_add_server(apr_memcache_t *mc, apr_memcache_server_t *ms) +APR_DECLARE(apr_status_t) apr_memcache_add_server(apr_memcache_t *mc, apr_memcache_server_t *ms) { apr_status_t rv = APR_SUCCESS; @@ -145,7 +145,7 @@ APU_DECLARE(apr_status_t) apr_memcache_add_server(apr_memcache_t *mc, apr_memcac static apr_status_t mc_version_ping(apr_memcache_server_t *ms); -APU_DECLARE(apr_memcache_server_t *) +APR_DECLARE(apr_memcache_server_t *) apr_memcache_find_server_hash(apr_memcache_t *mc, const apr_uint32_t hash) { if (mc->server_func) { @@ -156,7 +156,7 @@ apr_memcache_find_server_hash(apr_memcache_t *mc, const apr_uint32_t hash) } } -APU_DECLARE(apr_memcache_server_t *) +APR_DECLARE(apr_memcache_server_t *) apr_memcache_find_server_hash_default(void *baton, apr_memcache_t *mc, const apr_uint32_t hash) { @@ -207,7 +207,7 @@ apr_memcache_find_server_hash_default(void *baton, apr_memcache_t *mc, return ms; } -APU_DECLARE(apr_memcache_server_t *) apr_memcache_find_server(apr_memcache_t *mc, const char *host, apr_port_t port) +APR_DECLARE(apr_memcache_server_t *) apr_memcache_find_server(apr_memcache_t *mc, const char *host, apr_port_t port) { int i; @@ -268,7 +268,7 @@ static apr_status_t ms_release_conn(apr_memcache_server_t *ms, apr_memcache_conn #endif } -APU_DECLARE(apr_status_t) apr_memcache_enable_server(apr_memcache_t *mc, apr_memcache_server_t *ms) +APR_DECLARE(apr_status_t) apr_memcache_enable_server(apr_memcache_t *mc, apr_memcache_server_t *ms) { apr_status_t rv = APR_SUCCESS; @@ -280,7 +280,7 @@ APU_DECLARE(apr_status_t) apr_memcache_enable_server(apr_memcache_t *mc, apr_mem return rv; } -APU_DECLARE(apr_status_t) apr_memcache_disable_server(apr_memcache_t *mc, apr_memcache_server_t *ms) +APR_DECLARE(apr_status_t) apr_memcache_disable_server(apr_memcache_t *mc, apr_memcache_server_t *ms) { return make_server_dead(mc, ms); } @@ -386,7 +386,7 @@ mc_conn_destruct(void *conn_, void *params, apr_pool_t *pool) } #endif -APU_DECLARE(apr_status_t) apr_memcache_server_create(apr_pool_t *p, +APR_DECLARE(apr_status_t) apr_memcache_server_create(apr_pool_t *p, const char *host, apr_port_t port, apr_uint32_t min, apr_uint32_t smax, apr_uint32_t max, apr_uint32_t ttl, @@ -433,7 +433,7 @@ APU_DECLARE(apr_status_t) apr_memcache_server_create(apr_pool_t *p, return rv; } -APU_DECLARE(apr_status_t) apr_memcache_create(apr_pool_t *p, +APR_DECLARE(apr_status_t) apr_memcache_create(apr_pool_t *p, apr_uint16_t max_servers, apr_uint32_t flags, apr_memcache_t **memcache) { @@ -527,7 +527,7 @@ static const apr_uint32_t crc32tab[256] = { 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, }; -APU_DECLARE(apr_uint32_t) apr_memcache_hash_crc32(void *baton, +APR_DECLARE(apr_uint32_t) apr_memcache_hash_crc32(void *baton, const char *data, const apr_size_t data_len) { @@ -541,7 +541,7 @@ APU_DECLARE(apr_uint32_t) apr_memcache_hash_crc32(void *baton, return ~crc; } -APU_DECLARE(apr_uint32_t) apr_memcache_hash_default(void *baton, +APR_DECLARE(apr_uint32_t) apr_memcache_hash_default(void *baton, const char *data, const apr_size_t data_len) { @@ -551,7 +551,7 @@ APU_DECLARE(apr_uint32_t) apr_memcache_hash_default(void *baton, return ((apr_memcache_hash_crc32(baton, data, data_len) >> 16) & 0x7fff); } -APU_DECLARE(apr_uint32_t) apr_memcache_hash(apr_memcache_t *mc, +APR_DECLARE(apr_uint32_t) apr_memcache_hash(apr_memcache_t *mc, const char *data, const apr_size_t data_len) { @@ -670,7 +670,7 @@ static apr_status_t storage_cmd_write(apr_memcache_t *mc, return rv; } -APU_DECLARE(apr_status_t) +APR_DECLARE(apr_status_t) apr_memcache_set(apr_memcache_t *mc, const char *key, char *data, @@ -685,7 +685,7 @@ apr_memcache_set(apr_memcache_t *mc, timeout, flags); } -APU_DECLARE(apr_status_t) +APR_DECLARE(apr_status_t) apr_memcache_add(apr_memcache_t *mc, const char *key, char *data, @@ -700,7 +700,7 @@ apr_memcache_add(apr_memcache_t *mc, timeout, flags); } -APU_DECLARE(apr_status_t) +APR_DECLARE(apr_status_t) apr_memcache_replace(apr_memcache_t *mc, const char *key, char *data, @@ -716,7 +716,7 @@ apr_memcache_replace(apr_memcache_t *mc, } -APU_DECLARE(apr_status_t) +APR_DECLARE(apr_status_t) apr_memcache_getp(apr_memcache_t *mc, apr_pool_t *p, const char *key, @@ -853,7 +853,7 @@ apr_memcache_getp(apr_memcache_t *mc, return rv; } -APU_DECLARE(apr_status_t) +APR_DECLARE(apr_status_t) apr_memcache_delete(apr_memcache_t *mc, const char *key, apr_uint32_t timeout) @@ -992,7 +992,7 @@ static apr_status_t num_cmd_write(apr_memcache_t *mc, return rv; } -APU_DECLARE(apr_status_t) +APR_DECLARE(apr_status_t) apr_memcache_incr(apr_memcache_t *mc, const char *key, apr_int32_t inc, @@ -1007,7 +1007,7 @@ apr_memcache_incr(apr_memcache_t *mc, } -APU_DECLARE(apr_status_t) +APR_DECLARE(apr_status_t) apr_memcache_decr(apr_memcache_t *mc, const char *key, apr_int32_t inc, @@ -1023,7 +1023,7 @@ apr_memcache_decr(apr_memcache_t *mc, -APU_DECLARE(apr_status_t) +APR_DECLARE(apr_status_t) apr_memcache_version(apr_memcache_server_t *ms, apr_pool_t *p, char **baton) @@ -1106,7 +1106,7 @@ apr_status_t mc_version_ping(apr_memcache_server_t *ms) } -APU_DECLARE(void) +APR_DECLARE(void) apr_memcache_add_multget_key(apr_pool_t *data_pool, const char* key, apr_hash_t **values) @@ -1165,7 +1165,7 @@ static void mget_conn_result(int serverup, } } -APU_DECLARE(apr_status_t) +APR_DECLARE(apr_status_t) apr_memcache_multgetp(apr_memcache_t *mc, apr_pool_t *temp_pool, apr_pool_t *data_pool, @@ -1635,7 +1635,7 @@ static void update_stats(apr_pool_t *p, apr_memcache_conn_t *conn, else mc_do_stat(threads, uint32) } -APU_DECLARE(apr_status_t) +APR_DECLARE(apr_status_t) apr_memcache_stats(apr_memcache_server_t *ms, apr_pool_t *p, apr_memcache_stats_t **stats) diff --git a/strmatch/apr_strmatch.c b/strmatch/apr_strmatch.c index 6a4bf6f9edf..e5a0a81b939 100644 --- a/strmatch/apr_strmatch.c +++ b/strmatch/apr_strmatch.c @@ -79,7 +79,7 @@ static const char *match_boyer_moore_horspool_nocase( return NULL; } -APU_DECLARE(const apr_strmatch_pattern *) apr_strmatch_precompile( +APR_DECLARE(const apr_strmatch_pattern *) apr_strmatch_precompile( apr_pool_t *p, const char *s, int case_sensitive) { diff --git a/uri/apr_uri.c b/uri/apr_uri.c index e5acb3467b8..5f16c664b7e 100644 --- a/uri/apr_uri.c +++ b/uri/apr_uri.c @@ -70,7 +70,7 @@ static schemes_t schemes[] = { NULL, 0xFFFF } /* unknown port */ }; -APU_DECLARE(apr_port_t) apr_uri_port_of_scheme(const char *scheme_str) +APR_DECLARE(apr_port_t) apr_uri_port_of_scheme(const char *scheme_str) { schemes_t *scheme; @@ -87,7 +87,7 @@ APU_DECLARE(apr_port_t) apr_uri_port_of_scheme(const char *scheme_str) /* Unparse a apr_uri_t structure to an URI string. * Optionally suppress the password for security reasons. */ -APU_DECLARE(char *) apr_uri_unparse(apr_pool_t *p, +APR_DECLARE(char *) apr_uri_unparse(apr_pool_t *p, const apr_uri_t *uptr, unsigned flags) { @@ -240,7 +240,7 @@ static const unsigned char uri_delims[256] = { * - fills in fields of uri_components *uptr * - none on any of the r->* fields */ -APU_DECLARE(apr_status_t) apr_uri_parse(apr_pool_t *p, const char *uri, +APR_DECLARE(apr_status_t) apr_uri_parse(apr_pool_t *p, const char *uri, apr_uri_t *uptr) { const char *s; @@ -405,7 +405,7 @@ APU_DECLARE(apr_status_t) apr_uri_parse(apr_pool_t *p, const char *uri, * currently at http://www.mcom.com/newsref/std/tunneling_ssl.html * for the format of the "CONNECT host:port HTTP/1.0" request */ -APU_DECLARE(apr_status_t) apr_uri_parse_hostinfo(apr_pool_t *p, +APR_DECLARE(apr_status_t) apr_uri_parse_hostinfo(apr_pool_t *p, const char *hostinfo, apr_uri_t *uptr) { diff --git a/util-misc/apr_date.c b/util-misc/apr_date.c index 28086e334b3..e28e967fb15 100644 --- a/util-misc/apr_date.c +++ b/util-misc/apr_date.c @@ -52,7 +52,7 @@ * * - swallow remaining characters * - exact match for any other character */ -APU_DECLARE(int) apr_date_checkmask(const char *data, const char *mask) +APR_DECLARE(int) apr_date_checkmask(const char *data, const char *mask) { int i; char d; @@ -142,7 +142,7 @@ APU_DECLARE(int) apr_date_checkmask(const char *data, const char *mask) * but many changes since then. * */ -APU_DECLARE(apr_time_t) apr_date_parse_http(const char *date) +APR_DECLARE(apr_time_t) apr_date_parse_http(const char *date) { apr_time_exp_t ds; apr_time_t result; @@ -316,7 +316,7 @@ APU_DECLARE(apr_time_t) apr_date_parse_http(const char *date) timstr[6],timstr[7]); \ } -APU_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date) +APR_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date) { apr_time_exp_t ds; apr_time_t result; diff --git a/util-misc/apr_queue.c b/util-misc/apr_queue.c index b74fdf852a5..a1682f8f2a7 100644 --- a/util-misc/apr_queue.c +++ b/util-misc/apr_queue.c @@ -98,7 +98,7 @@ static apr_status_t queue_destroy(void *data) /** * Initialize the apr_queue_t. */ -APU_DECLARE(apr_status_t) apr_queue_create(apr_queue_t **q, +APR_DECLARE(apr_status_t) apr_queue_create(apr_queue_t **q, unsigned int queue_capacity, apr_pool_t *a) { @@ -145,7 +145,7 @@ APU_DECLARE(apr_status_t) apr_queue_create(apr_queue_t **q, * the push operation has completed, it signals other threads waiting * in apr_queue_pop() that they may continue consuming sockets. */ -APU_DECLARE(apr_status_t) apr_queue_push(apr_queue_t *queue, void *data) +APR_DECLARE(apr_status_t) apr_queue_push(apr_queue_t *queue, void *data) { apr_status_t rv; @@ -206,7 +206,7 @@ APU_DECLARE(apr_status_t) apr_queue_push(apr_queue_t *queue, void *data) * the push operation completes successfully, it signals other threads * waiting in apr_queue_pop() that they may continue consuming sockets. */ -APU_DECLARE(apr_status_t) apr_queue_trypush(apr_queue_t *queue, void *data) +APR_DECLARE(apr_status_t) apr_queue_trypush(apr_queue_t *queue, void *data) { apr_status_t rv; @@ -244,7 +244,7 @@ APU_DECLARE(apr_status_t) apr_queue_trypush(apr_queue_t *queue, void *data) /** * not thread safe */ -APU_DECLARE(unsigned int) apr_queue_size(apr_queue_t *queue) { +APR_DECLARE(unsigned int) apr_queue_size(apr_queue_t *queue) { return queue->nelts; } @@ -254,7 +254,7 @@ APU_DECLARE(unsigned int) apr_queue_size(apr_queue_t *queue) { * Once retrieved, the item is placed into the address specified by * 'data'. */ -APU_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data) +APR_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data) { apr_status_t rv; @@ -316,7 +316,7 @@ APU_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data) * items available, return APR_EAGAIN. Once retrieved, * the item is placed into the address specified by 'data'. */ -APU_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data) +APR_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data) { apr_status_t rv; @@ -351,7 +351,7 @@ APU_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data) return rv; } -APU_DECLARE(apr_status_t) apr_queue_interrupt_all(apr_queue_t *queue) +APR_DECLARE(apr_status_t) apr_queue_interrupt_all(apr_queue_t *queue) { apr_status_t rv; Q_DBG("intr all", queue); @@ -368,7 +368,7 @@ APU_DECLARE(apr_status_t) apr_queue_interrupt_all(apr_queue_t *queue) return APR_SUCCESS; } -APU_DECLARE(apr_status_t) apr_queue_term(apr_queue_t *queue) +APR_DECLARE(apr_status_t) apr_queue_term(apr_queue_t *queue) { apr_status_t rv; diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c index 0c43e07473c..f4448493577 100644 --- a/util-misc/apr_reslist.c +++ b/util-misc/apr_reslist.c @@ -173,7 +173,7 @@ static apr_status_t reslist_cleanup(void *data_) * Perform routine maintenance on the resource list. This call * may instantiate new resources or expire old resources. */ -APU_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist) +APR_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist) { apr_time_t now; apr_status_t rv; @@ -248,7 +248,7 @@ APU_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist) return APR_SUCCESS; } -APU_DECLARE(apr_status_t) apr_reslist_create(apr_reslist_t **reslist, +APR_DECLARE(apr_status_t) apr_reslist_create(apr_reslist_t **reslist, int min, int smax, int hmax, apr_interval_time_t ttl, apr_reslist_constructor con, @@ -318,12 +318,12 @@ APU_DECLARE(apr_status_t) apr_reslist_create(apr_reslist_t **reslist, return APR_SUCCESS; } -APU_DECLARE(apr_status_t) apr_reslist_destroy(apr_reslist_t *reslist) +APR_DECLARE(apr_status_t) apr_reslist_destroy(apr_reslist_t *reslist) { return apr_pool_cleanup_run(reslist->pool, reslist, reslist_cleanup); } -APU_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, +APR_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, void **resource) { apr_status_t rv; @@ -405,7 +405,7 @@ APU_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, } } -APU_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, +APR_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, void *resource) { apr_res_t *res; @@ -424,13 +424,13 @@ APU_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, return apr_reslist_maintain(reslist); } -APU_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, +APR_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, apr_interval_time_t timeout) { reslist->timeout = timeout; } -APU_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist) +APR_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist) { apr_uint32_t count; @@ -445,7 +445,7 @@ APU_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist) return count; } -APU_DECLARE(apr_status_t) apr_reslist_invalidate(apr_reslist_t *reslist, +APR_DECLARE(apr_status_t) apr_reslist_invalidate(apr_reslist_t *reslist, void *resource) { apr_status_t ret; @@ -461,7 +461,7 @@ APU_DECLARE(apr_status_t) apr_reslist_invalidate(apr_reslist_t *reslist, return ret; } -APU_DECLARE(void) apr_reslist_cleanup_order_set(apr_reslist_t *rl, +APR_DECLARE(void) apr_reslist_cleanup_order_set(apr_reslist_t *rl, apr_uint32_t mode) { apr_pool_cleanup_kill(rl->pool, rl, reslist_cleanup); diff --git a/util-misc/apr_rmm.c b/util-misc/apr_rmm.c index ed67dc25c80..e90be1e7c46 100644 --- a/util-misc/apr_rmm.c +++ b/util-misc/apr_rmm.c @@ -210,7 +210,7 @@ static void move_block(apr_rmm_t *rmm, apr_rmm_off_t this, int free) } } -APU_DECLARE(apr_status_t) apr_rmm_init(apr_rmm_t **rmm, apr_anylock_t *lock, +APR_DECLARE(apr_status_t) apr_rmm_init(apr_rmm_t **rmm, apr_anylock_t *lock, void *base, apr_size_t size, apr_pool_t *p) { @@ -245,7 +245,7 @@ APU_DECLARE(apr_status_t) apr_rmm_init(apr_rmm_t **rmm, apr_anylock_t *lock, return APR_ANYLOCK_UNLOCK(lock); } -APU_DECLARE(apr_status_t) apr_rmm_destroy(apr_rmm_t *rmm) +APR_DECLARE(apr_status_t) apr_rmm_destroy(apr_rmm_t *rmm) { apr_status_t rv; rmm_block_t *blk; @@ -278,7 +278,7 @@ APU_DECLARE(apr_status_t) apr_rmm_destroy(apr_rmm_t *rmm) return APR_ANYLOCK_UNLOCK(&rmm->lock); } -APU_DECLARE(apr_status_t) apr_rmm_attach(apr_rmm_t **rmm, apr_anylock_t *lock, +APR_DECLARE(apr_status_t) apr_rmm_attach(apr_rmm_t **rmm, apr_anylock_t *lock, void *base, apr_pool_t *p) { apr_anylock_t nulllock; @@ -298,13 +298,13 @@ APU_DECLARE(apr_status_t) apr_rmm_attach(apr_rmm_t **rmm, apr_anylock_t *lock, return APR_SUCCESS; } -APU_DECLARE(apr_status_t) apr_rmm_detach(apr_rmm_t *rmm) +APR_DECLARE(apr_status_t) apr_rmm_detach(apr_rmm_t *rmm) { /* A noop until we introduce locked/refcounts */ return APR_SUCCESS; } -APU_DECLARE(apr_rmm_off_t) apr_rmm_malloc(apr_rmm_t *rmm, apr_size_t reqsize) +APR_DECLARE(apr_rmm_off_t) apr_rmm_malloc(apr_rmm_t *rmm, apr_size_t reqsize) { apr_rmm_off_t this; @@ -323,7 +323,7 @@ APU_DECLARE(apr_rmm_off_t) apr_rmm_malloc(apr_rmm_t *rmm, apr_size_t reqsize) return this; } -APU_DECLARE(apr_rmm_off_t) apr_rmm_calloc(apr_rmm_t *rmm, apr_size_t reqsize) +APR_DECLARE(apr_rmm_off_t) apr_rmm_calloc(apr_rmm_t *rmm, apr_size_t reqsize) { apr_rmm_off_t this; @@ -343,7 +343,7 @@ APU_DECLARE(apr_rmm_off_t) apr_rmm_calloc(apr_rmm_t *rmm, apr_size_t reqsize) return this; } -APU_DECLARE(apr_rmm_off_t) apr_rmm_realloc(apr_rmm_t *rmm, void *entity, +APR_DECLARE(apr_rmm_off_t) apr_rmm_realloc(apr_rmm_t *rmm, void *entity, apr_size_t reqsize) { apr_rmm_off_t this; @@ -372,7 +372,7 @@ APU_DECLARE(apr_rmm_off_t) apr_rmm_realloc(apr_rmm_t *rmm, void *entity, return this; } -APU_DECLARE(apr_status_t) apr_rmm_free(apr_rmm_t *rmm, apr_rmm_off_t this) +APR_DECLARE(apr_status_t) apr_rmm_free(apr_rmm_t *rmm, apr_rmm_off_t this) { apr_status_t rv; struct rmm_block_t *blk; @@ -420,14 +420,14 @@ APU_DECLARE(apr_status_t) apr_rmm_free(apr_rmm_t *rmm, apr_rmm_off_t this) return APR_ANYLOCK_UNLOCK(&rmm->lock); } -APU_DECLARE(void *) apr_rmm_addr_get(apr_rmm_t *rmm, apr_rmm_off_t entity) +APR_DECLARE(void *) apr_rmm_addr_get(apr_rmm_t *rmm, apr_rmm_off_t entity) { /* debug-sanity checking here would be good */ return (void*)((char*)rmm->base + entity); } -APU_DECLARE(apr_rmm_off_t) apr_rmm_offset_get(apr_rmm_t *rmm, void* entity) +APR_DECLARE(apr_rmm_off_t) apr_rmm_offset_get(apr_rmm_t *rmm, void* entity) { /* debug, or always, sanity checking here would be good * since the primitive is apr_rmm_off_t, I don't mind penalizing @@ -437,7 +437,7 @@ APU_DECLARE(apr_rmm_off_t) apr_rmm_offset_get(apr_rmm_t *rmm, void* entity) return ((char*)entity - (char*)rmm->base); } -APU_DECLARE(apr_size_t) apr_rmm_overhead_get(int n) +APR_DECLARE(apr_size_t) apr_rmm_overhead_get(int n) { /* overhead per block is at most APR_ALIGN_DEFAULT(1) wasted bytes * for alignment overhead, plus the size of the rmm_block_t diff --git a/util-misc/apr_thread_pool.c b/util-misc/apr_thread_pool.c index 693518d10d4..22c544d0b1a 100644 --- a/util-misc/apr_thread_pool.c +++ b/util-misc/apr_thread_pool.c @@ -355,7 +355,7 @@ static apr_status_t thread_pool_cleanup(void *me) return APR_SUCCESS; } -APU_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t ** me, +APR_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t ** me, apr_size_t init_threads, apr_size_t max_threads, apr_pool_t * pool) @@ -395,7 +395,7 @@ APU_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t ** me, return rv; } -APU_DECLARE(apr_status_t) apr_thread_pool_destroy(apr_thread_pool_t * me) +APR_DECLARE(apr_status_t) apr_thread_pool_destroy(apr_thread_pool_t * me) { return apr_pool_cleanup_run(me->pool, me, thread_pool_cleanup); } @@ -588,7 +588,7 @@ static apr_status_t add_task(apr_thread_pool_t *me, apr_thread_start_t func, return rv; } -APU_DECLARE(apr_status_t) apr_thread_pool_push(apr_thread_pool_t *me, +APR_DECLARE(apr_status_t) apr_thread_pool_push(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_byte_t priority, @@ -597,7 +597,7 @@ APU_DECLARE(apr_status_t) apr_thread_pool_push(apr_thread_pool_t *me, return add_task(me, func, param, priority, 1, owner); } -APU_DECLARE(apr_status_t) apr_thread_pool_schedule(apr_thread_pool_t *me, +APR_DECLARE(apr_status_t) apr_thread_pool_schedule(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_interval_time_t time, @@ -606,7 +606,7 @@ APU_DECLARE(apr_status_t) apr_thread_pool_schedule(apr_thread_pool_t *me, return schedule_task(me, func, param, owner, time); } -APU_DECLARE(apr_status_t) apr_thread_pool_top(apr_thread_pool_t *me, +APR_DECLARE(apr_status_t) apr_thread_pool_top(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_byte_t priority, @@ -698,7 +698,7 @@ static void wait_on_busy_threads(apr_thread_pool_t *me, void *owner) return; } -APU_DECLARE(apr_status_t) apr_thread_pool_tasks_cancel(apr_thread_pool_t *me, +APR_DECLARE(apr_status_t) apr_thread_pool_tasks_cancel(apr_thread_pool_t *me, void *owner) { apr_status_t rv = APR_SUCCESS; @@ -716,63 +716,63 @@ APU_DECLARE(apr_status_t) apr_thread_pool_tasks_cancel(apr_thread_pool_t *me, return rv; } -APU_DECLARE(apr_size_t) apr_thread_pool_tasks_count(apr_thread_pool_t *me) +APR_DECLARE(apr_size_t) apr_thread_pool_tasks_count(apr_thread_pool_t *me) { return me->task_cnt; } -APU_DECLARE(apr_size_t) +APR_DECLARE(apr_size_t) apr_thread_pool_scheduled_tasks_count(apr_thread_pool_t *me) { return me->scheduled_task_cnt; } -APU_DECLARE(apr_size_t) apr_thread_pool_threads_count(apr_thread_pool_t *me) +APR_DECLARE(apr_size_t) apr_thread_pool_threads_count(apr_thread_pool_t *me) { return me->thd_cnt; } -APU_DECLARE(apr_size_t) apr_thread_pool_busy_count(apr_thread_pool_t *me) +APR_DECLARE(apr_size_t) apr_thread_pool_busy_count(apr_thread_pool_t *me) { return me->thd_cnt - me->idle_cnt; } -APU_DECLARE(apr_size_t) apr_thread_pool_idle_count(apr_thread_pool_t *me) +APR_DECLARE(apr_size_t) apr_thread_pool_idle_count(apr_thread_pool_t *me) { return me->idle_cnt; } -APU_DECLARE(apr_size_t) +APR_DECLARE(apr_size_t) apr_thread_pool_tasks_run_count(apr_thread_pool_t * me) { return me->tasks_run; } -APU_DECLARE(apr_size_t) +APR_DECLARE(apr_size_t) apr_thread_pool_tasks_high_count(apr_thread_pool_t * me) { return me->tasks_high; } -APU_DECLARE(apr_size_t) +APR_DECLARE(apr_size_t) apr_thread_pool_threads_high_count(apr_thread_pool_t * me) { return me->thd_high; } -APU_DECLARE(apr_size_t) +APR_DECLARE(apr_size_t) apr_thread_pool_threads_idle_timeout_count(apr_thread_pool_t * me) { return me->thd_timed_out; } -APU_DECLARE(apr_size_t) apr_thread_pool_idle_max_get(apr_thread_pool_t *me) +APR_DECLARE(apr_size_t) apr_thread_pool_idle_max_get(apr_thread_pool_t *me) { return me->idle_max; } -APU_DECLARE(apr_interval_time_t) +APR_DECLARE(apr_interval_time_t) apr_thread_pool_idle_wait_get(apr_thread_pool_t * me) { return me->idle_wait; @@ -872,7 +872,7 @@ static apr_size_t trim_busy_threads(apr_thread_pool_t *me, apr_size_t cnt) return cnt; } -APU_DECLARE(apr_size_t) apr_thread_pool_idle_max_set(apr_thread_pool_t *me, +APR_DECLARE(apr_size_t) apr_thread_pool_idle_max_set(apr_thread_pool_t *me, apr_size_t cnt) { me->idle_max = cnt; @@ -880,7 +880,7 @@ APU_DECLARE(apr_size_t) apr_thread_pool_idle_max_set(apr_thread_pool_t *me, return cnt; } -APU_DECLARE(apr_interval_time_t) +APR_DECLARE(apr_interval_time_t) apr_thread_pool_idle_wait_set(apr_thread_pool_t * me, apr_interval_time_t timeout) { @@ -892,7 +892,7 @@ APU_DECLARE(apr_interval_time_t) return oldtime; } -APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_get(apr_thread_pool_t *me) +APR_DECLARE(apr_size_t) apr_thread_pool_thread_max_get(apr_thread_pool_t *me) { return me->thd_max; } @@ -901,7 +901,7 @@ APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_get(apr_thread_pool_t *me) * This function stop extra working threads to the new limit. * NOTE: There could be busy threads become idle during this function */ -APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_set(apr_thread_pool_t *me, +APR_DECLARE(apr_size_t) apr_thread_pool_thread_max_set(apr_thread_pool_t *me, apr_size_t cnt) { unsigned int n; @@ -922,12 +922,12 @@ APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_set(apr_thread_pool_t *me, return n; } -APU_DECLARE(apr_size_t) apr_thread_pool_threshold_get(apr_thread_pool_t *me) +APR_DECLARE(apr_size_t) apr_thread_pool_threshold_get(apr_thread_pool_t *me) { return me->threshold; } -APU_DECLARE(apr_size_t) apr_thread_pool_threshold_set(apr_thread_pool_t *me, +APR_DECLARE(apr_size_t) apr_thread_pool_threshold_set(apr_thread_pool_t *me, apr_size_t val) { apr_size_t ov; @@ -937,7 +937,7 @@ APU_DECLARE(apr_size_t) apr_thread_pool_threshold_set(apr_thread_pool_t *me, return ov; } -APU_DECLARE(apr_status_t) apr_thread_pool_task_owner_get(apr_thread_t *thd, +APR_DECLARE(apr_status_t) apr_thread_pool_task_owner_get(apr_thread_t *thd, void **owner) { apr_status_t rv; diff --git a/util-misc/apu_version.c b/util-misc/apu_version.c index 97e73099741..033a1eefbb7 100644 --- a/util-misc/apu_version.c +++ b/util-misc/apu_version.c @@ -19,7 +19,7 @@ #include "apu.h" #include "apu_version.h" -APU_DECLARE(void) apu_version(apr_version_t *pvsn) +APR_DECLARE(void) apu_version(apr_version_t *pvsn) { pvsn->major = APU_MAJOR_VERSION; pvsn->minor = APU_MINOR_VERSION; @@ -31,7 +31,7 @@ APU_DECLARE(void) apu_version(apr_version_t *pvsn) #endif } -APU_DECLARE(const char *) apu_version_string(void) +APR_DECLARE(const char *) apu_version_string(void) { return APU_VERSION_STRING; } diff --git a/xlate/xlate.c b/xlate/xlate.c index 1ea840e9bf1..30f13370a75 100644 --- a/xlate/xlate.c +++ b/xlate/xlate.c @@ -195,7 +195,7 @@ static void make_identity_table(apr_xlate_t *convset) convset->sbcs_table[i] = i; } -APU_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, +APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, const char *topage, const char *frompage, apr_pool_t *pool) @@ -274,13 +274,13 @@ APU_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, return rv; } -APU_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff) +APR_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff) { *onoff = convset->sbcs_table != NULL; return APR_SUCCESS; } -APU_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, +APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, apr_size_t *inbytes_left, char *outbuf, @@ -404,7 +404,7 @@ APU_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, return status; } -APU_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, +APR_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar) { if (convset->sbcs_table) { @@ -415,14 +415,14 @@ APU_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, } } -APU_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset) +APR_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset) { return apr_pool_cleanup_run(convset->pool, convset, apr_xlate_cleanup); } #else /* !APR_HAS_XLATE */ -APU_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, +APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, const char *topage, const char *frompage, apr_pool_t *pool) @@ -430,18 +430,18 @@ APU_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, return APR_ENOTIMPL; } -APU_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff) +APR_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff) { return APR_ENOTIMPL; } -APU_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, +APR_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar) { return (-1); } -APU_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, +APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, apr_size_t *inbytes_left, char *outbuf, @@ -450,7 +450,7 @@ APU_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, return APR_ENOTIMPL; } -APU_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset) +APR_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset) { return APR_ENOTIMPL; } diff --git a/xml/apr_xml.c b/xml/apr_xml.c index 8b48f1db276..9027c2b61f2 100644 --- a/xml/apr_xml.c +++ b/xml/apr_xml.c @@ -366,7 +366,7 @@ static void default_handler(void *userData, const XML_Char *s, int len) } #endif -APU_DECLARE(apr_xml_parser *) apr_xml_parser_create(apr_pool_t *pool) +APR_DECLARE(apr_xml_parser *) apr_xml_parser_create(apr_pool_t *pool) { apr_xml_parser *parser = apr_pcalloc(pool, sizeof(*parser)); @@ -427,14 +427,14 @@ static apr_status_t do_parse(apr_xml_parser *parser, return parser->error ? APR_EGENERAL : APR_SUCCESS; } -APU_DECLARE(apr_status_t) apr_xml_parser_feed(apr_xml_parser *parser, +APR_DECLARE(apr_status_t) apr_xml_parser_feed(apr_xml_parser *parser, const char *data, apr_size_t len) { return do_parse(parser, data, len, 0 /* is_final */); } -APU_DECLARE(apr_status_t) apr_xml_parser_done(apr_xml_parser *parser, +APR_DECLARE(apr_status_t) apr_xml_parser_done(apr_xml_parser *parser, apr_xml_doc **pdoc) { char end; @@ -451,7 +451,7 @@ APU_DECLARE(apr_status_t) apr_xml_parser_done(apr_xml_parser *parser, return APR_SUCCESS; } -APU_DECLARE(char *) apr_xml_parser_geterror(apr_xml_parser *parser, +APR_DECLARE(char *) apr_xml_parser_geterror(apr_xml_parser *parser, char *errbuf, apr_size_t errbufsize) { @@ -493,7 +493,7 @@ APU_DECLARE(char *) apr_xml_parser_geterror(apr_xml_parser *parser, return errbuf; } -APU_DECLARE(apr_status_t) apr_xml_parse_file(apr_pool_t *p, +APR_DECLARE(apr_status_t) apr_xml_parse_file(apr_pool_t *p, apr_xml_parser **parser, apr_xml_doc **ppdoc, apr_file_t *xmlfd, @@ -531,7 +531,7 @@ APU_DECLARE(apr_status_t) apr_xml_parse_file(apr_pool_t *p, return rv; } -APU_DECLARE(void) apr_text_append(apr_pool_t * p, apr_text_header *hdr, +APR_DECLARE(void) apr_text_append(apr_pool_t * p, apr_text_header *hdr, const char *text) { apr_text *t = apr_palloc(p, sizeof(*t)); @@ -565,7 +565,7 @@ APU_DECLARE(void) apr_text_append(apr_pool_t * p, apr_text_header *hdr, ** quotes is typically set to true for XML strings that will occur within ** double quotes -- attribute values. */ -APU_DECLARE(const char *) apr_xml_quote_string(apr_pool_t *p, const char *s, +APR_DECLARE(const char *) apr_xml_quote_string(apr_pool_t *p, const char *s, int quotes) { const char *scan; @@ -841,7 +841,7 @@ static char *write_elem(char *s, const apr_xml_elem *elem, int style, return s; } -APU_DECLARE(void) apr_xml_quote_elem(apr_pool_t *p, apr_xml_elem *elem) +APR_DECLARE(void) apr_xml_quote_elem(apr_pool_t *p, apr_xml_elem *elem) { apr_text *scan_txt; apr_xml_attr *scan_attr; @@ -875,7 +875,7 @@ APU_DECLARE(void) apr_xml_quote_elem(apr_pool_t *p, apr_xml_elem *elem) } /* convert an element to a text string */ -APU_DECLARE(void) apr_xml_to_text(apr_pool_t * p, const apr_xml_elem *elem, +APR_DECLARE(void) apr_xml_to_text(apr_pool_t * p, const apr_xml_elem *elem, int style, apr_array_header_t *namespaces, int *ns_map, const char **pbuf, apr_size_t *psize) @@ -892,7 +892,7 @@ APU_DECLARE(void) apr_xml_to_text(apr_pool_t * p, const apr_xml_elem *elem, *psize = size; } -APU_DECLARE(const char *) apr_xml_empty_elem(apr_pool_t * p, +APR_DECLARE(const char *) apr_xml_empty_elem(apr_pool_t * p, const apr_xml_elem *elem) { if (elem->ns == APR_XML_NS_NONE) { @@ -907,7 +907,7 @@ APU_DECLARE(const char *) apr_xml_empty_elem(apr_pool_t * p, } /* return the URI's (existing) index, or insert it and return a new index */ -APU_DECLARE(int) apr_xml_insert_uri(apr_array_header_t *uri_array, +APR_DECLARE(int) apr_xml_insert_uri(apr_array_header_t *uri_array, const char *uri) { int i; @@ -983,7 +983,7 @@ static apr_status_t apr_xml_parser_convert_elem(apr_xml_elem *e, } /* convert the whole document to EBCDIC */ -APU_DECLARE(apr_status_t) apr_xml_parser_convert_doc(apr_pool_t *pool, +APR_DECLARE(apr_status_t) apr_xml_parser_convert_doc(apr_pool_t *pool, apr_xml_doc *pdoc, apr_xlate_t *convset) { From 26b7e95e9dfd2c554dbcb860553f2d856995ad46 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Fri, 17 Jul 2009 22:53:16 +0000 Subject: [PATCH 6503/7878] One more APU to APR conversion. Patch by Dan Poirier . git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@795263 13f79535-47bb-0310-9956-ffa450edef68 --- hooks/apr_hooks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/apr_hooks.c b/hooks/apr_hooks.c index c85fb55b16c..82a3a65c90d 100644 --- a/hooks/apr_hooks.c +++ b/hooks/apr_hooks.c @@ -314,7 +314,7 @@ APR_DECLARE(void) apr_hook_debug_show(const char *szName, /* Optional hook support */ -APR_DECLARE_EXTERNAL_HOOK(apr,APU,void,_optional,(void)) +APR_DECLARE_EXTERNAL_HOOK(apr,APR,void,_optional,(void)) APR_DECLARE(apr_array_header_t *) apr_optional_hook_get(const char *szName) { From 14643d4216275f41aa79a66e6c7612a5f1cf7475 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Fri, 17 Jul 2009 23:06:50 +0000 Subject: [PATCH 6504/7878] Document r794485. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@795267 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 6c33808cde9..01ba9c002b7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) More elaborate detection for dup3(), accept4() and epoll_create1(). + [Chetan Reddy , Bojan Smojver] + *) Use locally scoped variables in PostgreSQL driver to avoid stomping on return codes. PR 47431 [Wayne Jensen ] From 241d51a91fe5ae0fd3da31261d1b17c3f4f8aef3 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 18 Jul 2009 14:39:58 +0000 Subject: [PATCH 6505/7878] Add unmanaged pools from 1.4 branch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@795381 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 40 ++++++++++++++++ memory/unix/apr_pools.c | 101 +++++++++++++++++++++++++++++----------- 2 files changed, 115 insertions(+), 26 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 08512600bb7..61d8df0f0b1 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -188,6 +188,23 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator); +/** + * Create a new unmanaged pool. + * @param newpool The pool we have just created. + * @param abort_fn A function to use if the pool cannot allocate more memory. + * @param allocator The allocator to use with the new pool. If NULL a + * new allocator will be crated with newpool as owner. + * @remark An unmanaged pool is a special pool without a parent; it will + * NOT be destroyed upon apr_terminate. It must be explicitly + * destroyed by calling apr_pool_destroy, to prevent memory leaks. + * Use of this function is discouraged, think twice about whether + * you really really need it. + */ +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator); + + /** * Debug version of apr_pool_create_ex. * @param newpool @see apr_pool_create. @@ -210,10 +227,33 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_allocator_t *allocator, const char *file_line); +/** + * Debug version of apr_pool_create_unmanaged_ex. + * @param newpool @see apr_pool_create_unmanaged. + * @param abort_fn @see apr_pool_create_unmanaged. + * @param allocator @see apr_pool_create_unmanaged. + * @param file_line Where the function is called from. + * This is usually APR_POOL__FILE_LINE__. + * @remark Only available when APR_POOL_DEBUG is defined. + * Call this directly if you have you apr_pool_create_unmanaged_ex + * calls in a wrapper function and wish to override + * the file_line argument to reflect the caller of + * your wrapper function. If you do not have + * apr_pool_create_core_ex in a wrapper, trust the macro + * and don't call apr_pool_create_core_ex_debug directly. + */ +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line); + #if APR_POOL_DEBUG #define apr_pool_create_ex(newpool, parent, abort_fn, allocator) \ apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \ APR_POOL__FILE_LINE__) +#define apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator) \ + apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, \ + APR_POOL__FILE_LINE__) #endif /** diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 8c6d3e5f151..8bdce908ecc 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -796,22 +796,15 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) free(pool); } -APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator) +static apr_status_t internal_pool_create_ex(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator) { apr_pool_t *pool; *newpool = NULL; - if (!parent) - parent = global_pool; - - /* parent will always be non-NULL here except the first time a - * pool is created, in which case allocator is guaranteed to be - * non-NULL. */ - if (!abort_fn && parent) abort_fn = parent->abort_fn; @@ -880,6 +873,28 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator) +{ + if (!parent) + parent = global_pool; + + /* parent will always be non-NULL here except the first time a + * pool is created, in which case allocator is guaranteed to be + * non-NULL. */ + return internal_pool_create_ex(newpool, parent, abort_fn, allocator); +} + +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator) +{ + /* unmanaged pools have no parent. */ + return internal_pool_create_ex(newpool, NULL, abort_fn, allocator); +} + /* * "Print" functions */ @@ -1405,26 +1420,16 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, pool_destroy_debug(pool, file_line); } -APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator, - const char *file_line) +static apr_status_t internal_pool_create_ex_debug(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line) { apr_pool_t *pool; *newpool = NULL; - if (!parent) { - parent = global_pool; - } - else { - apr_pool_check_integrity(parent); - - if (!allocator) - allocator = parent->allocator; - } - if (!abort_fn && parent) abort_fn = parent->abort_fn; @@ -1506,6 +1511,34 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line) +{ + if (!parent) { + parent = global_pool; + } + else { + apr_pool_check_integrity(parent); + + if (!allocator) + allocator = parent->allocator; + } + return internal_pool_create_ex_debug(newpool, parent, abort_fn, allocator, + file_line); +} + +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line) +{ + return internal_pool_create_ex_debug(newpool, NULL, abort_fn, allocator, + file_line); +} + /* * "Print" functions (debug) */ @@ -2254,4 +2287,20 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, "undefined"); } +#undef apr_pool_create_unmanaged_ex +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator); + +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator) +{ + return apr_pool_create_unmanaged_ex_debug(newpool, parent, + abort_fn, allocator, + "undefined"); +} + #endif /* APR_POOL_DEBUG */ From 16abe8e8af702cb4a8090356e5cca97fc13509ed Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Sat, 18 Jul 2009 14:50:57 +0000 Subject: [PATCH 6506/7878] Add missing debug unmanaged fn thunk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@795384 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 8bdce908ecc..9690262e6f9 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -2237,6 +2237,14 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, return apr_pool_create_ex(newpool, parent, abort_fn, allocator); } +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line) +{ + return apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator); +} + #else /* APR_POOL_DEBUG */ #undef apr_palloc From a282f68f2c2098e7131db130dbdc581dc7d5150d Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sat, 18 Jul 2009 20:44:46 +0000 Subject: [PATCH 6507/7878] added ASF header; reformatted; cleaned up. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@795428 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_nw_export.awk | 52 +++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index ec0c8d9e9a1..a6786fd92c8 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -1,3 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# # Based on apr's make_export.awk, which is # based on Ryan Bloom's make_export.pl @@ -11,25 +27,10 @@ BEGIN { #/apr_##name##_perms_set/{next} /apr_socket_perms_set/{next} - -function add_symbol (sym_name) { - if (count) { - found++ - } - gsub (/ /, "", sym_name) - line = line sym_name ",\n" - - if (count == 0) { - printf(" %s", line) - line = "" - } -} - /^[ \t]*AP[RUI]?_DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ { sub("[ \t]*AP[RUI]?_DECLARE[^(]*[(][^)]*[)][ \t]*", "") sub("[(].*", "") sub("([^ ]* (^([ \t]*[(])))+", "") - add_symbol($0) next } @@ -39,7 +40,6 @@ function add_symbol (sym_name) { symbol = args[2] sub("^[ \t]+", "", symbol) sub("[ \t]+$", "", symbol) - add_symbol("ap_hook_" symbol) add_symbol("ap_hook_get_" symbol) add_symbol("ap_run_" symbol) @@ -75,14 +75,22 @@ function add_symbol (sym_name) { #} /^[ \t]*AP[RUI]?_DECLARE_DATA .*;$/ { - varname = $NF; - gsub( /[*;]/, "", varname); - gsub( /\[.*\]/, "", varname); - add_symbol(varname); + varname = $NF; + gsub( /[*;]/, "", varname); + gsub( /\[.*\]/, "", varname); + add_symbol(varname); } END { - add_symbol("apr_wait_for_io_or_timeout"); -# printf(" %s", line) + add_symbol("apr_wait_for_io_or_timeout"); +# printf("\n\n#found: %d symbols.\n", found) +} + +function add_symbol(sym_name) { + found++ + sub (" ", "", sym_name) + printf(" %s,\n", sym_name) } + + From 50b08a06b62d4af9718adc11790db54decc15645 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Sun, 19 Jul 2009 19:22:29 +0000 Subject: [PATCH 6508/7878] Reveert pool code back to r751657, before we got a little crazy and tried to use malloc() directly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@795598 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 64 +++- memory/unix/apr_pools.c | 702 ++++++++++++++++++++++++++++------------ 2 files changed, 556 insertions(+), 210 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 61d8df0f0b1..071ff685ca7 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -188,6 +188,14 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator); +/** + * Create a new pool. + * @deprecated @see apr_pool_create_unmanaged_ex. + */ +APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator); + /** * Create a new unmanaged pool. * @param newpool The pool we have just created. @@ -199,12 +207,15 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, * destroyed by calling apr_pool_destroy, to prevent memory leaks. * Use of this function is discouraged, think twice about whether * you really really need it. + * @warning Any child cleanups registered against the new pool, or + * against sub-pools thereof, will not be executed during an + * invocation of apr_proc_create(), so resources created in an + * "unmanaged" pool heirarchy will leak to child processes. */ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator); - /** * Debug version of apr_pool_create_ex. * @param newpool @see apr_pool_create. @@ -227,6 +238,21 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_allocator_t *allocator, const char *file_line); +#if APR_POOL_DEBUG +#define apr_pool_create_ex(newpool, parent, abort_fn, allocator) \ + apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \ + APR_POOL__FILE_LINE__) +#endif + +/** + * Debug version of apr_pool_create_core_ex. + * @deprecated @see apr_pool_create_unmanaged_ex_debug. + */ +APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line); + /** * Debug version of apr_pool_create_unmanaged_ex. * @param newpool @see apr_pool_create_unmanaged. @@ -248,12 +274,14 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpoo const char *file_line); #if APR_POOL_DEBUG -#define apr_pool_create_ex(newpool, parent, abort_fn, allocator) \ - apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \ - APR_POOL__FILE_LINE__) +#define apr_pool_create_core_ex(newpool, abort_fn, allocator) \ + apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, \ + APR_POOL__FILE_LINE__) + #define apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator) \ apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, \ APR_POOL__FILE_LINE__) + #endif /** @@ -278,6 +306,34 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, #endif #endif +/** + * Create a new pool. + * @param newpool The pool we have just created. + */ +#if defined(DOXYGEN) +APR_DECLARE(apr_status_t) apr_pool_create_core(apr_pool_t **newpool); +APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool); +#else +#if APR_POOL_DEBUG +#define apr_pool_create_core(newpool) \ + apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \ + APR_POOL__FILE_LINE__) +#define apr_pool_create_unmanaged(newpool) \ + apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \ + APR_POOL__FILE_LINE__) +#else +#define apr_pool_create_core(newpool) \ + apr_pool_create_unmanaged_ex(newpool, NULL, NULL) +#define apr_pool_create_unmanaged(newpool) \ + apr_pool_create_unmanaged_ex(newpool, NULL, NULL) +#endif +#endif + +/** + * Find the pools allocator + * @param pool The pool to get the allocator from. + */ +APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool); /** * Clear all memory in the pool and run all the cleanups. This also destroys all diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 9690262e6f9..a4fe887d685 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -460,15 +460,6 @@ struct debug_node_t { #endif /* APR_POOL_DEBUG */ -typedef struct block_list_t block_list_t; -#define BLOCK_LIST_ENTRIES_MIN (13) -struct block_list_t { - int offset; - int size; - block_list_t *next; - void *entries[BLOCK_LIST_ENTRIES_MIN]; -}; - /* The ref field in the apr_pool_t struct holds a * pointer to the pointer referencing this pool. * It is used for parent, child, sibling management. @@ -482,19 +473,16 @@ struct apr_pool_t { apr_pool_t **ref; cleanup_t *cleanups; cleanup_t *free_cleanups; + apr_allocator_t *allocator; struct process_chain *subprocesses; apr_abortfunc_t abort_fn; apr_hash_t *user_data; const char *tag; - block_list_t first_block; - block_list_t *final_block; - block_list_t *blocks; -#if APR_HAS_THREADS - apr_thread_mutex_t *mutex; -#endif /* APR_HAS_THREADS */ - #if !APR_POOL_DEBUG + apr_memnode_t *active; + apr_memnode_t *self; /* The node containing the pool itself */ + char *self_first_avail; #else /* APR_POOL_DEBUG */ apr_pool_t *joined; /* the caller has guaranteed that this pool @@ -507,13 +495,14 @@ struct apr_pool_t { unsigned int stat_clear; #if APR_HAS_THREADS apr_os_thread_t owner; + apr_thread_mutex_t *mutex; #endif /* APR_HAS_THREADS */ #endif /* APR_POOL_DEBUG */ #ifdef NETWARE apr_os_proc_t owner_proc; #endif /* defined(NETWARE) */ cleanup_t *pre_cleanups; - cleanup_t *final_cleanups; + cleanup_t *free_pre_cleanups; }; #define SIZEOF_POOL_T APR_ALIGN_DEFAULT(sizeof(apr_pool_t)) @@ -540,7 +529,6 @@ static apr_file_t *file_stderr = NULL; static void run_cleanups(cleanup_t **c); static void run_child_cleanups(cleanup_t **c); -static void free_cleanups(cleanup_t **c); static void free_proc_chain(struct process_chain *procs); #if APR_POOL_DEBUG @@ -640,64 +628,61 @@ APR_DECLARE(void) apr_pool_terminate(void) * Memory allocation */ -static void block_list_add_entry(apr_pool_t *pool, void *mem, apr_size_t size) +APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) { - if (pool->blocks->offset == pool->blocks->size) { - size_t size = APR_ALIGN((pool->blocks->size << 1), 16); - block_list_t *ml = pool->blocks; - pool->blocks = malloc(sizeof(block_list_t) + (sizeof(void *) * size)); - pool->blocks->offset = 0; - pool->blocks->size = BLOCK_LIST_ENTRIES_MIN + size; - pool->blocks->next = ml; - } - - pool->blocks->entries[pool->blocks->offset] = mem; - pool->blocks->offset++; -} + apr_memnode_t *active, *node; + void *mem; + apr_size_t free_index; -static void block_list_clear(block_list_t *ml) -{ - int i; - for (i = 0; i < ml->offset; i++) { - free(ml->entries[i]); - } - ml->offset = 0; -} + size = APR_ALIGN_DEFAULT(size); + active = pool->active; + /* If the active node has enough bytes left, use it. */ + if (size <= node_free_space(active)) { + mem = active->first_avail; + active->first_avail += size; -static void block_list_clear_all(block_list_t *ml) -{ - while (ml != NULL) { - block_list_clear(ml); - ml = ml->next; + return mem; } -} -static void block_list_destroy(block_list_t *ml) -{ - int i; + node = active->next; + if (size <= node_free_space(node)) { + list_remove(node); + } + else { + if ((node = allocator_alloc(pool->allocator, size)) == NULL) { + if (pool->abort_fn) + pool->abort_fn(APR_ENOMEM); - for (i = 0; i < ml->offset; i++) { - free(ml->entries[i]); + return NULL; + } } -} -static void block_list_destroy_all(block_list_t *ml) -{ - block_list_t *i, *j; - for (i = ml; i != NULL; i = j) { - j = i->next; - block_list_destroy(i); - /* The last block is not malloc-allocated, so only free the - * block_list_t * for previous blocks. */ - if (j) free(i); + node->free_index = 0; + + mem = node->first_avail; + node->first_avail += size; + + list_insert(node, active); + + pool->active = node; + + free_index = (APR_ALIGN(active->endp - active->first_avail + 1, + BOUNDARY_SIZE) - BOUNDARY_SIZE) >> BOUNDARY_INDEX; + + active->free_index = (APR_UINT32_TRUNC_CAST)free_index; + node = active->next; + if (free_index >= node->free_index) + return mem; + + do { + node = node->next; } -} + while (free_index < node->free_index); + + list_remove(active); + list_insert(active, node); -APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) -{ - void *mem = malloc(size); - block_list_add_entry(pool, mem, size); return mem; } @@ -712,8 +697,13 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size); APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) { - void *mem = calloc(1, size); - block_list_add_entry(pool, mem, size); + void *mem; + + size = APR_ALIGN_DEFAULT(size); + if ((mem = apr_palloc(pool, size)) != NULL) { + memset(mem, 0, size); + } + return mem; } @@ -724,9 +714,12 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) { + apr_memnode_t *active; + /* Run pre destroy cleanups */ run_cleanups(&pool->pre_cleanups); pool->pre_cleanups = NULL; + pool->free_pre_cleanups = NULL; /* Destroy the subpools. The subpools will detach themselves from * this pool thus this loop is safe and easy. @@ -737,7 +730,6 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) /* Run cleanups */ run_cleanups(&pool->cleanups); pool->cleanups = NULL; - free_cleanups(&pool->free_cleanups); pool->free_cleanups = NULL; /* Free subprocesses */ @@ -747,14 +739,30 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) /* Clear the user data. */ pool->user_data = NULL; - block_list_clear_all(pool->blocks); + /* Find the node attached to the pool structure, reset it, make + * it the active node and free the rest of the nodes. + */ + active = pool->active = pool->self; + active->first_avail = pool->self_first_avail; + + if (active->next == active) + return; + + *active->ref = NULL; + allocator_free(pool->allocator, active->next); + active->next = active; + active->ref = &active->next; } APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) { + apr_memnode_t *active; + apr_allocator_t *allocator; + /* Run pre destroy cleanups */ run_cleanups(&pool->pre_cleanups); pool->pre_cleanups = NULL; + pool->free_pre_cleanups = NULL; /* Destroy the subpools. The subpools will detach themselve from * this pool thus this loop is safe and easy. @@ -764,7 +772,6 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) /* Run cleanups */ run_cleanups(&pool->cleanups); - free_cleanups(&pool->free_cleanups); /* Free subprocesses */ free_proc_chain(pool->subprocesses); @@ -772,83 +779,111 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) /* Remove the pool from the parents child list */ if (pool->parent) { #if APR_HAS_THREADS - if (pool->parent->mutex) { - apr_thread_mutex_lock(pool->parent->mutex); - } + apr_thread_mutex_t *mutex; + + if ((mutex = apr_allocator_mutex_get(pool->parent->allocator)) != NULL) + apr_thread_mutex_lock(mutex); #endif /* APR_HAS_THREADS */ if ((*pool->ref = pool->sibling) != NULL) pool->sibling->ref = pool->ref; #if APR_HAS_THREADS - if (pool->parent->mutex) { - apr_thread_mutex_unlock(pool->parent->mutex); - } + if (mutex) + apr_thread_mutex_unlock(mutex); #endif /* APR_HAS_THREADS */ } - block_list_destroy_all(pool->blocks); - run_cleanups(&pool->final_cleanups); - if (pool->final_block) { - block_list_destroy(pool->final_block); - free(pool->final_block); + /* Find the block attached to the pool structure. Save a copy of the + * allocator pointer, because the pool struct soon will be no more. + */ + allocator = pool->allocator; + active = pool->self; + *active->ref = NULL; + +#if APR_HAS_THREADS + if (apr_allocator_owner_get(allocator) == pool) { + /* Make sure to remove the lock, since it is highly likely to + * be invalid now. + */ + apr_allocator_mutex_set(allocator, NULL); + } +#endif /* APR_HAS_THREADS */ + + /* Free all the nodes in the pool (including the node holding the + * pool struct), by giving them back to the allocator. + */ + allocator_free(allocator, active); + + /* If this pool happens to be the owner of the allocator, free + * everything in the allocator (that includes the pool struct + * and the allocator). Don't worry about destroying the optional mutex + * in the allocator, it will have been destroyed by the cleanup function. + */ + if (apr_allocator_owner_get(allocator) == pool) { + apr_allocator_destroy(allocator); } - free(pool); } -static apr_status_t internal_pool_create_ex(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator) +APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator) { apr_pool_t *pool; + apr_memnode_t *node; *newpool = NULL; + if (!parent) + parent = global_pool; + + /* parent will always be non-NULL here except the first time a + * pool is created, in which case allocator is guaranteed to be + * non-NULL. */ + if (!abort_fn && parent) abort_fn = parent->abort_fn; - pool = malloc(sizeof(apr_pool_t)); + if (allocator == NULL) + allocator = parent->allocator; + + if ((node = allocator_alloc(allocator, + MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { + if (abort_fn) + abort_fn(APR_ENOMEM); + + return APR_ENOMEM; + } + + node->next = node; + node->ref = &node->next; + + pool = (apr_pool_t *)node->first_avail; + node->first_avail = pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; + + pool->allocator = allocator; + pool->active = pool->self = node; pool->abort_fn = abort_fn; pool->child = NULL; + pool->cleanups = NULL; pool->free_cleanups = NULL; pool->pre_cleanups = NULL; + pool->free_pre_cleanups = NULL; pool->subprocesses = NULL; pool->user_data = NULL; pool->tag = NULL; - pool->cleanups = NULL; - pool->final_block = NULL; - pool->final_cleanups = NULL; - - if (allocator) { - pool->blocks = malloc(sizeof(block_list_t)); - pool->blocks->offset = 0; - pool->blocks->next = NULL; - pool->blocks->size = BLOCK_LIST_ENTRIES_MIN; - (void)apr_thread_mutex_create(&pool->mutex, - APR_THREAD_MUTEX_NESTED, pool); - pool->final_cleanups = pool->cleanups; - pool->final_block = pool->blocks; - pool->cleanups = NULL; - } - else { - pool->mutex = parent->mutex; - } - pool->blocks = &pool->first_block; - pool->blocks->offset = 0; - pool->blocks->next = NULL; - pool->blocks->size = BLOCK_LIST_ENTRIES_MIN; - - + #ifdef NETWARE pool->owner_proc = (apr_os_proc_t)getnlmhandle(); #endif /* defined(NETWARE) */ if ((pool->parent = parent) != NULL) { #if APR_HAS_THREADS - if (pool->parent->mutex) { - apr_thread_mutex_lock(pool->parent->mutex); - } + apr_thread_mutex_t *mutex; + + if ((mutex = apr_allocator_mutex_get(parent->allocator)) != NULL) + apr_thread_mutex_lock(mutex); #endif /* APR_HAS_THREADS */ if ((pool->sibling = parent->child) != NULL) @@ -858,9 +893,8 @@ static apr_status_t internal_pool_create_ex(apr_pool_t **newpool, pool->ref = &parent->child; #if APR_HAS_THREADS - if (pool->parent->mutex) { - apr_thread_mutex_unlock(pool->parent->mutex); - } + if (mutex) + apr_thread_mutex_unlock(mutex); #endif /* APR_HAS_THREADS */ } else { @@ -873,76 +907,261 @@ static apr_status_t internal_pool_create_ex(apr_pool_t **newpool, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator) +/* Deprecated. Renamed to apr_pool_create_unmanaged_ex + */ +APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator) { - if (!parent) - parent = global_pool; - - /* parent will always be non-NULL here except the first time a - * pool is created, in which case allocator is guaranteed to be - * non-NULL. */ - return internal_pool_create_ex(newpool, parent, abort_fn, allocator); + return apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator); } APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator) { - /* unmanaged pools have no parent. */ - return internal_pool_create_ex(newpool, NULL, abort_fn, allocator); + apr_pool_t *pool; + apr_memnode_t *node; + apr_allocator_t *pool_allocator; + + *newpool = NULL; + + if (!apr_pools_initialized) + return APR_ENOPOOL; + if ((pool_allocator = allocator) == NULL) { + if ((pool_allocator = malloc(MIN_ALLOC)) == NULL) { + if (abort_fn) + abort_fn(APR_ENOMEM); + + return APR_ENOMEM; + } + memset(pool_allocator, 0, SIZEOF_ALLOCATOR_T); + pool_allocator->max_free_index = APR_ALLOCATOR_MAX_FREE_UNLIMITED; + node = (apr_memnode_t *)((char *)pool_allocator + SIZEOF_ALLOCATOR_T); + node->next = NULL; + node->index = 1; + node->first_avail = (char *)node + APR_MEMNODE_T_SIZE; + node->endp = (char *)pool_allocator + MIN_ALLOC; + } + else if ((node = allocator_alloc(pool_allocator, + MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { + if (abort_fn) + abort_fn(APR_ENOMEM); + + return APR_ENOMEM; + } + + node->next = node; + node->ref = &node->next; + + pool = (apr_pool_t *)node->first_avail; + node->first_avail = pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; + + pool->allocator = pool_allocator; + pool->active = pool->self = node; + pool->abort_fn = abort_fn; + pool->child = NULL; + pool->cleanups = NULL; + pool->free_cleanups = NULL; + pool->pre_cleanups = NULL; + pool->free_pre_cleanups = NULL; + pool->subprocesses = NULL; + pool->user_data = NULL; + pool->tag = NULL; + pool->parent = NULL; + pool->sibling = NULL; + pool->ref = NULL; + +#ifdef NETWARE + pool->owner_proc = (apr_os_proc_t)getnlmhandle(); +#endif /* defined(NETWARE) */ + if (!allocator) + pool_allocator->owner = pool; + *newpool = pool; + + return APR_SUCCESS; } /* * "Print" functions */ + +/* + * apr_psprintf is implemented by writing directly into the current + * block of the pool, starting right at first_avail. If there's + * insufficient room, then a new block is allocated and the earlier + * output is copied over. The new block isn't linked into the pool + * until all the output is done. + * + * Note that this is completely safe because nothing else can + * allocate in this apr_pool_t while apr_psprintf is running. alarms are + * blocked, and the only thing outside of apr_pools.c that's invoked + * is apr_vformatter -- which was purposefully written to be + * self-contained with no callouts. + */ + struct psprintf_data { apr_vformatter_buff_t vbuff; - char *mem; - apr_size_t size; + apr_memnode_t *node; + apr_pool_t *pool; + apr_byte_t got_a_new_node; + apr_memnode_t *free; }; +#define APR_PSPRINTF_MIN_STRINGSIZE 32 + static int psprintf_flush(apr_vformatter_buff_t *vbuff) { struct psprintf_data *ps = (struct psprintf_data *)vbuff; - apr_size_t size; - - size = ps->vbuff.curpos - ps->mem; - - ps->size <<= 1; - if ((ps->mem = realloc(ps->mem, ps->size)) == NULL) - return -1; - - ps->vbuff.curpos = ps->mem + size; - ps->vbuff.endpos = ps->mem + ps->size - 1; - + apr_memnode_t *node, *active; + apr_size_t cur_len, size; + char *strp; + apr_pool_t *pool; + apr_size_t free_index; + + pool = ps->pool; + active = ps->node; + strp = ps->vbuff.curpos; + cur_len = strp - active->first_avail; + size = cur_len << 1; + + /* Make sure that we don't try to use a block that has less + * than APR_PSPRINTF_MIN_STRINGSIZE bytes left in it. This + * also catches the case where size == 0, which would result + * in reusing a block that can't even hold the NUL byte. + */ + if (size < APR_PSPRINTF_MIN_STRINGSIZE) + size = APR_PSPRINTF_MIN_STRINGSIZE; + + node = active->next; + if (!ps->got_a_new_node && size <= node_free_space(node)) { + + list_remove(node); + list_insert(node, active); + + node->free_index = 0; + + pool->active = node; + + free_index = (APR_ALIGN(active->endp - active->first_avail + 1, + BOUNDARY_SIZE) - BOUNDARY_SIZE) >> BOUNDARY_INDEX; + + active->free_index = (APR_UINT32_TRUNC_CAST)free_index; + node = active->next; + if (free_index < node->free_index) { + do { + node = node->next; + } + while (free_index < node->free_index); + + list_remove(active); + list_insert(active, node); + } + + node = pool->active; + } + else { + if ((node = allocator_alloc(pool->allocator, size)) == NULL) + return -1; + + if (ps->got_a_new_node) { + active->next = ps->free; + ps->free = active; + } + + ps->got_a_new_node = 1; + } + + memcpy(node->first_avail, active->first_avail, cur_len); + + ps->node = node; + ps->vbuff.curpos = node->first_avail + cur_len; + ps->vbuff.endpos = node->endp - 1; /* Save a byte for NUL terminator */ + return 0; } APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) { struct psprintf_data ps; + char *strp; + apr_size_t size; + apr_memnode_t *active, *node; + apr_size_t free_index; + + ps.node = active = pool->active; + ps.pool = pool; + ps.vbuff.curpos = ps.node->first_avail; - ps.size = 128; - ps.mem = malloc(ps.size); - ps.vbuff.curpos = ps.mem; - /* Save a byte for the NUL terminator */ - ps.vbuff.endpos = ps.mem + ps.size - 1; - + ps.vbuff.endpos = ps.node->endp - 1; + ps.got_a_new_node = 0; + ps.free = NULL; + + /* Make sure that the first node passed to apr_vformatter has at least + * room to hold the NUL terminator. + */ + if (ps.node->first_avail == ps.node->endp) { + if (psprintf_flush(&ps.vbuff) == -1) { + if (pool->abort_fn) { + pool->abort_fn(APR_ENOMEM); + } + + return NULL; + } + } + if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); - + return NULL; } - *ps.vbuff.curpos++ = '\0'; - - block_list_add_entry(pool, ps.mem, ps.size); - return ps.mem; + strp = ps.vbuff.curpos; + *strp++ = '\0'; + + size = strp - ps.node->first_avail; + size = APR_ALIGN_DEFAULT(size); + strp = ps.node->first_avail; + ps.node->first_avail += size; + + if (ps.free) + allocator_free(pool->allocator, ps.free); + + /* + * Link the node in if it's a new one + */ + if (!ps.got_a_new_node) + return strp; + + active = pool->active; + node = ps.node; + + node->free_index = 0; + + list_insert(node, active); + + pool->active = node; + + free_index = (APR_ALIGN(active->endp - active->first_avail + 1, + BOUNDARY_SIZE) - BOUNDARY_SIZE) >> BOUNDARY_INDEX; + + active->free_index = (APR_UINT32_TRUNC_CAST)free_index; + node = active->next; + + if (free_index >= node->free_index) + return strp; + + do { + node = node->next; + } + while (free_index < node->free_index); + + list_remove(active); + list_insert(active, node); + + return strp; } @@ -1420,16 +1639,26 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, pool_destroy_debug(pool, file_line); } -static apr_status_t internal_pool_create_ex_debug(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator, - const char *file_line) +APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, + apr_pool_t *parent, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line) { apr_pool_t *pool; *newpool = NULL; + if (!parent) { + parent = global_pool; + } + else { + apr_pool_check_integrity(parent); + + if (!allocator) + allocator = parent->allocator; + } + if (!abort_fn && parent) abort_fn = parent->abort_fn; @@ -1511,23 +1740,13 @@ static apr_status_t internal_pool_create_ex_debug(apr_pool_t **newpool, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, - apr_pool_t *parent, +APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, const char *file_line) { - if (!parent) { - parent = global_pool; - } - else { - apr_pool_check_integrity(parent); - - if (!allocator) - allocator = parent->allocator; - } - return internal_pool_create_ex_debug(newpool, parent, abort_fn, allocator, - file_line); + return apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, + file_line); } APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, @@ -1535,8 +1754,69 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpoo apr_allocator_t *allocator, const char *file_line) { - return internal_pool_create_ex_debug(newpool, NULL, abort_fn, allocator, - file_line); + apr_pool_t *pool; + apr_allocator_t *pool_allocator; + + *newpool = NULL; + + if ((pool = malloc(SIZEOF_POOL_T)) == NULL) { + if (abort_fn) + abort_fn(APR_ENOMEM); + + return APR_ENOMEM; + } + + memset(pool, 0, SIZEOF_POOL_T); + + pool->abort_fn = abort_fn; + pool->tag = file_line; + pool->file_line = file_line; + +#if APR_HAS_THREADS + pool->owner = apr_os_thread_current(); +#endif /* APR_HAS_THREADS */ +#ifdef NETWARE + pool->owner_proc = (apr_os_proc_t)getnlmhandle(); +#endif /* defined(NETWARE) */ + + if ((pool_allocator = allocator) == NULL) { + apr_status_t rv; + if ((rv = apr_allocator_create(&pool_allocator)) != APR_SUCCESS) { + if (abort_fn) + abort_fn(rv); + return rv; + } + pool_allocator->owner = pool; + } + pool->allocator = pool_allocator; + + if (pool->allocator != allocator) { +#if APR_HAS_THREADS + apr_status_t rv; + + /* No matter what the creation flags say, always create + * a lock. Without it integrity_check and apr_pool_num_bytes + * blow up (because they traverse pools child lists that + * possibly belong to another thread, in combination with + * the pool having no lock). However, this might actually + * hide problems like creating a child pool of a pool + * belonging to another thread. + */ + if ((rv = apr_thread_mutex_create(&pool->mutex, + APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) { + free(pool); + return rv; + } +#endif /* APR_HAS_THREADS */ + } + + *newpool = pool; + +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) + apr_pool_log_event(pool, "CREATE", file_line, 1); +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ + + return APR_SUCCESS; } /* @@ -1763,6 +2043,11 @@ APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool) return pool->parent; } +APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool) +{ + return pool->allocator; +} + /* return TRUE if a is an ancestor of b * NULL is considered an ancestor of all pools */ @@ -1889,7 +2174,7 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, c = p->free_cleanups; p->free_cleanups = c->next; } else { - c = malloc(sizeof(cleanup_t)); + c = apr_palloc(p, sizeof(cleanup_t)); } c->data = data; c->plain_cleanup_fn = plain_cleanup_fn; @@ -1909,12 +2194,12 @@ APR_DECLARE(void) apr_pool_pre_cleanup_register(apr_pool_t *p, const void *data, #endif /* APR_POOL_DEBUG */ if (p != NULL) { - if (p->free_cleanups) { + if (p->free_pre_cleanups) { /* reuse a cleanup structure */ - c = p->free_cleanups; - p->free_cleanups = c->next; + c = p->free_pre_cleanups; + p->free_pre_cleanups = c->next; } else { - c = malloc(sizeof(cleanup_t)); + c = apr_palloc(p, sizeof(cleanup_t)); } c->data = data; c->plain_cleanup_fn = plain_cleanup_fn; @@ -1975,8 +2260,8 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, if (c->data == data && c->plain_cleanup_fn == cleanup_fn) { *lastp = c->next; /* move to freelist */ - c->next = p->free_cleanups; - p->free_cleanups = c; + c->next = p->free_pre_cleanups; + p->free_pre_cleanups = c; break; } @@ -2024,18 +2309,6 @@ static void run_cleanups(cleanup_t **cref) while (c) { *cref = c->next; (*c->plain_cleanup_fn)((void *)c->data); - free(c); - c = *cref; - } -} - -static void free_cleanups(cleanup_t **cref) -{ - cleanup_t *c = *cref; - - while (c) { - *cref = c->next; - free(c); c = *cref; } } @@ -2047,7 +2320,6 @@ static void run_child_cleanups(cleanup_t **cref) while (c) { *cref = c->next; (*c->child_cleanup_fn)((void *)c->data); - free(c); c = *cref; } } @@ -2237,10 +2509,18 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, return apr_pool_create_ex(newpool, parent, abort_fn, allocator); } +APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line) +{ + return apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator); +} + APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator, - const char *file_line) + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator, + const char *file_line) { return apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator); } @@ -2295,20 +2575,30 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, "undefined"); } +#undef apr_pool_create_core_ex +APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator); + +APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator) +{ + return apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, + allocator, "undefined"); +} + #undef apr_pool_create_unmanaged_ex APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator); + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator); APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator) + apr_abortfunc_t abort_fn, + apr_allocator_t *allocator) { - return apr_pool_create_unmanaged_ex_debug(newpool, parent, - abort_fn, allocator, - "undefined"); + return apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, + allocator, "undefined"); } #endif /* APR_POOL_DEBUG */ From c35aaf9ab3b2b102827e6f5155b9cb174fcf84a6 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 27 Jul 2009 21:20:20 +0000 Subject: [PATCH 6509/7878] Clarify the error messages within the dbd tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@798286 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ test/testdbd.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 01ba9c002b7..2e8b9112426 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Clarify the error messages within the dbd tests. [Graham Leggett] + *) More elaborate detection for dup3(), accept4() and epoll_create1(). [Chetan Reddy , Bojan Smojver] diff --git a/test/testdbd.c b/test/testdbd.c index 682599eb12a..b94c491b932 100644 --- a/test/testdbd.c +++ b/test/testdbd.c @@ -180,7 +180,7 @@ static void test_dbd_sqlite2(abts_case *tc, void *data) apr_dbd_t* handle = NULL; rv = apr_dbd_get_driver(pool, "sqlite2", &driver); - ABTS_ASSERT(tc, "failed to fetch driver", rv == APR_SUCCESS); + ABTS_ASSERT(tc, "failed to fetch sqlite2 driver", rv == APR_SUCCESS); ABTS_PTR_NOTNULL(tc, driver); if (!driver) { return; @@ -189,7 +189,7 @@ static void test_dbd_sqlite2(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "sqlite2", apr_dbd_name(driver)); rv = apr_dbd_open(driver, pool, "data/sqlite2.db:600", &handle); - ABTS_ASSERT(tc, "failed to open database", rv == APR_SUCCESS); + ABTS_ASSERT(tc, "failed to open sqlite2 atabase", rv == APR_SUCCESS); ABTS_PTR_NOTNULL(tc, handle); if (!handle) { return; @@ -208,7 +208,7 @@ static void test_dbd_sqlite3(abts_case *tc, void *data) apr_dbd_t* handle = NULL; rv = apr_dbd_get_driver(pool, "sqlite3", &driver); - ABTS_ASSERT(tc, "failed to fetch driver", rv == APR_SUCCESS); + ABTS_ASSERT(tc, "failed to fetch sqlite3 driver", rv == APR_SUCCESS); ABTS_PTR_NOTNULL(tc, driver); if (!driver) { return; @@ -217,7 +217,7 @@ static void test_dbd_sqlite3(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "sqlite3", apr_dbd_name(driver)); rv = apr_dbd_open(driver, pool, "data/sqlite3.db", &handle); - ABTS_ASSERT(tc, "failed to open database", rv == APR_SUCCESS); + ABTS_ASSERT(tc, "failed to open sqlite3 database", rv == APR_SUCCESS); ABTS_PTR_NOTNULL(tc, handle); if (!handle) { return; From db1ce94890abb5f18f0a8c5bdce8565ed0e4776b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 27 Jul 2009 22:41:35 +0000 Subject: [PATCH 6510/7878] ignore buildmess git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@798318 13f79535-47bb-0310-9956-ffa450edef68 From 31e3239f2aeab03ea8d91853d6437c902dfc3ae9 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 28 Jul 2009 00:07:05 +0000 Subject: [PATCH 6511/7878] Make sure the LD_LIBRARY_PATH is sensible when running the tests from the RPM build, so that the crypto, dbd and dbm tests pass. Transfer the apr-util spec file contents to apr.spec. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@798340 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++ build/rpm/apr.spec.in | 130 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 134 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 2e8b9112426..b0d7f1f6c73 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Make sure the LD_LIBRARY_PATH is sensible when running the tests + from the RPM build, so that the crypto, dbd and dbm tests pass. + Transfer the apr-util spec file contents to apr.spec. [Graham + Leggett] + *) Clarify the error messages within the dbd tests. [Graham Leggett] *) More elaborate detection for dup3(), accept4() and epoll_create1(). diff --git a/build/rpm/apr.spec.in b/build/rpm/apr.spec.in index 9e23e6cf070..7fd208342cd 100644 --- a/build/rpm/apr.spec.in +++ b/build/rpm/apr.spec.in @@ -29,6 +29,92 @@ build applications using the APR library. The mission of the Apache Portable Runtime (APR) is to provide a free library of C data structures and routines. +%package dbm +Group: Development/Libraries +Summary: APR utility library DBM driver +BuildRequires: db4-devel +Requires: apr-util = %{version}-%{release} + +%description dbm +This package provides the DBM driver for the apr-util. + +%package pgsql +Group: Development/Libraries +Summary: APR utility library PostgreSQL DBD driver +BuildRequires: postgresql-devel +Requires: apr-util = %{version}-%{release} + +%description pgsql +This package provides the PostgreSQL driver for the apr-util +DBD (database abstraction) interface. + +%package mysql +Group: Development/Libraries +Summary: APR utility library MySQL DBD driver +BuildRequires: mysql-devel +Requires: apr-util = %{version}-%{release} + +%description mysql +This package provides the MySQL driver for the apr-util DBD +(database abstraction) interface. + +%package sqlite +Group: Development/Libraries +Summary: APR utility library SQLite DBD driver +BuildRequires: sqlite-devel >= 3.0.0 +Requires: apr-util = %{version}-%{release} + +%description sqlite +This package provides the SQLite driver for the apr-util DBD +(database abstraction) interface. + +%package freetds +Group: Development/Libraries +Summary: APR utility library FreeTDS DBD driver +BuildRequires: freetds-devel +Requires: apr-util = %{version}-%{release} + +%description freetds +This package provides the FreeTDS driver for the apr-util DBD +(database abstraction) interface. + +%package odbc +Group: Development/Libraries +Summary: APR utility library ODBC DBD driver +BuildRequires: unixODBC-devel +Requires: apr-util = %{version}-%{release} + +%description odbc +This package provides the ODBC driver for the apr-util DBD +(database abstraction) interface. + +%package ldap +Group: Development/Libraries +Summary: APR utility library LDAP support +BuildRequires: openldap-devel +Requires: apr-util = %{version}-%{release} + +%description ldap +This package provides the LDAP support for the apr-util. + +%package openssl +Group: Development/Libraries +Summary: APR utility library OpenSSL crypto support +BuildRequires: openssl-devel +Requires: apr-util = %{version}-%{release} + +%description openssl +This package provides crypto support for apr-util based on OpenSSL. + +%package nss +Group: Development/Libraries +Summary: APR utility library NSS crypto support +BuildRequires: nss-devel +Requires: apr-util = %{version}-%{release} + +%description nss +This package provides crypto support for apr-util based on Mozilla NSS. + %prep %setup -q @@ -40,6 +126,11 @@ C data structures and routines. --includedir=%{_includedir}/apr-%{aprver} \ --with-installbuilddir=%{_libdir}/apr/build-%{aprver} \ --with-devrandom=/dev/urandom \ + --with-ldap --without-gdbm \ + --with-sqlite3 --with-pgsql --with-mysql --with-freetds --with-odbc \ + --with-berkeley-db \ + --with-crypto --with-openssl --with-nss \ + --without-sqlite2 CC=gcc CXX=g++ make %{?_smp_mflags} && make dox @@ -47,7 +138,7 @@ make %{?_smp_mflags} && make dox # Run non-interactive tests pushd test make %{?_smp_mflags} all CFLAGS=-fno-strict-aliasing -./testall -v || exit 1 +LD_LIBRARY_PATH=../crypto/.libs:../dbd/.libs:../dbm/.libs ./testall -v || exit 1 popd %install @@ -71,6 +162,43 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %doc CHANGES LICENSE NOTICE %{_libdir}/libapr-%{aprver}.so.* +%dir %{_libdir}/apr-%{aprver} + +%files dbm +%defattr(-,root,root,-) +%{_libdir}/apr-%{aprver}/apr_dbm_db* + +%files pgsql +%defattr(-,root,root,-) +%{_libdir}/apr-%{aprver}/apr_dbd_pgsql* + +%files mysql +%defattr(-,root,root,-) +%{_libdir}/apr-%{aprver}/apr_dbd_mysql* + +%files sqlite +%defattr(-,root,root,-) +%{_libdir}/apr-%{aprver}/apr_dbd_sqlite* + +%files freetds +%defattr(-,root,root,-) +%{_libdir}/apr-%{aprver}/apr_dbd_freetds* + +%files odbc +%defattr(-,root,root,-) +%{_libdir}/apr-%{aprver}/apr_dbd_odbc* + +%files ldap +%defattr(-,root,root,-) +%{_libdir}/apr-%{aprver}/apr_ldap* + +%files openssl +%defattr(-,root,root,-) +%{_libdir}/apr-%{aprver}/apr_crypto_openssl* + +%files nss +%defattr(-,root,root,-) +%{_libdir}/apr-%{aprver}/apr_crypto_nss* %files devel %defattr(-,root,root,-) From 1e3797ea627c26a45500ad3fea2630a867e94e78 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 28 Jul 2009 19:40:01 +0000 Subject: [PATCH 6512/7878] Make sure the mysql version of dbd_mysql_get_entry() respects the rule that if the column number exceeds the number of columns, we return NULL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@798678 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ dbd/apr_dbd_mysql.c | 16 +++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index b0d7f1f6c73..5ade5953422 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Make sure the mysql version of dbd_mysql_get_entry() respects the + rule that if the column number exceeds the number of columns, we + return NULL. [Graham Leggett] + *) Make sure the LD_LIBRARY_PATH is sensible when running the tests from the RPM build, so that the crypto, dbd and dbm tests pass. Transfer the apr-util spec file contents to apr.spec. [Graham diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c index 77fa5fb7526..fe1d7c5924c 100644 --- a/dbd/apr_dbd_mysql.c +++ b/dbd/apr_dbd_mysql.c @@ -256,7 +256,7 @@ static int dbd_mysql_select(apr_pool_t *pool, apr_dbd_t *sql, } else { ret = mysql_errno(sql->conn); } - + if (TXN_NOTICE_ERRORS(sql->trans)) { sql->trans->errnum = ret; } @@ -333,6 +333,9 @@ static int dbd_mysql_get_entry(const apr_dbd_row_t *row, int n, apr_dbd_datum_t *val) { MYSQL_BIND *bind; + if (dbd_mysql_num_cols(row->res) <= n) { + return NULL; + } if (row->res->statement) { bind = &row->res->bind[n]; if (mysql_stmt_fetch_column(row->res->statement, bind, n, 0) != 0) { @@ -359,6 +362,9 @@ static int dbd_mysql_get_entry(const apr_dbd_row_t *row, int n, static const char *dbd_mysql_get_entry(const apr_dbd_row_t *row, int n) { MYSQL_BIND *bind; + if (dbd_mysql_num_cols(row->res) <= n) { + return NULL; + } if (row->res->statement) { bind = &row->res->bind[n]; if (mysql_stmt_fetch_column(row->res->statement, bind, n, 0) != 0) { @@ -1100,7 +1106,7 @@ static apr_dbd_t *dbd_mysql_open(apr_pool_t *pool, const char *params, #endif MYSQL *real_conn; unsigned long flags = 0; - + struct { const char *field; const char *value; @@ -1176,7 +1182,7 @@ static apr_dbd_t *dbd_mysql_open(apr_pool_t *pool, const char *params, /* the MySQL manual says this should be BEFORE mysql_real_connect */ mysql_options(sql->conn, MYSQL_OPT_RECONNECT, &do_reconnect); #endif - + real_conn = mysql_real_connect(sql->conn, fields[0].value, fields[1].value, fields[2].value, fields[3].value, port, @@ -1256,8 +1262,8 @@ static void dbd_mysql_init(apr_pool_t *pool) { my_init(); mysql_thread_init(); - - /* FIXME: this is a guess; find out what it really does */ + + /* FIXME: this is a guess; find out what it really does */ apr_pool_cleanup_register(pool, NULL, thread_end, apr_pool_cleanup_null); } APU_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_mysql_driver = { From a0277599de37ad52ea02410c3360cb0db7be8bbb Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 28 Jul 2009 19:53:52 +0000 Subject: [PATCH 6513/7878] Add dbd_mysql_num_cols to the list of declared functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@798689 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_mysql.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c index fe1d7c5924c..95a92477ade 100644 --- a/dbd/apr_dbd_mysql.c +++ b/dbd/apr_dbd_mysql.c @@ -112,6 +112,7 @@ static apr_bucket *apr_bucket_lob_create(const apr_dbd_row_t *row, int col, apr_off_t offset, apr_size_t len, apr_pool_t *p, apr_bucket_alloc_t *list); +static int dbd_mysql_num_cols(apr_dbd_results_t *res); static const apr_bucket_type_t apr_bucket_type_lob = { "LOB", 5, APR_BUCKET_DATA, From 90cf2e4b6b44e5e9432519bc224bdf0082ef8a3b Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 28 Jul 2009 22:02:21 +0000 Subject: [PATCH 6514/7878] Make sure that "make check" is used in the RPM spec file, so that the crypto, dbd and dbm tests pass. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@798718 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 ++++--- build/rpm/apr.spec.in | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 5ade5953422..937eb3d1965 100644 --- a/CHANGES +++ b/CHANGES @@ -1,13 +1,14 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Make sure that "make check" is used in the RPM spec file, so that + the crypto, dbd and dbm tests pass. [Graham Leggett] + *) Make sure the mysql version of dbd_mysql_get_entry() respects the rule that if the column number exceeds the number of columns, we return NULL. [Graham Leggett] - *) Make sure the LD_LIBRARY_PATH is sensible when running the tests - from the RPM build, so that the crypto, dbd and dbm tests pass. - Transfer the apr-util spec file contents to apr.spec. [Graham + *) Transfer the apr-util spec file contents to apr.spec. [Graham Leggett] *) Clarify the error messages within the dbd tests. [Graham Leggett] diff --git a/build/rpm/apr.spec.in b/build/rpm/apr.spec.in index 7fd208342cd..662ab4ca340 100644 --- a/build/rpm/apr.spec.in +++ b/build/rpm/apr.spec.in @@ -138,7 +138,7 @@ make %{?_smp_mflags} && make dox # Run non-interactive tests pushd test make %{?_smp_mflags} all CFLAGS=-fno-strict-aliasing -LD_LIBRARY_PATH=../crypto/.libs:../dbd/.libs:../dbm/.libs ./testall -v || exit 1 +make check || exit 1 popd %install From 917744027a6147243a35020d723ff89ddda74e5f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 29 Jul 2009 21:29:42 +0000 Subject: [PATCH 6515/7878] Drop incomplete abstrations from apr-2.0; for today, simply omit the ability to inspect ldap linkage binding. apr_ldap either needs to be refactored as a proper abstration or dropped from the apr 'suite' of portability abstractions, as previously discussed on list. This commit might encourge some forward progress to accomplishing this. Note there is nothing wrong with abstracting our build/autogunk m4 macros to the point where authors can borrow the logic when they want an apr-ish method of picking one of many interfaces. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@799085 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 5 ----- 1 file changed, 5 deletions(-) diff --git a/apr-config.in b/apr-config.in index e6b518137d2..84b407356b6 100644 --- a/apr-config.in +++ b/apr-config.in @@ -44,7 +44,6 @@ APR_BUILD_DIR="@apr_builddir@" APR_SO_EXT="@so_ext@" APR_LIB_TARGET="@export_lib_target@" APR_LIBNAME="@APR_LIBNAME@" -LDAP_LIBS="@LDADD_ldap@" # NOTE: the following line is modified during 'make install': alter with care! location=@APR_CONFIG_LOCATION@ @@ -65,7 +64,6 @@ Known values for OPTION are: --includes print include information --ldflags print linker flags --libs print additional libraries to link against - --ldap-libs print additional library information to link with ldap --srcdir print APR source directory --installbuilddir print APR build helper directory --link-ld print link switch(es) for linking to APR @@ -150,9 +148,6 @@ while test $# -gt 0; do --libs) flags="$flags $LIBS" ;; - --ldap-libs) - flags="$flags $LDAP_LIBS" - ;; --ldflags) flags="$flags $LDFLAGS" ;; From 48b841b380adbc94705983a288f22e6ca60cf3f8 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Fri, 31 Jul 2009 03:05:46 +0000 Subject: [PATCH 6516/7878] Pass default environment in testflock and testoc (for ICC compiled stuff). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@799497 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ test/testflock.c | 3 +++ test/testoc.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/CHANGES b/CHANGES index 937eb3d1965..71698ef2aa8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Pass default environment to testflock and testoc. + [Bojan Smojver] + *) Make sure that "make check" is used in the RPM spec file, so that the crypto, dbd and dbm tests pass. [Graham Leggett] diff --git a/test/testflock.c b/test/testflock.c index f4350590d86..136d9f649c0 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -39,6 +39,9 @@ static int launch_reader(abts_case *tc) APR_NO_PIPE); APR_ASSERT_SUCCESS(tc, "Couldn't set io in procattr", rv); + rv = apr_procattr_cmdtype_set(procattr, APR_PROGRAM_ENV); + APR_ASSERT_SUCCESS(tc, "Couldn't set copy environment", rv); + rv = apr_procattr_error_check_set(procattr, 1); APR_ASSERT_SUCCESS(tc, "Couldn't set error check in procattr", rv); diff --git a/test/testoc.c b/test/testoc.c index a5342b1f2dc..923bd4b6df6 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -73,6 +73,9 @@ static void test_child_kill(abts_case *tc, void *data) APR_NO_PIPE); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_procattr_cmdtype_set(procattr, APR_PROGRAM_ENV); + APR_ASSERT_SUCCESS(tc, "Couldn't set copy environment", rv); + rv = apr_proc_create(&newproc, TESTBINPATH "occhild" EXTENSION, args, NULL, procattr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, newproc.in); From e82e3b5266fda464c987cefef534950e894a55a5 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Fri, 31 Jul 2009 03:13:51 +0000 Subject: [PATCH 6517/7878] More precise comment about testflock and testoc changes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@799501 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 71698ef2aa8..05a3d470382 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,7 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) Pass default environment to testflock and testoc. + *) Pass default environment to testflock and testoc children. [Bojan Smojver] *) Make sure that "make check" is used in the RPM spec file, so that From 451cee5a1858cd5dbb11cc7b2067bfe669e79afe Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Sun, 2 Aug 2009 00:05:36 +0000 Subject: [PATCH 6518/7878] Improve change log for r799497. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@799964 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 05a3d470382..adf05a0c5b8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) Pass default environment to testflock and testoc children. + *) Pass default environment to testflock and testoc children, so that + tests run when APR is compiled with Intel C Compiler. [Bojan Smojver] *) Make sure that "make check" is used in the RPM spec file, so that From cd84ed2e8e0552b1313f0b86dee8d70e27299cc0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 3 Aug 2009 19:28:26 +0000 Subject: [PATCH 6519/7878] Reorder the config into sanity, prefer include/mysql/ structure if found, and *be consistent*. Includes rpluem's patch to maintain load order of these cleaned up includes. It appears my_sys.h is actually not required for my_init(), and it certainly won't compile under Visual C/Win32. So carefully omit it only on platforms where my_sys.h is not found/not usable, and retain the existing unix compilation. Forward ports: 799780, 800402, 800431 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@800505 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_mysql.c | 23 ++++++++++++----------- include/private/apu_config.hw | 6 ++++++ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c index 95a92477ade..482b82a96a6 100644 --- a/dbd/apr_dbd_mysql.c +++ b/dbd/apr_dbd_mysql.c @@ -15,7 +15,6 @@ */ #include "apu.h" -#define HAVE_MYSQL_MYSQL_H #if APU_HAVE_MYSQL @@ -25,22 +24,24 @@ #include #include -#ifdef HAVE_MY_GLOBAL_H -#include -#elif defined(HAVE_MYSQL_MY_GLOBAL_H) +#if defined(HAVE_MYSQL_MYSQL_H) +#if defined(HAVE_MYSQL_MY_GLOBAL_H) #include +#if defined(HAVE_MYSQL_MY_SYS_H) +#include +#endif #endif -#ifdef HAVE_MY_SYS_H +#include +#include +#else /* !defined(HAVE_MYSQL_MYSQL_H) */ +#if defined(HAVE_MY_GLOBAL_H) +#include +#if defined(HAVE_MY_SYS_H) #include -#elif defined(HAVE_MYSQL_MY_SYS_H) -#include #endif -#ifdef HAVE_MYSQL_H +#endif #include #include -#elif defined(HAVE_MYSQL_MYSQL_H) -#include -#include #endif #include "apr_strings.h" diff --git a/include/private/apu_config.hw b/include/private/apu_config.hw index 45b4c2af3e1..a4d9e3149e8 100644 --- a/include/private/apu_config.hw +++ b/include/private/apu_config.hw @@ -31,6 +31,12 @@ #define APU_DSO_BUILD 1 #endif +/* Presume a standard, modern (5.x) mysql sdk/ +#define HAVE_MY_GLOBAL_H 1 + +/* my_sys.h is broken on VC/Win32, and apparently not required */ +/* #undef HAVE_MY_SYS_H 0 */ + /* * Windows does not have GDBM, and we always use the bundled (new) Expat */ From de354b53fb0576f80216c67f49fa91617fddd90e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 3 Aug 2009 20:31:21 +0000 Subject: [PATCH 6520/7878] Reflect merger of apr-util/STATUS into apr/STATUS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@800539 13f79535-47bb-0310-9956-ffa450edef68 --- README | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/README b/README index 5fa59bfb736..a49c84e6041 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ Apache Portable Runtime Library (APR) -------------------------------------- +===================================== The Apache Portable Runtime Library provides a predictable and consistent interface to underlying platform-specific @@ -35,6 +35,26 @@ Apache Portable Runtime Library (APR) Thread and Process management Various data structures (tables, hashes, priority queues, etc) + APR 2.0 also provides a number of utility functions and library + compatibility interfaces. These were formerly part of APR-util, + a seperate utility library in version 1 releases. These include; + + Hashing and UUID services + Multiple SQL DBD client interfaces + Multiple flat-database DBM client interfaces + Typesafe function Hooks abstraction + LDAP SSL connections for a variety of LDAP toolkits + MemCache interface + Date parsing rourtines + Resource Lists + Thread Pools + Queues + Relocatable Memory Management functions + String filename-style pattern matching + URI Parsing + Charset translation (iconv based) + XML parsing (expat based) + For a more complete list, please refer to the following URLs: http://apr.apache.org/docs/apr/modules.html @@ -55,6 +75,20 @@ Apache Portable Runtime Library (APR) if you find our libraries useful in your own projects! +Database Providers +================== +Interfaces for copy-left licensed MySQL and gdbm DBD drivers, and +Berkeley DB DBM all ship as part of the distribution. To avoid licensing +incompatibilities, these are not built by default. To enable support, +the corresponding use the --with-{provider} option, but be aware that +these licenses may introduce licensing implications for your compiled code. +Similarly, the bindings for propritary drivers such as Oracle must also be +explicitly enabled. + +Whenever distributing apr-util in combination with database client +drivers, always review the license requirements of all components. + + Using a Subversion Checkout on Unix =================================== @@ -133,6 +167,11 @@ simply link to libapr.lib. To use it as a static library, simply define APR_DECLARE_STATIC before you include any apr header files in your source, and link to apr.lib instead. +On windows, selection of database drivers is via the environment values +DBD_LIST (for freetds, mysql, oracle, pgsql, sqlite2 and/or sqlite3) +and DBM_LIST (db and/or gdbm). DBD odbc and DBM sdbm are unconditionally +compiled and installed, do not include these in the list. + Generating Test Coverage information with gcc ============================================= @@ -149,3 +188,32 @@ If you want to generate test coverage data, use the following steps: make gcov +Cryptographic Software Notice +============================= +This distribution includes cryptographic software. The country in +which you currently reside may have restrictions on the import, +possession, use, and/or re-export to another country, of +encryption software. BEFORE using any encryption software, please +check your country's laws, regulations and policies concerning the +import, possession, or use, and re-export of encryption software, to +see if this is permitted. See http://www.wassenaar.org/ for more +information. + +The U.S. Government Department of Commerce, Bureau of Industry and +Security (BIS), has classified this software as Export Commodity +Control Number (ECCN) 5D002.C.1, which includes information security +software using or performing cryptographic functions with asymmetric +algorithms. The form and manner of this Apache Software Foundation +distribution makes it eligible for export under the License Exception +ENC Technology Software Unrestricted (TSU) exception (see the BIS +Export Administration Regulations, Section 740.13) for both object +code and source code. + +The following provides more details on the included cryptographic +software: + + APR-Util provides an abstract interface for SSL encrypted LDAP (ldaps + and STARTTLS style) connections, which can be powered by OpenLDAP, + Netscape LDAP SDK, Mozilla LDAP SDK, or other platform specific ldap + interfaces. + From 48ba019274c7140f75123d71575b25bc91c9eeb8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 3 Aug 2009 21:37:28 +0000 Subject: [PATCH 6521/7878] flesh out STATUS similar to http, prepare to rm apr-util git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@800578 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/STATUS b/STATUS index f53ee2f9b2a..3f58b93a05c 100644 --- a/STATUS +++ b/STATUS @@ -1,6 +1,24 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*- coding: utf-8 -*- Last modified at [$Date$] +The current version of this file can be found at: + + * http://svn.apache.org/repos/asf/apr/apr/trunk/STATUS + +Effective with version 2.0 , apr-util ceases to exist. For reference, +the final standalone apr-util can be found in subversion at: + + * http://svn.apache.org/repos/asf/apr/apr-util/branches -r784519 + +Patches considered for backport are noted in their branches' STATUS: + + * http://svn.apache.org/repos/asf/apr/apr/branches/0.9.x/STATUS + * http://svn.apache.org/repos/asf/apr/apr/branches/1.3.x/STATUS + * http://svn.apache.org/repos/asf/apr/apr/branches/1.4.x/STATUS + * http://svn.apache.org/repos/asf/apr/apr-util/branches/0.9.x/STATUS + * http://svn.apache.org/repos/asf/apr/apr-util/branches/1.3.x/STATUS + * http://svn.apache.org/repos/asf/apr/apr-util/branches/1.4.x/STATUS + Releases: 2.0.0 : in development on trunk/ 1.4.0 : in development on branches/1.4.x/ @@ -58,9 +76,27 @@ Bundled with httpd: 2.0a2 : released March 31, 2000 2.0a1 : released March 10, 2000 +Contributors looking for a mission: + + * Just do an egrep on "TODO" or "XXX" in the source. + + * Review the bug database at: http://issues.apache.org/bugzilla/ + + * Review the "PatchAvailable" bugs in the bug database: + + https://issues.apache.org/bugzilla/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&product=APR&keywords=PatchAvailable + + After testing, you can append a comment saying "Reviewed and tested". + + * Open bugs in the bug database. + RELEASE SHOWSTOPPERS: + * Refactor apr_ldap as a proper/complete API. [Effective now, apr-2-config + no longer exports -lldap (-llber).] Brownie points for making these + DSO pluggable providers against the various SDK's/Toolkits. + CURRENT VOTES: From 47fd2c19390741020f09cc235d3ee649a0c501c4 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Mon, 3 Aug 2009 23:45:27 +0000 Subject: [PATCH 6522/7878] One more place where passing in the environment may help with ICC. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@800627 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++-- test/testpipe.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index adf05a0c5b8..cc47a0c08cf 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) Pass default environment to testflock and testoc children, so that - tests run when APR is compiled with Intel C Compiler. + *) Pass default environment to testflock, testoc and testpipe children, + so that tests run when APR is compiled with Intel C Compiler. [Bojan Smojver] *) Make sure that "make check" is used in the RPM spec file, so that diff --git a/test/testpipe.c b/test/testpipe.c index 819c8aa2769..a89d3d83151 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -146,6 +146,9 @@ static void test_pipe_writefull(abts_case *tc, void *data) APR_CHILD_BLOCK); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_procattr_cmdtype_set(procattr, APR_PROGRAM_ENV); + APR_ASSERT_SUCCESS(tc, "Couldn't set copy environment", rv); + rv = apr_procattr_error_check_set(procattr, 1); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); From 1933008dc57ed89520ceb75f45132e1eaade4c1d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 4 Aug 2009 11:33:08 +0000 Subject: [PATCH 6523/7878] SECURITY: CVE-2009-2412 (cve.mitre.org) Fix overflow in pools and rmm, where size alignment was taking place. Reported by: Matt Lewis * CHANGES Add entry for CVE-2009-2412. * memory/unix/apr_pools.c (allocator_alloc, apr_palloc): Check for overflow after aligning size. (apr_pcalloc): Drop aligning of size; clearing what the caller asked for should suffice. * util-misc/apr_rmm.c (apr_rmm_malloc, apr_rmm_calloc, apr_rmm_realloc): Check for overflow after aligning size. Submitted by: Matt Lewis , Sander Striker git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@800730 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ memory/unix/apr_pools.c | 22 +++++++++++++++------- util-misc/apr_rmm.c | 29 ++++++++++++++++++++--------- 3 files changed, 39 insertions(+), 16 deletions(-) diff --git a/CHANGES b/CHANGES index cc47a0c08cf..0c498d0154a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) SECURITY: CVE-2009-2412 (cve.mitre.org) + Fix overflow in pools and rmm, where size alignment was taking place. + [Matt Lewis , Sander Striker] + *) Pass default environment to testflock, testoc and testpipe children, so that tests run when APR is compiled with Intel C Compiler. [Bojan Smojver] diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index a4fe887d685..1a783d118df 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -191,16 +191,19 @@ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, } static APR_INLINE -apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size) +apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) { apr_memnode_t *node, **ref; apr_uint32_t max_index; - apr_size_t i, index; + apr_size_t size, i, index; /* Round up the block size to the next boundary, but always * allocate at least a certain size (MIN_ALLOC). */ - size = APR_ALIGN(size + APR_MEMNODE_T_SIZE, BOUNDARY_SIZE); + size = APR_ALIGN(in_size + APR_MEMNODE_T_SIZE, BOUNDARY_SIZE); + if (size < in_size) { + return NULL; + } if (size < MIN_ALLOC) size = MIN_ALLOC; @@ -628,13 +631,19 @@ APR_DECLARE(void) apr_pool_terminate(void) * Memory allocation */ -APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) +APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t in_size) { apr_memnode_t *active, *node; void *mem; - apr_size_t free_index; + apr_size_t size, free_index; - size = APR_ALIGN_DEFAULT(size); + size = APR_ALIGN_DEFAULT(in_size); + if (size < in_size) { + if (pool->abort_fn) + pool->abort_fn(APR_ENOMEM); + + return NULL; + } active = pool->active; /* If the active node has enough bytes left, use it. */ @@ -699,7 +708,6 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) { void *mem; - size = APR_ALIGN_DEFAULT(size); if ((mem = apr_palloc(pool, size)) != NULL) { memset(mem, 0, size); } diff --git a/util-misc/apr_rmm.c b/util-misc/apr_rmm.c index e90be1e7c46..91e30885fc2 100644 --- a/util-misc/apr_rmm.c +++ b/util-misc/apr_rmm.c @@ -306,13 +306,17 @@ APR_DECLARE(apr_status_t) apr_rmm_detach(apr_rmm_t *rmm) APR_DECLARE(apr_rmm_off_t) apr_rmm_malloc(apr_rmm_t *rmm, apr_size_t reqsize) { + apr_size_t size; apr_rmm_off_t this; - reqsize = APR_ALIGN_DEFAULT(reqsize) + RMM_BLOCK_SIZE; + size = APR_ALIGN_DEFAULT(reqsize) + RMM_BLOCK_SIZE; + if (size < reqsize) { + return 0; + } APR_ANYLOCK_LOCK(&rmm->lock); - this = find_block_of_size(rmm, reqsize); + this = find_block_of_size(rmm, size); if (this) { move_block(rmm, this, 0); @@ -325,18 +329,22 @@ APR_DECLARE(apr_rmm_off_t) apr_rmm_malloc(apr_rmm_t *rmm, apr_size_t reqsize) APR_DECLARE(apr_rmm_off_t) apr_rmm_calloc(apr_rmm_t *rmm, apr_size_t reqsize) { + apr_size_t size; apr_rmm_off_t this; - reqsize = APR_ALIGN_DEFAULT(reqsize) + RMM_BLOCK_SIZE; + size = APR_ALIGN_DEFAULT(reqsize) + RMM_BLOCK_SIZE; + if (size < reqsize) { + return 0; + } APR_ANYLOCK_LOCK(&rmm->lock); - this = find_block_of_size(rmm, reqsize); + this = find_block_of_size(rmm, size); if (this) { move_block(rmm, this, 0); this += RMM_BLOCK_SIZE; - memset((char*)rmm->base + this, 0, reqsize - RMM_BLOCK_SIZE); + memset((char*)rmm->base + this, 0, size - RMM_BLOCK_SIZE); } APR_ANYLOCK_UNLOCK(&rmm->lock); @@ -349,16 +357,19 @@ APR_DECLARE(apr_rmm_off_t) apr_rmm_realloc(apr_rmm_t *rmm, void *entity, apr_rmm_off_t this; apr_rmm_off_t old; struct rmm_block_t *blk; - apr_size_t oldsize; + apr_size_t size, oldsize; if (!entity) { return apr_rmm_malloc(rmm, reqsize); } - reqsize = APR_ALIGN_DEFAULT(reqsize); + size = APR_ALIGN_DEFAULT(reqsize); + if (size < reqsize) { + return 0; + } old = apr_rmm_offset_get(rmm, entity); - if ((this = apr_rmm_malloc(rmm, reqsize)) == 0) { + if ((this = apr_rmm_malloc(rmm, size)) == 0) { return 0; } @@ -366,7 +377,7 @@ APR_DECLARE(apr_rmm_off_t) apr_rmm_realloc(apr_rmm_t *rmm, void *entity, oldsize = blk->size; memcpy(apr_rmm_addr_get(rmm, this), - apr_rmm_addr_get(rmm, old), oldsize < reqsize ? oldsize : reqsize); + apr_rmm_addr_get(rmm, old), oldsize < size ? oldsize : size); apr_rmm_free(rmm, old); return this; From 1f474efc679de335f256e3a706ba1872e4abd6b6 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Fri, 14 Aug 2009 10:58:24 +0000 Subject: [PATCH 6524/7878] Remove stray semicolon in OS/2 version of apr_pollset_create_ex() that breaks the build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@804160 13f79535-47bb-0310-9956-ffa450edef68 --- poll/os2/pollset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c index a358fafb27c..e77dc9a3e8a 100644 --- a/poll/os2/pollset.c +++ b/poll/os2/pollset.c @@ -55,7 +55,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags, - apr_pollset_method_e method); + apr_pollset_method_e method) { return apr_pollset_create(pollset, size, p, flags); } From bea26138518cafee91a6e1fbcfff5a61d592c05a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 24 Aug 2009 15:02:05 +0000 Subject: [PATCH 6525/7878] Fix an error handling issue in the Event Port backend for APR pollsets. (ETIME is sometimes reported along with an event.) PR: 47645 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@807263 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 112 +++++++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 52 deletions(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index 468131f4d9e..6e33196de12 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -86,6 +86,58 @@ struct apr_pollset_private_t volatile apr_uint32_t waiting; }; +static apr_status_t call_port_getn(int port, port_event_t list[], + unsigned int max, unsigned int *nget, + apr_interval_time_t timeout) +{ + struct timespec tv, *tvptr; + int ret; + apr_status_t rv = APR_SUCCESS; + + if (timeout < 0) { + tvptr = NULL; + } + else { + tv.tv_sec = (long) apr_time_sec(timeout); + tv.tv_nsec = (long) apr_time_usec(timeout) * 1000; + tvptr = &tv; + } + + ret = port_getn(port, list, max, nget, tvptr); + + if (ret < 0) { + rv = apr_get_netos_error(); + + switch(rv) { + case EINTR: + case ETIME: + if (*nget > 0) { + /* This confusing API can return an event at the same time + * that it reports EINTR or ETIME. If that occurs, just + * report the event. + * (Maybe it will be simplified; see thread + * http://mail.opensolaris.org + * /pipermail/networking-discuss/2009-August/011979.html + * This code will still work afterwards.) + */ + rv = APR_SUCCESS; + break; + } + if (rv == ETIME) { + rv = APR_TIMEUP; + } + /* fall-through */ + default: + *nget = 0; + } + } + else if (*nget == 0) { + rv = APR_TIMEUP; + } + + return rv; +} + static apr_status_t impl_pollset_cleanup(apr_pollset_t *pollset) { close(pollset->p->port_fd); @@ -288,19 +340,9 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, int ret, i, j; unsigned int nget; pfd_elem_t *ep; - struct timespec tv, *tvptr; apr_status_t rv = APR_SUCCESS; apr_pollfd_t fp; - if (timeout < 0) { - tvptr = NULL; - } - else { - tv.tv_sec = (long) apr_time_sec(timeout); - tv.tv_nsec = (long) apr_time_usec(timeout) * 1000; - tvptr = &tv; - } - nget = 1; pollset_lock_rings(); @@ -337,27 +379,15 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, return rv; } - ret = port_getn(pollset->p->port_fd, pollset->p->port_set, pollset->nalloc, - &nget, tvptr); + rv = call_port_getn(pollset->p->port_fd, pollset->p->port_set, + pollset->nalloc, &nget, timeout); /* decrease the waiting ASAP to reduce the window for calling port_associate within apr_pollset_add() */ apr_atomic_dec32(&pollset->p->waiting); - (*num) = nget; - if (ret == -1) { - (*num) = 0; - if (errno == ETIME) { - rv = APR_TIMEUP; - } - else { - rv = apr_get_netos_error(); - } - } - else if (nget == 0) { - rv = APR_TIMEUP; - } - else { + (*num) = nget; + if (nget) { pollset_lock_rings(); @@ -502,36 +532,14 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, apr_pollcb_cb_t func, void *baton) { - int ret; apr_pollfd_t *pollfd; - struct timespec tv, *tvptr; - apr_status_t rv = APR_SUCCESS; + apr_status_t rv; unsigned int i, nget = pollcb->nalloc; - if (timeout < 0) { - tvptr = NULL; - } - else { - tv.tv_sec = (long) apr_time_sec(timeout); - tv.tv_nsec = (long) apr_time_usec(timeout) * 1000; - tvptr = &tv; - } + rv = call_port_getn(pollcb->fd, pollcb->pollset.port, pollcb->nalloc, + &nget, timeout); - ret = port_getn(pollcb->fd, pollcb->pollset.port, pollcb->nalloc, - &nget, tvptr); - - if (ret == -1) { - if (errno == ETIME) { - rv = APR_TIMEUP; - } - else { - rv = apr_get_netos_error(); - } - } - else if (nget == 0) { - rv = APR_TIMEUP; - } - else { + if (nget) { for (i = 0; i < nget; i++) { pollfd = (apr_pollfd_t *)(pollcb->pollset.port[i].portev_user); pollfd->rtnevents = get_revent(pollcb->pollset.port[i].portev_events); From 3639a05ba4894762e8508b20387a05c073e504de Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 31 Aug 2009 20:53:22 +0000 Subject: [PATCH 6526/7878] Ugly hack... for Darwin 10.0.0, off_t is long long git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@809741 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure.in b/configure.in index 429a42e8210..1f184f8bb85 100644 --- a/configure.in +++ b/configure.in @@ -1636,6 +1636,13 @@ elif test "$ac_cv_type_off_t" = "yes"; then else AC_ERROR([could not determine the size of off_t]) fi + # + case $host in + *darwin10.0.0) + if test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_long_long"; then + off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' + fi ;; + esac else # Fallback on int off_t_value=apr_int32_t From 25938355e1f3aa0af779e0ae8861f789fc650768 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 31 Aug 2009 20:55:09 +0000 Subject: [PATCH 6527/7878] Ooops... didn't mean that. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@809743 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 7 ------- 1 file changed, 7 deletions(-) diff --git a/configure.in b/configure.in index 1f184f8bb85..429a42e8210 100644 --- a/configure.in +++ b/configure.in @@ -1636,13 +1636,6 @@ elif test "$ac_cv_type_off_t" = "yes"; then else AC_ERROR([could not determine the size of off_t]) fi - # - case $host in - *darwin10.0.0) - if test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_long_long"; then - off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' - fi ;; - esac else # Fallback on int off_t_value=apr_int32_t From 200406e2ed6469c9f76b72b7cea5a7d26542ec3e Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 31 Aug 2009 21:13:24 +0000 Subject: [PATCH 6528/7878] This is the right one... Fix APR_OFF_T_FMT which is lld for OS X 10.6 (darwin 10.0.0) since off_t ends up as a long long. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@809745 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure.in b/configure.in index 429a42e8210..9e4762ce504 100644 --- a/configure.in +++ b/configure.in @@ -1636,6 +1636,15 @@ elif test "$ac_cv_type_off_t" = "yes"; then else AC_ERROR([could not determine the size of off_t]) fi + # Per OS tuning... + case $host in + *apple-darwin10.0.0) + # off_t is a long long, but long == long long + if test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_long_long"; then + off_t_fmt='#define APR_OFF_T_FMT "lld"' + fi + ;; + esac else # Fallback on int off_t_value=apr_int32_t From fa220f843123a850d06b681c9a090ec63f34a194 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 1 Sep 2009 01:57:13 +0000 Subject: [PATCH 6529/7878] Enable KQueue on OS X 10.6+ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@809796 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 3b2ba48c423..fe66cf3410c 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -195,13 +195,12 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp]) APR_SETIFNULL(apr_posixsem_is_global, [yes]) case $host in - *-apple-darwin*) + *-apple-darwin[[0-9]]*) # APR's use of kqueue has triggered kernel panics for some # 10.5.x (Darwin 9.x) users when running the entire test suite. # In 10.4.x, use of kqueue would cause the socket tests to hang. + # 10.6+ is supposed to fix the KQueue issues APR_SETIFNULL(ac_cv_func_kqueue, [no]) - ;; - *-apple-darwin[[0-8]].*) APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332 ;; esac From 69e00f2827c7712c0b7644fa5de91f2100c6cfdd Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 1 Sep 2009 02:12:28 +0000 Subject: [PATCH 6530/7878] Fix regex to catch Darwin 1.x->9.x, but not darwin 10.x git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@809798 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index fe66cf3410c..680cbf4b614 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -195,11 +195,11 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp]) APR_SETIFNULL(apr_posixsem_is_global, [yes]) case $host in - *-apple-darwin[[0-9]]*) - # APR's use of kqueue has triggered kernel panics for some + *-apple-darwin[[1-9]].*) + # APR's use of kqueue has triggered kernel panics for some # 10.5.x (Darwin 9.x) users when running the entire test suite. # In 10.4.x, use of kqueue would cause the socket tests to hang. - # 10.6+ is supposed to fix the KQueue issues + # 10.6+ (Darwin 10.x is supposed to fix the KQueue issues APR_SETIFNULL(ac_cv_func_kqueue, [no]) APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332 ;; From 73d9f9315affe35706e08aec9aa342214e58a501 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Tue, 1 Sep 2009 06:49:07 +0000 Subject: [PATCH 6531/7878] Pass environment to children in testsock, testshm and testproc. Further fixes for PR 47590. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@809854 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 +++--- test/testproc.c | 4 ++-- test/testshm.c | 8 ++++++++ test/testsock.c | 3 +++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 0c498d0154a..5e0923e0f17 100644 --- a/CHANGES +++ b/CHANGES @@ -5,9 +5,9 @@ Changes for APR 2.0.0 Fix overflow in pools and rmm, where size alignment was taking place. [Matt Lewis , Sander Striker] - *) Pass default environment to testflock, testoc and testpipe children, - so that tests run when APR is compiled with Intel C Compiler. - [Bojan Smojver] + *) Pass default environment to testflock, testoc, testpipe, testsock, + testshm and testproc children, so that tests run when APR is compiled + with Intel C Compiler. [Bojan Smojver] *) Make sure that "make check" is used in the RPM spec file, so that the crypto, dbd and dbm tests pass. [Graham Leggett] diff --git a/test/testproc.c b/test/testproc.c index 4791b928197..5cf768f1eec 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -44,7 +44,7 @@ static void test_create_proc(abts_case *tc, void *data) rv = apr_procattr_dir_set(attr, "data"); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_procattr_cmdtype_set(attr, APR_PROGRAM); + rv = apr_procattr_cmdtype_set(attr, APR_PROGRAM_ENV); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); args[0] = "proc_child" EXTENSION; @@ -120,7 +120,7 @@ static void test_file_redir(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_procattr_dir_set(attr, "data"); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_procattr_cmdtype_set(attr, APR_PROGRAM); + rv = apr_procattr_cmdtype_set(attr, APR_PROGRAM_ENV); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); args[0] = "proc_child"; diff --git a/test/testshm.c b/test/testshm.c index ab9b76c21a7..6c192f290fb 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -185,6 +185,10 @@ static void test_named(abts_case *tc, void *data) rv = apr_procattr_create(&attr1, p); ABTS_PTR_NOTNULL(tc, attr1); APR_ASSERT_SUCCESS(tc, "Couldn't create attr1", rv); + + rv = apr_procattr_cmdtype_set(attr1, APR_PROGRAM_ENV); + APR_ASSERT_SUCCESS(tc, "Couldn't set copy environment", rv); + args[0] = apr_pstrdup(p, "testshmproducer" EXTENSION); args[1] = NULL; rv = apr_proc_create(&pidproducer, TESTBINPATH "testshmproducer" EXTENSION, args, @@ -194,6 +198,10 @@ static void test_named(abts_case *tc, void *data) rv = apr_procattr_create(&attr2, p); ABTS_PTR_NOTNULL(tc, attr2); APR_ASSERT_SUCCESS(tc, "Couldn't create attr2", rv); + + rv = apr_procattr_cmdtype_set(attr2, APR_PROGRAM_ENV); + APR_ASSERT_SUCCESS(tc, "Couldn't set copy environment", rv); + args[0] = apr_pstrdup(p, "testshmconsumer" EXTENSION); rv = apr_proc_create(&pidconsumer, TESTBINPATH "testshmconsumer" EXTENSION, args, NULL, attr2, p); diff --git a/test/testsock.c b/test/testsock.c index 1b19141ad1d..a2d5319239b 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -45,6 +45,9 @@ static void launch_child(abts_case *tc, apr_proc_t *proc, const char *arg1, apr_ rv = apr_procattr_error_check_set(procattr, 1); APR_ASSERT_SUCCESS(tc, "Couldn't set error check in procattr", rv); + rv = apr_procattr_cmdtype_set(procattr, APR_PROGRAM_ENV); + APR_ASSERT_SUCCESS(tc, "Couldn't set copy environment", rv); + args[0] = "sockchild" EXTENSION; args[1] = arg1; args[2] = socket_name; From 9afb09d3c2a1c6b1b644fb3815a79ac194dedd59 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 2 Sep 2009 12:10:54 +0000 Subject: [PATCH 6532/7878] predict future and keep mr rowe happy git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@810472 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 9e4762ce504..3366f509f67 100644 --- a/configure.in +++ b/configure.in @@ -1638,7 +1638,7 @@ elif test "$ac_cv_type_off_t" = "yes"; then fi # Per OS tuning... case $host in - *apple-darwin10.0.0) + *apple-darwin10.*) # off_t is a long long, but long == long long if test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_long_long"; then off_t_fmt='#define APR_OFF_T_FMT "lld"' From 39fb29b31270fd245317a78093457238133c0b77 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 4 Sep 2009 15:53:16 +0000 Subject: [PATCH 6533/7878] Allow for passed locknames to be honored with posix-sems. Still maintain posix-sem naming conventions tho! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@811455 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 50 ++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index aac83be2711..e993939b31d 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -18,6 +18,7 @@ #include "apr_strings.h" #include "apr_arch_proc_mutex.h" #include "apr_arch_file_io.h" /* for apr_mkstemp() */ +#include "apr_md5.h" /* for apr_md5() */ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) { @@ -65,11 +66,10 @@ static apr_status_t proc_mutex_posix_cleanup(void *mutex_) static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, const char *fname) { + #define APR_POSIXSEM_NAME_MAX 30 + #define APR_POSIXSEM_NAME_MIN 13 sem_t *psem; - char semname[31]; - apr_time_t now; - unsigned long sec; - unsigned long usec; + char semname[34]; /* APR_MD5_DIGESTSIZE*2 + 2 */ new_mutex->interproc = apr_palloc(new_mutex->pool, sizeof(*new_mutex->interproc)); @@ -80,28 +80,46 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, * - be at most 14 chars * - be unique and not match anything on the filesystem * - * Because of this, we ignore fname, and try our - * own naming system. We tuck the name away, since it might - * be useful for debugging. to make this as robust as possible, - * we initially try something larger (and hopefully more unique) - * and gracefully fail down to the LCD above. + * Because of this, we use fname to generate an md5 hex checksum + * and use that as the name of the semaphore. If no filename was + * given, we create one based on the time. We tuck the name + * away, since it might be useful for debugging. + * + * To make this as robust as possible, we initially try something + * larger (and hopefully more unique) and gracefully fail down to the + * LCD above. * * NOTE: Darwin (Mac OS X) seems to be the most restrictive * implementation. Versions previous to Darwin 6.2 had the 14 * char limit, but later rev's allow up to 31 characters. * */ - now = apr_time_now(); - sec = apr_time_sec(now); - usec = apr_time_usec(now); - apr_snprintf(semname, sizeof(semname), "/ApR.%lxZ%lx", sec, usec); + if (fname) { + unsigned char digest[APR_MD5_DIGESTSIZE]; /* note dependency on semname here */ + const char *hex = "0123456789abcdef"; + char *p = semname; + int i; + apr_md5(digest, fname, strlen(fname)); + *p++ = '/'; /* must start with /, right? */ + for (i = 0; i < sizeof(digest); i++) { + *p++ = hex[digest[i] >> 4]; + *p++ = hex[digest[i] & 0xF]; + } + semname[APR_POSIXSEM_NAME_MAX] = '\0'; + } else { + apr_time_t now; + unsigned long sec; + unsigned long usec; + now = apr_time_now(); + sec = apr_time_sec(now); + usec = apr_time_usec(now); + apr_snprintf(semname, sizeof(semname), "/ApR.%lxZ%lx", sec, usec); + } psem = sem_open(semname, O_CREAT | O_EXCL, 0644, 1); if (psem == (sem_t *)SEM_FAILED) { if (errno == ENAMETOOLONG) { /* Oh well, good try */ - semname[13] = '\0'; - } else if (errno == EEXIST) { - apr_snprintf(semname, sizeof(semname), "/ApR.%lxZ%lx", usec, sec); + semname[APR_POSIXSEM_NAME_MIN] = '\0'; } else { return errno; } From ad8b3ae92a00a953316dd138ad74834a1c9a38a2 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 9 Sep 2009 17:35:34 +0000 Subject: [PATCH 6534/7878] Fix spacing around apr_crypto_driver_name() as it was causing a link failure by including a space in the symbol name in the generated export file ApacheCoreOS2.def. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@813055 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_crypto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_crypto.h b/include/apr_crypto.h index 20745080622..fa94a04bb16 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -219,7 +219,7 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver(apr_pool_t *pool, const char *na * @param driver - The driver in use. * @return The name of the driver. */ -APR_DECLARE(const char *)apr_crypto_driver_name (const apr_crypto_driver_t *driver); +APR_DECLARE(const char *) apr_crypto_driver_name(const apr_crypto_driver_t *driver); /** * @brief Get the result of the last operation on a factory. If the result From 2928c4aff5e451ec31d2f2ec01c6e7155724b77d Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 9 Sep 2009 17:43:57 +0000 Subject: [PATCH 6535/7878] OS/2: Add "not implemented" stub for apr_file_link() as OS/2 doesn't support links. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@813056 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/link.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 file_io/os2/link.c diff --git a/file_io/os2/link.c b/file_io/os2/link.c new file mode 100644 index 00000000000..5487df17c45 --- /dev/null +++ b/file_io/os2/link.c @@ -0,0 +1,23 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_arch_file_io.h" + +APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, const char *to_path) +{ + /* OS/2 doesn't support links */ + return APR_ENOTIMPL; +} From 61dfa2b18a880177ee29ccf8902638368b30efaf Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 9 Sep 2009 18:10:17 +0000 Subject: [PATCH 6536/7878] just use it :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@813063 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index e993939b31d..71d321d97a9 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -69,7 +69,7 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, #define APR_POSIXSEM_NAME_MAX 30 #define APR_POSIXSEM_NAME_MIN 13 sem_t *psem; - char semname[34]; /* APR_MD5_DIGESTSIZE*2 + 2 */ + char semname[APR_MD5_DIGESTSIZE * 2 + 2]; new_mutex->interproc = apr_palloc(new_mutex->pool, sizeof(*new_mutex->interproc)); From e557a54f6f9107ff1e6d87d4f9220e437c88e32d Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Wed, 9 Sep 2009 18:46:05 +0000 Subject: [PATCH 6537/7878] Add comments describing the thread-safety properties of apr_pool_t. Submitted by: Neil Conway nrc cs.berkeley.edu git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@813071 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_pools.h | 24 +++++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 5e0923e0f17..8bca2b71f7f 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,9 @@ Changes for APR 2.0.0 Fix overflow in pools and rmm, where size alignment was taking place. [Matt Lewis , Sander Striker] + *) Add comments describing the thread-safety properties of apr_pool_t. + [Neil Conway nrc cs.berkeley.edu] + *) Pass default environment to testflock, testoc, testpipe, testsock, testshm and testproc children, so that tests run when APR is compiled with Intel C Compiler. [Bojan Smojver] diff --git a/include/apr_pools.h b/include/apr_pools.h index 071ff685ca7..956e4568c61 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -28,10 +28,16 @@ * particularly in the presence of die()). * * Instead, we maintain pools, and allocate items (both memory and I/O - * handlers) from the pools --- currently there are two, one for per - * transaction info, and one for config info. When a transaction is over, - * we can delete everything in the per-transaction apr_pool_t without fear, - * and without thinking too hard about it either. + * handlers) from the pools --- currently there are two, one for + * per-transaction info, and one for config info. When a transaction is + * over, we can delete everything in the per-transaction apr_pool_t without + * fear, and without thinking too hard about it either. + * + * Note that most operations on pools are not thread-safe: a single pool + * should only be accessed by a single thread at any given time. The one + * exception to this rule is creating a subpool of a given pool: one or more + * threads can safely create subpools at the same time that another thread + * accesses the parent pool. */ #include "apr.h" @@ -182,6 +188,10 @@ APR_DECLARE(void) apr_pool_terminate(void); * @param abort_fn A function to use if the pool cannot allocate more memory. * @param allocator The allocator to use with the new pool. If NULL the * allocator of the parent pool will be used. + * @remark This function is thread-safe, in the sense that multiple threads + * can safely create subpools of the same parent pool concurrently. + * Similarly, a subpool can be created by one thread at the same + * time that another thread accesses the parent pool. */ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *parent, @@ -291,6 +301,10 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpoo * pool. If it is non-NULL, the new pool will inherit all * of its parent pool's attributes, except the apr_pool_t will * be a sub-pool. + * @remark This function is thread-safe, in the sense that multiple threads + * can safely create subpools of the same parent pool concurrently. + * Similarly, a subpool can be created by one thread at the same + * time that another thread accesses the parent pool. */ #if defined(DOXYGEN) APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, @@ -330,7 +344,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool); #endif /** - * Find the pools allocator + * Find the pool's allocator * @param pool The pool to get the allocator from. */ APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool); From c173d490af5998f8dad8388b825e53d27d8a481b Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Wed, 9 Sep 2009 19:08:31 +0000 Subject: [PATCH 6538/7878] Clarify the return code for apr_dir_read. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@813081 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index bbcff8ac0d1..94e84e87635 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -261,7 +261,8 @@ APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir); * * @note If @c APR_INCOMPLETE is returned all the fields in @a finfo may * not be filled in, and you need to check the @c finfo->valid bitmask - * to verify that what you're looking for is there. + * to verify that what you're looking for is there. When no more + * entries are available, APR_ENOENT is returned. */ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_dir_t *thedir); From 3923c49ba6ac0026758d085d91c634fe845ae4b0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Sep 2009 22:48:53 +0000 Subject: [PATCH 6539/7878] Revert r799085 for now; vote on the list was to retain this functionality until the APR 2.0.0 rollout, to help ease developers into a new ldap interface, or to drop the ldap interface altogether. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@813152 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apr-config.in b/apr-config.in index 84b407356b6..e6b518137d2 100644 --- a/apr-config.in +++ b/apr-config.in @@ -44,6 +44,7 @@ APR_BUILD_DIR="@apr_builddir@" APR_SO_EXT="@so_ext@" APR_LIB_TARGET="@export_lib_target@" APR_LIBNAME="@APR_LIBNAME@" +LDAP_LIBS="@LDADD_ldap@" # NOTE: the following line is modified during 'make install': alter with care! location=@APR_CONFIG_LOCATION@ @@ -64,6 +65,7 @@ Known values for OPTION are: --includes print include information --ldflags print linker flags --libs print additional libraries to link against + --ldap-libs print additional library information to link with ldap --srcdir print APR source directory --installbuilddir print APR build helper directory --link-ld print link switch(es) for linking to APR @@ -148,6 +150,9 @@ while test $# -gt 0; do --libs) flags="$flags $LIBS" ;; + --ldap-libs) + flags="$flags $LDAP_LIBS" + ;; --ldflags) flags="$flags $LDFLAGS" ;; From 829c009316ab6be41e96f586a8097103e0b36d50 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Sep 2009 23:04:33 +0000 Subject: [PATCH 6540/7878] update status git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@813162 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/STATUS b/STATUS index 3f58b93a05c..2ffd5d452a1 100644 --- a/STATUS +++ b/STATUS @@ -93,10 +93,9 @@ Contributors looking for a mission: RELEASE SHOWSTOPPERS: - * Refactor apr_ldap as a proper/complete API. [Effective now, apr-2-config - no longer exports -lldap (-llber).] Brownie points for making these - DSO pluggable providers against the various SDK's/Toolkits. - + * Refactor apr_ldap as a proper/complete API. Brownie points for making + these into DSO pluggable providers against the various SDK's/Toolkits. + Either re-apply r799085, or drop apr_ldap before 2.0.0, per vote on dev@ CURRENT VOTES: From 81e861ab880d677f11f6a3ba6fa161f2c86d4057 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 19 Sep 2009 15:10:03 +0000 Subject: [PATCH 6541/7878] Add support for Berkeley DB 4.8. Submitted by: Arfrever Frehtes Taifersar Arahesis git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@816935 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ build/dbm.m4 | 70 ++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 54 insertions(+), 19 deletions(-) diff --git a/CHANGES b/CHANGES index 8bca2b71f7f..0248e7e515a 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,9 @@ Changes for APR 2.0.0 Fix overflow in pools and rmm, where size alignment was taking place. [Matt Lewis , Sander Striker] + *) Add support for Berkeley DB 4.8. [Arfrever Frehtes Taifersar Arahesis + ] + *) Add comments describing the thread-safety properties of apr_pool_t. [Neil Conway nrc cs.berkeley.edu] diff --git a/build/dbm.m4 b/build/dbm.m4 index e9a673f642b..6203ea7e391 100644 --- a/build/dbm.m4 +++ b/build/dbm.m4 @@ -522,6 +522,25 @@ AC_DEFUN([APU_CHECK_DB47], [ apu_db_version=4 fi ]) +dnl +dnl APU_CHECK_DB48: is DB4.8 present? +dnl +dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version +dnl +AC_DEFUN([APU_CHECK_DB48], [ + places=$1 + if test -z "$places"; then + places="std /usr/local/BerkeleyDB.4.8 /boot/home/config" + fi + APU_CHECK_BERKELEY_DB("4", "8", "-1", + "$places", + "db48/db.h db4/db.h db.h", + "db-4.8 db4-4.8 db48 db4 db" + ) + if test "$apu_have_db" = "1"; then + apu_db_version=4 + fi +]) AC_DEFUN([APU_CHECK_DB], [ requested=$1 @@ -606,6 +625,12 @@ AC_DEFUN([APU_CHECK_DB], [ AC_MSG_ERROR(Berkeley db4 not found) fi ;; + db48) + APU_CHECK_DB48("$check_places") + if test "$apu_db_version" != "4"; then + AC_MSG_ERROR(Berkeley db4 not found) + fi + ;; default) APU_CHECK_DB_ALL("$check_places") ;; @@ -613,34 +638,37 @@ AC_DEFUN([APU_CHECK_DB], [ ]) dnl -dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 4.7 to 1. +dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 4.8 to 1. dnl AC_DEFUN([APU_CHECK_DB_ALL], [ all_places=$1 - APU_CHECK_DB47("$all_places") + APU_CHECK_DB48("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB46("$all_places") + APU_CHECK_DB47("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB45("$all_places") + APU_CHECK_DB46("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB44("$all_places") + APU_CHECK_DB45("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB43("$all_places") + APU_CHECK_DB44("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB42("$all_places") + APU_CHECK_DB43("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB41("$all_places") + APU_CHECK_DB42("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB4("$all_places") + APU_CHECK_DB41("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB3("$all_places") - if test "$apu_db_version" != "3"; then - APU_CHECK_DB2("$all_places") - if test "$apu_db_version" != "2"; then - APU_CHECK_DB1("$all_places") - if test "$apu_db_version" != "1"; then - APU_CHECK_DB185("$all_places") + APU_CHECK_DB4("$all_places") + if test "$apu_db_version" != "4"; then + APU_CHECK_DB3("$all_places") + if test "$apu_db_version" != "3"; then + APU_CHECK_DB2("$all_places") + if test "$apu_db_version" != "2"; then + APU_CHECK_DB1("$all_places") + if test "$apu_db_version" != "1"; then + APU_CHECK_DB185("$all_places") + fi fi fi fi @@ -679,11 +707,11 @@ AC_DEFUN([APU_CHECK_DBM], [ apu_db_version=0 AC_ARG_WITH(dbm, [APR_HELP_STRING([--with-dbm=DBM], [choose the DBM type to use. - DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db41,db42,db43,db44,db45,db46,db47}])], + DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db41,db42,db43,db44,db45,db46,db47,db48}])], [ if test "$withval" = "yes"; then AC_MSG_ERROR([--with-dbm needs to specify a DBM type to use. - One of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47]) + One of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48]) fi requested="$withval" ], [ @@ -882,6 +910,10 @@ AC_DEFUN([APU_CHECK_DBM], [ apu_use_db=1 apu_default_dbm=db4 ;; + db48) + apu_use_db=1 + apu_default_dbm=db4 + ;; default) dnl ### use more sophisticated DBMs for the default? apu_default_dbm="sdbm (default)" @@ -889,7 +921,7 @@ AC_DEFUN([APU_CHECK_DBM], [ ;; *) AC_MSG_ERROR([--with-dbm=$look_for is an unknown DBM type. - Use one of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47]) + Use one of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48]) ;; esac From defdebfc187c099aa3e247230fb1386ce11a7f7e Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 22 Sep 2009 20:03:27 +0000 Subject: [PATCH 6542/7878] The implementation of expand_array() in tables/apr_hash.c allocates a new bucket array, without making any attempt to release the memory allocated for the previous bucket array. That wastes memory: if the hash table grows exponentially, this strategy wastes O(n) extra memory. Use a subpool instead. Submitted by: Neil Conway git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@817806 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ include/apr_hash.h | 12 +++++++----- tables/apr_hash.c | 42 ++++++++++++++++++++++++++++++++++-------- 3 files changed, 47 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index 0248e7e515a..cbdccf4cd33 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,12 @@ Changes for APR 2.0.0 Fix overflow in pools and rmm, where size alignment was taking place. [Matt Lewis , Sander Striker] + *) The implementation of expand_array() in tables/apr_hash.c allocates + a new bucket array, without making any attempt to release the memory + allocated for the previous bucket array. That wastes memory: if the + hash table grows exponentially, this strategy wastes O(n) extra memory. + Use a subpool instead. [Neil Conway ] + *) Add support for Berkeley DB 4.8. [Arfrever Frehtes Taifersar Arahesis ] diff --git a/include/apr_hash.h b/include/apr_hash.h index 39847c3382f..79fc51002e3 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -73,7 +73,7 @@ APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *key, /** * Create a hash table. * @param pool The pool to allocate the hash table out of - * @return The hash table just created + * @return The hash table just created, or NULL if memory allocation failed */ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool); @@ -81,7 +81,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool); * Create a hash table with a custom hash function * @param pool The pool to allocate the hash table out of * @param hash_func A custom hash function. - * @return The hash table just created + * @return The hash table just created, or NULL if memory allocation failed */ APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool, apr_hashfunc_t hash_func); @@ -90,7 +90,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool, * Make a copy of a hash table * @param pool The pool from which to allocate the new hash table * @param h The hash table to clone - * @return The hash table just created + * @return The hash table just created, or NULL if memory allocation failed * @remark Makes a shallow copy */ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, @@ -187,7 +187,8 @@ APR_DECLARE(void) apr_hash_clear(apr_hash_t *ht); * @param p The pool to use for the new hash table * @param overlay The table to add to the initial table * @param base The table that represents the initial values of the new table - * @return A new hash table containing all of the data from the two passed in + * @return A new hash table containing all of the data from the two passed in, + * or NULL if memory allocation failed */ APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p, const apr_hash_t *overlay, @@ -205,7 +206,8 @@ APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p, * make values from h1 override values from h2 (same semantics as * apr_hash_overlay()) * @param data Client data to pass to the merger function - * @return A new hash table containing all of the data from the two passed in + * @return A new hash table containing all of the data from the two passed in, + * or NULL if memory allocation failed. */ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, const apr_hash_t *h1, diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 05ee42f46e6..0ae3950fd05 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -67,12 +67,15 @@ struct apr_hash_index_t { /* * The size of the array is always a power of two. We use the maximum * index rather than the size so that we can use bitwise-AND for - * modular arithmetic. - * The count of hash entries may be greater depending on the chosen - * collision rate. + * modular arithmetic. The count of hash entries may be greater + * depending on the chosen collision rate. + * + * We allocate the bucket array in a sub-pool, "array_pool". This allows us + * to reclaim the old bucket array after an expansion. */ struct apr_hash_t { apr_pool_t *pool; + apr_pool_t *array_pool; apr_hash_entry_t **array; apr_hash_index_t iterator; /* For apr_hash_first(NULL, ...) */ unsigned int count, max; @@ -89,14 +92,20 @@ struct apr_hash_t { static apr_hash_entry_t **alloc_array(apr_hash_t *ht, unsigned int max) { - return apr_pcalloc(ht->pool, sizeof(*ht->array) * (max + 1)); + return apr_pcalloc(ht->array_pool, sizeof(*ht->array) * (max + 1)); } APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) { + apr_pool_t *array_pool; apr_hash_t *ht; + + if (apr_pool_create(&array_pool, pool) != APR_SUCCESS) + return NULL; + ht = apr_palloc(pool, sizeof(apr_hash_t)); ht->pool = pool; + ht->array_pool = array_pool; ht->free = NULL; ht->count = 0; ht->max = INITIAL_MAX; @@ -163,10 +172,17 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, static void expand_array(apr_hash_t *ht) { + apr_pool_t *new_array_pool; + apr_pool_t *old_array_pool; apr_hash_index_t *hi; apr_hash_entry_t **new_array; unsigned int new_max; + if (apr_pool_create(&new_array_pool, ht->pool) != APR_SUCCESS) + return; /* Give up and don't try to expand the array */ + old_array_pool = ht->array_pool; + ht->array_pool = new_array_pool; + new_max = ht->max * 2 + 1; new_array = alloc_array(ht, new_max); for (hi = apr_hash_first(NULL, ht); hi; hi = apr_hash_next(hi)) { @@ -176,6 +192,8 @@ static void expand_array(apr_hash_t *ht) } ht->array = new_array; ht->max = new_max; + + apr_pool_destroy(old_array_pool); } APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, @@ -288,22 +306,25 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, const apr_hash_t *orig) { + apr_pool_t *array_pool; apr_hash_t *ht; apr_hash_entry_t *new_vals; unsigned int i, j; + if (apr_pool_create(&array_pool, ht->pool) != APR_SUCCESS) + return NULL; + ht = apr_palloc(pool, sizeof(apr_hash_t) + - sizeof(*ht->array) * (orig->max + 1) + sizeof(apr_hash_entry_t) * orig->count); ht->pool = pool; + ht->array_pool = array_pool; ht->free = NULL; ht->count = orig->count; ht->max = orig->max; ht->hash_func = orig->hash_func; - ht->array = (apr_hash_entry_t **)((char *)ht + sizeof(apr_hash_t)); + ht->array = alloc_array(ht, ht->max); - new_vals = (apr_hash_entry_t *)((char *)(ht) + sizeof(apr_hash_t) + - sizeof(*ht->array) * (orig->max + 1)); + new_vals = (apr_hash_entry_t *)((char *)(ht) + sizeof(apr_hash_t)); j = 0; for (i = 0; i <= ht->max; i++) { apr_hash_entry_t **new_entry = &(ht->array[i]); @@ -392,6 +413,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, const void *data), const void *data) { + apr_pool_t *array_pool; apr_hash_t *res; apr_hash_entry_t *new_vals = NULL; apr_hash_entry_t *iter; @@ -415,8 +437,12 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, } #endif + if (apr_pool_create(&array_pool, p) != APR_SUCCESS) + return NULL; + res = apr_palloc(p, sizeof(apr_hash_t)); res->pool = p; + res->array_pool = array_pool; res->free = NULL; res->hash_func = base->hash_func; res->count = base->count; From d35bf70b4a0cf93ba5b959174825a801bfe016fb Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Tue, 22 Sep 2009 21:55:25 +0000 Subject: [PATCH 6543/7878] * Use the correct pool. ht->pool isn't set to pool yet. Submitted by: Neil Conway Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@817858 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 0ae3950fd05..b2990ba6496 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -311,7 +311,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, apr_hash_entry_t *new_vals; unsigned int i, j; - if (apr_pool_create(&array_pool, ht->pool) != APR_SUCCESS) + if (apr_pool_create(&array_pool, pool) != APR_SUCCESS) return NULL; ht = apr_palloc(pool, sizeof(apr_hash_t) + From 6290781727d799030ba4c4aa5e9716dcd47109ae Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 25 Sep 2009 13:08:36 +0000 Subject: [PATCH 6544/7878] TMPDIR is the canonical prefered envvar to use git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@818841 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/tempdir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/unix/tempdir.c b/file_io/unix/tempdir.c index 659e0bf4931..22325eff1c1 100644 --- a/file_io/unix/tempdir.c +++ b/file_io/unix/tempdir.c @@ -42,7 +42,7 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, { apr_status_t apr_err; const char *try_dirs[] = { "/tmp", "/usr/tmp", "/var/tmp" }; - const char *try_envs[] = { "TMP", "TEMP", "TMPDIR" }; + const char *try_envs[] = { "TMPDIR", "TMP", "TEMP"}; const char *dir; char *cwd; int i; @@ -51,9 +51,9 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, into. Here's the order in which we'll try various paths: + $TMPDIR $TMP $TEMP - $TMPDIR "C:\TEMP" (windows only) "SYS:\TMP" (netware only) "/tmp" From f4cac5eb4f37feb17af5275710baec168ffb5220 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 25 Sep 2009 13:09:47 +0000 Subject: [PATCH 6545/7878] note changes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@818842 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGES b/CHANGES index cbdccf4cd33..2dae8893f26 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,15 @@ Changes for APR 2.0.0 Fix overflow in pools and rmm, where size alignment was taking place. [Matt Lewis , Sander Striker] + *) apr_temp_dir_get() now checks the TMPDIR environment variable + first, instead of third. [Jim Jagielski] + + *) Posix semaphores can now be named and used as named semaphores. + [Jim Jagielski] + + *) Better handling of APR_OFF_T_FMT for Darwin 10 depending on -arch + setting of compiler. [Jim Jagielski] + *) The implementation of expand_array() in tables/apr_hash.c allocates a new bucket array, without making any attempt to release the memory allocated for the previous bucket array. That wastes memory: if the From 63475cf61ac3d2d158e5825dd658022b519ea4e3 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Fri, 25 Sep 2009 20:04:56 +0000 Subject: [PATCH 6546/7878] Fix a bunch of typos in the doxygen comments for public include files in APR Submitted by: Neil Conway git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@818977 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_env.h | 2 +- include/apr_file_io.h | 12 ++++++------ include/apr_memcache.h | 4 ++-- include/apr_portable.h | 12 ++++++------ include/apr_tables.h | 4 ++-- include/apr_xml.h | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/apr_env.h b/include/apr_env.h index 05419c37c16..85ab67041fa 100644 --- a/include/apr_env.h +++ b/include/apr_env.h @@ -28,7 +28,7 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_env Functions for manupulating the environment + * @defgroup apr_env Functions for manipulating the environment * @ingroup APR * @{ */ diff --git a/include/apr_file_io.h b/include/apr_file_io.h index dc65c83b7d5..b03f2cf7ce2 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -113,7 +113,7 @@ extern "C" { * to decipher a sparse file, so it's critical that the sparse file * flag should only be used for files accessed only by APR or other * applications known to be able to decipher them. APR does not - * guarentee that it will compress the file into sparse segments + * guarantee that it will compress the file into sparse segments * if it was previously created and written without the sparse flag. * On platforms which do not understand, or on file systems which * cannot handle sparse files, the flag is ignored by apr_file_open(). @@ -753,7 +753,7 @@ APR_DECLARE(apr_status_t) apr_file_name_get(const char **new_path, /** * Return the data associated with the current file. * @param data The user data associated with the file. - * @param key The key to use for retreiving data associated with this file. + * @param key The key to use for retrieving data associated with this file. * @param file The currently open file. */ APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, @@ -763,7 +763,7 @@ APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, * Set the data associated with the current file. * @param file The currently open file. * @param data The user data to associate with the file. - * @param key The key to use for assocaiteing data with the file. + * @param key The key to use for associating data with the file. * @param cleanup The cleanup routine to use when the file is destroyed. */ APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, @@ -807,7 +807,7 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, *
    * @param attr_mask Mask of valid bits in attributes. * @param pool the pool to use. - * @remark This function should be used in preference to explict manipulation + * @remark This function should be used in preference to explicit manipulation * of the file permissions, because the operations to provide these * attributes are platform specific and may involve more than simply * setting permission bits. @@ -834,7 +834,7 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, /** * Create a new directory on the file system. * @param path the path for the directory to be created. (use / on all systems) - * @param perm Permissions for the new direcoty. + * @param perm Permissions for the new directory. * @param pool the pool to use. */ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, @@ -844,7 +844,7 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, * 'mkdir -p'. Creates intermediate directories as required. No error * will be reported if PATH already exists. * @param path the path for the directory to be created. (use / on all systems) - * @param perm Permissions for the new direcoty. + * @param perm Permissions for the new directory. * @param pool the pool to use. */ APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, diff --git a/include/apr_memcache.h b/include/apr_memcache.h index cc459ac900f..bb60d2e2d3f 100644 --- a/include/apr_memcache.h +++ b/include/apr_memcache.h @@ -267,7 +267,7 @@ APR_DECLARE(void) apr_memcache_add_multget_key(apr_pool_t *data_pool, /** * Gets multiple values from the server, allocating the values out of p * @param mc client to use - * @param temp_pool Pool used for tempoary allocations. May be cleared inside this + * @param temp_pool Pool used for temporary allocations. May be cleared inside this * call. * @param data_pool Pool used to allocate data for the returned values. * @param values hash of apr_memcache_value_t keyed by strings, contains the @@ -345,7 +345,7 @@ APR_DECLARE(apr_status_t) apr_memcache_delete(apr_memcache_t *mc, * @param mc client to use * @param key null terminated string containing the key * @param n number to increment by - * @param nv new value after incrmenting + * @param nv new value after incrementing */ APR_DECLARE(apr_status_t) apr_memcache_incr(apr_memcache_t *mc, const char *key, diff --git a/include/apr_portable.h b/include/apr_portable.h index b1b21e37b7e..7e52afc4f28 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -16,7 +16,7 @@ /* This header file is where you should put ANY platform specific information. * This should be the only header file that programs need to include that - * actually has platform dependant code which refers to the . + * actually has platform dependent code which refers to the . */ #ifndef APR_PORTABLE_H #define APR_PORTABLE_H @@ -145,7 +145,7 @@ struct apr_os_proc_mutex_t { typedef int apr_os_file_t; /**< native file */ typedef DIR apr_os_dir_t; /**< native dir */ typedef int apr_os_sock_t; /**< native dir */ -typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_t; /**< native proces +typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_t; /**< native process * mutex */ #if APR_HAS_THREADS && APR_HAVE_PTHREAD_H @@ -235,7 +235,7 @@ APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, /** * Convert the socket from an apr type to an OS specific socket * @param thesock The socket to convert. - * @param sock The os specifc equivelant of the apr socket.. + * @param sock The os specific equivalent of the apr socket.. */ APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock); @@ -450,7 +450,7 @@ APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **shm, #if APR_HAS_DSO || defined(DOXYGEN) /** - * @defgroup apr_os_dso DSO (Dynamic Loading) Portabiliity Routines + * @defgroup apr_os_dso DSO (Dynamic Loading) Portability Routines * @{ */ /** @@ -483,7 +483,7 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data); /** - * Get the name of the system default characer set. + * Get the name of the system default character set. * @param pool the pool to allocate the name from, if needed */ APR_DECLARE(const char*) apr_os_default_encoding(apr_pool_t *pool); @@ -493,7 +493,7 @@ APR_DECLARE(const char*) apr_os_default_encoding(apr_pool_t *pool); * Get the name of the current locale character set. * @param pool the pool to allocate the name from, if needed * @remark Defers to apr_os_default_encoding if the current locale's - * data can't be retreved on this system. + * data can't be retrieved on this system. */ APR_DECLARE(const char*) apr_os_locale_encoding(apr_pool_t *pool); diff --git a/include/apr_tables.h b/include/apr_tables.h index aef5c7ba818..b2526e0b05b 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -261,7 +261,7 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); * Add a key/value pair to a table, if another element already exists with the * same key, this will over-write the old data. * @param t The table to add the data to. - * @param key The key fo use + * @param key The key to use * @param val The value to add * @remark When adding data, this function makes a copy of both the key and the * value. @@ -388,7 +388,7 @@ APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, /** * Iterate over a table running the provided function once for every - * element in the table. The @param vp varargs paramater must be a + * element in the table. The @param vp varargs parameter must be a * list of zero or more (char *) keys followed by a NULL pointer. If * zero keys are given, the @param comp function will be invoked for * every element in the table. Otherwise, the function is invoked diff --git a/include/apr_xml.h b/include/apr_xml.h index 62fed68d14b..8de6875639a 100644 --- a/include/apr_xml.h +++ b/include/apr_xml.h @@ -218,7 +218,7 @@ APR_DECLARE(apr_xml_parser *) apr_xml_parser_create(apr_pool_t *pool); * Parse a File, producing a xml_doc * @param p The pool for allocating the parse results. * @param parser A pointer to *parser (needed so calling function can get - * errors), will be set to NULL on successfull completion. + * errors), will be set to NULL on successful completion. * @param ppdoc A pointer to *apr_xml_doc (which has the parsed results in it) * @param xmlfd A file to read from. * @param buffer_length Buffer length which would be suitable From 8179481b2dbcc3e534d42161581eff8d3f54742f Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 29 Sep 2009 12:14:45 +0000 Subject: [PATCH 6547/7878] changed conditionals to avoid a couple of 'statement not reached' warnings with strict compilers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@819897 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 55 ++++++++++++++++++++---------------------------- 1 file changed, 23 insertions(+), 32 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index f708a928139..081ca6749c1 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -33,8 +33,7 @@ static apr_status_t shm_cleanup_owner(void *m_) return errno; } return APR_SUCCESS; -#endif -#if APR_USE_SHMEM_SHMGET_ANON +#elif APR_USE_SHMEM_SHMGET_ANON if (shmdt(m->base) == -1) { return errno; } @@ -56,8 +55,7 @@ static apr_status_t shm_cleanup_owner(void *m_) else { return apr_file_remove(m->filename, m->pool); } -#endif -#if APR_USE_SHMEM_MMAP_SHM +#elif APR_USE_SHMEM_MMAP_SHM if (munmap(m->base, m->realsize) == -1) { return errno; } @@ -65,8 +63,7 @@ static apr_status_t shm_cleanup_owner(void *m_) return errno; } return APR_SUCCESS; -#endif -#if APR_USE_SHMEM_SHMGET +#elif APR_USE_SHMEM_SHMGET /* Indicate that the segment is to be destroyed as soon * as all processes have detached. This also disallows any * new attachments to the segment. */ @@ -82,10 +79,10 @@ static apr_status_t shm_cleanup_owner(void *m_) else { return apr_file_remove(m->filename, m->pool); } +#else + return APR_ENOTIMPL; #endif } - - return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, @@ -172,9 +169,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return APR_SUCCESS; #endif /* APR_USE_SHMEM_MMAP_ZERO */ -#endif /* APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_MMAP_ANON */ -#if APR_USE_SHMEM_SHMGET_ANON - +#elif APR_USE_SHMEM_SHMGET_ANON new_m = apr_palloc(pool, sizeof(apr_shm_t)); new_m->pool = pool; new_m->reqsize = reqsize; @@ -213,9 +208,10 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, apr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; -#endif /* APR_USE_SHMEM_SHMGET_ANON */ +#else /* It is an error if they want anonymous memory but we don't have it. */ return APR_ENOTIMPL; /* requested anonymous but we don't have it */ +#endif } /* Name-based shared memory */ @@ -303,9 +299,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, *m = new_m; return APR_SUCCESS; -#endif /* APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM */ - -#if APR_USE_SHMEM_SHMGET +#elif APR_USE_SHMEM_SHMGET new_m->realsize = reqsize; /* FIXME: APR_OS_DEFAULT is too permissive, switch to 600 I think. */ @@ -359,10 +353,10 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, *m = new_m; return APR_SUCCESS; -#endif /* APR_USE_SHMEM_SHMGET */ +#else + return APR_ENOTIMPL; +#endif } - - return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, @@ -377,14 +371,12 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, #if APR_USE_SHMEM_MMAP_TMP return apr_file_remove(filename, pool); -#endif -#if APR_USE_SHMEM_MMAP_SHM +#elif APR_USE_SHMEM_MMAP_SHM if (shm_unlink(filename) == -1) { return errno; } return APR_SUCCESS; -#endif -#if APR_USE_SHMEM_SHMGET +#elif APR_USE_SHMEM_SHMGET /* Presume that the file already exists; just open for writing */ status = apr_file_open(&file, filename, APR_WRITE, APR_OS_DEFAULT, pool); @@ -418,10 +410,11 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, /* ensure the file has been removed anyway. */ apr_file_remove(filename, pool); return status; -#endif +#else /* No support for anonymous shm */ return APR_ENOTIMPL; +#endif } APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) @@ -443,16 +436,15 @@ static apr_status_t shm_cleanup_attach(void *m_) return errno; } return APR_SUCCESS; -#endif /* APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM */ -#if APR_USE_SHMEM_SHMGET +#elif APR_USE_SHMEM_SHMGET if (shmdt(m->base) == -1) { return errno; } return APR_SUCCESS; +#else + return APR_ENOTIMPL; #endif } - - return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, @@ -520,8 +512,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, *m = new_m; return APR_SUCCESS; -#endif /* APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM */ -#if APR_USE_SHMEM_SHMGET +#elif APR_USE_SHMEM_SHMGET apr_shm_t *new_m; apr_status_t status; apr_file_t *file; /* file where metadata is stored */ @@ -566,10 +557,10 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, *m = new_m; return APR_SUCCESS; -#endif /* APR_USE_SHMEM_SHMGET */ +#else + return APR_ENOTIMPL; +#endif } - - return APR_ENOTIMPL; } APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) From 8ae440cc1f2d5b45b7ccd62ebc81b9dcff7b1400 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 1 Oct 2009 13:31:24 +0000 Subject: [PATCH 6548/7878] CHANGES are local changes... remove the 1.4 and earlier and any patches in trunk that are in 1.4... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@820651 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2379 +------------------------------------------------------ 1 file changed, 12 insertions(+), 2367 deletions(-) diff --git a/CHANGES b/CHANGES index 2dae8893f26..84f1d609fc3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,35 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) SECURITY: CVE-2009-2412 (cve.mitre.org) - Fix overflow in pools and rmm, where size alignment was taking place. - [Matt Lewis , Sander Striker] - - *) apr_temp_dir_get() now checks the TMPDIR environment variable - first, instead of third. [Jim Jagielski] - - *) Posix semaphores can now be named and used as named semaphores. - [Jim Jagielski] - - *) Better handling of APR_OFF_T_FMT for Darwin 10 depending on -arch - setting of compiler. [Jim Jagielski] - - *) The implementation of expand_array() in tables/apr_hash.c allocates - a new bucket array, without making any attempt to release the memory - allocated for the previous bucket array. That wastes memory: if the - hash table grows exponentially, this strategy wastes O(n) extra memory. - Use a subpool instead. [Neil Conway ] - *) Add support for Berkeley DB 4.8. [Arfrever Frehtes Taifersar Arahesis ] - *) Add comments describing the thread-safety properties of apr_pool_t. - [Neil Conway nrc cs.berkeley.edu] - - *) Pass default environment to testflock, testoc, testpipe, testsock, - testshm and testproc children, so that tests run when APR is compiled - with Intel C Compiler. [Bojan Smojver] - *) Make sure that "make check" is used in the RPM spec file, so that the crypto, dbd and dbm tests pass. [Graham Leggett] @@ -42,9 +16,6 @@ Changes for APR 2.0.0 *) Clarify the error messages within the dbd tests. [Graham Leggett] - *) More elaborate detection for dup3(), accept4() and epoll_create1(). - [Chetan Reddy , Bojan Smojver] - *) Use locally scoped variables in PostgreSQL driver to avoid stomping on return codes. PR 47431 [Wayne Jensen ] @@ -53,9 +24,6 @@ Changes for APR 2.0.0 causes proc mutex failures. [Stefan Fritsch ] - *) Add apr_file_sync() and apr_file_datasync() calls. - [Bojan Smojver] - *) Fix race conditions in initialisation of DBD, DBM and DSO. [Bojan Smojver] @@ -69,11 +37,6 @@ Changes for APR 2.0.0 *) apr_thread_cond_*wait() on BeOS: Fix broken logic. PR 45800. [Jochen Voss (no e-mail)] - *) Set CLOEXEC flags where appropriate. Either use new O_CLOEXEC flag and - associated functions, such as dup3(), accept4(), epoll_create1() etc., - or simply set CLOEXEC flag using fcntl(). PR 46425. [Stefan Fritsch - , Arkadiusz Miskiewicz ] - *) Added Unix domain socket support. [Mladen Turk] *) Win32: Use WSAPoll as default pollset method if supported and found @@ -87,2345 +50,27 @@ Changes for APR 2.0.0 Currently only implemented for shm, proc and global mutexes on posix platforms. [Mladen Turk] -Changes for APR 1.4.0 - - *) Fix compilation error on systems that do not have IPV6. - PR 46601 [Julien Charbon ] - - *) apr_pollset_wakeup() on Windows: Fix core caused by closing the - file_socket_pipe with standard file_close. - [Arsen Chaloyan, Mladen Turk] - - *) apr_socket_sendfile() on Solaris: Fix handling of files truncated - after the sender determines the length. (This fixes a busy loop in - httpd when a file being served is truncated.) [Jeff Trawick] - - *) Fix documentation for apr_temp_dir_get(). - PR 46303 [Carlo Marcelo Arenas Belon ] - - *) Add AC_MSG_RESULT after AC_MSG_CHECKING. - PR 46427 [Rainer Jung ] - - *) Win32: Do not error out on apr_pollset_poll() when there are no sockets. - [Justin Erenkrantz] - - *) Intruduce apr_hash_do for iterating over a hash table. - [Mladen Turk] - - *) Rename apr_pool_create_core to apr_pool_create_unmanaged and - deprecate the old API name. It better reflects the scope and usage - of this function. [Mladen Turk] - - *) Use proper return code for fcntl-based apr_proc_mutex_trylock() - on platforms that return EACCES instead of EAGAIN when the lock - is already held (AIX, HP-UX). - [Eric Covener] - - *) Make sure WIN32 behaves the same as posix for file backed - shared memory by removing the file on cleanup/remove. - [Mladen Turk] - - *) Fix Solaris poll failure. PR 43000 - [Henry Jen ] - - *) Introduce apr_pollset_wakeup() for interrupting - the blocking apr_pollset_poll call. - [Mladen Turk] - - *) Implement apr_proc_wait_all_procs for windows. - [Mladen Turk] - - *) Add apr_file_link() function. PR 44841 - [Mark Heily ] - -Changes for APR 1.3.0 - - *) apr_getservbyname(): Use proper method for converting port - to host byte order. PR 44903. - [Chris Taylor ] - - *) Introduce apr_pool_pre_cleanup_register() for registering - a cleanup that is called before any subpool is destroyed - within apr_pool_clear or apr_pool_destroy. - This allows to register a cleanup that will notify subpools - about its inevitable destruction. - [Mladen Turk] - - *) Introduce apr_pool_create_core_ex() for creation of standalone - pools without parent. This function should be used for short - living pools, usually ones that are created and destroyed - either in a loop or inside function call. Since the pools - created with this function doesn't have a parent they must - be explicitly destroyed when done. - [Mladen Turk] - - *) Fix return value when apr_pollset_poll interrupted. - PR 42580 [Basant Kumar Kukreja ] - - *) Add missing semi-colon in Win9x code path of apr_file_open that breaks - Win9X Debug builds. PR 44329. [Curt Arnold] - - *) z/OS: return standard apr_status_t codes from apr_dso_load() - and apr_dso_sym(). [David Jones ] - - *) Fix the make test target in the spec file. [Graham Leggett] - - *) Fix DSO-related crash on z/OS caused by incorrect memory - allocation. [David Jones ] - - *) Implement Darwin-semantic (9.0.0 and later) sendfile support. - Use writev in lieu of hdtr vecs since how Darwin counts the - data is undocumented. [Geoff Greer , - William Rowe, Jim Jagielski] - - *) Implemented the APR_FOPEN_SPARSE flag, permits win32 to create - sparse data files. Also bestow apr_fileinfo_t csize field for - Windows versions 2000 and later, which helps in the detection - that a sparse file is truly in use (see test/testlfs.c for an - example, because different filesystems can vary in behavior - even on an OS supporting sparse files). [William Rowe] - - *) Corrected for Darwin and others to toggle APR_HAS_LARGE_FILES - where large off_t's are enabled without any extra defines, hints - or additional functions. This is binary compatible, but apps - may need to be recompiled to take full advantage depending on how - they detect this feature. [William Rowe] - - *) Implement apr_atomic_casptr() and apr_atomic_xchgptr() for z/OS. - [David Jones ] - - *) Introduce apr_file_pipe_create_ex() to portably permit one pipe - end or another to be entirely blocking for non-APR applications - (e.g. stdio streams) and the other (or both ends) non blocking, - with a timeout of 0 by default. - [William Rowe] - - *) apr_procattr_io_set() on Windows: Set non-blocking pipe handles - to a default timeout of 0, following the Unix default. No effect - on pipe handles configured to block. PR 43522. - [Eric Covener ] - - *) apr_file_write() on Windows: Fix return code when writing to a non- - blocking pipe would have blocked. PR 43563. - [Eric Covener ] - - *) Introduce APR_NO_FILE as an option to apr_procattr_io_set() for any - of the three stdio streams to cause the corresponding streams to be - closed to the child process. This becomes effective in 1.3.0 across - platforms (equivilant to APR_NO_PIPE in 1.2.x except on Win32.) - [William Rowe] - - *) Solve WinNT inherited pipe leaks by mutexing apr_proc_create calls, - on WinNT (not WinCE, nor 9x) so that we toggle the inherited state - of the stdin/out/err pipes. All other file handles are treated as - not-inherited until apr_file_dup2'ed a std handle of this process, - or while they are used by apr_proc_create. [William Rowe] - - *) Define the Mac OS/X filesystem_encoding as utf-8 (in previous - releases the interpretation would vary). [Branko Čibej] - - *) Add table cloning (deep copy) convenience function. - [Davi Arnaut] - - *) Rework the WIN32 CV code to signal the condition only if one or - more threads are blocked on the condition variable. If no threads - are waiting on the condition variable, nothing happens. The change - also eliminates the thundering-herd problem of the manual-reset - event, which (theoretically) wakes up all threads waiting on. Now - the behavior of the CV's should be the same on Unix and win32 - platforms. PR 42305. [Davi Arnaut] - - *) Define SEM_FAILED if it isn't already defined, as the proc mutex - code already does it. Also search for the sem_open function in - the realtime library. (This fixes HP-UX sem_open detection). - [Davi Arnaut] - - *) Define the _HPUX_SOURCE feature test macro to obtain maximum - functionality. - PR 42261. [Davi Arnaut] - - *) Stop invoking the testshm* helpers upon 'make test' invocation. - [Kurt Miller ] - - *) Register a cleanup only if APR_FILE_NOCLEANUP was not flagged in - apr_file_mktemp. [Brian J. France ] - - *) Numerous build fixes for non-GCC builds and GCC builds on Win32, - as well as WinCE builds. [Davi Arnaut , - Curt Arnold , John Mark Vandenberg, - Kouhei Sutou , William Rowe] - - *) Discard file buffers when running cleanups for exec. - PR 41119. [Davi Arnaut , Bojan Smojver] - - *) Improve thread safety of assorted file_io functions. - PR 42400. [Davi Arnaut ] - - *) Add the apr_pollcb API as an alternative more efficient method - of polling sockets, compared to apr_pollset. [Paul Querna] - - *) Fix possible crash in apr_pool_initialize() when built with - verbose pool debugging. PR 41063. - [Peter Steiner ] - - *) Fix --disable-ipv6 build on platforms with getifaddrs(). - PR 39199. [Joe Orton] - - *) Correctly retrieve 'empty' environment values with apr_env_get - on Win32 (e.g. "VAR="), and added validation to testall suite. - PR 40764. [Issac Goldstand ] - - *) Portably check for EEXIST in mktemp code. PR 40818 - [Kenneth Golomb ] - - *) Fix apr_socket_recvfrom() to ensure the peer's address is returned - through the "from" parameter. [Joe Orton] - - *) Fix error checking in kqueue, epoll and event port versions of - apr_pollset_create. PR 40660, 40661, 40662 - [Larry Cipriani ] - - *) Add some documentation on the format matched by apr_fnmatch. - [David Glasser ] - - *) Add apr_hash_clear. [Daniel L. Rall ] - - *) Don't try to build apr_app.c on MinGW. - [Matthias Miller ] - - *) Fix the timeout converstion in apr_pollset with the KQueue - backend. [Marco Molteni ] - - *) Support MinGW. [John Vandenberg, Justin Erenkrantz] - - *) Implement apr_thread_yield on Unix in terms of pthread_yield or - sched_yield. [Keisuke Nishida ] - - *) Provide folding in autogenerated .manifest files for Win32 builders - using VisualStudio 2005 [William Rowe] - - *) Utilise Solaris' native atomic_* functions for apr_atomics - where appropriate. [Colm MacCárthaigh] - - *) Make apr_socket_recvfrom initialize the port field in the from - sockaddr. PR 39325 [Anthony Minessale ] - - *) NetBSD: Avoid leaving zombie process when using apr_signal() - to ignore SIGCHLD. PR 36750. [Todd Vierling ] - - *) Implement support for apr_proc_mutex_trylock() on Unix platforms. - PR 38785. [Chris Darroch ] - - *) APR_FIND_APR macro now supports customisable detailed checks on - each installed apr. [Justin Erenkrantz, Colm MacCárthaigh] - - *) APR_FIND_APR macro no longer checks /usr/local/apache2/ - [Colm MacCárthaigh] - - *) Add APR_POLLSET_NOCOPY option to apr_pollset API to eliminate - O(n)-time lookup in apr_pollset_remove() (currently implemented - only for epoll). [Brian Pane] - - *) Add apr_file_buffer_set() and apr_file_buffer_size_get() functions - to support variable buffer sizes with APR file handles. - [Colm MacCárthaigh] - - *) Add apr_file_open_flags_std[err|out|in]() functions. - [Colm MacCárthaigh] - - *) stdio: apr_file_open_std[err|out|in]() functions now set the APR_WRITE - or APR_READ flag as appropriate. [Colm MacCárthaigh] - - *) multicast: apr_mcast_*() no longer return APR_ENOTIMPL when invoked - for non-UDP/RAW sockets. The caller is expected to ensure that the - socket-type is suitable for multicast. [Colm MacCárthaigh] - - *) Add apr_sockaddr_ip_getbuf() function. [Joe Orton] - - *) Fix handling of %pI in apr_psprintf. [Joe Orton] - - *) Provide APR_VERSION_AT_LEAST() macro for applications which - want to enable features based on a required level of APR. - [Jeff Trawick] - - *) jlibtool: Teach to use static libraries with -static. - [Justin Erenkrantz] - - *) Fix checks for alloca() support in configure. PR 13037. - [Noah Misch ] - - *) Add %pm support to apr_snprintf() for printing the error string - corresponding to an apr_status_t value. [Joe Orton] - - *) Add APR_ARRAY_IDX() and APR_ARRAY_PUSH() convenience macros to - apr_tables.h. [Garrett Rooney] - -Changes for APR 1.2.12 - - *) Define apr_ino_t in such a way that it doesn't change definition - based on the library consumer's -D'efines to the filesystem. - [Lucian Adrian Grijincu ] - - *) Fill in apr_fileinfo_t member st_csize on Netware and Unix (PR 41678), - and refine the file times down to apr_time_t resolution if supported - by a st_atimensec or st_atim.tv_nsec value by the OS. Additional - msec implementations are possible if exposed through autoconf. - [William Rowe, Nicklas Edmundsson ] - - *) Fix apr_socket_recvfrom() to ensure the peer's address is returned - through the "from" parameter on Win32. [William Rowe] - - *) Cause apr_file_dup2() on Win32 to update the MSVCRT psuedo-stdio - handles for fd-based and FILE * based I/O. [William Rowe] - -Changes for APR 1.2.7 - - *) Netware - add missing apu_version.c parsing for apu_version_string() - to the Netware specific builds. Unix platforms support this API - since 0.9.1. [Brad Nicholes] - - *) Fix a regression in the updated win32 apr_file_read with timeouts - since 1.2.6 which would fail to return the bytes read in specific - edge cases. [William Rowe] - -Changes for APR 1.2.6 - - *) Fully test the detected libuuid or libc based uuid_create or - uuid_generate function against the detected uuid.h, uuid/uuid.h, - or sys/uuid.h (using only the first-found .h examined in that order) - for correct compilation. Resolves various apr_os_uuid issues on - multiple environments. [William Rowe] - - *) Prevent detection of robust mutex support with glibc 2.4, - fixing APR_LOCK_PROC_PTHREAD locks. PR 38442. [Joe Orton] - - *) Correct bug in kqueue backend for apr_pollset where we would - erroneously indicate that a socket was readable or writeable. - [Garrett Rooney] - - *) Make the filePtr in apr_file_t an apr_off_t on Unix, to avoid issues - truncating offsets down to 32 bits on large file systems. - [Garrett Rooney] - - *) Fix seeks with files opened in xthread mode for append on win32. - [M Joonas Pihlaja , Garrett Rooney] - - *) Keep testpipe.c from hanging on win32. [Garrett Rooney] - - *) Cause apr_file_write_full on win32 to consider the timeout value set by - apr_file_pipe_timeout_set. PR 30182 - [] - - *) Fix assertion from double close of a handle with a rwlock on win32. - [Evgueni Brevnov ] - - *) Fix EOF handling for unbuffered reads on win32. - [Konstantin Sharenkov ] - - *) Documented that apr_stat and apr_dir_read can return APR_INCOMPLETE, - and how to determine which parts of the resulting apr_finfo_t can be - used in such a case. - [Garrett Rooney] - - *) Fix passing "" as an argument to the program started by apr_proc_create - on Win32. - [Philip Martin - - *) Bugfix for apr_pollset_poll() on systems that implement pollsets - using select(2): properly compute the number of signalled desciptors - when one or more of them are both readable and writable. - [Dror Shilo , Gerry ] - - *) Fix apr_file_seek() to catch write failures when flushing - pending writes for a buffered file. [Joe Orton] - -Changes for APR 1.2.2 - - *) Fix crash in apr_dir_make_recursive() for relative path - when the working directory has been deleted. [Joe Orton] - - *) Win32: fix apr_proc_mutex_trylock() to handle WAIT_TIMEOUT, - returning APR_EBUSY. [Ronen Mizrahi ] - - *) Fix apr_socket_opt_set() issue where TCP_NODELAY would be - set when TCP_DEFER_ACCEPT was set. [Brian Pane] - - *) Allow TCP_NODELAY and TCP_CORK to be set concurrently on - Linux 2.6 and later. [Joe Orton] - - *) Fix apr_socket_addr_get(,APR_REMOTE,) after a non-blocking - connection is completed. PR 32737. [Joe Orton] - - *) Fix apr_file_gets() and apr_file_read() to catch write failures - when flushing pending writes for a buffered file. [Joe Orton] - - *) Fix apr_file_write() infinite loop on write failure for buffered - files. [Erik Huelsmann ] - - *) Fix error handling where apr_uid_* and apr_gid_* could return - APR_SUCCESS in failure cases. PR 34053 continued. [Joe Orton] - -Changes for APR 1.2.1 - - *) Refactor Win32 condition variables code to address bugs 27654, 34336. - [Henry Jen , E Holyat ] - -Changes for APR 1.2.0 - - *) If getpwuid_r or getgrgid_r set their results to NULL, it is an error. - PR 34053. [Paul Querna] - - *) Switch to lazy initialization of the pollset that's used within - apr_file_t on platforms where apr_wait_for_io_or_timeout() doesn't - use poll(2). (This fixes a performance problem observed in httpd-2.x - on OS X due to the use of poll now being disabled by default on that - platform.) [Brian Pane] - - *) Fix Pollset corruption on Solaris 10. [Paul Querna] - - *) Add %pt support to apr_snprintf() for printing an apr_os_thread_t - in hex format. [Jeff Trawick] - - *) Support APR_SO_SNDBUF and APR_SO_RCVBUF on Windows. PR 32177. - [Sim , Jeff Trawick] - - *) Fix apr_table_overlap()'s handling of tables allocated from - different pools. [Joe Schaefer ] - - *) Add support for uuid_generate on OS X 10.4. [Paul Querna] - - *) Include the C preprocessor flags in --cflags for pkg-config. - [Paul Querna] - - *) Fix issue with poll() followed by net I/O yielding EAGAIN on - Mac OS 10.4 (Darwin 8). [Wilfredo Sanchez] - -Changes for APR 1.1.1 - - *) Disable sendfile support for S/390 only in kernel versions < 2.4.0. - [Joe Orton] - - *) Fix posix rwlock detection on Darwin. [Aaron Bannert] - - *) Build fix for Multicast support on HP-UX 11.00 and Tru64 [Joe Orton] - - *) Fix libapr.rc for Win32 builds [William Rowe] - - *) Rewrite apr_file_writev_full using apr_file_write_full. [Paul Querna] - - *) Use APR_RING_CONCAT for moving dead list in KQueue, sys_epoll, and - Event Ports. [Paul Querna] - - *) find_apr.m4: Try installed APR before bundled copy if --with-apr not - passed to configure. [Justin Erenkrantz] - -Changes for APR 1.1.0 - - *) Added apr_procattr_user_set and apr_procattr_group_set - setting the user and group for new processes. [Mladen Turk] - - *) Add APR Multicast functions; including support for - Source-Specific Multicast from Colm MacCárthaigh. [Paul Querna] - - *) Add a build script to create a solaris package. [Graham Leggett] - - *) Add support for APR_TCP_DEFER_ACCEPT. [Paul Querna] - - *) Rename the apr_file_permissions macros (APR_UREAD, APR_UWRITE etc.) - to have prefix APR_FPROT_ (old names kept for compatibility). - [Stas Bekman] - - *) Emit the run-time link path option in apr-config after installation - if the user is linking with libtool. [Justin Erenkrantz] - - *) Add apr_file_writev_full to ensure an entire iovec is writen to a file. - [Paul Querna] - - *) Remove the runtime test for Sendfile versions on FreeBSD. PR 25718. - [Mike Silbersack , Paul Querna] - - *) Rename the apr_file_open macros (APR_READ, APR_WRITE, etc.) to - have prefix APR_FOPEN_ (old names kept for compatibility). - [Stas Bekman] - - *) Added apr_os_uuid_get() support for Linux via libuuid and for modern - BSDs which have uuid_create as part of their libc. [Paul Querna] - - *) Added Solaris 10 'Event Ports' as a backend for APR Pollset. This - backend also supports the APR_POLLSET_THREADSAFE flag. [Paul Querna] - - *) Added the APR_POLLSET_THREADSAFE flag. This allows multiple threads - to call the Pollset Add or Remove functions in a thread safe manner. - Currently only EPoll and KQueue support this flag. [Paul Querna] - - *) Split poll/unix/poll.c into separate files for each Poll or Pollset - implementation. [Paul Querna] - - *) Rewrite apr_file_printf to handle arbitrary length strings. - PR 28029. [Chris Knight , - Garrett Rooney ] - -Changes for APR 1.0.2 - - *) [NetWare] Fixed some type mismatches in threadproc/netware/proc.c and - locks/netware/thread_mutex.c that prevented APR from building with the - latest release of the LibC SDK. [Brad Nicholes] - -Changes for APR 1.0.1 - - *) apr_password_get(): Fix the check for buffer overflow. [Jeff Trawick] - - *) Fix HUP return codes in pollset when using KQueue. - [Paul Querna] - - *) Prevent unbounded memory use during repeated operations on a hash table. - [Julian Foad - - *) Moved repository to SVN - [Hackathon] - - *) jlibtool: Ignore '-export-symbols-regexp' option. - [Justin Erenkrantz] - - *) fix apr_file_dup and apr_file_dup2 win32 implementations - to create a mutex [Steve Hay ] - - *) Makes the threads to behave like on posix. If the thread is created - without APR_DETACH expect that the thread_join will be called, so don't - close the handle in advance, if the thread has already finished. - [Mladen Turk] - - *) The apr/test/Makefile.win is missing a target to build a - readchild.exe that test is depending on but is never built. - [Mladen Turk] - - *) Improve apr_file_gets() performance on buffered files. [Justin Erenkrantz] - - *) Win32: Fix bug in apr_socket_sendfile that interferred with - Win32 LSPs. PR 23982 [Jan Bilek, Bill Stoddard] - - *) Win32: Fix bug tracking the file pointer on a file opened for - overlapped/APR_XTHREAD io. [Bill Stoddard] - -Changes with APR 1.0 - - *) Only install apr-$MAJOR-config and add appropriate detection code to - find_apr.m4 (APR_FIND_APR). [Max Bowsher ] - - *) Remove APR_STATUS_IS_SUCCESS() macro. [Justin Erenkrantz] - - *) apr_proc_create() on Unix: Remove unnecessary check for read - access to the working directory of the child process. - PR 30137. [Jeremy Chadwick ] - - *) Add jlibtool - enabled with '--enable-experimental-libtool' option. - [Justin Erenkrantz] - - *) Add support for KQueue and sys_epoll to apr_pollset. [Paul Querna] - - *) Support threading on FreeBSD 5.x where kern.osreldate >= 502102. - [Craig Rodrigues ] - - *) Add an RPM spec file derived from Fedora Core. - [Graham Leggett, Joe Orton] - - *) Fix apr_threadattr_detach_set() on Mac OS X. PR 28472. - [INOUE Seiichiro ] - - *) Change default inter-process locking mechanisms: POSIX semaphores - and pthread cross-process mutexes are not used by default; on - Solaris, fcntl locks are used by default. [Joe Orton] - - *) Add apr_threadattr_guardsize_set() for overriding the default stack - guard area size for created created by apr_thread_create(). - [Joe Orton] - - *) Add apr_shm_remove() function for removing a named shared - memory segment. [Amit Athavale ] - - *) Add apr_strtoff() function for converting numeric strings into - apr_off_t values. [André Malo , Joe Orton] - - *) Fix stack overflow with IPv6 apr_socket_accept() on Win32. - PR 28471. [inoue ] - - *) Add new functions apr_signal_block, apr_signal_unblock to block/unblock - the delivery of a particular signal. [Madhusudan Mathihalli] - - *) Add support for developers to use their own hashing function with - apr_hash_make_custom. [Ami Ganguli ] - - *) Support "large files" by default on 32-bit Unix platforms which - implement the LFS standard. [Joe Orton] - - *) Add apr_threadattr_stacksize_set() for overriding the default - stack size for threads created by apr_thread_create(). - [Jeff Trawick] - - *) The whole codebase was relicensed and is now available under - the Apache License, Version 2.0 (http://www.apache.org/licenses). - [Apache Software Foundation] - - *) Switch to a single, top-level make. [Greg Stein] - - *) new error status APR_STATUS_IS_ENOTENOUGHENTROPY, Doxygen fixes - [Sander Temme apr_socket_accept - apr_allocator_get_mutex -> apr_allocator_mutex_get - apr_allocator_get_owner -> apr_allocator_owner_get - apr_allocator_set_max_free -> apr_allocator_max_free_set - apr_allocator_set_mutex -> apr_allocator_mutex_set - apr_allocator_set_owner -> apr_allocator_owner_set - apr_atomic_add -> apr_atomic_add32 - apr_atomic_cas -> apr_atomic_cas32 - apr_atomic_dec -> apr_atomic_dec32 - apr_atomic_inc -> apr_atomic_inc32 - apr_atomic_read -> apr_atomic_read32 - apr_atomic_set -> apr_atomic_set32 - apr_bind -> apr_socket_bind - apr_compare_groups -> apr_gid_compare - apr_compare_users -> apr_uid_compare - apr_connect -> apr_socket_connect - apr_current_userid -> apr_uid_current - apr_explode_localtime -> apr_time_exp_lt - apr_explode_time -> apr_time_exp_tz - apr_filename_of_pathname -> apr_filepath_name_get - apr_file_set_inherit -> apr_file_inherit_set - apr_file_unset_inherit -> apr_file_inherit_unset - apr_getsocketopt -> apr_socket_opt_get - apr_get_groupid -> apr_gid_get - apr_get_groupname -> apr_gid_name_get - apr_get_home_directory -> apr_uid_homepath_get - apr_get_userid -> apr_uid_get - apr_get_username -> apr_uid_name_get - apr_group_name_get -> apr_gid_name_get - apr_implode_gmt -> apr_time_exp_gmt_get - apr_is_fnmatch -> apr_fnmatch_test - apr_listen -> apr_socket_listen - apr_lstat -> apr_stat - apr_pool_get_abort -> apr_pool_abort_get - apr_pool_get_parent -> apr_pool_parent_get - apr_pool_set_abort -> apr_pool_abort_set - apr_pool_sub_make -> apr_pool_create_ex - apr_proc_other_child_read -> apr_proc_other_child_alert - apr_recv -> apr_socket_recv - apr_recvfrom -> apr_socket_recvfrom - apr_send -> apr_socket_send - apr_sendfile -> apr_socket_sendfile - apr_sendto -> apr_socket_sendto - apr_sendv -> apr_socket_sendv - apr_setsocketopt -> apr_socket_opt_set - apr_shutdown -> apr_socket_shutdown - apr_signal_get_description -> apr_signal_description_get - apr_sockaddr_ip_set -> apr_sockaddr_info_get - apr_sockaddr_port_get -> (access directly) - apr_sockaddr_port_set -> apr_sockaddr_info_get - apr_socket_create_ex -> apr_socket_create - apr_socket_set_inherit -> apr_socket_inherit_set - apr_socket_unset_inherit -> apr_socket_inherit_unset - FNM_NOMATCH -> APR_FNM_NOMATCH - FNM_NOESCAPE -> APR_FNM_NOESCAPE - FNM_PATHNAME -> APR_FNM_PATHNAME - FNM_PERIOD -> APR_FNM_PERIOD - FNM_CASE_BLIND -> APR_FNM_CASE_BLIND - MAX_SECONDS_TO_LINGER -> APR_MAX_SECONDS_TO_LINGER - - The following interfaces have function argument changes: - - apr_mmap_dup - apr_socket_create - - The following header files have been removed: - - apr_compat.h - -Changes with APR 0.9.5 - - *) Fix apr_snprintf() to respect precision for small floating point - numbers. PR 29621. [Artur Zaprzala ] - - *) Add command type APR_SHELLCMD_ENV for creating a process - which is started by the shell and which inherits the parent's - environment variables. [Jeff Trawick] - - *) Don't try to enable run-time linking on AIX < 4.2, as this - results in invalid linker options being used. PR 29170. - [Jeff Trawick] - - *) Don't assume getnameinfo() can handle IPv4-mapped IPv6 addresses - on any platforms. - [Jeff Trawick, Joe Orton, Colm MacCárthaigh ] - - *) Support setuid, setgid and sticky file permissions bits on Unix. - [André Malo] - - *) Fix sign error in apr_file_seek(APR_END). - [Greg Hudson ] - - *) Provide workaround for socklen_t declaration problem with 64-bit - build on HP-UX. Stop setting a PA-RISC-specific compile option - on ia64. Look for -mt thread option, which is used with HP-UX - vendor compiler on ia64. [Jeff Trawick, based on idea from - Madhusudan Mathihalli] - - *) Return an error instead of silently failing when apr_poll() is - used with file descriptors >= FD_SETSIZE. (Unix systems with - no native poll()) [Jeff Trawick, Brad Nicholes] - - *) Fix handling of negative numbers in apr_strtoi64() on platforms - without strtoll. [Joe Orton] - - *) Fix printing apr_int64_t values smaller than LONG_MIN on 32-bit - platforms in apr_vformatter. [Joe Orton] - - *) Fix apr_socket_opt_set with APR_IPV6_V6ONLY flag. Fixes httpd - Listen IPv6 socket behavior on FreeBSD 5.x, OpenBSD, NetBSD. - [Justin Erenkrantz] - - *) Fix apr_time_exp_get() for dates in 2038. - [Philip Martin ] - - *) Add APR_LARGEFILE flag to allow opening files with the - O_LARGEFILE flag; not recommended for general use, see - include/apr_file_io.h. [Joe Orton] - - *) Various build fixes: thread_rwlock.c on some Solaris platforms - (PR 22990); filestat.c on ReliantUnix (PR 22990); config.status - on IRIX (PR 19251). [Various] - - *) Use NI_NAMEREQD instead of NI_NUMERICHOST in - APR_CHECK_GETNAMEINFO_IPV4_MAPPED. PR 24469. [Justin Erenkrantz] - - *) Ensure that apr_sockaddr_info_get() does not return anything - other than AF_INET and AF_INET6 addresses. [Joe Orton] - - *) Clarify that apr_dir_read() does not guarantee order of returned - entries as previously claimed. [Joe Orton] - - *) The whole codebase was relicensed and is now available under - the Apache License, Version 2.0 (http://www.apache.org/licenses). - [Apache Software Foundation] - - *) Define apr_off_t as long rather than as off_t on platforms with a - 32-bit off_t to prevent incompatibility with packages such as - Perl which redefine the size of off_t via _FILE_OFFSET_BITS on - some platforms. [Ben Reser ] - - *) apr_socket_connect(): allow app to make subsequent call on - non-blocking socket. [Jeff Trawick] - - *) Add apr_os_pipe_put_ex(), which allows the caller to tell APR - to establish a cleanup on the pipe. [Jeff Trawick, Brad Nicholes] - - *) Fix make_exports.awk to work with apr-iconv. [Justin Erenkrantz] - -Changes with APR 0.9.4 - - *) win32: fix apr_file_dup() and apr_file_dup2() to dup the - ungetchar member [Stas Bekman] - - *) Preserve leading '../' segments as when merging to an empty and - unrooted path - fixes a bug observed in SVN with Win32/Netware/OS2. - [Mike Pilato , William Rowe] - - *) Work around a bug in Darwin when calling getnameinfo() on IPv4-mapped - IPv6-addresses. [Colm MacCárthaigh , Jeff Trawick, - Justin Erenkrantz] - - *) Add apr_temp_dir_get() for getting the most suitable temp directory - [Mike Pilato , Thom May] - - *) Modify apr_sockaddr_info_get to call the resolver when we - do not have a hostname. Also, fix bugs in the getaddrinfo() - implementation. - [Colm MacCárthaigh , Justin Erenkrantz] - - *) Change the behavior of unix process 'trylock's to return - APR_ENOTIMPL instead of segfaulting, consistent with the - other lock implementations. [William Rowe] - - *) Fix a subtle race where the ownership of a unix nested - thread lock could be corrupted when the prior owner released - the lock with another thread waiting on the same lock. - [William Rowe] - - *) apr_socket_data_set(): allow the same key to be used for - multiple sockets in the same pool. [Jeff Trawick] - - *) Add new table function apr_table_compress() and replace - red-black trees with mergesort in apr_table_overlap() - [Joe Schaefer , Brian Pane] - - *) Win32: Adopt Brian Havard's OS/2 rwlock implementation for - Windows [Marc Adkins, Bill Stoddard] - - *) Add apr_proc_mutex_lockfile() for retrieving the name of the - file associated with a mutex. [Jeff Trawick] - - *) Don't require the lock file name to be passed into - apr_proc_mutex_child_init() or apr_global_mutex_child_init(). - This allows child init to work when the lock file was a temp - file created by APR. (The problem only occurred with flock- - based mutexes.) [Jeff Trawick] - - *) When using a temporary file for flock- and fcntl-based mutexes, - don't let the file be deleted on close. For flock-based mutexes, - this corrects a fatal problem, since the file would disappear - when a program was spawned and cleanup-for-exec was performed, - and a subsequent attempt to perform child process mutex - initialization would fail. For fcntl-based mutexes, this was a - very minor issue that resulted in a failing unlink() when the - file was closed, since fcntl lock initialization always removes - the file immediately. [Jeff Trawick] - - *) When writing to pipes with a timeout set, handle the situation - where the kernel says the pipe is writable but an attempt to - write <= PIPE_BUF bytes gets EAGAIN. APR will now write whatever - data will fit. APR applications that relied on the atomic nature - of relatively small pipe write requests may be affected. - PR 20295 [Mark Street , Jeff Trawick] - - *) Define _THREAD_SAFE for all compilations on AIX. Previously - those of us who used the vendor compiler had it defined - implicitly and others did not. The difference became obvious - with the recent thread safety fixes to apr_password_validate(). - PR 20420 [Jeff Trawick] - - *) For apr_proc_detach(APR_PROC_DETACH_FOREGROUND), don't treat - a setsid() failure as fatal, as the usual cause is that the - caller is already a process group leader. PR 18519 - [Jeff Trawick] - - *) Fix some problems with non-blocking socket handling on unix - that resulted in infinite timeouts being used for non-blocking - sockets with apr_socket_connect() and some read/write calls. - [Jeff Trawick] - - *) Fix a bug in socket timeout handling on unix that left the - socket non-blocking after disabling the timeout. - [Jacob Craig Lewallen ] - - *) Added flag APR_FILE_ATTR_HIDDEN for manipulating the "hidden" - file attribute on Windows and OS/2. [Branko Čibej] - - *) SECURITY [CAN-2003-0245]: Fixed a bug that could be triggered - remotely through mod_dav and possibly other mechanisms, causing - an Apache child process to crash. The crash was first reported - by David Endler and was researched and - fixed by Joe Orton . Details will be released - on 30 May 2003. - - *) apr_proc_wait(): Handle interrupted waitpid(2) calls by calling - it repeatedly until it succeeds or fails with errno other than - EINTR. This hides this UNIX-specific behavior from APR clients. - - *) Removed the solaris-specific atomic code, due to licence - concerns (it was MPL 1.0, and the author could not be contacted) - [Ian Holsman] - - *) apr_file_gets(): Return APR_SUCCESS if any characters are - returned. Any I/O errors or EOF will be reported on the - next call. Callers that are coded to expect returned - data + APR_EOF when there is no final newline are affected - by this change. [Jeff Trawick] - - *) apr_proc_create() on Unix: Make the APR_SHELLCMD mode work - when there is more than one program argument passed in. - [Jeff Trawick] - - *) Add --cc and --cpp flags to apr-config. [Jeff Trawick] - - *) Don't segfault trying to close a file in error paths of flock - and fcntl mutex creation. PR 19036 [Jeff Trawick] - - *) Add %pT support to apr_snprintf() for printing an apr_os_thread_t. - [Jeff Trawick] - - *) Add APR_TCP_NODELAY_INHERITED & APR_O_NONBLOCK_INHERITED to apr.hw - [Allan Edwards] - - *) Add APR_UINT64_T_HEX_FMT. [Jeff Trawick] - - *) Add parameter to APR_SUBDIR_CONFIG to drop options passed to configure - before the subdir's configure is invoked. - [Jeff Trawick, Justin Erenkrantz] - - *) Implement APR_SO_RCVBUF socket option on Unix. - [Adam Sussman ] - - *) Don't add the math library (-lm) if the modf() function - is already available via libc. [Roy Fielding] - - *) Solaris cc: Don't use the -mt option for threaded builds. That - is for non-Posix threading, and the use of it prevented us from - linking with -lpthread, which in turn caused weird problems for - APR applications. [Kristofer Spinka ] - - *) OS/2: apr_stat() fixes - When a character device is stat'ed, - fill in finfo.name if it was asked for. Return APR_INCOMPLETE - when appropriate. Addresses httpd incident [CAN-2003-0134]. - [Brian Havard] - -Changes with APR 0.9.3 - - *) Don't enable posixsem, at build time, on systems where sem_t * - won't "fit" into an int (sizeof-wise). Also, better error handling - when we fail to create a posixsem. PR 17186 [Scott Herod - , Jim Jagielski] - - *) Default hpux 10.x to disable threading, since if it exists at all - the pthread implementation should not be trusted, while hpux 10 - had its own threads implementation that is no longer supported. - PR 9457 [William Rowe] - - *) Fix error in apr-config when symlinks are involved. - [Garrett Rooney ] - -Changes with APR 0.9.2 - - *) Numerous bug fixes for file and socket inheritence by child - processes on Unix, correcting bugs that affected the correct - behavior of apr_[file|socket]_inherit_[un]set() API. - [Bjoern A. Zeeb , William Rowe, Joe Orton] - - *) Define APR_UINT64_T_FMT and APR_UINT64_T_FMT_LEN. - Define APR_INT64_T_FMT_LEN on Windows and Netware. [Branko Čibej] - - *) Correct apr_file_gets() on OS2 and Win32 so that '\r's are no longer - eaten, and apr_file_gets() -> apr_file_puts() moves the contents - uncorrupted. [William Rowe] - - *) Alter Win32's handling of the apr_proc_t hproc member, so that we - close that system handle wherever an apr function would invoke the - final waitpid() against a zombie process on Unix. [William Rowe] - - *) APR_MAX_SECONDS_TO_LINGER and APR_FNM_* #defines replace their - old undecorated names (missing APR_ prefix). The old names will - disappear with APR 1.0.0. - [Craig Rodrigues , William Rowe] - - - *) When generating a semaphore name for posixsem locking, try to - be a little more robust (and unique). [Jim Jagielski] - - *) Add functions apr_env_get, apr_env_set and apr_env_delete for - manipulating the environment. [Branko Čibej] - - *) Fix APR_LAYOUT to work with layout files with no preceding blank lines - and emit errors when layout is not found. PR 15679. - [Justin Erenkrantz] - - *) Add functions apr_filepath_list_split and apr_filepath_list_merge - for managing search paths. [Branko Čibej] - - *) Introduce Release mode debugging symbols for Win32 builds of apr. - All library builds gain /Zi for debug symbols (which are discarded - at link time if some flavor of the /debug flag isn't passed to link) - and .dll builds gain .pdb symbols. [Allen Edwards, William Rowe] - - *) Add two new proc attributes to improve diagnostics for - apr_proc_create() failures on platforms where fork()+exec() is used. - See the doc for apr_procattr_child_errfn_set() and - apr_procattr_error_check_set(). [Jeff Trawick] - - *) Rename rules.mk to apr_rules.mk and make apr_rules.mk be installed. - [Thom May] - - *) Fix a bug in apr_proc_create() that could cause a new child process - to run the parent's code if setrlimit() fails. [Jeff Trawick] - - *) Disable apr_socket_sendfile() on 64-bit AIX to avoid an apparent - system problem. PR 11408. [Jeff Trawick] - - *) Add --includedir flag to apr-config. [Justin Erenkrantz] - - *) Only include sys/syslimits.h if we don't have limits.h - [Craig Rodrigues , Garrett Rooney - , Thom May] - - *) Allow apr-config to work in symlinked install directories when - 'realpath' is available. [Justin Erenkrantz] - - *) Namespace protect the header files in include/arch - [Thom May] - - *) Add function apr_filepath_encoding and associated constants. - [Branko Čibej] - - *) Allow apr_hash to have greater than int number of elements. - [Justin Erenkrantz] - - *) Allow generation of dependencies by non-GCC compilers. - [Justin Erenkrantz] - - *) Prevent obscenely large values of precision in apr_vformatter - from clobbering a buffer. [Sander Striker, Jim Jagielski] - - *) limit the renames performed in apr_rename.pl to the most recent renames. - [Thom May] - - *) Changed apr_mmap_dup() and friends so that there's no longer any - is_owner concept on the mmaped region, but rather something more - along the lines of a reference count. This allows the old apr_mmap_t - to still be used safely when the new apr_mmap_t is in a disjoint pool. - [Cliff Woolley, Sander Striker] - - *) Fix a bug in apr_hash_merge() which caused the last entry in the - overlay hash to be lost. PR 10522 [Jeff Trawick] - - *) Add DougM's apr_rename.pl script into helpers, and update for the new - batch of updates [Thom May] - - *) Renames done (deprecated functions wrapped): - apr_filename_of_pathname -> apr_filepath_name_get - apr_get_groupid -> apr_gid_get - apr_get_groupname -> apr_gid_name_get - apr_compare_groups -> apr_gid_compare - apr_parse_addr_port -> apr_port_addr_parse - apr_shutdown -> apr_socket_shutdown - apr_bind -> apr_socket_bind - apr_listen -> apr_socket_listen - apr_accept -> apr_socket_accept - apr_connect -> apr_socket_connect - apr_send -> apr_socket_send - apr_sendv -> apr_socket_sendv - apr_sendto -> apr_socket_sendto - apr_implode_gmt -> apr_time_exp_gmt_get - apr_get_home_directory -> apr_uid_homepath_get - apr_get_userid -> apr_uid_get - apr_current_userid -> apr_uid_current - apr_compare_users -> apr_uid_compare - apr_get_username -> apr_uid_name_get - apr_recvfrom -> apr_socket_recvfrom - apr_sendfile -> apr_socket_sendfile - apr_recv -> apr_socket_recv - [Thom May] - - *) Add APR_IPV6_V6ONLY socket option. [Jeff Trawick] - - *) Update timeout algorithm in free_proc_chain. If a subprocess - did not exit immediately, the thread would sleep for 3 seconds - before checking the subprocess exit status again. In a very - common case when the subprocess was an HTTP server CGI script, - the CGI script actually exited a fraction of a second into the 3 - second sleep, which effectively limited the server to serving one - CGI request every 3 seconds across a persistent connection. - [Bill Stoddard, Kai.Risku@arrak.fi] - - *) Update doxygen tags. [Justin Erenkrantz] - - *) NetWare: implemented a file IO path context scheme to directly - reference directory paths and files in the file system rather - than having to traverse the file system on every stat() or - open() call. (Performance enhancement) [Brad Nicholes] - - *) ReliantUnix: recognize that dlsym() is in libdl and dlopen() is in - libc. The check is generic so maybe this fixes some other system. - PR 14189 [Jeff Trawick] - - *) Win32: Fix APR_APPEND file i/o. [Bill Stoddard] - - *) Fix a problem retrieving the remote socket address for sockets - created via apr_os_sock_put() or apr_os_sock_make(). [Jeff Trawick] - - *) Add recognition of and socket API support for the SCTP protocol. - [Randall Stewart ] - - *) Win32: apr_shutdown was not honoring apr_shutdown_how_e and - always shutting down the socket for read. This could result - in Apache HTTPD 2.0 clients getting early connection closures - because lingering_close() was broken. [Bill Stoddard, Allan Edwards] - - *) Add apr_atomic_casptr() to support atomic compare-and-swap - of pointers [Brian Pane] - - *) Add apr_socket_create_ex() to allow protocol to be specified for the - socket. With APR 1.0, this function will be removed and apr_socket_create() - will have the additional parameter. - [Randall Stewart ] - - *) Fix the detection of INT64_C() when defined in . - [Joe Orton ] - - *) Don't use whitespace before preprocessor directives in the configure - logic. Such whitespace breaks with some older preprocessors; a - particularly nasty break occurs on Tru64 4.0f where APR_CHECK_DEFINE - will always succeed. [Joe Orton ] - - *) Add APR_IPV4_ADDR_OK flag to apr_sockaddr_info_get() to allow - apps to avoid lookup of IPv6 address if IPv4 address is sufficient. - (New APR_IPV6_ADDR_OK flag is similar.) [Jeff Trawick] - - *) Disable IPv6 support on Darwin. The current IPv6 support has a - problem in getnameinfo() which breaks certain applications. - [Sander Temme , Jeff Trawick] - - *) Support for SCO OpenServer Release 5 [Kean Johnston ] - - *) Faster (inline and mutex-free) implementations of all apr_atomic - operations for Linux/x86 (requires a 486 or later; to enable, - configure APR with --enable-nonportable-atomics=yes ) [Brian Pane] - - *) Add --bindir option to apr-config. [Justin Erenkrantz] - - *) Begin to rehash the test suite. There is now a new test program called - testall. This program currently runs testtime and teststr with the - CuTest framework. The stand-alone programs for testtime and teststr - can be built, but only if a special flag is specified when building. - [Ryan Bloom] - - *) Fix a broken check for a failure to read from the random device file. - PR 12615 [tenthumbs@cybernex.net] - - *) Print informative link errors on Darwin. [Justin Erenkrantz] - -Changes with APR 0.9.1 - - *) Fixed usage of alloca in apr_poll() on Tru64 - [Dave Hill ] - - *) Running "make check" in the toplevel directory or the test/ directory - will build and run all test programs. [Aaron Bannert] - - *) Add apr_array_pop(). [Justin Erenkrantz] - - *) Fixed the native SPARC v8plus version of apr_atomic_dec - to match the semantics of the default C version [Brian Pane] - -Changes with APR 0.9.0 - - *) If the length argument to apr_snprintf is 0, then we should return the - length that the string would be if we actually were going to fill it out. - However, if the length argument is 0, we can also accept a NULL string. - Also, added a test case for this. [Ryan Bloom] - - *) Printing a string with apr_snprintf can seg fault, if a precision is - specified for the string, and the string being printed doesn't have a - trailing '\0'. Fix that seg fault by not calling strlen if a precision - is specified when printing a string. Also add a test to the test suite - for this case. - [R Samuel Klatchko ] - - *) handle leak related to threads on Windows2000/XP - [INOUE Seiichiro ] - - *) Includes moved to INCLUDEDIR/apr-{major} (e.g. /usr/include/apr-0) - [Greg Stein] - - *) libtool versioning is used to give the library sonames a real - value. The libraries will be libapr-{major}.so.0.{minor}.{patch} - [Greg Stein] - - *) Fix apr_tokenize_to_argv() to remove the escape character - (backslash) from the argument tokens. PR 11793 [Paul J. Reder] - - *) Add APR_PARSE_ARGUMENTS and APR_LAYOUT macros for better layout - support. [Thom May] - - *) Add parallel-apr layout which utilizes the major version number in - directories and library names. [Justin Erenkrantz] - - *) Add a version number to the library name (e.g. libapr-1.so) so - that apps can do things like: -lapr-1 or -lapr-2, depending on - which version they want to use and link against. [Greg Stein] - - *) Add --version to apr-config so that apps can retrieve the version - information of the (installed) APR. [Greg Stein] - - *) Remove the APRVARS system; apps should use apr-config. [Greg Stein] - - *) EBCDIC: fix compile failure in strings/apr_strings.c in - httpd-2.0.40 with the following error message: - CANNOT COMPILE apr_strtoi64(), only ASCII and EBCDIC supported - - *) In apr_signal_thread() remove synchronous signals from the mask - passed to sigwait(). It is never valid for them to be there. - Some platforms silently ignore them, some return EINVAL, some - don't process it as desired. [Jeff Trawick] - - *) Change config.nice generation to always expand variables. - [Justin Erenkrantz] - - *) Renamed apr_strtoll()/apr_atoll() to follow int64 convention, - so these new helpers are apr_strtoi64/apr_atoi64(), since - 'll' (long long) is a nonportable and aspecific construct. - Used ac/m4 tests to choose the appropriate fn behind strtoi64. - [William Rowe] - - *) don't perform a strlen on that name value without checking for NULL - first (in getopt) - [David Waite , Ian Holsman] - - *) Added apr_strtoll() and apr_atoll() to strings lib. - [Shantonu Sen , Wilfredo Sanchez] - - *) Added a lightweight internal index to apr_table_t to speed up - table lookup operations [Brian Pane] - - *) initalize handle members to invalid before calling createprocess - on win32 [Rob Saccoccio ] - - *) Removed apr/i18n to apr-util/xlate for inclusion of apr-iconv - as required by missing libiconv. [William Rowe] - - *) Removed apr/md5 and apr/uuid into apr-util/crypto. [William Rowe] - - *) Add APR_BUFFERED support to apr_os_file_put(). [Justin Erenkrantz] - - *) Fix misinterpretation of timeout for select() on Win32/Netware. - Identified by [TANAKA Koichi ] - - *) Re-write apr_poll() on Unix. This improves the performance by - giving the user back control over the memory in the pollset. - [Ryan Bloom] - - *) Added APR_LIMIT_NOFILE option to apr_procattr_limit_set() to - control the file descriptor limit on platforms that support - RLIMIT_NOFILE. [Brian Pane] - - *) FreeBSD: change apr_sendfile to accomodate a 4.6 kernel patch. - [Greg Ames] - - *) Faster code for the apr_table get/set functions [Brian Pane] - - *) Fix the userid functions on Irix to handle the way that Irix - reports a failure from getpwnam_r(). PR 10095. - [Robert I. Cowles , Jeff Trawick] - - *) apr_table_do() and apr_table_vdo() now return an int rather than - void to indicate whether or not any of its iterations returned 0. - [Cliff Woolley] - - *) Fix the definition of union semun so that it is valid on systems - where sizeof(long) != sizeof(int). This resolves a hang on - HP-UX/Itanium. - [Madhusudan Mathihalli ] - - *) Correct shared library support on Darwin to not fatally error out - when a shared library does not exist. [Justin Erenkrantz] - - *) Added optimized atomic CAS support for Linux/x86 (available only - when APR is configured with --enable-nonportable-atomics=yes) - [Brian Pane] - - *) Fix a compile error in the EGD support in rand.c on older Solaris - versions. PR 9976 [Jim Morris ] - - *) Fixed apr_file_seek() to unset the eof_hit flag. [Stas Bekman] - - *) Removed --disable-atomics flag and added --enable-nonportable-atomics, - thereby defaulting to portable binaries on those systems that could - be optimized at the expense of portability. PR: 9507 [Aaron Bannert] - - *) Added 2 additional lock functions: apr_proc_mutex_name and - apr_proc_mutex_defname which returns the type name of the mutex - (eg: "sysvsem") as well as the default mutex type (APR_LOCK_DEFAULT). - Mostly useful under Unix were the locktypes are selectable. - [Jim Jagielski] - - *) Fixed apr_generate_random_bytes() for Win32 on Win NT or 9x by - dropping the 0x40 bit (CRYPT_SILENT) for earlier OS'es. - PR 9286 [William Rowe] - - *) Added --with-devrandom=[DEV] configure flag which allows a particular - "/dev/random"-compatible device to be specified, overriding the - default search path (/dev/random then /dev/arandom then /dev/urandom). - Also, if --with-egd= is specified, it now implies - --without-devrandom. [Cliff Woolley] - - *) Darwin/Mac OS X: Don't leave zombie processes when the app calls - apr_signal(SIGCHLD, SIG_IGN). This fixes a problem with Apache's - mod_cgid. PR 9168. [Jeff Trawick] - - *) Win32: Fix bug where apr_sendfile() was incorrectly returning - APR_SUCCESS on a TransmitFile call that was interrupted by - the client closing its end of the connection. Always call - GetOverlappedResults() to get results of async TransmitFile() - completion notification. [Bill Stoddard] - - *) Renamed APR_XtOffset -> APR_OFFSET and APR_XtOffsetOf -> APR_OFFSETOF. - [Cliff Woolley] - - *) Cygwin: the unix version of apr_file_open() must respect the - APR_BINARY flag if the underlying platform requires it (in - which case we assume O_BINARY is defined). PR 9185. - [Cliff Woolley] - - *) Linux, AIX: Use crypt_r() instead of crypt() because the native - crypt() is not thread-safe. The misuse of crypt() led to - intermittent failures with Apache basic authentication when crypt - passwords were being used. [Jeff Trawick] - - *) AIX: Global mutexes don't need an intraprocess mutex when SysV - sems are used for the crossprocess mutex. - Darwin: The same optimization was applied for Posix sems. - [Jeff Trawick] - - *) Fix a problem with global mutexes on OS/390 when something other - than the default mechanism (SysV sem) was used. The mutexes didn't - necessarily block out other threads in the same process. - [Jeff Trawick] - - *) Fixed apr_strfsize formatting of values over 1 gig - [Matsuzaki Yoshinobu ] - - *) Renamed --disable-atomics as --disable-optimized-atomics, - since it doesn't really disable the atomics. [Aaron Bannert] - - *) Converted apr_pcalloc to a macro [Brian Pane] - - *) Fixed APR_STATUS_IS_ETIMEDOUT macro. - [Dagfinn Aarvaag ] - - *) Add --disable-atomics switch to override our handcoded assembly - optimizations. Note that this has no effect if your operating - system has a userspace atomic interface. [Justin Erenkrantz] - - *) Remove Linux atomic support since it does not have a usable - userspace atomic interface. [Justin Erenkrantz] - - *) Don't require that the DNS can map 127.0.0.1 when checking for - the presence/usability of getnameinfo(). PR 7642. [Jeff Trawick] - - *) Remove APR_WANT_SIGNAL from apr_want.h because code must include - apr_signal.h in order to get consistent definitions. [Roy Fielding] - - *) Don't try to use /dev/zero and mmap on platforms that don't - support that (such as HP-UX). PR 8537. [Justin Erenkrantz] - - *) Reduce the number of apr_sendfile calls on AIX and OS/390 by - remembering when the kernel tells us the next one will block. - [Jeff Trawick] - - *) Reduce the number of apr_sendfile calls on FreeBSD by remembering - when the kernel tells us the next one will block. [Greg Ames] - - *) To support modules like PHP, which implement their own - loaded extensions, Darwin needs to place their public - symbols in the global table. [Marko Karppinen , - Jim Jagielski] - - *) Rename apr_get_groupname to apr_group_name_get. - [Thom May ] - - *) Allow VPATH builds to properly build dependencies and switch to - a .deps dependency model to mimic httpd-2.0. [Justin Erenkrantz] - - *) Tru64: Stop leaving zombies in APR apps like mod_cgid which - tell APR to ignore SIGCHLD. - [Dave Hill ] - - *) Ensure that the ATOMIC_HASH can not be negative. - [Joe Orton ] - - *) Fix a problem with eof reporting with Unix file I/O on - unbuffered files. [Stas Bekman ] - - *) Rename apr_explode_time to apr_time_exp_tz. - [Thom May ] - - *) Rename apr_explode_localtime to apr_time_exp_lt. - [Thom May ] - - *) Set precompiler for Solaris atomics when using GNU binutils. - PR 7876. [solomon@conceptshopping.com (Marvin Solomon)] - - *) AIX: Fix breakage with 64-bit builds on versions of AIX prior - to 5L. PR 7957 [Jeff Trawick] - - *) On socket write functions (apr_sendfile, apr_send, apr_sendv), - added a select to wait for writability on the socket if the - previous write was incomplete. [Jeff Trawick, Brian Pane] - - *) Deprecated the apr_lock.h API. Please see the following files - for the improved thread and process locking and signaling: - apr_proc_mutex.h, apr_thread_mutex.h, apr_thread_rwlock.h, - apr_thread_cond.h, and apr_global_mutex.h. [Aaron Bannert] - - *) Fix some daylight savings time breakage on (at least) AIX, - Solaris, and HP-UX. [Jeff Trawick] - - *) Added support for Posix semaphores (sem_open, et.al.) for mutex - locking. We use named semaphores in this implementation. The - default priority is between pthread and sysvsem. - [Jim Jagielski] - - *) Get flock-based mutexes to work in apps like Apache. Use the - same permissions on flock- and fcntl-based mutexes as Apache - 1.3. [Jeff Trawick] - - *) Fix apr-config so that it will not attempt to cd to a non-existent - directory. [Justin Erenkrantz] - - *) Change the ordering of the apr_lock implementation method to - better match what's done in Apache 1.3. The ordering is - now (highest to lowest): pthread -> sysvsem -> fcntl -> flock. - [Jim Jagielski] - - *) Improve detection of the INT64_C macro to prevent problems - with HP-UX's ANSI C compiler. PR 8932. [Justin Erenkrantz] - - *) Make sure gethostbyname() can handle 255.255.255.255 if we - are to trust it to handle numeric address strings in - apr_sockaddr_info_get(). This fixes a problem on HP-UX - which led to an assertion failure at Apache startup when - using vhosts. [Jeff Trawick] - - *) Don't mask SIGUSR2 [Jin Hong ] - - *) Load libraries if they not MH_BUNDLE, but if they are not, it - just attempts to link them as shared libs. - [Pier Fumagalli ] - - *) apr_atomic_dec now returns a zero value if the value of - the atomic is zero, non-zero otherwise [Ian Holsman] - - *) When opening a file, only create an internal thread mutex - if APR_XTHREAD is set. [Brian Pane] - - *) Move the kill_conditions enum in apr_thread_proc.h into the - APR namespace. kill_after_timeout et al have been renamed - appropriately (e.g., APR_KILL_AFTER_TIMEOUT). [Jeff Trawick] - - *) Fix a segfault in apr_thread_rwlock_destroy() on Win32. - [INOUE Seiichiro ] - - *) configure now checks to see if we can change DNS timeout values - [Ian Holsman] - - *) Fix a bug in apr_file_seek() on Unix when using buffered - files. PR 10003 [Jeff Trawick] - - *) Small table performance optimization: eliminate the - zero-fill of newly allocated elements when expanding - a table's size. [Brian Pane] - - *) Allow APR to install its generated libtool(s) via the - --with-installbuilddir option (defaults to ${datadir}/build). - [Justin Erenkrantz] - - *) renames: apr_ansi_time_to_apr_time becomes apr_time_ansi_put - ap_exploded_time_t becomes apr_time_exp_t - [Thom May ] - - *) Add the APR_FILE_NOCLEANUP flag to apr_file_open(). - Adding the flag will prevent the file from being closed - when the pool passed in on apr_file_open() is destroyed. - This feature is useful when using apr_os_file_get|put() - to manage the apr_os_file_t in apr_file_t (ie, file handle - caching in the HTTP server) [Bill Stoddard] - - *) Win32: Fix APR_XTHREAD problems in apr_file_read() - and apr_file_write(). Multiple threads were using the - same overlapped structure and io event handle created - in the open call, which could cause unpredictable - file i/o results. [Bill Stoddard] - - *) Win32: apr_proc_mutex_trylock and apr_proc_mutex_lock were - incorrectly returning APR_BUSY if the lock was previously - held by a thread that exited before releasing the lock - (ie, if the process holding the lock segfaults). The MSDN - doc says when WaitForSingleObject returns WAIT_ABANDONED, - the calling thread takes ownership of the mutex, so these - two routines should return APR_SUCCESS in this case, not - APR_BUSY. [Bill Stoddard] - - *) Added a new m4 function APR_EXPAND_VAR that will iteratively - interpolate the contents of a variable, such as $sysconfdir, - for use in a borne script. [Aaron Bannert] - - *) apr-atomic support for old-sparc's and gas on solaris - [Dale Ghent , jean-frederic clere, Ian Holsman] - - *) Change apr_proc_detach to take a parameter that can enable/disable - automatic forking (aka, to "daemonize"). - [Jos Backus , Aaron Bannert] - - *) Implement apr_global_lock_foo() on Win32 - [Bill Stoddard] - - *) Fix select() argument call when waiting for IO. PR 9674. - [David MacKenzie ] - - *) Add a new lock API (apr_global_mutex_t) to provide guaranteed - cross-process AND cross-thread mutual exclusion. [Aaron Bannert] - - *) Note: We are in the process of deprecating the apr_lock.h API. - The new and improved lock/synchronization APIs now reside - in apr_thread_mutex.h, apr_proc_mutex.h, apr_thread_rwlock.h, - and apr_thread_cond.h. [Aaron Bannert] - - *) Enable autoconf 2.52{f,g} build support. - [Blair Zajac ] - - *) Added new functions for atomic operations. These are experimental - at the moment, so use in apps is discouraged [Ian Holsman] - - *) Correct serious problems with the Win32 apr_file_dup2 - and apr_file_open_stdxxx() fns. [William Rowe] - - *) Begin implementation of the WinCE port. - [Mladen Turk ] - - *) Disable SHMEM_MMAP_ZERO on HPUX 11.x where it is not supported. - Use SHMEM_SHMGET_ANON instead. [Aaron Bannert] - - *) Fix a few attempts to add to a void * ptr in the Unix shared - memory support code. PR #9710 Per Ekman [pek@pdc.kth.se] - - *) In the Linux apr_sendfile(), fix the types of some parameters - to apr_send() and apr_recv(). Breakage was seen in 64-bit mode - on s/390. PR #9712 [Neale.Ferguson@SoftwareAG-usa.coom] - - *) added APR_PROGRAM_ENV and APR_PROGRAM_PATH options for starting - processes via apr_proc_create() [Greg Stein] - - *) Deprecated apr_pool_free_blocks_num_bytes() [Sander Striker] - - *) Add --enable-pool-debug to make it easier for people to - enable pool debug mode. Removed the APR_POOL_DEBUG_VERBOSE - define that was previously being used. [Sander Striker] - - *) Changed the apr_file_dup2() function prototype. It can only - take and reuse an apr_file_t*, and will no longer create one - if *new_file == NULL (use apr_file_dup() for that). [Aaron Bannert] - - *) Implemented name-based shared memory on Unix. [Aaron Bannert] - - *) Fix spelling mistakes in APRDesign. - [Blair Zajac ] - - *) Ensure that apr_file_mktemp creates the temp file if it isn't there. - [John Sterling ] - - *) Make sure to pre-mark anon SysV shared memory segments as - removed. [Jim Jagielski] - - *) Add --with-efence to allow usage of Electric Fence. - [Justin Erenkrantz] - - *) Updated the pools debug code. Check if a pool is still - valid on the most common apr_pool_xxx functions. - Fix the way APR_POOL_DEBUG_VERBOSE was using stderr. - Make the output somewhat nicer in this debug mode. [Sander Striker] - - *) Add new define APR_POOL_DEBUG_VERBOSE which spits out info - about pool creation/destruction [Ian Holsman] - - *) Fix GMT offset adjustments for platforms that do not have native - GMT offset adjustments. [Jon Travis ] - - *) Add new apr_shm_t API and remove old apr_shmem_t API. The new - API handles both anonymous and name-based shared memory. Anonymous - shared memory segments are only usable on systems with process - inheritance, and so the new API with name-based segments is - usable on platforms like Win32. [Aaron Bannert and William Rowe - with much help from Justin Erenkrantz and Sander Striker] - - *) Add --with-egd to support EGD-compatible entropy gatherers for - those platforms without native support. [Justin Erenkrantz] - - *) apr_lock_create() and apr_proc_mutex_create() now have an - additional parameter for specifying the lock mechanism. - apr_lock_create_np() and apr_proc_mutex_create_np() have been - removed. [Jeff Trawick] - - *) Change the prototype of apr_thread_exit() so that the apr_status_t - is no longer a pointer. It was difficult and sometimes hazardous - to return a apr_status_t* at times, and this allows us to return - the APR_* error codes directly. [Aaron Bannert] - - *) Add apr_sockaddr_equal() for comparing APR sockaddrs. - [Jeff Trawick] - - *) Win32: apr_sendfile() should return APR_ENOTIMPL if - oslevel < WINNT. [Bill Stoddard] - - *) Put new pools code in place which allows applications to - switch off locking on pools operations in case a pool is - guaranteed to never being used in more than one thread - at the same time. We've seen a significant performance - improvement over the old code. [Sander Striker] - - *) Add apr-config - a shell script to allow third-party programs - easy access to APR configuration parameters. [Justin Erenkrantz] - - *) Add find_apr.m4 to allow third-party programs that use APR to - have a standard m4 macro for detection. [Greg Stein] - - *) SEGV in apr_table_overlap [Brian Pane] - - *) apr_array_copy speedup by removing the zero-fill [Brian Pane] - - *) Fix build breakage on systems with getaddrinfo() but not - gai_strerror() (e.g., RedHat 5.2). [Jeff Trawick] - - *) Fix a problem in Unix apr_file_dup() which caused 0 to be returned - by the first read. [Stas Bekman ] - - *) Fix a buglet that caused APR_FILE_BASED_SHM to be set inadvertently - on some platforms (e.g., Linux, AIX). [Jeff Trawick] - - *) Speed up apr_table operations by using a cache/checksum and a - red-black tree in the overlay. - [Brian Pane , Cliff Woolley] - - *) Speed up apr_pool_userdata_set[n] by letting hash_set figure out - the strings length. [Brian Pane ] - - *) New function apr_mmap_dup. This is called in the mmap_setaside. - [Brian Pane ] - - *) Speed up the apr_hash_t implementation's handling of APR_HASH_KEY_STRING. - [Brian Pane ] - - *) Tweak apr_gethostname() so that it detects truncation of the - name and returns an error. [Jeff Trawick] - - *) Fix bug in Darwin DSO code. [Sander Temme] - - *) Fix apr_setup_signal_thread() to grab the right error code from - a sigprocmask() failure. This only affects platforms that use - sigprocmask() in lieu of pthread_sigmask(). [Jeff Trawick] - - *) Fix the Unix HAVE_POLL flavor of apr_poll_socket_mask() so that - it doesn't segfault. Avoid some wasted storage in a poll-related - APR structure. [INOUE Seiichiro ] - - *) Fix apr_setup_signal_thread() so that threads don't block - synchronous signals (e.g., SIGSEGV). It is a programming error - to do so, and some platforms (e.g., Solaris, AIX) don't call any - registered signal handler when such signals are blocked. - [Jeff Trawick] - - *) Change the apr_table_elts macro so that it provides access via - a const pointer instead of a non-const pointer. - [Brian Pane ] - - *) Use strerror_r() where available, since strerror() isn't always - thread-safe. Example systems where strerror() isn't thread-safe: - Linux+glibc, AIX [Jeff Trawick] - - *) Fix some file cleanup problems in apr_proc_create() which could - result in the pipes for stdin/stdout/stderr being closed - immediately. [Jeff Trawick] - - *) New functions apr_hash_[merge|copy], change to overlay fn - so that it calls merge, which does a inline iteration instead - of calling the iterator function. [Brian Pane ] - - *) Introduce the apr_pool_userdata_setn() variant that doesn't - strdup the key. Allows both the _setn() and _set() variant to - accept NULL for the cleanup. [Brian Pane ] - - *) Re-vamp the apr_proc_wait and apr_proc_wait_all functions. We - now return the exit code from the program and a reason that the - program died, either normal exit or signalled. - [Jeff Trawick and Ryan Bloom] - - *) Implement portable accessors for proc mutex. These are equivalent - to apr_os_lock_get/set, but they work for apr_proc_mutex_t types - instead. [Aaron Bannert] - - *) Added a new parameter to apr_thread_mutex_init(). Now, by default, - thread mutexes are not nested (sometimes called "recursive"). To - enable nested mutexes, a flag must be passed to the init script. - Non-nested mutexes are much faster than nested ones. - [Aaron Bannert] - - *) read_with_timeout in apr/file_io/win32/readwrite.c incorrectly - returned APR_SUCCESS instead of APR_EOF when PeekNamedPipe failed - and the result from GetLastError() was ERROR_BROKEN_PIPE. Because - of this, the pipe wasn't closed as soon as it could be. - [Tim Costello ] - - *) Fix a problem in the Win32 pipe creation code called by - apr_proc_create(): It didn't register cleanups for either the - read or the write ends of the pipe, so file handles (and event - handles for pipes with asynchronous I/O mode set) are never - closed. [Tim Costello ] - - *) Add support for QNX 6. [J.T. Conklin ] - - *) We now create exports.c and export_vars.h, which in turn create - exports.c. From this we generate two more files with different - purposes: apr.exp - list of exported symbols; and exports.lo - (exports.o) - an object file that can be linked with an executable - to force resolution of all apr symbols. [Aaron Bannert] - - *) Add the apr_thread_cond_timedwait function to the condition - variable API. [Aaron Bannert] - - *) Fixed apr_file_mktemp on systems without mkstemp (Win32, etc). - [Mladen Turk, Cliff Woolley] - - *) Fix a segfault in apr_poll_clear on Unix. Also fix the logic - for the case where there are multiple events ORed together in - the events list. [Jamshid Mahdavi ] - - *) Files opened on Unix with the flag APR_DELONCLOSE are now - not unlinked until they are actually closed, rather than as - soon as they're opened. The old approach worked but made - handling temp files harder. [Cliff Woolley] - - *) Fix potential segfault when closing a file on Unix. If - apr_file_close() was called and it failed, it would not - deregister the file cleanup. Therefore the cleanup would - be run again later on a now-invalid descriptor. [Cliff Woolley] - - *) Introduce apr_pool_lock for debugging, in combination with - ALLOC_USE_MALLOC + DEBUG_WITH_MPROTECT. Only implemented - on Win32 today, very effective for debugging pool constness. - [William Rowe] - - *) Optimize apr_pstrcat by caching lengths of first 6 strings - [Brian Pane ] - - *) Add pool accessors to the apr_thread_mutex_t datatype. - [Aaron Bannert ] - - *) Add the apr_file_mktemp function. This creates and opens a - temporary file, for use by the program. This file is created - delete_on_close. The initial implementation only works on - Unix, but Windows is coming soon. [Ryan Bloom] - - *) Make the unix version of apr_proc_wait_all_procs a simple wrapper - around apr_proc_wait, and which extracts the exit code from the - status returned by waitpid. - [Kevin Pilch-Bisson ] - - *) Add process locking API to APR. [Aaron Bannert ] - - *) Add condition variables for Windows. [Ryan Bloom] - - *) Add condition variables to the APR set of locking functions. - This does Unix, and provides stubs for all other platforms. - [Aaron Bannert ] - - *) Don't search for IPv6 names in apr_sockaddr_info_get() if the - application doesn't specify the family (i.e., the application - passes in AF_UNSPEC) and APR isn't built with IPv6 support. - [Jeff Trawick] - - *) Fix the API for the apr_proc_create() call on Win32. Several - bad assumptions are gone, including a mismatch between unix and - win32, where win32 was defaulting to create detached. Also fixes - the apr_proc_t's pid member to a real pid (identity that works - across processes) instead of the handle (which is a new hproc - member value.) [William Rowe] - - *) Modify the external apr_filepath_get() fn to take a flags arg, - currently only for APR_FILEPATH_NATIVE. This returns c:\foo - format on Win32, and should do the same on OS2, or sys\vol:\foo - on Netware. Primarily for internals, but possibly useful to - others (and it mirrors some of the other apr_filepath_*() calls.) - [William Rowe] - - *) Add the new thread read/write lock API to APR. - [Aaron Bannert ] - - *) Add the new thread mutex lock API to APR. - [Aaron Bannert ] - - *) Cache GMT offset on platforms that don't store it in the tm struct. - This offset is normalized to be independent of daylight savings - time. [Brian Pane ] - - *) Initial support for cygwin. [Stipe Tolj ] - - *) Fix a problem with buffered files on Unix. [Brian Havard] - - *) Fix the bungling of getaddrinfo() error codes. [Jeff Trawick] - - *) Add an apr_thread_once function to APR. This allows a - program to ensure that a function is only called once. - [Ryan Bloom] - - *) APR Documentation is now in Doxygen format. - [Ian Holsman] - - *) Get apr_ungetc() to work with buffered files on Unix. - [Jeff Trawick] - - *) Fixed apr_filepath_root on Unix [William Rowe, Cliff Woolley]. - - *) Rename XtOffset to APR_XtOffset. This namespace protection - is important to keep from conflicting with other packages. - [Perl] - - *) Introduce a new --disable-ipv6 option to disable IPv6 support. - [Sterling Hughes , Jeff - Trawick] - - *) Fix the new shared memory code. We need to pass a pointer to - an apr_file_t to apr_file_open. Also, apr_os_file_get returns - a status value, not the OS file descriptor. [Ryan Bloom] - - *) Fix the new shared memory configure script. The APR_DECIDE - macros go in order, so the last set of dependancies that are - met are the ones used. That means that when using those macros, - options should be listed with the least desirable option first, - and the most desirable last. The new shared memory routines did - the opposite, so we chose the wrong shared memory option on Linux. - [Ryan Bloom] - - *) Move the necessary shared memory code from MM into APR and remove - our dependency upon MM. [Justin Erenkrantz] - - *) Get apr_lock_file and apr_unlock_file working on Windows 9x. - [Mladen Turk, Bill Stoddard] - - *) Make all APR pools be allocated out of the permanent pool. - This brings APR pools back to a tree structure. There are - no longer any way to create a pool that is not a decendant - of the permanent_pool. [Ryan Bloom] - - *) Wrap all functions in APR_DECLARE macro. - [Sterling Hughes ] - - *) Non-blocking connects shouldn't be calling connect a second - time. According to Single Unix, a non-blocking connect has - succeeded when the select pops successfully. It has failed - if the select failed. The second connect was causing 502's - in the httpd-proxy. [John Barbee barbee@veribox.net] - - *) Fix apr_dir_rewind() for Win32 to avoid returning a bogus error. - [Jeff Trawick, William Rowe] - - *) Detect required libraries first. This minimizes the libraries - needed in apr_hints.m4. [Justin Erenkrantz] - - *) Support the AIX, glibc2, and Solaris variants of gethostby{name|addr}_r. - Use gethostbyaddr_r function when available. - [Sterling Hughes ] - - *) Add new socket option, APR_INCOMPLETE_READ, that should be - set when you expect the first non-blocking read to fail with - EAGAIN. Setting APR_INCOMPLETE_READ prior to calling apr_read - will cause select() to be called first to wait for bytes - to read. [Brian Pane, Dean Gaudet] - - *) Better installation. This makes us install the APRVARS file, - as well as MM. [Ryan Bloom] - - *) Provide new number conversion functions apr_itoa, apr_ltoa, and - apr_off_t_toa, and inline code in inet_ntop4, to reduce CPU - consumption. [Brian Pane] - - *) Updated APR to pass the thread worker_function prototype - (apr_thread_start_t) two parameters, the apr private data - (apr_thread_t*) and the application private data (void*). - Applications' worker_thread() routines may use apr_thread_pool_get - to access the pool (implemented using APR_POOL_*_ACCESSOR() macros.) - [Aaron Bannert ] - - *) Add Solaris 8's sendfilev() support. This requires the following - patches from Sun: 111297 (Sparc), 111298 (x86). You'll need the - other patches listed in the patch description. [Justin Erenkrantz] - - *) Close file descriptor when we are done with fcntl or flock-based - cross-process lock. Otherwise, we leak descriptors. - [Justin Erenkrantz] - - *) Fix a possible data corruption problem with the use of getpwnam_r() on - all platforms where that function is used. - Use getpwnam_r() and getgrgid_r() instead of getpwnam() and getgrgid() - with threaded builds on glibc (2.1, at least) to avoid thread safety - issues. [Jeff Trawick] - - *) Added apr_lock_tryacquire. It will attempt to acquire the lock, but - will not block if it can not acquire the lock. Returns APR_EBUSY if - acquistion can not happen. [Justin Erenkrantz] - - *) Added an inherit flag to apr_socket_create and other socket creation - functions. This allows APR programs to specify that a socket should - be passed to any child processes that are created. The inherit flag - is only meaningful if programs use apr_process_create(). This - also adds a couple of macros that allow APR types to set and unset - the inherit flag. [Ryan Bloom] - - *) apr_connect()on Windows: Handle timeouts and returning the proper - status code when a connect is in progress. [Bill Stoddard] - - *) apr_connect() on Unix: Handle EINTR during connect(). Handle timeouts. - [Jeff Trawick] - - *) Handle the weird case where getpwnam() returns NULL but errno is zero. - [Jeff Trawick] - - *) Add apr_file_flags_get() which returns the flags that were originally - passed in to apr_file_open(). [Cliff Woolley] - - *) Added APR_HAS_XTHREAD_FILES macro that indicates whether or not the - platform handles files opened in APR_XTHREAD mode natively. Currently - only Win32 has such native support. [Cliff Woolley] - - *) Fix gmt offset handling on Solaris. Apache log messages now show - local time again. PR #7902 [Taketo Kabe ] - - *) apr_pstrcat() optimizations [Doug MacEachern, Jeff Trawick] - - *) Make the apr_pool_is_ancestor logic public. This is required for - some new logic that is going into HTTPD. I have left the join logic - in that function debug only. [Ryan Bloom] - - *) Clean up Win32 locks when the pool goes away. - [Justin Erenkrantz, Jeff Trawick] - - *) Implement apr_get_home_directory for Win32. [William Rowe] - - *) Complete the implementation of LARGEFILE support on Win32, although - the mmap semantics still need a touch of work. [William Rowe] - - *) Fix the APR_XTHREAD support, and apr_sendfile mechanics, so we can - handle cross-threaded file handles on Win32. [William Rowe] - - *) Implement APR_READWRITE locks on Unix with POSIX rwlocks. - Introduce new apr_lock_acquire_rw() function which takes in - APR_READER or APR_WRITER. [Justin Erenkrantz] - - *) Add apr_open_stdin. This mirrors apr_open_stderr, except it works - on stdin. [Aaron Bannert ] - - *) Add apr_strtok(), a thread-safe flavor of strtok() which has the - same interface as strtok_r(). [Jeff Trawick] - - *) Add other child support to Win32 [Bill Stoddard] - - *) Other-child registrations are automatically removed when the - associated pool is destroyed. This avoids garbage in the list - of registrations when a pool with a registration is freed. - [Jeff Trawick] - - *) Allow LTFLAGS to be overridden by the configure command-line - (default="--silent") and introduce LT_LDFLAGS. [Roy Fielding] - - *) Add memory code kindly donated to APR by - Elrond - Luke Kenneth Casson Leighton - Sander Striker - [David Reid] - - *) Fix a problem with the FreeBSD flavor of apr_sendfile() where we - could return APR_EAGAIN+bytes_sent. [Jeff Trawick] - - *) Fix a problem on unixware where clearing h_errno wouldn't work. - Use set_h_errno() instead. PR #7651 [Jeff Trawick] - - *) Add the test and build directories (when present) to the recursive - make process, being sure that they are run last. test is only done - recursively for make *clean targets. [Roy Fielding] - - *) Make the apr_mmap_create() function use the native_flags variable. - This allows us to actually create WRITEABLE MMAPs. - [Ed Korthof ] - - *) Completely revamp configure so that it preserves the standard make - variables CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS and LIBS by moving - the configure additions to EXTRA_* variables. Also, allow the user - to specify NOTEST_* values for all of the above, which eliminates the - need for THREAD_CPPFLAGS, THREAD_CFLAGS, and OPTIM. Fix the setting - of INCLUDES and EXTRA_INCLUDES. Check flags as they are added to - avoid pointless duplications. Fix the order in which flags are given - on the compile and link lines. [Roy Fielding] - - *) Fix DSO code on HP/UX. We have to use == not =, and it makes more - sense to actually return errno, so that the return code means - something. [Ryan Bloom] - - *) Clean up conditionals in unix DSO code so that we decide based on - the dynamic loading implementation, which we noticed at configure - time, instead of by operating system. - [Wilfredo Sanchez] - - *) Add DSO support for dyld platforms (Darwin/Mac OS and OpenStep). - [Wilfredo Sanchez] - - *) Amend the time code to better deal with time zones. - [David Reid] - - *) Carefully select an appropriate native type for apr_int64_t and - define its format as APR_INT64_T_FMT and literal using APR_INT64_C(). - [Justin Erenkrantz, William Rowe] - - *) Make clean, distclean, and extraclean consistently according to the - Gnu makefile guidelines. [Justin Erenkrantz ] - - *) Initial implementation of of apr_filepath (get/set/parse_root and - merge) for Windows. [William Rowe] - - *) Cleaned up implementation of of apr_filepath (get/set/parse_root - and merge) for Unix. [Greg Stein, William Rowe] - - *) Fixup the --enable-libtool option. This allows the test directory - to compile again. The test directory still doesn't work when - APR is configured without libtool. [Ryan Bloom] - - *) If we don't have sigwait() in the system, see if sigsuspend() is - available, and use that instead. [Wilfredo Sanchez] - - *) Make libtool optional at configure time. This is done with - --disable-libtool. [Ryan Bloom] - - *) Recognize systems where the TCP_NODELAY setting is inherited from - the listening socket, and optimize apr_setsockopt(APR_TCP_NODELAY) - accordingly. [Jeff Trawick] - - *) Recognize the presence of getnameinfo() on Tru64. [David Reid] - - *) Allow APR to be installed. [Ryan Bloom] - - *) Generate config.nice for easy re-run of configure. [Roy Fielding] - - *) Define preprocessor flags in CPPFLAGS instead of CFLAGS and - bring some sanity to the compiler command-lines. [Roy Fielding] - - *) Use the dso/aix subdirectory for older versions of AIX and fix - a number of bugs in the dso code in that directory. - [Victor Orlikowski] - - *) Allow libtool 1.3b to be used. [Victor Orlikowski] - - *) Misc. Win32 fixes: Set the pool pointer in apr_sockaddr_t - structures created with the apr_socket_t to prevent segfault - in certain apps. Flush unwritten buffered data when the file - is closed. [Jeff Trawick] - - *) Win32: Get APR to compile with MSVC 5.0 (a.k.a. VC97). - PR #7489 [Jeff Trawick] - - *) First draft implementation of apr_filepath (get/set/parse_root - and merge) for Unix. [William Rowe] - - *) Add apr_ipsubnet_create() and apr_ipsubnet_test() for testing - whether or not an address is within a subnet. [Jeff Trawick] - - *) Add apr_sendto and apr_recvfrom for Unix. Start of adding UDP - support. [David Reid] - - *) Add a method to get the password from the system for a given - user. [John Barbee ] - - *) Change the include path order, so that we look for included files - in the APR paths first, and the system paths second. - [jean-frederic clere ] - - *) Add a with-sendfile option, so that people on platforms without a - sendfile implementation for APR can easily disable it from the - configure line. [Ryan Bloom] - - *) Change the check for netinet/tcp.h to work around an issue with - that header file on IRIX 6.5 which prevented it from being - detected. PR #6459 [Jeff Trawick] - - *) Introduce apr_get_userid to return a named user's apr_uid_t and - apr_gid_t across platforms [Cliff Woolley, William Rowe] - - *) In apr_shm_init(), check the retcode from mm_malloc(). Previously, - we segfaulted here if mm_malloc() failed to get a lock. An example - error scenario is when the lock file lives on a filesystem which - doesn't support locking. [Jeff Trawick] - - *) Name protected the autoconf macros defined by APR. Moved the - REENTRANCY_FLAGS settings into apr_hints.m4. Inlined the - APR_PREPARE_MM_DIR macro because it could only be used once. - Removed the unused macros MY_TRY_RUN, MY_TRY_RUN_NATIVE, and - AC_USE_FUNCTION. Added some macro comments. [Roy Fielding] - - *) Cope with BSDi installations where the default make has been - replaced with GNU make. [Joe Orton ] - - *) Changed apr/helpers to apr/build to be consistent with other Apache - source trees. Added make variables to rules.mk.in that point to the - builders directory and its scripts. Updated buildconf, configure.in, - and Makefile.in files to create and use the new scripts. Moved scandoc - to scandoc.pl and its default.pl template to scandoc_template.pl. - [Roy Fielding] - - *) Updated config.guess and config.sub to GNU libtool 1.3.5 features, - with the Apache additions for OS/390 and OS/2 emx. [Roy Fielding] - - *) Moved hints.m4, apr_common.m4, and helpers/apr-conf.m4 into the - new build directory as apr_hints.m4, apr_common.m4, apr_network.m4, - and apr_threads.m4. [Roy Fielding] - - *) Get apr_sendfile() working on HP-UX. This gets APR to build on - HP-UX without having to turn off APR_HAS_SENDFILE. [Jeff Trawick] - - *) Force FreeBSD to compile without threads by default. To enable - threads, use --enable-threads on the configure line. - [Ryan Bloom] - - *) Purge system password buffer before returning from apr_password_get. - No longer abuses bufsize argument on return. [William Rowe] - - *) Moved the prototypes for apr_snprintf and apr_vsnprintf to the - apr_strings.h header, from apr_lib.h. This location makes more - sense. [Ryan Bloom] - - *) Added the APR_TRY_COMPILE_NO_WARNING configure macro for testing a - compile with -Werror as well as the APR_CHECK_ICONV_INBUF macro to - test for annoying iconv prototype differences. - [Jeff Trawick, Roy Fielding] - - *) Fix a problem with configure on NetBSD. We must include sys/types.h - for some platforms. [jun-ichiro hagino ] - - *) Some fixes in the Win32 time support. - (IsLeapYear): New macro for quickly figgerin' out if a given year is a - leap year. (SystemTimeToAprExpTime): Perform the calculation of - tm_yday. Also, negate the sign of the tm_gmtoff field to be - consistent with Unix platforms and APR header file comments. - [Mike Pilato] - - *) Implement WinNT Unix'ish permissions. [William Rowe] - - *) Corrected an OS2'ism of apr_get_home_directory. OS2 now returns the - proper directory, including the user's name. - - *) Removed private os2errno.h and integrated the OS2 network error codes - into apr_errno.h for optimized error tests (APR_STATUS_IS_EFOO(rv)). - [William Rowe] - - *) Moved inclusion of header from multiple modules into apr.h - [William Rowe] - - *) Added apr_compare_users() and apr_compare_groups() for more complex - apr_uid_t and apr_gid_t structures. Enabled both .user and .group - results from WinNT/2000 stat/getfileinfo, but expect to find that - .group is 'None' in most cases. [William Rowe] - - *) Replace configure --with-optim option by using the environment - variable OPTIM instead. This is needed because configure options - do not support multiple flags separated by spaces. [Roy Fielding] - - *) Eliminate the APR_SIG* aliases for standard signal names, - since they serve no useful purpose. [Roy Fielding] - - *) Abstracted apr_get_username and apr_get_groupname for unix and win32. - Modified Win32 apr_uid_t and apr_gid_t to use PSIDs, and elimintated - the uid_t and gid_t definitions. [William Rowe] - - *) Radically refactored apr_stat/lstat/getfileinfo/dir_read for Win32 - to assure we are retrieving what we expect to retrieve, and reporting - the correct result (APR_SUCCESS or APR_INCOMPLETE). The potential - for a bit more optimization still remains. [William Rowe] - - *) While we have the future opportunity to cache the apr_stat'ed file - handle for a very fast open (dup handle) on Win32, patched to close - that file after a stat always. Needs a new semantic before we leave - handles dangling when the user intends to rm. [William Rowe] - - *) Correct Win32 apr_stat/lstat/getfileinfo/dir_read to all zero out - the finfo buffer on success (or incomplete success). [William Rowe] - - *) Fix Win32/Unix apr_lstat to throw the .valid bit APR_FINFO_LINK to - indicate we attempted to open the link. Only the .filetype APR_LNK - reflects if the file found was, in fact, a link. [William Rowe] - - *) Fixed apr_open and apr_rename to function on Win9x. - [Mike Pilato ] - - *) Add apr_open_stdout. This mirrors apr_open_stderr, except it works - on stdout. [Mike Pilato ] - - *) Fix bug in file_io/unix/dir.c. There is no such thing as a dirent, - it must be a struct dirent. - [Kevin Pilch-Bisson ] - - *) Fix the configure script so that we can build from a different - directory. [Kevin Pilch-Bisson ] - - *) Introduce the wanted flag argument to the apr_stat/lstat/getfileinfo - family of functions. This change allows the user to determine what - platform-specific file information is retrieved, to optimize both - portability and performance. [William Rowe] - - *) Fix make depend. [Ryan Bloom] - - *) All dso implementations now register a cleanup to unload the DSO - when it is loaded. If the pool is removed, we really do need to - remove the DSO. In the past, different platforms behaved differently - it this respect. [Ryan Bloom] - - *) Add linkage declarations to the DSO code. - [Gregory Nicholls ] - - *) Some adjustment of hints.m4 setting flags (used to check if null - first) and added some verbosity. [Jim Jagielski] - - *) Specify APR_DECLARE to some of the APR functions. This helps linking - on some operating systems. [Gregory Nicholls ] - - *) Libtool'ized APR and converted all the makefiles to share rules - from helpers/rules.mk. [Greg Stein] - - *) Remove a warning on FreeBSD. FreeBSD defines TCP_NO_PUSH, but we - don't actually use it. This causes os_cork to be defined but not - used. This patch keeps us from defining os_cork and os_uncork on - FreeBSD. [Ryan Bloom] - - *) Keep apr_terminate from seg faulting on terminate. This is - happening on systems that do not NULL out locks when they are - destroyed. To keep this from happening, we set the locks to - NULL after destroying them in apr_terminate, and we have to - check for NULL in free_blocks. - [Allan Edwards and Gregory Nicholls ] - - *) Remove the ability to allocate memory out of a NULL pool. - [Ryan Bloom] - - *) Add an APR_GET_POOL macro to get a pool from any APR type that has - a pool. This requires that ALL apr types put the pool as the first - field in their structure. [Ryan Bloom] - - *) Begin to remove the ability to allocate out of NULL pools. The first - problem to solve, is that we need an apr_lock in order to allocate - pools, so that we can lock things out when allocating. So, how do we - allocate locks without a pool to allocate from? The answer is to create - a global_apr_pool, which is a bootstrapping pool. There should NEVER - be a sub-pool off this pool, and it is static to an APR file. This is - only used to allow us to allocate the locks cleanly, without using the - NULL pool hack. [Ryan Bloom] - - *) Fix a logic error in the poll code when implemented using select. - [Nick Caruso ] - - *) FreeBSD does not support sendfile() in combination with threads - before version 4.2. We no longer even try to support it. - [Ryan Bloom] - - *) On FreeBSD, it is possible for the first call to sendfile to - get EAGAIN, but still send some data. This means that we cannot - call sendfile and then check for EAGAIN, and then wait and call - sendfile again. If we do that, then we are likely to send the - first chunk of data twice, once in the first call and once in the - second. If we are using a timed write, then we check to make sure - we can send data before trying to send it. [Ryan Bloom] - - *) Cleanup to help Apache support programs build cleanly. - [Cliff Woolley ] - - *) Cleanup some compiler warnings on Solaris - [Dale Ghent ] - - *) apr_getaddrinfo() can now return multiple addresses for a host - via the next field in apr_sockaddr_t. [Jeff Trawick] - - *) Tighten up the check for getaddrinfo(). If it can't figure out - the appropriate address family for 127.0.0.1, it fails. - Unfortunately, Tru64 fails this test so we won't do IPv6 on - Tru64. [Jeff Trawick] - - *) Rename apr_opendir to apr_dir_open. [Ryan Bloom] - - *) apr_snprintf()'s %pI format string now takes apr_sockaddr_t * - instead of sockaddr_in *. [Jeff Trawick] - - *) Fix a bug in apr_accept() for Win32 and Unix where the local - apr_sockaddr_t in the new connected socket was not initialized - properly. This could result in a bad string for apr_get_ipaddr(), - among other things. [Jeff Trawick] - - *) Add apr_getnameinfo(), a replacement for apr_get_hostname() which - supports IPv6 and will be friendlier for use with eventual - SOCK_DGRAM support. apr_get_hostname() is gone. [Jeff Trawick] - - -Changes with APR a9 - - *) Removed the iconv implementation from the i18n/unix/iconv branch. - This now resides in the apr-iconv repository, and will be ported - over time to use native apr types (e.g. apr_dso) for portability. - - *) Only support IPv6 if we have sockaddr_in and a working - getaddrinfo(). [Jeff Trawick] - - *) Add apr_parse_addr_port() for parsing the hostname:port portion - of URLs and similar strings. [Jeff Trawick] - - *) Add Win32 MMAP support [William Rowe] - - *) Allow the APR programmer to specify if the MMAP is read-only or - write-able. - [Ryan Bloom and Will Rowe] - - *) Check more carefully for getaddrinfo(). Accept those that - require to be included (e.g., Tru64). Reject those that - fail a very basic operational test (e.g., AIX). [Jeff Trawick] - *) Add apr_make_os_sock() for constructing a fully-capable APR - socket. [Jeff Trawick] +Changes for APR 1.4.x and later: - *) Make APR's shared memory routines always allocate enough memory - for the requested segment, the MM internal types, and the APR - internal types. - [Ryan Bloom] + *) http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/CHANGES?view=markup - *) Add APR_SIZE_T_FMT. Get the other APR_xx_T_FMT variables - defined properly on AIX. [Jeff Trawick] +Changes for APR 1.3.x and later: - *) network API changes: get rid of apr_get_socket_inaddr(), - apr_get_remote_name(), and apr_get_local_name() [Jeff Trawick] + *) http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/CHANGES?view=markup - *) Add a step at configure time to create a file at the top-level, - apr.exports, which lists every function exported by APR. The - file is generated by a script in helpers, that reads each header - file. - [Ryan Bloom] +Changes for APR 1.2.x and later: - *) Lock config changes: Detect SysV sem capability by the presence of - sempaphore functions, not by the presence of union semun. New - config variable apr_lock_method can override autodetection of the - apr_lock implementation method. For now, hints.m4 uses it to select - SysV semaphores for OS/390. New config variable - apr_process_lock_is_global specifies that the selected inter-process - lock method is sufficient for APR_LOCKALL (i.e., it blocks all - threads and processes). For now, hints.m4 turns on this flag for - OS/390. [Jeff Trawick] - - *) Get APR_OFF_T_FMT defined properly on Solaris Sparc. - [Jeff Trawick] + *) http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/CHANGES?view=markup +Changes for APR 1.1.x and later: -Changes with APR a8 + *) http://svn.apache.org/viewvc/apr/apr/branches/1.1.x/CHANGES?view=markup - *) Change the name of the sa_len field in apr_sockaddr_t to salen. - Some platforms have a macro named sa_len. - [Tony Finch] +Changes for APR 1.0.x and later: - *) apr_set_port(), apr_get_port(), apr_set_ipaddr(), and apr_get_ipaddr() - now take apr_sockaddr_t as a parameter instead of apr_socket_t + - apr_interface_e. This will allow the same routines to be used with - datagram APIs to be added later. Note that code which calls - apr_set_ipaddr() should probably be changed to call apr_getaddrinfo() - for protocol independence. [Jeff Trawick] + *) http://svn.apache.org/viewvc/apr/apr/branches/1.0.x/CHANGES?view=markup - *) apr_create_tcp_socket() has been removed. Use apr_create_socket() - instead. [Jeff Trawick] +Changes for APR 0.9.x and later/earlier: - *) Source was moved from the apache-2.0 repository. For all CHANGES - prior to this time, please see the apache-2.0 repository + *) http://svn.apache.org/viewvc/apr/apr/branches/0.9.x/CHANGES?view=markup From 14f3104052fff62507f298f729fa3e9701a4dae5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 2 Oct 2009 12:46:26 +0000 Subject: [PATCH 6549/7878] remove this 1.3.x change from apr 2.0 CHANGES (included by definition) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@820991 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGES b/CHANGES index 84f1d609fc3..fec5e9916a2 100644 --- a/CHANGES +++ b/CHANGES @@ -20,10 +20,6 @@ Changes for APR 2.0.0 on return codes. PR 47431 [Wayne Jensen ] - *) On Linux/hppa flock() returns EAGAIN instead of EWOULDBLOCK. This - causes proc mutex failures. - [Stefan Fritsch ] - *) Fix race conditions in initialisation of DBD, DBM and DSO. [Bojan Smojver] From de4972173338529a2ae355a9ad5a80e388b67982 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 2 Oct 2009 12:53:17 +0000 Subject: [PATCH 6550/7878] APR trunk/2.0 includes APR-Util note the merge as a change point to prior APR-Util CHANGES files too axe a couple of included APR-Util fixes from the 2.0 change log git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@820994 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index fec5e9916a2..7cc0394f94e 100644 --- a/CHANGES +++ b/CHANGES @@ -23,13 +23,6 @@ Changes for APR 2.0.0 *) Fix race conditions in initialisation of DBD, DBM and DSO. [Bojan Smojver] - *) SECURITY: CVE-2009-0023 (cve.mitre.org) - Fix underflow in apr_strmatch_precompile. - [Matthew Palmer ] - - *) Fix off by one overflow in apr_brigade_vprintf. - [C. Michael Pilato ] - *) apr_thread_cond_*wait() on BeOS: Fix broken logic. PR 45800. [Jochen Voss (no e-mail)] @@ -46,27 +39,34 @@ Changes for APR 2.0.0 Currently only implemented for shm, proc and global mutexes on posix platforms. [Mladen Turk] + *) Merge APR-Util into APR. [various] -Changes for APR 1.4.x and later: +Changes for APR and APR-Util 1.4.x and later: *) http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/CHANGES?view=markup + *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.4.x/CHANGES?view=markup -Changes for APR 1.3.x and later: +Changes for APR and APR-Util 1.3.x and later: *) http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/CHANGES?view=markup + *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/CHANGES?view=markup -Changes for APR 1.2.x and later: +Changes for APR and APR-Util 1.2.x and later: *) http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/CHANGES?view=markup + *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.2.x/CHANGES?view=markup -Changes for APR 1.1.x and later: +Changes for APR and APR-Util 1.1.x and later: *) http://svn.apache.org/viewvc/apr/apr/branches/1.1.x/CHANGES?view=markup + *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.1.x/CHANGES?view=markup -Changes for APR 1.0.x and later: +Changes for APR and APR-Util 1.0.x and later: *) http://svn.apache.org/viewvc/apr/apr/branches/1.0.x/CHANGES?view=markup + *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.0.x/CHANGES?view=markup -Changes for APR 0.9.x and later/earlier: +Changes for APR and APR-Util 0.9.x and later/earlier: *) http://svn.apache.org/viewvc/apr/apr/branches/0.9.x/CHANGES?view=markup + *) http://svn.apache.org/viewvc/apr/apr-util/branches/0.9.x/CHANGES?view=markup From dbc5c079b0f70fdd98d687d590e1001b987f630b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 2 Oct 2009 13:06:09 +0000 Subject: [PATCH 6551/7878] don't list changes that were in APR-Util 1.3.x or 1.4.x git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@821004 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/CHANGES b/CHANGES index 7cc0394f94e..8d3669f8e45 100644 --- a/CHANGES +++ b/CHANGES @@ -1,28 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) Add support for Berkeley DB 4.8. [Arfrever Frehtes Taifersar Arahesis - ] - - *) Make sure that "make check" is used in the RPM spec file, so that - the crypto, dbd and dbm tests pass. [Graham Leggett] - - *) Make sure the mysql version of dbd_mysql_get_entry() respects the - rule that if the column number exceeds the number of columns, we - return NULL. [Graham Leggett] - *) Transfer the apr-util spec file contents to apr.spec. [Graham Leggett] - *) Clarify the error messages within the dbd tests. [Graham Leggett] - - *) Use locally scoped variables in PostgreSQL driver to avoid stomping - on return codes. PR 47431 - [Wayne Jensen ] - - *) Fix race conditions in initialisation of DBD, DBM and DSO. - [Bojan Smojver] - *) apr_thread_cond_*wait() on BeOS: Fix broken logic. PR 45800. [Jochen Voss (no e-mail)] From cbd41755fdc0e14ef8448a0467fa6861ef043c88 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 2 Oct 2009 15:44:14 +0000 Subject: [PATCH 6552/7878] s/APR-Util/APR-util/ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@821065 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 8d3669f8e45..cae392fb059 100644 --- a/CHANGES +++ b/CHANGES @@ -20,34 +20,34 @@ Changes for APR 2.0.0 Currently only implemented for shm, proc and global mutexes on posix platforms. [Mladen Turk] - *) Merge APR-Util into APR. [various] + *) Merge APR-util into APR. [various] -Changes for APR and APR-Util 1.4.x and later: +Changes for APR and APR-util 1.4.x and later: *) http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/CHANGES?view=markup *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.4.x/CHANGES?view=markup -Changes for APR and APR-Util 1.3.x and later: +Changes for APR and APR-util 1.3.x and later: *) http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/CHANGES?view=markup *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/CHANGES?view=markup -Changes for APR and APR-Util 1.2.x and later: +Changes for APR and APR-util 1.2.x and later: *) http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/CHANGES?view=markup *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.2.x/CHANGES?view=markup -Changes for APR and APR-Util 1.1.x and later: +Changes for APR and APR-util 1.1.x and later: *) http://svn.apache.org/viewvc/apr/apr/branches/1.1.x/CHANGES?view=markup *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.1.x/CHANGES?view=markup -Changes for APR and APR-Util 1.0.x and later: +Changes for APR and APR-util 1.0.x and later: *) http://svn.apache.org/viewvc/apr/apr/branches/1.0.x/CHANGES?view=markup *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.0.x/CHANGES?view=markup -Changes for APR and APR-Util 0.9.x and later/earlier: +Changes for APR and APR-util 0.9.x and later/earlier: *) http://svn.apache.org/viewvc/apr/apr/branches/0.9.x/CHANGES?view=markup *) http://svn.apache.org/viewvc/apr/apr-util/branches/0.9.x/CHANGES?view=markup From 9057dadc70e4b400621816ce4c6ce57ca0f49a98 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Sat, 3 Oct 2009 12:50:34 +0000 Subject: [PATCH 6553/7878] On Windows, map the system error code ERROR DIRECTORY which means "directory name is not valid" into APR_STATUS_IS_ENOTDIR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@821306 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index f34e8d98b35..ea750c972e7 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -1046,7 +1046,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + ERROR_BAD_NETPATH \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_NET_NAME \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_PATHNAME \ - || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DRIVE) + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DRIVE \ + || (s) == APR_OS_START_SYSERR + ERROR_DIRECTORY) #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL) #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM \ From bc45e5e7021bb0071fae394546c114590c5466f3 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Sun, 4 Oct 2009 12:09:57 +0000 Subject: [PATCH 6554/7878] * Add apr_socket_is_connected to detect whether the remote side of a socket is still open. The origin of apr_socket_is_connected is r473278 from http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c in httpd. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@821524 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ include/apr_network_io.h | 6 ++++ libapr.dsp | 4 +++ network_io/beos/socketcommon.c | 1 + network_io/os2/socket_util.c | 1 + network_io/unix/socket_util.c | 57 ++++++++++++++++++++++++++++++++++ test/sockchild.c | 4 +++ test/testsock.c | 50 +++++++++++++++++++++++++++++ 8 files changed, 126 insertions(+) create mode 100644 network_io/os2/socket_util.c create mode 100644 network_io/unix/socket_util.c diff --git a/CHANGES b/CHANGES index cae392fb059..13aa3f781c3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add apr_socket_is_connected to detect whether the remote side of + a socket is still open. [Ruediger Pluem] + *) Transfer the apr-util spec file contents to apr.spec. [Graham Leggett] diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 1046d9809ce..43f881ac956 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -374,6 +374,12 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new_sock, APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa); +/** + * Check whether the remote side of a socket is still open. + * @param socket The socket to check + */ +APR_DECLARE(int) apr_socket_is_connected(apr_socket_t *socket); + /** * Create apr_sockaddr_t from hostname, address family, and port. * @param sa The new apr_sockaddr_t. diff --git a/libapr.dsp b/libapr.dsp index a5d3db4b397..4163aa9d756 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -436,6 +436,10 @@ SOURCE=.\network_io\unix\multicast.c # End Source File # Begin Source File +SOURCE=.\network_io\unix\socket_util.c +# End Source File +# Begin Source File + SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File diff --git a/network_io/beos/socketcommon.c b/network_io/beos/socketcommon.c index cdadc8561ae..b9f594bbe0d 100644 --- a/network_io/beos/socketcommon.c +++ b/network_io/beos/socketcommon.c @@ -3,3 +3,4 @@ #include "../unix/sockets.c" #include "../unix/sockaddr.c" #include "../unix/sockopt.c" +#include "../unix/socket_util.c" diff --git a/network_io/os2/socket_util.c b/network_io/os2/socket_util.c new file mode 100644 index 00000000000..cdc1cea8940 --- /dev/null +++ b/network_io/os2/socket_util.c @@ -0,0 +1 @@ +#include "../unix/socket_util.c" diff --git a/network_io/unix/socket_util.c b/network_io/unix/socket_util.c new file mode 100644 index 00000000000..bf98f100c2b --- /dev/null +++ b/network_io/unix/socket_util.c @@ -0,0 +1,57 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_network_io.h" +#include "apr_poll.h" + +int apr_socket_is_connected(apr_socket_t *socket) +{ + apr_pollfd_t pfds[1]; + apr_status_t status; + apr_int32_t nfds; + + pfds[0].reqevents = APR_POLLIN; + pfds[0].desc_type = APR_POLL_SOCKET; + pfds[0].desc.s = socket; + + do { + status = apr_poll(&pfds[0], 1, &nfds, 0); + } while (APR_STATUS_IS_EINTR(status)); + + if (status == APR_SUCCESS && nfds == 1 && + pfds[0].rtnevents == APR_POLLIN) { + apr_sockaddr_t unused; + apr_size_t len = 1; + char buf[1]; + /* The socket might be closed in which case + * the poll will return POLLIN. + * If there is no data available the socket + * is closed. + */ + status = apr_socket_recvfrom(&unused, socket, MSG_PEEK, + &buf[0], &len); + if (status == APR_SUCCESS && len) + return 1; + else + return 0; + } + else if (APR_STATUS_IS_EAGAIN(status) || APR_STATUS_IS_TIMEUP(status)) { + return 1; + } + return 0; + +} + diff --git a/test/sockchild.c b/test/sockchild.c index e5d52ac151a..e16271bdf25 100644 --- a/test/sockchild.c +++ b/test/sockchild.c @@ -76,5 +76,9 @@ int main(int argc, char *argv[]) apr_socket_close(sock); exit((int)length); } + else if (!strcmp("close", argv[1])) { + apr_socket_close(sock); + exit(0); + } exit(-1); } diff --git a/test/testsock.c b/test/testsock.c index a2d5319239b..d902f69b28b 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -204,6 +204,55 @@ static void test_recv(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } +static void test_is_connected(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_socket_t *sock; + apr_socket_t *sock2; + apr_proc_t proc; + apr_size_t length = STRLEN; + char datastr[STRLEN]; + + sock = setup_socket(tc); + if (!sock) return; + + launch_child(tc, &proc, "write", p); + + rv = apr_socket_accept(&sock2, sock, p); + APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); + + /* Check that the remote socket is still open */ + ABTS_INT_EQUAL(tc, 1, apr_socket_is_connected(sock2)); + + memset(datastr, 0, STRLEN); + apr_socket_recv(sock2, datastr, &length); + + /* Make sure that the server received the data we sent */ + ABTS_STR_EQUAL(tc, DATASTR, datastr); + ABTS_SIZE_EQUAL(tc, strlen(datastr), wait_child(tc, &proc)); + + /* The child is dead, so should be the remote socket */ + ABTS_INT_EQUAL(tc, 0, apr_socket_is_connected(sock2)); + + rv = apr_socket_close(sock2); + APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); + + launch_child(tc, &proc, "close", p); + + rv = apr_socket_accept(&sock2, sock, p); + APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); + + /* The child closed the socket instantly */ + ABTS_INT_EQUAL(tc, 0, apr_socket_is_connected(sock2)); + wait_child(tc, &proc); + + rv = apr_socket_close(sock2); + APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); + + rv = apr_socket_close(sock); + APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); +} + static void test_timeout(abts_case *tc, void *data) { apr_status_t rv; @@ -351,6 +400,7 @@ abts_suite *testsock(abts_suite *suite) abts_run_test(suite, test_create_bind_listen, NULL); abts_run_test(suite, test_send, NULL); abts_run_test(suite, test_recv, NULL); + abts_run_test(suite, test_is_connected, NULL); abts_run_test(suite, test_timeout, NULL); abts_run_test(suite, test_print_addr, NULL); abts_run_test(suite, test_get_addr, NULL); From 4fc635dd636232680cb926813a334d3d03c4e32f Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 4 Oct 2009 22:50:09 +0000 Subject: [PATCH 6555/7878] added socket_util.c to NetWare makefile. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@821634 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index c4d1f10d020..68d6a72edf2 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -389,6 +389,7 @@ FILES_lib_objs = \ $(OBJDIR)/shm.o \ $(OBJDIR)/signals.o \ $(OBJDIR)/sockaddr.o \ + $(OBJDIR)/socket_util.o \ $(OBJDIR)/sockets.o \ $(OBJDIR)/sockopt.o \ $(OBJDIR)/start.o \ From 6f65d83dbf0c9c19381e76b9147a747f5d170fd8 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 5 Oct 2009 17:21:16 +0000 Subject: [PATCH 6556/7878] improved NetWare build of test samples. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@821929 13f79535-47bb-0310-9956-ffa450edef68 --- test/NWGNUaprtest | 7 +- test/NWGNUechod | 253 +++++++++++++++++++++++++++++++++++++ test/NWGNUglobalmutexchild | 6 +- test/NWGNUmakefile | 6 +- test/NWGNUmod_test | 15 +-- test/NWGNUproc_child | 19 ++- test/NWGNUreadchild | 6 +- test/NWGNUsockchild | 6 +- test/NWGNUsockperf | 253 +++++++++++++++++++++++++++++++++++++ test/NWGNUtestatmc | 8 +- test/NWGNUtryread | 6 +- test/nw_misc.c | 8 +- 12 files changed, 544 insertions(+), 49 deletions(-) create mode 100644 test/NWGNUechod create mode 100644 test/NWGNUsockperf diff --git a/test/NWGNUaprtest b/test/NWGNUaprtest index 6a97db1eec3..6e812c435fa 100644 --- a/test/NWGNUaprtest +++ b/test/NWGNUaprtest @@ -101,13 +101,13 @@ NLM_DESCRIPTION = NLM is to test the apr layer # This is used by the '-threadname' directive. If left blank, # NLM_NAME Thread will be used. # -NLM_THREAD_NAME = aprtest +NLM_THREAD_NAME = $(NLM_NAME) # # This is used by the '-screenname' directive. If left blank, # 'Apache for NetWare' Thread will be used. # -NLM_SCREEN_NAME = aprtest +NLM_SCREEN_NAME = $(NLM_NAME) # # If this is specified, it will override VERSION value in @@ -275,9 +275,8 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @libc.imp \ - @netware.imp \ @$(APR)/aprlib.imp \ + @libc.imp \ $(EOLIST) # Include the Winsock imports if Winsock is being used diff --git a/test/NWGNUechod b/test/NWGNUechod new file mode 100644 index 00000000000..45b00c77d61 --- /dev/null +++ b/test/NWGNUechod @@ -0,0 +1,253 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(APR_WORK)/build/NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR)/include \ + $(APR)/include/arch/NetWare \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = echod + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Echo Daemon NLM to test socket performance + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = $(NLM_NAME) + +# +# This is used by the '-screenname' directive. If left blank, +# 'Apache for NetWare' Thread will be used. +# +NLM_SCREEN_NAME = $(NLM_NAME) + +# +# If this is specified, it will override VERSION value in +# $(APR_WORK)/build/NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If this is specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can +# be disabled by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# Declare all target files (you must add your files here) +# + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/$(NLM_NAME).nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/$(NLM_NAME).o \ + $(OBJDIR)/nw_misc.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + Libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override the default copyright. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)/build/NWGNUtail.inc + diff --git a/test/NWGNUglobalmutexchild b/test/NWGNUglobalmutexchild index 888a69f3271..1ee75bb29fa 100644 --- a/test/NWGNUglobalmutexchild +++ b/test/NWGNUglobalmutexchild @@ -103,7 +103,7 @@ NLM_DESCRIPTION = child NLM to test the global Mutex layer # This is used by the '-threadname' directive. If left blank, # NLM_NAME Thread will be used. # -NLM_THREAD_NAME = globalmutexchild +NLM_THREAD_NAME = $(NLM_NAME) # # This is used by the '-screenname' directive. If left blank, @@ -157,7 +157,7 @@ XDCDATA = # If there is an NLM target, put it here # TARGET_nlm = \ - $(OBJDIR)/globalmutexchild.nlm \ + $(OBJDIR)/$(NLM_NAME).nlm \ $(EOLIST) # @@ -171,7 +171,7 @@ TARGET_lib = \ # Paths must all use the '/' character # FILES_nlm_objs = \ - $(OBJDIR)/globalmutexchild.o \ + $(OBJDIR)/$(NLM_NAME).o \ $(EOLIST) # diff --git a/test/NWGNUmakefile b/test/NWGNUmakefile index 2b340534aa1..af78c53a0f0 100644 --- a/test/NWGNUmakefile +++ b/test/NWGNUmakefile @@ -163,13 +163,15 @@ XDCDATA = # TARGET_nlm = \ $(OBJDIR)/aprtest.nlm \ + $(OBJDIR)/echod.nlm \ + $(OBJDIR)/globalmutexchild.nlm \ $(OBJDIR)/mod_test.nlm \ $(OBJDIR)/proc_child.nlm \ $(OBJDIR)/readchild.nlm \ - $(OBJDIR)/globalmutexchild.nlm \ $(OBJDIR)/sockchild.nlm \ - $(OBJDIR)/tryread.nlm \ + $(OBJDIR)/sockperf.nlm \ $(OBJDIR)/testatmc.nlm \ + $(OBJDIR)/tryread.nlm \ $(EOLIST) # # If there is an LIB target, put it here diff --git a/test/NWGNUmod_test b/test/NWGNUmod_test index 3dfa6df4514..3d416fc8713 100644 --- a/test/NWGNUmod_test +++ b/test/NWGNUmod_test @@ -54,7 +54,6 @@ XDEFINES += \ XLFLAGS += \ $(EOLIST) - endif ifeq "$(RELEASE)" "noopt" @@ -69,8 +68,6 @@ XDEFINES += \ XLFLAGS += \ $(EOLIST) - - $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -92,13 +89,13 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = mod_test +NLM_NAME = mod_test # # This is used by the link '-desc ' directive. # If left blank, NLM_NAME will be used. # -NLM_DESCRIPTION = DSO NLM to test the apr DSO loading layer +NLM_DESCRIPTION = DSO NLM to test the apr DSO loading layer # # This is used by the '-threadname' directive. If left blank, @@ -116,7 +113,7 @@ NLM_SCREEN_NAME = DEFAULT # If this is specified, it will override VERSION value in # $(APR_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = 1,0,0 +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -141,14 +138,14 @@ NLM_CHECK_SYM = # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION # # If this is specified it will be linked in with the XDCData option in the def # file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can # be disabled by setting APACHE_UNIPROC in the environment # -XDCDATA = +XDCDATA = # # Declare all target files (you must add your files here) @@ -222,7 +219,7 @@ FILES_nlm_exports = \ print_hello \ count_reps \ $(EOLIST) - + # # These are the OBJ files needed to create the LIB target above. # Paths must all use the '/' character diff --git a/test/NWGNUproc_child b/test/NWGNUproc_child index c002c8e9aaf..0efbc056357 100644 --- a/test/NWGNUproc_child +++ b/test/NWGNUproc_child @@ -54,7 +54,6 @@ XDEFINES += \ XLFLAGS += \ $(EOLIST) - endif ifeq "$(RELEASE)" "noopt" @@ -69,8 +68,6 @@ XDEFINES += \ XLFLAGS += \ $(EOLIST) - - $(EOLIST) endif ifeq "$(RELEASE)" "release" @@ -92,19 +89,19 @@ endif # This is used by the link 'name' directive to name the nlm. If left blank # TARGET_nlm (see below) will be used. # -NLM_NAME = proc_child +NLM_NAME = proc_child # # This is used by the link '-desc ' directive. # If left blank, NLM_NAME will be used. # -NLM_DESCRIPTION = child NLM to test the proc layer +NLM_DESCRIPTION = child NLM to test the proc layer # # This is used by the '-threadname' directive. If left blank, # NLM_NAME Thread will be used. # -NLM_THREAD_NAME = proc_child +NLM_THREAD_NAME = $(NLM_NAME) # # This is used by the '-screenname' directive. If left blank, @@ -116,7 +113,7 @@ NLM_SCREEN_NAME = DEFAULT # If this is specified, it will override VERSION value in # $(APR_WORK)\build\NWGNUenvironment.inc # -NLM_VERSION = 1,0,0 +NLM_VERSION = # # If this is specified, it will override the default of 64K @@ -141,14 +138,14 @@ NLM_CHECK_SYM = # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE # # If this is specified it will be linked in with the XDCData option in the def # file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can # be disabled by setting APACHE_UNIPROC in the environment # -XDCDATA = +XDCDATA = # # Declare all target files (you must add your files here) @@ -158,7 +155,7 @@ XDCDATA = # If there is an NLM target, put it here # TARGET_nlm = \ - $(OBJDIR)/proc_child.nlm \ + $(OBJDIR)/$(NLM_NAME).nlm \ $(EOLIST) # @@ -172,7 +169,7 @@ TARGET_lib = \ # Paths must all use the '/' character # FILES_nlm_objs = \ - $(OBJDIR)/proc_child.o \ + $(OBJDIR)/$(NLM_NAME).o \ $(EOLIST) # diff --git a/test/NWGNUreadchild b/test/NWGNUreadchild index caabfca27ed..3c5e75f697b 100644 --- a/test/NWGNUreadchild +++ b/test/NWGNUreadchild @@ -101,7 +101,7 @@ NLM_DESCRIPTION = child NLM to test the pipe layer # This is used by the '-threadname' directive. If left blank, # NLM_NAME Thread will be used. # -NLM_THREAD_NAME = readchild +NLM_THREAD_NAME = $(NLM_NAME) # # This is used by the '-screenname' directive. If left blank, @@ -155,7 +155,7 @@ XDCDATA = # If there is an NLM target, put it here # TARGET_nlm = \ - $(OBJDIR)/readchild.nlm \ + $(OBJDIR)/$(NLM_NAME).nlm \ $(EOLIST) # @@ -169,7 +169,7 @@ TARGET_lib = \ # Paths must all use the '/' character # FILES_nlm_objs = \ - $(OBJDIR)/readchild.o \ + $(OBJDIR)/$(NLM_NAME).o \ $(EOLIST) # diff --git a/test/NWGNUsockchild b/test/NWGNUsockchild index 2e2049365c9..e1be847d05a 100644 --- a/test/NWGNUsockchild +++ b/test/NWGNUsockchild @@ -101,7 +101,7 @@ NLM_DESCRIPTION = socket NLM to test sockets # This is used by the '-threadname' directive. If left blank, # NLM_NAME Thread will be used. # -NLM_THREAD_NAME = sockchild +NLM_THREAD_NAME = $(NLM_NAME) # # This is used by the '-screenname' directive. If left blank, @@ -155,7 +155,7 @@ XDCDATA = # If there is an NLM target, put it here # TARGET_nlm = \ - $(OBJDIR)/sockchild.nlm \ + $(OBJDIR)/$(NLM_NAME).nlm \ $(EOLIST) # @@ -169,7 +169,7 @@ TARGET_lib = \ # Paths must all use the '/' character # FILES_nlm_objs = \ - $(OBJDIR)/sockchild.o \ + $(OBJDIR)/$(NLM_NAME).o \ $(EOLIST) # diff --git a/test/NWGNUsockperf b/test/NWGNUsockperf new file mode 100644 index 00000000000..c2d5f7d8b15 --- /dev/null +++ b/test/NWGNUsockperf @@ -0,0 +1,253 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(APR_WORK)/build/NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR)/include \ + $(APR)/include/arch/NetWare \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = sockperf + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = socket NLM to test socket performance + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = $(NLM_NAME) + +# +# This is used by the '-screenname' directive. If left blank, +# 'Apache for NetWare' Thread will be used. +# +NLM_SCREEN_NAME = $(NLM_NAME) + +# +# If this is specified, it will override VERSION value in +# $(APR_WORK)/build/NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If this is specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can +# be disabled by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# Declare all target files (you must add your files here) +# + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/$(NLM_NAME).nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/$(NLM_NAME).o \ + $(OBJDIR)/nw_misc.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + Libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override the default copyright. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(APR_WORK)/build/NWGNUtail.inc + diff --git a/test/NWGNUtestatmc b/test/NWGNUtestatmc index d8637ce6874..6f017802da3 100644 --- a/test/NWGNUtestatmc +++ b/test/NWGNUtestatmc @@ -100,13 +100,13 @@ NLM_DESCRIPTION = NLM is to test the atomic functions # This is used by the '-threadname' directive. If left blank, # NLM_NAME Thread will be used. # -NLM_THREAD_NAME = testatmc +NLM_THREAD_NAME = $(NLM_NAME) # # This is used by the '-screenname' directive. If left blank, # 'Apache for NetWare' Thread will be used. # -NLM_SCREEN_NAME = testatmc +NLM_SCREEN_NAME = $(NLM_NAME) # # If this is specified, it will override VERSION value in @@ -154,7 +154,7 @@ XDCDATA = # If there is an NLM target, put it here # TARGET_nlm = \ - $(OBJDIR)/testatmc.nlm \ + $(OBJDIR)/$(NLM_NAME).nlm \ $(EOLIST) # @@ -210,8 +210,8 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ @libc.imp \ - @$(APR)/aprlib.imp \ $(EOLIST) # diff --git a/test/NWGNUtryread b/test/NWGNUtryread index 9eb0f4f4003..7dbf1b800a8 100644 --- a/test/NWGNUtryread +++ b/test/NWGNUtryread @@ -101,7 +101,7 @@ NLM_DESCRIPTION = reader NLM to test flock # This is used by the '-threadname' directive. If left blank, # NLM_NAME Thread will be used. # -NLM_THREAD_NAME = try_read +NLM_THREAD_NAME = $(NLM_NAME) # # This is used by the '-screenname' directive. If left blank, @@ -155,7 +155,7 @@ XDCDATA = # If there is an NLM target, put it here # TARGET_nlm = \ - $(OBJDIR)/tryread.nlm \ + $(OBJDIR)/$(NLM_NAME).nlm \ $(EOLIST) # @@ -169,7 +169,7 @@ TARGET_lib = \ # Paths must all use the '/' character # FILES_nlm_objs = \ - $(OBJDIR)/tryread.o \ + $(OBJDIR)/$(NLM_NAME).o \ $(EOLIST) # diff --git a/test/nw_misc.c b/test/nw_misc.c index d00ef0e00d4..5895247f78d 100644 --- a/test/nw_misc.c +++ b/test/nw_misc.c @@ -1,6 +1,4 @@ #include -#include -#include /* #include "testutil.h" */ @@ -9,11 +7,7 @@ void _NonAppStop( void ) { if (getenv("_IN_NETWARE_BASH_") == NULL) { - uint16_t row, col; - - GetScreenSize(&row, &col); - gotorowcol(row-1, 0); - printf(" "); + printf("\r\n "); getcharacter(); } } From 33f7573b79a25a00425e5cf68ac35cf318f8db58 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 5 Oct 2009 19:02:07 +0000 Subject: [PATCH 6557/7878] removed CodeWarrior IDE project file since its not maintained nor used anymore, and thus unusable in its current shape. If in future someone wants to pick it up and update / fix it then it can still be checked out from previous revisions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@821965 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 171800 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 libaprnw.mcp.zip diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip deleted file mode 100644 index f9d5c14e61f378e50b8ba31b2f05ad83090221b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 171800 zcma&NcUY54)Gum7M4F)VwiOYjBLt*IML?-a@1a9zkzPVTq?dq5@4XWc2p}zV0@4Y+ z_ufMd?ZmymbMCp%{pZe;yk)Xx&AjhwGi!eNEPwajlUsLgJ-DUxy^(8(me|HF>Gmyl zYU*2$Zr!?N12#7L>fmJN=w#>0V{7ttdxp^P@dyjyzWgibn@3axVUHi#YL}~}Bc*+K zCXA`xCl0-xYI|<>#(wc_K>Fe=bg$u*`ewJ`l==7ZO+(#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DA8gQ3 z5Y~F#4dj!x6$8A^%v>^TwiyN4{R{~ppG9wkyrkqYk+phZhj@l4nmb8w2jY_I0gHx^ zh~;niDv|HaG*$bX{EVdki8R3iQ*4CgL zdW5oTAX}EiWnsMxW3d%}RM`o6iP%v8f6ZG_6Qy~ZulqFwkLR_ZMOa^5+R;5bt07x1 z%H{yAp~A6!klpi$(hl`Bm~scU-~r7v1`?-5O2(Q4I6=$&yXMH1vaeEHu)kSOuBw;z zkpPYB$EB)VI_;CFoHHUcaVj4*YC&acahWs$!DY3Mp%7#TB+l#9^gR4TiXu@n+?*}Zh>r=%r zSKE1f%<;}IO9QO%M%I>Nprg#o$loc>i;_0*U)^4g;k>9So|sIXWOzk{W4J2HnR|YO zq8HXa1)FJd<)+kbQ8VqVM?w0LDqeL9)a8cKTyidUqGW-GIDsjAx2zvYODITf|7A70 zCqdeD*D0qKCxbw|o5(&g9Gx@ML}Z5FKcpT>RXsc5hRs92QvF1V-)Y~*QyK1GS*Lf01m5BBwPcMA*-eHs$#A0hAeIPibi zbTsU`H{o*L?7vX`^k?X*dzk20|A$QX54(s)^Z&>GA133ue;3fx-jTHL Date: Mon, 5 Oct 2009 19:13:04 +0000 Subject: [PATCH 6558/7878] removed batch file used for CodeWarrior IDE project file since its not maintained nor used anymore. If in future someone wants to pick it up and update / fix it then it can still be checked out from previous revisions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@821970 13f79535-47bb-0310-9956-ffa450edef68 --- build/prebuildNW.bat | 48 -------------------------------------------- 1 file changed, 48 deletions(-) delete mode 100755 build/prebuildNW.bat diff --git a/build/prebuildNW.bat b/build/prebuildNW.bat deleted file mode 100755 index 941d920c9bf..00000000000 --- a/build/prebuildNW.bat +++ /dev/null @@ -1,48 +0,0 @@ -@echo off - -if not "%NovellLibC%" == "" goto CheckNDK -set NovellLibC=\novell\ndk\libc -@echo Could not find the NovellLibC environment variable -@echo Setting NovellLibC = %NovellLibC% -@echo --------------------- - -:CheckNDK -if exist %NovellLibC%\include\netware.h goto NDKOK -@echo The path to the NDK "%NovellLibC%" is invalid. -@echo Please set then NovellLibC environment variable to the location of the NDK -@echo --------------------- -goto Done - -:NDKOK -@echo # As part of the pre-build process, the utility GenURI.NLM -@echo # (Gen URI Delims) must be built, copied to a NetWare server -@echo # and run using the following command: -@echo # -@echo # "sys:\genuri >sys:\uri_delims.h" -@echo # -@echo # The file "sys:\uri_delims.h" must then be copied to -@echo # "apr-util\uri\uri_delims.h" on the build machine. - -@echo Fixing up the APR headers -copy ..\include\apr.hnw ..\include\apr.h - -@echo Fixing up the APR-Util headers -copy ..\..\apr-util\include\apu.hnw ..\..\apr-util\include\apu.h -copy ..\..\apr-util\include\apu_want.hnw ..\..\apr-util\include\apu_want.h -copy ..\..\apr-util\include\apr_ldap.hnw ..\..\apr-util\include\apr_ldap.h -copy ..\..\apr-util\include\private\apu_config.hw ..\..\apr-util\include\private\apu_config.h -copy ..\..\apr-util\xml\expat\lib\expat.h.in ..\..\apr-util\xml\expat\lib\expat.h -copy ..\..\apr-util\xml\expat\lib\config.hnw ..\..\apr-util\xml\expat\lib\config.h -copy ..\..\apr-util\include\private\apu_select_dbm.hw ..\..\apr-util\include\private\apu_select_dbm.h - -@echo Fixing up the pcre headers -copy ..\..\pcre\config.hw ..\..\pcre\config.h -copy ..\..\pcre\pcre.hw ..\..\pcre\pcre.h - -@echo Generating the import list... -set MWCIncludes=..\include;..\include\arch\netware;..\include\arch\unix;..\..\apr-util\include;+%NovellLibC% -mwccnlm -P nw_export.inc -d NETWARE -EP -awk -f make_nw_export.awk nw_export.i |sort >..\aprlib.imp - -:Done -pause From 3037076f80b66f85c65a630e538a1871f0e43fac Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Tue, 6 Oct 2009 19:01:45 +0000 Subject: [PATCH 6559/7878] * Improve the documentation Suggested by: jorton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@822431 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 43f881ac956..54d8f6e9083 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -375,8 +375,15 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa); /** - * Check whether the remote side of a socket is still open. + * Check whether the receive part of the socket has been shut down by the + * peer and that the socket's read buffer is empty. If this is true the next + * read on the socket wil return APR_EOF. * @param socket The socket to check + * @remark + *
    + * This function does not block on the socket but returns immediately in
    + * any case.
    + * 
    */ APR_DECLARE(int) apr_socket_is_connected(apr_socket_t *socket); From e442851e79dbb0174747fb7dc963a855575ba69b Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Wed, 7 Oct 2009 20:13:06 +0000 Subject: [PATCH 6560/7878] * Improve the documentation even further Reviewed by: jim git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@822892 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 54d8f6e9083..19955301fa1 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -375,9 +375,9 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa); /** - * Check whether the receive part of the socket has been shut down by the - * peer and that the socket's read buffer is empty. If this is true the next - * read on the socket wil return APR_EOF. + * Check whether the send part of the socket is still open on the + * peer or that there is still data in the socket's read buffer. + * If this is false the next read on the socket will return APR_EOF. * @param socket The socket to check * @remark *
    
    From 9b82ae8f37bebd6d3c1aecc16746838c6f2129f8 Mon Sep 17 00:00:00 2001
    From: Ruediger Pluem 
    Date: Fri, 9 Oct 2009 11:03:00 +0000
    Subject: [PATCH 6561/7878] * Do not miss Mladen here as he wrote the code that
     is used here in   proxy_util.c in httpd land.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@823513 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/CHANGES b/CHANGES
    index 13aa3f781c3..89021b5d006 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -2,7 +2,7 @@
     Changes for APR 2.0.0
     
       *) Add apr_socket_is_connected to detect whether the remote side of
    -     a socket is still open. [Ruediger Pluem]
    +     a socket is still open. [Ruediger Pluem, Mladen Turk]
     
       *) Transfer the apr-util spec file contents to apr.spec. [Graham
          Leggett]
    
    From 6514ee19db8f0fdf711c6b2399cb47119fba55f2 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Mon, 12 Oct 2009 21:16:56 +0000
    Subject: [PATCH 6562/7878] * include/apr_network_io.h, *
     network_io/unix/socket_util.c (apr_socket_atreadeof): Renamed from  
     apr_socket_is_connected; adjusted to return an apr_status_t error   code, and
     pass an "at EOF" flag via an output parameter.
    
    * test/testsock.c (test_atreadeof): Renamed from test_is_connected,
      adjusted for new API.
    
    Submitted by: jorton, rpluem
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@824500 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_network_io.h      | 20 ++++++-----
     network_io/unix/socket_util.c | 63 ++++++++++++++++++++++-------------
     test/testsock.c               | 17 +++++++---
     3 files changed, 63 insertions(+), 37 deletions(-)
    
    diff --git a/include/apr_network_io.h b/include/apr_network_io.h
    index 19955301fa1..690be85531b 100644
    --- a/include/apr_network_io.h
    +++ b/include/apr_network_io.h
    @@ -375,17 +375,19 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock,
                                                  apr_sockaddr_t *sa);
     
     /**
    - * Check whether the send part of the socket is still open on the
    - * peer or that there is still data in the socket's read buffer.
    - * If this is false the next read on the socket will return APR_EOF.
    + * Determine whether the receive part of the socket has been closed by
    + * the peer (such that a subsequent call to apr_socket_read would
    + * return APR_EOF), if the socket's receive buffer is empty.  This
    + * function does not block waiting for I/O.
    + *
      * @param socket The socket to check
    - * @remark
    - * 
    - * This function does not block on the socket but returns immediately in
    - * any case.
    - * 
    + * @param atreadeof If APR_SUCCESS is returned, *atreadeof is set to + * non-zero if a subsequent read would return APR_EOF + * @return an error is returned if it was not possible to determine the + * status, in which case *atreadeof is not changed. */ -APR_DECLARE(int) apr_socket_is_connected(apr_socket_t *socket); +APR_DECLARE(apr_status_t) apr_socket_atreadeof(apr_socket_t *sock, + int *atreadeof); /** * Create apr_sockaddr_t from hostname, address family, and port. diff --git a/network_io/unix/socket_util.c b/network_io/unix/socket_util.c index bf98f100c2b..b23aed6b25a 100644 --- a/network_io/unix/socket_util.c +++ b/network_io/unix/socket_util.c @@ -17,41 +17,58 @@ #include "apr_network_io.h" #include "apr_poll.h" -int apr_socket_is_connected(apr_socket_t *socket) +apr_status_t apr_socket_atreadeof(apr_socket_t *sock, int *atreadeof) { apr_pollfd_t pfds[1]; - apr_status_t status; + apr_status_t rv; apr_int32_t nfds; + /* The purpose here is to return APR_SUCCESS only in cases in + * which it can be unambiguously determined whether or not the + * socket will return EOF on next read. In case of an unexpected + * error, return that. */ + pfds[0].reqevents = APR_POLLIN; pfds[0].desc_type = APR_POLL_SOCKET; - pfds[0].desc.s = socket; + pfds[0].desc.s = sock; do { - status = apr_poll(&pfds[0], 1, &nfds, 0); - } while (APR_STATUS_IS_EINTR(status)); + rv = apr_poll(&pfds[0], 1, &nfds, 0); + } while (APR_STATUS_IS_EINTR(rv)); - if (status == APR_SUCCESS && nfds == 1 && - pfds[0].rtnevents == APR_POLLIN) { + if (APR_STATUS_IS_TIMEUP(rv)) { + /* Read buffer empty -> subsequent reads would block, so, + * definitely not at EOF. */ + *atreadeof = 0; + return APR_SUCCESS; + } + else if (rv) { + /* Some other error -> unexpected error. */ + return rv; + } + else if (nfds == 1 && pfds[0].rtnevents == APR_POLLIN) { apr_sockaddr_t unused; apr_size_t len = 1; - char buf[1]; - /* The socket might be closed in which case - * the poll will return POLLIN. - * If there is no data available the socket - * is closed. - */ - status = apr_socket_recvfrom(&unused, socket, MSG_PEEK, - &buf[0], &len); - if (status == APR_SUCCESS && len) - return 1; - else - return 0; - } - else if (APR_STATUS_IS_EAGAIN(status) || APR_STATUS_IS_TIMEUP(status)) { - return 1; + char buf; + + /* The socket is readable - peek to see whether it returns EOF + * without consuming bytes from the socket buffer. */ + rv = apr_socket_recvfrom(&unused, sock, MSG_PEEK, &buf, &len); + if (rv == APR_EOF) { + *atreadeof = 1; + return APR_SUCCESS; + } + else if (rv) { + /* Read error -> unexpected error. */ + return rv; + } + else { + *atreadeof = 0; + return APR_SUCCESS; + } } - return 0; + /* Should not fall through here. */ + return APR_EGENERAL; } diff --git a/test/testsock.c b/test/testsock.c index d902f69b28b..ff6483a2f14 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -204,7 +204,7 @@ static void test_recv(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } -static void test_is_connected(abts_case *tc, void *data) +static void test_atreadeof(abts_case *tc, void *data) { apr_status_t rv; apr_socket_t *sock; @@ -212,6 +212,7 @@ static void test_is_connected(abts_case *tc, void *data) apr_proc_t proc; apr_size_t length = STRLEN; char datastr[STRLEN]; + int atreadeof = -1; sock = setup_socket(tc); if (!sock) return; @@ -222,7 +223,9 @@ static void test_is_connected(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); /* Check that the remote socket is still open */ - ABTS_INT_EQUAL(tc, 1, apr_socket_is_connected(sock2)); + rv = apr_socket_atreadeof(sock2, &atreadeof); + APR_ASSERT_SUCCESS(tc, "Determine whether at EOF, #1", rv); + ABTS_INT_EQUAL(tc, 0, atreadeof); memset(datastr, 0, STRLEN); apr_socket_recv(sock2, datastr, &length); @@ -232,7 +235,9 @@ static void test_is_connected(abts_case *tc, void *data) ABTS_SIZE_EQUAL(tc, strlen(datastr), wait_child(tc, &proc)); /* The child is dead, so should be the remote socket */ - ABTS_INT_EQUAL(tc, 0, apr_socket_is_connected(sock2)); + rv = apr_socket_atreadeof(sock2, &atreadeof); + APR_ASSERT_SUCCESS(tc, "Determine whether at EOF, #2", rv); + ABTS_INT_EQUAL(tc, 1, atreadeof); rv = apr_socket_close(sock2); APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); @@ -243,7 +248,9 @@ static void test_is_connected(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); /* The child closed the socket instantly */ - ABTS_INT_EQUAL(tc, 0, apr_socket_is_connected(sock2)); + rv = apr_socket_atreadeof(sock2, &atreadeof); + APR_ASSERT_SUCCESS(tc, "Determine whether at EOF, #3", rv); + ABTS_INT_EQUAL(tc, 1, atreadeof); wait_child(tc, &proc); rv = apr_socket_close(sock2); @@ -400,7 +407,7 @@ abts_suite *testsock(abts_suite *suite) abts_run_test(suite, test_create_bind_listen, NULL); abts_run_test(suite, test_send, NULL); abts_run_test(suite, test_recv, NULL); - abts_run_test(suite, test_is_connected, NULL); + abts_run_test(suite, test_atreadeof, NULL); abts_run_test(suite, test_timeout, NULL); abts_run_test(suite, test_print_addr, NULL); abts_run_test(suite, test_get_addr, NULL); From 7a6178b3149c3c8232fa0ded93aa08f390891827 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 13 Oct 2009 00:07:15 +0000 Subject: [PATCH 6563/7878] fixed error message in abts_ptr_notnull() and avoid printing a NULL pointer. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@824549 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/abts.c b/test/abts.c index d23eefa9090..520b38dfb34 100644 --- a/test/abts.c +++ b/test/abts.c @@ -306,7 +306,7 @@ void abts_ptr_notnull(abts_case *tc, const void *ptr, int lineno) tc->failed = TRUE; if (verbose) { - fprintf(stderr, "Line %d: Expected NULL, but saw <%p>\n", lineno, ptr); + fprintf(stderr, "Line %d: Expected non-NULL, but got NULL\n", lineno); fflush(stderr); } } From 8f8ebc038d96c174e29a47a7769375a0979e6810 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 13 Oct 2009 13:58:19 +0000 Subject: [PATCH 6564/7878] More Darwin mojo due to 64 and 32 bit multi-arches. The deal is we need to install headers that work both when installed and used for both 32 and 64 bit builds, ie: at compile time. Uses Apple's own apr.h edits as a guide. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@824767 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 3 + configure.in | 11 ++++ include/apr.h.in | 12 ++++ include/apr_os_override.h | 70 +++++++++++++++++++++++ include/arch/darwin/apr_darwin_types.h | 77 ++++++++++++++++++++++++++ 5 files changed, 173 insertions(+) create mode 100644 include/apr_os_override.h create mode 100644 include/arch/darwin/apr_darwin_types.h diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 680cbf4b614..25d1e4d5da8 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -203,6 +203,9 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(ac_cv_func_kqueue, [no]) APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332 ;; + *-apple-darwin10.*) + APR_ADDTO(CPPFLAGS, [-DDARWIN_10]) + ;; esac ;; *-dec-osf*) diff --git a/configure.in b/configure.in index 3366f509f67..4bbb9dc8f01 100644 --- a/configure.in +++ b/configure.in @@ -34,6 +34,12 @@ sinclude(build/dbm.m4) sinclude(build/dbd.m4) sinclude(build/dso.m4) +dnl Hard-coded top of apr_private.h: +AH_TOP([ +#ifndef APR_PRIVATE_H +#define APR_PRIVATE_H +]) + dnl Hard-coded inclusion at the tail end of apr_private.h: AH_BOTTOM([ /* switch this on if we have a BeOS version below BONE */ @@ -43,10 +49,15 @@ AH_BOTTOM([ #define BEOS_BONE 1 #endif +#ifdef DARWIN_10 +#include "../darwin/apr_darwin_types.h" +#endif + /* * Include common private declarations. */ #include "../apr_private_common.h" +#endif /* APR_PRIVATE_H */ ]) dnl Save user-defined environment settings for later restoration diff --git a/include/apr.h.in b/include/apr.h.in index f808c232ba3..608fb13fa5d 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -278,8 +278,18 @@ typedef unsigned @short_value@ apr_uint16_t; typedef @int_value@ apr_int32_t; typedef unsigned @int_value@ apr_uint32_t; +#ifdef DARWIN_10 +#ifdef __LP64__ +typedef long apr_int64_t; +typedef unsigned long apr_uint64_t; +#else +typedef long long apr_int64_t; +typedef unsigned long long apr_uint64_t; +#endif +#else typedef @long_value@ apr_int64_t; typedef unsigned @long_value@ apr_uint64_t; +#endif typedef @size_t_value@ apr_size_t; typedef @ssize_t_value@ apr_ssize_t; @@ -506,6 +516,8 @@ typedef int uid_t; typedef int gid_t; #endif +#include "apr_os_override.h" + #ifdef __cplusplus } #endif diff --git a/include/apr_os_override.h b/include/apr_os_override.h new file mode 100644 index 00000000000..bfef893c740 --- /dev/null +++ b/include/apr_os_override.h @@ -0,0 +1,70 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef APR_OS_OVERRIDE_H +#define APR_OS_OVERRIDE_H + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef DARWIN_10 + +#undef APR_HAS_LARGE_FILES +#undef APR_SIZEOF_VOIDP +#undef APR_INT64_T_FMT +#undef APR_UINT64_T_FMT +#undef APR_UINT64_T_HEX_FMT + +#ifdef __LP64__ + #define APR_HAS_LARGE_FILES 0 + #define APR_SIZEOF_VOIDP 8 + #define APR_INT64_T_FMT "ld" + #define APR_UINT64_T_FMT "lu" + #define APR_UINT64_T_HEX_FMT "lx" +#else + #define APR_HAS_LARGE_FILES 1 + #define APR_SIZEOF_VOIDP 4 + #define APR_INT64_T_FMT "lld" + #define APR_UINT64_T_FMT "llu" + #define APR_UINT64_T_HEX_FMT "llx" +#endif + +#undef APR_IS_BIGENDIAN +#ifdef __BIG_ENDIAN__ + #define APR_IS_BIGENDIAN 1 +#else + #define APR_IS_BIGENDIAN 0 +#endif + +/* + * ./i386/_types.h:typedef long long __int64_t; + * ./sys/_types.h:typedef __int64_t __darwin_off_t; + * ./sys/types.h:typedef __darwin_off_t off_t; + * So off_t is always long long + */ +#undef APR_OFF_T_FMT +#define APR_OFF_T_FMT "lld" + +#endif /* DARWIN_10 */ + +#ifdef __cplusplus +} +#endif + +#endif /* APR_OS_OVERRIDE_H */ diff --git a/include/arch/darwin/apr_darwin_types.h b/include/arch/darwin/apr_darwin_types.h new file mode 100644 index 00000000000..1fc12fa713a --- /dev/null +++ b/include/arch/darwin/apr_darwin_types.h @@ -0,0 +1,77 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef APR_DARWIN_TYPES_H +#define APR_DARWIN_TYPES_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Darwin 10's default compiler (gcc42) builds for both 64 and + * 32 bit architectures unless specifically told not to. + * In those cases, we need to override types depending on how + * we're being built at compile time + */ +#ifdef DARWIN_10 + +#undef APR_OFF_T_STRFN +#undef APR_INT64_STRFN +#undef SIZEOF_LONG +#undef SIZEOF_SIZE_T +#undef SIZEOF_SSIZE_T +#undef SIZEOF_VOIDP + +#ifdef __LP64__ + #define APR_INT64_STRFN strtol + #define SIZEOF_LONG 8 + #define SIZEOF_SIZE_T 8 + #define SIZEOF_SSIZE_T 8 + #define SIZEOF_VOIDP 8 +#else + #define APR_INT64_STRFN strtoll + #define SIZEOF_LONG 4 + #define SIZEOF_SIZE_T 4 + #define SIZEOF_SSIZE_T 4 + #define SIZEOF_VOIDP 4 +#endif + +/* + * ./i386/_types.h:typedef long long __int64_t; + * ./sys/_types.h:typedef __int64_t __darwin_off_t; + * ./sys/types.h:typedef __darwin_off_t off_t; + * So off_t is always long long + */ +#undef APR_OFF_T_STRFN +#define APR_OFF_T_STRFN APR_INT64_STRFN + + +#undef SETPGRP_VOID +#ifdef __DARWIN_UNIX03 + #define SETPGRP_VOID 1 +#else +/* #undef SETPGRP_VOID */ +#endif + +#endif /* DARWIN_10 */ + +#ifdef __cplusplus +} +#endif + +#endif /* APR_DARWIN_TYPES_H */ From 679b3d582bc2b95a5168d1f42fc8508b651abda4 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 13 Oct 2009 15:54:06 +0000 Subject: [PATCH 6565/7878] punt git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@824819 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_os_override.h | 70 ----------------------- include/arch/darwin/apr_darwin_types.h | 77 -------------------------- 2 files changed, 147 deletions(-) delete mode 100644 include/apr_os_override.h delete mode 100644 include/arch/darwin/apr_darwin_types.h diff --git a/include/apr_os_override.h b/include/apr_os_override.h deleted file mode 100644 index bfef893c740..00000000000 --- a/include/apr_os_override.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef APR_OS_OVERRIDE_H -#define APR_OS_OVERRIDE_H - -#ifdef __cplusplus -extern "C" { -#endif - - -#ifdef DARWIN_10 - -#undef APR_HAS_LARGE_FILES -#undef APR_SIZEOF_VOIDP -#undef APR_INT64_T_FMT -#undef APR_UINT64_T_FMT -#undef APR_UINT64_T_HEX_FMT - -#ifdef __LP64__ - #define APR_HAS_LARGE_FILES 0 - #define APR_SIZEOF_VOIDP 8 - #define APR_INT64_T_FMT "ld" - #define APR_UINT64_T_FMT "lu" - #define APR_UINT64_T_HEX_FMT "lx" -#else - #define APR_HAS_LARGE_FILES 1 - #define APR_SIZEOF_VOIDP 4 - #define APR_INT64_T_FMT "lld" - #define APR_UINT64_T_FMT "llu" - #define APR_UINT64_T_HEX_FMT "llx" -#endif - -#undef APR_IS_BIGENDIAN -#ifdef __BIG_ENDIAN__ - #define APR_IS_BIGENDIAN 1 -#else - #define APR_IS_BIGENDIAN 0 -#endif - -/* - * ./i386/_types.h:typedef long long __int64_t; - * ./sys/_types.h:typedef __int64_t __darwin_off_t; - * ./sys/types.h:typedef __darwin_off_t off_t; - * So off_t is always long long - */ -#undef APR_OFF_T_FMT -#define APR_OFF_T_FMT "lld" - -#endif /* DARWIN_10 */ - -#ifdef __cplusplus -} -#endif - -#endif /* APR_OS_OVERRIDE_H */ diff --git a/include/arch/darwin/apr_darwin_types.h b/include/arch/darwin/apr_darwin_types.h deleted file mode 100644 index 1fc12fa713a..00000000000 --- a/include/arch/darwin/apr_darwin_types.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef APR_DARWIN_TYPES_H -#define APR_DARWIN_TYPES_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Darwin 10's default compiler (gcc42) builds for both 64 and - * 32 bit architectures unless specifically told not to. - * In those cases, we need to override types depending on how - * we're being built at compile time - */ -#ifdef DARWIN_10 - -#undef APR_OFF_T_STRFN -#undef APR_INT64_STRFN -#undef SIZEOF_LONG -#undef SIZEOF_SIZE_T -#undef SIZEOF_SSIZE_T -#undef SIZEOF_VOIDP - -#ifdef __LP64__ - #define APR_INT64_STRFN strtol - #define SIZEOF_LONG 8 - #define SIZEOF_SIZE_T 8 - #define SIZEOF_SSIZE_T 8 - #define SIZEOF_VOIDP 8 -#else - #define APR_INT64_STRFN strtoll - #define SIZEOF_LONG 4 - #define SIZEOF_SIZE_T 4 - #define SIZEOF_SSIZE_T 4 - #define SIZEOF_VOIDP 4 -#endif - -/* - * ./i386/_types.h:typedef long long __int64_t; - * ./sys/_types.h:typedef __int64_t __darwin_off_t; - * ./sys/types.h:typedef __darwin_off_t off_t; - * So off_t is always long long - */ -#undef APR_OFF_T_STRFN -#define APR_OFF_T_STRFN APR_INT64_STRFN - - -#undef SETPGRP_VOID -#ifdef __DARWIN_UNIX03 - #define SETPGRP_VOID 1 -#else -/* #undef SETPGRP_VOID */ -#endif - -#endif /* DARWIN_10 */ - -#ifdef __cplusplus -} -#endif - -#endif /* APR_DARWIN_TYPES_H */ From 80bbfd8dc37999d7587218871bda468db56144f5 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 13 Oct 2009 15:55:51 +0000 Subject: [PATCH 6566/7878] Punt git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@824821 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 3 --- configure.in | 4 ---- include/apr.h.in | 12 ------------ 3 files changed, 19 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 25d1e4d5da8..680cbf4b614 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -203,9 +203,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(ac_cv_func_kqueue, [no]) APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332 ;; - *-apple-darwin10.*) - APR_ADDTO(CPPFLAGS, [-DDARWIN_10]) - ;; esac ;; *-dec-osf*) diff --git a/configure.in b/configure.in index 4bbb9dc8f01..db14f44765a 100644 --- a/configure.in +++ b/configure.in @@ -49,10 +49,6 @@ AH_BOTTOM([ #define BEOS_BONE 1 #endif -#ifdef DARWIN_10 -#include "../darwin/apr_darwin_types.h" -#endif - /* * Include common private declarations. */ diff --git a/include/apr.h.in b/include/apr.h.in index 608fb13fa5d..f808c232ba3 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -278,18 +278,8 @@ typedef unsigned @short_value@ apr_uint16_t; typedef @int_value@ apr_int32_t; typedef unsigned @int_value@ apr_uint32_t; -#ifdef DARWIN_10 -#ifdef __LP64__ -typedef long apr_int64_t; -typedef unsigned long apr_uint64_t; -#else -typedef long long apr_int64_t; -typedef unsigned long long apr_uint64_t; -#endif -#else typedef @long_value@ apr_int64_t; typedef unsigned @long_value@ apr_uint64_t; -#endif typedef @size_t_value@ apr_size_t; typedef @ssize_t_value@ apr_ssize_t; @@ -516,8 +506,6 @@ typedef int uid_t; typedef int gid_t; #endif -#include "apr_os_override.h" - #ifdef __cplusplus } #endif From 2f3c59139d23265b4157e9c9a91eb2fd8a17639a Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Tue, 13 Oct 2009 20:18:39 +0000 Subject: [PATCH 6567/7878] * apr_socket_is_connected was renamed to apr_socket_atreadeof and jorton had his share as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@824906 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 89021b5d006..9dad334e604 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) Add apr_socket_is_connected to detect whether the remote side of - a socket is still open. [Ruediger Pluem, Mladen Turk] + *) Add apr_socket_atreadeof to determine whether the receive part of the + socket has been closed by the peer. + [Ruediger Pluem, Mladen Turk, Joe Orton] *) Transfer the apr-util spec file contents to apr.spec. [Graham Leggett] From bc370e2de1929948586936f4657a2505cc0f64e7 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 16 Oct 2009 14:49:03 +0000 Subject: [PATCH 6568/7878] small cosmetic fix to sync with other output. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@825918 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/abts.c b/test/abts.c index 520b38dfb34..500d7babf4a 100644 --- a/test/abts.c +++ b/test/abts.c @@ -306,7 +306,7 @@ void abts_ptr_notnull(abts_case *tc, const void *ptr, int lineno) tc->failed = TRUE; if (verbose) { - fprintf(stderr, "Line %d: Expected non-NULL, but got NULL\n", lineno); + fprintf(stderr, "Line %d: expected non-NULL, but saw NULL\n", lineno); fflush(stderr); } } From 674eddf53c592a8397f6d5b0269a5c7fca5baf23 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 21 Oct 2009 00:05:17 +0000 Subject: [PATCH 6569/7878] remove dangling ";" after function body to resolve "warning: syntax error: empty declaration" from SunStudio git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@827846 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_odbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index 7a843ba7b06..a393a29c195 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -1138,7 +1138,7 @@ static int odbc_start_transaction(apr_pool_t *pool, apr_dbd_t *handle, } handle->can_commit = APR_DBD_TRANSACTION_COMMIT; return APR_FROM_SQL_RESULT(rc); -}; +} /** end_transaction: end a transaction **/ From a66cf0bcf9aaabea749f288a32cd5c7c28468c12 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Sun, 25 Oct 2009 04:12:21 +0000 Subject: [PATCH 6570/7878] Fix apr_hash_first() doxygen syntax. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@829490 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index 79fc51002e3..bf6532205e4 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -122,16 +122,15 @@ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, * @param p The pool to allocate the apr_hash_index_t iterator. If this * pool is NULL, then an internal, non-thread-safe iterator is used. * @param ht The hash table + * @return The iteration state * @remark There is no restriction on adding or deleting hash entries during * an iteration (although the results may be unpredictable unless all you do * is delete the current entry) and multiple iterations can be in * progress at the same time. - */ -/** - * @example * - *
    - * 
    + * @par Example:
    + *
    + * @code
      * int sum_values(apr_pool_t *p, apr_hash_t *ht)
      * {
      *     apr_hash_index_t *hi;
    @@ -143,7 +142,7 @@ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key,
      *     }
      *     return sum;
      * }
    - * 
    + * @endcode */ APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht); From bf1ed52ee5ed5b7e71cde99190f8f597ec2d8de0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 26 Oct 2009 13:31:43 +0000 Subject: [PATCH 6571/7878] Work around bogus return code in some circumstances with 32-bit port_getn() on Solaris 10 x86. AFAICT this problem only occurs when the return code should be zero, so changing the return code check should be sufficient. APR 1.3.8 wasn't affected. PR: 48029 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@829789 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index 6e33196de12..1d2613df10f 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -104,8 +104,11 @@ static apr_status_t call_port_getn(int port, port_event_t list[], } ret = port_getn(port, list, max, nget, tvptr); + /* Note: 32-bit port_getn() on Solaris 10 x86 returns large negative + * values instead of 0 when returning immediately. + */ - if (ret < 0) { + if (ret == -1) { rv = apr_get_netos_error(); switch(rv) { From e2e7ea4951ac76e5f7b7d5f0157a39c8e86ee950 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Sun, 1 Nov 2009 06:01:01 +0000 Subject: [PATCH 6572/7878] Set file/socket descriptor to -1 before close(), so that there is no chance of returning an already closed FD from apr_os_file_get()/apr_os_sock_get(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@831641 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 11 +++++++++-- network_io/unix/sockets.c | 12 ++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index e10fc3ddaab..bf3b43b6a54 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -29,10 +29,14 @@ static apr_status_t file_cleanup(apr_file_t *file, int is_child) { apr_status_t rv = APR_SUCCESS; + int fd = file->filedes; - if (close(file->filedes) == 0) { - file->filedes = -1; + /* Set file descriptor to -1 before close(), so that there is no + * chance of returning an already closed FD from apr_os_file_get(). + */ + file->filedes = -1; + if (close(fd) == 0) { /* Only the parent process should delete the file! */ if (!is_child && (file->flags & APR_DELONCLOSE)) { unlink(file->fname); @@ -44,6 +48,9 @@ static apr_status_t file_cleanup(apr_file_t *file, int is_child) #endif } else { + /* Restore, close() was not successful. */ + file->filedes = fd; + /* Are there any error conditions other than EINTR or EBADF? */ rv = errno; } diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 57f01927d52..3523c95f573 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -38,6 +38,12 @@ static char generic_inaddr_any[GENERIC_INADDR_ANY_LEN] = {0}; static apr_status_t socket_cleanup(void *sock) { apr_socket_t *thesocket = sock; + int sd = thesocket->socketdes; + + /* Set socket descriptor to -1 before close(), so that there is no + * chance of returning an already closed FD from apr_os_sock_get(). + */ + thesocket->socketdes = -1; #if APR_HAVE_SOCKADDR_UN if (thesocket->bound && thesocket->local_addr->family == APR_UNIX) { @@ -45,11 +51,13 @@ static apr_status_t socket_cleanup(void *sock) unlink(thesocket->local_addr->hostname); } #endif - if (close(thesocket->socketdes) == 0) { - thesocket->socketdes = -1; + if (close(sd) == 0) { return APR_SUCCESS; } else { + /* Restore, close() was not successful. */ + thesocket->socketdes = sd; + return errno; } } From 9a779c4a13ecd5f5bdd38837243e0ee8161d20cc Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 4 Nov 2009 23:28:15 +0000 Subject: [PATCH 6573/7878] * configure.in: Simplify check for accept4(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@832904 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 81 +++++++++++++++------------------------------------- 1 file changed, 23 insertions(+), 58 deletions(-) diff --git a/configure.in b/configure.in index db14f44765a..eb3ad492390 100644 --- a/configure.in +++ b/configure.in @@ -835,78 +835,43 @@ if test "$apr_cv_dup3" = "yes"; then AC_DEFINE([HAVE_DUP3], 1, [Define if dup3 function is supported]) fi -# test for accept4 +# Test for accept4(). Create a non-blocking socket, bind it to +# an unspecified port & address (kernel picks), and attempt to +# call accept4() on it. If the syscall is wired up (i.e. the +# kernel is new enough), it should return EAGAIN. AC_CACHE_CHECK([for accept4 support], [apr_cv_accept4], [AC_TRY_RUN([ -#include #include #include -#include #include -#include +#include +#include #include +#include +#include -#define A4_SOCK "./apr_accept4_test_socket" - -int main() +int main(int argc, char **argv) { - pid_t pid; int fd; - struct sockaddr_un loc, rem; - socklen_t rem_sz; - - if ((pid = fork())) { - int status; - - unlink(A4_SOCK); - - if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) - goto cleanup_failure2; - - loc.sun_family = AF_UNIX; - strncpy(loc.sun_path, A4_SOCK, sizeof(loc.sun_path) - 1); - - if (bind(fd, (struct sockaddr *) &loc, - sizeof(struct sockaddr_un)) == -1) - goto cleanup_failure; + struct sockaddr_in sin; - if (listen(fd, 5) == -1) - goto cleanup_failure; - - rem_sz = sizeof(struct sockaddr_un); - if (accept4(fd, (struct sockaddr *) &rem, &rem_sz, 0) == -1) { - goto cleanup_failure; - } - else { - close(fd); - waitpid(pid, &status, 0); - unlink(A4_SOCK); - return 0; - } - -cleanup_failure: - close(fd); -cleanup_failure2: - kill(pid, SIGKILL); - waitpid(pid, &status, 0); - unlink(A4_SOCK); + if ((fd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0)) == -1) return 1; - } - else { - if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) - return 1; /* this will be bad: we'll hang */ - loc.sun_family = AF_UNIX; - strncpy(loc.sun_path, A4_SOCK, sizeof(loc.sun_path) - 1); - - while(connect(fd, (struct sockaddr *) &loc, - sizeof(struct sockaddr_un)) == -1 && - (errno==ENOENT || errno==ECONNREFUSED)) - ; + memset(&sin, 0, sizeof sin); + sin.sin_family = AF_INET; + + if (bind(fd, (struct sockaddr *) &sin, sizeof sin) == -1) + return 2; + + if (listen(fd, 5) == -1) + return 3; - close(fd); + if (accept4(fd, NULL, 0, SOCK_NONBLOCK) == 0 + || errno == EAGAIN || errno == EWOULDBLOCK) return 0; - } + + return 4; }], [apr_cv_accept4=yes], [apr_cv_accept4=no], [apr_cv_accept4=no])]) if test "$apr_cv_accept4" = "yes"; then From 8143d988ae90ee14c5026227668954d9ff5c8c44 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 8 Nov 2009 18:14:37 +0000 Subject: [PATCH 6574/7878] don't assume child process can both connect and close before parent can both accept and look for EOF (fixes intermittent failure seen on Linux and OpenSolaris) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@833907 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/testsock.c b/test/testsock.c index ff6483a2f14..c95f4fc3747 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -247,9 +247,14 @@ static void test_atreadeof(abts_case *tc, void *data) rv = apr_socket_accept(&sock2, sock, p); APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); - /* The child closed the socket instantly */ + /* The child closed the socket as soon as it could... */ rv = apr_socket_atreadeof(sock2, &atreadeof); APR_ASSERT_SUCCESS(tc, "Determine whether at EOF, #3", rv); + if (!atreadeof) { /* ... but perhaps not yet; wait a moment */ + apr_sleep(apr_time_from_msec(5)); + rv = apr_socket_atreadeof(sock2, &atreadeof); + APR_ASSERT_SUCCESS(tc, "Determine whether at EOF, #4", rv); + } ABTS_INT_EQUAL(tc, 1, atreadeof); wait_child(tc, &proc); From a8ffb37788ffc4ef8968508723bc3b037eaedd2c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 9 Nov 2009 12:18:11 +0000 Subject: [PATCH 6575/7878] apr_pollset_create_ex(), apr_pollcb_create_ex(): simplify logic to update the caller's pollcb/pollset ptr, fixing a apr_pollcb_create_ex() crash in one of the fall-back paths which was reported by Neil Conway git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@834029 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollcb.c | 24 +++++++++++++----------- poll/unix/pollset.c | 34 +++++++++++++++++----------------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c index cd5266a7e04..0af3e512c53 100644 --- a/poll/unix/pollcb.c +++ b/poll/unix/pollcb.c @@ -72,21 +72,23 @@ static apr_pollcb_provider_t *pollcb_provider(apr_pollset_method_e method) return provider; } -APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, +APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **ret_pollcb, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags, apr_pollset_method_e method) { apr_status_t rv; + apr_pollcb_t *pollcb; apr_pollcb_provider_t *provider = NULL; + *ret_pollcb = NULL; + if (method == APR_POLLSET_DEFAULT) method = pollset_default_method; while (provider == NULL) { provider = pollcb_provider(method); if (!provider) { - *pollcb = NULL; if ((flags & APR_POLLSET_NODEFAULT) == APR_POLLSET_NODEFAULT) return APR_ENOTIMPL; if (method == pollset_default_method) @@ -95,15 +97,14 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, } } - *pollcb = apr_palloc(p, sizeof(**pollcb)); - (*pollcb)->nelts = 0; - (*pollcb)->nalloc = size; - (*pollcb)->pool = p; - (*pollcb)->provider = provider; + pollcb = apr_palloc(p, sizeof(*pollcb)); + pollcb->nelts = 0; + pollcb->nalloc = size; + pollcb->pool = p; + pollcb->provider = provider; - rv = (*provider->create)(*pollcb, size, p, flags); + rv = (*provider->create)(pollcb, size, p, flags); if (rv == APR_ENOTIMPL) { - *pollcb = NULL; if (method == pollset_default_method) { return rv; } @@ -117,13 +118,14 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, if (!provider) { return APR_ENOTIMPL; } - rv = (*provider->create)(*pollcb, size, p, flags); + rv = (*provider->create)(pollcb, size, p, flags); if (rv != APR_SUCCESS) { return rv; } - (*pollcb)->provider = provider; + pollcb->provider = provider; } + *ret_pollcb = pollcb; return APR_SUCCESS; } diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index 6a3fa5dfe2a..049509f409f 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -210,21 +210,23 @@ static apr_pollset_provider_t *pollset_provider(apr_pollset_method_e method) return provider; } -APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, +APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **ret_pollset, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags, apr_pollset_method_e method) { apr_status_t rv; + apr_pollset_t *pollset; apr_pollset_provider_t *provider = NULL; + *ret_pollset = NULL; + if (method == APR_POLLSET_DEFAULT) method = pollset_default_method; while (provider == NULL) { provider = pollset_provider(method); if (!provider) { - *pollset = NULL; if ((flags & APR_POLLSET_NODEFAULT) == APR_POLLSET_NODEFAULT) return APR_ENOTIMPL; if (method == pollset_default_method) @@ -237,41 +239,39 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, size++; } - *pollset = apr_palloc(p, sizeof(**pollset)); - (*pollset)->nelts = 0; - (*pollset)->nalloc = size; - (*pollset)->pool = p; - (*pollset)->flags = flags; - (*pollset)->provider = provider; + pollset = apr_palloc(p, sizeof(*pollset)); + pollset->nelts = 0; + pollset->nalloc = size; + pollset->pool = p; + pollset->flags = flags; + pollset->provider = provider; - rv = (*provider->create)(*pollset, size, p, flags); + rv = (*provider->create)(pollset, size, p, flags); if (rv == APR_ENOTIMPL) { if (method == pollset_default_method) { - *pollset = NULL; return rv; } provider = pollset_provider(pollset_default_method); if (!provider) { - *pollset = NULL; return APR_ENOTIMPL; } - rv = (*provider->create)(*pollset, size, p, flags); + rv = (*provider->create)(pollset, size, p, flags); if (rv != APR_SUCCESS) { - *pollset = NULL; return rv; } - (*pollset)->provider = provider; + pollset->provider = provider; } if (flags & APR_POLLSET_WAKEABLE) { /* Create wakeup pipe */ - if ((rv = create_wakeup_pipe(*pollset)) != APR_SUCCESS) { - *pollset = NULL; + if ((rv = create_wakeup_pipe(pollset)) != APR_SUCCESS) { return rv; } } if ((flags & APR_POLLSET_WAKEABLE) || provider->cleanup) - apr_pool_cleanup_register(p, *pollset, pollset_cleanup, + apr_pool_cleanup_register(p, pollset, pollset_cleanup, apr_pool_cleanup_null); + + *ret_pollset = pollset; return APR_SUCCESS; } From 6d5e370688bec3d6cdca3ccab01c379d06bb5487 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 9 Nov 2009 12:48:25 +0000 Subject: [PATCH 6576/7878] fix special poll() processing on Win32 to be consistent between . apr_{pollset|pollcb}_create_ex(..., APR_POLLSET_DEFAULT) and . apr_{pollset|pollcb}_create(...) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@834040 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollcb.c | 19 +++++++++++-------- poll/unix/pollset.c | 19 +++++++++++-------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c index 0af3e512c53..2971b021646 100644 --- a/poll/unix/pollcb.c +++ b/poll/unix/pollcb.c @@ -84,6 +84,17 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **ret_pollcb, *ret_pollcb = NULL; + #ifdef WIN32 + /* This will work only if ws2_32.dll has WSAPoll funtion. + * We could check the presence of the function here, + * but someone might implement other pollcb method in + * the future. + */ + if (method == APR_POLLSET_DEFAULT) { + method = APR_POLLSET_POLL; + } + #endif + if (method == APR_POLLSET_DEFAULT) method = pollset_default_method; while (provider == NULL) { @@ -135,14 +146,6 @@ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, apr_uint32_t flags) { apr_pollset_method_e method = APR_POLLSET_DEFAULT; - #ifdef WIN32 - /* This will work only if ws2_32.dll has WSAPoll funtion. - * We could check the presence of the function here, - * but someone might implement other pollcb method in - * the future. - */ - method = APR_POLLSET_POLL; - #endif return apr_pollcb_create_ex(pollcb, size, p, flags, method); } diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index 049509f409f..5ad70c994df 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -222,6 +222,17 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **ret_pollset, *ret_pollset = NULL; + #ifdef WIN32 + /* Favor WSAPoll if supported. + * This will work only if ws2_32.dll has WSAPoll funtion. + * In other cases it will fall back to select() method unless + * the APR_POLLSET_NODEFAULT is added to the flags. + */ + if (method == APR_POLLSET_DEFAULT) { + method = APR_POLLSET_POLL; + } + #endif + if (method == APR_POLLSET_DEFAULT) method = pollset_default_method; while (provider == NULL) { @@ -297,14 +308,6 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t flags) { apr_pollset_method_e method = APR_POLLSET_DEFAULT; - #ifdef WIN32 - /* Favor WSAPoll if supported. - * This will work only if ws2_32.dll has WSAPoll funtion. - * In other cases it will fall back to select() method unless - * the APR_POLLSET_NODEFAULT is added to the flags. - */ - method = APR_POLLSET_POLL; - #endif return apr_pollset_create_ex(pollset, size, p, flags, method); } From eb515e0443f21325cb26d44f8f70e34a47bba707 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 9 Nov 2009 16:16:06 +0000 Subject: [PATCH 6577/7878] fix incorrect assumptions in pollset/pollcb tests: - polling won't necessary detect the status change immediately after an I/O operation - a single poll call won't necessarily return multiple status changes after multiple I/O operations Submitted by: Neil Conway Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@834130 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/test/testpoll.c b/test/testpoll.c index e7792c2f11a..56ce90e4998 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -308,12 +308,14 @@ static void multi_event_pollset(abts_case *tc, void *data) send_msg(s, sa, 0, tc); - rv = apr_pollset_poll(pollset, 0, &lrv, &descs); - ABTS_INT_EQUAL(tc, 0, APR_STATUS_IS_TIMEUP(rv)); + rv = apr_pollset_poll(pollset, -1, &lrv, &descs); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); if (lrv == 1) { + int ev = descs[0].rtnevents; ABTS_PTR_EQUAL(tc, s[0], descs[0].desc.s); - ABTS_INT_EQUAL(tc, APR_POLLIN | APR_POLLOUT, descs[0].rtnevents); ABTS_PTR_EQUAL(tc, s[0], descs[0].client_data); + ABTS_ASSERT(tc, "either or both of APR_POLLIN, APR_POLLOUT returned", + ((ev & APR_POLLIN) != 0) || ((ev & APR_POLLOUT) != 0)); } else if (lrv == 2) { ABTS_PTR_EQUAL(tc, s[0], descs[0].desc.s); @@ -381,7 +383,7 @@ static void send0_pollset(abts_case *tc, void *data) int num; send_msg(s, sa, 0, tc); - rv = apr_pollset_poll(pollset, 0, &num, &descs); + rv = apr_pollset_poll(pollset, -1, &num, &descs); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 1, num); ABTS_PTR_NOTNULL(tc, descs); @@ -411,14 +413,19 @@ static void send_middle_pollset(abts_case *tc, void *data) send_msg(s, sa, 2, tc); send_msg(s, sa, 5, tc); - rv = apr_pollset_poll(pollset, 0, &num, &descs); + rv = apr_pollset_poll(pollset, -1, &num, &descs); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_INT_EQUAL(tc, 2, num); ABTS_PTR_NOTNULL(tc, descs); - - ABTS_ASSERT(tc, "Incorrect socket in result set", - ((descs[0].desc.s == s[2]) && (descs[1].desc.s == s[5])) || - ((descs[0].desc.s == s[5]) && (descs[1].desc.s == s[2]))); + ABTS_ASSERT(tc, "either one or two events returned", + num == 1 || num == 2); + + /* The poll might only see the first sent message, in which + * case we just don't bother checking this assertion */ + if (num == 2) { + ABTS_ASSERT(tc, "Incorrect socket in result set", + ((descs[0].desc.s == s[2]) && (descs[1].desc.s == s[5])) || + ((descs[0].desc.s == s[5]) && (descs[1].desc.s == s[2]))); + } } static void clear_middle_pollset(abts_case *tc, void *data) @@ -443,7 +450,7 @@ static void send_last_pollset(abts_case *tc, void *data) int num; send_msg(s, sa, LARGE_NUM_SOCKETS - 1, tc); - rv = apr_pollset_poll(pollset, 0, &num, &descs); + rv = apr_pollset_poll(pollset, -1, &num, &descs); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 1, num); ABTS_PTR_NOTNULL(tc, descs); @@ -607,8 +614,8 @@ static void trigger_pollcb(abts_case *tc, void *data) send_msg(s, sa, 0, tc); pcb.tc = tc; pcb.count = 0; - rv = apr_pollcb_poll(pollcb, 0, trigger_pollcb_cb, &pcb); - ABTS_INT_EQUAL(tc, 0, APR_STATUS_IS_TIMEUP(rv)); + rv = apr_pollcb_poll(pollcb, -1, trigger_pollcb_cb, &pcb); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 1, pcb.count); rv = apr_pollcb_remove(pollcb, &socket_pollfd); From c5f530f913ed7d8c51d646188e9a3c28784b9eaa Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 9 Nov 2009 16:19:09 +0000 Subject: [PATCH 6578/7878] whitespace fixes Submitted by: Neil Conway Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@834133 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/testpoll.c b/test/testpoll.c index 56ce90e4998..c5e4b5d2206 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -53,7 +53,7 @@ static void make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, rv = apr_socket_create(sock, (*sa)->family, SOCK_DGRAM, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv =apr_socket_bind((*sock), (*sa)); + rv = apr_socket_bind((*sock), (*sa)); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } @@ -381,7 +381,7 @@ static void send0_pollset(abts_case *tc, void *data) apr_status_t rv; const apr_pollfd_t *descs = NULL; int num; - + send_msg(s, sa, 0, tc); rv = apr_pollset_poll(pollset, -1, &num, &descs); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -389,7 +389,7 @@ static void send0_pollset(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, descs); ABTS_PTR_EQUAL(tc, s[0], descs[0].desc.s); - ABTS_PTR_EQUAL(tc, s[0], descs[0].client_data); + ABTS_PTR_EQUAL(tc, s[0], descs[0].client_data); } static void recv0_pollset(abts_case *tc, void *data) @@ -456,7 +456,7 @@ static void send_last_pollset(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, descs); ABTS_PTR_EQUAL(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].desc.s); - ABTS_PTR_EQUAL(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].client_data); + ABTS_PTR_EQUAL(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].client_data); } static void clear_last_pollset(abts_case *tc, void *data) @@ -695,11 +695,8 @@ abts_suite *testpoll(abts_suite *suite) abts_run_test(suite, clear_middle_pollset, NULL); abts_run_test(suite, send_last_pollset, NULL); abts_run_test(suite, clear_last_pollset, NULL); - abts_run_test(suite, pollset_remove, NULL); - abts_run_test(suite, close_all_sockets, NULL); - abts_run_test(suite, create_all_sockets, NULL); abts_run_test(suite, setup_pollcb, NULL); abts_run_test(suite, trigger_pollcb, NULL); From 96e46f72354f750dbab1e4aa0dca8ebb9b4206b9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 9 Nov 2009 16:37:50 +0000 Subject: [PATCH 6579/7878] fix pollcb hangs on Solaris when using Event Ports passing nget=n will block until n events are available (or timeout/signal occurs) possible future optimization: in order to retrieve 1 or more events, first call port_getn() with nget=0 to find out how many events are available, then call it again with the number available git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@834136 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index 1d2613df10f..a4509ac8a9c 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -537,7 +537,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, { apr_pollfd_t *pollfd; apr_status_t rv; - unsigned int i, nget = pollcb->nalloc; + unsigned int i, nget = 1; rv = call_port_getn(pollcb->fd, pollcb->pollset.port, pollcb->nalloc, &nget, timeout); From f86b9f39ecf3173477688fa1c87b4e6b98563580 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 10 Nov 2009 18:30:26 +0000 Subject: [PATCH 6580/7878] add testcases for method fallback logic in apr_{pollcb|pollset}_create_ex(), including one for a crash fixed in r834029 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@834585 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 105 insertions(+), 1 deletion(-) diff --git a/test/testpoll.c b/test/testpoll.c index c5e4b5d2206..b298c91651f 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -666,6 +666,109 @@ static void timeout_pollin_pollcb(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } +static void pollset_default(abts_case *tc, void *data) +{ + apr_status_t rv1, rv2; + apr_pollset_t *pollset; + + /* verify that APR will successfully create a pollset if an invalid method + * is specified as long as APR_POLLSET_NODEFAULT isn't specified + * (no platform has both APR_POLLSET_PORT and APR_POLLSET_KQUEUE, so at + * least one create call will succeed after having to switch to the default + * type) + */ + rv1 = apr_pollset_create_ex(&pollset, 1, p, 0, APR_POLLSET_PORT); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv1); + ABTS_PTR_NOTNULL(tc, pollset); + + rv1 = apr_pollset_create_ex(&pollset, 1, p, 0, APR_POLLSET_KQUEUE); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv1); + ABTS_PTR_NOTNULL(tc, pollset); + + /* verify that APR will fail to create a pollset if an invalid method is + * specified along with APR_POLLSET_NODEFAULT + * (no platform has both APR_POLLSET_PORT and APR_POLLSET_KQUEUE, so at + * least one create call will fail since it can't switch to the default + * type) + */ + rv1 = apr_pollset_create_ex(&pollset, 1, p, APR_POLLSET_NODEFAULT, + APR_POLLSET_PORT); + + if (rv1 == APR_SUCCESS) { + ABTS_PTR_NOTNULL(tc, pollset); + } + + rv2 = apr_pollset_create_ex(&pollset, 1, p, APR_POLLSET_NODEFAULT, + APR_POLLSET_KQUEUE); + if (rv2 == APR_SUCCESS) { + ABTS_PTR_NOTNULL(tc, pollset); + } + + ABTS_ASSERT(tc, + "failure using APR_POLLSET_NODEFAULT with unsupported method", + rv1 != APR_SUCCESS || rv2 != APR_SUCCESS); +} + +static void pollcb_default(abts_case *tc, void *data) +{ + apr_status_t rv1, rv2; + apr_pollcb_t *pollcb; + + /* verify that APR will successfully create a pollcb if an invalid method + * is specified as long as APR_POLLSET_NODEFAULT isn't specified + * (no platform has both APR_POLLSET_PORT and APR_POLLSET_KQUEUE, so at + * least one create call will succeed after having to switch to the default + * type) + */ + rv1 = apr_pollcb_create_ex(&pollcb, 1, p, 0, APR_POLLSET_PORT); + if (rv1 == APR_ENOTIMPL) { + ABTS_NOT_IMPL(tc, "pollcb interface not supported"); + return; + } + + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv1); + ABTS_PTR_NOTNULL(tc, pollcb); + + rv1 = apr_pollcb_create_ex(&pollcb, 1, p, 0, APR_POLLSET_KQUEUE); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv1); + ABTS_PTR_NOTNULL(tc, pollcb); + + /* verify that APR will fail to create a pollcb if an invalid method is + * specified along with APR_POLLSET_NODEFAULT + * (no platform has both APR_POLLSET_PORT and APR_POLLSET_KQUEUE, so at + * least one create call will fail since it can't switch to the default + * type) + */ + rv1 = apr_pollcb_create_ex(&pollcb, 1, p, APR_POLLSET_NODEFAULT, + APR_POLLSET_PORT); + + if (rv1 == APR_SUCCESS) { + ABTS_PTR_NOTNULL(tc, pollcb); + } + + rv2 = apr_pollcb_create_ex(&pollcb, 1, p, APR_POLLSET_NODEFAULT, + APR_POLLSET_KQUEUE); + if (rv2 == APR_SUCCESS) { + ABTS_PTR_NOTNULL(tc, pollcb); + } + + ABTS_ASSERT(tc, + "failure using APR_POLLSET_NODEFAULT with unsupported method", + rv1 != APR_SUCCESS || rv2 != APR_SUCCESS); + + + /* verify basic behavior for another method fallback case (this caused + * APR to crash before r834029) + */ + + rv1 = apr_pollcb_create_ex(&pollcb, 1, p, 0, APR_POLLSET_POLL); + if (rv1 != APR_ENOTIMPL) { + ABTS_INT_EQUAL(tc, rv1, APR_SUCCESS); + ABTS_PTR_NOTNULL(tc, pollcb); + } +} + abts_suite *testpoll(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -703,7 +806,8 @@ abts_suite *testpoll(abts_suite *suite) abts_run_test(suite, timeout_pollcb, NULL); abts_run_test(suite, timeout_pollin_pollcb, NULL); abts_run_test(suite, close_all_sockets, NULL); - + abts_run_test(suite, pollset_default, NULL); + abts_run_test(suite, pollcb_default, NULL); return suite; } From 15fb6750a8fd903f97df38c53e1dc0661ba9113e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Nov 2009 22:27:39 +0000 Subject: [PATCH 6581/7878] Allow --verbose'ity with ./buildconf for debugging git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@835607 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/buildconf b/buildconf index 11554ed3466..730a088508d 100755 --- a/buildconf +++ b/buildconf @@ -19,9 +19,14 @@ # buildconf: Build the support scripts needed to compile from a # checked-out version of the source code. +if [ "$1" = "--verbose" -o "$1" = "-v" ]; then + verbose="--verbose" + shift +fi + # Verify that the builder has the right config tools installed # -build/buildcheck.sh || exit 1 +build/buildcheck.sh $verbose || exit 1 libtoolize=`build/PrintPath glibtoolize1 glibtoolize libtoolize15 libtoolize14 libtoolize` if [ "x$libtoolize" = "x" ]; then @@ -45,7 +50,7 @@ lt_pversion=`$libtoolize --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*// lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` IFS=.; set $lt_version; IFS=' ' if test "$1" = "1"; then - $libtoolize --copy --automake + $libtoolize --copy --automake --force $verbose if [ -f libtool.m4 ]; then ltfile=`pwd`/libtool.m4 else @@ -67,7 +72,7 @@ if test "$1" = "1"; then cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 fi if test "$1" = "2"; then - $libtoolize --copy + $libtoolize --copy --force $verbose # Wouldn't it just be better to define top_builddir?? mv build/libtool.m4 build/libtool.m4.$$ cat build/libtool.m4.$$ | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 @@ -81,17 +86,17 @@ rm -f aclocal.m4 libtool.m4 # Generate the autoconf header and ./configure # echo "buildconf: creating include/arch/unix/apr_private.h.in ..." -${AUTOHEADER:-autoheader} +${AUTOHEADER:-autoheader} $verbose echo "buildconf: creating configure ..." ### do some work to toss config.cache? -${AUTOCONF:-autoconf} +${AUTOCONF:-autoconf} $verbose # Remove autoconf 2.5x's cache directory rm -rf autom4te*.cache echo "buildconf: generating 'make' outputs ..." -build/gen-build.py make +build/gen-build.py $verbose make # Create RPM Spec file if [ -f `which cut` ]; then From 114654a1f5eb85ac742fd82d6bd2599a643d4127 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Nov 2009 22:28:20 +0000 Subject: [PATCH 6582/7878] These are needed in 2.2.6 libtool to correctly libtoolize --copy and to create .dll's on win32 from the buildconf/configure schema git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@835608 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.in b/configure.in index eb3ad492390..3eab0f345fc 100644 --- a/configure.in +++ b/configure.in @@ -8,6 +8,7 @@ AC_PREREQ(2.50) AC_INIT(build/apr_common.m4) AC_CONFIG_HEADER(include/arch/unix/apr_private.h) +AC_CONFIG_MACRO_DIR(build) AC_CONFIG_AUX_DIR(build) AC_CONFIG_MACRO_DIR(build) @@ -214,7 +215,9 @@ case $host in fi else dnl libtoolize requires that the following not be indented + dnl should become LT_INIT(win32-dll) AC_PROG_LIBTOOL +AC_LIBTOOL_WIN32_DLL # get libtool's setting of shlibpath_var eval `grep "^shlibpath_var=[[A-Z_]]*$" $apr_builddir/libtool` if test "x$shlibpath_var" = "x"; then From ab02da63b1f67141bfa6d3e9d50fb929f3a872a9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 13 Nov 2009 00:27:10 +0000 Subject: [PATCH 6583/7878] bump to 2.59 baseline for autoconf (it -was- 5 yrs old, this year) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@835658 13f79535-47bb-0310-9956-ffa450edef68 --- build.conf | 4 ++-- build/buildcheck.sh | 8 ++++---- configure.in | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.conf b/build.conf index 88320bb55a5..2b8fd04f7fb 100644 --- a/build.conf +++ b/build.conf @@ -39,8 +39,8 @@ platform_dirs = dso file_io locks memory misc mmap network_io poll random shmem support threadproc time user atomic -# all the public headers -headers = include/*.h +# all the public headers; apr_ldap.h is generated +headers = include/*.h include/apr_ldap.h # aplibtool is manually built by the configure process # build/aplibtool.c diff --git a/build/buildcheck.sh b/build/buildcheck.sh index d0e2e26ed30..69e38033f4e 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -14,18 +14,18 @@ py_version=`python -c 'import sys; print sys.version' 2>&1|sed 's/ .*//;q'` echo "buildconf: python version $py_version (ok)" fi -# autoconf 2.50 or newer +# autoconf 2.59 or newer ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;q'` if test -z "$ac_version"; then echo "buildconf: autoconf not found." -echo " You need autoconf version 2.50 or newer installed" +echo " You need autoconf version 2.59 or newer installed" echo " to build APR from SVN." exit 1 fi IFS=.; set $ac_version; IFS=' ' -if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then +if test "$1" = "2" -a "$2" -lt "59" || test "$1" -lt "2"; then echo "buildconf: autoconf version $ac_version found." -echo " You need autoconf version 2.50 or newer installed" +echo " You need autoconf version 2.59 or newer installed" echo " to build APR from SVN." exit 1 else diff --git a/configure.in b/configure.in index 3eab0f345fc..a2d25000db6 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl dnl Process this file with autoconf to produce a configure script. dnl Use ./buildconf to prepare build files and run autoconf for APR. -AC_PREREQ(2.50) +AC_PREREQ(2.59) AC_INIT(build/apr_common.m4) AC_CONFIG_HEADER(include/arch/unix/apr_private.h) From 11d4a419ea2ae044288171894ed6c0f90d9faf60 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 13 Nov 2009 00:28:44 +0000 Subject: [PATCH 6584/7878] Revert a bit of miscommit on 835658 - this is a problem for me if anyone can validate this fix to missing, installed apr_ldap.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@835663 13f79535-47bb-0310-9956-ffa450edef68 --- build.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.conf b/build.conf index 2b8fd04f7fb..88320bb55a5 100644 --- a/build.conf +++ b/build.conf @@ -39,8 +39,8 @@ platform_dirs = dso file_io locks memory misc mmap network_io poll random shmem support threadproc time user atomic -# all the public headers; apr_ldap.h is generated -headers = include/*.h include/apr_ldap.h +# all the public headers +headers = include/*.h # aplibtool is manually built by the configure process # build/aplibtool.c From 197a7d4a63ef97d0be88a6dff4ccaa65049ed94d Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Fri, 13 Nov 2009 06:40:13 +0000 Subject: [PATCH 6585/7878] * Add missing APR_DECLARE for apr_socket_atreadeof git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@835758 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/socket_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/socket_util.c b/network_io/unix/socket_util.c index b23aed6b25a..6cd28a55c43 100644 --- a/network_io/unix/socket_util.c +++ b/network_io/unix/socket_util.c @@ -17,7 +17,7 @@ #include "apr_network_io.h" #include "apr_poll.h" -apr_status_t apr_socket_atreadeof(apr_socket_t *sock, int *atreadeof) +APR_DECLARE(apr_status_t) apr_socket_atreadeof(apr_socket_t *sock, int *atreadeof) { apr_pollfd_t pfds[1]; apr_status_t rv; From 09d84311f35b1df63ec3fa25a527de3b7ad68a87 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 13 Nov 2009 21:16:43 +0000 Subject: [PATCH 6586/7878] remove redundant AC_CONFIG_MACRO_DIR, thanks trawick for the observation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@835992 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.in b/configure.in index a2d25000db6..f90cdbb25e7 100644 --- a/configure.in +++ b/configure.in @@ -8,7 +8,6 @@ AC_PREREQ(2.59) AC_INIT(build/apr_common.m4) AC_CONFIG_HEADER(include/arch/unix/apr_private.h) -AC_CONFIG_MACRO_DIR(build) AC_CONFIG_AUX_DIR(build) AC_CONFIG_MACRO_DIR(build) From 216aea53f96ac087f997fc2b8c35c20ffc3882a0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 13 Nov 2009 22:22:12 +0000 Subject: [PATCH 6587/7878] Entirely identical resultset to vanilla, or --quiet arg with libtool 2.26 and autoconf 2.63. However, --quiet --verbose does not produce the desired level of information, while omitting these both causes libtool to be too verbose in most cases. Undoes one bit of rationalization from r748902 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@836027 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildconf b/buildconf index 730a088508d..7f2aea2a1c2 100755 --- a/buildconf +++ b/buildconf @@ -72,7 +72,7 @@ if test "$1" = "1"; then cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 fi if test "$1" = "2"; then - $libtoolize --copy --force $verbose + $libtoolize --copy --automake --force $verbose # Wouldn't it just be better to define top_builddir?? mv build/libtool.m4 build/libtool.m4.$$ cat build/libtool.m4.$$ | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 From 312ef196c0c641bbfe394265bd5b8424beaa2afd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 14 Nov 2009 00:18:20 +0000 Subject: [PATCH 6588/7878] Fix sequencing for older autoconf/libtool. Thanks for the report, Jeff. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@836076 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index f90cdbb25e7..9f7c4f52097 100644 --- a/configure.in +++ b/configure.in @@ -215,8 +215,8 @@ case $host in else dnl libtoolize requires that the following not be indented dnl should become LT_INIT(win32-dll) -AC_PROG_LIBTOOL AC_LIBTOOL_WIN32_DLL +AC_PROG_LIBTOOL # get libtool's setting of shlibpath_var eval `grep "^shlibpath_var=[[A-Z_]]*$" $apr_builddir/libtool` if test "x$shlibpath_var" = "x"; then From d52d3c314746be67215ac68f1da144fbd91ab052 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 14 Nov 2009 02:22:09 +0000 Subject: [PATCH 6589/7878] Check that an event was actually filled in when port_getn() returns -1/EINTR with nget > 0. This resolves a crash when receiving a signal. PR: 48030 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@836091 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index a4509ac8a9c..7a31c468324 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -103,6 +103,10 @@ static apr_status_t call_port_getn(int port, port_event_t list[], tvptr = &tv; } + list[0].portev_user = (void *)-1; /* so we can double check that an + * event was returned + */ + ret = port_getn(port, list, max, nget, tvptr); /* Note: 32-bit port_getn() on Solaris 10 x86 returns large negative * values instead of 0 when returning immediately. @@ -114,10 +118,12 @@ static apr_status_t call_port_getn(int port, port_event_t list[], switch(rv) { case EINTR: case ETIME: - if (*nget > 0) { + if (*nget > 0 && list[0].portev_user != (void *)-1) { /* This confusing API can return an event at the same time * that it reports EINTR or ETIME. If that occurs, just - * report the event. + * report the event. With EINTR, nget can be > 0 without + * any event, so check that portev_user was filled in. + * * (Maybe it will be simplified; see thread * http://mail.opensolaris.org * /pipermail/networking-discuss/2009-August/011979.html From 1c196af10a79932cdba674d538c9af75c9f12d28 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 16 Nov 2009 07:40:15 +0000 Subject: [PATCH 6590/7878] Fix -DWIN32 and APR_FILES_AS_SOCKETS for MinGW git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@880640 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 9f7c4f52097..68c6c49e909 100644 --- a/configure.in +++ b/configure.in @@ -496,11 +496,13 @@ case $host in ;; *mingw*) OSDIR="win32" + APR_ADDTO(CPPFLAGS,-DWIN32) ac_cv_file__dev_zero="no" ac_cv_func_setpgrp_void="no" apr_cv_tcp_nodelay_with_cork="no" enable_threads="system_threads" - eolstr="\\n" + eolstr="\\r\\n" + file_as_socket="0" proc_mutex_is_global=1 OBJECTS_PLATFORM='$(OBJECTS_win32)' ;; From ca983b0f14112b1ec5734ec4a281c195395dbd64 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 17 Nov 2009 14:26:20 +0000 Subject: [PATCH 6591/7878] Solaris 10 or later: Use pthread by default for cross-process mutex instead of fcntl; the latter is not thread-aware, leading to EDEADLK failures with some multi- threaded, multi-process applications. Proper recovery after a crash of the mutex owner was tested on Solaris 10 U5 and OpenSolaris 2009.06. Earlier Solaris versions weren't tested, and there were reports in httpd-land long ago about failures to recover the mutex. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@881301 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 680cbf4b614..e6a24661117 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -243,7 +243,11 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-solaris2*) PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT]) - APR_SETIFNULL(apr_lock_method, [USE_FCNTL_SERIALIZE]) + if test $PLATOSVERS -ge 10; then + APR_SETIFNULL(apr_lock_method, [USE_PROC_PTHREAD_SERIALIZE]) + else + APR_SETIFNULL(apr_lock_method, [USE_FCNTL_SERIALIZE]) + fi # readdir64_r error handling seems broken on Solaris (at least # up till 2.8) -- it will return -1 at end-of-directory. APR_SETIFNULL(ac_cv_func_readdir64_r, [no]) From e57d8bad054d6bdb2e6ab0dd3f09fe673278eac5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 19 Nov 2009 19:34:52 +0000 Subject: [PATCH 6592/7878] document errno usage with apr_atoi64() and apr_strtoi64() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@882260 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index d43412cf8a1..6b71ff17eb6 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -334,7 +334,7 @@ APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *buf, * digits are prefixed with '0x', in which case it will be treated as * base 16. * @return The numeric value of the string. On overflow, errno is set - * to ERANGE. + * to ERANGE. On success, errno is set to 0. */ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base); @@ -342,7 +342,8 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base); * parse a base-10 numeric string into a 64-bit numeric value. * Equivalent to apr_strtoi64(buf, (char**)NULL, 10). * @param buf The string to parse - * @return The numeric value of the string + * @return The numeric value of the string. On overflow, errno is set + * to ERANGE. On success, errno is set to 0. */ APR_DECLARE(apr_int64_t) apr_atoi64(const char *buf); From 308119e589235516acd25fb4c478405b48afdad9 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Fri, 20 Nov 2009 17:35:23 +0000 Subject: [PATCH 6593/7878] Support connecttimeout, readtimeout and writetimeout MySQL options PR 48251 Submitted by Marko Kevac git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@882650 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ dbd/apr_dbd_mysql.c | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/CHANGES b/CHANGES index 9dad334e604..e087006605b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Support connecttimeout, readtimeout and writetimeout MySQL options + PR 48251 [Marko Kevac ] + *) Add apr_socket_atreadeof to determine whether the receive part of the socket has been closed by the peer. [Ruediger Pluem, Mladen Turk, Joe Orton] diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c index 482b82a96a6..a54204cf9a5 100644 --- a/dbd/apr_dbd_mysql.c +++ b/dbd/apr_dbd_mysql.c @@ -1122,7 +1122,12 @@ static apr_dbd_t *dbd_mysql_open(apr_pool_t *pool, const char *params, {"flags", NULL}, {"fldsz", NULL}, {"group", NULL}, +#if MYSQL_VERSION_ID >= 50013 {"reconnect", NULL}, + {"connecttimeout", NULL}, + {"readtimeout", NULL}, + {"writetimeout", NULL}, +#endif {NULL, NULL} }; unsigned int port = 0; @@ -1178,6 +1183,18 @@ static apr_dbd_t *dbd_mysql_open(apr_pool_t *pool, const char *params, if (fields[9].value != NULL) { do_reconnect = atoi(fields[9].value) ? 1 : 0; } + if (fields[10].value != NULL) { + mysql_options(sql->conn, MYSQL_OPT_CONNECT_TIMEOUT, + atoi(fields[10].value)); + } + if (fields[11].value != NULL) { + mysql_options(sql->conn, MYSQL_OPT_READ_TIMEOUT, + atoi(fields[11].value)); + } + if (fields[12].value != NULL) { + mysql_options(sql->conn, MYSQL_OPT_WRITE_TIMEOUT, + atoi(fields[12].value)); + } #endif #if MYSQL_VERSION_ID >= 50013 From d780ffce52d4fe7dd6def844d1772ebff47c6cee Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 21 Nov 2009 14:37:10 +0000 Subject: [PATCH 6594/7878] add missing apr_global_mutex_lockfile(), corresponding to apr_proc_mutex_lockfile() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@882915 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_global_mutex.h | 8 ++++++++ locks/unix/global_mutex.c | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index dac9d0a0c0e..3540705d426 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -120,6 +120,13 @@ APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex); */ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex); +/** + * Return the name of the lockfile for the mutex, or NULL + * if the mutex doesn't use a lock file + */ + +APR_DECLARE(const char *) apr_global_mutex_lockfile(apr_global_mutex_t *mutex); + /** * Set mutex permissions. */ @@ -145,6 +152,7 @@ APR_POOL_DECLARE_ACCESSOR(global_mutex); #define apr_global_mutex_trylock apr_proc_mutex_trylock #define apr_global_mutex_unlock apr_proc_mutex_unlock #define apr_global_mutex_destroy apr_proc_mutex_destroy +#define apr_global_mutex_lockfile apr_proc_mutex_lockfile #define apr_global_mutex_pool_get apr_proc_mutex_pool_get #endif diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index c5ff938c783..c0b6c3d3591 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -175,6 +175,11 @@ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) return apr_pool_cleanup_run(mutex->pool, mutex, global_mutex_cleanup); } +APR_DECLARE(const char *) apr_global_mutex_lockfile(apr_global_mutex_t *mutex) +{ + return apr_proc_mutex_lockfile(mutex->proc_mutex); +} + APR_PERMS_SET_IMPLEMENT(global_mutex) { apr_status_t rv; From c034934e76d85834b2ee515ed5d11070fb36d68b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 25 Nov 2009 15:22:59 +0000 Subject: [PATCH 6595/7878] add apr_global_mutex_name(), for retrieving the name of the mechanism used by the underlying apr_proc_mutex_t declare NULL as the result for any future mechanisms that don't have an underlying apr_proc_mutex_t or equivalent git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@884139 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_global_mutex.h | 9 +++++++++ locks/unix/global_mutex.c | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index 3540705d426..3cd384704f4 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -127,6 +127,14 @@ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex); APR_DECLARE(const char *) apr_global_mutex_lockfile(apr_global_mutex_t *mutex); +/** + * Display the name of the mutex, as it relates to the actual method used + * for the underlying apr_proc_mutex_t, if any. NULL is returned if + * there is no underlying apr_proc_mutex_t. + * @param mutex the name of the mutex + */ +APR_DECLARE(const char *) apr_global_mutex_name(apr_global_mutex_t *mutex); + /** * Set mutex permissions. */ @@ -153,6 +161,7 @@ APR_POOL_DECLARE_ACCESSOR(global_mutex); #define apr_global_mutex_unlock apr_proc_mutex_unlock #define apr_global_mutex_destroy apr_proc_mutex_destroy #define apr_global_mutex_lockfile apr_proc_mutex_lockfile +#define apr_global_mutex_name apr_proc_mutex_name #define apr_global_mutex_pool_get apr_proc_mutex_pool_get #endif diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index c0b6c3d3591..ca3b86e46eb 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -180,6 +180,11 @@ APR_DECLARE(const char *) apr_global_mutex_lockfile(apr_global_mutex_t *mutex) return apr_proc_mutex_lockfile(mutex->proc_mutex); } +APR_DECLARE(const char *) apr_global_mutex_name(apr_global_mutex_t *mutex) +{ + return apr_proc_mutex_name(mutex->proc_mutex); +} + APR_PERMS_SET_IMPLEMENT(global_mutex) { apr_status_t rv; From 7d20ddfaaad46b12b3b75cb8720f24509dafb7d0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 25 Nov 2009 15:32:14 +0000 Subject: [PATCH 6596/7878] Win32 apr_{global,proc}_mutex_name() and apr_{global,proc}_mutex_lockfile() returned the wrong information git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@884144 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/proc_mutex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 13a1959f100..38366f18543 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -186,12 +186,12 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex) APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) { - return NULL; + return mutex->fname; } APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) { - return mutex->fname; + return apr_proc_mutex_defname(); } APR_DECLARE(const char *) apr_proc_mutex_defname(void) From c2c19bab9b5949b1e5685887f7a40ae895ed8025 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Thu, 26 Nov 2009 21:03:41 +0000 Subject: [PATCH 6597/7878] * mysql_options() requires a pointer as third argument, not a value. PR: 48251 Submitted by: Marko Kevac Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@884697 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_mysql.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c index a54204cf9a5..4b2790aacef 100644 --- a/dbd/apr_dbd_mysql.c +++ b/dbd/apr_dbd_mysql.c @@ -1131,6 +1131,7 @@ static apr_dbd_t *dbd_mysql_open(apr_pool_t *pool, const char *params, {NULL, NULL} }; unsigned int port = 0; + unsigned int timeout = 0; apr_dbd_t *sql = apr_pcalloc(pool, sizeof(apr_dbd_t)); sql->fldsz = FIELDSIZE; sql->conn = mysql_init(sql->conn); @@ -1184,16 +1185,19 @@ static apr_dbd_t *dbd_mysql_open(apr_pool_t *pool, const char *params, do_reconnect = atoi(fields[9].value) ? 1 : 0; } if (fields[10].value != NULL) { - mysql_options(sql->conn, MYSQL_OPT_CONNECT_TIMEOUT, - atoi(fields[10].value)); + timeout = atoi(fields[10].value); + mysql_options(sql->conn, MYSQL_OPT_CONNECT_TIMEOUT, + (const void *)&timeout); } if (fields[11].value != NULL) { - mysql_options(sql->conn, MYSQL_OPT_READ_TIMEOUT, - atoi(fields[11].value)); + timeout = atoi(fields[11].value); + mysql_options(sql->conn, MYSQL_OPT_READ_TIMEOUT, + (const void *)&timeout); } if (fields[12].value != NULL) { - mysql_options(sql->conn, MYSQL_OPT_WRITE_TIMEOUT, - atoi(fields[12].value)); + timeout = atoi(fields[12].value); + mysql_options(sql->conn, MYSQL_OPT_WRITE_TIMEOUT, + (const void *)&timeout); } #endif From dcdf4ac451d893ddefd876b11efd1b0d490f9fe0 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Tue, 1 Dec 2009 16:06:29 +0000 Subject: [PATCH 6598/7878] * Silence compiler warning git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@885813 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_mysql.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c index 4b2790aacef..df4f6e3b0cd 100644 --- a/dbd/apr_dbd_mysql.c +++ b/dbd/apr_dbd_mysql.c @@ -1131,7 +1131,9 @@ static apr_dbd_t *dbd_mysql_open(apr_pool_t *pool, const char *params, {NULL, NULL} }; unsigned int port = 0; +#if MYSQL_VERSION_ID >= 50013 unsigned int timeout = 0; +#endif apr_dbd_t *sql = apr_pcalloc(pool, sizeof(apr_dbd_t)); sql->fldsz = FIELDSIZE; sql->conn = mysql_init(sql->conn); From 9b07a6bbea7b760f6d5e09d7ceed1259064a0a60 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 4 Dec 2009 05:22:43 +0000 Subject: [PATCH 6599/7878] Catch up with branch and release activity git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@887065 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 2ffd5d452a1..3fb7860b5f9 100644 --- a/STATUS +++ b/STATUS @@ -5,24 +5,36 @@ The current version of this file can be found at: * http://svn.apache.org/repos/asf/apr/apr/trunk/STATUS + +NOTICE: + Effective with version 2.0 , apr-util ceases to exist. For reference, the final standalone apr-util can be found in subversion at: * http://svn.apache.org/repos/asf/apr/apr-util/branches -r784519 + Patches considered for backport are noted in their branches' STATUS: * http://svn.apache.org/repos/asf/apr/apr/branches/0.9.x/STATUS * http://svn.apache.org/repos/asf/apr/apr/branches/1.3.x/STATUS * http://svn.apache.org/repos/asf/apr/apr/branches/1.4.x/STATUS + * http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x/STATUS * http://svn.apache.org/repos/asf/apr/apr-util/branches/0.9.x/STATUS * http://svn.apache.org/repos/asf/apr/apr-util/branches/1.3.x/STATUS * http://svn.apache.org/repos/asf/apr/apr-util/branches/1.4.x/STATUS + * http://svn.apache.org/repos/asf/apr/apr-util/branches/1.5.x/STATUS Releases: 2.0.0 : in development on trunk/ + 1.5.0 : in development on branches/1.5.x/ 1.4.0 : in development on branches/1.4.x/ - 1.3.4 : in development on branches/1.3.x/ + 1.3.9 : tagged September 21, 2009 + 1.3.8 : released August 6, 2009 + 1.3.7 : released July 23, 2009 + 1.3.6 : released July 4, 2009 + 1.3.5 : released June 5, 2009 + 1.3.4 : not released 1.3.3 : released August 14, 2008 1.3.2 : released June 23, 2008 1.3.1 : not released From f47f58aec48a62da4c4c49d88b913aedd999eebf Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 4 Dec 2009 05:50:14 +0000 Subject: [PATCH 6600/7878] catch up with release activity git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@887072 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 3fb7860b5f9..1e57acb41a0 100644 --- a/STATUS +++ b/STATUS @@ -29,7 +29,7 @@ Releases: 2.0.0 : in development on trunk/ 1.5.0 : in development on branches/1.5.x/ 1.4.0 : in development on branches/1.4.x/ - 1.3.9 : tagged September 21, 2009 + 1.3.9 : released September 23, 2009 1.3.8 : released August 6, 2009 1.3.7 : released July 23, 2009 1.3.6 : released July 4, 2009 From 02b5e11cc696cf8a862fe9e55feb88c831a2c1de Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Wed, 9 Dec 2009 01:27:49 +0000 Subject: [PATCH 6601/7878] let HP-UX on IA64 fall through to the default unix case, using .so instead of .sl. A quick scan of a couple years of dev@apr only turned up one person reporting results on this platform, and they had the 8/9 testdso failures as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@888669 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testdso.c b/test/testdso.c index 6ab94010ab0..0d9f27bb2ee 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -38,7 +38,7 @@ #elif defined(DARWIN) # define MOD_NAME ".libs/mod_test.so" # define LIB_NAME ".libs/libmod_test.dylib" -#elif defined(__hpux__) || defined(__hpux) +#elif (defined(__hpux__) || defined(__hpux)) && !defined(__ia64) # define MOD_NAME ".libs/mod_test.sl" # define LIB_NAME ".libs/libmod_test.sl" #elif defined(_AIX) || defined(__bsdi__) From 2047cd94c34caf0bdbf10e8fdcb673a780259b15 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 14 Dec 2009 18:20:03 +0000 Subject: [PATCH 6602/7878] fix warnings for non-static functions without prototype git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@890423 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmemcache.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/testmemcache.c b/test/testmemcache.c index bcdf02e8fe1..80bc10bd21b 100644 --- a/test/testmemcache.c +++ b/test/testmemcache.c @@ -72,8 +72,8 @@ typedef struct { * if you wanted to use some external hashing library or functions for * consistent hashing, for example, this would be a good place to do it. */ -apr_uint32_t my_hash_func(void *baton, const char *data, - apr_size_t data_len) +static apr_uint32_t my_hash_func(void *baton, const char *data, + apr_size_t data_len) { return HASH_FUNC_RESULT; @@ -85,9 +85,9 @@ apr_uint32_t my_hash_func(void *baton, const char *data, * and pulls some number from the *baton, which is a struct that has some * kind of meaningful stuff in it. */ -apr_memcache_server_t *my_server_func(void *baton, - apr_memcache_t *mc, - const apr_uint32_t hash) +static apr_memcache_server_t *my_server_func(void *baton, + apr_memcache_t *mc, + const apr_uint32_t hash) { apr_memcache_server_t *ms = NULL; my_hash_server_baton *mhsb = (my_hash_server_baton *)baton; @@ -106,7 +106,7 @@ apr_memcache_server_t *my_server_func(void *baton, } apr_uint16_t firsttime = 0; -int randval(apr_uint32_t high) +static int randval(apr_uint32_t high) { apr_uint32_t i = 0; double d = 0; @@ -177,7 +177,7 @@ static void test_memcache_create(abts_case * tc, void *data) /* install our own custom hashing and server selection routines. */ -int create_test_hash(apr_pool_t *p, apr_hash_t *h) +static int create_test_hash(apr_pool_t *p, apr_hash_t *h) { int i; @@ -539,7 +539,7 @@ static void test_memcache_setget(abts_case * tc, void *data) /* use apr_socket stuff to see if there is in fact a memcached server * running on PORT. */ -apr_status_t check_mc(void) +static apr_status_t check_mc(void) { apr_pool_t *pool = p; apr_status_t rv; From 68fd21cf5d52c2b7ba82865a380d74d87901d662 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 15 Dec 2009 00:28:46 +0000 Subject: [PATCH 6603/7878] Refactor the apr_crypto.h interface so that the apr_crypto_t structure remains private. Correctly reference the apr_crypto_t context as a context and not a factory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@890579 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 32 ++++++------ crypto/apr_crypto_nss.c | 61 ++++++++++++++--------- crypto/apr_crypto_openssl.c | 41 +++++++++++----- include/apr_crypto.h | 34 +++++-------- include/private/apr_crypto_internal.h | 24 ++++++--- test/testcrypto.c | 70 ++++++++++++++++----------- 6 files changed, 152 insertions(+), 110 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 3fdbc65408a..9b596affe53 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -190,15 +190,15 @@ APR_DECLARE(const char *)apr_crypto_driver_name (const apr_crypto_driver_t *driv } /** - * @brief Get the result of a previous operation on this context. - * @param pool - process pool - * @param params - array of key parameters - * @param factory - factory pointer will be written here + * @brief Get the result of the last operation on a context. If the result + * is NULL, the operation was successful. + * @param f - context pointer + * @param result - the result structure + * @return APR_SUCCESS for success */ -APR_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_t *f, - const apu_err_t **result) { - *result = f->result; - return APR_SUCCESS; +APR_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_driver_t *driver, + const apr_crypto_t *f, const apu_err_t **result) { + return driver->error(f, result); } /** @@ -206,11 +206,11 @@ APR_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_t *f, * @param driver - driver to use * @param pool - process pool * @param params - array of key parameters - * @param factory - factory pointer will be written here + * @param f - context pointer will be written here */ -APR_DECLARE(apr_status_t) apr_crypto_factory(const apr_crypto_driver_t *driver, +APR_DECLARE(apr_status_t) apr_crypto_make(const apr_crypto_driver_t *driver, apr_pool_t *pool, const apr_array_header_t *params, apr_crypto_t **f) { - return driver->factory(pool, params, f); + return driver->make(pool, params, f); } /** @@ -257,7 +257,7 @@ APR_DECLARE(apr_status_t) apr_crypto_passphrase(const apr_crypto_driver_t *drive * *ctx is not NULL, *ctx must point at a previously created structure. * @param driver - driver to use * @param p The pool to use. - * @param f The block factory to use. + * @param f The block context to use. * @param key The key structure to use. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. @@ -334,7 +334,7 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish( * *ctx is not NULL, *ctx must point at a previously created structure. * @param driver - driver to use * @param p The pool to use. - * @param f The block factory to use. + * @param f The block context to use. * @param key The key structure to use. * @param iv Optional initialisation vector. * @param ctx The block context returned, see note. @@ -415,10 +415,10 @@ APR_DECLARE(apr_status_t) apr_crypto_block_cleanup( } /** - * @brief Clean encryption / decryption factory. - * @note After cleanup, a factory is free to be reused if necessary. + * @brief Clean encryption / decryption context. + * @note After cleanup, a context is free to be reused if necessary. * @param driver - driver to use - * @param f The factory to use. + * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ APR_DECLARE(apr_status_t) apr_crypto_cleanup(const apr_crypto_driver_t *driver, diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 89ba127409b..d63c7427d07 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -46,6 +46,13 @@ #include #endif +struct apr_crypto_t { + apr_pool_t *pool; + apu_err_t *result; + apr_array_header_t *keys; + apr_crypto_config_t *config; +}; + struct apr_crypto_config_t { }; @@ -57,13 +64,20 @@ struct apr_crypto_key_t { }; struct apr_crypto_block_t { - const apr_crypto_t *factory; + const apr_crypto_t *f; apr_pool_t *pool; PK11Context *ctx; apr_crypto_key_t *key; int blockSize; }; +/** + * Fetch the most recent error from this driver. + */ +static apr_status_t crypto_error(const apr_crypto_t *f, const apu_err_t **result) { + *result = f->result; + return APR_SUCCESS; +} /** * Shutdown the crypto library and release resources. @@ -175,10 +189,10 @@ static apr_status_t crypto_block_cleanup_helper(void *data) } /** - * @brief Clean encryption / decryption factory. - * @note After cleanup, a factory is free to be reused if necessary. + * @brief Clean encryption / decryption context. + * @note After cleanup, a context is free to be reused if necessary. * @param driver - driver to use - * @param f The factory to use. + * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ static apr_status_t crypto_cleanup(apr_crypto_t *f) @@ -209,13 +223,13 @@ static apr_status_t crypto_cleanup_helper(void *data) * @param driver - driver to use * @param pool - process pool * @param params - array of key parameters - * @param factory - factory pointer will be written here + * @param context - context pointer will be written here * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ -static apr_status_t crypto_factory(apr_pool_t *pool, - const apr_array_header_t *params, - apr_crypto_t **factory) +static apr_status_t crypto_make(apr_pool_t *pool, + const apr_array_header_t *params, + apr_crypto_t **ff) { apr_crypto_config_t *config = NULL; /* struct apr_crypto_param_t *ents = params ? (struct apr_crypto_param_t *)params->elts : NULL; */ @@ -226,7 +240,7 @@ static apr_status_t crypto_factory(apr_pool_t *pool, if (!f) { return APR_ENOMEM; } - *factory = f; + *ff = f; f->pool = pool; config = f->config = apr_pcalloc(pool, sizeof(apr_crypto_config_t)); if (!config) { @@ -249,7 +263,7 @@ static apr_status_t crypto_factory(apr_pool_t *pool, default: f->result->rc = -1; f->result->reason = "The NSS module currently supports " - "no per factory initialisation parameters at this time, but " + "no per context initialisation parameters at this time, but " "may do in future."; return APR_EINIT; } @@ -412,7 +426,7 @@ static apr_status_t crypto_passphrase(apr_pool_t *p, * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. * @param p The pool to use. - * @param f The block factory to use. + * @param f The block context to use. * @param key The key structure. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. @@ -442,7 +456,7 @@ static apr_status_t crypto_block_encrypt_init(apr_pool_t *p, if (!block) { return APR_ENOMEM; } - block->factory = f; + block->f = f; block->pool = p; apr_pool_cleanup_register(p, block, @@ -536,8 +550,8 @@ static apr_status_t crypto_block_encrypt(apr_crypto_block_t *block, if (s != SECSuccess) { PRErrorCode perr = PORT_GetError(); if (perr) { - block->factory->result->rc = perr; - block->factory->result->msg = PR_ErrorToName(perr); + block->f->result->rc = perr; + block->f->result->msg = PR_ErrorToName(perr); } return APR_ECRYPT; } @@ -579,8 +593,8 @@ static apr_status_t crypto_block_encrypt_finish(apr_crypto_block_t *block, if (s != SECSuccess) { PRErrorCode perr = PORT_GetError(); if (perr) { - block->factory->result->rc = perr; - block->factory->result->msg = PR_ErrorToName(perr); + block->f->result->rc = perr; + block->f->result->msg = PR_ErrorToName(perr); } rv = APR_ECRYPT; } @@ -595,7 +609,7 @@ static apr_status_t crypto_block_encrypt_finish(apr_crypto_block_t *block, * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. * @param p The pool to use. - * @param f The block factory to use. + * @param f The block context to use. * @param key The key structure. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. @@ -623,7 +637,7 @@ static apr_status_t crypto_block_decrypt_init(apr_pool_t *p, if (!block) { return APR_ENOMEM; } - block->factory = f; + block->f = f; block->pool = p; apr_pool_cleanup_register(p, block, @@ -704,8 +718,8 @@ static apr_status_t crypto_block_decrypt(apr_crypto_block_t *block, if (s != SECSuccess) { PRErrorCode perr = PORT_GetError(); if (perr) { - block->factory->result->rc = perr; - block->factory->result->msg = PR_ErrorToName(perr); + block->f->result->rc = perr; + block->f->result->msg = PR_ErrorToName(perr); } return APR_ECRYPT; } @@ -747,8 +761,8 @@ static apr_status_t crypto_block_decrypt_finish(apr_crypto_block_t *block, if (s != SECSuccess) { PRErrorCode perr = PORT_GetError(); if (perr) { - block->factory->result->rc = perr; - block->factory->result->msg = PR_ErrorToName(perr); + block->f->result->rc = perr; + block->f->result->msg = PR_ErrorToName(perr); } rv = APR_ECRYPT; } @@ -764,7 +778,8 @@ static apr_status_t crypto_block_decrypt_finish(apr_crypto_block_t *block, APU_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_nss_driver = { "nss", crypto_init, - crypto_factory, + crypto_error, + crypto_make, crypto_passphrase, crypto_block_encrypt_init, crypto_block_encrypt, diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index a9dda907ab4..6870d965fa8 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -36,6 +36,13 @@ #define LOG_PREFIX "apr_crypto_openssl: " +struct apr_crypto_t { + apr_pool_t *pool; + apu_err_t *result; + apr_array_header_t *keys; + apr_crypto_config_t *config; +}; + struct apr_crypto_config_t { ENGINE *engine; }; @@ -49,7 +56,7 @@ struct apr_crypto_key_t { }; struct apr_crypto_block_t { - const apr_crypto_t *factory; + const apr_crypto_t *f; apr_pool_t *pool; EVP_CIPHER_CTX cipherCtx; int initialised; @@ -58,6 +65,14 @@ struct apr_crypto_block_t { int doPad; }; +/** + * Fetch the most recent error from this driver. + */ +static apr_status_t crypto_error(const apr_crypto_t *f, const apu_err_t **result) { + *result = f->result; + return APR_SUCCESS; +} + /** * Shutdown the crypto library and release resources. */ @@ -115,10 +130,10 @@ static apr_status_t crypto_block_cleanup_helper(void *data) { } /** - * @brief Clean encryption / decryption factory. - * @note After cleanup, a factory is free to be reused if necessary. + * @brief Clean encryption / decryption context. + * @note After cleanup, a context is free to be reused if necessary. * @param driver - driver to use - * @param f The factory to use. + * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ static apr_status_t crypto_cleanup(apr_crypto_t *f) { @@ -145,12 +160,12 @@ static apr_status_t crypto_cleanup_helper(void *data) { * @param driver - driver to use * @param pool - process pool * @param params - array of key parameters - * @param factory - factory pointer will be written here + * @param context - context pointer will be written here * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ -static apr_status_t crypto_factory(apr_pool_t *pool, - const apr_array_header_t *params, apr_crypto_t **factory) { +static apr_status_t crypto_make(apr_pool_t *pool, + const apr_array_header_t *params, apr_crypto_t **ff) { apr_crypto_config_t *config = NULL; struct apr_crypto_param_t *ents = params ? (struct apr_crypto_param_t *) params->elts : NULL; @@ -159,7 +174,7 @@ static apr_status_t crypto_factory(apr_pool_t *pool, if (!f) { return APR_ENOMEM; } - *factory = f; + *ff = f; f->pool = pool; config = f->config = apr_pcalloc(pool, sizeof(apr_crypto_config_t)); if (!config) { @@ -318,7 +333,7 @@ static apr_status_t crypto_passphrase(apr_pool_t *p, const apr_crypto_t *f, * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. * @param p The pool to use. - * @param f The block factory to use. + * @param f The block context to use. * @param type 3DES_192, AES_128, AES_192, AES_256. * @param mode Electronic Code Book / Cipher Block Chaining. * @param key The key @@ -344,7 +359,7 @@ static apr_status_t crypto_block_encrypt_init(apr_pool_t *p, if (!block) { return APR_ENOMEM; } - block->factory = f; + block->f = f; block->pool = p; apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, @@ -487,7 +502,7 @@ static apr_status_t crypto_block_encrypt_finish(apr_crypto_block_t *ctx, * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. * @param p The pool to use. - * @param f The block factory to use. + * @param f The block context to use. * @param key The key structure. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. @@ -510,7 +525,7 @@ static apr_status_t crypto_block_decrypt_init(apr_pool_t *p, if (!block) { return APR_ENOMEM; } - block->factory = f; + block->f = f; block->pool = p; apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, @@ -640,7 +655,7 @@ static apr_status_t crypto_block_decrypt_finish(apr_crypto_block_t *ctx, * OpenSSL module. */ APU_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_openssl_driver = { - "openssl", crypto_init, crypto_factory, crypto_passphrase, + "openssl", crypto_init, crypto_error, crypto_make, crypto_passphrase, crypto_block_encrypt_init, crypto_block_encrypt, crypto_block_encrypt_finish, crypto_block_decrypt_init, crypto_block_decrypt, crypto_block_decrypt_finish, diff --git a/include/apr_crypto.h b/include/apr_crypto.h index fa94a04bb16..e51d760d62a 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -175,20 +175,11 @@ typedef struct apr_crypto_param_t { /* These are opaque structs. Instantiation is up to each backend */ typedef struct apr_crypto_driver_t apr_crypto_driver_t; +typedef struct apr_crypto_t apr_crypto_t; typedef struct apr_crypto_config_t apr_crypto_config_t; typedef struct apr_crypto_key_t apr_crypto_key_t; typedef struct apr_crypto_block_t apr_crypto_block_t; -/** - * Public factory API, common to all backends. - */ -typedef struct apr_crypto_t { - apr_pool_t *pool; - apu_err_t *result; - apr_array_header_t *keys; - apr_crypto_config_t *config; -} apr_crypto_t; - /** * @brief Perform once-only initialisation. Call once only. * @@ -222,15 +213,14 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver(apr_pool_t *pool, const char *na APR_DECLARE(const char *) apr_crypto_driver_name(const apr_crypto_driver_t *driver); /** - * @brief Get the result of the last operation on a factory. If the result + * @brief Get the result of the last operation on a context. If the result * is NULL, the operation was successful. - * @param driver - driver to use - * @param factory - factory pointer will be written here + * @param f - context pointer * @param result - the result structure * @return APR_SUCCESS for success */ -APR_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_t *f, - const apu_err_t **result); +APR_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_driver_t *driver, + const apr_crypto_t *f, const apu_err_t **result); /** * @brief Create a context for supporting encryption. Keys, certificates, @@ -240,11 +230,11 @@ APR_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_t *f, * @param driver - driver to use * @param pool - process pool * @param params - array of key parameters - * @param factory - factory pointer will be written here + * @param f - context pointer will be written here * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ -APR_DECLARE(apr_status_t) apr_crypto_factory(const apr_crypto_driver_t *driver, +APR_DECLARE(apr_status_t) apr_crypto_make(const apr_crypto_driver_t *driver, apr_pool_t *pool, const apr_array_header_t *params, apr_crypto_t **f); /** @@ -288,7 +278,7 @@ APR_DECLARE(apr_status_t) apr_crypto_passphrase(const apr_crypto_driver_t *drive * *ctx is not NULL, *ctx must point at a previously created structure. * @param driver - driver to use * @param p The pool to use. - * @param f The block factory to use. + * @param f The block context to use. * @param key The key structure to use. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. @@ -359,7 +349,7 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish( * *ctx is not NULL, *ctx must point at a previously created structure. * @param driver - driver to use * @param p The pool to use. - * @param f The block factory to use. + * @param f The block context to use. * @param key The key structure to use. * @param iv Optional initialisation vector. * @param ctx The block context returned, see note. @@ -432,10 +422,10 @@ APR_DECLARE(apr_status_t) apr_crypto_block_cleanup( const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx); /** - * @brief Clean encryption / decryption factory. - * @note After cleanup, a factory is free to be reused if necessary. + * @brief Clean encryption / decryption context. + * @note After cleanup, a context is free to be reused if necessary. * @param driver - driver to use - * @param f The factory to use. + * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ APR_DECLARE(apr_status_t) apr_crypto_cleanup(const apr_crypto_driver_t *driver, diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index de109de576d..20b0c80eece 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -40,6 +40,14 @@ struct apr_crypto_driver_t { */ apr_status_t (*init)(apr_pool_t *pool, const apr_array_header_t *params, int *rc); + /** + * @brief: fetch the most recent error from this driver. + * @param f - context pointer + * @param result - the result structure + * @return APR_SUCCESS for success. + */ + apr_status_t (*error)(const apr_crypto_t *f, const apu_err_t **result); + /** * @brief Create a context for supporting encryption. Keys, certificates, * algorithms and other parameters will be set per context. More than @@ -52,7 +60,7 @@ struct apr_crypto_driver_t { * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ - apr_status_t (*factory)(apr_pool_t *pool, const apr_array_header_t *params, + apr_status_t (*make)(apr_pool_t *pool, const apr_array_header_t *params, apr_crypto_t **f); /** @@ -94,7 +102,7 @@ struct apr_crypto_driver_t { * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. * @param p The pool to use. - * @param f The block factory to use. + * @param f The block context to use. * @param key The key structure. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. @@ -159,7 +167,7 @@ struct apr_crypto_driver_t { * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. * @param p The pool to use. - * @param f The block factory to use. + * @param f The block context to use. * @param key The key structure. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. @@ -226,17 +234,17 @@ struct apr_crypto_driver_t { apr_status_t (*block_cleanup)(apr_crypto_block_t *ctx); /** - * @brief Clean encryption / decryption factory. - * @note After cleanup, a factory is free to be reused if necessary. + * @brief Clean encryption / decryption context. + * @note After cleanup, a context is free to be reused if necessary. * @param driver - driver to use - * @param f The factory to use. + * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ apr_status_t (*cleanup)(apr_crypto_t *f); /** - * @brief Clean encryption / decryption factory. - * @note After cleanup, a factory is free to be reused if necessary. + * @brief Clean encryption / decryption context. + * @note After cleanup, a context is free to be reused if necessary. * @param pool The pool to use. * @return Returns APR_ENOTIMPL if not supported. */ diff --git a/test/testcrypto.c b/test/testcrypto.c index cc81b73370b..c44ea024ab0 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -79,7 +79,7 @@ static const apr_crypto_driver_t *get_openssl_driver(abts_case *tc, } -static apr_crypto_t *factory(abts_case *tc, apr_pool_t *pool, +static apr_crypto_t *make(abts_case *tc, apr_pool_t *pool, const apr_crypto_driver_t *driver) { apr_crypto_t *f = NULL; @@ -88,9 +88,9 @@ static apr_crypto_t *factory(abts_case *tc, apr_pool_t *pool, return NULL; } - /* get the factory */ - apr_crypto_factory(driver, pool, NULL, &f); - ABTS_ASSERT(tc, "apr_crypto_factory returned NULL", f != NULL); + /* get the context */ + apr_crypto_make(driver, pool, NULL, &f); + ABTS_ASSERT(tc, "apr_crypto_make returned NULL", f != NULL); return f; @@ -102,6 +102,7 @@ static const apr_crypto_key_t *passphrase(abts_case *tc, apr_pool_t *pool, int doPad, const char *description) { apr_crypto_key_t *key = NULL; + const apu_err_t *result = NULL; const char *pass = "secret"; const char *salt = "salt"; apr_status_t rv; @@ -115,14 +116,19 @@ static const apr_crypto_key_t *passphrase(abts_case *tc, apr_pool_t *pool, (unsigned char *) salt, strlen(salt), type, mode, doPad, 4096, &key, NULL); if (APR_ENOCIPHER == rv) { - ABTS_NOT_IMPL(tc, apr_psprintf(pool, "skipped: %s %s passphrase return APR_ENOCIPHER: error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), f->result->rc, f->result->reason ? f->result->reason : "", f->result->msg ? f->result->msg : "")); + apr_crypto_error(driver, f, &result); + ABTS_NOT_IMPL(tc, apr_psprintf(pool, + "skipped: %s %s passphrase return APR_ENOCIPHER: error %d: %s (%s)\n", + description, apr_crypto_driver_name(driver), result->rc, + result->reason ? result->reason : "", result->msg ? result->msg : "")); return NULL; } else { if (APR_SUCCESS != rv) { + apr_crypto_error(driver, f, &result); fprintf(stderr, "passphrase: %s %s native error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), f->result->rc, - f->result->reason ? f->result->reason : "", - f->result->msg ? f->result->msg : ""); + description, apr_crypto_driver_name(driver), result->rc, + result->reason ? result->reason : "", + result->msg ? result->msg : ""); } ABTS_ASSERT(tc, "apr_crypto_passphrase returned APR_ENOKEY", rv != APR_ENOKEY); ABTS_ASSERT(tc, "apr_crypto_passphrase returned APR_EPADDING", rv != APR_EPADDING); @@ -145,6 +151,7 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, apr_size_t *blockSize, const char *description) { apr_crypto_block_t *block = NULL; + const apu_err_t *result = NULL; apr_size_t len = 0; apr_status_t rv; @@ -159,10 +166,11 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, ABTS_NOT_IMPL(tc, "apr_crypto_block_encrypt_init returned APR_ENOTIMPL"); } else { if (APR_SUCCESS != rv) { + apr_crypto_error(driver, f, &result); fprintf(stderr, "encrypt_init: %s %s native error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), f->result->rc, - f->result->reason ? f->result->reason : "", - f->result->msg ? f->result->msg : ""); + description, apr_crypto_driver_name(driver), result->rc, + result->reason ? result->reason : "", + result->msg ? result->msg : ""); } ABTS_ASSERT(tc, "apr_crypto_block_encrypt_init returned APR_ENOKEY", rv != APR_ENOKEY); ABTS_ASSERT(tc, "apr_crypto_block_encrypt_init returned APR_ENOIV", rv != APR_ENOIV); @@ -179,10 +187,11 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, rv = apr_crypto_block_encrypt(driver, block, cipherText, cipherTextLen, in, inlen); if (APR_SUCCESS != rv) { + apr_crypto_error(driver, f, &result); fprintf(stderr, "encrypt: %s %s native error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), f->result->rc, - f->result->reason ? f->result->reason : "", - f->result->msg ? f->result->msg : ""); + description, apr_crypto_driver_name(driver), result->rc, + result->reason ? result->reason : "", + result->msg ? result->msg : ""); } ABTS_ASSERT(tc, "apr_crypto_block_encrypt returned APR_ECRYPT", rv != APR_ECRYPT); ABTS_ASSERT(tc, "failed to apr_crypto_block_encrypt", rv == APR_SUCCESS); @@ -195,10 +204,11 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, rv = apr_crypto_block_encrypt_finish(driver, block, *cipherText + *cipherTextLen, &len); if (APR_SUCCESS != rv) { + apr_crypto_error(driver, f, &result); fprintf(stderr, "encrypt_finish: %s %s native error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), f->result->rc, - f->result->reason ? f->result->reason : "", - f->result->msg ? f->result->msg : ""); + description, apr_crypto_driver_name(driver), result->rc, + result->reason ? result->reason : "", + result->msg ? result->msg : ""); } ABTS_ASSERT(tc, "apr_crypto_block_encrypt_finish returned APR_ECRYPT", rv != APR_ECRYPT); ABTS_ASSERT(tc, "apr_crypto_block_encrypt_finish returned APR_EPADDING", rv != APR_EPADDING); @@ -221,6 +231,7 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, apr_size_t *blockSize, const char *description) { apr_crypto_block_t *block = NULL; + const apu_err_t *result = NULL; apr_size_t len = 0; apr_status_t rv; @@ -235,10 +246,11 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, ABTS_NOT_IMPL(tc, "apr_crypto_block_decrypt_init returned APR_ENOTIMPL"); } else { if (APR_SUCCESS != rv) { + apr_crypto_error(driver, f, &result); fprintf(stderr, "decrypt_init: %s %s native error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), f->result->rc, - f->result->reason ? f->result->reason : "", - f->result->msg ? f->result->msg : ""); + description, apr_crypto_driver_name(driver), result->rc, + result->reason ? result->reason : "", + result->msg ? result->msg : ""); } ABTS_ASSERT(tc, "apr_crypto_block_decrypt_init returned APR_ENOKEY", rv != APR_ENOKEY); ABTS_ASSERT(tc, "apr_crypto_block_decrypt_init returned APR_ENOIV", rv != APR_ENOIV); @@ -255,10 +267,11 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, rv = apr_crypto_block_decrypt(driver, block, plainText, plainTextLen, cipherText, cipherTextLen); if (APR_SUCCESS != rv) { + apr_crypto_error(driver, f, &result); fprintf(stderr, "decrypt: %s %s native error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), f->result->rc, - f->result->reason ? f->result->reason : "", - f->result->msg ? f->result->msg : ""); + description, apr_crypto_driver_name(driver), result->rc, + result->reason ? result->reason : "", + result->msg ? result->msg : ""); } ABTS_ASSERT(tc, "apr_crypto_block_decrypt returned APR_ECRYPT", rv != APR_ECRYPT); ABTS_ASSERT(tc, "failed to apr_crypto_block_decrypt", rv == APR_SUCCESS); @@ -271,10 +284,11 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, rv = apr_crypto_block_decrypt_finish(driver, block, *plainText + *plainTextLen, &len); if (APR_SUCCESS != rv) { + apr_crypto_error(driver, f, &result); fprintf(stderr, "decrypt_finish: %s %s native error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), f->result->rc, - f->result->reason ? f->result->reason : "", - f->result->msg ? f->result->msg : ""); + description, apr_crypto_driver_name(driver), result->rc, + result->reason ? result->reason : "", + result->msg ? result->msg : ""); } ABTS_ASSERT(tc, "apr_crypto_block_decrypt_finish returned APR_ECRYPT", rv != APR_ECRYPT); ABTS_ASSERT(tc, "apr_crypto_block_decrypt_finish returned APR_EPADDING", rv != APR_EPADDING); @@ -317,8 +331,8 @@ static void crypto_block_cross(abts_case *tc, apr_pool_t *pool, const unsigned char *iv = NULL; apr_size_t blockSize = 0; - f1 = factory(tc, pool, driver1); - f2 = factory(tc, pool, driver2); + f1 = make(tc, pool, driver1); + f2 = make(tc, pool, driver2); key1 = passphrase(tc, pool, driver1, f1, type, mode, doPad, description); key2 = passphrase(tc, pool, driver2, f2, type, mode, doPad, description); From b7a72bc13da76e6ca2d7d989aa7b866f6d63ab33 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 16 Dec 2009 15:04:37 +0000 Subject: [PATCH 6604/7878] replace --enable-dtrace and corresponding DTrace-specific hook probes with a general purpose facility that can be used with DTrace or most anything else no probe implementation, DTrace or otherwise, is provided with APR git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891269 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 16 ------- include/apr_hooks.h | 112 ++++++++++++++++++++++++++++++++------------ test/testhooks.c | 72 +++++++++++++++++++++++++++- 3 files changed, 154 insertions(+), 46 deletions(-) diff --git a/configure.in b/configure.in index 68c6c49e909..4a2d102f3cd 100644 --- a/configure.in +++ b/configure.in @@ -2533,22 +2533,6 @@ APU_CHECK_DBD_ODBC APU_FIND_EXPAT APU_FIND_ICONV -AC_CHECK_HEADERS( \ -sys/sdt.h -) - -AC_ARG_ENABLE(dtrace,APR_HELP_STRING(--enable-dtrace, Enable DTrace probes), -[ - enable_dtrace=$enableval -], -[ - enable_dtrace=no -]) - -if test $enable_dtrace = "yes" -a "$ac_cv_header_sys_sdt_h" = "yes"; then - APR_ADDTO(CPPFLAGS, -DAPR_DTRACE_PROVIDER) -fi - dnl Enable DSO build; must be last: APR_MODULAR_DSO diff --git a/include/apr_hooks.h b/include/apr_hooks.h index 614c2fe9a3e..7d3a4dcaf01 100644 --- a/include/apr_hooks.h +++ b/include/apr_hooks.h @@ -21,23 +21,6 @@ /* For apr_array_header_t */ #include "apr_tables.h" -#ifdef APR_DTRACE_PROVIDER -#include -#ifndef OLD_DTRACE_PROBE -#define OLD_DTRACE_PROBE(name) __dtrace_ap___##name() -#endif -#ifndef OLD_DTRACE_PROBE1 -#define OLD_DTRACE_PROBE1(name,a) __dtrace_ap___##name(a) -#endif -#ifndef OLD_DTRACE_PROBE2 -#define OLD_DTRACE_PROBE2(name,a,b) __dtrace_ap___##name(a,b) -#endif -#else -#define OLD_DTRACE_PROBE(a) -#define OLD_DTRACE_PROBE1(a,b) -#define OLD_DTRACE_PROBE2(a,b,c) -#endif - /** * @file apr_hooks.h * @brief Apache hook functions @@ -51,6 +34,74 @@ extern "C" { * @ingroup APR_Util * @{ */ + +/** + * @defgroup apr_hook_probes Hook probe capability + * APR hooks provide a trace probe capability for capturing + * the flow of control and return values with hooks. + * + * In order to use this facility, the application must define + * the symbol APR_HOOK_PROBES_ENABLED and the four APR_HOOK_PROBE_ + * macros described below before including apr_hooks.h in files + * that use the APR_IMPLEMENT_EXTERNAL_HOOK_* macros. + * + * This probe facility is not provided for APR optional hooks. + * @{ + */ + +#ifdef APR_HOOK_PROBES_ENABLED +#define APR_HOOK_INT_DCL_UD void *ud = NULL +#else +/** internal implementation detail to avoid the ud declaration when + * hook probes are not used + */ +#define APR_HOOK_INT_DCL_UD +/** + * User-defined hook probe macro that is invoked when the hook + * is run, before calling any hook functions. + * @param ud A void * user data field that should be filled in by + * this macro, and will be provided to the other hook probe macros. + * @param ns The namespace prefix of the hook functions + * @param name The name of the hook + */ +#define APR_HOOK_PROBE_ENTRY(ud,ns,name) +/** + * User-defined hook probe macro that is invoked after the hook + * has run. + * @param ud A void * user data field that was filled in by the user- + * provided APR_HOOK_PROBE_ENTRY(). + * @param ns The namespace prefix of the hook functions + * @param name The name of the hook + * @param rv The return value of the hook, or 0 if the hook is void. + */ +#define APR_HOOK_PROBE_RETURN(ud,ns,name,rv) +/** + * User-defined hook probe macro that is invoked before calling a + * hook function. + * @param ud A void * user data field that was filled in by the user- + * provided APR_HOOK_PROBE_ENTRY(). + * @param ns The namespace prefix of the hook functions + * @param name The name of the hook + * @param src The value of apr_hook_debug_current at the time the function + * was hooked (usually the source file implementing the hook function). + */ +#define APR_HOOK_PROBE_INVOKE(ud,ns,name,src) +/** + * User-defined hook probe macro that is invoked before calling a + * hook function. + * @param ud A void * user data field that was filled in by the user- + * provided APR_HOOK_PROBE_ENTRY(). + * @param ns The namespace prefix of the hook functions + * @param name The name of the hook + * @param src The value of apr_hook_debug_current at the time the function + * was hooked (usually the source file implementing the hook function). + * @param rv The return value of the hook function, or 0 if the hook is void. + */ +#define APR_HOOK_PROBE_COMPLETE(ud,ns,name,src,rv) +#endif + +/** @} */ + /** macro to return the prototype of the hook function */ #define APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name) \ link##_DECLARE(apr_array_header_t *) ns##_hook_get_##name(void) @@ -123,21 +174,22 @@ link##_DECLARE(void) ns##_run_##name args_decl \ { \ ns##_LINK_##name##_t *pHook; \ int n; \ + APR_HOOK_INT_DCL_UD; \ \ - OLD_DTRACE_PROBE(name##__entry); \ + APR_HOOK_PROBE_ENTRY(ud, ns, name); \ \ if(_hooks.link_##name) \ { \ pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \ for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ { \ - OLD_DTRACE_PROBE1(name##__dispatch__invoke, (char *)pHook[n].szName); \ + APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName); \ pHook[n].pFunc args_use; \ - OLD_DTRACE_PROBE2(name##__dispatch__complete, (char *)pHook[n].szName, 0); \ + APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, 0); \ } \ } \ \ - OLD_DTRACE_PROBE1(name##__return, 0); \ + APR_HOOK_PROBE_RETURN(ud, ns, name, 0); \ \ } @@ -166,24 +218,25 @@ link##_DECLARE(ret) ns##_run_##name args_decl \ ns##_LINK_##name##_t *pHook; \ int n; \ ret rv = ok; \ + APR_HOOK_INT_DCL_UD; \ \ - OLD_DTRACE_PROBE(name##__entry); \ + APR_HOOK_PROBE_ENTRY(ud, ns, name); \ \ if(_hooks.link_##name) \ { \ pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \ for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ { \ - OLD_DTRACE_PROBE1(name##__dispatch__invoke, (char *)pHook[n].szName); \ + APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName); \ rv=pHook[n].pFunc args_use; \ - OLD_DTRACE_PROBE2(name##__dispatch__complete, (char *)pHook[n].szName, rv); \ + APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, rv); \ if(rv != ok && rv != decline) \ break; \ rv = ok; \ } \ } \ \ - OLD_DTRACE_PROBE1(name##__return, rv); \ + APR_HOOK_PROBE_RETURN(ud, ns, name, rv); \ \ return rv; \ } @@ -210,24 +263,25 @@ link##_DECLARE(ret) ns##_run_##name args_decl \ ns##_LINK_##name##_t *pHook; \ int n; \ ret rv = decline; \ + APR_HOOK_INT_DCL_UD; \ \ - OLD_DTRACE_PROBE(name##__entry); \ + APR_HOOK_PROBE_ENTRY(ud, ns, name); \ \ if(_hooks.link_##name) \ { \ pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \ for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ { \ - OLD_DTRACE_PROBE1(name##__dispatch__invoke, (char *)pHook[n].szName); \ + APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName); \ rv=pHook[n].pFunc args_use; \ - OLD_DTRACE_PROBE2(name##__dispatch__complete, (char *)pHook[n].szName, rv); \ + APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, rv); \ \ if(rv != decline) \ break; \ } \ } \ \ - OLD_DTRACE_PROBE1(name##__return, rv); \ + APR_HOOK_PROBE_RETURN(ud, ns, name, rv); \ \ return rv; \ } diff --git a/test/testhooks.c b/test/testhooks.c index 3d02c285300..9e1ebf3e375 100644 --- a/test/testhooks.c +++ b/test/testhooks.c @@ -16,6 +16,21 @@ #include "abts.h" #include "testutil.h" + +#define APR_HOOK_PROBES_ENABLED + +#define APR_HOOK_PROBE_ENTRY(ud,ns,name) \ + ud = toy_hook_probe_entry(#name) + +#define APR_HOOK_PROBE_RETURN(ud,ns,name,rv) \ + toy_hook_probe_return(ud, #name, rv) + +#define APR_HOOK_PROBE_INVOKE(ud,ns,name,src) \ + toy_hook_probe_invoke(ud, #name, src) + +#define APR_HOOK_PROBE_COMPLETE(ud,ns,name,src,rv) \ + toy_hook_probe_complete(ud, #name, src, rv) + #include "apr_hooks.h" #define TEST_DECLARE(type) type @@ -26,9 +41,23 @@ APR_HOOK_STRUCT( APR_HOOK_LINK(toyhook) ) +static void *toy_hook_probe_entry(const char *name); +static void toy_hook_probe_return(void *ud, const char *name, int rv); +static void toy_hook_probe_invoke(void *ud, const char *name, const char *src); +static void toy_hook_probe_complete(void *ud, const char *name, + const char *src, int rv); + APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(test,TEST,int, toyhook, (char *x, apr_size_t s), (x, s), 0, -1) +typedef struct { + char *buf; + apr_size_t buf_size; +} hook_probe_data_t; + +static apr_pool_t *probe_buf_pool; +static char *probe_buf; + static void safe_concat(char *buf, apr_size_t buf_size, const char *append) { if (strlen(buf) + strlen(append) + 1 <= buf_size) { @@ -36,6 +65,40 @@ static void safe_concat(char *buf, apr_size_t buf_size, const char *append) } } +static void *toy_hook_probe_entry(const char *name) +{ + hook_probe_data_t *ud = apr_palloc(probe_buf_pool, sizeof *ud); + ud->buf_size = 18; + ud->buf = (char *)apr_palloc(probe_buf_pool, ud->buf_size); + safe_concat(ud->buf, ud->buf_size, "E"); + return (void *)ud; +} + +static void toy_hook_probe_return(void *vud, const char *name, int rv) +{ + hook_probe_data_t *ud = vud; + + safe_concat(ud->buf, ud->buf_size, "R"); + probe_buf = ud->buf; +} + +static void toy_hook_probe_invoke(void *vud, const char *name, + const char *src) +{ + hook_probe_data_t *ud = vud; + + safe_concat(ud->buf, ud->buf_size, "I"); + safe_concat(ud->buf, ud->buf_size, src); +} + +static void toy_hook_probe_complete(void *vud, const char *name, + const char *src, int rv) +{ + hook_probe_data_t *ud = vud; + + safe_concat(ud->buf, ud->buf_size, "C"); +} + static int toyhook_1(char *x, apr_size_t buf_size) { safe_concat(x, buf_size, "1"); @@ -73,18 +136,24 @@ static void test_basic_ordering(abts_case *tc, void *data) apr_hook_global_pool = p; apr_hook_deregister_all(); - apr_hook_debug_current = "foo"; + apr_hook_debug_current = "5"; test_hook_toyhook(toyhook_5, NULL, NULL, APR_HOOK_MIDDLE + 2); + apr_hook_debug_current = "1"; test_hook_toyhook(toyhook_1, NULL, NULL, APR_HOOK_MIDDLE - 2); + apr_hook_debug_current = "3"; test_hook_toyhook(toyhook_3, NULL, NULL, APR_HOOK_MIDDLE); + apr_hook_debug_current = "2"; test_hook_toyhook(toyhook_2, NULL, NULL, APR_HOOK_MIDDLE - 1); + apr_hook_debug_current = "4"; test_hook_toyhook(toyhook_4, NULL, NULL, APR_HOOK_MIDDLE + 1); apr_hook_sort_all(); + probe_buf_pool = p; test_run_toyhook(buf, sizeof buf); ABTS_STR_EQUAL(tc, "12345", buf); + ABTS_STR_EQUAL(tc, "EI1CI2CI3CI4CI5CR", probe_buf); } static void test_pred_ordering(abts_case *tc, void *data) @@ -107,6 +176,7 @@ static void test_pred_ordering(abts_case *tc, void *data) apr_hook_sort_all(); + probe_buf_pool = p; test_run_toyhook(buf, sizeof buf); /* FAILS ABTS_STR_EQUAL(tc, "1223", buf); */ From 8ca74757c5117ce4c5369718f8708a8613a7b7a1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 16 Dec 2009 23:53:16 +0000 Subject: [PATCH 6605/7878] remove apr-iconv references; it was built upon apr so cannot exist before apr git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891488 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprenv.py | 1 - build/apu-iconv.m4 | 18 +++---------- configure.in | 45 +++++++-------------------------- include/apu.h.in | 1 - include/apu.hnw | 3 +-- include/apu.hw | 3 +-- test/testxlate.c | 8 ------ xlate/xlate.c | 63 +++------------------------------------------- 8 files changed, 17 insertions(+), 125 deletions(-) diff --git a/build/aprenv.py b/build/aprenv.py index 9361aa9c255..248639fe5c4 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -681,7 +681,6 @@ def APRAutoconf(self): subst['@apu_have_openssl@'] = 0 subst['@apu_have_nss@'] = 0 - subst['@have_apr_iconv@'] = 0 subst['@have_iconv@'] = 0 # ldap stuff, remove soon. diff --git a/build/apu-iconv.m4 b/build/apu-iconv.m4 index c95e111cffe..f6eba10e7bb 100644 --- a/build/apu-iconv.m4 +++ b/build/apu-iconv.m4 @@ -34,23 +34,14 @@ dnl AC_DEFUN([APU_FIND_ICONV], [ apu_iconv_dir="unknown" -have_apr_iconv="0" want_iconv="1" AC_ARG_WITH(iconv,[ --with-iconv[=DIR] path to iconv installation], [ apu_iconv_dir="$withval" if test "$apu_iconv_dir" = "no"; then - have_apr_iconv="0" have_iconv="0" want_iconv="0" elif test "$apu_iconv_dir" != "yes"; then - if test -f "$apu_iconv_dir/include/apr-1/api_version.h"; then - have_apr_iconv="1" - have_iconv="0" - APR_ADDTO(INCLUDES,[-I$apu_iconv_dir/include/apr-1]) - APR_ADDTO(LIBS,[$apu_iconv_dir/lib/libapriconv-1.la]) - AC_MSG_RESULT(using apr-iconv) - elif test -f "$apu_iconv_dir/include/iconv.h"; then - have_apr_iconv="0" + if test -f "$apu_iconv_dir/include/iconv.h"; then have_iconv="1" APR_ADDTO(CPPFLAGS,[-I$apu_iconv_dir/include]) APR_ADDTO(LDFLAGS,[-L$apu_iconv_dir/lib]) @@ -58,7 +49,7 @@ AC_ARG_WITH(iconv,[ --with-iconv[=DIR] path to iconv installation], fi ]) -if test "$want_iconv" = "1" -a "$have_apr_iconv" != "1"; then +if test "$want_iconv" = "1"; then AC_CHECK_HEADER(iconv.h, [ APU_TRY_ICONV([ have_iconv="1" ], [ @@ -78,9 +69,7 @@ fi if test "$want_iconv" = "1" -a "$apu_iconv_dir" != "unknown"; then if test "$have_iconv" != "1"; then - if test "$have_apr_iconv" != "1"; then - AC_MSG_ERROR([iconv support requested, but not found]) - fi + AC_MSG_ERROR([iconv support requested, but not found]) fi APR_REMOVEFROM(CPPFLAGS,[-I$apu_iconv_dir/include]) APR_ADDTO(INCLUDES,[-I$apu_iconv_dir/include]) @@ -96,7 +85,6 @@ APR_FLAG_FUNCS(nl_langinfo) APR_CHECK_DEFINE(CODESET, langinfo.h, [CODESET defined in langinfo.h]) AC_SUBST(have_iconv) -AC_SUBST(have_apr_iconv) ])dnl dnl diff --git a/configure.in b/configure.in index 4a2d102f3cd..4a93c860410 100644 --- a/configure.in +++ b/configure.in @@ -27,7 +27,6 @@ sinclude(build/ltversion.m4) sinclude(build/lt~obsolete.m4) sinclude(build/apu-conf.m4) -sinclude(build/apu-iconv.m4) sinclude(build/apu-hints.m4) sinclude(build/crypto.m4) sinclude(build/dbm.m4) @@ -2483,45 +2482,15 @@ dnl ------------------------------ APR-util stuff APU_PRELOAD -dnl -dnl Find the APR-ICONV directory. -dnl -AC_ARG_WITH(apr-iconv, - [ --with-apr-iconv=DIR relative path to apr-iconv source], - [ apu_apriconv_dir="$withval" - if test "$apu_apriconv_dir" != "no"; then - if test -d "$apu_apriconv_dir"; then - APR_SUBDIR_CONFIG("$apu_apriconv_dir", - [$apache_apr_flags \ - --prefix=$prefix \ - --exec-prefix=$exec_prefix \ - --libdir=$libdir \ - --includedir=$includedir \ - --bindir=$bindir \ - --datadir=$datadir \ - --with-installbuilddir=$installbuilddir], - [--enable-layout=*|\'--enable-layout=*]) - APRUTIL_EXPORT_LIBS="$abs_srcdir/$apu_apriconv_dir/lib/libapriconv.la \ - $APRUTIL_EXPORT_LIBS" - APR_ADDTO(INCLUDES, [-I$abs_srcdir/$apu_apriconv_dir/include]) - APR_ICONV_DIR="$apu_apriconv_dir" - else - APR_ICONV_DIR="" - fi - else - APR_ICONV_DIR="" - fi - ]) -AC_SUBST(APR_ICONV_DIR) - -dnl Find LDAP library -dnl Determine what DBM backend type to use. -dnl Find Expat -dnl Find an iconv library +dnl Find crpyto libraries APU_CHECK_CRYPTO APU_CHECK_CRYPTO_OPENSSL APU_CHECK_CRYPTO_NSS + +dnl Find LDAP library APU_FIND_LDAP + +dnl Find DBM and DBD backends to use. APU_CHECK_DBM APU_CHECK_DBD APU_CHECK_DBD_MYSQL @@ -2530,7 +2499,11 @@ APU_CHECK_DBD_SQLITE2 APU_CHECK_DBD_ORACLE APU_CHECK_DBD_FREETDS APU_CHECK_DBD_ODBC + +dnl Find Expat APU_FIND_EXPAT + +dnl Find iconv implementations APU_FIND_ICONV dnl Enable DSO build; must be last: diff --git a/include/apu.h.in b/include/apu.h.in index 572f3bdd084..34a69c5f0ed 100644 --- a/include/apu.h.in +++ b/include/apu.h.in @@ -106,7 +106,6 @@ #define APU_HAVE_OPENSSL @apu_have_openssl@ #define APU_HAVE_NSS @apu_have_nss@ -#define APU_HAVE_APR_ICONV @have_apr_iconv@ #define APU_HAVE_ICONV @have_iconv@ #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) diff --git a/include/apu.hnw b/include/apu.hnw index aca6227f2e9..6106ce64f77 100644 --- a/include/apu.hnw +++ b/include/apu.hnw @@ -115,9 +115,8 @@ #define APU_HAVE_NSS 0 #endif -#define APU_HAVE_APR_ICONV 0 #define APU_HAVE_ICONV 1 -#define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) +#define APR_HAS_XLATE (APU_HAVE_ICONV) #endif /* APU_H */ #endif /* NETWARE */ diff --git a/include/apu.hw b/include/apu.hw index 591fb76aee9..ace8132d4a4 100644 --- a/include/apu.hw +++ b/include/apu.hw @@ -132,9 +132,8 @@ #define APU_HAVE_NSS 0 #endif -#define APU_HAVE_APR_ICONV 1 #define APU_HAVE_ICONV 0 -#define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) +#define APR_HAS_XLATE (APU_HAVE_ICONV) #endif /* APU_H */ /** @} */ diff --git a/test/testxlate.c b/test/testxlate.c index 6981eff6bfd..e70196df6cc 100644 --- a/test/testxlate.c +++ b/test/testxlate.c @@ -71,13 +71,6 @@ static void one_test(abts_case *tc, const char *cs1, const char *cs2, ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } -#if APU_HAVE_APR_ICONV -/* it is a bug if iconv_open() fails */ -static int is_transform_supported(abts_case *tc, const char *cs1, - const char *cs2, apr_pool_t *pool) { - return 1; -} -#else /* some iconv implementations don't support all tested transforms; * example: 8859-1 <-> 8859-2 using native Solaris iconv */ @@ -96,7 +89,6 @@ static int is_transform_supported(abts_case *tc, const char *cs1, return 1; } -#endif static void test_transformation(abts_case *tc, void *data) { diff --git a/xlate/xlate.c b/xlate/xlate.c index 30f13370a75..58875c5a3c6 100644 --- a/xlate/xlate.c +++ b/xlate/xlate.c @@ -39,11 +39,8 @@ #ifdef HAVE_ICONV_H #include #endif -#if APU_HAVE_APR_ICONV -#include -#endif -#if defined(APU_ICONV_INBUF_CONST) || APU_HAVE_APR_ICONV +#if defined(APU_ICONV_INBUF_CONST) #define ICONV_INBUF_TYPE const char ** #else #define ICONV_INBUF_TYPE char ** @@ -60,8 +57,6 @@ struct apr_xlate_t { char *sbcs_table; #if APU_HAVE_ICONV iconv_t ich; -#elif APU_HAVE_APR_ICONV - apr_iconv_t ich; #endif }; @@ -83,12 +78,7 @@ static apr_status_t apr_xlate_cleanup(void *convset) { apr_xlate_t *old = convset; -#if APU_HAVE_APR_ICONV - if (old->ich != (apr_iconv_t)-1) { - return apr_iconv_close(old->ich, old->pool); - } - -#elif APU_HAVE_ICONV +#if APU_HAVE_ICONV if (old->ich != (iconv_t)-1) { if (iconv_close(old->ich)) { int rv = errno; @@ -288,54 +278,7 @@ APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, { apr_status_t status = APR_SUCCESS; -#if APU_HAVE_APR_ICONV - if (convset->ich != (apr_iconv_t)-1) { - const char *inbufptr = inbuf; - apr_size_t translated; - char *outbufptr = outbuf; - status = apr_iconv(convset->ich, &inbufptr, inbytes_left, - &outbufptr, outbytes_left, &translated); - - /* If everything went fine but we ran out of buffer, don't - * report it as an error. Caller needs to look at the two - * bytes-left values anyway. - * - * There are three expected cases where rc is -1. In each of - * these cases, *inbytes_left != 0. - * a) the non-error condition where we ran out of output - * buffer - * b) the non-error condition where we ran out of input (i.e., - * the last input character is incomplete) - * c) the error condition where the input is invalid - */ - switch (status) { - - case APR_BADARG: /* out of space on output */ - status = 0; /* change table lookup code below if you - make this an error */ - break; - - case APR_EINVAL: /* input character not complete (yet) */ - status = APR_INCOMPLETE; - break; - - case APR_BADCH: /* bad input byte */ - status = APR_EINVAL; - break; - - /* Sometimes, iconv is not good about setting errno. */ - case 0: - if (inbytes_left && *inbytes_left) - status = APR_INCOMPLETE; - break; - - default: - break; - } - } - else - -#elif APU_HAVE_ICONV +#if APU_HAVE_ICONV if (convset->ich != (iconv_t)-1) { const char *inbufptr = inbuf; char *outbufptr = outbuf; From 454be7201aadea7c1768aac0af4cb7570061600f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Dec 2009 00:47:42 +0000 Subject: [PATCH 6606/7878] The resource stub name changes for the libapr migration git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891495 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_freetds.dsp | 2 +- dbd/apr_dbd_mysql.dsp | 2 +- dbd/apr_dbd_oracle.dsp | 2 +- dbd/apr_dbd_pgsql.dsp | 2 +- dbd/apr_dbd_sqlite2.dsp | 2 +- dbd/apr_dbd_sqlite3.dsp | 2 +- dbm/apr_dbm_db.dsp | 2 +- dbm/apr_dbm_gdbm.dsp | 2 +- ldap/apr_ldap.dsp | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dbd/apr_dbd_freetds.dsp b/dbd/apr_dbd_freetds.dsp index 90bf7e58c5f..84535ecf109 100644 --- a/dbd/apr_dbd_freetds.dsp +++ b/dbd/apr_dbd_freetds.dsp @@ -201,7 +201,7 @@ SOURCE=..\include\private\apu_internal.h # End Group # Begin Source File -SOURCE=..\libaprutil.rc +SOURCE=..\libapr.rc # End Source File # End Target # End Project diff --git a/dbd/apr_dbd_mysql.dsp b/dbd/apr_dbd_mysql.dsp index 6b88d77453b..40c955355fb 100644 --- a/dbd/apr_dbd_mysql.dsp +++ b/dbd/apr_dbd_mysql.dsp @@ -201,7 +201,7 @@ SOURCE=..\include\private\apu_internal.h # End Group # Begin Source File -SOURCE=..\libaprutil.rc +SOURCE=..\libapr.rc # End Source File # End Target # End Project diff --git a/dbd/apr_dbd_oracle.dsp b/dbd/apr_dbd_oracle.dsp index e5b97d9feda..bdaa4a2285d 100644 --- a/dbd/apr_dbd_oracle.dsp +++ b/dbd/apr_dbd_oracle.dsp @@ -201,7 +201,7 @@ SOURCE=..\include\private\apu_internal.h # End Group # Begin Source File -SOURCE=..\libaprutil.rc +SOURCE=..\libapr.rc # End Source File # End Target # End Project diff --git a/dbd/apr_dbd_pgsql.dsp b/dbd/apr_dbd_pgsql.dsp index e7f146648d1..da6d29d57ad 100644 --- a/dbd/apr_dbd_pgsql.dsp +++ b/dbd/apr_dbd_pgsql.dsp @@ -201,7 +201,7 @@ SOURCE=..\include\private\apu_internal.h # End Group # Begin Source File -SOURCE=..\libaprutil.rc +SOURCE=..\libapr.rc # End Source File # End Target # End Project diff --git a/dbd/apr_dbd_sqlite2.dsp b/dbd/apr_dbd_sqlite2.dsp index 29776067045..67478a760ae 100644 --- a/dbd/apr_dbd_sqlite2.dsp +++ b/dbd/apr_dbd_sqlite2.dsp @@ -201,7 +201,7 @@ SOURCE=..\include\private\apu_internal.h # End Group # Begin Source File -SOURCE=..\libaprutil.rc +SOURCE=..\libapr.rc # End Source File # End Target # End Project diff --git a/dbd/apr_dbd_sqlite3.dsp b/dbd/apr_dbd_sqlite3.dsp index 8b332223ade..199622ac72b 100644 --- a/dbd/apr_dbd_sqlite3.dsp +++ b/dbd/apr_dbd_sqlite3.dsp @@ -201,7 +201,7 @@ SOURCE=..\include\private\apu_internal.h # End Group # Begin Source File -SOURCE=..\libaprutil.rc +SOURCE=..\libapr.rc # End Source File # End Target # End Project diff --git a/dbm/apr_dbm_db.dsp b/dbm/apr_dbm_db.dsp index 6b7e838abb2..f66aa4ab20b 100644 --- a/dbm/apr_dbm_db.dsp +++ b/dbm/apr_dbm_db.dsp @@ -209,7 +209,7 @@ SOURCE=..\include\private\apu_select_dbm.h # End Group # Begin Source File -SOURCE=..\libaprutil.rc +SOURCE=..\libapr.rc # End Source File # End Target # End Project diff --git a/dbm/apr_dbm_gdbm.dsp b/dbm/apr_dbm_gdbm.dsp index 061cedf552b..a19e9e1c2cb 100644 --- a/dbm/apr_dbm_gdbm.dsp +++ b/dbm/apr_dbm_gdbm.dsp @@ -209,7 +209,7 @@ SOURCE=..\include\private\apu_select_dbm.h # End Group # Begin Source File -SOURCE=..\libaprutil.rc +SOURCE=..\libapr.rc # End Source File # End Target # End Project diff --git a/ldap/apr_ldap.dsp b/ldap/apr_ldap.dsp index 095e3af5aaf..1ec49f2b3c6 100644 --- a/ldap/apr_ldap.dsp +++ b/ldap/apr_ldap.dsp @@ -221,7 +221,7 @@ SOURCE=..\include\private\apu_internal.h # End Group # Begin Source File -SOURCE=..\libaprutil.rc +SOURCE=..\libapr.rc # End Source File # End Target # End Project From 557b4597ac20c222d9deb2a41b57edf9f22e33a3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Dec 2009 01:08:57 +0000 Subject: [PATCH 6607/7878] Remove Win-9x, deprecated, and add apr-util oriented header generation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891502 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 336 +++++++++++++++++++++++++++++++++++++++----------- libapr.dsp | 355 ++++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 534 insertions(+), 157 deletions(-) diff --git a/apr.dsp b/apr.dsp index 191c0c81e3a..e1289275511 100644 --- a/apr.dsp +++ b/apr.dsp @@ -19,8 +19,6 @@ CFG=apr - Win32 Release !MESSAGE !MESSAGE "apr - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "apr - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "apr - Win32 Release9x" (based on "Win32 (x86) Static Library") -!MESSAGE "apr - Win32 Debug9x" (based on "Win32 (x86) Static Library") !MESSAGE "apr - x64 Release" (based on "Win32 (x86) Static Library") !MESSAGE "apr - x64 Debug" (based on "Win32 (x86) Static Library") !MESSAGE @@ -79,53 +77,6 @@ LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"LibD\apr-1.lib" -!ELSEIF "$(CFG)" == "apr - Win32 Release9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "9x\LibR" -# PROP BASE Intermediate_Dir "9x\LibR" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "9x\LibR" -# PROP Intermediate_Dir "9x\LibR" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"9x\LibR\apr-1.lib" - -!ELSEIF "$(CFG)" == "apr - Win32 Debug9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "9x\LibD" -# PROP BASE Intermediate_Dir "9x\LibD" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "9x\LibD" -# PROP Intermediate_Dir "9x\LibD" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /EHsc /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"9x\LibD\apr-1.lib" - !ELSEIF "$(CFG)" == "apr - x64 Release" # PROP BASE Use_MFC 0 @@ -179,8 +130,6 @@ LIB32=link.exe -lib # Name "apr - Win32 Release" # Name "apr - Win32 Debug" -# Name "apr - Win32 Release9x" -# Name "apr - Win32 Debug9x" # Name "apr - x64 Release" # Name "apr - x64 Debug" # Begin Group "Source Files" @@ -629,24 +578,6 @@ InputPath=.\include\apr.hw # End Custom Build -!ELSEIF "$(CFG)" == "apr - Win32 Release9x" - -# Begin Custom Build - Creating apr.h from apr.hw -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr.hw > .\include\apr.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - Win32 Debug9x" - -# Begin Custom Build - Creating apr.h from apr.hw -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr.hw > .\include\apr.h - # End Custom Build !ELSEIF "$(CFG)" == "apr - x64 Release" @@ -811,6 +742,273 @@ SOURCE=.\include\apr_version.h # Begin Source File SOURCE=.\include\apr_want.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_ldap.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\apr_ldap.hnw +# End Source File +# Begin Source File + +SOURCE=.\include\apr_ldap.hw + +!IF "$(CFG)" == "apr - Win32 Release" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - Win32 Debug" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - x64 Release" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - x64 Debug" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\include\apu.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\apu.hnw +# End Source File +# Begin Source File + +SOURCE=.\include\apu.hw + +!IF "$(CFG)" == "apr - Win32 Release" + +# Begin Custom Build - Creating apu.h from apu.hw +InputPath=.\include\apu.hw + +".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu.hw > .\include\apu.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - Win32 Debug" + +# Begin Custom Build - Creating apu.h from apu.hw +InputPath=.\include\apu.hw + +".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu.hw > .\include\apu.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - x64 Release" + +# Begin Custom Build - Creating apu.h from apu.hw +InputPath=.\include\apu.hw + +".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu.hw > .\include\apu.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - x64 Debug" + +# Begin Custom Build - Creating apu.h from apu.hw +InputPath=.\include\apu.hw + +".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu.hw > .\include\apu.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\include\private\apu_config.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\private\apu_config.hw + +!IF "$(CFG)" == "apr - Win32 Release" + +# Begin Custom Build - Creating apu_config.h from apu_config.hw +InputPath=.\include\private\apu_config.hw + +".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_config.hw > .\include\private\apu_config.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - Win32 Debug" + +# Begin Custom Build - Creating apu_config.h from apu_config.hw +InputPath=.\include\private\apu_config.hw + +".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_config.hw > .\include\private\apu_config.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - x64 Release" + +# Begin Custom Build - Creating apu_config.h from apu_config.hw +InputPath=.\include\private\apu_config.hw + +".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_config.hw > .\include\private\apu_config.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - x64 Debug" + +# Begin Custom Build - Creating apu_config.h from apu_config.hw +InputPath=.\include\private\apu_config.hw + +".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_config.hw > .\include\private\apu_config.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\include\private\apu_select_dbm.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\private\apu_select_dbm.hw + +!IF "$(CFG)" == "apr - Win32 Release" + +# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw +InputPath=.\include\private\apu_select_dbm.hw + +".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - Win32 Debug" + +# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw +InputPath=.\include\private\apu_select_dbm.hw + +".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - x64 Release" + +# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw +InputPath=.\include\private\apu_select_dbm.hw + +".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - x64 Debug" + +# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw +InputPath=.\include\private\apu_select_dbm.hw + +".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\include\apu_want.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\apu_want.hnw +# End Source File +# Begin Source File + +SOURCE=.\include\apu_want.hw + +!IF "$(CFG)" == "apr - Win32 Release" + +# Begin Custom Build - Creating apu_want.h from apu_want.hw +InputPath=.\include\apu_want.hw + +".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu_want.hw > .\include\apu_want.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - Win32 Debug" + +# Begin Custom Build - Creating apu_want.h from apu_want.hw +InputPath=.\include\apu_want.hw + +".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu_want.hw > .\include\apu_want.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - x64 Release" + +# Begin Custom Build - Creating apu_want.h from apu_want.hw +InputPath=.\include\apu_want.hw + +".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu_want.hw > .\include\apu_want.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - x64 Debug" + +# Begin Custom Build - Creating apu_want.h from apu_want.hw +InputPath=.\include\apu_want.hw + +".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu_want.hw > .\include\apu_want.h + +# End Custom Build + +!ENDIF + # End Source File # End Group # End Target diff --git a/libapr.dsp b/libapr.dsp index 4163aa9d756..fa8b2131b32 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -19,8 +19,6 @@ CFG=libapr - Win32 Release !MESSAGE !MESSAGE "libapr - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libapr - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libapr - Win32 Release9x" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libapr - Win32 Debug9x" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libapr - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libapr - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE @@ -97,70 +95,6 @@ PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 # End Special Build Tool -!ELSEIF "$(CFG)" == "libapr - Win32 Release9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "9x\Release" -# PROP BASE Intermediate_Dir "9x\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "9x\Release" -# PROP Intermediate_Dir "9x\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /i "./include" /d "NDEBUG" /d "APR_VERSION_ONLY" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"9x\Release\libapr-1.dll" /pdb:"9x\Release\libapr-1.pdb" /implib:"9x\Release\libapr-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=9x\Release\libapr.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "libapr - Win32 Debug9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "9x\Debug" -# PROP BASE Intermediate_Dir "9x\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "9x\Debug" -# PROP Intermediate_Dir "9x\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /i "./include" /d "_DEBUG" /d "APR_VERSION_ONLY" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"9x\Debug\libapr-1.dll" /pdb:"9x\Debug\libapr-1.pdb" /implib:"9x\Debug\libapr-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=9x\Debug\libapr-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - !ELSEIF "$(CFG)" == "libapr - x64 Release" # PROP BASE Use_MFC 0 @@ -231,8 +165,6 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # Name "libapr - Win32 Release" # Name "libapr - Win32 Debug" -# Name "libapr - Win32 Release9x" -# Name "libapr - Win32 Debug9x" # Name "libapr - x64 Release" # Name "libapr - x64 Debug" # Begin Group "Source Files" @@ -685,26 +617,6 @@ InputPath=.\include\apr.hw # End Custom Build -!ELSEIF "$(CFG)" == "libapr - Win32 Release9x" - -# Begin Custom Build - Creating apr.h from apr.hw -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr.hw > .\include\apr.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - Win32 Debug9x" - -# Begin Custom Build - Creating apr.h from apr.hw -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr.hw > .\include\apr.h - -# End Custom Build - !ELSEIF "$(CFG)" == "libapr - x64 Release" # Begin Custom Build - Creating apr.h from apr.hw @@ -867,6 +779,273 @@ SOURCE=.\include\apr_version.h # Begin Source File SOURCE=.\include\apr_want.h +# End Source File +# Begin Source File + +SOURCE=.\include\apr_ldap.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\apr_ldap.hnw +# End Source File +# Begin Source File + +SOURCE=.\include\apr_ldap.hw + +!IF "$(CFG)" == "libapr - Win32 Release" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Release" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Debug" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\include\apu.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\apu.hnw +# End Source File +# Begin Source File + +SOURCE=.\include\apu.hw + +!IF "$(CFG)" == "libapr - Win32 Release" + +# Begin Custom Build - Creating apu.h from apu.hw +InputPath=.\include\apu.hw + +".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu.hw > .\include\apu.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +# Begin Custom Build - Creating apu.h from apu.hw +InputPath=.\include\apu.hw + +".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu.hw > .\include\apu.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Release" + +# Begin Custom Build - Creating apu.h from apu.hw +InputPath=.\include\apu.hw + +".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu.hw > .\include\apu.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Debug" + +# Begin Custom Build - Creating apu.h from apu.hw +InputPath=.\include\apu.hw + +".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu.hw > .\include\apu.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\include\private\apu_config.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\private\apu_config.hw + +!IF "$(CFG)" == "libapr - Win32 Release" + +# Begin Custom Build - Creating apu_config.h from apu_config.hw +InputPath=.\include\private\apu_config.hw + +".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_config.hw > .\include\private\apu_config.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +# Begin Custom Build - Creating apu_config.h from apu_config.hw +InputPath=.\include\private\apu_config.hw + +".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_config.hw > .\include\private\apu_config.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Release" + +# Begin Custom Build - Creating apu_config.h from apu_config.hw +InputPath=.\include\private\apu_config.hw + +".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_config.hw > .\include\private\apu_config.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Debug" + +# Begin Custom Build - Creating apu_config.h from apu_config.hw +InputPath=.\include\private\apu_config.hw + +".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_config.hw > .\include\private\apu_config.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\include\private\apu_select_dbm.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\private\apu_select_dbm.hw + +!IF "$(CFG)" == "libapr - Win32 Release" + +# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw +InputPath=.\include\private\apu_select_dbm.hw + +".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw +InputPath=.\include\private\apu_select_dbm.hw + +".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Release" + +# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw +InputPath=.\include\private\apu_select_dbm.hw + +".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Debug" + +# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw +InputPath=.\include\private\apu_select_dbm.hw + +".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\include\apu_want.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\apu_want.hnw +# End Source File +# Begin Source File + +SOURCE=.\include\apu_want.hw + +!IF "$(CFG)" == "libapr - Win32 Release" + +# Begin Custom Build - Creating apu_want.h from apu_want.hw +InputPath=.\include\apu_want.hw + +".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu_want.hw > .\include\apu_want.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +# Begin Custom Build - Creating apu_want.h from apu_want.hw +InputPath=.\include\apu_want.hw + +".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu_want.hw > .\include\apu_want.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Release" + +# Begin Custom Build - Creating apu_want.h from apu_want.hw +InputPath=.\include\apu_want.hw + +".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu_want.hw > .\include\apu_want.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Debug" + +# Begin Custom Build - Creating apu_want.h from apu_want.hw +InputPath=.\include\apu_want.hw + +".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apu_want.hw > .\include\apu_want.h + +# End Custom Build + +!ENDIF + # End Source File # End Group # Begin Source File From 80e97f7c707ec81694afa9b77f6c48f7406bfff8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Dec 2009 01:15:07 +0000 Subject: [PATCH 6608/7878] Reorder, and clean up some leftover cruft in apr.dsp git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891503 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 112 ++++++++++++++++++++++++++--------------------------- libapr.dsp | 110 ++++++++++++++++++++++++++-------------------------- 2 files changed, 110 insertions(+), 112 deletions(-) diff --git a/apr.dsp b/apr.dsp index e1289275511..3d4dd3c8b44 100644 --- a/apr.dsp +++ b/apr.dsp @@ -578,8 +578,6 @@ InputPath=.\include\apr.hw # End Custom Build -# End Custom Build - !ELSEIF "$(CFG)" == "apr - x64 Release" # Begin Custom Build - Creating apr.h from apr.hw @@ -657,6 +655,61 @@ SOURCE=.\include\apr_inherit.h # End Source File # Begin Source File +SOURCE=.\include\apr_ldap.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\apr_ldap.hnw +# End Source File +# Begin Source File + +SOURCE=.\include\apr_ldap.hw + +!IF "$(CFG)" == "apr - Win32 Release" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - Win32 Debug" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - x64 Release" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "apr - x64 Debug" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=.\include\apr_lib.h # End Source File # Begin Source File @@ -745,61 +798,6 @@ SOURCE=.\include\apr_want.h # End Source File # Begin Source File -SOURCE=.\include\apr_ldap.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apr_ldap.hnw -# End Source File -# Begin Source File - -SOURCE=.\include\apr_ldap.hw - -!IF "$(CFG)" == "apr - Win32 Release" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - Win32 Debug" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - x64 Release" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - x64 Debug" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - SOURCE=.\include\apu.h.in # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index fa8b2131b32..5621803fc99 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -694,6 +694,61 @@ SOURCE=.\include\apr_inherit.h # End Source File # Begin Source File +SOURCE=.\include\apr_ldap.h.in +# End Source File +# Begin Source File + +SOURCE=.\include\apr_ldap.hnw +# End Source File +# Begin Source File + +SOURCE=.\include\apr_ldap.hw + +!IF "$(CFG)" == "libapr - Win32 Release" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Release" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Debug" + +# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw +InputPath=.\include\apr_ldap.hw + +".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\apr_ldap.hw > .\include\apr_ldap.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=.\include\apr_lib.h # End Source File # Begin Source File @@ -782,61 +837,6 @@ SOURCE=.\include\apr_want.h # End Source File # Begin Source File -SOURCE=.\include\apr_ldap.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apr_ldap.hnw -# End Source File -# Begin Source File - -SOURCE=.\include\apr_ldap.hw - -!IF "$(CFG)" == "libapr - Win32 Release" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - Win32 Debug" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - x64 Release" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - x64 Debug" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - SOURCE=.\include\apu.h.in # End Source File # Begin Source File From d606776396a269712bcb6bc17818c79cae545090 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Dec 2009 01:17:51 +0000 Subject: [PATCH 6609/7878] Fix 1.4.x breakage on win32, add socket_util to both static and dll builds git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891506 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++++ libapr.dsp | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apr.dsp b/apr.dsp index 3d4dd3c8b44..9d0c4a5cf02 100644 --- a/apr.dsp +++ b/apr.dsp @@ -345,6 +345,10 @@ SOURCE=.\network_io\win32\sockets.c # End Source File # Begin Source File +SOURCE=.\network_io\unix\socket_util.c +# End Source File +# Begin Source File + SOURCE=.\network_io\win32\sockopt.c # End Source File # End Group diff --git a/libapr.dsp b/libapr.dsp index 5621803fc99..9951f43dac1 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -368,10 +368,6 @@ SOURCE=.\network_io\unix\multicast.c # End Source File # Begin Source File -SOURCE=.\network_io\unix\socket_util.c -# End Source File -# Begin Source File - SOURCE=.\network_io\win32\sendrecv.c # End Source File # Begin Source File @@ -384,6 +380,10 @@ SOURCE=.\network_io\win32\sockets.c # End Source File # Begin Source File +SOURCE=.\network_io\unix\socket_util.c +# End Source File +# Begin Source File + SOURCE=.\network_io\win32\sockopt.c # End Source File # End Group From dae749be50b8272ed90a0de96a6675c133587a66 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Dec 2009 01:20:30 +0000 Subject: [PATCH 6610/7878] This is a generated artifact, not to be checked in! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891507 13f79535-47bb-0310-9956-ffa450edef68 --- include/private/apu_config.h | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 include/private/apu_config.h diff --git a/include/private/apu_config.h b/include/private/apu_config.h deleted file mode 100644 index 65a809ca823..00000000000 --- a/include/private/apu_config.h +++ /dev/null @@ -1,2 +0,0 @@ -#include "apr.h" -#include "apr_private.h" From 73535554a9c88ffa2f8a2d3d9c86dc8301054683 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Dec 2009 17:12:27 +0000 Subject: [PATCH 6611/7878] merge util sources, rev to -2 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891803 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 295 +++++++++++++++++++++++++++++++++++++++++++++++++-- libapr.dsp | 303 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 578 insertions(+), 20 deletions(-) diff --git a/apr.dsp b/apr.dsp index 9d0c4a5cf02..ed161fc2b7f 100644 --- a/apr.dsp +++ b/apr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"LibR\apr-1.lib" +# ADD LIB32 /nologo /out:"LibR\apr-2.lib" !ELSEIF "$(CFG)" == "apr - Win32 Debug" @@ -67,7 +67,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /EHsc /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -75,7 +75,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"LibD\apr-1.lib" +# ADD LIB32 /nologo /out:"LibD\apr-2.lib" !ELSEIF "$(CFG)" == "apr - x64 Release" @@ -90,7 +90,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "x64\LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -98,7 +98,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"x64\LibR\apr-1.lib" +# ADD LIB32 /nologo /out:"x64\LibR\apr-2.lib" !ELSEIF "$(CFG)" == "apr - x64 Debug" @@ -114,7 +114,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /EHsc /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -122,7 +122,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"x64\LibD\apr-1.lib" +# ADD LIB32 /nologo /out:"x64\LibD\apr-2.lib" !ENDIF @@ -143,6 +143,141 @@ LIB32=link.exe -lib SOURCE=.\atomic\win32\apr_atomic.c # End Source File # End Group +# Begin Group "buckets" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\buckets\apr_brigade.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_alloc.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_eos.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_file.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_flush.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_heap.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_mmap.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_pipe.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_pool.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_refcount.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_simple.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_socket.c +# End Source File +# End Group +# Begin Group "crypto" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\crypto\apr_md4.c +# End Source File +# Begin Source File + +SOURCE=.\crypto\apr_md5.c +# End Source File +# Begin Source File + +SOURCE=.\crypto\apr_sha1.c +# End Source File +# Begin Source File + +SOURCE=.\crypto\getuuid.c +# End Source File +# Begin Source File + +SOURCE=.\crypto\uuid.c +# End Source File +# End Group +# Begin Group "dbd" +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\dbd\apr_dbd.c +# End Source File +# Begin Source File + +SOURCE=.\dbd\apr_dbd_freetds.c +# End Source File +# Begin Source File + +SOURCE=.\dbd\apr_dbd_mysql.c +# End Source File +# Begin Source File + +SOURCE=.\dbd\apr_dbd_odbc.c +# End Source File +# Begin Source File + +SOURCE=.\dbd\apr_dbd_oracle.c +# End Source File +# Begin Source File + +SOURCE=.\dbd\apr_dbd_pgsql.c +# End Source File +# Begin Source File + +SOURCE=.\dbd\apr_dbd_sqlite2.c +# End Source File +# Begin Source File + +SOURCE=.\dbd\apr_dbd_sqlite3.c +# End Source File +# End Group +# Begin Group "dbm" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\dbm\apr_dbm.c +# End Source File +# Begin Source File + +SOURCE=.\dbm\apr_dbm_berkeleydb.c +# End Source File +# Begin Source File + +SOURCE=.\dbm\apr_dbm_gdbm.c +# End Source File +# Begin Source File + +SOURCE=.\dbm\apr_dbm_sdbm.c +# End Source File +# End Group # Begin Group "dso" # PROP Default_Filter "" @@ -151,6 +286,14 @@ SOURCE=.\atomic\win32\apr_atomic.c SOURCE=.\dso\win32\dso.c # End Source File # End Group +# Begin Group "encoding" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\encoding\apr_base64.c +# End Source File +# End Group # Begin Group "file_io" # PROP Default_Filter "" @@ -223,6 +366,38 @@ SOURCE=.\file_io\win32\seek.c SOURCE=.\file_io\unix\tempdir.c # End Source File # End Group +# Begin Group "hooks" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\hooks\apr_hooks.c +# End Source File +# End Group +# Begin Group "ldap" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\ldap\apr_ldap_init.c +# End Source File +# Begin Source File + +SOURCE=.\ldap\apr_ldap_option.c +# End Source File +# Begin Source File + +SOURCE=.\ldap\apr_ldap_rebind.c +# End Source File +# Begin Source File + +SOURCE=.\ldap\apr_ldap_stub.c +# End Source File +# Begin Source File + +SOURCE=.\ldap\apr_ldap_url.c +# End Source File +# End Group # Begin Group "locks" # PROP Default_Filter "" @@ -243,6 +418,14 @@ SOURCE=.\locks\win32\thread_mutex.c SOURCE=.\locks\win32\thread_rwlock.c # End Source File # End Group +# Begin Group "memcache" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\memcache\apr_memcache.c +# End Source File +# End Group # Begin Group "memory" # PROP Default_Filter "" @@ -396,6 +579,38 @@ SOURCE=.\random\unix\sha2.c SOURCE=.\random\unix\sha2_glue.c # End Source File # End Group +# Begin Group "sdbm" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\dbm\sdbm\sdbm.c +# End Source File +# Begin Source File + +SOURCE=.\dbm\sdbm\sdbm_hash.c +# End Source File +# Begin Source File + +SOURCE=.\dbm\sdbm\sdbm_lock.c +# End Source File +# Begin Source File + +SOURCE=.\dbm\sdbm\sdbm_pair.c +# End Source File +# Begin Source File + +SOURCE=.\dbm\sdbm\sdbm_pair.h +# End Source File +# Begin Source File + +SOURCE=.\dbm\sdbm\sdbm_private.h +# End Source File +# Begin Source File + +SOURCE=.\dbm\sdbm\sdbm_tune.h +# End Source File +# End Group # Begin Group "shmem" # PROP Default_Filter "" @@ -432,6 +647,14 @@ SOURCE=.\strings\apr_strnatcmp.c SOURCE=.\strings\apr_strtok.c # End Source File # End Group +# Begin Group "strmatch" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\strmatch\apr_strmatch.c +# End Source File +# End Group # Begin Group "tables" # PROP Default_Filter "" @@ -480,6 +703,14 @@ SOURCE=.\time\win32\time.c SOURCE=.\time\win32\timestr.c # End Source File # End Group +# Begin Group "uri" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\uri\apr_uri.c +# End Source File +# End Group # Begin Group "user" # PROP Default_Filter "" @@ -492,6 +723,54 @@ SOURCE=.\user\win32\groupinfo.c SOURCE=.\user\win32\userinfo.c # End Source File # End Group +# Begin Group "util-misc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\util-misc\apr_date.c +# End Source File +# Begin Source File + +SOURCE=.\util-misc\apu_dso.c +# End Source File +# Begin Source File + +SOURCE=.\util-misc\apr_queue.c +# End Source File +# Begin Source File + +SOURCE=.\util-misc\apr_reslist.c +# End Source File +# Begin Source File + +SOURCE=.\util-misc\apr_rmm.c +# End Source File +# Begin Source File + +SOURCE=.\util-misc\apr_thread_pool.c +# End Source File +# Begin Source File + +SOURCE=.\util-misc\apu_version.c +# End Source File +# End Group +# Begin Group "xlate" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\xlate\xlate.c +# End Source File +# End Group +# Begin Group "xml" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\xml\apr_xml.c +# End Source File +# End Group # End Group # Begin Group "Private Header Files" diff --git a/libapr.dsp b/libapr.dsp index 9951f43dac1..93820f3f46d 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -55,9 +55,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"Release\libapr-1.dll" /pdb:"Release\libapr-1.pdb" /implib:"Release\libapr-1.lib" /MACHINE:X86 /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib expat.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /libpath:"./srclib/expat/bin/Release" /out:"Release\libapr-2.dll" /pdb:"Release\libapr-2.pdb" /implib:"Release\libapr-2.lib" /MACHINE:X86 /opt:ref # Begin Special Build Tool -TargetPath=Release\libapr-1.dll +TargetPath=Release\libapr-2.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -77,7 +77,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -87,9 +87,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\libapr-1.dll" /pdb:"Debug\libapr-1.pdb" /implib:"Debug\libapr-1.lib" /MACHINE:X86 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /libpath:"./srclib/expat/bin/Debug" /out:"Debug\libapr-2.dll" /pdb:"Debug\libapr-2.pdb" /implib:"Debug\libapr-2.lib" /MACHINE:X86 # Begin Special Build Tool -TargetPath=Debug\libapr-1.dll +TargetPath=Debug\libapr-2.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -109,7 +109,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -119,9 +119,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\libapr-1.dll" /pdb:"x64\Release\libapr-1.pdb" /implib:"x64\Release\libapr-1.lib" /MACHINE:X64 /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /libpath:"./srclib/expat/bin/x64/Release" /out:"x64\Release\libapr-2.dll" /pdb:"x64\Release\libapr-2.pdb" /implib:"x64\Release\libapr-2.lib" /MACHINE:X64 /opt:ref # Begin Special Build Tool -TargetPath=x64\Release\libapr-1.dll +TargetPath=x64\Release\libapr-2.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -141,7 +141,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -151,9 +151,9 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\libapr-1.dll" /pdb:"x64\Debug\libapr-1.pdb" /implib:"x64\Debug\libapr-1.lib" /MACHINE:X64 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /libpath:"./srclib/expat/bin/x64/Debug" /out:"x64\Debug\libapr-2.dll" /pdb:"x64\Debug\libapr-2.pdb" /implib:"x64\Debug\libapr-2.lib" /MACHINE:X64 # Begin Special Build Tool -TargetPath=x64\Debug\libapr-1.dll +TargetPath=x64\Debug\libapr-2.dll SOURCE="$(InputPath)" PostBuild_Desc=Embed .manifest PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 @@ -178,6 +178,141 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma SOURCE=.\atomic\win32\apr_atomic.c # End Source File # End Group +# Begin Group "buckets" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\buckets\apr_brigade.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_alloc.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_eos.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_file.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_flush.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_heap.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_mmap.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_pipe.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_pool.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_refcount.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_simple.c +# End Source File +# Begin Source File + +SOURCE=.\buckets\apr_buckets_socket.c +# End Source File +# End Group +# Begin Group "crypto" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\crypto\apr_md4.c +# End Source File +# Begin Source File + +SOURCE=.\crypto\apr_md5.c +# End Source File +# Begin Source File + +SOURCE=.\crypto\apr_sha1.c +# End Source File +# Begin Source File + +SOURCE=.\crypto\getuuid.c +# End Source File +# Begin Source File + +SOURCE=.\crypto\uuid.c +# End Source File +# End Group +# Begin Group "dbd" +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\dbd\apr_dbd.c +# End Source File +# Begin Source File + +SOURCE=.\dbd\apr_dbd_freetds.c +# End Source File +# Begin Source File + +SOURCE=.\dbd\apr_dbd_mysql.c +# End Source File +# Begin Source File + +SOURCE=.\dbd\apr_dbd_odbc.c +# End Source File +# Begin Source File + +SOURCE=.\dbd\apr_dbd_oracle.c +# End Source File +# Begin Source File + +SOURCE=.\dbd\apr_dbd_pgsql.c +# End Source File +# Begin Source File + +SOURCE=.\dbd\apr_dbd_sqlite2.c +# End Source File +# Begin Source File + +SOURCE=.\dbd\apr_dbd_sqlite3.c +# End Source File +# End Group +# Begin Group "dbm" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\dbm\apr_dbm.c +# End Source File +# Begin Source File + +SOURCE=.\dbm\apr_dbm_berkeleydb.c +# End Source File +# Begin Source File + +SOURCE=.\dbm\apr_dbm_gdbm.c +# End Source File +# Begin Source File + +SOURCE=.\dbm\apr_dbm_sdbm.c +# End Source File +# End Group # Begin Group "dso" # PROP Default_Filter "" @@ -186,6 +321,14 @@ SOURCE=.\atomic\win32\apr_atomic.c SOURCE=.\dso\win32\dso.c # End Source File # End Group +# Begin Group "encoding" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\encoding\apr_base64.c +# End Source File +# End Group # Begin Group "file_io" # PROP Default_Filter "" @@ -258,6 +401,38 @@ SOURCE=.\file_io\win32\seek.c SOURCE=.\file_io\unix\tempdir.c # End Source File # End Group +# Begin Group "hooks" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\hooks\apr_hooks.c +# End Source File +# End Group +# Begin Group "ldap" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\ldap\apr_ldap_init.c +# End Source File +# Begin Source File + +SOURCE=.\ldap\apr_ldap_option.c +# End Source File +# Begin Source File + +SOURCE=.\ldap\apr_ldap_rebind.c +# End Source File +# Begin Source File + +SOURCE=.\ldap\apr_ldap_stub.c +# End Source File +# Begin Source File + +SOURCE=.\ldap\apr_ldap_url.c +# End Source File +# End Group # Begin Group "locks" # PROP Default_Filter "" @@ -278,6 +453,14 @@ SOURCE=.\locks\win32\thread_mutex.c SOURCE=.\locks\win32\thread_rwlock.c # End Source File # End Group +# Begin Group "memcache" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\memcache\apr_memcache.c +# End Source File +# End Group # Begin Group "memory" # PROP Default_Filter "" @@ -431,6 +614,38 @@ SOURCE=.\random\unix\sha2.c SOURCE=.\random\unix\sha2_glue.c # End Source File # End Group +# Begin Group "sdbm" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\dbm\sdbm\sdbm.c +# End Source File +# Begin Source File + +SOURCE=.\dbm\sdbm\sdbm_hash.c +# End Source File +# Begin Source File + +SOURCE=.\dbm\sdbm\sdbm_lock.c +# End Source File +# Begin Source File + +SOURCE=.\dbm\sdbm\sdbm_pair.c +# End Source File +# Begin Source File + +SOURCE=.\dbm\sdbm\sdbm_pair.h +# End Source File +# Begin Source File + +SOURCE=.\dbm\sdbm\sdbm_private.h +# End Source File +# Begin Source File + +SOURCE=.\dbm\sdbm\sdbm_tune.h +# End Source File +# End Group # Begin Group "shmem" # PROP Default_Filter "" @@ -467,6 +682,14 @@ SOURCE=.\strings\apr_strnatcmp.c SOURCE=.\strings\apr_strtok.c # End Source File # End Group +# Begin Group "strmatch" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\strmatch\apr_strmatch.c +# End Source File +# End Group # Begin Group "tables" # PROP Default_Filter "" @@ -515,6 +738,14 @@ SOURCE=.\time\win32\time.c SOURCE=.\time\win32\timestr.c # End Source File # End Group +# Begin Group "uri" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\uri\apr_uri.c +# End Source File +# End Group # Begin Group "user" # PROP Default_Filter "" @@ -527,6 +758,54 @@ SOURCE=.\user\win32\groupinfo.c SOURCE=.\user\win32\userinfo.c # End Source File # End Group +# Begin Group "util-misc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\util-misc\apr_date.c +# End Source File +# Begin Source File + +SOURCE=.\util-misc\apu_dso.c +# End Source File +# Begin Source File + +SOURCE=.\util-misc\apr_queue.c +# End Source File +# Begin Source File + +SOURCE=.\util-misc\apr_reslist.c +# End Source File +# Begin Source File + +SOURCE=.\util-misc\apr_rmm.c +# End Source File +# Begin Source File + +SOURCE=.\util-misc\apr_thread_pool.c +# End Source File +# Begin Source File + +SOURCE=.\util-misc\apu_version.c +# End Source File +# End Group +# Begin Group "xlate" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\xlate\xlate.c +# End Source File +# End Group +# Begin Group "xml" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\xml\apr_xml.c +# End Source File +# End Group # End Group # Begin Group "Private Header Files" From afb3ef511d85e4b4711bcdc242e6745a18c7bda5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Dec 2009 18:51:24 +0000 Subject: [PATCH 6612/7878] Refactoring to drop apr_config.h, renamed APU_MODULE_DECLARE_DATA git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891835 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd.c | 3 +- dbd/apr_dbd_freetds.c | 4 +-- dbd/apr_dbd_mysql.c | 4 +-- dbd/apr_dbd_odbc.c | 2 +- dbd/apr_dbd_oracle.c | 3 +- dbd/apr_dbd_pgsql.c | 5 ++-- dbd/apr_dbd_sqlite2.c | 3 +- dbd/apr_dbd_sqlite3.c | 3 +- include/apr.h.in | 21 +++++++++++++ include/apr.hnw | 21 +++++++++++++ include/apr.hw | 21 +++++++++++++ include/apu.h.in | 53 --------------------------------- include/apu.hnw | 50 ------------------------------- include/apu.hw | 67 ------------------------------------------ ldap/apr_ldap_init.c | 4 +-- ldap/apr_ldap_option.c | 2 +- ldap/apr_ldap_rebind.c | 2 +- ldap/apr_ldap_stub.c | 2 +- util-misc/apu_dso.c | 3 +- xlate/xlate.c | 2 +- xml/apr_xml.c | 3 +- 21 files changed, 85 insertions(+), 193 deletions(-) diff --git a/dbd/apr_dbd.c b/dbd/apr_dbd.c index 47dc12426c6..65687032043 100644 --- a/dbd/apr_dbd.c +++ b/dbd/apr_dbd.c @@ -17,9 +17,8 @@ #include #include -#include "apu_config.h" #include "apu.h" - +#include "apr_private.h" #include "apr_pools.h" #include "apr_dso.h" #include "apr_strings.h" diff --git a/dbd/apr_dbd_freetds.c b/dbd/apr_dbd_freetds.c index 9a0cae7939a..a00db4b88ce 100644 --- a/dbd/apr_dbd_freetds.c +++ b/dbd/apr_dbd_freetds.c @@ -15,7 +15,7 @@ */ #include "apu.h" -#include "apu_config.h" +#include "apr_private.h" /* COMPILE_STUBS: compile stubs for unimplemented functions. * @@ -764,7 +764,7 @@ static apr_status_t dbd_freetds_datum_get(const apr_dbd_row_t *row, int n, } #endif -APU_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_freetds_driver = { +APR_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_freetds_driver = { "freetds", dbd_freetds_init, dbd_freetds_native, diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c index df4f6e3b0cd..fdd14f6f29e 100644 --- a/dbd/apr_dbd_mysql.c +++ b/dbd/apr_dbd_mysql.c @@ -19,7 +19,7 @@ #if APU_HAVE_MYSQL #include "apu_version.h" -#include "apu_config.h" +#include "apr_private.h" #include #include @@ -1291,7 +1291,7 @@ static void dbd_mysql_init(apr_pool_t *pool) /* FIXME: this is a guess; find out what it really does */ apr_pool_cleanup_register(pool, NULL, thread_end, apr_pool_cleanup_null); } -APU_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_mysql_driver = { +APR_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_mysql_driver = { "mysql", dbd_mysql_init, dbd_mysql_native, diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index a393a29c195..a69e7e3760b 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -15,6 +15,7 @@ */ #include "apu.h" +#include "apr_private.h" #if APU_HAVE_ODBC #include "apr.h" @@ -26,7 +27,6 @@ #include "apr_dbd_internal.h" #include "apr_thread_proc.h" #include "apu_version.h" -#include "apu_config.h" #include diff --git a/dbd/apr_dbd_oracle.c b/dbd/apr_dbd_oracle.c index 7ef05f9680d..1de34901848 100644 --- a/dbd/apr_dbd_oracle.c +++ b/dbd/apr_dbd_oracle.c @@ -50,6 +50,7 @@ #endif #include "apu.h" +#include "apr_private.h" #if APU_HAVE_ORACLE @@ -2184,7 +2185,7 @@ static int dbd_oracle_num_tuples(apr_dbd_results_t* res) return res->nrows; } -APU_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_oracle_driver = { +APR_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_oracle_driver = { "oracle", dbd_oracle_init, dbd_oracle_native, diff --git a/dbd/apr_dbd_pgsql.c b/dbd/apr_dbd_pgsql.c index 21f2179b803..989945c06a6 100644 --- a/dbd/apr_dbd_pgsql.c +++ b/dbd/apr_dbd_pgsql.c @@ -15,11 +15,10 @@ */ #include "apu.h" +#include "apr_private.h" #if APU_HAVE_PGSQL -#include "apu_config.h" - #include #include @@ -1279,7 +1278,7 @@ static int dbd_pgsql_num_tuples(apr_dbd_results_t* res) } } -APU_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_pgsql_driver = { +APR_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_pgsql_driver = { "pgsql", NULL, dbd_pgsql_native, diff --git a/dbd/apr_dbd_sqlite2.c b/dbd/apr_dbd_sqlite2.c index 132ccc4c65a..22bf2de5a5f 100644 --- a/dbd/apr_dbd_sqlite2.c +++ b/dbd/apr_dbd_sqlite2.c @@ -15,6 +15,7 @@ */ #include "apu.h" +#include "apr_private.h" #if APU_HAVE_SQLITE2 @@ -530,7 +531,7 @@ static int dbd_sqlite_num_tuples(apr_dbd_results_t * res) return res->ntuples; } -APU_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_sqlite2_driver = { +APR_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_sqlite2_driver = { "sqlite2", NULL, dbd_sqlite_native, diff --git a/dbd/apr_dbd_sqlite3.c b/dbd/apr_dbd_sqlite3.c index 02b2c02d35c..2dd51d217a6 100644 --- a/dbd/apr_dbd_sqlite3.c +++ b/dbd/apr_dbd_sqlite3.c @@ -15,6 +15,7 @@ */ #include "apu.h" +#include "apr_private.h" #if APU_HAVE_SQLITE3 @@ -880,7 +881,7 @@ static int dbd_sqlite3_num_tuples(apr_dbd_results_t *res) return res->tuples; } -APU_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_sqlite3_driver = { +APR_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_sqlite3_driver = { "sqlite3", NULL, dbd_sqlite3_native, diff --git a/include/apr.h.in b/include/apr.h.in index f808c232ba3..2ae564dea68 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -435,6 +435,27 @@ typedef apr_uint32_t apr_uintptr_t; */ #define APR_DECLARE_DATA +#if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) +/** + * Declare a dso module's exported module structure as APR_MODULE_DECLARE_DATA. + * + * Unless APR_MODULE_DECLARE_STATIC is defined at compile time, symbols + * declared with APR_MODULE_DECLARE_DATA are always exported. + * @code + * module APR_MODULE_DECLARE_DATA mod_tag + * @endcode + */ +#define APR_MODULE_DECLARE_DATA +#else +#define APR_MODULE_DECLARE_DATA __declspec(dllexport) +#endif + +/** + * @deprecated + * @see APR_MODULE_DECLARE_DATA + */ +#define APU_MODULE_DECLARE_DATA APR_MODULE_DECLARE_DATA + /* Define APR_SSIZE_T_FMT. * If ssize_t is an integer we define it to be "d", * if ssize_t is a long int we define it to be "ld", diff --git a/include/apr.hnw b/include/apr.hnw index 2e72353c7ed..c3dda1e7130 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -410,6 +410,27 @@ typedef apr_uint32_t apr_uintptr_t; */ #define APR_DECLARE_DATA +#if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) +/** + * Declare a dso module's exported module structure as APR_MODULE_DECLARE_DATA. + * + * Unless APR_MODULE_DECLARE_STATIC is defined at compile time, symbols + * declared with APR_MODULE_DECLARE_DATA are always exported. + * @code + * module APR_MODULE_DECLARE_DATA mod_tag + * @endcode + */ +#define APR_MODULE_DECLARE_DATA +#else +#define APR_MODULE_DECLARE_DATA __declspec(dllexport) +#endif + +/** + * @deprecated + * @see APR_MODULE_DECLARE_DATA + */ +#define APU_MODULE_DECLARE_DATA APR_MODULE_DECLARE_DATA + #define APR_SSIZE_T_FMT "d" #define APR_SIZE_T_FMT "d" diff --git a/include/apr.hw b/include/apr.hw index 5a0410106bc..00be181b8ce 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -552,6 +552,27 @@ typedef apr_uint32_t apr_uintptr_t; #define APR_DECLARE_DATA __declspec(dllimport) #endif +#if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) +/** + * Declare a dso module's exported module structure as APR_MODULE_DECLARE_DATA. + * + * Unless APR_MODULE_DECLARE_STATIC is defined at compile time, symbols + * declared with APR_MODULE_DECLARE_DATA are always exported. + * @code + * module APR_MODULE_DECLARE_DATA mod_tag + * @endcode + */ +#define APR_MODULE_DECLARE_DATA +#else +#define APR_MODULE_DECLARE_DATA __declspec(dllexport) +#endif + +/** + * @deprecated + * @see APR_MODULE_DECLARE_DATA + */ +#define APU_MODULE_DECLARE_DATA APR_MODULE_DECLARE_DATA + #ifdef WIN64 #define APR_SSIZE_T_FMT "I64d" #define APR_SIZE_T_FMT "I64u" diff --git a/include/apu.h.in b/include/apu.h.in index 34a69c5f0ed..207360acca5 100644 --- a/include/apu.h.in +++ b/include/apu.h.in @@ -29,59 +29,6 @@ #ifndef APU_H #define APU_H -/** - * APR_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, - * so that all public symbols are exported. - * - * APR_DECLARE_STATIC is defined when including the APR-UTIL public headers, - * to provide static linkage when the dynamic library may be unavailable. - * - * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when - * including the APR-UTIL public headers, to import and link the symbols from - * the dynamic APR-UTIL library and assure appropriate indirection and calling - * conventions at compile time. - */ - -/** - * The public APR-UTIL functions are declared with APR_DECLARE(), so they may - * use the most appropriate calling convention. Public APR functions with - * variable arguments must use APR_DECLARE_NONSTD(). - * - * @fn APR_DECLARE(rettype) apr_func(args); - */ -#define APR_DECLARE(type) type -/** - * The public APR-UTIL functions using variable arguments are declared with - * APR_DECLARE_NONSTD(), as they must use the C language calling convention. - * - * @fn APR_DECLARE_NONSTD(rettype) apr_func(args, ...); - */ -#define APR_DECLARE_NONSTD(type) type -/** - * The public APR-UTIL variables are declared with APR_DECLARE_DATA. - * This assures the appropriate indirection is invoked at compile time. - * - * @fn APR_DECLARE_DATA type apr_variable; - * @note APR_DECLARE_DATA extern type apr_variable; syntax is required for - * declarations within headers to properly import the variable. - */ -#define APR_DECLARE_DATA - -#if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) -/** - * Declare a dso module's exported module structure as APU_MODULE_DECLARE_DATA. - * - * Unless APU_MODULE_DECLARE_STATIC is defined at compile time, symbols - * declared with APU_MODULE_DECLARE_DATA are always exported. - * @code - * module APU_MODULE_DECLARE_DATA mod_tag - * @endcode - */ -#define APU_MODULE_DECLARE_DATA -#else -#define APU_MODULE_DECLARE_DATA __declspec(dllexport) -#endif - /* * we always have SDBM (it's in our codebase) */ diff --git a/include/apu.hnw b/include/apu.hnw index 6106ce64f77..1c9e98e035d 100644 --- a/include/apu.hnw +++ b/include/apu.hnw @@ -30,56 +30,6 @@ * @{ */ - -/** - * APR_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, - * so that all public symbols are exported. - * - * APR_DECLARE_STATIC is defined when including the APR-UTIL public headers, - * to provide static linkage when the dynamic library may be unavailable. - * - * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when - * including the APR-UTIL public headers, to import and link the symbols from - * the dynamic APR-UTIL library and assure appropriate indirection and calling - * conventions at compile time. - */ - -/** - * The public APR-UTIL functions are declared with APR_DECLARE(), so they may - * use the most appropriate calling convention. Public APR functions with - * variable arguments must use APR_DECLARE_NONSTD(). - * - * @fn APR_DECLARE(rettype) apr_func(args); - */ -#define APR_DECLARE(type) type -/** - * The public APR-UTIL functions using variable arguments are declared with - * APR_DECLARE_NONSTD(), as they must use the C language calling convention. - * - * @fn APR_DECLARE_NONSTD(rettype) apr_func(args, ...); - */ -#define APR_DECLARE_NONSTD(type) type -/** - * The public APR-UTIL variables are declared with APR_DECLARE_DATA. - * This assures the appropriate indirection is invoked at compile time. - * - * @fn APR_DECLARE_DATA type apr_variable; - * @note APR_DECLARE_DATA extern type apr_variable; syntax is required for - * declarations within headers to properly import the variable. - */ -#define APR_DECLARE_DATA - -/** - * Declare a dso module's exported module structure as APU_MODULE_DECLARE_DATA. - * - * Unless APU_MODULE_DECLARE_STATIC is defined at compile time, symbols - * declared with APU_MODULE_DECLARE_DATA are always exported. - * @code - * module APU_MODULE_DECLARE_DATA mod_tag - * @endcode - */ -#define APU_MODULE_DECLARE_DATA - /* * we always have SDBM (it's in our codebase) */ diff --git a/include/apu.hw b/include/apu.hw index ace8132d4a4..65df64290ea 100644 --- a/include/apu.hw +++ b/include/apu.hw @@ -29,73 +29,6 @@ #ifndef APU_H #define APU_H -/** - * APR_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, - * so that all public symbols are exported. - * - * APR_DECLARE_STATIC is defined when including the APR-UTIL public headers, - * to provide static linkage when the dynamic library may be unavailable. - * - * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when - * including the APR-UTIL public headers, to import and link the symbols from - * the dynamic APR-UTIL library and assure appropriate indirection and calling - * conventions at compile time. - */ - -#if defined(DOXYGEN) || !defined(WIN32) -/** - * The public APR-UTIL functions are declared with APR_DECLARE(), so they may - * use the most appropriate calling convention. Public APR functions with - * variable arguments must use APR_DECLARE_NONSTD(). - * - * @fn APR_DECLARE(rettype) apr_func(args); - */ -#define APR_DECLARE(type) type -/** - * The public APR-UTIL functions using variable arguments are declared with - * APR_DECLARE_NONSTD(), as they must use the C language calling convention. - * - * @fn APR_DECLARE_NONSTD(rettype) apr_func(args, ...); - */ -#define APR_DECLARE_NONSTD(type) type -/** - * The public APR-UTIL variables are declared with APR_DECLARE_DATA. - * This assures the appropriate indirection is invoked at compile time. - * - * @fn APR_DECLARE_DATA type apr_variable; - * @note extern APR_DECLARE_DATA type apr_variable; syntax is required for - * declarations within headers to properly import the variable. - */ -#define APR_DECLARE_DATA -#elif defined(APR_DECLARE_STATIC) -#define APR_DECLARE(type) type __stdcall -#define APR_DECLARE_NONSTD(type) type __cdecl -#define APR_DECLARE_DATA -#elif defined(APR_DECLARE_EXPORT) -#define APR_DECLARE(type) __declspec(dllexport) type __stdcall -#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl -#define APR_DECLARE_DATA __declspec(dllexport) -#else -#define APR_DECLARE(type) __declspec(dllimport) type __stdcall -#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl -#define APR_DECLARE_DATA __declspec(dllimport) -#endif - -#if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) -/** - * Declare a dso module's exported module structure as APU_MODULE_DECLARE_DATA. - * - * Unless APU_MODULE_DECLARE_STATIC is defined at compile time, symbols - * declared with APU_MODULE_DECLARE_DATA are always exported. - * @code - * module APU_MODULE_DECLARE_DATA mod_tag - * @endcode - */ -#define APU_MODULE_DECLARE_DATA -#else -#define APU_MODULE_DECLARE_DATA __declspec(dllexport) -#endif - /* * we always have SDBM (it's in our codebase) */ diff --git a/ldap/apr_ldap_init.c b/ldap/apr_ldap_init.c index 339f4fe2c2f..a1a1dd3de5d 100644 --- a/ldap/apr_ldap_init.c +++ b/ldap/apr_ldap_init.c @@ -24,7 +24,7 @@ #include "apr.h" #include "apu.h" -#include "apu_config.h" +#include "apr_private.h" #if APR_HAVE_MODULAR_DSO #define APU_DSO_LDAP_BUILD @@ -202,7 +202,7 @@ APR_DECLARE_LDAP(int) apr_ldap_info(apr_pool_t *pool, /* For DSO builds, export the table of entry points into the apr_ldap DSO * See include/private/apu_internal.h for the corresponding declarations */ -APU_MODULE_DECLARE_DATA struct apr__ldap_dso_fntable apr__ldap_fns = { +APR_MODULE_DECLARE_DATA struct apr__ldap_dso_fntable apr__ldap_fns = { apr_ldap_info, apr_ldap_init, apr_ldap_ssl_init, diff --git a/ldap/apr_ldap_option.c b/ldap/apr_ldap_option.c index d6dd4f1b4ac..24a713e5f71 100644 --- a/ldap/apr_ldap_option.c +++ b/ldap/apr_ldap_option.c @@ -23,7 +23,7 @@ #include "apr.h" #include "apu.h" -#include "apu_config.h" +#include "apr_private.h" #if APR_HAVE_MODULAR_DSO #define APU_DSO_LDAP_BUILD diff --git a/ldap/apr_ldap_rebind.c b/ldap/apr_ldap_rebind.c index a22cf6d6b0a..a829f30040a 100644 --- a/ldap/apr_ldap_rebind.c +++ b/ldap/apr_ldap_rebind.c @@ -23,7 +23,7 @@ #include "apr.h" #include "apu.h" -#include "apu_config.h" +#include "apr_private.h" #if APR_HAVE_MODULAR_DSO #define APU_DSO_LDAP_BUILD diff --git a/ldap/apr_ldap_stub.c b/ldap/apr_ldap_stub.c index f32dc1e660f..93fbcfefb0d 100644 --- a/ldap/apr_ldap_stub.c +++ b/ldap/apr_ldap_stub.c @@ -16,7 +16,7 @@ #include "apr.h" #include "apu.h" -#include "apu_config.h" +#include "apr_private.h" #include "apr_ldap.h" #include "apu_internal.h" #include "apr_dso.h" diff --git a/util-misc/apu_dso.c b/util-misc/apu_dso.c index d543b46d246..a8607c1177f 100644 --- a/util-misc/apu_dso.c +++ b/util-misc/apu_dso.c @@ -17,9 +17,8 @@ #include #include -#include "apu_config.h" #include "apu.h" - +#include "apr_private.h" #include "apr_pools.h" #include "apr_tables.h" #include "apr_dso.h" diff --git a/xlate/xlate.c b/xlate/xlate.c index 58875c5a3c6..400949f1cb7 100644 --- a/xlate/xlate.c +++ b/xlate/xlate.c @@ -15,7 +15,7 @@ */ #include "apu.h" -#include "apu_config.h" +#include "apr_private.h" #include "apr_lib.h" #include "apr_strings.h" #include "apr_portable.h" diff --git a/xml/apr_xml.c b/xml/apr_xml.c index 9027c2b61f2..f79c80ce8d2 100644 --- a/xml/apr_xml.c +++ b/xml/apr_xml.c @@ -15,6 +15,7 @@ */ #include "apr.h" +#include "apr_private.h" #include "apr_strings.h" #define APR_WANT_STDIO /* for sprintf() */ @@ -23,8 +24,6 @@ #include "apr_xml.h" -#include "apu_config.h" - #if defined(HAVE_XMLPARSE_XMLPARSE_H) #include #elif defined(HAVE_XMLTOK_XMLPARSE_H) From 17f5b9e148545ed1522dcfdb2a087345e780c810 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Dec 2009 18:51:46 +0000 Subject: [PATCH 6613/7878] Refactoring to drop apr_config.h, renamed APU_MODULE_DECLARE_DATA git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891836 13f79535-47bb-0310-9956-ffa450edef68 --- dbm/apr_dbm.c | 2 +- dbm/apr_dbm_berkeleydb.c | 4 ++-- dbm/apr_dbm_gdbm.c | 4 ++-- dbm/apr_dbm_ndbm.c | 4 ++-- dbm/apr_dbm_sdbm.c | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dbm/apr_dbm.c b/dbm/apr_dbm.c index dbb064dca38..2e24106cb40 100644 --- a/dbm/apr_dbm.c +++ b/dbm/apr_dbm.c @@ -26,8 +26,8 @@ #include "apr_general.h" #include "apr_atomic.h" -#include "apu_config.h" #include "apu.h" +#include "apr_private.h" #include "apu_internal.h" #include "apu_version.h" #include "apr_dbm_private.h" diff --git a/dbm/apr_dbm_berkeleydb.c b/dbm/apr_dbm_berkeleydb.c index 0cbab82ba69..838e373bdae 100644 --- a/dbm/apr_dbm_berkeleydb.c +++ b/dbm/apr_dbm_berkeleydb.c @@ -25,8 +25,8 @@ #include /* for abort() */ #endif -#include "apu_config.h" #include "apu.h" +#include "apr_private.h" #if APU_HAVE_DB #include "apr_dbm_private.h" @@ -386,7 +386,7 @@ static void vt_db_usednames(apr_pool_t *pool, const char *pathname, } -APU_MODULE_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_db = { +APR_MODULE_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_db = { "db", vt_db_open, diff --git a/dbm/apr_dbm_gdbm.c b/dbm/apr_dbm_gdbm.c index 749447a0a31..1d8c96a6398 100644 --- a/dbm/apr_dbm_gdbm.c +++ b/dbm/apr_dbm_gdbm.c @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "apu_config.h" #include "apu.h" +#include "apr_private.h" #include "apr_strings.h" #if APR_HAVE_STDLIB_H @@ -238,7 +238,7 @@ static void vt_gdbm_usednames(apr_pool_t *pool, const char *pathname, *used2 = NULL; } -APU_MODULE_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_gdbm = { +APR_MODULE_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_gdbm = { "gdbm", vt_gdbm_open, vt_gdbm_close, diff --git a/dbm/apr_dbm_ndbm.c b/dbm/apr_dbm_ndbm.c index 7f381862453..a69ac526255 100644 --- a/dbm/apr_dbm_ndbm.c +++ b/dbm/apr_dbm_ndbm.c @@ -20,8 +20,8 @@ #include /* for free() */ #endif -#include "apu_config.h" #include "apu.h" +#include "apr_private.h" #if APU_HAVE_NDBM #include "apr_dbm_private.h" @@ -221,7 +221,7 @@ static void vt_ndbm_usednames(apr_pool_t *pool, const char *pathname, *used2 = NULL; } -APU_MODULE_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_ndbm = { +APR_MODULE_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_ndbm = { "ndbm", vt_ndbm_open, vt_ndbm_close, diff --git a/dbm/apr_dbm_sdbm.c b/dbm/apr_dbm_sdbm.c index 6f531a17697..0062a3d3038 100644 --- a/dbm/apr_dbm_sdbm.c +++ b/dbm/apr_dbm_sdbm.c @@ -19,8 +19,8 @@ #define APR_WANT_STRFUNC #include "apr_want.h" -#include "apu_config.h" #include "apu.h" +#include "apr_private.h" #if APU_HAVE_SDBM @@ -207,7 +207,7 @@ static void vt_sdbm_usednames(apr_pool_t *pool, const char *pathname, *used2 = apr_pstrcat(pool, pathname, APR_SDBM_PAGFEXT, NULL); } -APU_MODULE_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_sdbm = { +APR_MODULE_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_sdbm = { "sdbm", vt_sdbm_open, vt_sdbm_close, From b2ac9392bdf5e89f5a05e2fd92c836bd5a50a901 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Dec 2009 18:57:30 +0000 Subject: [PATCH 6614/7878] Catch up to APU_MODULE_DECLARE_DATA rename git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891838 13f79535-47bb-0310-9956-ffa450edef68 --- include/private/apr_dbm_private.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/private/apr_dbm_private.h b/include/private/apr_dbm_private.h index a4db5fe0fc7..1844435f20d 100644 --- a/include/private/apr_dbm_private.h +++ b/include/private/apr_dbm_private.h @@ -109,10 +109,10 @@ struct apr_dbm_t /* Declare all of the DBM provider tables */ -APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_sdbm; -APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_gdbm; -APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_ndbm; -APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db; +APR_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_sdbm; +APR_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_gdbm; +APR_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_ndbm; +APR_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db; #ifdef __cplusplus } From 5d4a9fe3eab2fcece19ee1b1ca2f6237815e74f2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Dec 2009 19:00:08 +0000 Subject: [PATCH 6615/7878] Two missed APU_MODULE_DECLARE_DATA fixes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891841 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 3 +-- crypto/apr_crypto_nss.c | 5 ++--- crypto/apr_crypto_openssl.c | 5 ++--- crypto/apr_md5.c | 2 +- dbd/apr_dbd_odbc.c | 2 +- docs/doxygen.conf | 2 +- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 9b596affe53..31a8cf0b80a 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -17,9 +17,8 @@ #include #include -#include "apu_config.h" #include "apu.h" - +#include "apr_private.h" #include "apr_pools.h" #include "apr_dso.h" #include "apr_strings.h" diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index d63c7427d07..22673c54eff 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -15,8 +15,7 @@ */ #include "apu.h" - -#include "apu_config.h" +#include "apr_private.h" #include "apu_errno.h" #include @@ -775,7 +774,7 @@ static apr_status_t crypto_block_decrypt_finish(apr_crypto_block_t *block, /** * OpenSSL module. */ -APU_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_nss_driver = { +APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_nss_driver = { "nss", crypto_init, crypto_error, diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 6870d965fa8..48f91bddab0 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -15,8 +15,7 @@ */ #include "apu.h" - -#include "apu_config.h" +#include "apr_private.h" #include "apu_errno.h" #include @@ -654,7 +653,7 @@ static apr_status_t crypto_block_decrypt_finish(apr_crypto_block_t *ctx, /** * OpenSSL module. */ -APU_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_openssl_driver = { +APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_openssl_driver = { "openssl", crypto_init, crypto_error, crypto_make, crypto_passphrase, crypto_block_encrypt_init, crypto_block_encrypt, crypto_block_encrypt_finish, crypto_block_decrypt_init, diff --git a/crypto/apr_md5.c b/crypto/apr_md5.c index 5a18fc4c2ff..f52bd0fd4ab 100644 --- a/crypto/apr_md5.c +++ b/crypto/apr_md5.c @@ -60,7 +60,7 @@ #include "apr_strings.h" #include "apr_md5.h" #include "apr_lib.h" -#include "apu_config.h" +#include "apr_private.h" #include "apr_sha1.h" #if APR_HAVE_STRING_H diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index a69e7e3760b..552ecbf932a 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -1637,7 +1637,7 @@ static int odbc_pvbselect(apr_pool_t * pool, apr_dbd_t * handle, return odbc_pbselect(pool, handle, res, statement, random, (const void **) values); } -APU_MODULE_DECLARE_DATA const apr_dbd_driver_t ODBC_DRIVER_ENTRY = { +APR_MODULE_DECLARE_DATA const apr_dbd_driver_t ODBC_DRIVER_ENTRY = { ODBC_DRIVER_STRING, odbc_init, odbc_native_handle, diff --git a/docs/doxygen.conf b/docs/doxygen.conf index cfdf1288a5f..86145a4d061 100644 --- a/docs/doxygen.conf +++ b/docs/doxygen.conf @@ -19,9 +19,9 @@ PREDEFINED="APR_DECLARE(x)=x" \ "APR_DECLARE_INHERIT_SET(x)=apr_status_t apr_##x##_inherit_set(apr_##x##_t *the##x)" \ "APR_DECLARE_INHERIT_UNSET(x)=apr_status_t apr_##x##_inherit_unset(apr_##x##_t *the##x)" \ "APR_HAS_THREADS" \ - "APU_MODULE_DECLARE_DATA" \ "APR_HAS_MMAP" \ "APR_HAS_XLATE" \ + "APR_MODULE_DECLARE_DATA" \ "__attribute__(x)=" \ DOXYGEN= From facf960ec9ddd323062b8e177410bb2034c713e0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Dec 2009 19:08:04 +0000 Subject: [PATCH 6616/7878] Restore system iconv functionality broken in r891488 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891844 13f79535-47bb-0310-9956-ffa450edef68 --- build/{apu-iconv.m4 => iconv.m4} | 0 configure.in | 1 + 2 files changed, 1 insertion(+) rename build/{apu-iconv.m4 => iconv.m4} (100%) diff --git a/build/apu-iconv.m4 b/build/iconv.m4 similarity index 100% rename from build/apu-iconv.m4 rename to build/iconv.m4 diff --git a/configure.in b/configure.in index 4a93c860410..e8b92125f75 100644 --- a/configure.in +++ b/configure.in @@ -32,6 +32,7 @@ sinclude(build/crypto.m4) sinclude(build/dbm.m4) sinclude(build/dbd.m4) sinclude(build/dso.m4) +sinclude(build/iconv.m4) dnl Hard-coded top of apr_private.h: AH_TOP([ From 879e3f10a7866c85010cfea988c8cb7ce62f29eb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Dec 2009 19:13:49 +0000 Subject: [PATCH 6617/7878] The expat-way of doing things to the expat lib, rather than our own xml.lib The other whitespace and functional win32 changes are going away altogether as apu_config.h is dropped. The apu.hnw change was immediately reverted. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891846 13f79535-47bb-0310-9956-ffa450edef68 --- include/apu.h.in | 1 - include/apu.hnw | 4 ---- include/apu.hw | 5 ++--- include/private/apu_config.hw | 8 +++++++- libapr.dsp | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/apu.h.in b/include/apu.h.in index 207360acca5..f00ea350c8f 100644 --- a/include/apu.h.in +++ b/include/apu.h.in @@ -25,7 +25,6 @@ * @{ */ - #ifndef APU_H #define APU_H diff --git a/include/apu.hnw b/include/apu.hnw index 1c9e98e035d..5b65dafac27 100644 --- a/include/apu.hnw +++ b/include/apu.hnw @@ -25,10 +25,6 @@ #ifdef NETWARE #ifndef APU_H #define APU_H -/** - * @defgroup APR_Util APR Utility Functions - * @{ - */ /* * we always have SDBM (it's in our codebase) diff --git a/include/apu.hw b/include/apu.hw index 65df64290ea..6ee9529b16a 100644 --- a/include/apu.hw +++ b/include/apu.hw @@ -25,7 +25,6 @@ * @{ */ - #ifndef APU_H #define APU_H @@ -46,7 +45,7 @@ /* * we always enable dynamic driver loads within apr_dbd - * Win32 always has odbc (it's always installed) + * driver builds enable these flags individually */ #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_PGSQL 0 @@ -55,7 +54,7 @@ #define APU_HAVE_SQLITE2 0 #define APU_HAVE_ORACLE 0 #define APU_HAVE_FREETDS 0 -#define APU_HAVE_ODBC 1 +#define APU_HAVE_ODBC 0 #endif #define APU_HAVE_CRYPTO 0 diff --git a/include/private/apu_config.hw b/include/private/apu_config.hw index a4d9e3149e8..eb6ba4ca2cb 100644 --- a/include/private/apu_config.hw +++ b/include/private/apu_config.hw @@ -24,9 +24,12 @@ #ifndef APU_CONFIG_H #define APU_CONFIG_H -/* Compile win32 with DSO support for .dll builds */ +/* Compile win32 with DSO support for .dll builds + * Pair the static xml build for static apr-2.lib + */ #ifdef APR_DECLARE_STATIC #define APU_DSO_BUILD 0 +#define XML_STATIC 1 #else #define APU_DSO_BUILD 1 #endif @@ -37,6 +40,9 @@ /* my_sys.h is broken on VC/Win32, and apparently not required */ /* #undef HAVE_MY_SYS_H 0 */ +/* Windows ODBC sql.h is always present */ +#define HAVE_SQL_H 1 + /* * Windows does not have GDBM, and we always use the bundled (new) Expat */ diff --git a/libapr.dsp b/libapr.dsp index 93820f3f46d..fa90aa884c4 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -55,7 +55,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib expat.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /libpath:"./srclib/expat/bin/Release" /out:"Release\libapr-2.dll" /pdb:"Release\libapr-2.pdb" /implib:"Release\libapr-2.lib" /MACHINE:X86 /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib libexpat.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /libpath:"..\expat\win32\bin\Release" /out:"Release\libapr-2.dll" /pdb:"Release\libapr-2.pdb" /implib:"Release\libapr-2.lib" /MACHINE:X86 /opt:ref # Begin Special Build Tool TargetPath=Release\libapr-2.dll SOURCE="$(InputPath)" @@ -87,7 +87,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /libpath:"./srclib/expat/bin/Debug" /out:"Debug\libapr-2.dll" /pdb:"Debug\libapr-2.pdb" /implib:"Debug\libapr-2.lib" /MACHINE:X86 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib libexpat.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /libpath:"..\expat\win32\bin\Debug" /out:"Debug\libapr-2.dll" /pdb:"Debug\libapr-2.pdb" /implib:"Debug\libapr-2.lib" /MACHINE:X86 # Begin Special Build Tool TargetPath=Debug\libapr-2.dll SOURCE="$(InputPath)" @@ -119,7 +119,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /libpath:"./srclib/expat/bin/x64/Release" /out:"x64\Release\libapr-2.dll" /pdb:"x64\Release\libapr-2.pdb" /implib:"x64\Release\libapr-2.lib" /MACHINE:X64 /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib libexpat.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /libpath:"..\expat\win32\bin\x64\Release" /out:"x64\Release\libapr-2.dll" /pdb:"x64\Release\libapr-2.pdb" /implib:"x64\Release\libapr-2.lib" /MACHINE:X64 /opt:ref # Begin Special Build Tool TargetPath=x64\Release\libapr-2.dll SOURCE="$(InputPath)" @@ -151,7 +151,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /libpath:"./srclib/expat/bin/x64/Debug" /out:"x64\Debug\libapr-2.dll" /pdb:"x64\Debug\libapr-2.pdb" /implib:"x64\Debug\libapr-2.lib" /MACHINE:X64 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib libexpat.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /libpath:"..\expat\win32\bin\x64\Debug" /out:"x64\Debug\libapr-2.dll" /pdb:"x64\Debug\libapr-2.pdb" /implib:"x64\Debug\libapr-2.lib" /MACHINE:X64 # Begin Special Build Tool TargetPath=x64\Debug\libapr-2.dll SOURCE="$(InputPath)" From b03be261a7245ce790f1c782b2d416fdfb75b920 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Dec 2009 19:17:59 +0000 Subject: [PATCH 6618/7878] revert stray commit of 891846 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891850 13f79535-47bb-0310-9956-ffa450edef68 --- include/apu.hnw | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/apu.hnw b/include/apu.hnw index 5b65dafac27..1c9e98e035d 100644 --- a/include/apu.hnw +++ b/include/apu.hnw @@ -25,6 +25,10 @@ #ifdef NETWARE #ifndef APU_H #define APU_H +/** + * @defgroup APR_Util APR Utility Functions + * @{ + */ /* * we always have SDBM (it's in our codebase) From f8e48b7bd72df861af7fd7f168bac4ea873a10cb Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 17 Dec 2009 19:34:58 +0000 Subject: [PATCH 6619/7878] fix spelling git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891858 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index e8b92125f75..530689cd514 100644 --- a/configure.in +++ b/configure.in @@ -2483,7 +2483,7 @@ dnl ------------------------------ APR-util stuff APU_PRELOAD -dnl Find crpyto libraries +dnl Find crypto libraries APU_CHECK_CRYPTO APU_CHECK_CRYPTO_OPENSSL APU_CHECK_CRYPTO_NSS From d3ccb71c5f51baa6cf294e0ab71c67e8e5f47797 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 17 Dec 2009 23:29:53 +0000 Subject: [PATCH 6620/7878] This newline breaks feature detection on mingw xcompile, shouldn't be needed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@891991 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 4b3f6586772..38c2b255cf5 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -468,7 +468,7 @@ main() { FILE *f=fopen("conftestval", "w"); if (!f) exit(1); - fprintf(f, "%d\n", sizeof($2)); + fprintf(f, "%d", sizeof($2)); exit(0); }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$3],,, AC_CV_NAME=$3))])dnl From 6d78caa9f31a80986bc86e0180b02310e2ab9671 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 00:21:02 +0000 Subject: [PATCH 6621/7878] More portable solution to this type mess, extensible to other \r\n platforms git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892028 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 38c2b255cf5..d0efc1e9206 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -464,11 +464,16 @@ AC_MSG_CHECKING(size of $2) AC_CACHE_VAL(AC_CV_NAME, [AC_TRY_RUN([#include $1 +#ifdef WIN32 +#define binmode "b" +#else +#define binmode +#endif main() { - FILE *f=fopen("conftestval", "w"); + FILE *f=fopen("conftestval", "w" binmode); if (!f) exit(1); - fprintf(f, "%d", sizeof($2)); + fprintf(f, "%d\n", sizeof($2)); exit(0); }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$3],,, AC_CV_NAME=$3))])dnl From c1a2bb532f537b74dc9130e28be1062055522716 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 03:44:48 +0000 Subject: [PATCH 6622/7878] missed one APU_HAVE_APR_ICONV occurance git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892121 13f79535-47bb-0310-9956-ffa450edef68 --- include/apu.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apu.h.in b/include/apu.h.in index f00ea350c8f..a7832740294 100644 --- a/include/apu.h.in +++ b/include/apu.h.in @@ -53,7 +53,7 @@ #define APU_HAVE_NSS @apu_have_nss@ #define APU_HAVE_ICONV @have_iconv@ -#define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) +#define APR_HAS_XLATE (APU_HAVE_ICONV) #endif /* APU_H */ /** @} */ From 657b7f197a7e2a55bb53ab65f10c3575090334e0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 03:44:59 +0000 Subject: [PATCH 6623/7878] working through various mingw elections, to straighten out win32 apr_private.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892122 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index 530689cd514..f6aca03e8cc 100644 --- a/configure.in +++ b/configure.in @@ -494,12 +494,13 @@ case $host in OSDIR="as400" eolstr="\\n" ;; - *mingw*) + *-mingw*) OSDIR="win32" APR_ADDTO(CPPFLAGS,-DWIN32) ac_cv_file__dev_zero="no" ac_cv_func_setpgrp_void="no" apr_cv_tcp_nodelay_with_cork="no" + apr_cv_use_lfs64="no" enable_threads="system_threads" eolstr="\\r\\n" file_as_socket="0" @@ -626,7 +627,7 @@ dnl It should check for LIBS being empty and set LIBS equal to the new value dnl without the extra " " in that case, but they didn't do that. So, we dnl end up LIBS="-lm -lcrypt -lnsl -ldl" which is an annoyance. case $host in - *mingw*) + *-mingw*) dnl APR_ADDTO(LIBS,[-lmsvcrt --lshell32 -ladvapi32 -lws2_32]) AC_CHECK_LIB(msvcrt, getpid) @@ -1527,6 +1528,16 @@ case $host in esac size_t_fmt="lu" ;; + *-mingw*) +dnl int64_literal='#define APR_INT64_C(val) (val##i64)' +dnl uint64_literal='#define APR_UINT64_C(val) (val##Ui64)' + int64_t_fmt='#define APR_INT64_T_FMT "I64d"' + uint64_t_fmt='#define APR_UINT64_T_FMT "I64u"' + uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "I64x"' + int64_value="__int64" + long_value="__int64" + int64_strfn="_strtoi64" + ;; esac APR_CHECK_TYPES_COMPATIBLE(ssize_t, int, [ssize_t_fmt="d"]) @@ -1620,12 +1631,17 @@ elif test "$ac_cv_type_off_t" = "yes"; then off_t_fmt='#define APR_OFF_T_FMT "lld"' fi ;; + *-mingw*) + off_t_value=apr_int64_t + off_t_fmt='#define APR_OFF_T_FMT "I64d"' + off_t_strfn='_strtoi64' + ;; esac else - # Fallback on int - off_t_value=apr_int32_t - off_t_fmt=d - off_t_strfn='strtoi' + # Fallback on int + off_t_value=apr_int64_t + off_t_fmt='#define APR_OFF_T_FMT "d"' + off_t_strfn='strtoi' fi AC_MSG_RESULT($off_t_value) @@ -1746,7 +1762,7 @@ if test "$dsotype" = "any"; then if test "$ac_cv_sizeof_voidp$have_shl" = "41"; then dsotype=shl; APR_ADDTO(LIBS,-ldld) fi;; - *mingw*|*-os2*) + *-mingw*|*-os2*) # several 'other's below probably belong up here. If they always # use a platform implementation and shouldn't test the dlopen/dlfcn # features, then bring them up here. @@ -2645,7 +2661,7 @@ chmod +x apr-$APR_MAJOR_VERSION-config # instead, we will rely on the manually-crafted win32 apr_private.h instead. case $APR_PLATFORM in *-mingw*) - rm include/arch/unix/apr_private.h +dnl XXX rm include/arch/unix/apr_private.h ;; *) ;; From cc8844c5cac23fe22c5a3f2df992862464d35562 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 04:24:50 +0000 Subject: [PATCH 6624/7878] Nothing interesting existed in apr_common_private.h, this would have just as well been an include/arch/unix/apr_arch_common.h but is entirely unnecessary. The right solution is dozens of lines less code and confusion, simply drive apr_filepath_list_split|merge from filepath_util.c brought in from the unix/ directory, across all platforms. One 'temporary' cast was in use by apr_pools.c, the other was entirely unused. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892127 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 --- file_io/unix/filepath.c | 14 ---------- file_io/unix/filepath_util.c | 30 ++++++++++++---------- file_io/win32/filepath.c | 15 ----------- include/arch/apr_private_common.h | 41 ------------------------------ include/arch/netware/apr_private.h | 5 ---- include/arch/win32/apr_private.h | 5 ---- memory/unix/apr_pools.c | 2 ++ 8 files changed, 19 insertions(+), 97 deletions(-) delete mode 100644 include/arch/apr_private_common.h diff --git a/configure.in b/configure.in index f6aca03e8cc..c6f9d809d56 100644 --- a/configure.in +++ b/configure.in @@ -49,10 +49,6 @@ AH_BOTTOM([ #define BEOS_BONE 1 #endif -/* - * Include common private declarations. - */ -#include "../apr_private_common.h" #endif /* APR_PRIVATE_H */ ]) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index 6a65b202ecf..b3dd2cac926 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -289,20 +289,6 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, - const char *liststr, - apr_pool_t *p) -{ - return apr_filepath_list_split_impl(pathelts, liststr, ':', p); -} - -APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, - apr_array_header_t *pathelts, - apr_pool_t *p) -{ - return apr_filepath_list_merge_impl(liststr, pathelts, ':', p); -} - APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p) { #if defined(DARWIN) diff --git a/file_io/unix/filepath_util.c b/file_io/unix/filepath_util.c index d8ccc567146..af0c67e07b0 100644 --- a/file_io/unix/filepath_util.c +++ b/file_io/unix/filepath_util.c @@ -26,30 +26,35 @@ #include "apr_private.h" -apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, - const char *liststr, - char separator, - apr_pool_t *p) +#if defined(WIN32) || defined(OS2) || defined(NETWARE) +#define PATH_SEPARATOR ';' +#define PATH_SEPARATOR_STRING ";" +#else +#define PATH_SEPARATOR ':' +#define PATH_SEPARATOR_STRING ":" +#endif + +APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, + const char *liststr, + apr_pool_t *p) { char *path, *part, *ptr; - char separator_string[2] = { '\0', '\0' }; apr_array_header_t *elts; int nelts; - separator_string[0] = separator; /* Count the number of path elements. We know there'll be at least one even if path is an empty string. */ path = apr_pstrdup(p, liststr); for (nelts = 0, ptr = path; ptr != NULL; ++nelts) { - ptr = strchr(ptr, separator); + ptr = strchr(ptr, PATH_SEPARATOR); if (ptr) ++ptr; } /* Split the path into the array. */ elts = apr_array_make(p, nelts, sizeof(char*)); - while ((part = apr_strtok(path, separator_string, &ptr)) != NULL) + while ((part = apr_strtok(path, PATH_SEPARATOR_STR, &ptr)) != NULL) { if (*part == '\0') /* Ignore empty path components. */ continue; @@ -63,10 +68,9 @@ apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, } -apr_status_t apr_filepath_list_merge_impl(char **liststr, - apr_array_header_t *pathelts, - char separator, - apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, + apr_array_header_t *pathelts, + apr_pool_t *p) { apr_size_t path_size = 0; char *path; @@ -102,7 +106,7 @@ apr_status_t apr_filepath_list_merge_impl(char **liststr, continue; if (i > 0) - *path++ = separator; + *path++ = PATH_SEPARATOR; memcpy(path, part, part_size); path += part_size; } diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 766e35f8d82..5fb21611238 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -955,21 +955,6 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } -APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, - const char *liststr, - apr_pool_t *p) -{ - return apr_filepath_list_split_impl(pathelts, liststr, ';', p); -} - -APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, - apr_array_header_t *pathelts, - apr_pool_t *p) -{ - return apr_filepath_list_merge_impl(liststr, pathelts, ';', p); -} - - APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p) { #if APR_HAS_UNICODE_FS diff --git a/include/arch/apr_private_common.h b/include/arch/apr_private_common.h deleted file mode 100644 index ec850c6525e..00000000000 --- a/include/arch/apr_private_common.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * This file contains private declarations common to all architectures. - */ - -#ifndef APR_PRIVATE_COMMON_H -#define APR_PRIVATE_COMMON_H - -#include "apr_pools.h" -#include "apr_tables.h" - -apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, - const char *liststr, - char separator, - apr_pool_t *p); - -apr_status_t apr_filepath_list_merge_impl(char **liststr, - apr_array_header_t *pathelts, - char separator, - apr_pool_t *p); - -/* temporary defines to handle 64bit compile mismatches */ -#define APR_INT_TRUNC_CAST int -#define APR_UINT32_TRUNC_CAST apr_uint32_t - -#endif /*APR_PRIVATE_COMMON_H*/ diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index a4e9b1e7828..6cf1c092852 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -193,10 +193,5 @@ void* getStatCache(); /* used to check DWORD overflow for 64bit compiles */ #define APR_DWORD_MAX 0xFFFFFFFFUL -/* - * Include common private declarations. - */ -#include "../apr_private_common.h" - #endif /*APR_PRIVATE_H*/ #endif /*NETWARE*/ diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index e2738891b3e..8cd21cfe964 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -164,10 +164,5 @@ APR_DECLARE_DATA int errno; /* used to check for DWORD overflow in 64bit compiles */ #define APR_DWORD_MAX 0xFFFFFFFFUL -/* - * Include common private declarations. - */ -#include "../apr_private_common.h" - #endif /*APR_PRIVATE_H*/ #endif /*WIN32*/ diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 1a783d118df..1002555ac5b 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -39,6 +39,8 @@ #include /* for getpid */ #endif +/* XXX Temporary Cast */ +#define APR_UINT32_TRUNC_CAST apr_uint32_t /* * Magic numbers From 37bd71272273b01e1f5f8e56d969f6d767c89e56 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 04:38:43 +0000 Subject: [PATCH 6625/7878] Catch up on Win32 build with apr_private_common.h/apu_config.h deprecation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892130 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 55 ------------------------------------------------------ libapr.dsp | 55 ------------------------------------------------------ 2 files changed, 110 deletions(-) diff --git a/apr.dsp b/apr.dsp index ed161fc2b7f..1a86453aca0 100644 --- a/apr.dsp +++ b/apr.dsp @@ -819,10 +819,6 @@ SOURCE=.\include\arch\win32\apr_arch_utf8.h SOURCE=.\include\arch\win32\apr_private.h # End Source File -# Begin Source File - -SOURCE=.\include\arch\apr_private_common.h -# End Source File # End Group # Begin Group "Public Header Files" @@ -1136,57 +1132,6 @@ InputPath=.\include\apu.hw # End Source File # Begin Source File -SOURCE=.\include\private\apu_config.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\private\apu_config.hw - -!IF "$(CFG)" == "apr - Win32 Release" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - Win32 Debug" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - x64 Release" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - x64 Debug" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - SOURCE=.\include\private\apu_select_dbm.h.in # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index fa90aa884c4..18129cc2f61 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -854,10 +854,6 @@ SOURCE=.\include\arch\win32\apr_arch_utf8.h SOURCE=.\include\arch\win32\apr_private.h # End Source File -# Begin Source File - -SOURCE=.\include\arch\apr_private_common.h -# End Source File # End Group # Begin Group "Public Header Files" @@ -1171,57 +1167,6 @@ InputPath=.\include\apu.hw # End Source File # Begin Source File -SOURCE=.\include\private\apu_config.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\private\apu_config.hw - -!IF "$(CFG)" == "libapr - Win32 Release" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - Win32 Debug" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - x64 Release" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - x64 Debug" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - SOURCE=.\include\private\apu_select_dbm.h.in # End Source File # Begin Source File From 53af05ab16626895893b4e9c261257b5b1ff1609 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 04:57:07 +0000 Subject: [PATCH 6626/7878] The end of individual apu.h flavors, these public declarations live in apr.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892131 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 53 +---------------------------------- configure.in | 3 +- include/apr.h.in | 27 ++++++++++++++++++ include/apr.hnw | 38 +++++++++++++++++++++++++ include/apr.hw | 39 ++++++++++++++++++++++++++ include/apu.h | 24 ++++++++++++++++ include/apu.h.in | 59 -------------------------------------- include/apu.hnw | 73 ------------------------------------------------ include/apu.hw | 71 ---------------------------------------------- libapr.dsp | 53 +---------------------------------- 10 files changed, 131 insertions(+), 309 deletions(-) create mode 100644 include/apu.h delete mode 100644 include/apu.h.in delete mode 100644 include/apu.hnw delete mode 100644 include/apu.hw diff --git a/apr.dsp b/apr.dsp index 1a86453aca0..f327c0b6ce3 100644 --- a/apr.dsp +++ b/apr.dsp @@ -1077,58 +1077,7 @@ SOURCE=.\include\apr_want.h # End Source File # Begin Source File -SOURCE=.\include\apu.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apu.hnw -# End Source File -# Begin Source File - -SOURCE=.\include\apu.hw - -!IF "$(CFG)" == "apr - Win32 Release" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - Win32 Debug" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - x64 Release" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - x64 Debug" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ENDIF - +SOURCE=.\include\apu.h # End Source File # Begin Source File diff --git a/configure.in b/configure.in index c6f9d809d56..4af7cb8cbd2 100644 --- a/configure.in +++ b/configure.in @@ -2548,7 +2548,6 @@ if test -n "$APR_DSO_MODULES"; then else APR_HAVE_MODULES=no fi -# Define expanded libdir for apu_config.h APR_EXPAND_VAR(abs_dso_libdir, $APR_DSO_LIBDIR) AC_DEFINE_UNQUOTED([APR_DSO_LIBDIR], ["$abs_dso_libdir"], [Define to be absolute path to DSO directory]) @@ -2638,7 +2637,7 @@ fi AC_CONFIG_FILES([include/private/apu_select_dbm.h include/apr_ldap.h - include/apu.h include/apu_want.h]) + include/apu_want.h]) dir=include/arch/unix test -d $dir || $MKDIR $dir diff --git a/include/apr.h.in b/include/apr.h.in index 2ae564dea68..dc74971794c 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -527,6 +527,33 @@ typedef int uid_t; typedef int gid_t; #endif +/* + * we always have SDBM (it's in our codebase) + */ +#define APU_HAVE_SDBM @apu_have_sdbm@ +#define APU_HAVE_GDBM @apu_have_gdbm@ +#define APU_HAVE_NDBM @apu_have_ndbm@ +#define APU_HAVE_DB @apu_have_db@ + +#if APU_HAVE_DB +#define APU_HAVE_DB_VERSION @apu_db_version@ +#endif + +#define APU_HAVE_PGSQL @apu_have_pgsql@ +#define APU_HAVE_MYSQL @apu_have_mysql@ +#define APU_HAVE_SQLITE3 @apu_have_sqlite3@ +#define APU_HAVE_SQLITE2 @apu_have_sqlite2@ +#define APU_HAVE_ORACLE @apu_have_oracle@ +#define APU_HAVE_FREETDS @apu_have_freetds@ +#define APU_HAVE_ODBC @apu_have_odbc@ + +#define APU_HAVE_CRYPTO @apu_have_crypto@ +#define APU_HAVE_OPENSSL @apu_have_openssl@ +#define APU_HAVE_NSS @apu_have_nss@ + +#define APU_HAVE_ICONV @have_iconv@ +#define APR_HAS_XLATE (APU_HAVE_ICONV) + #ifdef __cplusplus } #endif diff --git a/include/apr.hnw b/include/apr.hnw index c3dda1e7130..b13c530b7c4 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -457,6 +457,44 @@ typedef int apr_wait_t; #define APR_UINT64_T_HEX_FMT "llx" #define APR_TIME_T_FMT APR_INT64_T_FMT +/* + * we always have SDBM (it's in our codebase) + */ +#define APU_HAVE_SDBM 1 + +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_GDBM 0 +#define APU_HAVE_NDBM 0 +#define APU_HAVE_DB 0 + +#if APU_HAVE_DB +#define APU_HAVE_DB_VERSION 0 +#endif +#endif + +/* + * we always enable dynamic driver loads within apr_dbd + */ +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_PGSQL 0 +#define APU_HAVE_MYSQL 0 +#define APU_HAVE_SQLITE3 0 +#define APU_HAVE_SQLITE2 0 +#define APU_HAVE_ORACLE 0 +#define APU_HAVE_FREETDS 0 +#define APU_HAVE_ODBC 0 +#endif + +#define APU_HAVE_CRYPTO 0 + +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_OPENSSL 0 +#define APU_HAVE_NSS 0 +#endif + +#define APU_HAVE_ICONV 1 +#define APR_HAS_XLATE (APU_HAVE_ICONV) + /** @} */ #ifdef __cplusplus diff --git a/include/apr.hw b/include/apr.hw index 00be181b8ce..76bf3e503ec 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -610,6 +610,45 @@ typedef int apr_wait_t; #define APR_DSOPATH "PATH" +/* + * we always have SDBM (it's in our codebase) + */ +#define APU_HAVE_SDBM 1 + +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_GDBM 0 +#define APU_HAVE_NDBM 0 +#define APU_HAVE_DB 0 + +#if APU_HAVE_DB +#define APU_HAVE_DB_VERSION 0 +#endif +#endif + +/* + * we always enable dynamic driver loads within apr_dbd + * driver builds enable these flags individually + */ +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_PGSQL 0 +#define APU_HAVE_MYSQL 0 +#define APU_HAVE_SQLITE3 0 +#define APU_HAVE_SQLITE2 0 +#define APU_HAVE_ORACLE 0 +#define APU_HAVE_FREETDS 0 +#define APU_HAVE_ODBC 0 +#endif + +#define APU_HAVE_CRYPTO 0 + +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_OPENSSL 0 +#define APU_HAVE_NSS 0 +#endif + +#define APU_HAVE_ICONV 0 +#define APR_HAS_XLATE (APU_HAVE_ICONV) + /** @} */ /* Definitions that only Win32 programs need to compile properly. */ diff --git a/include/apu.h b/include/apu.h new file mode 100644 index 00000000000..942098f2e90 --- /dev/null +++ b/include/apu.h @@ -0,0 +1,24 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* @file apu.h + * @brief APR-Utility main file + * @deprecated @see apr.h + */ + +#include + +/** @} */ diff --git a/include/apu.h.in b/include/apu.h.in deleted file mode 100644 index a7832740294..00000000000 --- a/include/apu.h.in +++ /dev/null @@ -1,59 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * apu.h is generated from apu.h.in by configure -- do not edit apu.h - */ -/* @file apu.h - * @brief APR-Utility main file - */ -/** - * @defgroup APR_Util APR Utility Functions - * @{ - */ - -#ifndef APU_H -#define APU_H - -/* - * we always have SDBM (it's in our codebase) - */ -#define APU_HAVE_SDBM @apu_have_sdbm@ -#define APU_HAVE_GDBM @apu_have_gdbm@ -#define APU_HAVE_NDBM @apu_have_ndbm@ -#define APU_HAVE_DB @apu_have_db@ - -#if APU_HAVE_DB -#define APU_HAVE_DB_VERSION @apu_db_version@ -#endif - -#define APU_HAVE_PGSQL @apu_have_pgsql@ -#define APU_HAVE_MYSQL @apu_have_mysql@ -#define APU_HAVE_SQLITE3 @apu_have_sqlite3@ -#define APU_HAVE_SQLITE2 @apu_have_sqlite2@ -#define APU_HAVE_ORACLE @apu_have_oracle@ -#define APU_HAVE_FREETDS @apu_have_freetds@ -#define APU_HAVE_ODBC @apu_have_odbc@ - -#define APU_HAVE_CRYPTO @apu_have_crypto@ -#define APU_HAVE_OPENSSL @apu_have_openssl@ -#define APU_HAVE_NSS @apu_have_nss@ - -#define APU_HAVE_ICONV @have_iconv@ -#define APR_HAS_XLATE (APU_HAVE_ICONV) - -#endif /* APU_H */ -/** @} */ diff --git a/include/apu.hnw b/include/apu.hnw deleted file mode 100644 index 1c9e98e035d..00000000000 --- a/include/apu.hnw +++ /dev/null @@ -1,73 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Note: This is a NetWare specific version of apu.h. It is renamed to - * apu.h at the start of a NetWare build. - */ -/* @file apu.h - * @brief APR-Utility main file - */ - -#ifdef NETWARE -#ifndef APU_H -#define APU_H -/** - * @defgroup APR_Util APR Utility Functions - * @{ - */ - -/* - * we always have SDBM (it's in our codebase) - */ -#define APU_HAVE_SDBM 1 - -#ifndef APU_DSO_MODULE_BUILD -#define APU_HAVE_GDBM 0 -#define APU_HAVE_NDBM 0 -#define APU_HAVE_DB 0 - -#if APU_HAVE_DB -#define APU_HAVE_DB_VERSION 0 -#endif -#endif - -/* - * we always enable dynamic driver loads within apr_dbd - */ -#ifndef APU_DSO_MODULE_BUILD -#define APU_HAVE_PGSQL 0 -#define APU_HAVE_MYSQL 0 -#define APU_HAVE_SQLITE3 0 -#define APU_HAVE_SQLITE2 0 -#define APU_HAVE_ORACLE 0 -#define APU_HAVE_FREETDS 0 -#define APU_HAVE_ODBC 0 -#endif - -#define APU_HAVE_CRYPTO 0 - -#ifndef APU_DSO_MODULE_BUILD -#define APU_HAVE_OPENSSL 0 -#define APU_HAVE_NSS 0 -#endif - -#define APU_HAVE_ICONV 1 -#define APR_HAS_XLATE (APU_HAVE_ICONV) - -#endif /* APU_H */ -#endif /* NETWARE */ - diff --git a/include/apu.hw b/include/apu.hw deleted file mode 100644 index 6ee9529b16a..00000000000 --- a/include/apu.hw +++ /dev/null @@ -1,71 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * apu.h is duplicated from apu.hw at build time -- do not edit apu.h - */ -/* @file apu.h - * @brief APR-Utility main file - */ -/** - * @defgroup APR_Util APR Utility Functions - * @{ - */ - -#ifndef APU_H -#define APU_H - -/* - * we always have SDBM (it's in our codebase) - */ -#define APU_HAVE_SDBM 1 - -#ifndef APU_DSO_MODULE_BUILD -#define APU_HAVE_GDBM 0 -#define APU_HAVE_NDBM 0 -#define APU_HAVE_DB 0 - -#if APU_HAVE_DB -#define APU_HAVE_DB_VERSION 0 -#endif -#endif - -/* - * we always enable dynamic driver loads within apr_dbd - * driver builds enable these flags individually - */ -#ifndef APU_DSO_MODULE_BUILD -#define APU_HAVE_PGSQL 0 -#define APU_HAVE_MYSQL 0 -#define APU_HAVE_SQLITE3 0 -#define APU_HAVE_SQLITE2 0 -#define APU_HAVE_ORACLE 0 -#define APU_HAVE_FREETDS 0 -#define APU_HAVE_ODBC 0 -#endif - -#define APU_HAVE_CRYPTO 0 - -#ifndef APU_DSO_MODULE_BUILD -#define APU_HAVE_OPENSSL 0 -#define APU_HAVE_NSS 0 -#endif - -#define APU_HAVE_ICONV 0 -#define APR_HAS_XLATE (APU_HAVE_ICONV) - -#endif /* APU_H */ -/** @} */ diff --git a/libapr.dsp b/libapr.dsp index 18129cc2f61..cc37cfbacf7 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -1112,58 +1112,7 @@ SOURCE=.\include\apr_want.h # End Source File # Begin Source File -SOURCE=.\include\apu.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apu.hnw -# End Source File -# Begin Source File - -SOURCE=.\include\apu.hw - -!IF "$(CFG)" == "libapr - Win32 Release" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - Win32 Debug" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - x64 Release" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - x64 Debug" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ENDIF - +SOURCE=.\include\apu.h # End Source File # Begin Source File From 28f97ce8bc7341d61ffcdaa7a4ca5cb15b1df763 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 05:03:21 +0000 Subject: [PATCH 6627/7878] Catch filepath_util.c flaws, unix build works again git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892134 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/unix/filepath_util.c b/file_io/unix/filepath_util.c index af0c67e07b0..82d97e48144 100644 --- a/file_io/unix/filepath_util.c +++ b/file_io/unix/filepath_util.c @@ -18,7 +18,7 @@ #define APR_WANT_STRFUNC #define APR_WANT_MEMFUNC #include "apr_want.h" - +#include "apr_file_info.h" #include "apr_errno.h" #include "apr_pools.h" #include "apr_strings.h" @@ -54,7 +54,7 @@ APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, /* Split the path into the array. */ elts = apr_array_make(p, nelts, sizeof(char*)); - while ((part = apr_strtok(path, PATH_SEPARATOR_STR, &ptr)) != NULL) + while ((part = apr_strtok(path, PATH_SEPARATOR_STRING, &ptr)) != NULL) { if (*part == '\0') /* Ignore empty path components. */ continue; From a88e7e514dce112e2349cecb6c5f13ab90855815 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 05:05:17 +0000 Subject: [PATCH 6628/7878] Fix doxygen syntax git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892137 13f79535-47bb-0310-9956-ffa450edef68 --- include/apu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/apu.h b/include/apu.h index 942098f2e90..018bf638a6e 100644 --- a/include/apu.h +++ b/include/apu.h @@ -21,4 +21,3 @@ #include -/** @} */ From 3c0eebcad517793672ce43be03606bdbd55846c2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 05:20:42 +0000 Subject: [PATCH 6629/7878] Netware changes; always include netware.h/library.h for whatever local functions or types would be aliased, in a public manner, and drop very stale references to flavors which should not be in common use. It's not necessary to exclude by platform, is it? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892141 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 2 ++ include/arch/netware/apr_private.h | 29 ++--------------------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index b13c530b7c4..77c0abff4b1 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -48,6 +48,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 6cf1c092852..289651ebdeb 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -16,28 +16,13 @@ /* * Note: - * This is the windows specific autoconf-like config file - * which unix would create at build time. + * This is the netware-specific autoconf-like config file + * which unix creates at ./configure time. */ -#ifdef NETWARE - #ifndef APR_PRIVATE_H #define APR_PRIVATE_H -/* Include the public APR symbols, include our idea of the 'right' - * subset of the Windows.h header. This saves us repetition. - */ -#include "apr.h" - -#include -#include -#include -#include -#include -#include -#include - /* Use this section to define all of the HAVE_FOO_H * that are required to build properly. */ @@ -71,19 +56,10 @@ #define HAVE_WRITEV 1 #define HAVE_GETPASS_R 1 -/* - * check for older NDKs which have only the getpassword() function. - */ -#include -#if (CURRENT_NDK_THRESHOLD < 709060000) -#define getpass_r getpassword -#endif /* 64-bit integer conversion function */ #define APR_INT64_STRFN strtoll -/*#define DSO_USE_DLFCN */ - #ifdef NW_BUILD_IPV6 #define HAVE_GETADDRINFO 1 #define HAVE_GETNAMEINFO 1 @@ -194,4 +170,3 @@ void* getStatCache(); #define APR_DWORD_MAX 0xFFFFFFFFUL #endif /*APR_PRIVATE_H*/ -#endif /*NETWARE*/ From 5dc8da4e49bb357c2ed05936538bb243c6e116d2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 06:10:44 +0000 Subject: [PATCH 6630/7878] Finish removing apu_config.h[n]w templates, these need synchronization w/unix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892148 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 36 +++++++ include/apr.hw | 147 +++++++++++++++++------------ include/arch/netware/apr_private.h | 24 +++++ include/arch/win32/apr_private.h | 60 ++++++++---- include/private/apu_config.hnw | 53 ----------- include/private/apu_config.hw | 58 ------------ threadproc/win32/proc.c | 2 +- threadproc/win32/thread.c | 2 +- 8 files changed, 191 insertions(+), 191 deletions(-) delete mode 100644 include/private/apu_config.hnw delete mode 100644 include/private/apu_config.hw diff --git a/include/apr.h.in b/include/apr.h.in index dc74971794c..068218a4673 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -116,13 +116,49 @@ */ #if APR_HAVE_WINDOWS_H +#ifndef _WINDOWS_ + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0501 +#endif + +#ifndef NOUSER +#define NOUSER +#endif +#ifndef NOMCX +#define NOMCX +#endif +#ifndef NOIME +#define NOIME +#endif + #include #endif +#endif #if APR_HAVE_WINSOCK2_H #include + +#if APR_HAVE_WS2TCPIP_H +#include +#endif + +#if APR_HAVE_MSWSOCK_H +#include #endif +#else /* !APR_HAVE_WINSOCK2_H */ + +#if APR_HAVE_WINSOCK_H +#include +#endif + +#endif /* !APR_HAVE_WINSOCK2_H */ + #if APR_HAVE_SYS_TYPES_H #include #endif diff --git a/include/apr.hw b/include/apr.hw index 76bf3e503ec..ae5d2bacaa9 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -28,16 +28,6 @@ * apr.hw by the apr.dsp and libapr.dsp projects. */ -/** - * @file apr.h - * @brief APR Platform Definitions - * @remark This is a generated header generated from include/apr.h.in by - * ./configure, or copied from include/apr.hw or include/apr.hnw - * for Win32 or Netware by those build environments, respectively. - */ - -#if defined(WIN32) || defined(DOXYGEN) - /* Ignore most warnings (back down to /W3) for poorly constructed headers */ #if defined(_MSC_VER) && _MSC_VER >= 1200 @@ -66,44 +56,13 @@ #pragma warning(disable: 4996) #endif -/* Has windows.h already been included? If so, our preferences don't matter, - * but we will still need the winsock things no matter what was included. - * If not, include a restricted set of windows headers to our tastes. - */ -#ifndef _WINDOWS_ -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#ifndef _WIN32_WINNT - -/* Restrict the server to a subset of Windows XP header files by default - */ -#define _WIN32_WINNT 0x0501 -#endif -#ifndef NOUSER -#define NOUSER -#endif -#ifndef NOMCX -#define NOMCX -#endif -#ifndef NOIME -#define NOIME -#endif -#include -/* - * Add a _very_few_ declarations missing from the restricted set of headers - * (If this list becomes extensive, re-enable the required headers above!) - * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now +/** + * @file apr.h + * @brief APR Platform Definitions + * @remark This is a generated header generated from include/apr.h.in by + * ./configure, or copied from include/apr.hw or include/apr.hnw + * for Win32 or Netware by those build environments, respectively. */ -#define SW_HIDE 0 -#ifndef _WIN32_WCE -#include -#include -#include -#else -#include -#endif -#endif /* !_WINDOWS_ */ /** * @defgroup APR Apache Portability Runtime library @@ -142,6 +101,7 @@ #define APR_HAVE_SEMAPHORE_H 0 #define APR_HAVE_SIGNAL_H 1 #define APR_HAVE_STDARG_H 1 +#define APR_HAVE_STDDEF_H 1 #define APR_HAVE_STDINT_H 0 #define APR_HAVE_STDIO_H 1 #define APR_HAVE_STDLIB_H 1 @@ -160,8 +120,8 @@ #define APR_HAVE_SYS_WAIT_H 0 #define APR_HAVE_TIME_H 1 #define APR_HAVE_UNISTD_H 0 -#define APR_HAVE_STDDEF_H 1 -#define APR_HAVE_PROCESS_H 1 +#define APR_HAVE_WINDOWS_H 1 +#define APR_HAVE_WINSOCK2_H 1 #else #define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_CONIO_H 0 @@ -181,6 +141,7 @@ #define APR_HAVE_SEMAPHORE_H 0 #define APR_HAVE_SIGNAL_H 0 #define APR_HAVE_STDARG_H 0 +#define APR_HAVE_STDDEF_H 0 #define APR_HAVE_STDINT_H 0 #define APR_HAVE_STDIO_H 1 #define APR_HAVE_STDLIB_H 1 @@ -199,8 +160,8 @@ #define APR_HAVE_SYS_WAIT_H 0 #define APR_HAVE_TIME_H 0 #define APR_HAVE_UNISTD_H 0 -#define APR_HAVE_STDDEF_H 0 -#define APR_HAVE_PROCESS_H 0 +#define APR_HAVE_WINDOWS_H 1 +#define APR_HAVE_WINSOCK2_H 0 #endif /** @} */ @@ -210,24 +171,90 @@ * or the extern "C" namespace */ +/* If windows.h was already included, our preferences don't matter. + * If not, include a restricted set of windows headers to our tastes. + */ +#if APR_HAVE_WINDOWS_H +#ifndef _WINDOWS_ + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0501 +#endif + +#ifndef NOUSER +#define NOUSER +#endif +#ifndef NOMCX +#define NOMCX +#endif +#ifndef NOIME +#define NOIME +#endif + +#include +#endif +#endif + +#if APR_HAVE_WINSOCK2_H +#include + +#if APR_HAVE_WS2TCPIP_H +#include +#endif + +#if APR_HAVE_MSWSOCK_H +#include +#endif + +#else /* !APR_HAVE_WINSOCK2_H */ + +#if APR_HAVE_WINSOCK_H +#include +#endif + +#endif /* !APR_HAVE_WINSOCK2_H */ + +#if APR_HAVE_SYS_TYPES_H +#include +#endif + +#if APR_HAVE_SYS_SOCKET_H +#include +#endif + +#if APR_HAVE_STDINT_H +#include +#endif + +#if APR_HAVE_SYS_WAIT_H +#include +#endif + +/* header files for PATH_MAX, _POSIX_PATH_MAX */ +#if APR_HAVE_LIMITS_H +#include +#else +#if APR_HAVE_SYS_SYSLIMITS_H +#include +#endif +#endif + #if APR_HAVE_STDLIB_H #include #endif #if APR_HAVE_STDIO_H #include #endif -#if APR_HAVE_SYS_TYPES_H -#include -#endif #if APR_HAVE_STDDEF_H #include #endif #if APR_HAVE_TIME_H #include #endif -#if APR_HAVE_PROCESS_H -#include -#endif #ifdef __cplusplus extern "C" { @@ -686,13 +713,13 @@ typedef int gid_t; } #endif -/* Done with badly written headers +/* Done with badly written headers, leave 'deprecated CRT' undeprecated */ #if defined(_MSC_VER) && _MSC_VER >= 1200 #pragma warning(pop) +#if _MSC_VER >= 1400 #pragma warning(disable: 4996) #endif - -#endif /* WIN32 */ +#endif #endif /* APR_H */ diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 289651ebdeb..6e614339de1 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -169,4 +169,28 @@ void* getStatCache(); /* used to check DWORD overflow for 64bit compiles */ #define APR_DWORD_MAX 0xFFFFFFFFUL +/* Always compile Netware with DSO support for .nlm builds */ +#define APU_DSO_BUILD 0 + +/* + * NetWare does not have GDBM, and we always use the bundled (new) Expat + */ + +/* Define if you have the gdbm library (-lgdbm). */ +/* #undef HAVE_LIBGDBM */ + +/* define if Expat 1.0 or 1.1 was found */ +/* #undef APR_HAVE_OLD_EXPAT */ + +/* NetWare uses its own ICONV implementation. */ +#define HAVE_ICONV_H 1 + +/* + * check for newer NDKs which use now correctly 'const char*' with iconv. + */ +#include +#if (CURRENT_NDK_THRESHOLD >= 705110000) +#define APU_ICONV_INBUF_CONST +#endif + #endif /*APR_PRIVATE_H*/ diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 8cd21cfe964..56cc383dacc 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -16,12 +16,10 @@ /* * Note: - * This is the windows specific autoconf-like config file - * which unix would create at build time. + * This is the win32-specific autoconf-like config file + * which unix creates at ./configure time. */ -#ifdef WIN32 - #ifndef APR_PRIVATE_H #define APR_PRIVATE_H @@ -32,8 +30,8 @@ /* * Add a _very_few_ declarations missing from the restricted set of headers - * (If this list becomes extensive, re-enable the required headers above!) - * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now + * (If this list becomes extensive, re-enable the required headers in apr.hw!) + * ACL headers were excluded by default, so include them now. */ #ifndef SW_HIDE #define SW_HIDE 0 @@ -56,26 +54,19 @@ #define HAVE_ACLAPI 0 #endif -#if APR_HAVE_SYS_TYPES_H -#include -#endif -#if APR_HAVE_STDDEF_H -#include -#endif -#include -#if APR_HAVE_TIME_H -#include -#endif - /* Use this section to define all of the HAVE_FOO_H * that are required to build properly. */ #define HAVE_LIMITS_H 1 #define HAVE_MALLOC_H 1 #define HAVE_SIGNAL_H 1 -/* #define HAVE_STDDEF_H 1 why not? */ #define HAVE_STDLIB_H 1 +#ifndef _WIN32_WCE +#define HAVE_PROCESS_H 1 +#define HAVE_STDDEF_H 1 +#endif + #define HAVE_STRICMP 1 #define HAVE_STRNICMP 1 #define HAVE_STRDUP 1 @@ -164,5 +155,38 @@ APR_DECLARE_DATA int errno; /* used to check for DWORD overflow in 64bit compiles */ #define APR_DWORD_MAX 0xFFFFFFFFUL +/* Compile win32 with DSO support for .dll builds + * Pair the static xml build for static apr-2.lib + */ +#ifdef APR_DECLARE_STATIC +#define APU_DSO_BUILD 0 +#define XML_STATIC 1 +#else +#define APU_DSO_BUILD 1 +#endif + +/* Presume a standard, modern (5.x) mysql sdk/ +#define HAVE_MY_GLOBAL_H 1 + +/* my_sys.h is broken on VC/Win32, and apparently not required */ +/* #undef HAVE_MY_SYS_H 0 */ + +/* Windows ODBC sql.h is always present */ +#define HAVE_SQL_H 1 + +/* + * Windows does not have GDBM, and we always use the bundled (new) Expat + */ + +/* Define if you have the gdbm library (-lgdbm). */ +/* #undef HAVE_LIBGDBM */ + +/* define if Expat 1.0 or 1.1 was found */ +/* #undef APR_HAVE_OLD_EXPAT */ + +#ifdef HAVE_PROCESS_H +#include +#endif + #endif /*APR_PRIVATE_H*/ #endif /*WIN32*/ diff --git a/include/private/apu_config.hnw b/include/private/apu_config.hnw deleted file mode 100644 index 9c6c73e4627..00000000000 --- a/include/private/apu_config.hnw +++ /dev/null @@ -1,53 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Note: This is a NetWare specific version of apu_config.hnw. It is copied - * as apu_config.h at the start of a NetWare build. - */ - -#ifdef NETWARE - -#ifndef APU_CONFIG_H -#define APU_CONFIG_H - -/* Always compile Netware with DSO support for .nlm builds */ -#define APU_DSO_BUILD 0 - -/* - * NetWare does not have GDBM, and we always use the bundled (new) Expat - */ - -/* Define if you have the gdbm library (-lgdbm). */ -/* #undef HAVE_LIBGDBM */ - -/* define if Expat 1.0 or 1.1 was found */ -/* #undef APR_HAVE_OLD_EXPAT */ - -/* NetWare uses its own ICONV implementation. */ -#define HAVE_ICONV_H 1 - -/* - * check for newer NDKs which use now correctly 'const char*' with iconv. - */ -#include -#if (CURRENT_NDK_THRESHOLD >= 705110000) -#define APU_ICONV_INBUF_CONST -#endif - -#endif /* APU_CONFIG_H */ -#endif /* NETWARE */ - diff --git a/include/private/apu_config.hw b/include/private/apu_config.hw deleted file mode 100644 index eb6ba4ca2cb..00000000000 --- a/include/private/apu_config.hw +++ /dev/null @@ -1,58 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Note: This is a Windows specific version of apu_config.hw. It is copied - * as apu_config.h at the start of a Windows build. - */ - -#ifdef WIN32 - -#ifndef APU_CONFIG_H -#define APU_CONFIG_H - -/* Compile win32 with DSO support for .dll builds - * Pair the static xml build for static apr-2.lib - */ -#ifdef APR_DECLARE_STATIC -#define APU_DSO_BUILD 0 -#define XML_STATIC 1 -#else -#define APU_DSO_BUILD 1 -#endif - -/* Presume a standard, modern (5.x) mysql sdk/ -#define HAVE_MY_GLOBAL_H 1 - -/* my_sys.h is broken on VC/Win32, and apparently not required */ -/* #undef HAVE_MY_SYS_H 0 */ - -/* Windows ODBC sql.h is always present */ -#define HAVE_SQL_H 1 - -/* - * Windows does not have GDBM, and we always use the bundled (new) Expat - */ - -/* Define if you have the gdbm library (-lgdbm). */ -/* #undef HAVE_LIBGDBM */ - -/* define if Expat 1.0 or 1.1 was found */ -/* #undef APR_HAVE_OLD_EXPAT */ - - -#endif /* APU_CONFIG_H */ -#endif /* WIN32 */ diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 08ea918a05e..c54d556af91 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -28,7 +28,7 @@ #include #endif #include -#if APR_HAVE_PROCESS_H +#ifdef HAVE_PROCESS_H #include #endif diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 25034571ea9..9b9473ad584 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -20,7 +20,7 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_portable.h" -#if APR_HAVE_PROCESS_H +#ifdef HAVE_PROCESS_H #include #endif #include "apr_arch_misc.h" From d7633a9c6f1c60dcdc47cb05dfcf02387e014f74 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 06:33:49 +0000 Subject: [PATCH 6631/7878] Further synchronization, hide internals git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892154 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 8 +- include/apr.hw | 130 +++++++++++++------------------ include/arch/win32/apr_private.h | 10 +++ 3 files changed, 69 insertions(+), 79 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 068218a4673..24f6da53b2f 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -56,7 +56,10 @@ * means. In particular it's missing inline and the __attribute__ * stuff. So we hack around it. PR#1613. -djg */ -#if !defined(__GNUC__) || __GNUC__ < 2 || \ +#if defined(_MSC_VER) +#define APR_INLINE __inline +#define APR_HAS_INLINE 1 +#elif !defined(__GNUC__) || __GNUC__ < 2 || \ (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\ defined(NEXT) #ifndef __attribute__ @@ -115,6 +118,9 @@ * or the extern "C" namespace */ +/* If windows.h was already included, our preferences don't matter. + * If not, include a restricted set of windows headers to our tastes. + */ #if APR_HAVE_WINDOWS_H #ifndef _WINDOWS_ diff --git a/include/apr.hw b/include/apr.hw index ae5d2bacaa9..b5fe03522c6 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -28,7 +28,8 @@ * apr.hw by the apr.dsp and libapr.dsp projects. */ -/* Ignore most warnings (back down to /W3) for poorly constructed headers +/* Ignore most warnings (back down to /W3) for poorly constructed headers, + * excluded from doxygen parsing */ #if defined(_MSC_VER) && _MSC_VER >= 1200 #pragma warning(push, 3) @@ -44,7 +45,9 @@ * C4244: int to char/short - precision loss * C4514: unreferenced inline function removed */ +#if defined(_MSC_VER) #pragma warning(disable: 4100 4127 4163 4201 4514; once: 4057 4075 4244) +#endif /* Ignore Microsoft's interpretation of secure development * and the POSIX string handling API @@ -76,62 +79,48 @@ * are platform specific and should NOT be relied upon! */ +/* So that we can use inline on some critical functions, and use + * GNUC attributes (such as to get -Wall warnings for printf-like + * functions). Only do this in gcc 2.7 or later ... it may work + * on earlier stuff, but why chance it. + * + * We've since discovered that the gcc shipped with NeXT systems + * as "cc" is completely broken. It claims to be __GNUC__ and so + * on, but it doesn't implement half of the things that __GNUC__ + * means. In particular it's missing inline and the __attribute__ + * stuff. So we hack around it. PR#1613. -djg + */ +#if defined(_MSC_VER) #define APR_INLINE __inline -#define APR_HAS_INLINE 1 -#if !defined(__GNUC__) && !defined(__attribute__) +#define APR_HAS_INLINE 1 +#elif !defined(__GNUC__) || __GNUC__ < 2 || \ + (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\ + defined(NEXT) +#ifndef __attribute__ #define __attribute__(__x) #endif +#define APR_INLINE +#define APR_HAS_INLINE 0 +#else +#define APR_INLINE __inline__ +#define APR_HAS_INLINE 1 +#endif -#ifndef _WIN32_WCE -#define APR_HAVE_ARPA_INET_H 0 -#define APR_HAVE_CONIO_H 1 -#define APR_HAVE_CRYPT_H 0 -#define APR_HAVE_CTYPE_H 1 -#define APR_HAVE_DIRENT_H 0 -#define APR_HAVE_ERRNO_H 1 -#define APR_HAVE_FCNTL_H 1 -#define APR_HAVE_IO_H 1 -#define APR_HAVE_LIMITS_H 1 -#define APR_HAVE_NETDB_H 0 -#define APR_HAVE_NETINET_IN_H 0 -#define APR_HAVE_NETINET_SCTP_H 0 -#define APR_HAVE_NETINET_SCTP_UIO_H 0 -#define APR_HAVE_NETINET_TCP_H 0 -#define APR_HAVE_PTHREAD_H 0 -#define APR_HAVE_SEMAPHORE_H 0 -#define APR_HAVE_SIGNAL_H 1 -#define APR_HAVE_STDARG_H 1 -#define APR_HAVE_STDDEF_H 1 -#define APR_HAVE_STDINT_H 0 -#define APR_HAVE_STDIO_H 1 -#define APR_HAVE_STDLIB_H 1 -#define APR_HAVE_STRING_H 1 -#define APR_HAVE_STRINGS_H 0 -#define APR_HAVE_SYS_IOCTL_H 0 -#define APR_HAVE_SYS_SENDFILE_H 0 -#define APR_HAVE_SYS_SIGNAL_H 0 -#define APR_HAVE_SYS_SOCKET_H 0 -#define APR_HAVE_SYS_SOCKIO_H 0 -#define APR_HAVE_SYS_SYSLIMITS_H 0 -#define APR_HAVE_SYS_TIME_H 0 -#define APR_HAVE_SYS_TYPES_H 1 -#define APR_HAVE_SYS_UIO_H 0 -#define APR_HAVE_SYS_UN_H 0 -#define APR_HAVE_SYS_WAIT_H 0 -#define APR_HAVE_TIME_H 1 -#define APR_HAVE_UNISTD_H 0 -#define APR_HAVE_WINDOWS_H 1 -#define APR_HAVE_WINSOCK2_H 1 +#ifdef _WIN32_WCE +#define APR_NOT_IN_WCE 0 #else +#define APR_NOT_IN_WCE 1 +#endif + #define APR_HAVE_ARPA_INET_H 0 -#define APR_HAVE_CONIO_H 0 +#define APR_HAVE_CONIO_H APR_NOT_IN_WCE #define APR_HAVE_CRYPT_H 0 -#define APR_HAVE_CTYPE_H 0 +#define APR_HAVE_CTYPE_H APR_NOT_IN_WCE #define APR_HAVE_DIRENT_H 0 -#define APR_HAVE_ERRNO_H 0 -#define APR_HAVE_FCNTL_H 0 -#define APR_HAVE_IO_H 0 -#define APR_HAVE_LIMITS_H 0 +#define APR_HAVE_ERRNO_H APR_NOT_IN_WCE +#define APR_HAVE_FCNTL_H APR_NOT_IN_WCE +#define APR_HAVE_IO_H APR_NOT_IN_WCE +#define APR_HAVE_LIMITS_H APR_NOT_IN_WCE #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 #define APR_HAVE_NETINET_SCTP_H 0 @@ -139,9 +128,9 @@ #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SEMAPHORE_H 0 -#define APR_HAVE_SIGNAL_H 0 -#define APR_HAVE_STDARG_H 0 -#define APR_HAVE_STDDEF_H 0 +#define APR_HAVE_SIGNAL_H APR_NOT_IN_WCE +#define APR_HAVE_STDARG_H APR_NOT_IN_WCE +#define APR_HAVE_STDDEF_H APR_NOT_IN_WCE #define APR_HAVE_STDINT_H 0 #define APR_HAVE_STDIO_H 1 #define APR_HAVE_STDLIB_H 1 @@ -154,15 +143,14 @@ #define APR_HAVE_SYS_SOCKIO_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 #define APR_HAVE_SYS_TIME_H 0 -#define APR_HAVE_SYS_TYPES_H 0 +#define APR_HAVE_SYS_TYPES_H APR_NOT_IN_WCE #define APR_HAVE_SYS_UIO_H 0 #define APR_HAVE_SYS_UN_H 0 #define APR_HAVE_SYS_WAIT_H 0 -#define APR_HAVE_TIME_H 0 +#define APR_HAVE_TIME_H APR_NOT_IN_WCE #define APR_HAVE_UNISTD_H 0 #define APR_HAVE_WINDOWS_H 1 -#define APR_HAVE_WINSOCK2_H 0 -#endif +#define APR_HAVE_WINSOCK2_H APR_NOT_IN_WCE /** @} */ /** @} */ @@ -312,7 +300,9 @@ extern "C" { #define APR_HAVE_SIGWAIT 0 #define APR_HAVE_STRCASECMP 0 #define APR_HAVE_STRDUP 1 +#define APR_HAVE_STRICMP APR_NOT_IN_WCE #define APR_HAVE_STRNCASECMP 0 +#define APR_HAVE_STRNICMP APR_NOT_IN_WCE #define APR_HAVE_STRSTR 1 #define APR_HAVE_MEMCHR 1 #define APR_HAVE_STRUCT_RLIMIT 0 @@ -320,17 +310,10 @@ extern "C" { #define APR_HAVE_SCTP 0 #define APR_HAVE_IOVEC 0 -#ifndef _WIN32_WCE -#define APR_HAVE_STRICMP 1 -#define APR_HAVE_STRNICMP 1 -#else -#define APR_HAVE_STRICMP 0 -#define APR_HAVE_STRNICMP 0 -#endif - /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY 1 #define APR_HAS_THREADS 1 +#define APR_HAS_SENDFILE APR_NOT_IN_WCE #define APR_HAS_MMAP 1 #define APR_HAS_FORK 0 #define APR_HAS_RANDOM 1 @@ -339,21 +322,12 @@ extern "C" { #define APR_HAS_SO_ACCEPTFILTER 0 #define APR_HAS_UNICODE_FS 1 #define APR_HAS_PROC_INVOKED 1 +#define APR_HAS_USER APR_NOT_IN_WCE +#define APR_HAS_LARGE_FILES APR_NOT_IN_WCE +#define APR_HAS_XTHREAD_FILES APR_NOT_IN_WCE #define APR_HAS_OS_UUID 1 -#ifndef _WIN32_WCE -#define APR_HAS_SENDFILE 1 -#define APR_HAS_USER 1 -#define APR_HAS_LARGE_FILES 1 -#define APR_HAS_XTHREAD_FILES 1 -#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 1 -#else -#define APR_HAS_SENDFILE 0 -#define APR_HAS_USER 0 -#define APR_HAS_LARGE_FILES 0 -#define APR_HAS_XTHREAD_FILES 0 -#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0 -#endif +#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD APR_NOT_IN_WCE /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible * to poll on files/pipes. @@ -367,7 +341,7 @@ extern "C" { /* If we have a TCP implementation that can be "corked", what flag * do we use? */ -#define APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@ +#xxxdefine APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@ /* Is the TCP_NODELAY socket option inherited from listening sockets? */ diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 56cc383dacc..2d307a2fa57 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -37,6 +37,16 @@ #define SW_HIDE 0 #endif +#ifndef STDIN_FILENO +#define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +#define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +#define STDERR_FILENO 2 +#endif + /* For the misc.h late-loaded dynamic symbols, we need some obscure types * Avoid dragging in wtypes.h unless it's absolutely necessary [generally * not with APR itself, until some GUI-related security is introduced.] From 365882e4e97557b6ed6b92142a552b242ff2a436 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 06:40:15 +0000 Subject: [PATCH 6632/7878] sync for stddef.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892156 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + include/apr.h.in | 5 +++++ include/apr.hw | 5 ----- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 4af7cb8cbd2..9eb81e4e492 100644 --- a/configure.in +++ b/configure.in @@ -1307,6 +1307,7 @@ AC_SUBST(netinet_sctph) AC_SUBST(netinet_sctp_uioh) AC_SUBST(netinet_tcph) AC_SUBST(stdargh) +AC_SUBST(stddefh) AC_SUBST(stdioh) AC_SUBST(stdlibh) AC_SUBST(stringh) diff --git a/include/apr.h.in b/include/apr.h.in index 24f6da53b2f..2be7e2e4b6c 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -90,6 +90,7 @@ #define APR_HAVE_SEMAPHORE_H @semaphoreh@ #define APR_HAVE_SIGNAL_H @signalh@ #define APR_HAVE_STDARG_H @stdargh@ +#define APR_HAVE_STDDEF_H @stddefh@ #define APR_HAVE_STDINT_H @stdint@ #define APR_HAVE_STDIO_H @stdioh@ #define APR_HAVE_STDLIB_H @stdlibh@ @@ -169,6 +170,10 @@ #include #endif +#if APR_HAVE_STDDEF_H +#include +#endif + #if APR_HAVE_SYS_SOCKET_H #include #endif diff --git a/include/apr.hw b/include/apr.hw index b5fe03522c6..85fe5e8e48a 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -663,11 +663,6 @@ typedef int pid_t; typedef int uid_t; typedef int gid_t; -/* Win32 .h ommissions we really need */ -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 - #if APR_HAVE_IPV6 /* Appears in later flavors, not the originals. */ From f4643f23ac4cd4feb285cfeb643392b43603efa1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 06:54:39 +0000 Subject: [PATCH 6633/7878] fix compilation errors on win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892158 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_private.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 2d307a2fa57..dc7c586096d 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -69,14 +69,11 @@ */ #define HAVE_LIMITS_H 1 #define HAVE_MALLOC_H 1 +#define HAVE_PROCESS_H APR_NOT_IN_WCE #define HAVE_SIGNAL_H 1 +#define HAVE_STDDEF_H APR_NOT_IN_WCE #define HAVE_STDLIB_H 1 -#ifndef _WIN32_WCE -#define HAVE_PROCESS_H 1 -#define HAVE_STDDEF_H 1 -#endif - #define HAVE_STRICMP 1 #define HAVE_STRNICMP 1 #define HAVE_STRDUP 1 @@ -175,7 +172,7 @@ APR_DECLARE_DATA int errno; #define APU_DSO_BUILD 1 #endif -/* Presume a standard, modern (5.x) mysql sdk/ +/* Presume a standard, modern (5.x) mysql sdk */ #define HAVE_MY_GLOBAL_H 1 /* my_sys.h is broken on VC/Win32, and apparently not required */ @@ -199,4 +196,3 @@ APR_DECLARE_DATA int errno; #endif #endif /*APR_PRIVATE_H*/ -#endif /*WIN32*/ From aa616faee5644add82b115c986e1148de3be7d5a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 07:03:34 +0000 Subject: [PATCH 6634/7878] Restructure to ensure successful mingw compilation, stdio seems very popular, too git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892159 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_getpass.c | 82 +++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 3deb08fc0e1..20e8738f727 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -47,6 +47,9 @@ #if APR_HAVE_STRINGS_H #include #endif +#if APR_HAVE_STDIO_H +#include +#endif /* Disable getpass() support when PASS_MAX is defined and is "small", * for an arbitrary definition of "small". */ @@ -90,46 +93,7 @@ static char *get_password(const char *prompt) return (char *) &password; } -#elif defined (HAVE_TERMIOS_H) -#include - -static char *get_password(const char *prompt) -{ - struct termios attr; - static char password[MAX_STRING_LEN]; - int n=0; - fputs(prompt, stderr); - fflush(stderr); - - if (tcgetattr(STDIN_FILENO, &attr) != 0) - return NULL; - attr.c_lflag &= ~(ECHO); - - if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &attr) != 0) - return NULL; - while ((password[n] = getchar()) != '\n') { - if (n < sizeof(password) - 1 && password[n] >= ' ' && password[n] <= '~') { - n++; - } else { - fprintf(stderr,"\n"); - fputs(prompt, stderr); - fflush(stderr); - n = 0; - } - } - - password[n] = '\0'; - printf("\n"); - if (n > (MAX_STRING_LEN - 1)) { - password[MAX_STRING_LEN - 1] = '\0'; - } - - attr.c_lflag |= ECHO; - tcsetattr(STDIN_FILENO, TCSANOW, &attr); - return (char*) &password; -} - -#else +#elif defined(WIN32) /* * Windows lacks getpass(). So we'll re-implement it here. @@ -200,6 +164,44 @@ static char *get_password(const char *prompt) #endif } +#elif defined (HAVE_TERMIOS_H) + +static char *get_password(const char *prompt) +{ + struct termios attr; + static char password[MAX_STRING_LEN]; + int n=0; + fputs(prompt, stderr); + fflush(stderr); + + if (tcgetattr(STDIN_FILENO, &attr) != 0) + return NULL; + attr.c_lflag &= ~(ECHO); + + if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &attr) != 0) + return NULL; + while ((password[n] = getchar()) != '\n') { + if (n < sizeof(password) - 1 && password[n] >= ' ' && password[n] <= '~') { + n++; + } else { + fprintf(stderr,"\n"); + fputs(prompt, stderr); + fflush(stderr); + n = 0; + } + } + + password[n] = '\0'; + printf("\n"); + if (n > (MAX_STRING_LEN - 1)) { + password[MAX_STRING_LEN - 1] = '\0'; + } + + attr.c_lflag |= ECHO; + tcsetattr(STDIN_FILENO, TCSANOW, &attr); + return (char*) &password; +} + #endif /* no getchar or _getch */ #endif /* no getpass or getpassphrase or getpass_r */ From ed357370dd1843c38ee6642146e2d573066324a2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 07:24:46 +0000 Subject: [PATCH 6635/7878] further win32 synchronization git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892162 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 26 +++++++++--------- include/apr.hw | 68 +++++++++++++++++++++--------------------------- 2 files changed, 42 insertions(+), 52 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 2be7e2e4b6c..fe98bcddf93 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -561,19 +561,6 @@ typedef int apr_wait_t; /** @} */ -/* Definitions that only Win32 programs need to compile properly. */ - -/* XXX These simply don't belong here, perhaps in apr_portable.h - * based on some APR_HAVE_PID/GID/UID? - */ -#ifdef __MINGW32__ -#ifndef __GNUC__ -typedef int pid_t; -#endif -typedef int uid_t; -typedef int gid_t; -#endif - /* * we always have SDBM (it's in our codebase) */ @@ -601,6 +588,19 @@ typedef int gid_t; #define APU_HAVE_ICONV @have_iconv@ #define APR_HAS_XLATE (APU_HAVE_ICONV) +/* Definitions that only Win32 programs need to compile properly. */ + +/* XXX These simply don't belong here, perhaps in apr_portable.h + * based on some APR_HAVE_PID/GID/UID? + */ +#ifdef WIN32 +#ifndef __GNUC__ +typedef int pid_t; +#endif +typedef int uid_t; +typedef int gid_t; +#endif + #ifdef __cplusplus } #endif diff --git a/include/apr.hw b/include/apr.hw index 85fe5e8e48a..d079cdce057 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -113,14 +113,14 @@ #endif #define APR_HAVE_ARPA_INET_H 0 -#define APR_HAVE_CONIO_H APR_NOT_IN_WCE +#define APR_HAVE_CONIO_H APR_NOT_IN_WCE #define APR_HAVE_CRYPT_H 0 -#define APR_HAVE_CTYPE_H APR_NOT_IN_WCE +#define APR_HAVE_CTYPE_H APR_NOT_IN_WCE #define APR_HAVE_DIRENT_H 0 -#define APR_HAVE_ERRNO_H APR_NOT_IN_WCE -#define APR_HAVE_FCNTL_H APR_NOT_IN_WCE -#define APR_HAVE_IO_H APR_NOT_IN_WCE -#define APR_HAVE_LIMITS_H APR_NOT_IN_WCE +#define APR_HAVE_ERRNO_H APR_NOT_IN_WCE +#define APR_HAVE_FCNTL_H APR_NOT_IN_WCE +#define APR_HAVE_IO_H APR_NOT_IN_WCE +#define APR_HAVE_LIMITS_H APR_NOT_IN_WCE #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 #define APR_HAVE_NETINET_SCTP_H 0 @@ -128,13 +128,13 @@ #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SEMAPHORE_H 0 -#define APR_HAVE_SIGNAL_H APR_NOT_IN_WCE -#define APR_HAVE_STDARG_H APR_NOT_IN_WCE -#define APR_HAVE_STDDEF_H APR_NOT_IN_WCE +#define APR_HAVE_SIGNAL_H APR_NOT_IN_WCE +#define APR_HAVE_STDARG_H APR_NOT_IN_WCE +#define APR_HAVE_STDDEF_H APR_NOT_IN_WCE #define APR_HAVE_STDINT_H 0 -#define APR_HAVE_STDIO_H 1 -#define APR_HAVE_STDLIB_H 1 -#define APR_HAVE_STRING_H 1 +#define APR_HAVE_STDIO_H 1 +#define APR_HAVE_STDLIB_H 1 +#define APR_HAVE_STRING_H 1 #define APR_HAVE_STRINGS_H 0 #define APR_HAVE_SYS_IOCTL_H 0 #define APR_HAVE_SYS_SENDFILE_H 0 @@ -143,14 +143,14 @@ #define APR_HAVE_SYS_SOCKIO_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 #define APR_HAVE_SYS_TIME_H 0 -#define APR_HAVE_SYS_TYPES_H APR_NOT_IN_WCE +#define APR_HAVE_SYS_TYPES_H APR_NOT_IN_WCE #define APR_HAVE_SYS_UIO_H 0 #define APR_HAVE_SYS_UN_H 0 #define APR_HAVE_SYS_WAIT_H 0 -#define APR_HAVE_TIME_H APR_NOT_IN_WCE +#define APR_HAVE_TIME_H APR_NOT_IN_WCE #define APR_HAVE_UNISTD_H 0 -#define APR_HAVE_WINDOWS_H 1 -#define APR_HAVE_WINSOCK2_H APR_NOT_IN_WCE +#define APR_HAVE_WINDOWS_H 1 +#define APR_HAVE_WINSOCK2_H APR_NOT_IN_WCE /** @} */ /** @} */ @@ -214,6 +214,10 @@ #include #endif +#if APR_HAVE_STDDEF_H +#include +#endif + #if APR_HAVE_STDINT_H #include #endif @@ -231,19 +235,6 @@ #endif #endif -#if APR_HAVE_STDLIB_H -#include -#endif -#if APR_HAVE_STDIO_H -#include -#endif -#if APR_HAVE_STDDEF_H -#include -#endif -#if APR_HAVE_TIME_H -#include -#endif - #ifdef __cplusplus extern "C" { #endif @@ -271,8 +262,8 @@ extern "C" { #define APR_USE_SHMEM_BEOS 0 #define APR_USE_FLOCK_SERIALIZE 0 -#define APR_USE_POSIXSEM_SERIALIZE 0 #define APR_USE_SYSVSEM_SERIALIZE 0 +#define APR_USE_POSIXSEM_SERIALIZE 0 #define APR_USE_FCNTL_SERIALIZE 0 #define APR_USE_PROC_PTHREAD_SERIALIZE 0 #define APR_USE_PTHREAD_SERIALIZE 0 @@ -298,6 +289,7 @@ extern "C" { #define APR_HAVE_SIGACTION 0 #define APR_HAVE_SIGSUSPEND 0 #define APR_HAVE_SIGWAIT 0 +#define APR_HAVE_SA_STORAGE 0 #define APR_HAVE_STRCASECMP 0 #define APR_HAVE_STRDUP 1 #define APR_HAVE_STRICMP APR_NOT_IN_WCE @@ -327,7 +319,7 @@ extern "C" { #define APR_HAS_XTHREAD_FILES APR_NOT_IN_WCE #define APR_HAS_OS_UUID 1 -#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD APR_NOT_IN_WCE +#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD APR_NOT_IN_WCE /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible * to poll on files/pipes. @@ -341,7 +333,7 @@ extern "C" { /* If we have a TCP implementation that can be "corked", what flag * do we use? */ -#xxxdefine APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@ +#define APR_TCP_NOPUSH_FLAG 0 /* Is the TCP_NODELAY socket option inherited from listening sockets? */ @@ -349,7 +341,7 @@ extern "C" { /* Is the O_NONBLOCK flag inherited from listening sockets? */ -#define APR_O_NONBLOCK_INHERITED 1 +#define APR_O_NONBLOCK_INHERITED 1 /* Typedefs that APR needs. */ @@ -365,15 +357,11 @@ typedef __int64 apr_int64_t; typedef unsigned __int64 apr_uint64_t; typedef size_t apr_size_t; -#if APR_HAVE_STDDEF_H -typedef ptrdiff_t apr_ssize_t; -#else -typedef int apr_ssize_t; -#endif +typedef ssize_t apr_ssize_t; #if APR_HAS_LARGE_FILES typedef __int64 apr_off_t; #else -typedef int apr_off_t; +typedef long apr_off_t; #endif typedef int apr_socklen_t; typedef apr_uint64_t apr_ino_t; @@ -657,11 +645,13 @@ typedef int apr_wait_t; /* XXX These simply don't belong here, perhaps in apr_portable.h * based on some APR_HAVE_PID/GID/UID? */ +#ifdef WIN32 #ifndef __GNUC__ typedef int pid_t; #endif typedef int uid_t; typedef int gid_t; +#endif #if APR_HAVE_IPV6 From 6ea523be528dfb0e154712879b4e4377595d4881 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 08:29:08 +0000 Subject: [PATCH 6636/7878] Quiet missing prototype warnings git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892176 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index 44d3776e552..d1763ca3b8e 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -189,7 +189,7 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); typedef rettype (calltype *apr_winapi_fpt_##fn) args; \ static apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \ static int apr_winapi_chk_##fn = 0; \ - static APR_INLINE int apr_winapi_ld_##fn() \ + static APR_INLINE int apr_winapi_ld_##fn(void) \ { if (apr_winapi_pfn_##fn) return 1; \ if (apr_winapi_chk_##fn ++) return 0; \ if (!apr_winapi_pfn_##fn) \ From 91032765743e30c8681841395ceb58efeaf05be2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 08:29:51 +0000 Subject: [PATCH 6637/7878] Yes, use the lfs64 flag to flag APR_HAS_LARGE_FILES Cleans up some warning emits in the dbg_log custom win32 tracing logic Set the HAVE_ICONV_H flag for testing purposes, until I wrap up the unix side git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892177 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- include/arch/win32/apr_private.h | 2 ++ misc/win32/misc.c | 13 ++++++++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 9eb81e4e492..209cef6da3c 100644 --- a/configure.in +++ b/configure.in @@ -496,7 +496,7 @@ case $host in ac_cv_file__dev_zero="no" ac_cv_func_setpgrp_void="no" apr_cv_tcp_nodelay_with_cork="no" - apr_cv_use_lfs64="no" + apr_cv_use_lfs64="yes" enable_threads="system_threads" eolstr="\\r\\n" file_as_socket="0" diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index dc7c586096d..cad8e328f7b 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -181,6 +181,8 @@ APR_DECLARE_DATA int errno; /* Windows ODBC sql.h is always present */ #define HAVE_SQL_H 1 +#define HAVE_ICONV_H 1 + /* * Windows does not have GDBM, and we always use the bundled (new) Expat */ diff --git a/misc/win32/misc.c b/misc/win32/misc.c index a95a2219036..8c3cb916c2c 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -17,6 +17,7 @@ #include "apr_private.h" #include "apr_arch_misc.h" #include "apr_arch_file_io.h" +#include "apr_dbg_win32_handles.h" #include "assert.h" #include "apr_lib.h" #include "tchar.h" @@ -35,7 +36,7 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) { static unsigned int servpack = 0; TCHAR *pservpack; - if (pservpack = oslev.szCSDVersion) { + if ((pservpack = oslev.szCSDVersion)) { while (*pservpack && !apr_isdigit(*pservpack)) { pservpack++; } @@ -213,8 +214,8 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, sbuf[1023] = '\0'; if (!fh) { (GetModuleFileNameA)(NULL, sbuf, 250); - sprintf(strchr(sbuf, '\0'), ".%d", - (GetCurrentProcessId)()); + sprintf(strchr(sbuf, '\0'), ".%u", + (unsigned int)(GetCurrentProcessId)()); fh = (CreateFileA)(sbuf, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); (InitializeCriticalSection)(&cs); @@ -223,7 +224,8 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, if (!nh) { (sprintf)(sbuf, "%p %08x %08x %s() %s:%d\n", - ha, seq, GetCurrentThreadId(), fn, fl, ln); + ha, (unsigned int)seq, (unsigned int)GetCurrentThreadId(), + fn, fl, ln); (EnterCriticalSection)(&cs); (WriteFile)(fh, sbuf, (DWORD)strlen(sbuf), &wrote, NULL); (LeaveCriticalSection)(&cs); @@ -250,7 +252,8 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, } } (sprintf)(sbuf, "%p %08x %08x %s(%s) %s:%d\n", - *hv, seq, GetCurrentThreadId(), + *hv, (unsigned int)seq, + (unsigned int)GetCurrentThreadId(), fn, dsc, fl, ln); (WriteFile)(fh, sbuf, (DWORD)strlen(sbuf), &wrote, NULL); } while (--nh); From 06aa4b1c25a3c85ba0e1cdb7621326769a80b3a4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 08:36:51 +0000 Subject: [PATCH 6638/7878] MSVC needs __attribute__ fixed, and on second thought, drop it from .h.in git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892180 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 5 +---- include/apr.hw | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index fe98bcddf93..ed5b3ce0bd8 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -56,10 +56,7 @@ * means. In particular it's missing inline and the __attribute__ * stuff. So we hack around it. PR#1613. -djg */ -#if defined(_MSC_VER) -#define APR_INLINE __inline -#define APR_HAS_INLINE 1 -#elif !defined(__GNUC__) || __GNUC__ < 2 || \ +#if !defined(__GNUC__) || __GNUC__ < 2 || \ (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\ defined(NEXT) #ifndef __attribute__ diff --git a/include/apr.hw b/include/apr.hw index d079cdce057..2470296d234 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -93,6 +93,9 @@ #if defined(_MSC_VER) #define APR_INLINE __inline #define APR_HAS_INLINE 1 +#ifndef __attribute__ +#define __attribute__(__x) +#endif #elif !defined(__GNUC__) || __GNUC__ < 2 || \ (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\ defined(NEXT) From dde747e98275c668041f92c5c983669768d4c144 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 08:40:24 +0000 Subject: [PATCH 6639/7878] Revert; we should base ssize_t on ptrdiff_t (thus, stddef.h on win32) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892181 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index 2470296d234..545521b30ea 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -360,7 +360,12 @@ typedef __int64 apr_int64_t; typedef unsigned __int64 apr_uint64_t; typedef size_t apr_size_t; -typedef ssize_t apr_ssize_t; +#if APR_HAVE_STDDEF_H +typedef ptrdiff_t apr_ssize_t; +#else +typedef int apr_ssize_t; +#endif + #if APR_HAS_LARGE_FILES typedef __int64 apr_off_t; #else From 98d8983b0005d200adaa00e932d13bdab5ab01d5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 08:58:28 +0000 Subject: [PATCH 6640/7878] Handle mswsock, ws2tcpip and winsock2 header files correctly git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892187 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +++++- include/apr.h.in | 9 +++++++++ include/apr.hw | 9 +++++++++ network_io/unix/multicast.c | 1 + 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 209cef6da3c..3981ca921b7 100644 --- a/configure.in +++ b/configure.in @@ -1224,6 +1224,7 @@ APR_FLAG_HEADERS( mach-o/dyld.h \ malloc.h \ memory.h \ + mswsock.h \ netdb.h \ osreldate.h \ poll.h \ @@ -1247,6 +1248,7 @@ APR_FLAG_HEADERS( unix.h \ windows.h \ winsock2.h \ + ws2tcpip.h \ arpa/inet.h \ kernel/OS.h \ net/errno.h \ @@ -1300,8 +1302,8 @@ AC_SUBST(direnth) AC_SUBST(fcntlh) AC_SUBST(ioh) AC_SUBST(limitsh) +AC_SUBST(mswsockh) AC_SUBST(netdbh) -AC_SUBST(sys_syslimitsh) AC_SUBST(netinet_inh) AC_SUBST(netinet_sctph) AC_SUBST(netinet_sctp_uioh) @@ -1317,6 +1319,7 @@ AC_SUBST(sys_sendfileh) AC_SUBST(sys_signalh) AC_SUBST(sys_socketh) AC_SUBST(sys_sockioh) +AC_SUBST(sys_syslimitsh) AC_SUBST(sys_typesh) AC_SUBST(sys_timeh) AC_SUBST(sys_uioh) @@ -1329,6 +1332,7 @@ AC_SUBST(pthreadh) AC_SUBST(semaphoreh) AC_SUBST(windowsh) AC_SUBST(winsock2h) +AC_SUBST(ws2tcpiph) # Checking for h_errno in if test "$netdbh" = "1"; then diff --git a/include/apr.h.in b/include/apr.h.in index ed5b3ce0bd8..a4149e150f8 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -78,6 +78,7 @@ #define APR_HAVE_FCNTL_H @fcntlh@ #define APR_HAVE_IO_H @ioh@ #define APR_HAVE_LIMITS_H @limitsh@ +#define APR_HAVE_MSWSOCK_H @mswsockh@ #define APR_HAVE_NETDB_H @netdbh@ #define APR_HAVE_NETINET_IN_H @netinet_inh@ #define APR_HAVE_NETINET_SCTP_H @netinet_sctph@ @@ -108,6 +109,7 @@ #define APR_HAVE_UNISTD_H @unistdh@ #define APR_HAVE_WINDOWS_H @windowsh@ #define APR_HAVE_WINSOCK2_H @winsock2h@ +#define APR_HAVE_WS2TCPIP_H @ws2tcpiph@ /** @} */ /** @} */ @@ -140,6 +142,13 @@ #define NOIME #endif +/* Impossible to include winsock2.h after winsock.h, while windows.h + * attempts to load winsock. Setting _WINSOCKAPI_ will dodge this. + */ +#if APR_HAVE_WINSOCK2_H +#define _WINSOCKAPI_ +#endif + #include #endif #endif diff --git a/include/apr.hw b/include/apr.hw index 545521b30ea..080e7d509c5 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -124,6 +124,7 @@ #define APR_HAVE_FCNTL_H APR_NOT_IN_WCE #define APR_HAVE_IO_H APR_NOT_IN_WCE #define APR_HAVE_LIMITS_H APR_NOT_IN_WCE +#define APR_HAVE_MSWSOCK_H APR_NOT_IN_WCE #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 #define APR_HAVE_NETINET_SCTP_H 0 @@ -154,6 +155,7 @@ #define APR_HAVE_UNISTD_H 0 #define APR_HAVE_WINDOWS_H 1 #define APR_HAVE_WINSOCK2_H APR_NOT_IN_WCE +#define APR_HAVE_WS2TCPIP_H APR_NOT_IN_WCE /** @} */ /** @} */ @@ -186,6 +188,13 @@ #define NOIME #endif +/* Impossible to include winsock2.h after winsock.h, while windows.h + * attempts to load winsock. Setting _WINSOCKAPI_ will dodge this. + */ +#if APR_HAVE_WINSOCK2_H +#define _WINSOCKAPI_ +#endif + #include #endif #endif diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index 67ab2457403..e0cb6ef39e1 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "apr.h" #include "apr_arch_networkio.h" #include "apr_network_io.h" #include "apr_support.h" From 22a0db4a0f3fe8fdde05919d401ceebbf8f122eb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 09:05:28 +0000 Subject: [PATCH 6641/7878] explicit stdlib for malloc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892188 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/timestr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 11692499149..c28f8e79984 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -18,6 +18,10 @@ #include "apr_portable.h" #include "apr_strings.h" +#if APR_HAVE_STDLIB_H +#include +#endif + APR_DECLARE_DATA const char apr_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" From a52be4b68af729f3d0a872d387790c2f48a4e6cf Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 20:46:13 +0000 Subject: [PATCH 6642/7878] This high-offset arg is signed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892378 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index ecbe7dda891..b61c7d0a300 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -265,8 +265,8 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a if (thefile->direction == 0) { // Position file pointer for writing at the offset we are logically reading from apr_off_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; - DWORD offlo = (DWORD)offset; - DWORD offhi = (DWORD)(offset >> 32); + apr_uint32_t offlo = (apr_uint32_t)offset; + apr_int32_t offhi = (apr_int32_t)(offset >> 32); if (offset != thefile->filePtr) SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); thefile->bufpos = thefile->dataRead = 0; From 6ac96a0ce8fb49ee3d3e843426a376a282a4e354 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 22:20:10 +0000 Subject: [PATCH 6643/7878] refactor for what is meant to strictly be internal functionality for 1 platform, move declarations out of .c sources git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892386 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 10 ++-- include/arch/win32/apr_arch_file_io.h | 6 +++ poll/unix/pollset.c | 70 +++++++++++++++------------ 3 files changed, 49 insertions(+), 37 deletions(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index f1ab4895e2f..dbf264589ff 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -242,7 +242,7 @@ static apr_status_t create_socket_pipe(SOCKET *rd, SOCKET *wr) apr_status_t rv = APR_SUCCESS; int ll = sizeof(la); int lc = sizeof(ca); - int bm = 1; + unsigned long bm = 1; int uid[2]; int iid[2]; @@ -370,9 +370,9 @@ static apr_status_t socket_pipe_cleanup(void *thefile) return APR_SUCCESS; } -apr_status_t apr_file_socket_pipe_create(apr_file_t **in, - apr_file_t **out, - apr_pool_t *p) +apr_status_t file_socket_pipe_create(apr_file_t **in, + apr_file_t **out, + apr_pool_t *p) { apr_status_t rv; SOCKET rd; @@ -417,7 +417,7 @@ apr_status_t apr_file_socket_pipe_create(apr_file_t **in, return rv; } -apr_status_t apr_file_socket_pipe_close(apr_file_t *file) +apr_status_t file_socket_pipe_close(apr_file_t *file) { apr_status_t stat; if (!file->pipe) diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index 4ac39e9d379..28f2c247f86 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -253,4 +253,10 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p); apr_status_t file_cleanup(void *); +apr_status_t file_socket_pipe_create(apr_file_t **in, + apr_file_t **out, + apr_pool_t *p); + +apr_status_t file_socket_pipe_close(apr_file_t *file); + #endif /* ! FILE_IO_H */ diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index 5ad70c994df..721ed9183ed 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -31,15 +31,8 @@ static apr_pollset_method_e pollset_default_method = POLLSET_DEFAULT_METHOD; #if !APR_FILES_AS_SOCKETS -#if defined (WIN32) -extern apr_status_t -apr_file_socket_pipe_create(apr_file_t **in, - apr_file_t **out, - apr_pool_t *p); - -extern apr_status_t -apr_file_socket_pipe_close(apr_file_t *file); +#ifdef WIN32 /* Create a dummy wakeup socket pipe for interrupting the poller */ @@ -48,9 +41,9 @@ static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) apr_status_t rv; apr_pollfd_t fd; - if ((rv = apr_file_socket_pipe_create(&pollset->wakeup_pipe[0], - &pollset->wakeup_pipe[1], - pollset->pool)) != APR_SUCCESS) + if ((rv = file_socket_pipe_create(&pollset->wakeup_pipe[0], + &pollset->wakeup_pipe[1], + pollset->pool)) != APR_SUCCESS) return rv; fd.reqevents = APR_POLLIN; fd.desc_type = APR_POLL_FILE; @@ -60,18 +53,33 @@ static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) return apr_pollset_add(pollset, &fd); } -#else /* !WIN32 */ +static apr_status_t close_wakeup_pipe(apr_pollset_t *pollset) +{ + /* Close both sides of the wakeup pipe */ + if (pollset->wakeup_pipe[0]) { + file_socket_pipe_close(pollset->wakeup_pipe[0]); + pollset->wakeup_pipe[0] = NULL; + } + if (pollset->wakeup_pipe[1]) { + file_socket_pipe_close(pollset->wakeup_pipe[1]); + pollset->wakeup_pipe[1] = NULL; + } +} + +#else /* !WIN32 */ + static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) { return APR_ENOTIMPL; } -static apr_status_t apr_file_socket_pipe_close(apr_file_t *file) +static apr_status_t close_wakeup_pipe(apr_pollset_t *pollset) { return APR_ENOTIMPL; } -#endif /* WIN32 */ +#endif /* !WIN32 */ + #else /* APR_FILES_AS_SOCKETS */ /* Create a dummy wakeup pipe for interrupting the poller @@ -114,7 +122,21 @@ static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) */ return apr_pollset_add(pollset, &fd); } -#endif /* !APR_FILES_AS_SOCKETS */ + +static apr_status_t close_wakeup_pipe(apr_pollset_t *pollset) +{ + /* Close both sides of the wakeup pipe */ + if (pollset->wakeup_pipe[0]) { + apr_file_close(pollset->wakeup_pipe[0]); + pollset->wakeup_pipe[0] = NULL; + } + if (pollset->wakeup_pipe[1]) { + apr_file_close(pollset->wakeup_pipe[1]); + pollset->wakeup_pipe[1] = NULL; + } +} + +#endif /* APR_FILES_AS_SOCKETS */ /* Read and discard what's ever in the wakeup pipe. */ @@ -141,23 +163,7 @@ static apr_status_t pollset_cleanup(void *p) (*pollset->provider->cleanup)(pollset); } if (pollset->flags & APR_POLLSET_WAKEABLE) { - /* Close both sides of the wakeup pipe */ - if (pollset->wakeup_pipe[0]) { -#if APR_FILES_AS_SOCKETS - apr_file_close(pollset->wakeup_pipe[0]); -#else - apr_file_socket_pipe_close(pollset->wakeup_pipe[0]); -#endif - pollset->wakeup_pipe[0] = NULL; - } - if (pollset->wakeup_pipe[1]) { -#if APR_FILES_AS_SOCKETS - apr_file_close(pollset->wakeup_pipe[1]); -#else - apr_file_socket_pipe_close(pollset->wakeup_pipe[1]); -#endif - pollset->wakeup_pipe[1] = NULL; - } + close_wakeup_pipe(pollset); } return APR_SUCCESS; From 74ac812994f146e20a0c2f0f23a41cb5b224d6c3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 22:21:11 +0000 Subject: [PATCH 6644/7878] Cleanups for various gcc warnings, conditional assignment and type errors git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892387 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 24 +++++++++++++----------- file_io/win32/filedup.c | 1 - file_io/win32/filestat.c | 12 ++++++------ file_io/win32/filesys.c | 12 ++++++------ file_io/win32/open.c | 34 +++++++++++++++++++--------------- file_io/win32/readwrite.c | 4 ++-- file_io/win32/seek.c | 4 ++-- memory/unix/apr_pools.c | 31 ++++++++++++++++++++----------- 8 files changed, 68 insertions(+), 54 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 9e16bc19746..574e7270ce1 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -76,8 +76,8 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, ELSE_WIN_OS_IS_ANSI { /* Note that we won't open a directory that is greater than MAX_PATH, - * including the trailing /* wildcard suffix. If a * won't fit, then - * neither will any other file name within the directory. + * counting the additional '/' '*' wildcard suffix. If a * won't fit + * then neither will any other file name within the directory. * The length not including the trailing '*' is stored as rootlen, to * skip over all paths which are too long. */ @@ -128,9 +128,9 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if (thedir->dirhand == INVALID_HANDLE_VALUE) { apr_status_t rv; - if (rv = utf8_to_unicode_path(wdirname, sizeof(wdirname) - / sizeof(apr_wchar_t), - thedir->dirname)) { + if ((rv = utf8_to_unicode_path(wdirname, sizeof(wdirname) + / sizeof(apr_wchar_t), + thedir->dirname))) { return rv; } eos = wcschr(wdirname, '\0'); @@ -162,8 +162,8 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, return apr_get_os_error(); } } - if (rv = unicode_to_utf8_path(thedir->name, APR_FILE_MAX * 3 + 1, - thedir->w.entry->cFileName)) + if ((rv = unicode_to_utf8_path(thedir->name, APR_FILE_MAX * 3 + 1, + thedir->w.entry->cFileName))) return rv; fname = thedir->name; } @@ -280,8 +280,9 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, { apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; - if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), path)) { + if ((rv = utf8_to_unicode_path(wpath, + sizeof(wpath) / sizeof(apr_wchar_t), + path))) { return rv; } if (!CreateDirectoryW(wpath, NULL)) { @@ -357,8 +358,9 @@ APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool) { apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; - if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), path)) { + if ((rv = utf8_to_unicode_path(wpath, + sizeof(wpath) / sizeof(apr_wchar_t), + path))) { return rv; } if (!RemoveDirectoryW(wpath)) { diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 2c9a3429130..99f2a0a0e8f 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -72,7 +72,6 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, #ifdef _WIN32_WCE return APR_ENOTIMPL; #else - DWORD stdhandle = 0; HANDLE hproc = GetCurrentProcess(); HANDLE newhand = NULL; apr_int32_t newflags; diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index f409fc247c1..f2119d07586 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -439,7 +439,7 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want * don't need to take chances while the handle is already open. */ DWORD FileType; - if (FileType = GetFileType(thefile->filehand)) { + if ((FileType = GetFileType(thefile->filehand))) { if (FileType == FILE_TYPE_CHAR) { finfo->filetype = APR_CHR; } @@ -532,8 +532,8 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, wanted &= ~finfo->valid; } - if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) - / sizeof(apr_wchar_t), fname)) + if ((rv = utf8_to_unicode_path(wfname, sizeof(wfname) + / sizeof(apr_wchar_t), fname))) return rv; if (!(wanted & APR_FINFO_NAME)) { if (!GetFileAttributesExW(wfname, GetFileExInfoStandard, @@ -718,9 +718,9 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - if (rv = utf8_to_unicode_path(wfname, - sizeof(wfname) / sizeof(wfname[0]), - fname)) + if ((rv = utf8_to_unicode_path(wfname, + sizeof(wfname) / sizeof(wfname[0]), + fname))) return rv; flags = GetFileAttributesW(wfname); } diff --git a/file_io/win32/filesys.c b/file_io/win32/filesys.c index ad31e3387ac..e812139551a 100644 --- a/file_io/win32/filesys.c +++ b/file_io/win32/filesys.c @@ -70,8 +70,8 @@ apr_status_t filepath_root_test(char *path, apr_pool_t *p) if (apr_os_level >= APR_WIN_NT) { apr_wchar_t wpath[APR_PATH_MAX]; - if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), path)) + if ((rv = utf8_to_unicode_path(wpath, sizeof(wpath) + / sizeof(apr_wchar_t), path))) return rv; rv = GetDriveTypeW(wpath); } @@ -143,8 +143,8 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) /* ???: This needs review, apparently "\\?\d:." returns "\\?\d:" * as if that is useful for anything. */ - if (rv = utf8_to_unicode_path(wroot, sizeof(wroot) - / sizeof(apr_wchar_t), root)) + if ((rv = utf8_to_unicode_path(wroot, sizeof(wroot) + / sizeof(apr_wchar_t), root))) return rv; if (!GetFullPathNameW(wroot, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored)) return apr_get_os_error(); @@ -211,8 +211,8 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath, { apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; - if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), rootpath)) + if ((rv = utf8_to_unicode_path(wpath, sizeof(wpath) + / sizeof(apr_wchar_t), rootpath))) return rv; if (!SetCurrentDirectoryW(wpath)) return apr_get_os_error(); diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 5af4dd4a50b..33909ecf153 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -86,7 +86,7 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, } } - if (rv = apr_conv_utf8_to_ucs2(srcstr, &srcremains, t, &retlen)) { + if ((rv = apr_conv_utf8_to_ucs2(srcstr, &srcremains, t, &retlen))) { return (rv == APR_INCOMPLETE) ? APR_EINVAL : rv; } if (srcremains) { @@ -127,7 +127,7 @@ apr_status_t unicode_to_utf8_path(char* retstr, apr_size_t retlen, } } - if (rv = apr_conv_ucs2_to_utf8(srcstr, &srcremains, t, &retlen)) { + if ((rv = apr_conv_ucs2_to_utf8(srcstr, &srcremains, t, &retlen))) { return rv; } if (srcremains) { @@ -169,7 +169,7 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) wfile = apr_palloc(pool, (r + n) * sizeof(apr_wchar_t)); wcscpy(wfile, wpre); d = n; - if (rv = apr_conv_utf8_to_ucs2(file, &n, wfile + r, &d)) { + if ((rv = apr_conv_utf8_to_ucs2(file, &n, wfile + r, &d))) { return NULL; } for (ch = wfile + r; *ch; ++ch) { @@ -415,8 +415,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, attributes |= FILE_FLAG_SEQUENTIAL_SCAN | FILE_FLAG_OVERLAPPED; } - if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) - / sizeof(apr_wchar_t), fname)) + if ((rv = utf8_to_unicode_path(wfname, sizeof(wfname) + / sizeof(apr_wchar_t), fname))) return rv; handle = CreateFileW(wfname, oflags, sharemode, NULL, createflags, attributes, 0); @@ -511,8 +511,8 @@ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool) { apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; - if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), path)) { + if ((rv = utf8_to_unicode_path(wpath, sizeof(wpath) + / sizeof(apr_wchar_t), path))) { return rv; } if (DeleteFileW(wpath)) @@ -536,12 +536,14 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, #if APR_HAS_UNICODE_FS apr_wchar_t wfrompath[APR_PATH_MAX], wtopath[APR_PATH_MAX]; apr_status_t rv; - if (rv = utf8_to_unicode_path(wfrompath, sizeof(wfrompath) - / sizeof(apr_wchar_t), frompath)) { + if ((rv = utf8_to_unicode_path(wfrompath, + sizeof(wfrompath) / sizeof(apr_wchar_t), + frompath))) { return rv; } - if (rv = utf8_to_unicode_path(wtopath, sizeof(wtopath) - / sizeof(apr_wchar_t), topath)) { + if ((rv = utf8_to_unicode_path(wtopath, + sizeof(wtopath) / sizeof(apr_wchar_t), + topath))) { return rv; } #ifndef _WIN32_WCE @@ -593,11 +595,13 @@ APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, apr_wchar_t wfrom_path[APR_PATH_MAX]; apr_wchar_t wto_path[APR_PATH_MAX]; - if (rv = utf8_to_unicode_path(wfrom_path, sizeof(wfrom_path) - / sizeof(apr_wchar_t), from_path)) + if ((rv = utf8_to_unicode_path(wfrom_path, + sizeof(wfrom_path) / sizeof(apr_wchar_t), + from_path))) return rv; - if (rv = utf8_to_unicode_path(wto_path, sizeof(wto_path) - / sizeof(apr_wchar_t), to_path)) + if ((rv = utf8_to_unicode_path(wto_path, + sizeof(wto_path) / sizeof(apr_wchar_t), + to_path))) return rv; if (!CreateHardLinkW(wto_path, wfrom_path, NULL)) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index b61c7d0a300..4d405c43538 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -265,8 +265,8 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a if (thefile->direction == 0) { // Position file pointer for writing at the offset we are logically reading from apr_off_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; - apr_uint32_t offlo = (apr_uint32_t)offset; - apr_int32_t offhi = (apr_int32_t)(offset >> 32); + DWORD offlo = (DWORD)offset; + LONG offhi = (LONG)(offset >> 32); if (offset != thefile->filePtr) SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); thefile->bufpos = thefile->dataRead = 0; diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 53e53dd7d0f..7a1124cf48e 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -44,7 +44,7 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) rv = APR_SUCCESS; } else { DWORD offlo = (DWORD)pos; - DWORD offhi = (DWORD)(pos >> 32); + LONG offhi = (LONG)(pos >> 32); rc = SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); if (rc == (DWORD)-1) @@ -158,7 +158,7 @@ APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *thefile, apr_off_t offset) { apr_status_t rv; DWORD offlo = (DWORD)offset; - DWORD offhi = (DWORD)(offset >> 32); + LONG offhi = (LONG)(offset >> 32); DWORD rc; rc = SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 1002555ac5b..379862ec6cb 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -533,7 +533,6 @@ static apr_file_t *file_stderr = NULL; */ static void run_cleanups(cleanup_t **c); -static void run_child_cleanups(cleanup_t **c); static void free_proc_chain(struct process_chain *procs); #if APR_POOL_DEBUG @@ -2323,6 +2322,8 @@ static void run_cleanups(cleanup_t **cref) } } +#if !defined(WIN32) && !defined(OS2) + static void run_child_cleanups(cleanup_t **cref) { cleanup_t *c = *cref; @@ -2344,20 +2345,28 @@ static void cleanup_pool_for_exec(apr_pool_t *p) APR_DECLARE(void) apr_pool_cleanup_for_exec(void) { -#if !defined(WIN32) && !defined(OS2) + cleanup_pool_for_exec(global_pool); +} + +#else /* !defined(WIN32) && !defined(OS2) */ + +APR_DECLARE(void) apr_pool_cleanup_for_exec(void) +{ /* - * Don't need to do anything on NT or OS/2, because I - * am actually going to spawn the new process - not - * exec it. All handles that are not inheritable, will - * be automajically closed. The only problem is with - * file handles that are open, but there isn't much - * I can do about that (except if the child decides - * to go out and close them + * Don't need to do anything on NT or OS/2, because + * these platforms will spawn the new process - not + * fork for exec. All handles that are not inheritable, + * will be automajically closed. The only problem is + * with file handles that are open, but there isn't + * much that can be done about that (except if the + * child decides to go out and close them, or the + * developer quits opening them shared) */ - cleanup_pool_for_exec(global_pool); -#endif /* !defined(WIN32) && !defined(OS2) */ + return; } +#endif /* !defined(WIN32) && !defined(OS2) */ + APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) { /* do nothing cleanup routine */ From c796f624c9b3b108ab7f7ec0b1721a82afa30973 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 22:37:00 +0000 Subject: [PATCH 6645/7878] gcc has this one wrong, it's never necessary to cast to introduce constness where none was required before. But the fix is harmless. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892390 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/win32/internal.c b/misc/win32/internal.c index edd7f0a0ede..03362cf5982 100644 --- a/misc/win32/internal.c +++ b/misc/win32/internal.c @@ -96,6 +96,6 @@ int apr_wastrtoastr(char const * const * *retarr, } } - *retarr = newarr; + *retarr = (char const * const *)newarr; return args; } From 21926164110f8bbc7b3b4f25a20d7045f59d7170 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 18 Dec 2009 22:54:48 +0000 Subject: [PATCH 6646/7878] Add result values git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892393 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollset.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index 721ed9183ed..53da2053adb 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -55,15 +55,19 @@ static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) static apr_status_t close_wakeup_pipe(apr_pollset_t *pollset) { + apr_status_t rv0 = APR_SUCCESS; + apr_status_t rv1 = APR_SUCCESS; + /* Close both sides of the wakeup pipe */ if (pollset->wakeup_pipe[0]) { - file_socket_pipe_close(pollset->wakeup_pipe[0]); + rv0 = file_socket_pipe_close(pollset->wakeup_pipe[0]); pollset->wakeup_pipe[0] = NULL; } if (pollset->wakeup_pipe[1]) { - file_socket_pipe_close(pollset->wakeup_pipe[1]); + rv1 = file_socket_pipe_close(pollset->wakeup_pipe[1]); pollset->wakeup_pipe[1] = NULL; } + return rv0 ? rv0 : rv1; } #else /* !WIN32 */ @@ -127,13 +131,14 @@ static apr_status_t close_wakeup_pipe(apr_pollset_t *pollset) { /* Close both sides of the wakeup pipe */ if (pollset->wakeup_pipe[0]) { - apr_file_close(pollset->wakeup_pipe[0]); + rv0 = apr_file_close(pollset->wakeup_pipe[0]); pollset->wakeup_pipe[0] = NULL; } if (pollset->wakeup_pipe[1]) { - apr_file_close(pollset->wakeup_pipe[1]); + rv1 = apr_file_close(pollset->wakeup_pipe[1]); pollset->wakeup_pipe[1] = NULL; } + return rv0 ? rv0 : rv1; } #endif /* APR_FILES_AS_SOCKETS */ From dcd33bba0fe4ac493e9facfe0e0dc13ec315fbe7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 19 Dec 2009 03:28:51 +0000 Subject: [PATCH 6647/7878] apparently rpc.h is also required for UUID support on mingw win32 headers git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892426 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/rand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 7161bfbbd60..fb65a7cf336 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -14,8 +14,9 @@ * limitations under the License. */ -#include "apr.h" #include +#include +#include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_portable.h" From bbcad2cfcb1f11d60dfe9558d20c211d7918d4ab Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 19 Dec 2009 05:22:58 +0000 Subject: [PATCH 6648/7878] Please review; Unless the granularity is 4GB, there appears to be a truncation issue using 32 bit ints on a 64 bit memory architecture platform. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892435 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 379862ec6cb..70b939ee0d9 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -39,8 +39,6 @@ #include /* for getpid */ #endif -/* XXX Temporary Cast */ -#define APR_UINT32_TRUNC_CAST apr_uint32_t /* * Magic numbers @@ -71,18 +69,18 @@ struct apr_allocator_t { /** largest used index into free[], always < MAX_INDEX */ - apr_uint32_t max_index; + apr_size_t max_index; /** Total size (in BOUNDARY_SIZE multiples) of unused memory before * blocks are given back. @see apr_allocator_max_free_set(). * @note Initialized to APR_ALLOCATOR_MAX_FREE_UNLIMITED, * which means to never give back blocks. */ - apr_uint32_t max_free_index; + apr_size_t max_free_index; /** * Memory size (in BOUNDARY_SIZE multiples) that currently must be freed * before blocks are given back. Range: 0..max_free_index */ - apr_uint32_t current_free_index; + apr_size_t current_free_index; #if APR_HAS_THREADS apr_thread_mutex_t *mutex; #endif /* APR_HAS_THREADS */ @@ -169,7 +167,7 @@ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, apr_size_t in_size) { apr_uint32_t max_free_index; - apr_uint32_t size = (APR_UINT32_TRUNC_CAST)in_size; + apr_size_t size = in_size; #if APR_HAS_THREADS apr_thread_mutex_t *mutex; @@ -329,7 +327,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) return NULL; node->next = NULL; - node->index = (APR_UINT32_TRUNC_CAST)index; + node->index = index; node->first_avail = (char *)node + APR_MEMNODE_T_SIZE; node->endp = (char *)node + size; @@ -680,7 +678,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t in_size) free_index = (APR_ALIGN(active->endp - active->first_avail + 1, BOUNDARY_SIZE) - BOUNDARY_SIZE) >> BOUNDARY_INDEX; - active->free_index = (APR_UINT32_TRUNC_CAST)free_index; + active->free_index = free_index; node = active->next; if (free_index >= node->free_index) return mem; @@ -1055,7 +1053,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) free_index = (APR_ALIGN(active->endp - active->first_avail + 1, BOUNDARY_SIZE) - BOUNDARY_SIZE) >> BOUNDARY_INDEX; - active->free_index = (APR_UINT32_TRUNC_CAST)free_index; + active->free_index = free_index; node = active->next; if (free_index < node->free_index) { do { @@ -1156,7 +1154,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) free_index = (APR_ALIGN(active->endp - active->first_avail + 1, BOUNDARY_SIZE) - BOUNDARY_SIZE) >> BOUNDARY_INDEX; - active->free_index = (APR_UINT32_TRUNC_CAST)free_index; + active->free_index = free_index; node = active->next; if (free_index >= node->free_index) From 2ab569351cbd6c57d67dc2f2d1110041bef7022c Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Mon, 21 Dec 2009 07:59:48 +0000 Subject: [PATCH 6649/7878] * Add missing declarations. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892718 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollset.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index 53da2053adb..b99cf634d43 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -129,6 +129,9 @@ static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) static apr_status_t close_wakeup_pipe(apr_pollset_t *pollset) { + apr_status_t rv0; + apr_status_t rv1; + /* Close both sides of the wakeup pipe */ if (pollset->wakeup_pipe[0]) { rv0 = apr_file_close(pollset->wakeup_pipe[0]); From 2be02d6b058f6c3a1773f8c21ba78ee8436bde2a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 18:10:42 +0000 Subject: [PATCH 6650/7878] Restore getpassword == getpass_r hack for older Novell NDKs. partial revert of r892141 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892909 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_private.h | 8 ++++++++ passwd/apr_getpass.c | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 6e614339de1..403af44175c 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -56,6 +56,14 @@ #define HAVE_WRITEV 1 #define HAVE_GETPASS_R 1 +/* + * Hack around older NDKs which have only the getpassword() function, + * a threadsafe, API-equivilant of getpass_r(). + */ +#include +#if (CURRENT_NDK_THRESHOLD < 709060000) +#define getpass_r getpassword +#endif /* 64-bit integer conversion function */ #define APR_INT64_STRFN strtoll diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 20e8738f727..48aef1c0c6c 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -34,9 +34,13 @@ #include #endif #if APR_HAVE_CONIO_H +#ifdef _MSC_VER #pragma warning(disable: 4032) #include #pragma warning(default: 4032) +#else +#include +#endif #endif #if APR_HAVE_STDLIB_H #include @@ -75,9 +79,9 @@ #if !defined(HAVE_GETPASS) && !defined(HAVE_GETPASSPHRASE) && !defined(HAVE_GETPASS_R) -/* MPE, Win32, NetWare and BeOS all lack a native getpass() */ +/* MPE, Win32, and BeOS all lack a native getpass() */ -#if !defined(HAVE_TERMIOS_H) && !defined(WIN32) && !defined(NETWARE) +#if !defined(HAVE_TERMIOS_H) && !defined(WIN32) /* * MPE lacks getpass() and a way to suppress stdin echo. So for now, just * issue the prompt and read the results with echo. (Ugh). From 151255d7b09c211348719fd773c95aec64ae32eb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 18:19:43 +0000 Subject: [PATCH 6651/7878] Ensure all platforms are consistent in including apr.h within apr_private.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892915 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 +++++ include/arch/netware/apr_private.h | 10 ++++++++-- include/arch/win32/apr_private.h | 6 +++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 3981ca921b7..bb1ac1e1ee2 100644 --- a/configure.in +++ b/configure.in @@ -38,6 +38,11 @@ dnl Hard-coded top of apr_private.h: AH_TOP([ #ifndef APR_PRIVATE_H #define APR_PRIVATE_H + +/* Pick up publicly advertised headers and symbols before the + * APR internal private headers and symbols + */ +#include ]) dnl Hard-coded inclusion at the tail end of apr_private.h: diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 403af44175c..35644191437 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -23,6 +23,14 @@ #ifndef APR_PRIVATE_H #define APR_PRIVATE_H +/* Pick up publicly advertised headers and symbols before the + * APR internal private headers and symbols + */ +#include + +/* Pick up privately consumed headers */ +#include + /* Use this section to define all of the HAVE_FOO_H * that are required to build properly. */ @@ -60,7 +68,6 @@ * Hack around older NDKs which have only the getpassword() function, * a threadsafe, API-equivilant of getpass_r(). */ -#include #if (CURRENT_NDK_THRESHOLD < 709060000) #define getpass_r getpassword #endif @@ -196,7 +203,6 @@ void* getStatCache(); /* * check for newer NDKs which use now correctly 'const char*' with iconv. */ -#include #if (CURRENT_NDK_THRESHOLD >= 705110000) #define APU_ICONV_INBUF_CONST #endif diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index cad8e328f7b..96814ec5a80 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -23,10 +23,10 @@ #ifndef APR_PRIVATE_H #define APR_PRIVATE_H -/* Include the public APR symbols, include our idea of the 'right' - * subset of the Windows.h header. This saves us repetition. +/* Pick up publicly advertised headers and symbols before the + * APR internal private headers and symbols */ -#include "apr.h" +#include /* * Add a _very_few_ declarations missing from the restricted set of headers From 0d6175531037cd52efebdc8336cd3ed6fe563256 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 21:11:29 +0000 Subject: [PATCH 6652/7878] Comment to mirror unix comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892978 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/apr.hw b/include/apr.hw index 080e7d509c5..c8585dbf0d3 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -579,6 +579,11 @@ typedef apr_uint32_t apr_uintptr_t; */ #define APU_MODULE_DECLARE_DATA APR_MODULE_DECLARE_DATA +/* Define APR_SSIZE_T_FMT. + * If ssize_t is an integer we define it to be "d", + * if ssize_t is a long int we define it to be "ld", + * if ssize_t is 64-bit, we define it to be msvc specific "I64d" + */ #ifdef WIN64 #define APR_SSIZE_T_FMT "I64d" #define APR_SIZE_T_FMT "I64u" From 1629f4fbd127e1c3934a15243c17fa88600ebf7c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 21:25:45 +0000 Subject: [PATCH 6653/7878] Refactor away apu_version legacy cruft git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892984 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 8 ++--- dbd/apr_dbd.c | 5 ++- dbd/apr_dbd_mysql.c | 1 - dbd/apr_dbd_odbc.c | 16 ++++----- dbm/apr_dbm.c | 6 ++-- include/apu_version.h | 79 ++++++++++--------------------------------- 6 files changed, 35 insertions(+), 80 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 31a8cf0b80a..dcb0c92d4c1 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, 3 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * @@ -31,7 +31,7 @@ #include "apu_internal.h" #include "apr_crypto_internal.h" #include "apr_crypto.h" -#include "apu_version.h" +#include "apr_version.h" static apr_hash_t *drivers = NULL; @@ -135,9 +135,9 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver(apr_pool_t *pool, const char *na apr_snprintf(modname, sizeof(modname), "crypto%s.nlm", name); #elif defined(WIN32) apr_snprintf(modname, sizeof(modname), - "apr_crypto_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", name); + "apr_crypto_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll", name); #else - apr_snprintf(modname, sizeof(modname), "apr_crypto_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".so", name); + apr_snprintf(modname, sizeof(modname), "apr_crypto_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".so", name); #endif apr_snprintf(symname, sizeof(symname), "apr_crypto_%s_driver", name); rv = apu_dso_load(&dso, &symbol, modname, symname, pool); diff --git a/dbd/apr_dbd.c b/dbd/apr_dbd.c index 65687032043..9d273810094 100644 --- a/dbd/apr_dbd.c +++ b/dbd/apr_dbd.c @@ -30,7 +30,6 @@ #include "apu_internal.h" #include "apr_dbd_internal.h" #include "apr_dbd.h" -#include "apu_version.h" static apr_hash_t *drivers = NULL; static apr_uint32_t initialised = 0, in_init = 1; @@ -185,10 +184,10 @@ APR_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name, apr_snprintf(modname, sizeof(modname), "dbd%s.nlm", name); #elif defined(WIN32) apr_snprintf(modname, sizeof(modname), - "apr_dbd_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", name); + "apr_dbd_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll", name); #else apr_snprintf(modname, sizeof(modname), - "apr_dbd_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".so", name); + "apr_dbd_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".so", name); #endif apr_snprintf(symname, sizeof(symname), "apr_dbd_%s_driver", name); rv = apu_dso_load(NULL, &symbol, modname, symname, pool); diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c index fdd14f6f29e..7cad22d6f96 100644 --- a/dbd/apr_dbd_mysql.c +++ b/dbd/apr_dbd_mysql.c @@ -18,7 +18,6 @@ #if APU_HAVE_MYSQL -#include "apu_version.h" #include "apr_private.h" #include diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index 552ecbf932a..66e8bff1345 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -26,7 +26,7 @@ #include "apr_file_info.h" #include "apr_dbd_internal.h" #include "apr_thread_proc.h" -#include "apu_version.h" +#include "apr_version.h" #include @@ -949,18 +949,18 @@ static void odbc_init(apr_pool_t *pool) { SQLRETURN rc; char *step; - apr_version_t apuver; + apr_version_t aprver; - apu_version(&apuver); - if (apuver.major != DRIVER_APU_VERSION_MAJOR - || apuver.minor != DRIVER_APU_VERSION_MINOR) { + apr_version(&aprver); + if (aprver.major != DRIVER_APR_VERSION_MAJOR + || aprver.minor != DRIVER_APR_VERSION_MINOR) { apr_file_t *se; apr_file_open_stderr(&se, pool); apr_file_printf(se, "Incorrect " ODBC_DRIVER_STRING " dbd driver version\n" - "Attempt to load APU version %d.%d driver with APU version %d.%d\n", - DRIVER_APU_VERSION_MAJOR, DRIVER_APU_VERSION_MINOR, - apuver.major, apuver.minor); + "Attempt to load APR version %d.%d driver with APR version %d.%d\n", + DRIVER_APR_VERSION_MAJOR, DRIVER_APR_VERSION_MINOR, + aprver.major, aprver.minor); abort(); } diff --git a/dbm/apr_dbm.c b/dbm/apr_dbm.c index 2e24106cb40..60ec6c5c511 100644 --- a/dbm/apr_dbm.c +++ b/dbm/apr_dbm.c @@ -29,7 +29,7 @@ #include "apu.h" #include "apr_private.h" #include "apu_internal.h" -#include "apu_version.h" +#include "apr_version.h" #include "apr_dbm_private.h" #include "apu_select_dbm.h" #include "apr_dbm.h" @@ -164,10 +164,10 @@ static apr_status_t dbm_open_type(apr_dbm_type_t const* * vtable, apr_snprintf(modname, sizeof(modname), "dbm%s.nlm", type); #elif defined(WIN32) apr_snprintf(modname, sizeof(modname), - "apr_dbm_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", type); + "apr_dbm_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll", type); #else apr_snprintf(modname, sizeof(modname), - "apr_dbm_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".so", type); + "apr_dbm_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".so", type); #endif apr_snprintf(symname, sizeof(symname), "apr_dbm_type_%s", type); diff --git a/include/apu_version.h b/include/apu_version.h index 66f3e818d45..30542257557 100644 --- a/include/apu_version.h +++ b/include/apu_version.h @@ -38,36 +38,48 @@ */ +#include "apr_version.h" + /* The numeric compile-time version constants. These constants are the - * authoritative version numbers for APU. + * authoritative version numbers for APU. This file remains as strictly + * a compatibility stub. */ /** major version * Major API changes that could cause compatibility problems for older * programs such as structure size changes. No binary compatibility is * possible across a change in the major version. + * In 2.0, for legacy support, this is an identity of the APR version. + * @deprecated @see APR_MAJOR_VERSION */ -#define APU_MAJOR_VERSION 2 +#define APU_MAJOR_VERSION APR_MAJOR_VERSION /** minor version * Minor API changes that do not cause binary compatibility problems. * Reset to 0 when upgrading APU_MAJOR_VERSION + * In 2.0, for legacy support, this is an identity of the APR version. + * @deprecated @see APR_MINOR_VERSION */ -#define APU_MINOR_VERSION 0 +#define APU_MINOR_VERSION APR_MINOR_VERSION /** patch level * The Patch Level never includes API changes, simply bug fixes. * Reset to 0 when upgrading APR_MINOR_VERSION + * In 2.0, for legacy support, this is an identity of the APR version. + * @deprecated @see APR_PATCH_VERSION */ -#define APU_PATCH_VERSION 0 +#define APU_PATCH_VERSION APR_PATCH_VERSION /** * The symbol APU_IS_DEV_VERSION is only defined for internal, * "development" copies of APU. It is undefined for released versions * of APU. + * In 2.0, for legacy support, this is an identity of the APR version. + * @deprecated @see APR_IS_DEV_VERSION */ -#define APU_IS_DEV_VERSION - +#ifdef APR_IS_DEV_VERSION +# define APU_IS_DEV_VERSION +#endif #if defined(APU_IS_DEV_VERSION) || defined(DOXYGEN) /** Internal: string form of the "is dev" flag */ @@ -76,59 +88,4 @@ #define APU_IS_DEV_STRING "" #endif - -#ifndef APU_STRINGIFY -/** Properly quote a value as a string in the C preprocessor */ -#define APU_STRINGIFY(n) APU_STRINGIFY_HELPER(n) -/** Helper macro for APU_STRINGIFY */ -#define APU_STRINGIFY_HELPER(n) #n -#endif - -/** The formatted string of APU's version */ -#define APU_VERSION_STRING \ - APU_STRINGIFY(APU_MAJOR_VERSION) "." \ - APU_STRINGIFY(APU_MINOR_VERSION) "." \ - APU_STRINGIFY(APU_PATCH_VERSION) \ - APU_IS_DEV_STRING - -/** An alternative formatted string of APR's version */ -/* macro for Win32 .rc files using numeric csv representation */ -#define APU_VERSION_STRING_CSV APU_MAJOR_VERSION ##, \ - ##APU_MINOR_VERSION ##, \ - ##APU_PATCH_VERSION - - -#ifndef APU_VERSION_ONLY - -/* The C language API to access the version at run time, - * as opposed to compile time. APU_VERSION_ONLY may be defined - * externally when preprocessing apr_version.h to obtain strictly - * the C Preprocessor macro declarations. - */ - -#include "apr_version.h" - -#include "apu.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Return APR-util's version information information in a numeric form. - * - * @param pvsn Pointer to a version structure for returning the version - * information. - */ -APR_DECLARE(void) apu_version(apr_version_t *pvsn); - -/** Return APU's version information as a string. */ -APR_DECLARE(const char *) apu_version_string(void); - -#ifdef __cplusplus -} -#endif - -#endif /* ndef APU_VERSION_ONLY */ - #endif /* ndef APU_VERSION_H */ From 0394f0d59f864f2b80b4991ac8ac843d7f0d10b8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 21:26:22 +0000 Subject: [PATCH 6654/7878] Refactor away apu_version legacy cruft git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892985 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 - apr.dsp | 4 ---- build/nw_export.inc | 1 - libapr.dsp | 4 ---- util-misc/apu_dso.c | 1 - util-misc/apu_version.c | 37 ------------------------------------- 6 files changed, 48 deletions(-) delete mode 100644 util-misc/apu_version.c diff --git a/NWGNUmakefile b/NWGNUmakefile index 68d6a72edf2..76847a0d7c9 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -342,7 +342,6 @@ FILES_lib_objs = \ $(OBJDIR)/apr_thread_pool.o \ $(OBJDIR)/apr_uri.o \ $(OBJDIR)/apu_dso.o \ - $(OBJDIR)/apu_version.o \ $(OBJDIR)/buffer.o \ $(OBJDIR)/charset.o \ $(OBJDIR)/common.o \ diff --git a/apr.dsp b/apr.dsp index f327c0b6ce3..1ff00c5d44d 100644 --- a/apr.dsp +++ b/apr.dsp @@ -750,10 +750,6 @@ SOURCE=.\util-misc\apr_rmm.c SOURCE=.\util-misc\apr_thread_pool.c # End Source File -# Begin Source File - -SOURCE=.\util-misc\apu_version.c -# End Source File # End Group # Begin Group "xlate" diff --git a/build/nw_export.inc b/build/nw_export.inc index 66f45fd8a77..bf55ddedd7a 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -74,5 +74,4 @@ #include "apr_want.h" #include "apr_xlate.h" #include "apr_xml.h" -#include "apu_version.h" #include "apu_want.h" diff --git a/libapr.dsp b/libapr.dsp index cc37cfbacf7..db84e1c736a 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -785,10 +785,6 @@ SOURCE=.\util-misc\apr_rmm.c SOURCE=.\util-misc\apr_thread_pool.c # End Source File -# Begin Source File - -SOURCE=.\util-misc\apu_version.c -# End Source File # End Group # Begin Group "xlate" diff --git a/util-misc/apu_dso.c b/util-misc/apu_dso.c index a8607c1177f..a826b83ec1a 100644 --- a/util-misc/apu_dso.c +++ b/util-misc/apu_dso.c @@ -29,7 +29,6 @@ #include "apr_atomic.h" #include "apu_internal.h" -#include "apu_version.h" #if APR_HAVE_MODULAR_DSO diff --git a/util-misc/apu_version.c b/util-misc/apu_version.c deleted file mode 100644 index 033a1eefbb7..00000000000 --- a/util-misc/apu_version.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "apr_general.h" /* for APR_STRINGIFY */ - -#include "apu.h" -#include "apu_version.h" - -APR_DECLARE(void) apu_version(apr_version_t *pvsn) -{ - pvsn->major = APU_MAJOR_VERSION; - pvsn->minor = APU_MINOR_VERSION; - pvsn->patch = APU_PATCH_VERSION; -#ifdef APU_IS_DEV_VERSION - pvsn->is_dev = 1; -#else - pvsn->is_dev = 0; -#endif -} - -APR_DECLARE(const char *) apu_version_string(void) -{ - return APU_VERSION_STRING; -} From 288ad38e47c7e4f18b834a80f52dbe036e1e9a1a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 21:34:40 +0000 Subject: [PATCH 6655/7878] Clean up inclusion of windows sub-headers, following apr.h always git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892989 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/rand.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/win32/rand.c b/misc/win32/rand.c index fb65a7cf336..cb5a6537fb7 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -14,9 +14,9 @@ * limitations under the License. */ -#include -#include #include "apr.h" +#include +#include #include "apr_private.h" #include "apr_general.h" #include "apr_portable.h" From 36683ccdf3fd5502a024adf63afc79d7c31c2cfb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 21:43:11 +0000 Subject: [PATCH 6656/7878] Refactor away apu_version legacy cruft git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892994 13f79535-47bb-0310-9956-ffa450edef68 --- ldap/apr_ldap_stub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ldap/apr_ldap_stub.c b/ldap/apr_ldap_stub.c index 93fbcfefb0d..929351b0c0b 100644 --- a/ldap/apr_ldap_stub.c +++ b/ldap/apr_ldap_stub.c @@ -23,7 +23,7 @@ #include "apr_errno.h" #include "apr_pools.h" #include "apr_strings.h" -#include "apu_version.h" +#include "apr_version.h" #if APR_HAS_LDAP @@ -46,9 +46,9 @@ static apr_status_t load_ldap(apr_pool_t *pool) } #if defined(WIN32) - modname = "apr_ldap-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll"; + modname = "apr_ldap-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll"; #else - modname = "apr_ldap-" APU_STRINGIFY(APU_MAJOR_VERSION) ".so"; + modname = "apr_ldap-" APR_STRINGIFY(APR_MAJOR_VERSION) ".so"; #endif rv = apu_dso_load(NULL, &symbol, modname, "apr__ldap_fns", pool); if (rv == APR_SUCCESS) { From 6b23c31f439d9916457f8d67ffd6569a4624267d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 21:50:57 +0000 Subject: [PATCH 6657/7878] Don't include include/arch/ root git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@893000 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 8 ++++---- libapr.dsp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apr.dsp b/apr.dsp index 1ff00c5d44d..4dd9e295a17 100644 --- a/apr.dsp +++ b/apr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -67,7 +67,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /EHsc /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -90,7 +90,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "x64\LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -114,7 +114,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /EHsc /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/libapr.dsp b/libapr.dsp index db84e1c736a..bf5b1dc67fe 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -77,7 +77,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -109,7 +109,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -141,7 +141,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" From f8fb7eb171b3f4d066d84ee35e96092000e3702c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 22:09:06 +0000 Subject: [PATCH 6658/7878] revert typo from r892984 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@893012 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 2 +- test/Makefile.win | 86 +++++++++++++++++++++++++++++++++------------ 2 files changed, 65 insertions(+), 23 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index dcb0c92d4c1..2369f628206 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, 3 2.0 + * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * diff --git a/test/Makefile.win b/test/Makefile.win index 2e7842f162d..59da1d185a5 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -77,28 +77,70 @@ TESTALL_COMPONENTS = \ $(OUTDIR)\testshmconsumer.exe \ $(OUTDIR)\globalmutexchild.exe -ALL_TESTS = $(INTDIR)\testutil.obj $(INTDIR)\testtime.obj \ - $(INTDIR)\teststr.obj $(INTDIR)\testvsn.obj \ - $(INTDIR)\testipsub.obj $(INTDIR)\testmmap.obj \ - $(INTDIR)\testud.obj $(INTDIR)\testtable.obj \ - $(INTDIR)\testsleep.obj $(INTDIR)\testpools.obj \ - $(INTDIR)\testfmt.obj $(INTDIR)\testfile.obj \ - $(INTDIR)\testdir.obj $(INTDIR)\testfileinfo.obj \ - $(INTDIR)\testrand.obj $(INTDIR)\testdso.obj \ - $(INTDIR)\testoc.obj $(INTDIR)\testdup.obj \ - $(INTDIR)\testsockets.obj $(INTDIR)\testproc.obj \ - $(INTDIR)\testpoll.obj $(INTDIR)\testlock.obj \ - $(INTDIR)\testsockopt.obj $(INTDIR)\testpipe.obj \ - $(INTDIR)\testthread.obj $(INTDIR)\testhash.obj \ - $(INTDIR)\testargs.obj $(INTDIR)\testnames.obj \ - $(INTDIR)\testuser.obj $(INTDIR)\testpath.obj \ - $(INTDIR)\testenv.obj $(INTDIR)\testprocmutex.obj \ - $(INTDIR)\testfnmatch.obj $(INTDIR)\testatomic.obj \ - $(INTDIR)\testflock.obj $(INTDIR)\testshm.obj \ - $(INTDIR)\testsock.obj $(INTDIR)\testglobalmutex.obj \ - $(INTDIR)\teststrnatcmp.obj $(INTDIR)\testfilecopy.obj \ - $(INTDIR)\testtemp.obj $(INTDIR)\testlfs.obj \ - $(INTDIR)\testcond.obj +ALL_TESTS = \ + $(INTDIR)\testargs.obj \ + $(INTDIR)\testatomic.obj \ + $(INTDIR)\testbase64.obj \ + $(INTDIR)\testbuckets.obj \ + $(INTDIR)\testcond.obj \ + $(INTDIR)\testcrypto.obj \ + $(INTDIR)\testdate.obj \ + $(INTDIR)\testdbd.obj \ + $(INTDIR)\testdbm.obj \ + $(INTDIR)\testdir.obj \ + $(INTDIR)\testdso.obj \ + $(INTDIR)\testdup.obj \ + $(INTDIR)\testenv.obj \ + $(INTDIR)\testfile.obj \ + $(INTDIR)\testfilecopy.obj \ + $(INTDIR)\testfileinfo.obj \ + $(INTDIR)\testflock.obj \ + $(INTDIR)\testfmt.obj \ + $(INTDIR)\testfnmatch.obj \ + $(INTDIR)\testglobalmutex.obj \ + $(INTDIR)\testhash.obj \ + $(INTDIR)\testhooks.obj \ + $(INTDIR)\testipsub.obj \ + $(INTDIR)\testldap.obj \ + $(INTDIR)\testlfs.obj \ + $(INTDIR)\testlock.obj \ + $(INTDIR)\testmd4.obj \ + $(INTDIR)\testmd5.obj \ + $(INTDIR)\testmemcache.obj \ + $(INTDIR)\testmmap.obj \ + $(INTDIR)\testnames.obj \ + $(INTDIR)\testoc.obj \ + $(INTDIR)\testpass.obj \ + $(INTDIR)\testpath.obj \ + $(INTDIR)\testpipe.obj \ + $(INTDIR)\testpoll.obj \ + $(INTDIR)\testpools.obj \ + $(INTDIR)\testproc.obj \ + $(INTDIR)\testprocmutex.obj \ + $(INTDIR)\testqueue.obj \ + $(INTDIR)\testrand.obj \ + $(INTDIR)\testreslist.obj \ + $(INTDIR)\testrmm.obj \ + $(INTDIR)\testshm.obj \ + $(INTDIR)\testsleep.obj \ + $(INTDIR)\testsock.obj \ + $(INTDIR)\testsockets.obj \ + $(INTDIR)\testsockopt.obj \ + $(INTDIR)\teststr.obj \ + $(INTDIR)\testmatch.obj \ + $(INTDIR)\teststrnatcmp.obj \ + $(INTDIR)\testtable.obj \ + $(INTDIR)\testtemp.obj \ + $(INTDIR)\testthread.obj \ + $(INTDIR)\testtime.obj \ + $(INTDIR)\testud.obj\ + $(INTDIR)\testuri.obj \ + $(INTDIR)\testuser.obj \ + $(INTDIR)\testutil.obj \ + $(INTDIR)\testuuid.obj \ + $(INTDIR)\testvsn.obj \ + $(INTDIR)\testxlate.obj \ + $(INTDIR)\testxml.obj CLEAN_DATA = testfile.tmp lfstests\large.bin \ data\testputs.txt data\testbigfprintf.dat \ From 11b818af13b4a6162f9fb1f18b225a4dcd5bea17 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 22:28:55 +0000 Subject: [PATCH 6659/7878] Complete transitions from -1 to -2 for win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@893015 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprapp.dsp | 65 ++++++--------------------------------------- build/libaprapp.dsp | 65 ++++++--------------------------------------- test/Makefile.win | 10 +++---- 3 files changed, 21 insertions(+), 119 deletions(-) diff --git a/build/aprapp.dsp b/build/aprapp.dsp index b8b08ebd057..7285d0afb8c 100644 --- a/build/aprapp.dsp +++ b/build/aprapp.dsp @@ -19,8 +19,6 @@ CFG=aprapp - Win32 Release !MESSAGE !MESSAGE "aprapp - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "aprapp - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "aprapp - Win32 Release9x" (based on "Win32 (x86) Static Library") -!MESSAGE "aprapp - Win32 Debug9x" (based on "Win32 (x86) Static Library") !MESSAGE "aprapp - x64 Release" (based on "Win32 (x86) Static Library") !MESSAGE "aprapp - x64 Debug" (based on "Win32 (x86) Static Library") !MESSAGE @@ -45,7 +43,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-1" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-2" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -53,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\LibR\aprapp-1.lib" +# ADD LIB32 /nologo /out:"..\LibR\aprapp-2.lib" !ELSEIF "$(CFG)" == "aprapp - Win32 Debug" @@ -69,7 +67,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-1" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-2" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -77,54 +75,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\LibD\aprapp-1.lib" - -!ELSEIF "$(CFG)" == "aprapp - Win32 Release9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\9x\LibR" -# PROP BASE Intermediate_Dir "9x\LibR" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\9x\LibR" -# PROP Intermediate_Dir "9x\LibR" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-1" /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\9x\LibR\aprapp-1.lib" - -!ELSEIF "$(CFG)" == "aprapp - Win32 Debug9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\9x\LibD" -# PROP BASE Intermediate_Dir "9x\LibD" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\9x\LibD" -# PROP Intermediate_Dir "9x\LibD" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-1" /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\9x\LibD\aprapp-1.lib" +# ADD LIB32 /nologo /out:"..\LibD\aprapp-2.lib" !ELSEIF "$(CFG)" == "aprapp - x64 Release" @@ -139,7 +90,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "x64\LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-1" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-2" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -147,7 +98,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\x64\LibR\aprapp-1.lib" +# ADD LIB32 /nologo /out:"..\x64\LibR\aprapp-2.lib" !ELSEIF "$(CFG)" == "aprapp - x64 Debug" @@ -163,7 +114,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-1" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D APR_APP /D "APR_DECLARE_STATIC" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprapp-2" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -171,7 +122,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\x64\LibD\aprapp-1.lib" +# ADD LIB32 /nologo /out:"..\x64\LibD\aprapp-2.lib" !ENDIF diff --git a/build/libaprapp.dsp b/build/libaprapp.dsp index 2a9506dc90e..6a549d237f5 100644 --- a/build/libaprapp.dsp +++ b/build/libaprapp.dsp @@ -19,8 +19,6 @@ CFG=libaprapp - Win32 Release !MESSAGE !MESSAGE "libaprapp - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "libaprapp - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "libaprapp - Win32 Release9x" (based on "Win32 (x86) Static Library") -!MESSAGE "libaprapp - Win32 Debug9x" (based on "Win32 (x86) Static Library") !MESSAGE "libaprapp - x64 Release" (based on "Win32 (x86) Static Library") !MESSAGE "libaprapp - x64 Debug" (based on "Win32 (x86) Static Library") !MESSAGE @@ -45,7 +43,7 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-1" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-2" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -53,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\Release\libaprapp-1.lib" +# ADD LIB32 /nologo /out:"..\Release\libaprapp-2.lib" !ELSEIF "$(CFG)" == "libaprapp - Win32 Debug" @@ -69,7 +67,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-1" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-2" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -77,54 +75,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\Debug\libaprapp-1.lib" - -!ELSEIF "$(CFG)" == "libaprapp - Win32 Release9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\9x\Release" -# PROP BASE Intermediate_Dir "9x\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\9x\Release" -# PROP Intermediate_Dir "9x\Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-1" /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\9x\Release\libaprapp-1.lib" - -!ELSEIF "$(CFG)" == "libaprapp - Win32 Debug9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\9x\Debug" -# PROP BASE Intermediate_Dir "9x\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\9x\Debug" -# PROP Intermediate_Dir "9x\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-1" /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\9x\Debug\libaprapp-1.lib" +# ADD LIB32 /nologo /out:"..\Debug\libaprapp-2.lib" !ELSEIF "$(CFG)" == "libaprapp - x64 Release" @@ -139,7 +90,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "x64\Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-1" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "NDEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-2" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -147,7 +98,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\x64\Release\libaprapp-1.lib" +# ADD LIB32 /nologo /out:"..\x64\Release\libaprapp-2.lib" !ELSEIF "$(CFG)" == "libaprapp - x64 Debug" @@ -163,7 +114,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-1" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "../include" /I "../include/arch" /I "../include/arch/win32" /I "../include/arch/unix" /D "_DEBUG" /D "WINNT" /D "WIN32" /D "_WINDOWS" /D "APR_APP" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\libaprapp-2" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe @@ -171,7 +122,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\x64\Debug\libaprapp-1.lib" +# ADD LIB32 /nologo /out:"..\x64\Debug\libaprapp-2.lib" !ENDIF diff --git a/test/Makefile.win b/test/Makefile.win index 59da1d185a5..112113730ce 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -15,7 +15,7 @@ # Windows Specific; # MODEL # dynamic or static - refers to which set of bindings are desired -# and controls which libraries (apr-1 or libapr-1) will be linked. +# and controls which libraries (apr-2 or libapr-2) will be linked. # OUTDIR # the library path of the libraries, and also the path within test/ # where all of the tests for that library will be built @@ -164,12 +164,12 @@ CL = cl.exe LD = link.exe !IF "$(MODEL)" == "static" -LOCAL_LIB= ..\$(OUTDIR)\apr-1.lib -APP_LIB= ..\$(OUTDIR)\aprapp-1.lib +LOCAL_LIB= ..\$(OUTDIR)\apr-2.lib +APP_LIB= ..\$(OUTDIR)\aprapp-2.lib STATIC_CFLAGS = /D APR_DECLARE_STATIC !ELSE -LOCAL_LIB= ..\$(OUTDIR)\libapr-1.lib -APP_LIB= ..\$(OUTDIR)\libaprapp-1.lib +LOCAL_LIB= ..\$(OUTDIR)\libapr-2.lib +APP_LIB= ..\$(OUTDIR)\libaprapp-2.lib STATIC_CFLAGS = !ENDIF From d1266b7bad26d165772d54ace1308c45a7f437f5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 22:29:06 +0000 Subject: [PATCH 6660/7878] Complete transitions from -1 to -2 for win32 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@893016 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.win | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile.win b/Makefile.win index b2c2f07c463..66fa36c4a9a 100644 --- a/Makefile.win +++ b/Makefile.win @@ -166,16 +166,16 @@ install: copy LICENSE "$(PREFIX)\LICENSE.txt" <.y copy NOTICE "$(PREFIX)\NOTICE.txt" <.y xcopy include\*.h "$(PREFIX)\include\" /d < .a - copy $(LIBSOSPATH)\apr-1.lib "$(PREFIX)\lib\" <.y - copy $(LIBSOSPATH)\apr-1.pdb "$(PREFIX)\lib\" <.y - copy $(LIBSOSPATH)\aprapp-1.lib "$(PREFIX)\lib\" <.y - copy $(LIBSOSPATH)\aprapp-1.pdb "$(PREFIX)\lib\" <.y - copy $(LIBSOSPATH)\libaprapp-1.lib "$(PREFIX)\lib\" <.y - copy $(LIBSOSPATH)\libaprapp-1.pdb "$(PREFIX)\lib\" <.y - copy $(ARCHOSPATH)\libapr-1.lib "$(PREFIX)\lib\" <.y - copy $(ARCHOSPATH)\libapr-1.exp "$(PREFIX)\lib\" <.y - copy $(ARCHOSPATH)\libapr-1.dll "$(PREFIX)\bin\" <.y - copy $(ARCHOSPATH)\libapr-1.pdb "$(PREFIX)\bin\" <.y + copy $(LIBSOSPATH)\apr-2.lib "$(PREFIX)\lib\" <.y + copy $(LIBSOSPATH)\apr-2.pdb "$(PREFIX)\lib\" <.y + copy $(LIBSOSPATH)\aprapp-2.lib "$(PREFIX)\lib\" <.y + copy $(LIBSOSPATH)\aprapp-2.pdb "$(PREFIX)\lib\" <.y + copy $(LIBSOSPATH)\libaprapp-2.lib "$(PREFIX)\lib\" <.y + copy $(LIBSOSPATH)\libaprapp-2.pdb "$(PREFIX)\lib\" <.y + copy $(ARCHOSPATH)\libapr-2.lib "$(PREFIX)\lib\" <.y + copy $(ARCHOSPATH)\libapr-2.exp "$(PREFIX)\lib\" <.y + copy $(ARCHOSPATH)\libapr-2.dll "$(PREFIX)\bin\" <.y + copy $(ARCHOSPATH)\libapr-2.pdb "$(PREFIX)\bin\" <.y del .y del .a From 76db89d8818a6dbdd5456982bbf0e5d88c2a0def Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 22:46:24 +0000 Subject: [PATCH 6661/7878] Complete transitions from -1 to -2 for win32, and removal of 9x git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@893022 13f79535-47bb-0310-9956-ffa450edef68 --- build/aprapp.dsp | 2 -- build/libaprapp.dsp | 2 -- build/preaprapp.dsp | 48 ------------------------------------------ build/prelibaprapp.dsp | 48 ------------------------------------------ 4 files changed, 100 deletions(-) diff --git a/build/aprapp.dsp b/build/aprapp.dsp index 7285d0afb8c..30fcc1d56bb 100644 --- a/build/aprapp.dsp +++ b/build/aprapp.dsp @@ -130,8 +130,6 @@ LIB32=link.exe -lib # Name "aprapp - Win32 Release" # Name "aprapp - Win32 Debug" -# Name "aprapp - Win32 Release9x" -# Name "aprapp - Win32 Debug9x" # Name "aprapp - x64 Release" # Name "aprapp - x64 Debug" # Begin Source File diff --git a/build/libaprapp.dsp b/build/libaprapp.dsp index 6a549d237f5..2e3d2001331 100644 --- a/build/libaprapp.dsp +++ b/build/libaprapp.dsp @@ -130,8 +130,6 @@ LIB32=link.exe -lib # Name "libaprapp - Win32 Release" # Name "libaprapp - Win32 Debug" -# Name "libaprapp - Win32 Release9x" -# Name "libaprapp - Win32 Debug9x" # Name "libaprapp - x64 Release" # Name "libaprapp - x64 Debug" # Begin Source File diff --git a/build/preaprapp.dsp b/build/preaprapp.dsp index caa95dfab75..b17aa7b0786 100644 --- a/build/preaprapp.dsp +++ b/build/preaprapp.dsp @@ -19,8 +19,6 @@ CFG=preaprapp - Win32 Release !MESSAGE !MESSAGE "preaprapp - Win32 Release" (based on "Win32 (x86) External Target") !MESSAGE "preaprapp - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE "preaprapp - Win32 Release9x" (based on "Win32 (x86) External Target") -!MESSAGE "preaprapp - Win32 Debug9x" (based on "Win32 (x86) External Target") !MESSAGE "preaprapp - x64 Release" (based on "Win32 (x86) External Target") !MESSAGE "preaprapp - x64 Debug" (based on "Win32 (x86) External Target") !MESSAGE @@ -70,46 +68,6 @@ CFG=preaprapp - Win32 Release # PROP Bsc_Name "" # PROP Target_Dir "" -!ELSEIF "$(CFG)" == "preaprapp - Win32 Release9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "preaprapp.exe" -# PROP BASE Bsc_Name "preaprapp.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /nologo /f NUL" -# PROP Rebuild_Opt "/a" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "preaprapp - Win32 Debug9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "preaprapp.exe" -# PROP BASE Bsc_Name "preaprapp.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /nologo /f NUL" -# PROP Rebuild_Opt "/a" -# PROP Bsc_Name "" -# PROP Target_Dir "" - !ELSEIF "$(CFG)" == "preaprapp - x64 Release" # PROP BASE Use_MFC 0 @@ -156,8 +114,6 @@ CFG=preaprapp - Win32 Release # Name "preaprapp - Win32 Release" # Name "preaprapp - Win32 Debug" -# Name "preaprapp - Win32 Release9x" -# Name "preaprapp - Win32 Debug9x" # Name "preaprapp - x64 Release" # Name "preaprapp - x64 Debug" @@ -165,10 +121,6 @@ CFG=preaprapp - Win32 Release !ELSEIF "$(CFG)" == "preaprapp - Win32 Debug" -!ELSEIF "$(CFG)" == "preaprapp - Win32 Release9x" - -!ELSEIF "$(CFG)" == "preaprapp - Win32 Debug9x" - !ELSEIF "$(CFG)" == "preaprapp - x64 Release" !ELSEIF "$(CFG)" == "preaprapp - x64 Debug" diff --git a/build/prelibaprapp.dsp b/build/prelibaprapp.dsp index 3654a7fbb29..b370a14f34e 100644 --- a/build/prelibaprapp.dsp +++ b/build/prelibaprapp.dsp @@ -19,8 +19,6 @@ CFG=prelibaprapp - Win32 Release !MESSAGE !MESSAGE "prelibaprapp - Win32 Release" (based on "Win32 (x86) External Target") !MESSAGE "prelibaprapp - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE "prelibaprapp - Win32 Release9x" (based on "Win32 (x86) External Target") -!MESSAGE "prelibaprapp - Win32 Debug9x" (based on "Win32 (x86) External Target") !MESSAGE "prelibaprapp - x64 Release" (based on "Win32 (x86) External Target") !MESSAGE "prelibaprapp - x64 Debug" (based on "Win32 (x86) External Target") !MESSAGE @@ -70,46 +68,6 @@ CFG=prelibaprapp - Win32 Release # PROP Bsc_Name "" # PROP Target_Dir "" -!ELSEIF "$(CFG)" == "prelibaprapp - Win32 Release9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "prelibaprapp.exe" -# PROP BASE Bsc_Name "prelibaprapp.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /nologo /f NUL" -# PROP Rebuild_Opt "/a" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "prelibaprapp - Win32 Debug9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /nologo /f NUL" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "prelibaprapp.exe" -# PROP BASE Bsc_Name "prelibaprapp.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /nologo /f NUL" -# PROP Rebuild_Opt "/a" -# PROP Bsc_Name "" -# PROP Target_Dir "" - !ELSEIF "$(CFG)" == "prelibaprapp - x64 Release" # PROP BASE Use_MFC 0 @@ -156,8 +114,6 @@ CFG=prelibaprapp - Win32 Release # Name "prelibaprapp - Win32 Release" # Name "prelibaprapp - Win32 Debug" -# Name "prelibaprapp - Win32 Release9x" -# Name "prelibaprapp - Win32 Debug9x" # Name "prelibaprapp - x64 Release" # Name "prelibaprapp - x64 Debug" @@ -165,10 +121,6 @@ CFG=prelibaprapp - Win32 Release !ELSEIF "$(CFG)" == "prelibaprapp - Win32 Debug" -!ELSEIF "$(CFG)" == "prelibaprapp - Win32 Release9x" - -!ELSEIF "$(CFG)" == "prelibaprapp - Win32 Debug9x" - !ELSEIF "$(CFG)" == "prelibaprapp - x64 Release" !ELSEIF "$(CFG)" == "prelibaprapp - x64 Debug" From 8d04112d73baa22b7dbb0a75c47e45149fbab55d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 22:47:31 +0000 Subject: [PATCH 6662/7878] Finish removing 9x from win32 build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@893023 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.win | 10 ---------- test/Makefile.win | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Makefile.win b/Makefile.win index 66fa36c4a9a..5e4e835d8a8 100644 --- a/Makefile.win +++ b/Makefile.win @@ -18,8 +18,6 @@ # # ARCH="Win32 Release" # ARCH="Win32 Debug" -# ARCH="Win32 Release9x" -# ARCH="Win32 Debug9x" # ARCH="x64 Release" # ARCH="x64 Debug" # @@ -66,14 +64,6 @@ LIBSOSPATH=LibR SLNARCH=Debug|Win32 ARCHOSPATH=Debug LIBSOSPATH=LibD -!ELSEIF "$(ARCH)" == "Win32 Release9x" -SLNARCH=Release9x|Win32 -ARCHOSPATH=9x\Release -LIBSOSPATH=9x\LibR -!ELSEIF "$(ARCH)" == "Win32 Debug9x" -SLNARCH=Debug9x|Win32 -ARCHOSPATH=9x\Debug -LIBSOSPATH=9x\LibD !ELSEIF "$(ARCH)" == "x64 Release" SLNARCH=Release|x64 ARCHOSPATH=x64\Release diff --git a/test/Makefile.win b/test/Makefile.win index 112113730ce..d81a5ba9523 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -148,7 +148,7 @@ CLEAN_DATA = testfile.tmp lfstests\large.bin \ data\testflush.dat data\testxthread.dat \ data\apr.testshm.shm -CLEAN_BUILDDIRS = Debug Release LibD LibR 9x x64 +CLEAN_BUILDDIRS = Debug Release LibD LibR x64 TEST_SUBDIRS = internal From 45139ba6d1f5b0a48c3ada17b29bbaec1a155105 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 23:07:45 +0000 Subject: [PATCH 6663/7878] Noted from abts that this is supposedly a 'standard' portability declaration git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@893025 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 12 ++++++++++++ include/arch/win32/apr_private.h | 10 ---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index c8585dbf0d3..1250d86afe4 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -675,6 +675,18 @@ typedef int uid_t; typedef int gid_t; #endif +/* Typically defined in stdio.h or unistd.h + */ +#ifndef STDIN_FILENO +#define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +#define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +#define STDERR_FILENO 2 +#endif + #if APR_HAVE_IPV6 /* Appears in later flavors, not the originals. */ diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 96814ec5a80..ee27a4abc9a 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -37,16 +37,6 @@ #define SW_HIDE 0 #endif -#ifndef STDIN_FILENO -#define STDIN_FILENO 0 -#endif -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif -#ifndef STDERR_FILENO -#define STDERR_FILENO 2 -#endif - /* For the misc.h late-loaded dynamic symbols, we need some obscure types * Avoid dragging in wtypes.h unless it's absolutely necessary [generally * not with APR itself, until some GUI-related security is introduced.] From 8b177a7dede6b2e991b43f756d07198a81efee75 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 21 Dec 2009 23:30:55 +0000 Subject: [PATCH 6664/7878] Get the tests compiling, with expat libs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@893031 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_ldap.hw | 2 +- test/Makefile.win | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/apr_ldap.hw b/include/apr_ldap.hw index 2103c260cb6..42bbf4683b9 100644 --- a/include/apr_ldap.hw +++ b/include/apr_ldap.hw @@ -31,7 +31,7 @@ */ /* this will be defined if LDAP support was compiled into apr-util */ -#define APR_HAS_LDAP 1 +#define APR_HAS_LDAP 0 /* identify the LDAP toolkit used */ #define APR_HAS_NETSCAPE_LDAPSDK 0 diff --git a/test/Makefile.win b/test/Makefile.win index d81a5ba9523..c06b17d78ff 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -127,7 +127,7 @@ ALL_TESTS = \ $(INTDIR)\testsockets.obj \ $(INTDIR)\testsockopt.obj \ $(INTDIR)\teststr.obj \ - $(INTDIR)\testmatch.obj \ + $(INTDIR)\teststrmatch.obj \ $(INTDIR)\teststrnatcmp.obj \ $(INTDIR)\testtable.obj \ $(INTDIR)\testtemp.obj \ @@ -164,8 +164,8 @@ CL = cl.exe LD = link.exe !IF "$(MODEL)" == "static" -LOCAL_LIB= ..\$(OUTDIR)\apr-2.lib -APP_LIB= ..\$(OUTDIR)\aprapp-2.lib +LOCAL_LIB= ..\$(OUTDIR)\apr-2.lib ..\..\expat\win32\bin\Release\libexpatMT.lib +APP_LIB= ..\$(OUTDIR)\aprapp-2.lib STATIC_CFLAGS = /D APR_DECLARE_STATIC !ELSE LOCAL_LIB= ..\$(OUTDIR)\libapr-2.lib @@ -188,7 +188,8 @@ CFLAGS = /nologo /c /W3 /Gm /EHsc /Zi /Od $(INCLUDES) \ LD_LIBS = kernel32.lib advapi32.lib ws2_32.lib wsock32.lib \ ole32.lib shell32.lib rpcrt4.lib -LDFLAGS = /nologo /debug /subsystem:console /incremental:no +LDFLAGS = /nologo /debug /subsystem:console /incremental:no /nodefaultlib:libcmt + SHLDFLAGS = /nologo /dll /debug /subsystem:windows /incremental:no .c{$(INTDIR)}.obj:: From c8d3cc53cf6168a240577c4d6873f01287b5443a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 22 Dec 2009 23:25:23 +0000 Subject: [PATCH 6665/7878] Fix breakage observed by rpluem, I hope git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@893346 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_odbc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index 66e8bff1345..6cfdb8e8aea 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -61,8 +61,8 @@ #define ODBC_DRIVER_ENTRY NAMIFY1(ODBC_DRIVER_NAME) /* Required APR version for this driver */ -#define DRIVER_APU_VERSION_MAJOR APU_MAJOR_VERSION -#define DRIVER_APU_VERSION_MINOR APU_MINOR_VERSION +#define DRIVER_APU_VERSION_MAJOR APR_MAJOR_VERSION +#define DRIVER_APU_VERSION_MINOR APR_MINOR_VERSION static SQLHANDLE henv = NULL; /* ODBC ENV handle is process-wide */ From 53e7060f5e0124fc214f82e8921ecf4ed2a0b0a1 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Wed, 23 Dec 2009 14:59:59 +0000 Subject: [PATCH 6666/7878] * Define DRIVER_APR_VERSION_* git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@893538 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_odbc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index 6cfdb8e8aea..7d6753bee0c 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -61,8 +61,8 @@ #define ODBC_DRIVER_ENTRY NAMIFY1(ODBC_DRIVER_NAME) /* Required APR version for this driver */ -#define DRIVER_APU_VERSION_MAJOR APR_MAJOR_VERSION -#define DRIVER_APU_VERSION_MINOR APR_MINOR_VERSION +#define DRIVER_APR_VERSION_MAJOR APR_MAJOR_VERSION +#define DRIVER_APR_VERSION_MINOR APR_MINOR_VERSION static SQLHANDLE henv = NULL; /* ODBC ENV handle is process-wide */ From 62f6c9b6f5fda4b05d7c89cdb1d978ce8987b50c Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Fri, 25 Dec 2009 08:14:45 +0000 Subject: [PATCH 6667/7878] Remove all deprecated pool*_core functions. (renamed to _unmanaged) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@893840 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 33 +++------------------------------ memory/unix/apr_pools.c | 39 --------------------------------------- 2 files changed, 3 insertions(+), 69 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 956e4568c61..ae189e22965 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -198,14 +198,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator); -/** - * Create a new pool. - * @deprecated @see apr_pool_create_unmanaged_ex. - */ -APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator); - /** * Create a new unmanaged pool. * @param newpool The pool we have just created. @@ -254,16 +246,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, APR_POOL__FILE_LINE__) #endif -/** - * Debug version of apr_pool_create_core_ex. - * @deprecated @see apr_pool_create_unmanaged_ex_debug. - */ -APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator, - const char *file_line); - -/** + /** * Debug version of apr_pool_create_unmanaged_ex. * @param newpool @see apr_pool_create_unmanaged. * @param abort_fn @see apr_pool_create_unmanaged. @@ -275,8 +258,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have - * apr_pool_create_core_ex in a wrapper, trust the macro - * and don't call apr_pool_create_core_ex_debug directly. + * apr_pool_create_unmanaged_ex in a wrapper, trust the macro + * and don't call apr_pool_create_unmanaged_ex_debug directly. */ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, apr_abortfunc_t abort_fn, @@ -284,10 +267,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpoo const char *file_line); #if APR_POOL_DEBUG -#define apr_pool_create_core_ex(newpool, abort_fn, allocator) \ - apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, \ - APR_POOL__FILE_LINE__) - #define apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator) \ apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, \ APR_POOL__FILE_LINE__) @@ -325,19 +304,13 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, * @param newpool The pool we have just created. */ #if defined(DOXYGEN) -APR_DECLARE(apr_status_t) apr_pool_create_core(apr_pool_t **newpool); APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool); #else #if APR_POOL_DEBUG -#define apr_pool_create_core(newpool) \ - apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \ - APR_POOL__FILE_LINE__) #define apr_pool_create_unmanaged(newpool) \ apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \ APR_POOL__FILE_LINE__) #else -#define apr_pool_create_core(newpool) \ - apr_pool_create_unmanaged_ex(newpool, NULL, NULL) #define apr_pool_create_unmanaged(newpool) \ apr_pool_create_unmanaged_ex(newpool, NULL, NULL) #endif diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 70b939ee0d9..d3c81fc347b 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -914,15 +914,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, return APR_SUCCESS; } -/* Deprecated. Renamed to apr_pool_create_unmanaged_ex - */ -APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator) -{ - return apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator); -} - APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator) @@ -1747,15 +1738,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator, - const char *file_line) -{ - return apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, - file_line); -} - APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, @@ -2526,14 +2508,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, return apr_pool_create_ex(newpool, parent, abort_fn, allocator); } -APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator, - const char *file_line) -{ - return apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator); -} - APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, @@ -2592,19 +2566,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, "undefined"); } -#undef apr_pool_create_core_ex -APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator); - -APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator) -{ - return apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, - allocator, "undefined"); -} - #undef apr_pool_create_unmanaged_ex APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, From bb2b5aa636c84c5d78ab9c868bc1094bff1ae0e0 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Wed, 6 Jan 2010 10:49:36 +0000 Subject: [PATCH 6668/7878] Fixes various doxygen usage warnings and minor doxygen errors. Submitted by: Neil Conway git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@896382 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_buckets.h | 15 ++++++++------- include/apr_file_io.h | 3 ++- include/apr_ldap.h.in | 2 +- include/apr_memcache.h | 13 +++++++------ include/apr_network_io.h | 9 +++++---- include/apr_thread_proc.h | 4 ++-- include/apr_want.h | 6 +++--- include/apr_xml.h | 4 ++-- 8 files changed, 30 insertions(+), 26 deletions(-) diff --git a/include/apr_buckets.h b/include/apr_buckets.h index e192a9c5665..c900934e771 100644 --- a/include/apr_buckets.h +++ b/include/apr_buckets.h @@ -659,14 +659,14 @@ APR_DECLARE(apr_bucket_brigade *) apr_brigade_create(apr_pool_t *p, apr_bucket_alloc_t *list); /** - * destroy an entire bucket brigade. This includes destroying all of the + * Destroy an entire bucket brigade. This includes destroying all of the * buckets within the bucket brigade's bucket list. * @param b The bucket brigade to destroy */ APR_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b); /** - * empty out an entire bucket brigade. This includes destroying all of the + * Empty out an entire bucket brigade. This includes destroying all of the * buckets within the bucket brigade's bucket list. This is similar to * apr_brigade_destroy(), except that it does not deregister the brigade's * pool cleanup function. @@ -679,10 +679,11 @@ APR_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b); APR_DECLARE(apr_status_t) apr_brigade_cleanup(void *data); /** - * Move the buckets from the tail end of the existing brigade @param b into - * the brigade @param a. If @param a is NULL a new brigade is created. Buckets - * from @param e to the last bucket (inclusively) of brigade @param b are moved - * from @param b to the returned brigade @param a. + * Move the buckets from the tail end of the existing brigade @a b into + * the brigade @a a. If @a a is NULL a new brigade is created. Buckets + * from @a e to the last bucket (inclusively) of brigade @a b are moved + * from @a b to the returned brigade @a a. + * * @param b The brigade to split * @param e The first bucket to move * @param a The brigade which should be used for the result or NULL if @@ -774,7 +775,7 @@ APR_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut, apr_off_t maxbytes); /** - * create an iovec of the elements in a bucket_brigade... return number + * Create an iovec of the elements in a bucket_brigade... return number * of elements used. This is useful for writing to a file or to the * network efficiently. * @param b The bucket brigade to create the iovec from diff --git a/include/apr_file_io.h b/include/apr_file_io.h index b03f2cf7ce2..80d9fbe7a92 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -674,6 +674,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, * @param in The newly created pipe's file for reading. * @param out The newly created pipe's file for writing. * @param blocking one of these values defined in apr_thread_proc.h; + * @param pool The pool to operate on. *
      *       APR_FULL_BLOCK
      *       APR_READ_BLOCK
    @@ -692,7 +693,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in,
     APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, 
                                                       apr_file_t **out, 
                                                       apr_int32_t blocking, 
    -                                                  apr_pool_t *p);
    +                                                  apr_pool_t *pool);
     
     /**
      * Create a named pipe.
    diff --git a/include/apr_ldap.h.in b/include/apr_ldap.h.in
    index baed01072d5..c548b55113f 100644
    --- a/include/apr_ldap.h.in
    +++ b/include/apr_ldap.h.in
    @@ -192,6 +192,6 @@ typedef struct apr_ldap_err_t {
     #include "apr_ldap_option.h"
     #include "apr_ldap_rebind.h"
     
    -/** @} */
     #endif /* APR_HAS_LDAP */
    +/** @} */
     #endif /* APU_LDAP_H */
    diff --git a/include/apr_memcache.h b/include/apr_memcache.h
    index bb60d2e2d3f..fac5cc0c68f 100644
    --- a/include/apr_memcache.h
    +++ b/include/apr_memcache.h
    @@ -120,6 +120,7 @@ typedef struct
     
     /**
      * Creates a crc32 hash used to split keys between servers
    + * @param mc The memcache client object to use
      * @param data Data to be hashed
      * @param data_len Length of the data to use
      * @return crc32 hash of data
    @@ -164,7 +165,7 @@ apr_memcache_find_server_hash_default(void *baton,
     /**
      * Adds a server to a client object
      * @param mc The memcache client object to use
    - * @param ms Server to add
    + * @param server Server to add
      * @remark Adding servers is not thread safe, and should be done once at startup.
      * @warning Changing servers after startup may cause keys to go to
      * different servers.
    @@ -284,7 +285,7 @@ APR_DECLARE(apr_status_t) apr_memcache_multgetp(apr_memcache_t *mc,
      * @param mc client to use
      * @param key   null terminated string containing the key
      * @param baton data to store on the server
    - * @param len   length of data at baton
    + * @param data_size   length of data at baton
      * @param timeout time in seconds for the data to live on the server
      * @param flags any flags set by the client for this key
      */
    @@ -300,7 +301,7 @@ APR_DECLARE(apr_status_t) apr_memcache_set(apr_memcache_t *mc,
      * @param mc client to use
      * @param key   null terminated string containing the key
      * @param baton data to store on the server
    - * @param len   length of data at baton
    + * @param data_size   length of data at baton
      * @param timeout time for the data to live on the server
      * @param flags any flags set by the client for this key
      * @return APR_SUCCESS if the key was added, APR_EEXIST if the key 
    @@ -318,7 +319,7 @@ APR_DECLARE(apr_status_t) apr_memcache_add(apr_memcache_t *mc,
      * @param mc client to use
      * @param key   null terminated string containing the key
      * @param baton data to store on the server
    - * @param len   length of data at baton
    + * @param data_size   length of data at baton
      * @param timeout time for the data to live on the server
      * @param flags any flags set by the client for this key
      * @return APR_SUCCESS if the key was added, APR_EEXIST if the key 
    @@ -326,7 +327,7 @@ APR_DECLARE(apr_status_t) apr_memcache_add(apr_memcache_t *mc,
      */
     APR_DECLARE(apr_status_t) apr_memcache_replace(apr_memcache_t *mc,
                                                    const char *key,
    -                                               char *data,
    +                                               char *baton,
                                                    const apr_size_t data_size,
                                                    apr_uint32_t timeout,
                                                    apr_uint16_t flags);
    @@ -357,7 +358,7 @@ APR_DECLARE(apr_status_t) apr_memcache_incr(apr_memcache_t *mc,
      * @param mc client to use
      * @param key   null terminated string containing the key
      * @param n     number to decrement by
    - * @param nv    new value after decrementing
    + * @param new_value    new value after decrementing
      */
     APR_DECLARE(apr_status_t) apr_memcache_decr(apr_memcache_t *mc, 
                                                 const char *key,
    diff --git a/include/apr_network_io.h b/include/apr_network_io.h
    index 690be85531b..f45427c47c1 100644
    --- a/include/apr_network_io.h
    +++ b/include/apr_network_io.h
    @@ -380,7 +380,7 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock,
      * return APR_EOF), if the socket's receive buffer is empty.  This
      * function does not block waiting for I/O.
      *
    - * @param socket The socket to check
    + * @param sock The socket to check
      * @param atreadeof If APR_SUCCESS is returned, *atreadeof is set to
      *                  non-zero if a subsequent read would return APR_EOF
      * @return an error is returned if it was not possible to determine the
    @@ -553,9 +553,10 @@ APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock,
     
     /**
      * Read data from a socket.  On success, the address of the peer from
    - * which the data was sent is copied into the @param from parameter,
    - * and the @param len parameter is updated to give the number of bytes
    - * written to @param buf.
    + * which the data was sent is copied into the @a from parameter, and the
    + * @a len parameter is updated to give the number of bytes written to
    + * @a buf.
    + *
      * @param from Updated with the address from which the data was received
      * @param sock The socket to use
      * @param flags The flags to use
    diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h
    index eeb81cde4d4..13631068e1d 100644
    --- a/include/apr_thread_proc.h
    +++ b/include/apr_thread_proc.h
    @@ -738,13 +738,13 @@ APR_DECLARE(void) apr_proc_other_child_unregister(void *data);
      * 
      * rv = apr_proc_wait_all_procs(&proc, &exitcode, &status, APR_WAIT, p);
      * if (APR_STATUS_IS_CHILD_DONE(rv)) {
    - * #if APR_HAS_OTHER_CHILD
    + * \#if APR_HAS_OTHER_CHILD
      *     if (apr_proc_other_child_alert(&proc, APR_OC_REASON_DEATH, status)
      *             == APR_SUCCESS) {
      *         ;  (already handled)
      *     }
      *     else
    - * #endif
    + * \#endif
      *         [... handling non-otherchild processes death ...]
      * 
    */ diff --git a/include/apr_want.h b/include/apr_want.h index 5df6e884bf2..6b2fbde453e 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -30,9 +30,9 @@ * * Typical usage: * - * #define APR_WANT_STRFUNC - * #define APR_WANT_MEMFUNC - * #include "apr_want.h" + * \#define APR_WANT_STRFUNC + * \#define APR_WANT_MEMFUNC + * \#include "apr_want.h" * * The appropriate headers will be included. * diff --git a/include/apr_xml.h b/include/apr_xml.h index 8de6875639a..9198cc4b46f 100644 --- a/include/apr_xml.h +++ b/include/apr_xml.h @@ -304,10 +304,10 @@ APR_DECLARE(const char *) apr_xml_empty_elem(apr_pool_t *p, /** * quote an XML string - * Replace '<', '>', and '&' with '<', '>', and '&'. + * Replace '\<', '\>', and '\&' with '\<', '\>', and '\&'. * @param p The pool to allocate out of * @param s The string to quote - * @param quotes If quotes is true, then replace '"' with '"'. + * @param quotes If quotes is true, then replace '"' with '\"'. * @return The quoted string * @note If the string does not contain special characters, it is not * duplicated into the pool and the original string is returned. From dad479f81ea1e13727014246bb5c986ca6b199ba Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Wed, 6 Jan 2010 20:24:19 +0000 Subject: [PATCH 6669/7878] Document the difference in behaviour between select and the other providers in the poll interface. Submitted by: Neil Conway git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@896653 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index 9521eee923f..73a01dc814b 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -74,10 +74,10 @@ extern "C" { typedef enum { APR_POLLSET_DEFAULT, /**< Platform default poll method */ APR_POLLSET_SELECT, /**< Poll uses select method */ - APR_POLLSET_KQUEUE, - APR_POLLSET_PORT, - APR_POLLSET_EPOLL, - APR_POLLSET_POLL + APR_POLLSET_KQUEUE, /**< Poll uses kqueue method */ + APR_POLLSET_PORT, /**< Poll uses Solaris event port method */ + APR_POLLSET_EPOLL, /**< Poll uses epoll method */ + APR_POLLSET_POLL /**< Poll uses poll method */ } apr_pollset_method_e; /** Used in apr_pollfd_t to determine what the apr_descriptor is */ @@ -137,6 +137,12 @@ typedef struct apr_pollset_t apr_pollset_t; * @remark If flags contains APR_POLLSET_NOCOPY, then the apr_pollfd_t * structures passed to apr_pollset_add() are not copied and * must have a lifetime at least as long as the pollset. + * @remark Some poll methods (including APR_POLLSET_KQUEUE, + * APR_POLLSET_PORT, and APR_POLLSET_EPOLL) do not have a + * fixed limit on the size of the pollset. For these methods, + * the size parameter controls the maximum number of + * descriptors that will be returned by a single call to + * apr_pollset_poll(). */ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, @@ -149,7 +155,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, * @param size The maximum number of descriptors that this pollset can hold * @param p The pool from which to allocate the pollset * @param flags Optional flags to modify the operation of the pollset. - * @param method Poll method to use. See @apr_pollset_method_e. If this + * @param method Poll method to use. See #apr_pollset_method_e. If this * method cannot be used, the default method will be used unless the * APR_POLLSET_NODEFAULT flag has been specified. * @@ -168,6 +174,12 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, * @remark If flags contains APR_POLLSET_NOCOPY, then the apr_pollfd_t * structures passed to apr_pollset_add() are not copied and * must have a lifetime at least as long as the pollset. + * @remark Some poll methods (including APR_POLLSET_KQUEUE, + * APR_POLLSET_PORT, and APR_POLLSET_EPOLL) do not have a + * fixed limit on the size of the pollset. For these methods, + * the size parameter controls the maximum number of + * descriptors that will be returned by a single call to + * apr_pollset_poll(). */ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, apr_uint32_t size, @@ -308,7 +320,7 @@ typedef struct apr_pollcb_t apr_pollcb_t; */ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, apr_uint32_t size, - apr_pool_t *pool, + apr_pool_t *p, apr_uint32_t flags); /** @@ -317,7 +329,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, * @param size The maximum number of descriptors that a single _poll can return. * @param p The pool from which to allocate the pollcb * @param flags Optional flags to modify the operation of the pollcb. - * @param method Poll method to use. See @apr_pollset_method_e. If this + * @param method Poll method to use. See #apr_pollset_method_e. If this * method cannot be used, the default method will be used unless the * APR_POLLSET_NODEFAULT flag has been specified. * @@ -326,7 +338,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, */ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, apr_uint32_t size, - apr_pool_t *pool, + apr_pool_t *p, apr_uint32_t flags, apr_pollset_method_e method); @@ -361,7 +373,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor); /** Function prototype for pollcb handlers - * @param baton Opaque baton passed into apr_pollcb_poll + * @param baton Opaque baton passed into apr_pollcb_poll() * @param descriptor Contains the notification for an active descriptor, * the rtnevents member contains what events were triggered * for this descriptor. From 5f1c996ea84af9b2906f550b857ac1f68fe9d0ba Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 16 Jan 2010 08:53:33 +0000 Subject: [PATCH 6670/7878] * Add apr_pollcb_wakeup(), with similar behavior to apr_pollset_wakeup(). Along the way, refactor the code for creating/managing the wakeup pipe to a separate file, wakeup.c * Add apr_pollcb_method_name(), with similar behavior to apr_pollset_method_name() * Add minimal unit tests for apr_pollset_wakeup() and apr_pollcb_wakeup() apr_pollcb_wakeup() is supported with all the poll methods supported by pollcb (kqueue, epoll, poll, and event ports). Submitted by: Neil Conway git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@899905 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 50 +++++-- include/arch/unix/apr_arch_poll_private.h | 9 +- poll/unix/epoll.c | 29 +++-- poll/unix/kqueue.c | 25 ++-- poll/unix/poll.c | 18 ++- poll/unix/pollcb.c | 48 +++++++ poll/unix/pollset.c | 145 ++------------------- poll/unix/port.c | 22 +++- poll/unix/select.c | 2 +- poll/unix/wakeup.c | 151 ++++++++++++++++++++++ test/testpoll.c | 57 +++++++- 11 files changed, 376 insertions(+), 180 deletions(-) create mode 100644 poll/unix/wakeup.c diff --git a/include/apr_poll.h b/include/apr_poll.h index 73a01dc814b..02c1275a87d 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -61,7 +61,7 @@ extern "C" { * are not copied */ #define APR_POLLSET_WAKEABLE 0x004 /**< Poll operations are interruptable by - * apr_pollset_wakeup() + * apr_pollset_wakeup() or apr_pollcb_wakeup() */ #define APR_POLLSET_NODEFAULT 0x010 /**< Do not try to use the default method if * the specified non-default method cannot be @@ -131,7 +131,7 @@ typedef struct apr_pollset_t apr_pollset_t; * @remark If flags contains APR_POLLSET_WAKEABLE, then a pollset is * created with an additional internal pipe object used for the * apr_pollset_wakeup() call. The actual size of pollset is - * in that case size + 1. This feature is only supported on some + * in that case @a size + 1. This feature is only supported on some * platforms; the apr_pollset_create() call will fail with * APR_ENOTIMPL on platforms where it is not supported. * @remark If flags contains APR_POLLSET_NOCOPY, then the apr_pollfd_t @@ -226,6 +226,7 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, * Remove a descriptor from a pollset * @param pollset The pollset from which to remove the descriptor * @param descriptor The descriptor to remove + * @remark If the descriptor is not found, APR_NOTFOUND is returned. * @remark If the pollset has been created with APR_POLLSET_THREADSAFE * and thread T1 is blocked in a call to apr_pollset_poll() for * this same pollset that is being modified via apr_pollset_remove() @@ -305,7 +306,7 @@ APR_DECLARE(const char *) apr_pollset_method_name(apr_pollset_t *pollset); */ APR_DECLARE(const char *) apr_poll_method_defname(void); -/** Opaque structure used for pollset API */ +/** Opaque structure used for pollcb API */ typedef struct apr_pollcb_t apr_pollcb_t; /** @@ -315,8 +316,12 @@ typedef struct apr_pollcb_t apr_pollcb_t; * @param p The pool from which to allocate the pollcb * @param flags Optional flags to modify the operation of the pollcb. * + * @remark If flags contains APR_POLLSET_WAKEABLE, then a pollcb is + * created with an additional internal pipe object used for the + * apr_pollcb_wakeup() call. The actual size of pollcb is + * in that case @a size + 1. * @remark Pollcb is only supported on some platforms; the apr_pollcb_create() - * call will fail with APR_ENOTIMPL on platforms where it is not supported. + * call will fail with APR_ENOTIMPL on platforms where it is not supported. */ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, apr_uint32_t size, @@ -333,8 +338,12 @@ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, * method cannot be used, the default method will be used unless the * APR_POLLSET_NODEFAULT flag has been specified. * + * @remark If flags contains APR_POLLSET_WAKEABLE, then a pollcb is + * created with an additional internal pipe object used for the + * apr_pollcb_wakeup() call. The actual size of pollcb is + * in that case @a size + 1. * @remark Pollcb is only supported on some platforms; the apr_pollcb_create_ex() - * call will fail with APR_ENOTIMPL on platforms where it is not supported. + * call will fail with APR_ENOTIMPL on platforms where it is not supported. */ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, apr_uint32_t size, @@ -365,6 +374,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, * Remove a descriptor from a pollcb * @param pollcb The pollcb from which to remove the descriptor * @param descriptor The descriptor to remove + * @remark If the descriptor is not found, APR_NOTFOUND is returned. * @remark apr_pollcb_remove() cannot be used to remove a subset of requested * events for a descriptor. The reqevents field in the apr_pollfd_t * parameter must contain the same value when removing as when adding. @@ -372,11 +382,14 @@ APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor); -/** Function prototype for pollcb handlers +/** + * Function prototype for pollcb handlers * @param baton Opaque baton passed into apr_pollcb_poll() - * @param descriptor Contains the notification for an active descriptor, - * the rtnevents member contains what events were triggered + * @param descriptor Contains the notification for an active descriptor. + * The @a rtnevents member describes which events were triggered * for this descriptor. + * @remark If the pollcb handler does not return APR_SUCCESS, the apr_pollcb_poll() + * call returns with the handler's return value. */ typedef apr_status_t (*apr_pollcb_cb_t)(void *baton, apr_pollfd_t *descriptor); @@ -387,17 +400,34 @@ typedef apr_status_t (*apr_pollcb_cb_t)(void *baton, apr_pollfd_t *descriptor); * maximum, not a minimum. If a descriptor is signalled, the * function will return before this time. If timeout is * negative, the function will block until a descriptor is - * signalled. + * signalled or until apr_pollcb_wakeup() has been called. * @param func Callback function to call for each active descriptor. * @param baton Opaque baton passed to the callback function. * @remark Multiple signalled conditions for the same descriptor may be reported * in one or more calls to the callback function, depending on the * implementation. + * @remark APR_EINTR will be returned if the pollset has been created with + * APR_POLLSET_WAKEABLE and apr_pollcb_wakeup() has been called while + * waiting for activity. */ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, apr_interval_time_t timeout, apr_pollcb_cb_t func, - void *baton); + void *baton); + +/** + * Interrupt the blocked apr_pollcb_poll() call. + * @param pollcb The pollcb to use + * @remark If the pollcb was not created with APR_POLLSET_WAKEABLE the + * return value is APR_EINIT. + */ +APR_DECLARE(apr_status_t) apr_pollcb_wakeup(apr_pollcb_t *pollcb); + +/** + * Return a printable representation of the pollcb method. + * @param pollcb The pollcb to use + */ +APR_DECLARE(const char *) apr_pollcb_method_name(apr_pollcb_t *pollcb); /** @} */ diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index a26730490cf..80daefc88fd 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -139,6 +139,10 @@ struct apr_pollcb_t { apr_pool_t *pool; apr_uint32_t nelts; apr_uint32_t nalloc; + apr_uint32_t flags; + /* Pipe descriptors used for wakeup */ + apr_file_t *wakeup_pipe[2]; + apr_pollfd_t wakeup_pfd; int fd; apr_pollcb_pset pollset; apr_pollfd_t **copyset; @@ -159,10 +163,13 @@ struct apr_pollcb_provider_t { apr_status_t (*add)(apr_pollcb_t *, apr_pollfd_t *); apr_status_t (*remove)(apr_pollcb_t *, apr_pollfd_t *); apr_status_t (*poll)(apr_pollcb_t *, apr_interval_time_t, apr_pollcb_cb_t, void *); + apr_status_t (*cleanup)(apr_pollcb_t *); const char *name; }; /* Private functions */ -void apr_pollset_drain_wakeup_pipe(apr_pollset_t *pollset); +apr_status_t create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd, apr_file_t **wakeup_pipe); +apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe); +void drain_wakeup_pipe(apr_file_t **wakeup_pipe); #endif /* APR_ARCH_POLL_PRIVATE_H */ diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 326dac7b1e9..751d7c9bda8 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -147,7 +147,7 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) { struct epoll_event ev = {0}; - int ret = -1; + int ret; pfd_elem_t *elem = NULL; apr_status_t rv = APR_SUCCESS; @@ -204,7 +204,7 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, struct epoll_event ev = {0}; /* ignored, but must be passed with * kernel < 2.6.9 */ - int ret = -1; + int ret; if (descriptor->desc_type == APR_POLL_SOCKET) { ret = epoll_ctl(pollset->p->epoll_fd, EPOLL_CTL_DEL, @@ -245,9 +245,8 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, apr_int32_t *num, const apr_pollfd_t **descriptors) { - int ret, i, j; + int ret; apr_status_t rv = APR_SUCCESS; - apr_pollfd_t *fdptr; if (timeout > 0) { timeout /= 1000; @@ -264,6 +263,9 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, rv = APR_TIMEUP; } else { + int i, j; + apr_pollfd_t *fdptr; + for (i = 0, j = 0; i < ret; i++) { if (pollset->flags & APR_POLLSET_NOCOPY) { fdptr = (apr_pollfd_t *)(pollset->p->pollset[i].data.ptr); @@ -277,7 +279,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, if ((pollset->flags & APR_POLLSET_WAKEABLE) && fdptr->desc_type == APR_POLL_FILE && fdptr->desc.f == pollset->wakeup_pipe[0]) { - apr_pollset_drain_wakeup_pipe(pollset); + drain_wakeup_pipe(pollset->wakeup_pipe); rv = APR_EINTR; } else { @@ -319,9 +321,8 @@ static apr_pollset_provider_t impl = { apr_pollset_provider_t *apr_pollset_provider_epoll = &impl; -static apr_status_t cb_cleanup(void *p_) +static apr_status_t impl_pollcb_cleanup(apr_pollcb_t *pollcb) { - apr_pollcb_t *pollcb = (apr_pollcb_t *) p_; close(pollcb->fd); return APR_SUCCESS; } @@ -358,7 +359,6 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, pollcb->fd = fd; pollcb->pollset.epoll = apr_palloc(p, size * sizeof(struct epoll_event)); - apr_pool_cleanup_register(p, pollcb, cb_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -370,7 +370,7 @@ static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb, int ret; ev.events = get_epoll_event(descriptor->reqevents); - ev.data.ptr = (void *)descriptor; + ev.data.ptr = (void *) descriptor; if (descriptor->desc_type == APR_POLL_SOCKET) { ret = epoll_ctl(pollcb->fd, EPOLL_CTL_ADD, @@ -395,7 +395,7 @@ static apr_status_t impl_pollcb_remove(apr_pollcb_t *pollcb, struct epoll_event ev = {0}; /* ignored, but must be passed with * kernel < 2.6.9 */ - int ret = -1; + int ret; if (descriptor->desc_type == APR_POLL_SOCKET) { ret = epoll_ctl(pollcb->fd, EPOLL_CTL_DEL, @@ -437,6 +437,14 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, else { for (i = 0; i < ret; i++) { apr_pollfd_t *pollfd = (apr_pollfd_t *)(pollcb->pollset.epoll[i].data.ptr); + + if ((pollcb->flags & APR_POLLSET_WAKEABLE) && + pollfd->desc_type == APR_POLL_FILE && + pollfd->desc.f == pollcb->wakeup_pipe[0]) { + drain_wakeup_pipe(pollcb->wakeup_pipe); + return APR_EINTR; + } + pollfd->rtnevents = get_epoll_revent(pollcb->pollset.epoll[i].events); rv = func(baton, pollfd); @@ -454,6 +462,7 @@ static apr_pollcb_provider_t impl_cb = { impl_pollcb_add, impl_pollcb_remove, impl_pollcb_poll, + impl_pollcb_cleanup, "epoll" }; diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index dbe785a1546..a4483e0f09f 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -246,7 +246,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, apr_int32_t *num, const apr_pollfd_t **descriptors) { - int ret, i, j; + int ret; struct timespec tv, *tvptr; apr_status_t rv = APR_SUCCESS; apr_pollfd_t fd; @@ -270,12 +270,14 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, rv = APR_TIMEUP; } else { + int i, j; + for (i = 0, j = 0; i < ret; i++) { - fd = (((pfd_elem_t*)(pollset->p->ke_set[i].udata))->pfd); + fd = (((pfd_elem_t *)(pollset->p->ke_set[i].udata))->pfd); if ((pollset->flags & APR_POLLSET_WAKEABLE) && fd.desc_type == APR_POLL_FILE && fd.desc.f == pollset->wakeup_pipe[0]) { - apr_pollset_drain_wakeup_pipe(pollset); + drain_wakeup_pipe(pollset->wakeup_pipe); rv = APR_EINTR; } else { @@ -294,7 +296,6 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, } } - pollset_lock_rings(); /* Shift all PFDs in the Dead Ring to the Free Ring */ @@ -317,9 +318,8 @@ static apr_pollset_provider_t impl = { apr_pollset_provider_t *apr_pollset_provider_kqueue = &impl; -static apr_status_t cb_cleanup(void *b_) +static apr_status_t impl_pollcb_cleanup(apr_pollcb_t *pollcb) { - apr_pollcb_t *pollcb = (apr_pollcb_t *) b_; close(pollcb->fd); return APR_SUCCESS; } @@ -348,8 +348,7 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, } pollcb->fd = fd; - pollcb->pollset.ke = (struct kevent *)apr_pcalloc(p, 2 * size * sizeof(struct kevent)); - apr_pool_cleanup_register(p, pollcb, cb_cleanup, apr_pool_cleanup_null); + pollcb->pollset.ke = (struct kevent *) apr_pcalloc(p, 2 * size * sizeof(struct kevent)); return APR_SUCCESS; } @@ -452,7 +451,14 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, else { for (i = 0; i < ret; i++) { apr_pollfd_t *pollfd = (apr_pollfd_t *)(pollcb->pollset.ke[i].udata); - + + if ((pollcb->flags & APR_POLLSET_WAKEABLE) && + pollfd->desc_type == APR_POLL_FILE && + pollfd->desc.f == pollcb->wakeup_pipe[0]) { + drain_wakeup_pipe(pollcb->wakeup_pipe); + return APR_EINTR; + } + pollfd->rtnevents = get_kqueue_revent(pollcb->pollset.ke[i].filter, pollcb->pollset.ke[i].flags); @@ -472,6 +478,7 @@ static apr_pollcb_provider_t impl_cb = { impl_pollcb_add, impl_pollcb_remove, impl_pollcb_poll, + impl_pollcb_cleanup, "kqueue" }; diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 3727b5b8334..615470b7420 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -240,7 +240,6 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, { int ret; apr_status_t rv = APR_SUCCESS; - apr_uint32_t i, j; if (timeout > 0) { timeout /= 1000; @@ -258,6 +257,8 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, return APR_TIMEUP; } else { + apr_uint32_t i, j; + for (i = 0, j = 0; i < pollset->nelts; i++) { if (pollset->p->pollset[i].revents != 0) { /* Check if the polled descriptor is our @@ -266,8 +267,8 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, if ((pollset->flags & APR_POLLSET_WAKEABLE) && pollset->p->query_set[i].desc_type == APR_POLL_FILE && pollset->p->query_set[i].desc.f == pollset->wakeup_pipe[0]) { - apr_pollset_drain_wakeup_pipe(pollset); - rv = APR_EINTR; + drain_wakeup_pipe(pollset->wakeup_pipe); + rv = APR_EINTR; } else { pollset->p->result_set[j] = pollset->p->query_set[i]; @@ -305,7 +306,7 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, apr_uint32_t flags) { #if APR_HAS_THREADS - return APR_ENOTIMPL; + return APR_ENOTIMPL; #endif pollcb->fd = -1; @@ -402,6 +403,14 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, for (i = 0; i < pollcb->nelts; i++) { if (pollcb->pollset.ps[i].revents != 0) { apr_pollfd_t *pollfd = pollcb->copyset[i]; + + if ((pollcb->flags & APR_POLLSET_WAKEABLE) && + pollfd->desc_type == APR_POLL_FILE && + pollfd->desc.f == pollcb->wakeup_pipe[0]) { + drain_wakeup_pipe(pollcb->wakeup_pipe); + return APR_EINTR; + } + pollfd->rtnevents = get_revent(pollcb->pollset.ps[i].revents); rv = func(baton, pollfd); if (rv) { @@ -418,6 +427,7 @@ static apr_pollcb_provider_t impl_cb = { impl_pollcb_add, impl_pollcb_remove, impl_pollcb_poll, + NULL, "poll" }; diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c index 2971b021646..58c0964fa83 100644 --- a/poll/unix/pollcb.c +++ b/poll/unix/pollcb.c @@ -72,6 +72,20 @@ static apr_pollcb_provider_t *pollcb_provider(apr_pollset_method_e method) return provider; } +static apr_status_t pollcb_cleanup(void *p) +{ + apr_pollcb_t *pollcb = (apr_pollcb_t *) p; + + if (pollcb->provider->cleanup) { + (*pollcb->provider->cleanup)(pollcb); + } + if (pollcb->flags & APR_POLLSET_WAKEABLE) { + close_wakeup_pipe(pollcb->wakeup_pipe); + } + + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **ret_pollcb, apr_uint32_t size, apr_pool_t *p, @@ -108,9 +122,15 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **ret_pollcb, } } + if (flags & APR_POLLSET_WAKEABLE) { + /* Add room for wakeup descriptor */ + size++; + } + pollcb = apr_palloc(p, sizeof(*pollcb)); pollcb->nelts = 0; pollcb->nalloc = size; + pollcb->flags = flags; pollcb->pool = p; pollcb->provider = provider; @@ -136,6 +156,21 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **ret_pollcb, pollcb->provider = provider; } + if (flags & APR_POLLSET_WAKEABLE) { + /* Create wakeup pipe */ + if ((rv = create_wakeup_pipe(pollcb->pool, &pollcb->wakeup_pfd, + pollcb->wakeup_pipe)) != APR_SUCCESS) { + return rv; + } + + if ((rv = apr_pollcb_add(pollcb, &pollcb->wakeup_pfd)) != APR_SUCCESS) { + return rv; + } + } + if ((flags & APR_POLLSET_WAKEABLE) || provider->cleanup) + apr_pool_cleanup_register(p, pollcb, pollcb_cleanup, + apr_pool_cleanup_null); + *ret_pollcb = pollcb; return APR_SUCCESS; } @@ -169,3 +204,16 @@ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, { return (*pollcb->provider->poll)(pollcb, timeout, func, baton); } + +APR_DECLARE(apr_status_t) apr_pollcb_wakeup(apr_pollcb_t *pollcb) +{ + if (pollcb->flags & APR_POLLSET_WAKEABLE) + return apr_file_putc(1, pollcb->wakeup_pipe[1]); + else + return APR_EINIT; +} + +APR_DECLARE(const char *) apr_pollcb_method_name(apr_pollcb_t *pollcb) +{ + return pollcb->provider->name; +} diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index b99cf634d43..ec2f55fb4ce 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -30,140 +30,6 @@ static apr_pollset_method_e pollset_default_method = POLLSET_DEFAULT_METHOD; -#if !APR_FILES_AS_SOCKETS - -#ifdef WIN32 - -/* Create a dummy wakeup socket pipe for interrupting the poller - */ -static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) -{ - apr_status_t rv; - apr_pollfd_t fd; - - if ((rv = file_socket_pipe_create(&pollset->wakeup_pipe[0], - &pollset->wakeup_pipe[1], - pollset->pool)) != APR_SUCCESS) - return rv; - fd.reqevents = APR_POLLIN; - fd.desc_type = APR_POLL_FILE; - fd.desc.f = pollset->wakeup_pipe[0]; - /* Add the pipe to the pollset - */ - return apr_pollset_add(pollset, &fd); -} - -static apr_status_t close_wakeup_pipe(apr_pollset_t *pollset) -{ - apr_status_t rv0 = APR_SUCCESS; - apr_status_t rv1 = APR_SUCCESS; - - /* Close both sides of the wakeup pipe */ - if (pollset->wakeup_pipe[0]) { - rv0 = file_socket_pipe_close(pollset->wakeup_pipe[0]); - pollset->wakeup_pipe[0] = NULL; - } - if (pollset->wakeup_pipe[1]) { - rv1 = file_socket_pipe_close(pollset->wakeup_pipe[1]); - pollset->wakeup_pipe[1] = NULL; - } - return rv0 ? rv0 : rv1; -} - -#else /* !WIN32 */ - -static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) -{ - return APR_ENOTIMPL; -} - -static apr_status_t close_wakeup_pipe(apr_pollset_t *pollset) -{ - return APR_ENOTIMPL; -} - -#endif /* !WIN32 */ - -#else /* APR_FILES_AS_SOCKETS */ - -/* Create a dummy wakeup pipe for interrupting the poller - */ -static apr_status_t create_wakeup_pipe(apr_pollset_t *pollset) -{ - apr_status_t rv; - apr_pollfd_t fd; - - if ((rv = apr_file_pipe_create(&pollset->wakeup_pipe[0], - &pollset->wakeup_pipe[1], - pollset->pool)) != APR_SUCCESS) - return rv; - fd.reqevents = APR_POLLIN; - fd.desc_type = APR_POLL_FILE; - fd.desc.f = pollset->wakeup_pipe[0]; - - { - int flags; - - if ((flags = fcntl(pollset->wakeup_pipe[0]->filedes, F_GETFD)) == -1) - return errno; - - flags |= FD_CLOEXEC; - if (fcntl(pollset->wakeup_pipe[0]->filedes, F_SETFD, flags) == -1) - return errno; - } - { - int flags; - - if ((flags = fcntl(pollset->wakeup_pipe[1]->filedes, F_GETFD)) == -1) - return errno; - - flags |= FD_CLOEXEC; - if (fcntl(pollset->wakeup_pipe[1]->filedes, F_SETFD, flags) == -1) - return errno; - } - - /* Add the pipe to the pollset - */ - return apr_pollset_add(pollset, &fd); -} - -static apr_status_t close_wakeup_pipe(apr_pollset_t *pollset) -{ - apr_status_t rv0; - apr_status_t rv1; - - /* Close both sides of the wakeup pipe */ - if (pollset->wakeup_pipe[0]) { - rv0 = apr_file_close(pollset->wakeup_pipe[0]); - pollset->wakeup_pipe[0] = NULL; - } - if (pollset->wakeup_pipe[1]) { - rv1 = apr_file_close(pollset->wakeup_pipe[1]); - pollset->wakeup_pipe[1] = NULL; - } - return rv0 ? rv0 : rv1; -} - -#endif /* APR_FILES_AS_SOCKETS */ - -/* Read and discard what's ever in the wakeup pipe. - */ -void apr_pollset_drain_wakeup_pipe(apr_pollset_t *pollset) -{ - char rb[512]; - apr_size_t nr = sizeof(rb); - - while (apr_file_read(pollset->wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { - /* Although we write just one byte to the other end of the pipe - * during wakeup, multiple treads could call the wakeup. - * So simply drain out from the input side of the pipe all - * the data. - */ - if (nr != sizeof(rb)) - break; - } -} - static apr_status_t pollset_cleanup(void *p) { apr_pollset_t *pollset = (apr_pollset_t *) p; @@ -171,7 +37,7 @@ static apr_status_t pollset_cleanup(void *p) (*pollset->provider->cleanup)(pollset); } if (pollset->flags & APR_POLLSET_WAKEABLE) { - close_wakeup_pipe(pollset); + close_wakeup_pipe(pollset->wakeup_pipe); } return APR_SUCCESS; @@ -287,8 +153,15 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **ret_pollset, pollset->provider = provider; } if (flags & APR_POLLSET_WAKEABLE) { + apr_pollfd_t pfd; + /* Create wakeup pipe */ - if ((rv = create_wakeup_pipe(pollset)) != APR_SUCCESS) { + if ((rv = create_wakeup_pipe(pollset->pool, &pfd, + pollset->wakeup_pipe)) != APR_SUCCESS) { + return rv; + } + + if ((rv = apr_pollset_add(pollset, &pfd)) != APR_SUCCESS) { return rv; } } diff --git a/poll/unix/port.c b/poll/unix/port.c index 7a31c468324..b11c54c46d5 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -405,7 +405,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, if ((pollset->flags & APR_POLLSET_WAKEABLE) && fp.desc_type == APR_POLL_FILE && fp.desc.f == pollset->wakeup_pipe[0]) { - apr_pollset_drain_wakeup_pipe(pollset); + drain_wakeup_pipe(pollset->wakeup_pipe); rv = APR_EINTR; } else { @@ -458,9 +458,8 @@ static apr_pollset_provider_t impl = { apr_pollset_provider_t *apr_pollset_provider_port = &impl; -static apr_status_t cb_cleanup(void *p_) +static apr_status_t impl_pollcb_cleanup(apr_pollcb_t *pollcb) { - apr_pollcb_t *pollcb = (apr_pollcb_t *) p_; close(pollcb->fd); return APR_SUCCESS; } @@ -488,7 +487,6 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, } pollcb->pollset.port = apr_palloc(p, size * sizeof(port_event_t)); - apr_pool_cleanup_register(p, pollcb, cb_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; } @@ -541,16 +539,25 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, apr_pollcb_cb_t func, void *baton) { - apr_pollfd_t *pollfd; apr_status_t rv; - unsigned int i, nget = 1; + unsigned int nget = 1; rv = call_port_getn(pollcb->fd, pollcb->pollset.port, pollcb->nalloc, &nget, timeout); if (nget) { + unsigned int i; + for (i = 0; i < nget; i++) { - pollfd = (apr_pollfd_t *)(pollcb->pollset.port[i].portev_user); + apr_pollfd_t *pollfd = (apr_pollfd_t *)(pollcb->pollset.port[i].portev_user); + + if ((pollfd->flags & APR_POLLSET_WAKEABLE) && + pollfd->desc_type == APR_POLL_FILE && + pollfd->desc.f == pollfd->wakeup_pipe[0]) { + drain_wakeup_pipe(pollfd->wakeup_pipe); + return APR_EINTR; + } + pollfd->rtnevents = get_revent(pollcb->pollset.port[i].portev_events); rv = func(baton, pollfd); @@ -569,6 +576,7 @@ static apr_pollcb_provider_t impl_cb = { impl_pollcb_add, impl_pollcb_remove, impl_pollcb_poll, + impl_pollcb_cleanup, "port" }; diff --git a/poll/unix/select.c b/poll/unix/select.c index 9288de00cc5..f4bd482d368 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -382,7 +382,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, else { if ((pollset->flags & APR_POLLSET_WAKEABLE) && pollset->p->query_set[i].desc.f == pollset->wakeup_pipe[0]) { - apr_pollset_drain_wakeup_pipe(pollset); + drain_wakeup_pipe(pollset->wakeup_pipe); rv = APR_EINTR; continue; } diff --git a/poll/unix/wakeup.c b/poll/unix/wakeup.c new file mode 100644 index 00000000000..f4b20d035c5 --- /dev/null +++ b/poll/unix/wakeup.c @@ -0,0 +1,151 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr.h" +#include "apr_poll.h" +#include "apr_time.h" +#include "apr_portable.h" +#include "apr_arch_file_io.h" +#include "apr_arch_networkio.h" +#include "apr_arch_poll_private.h" +#include "apr_arch_inherit.h" + +#if !APR_FILES_AS_SOCKETS + +#ifdef WIN32 + +apr_status_t create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd, + apr_file_t **wakeup_pipe) +{ + apr_status_t rv; + + if ((rv = file_socket_pipe_create(&wakeup_pipe[0], &wakeup_pipe[1], + pool)) != APR_SUCCESS) + return rv; + + pfd->reqevents = APR_POLLIN; + pfd->desc_type = APR_POLL_FILE; + pfd->desc.f = wakeup_pipe[0]; + return APR_SUCCESS; +} + +apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe) +{ + apr_status_t rv0 = APR_SUCCESS; + apr_status_t rv1 = APR_SUCCESS; + + /* Close both sides of the wakeup pipe */ + if (wakeup_pipe[0]) { + rv0 = file_socket_pipe_close(wakeup_pipe[0]); + wakeup_pipe[0] = NULL; + } + if (wakeup_pipe[1]) { + rv1 = file_socket_pipe_close(wakeup_pipe[1]); + wakeup_pipe[1] = NULL; + } + return rv0 ? rv0 : rv1 +} + +#else /* !WIN32 */ + +apr_status_t create_wakeup_pipe(apr_pollfd_t *pfd, apr_file_t **wakeup_pipe) +{ + return APR_ENOTIMPL; +} + +apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe) +{ + return APR_ENOTIMPL; +} + +#endif /* !WIN32 */ + +#else /* APR_FILES_AS_SOCKETS */ + +apr_status_t create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd, + apr_file_t **wakeup_pipe) +{ + apr_status_t rv; + + if ((rv = apr_file_pipe_create(&wakeup_pipe[0], &wakeup_pipe[1], + pool)) != APR_SUCCESS) + return rv; + + pfd->p = pool; + pfd->reqevents = APR_POLLIN; + pfd->desc_type = APR_POLL_FILE; + pfd->desc.f = wakeup_pipe[0]; + + { + int flags; + + if ((flags = fcntl(wakeup_pipe[0]->filedes, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl(wakeup_pipe[0]->filedes, F_SETFD, flags) == -1) + return errno; + } + { + int flags; + + if ((flags = fcntl(wakeup_pipe[1]->filedes, F_GETFD)) == -1) + return errno; + + flags |= FD_CLOEXEC; + if (fcntl(wakeup_pipe[1]->filedes, F_SETFD, flags) == -1) + return errno; + } + + return APR_SUCCESS; +} + +apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe) +{ + apr_status_t rv0 = APR_SUCCESS; + apr_status_t rv1 = APR_SUCCESS; + + /* Close both sides of the wakeup pipe */ + if (wakeup_pipe[0]) { + rv0 = apr_file_close(wakeup_pipe[0]); + wakeup_pipe[0] = NULL; + } + if (wakeup_pipe[1]) { + rv1 = apr_file_close(wakeup_pipe[1]); + wakeup_pipe[1] = NULL; + } + return rv0 ? rv0 : rv1; +} + +#endif /* APR_FILES_AS_SOCKETS */ + +/* Read and discard whatever is in the wakeup pipe. + */ +void drain_wakeup_pipe(apr_file_t **wakeup_pipe) +{ + char rb[512]; + apr_size_t nr = sizeof(rb); + + while (apr_file_read(wakeup_pipe[0], rb, &nr) == APR_SUCCESS) { + /* Although we write just one byte to the other end of the pipe + * during wakeup, multiple threads could call the wakeup. + * So simply drain out from the input side of the pipe all + * the data. + */ + if (nr != sizeof(rb)) + break; + } +} diff --git a/test/testpoll.c b/test/testpoll.c index b298c91651f..ab31a3deb70 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -586,9 +586,9 @@ typedef struct pollcb_baton_t { int count; } pollcb_baton_t; -static apr_status_t trigger_pollcb_cb(void* baton, apr_pollfd_t *descriptor) +static apr_status_t trigger_pollcb_cb(void *baton, apr_pollfd_t *descriptor) { - pollcb_baton_t* pcb = (pollcb_baton_t*) baton; + pollcb_baton_t *pcb = (pollcb_baton_t *) baton; ABTS_PTR_EQUAL(pcb->tc, s[0], descriptor->desc.s); ABTS_PTR_EQUAL(pcb->tc, s[0], descriptor->client_data); pcb->count++; @@ -769,6 +769,56 @@ static void pollcb_default(abts_case *tc, void *data) } } +static void pollset_wakeup(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_pollset_t *pollset; + apr_int32_t num; + const apr_pollfd_t *descriptors; + + rv = apr_pollset_create(&pollset, 1, p, APR_POLLSET_WAKEABLE); + if (rv == APR_ENOTIMPL) { + ABTS_NOT_IMPL(tc, "apr_pollset_wakeup() not supported"); + return; + } + + rv = apr_pollset_wakeup(pollset); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_pollset_poll(pollset, -1, &num, &descriptors); + ABTS_INT_EQUAL(tc, APR_EINTR, rv); +} + +/* Should never be invoked */ +static apr_status_t wakeup_pollcb_cb(void *baton, apr_pollfd_t *descriptor) +{ + abts_case *tc = (abts_case *) baton; + + ABTS_FAIL(tc, "pollcb callback invoked on apr_pollcb_wakeup()"); + return APR_SUCCESS; +} + +static void pollcb_wakeup(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_pollcb_t *pcb; + + rv = apr_pollcb_create(&pcb, 1, p, APR_POLLSET_WAKEABLE); + if (rv == APR_ENOTIMPL) { + ABTS_NOT_IMPL(tc, "pollcb interface not supported"); + return; + } + else { + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + } + + rv = apr_pollcb_wakeup(pcb); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_pollcb_poll(pcb, -1, wakeup_pollcb_cb, tc); + ABTS_INT_EQUAL(tc, APR_EINTR, rv); +} + abts_suite *testpoll(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -808,6 +858,9 @@ abts_suite *testpoll(abts_suite *suite) abts_run_test(suite, close_all_sockets, NULL); abts_run_test(suite, pollset_default, NULL); abts_run_test(suite, pollcb_default, NULL); + + abts_run_test(suite, pollset_wakeup, NULL); + abts_run_test(suite, pollcb_wakeup, NULL); return suite; } From a4baf8f86321fc74b27914dcf34c06dc97562944 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 16 Jan 2010 09:10:05 +0000 Subject: [PATCH 6671/7878] Add the APR_TYPEDEF_STRUCT macro to provide an implementation of complete types where only an incomplete type is available. Remove the driver parameter from the apr_crypto API, the driver is now wrapped inside the apr_crypto_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@899910 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 55 ++++++++++++++------------- crypto/apr_crypto_nss.c | 8 ++-- crypto/apr_crypto_openssl.c | 8 ++-- include/apr_crypto.h | 44 +++++++++------------ include/apr_general.h | 10 +++++ include/private/apr_crypto_internal.h | 4 +- test/testcrypto.c | 36 +++++++++--------- 7 files changed, 87 insertions(+), 78 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 2369f628206..07ba351aafe 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -39,6 +39,11 @@ static apr_hash_t *drivers = NULL; #define CLEANUP_CAST (apr_status_t (*)(void*)) +APR_TYPEDEF_STRUCT(apr_crypto_t, \ + apr_pool_t *pool; \ + apr_crypto_driver_t *provider; \ +) + #if !APR_HAVE_MODULAR_DSO #define DRIVER_LOAD(name,driver,pool,params) \ { \ @@ -195,9 +200,9 @@ APR_DECLARE(const char *)apr_crypto_driver_name (const apr_crypto_driver_t *driv * @param result - the result structure * @return APR_SUCCESS for success */ -APR_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_driver_t *driver, +APR_DECLARE(apr_status_t) apr_crypto_error( const apr_crypto_t *f, const apu_err_t **result) { - return driver->error(f, result); + return f->provider->error(f, result); } /** @@ -209,7 +214,7 @@ APR_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_driver_t *driver, */ APR_DECLARE(apr_status_t) apr_crypto_make(const apr_crypto_driver_t *driver, apr_pool_t *pool, const apr_array_header_t *params, apr_crypto_t **f) { - return driver->make(pool, params, f); + return driver->make(pool, driver, params, f); } /** @@ -240,13 +245,12 @@ APR_DECLARE(apr_status_t) apr_crypto_make(const apr_crypto_driver_t *driver, * not known. APR_EPADDING if padding was requested but is not supported. * APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_passphrase(const apr_crypto_driver_t *driver, - apr_pool_t *p, const apr_crypto_t *f, const char *pass, - apr_size_t passLen, const unsigned char * salt, apr_size_t saltLen, - const apr_crypto_block_key_type_e type, +APR_DECLARE(apr_status_t) apr_crypto_passphrase(apr_pool_t *p, const apr_crypto_t *f, + const char *pass, apr_size_t passLen, const unsigned char * salt, + apr_size_t saltLen, const apr_crypto_block_key_type_e type, const apr_crypto_block_key_mode_e mode, const int doPad, const int iterations, apr_crypto_key_t **key, apr_size_t *ivSize) { - return driver->passphrase(p, f, pass, passLen, salt, saltLen, type, mode, + return f->provider->passphrase(p, f, pass, passLen, salt, saltLen, type, mode, doPad, iterations, key, ivSize); } @@ -268,12 +272,11 @@ APR_DECLARE(apr_status_t) apr_crypto_passphrase(const apr_crypto_driver_t *drive * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init( - const apr_crypto_driver_t *driver, apr_pool_t *p, +APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init(apr_pool_t *p, const apr_crypto_t *f, const apr_crypto_key_t *key, const unsigned char **iv, apr_crypto_block_t **ctx, apr_size_t *blockSize) { - return driver->block_encrypt_init(p, f, key, iv, ctx, blockSize); + return f->provider->block_encrypt_init(p, f, key, iv, ctx, blockSize); } /** @@ -296,10 +299,10 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init( * not implemented. */ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt( - const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx, + const apr_crypto_t *f, apr_crypto_block_t *ctx, unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen) { - return driver->block_encrypt(ctx, out, outlen, in, inlen); + return f->provider->block_encrypt(ctx, out, outlen, in, inlen); } /** @@ -322,9 +325,9 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt( * @return APR_ENOTIMPL if not implemented. */ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish( - const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx, + const apr_crypto_t *f, apr_crypto_block_t *ctx, unsigned char *out, apr_size_t *outlen) { - return driver->block_encrypt_finish(ctx, out, outlen); + return f->provider->block_encrypt_finish(ctx, out, outlen); } /** @@ -342,12 +345,11 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish( * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init( - const apr_crypto_driver_t *driver, apr_pool_t *p, +APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init(apr_pool_t *p, const apr_crypto_t *f, const apr_crypto_key_t *key, const unsigned char *iv, apr_crypto_block_t **ctx, apr_size_t *blockSize) { - return driver->block_decrypt_init(p, f, key, iv, ctx, blockSize); + return f->provider->block_decrypt_init(p, f, key, iv, ctx, blockSize); } /** @@ -370,10 +372,10 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init( * not implemented. */ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt( - const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx, + const apr_crypto_t *f, apr_crypto_block_t *ctx, unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen) { - return driver->block_decrypt(ctx, out, outlen, in, inlen); + return f->provider->block_decrypt(ctx, out, outlen, in, inlen); } /** @@ -396,9 +398,9 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt( * @return APR_ENOTIMPL if not implemented. */ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish( - const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx, + const apr_crypto_t *f, apr_crypto_block_t *ctx, unsigned char *out, apr_size_t *outlen) { - return driver->block_decrypt_finish(ctx, out, outlen); + return f->provider->block_decrypt_finish(ctx, out, outlen); } /** @@ -409,8 +411,8 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish( * @return Returns APR_ENOTIMPL if not supported. */ APR_DECLARE(apr_status_t) apr_crypto_block_cleanup( - const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx) { - return driver->block_cleanup(ctx); + const apr_crypto_t *f, apr_crypto_block_t *ctx) { + return f->provider->block_cleanup(ctx); } /** @@ -420,9 +422,8 @@ APR_DECLARE(apr_status_t) apr_crypto_block_cleanup( * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ -APR_DECLARE(apr_status_t) apr_crypto_cleanup(const apr_crypto_driver_t *driver, - apr_crypto_t *f) { - return driver->cleanup(f); +APR_DECLARE(apr_status_t) apr_crypto_cleanup(apr_crypto_t *f) { + return f->provider->cleanup(f); } /** diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 22673c54eff..1f677b6e68e 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -47,6 +47,7 @@ struct apr_crypto_t { apr_pool_t *pool; + const apr_crypto_driver_t *provider; apu_err_t *result; apr_array_header_t *keys; apr_crypto_config_t *config; @@ -74,8 +75,8 @@ struct apr_crypto_block_t { * Fetch the most recent error from this driver. */ static apr_status_t crypto_error(const apr_crypto_t *f, const apu_err_t **result) { - *result = f->result; - return APR_SUCCESS; + *result = f->result; + return APR_SUCCESS; } /** @@ -226,7 +227,7 @@ static apr_status_t crypto_cleanup_helper(void *data) * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ -static apr_status_t crypto_make(apr_pool_t *pool, +static apr_status_t crypto_make(apr_pool_t *pool, const apr_crypto_driver_t *provider, const apr_array_header_t *params, apr_crypto_t **ff) { @@ -241,6 +242,7 @@ static apr_status_t crypto_make(apr_pool_t *pool, } *ff = f; f->pool = pool; + f->provider = provider; config = f->config = apr_pcalloc(pool, sizeof(apr_crypto_config_t)); if (!config) { return APR_ENOMEM; diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 48f91bddab0..55a0c2f4782 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -37,6 +37,7 @@ struct apr_crypto_t { apr_pool_t *pool; + const apr_crypto_driver_t *provider; apu_err_t *result; apr_array_header_t *keys; apr_crypto_config_t *config; @@ -68,8 +69,8 @@ struct apr_crypto_block_t { * Fetch the most recent error from this driver. */ static apr_status_t crypto_error(const apr_crypto_t *f, const apu_err_t **result) { - *result = f->result; - return APR_SUCCESS; + *result = f->result; + return APR_SUCCESS; } /** @@ -163,7 +164,7 @@ static apr_status_t crypto_cleanup_helper(void *data) { * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ -static apr_status_t crypto_make(apr_pool_t *pool, +static apr_status_t crypto_make(apr_pool_t *pool, const apr_crypto_driver_t *provider, const apr_array_header_t *params, apr_crypto_t **ff) { apr_crypto_config_t *config = NULL; struct apr_crypto_param_t *ents = @@ -175,6 +176,7 @@ static apr_status_t crypto_make(apr_pool_t *pool, } *ff = f; f->pool = pool; + f->provider = provider; config = f->config = apr_pcalloc(pool, sizeof(apr_crypto_config_t)); if (!config) { return APR_ENOMEM; diff --git a/include/apr_crypto.h b/include/apr_crypto.h index e51d760d62a..d03cdd455a5 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -20,6 +20,7 @@ #include "apu.h" #include "apr_pools.h" #include "apr_tables.h" +#include "apr_dso.h" #include "apu_errno.h" #ifdef __cplusplus @@ -219,8 +220,8 @@ APR_DECLARE(const char *) apr_crypto_driver_name(const apr_crypto_driver_t *driv * @param result - the result structure * @return APR_SUCCESS for success */ -APR_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_driver_t *driver, - const apr_crypto_t *f, const apu_err_t **result); +APR_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_t *f, + const apu_err_t **result); /** * @brief Create a context for supporting encryption. Keys, certificates, @@ -265,10 +266,9 @@ APR_DECLARE(apr_status_t) apr_crypto_make(const apr_crypto_driver_t *driver, * not known. APR_EPADDING if padding was requested but is not supported. * APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_passphrase(const apr_crypto_driver_t *driver, - apr_pool_t *p, const apr_crypto_t *f, const char *pass, - apr_size_t passLen, const unsigned char * salt, apr_size_t saltLen, - const apr_crypto_block_key_type_e type, +APR_DECLARE(apr_status_t) apr_crypto_passphrase(apr_pool_t *p, const apr_crypto_t *f, + const char *pass, apr_size_t passLen, const unsigned char * salt, + apr_size_t saltLen, const apr_crypto_block_key_type_e type, const apr_crypto_block_key_mode_e mode, const int doPad, const int iterations, apr_crypto_key_t **key, apr_size_t *ivSize); @@ -290,8 +290,7 @@ APR_DECLARE(apr_status_t) apr_crypto_passphrase(const apr_crypto_driver_t *drive * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init( - const apr_crypto_driver_t *driver, apr_pool_t *p, +APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init(apr_pool_t *p, const apr_crypto_t *f, const apr_crypto_key_t *key, const unsigned char **iv, apr_crypto_block_t **ctx, apr_size_t *blockSize); @@ -315,10 +314,9 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init( * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_encrypt( - const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx, - unsigned char **out, apr_size_t *outlen, const unsigned char *in, - apr_size_t inlen); +APR_DECLARE(apr_status_t) apr_crypto_block_encrypt(const apr_crypto_t *f, + apr_crypto_block_t *ctx, unsigned char **out, apr_size_t *outlen, + const unsigned char *in, apr_size_t inlen); /** * @brief Encrypt final data block, write it to out. @@ -339,9 +337,8 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt( * formatted. * @return APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish( - const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx, - unsigned char *out, apr_size_t *outlen); +APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(const apr_crypto_t *f, + apr_crypto_block_t *ctx, unsigned char *out, apr_size_t *outlen); /** * @brief Initialise a context for decrypting arbitrary data using the given key. @@ -358,8 +355,7 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish( * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init( - const apr_crypto_driver_t *driver, apr_pool_t *p, +APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init(apr_pool_t *p, const apr_crypto_t *f, const apr_crypto_key_t *key, const unsigned char *iv, apr_crypto_block_t **ctx, apr_size_t *blockSize); @@ -383,10 +379,9 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init( * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_decrypt( - const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx, - unsigned char **out, apr_size_t *outlen, const unsigned char *in, - apr_size_t inlen); +APR_DECLARE(apr_status_t) apr_crypto_block_decrypt(const apr_crypto_t *f, + apr_crypto_block_t *ctx, unsigned char **out, apr_size_t *outlen, + const unsigned char *in, apr_size_t inlen); /** * @brief Decrypt final data block, write it to out. @@ -408,7 +403,7 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt( * @return APR_ENOTIMPL if not implemented. */ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish( - const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx, + const apr_crypto_t *f, apr_crypto_block_t *ctx, unsigned char *out, apr_size_t *outlen); /** @@ -419,7 +414,7 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish( * @return Returns APR_ENOTIMPL if not supported. */ APR_DECLARE(apr_status_t) apr_crypto_block_cleanup( - const apr_crypto_driver_t *driver, apr_crypto_block_t *ctx); + const apr_crypto_t *f, apr_crypto_block_t *ctx); /** * @brief Clean encryption / decryption context. @@ -428,8 +423,7 @@ APR_DECLARE(apr_status_t) apr_crypto_block_cleanup( * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ -APR_DECLARE(apr_status_t) apr_crypto_cleanup(const apr_crypto_driver_t *driver, - apr_crypto_t *f); +APR_DECLARE(apr_status_t) apr_crypto_cleanup(apr_crypto_t *f); /** * @brief Shutdown the crypto library. diff --git a/include/apr_general.h b/include/apr_general.h index db1f25bc819..01d2e076678 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -160,6 +160,16 @@ int strncasecmp(const char *a, const char *b, size_t n); void *memchr(const void *s, int c, size_t n); #endif +/** + * Macro to provide a way to turn an incomplete type into a complete + * type containing common pointers for a provider. + */ +#define APR_TYPEDEF_STRUCT(type, incompletion) \ +struct type { \ + incompletion \ + void *unk[]; \ +}; + /** @} */ /** diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index 20b0c80eece..d253bcfaf86 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -60,8 +60,8 @@ struct apr_crypto_driver_t { * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ - apr_status_t (*make)(apr_pool_t *pool, const apr_array_header_t *params, - apr_crypto_t **f); + apr_status_t (*make)(apr_pool_t *pool, const apr_crypto_driver_t *provider, + const apr_array_header_t *params, apr_crypto_t **f); /** * @brief Create a key from the given passphrase. By default, the PBKDF2 diff --git a/test/testcrypto.c b/test/testcrypto.c index c44ea024ab0..ce9af846e08 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -107,16 +107,16 @@ static const apr_crypto_key_t *passphrase(abts_case *tc, apr_pool_t *pool, const char *salt = "salt"; apr_status_t rv; - if (!driver || !f) { + if (!f) { return NULL; } /* init the passphrase */ - rv = apr_crypto_passphrase(driver, pool, f, pass, strlen(pass), + rv = apr_crypto_passphrase(pool, f, pass, strlen(pass), (unsigned char *) salt, strlen(salt), type, mode, doPad, 4096, &key, NULL); if (APR_ENOCIPHER == rv) { - apr_crypto_error(driver, f, &result); + apr_crypto_error(f, &result); ABTS_NOT_IMPL(tc, apr_psprintf(pool, "skipped: %s %s passphrase return APR_ENOCIPHER: error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, @@ -124,7 +124,7 @@ static const apr_crypto_key_t *passphrase(abts_case *tc, apr_pool_t *pool, return NULL; } else { if (APR_SUCCESS != rv) { - apr_crypto_error(driver, f, &result); + apr_crypto_error(f, &result); fprintf(stderr, "passphrase: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", @@ -160,13 +160,13 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, } /* init the encryption */ - rv = apr_crypto_block_encrypt_init(driver, pool, f, key, iv, &block, + rv = apr_crypto_block_encrypt_init(pool, f, key, iv, &block, blockSize); if (APR_ENOTIMPL == rv) { ABTS_NOT_IMPL(tc, "apr_crypto_block_encrypt_init returned APR_ENOTIMPL"); } else { if (APR_SUCCESS != rv) { - apr_crypto_error(driver, f, &result); + apr_crypto_error(f, &result); fprintf(stderr, "encrypt_init: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", @@ -184,10 +184,10 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, } /* encrypt the block */ - rv = apr_crypto_block_encrypt(driver, block, cipherText, + rv = apr_crypto_block_encrypt(f, block, cipherText, cipherTextLen, in, inlen); if (APR_SUCCESS != rv) { - apr_crypto_error(driver, f, &result); + apr_crypto_error(f, &result); fprintf(stderr, "encrypt: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", @@ -201,10 +201,10 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, } /* finalise the encryption */ - rv = apr_crypto_block_encrypt_finish(driver, block, *cipherText + rv = apr_crypto_block_encrypt_finish(f, block, *cipherText + *cipherTextLen, &len); if (APR_SUCCESS != rv) { - apr_crypto_error(driver, f, &result); + apr_crypto_error(f, &result); fprintf(stderr, "encrypt_finish: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", @@ -214,7 +214,7 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, ABTS_ASSERT(tc, "apr_crypto_block_encrypt_finish returned APR_EPADDING", rv != APR_EPADDING); ABTS_ASSERT(tc, "failed to apr_crypto_block_encrypt_finish", rv == APR_SUCCESS); *cipherTextLen += len; - apr_crypto_block_cleanup(driver, block); + apr_crypto_block_cleanup(f, block); if (rv) { return NULL; } @@ -240,13 +240,13 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, } /* init the decryption */ - rv = apr_crypto_block_decrypt_init(driver, pool, f, key, iv, &block, + rv = apr_crypto_block_decrypt_init(pool, f, key, iv, &block, blockSize); if (APR_ENOTIMPL == rv) { ABTS_NOT_IMPL(tc, "apr_crypto_block_decrypt_init returned APR_ENOTIMPL"); } else { if (APR_SUCCESS != rv) { - apr_crypto_error(driver, f, &result); + apr_crypto_error(f, &result); fprintf(stderr, "decrypt_init: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", @@ -264,10 +264,10 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, } /* decrypt the block */ - rv = apr_crypto_block_decrypt(driver, block, plainText, plainTextLen, + rv = apr_crypto_block_decrypt(f, block, plainText, plainTextLen, cipherText, cipherTextLen); if (APR_SUCCESS != rv) { - apr_crypto_error(driver, f, &result); + apr_crypto_error(f, &result); fprintf(stderr, "decrypt: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", @@ -281,10 +281,10 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, } /* finalise the decryption */ - rv = apr_crypto_block_decrypt_finish(driver, block, *plainText + rv = apr_crypto_block_decrypt_finish(f, block, *plainText + *plainTextLen, &len); if (APR_SUCCESS != rv) { - apr_crypto_error(driver, f, &result); + apr_crypto_error(f, &result); fprintf(stderr, "decrypt_finish: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", @@ -298,7 +298,7 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, } *plainTextLen += len; - apr_crypto_block_cleanup(driver, block); + apr_crypto_block_cleanup(f, block); return *plainText; From be3989d181a20b3c23b5dd91ff3e066ad01dedea Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 17 Jan 2010 10:40:59 +0000 Subject: [PATCH 6672/7878] When adding members to an existing struct, add them to the end(!!!) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@900089 13f79535-47bb-0310-9956-ffa450edef68 --- include/private/apr_crypto_internal.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index d253bcfaf86..db71a7fca62 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -40,14 +40,6 @@ struct apr_crypto_driver_t { */ apr_status_t (*init)(apr_pool_t *pool, const apr_array_header_t *params, int *rc); - /** - * @brief: fetch the most recent error from this driver. - * @param f - context pointer - * @param result - the result structure - * @return APR_SUCCESS for success. - */ - apr_status_t (*error)(const apr_crypto_t *f, const apu_err_t **result); - /** * @brief Create a context for supporting encryption. Keys, certificates, * algorithms and other parameters will be set per context. More than @@ -250,6 +242,14 @@ struct apr_crypto_driver_t { */ apr_status_t (*shutdown)(apr_pool_t *p); + /** + * @brief: fetch the most recent error from this driver. + * @param f - context pointer + * @param result - the result structure + * @return APR_SUCCESS for success. + */ + apr_status_t (*error)(const apr_crypto_t *f, const apu_err_t **result); + }; #endif From dbde6a3ea192854ff01c77fd204d3c0f56a69109 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 19 Jan 2010 22:20:46 +0000 Subject: [PATCH 6673/7878] Revert r817806. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@900981 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 12 +++++------- tables/apr_hash.c | 42 ++++++++---------------------------------- 2 files changed, 13 insertions(+), 41 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index bf6532205e4..8e48c7ecf15 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -73,7 +73,7 @@ APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *key, /** * Create a hash table. * @param pool The pool to allocate the hash table out of - * @return The hash table just created, or NULL if memory allocation failed + * @return The hash table just created */ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool); @@ -81,7 +81,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool); * Create a hash table with a custom hash function * @param pool The pool to allocate the hash table out of * @param hash_func A custom hash function. - * @return The hash table just created, or NULL if memory allocation failed + * @return The hash table just created */ APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool, apr_hashfunc_t hash_func); @@ -90,7 +90,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool, * Make a copy of a hash table * @param pool The pool from which to allocate the new hash table * @param h The hash table to clone - * @return The hash table just created, or NULL if memory allocation failed + * @return The hash table just created * @remark Makes a shallow copy */ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, @@ -186,8 +186,7 @@ APR_DECLARE(void) apr_hash_clear(apr_hash_t *ht); * @param p The pool to use for the new hash table * @param overlay The table to add to the initial table * @param base The table that represents the initial values of the new table - * @return A new hash table containing all of the data from the two passed in, - * or NULL if memory allocation failed + * @return A new hash table containing all of the data from the two passed in */ APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p, const apr_hash_t *overlay, @@ -205,8 +204,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p, * make values from h1 override values from h2 (same semantics as * apr_hash_overlay()) * @param data Client data to pass to the merger function - * @return A new hash table containing all of the data from the two passed in, - * or NULL if memory allocation failed. + * @return A new hash table containing all of the data from the two passed in */ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, const apr_hash_t *h1, diff --git a/tables/apr_hash.c b/tables/apr_hash.c index b2990ba6496..05ee42f46e6 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -67,15 +67,12 @@ struct apr_hash_index_t { /* * The size of the array is always a power of two. We use the maximum * index rather than the size so that we can use bitwise-AND for - * modular arithmetic. The count of hash entries may be greater - * depending on the chosen collision rate. - * - * We allocate the bucket array in a sub-pool, "array_pool". This allows us - * to reclaim the old bucket array after an expansion. + * modular arithmetic. + * The count of hash entries may be greater depending on the chosen + * collision rate. */ struct apr_hash_t { apr_pool_t *pool; - apr_pool_t *array_pool; apr_hash_entry_t **array; apr_hash_index_t iterator; /* For apr_hash_first(NULL, ...) */ unsigned int count, max; @@ -92,20 +89,14 @@ struct apr_hash_t { static apr_hash_entry_t **alloc_array(apr_hash_t *ht, unsigned int max) { - return apr_pcalloc(ht->array_pool, sizeof(*ht->array) * (max + 1)); + return apr_pcalloc(ht->pool, sizeof(*ht->array) * (max + 1)); } APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) { - apr_pool_t *array_pool; apr_hash_t *ht; - - if (apr_pool_create(&array_pool, pool) != APR_SUCCESS) - return NULL; - ht = apr_palloc(pool, sizeof(apr_hash_t)); ht->pool = pool; - ht->array_pool = array_pool; ht->free = NULL; ht->count = 0; ht->max = INITIAL_MAX; @@ -172,17 +163,10 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, static void expand_array(apr_hash_t *ht) { - apr_pool_t *new_array_pool; - apr_pool_t *old_array_pool; apr_hash_index_t *hi; apr_hash_entry_t **new_array; unsigned int new_max; - if (apr_pool_create(&new_array_pool, ht->pool) != APR_SUCCESS) - return; /* Give up and don't try to expand the array */ - old_array_pool = ht->array_pool; - ht->array_pool = new_array_pool; - new_max = ht->max * 2 + 1; new_array = alloc_array(ht, new_max); for (hi = apr_hash_first(NULL, ht); hi; hi = apr_hash_next(hi)) { @@ -192,8 +176,6 @@ static void expand_array(apr_hash_t *ht) } ht->array = new_array; ht->max = new_max; - - apr_pool_destroy(old_array_pool); } APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, @@ -306,25 +288,22 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, const apr_hash_t *orig) { - apr_pool_t *array_pool; apr_hash_t *ht; apr_hash_entry_t *new_vals; unsigned int i, j; - if (apr_pool_create(&array_pool, pool) != APR_SUCCESS) - return NULL; - ht = apr_palloc(pool, sizeof(apr_hash_t) + + sizeof(*ht->array) * (orig->max + 1) + sizeof(apr_hash_entry_t) * orig->count); ht->pool = pool; - ht->array_pool = array_pool; ht->free = NULL; ht->count = orig->count; ht->max = orig->max; ht->hash_func = orig->hash_func; - ht->array = alloc_array(ht, ht->max); + ht->array = (apr_hash_entry_t **)((char *)ht + sizeof(apr_hash_t)); - new_vals = (apr_hash_entry_t *)((char *)(ht) + sizeof(apr_hash_t)); + new_vals = (apr_hash_entry_t *)((char *)(ht) + sizeof(apr_hash_t) + + sizeof(*ht->array) * (orig->max + 1)); j = 0; for (i = 0; i <= ht->max; i++) { apr_hash_entry_t **new_entry = &(ht->array[i]); @@ -413,7 +392,6 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, const void *data), const void *data) { - apr_pool_t *array_pool; apr_hash_t *res; apr_hash_entry_t *new_vals = NULL; apr_hash_entry_t *iter; @@ -437,12 +415,8 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, } #endif - if (apr_pool_create(&array_pool, p) != APR_SUCCESS) - return NULL; - res = apr_palloc(p, sizeof(apr_hash_t)); res->pool = p; - res->array_pool = array_pool; res->free = NULL; res->hash_func = base->hash_func; res->count = base->count; From 56a36e9660c03736975c54e2fff73c66ec086eb0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 20 Jan 2010 06:46:41 +0000 Subject: [PATCH 6674/7878] Update for performance de-optimization and seperate expat .dll location git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@901087 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++++ libapr.dsp | 4 ++++ test/Makefile.win | 5 +---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apr.dsp b/apr.dsp index 4dd9e295a17..7321a48ab23 100644 --- a/apr.dsp +++ b/apr.dsp @@ -562,6 +562,10 @@ SOURCE=.\poll\unix\poll.c SOURCE=.\poll\unix\select.c # End Source File +# Begin Source File + +SOURCE=.\poll\unix\wakeup.c +# End Source File # End Group # Begin Group "random" diff --git a/libapr.dsp b/libapr.dsp index bf5b1dc67fe..17e2ae3672f 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -597,6 +597,10 @@ SOURCE=.\poll\unix\poll.c SOURCE=.\poll\unix\select.c # End Source File +# Begin Source File + +SOURCE=.\poll\unix\wakeup.c +# End Source File # End Group # Begin Group "random" diff --git a/test/Makefile.win b/test/Makefile.win index c06b17d78ff..0bcc026cc70 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -171,6 +171,7 @@ STATIC_CFLAGS = /D APR_DECLARE_STATIC LOCAL_LIB= ..\$(OUTDIR)\libapr-2.lib APP_LIB= ..\$(OUTDIR)\libaprapp-2.lib STATIC_CFLAGS = +PATH=$(OUTDIR);..\$(OUTDIR);..\..\expat\win32\bin\$(OUTDIR);$(PATH) !ENDIF !IFDEF _DEBUG @@ -299,10 +300,6 @@ cleanall: %COMSPEC% /c "cd %%d & $(MAKE) -f Makefile.win cleanall" \ -!IF "$(MODEL)" != "static" -PATH=$(OUTDIR);..\$(OUTDIR);$(PATH) -!ENDIF - check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) @for %p in ($(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)) do @( \ echo Testing %p && %p -v || echo %p failed \ From 496fb2b7e60ebc2d0a88291ad7af5ff8603f6e44 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 20 Jan 2010 06:47:31 +0000 Subject: [PATCH 6675/7878] fix missing semicolon git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@901088 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/wakeup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/wakeup.c b/poll/unix/wakeup.c index f4b20d035c5..788498330eb 100644 --- a/poll/unix/wakeup.c +++ b/poll/unix/wakeup.c @@ -56,7 +56,7 @@ apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe) rv1 = file_socket_pipe_close(wakeup_pipe[1]); wakeup_pipe[1] = NULL; } - return rv0 ? rv0 : rv1 + return rv0 ? rv0 : rv1; } #else /* !WIN32 */ From ac4ce02a43ef81e2fa7abc2c4fc2e7ae568c405a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 22 Jan 2010 12:29:10 +0000 Subject: [PATCH 6676/7878] eol-style -> native git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@902073 13f79535-47bb-0310-9956-ffa450edef68 --- include/apu.h | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/include/apu.h b/include/apu.h index 018bf638a6e..ab119730fd5 100644 --- a/include/apu.h +++ b/include/apu.h @@ -1,23 +1,23 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* @file apu.h - * @brief APR-Utility main file - * @deprecated @see apr.h - */ - -#include - +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* @file apu.h + * @brief APR-Utility main file + * @deprecated @see apr.h + */ + +#include + From b62b3c393e1e6bf497f4a1be24d788be90bd6e7a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 22 Jan 2010 12:52:16 +0000 Subject: [PATCH 6677/7878] fix compile failure in pollcb wakeup logic on Solaris >= 10 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@902077 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index b11c54c46d5..2253e8becaf 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -551,10 +551,10 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, for (i = 0; i < nget; i++) { apr_pollfd_t *pollfd = (apr_pollfd_t *)(pollcb->pollset.port[i].portev_user); - if ((pollfd->flags & APR_POLLSET_WAKEABLE) && + if ((pollcb->flags & APR_POLLSET_WAKEABLE) && pollfd->desc_type == APR_POLL_FILE && - pollfd->desc.f == pollfd->wakeup_pipe[0]) { - drain_wakeup_pipe(pollfd->wakeup_pipe); + pollfd->desc.f == pollcb->wakeup_pipe[0]) { + drain_wakeup_pipe(pollcb->wakeup_pipe); return APR_EINTR; } From bcc1d4c0eefe2159ad4cbaf05b1e3decf281b3cc Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 22 Jan 2010 14:08:47 +0000 Subject: [PATCH 6678/7878] add namespace protection for * create_wakeup_pipe() * close_wakeup_pipe() * drain_wakeup_pipe() use generic apr_poll_ since these are used from both apr_pollset_ and apr_pollcb_ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@902090 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_poll_private.h | 12 ++++++++---- poll/unix/epoll.c | 4 ++-- poll/unix/kqueue.c | 4 ++-- poll/unix/poll.c | 4 ++-- poll/unix/pollcb.c | 7 ++++--- poll/unix/pollset.c | 7 ++++--- poll/unix/port.c | 4 ++-- poll/unix/select.c | 2 +- poll/unix/wakeup.c | 18 +++++++++--------- 9 files changed, 34 insertions(+), 28 deletions(-) diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index 80daefc88fd..2d5c07096a3 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -167,9 +167,13 @@ struct apr_pollcb_provider_t { const char *name; }; -/* Private functions */ -apr_status_t create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd, apr_file_t **wakeup_pipe); -apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe); -void drain_wakeup_pipe(apr_file_t **wakeup_pipe); +/* + * Private functions used for the implementation of both apr_pollcb_* and + * apr_pollset_* + */ +apr_status_t apr_poll_create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd, + apr_file_t **wakeup_pipe); +apr_status_t apr_poll_close_wakeup_pipe(apr_file_t **wakeup_pipe); +void apr_poll_drain_wakeup_pipe(apr_file_t **wakeup_pipe); #endif /* APR_ARCH_POLL_PRIVATE_H */ diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 751d7c9bda8..696710867b2 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -279,7 +279,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, if ((pollset->flags & APR_POLLSET_WAKEABLE) && fdptr->desc_type == APR_POLL_FILE && fdptr->desc.f == pollset->wakeup_pipe[0]) { - drain_wakeup_pipe(pollset->wakeup_pipe); + apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe); rv = APR_EINTR; } else { @@ -441,7 +441,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, if ((pollcb->flags & APR_POLLSET_WAKEABLE) && pollfd->desc_type == APR_POLL_FILE && pollfd->desc.f == pollcb->wakeup_pipe[0]) { - drain_wakeup_pipe(pollcb->wakeup_pipe); + apr_poll_drain_wakeup_pipe(pollcb->wakeup_pipe); return APR_EINTR; } diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index a4483e0f09f..2e25c9fdec1 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -277,7 +277,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, if ((pollset->flags & APR_POLLSET_WAKEABLE) && fd.desc_type == APR_POLL_FILE && fd.desc.f == pollset->wakeup_pipe[0]) { - drain_wakeup_pipe(pollset->wakeup_pipe); + apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe); rv = APR_EINTR; } else { @@ -455,7 +455,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, if ((pollcb->flags & APR_POLLSET_WAKEABLE) && pollfd->desc_type == APR_POLL_FILE && pollfd->desc.f == pollcb->wakeup_pipe[0]) { - drain_wakeup_pipe(pollcb->wakeup_pipe); + apr_poll_drain_wakeup_pipe(pollcb->wakeup_pipe); return APR_EINTR; } diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 615470b7420..8d2517e5f42 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -267,7 +267,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, if ((pollset->flags & APR_POLLSET_WAKEABLE) && pollset->p->query_set[i].desc_type == APR_POLL_FILE && pollset->p->query_set[i].desc.f == pollset->wakeup_pipe[0]) { - drain_wakeup_pipe(pollset->wakeup_pipe); + apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe); rv = APR_EINTR; } else { @@ -407,7 +407,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, if ((pollcb->flags & APR_POLLSET_WAKEABLE) && pollfd->desc_type == APR_POLL_FILE && pollfd->desc.f == pollcb->wakeup_pipe[0]) { - drain_wakeup_pipe(pollcb->wakeup_pipe); + apr_poll_drain_wakeup_pipe(pollcb->wakeup_pipe); return APR_EINTR; } diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c index 58c0964fa83..e1d0bbd82dd 100644 --- a/poll/unix/pollcb.c +++ b/poll/unix/pollcb.c @@ -80,7 +80,7 @@ static apr_status_t pollcb_cleanup(void *p) (*pollcb->provider->cleanup)(pollcb); } if (pollcb->flags & APR_POLLSET_WAKEABLE) { - close_wakeup_pipe(pollcb->wakeup_pipe); + apr_poll_close_wakeup_pipe(pollcb->wakeup_pipe); } return APR_SUCCESS; @@ -158,8 +158,9 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **ret_pollcb, if (flags & APR_POLLSET_WAKEABLE) { /* Create wakeup pipe */ - if ((rv = create_wakeup_pipe(pollcb->pool, &pollcb->wakeup_pfd, - pollcb->wakeup_pipe)) != APR_SUCCESS) { + if ((rv = apr_poll_create_wakeup_pipe(pollcb->pool, &pollcb->wakeup_pfd, + pollcb->wakeup_pipe)) + != APR_SUCCESS) { return rv; } diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index ec2f55fb4ce..a93fa243459 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -37,7 +37,7 @@ static apr_status_t pollset_cleanup(void *p) (*pollset->provider->cleanup)(pollset); } if (pollset->flags & APR_POLLSET_WAKEABLE) { - close_wakeup_pipe(pollset->wakeup_pipe); + apr_poll_close_wakeup_pipe(pollset->wakeup_pipe); } return APR_SUCCESS; @@ -156,8 +156,9 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **ret_pollset, apr_pollfd_t pfd; /* Create wakeup pipe */ - if ((rv = create_wakeup_pipe(pollset->pool, &pfd, - pollset->wakeup_pipe)) != APR_SUCCESS) { + if ((rv = apr_poll_create_wakeup_pipe(pollset->pool, &pfd, + pollset->wakeup_pipe)) + != APR_SUCCESS) { return rv; } diff --git a/poll/unix/port.c b/poll/unix/port.c index 2253e8becaf..8f14488bd16 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -405,7 +405,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, if ((pollset->flags & APR_POLLSET_WAKEABLE) && fp.desc_type == APR_POLL_FILE && fp.desc.f == pollset->wakeup_pipe[0]) { - drain_wakeup_pipe(pollset->wakeup_pipe); + apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe); rv = APR_EINTR; } else { @@ -554,7 +554,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, if ((pollcb->flags & APR_POLLSET_WAKEABLE) && pollfd->desc_type == APR_POLL_FILE && pollfd->desc.f == pollcb->wakeup_pipe[0]) { - drain_wakeup_pipe(pollcb->wakeup_pipe); + apr_poll_drain_wakeup_pipe(pollcb->wakeup_pipe); return APR_EINTR; } diff --git a/poll/unix/select.c b/poll/unix/select.c index f4bd482d368..c1ac3c519bb 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -382,7 +382,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, else { if ((pollset->flags & APR_POLLSET_WAKEABLE) && pollset->p->query_set[i].desc.f == pollset->wakeup_pipe[0]) { - drain_wakeup_pipe(pollset->wakeup_pipe); + apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe); rv = APR_EINTR; continue; } diff --git a/poll/unix/wakeup.c b/poll/unix/wakeup.c index 788498330eb..f8ea0604842 100644 --- a/poll/unix/wakeup.c +++ b/poll/unix/wakeup.c @@ -27,8 +27,8 @@ #ifdef WIN32 -apr_status_t create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd, - apr_file_t **wakeup_pipe) +apr_status_t apr_poll_create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd, + apr_file_t **wakeup_pipe) { apr_status_t rv; @@ -42,7 +42,7 @@ apr_status_t create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd, return APR_SUCCESS; } -apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe) +apr_status_t apr_poll_close_wakeup_pipe(apr_file_t **wakeup_pipe) { apr_status_t rv0 = APR_SUCCESS; apr_status_t rv1 = APR_SUCCESS; @@ -61,12 +61,12 @@ apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe) #else /* !WIN32 */ -apr_status_t create_wakeup_pipe(apr_pollfd_t *pfd, apr_file_t **wakeup_pipe) +apr_status_t apr_poll_create_wakeup_pipe(apr_pollfd_t *pfd, apr_file_t **wakeup_pipe) { return APR_ENOTIMPL; } -apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe) +apr_status_t apr_poll_close_wakeup_pipe(apr_file_t **wakeup_pipe) { return APR_ENOTIMPL; } @@ -75,8 +75,8 @@ apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe) #else /* APR_FILES_AS_SOCKETS */ -apr_status_t create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd, - apr_file_t **wakeup_pipe) +apr_status_t apr_poll_create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd, + apr_file_t **wakeup_pipe) { apr_status_t rv; @@ -113,7 +113,7 @@ apr_status_t create_wakeup_pipe(apr_pool_t *pool, apr_pollfd_t *pfd, return APR_SUCCESS; } -apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe) +apr_status_t apr_poll_close_wakeup_pipe(apr_file_t **wakeup_pipe) { apr_status_t rv0 = APR_SUCCESS; apr_status_t rv1 = APR_SUCCESS; @@ -134,7 +134,7 @@ apr_status_t close_wakeup_pipe(apr_file_t **wakeup_pipe) /* Read and discard whatever is in the wakeup pipe. */ -void drain_wakeup_pipe(apr_file_t **wakeup_pipe) +void apr_poll_drain_wakeup_pipe(apr_file_t **wakeup_pipe) { char rb[512]; apr_size_t nr = sizeof(rb); From 6c5b8a87ee492e5fadc8df07538869d949cf03e5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 22 Jan 2010 15:45:53 +0000 Subject: [PATCH 6679/7878] remove entries for fixes/features first delivered in the branches point to CHANGES for the 1.5.x branches git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@902131 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index e087006605b..4a6a0d9a03a 100644 --- a/CHANGES +++ b/CHANGES @@ -4,10 +4,6 @@ Changes for APR 2.0.0 *) Support connecttimeout, readtimeout and writetimeout MySQL options PR 48251 [Marko Kevac ] - *) Add apr_socket_atreadeof to determine whether the receive part of the - socket has been closed by the peer. - [Ruediger Pluem, Mladen Turk, Joe Orton] - *) Transfer the apr-util spec file contents to apr.spec. [Graham Leggett] @@ -19,16 +15,17 @@ Changes for APR 2.0.0 *) Win32: Use WSAPoll as default pollset method if supported and found inside winsock dll. [Mladen Turk] - *) Make apr_pollset and apr_pollcb implementations using providers. - Added apr_pollset_create_ex and apr_pollcb_create_ex that allows - choosing non-default providers. [Mladen Turk] - *) Introduce APR_PERMS_SET macros for setting the owner/group on objects Currently only implemented for shm, proc and global mutexes on posix platforms. [Mladen Turk] *) Merge APR-util into APR. [various] +Changes for APR and APR-util 1.5.x and later: + + *) http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/CHANGES?view=markup + *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/CHANGES?view=markup + Changes for APR and APR-util 1.4.x and later: *) http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/CHANGES?view=markup From 14fb184e1d4af4371c864744d3c056bdfc538b50 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 31 Jan 2010 13:46:16 +0000 Subject: [PATCH 6680/7878] * file_io/unix/open.c (apr_file_open): Don't set FD_CLOEXEC if it was already set via O_CLOEXEC. PR: 46297 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@905040 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index bf3b43b6a54..be0862318c6 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -176,9 +176,11 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, if ((flags = fcntl(fd, F_GETFD)) == -1) return errno; - flags |= FD_CLOEXEC; - if (fcntl(fd, F_SETFD, flags) == -1) - return errno; + if ((flags & FD_CLOEXEC) == 0) { + flags |= FD_CLOEXEC; + if (fcntl(fd, F_SETFD, flags) == -1) + return errno; + } } (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); From 12482c33ef42ddaa189503907bcce6cbc69c53b0 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Wed, 3 Feb 2010 10:17:57 +0000 Subject: [PATCH 6681/7878] Add two new features to APR Files: - When opened with normal rotating flag, every 60 seconds the file will check if the file it is writing to has changed inode (ie, been replaced/moved). - When opened with the manual rotating flag, the consumer must call the check, but can provider the current timestamp, to avoid a apr_time call. This is based off of the patch from Brian, but I've modified it for style, and adding the manual rotation flag after discussion with brian at the httpd hackathon. Submitted by: Brian J. France git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@905970 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 11 ++++ file_io/unix/open.c | 27 +++++++++ file_io/unix/readwrite.c | 89 ++++++++++++++++++++++++++++ include/apr_file_io.h | 13 +++- include/arch/unix/apr_arch_file_io.h | 12 ++++ 5 files changed, 151 insertions(+), 1 deletion(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 47ea4f33b69..e2c26e155f8 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -95,6 +95,17 @@ static apr_status_t file_dup(apr_file_t **new_file, /* make sure unget behavior is consistent */ (*new_file)->ungetchar = old_file->ungetchar; + if (old_file->rotating != NULL) { + (*new_file)->rotating = (apr_rotating_info_t *)apr_pcalloc(p, sizeof(apr_rotating_info_t)); + + memcpy(&((*new_file)->rotating->finfo), &(old_file->rotating->finfo), sizeof(apr_finfo_t)); + (*new_file)->rotating->timeout = old_file->rotating->timeout; + (*new_file)->rotating->lastcheck = old_file->rotating->lastcheck; + (*new_file)->rotating->oflags = old_file->rotating->oflags; + (*new_file)->rotating->perm = old_file->rotating->perm; + (*new_file)->rotating->manual = old_file->rotating->manual; + } + /* apr_file_dup2() retains the original cleanup, reflecting * the existing inherit and nocleanup flags. This means, * that apr_file_dup2() cannot be called against an apr_file_t diff --git a/file_io/unix/open.c b/file_io/unix/open.c index be0862318c6..78f631fc134 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -19,6 +19,7 @@ #include "apr_portable.h" #include "apr_thread_mutex.h" #include "apr_arch_inherit.h" +#include "apr_time.h" #ifdef NETWARE #include "nks/dirio.h" @@ -225,6 +226,32 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, apr_unix_file_cleanup, apr_unix_child_file_cleanup); } + + if ((flag & APR_FOPEN_ROTATING) || (flag & APR_FOPEN_MANUAL_ROTATE)) { + (*new)->rotating = (apr_rotating_info_t *)apr_pcalloc(pool, + sizeof(apr_rotating_info_t)); + + rv = apr_file_info_get(&(*new)->rotating->finfo, + APR_FINFO_DEV|APR_FINFO_INODE, *new); + if (rv != APR_SUCCESS) { + return rv; + } + + if (flag & APR_FOPEN_MANUAL_ROTATE) { + (*new)->rotating->manual = 1; + } + else { + (*new)->rotating->manual = 0; + } + (*new)->rotating->timeout = 60; + (*new)->rotating->lastcheck = apr_time_sec(apr_time_now()); + (*new)->rotating->oflags = oflags; + (*new)->rotating->perm = perm; + } + else { + (*new)->rotating = NULL; + } + return APR_SUCCESS; } diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index f2e07534fe6..9373dcd0794 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -18,6 +18,8 @@ #include "apr_strings.h" #include "apr_thread_mutex.h" #include "apr_support.h" +#include "apr_time.h" +#include "apr_file_info.h" /* The only case where we don't use wait_for_io_or_timeout is on * pre-BONE BeOS, so this check should be sufficient and simpler */ @@ -144,10 +146,92 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } } +static apr_status_t do_rotating_check(apr_file_t *thefile, apr_time_t now) +{ + apr_size_t rv = APR_SUCCESS; + + if ((now - thefile->rotating->lastcheck) >= thefile->rotating->timeout) { + apr_finfo_t new_finfo; + apr_pool_t *tmp_pool; + + apr_pool_create(&tmp_pool, thefile->pool); + + rv = apr_stat(&new_finfo, thefile->fname, + APR_FINFO_DEV|APR_FINFO_INODE, tmp_pool); + + if (rv != APR_SUCCESS || + new_finfo.inode != thefile->rotating->finfo.inode || + new_finfo.device != thefile->rotating->finfo.device) { + + if (thefile->buffered) { + apr_file_flush(thefile); + } + + close(thefile->filedes); + thefile->filedes = -1; + + if (thefile->rotating->perm == APR_OS_DEFAULT) { + thefile->filedes = open(thefile->fname, + thefile->rotating->oflags, + 0666); + } + else { + thefile->filedes = open(thefile->fname, + thefile->rotating->oflags, + apr_unix_perms2mode(thefile->rotating->perm)); + } + + if (thefile->filedes < 0) { + rv = errno; + } + else { + rv = apr_file_info_get(&thefile->rotating->finfo, + APR_FINFO_DEV|APR_FINFO_INODE, + thefile); + } + } + + apr_pool_destroy(tmp_pool); + thefile->rotating->lastcheck = now; + } + return rv; +} + +static apr_status_t file_rotating_check(apr_file_t *thefile) +{ + if (thefile->rotating && thefile->rotating->manual == 0) { + apr_time_t now = apr_time_sec(apr_time_now()); + return do_rotating_check(thefile, now); + } + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_file_rotating_check(apr_file_t *thefile) +{ + if (thefile->rotating) { + apr_time_t now = apr_time_sec(apr_time_now()); + return do_rotating_check(thefile, now); + } + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_file_rotating_check_manual(apr_file_t *thefile, apr_time_t n) +{ + if (thefile->rotating) { + return do_rotating_check(thefile, n); + } + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { apr_size_t rv; + rv = file_rotating_check(thefile); + if (rv != APR_SUCCESS) { + return rv; + } + if (thefile->buffered) { char *pos = (char *)buf; int blocksize; @@ -252,6 +336,11 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove file_unlock(thefile); } + rv = file_rotating_check(thefile); + if (rv != APR_SUCCESS) { + return rv; + } + if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { *nbytes = 0; rv = errno; diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 80d9fbe7a92..1c80a6277ee 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -75,12 +75,18 @@ extern "C" { file should support apr_socket_sendfile operation */ #define APR_FOPEN_LARGEFILE 0x04000 /**< Platform dependent flag to enable - * large file support, see WARNING below + * large file support, see WARNING below */ + #define APR_FOPEN_SPARSE 0x08000 /**< Platform dependent flag to enable * sparse file support, see WARNING below */ +#define APR_FOPEN_ROTATING 0x10000 /**< Do file file rotation checking */ + +#define APR_FOPEN_MANUAL_ROTATE 0x20000 /**< Enable Manual rotation */ + + /* backcompat */ #define APR_READ APR_FOPEN_READ /**< @deprecated @see APR_FOPEN_READ */ #define APR_WRITE APR_FOPEN_WRITE /**< @deprecated @see APR_FOPEN_WRITE */ @@ -935,8 +941,13 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *templ, APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, apr_pool_t *p); + +APR_DECLARE(apr_status_t) apr_file_rotating_check(apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_file_rotating_manual_check(apr_file_t *thefile, apr_time_t time); + /** @} */ + #ifdef __cplusplus } #endif diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index 77a909177b4..5847cdc2c79 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -29,6 +29,8 @@ #ifndef WAITIO_USES_POLL #include "apr_poll.h" #endif +#include "apr_time.h" + /* System headers the file I/O library needs */ #if APR_HAVE_FCNTL_H @@ -90,6 +92,15 @@ /* For backwards-compat */ #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE +typedef struct apr_rotating_info_t { + apr_finfo_t finfo; + apr_interval_time_t timeout; + apr_time_t lastcheck; + int oflags; + int manual; + apr_fileperms_t perm; +} apr_rotating_info_t; + struct apr_file_t { apr_pool_t *pool; int filedes; @@ -115,6 +126,7 @@ struct apr_file_t { #if APR_HAS_THREADS struct apr_thread_mutex_t *thlock; #endif + apr_rotating_info_t *rotating; }; #if APR_HAS_THREADS From 602a26b273052ee2ddcfb6b4607dbe35ea5f1503 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Wed, 3 Feb 2010 19:50:59 +0000 Subject: [PATCH 6682/7878] * Fix typo in prototype git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@906206 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 1c80a6277ee..65ce0220b66 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -943,7 +943,7 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, APR_DECLARE(apr_status_t) apr_file_rotating_check(apr_file_t *thefile); -APR_DECLARE(apr_status_t) apr_file_rotating_manual_check(apr_file_t *thefile, apr_time_t time); +APR_DECLARE(apr_status_t) apr_file_rotating_check_manual(apr_file_t *thefile, apr_time_t time); /** @} */ From c938fbf82d4d947c234b9d43bbfeadbc1a3c5741 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Thu, 4 Feb 2010 07:58:21 +0000 Subject: [PATCH 6683/7878] * Reverse order of manual and check to conform to naming style git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@906390 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 2 +- include/apr_file_io.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 9373dcd0794..f72d87bae2e 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -215,7 +215,7 @@ APR_DECLARE(apr_status_t) apr_file_rotating_check(apr_file_t *thefile) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_rotating_check_manual(apr_file_t *thefile, apr_time_t n) +APR_DECLARE(apr_status_t) apr_file_rotating_manual_check(apr_file_t *thefile, apr_time_t n) { if (thefile->rotating) { return do_rotating_check(thefile, n); diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 65ce0220b66..1c80a6277ee 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -943,7 +943,7 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, APR_DECLARE(apr_status_t) apr_file_rotating_check(apr_file_t *thefile); -APR_DECLARE(apr_status_t) apr_file_rotating_check_manual(apr_file_t *thefile, apr_time_t time); +APR_DECLARE(apr_status_t) apr_file_rotating_manual_check(apr_file_t *thefile, apr_time_t time); /** @} */ From 55ba27c72c44da94d4a65489f166d5904c1d8e26 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sat, 6 Feb 2010 18:47:28 +0000 Subject: [PATCH 6684/7878] newer config.sub/config.guess sets host type of e.g. 'powerpc64-suse-linux', which wasn't matching our *-linux-* pattern. older config.sub/config.guess returned 'powerpc64-unknown-linux-gnu' on one such host (SLES 10.2/PPC64) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@907272 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index e6a24661117..99de9120478 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -118,7 +118,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-hp-hpux*) APR_ADDTO(CPPFLAGS, [-DHPUX -D_REENTRANT]) ;; - *-linux-*) + *-linux*) case `uname -r` in 2.* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2]) ;; From 8c475b59c4c1e0598d09df15ff64ac279f0ca6b4 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 10 Feb 2010 10:05:28 +0000 Subject: [PATCH 6685/7878] * build/gen-build.py: Sort lists so that the generated build-outputs.mk is easy to diff across releases. (Cosmetic change only; no functional difference) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@908427 13f79535-47bb-0310-9956-ffa450edef68 --- build/gen-build.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build/gen-build.py b/build/gen-build.py index c8d39a7294b..9c50683a7d6 100755 --- a/build/gen-build.py +++ b/build/gen-build.py @@ -111,12 +111,16 @@ def main(): symname = 'OBJECTS_%s_%s' % (subdir, platform) + objects.sort() + # and write the symbol for the whole group f.write('\n%s = %s\n\n' % (symname, string.join(objects))) # and include that symbol in the group group.append('$(%s)' % symname) + group.sort() + # write out a symbol which contains the necessary files f.write('OBJECTS_%s = %s\n\n' % (platform, string.join(group))) @@ -193,7 +197,9 @@ def write_objects(f, legal_deps, h_deps, files): for hdr in deps.keys(): deps.update(h_deps.get(hdr, {})) - f.write('%s: %s .make.dirs %s\n' % (obj, file, string.join(deps.values()))) + f.write('%s: %s .make.dirs %s\n' % (obj, file, string.join(sorted(deps.values())))) + + objects.sort() return objects, dirs @@ -231,6 +237,7 @@ def get_files(patterns): files = [ ] for pat in string.split(patterns): files.extend(map(clean_path, glob.glob(pat))) + files.sort() return files From b3de8d07305a7dd6441b6d9f7bad80a548965821 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Tue, 16 Feb 2010 07:43:23 +0000 Subject: [PATCH 6686/7878] * sorted requires python >= 2.4. We only require python 2.3 and do not have any better by default on RHEL 4. So sort the values by other means. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@910419 13f79535-47bb-0310-9956-ffa450edef68 --- build/gen-build.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/gen-build.py b/build/gen-build.py index 9c50683a7d6..054422abcde 100755 --- a/build/gen-build.py +++ b/build/gen-build.py @@ -197,7 +197,9 @@ def write_objects(f, legal_deps, h_deps, files): for hdr in deps.keys(): deps.update(h_deps.get(hdr, {})) - f.write('%s: %s .make.dirs %s\n' % (obj, file, string.join(sorted(deps.values())))) + vals = deps.values() + vals.sort() + f.write('%s: %s .make.dirs %s\n' % (obj, file, string.join(vals))) objects.sort() From 01fdb4a4168a808d5766a5e20e79fdf341a84c33 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Tue, 16 Feb 2010 17:07:09 +0000 Subject: [PATCH 6687/7878] Make sure we don't leak file descriptors. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@910597 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 081ca6749c1..42921955aa1 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -314,26 +314,31 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, * exist before calling ftok(). */ new_m->shmkey = ftok(filename, 1); if (new_m->shmkey == (key_t)-1) { + apr_file_close(file); return errno; } if ((new_m->shmid = shmget(new_m->shmkey, new_m->realsize, SHM_R | SHM_W | IPC_CREAT | IPC_EXCL)) < 0) { + apr_file_close(file); return errno; } if ((new_m->base = shmat(new_m->shmid, NULL, 0)) == (void *)-1) { + apr_file_close(file); return errno; } new_m->usable = new_m->base; if (shmctl(new_m->shmid, IPC_STAT, &shmbuf) == -1) { + apr_file_close(file); return errno; } apr_uid_current(&uid, &gid, pool); shmbuf.shm_perm.uid = uid; shmbuf.shm_perm.gid = gid; if (shmctl(new_m->shmid, IPC_SET, &shmbuf) == -1) { + apr_file_close(file); return errno; } @@ -341,6 +346,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, status = apr_file_write(file, (const void *)&reqsize, &nbytes); if (status != APR_SUCCESS) { + apr_file_close(file); return status; } status = apr_file_close(file); From 971a78a844d36215107fab201a5ba2105b79c800 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Wed, 24 Feb 2010 03:31:18 +0000 Subject: [PATCH 6688/7878] When an individual LDAP connection is to have a different SSL environemnt than the global (ldap == NULL) options, we have to tell openldap via LDAP_OPT_X_TLS_NEWCTX. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@915649 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ ldap/apr_ldap_option.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/CHANGES b/CHANGES index 4a6a0d9a03a..30be22fac5b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Enable per-connection LDAP client certificates for + openldap by requesting a new SSL context. [Eric Covener] + *) Support connecttimeout, readtimeout and writetimeout MySQL options PR 48251 [Marko Kevac ] diff --git a/ldap/apr_ldap_option.c b/ldap/apr_ldap_option.c index 24a713e5f71..0291b134489 100644 --- a/ldap/apr_ldap_option.c +++ b/ldap/apr_ldap_option.c @@ -578,6 +578,15 @@ static void option_set_cert(apr_pool_t *pool, LDAP *ldap, /* OpenLDAP SDK */ #if APR_HAS_OPENLDAP_LDAPSDK #ifdef LDAP_OPT_X_TLS_CACERTFILE +#ifndef LDAP_OPT_X_TLS_NEWCTX + if (ldap) { + result->reason = "LDAP: The OpenLDAP SDK cannot support the setting " + "of certificates or keys on a per connection basis."; + result->rc = -1; + return; + } +#endif + /* set one or more certificates */ /* FIXME: make it support setting directories as well as files */ for (i = 0; i < certs->nelts; i++) { @@ -615,6 +624,15 @@ static void option_set_cert(apr_pool_t *pool, LDAP *ldap, break; } } + /* Certificate settings are now configured, but we also need a new + * TLS context to be created. This applies to both gnuTLS and openssl + */ + if (ldap && (result->rc == LDAP_SUCCESS)) { + int IS_SERVER = 0; + result->rc = ldap_set_option(ldap, LDAP_OPT_X_TLS_NEWCTX, &IS_SERVER); + result->msg = ldap_err2string(result->rc); + } + #else result->reason = "LDAP: LDAP_OPT_X_TLS_CACERTFILE not " "defined by this OpenLDAP SDK. Certificate " From fef08ff732387ff61592293e5a9dfcd45f44a611 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Wed, 24 Feb 2010 04:19:09 +0000 Subject: [PATCH 6689/7878] protect LDAP_OPT_X_TLS_NEWCTX from reference on older openldap git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@915666 13f79535-47bb-0310-9956-ffa450edef68 --- ldap/apr_ldap_option.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ldap/apr_ldap_option.c b/ldap/apr_ldap_option.c index 0291b134489..ea8a19c1265 100644 --- a/ldap/apr_ldap_option.c +++ b/ldap/apr_ldap_option.c @@ -624,6 +624,7 @@ static void option_set_cert(apr_pool_t *pool, LDAP *ldap, break; } } +#ifdef LDAP_OPT_X_TLS_NEWCTX /* Certificate settings are now configured, but we also need a new * TLS context to be created. This applies to both gnuTLS and openssl */ @@ -632,6 +633,7 @@ static void option_set_cert(apr_pool_t *pool, LDAP *ldap, result->rc = ldap_set_option(ldap, LDAP_OPT_X_TLS_NEWCTX, &IS_SERVER); result->msg = ldap_err2string(result->rc); } +#endif #else result->reason = "LDAP: LDAP_OPT_X_TLS_CACERTFILE not " From 84e54e931d5ce705710945029bfc67db647b23b8 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 1 Mar 2010 19:45:36 +0000 Subject: [PATCH 6690/7878] Use the APR_FOPEN_* constants instead of the deprecated APR_* constants within the file_io code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@917675 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/mktemp.c | 8 +++---- file_io/netware/pipe.c | 2 +- file_io/os2/filedup.c | 2 +- file_io/os2/open.c | 30 +++++++++++------------ file_io/os2/readwrite.c | 2 +- file_io/unix/copy.c | 6 ++--- file_io/unix/filedup.c | 10 ++++---- file_io/unix/mktemp.c | 6 ++--- file_io/unix/open.c | 50 +++++++++++++++++++-------------------- file_io/unix/pipe.c | 2 +- file_io/win32/filedup.c | 2 +- file_io/win32/filestat.c | 2 +- file_io/win32/open.c | 44 +++++++++++++++++----------------- file_io/win32/readwrite.c | 4 ++-- file_io/win32/seek.c | 4 ++-- 15 files changed, 87 insertions(+), 87 deletions(-) diff --git a/file_io/netware/mktemp.c b/file_io/netware/mktemp.c index c86954ff279..4f78226e63d 100644 --- a/file_io/netware/mktemp.c +++ b/file_io/netware/mktemp.c @@ -28,8 +28,8 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i int fd; apr_status_t rv; - flags = (!flags) ? APR_CREATE | APR_READ | APR_WRITE | - APR_DELONCLOSE : flags & ~APR_EXCL; + flags = (!flags) ? APR_FOPEN_CREATE | APR_FOPEN_READ | APR_FOPEN_WRITE | + APR_FOPEN_DELONCLOSE : flags & ~APR_FOPEN_EXCL; fd = mkstemp(template); if (fd == -1) { @@ -39,11 +39,11 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i * Otherwise file locking will not allow the file to be shared. */ close(fd); - if ((rv = apr_file_open(fp, template, flags|APR_FILE_NOCLEANUP, + if ((rv = apr_file_open(fp, template, flags|APR_FOPEN_NOCLEANUP, APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) { - if (!(flags & APR_FILE_NOCLEANUP)) { + if (!(flags & APR_FOPEN_NOCLEANUP)) { int flags; if ((flags = fcntl((*fp)->filedes, F_GETFD)) == -1) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 1abf41405d3..3e8f5593555 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -114,7 +114,7 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, (*file)->ungetchar = -1; /* no char avail */ (*file)->filedes = *dafile; if (!register_cleanup) { - (*file)->flags = APR_FILE_NOCLEANUP; + (*file)->flags = APR_FOPEN_NOCLEANUP; } (*file)->buffered = 0; #if APR_HAS_THREADS diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index a9d0421e201..b1063f57ce1 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -112,7 +112,7 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, (*new_file)->fname = apr_pstrdup(p, old_file->fname); } - if (!(old_file->flags & APR_FILE_NOCLEANUP)) { + if (!(old_file->flags & APR_FOPEN_NOCLEANUP)) { apr_pool_cleanup_register(p, (void *)(*new_file), apr_file_cleanup, apr_file_cleanup); diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 386bd073c6e..a1a55202f4a 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -45,18 +45,18 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->flags = flag; dafile->blocking = BLK_ON; - if ((flag & APR_READ) && (flag & APR_WRITE)) { + if ((flag & APR_FOPEN_READ) && (flag & APR_FOPEN_WRITE)) { mflags |= OPEN_ACCESS_READWRITE; - } else if (flag & APR_READ) { + } else if (flag & APR_FOPEN_READ) { mflags |= OPEN_ACCESS_READONLY; - } else if (flag & APR_WRITE) { + } else if (flag & APR_FOPEN_WRITE) { mflags |= OPEN_ACCESS_WRITEONLY; } else { dafile->filedes = -1; return APR_EACCES; } - dafile->buffered = (flag & APR_BUFFERED) > 0; + dafile->buffered = (flag & APR_FOPEN_BUFFERED) > 0; if (dafile->buffered) { dafile->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); @@ -67,18 +67,18 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr return rv; } - if (flag & APR_CREATE) { + if (flag & APR_FOPEN_CREATE) { oflags |= OPEN_ACTION_CREATE_IF_NEW; - if (!(flag & APR_EXCL) && !(flag & APR_TRUNCATE)) { + if (!(flag & APR_FOPEN_EXCL) && !(flag & APR_FOPEN_TRUNCATE)) { oflags |= OPEN_ACTION_OPEN_IF_EXISTS; } } - if ((flag & APR_EXCL) && !(flag & APR_CREATE)) + if ((flag & APR_FOPEN_EXCL) && !(flag & APR_FOPEN_CREATE)) return APR_EACCES; - if (flag & APR_TRUNCATE) { + if (flag & APR_FOPEN_TRUNCATE) { oflags |= OPEN_ACTION_REPLACE_IF_EXISTS; } else if ((oflags & 0xFF) == 0) { oflags |= OPEN_ACTION_OPEN_IF_EXISTS; @@ -86,7 +86,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr rv = DosOpen(fname, &(dafile->filedes), &action, 0, 0, oflags, mflags, NULL); - if (rv == 0 && (flag & APR_APPEND)) { + if (rv == 0 && (flag & APR_FOPEN_APPEND)) { ULONG newptr; rv = DosSetFilePtr(dafile->filedes, 0, FILE_END, &newptr ); @@ -105,7 +105,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->direction = 0; dafile->pipe = FALSE; - if (!(flag & APR_FILE_NOCLEANUP)) { + if (!(flag & APR_FOPEN_NOCLEANUP)) { apr_pool_cleanup_register(dafile->pool, dafile, apr_file_cleanup, apr_file_cleanup); } @@ -128,7 +128,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) if (rc == 0) { file->isopen = FALSE; - if (file->flags & APR_DELONCLOSE) { + if (file->flags & APR_FOPEN_DELONCLOSE) { status = APR_FROM_OS_ERROR(DosDelete(file->fname)); } /* else we return the status of the flush attempt @@ -192,7 +192,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thef (*file)->eof_hit = FALSE; (*file)->flags = flags; (*file)->pipe = FALSE; - (*file)->buffered = (flags & APR_BUFFERED) > 0; + (*file)->buffered = (flags & APR_FOPEN_BUFFERED) > 0; if ((*file)->buffered) { apr_status_t rv; @@ -224,7 +224,7 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, { apr_os_file_t fd = 2; - return apr_os_file_put(thefile, &fd, flags | APR_WRITE, pool); + return apr_os_file_put(thefile, &fd, flags | APR_FOPEN_WRITE, pool); } @@ -234,7 +234,7 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, { apr_os_file_t fd = 1; - return apr_os_file_put(thefile, &fd, flags | APR_WRITE, pool); + return apr_os_file_put(thefile, &fd, flags | APR_FOPEN_WRITE, pool); } @@ -244,7 +244,7 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, { apr_os_file_t fd = 0; - return apr_os_file_put(thefile, &fd, flags | APR_READ, pool); + return apr_os_file_put(thefile, &fd, flags | APR_FOPEN_READ, pool); } diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index a7b591b3699..9c44ee0e0ae 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -163,7 +163,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a apr_thread_mutex_unlock(thefile->mutex); return APR_FROM_OS_ERROR(rc); } else { - if (thefile->flags & APR_APPEND) { + if (thefile->flags & APR_FOPEN_APPEND) { FILELOCK all = { 0, 0x7fffffff }; ULONG newpos; rc = DosSetFileLocks(thefile->filedes, NULL, &all, -1, 0); diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index 3a1c59a62dd..df3a49c8209 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -29,7 +29,7 @@ static apr_status_t apr_file_transfer_contents(const char *from_path, apr_fileperms_t perms; /* Open source file. */ - status = apr_file_open(&s, from_path, APR_READ, APR_OS_DEFAULT, pool); + status = apr_file_open(&s, from_path, APR_FOPEN_READ, APR_OS_DEFAULT, pool); if (status) return status; @@ -101,7 +101,7 @@ APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path, apr_pool_t *pool) { return apr_file_transfer_contents(from_path, to_path, - (APR_WRITE | APR_CREATE | APR_TRUNCATE), + (APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE), perms, pool); } @@ -112,7 +112,7 @@ APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, apr_pool_t *pool) { return apr_file_transfer_contents(from_path, to_path, - (APR_WRITE | APR_CREATE | APR_APPEND), + (APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_APPEND), perms, pool); } diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index e2c26e155f8..ab31e94434f 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -35,12 +35,12 @@ static apr_status_t file_dup(apr_file_t **new_file, return APR_EINVAL; } #ifdef HAVE_DUP3 - if (!((*new_file)->flags & (APR_FILE_NOCLEANUP|APR_INHERIT))) + if (!((*new_file)->flags & (APR_FOPEN_NOCLEANUP|APR_INHERIT))) flags |= O_CLOEXEC; rv = dup3(old_file->filedes, (*new_file)->filedes, flags); #else rv = dup2(old_file->filedes, (*new_file)->filedes); - if (!((*new_file)->flags & (APR_FILE_NOCLEANUP|APR_INHERIT))) { + if (!((*new_file)->flags & (APR_FOPEN_NOCLEANUP|APR_INHERIT))) { int flags; if (rv == -1) @@ -117,12 +117,12 @@ static apr_status_t file_dup(apr_file_t **new_file, } /* apr_file_dup() retains all old_file flags with the exceptions - * of APR_INHERIT and APR_FILE_NOCLEANUP. + * of APR_INHERIT and APR_FOPEN_NOCLEANUP. * The user must call apr_file_inherit_set() on the dupped * apr_file_t when desired. */ (*new_file)->flags = old_file->flags - & ~(APR_INHERIT | APR_FILE_NOCLEANUP); + & ~(APR_INHERIT | APR_FOPEN_NOCLEANUP); apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), apr_unix_file_cleanup, @@ -175,7 +175,7 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, if (old_file->fname) { (*new_file)->fname = apr_pstrdup(p, old_file->fname); } - if (!(old_file->flags & APR_FILE_NOCLEANUP)) { + if (!(old_file->flags & APR_FOPEN_NOCLEANUP)) { apr_pool_cleanup_register(p, (void *)(*new_file), apr_unix_file_cleanup, ((*new_file)->flags & APR_INHERIT) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index a78b73ae96c..28aaf90e25e 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -178,8 +178,8 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i #ifdef HAVE_MKSTEMP int fd; #endif - flags = (!flags) ? APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | - APR_DELONCLOSE : flags; + flags = (!flags) ? APR_FOPEN_CREATE | APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_EXCL | + APR_FOPEN_DELONCLOSE : flags; #ifndef HAVE_MKSTEMP return gettemp(template, fp, flags, p); #else @@ -203,7 +203,7 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i apr_os_file_put(fp, &fd, flags, p); (*fp)->fname = apr_pstrdup(p, template); - if (!(flags & APR_FILE_NOCLEANUP)) { + if (!(flags & APR_FOPEN_NOCLEANUP)) { int flags; if ((flags = fcntl(fd, F_GETFD)) == -1) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 78f631fc134..c2a1b7dce9c 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -39,7 +39,7 @@ static apr_status_t file_cleanup(apr_file_t *file, int is_child) if (close(fd) == 0) { /* Only the parent process should delete the file! */ - if (!is_child && (file->flags & APR_DELONCLOSE)) { + if (!is_child && (file->flags & APR_FOPEN_DELONCLOSE)) { unlink(file->fname); } #if APR_HAS_THREADS @@ -101,37 +101,37 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, apr_status_t rv; #endif - if ((flag & APR_READ) && (flag & APR_WRITE)) { + if ((flag & APR_FOPEN_READ) && (flag & APR_FOPEN_WRITE)) { oflags = O_RDWR; } - else if (flag & APR_READ) { + else if (flag & APR_FOPEN_READ) { oflags = O_RDONLY; } - else if (flag & APR_WRITE) { + else if (flag & APR_FOPEN_WRITE) { oflags = O_WRONLY; } else { return APR_EACCES; } - if (flag & APR_CREATE) { - oflags |= O_CREAT; - if (flag & APR_EXCL) { + if (flag & APR_FOPEN_CREATE) { + oflags |= O_CREAT; + if (flag & APR_FOPEN_EXCL) { oflags |= O_EXCL; } } - if ((flag & APR_EXCL) && !(flag & APR_CREATE)) { + if ((flag & APR_FOPEN_EXCL) && !(flag & APR_FOPEN_CREATE)) { return APR_EACCES; } - if (flag & APR_APPEND) { + if (flag & APR_FOPEN_APPEND) { oflags |= O_APPEND; } - if (flag & APR_TRUNCATE) { + if (flag & APR_FOPEN_TRUNCATE) { oflags |= O_TRUNC; } #ifdef O_BINARY - if (flag & APR_BINARY) { + if (flag & APR_FOPEN_BINARY) { oflags |= O_BINARY; } #endif @@ -139,7 +139,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, #ifdef O_CLOEXEC /* Introduced in Linux 2.6.23. Silently ignored on earlier Linux kernels. */ - if (!(flag & APR_FILE_NOCLEANUP)) { + if (!(flag & APR_FOPEN_NOCLEANUP)) { oflags |= O_CLOEXEC; } #endif @@ -147,13 +147,13 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, #if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE) oflags |= O_LARGEFILE; #elif defined(O_LARGEFILE) - if (flag & APR_LARGEFILE) { + if (flag & APR_FOPEN_LARGEFILE) { oflags |= O_LARGEFILE; } #endif #if APR_HAS_THREADS - if ((flag & APR_BUFFERED) && (flag & APR_XTHREAD)) { + if ((flag & APR_FOPEN_BUFFERED) && (flag & APR_FOPEN_XTHREAD)) { rv = apr_thread_mutex_create(&thlock, APR_THREAD_MUTEX_DEFAULT, pool); if (rv) { @@ -171,7 +171,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, if (fd < 0) { return errno; } - if (!(flag & APR_FILE_NOCLEANUP)) { + if (!(flag & APR_FOPEN_NOCLEANUP)) { int flags; if ((flags = fcntl(fd, F_GETFD)) == -1) @@ -192,13 +192,13 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, (*new)->fname = apr_pstrdup(pool, fname); (*new)->blocking = BLK_ON; - (*new)->buffered = (flag & APR_BUFFERED) > 0; + (*new)->buffered = (flag & APR_FOPEN_BUFFERED) > 0; if ((*new)->buffered) { (*new)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); (*new)->bufsize = APR_FILE_DEFAULT_BUFSIZE; #if APR_HAS_THREADS - if ((*new)->flags & APR_XTHREAD) { + if ((*new)->flags & APR_FOPEN_XTHREAD) { (*new)->thlock = thlock; } #endif @@ -221,7 +221,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, */ (*new)->pollset = NULL; #endif - if (!(flag & APR_FILE_NOCLEANUP)) { + if (!(flag & APR_FOPEN_NOCLEANUP)) { apr_pool_cleanup_register((*new)->pool, (void *)(*new), apr_unix_file_cleanup, apr_unix_child_file_cleanup); @@ -300,8 +300,8 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file)->timeout = -1; (*file)->ungetchar = -1; /* no char avail */ (*file)->filedes = *dafile; - (*file)->flags = flags | APR_FILE_NOCLEANUP; - (*file)->buffered = (flags & APR_BUFFERED) > 0; + (*file)->flags = flags | APR_FOPEN_NOCLEANUP; + (*file)->buffered = (flags & APR_FOPEN_BUFFERED) > 0; #ifndef WAITIO_USES_POLL /* Start out with no pollset. apr_wait_for_io_or_timeout() will @@ -314,7 +314,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); (*file)->bufsize = APR_FILE_DEFAULT_BUFSIZE; #if APR_HAS_THREADS - if ((*file)->flags & APR_XTHREAD) { + if ((*file)->flags & APR_FOPEN_XTHREAD) { apr_status_t rv; rv = apr_thread_mutex_create(&((*file)->thlock), APR_THREAD_MUTEX_DEFAULT, pool); @@ -341,7 +341,7 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, { int fd = STDERR_FILENO; - return apr_os_file_put(thefile, &fd, flags | APR_WRITE, pool); + return apr_os_file_put(thefile, &fd, flags | APR_FOPEN_WRITE, pool); } APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, @@ -350,7 +350,7 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, { int fd = STDOUT_FILENO; - return apr_os_file_put(thefile, &fd, flags | APR_WRITE, pool); + return apr_os_file_put(thefile, &fd, flags | APR_FOPEN_WRITE, pool); } APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, @@ -359,7 +359,7 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, { int fd = STDIN_FILENO; - return apr_os_file_put(thefile, &fd, flags | APR_READ, pool); + return apr_os_file_put(thefile, &fd, flags | APR_FOPEN_READ, pool); } APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, @@ -387,7 +387,7 @@ APR_IMPLEMENT_INHERIT_SET(file, flags, pool, apr_unix_file_cleanup) * suitable on Unix (see PR 41119). */ APR_DECLARE(apr_status_t) apr_file_inherit_unset(apr_file_t *thefile) { - if (thefile->flags & APR_FILE_NOCLEANUP) { + if (thefile->flags & APR_FOPEN_NOCLEANUP) { return APR_EINVAL; } if (thefile->flags & APR_INHERIT) { diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 0411aa5f027..7b8f01fb92a 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -149,7 +149,7 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, (*file)->ungetchar = -1; /* no char avail */ (*file)->filedes = *dafile; if (!register_cleanup) { - (*file)->flags = APR_FILE_NOCLEANUP; + (*file)->flags = APR_FOPEN_NOCLEANUP; } (*file)->buffered = 0; #if APR_HAS_THREADS diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 99f2a0a0e8f..e1dfc164997 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -208,7 +208,7 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, if (old_file->fname) { (*new_file)->fname = apr_pstrdup(p, old_file->fname); } - if (!(old_file->flags & APR_FILE_NOCLEANUP)) { + if (!(old_file->flags & APR_FOPEN_NOCLEANUP)) { apr_pool_cleanup_register(p, (void *)(*new_file), file_cleanup, file_cleanup); diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index f2119d07586..cdd507d1aa2 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -779,7 +779,7 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, apr_status_t rv; rv = apr_file_open(&thefile, fname, - APR_READ | APR_WRITEATTRS, + APR_FOPEN_READ | APR_WRITEATTRS, APR_OS_DEFAULT, pool); if (!rv) { diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 33909ecf153..48736984a5a 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -331,10 +331,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE; apr_status_t rv; - if (flag & APR_READ) { + if (flag & APR_FOPEN_READ) { oflags |= GENERIC_READ; } - if (flag & APR_WRITE) { + if (flag & APR_FOPEN_WRITE) { oflags |= GENERIC_WRITE; } if (flag & APR_WRITEATTRS) { @@ -344,18 +344,18 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, if (apr_os_level >= APR_WIN_NT) sharemode |= FILE_SHARE_DELETE; - if (flag & APR_CREATE) { - if (flag & APR_EXCL) { + if (flag & APR_FOPEN_CREATE) { + if (flag & APR_FOPEN_EXCL) { /* only create new if file does not already exist */ createflags = CREATE_NEW; - } else if (flag & APR_TRUNCATE) { + } else if (flag & APR_FOPEN_TRUNCATE) { /* truncate existing file or create new */ createflags = CREATE_ALWAYS; } else { /* open existing but create if necessary */ createflags = OPEN_ALWAYS; } - } else if (flag & APR_TRUNCATE) { + } else if (flag & APR_FOPEN_TRUNCATE) { /* only truncate if file already exists */ createflags = TRUNCATE_EXISTING; } else { @@ -363,11 +363,11 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, createflags = OPEN_EXISTING; } - if ((flag & APR_EXCL) && !(flag & APR_CREATE)) { + if ((flag & APR_FOPEN_EXCL) && !(flag & APR_FOPEN_CREATE)) { return APR_EACCES; } - if (flag & APR_DELONCLOSE) { + if (flag & APR_FOPEN_DELONCLOSE) { attributes |= FILE_FLAG_DELETE_ON_CLOSE; } @@ -382,7 +382,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, * FILE_FLAG_BACKUP_SEMANTICS to allow us to open directories. * See the static resolve_ident() fn in file_io/win32/filestat.c */ - if (!(flag & (APR_READ | APR_WRITE))) { + if (!(flag & (APR_FOPEN_READ | APR_FOPEN_WRITE))) { if (flag & APR_OPENINFO) { if (apr_os_level >= APR_WIN_NT) { attributes |= FILE_FLAG_BACKUP_SEMANTICS; @@ -395,7 +395,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, oflags |= READ_CONTROL; } - if (flag & APR_XTHREAD) { + if (flag & APR_FOPEN_XTHREAD) { /* This win32 specific feature is required * to allow multiple threads to work with the file. */ @@ -407,11 +407,11 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, { apr_wchar_t wfname[APR_PATH_MAX]; - if (flag & APR_SENDFILE_ENABLED) { + if (flag & APR_FOPEN_SENDFILE_ENABLED) { /* This feature is required to enable sendfile operations - * against the file on Win32. Also implies APR_XTHREAD. + * against the file on Win32. Also implies APR_FOPEN_XTHREAD. */ - flag |= APR_XTHREAD; + flag |= APR_FOPEN_XTHREAD; attributes |= FILE_FLAG_SEQUENTIAL_SCAN | FILE_FLAG_OVERLAPPED; } @@ -427,7 +427,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, handle = CreateFileA(fname, oflags, sharemode, NULL, createflags, attributes, 0); /* This feature is not supported on this platform. */ - flag &= ~APR_SENDFILE_ENABLED; + flag &= ~APR_FOPEN_SENDFILE_ENABLED; } #endif if (handle == INVALID_HANDLE_VALUE) { @@ -442,11 +442,11 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, (*new)->timeout = -1; (*new)->ungetchar = -1; - if (flag & APR_APPEND) { + if (flag & APR_FOPEN_APPEND) { (*new)->append = 1; SetFilePointer((*new)->filehand, 0, NULL, FILE_END); } - if (flag & APR_BUFFERED) { + if (flag & APR_FOPEN_BUFFERED) { (*new)->buffered = 1; (*new)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); (*new)->bufsize = APR_FILE_DEFAULT_BUFSIZE; @@ -482,7 +482,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, /* ### check return codes */ (void) apr_pollset_create(&(*new)->pollset, 1, pool, 0); #endif - if (!(flag & APR_FILE_NOCLEANUP)) { + if (!(flag & APR_FOPEN_NOCLEANUP)) { apr_pool_cleanup_register((*new)->pool, (void *)(*new), file_cleanup, apr_pool_cleanup_null); } @@ -636,10 +636,10 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file)->timeout = -1; (*file)->flags = flags; - if (flags & APR_APPEND) { + if (flags & APR_FOPEN_APPEND) { (*file)->append = 1; } - if (flags & APR_BUFFERED) { + if (flags & APR_FOPEN_BUFFERED) { (*file)->buffered = 1; (*file)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); (*file)->bufsize = APR_FILE_DEFAULT_BUFSIZE; @@ -690,7 +690,7 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, file_handle = INVALID_HANDLE_VALUE; return apr_os_file_put(thefile, &file_handle, - flags | APR_WRITE | APR_STDERR_FLAG, pool); + flags | APR_FOPEN_WRITE | APR_STDERR_FLAG, pool); #endif } @@ -709,7 +709,7 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, file_handle = INVALID_HANDLE_VALUE; return apr_os_file_put(thefile, &file_handle, - flags | APR_WRITE | APR_STDOUT_FLAG, pool); + flags | APR_FOPEN_WRITE | APR_STDOUT_FLAG, pool); #endif } @@ -728,7 +728,7 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, file_handle = INVALID_HANDLE_VALUE; return apr_os_file_put(thefile, &file_handle, - flags | APR_READ | APR_STDIN_FLAG, pool); + flags | APR_FOPEN_READ | APR_STDIN_FLAG, pool); #endif } diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 4d405c43538..c93c805c57b 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -154,7 +154,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size * initialize the overlapped and io completion event (hEvent). * Threads should NOT share an apr_file_t or its hEvent. */ - if ((thefile->flags & APR_XTHREAD) && !thefile->pOverlapped ) { + if ((thefile->flags & APR_FOPEN_XTHREAD) && !thefile->pOverlapped ) { thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->pool, sizeof(OVERLAPPED)); thefile->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); @@ -245,7 +245,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a * initialize the overlapped and io completion event (hEvent). * Threads should NOT share an apr_file_t or its hEvent. */ - if ((thefile->flags & APR_XTHREAD) && !thefile->pOverlapped ) { + if ((thefile->flags & APR_FOPEN_XTHREAD) && !thefile->pOverlapped ) { thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->pool, sizeof(OVERLAPPED)); thefile->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 7a1124cf48e..b412fd4cbf5 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -100,10 +100,10 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh *offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; return rc; } - /* A file opened with APR_XTHREAD has been opened for overlapped i/o. + /* A file opened with APR_FOPEN_XTHREAD has been opened for overlapped i/o. * APR must explicitly track the file pointer in this case. */ - else if (thefile->pOverlapped || thefile->flags & APR_XTHREAD) { + else if (thefile->pOverlapped || thefile->flags & APR_FOPEN_XTHREAD) { switch(where) { case APR_SET: thefile->filePtr = *offset; From bc47219b709f4a0efe41af69ea7f176365569c11 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 1 Mar 2010 20:39:15 +0000 Subject: [PATCH 6691/7878] Add RPM build instructions. Submitted by Dan Poirier. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@917704 13f79535-47bb-0310-9956-ffa450edef68 --- README | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README b/README index a49c84e6041..1358063e713 100644 --- a/README +++ b/README @@ -137,6 +137,22 @@ with the flag; ./testall -v +Building APR RPM files on Linux +=============================== + +Run the following to create SRPMs: + +rpmbuild -ts apr-.tar.bz2 +rpmbuild -ts apr-util-.tar.bz2 + +Run the following to create RPMs (or build from the SRPMs): + +rpmbuild -tb apr-.tar.bz2 +rpmbuild -tb apr-util-.tar.bz2 + +Resolve dependencies as appropriate. + + Configuring and Building APR on Windows ======================================= From b457c8df44c1067c18c2c94ce546ace9c4943229 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 2 Mar 2010 00:17:18 +0000 Subject: [PATCH 6692/7878] Enable platform specific support for the opening of a file or pipe in non blocking module through the APR_FOPEN_NONBLOCK flag. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@917819 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ file_io/unix/open.c | 6 ++++++ include/apr_file_io.h | 6 +++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 30be22fac5b..555dc85a6ff 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Enable platform specific support for the opening of a file or + pipe in non blocking module through the APR_FOPEN_NONBLOCK flag. + [Graham Leggett] + *) Enable per-connection LDAP client certificates for openldap by requesting a new SSL context. [Eric Covener] diff --git a/file_io/unix/open.c b/file_io/unix/open.c index c2a1b7dce9c..ce43785773a 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -136,6 +136,12 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, } #endif +#ifdef O_NONBLOCK + if (flag & APR_FOPEN_NONBLOCK) { + oflags |= O_NONBLOCK; + } +#endif + #ifdef O_CLOEXEC /* Introduced in Linux 2.6.23. Silently ignored on earlier Linux kernels. */ diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 1c80a6277ee..3740401a704 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -85,7 +85,11 @@ extern "C" { #define APR_FOPEN_ROTATING 0x10000 /**< Do file file rotation checking */ #define APR_FOPEN_MANUAL_ROTATE 0x20000 /**< Enable Manual rotation */ - + +#define APR_FOPEN_NONBLOCK 0x40000 /**< Platform dependent flag to enable + * non blocking file io */ + + /* backcompat */ #define APR_READ APR_FOPEN_READ /**< @deprecated @see APR_FOPEN_READ */ From 3aa320d559104ff283a0bc08b26d51f0e8e4bb8e Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 2 Mar 2010 01:27:42 +0000 Subject: [PATCH 6693/7878] Use the APR_FOPEN_* constants instead of the deprecated APR_* constants within code outside the file_io code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@917837 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_buckets_file.c | 4 ++-- dbm/apr_dbm_sdbm.c | 10 +++++----- dbm/sdbm/sdbm.c | 8 ++++---- include/arch/unix/apr_arch_inherit.h | 4 ++-- locks/unix/proc_mutex.c | 10 +++++----- shmem/unix/shm.c | 6 +++--- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/buckets/apr_buckets_file.c b/buckets/apr_buckets_file.c index 7df138a60eb..c26089496ab 100644 --- a/buckets/apr_buckets_file.c +++ b/buckets/apr_buckets_file.c @@ -93,14 +93,14 @@ static apr_status_t file_bucket_read(apr_bucket *e, const char **str, #endif #if APR_HAS_THREADS && !APR_HAS_XTHREAD_FILES - if ((flags = apr_file_flags_get(f)) & APR_XTHREAD) { + if ((flags = apr_file_flags_get(f)) & APR_FOPEN_XTHREAD) { /* this file descriptor is shared across multiple threads and * this OS doesn't support that natively, so as a workaround * we must reopen the file into a->readpool */ const char *fname; apr_file_name_get(&fname, f); - rv = apr_file_open(&f, fname, (flags & ~APR_XTHREAD), 0, a->readpool); + rv = apr_file_open(&f, fname, (flags & ~APR_FOPEN_XTHREAD), 0, a->readpool); if (rv != APR_SUCCESS) return rv; diff --git a/dbm/apr_dbm_sdbm.c b/dbm/apr_dbm_sdbm.c index 0062a3d3038..7a246dd4fa4 100644 --- a/dbm/apr_dbm_sdbm.c +++ b/dbm/apr_dbm_sdbm.c @@ -27,11 +27,11 @@ #include "apr_dbm_private.h" #include "apr_sdbm.h" -#define APR_DBM_DBMODE_RO (APR_READ | APR_BUFFERED) -#define APR_DBM_DBMODE_RW (APR_READ | APR_WRITE) -#define APR_DBM_DBMODE_RWCREATE (APR_READ | APR_WRITE | APR_CREATE) -#define APR_DBM_DBMODE_RWTRUNC (APR_READ | APR_WRITE | APR_CREATE | \ - APR_TRUNCATE) +#define APR_DBM_DBMODE_RO (APR_FOPEN_READ | APR_FOPEN_BUFFERED) +#define APR_DBM_DBMODE_RW (APR_FOPEN_READ | APR_FOPEN_WRITE) +#define APR_DBM_DBMODE_RWCREATE (APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE) +#define APR_DBM_DBMODE_RWTRUNC (APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | \ + APR_FOPEN_TRUNCATE) static apr_status_t set_error(apr_dbm_t *dbm, apr_status_t dbm_said) { diff --git a/dbm/sdbm/sdbm.c b/dbm/sdbm/sdbm.c index 7fa9431f55e..3f4d65d92dc 100644 --- a/dbm/sdbm/sdbm.c +++ b/dbm/sdbm/sdbm.c @@ -101,7 +101,7 @@ static apr_status_t prep(apr_sdbm_t **pdb, const char *dirname, const char *pagn * as required by this package. Also set our internal * flag for RDONLY if needed. */ - if (!(flags & APR_WRITE)) { + if (!(flags & APR_FOPEN_WRITE)) { db->flags |= SDBM_RDONLY; } @@ -111,12 +111,12 @@ static apr_status_t prep(apr_sdbm_t **pdb, const char *dirname, const char *pagn * an apr_file_t, in case it's ever introduced, and set * our own flag. */ - if (flags & APR_SHARELOCK) { + if (flags & APR_FOPEN_SHARELOCK) { db->flags |= SDBM_SHARED; - flags &= ~APR_SHARELOCK; + flags &= ~APR_FOPEN_SHARELOCK; } - flags |= APR_BINARY | APR_READ; + flags |= APR_FOPEN_BINARY | APR_FOPEN_READ; /* * open the files in sequence, and stat the dirfile. diff --git a/include/arch/unix/apr_arch_inherit.h b/include/arch/unix/apr_arch_inherit.h index 6ae2435f052..21543c1e1c3 100644 --- a/include/arch/unix/apr_arch_inherit.h +++ b/include/arch/unix/apr_arch_inherit.h @@ -24,7 +24,7 @@ #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \ { \ - if (the##name->flag & APR_FILE_NOCLEANUP) \ + if (the##name->flag & APR_FOPEN_NOCLEANUP) \ return APR_EINVAL; \ if (!(the##name->flag & APR_INHERIT)) { \ int flags = fcntl(the##name->name##des, F_GETFD); \ @@ -44,7 +44,7 @@ apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \ #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \ { \ - if (the##name->flag & APR_FILE_NOCLEANUP) \ + if (the##name->flag & APR_FOPEN_NOCLEANUP) \ return APR_EINVAL; \ if (the##name->flag & APR_INHERIT) { \ int flags; \ diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 71d321d97a9..2c154516f01 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -569,14 +569,14 @@ static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, if (fname) { new_mutex->fname = apr_pstrdup(new_mutex->pool, fname); rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, - APR_CREATE | APR_WRITE | APR_EXCL, + APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_EXCL, APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD, new_mutex->pool); } else { new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX"); rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname, - APR_CREATE | APR_WRITE | APR_EXCL, + APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_EXCL, new_mutex->pool); } @@ -706,14 +706,14 @@ static apr_status_t proc_mutex_flock_create(apr_proc_mutex_t *new_mutex, if (fname) { new_mutex->fname = apr_pstrdup(new_mutex->pool, fname); rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, - APR_CREATE | APR_WRITE | APR_EXCL, + APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_EXCL, APR_UREAD | APR_UWRITE, new_mutex->pool); } else { new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX"); rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname, - APR_CREATE | APR_WRITE | APR_EXCL, + APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_EXCL, new_mutex->pool); } @@ -789,7 +789,7 @@ static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, } new_mutex->fname = apr_pstrdup(pool, fname); rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, - APR_WRITE, 0, new_mutex->pool); + APR_FOPEN_WRITE, 0, new_mutex->pool); if (rv != APR_SUCCESS) { return rv; } diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 42921955aa1..f1259e232c0 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -304,7 +304,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* FIXME: APR_OS_DEFAULT is too permissive, switch to 600 I think. */ status = apr_file_open(&file, filename, - APR_WRITE | APR_CREATE | APR_EXCL, + APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL, APR_OS_DEFAULT, pool); if (status != APR_SUCCESS) { return status; @@ -384,7 +384,7 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, return APR_SUCCESS; #elif APR_USE_SHMEM_SHMGET /* Presume that the file already exists; just open for writing */ - status = apr_file_open(&file, filename, APR_WRITE, + status = apr_file_open(&file, filename, APR_FOPEN_WRITE, APR_OS_DEFAULT, pool); if (status) { return status; @@ -527,7 +527,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, new_m = apr_palloc(pool, sizeof(apr_shm_t)); status = apr_file_open(&file, filename, - APR_READ, APR_OS_DEFAULT, pool); + APR_FOPEN_READ, APR_OS_DEFAULT, pool); if (status != APR_SUCCESS) { return status; } From 3fe877a191640ba21ed41911a1aad2c05d9ae3ee Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 2 Mar 2010 01:28:52 +0000 Subject: [PATCH 6694/7878] Use the APR_FOPEN_* constants instead of the deprecated APR_* constants within code inside the test suite. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@917838 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 4 +-- test/testbuckets.c | 2 +- test/testdir.c | 2 +- test/testdup.c | 16 +++++----- test/testfile.c | 78 ++++++++++++++++++++++----------------------- test/testfileinfo.c | 12 +++---- test/testflock.c | 2 +- test/testldap.c | 2 +- test/testmmap.c | 2 +- test/testproc.c | 6 ++-- test/testxml.c | 8 ++--- test/tryread.c | 2 +- 12 files changed, 68 insertions(+), 68 deletions(-) diff --git a/test/sendfile.c b/test/sendfile.c index 488d26481b5..e60ec71b2c9 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -109,7 +109,7 @@ static void create_testfile(apr_pool_t *p, const char *fname) printf("Creating a test file...\n"); rv = apr_file_open(&f, fname, - APR_CREATE | APR_WRITE | APR_TRUNCATE | APR_BUFFERED, + APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_TRUNCATE | APR_FOPEN_BUFFERED, APR_UREAD | APR_UWRITE, p); if (rv) { fprintf(stderr, "apr_file_open()->%d/%s\n", @@ -188,7 +188,7 @@ static int client(client_socket_mode_t socket_mode, char *host) apr_setup(&p, &sock, &family); create_testfile(p, TESTFILE); - rv = apr_file_open(&f, TESTFILE, APR_READ, 0, p); + rv = apr_file_open(&f, TESTFILE, APR_FOPEN_READ, 0, p); if (rv != APR_SUCCESS) { fprintf(stderr, "apr_file_open()->%d/%s\n", rv, diff --git a/test/testbuckets.c b/test/testbuckets.c index 62706dcba45..954b474c565 100644 --- a/test/testbuckets.c +++ b/test/testbuckets.c @@ -368,7 +368,7 @@ static apr_file_t *make_test_file(abts_case *tc, const char *fname, ABTS_ASSERT(tc, "create test file", apr_file_open(&f, fname, - APR_READ|APR_WRITE|APR_TRUNCATE|APR_CREATE, + APR_FOPEN_READ|APR_FOPEN_WRITE|APR_FOPEN_TRUNCATE|APR_FOPEN_CREATE, APR_OS_DEFAULT, p) == APR_SUCCESS); ABTS_ASSERT(tc, "write test file contents", diff --git a/test/testdir.c b/test/testdir.c index 63a2f1722ef..417a1d7b226 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -180,7 +180,7 @@ static void test_uncleared_errno(abts_case *tc, void *data) rv = apr_dir_make("dir2", APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_open(&thefile, "dir1/file1", - APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, p); + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_close(thefile); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); diff --git a/test/testdup.c b/test/testdup.c index a7463379fa8..fd88f223ee3 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -34,8 +34,8 @@ static void test_file_dup(abts_case *tc, void *data) /* First, create a new file, empty... */ rv = apr_file_open(&file1, FILEPATH "testdup.file", - APR_READ | APR_WRITE | APR_CREATE | - APR_DELONCLOSE, APR_OS_DEFAULT, p); + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | + APR_FOPEN_DELONCLOSE, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, file1); @@ -65,8 +65,8 @@ static void test_file_readwrite(abts_case *tc, void *data) /* First, create a new file, empty... */ rv = apr_file_open(&file1, FILEPATH "testdup.readwrite.file", - APR_READ | APR_WRITE | APR_CREATE | - APR_DELONCLOSE, APR_OS_DEFAULT, p); + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | + APR_FOPEN_DELONCLOSE, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, file1); @@ -106,8 +106,8 @@ static void test_dup2(abts_case *tc, void *data) apr_status_t rv; rv = apr_file_open(&testfile, FILEPATH "testdup2.file", - APR_READ | APR_WRITE | APR_CREATE | - APR_DELONCLOSE, APR_OS_DEFAULT, p); + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | + APR_FOPEN_DELONCLOSE, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, testfile); @@ -143,8 +143,8 @@ static void test_dup2_readwrite(abts_case *tc, void *data) apr_off_t fpos; rv = apr_file_open(&testfile, FILEPATH "testdup2.readwrite.file", - APR_READ | APR_WRITE | APR_CREATE | - APR_DELONCLOSE, APR_OS_DEFAULT, p); + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | + APR_FOPEN_DELONCLOSE, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, testfile); diff --git a/test/testfile.c b/test/testfile.c index 49d9a3ac928..2b46586693f 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -38,7 +38,7 @@ static void test_open_noreadwrite(abts_case *tc, void *data) apr_file_t *thefile = NULL; rv = apr_file_open(&thefile, FILENAME, - APR_CREATE | APR_EXCL, + APR_FOPEN_CREATE | APR_FOPEN_EXCL, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_TRUE(tc, rv != APR_SUCCESS); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EACCES(rv)); @@ -51,7 +51,7 @@ static void test_open_excl(abts_case *tc, void *data) apr_file_t *thefile = NULL; rv = apr_file_open(&thefile, FILENAME, - APR_CREATE | APR_EXCL | APR_WRITE, + APR_FOPEN_CREATE | APR_FOPEN_EXCL | APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_TRUE(tc, rv != APR_SUCCESS); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EEXIST(rv)); @@ -64,7 +64,7 @@ static void test_open_read(abts_case *tc, void *data) apr_file_t *filetest = NULL; rv = apr_file_open(&filetest, FILENAME, - APR_READ, + APR_FOPEN_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, filetest); @@ -96,7 +96,7 @@ static void test_read(abts_case *tc, void *data) apr_file_t *filetest = NULL; rv = apr_file_open(&filetest, FILENAME, - APR_READ, + APR_FOPEN_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); @@ -115,7 +115,7 @@ static void test_readzero(abts_case *tc, void *data) char *str = NULL; apr_file_t *filetest; - rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_OS_DEFAULT, p); + rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ, APR_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); @@ -132,7 +132,7 @@ static void test_filename(abts_case *tc, void *data) apr_file_t *filetest = NULL; rv = apr_file_open(&filetest, FILENAME, - APR_READ, + APR_FOPEN_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); @@ -151,7 +151,7 @@ static void test_fileclose(abts_case *tc, void *data) apr_file_t *filetest = NULL; rv = apr_file_open(&filetest, FILENAME, - APR_READ, + APR_FOPEN_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); @@ -170,7 +170,7 @@ static void test_file_remove(abts_case *tc, void *data) rv = apr_file_remove(FILENAME, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_open(&filetest, FILENAME, APR_READ, + rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); } @@ -182,7 +182,7 @@ static void test_open_write(abts_case *tc, void *data) filetest = NULL; rv = apr_file_open(&filetest, FILENAME, - APR_WRITE, + APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); ABTS_PTR_EQUAL(tc, NULL, filetest); @@ -195,7 +195,7 @@ static void test_open_writecreate(abts_case *tc, void *data) filetest = NULL; rv = apr_file_open(&filetest, FILENAME, - APR_WRITE | APR_CREATE, + APR_FOPEN_WRITE | APR_FOPEN_CREATE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -209,7 +209,7 @@ static void test_write(abts_case *tc, void *data) apr_file_t *filetest = NULL; rv = apr_file_open(&filetest, FILENAME, - APR_WRITE | APR_CREATE, + APR_FOPEN_WRITE | APR_FOPEN_CREATE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -226,7 +226,7 @@ static void test_open_readwrite(abts_case *tc, void *data) filetest = NULL; rv = apr_file_open(&filetest, FILENAME, - APR_READ | APR_WRITE, + APR_FOPEN_READ | APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, filetest); @@ -243,7 +243,7 @@ static void test_seek(abts_case *tc, void *data) apr_file_t *filetest = NULL; rv = apr_file_open(&filetest, FILENAME, - APR_READ, + APR_FOPEN_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv); @@ -267,7 +267,7 @@ static void test_seek(abts_case *tc, void *data) /* Test for regression of sign error bug with SEEK_END and buffered files. */ rv = apr_file_open(&filetest, FILENAME, - APR_READ | APR_BUFFERED, + APR_FOPEN_READ | APR_FOPEN_BUFFERED, APR_UREAD | APR_UWRITE | APR_GREAD, p); APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv); @@ -292,7 +292,7 @@ static void test_userdata_set(abts_case *tc, void *data) apr_file_t *filetest = NULL; rv = apr_file_open(&filetest, FILENAME, - APR_WRITE, + APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -310,7 +310,7 @@ static void test_userdata_get(abts_case *tc, void *data) apr_file_t *filetest = NULL; rv = apr_file_open(&filetest, FILENAME, - APR_WRITE, + APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -333,7 +333,7 @@ static void test_userdata_getnokey(abts_case *tc, void *data) apr_file_t *filetest = NULL; rv = apr_file_open(&filetest, FILENAME, - APR_WRITE, + APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -351,7 +351,7 @@ static void test_buffer_set_get(abts_case *tc, void *data) char * buffer; rv = apr_file_open(&filetest, FILENAME, - APR_WRITE | APR_BUFFERED, + APR_FOPEN_WRITE | APR_FOPEN_BUFFERED, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -379,7 +379,7 @@ static void test_getc(abts_case *tc, void *data) apr_status_t rv; char ch; - rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); + rv = apr_file_open(&f, FILENAME, APR_FOPEN_READ, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); apr_file_getc(&ch, f); @@ -394,7 +394,7 @@ static void test_ungetc(abts_case *tc, void *data) apr_status_t rv; char ch; - rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); + rv = apr_file_open(&f, FILENAME, APR_FOPEN_READ, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); apr_file_getc(&ch, f); @@ -417,7 +417,7 @@ static void test_gets(abts_case *tc, void *data) apr_status_t rv; char *str = apr_palloc(p, 256); - rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); + rv = apr_file_open(&f, FILENAME, APR_FOPEN_READ, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_gets(str, 256, f); @@ -440,7 +440,7 @@ static void test_gets_buffered(abts_case *tc, void *data) char *str = apr_palloc(p, 256); /* This will deadlock gets before the r524355 fix. */ - rv = apr_file_open(&f, FILENAME, APR_READ|APR_BUFFERED|APR_XTHREAD, 0, p); + rv = apr_file_open(&f, FILENAME, APR_FOPEN_READ|APR_FOPEN_BUFFERED|APR_FOPEN_XTHREAD, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_gets(str, 256, f); @@ -466,7 +466,7 @@ static void test_bigread(abts_case *tc, void *data) /* Create a test file with known content. */ rv = apr_file_open(&f, "data/created_file", - APR_CREATE | APR_WRITE | APR_TRUNCATE, + APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_TRUNCATE, APR_UREAD | APR_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -481,7 +481,7 @@ static void test_bigread(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); f = NULL; - rv = apr_file_open(&f, "data/created_file", APR_READ, 0, p); + rv = apr_file_open(&f, "data/created_file", APR_FOPEN_READ, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); nbytes = sizeof buf; @@ -511,7 +511,7 @@ static void test_mod_neg(abts_case *tc, void *data) const char *fname = "data/modneg.dat"; rv = apr_file_open(&f, fname, - APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); + APR_FOPEN_CREATE | APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); s = "body56789\n"; @@ -545,7 +545,7 @@ static void test_mod_neg(abts_case *tc, void *data) rv = apr_file_close(f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_open(&f, fname, APR_READ, 0, p); + rv = apr_file_open(&f, fname, APR_FOPEN_READ, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_gets(buf, 11, f); @@ -589,7 +589,7 @@ static void file_contents_equal(abts_case *tc, apr_file_t *f; APR_ASSERT_SUCCESS(tc, "open file", - apr_file_open(&f, fname, APR_READ|APR_BUFFERED, + apr_file_open(&f, fname, APR_FOPEN_READ|APR_FOPEN_BUFFERED, 0, p)); APR_ASSERT_SUCCESS(tc, "read from file", apr_file_read_full(f, actual, expectlen, NULL)); @@ -610,7 +610,7 @@ static void test_puts(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open file for writing", apr_file_open(&f, fname, - APR_WRITE|APR_CREATE|APR_TRUNCATE, + APR_FOPEN_WRITE|APR_FOPEN_CREATE|APR_FOPEN_TRUNCATE, APR_OS_DEFAULT, p)); APR_ASSERT_SUCCESS(tc, "write line to file", @@ -633,7 +633,7 @@ static void test_writev(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open file for writing", apr_file_open(&f, fname, - APR_WRITE|APR_CREATE|APR_TRUNCATE, + APR_FOPEN_WRITE|APR_FOPEN_CREATE|APR_FOPEN_TRUNCATE, APR_OS_DEFAULT, p)); vec[0].iov_base = LINE1; @@ -675,7 +675,7 @@ static void test_writev_full(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open file for writing", apr_file_open(&f, fname, - APR_WRITE|APR_CREATE|APR_TRUNCATE, + APR_FOPEN_WRITE|APR_FOPEN_CREATE|APR_FOPEN_TRUNCATE, APR_OS_DEFAULT, p)); vec[0].iov_base = LINE1; @@ -711,8 +711,8 @@ static void test_writev_buffered(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open file for writing", apr_file_open(&f, fname, - APR_WRITE | APR_CREATE | APR_TRUNCATE | - APR_BUFFERED, APR_OS_DEFAULT, p)); + APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE | + APR_FOPEN_BUFFERED, APR_OS_DEFAULT, p)); nbytes = strlen(TESTSTR); APR_ASSERT_SUCCESS(tc, "buffered write", @@ -745,7 +745,7 @@ static void test_writev_buffered_seek(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open file for writing", apr_file_open(&f, fname, - APR_WRITE | APR_READ | APR_BUFFERED, + APR_FOPEN_WRITE | APR_FOPEN_READ | APR_FOPEN_BUFFERED, APR_OS_DEFAULT, p)); rv = apr_file_read(f, str, &nbytes); @@ -783,7 +783,7 @@ static void test_truncate(abts_case *tc, void *data) apr_file_remove(fname, p); rv = apr_file_open(&f, fname, - APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); + APR_FOPEN_CREATE | APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); s = "some data"; @@ -796,7 +796,7 @@ static void test_truncate(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_open(&f, fname, - APR_TRUNCATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); + APR_FOPEN_TRUNCATE | APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_close(f); @@ -821,7 +821,7 @@ static void test_bigfprintf(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open test file", apr_file_open(&f, fname, - APR_CREATE|APR_WRITE, + APR_FOPEN_CREATE|APR_FOPEN_WRITE, APR_UREAD|APR_UWRITE, p)); @@ -854,7 +854,7 @@ static void test_fail_write_flush(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open test file", apr_file_open(&f, fname, - APR_CREATE|APR_READ|APR_BUFFERED, + APR_FOPEN_CREATE|APR_FOPEN_READ|APR_FOPEN_BUFFERED, APR_UREAD|APR_UWRITE, p)); memset(buf, 'A', sizeof buf); @@ -884,7 +884,7 @@ static void test_fail_read_flush(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open test file", apr_file_open(&f, fname, - APR_CREATE|APR_READ|APR_BUFFERED, + APR_FOPEN_CREATE|APR_FOPEN_READ|APR_FOPEN_BUFFERED, APR_UREAD|APR_UWRITE, p)); /* this write should be buffered. */ @@ -923,7 +923,7 @@ static void test_xthread(abts_case *tc, void *data) apr_file_t *f; const char *fname = "data/testxthread.dat"; apr_status_t rv; - apr_int32_t flags = APR_CREATE|APR_READ|APR_WRITE|APR_APPEND|APR_XTHREAD; + apr_int32_t flags = APR_FOPEN_CREATE|APR_FOPEN_READ|APR_FOPEN_WRITE|APR_FOPEN_APPEND|APR_FOPEN_XTHREAD; char buf[128] = { 0 }; /* Test for bug 38438, opening file with append + xthread and seeking to diff --git a/test/testfileinfo.c b/test/testfileinfo.c index ea58e12cd5b..ff085930d16 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -109,7 +109,7 @@ static void test_info_get(abts_case *tc, void *data) apr_finfo_t finfo; apr_status_t rv; - rv = apr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p); + rv = apr_file_open(&thefile, FILENAME, APR_FOPEN_READ, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); @@ -155,7 +155,7 @@ static void test_stat_eq_finfo(abts_case *tc, void *data) apr_finfo_t stat_finfo; apr_status_t rv; - rv = apr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p); + rv = apr_file_open(&thefile, FILENAME, APR_FOPEN_READ, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); @@ -180,8 +180,8 @@ static void test_buffered_write_size(abts_case *tc, void *data) apr_size_t bytes; rv = apr_file_open(&thefile, NEWFILENAME, - APR_READ | APR_WRITE | APR_CREATE | APR_TRUNCATE - | APR_BUFFERED | APR_DELONCLOSE, + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE + | APR_FOPEN_BUFFERED | APR_FOPEN_DELONCLOSE, APR_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "open file", rv); @@ -213,8 +213,8 @@ static void test_mtime_set(abts_case *tc, void *data) * the epoch. */ rv = apr_file_open(&thefile, NEWFILENAME, - APR_READ | APR_WRITE | APR_CREATE | APR_TRUNCATE - | APR_BUFFERED | APR_DELONCLOSE, + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE + | APR_FOPEN_BUFFERED | APR_FOPEN_DELONCLOSE, APR_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "open file", rv); diff --git a/test/testflock.c b/test/testflock.c index 136d9f649c0..b9e8c79281f 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -63,7 +63,7 @@ static void test_withlock(abts_case *tc, void *data) apr_status_t rv; int code; - rv = apr_file_open(&file, TESTFILE, APR_WRITE|APR_CREATE, + rv = apr_file_open(&file, TESTFILE, APR_FOPEN_WRITE|APR_FOPEN_CREATE, APR_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "Could not create file.", rv); ABTS_PTR_NOTNULL(tc, file); diff --git a/test/testldap.c b/test/testldap.c index 7595a55fe62..4f4fef907bc 100644 --- a/test/testldap.c +++ b/test/testldap.c @@ -80,7 +80,7 @@ static int get_ldap_host(void) ldap_host[0] = '\0'; rv = apr_file_open(&thefile, FILENAME, - APR_READ, + APR_FOPEN_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); if (rv != APR_SUCCESS) { return 0; diff --git a/test/testmmap.c b/test/testmmap.c index ee87b3bfc4b..4063ba62e63 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -73,7 +73,7 @@ static void test_file_open(abts_case *tc, void *data) { apr_status_t rv; - rv = apr_file_open(&thefile, file1, APR_READ, APR_UREAD | APR_GREAD, p); + rv = apr_file_open(&thefile, file1, APR_FOPEN_READ, APR_UREAD | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, thefile); } diff --git a/test/testproc.c b/test/testproc.c index 5cf768f1eec..c983f2594b7 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -91,15 +91,15 @@ static void test_file_redir(abts_case *tc, void *data) testfile = NULL; rv = apr_file_open(&testfile, "data/stdin", - APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_open(&testout, "data/stdout", - APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_open(&testerr, "data/stderr", - APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); diff --git a/test/testxml.c b/test/testxml.c index cc82c978a74..3d2542d4445 100644 --- a/test/testxml.c +++ b/test/testxml.c @@ -28,8 +28,8 @@ static apr_status_t create_dummy_file_error(abts_case *tc, apr_pool_t *p, apr_off_t off = 0L; char template[] = "data/testxmldummyerrorXXXXXX"; - rv = apr_file_mktemp(fd, template, APR_CREATE | APR_TRUNCATE | APR_DELONCLOSE | - APR_READ | APR_WRITE | APR_EXCL, p); + rv = apr_file_mktemp(fd, template, APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE | APR_FOPEN_DELONCLOSE | + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_EXCL, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); if (rv != APR_SUCCESS) @@ -62,8 +62,8 @@ static apr_status_t create_dummy_file(abts_case *tc, apr_pool_t *p, apr_off_t off = 0L; char template[] = "data/testxmldummyXXXXXX"; - rv = apr_file_mktemp(fd, template, APR_CREATE | APR_TRUNCATE | APR_DELONCLOSE | - APR_READ | APR_WRITE | APR_EXCL, p); + rv = apr_file_mktemp(fd, template, APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE | APR_FOPEN_DELONCLOSE | + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_EXCL, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); if (rv != APR_SUCCESS) diff --git a/test/tryread.c b/test/tryread.c index 729f8e699b9..569d647c36b 100644 --- a/test/tryread.c +++ b/test/tryread.c @@ -33,7 +33,7 @@ int main(int argc, const char * const *argv) apr_initialize(); apr_pool_create(&p, NULL); - if (apr_file_open(&file, TESTFILE, APR_WRITE, APR_OS_DEFAULT, p) + if (apr_file_open(&file, TESTFILE, APR_FOPEN_WRITE, APR_OS_DEFAULT, p) != APR_SUCCESS) { exit(UNEXPECTED_ERROR); From 1bf3dcb9a6d36b112482ae23e69a09381b38e8e0 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Tue, 9 Mar 2010 10:40:06 +0000 Subject: [PATCH 6695/7878] Otherwise it won't compile. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@920783 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 48736984a5a..ebf68c474ec 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -607,12 +607,12 @@ APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, if (!CreateHardLinkW(wto_path, wfrom_path, NULL)) return apr_get_os_error(); } -#endif #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI { if (!CreateHardLinkA(wto_path, wfrom_path)) return apr_get_os_error() } +#endif #endif return rv; } From be1d321ac1ee1ed5b66225669317abc86cb611ed Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Tue, 9 Mar 2010 13:27:11 +0000 Subject: [PATCH 6696/7878] Rollback r920783 looking for a real correction... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@920862 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index ebf68c474ec..48736984a5a 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -607,12 +607,12 @@ APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, if (!CreateHardLinkW(wto_path, wfrom_path, NULL)) return apr_get_os_error(); } +#endif #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI { if (!CreateHardLinkA(wto_path, wfrom_path)) return apr_get_os_error() } -#endif #endif return rv; } From 4602c368bcc4848dedf68ec45942e3f6fb3c0aef Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Tue, 9 Mar 2010 14:42:23 +0000 Subject: [PATCH 6697/7878] typos? Otherwise it won't compile. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@920897 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 48736984a5a..a4e6f269240 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -610,8 +610,8 @@ APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, #endif #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI { - if (!CreateHardLinkA(wto_path, wfrom_path)) - return apr_get_os_error() + if (!CreateHardLinkA(to_path, from_path, NULL)) + return apr_get_os_error(); } #endif return rv; From f5d41f7c1c0c04b04091d7127de81b08483310f7 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 13 Mar 2010 17:34:47 +0000 Subject: [PATCH 6698/7878] Fix an incorrect comment describing the bufsize member of apr_file_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@922620 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/apr_arch_file_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arch/os2/apr_arch_file_io.h b/include/arch/os2/apr_arch_file_io.h index 399371237a9..a898547ab7c 100644 --- a/include/arch/os2/apr_arch_file_io.h +++ b/include/arch/os2/apr_arch_file_io.h @@ -49,7 +49,7 @@ struct apr_file_t { /* Stuff for buffered mode */ char *buffer; - apr_size_t bufsize; // Read/Write position in buffer + apr_size_t bufsize; // The size of the buffer apr_size_t bufpos; // Read/Write position in buffer unsigned long dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write From 91590c6da8e024144d7c25098e7e7b7413a89e10 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 13 Mar 2010 17:56:03 +0000 Subject: [PATCH 6699/7878] Remove trailing backslashes in the ldap section of build.conf as they're not necessary and cause buildconf to fail on OS/2 with an assert failure in gen-build.py. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@922628 13f79535-47bb-0310-9956-ffa450edef68 --- build.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.conf b/build.conf index 88320bb55a5..1fa1eae48f7 100644 --- a/build.conf +++ b/build.conf @@ -109,8 +109,8 @@ paths = dbm/apr_dbm_ndbm.c target = dbm/apr_dbm_ndbm.la [ldap] -paths = ldap/apr_ldap_init.c \ - ldap/apr_ldap_option.c \ +paths = ldap/apr_ldap_init.c + ldap/apr_ldap_option.c ldap/apr_ldap_rebind.c target = ldap/apr_ldap.la From f6cf34e361175cacbc96cd6baf5f8df231492202 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 13 Mar 2010 18:10:03 +0000 Subject: [PATCH 6700/7878] Include unix multicast functions in OS/2 build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@922635 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/multicast.c | 1 + 1 file changed, 1 insertion(+) create mode 100644 network_io/os2/multicast.c diff --git a/network_io/os2/multicast.c b/network_io/os2/multicast.c new file mode 100644 index 00000000000..f1ab4990e22 --- /dev/null +++ b/network_io/os2/multicast.c @@ -0,0 +1 @@ +#include "../unix/multicast.c" From fd9805decd39c587d5af8f90bb6e533d1699903d Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 15 Mar 2010 15:55:22 +0000 Subject: [PATCH 6701/7878] OS/2: Implement apr_pollset_wakeup() using a unix domain socket. Also adds stubs for apr_poll_method_defname() and apr_pollset_method_name(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@923311 13f79535-47bb-0310-9956-ffa450edef68 --- poll/os2/pollset.c | 92 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 86 insertions(+), 6 deletions(-) diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c index e77dc9a3e8a..8d5d012b15c 100644 --- a/poll/os2/pollset.c +++ b/poll/os2/pollset.c @@ -18,7 +18,9 @@ #include "apr_poll.h" #include "apr_arch_networkio.h" - +#ifndef MSG_DONTWAIT +#define MSG_DONTWAIT 0x100 +#endif struct apr_pollset_t { apr_pool_t *pool; @@ -31,6 +33,9 @@ struct apr_pollset_t { int num_total; apr_pollfd_t *query_set; apr_pollfd_t *result_set; + apr_socket_t *wake_listen; + apr_socket_t *wake_sender; + apr_sockaddr_t *wake_address; }; @@ -40,6 +45,12 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_pool_t *p, apr_uint32_t flags) { + apr_status_t rc = APR_SUCCESS; + + if (flags & APR_POLLSET_WAKEABLE) { + size++; + } + *pollset = apr_palloc(p, sizeof(**pollset)); (*pollset)->pool = p; (*pollset)->nelts = 0; @@ -48,7 +59,34 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); (*pollset)->num_read = -1; - return APR_SUCCESS; + (*pollset)->wake_listen = NULL; + (*pollset)->wake_sender = NULL; + + if (flags & APR_POLLSET_WAKEABLE) { + rc = apr_socket_create(&(*pollset)->wake_listen, APR_UNIX, SOCK_DGRAM, 0, p); + + if (rc == APR_SUCCESS) { + apr_sockaddr_t *listen_address; + apr_socket_timeout_set((*pollset)->wake_listen, 0); + apr_sockaddr_info_get(&listen_address, "", APR_UNIX, 0, 0, p); + rc = apr_socket_bind((*pollset)->wake_listen, listen_address); + + if (rc == APR_SUCCESS) { + apr_pollfd_t wake_poll_fd; + wake_poll_fd.p = p; + wake_poll_fd.desc_type = APR_POLL_SOCKET; + wake_poll_fd.reqevents = APR_POLLIN; + wake_poll_fd.desc.s = (*pollset)->wake_listen; + wake_poll_fd.client_data = NULL; + apr_pollset_add(*pollset, &wake_poll_fd); + apr_socket_addr_get(&(*pollset)->wake_address, APR_LOCAL, (*pollset)->wake_listen); + + rc = apr_socket_create(&(*pollset)->wake_sender, APR_UNIX, SOCK_DGRAM, 0, p); + } + } + } + + return rc; } APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, @@ -57,6 +95,13 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, apr_uint32_t flags, apr_pollset_method_e method) { + /* Only one method is supported */ + if (flags & APR_POLLSET_NODEFAULT) { + if (method != APR_POLLSET_DEFAULT && method != APR_POLLSET_POLL) { + return APR_ENOTIMPL; + } + } + return apr_pollset_create(pollset, size, p, flags); } @@ -167,6 +212,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_uint32_t i; int *pollresult; int read_pos, write_pos, except_pos; + apr_status_t rc = APR_SUCCESS; if (pollset->num_read < 0) { make_pollset(pollset); @@ -216,9 +262,21 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } if (rtnevents) { - pollset->result_set[*num] = pollset->query_set[i]; - pollset->result_set[*num].rtnevents = rtnevents; - (*num)++; + if (i == 0 && pollset->wake_listen != NULL) { + struct apr_sockaddr_t from_addr; + char buffer[16]; + apr_size_t buflen; + rc = APR_EINTR; + + do { + buflen = sizeof(buffer); + } while (apr_socket_recvfrom(&from_addr, pollset->wake_listen, MSG_DONTWAIT, buffer, &buflen) == APR_SUCCESS); + } + else { + pollset->result_set[*num] = pollset->query_set[i]; + pollset->result_set[*num].rtnevents = rtnevents; + (*num)++; + } } } @@ -226,5 +284,27 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, *descriptors = pollset->result_set; } - return APR_SUCCESS; + return rc; +} + + + +APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) +{ + apr_size_t len = 1; + return apr_socket_sendto(pollset->wake_sender, pollset->wake_address, 0, "", &len); +} + + + +APR_DECLARE(const char *) apr_poll_method_defname() +{ + return "select"; +} + + + +APR_DECLARE(const char *) apr_pollset_method_name(apr_pollset_t *pollset) +{ + return "select"; } From 276b967f0958e59468988d7422c0610c927f4e47 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 15 Mar 2010 16:10:18 +0000 Subject: [PATCH 6702/7878] OS/2: Protect against NULL dereference if apr_pollset_wakeup() is called for a non-wakeable pollset. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@923320 13f79535-47bb-0310-9956-ffa450edef68 --- poll/os2/pollset.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c index 8d5d012b15c..e1263b5f211 100644 --- a/poll/os2/pollset.c +++ b/poll/os2/pollset.c @@ -291,8 +291,12 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset) { - apr_size_t len = 1; - return apr_socket_sendto(pollset->wake_sender, pollset->wake_address, 0, "", &len); + if (pollset->wake_sender) { + apr_size_t len = 1; + return apr_socket_sendto(pollset->wake_sender, pollset->wake_address, 0, "", &len); + } + + return APR_EINIT; } From 6ff9cb57698f9a1897a9f40dc9062372d36e69e0 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 15 Mar 2010 16:27:34 +0000 Subject: [PATCH 6703/7878] OS/2: Implement pollcb API. As we don't have any advanced features like kqueue or similar, this is just a wrapper for a pollset. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@923329 13f79535-47bb-0310-9956-ffa450edef68 --- poll/os2/pollcb.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 poll/os2/pollcb.c diff --git a/poll/os2/pollcb.c b/poll/os2/pollcb.c new file mode 100644 index 00000000000..63b33cb169f --- /dev/null +++ b/poll/os2/pollcb.c @@ -0,0 +1,96 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr.h" +#include "apr_poll.h" + +struct apr_pollcb_t { + apr_pool_t *pool; + apr_pollset_t *pollset; +}; + + + +APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) +{ + return apr_pollcb_create_ex(pollcb, size, p, flags, APR_POLLSET_DEFAULT); +} + + + +APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **ret_pollcb, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags, + apr_pollset_method_e method) +{ + apr_pollcb_t *pollcb = apr_palloc(p, sizeof(apr_pollcb_t)); + pollcb->pool = p; + *ret_pollcb = pollcb; + return apr_pollset_create_ex(&pollcb->pollset, size, p, flags, method); +} + + + +APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) +{ + return apr_pollset_add(pollcb->pollset, descriptor); +} + + + +APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, + apr_pollfd_t *descriptor) +{ + return apr_pollset_remove(pollcb->pollset, descriptor); +} + + + +APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, + apr_interval_time_t timeout, + apr_pollcb_cb_t func, + void *baton) +{ + int c; + int num_signaled = 0; + const apr_pollfd_t *signalled_descriptors; + apr_status_t rc = apr_pollset_poll(pollcb->pollset, timeout, &num_signaled, &signalled_descriptors); + + for (c = 0; rc == APR_SUCCESS && c < num_signaled; c++) { + rc = func(baton, signalled_descriptors + c); + } + + return rc; +} + + + +APR_DECLARE(const char *) apr_pollcb_method_name(apr_pollcb_t *pollcb) +{ + return "poll"; +} + + + +APR_DECLARE(apr_status_t) apr_pollcb_wakeup(apr_pollcb_t *pollcb) +{ + return apr_pollset_wakeup(pollcb->pollset); +} From b48fa357b79c15a7050d2bd72e1dac788e5a91a5 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 16 Mar 2010 15:37:11 +0000 Subject: [PATCH 6704/7878] OS/2: In apr_dir_open(), check that the supplied directory name is actually valid before returning APR_SUCCESS. This fixes a failure in testdir. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@923810 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/dir.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 3b08355f567..f1554b6f35c 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -31,6 +31,8 @@ static apr_status_t dir_cleanup(void *thedir) APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *pool) { + FILESTATUS3 filestatus; + int rv; apr_dir_t *thedir = (apr_dir_t *)apr_palloc(pool, sizeof(apr_dir_t)); if (thedir == NULL) @@ -46,6 +48,17 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, apr thedir->validentry = FALSE; *new = thedir; apr_pool_cleanup_register(pool, thedir, dir_cleanup, apr_pool_cleanup_null); + + rv = DosQueryPathInfo(dirname, FIL_STANDARD, &filestatus, sizeof(filestatus)); + + if (rv != 0) { + return APR_FROM_OS_ERROR(rv); + } + + if ((filestatus.attrFile & FILE_DIRECTORY) == 0) { + return APR_ENOTDIR; + } + return APR_SUCCESS; } From 5b2303e6a4251e4eb3a9c63980f57a03a0e5faa3 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 16 Mar 2010 15:44:07 +0000 Subject: [PATCH 6705/7878] OS/2: In apr_socket_create(), override the supplied protocol if family is AF_UNIX. This is done in the unix implementation and is required to pass tests in testsock which pass APR_PROTO_TCP with AF_UNIX. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@923815 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockets.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index bb951e4c866..580272aa5ca 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -84,6 +84,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int { int downgrade = (family == AF_UNSPEC); apr_pollfd_t pfd; + int oprotocol = protocol; if (family == AF_UNSPEC) { #if APR_HAVE_IPV6 @@ -93,6 +94,10 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int #endif } + if (family == APR_UNIX) { + protocol = 0; + } + alloc_socket(new, cont); (*new)->socketdes = socket(family, type, protocol); @@ -106,7 +111,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int if ((*new)->socketdes < 0) { return APR_OS2_STATUS(sock_errno()); } - set_socket_vars(*new, family, type, protocol); + set_socket_vars(*new, family, type, oprotocol); (*new)->timeout = -1; (*new)->nonblock = FALSE; From f1465d712f7c56474bd86cedf858f689dff5ddde Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 16 Mar 2010 16:32:29 +0000 Subject: [PATCH 6706/7878] OS/2: Remove OS/2 implementations of APR_IMPLEMENT_INHERIT_SET/UNSET macros. They weren't quite correct and even if fixed, would only work for files so there's no benefit from using macros. apr_file_inherit_set/unset() are defined elsewhere. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@923850 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/apr_arch_inherit.h | 50 ----------------------------- 1 file changed, 50 deletions(-) delete mode 100644 include/arch/os2/apr_arch_inherit.h diff --git a/include/arch/os2/apr_arch_inherit.h b/include/arch/os2/apr_arch_inherit.h deleted file mode 100644 index 494772acd63..00000000000 --- a/include/arch/os2/apr_arch_inherit.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef INHERIT_H -#define INHERIT_H - -#include "apr_inherit.h" - -#define APR_INHERIT (1 << 24) /* Must not conflict with other bits */ - -#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ -APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ -{ \ - int rv; \ - ULONG state; \ - if (((rv = DosQueryFHState(attr->parent_err->filedes, &state)) \ - != 0) || \ - ((rv = DosSetFHState(attr->parent_err->filedes, \ - state & ~OPEN_FLAGS_NOINHERIT)) != 0)) \ - return APR_FROM_OS_ERROR(rv); \ - return APR_SUCCESS; \ -} - -#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ -APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ -{ \ - int rv; \ - ULONG state; \ - if (((rv = DosQueryFHState(attr->parent_err->filedes, &state)) \ - != 0) || \ - ((rv = DosSetFHState(attr->parent_err->filedes, \ - state | OPEN_FLAGS_NOINHERIT)) != 0)) \ - return APR_FROM_OS_ERROR(rv); \ - return APR_SUCCESS; \ -} - -#endif /* ! INHERIT_H */ From 9b2f542a1c88310abc62dc20fcf066e5a1d9034b Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 16 Mar 2010 16:45:50 +0000 Subject: [PATCH 6707/7878] OS/2: Disable building apr_wait_for_io_or_timeout() on OS/2 as it doesn't compile due to files not having a pollset (and it wouldn't make any sense to add one as files can't be polled anyway). It also doesn't help much as using select() directly almost as easy and more efficient. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@923860 13f79535-47bb-0310-9956-ffa450edef68 --- support/unix/waitio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/unix/waitio.c b/support/unix/waitio.c index 7232cdd9cea..a30ec4a7352 100644 --- a/support/unix/waitio.c +++ b/support/unix/waitio.c @@ -22,7 +22,7 @@ /* The only case where we don't use wait_for_io_or_timeout is on * pre-BONE BeOS, so this check should be sufficient and simpler */ -#if !BEOS_R5 +#if !BEOS_R5 && !defined(OS2) #define USE_WAIT_FOR_IO #endif From 83d87513ffc1911eb45d6b74b701e7da9f9ba1db Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 16 Mar 2010 16:55:55 +0000 Subject: [PATCH 6708/7878] OS/2: Rework apr_socket_sendto() & apr_socket_recvfrom() to not use apr_wait_for_io_or_timeout() and to eliminate code duplication. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@923868 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sendrecv_udp.c | 116 +++++++++++++++++++--------------- 1 file changed, 64 insertions(+), 52 deletions(-) diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c index c0dcd8562ec..1aea02c2591 100644 --- a/network_io/os2/sendrecv_udp.c +++ b/network_io/os2/sendrecv_udp.c @@ -22,8 +22,24 @@ #include "apr_lib.h" #include +static apr_status_t wait_socket_ready(apr_socket_t *sock, int readwrite) +{ + int pollsocket = sock->socketdes; + int wait_rc = select(&pollsocket, readwrite == 0, readwrite == 1, 0, sock->timeout / 1000); + + if (wait_rc == 0) { + return APR_TIMEUP; + } + else if (wait_rc < 0) { + return APR_FROM_OS_ERROR(sock_errno()); + } + + return APR_SUCCESS; +} + + -APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, +APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, apr_sockaddr_t *where, apr_int32_t flags, const char *buf, apr_size_t *len) @@ -35,30 +51,28 @@ APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, rv = sendto(sock->socketdes, buf, (*len), flags, (struct sockaddr*)&where->sa, where->salen); - } while (rv == -1 && (serrno = sock_errno()) == EINTR); - - if (rv == -1 && serrno == SOCEWOULDBLOCK && sock->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); - - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } else { - do { - rv = sendto(sock->socketdes, buf, *len, flags, - (const struct sockaddr*)&where->sa, - where->salen); - } while (rv == -1 && (serrno = sock_errno()) == SOCEINTR); - } - } - - if (rv == -1) { - *len = 0; - return APR_FROM_OS_ERROR(serrno); - } - *len = rv; - return APR_SUCCESS; + if (rv == -1) { + serrno = sock_errno(); + + if (serrno == SOCEWOULDBLOCK && sock->timeout != 0) { + apr_status_t wait_status = wait_socket_ready(sock, 1); + + if (wait_status != APR_SUCCESS) { + *len = 0; + return wait_status; + } + } + else if (serrno != SOCEINTR) { + *len = 0; + return APR_FROM_OS_ERROR(serrno); + } + } + else { + *len = rv; + return APR_SUCCESS; + } + } while (1); } @@ -72,33 +86,31 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, int serrno; do { - rv = recvfrom(sock->socketdes, buf, (*len), flags, - (struct sockaddr*)&from->sa, &from->salen); - } while (rv == -1 && (serrno = sock_errno()) == EINTR); - - if (rv == -1 && serrno == SOCEWOULDBLOCK && sock->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 1); - - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } else { - do { - rv = recvfrom(sock->socketdes, buf, *len, flags, - (struct sockaddr*)&from->sa, &from->salen); - } while (rv == -1 && (serrno = sock_errno()) == EINTR); + from->salen = sizeof(from->sa); + rv = recvfrom(sock->socketdes, buf, (*len), flags, + (struct sockaddr*)&from->sa, + &from->salen); + + if (rv == -1) { + serrno = sock_errno(); + + if (serrno == SOCEWOULDBLOCK && sock->timeout != 0) { + apr_status_t wait_status = wait_socket_ready(sock, 0); + + if (wait_status != APR_SUCCESS) { + *len = 0; + return wait_status; + } + } + else if (serrno != SOCEINTR) { + *len = 0; + return APR_FROM_OS_ERROR(serrno); + } } - } - - if (rv == -1) { - (*len) = 0; - return APR_FROM_OS_ERROR(serrno); - } - - (*len) = rv; - - if (rv == 0 && sock->type == SOCK_STREAM) - return APR_EOF; - - return APR_SUCCESS; + else { + *len = rv; + apr_sockaddr_vars_set(from, from->sa.sin.sin_family, ntohs(from->sa.sin.sin_port)); + return (rv == 0 && sock->type == SOCK_STREAM) ? APR_EOF : APR_SUCCESS; + } + } while (1); } From 6e24dfb680f82b7e8a74f2ef0462735811730945 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 22 Mar 2010 04:20:10 +0000 Subject: [PATCH 6709/7878] Add some API ideas git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@925950 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/STATUS b/STATUS index 1e57acb41a0..c945e1f678b 100644 --- a/STATUS +++ b/STATUS @@ -162,6 +162,17 @@ ONGOING REMINDERS FOR STYLE/SUBSTANCE OF CONTRIBUTING TO APR: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * Need a proper fragmentation control API for clearing apr_pool's, + where the block alloc/clear/realloc sequence introduces more and + more unusable spaces in the physical blocks. APR must provide + a mechanism to recognize such fragmented conditions, free the + physical pages, and allocate a new single pool block. See also + http://svn.haxx.se/dev/archive-2008-10/0070.shtml + + * Implement apr_pool_realloc for consumers such as apr_vformatter, + where the possibility to extend an allocation exists. Given that + an apr function does this, external consumers should be allowed to. + * Need some architecture/OS specific versions of the atomic operations. progress: generic, solaris Sparc, FreeBSD5, linux, and OS/390 done need: AIX, AS400, HPUX From 30ecfc9fccbab0380d3e2d193f4125701f352cb1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 22 Mar 2010 04:35:31 +0000 Subject: [PATCH 6710/7878] Reminder, at least to myself, to finish network TOS support git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@925952 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/STATUS b/STATUS index c945e1f678b..43006c58c67 100644 --- a/STATUS +++ b/STATUS @@ -162,6 +162,13 @@ ONGOING REMINDERS FOR STYLE/SUBSTANCE OF CONTRIBUTING TO APR: RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: + * Implement TOS for linux and solaris and bsd network API's. + The patches below implement only one of these API's, see the + pointer to mod_ftp in this bugzilla incident for hints to offer + all the necessary implementations, for starters. + http://qaix.com/apache-http-server/569-729-patch-add-ip-tos-support-read.shtml + https://issues.apache.org/bugzilla/show_bug.cgi?id=42848 + * Need a proper fragmentation control API for clearing apr_pool's, where the block alloc/clear/realloc sequence introduces more and more unusable spaces in the physical blocks. APR must provide From 04ae5f1c830428c8285d39afa4d5e6eeca11fcc8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 22 Mar 2010 06:15:04 +0000 Subject: [PATCH 6711/7878] Some folks are ignoring the Tab prohibitions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@925965 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/ppc.c | 134 +++++++++++++++++----------------- atomic/unix/s390.c | 34 ++++----- crypto/apr_sha1.c | 176 ++++++++++++++++++++++----------------------- crypto/getuuid.c | 2 +- crypto/uuid.c | 24 +++---- 5 files changed, 185 insertions(+), 185 deletions(-) diff --git a/atomic/unix/ppc.c b/atomic/unix/ppc.c index db9fca934d3..6ef429f06b6 100644 --- a/atomic/unix/ppc.c +++ b/atomic/unix/ppc.c @@ -19,7 +19,7 @@ #ifdef USE_ATOMICS_PPC #ifdef PPC405_ERRATA -# define PPC405_ERR77_SYNC " sync\n" +# define PPC405_ERR77_SYNC " sync\n" #else # define PPC405_ERR77_SYNC #endif @@ -43,12 +43,12 @@ APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint3 { apr_uint32_t prev, temp; - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%3\n" /* load and reserve */ - " add %1,%0,%4\n" /* add val and prev */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %1,0,%3\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%3\n" /* load and reserve */ + " add %1,%0,%4\n" /* add val and prev */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %1,0,%3\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ : "=&r" (prev), "=&r" (temp), "=m" (*mem) : "b" (mem), "r" (val) : "cc", "memory"); @@ -60,12 +60,12 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) { apr_uint32_t temp; - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%2\n" /* load and reserve */ - " subf %0,%3,%0\n" /* subtract val */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %0,0,%2\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%2\n" /* load and reserve */ + " subf %0,%3,%0\n" /* subtract val */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %0,0,%2\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ : "=&r" (temp), "=m" (*mem) : "b" (mem), "r" (val) : "cc", "memory"); @@ -75,13 +75,13 @@ APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) { apr_uint32_t prev; - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%2\n" /* load and reserve */ - " addi %0,%0,1\n" /* add immediate */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %0,0,%2\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ - " subi %0,%0,1\n" /* return old value */ + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%2\n" /* load and reserve */ + " addi %0,%0,1\n" /* add immediate */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %0,0,%2\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + " subi %0,%0,1\n" /* return old value */ : "=&b" (prev), "=m" (*mem) : "b" (mem), "m" (*mem) : "cc", "memory"); @@ -93,12 +93,12 @@ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) { apr_uint32_t prev; - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%2\n" /* load and reserve */ - " subi %0,%0,1\n" /* subtract immediate */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %0,0,%2\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%2\n" /* load and reserve */ + " subi %0,%0,1\n" /* subtract immediate */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %0,0,%2\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ : "=&b" (prev), "=m" (*mem) : "b" (mem), "m" (*mem) : "cc", "memory"); @@ -111,14 +111,14 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3 { apr_uint32_t prev; - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%1\n" /* load and reserve */ - " cmpw %0,%3\n" /* compare operands */ - " bne- exit_%=\n" /* skip if not equal */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ - "exit_%=:\n" /* not equal */ + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%1\n" /* load and reserve */ + " cmpw %0,%3\n" /* compare operands */ + " bne- exit_%=\n" /* skip if not equal */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %2,0,%1\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + "exit_%=:\n" /* not equal */ : "=&r" (prev) : "b" (mem), "r" (with), "r" (cmp) : "cc", "memory"); @@ -130,11 +130,11 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint { apr_uint32_t prev; - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%1\n" /* load and reserve */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=" /* loop if lost */ + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%1\n" /* load and reserve */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %2,0,%1\n" /* store new value */ + " bne- loop_%=" /* loop if lost */ : "=&r" (prev) : "b" (mem), "r" (val) : "cc", "memory"); @@ -146,26 +146,26 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void { void *prev; #if APR_SIZEOF_VOIDP == 4 - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%1\n" /* load and reserve */ - " cmpw %0,%3\n" /* compare operands */ - " bne- exit_%=\n" /* skip if not equal */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ - "exit_%=:\n" /* not equal */ + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%1\n" /* load and reserve */ + " cmpw %0,%3\n" /* compare operands */ + " bne- exit_%=\n" /* skip if not equal */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %2,0,%1\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + "exit_%=:\n" /* not equal */ : "=&r" (prev) : "b" (mem), "r" (with), "r" (cmp) : "cc", "memory"); #elif APR_SIZEOF_VOIDP == 8 - asm volatile ("loop_%=:\n" /* lost reservation */ - " ldarx %0,0,%1\n" /* load and reserve */ - " cmpd %0,%3\n" /* compare operands */ - " bne- exit_%=\n" /* skip if not equal */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stdcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ - "exit_%=:\n" /* not equal */ + asm volatile ("loop_%=:\n" /* lost reservation */ + " ldarx %0,0,%1\n" /* load and reserve */ + " cmpd %0,%3\n" /* compare operands */ + " bne- exit_%=\n" /* skip if not equal */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stdcx. %2,0,%1\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + "exit_%=:\n" /* not equal */ : "=&r" (prev) : "b" (mem), "r" (with), "r" (cmp) : "cc", "memory"); @@ -179,22 +179,22 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) { void *prev; #if APR_SIZEOF_VOIDP == 4 - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%1\n" /* load and reserve */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ - " isync\n" /* memory barrier */ + asm volatile ("loop_%=:\n" /* lost reservation */ + " lwarx %0,0,%1\n" /* load and reserve */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %2,0,%1\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + " isync\n" /* memory barrier */ : "=&r" (prev) : "b" (mem), "r" (with) : "cc", "memory"); #elif APR_SIZEOF_VOIDP == 8 - asm volatile ("loop_%=:\n" /* lost reservation */ - " ldarx %0,0,%1\n" /* load and reserve */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stdcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ - " isync\n" /* memory barrier */ + asm volatile ("loop_%=:\n" /* lost reservation */ + " ldarx %0,0,%1\n" /* load and reserve */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stdcx. %2,0,%1\n" /* store new value */ + " bne- loop_%=\n" /* loop if lost */ + " isync\n" /* memory barrier */ : "=&r" (prev) : "b" (mem), "r" (with) : "cc", "memory"); diff --git a/atomic/unix/s390.c b/atomic/unix/s390.c index 3e2332077f4..b6b6f42de02 100644 --- a/atomic/unix/s390.c +++ b/atomic/unix/s390.c @@ -38,10 +38,10 @@ static APR_INLINE apr_uint32_t atomic_add(volatile apr_uint32_t *mem, apr_uint32 apr_uint32_t prev = *mem, temp; asm volatile ("loop_%=:\n" - " lr %1,%0\n" - " alr %1,%3\n" - " cs %0,%1,%2\n" - " jl loop_%=\n" + " lr %1,%0\n" + " alr %1,%3\n" + " cs %0,%1,%2\n" + " jl loop_%=\n" : "+d" (prev), "+d" (temp), "=Q" (*mem) : "d" (val), "m" (*mem) : "cc", "memory"); @@ -64,10 +64,10 @@ static APR_INLINE apr_uint32_t atomic_sub(volatile apr_uint32_t *mem, apr_uint32 apr_uint32_t prev = *mem, temp; asm volatile ("loop_%=:\n" - " lr %1,%0\n" - " slr %1,%3\n" - " cs %0,%1,%2\n" - " jl loop_%=\n" + " lr %1,%0\n" + " slr %1,%3\n" + " cs %0,%1,%2\n" + " jl loop_%=\n" : "+d" (prev), "+d" (temp), "=Q" (*mem) : "d" (val), "m" (*mem) : "cc", "memory"); @@ -88,7 +88,7 @@ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, apr_uint32_t cmp) { - asm volatile (" cs %0,%2,%1\n" + asm volatile (" cs %0,%2,%1\n" : "+d" (cmp), "=Q" (*mem) : "d" (with), "m" (*mem) : "cc", "memory"); @@ -101,8 +101,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint apr_uint32_t prev = *mem; asm volatile ("loop_%=:\n" - " cs %0,%2,%1\n" - " jl loop_%=\n" + " cs %0,%2,%1\n" + " jl loop_%=\n" : "+d" (prev), "=Q" (*mem) : "d" (val), "m" (*mem) : "cc", "memory"); @@ -114,12 +114,12 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void { void *prev = (void *) cmp; #if APR_SIZEOF_VOIDP == 4 - asm volatile (" cs %0,%2,%1\n" + asm volatile (" cs %0,%2,%1\n" : "+d" (prev), "=Q" (*mem) : "d" (with), "m" (*mem) : "cc", "memory"); #elif APR_SIZEOF_VOIDP == 8 - asm volatile (" csg %0,%2,%1\n" + asm volatile (" csg %0,%2,%1\n" : "+d" (prev), "=Q" (*mem) : "d" (with), "m" (*mem) : "cc", "memory"); @@ -134,15 +134,15 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) void *prev = (void *) *mem; #if APR_SIZEOF_VOIDP == 4 asm volatile ("loop_%=:\n" - " cs %0,%2,%1\n" - " jl loop_%=\n" + " cs %0,%2,%1\n" + " jl loop_%=\n" : "+d" (prev), "=Q" (*mem) : "d" (with), "m" (*mem) : "cc", "memory"); #elif APR_SIZEOF_VOIDP == 8 asm volatile ("loop_%=:\n" - " csg %0,%2,%1\n" - " jl loop_%=\n" + " csg %0,%2,%1\n" + " jl loop_%=\n" : "+d" (prev), "=Q" (*mem) : "d" (with), "m" (*mem) : "cc", "memory"); diff --git a/crypto/apr_sha1.c b/crypto/apr_sha1.c index 7eddf74fd92..4ac8b73afdb 100644 --- a/crypto/apr_sha1.c +++ b/crypto/apr_sha1.c @@ -17,7 +17,7 @@ /* * The exported function: * - * apr_sha1_base64(const char *clear, int len, char *out); + * apr_sha1_base64(const char *clear, int len, char *out); * * provides a means to SHA1 crypt/encode a plaintext password in * a way which makes password files compatible with those commonly @@ -38,10 +38,10 @@ * This software also makes use of the following component: * * NIST Secure Hash Algorithm - * heavily modified by Uwe Hollerbach uh@alumni.caltech edu - * from Peter C. Gutmann's implementation as found in - * Applied Cryptography by Bruce Schneier - * This code is hereby placed in the public domain + * heavily modified by Uwe Hollerbach uh@alumni.caltech edu + * from Peter C. Gutmann's implementation as found in + * Applied Cryptography by Bruce Schneier + * This code is hereby placed in the public domain */ #include "apr_sha1.h" @@ -60,23 +60,23 @@ #define USE_MODIFIED_SHA /* SHA f()-functions */ -#define f1(x,y,z) ((x & y) | (~x & z)) -#define f2(x,y,z) (x ^ y ^ z) -#define f3(x,y,z) ((x & y) | (x & z) | (y & z)) -#define f4(x,y,z) (x ^ y ^ z) +#define f1(x,y,z) ((x & y) | (~x & z)) +#define f2(x,y,z) (x ^ y ^ z) +#define f3(x,y,z) ((x & y) | (x & z) | (y & z)) +#define f4(x,y,z) (x ^ y ^ z) /* SHA constants */ -#define CONST1 0x5a827999L -#define CONST2 0x6ed9eba1L -#define CONST3 0x8f1bbcdcL -#define CONST4 0xca62c1d6L +#define CONST1 0x5a827999L +#define CONST2 0x6ed9eba1L +#define CONST3 0x8f1bbcdcL +#define CONST4 0xca62c1d6L /* 32-bit rotate */ -#define ROT32(x,n) ((x << n) | (x >> (32 - n))) +#define ROT32(x,n) ((x << n) | (x >> (32 - n))) -#define FUNC(n,i) \ - temp = ROT32(A,5) + f##n(B,C,D) + E + W[i] + CONST##n; \ +#define FUNC(n,i) \ + temp = ROT32(A,5) + f##n(B,C,D) + E + W[i] + CONST##n; \ E = D; D = C; C = ROT32(B,30); B = A; A = temp #define SHA_BLOCKSIZE 64 @@ -110,12 +110,12 @@ static void sha_transform(apr_sha1_ctx_t *sha_info) apr_uint32_t temp, A, B, C, D, E, W[80]; for (i = 0; i < 16; ++i) { - W[i] = sha_info->data[i]; + W[i] = sha_info->data[i]; } for (i = 16; i < 80; ++i) { - W[i] = W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16]; + W[i] = W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16]; #ifdef USE_MODIFIED_SHA - W[i] = ROT32(W[i], 1); + W[i] = ROT32(W[i], 1); #endif /* USE_MODIFIED_SHA */ } A = sha_info->digest[0]; @@ -145,16 +145,16 @@ static void sha_transform(apr_sha1_ctx_t *sha_info) FUNC(4,75); FUNC(4,76); FUNC(4,77); FUNC(4,78); FUNC(4,79); #else /* !UNROLL_LOOPS */ for (i = 0; i < 20; ++i) { - FUNC(1,i); + FUNC(1,i); } for (i = 20; i < 40; ++i) { - FUNC(2,i); + FUNC(2,i); } for (i = 40; i < 60; ++i) { - FUNC(3,i); + FUNC(3,i); } for (i = 60; i < 80; ++i) { - FUNC(4,i); + FUNC(4,i); } #endif /* !UNROLL_LOOPS */ sha_info->digest[0] += A; @@ -184,20 +184,20 @@ static void maybe_byte_reverse(apr_uint32_t *buffer, int count) int i; apr_byte_t ct[4], *cp; - if (isLittleEndian()) { /* do the swap only if it is little endian */ - count /= sizeof(apr_uint32_t); - cp = (apr_byte_t *) buffer; - for (i = 0; i < count; ++i) { - ct[0] = cp[0]; - ct[1] = cp[1]; - ct[2] = cp[2]; - ct[3] = cp[3]; - cp[0] = ct[3]; - cp[1] = ct[2]; - cp[2] = ct[1]; - cp[3] = ct[0]; - cp += sizeof(apr_uint32_t); - } + if (isLittleEndian()) { /* do the swap only if it is little endian */ + count /= sizeof(apr_uint32_t); + cp = (apr_byte_t *) buffer; + for (i = 0; i < count; ++i) { + ct[0] = cp[0]; + ct[1] = cp[1]; + ct[2] = cp[2]; + ct[3] = cp[3]; + cp[0] = ct[3]; + cp[1] = ct[2]; + cp[2] = ct[1]; + cp[3] = ct[0]; + cp += sizeof(apr_uint32_t); + } } } @@ -224,33 +224,33 @@ APR_DECLARE(void) apr_sha1_update_binary(apr_sha1_ctx_t *sha_info, unsigned int i; if ((sha_info->count_lo + ((apr_uint32_t) count << 3)) < sha_info->count_lo) { - ++sha_info->count_hi; + ++sha_info->count_hi; } sha_info->count_lo += (apr_uint32_t) count << 3; sha_info->count_hi += (apr_uint32_t) count >> 29; if (sha_info->local) { - i = SHA_BLOCKSIZE - sha_info->local; - if (i > count) { - i = count; - } - memcpy(((apr_byte_t *) sha_info->data) + sha_info->local, buffer, i); - count -= i; - buffer += i; - sha_info->local += i; - if (sha_info->local == SHA_BLOCKSIZE) { - maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); - sha_transform(sha_info); - } - else { - return; - } + i = SHA_BLOCKSIZE - sha_info->local; + if (i > count) { + i = count; + } + memcpy(((apr_byte_t *) sha_info->data) + sha_info->local, buffer, i); + count -= i; + buffer += i; + sha_info->local += i; + if (sha_info->local == SHA_BLOCKSIZE) { + maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); + sha_transform(sha_info); + } + else { + return; + } } while (count >= SHA_BLOCKSIZE) { - memcpy(sha_info->data, buffer, SHA_BLOCKSIZE); - buffer += SHA_BLOCKSIZE; - count -= SHA_BLOCKSIZE; - maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); - sha_transform(sha_info); + memcpy(sha_info->data, buffer, SHA_BLOCKSIZE); + buffer += SHA_BLOCKSIZE; + count -= SHA_BLOCKSIZE; + maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); + sha_transform(sha_info); } memcpy(sha_info->data, buffer, count); sha_info->local = count; @@ -265,39 +265,39 @@ APR_DECLARE(void) apr_sha1_update(apr_sha1_ctx_t *sha_info, const char *buf, apr_size_t inbytes_left, outbytes_left; if ((sha_info->count_lo + ((apr_uint32_t) count << 3)) < sha_info->count_lo) { - ++sha_info->count_hi; + ++sha_info->count_hi; } sha_info->count_lo += (apr_uint32_t) count << 3; sha_info->count_hi += (apr_uint32_t) count >> 29; /* Is there a remainder of the previous Update operation? */ if (sha_info->local) { - i = SHA_BLOCKSIZE - sha_info->local; - if (i > count) { - i = count; - } + i = SHA_BLOCKSIZE - sha_info->local; + if (i > count) { + i = count; + } inbytes_left = outbytes_left = i; apr_xlate_conv_buffer(ebcdic2ascii_xlate, buffer, &inbytes_left, ((apr_byte_t *) sha_info->data) + sha_info->local, &outbytes_left); - count -= i; - buffer += i; - sha_info->local += i; - if (sha_info->local == SHA_BLOCKSIZE) { - maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); - sha_transform(sha_info); - } - else { - return; - } + count -= i; + buffer += i; + sha_info->local += i; + if (sha_info->local == SHA_BLOCKSIZE) { + maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); + sha_transform(sha_info); + } + else { + return; + } } while (count >= SHA_BLOCKSIZE) { inbytes_left = outbytes_left = SHA_BLOCKSIZE; apr_xlate_conv_buffer(ebcdic2ascii_xlate, buffer, &inbytes_left, (apr_byte_t *) sha_info->data, &outbytes_left); - buffer += SHA_BLOCKSIZE; - count -= SHA_BLOCKSIZE; - maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); - sha_transform(sha_info); + buffer += SHA_BLOCKSIZE; + count -= SHA_BLOCKSIZE; + maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); + sha_transform(sha_info); } inbytes_left = outbytes_left = count; apr_xlate_conv_buffer(ebcdic2ascii_xlate, buffer, &inbytes_left, @@ -321,14 +321,14 @@ APR_DECLARE(void) apr_sha1_final(unsigned char digest[APR_SHA1_DIGESTSIZE], count = (int) ((lo_bit_count >> 3) & 0x3f); ((apr_byte_t *) sha_info->data)[count++] = 0x80; if (count > SHA_BLOCKSIZE - 8) { - memset(((apr_byte_t *) sha_info->data) + count, 0, SHA_BLOCKSIZE - count); - maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); - sha_transform(sha_info); - memset((apr_byte_t *) sha_info->data, 0, SHA_BLOCKSIZE - 8); + memset(((apr_byte_t *) sha_info->data) + count, 0, SHA_BLOCKSIZE - count); + maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); + sha_transform(sha_info); + memset((apr_byte_t *) sha_info->data, 0, SHA_BLOCKSIZE - 8); } else { - memset(((apr_byte_t *) sha_info->data) + count, 0, - SHA_BLOCKSIZE - 8 - count); + memset(((apr_byte_t *) sha_info->data) + count, 0, + SHA_BLOCKSIZE - 8 - count); } maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); sha_info->data[14] = hi_bit_count; @@ -336,11 +336,11 @@ APR_DECLARE(void) apr_sha1_final(unsigned char digest[APR_SHA1_DIGESTSIZE], sha_transform(sha_info); for (i = 0, j = 0; j < APR_SHA1_DIGESTSIZE; i++) { - k = sha_info->digest[i]; - digest[j++] = (unsigned char) ((k >> 24) & 0xff); - digest[j++] = (unsigned char) ((k >> 16) & 0xff); - digest[j++] = (unsigned char) ((k >> 8) & 0xff); - digest[j++] = (unsigned char) (k & 0xff); + k = sha_info->digest[i]; + digest[j++] = (unsigned char) ((k >> 24) & 0xff); + digest[j++] = (unsigned char) ((k >> 16) & 0xff); + digest[j++] = (unsigned char) ((k >> 8) & 0xff); + digest[j++] = (unsigned char) (k & 0xff); } } diff --git a/crypto/getuuid.c b/crypto/getuuid.c index 407598e9882..94845b024c9 100644 --- a/crypto/getuuid.c +++ b/crypto/getuuid.c @@ -68,7 +68,7 @@ static void get_random_info(unsigned char node[NODE_LENGTH]) /* Leach & Salz use Linux-specific struct sysinfo; * replace with pid/tid for portability (in the spirit of mod_unique_id) */ struct { - /* Add thread id here, if applicable, when we get to pthread or apr */ + /* Add thread id here, if applicable, when we get to pthread or apr */ pid_t pid; #ifdef NETWARE apr_uint64_t t; diff --git a/crypto/uuid.c b/crypto/uuid.c index 1d61e6f5caf..9b095920943 100644 --- a/crypto/uuid.c +++ b/crypto/uuid.c @@ -41,19 +41,19 @@ static unsigned char parse_hexpair(const char *s) result = s[0] - '0'; if (result > 48) - result = (result - 39) << 4; + result = (result - 39) << 4; else if (result > 16) - result = (result - 7) << 4; + result = (result - 7) << 4; else - result = result << 4; + result = result << 4; temp = s[1] - '0'; if (temp > 48) - result |= temp - 39; + result |= temp - 39; else if (temp > 16) - result |= temp - 7; + result |= temp - 7; else - result |= temp; + result |= temp; return (unsigned char)result; } @@ -98,15 +98,15 @@ APR_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, unsigned char *d = uuid->data; for (i = 0; i < 36; ++i) { - char c = uuid_str[i]; - if (!apr_isxdigit(c) && - !(c == '-' && (i == 8 || i == 13 || i == 18 || i == 23))) + char c = uuid_str[i]; + if (!apr_isxdigit(c) && + !(c == '-' && (i == 8 || i == 13 || i == 18 || i == 23))) /* ### need a better value */ - return APR_BADARG; + return APR_BADARG; } if (uuid_str[36] != '\0') { /* ### need a better value */ - return APR_BADARG; + return APR_BADARG; } d[0] = parse_hexpair(&uuid_str[0]); @@ -124,7 +124,7 @@ APR_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, d[9] = parse_hexpair(&uuid_str[21]); for (i = 6; i--;) - d[10 + i] = parse_hexpair(&uuid_str[i*2+24]); + d[10 + i] = parse_hexpair(&uuid_str[i*2+24]); return APR_SUCCESS; } From 5c6767812bf0cfdea2dadd804535262fe0108bab Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 22 Mar 2010 06:15:11 +0000 Subject: [PATCH 6712/7878] Some folks are ignoring the Tab prohibitions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@925966 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 6 +++--- build/jlibtool.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/aplibtool.c b/build/aplibtool.c index 8f4943c3edb..ffbdc3f7bda 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -532,9 +532,9 @@ char *shell_esc(const char *str) for (; *s; ++s) { if (*s == '"' || *s == '\\') { - *d++ = '\\'; - } - *d++ = *s; + *d++ = '\\'; + } + *d++ = *s; } *d = '\0'; diff --git a/build/jlibtool.c b/build/jlibtool.c index 9bd01d04157..1ad5a1b2756 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -1448,9 +1448,9 @@ int parse_output_file_name(char *arg, command_t *cmd_data) newarg = (char *)malloc(strlen(arg) + 5); strcpy(newarg, arg); #ifdef EXE_EXT - if (!ext) { - strcat(newarg, EXE_EXT); - } + if (!ext) { + strcat(newarg, EXE_EXT); + } #endif cmd_data->output_name = newarg; return 1; From 90eb0f45f31bfee1f7b6952e9d72709671493aba Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 30 Mar 2010 10:24:17 +0000 Subject: [PATCH 6713/7878] OS/2: Clean up some comment questions. For the record: /* XXX: No other possible types from FS3? */ No, FILESTATUS3 info can't specify any types besides regular file and directory which is why we go on to test the file handle if possible. From DosQueryHType(), values in the low byte of filetype greater than 2 are described as "reserved" by the API documentation so should never happen. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@929069 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filestat.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index cd163e41edd..6ae39eeb665 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -31,7 +31,6 @@ static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus) finfo->filetype = APR_DIR; else finfo->filetype = APR_REG; - /* XXX: No other possible types from FS3? */ finfo->user = 0; finfo->group = 0; @@ -73,8 +72,7 @@ static apr_status_t handle_type(apr_filetype_e *ftype, HFILE file) break; default: - /* Brian, is this correct??? - */ + /* Values greater than 2 are reserved, this should never happen */ *ftype = APR_UNKFILE; break; } From fb5a4c423860179ac0cf665b6bc91f5b36d47e41 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 30 Mar 2010 10:35:43 +0000 Subject: [PATCH 6714/7878] OS/2: Only mutex protect buffer access if APR_FOPEN_XTHREAD is specified. Also add missing mutex locking in apr_file_flush(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@929070 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/buffer.c | 34 ++++++++++++++++++++++------------ file_io/os2/open.c | 12 ++++++++---- file_io/os2/readwrite.c | 32 +++++++++++++++++++++++++++----- 3 files changed, 57 insertions(+), 21 deletions(-) diff --git a/file_io/os2/buffer.c b/file_io/os2/buffer.c index 34e4e639347..4fc73804b78 100644 --- a/file_io/os2/buffer.c +++ b/file_io/os2/buffer.c @@ -22,35 +22,45 @@ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, apr_size_t bufsize) { apr_status_t rv; + int do_locking = file->mutex != NULL && file->buffered; - apr_thread_mutex_lock(file->mutex); + if (do_locking) { + apr_thread_mutex_lock(file->mutex); + } - if(file->buffered) { + if (file->buffered) { /* Flush the existing buffer */ rv = apr_file_flush(file); if (rv != APR_SUCCESS) { - apr_thread_mutex_unlock(file->mutex); + if (do_locking) { + apr_thread_mutex_unlock(file->mutex); + } + return rv; } } file->buffer = buffer; file->bufsize = bufsize; - file->buffered = 1; file->bufpos = 0; file->direction = 0; file->dataRead = 0; - - if (file->bufsize == 0) { - /* Setting the buffer size to zero is equivalent to turning - * buffering off. - */ - file->buffered = 0; + + if (bufsize > 0 && file->mutex == NULL && (file->flags & APR_FOPEN_XTHREAD)) { + /* buffering is being turned on but we have no mutex, make one */ + rv = apr_thread_mutex_create(&file->mutex, 0, file->pool); } + + /* Setting the buffer size to zero is equivalent to turning + * buffering off. + */ + file->buffered = file->bufsize > 0; - apr_thread_mutex_unlock(file->mutex); + if (do_locking) { + apr_thread_mutex_unlock(file->mutex); + } - return APR_SUCCESS; + return rv; } APR_DECLARE(apr_size_t) apr_file_buffer_size_get(apr_file_t *file) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index a1a55202f4a..f8afbb1b6e9 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -36,7 +36,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr int mflags = OPEN_FLAGS_FAIL_ON_ERROR|OPEN_SHARE_DENYNONE|OPEN_FLAGS_NOINHERIT; int rv; ULONG action; - apr_file_t *dafile = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); + apr_file_t *dafile = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); dafile->pool = pool; dafile->isopen = FALSE; @@ -61,10 +61,14 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr if (dafile->buffered) { dafile->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); dafile->bufsize = APR_FILE_DEFAULT_BUFSIZE; - rv = apr_thread_mutex_create(&dafile->mutex, 0, pool); - if (rv) - return rv; + if (flag & APR_FOPEN_XTHREAD) { + rv = apr_thread_mutex_create(&dafile->mutex, 0, pool); + + if (rv) { + return rv; + } + } } if (flag & APR_FOPEN_CREATE) { diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 9c44ee0e0ae..5dc0f9ad62a 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -24,6 +24,24 @@ #include +static void file_lock(apr_file_t *thefile) +{ + if (thefile->mutex && thefile->buffered) { + apr_thread_mutex_lock(thefile->mutex); + } +} + + + +static void file_unlock(apr_file_t *thefile) +{ + if (thefile->mutex && thefile->buffered) { + apr_thread_mutex_unlock(thefile->mutex); + } +} + + + APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) { ULONG rc = 0; @@ -39,13 +57,13 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size ULONG blocksize; ULONG size = *nbytes; - apr_thread_mutex_lock(thefile->mutex); + file_lock(thefile); if (thefile->direction == 1) { int rv = apr_file_flush(thefile); if (rv != APR_SUCCESS) { - apr_thread_mutex_unlock(thefile->mutex); + file_unlock(thefile); return rv; } @@ -79,7 +97,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } *nbytes = rc == 0 ? pos - (char *)buf : 0; - apr_thread_mutex_unlock(thefile->mutex); + file_unlock(thefile); if (*nbytes == 0 && rc == 0 && thefile->eof_hit) { return APR_EOF; @@ -137,7 +155,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a int blocksize; int size = *nbytes; - apr_thread_mutex_lock(thefile->mutex); + file_lock(thefile); if ( thefile->direction == 0 ) { // Position file pointer for writing at the offset we are logically reading from @@ -160,7 +178,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a size -= blocksize; } - apr_thread_mutex_unlock(thefile->mutex); + file_unlock(thefile); return APR_FROM_OS_ERROR(rc); } else { if (thefile->flags & APR_FOPEN_APPEND) { @@ -288,11 +306,15 @@ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) int rc = 0; if (thefile->direction == 1 && thefile->bufpos) { + file_lock(thefile); + rc = DosWrite(thefile->filedes, thefile->buffer, thefile->bufpos, &written); thefile->filePtr += written; if (rc == 0) thefile->bufpos = 0; + + file_unlock(thefile); } return APR_FROM_OS_ERROR(rc); From 29ba5f049ce51e839591e09a35b3cebd4e52ebfc Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 30 Mar 2010 11:11:02 +0000 Subject: [PATCH 6715/7878] OS/2: Fix a possible uninitialised error status in apr_file_buffer_set(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@929080 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/os2/buffer.c b/file_io/os2/buffer.c index 4fc73804b78..8edc606187b 100644 --- a/file_io/os2/buffer.c +++ b/file_io/os2/buffer.c @@ -21,7 +21,7 @@ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, char * buffer, apr_size_t bufsize) { - apr_status_t rv; + apr_status_t rv = APR_SUCCESS; int do_locking = file->mutex != NULL && file->buffered; if (do_locking) { From e79f6688d77960ba791649ff47d6ebd41168113f Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 30 Mar 2010 11:16:48 +0000 Subject: [PATCH 6716/7878] OS/2: fix apr_file_putc() to use the buffer if there is one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@929081 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 5dc0f9ad62a..92191128412 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -239,20 +239,9 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile) { - ULONG rc; - ULONG byteswritten; - - if (!thefile->isopen) { - return APR_EBADF; - } + apr_size_t nbytes = 1; - rc = DosWrite(thefile->filedes, &ch, 1, &byteswritten); - - if (rc) { - return APR_FROM_OS_ERROR(rc); - } - - return APR_SUCCESS; + return apr_file_write(thefile, &ch, &nbytes); } From 3d4a69f44c98244e0edf8dd214c08315aabb876a Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 30 Mar 2010 11:18:52 +0000 Subject: [PATCH 6717/7878] OS/2: Implement apr_file_sync(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@929082 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 92191128412..e8347dff4c5 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -317,12 +317,22 @@ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) APR_DECLARE(apr_status_t) apr_file_sync(apr_file_t *thefile) { - return APR_ENOTIMPL; + apr_status_t rv; + int rc; + + rv = apr_file_flush(thefile); + + if (rv != APR_SUCCESS) { + return rv; + } + + rc = DosResetBuffer(thefile->filedes); + return APR_FROM_OS_ERROR(rc); } APR_DECLARE(apr_status_t) apr_file_datasync(apr_file_t *thefile) { - return APR_ENOTIMPL; + return apr_file_sync(thefile); } APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) From cf2632178d223eb4cdc1abe26e444af643cf8a81 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 30 Mar 2010 11:31:54 +0000 Subject: [PATCH 6718/7878] OS/2: Add ENOTIMPL stubs for apr_file_rotating_*(). Can't reasonably implement as OS/2 file systems don't allow renaming open files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@929093 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index e8347dff4c5..28e672c3993 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -407,3 +407,17 @@ apr_status_t apr_file_check_read(apr_file_t *fd) return APR_FROM_OS_ERROR(rc); } + + + +APR_DECLARE(apr_status_t) apr_file_rotating_check(apr_file_t *thefile) +{ + return APR_ENOTIMPL; +} + + + +APR_DECLARE(apr_status_t) apr_file_rotating_manual_check(apr_file_t *thefile, apr_time_t n) +{ + return APR_ENOTIMPL; +} From 303216907bd80ba4e3365ea6c5095fc4ec9d580e Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 30 Mar 2010 13:41:02 +0000 Subject: [PATCH 6719/7878] OS/2: Make apr_password_validate() thread safe. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@929134 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_md5.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/crypto/apr_md5.c b/crypto/apr_md5.c index f52bd0fd4ab..92d8728cc06 100644 --- a/crypto/apr_md5.c +++ b/crypto/apr_md5.c @@ -681,6 +681,32 @@ static void crypt_mutex_unlock(void) pthread_mutex_unlock(&crypt_mutex); } +#elif defined(OS2) + +static HMTX crypt_mutex = 0; +static void crypt_mutex_lock() +{ + if (crypt_mutex == 0) { + /* Prevent race condition where two threads could try to create the + * mutex concurrently + */ + DosEnterCritSec(); + + if (crypt_mutex == 0) { + DosCreateMutexSem(NULL, &crypt_mutex, 0, FALSE); + } + + DosExitCritSec(); + } + + DosRequestMutexSem(crypt_mutex, SEM_INDEFINITE_WAIT); +} + +static void crypt_mutex_unlock() +{ + DosReleaseMutexSem(crypt_mutex); +} + #else #error apr_password_validate() is not threadsafe. rebuild APR without thread support. From f544dea928c86ecd8ef7a221ce93bf37f659069e Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 30 Mar 2010 13:44:43 +0000 Subject: [PATCH 6720/7878] OS/2: Fix path to aplibtool for when it's used outside of APR build directory. Was being defined as ./build/aplibtool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@929135 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index bb1ac1e1ee2..ca8f8532662 100644 --- a/configure.in +++ b/configure.in @@ -196,8 +196,9 @@ case $host in *-os2*) # Use a custom-made libtool replacement echo "using aplibtool" - LIBTOOL="$srcdir/build/aplibtool" - gcc $CFLAGS $CPPFLAGS -o $LIBTOOL.exe $LIBTOOL.c + LIBTOOL="$apr_builddir/build/aplibtool" + LIBTOOL_SRC="$apr_srcdir/build/aplibtool.c" + $CC $CFLAGS $CPPFLAGS -o $LIBTOOL.exe $LIBTOOL_SRC ;; *) if test "x$LTFLAGS" = "x"; then From b6794c2c43880cea0ef0175eebcde8c6d3f7b5b9 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 30 Mar 2010 13:47:24 +0000 Subject: [PATCH 6721/7878] OS/2: Prevent pthread_sigmask() being used on OS/2 by defining SIGPROCMASK_SETS_THREAD_MASK. It also happens to be true. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@929139 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/signals.c | 1 + 1 file changed, 1 insertion(+) diff --git a/threadproc/os2/signals.c b/threadproc/os2/signals.c index e1727125ad9..cde3dedd713 100644 --- a/threadproc/os2/signals.c +++ b/threadproc/os2/signals.c @@ -1 +1,2 @@ +#define SIGPROCMASK_SETS_THREAD_MASK 1 #include "../unix/signals.c" From 0437a45994ad819152a7a32f3869e5eb944163b4 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 30 Mar 2010 13:51:15 +0000 Subject: [PATCH 6722/7878] OS/2: A few tweaks to aplibtool: - Recognise exe & dll extensions and set output type accordingly. - Ignore -release switch. - Make -module switch set the shared flag. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@929142 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/build/aplibtool.c b/build/aplibtool.c index ffbdc3f7bda..e19870360c9 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -194,6 +194,7 @@ int parse_short_opt(char *arg, cmd_data_t *cmd_data) } if (strcmp(arg, "module") == 0) { + shared = true; return 1; } @@ -221,6 +222,10 @@ int parse_short_opt(char *arg, cmd_data_t *cmd_data) return 1; } + if (strcmp(arg, "release") == 0 ) { + return 2; + } + return 0; } @@ -338,6 +343,18 @@ bool parse_output_file_name(char *arg, cmd_data_t *cmd_data) ext++; pathlen = name - arg; + if (strcmp(ext, "exe") == 0) { + cmd_data->output_type = otProgram; + cmd_data->output_name = newarg; + return false; + } + + if (strcmp(ext, "dll") == 0) { + cmd_data->output_type = otDynamicLibrary; + cmd_data->output_name = newarg; + return false; + } + if (strcmp(ext, "la") == 0) { cmd_data->stub_name = arg; cmd_data->output_type = shared ? otDynamicLibrary : otStaticLibrary; @@ -345,6 +362,10 @@ bool parse_output_file_name(char *arg, cmd_data_t *cmd_data) mkdir(".libs", 0); strcpy(newarg, ".libs/"); + if (strrchr(arg, '/')) { + arg = strrchr(arg, '/') + 1; + } + if (strncmp(arg, "lib", 3) == 0) { arg += 3; } From 05b1f364f4bd1127124db044cee2001962d1db22 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 1 Apr 2010 03:40:31 +0000 Subject: [PATCH 6723/7878] Eliminate all external dependencies upon execution of fixwin32mak.pl, to guard the resulting mak/dep files from header dependency chains that are very specific to one version. This allows apr-util, for example, to build somewhere other than relative to ../apr. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@929796 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl index b559eeccfe1..49853b34b30 100644 --- a/build/fixwin32mak.pl +++ b/build/fixwin32mak.pl @@ -135,6 +135,28 @@ sub fixcwd { print "Touched datestamp for " . $oname . " in " . $File::Find::dir . "\n"; } $oname =~ s/.mak$/.dep/; + $verchg = 0; + $srcfl = new IO::File $oname, "r" || die; + $dstfl = new IO::File $tname, "w" || die; + while ($src = <$srcfl>) { + if (($src =~ m/^\t"(\.\.\\)+(apr|apr-util|apr-iconv)\\.*"\\/) || + ($src =~ m/^\t{\$\(INCLUDE\)}".*"\\/)) { + $verchg = -1; + } + else { + print $dstfl $src; + } + } + undef $srcfl; + undef $dstfl; + if ($verchg) { + unlink $oname || die; + rename $tname, $oname || die; + print "Stripped external dependencies from " . $oname . " in " . $File::Find::dir . "\n"; + } + else { + unlink $tname || die; + } @ostat = stat($oname); if ($ostat[9] && $dstat[9] && ($ostat[9] != $dstat[9])) { @onames = ($oname); From 25011dd77c19ddea0f728d67fc17d99963af7a3e Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Fri, 2 Apr 2010 10:10:01 +0000 Subject: [PATCH 6724/7878] OS/2: Remove all remaining uses of APR_OS2_STATUS macro which has been superceded by the more general APR_FROM_OS_ERROR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930224 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 4 ---- locks/os2/thread_mutex.c | 8 ++++---- network_io/os2/os2calls.c | 4 ++-- network_io/os2/sendrecv.c | 12 ++++++------ network_io/os2/sockets.c | 14 +++++++------- network_io/os2/sockopt.c | 18 +++++++++--------- shmem/os2/shm.c | 2 +- threadproc/os2/proc.c | 4 ++-- threadproc/os2/thread.c | 2 +- threadproc/os2/threadpriv.c | 4 ++-- threadproc/unix/signals.c | 2 +- 11 files changed, 35 insertions(+), 39 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index ea750c972e7..5fbc5bbd59f 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -855,10 +855,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define apr_get_netos_error() (APR_FROM_OS_ERROR(errno)) #define apr_set_netos_error(e) (errno = APR_TO_OS_ERROR(e)) -/* And this needs to be greped away for good: - */ -#define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e)) - /* These can't sit in a private header, so in spite of the extra size, * they need to be made available here. */ diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index 5d8436be4f5..a50cb670b97 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -50,7 +50,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, if (!rc) apr_pool_cleanup_register(pool, new_mutex, thread_mutex_cleanup, apr_pool_cleanup_null); - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } @@ -58,7 +58,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { ULONG rc = DosRequestMutexSem(mutex->hMutex, SEM_INDEFINITE_WAIT); - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } @@ -66,7 +66,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { ULONG rc = DosRequestMutexSem(mutex->hMutex, SEM_IMMEDIATE_RETURN); - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } @@ -74,7 +74,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { ULONG rc = DosReleaseMutexSem(mutex->hMutex); - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } diff --git a/network_io/os2/os2calls.c b/network_io/os2/os2calls.c index 6bf1fcd02eb..c0aec855afe 100644 --- a/network_io/os2/os2calls.c +++ b/network_io/os2/os2calls.c @@ -55,7 +55,7 @@ static int os2_fn_link() rc = DosLoadModule(errorstr, sizeof(errorstr), "SO32DLL", &hSO32DLL); if (rc) - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); rc = DosQueryProcAddr(hSO32DLL, 0, "SOCKET", &apr_os2_socket); @@ -114,7 +114,7 @@ static int os2_fn_link() rc = DosQueryProcAddr(hSO32DLL, 0, "RECVFROM", &apr_os2_recvfrom); if (rc) - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } DosExitCritSec(); diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index 839ff3f8313..6cd14c69ec8 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -46,7 +46,7 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, if (err == SOCEINTR) continue; - return APR_OS2_STATUS(err); + return APR_FROM_OS_ERROR(err); } } @@ -56,7 +56,7 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, if (err) { *len = 0; - return APR_OS2_STATUS(err); + return APR_FROM_OS_ERROR(err); } (*len) = rv; @@ -86,7 +86,7 @@ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, if (err == SOCEINTR) continue; - return APR_OS2_STATUS(err); + return APR_FROM_OS_ERROR(err); } } @@ -96,7 +96,7 @@ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, if (err) { *len = 0; - return APR_OS2_STATUS(err); + return APR_FROM_OS_ERROR(err); } (*len) = rv; @@ -137,7 +137,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, if (err == SOCEINTR) continue; - return APR_OS2_STATUS(err); + return APR_FROM_OS_ERROR(err); } } @@ -147,7 +147,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, if (err) { *len = 0; - return APR_OS2_STATUS(err); + return APR_FROM_OS_ERROR(err); } *len = rv; diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 580272aa5ca..89d987603bb 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -43,7 +43,7 @@ static apr_status_t socket_cleanup(void *sock) return APR_SUCCESS; } else { - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); } } @@ -109,7 +109,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int #endif if ((*new)->socketdes < 0) { - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); } set_socket_vars(*new, family, type, oprotocol); @@ -128,7 +128,7 @@ APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, return APR_SUCCESS; } else { - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); } } @@ -144,7 +144,7 @@ APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, if (bind(sock->socketdes, (struct sockaddr *)&sa->sa, sa->salen) == -1) - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); else { sock->local_addr = sa; /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ @@ -159,7 +159,7 @@ APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); else return APR_SUCCESS; } @@ -179,7 +179,7 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, &(*new)->remote_addr->salen); if ((*new)->socketdes < 0) { - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); } *(*new)->local_addr = *sock->local_addr; @@ -202,7 +202,7 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, if ((connect(sock->socketdes, (struct sockaddr *)&sa->sa.sin, sa->salen) < 0) && (sock_errno() != SOCEINPROGRESS)) { - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); } else { int namelen = sizeof(sock->local_addr->sa.sin); diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 101a952d980..a7556dadc80 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -50,27 +50,27 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, if (opt & APR_SO_KEEPALIVE) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); } } if (opt & APR_SO_DEBUG) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); } } if (opt & APR_SO_REUSEADDR) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); } } if (opt & APR_SO_SNDBUF) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); } } if (opt & APR_SO_NONBLOCK) { if (ioctl(sock->socketdes, FIONBIO, (caddr_t)&one, sizeof(one)) == -1) { - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); } else { sock->nonblock = one; } @@ -79,12 +79,12 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, li.l_onoff = on; li.l_linger = APR_MAX_SECS_TO_LINGER; if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); } } if (opt & APR_TCP_NODELAY) { if (setsockopt(sock->socketdes, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); } } return APR_SUCCESS; @@ -115,7 +115,7 @@ APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark) int oobmark; if (ioctl(sock->socketdes, SIOCATMARK, (void*)&oobmark, sizeof(oobmark)) < 0) { - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); } *atmark = (oobmark != 0); @@ -129,7 +129,7 @@ APR_DECLARE(apr_status_t) apr_gethostname(char *buf, apr_int32_t len, { if (gethostname(buf, len) == -1) { buf[0] = '\0'; - return APR_OS2_STATUS(sock_errno()); + return APR_FROM_OS_ERROR(sock_errno()); } else if (!memchr(buf, '\0', len)) { /* buffer too small */ buf[0] = '\0'; diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c index dcdb4158709..f2c1b7dfb3c 100644 --- a/shmem/os2/shm.c +++ b/shmem/os2/shm.c @@ -49,7 +49,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, rc = DosAllocSharedMem(&(newm->memblock), name, reqsize, flags); if (rc) { - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } *m = newm; diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 96f76d69925..7047401b158 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -619,7 +619,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, return APR_CHILD_NOTDONE; } - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } @@ -640,7 +640,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, return APR_CHILD_NOTDONE; } - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 00ec4eb5cd6..a75752f77f4 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -152,7 +152,7 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *th rc = 0; /* Thread had already terminated */ *retval = thd->exitval; - return APR_OS2_STATUS(rc); + return APR_FROM_OS_ERROR(rc); } diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index 107ec10d712..c0f709c31c6 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -33,7 +33,7 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, } (*key)->pool = pool; - return APR_OS2_STATUS(DosAllocThreadLocalMemory(1, &((*key)->key))); + return APR_FROM_OS_ERROR(DosAllocThreadLocalMemory(1, &((*key)->key))); } APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key) @@ -50,7 +50,7 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) { - return APR_OS2_STATUS(DosFreeThreadLocalMemory(key->key)); + return APR_FROM_OS_ERROR(DosFreeThreadLocalMemory(key->key)); } APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 57a31af97ac..361d68acbd9 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -40,7 +40,7 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signum) * call instead */ if (signum == SIGTERM) { - return APR_OS2_STATUS(DosSendSignalException(proc->pid, + return APR_FROM_OS_ERROR(DosSendSignalException(proc->pid, XCPT_SIGNAL_BREAK)); } #endif /* OS2 */ From f8b73b2ba9f5521708dd2747dfcc78613c46ae5f Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 3 Apr 2010 10:42:53 +0000 Subject: [PATCH 6725/7878] OS/2: In apr_file_close(), only try to destroy the mutex if there is one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930503 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index f8afbb1b6e9..46be806a5e0 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -143,8 +143,10 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) } } - if (file->buffered) + if (file->mutex) { apr_thread_mutex_destroy(file->mutex); + file->mutex = NULL; + } return APR_SUCCESS; } From 1e99779d46ead2610e685172e73ec3b4cc4edbab Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 3 Apr 2010 10:45:35 +0000 Subject: [PATCH 6726/7878] OS/2: Make apr_thread_mutex_trylock() return APR_EBUSY if lock cannot be obtained instead of APR_FROM_OS_ERROR(ERROR_TIMEOUT). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930504 13f79535-47bb-0310-9956-ffa450edef68 --- locks/os2/thread_mutex.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index a50cb670b97..03ab3de4dc8 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -66,6 +66,11 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { ULONG rc = DosRequestMutexSem(mutex->hMutex, SEM_IMMEDIATE_RETURN); + + if (rc == ERROR_TIMEOUT) { + return APR_EBUSY; + } + return APR_FROM_OS_ERROR(rc); } From 910af67ca5d5e808fb3709ab59a3a71ba0ce66e1 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 3 Apr 2010 12:28:52 +0000 Subject: [PATCH 6727/7878] OS/2: Add an implementation of condition variables, derived from the Win32 implementation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930508 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/apr_arch_thread_cond.h | 5 + locks/os2/thread_cond.c | 149 ++++++++++++++++++++++-- 2 files changed, 146 insertions(+), 8 deletions(-) diff --git a/include/arch/os2/apr_arch_thread_cond.h b/include/arch/os2/apr_arch_thread_cond.h index 648b85d148b..aa0a7ca6f8e 100644 --- a/include/arch/os2/apr_arch_thread_cond.h +++ b/include/arch/os2/apr_arch_thread_cond.h @@ -22,6 +22,11 @@ struct apr_thread_cond_t { apr_pool_t *pool; + HEV semaphore; + HMTX mutex; + unsigned long num_waiting; + unsigned long num_wake; + unsigned long generation; }; #endif /* THREAD_COND_H */ diff --git a/locks/os2/thread_cond.c b/locks/os2/thread_cond.c index ec6034f55d9..97af18765d9 100644 --- a/locks/os2/thread_cond.c +++ b/locks/os2/thread_cond.c @@ -23,38 +23,171 @@ #include "apr_arch_file_io.h" #include +#ifndef DCE_POSTONE +#define DCE_POSTONE 0x0800 // Post one flag +#endif + +static apr_status_t thread_cond_cleanup(void *data) +{ + apr_thread_cond_t *cv = data; + + if (cv->semaphore) { + DosCloseEventSem(cv->semaphore); + } + + if (cv->mutex) { + DosCloseMutexSem(cv->mutex); + } + + return APR_SUCCESS; +} + + + APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, apr_pool_t *pool) { - return APR_ENOTIMPL; + int rc; + apr_thread_cond_t *cv; + + cv = apr_pcalloc(pool, sizeof(**cond)); + rc = DosCreateEventSem(NULL, &cv->semaphore, DCE_POSTONE, FALSE); + + if (rc == 0) { + rc = DosCreateMutexSem(NULL, &cv->mutex, 0, FALSE); + } + + *cond = cv; + cv->pool = pool; + apr_pool_cleanup_register(cv->pool, cv, thread_cond_cleanup, + apr_pool_cleanup_null); + + return APR_FROM_OS_ERROR(rc); +} + + + +static apr_status_t thread_cond_timedwait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex, + ULONG timeout_ms ) +{ + ULONG rc; + apr_status_t rv = APR_SUCCESS; + int wake = FALSE; + unsigned long generation; + + DosRequestMutexSem(cond->mutex, SEM_INDEFINITE_WAIT); + cond->num_waiting++; + generation = cond->generation; + DosReleaseMutexSem(cond->mutex); + + apr_thread_mutex_unlock(mutex); + + do { + rc = DosWaitEventSem(cond->semaphore, timeout_ms); + + DosRequestMutexSem(cond->mutex, SEM_INDEFINITE_WAIT); + + if (cond->num_wake) { + if (cond->generation != generation) { + cond->num_wake--; + cond->num_waiting--; + rv = APR_SUCCESS; + break; + } else { + wake = TRUE; + } + } + else if (rc != 0) { + cond->num_waiting--; + rv = APR_TIMEUP; + break; + } + + DosReleaseMutexSem(cond->mutex); + + if (wake) { + wake = FALSE; + DosPostEventSem(cond->semaphore); + } + } while (1); + + DosReleaseMutexSem(cond->mutex); + apr_thread_mutex_lock(mutex); + return rv; } + + APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + return thread_cond_timedwait(cond, mutex, SEM_INDEFINITE_WAIT); } + + APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, - apr_interval_time_t timeout){ - return APR_ENOTIMPL; + apr_interval_time_t timeout) +{ + ULONG timeout_ms = apr_time_as_msec(timeout); + return thread_cond_timedwait(cond, mutex, timeout_ms); } + + APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) { - return APR_ENOTIMPL; + int wake = FALSE; + + DosRequestMutexSem(cond->mutex, SEM_INDEFINITE_WAIT); + + if (cond->num_waiting > cond->num_wake) { + wake = TRUE; + cond->num_wake++; + cond->generation++; + } + + DosReleaseMutexSem(cond->mutex); + + if (wake) { + DosPostEventSem(cond->semaphore); + } + + return APR_SUCCESS; } + + APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) { - return APR_ENOTIMPL; + unsigned long num_wake = 0; + + DosRequestMutexSem(cond->mutex, SEM_INDEFINITE_WAIT); + + if (cond->num_waiting > cond->num_wake) { + num_wake = cond->num_waiting - cond->num_wake; + cond->num_wake = cond->num_waiting; + cond->generation++; + } + + DosReleaseMutexSem(cond->mutex); + + for (; num_wake; num_wake--) { + DosPostEventSem(cond->semaphore); + } + + return APR_SUCCESS; } + + APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) { - return APR_ENOTIMPL; + return apr_pool_cleanup_run(cond->pool, cond, thread_cond_cleanup); } -APR_POOL_IMPLEMENT_ACCESSOR(thread_cond) + +APR_POOL_IMPLEMENT_ACCESSOR(thread_cond) From 52708a0524725b2a66077aaac8a712f2943ccc10 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 3 Apr 2010 15:34:04 +0000 Subject: [PATCH 6728/7878] OS/2: Add an implementation of apr_wait_for_io_or_timeout(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930532 13f79535-47bb-0310-9956-ffa450edef68 --- support/os2/waitio.c | 71 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 support/os2/waitio.c diff --git a/support/os2/waitio.c b/support/os2/waitio.c new file mode 100644 index 00000000000..e799b2711c7 --- /dev/null +++ b/support/os2/waitio.c @@ -0,0 +1,71 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_arch_file_io.h" +#include "apr_arch_networkio.h" +#include "apr_errno.h" +#include "apr_support.h" + +static apr_status_t wait_for_file(apr_file_t *f, int for_read) +{ + int rc; + + if (!f->pipe) { + /* No support for waiting on a regular file */ + return APR_ENOTIMPL; + } + + rc = DosWaitEventSem(f->pipeSem, f->timeout >= 0 ? f->timeout / 1000 : SEM_INDEFINITE_WAIT); + + if (rc == ERROR_TIMEOUT) { + return APR_TIMEUP; + } + + return APR_FROM_OS_ERROR(rc); +} + + + +static apr_status_t wait_for_socket(apr_socket_t *s, int for_read) +{ + int pollsocket = s->socketdes; + int wait_rc = select(&pollsocket, for_read != 0, for_read == 0, 0, s->timeout / 1000); + + if (wait_rc == 0) { + return APR_TIMEUP; + } + else if (wait_rc < 0) { + return APR_FROM_OS_ERROR(sock_errno()); + } + + return APR_SUCCESS; +} + + + +apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, + int for_read) +{ + if (f) { + return wait_for_file(f, for_read); + } + else if (s) { + return wait_for_socket(s, for_read); + } + + /* Didn't specify a file or socket */ + return APR_EINVAL; +} From b66945a0229fee37fbc9d3ee19bf6c82c1941580 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sat, 3 Apr 2010 15:43:00 +0000 Subject: [PATCH 6729/7878] Add missing APR_DECLARE for apr_wait_for_io_or_timeout() declaration. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930533 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_support.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/apr_support.h b/include/apr_support.h index 79c8cb479e8..b7f112216ca 100644 --- a/include/apr_support.h +++ b/include/apr_support.h @@ -45,8 +45,9 @@ extern "C" { * otherwise wait for data to be able to be written. * @return APR_TIMEUP if we run out of time. */ -apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, - int for_read); +APR_DECLARE(apr_status_t) apr_wait_for_io_or_timeout(apr_file_t *f, + apr_socket_t *s, + int for_read); /** @} */ From f48d0fe37a18d76cc0b11ce9d1fd7562e2e02ffb Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 4 Apr 2010 12:30:08 +0000 Subject: [PATCH 6730/7878] OS/2: Fix incorrect returning of APR_EOF when a 0 length read is requested. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930671 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 28e672c3993..01536e2f487 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -46,6 +46,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size { ULONG rc = 0; ULONG bytesread; + apr_size_t req_nbytes = *nbytes; if (!thefile->isopen) { *nbytes = 0; @@ -129,7 +130,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size *nbytes = bytesread; - if (bytesread == 0) { + if (bytesread == 0 && req_nbytes > 0) { thefile->eof_hit = TRUE; return APR_EOF; } From d53cc5263df62d6016b35b1c07adf4b335ec15b7 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 4 Apr 2010 12:45:00 +0000 Subject: [PATCH 6731/7878] OS/2: Share the unix implementation of apr_file_printf() which passes the >HUGE_STRING_LEN test in testfile. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930676 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/printf.c | 1 + file_io/os2/readwrite.c | 22 -------------- file_io/unix/printf.c | 66 ++++++++++++++++++++++++++++++++++++++++ file_io/unix/readwrite.c | 47 ---------------------------- 4 files changed, 67 insertions(+), 69 deletions(-) create mode 100644 file_io/os2/printf.c create mode 100644 file_io/unix/printf.c diff --git a/file_io/os2/printf.c b/file_io/os2/printf.c new file mode 100644 index 00000000000..a77d258905d --- /dev/null +++ b/file_io/os2/printf.c @@ -0,0 +1 @@ +#include "../unix/printf.c" diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 01536e2f487..6ff2feb547a 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -372,28 +372,6 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) -APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, - const char *format, ...) -{ - int cc; - va_list ap; - char *buf; - int len; - - buf = malloc(HUGE_STRING_LEN); - if (buf == NULL) { - return 0; - } - va_start(ap, format); - len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = apr_file_puts(buf, fptr); - va_end(ap); - free(buf); - return (cc == APR_SUCCESS) ? len : -1; -} - - - apr_status_t apr_file_check_read(apr_file_t *fd) { int rc; diff --git a/file_io/unix/printf.c b/file_io/unix/printf.c new file mode 100644 index 00000000000..21a1c318e45 --- /dev/null +++ b/file_io/unix/printf.c @@ -0,0 +1,66 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_file_io.h" +#include "apr_strings.h" +#include "apr_lib.h" + +struct apr_file_printf_data { + apr_vformatter_buff_t vbuff; + apr_file_t *fptr; + char *buf; +}; + +static int file_printf_flush(apr_vformatter_buff_t *buff) +{ + struct apr_file_printf_data *data = (struct apr_file_printf_data *)buff; + + if (apr_file_write_full(data->fptr, data->buf, + data->vbuff.curpos - data->buf, NULL)) { + return -1; + } + + data->vbuff.curpos = data->buf; + return 0; +} + +APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, + const char *format, ...) +{ + struct apr_file_printf_data data; + va_list ap; + int count; + + /* don't really need a HUGE_STRING_LEN anymore */ + data.buf = malloc(HUGE_STRING_LEN); + if (data.buf == NULL) { + return -1; + } + data.vbuff.curpos = data.buf; + data.vbuff.endpos = data.buf + HUGE_STRING_LEN; + data.fptr = fptr; + va_start(ap, format); + count = apr_vformatter(file_printf_flush, + (apr_vformatter_buff_t *)&data, format, ap); + /* apr_vformatter does not call flush for the last bits */ + if (count >= 0) file_printf_flush((apr_vformatter_buff_t *)&data); + + va_end(ap); + + free(data.buf); + + return count; +} diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index f72d87bae2e..d0afd64b07c 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -562,50 +562,3 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) } return rv; } - -struct apr_file_printf_data { - apr_vformatter_buff_t vbuff; - apr_file_t *fptr; - char *buf; -}; - -static int file_printf_flush(apr_vformatter_buff_t *buff) -{ - struct apr_file_printf_data *data = (struct apr_file_printf_data *)buff; - - if (apr_file_write_full(data->fptr, data->buf, - data->vbuff.curpos - data->buf, NULL)) { - return -1; - } - - data->vbuff.curpos = data->buf; - return 0; -} - -APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, - const char *format, ...) -{ - struct apr_file_printf_data data; - va_list ap; - int count; - - /* don't really need a HUGE_STRING_LEN anymore */ - data.buf = malloc(HUGE_STRING_LEN); - if (data.buf == NULL) { - return -1; - } - data.vbuff.curpos = data.buf; - data.vbuff.endpos = data.buf + HUGE_STRING_LEN; - data.fptr = fptr; - va_start(ap, format); - count = apr_vformatter(file_printf_flush, - (apr_vformatter_buff_t *)&data, format, ap); - /* apr_vformatter does not call flush for the last bits */ - if (count >= 0) file_printf_flush((apr_vformatter_buff_t *)&data); - - va_end(ap); - - free(data.buf); - - return count; -} From 98dd5b1c8b7fda8ac115298b9770620be3c57389 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 4 Apr 2010 13:10:34 +0000 Subject: [PATCH 6732/7878] OS/2: Do a proper implementation of apr_file_ungetc(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930686 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filedup.c | 1 + file_io/os2/open.c | 2 ++ file_io/os2/pipe.c | 3 +++ file_io/os2/readwrite.c | 11 +++++++++-- include/arch/os2/apr_arch_file_io.h | 2 ++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index b1063f57ce1..810e227fbab 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -49,6 +49,7 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_po dup_file->buffered = old_file->buffered; dup_file->isopen = old_file->isopen; dup_file->flags = old_file->flags & ~APR_INHERIT; + dup_file->ungetchar = old_file->ungetchar; /* TODO - dup pipes correctly */ dup_file->pipe = old_file->pipe; diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 46be806a5e0..888988c8a1c 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -44,6 +44,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->buffer = NULL; dafile->flags = flag; dafile->blocking = BLK_ON; + dafile->ungetchar = -1; if ((flag & APR_FOPEN_READ) && (flag & APR_FOPEN_WRITE)) { mflags |= OPEN_ACCESS_READWRITE; @@ -199,6 +200,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thef (*file)->flags = flags; (*file)->pipe = FALSE; (*file)->buffered = (flags & APR_FOPEN_BUFFERED) > 0; + (*file)->ungetchar = -1; if ((*file)->buffered) { apr_status_t rv; diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 211c43cde31..d0851932ecf 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -85,6 +85,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->pipe = 1; (*in)->timeout = -1; (*in)->blocking = BLK_ON; + (*in)->ungetchar = -1; apr_pool_cleanup_register(pool, *in, apr_file_cleanup, apr_pool_cleanup_null); (*out) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); @@ -97,6 +98,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*out)->pipe = 1; (*out)->timeout = -1; (*out)->blocking = BLK_ON; + (*out)->ungetchar = -1; apr_pool_cleanup_register(pool, *out, apr_file_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; @@ -186,6 +188,7 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, (*file)->pipe = 1; (*file)->blocking = BLK_UNKNOWN; /* app needs to make a timeout call */ (*file)->timeout = -1; + (*file)->ungetchar = -1; (*file)->filedes = *thefile; if (register_cleanup) { diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 6ff2feb547a..deaf5c26203 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -53,6 +53,13 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size return APR_EBADF; } + if (thefile->ungetchar != -1 && req_nbytes >= 1) { + *(char *)buf = (char)thefile->ungetchar; + (char *)buf++; + (*nbytes)--; + thefile->ungetchar = -1; + } + if (thefile->buffered) { char *pos = (char *)buf; ULONG blocksize; @@ -249,8 +256,8 @@ APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile) APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile) { - apr_off_t offset = -1; - return apr_file_seek(thefile, APR_CUR, &offset); + thefile->ungetchar = (unsigned char)ch; + return APR_SUCCESS; } diff --git a/include/arch/os2/apr_arch_file_io.h b/include/arch/os2/apr_arch_file_io.h index a898547ab7c..16cce943f52 100644 --- a/include/arch/os2/apr_arch_file_io.h +++ b/include/arch/os2/apr_arch_file_io.h @@ -55,6 +55,8 @@ struct apr_file_t { int direction; // buffer being used for 0 = read, 1 = write unsigned long filePtr; // position in file of handle apr_thread_mutex_t *mutex;// mutex semaphore, must be owned to access the above fields + + int ungetchar; }; struct apr_dir_t { From 02e4a424098e5a39f836dc6da8cbfa0c3b7d8bc2 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 4 Apr 2010 14:37:24 +0000 Subject: [PATCH 6733/7878] OS/2: Change implementation of apr_file_writev() to just call apr_file_write() in a loop. OS/2 doesn't have a system call equivalent to writev() so the C library was just emulating it, providing no performance benefit. This also fixes a problem with the old implementation failing to handle buffered files correctly which resulted in a testfile failure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930694 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index deaf5c26203..a3cc650ed66 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -219,29 +219,21 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a -#ifdef HAVE_WRITEV - APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) { - int bytes; - - if (thefile->buffered) { - apr_status_t rv = apr_file_flush(thefile); - if (rv != APR_SUCCESS) { - return rv; - } - } - - if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { - *nbytes = 0; - return errno; - } - else { - *nbytes = bytes; - return APR_SUCCESS; - } + int c; + apr_status_t rv = APR_SUCCESS; + apr_size_t written = 0; + + for (c = 0; c < nvec && rv == APR_SUCCESS; c++) { + apr_size_t nbytes = vec[c].iov_len; + rv = apr_file_write(thefile, vec[c].iov_base, &nbytes); + written += nbytes; + } + + *nbytes = written; + return rv; } -#endif From b66919f766dccbdd96811115e7ab5112c8fdd3c7 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 4 Apr 2010 16:44:15 +0000 Subject: [PATCH 6734/7878] OS/2: Fix incorrect error code conversion in apr_file_write() for buffered files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930715 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index a3cc650ed66..f460a91e52a 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -162,6 +162,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a char *pos = (char *)buf; int blocksize; int size = *nbytes; + apr_status_t rv = APR_SUCCESS; file_lock(thefile); @@ -174,10 +175,11 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a thefile->direction = 1; } - while (rc == 0 && size > 0) { - if (thefile->bufpos == thefile->bufsize) // write buffer is full - /* XXX bug; - rc is double-transformed os->apr below */ - rc = apr_file_flush(thefile); + while (rv == APR_SUCCESS && size > 0) { + if (thefile->bufpos == thefile->bufsize) { + /* write buffer is full */ + rv = apr_file_flush(thefile); + } blocksize = size > thefile->bufsize - thefile->bufpos ? thefile->bufsize - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); @@ -187,7 +189,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } file_unlock(thefile); - return APR_FROM_OS_ERROR(rc); + return rv; } else { if (thefile->flags & APR_FOPEN_APPEND) { FILELOCK all = { 0, 0x7fffffff }; From afec2db713935193470379fe34cfaa17e042b758 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 4 Apr 2010 16:50:08 +0000 Subject: [PATCH 6735/7878] OS/2: Add missing locking in apr_file_seek() for buffered files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930716 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/seek.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index a8d13fe28b7..7afba30773b 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -27,7 +27,6 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) ULONG rc; if (thefile->direction == 1) { - /* XXX: flush here is not mutex protected */ apr_status_t rv = apr_file_flush(thefile); if (rv != APR_SUCCESS) { @@ -65,6 +64,10 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh int rc = EINVAL; apr_finfo_t finfo; + if (thefile->mutex) { + apr_thread_mutex_lock(thefile->mutex); + } + switch (where) { case APR_SET: rc = setptr(thefile, *offset); @@ -82,6 +85,11 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh } *offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + + if (thefile->mutex) { + apr_thread_mutex_unlock(thefile->mutex); + } + return rc; } else { switch (where) { From d53c59173aafb42ff7acff84a51caa18fa5a0003 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 4 Apr 2010 17:02:06 +0000 Subject: [PATCH 6736/7878] OS/2: Remove comment warnings about apr_file_flush() not being mutex protected as apr_file_flush() now does its own locking. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@930717 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filestat.c | 1 - file_io/os2/open.c | 1 - 2 files changed, 2 deletions(-) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 6ae39eeb665..8208eb4b7f3 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -92,7 +92,6 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want if (thefile->isopen) { if (thefile->buffered) { - /* XXX: flush here is not mutex protected */ apr_status_t rv = apr_file_flush(thefile); if (rv != APR_SUCCESS) { diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 888988c8a1c..38cc40e9e31 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -126,7 +126,6 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) apr_status_t status; if (file && file->isopen) { - /* XXX: flush here is not mutex protected */ status = apr_file_flush(file); rc = DosClose(file->filedes); From 00367f28ba9e20443076beed5f6c640870799c4b Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 6 Apr 2010 18:45:48 +0000 Subject: [PATCH 6737/7878] OS/2: Fix invalid parameter error in apr_file_inherit_set/unset(). DosSetFHState() only accepts a subset of flags returned by DosQueryFHState() and all others must be zero so mask out the unsupported flags. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@931265 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 38cc40e9e31..c9d32deb958 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -284,7 +284,8 @@ APR_DECLARE(apr_status_t) apr_file_inherit_set(apr_file_t *thefile) rv = DosQueryFHState(thefile->filedes, &state); if (rv == 0 && (state & OPEN_FLAGS_NOINHERIT) != 0) { - rv = DosSetFHState(thefile->filedes, state & ~OPEN_FLAGS_NOINHERIT); + state &= OPEN_FLAGS_WRITE_THROUGH|OPEN_FLAGS_FAIL_ON_ERROR|OPEN_FLAGS_NO_CACHE; + rv = DosSetFHState(thefile->filedes, state); } return APR_FROM_OS_ERROR(rv); @@ -300,6 +301,7 @@ APR_DECLARE(apr_status_t) apr_file_inherit_unset(apr_file_t *thefile) rv = DosQueryFHState(thefile->filedes, &state); if (rv == 0 && (state & OPEN_FLAGS_NOINHERIT) == 0) { + state &= OPEN_FLAGS_WRITE_THROUGH|OPEN_FLAGS_FAIL_ON_ERROR|OPEN_FLAGS_NO_CACHE; rv = DosSetFHState(thefile->filedes, state | OPEN_FLAGS_NOINHERIT); } From d3be5bde066fbad4aa09f65f43c2d9f3aa55baf5 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 6 Apr 2010 18:50:08 +0000 Subject: [PATCH 6738/7878] OS/2: Fix return value from apr_file_pipe_timeout_set() when the pipe doesn't need its blocking status changed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@931269 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/pipe.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index d0851932ecf..c6aae5c7e5d 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -145,6 +145,8 @@ APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fi APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) { + apr_status_t rv = APR_SUCCESS; + if (thepipe->pipe == 1) { thepipe->timeout = timeout; @@ -161,7 +163,11 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_int } } } - return APR_EINVAL; + else { + rv = APR_EINVAL; + } + + return rv; } From ea24d0e0d596d096020dc0b38e266b88b4c29177 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 6 Apr 2010 18:53:22 +0000 Subject: [PATCH 6739/7878] OS/2: Add support for writing to a non-blocking pipe with time out. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@931271 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/pipe.c | 19 +++++++++++++++++++ file_io/os2/readwrite.c | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index c6aae5c7e5d..4715cf44eb8 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -89,6 +89,25 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out apr_pool_cleanup_register(pool, *in, apr_file_cleanup, apr_pool_cleanup_null); (*out) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); + rc = DosCreateEventSem(NULL, &(*out)->pipeSem, DC_SEM_SHARED, FALSE); + + if (rc) { + DosClose(filedes[0]); + DosClose(filedes[1]); + DosCloseEventSem((*in)->pipeSem); + return APR_FROM_OS_ERROR(rc); + } + + rc = DosSetNPipeSem(filedes[1], (HSEM)(*out)->pipeSem, 1); + + if (rc) { + DosClose(filedes[0]); + DosClose(filedes[1]); + DosCloseEventSem((*in)->pipeSem); + DosCloseEventSem((*out)->pipeSem); + return APR_FROM_OS_ERROR(rc); + } + (*out)->pool = pool; (*out)->filedes = filedes[1]; (*out)->fname = apr_pstrdup(pool, pipename); diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index f460a91e52a..381c26b62d2 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -191,6 +191,10 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a file_unlock(thefile); return rv; } else { + if (thefile->pipe) { + DosResetEventSem(thefile->pipeSem, &rc); + } + if (thefile->flags & APR_FOPEN_APPEND) { FILELOCK all = { 0, 0x7fffffff }; ULONG newpos; @@ -207,6 +211,21 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } } else { rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten); + + if (thefile->pipe && rc == 0 && *nbytes > 0 && byteswritten == 0) { + /* Pipe is full, wait or timeout */ + int rcwait = DosWaitEventSem(thefile->pipeSem, thefile->timeout >= 0 ? thefile->timeout / 1000 : SEM_INDEFINITE_WAIT); + + if (rcwait == 0) { + rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten); + } + else if (rcwait == ERROR_TIMEOUT) { + return APR_TIMEUP; + } + else { + rc = rcwait; + } + } } if (rc) { From 368fb61fe491f178121d455c4367ba36fd264c7f Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 7 Apr 2010 12:31:46 +0000 Subject: [PATCH 6740/7878] OS/2: Add OS/2 specific handling in apr_proc_other_child_refresh(). Now passes testoc. Was resulting in APR_OC_REASON_LOST on child death. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@931521 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/otherchild.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index ea43edfb7cd..a2fef19acad 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -139,6 +139,34 @@ APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status); } +#elif defined(OS2) + int rc; + int status; + RESULTCODES proc_rc; + PID ended_pid; + + if (ocr->proc == NULL) { + return; + } + + rc = DosWaitChild(DCWA_PROCESS, DCWW_NOWAIT, &proc_rc, &ended_pid, ocr->proc->pid); + + switch (rc) { + case 0: + ocr->proc = NULL; + status = (proc_rc.codeResult << 8) | proc_rc.codeTerminate; + (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status); + break; + + case ERROR_CHILD_NOT_COMPLETE: + (*ocr->maintenance) (reason, ocr->data, -1); + break; + + default: + ocr->proc = NULL; + (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1); + break; + } #else /* ndef Win32 */ pid_t waitret; int status; From 28dad273983ad2b840ed343e8d24e75e4caeefdc Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 7 Apr 2010 13:57:34 +0000 Subject: [PATCH 6741/7878] include malloc() prototype git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@931553 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/printf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/file_io/unix/printf.c b/file_io/unix/printf.c index 21a1c318e45..03c23b22256 100644 --- a/file_io/unix/printf.c +++ b/file_io/unix/printf.c @@ -18,6 +18,10 @@ #include "apr_strings.h" #include "apr_lib.h" +#if APR_HAVE_STDLIB_H +#include +#endif + struct apr_file_printf_data { apr_vformatter_buff_t vbuff; apr_file_t *fptr; From f4c62c613b7723607b36412681ee1eee3a79a25d Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 7 Apr 2010 14:19:27 +0000 Subject: [PATCH 6742/7878] Revert addition of APR_DECLARE to apr_wait_for_io_or_timeout() (r930533) as it is not supposed to be a public function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@931565 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_support.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/apr_support.h b/include/apr_support.h index b7f112216ca..79c8cb479e8 100644 --- a/include/apr_support.h +++ b/include/apr_support.h @@ -45,9 +45,8 @@ extern "C" { * otherwise wait for data to be able to be written. * @return APR_TIMEUP if we run out of time. */ -APR_DECLARE(apr_status_t) apr_wait_for_io_or_timeout(apr_file_t *f, - apr_socket_t *s, - int for_read); +apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, + int for_read); /** @} */ From a739f84c1120992ae33fbd7cd7f3d0ab85d38462 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 7 Apr 2010 14:47:13 +0000 Subject: [PATCH 6743/7878] Fix a trunk-only problem opening dbd drivers: apr_version.h wasn't included, so APR_MAJOR_VERSION wasn't defined, so APR_STRINGIFY(APR_MAJOR_VERSION) returned "APR_MAJOR_VERSION", so we tried to open something like "apr_dbd_sqlite3-APR_MAJOR_VERSI". git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@931574 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dbd/apr_dbd.c b/dbd/apr_dbd.c index 9d273810094..7f6f26ab128 100644 --- a/dbd/apr_dbd.c +++ b/dbd/apr_dbd.c @@ -26,6 +26,7 @@ #include "apr_thread_mutex.h" #include "apr_lib.h" #include "apr_atomic.h" +#include "apr_version.h" #include "apu_internal.h" #include "apr_dbd_internal.h" From 08af68a1450a09f50dbe104de5f0bf4bc7887c6a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 8 Apr 2010 15:37:17 +0000 Subject: [PATCH 6744/7878] Add apr_hash_this_key(), apr_hash_this_key_len(), and apr_hash_this_val() for easier access to those attributes from a hash iterator. PR: 49065 Submitted by: Hyrum K. Wright Reviewed by: trawick, wrowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@931973 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_hash.h | 21 +++++++++++++++++++++ tables/apr_hash.c | 23 +++++++++++++++++++++++ test/testhash.c | 7 ++++--- 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 555dc85a6ff..4a2d60dad30 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add apr_hash_this_key(), apr_hash_this_key_len(), and + apr_hash_this_val() for easier access to those attributes from + a hash iterator. [Hyrum K. Wright ] + *) Enable platform specific support for the opening of a file or pipe in non blocking module through the APR_FOPEN_NONBLOCK flag. [Graham Leggett] diff --git a/include/apr_hash.h b/include/apr_hash.h index 8e48c7ecf15..37d972f9dd7 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -166,6 +166,27 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, apr_ssize_t *klen, void **val); +/** + * Get the current entry's key from the iteration state. + * @param hi The iteration state + * @return The pointer to the key + */ +APR_DECLARE(const void*) apr_hash_this_key(apr_hash_index_t *hi); + +/** + * Get the current entry's key length from the iteration state. + * @param hi The iteration state + * @return The key length + */ +APR_DECLARE(apr_ssize_t) apr_hash_this_key_len(apr_hash_index_t *hi); + +/** + * Get the current entry's value from the iteration state. + * @param hi The iteration state + * @return The pointer to the value + */ +APR_DECLARE(void*) apr_hash_this_val(apr_hash_index_t *hi); + /** * Get the number of key/value pairs in the hash table. * @param ht The hash table diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 05ee42f46e6..d64e77941bb 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -156,6 +156,29 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, if (val) *val = (void *)hi->this->val; } +APR_DECLARE(const void *) apr_hash_this_key(apr_hash_index_t *hi) +{ + const void *key; + + apr_hash_this(hi, &key, NULL, NULL); + return key; +} + +APR_DECLARE(apr_ssize_t) apr_hash_this_key_len(apr_hash_index_t *hi) +{ + apr_ssize_t klen; + + apr_hash_this(hi, NULL, &klen, NULL); + return klen; +} + +APR_DECLARE(void *) apr_hash_this_val(apr_hash_index_t *hi) +{ + void *val; + + apr_hash_this(hi, NULL, NULL, &val); + return val; +} /* * Expanding a hash table diff --git a/test/testhash.c b/test/testhash.c index 6e7e518d507..9b6190b9626 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -32,12 +32,13 @@ static int comp_string(const void *str1, const void *str2) static void dump_hash(apr_pool_t *p, apr_hash_t *h, char str[][MAX_LTH]) { apr_hash_index_t *hi; - char *val, *key; - apr_ssize_t len; int i = 0; for (hi = apr_hash_first(p, h); hi; hi = apr_hash_next(hi)) { - apr_hash_this(hi,(void*) &key, &len, (void*) &val); + char *key = apr_hash_this_key(hi); + apr_ssize_t len = apr_hash_this_key_len(hi); + char *val = apr_hash_this_val(hi); + str[i][0]='\0'; apr_snprintf(str[i], MAX_LTH, "%sKey %s (%" APR_SSIZE_T_FMT ") Value %s\n", str[i], key, len, val); From 9bd3ea67f5406fa265e588150a432c4b4e28a1f0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 8 Apr 2010 19:15:24 +0000 Subject: [PATCH 6745/7878] avoid uninitialized memory access in apr_filepath_merge() it was harmless other than triggering errors from tools that check memory access Submitted by: Arsen Chaloyan Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@932067 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 5fb21611238..37cc53a392c 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -949,8 +949,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } } - *newpath = apr_pmemdup(p, path, pathlen + 1); - (*newpath)[pathlen] = '\0'; + *newpath = apr_pstrmemdup(p, path, pathlen); return APR_SUCCESS; } From 6039cd0772982d84057bd0a199efa806cceba05c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 9 Apr 2010 20:34:24 +0000 Subject: [PATCH 6746/7878] fix misuse of autodata in initialization of the wakeup pipe when the pollset was created with APR_POLLSET_NOCOPY Submitted by: Neil Conway Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@932585 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_poll_private.h | 1 + poll/unix/pollset.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index 2d5c07096a3..a82c3810754 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -115,6 +115,7 @@ struct apr_pollset_t apr_uint32_t flags; /* Pipe descriptors used for wakeup */ apr_file_t *wakeup_pipe[2]; + apr_pollfd_t wakeup_pfd; apr_pollset_private_t *p; apr_pollset_provider_t *provider; }; diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index a93fa243459..06ee0da22dc 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -153,16 +153,14 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **ret_pollset, pollset->provider = provider; } if (flags & APR_POLLSET_WAKEABLE) { - apr_pollfd_t pfd; - /* Create wakeup pipe */ - if ((rv = apr_poll_create_wakeup_pipe(pollset->pool, &pfd, + if ((rv = apr_poll_create_wakeup_pipe(pollset->pool, &pollset->wakeup_pfd, pollset->wakeup_pipe)) != APR_SUCCESS) { return rv; } - if ((rv = apr_pollset_add(pollset, &pfd)) != APR_SUCCESS) { + if ((rv = apr_pollset_add(pollset, &pollset->wakeup_pfd)) != APR_SUCCESS) { return rv; } } From 0e9a7d4b147873db73b162b1a5080149b349b49c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 12 Apr 2010 15:18:09 +0000 Subject: [PATCH 6747/7878] apr_pollset_create_ex(): Trap errors from pollset providers. PR: 49094 Submitted by: Sami Tolvanen Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@933271 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollset.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index 06ee0da22dc..f8a12d235b9 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -152,6 +152,9 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **ret_pollset, } pollset->provider = provider; } + else if (rv != APR_SUCCESS) { + return rv; + } if (flags & APR_POLLSET_WAKEABLE) { /* Create wakeup pipe */ if ((rv = apr_poll_create_wakeup_pipe(pollset->pool, &pollset->wakeup_pfd, From 006ac6f21ab8ef85ecd4f6324e6e990869c170ab Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 12 Apr 2010 18:10:48 +0000 Subject: [PATCH 6748/7878] Hide apr_wait_for_io_or_timeout() from public view and add instead apr_socket_wait() and apr_file_pipe_wait(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@933338 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ file_io/os2/pipe.c | 4 +- file_io/os2/readwrite.c | 25 ++++++++++++ file_io/unix/readwrite.c | 7 ++++ include/apr_file_io.h | 10 +++++ include/apr_general.h | 3 ++ include/apr_network_io.h | 10 +++++ include/{ => private}/apr_support.h | 0 network_io/os2/sendrecv.c | 18 +++++++++ network_io/unix/sendrecv.c | 5 +++ support/os2/waitio.c | 41 +------------------- test/testpipe.c | 30 +++++++++++++++ test/testsock.c | 60 +++++++++++++++++++++++++++++ 13 files changed, 175 insertions(+), 41 deletions(-) rename include/{ => private}/apr_support.h (100%) diff --git a/CHANGES b/CHANGES index 4a2d60dad30..31b913b041c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Hide apr_wait_for_io_or_timeout() from public view and add instead + apr_socket_wait() and apr_file_pipe_wait(). [Brian Havard] + *) Add apr_hash_this_key(), apr_hash_this_key_len(), and apr_hash_this_val() for easier access to those attributes from a hash iterator. [Hyrum K. Wright ] diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 4715cf44eb8..bf0aaae05f5 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -81,7 +81,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->fname = apr_pstrdup(pool, pipename); (*in)->isopen = TRUE; (*in)->buffered = FALSE; - (*in)->flags = 0; + (*in)->flags = APR_FOPEN_READ; (*in)->pipe = 1; (*in)->timeout = -1; (*in)->blocking = BLK_ON; @@ -113,7 +113,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*out)->fname = apr_pstrdup(pool, pipename); (*out)->isopen = TRUE; (*out)->buffered = FALSE; - (*out)->flags = 0; + (*out)->flags = APR_FOPEN_WRITE; (*out)->pipe = 1; (*out)->timeout = -1; (*out)->blocking = BLK_ON; diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 381c26b62d2..6eb59fcc0b6 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -409,6 +409,31 @@ apr_status_t apr_file_check_read(apr_file_t *fd) +APR_DECLARE(apr_status_t) apr_file_pipe_wait(apr_file_t *pipe, apr_wait_type_t direction) +{ + int rc; + + if (!pipe->pipe) { + /* No support for waiting on a regular file */ + return APR_ENOTIMPL; + } + + if (((pipe->flags & APR_FOPEN_READ) > 0) != (direction == APR_WAIT_READ)) { + /* Attempt to wait for read from the write end of the pipe or vica versa */ + return APR_EINVAL; + } + + rc = DosWaitEventSem(pipe->pipeSem, pipe->timeout >= 0 ? pipe->timeout / 1000 : SEM_INDEFINITE_WAIT); + + if (rc == ERROR_TIMEOUT) { + return APR_TIMEUP; + } + + return APR_FROM_OS_ERROR(rc); +} + + + APR_DECLARE(apr_status_t) apr_file_rotating_check(apr_file_t *thefile) { return APR_ENOTIMPL; diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index d0afd64b07c..d736b5ea4f4 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -562,3 +562,10 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) } return rv; } + + + +APR_DECLARE(apr_status_t) apr_file_pipe_wait(apr_file_t *thepipe, apr_wait_type_t direction) +{ + return apr_wait_for_io_or_timeout(thepipe, NULL, direction == APR_WAIT_READ); +} diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 3740401a704..7cdb9bc263a 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -568,6 +568,16 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, */ APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile); +/** + * Wait for a pipe to be ready for input or output + * @param thepipe the pipe to wait on + * @param direction whether to wait for reading or writing to be ready + * Can be either APR_WAIT_READ or APR_WAIT_WRITE + * @remark Will time out if thepipe has a time out set for it + */ +APR_DECLARE(apr_status_t) apr_file_pipe_wait(apr_file_t *thepipe, + apr_wait_type_t direction); + /** * Flush the file's buffer. * @param thefile The file descriptor to flush diff --git a/include/apr_general.h b/include/apr_general.h index 01d2e076678..cf65945c0a1 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -67,6 +67,9 @@ extern "C" { /** signal numbers typedef */ typedef int apr_signum_t; +/* Type of I/O to wait for */ +typedef enum { APR_WAIT_READ, APR_WAIT_WRITE } apr_wait_type_t; + /** * Finding offsets of elements within structures. * Taken from the X code... they've sweated portability of this stuff diff --git a/include/apr_network_io.h b/include/apr_network_io.h index f45427c47c1..292cc586a74 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -620,6 +620,16 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len); +/** + * Wait for a socket to be ready for input or output + * @param sock the socket to wait on + * @param direction whether to wait for reading or writing to be ready + * @remark Will time out if socket has a time out set for it + * @remark direction can be either APR_WAIT_READ or APR_WAIT_WRITE + */ +APR_DECLARE(apr_status_t) apr_socket_wait(apr_socket_t *sock, + apr_wait_type_t direction); + /** * Setup socket options for the specified socket * @param sock The socket to set up. diff --git a/include/apr_support.h b/include/private/apr_support.h similarity index 100% rename from include/apr_support.h rename to include/private/apr_support.h diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index 6cd14c69ec8..4f67b3b312d 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -153,3 +153,21 @@ APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, *len = rv; return APR_SUCCESS; } + + + +APR_DECLARE(apr_status_t) apr_socket_wait(apr_socket_t *sock, apr_wait_type_t direction) +{ + int pollsocket = sock->socketdes; + int wait_rc = select(&pollsocket, direction == APR_WAIT_READ, + direction == APR_WAIT_WRITE, 0, sock->timeout / 1000); + + if (wait_rc == 0) { + return APR_TIMEUP; + } + else if (wait_rc < 0) { + return APR_FROM_OS_ERROR(sock_errno()); + } + + return APR_SUCCESS; +} diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index c133a26d9c7..b19ff5c3f94 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -235,6 +235,11 @@ apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, #endif } +apr_status_t apr_socket_wait(apr_socket_t *sock, apr_wait_type_t direction) +{ + return apr_wait_for_io_or_timeout(NULL, sock, direction == APR_WAIT_READ); +} + #if APR_HAS_SENDFILE /* TODO: Verify that all platforms handle the fd the same way, diff --git a/support/os2/waitio.c b/support/os2/waitio.c index e799b2711c7..60530e732ff 100644 --- a/support/os2/waitio.c +++ b/support/os2/waitio.c @@ -19,51 +19,14 @@ #include "apr_errno.h" #include "apr_support.h" -static apr_status_t wait_for_file(apr_file_t *f, int for_read) -{ - int rc; - - if (!f->pipe) { - /* No support for waiting on a regular file */ - return APR_ENOTIMPL; - } - - rc = DosWaitEventSem(f->pipeSem, f->timeout >= 0 ? f->timeout / 1000 : SEM_INDEFINITE_WAIT); - - if (rc == ERROR_TIMEOUT) { - return APR_TIMEUP; - } - - return APR_FROM_OS_ERROR(rc); -} - - - -static apr_status_t wait_for_socket(apr_socket_t *s, int for_read) -{ - int pollsocket = s->socketdes; - int wait_rc = select(&pollsocket, for_read != 0, for_read == 0, 0, s->timeout / 1000); - - if (wait_rc == 0) { - return APR_TIMEUP; - } - else if (wait_rc < 0) { - return APR_FROM_OS_ERROR(sock_errno()); - } - - return APR_SUCCESS; -} - - - apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, int for_read) { if (f) { - return wait_for_file(f, for_read); + return apr_file_pipe_wait(f, for_read ? APR_WAIT_READ : APR_WAIT_WRITE); } else if (s) { - return wait_for_socket(s, for_read); + return apr_socket_wait(s, for_read ? APR_WAIT_READ : APR_WAIT_WRITE); } /* Didn't specify a file or socket */ diff --git a/test/testpipe.c b/test/testpipe.c index a89d3d83151..26d9a89762d 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -186,6 +186,35 @@ static void test_pipe_writefull(abts_case *tc, void *data) ABTS_ASSERT(tc, "child terminated normally", why == APR_PROC_EXIT); } +static void wait_pipe(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_interval_time_t delay = 200000; + apr_time_t start_time; + apr_time_t end_time; + apr_size_t nbytes; + + rv = apr_file_pipe_create(&readp, &writep, p); + APR_ASSERT_SUCCESS(tc, "Couldn't create pipe", rv); + + rv = apr_file_pipe_timeout_set(readp, delay); + APR_ASSERT_SUCCESS(tc, "Couldn't set pipe timeout", rv); + + start_time = apr_time_now(); + rv = apr_file_pipe_wait(readp, APR_WAIT_READ); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + + end_time = apr_time_now(); + ABTS_ASSERT(tc, "apr_file_pipe_wait() waited for the time out", end_time - start_time >= delay); + + nbytes = 4; + rv = apr_file_write(writep, "data", &nbytes); + APR_ASSERT_SUCCESS(tc, "Couldn't write to pipe", rv); + + rv = apr_file_pipe_wait(readp, APR_WAIT_READ); + APR_ASSERT_SUCCESS(tc, "Wait for pipe failed", rv); +} + abts_suite *testpipe(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -199,6 +228,7 @@ abts_suite *testpipe(abts_suite *suite) abts_run_test(suite, read_write_notimeout, NULL); abts_run_test(suite, test_pipe_writefull, NULL); abts_run_test(suite, close_pipe, NULL); + abts_run_test(suite, wait_pipe, NULL); return suite; } diff --git a/test/testsock.c b/test/testsock.c index c95f4fc3747..ea2c885f837 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -403,6 +403,64 @@ static void test_get_addr(abts_case *tc, void *data) apr_socket_close(ld); } +static void test_wait(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_socket_t *server; + apr_socket_t *server_connection; + apr_sockaddr_t *server_addr; + apr_socket_t *client; + apr_interval_time_t delay = 200000; + apr_time_t start_time; + apr_time_t end_time; + apr_size_t nbytes; + int connected = FALSE; + + server = setup_socket(tc); + rv = apr_sockaddr_info_get(&server_addr, socket_name, socket_type, 8021, 0, p); + APR_ASSERT_SUCCESS(tc, "setting up sockaddr", rv); + + rv = apr_socket_create(&client, server_addr->family, SOCK_STREAM, 0, p); + APR_ASSERT_SUCCESS(tc, "creating client socket", rv); + + rv = apr_socket_timeout_set(client, 0); + APR_ASSERT_SUCCESS(tc, "setting client socket timeout", rv); + + rv = apr_socket_connect(client, server_addr); + + if (rv == APR_SUCCESS) { + connected = TRUE; + } + else { + ABTS_ASSERT(tc, "connecting client to server", APR_STATUS_IS_EINPROGRESS(rv)); + } + + rv = apr_socket_accept(&server_connection, server, p); + APR_ASSERT_SUCCESS(tc, "accepting client connection", rv); + + if (!connected) { + rv = apr_socket_connect(client, server_addr); + APR_ASSERT_SUCCESS(tc, "connecting client to server", rv); + } + + rv = apr_socket_timeout_set(client, delay); + APR_ASSERT_SUCCESS(tc, "setting client socket timeout", rv); + + start_time = apr_time_now(); + rv = apr_socket_wait(client, APR_WAIT_READ); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + + end_time = apr_time_now(); + ABTS_ASSERT(tc, "apr_socket_wait() waited for the time out", end_time - start_time >= delay); + + nbytes = 4; + rv = apr_socket_send(server_connection, "data", &nbytes); + APR_ASSERT_SUCCESS(tc, "Couldn't write to client", rv); + + rv = apr_socket_wait(client, APR_WAIT_READ); + APR_ASSERT_SUCCESS(tc, "Wait for socket failed", rv); +} + abts_suite *testsock(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -416,6 +474,7 @@ abts_suite *testsock(abts_suite *suite) abts_run_test(suite, test_timeout, NULL); abts_run_test(suite, test_print_addr, NULL); abts_run_test(suite, test_get_addr, NULL); + abts_run_test(suite, test_wait, NULL); #if APR_HAVE_SOCKADDR_UN socket_name = UNIX_SOCKET_NAME; socket_type = APR_UNIX; @@ -423,6 +482,7 @@ abts_suite *testsock(abts_suite *suite) abts_run_test(suite, test_send, NULL); abts_run_test(suite, test_recv, NULL); abts_run_test(suite, test_timeout, NULL); + abts_run_test(suite, test_wait, NULL); #endif return suite; } From 03bb9b581bef93fc0762cc6e32b24938f8b75f7d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 13 Apr 2010 18:29:43 +0000 Subject: [PATCH 6749/7878] fix commentary for APR_HOOK_PROBE_COMPLETE() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@933735 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hooks.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_hooks.h b/include/apr_hooks.h index 7d3a4dcaf01..a6fc0daf72e 100644 --- a/include/apr_hooks.h +++ b/include/apr_hooks.h @@ -87,7 +87,7 @@ extern "C" { */ #define APR_HOOK_PROBE_INVOKE(ud,ns,name,src) /** - * User-defined hook probe macro that is invoked before calling a + * User-defined hook probe macro that is invoked after calling a * hook function. * @param ud A void * user data field that was filled in by the user- * provided APR_HOOK_PROBE_ENTRY(). From d5f4347e4f33c9be7d4dcdd40c0b6cbec9a6c1d2 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 13 Apr 2010 20:04:42 +0000 Subject: [PATCH 6750/7878] Go back to Go. Do not collect $200. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@933770 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 ------ 1 file changed, 6 deletions(-) diff --git a/configure.in b/configure.in index ca8f8532662..7a3d8123226 100644 --- a/configure.in +++ b/configure.in @@ -1632,12 +1632,6 @@ elif test "$ac_cv_type_off_t" = "yes"; then fi # Per OS tuning... case $host in - *apple-darwin10.*) - # off_t is a long long, but long == long long - if test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_long_long"; then - off_t_fmt='#define APR_OFF_T_FMT "lld"' - fi - ;; *-mingw*) off_t_value=apr_int64_t off_t_fmt='#define APR_OFF_T_FMT "I64d"' From 9b3edb5eb661521d4772d5b952f8f5e943728f1b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 20 Apr 2010 17:31:36 +0000 Subject: [PATCH 6751/7878] comment changes only: Fix a few grammar and punctuation errors and improve consistency of style. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@936009 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 46 ++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index b2526e0b05b..436b7d256f1 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -81,28 +81,28 @@ struct apr_table_entry_t { }; /** - * Get the elements from a table + * Get the elements from a table. * @param t The table * @return An array containing the contents of the table */ APR_DECLARE(const apr_array_header_t *) apr_table_elts(const apr_table_t *t); /** - * Determine if the table is empty (either NULL or having no elements) + * Determine if the table is empty (either NULL or having no elements). * @param t The table to check * @return True if empty, False otherwise */ APR_DECLARE(int) apr_is_empty_table(const apr_table_t *t); /** - * Determine if the array is empty (either NULL or having no elements) + * Determine if the array is empty (either NULL or having no elements). * @param a The array to check * @return True if empty, False otherwise */ APR_DECLARE(int) apr_is_empty_array(const apr_array_header_t *a); /** - * Create an array + * Create an array. * @param p The pool to allocate the memory out of * @param nelts the number of elements in the initial array * @param elt_size The size of each element in the array. @@ -112,7 +112,7 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, int nelts, int elt_size); /** - * Add a new element to an array (as a first-in, last-out stack) + * Add a new element to an array (as a first-in, last-out stack). * @param arr The array to add an element to. * @return Location for the new element in the array. * @remark If there are no free spots in the array, then this function will @@ -140,7 +140,7 @@ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr); #define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary))) /** - * Remove an element from an array (as a first-in, last-out stack) + * Remove an element from an array (as a first-in, last-out stack). * @param arr The array to remove an element from. * @return Location of the element in the array. * @remark If there are no elements in the array, NULL is returned. @@ -156,7 +156,7 @@ APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr); APR_DECLARE(void) apr_array_clear(apr_array_header_t *arr); /** - * Concatenate two arrays together + * Concatenate two arrays together. * @param dst The destination array, and the one to go first in the combined * array * @param src The source array to add to the destination array @@ -165,7 +165,7 @@ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, const apr_array_header_t *src); /** - * Copy the entire array + * Copy the entire array. * @param p The pool to allocate the copy of the array out of * @param arr The array to copy * @return An exact copy of the array passed in @@ -198,7 +198,7 @@ APR_DECLARE(apr_array_header_t *) apr_array_append(apr_pool_t *p, const apr_array_header_t *second); /** - * Generates a new string from the apr_pool_t containing the concatenated + * Generate a new string from the apr_pool_t containing the concatenated * sequence of substrings referenced as elements within the array. The string * will be empty if all substrings are empty or null, or if there are no * elements in the array. If sep is non-NUL, it will be inserted between @@ -213,7 +213,7 @@ APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, const char sep); /** - * Make a new table + * Make a new table. * @param p The pool to allocate the pool out of * @param nelts The number of elements in the initial table. * @return The new table. @@ -222,7 +222,7 @@ APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts); /** - * Create a new table and copy another table into it + * Create a new table and copy another table into it. * @param p The pool to allocate the new table out of * @param t The table to copy * @return A copy of the table passed in @@ -243,14 +243,14 @@ APR_DECLARE(apr_table_t *) apr_table_clone(apr_pool_t *p, const apr_table_t *t); /** - * Delete all of the elements from a table + * Delete all of the elements from a table. * @param t The table to clear */ APR_DECLARE(void) apr_table_clear(apr_table_t *t); /** * Get the value associated with a given key from the table. After this call, - * The data is still in the table + * the data is still in the table. * @param t The table to search for the key * @param key The key to search for * @return The value associated with the key, or NULL if the key does not exist. @@ -258,8 +258,8 @@ APR_DECLARE(void) apr_table_clear(apr_table_t *t); APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); /** - * Add a key/value pair to a table, if another element already exists with the - * same key, this will over-write the old data. + * Add a key/value pair to a table. If another element already exists with the + * same key, this will overwrite the old data. * @param t The table to add the data to. * @param key The key to use * @param val The value to add @@ -270,8 +270,8 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, const char *val); /** - * Add a key/value pair to a table, if another element already exists with the - * same key, this will over-write the old data. + * Add a key/value pair to a table. If another element already exists with the + * same key, this will overwrite the old data. * @param t The table to add the data to. * @param key The key to use * @param val The value to add @@ -283,7 +283,7 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, const char *val); /** - * Remove data from the table + * Remove data from the table. * @param t The table to remove data from * @param key The key of the data being removed */ @@ -291,7 +291,7 @@ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key); /** * Add data to a table by merging the value with data that has already been - * stored + * stored. * @param t The table to search for the data * @param key The key to merge data for * @param val The data to add @@ -302,7 +302,7 @@ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, /** * Add data to a table by merging the value with data that has already been - * stored + * stored. * @param t The table to search for the data * @param key The key to merge data for * @param val The data to add @@ -331,13 +331,13 @@ APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, * @param val The value to add. * @remark When adding data, this function does not make a copy of the key or the * value, so care should be taken to ensure that the values will not - * change after they have been added.. + * change after they have been added. */ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, const char *val); /** - * Merge two tables into one new table + * Merge two tables into one new table. * @param p The pool to use for the new table * @param overlay The first table to put in the new table * @param base The table to add at the end of the new table @@ -454,7 +454,7 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, /** * Eliminate redundant entries in a table by either overwriting - * or merging duplicates + * or merging duplicates. * * @param t Table. * @param flags APR_OVERLAP_TABLES_MERGE to merge, or From 95cc874449bfe588aa04dd907ee53deb17ebcd8a Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 21 Apr 2010 14:23:25 +0000 Subject: [PATCH 6752/7878] Improve the way aplibtool handles static library dependencies by listing a libraries dependencies in the .la file and using that list when linking an executable. Before this change, it was simply accumulating the object files of any depended on libraries into the target library which is inefficient and prone to problems. With this improvement, aplibtool can be used to build more complex projects like subversion and php. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@936319 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 264 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 203 insertions(+), 61 deletions(-) diff --git a/build/aplibtool.c b/build/aplibtool.c index e19870360c9..357dbb993f7 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -46,7 +46,7 @@ enum output_type_t { otGeneral, otObject, otProgram, otStaticLibrary, otDynamicL /* OMF is the native format under OS/2 */ # define STATIC_LIB_EXT "lib" # define OBJECT_EXT "obj" -# define LIBRARIAN "emxomfar" +# define LIBRARIAN "emxomfar -p256" # else /* but the alternative, a.out, can fork() which is sometimes necessary */ # define STATIC_LIB_EXT "a" @@ -67,6 +67,8 @@ typedef struct { int num_tmp_dirs; char *obj_files[1024]; int num_obj_files; + char *dep_libs[1024]; + int num_dep_libs; } cmd_data_t; void parse_args(int argc, char *argv[], cmd_data_t *cmd_data); @@ -75,13 +77,16 @@ int parse_short_opt(char *arg, cmd_data_t *cmd_data); bool parse_input_file_name(char *arg, cmd_data_t *cmd_data); bool parse_output_file_name(char *arg, cmd_data_t *cmd_data); void post_parse_fixup(cmd_data_t *cmd_data); -bool explode_static_lib(char *lib, cmd_data_t *cmd_data); +void append_depenent_libs(cmd_data_t *cmd_data); int execute_command(cmd_data_t *cmd_data); char *shell_esc(const char *str); void cleanup_tmp_dirs(cmd_data_t *cmd_data); void generate_def_file(cmd_data_t *cmd_data); char *nameof(char *fullpath); char *truncate_dll_name(char *path); +void add_dep_lib(char *lib, cmd_data_t *cmd_data); +void add_lib_dep_libs(char *la_file, cmd_data_t *cmd_data); +void write_dep_libs(FILE *stub_handle, cmd_data_t *cmd_data); int main(int argc, char *argv[]) @@ -97,7 +102,13 @@ int main(int argc, char *argv[]) rc = execute_command(&cmd_data); if (rc == 0 && cmd_data.stub_name) { - fopen(cmd_data.stub_name, "w"); + FILE *stub_handle = fopen(cmd_data.stub_name, "w"); + + if (cmd_data.output_type == otStaticLibrary) { + write_dep_libs(stub_handle, &cmd_data); + } + + fclose(stub_handle); } cleanup_tmp_dirs(&cmd_data); @@ -141,6 +152,10 @@ void parse_args(int argc, char *argv[], cmd_data_t *cmd_data) } post_parse_fixup(cmd_data); + + if (cmd_data->output_type == otProgram || cmd_data->output_type == otDynamicLibrary) { + append_depenent_libs(cmd_data); + } } @@ -159,7 +174,7 @@ bool parse_long_opt(char *arg, cmd_data_t *cmd_data) strcpy(var, arg); } - if (strcmp(var, "silent") == 0) { + if (strcmp(var, "silent") == 0 || strcmp(var, "quiet") == 0) { silent = true; } else if (strcmp(var, "mode") == 0) { if (strcmp(value, "compile") == 0) { @@ -178,6 +193,8 @@ bool parse_long_opt(char *arg, cmd_data_t *cmd_data) shared = true; } else if (strcmp(var, "export-all") == 0) { export_all = true; + } else if (strcmp(var, "tag") == 0) { + // What's this for? Ignore for now } else { return false; } @@ -226,11 +243,59 @@ int parse_short_opt(char *arg, cmd_data_t *cmd_data) return 2; } + if (strcmp(arg, "export-symbols-regex") == 0) { + return 2; + } + return 0; } +void parse_la_input_file_name(char *arg, cmd_data_t *cmd_data) +{ + char *name = strrchr(arg, '/'); + char *ext; + char *newarg; + int pathlen; + + if (name == NULL) { + name = strrchr(arg, '\\'); + + if (name == NULL) { + name = arg; + } else { + name++; + } + } else { + name++; + } + + pathlen = name - arg; + newarg = (char *)malloc(strlen(arg) + 10); + strcpy(newarg, arg); + newarg[pathlen] = 0; + strcat(newarg, ".libs/"); + + if (strncmp(name, "lib", 3) == 0) { + name += 3; + } + + strcat(newarg, name); + ext = strrchr(newarg, '.') + 1; + + if (shared && cmd_data->mode == mInstall) { + strcpy(ext, DYNAMIC_LIB_EXT); + newarg = truncate_dll_name(newarg); + } else { + strcpy(ext, STATIC_LIB_EXT); + } + + cmd_data->arglist[cmd_data->num_args++] = newarg; +} + + + bool parse_input_file_name(char *arg, cmd_data_t *cmd_data) { char *ext = strrchr(arg, '.'); @@ -268,26 +333,8 @@ bool parse_input_file_name(char *arg, cmd_data_t *cmd_data) } if (strcmp(ext, "la") == 0) { - newarg = (char *)malloc(strlen(arg) + 10); - strcpy(newarg, arg); - newarg[pathlen] = 0; - strcat(newarg, ".libs/"); - - if (strncmp(name, "lib", 3) == 0) { - name += 3; - } - - strcat(newarg, name); - ext = strrchr(newarg, '.') + 1; - - if (shared && cmd_data->mode == mInstall) { - strcpy(ext, DYNAMIC_LIB_EXT); - newarg = truncate_dll_name(newarg); - } else { - strcpy(ext, STATIC_LIB_EXT); - } - - cmd_data->arglist[cmd_data->num_args++] = newarg; + add_lib_dep_libs(arg, cmd_data); + parse_la_input_file_name(arg, cmd_data); return true; } @@ -329,12 +376,16 @@ bool parse_output_file_name(char *arg, cmd_data_t *cmd_data) name++; } - if (!ext) { - cmd_data->stub_name = arg; + if (!ext || stricmp(ext, EXE_EXT) == 0) { cmd_data->output_type = otProgram; newarg = (char *)malloc(strlen(arg) + 5); strcpy(newarg, arg); - strcat(newarg, EXE_EXT); + + if (!ext) { + strcat(newarg, EXE_EXT); + cmd_data->stub_name = arg; + } + cmd_data->arglist[cmd_data->num_args++] = newarg; cmd_data->output_name = newarg; return true; @@ -446,6 +497,10 @@ void post_parse_fixup(cmd_data_t *cmd_data) if (strcmp(arg, "-o") == 0) { a++; } + + if (arg[1] == 'l') { + add_dep_lib(arg, cmd_data); + } } if (strcmp(arg, CC) == 0 || strcmp(arg, CC EXE_EXT) == 0) { @@ -460,7 +515,6 @@ void post_parse_fixup(cmd_data_t *cmd_data) if (strcmp(ext, STATIC_LIB_EXT) == 0) { cmd_data->arglist[a] = NULL; - explode_static_lib(arg, cmd_data); } } } @@ -484,6 +538,19 @@ void post_parse_fixup(cmd_data_t *cmd_data) } } + if (cmd_data->output_type == otProgram || cmd_data->output_type == otGeneral) { + for (a=0; a < cmd_data->num_args; a++) { + arg = cmd_data->arglist[a]; + + if (arg) { + if (strcmp(arg, "-rpath") == 0 && a+1 < cmd_data->num_args) { + cmd_data->arglist[a] = NULL; + cmd_data->arglist[a+1] = NULL; + } + } + } + } + #if USE_OMF if (cmd_data->output_type == otObject || cmd_data->output_type == otProgram || @@ -499,6 +566,25 @@ void post_parse_fixup(cmd_data_t *cmd_data) +void append_depenent_libs(cmd_data_t *cmd_data) +{ + int l; + + for (l = 0; l < cmd_data->num_dep_libs; l++) { + char *arg = cmd_data->dep_libs[l]; + char *ext = strrchr(arg, '.'); + + if (ext && strcmp(ext, ".la") == 0) { + parse_la_input_file_name(cmd_data->dep_libs[l], cmd_data); + } + else { + cmd_data->arglist[cmd_data->num_args++] = arg; + } + } +} + + + int execute_command(cmd_data_t *cmd_data) { int target = 0; @@ -564,51 +650,107 @@ char *shell_esc(const char *str) -bool explode_static_lib(char *lib, cmd_data_t *cmd_data) +void add_dep_lib(char *lib, cmd_data_t *cmd_data) { - char tmpdir[1024]; - char savewd[1024]; - char cmd[1024]; - char *name; - DIR *dir; - struct dirent *entry; + int l; - strcpy(tmpdir, lib); - strcat(tmpdir, ".exploded"); + while (isspace(*lib)) { + lib++; + } - mkdir(tmpdir, 0); - cmd_data->tmp_dirs[cmd_data->num_tmp_dirs++] = strdup(tmpdir); - getcwd(savewd, sizeof(savewd)); + if (*lib) { + for (l = 0; l < cmd_data->num_dep_libs; l++) { + if (stricmp(cmd_data->dep_libs[l], lib) == 0) { + return; + } + } + } - if (chdir(tmpdir) != 0) - return false; + if (*lib) { + cmd_data->dep_libs[cmd_data->num_dep_libs++] = strdup(lib); + } +} - strcpy(cmd, LIBRARIAN " x "); - name = strrchr(lib, '/'); - if (name) { - name++; - } else { - name = lib; + +void write_dep_libs(FILE *stub_handle, cmd_data_t *cmd_data) +{ + int l; + char cwd[MAXPATHLEN]; + + getwd(cwd); + fputs("dependency_libs='", stub_handle); + + for (l = 0; l < cmd_data->num_dep_libs; l++) { + if (l) { + fputs(" ", stub_handle); + } + + if (cmd_data->dep_libs[l][0] != '/' && cmd_data->dep_libs[l][0] != '-') { + fprintf(stub_handle, "%s/%s", cwd, cmd_data->dep_libs[l]); + } + else { + fputs(cmd_data->dep_libs[l], stub_handle); + } } - strcat(cmd, "../"); - strcat(cmd, name); - system(cmd); - chdir(savewd); - dir = opendir(tmpdir); + fputs("'\n", stub_handle); +} - while ((entry = readdir(dir)) != NULL) { - if (entry->d_name[0] != '.') { - strcpy(cmd, tmpdir); - strcat(cmd, "/"); - strcat(cmd, entry->d_name); - cmd_data->arglist[cmd_data->num_args++] = strdup(cmd); + + +void add_lib_dep_libs(char *la_file, cmd_data_t *cmd_data) +{ + FILE *hla; + char line[16384]; + + add_dep_lib(la_file, cmd_data); + hla = fopen(la_file, "r"); + + if (hla == NULL) { + fprintf(stderr, "warning: couldn't open %s\n", la_file); + return; + } + + while (fgets(line, sizeof(line), hla) != NULL) { + char *pos = strchr(line, '='); + + if (pos) { + *pos = 0; + pos++; + + if (*pos == '\'') { + char *end; + pos++; + end = strchr(pos, '\''); + + if (end != NULL) { + *end = 0; + } + } + + if (strcmp(line, "dependency_libs") == 0) { + while (*pos) { + char *end = strchr(pos, ' '); + + if (end != NULL) { + *end = 0; + } + + add_dep_lib(pos, cmd_data); + + if (end) { + pos = end + 1; + } + else { + break; + } + } + } } } - closedir(dir); - return true; + fclose(hla); } From 99f15c8d2dedb41991236847cd89899f553c6f2b Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 21 Apr 2010 14:29:02 +0000 Subject: [PATCH 6753/7878] OS/2: Make APR_STATUS_IS_EDSOOPEN() and APR_STATUS_IS_ESYMNOTFOUND() work correctly on OS/2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@936322 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/apr_errno.h b/include/apr_errno.h index 5fbc5bbd59f..b54dbe891db 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -397,6 +397,9 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #if defined(WIN32) #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN \ || APR_TO_OS_ERROR(s) == ERROR_MOD_NOT_FOUND) +#elif defined(OS2) +#define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN \ + || APR_TO_OS_ERROR(s) == ERROR_FILE_NOT_FOUND) #else #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN) #endif @@ -418,6 +421,9 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #if defined(WIN32) #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND \ || APR_TO_OS_ERROR(s) == ERROR_PROC_NOT_FOUND) +#elif defined(OS2) +#define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND \ + || APR_TO_OS_ERROR(s) == ERROR_INVALID_NAME) #else #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND) #endif From 7c5edd1ace33bdfbfc12a0f7e91b146d5f1a9bf7 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 21 Apr 2010 14:30:46 +0000 Subject: [PATCH 6754/7878] OS/2: Clean up a thread's pool when it terminates. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@936323 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/thread.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index a75752f77f4..e2cf3f6a80d 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -70,6 +70,7 @@ static void apr_thread_begin(void *arg) { apr_thread_t *thread = (apr_thread_t *)arg; thread->exitval = thread->func(thread, thread->data); + apr_pool_destroy(thread->pool); } @@ -132,6 +133,7 @@ APR_DECLARE(apr_os_thread_t) apr_os_thread_current() APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) { thd->exitval = retval; + apr_pool_destroy(thd->pool); _endthread(); return -1; /* If we get here something's wrong */ } From 7431e9c6852a06316b8161efdf17e44558f50340 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 26 Apr 2010 17:25:16 +0000 Subject: [PATCH 6755/7878] Support Berkeley DB 5.0. PR: 49179 Submitted by: Bernhard Rosenkraenzer
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@938132 13f79535-47bb-0310-9956-ffa450edef68 --- dbm/apr_dbm_berkeleydb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dbm/apr_dbm_berkeleydb.c b/dbm/apr_dbm_berkeleydb.c index 838e373bdae..37e36bd22e0 100644 --- a/dbm/apr_dbm_berkeleydb.c +++ b/dbm/apr_dbm_berkeleydb.c @@ -37,13 +37,13 @@ * DB_185, DB2, DB3, and DB4. */ -#if defined(DB_VERSION_MAJOR) && (DB_VERSION_MAJOR == 4) +#if defined(DB_VERSION_MAJOR) && (DB_VERSION_MAJOR >= 4) /* We will treat anything greater than 4.1 as DB4. * We can treat 4.0 as DB3. */ -#if defined(DB_VERSION_MINOR) && (DB_VERSION_MINOR >= 1) +#if DB_VERSION_MAJOR > 4 || (defined(DB_VERSION_MINOR) && (DB_VERSION_MINOR >= 1)) #define DB_VER 4 -#else +#elif DB_VERSION_MAJOR == 4 #define DB_VER 3 #endif #elif defined(DB_VERSION_MAJOR) && (DB_VERSION_MAJOR == 3) From 248115b55b796add0510d12508fcac0737496f5b Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 29 Apr 2010 22:52:42 +0000 Subject: [PATCH 6756/7878] explicitly check for ifaddrs.h before using it. the compile of multicast.c was failing on z/OS 1.10 because configure found some getifaddrs() function somewhere, but there is no ifaddrs.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@939506 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 ++ include/apr.h.in | 1 + network_io/unix/multicast.c | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 7a3d8123226..626c9f0f68b 100644 --- a/configure.in +++ b/configure.in @@ -1226,6 +1226,7 @@ APR_FLAG_HEADERS( fcntl.h \ grp.h \ io.h \ + ifaddrs.h \ limits.h \ mach-o/dyld.h \ malloc.h \ @@ -1307,6 +1308,7 @@ AC_SUBST(errnoh) AC_SUBST(direnth) AC_SUBST(fcntlh) AC_SUBST(ioh) +AC_SUBST(ifaddrsh) AC_SUBST(limitsh) AC_SUBST(mswsockh) AC_SUBST(netdbh) diff --git a/include/apr.h.in b/include/apr.h.in index a4149e150f8..621785cec41 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -77,6 +77,7 @@ #define APR_HAVE_ERRNO_H @errnoh@ #define APR_HAVE_FCNTL_H @fcntlh@ #define APR_HAVE_IO_H @ioh@ +#define APR_HAVE_IFADDRS_H @ifaddrsh@ #define APR_HAVE_LIMITS_H @limitsh@ #define APR_HAVE_MSWSOCK_H @mswsockh@ #define APR_HAVE_NETDB_H @netdbh@ diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index e0cb6ef39e1..7b4978995cc 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -23,8 +23,10 @@ #ifdef HAVE_GETIFADDRS #include +#if APR_HAVE_IFADDRS_H #include #endif +#endif #ifdef HAVE_STRUCT_IPMREQ static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast, @@ -45,7 +47,7 @@ static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast, static unsigned int find_if_index(const apr_sockaddr_t *iface) { unsigned int index = 0; -#if defined(HAVE_GETIFADDRS) && APR_HAVE_IPV6 +#if defined(HAVE_GETIFADDRS) && APR_HAVE_IFADDRS_H && APR_HAVE_IPV6 struct ifaddrs *ifp, *ifs; /** From 5527c951794a48f72393b012cbb499f9aaf83f53 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 30 Apr 2010 00:52:22 +0000 Subject: [PATCH 6757/7878] restore alphabetic order, no functional change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@939530 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- include/apr.h.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 626c9f0f68b..d2f534809d9 100644 --- a/configure.in +++ b/configure.in @@ -1225,8 +1225,8 @@ APR_FLAG_HEADERS( errno.h \ fcntl.h \ grp.h \ - io.h \ ifaddrs.h \ + io.h \ limits.h \ mach-o/dyld.h \ malloc.h \ diff --git a/include/apr.h.in b/include/apr.h.in index 621785cec41..78c1a9f6adb 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -76,8 +76,8 @@ #define APR_HAVE_DIRENT_H @direnth@ #define APR_HAVE_ERRNO_H @errnoh@ #define APR_HAVE_FCNTL_H @fcntlh@ -#define APR_HAVE_IO_H @ioh@ #define APR_HAVE_IFADDRS_H @ifaddrsh@ +#define APR_HAVE_IO_H @ioh@ #define APR_HAVE_LIMITS_H @limitsh@ #define APR_HAVE_MSWSOCK_H @mswsockh@ #define APR_HAVE_NETDB_H @netdbh@ From da09133cc32ba563753745b5e7117f7f8de8d12e Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 21 May 2010 20:22:39 +0000 Subject: [PATCH 6758/7878] use the OS's isascii() on EBCDIC systems git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@947160 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index 8c0fea74bd8..682deae3088 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -212,7 +212,7 @@ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, /** @see islower*/ #define apr_islower(c) (islower(((unsigned char)(c)))) /** @see isascii */ -#ifdef isascii +#if APR_CHARSET_EBCDIC || defined(isascii) #define apr_isascii(c) (isascii(((unsigned char)(c)))) #else #define apr_isascii(c) (((c) & ~0x7f)==0) From ac697b0ab91d6aa0a1c51b4f49243a06672c3770 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 24 May 2010 16:56:07 +0000 Subject: [PATCH 6759/7878] axe ancient notes about ancient FreeBSD threading Submitted by: pgollucci git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@947713 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/STATUS b/STATUS index 43006c58c67..e69ba5597a4 100644 --- a/STATUS +++ b/STATUS @@ -383,20 +383,6 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: what "reasonable" should be, so be conservative, only increase this as necessary. - * Generate a good bug report to send to the FreeBSD hackers that details - the problems we have seen with threads and system calls (specifically - sendfile data is corrupted). From our analysis so far, we don't think - that this is an APR issue, but rather a FreeBSD kernel issue. Our - current solution is to just disable threads across the board on - FreeBSD. - - MsgID: <20010828091959.D17570@ebuilt.com> - Status: Fixed in -CURRENT. MFC in about a week. Continuing - testing with threads on FreeBSD. - - FreeBSD PR kern/32684: - http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/32684 - * There are some optimizations that can be done to the new apr_proc_*() functions (on UNIX). One that may reduce pointer indirection would be to make the apr_proc_mutex_unix_lock_methods_t From 72d068da4b341d8cb788fb89eb3d3c7177df0d6a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 28 May 2010 15:46:25 +0000 Subject: [PATCH 6760/7878] axe unused variables git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@949209 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/win32/mmap.c | 1 - network_io/win32/sendrecv.c | 1 - network_io/win32/sockets.c | 2 ++ 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index 134417707f8..d5d88aebd00 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -29,7 +29,6 @@ static apr_status_t mmap_cleanup(void *themmap) { apr_mmap_t *mm = themmap; apr_mmap_t *next = APR_RING_NEXT(mm,link); - apr_status_t rv = 0; /* we no longer refer to the mmaped region */ APR_RING_REMOVE(mm,link); diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 80adccdd14b..a01f0329a44 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -266,7 +266,6 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, DWORD dwFlags = 0; apr_size_t nbytes; TRANSMIT_FILE_BUFFERS tfb, *ptfb = NULL; - int ptr = 0; apr_size_t bytes_to_send; /* Bytes to send out of the file (not including headers) */ int disconnected = 0; int sendv_trailers = 0; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 88a362f71f9..62f61fe4a77 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -81,7 +81,9 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int type, int protocol, apr_pool_t *cont) { +#if APR_HAVE_IPV6 int downgrade = (family == AF_UNSPEC); +#endif if (family == AF_UNSPEC) { #if APR_HAVE_IPV6 From 7983582d5b324f04910c75192a521a3786e27524 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 May 2010 15:54:40 +0000 Subject: [PATCH 6761/7878] Solve ELF-32 builds on ia64-hpux git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@949211 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index d2f534809d9..938499625db 100644 --- a/configure.in +++ b/configure.in @@ -1260,6 +1260,7 @@ APR_FLAG_HEADERS( kernel/OS.h \ net/errno.h \ netinet/in.h \ + netinet/ip.h \ netinet/sctp.h \ netinet/sctp_uio.h \ sys/file.h \ @@ -1300,6 +1301,12 @@ else netinet_tcph=0 fi +AC_CHECK_DECL(SOL_IP, , , [ + #include + #include + #include +]) + AC_SUBST(arpa_ineth) AC_SUBST(conioh) AC_SUBST(ctypeh) @@ -1313,6 +1320,7 @@ AC_SUBST(limitsh) AC_SUBST(mswsockh) AC_SUBST(netdbh) AC_SUBST(netinet_inh) +AC_SUBST(netinet_inp) AC_SUBST(netinet_sctph) AC_SUBST(netinet_sctp_uioh) AC_SUBST(netinet_tcph) @@ -1758,9 +1766,8 @@ if test "$dsotype" = "any"; then *darwin[[0-8]]\.*) # Original Darwin, not for 9.0!: AC_CHECK_FUNC(NSLinkModule, [dsotype=dyld]);; - *-hpux[[1-9]]\.*|*-hpux1[[01]]*) - # shl is specific to hpux(?), and is suboptimal for 64 bit builds, - # and most unlikely to be the choice of 12.x developers. + hppa*-hpux[[1-9]]\.*|hppa*-hpux1[[01]]*) + # shl is specific to parisc hpux SOM binaries, not used for 64 bit AC_CHECK_LIB(dld, shl_load, [have_shl=1]) if test "$ac_cv_sizeof_voidp$have_shl" = "41"; then dsotype=shl; APR_ADDTO(LIBS,-ldld) From 8014ec74c141785415f5b1c82ab7c49418ee80ed Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 2 Jun 2010 17:20:45 +0000 Subject: [PATCH 6762/7878] Revert r949211 miscommit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@950669 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/configure.in b/configure.in index 938499625db..d2f534809d9 100644 --- a/configure.in +++ b/configure.in @@ -1260,7 +1260,6 @@ APR_FLAG_HEADERS( kernel/OS.h \ net/errno.h \ netinet/in.h \ - netinet/ip.h \ netinet/sctp.h \ netinet/sctp_uio.h \ sys/file.h \ @@ -1301,12 +1300,6 @@ else netinet_tcph=0 fi -AC_CHECK_DECL(SOL_IP, , , [ - #include - #include - #include -]) - AC_SUBST(arpa_ineth) AC_SUBST(conioh) AC_SUBST(ctypeh) @@ -1320,7 +1313,6 @@ AC_SUBST(limitsh) AC_SUBST(mswsockh) AC_SUBST(netdbh) AC_SUBST(netinet_inh) -AC_SUBST(netinet_inp) AC_SUBST(netinet_sctph) AC_SUBST(netinet_sctp_uioh) AC_SUBST(netinet_tcph) @@ -1766,8 +1758,9 @@ if test "$dsotype" = "any"; then *darwin[[0-8]]\.*) # Original Darwin, not for 9.0!: AC_CHECK_FUNC(NSLinkModule, [dsotype=dyld]);; - hppa*-hpux[[1-9]]\.*|hppa*-hpux1[[01]]*) - # shl is specific to parisc hpux SOM binaries, not used for 64 bit + *-hpux[[1-9]]\.*|*-hpux1[[01]]*) + # shl is specific to hpux(?), and is suboptimal for 64 bit builds, + # and most unlikely to be the choice of 12.x developers. AC_CHECK_LIB(dld, shl_load, [have_shl=1]) if test "$ac_cv_sizeof_voidp$have_shl" = "41"; then dsotype=shl; APR_ADDTO(LIBS,-ldld) From 3624fc6d8490d891d53535b7d3f961f1446dbd36 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 2 Jun 2010 17:21:48 +0000 Subject: [PATCH 6763/7878] Solve ELF-32 builds on ia64-hpux git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@950670 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index d2f534809d9..43c6eaae61e 100644 --- a/configure.in +++ b/configure.in @@ -1758,9 +1758,8 @@ if test "$dsotype" = "any"; then *darwin[[0-8]]\.*) # Original Darwin, not for 9.0!: AC_CHECK_FUNC(NSLinkModule, [dsotype=dyld]);; - *-hpux[[1-9]]\.*|*-hpux1[[01]]*) - # shl is specific to hpux(?), and is suboptimal for 64 bit builds, - # and most unlikely to be the choice of 12.x developers. + hppa*-hpux[[1-9]]\.*|hppa*-hpux1[[01]]*) + # shl is specific to parisc hpux SOM binaries, not used for 64 bit AC_CHECK_LIB(dld, shl_load, [have_shl=1]) if test "$ac_cv_sizeof_voidp$have_shl" = "41"; then dsotype=shl; APR_ADDTO(LIBS,-ldld) From 404986cdb0d3ba10ea605905cb2275eb04d3aead Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 5 Jun 2010 20:43:15 +0000 Subject: [PATCH 6764/7878] Add debugging traps for use-after-destroy of a brigade: * buckets/apr_brigade.c (apr_brigade_cleanup): Check brigade consistency. (apr_brigade_destroy) [APR_BUCKET_DEBUG]: Check brigade consistency before destroying it, and clear b->p, b->bucket_alloc after. * include/apr_buckets.h (APR_BRIGADE_CHECK_CONSISTENCY): assert that b->p and b->bucket_alloc are non-NULL. Suggested by: sf git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@951762 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_brigade.c | 20 ++++++++++++++++++-- include/apr_buckets.h | 7 +++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/buckets/apr_brigade.c b/buckets/apr_brigade.c index 4519f64194b..2b5893077ca 100644 --- a/buckets/apr_brigade.c +++ b/buckets/apr_brigade.c @@ -39,6 +39,8 @@ APR_DECLARE(apr_status_t) apr_brigade_cleanup(void *data) apr_bucket_brigade *b = data; apr_bucket *e; + APR_BRIGADE_CHECK_CONSISTENCY(b); + while (!APR_BRIGADE_EMPTY(b)) { e = APR_BRIGADE_FIRST(b); apr_bucket_delete(e); @@ -49,8 +51,22 @@ APR_DECLARE(apr_status_t) apr_brigade_cleanup(void *data) APR_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b) { - apr_pool_cleanup_kill(b->p, b, brigade_cleanup); - return apr_brigade_cleanup(b); +#ifndef APR_BUCKET_DEBUG + return apr_pool_cleanup_run(b->p, b, brigade_cleanup); +#else + apr_status_t rv; + + APR_BRIGADE_CHECK_CONSISTENCY(b); + + rv = apr_pool_cleanup_run(b->p, b, brigade_cleanup); + + /* Trigger consistency check failures if the brigade is + * re-used. */ + b->p = NULL; + b->bucket_alloc = NULL; + + return rv; +#endif } APR_DECLARE(apr_bucket_brigade *) apr_brigade_create(apr_pool_t *p, diff --git a/include/apr_buckets.h b/include/apr_buckets.h index c900934e771..18453ce795a 100644 --- a/include/apr_buckets.h +++ b/include/apr_buckets.h @@ -288,8 +288,11 @@ typedef apr_status_t (*apr_brigade_flush)(apr_bucket_brigade *bb, void *ctx); */ #ifdef APR_BUCKET_DEBUG -#define APR_BRIGADE_CHECK_CONSISTENCY(b) \ - APR_RING_CHECK_CONSISTENCY(&(b)->list, apr_bucket, link) +#define APR_BRIGADE_CHECK_CONSISTENCY(b) do { \ + APR_RING_CHECK_CONSISTENCY(&(b)->list, apr_bucket, link); \ + assert(b->p != NULL); \ + assert(b->bucket_alloc != NULL); \ +} while (0) #define APR_BUCKET_CHECK_CONSISTENCY(e) \ APR_RING_CHECK_ELEM_CONSISTENCY((e), apr_bucket, link) From 46066d38d80258f4ca6cf2e9500882f9bcde8b9e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 5 Jun 2010 20:47:20 +0000 Subject: [PATCH 6765/7878] * include/apr_memcache.h: Include apr_buckets.h before apr_ring.h so that APR_RING_DEBUG is defined when including the latter, if APR_BUCKET_DEBUG is defined. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@951764 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_memcache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_memcache.h b/include/apr_memcache.h index fac5cc0c68f..c930b27b726 100644 --- a/include/apr_memcache.h +++ b/include/apr_memcache.h @@ -30,8 +30,8 @@ #include "apr_time.h" #include "apr_strings.h" #include "apr_network_io.h" -#include "apr_ring.h" #include "apr_buckets.h" +#include "apr_ring.h" #include "apr_reslist.h" #include "apr_hash.h" From 221c8ab681ececf1c2bf020e995a06d531e16ae6 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 5 Jun 2010 21:21:10 +0000 Subject: [PATCH 6766/7878] * test/testhash.c (dump_hash): Fix compiler warning due to lack of const. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@951771 13f79535-47bb-0310-9956-ffa450edef68 --- test/testhash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testhash.c b/test/testhash.c index 9b6190b9626..8c1735a99cc 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -35,7 +35,7 @@ static void dump_hash(apr_pool_t *p, apr_hash_t *h, char str[][MAX_LTH]) int i = 0; for (hi = apr_hash_first(p, h); hi; hi = apr_hash_next(hi)) { - char *key = apr_hash_this_key(hi); + const char *key = apr_hash_this_key(hi); apr_ssize_t len = apr_hash_this_key_len(hi); char *val = apr_hash_this_val(hi); From 8cbeeba91f418342c0c8297e97440b5a1c528d89 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 17 Jun 2010 13:56:48 +0000 Subject: [PATCH 6767/7878] resolve permission problems encountered when building apr in the FreeBSD ports setup Submitted by: pgollucci Tweaked by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@955603 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildconf b/buildconf index 7f2aea2a1c2..74fdb0bd4cc 100755 --- a/buildconf +++ b/buildconf @@ -69,6 +69,7 @@ if test "$1" = "1"; then fi # Do we need this anymore? echo "buildconf: Using libtool.m4 at ${ltfile}." + chmod u+w build/libtool.m4 cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 fi if test "$1" = "2"; then @@ -76,7 +77,7 @@ if test "$1" = "2"; then # Wouldn't it just be better to define top_builddir?? mv build/libtool.m4 build/libtool.m4.$$ cat build/libtool.m4.$$ | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 - rm build/libtool.m4.$$ + rm -f build/libtool.m4.$$ fi # Clean up any leftovers From cb895cc51553f993a584d59f4f46f5e9cec50e2c Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 22 Jun 2010 10:56:59 +0000 Subject: [PATCH 6768/7878] OS/2: Fix incorrect value in nbytes parameter to apr_file_read() after use of apr_file_ungetc(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@956849 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 6eb59fcc0b6..4f99a4ef4b9 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -55,9 +55,9 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size if (thefile->ungetchar != -1 && req_nbytes >= 1) { *(char *)buf = (char)thefile->ungetchar; - (char *)buf++; - (*nbytes)--; thefile->ungetchar = -1; + (*nbytes) = 1; + return APR_SUCCESS; } if (thefile->buffered) { From bcdc673069cf5db8d2a6403305546e388d7c1b28 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 5 Jul 2010 19:37:01 +0000 Subject: [PATCH 6769/7878] Remove assumption that drive letters are always uppercase. * file_io/win32/filepath.c: (same_drive): new helper function (apr_filepath_merge): use helper rather than a simple comparison * test/testnames.c: (merge_lowercasedrive): do some tests with lowercase drive names Patch by: Bert Huijben git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@960665 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filepath.c | 23 ++++++++++++++++++++- test/testnames.c | 44 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 37cc53a392c..0bf5cc0ba3d 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -327,6 +327,27 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, #endif /* ndef(NETWARE) */ } +#if !defined(NETWARE) +static int same_drive(const char *path1, const char *path2) +{ + char drive1 = path1[0]; + char drive2 = path2[0]; + + if (!drive1 || !drive2 || path1[1] != ':' || path2[1] != ':') + return FALSE; + + if (drive1 == drive2) + return TRUE; + + if (drive1 >= 'a' && drive1 <= 'z') + drive1 += 'A' - 'a'; + + if (drive2 >= 'a' && drive2 <= 'z') + drive2 += 'A' - 'a'; + + return (drive1 == drive2); +} +#endif APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, const char *basepath, @@ -540,7 +561,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * use the basepath _if_ it matches this drive letter! * Otherwise we must discard the basepath. */ - if (addroot[0] == baseroot[0] && baseroot[1] == ':') { + if (same_drive(addroot, baseroot)) { #endif /* Base the result path on the basepath */ diff --git a/test/testnames.c b/test/testnames.c index ae650b190aa..7a310faffe9 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -21,6 +21,11 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_lib.h" +#include "apr_strings.h" + +#if defined(WIN32) +#include +#endif #if defined(WIN32) || defined(OS2) #define ABS_ROOT "C:/" @@ -175,6 +180,42 @@ static void merge_notabs(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "foo/baz", dstpath); } +#if defined (WIN32) +static void merge_lowercasedrive(abts_case *tc, void *data) +{ + char current_dir[1024]; + char current_dir_on_C[1024]; + char *dir_on_c; + char *testdir; + apr_status_t rv; + + /* Change the current directory on C: from something like "C:\dir" + to something like "c:\dir" to replicate the failing case. */ + ABTS_PTR_NOTNULL(tc, _getcwd(current_dir, sizeof(current_dir))); + + /* 3 stands for drive C: */ + ABTS_PTR_NOTNULL(tc, _getdcwd(3, current_dir_on_C, + sizeof(current_dir_on_C))); + + /* Use the same path, but now with a lower case driveletter */ + dir_on_c = apr_pstrdup(p, current_dir_on_C); + dir_on_c[0] = (char)tolower(dir_on_c[0]); + + chdir(dir_on_c); + + /* Now merge a drive relative path with an upper case drive letter. */ + rv = apr_filepath_merge(&testdir, NULL, "C:hi", + APR_FILEPATH_NOTRELATIVE, p); + + /* Change back to original directory for next tests */ + chdir("C:\\"); /* Switch to upper case */ + chdir(current_dir_on_C); /* Switch cwd on C: */ + chdir(current_dir); /* Switch back to original cwd */ + + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); +} +#endif + static void root_absolute(abts_case *tc, void *data) { apr_status_t rv; @@ -294,6 +335,9 @@ abts_suite *testnames(abts_suite *suite) abts_run_test(suite, merge_notabs, NULL); abts_run_test(suite, merge_notabsfail, NULL); abts_run_test(suite, merge_dotdot_dotdot_dotdot, NULL); +#if defined(WIN32) + abts_run_test(suite, merge_lowercasedrive, NULL); +#endif abts_run_test(suite, root_absolute, NULL); abts_run_test(suite, root_relative, NULL); From da999b3e52736e0f06f9ff2af7dcc8f9b6f34a13 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 5 Jul 2010 19:47:08 +0000 Subject: [PATCH 6770/7878] Only deal with the mutex when XTHREAD is enabled. This increases the performance of buffered reads/writes tremendously. * file_io/win32/readwrite.c: (apr_file_read, apr_file_write): only manipulate mutex when XTHREAD Patch By: Ivan Zhakov git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@960671 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index c93c805c57b..7041bc6b84a 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -181,12 +181,16 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size apr_size_t blocksize; apr_size_t size = *len; - apr_thread_mutex_lock(thefile->mutex); + if (thefile->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_lock(thefile->mutex); + } if (thefile->direction == 1) { rv = apr_file_flush(thefile); if (rv != APR_SUCCESS) { - apr_thread_mutex_unlock(thefile->mutex); + if (thefile->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_unlock(thefile->mutex); + } return rv; } thefile->bufpos = 0; @@ -223,7 +227,10 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size if (*len) { rv = APR_SUCCESS; } - apr_thread_mutex_unlock(thefile->mutex); + + if (thefile->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_unlock(thefile->mutex); + } } else { /* Unbuffered i/o */ apr_size_t nbytes; @@ -260,7 +267,9 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a apr_size_t blocksize; apr_size_t size = *nbytes; - apr_thread_mutex_lock(thefile->mutex); + if (thefile->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_lock(thefile->mutex); + } if (thefile->direction == 0) { // Position file pointer for writing at the offset we are logically reading from @@ -286,7 +295,9 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a size -= blocksize; } - apr_thread_mutex_unlock(thefile->mutex); + if (thefile->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_unlock(thefile->mutex); + } return rv; } else { if (!thefile->pipe) { From 3978fe46e4c5e8d8171a5053a3eb69b1e292dfc1 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Tue, 20 Jul 2010 00:08:38 +0000 Subject: [PATCH 6771/7878] Copy memory returned by dbd_mysql_get_entry PR 46421 tells us this is necessary, though it looks as if it shouldn't be. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@965687 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_mysql.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c index 7cad22d6f96..ddad6c89c93 100644 --- a/dbd/apr_dbd_mysql.c +++ b/dbd/apr_dbd_mysql.c @@ -363,6 +363,7 @@ static int dbd_mysql_get_entry(const apr_dbd_row_t *row, int n, static const char *dbd_mysql_get_entry(const apr_dbd_row_t *row, int n) { MYSQL_BIND *bind; + const char *result = NULL; if (dbd_mysql_num_cols(row->res) <= n) { return NULL; } @@ -375,13 +376,20 @@ static const char *dbd_mysql_get_entry(const apr_dbd_row_t *row, int n) return NULL; } else { - return bind->buffer; + result = bind->buffer; } } else { - return row->row[n]; + result = row->row[n]; } - return NULL; + if (result != NULL) { + /* need to copy this - PR 46421 + * Don't know why, when it apparently came from an array + * in the first place. + */ + result = apr_pstrdup(row->res->pool, result); + } + return result; } #endif From ad13b7502a809710777f716f9bb09b966aa4a84e Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 25 Jul 2010 17:36:05 +0000 Subject: [PATCH 6772/7878] Quote argument when used. Choosing the same style as in the "sed" command directly below. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@979074 13f79535-47bb-0310-9956-ffa450edef68 --- build/find_apr.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/find_apr.m4 b/build/find_apr.m4 index 88f64a7e315..925e523f81d 100644 --- a/build/find_apr.m4 +++ b/build/find_apr.m4 @@ -176,7 +176,7 @@ AC_DEFUN([APR_FIND_APR], [ fi dnl if we have not found anything yet and have bundled source, use that if test "$apr_found" = "no" && test -d "$1"; then - apr_temp_abs_srcdir="`cd $1 && pwd`" + apr_temp_abs_srcdir="`cd \"$1\" && pwd`" apr_found="reconfig" apr_bundled_major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"$1/include/apr_version.h\"`" case $apr_bundled_major in From 6d61bd00ae71a7b601c1d1396419e1d2c0066dd4 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 25 Jul 2010 17:38:56 +0000 Subject: [PATCH 6773/7878] Fix APR crypto doxygen docs (function params). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@979075 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_nss.c | 18 ++++++++---------- crypto/apr_crypto_openssl.c | 12 +++--------- include/private/apr_crypto_internal.h | 9 +++------ 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 1f677b6e68e..ce4df93a059 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -166,8 +166,7 @@ static apr_status_t crypto_init(apr_pool_t *pool, const apr_array_header_t *para /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. - * @param driver - driver to use - * @param ctx The block context to use. + * @param block The block context to use. * @return Returns APR_ENOTIMPL if not supported. */ static apr_status_t crypto_block_cleanup(apr_crypto_block_t *block) @@ -191,7 +190,6 @@ static apr_status_t crypto_block_cleanup_helper(void *data) /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. - * @param driver - driver to use * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ @@ -220,10 +218,10 @@ static apr_status_t crypto_cleanup_helper(void *data) * algorithms and other parameters will be set per context. More than * one context can be created at one time. A cleanup will be automatically * registered with the given pool to guarantee a graceful shutdown. - * @param driver - driver to use * @param pool - process pool + * @param provider - provider to use * @param params - array of key parameters - * @param context - context pointer will be written here + * @param ff - context pointer will be written here * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ @@ -284,7 +282,6 @@ static apr_status_t crypto_make(apr_pool_t *pool, const apr_crypto_driver_t *pro * operations. * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If * *key is not NULL, *key must point at a previously created structure. - * @param driver - driver to use * @param p The pool to use. * @param f The context to use. * @param pass The passphrase to use. @@ -294,6 +291,7 @@ static apr_status_t crypto_make(apr_pool_t *pool, const apr_crypto_driver_t *pro * @param type 3DES_192, AES_128, AES_192, AES_256. * @param mode Electronic Code Book / Cipher Block Chaining. * @param doPad Pad if necessary. + * @param iterations Iteration count * @param key The key returned, see note. * @param ivSize The size of the initialisation vector will be returned, based * on whether an IV is relevant for this type of crypto. @@ -517,7 +515,7 @@ static apr_status_t crypto_block_encrypt_init(apr_pool_t *p, * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. - * @param ctx The block context to use. + * @param block The block context to use. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. @@ -570,7 +568,7 @@ static apr_status_t crypto_block_encrypt(apr_crypto_block_t *block, * number of bytes returned as actually written by the * apr_crypto_block_encrypt() call. After this call, the context * is cleaned and can be reused by apr_crypto_block_encrypt_init(). - * @param ctx The block context to use. + * @param block The block context to use. * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. @@ -685,7 +683,7 @@ static apr_status_t crypto_block_decrypt_init(apr_pool_t *p, * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. - * @param ctx The block context to use. + * @param block The block context to use. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. @@ -738,7 +736,7 @@ static apr_status_t crypto_block_decrypt(apr_crypto_block_t *block, * bytes returned as actually written by the apr_evp_crypt() * call. After this call, the context is cleaned and can be * reused by apr_env_encrypt_init() or apr_env_decrypt_init(). - * @param ctx The block context to use. + * @param block The block context to use. * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 55a0c2f4782..0e60758d1c0 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -109,7 +109,6 @@ static apr_status_t crypto_init(apr_pool_t *pool, /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. - * @param driver - driver to use * @param ctx The block context to use. * @return Returns APR_ENOTIMPL if not supported. */ @@ -132,7 +131,6 @@ static apr_status_t crypto_block_cleanup_helper(void *data) { /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. - * @param driver - driver to use * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ @@ -157,10 +155,10 @@ static apr_status_t crypto_cleanup_helper(void *data) { * algorithms and other parameters will be set per context. More than * one context can be created at one time. A cleanup will be automatically * registered with the given pool to guarantee a graceful shutdown. - * @param driver - driver to use * @param pool - process pool + * @param provider - provider to use * @param params - array of key parameters - * @param context - context pointer will be written here + * @param ff - context pointer will be written here * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ @@ -219,7 +217,6 @@ static apr_status_t crypto_make(apr_pool_t *pool, const apr_crypto_driver_t *pro * operations. * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If * *key is not NULL, *key must point at a previously created structure. - * @param driver - driver to use * @param p The pool to use. * @param f The context to use. * @param pass The passphrase to use. @@ -229,6 +226,7 @@ static apr_status_t crypto_make(apr_pool_t *pool, const apr_crypto_driver_t *pro * @param type 3DES_192, AES_128, AES_192, AES_256. * @param mode Electronic Code Book / Cipher Block Chaining. * @param doPad Pad if necessary. + * @param iterations Iteration count * @param key The key returned, see note. * @param ivSize The size of the initialisation vector will be returned, based * on whether an IV is relevant for this type of crypto. @@ -335,12 +333,8 @@ static apr_status_t crypto_passphrase(apr_pool_t *p, const apr_crypto_t *f, * *ctx is not NULL, *ctx must point at a previously created structure. * @param p The pool to use. * @param f The block context to use. - * @param type 3DES_192, AES_128, AES_192, AES_256. - * @param mode Electronic Code Book / Cipher Block Chaining. * @param key The key - * @param keyLen The key length in bytes * @param iv Optional initialisation vector. - * @param doPad Pad if necessary. * @param ctx The block context returned, see note. * @param blockSize The block size of the cipher. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index db71a7fca62..ea67cb80e6f 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -37,6 +37,7 @@ struct apr_crypto_driver_t { * Called once only. * @param pool The pool to register the cleanup in. * @param params An array of optional init parameters. + * @param rc Driver-specific additional error code */ apr_status_t (*init)(apr_pool_t *pool, const apr_array_header_t *params, int *rc); @@ -45,7 +46,7 @@ struct apr_crypto_driver_t { * algorithms and other parameters will be set per context. More than * one context can be created at one time. A cleanup will be automatically * registered with the given pool to guarantee a graceful shutdown. - * @param driver - driver to use + * @param provider - provider to use * @param pool - process pool * @param params - array of key parameters * @param f - context pointer will be written here @@ -64,7 +65,6 @@ struct apr_crypto_driver_t { * operations. * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If * *key is not NULL, *key must point at a previously created structure. - * @param driver - driver to use * @param p The pool to use. * @param f The context to use. * @param pass The passphrase to use. @@ -74,6 +74,7 @@ struct apr_crypto_driver_t { * @param type 3DES_192, AES_128, AES_192, AES_256. * @param mode Electronic Code Book / Cipher Block Chaining. * @param doPad Pad if necessary. + * @param iterations Iteration count * @param key The key returned, see note. * @param ivSize The size of the initialisation vector will be returned, based * on whether an IV is relevant for this type of crypto. @@ -101,8 +102,6 @@ struct apr_crypto_driver_t { * If the buffer pointed to is not NULL, the IV in the buffer will be * used. * @param ctx The block context returned, see note. - * @param ivSize The size of the initialisation vector will be returned, based - * on whether an IV is relevant for this type of crypto. * @param blockSize The block size of the cipher. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns @@ -219,7 +218,6 @@ struct apr_crypto_driver_t { /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. - * @param driver - driver to use * @param ctx The block context to use. * @return Returns APR_ENOTIMPL if not supported. */ @@ -228,7 +226,6 @@ struct apr_crypto_driver_t { /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. - * @param driver - driver to use * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ From 137dcb96084f9237c0b05f873e1213037abbb981 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 25 Jul 2010 17:40:56 +0000 Subject: [PATCH 6774/7878] Fix order of elements in struct. Was broken by reordering in struct definition (r900089). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@979076 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_nss.c | 6 +++--- crypto/apr_crypto_openssl.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index ce4df93a059..4d3139bc9e0 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -772,12 +772,11 @@ static apr_status_t crypto_block_decrypt_finish(apr_crypto_block_t *block, } /** - * OpenSSL module. + * NSS module. */ APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_nss_driver = { "nss", crypto_init, - crypto_error, crypto_make, crypto_passphrase, crypto_block_encrypt_init, @@ -788,7 +787,8 @@ APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_nss_driver = { crypto_block_decrypt_finish, crypto_block_cleanup, crypto_cleanup, - crypto_shutdown + crypto_shutdown, + crypto_error }; #endif diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 0e60758d1c0..86e81763e30 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -650,10 +650,10 @@ static apr_status_t crypto_block_decrypt_finish(apr_crypto_block_t *ctx, * OpenSSL module. */ APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_openssl_driver = { - "openssl", crypto_init, crypto_error, crypto_make, crypto_passphrase, + "openssl", crypto_init, crypto_make, crypto_passphrase, crypto_block_encrypt_init, crypto_block_encrypt, crypto_block_encrypt_finish, crypto_block_decrypt_init, crypto_block_decrypt, crypto_block_decrypt_finish, - crypto_block_cleanup, crypto_cleanup, crypto_shutdown }; + crypto_block_cleanup, crypto_cleanup, crypto_shutdown, crypto_error }; #endif From 4d1c29854a95185c851358afd70b2b67a7a1e2d3 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 25 Jul 2010 17:43:24 +0000 Subject: [PATCH 6775/7878] Fix broken installation of apu.h. Since APU has been merged with APR, the header file apu.h is no longer dynamically generated during the build. It only contains a fixed include of apr.h. So install from source directory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@979077 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index c923ce83380..16bf72eacd8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -91,7 +91,7 @@ install: install-modules $(TARGETS) $(APR_MKDIR) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(installbuilddir) \ $(DESTDIR)$(libdir)/pkgconfig $(DESTDIR)$(includedir) $(INSTALL_DATA) $(top_blddir)/include/apr.h $(DESTDIR)$(includedir) - $(INSTALL_DATA) $(top_blddir)/include/apu.h $(DESTDIR)$(includedir) + $(INSTALL_DATA) $(top_srcdir)/include/apu.h $(DESTDIR)$(includedir) for f in $(top_srcdir)/include/apr_*.h $(top_srcdir)/include/apu_*.h; do \ $(INSTALL_DATA) $${f} $(DESTDIR)$(includedir); \ done From b0c0357cdc8eb2fcc04574beb0f2b08baf96d558 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 25 Jul 2010 17:46:38 +0000 Subject: [PATCH 6776/7878] Fix broken header file installation for VPATH build. Some header files are generated during build, e.g. apr_ldap.h and apu_want.h. Those header files need to be picked up from the build dir during installation. For a VPATH build, build dir and source dir are not the same. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@979078 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile.in b/Makefile.in index 16bf72eacd8..539d5b9112e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -95,6 +95,9 @@ install: install-modules $(TARGETS) for f in $(top_srcdir)/include/apr_*.h $(top_srcdir)/include/apu_*.h; do \ $(INSTALL_DATA) $${f} $(DESTDIR)$(includedir); \ done + for f in $(top_blddir)/include/apr_*.h $(top_blddir)/include/apu_*.h; do \ + $(INSTALL_DATA) $${f} $(DESTDIR)$(includedir); \ + done $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(TARGET_LIB) $(DESTDIR)$(libdir) $(INSTALL_DATA) apr.exp $(DESTDIR)$(libdir)/apr.exp $(INSTALL_DATA) apr.pc $(DESTDIR)$(libdir)/pkgconfig/$(APR_PCFILE) From ed89c263478e17cdcd61f9e519c6fbabb847d35f Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 25 Jul 2010 20:02:30 +0000 Subject: [PATCH 6777/7878] Update release list in STATUS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@979105 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index e69ba5597a4..47a3a9db5a8 100644 --- a/STATUS +++ b/STATUS @@ -28,7 +28,10 @@ Patches considered for backport are noted in their branches' STATUS: Releases: 2.0.0 : in development on trunk/ 1.5.0 : in development on branches/1.5.x/ - 1.4.0 : in development on branches/1.4.x/ + 1.4.3 : in development on branches/1.4.x/ + 1.4.2 : tagged January 20, 2010 + 1.4.1 : not released + 1.4.0 : not released 1.3.9 : released September 23, 2009 1.3.8 : released August 6, 2009 1.3.7 : released July 23, 2009 From 496fd9d51e8ed325a5225c600f945745c0913f8e Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 25 Jul 2010 20:41:04 +0000 Subject: [PATCH 6778/7878] Update config.guess and config.sub from http://git.savannah.gnu.org/cgit/config.git. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@979109 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 252 ++++++++++++++++++++------------------------- build/config.sub | 151 ++++++++++++++++++++------- 2 files changed, 226 insertions(+), 177 deletions(-) diff --git a/build/config.guess b/build/config.guess index ca2a03ca4f1..115f944a61d 100755 --- a/build/config.guess +++ b/build/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2008-01-08' +timestamp='2010-04-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -27,16 +27,16 @@ timestamp='2008-01-08' # the same distribution terms that you use for the rest of that program. -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` @@ -56,8 +56,9 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -91,7 +92,7 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' 1 2 15 +trap 'exit 1' HUP INT TERM # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -105,7 +106,7 @@ trap 'exit 1' 1 2 15 set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || @@ -170,7 +171,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null + | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? @@ -324,14 +325,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -640,7 +660,7 @@ EOF # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null + grep -q __LP64__ then HP_ARCH="hppa2.0w" else @@ -791,12 +811,12 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - *:Interix*:[3456]*) + *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd) + authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) @@ -806,6 +826,9 @@ EOF [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -835,6 +858,20 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ @@ -857,6 +894,17 @@ EOF frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; @@ -866,74 +914,33 @@ EOF m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) + mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU - #undef mips64 - #undef mips64el + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el + CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 + CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + padre:Linux:*:*) + echo sparc-unknown-linux-gnu exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level @@ -943,8 +950,11 @@ EOF *) echo hppa-unknown-linux-gnu ;; esac exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux @@ -967,69 +977,6 @@ EOF xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both @@ -1058,7 +1005,7 @@ EOF i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) @@ -1102,8 +1049,11 @@ EOF pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 @@ -1141,6 +1091,16 @@ EOF 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; @@ -1153,7 +1113,7 @@ EOF rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) @@ -1216,6 +1176,9 @@ EOF BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1243,6 +1206,16 @@ EOF *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} @@ -1324,6 +1297,9 @@ EOF i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1484,9 +1460,9 @@ This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD and - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD If the version you run ($0) is already up to date, please send the following data and any information you think might be diff --git a/build/config.sub b/build/config.sub index 6759825a5b7..204218c0738 100755 --- a/build/config.sub +++ b/build/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2008-01-16' +timestamp='2010-05-21' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -32,13 +32,16 @@ timestamp='2008-01-16' # Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. @@ -72,8 +75,9 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -120,8 +124,10 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -148,10 +154,13 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) + -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; + -bluegene*) + os=-cnk + ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 @@ -249,13 +258,16 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ + | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ - | mips64vr | mips64vrel \ + | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ @@ -268,6 +280,7 @@ case $basic_machine in | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | moxie \ | mt \ | msp430 \ | nios | nios2 \ @@ -276,20 +289,31 @@ case $basic_machine in | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ + | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ + | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) + | z8k | z80) basic_machine=$basic_machine-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12) + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none @@ -320,7 +344,7 @@ case $basic_machine in | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ @@ -329,14 +353,17 @@ case $basic_machine in | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ + | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ @@ -357,21 +384,23 @@ case $basic_machine in | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile-* | tilegx-* \ | tron-* \ + | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-*) + | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) @@ -439,6 +468,10 @@ case $basic_machine in basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -455,10 +488,27 @@ case $basic_machine in basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; c90) basic_machine=c90-cray os=-unicos ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -526,6 +576,10 @@ case $basic_machine in basic_machine=m88k-motorola os=-sysv3 ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp @@ -699,6 +753,9 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; + microblaze) + basic_machine=microblaze-xilinx + ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -1037,17 +1094,10 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu ;; tile*) basic_machine=tile-unknown @@ -1128,6 +1178,10 @@ case $basic_machine in basic_machine=z8k-unknown os=-sim ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -1166,7 +1220,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) @@ -1216,6 +1270,9 @@ case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; @@ -1236,10 +1293,11 @@ case $os in # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1248,9 +1306,10 @@ case $os in | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ + | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1258,7 +1317,7 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1388,6 +1447,11 @@ case $os in -zvmoe) os=-zvmoe ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; -none) ;; *) @@ -1428,6 +1492,15 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 @@ -1585,7 +1658,7 @@ case $basic_machine in -sunos*) vendor=sun ;; - -aix*) + -cnk*|-aix*) vendor=ibm ;; -beos*) From c62ff64d143ecb94cd426414230843cd4b9661f2 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Tue, 27 Jul 2010 22:09:45 +0000 Subject: [PATCH 6779/7878] Fix various issues found by cppcheck - error handling issues - use of uninitialized data - null pointer dereference - unused variables - memory/fd leaks - broken code in threadproc/beos/proc.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@979891 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 5 ----- build/jlibtool.c | 4 ++-- dbd/apr_dbd_oracle.c | 2 +- dbm/apr_dbm_sdbm.c | 2 +- file_io/netware/pipe.c | 3 --- file_io/os2/open.c | 2 +- file_io/unix/open.c | 8 ++++++-- file_io/win32/open.c | 4 +--- memory/unix/apr_pools.c | 1 + threadproc/beos/proc.c | 7 ++++--- threadproc/unix/proc.c | 7 +++---- threadproc/unix/procsup.c | 4 ++-- 12 files changed, 22 insertions(+), 27 deletions(-) diff --git a/build/aplibtool.c b/build/aplibtool.c index 357dbb993f7..602f045fe2b 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -300,7 +300,6 @@ bool parse_input_file_name(char *arg, cmd_data_t *cmd_data) { char *ext = strrchr(arg, '.'); char *name = strrchr(arg, '/'); - int pathlen; char *newarg; if (!ext) { @@ -321,8 +320,6 @@ bool parse_input_file_name(char *arg, cmd_data_t *cmd_data) name++; } - pathlen = name - arg; - if (strcmp(ext, "lo") == 0) { newarg = (char *)malloc(strlen(arg) + 10); strcpy(newarg, arg); @@ -362,7 +359,6 @@ bool parse_output_file_name(char *arg, cmd_data_t *cmd_data) char *name = strrchr(arg, '/'); char *ext = strrchr(arg, '.'); char *newarg = NULL, *newext; - int pathlen; if (name == NULL) { name = strrchr(arg, '\\'); @@ -392,7 +388,6 @@ bool parse_output_file_name(char *arg, cmd_data_t *cmd_data) } ext++; - pathlen = name - arg; if (strcmp(ext, "exe") == 0) { cmd_data->output_type = otProgram; diff --git a/build/jlibtool.c b/build/jlibtool.c index 1ad5a1b2756..892e26d5653 100644 --- a/build/jlibtool.c +++ b/build/jlibtool.c @@ -1650,7 +1650,7 @@ const char* expand_path(const char *relpath) getcwd(foo, PATH_MAX-1); newpath = (char*)malloc(strlen(foo)+strlen(relpath)+2); - strcat(newpath, foo); + strcpy(newpath, foo); strcat(newpath, "/"); strcat(newpath, relpath); return newpath; @@ -1682,7 +1682,7 @@ void link_fixup(command_t *c) push_count_chars(c->shared_opts.normal, DYNAMIC_INSTALL_NAME); tmp = (char*)malloc(PATH_MAX); - strcat(tmp, c->install_path); + strcpy(tmp, c->install_path); strcat(tmp, strrchr(c->shared_name.normal, '/')); push_count_chars(c->shared_opts.normal, tmp); #endif diff --git a/dbd/apr_dbd_oracle.c b/dbd/apr_dbd_oracle.c index 1de34901848..df3ebcc6756 100644 --- a/dbd/apr_dbd_oracle.c +++ b/dbd/apr_dbd_oracle.c @@ -1758,8 +1758,8 @@ static int dbd_oracle_end_transaction(apr_dbd_transaction_t *trans) { int ret = 1; /* no transaction is an error cond */ sword status; - apr_dbd_t *handle = trans->handle; if (trans) { + apr_dbd_t *handle = trans->handle; switch (trans->status) { case TRANS_NONE: /* No trans is an error here */ status = OCI_ERROR; diff --git a/dbm/apr_dbm_sdbm.c b/dbm/apr_dbm_sdbm.c index 7a246dd4fa4..7c105d2eb9e 100644 --- a/dbm/apr_dbm_sdbm.c +++ b/dbm/apr_dbm_sdbm.c @@ -193,7 +193,7 @@ static apr_status_t vt_sdbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey) pkey->dsize = rd.dsize; /* store any error info into DBM, and return a status code. */ - return set_error(dbm, APR_SUCCESS); + return set_error(dbm, rv); } static void vt_sdbm_freedatum(apr_dbm_t *dbm, apr_datum_t data) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 3e8f5593555..f88f1e625bb 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -26,7 +26,6 @@ static apr_status_t pipeblock(apr_file_t *thepipe) { #ifdef USE_FLAGS - int err; unsigned long flags; if (fcntl(thepipe->filedes, F_GETFL, &flags) != -1) @@ -49,7 +48,6 @@ static apr_status_t pipeblock(apr_file_t *thepipe) static apr_status_t pipenonblock(apr_file_t *thepipe) { #ifdef USE_FLAGS - int err; unsigned long flags; errno = 0; @@ -138,7 +136,6 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) { int filedes[2]; - int err; if (pipe(filedes) == -1) { return errno; diff --git a/file_io/os2/open.c b/file_io/os2/open.c index c9d32deb958..cd629dc8e7f 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -148,7 +148,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) file->mutex = NULL; } - return APR_SUCCESS; + return status; } diff --git a/file_io/unix/open.c b/file_io/unix/open.c index ce43785773a..ba271cb05dd 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -180,13 +180,17 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, if (!(flag & APR_FOPEN_NOCLEANUP)) { int flags; - if ((flags = fcntl(fd, F_GETFD)) == -1) + if ((flags = fcntl(fd, F_GETFD)) == -1) { + close(fd); return errno; + } if ((flags & FD_CLOEXEC) == 0) { flags |= FD_CLOEXEC; - if (fcntl(fd, F_SETFD, flags) == -1) + if (fcntl(fd, F_SETFD, flags) == -1) { + close(fd); return errno; + } } } diff --git a/file_io/win32/open.c b/file_io/win32/open.c index a4e6f269240..c6afa5fe810 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -145,7 +145,6 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) apr_wchar_t *wpre, *wfile, *ch; apr_size_t n = strlen(file) + 1; apr_size_t r, d; - apr_status_t rv; if (apr_os_level >= APR_WIN_2000) { if (global) @@ -169,7 +168,7 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) wfile = apr_palloc(pool, (r + n) * sizeof(apr_wchar_t)); wcscpy(wfile, wpre); d = n; - if ((rv = apr_conv_utf8_to_ucs2(file, &n, wfile + r, &d))) { + if (apr_conv_utf8_to_ucs2(file, &n, wfile + r, &d)) { return NULL; } for (ch = wfile + r; *ch; ++ch) { @@ -186,7 +185,6 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) apr_size_t n = strlen(file) + 1; #if !APR_HAS_UNICODE_FS - apr_status_t rv; apr_size_t r, d; char *pre; diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index d3c81fc347b..08b43fba0db 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1427,6 +1427,7 @@ static void *pool_alloc(apr_pool_t *pool, apr_size_t size) node = pool->nodes; if (node == NULL || node->index == 64) { if ((node = malloc(SIZEOF_DEBUG_NODE_T)) == NULL) { + free(mem); if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 3092f4502c1..e3698082f35 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -362,8 +362,9 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_fi == APR_SUCCESS) rv = apr_file_inherit_set(attr->child_in); } + } - if (parent_in != NULL && rv == APR_SUCCESS) { + if (parent_in != NULL && rv == APR_SUCCESS) rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool); return rv; @@ -391,7 +392,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_f } } - if (parent_out != NULL && rv == APR_SUCCESS) { + if (parent_out != NULL && rv == APR_SUCCESS) rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool); return rv; @@ -419,7 +420,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f } } - if (parent_err != NULL && rv == APR_SUCCESS) { + if (parent_err != NULL && rv == APR_SUCCESS) rv = apr_file_dup(&attr->parent_err, parent_err, attr->pool); return rv; diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index b9a674b7faf..8deb6de2fcc 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -396,7 +396,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, return errno; } else if (new->pid == 0) { - int status; /* child process */ /* @@ -478,7 +477,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } /* Only try to switch if we are running as root */ if (attr->gid != -1 && !geteuid()) { - if ((status = setgid(attr->gid))) { + if (setgid(attr->gid)) { if (attr->errfn) { attr->errfn(pool, errno, "setting of group failed"); } @@ -487,7 +486,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } if (attr->uid != -1 && !geteuid()) { - if ((status = setuid(attr->uid))) { + if (setuid(attr->uid)) { if (attr->errfn) { attr->errfn(pool, errno, "setting of user failed"); } @@ -495,7 +494,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } } - if ((status = limit_proc(attr)) != APR_SUCCESS) { + if (limit_proc(attr) != APR_SUCCESS) { if (attr->errfn) { attr->errfn(pool, errno, "setting of resource limits failed"); } diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index 376baf21fc0..94177f92a65 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -18,8 +18,6 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) { - int x; - if (chdir("/") == -1) { return errno; } @@ -28,6 +26,8 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) /* Don't detach for MPE because child processes can't survive the death of * the parent. */ if (daemonize) { + int x; + if ((x = fork()) > 0) { exit(0); } From bebb7f67f43ca1e0ef90dbed0ba2bd0bbca70716 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Wed, 28 Jul 2010 20:30:52 +0000 Subject: [PATCH 6780/7878] For now, revert part of r979891 to fix test breakage. But the error handling of apr_sdbm_nextkey seems broken. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@980197 13f79535-47bb-0310-9956-ffa450edef68 --- dbm/apr_dbm_sdbm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dbm/apr_dbm_sdbm.c b/dbm/apr_dbm_sdbm.c index 7c105d2eb9e..a3735e04efe 100644 --- a/dbm/apr_dbm_sdbm.c +++ b/dbm/apr_dbm_sdbm.c @@ -192,8 +192,11 @@ static apr_status_t vt_sdbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey) pkey->dptr = rd.dptr; pkey->dsize = rd.dsize; - /* store any error info into DBM, and return a status code. */ - return set_error(dbm, rv); + /* + * XXX: This discards any error but apr_sdbm_nextkey currently returns + * XXX: an error for the last key + */ + return set_error(dbm, APR_SUCCESS); } static void vt_sdbm_freedatum(apr_dbm_t *dbm, apr_datum_t data) From e9df65b7bace70d6e5a8c56fb70e3335e56f34f2 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 3 Aug 2010 05:52:59 +0000 Subject: [PATCH 6781/7878] The Tab Police removed 24 tabs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@981748 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index f88f1e625bb..adc53ee96e1 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -26,16 +26,16 @@ static apr_status_t pipeblock(apr_file_t *thepipe) { #ifdef USE_FLAGS - unsigned long flags; + unsigned long flags; - if (fcntl(thepipe->filedes, F_GETFL, &flags) != -1) - { - flags &= ~FNDELAY; - fcntl(thepipe->filedes, F_SETFL, flags); - } + if (fcntl(thepipe->filedes, F_GETFL, &flags) != -1) + { + flags &= ~FNDELAY; + fcntl(thepipe->filedes, F_SETFL, flags); + } #else errno = 0; - fcntl(thepipe->filedes, F_SETFL, 0); + fcntl(thepipe->filedes, F_SETFL, 0); #endif if (errno) @@ -48,17 +48,17 @@ static apr_status_t pipeblock(apr_file_t *thepipe) static apr_status_t pipenonblock(apr_file_t *thepipe) { #ifdef USE_FLAGS - unsigned long flags; + unsigned long flags; errno = 0; - if (fcntl(thepipe->filedes, F_GETFL, &flags) != -1) - { - flags |= FNDELAY; - fcntl(thepipe->filedes, F_SETFL, flags); - } + if (fcntl(thepipe->filedes, F_GETFL, &flags) != -1) + { + flags |= FNDELAY; + fcntl(thepipe->filedes, F_SETFL, flags); + } #else errno = 0; - fcntl(thepipe->filedes, F_SETFL, FNDELAY); + fcntl(thepipe->filedes, F_SETFL, FNDELAY); #endif if (errno) @@ -135,7 +135,7 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) { - int filedes[2]; + int filedes[2]; if (pipe(filedes) == -1) { return errno; From cd79eb7f62af20dfbb7fec13f6e292ae9ab2b922 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 3 Aug 2010 06:07:46 +0000 Subject: [PATCH 6782/7878] Renamed _self var since (Open)Watcom recognizes this as reserved. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@981753 13f79535-47bb-0310-9956-ffa450edef68 --- util-misc/apr_thread_pool.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/util-misc/apr_thread_pool.c b/util-misc/apr_thread_pool.c index 22c544d0b1a..39d9330552a 100644 --- a/util-misc/apr_thread_pool.c +++ b/util-misc/apr_thread_pool.c @@ -342,16 +342,16 @@ static void *APR_THREAD_FUNC thread_pool_func(apr_thread_t * t, void *param) static apr_status_t thread_pool_cleanup(void *me) { - apr_thread_pool_t *_self = me; + apr_thread_pool_t *_myself = me; - _self->terminated = 1; - apr_thread_pool_idle_max_set(_self, 0); - while (_self->thd_cnt) { + _myself->terminated = 1; + apr_thread_pool_idle_max_set(_myself, 0); + while (_myself->thd_cnt) { apr_sleep(20 * 1000); /* spin lock with 20 ms */ } - apr_thread_mutex_destroy(_self->lock); - apr_thread_mutex_destroy(_self->cond_lock); - apr_thread_cond_destroy(_self->cond); + apr_thread_mutex_destroy(_myself->lock); + apr_thread_mutex_destroy(_myself->cond_lock); + apr_thread_cond_destroy(_myself->cond); return APR_SUCCESS; } From dd1421159d39700a218be10a0d0b57854d1d5417 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 3 Aug 2010 09:27:16 +0000 Subject: [PATCH 6783/7878] NetWare build system fixes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@981787 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 + build/NWGNUmakefile | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 76847a0d7c9..23dcb839dc1 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -371,6 +371,7 @@ FILES_lib_objs = \ $(OBJDIR)/pipe.o \ $(OBJDIR)/pollcb.o \ $(OBJDIR)/pollset.o \ + $(OBJDIR)/printf.o \ $(OBJDIR)/proc.o \ $(OBJDIR)/proc_mutex.o \ $(OBJDIR)/procsup.o \ diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index 9f33c108a8c..b15ad8b23e2 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -17,7 +17,6 @@ include $(APR_WORK)/build/NWGNUhead.inc FILES_prebuild_headers = \ $(APR)/include/apr.h \ - $(APR)/include/apu.h \ $(APR)/include/apu_want.h \ $(APR)/include/apr_ldap.h \ $(APR)/include/private/apu_config.h \ @@ -42,6 +41,7 @@ $(NLM_NAME)_cc.opt : NWGNUmakefile $(APR)/build/NWGNUenvironment.inc $(APR)/buil @echo -w nocmdline >> $@ @echo $(DEFINES) -DGENEXPORTS >> $@ @echo -I$(APR)/include >> $@ + @echo -I$(APR)/include/private >> $@ @echo -I$(APR)/include/arch/netware >> $@ @echo -I$(APR)/include/arch/unix >> $@ @echo -I$(APR)/build >> $@ @@ -76,7 +76,6 @@ clean :: $(CHK) $(NLM_NAME)_cc.opt $(DEL) $(NLM_NAME)_cc.opt $(CHK) NWGNUversion.inc $(DEL) NWGNUversion.inc $(CHK) $(subst /,\,$(APR))\include\apr.h $(DEL) $(subst /,\,$(APR))\include\apr.h - $(CHK) $(subst /,\,$(APR))\include\apu.h $(DEL) $(subst /,\,$(APR))\include\apu.h $(CHK) $(subst /,\,$(APR))\include\apu_want.h $(DEL) $(subst /,\,$(APR))\include\apu_want.h $(CHK) $(subst /,\,$(APR))\include\apr_ldap.h $(DEL) $(subst /,\,$(APR))\include\apr_ldap.h $(CHK) $(subst /,\,$(APR))\include\private\apu_config.h $(DEL) $(subst /,\,$(APR))\include\private\apu_config.h From 7ba93184a102bff7e46d57b7beb59e24de2c7555 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 3 Aug 2010 09:34:39 +0000 Subject: [PATCH 6784/7878] Sync'd NetWare header with unix one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@981790 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_arch_file_io.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/arch/netware/apr_arch_file_io.h b/include/arch/netware/apr_arch_file_io.h index 0676eb2789e..659eb200625 100644 --- a/include/arch/netware/apr_arch_file_io.h +++ b/include/arch/netware/apr_arch_file_io.h @@ -26,6 +26,7 @@ #include "apr_errno.h" #include "apr_lib.h" #include "apr_poll.h" +#include "apr_time.h" /* System headers the file I/O library needs */ #if APR_HAVE_FCNTL_H @@ -94,6 +95,15 @@ typedef struct stat struct_stat; +typedef struct apr_rotating_info_t { + apr_finfo_t finfo; + apr_interval_time_t timeout; + apr_time_t lastcheck; + int oflags; + int manual; + apr_fileperms_t perm; +} apr_rotating_info_t; + struct apr_file_t { apr_pool_t *pool; int filedes; @@ -119,6 +129,7 @@ struct apr_file_t { #if APR_HAS_THREADS struct apr_thread_mutex_t *thlock; #endif + apr_rotating_info_t *rotating; }; struct apr_dir_t { @@ -165,6 +176,9 @@ apr_status_t filepath_compare_drive(const char *path1, const char *path2, apr_po apr_status_t apr_unix_file_cleanup(void *); apr_status_t apr_unix_child_file_cleanup(void *); +mode_t apr_unix_perms2mode(apr_fileperms_t perms); +apr_fileperms_t apr_unix_mode2perms(mode_t mode); + apr_status_t apr_file_flush_locked(apr_file_t *thefile); apr_status_t apr_file_info_get_locked(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile); From 1e49bc885edb6181f987bc4703313bf35ba69e63 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 3 Aug 2010 09:45:30 +0000 Subject: [PATCH 6785/7878] The Tab Police removed 119 tabs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@981793 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/thread.c | 50 ++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 4b5d930a0e5..61dbdc157d6 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -41,7 +41,7 @@ apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr,apr_int32_t on) { attr->detach = on; - return APR_SUCCESS; + return APR_SUCCESS; } apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) @@ -71,21 +71,21 @@ static void *dummy_worker(void *opaque) } apr_status_t apr_thread_create(apr_thread_t **new, - apr_threadattr_t *attr, - apr_thread_start_t func, - void *data, - apr_pool_t *pool) + apr_threadattr_t *attr, + apr_thread_start_t func, + void *data, + apr_pool_t *pool) { apr_status_t stat; long flags = NX_THR_BIND_CONTEXT; - char threadName[NX_MAX_OBJECT_NAME_LEN+1]; + char threadName[NX_MAX_OBJECT_NAME_LEN+1]; size_t stack_size = APR_DEFAULT_STACK_SIZE; if (attr && attr->thread_name) { strncpy (threadName, attr->thread_name, NX_MAX_OBJECT_NAME_LEN); } else { - sprintf(threadName, "APR_thread %04ld", ++thread_count); + sprintf(threadName, "APR_thread %04ld", ++thread_count); } /* An original stack size of 0 will allow NXCreateThread() to @@ -117,27 +117,27 @@ apr_status_t apr_thread_create(apr_thread_t **new, } (*new)->ctx = NXContextAlloc( - /* void(*start_routine)(void *arg)*/(void (*)(void *)) dummy_worker, - /* void *arg */ (*new), - /* int priority */ NX_PRIO_MED, - /* NXSize_t stackSize */ stack_size, - /* long flags */ NX_CTX_NORMAL, - /* int *error */ &stat); - - - stat = NXContextSetName( - /* NXContext_t ctx */ (*new)->ctx, - /* const char *name */ threadName); - - stat = NXThreadCreate( - /* NXContext_t context */ (*new)->ctx, - /* long flags */ flags, - /* NXThreadId_t *thread_id */ &(*new)->td); + /* void(*start_routine)(void *arg)*/(void (*)(void *)) dummy_worker, + /* void *arg */ (*new), + /* int priority */ NX_PRIO_MED, + /* NXSize_t stackSize */ stack_size, + /* long flags */ NX_CTX_NORMAL, + /* int *error */ &stat); + + + stat = NXContextSetName( + /* NXContext_t ctx */ (*new)->ctx, + /* const char *name */ threadName); + + stat = NXThreadCreate( + /* NXContext_t context */ (*new)->ctx, + /* long flags */ flags, + /* NXThreadId_t *thread_id */ &(*new)->td); if(stat==0) - return APR_SUCCESS; + return APR_SUCCESS; - return(stat);// if error + return(stat);// if error } apr_os_thread_t apr_os_thread_current() From 7bacf823255e6244f13e63ac84ee644c2914ce46 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 3 Aug 2010 20:45:06 +0000 Subject: [PATCH 6786/7878] Fixed some compiler warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982032 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/start.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/misc/netware/start.c b/misc/netware/start.c index 1e5708d1f7e..76817d96c00 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -22,8 +22,20 @@ #include "apr_arch_misc.h" /* for WSAHighByte / WSALowByte */ #include "apr_arch_proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ #include "apr_arch_internal_time.h" +#include "apr_ldap.h" /* for apr_ldap_rebind_init() */ #ifdef USE_WINSOCK +/* Prototypes missing from older NDKs */ +int WSAStartupRTags(WORD wVersionRequested, + LPWSADATA lpWSAData, + rtag_t WSAStartupRTag, + rtag_t WSPSKTRTag, + rtag_t lookUpServiceBeginRTag, + rtag_t WSAEventRTag, + rtag_t WSPCPRTag); + +int WSACleanupRTag(rtag_t rTag); + /* ** Resource tag signatures for using NetWare WinSock 2. These will no longer ** be needed by anyone once the new WSAStartupWithNlmHandle() is available @@ -38,7 +50,6 @@ int (*WSAStartupWithNLMHandle)( WORD version, LPWSADATA data, void *handle ) = NULL; int (*WSACleanupWithNLMHandle)( void *handle ) = NULL; -apr_status_t apr_ldap_rebind_init(apr_pool_t *pool); static int wsa_startup_with_handle (WORD wVersionRequested, LPWSADATA data, void *handle) { @@ -124,7 +135,6 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, APR_DECLARE(apr_status_t) apr_initialize(void) { apr_pool_t *pool; - int err; void *nlmhandle = getnlmhandle(); /* Register the NLM as using APR. If it is already @@ -144,15 +154,18 @@ APR_DECLARE(apr_status_t) apr_initialize(void) apr_pool_tag(pool, "apr_initilialize"); #ifdef USE_WINSOCK - err = RegisterAppWithWinSock (nlmhandle); - - if (err) { - return err; + { + int err; + if ((err = RegisterAppWithWinSock (nlmhandle))) { + return err; + } } #endif apr_signal_init(pool); +#if APR_HAS_LDAP apr_ldap_rebind_init(pool); +#endif return APR_SUCCESS; } From dc9d5939c4536ebd541b637309b2beeff0612563 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 3 Aug 2010 20:49:43 +0000 Subject: [PATCH 6787/7878] Fixed a compiler warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982033 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/libprews.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index 624bf22cfa4..023e938ac53 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -17,11 +17,12 @@ #include #include #ifdef USE_WINSOCK -#include "novsock2.h" +#include #endif #include "apr_pools.h" #include "apr_private.h" +#include "apr_arch_internal_time.h" /* library-private data...*/ From a8cf316378f1a7616373f04caa8701a4ac7fa669 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 3 Aug 2010 21:30:22 +0000 Subject: [PATCH 6788/7878] Some more NetWare build fixes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982038 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 2 ++ build/NWGNUenvironment.inc | 2 +- include/apr.hnw | 1 + include/arch/netware/apr_private.h | 23 ++++++----------------- network_io/win32/sendrecv.c | 5 +++++ 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 23dcb839dc1..b4fb0321979 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -42,6 +42,7 @@ XINCDIRS += \ $(APR)/dbm/sdbm \ $(APR)/memory/unix \ $(APR)/random/unix \ + $(LDAPSDK)/inc \ $(EOLIST) # @@ -405,6 +406,7 @@ FILES_lib_objs = \ $(OBJDIR)/uuid.o \ $(OBJDIR)/version.o \ $(OBJDIR)/waitio.o \ + $(OBJDIR)/wakeup.o \ $(OBJDIR)/xlate.o \ $(EOLIST) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index dd765c6a898..905e3ffec87 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -237,7 +237,7 @@ endif # Add support for building IPV6 alongside ifneq "$(IPV6)" "" DEFINES += -DNW_BUILD_IPV6 -INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS) +# INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS) ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6" OBJDIR := $(OBJDIR)_IPV6 diff --git a/include/apr.hnw b/include/apr.hnw index 77c0abff4b1..e1ebde361f5 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -38,6 +38,7 @@ #if defined(NETWARE) || defined(DOXYGEN) +#undef FD_SETSIZE #define FD_SETSIZE 1024 #include diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 35644191437..f8e1ecf1241 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -89,8 +89,10 @@ /* 7 is used for SIGPOLL on netware */ #define SIGKILL 11 +#undef SA_NOCLDSTOP #define SA_NOCLDSTOP 12 #define SIGALRM 13 +#undef SIGCHLD #define SIGCHLD 14 #define SIGCONT 15 #define SIGHUP 16 @@ -105,6 +107,7 @@ #define SIGTRAP 25 #define SIGIOT 26 +#undef SIGBUS #define SIGBUS 27 #define SIGSTKFLT 28 #define SIGURG 29 @@ -115,29 +118,15 @@ #define SIGWINCH 34 #define SIGIO 35 -#if 0 -#define __attribute__(__x) - -/* APR COMPATABILITY FUNCTIONS - * This section should be used to define functions and - * macros which are need to make Windows features look - * like POSIX features. - */ -typedef void (Sigfunc)(int); -#endif - -#define strcasecmp(s1, s2) stricmp(s1, s2) -#define Sleep(t) delay(t) -#define lstat(a,b) stat(a,b) -#define _getch() getcharacter() +#define _getch() getcharacter() +#define SIZEOF_CHAR 1 #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 #define SIZEOF_LONGLONG 8 -#define SIZEOF_CHAR 1 #define SIZEOF_SSIZE_T SIZEOF_INT -void netware_pool_proc_cleanup (); +void netware_pool_proc_cleanup(); /* NLM registration routines for managing which NLMs are using the library. */ diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index a01f0329a44..1ca8df42e99 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -455,3 +455,8 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, #endif +APR_DECLARE(apr_status_t) apr_socket_wait(apr_socket_t *sock, apr_wait_type_t direction) +{ + return APR_ENOTIMPL; +} + From bf4b3d8023ee4d9842bfc341835a661eb29941dd Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 4 Aug 2010 01:23:03 +0000 Subject: [PATCH 6789/7878] Fixed comment. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982098 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index e1ebde361f5..ef4de26c1fd 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -25,15 +25,7 @@ * And please, make an effort to stub apr.hw and apr.h.in in the process. * * This is the NetWare specific version of apr.h. It is copied from - * apr.hnw at the start of a NetWare build by prebuildNW.bat. - */ - -/** - * @file apr.h - * @brief APR Platform Definitions - * @remark This is a generated header generated from include/apr.h.in by - * ./configure, or copied from include/apr.hw or include/apr.hnw - * for Win32 or Netware by those build environments, respectively. + * apr.hnw at the start of a NetWare build by the ./build/NWGNmakefile. */ #if defined(NETWARE) || defined(DOXYGEN) From 8a19712a34679ba9e32921d467bb1c9f4b2d8458 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 4 Aug 2010 02:24:49 +0000 Subject: [PATCH 6790/7878] Fixed two other NetWare compiler warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982100 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 2 +- include/arch/netware/apr_private.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr.hnw b/include/apr.hnw index ef4de26c1fd..580c0f53e8f 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -114,7 +114,7 @@ extern "C" { #ifdef USE_WINSOCK #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SOCKIO_H 0 -#define APR_HAVE_SYS_TIME_H 0 +#define APR_HAVE_SYS_TIME_H 1 #define APR_HAVE_SYS_UN_H 0 #else #define APR_HAVE_SYS_SOCKET_H 1 diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index f8e1ecf1241..3cb4dd009fc 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -163,6 +163,7 @@ void* getStatCache(); and can be shared by the library. */ #undef malloc #define malloc(x) library_malloc(gLibHandle,x) +#define _alloca alloca #if APR_HAS_LARGE_FILES #define APR_OFF_T_STRFN strtoll From ceef339e43f7041387c95d03f03e195573f80eca Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 4 Aug 2010 02:28:06 +0000 Subject: [PATCH 6791/7878] Enable to build Win32 target with OpenWatcom. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982101 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 6 ++++++ include/arch/win32/apr_private.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/include/apr.hw b/include/apr.hw index 1250d86afe4..0b41f9b9598 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -132,7 +132,11 @@ #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SEMAPHORE_H 0 +#ifdef __WATCOMC__ +#define APR_HAVE_SIGNAL_H 0 +#else #define APR_HAVE_SIGNAL_H APR_NOT_IN_WCE +#endif #define APR_HAVE_STDARG_H APR_NOT_IN_WCE #define APR_HAVE_STDDEF_H APR_NOT_IN_WCE #define APR_HAVE_STDINT_H 0 @@ -668,12 +672,14 @@ typedef int apr_wait_t; * based on some APR_HAVE_PID/GID/UID? */ #ifdef WIN32 +#ifndef __WATCOMC__ #ifndef __GNUC__ typedef int pid_t; #endif typedef int uid_t; typedef int gid_t; #endif +#endif /* Typically defined in stdio.h or unistd.h */ diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index ee27a4abc9a..55b38411be1 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -60,7 +60,11 @@ #define HAVE_LIMITS_H 1 #define HAVE_MALLOC_H 1 #define HAVE_PROCESS_H APR_NOT_IN_WCE +#ifdef __WATCOMC__ +#define HAVE_SIGNAL_H 0 +#else #define HAVE_SIGNAL_H 1 +#endif #define HAVE_STDDEF_H APR_NOT_IN_WCE #define HAVE_STDLIB_H 1 From 8878f85cb43e6c1c9b9b566223cb983a8c83b13c Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 4 Aug 2010 02:39:26 +0000 Subject: [PATCH 6792/7878] cleanup. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982105 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index 580c0f53e8f..607dafb7eb8 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -111,15 +111,14 @@ extern "C" { #define APR_HAVE_STRTOLL 1 #define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 +#define APR_HAVE_SYS_TIME_H 1 #ifdef USE_WINSOCK #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SOCKIO_H 0 -#define APR_HAVE_SYS_TIME_H 1 #define APR_HAVE_SYS_UN_H 0 #else #define APR_HAVE_SYS_SOCKET_H 1 #define APR_HAVE_SYS_SOCKIO_H 1 -#define APR_HAVE_SYS_TIME_H 1 #define APR_HAVE_SYS_UN_H 1 #endif #define APR_HAVE_SYS_SIGNAL_H 1 From db09cfd8325d1ee2e321adf04218e5cffbfa09be Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 4 Aug 2010 05:37:09 +0000 Subject: [PATCH 6793/7878] Fixed a type mismatch compiler warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982124 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index cdd507d1aa2..d2997b2ee61 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -565,7 +565,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI { - char *root = NULL; + const char *root = NULL; const char *test = fname; rv = apr_filepath_root(&root, &test, APR_FILEPATH_NATIVE, pool); isroot = (root && *root && !(*test)); From 3c643cb92c2041fec82a7cd4ef2c7b2cf79bce06 Mon Sep 17 00:00:00 2001 From: "Philip M. Gollucci" Date: Wed, 4 Aug 2010 21:15:02 +0000 Subject: [PATCH 6794/7878] - Fix mismatched signed comparisons [1] - While here replace atoi with strtol(3) Reported by: sf via gcc [1] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982408 13f79535-47bb-0310-9956-ffa450edef68 --- memcache/apr_memcache.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index 3332841e251..dc4df8538d3 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -787,10 +787,10 @@ apr_memcache_getp(apr_memcache_t *mc, length = apr_strtok(NULL, " ", &last); if (length) { - len = atoi(length); + len = strtol(length, (char **)NULL, 10); } - if (len < 0) { + if (len != 0 ) { *new_length = 0; *baton = NULL; } @@ -1358,14 +1358,14 @@ apr_memcache_multgetp(apr_memcache_t *mc, length = apr_strtok(NULL, " ", &last); if (length) { - len = atoi(length); + len = strtol(length, (char **) NULL, 10); } value = apr_hash_get(values, key, strlen(key)); if (value) { - if (len >= 0) { + if (len != 0) { apr_bucket_brigade *bbb; apr_bucket *e; From c8396d250e8dee12634f2c068e987e9c8adc9237 Mon Sep 17 00:00:00 2001 From: "Philip M. Gollucci" Date: Wed, 4 Aug 2010 21:26:55 +0000 Subject: [PATCH 6795/7878] - this is handling the error condition, not success [note, testmemcache apparently doesn't hit this path] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982409 13f79535-47bb-0310-9956-ffa450edef68 --- memcache/apr_memcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index dc4df8538d3..06773abbc36 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -790,7 +790,7 @@ apr_memcache_getp(apr_memcache_t *mc, len = strtol(length, (char **)NULL, 10); } - if (len != 0 ) { + if (len == 0 ) { *new_length = 0; *baton = NULL; } From f9d265b67a8c9421b8ef4612b218aa02f865474c Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Thu, 5 Aug 2010 08:18:52 +0000 Subject: [PATCH 6796/7878] USe the MAJOR, MINOR, PATCH macros directly instead of the ugly macro hack. MingW32 windres issued a couple of warnings, and Watcom wrc broke. This version tested with MingW32, Watcom, OpenWatcom, MSVC6, MSVC7, and all can create now a *.res warning-free. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982499 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libapr.rc b/libapr.rc index ac8094b1282..f8553316d71 100644 --- a/libapr.rc +++ b/libapr.rc @@ -21,8 +21,8 @@ 1 VERSIONINFO - FILEVERSION APR_VERSION_STRING_CSV,0 - PRODUCTVERSION APR_VERSION_STRING_CSV,0 + FILEVERSION APR_MAJOR_VERSION,APR_MINOR_VERSION,APR_PATCH_VERSION,0 + PRODUCTVERSION APR_MAJOR_VERSION,APR_MINOR_VERSION,APR_PATCH_VERSION,0 FILEFLAGSMASK 0x3fL #if defined(APR_IS_DEV_VERSION) #if defined(_DEBUG) From 29e9ff87a53b2ed299d7b873b94b0053778cd7ae Mon Sep 17 00:00:00 2001 From: "Philip M. Gollucci" Date: Thu, 5 Aug 2010 19:14:23 +0000 Subject: [PATCH 6797/7878] - start is never used Reported by: clang static analyzer git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982735 13f79535-47bb-0310-9956-ffa450edef68 --- memcache/apr_memcache.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index 06773abbc36..51c411d7b29 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -772,11 +772,9 @@ apr_memcache_getp(apr_memcache_t *mc, if (strncmp(MS_VALUE, conn->buffer, MS_VALUE_LEN) == 0) { char *flags; char *length; - char *start; char *last; apr_size_t len = 0; - start = conn->buffer; flags = apr_strtok(conn->buffer, " ", &last); flags = apr_strtok(NULL, " ", &last); flags = apr_strtok(NULL, " ", &last); @@ -1345,12 +1343,10 @@ apr_memcache_multgetp(apr_memcache_t *mc, char *key; char *flags; char *length; - char *start; char *last; char *data; apr_size_t len = 0; - start = conn->buffer; key = apr_strtok(conn->buffer, " ", &last); /* just the VALUE, ignore */ key = apr_strtok(NULL, " ", &last); flags = apr_strtok(NULL, " ", &last); From 313d86e862f0b3d6305586aa027a84e03950c8f3 Mon Sep 17 00:00:00 2001 From: "Philip M. Gollucci" Date: Thu, 5 Aug 2010 19:17:36 +0000 Subject: [PATCH 6798/7878] - remove unused assignment Reported by: clang static analyzer git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982736 13f79535-47bb-0310-9956-ffa450edef68 --- util-misc/apr_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util-misc/apr_queue.c b/util-misc/apr_queue.c index a1682f8f2a7..66b74dceaec 100644 --- a/util-misc/apr_queue.c +++ b/util-misc/apr_queue.c @@ -330,7 +330,7 @@ APR_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data) } if (apr_queue_empty(queue)) { - rv = apr_thread_mutex_unlock(queue->one_big_mutex); + (void)apr_thread_mutex_unlock(queue->one_big_mutex); return APR_EAGAIN; } From aa7212d87625a07ea8b1ece6c64d4dedaae3720f Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 8 Aug 2010 12:19:02 +0000 Subject: [PATCH 6799/7878] Added workaround for Watcom. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@983397 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_private.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 55b38411be1..ef6bf939431 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -114,6 +114,10 @@ typedef void (Sigfunc)(int); #define sleep(t) Sleep((t) * 1000) +/* For now workaround for Watcom'S lack of _commit() */ +#ifdef __WATCOMC__ +#define _commit fsync +#endif #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 From b42d6e9798384b358e40a9d477d584f06f67b1b4 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 8 Aug 2010 12:29:05 +0000 Subject: [PATCH 6800/7878] Revert r982499 and change macro in apr_version.h instead. MingW32 windres issued a couple of warnings, and Watcom wrc broke with this macro. This version tested with MingW32, Watcom, OpenWatcom, MSVC6, MSVC7, and all can create now a *.res warning-free. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@983400 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_version.h | 6 +++--- libapr.rc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/apr_version.h b/include/apr_version.h index c3a52500912..9dbb985c80f 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -109,9 +109,9 @@ /** An alternative formatted string of APR's version */ /* macro for Win32 .rc files using numeric csv representation */ -#define APR_VERSION_STRING_CSV APR_MAJOR_VERSION ##, \ - ##APR_MINOR_VERSION ##, \ - ##APR_PATCH_VERSION +#define APR_VERSION_STRING_CSV APR_MAJOR_VERSION, \ + APR_MINOR_VERSION, \ + APR_PATCH_VERSION #ifndef APR_VERSION_ONLY diff --git a/libapr.rc b/libapr.rc index f8553316d71..ac8094b1282 100644 --- a/libapr.rc +++ b/libapr.rc @@ -21,8 +21,8 @@ 1 VERSIONINFO - FILEVERSION APR_MAJOR_VERSION,APR_MINOR_VERSION,APR_PATCH_VERSION,0 - PRODUCTVERSION APR_MAJOR_VERSION,APR_MINOR_VERSION,APR_PATCH_VERSION,0 + FILEVERSION APR_VERSION_STRING_CSV,0 + PRODUCTVERSION APR_VERSION_STRING_CSV,0 FILEFLAGSMASK 0x3fL #if defined(APR_IS_DEV_VERSION) #if defined(_DEBUG) From 5061958eec0d1c0c5d75f3f90d6b710e4d42ba3a Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 8 Aug 2010 12:39:39 +0000 Subject: [PATCH 6801/7878] Moved copyright string definition to apr_version.h; updated copyright year. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@983403 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_version.h | 3 +++ libapr.rc | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_version.h b/include/apr_version.h index 9dbb985c80f..d516383726d 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -38,6 +38,9 @@ */ +#define APR_COPYRIGHT "Copyright (c) 2010 The Apache Software " \ + "Foundation or its licensors, as applicable." + /* The numeric compile-time version constants. These constants are the * authoritative version numbers for APR. */ diff --git a/libapr.rc b/libapr.rc index ac8094b1282..604fc7c06e4 100644 --- a/libapr.rc +++ b/libapr.rc @@ -1,8 +1,5 @@ #include "apr_version.h" -#define APR_COPYRIGHT "Copyright (c) 2009 The Apache Software " \ - "Foundation or its licensors, as applicable." - #define APR_LICENSE \ "Licensed to the Apache Software Foundation (ASF) under one or more " \ "contributor license agreements. See the NOTICE file distributed with " \ From 2a4636db67c69a2ca7788d89f38a40e04824d3da Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 8 Aug 2010 12:54:49 +0000 Subject: [PATCH 6802/7878] Reverted r982101 because it doesnt work. This whole redifine of the SIG macros is bogus. Other compilers might silently ignore redines, but Watcom breaks, and for good reason. I see that these redefines cant work properly because its only a matter of the order of the headers: if signal.h is included first then these redefines in apr_private.h might win - if f.e. as with httpd - apr.h is included first then those from signal.h win. We should really use own macro definitions prefixed with APR_ to make sure that we always use same definitions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@983409 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 4 ---- include/arch/win32/apr_private.h | 6 ++---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 0b41f9b9598..4534eff7f42 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -132,11 +132,7 @@ #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SEMAPHORE_H 0 -#ifdef __WATCOMC__ -#define APR_HAVE_SIGNAL_H 0 -#else #define APR_HAVE_SIGNAL_H APR_NOT_IN_WCE -#endif #define APR_HAVE_STDARG_H APR_NOT_IN_WCE #define APR_HAVE_STDDEF_H APR_NOT_IN_WCE #define APR_HAVE_STDINT_H 0 diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index ef6bf939431..10e4656d19e 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -60,11 +60,7 @@ #define HAVE_LIMITS_H 1 #define HAVE_MALLOC_H 1 #define HAVE_PROCESS_H APR_NOT_IN_WCE -#ifdef __WATCOMC__ -#define HAVE_SIGNAL_H 0 -#else #define HAVE_SIGNAL_H 1 -#endif #define HAVE_STDDEF_H APR_NOT_IN_WCE #define HAVE_STDLIB_H 1 @@ -74,6 +70,7 @@ #define HAVE_STRSTR 1 #define HAVE_MEMCHR 1 +#ifndef __WATCOMC__ #define SIGHUP 1 /* 2 is used for SIGINT on windows */ #define SIGQUIT 3 @@ -86,6 +83,7 @@ #define SIGUSR1 10 /* 11 is used for SIGSEGV on windows */ #define SIGUSR2 12 +#endif #define SIGPIPE 13 #define SIGALRM 14 /* 15 is used for SIGTERM on windows */ From 58f47027051bdf0a24893f568b3973b224b8ed9b Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 8 Aug 2010 17:26:15 +0000 Subject: [PATCH 6803/7878] Some NetWare build fixes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@983455 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUenvironment.inc | 4 +++- build/nw_export.inc | 2 +- include/apr.hnw | 8 ++++---- ldap/NWGNUmakefile | 8 -------- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 905e3ffec87..eb28c41502b 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -154,7 +154,9 @@ NOVI = $(NOVELLLIBC)/imports INCDIRS = $(NOVELLLIBC)/include;$(NOVELLLIBC)/include/nks; DEFINES = -DNETWARE -ifndef USE_STDSOCKETS +ifdef USE_STDSOCKETS +DEFINES += -DUSE_BSD_SOCKETS +else DEFINES += -DUSE_WINSOCK INCDIRS += $(NOVELLLIBC)/include/winsock; endif diff --git a/build/nw_export.inc b/build/nw_export.inc index bf55ddedd7a..f3743d464b2 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -2,7 +2,6 @@ ** the standard prototypes macros after it messes with them. */ #include "apr.h" -#include "apu.h" #undef APR_DECLARE #undef APR_DECLARE_NONSTD @@ -19,6 +18,7 @@ #include "apr_date.h" #include "apr_dbd.h" #include "apr_dbm.h" +#include "apr_dbm_private.h" #include "apr_dso.h" #include "apr_env.h" #include "apr_errno.h" diff --git a/include/apr.hnw b/include/apr.hnw index 607dafb7eb8..4088aae7b8d 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -49,15 +49,15 @@ #include #ifdef USE_WINSOCK #include +#ifdef NW_BUILD_IPV6 +#include +#endif #else #include +#include #endif #include -#ifdef NW_BUILD_IPV6 -#include -#endif - #define _POSIX_THREAD_SAFE_FUNCTIONS 1 #define READDIR_IS_THREAD_SAFE 1 diff --git a/ldap/NWGNUmakefile b/ldap/NWGNUmakefile index 83c5eff7525..d0e085d2159 100644 --- a/ldap/NWGNUmakefile +++ b/ldap/NWGNUmakefile @@ -42,14 +42,6 @@ XCFLAGS += \ XDEFINES += \ $(EOLIST) -# -#LDAP client requires the use of Winsock -# -ifdef USE_STDSOCKETS -XDEFINES += -DUSE_WINSOCK \ - $(EOLIST) -endif - # # These flags will be added to the link.opt file # From 0916bbc3cc736dbe08fcf12e796ee82803b143c8 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 8 Aug 2010 17:30:05 +0000 Subject: [PATCH 6804/7878] Removed tabs and trailing spaces. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@983458 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 4534eff7f42..ddbb25c82c8 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -25,7 +25,7 @@ * And please, make an effort to stub apr.hnw and apr.h.in in the process. * * This is the Win32 specific version of apr.h. It is copied from - * apr.hw by the apr.dsp and libapr.dsp projects. + * apr.hw by the apr.dsp and libapr.dsp projects. */ /* Ignore most warnings (back down to /W3) for poorly constructed headers, @@ -63,7 +63,7 @@ * @file apr.h * @brief APR Platform Definitions * @remark This is a generated header generated from include/apr.h.in by - * ./configure, or copied from include/apr.hw or include/apr.hnw + * ./configure, or copied from include/apr.hw or include/apr.hnw * for Win32 or Netware by those build environments, respectively. */ @@ -92,7 +92,7 @@ */ #if defined(_MSC_VER) #define APR_INLINE __inline -#define APR_HAS_INLINE 1 +#define APR_HAS_INLINE 1 #ifndef __attribute__ #define __attribute__(__x) #endif @@ -103,10 +103,10 @@ #define __attribute__(__x) #endif #define APR_INLINE -#define APR_HAS_INLINE 0 +#define APR_HAS_INLINE 0 #else #define APR_INLINE __inline__ -#define APR_HAS_INLINE 1 +#define APR_HAS_INLINE 1 #endif #ifdef _WIN32_WCE @@ -160,8 +160,8 @@ /** @} */ /** @} */ -/* We don't include our conditional headers within the doxyblocks - * or the extern "C" namespace +/* We don't include our conditional headers within the doxyblocks + * or the extern "C" namespace */ /* If windows.h was already included, our preferences don't matter. @@ -188,7 +188,7 @@ #define NOIME #endif -/* Impossible to include winsock2.h after winsock.h, while windows.h +/* Impossible to include winsock2.h after winsock.h, while windows.h * attempts to load winsock. Setting _WINSOCKAPI_ will dodge this. */ #if APR_HAVE_WINSOCK2_H @@ -253,7 +253,7 @@ extern "C" { /** * @addtogroup apr_platform - * @ingroup APR + * @ingroup APR * @{ */ @@ -273,12 +273,12 @@ extern "C" { #define APR_USE_SHMEM_MMAP_ANON 0 #define APR_USE_SHMEM_BEOS 0 -#define APR_USE_FLOCK_SERIALIZE 0 +#define APR_USE_FLOCK_SERIALIZE 0 #define APR_USE_SYSVSEM_SERIALIZE 0 #define APR_USE_POSIXSEM_SERIALIZE 0 #define APR_USE_FCNTL_SERIALIZE 0 -#define APR_USE_PROC_PTHREAD_SERIALIZE 0 -#define APR_USE_PTHREAD_SERIALIZE 0 +#define APR_USE_PROC_PTHREAD_SERIALIZE 0 +#define APR_USE_PTHREAD_SERIALIZE 0 #define APR_HAS_FLOCK_SERIALIZE 0 #define APR_HAS_SYSVSEM_SERIALIZE 0 @@ -397,7 +397,7 @@ typedef apr_uint32_t apr_uintptr_t; /* Are we big endian? */ /* XXX: Fatal assumption on Alpha platforms */ -#define APR_IS_BIGENDIAN 0 +#define APR_IS_BIGENDIAN 0 /* Mechanisms to properly type numeric literals */ @@ -478,8 +478,8 @@ typedef apr_uint32_t apr_uintptr_t; #define APR_END_DECLS #endif -/** - * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, +/** + * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, * so that they follow the platform's calling convention. *
      *
    @@ -494,7 +494,7 @@ typedef  apr_uint32_t            apr_uintptr_t;
     
     /**
      * The public APR functions are declared with APR_DECLARE(), so they may
    - * use the most appropriate calling convention.  Public APR functions with 
    + * use the most appropriate calling convention.  Public APR functions with
      * variable arguments must use APR_DECLARE_NONSTD().
      *
      * @remark Both the declaration and implementations must use the same macro.
    @@ -503,20 +503,20 @@ typedef  apr_uint32_t            apr_uintptr_t;
      * APR_DECLARE(rettype) apr_func(args)
      * 
    * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA - * @remark Note that when APR compiles the library itself, it passes the - * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) + * @remark Note that when APR compiles the library itself, it passes the + * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) * to export public symbols from the dynamic library build.\n * The user must define the APR_DECLARE_STATIC when compiling to target - * the static APR library on some platforms (e.g. Win32.) The public symbols + * the static APR library on some platforms (e.g. Win32.) The public symbols * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n * By default, compiling an application and including the APR public * headers, without defining APR_DECLARE_STATIC, will prepare the code to be * linked to the dynamic library. */ -#define APR_DECLARE(type) type +#define APR_DECLARE(type) type /** - * The public APR functions using variable arguments are declared with + * The public APR functions using variable arguments are declared with * APR_DECLARE_NONSTD(), as they must follow the C language calling convention. * @see APR_DECLARE @see APR_DECLARE_DATA * @remark Both the declaration and implementations must use the same macro. @@ -534,7 +534,7 @@ typedef apr_uint32_t apr_uintptr_t; * @see APR_DECLARE @see APR_DECLARE_NONSTD * @remark Note that the declaration and implementations use different forms, * but both must include the macro. - * + * *
      *
      * extern APR_DECLARE_DATA type apr_variable;\n
    @@ -562,7 +562,7 @@ typedef  apr_uint32_t            apr_uintptr_t;
     /**
      * Declare a dso module's exported module structure as APR_MODULE_DECLARE_DATA.
      *
    - * Unless APR_MODULE_DECLARE_STATIC is defined at compile time, symbols 
    + * Unless APR_MODULE_DECLARE_STATIC is defined at compile time, symbols
      * declared with APR_MODULE_DECLARE_DATA are always exported.
      * @code
      * module APR_MODULE_DECLARE_DATA mod_tag
    @@ -579,7 +579,7 @@ typedef  apr_uint32_t            apr_uintptr_t;
      */
     #define APU_MODULE_DECLARE_DATA           APR_MODULE_DECLARE_DATA
     
    -/* Define APR_SSIZE_T_FMT.  
    +/* Define APR_SSIZE_T_FMT.
      * If ssize_t is an integer we define it to be "d",
      * if ssize_t is a long int we define it to be "ld",
      * if ssize_t is 64-bit, we define it to be msvc specific "I64d"
    @@ -636,7 +636,7 @@ typedef int apr_wait_t;
     #endif
     #endif
     
    -/* 
    +/*
      * we always enable dynamic driver loads within apr_dbd
      * driver builds enable these flags individually
      */
    
    From 8c383d53b89bae9b0b0cc4a6e615351628e0cd48 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Mon, 9 Aug 2010 12:51:29 +0000
    Subject: [PATCH 6805/7878] * network_io/unix/sockets.c (apr_socket_connect):
     Copy the remote   address by value rather than by reference.  This ensures
     that the   sockaddr object returned by apr_socket_addr_get is allocated from 
      the same pool as the socket object itself, as apr_socket_accept   does;
     avoiding any potential lifetime mismatches.
    
    * test/testsock.c (test_get_addr): Enhance test case to cover this.
    
    PR: 49713
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@983618 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sockets.c |  9 ++++++---
     test/testsock.c           | 35 +++++++++++++++++++++++++++++------
     2 files changed, 35 insertions(+), 9 deletions(-)
    
    diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c
    index 3523c95f573..13d3ecb0cf2 100644
    --- a/network_io/unix/sockets.c
    +++ b/network_io/unix/sockets.c
    @@ -387,10 +387,13 @@ apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
             /* A real remote address was passed in.  If the unspecified
              * address was used, the actual remote addr will have to be
              * determined using getpeername() if required. */
    -        /* ### this should probably be a structure copy + fixup as per
    -         * _accept()'s handling of local_addr */
    -        sock->remote_addr = sa;
             sock->remote_addr_unknown = 0;
    +
    +        /* Copy the address structure details in. */
    +        sock->remote_addr->sa = sa->sa;
    +        sock->remote_addr->salen = sa->salen;
    +        /* Adjust ipaddr_ptr et al. */
    +        apr_sockaddr_vars_set(sock->remote_addr, sa->family, sa->port);
         }
     
         if (sock->local_addr->port == 0) {
    diff --git a/test/testsock.c b/test/testsock.c
    index ea2c885f837..425872cb505 100644
    --- a/test/testsock.c
    +++ b/test/testsock.c
    @@ -334,8 +334,11 @@ static void test_get_addr(abts_case *tc, void *data)
         apr_status_t rv;
         apr_socket_t *ld, *sd, *cd;
         apr_sockaddr_t *sa, *ca;
    +    apr_pool_t *subp;
         char *a, *b;
     
    +    APR_ASSERT_SUCCESS(tc, "create subpool", apr_pool_create(&subp, p));
    +
         ld = setup_socket(tc);
     
         APR_ASSERT_SUCCESS(tc,
    @@ -343,7 +346,7 @@ static void test_get_addr(abts_case *tc, void *data)
                            apr_socket_addr_get(&sa, APR_LOCAL, ld));
     
         rv = apr_socket_create(&cd, sa->family, SOCK_STREAM,
    -                           APR_PROTO_TCP, p);
    +                           APR_PROTO_TCP, subp);
         APR_ASSERT_SUCCESS(tc, "create client socket", rv);
     
         APR_ASSERT_SUCCESS(tc, "enable non-block mode",
    @@ -369,7 +372,7 @@ static void test_get_addr(abts_case *tc, void *data)
         }
     
         APR_ASSERT_SUCCESS(tc, "accept connection",
    -                       apr_socket_accept(&sd, ld, p));
    +                       apr_socket_accept(&sd, ld, subp));
         
         {
             /* wait for writability */
    @@ -389,18 +392,38 @@ static void test_get_addr(abts_case *tc, void *data)
     
         APR_ASSERT_SUCCESS(tc, "get local address of server socket",
                            apr_socket_addr_get(&sa, APR_LOCAL, sd));
    -
         APR_ASSERT_SUCCESS(tc, "get remote address of client socket",
                            apr_socket_addr_get(&ca, APR_REMOTE, cd));
    -    
    -    a = apr_psprintf(p, "%pI", sa);
    -    b = apr_psprintf(p, "%pI", ca);
     
    +    /* Test that the pool of the returned sockaddr objects exactly
    +     * match the socket. */
    +    ABTS_PTR_EQUAL(tc, subp, sa->pool);
    +    ABTS_PTR_EQUAL(tc, subp, ca->pool);
    +
    +    /* Check equivalence. */
    +    a = apr_psprintf(p, "%pI fam=%d", sa, sa->family);
    +    b = apr_psprintf(p, "%pI fam=%d", ca, ca->family);
         ABTS_STR_EQUAL(tc, a, b);
    +
    +    /* Check pool of returned sockaddr, as above. */
    +    APR_ASSERT_SUCCESS(tc, "get local address of client socket",
    +                       apr_socket_addr_get(&sa, APR_LOCAL, cd));
    +    APR_ASSERT_SUCCESS(tc, "get remote address of server socket",
    +                       apr_socket_addr_get(&ca, APR_REMOTE, sd));
    +
    +    /* Check equivalence. */
    +    a = apr_psprintf(p, "%pI fam=%d", sa, sa->family);
    +    b = apr_psprintf(p, "%pI fam=%d", ca, ca->family);
    +    ABTS_STR_EQUAL(tc, a, b);
    +
    +    ABTS_PTR_EQUAL(tc, subp, sa->pool);
    +    ABTS_PTR_EQUAL(tc, subp, ca->pool);
                            
         apr_socket_close(cd);
         apr_socket_close(sd);
         apr_socket_close(ld);
    +
    +    apr_pool_destroy(subp);
     }
     
     static void test_wait(abts_case *tc, void *data)
    
    From cb6cf7ef8ea94242971bdb56356d36af735e8361 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 20 Aug 2010 21:26:37 +0000
    Subject: [PATCH 6806/7878] disable entire impl_pollcb_create() function if
     APR_HAS_THREADS instead of just inserting a return at the top
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@987639 13f79535-47bb-0310-9956-ffa450edef68
    ---
     poll/unix/poll.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/poll/unix/poll.c b/poll/unix/poll.c
    index 8d2517e5f42..1fe9b91d43c 100644
    --- a/poll/unix/poll.c
    +++ b/poll/unix/poll.c
    @@ -307,8 +307,7 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb,
     {
     #if APR_HAS_THREADS
         return APR_ENOTIMPL;
    -#endif
    -
    +#else
         pollcb->fd = -1;
     #ifdef WIN32
         if (!APR_HAVE_LATE_DLL_FUNC(WSAPoll)) {
    @@ -320,6 +319,7 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb,
         pollcb->copyset = apr_palloc(p, size * sizeof(apr_pollfd_t *));
     
         return APR_SUCCESS;
    +#endif
     }
     
     static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb,
    
    From 07f22768919e38f0691c56fe27867ea71997ad89 Mon Sep 17 00:00:00 2001
    From: Mladen Turk 
    Date: Thu, 26 Aug 2010 05:02:33 +0000
    Subject: [PATCH 6807/7878] Loop if the recv gets WSAEWOULDBLOCK
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@989443 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/pipe.c | 7 +++++--
     1 file changed, 5 insertions(+), 2 deletions(-)
    
    diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c
    index dbf264589ff..dc05a014b68 100644
    --- a/file_io/win32/pipe.c
    +++ b/file_io/win32/pipe.c
    @@ -321,7 +321,11 @@ static apr_status_t create_socket_pipe(SOCKET *rd, SOCKET *wr)
             }
             /* Verify the connection by reading the send identification.
              */
    -        nrd = recv(*rd, (char *)iid, sizeof(iid), 0);
    +        do {
    +            nrd = recv(*rd, (char *)iid, sizeof(iid), 0);
    +            rv = nrd == SOCKET_ERROR ? apr_get_netos_error() : APR_SUCCESS;
    +        } while (APR_STATUS_IS_EAGAIN(rv));
    +
             if (nrd == sizeof(iid)) {
                 if (memcmp(uid, iid, sizeof(uid)) == 0) {
                     /* Wow, we recived what we send.
    @@ -337,7 +341,6 @@ static apr_status_t create_socket_pipe(SOCKET *rd, SOCKET *wr)
                 }
             }
             else if (nrd == SOCKET_ERROR) {
    -            rv =  apr_get_netos_error();
                 goto cleanup;
             }
             closesocket(*rd);
    
    From ae9ce8aae8efd0f7a483ae6e3eaea4c13d28e66c Mon Sep 17 00:00:00 2001
    From: Mladen Turk 
    Date: Thu, 26 Aug 2010 06:10:54 +0000
    Subject: [PATCH 6808/7878] Add Windows 7 to the list of detected versions
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@989450 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/win32/apr_arch_misc.h | 3 ++-
     misc/win32/misc.c                  | 5 ++++-
     2 files changed, 6 insertions(+), 2 deletions(-)
    
    diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h
    index d1763ca3b8e..75d7327c0f4 100644
    --- a/include/arch/win32/apr_arch_misc.h
    +++ b/include/arch/win32/apr_arch_misc.h
    @@ -104,7 +104,8 @@ typedef enum {
             APR_WIN_XP_SP1 =   61,
             APR_WIN_XP_SP2 =   62,
             APR_WIN_2003 =     70,
    -        APR_WIN_VISTA =    80
    +        APR_WIN_VISTA =    80,
    +        APR_WIN_7  =       90
     } apr_oslevel_e;
     
     extern APR_DECLARE_DATA apr_oslevel_e apr_os_level;
    diff --git a/misc/win32/misc.c b/misc/win32/misc.c
    index 8c3cb916c2c..9651561285f 100644
    --- a/misc/win32/misc.c
    +++ b/misc/win32/misc.c
    @@ -98,7 +98,10 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level)
                     }
                 }
                 else if (oslev.dwMajorVersion == 6) {
    -                apr_os_level = APR_WIN_VISTA;
    +                if (oslev.dwMinorVersion == 0)
    +                    apr_os_level = APR_WIN_VISTA;
    +                else
    +                    apr_os_level = APR_WIN_7;
                 }
                 else {
                     apr_os_level = APR_WIN_XP;
    
    From 4ad1f884074abc290a170aeefce3dd2dd0a13200 Mon Sep 17 00:00:00 2001
    From: Mladen Turk 
    Date: Thu, 26 Aug 2010 12:21:52 +0000
    Subject: [PATCH 6809/7878] Don't consume too much CPU while reading data
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@989639 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/pipe.c | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c
    index dc05a014b68..51da70801b3 100644
    --- a/file_io/win32/pipe.c
    +++ b/file_io/win32/pipe.c
    @@ -295,6 +295,7 @@ static apr_status_t create_socket_pipe(SOCKET *rd, SOCKET *wr)
         }
         for (;;) {
             int ns;
    +        int nc = 0;
             /* Listening socket is nonblocking by now.
              * The accept should create the socket
              * immediatelly because we are connected already.
    @@ -322,6 +323,8 @@ static apr_status_t create_socket_pipe(SOCKET *rd, SOCKET *wr)
             /* Verify the connection by reading the send identification.
              */
             do {
    +            if (nc++)
    +                Sleep(1);
                 nrd = recv(*rd, (char *)iid, sizeof(iid), 0);
                 rv = nrd == SOCKET_ERROR ? apr_get_netos_error() : APR_SUCCESS;
             } while (APR_STATUS_IS_EAGAIN(rv));
    
    From 48a7f98504fdf392cad77da7b53a9a89a2a2a834 Mon Sep 17 00:00:00 2001
    From: Stefan Fritsch 
    Date: Sat, 28 Aug 2010 20:06:50 +0000
    Subject: [PATCH 6810/7878] re-commit r761344 which was accidentally reverted
     by r795598:
    
    Author: Mladen Turk 
    Date:   Thu Apr 2 16:58:40 2009 +0000
    
        Both cleanup and pre_cleanup can share the same free list.
        Axe the free_pre_cleanups and use free_cleanups for both
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@990431 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_pools.c | 16 +++++-----------
     1 file changed, 5 insertions(+), 11 deletions(-)
    
    diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
    index 08b43fba0db..e9be1d438f3 100644
    --- a/memory/unix/apr_pools.c
    +++ b/memory/unix/apr_pools.c
    @@ -505,7 +505,6 @@ struct apr_pool_t {
         apr_os_proc_t         owner_proc;
     #endif /* defined(NETWARE) */
         cleanup_t            *pre_cleanups;
    -    cleanup_t            *free_pre_cleanups;
     };
     
     #define SIZEOF_POOL_T       APR_ALIGN_DEFAULT(sizeof(apr_pool_t))
    @@ -726,7 +725,6 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool)
         /* Run pre destroy cleanups */
         run_cleanups(&pool->pre_cleanups);
         pool->pre_cleanups = NULL;
    -    pool->free_pre_cleanups = NULL;
     
         /* Destroy the subpools.  The subpools will detach themselves from
          * this pool thus this loop is safe and easy.
    @@ -769,7 +767,6 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool)
         /* Run pre destroy cleanups */
         run_cleanups(&pool->pre_cleanups);
         pool->pre_cleanups = NULL;
    -    pool->free_pre_cleanups = NULL;
     
         /* Destroy the subpools.  The subpools will detach themselve from
          * this pool thus this loop is safe and easy.
    @@ -876,7 +873,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool,
         pool->cleanups = NULL;
         pool->free_cleanups = NULL;
         pool->pre_cleanups = NULL;
    -    pool->free_pre_cleanups = NULL;
         pool->subprocesses = NULL;
         pool->user_data = NULL;
         pool->tag = NULL;
    @@ -962,7 +958,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool,
         pool->cleanups = NULL;
         pool->free_cleanups = NULL;
         pool->pre_cleanups = NULL;
    -    pool->free_pre_cleanups = NULL;
         pool->subprocesses = NULL;
         pool->user_data = NULL;
         pool->tag = NULL;
    @@ -1499,7 +1494,6 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line)
         /* Run pre destroy cleanups */
         run_cleanups(&pool->pre_cleanups);
         pool->pre_cleanups = NULL;
    -    pool->free_pre_cleanups = NULL;
     
         /* Destroy the subpools.  The subpools will detach themselves from
          * this pool thus this loop is safe and easy.
    @@ -2184,10 +2178,10 @@ APR_DECLARE(void) apr_pool_pre_cleanup_register(apr_pool_t *p, const void *data,
     #endif /* APR_POOL_DEBUG */
     
         if (p != NULL) {
    -        if (p->free_pre_cleanups) {
    +        if (p->free_cleanups) {
                 /* reuse a cleanup structure */
    -            c = p->free_pre_cleanups;
    -            p->free_pre_cleanups = c->next;
    +            c = p->free_cleanups;
    +            p->free_cleanups = c->next;
             } else {
                 c = apr_palloc(p, sizeof(cleanup_t));
             }
    @@ -2250,8 +2244,8 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data,
             if (c->data == data && c->plain_cleanup_fn == cleanup_fn) {
                 *lastp = c->next;
                 /* move to freelist */
    -            c->next = p->free_pre_cleanups;
    -            p->free_pre_cleanups = c;
    +            c->next = p->free_cleanups;
    +            p->free_cleanups = c;
                 break;
             }
     
    
    From efa70e6393d257a10a8c23a59837a01c5dc32d66 Mon Sep 17 00:00:00 2001
    From: Stefan Fritsch 
    Date: Sat, 28 Aug 2010 20:11:57 +0000
    Subject: [PATCH 6811/7878] Fix various off-by-one errors related to
     current_free_index: current_free_index counts pages of size BOUNDARY_SIZE,
     but every node contains index + 1 of such pages
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@990435 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_pools.c | 14 +++++++-------
     1 file changed, 7 insertions(+), 7 deletions(-)
    
    diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
    index e9be1d438f3..ca76db33eb6 100644
    --- a/memory/unix/apr_pools.c
    +++ b/memory/unix/apr_pools.c
    @@ -259,7 +259,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size)
                     allocator->max_index = max_index;
                 }
     
    -            allocator->current_free_index += node->index;
    +            allocator->current_free_index += node->index + 1;
                 if (allocator->current_free_index > allocator->max_free_index)
                     allocator->current_free_index = allocator->max_free_index;
     
    @@ -299,7 +299,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size)
             if (node) {
                 *ref = node->next;
     
    -            allocator->current_free_index += node->index;
    +            allocator->current_free_index += node->index + 1;
                 if (allocator->current_free_index > allocator->max_free_index)
                     allocator->current_free_index = allocator->max_free_index;
     
    @@ -358,7 +358,7 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node)
             index = node->index;
     
             if (max_free_index != APR_ALLOCATOR_MAX_FREE_UNLIMITED
    -            && index > current_free_index) {
    +            && index + 1 > current_free_index) {
                 node->next = freelist;
                 freelist = node;
             }
    @@ -371,8 +371,8 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node)
                     max_index = index;
                 }
                 allocator->free[index] = node;
    -            if (current_free_index >= index)
    -                current_free_index -= index;
    +            if (current_free_index >= index + 1)
    +                current_free_index -= index + 1;
                 else
                     current_free_index = 0;
             }
    @@ -382,8 +382,8 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node)
                  */
                 node->next = allocator->free[0];
                 allocator->free[0] = node;
    -            if (current_free_index >= index)
    -                current_free_index -= index;
    +            if (current_free_index >= index + 1)
    +                current_free_index -= index + 1;
                 else
                     current_free_index = 0;
             }
    
    From 50ffd957cb2a685a2270391d0f116d6e05bf1a29 Mon Sep 17 00:00:00 2001
    From: Guenter Knauf 
    Date: Wed, 1 Sep 2010 18:50:04 +0000
    Subject: [PATCH 6812/7878] Removed tabs.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@991647 13f79535-47bb-0310-9956-ffa450edef68
    ---
     threadproc/netware/proc.c | 12 ++++++------
     1 file changed, 6 insertions(+), 6 deletions(-)
    
    diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c
    index 7efa7f84e89..c5e341b8f56 100644
    --- a/threadproc/netware/proc.c
    +++ b/threadproc/netware/proc.c
    @@ -36,7 +36,7 @@ apr_status_t apr_netware_proc_cleanup(void *theproc)
             waitpid(proc->pid, &exit_int, waitpid_options);
         }
     
    -/*	NXVmDestroy(proc->pid); */
    +/* NXVmDestroy(proc->pid); */
         return APR_SUCCESS;
     }
     
    @@ -307,11 +307,11 @@ APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr,
     }
     
     APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc,
    -									const char *progname, 
    -									const char * const *args, 
    -									const char * const *env,
    -                              		apr_procattr_t *attr, 
    -                              		apr_pool_t *pool)
    +                                          const char *progname, 
    +                                          const char * const *args, 
    +                                          const char * const *env,
    +                                          apr_procattr_t *attr, 
    +                                          apr_pool_t *pool)
     {
         wiring_t wire;
         int      addr_space;
    
    From 722ab8a48ddfe0630967772cf92a6de01319c883 Mon Sep 17 00:00:00 2001
    From: Guenter Knauf 
    Date: Wed, 1 Sep 2010 18:52:42 +0000
    Subject: [PATCH 6813/7878] Added require prototypes conditionally to CFLAGS
     for NetWare.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@991649 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/NWGNUenvironment.inc | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc
    index eb28c41502b..259c5245818 100644
    --- a/build/NWGNUenvironment.inc
    +++ b/build/NWGNUenvironment.inc
    @@ -193,6 +193,10 @@ PLIB3S	= $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP
     
     CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII
     
    +ifeq "$(REQUIRE_PROTOTYPES)" "1"
    +CFLAGS += -r
    +endif
    +
     # -g                    generate debugging information
     # -O0                   level 0 optimizations
     
    
    From 0da59895a9f4ed9a165045dcbf16ededc2f91794 Mon Sep 17 00:00:00 2001
    From: Guenter Knauf 
    Date: Wed, 1 Sep 2010 23:05:12 +0000
    Subject: [PATCH 6814/7878] Make functions static.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@991753 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/win32/sockopt.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c
    index c8e670fa79e..b654e8b4050 100644
    --- a/network_io/win32/sockopt.c
    +++ b/network_io/win32/sockopt.c
    @@ -20,7 +20,7 @@
     #include "apr_strings.h"
     #include 
     
    -apr_status_t soblock(SOCKET sd)
    +static apr_status_t soblock(SOCKET sd)
     {
         u_long zero = 0;
     
    @@ -30,7 +30,7 @@ apr_status_t soblock(SOCKET sd)
         return APR_SUCCESS;
     }
     
    -apr_status_t sononblock(SOCKET sd)
    +static apr_status_t sononblock(SOCKET sd)
     {
         u_long one = 1;
     
    
    From 32e426e15d092519786a0f9fdaca3e4714bc3091 Mon Sep 17 00:00:00 2001
    From: Guenter Knauf 
    Date: Wed, 1 Sep 2010 23:07:29 +0000
    Subject: [PATCH 6815/7878] Include alloca.h to get compiler-dependent defines.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@991754 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/netware/apr_private.h | 6 ++++++
     1 file changed, 6 insertions(+)
    
    diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h
    index 3cb4dd009fc..1552655b338 100644
    --- a/include/arch/netware/apr_private.h
    +++ b/include/arch/netware/apr_private.h
    @@ -31,9 +31,13 @@
     /* Pick up privately consumed headers */
     #include 
     
    +/* Include alloca.h to get compiler-dependent defines */ 
    +#include 
    +
     /* Use this section to define all of the HAVE_FOO_H
      * that are required to build properly.
      */
    +#define HAVE_ALLOCA_H   1
     #define HAVE_DLFCN_H    1
     #define HAVE_LIMITS_H   1
     #define HAVE_SIGNAL_H   1
    @@ -163,7 +167,9 @@ void* getStatCache();
         and can be shared by the library. */
     #undef malloc
     #define malloc(x) library_malloc(gLibHandle,x)
    +#ifndef __MWERKS__
     #define _alloca alloca
    +#endif
     
     #if APR_HAS_LARGE_FILES
     #define APR_OFF_T_STRFN       strtoll
    
    From 2619a110efdd1080e3713aa958f8bae7a1ef0156 Mon Sep 17 00:00:00 2001
    From: Stefan Fritsch 
    Date: Fri, 10 Sep 2010 16:43:49 +0000
    Subject: [PATCH 6816/7878] Correctly document the handling of trailing \0
     characters
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@995861 13f79535-47bb-0310-9956-ffa450edef68
    ---
     encoding/apr_base64.c |  5 +++--
     include/apr_base64.h  | 41 ++++++++++++++++++++++++++---------------
     2 files changed, 29 insertions(+), 17 deletions(-)
    
    diff --git a/encoding/apr_base64.c b/encoding/apr_base64.c
    index 533859130cf..d553631dc31 100644
    --- a/encoding/apr_base64.c
    +++ b/encoding/apr_base64.c
    @@ -139,8 +139,9 @@ APR_DECLARE(int) apr_base64_decode(char *bufplain, const char *bufcoded)
         return len;
     }
     
    -/* This is the same as apr_base64_decode() except on EBCDIC machines, where
    - * the conversion of the output to ebcdic is left out.
    +/* This is the same as apr_base64_decode() except:
    + * - no \0 is appended
    + * - on EBCDIC machines, the conversion of the output to ebcdic is left out
      */
     APR_DECLARE(int) apr_base64_decode_binary(unsigned char *bufplain,
     				   const char *bufcoded)
    diff --git a/include/apr_base64.h b/include/apr_base64.h
    index 29f4866969b..6ba5d94f17a 100644
    --- a/include/apr_base64.h
    +++ b/include/apr_base64.h
    @@ -43,10 +43,10 @@ extern "C" {
      * the incoming plain source. And return the length of what we decoded.
      *
      * The decoding function takes any non valid char (i.e. whitespace, \0
    - * or anything non A-Z,0-9 etc as terminal.
    + * or anything non A-Z,0-9 etc) as terminal.
      * 
    - * plain strings/binary sequences are not assumed '\0' terminated. Encoded
    - * strings are neither. But probably should.
    + * The handling of terminating \0 characters differs from function to
    + * function.
      *
      */
     
    @@ -54,26 +54,32 @@ extern "C" {
      * Given the length of an un-encrypted string, get the length of the 
      * encrypted string.
      * @param len the length of an unencrypted string.
    - * @return the length of the string after it is encrypted
    + * @return the length of the string after it is encrypted, including the
    + * trailing \0
      */ 
     APR_DECLARE(int) apr_base64_encode_len(int len);
     
     /**
    - * Encode a text string using base64encoding.
    - * @param coded_dst The destination string for the encoded string.
    + * Encode a text string using base64encoding. On EBCDIC machines, the input
    + * is first converted to ASCII.
    + * @param coded_dst The destination string for the encoded string. A \0 is
    + * appended.
      * @param plain_src The original string in plain text
      * @param len_plain_src The length of the plain text string
    - * @return the length of the encoded string
    + * @return the length of the encoded string, including the trailing \0
      */ 
     APR_DECLARE(int) apr_base64_encode(char * coded_dst, const char *plain_src, 
                                      int len_plain_src);
     
     /**
    - * Encode an EBCDIC string using base64encoding.
    - * @param coded_dst The destination string for the encoded string.
    + * Encode an text string using base64encoding. This is the same as
    + * apr_base64_encode() except on EBCDIC machines, where the conversion of the
    + * input to ASCII is left out.
    + * @param coded_dst The destination string for the encoded string. A \0 is
    + * appended.
      * @param plain_src The original string in plain text
      * @param len_plain_src The length of the plain text string
    - * @return the length of the encoded string
    + * @return the length of the encoded string, including the trailing \0
      */ 
     APR_DECLARE(int) apr_base64_encode_binary(char * coded_dst, 
                                             const unsigned char *plain_src,
    @@ -88,16 +94,21 @@ APR_DECLARE(int) apr_base64_encode_binary(char * coded_dst,
     APR_DECLARE(int) apr_base64_decode_len(const char * coded_src);
     
     /**
    - * Decode a string to plain text
    - * @param plain_dst The destination string for the plain text
    + * Decode a string to plain text. On EBCDIC machines, the result is then
    + * converted to EBCDIC.
    + * @param plain_dst The destination string for the plain text. A \0 is
    + * appended.
      * @param coded_src The encoded string 
    - * @return the length of the plain text string
    + * @return the length of the plain text string (excluding the trailing \0)
      */ 
     APR_DECLARE(int) apr_base64_decode(char * plain_dst, const char *coded_src);
     
     /**
    - * Decode an EBCDIC string to plain text
    - * @param plain_dst The destination string for the plain text
    + * Decode an string to plain text. This is the same as apr_base64_decode()
    + * except no \0 is appended and on EBCDIC machines, the conversion of the
    + * output to EBCDIC is left out.
    + * @param plain_dst The destination string for the plain text. The string is
    + * not \0-terminated.
      * @param coded_src The encoded string 
      * @return the length of the plain text string
      */ 
    
    From fb593ea6b993c81074cf368072706c4b95a5bccb Mon Sep 17 00:00:00 2001
    From: Stefan Fritsch 
    Date: Fri, 10 Sep 2010 16:51:32 +0000
    Subject: [PATCH 6817/7878] mark apr_brigade_putstrs() with attribute sentinel
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@995864 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_buckets.h | 8 ++++++--
     1 file changed, 6 insertions(+), 2 deletions(-)
    
    diff --git a/include/apr_buckets.h b/include/apr_buckets.h
    index 18453ce795a..d3ef9bc2336 100644
    --- a/include/apr_buckets.h
    +++ b/include/apr_buckets.h
    @@ -873,12 +873,16 @@ APR_DECLARE(apr_status_t) apr_brigade_putc(apr_bucket_brigade *b,
      * @param b The bucket brigade to add to
      * @param flush The flush function to use if the brigade is full
      * @param ctx The structure to pass to the flush function
    - * @param ... The strings to add
    + * @param ... The strings to add. The final string must be NULL
      * @return APR_SUCCESS or error code
      */
     APR_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b,
                                                          apr_brigade_flush flush,
    -                                                     void *ctx, ...);
    +                                                     void *ctx, ...)
    +#if defined(__GNUC__) && __GNUC__ >= 4
    +    __attribute__((sentinel))
    +#endif
    +    ;
     
     /**
      * Evaluate a printf and put the resulting string at the end 
    
    From 3e833d02d26ff79675aaebcee1df96fdd1390d91 Mon Sep 17 00:00:00 2001
    From: Stefan Fritsch 
    Date: Sat, 18 Sep 2010 20:14:42 +0000
    Subject: [PATCH 6818/7878] No need to clear 128k of memory because of bugs
     that have been fixed 8 years ago.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@998533 13f79535-47bb-0310-9956-ffa450edef68
    ---
     crypto/apr_md5.c | 11 +++++++----
     1 file changed, 7 insertions(+), 4 deletions(-)
    
    diff --git a/crypto/apr_md5.c b/crypto/apr_md5.c
    index 92d8728cc06..d618a459b93 100644
    --- a/crypto/apr_md5.c
    +++ b/crypto/apr_md5.c
    @@ -754,12 +754,15 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd,
     #elif defined(CRYPT_R_STRUCT_CRYPT_DATA)
             struct crypt_data buffer;
     
    -        /* having to clear this seems bogus... GNU doc is
    -         * confusing...  user report found from google says
    -         * the crypt_data struct had to be cleared to get
    -         * the same result as plain crypt()
    +#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,4)
    +        buffer.initialized = 0;
    +#else
    +        /*
    +         * glibc before 2.3.2 had a bug that required clearing the
    +         * whole struct
              */
             memset(&buffer, 0, sizeof(buffer));
    +#endif
             crypt_pw = crypt_r(passwd, hash, &buffer);
             if (!crypt_pw) {
                 return APR_EMISMATCH;
    
    From 9e4cd3f14007e98defa118a28d31cb637161c031 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 24 Sep 2010 12:59:16 +0000
    Subject: [PATCH 6819/7878] update apr_reslist_create() doc to reflect that ttl
     is honored absolutely and smax has a more subtle role
    
    Reviewed by: rpleum
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1000850 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_reslist.h | 10 ++++++----
     1 file changed, 6 insertions(+), 4 deletions(-)
    
    diff --git a/include/apr_reslist.h b/include/apr_reslist.h
    index 89577692599..4c90df89070 100644
    --- a/include/apr_reslist.h
    +++ b/include/apr_reslist.h
    @@ -69,11 +69,13 @@ typedef apr_status_t (*apr_reslist_destructor)(void *resource, void *params,
      *                list will be stored.
      * @param min Allowed minimum number of available resources. Zero
      *            creates new resources only when needed.
    - * @param smax Resources will be destroyed to meet this maximum
    - *             restriction as they expire.
    + * @param smax Resources will be destroyed during reslist maintenance to
    + *             meet this maximum restriction as they expire (reach their ttl).
      * @param hmax Absolute maximum limit on the number of total resources.
    - * @param ttl If non-zero, sets the maximum amount of time in microseconds a
    - *            resource may be available while exceeding the soft limit.
    + * @param ttl If non-zero, sets the maximum amount of time in microseconds an
    + *            unused resource is valid.  Any resource which has exceeded this
    + *            time will be destroyed, either when encountered by
    + *            apr_reslist_acquire() or during reslist maintenance.
      * @param con Constructor routine that is called to create a new resource.
      * @param de Destructor routine that is called to destroy an expired resource.
      * @param params Passed to constructor and deconstructor
    
    From 0d37decb737141839b3de1e45a07cb52d6f3a16a Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 24 Sep 2010 21:01:14 +0000
    Subject: [PATCH 6820/7878] DBD ODBC support: Fix memory corruption using
     apr_dbd_datum_get() with several different data types, including
     APR_DBD_TYPE_TIME.
    
    PR: 49645
    Submitted by: 
    Reviewed by: trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1001073 13f79535-47bb-0310-9956-ffa450edef68
    ---
     dbd/apr_dbd_odbc.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c
    index 7d6753bee0c..f4316cdf3ff 100644
    --- a/dbd/apr_dbd_odbc.c
    +++ b/dbd/apr_dbd_odbc.c
    @@ -1323,7 +1323,7 @@ static apr_status_t odbc_datum_get(const apr_dbd_row_t * row, int col,
             return APR_ENOENT;          /* SQL NULL value */
         
         if (len < 0)
    -        strcpy(data, p);
    +       *(char**)data = (char *)p;
         else
             memcpy(data, p, len);
         
    
    From db5dc000c6338303f837ad2ad6387d61e76226b0 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 24 Sep 2010 21:02:03 +0000
    Subject: [PATCH 6821/7878] fix compiler warning for non-static function with
     no prototype
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1001074 13f79535-47bb-0310-9956-ffa450edef68
    ---
     dbd/apr_dbd_odbc.c | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c
    index f4316cdf3ff..7481458b7d9 100644
    --- a/dbd/apr_dbd_odbc.c
    +++ b/dbd/apr_dbd_odbc.c
    @@ -1451,9 +1451,9 @@ static int odbc_pvquery(apr_pool_t * pool, apr_dbd_t * handle, int *nrows,
     }
     
     /** pselect: select using a prepared statement + args **/
    -int odbc_pselect(apr_pool_t * pool, apr_dbd_t * handle,
    -                 apr_dbd_results_t ** res, apr_dbd_prepared_t * statement,
    -                 int random, const char **args)
    +static int odbc_pselect(apr_pool_t * pool, apr_dbd_t * handle,
    +                        apr_dbd_results_t ** res, apr_dbd_prepared_t * statement,
    +                        int random, const char **args)
     {
         SQLRETURN rc = SQL_SUCCESS;
         int i, argp;
    
    From 6c249b6688361ad27d328acf5208aedec3728a5f Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 27 Sep 2010 11:57:17 +0000
    Subject: [PATCH 6822/7878] apr_thread_pool_create: Fix pool corruption caused
     by multithread use of the pool when multiple initial threads are created.
    
    PR: 47843
    Submitted by: Alex Korobka 
    Reviewed by: trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1001685 13f79535-47bb-0310-9956-ffa450edef68
    ---
     util-misc/apr_thread_pool.c | 6 ++++++
     1 file changed, 6 insertions(+)
    
    diff --git a/util-misc/apr_thread_pool.c b/util-misc/apr_thread_pool.c
    index 39d9330552a..6b03492ccd6 100644
    --- a/util-misc/apr_thread_pool.c
    +++ b/util-misc/apr_thread_pool.c
    @@ -377,7 +377,13 @@ APR_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t ** me,
                                   apr_pool_cleanup_null);
     
         while (init_threads) {
    +        /* Grab the mutex as apr_thread_create() and thread_pool_func() will 
    +         * allocate from (*me)->pool. This is dangerous if there are multiple 
    +         * initial threads to create.
    +         */
    +        apr_thread_mutex_lock(tp->lock);
             rv = apr_thread_create(&t, NULL, thread_pool_func, tp, tp->pool);
    +        apr_thread_mutex_unlock(tp->lock);
             if (APR_SUCCESS != rv) {
                 break;
             }
    
    From 9a02f0bd5dd49a4677a23771db07c349157be625 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 28 Sep 2010 10:37:28 +0000
    Subject: [PATCH 6823/7878] apr_thread_pool: Fix some potential deadlock
     situations.
    
    The use of two mutexes allowed race conditions between
    releasing one and acquiring another.
    
    PR: 49709
    Submitted by: Joe Mudd 
    Reviewed by: henryjen, trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1002105 13f79535-47bb-0310-9956-ffa450edef68
    ---
     util-misc/apr_thread_pool.c | 30 ++++++------------------------
     1 file changed, 6 insertions(+), 24 deletions(-)
    
    diff --git a/util-misc/apr_thread_pool.c b/util-misc/apr_thread_pool.c
    index 6b03492ccd6..9ec046077ce 100644
    --- a/util-misc/apr_thread_pool.c
    +++ b/util-misc/apr_thread_pool.c
    @@ -72,7 +72,6 @@ struct apr_thread_pool
         struct apr_thread_list *busy_thds;
         struct apr_thread_list *idle_thds;
         apr_thread_mutex_t *lock;
    -    apr_thread_mutex_t *cond_lock;
         apr_thread_cond_t *cond;
         volatile int terminated;
         struct apr_thread_pool_tasks *recycled_tasks;
    @@ -95,16 +94,9 @@ static apr_status_t thread_pool_construct(apr_thread_pool_t * me,
         if (APR_SUCCESS != rv) {
             return rv;
         }
    -    rv = apr_thread_mutex_create(&me->cond_lock, APR_THREAD_MUTEX_UNNESTED,
    -                                 me->pool);
    -    if (APR_SUCCESS != rv) {
    -        apr_thread_mutex_destroy(me->lock);
    -        return rv;
    -    }
         rv = apr_thread_cond_create(&me->cond, me->pool);
         if (APR_SUCCESS != rv) {
             apr_thread_mutex_destroy(me->lock);
    -        apr_thread_mutex_destroy(me->cond_lock);
             return rv;
         }
         me->tasks = apr_palloc(me->pool, sizeof(*me->tasks));
    @@ -148,7 +140,6 @@ static apr_status_t thread_pool_construct(apr_thread_pool_t * me,
       CATCH_ENOMEM:
         rv = APR_ENOMEM;
         apr_thread_mutex_destroy(me->lock);
    -    apr_thread_mutex_destroy(me->cond_lock);
         apr_thread_cond_destroy(me->cond);
       FINAL_EXIT:
         return rv;
    @@ -321,16 +312,12 @@ static void *APR_THREAD_FUNC thread_pool_func(apr_thread_t * t, void *param)
             else
                 wait = -1;
     
    -        apr_thread_mutex_unlock(me->lock);
    -        apr_thread_mutex_lock(me->cond_lock);
             if (wait >= 0) {
    -            rv = apr_thread_cond_timedwait(me->cond, me->cond_lock, wait);
    +            rv = apr_thread_cond_timedwait(me->cond, me->lock, wait);
             }
             else {
    -            rv = apr_thread_cond_wait(me->cond, me->cond_lock);
    +            rv = apr_thread_cond_wait(me->cond, me->lock);
             }
    -        apr_thread_mutex_unlock(me->cond_lock);
    -        apr_thread_mutex_lock(me->lock);
         }
     
         /* idle thread been asked to stop, will be joined */
    @@ -350,7 +337,6 @@ static apr_status_t thread_pool_cleanup(void *me)
             apr_sleep(20 * 1000);   /* spin lock with 20 ms */
         }
         apr_thread_mutex_destroy(_myself->lock);
    -    apr_thread_mutex_destroy(_myself->cond_lock);
         apr_thread_cond_destroy(_myself->cond);
         return APR_SUCCESS;
     }
    @@ -530,10 +516,8 @@ static apr_status_t schedule_task(apr_thread_pool_t *me,
                     me->thd_high = me->thd_cnt;
             }
         }
    -    apr_thread_mutex_unlock(me->lock);
    -    apr_thread_mutex_lock(me->cond_lock);
         apr_thread_cond_signal(me->cond);
    -    apr_thread_mutex_unlock(me->cond_lock);
    +    apr_thread_mutex_unlock(me->lock);
         return rv;
     }
     
    @@ -585,11 +569,9 @@ static apr_status_t add_task(apr_thread_pool_t *me, apr_thread_start_t func,
                     me->thd_high = me->thd_cnt;
             }
         }
    -    apr_thread_mutex_unlock(me->lock);
     
    -    apr_thread_mutex_lock(me->cond_lock);
         apr_thread_cond_signal(me->cond);
    -    apr_thread_mutex_unlock(me->cond_lock);
    +    apr_thread_mutex_unlock(me->lock);
     
         return rv;
     }
    @@ -847,9 +829,9 @@ static apr_size_t trim_idle_threads(apr_thread_pool_t *me, apr_size_t cnt)
     
         elt = trim_threads(me, &cnt, 1);
     
    -    apr_thread_mutex_lock(me->cond_lock);
    +    apr_thread_mutex_lock(me->lock);
         apr_thread_cond_broadcast(me->cond);
    -    apr_thread_mutex_unlock(me->cond_lock);
    +    apr_thread_mutex_unlock(me->lock);
     
         n_dbg = 0;
         if (NULL != (head = elt)) {
    
    From 10be61fc737c1d70556f238ada450475dac9a968 Mon Sep 17 00:00:00 2001
    From: Graham Leggett 
    Date: Fri, 1 Oct 2010 00:21:02 +0000
    Subject: [PATCH 6824/7878] Overhaul the apr_file_io.h doxygen documentation so
     to no longer reference deprecated #defines. Fix various cut and paste errors.
     Submitted by: Stefan Ruppert 
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1003338 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_file_io.h | 199 +++++++++++++++++++++++-------------------
     1 file changed, 111 insertions(+), 88 deletions(-)
    
    diff --git a/include/apr_file_io.h b/include/apr_file_io.h
    index 7cdb9bc263a..97eaf4873f5 100644
    --- a/include/apr_file_io.h
    +++ b/include/apr_file_io.h
    @@ -57,8 +57,10 @@ extern "C" {
     #define APR_FOPEN_APPEND     0x00008  /**< Append to the end of the file */
     #define APR_FOPEN_TRUNCATE   0x00010  /**< Open the file and truncate
                                              to 0 length */
    -#define APR_FOPEN_BINARY     0x00020  /**< Open the file in binary mode */
    -#define APR_FOPEN_EXCL       0x00040  /**< Open should fail if APR_CREATE
    +#define APR_FOPEN_BINARY     0x00020  /**< Open the file in binary mode
    +				         (This flag is ignored on UNIX 
    +					 because it has no meaning)*/
    +#define APR_FOPEN_EXCL       0x00040  /**< Open should fail if #APR_FOPEN_CREATE
                                              and file exists. */
     #define APR_FOPEN_BUFFERED   0x00080  /**< Open the file for buffered I/O */
     #define APR_FOPEN_DELONCLOSE 0x00100  /**< Delete the file after close */
    @@ -70,7 +72,10 @@ extern "C" {
                                              access to support writes across
                                              process/machines */
     #define APR_FOPEN_NOCLEANUP  0x00800  /**< Do not register a cleanup
    -                                         when the file is opened */
    +                                         when the file is opened. The
    +					 apr_os_file_t handle in apr_file_t
    +					 will not be closed when the pool
    +					 is destroyed. */
     #define APR_FOPEN_SENDFILE_ENABLED 0x01000 /**< Advisory flag that this
                                                  file should support
                                                  apr_socket_sendfile operation */
    @@ -107,17 +112,19 @@ extern "C" {
     #define APR_SENDFILE_ENABLED APR_FOPEN_SENDFILE_ENABLED /**< @deprecated @see APR_FOPEN_SENDFILE_ENABLED */   
     #define APR_LARGEFILE        APR_FOPEN_LARGEFILE  /**< @deprecated @see APR_FOPEN_LARGEFILE */   
     
    -/** @warning APR_FOPEN_LARGEFILE flag only has effect on some
    +/** @def APR_FOPEN_LARGEFILE 
    + * @warning APR_FOPEN_LARGEFILE flag only has effect on some
      * platforms where sizeof(apr_off_t) == 4.  Where implemented, it
      * allows opening and writing to a file which exceeds the size which
      * can be represented by apr_off_t (2 gigabytes).  When a file's size
      * does exceed 2Gb, apr_file_info_get() will fail with an error on the
      * descriptor, likewise apr_stat()/apr_lstat() will fail on the
    - * filename.  apr_dir_read() will fail with APR_INCOMPLETE on a
    + * filename.  apr_dir_read() will fail with #APR_INCOMPLETE on a
      * directory entry for a large file depending on the particular
      * APR_FINFO_* flags.  Generally, it is not recommended to use this
      * flag.
      *
    + * @def APR_FOPEN_SPARSE
      * @warning APR_FOPEN_SPARSE may, depending on platform, convert a
      * normal file to a sparse file.  Some applications may be unable
      * to decipher a sparse file, so it's critical that the sparse file
    @@ -210,33 +217,36 @@ typedef struct apr_file_t         apr_file_t;
      * @param newf The opened file descriptor.
      * @param fname The full path to the file (using / on all systems)
      * @param flag Or'ed value of:
    - * 
    - *         APR_READ              open for reading
    - *         APR_WRITE             open for writing
    - *         APR_CREATE            create the file if not there
    - *         APR_APPEND            file ptr is set to end prior to all writes
    - *         APR_TRUNCATE          set length to zero if file exists
    - *         APR_BINARY            not a text file (This flag is ignored on 
    - *                               UNIX because it has no meaning)
    - *         APR_BUFFERED          buffer the data.  Default is non-buffered
    - *         APR_EXCL              return error if APR_CREATE and file exists
    - *         APR_DELONCLOSE        delete the file after closing.
    - *         APR_XTHREAD           Platform dependent tag to open the file
    + * @li #APR_FOPEN_READ           open for reading
    + * @li #APR_FOPEN_WRITE          open for writing
    + * @li #APR_FOPEN_CREATE         create the file if not there
    + * @li #APR_FOPEN_APPEND         file ptr is set to end prior to all writes
    + * @li #APR_FOPEN_TRUNCATE       set length to zero if file exists
    + * @li #APR_FOPEN_BINARY         not a text file
    + * @li #APR_FOPEN_BUFFERED       buffer the data.  Default is non-buffered
    + * @li #APR_FOPEN_EXCL           return error if #APR_FOPEN_CREATE and file exists
    + * @li #APR_FOPEN_DELONCLOSE     delete the file after closing
    + * @li #APR_FOPEN_XTHREAD        Platform dependent tag to open the file
      *                               for use across multiple threads
    - *         APR_SHARELOCK         Platform dependent support for higher
    + * @li #APR_FOPEN_SHARELOCK      Platform dependent support for higher
      *                               level locked read/write access to support
      *                               writes across process/machines
    - *         APR_FILE_NOCLEANUP    Do not register a cleanup with the pool 
    - *                               passed in on the pool argument (see below).
    - *                               The apr_os_file_t handle in apr_file_t will not
    - *                               be closed when the pool is destroyed.
    - *         APR_SENDFILE_ENABLED  Open with appropriate platform semantics
    + * @li #APR_FOPEN_NOCLEANUP      Do not register a cleanup with the pool 
    + *                               passed in on the @a pool argument (see below)
    + * @li #APR_FOPEN_SENDFILE_ENABLED  Open with appropriate platform semantics
      *                               for sendfile operations.  Advisory only,
    - *                               apr_socket_sendfile does not check this flag.
    - * 
    + * apr_socket_sendfile does not check this flag + * @li #APR_FOPEN_LARGEFILE Platform dependent flag to enable large file + * support, see WARNING below + * @li #APR_FOPEN_SPARSE Platform dependent flag to enable sparse file + * support, see WARNING below + * @li #APR_FOPEN_ROTATING Do file file rotation checking + * @li #APR_FOPEN_MANUAL_ROTATE Enable Manual rotation + * @li #APR_FOPEN_NONBLOCK Platform dependent flag to enable + * non blocking file io * @param perm Access permissions for file. * @param pool The pool to use. - * @remark If perm is APR_OS_DEFAULT and the file is being created, + * @remark If perm is #APR_FPROT_OS_DEFAULT and the file is being created, * appropriate default permissions will be used. * @remark By default, the returned file descriptor will not be * inherited by child processes created by apr_proc_create(). This @@ -289,7 +299,7 @@ APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, * @param to_path The full path to the new file (using / on all systems) * @param perms Access permissions for the new file if it is created. * In place of the usual or'd combination of file permissions, the - * value APR_FILE_SOURCE_PERMS may be given, in which case the source + * value #APR_FPROT_FILE_SOURCE_PERMS may be given, in which case the source * file's permissions are copied. * @param pool The pool to use. * @remark The new file does not need to exist, it will be created if required. @@ -306,7 +316,7 @@ APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path, * @param to_path The full path to the destination file (use / on all systems) * @param perms Access permissions for the destination file if it is created. * In place of the usual or'd combination of file permissions, the - * value APR_FILE_SOURCE_PERMS may be given, in which case the source + * value #APR_FPROT_FILE_SOURCE_PERMS may be given, in which case the source * file's permissions are copied. * @param pool The pool to use. * @remark The new file does not need to exist, it will be created if required. @@ -319,7 +329,7 @@ APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, /** * Are we at the end of the file * @param fptr The apr file we are testing. - * @remark Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise. + * @remark Returns #APR_EOF if we are at the end of file, #APR_SUCCESS otherwise. */ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); @@ -346,7 +356,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, * @param thefile The apr file to use as stdout. * @param pool The pool to allocate the file out of. * - * @remark See remarks for apr_file_open_stderr. + * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *pool); @@ -356,7 +366,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, * @param thefile The apr file to use as stdin. * @param pool The pool to allocate the file out of. * - * @remark See remarks for apr_file_open_stderr. + * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool); @@ -364,13 +374,19 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, /** * open standard error as an apr file pointer, with flags. * @param thefile The apr file to use as stderr. - * @param flags The flags to open the file with. Only the APR_EXCL, - * APR_BUFFERED, APR_XTHREAD, APR_SHARELOCK, - * APR_SENDFILE_ENABLED and APR_LARGEFILE flags should - * be used. The APR_WRITE flag will be set unconditionally. + * @param flags The flags to open the file with. Only the + * @li #APR_FOPEN_EXCL + * @li #APR_FOPEN_BUFFERED + * @li #APR_FOPEN_XTHREAD + * @li #APR_FOPEN_SHARELOCK + * @li #APR_FOPEN_SENDFILE_ENABLED + * @li #APR_FOPEN_LARGEFILE + * + * flags should be used. The #APR_FOPEN_WRITE flag will + * be set unconditionally. * @param pool The pool to allocate the file out of. * - * @remark See remarks for apr_file_open_stderr. + * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, apr_int32_t flags, @@ -379,13 +395,19 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, /** * open standard output as an apr file pointer, with flags. * @param thefile The apr file to use as stdout. - * @param flags The flags to open the file with. Only the APR_EXCL, - * APR_BUFFERED, APR_XTHREAD, APR_SHARELOCK, - * APR_SENDFILE_ENABLED and APR_LARGEFILE flags should - * be used. The APR_WRITE flag will be set unconditionally. + * @param flags The flags to open the file with. Only the + * @li #APR_FOPEN_EXCL + * @li #APR_FOPEN_BUFFERED + * @li #APR_FOPEN_XTHREAD + * @li #APR_FOPEN_SHARELOCK + * @li #APR_FOPEN_SENDFILE_ENABLED + * @li #APR_FOPEN_LARGEFILE + * + * flags should be used. The #APR_FOPEN_WRITE flag will + * be set unconditionally. * @param pool The pool to allocate the file out of. * - * @remark See remarks for apr_file_open_stderr. + * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, apr_int32_t flags, @@ -394,13 +416,19 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, /** * open standard input as an apr file pointer, with flags. * @param thefile The apr file to use as stdin. - * @param flags The flags to open the file with. Only the APR_EXCL, - * APR_BUFFERED, APR_XTHREAD, APR_SHARELOCK, - * APR_SENDFILE_ENABLED and APR_LARGEFILE flags should - * be used. The APR_READ flag will be set unconditionally. + * @param flags The flags to open the file with. Only the + * @li #APR_FOPEN_EXCL + * @li #APR_FOPEN_BUFFERED + * @li #APR_FOPEN_XTHREAD + * @li #APR_FOPEN_SHARELOCK + * @li #APR_FOPEN_SENDFILE_ENABLED + * @li #APR_FOPEN_LARGEFILE + * + * flags should be used. The #APR_FOPEN_WRITE flag will + * be set unconditionally. * @param pool The pool to allocate the file out of. * - * @remark See remarks for apr_file_open_stderr. + * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, apr_int32_t flags, @@ -413,15 +441,15 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, * @param nbytes On entry, the number of bytes to read; on exit, the number * of bytes read. * - * @remark apr_file_read will read up to the specified number of + * @remark apr_file_read() will read up to the specified number of * bytes, but never more. If there isn't enough data to fill that * number of bytes, all of the available data is read. The third * argument is modified to reflect the number of bytes read. If a * char was put back into the stream via ungetc, it will be the first * character returned. * - * @remark It is not possible for both bytes to be read and an APR_EOF - * or other error to be returned. APR_EINTR is never returned. + * @remark It is not possible for both bytes to be read and an #APR_EOF + * or other error to be returned. #APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes); @@ -433,13 +461,13 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, * @param nbytes On entry, the number of bytes to write; on exit, the number * of bytes written. * - * @remark apr_file_write will write up to the specified number of + * @remark apr_file_write() will write up to the specified number of * bytes, but never more. If the OS cannot write that many bytes, it * will write as many as it can. The third argument is modified to * reflect the * number of bytes written. * * @remark It is possible for both bytes to be written and an error to - * be returned. APR_EINTR is never returned. + * be returned. #APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes); @@ -449,14 +477,14 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, * @param thefile The file descriptor to write to. * @param vec The array from which to get the data to write to the file. * @param nvec The number of elements in the struct iovec array. This must - * be smaller than APR_MAX_IOVEC_SIZE. If it isn't, the function - * will fail with APR_EINVAL. + * be smaller than #APR_MAX_IOVEC_SIZE. If it isn't, the function + * will fail with #APR_EINVAL. * @param nbytes The number of bytes written. * * @remark It is possible for both bytes to be written and an error to - * be returned. APR_EINTR is never returned. + * be returned. #APR_EINTR is never returned. * - * @remark apr_file_writev is available even if the underlying + * @remark apr_file_writev() is available even if the underlying * operating system doesn't provide writev(). */ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, @@ -471,7 +499,7 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, * @param nbytes The number of bytes to read. * @param bytes_read If non-NULL, this will contain the number of bytes read. * - * @remark apr_file_read will read up to the specified number of + * @remark apr_file_read_full() will read up to the specified number of * bytes, but never more. If there isn't enough data to fill that * number of bytes, then the process/thread will block until it is * available or EOF is reached. If a char was put back into the @@ -481,7 +509,7 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, * returned. And if *bytes_read is less than nbytes, an accompanying * error is _always_ returned. * - * @remark APR_EINTR is never returned. + * @remark #APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, apr_size_t nbytes, @@ -495,7 +523,7 @@ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, * @param nbytes The number of bytes to write. * @param bytes_written If non-NULL, set to the number of bytes written. * - * @remark apr_file_write will write up to the specified number of + * @remark apr_file_write_full() will write up to the specified number of * bytes, but never more. If the OS cannot write that many bytes, the * process/thread will block until they can be written. Exceptional * error such as "out of space" or "pipe closed" will terminate with @@ -505,7 +533,7 @@ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, * be returned. And if *bytes_written is less than nbytes, an * accompanying error is _always_ returned. * - * @remark APR_EINTR is never returned. + * @remark #APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, const void *buf, @@ -519,11 +547,11 @@ APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, * @param thefile The file descriptor to write to. * @param vec The array from which to get the data to write to the file. * @param nvec The number of elements in the struct iovec array. This must - * be smaller than APR_MAX_IOVEC_SIZE. If it isn't, the function - * will fail with APR_EINVAL. + * be smaller than #APR_MAX_IOVEC_SIZE. If it isn't, the function + * will fail with #APR_EINVAL. * @param nbytes The number of bytes written. * - * @remark apr_file_writev_full is available even if the underlying + * @remark apr_file_writev_full() is available even if the underlying * operating system doesn't provide writev(). */ APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile, @@ -572,7 +600,7 @@ APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile); * Wait for a pipe to be ready for input or output * @param thepipe the pipe to wait on * @param direction whether to wait for reading or writing to be ready - * Can be either APR_WAIT_READ or APR_WAIT_WRITE + * Can be either #APR_WAIT_READ or #APR_WAIT_WRITE * @remark Will time out if thepipe has a time out set for it */ APR_DECLARE(apr_status_t) apr_file_pipe_wait(apr_file_t *thepipe, @@ -640,7 +668,7 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, * @param buffer The buffer * @param bufsize The size of the buffer * @remark It is possible to add a buffer to previously unbuffered - * file handles, the APR_BUFFERED flag will be added to + * file handles, the #APR_FOPEN_BUFFERED flag will be added to * the file handle's flags. Likewise, with buffer=NULL and * bufsize=0 arguments it is possible to make a previously * buffered file handle unbuffered. @@ -659,11 +687,9 @@ APR_DECLARE(apr_size_t) apr_file_buffer_size_get(apr_file_t *thefile); * Move the read/write file offset to a specified byte within a file. * @param thefile The file descriptor * @param where How to move the pointer, one of: - *
    - *            APR_SET  --  set the offset to offset
    - *            APR_CUR  --  add the offset to the current position 
    - *            APR_END  --  add the offset to the current file size 
    - * 
    + * @li #APR_SET -- set the offset to offset + * @li #APR_CUR -- add the offset to the current position + * @li #APR_END -- add the offset to the current file size * @param offset The offset to move the pointer to. * @remark The third argument is modified to be the offset the pointer was actually moved to. @@ -683,7 +709,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, * @bug Some platforms cannot toggle between blocking and nonblocking, * and when passing a pipe as a standard handle to an application which * does not expect it, a non-blocking stream will fluxor the client app. - * @deprecated @see apr_file_pipe_create_ex + * @deprecated @see apr_file_pipe_create_ex() */ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, @@ -694,20 +720,18 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, * @param in The newly created pipe's file for reading. * @param out The newly created pipe's file for writing. * @param blocking one of these values defined in apr_thread_proc.h; + * @li #APR_FULL_BLOCK + * @li #APR_READ_BLOCK + * @li #APR_WRITE_BLOCK + * @li #APR_FULL_NONBLOCK * @param pool The pool to operate on. - *
    - *       APR_FULL_BLOCK
    - *       APR_READ_BLOCK
    - *       APR_WRITE_BLOCK
    - *       APR_FULL_NONBLOCK
    - * 
    * @remark By default, the returned file descriptors will be inherited * by child processes created using apr_proc_create(). This can be * changed using apr_file_inherit_unset(). * @remark Some platforms cannot toggle between blocking and nonblocking, * and when passing a pipe as a standard handle to an application which * does not expect it, a non-blocking stream will fluxor the client app. - * Use this function rather than apr_file_pipe_create to create pipes + * Use this function rather than apr_file_pipe_create() to create pipes * where one or both ends require non-blocking semantics. */ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, @@ -808,11 +832,11 @@ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, * @param perms The permission bits to apply to the file. * * @warning Some platforms may not be able to apply all of the - * available permission bits; APR_INCOMPLETE will be returned if some + * available permission bits; #APR_INCOMPLETE will be returned if some * permissions are specified which could not be set. * * @warning Platforms which do not implement this feature will return - * APR_ENOTIMPL. + * #APR_ENOTIMPL. */ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, apr_fileperms_t perms); @@ -821,11 +845,9 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, * Set attributes of the specified file. * @param fname The full path to the file (using / on all systems) * @param attributes Or'd combination of - *
    - *            APR_FILE_ATTR_READONLY   - make the file readonly
    - *            APR_FILE_ATTR_EXECUTABLE - make the file executable
    - *            APR_FILE_ATTR_HIDDEN     - make the file hidden
    - * 
    + * @li #APR_FILE_ATTR_READONLY - make the file readonly + * @li #APR_FILE_ATTR_EXECUTABLE - make the file executable + * @li #APR_FILE_ATTR_HIDDEN - make the file hidden * @param attr_mask Mask of valid bits in attributes. * @param pool the pool to use. * @remark This function should be used in preference to explicit manipulation @@ -833,7 +855,7 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, * attributes are platform specific and may involve more than simply * setting permission bits. * @warning Platforms which do not implement this feature will return - * APR_ENOTIMPL. + * #APR_ENOTIMPL. */ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, @@ -846,7 +868,7 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, * @param mtime The mtime to apply to the file. * @param pool The pool to use. * @warning Platforms which do not implement this feature will return - * APR_ENOTIMPL. + * #APR_ENOTIMPL. */ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, apr_time_t mtime, @@ -884,7 +906,7 @@ APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool); /** * get the specified file's stats. * @param finfo Where to store the information about the file. - * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values + * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_* values * @param thefile The file to get information about. */ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, @@ -929,7 +951,8 @@ APR_DECLARE_INHERIT_UNSET(file); * @param templ The template to use when creating a temp file. * @param flags The flags to open the file with. If this is zero, * the file is opened with - * APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE + * #APR_FOPEN_CREATE | #APR_FOPEN_READ | #APR_FOPEN_WRITE | + * #APR_FOPEN_EXCL | #APR_FOPEN_DELONCLOSE * @param p The pool to allocate the file out of. * @remark * This function generates a unique temporary file name from template. From c90987cea4a9c28cb766f39d58ba6c1f3df35f68 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 1 Oct 2010 11:41:44 +0000 Subject: [PATCH 6825/7878] SECURITY: CVE-2010-1623 (cve.mitre.org) Fix a denial of service attack against apr_brigade_split_line(). Submitted by: sf Reviewed by: trawick, jorton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1003491 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_brigade.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/buckets/apr_brigade.c b/buckets/apr_brigade.c index 2b5893077ca..a075674e86e 100644 --- a/buckets/apr_brigade.c +++ b/buckets/apr_brigade.c @@ -347,7 +347,18 @@ APR_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut, return APR_SUCCESS; } APR_BUCKET_REMOVE(e); - APR_BRIGADE_INSERT_TAIL(bbOut, e); + if (APR_BUCKET_IS_METADATA(e) || len > APR_BUCKET_BUFF_SIZE/4) { + APR_BRIGADE_INSERT_TAIL(bbOut, e); + } + else { + if (len > 0) { + rv = apr_brigade_write(bbOut, NULL, NULL, str, len); + if (rv != APR_SUCCESS) { + return rv; + } + } + apr_bucket_destroy(e); + } readbytes += len; /* We didn't find an APR_ASCII_LF within the maximum line length. */ if (readbytes >= maxbytes) { From a45a92a82fe01aac3dd473194f827cdd0920bf0a Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sat, 2 Oct 2010 12:11:42 +0000 Subject: [PATCH 6826/7878] Create before chmod. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1003781 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildconf b/buildconf index 74fdb0bd4cc..a08f1bb7b7a 100755 --- a/buildconf +++ b/buildconf @@ -69,8 +69,8 @@ if test "$1" = "1"; then fi # Do we need this anymore? echo "buildconf: Using libtool.m4 at ${ltfile}." - chmod u+w build/libtool.m4 cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 + chmod u+w build/libtool.m4 fi if test "$1" = "2"; then $libtoolize --copy --automake --force $verbose From 0cdea5b22d24f70d90efd5f262f2f2a40cf98f10 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sat, 2 Oct 2010 12:24:58 +0000 Subject: [PATCH 6827/7878] - remove force flag from libtoolize: - we don't want our config.(guess|sub) be overwritten by whatever is installed on the RM system - we already clean up all other files copied in at the beginning of the script - chmod: was previously located in front of the "cat", which gave an error if the file was not there. Since we try to override immediately after, changed to "rm -f". git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1003783 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildconf b/buildconf index a08f1bb7b7a..e5f8926cc73 100755 --- a/buildconf +++ b/buildconf @@ -50,7 +50,7 @@ lt_pversion=`$libtoolize --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*// lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` IFS=.; set $lt_version; IFS=' ' if test "$1" = "1"; then - $libtoolize --copy --automake --force $verbose + $libtoolize --copy --automake $verbose if [ -f libtool.m4 ]; then ltfile=`pwd`/libtool.m4 else @@ -69,11 +69,11 @@ if test "$1" = "1"; then fi # Do we need this anymore? echo "buildconf: Using libtool.m4 at ${ltfile}." + rm -f build/libtool.m4 cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 - chmod u+w build/libtool.m4 fi if test "$1" = "2"; then - $libtoolize --copy --automake --force $verbose + $libtoolize --copy --automake $verbose # Wouldn't it just be better to define top_builddir?? mv build/libtool.m4 build/libtool.m4.$$ cat build/libtool.m4.$$ | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 From e6c4035884c2c75455f49cc26e0ca06e589efdcc Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sat, 2 Oct 2010 12:25:40 +0000 Subject: [PATCH 6828/7878] Support Berkeley DB 5.0 and 5.1. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1003784 13f79535-47bb-0310-9956-ffa450edef68 --- build/dbm.m4 | 108 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 86 insertions(+), 22 deletions(-) diff --git a/build/dbm.m4 b/build/dbm.m4 index 6203ea7e391..7584828a013 100644 --- a/build/dbm.m4 +++ b/build/dbm.m4 @@ -541,6 +541,44 @@ AC_DEFUN([APU_CHECK_DB48], [ apu_db_version=4 fi ]) +dnl +dnl APU_CHECK_DB50: is DB5.0 present? +dnl +dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version +dnl +AC_DEFUN([APU_CHECK_DB50], [ + places=$1 + if test -z "$places"; then + places="std /usr/local/BerkeleyDB.5.0 /boot/home/config" + fi + APU_CHECK_BERKELEY_DB("5", "0", "-1", + "$places", + "db50/db.h db5/db.h db.h", + "db-5.0 db5-5.0 db50 db5 db" + ) + if test "$apu_have_db" = "1"; then + apu_db_version=5 + fi +]) +dnl +dnl APU_CHECK_DB51: is DB5.1 present? +dnl +dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version +dnl +AC_DEFUN([APU_CHECK_DB51], [ + places=$1 + if test -z "$places"; then + places="std /usr/local/BerkeleyDB.5.1 /boot/home/config" + fi + APU_CHECK_BERKELEY_DB("5", "1", "-1", + "$places", + "db51/db.h db5/db.h db.h", + "db-5.1 db5-5.1 db51 db5 db" + ) + if test "$apu_have_db" = "1"; then + apu_db_version=5 + fi +]) AC_DEFUN([APU_CHECK_DB], [ requested=$1 @@ -631,6 +669,18 @@ AC_DEFUN([APU_CHECK_DB], [ AC_MSG_ERROR(Berkeley db4 not found) fi ;; + db50) + APU_CHECK_DB50("$check_places") + if test "$apu_db_version" != "5"; then + AC_MSG_ERROR(Berkeley db5 not found) + fi + ;; + db51) + APU_CHECK_DB51("$check_places") + if test "$apu_db_version" != "5"; then + AC_MSG_ERROR(Berkeley db5 not found) + fi + ;; default) APU_CHECK_DB_ALL("$check_places") ;; @@ -638,36 +688,42 @@ AC_DEFUN([APU_CHECK_DB], [ ]) dnl -dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 4.8 to 1. +dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 5.1 to 1. dnl AC_DEFUN([APU_CHECK_DB_ALL], [ all_places=$1 - APU_CHECK_DB48("$all_places") - if test "$apu_db_version" != "4"; then - APU_CHECK_DB47("$all_places") - if test "$apu_db_version" != "4"; then - APU_CHECK_DB46("$all_places") + APU_CHECK_DB51("$all_places") + if test "$apu_db_version" != "5"; then + APU_CHECK_DB50("$all_places") + if test "$apu_db_version" != "5"; then + APU_CHECK_DB48("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB45("$all_places") + APU_CHECK_DB47("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB44("$all_places") + APU_CHECK_DB46("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB43("$all_places") + APU_CHECK_DB45("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB42("$all_places") + APU_CHECK_DB44("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB41("$all_places") + APU_CHECK_DB43("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB4("$all_places") + APU_CHECK_DB42("$all_places") if test "$apu_db_version" != "4"; then - APU_CHECK_DB3("$all_places") - if test "$apu_db_version" != "3"; then - APU_CHECK_DB2("$all_places") - if test "$apu_db_version" != "2"; then - APU_CHECK_DB1("$all_places") - if test "$apu_db_version" != "1"; then - APU_CHECK_DB185("$all_places") + APU_CHECK_DB41("$all_places") + if test "$apu_db_version" != "4"; then + APU_CHECK_DB4("$all_places") + if test "$apu_db_version" != "4"; then + APU_CHECK_DB3("$all_places") + if test "$apu_db_version" != "3"; then + APU_CHECK_DB2("$all_places") + if test "$apu_db_version" != "2"; then + APU_CHECK_DB1("$all_places") + if test "$apu_db_version" != "1"; then + APU_CHECK_DB185("$all_places") + fi + fi fi fi fi @@ -707,11 +763,11 @@ AC_DEFUN([APU_CHECK_DBM], [ apu_db_version=0 AC_ARG_WITH(dbm, [APR_HELP_STRING([--with-dbm=DBM], [choose the DBM type to use. - DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db41,db42,db43,db44,db45,db46,db47,db48}])], + DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db41,db42,db43,db44,db45,db46,db47,db48,db50,db51}])], [ if test "$withval" = "yes"; then AC_MSG_ERROR([--with-dbm needs to specify a DBM type to use. - One of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48]) + One of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48, db50, db51]) fi requested="$withval" ], [ @@ -914,6 +970,14 @@ AC_DEFUN([APU_CHECK_DBM], [ apu_use_db=1 apu_default_dbm=db4 ;; + db50) + apu_use_db=1 + apu_default_dbm=db5 + ;; + db51) + apu_use_db=1 + apu_default_dbm=db5 + ;; default) dnl ### use more sophisticated DBMs for the default? apu_default_dbm="sdbm (default)" @@ -921,7 +985,7 @@ AC_DEFUN([APU_CHECK_DBM], [ ;; *) AC_MSG_ERROR([--with-dbm=$look_for is an unknown DBM type. - Use one of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48]) + Use one of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48, db50, db51]) ;; esac From 092eea37d33b88a7176bec0b032de6cc5497801d Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sat, 2 Oct 2010 12:32:08 +0000 Subject: [PATCH 6829/7878] Fix small ommission in Berkeley DB 5.1 support. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1003785 13f79535-47bb-0310-9956-ffa450edef68 --- build/dbm.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dbm.m4 b/build/dbm.m4 index 7584828a013..03a82f64d57 100644 --- a/build/dbm.m4 +++ b/build/dbm.m4 @@ -112,7 +112,7 @@ AC_DEFUN([APU_CHECK_BERKELEY_DB], [ changequote([,]) unset $cache_id AC_CHECK_HEADER([$bdb_header], [ - if test "$1" = "3" -o "$1" = "4"; then + if test "$1" = "3" -o "$1" = "4" -o "$1" = "5"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of From 0b3e45f46693544da8b988f263891e841dfede0b Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 4 Oct 2010 16:05:44 +0000 Subject: [PATCH 6830/7878] Renamed optarg -> opt_arg to avoid name clashes with system-own optarg. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1004302 13f79535-47bb-0310-9956-ffa450edef68 --- test/testargs.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/test/testargs.c b/test/testargs.c index cb501924f1b..405b3bed6d1 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -46,21 +46,21 @@ static void no_options_found(abts_case *tc, void *data) apr_getopt_t *opt; apr_status_t rv; char ch; - const char *optarg; + const char *opt_arg; char str[8196]; str[0] = '\0'; rv = apr_getopt_init(&opt, p, largc, largv); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - while (apr_getopt(opt, "abcd", &ch, &optarg) == APR_SUCCESS) { + while (apr_getopt(opt, "abcd", &ch, &opt_arg) == APR_SUCCESS) { switch (ch) { case 'a': case 'b': case 'c': case 'd': default: - format_arg(str, ch, optarg); + format_arg(str, ch, opt_arg); } } ABTS_STR_EQUAL(tc, "option: a\n" @@ -76,7 +76,7 @@ static void no_options(abts_case *tc, void *data) apr_getopt_t *opt; apr_status_t rv; char ch; - const char *optarg; + const char *opt_arg; char str[8196]; str[0] = '\0'; @@ -86,13 +86,13 @@ static void no_options(abts_case *tc, void *data) opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "efgh", &ch, &optarg) == APR_SUCCESS) { + while (apr_getopt(opt, "efgh", &ch, &opt_arg) == APR_SUCCESS) { switch (ch) { case 'a': case 'b': case 'c': case 'd': - format_arg(str, ch, optarg); + format_arg(str, ch, opt_arg); break; default: break; @@ -108,7 +108,7 @@ static void required_option(abts_case *tc, void *data) apr_getopt_t *opt; apr_status_t rv; char ch; - const char *optarg; + const char *opt_arg; char str[8196]; str[0] = '\0'; @@ -118,10 +118,10 @@ static void required_option(abts_case *tc, void *data) opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "a:", &ch, &optarg) == APR_SUCCESS) { + while (apr_getopt(opt, "a:", &ch, &opt_arg) == APR_SUCCESS) { switch (ch) { case 'a': - format_arg(str, ch, optarg); + format_arg(str, ch, opt_arg); break; default: break; @@ -137,7 +137,7 @@ static void required_option_notgiven(abts_case *tc, void *data) apr_getopt_t *opt; apr_status_t rv; char ch; - const char *optarg; + const char *opt_arg; char str[8196]; str[0] = '\0'; @@ -147,10 +147,10 @@ static void required_option_notgiven(abts_case *tc, void *data) opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "a:", &ch, &optarg) == APR_SUCCESS) { + while (apr_getopt(opt, "a:", &ch, &opt_arg) == APR_SUCCESS) { switch (ch) { case 'a': - format_arg(str, ch, optarg); + format_arg(str, ch, opt_arg); break; default: break; @@ -166,7 +166,7 @@ static void optional_option(abts_case *tc, void *data) apr_getopt_t *opt; apr_status_t rv; char ch; - const char *optarg; + const char *opt_arg; char str[8196]; str[0] = '\0'; @@ -176,10 +176,10 @@ static void optional_option(abts_case *tc, void *data) opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "a::", &ch, &optarg) == APR_SUCCESS) { + while (apr_getopt(opt, "a::", &ch, &opt_arg) == APR_SUCCESS) { switch (ch) { case 'a': - format_arg(str, ch, optarg); + format_arg(str, ch, opt_arg); break; default: break; @@ -195,7 +195,7 @@ static void optional_option_notgiven(abts_case *tc, void *data) apr_getopt_t *opt; apr_status_t rv; char ch; - const char *optarg; + const char *opt_arg; char str[8196]; str[0] = '\0'; @@ -205,10 +205,10 @@ static void optional_option_notgiven(abts_case *tc, void *data) opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "a::", &ch, &optarg) == APR_SUCCESS) { + while (apr_getopt(opt, "a::", &ch, &opt_arg) == APR_SUCCESS) { switch (ch) { case 'a': - format_arg(str, ch, optarg); + format_arg(str, ch, opt_arg); break; default: break; From d61e58405bda4487723f9c24ff548d3586f6fd4c Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sun, 7 Nov 2010 20:28:05 +0000 Subject: [PATCH 6831/7878] Improve documentation for tables git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1032383 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index 436b7d256f1..0354604c6ea 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -36,8 +36,8 @@ extern "C" { /** * @defgroup apr_tables Table and Array Functions * @ingroup APR - * Tables are used to store entirely opaque structures - * for applications, while Arrays are usually used to + * Arrays are used to store entirely opaque structures + * for applications, while Tables are usually used to * deal with string lists. * @{ */ @@ -252,7 +252,7 @@ APR_DECLARE(void) apr_table_clear(apr_table_t *t); * Get the value associated with a given key from the table. After this call, * the data is still in the table. * @param t The table to search for the key - * @param key The key to search for + * @param key The key to search for (case does not matter) * @return The value associated with the key, or NULL if the key does not exist. */ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); @@ -273,7 +273,7 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, * Add a key/value pair to a table. If another element already exists with the * same key, this will overwrite the old data. * @param t The table to add the data to. - * @param key The key to use + * @param key The key to use (case does not matter) * @param val The value to add * @warning When adding data, this function does not make a copy of the key or * the value, so care should be taken to ensure that the values will @@ -285,15 +285,16 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, /** * Remove data from the table. * @param t The table to remove data from - * @param key The key of the data being removed + * @param key The key of the data being removed (case does not matter) */ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key); /** * Add data to a table by merging the value with data that has already been - * stored. + * stored. The merging is done by concatenating the two values, separated + * by the string ", ". * @param t The table to search for the data - * @param key The key to merge data for + * @param key The key to merge data for (case does not matter) * @param val The data to add * @remark If the key is not found, then this function acts like apr_table_add */ @@ -302,9 +303,10 @@ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, /** * Add data to a table by merging the value with data that has already been - * stored. + * stored. The merging is done by concatenating the two values, separated + * by the string ", ". * @param t The table to search for the data - * @param key The key to merge data for + * @param key The key to merge data for (case does not matter) * @param val The data to add * @remark If the key is not found, then this function acts like apr_table_addn */ From fd695ca4382539cb473cd0b9fc929fd170c01488 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 8 Dec 2010 12:54:39 +0000 Subject: [PATCH 6832/7878] Fixed some NetWare signal redefines. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1043393 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_private.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 1552655b338..311aa5f86fb 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -77,7 +77,7 @@ #endif /* 64-bit integer conversion function */ -#define APR_INT64_STRFN strtoll +#define APR_INT64_STRFN strtoll #ifdef NW_BUILD_IPV6 #define HAVE_GETADDRINFO 1 @@ -92,11 +92,9 @@ /* 6 is used for SIGTERM on netware */ /* 7 is used for SIGPOLL on netware */ +#if (CURRENT_NDK_THRESHOLD < 306030000) #define SIGKILL 11 -#undef SA_NOCLDSTOP -#define SA_NOCLDSTOP 12 #define SIGALRM 13 -#undef SIGCHLD #define SIGCHLD 14 #define SIGCONT 15 #define SIGHUP 16 @@ -108,11 +106,10 @@ #define SIGTTOU 22 #define SIGUSR1 23 #define SIGUSR2 24 - +#endif + #define SIGTRAP 25 #define SIGIOT 26 -#undef SIGBUS -#define SIGBUS 27 #define SIGSTKFLT 28 #define SIGURG 29 #define SIGXCPU 30 @@ -122,6 +119,13 @@ #define SIGWINCH 34 #define SIGIO 35 +#undef SA_NOCLDSTOP +#define SA_NOCLDSTOP 12 +#ifdef SIGBUS +#undef SIGBUS +#endif +#define SIGBUS 27 + #define _getch() getcharacter() #define SIZEOF_CHAR 1 From 6064febca69cfcb9476012c37456d1f88eed5a76 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 8 Dec 2010 16:37:19 +0000 Subject: [PATCH 6833/7878] Fixed NetWare signal defines to match with newer NDKs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1043503 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_private.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 311aa5f86fb..85eb751cee4 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -119,12 +119,13 @@ #define SIGWINCH 34 #define SIGIO 35 +#if (CURRENT_NDK_THRESHOLD < 406230000) #undef SA_NOCLDSTOP -#define SA_NOCLDSTOP 12 -#ifdef SIGBUS -#undef SIGBUS +#define SA_NOCLDSTOP 0x00000001 +#endif +#ifndef SIGBUS +#define SIGBUS SIGSEGV #endif -#define SIGBUS 27 #define _getch() getcharacter() From 215e46ccdf3c1c14806826577d1e57b57fdad34b Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 8 Dec 2010 17:18:07 +0000 Subject: [PATCH 6834/7878] Fixed some comments and indents. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1043533 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_private.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 85eb751cee4..23d9203dfe8 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -73,12 +73,9 @@ * a threadsafe, API-equivilant of getpass_r(). */ #if (CURRENT_NDK_THRESHOLD < 709060000) -#define getpass_r getpassword +#define getpass_r getpassword #endif -/* 64-bit integer conversion function */ -#define APR_INT64_STRFN strtoll - #ifdef NW_BUILD_IPV6 #define HAVE_GETADDRINFO 1 #define HAVE_GETNAMEINFO 1 @@ -173,20 +170,23 @@ void* getStatCache(); #undef malloc #define malloc(x) library_malloc(gLibHandle,x) #ifndef __MWERKS__ -#define _alloca alloca +#define _alloca alloca #endif +/* 64-bit integer conversion function */ +#define APR_INT64_STRFN strtoll + #if APR_HAS_LARGE_FILES -#define APR_OFF_T_STRFN strtoll +#define APR_OFF_T_STRFN strtoll #else -#define APR_OFF_T_STRFN strtol +#define APR_OFF_T_STRFN strtol #endif /* used to check DWORD overflow for 64bit compiles */ -#define APR_DWORD_MAX 0xFFFFFFFFUL +#define APR_DWORD_MAX 0xFFFFFFFFUL /* Always compile Netware with DSO support for .nlm builds */ -#define APU_DSO_BUILD 0 +#define APU_DSO_BUILD 0 /* * NetWare does not have GDBM, and we always use the bundled (new) Expat From 540e328487bc52a77c3154a104e6f0e73a4c8c3f Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Fri, 10 Dec 2010 16:52:09 +0000 Subject: [PATCH 6835/7878] Add apr_file_trunc test case. It currently fails for APR_FOPEN_BUFFERED because write buffer is flushed after ftruncate call git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1044432 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/test/testfile.c b/test/testfile.c index 2b46586693f..dad214e35de 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -810,6 +810,62 @@ static void test_truncate(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } +static void test_file_trunc(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtruncate.dat"; + const char *s; + apr_size_t nbytes; + apr_finfo_t finfo; + + apr_file_remove(fname, p); + + /* Test unbuffered */ + rv = apr_file_open(&f, fname, + APR_FOPEN_CREATE | APR_FOPEN_READ | + APR_FOPEN_WRITE, + APR_UREAD | APR_UWRITE, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + s = "some data"; + nbytes = strlen(s); + rv = apr_file_write(f, s, &nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_SIZE_EQUAL(tc, strlen(s), nbytes); + rv = apr_file_trunc(f, 4); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_file_close(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_stat(&finfo, fname, APR_FINFO_SIZE, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_ASSERT(tc, "File size mismatch, expected 4", finfo.size == 4); + + rv = apr_file_remove(fname, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + /* Test buffered */ + rv = apr_file_open(&f, fname, + APR_FOPEN_CREATE | APR_FOPEN_READ | + APR_FOPEN_WRITE | APR_FOPEN_BUFFERED, + APR_UREAD | APR_UWRITE, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + nbytes = strlen(s); + rv = apr_file_write(f, s, &nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_SIZE_EQUAL(tc, strlen(s), nbytes); + rv = apr_file_trunc(f, 4); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_file_close(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_stat(&finfo, fname, APR_FINFO_SIZE, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_ASSERT(tc, "File size mismatch, expected 4", finfo.size == 4); + + rv = apr_file_remove(fname, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); +} + static void test_bigfprintf(abts_case *tc, void *data) { apr_file_t *f; @@ -1003,6 +1059,7 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_bigread, NULL); abts_run_test(suite, test_mod_neg, NULL); abts_run_test(suite, test_truncate, NULL); + abts_run_test(suite, test_file_trunc, NULL); abts_run_test(suite, test_bigfprintf, NULL); abts_run_test(suite, test_fail_write_flush, NULL); abts_run_test(suite, test_fail_read_flush, NULL); From 10c1fcd8f427820e77320a978fc2d005f121aa7f Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Fri, 10 Dec 2010 17:06:49 +0000 Subject: [PATCH 6836/7878] Fix file_trunc for buffered files. Make sure the write buffer is flushed before truncate call git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1044440 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/seek.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 77ef96e7d55..e70805d7f5d 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -33,7 +33,7 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) if (newbufpos >= 0 && newbufpos <= thefile->dataRead) { thefile->bufpos = newbufpos; rv = APR_SUCCESS; - } + } else { if (lseek(thefile->filedes, pos, SEEK_SET) != -1) { thefile->bufpos = thefile->dataRead = 0; @@ -98,6 +98,30 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset) { + if (fp->buffered) { + int rc = 0; + file_lock(fp); + if (fp->direction == 1 && fp->bufpos != 0) { + apr_off_t len = fp->filePtr + fp->bufpos; + if (offset < len) { + /* New file end fall below our write buffer limit. + * Figure out if and what needs to be flushed. + */ + apr_off_t off = len - offset; + if (off >= 0 && off <= fp->bufpos) + fp->bufpos = fp->bufpos - (size_t)off; + else + fp->bufpos = 0; + } + rc = apr_file_flush_locked(fp); + /* Reset buffer positions for write mode */ + fp->bufpos = fp->direction = fp->dataRead = 0; + } + if (rc) { + return rc; + } + file_unlock(fp); + } if (ftruncate(fp->filedes, offset) == -1) { return errno; } From 0055b76d6864cd817f13e81617e1abf204d6afaa Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Fri, 10 Dec 2010 17:11:00 +0000 Subject: [PATCH 6837/7878] Ooops. Don't leave file locked git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1044447 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/seek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index e70805d7f5d..3f5aa00e956 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -117,10 +117,10 @@ apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset) /* Reset buffer positions for write mode */ fp->bufpos = fp->direction = fp->dataRead = 0; } + file_unlock(fp); if (rc) { return rc; } - file_unlock(fp); } if (ftruncate(fp->filedes, offset) == -1) { return errno; From babfc180153bf062d033eeb8ec095bd407b44dbf Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 17 Dec 2010 14:05:42 +0000 Subject: [PATCH 6838/7878] Re-arrange sizing tests to go from largest to smallest, instead of the reverse. This allows OS X 10.6 to compile cleanly in both 32 and 64 bit mode git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1050391 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 65 ++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/configure.in b/configure.in index 43c6eaae61e..e10275ba431 100644 --- a/configure.in +++ b/configure.in @@ -1386,24 +1386,15 @@ if test "$ac_cv_sizeof_int" = "4"; then fi # Now we need to find what apr_int64_t (sizeof == 8) will be. # The first match is our preference. -if test "$ac_cv_sizeof_int" = "8"; then - int64_literal='#define APR_INT64_C(val) (val)' - uint64_literal='#define APR_UINT64_C(val) (val##U)' - int64_t_fmt='#define APR_INT64_T_FMT "d"' - uint64_t_fmt='#define APR_UINT64_T_FMT "u"' - uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "x"' - int64_value="int" - long_value=int - int64_strfn="strtoi" -elif test "$ac_cv_sizeof_long" = "8"; then - int64_literal='#define APR_INT64_C(val) (val##L)' - uint64_literal='#define APR_UINT64_C(val) (val##UL)' - int64_t_fmt='#define APR_INT64_T_FMT "ld"' - uint64_t_fmt='#define APR_UINT64_T_FMT "lu"' - uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "lx"' - int64_value="long" - long_value=long - int64_strfn="strtol" +if test "$ac_cv_sizeof_longlong" = "8"; then + int64_literal='#define APR_INT64_C(val) (val##LL)' + uint64_literal='#define APR_UINT64_C(val) (val##ULL)' + int64_t_fmt='#define APR_INT64_T_FMT "qd"' + uint64_t_fmt='#define APR_UINT64_T_FMT "qu"' + uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "qx"' + int64_value="__int64" + long_value="__int64" + int64_strfn="strtoll" elif test "$ac_cv_sizeof_long_long" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LL)' uint64_literal='#define APR_UINT64_C(val) (val##ULL)' @@ -1417,15 +1408,24 @@ elif test "$ac_cv_sizeof_long_long" = "8"; then int64_value="long long" long_value="long long" int64_strfn="strtoll" -elif test "$ac_cv_sizeof_longlong" = "8"; then - int64_literal='#define APR_INT64_C(val) (val##LL)' - uint64_literal='#define APR_UINT64_C(val) (val##ULL)' - int64_t_fmt='#define APR_INT64_T_FMT "qd"' - uint64_t_fmt='#define APR_UINT64_T_FMT "qu"' - uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "qx"' - int64_value="__int64" - long_value="__int64" - int64_strfn="strtoll" +elif test "$ac_cv_sizeof_long" = "8"; then + int64_literal='#define APR_INT64_C(val) (val##L)' + uint64_literal='#define APR_UINT64_C(val) (val##UL)' + int64_t_fmt='#define APR_INT64_T_FMT "ld"' + uint64_t_fmt='#define APR_UINT64_T_FMT "lu"' + uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "lx"' + int64_value="long" + long_value=long + int64_strfn="strtol" +elif test "$ac_cv_sizeof_int" = "8"; then + int64_literal='#define APR_INT64_C(val) (val)' + uint64_literal='#define APR_UINT64_C(val) (val##U)' + int64_t_fmt='#define APR_INT64_T_FMT "d"' + uint64_t_fmt='#define APR_UINT64_T_FMT "u"' + uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "x"' + int64_value="int" + long_value=int + int64_strfn="strtoi" else # int64_literal may be overriden if your compiler thinks you have # a 64-bit value but APR does not agree. @@ -1619,16 +1619,17 @@ elif test "${ac_cv_sizeof_off_t}x${ac_cv_sizeof_long}" = "4x4"; then elif test "$ac_cv_type_off_t" = "yes"; then off_t_value=off_t # off_t is more commonly a long than an int; prefer that case - # where int and long are the same size. - if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then + # where int and long are the same size. Use the longest + # type that fits + if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then + off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' + off_t_strfn='apr_strtoi64' + elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then off_t_fmt='#define APR_OFF_T_FMT "ld"' off_t_strfn='strtol' elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then off_t_fmt='#define APR_OFF_T_FMT "d"' off_t_strfn='strtoi' - elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then - off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' - off_t_strfn='apr_strtoi64' else AC_ERROR([could not determine the size of off_t]) fi From 5db13f5f11ccbc59d770e56ce752050adec7404f Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 18 Dec 2010 14:56:47 +0000 Subject: [PATCH 6839/7878] (Try to) support Darwin's "universal" builds by allowing for 2 separate bit sizes for some types in the same binary/library (which is what a universal build is). As such, the C header files need to know how the *current* codebase is being built (which links to apr) and choose the correct bit size depending on the compiler flags. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1050644 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 3 ++ configure.in | 60 ++++++++++++++++++++++++++++++++ include/apr.h.in | 86 +++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 145 insertions(+), 4 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 99de9120478..746edef6e67 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -203,6 +203,9 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(ac_cv_func_kqueue, [no]) APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332 ;; + *-apple-darwin10.*) + APR_ADDTO(CPPFLAGS, [-DDARWIN_10]) + ;; esac ;; *-dec-osf*) diff --git a/configure.in b/configure.in index e10275ba431..8648d74de2f 100644 --- a/configure.in +++ b/configure.in @@ -54,6 +54,66 @@ AH_BOTTOM([ #define BEOS_BONE 1 #endif +/* + * Darwin 10's default compiler (gcc42) builds for both 64 and + * 32 bit architectures unless specifically told not to. + * In those cases, we need to override types depending on how + * we're being built at compile time. + * NOTE: This is an ugly work-around for Darwin's + * concept of universal binaries, a single package + * (executable, lib, etc...) which contains both 32 + * and 64 bit versions. The issue is that if APR is + * built universally, if something else is compiled + * against it, some bit sizes will depend on whether + * it is 32 or 64 bit. This is determined by the __LP64__ + * flag. Since we need to support both, we have to + * handle OS X unqiuely. + */ +#ifdef DARWIN_10 + +#undef APR_OFF_T_STRFN +#undef APR_INT64_STRFN +#undef SIZEOF_LONG +#undef SIZEOF_SIZE_T +#undef SIZEOF_SSIZE_T +#undef SIZEOF_VOIDP +#undef SIZEOF_STRUCT_IOVEC + +#ifdef __LP64__ + #define APR_INT64_STRFN strtol + #define SIZEOF_LONG 8 + #define SIZEOF_SIZE_T 8 + #define SIZEOF_SSIZE_T 8 + #define SIZEOF_VOIDP 8 + #define SIZEOF_STRUCT_IOVEC 16 +#else + #define APR_INT64_STRFN strtoll + #define SIZEOF_LONG 4 + #define SIZEOF_SIZE_T 4 + #define SIZEOF_SSIZE_T 4 + #define SIZEOF_VOIDP 4 + #define SIZEOF_STRUCT_IOVEC 8 +#endif + +/* + * ./i386/_types.h:typedef long long __int64_t; + * ./sys/_types.h:typedef __int64_t __darwin_off_t; + * ./sys/types.h:typedef __darwin_off_t off_t; + * So off_t is always long long + */ +#undef APR_OFF_T_STRFN +#define APR_OFF_T_STRFN APR_INT64_STRFN + + +#undef SETPGRP_VOID +#ifdef __DARWIN_UNIX03 + #define SETPGRP_VOID 1 +#else +/* #undef SETPGRP_VOID */ +#endif + +#endif /* DARWIN_10 */ + #endif /* APR_PRIVATE_H */ ]) diff --git a/include/apr.h.in b/include/apr.h.in index 78c1a9f6adb..3402f55d75c 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -332,8 +332,44 @@ typedef unsigned @short_value@ apr_uint16_t; typedef @int_value@ apr_int32_t; typedef unsigned @int_value@ apr_uint32_t; -typedef @long_value@ apr_int64_t; -typedef unsigned @long_value@ apr_uint64_t; +#define APR_SIZEOF_VOIDP @voidp_size@ + +/* + * Darwin 10's default compiler (gcc42) builds for both 64 and + * 32 bit architectures unless specifically told not to. + * In those cases, we need to override types depending on how + * we're being built at compile time. + * NOTE: This is an ugly work-around for Darwin's + * concept of universal binaries, a single package + * (executable, lib, etc...) which contains both 32 + * and 64 bit versions. The issue is that if APR is + * built universally, if something else is compiled + * against it, some bit sizes will depend on whether + * it is 32 or 64 bit. This is determined by the __LP64__ + * flag. Since we need to support both, we have to + * handle OS X unqiuely. + */ +#ifdef DARWIN_10 +#undef APR_SIZEOF_VOIDP +#undef INT64_C +#undef UINT64_C +#ifdef __LP64__ + typedef long apr_int64_t; + typedef unsigned long apr_uint64_t; + #define APR_SIZEOF_VOIDP 8 + #define INT64_C(v) (v ## L) + #define UINT64_C(v) (v ## UL) +#else + typedef long long apr_int64_t; + typedef unsigned long long apr_uint64_t; + #define APR_SIZEOF_VOIDP 4 + #define INT64_C(v) (v ## LL) + #define UINT64_C(v) (v ## ULL) +#endif +#else + typedef @long_value@ apr_int64_t; + typedef unsigned @long_value@ apr_uint64_t; +#endif typedef @size_t_value@ apr_size_t; typedef @ssize_t_value@ apr_ssize_t; @@ -341,8 +377,6 @@ typedef @off_t_value@ apr_off_t; typedef @socklen_t_value@ apr_socklen_t; typedef @ino_t_value@ apr_ino_t; -#define APR_SIZEOF_VOIDP @voidp_size@ - #if APR_SIZEOF_VOIDP == 8 typedef apr_uint64_t apr_uintptr_t; #else @@ -518,6 +552,7 @@ typedef apr_uint32_t apr_uintptr_t; * to find the logic for this definition search for "ssize_t_fmt" in * configure.in. */ + @ssize_t_fmt@ /* And APR_SIZE_T_FMT */ @@ -538,6 +573,49 @@ typedef apr_uint32_t apr_uintptr_t; /* And APR_UINT64_T_HEX_FMT */ @uint64_t_hex_fmt@ +/* + * Ensure we work with universal binaries on Darwin + */ +#ifdef DARWIN_10 + +#undef APR_HAS_LARGE_FILES +#undef APR_SIZEOF_VOIDP +#undef APR_INT64_T_FMT +#undef APR_UINT64_T_FMT +#undef APR_UINT64_T_HEX_FMT + +#ifdef __LP64__ + #define APR_HAS_LARGE_FILES 0 + #define APR_SIZEOF_VOIDP 8 + #define APR_INT64_T_FMT "ld" + #define APR_UINT64_T_FMT "lu" + #define APR_UINT64_T_HEX_FMT "lx" +#else + #define APR_HAS_LARGE_FILES 1 + #define APR_SIZEOF_VOIDP 4 + #define APR_INT64_T_FMT "lld" + #define APR_UINT64_T_FMT "llu" + #define APR_UINT64_T_HEX_FMT "llx" +#endif + +#undef APR_IS_BIGENDIAN +#ifdef __BIG_ENDIAN__ + #define APR_IS_BIGENDIAN 1 +#else + #define APR_IS_BIGENDIAN 0 +#endif + +/* + * ./i386/_types.h:typedef long long __int64_t; + * ./sys/_types.h:typedef __int64_t __darwin_off_t; + * ./sys/types.h:typedef __darwin_off_t off_t; + * So off_t is always long long + */ +#undef APR_OFF_T_FMT +#define APR_OFF_T_FMT "lld" + +#endif /* DARWIN_10 */ + /* Does the proc mutex lock threads too */ #define APR_PROC_MUTEX_IS_GLOBAL @proc_mutex_is_global@ From 12ae4812c24765ca7c3de8ee2a2885cbcbb94642 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 20 Dec 2010 18:18:26 +0000 Subject: [PATCH 6840/7878] now that we treat OS X special, revert ordering change back to perfering shortest rather than longest git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1051230 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 65 ++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/configure.in b/configure.in index 8648d74de2f..5ecd0db07f2 100644 --- a/configure.in +++ b/configure.in @@ -1446,15 +1446,24 @@ if test "$ac_cv_sizeof_int" = "4"; then fi # Now we need to find what apr_int64_t (sizeof == 8) will be. # The first match is our preference. -if test "$ac_cv_sizeof_longlong" = "8"; then - int64_literal='#define APR_INT64_C(val) (val##LL)' - uint64_literal='#define APR_UINT64_C(val) (val##ULL)' - int64_t_fmt='#define APR_INT64_T_FMT "qd"' - uint64_t_fmt='#define APR_UINT64_T_FMT "qu"' - uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "qx"' - int64_value="__int64" - long_value="__int64" - int64_strfn="strtoll" +if test "$ac_cv_sizeof_int" = "8"; then + int64_literal='#define APR_INT64_C(val) (val)' + uint64_literal='#define APR_UINT64_C(val) (val##U)' + int64_t_fmt='#define APR_INT64_T_FMT "d"' + uint64_t_fmt='#define APR_UINT64_T_FMT "u"' + uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "x"' + int64_value="int" + long_value=int + int64_strfn="strtoi" +elif test "$ac_cv_sizeof_long" = "8"; then + int64_literal='#define APR_INT64_C(val) (val##L)' + uint64_literal='#define APR_UINT64_C(val) (val##UL)' + int64_t_fmt='#define APR_INT64_T_FMT "ld"' + uint64_t_fmt='#define APR_UINT64_T_FMT "lu"' + uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "lx"' + int64_value="long" + long_value=long + int64_strfn="strtol" elif test "$ac_cv_sizeof_long_long" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LL)' uint64_literal='#define APR_UINT64_C(val) (val##ULL)' @@ -1468,24 +1477,15 @@ elif test "$ac_cv_sizeof_long_long" = "8"; then int64_value="long long" long_value="long long" int64_strfn="strtoll" -elif test "$ac_cv_sizeof_long" = "8"; then - int64_literal='#define APR_INT64_C(val) (val##L)' - uint64_literal='#define APR_UINT64_C(val) (val##UL)' - int64_t_fmt='#define APR_INT64_T_FMT "ld"' - uint64_t_fmt='#define APR_UINT64_T_FMT "lu"' - uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "lx"' - int64_value="long" - long_value=long - int64_strfn="strtol" -elif test "$ac_cv_sizeof_int" = "8"; then - int64_literal='#define APR_INT64_C(val) (val)' - uint64_literal='#define APR_UINT64_C(val) (val##U)' - int64_t_fmt='#define APR_INT64_T_FMT "d"' - uint64_t_fmt='#define APR_UINT64_T_FMT "u"' - uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "x"' - int64_value="int" - long_value=int - int64_strfn="strtoi" +elif test "$ac_cv_sizeof_longlong" = "8"; then + int64_literal='#define APR_INT64_C(val) (val##LL)' + uint64_literal='#define APR_UINT64_C(val) (val##ULL)' + int64_t_fmt='#define APR_INT64_T_FMT "qd"' + uint64_t_fmt='#define APR_UINT64_T_FMT "qu"' + uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "qx"' + int64_value="__int64" + long_value="__int64" + int64_strfn="strtoll" else # int64_literal may be overriden if your compiler thinks you have # a 64-bit value but APR does not agree. @@ -1679,17 +1679,16 @@ elif test "${ac_cv_sizeof_off_t}x${ac_cv_sizeof_long}" = "4x4"; then elif test "$ac_cv_type_off_t" = "yes"; then off_t_value=off_t # off_t is more commonly a long than an int; prefer that case - # where int and long are the same size. Use the longest - # type that fits - if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then - off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' - off_t_strfn='apr_strtoi64' - elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then + # where int and long are the same size. + if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then off_t_fmt='#define APR_OFF_T_FMT "ld"' off_t_strfn='strtol' elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then off_t_fmt='#define APR_OFF_T_FMT "d"' off_t_strfn='strtoi' + elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then + off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' + off_t_strfn='apr_strtoi64' else AC_ERROR([could not determine the size of off_t]) fi From 14605ad5ede43317d2b3ce54de15401a118608f2 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sat, 25 Dec 2010 13:51:33 +0000 Subject: [PATCH 6841/7878] Removed define obsolete since r93260. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1052783 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 746edef6e67..ab450a858d0 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -405,7 +405,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(LIBS, [-lbind -lsocket]) ;; esac - APR_ADDTO(CPPFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK -DAP_AUTH_DBM_USE_APR]) + APR_ADDTO(CPPFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK]) ;; 4850-*.*) APR_ADDTO(CPPFLAGS, [-DSVR4 -DMPRAS]) From 8cda1557b735aeb7d570a28be54b019063fb8d6e Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sat, 25 Dec 2010 14:39:14 +0000 Subject: [PATCH 6842/7878] Removed stuff defined in expat.h; moved license to top. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1052788 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_arch_pre_nw.h | 36 ++++++++++---------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/include/arch/netware/apr_arch_pre_nw.h b/include/arch/netware/apr_arch_pre_nw.h index 36d9942c1c6..7380e118226 100644 --- a/include/arch/netware/apr_arch_pre_nw.h +++ b/include/arch/netware/apr_arch_pre_nw.h @@ -1,16 +1,3 @@ -#ifndef __pre_nw__ -#define __pre_nw__ - -#include - -#ifndef __GNUC__ -#pragma precompile_target "precomp.mch" -#endif - -#define NETWARE - -#define N_PLAT_NLM - /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -26,6 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#ifndef __pre_nw__ +#define __pre_nw__ + +#include + +#ifndef __GNUC__ +#pragma precompile_target "precomp.mch" +#endif + +#define NETWARE + +#define N_PLAT_NLM + #define FAR #define far @@ -51,16 +51,6 @@ #define __int64 long long #endif -/* expat version */ -#define VERSION "expat_1.95.1" -#define EXPAT_MAJOR_VERSION 1 -#define EXPAT_MINOR_VERSION 95 -#define EXPAT_EDIT 2 - -#define XML_MAJOR_VERSION EXPAT_MAJOR_VERSION -#define XML_MINOR_VERSION EXPAT_MINOR_VERSION -#define XML_MICRO_VERSION EXPAT_EDIT - #endif From 549f6345046e4d0c76645ac2768c8a69d86efe2f Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Mon, 3 Jan 2011 16:04:05 +0000 Subject: [PATCH 6843/7878] Update copyright year git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1054672 13f79535-47bb-0310-9956-ffa450edef68 --- NOTICE | 2 +- include/apr_version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NOTICE b/NOTICE index 1e0abd3aa93..6643ee6d75e 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Apache Portable Runtime -Copyright (c) 2009 The Apache Software Foundation. +Copyright (c) 2011 The Apache Software Foundation. This product includes software developed by The Apache Software Foundation (http://www.apache.org/). diff --git a/include/apr_version.h b/include/apr_version.h index d516383726d..b47cb7c0fa3 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -38,7 +38,7 @@ */ -#define APR_COPYRIGHT "Copyright (c) 2010 The Apache Software " \ +#define APR_COPYRIGHT "Copyright (c) 2011 The Apache Software " \ "Foundation or its licensors, as applicable." /* The numeric compile-time version constants. These constants are the From f14e68e29d857bf18e9e0e71b6d4c4bf8eff07be Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 5 Jan 2011 21:54:44 +0000 Subject: [PATCH 6844/7878] comment changes only mention string concatenation for apr_table_overlap() and apr_table_compress() provide a better overview of arrays and tables git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1055657 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index 0354604c6ea..0ace8ded919 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -36,9 +36,19 @@ extern "C" { /** * @defgroup apr_tables Table and Array Functions * @ingroup APR - * Arrays are used to store entirely opaque structures - * for applications, while Tables are usually used to - * deal with string lists. + * Arrays are used to store data which is referenced sequentially or + * as a stack. Functions are provided to push and pop individual + * elements as well as to operate on the entire array. + * + * Tables are used to store data which can be referenced by key. + * Limited capabilities are provided for tables with multiple elements + * which share a key; while key lookup will return only a single + * element, iteration is available. Additionally, a table can be + * compressed to resolve duplicates. + * + * Both arrays and tables may store string or binary data; some features, + * such as concatenation or merging of elements, work only for string + * data. * @{ */ @@ -422,6 +432,8 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, * @param flags How to add the table to table a. One of: * APR_OVERLAP_TABLES_SET Use apr_table_setn * APR_OVERLAP_TABLES_MERGE Use apr_table_mergen + * @remark When merging duplicates, the two values are concatenated, + * separated by the string ", ". * @remark This function is highly optimized, and uses less memory and CPU cycles * than a function that just loops through table b calling other functions. */ @@ -461,6 +473,8 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, * @param t Table. * @param flags APR_OVERLAP_TABLES_MERGE to merge, or * APR_OVERLAP_TABLES_SET to overwrite + * @remark When merging duplicates, the two values are concatenated, + * separated by the string ", ". */ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags); From 91cc5a01f6aa37af6ae4289075e79292e439c077 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 15 Jan 2011 15:12:56 +0000 Subject: [PATCH 6845/7878] * network_io/unix/sockets.c (apr_socket_accept): Ensure the correct address family is used for the new socket when adjusting local_addr/remote_addr, fixing handling of an AF_INET socket accepted from a bound AF_INET6 socket. PR: 49678 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1059351 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ network_io/unix/sockets.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 31b913b041c..82781fac114 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Fix address handling when accepting an AF_INET socket from a socket + bound as AF_INET6. PR 49678. [Joe Orton] + *) Hide apr_wait_for_io_or_timeout() from public view and add instead apr_socket_wait() and apr_file_pipe_wait(). [Brian Havard] diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 13d3ecb0cf2..11d284916b4 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -259,7 +259,13 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, } #endif alloc_socket(new, connection_context); - set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM, sock->protocol); + + /* Set up socket variables -- note that it may be possible for + * *new to be an AF_INET socket when sock is AF_INET6 in some + * dual-stack configurations, so ensure the the remote_/local_addr + * structures are adjusted for the family of the accepted + * socket: */ + set_socket_vars(*new, sa.sa.sin.sin_family, SOCK_STREAM, sock->protocol); #ifndef HAVE_POLL (*new)->connected = 1; From 904cfff09059a38331c1a51cbef914478ea1dc42 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 15 Jan 2011 15:15:00 +0000 Subject: [PATCH 6846/7878] * test/: Ignore more. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1059353 13f79535-47bb-0310-9956-ffa450edef68 From c86e51c9f6153642b8bdec92ff79b0037f07a22c Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 17 Jan 2011 17:01:46 +0000 Subject: [PATCH 6847/7878] Minor update for Darwin git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1059987 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 ------ include/apr.h.in | 8 +------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/configure.in b/configure.in index 5ecd0db07f2..92396368211 100644 --- a/configure.in +++ b/configure.in @@ -95,12 +95,6 @@ AH_BOTTOM([ #define SIZEOF_STRUCT_IOVEC 8 #endif -/* - * ./i386/_types.h:typedef long long __int64_t; - * ./sys/_types.h:typedef __int64_t __darwin_off_t; - * ./sys/types.h:typedef __darwin_off_t off_t; - * So off_t is always long long - */ #undef APR_OFF_T_STRFN #define APR_OFF_T_STRFN APR_INT64_STRFN diff --git a/include/apr.h.in b/include/apr.h.in index 3402f55d75c..ebca4dd2134 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -605,14 +605,8 @@ typedef apr_uint32_t apr_uintptr_t; #define APR_IS_BIGENDIAN 0 #endif -/* - * ./i386/_types.h:typedef long long __int64_t; - * ./sys/_types.h:typedef __int64_t __darwin_off_t; - * ./sys/types.h:typedef __darwin_off_t off_t; - * So off_t is always long long - */ #undef APR_OFF_T_FMT -#define APR_OFF_T_FMT "lld" +#define APR_OFF_T_FMT APR_INT64_T_FMT #endif /* DARWIN_10 */ From 87005d72b6b77fbc37bf59051c302df8501d7e64 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 17 Jan 2011 17:24:51 +0000 Subject: [PATCH 6848/7878] revert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1060010 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.h.in b/include/apr.h.in index ebca4dd2134..88f3cac76ce 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -606,7 +606,7 @@ typedef apr_uint32_t apr_uintptr_t; #endif #undef APR_OFF_T_FMT -#define APR_OFF_T_FMT APR_INT64_T_FMT +#define APR_OFF_T_FMT "lld" #endif /* DARWIN_10 */ From d00a66bbca9bdf6fe9e607ae598459607455b38d Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 17 Jan 2011 21:37:58 +0000 Subject: [PATCH 6849/7878] Fix cases where off_t (and APR_OFF_T_FMT) may be "larger" than int64 (and APR_INT64_T_FMT). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1060104 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 0131007996e..695739480f7 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -810,10 +810,27 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), adjust_precision = adjust_width = NO; /* - * Modifier check. Note that if APR_INT64_T_FMT is "d", - * the first if condition is never true. + * Modifier check. In same cases, APR_OFF_T_FMT can be + * "lld" and APR_INT64_T_FMT can be "ld" (that is, off_t is + * "larger" than int64). Check that case 1st. + * Note that if APR_OFF_T_FMT is "d", + * the first if condition is never true. If APR_INT64_T_FMT + * is "d' then the second if condition is never true. */ - if ((sizeof(APR_INT64_T_FMT) == 4 && + if ((sizeof(APR_OFF_T_FMT) > sizeof(APR_INT64_T_FMT)) && + (sizeof(APR_OFF_T_FMT) == 4 && + fmt[0] == APR_OFF_T_FMT[0] && + fmt[1] == APR_OFF_T_FMT[1]) || + (sizeof(APR_OFF_T_FMT) == 3 && + fmt[0] == APR_OFF_T_FMT[0]) || + (sizeof(APR_OFF_T_FMT) > 4 && + strncmp(fmt, APR_OFF_T_FMT, + sizeof(APR_OFF_T_FMT) - 2) == 0)) { + /* Need to account for trailing 'd' and null in sizeof() */ + var_type = IS_QUAD; + fmt += (sizeof(APR_OFF_T_FMT) - 2); + } + else if ((sizeof(APR_INT64_T_FMT) == 4 && fmt[0] == APR_INT64_T_FMT[0] && fmt[1] == APR_INT64_T_FMT[1]) || (sizeof(APR_INT64_T_FMT) == 3 && From 0e57479406a34ac2a9550cd179f9ba4dea94257d Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 19 Jan 2011 02:51:23 +0000 Subject: [PATCH 6850/7878] quite warning... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1060659 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 695739480f7..7c1aee52e72 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -818,14 +818,14 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), * is "d' then the second if condition is never true. */ if ((sizeof(APR_OFF_T_FMT) > sizeof(APR_INT64_T_FMT)) && - (sizeof(APR_OFF_T_FMT) == 4 && + ((sizeof(APR_OFF_T_FMT) == 4 && fmt[0] == APR_OFF_T_FMT[0] && fmt[1] == APR_OFF_T_FMT[1]) || (sizeof(APR_OFF_T_FMT) == 3 && fmt[0] == APR_OFF_T_FMT[0]) || (sizeof(APR_OFF_T_FMT) > 4 && strncmp(fmt, APR_OFF_T_FMT, - sizeof(APR_OFF_T_FMT) - 2) == 0)) { + sizeof(APR_OFF_T_FMT) - 2) == 0))) { /* Need to account for trailing 'd' and null in sizeof() */ var_type = IS_QUAD; fmt += (sizeof(APR_OFF_T_FMT) - 2); From 231283b6667f628de629d4dd88f78be0dd0881f4 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 27 Jan 2011 19:44:50 +0000 Subject: [PATCH 6851/7878] replace expensive % with faster (2-4x) functional equiv. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1064276 13f79535-47bb-0310-9956-ffa450edef68 --- util-misc/apr_queue.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/util-misc/apr_queue.c b/util-misc/apr_queue.c index 66b74dceaec..413069918c8 100644 --- a/util-misc/apr_queue.c +++ b/util-misc/apr_queue.c @@ -185,7 +185,9 @@ APR_DECLARE(apr_status_t) apr_queue_push(apr_queue_t *queue, void *data) } queue->data[queue->in] = data; - queue->in = (queue->in + 1) % queue->bounds; + queue->in++; + if (queue->in >= queue->bounds) + queue->in -= queue->bounds; queue->nelts++; if (queue->empty_waiters) { @@ -225,7 +227,9 @@ APR_DECLARE(apr_status_t) apr_queue_trypush(apr_queue_t *queue, void *data) } queue->data[queue->in] = data; - queue->in = (queue->in + 1) % queue->bounds; + queue->in++; + if (queue->in >= queue->bounds) + queue->in -= queue->bounds; queue->nelts++; if (queue->empty_waiters) { @@ -297,7 +301,9 @@ APR_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data) *data = queue->data[queue->out]; queue->nelts--; - queue->out = (queue->out + 1) % queue->bounds; + queue->out++; + if (queue->out >= queue->bounds) + queue->out -= queue->bounds; if (queue->full_waiters) { Q_DBG("signal !full", queue); rv = apr_thread_cond_signal(queue->not_full); @@ -337,7 +343,9 @@ APR_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data) *data = queue->data[queue->out]; queue->nelts--; - queue->out = (queue->out + 1) % queue->bounds; + queue->out++; + if (queue->out >= queue->bounds) + queue->out -= queue->bounds; if (queue->full_waiters) { Q_DBG("signal !full", queue); rv = apr_thread_cond_signal(queue->not_full); From 7a1fed220335f072c0c2984ff1f33a7e6fe1558f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Jan 2011 02:26:58 +0000 Subject: [PATCH 6852/7878] This was messed up in the rename to libaprapp-n.lib, solve make install git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1064429 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.win | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.win b/Makefile.win index 5e4e835d8a8..875519f153b 100644 --- a/Makefile.win +++ b/Makefile.win @@ -160,8 +160,8 @@ install: copy $(LIBSOSPATH)\apr-2.pdb "$(PREFIX)\lib\" <.y copy $(LIBSOSPATH)\aprapp-2.lib "$(PREFIX)\lib\" <.y copy $(LIBSOSPATH)\aprapp-2.pdb "$(PREFIX)\lib\" <.y - copy $(LIBSOSPATH)\libaprapp-2.lib "$(PREFIX)\lib\" <.y - copy $(LIBSOSPATH)\libaprapp-2.pdb "$(PREFIX)\lib\" <.y + copy $(ARCHOSPATH)\libaprapp-2.lib "$(PREFIX)\lib\" <.y + copy $(ARCHOSPATH)\libaprapp-2.pdb "$(PREFIX)\lib\" <.y copy $(ARCHOSPATH)\libapr-2.lib "$(PREFIX)\lib\" <.y copy $(ARCHOSPATH)\libapr-2.exp "$(PREFIX)\lib\" <.y copy $(ARCHOSPATH)\libapr-2.dll "$(PREFIX)\bin\" <.y From 603285431bd53913ae3ada57e269405f2c13864f Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Sun, 30 Jan 2011 12:51:48 +0000 Subject: [PATCH 6853/7878] Fix endianness issue in Oracle driver PR 50690 - Patch from Stefan Ruppert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1065258 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ dbd/apr_dbd_oracle.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 82781fac114..cd74afcca86 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_dbd_oracle: fix endianness issue in prepared statements + PR 50690 [Stefan Ruppert ] + *) Fix address handling when accepting an AF_INET socket from a socket bound as AF_INET6. PR 49678. [Joe Orton] diff --git a/dbd/apr_dbd_oracle.c b/dbd/apr_dbd_oracle.c index df3ebcc6756..832677d909f 100644 --- a/dbd/apr_dbd_oracle.c +++ b/dbd/apr_dbd_oracle.c @@ -860,6 +860,7 @@ static int dbd_oracle_prepare(apr_pool_t *pool, apr_dbd_t *sql, int ret = 0; int i; apr_dbd_prepared_t *stmt ; + apr_int16_t type; if (*statement == NULL) { *statement = apr_pcalloc(pool, sizeof(apr_dbd_prepared_t)); @@ -895,11 +896,12 @@ static int dbd_oracle_prepare(apr_pool_t *pool, apr_dbd_t *sql, apr_pool_cleanup_null); /* Perl gets statement type here */ - sql->status = OCIAttrGet(stmt->stmt, OCI_HTYPE_STMT, &stmt->type, 0, + sql->status = OCIAttrGet(stmt->stmt, OCI_HTYPE_STMT, &type, 0, OCI_ATTR_STMT_TYPE, sql->err); if (sql->status != OCI_SUCCESS) { return 1; } + stmt->type = type; /* Perl sets PREFETCH_MEMORY here, but the docs say there's a working default */ #if 0 From b0196bfef9c9b7585b165b9f729d68d83ecd2684 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 9 Feb 2011 12:50:53 +0000 Subject: [PATCH 6854/7878] Axed C++ comments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1068870 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 2 +- file_io/os2/readwrite.c | 2 +- file_io/win32/pipe.c | 20 ++++++++++---------- file_io/win32/readwrite.c | 4 ++-- include/arch/netware/apr_arch_threadproc.h | 12 +++++++----- include/arch/os2/apr_arch_file_io.h | 14 +++++++------- include/arch/win32/apr_arch_file_io.h | 21 +++++++++++---------- include/arch/win32/apr_arch_misc.h | 14 +++++++------- include/private/apr_dbd_odbc_v2.h | 2 +- locks/os2/proc_mutex.c | 2 +- locks/os2/thread_cond.c | 2 +- threadproc/netware/thread.c | 4 ++-- 12 files changed, 51 insertions(+), 48 deletions(-) diff --git a/build/aplibtool.c b/build/aplibtool.c index 602f045fe2b..1604e051ca2 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -194,7 +194,7 @@ bool parse_long_opt(char *arg, cmd_data_t *cmd_data) } else if (strcmp(var, "export-all") == 0) { export_all = true; } else if (strcmp(var, "tag") == 0) { - // What's this for? Ignore for now + /* What's this for? Ignore for now */ } else { return false; } diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 4f99a4ef4b9..d567ef3a5c0 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -167,7 +167,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a file_lock(thefile); if ( thefile->direction == 0 ) { - // Position file pointer for writing at the offset we are logically reading from + /* Position file pointer for writing at the offset we are logically reading from */ ULONG offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; if (offset != thefile->filePtr) DosSetFilePtr(thefile->filedes, offset, FILE_BEGIN, &thefile->filePtr ); diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 51da70801b3..1f5fd2d970f 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -141,10 +141,10 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, (*in)->filehand = CreateNamedPipe(name, dwOpenMode, dwPipeMode, - 1, //nMaxInstances, - 0, //nOutBufferSize, - 65536, //nInBufferSize, - 1, //nDefaultTimeOut, + 1, /* nMaxInstances, */ + 0, /* nOutBufferSize, */ + 65536, /* nInBufferSize, */ + 1, /* nDefaultTimeOut, */ &sa); /* Create the write end of the pipe */ @@ -158,12 +158,12 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, } (*out)->filehand = CreateFile(name, - GENERIC_WRITE, // access mode - 0, // share mode - &sa, // Security attributes - OPEN_EXISTING, // dwCreationDisposition - dwOpenMode, // Pipe attributes - NULL); // handle to template file + GENERIC_WRITE, /* access mode */ + 0, /* share mode */ + &sa, /* Security attributes */ + OPEN_EXISTING, /* dwCreationDisposition */ + dwOpenMode, /* Pipe attributes */ + NULL); /* handle to template file */ } else { /* Pipes on Win9* are blocking. Live with it. */ diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 7041bc6b84a..701bec75b87 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -272,7 +272,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } if (thefile->direction == 0) { - // Position file pointer for writing at the offset we are logically reading from + /* Position file pointer for writing at the offset we are logically reading from */ apr_off_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; DWORD offlo = (DWORD)offset; LONG offhi = (LONG)(offset >> 32); @@ -284,7 +284,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = 0; while (rv == 0 && size > 0) { - if (thefile->bufpos == thefile->bufsize) // write buffer is full + if (thefile->bufpos == thefile->bufsize) /* write buffer is full */ rv = apr_file_flush(thefile); blocksize = size > thefile->bufsize - thefile->bufpos ? diff --git a/include/arch/netware/apr_arch_threadproc.h b/include/arch/netware/apr_arch_threadproc.h index 713ed295af0..2fee2c00eeb 100644 --- a/include/arch/netware/apr_arch_threadproc.h +++ b/include/arch/netware/apr_arch_threadproc.h @@ -68,11 +68,13 @@ struct apr_thread_once_t { unsigned long value; }; -//struct apr_proc_t { -// apr_pool_t *pool; -// pid_t pid; -// apr_procattr_t *attr; -//}; +/* +struct apr_proc_t { + apr_pool_t *pool; + pid_t pid; + apr_procattr_t *attr; +}; +*/ #endif /* ! THREAD_PROC_H */ diff --git a/include/arch/os2/apr_arch_file_io.h b/include/arch/os2/apr_arch_file_io.h index 16cce943f52..a742bf47729 100644 --- a/include/arch/os2/apr_arch_file_io.h +++ b/include/arch/os2/apr_arch_file_io.h @@ -49,13 +49,13 @@ struct apr_file_t { /* Stuff for buffered mode */ char *buffer; - apr_size_t bufsize; // The size of the buffer - apr_size_t bufpos; // Read/Write position in buffer - unsigned long dataRead; // amount of valid data read into buffer - int direction; // buffer being used for 0 = read, 1 = write - unsigned long filePtr; // position in file of handle - apr_thread_mutex_t *mutex;// mutex semaphore, must be owned to access the above fields - + apr_size_t bufsize; /* The size of the buffer */ + apr_size_t bufpos; /* Read/Write position in buffer */ + unsigned long dataRead; /* amount of valid data read into buffer */ + int direction; /* buffer being used for 0 = read, 1 = write */ + unsigned long filePtr; /* position in file of handle */ + apr_thread_mutex_t *mutex; /* mutex semaphore, must be owned to access + the above fields */ int ungetchar; }; diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index 28f2c247f86..7c5996cab3b 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -155,13 +155,13 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, * correctly when writing to a file with this flag set TRUE. */ -// for apr_poll.c; +/* for apr_poll.c */ #define filedes filehand struct apr_file_t { apr_pool_t *pool; HANDLE filehand; - BOOLEAN pipe; // Is this a pipe of a file? + BOOLEAN pipe; /* Is this a pipe of a file? */ OVERLAPPED *pOverlapped; apr_interval_time_t timeout; apr_int32_t flags; @@ -171,18 +171,19 @@ struct apr_file_t { char *fname; DWORD dwFileAttributes; int eof_hit; - BOOLEAN buffered; // Use buffered I/O? - int ungetchar; // Last char provided by an unget op. (-1 = no char) + BOOLEAN buffered; /* Use buffered I/O? */ + int ungetchar; /* Last char provided by an unget op. (-1 = no char) */ int append; /* Stuff for buffered mode */ char *buffer; - apr_size_t bufpos; // Read/Write position in buffer - apr_size_t bufsize; // The size of the buffer - apr_size_t dataRead; // amount of valid data read into buffer - int direction; // buffer being used for 0 = read, 1 = write - apr_off_t filePtr; // position in file of handle - apr_thread_mutex_t *mutex; // mutex semaphore, must be owned to access the above fields + apr_size_t bufpos; /* Read/Write position in buffer */ + apr_size_t bufsize; /* The size of the buffer */ + apr_size_t dataRead; /* amount of valid data read into buffer */ + int direction; /* buffer being used for 0 = read, 1 = write */ + apr_off_t filePtr; /* position in file of handle */ + apr_thread_mutex_t *mutex; /* mutex semaphore, must be owned to access + the above fields */ #if APR_FILES_AS_SOCKETS /* if there is a timeout set, then this pollset is used */ diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index 75d7327c0f4..bf783c1d28a 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -172,13 +172,13 @@ static APR_INLINE void* apr_realloc_dbg(void* userData, size_t newSize, #endif /* ! _MSC_VER */ typedef enum { - DLL_WINBASEAPI = 0, // kernel32 From WinBase.h - DLL_WINADVAPI = 1, // advapi32 From WinBase.h - DLL_WINSOCKAPI = 2, // mswsock From WinSock.h - DLL_WINSOCK2API = 3, // ws2_32 From WinSock2.h - DLL_SHSTDAPI = 4, // shell32 From ShellAPI.h - DLL_NTDLL = 5, // shell32 From our real kernel - DLL_defined = 6 // must define as last idx_ + 1 + DLL_WINBASEAPI = 0, /* kernel32 From WinBase.h */ + DLL_WINADVAPI = 1, /* advapi32 From WinBase.h */ + DLL_WINSOCKAPI = 2, /* mswsock From WinSock.h */ + DLL_WINSOCK2API = 3, /* ws2_32 From WinSock2.h */ + DLL_SHSTDAPI = 4, /* shell32 From ShellAPI.h */ + DLL_NTDLL = 5, /* shell32 From our real kernel */ + DLL_defined = 6 /* must define as last idx_ + 1 */ } apr_dlltoken_e; FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); diff --git a/include/private/apr_dbd_odbc_v2.h b/include/private/apr_dbd_odbc_v2.h index dc7bc9c9c38..d9f56318993 100644 --- a/include/private/apr_dbd_odbc_v2.h +++ b/include/private/apr_dbd_odbc_v2.h @@ -23,7 +23,7 @@ * */ -#define SQLHANDLE SQLHENV // Presumes that ENV, DBC, and STMT handles are all the same datatype +#define SQLHANDLE SQLHENV /* Presumes that ENV, DBC, and STMT handles are all the same datatype */ #define SQL_NULL_HANDLE 0 #define SQL_HANDLE_STMT 1 #define SQL_HANDLE_DBC 2 diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 6655abb6061..9b53c0befb1 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -32,7 +32,7 @@ static char *fixed_name(const char *fname, apr_pool_t *pool) if (fname == NULL) semname = NULL; else { - // Semaphores don't live in the file system, fix up the name + /* Semaphores don't live in the file system, fix up the name */ while (*fname == '/' || *fname == '\\') { fname++; } diff --git a/locks/os2/thread_cond.c b/locks/os2/thread_cond.c index 97af18765d9..284bd00f197 100644 --- a/locks/os2/thread_cond.c +++ b/locks/os2/thread_cond.c @@ -24,7 +24,7 @@ #include #ifndef DCE_POSTONE -#define DCE_POSTONE 0x0800 // Post one flag +#define DCE_POSTONE 0x0800 /* Post one flag */ #endif static apr_status_t thread_cond_cleanup(void *data) diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 61dbdc157d6..82b846aaff0 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -134,10 +134,10 @@ apr_status_t apr_thread_create(apr_thread_t **new, /* long flags */ flags, /* NXThreadId_t *thread_id */ &(*new)->td); - if(stat==0) + if (stat == 0) return APR_SUCCESS; - return(stat);// if error + return(stat); /* if error */ } apr_os_thread_t apr_os_thread_current() From 98427986f4a534b802e97bb80fac2ebd420b7178 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 15 Feb 2011 12:03:04 +0000 Subject: [PATCH 6855/7878] Disable getpass() for HP-UX platform (PR49496). Reported by rajeshkc yahoo.com. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1070855 13f79535-47bb-0310-9956-ffa450edef68 --- passwd/apr_getpass.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 48aef1c0c6c..c12826ca2b3 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -56,8 +56,12 @@ #endif /* Disable getpass() support when PASS_MAX is defined and is "small", - * for an arbitrary definition of "small". */ -#if defined(HAVE_GETPASS) && defined(PASS_MAX) && PASS_MAX < 32 + * for an arbitrary definition of "small". + * HP-UX truncates passwords (PR49496) so we disable getpass() for + * this platform too. + */ +#if defined(HAVE_GETPASS) && \ + (defined(PASS_MAX) && PASS_MAX < 32) || defined(__hpux) || defined(__hpux__) #undef HAVE_GETPASS #endif From 45647f6199309732ce6c461fd4ee9c91a91477d4 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 18 Feb 2011 21:40:42 +0000 Subject: [PATCH 6856/7878] note that keys are case insensitive git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1072159 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index 0ace8ded919..1e7a57d1627 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -271,7 +271,7 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); * Add a key/value pair to a table. If another element already exists with the * same key, this will overwrite the old data. * @param t The table to add the data to. - * @param key The key to use + * @param key The key to use (case does not matter) * @param val The value to add * @remark When adding data, this function makes a copy of both the key and the * value. From fe42155f1b485d37f473e9927060ae74b9c39b87 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 18 Feb 2011 21:51:56 +0000 Subject: [PATCH 6857/7878] Add new configure option --enable-allocator-uses-mmap to use mmap instead of malloc in apr_allocator_alloc(). This greatly reduces memory fragmentation with malloc implementations (e.g. glibc) that don't handle allocationss of a page-size-multiples in an efficient way. It also makes apr_allocator_max_free_set() actually have some effect on such platforms. The handling of page sizes other than 4k seems like a lot of trouble for a very small number of platforms, but there does not seem to be a reasonable way to check this at compile time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1072165 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++++ configure.in | 12 +++++++++ memory/unix/apr_pools.c | 57 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 75 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index cd74afcca86..ce4431600e2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,13 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add new configure option --enable-allocator-uses-mmap to use mmap + instead of malloc in apr_allocator_alloc(). This greatly reduces + memory fragmentation with malloc implementations (e.g. glibc) that + don't handle allocationss of a page-size-multiples in an efficient way. + It also makes apr_allocator_max_free_set() actually have some effect + on such platforms. [Stefan Fritsch] + *) apr_dbd_oracle: fix endianness issue in prepared statements PR 50690 [Stefan Ruppert ] diff --git a/configure.in b/configure.in index 92396368211..a34d7b4cf06 100644 --- a/configure.in +++ b/configure.in @@ -1404,6 +1404,18 @@ if test "$netdbh" = "1"; then fi fi +AC_ARG_ENABLE(allocator-uses-mmap, + [ --enable-allocator-uses-mmap Use mmap in apr_allocator instead of malloc ], + [ if test "$enableval" = "yes"; then + APR_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON, + [AC_DEFINE(APR_ALLOCATOR_USES_MMAP, 1, + [Define if apr_allocator should use mmap]) ], + [AC_MSG_ERROR([mmap()/MAP_ANON not supported]) ] + ) + fi ], + [ ] +) + dnl ----------------------------- Checks for standard typedefs AC_TYPE_OFF_T AC_TYPE_PID_T diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index ca76db33eb6..96aff7a087a 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -36,9 +36,12 @@ #endif #if APR_HAVE_UNISTD_H -#include /* for getpid */ +#include /* for getpid and sysconf */ #endif +#if APR_ALLOCATOR_USES_MMAP +#include +#endif /* * Magic numbers @@ -47,8 +50,15 @@ #define MIN_ALLOC 8192 #define MAX_INDEX 20 +#if APR_ALLOCATOR_USES_MMAP && defined(_SC_PAGESIZE) +static unsigned int boundary_index; +static unsigned int boundary_size; +#define BOUNDARY_INDEX boundary_index +#define BOUNDARY_SIZE boundary_size +#else #define BOUNDARY_INDEX 12 #define BOUNDARY_SIZE (1 << BOUNDARY_INDEX) +#endif /* * Timing constants for killing subprocesses @@ -131,7 +141,11 @@ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) ref = &allocator->free[index]; while ((node = *ref) != NULL) { *ref = node->next; +#if APR_ALLOCATOR_USES_MMAP + munmap(node, (node->index+1) << BOUNDARY_INDEX); +#else free(node); +#endif } } @@ -323,7 +337,12 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) /* If we haven't got a suitable node, malloc a new one * and initialize it. */ +#if APR_ALLOCATOR_USES_MMAP + if ((node = mmap(NULL, size, PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANON, -1, 0)) == MAP_FAILED) +#else if ((node = malloc(size)) == NULL) +#endif return NULL; node->next = NULL; @@ -400,7 +419,11 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) while (freelist != NULL) { node = freelist; freelist = node->next; +#if APR_ALLOCATOR_USES_MMAP + munmap(node, (node->index+1) << BOUNDARY_INDEX); +#else free(node); +#endif } } @@ -548,6 +571,14 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) if (apr_pools_initialized++) return APR_SUCCESS; +#if APR_ALLOCATOR_USES_MMAP && defined(_SC_PAGESIZE) + boundary_size = sysconf(_SC_PAGESIZE); + boundary_index = 12; + while ( (1 << boundary_index) < boundary_size) + boundary_index++; + boundary_size = (1 << boundary_index); +#endif + if ((rv = apr_allocator_create(&global_allocator)) != APR_SUCCESS) { apr_pools_initialized = 0; return rv; @@ -923,6 +954,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, if (!apr_pools_initialized) return APR_ENOPOOL; if ((pool_allocator = allocator) == NULL) { +#if !APR_ALLOCATOR_USES_MMAP if ((pool_allocator = malloc(MIN_ALLOC)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -936,6 +968,21 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, node->index = 1; node->first_avail = (char *)node + APR_MEMNODE_T_SIZE; node->endp = (char *)pool_allocator + MIN_ALLOC; +#else + if (apr_allocator_create(&pool_allocator) != APR_SUCCESS) { + if (abort_fn) + abort_fn(APR_ENOMEM); + + return APR_ENOMEM; + } + if ((node = allocator_alloc(pool_allocator, + MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { + if (abort_fn) + abort_fn(APR_ENOMEM); + + return APR_ENOMEM; + } +#endif } else if ((node = allocator_alloc(pool_allocator, MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { @@ -1331,6 +1378,14 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) if (apr_pools_initialized++) return APR_SUCCESS; +#if APR_ALLOCATOR_USES_MMAP && defined(_SC_PAGESIZE) + boundary_size = sysconf(_SC_PAGESIZE); + boundary_index = 12; + while ( (1 << boundary_index) < boundary_size) + boundary_index++; + boundary_size = (1 << boundary_index); +#endif + /* Since the debug code works a bit differently then the * regular pools code, we ask for a lock here. The regular * pools code has got this lock embedded in the global From 574f3409bdec9dcc0cba9d65cc9fb2a4f1d261df Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 21 Feb 2011 12:07:33 +0000 Subject: [PATCH 6858/7878] add hook function args to the hook probe invocations git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1072937 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hooks.h | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/include/apr_hooks.h b/include/apr_hooks.h index a6fc0daf72e..ff8e4b1b1ff 100644 --- a/include/apr_hooks.h +++ b/include/apr_hooks.h @@ -63,8 +63,10 @@ extern "C" { * this macro, and will be provided to the other hook probe macros. * @param ns The namespace prefix of the hook functions * @param name The name of the hook + * @param args The argument list to the hook functions, with enclosing + * parens. */ -#define APR_HOOK_PROBE_ENTRY(ud,ns,name) +#define APR_HOOK_PROBE_ENTRY(ud,ns,name,args) /** * User-defined hook probe macro that is invoked after the hook * has run. @@ -73,8 +75,10 @@ extern "C" { * @param ns The namespace prefix of the hook functions * @param name The name of the hook * @param rv The return value of the hook, or 0 if the hook is void. + * @param args The argument list to the hook functions, with enclosing + * parens. */ -#define APR_HOOK_PROBE_RETURN(ud,ns,name,rv) +#define APR_HOOK_PROBE_RETURN(ud,ns,name,rv,args) /** * User-defined hook probe macro that is invoked before calling a * hook function. @@ -84,8 +88,10 @@ extern "C" { * @param name The name of the hook * @param src The value of apr_hook_debug_current at the time the function * was hooked (usually the source file implementing the hook function). + * @param args The argument list to the hook functions, with enclosing + * parens. */ -#define APR_HOOK_PROBE_INVOKE(ud,ns,name,src) +#define APR_HOOK_PROBE_INVOKE(ud,ns,name,src,args) /** * User-defined hook probe macro that is invoked after calling a * hook function. @@ -96,8 +102,10 @@ extern "C" { * @param src The value of apr_hook_debug_current at the time the function * was hooked (usually the source file implementing the hook function). * @param rv The return value of the hook function, or 0 if the hook is void. + * @param args The argument list to the hook functions, with enclosing + * parens. */ -#define APR_HOOK_PROBE_COMPLETE(ud,ns,name,src,rv) +#define APR_HOOK_PROBE_COMPLETE(ud,ns,name,src,rv,args) #endif /** @} */ @@ -176,20 +184,20 @@ link##_DECLARE(void) ns##_run_##name args_decl \ int n; \ APR_HOOK_INT_DCL_UD; \ \ - APR_HOOK_PROBE_ENTRY(ud, ns, name); \ + APR_HOOK_PROBE_ENTRY(ud, ns, name, args_use); \ \ if(_hooks.link_##name) \ { \ pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \ for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ { \ - APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName); \ + APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName, args_use); \ pHook[n].pFunc args_use; \ - APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, 0); \ + APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, 0, args_use); \ } \ } \ \ - APR_HOOK_PROBE_RETURN(ud, ns, name, 0); \ + APR_HOOK_PROBE_RETURN(ud, ns, name, 0, args_use); \ \ } @@ -220,23 +228,23 @@ link##_DECLARE(ret) ns##_run_##name args_decl \ ret rv = ok; \ APR_HOOK_INT_DCL_UD; \ \ - APR_HOOK_PROBE_ENTRY(ud, ns, name); \ + APR_HOOK_PROBE_ENTRY(ud, ns, name, args_use); \ \ if(_hooks.link_##name) \ { \ pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \ for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ { \ - APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName); \ + APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName, args_use); \ rv=pHook[n].pFunc args_use; \ - APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, rv); \ + APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, rv, args_use); \ if(rv != ok && rv != decline) \ break; \ rv = ok; \ } \ } \ \ - APR_HOOK_PROBE_RETURN(ud, ns, name, rv); \ + APR_HOOK_PROBE_RETURN(ud, ns, name, rv, args_use); \ \ return rv; \ } @@ -265,23 +273,23 @@ link##_DECLARE(ret) ns##_run_##name args_decl \ ret rv = decline; \ APR_HOOK_INT_DCL_UD; \ \ - APR_HOOK_PROBE_ENTRY(ud, ns, name); \ + APR_HOOK_PROBE_ENTRY(ud, ns, name, args_use); \ \ if(_hooks.link_##name) \ { \ pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \ for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ { \ - APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName); \ + APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName, args_use); \ rv=pHook[n].pFunc args_use; \ - APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, rv); \ + APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, rv, args_use); \ \ if(rv != decline) \ break; \ } \ } \ \ - APR_HOOK_PROBE_RETURN(ud, ns, name, rv); \ + APR_HOOK_PROBE_RETURN(ud, ns, name, rv, args_use); \ \ return rv; \ } From dcc5dc96f4e02ea4fb9f2175af96f9ca40258a1d Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 21 Feb 2011 21:23:36 +0000 Subject: [PATCH 6859/7878] apr_file_flush_locked(): Handle short writes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1073142 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ file_io/unix/readwrite.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index ce4431600e2..5c07f877c8f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_file_flush_locked(): Handle short writes. [Stefan Fritsch] + *) Add new configure option --enable-allocator-uses-mmap to use mmap instead of malloc in apr_allocator_alloc(). This greatly reduces memory fragmentation with malloc implementations (e.g. glibc) that diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index d736b5ea4f4..f1287387730 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -400,12 +400,16 @@ apr_status_t apr_file_flush_locked(apr_file_t *thefile) apr_status_t rv = APR_SUCCESS; if (thefile->direction == 1 && thefile->bufpos) { - apr_ssize_t written; + apr_ssize_t written = 0, ret; do { - written = write(thefile->filedes, thefile->buffer, thefile->bufpos); - } while (written == -1 && errno == EINTR); - if (written == -1) { + ret = write(thefile->filedes, thefile->buffer + written, + thefile->bufpos - written); + if (ret > 0) + written += ret; + } while (written < thefile->bufpos && + (ret > 0 || (ret == -1 && errno == EINTR))); + if (ret == -1) { rv = errno; } else { thefile->filePtr += written; From df7983eb21e004572457fa3092fae6611e3f2950 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 22 Feb 2011 01:28:01 +0000 Subject: [PATCH 6860/7878] sync up with hook probe macro changes in r1072937 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1073198 13f79535-47bb-0310-9956-ffa450edef68 --- test/testhooks.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testhooks.c b/test/testhooks.c index 9e1ebf3e375..bf5de120d1a 100644 --- a/test/testhooks.c +++ b/test/testhooks.c @@ -19,16 +19,16 @@ #define APR_HOOK_PROBES_ENABLED -#define APR_HOOK_PROBE_ENTRY(ud,ns,name) \ +#define APR_HOOK_PROBE_ENTRY(ud,ns,name,args) \ ud = toy_hook_probe_entry(#name) -#define APR_HOOK_PROBE_RETURN(ud,ns,name,rv) \ +#define APR_HOOK_PROBE_RETURN(ud,ns,name,rv,args) \ toy_hook_probe_return(ud, #name, rv) -#define APR_HOOK_PROBE_INVOKE(ud,ns,name,src) \ +#define APR_HOOK_PROBE_INVOKE(ud,ns,name,src,args) \ toy_hook_probe_invoke(ud, #name, src) -#define APR_HOOK_PROBE_COMPLETE(ud,ns,name,src,rv) \ +#define APR_HOOK_PROBE_COMPLETE(ud,ns,name,src,rv,args) \ toy_hook_probe_complete(ud, #name, src, rv) #include "apr_hooks.h" From 94ed34a5460c26fba9b2c0597d8421c7538238be Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sat, 26 Feb 2011 09:51:36 +0000 Subject: [PATCH 6861/7878] Axed C++ comments and tabs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1074811 13f79535-47bb-0310-9956-ffa450edef68 --- locks/netware/thread_rwlock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locks/netware/thread_rwlock.c b/locks/netware/thread_rwlock.c index d0bf3ddf342..f971aefd47b 100644 --- a/locks/netware/thread_rwlock.c +++ b/locks/netware/thread_rwlock.c @@ -34,12 +34,12 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, { apr_thread_rwlock_t *new_rwlock = NULL; - NXHierarchy_t hierarchy = 1; //for libc NKS NXRwLockAlloc - NXLockInfo_t *info; //for libc NKS NXRwLockAlloc + NXHierarchy_t hierarchy = 1; /* for libc NKS NXRwLockAlloc */ + NXLockInfo_t *info; /* for libc NKS NXRwLockAlloc */ new_rwlock = (apr_thread_rwlock_t *)apr_pcalloc(pool, sizeof(apr_thread_rwlock_t)); - - if(new_rwlock ==NULL) { + + if(new_rwlock ==NULL) { return APR_ENOMEM; } new_rwlock->pool = pool; From bf5677280c6cd94bf02f8f70ba9d6452b695db85 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sat, 26 Feb 2011 10:30:18 +0000 Subject: [PATCH 6862/7878] Axed C++ comments and tabs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1074817 13f79535-47bb-0310-9956-ffa450edef68 --- include/private/apr_dbd_odbc_v2.h | 50 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/include/private/apr_dbd_odbc_v2.h b/include/private/apr_dbd_odbc_v2.h index d9f56318993..b8da7b181f9 100644 --- a/include/private/apr_dbd_odbc_v2.h +++ b/include/private/apr_dbd_odbc_v2.h @@ -17,13 +17,13 @@ /* ONLY USED FOR ODBC Version 2 -DODBCV2 * -* Re-define everything to work (more-or-less) in an ODBC V2 environment +* Re-define everything to work (more-or-less) in an ODBC V2 environment * Random access to retrieved rows is not supported - i.e. calls to apr_dbd_select() cannot * have a 'random' argument of 1. apr_dbd_get_row() must always pass rownum as 0 (get next row) * */ -#define SQLHANDLE SQLHENV /* Presumes that ENV, DBC, and STMT handles are all the same datatype */ +#define SQLHANDLE SQLHENV /* Presumes that ENV, DBC, and STMT handles are all the same datatype */ #define SQL_NULL_HANDLE 0 #define SQL_HANDLE_STMT 1 #define SQL_HANDLE_DBC 2 @@ -87,32 +87,32 @@ #undef SQLColAttribute #define SQLColAttribute(s, c, f, a, l, m, n) SQLColAttributes(s, c, f, a, l, m, n) -#define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE -#define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT -#define SQL_ATTR_CONNECTION_TIMEOUT 113 -#define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER -#define SQL_ATTR_DISCONNECT_BEHAVIOR 114 -#define SQL_ATTR_ENLIST_IN_DTC 1207 -#define SQL_ATTR_ENLIST_IN_XA 1208 - -#define SQL_ATTR_CONNECTION_DEAD 1209 -#define SQL_CD_TRUE 1L /* Connection is closed/dead */ -#define SQL_CD_FALSE 0L /* Connection is open/available */ - -#define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT -#define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS -#define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE -#define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE -#define SQL_ATTR_TRACE SQL_OPT_TRACE -#define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE -#define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL -#define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION -#define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION +#define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE +#define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT +#define SQL_ATTR_CONNECTION_TIMEOUT 113 +#define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER +#define SQL_ATTR_DISCONNECT_BEHAVIOR 114 +#define SQL_ATTR_ENLIST_IN_DTC 1207 +#define SQL_ATTR_ENLIST_IN_XA 1208 + +#define SQL_ATTR_CONNECTION_DEAD 1209 +#define SQL_CD_TRUE 1L /* Connection is closed/dead */ +#define SQL_CD_FALSE 0L /* Connection is open/available */ + +#define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT +#define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS +#define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE +#define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE +#define SQL_ATTR_TRACE SQL_OPT_TRACE +#define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE +#define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL +#define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION +#define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION #define SQL_ATTR_CURSOR_SCROLLABLE -1 -#define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */ -#define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */ +#define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */ +#define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */ #define SQL_FALSE 0 #define SQL_TRUE 1 From 117b32d86745de2009febccea0519385b9f857e4 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 26 Feb 2011 16:55:06 +0000 Subject: [PATCH 6863/7878] Makr APR_RING_HEAD pointers volatile to work around an aliasing problem that causes gcc 4.5 to miscompile some brigade related code. PR 50190 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1074876 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_ring.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 5c07f877c8f..f4b767a88e2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_ring: Workaround for aliasing problem that causes gcc 4.5 to + miscompile some brigade related code. PR 50190. [Stefan Fritsch] + *) apr_file_flush_locked(): Handle short writes. [Stefan Fritsch] *) Add new configure option --enable-allocator-uses-mmap to use mmap diff --git a/include/apr_ring.h b/include/apr_ring.h index 935b07fc5d0..eec735fcf58 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -90,8 +90,8 @@ */ #define APR_RING_HEAD(head, elem) \ struct head { \ - struct elem *next; \ - struct elem *prev; \ + struct elem * volatile next; \ + struct elem * volatile prev; \ } /** From 6866e29c169e677a695d7e3ac86ef3c51fe41c23 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 26 Feb 2011 18:53:22 +0000 Subject: [PATCH 6864/7878] clarify docs for apr_file_gets git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1074899 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 97eaf4873f5..61b58ffb569 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -580,11 +580,12 @@ APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile); APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile); /** - * Read a string from the specified file. + * Read a line from the specified file * @param str The buffer to store the string in. * @param len The length of the string * @param thefile The file descriptor to read from * @remark The buffer will be NUL-terminated if any characters are stored. + * The newline at the end of the line will not be stripped. */ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile); From b7c39f3d8b6c6c85e1b9fde9f818ab695c4287d9 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Wed, 2 Mar 2011 08:03:23 +0000 Subject: [PATCH 6865/7878] * Remove empty [ ] block as it causes an empty "else fi" block that the shell does not like. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1076133 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index a34d7b4cf06..55fd922fd8f 100644 --- a/configure.in +++ b/configure.in @@ -1410,10 +1410,9 @@ AC_ARG_ENABLE(allocator-uses-mmap, APR_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON, [AC_DEFINE(APR_ALLOCATOR_USES_MMAP, 1, [Define if apr_allocator should use mmap]) ], - [AC_MSG_ERROR([mmap()/MAP_ANON not supported]) ] - ) - fi ], - [ ] + [AC_MSG_ERROR([mmap()/MAP_ANON not supported]) ] + ) + fi ] ) dnl ----------------------------- Checks for standard typedefs From 2a980a2ab2181b70a28ab84d491e0e07752bcad8 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 4 Mar 2011 01:16:53 +0000 Subject: [PATCH 6866/7878] Set eol-style native. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1076915 13f79535-47bb-0310-9956-ffa450edef68 --- xml/expat_config.hnw | 61 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/xml/expat_config.hnw b/xml/expat_config.hnw index 3b646431a72..ea6428349c2 100644 --- a/xml/expat_config.hnw +++ b/xml/expat_config.hnw @@ -1,31 +1,30 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef EXPAT_CONFIG_HNW -#define EXPAT_CONFIG_HNW - -#include -#include - -#define HAVE_MEMMOVE 1 - -#define XML_NS 1 -#define XML_DTD 1 -#define XML_BYTE_ORDER 12 -#define XML_CONTEXT_BYTES 1024 - -#endif /* EXPAT_CONFIG_HNW */ - +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef EXPAT_CONFIG_HNW +#define EXPAT_CONFIG_HNW + +#include + +#define HAVE_MEMMOVE 1 + +#define XML_NS 1 +#define XML_DTD 1 +#define XML_BYTE_ORDER 12 +#define XML_CONTEXT_BYTES 1024 + +#endif /* EXPAT_CONFIG_HNW */ + From 31838b6032110525bd05a1255d70d2a9ee35cfdc Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 4 Mar 2011 01:19:29 +0000 Subject: [PATCH 6867/7878] NetWare build overhaul in order to compile on Linux. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1076916 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 4 +- build/NWGNUenvironment.inc | 65 ++++++++++++++------------ build/NWGNUhead.inc | 21 ++++----- build/NWGNUmakefile | 23 ++++++++-- build/NWGNUtail.inc | 94 ++++++++++++++++++++++++++------------ misc/netware/aprlib.def | 3 -- xml/NWGNUmakefile | 12 +++++ 7 files changed, 142 insertions(+), 80 deletions(-) delete mode 100644 misc/netware/aprlib.def diff --git a/NWGNUmakefile b/NWGNUmakefile index b4fb0321979..69e267bae95 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -275,8 +275,8 @@ endif #If the LDAP support is defined then add the imports ifneq "$(LDAPSDK)" "" FILES_nlm_Ximports += \ - @$(LDAPSDK)/imports/lldapsdk.imp \ - @$(LDAPSDK)/imports/lldapssl.imp \ + @lldapsdk.imp \ + @lldapssl.imp \ $(EOLIST) endif diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 259c5245818..44ef89b1493 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -143,6 +143,38 @@ LIB = mwldnlm -type library -w nocmdline # Setup build tools AWK = awk +# +# Declare Command and tool macros here +# + +ifeq "$(OSTYPE)" "linux" +DEL = $(RM) +MD = mkdir -p +DELTREE = rmdir -p +CP = cp -av +XCP = cp -ar +CHK = test -e +CHKNOT = test ! -e +ECHONL = echo "" +DL = ' +else +ifeq "$(OS)" "Windows_NT" +CMD = cmd /c +DEL = del /q /f 2>NUL +DELTREE = rd /s /q 2>NUL +else +CMD = command /c +DEL = del +DELTREE = deltree /y +endif +MD = md 2>NUL +CP = copy /y 2>NUL +XCP = xcopy /e /y 2>NUL +CHK = $(CMD) if exist +CHKNOT = $(CMD) if not exist +ECHONL = $(CMD) echo. +endif + ifdef IPV6 ifndef USE_STDSOCKETS USE_STDSOCKETS=1 @@ -151,7 +183,7 @@ endif NOVI = $(NOVELLLIBC)/imports -INCDIRS = $(NOVELLLIBC)/include;$(NOVELLLIBC)/include/nks; +INCDIRS = $(NOVELLLIBC)/include; DEFINES = -DNETWARE ifdef USE_STDSOCKETS @@ -214,7 +246,9 @@ endif CFLAGS += -prefix apr_arch_pre_nw.h +ifneq "$(OSTYPE)" "linux" PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools +endif # # Declare major project deliverables output directories here @@ -279,35 +313,6 @@ INSTDEVDIRS := \ INSTDIRS += \ $(INSTALLBASE) -# -# Declare Command and tool macros here -# - -# Os2LibPath is an extra check to see if we are on NT -ifdef Os2LibPath -OS = Windows_NT -endif - -ifeq "$(OS)" "Windows_NT" -CMD = cmd /C -DEL = del /F -DELTREE = $(CMD) rd /s/q -WINNT = 1 -else -CMD = command /C -DEL = del -DELTREE = deltree /y -endif -CP = copy /Y -XCP = xcopy /E /Y -CHK = $(CMD) if exist -CHKNOT = $(CMD) if not exist - - -# -# Setup base C compiler flags -# - # # Common directories # diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc index e9a5d097a4f..427e5ffe91f 100644 --- a/build/NWGNUhead.inc +++ b/build/NWGNUhead.inc @@ -26,7 +26,7 @@ install :: NO_LICENSE_FILE installdev :: NO_LICENSE_FILE NO_LICENSE_FILE : - $(MAKE) $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(METROWERKS)\license.dat" + $(MAKE) $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(METROWERKS)/license.dat" else # LM_LICENSE_FILE must be defined so use the real targets @@ -51,21 +51,20 @@ help : @echo clean . . . . . . deletes $(OBJDIR) dirs, *.err, and *.map @echo clobber_all . . . deletes all possible output from the make @echo clobber_install . deletes all files in $(INSTALL) - @$(CMD) echo. + @$(ECHONL) @echo Multiple targets can be used on a single nmake command line - @echo (i.e. $(MAKE) clean all) - @$(CMD) echo. + @$(ECHONL) @echo You can also specify RELEASE=debug, RELEASE=noopt, or RELEASE=release @echo The default is RELEASE=release clobber_all :: clean clobber_install clobber_install :: - -$(DELTREE) $(INSTALL) 2>NUL + -$(DELTREE) $(INSTALL) test :: default $(MAKE) -C $(APRTEST) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(LM_LICENSE_FILE)" - $(CMD) echo. # # build recursive targets @@ -73,13 +72,13 @@ test :: default $(SUBDIRS) : FORCE ifneq "$(MAKECMDGOALS)" "clean" - $(CMD) echo. + @$(ECHONL) @echo Building $(CURDIR)/$@ endif $(MAKE) -C $@ $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(LM_LICENSE_FILE)" - $(CMD) echo. + @$(ECHONL) -FORCE: +FORCE : ; # # Standard targets @@ -87,13 +86,13 @@ FORCE: clean :: $(SUBDIRS) $(APRTEST) @echo Cleaning up $(CURDIR) - -$(DELTREE) $(OBJDIR) 2> NUL + -$(DELTREE) $(OBJDIR) $(CHK) *.err $(DEL) *.err $(CHK) *.map $(DEL) *.map $(CHK) *.d $(DEL) *.d $(CHK) *.tmp $(DEL) *.tmp - -$(DELTREE) $(OBJDIR) 2> NUL + -$(DELTREE) $(OBJDIR) $(OBJDIR) :: - $(CHKNOT) $(OBJDIR)\nul mkdir $(OBJDIR) + -$(MD) $@ diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index b15ad8b23e2..fb6f1183d97 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -26,16 +26,17 @@ FILES_prebuild_headers = \ nlms :: $(APR)/aprlib.imp $(APR)/aprlib.imp : make_nw_export.awk nw_export.i - @echo Generating $@ +# @echo Generating $@ + @echo GEN $@ $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ | sort >$@ nw_export.i : nw_export.inc $(FILES_prebuild_headers) $(NLM_NAME)_cc.opt - @echo Generating $@ +# @echo Generating $@ + @echo GEN $@ $(CC) $< @$(NLM_NAME)_cc.opt $(NLM_NAME)_cc.opt : NWGNUmakefile $(APR)/build/NWGNUenvironment.inc $(APR)/build/NWGNUhead.inc $(APR)/build/NWGNUtail.inc $(CUSTOM_INI) - $(CHK) $@ $(DEL) $@ - @echo -P >> $@ + @echo -P > $@ @echo -EP >> $@ @echo -nosyspath >> $@ @echo -w nocmdline >> $@ @@ -52,15 +53,27 @@ endif $(APR)/include/%.h: $(APR)/include/%.hnw @echo Creating $@ +ifeq "$(OSTYPE)" "linux" + $(CP) $< $@ +else $(CP) $(subst /,\,$<) $(subst /,\,$@) +endif $(APR)/include/private/%.h: $(APR)/include/private/%.hnw @echo Creating $@ +ifeq "$(OSTYPE)" "linux" + $(CP) $< $@ +else $(CP) $(subst /,\,$<) $(subst /,\,$@) +endif $(APR)/include/private/%.h: $(APR)/include/private/%.hw @echo Creating $@ +ifeq "$(OSTYPE)" "linux" + $(CP) $< $@ +else $(CP) $(subst /,\,$<) $(subst /,\,$@) +endif $(APR)/include/private/apu_config.h: FORCE @@ -87,5 +100,5 @@ clean :: # in this makefile # -include $(APR_WORK)\build\NWGNUtail.inc +include $(APR_WORK)/build/NWGNUtail.inc diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 63dfeb5910e..60215b6f59a 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -85,7 +85,8 @@ endif ifneq ($(MAKECMDGOALS),clean) $(APRBUILD)/NWGNUversion.inc : $(APRBUILD)/nw_ver.awk $(APR)/include/apr_version.h - @echo Generating $@ +# @echo Generating $@ + @echo GEN $@ @$(AWK) -f $^ > $@ -include $(APRBUILD)/NWGNUversion.inc @@ -112,13 +113,19 @@ endif ifeq "$(INCLUDE_BLDCMDS)" "1" $(OBJDIR)/%.o: %.c $(OBJDIR)/$(CCOPT_NAME)_cc.opt - @echo Compiling $< +# @echo Compiling $< + @echo CC $< $(CC) -o $@ $< @$(word 2, $^) $(OBJDIR)/$(CCOPT_NAME)_cc.opt: $(CCOPT_DEPENDS) +ifeq "$(OSTYPE)" "linux" + $(DEL) $@ +else $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) - @echo CCOPT_DEPENDS=$^ - @echo Generating $@ +endif +# @echo CCOPT_DEPENDS=$^ +# @echo Generating $@ + @echo GEN $@ ifneq "$(strip $(CFLAGS))" "" @echo $(CFLAGS) >> $@ endif @@ -139,13 +146,19 @@ ifneq "$(strip $(XDEFINES))" "" endif $(OBJDIR)/%.o: %.cpp $(OBJDIR)/$(CCOPT_NAME)_cpp.opt - @echo Compiling $< +# @echo Compiling $< + @echo CC $< $(CCP) -o $@ $< @$(word 2, $^) $(OBJDIR)/$(CCOPT_NAME)_cpp.opt: $(CPPOPT_DEPENDS) +ifeq "$(OSTYPE)" "linux" + $(DEL) $@ +else $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) +endif @echo CPPOPT_DEPENDS=$^ - @echo Generating $@ +# @echo Generating $@ + @echo GEN $@ ifneq "$(strip $(CFLAGS))" "" @echo $(CFLAGS) >> $@ endif @@ -176,14 +189,24 @@ endif # one target nlm or lib ifeq "$(words $(strip $(TARGET_lib)))" "1" $(TARGET_lib) : $(OBJDIR)/$(LIB_NAME)_lib.lst +ifeq "$(OSTYPE)" "linux" + $(DEL) $@ +else $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) - @echo Generating $@ +endif +# @echo Generating $@ + @echo AR $@ $(LIB) -o $@ @$< $(OBJDIR)/aprlib_lib.lst: $(aprlib_LIBLST_DEPENDS) +ifeq "$(OSTYPE)" "linux" + $(DEL) $@ +else $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) +endif ifneq "$(strip $(FILES_lib_objs))" "" - @echo Generating $@ +# @echo Generating $@ + @echo GEN $@ @echo $(wordlist 1, 10, $(FILES_lib_objs)) >> $@ @echo $(wordlist 11, 20, $(FILES_lib_objs)) >> $@ @echo $(wordlist 21, 30, $(FILES_lib_objs)) >> $@ @@ -198,10 +221,14 @@ ifneq "$(strip $(FILES_lib_objs))" "" endif $(OBJDIR)/%_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS) +ifeq "$(OSTYPE)" "linux" + $(DEL) $@ +else $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) +endif ifneq "$(strip $(FILES_lib_objs))" "" - @echo Generating $@ - @echo CWD $(CURDIR) +# @echo Generating $@ + @echo GEN $@ @echo $(FILES_lib_objs) >> $@ endif @@ -223,16 +250,23 @@ vpath libcpre.o $(NOVELLLIBC)/imports ifeq "$(words $(strip $(TARGET_nlm)))" "1" $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.opt - @echo Linking $@ +# @echo Linking $@ + @echo LINK $@ $(LINK) @$(OBJDIR)/$(NLM_NAME)_link.opt # This will force the link option file to be rebuilt if we change the # corresponding makefile $(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) +ifeq "$(OSTYPE)" "linux" + $(DEL) $@ + $(DEL) $(@:.opt=.def) +else $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) $(CHK) $(subst /,\,$(@:.opt=.def)) $(DEL) $(subst /,\,$(@:.opt=.def)) - @echo Generating $@ +endif +# @echo Generating $@ + @echo GEN $@ @echo -warnings off >> $@ @echo -zerobss >> $@ @echo -o $(TARGET_nlm) >> $@ @@ -251,14 +285,15 @@ endif @echo -l $(APRBUCKETS)/$(OBJDIR) >> $@ @echo -l $(APRLDAP)/$(OBJDIR) >> $@ @echo -l $(APRXML)/$(OBJDIR) >> $@ - @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime" >> $@ - @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++" >> $@ + @echo -l $(APR)/misc/netware >> $@ + @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime"$(DL) >> $@ + @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++"$(DL) >> $@ ifneq "$(IPV6)" "" @echo -l $(NOVELLLIBC)/include/winsock/IPV6 >> $@ endif @echo -l $(NOVELLLIBC)/imports >> $@ ifneq "$(LDAPSDK)" "" - @echo -l $(LDAPSDK)/lib/nlm >> $@ + @echo -l $(LDAPSDK)/imports >> $@ endif @echo -nodefaults >> $@ @echo -map $(OBJDIR)/$(NLM_NAME).map>> $@ @@ -266,14 +301,14 @@ ifneq "$(strip $(XLFLAGS))" "" @echo $(XLFLAGS) >> $@ endif ifneq "$(strip $(FILES_nlm_objs))" "" - @echo $(foreach objfile,$(strip $(FILES_nlm_objs)),$(subst /,\,$(objfile))) >> $@ + @echo $(foreach objfile,$(strip $(FILES_nlm_objs)),$(objfile)) >> $@ endif ifneq "$(FILES_nlm_libs)" "" - @echo $(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(subst /,\,$(libfile))) >> $@ + @echo $(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(libfile)) >> $@ endif @echo -commandfile $(@:.opt=.def) >> $@ - @echo # Do not edit this file - it is created by make! > $(@:.opt=.def) - @echo # All your changes will be lost!! >> $(@:.opt=.def) + @echo $(DL)# Do not edit this file - it is created by make!$(DL) > $(@:.opt=.def) + @echo $(DL)# All your changes will be lost!!$(DL) >> $(@:.opt=.def) ifneq "$(FILE_nlm_msg)" "" @echo Messages $(FILE_nlm_msg) >> $(@:.opt=.def) endif @@ -281,16 +316,16 @@ ifneq "$(FILE_nlm_hlp)" "" @echo Help $(FILE_nlm_hlp) >> $(@:.opt=.def) endif ifeq "$(FILE_nlm_copyright)" "" - @echo copyright "$(NLM_COPYRIGHT)" >> $(@:.opt=.def) + @echo $(DL)copyright "$(NLM_COPYRIGHT)"$(DL) >> $(@:.opt=.def) endif - @echo description "$(NLM_DESCRIPTION)" >> $(@:.opt=.def) - @echo threadname "$(NLM_THREAD_NAME)" >> $(@:.opt=.def) + @echo $(DL)description "$(NLM_DESCRIPTION)"$(DL) >> $(@:.opt=.def) + @echo $(DL)threadname "$(NLM_THREAD_NAME)"$(DL) >> $(@:.opt=.def) ifneq "$(NLM_STACK_SIZE)" "" @echo stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE)))) >> $(@:.opt=.def) else @echo stacksize 64000 >> $(@:.opt=.def) endif - @echo screenname "$(NLM_SCREEN_NAME)" >> $(@:.opt=.def) + @echo $(DL)screenname "$(NLM_SCREEN_NAME)"$(DL) >> $(@:.opt=.def) ifneq "$(NLM_VERSION)" "" @echo version $(NLM_VERSION) >> $(@:.opt=.def) else @@ -309,13 +344,13 @@ ifneq "$(NLM_FLAGS)" "" @echo $(strip $(NLM_FLAGS)) >> $(@:.opt=.def) endif ifneq "$(FILES_nlm_modules)" "" - @echo module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(subst /,\,$(module))) >> $(@:.opt=.def) + @echo module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(module)) >> $(@:.opt=.def) endif ifneq "$(FILES_nlm_Ximports)" "" - @echo import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(subst /,\,$(import))) >> $(@:.opt=.def) + @echo import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(import)) >> $(@:.opt=.def) endif ifneq "$(FILES_nlm_exports)" "" - @echo export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(subst /,\,$(export))) >> $(@:.opt=.def) + @echo export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export)) >> $(@:.opt=.def) endif # if APACHE_UNIPROC is defined, don't include XDCData @@ -323,7 +358,7 @@ ifndef APACHE_UNIPROC ifneq "$(string $(XDCDATA))" "" @echo xdcdata $(XDCDATA) >> $(@:.opt=.def) else - @echo xdcdata $(APR)/misc/netware/apr.xdc >> $(@:.opt=.def) + @echo xdcdata apr.xdc >> $(@:.opt=.def) endif endif @@ -337,7 +372,7 @@ ifndef NO_LICENSE_FILE $(OBJDIR)/%.nlm: NWGNU% $(APRBUILD)/NWGNUhead.inc $(APRBUILD)/NWGNUtail.inc $(APRBUILD)/NWGNUenvironment.inc $(CUSTOM_INI) $(VERSION_INC) FORCE @echo Calling $< $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE) - $(CMD) echo. + @$(ECHONL) else @@ -348,6 +383,7 @@ endif # NO_LICENSE_FILE endif # multiple targets $(INSTDIRS) :: - $(CHKNOT) $@\NUL mkdir $@ +# $(CHKNOT) $@\NUL mkdir $@ + -$(MD) $@ diff --git a/misc/netware/aprlib.def b/misc/netware/aprlib.def deleted file mode 100644 index 0a2a01eb8f3..00000000000 --- a/misc/netware/aprlib.def +++ /dev/null @@ -1,3 +0,0 @@ -MODULE LIBC.NLM -MODULE WS2_32.NLM -EXPORT @aprlib.imp diff --git a/xml/NWGNUmakefile b/xml/NWGNUmakefile index 4cdf300cd55..d4e5c61d4f0 100644 --- a/xml/NWGNUmakefile +++ b/xml/NWGNUmakefile @@ -33,15 +33,27 @@ endif $(EXPATSRC)/lib/%.h: $(EXPATSRC)/lib/%.hnw @echo Creating $@ +ifeq "$(OSTYPE)" "linux" + $(CP) $< $@ +else $(CP) $(subst /,\,$<) $(subst /,\,$@) +endif $(EXPATSRC)/lib/%.h: $(EXPATSRC)/lib/%.h.in @echo Creating $@ +ifeq "$(OSTYPE)" "linux" + $(CP) $< $@ +else $(CP) $(subst /,\,$<) $(subst /,\,$@) +endif $(EXPATSRC)/lib/%.h: $(CURDIR)/%.hnw @echo Creating $@ +ifeq "$(OSTYPE)" "linux" + $(CP) $< $@ +else $(CP) $(subst /,\,$<) $(subst /,\,$@) +endif vpath %.c $(EXPATSRC)/lib From bd2d4ac13649ca4c633f7de524e353586a2ec4d0 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 4 Mar 2011 11:19:49 +0000 Subject: [PATCH 6868/7878] NetWare build overhaul in order to compile on Linux. Part 2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1077882 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 22 +++++++++---------- build/NWGNUenvironment.inc | 44 +++++++++++++++++--------------------- build/NWGNUhead.inc | 13 ++++++----- build/NWGNUmakefile | 36 +++++++++++-------------------- build/NWGNUtail.inc | 42 +++++++----------------------------- 5 files changed, 57 insertions(+), 100 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 69e267bae95..aae43124298 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -423,24 +423,24 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples) # install :: nlms $(INSTDIRS) FORCE - $(CP) $(subst /,\,$(APR)\$(TARGET_nlm)) $(INSTALLBASE)\*.* + $(call CP,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/) ifndef DEST - -$(CP) $(subst /,\,$(APR))\STATUS $(INSTALLBASE)\*.apr - -$(CP) $(subst /,\,$(APR))\LICENSE $(INSTALLBASE)\* - -$(CP) $(subst /,\,$(APR))\CHANGES $(INSTALLBASE)\*.apr - @-$(XCP) $(subst /,\,$(APR))\docs $(INSTALLBASE)\docs\*.* + -$(call CP,$(APR)/STATUS,$(INSTALLBASE)/*.apr) + -$(call CP,$(APR)/LICENSE,$(INSTALLBASE)/) + -$(call CP,$(APR)/CHANGES,$(INSTALLBASE)/*.apr) + @-$(call XCP,$(APR)/docs,$(INSTALLBASE)/docs/) endif ifndef DEST installdev :: $(INSTDEVDIRS) FORCE - $(CP) $(subst /,\,$(APR))\include\*.h $(INSTALLBASE)\include\*.* - $(CP) $(subst /,\,$(APR))\*.imp $(INSTALLBASE)\lib\*.* - $(CP) $(subst /,\,$(APR))\misc\netware\*.xdc $(INSTALLBASE)\lib\*.* - $(CP) $(subst /,\,$(APR)\$(TARGET_lib)) $(INSTALLBASE)\lib\*.* - $(CP) $(subst /,\,$(APR)\$(TARGET_nlm)) $(INSTALLBASE)\bin\*.* + $(call CP,$(APR)/include/*.h,$(INSTALLBASE)/include/) + $(call CP,$(APR)/*.imp,$(INSTALLBASE)/lib/) + $(call CP,$(APR)/misc/netware/*.xdc,$(INSTALLBASE)/lib/) + $(call CP,$(APR)/$(TARGET_lib),$(INSTALLBASE)/lib/) + $(call CP,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/bin/) $(INSTDEVDIRS) :: - $(CHKNOT) $@\NUL mkdir $@ + $(call MD,$@) endif # diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 44ef89b1493..fd3e09f24c5 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -147,31 +147,27 @@ AWK = awk # Declare Command and tool macros here # -ifeq "$(OSTYPE)" "linux" -DEL = $(RM) -MD = mkdir -p -DELTREE = rmdir -p -CP = cp -av +ifeq ($(findstring /sh,$(SHELL)),/sh) +DEL = $(RM) $1 +MD = mkdir -p $1 +DELTREE = rm -rf $1 +CP = cp -av $1 $2 XCP = cp -ar -CHK = test -e -CHKNOT = test ! -e ECHONL = echo "" DL = ' else ifeq "$(OS)" "Windows_NT" CMD = cmd /c -DEL = del /q /f 2>NUL -DELTREE = rd /s /q 2>NUL +DEL = $(CMD) if exist $(subst /,\,$1) del /q /f 2>NUL $(subst /,\,$1) +DELTREE = rd /s /q 2>NUL $(subst /,\,$1) else CMD = command /c -DEL = del -DELTREE = deltree /y -endif -MD = md 2>NUL -CP = copy /y 2>NUL -XCP = xcopy /e /y 2>NUL -CHK = $(CMD) if exist -CHKNOT = $(CMD) if not exist +DEL = $(CMD) if exist $(subst /,\,$1) del 2>NUL $(subst /,\,$1) +DELTREE = deltree /y $(subst /,\,$1) +endif +MD = $(CMD) if not exist $(subst /,\,$1)\NUL md 2>NUL $(subst /,\,$1) +CP = copy /y 2>NUL $(subst /,\,$1) $(subst /,\,$2) +XCP = xcopy /e /y 2>NUL $(subst /,\,$1) $(subst /,\,$2) ECHONL = $(CMD) echo. endif @@ -269,15 +265,15 @@ endif endif ifndef INSTALL -INSTALL = $(APR_WORK)\Dist -INSTDIRS = $(APR_WORK)\Dist +INSTALL = $(APR_WORK)/Dist +INSTDIRS = $(APR_WORK)/Dist BASEDIR = Apr endif # Add support for building IPV6 alongside ifneq "$(IPV6)" "" DEFINES += -DNW_BUILD_IPV6 -# INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS) +# INCDIRS := $(NOVELLLIBC)/include/winsock/IPV6;$(INCDIRS) ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6" OBJDIR := $(OBJDIR)_IPV6 @@ -301,14 +297,14 @@ endif endif -INSTALLBASE := $(INSTALL)\$(BASEDIR) +INSTALLBASE := $(INSTALL)/$(BASEDIR) INSTDEVDIRS := \ $(INSTDIRS) \ $(INSTALLBASE) \ - $(INSTALLBASE)\include \ - $(INSTALLBASE)\lib \ - $(INSTALLBASE)\bin + $(INSTALLBASE)/include \ + $(INSTALLBASE)/lib \ + $(INSTALLBASE)/bin INSTDIRS += \ $(INSTALLBASE) diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc index 427e5ffe91f..31b34e70be4 100644 --- a/build/NWGNUhead.inc +++ b/build/NWGNUhead.inc @@ -86,13 +86,12 @@ FORCE : ; clean :: $(SUBDIRS) $(APRTEST) @echo Cleaning up $(CURDIR) - -$(DELTREE) $(OBJDIR) - $(CHK) *.err $(DEL) *.err - $(CHK) *.map $(DEL) *.map - $(CHK) *.d $(DEL) *.d - $(CHK) *.tmp $(DEL) *.tmp - -$(DELTREE) $(OBJDIR) + -$(call DELTREE,$(OBJDIR)) + $(call DEL,*.err) + $(call DEL,*.map) +# $(call DEL,*.d) + $(call DEL,*.tmp) $(OBJDIR) :: - -$(MD) $@ + $(call MD,$@) diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index fb6f1183d97..a62e15d09f6 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -53,27 +53,15 @@ endif $(APR)/include/%.h: $(APR)/include/%.hnw @echo Creating $@ -ifeq "$(OSTYPE)" "linux" - $(CP) $< $@ -else - $(CP) $(subst /,\,$<) $(subst /,\,$@) -endif + $(call CP,$<,$@) $(APR)/include/private/%.h: $(APR)/include/private/%.hnw @echo Creating $@ -ifeq "$(OSTYPE)" "linux" - $(CP) $< $@ -else - $(CP) $(subst /,\,$<) $(subst /,\,$@) -endif + $(call CP,$<,$@) $(APR)/include/private/%.h: $(APR)/include/private/%.hw @echo Creating $@ -ifeq "$(OSTYPE)" "linux" - $(CP) $< $@ -else - $(CP) $(subst /,\,$<) $(subst /,\,$@) -endif + $(call CP,$<,$@) $(APR)/include/private/apu_config.h: FORCE @@ -85,15 +73,15 @@ install :: nlms FORCE clean :: - $(CHK) nw_export.i $(DEL) nw_export.i - $(CHK) $(NLM_NAME)_cc.opt $(DEL) $(NLM_NAME)_cc.opt - $(CHK) NWGNUversion.inc $(DEL) NWGNUversion.inc - $(CHK) $(subst /,\,$(APR))\include\apr.h $(DEL) $(subst /,\,$(APR))\include\apr.h - $(CHK) $(subst /,\,$(APR))\include\apu_want.h $(DEL) $(subst /,\,$(APR))\include\apu_want.h - $(CHK) $(subst /,\,$(APR))\include\apr_ldap.h $(DEL) $(subst /,\,$(APR))\include\apr_ldap.h - $(CHK) $(subst /,\,$(APR))\include\private\apu_config.h $(DEL) $(subst /,\,$(APR))\include\private\apu_config.h - $(CHK) $(subst /,\,$(APR))\include\private\apu_select_dbm.h $(DEL) $(subst /,\,$(APR))\include\private\apu_select_dbm.h - $(CHK) $(subst /,\,$(APR))\aprlib.imp $(DEL) $(subst /,\,$(APR))\aprlib.imp + $(call DEL,nw_export.i) + $(call DEL,$(NLM_NAME)_cc.opt) + $(call DEL,NWGNUversion.inc) + $(call DEL,$(APR)/include/apr.h) + $(call DEL,$(APR)/include/apu_want.h) + $(call DEL,$(APR)/include/apr_ldap.h) + $(call DEL,$(APR)/include/private/apu_config.h) + $(call DEL,$(APR)/include/private/apu_select_dbm.h) + $(call DEL,$(APR)/aprlib.imp) # # Include the 'tail' makefile that has targets that depend on variables defined diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 60215b6f59a..3aa79e95431 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -118,11 +118,7 @@ $(OBJDIR)/%.o: %.c $(OBJDIR)/$(CCOPT_NAME)_cc.opt $(CC) -o $@ $< @$(word 2, $^) $(OBJDIR)/$(CCOPT_NAME)_cc.opt: $(CCOPT_DEPENDS) -ifeq "$(OSTYPE)" "linux" - $(DEL) $@ -else - $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) -endif + $(call DEL,$@) # @echo CCOPT_DEPENDS=$^ # @echo Generating $@ @echo GEN $@ @@ -151,11 +147,7 @@ $(OBJDIR)/%.o: %.cpp $(OBJDIR)/$(CCOPT_NAME)_cpp.opt $(CCP) -o $@ $< @$(word 2, $^) $(OBJDIR)/$(CCOPT_NAME)_cpp.opt: $(CPPOPT_DEPENDS) -ifeq "$(OSTYPE)" "linux" - $(DEL) $@ -else - $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) -endif + $(call DEL,$@) @echo CPPOPT_DEPENDS=$^ # @echo Generating $@ @echo GEN $@ @@ -189,21 +181,13 @@ endif # one target nlm or lib ifeq "$(words $(strip $(TARGET_lib)))" "1" $(TARGET_lib) : $(OBJDIR)/$(LIB_NAME)_lib.lst -ifeq "$(OSTYPE)" "linux" - $(DEL) $@ -else - $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) -endif + $(call DEL,$@) # @echo Generating $@ @echo AR $@ $(LIB) -o $@ @$< $(OBJDIR)/aprlib_lib.lst: $(aprlib_LIBLST_DEPENDS) -ifeq "$(OSTYPE)" "linux" - $(DEL) $@ -else - $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) -endif + $(call DEL,$@) ifneq "$(strip $(FILES_lib_objs))" "" # @echo Generating $@ @echo GEN $@ @@ -221,11 +205,7 @@ ifneq "$(strip $(FILES_lib_objs))" "" endif $(OBJDIR)/%_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS) -ifeq "$(OSTYPE)" "linux" - $(DEL) $@ -else - $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) -endif + $(call DEL,$@) ifneq "$(strip $(FILES_lib_objs))" "" # @echo Generating $@ @echo GEN $@ @@ -258,13 +238,8 @@ $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.o # corresponding makefile $(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) -ifeq "$(OSTYPE)" "linux" - $(DEL) $@ - $(DEL) $(@:.opt=.def) -else - $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) - $(CHK) $(subst /,\,$(@:.opt=.def)) $(DEL) $(subst /,\,$(@:.opt=.def)) -endif + $(call DEL,$@) + $(call DEL,$(@:.opt=.def)) # @echo Generating $@ @echo GEN $@ @echo -warnings off >> $@ @@ -383,7 +358,6 @@ endif # NO_LICENSE_FILE endif # multiple targets $(INSTDIRS) :: -# $(CHKNOT) $@\NUL mkdir $@ - -$(MD) $@ + $(call MD,$@) From dce1097186bf865cd39e13aa69f475b579e7d0e9 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 4 Mar 2011 23:08:43 +0000 Subject: [PATCH 6869/7878] NetWare build overhaul in order to compile on Linux. Part 3. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078199 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUenvironment.inc | 2 +- xml/NWGNUmakefile | 20 ++++---------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index fd3e09f24c5..072ffcb36db 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -242,7 +242,7 @@ endif CFLAGS += -prefix apr_arch_pre_nw.h -ifneq "$(OSTYPE)" "linux" +ifeq ($(findstring /sh,$(SHELL)),/sh) PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools endif diff --git a/xml/NWGNUmakefile b/xml/NWGNUmakefile index d4e5c61d4f0..182dd98415f 100644 --- a/xml/NWGNUmakefile +++ b/xml/NWGNUmakefile @@ -33,27 +33,15 @@ endif $(EXPATSRC)/lib/%.h: $(EXPATSRC)/lib/%.hnw @echo Creating $@ -ifeq "$(OSTYPE)" "linux" - $(CP) $< $@ -else - $(CP) $(subst /,\,$<) $(subst /,\,$@) -endif + $(call CP,$<,$@) $(EXPATSRC)/lib/%.h: $(EXPATSRC)/lib/%.h.in @echo Creating $@ -ifeq "$(OSTYPE)" "linux" - $(CP) $< $@ -else - $(CP) $(subst /,\,$<) $(subst /,\,$@) -endif + $(call CP,$<,$@) $(EXPATSRC)/lib/%.h: $(CURDIR)/%.hnw @echo Creating $@ -ifeq "$(OSTYPE)" "linux" - $(CP) $< $@ -else - $(CP) $(subst /,\,$<) $(subst /,\,$@) -endif + $(call CP,$<,$@) vpath %.c $(EXPATSRC)/lib @@ -287,7 +275,7 @@ nlms :: libs $(TARGET_nlm) install :: nlms FORCE clean :: - $(foreach file,$(EXPAT_prebuild_headers),$(shell if exist $(subst /,\,$(file)) $(DEL) $(subst /,\,$(file)))) + $(foreach file,$(EXPAT_prebuild_headers),$(call DEL,$(file))) # # Any specialized rules here From 3176d53a270035672405bd1af69e3e19c2aa04fd Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 4 Mar 2011 23:13:13 +0000 Subject: [PATCH 6870/7878] NetWare build overhaul in order to compile on Linux. Fix a c&p error. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078205 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUenvironment.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 072ffcb36db..51ee5184ef8 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -242,7 +242,7 @@ endif CFLAGS += -prefix apr_arch_pre_nw.h -ifeq ($(findstring /sh,$(SHELL)),/sh) +ifneq ($(findstring /sh,$(SHELL)),/sh) PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools endif From 6070f3866fbff20268a235acec62b6fb7280c610 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 6 Mar 2011 16:34:46 +0000 Subject: [PATCH 6871/7878] style changes only -- make it look a lot more like the bulk of APR git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078507 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_odbc.c | 489 ++++++++++++++++++++++++--------------------- 1 file changed, 265 insertions(+), 224 deletions(-) diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index 7481458b7d9..cd0c546beba 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -47,7 +47,7 @@ #include #endif - /* Driver name is "odbc" and the entry point is 'apr_dbd_odbc_driver' +/* Driver name is "odbc" and the entry point is 'apr_dbd_odbc_driver' * unless ODBC_DRIVER_NAME is defined and it is linked with another db library which * is ODBC source-compatible. e.g. DB2, Informix, TimesTen, mysql. */ @@ -64,11 +64,11 @@ #define DRIVER_APR_VERSION_MAJOR APR_MAJOR_VERSION #define DRIVER_APR_VERSION_MINOR APR_MINOR_VERSION - static SQLHANDLE henv = NULL; /* ODBC ENV handle is process-wide */ /* Use a CHECK_ERROR macro so we can grab the source line numbers - * for error reports */ + * for error reports + */ static void check_error(apr_dbd_t *a, const char *step, SQLRETURN rc, SQLSMALLINT type, SQLHANDLE h, int line); #define CHECK_ERROR(a,s,r,t,h) check_error(a,s,r,t,h, __LINE__) @@ -87,12 +87,15 @@ static void check_error(apr_dbd_t *a, const char *step, SQLRETURN rc, #define BINARYMODE 0 /* used for binary (APR 1.3+) mode params */ /* Identify datatypes which are LOBs - * - DB2 DRDA driver uses undefined types -98 and -99 for CLOB & BLOB */ + * - DB2 DRDA driver uses undefined types -98 and -99 for CLOB & BLOB + */ #define IS_LOB(t) (t == SQL_LONGVARCHAR \ || t == SQL_LONGVARBINARY || t == SQL_VARBINARY \ || t == -98 || t == -99) + /* These types are CLOBs - * - DB2 DRDA driver uses undefined type -98 for CLOB */ + * - DB2 DRDA driver uses undefined type -98 for CLOB + */ #define IS_CLOB(t) \ (t == SQL_LONGVARCHAR || t == -98) @@ -138,7 +141,8 @@ struct apr_dbd_results_t int *all_data_fetched; /* flags data as all fetched, for LOBs */ void *data; /* buffer for all data for one row */ }; -enum /* results column states */ + +enum /* results column states */ { COL_AVAIL, /* data may be retrieved with SQLGetData */ COL_PRESENT, /* data has been retrieved with SQLGetData */ @@ -147,7 +151,8 @@ enum /* results column states */ COL_UNAVAIL /* column is unavailable because ODBC driver * requires that columns be retrieved * in ascending order and a higher col - * was accessed */ + * was accessed + */ }; struct apr_dbd_row_t { @@ -169,7 +174,6 @@ struct apr_dbd_prepared_t { int nargs; int nvals; int *types; /* array of DBD data types */ - }; static void odbc_lob_bucket_destroy(void *data); @@ -187,7 +191,6 @@ static const apr_bucket_type_t odbc_bucket_type = { apr_bucket_shared_copy }; - /* ODBC LOB bucket data */ typedef struct { /** Ref count for shared bucket */ @@ -197,7 +200,6 @@ typedef struct { SQLSMALLINT type; } odbc_bucket; - /* SQL datatype mappings to DBD datatypes * These tables must correspond *exactly* to the apr_dbd_type_e enum * in apr_dbd_internal.h @@ -285,17 +287,18 @@ static int const sqlSizes[] = { }; /* -* local functions -*/ + * local functions + */ /* close any open results for the connection */ static apr_status_t odbc_close_results(void *d) -{ apr_dbd_results_t *dbr = (apr_dbd_results_t *) d; +{ + apr_dbd_results_t *dbr = (apr_dbd_results_t *)d; SQLRETURN rc = SQL_SUCCESS; if (dbr && dbr->apr_dbd && dbr->apr_dbd->dbc) { - if (!dbr->isclosed) - rc = SQLCloseCursor(dbr->stmt); + if (!dbr->isclosed) + rc = SQLCloseCursor(dbr->stmt); dbr->isclosed = 1; } return APR_FROM_SQL_RESULT(rc); @@ -306,6 +309,7 @@ static apr_status_t odbc_close_pstmt(void *s) { SQLRETURN rc = APR_SUCCESS; apr_dbd_prepared_t *statement = s; + /* stmt is closed if connection has already been closed */ if (statement) { SQLHANDLE hstmt = statement->stmt; @@ -336,7 +340,7 @@ static apr_status_t odbc_close(apr_dbd_t *handle) /* odbc_close re-defined for passing to pool cleanup */ static apr_status_t odbc_close_cleanup(void *handle) { - return odbc_close( (apr_dbd_t *) handle); + return odbc_close((apr_dbd_t *)handle); } /* close the ODBC environment handle at process termination */ @@ -350,26 +354,29 @@ static apr_status_t odbc_close_env(SQLHANDLE henv) } /* setup the arrays in results for all the returned columns */ -static SQLRETURN odbc_set_result_column(int icol, apr_dbd_results_t * res, - SQLHANDLE stmt) +static SQLRETURN odbc_set_result_column(int icol, apr_dbd_results_t *res, + SQLHANDLE stmt) { SQLRETURN rc; int maxsize, textsize, realsize, type, isunsigned = 1; - /* discover the sql type */ + /* discover the sql type */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_UNSIGNED, NULL, 0, NULL, - (SQLPOINTER) &isunsigned); + (SQLPOINTER)&isunsigned); isunsigned = (isunsigned == SQL_TRUE); rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_TYPE, NULL, 0, NULL, - (SQLPOINTER) &type); - if (!SQL_SUCCEEDED(rc) || type == SQL_UNKNOWN_TYPE) + (SQLPOINTER)&type); + if (!SQL_SUCCEEDED(rc) || type == SQL_UNKNOWN_TYPE) { /* MANY ODBC v2 datasources only supply CONCISE_TYPE */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_CONCISE_TYPE, NULL, - 0, NULL, (SQLPOINTER) &type); - if (!SQL_SUCCEEDED(rc)) + 0, NULL, (SQLPOINTER)&type); + } + + if (!SQL_SUCCEEDED(rc)) { /* if still unknown make it CHAR */ type = SQL_C_CHAR; + } switch (type) { case SQL_INTEGER: @@ -405,28 +412,31 @@ static SQLRETURN odbc_set_result_column(int icol, apr_dbd_results_t * res, /* size if retrieved as text */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_DISPLAY_SIZE, NULL, 0, - NULL, (SQLPOINTER) & textsize); - if (!SQL_SUCCEEDED(rc) || textsize < 0) + NULL, (SQLPOINTER)&textsize); + if (!SQL_SUCCEEDED(rc) || textsize < 0) { textsize = res->apr_dbd->defaultBufferSize; + } /* for null-term, which sometimes isn't included */ textsize++; /* real size */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_OCTET_LENGTH, NULL, 0, - NULL, (SQLPOINTER) & realsize); - if (!SQL_SUCCEEDED(rc)) + NULL, (SQLPOINTER)&realsize); + if (!SQL_SUCCEEDED(rc)) { realsize = textsize; + } maxsize = (textsize > realsize) ? textsize : realsize; - if ( IS_LOB(type) || maxsize <= 0) { + if (IS_LOB(type) || maxsize <= 0) { /* LOB types are never bound and have a NULL colptr for binary. * Ingore their real (1-2gb) length & use a default - the larger * of defaultBufferSize or APR_BUCKET_BUFF_SIZE. * If not a LOB, but simply unknown length - always use defaultBufferSize. */ maxsize = res->apr_dbd->defaultBufferSize; - if ( IS_LOB(type) && maxsize < APR_BUCKET_BUFF_SIZE ) + if (IS_LOB(type) && maxsize < APR_BUCKET_BUFF_SIZE) { maxsize = APR_BUCKET_BUFF_SIZE; + } res->colptrs[icol] = NULL; res->colstate[icol] = COL_AVAIL; @@ -440,14 +450,15 @@ static SQLRETURN odbc_set_result_column(int icol, apr_dbd_results_t * res, /* we are allowed to call SQLGetData if we need to */ rc = SQLBindCol(stmt, icol + 1, res->coltypes[icol], res->colptrs[icol], maxsize, - &(res->colinds[icol]) ); + &(res->colinds[icol])); CHECK_ERROR(res->apr_dbd, "SQLBindCol", rc, SQL_HANDLE_STMT, stmt); res->colstate[icol] = SQL_SUCCEEDED(rc) ? COL_BOUND : COL_AVAIL; } else { /* this driver won't allow us to call SQLGetData on bound - * columns - so don't bind any */ + * columns - so don't bind any + */ res->colstate[icol] = COL_AVAIL; rc = SQL_SUCCESS; } @@ -456,9 +467,9 @@ static SQLRETURN odbc_set_result_column(int icol, apr_dbd_results_t * res, } /* create and populate an apr_dbd_results_t for a select */ -static SQLRETURN odbc_create_results(apr_dbd_t * handle, SQLHANDLE hstmt, - apr_pool_t * pool, const int random, - apr_dbd_results_t ** res) +static SQLRETURN odbc_create_results(apr_dbd_t *handle, SQLHANDLE hstmt, + apr_pool_t *pool, const int random, + apr_dbd_results_t **res) { SQLRETURN rc; SQLSMALLINT ncols; @@ -473,7 +484,7 @@ static SQLRETURN odbc_create_results(apr_dbd_t * handle, SQLHANDLE hstmt, CHECK_ERROR(handle, "SQLNumResultCols", rc, SQL_HANDLE_STMT, hstmt); (*res)->ncols = ncols; - if SQL_SUCCEEDED(rc) { + if (SQL_SUCCEEDED(rc)) { int i; (*res)->colnames = apr_pcalloc(pool, ncols * sizeof(char *)); @@ -484,16 +495,17 @@ static SQLRETURN odbc_create_results(apr_dbd_t * handle, SQLHANDLE hstmt, (*res)->colstate = apr_pcalloc(pool, ncols * sizeof(int)); (*res)->ncols = ncols; - for (i = 0 ; i < ncols ; i++) + for (i = 0; i < ncols; i++) { odbc_set_result_column(i, (*res), hstmt); } + } return rc; } /* bind a parameter - input params only, does not support output parameters */ -static SQLRETURN odbc_bind_param(apr_pool_t * pool, - apr_dbd_prepared_t * statement, const int narg, +static SQLRETURN odbc_bind_param(apr_pool_t *pool, + apr_dbd_prepared_t *statement, const int narg, const SQLSMALLINT type, int *argp, const void **args, const int textmode) { @@ -521,8 +533,8 @@ static SQLRETURN odbc_bind_param(apr_pool_t * pool, indicator = NULL; /* LOBs */ if (IS_LOB(cType)) { - ptr = (void *) args[*argp]; - len = (SQLULEN) * (apr_size_t *) args[*argp + 1]; + ptr = (void *)args[*argp]; + len = (SQLULEN) * (apr_size_t *)args[*argp + 1]; cType = (IS_CLOB(cType)) ? SQL_C_CHAR : SQL_C_DEFAULT; (*argp) += 4; /* LOBs consume 4 args (last two are unused) */ } @@ -533,48 +545,48 @@ static SQLRETURN odbc_bind_param(apr_pool_t * pool, case SQL_DATE: case SQL_TIME: case SQL_TIMESTAMP: - ptr = (void *) args[*argp]; - len = (SQLULEN) strlen(ptr); + ptr = (void *)args[*argp]; + len = (SQLULEN)strlen(ptr); break; case SQL_TINYINT: ptr = apr_palloc(pool, sizeof(unsigned char)); len = sizeof(unsigned char); - *(unsigned char *) ptr = + *(unsigned char *)ptr = (textmode ? - atoi(args[*argp]) : *(unsigned char *) args[*argp]); + atoi(args[*argp]) : *(unsigned char *)args[*argp]); break; case SQL_SMALLINT: ptr = apr_palloc(pool, sizeof(short)); len = sizeof(short); - *(short *) ptr = - (textmode ? atoi(args[*argp]) : *(short *) args[*argp]); + *(short *)ptr = + (textmode ? atoi(args[*argp]) : *(short *)args[*argp]); break; case SQL_INTEGER: ptr = apr_palloc(pool, sizeof(int)); len = sizeof(int); - *(long *) ptr = - (textmode ? atol(args[*argp]) : *(long *) args[*argp]); + *(long *)ptr = + (textmode ? atol(args[*argp]) : *(long *)args[*argp]); break; case SQL_FLOAT: ptr = apr_palloc(pool, sizeof(float)); len = sizeof(float); - *(float *) ptr = + *(float *)ptr = (textmode ? - (float) atof(args[*argp]) : *(float *) args[*argp]); + (float)atof(args[*argp]) : *(float *)args[*argp]); break; case SQL_DOUBLE: ptr = apr_palloc(pool, sizeof(double)); len = sizeof(double); - *(double *) ptr = + *(double *)ptr = (textmode ? atof(args[*argp]) : *(double *) args[*argp]); break; case SQL_BIGINT: ptr = apr_palloc(pool, sizeof(apr_int64_t)); len = sizeof(apr_int64_t); - *(apr_int64_t *) ptr = + *(apr_int64_t *)ptr = (textmode ? - apr_atoi64(args[*argp]) : *(apr_int64_t *) args[*argp]); + apr_atoi64(args[*argp]) : *(apr_int64_t *)args[*argp]); break; default: return APR_EGENERAL; @@ -591,8 +603,6 @@ static SQLRETURN odbc_bind_param(apr_pool_t * pool, /* LOB / Bucket Brigade functions */ - - /* bucket type specific destroy */ static void odbc_lob_bucket_destroy(void *data) { @@ -605,7 +615,7 @@ static void odbc_lob_bucket_destroy(void *data) /* set aside a bucket if possible */ static apr_status_t odbc_lob_bucket_setaside(apr_bucket *e, apr_pool_t *pool) { - odbc_bucket *bd = (odbc_bucket *) e->data; + odbc_bucket *bd = (odbc_bucket *)e->data; /* Unlikely - but if the row pool is ancestor of this pool then it is OK */ if (apr_pool_is_ancestor(bd->row->pool, pool)) @@ -621,7 +631,7 @@ static apr_status_t odbc_lob_bucket_read(apr_bucket *e, const char **str, SQLRETURN rc; SQLLEN len_indicator; SQLSMALLINT type; - odbc_bucket *bd = (odbc_bucket *) e->data; + odbc_bucket *bd = (odbc_bucket *)e->data; apr_bucket *nxt; void *buf; int bufsize = bd->row->res->apr_dbd->defaultBufferSize; @@ -633,9 +643,9 @@ static apr_status_t odbc_lob_bucket_read(apr_bucket *e, const char **str, /* LOB buffers are always at least APR_BUCKET_BUFF_SIZE, * but they may be much bigger per the BUFSIZE parameter. - */ + */ if (bufsize < APR_BUCKET_BUFF_SIZE) - bufsize = APR_BUCKET_BUFF_SIZE; + bufsize = APR_BUCKET_BUFF_SIZE; buf = apr_bucket_alloc(bufsize, e->list); *str = NULL; @@ -654,7 +664,7 @@ static apr_status_t odbc_lob_bucket_read(apr_bucket *e, const char **str, if (SQL_SUCCEEDED(rc) || rc == SQL_NO_DATA) { if (rc == SQL_SUCCESS_WITH_INFO - && ( len_indicator == SQL_NO_TOTAL || len_indicator >= bufsize) ) { + && (len_indicator == SQL_NO_TOTAL || len_indicator >= bufsize)) { /* not the last read = a full buffer. CLOBs have a null terminator */ *len = bufsize - (IS_CLOB(bd->type) ? 1 : 0 ); @@ -666,8 +676,8 @@ static apr_status_t odbc_lob_bucket_read(apr_bucket *e, const char **str, * We try to handle both interpretations. */ *len = (len_indicator > bufsize - && len_indicator >= (SQLLEN) e->start) - ? (len_indicator - (SQLLEN) e->start) : len_indicator; + && len_indicator >= (SQLLEN)e->start) + ? (len_indicator - (SQLLEN)e->start) : len_indicator; eos = 1; } @@ -706,12 +716,10 @@ static apr_status_t odbc_create_bucket(const apr_dbd_row_t *row, const int col, odbc_bucket *bd = apr_bucket_alloc(sizeof(odbc_bucket), list); apr_bucket *eos = apr_bucket_eos_create(list); - bd->row = row; bd->col = col; bd->type = type; - APR_BUCKET_INIT(b); b->type = &odbc_bucket_type; b->free = apr_bucket_free; @@ -726,7 +734,8 @@ static apr_status_t odbc_create_bucket(const apr_dbd_row_t *row, const int col, } /* returns a data pointer for a column, returns NULL for NULL value, - * return -1 if data not available */ + * return -1 if data not available + */ static void *odbc_get(const apr_dbd_row_t *row, const int col, const SQLSMALLINT sqltype) { @@ -736,11 +745,13 @@ static void *odbc_get(const apr_dbd_row_t *row, const int col, int options = row->res->apr_dbd->dboptions; switch (state) { - case (COL_UNAVAIL) : return (void *) -1; - case (COL_RETRIEVED) : return NULL; + case (COL_UNAVAIL): + return (void *)-1; + case (COL_RETRIEVED): + return NULL; - case (COL_BOUND) : - case (COL_PRESENT) : + case (COL_BOUND): + case (COL_PRESENT): if (sqltype == row->res->coltypes[col]) { /* same type and we already have the data */ row->res->colstate[col] = COL_RETRIEVED; @@ -752,7 +763,8 @@ static void *odbc_get(const apr_dbd_row_t *row, const int col, /* we need to get the data now */ if (!(options & SQL_GD_ANY_ORDER)) { /* this ODBC driver requires columns to be retrieved in order, - * so we attempt to get every prior un-gotten non-LOB column */ + * so we attempt to get every prior un-gotten non-LOB column + */ int i; for (i = 0; i < col; i++) { if (row->res->colstate[i] == COL_AVAIL) { @@ -768,7 +780,7 @@ static void *odbc_get(const apr_dbd_row_t *row, const int col, if ((state == COL_BOUND && !(options & SQL_GD_BOUND))) /* this driver won't let us re-get bound columns */ - return (void *) -1; + return (void *)-1; /* a LOB might not have a buffer allocated yet - so create one */ if (!row->res->colptrs[col]) @@ -785,12 +797,14 @@ static void *odbc_get(const apr_dbd_row_t *row, const int col, /* whatever it was originally, it is now this sqltype */ row->res->coltypes[col] = sqltype; /* this allows getting CLOBs in text mode by calling get_entry - * until it returns NULL */ + * until it returns NULL + */ row->res->colstate[col] = (rc == SQL_SUCCESS_WITH_INFO) ? COL_AVAIL : COL_RETRIEVED; return row->res->colptrs[col]; } - else return (void *) -1; + else + return (void *)-1; } /* Parse the parameter string for open */ @@ -801,7 +815,7 @@ static apr_status_t odbc_parse_params(apr_pool_t *pool, const char *params, int **attrs, int **attrvals) { char *seps, *last, *name[MAX_PARAMS], *val[MAX_PARAMS]; - int nparams=0, i, j; + int nparams = 0, i, j; *attrs = apr_pcalloc(pool, MAX_PARAMS * sizeof(char *)); *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(int)); @@ -821,41 +835,45 @@ static apr_status_t odbc_parse_params(apr_pool_t *pool, const char *params, val[nparams] = apr_strtok(NULL, seps, &last); seps = DEFAULTSEPS; name[++nparams] = apr_strtok(NULL, seps, &last); - } while ( nparams <= MAX_PARAMS && name[nparams] != NULL); + } while (nparams <= MAX_PARAMS && name[nparams] != NULL); - for(j=i=0 ; i< nparams ; i++) - { if (!apr_strnatcasecmp(name[i], "CONNECT")) - { *datasource = (SQLCHAR *)apr_pstrdup(pool, val[i]); - *connect=1; + for (j = i = 0; i < nparams; i++) { + if (!apr_strnatcasecmp(name[i], "CONNECT")) { + *datasource = (SQLCHAR *)apr_pstrdup(pool, val[i]); + *connect = 1; } - else if (!apr_strnatcasecmp(name[i], "DATASOURCE")) - { *datasource = (SQLCHAR *)apr_pstrdup(pool, val[i]); - *connect=0; + else if (!apr_strnatcasecmp(name[i], "DATASOURCE")) { + *datasource = (SQLCHAR *)apr_pstrdup(pool, val[i]); + *connect = 0; } - else if (!apr_strnatcasecmp(name[i], "USER")) + else if (!apr_strnatcasecmp(name[i], "USER")) { *user = (SQLCHAR *)apr_pstrdup(pool, val[i]); - else if (!apr_strnatcasecmp(name[i], "PASSWORD")) + } + else if (!apr_strnatcasecmp(name[i], "PASSWORD")) { *password = (SQLCHAR *)apr_pstrdup(pool, val[i]); - else if (!apr_strnatcasecmp(name[i], "BUFSIZE")) + } + else if (!apr_strnatcasecmp(name[i], "BUFSIZE")) { *defaultBufferSize = atoi(val[i]); - else if (!apr_strnatcasecmp(name[i], "ACCESS")) - { if (!apr_strnatcasecmp(val[i], "READ_ONLY")) + } + else if (!apr_strnatcasecmp(name[i], "ACCESS")) { + if (!apr_strnatcasecmp(val[i], "READ_ONLY")) (*attrvals)[j] = SQL_MODE_READ_ONLY; else if (!apr_strnatcasecmp(val[i], "READ_WRITE")) (*attrvals)[j] = SQL_MODE_READ_WRITE; - else return SQL_ERROR; + else + return SQL_ERROR; (*attrs)[j++] = SQL_ATTR_ACCESS_MODE; } - else if (!apr_strnatcasecmp(name[i], "CTIMEOUT")) - { (*attrvals)[j] = atoi(val[i]); + else if (!apr_strnatcasecmp(name[i], "CTIMEOUT")) { + (*attrvals)[j] = atoi(val[i]); (*attrs)[j++] = SQL_ATTR_LOGIN_TIMEOUT; } - else if (!apr_strnatcasecmp(name[i], "STIMEOUT")) - { (*attrvals)[j] = atoi(val[i]); + else if (!apr_strnatcasecmp(name[i], "STIMEOUT")) { + (*attrvals)[j] = atoi(val[i]); (*attrs)[j++] = SQL_ATTR_CONNECTION_TIMEOUT; } - else if (!apr_strnatcasecmp(name[i], "TXMODE")) - { if (!apr_strnatcasecmp(val[i], "READ_UNCOMMITTED")) + else if (!apr_strnatcasecmp(name[i], "TXMODE")) { + if (!apr_strnatcasecmp(val[i], "READ_UNCOMMITTED")) (*attrvals)[j] = SQL_TXN_READ_UNCOMMITTED; else if (!apr_strnatcasecmp(val[i], "READ_COMMITTED")) (*attrvals)[j] = SQL_TXN_READ_COMMITTED; @@ -865,10 +883,12 @@ static apr_status_t odbc_parse_params(apr_pool_t *pool, const char *params, (*attrvals)[j] = SQL_TXN_SERIALIZABLE; else if (!apr_strnatcasecmp(val[i], "DEFAULT")) continue; - else return SQL_ERROR; + else + return SQL_ERROR; (*attrs)[j++] = SQL_ATTR_TXN_ISOLATION; } - else return SQL_ERROR; + else + return SQL_ERROR; } *nattrs = j; return (*datasource && *defaultBufferSize) ? APR_SUCCESS : SQL_ERROR; @@ -882,48 +902,62 @@ static void check_error(apr_dbd_t *dbc, const char *step, SQLRETURN rc, SQLCHAR sqlstate[128]; SQLINTEGER native; SQLSMALLINT reslength; - char *res, *p, *end, *logval=NULL; + char *res, *p, *end, *logval = NULL; int i; apr_status_t r; /* set info about last error in dbc - fast return for SQL_SUCCESS */ if (rc == SQL_SUCCESS) { char successMsg[] = "[dbd_odbc] SQL_SUCCESS "; + dbc->lasterrorcode = SQL_SUCCESS; strcpy(dbc->lastError, successMsg); - strcpy(dbc->lastError+sizeof(successMsg)-1, step); + strcpy(dbc->lastError + sizeof(successMsg) - 1, step); return; } switch (rc) { - case SQL_INVALID_HANDLE : { res = "SQL_INVALID_HANDLE"; break; } - case SQL_ERROR : { res = "SQL_ERROR"; break; } - case SQL_SUCCESS_WITH_INFO : { res = "SQL_SUCCESS_WITH_INFO"; break; } - case SQL_STILL_EXECUTING : { res = "SQL_STILL_EXECUTING"; break; } - case SQL_NEED_DATA : { res = "SQL_NEED_DATA"; break; } - case SQL_NO_DATA : { res = "SQL_NO_DATA"; break; } - default : { res = "unrecognized SQL return code"; } + case SQL_INVALID_HANDLE: + res = "SQL_INVALID_HANDLE"; + break; + case SQL_ERROR: + res = "SQL_ERROR"; + break; + case SQL_SUCCESS_WITH_INFO: + res = "SQL_SUCCESS_WITH_INFO"; + break; + case SQL_STILL_EXECUTING: + res = "SQL_STILL_EXECUTING"; + break; + case SQL_NEED_DATA: + res = "SQL_NEED_DATA"; + break; + case SQL_NO_DATA: + res = "SQL_NO_DATA"; + break; + default: + res = "unrecognized SQL return code"; } /* these two returns are expected during normal execution */ if (rc != SQL_SUCCESS_WITH_INFO && rc != SQL_NO_DATA - && dbc->can_commit != APR_DBD_TRANSACTION_IGNORE_ERRORS) - { + && dbc->can_commit != APR_DBD_TRANSACTION_IGNORE_ERRORS) { dbc->can_commit = APR_DBD_TRANSACTION_ROLLBACK; } p = dbc->lastError; end = p + sizeof(dbc->lastError); dbc->lasterrorcode = rc; p += sprintf(p, "[dbd_odbc] %.64s returned %.30s (%d) at %.24s:%d ", - step, res, rc, SOURCE_FILE, line-1); - for (i=1, rc=0 ; rc==0 ; i++) { + step, res, rc, SOURCE_FILE, line - 1); + for (i = 1, rc = 0; rc == 0; i++) { rc = SQLGetDiagRec(type, h, i, sqlstate, &native, buffer, sizeof(buffer), &reslength); - if (SQL_SUCCEEDED(rc) && (p < (end-280))) + if (SQL_SUCCEEDED(rc) && (p < (end - 280))) p += sprintf(p, "%.256s %.20s ", buffer, sqlstate); } r = apr_env_get(&logval, "apr_dbd_odbc_log", dbc->pool); /* if env var was set or call was init/open (no dbname) - log to stderr */ if (logval || !dbc->dbname ) { char timestamp[APR_CTIME_LEN]; + apr_file_t *se; apr_ctime(timestamp, apr_time_now()); apr_file_open_stderr(&se, dbc->pool); @@ -940,9 +974,10 @@ static APR_INLINE int odbc_check_rollback(apr_dbd_t *handle) } return 0; } + /* -* public functions per DBD driver API -*/ + * public functions per DBD driver API + */ /** init: allow driver to perform once-only initialisation. **/ static void odbc_init(apr_pool_t *pool) @@ -970,13 +1005,13 @@ static void odbc_init(apr_pool_t *pool) step = "SQLAllocHandle (SQL_HANDLE_ENV)"; rc = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv); apr_pool_cleanup_register(pool, henv, odbc_close_env, apr_pool_cleanup_null); - if (SQL_SUCCEEDED(rc)) - { step = "SQLSetEnvAttr"; + if (SQL_SUCCEEDED(rc)) { + step = "SQLSetEnvAttr"; rc = SQLSetEnvAttr(henv,SQL_ATTR_ODBC_VERSION, - (SQLPOINTER) SQL_OV_ODBC3, 0); + (SQLPOINTER)SQL_OV_ODBC3, 0); } - else - { apr_dbd_t tmp_dbc; + else { + apr_dbd_t tmp_dbc; SQLHANDLE err_h = henv; tmp_dbc.pool = pool; @@ -986,37 +1021,38 @@ static void odbc_init(apr_pool_t *pool) } /** native_handle: return the native database handle of the underlying db **/ -static void* odbc_native_handle(apr_dbd_t *handle) -{ return handle->dbc; +static void *odbc_native_handle(apr_dbd_t *handle) +{ + return handle->dbc; } /** open: obtain a database connection from the server rec. **/ /* It would be more efficient to allocate a single statement handle - here - but SQL_ATTR_CURSOR_SCROLLABLE must be set before - SQLPrepare, and we don't know whether random-access is - specified until SQLExecute so we cannot. -*/ + * here - but SQL_ATTR_CURSOR_SCROLLABLE must be set before + * SQLPrepare, and we don't know whether random-access is + * specified until SQLExecute so we cannot. + */ -static apr_dbd_t* odbc_open(apr_pool_t *pool, const char *params, const char **error) +static apr_dbd_t *odbc_open(apr_pool_t *pool, const char *params, const char **error) { - SQLRETURN rc; - SQLHANDLE hdbc = NULL; - apr_dbd_t *handle; + SQLRETURN rc; + SQLHANDLE hdbc = NULL; + apr_dbd_t *handle; char *err_step; int err_htype, i; - int defaultBufferSize=DEFAULT_BUFFER_SIZE; + int defaultBufferSize = DEFAULT_BUFFER_SIZE; SQLHANDLE err_h = NULL; - SQLCHAR *datasource=(SQLCHAR *)"", *user=(SQLCHAR *)"", - *password=(SQLCHAR *)""; - int nattrs=0, *attrs=NULL, *attrvals=NULL, connect=0; + SQLCHAR *datasource = (SQLCHAR *)"", *user = (SQLCHAR *)"", + *password = (SQLCHAR *)""; + int nattrs = 0, *attrs = NULL, *attrvals = NULL, connect = 0; - err_step="SQLAllocHandle (SQL_HANDLE_DBC)"; + err_step = "SQLAllocHandle (SQL_HANDLE_DBC)"; err_htype = SQL_HANDLE_ENV; err_h = henv; rc = SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc); if (SQL_SUCCEEDED(rc)) { - err_step="Invalid DBD Parameters - open"; + err_step = "Invalid DBD Parameters - open"; err_htype = SQL_HANDLE_DBC; err_h = hdbc; rc = odbc_parse_params(pool, params, &connect, &datasource, &user, @@ -1024,32 +1060,33 @@ static apr_dbd_t* odbc_open(apr_pool_t *pool, const char *params, const char **e &attrvals); } if (SQL_SUCCEEDED(rc)) { - for (i=0 ; i < nattrs && SQL_SUCCEEDED(rc); i++) { - err_step="SQLSetConnectAttr (from DBD Parameters)"; + for (i = 0; i < nattrs && SQL_SUCCEEDED(rc); i++) { + err_step = "SQLSetConnectAttr (from DBD Parameters)"; err_htype = SQL_HANDLE_DBC; err_h = hdbc; - rc = SQLSetConnectAttr(hdbc, attrs[i], (SQLPOINTER) attrvals[i], 0); + rc = SQLSetConnectAttr(hdbc, attrs[i], (SQLPOINTER)attrvals[i], 0); } } if (SQL_SUCCEEDED(rc)) { if (connect) { SQLCHAR out[1024]; SQLSMALLINT outlen; - err_step="SQLDriverConnect"; + + err_step = "SQLDriverConnect"; err_htype = SQL_HANDLE_DBC; err_h = hdbc; rc = SQLDriverConnect(hdbc, NULL, datasource, - (SQLSMALLINT) strlen((char *)datasource), + (SQLSMALLINT)strlen((char *)datasource), out, sizeof(out), &outlen, SQL_DRIVER_NOPROMPT); } else { - err_step="SQLConnect"; + err_step = "SQLConnect"; err_htype = SQL_HANDLE_DBC; err_h = hdbc; rc = SQLConnect(hdbc, datasource, - (SQLSMALLINT) strlen((char *)datasource), - user, (SQLSMALLINT) strlen((char *)user), - password, (SQLSMALLINT) strlen((char *)password)); + (SQLSMALLINT)strlen((char *)datasource), + user, (SQLSMALLINT)strlen((char *)user), + password, (SQLSMALLINT)strlen((char *)password)); } } if (SQL_SUCCEEDED(rc)) { @@ -1071,6 +1108,7 @@ static apr_dbd_t* odbc_open(apr_pool_t *pool, const char *params, const char **e } else { apr_dbd_t tmp_dbc; + tmp_dbc.pool = pool; tmp_dbc.dbname = NULL; CHECK_ERROR(&tmp_dbc, err_step, rc, err_htype, err_h); @@ -1099,9 +1137,8 @@ static apr_status_t odbc_check_conn(apr_pool_t *pool, apr_dbd_t *handle) return (isDead == SQL_CD_FALSE) ? APR_SUCCESS : APR_EGENERAL; } - /** set_dbname: select database name. May be a no-op if not supported. **/ -static int odbc_set_dbname(apr_pool_t* pool, apr_dbd_t *handle, +static int odbc_set_dbname(apr_pool_t*pool, apr_dbd_t *handle, const char *name) { if (apr_strnatcmp(name, handle->dbname)) { @@ -1120,18 +1157,18 @@ static int odbc_start_transaction(apr_pool_t *pool, apr_dbd_t *handle, if (handle->transaction_mode) { rc = SQLSetConnectAttr(handle->dbc, SQL_ATTR_TXN_ISOLATION, - (SQLPOINTER) handle->transaction_mode, 0); + (SQLPOINTER)handle->transaction_mode, 0); CHECK_ERROR(handle, "SQLSetConnectAttr (SQL_ATTR_TXN_ISOLATION)", rc, SQL_HANDLE_DBC, handle->dbc); } - if SQL_SUCCEEDED(rc) { + if (SQL_SUCCEEDED(rc)) { /* turn off autocommit for transactions */ rc = SQLSetConnectAttr(handle->dbc, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF, 0); CHECK_ERROR(handle, "SQLSetConnectAttr (SQL_ATTR_AUTOCOMMIT)", rc, SQL_HANDLE_DBC, handle->dbc); } - if SQL_SUCCEEDED(rc) { + if (SQL_SUCCEEDED(rc)) { *trans = apr_palloc(pool, sizeof(apr_dbd_transaction_t)); (*trans)->dbc = handle->dbc; (*trans)->apr_dbd = handle; @@ -1140,7 +1177,6 @@ static int odbc_start_transaction(apr_pool_t *pool, apr_dbd_t *handle, return APR_FROM_SQL_RESULT(rc); } - /** end_transaction: end a transaction **/ static int odbc_end_transaction(apr_dbd_transaction_t *trans) { @@ -1150,9 +1186,9 @@ static int odbc_end_transaction(apr_dbd_transaction_t *trans) rc = SQLEndTran(SQL_HANDLE_DBC, trans->dbc, action); CHECK_ERROR(trans->apr_dbd, "SQLEndTran", rc, SQL_HANDLE_DBC, trans->dbc); - if SQL_SUCCEEDED(rc) { + if (SQL_SUCCEEDED(rc)) { rc = SQLSetConnectAttr(trans->dbc, SQL_ATTR_AUTOCOMMIT, - (SQLPOINTER) SQL_AUTOCOMMIT_ON, 0); + (SQLPOINTER)SQL_AUTOCOMMIT_ON, 0); CHECK_ERROR(trans->apr_dbd, "SQLSetConnectAttr (SQL_ATTR_AUTOCOMMIT)", rc, SQL_HANDLE_DBC, trans->dbc); } @@ -1176,14 +1212,14 @@ static int odbc_query(apr_dbd_t *handle, int *nrows, const char *statement) if (!SQL_SUCCEEDED(rc)) return APR_FROM_SQL_RESULT(rc); - rc = SQLExecDirect(hstmt, (SQLCHAR *) statement, (SQLINTEGER) len); + rc = SQLExecDirect(hstmt, (SQLCHAR *)statement, (SQLINTEGER)len); CHECK_ERROR(handle, "SQLExecDirect", rc, SQL_HANDLE_STMT, hstmt); - if SQL_SUCCEEDED(rc) { + if (SQL_SUCCEEDED(rc)) { SQLLEN rowcount; rc = SQLRowCount(hstmt, &rowcount); - *nrows = (int) rowcount; + *nrows = (int)rowcount; CHECK_ERROR(handle, "SQLRowCount", rc, SQL_HANDLE_STMT, hstmt); } @@ -1210,8 +1246,8 @@ static int odbc_select(apr_pool_t *pool, apr_dbd_t *handle, if (!SQL_SUCCEEDED(rc)) return APR_FROM_SQL_RESULT(rc); /* Prepare an apr_dbd_prepared_t for pool cleanup, even though this - * is not a prepared statement. We want the same cleanup mechanism. - */ + * is not a prepared statement. We want the same cleanup mechanism. + */ stmt = apr_pcalloc(pool, sizeof(apr_dbd_prepared_t)); stmt->apr_dbd = handle; stmt->dbc = handle->dbc; @@ -1219,15 +1255,15 @@ static int odbc_select(apr_pool_t *pool, apr_dbd_t *handle, apr_pool_cleanup_register(pool, stmt, odbc_close_pstmt, apr_pool_cleanup_null); if (random) { rc = SQLSetStmtAttr(hstmt, SQL_ATTR_CURSOR_SCROLLABLE, - (SQLPOINTER) SQL_SCROLLABLE, 0); + (SQLPOINTER)SQL_SCROLLABLE, 0); CHECK_ERROR(handle, "SQLSetStmtAttr (SQL_ATTR_CURSOR_SCROLLABLE)", rc, SQL_HANDLE_STMT, hstmt); } - if SQL_SUCCEEDED(rc) { - rc = SQLExecDirect(hstmt, (SQLCHAR *) statement, (SQLINTEGER) len); + if (SQL_SUCCEEDED(rc)) { + rc = SQLExecDirect(hstmt, (SQLCHAR *)statement, (SQLINTEGER)len); CHECK_ERROR(handle, "SQLExecDirect", rc, SQL_HANDLE_STMT, hstmt); } - if SQL_SUCCEEDED(rc) { + if (SQL_SUCCEEDED(rc)) { rc = odbc_create_results(handle, hstmt, pool, random, res); apr_pool_cleanup_register(pool, *res, odbc_close_results, apr_pool_cleanup_null); @@ -1249,12 +1285,12 @@ static int odbc_num_tuples(apr_dbd_results_t *res) rc = SQLRowCount(res->stmt, &nrows); CHECK_ERROR(res->apr_dbd, "SQLRowCount", rc, SQL_HANDLE_STMT, res->stmt); - return SQL_SUCCEEDED(rc) ? (int) nrows : -1; + return SQL_SUCCEEDED(rc) ? (int)nrows : -1; } /** get_row: get a row from a result set **/ -static int odbc_get_row(apr_pool_t * pool, apr_dbd_results_t * res, - apr_dbd_row_t ** row, int rownum) +static int odbc_get_row(apr_pool_t *pool, apr_dbd_results_t *res, + apr_dbd_row_t **row, int rownum) { SQLRETURN rc; char *fetchtype; @@ -1268,11 +1304,12 @@ static int odbc_get_row(apr_pool_t * pool, apr_dbd_results_t * res, /* mark all the columns as needing SQLGetData unless they are bound */ for (c = 0; c < res->ncols; c++) { - if (res->colstate[c] != COL_BOUND) + if (res->colstate[c] != COL_BOUND) { res->colstate[c] = COL_AVAIL; - /* some drivers do not null-term zero-len CHAR data */ - if (res->colptrs[c] ) - * (char *) res->colptrs[c] = 0; + } + /* some drivers do not null-term zero-len CHAR data */ + if (res->colptrs[c]) + *(char *)res->colptrs[c] = 0; } if (res->random && (rownum > 0)) { @@ -1287,7 +1324,8 @@ static int odbc_get_row(apr_pool_t * pool, apr_dbd_results_t * res, (*row)->stmt = res->stmt; if (!SQL_SUCCEEDED(rc) && !res->random) { /* early close on any error (usually SQL_NO_DATA) if fetching - * sequentially to release resources ASAP */ + * sequentially to release resources ASAP + */ odbc_close_results(res); return -1; } @@ -1295,7 +1333,7 @@ static int odbc_get_row(apr_pool_t * pool, apr_dbd_results_t * res, } /** datum_get: get a binary entry from a row **/ -static apr_status_t odbc_datum_get(const apr_dbd_row_t * row, int col, +static apr_status_t odbc_datum_get(const apr_dbd_row_t *row, int col, apr_dbd_type_e dbdtype, void *data) { SQLSMALLINT sqltype; @@ -1316,7 +1354,7 @@ static apr_status_t odbc_datum_get(const apr_dbd_row_t * row, int col, return odbc_create_bucket(row, col, sqltype, data); p = odbc_get(row, col, sqltype); - if (p == (void *) -1) + if (p == (void *)-1) return APR_EGENERAL; if (p == NULL) @@ -1332,7 +1370,7 @@ static apr_status_t odbc_datum_get(const apr_dbd_row_t * row, int col, } /** get_entry: get an entry from a row (string data) **/ -static const char *odbc_get_entry(const apr_dbd_row_t * row, int col) +static const char *odbc_get_entry(const apr_dbd_row_t *row, int col) { void *p; @@ -1342,47 +1380,48 @@ static const char *odbc_get_entry(const apr_dbd_row_t * row, int col) p = odbc_get(row, col, SQL_C_CHAR); /* NULL or invalid (-1) */ - if (p == NULL || p == (void *) -1) + if (p == NULL || p == (void *)-1) return p; else return apr_pstrdup(row->pool, p); } /** error: get current error message (if any) **/ -static const char* odbc_error(apr_dbd_t *handle, int errnum) +static const char *odbc_error(apr_dbd_t *handle, int errnum) { return (handle) ? handle->lastError : "[dbd_odbc]No error message available"; } /** escape: escape a string so it is safe for use in query/select **/ -static const char* odbc_escape(apr_pool_t *pool, const char *s, - apr_dbd_t *handle) +static const char *odbc_escape(apr_pool_t *pool, const char *s, + apr_dbd_t *handle) { char *newstr, *src, *dst, *sq; int qcount; /* return the original if there are no single-quotes */ if (!(sq = strchr(s, '\''))) - return (char *) s; + return (char *)s; /* count the single-quotes and allocate a new buffer */ for (qcount = 1; (sq = strchr(sq + 1, '\'')); ) qcount++; newstr = apr_palloc(pool, strlen(s) + qcount + 1); /* move chars, doubling all single-quotes */ - src = (char *) s; - for (dst = newstr ; *src ; src++) { + src = (char *)s; + for (dst = newstr; *src; src++) { if ((*dst++ = *src) == '\'') *dst++ = '\''; } *dst = 0; return newstr; } + /** prepare: prepare a statement **/ -static int odbc_prepare(apr_pool_t * pool, apr_dbd_t * handle, +static int odbc_prepare(apr_pool_t *pool, apr_dbd_t *handle, const char *query, const char *label, int nargs, - int nvals, apr_dbd_type_e * types, - apr_dbd_prepared_t ** statement) + int nvals, apr_dbd_type_e *types, + apr_dbd_prepared_t **statement) { SQLRETURN rc; size_t len = strlen(query); @@ -1402,15 +1441,15 @@ static int odbc_prepare(apr_pool_t * pool, apr_dbd_t * handle, odbc_close_pstmt, apr_pool_cleanup_null); CHECK_ERROR(handle, "SQLAllocHandle (STMT)", rc, SQL_HANDLE_DBC, handle->dbc); - rc = SQLPrepare((*statement)->stmt, (SQLCHAR *) query, (SQLINTEGER) len); + rc = SQLPrepare((*statement)->stmt, (SQLCHAR *)query, (SQLINTEGER)len); CHECK_ERROR(handle, "SQLPrepare", rc, SQL_HANDLE_STMT, (*statement)->stmt); return APR_FROM_SQL_RESULT(rc); } /** pquery: query using a prepared statement + args **/ -static int odbc_pquery(apr_pool_t * pool, apr_dbd_t * handle, int *nrows, - apr_dbd_prepared_t * statement, const char **args) +static int odbc_pquery(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement, const char **args) { SQLRETURN rc = SQL_SUCCESS; int i, argp; @@ -1420,30 +1459,31 @@ static int odbc_pquery(apr_pool_t * pool, apr_dbd_t * handle, int *nrows, for (i = argp = 0; i < statement->nargs && SQL_SUCCEEDED(rc); i++) { rc = odbc_bind_param(pool, statement, i + 1, statement->types[i], - &argp, (const void **) args, TEXTMODE); + &argp, (const void **)args, TEXTMODE); } if (SQL_SUCCEEDED(rc)) { rc = SQLExecute(statement->stmt); CHECK_ERROR(handle, "SQLExecute", rc, SQL_HANDLE_STMT, statement->stmt); - } + } if (SQL_SUCCEEDED(rc)) { SQLLEN rowcount; rc = SQLRowCount(statement->stmt, &rowcount); - *nrows = (int) rowcount; + *nrows = (int)rowcount; CHECK_ERROR(handle, "SQLRowCount", rc, SQL_HANDLE_STMT, statement->stmt); - } + } return APR_FROM_SQL_RESULT(rc); } /** pvquery: query using a prepared statement + args **/ -static int odbc_pvquery(apr_pool_t * pool, apr_dbd_t * handle, int *nrows, - apr_dbd_prepared_t * statement, va_list args) +static int odbc_pvquery(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement, va_list args) { const char **values; int i; + values = apr_palloc(pool, sizeof(*values) * statement->nvals); for (i = 0; i < statement->nvals; i++) values[i] = va_arg(args, const char *); @@ -1451,8 +1491,8 @@ static int odbc_pvquery(apr_pool_t * pool, apr_dbd_t * handle, int *nrows, } /** pselect: select using a prepared statement + args **/ -static int odbc_pselect(apr_pool_t * pool, apr_dbd_t * handle, - apr_dbd_results_t ** res, apr_dbd_prepared_t * statement, +static int odbc_pselect(apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, const char **args) { SQLRETURN rc = SQL_SUCCESS; @@ -1463,32 +1503,33 @@ static int odbc_pselect(apr_pool_t * pool, apr_dbd_t * handle, if (random) { rc = SQLSetStmtAttr(statement->stmt, SQL_ATTR_CURSOR_SCROLLABLE, - (SQLPOINTER) SQL_SCROLLABLE, 0); + (SQLPOINTER)SQL_SCROLLABLE, 0); CHECK_ERROR(handle, "SQLSetStmtAttr (SQL_ATTR_CURSOR_SCROLLABLE)", rc, SQL_HANDLE_STMT, statement->stmt); } if (SQL_SUCCEEDED(rc)) { - for (i = argp = 0; i < statement->nargs && SQL_SUCCEEDED(rc); i++) + for (i = argp = 0; i < statement->nargs && SQL_SUCCEEDED(rc); i++) { rc = odbc_bind_param(pool, statement, i + 1, statement->types[i], - &argp, (const void **) args, TEXTMODE); + &argp, (const void **)args, TEXTMODE); } + } if (SQL_SUCCEEDED(rc)) { rc = SQLExecute(statement->stmt); CHECK_ERROR(handle, "SQLExecute", rc, SQL_HANDLE_STMT, statement->stmt); - } + } if (SQL_SUCCEEDED(rc)) { rc = odbc_create_results(handle, statement->stmt, pool, random, res); apr_pool_cleanup_register(pool, *res, odbc_close_results, apr_pool_cleanup_null); - } + } return APR_FROM_SQL_RESULT(rc); } /** pvselect: select using a prepared statement + args **/ -static int odbc_pvselect(apr_pool_t * pool, apr_dbd_t * handle, - apr_dbd_results_t ** res, - apr_dbd_prepared_t * statement, int random, +static int odbc_pvselect(apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, int random, va_list args) { const char **values; @@ -1501,7 +1542,7 @@ static int odbc_pvselect(apr_pool_t * pool, apr_dbd_t * handle, } /** get_name: get a column title from a result set **/ -static const char *odbc_get_name(const apr_dbd_results_t * res, int col) +static const char *odbc_get_name(const apr_dbd_results_t *res, int col) { SQLRETURN rc; char buffer[MAX_COLUMN_NAME]; @@ -1522,13 +1563,13 @@ static const char *odbc_get_name(const apr_dbd_results_t * res, int col) } /** transaction_mode_get: get the mode of transaction **/ -static int odbc_transaction_mode_get(apr_dbd_transaction_t * trans) +static int odbc_transaction_mode_get(apr_dbd_transaction_t *trans) { - return (int) trans->apr_dbd->can_commit; + return (int)trans->apr_dbd->can_commit; } /** transaction_mode_set: set the mode of transaction **/ -static int odbc_transaction_mode_set(apr_dbd_transaction_t * trans, int mode) +static int odbc_transaction_mode_set(apr_dbd_transaction_t *trans, int mode) { int legal = ( APR_DBD_TRANSACTION_IGNORE_ERRORS | APR_DBD_TRANSACTION_COMMIT @@ -1542,8 +1583,8 @@ static int odbc_transaction_mode_set(apr_dbd_transaction_t * trans, int mode) } /** pbquery: query using a prepared statement + binary args **/ -static int odbc_pbquery(apr_pool_t * pool, apr_dbd_t * handle, int *nrows, - apr_dbd_prepared_t * statement, const void **args) +static int odbc_pbquery(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement, const void **args) { SQLRETURN rc = SQL_SUCCESS; int i, argp; @@ -1559,22 +1600,22 @@ static int odbc_pbquery(apr_pool_t * pool, apr_dbd_t * handle, int *nrows, rc = SQLExecute(statement->stmt); CHECK_ERROR(handle, "SQLExecute", rc, SQL_HANDLE_STMT, statement->stmt); - } + } if (SQL_SUCCEEDED(rc)) { SQLLEN rowcount; rc = SQLRowCount(statement->stmt, &rowcount); - *nrows = (int) rowcount; + *nrows = (int)rowcount; CHECK_ERROR(handle, "SQLRowCount", rc, SQL_HANDLE_STMT, statement->stmt); - } + } return APR_FROM_SQL_RESULT(rc); } /** pbselect: select using a prepared statement + binary args **/ -static int odbc_pbselect(apr_pool_t * pool, apr_dbd_t * handle, - apr_dbd_results_t ** res, - apr_dbd_prepared_t * statement, +static int odbc_pbselect(apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, int random, const void **args) { SQLRETURN rc = SQL_SUCCESS; @@ -1585,7 +1626,7 @@ static int odbc_pbselect(apr_pool_t * pool, apr_dbd_t * handle, if (random) { rc = SQLSetStmtAttr(statement->stmt, SQL_ATTR_CURSOR_SCROLLABLE, - (SQLPOINTER) SQL_SCROLLABLE, 0); + (SQLPOINTER)SQL_SCROLLABLE, 0); CHECK_ERROR(handle, "SQLSetStmtAttr (SQL_ATTR_CURSOR_SCROLLABLE)", rc, SQL_HANDLE_STMT, statement->stmt); } @@ -1594,24 +1635,24 @@ static int odbc_pbselect(apr_pool_t * pool, apr_dbd_t * handle, rc = odbc_bind_param(pool, statement, i + 1, statement->types[i], &argp, args, BINARYMODE); } - } + } if (SQL_SUCCEEDED(rc)) { rc = SQLExecute(statement->stmt); CHECK_ERROR(handle, "SQLExecute", rc, SQL_HANDLE_STMT, statement->stmt); - } + } if (SQL_SUCCEEDED(rc)) { rc = odbc_create_results(handle, statement->stmt, pool, random, res); apr_pool_cleanup_register(pool, *res, odbc_close_results, apr_pool_cleanup_null); - } + } return APR_FROM_SQL_RESULT(rc); } /** pvbquery: query using a prepared statement + binary args **/ -static int odbc_pvbquery(apr_pool_t * pool, apr_dbd_t * handle, int *nrows, - apr_dbd_prepared_t * statement, va_list args) +static int odbc_pvbquery(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, + apr_dbd_prepared_t *statement, va_list args) { const char **values; int i; @@ -1619,13 +1660,13 @@ static int odbc_pvbquery(apr_pool_t * pool, apr_dbd_t * handle, int *nrows, values = apr_palloc(pool, sizeof(*values) * statement->nvals); for (i = 0; i < statement->nvals; i++) values[i] = va_arg(args, const char *); - return odbc_pbquery(pool, handle, nrows, statement, (const void **) values); + return odbc_pbquery(pool, handle, nrows, statement, (const void **)values); } /** pvbselect: select using a prepared statement + binary args **/ -static int odbc_pvbselect(apr_pool_t * pool, apr_dbd_t * handle, - apr_dbd_results_t ** res, - apr_dbd_prepared_t * statement, +static int odbc_pvbselect(apr_pool_t *pool, apr_dbd_t *handle, + apr_dbd_results_t **res, + apr_dbd_prepared_t *statement, int random, va_list args) { const char **values; @@ -1634,10 +1675,10 @@ static int odbc_pvbselect(apr_pool_t * pool, apr_dbd_t * handle, values = apr_palloc(pool, sizeof(*values) * statement->nvals); for (i = 0; i < statement->nvals; i++) values[i] = va_arg(args, const char *); - return odbc_pbselect(pool, handle, res, statement, random, (const void **) values); + return odbc_pbselect(pool, handle, res, statement, random, (const void **)values); } -APR_MODULE_DECLARE_DATA const apr_dbd_driver_t ODBC_DRIVER_ENTRY = { +APR_MODULE_DECLARE_DATA const apr_dbd_driver_t ODBC_DRIVER_ENTRY = { ODBC_DRIVER_STRING, odbc_init, odbc_native_handle, From afcf226733f2262b6c71194192524823dcac2610 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 6 Mar 2011 20:13:35 +0000 Subject: [PATCH 6872/7878] NetWare build overhaul in order to compile on Linux. Part 4. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078559 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 33 ++++++++++----------- build/NWGNUenvironment.inc | 36 ++++++++++++----------- build/NWGNUhead.inc | 6 ++-- build/NWGNUmakefile | 26 ++++++----------- build/NWGNUtail.inc | 59 +++++++++++++++++++++----------------- dbd/NWGNUdbdfreetds | 15 ++++------ dbd/NWGNUdbdmysql | 15 ++++------ dbd/NWGNUdbdpgsql | 15 ++++------ dbd/NWGNUdbdsqli2 | 15 ++++------ dbd/NWGNUdbdsqli3 | 15 ++++------ dbd/NWGNUmakefile | 4 +-- dbm/NWGNUdbmdb | 15 ++++------ dbm/NWGNUdbmgdbm | 15 ++++------ dbm/NWGNUmakefile | 4 +-- ldap/NWGNUmakefile | 2 +- test/NWGNUaprtest | 9 +++--- test/NWGNUechod | 6 ++-- test/NWGNUglobalmutexchild | 12 ++++---- test/NWGNUmakefile | 10 +++---- test/NWGNUmod_test | 14 ++++----- test/NWGNUproc_child | 12 ++++---- test/NWGNUreadchild | 6 ++-- test/NWGNUsockchild | 6 ++-- test/NWGNUsockperf | 6 ++-- test/NWGNUtestatmc | 8 +++--- test/NWGNUtryread | 7 +++-- xml/NWGNUmakefile | 8 +++--- 27 files changed, 172 insertions(+), 207 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index aae43124298..e5c1bc754ad 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -141,12 +141,12 @@ NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -156,7 +156,7 @@ NLM_CHECK_SYM = # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = # # If this is specified it will be linked in with the XDCData option in the def @@ -423,24 +423,24 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples) # install :: nlms $(INSTDIRS) FORCE - $(call CP,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/) + $(call COPY,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/) ifndef DEST - -$(call CP,$(APR)/STATUS,$(INSTALLBASE)/*.apr) - -$(call CP,$(APR)/LICENSE,$(INSTALLBASE)/) - -$(call CP,$(APR)/CHANGES,$(INSTALLBASE)/*.apr) - @-$(call XCP,$(APR)/docs,$(INSTALLBASE)/docs/) + -$(call COPY,$(APR)/STATUS,$(INSTALLBASE)/*.apr) + -$(call COPY,$(APR)/LICENSE,$(INSTALLBASE)/) + -$(call COPY,$(APR)/CHANGES,$(INSTALLBASE)/*.apr) + @-$(call COPYR,$(APR)/docs,$(INSTALLBASE)/docs/) endif ifndef DEST installdev :: $(INSTDEVDIRS) FORCE - $(call CP,$(APR)/include/*.h,$(INSTALLBASE)/include/) - $(call CP,$(APR)/*.imp,$(INSTALLBASE)/lib/) - $(call CP,$(APR)/misc/netware/*.xdc,$(INSTALLBASE)/lib/) - $(call CP,$(APR)/$(TARGET_lib),$(INSTALLBASE)/lib/) - $(call CP,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/bin/) + $(call COPY,$(APR)/include/*.h,$(INSTALLBASE)/include/) + $(call COPY,$(APR)/*.imp,$(INSTALLBASE)/lib/) + $(call COPY,$(APR)/misc/netware/*.xdc,$(INSTALLBASE)/lib/) + $(call COPY,$(APR)/$(TARGET_lib),$(INSTALLBASE)/lib/) + $(call COPY,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/bin/) $(INSTDEVDIRS) :: - $(call MD,$@) + $(call MKDIR,$@) endif # @@ -460,7 +460,8 @@ endif vpath %.c network_io/unix $(OBJDIR)/%.o: file_io/netware/%.c $(OBJDIR)/$(NLM_NAME)_cc.opt - @echo Compiling $< +# @echo Compiling $< + @echo $(DL)CC $<$(DL) $(CC) -cwd source -o $@ $< @$(OBJDIR)/$(NLM_NAME)_cc.opt # @@ -468,6 +469,6 @@ $(OBJDIR)/%.o: file_io/netware/%.c $(OBJDIR)/$(NLM_NAME)_cc.opt # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 51ee5184ef8..6543e8bb881 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -72,7 +72,7 @@ $(error neither EXPATSDK nor EXPATSRC defined - cant compile without EXPAT SDK o endif ifndef METROWERKS -METROWERKS = C:\Program Files\Metrowerks\CodeWarrior +METROWERKS = $(ProgramFiles)\Metrowerks\CodeWarrior endif # If LM_LICENSE_FILE isn't defined, define a variable that can be used to @@ -142,33 +142,35 @@ LIB = mwldnlm -type library -w nocmdline # Setup build tools AWK = awk +SORT = sort # # Declare Command and tool macros here # ifeq ($(findstring /sh,$(SHELL)),/sh) -DEL = $(RM) $1 -MD = mkdir -p $1 -DELTREE = rm -rf $1 -CP = cp -av $1 $2 -XCP = cp -ar +DEL = rm -f $1 +RMDIR = rm -rf $1 +MKDIR = mkdir -p $1 +COPY = cp -av $1 $2 +COPYR = cp -ar $1 $2 ECHONL = echo "" DL = ' +CAT = cat else ifeq "$(OS)" "Windows_NT" -CMD = cmd /c -DEL = $(CMD) if exist $(subst /,\,$1) del /q /f 2>NUL $(subst /,\,$1) -DELTREE = rd /s /q 2>NUL $(subst /,\,$1) +DEL = $(shell if exist $(subst /,\,$1) del /q /f 2>NUL $(subst /,\,$1)) +RMDIR = $(shell if exist $(subst /,\,$1)\NUL rd /q /s 2>NUL $(subst /,\,$1)) +ECHONL = cmd /c echo. else -CMD = command /c -DEL = $(CMD) if exist $(subst /,\,$1) del 2>NUL $(subst /,\,$1) -DELTREE = deltree /y $(subst /,\,$1) -endif -MD = $(CMD) if not exist $(subst /,\,$1)\NUL md 2>NUL $(subst /,\,$1) -CP = copy /y 2>NUL $(subst /,\,$1) $(subst /,\,$2) -XCP = xcopy /e /y 2>NUL $(subst /,\,$1) $(subst /,\,$2) -ECHONL = $(CMD) echo. +DEL = $(shell if exist $(subst /,\,$1) del 2>NUL $(subst /,\,$1)) +RMDIR = $(shell if exist $(subst /,\,$1)\NUL deltree /y 2>NUL $(subst /,\,$1)) +ECHONL = command /c echo. +endif +MKDIR = $(shell if not exist $(subst /,\,$1)\NUL md 2>NUL $(subst /,\,$1)) +COPY = copy /y 2>NUL $(subst /,\,$1) $(subst /,\,$2) +COPYR = xcopy /y /e 2>NUL $(subst /,\,$1) $(subst /,\,$2) +CAT = type endif ifdef IPV6 diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc index 31b34e70be4..28b148993fc 100644 --- a/build/NWGNUhead.inc +++ b/build/NWGNUhead.inc @@ -86,12 +86,12 @@ FORCE : ; clean :: $(SUBDIRS) $(APRTEST) @echo Cleaning up $(CURDIR) - -$(call DELTREE,$(OBJDIR)) + $(call RMDIR,$(OBJDIR)) $(call DEL,*.err) $(call DEL,*.map) -# $(call DEL,*.d) $(call DEL,*.tmp) +# $(call DEL,*.d) $(OBJDIR) :: - $(call MD,$@) + $(call MKDIR,$@) diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index a62e15d09f6..ab9fdbc3adf 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -19,7 +19,6 @@ FILES_prebuild_headers = \ $(APR)/include/apr.h \ $(APR)/include/apu_want.h \ $(APR)/include/apr_ldap.h \ - $(APR)/include/private/apu_config.h \ $(APR)/include/private/apu_select_dbm.h \ $(EOLIST) @@ -28,7 +27,7 @@ nlms :: $(APR)/aprlib.imp $(APR)/aprlib.imp : make_nw_export.awk nw_export.i # @echo Generating $@ @echo GEN $@ - $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ | sort >$@ + $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ | $(SORT) >$@ nw_export.i : nw_export.inc $(FILES_prebuild_headers) $(NLM_NAME)_cc.opt # @echo Generating $@ @@ -51,19 +50,13 @@ ifneq "$(LDAPSDK)" "" @echo -ir $(LDAPSDK) >> $@ endif -$(APR)/include/%.h: $(APR)/include/%.hnw +%.h: %.hnw @echo Creating $@ - $(call CP,$<,$@) + $(call COPY,$<,$@) -$(APR)/include/private/%.h: $(APR)/include/private/%.hnw +%.h: %.hw @echo Creating $@ - $(call CP,$<,$@) - -$(APR)/include/private/%.h: $(APR)/include/private/%.hw - @echo Creating $@ - $(call CP,$<,$@) - -$(APR)/include/private/apu_config.h: FORCE + $(call COPY,$<,$@) # # You can use this target if all that is needed is to copy files to the @@ -76,17 +69,14 @@ clean :: $(call DEL,nw_export.i) $(call DEL,$(NLM_NAME)_cc.opt) $(call DEL,NWGNUversion.inc) - $(call DEL,$(APR)/include/apr.h) - $(call DEL,$(APR)/include/apu_want.h) - $(call DEL,$(APR)/include/apr_ldap.h) - $(call DEL,$(APR)/include/private/apu_config.h) - $(call DEL,$(APR)/include/private/apu_select_dbm.h) $(call DEL,$(APR)/aprlib.imp) + $(foreach file,$(FILES_prebuild_headers),$(call DEL,$(file))) # # Include the 'tail' makefile that has targets that depend on variables defined # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc + diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 3aa79e95431..44856162ae7 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -28,6 +28,22 @@ ifndef NLM_COPYRIGHT NLM_COPYRIGHT = Licensed under the Apache License, Version 2.0 endif +ifeq "$(NLM_FLAGS)" "" +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +endif + +ifeq "$(NLM_STACK_SIZE)" "" +NLM_STACK_SIZE = 65536 +endif + +ifeq "$(NLM_ENTRY_SYM)" "" +NLM_ENTRY_SYM = _LibCPrelude +endif + +ifeq "$(NLM_EXIT_SYM)" "" +NLM_EXIT_SYM = _LibCPostlude +endif + # # Create dependency lists based on the files available # @@ -114,14 +130,14 @@ ifeq "$(INCLUDE_BLDCMDS)" "1" $(OBJDIR)/%.o: %.c $(OBJDIR)/$(CCOPT_NAME)_cc.opt # @echo Compiling $< - @echo CC $< + @echo $(DL)CC $<$(DL) $(CC) -o $@ $< @$(word 2, $^) $(OBJDIR)/$(CCOPT_NAME)_cc.opt: $(CCOPT_DEPENDS) $(call DEL,$@) # @echo CCOPT_DEPENDS=$^ # @echo Generating $@ - @echo GEN $@ + @echo $(DL)GEN $@$(DL) ifneq "$(strip $(CFLAGS))" "" @echo $(CFLAGS) >> $@ endif @@ -143,14 +159,14 @@ endif $(OBJDIR)/%.o: %.cpp $(OBJDIR)/$(CCOPT_NAME)_cpp.opt # @echo Compiling $< - @echo CC $< + @echo $(DL)CPP $<$(DL) $(CCP) -o $@ $< @$(word 2, $^) $(OBJDIR)/$(CCOPT_NAME)_cpp.opt: $(CPPOPT_DEPENDS) $(call DEL,$@) - @echo CPPOPT_DEPENDS=$^ +# @echo CPPOPT_DEPENDS=$^ # @echo Generating $@ - @echo GEN $@ + @echo $(DL)GEN $@$(DL) ifneq "$(strip $(CFLAGS))" "" @echo $(CFLAGS) >> $@ endif @@ -183,14 +199,14 @@ ifeq "$(words $(strip $(TARGET_lib)))" "1" $(TARGET_lib) : $(OBJDIR)/$(LIB_NAME)_lib.lst $(call DEL,$@) # @echo Generating $@ - @echo AR $@ + @echo $(DL)AR $@$(DL) $(LIB) -o $@ @$< $(OBJDIR)/aprlib_lib.lst: $(aprlib_LIBLST_DEPENDS) $(call DEL,$@) ifneq "$(strip $(FILES_lib_objs))" "" # @echo Generating $@ - @echo GEN $@ + @echo $(DL)GEN $@$(DL) @echo $(wordlist 1, 10, $(FILES_lib_objs)) >> $@ @echo $(wordlist 11, 20, $(FILES_lib_objs)) >> $@ @echo $(wordlist 21, 30, $(FILES_lib_objs)) >> $@ @@ -208,7 +224,7 @@ $(OBJDIR)/%_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS) $(call DEL,$@) ifneq "$(strip $(FILES_lib_objs))" "" # @echo Generating $@ - @echo GEN $@ + @echo $(DL)GEN $@$(DL) @echo $(FILES_lib_objs) >> $@ endif @@ -231,7 +247,7 @@ ifeq "$(words $(strip $(TARGET_nlm)))" "1" $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.opt # @echo Linking $@ - @echo LINK $@ + @echo $(DL)LINK $@$(DL) $(LINK) @$(OBJDIR)/$(NLM_NAME)_link.opt # This will force the link option file to be rebuilt if we change the @@ -241,18 +257,20 @@ $(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) $(call DEL,$@) $(call DEL,$(@:.opt=.def)) # @echo Generating $@ - @echo GEN $@ + @echo $(DL)GEN $@$(DL) + @echo $(DL)# Do not edit this file - it is created by make!$(DL) > $@ + @echo $(DL)# All your changes will be lost!!$(DL) >> $@ @echo -warnings off >> $@ @echo -zerobss >> $@ @echo -o $(TARGET_nlm) >> $@ ifneq "$(FILE_nlm_copyright)" "" - @-type $(FILE_nlm_copyright) >> $@ + @-$(CAT) $(FILE_nlm_copyright) >> $@ endif ifeq "$(RELEASE)" "debug" @echo -g >> $@ @echo -sym internal >> $@ @echo -sym codeview4 >> $@ - @echo -osym $(OBJDIR)\$(NLM_NAME).sym >> $@ + @echo -osym $(OBJDIR)/$(NLM_NAME).sym >> $@ else @echo -sym internal >> $@ endif @@ -295,29 +313,19 @@ ifeq "$(FILE_nlm_copyright)" "" endif @echo $(DL)description "$(NLM_DESCRIPTION)"$(DL) >> $(@:.opt=.def) @echo $(DL)threadname "$(NLM_THREAD_NAME)"$(DL) >> $(@:.opt=.def) -ifneq "$(NLM_STACK_SIZE)" "" - @echo stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE)))) >> $(@:.opt=.def) -else - @echo stacksize 64000 >> $(@:.opt=.def) -endif @echo $(DL)screenname "$(NLM_SCREEN_NAME)"$(DL) >> $(@:.opt=.def) + @echo stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE)))) >> $(@:.opt=.def) ifneq "$(NLM_VERSION)" "" @echo version $(NLM_VERSION) >> $(@:.opt=.def) else @echo version $(VERSION) >> $(@:.opt=.def) endif -ifneq "$(NLM_ENTRY_SYM)" "" + @echo $(strip $(NLM_FLAGS)) >> $(@:.opt=.def) @echo start $(NLM_ENTRY_SYM) >> $(@:.opt=.def) -endif -ifneq "$(NLM_EXIT_SYM)" "" @echo exit $(NLM_EXIT_SYM) >> $(@:.opt=.def) -endif ifneq "$(NLM_CHECK_SYM)" "" @echo check $(NLM_CHECK_SYM) >> $(@:.opt=.def) endif -ifneq "$(NLM_FLAGS)" "" - @echo $(strip $(NLM_FLAGS)) >> $(@:.opt=.def) -endif ifneq "$(FILES_nlm_modules)" "" @echo module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(module)) >> $(@:.opt=.def) endif @@ -327,7 +335,6 @@ endif ifneq "$(FILES_nlm_exports)" "" @echo export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export)) >> $(@:.opt=.def) endif - # if APACHE_UNIPROC is defined, don't include XDCData ifndef APACHE_UNIPROC ifneq "$(string $(XDCDATA))" "" @@ -358,6 +365,6 @@ endif # NO_LICENSE_FILE endif # multiple targets $(INSTDIRS) :: - $(call MD,$@) + $(call MKDIR,$@) diff --git a/dbd/NWGNUdbdfreetds b/dbd/NWGNUdbdfreetds index 49bed63ee91..a79a2ffd5ac 100644 --- a/dbd/NWGNUdbdfreetds +++ b/dbd/NWGNUdbdfreetds @@ -14,8 +14,6 @@ ifndef EnvironmentDefined include $(APR_WORK)/build/NWGNUhead.inc endif -#include $(APR)/build/NWGNUcustom.inc - # # build this level's files @@ -142,18 +140,17 @@ NLM_VERSION = # # If this is specified, it will override the default of 64K # -NLM_STACK_SIZE = 8192 - +NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -163,7 +160,7 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = # # If this is specified it will be linked in with the XDCData option in the def @@ -288,7 +285,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc - - +include $(APRBUILD)/NWGNUtail.inc diff --git a/dbd/NWGNUdbdmysql b/dbd/NWGNUdbdmysql index d040388fa85..10c4dbf155d 100644 --- a/dbd/NWGNUdbdmysql +++ b/dbd/NWGNUdbdmysql @@ -14,8 +14,6 @@ ifndef EnvironmentDefined include $(APR_WORK)/build/NWGNUhead.inc endif -#include $(APR)/build/NWGNUcustom.inc - # # build this level's files @@ -146,18 +144,17 @@ NLM_VERSION = # # If this is specified, it will override the default of 64K # -NLM_STACK_SIZE = 8192 - +NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -167,7 +164,7 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = # # If this is specified it will be linked in with the XDCData option in the def @@ -292,7 +289,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc - - +include $(APRBUILD)/NWGNUtail.inc diff --git a/dbd/NWGNUdbdpgsql b/dbd/NWGNUdbdpgsql index 455424fad0c..9e04f5427f7 100644 --- a/dbd/NWGNUdbdpgsql +++ b/dbd/NWGNUdbdpgsql @@ -14,8 +14,6 @@ ifndef EnvironmentDefined include $(APR_WORK)/build/NWGNUhead.inc endif -#include $(APR)/build/NWGNUcustom.inc - # # build this level's files @@ -143,18 +141,17 @@ NLM_VERSION = # # If this is specified, it will override the default of 64K # -NLM_STACK_SIZE = 8192 - +NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -164,7 +161,7 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = # # If this is specified it will be linked in with the XDCData option in the def @@ -289,7 +286,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc - - +include $(APRBUILD)/NWGNUtail.inc diff --git a/dbd/NWGNUdbdsqli2 b/dbd/NWGNUdbdsqli2 index 32775462810..bd5778853cc 100644 --- a/dbd/NWGNUdbdsqli2 +++ b/dbd/NWGNUdbdsqli2 @@ -14,8 +14,6 @@ ifndef EnvironmentDefined include $(APR_WORK)/build/NWGNUhead.inc endif -#include $(APR)/build/NWGNUcustom.inc - # # build this level's files @@ -142,18 +140,17 @@ NLM_VERSION = # # If this is specified, it will override the default of 64K # -NLM_STACK_SIZE = 8192 - +NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -163,7 +160,7 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = # # If this is specified it will be linked in with the XDCData option in the def @@ -288,7 +285,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc - - +include $(APRBUILD)/NWGNUtail.inc diff --git a/dbd/NWGNUdbdsqli3 b/dbd/NWGNUdbdsqli3 index 021f73409a6..921a373b59d 100644 --- a/dbd/NWGNUdbdsqli3 +++ b/dbd/NWGNUdbdsqli3 @@ -14,8 +14,6 @@ ifndef EnvironmentDefined include $(APR_WORK)/build/NWGNUhead.inc endif -#include $(APR)/build/NWGNUcustom.inc - # # build this level's files @@ -142,18 +140,17 @@ NLM_VERSION = # # If this is specified, it will override the default of 64K # -NLM_STACK_SIZE = 8192 - +NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -163,7 +160,7 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = # # If this is specified it will be linked in with the XDCData option in the def @@ -290,7 +287,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc - - +include $(APRBUILD)/NWGNUtail.inc diff --git a/dbd/NWGNUmakefile b/dbd/NWGNUmakefile index decde31aced..6bb7c610de4 100644 --- a/dbd/NWGNUmakefile +++ b/dbd/NWGNUmakefile @@ -244,7 +244,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples) # install :: nlms $(INSTDIRS) FORCE - $(CP) $(OBJDIR)\*.nlm $(INSTALLBASE) + $(call COPY,$(OBJDIR)/*.nlm,$(INSTALLBASE)/) # # Any specialized rules here @@ -255,6 +255,6 @@ install :: nlms $(INSTDIRS) FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc diff --git a/dbm/NWGNUdbmdb b/dbm/NWGNUdbmdb index 5c7d1c7a8c5..03b099cd644 100644 --- a/dbm/NWGNUdbmdb +++ b/dbm/NWGNUdbmdb @@ -14,8 +14,6 @@ ifndef EnvironmentDefined include $(APR_WORK)/build/NWGNUhead.inc endif -#include $(APR)\build\NWGNUcustom.inc - # # build this level's files @@ -145,18 +143,17 @@ NLM_VERSION = # # If this is specified, it will override the default of 64K # -NLM_STACK_SIZE = 8192 - +NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -166,7 +163,7 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = # # If this is specified it will be linked in with the XDCData option in the def @@ -291,7 +288,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc - - +include $(APRBUILD)/NWGNUtail.inc diff --git a/dbm/NWGNUdbmgdbm b/dbm/NWGNUdbmgdbm index f32ebc4516b..10709a54b20 100644 --- a/dbm/NWGNUdbmgdbm +++ b/dbm/NWGNUdbmgdbm @@ -14,8 +14,6 @@ ifndef EnvironmentDefined include $(APR_WORK)/build/NWGNUhead.inc endif -#include $(APR)\build\NWGNUcustom.inc - # # build this level's files @@ -144,18 +142,17 @@ NLM_VERSION = # # If this is specified, it will override the default of 64K # -NLM_STACK_SIZE = 8192 - +NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -165,7 +162,7 @@ NLM_CHECK_SYM = # # If these are specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = # # If this is specified it will be linked in with the XDCData option in the def @@ -290,7 +287,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc - - +include $(APRBUILD)/NWGNUtail.inc diff --git a/dbm/NWGNUmakefile b/dbm/NWGNUmakefile index db36d5cf340..228a45d11d2 100644 --- a/dbm/NWGNUmakefile +++ b/dbm/NWGNUmakefile @@ -235,7 +235,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples) # install :: nlms $(INSTDIRS) FORCE - copy $(OBJDIR)\*.nlm $(INSTALLBASE) + $(call COPY,$(OBJDIR)/*.nlm,$(INSTALLBASE)/) # # Any specialized rules here @@ -246,6 +246,6 @@ install :: nlms $(INSTDIRS) FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc diff --git a/ldap/NWGNUmakefile b/ldap/NWGNUmakefile index d0e085d2159..58bac625123 100644 --- a/ldap/NWGNUmakefile +++ b/ldap/NWGNUmakefile @@ -250,5 +250,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc diff --git a/test/NWGNUaprtest b/test/NWGNUaprtest index 6e812c435fa..d42a2016ede 100644 --- a/test/NWGNUaprtest +++ b/test/NWGNUaprtest @@ -123,12 +123,12 @@ NLM_STACK_SIZE = 524288 # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -138,7 +138,7 @@ NLM_CHECK_SYM = # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = # # If this is specified it will be linked in with the XDCData option in the def @@ -333,6 +333,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc - +include $(APRBUILD)/NWGNUtail.inc diff --git a/test/NWGNUechod b/test/NWGNUechod index 45b00c77d61..d1d1100e6c6 100644 --- a/test/NWGNUechod +++ b/test/NWGNUechod @@ -123,12 +123,12 @@ NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -249,5 +249,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc diff --git a/test/NWGNUglobalmutexchild b/test/NWGNUglobalmutexchild index 1ee75bb29fa..3db805b0241 100644 --- a/test/NWGNUglobalmutexchild +++ b/test/NWGNUglobalmutexchild @@ -8,7 +8,7 @@ # ifndef EnvironmentDefined -include $(APR_WORK)\build\NWGNUhead.inc +include $(APR_WORK)/build/NWGNUhead.inc endif # @@ -113,7 +113,7 @@ NLM_SCREEN_NAME = DEFAULT # # If this is specified, it will override VERSION value in -# $(APR_WORK)\build\NWGNUenvironment.inc +# $(APR_WORK)/build/NWGNUenvironment.inc # NLM_VERSION = @@ -125,12 +125,12 @@ NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -237,7 +237,7 @@ nlms :: libs $(TARGET_nlm) # # Updated this target to create necessary directories and copy files to the -# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples) +# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples) # install :: nlms FORCE @@ -250,5 +250,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)\build\NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc diff --git a/test/NWGNUmakefile b/test/NWGNUmakefile index af78c53a0f0..ad46450a94a 100644 --- a/test/NWGNUmakefile +++ b/test/NWGNUmakefile @@ -10,7 +10,7 @@ SUBDIRS = \ # paths to tools # -include $(APR_WORK)\build\NWGNUhead.inc +include $(APR_WORK)/build/NWGNUhead.inc # # build this level's files @@ -118,7 +118,7 @@ NLM_SCREEN_NAME = # # If this is specified, it will override VERSION value in -# $(APR_WORK)\build\NWGNUenvironment.inc +# $(APR_WORK)/build/NWGNUenvironment.inc # NLM_VERSION = @@ -245,10 +245,10 @@ nlms :: libs $(TARGET_nlm) # # Updated this target to create necessary directories and copy files to the -# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples) +# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples) # install :: nlms FORCE - $(CP) $(OBJDIR)\*.nlm $(INSTALLBASE) + $(call COPY,$(OBJDIR)/*.nlm,$(INSTALLBASE)/) # # Any specialized rules here @@ -259,5 +259,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)\build\NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc diff --git a/test/NWGNUmod_test b/test/NWGNUmod_test index 3d416fc8713..428d4f162cb 100644 --- a/test/NWGNUmod_test +++ b/test/NWGNUmod_test @@ -8,7 +8,7 @@ # ifndef EnvironmentDefined -include $(APR_WORK)\build\NWGNUhead.inc +include $(APR_WORK)/build/NWGNUhead.inc endif # @@ -111,7 +111,7 @@ NLM_SCREEN_NAME = DEFAULT # # If this is specified, it will override VERSION value in -# $(APR_WORK)\build\NWGNUenvironment.inc +# $(APR_WORK)/build/NWGNUenvironment.inc # NLM_VERSION = @@ -123,12 +123,12 @@ NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -138,7 +138,7 @@ NLM_CHECK_SYM = # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = # # If this is specified it will be linked in with the XDCData option in the def @@ -237,7 +237,7 @@ nlms :: libs $(TARGET_nlm) # # Updated this target to create necessary directories and copy files to the -# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples) +# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples) # install :: nlms FORCE @@ -250,5 +250,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)\build\NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc diff --git a/test/NWGNUproc_child b/test/NWGNUproc_child index 0efbc056357..8ba8954cc43 100644 --- a/test/NWGNUproc_child +++ b/test/NWGNUproc_child @@ -8,7 +8,7 @@ # ifndef EnvironmentDefined -include $(APR_WORK)\build\NWGNUhead.inc +include $(APR_WORK)/build/NWGNUhead.inc endif # @@ -111,7 +111,7 @@ NLM_SCREEN_NAME = DEFAULT # # If this is specified, it will override VERSION value in -# $(APR_WORK)\build\NWGNUenvironment.inc +# $(APR_WORK)/build/NWGNUenvironment.inc # NLM_VERSION = @@ -123,12 +123,12 @@ NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -235,7 +235,7 @@ nlms :: libs $(TARGET_nlm) # # Updated this target to create necessary directories and copy files to the -# correct place. (See $(APR_WORK)\build\NWGNUhead.inc for examples) +# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples) # install :: nlms FORCE @@ -248,5 +248,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)\build\NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc diff --git a/test/NWGNUreadchild b/test/NWGNUreadchild index 3c5e75f697b..4e37827bee2 100644 --- a/test/NWGNUreadchild +++ b/test/NWGNUreadchild @@ -123,12 +123,12 @@ NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -248,5 +248,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc diff --git a/test/NWGNUsockchild b/test/NWGNUsockchild index e1be847d05a..3caada6494c 100644 --- a/test/NWGNUsockchild +++ b/test/NWGNUsockchild @@ -123,12 +123,12 @@ NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -248,5 +248,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc diff --git a/test/NWGNUsockperf b/test/NWGNUsockperf index c2d5f7d8b15..8e9c548b760 100644 --- a/test/NWGNUsockperf +++ b/test/NWGNUsockperf @@ -123,12 +123,12 @@ NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -249,5 +249,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc diff --git a/test/NWGNUtestatmc b/test/NWGNUtestatmc index 6f017802da3..ea818cbe5cc 100644 --- a/test/NWGNUtestatmc +++ b/test/NWGNUtestatmc @@ -122,12 +122,12 @@ NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -137,7 +137,7 @@ NLM_CHECK_SYM = # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = # # If this is specified it will be linked in with the XDCData option in the def @@ -251,5 +251,5 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc diff --git a/test/NWGNUtryread b/test/NWGNUtryread index 7dbf1b800a8..9adf3a1bfcf 100644 --- a/test/NWGNUtryread +++ b/test/NWGNUtryread @@ -123,12 +123,12 @@ NLM_STACK_SIZE = # # If this is specified it will be used by the link '-entry' directive # -NLM_ENTRY_SYM = _LibCPrelude +NLM_ENTRY_SYM = # # If this is specified it will be used by the link '-exit' directive # -NLM_EXIT_SYM = _LibCPostlude +NLM_EXIT_SYM = # # If this is specified it will be used by the link '-check' directive @@ -248,5 +248,6 @@ install :: nlms FORCE # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc + diff --git a/xml/NWGNUmakefile b/xml/NWGNUmakefile index 182dd98415f..20c419dcf38 100644 --- a/xml/NWGNUmakefile +++ b/xml/NWGNUmakefile @@ -33,15 +33,15 @@ endif $(EXPATSRC)/lib/%.h: $(EXPATSRC)/lib/%.hnw @echo Creating $@ - $(call CP,$<,$@) + $(call COPY,$<,$@) $(EXPATSRC)/lib/%.h: $(EXPATSRC)/lib/%.h.in @echo Creating $@ - $(call CP,$<,$@) + $(call COPY,$<,$@) $(EXPATSRC)/lib/%.h: $(CURDIR)/%.hnw @echo Creating $@ - $(call CP,$<,$@) + $(call COPY,$<,$@) vpath %.c $(EXPATSRC)/lib @@ -286,5 +286,5 @@ clean :: # in this makefile # -include $(APR_WORK)/build/NWGNUtail.inc +include $(APRBUILD)/NWGNUtail.inc From aa5e9809db33d436074047781e35f3a998c4305a Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 6 Mar 2011 22:46:57 +0000 Subject: [PATCH 6873/7878] NetWare build overhaul in order to compile on Linux. Part 5. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078617 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 4 ++-- build/NWGNUhead.inc | 32 ++++++++++++++++---------------- build/NWGNUmakefile | 4 ++-- build/NWGNUtail.inc | 2 +- dbd/NWGNUdbdfreetds | 2 +- dbd/NWGNUdbdmysql | 2 +- dbd/NWGNUdbdpgsql | 2 +- dbd/NWGNUdbdsqli2 | 2 +- dbd/NWGNUdbdsqli3 | 2 +- dbm/NWGNUdbmdb | 2 +- dbm/NWGNUdbmgdbm | 2 +- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index e5c1bc754ad..6765c1af721 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -425,9 +425,9 @@ nlms :: libs $(TARGET_nlm) install :: nlms $(INSTDIRS) FORCE $(call COPY,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/) ifndef DEST - -$(call COPY,$(APR)/STATUS,$(INSTALLBASE)/*.apr) + -$(call COPY,$(APR)/STATUS,$(INSTALLBASE)/STATUS.apr) -$(call COPY,$(APR)/LICENSE,$(INSTALLBASE)/) - -$(call COPY,$(APR)/CHANGES,$(INSTALLBASE)/*.apr) + -$(call COPY,$(APR)/CHANGES,$(INSTALLBASE)/CHANGES.apr) @-$(call COPYR,$(APR)/docs,$(INSTALLBASE)/docs/) endif diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc index 28b148993fc..6b63c9c2020 100644 --- a/build/NWGNUhead.inc +++ b/build/NWGNUhead.inc @@ -39,24 +39,24 @@ $(TARGETS) :: $(SUBDIRS) endif #NO_LICENSE_FILE check help : - @echo targets for RELEASE=$(RELEASE): - @echo (default) . . . . libs nlms - @echo all . . . . . . . does everything (libs nlms install) - @echo libs. . . . . . . builds all libs - @echo nlms. . . . . . . builds all nlms - @echo install . . . . . builds libs and nlms and copies install files to - @echo "$(INSTALL)" - @echo installdev. . . . copies headers and files needed for development to - @echo "$(INSTALL)" - @echo clean . . . . . . deletes $(OBJDIR) dirs, *.err, and *.map - @echo clobber_all . . . deletes all possible output from the make - @echo clobber_install . deletes all files in $(INSTALL) + @echo $(DS)targets for RELEASE=$(RELEASE):$(DS) + @echo $(DS)(default) . . . . libs nlms$(DS) + @echo $(DS)all . . . . . . . does everything (libs nlms install)$(DS) + @echo $(DS)libs. . . . . . . builds all libs$(DS) + @echo $(DS)nlms. . . . . . . builds all nlms$(DS) + @echo $(DS)install . . . . . builds libs and nlms and copies install files to$(DS) + @echo $(DS) "$(INSTALL)"$(DS) + @echo $(DS)installdev. . . . copies headers and files needed for development to$(DS) + @echo $(DS) "$(INSTALL)"$(DS) + @echo $(DS)clean . . . . . . deletes $(OBJDIR) dirs, *.err, and *.map$(DS) + @echo $(DS)clobber_all . . . deletes all possible output from the make$(DS) + @echo $(DS)clobber_install . deletes all files in $(INSTALL)$(DS) @$(ECHONL) - @echo Multiple targets can be used on a single nmake command line - - @echo (i.e. $(MAKE) clean all) + @echo $(DS)Multiple targets can be used on a single make command line -$(DS) + @echo $(DS)(i.e. $(MAKE) clean all)$(DS) @$(ECHONL) - @echo You can also specify RELEASE=debug, RELEASE=noopt, or RELEASE=release - @echo The default is RELEASE=release + @echo $(DS)You can also specify RELEASE=debug, RELEASE=noopt, or RELEASE=release$(DS) + @echo $(DS)The default is RELEASE=release$(DS) clobber_all :: clean clobber_install diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index ab9fdbc3adf..7fabc9cc942 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -26,12 +26,12 @@ nlms :: $(APR)/aprlib.imp $(APR)/aprlib.imp : make_nw_export.awk nw_export.i # @echo Generating $@ - @echo GEN $@ + @echo $(DL)GEN $@$(DL) $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ | $(SORT) >$@ nw_export.i : nw_export.inc $(FILES_prebuild_headers) $(NLM_NAME)_cc.opt # @echo Generating $@ - @echo GEN $@ + @echo $(DL)GEN $@$(DL) $(CC) $< @$(NLM_NAME)_cc.opt $(NLM_NAME)_cc.opt : NWGNUmakefile $(APR)/build/NWGNUenvironment.inc $(APR)/build/NWGNUhead.inc $(APR)/build/NWGNUtail.inc $(CUSTOM_INI) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 44856162ae7..51b3e30a0b7 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -275,10 +275,10 @@ else @echo -sym internal >> $@ endif @echo -l $(APR)/$(OBJDIR) >> $@ - @echo -l $(APRBUCKETS)/$(OBJDIR) >> $@ @echo -l $(APRLDAP)/$(OBJDIR) >> $@ @echo -l $(APRXML)/$(OBJDIR) >> $@ @echo -l $(APR)/misc/netware >> $@ + @echo -l $(APR) >> $@ @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime"$(DL) >> $@ @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++"$(DL) >> $@ ifneq "$(IPV6)" "" diff --git a/dbd/NWGNUdbdfreetds b/dbd/NWGNUdbdfreetds index a79a2ffd5ac..bc631ee838f 100644 --- a/dbd/NWGNUdbdfreetds +++ b/dbd/NWGNUdbdfreetds @@ -238,7 +238,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \ @libc.imp \ $(EOLIST) diff --git a/dbd/NWGNUdbdmysql b/dbd/NWGNUdbdmysql index 10c4dbf155d..6f63946d7e2 100644 --- a/dbd/NWGNUdbdmysql +++ b/dbd/NWGNUdbdmysql @@ -242,7 +242,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \ @libc.imp \ $(EOLIST) diff --git a/dbd/NWGNUdbdpgsql b/dbd/NWGNUdbdpgsql index 9e04f5427f7..4862237c07a 100644 --- a/dbd/NWGNUdbdpgsql +++ b/dbd/NWGNUdbdpgsql @@ -239,7 +239,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \ @libc.imp \ $(EOLIST) diff --git a/dbd/NWGNUdbdsqli2 b/dbd/NWGNUdbdsqli2 index bd5778853cc..584f60ab57b 100644 --- a/dbd/NWGNUdbdsqli2 +++ b/dbd/NWGNUdbdsqli2 @@ -238,7 +238,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \ @libc.imp \ $(EOLIST) diff --git a/dbd/NWGNUdbdsqli3 b/dbd/NWGNUdbdsqli3 index 921a373b59d..d5468bce382 100644 --- a/dbd/NWGNUdbdsqli3 +++ b/dbd/NWGNUdbdsqli3 @@ -238,7 +238,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \ @libc.imp \ apr_dbd_mutex_lock \ apr_dbd_mutex_unlock \ diff --git a/dbm/NWGNUdbmdb b/dbm/NWGNUdbmdb index 03b099cd644..97834053543 100644 --- a/dbm/NWGNUdbmdb +++ b/dbm/NWGNUdbmdb @@ -241,7 +241,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \ @libc.imp \ $(EOLIST) diff --git a/dbm/NWGNUdbmgdbm b/dbm/NWGNUdbmgdbm index 10709a54b20..aeacc77305a 100644 --- a/dbm/NWGNUdbmgdbm +++ b/dbm/NWGNUdbmgdbm @@ -240,7 +240,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \ @libc.imp \ $(EOLIST) From 817d748fc5a1ddb089bcb0e6a62ec577b84261ea Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 6 Mar 2011 22:52:10 +0000 Subject: [PATCH 6874/7878] NetWare build overhaul in order to compile on Linux. Fixed typo. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078619 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUhead.inc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc index 6b63c9c2020..2095c56635c 100644 --- a/build/NWGNUhead.inc +++ b/build/NWGNUhead.inc @@ -39,24 +39,24 @@ $(TARGETS) :: $(SUBDIRS) endif #NO_LICENSE_FILE check help : - @echo $(DS)targets for RELEASE=$(RELEASE):$(DS) - @echo $(DS)(default) . . . . libs nlms$(DS) - @echo $(DS)all . . . . . . . does everything (libs nlms install)$(DS) - @echo $(DS)libs. . . . . . . builds all libs$(DS) - @echo $(DS)nlms. . . . . . . builds all nlms$(DS) - @echo $(DS)install . . . . . builds libs and nlms and copies install files to$(DS) - @echo $(DS) "$(INSTALL)"$(DS) - @echo $(DS)installdev. . . . copies headers and files needed for development to$(DS) - @echo $(DS) "$(INSTALL)"$(DS) - @echo $(DS)clean . . . . . . deletes $(OBJDIR) dirs, *.err, and *.map$(DS) - @echo $(DS)clobber_all . . . deletes all possible output from the make$(DS) - @echo $(DS)clobber_install . deletes all files in $(INSTALL)$(DS) + @echo $(DL)targets for RELEASE=$(RELEASE):$(DL) + @echo $(DL)(default) . . . . libs nlms$(DL) + @echo $(DL)all . . . . . . . does everything (libs nlms install)$(DL) + @echo $(DL)libs. . . . . . . builds all libs$(DL) + @echo $(DL)nlms. . . . . . . builds all nlms$(DL) + @echo $(DL)install . . . . . builds libs and nlms and copies install files to$(DL) + @echo $(DL) "$(INSTALL)"$(DL) + @echo $(DL)installdev. . . . copies headers and files needed for development to$(DL) + @echo $(DL) "$(INSTALL)"$(DL) + @echo $(DL)clean . . . . . . deletes $(OBJDIR) dirs, *.err, and *.map$(DL) + @echo $(DL)clobber_all . . . deletes all possible output from the make$(DL) + @echo $(DL)clobber_install . deletes all files in $(INSTALL)$(DL) @$(ECHONL) - @echo $(DS)Multiple targets can be used on a single make command line -$(DS) - @echo $(DS)(i.e. $(MAKE) clean all)$(DS) + @echo $(DL)Multiple targets can be used on a single make command line -$(DL) + @echo $(DL)(i.e. $(MAKE) clean all)$(DL) @$(ECHONL) - @echo $(DS)You can also specify RELEASE=debug, RELEASE=noopt, or RELEASE=release$(DS) - @echo $(DS)The default is RELEASE=release$(DS) + @echo $(DL)You can also specify RELEASE=debug, RELEASE=noopt, or RELEASE=release$(DL) + @echo $(DL)The default is RELEASE=release$(DL) clobber_all :: clean clobber_install From 9a681d856d332da20d6244780b58329af2206be6 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 6 Mar 2011 23:36:14 +0000 Subject: [PATCH 6875/7878] NetWare build overhaul in order to compile on Linux. Fix for crappy linker which cant deal with absolute unix paths for import files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078631 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/NWGNUdbdfreetds | 4 +--- dbd/NWGNUdbdmysql | 4 +--- dbd/NWGNUdbdpgsql | 6 +++++- dbd/NWGNUdbdsqli2 | 4 +--- dbd/NWGNUdbdsqli3 | 4 +--- dbm/NWGNUdbmdb | 6 +++++- dbm/NWGNUdbmgdbm | 6 +++++- 7 files changed, 19 insertions(+), 15 deletions(-) diff --git a/dbd/NWGNUdbdfreetds b/dbd/NWGNUdbdfreetds index bc631ee838f..393e380c5b9 100644 --- a/dbd/NWGNUdbdfreetds +++ b/dbd/NWGNUdbdfreetds @@ -60,11 +60,9 @@ XDEFINES += \ XLFLAGS += \ $(EOLIST) -ifdef LINK_STATIC XLFLAGS += \ -l $(FREETDSSDK)/lib \ $(EOLIST) -endif # # These values will be appended to the correct variables based on the value of @@ -244,7 +242,7 @@ FILES_nlm_Ximports = \ ifneq ($(LINK_STATIC),1) FILES_nlm_Ximports += \ - @$(FREETDS_IMP) \ + @$(notdir $(FREETDS_IMP)) \ $(EOLIST) endif diff --git a/dbd/NWGNUdbdmysql b/dbd/NWGNUdbdmysql index 6f63946d7e2..72bb414e25c 100644 --- a/dbd/NWGNUdbdmysql +++ b/dbd/NWGNUdbdmysql @@ -64,11 +64,9 @@ XDEFINES += \ XLFLAGS += \ $(EOLIST) -ifdef LINK_STATIC XLFLAGS += \ -l $(MYSQLSDK)/lib \ $(EOLIST) -endif # # These values will be appended to the correct variables based on the value of @@ -248,7 +246,7 @@ FILES_nlm_Ximports = \ ifneq ($(LINK_STATIC),1) FILES_nlm_Ximports += \ - @$(MYSQL_IMP) \ + @$(notdir $(MYSQL_IMP)) \ $(EOLIST) endif diff --git a/dbd/NWGNUdbdpgsql b/dbd/NWGNUdbdpgsql index 4862237c07a..f6848fa9660 100644 --- a/dbd/NWGNUdbdpgsql +++ b/dbd/NWGNUdbdpgsql @@ -65,6 +65,10 @@ ifdef LINK_STATIC XLFLAGS += \ -l $(PGSQLSDK)/lib \ $(EOLIST) +else +XLFLAGS += \ + -l $(PGSQLSDK)/imp \ + $(EOLIST) endif # @@ -245,7 +249,7 @@ FILES_nlm_Ximports = \ ifneq ($(LINK_STATIC),1) FILES_nlm_Ximports += \ - @$(PGSQL_IMP) \ + @$(notdir $(PGSQL_IMP)) \ $(EOLIST) endif diff --git a/dbd/NWGNUdbdsqli2 b/dbd/NWGNUdbdsqli2 index 584f60ab57b..c1f9cd1faf8 100644 --- a/dbd/NWGNUdbdsqli2 +++ b/dbd/NWGNUdbdsqli2 @@ -60,11 +60,9 @@ XDEFINES += \ XLFLAGS += \ $(EOLIST) -ifdef LINK_STATIC XLFLAGS += \ -l $(SQLITE2SDK) \ $(EOLIST) -endif # # These values will be appended to the correct variables based on the value of @@ -244,7 +242,7 @@ FILES_nlm_Ximports = \ ifneq ($(LINK_STATIC),1) FILES_nlm_Ximports += \ - @$(SQLITE2_IMP) \ + @$(notdir $(SQLITE2_IMP)) \ $(EOLIST) endif diff --git a/dbd/NWGNUdbdsqli3 b/dbd/NWGNUdbdsqli3 index d5468bce382..ed52a248610 100644 --- a/dbd/NWGNUdbdsqli3 +++ b/dbd/NWGNUdbdsqli3 @@ -60,11 +60,9 @@ XDEFINES += \ XLFLAGS += \ $(EOLIST) -ifdef LINK_STATIC XLFLAGS += \ -l $(SQLITE3SDK) \ $(EOLIST) -endif # # These values will be appended to the correct variables based on the value of @@ -246,7 +244,7 @@ FILES_nlm_Ximports = \ ifneq ($(LINK_STATIC),1) FILES_nlm_Ximports += \ - @$(SQLITE3_IMP) \ + @$(notdir $(SQLITE3_IMP)) \ $(EOLIST) endif diff --git a/dbm/NWGNUdbmdb b/dbm/NWGNUdbmdb index 97834053543..06615403f4a 100644 --- a/dbm/NWGNUdbmdb +++ b/dbm/NWGNUdbmdb @@ -67,6 +67,10 @@ ifdef LINK_STATIC XLFLAGS += \ -l $(DBSDK)/lib \ $(EOLIST) +else +XLFLAGS += \ + -l $(DBSDK)/imp \ + $(EOLIST) endif # @@ -247,7 +251,7 @@ FILES_nlm_Ximports = \ ifneq ($(LINK_STATIC),1) FILES_nlm_Ximports += \ - @$(DB_IMP) \ + @$(notdir $(DB_IMP)) \ $(EOLIST) endif diff --git a/dbm/NWGNUdbmgdbm b/dbm/NWGNUdbmgdbm index aeacc77305a..25c071d8a4b 100644 --- a/dbm/NWGNUdbmgdbm +++ b/dbm/NWGNUdbmgdbm @@ -66,6 +66,10 @@ ifdef LINK_STATIC XLFLAGS += \ -l $(GDBMSDK)/lib \ $(EOLIST) +else +XLFLAGS += \ + -l $(GDBMSDK)/imp \ + $(EOLIST) endif # @@ -246,7 +250,7 @@ FILES_nlm_Ximports = \ ifneq ($(LINK_STATIC),1) FILES_nlm_Ximports += \ - @$(GDBM_IMP) \ + @$(notdir $(GDBM_IMP)) \ $(EOLIST) endif From 4a450ae39d0d774d730ca0b48684d8948cba5525 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 7 Mar 2011 03:03:46 +0000 Subject: [PATCH 6876/7878] Fixed compilation when APR_HAVE_STRUCT_RLIMIT=0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078655 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 20 +++++++++++++++++--- threadproc/unix/proc.c | 4 +++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index c5e341b8f56..5ea9fe06019 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -448,8 +448,10 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, return errno; } -APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, - struct rlimit *limit) +#if APR_HAVE_STRUCT_RLIMIT +APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, + apr_int32_t what, + struct rlimit *limit) { switch(what) { case APR_LIMIT_CPU: @@ -459,13 +461,15 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32 #else return APR_ENOTIMPL; #endif + case APR_LIMIT_MEM: -#if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS) +#if defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS) attr->limit_mem = limit; break; #else return APR_ENOTIMPL; #endif + case APR_LIMIT_NPROC: #ifdef RLIMIT_NPROC attr->limit_nproc = limit; @@ -473,9 +477,19 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32 #else return APR_ENOTIMPL; #endif + + case APR_LIMIT_NOFILE: +#ifdef RLIMIT_NOFILE + attr->limit_nofile = limit; + break; +#else + return APR_ENOTIMPL; +#endif + } return APR_SUCCESS; } +#endif /* APR_HAVE_STRUCT_RLIMIT */ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, const char *username, diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 8deb6de2fcc..593eb5ad1eb 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -678,6 +678,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, return errno; } +#if APR_HAVE_STRUCT_RLIMIT APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, struct rlimit *limit) @@ -692,7 +693,7 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, #endif case APR_LIMIT_MEM: -#if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS) +#if defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS) attr->limit_mem = limit; break; #else @@ -719,6 +720,7 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, return APR_SUCCESS; } +#endif /* APR_HAVE_STRUCT_RLIMIT */ APR_DECLARE(apr_status_t) apr_procattr_perms_set_register(apr_procattr_t *attr, apr_perms_setfn_t *perms_set_fn, From ca6350d2256745f813eed8db9a44b8602585e9f4 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 7 Mar 2011 03:14:29 +0000 Subject: [PATCH 6877/7878] Fixed NetWare prototype warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078658 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 2 +- threadproc/netware/signals.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 5ea9fe06019..f5d24b21b5b 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -26,7 +26,7 @@ */ static apr_file_t no_file = { NULL, -1, }; -apr_status_t apr_netware_proc_cleanup(void *theproc) +static apr_status_t apr_netware_proc_cleanup(void *theproc) { apr_proc_t *proc = theproc; int exit_int; diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c index bc660af7dc9..c744da5c512 100644 --- a/threadproc/netware/signals.c +++ b/threadproc/netware/signals.c @@ -15,7 +15,6 @@ */ #include "apr_arch_threadproc.h" -#include #include "apr_private.h" #include "apr_pools.h" #include "apr_signal.h" @@ -64,12 +63,12 @@ static void *signal_thread_func(void *signal_handler) return NULL; } +#if (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) { - int rv = 0; - - return rv; + return 0; } +#endif /* (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) */ APR_DECLARE(apr_status_t) apr_signal_block(int signum) { From d71ce2d10552b01cd34a3b0806c8433990378d73 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 7 Mar 2011 10:44:41 +0000 Subject: [PATCH 6878/7878] fix some existing parameter range checking that had a bad assumption about the size of array entries add the same range check in another path git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078737 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_odbc.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index cd0c546beba..67cbc902680 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -202,7 +202,7 @@ typedef struct { /* SQL datatype mappings to DBD datatypes * These tables must correspond *exactly* to the apr_dbd_type_e enum - * in apr_dbd_internal.h + * in apr_dbd.h */ /* ODBC "C" types to DBD datatypes */ @@ -231,6 +231,7 @@ static SQLSMALLINT const sqlCtype[] = { SQL_LONGVARCHAR, /* APR_DBD_TYPE_CLOB, \%pDc */ SQL_TYPE_NULL /* APR_DBD_TYPE_NULL \%pDn */ }; +#define NUM_APR_DBD_TYPES (sizeof(sqlCtype) / sizeof(sqlCtype[0])) /* ODBC Base types to DBD datatypes */ static SQLSMALLINT const sqlBaseType[] = { @@ -528,6 +529,10 @@ static SQLRETURN odbc_bind_param(apr_pool_t *pool, } /* bind a non-NULL data value */ else { + if (type < 0 || type >= NUM_APR_DBD_TYPES) { + return APR_EGENERAL; + } + baseType = sqlBaseType[type]; cType = sqlCtype[type]; indicator = NULL; @@ -1338,15 +1343,17 @@ static apr_status_t odbc_datum_get(const apr_dbd_row_t *row, int col, { SQLSMALLINT sqltype; void *p; - int len = sqlSizes[dbdtype]; + int len; if (col >= row->res->ncols) return APR_EGENERAL; - if (dbdtype < 0 || dbdtype >= sizeof(sqlCtype)) { + if (dbdtype < 0 || dbdtype >= NUM_APR_DBD_TYPES) { data = NULL; /* invalid type */ return APR_EGENERAL; } + + len = sqlSizes[dbdtype]; sqltype = sqlCtype[dbdtype]; /* must not memcpy a brigade, sentinals are relative to orig loc */ From e64e4dc03b0bd1bea9446cb6dca5681c49a35ff4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 7 Mar 2011 11:19:29 +0000 Subject: [PATCH 6879/7878] replace some strcpy() calls with apr_cpystrn() (no overflow currently) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078744 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_odbc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index 67cbc902680..f7769fcb8f1 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -914,10 +914,12 @@ static void check_error(apr_dbd_t *dbc, const char *step, SQLRETURN rc, /* set info about last error in dbc - fast return for SQL_SUCCESS */ if (rc == SQL_SUCCESS) { char successMsg[] = "[dbd_odbc] SQL_SUCCESS "; + apr_size_t successMsgLen = sizeof successMsg - 1; dbc->lasterrorcode = SQL_SUCCESS; - strcpy(dbc->lastError, successMsg); - strcpy(dbc->lastError + sizeof(successMsg) - 1, step); + apr_cpystrn(dbc->lastError, successMsg, sizeof dbc->lastError); + apr_cpystrn(dbc->lastError + successMsgLen, step, + sizeof dbc->lastError - successMsgLen); return; } switch (rc) { @@ -974,7 +976,8 @@ static APR_INLINE int odbc_check_rollback(apr_dbd_t *handle) { if (handle->can_commit == APR_DBD_TRANSACTION_ROLLBACK) { handle->lasterrorcode = SQL_ERROR; - strcpy(handle->lastError, "[dbd_odbc] Rollback pending "); + apr_cpystrn(handle->lastError, "[dbd_odbc] Rollback pending ", + sizeof handle->lastError); return 1; } return 0; From a982605cb1b32352d072dab71e0d18c7d554e302 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 7 Mar 2011 16:39:14 +0000 Subject: [PATCH 6880/7878] Fix definition of apr_ino_t to be independent of _FILE_OFFSET_BITS even if ino_t is 'unsigned int' (this case was not caught by APR_CHECK_TYPES_COMPATIBLE(... unsigned long...) ). Also don't limit the special handling to 32bit platforms, as there are platforms (e.g. kfreebsd-gnu-amd64) where _FILE_OFFSET_BITS influences ino_t even on 64bit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078845 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 55fd922fd8f..b185f2b027b 100644 --- a/configure.in +++ b/configure.in @@ -1713,21 +1713,25 @@ else fi AC_MSG_RESULT($off_t_value) -# Regardless of whether _LARGEFILE64_SOURCE is used, on 32-bit +# Regardless of whether _LARGEFILE64_SOURCE is used, on some # platforms _FILE_OFFSET_BITS will affect the size of ino_t and hence # the build-time ABI may be different from the apparent ABI when using # APR with another package which *does* define _FILE_OFFSET_BITS. # (Exactly as per the case above with off_t where LFS is *not* used) # -# To be safe, hard-code apr_ino_t as 'unsigned long' iff that is -# exactly the size of ino_t here; otherwise use ino_t as existing +# To be safe, hard-code apr_ino_t as 'unsigned long' or 'unsigned int' +# iff that is exactly the size of ino_t here; otherwise use ino_t as existing # releases did. To be correct, apr_ino_t should have been made an # ino64_t as apr_off_t is off64_t, but this can't be done now without # breaking ABI. ino_t_value=ino_t -if test "$ac_cv_sizeof_long" = "4"; then - APR_CHECK_TYPES_COMPATIBLE(ino_t, unsigned long, - ino_t_value="unsigned long") +APR_CHECK_SIZEOF_EXTENDED(AC_INCLUDES_DEFAULT, ino_t, $ac_cv_sizeof_long) +if test $ac_cv_sizeof_ino_t = 4; then + if test $ac_cv_sizeof_long = 4; then + ino_t_value="unsigned long" + else + ino_t_value="unsigned int" + fi fi AC_MSG_NOTICE([using $ino_t_value for ino_t]) From 8ee45bd18b2b7034871010f36ef239f41f3d6740 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 7 Mar 2011 21:42:06 +0000 Subject: [PATCH 6881/7878] Added dbm stuff to NetWare build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078963 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index 6765c1af721..2f3c4b3ebaf 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -14,6 +14,12 @@ SUBDIRS += \ $(EOLIST) endif +ifdef WITH_APR_DBM +SUBDIRS += \ + dbm \ + $(EOLIST) +endif + # # Get the 'head' of the build environment. This includes default targets and # paths to tools From 2b951f73cf0d86e5f38057b53127fa7a51ce3ff4 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 7 Mar 2011 22:12:37 +0000 Subject: [PATCH 6882/7878] Fixed include paths in NetWare dbm makefiles. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078977 13f79535-47bb-0310-9956-ffa450edef68 --- dbm/NWGNUdbmdb | 3 +-- dbm/NWGNUdbmgdbm | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dbm/NWGNUdbmdb b/dbm/NWGNUdbmdb index 06615403f4a..fdce7b4f063 100644 --- a/dbm/NWGNUdbmdb +++ b/dbm/NWGNUdbmdb @@ -36,8 +36,7 @@ DB_NLM = libdb47 XINCDIRS += \ $(APR)/include/arch/netware \ $(APR)/include \ - $(APRUTIL)/include \ - $(APRUTIL)/include/private \ + $(APR)/include/private \ $(APR) \ $(DB_INC) \ $(EOLIST) diff --git a/dbm/NWGNUdbmgdbm b/dbm/NWGNUdbmgdbm index 25c071d8a4b..3ab1c815ccc 100644 --- a/dbm/NWGNUdbmgdbm +++ b/dbm/NWGNUdbmgdbm @@ -36,8 +36,7 @@ GDBM_NLM = libgdbm XINCDIRS += \ $(APR)/include/arch/netware \ $(APR)/include \ - $(APRUTIL)/include \ - $(APRUTIL)/include/private \ + $(APR)/include/private \ $(APR) \ $(GDBM_INC) \ $(EOLIST) From a028cc56110f5ee824da1db14f0cacc8d7dee6b8 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Tue, 8 Mar 2011 22:01:29 +0000 Subject: [PATCH 6883/7878] Add a test that checks that various apr types don't change their size if an apr consumer specifies -D_FILE_OFFSET_BITS=64 or 32. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1079562 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 3 +- test/abts_tests.h | 3 +- test/testlfsabi.c | 60 +++++++++++++++++++++++++++++++++++++++ test/testlfsabi.h | 28 ++++++++++++++++++ test/testlfsabi32.c | 29 +++++++++++++++++++ test/testlfsabi64.c | 29 +++++++++++++++++++ test/testlfsabi_include.c | 21 ++++++++++++++ test/testutil.h | 1 + 8 files changed, 172 insertions(+), 2 deletions(-) create mode 100644 test/testlfsabi.c create mode 100644 test/testlfsabi.h create mode 100644 test/testlfsabi32.c create mode 100644 test/testlfsabi64.c create mode 100644 test/testlfsabi_include.c diff --git a/test/Makefile.in b/test/Makefile.in index c6d67c91506..ca1e53bd3fe 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -34,7 +34,8 @@ TESTS = testtime.lo teststr.lo testvsn.lo testipsub.lo testshm.lo \ testxlate.lo testdbd.lo testrmm.lo testldap.lo testmd4.lo \ teststrmatch.lo testpass.lo testcrypto.lo testqueue.lo \ testbuckets.lo testxml.lo testdbm.lo testuuid.lo testmd5.lo \ - testreslist.lo testbase64.lo testhooks.lo + testreslist.lo testbase64.lo testhooks.lo testlfsabi.lo \ + testlfsabi32.lo testlfsabi64.lo OTHER_PROGRAMS = \ sendfile@EXEEXT@ \ diff --git a/test/abts_tests.h b/test/abts_tests.h index 1916fc175df..01234354ae7 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -86,7 +86,8 @@ const struct testlist { {testrmm}, {testdbm}, {testqueue}, - {testreslist} + {testreslist}, + {testlfsabi} }; #endif /* APR_TEST_INCLUDES */ diff --git a/test/testlfsabi.c b/test/testlfsabi.c new file mode 100644 index 00000000000..6fa39bdace1 --- /dev/null +++ b/test/testlfsabi.c @@ -0,0 +1,60 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "testutil.h" +#include "testlfsabi.h" +#include "apr_file_info.h" + +/* + * Check that various types don't change size depending on + * -D_FILE_OFFSET_BITS=64 + */ + +extern void get_type_sizes32(int *res); +extern void get_type_sizes64(int *res); + +void get_type_sizes(int *res) +{ +#include "testlfsabi_include.c" +} + +static void check_type_sizes(abts_case *tc, void *data) +{ + int normal[IDX_MAX], bits32[IDX_MAX], bits64[IDX_MAX]; + get_type_sizes(normal); + get_type_sizes32(bits32); + get_type_sizes64(bits64); + CHECKSIZE(tc, normal, bits32, apr_dev_t); + CHECKSIZE(tc, normal, bits64, apr_dev_t); + CHECKSIZE(tc, normal, bits32, apr_ino_t); + CHECKSIZE(tc, normal, bits64, apr_ino_t); + CHECKSIZE(tc, normal, bits32, apr_off_t); + CHECKSIZE(tc, normal, bits64, apr_off_t); + CHECKSIZE(tc, normal, bits32, apr_socklen_t); + CHECKSIZE(tc, normal, bits64, apr_socklen_t); + CHECKSIZE(tc, normal, bits32, apr_size_t); + CHECKSIZE(tc, normal, bits64, apr_size_t); +} + +abts_suite *testlfsabi(abts_suite *suite) +{ + suite = ADD_SUITE(suite) + + abts_run_test(suite, check_type_sizes, NULL); + + return suite; +} + diff --git a/test/testlfsabi.h b/test/testlfsabi.h new file mode 100644 index 00000000000..e7c532cc39b --- /dev/null +++ b/test/testlfsabi.h @@ -0,0 +1,28 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "abts.h" + +#define IDX_apr_dev_t 0 +#define IDX_apr_ino_t 1 +#define IDX_apr_off_t 2 +#define IDX_apr_socklen_t 3 +#define IDX_apr_size_t 4 +#define IDX_MAX 5 + +#define GETSIZE(res, type) res[(IDX_##type)] = sizeof(type) +#define CHECKSIZE(tc, res1, res2, type) \ + ABTS_INT_EQUAL(tc, res1[(IDX_##type)], res2[(IDX_##type)]); diff --git a/test/testlfsabi32.c b/test/testlfsabi32.c new file mode 100644 index 00000000000..c65bffda259 --- /dev/null +++ b/test/testlfsabi32.c @@ -0,0 +1,29 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifdef _FILE_OFFSET_BITS +#undef _FILE_OFFSET_BITS +#endif + +#define _FILE_OFFSET_BITS 32 + +#include "testlfsabi.h" +#include "apr_file_info.h" + +void get_type_sizes32(int *res) +{ +#include "testlfsabi_include.c" +} diff --git a/test/testlfsabi64.c b/test/testlfsabi64.c new file mode 100644 index 00000000000..ce66c5cf8a8 --- /dev/null +++ b/test/testlfsabi64.c @@ -0,0 +1,29 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifdef _FILE_OFFSET_BITS +#undef _FILE_OFFSET_BITS +#endif + +#define _FILE_OFFSET_BITS 64 + +#include "testlfsabi.h" +#include "apr_file_info.h" + +void get_type_sizes64(int *res) +{ +#include "testlfsabi_include.c" +} diff --git a/test/testlfsabi_include.c b/test/testlfsabi_include.c new file mode 100644 index 00000000000..c634d83a917 --- /dev/null +++ b/test/testlfsabi_include.c @@ -0,0 +1,21 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + GETSIZE(res, apr_dev_t); + GETSIZE(res, apr_ino_t); + GETSIZE(res, apr_off_t); + GETSIZE(res, apr_socklen_t); + GETSIZE(res, apr_size_t); diff --git a/test/testutil.h b/test/testutil.h index 2bbf9b9e971..3d28401b967 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -123,5 +123,6 @@ abts_suite *testxml(abts_suite *suite); abts_suite *testxlate(abts_suite *suite); abts_suite *testrmm(abts_suite *suite); abts_suite *testdbm(abts_suite *suite); +abts_suite *testlfsabi(abts_suite *suite); #endif /* APR_TEST_INCLUDES */ From 19e8ad5b0b3983d100937b60ba62a774b33eb66a Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 9 Mar 2011 00:18:23 +0000 Subject: [PATCH 6884/7878] NetWare build overhaul in order to compile on Linux. Some more fixes ... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1079613 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_nw_export.awk | 2 +- test/NWGNUaprtest | 2 +- test/NWGNUechod | 2 +- test/NWGNUglobalmutexchild | 2 +- test/NWGNUmod_test | 2 +- test/NWGNUproc_child | 2 +- test/NWGNUreadchild | 2 +- test/NWGNUsockchild | 2 +- test/NWGNUsockperf | 2 +- test/NWGNUtestatmc | 2 +- test/NWGNUtryread | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index a6786fd92c8..e1c2021cece 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -74,7 +74,7 @@ BEGIN { # next #} -/^[ \t]*AP[RUI]?_DECLARE_DATA .*;$/ { +/^[ \t]*AP[RUI]?_DECLARE_DATA .*;/ { varname = $NF; gsub( /[*;]/, "", varname); gsub( /\[.*\]/, "", varname); diff --git a/test/NWGNUaprtest b/test/NWGNUaprtest index d42a2016ede..c106a51a324 100644 --- a/test/NWGNUaprtest +++ b/test/NWGNUaprtest @@ -275,7 +275,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \) @libc.imp \ $(EOLIST) diff --git a/test/NWGNUechod b/test/NWGNUechod index d1d1100e6c6..fab6154a6bb 100644 --- a/test/NWGNUechod +++ b/test/NWGNUechod @@ -209,7 +209,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \) @libc.imp \ $(EOLIST) diff --git a/test/NWGNUglobalmutexchild b/test/NWGNUglobalmutexchild index 3db805b0241..be8434d70fe 100644 --- a/test/NWGNUglobalmutexchild +++ b/test/NWGNUglobalmutexchild @@ -210,7 +210,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \) @libc.imp \ $(EOLIST) diff --git a/test/NWGNUmod_test b/test/NWGNUmod_test index 428d4f162cb..eba9be9a85b 100644 --- a/test/NWGNUmod_test +++ b/test/NWGNUmod_test @@ -208,7 +208,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \) @libc.imp \ $(EOLIST) diff --git a/test/NWGNUproc_child b/test/NWGNUproc_child index 8ba8954cc43..0b92b582ee7 100644 --- a/test/NWGNUproc_child +++ b/test/NWGNUproc_child @@ -208,7 +208,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \) @libc.imp \ $(EOLIST) diff --git a/test/NWGNUreadchild b/test/NWGNUreadchild index 4e37827bee2..54fc6841243 100644 --- a/test/NWGNUreadchild +++ b/test/NWGNUreadchild @@ -208,7 +208,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \) @libc.imp \ $(EOLIST) diff --git a/test/NWGNUsockchild b/test/NWGNUsockchild index 3caada6494c..c7637a4dc5c 100644 --- a/test/NWGNUsockchild +++ b/test/NWGNUsockchild @@ -208,7 +208,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \) @libc.imp \ $(EOLIST) diff --git a/test/NWGNUsockperf b/test/NWGNUsockperf index 8e9c548b760..ba3ca0a1603 100644 --- a/test/NWGNUsockperf +++ b/test/NWGNUsockperf @@ -209,7 +209,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \) @libc.imp \ $(EOLIST) diff --git a/test/NWGNUtestatmc b/test/NWGNUtestatmc index ea818cbe5cc..e796724ddbc 100644 --- a/test/NWGNUtestatmc +++ b/test/NWGNUtestatmc @@ -210,7 +210,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \) @libc.imp \ $(EOLIST) diff --git a/test/NWGNUtryread b/test/NWGNUtryread index 9adf3a1bfcf..063865c25e2 100644 --- a/test/NWGNUtryread +++ b/test/NWGNUtryread @@ -208,7 +208,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @$(APR)/aprlib.imp \ + @aprlib.imp \) @libc.imp \ $(EOLIST) From c6d0c2e55d901789600e27b95f78b8554496a674 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 9 Mar 2011 00:46:02 +0000 Subject: [PATCH 6885/7878] NetWare build overhaul in order to compile on Linux. Some more fixes ... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1079621 13f79535-47bb-0310-9956-ffa450edef68 --- test/NWGNUaprtest | 2 +- test/NWGNUechod | 2 +- test/NWGNUglobalmutexchild | 2 +- test/NWGNUmod_test | 2 +- test/NWGNUproc_child | 2 +- test/NWGNUreadchild | 2 +- test/NWGNUsockchild | 2 +- test/NWGNUsockperf | 2 +- test/NWGNUtestatmc | 2 +- test/NWGNUtryread | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/NWGNUaprtest b/test/NWGNUaprtest index c106a51a324..f55fc0462b9 100644 --- a/test/NWGNUaprtest +++ b/test/NWGNUaprtest @@ -275,7 +275,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \) + @aprlib.imp \ @libc.imp \ $(EOLIST) diff --git a/test/NWGNUechod b/test/NWGNUechod index fab6154a6bb..3984d771218 100644 --- a/test/NWGNUechod +++ b/test/NWGNUechod @@ -209,7 +209,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \) + @aprlib.imp \ @libc.imp \ $(EOLIST) diff --git a/test/NWGNUglobalmutexchild b/test/NWGNUglobalmutexchild index be8434d70fe..8fbb187bc12 100644 --- a/test/NWGNUglobalmutexchild +++ b/test/NWGNUglobalmutexchild @@ -210,7 +210,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \) + @aprlib.imp \ @libc.imp \ $(EOLIST) diff --git a/test/NWGNUmod_test b/test/NWGNUmod_test index eba9be9a85b..102781b762f 100644 --- a/test/NWGNUmod_test +++ b/test/NWGNUmod_test @@ -208,7 +208,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \) + @aprlib.imp \ @libc.imp \ $(EOLIST) diff --git a/test/NWGNUproc_child b/test/NWGNUproc_child index 0b92b582ee7..fd7aa47f7e2 100644 --- a/test/NWGNUproc_child +++ b/test/NWGNUproc_child @@ -208,7 +208,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \) + @aprlib.imp \ @libc.imp \ $(EOLIST) diff --git a/test/NWGNUreadchild b/test/NWGNUreadchild index 54fc6841243..3ec701270f0 100644 --- a/test/NWGNUreadchild +++ b/test/NWGNUreadchild @@ -208,7 +208,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \) + @aprlib.imp \ @libc.imp \ $(EOLIST) diff --git a/test/NWGNUsockchild b/test/NWGNUsockchild index c7637a4dc5c..319eefa8eed 100644 --- a/test/NWGNUsockchild +++ b/test/NWGNUsockchild @@ -208,7 +208,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \) + @aprlib.imp \ @libc.imp \ $(EOLIST) diff --git a/test/NWGNUsockperf b/test/NWGNUsockperf index ba3ca0a1603..d846d984518 100644 --- a/test/NWGNUsockperf +++ b/test/NWGNUsockperf @@ -209,7 +209,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \) + @aprlib.imp \ @libc.imp \ $(EOLIST) diff --git a/test/NWGNUtestatmc b/test/NWGNUtestatmc index e796724ddbc..f851ef781c4 100644 --- a/test/NWGNUtestatmc +++ b/test/NWGNUtestatmc @@ -210,7 +210,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \) + @aprlib.imp \ @libc.imp \ $(EOLIST) diff --git a/test/NWGNUtryread b/test/NWGNUtryread index 063865c25e2..92b2a6e3ecd 100644 --- a/test/NWGNUtryread +++ b/test/NWGNUtryread @@ -208,7 +208,7 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \) + @aprlib.imp \ @libc.imp \ $(EOLIST) From 162a02a9525b1cae9a8aabf31d73cf47e9b3eae9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 9 Mar 2011 16:29:45 +0000 Subject: [PATCH 6886/7878] zap the never-used apr_env_get() retcode git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1079872 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_odbc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index f7769fcb8f1..410886f9fab 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -909,7 +909,6 @@ static void check_error(apr_dbd_t *dbc, const char *step, SQLRETURN rc, SQLSMALLINT reslength; char *res, *p, *end, *logval = NULL; int i; - apr_status_t r; /* set info about last error in dbc - fast return for SQL_SUCCESS */ if (rc == SQL_SUCCESS) { @@ -960,7 +959,7 @@ static void check_error(apr_dbd_t *dbc, const char *step, SQLRETURN rc, if (SQL_SUCCEEDED(rc) && (p < (end - 280))) p += sprintf(p, "%.256s %.20s ", buffer, sqlstate); } - r = apr_env_get(&logval, "apr_dbd_odbc_log", dbc->pool); + apr_env_get(&logval, "apr_dbd_odbc_log", dbc->pool); /* if env var was set or call was init/open (no dbname) - log to stderr */ if (logval || !dbc->dbname ) { char timestamp[APR_CTIME_LEN]; From deee14c1330787c77b5f7288c80d4b5a1b911d89 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 9 Mar 2011 17:26:11 +0000 Subject: [PATCH 6887/7878] apr_dbd odbc: Fix stack buffer overwrite when an unexpected number of parameters is passed to open. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1079901 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_odbc.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index 410886f9fab..0b9943c7675 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -819,7 +819,7 @@ static apr_status_t odbc_parse_params(apr_pool_t *pool, const char *params, int *defaultBufferSize, int *nattrs, int **attrs, int **attrvals) { - char *seps, *last, *name[MAX_PARAMS], *val[MAX_PARAMS]; + char *seps, *last, *next, *name[MAX_PARAMS], *val[MAX_PARAMS]; int nparams = 0, i, j; *attrs = apr_pcalloc(pool, MAX_PARAMS * sizeof(char *)); @@ -839,8 +839,18 @@ static apr_status_t odbc_parse_params(apr_pool_t *pool, const char *params, } val[nparams] = apr_strtok(NULL, seps, &last); seps = DEFAULTSEPS; - name[++nparams] = apr_strtok(NULL, seps, &last); - } while (nparams <= MAX_PARAMS && name[nparams] != NULL); + + ++nparams; + next = apr_strtok(NULL, seps, &last); + if (!next) { + break; + } + if (nparams >= MAX_PARAMS) { + /* too many parameters, no place to store */ + return APR_EGENERAL; + } + name[nparams] = next; + } while (1); for (j = i = 0; i < nparams; i++) { if (!apr_strnatcasecmp(name[i], "CONNECT")) { From e356241775abd9d1c7487828a76ee2ade1b563ff Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Thu, 10 Mar 2011 16:42:22 +0000 Subject: [PATCH 6888/7878] Fixed NetWare apr.h defines and formatting. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1080271 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index 4088aae7b8d..b9833ab854e 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -74,7 +74,7 @@ extern "C" { */ #define APR_INLINE -#define APR_HAS_INLINE 0 +#define APR_HAS_INLINE 0 #ifndef __attribute__ #define __attribute__(__x) #endif @@ -111,7 +111,6 @@ extern "C" { #define APR_HAVE_STRTOLL 1 #define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 -#define APR_HAVE_SYS_TIME_H 1 #ifdef USE_WINSOCK #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SOCKIO_H 0 @@ -122,6 +121,7 @@ extern "C" { #define APR_HAVE_SYS_UN_H 1 #endif #define APR_HAVE_SYS_SIGNAL_H 1 +#define APR_HAVE_SYS_TIME_H 1 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 1 #define APR_HAVE_SYS_WAIT_H 1 @@ -334,7 +334,7 @@ typedef apr_uint32_t apr_uintptr_t; #define APR_SIZE_MAX (~((apr_size_t)0)) /* PROC mutex is a GLOBAL mutex on Netware */ -#define APR_PROC_MUTEX_IS_GLOBAL 1 +#define APR_PROC_MUTEX_IS_GLOBAL 1 /* Definitions that APR programs need to work properly. */ @@ -408,7 +408,7 @@ typedef apr_uint32_t apr_uintptr_t; /** * Declare a dso module's exported module structure as APR_MODULE_DECLARE_DATA. * - * Unless APR_MODULE_DECLARE_STATIC is defined at compile time, symbols + * Unless APR_MODULE_DECLARE_STATIC is defined at compile time, symbols * declared with APR_MODULE_DECLARE_DATA are always exported. * @code * module APR_MODULE_DECLARE_DATA mod_tag @@ -466,7 +466,7 @@ typedef int apr_wait_t; #endif #endif -/* +/* * we always enable dynamic driver loads within apr_dbd */ #ifndef APU_DSO_MODULE_BUILD From 6b2e6ba367549432c8bb51c89a9d1fca41a98d77 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Thu, 10 Mar 2011 17:01:35 +0000 Subject: [PATCH 6889/7878] NetWare build overhaul in order to compile on Linux. Another forgotten fix + formatting ... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1080280 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUenvironment.inc | 4 ---- build/NWGNUhead.inc | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 6543e8bb881..1d933f3925c 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -200,9 +200,7 @@ else VERSION_SKT = (WINSOCK) endif -# # MetroWerks static Libraries - CLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime/mwcrtl.lib MATH3S = PLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP.lib @@ -229,7 +227,6 @@ endif # -g generate debugging information # -O0 level 0 optimizations - ifeq "$(RELEASE)" "debug" CFLAGS += -g -O0 endif @@ -240,7 +237,6 @@ CFLAGS += -O4,p endif # -prefix apr_arch_pre_nw.h #include pre_nw.h for all files - CFLAGS += -prefix apr_arch_pre_nw.h diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc index 2095c56635c..7a96480f60d 100644 --- a/build/NWGNUhead.inc +++ b/build/NWGNUhead.inc @@ -61,7 +61,7 @@ help : clobber_all :: clean clobber_install clobber_install :: - -$(DELTREE) $(INSTALL) + $(call RMDIR,$(INSTALL)) test :: default $(MAKE) -C $(APRTEST) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(LM_LICENSE_FILE)" From c2751898f415b0c57320476dbca8098f3547ada9 Mon Sep 17 00:00:00 2001 From: "Thomas J. Donovan" Date: Fri, 11 Mar 2011 00:09:12 +0000 Subject: [PATCH 6890/7878] indenting fix per change 1078507 - style fix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1080403 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_odbc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index 0b9943c7675..321eba93b7e 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -1324,9 +1324,10 @@ static int odbc_get_row(apr_pool_t *pool, apr_dbd_results_t *res, if (res->colstate[c] != COL_BOUND) { res->colstate[c] = COL_AVAIL; } - /* some drivers do not null-term zero-len CHAR data */ - if (res->colptrs[c]) - *(char *)res->colptrs[c] = 0; + + /* some drivers do not null-term zero-len CHAR data */ + if (res->colptrs[c]) + *(char *)res->colptrs[c] = 0; } if (res->random && (rownum > 0)) { From 6b3c5b2146a3ca52035dcffe59c4bff4d3eb8a93 Mon Sep 17 00:00:00 2001 From: "Thomas J. Donovan" Date: Fri, 11 Mar 2011 00:18:17 +0000 Subject: [PATCH 6891/7878] 2nd try - indenting fix per change 1078507 - style fix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1080404 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_odbc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index 321eba93b7e..1775326d2e7 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -1324,12 +1324,10 @@ static int odbc_get_row(apr_pool_t *pool, apr_dbd_results_t *res, if (res->colstate[c] != COL_BOUND) { res->colstate[c] = COL_AVAIL; } - - /* some drivers do not null-term zero-len CHAR data */ - if (res->colptrs[c]) - *(char *)res->colptrs[c] = 0; + /* some drivers do not null-term zero-len CHAR data */ + if (res->colptrs[c]) + *(char *)res->colptrs[c] = 0; } - if (res->random && (rownum > 0)) { fetchtype = "SQLFetchScroll"; rc = SQLFetchScroll(res->stmt, SQL_FETCH_ABSOLUTE, rownum); From a397d44b60637f0f0f88ee1debe73ee2e59e5de8 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sat, 12 Mar 2011 12:17:26 +0000 Subject: [PATCH 6892/7878] PR50918: check mutex during rebind calls, and set mutex to null when init pool is cleaned up so the mutex can be re-initialized. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1080928 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ ldap/apr_ldap_rebind.c | 33 +++++++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index f4b767a88e2..1dcc325d132 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_ldap: resolve possible hangs or crashes when the pool passed + to apr_ldap_rebind_init() is cleaned up and apr_ldap_rebind + is re-initted and re-used. PR50918. [Eric Covener] + *) apr_ring: Workaround for aliasing problem that causes gcc 4.5 to miscompile some brigade related code. PR 50190. [Stefan Fritsch] diff --git a/ldap/apr_ldap_rebind.c b/ldap/apr_ldap_rebind.c index a829f30040a..96226fc91ff 100644 --- a/ldap/apr_ldap_rebind.c +++ b/ldap/apr_ldap_rebind.c @@ -64,6 +64,14 @@ static apr_ldap_rebind_entry_t *xref_head = NULL; static int apr_ldap_rebind_set_callback(LDAP *ld); static apr_status_t apr_ldap_rebind_remove_helper(void *data); +static apr_status_t apr_ldap_pool_cleanup_set_null(void *data_) +{ + void **ptr = (void **)data_; + *ptr = NULL; + return APR_SUCCESS; +} + + /* APR utility routine used to create the xref_lock. */ APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool) { @@ -73,6 +81,9 @@ APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool) get_apd #endif + /* run after apr_thread_mutex_create cleanup */ + apr_pool_cleanup_register(pool, &apr_ldap_xref_lock, apr_ldap_pool_cleanup_set_null, NULL); + #if APR_HAS_THREADS if (apr_ldap_xref_lock == NULL) { retcode = apr_thread_mutex_create(&apr_ldap_xref_lock, APR_THREAD_MUTEX_DEFAULT, pool); @@ -107,14 +118,20 @@ APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, } #if APR_HAS_THREADS - apr_thread_mutex_lock(apr_ldap_xref_lock); + retcode = apr_thread_mutex_lock(apr_ldap_xref_lock); + if (retcode != APR_SUCCESS) { + return retcode; + } #endif new_xref->next = xref_head; xref_head = new_xref; #if APR_HAS_THREADS - apr_thread_mutex_unlock(apr_ldap_xref_lock); + retcode = apr_thread_mutex_unlock(apr_ldap_xref_lock); + if (retcode != APR_SUCCESS) { + return retcode; + } #endif } else { @@ -138,13 +155,17 @@ APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld) { apr_ldap_rebind_entry_t *tmp_xref, *prev = NULL; + apr_status_t retcode = 0; #ifdef NETWARE get_apd #endif #if APR_HAS_THREADS - apr_thread_mutex_lock(apr_ldap_xref_lock); + retcode = apr_thread_mutex_lock(apr_ldap_xref_lock); + if (retcode != APR_SUCCESS) { + return retcode; + } #endif tmp_xref = xref_head; @@ -169,7 +190,10 @@ APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld) } #if APR_HAS_THREADS - apr_thread_mutex_unlock(apr_ldap_xref_lock); + retcode = apr_thread_mutex_unlock(apr_ldap_xref_lock); + if (retcode != APR_SUCCESS) { + return retcode; + } #endif return APR_SUCCESS; } @@ -348,4 +372,5 @@ static int apr_ldap_rebind_set_callback(LDAP *ld) #endif + #endif /* APR_HAS_LDAP */ From 62fe9dff18fc955b5b6839aa6e54a9b6ea4e8059 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sun, 13 Mar 2011 01:03:18 +0000 Subject: [PATCH 6893/7878] Remove defect fix from CHANGES of unreleased branches git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1081027 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGES b/CHANGES index 1dcc325d132..f4b767a88e2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,10 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) apr_ldap: resolve possible hangs or crashes when the pool passed - to apr_ldap_rebind_init() is cleaned up and apr_ldap_rebind - is re-initted and re-used. PR50918. [Eric Covener] - *) apr_ring: Workaround for aliasing problem that causes gcc 4.5 to miscompile some brigade related code. PR 50190. [Stefan Fritsch] From f1d50efa8124d68067f08bb37b615d1466827aa7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 13 Mar 2011 14:12:03 +0000 Subject: [PATCH 6894/7878] apr_sockaddr_info_get() on AIX: Fix a problem which could set the port field in the native socket address to 1 when 0 was specified. An AIX-specific hack to work around a service name limitation used "1" as the service name, but the 1 was not replaced later. PR: 46964 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1081120 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 22 ++++++++++++++++------ test/testsock.c | 6 ++++++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 77cfba98c43..28280be853c 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -58,6 +58,15 @@ struct apr_ipsubnet_t { #define GETHOSTBYNAME_BUFLEN 512 #endif +#ifdef _AIX +/* Some levels of AIX getaddrinfo() don't like servname = "0", so + * set servname to "1" when port is 0 and fix it up later. + */ +#define AIX_SERVNAME_HACK 1 +#else +#define AIX_SERVNAME_HACK 0 +#endif + #ifdef _WIN32_WCE /* XXX: BS solution. Need an HAVE_GETSERVBYNAME and actually * do something here, to provide the obvious proto mappings. @@ -138,6 +147,11 @@ void apr_sockaddr_vars_set(apr_sockaddr_t *addr, int family, apr_port_t port) addr->sa.sin.sin_port = htons(port); addr->port = port; } +#if AIX_SERVNAME_HACK + else { + addr->sa.sin.sin_port = htons(port); + } +#endif if (family == APR_INET) { addr->salen = sizeof(struct sockaddr_in); @@ -339,16 +353,12 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, hints.ai_flags |= AI_NUMERICHOST; #endif #else -#ifdef _AIX - /* But current AIX getaddrinfo() doesn't like servname = "0"; - * the "1" won't hurt since we use the port parameter to fill - * in the returned socket addresses later - */ +#if AIX_SERVNAME_HACK if (!port) { servname = "1"; } else -#endif /* _AIX */ +#endif /* AIX_SERVNAME_HACK */ servname = apr_itoa(p, port); #endif /* OSF1 */ } diff --git a/test/testsock.c b/test/testsock.c index 425872cb505..f40a34fa5d3 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -80,6 +80,12 @@ static void test_addr_info(abts_case *tc, void *data) rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, 80, 0, p); APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); ABTS_STR_EQUAL(tc, "127.0.0.1", sa->hostname); + + rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, 0, 0, p); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); + ABTS_STR_EQUAL(tc, "127.0.0.1", sa->hostname); + ABTS_INT_EQUAL(tc, 0, sa->port); + ABTS_INT_EQUAL(tc, 0, ntohs(sa->sa.sin.sin_port)); } static void test_serv_by_name(abts_case *tc, void *data) From 99c795d96a2e5e84aef7ecedc9bda25004df382b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 14 Mar 2011 14:54:56 +0000 Subject: [PATCH 6895/7878] remove a couple of entries that will be inherited from the 1.4.x CHANGES file git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1081409 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ----- 1 file changed, 5 deletions(-) diff --git a/CHANGES b/CHANGES index f4b767a88e2..ce4431600e2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,11 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) apr_ring: Workaround for aliasing problem that causes gcc 4.5 to - miscompile some brigade related code. PR 50190. [Stefan Fritsch] - - *) apr_file_flush_locked(): Handle short writes. [Stefan Fritsch] - *) Add new configure option --enable-allocator-uses-mmap to use mmap instead of malloc in apr_allocator_alloc(). This greatly reduces memory fragmentation with malloc implementations (e.g. glibc) that From e8d54d1deef3b9a8e85f01d276ceb509dc6d4048 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 14 Mar 2011 16:46:30 +0000 Subject: [PATCH 6896/7878] more hints on APR_KILL_NEVER git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1081462 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 13631068e1d..ac3b7002ad7 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -198,7 +198,9 @@ typedef struct apr_other_child_rec_t apr_other_child_rec_t; typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(apr_thread_t*, void*); typedef enum { - APR_KILL_NEVER, /**< process is never sent any signals */ + APR_KILL_NEVER, /**< process is never killed (i.e., never sent + * any signals), but it will be reaped if it exits + * before the pool is cleaned up */ APR_KILL_ALWAYS, /**< process is sent SIGKILL on apr_pool_t cleanup */ APR_KILL_AFTER_TIMEOUT, /**< SIGTERM, wait 3 seconds, SIGKILL */ APR_JUST_WAIT, /**< wait forever for the process to complete */ From 52e69fa878e6bf036c092b29bd4572951085ad24 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 14 Mar 2011 17:59:43 +0000 Subject: [PATCH 6897/7878] return apr_get_netos_error() when setsockopt() fails git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1081495 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockopt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index b654e8b4050..c5a4e77152b 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -169,7 +169,7 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, if (setsockopt(sock->socketdes, optlevel, optname, (void *)&on, sizeof(int)) == -1) { - return errno; + return apr_get_netos_error(); } apr_set_option(sock, APR_TCP_DEFER_ACCEPT, on); } From ef614de73df3c82567ce3e0064aba30b4107f020 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 16 Mar 2011 15:54:16 +0000 Subject: [PATCH 6898/7878] * ldap/apr_ldap_rebind.c (apr_ldap_rebind_init): Use the real null cleanup callback. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1082171 13f79535-47bb-0310-9956-ffa450edef68 --- ldap/apr_ldap_rebind.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ldap/apr_ldap_rebind.c b/ldap/apr_ldap_rebind.c index 96226fc91ff..39215770b3f 100644 --- a/ldap/apr_ldap_rebind.c +++ b/ldap/apr_ldap_rebind.c @@ -82,7 +82,8 @@ APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool) #endif /* run after apr_thread_mutex_create cleanup */ - apr_pool_cleanup_register(pool, &apr_ldap_xref_lock, apr_ldap_pool_cleanup_set_null, NULL); + apr_pool_cleanup_register(pool, &apr_ldap_xref_lock, apr_ldap_pool_cleanup_set_null, + apr_pool_cleanup_null); #if APR_HAS_THREADS if (apr_ldap_xref_lock == NULL) { From fc8af8d1e376ef6d8b09d1adb7354c4746fa0a98 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 16 Mar 2011 15:58:15 +0000 Subject: [PATCH 6899/7878] * memory/unix/apr_pools.c (apr_pool_cleanup_register): [APR_POOL_DEBUG]: Catch NULL arguments which would lead to strange segfaults later. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1082177 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 96aff7a087a..c0d470b034d 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -2205,6 +2205,10 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, #if APR_POOL_DEBUG apr_pool_check_integrity(p); + + if (!p || !plain_cleanup_fn || !child_cleanup_fn) { + abort(); + } #endif /* APR_POOL_DEBUG */ if (p != NULL) { From 98fc103090f1d1b3747047edbf0477b0a07f0ff3 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 16 Mar 2011 23:22:54 +0000 Subject: [PATCH 6900/7878] NetWare build overhaul in order to compile on Linux. Some final changes to delimit all echo output lines for Linux. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1082344 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 152 ++++++++++++++++++++++---------------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 51b3e30a0b7..41e9a756638 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -44,6 +44,10 @@ ifeq "$(NLM_EXIT_SYM)" "" NLM_EXIT_SYM = _LibCPostlude endif +ifeq "$(NLM_VERSION)" "" +NLM_VERSION = $(VERSION) +endif + # # Create dependency lists based on the files available # @@ -139,22 +143,22 @@ $(OBJDIR)/$(CCOPT_NAME)_cc.opt: $(CCOPT_DEPENDS) # @echo Generating $@ @echo $(DL)GEN $@$(DL) ifneq "$(strip $(CFLAGS))" "" - @echo $(CFLAGS) >> $@ + @echo $(DL)$(CFLAGS)$(DL)>> $@ endif ifneq "$(strip $(XCFLAGS))" "" - @echo $(XCFLAGS) >> $@ + @echo $(DL)$(XCFLAGS)$(DL)>> $@ endif ifneq "$(strip $(XINCDIRS))" "" - @echo $(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir)) >> $@ + @echo $(DL)$(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir))$(DL)>> $@ endif ifneq "$(strip $(INCDIRS))" "" - @echo $(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir)) >> $@ + @echo $(DL)$(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir))$(DL)>> $@ endif ifneq "$(strip $(DEFINES))" "" - @echo $(DEFINES) >> $@ + @echo $(DL)$(DEFINES)$(DL)>> $@ endif ifneq "$(strip $(XDEFINES))" "" - @echo $(XDEFINES) >> $@ + @echo $(DL)$(XDEFINES)$(DL)>> $@ endif $(OBJDIR)/%.o: %.cpp $(OBJDIR)/$(CCOPT_NAME)_cpp.opt @@ -168,22 +172,22 @@ $(OBJDIR)/$(CCOPT_NAME)_cpp.opt: $(CPPOPT_DEPENDS) # @echo Generating $@ @echo $(DL)GEN $@$(DL) ifneq "$(strip $(CFLAGS))" "" - @echo $(CFLAGS) >> $@ + @echo $(DL)$(CFLAGS)$(DL)>> $@ endif ifneq "$(strip $(XCFLAGS))" "" - @echo $(XCFLAGS) >> $@ + @echo $(DL)$(XCFLAGS)$(DL)>> $@ endif ifneq "$(strip $(XINCDIRS))" "" - @echo $(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir)) >> $@ + @echo $(DL)$(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir))$(DL)>> $@ endif ifneq "$(strip $(INCDIRS))" "" - @echo $(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir)) >> $@ + @echo $(DL)$(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir))$(DL)>> $@ endif ifneq "$(strip $(DEFINES))" "" - @echo $(DEFINES) >> $@ + @echo $(DL)$(DEFINES)$(DL)>> $@ endif ifneq "$(strip $(XDEFINES))" "" - @echo $(XDEFINES) >> $@ + @echo $(DL)$(XDEFINES)$(DL)>> $@ endif endif # one target nlm or lib @@ -207,17 +211,17 @@ $(OBJDIR)/aprlib_lib.lst: $(aprlib_LIBLST_DEPENDS) ifneq "$(strip $(FILES_lib_objs))" "" # @echo Generating $@ @echo $(DL)GEN $@$(DL) - @echo $(wordlist 1, 10, $(FILES_lib_objs)) >> $@ - @echo $(wordlist 11, 20, $(FILES_lib_objs)) >> $@ - @echo $(wordlist 21, 30, $(FILES_lib_objs)) >> $@ - @echo $(wordlist 31, 40, $(FILES_lib_objs)) >> $@ - @echo $(wordlist 41, 50, $(FILES_lib_objs)) >> $@ - @echo $(wordlist 51, 60, $(FILES_lib_objs)) >> $@ - @echo $(wordlist 61, 70, $(FILES_lib_objs)) >> $@ - @echo $(wordlist 71, 80, $(FILES_lib_objs)) >> $@ - @echo $(wordlist 81, 90, $(FILES_lib_objs)) >> $@ - @echo $(wordlist 91, 100, $(FILES_lib_objs)) >> $@ - @echo $(wordlist 101, 110, $(FILES_lib_objs)) >> $@ + @echo $(DL)$(wordlist 1, 10, $(FILES_lib_objs))$(DL)>> $@ + @echo $(DL)$(wordlist 11, 20, $(FILES_lib_objs))$(DL)>> $@ + @echo $(DL)$(wordlist 21, 30, $(FILES_lib_objs))$(DL)>> $@ + @echo $(DL)$(wordlist 31, 40, $(FILES_lib_objs))$(DL)>> $@ + @echo $(DL)$(wordlist 41, 50, $(FILES_lib_objs))$(DL)>> $@ + @echo $(DL)$(wordlist 51, 60, $(FILES_lib_objs))$(DL)>> $@ + @echo $(DL)$(wordlist 61, 70, $(FILES_lib_objs))$(DL)>> $@ + @echo $(DL)$(wordlist 71, 80, $(FILES_lib_objs))$(DL)>> $@ + @echo $(DL)$(wordlist 81, 90, $(FILES_lib_objs))$(DL)>> $@ + @echo $(DL)$(wordlist 91, 100, $(FILES_lib_objs))$(DL)>> $@ + @echo $(DL)$(wordlist 101, 110, $(FILES_lib_objs))$(DL)>> $@ endif $(OBJDIR)/%_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS) @@ -225,13 +229,13 @@ $(OBJDIR)/%_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS) ifneq "$(strip $(FILES_lib_objs))" "" # @echo Generating $@ @echo $(DL)GEN $@$(DL) - @echo $(FILES_lib_objs) >> $@ + @echo $(DL)$(FILES_lib_objs)$(DL)>> $@ endif else # We must have more than one target library so load the individual makefiles $(OBJDIR)/%.lib: NWGNU% $(APRBUILD)/NWGNUhead.inc $(APRBUILD)/NWGNUtail.inc $(APRBUILD)/NWGNUenvironment.inc FORCE - @echo Calling $< + @echo $(DL)Calling $<$(DL) $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE) endif @@ -259,88 +263,84 @@ $(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) # @echo Generating $@ @echo $(DL)GEN $@$(DL) @echo $(DL)# Do not edit this file - it is created by make!$(DL) > $@ - @echo $(DL)# All your changes will be lost!!$(DL) >> $@ - @echo -warnings off >> $@ - @echo -zerobss >> $@ - @echo -o $(TARGET_nlm) >> $@ + @echo $(DL)# All your changes will be lost!!$(DL)>> $@ + @echo $(DL)-warnings off$(DL)>> $@ + @echo $(DL)-zerobss$(DL)>> $@ + @echo $(DL)-o $(TARGET_nlm)$(DL)>> $@ ifneq "$(FILE_nlm_copyright)" "" @-$(CAT) $(FILE_nlm_copyright) >> $@ endif ifeq "$(RELEASE)" "debug" - @echo -g >> $@ - @echo -sym internal >> $@ - @echo -sym codeview4 >> $@ - @echo -osym $(OBJDIR)/$(NLM_NAME).sym >> $@ + @echo $(DL)-g$(DL)>> $@ + @echo $(DL)-sym internal$(DL)>> $@ + @echo $(DL)-sym codeview4$(DL)>> $@ + @echo $(DL)-osym $(OBJDIR)/$(NLM_NAME).sym$(DL)>> $@ else - @echo -sym internal >> $@ -endif - @echo -l $(APR)/$(OBJDIR) >> $@ - @echo -l $(APRLDAP)/$(OBJDIR) >> $@ - @echo -l $(APRXML)/$(OBJDIR) >> $@ - @echo -l $(APR)/misc/netware >> $@ - @echo -l $(APR) >> $@ - @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime"$(DL) >> $@ - @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++"$(DL) >> $@ + @echo $(DL)-sym internal$(DL)>> $@ +endif + @echo $(DL)-l $(APR)/$(OBJDIR)$(DL)>> $@ + @echo $(DL)-l $(APRLDAP)/$(OBJDIR)$(DL)>> $@ + @echo $(DL)-l $(APRXML)/$(OBJDIR)$(DL)>> $@ + @echo $(DL)-l $(APR)/misc/netware$(DL)>> $@ + @echo $(DL)-l $(APR)$(DL)>> $@ + @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime"$(DL)>> $@ + @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++"$(DL)>> $@ ifneq "$(IPV6)" "" - @echo -l $(NOVELLLIBC)/include/winsock/IPV6 >> $@ + @echo $(DL)-l $(NOVELLLIBC)/include/winsock/IPV6$(DL)>> $@ endif - @echo -l $(NOVELLLIBC)/imports >> $@ + @echo $(DL)-l $(NOVELLLIBC)/imports$(DL)>> $@ ifneq "$(LDAPSDK)" "" - @echo -l $(LDAPSDK)/imports >> $@ + @echo $(DL)-l $(LDAPSDK)/imports$(DL)>> $@ endif - @echo -nodefaults >> $@ - @echo -map $(OBJDIR)/$(NLM_NAME).map>> $@ + @echo $(DL)-nodefaults$(DL)>> $@ + @echo $(DL)-map $(OBJDIR)/$(NLM_NAME).map$(DL)>> $@ ifneq "$(strip $(XLFLAGS))" "" - @echo $(XLFLAGS) >> $@ + @echo $(DL)$(XLFLAGS)$(DL)>> $@ endif ifneq "$(strip $(FILES_nlm_objs))" "" - @echo $(foreach objfile,$(strip $(FILES_nlm_objs)),$(objfile)) >> $@ + @echo $(DL)$(foreach objfile,$(strip $(FILES_nlm_objs)),$(objfile))$(DL)>> $@ endif ifneq "$(FILES_nlm_libs)" "" - @echo $(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(libfile)) >> $@ + @echo $(DL)$(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(libfile))$(DL)>> $@ endif - @echo -commandfile $(@:.opt=.def) >> $@ - @echo $(DL)# Do not edit this file - it is created by make!$(DL) > $(@:.opt=.def) - @echo $(DL)# All your changes will be lost!!$(DL) >> $(@:.opt=.def) + @echo $(DL)-commandfile $(@:.opt=.def)$(DL)>> $@ + @echo $(DL)# Do not edit this file - it is created by make!$(DL)> $(@:.opt=.def) + @echo $(DL)# All your changes will be lost!!$(DL)>> $(@:.opt=.def) ifneq "$(FILE_nlm_msg)" "" - @echo Messages $(FILE_nlm_msg) >> $(@:.opt=.def) + @echo $(DL)Messages $(FILE_nlm_msg)$(DL)>> $(@:.opt=.def) endif ifneq "$(FILE_nlm_hlp)" "" - @echo Help $(FILE_nlm_hlp) >> $(@:.opt=.def) + @echo $(DL)Help $(FILE_nlm_hlp)$(DL)>> $(@:.opt=.def) endif ifeq "$(FILE_nlm_copyright)" "" - @echo $(DL)copyright "$(NLM_COPYRIGHT)"$(DL) >> $(@:.opt=.def) -endif - @echo $(DL)description "$(NLM_DESCRIPTION)"$(DL) >> $(@:.opt=.def) - @echo $(DL)threadname "$(NLM_THREAD_NAME)"$(DL) >> $(@:.opt=.def) - @echo $(DL)screenname "$(NLM_SCREEN_NAME)"$(DL) >> $(@:.opt=.def) - @echo stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE)))) >> $(@:.opt=.def) -ifneq "$(NLM_VERSION)" "" - @echo version $(NLM_VERSION) >> $(@:.opt=.def) -else - @echo version $(VERSION) >> $(@:.opt=.def) -endif - @echo $(strip $(NLM_FLAGS)) >> $(@:.opt=.def) - @echo start $(NLM_ENTRY_SYM) >> $(@:.opt=.def) - @echo exit $(NLM_EXIT_SYM) >> $(@:.opt=.def) + @echo $(DL)copyright "$(NLM_COPYRIGHT)"$(DL)>> $(@:.opt=.def) +endif + @echo $(DL)description "$(NLM_DESCRIPTION)"$(DL)>> $(@:.opt=.def) + @echo $(DL)threadname "$(NLM_THREAD_NAME)"$(DL)>> $(@:.opt=.def) + @echo $(DL)screenname "$(NLM_SCREEN_NAME)"$(DL)>> $(@:.opt=.def) + @echo $(DL)stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE))))$(DL)>> $(@:.opt=.def) + @echo $(DL)version $(NLM_VERSION) $(DL)>> $(@:.opt=.def) + @echo $(DL)$(strip $(NLM_FLAGS))$(DL)>> $(@:.opt=.def) + @echo $(DL)start $(NLM_ENTRY_SYM)$(DL)>> $(@:.opt=.def) + @echo $(DL)exit $(NLM_EXIT_SYM)$(DL)>> $(@:.opt=.def) ifneq "$(NLM_CHECK_SYM)" "" - @echo check $(NLM_CHECK_SYM) >> $(@:.opt=.def) + @echo $(DL)check $(NLM_CHECK_SYM)$(DL)>> $(@:.opt=.def) endif ifneq "$(FILES_nlm_modules)" "" - @echo module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(module)) >> $(@:.opt=.def) + @echo $(DL)module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(module))$(DL)>> $(@:.opt=.def) endif ifneq "$(FILES_nlm_Ximports)" "" - @echo import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(import)) >> $(@:.opt=.def) + @echo $(DL)import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(import))$(DL)>> $(@:.opt=.def) endif ifneq "$(FILES_nlm_exports)" "" - @echo export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export)) >> $(@:.opt=.def) + @echo $(DL)export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export))$(DL)>> $(@:.opt=.def) endif # if APACHE_UNIPROC is defined, don't include XDCData ifndef APACHE_UNIPROC ifneq "$(string $(XDCDATA))" "" - @echo xdcdata $(XDCDATA) >> $(@:.opt=.def) + @echo $(DL)xdcdata $(XDCDATA)$(DL)>> $(@:.opt=.def) else - @echo xdcdata apr.xdc >> $(@:.opt=.def) + @echo $(DL)xdcdata apr.xdc$(DL)>> $(@:.opt=.def) endif endif @@ -352,7 +352,7 @@ else # more than one target so look for individual makefiles. ifndef NO_LICENSE_FILE $(OBJDIR)/%.nlm: NWGNU% $(APRBUILD)/NWGNUhead.inc $(APRBUILD)/NWGNUtail.inc $(APRBUILD)/NWGNUenvironment.inc $(CUSTOM_INI) $(VERSION_INC) FORCE - @echo Calling $< + @echo $(DL)Calling $<$(DL) $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE) @$(ECHONL) From 22f63a5ab22e54d46f9977786c610c5e27e87ec7 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 16 Mar 2011 23:25:54 +0000 Subject: [PATCH 6901/7878] NetWare build overhaul in order to compile on Linux. Some more small build tweaks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1082345 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUmakefile | 8 ++++---- build/NWGNUtail.inc | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index 7fabc9cc942..8b165b7fc15 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -29,12 +29,12 @@ $(APR)/aprlib.imp : make_nw_export.awk nw_export.i @echo $(DL)GEN $@$(DL) $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ | $(SORT) >$@ -nw_export.i : nw_export.inc $(FILES_prebuild_headers) $(NLM_NAME)_cc.opt +nw_export.i : nw_export.inc $(FILES_prebuild_headers) cc.opt # @echo Generating $@ @echo $(DL)GEN $@$(DL) - $(CC) $< @$(NLM_NAME)_cc.opt + $(CC) $< @cc.opt -$(NLM_NAME)_cc.opt : NWGNUmakefile $(APR)/build/NWGNUenvironment.inc $(APR)/build/NWGNUhead.inc $(APR)/build/NWGNUtail.inc $(CUSTOM_INI) +cc.opt : NWGNUmakefile $(APR)/build/NWGNUenvironment.inc $(APR)/build/NWGNUhead.inc $(APR)/build/NWGNUtail.inc $(CUSTOM_INI) @echo -P > $@ @echo -EP >> $@ @echo -nosyspath >> $@ @@ -67,7 +67,7 @@ install :: nlms FORCE clean :: $(call DEL,nw_export.i) - $(call DEL,$(NLM_NAME)_cc.opt) + $(call DEL,cc.opt) $(call DEL,NWGNUversion.inc) $(call DEL,$(APR)/aprlib.imp) $(foreach file,$(FILES_prebuild_headers),$(call DEL,$(file))) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 41e9a756638..06c2507f947 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -7,7 +7,6 @@ # If we are going to create an nlm, make sure we have assigned variables to # use during the link. # -#echo NLM_NAME=$(NLM_NAME) ifndef NLM_NAME NLM_NAME = $(TARGET_nlm) endif @@ -139,7 +138,9 @@ $(OBJDIR)/%.o: %.c $(OBJDIR)/$(CCOPT_NAME)_cc.opt $(OBJDIR)/$(CCOPT_NAME)_cc.opt: $(CCOPT_DEPENDS) $(call DEL,$@) -# @echo CCOPT_DEPENDS=$^ +ifdef VERBOSE + @echo CCOPT_DEPENDS=$^ +endif # @echo Generating $@ @echo $(DL)GEN $@$(DL) ifneq "$(strip $(CFLAGS))" "" @@ -168,7 +169,9 @@ $(OBJDIR)/%.o: %.cpp $(OBJDIR)/$(CCOPT_NAME)_cpp.opt $(OBJDIR)/$(CCOPT_NAME)_cpp.opt: $(CPPOPT_DEPENDS) $(call DEL,$@) -# @echo CPPOPT_DEPENDS=$^ +ifdef VERBOSE + @echo CPPOPT_DEPENDS=$^ +endif # @echo Generating $@ @echo $(DL)GEN $@$(DL) ifneq "$(strip $(CFLAGS))" "" From 2a24e96abad9427600e772f1ab66ccb8f404247e Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Thu, 17 Mar 2011 03:36:51 +0000 Subject: [PATCH 6902/7878] Fixed NetWare test build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1082390 13f79535-47bb-0310-9956-ffa450edef68 --- test/NWGNUaprtest | 7 +++++-- test/nw_misc.c | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/NWGNUaprtest b/test/NWGNUaprtest index f55fc0462b9..42ba72ae650 100644 --- a/test/NWGNUaprtest +++ b/test/NWGNUaprtest @@ -196,6 +196,9 @@ FILES_nlm_objs = \ $(OBJDIR)/testipsub.o \ $(OBJDIR)/testldap.o \ $(OBJDIR)/testlfs.o \ + $(OBJDIR)/testlfsabi.o \ + $(OBJDIR)/testlfsabi32.o \ + $(OBJDIR)/testlfsabi64.o \ $(OBJDIR)/testlock.o \ $(OBJDIR)/testmd4.o \ $(OBJDIR)/testmd5.o \ @@ -291,8 +294,8 @@ endif #If the LDAP support is defined then add the imports ifneq "$(LDAPSDK)" "" FILES_nlm_Ximports += \ - @$(LDAPSDK)/imports/lldapsdk.imp \ - @$(LDAPSDK)/imports/lldapssl.imp \ + @lldapsdk.imp \ + @lldapssl.imp \ $(EOLIST) endif diff --git a/test/nw_misc.c b/test/nw_misc.c index 5895247f78d..b45f9516dce 100644 --- a/test/nw_misc.c +++ b/test/nw_misc.c @@ -1,4 +1,6 @@ +#include #include +#include /* #include "testutil.h" */ From e3eb5d0c204060cc6bbeb577200fac4b90229042 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 18 Mar 2011 02:30:44 +0000 Subject: [PATCH 6903/7878] Use var for prelude so its possible to change it at one place. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1082798 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 2 +- build/NWGNUenvironment.inc | 1 + build/NWGNUtail.inc | 2 -- dbd/NWGNUdbdfreetds | 2 +- dbd/NWGNUdbdmysql | 2 +- dbd/NWGNUdbdpgsql | 2 +- dbd/NWGNUdbdsqli2 | 2 +- dbd/NWGNUdbdsqli3 | 2 +- dbm/NWGNUdbmdb | 2 +- dbm/NWGNUdbmgdbm | 2 +- test/NWGNUaprtest | 2 +- test/NWGNUechod | 2 +- test/NWGNUglobalmutexchild | 2 +- test/NWGNUmod_test | 2 +- test/NWGNUproc_child | 2 +- test/NWGNUreadchild | 2 +- test/NWGNUsockchild | 2 +- test/NWGNUsockperf | 2 +- test/NWGNUtestatmc | 2 +- test/NWGNUtryread | 2 +- 20 files changed, 19 insertions(+), 20 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 2f3c4b3ebaf..4c96325e155 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -202,7 +202,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(APRLIB) \ $(APRLDAPLIB) \ $(APRXMLLIB) \ diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 1d933f3925c..05cd6b5ee7b 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -180,6 +180,7 @@ endif endif NOVI = $(NOVELLLIBC)/imports +PRELUDE = $(NOVI)/libcpre.o INCDIRS = $(NOVELLLIBC)/include; diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 06c2507f947..76036915533 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -247,8 +247,6 @@ endif # Rules to build nlms. # -vpath libcpre.o $(NOVELLLIBC)/imports - # If we only have one target NLM then build it ifeq "$(words $(strip $(TARGET_nlm)))" "1" diff --git a/dbd/NWGNUdbdfreetds b/dbd/NWGNUdbdfreetds index 393e380c5b9..8692ff3bc2f 100644 --- a/dbd/NWGNUdbdfreetds +++ b/dbd/NWGNUdbdfreetds @@ -193,7 +193,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) ifeq ($(LINK_STATIC),1) diff --git a/dbd/NWGNUdbdmysql b/dbd/NWGNUdbdmysql index 72bb414e25c..c3e9c811f98 100644 --- a/dbd/NWGNUdbdmysql +++ b/dbd/NWGNUdbdmysql @@ -197,7 +197,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) ifeq ($(LINK_STATIC),1) diff --git a/dbd/NWGNUdbdpgsql b/dbd/NWGNUdbdpgsql index f6848fa9660..05e67bcb06c 100644 --- a/dbd/NWGNUdbdpgsql +++ b/dbd/NWGNUdbdpgsql @@ -200,7 +200,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) ifeq ($(LINK_STATIC),1) diff --git a/dbd/NWGNUdbdsqli2 b/dbd/NWGNUdbdsqli2 index c1f9cd1faf8..3caef7a4869 100644 --- a/dbd/NWGNUdbdsqli2 +++ b/dbd/NWGNUdbdsqli2 @@ -193,7 +193,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) ifeq ($(LINK_STATIC),1) diff --git a/dbd/NWGNUdbdsqli3 b/dbd/NWGNUdbdsqli3 index ed52a248610..e66f2347ed7 100644 --- a/dbd/NWGNUdbdsqli3 +++ b/dbd/NWGNUdbdsqli3 @@ -193,7 +193,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) ifeq ($(LINK_STATIC),1) diff --git a/dbm/NWGNUdbmdb b/dbm/NWGNUdbmdb index fdce7b4f063..a79edf08742 100644 --- a/dbm/NWGNUdbmdb +++ b/dbm/NWGNUdbmdb @@ -201,7 +201,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) ifeq ($(LINK_STATIC),1) diff --git a/dbm/NWGNUdbmgdbm b/dbm/NWGNUdbmgdbm index 3ab1c815ccc..dc0c2b0ebc0 100644 --- a/dbm/NWGNUdbmgdbm +++ b/dbm/NWGNUdbmgdbm @@ -200,7 +200,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) ifeq ($(LINK_STATIC),1) diff --git a/test/NWGNUaprtest b/test/NWGNUaprtest index 42ba72ae650..6b6ac26c54e 100644 --- a/test/NWGNUaprtest +++ b/test/NWGNUaprtest @@ -247,7 +247,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) # diff --git a/test/NWGNUechod b/test/NWGNUechod index 3984d771218..54280b14512 100644 --- a/test/NWGNUechod +++ b/test/NWGNUechod @@ -178,7 +178,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) # diff --git a/test/NWGNUglobalmutexchild b/test/NWGNUglobalmutexchild index 8fbb187bc12..fef38fe6c92 100644 --- a/test/NWGNUglobalmutexchild +++ b/test/NWGNUglobalmutexchild @@ -179,7 +179,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) # diff --git a/test/NWGNUmod_test b/test/NWGNUmod_test index 102781b762f..97bdfcd2491 100644 --- a/test/NWGNUmod_test +++ b/test/NWGNUmod_test @@ -177,7 +177,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) # diff --git a/test/NWGNUproc_child b/test/NWGNUproc_child index fd7aa47f7e2..05438aa1a9d 100644 --- a/test/NWGNUproc_child +++ b/test/NWGNUproc_child @@ -177,7 +177,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) # diff --git a/test/NWGNUreadchild b/test/NWGNUreadchild index 3ec701270f0..f1836b8f5b7 100644 --- a/test/NWGNUreadchild +++ b/test/NWGNUreadchild @@ -177,7 +177,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) # diff --git a/test/NWGNUsockchild b/test/NWGNUsockchild index 319eefa8eed..618ad4760f8 100644 --- a/test/NWGNUsockchild +++ b/test/NWGNUsockchild @@ -177,7 +177,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) # diff --git a/test/NWGNUsockperf b/test/NWGNUsockperf index d846d984518..ea3a55679f7 100644 --- a/test/NWGNUsockperf +++ b/test/NWGNUsockperf @@ -178,7 +178,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) # diff --git a/test/NWGNUtestatmc b/test/NWGNUtestatmc index f851ef781c4..8bb47602fdc 100644 --- a/test/NWGNUtestatmc +++ b/test/NWGNUtestatmc @@ -179,7 +179,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) # diff --git a/test/NWGNUtryread b/test/NWGNUtryread index 92b2a6e3ecd..e6c3eee5d56 100644 --- a/test/NWGNUtryread +++ b/test/NWGNUtryread @@ -177,7 +177,7 @@ FILES_nlm_objs = \ # These will be added as a library command in the link.opt file. # FILES_nlm_libs = \ - libcpre.o \ + $(PRELUDE) \ $(EOLIST) # From 3ba53700a6b9f44933e504c0939ee1440af6d892 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Mar 2011 16:29:27 +0000 Subject: [PATCH 6904/7878] apr_socket_create/accept: clean up socket descriptor on some error paths which happen before the cleanup is registered git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1082963 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 11d284916b4..b7b175e11c7 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -177,10 +177,14 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, int flags; if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1) + close((*new)->socketdes); + (*new)->socketdes = -1; return errno; flags |= FD_CLOEXEC; if (fcntl((*new)->socketdes, F_SETFD, flags) == -1) + close((*new)->socketdes); + (*new)->socketdes = -1; return errno; } #endif @@ -339,12 +343,18 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, { int flags; - if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1) + if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1) { + close((*new)->socketdes); + (*new)->socketdes = -1; return errno; + } flags |= FD_CLOEXEC; - if (fcntl((*new)->socketdes, F_SETFD, flags) == -1) + if (fcntl((*new)->socketdes, F_SETFD, flags) == -1) { + close((*new)->socketdes); + (*new)->socketdes = -1; return errno; + } } #endif From 3a527cb5c356500b44b68f81a310e454f0aba44d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Mar 2011 19:16:41 +0000 Subject: [PATCH 6905/7878] no builtin expat in trunk/2.0 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083023 13f79535-47bb-0310-9956-ffa450edef68 --- build/apu-conf.m4 | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/build/apu-conf.m4 b/build/apu-conf.m4 index 4c7ab6a18d1..bc7db21345b 100644 --- a/build/apu-conf.m4 +++ b/build/apu-conf.m4 @@ -130,42 +130,22 @@ save_cppflags="$CPPFLAGS" apu_has_expat=0 -# Default: will use either external or bundled expat. -apu_try_external_expat=1 -apu_try_builtin_expat=1 - AC_ARG_WITH([expat], -[ --with-expat=DIR specify Expat location, or 'builtin'], [ +[ --with-expat=DIR specify Expat location], [ if test "$withval" = "yes"; then AC_MSG_ERROR([a directory must be specified for --with-expat]) elif test "$withval" = "no"; then AC_MSG_ERROR([Expat cannot be disabled (at this time)]) - elif test "$withval" = "builtin"; then - apu_try_external_expat=0 else # Add given path to standard search paths if appropriate: if test "$withval" != "/usr"; then APR_ADDTO(INCLUDES, [-I$withval/include]) APR_ADDTO(LDFLAGS, [-L$withval/lib]) fi - # ...and refuse to fall back on the builtin expat. - apu_try_builtin_expat=0 fi ]) -if test $apu_try_external_expat = 1; then - APU_SYSTEM_EXPAT -fi - -if test "${apu_has_expat}${apu_try_builtin_expat}" = "01"; then - dnl This is a bit of a hack. This only works because we know that - dnl we are working with the bundled version of the software. - bundled_subdir="xml/expat" - APR_SUBDIR_CONFIG($bundled_subdir, [--prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir]) - APR_ADDTO(INCLUDES, [-I$top_builddir/$bundled_subdir/lib]) - APR_ADDTO(LDFLAGS, [-L$top_builddir/$bundled_subdir/lib]) - apu_expat_libs="$top_builddir/$bundled_subdir/lib/libexpat.la" -fi +APU_SYSTEM_EXPAT APR_ADDTO(APRUTIL_EXPORT_LIBS, [$apu_expat_libs]) APR_ADDTO(LIBS, [$apu_expat_libs]) From c52bebd2c51f144316bcf5fdd9077802248f716a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Mar 2011 19:59:11 +0000 Subject: [PATCH 6906/7878] fix r1083023: add errorchecking for missing expat, not needed when we had builtin expat for a fallback git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083030 13f79535-47bb-0310-9956-ffa450edef68 --- build/apu-conf.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/build/apu-conf.m4 b/build/apu-conf.m4 index bc7db21345b..a727e58706e 100644 --- a/build/apu-conf.m4 +++ b/build/apu-conf.m4 @@ -146,6 +146,7 @@ AC_ARG_WITH([expat], ]) APU_SYSTEM_EXPAT +test ${apu_has_expat} != "1" && AC_MSG_ERROR(could not find Expat) APR_ADDTO(APRUTIL_EXPORT_LIBS, [$apu_expat_libs]) APR_ADDTO(LIBS, [$apu_expat_libs]) From 63dbcd46accd3284d98c9289c8a1d1cfaa395ecc Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Mar 2011 20:17:56 +0000 Subject: [PATCH 6907/7878] fix compile failure with MinGW toolchain PR: 46175 (this is but a small part of the patch) Submitted by: Carlo Bramini Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083038 13f79535-47bb-0310-9956-ffa450edef68 --- support/unix/waitio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/unix/waitio.c b/support/unix/waitio.c index a30ec4a7352..19b8b1d6ba2 100644 --- a/support/unix/waitio.c +++ b/support/unix/waitio.c @@ -22,7 +22,7 @@ /* The only case where we don't use wait_for_io_or_timeout is on * pre-BONE BeOS, so this check should be sufficient and simpler */ -#if !BEOS_R5 && !defined(OS2) +#if !BEOS_R5 && !defined(OS2) && APR_FILES_AS_SOCKETS #define USE_WAIT_FOR_IO #endif From 17063137fa79673da75c9e989cdfa5ffcfde5ed8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 19 Mar 2011 12:17:02 +0000 Subject: [PATCH 6908/7878] clean up some low hanging gcc warnings on Win git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083169 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 2 +- test/testrand.c | 2 ++ test/testshm.c | 2 ++ threadproc/win32/signals.c | 1 + threadproc/win32/threadpriv.c | 2 +- time/win32/timestr.c | 4 ++-- user/win32/userinfo.c | 8 ++++---- 7 files changed, 13 insertions(+), 8 deletions(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 1ca8df42e99..0fb11add5e1 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -210,6 +210,7 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, } +#if APR_HAS_SENDFILE static apr_status_t collapse_iovec(char **off, apr_size_t *len, struct iovec *iovec, int numvec, char *buf, apr_size_t buflen) @@ -240,7 +241,6 @@ static apr_status_t collapse_iovec(char **off, apr_size_t *len, } -#if APR_HAS_SENDFILE /* * apr_status_t apr_socket_sendfile(apr_socket_t *, apr_file_t *, apr_hdtr_t *, * apr_off_t *, apr_size_t *, apr_int32_t flags) diff --git a/test/testrand.c b/test/testrand.c index 6ced4a34f63..333491f3e90 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -63,6 +63,7 @@ static void rand_run_kat(abts_case *tc, rnd_fn *f, apr_random_t *r, } } +#if APR_HAS_FORK static int rand_check_kat(rnd_fn *f, apr_random_t *r, const unsigned char expected[128]) { @@ -76,6 +77,7 @@ static int rand_check_kat(rnd_fn *f, apr_random_t *r, return 1; return 0; } +#endif static void rand_add_zeroes(apr_random_t *r) { diff --git a/test/testshm.c b/test/testshm.c index 6c192f290fb..bbaf6250445 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -31,6 +31,7 @@ #if APR_HAS_SHARED_MEMORY +#if APR_HAS_FORK static int msgwait(int sleep_sec, int first_box, int last_box) { int i; @@ -58,6 +59,7 @@ static void msgput(int boxnum, char *msg) apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg) + 1); boxes[boxnum].msgavail = 1; } +#endif /* APR_HAS_FORK */ static void test_anon_create(abts_case *tc, void *data) { diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index b97023094ea..1cc153e3061 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -17,6 +17,7 @@ #include "apr_arch_threadproc.h" #include "apr_arch_file_io.h" #include "apr_thread_proc.h" +#include "apr_signal.h" #include "apr_file_io.h" #include "apr_general.h" #if APR_HAVE_SIGNAL_H diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 0cbfe620e43..787c142c49d 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -41,7 +41,7 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key) { - if ((*new) = TlsGetValue(key->key)) { + if (((*new) = TlsGetValue(key->key))) { return APR_SUCCESS; } return apr_get_os_error(); diff --git a/time/win32/timestr.c b/time/win32/timestr.c index c28f8e79984..13841235218 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -124,8 +124,8 @@ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t) #ifndef _WIN32_WCE -apr_size_t win32_strftime_extra(char *s, size_t max, const char *format, - const struct tm *tm) +static apr_size_t win32_strftime_extra(char *s, size_t max, const char *format, + const struct tm *tm) { /* If the new format string is bigger than max, the result string won't fit * anyway. If format strings are added, made sure the padding below is diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 3d45df4f3ee..d09aaae836b 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -45,10 +45,10 @@ void get_sid_string(char *buf, apr_size_t blen, apr_uid_t id) + ((DWORD)(psia->Value[3]) << 16) + ((DWORD)(psia->Value[2]) << 24); sa = (DWORD)(psia->Value[1]) + ((DWORD)(psia->Value[0]) << 8); if (sa) { - slen = apr_snprintf(buf, blen, "S-%lu-0x%04x%08x", + slen = apr_snprintf(buf, blen, "S-%d-0x%04x%08x", SID_REVISION, sa, nsa); } else { - slen = apr_snprintf(buf, blen, "S-%lu-%lu", + slen = apr_snprintf(buf, blen, "S-%d-%lu", SID_REVISION, nsa); } @@ -211,11 +211,11 @@ APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *uid, apr_gid_t *gid, DWORD rv; char *pos; - if (pos = strchr(username, '/')) { + if ((pos = strchr(username, '/'))) { domain = apr_pstrndup(p, username, pos - username); username = pos + 1; } - else if (pos = strchr(username, '\\')) { + else if ((pos = strchr(username, '\\'))) { domain = apr_pstrndup(p, username, pos - username); username = pos + 1; } From 635ec08bab98c9109b3dd2bcd1c30266b022aee8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 19 Mar 2011 12:32:39 +0000 Subject: [PATCH 6909/7878] add dummy apr_file_pipe_wait() for Windows so that the test suite can link git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083170 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 701bec75b87..71b2f2b5a62 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -590,3 +590,10 @@ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, free(data.buf); return count; } + +APR_DECLARE(apr_status_t) apr_file_pipe_wait(apr_file_t *thepipe, + apr_wait_type_t direction) +{ + return APR_ENOTIMPL; +} + From 061a84ae9104b5c7f5548215cbd0eee1f33ca309 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 19 Mar 2011 13:13:13 +0000 Subject: [PATCH 6910/7878] remove ancient time field getters, replaced with exploded time git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083177 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 - libapr.dsp | 4 - time/win32/access.c | 204 -------------------------------------------- 3 files changed, 212 deletions(-) delete mode 100644 time/win32/access.c diff --git a/apr.dsp b/apr.dsp index 7321a48ab23..4319878fb31 100644 --- a/apr.dsp +++ b/apr.dsp @@ -696,10 +696,6 @@ SOURCE=.\threadproc\win32\threadpriv.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\time\win32\access.c -# End Source File -# Begin Source File - SOURCE=.\time\win32\time.c # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index 17e2ae3672f..6ad0be5943b 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -731,10 +731,6 @@ SOURCE=.\threadproc\win32\threadpriv.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\time\win32\access.c -# End Source File -# Begin Source File - SOURCE=.\time\win32\time.c # End Source File # Begin Source File diff --git a/time/win32/access.c b/time/win32/access.c deleted file mode 100644 index c3ccad6bcfa..00000000000 --- a/time/win32/access.c +++ /dev/null @@ -1,204 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "apr_arch_atime.h" -#include "apr_time.h" -#include "apr_general.h" -#include "apr_lib.h" - -apr_status_t apr_get_curtime(struct atime_t *time, apr_time_t *rv) -{ - if (time) { - (*rv) = time->currtime; - return APR_SUCCESS; - } - return APR_ENOTIME; -} - -apr_status_t apr_get_sec(struct atime_t *time, apr_int32_t *rv) -{ - if (time) { - (*rv) = time->explodedtime->wSecond; - return APR_SUCCESS; - } - return APR_ENOTIME; -} - -apr_status_t apr_get_min(struct atime_t *time, apr_int32_t *rv) -{ - if (time) { - (*rv) = time->explodedtime->wMinute; - return APR_SUCCESS; - } - return APR_ENOTIME; -} - -apr_status_t apr_get_hour(struct atime_t *time, apr_int32_t *rv) -{ - if (time) { - (*rv) = time->explodedtime->wHour; - return APR_SUCCESS; - } - return APR_ENOTIME; -} - -apr_status_t apr_get_mday(struct atime_t *time, apr_int32_t *rv) -{ - if (time) { - (*rv) = time->explodedtime->wDay; - return APR_SUCCESS; - } - return APR_ENOTIME; -} - -apr_status_t apr_get_mon(struct atime_t *time, apr_int32_t *rv) -{ - if (time) { - (*rv) = time->explodedtime->wMonth; - return APR_SUCCESS; - } - return APR_ENOTIME; -} - -apr_status_t apr_get_year(struct atime_t *time, apr_int32_t *rv) -{ - if (time) { - (*rv) = time->explodedtime->wYear; - return APR_SUCCESS; - } - return APR_ENOTIME; -} - -apr_status_t apr_get_wday(struct atime_t *time, apr_int32_t *rv) -{ - if (time) { - (*rv) = time->explodedtime->wDayOfWeek; - return APR_SUCCESS; - } - return APR_ENOTIME; -} - -apr_status_t apr_set_sec(struct atime_t *time, apr_int32_t value) -{ - if (!time) { - return APR_ENOTIME; - } - if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, - sizeof(SYSTEMTIME)); - } - if (time->explodedtime == NULL) { - return APR_ENOMEM; - } - time->explodedtime->wSecond = value; - return APR_SUCCESS; -} - -apr_status_t apr_set_min(struct atime_t *time, apr_int32_t value) -{ - if (!time) { - return APR_ENOTIME; - } - if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, - sizeof(SYSTEMTIME)); - } - if (time->explodedtime == NULL) { - return APR_ENOMEM; - } - time->explodedtime->wMinute = value; - return APR_SUCCESS; -} - -apr_status_t apr_set_hour(struct atime_t *time, apr_int32_t value) -{ - if (!time) { - return APR_ENOTIME; - } - if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, - sizeof(SYSTEMTIME)); - } - if (time->explodedtime == NULL) { - return APR_ENOMEM; - } - time->explodedtime->wHour = value; - return APR_SUCCESS; -} - -apr_status_t apr_set_mday(struct atime_t *time, apr_int32_t value) -{ - if (!time) { - return APR_ENOTIME; - } - if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, - sizeof(SYSTEMTIME)); - } - if (time->explodedtime == NULL) { - return APR_ENOMEM; - } - time->explodedtime->wDay = value; - return APR_SUCCESS; -} - -apr_status_t apr_set_mon(struct atime_t *time, apr_int32_t value) -{ - if (!time) { - return APR_ENOTIME; - } - if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, - sizeof(SYSTEMTIME)); - } - if (time->explodedtime == NULL) { - return APR_ENOMEM; - } - time->explodedtime->wMonth = value; - return APR_SUCCESS; -} - -apr_status_t apr_set_year(struct atime_t *time, apr_int32_t value) -{ - if (!time) { - return APR_ENOTIME; - } - if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, - sizeof(SYSTEMTIME)); - } - if (time->explodedtime == NULL) { - return APR_ENOMEM; - } - time->explodedtime->wYear = value; - return APR_SUCCESS; -} - -apr_status_t apr_set_wday(struct atime_t *time, apr_int32_t value) -{ - if (!time) { - return APR_ENOTIME; - } - if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, - sizeof(SYSTEMTIME)); - } - if (time->explodedtime == NULL) { - return APR_ENOMEM; - } - time->explodedtime->wDayOfWeek = value; - return APR_SUCCESS; -} From a04707ffb82b94460f52f0fa7d975f9a96d8e9ce Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 19 Mar 2011 13:19:10 +0000 Subject: [PATCH 6911/7878] fix declaration of apr_signal_description_get() (exposed by r1083169) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083178 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/signals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 1cc153e3061..f19fb03248a 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -51,7 +51,7 @@ void apr_signal_init(apr_pool_t *pglobal) { } -const char *apr_signal_description_get(int signum) +APR_DECLARE(const char *) apr_signal_description_get(int signum) { return "unknown signal (not supported)"; } From a08529c21091885e31a3baa798c297f371020718 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 19 Mar 2011 14:38:23 +0000 Subject: [PATCH 6912/7878] fix low-hanging gcc warnings, mostly for Windows git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083183 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 2 +- misc/unix/errorcodes.c | 100 +++++++++++++++++++-------------------- test/testlfsabi.c | 2 +- test/testlfsabi.h | 4 ++ user/win32/groupinfo.c | 4 +- user/win32/userinfo.c | 2 +- 6 files changed, 59 insertions(+), 55 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index d2997b2ee61..a149ae4b933 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -97,7 +97,7 @@ static void resolve_prot(apr_finfo_t *finfo, apr_int32_t wanted, PACL dacl) * there is no reason for os_level testing here. */ if ((wanted & APR_FINFO_WPROT) && !worldid) { - SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_WORLD_SID_AUTHORITY; + SID_IDENTIFIER_AUTHORITY SIDAuth = {SECURITY_WORLD_SID_AUTHORITY}; if (AllocateAndInitializeSid(&SIDAuth, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &worldid)) atexit(free_world); diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 4764998c380..75567c24657 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -189,56 +189,56 @@ static const struct { apr_status_t code; const char *msg; } gaErrorList[] = { - WSAEINTR, "Interrupted system call", - WSAEBADF, "Bad file number", - WSAEACCES, "Permission denied", - WSAEFAULT, "Bad address", - WSAEINVAL, "Invalid argument", - WSAEMFILE, "Too many open sockets", - WSAEWOULDBLOCK, "Operation would block", - WSAEINPROGRESS, "Operation now in progress", - WSAEALREADY, "Operation already in progress", - WSAENOTSOCK, "Socket operation on non-socket", - WSAEDESTADDRREQ, "Destination address required", - WSAEMSGSIZE, "Message too long", - WSAEPROTOTYPE, "Protocol wrong type for socket", - WSAENOPROTOOPT, "Bad protocol option", - WSAEPROTONOSUPPORT, "Protocol not supported", - WSAESOCKTNOSUPPORT, "Socket type not supported", - WSAEOPNOTSUPP, "Operation not supported on socket", - WSAEPFNOSUPPORT, "Protocol family not supported", - WSAEAFNOSUPPORT, "Address family not supported", - WSAEADDRINUSE, "Address already in use", - WSAEADDRNOTAVAIL, "Can't assign requested address", - WSAENETDOWN, "Network is down", - WSAENETUNREACH, "Network is unreachable", - WSAENETRESET, "Net connection reset", - WSAECONNABORTED, "Software caused connection abort", - WSAECONNRESET, "Connection reset by peer", - WSAENOBUFS, "No buffer space available", - WSAEISCONN, "Socket is already connected", - WSAENOTCONN, "Socket is not connected", - WSAESHUTDOWN, "Can't send after socket shutdown", - WSAETOOMANYREFS, "Too many references, can't splice", - WSAETIMEDOUT, "Connection timed out", - WSAECONNREFUSED, "Connection refused", - WSAELOOP, "Too many levels of symbolic links", - WSAENAMETOOLONG, "File name too long", - WSAEHOSTDOWN, "Host is down", - WSAEHOSTUNREACH, "No route to host", - WSAENOTEMPTY, "Directory not empty", - WSAEPROCLIM, "Too many processes", - WSAEUSERS, "Too many users", - WSAEDQUOT, "Disc quota exceeded", - WSAESTALE, "Stale NFS file handle", - WSAEREMOTE, "Too many levels of remote in path", - WSASYSNOTREADY, "Network system is unavailable", - WSAVERNOTSUPPORTED, "Winsock version out of range", - WSANOTINITIALISED, "WSAStartup not yet called", - WSAEDISCON, "Graceful shutdown in progress", - WSAHOST_NOT_FOUND, "Host not found", - WSANO_DATA, "No host data of that type was found", - 0, NULL + {WSAEINTR, "Interrupted system call"}, + {WSAEBADF, "Bad file number"}, + {WSAEACCES, "Permission denied"}, + {WSAEFAULT, "Bad address"}, + {WSAEINVAL, "Invalid argument"}, + {WSAEMFILE, "Too many open sockets"}, + {WSAEWOULDBLOCK, "Operation would block"}, + {WSAEINPROGRESS, "Operation now in progress"}, + {WSAEALREADY, "Operation already in progress"}, + {WSAENOTSOCK, "Socket operation on non-socket"}, + {WSAEDESTADDRREQ, "Destination address required"}, + {WSAEMSGSIZE, "Message too long"}, + {WSAEPROTOTYPE, "Protocol wrong type for socket"}, + {WSAENOPROTOOPT, "Bad protocol option"}, + {WSAEPROTONOSUPPORT, "Protocol not supported"}, + {WSAESOCKTNOSUPPORT, "Socket type not supported"}, + {WSAEOPNOTSUPP, "Operation not supported on socket"}, + {WSAEPFNOSUPPORT, "Protocol family not supported"}, + {WSAEAFNOSUPPORT, "Address family not supported"}, + {WSAEADDRINUSE, "Address already in use"}, + {WSAEADDRNOTAVAIL, "Can't assign requested address"}, + {WSAENETDOWN, "Network is down"}, + {WSAENETUNREACH, "Network is unreachable"}, + {WSAENETRESET, "Net connection reset"}, + {WSAECONNABORTED, "Software caused connection abort"}, + {WSAECONNRESET, "Connection reset by peer"}, + {WSAENOBUFS, "No buffer space available"}, + {WSAEISCONN, "Socket is already connected"}, + {WSAENOTCONN, "Socket is not connected"}, + {WSAESHUTDOWN, "Can't send after socket shutdown"}, + {WSAETOOMANYREFS, "Too many references, can't splice"}, + {WSAETIMEDOUT, "Connection timed out"}, + {WSAECONNREFUSED, "Connection refused"}, + {WSAELOOP, "Too many levels of symbolic links"}, + {WSAENAMETOOLONG, "File name too long"}, + {WSAEHOSTDOWN, "Host is down"}, + {WSAEHOSTUNREACH, "No route to host"}, + {WSAENOTEMPTY, "Directory not empty"}, + {WSAEPROCLIM, "Too many processes"}, + {WSAEUSERS, "Too many users"}, + {WSAEDQUOT, "Disc quota exceeded"}, + {WSAESTALE, "Stale NFS file handle"}, + {WSAEREMOTE, "Too many levels of remote in path"}, + {WSASYSNOTREADY, "Network system is unavailable"}, + {WSAVERNOTSUPPORTED, "Winsock version out of range"}, + {WSANOTINITIALISED, "WSAStartup not yet called"}, + {WSAEDISCON, "Graceful shutdown in progress"}, + {WSAHOST_NOT_FOUND, "Host not found"}, + {WSANO_DATA, "No host data of that type was found"}, + {0, NULL} }; diff --git a/test/testlfsabi.c b/test/testlfsabi.c index 6fa39bdace1..2c1e963b3e6 100644 --- a/test/testlfsabi.c +++ b/test/testlfsabi.c @@ -26,7 +26,7 @@ extern void get_type_sizes32(int *res); extern void get_type_sizes64(int *res); -void get_type_sizes(int *res) +static void get_type_sizes(int *res) { #include "testlfsabi_include.c" } diff --git a/test/testlfsabi.h b/test/testlfsabi.h index e7c532cc39b..32c84e8e7fc 100644 --- a/test/testlfsabi.h +++ b/test/testlfsabi.h @@ -26,3 +26,7 @@ #define GETSIZE(res, type) res[(IDX_##type)] = sizeof(type) #define CHECKSIZE(tc, res1, res2, type) \ ABTS_INT_EQUAL(tc, res1[(IDX_##type)], res2[(IDX_##type)]); + +extern void get_type_sizes32(int *res); +extern void get_type_sizes64(int *res); + diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index 7739a5428dd..585642f0740 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -36,11 +36,11 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *gid, DWORD rv; char *pos; - if (pos = strchr(groupname, '/')) { + if ((pos = strchr(groupname, '/'))) { domain = apr_pstrndup(p, groupname, pos - groupname); groupname = pos + 1; } - else if (pos = strchr(groupname, '\\')) { + else if ((pos = strchr(groupname, '\\'))) { domain = apr_pstrndup(p, groupname, pos - groupname); groupname = pos + 1; } diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index d09aaae836b..f343d95822a 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -30,7 +30,7 @@ * depends on IsValidSid(), which internally we better test long * before we get here! */ -void get_sid_string(char *buf, apr_size_t blen, apr_uid_t id) +static void get_sid_string(char *buf, apr_size_t blen, apr_uid_t id) { PSID_IDENTIFIER_AUTHORITY psia; DWORD nsa; From 6a922c03d9ade4be36c9602d8d63c71b12a39045 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 19 Mar 2011 16:53:29 +0000 Subject: [PATCH 6913/7878] fix some gcc warnings on Windows the return of APR_EGENERAL is to bypass a theoretical reference to an unset variable (sizelo) in a should-not-occur path, following an existing example git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083227 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 4 +++- user/win32/userinfo.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index a149ae4b933..79193bdccb3 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -268,7 +268,7 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, ((wanted & APR_FINFO_PROT) ? &dacl : NULL), NULL, &pdesc); else - return APR_INCOMPLETE; + return APR_INCOMPLETE; /* should not occur */ if (rv == ERROR_SUCCESS) apr_pool_cleanup_register(finfo->pool, pdesc, free_localheap, apr_pool_cleanup_null); @@ -319,6 +319,8 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, sizelo = GetCompressedFileSizeW((apr_wchar_t*)ufile, &sizehi); else if (whatfile == MORE_OF_FSPEC) sizelo = GetCompressedFileSizeA((char*)ufile, &sizehi); + else + return APR_EGENERAL; /* should not occur */ if (sizelo != INVALID_FILE_SIZE || GetLastError() == NO_ERROR) { #if APR_HAS_LARGE_FILES diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index f343d95822a..12931ade6c3 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -46,7 +46,7 @@ static void get_sid_string(char *buf, apr_size_t blen, apr_uid_t id) sa = (DWORD)(psia->Value[1]) + ((DWORD)(psia->Value[0]) << 8); if (sa) { slen = apr_snprintf(buf, blen, "S-%d-0x%04x%08x", - SID_REVISION, sa, nsa); + SID_REVISION, (unsigned int)sa, (unsigned int)nsa); } else { slen = apr_snprintf(buf, blen, "S-%d-%lu", SID_REVISION, nsa); From 55ddd67f5c6220adf1ef7bdbf5023c2ddc95d44d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 19 Mar 2011 18:06:24 +0000 Subject: [PATCH 6914/7878] MinGW improvements: * fix settings of APR_HAS_USER, APR_HAS_XTHREAD_FILES, APR_THREAD_FUNC, and APR_PROCATTR_USER_SET_REQUIRES_PASSOWRD * stop setting optimization level back to -O0, which isn't needed any more * bypass autodetection of O_NONBLOCK, TCP_NODELAY, and OS uuid suppot also, change the defaulting of have_unicode_fs to use the APR macro PR: 46175 (this is a moderate part of the patch) Submitted by: Carlo Bramini Reviewed/tweaked by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083242 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 29 +++++++++++++++++------------ configure.in | 18 ++++++++++++++---- include/apr.h.in | 8 ++++---- 3 files changed, 35 insertions(+), 20 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index ab450a858d0..ebb1c517058 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -442,24 +442,29 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DCYGWIN]) ;; *mingw*) - dnl gcc (3.4.2 at least) seems to mis-optimize at levels greater than - dnl -O0 producing link-time errors. The user can override by - dnl explicitly passing a CFLAGS value to configure. - dnl - dnl Example error messages: - dnl undefined reference to 'libmsvcrt_a_iname' - dnl undefined reference to '_nm___pctype' - if test "$ac_test_CFLAGS" != set; then - APR_REMOVEFROM(CFLAGS,-O2) - APR_ADDTO(CFLAGS,-O0) - fi APR_ADDTO(LDFLAGS, [-Wl,--enable-auto-import,--subsystem,console]) APR_SETIFNULL(apr_lock_method, [win32]) APR_SETIFNULL(apr_process_lock_is_global, [yes]) APR_SETIFNULL(have_unicode_fs, [1]) APR_SETIFNULL(have_proc_invoked, [1]) APR_SETIFNULL(apr_cv_use_lfs64, [yes]) - ;; + APR_SETIFNULL(apr_cv_osuuid, [yes]) + APR_SETIFNULL(ac_cv_o_nonblock_inherited, [yes]) + APR_SETIFNULL(ac_cv_tcp_nodelay_inherited, [yes]) + APR_SETIFNULL(apr_thread_func, [__stdcall]) + case $host in + *mingw32*) + APR_SETIFNULL(apr_has_xthread_files, [1]) + APR_SETIFNULL(apr_has_user, [1]) + APR_SETIFNULL(apr_procattr_user_set_requires_password, [1]) + ;; + *mingwce) + APR_SETIFNULL(apr_has_xthread_files, [0]) + APR_SETIFNULL(apr_has_user, [0]) + APR_SETIFNULL(apr_procattr_user_set_requires_password, [0]) + ;; + esac + ;; esac fi diff --git a/configure.in b/configure.in index b185f2b027b..f265c9db58b 100644 --- a/configure.in +++ b/configure.in @@ -2558,13 +2558,23 @@ dnl Check for langinfo support AC_CHECK_HEADERS(langinfo.h) AC_CHECK_FUNCS(nl_langinfo) +dnl ------------------------------ Defaults for some platform nuances + dnl Do we have a Win32-centric Unicode FS? +APR_SETIFNULL(have_unicode_fs, [0]) +AC_SUBST(have_unicode_fs) -if test -z "$have_unicode_fs"; then - have_unicode_fs="0" -fi +APR_SETIFNULL(apr_has_xthread_files, [0]) +AC_SUBST(apr_has_xthread_files) -AC_SUBST(have_unicode_fs) +APR_SETIFNULL(apr_procattr_user_set_requires_password, [0]) +AC_SUBST(apr_procattr_user_set_requires_password) + +APR_SETIFNULL(apr_thread_func, []) +AC_SUBST(apr_thread_func) + +APR_SETIFNULL(apr_has_user, [1]) +AC_SUBST(apr_has_user) dnl ------------------------------ APR-util stuff diff --git a/include/apr.h.in b/include/apr.h.in index 88f3cac76ce..d4e72f52fb1 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -293,12 +293,12 @@ extern "C" { #define APR_HAS_SO_ACCEPTFILTER @acceptfilter@ #define APR_HAS_UNICODE_FS @have_unicode_fs@ #define APR_HAS_PROC_INVOKED @have_proc_invoked@ -#define APR_HAS_USER 1 +#define APR_HAS_USER @apr_has_user@ #define APR_HAS_LARGE_FILES @aprlfs@ -#define APR_HAS_XTHREAD_FILES 0 +#define APR_HAS_XTHREAD_FILES @apr_has_xthread_files@ #define APR_HAS_OS_UUID @osuuid@ -#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0 +#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD @apr_procattr_user_set_requires_password@ /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible * to poll on files/pipes. @@ -469,7 +469,7 @@ typedef apr_uint32_t apr_uintptr_t; * *
    */ -#define APR_THREAD_FUNC +#define APR_THREAD_FUNC @apr_thread_func@ /** * The public APR functions are declared with APR_DECLARE(), so they may From 12f18ec1da8c79741ebe85602432220557469d76 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 20 Mar 2011 18:36:35 +0000 Subject: [PATCH 6915/7878] Should be sufficient to cause new testlfsabi features to compile git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083532 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/Makefile.win b/test/Makefile.win index 0bcc026cc70..e9e5e884db6 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -103,6 +103,9 @@ ALL_TESTS = \ $(INTDIR)\testipsub.obj \ $(INTDIR)\testldap.obj \ $(INTDIR)\testlfs.obj \ + $(INTDIR)\testlfsabi.obj \ + $(INTDIR)\testlfsabi32.obj \ + $(INTDIR)\testlfsabi64.obj \ $(INTDIR)\testlock.obj \ $(INTDIR)\testmd4.obj \ $(INTDIR)\testmd5.obj \ From 20bca713f40fd2ea7a955a86a0c137fd393eb1f7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 20 Mar 2011 21:47:38 +0000 Subject: [PATCH 6916/7878] include testlfsabi in IDE file selection git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083586 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdll.dsp | 20 ++++++++++++++++++++ test/testlib.dsp | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/test/testdll.dsp b/test/testdll.dsp index 9736fc9ba0a..e19285d457a 100644 --- a/test/testdll.dsp +++ b/test/testdll.dsp @@ -263,6 +263,26 @@ SOURCE=.\testlfs.c # End Source File # Begin Source File +SOURCE=.\testlfsabi.c +# End Source File +# Begin Source File + +SOURCE=.\testlfsabi.h +# End Source File +# Begin Source File + +SOURCE=.\testlfsabi_include.c +# End Source File +# Begin Source File + +SOURCE=.\testlfsabi32.c +# End Source File +# Begin Source File + +SOURCE=.\testlfsabi64.c +# End Source File +# Begin Source File + SOURCE=.\testlock.c # End Source File # Begin Source File diff --git a/test/testlib.dsp b/test/testlib.dsp index d3ab7aaf5c0..93408ca9f2e 100644 --- a/test/testlib.dsp +++ b/test/testlib.dsp @@ -263,6 +263,26 @@ SOURCE=.\testlfs.c # End Source File # Begin Source File +SOURCE=.\testlfsabi.c +# End Source File +# Begin Source File + +SOURCE=.\testlfsabi.h +# End Source File +# Begin Source File + +SOURCE=.\testlfsabi_include.c +# End Source File +# Begin Source File + +SOURCE=.\testlfsabi32.c +# End Source File +# Begin Source File + +SOURCE=.\testlfsabi64.c +# End Source File +# Begin Source File + SOURCE=.\testlock.c # End Source File # Begin Source File From c817d221ef0a3779e9b45a7543236762eb657ca1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 20 Mar 2011 21:57:46 +0000 Subject: [PATCH 6917/7878] fix data initialization error which could cause testhooks to fail git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083590 13f79535-47bb-0310-9956-ffa450edef68 --- test/testhooks.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testhooks.c b/test/testhooks.c index bf5de120d1a..b2b16d4c1eb 100644 --- a/test/testhooks.c +++ b/test/testhooks.c @@ -70,6 +70,7 @@ static void *toy_hook_probe_entry(const char *name) hook_probe_data_t *ud = apr_palloc(probe_buf_pool, sizeof *ud); ud->buf_size = 18; ud->buf = (char *)apr_palloc(probe_buf_pool, ud->buf_size); + ud->buf[0] = '\0'; safe_concat(ud->buf, ud->buf_size, "E"); return (void *)ud; } From 9f2fa1485292aad3f08e8a63052f32c59a965bc2 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 21 Mar 2011 16:01:38 +0000 Subject: [PATCH 6918/7878] Removed expat_config.hnw because wrowe doesnt like it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083852 13f79535-47bb-0310-9956-ffa450edef68 --- xml/NWGNUmakefile | 15 +++++++++++++-- xml/expat_config.hnw | 30 ------------------------------ 2 files changed, 13 insertions(+), 32 deletions(-) delete mode 100644 xml/expat_config.hnw diff --git a/xml/NWGNUmakefile b/xml/NWGNUmakefile index 20c419dcf38..dbbd74cc5ca 100644 --- a/xml/NWGNUmakefile +++ b/xml/NWGNUmakefile @@ -39,9 +39,20 @@ $(EXPATSRC)/lib/%.h: $(EXPATSRC)/lib/%.h.in @echo Creating $@ $(call COPY,$<,$@) -$(EXPATSRC)/lib/%.h: $(CURDIR)/%.hnw +$(EXPATSRC)/lib/expat_config.h: @echo Creating $@ - $(call COPY,$<,$@) + @echo $(DL)/* $(notdir $@) for NetWare platform */$(DL)>>$@ + @echo $(DL)#ifndef NETWARE$(DL)>>$@ + @echo $(DL)#error This $(notdir $@) is for NetWare platform!$(DL)>>$@ + @echo $(DL)#endif$(DL)>>$@ + @echo $(DL)#ifndef EXPAT_CONFIG_H$(DL)>>$@ + @echo $(DL)#define EXPAT_CONFIG_H$(DL)>>$@ + @echo $(DL)#define HAVE_MEMMOVE 1$(DL)>>$@ + @echo $(DL)#define XML_NS 1$(DL)>>$@ + @echo $(DL)#define XML_DTD 1$(DL)>>$@ + @echo $(DL)#define XML_BYTE_ORDER 1234$(DL)>>$@ + @echo $(DL)#define XML_CONTEXT_BYTES 1024$(DL)>>$@ + @echo $(DL)#endif /* EXPAT_CONFIG_H */$(DL)>>$@ vpath %.c $(EXPATSRC)/lib diff --git a/xml/expat_config.hnw b/xml/expat_config.hnw deleted file mode 100644 index ea6428349c2..00000000000 --- a/xml/expat_config.hnw +++ /dev/null @@ -1,30 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef EXPAT_CONFIG_HNW -#define EXPAT_CONFIG_HNW - -#include - -#define HAVE_MEMMOVE 1 - -#define XML_NS 1 -#define XML_DTD 1 -#define XML_BYTE_ORDER 12 -#define XML_CONTEXT_BYTES 1024 - -#endif /* EXPAT_CONFIG_HNW */ - From 60f52898479bf7a8058cfab613d8482863ac879d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 21 Mar 2011 20:15:32 +0000 Subject: [PATCH 6919/7878] use apr_get_netos_error() to retrieve the getaddrinfo() error code on Windows before: error: 681001/APR does not understand this error code after: error: 731001/No such host is known. (the latter matches an IPv4-only build) Submitted by: Ivan Zhakov Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083931 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 28280be853c..3a98267c95b 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -371,12 +371,13 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, } #endif if (error) { -#ifndef WIN32 +#if defined(WIN32) + return apr_get_netos_error(); +#else if (error == EAI_SYSTEM) { return errno; } else -#endif { /* issues with representing this with APR's error scheme: * glibc uses negative values for these numbers, perhaps so @@ -388,6 +389,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, #endif return error + APR_OS_START_EAIERR; } +#endif /* WIN32 */ } prev_sa = NULL; From a54d154857ceeb459ec6f81c917bb815b6a75f7a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 21 Mar 2011 21:44:18 +0000 Subject: [PATCH 6920/7878] fix indentation-over-syntax blunder in r1082963 which broke sockets for Solaris et al git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083975 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index b7b175e11c7..dae8e12165e 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -176,16 +176,18 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, { int flags; - if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1) + if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1) { close((*new)->socketdes); (*new)->socketdes = -1; return errno; + } flags |= FD_CLOEXEC; - if (fcntl((*new)->socketdes, F_SETFD, flags) == -1) + if (fcntl((*new)->socketdes, F_SETFD, flags) == -1) { close((*new)->socketdes); (*new)->socketdes = -1; return errno; + } } #endif From 041805ed486048dfc8f4ef98c865b9f68c54f295 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 21 Mar 2011 23:08:04 +0000 Subject: [PATCH 6921/7878] Fixed issue when compiling serf due to odd defines. The NetWare winsock2 header defines accept which breaks compilation of serf lib, therefore we now undef. Also removed obsolete include of novsock2.h in libprews.c. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1084016 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 9 +++++++-- misc/netware/libprews.c | 3 --- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index b9833ab854e..0dc0c536fb1 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -49,6 +49,11 @@ #include #ifdef USE_WINSOCK #include +/* The NetWare Winsock2 header novsock2.h has macros which define + * accept and connect, but these clash with serf, so we undef them + */ +#undef accept +#undef connect #ifdef NW_BUILD_IPV6 #include #endif @@ -223,11 +228,11 @@ extern "C" { #define APR_CHARSET_EBCDIC 0 /* Is the TCP_NODELAY socket option inherited from listening sockets? -*/ + */ #define APR_TCP_NODELAY_INHERITED 1 /* Is the O_NONBLOCK flag inherited from listening sockets? -*/ + */ #define APR_O_NONBLOCK_INHERITED 1 /* Typedefs that APR needs. */ diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index 023e938ac53..6e37ccf1d39 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -16,9 +16,6 @@ #include #include #include -#ifdef USE_WINSOCK -#include -#endif #include "apr_pools.h" #include "apr_private.h" From c22edcdcd8d1d380f4e7602e8bfe2082fc4610a2 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 22 Mar 2011 01:23:11 +0000 Subject: [PATCH 6922/7878] Reverted undef hack from r1084016 - needs more testing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1084046 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index 0dc0c536fb1..e3e214c7ff2 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -49,11 +49,6 @@ #include #ifdef USE_WINSOCK #include -/* The NetWare Winsock2 header novsock2.h has macros which define - * accept and connect, but these clash with serf, so we undef them - */ -#undef accept -#undef connect #ifdef NW_BUILD_IPV6 #include #endif From 8115302e9d5c0bc7ccdda60d00c65c7edd63d8ea Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 23 Mar 2011 11:24:36 +0000 Subject: [PATCH 6923/7878] Use the ComSpec environment var. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1084541 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUenvironment.inc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 05cd6b5ee7b..d85627f9d2b 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -161,12 +161,11 @@ else ifeq "$(OS)" "Windows_NT" DEL = $(shell if exist $(subst /,\,$1) del /q /f 2>NUL $(subst /,\,$1)) RMDIR = $(shell if exist $(subst /,\,$1)\NUL rd /q /s 2>NUL $(subst /,\,$1)) -ECHONL = cmd /c echo. else DEL = $(shell if exist $(subst /,\,$1) del 2>NUL $(subst /,\,$1)) RMDIR = $(shell if exist $(subst /,\,$1)\NUL deltree /y 2>NUL $(subst /,\,$1)) -ECHONL = command /c echo. endif +ECHONL = $(ComSpec) /c echo. MKDIR = $(shell if not exist $(subst /,\,$1)\NUL md 2>NUL $(subst /,\,$1)) COPY = copy /y 2>NUL $(subst /,\,$1) $(subst /,\,$2) COPYR = xcopy /y /e 2>NUL $(subst /,\,$1) $(subst /,\,$2) From 1666e13ac2f510bd274a9a1cb3fd77f04553c68c Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Wed, 23 Mar 2011 16:01:12 +0000 Subject: [PATCH 6924/7878] Decouple apr_xml from reliance on Expat Build with expat and it's effectively unchanged. The alternative build with libxml2 is compatible to the point that it passes the test suite, but shouldn't be considered ready for primetime! Various hacks want sorting: this is proof-of-concept. This requires a compile-time choice. Runtime would be nice, round tuits permitting. Build hacks & docs TBD git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1084621 13f79535-47bb-0310-9956-ffa450edef68 --- xml/apr_xml.c | 127 +++----------------------------------- xml/apr_xml_expat.c | 134 +++++++++++++++++++++++++++++++++++++++++ xml/apr_xml_internal.h | 50 +++++++++++++++ xml/apr_xml_libxml2.c | 96 +++++++++++++++++++++++++++++ 4 files changed, 290 insertions(+), 117 deletions(-) create mode 100644 xml/apr_xml_expat.c create mode 100644 xml/apr_xml_internal.h create mode 100644 xml/apr_xml_libxml2.c diff --git a/xml/apr_xml.c b/xml/apr_xml.c index f79c80ce8d2..651e40f64c2 100644 --- a/xml/apr_xml.c +++ b/xml/apr_xml.c @@ -23,22 +23,15 @@ #include "apr_want.h" #include "apr_xml.h" - -#if defined(HAVE_XMLPARSE_XMLPARSE_H) -#include -#elif defined(HAVE_XMLTOK_XMLPARSE_H) -#include -#elif defined(HAVE_XML_XMLPARSE_H) -#include -#else -#include -#endif +typedef void* XML_Parser; +typedef int XML_Error; +typedef unsigned char XML_Char; +#include "apr_xml_internal.h" #define DEBUG_CR "\r\n" static const char APR_KW_xmlns[] = { 0x78, 0x6D, 0x6C, 0x6E, 0x73, '\0' }; static const char APR_KW_xmlns_lang[] = { 0x78, 0x6D, 0x6C, 0x3A, 0x6C, 0x61, 0x6E, 0x67, '\0' }; -static const char APR_KW_DAV[] = { 0x44, 0x41, 0x56, 0x3A, '\0' }; /* errors related to namespace processing */ #define APR_XML_NS_ERROR_UNKNOWN_PREFIX (-1000) @@ -51,21 +44,6 @@ static const char APR_KW_DAV[] = { 0x44, 0x41, 0x56, 0x3A, '\0' }; (name[2] == 0x4C || name[2] == 0x6C) ) -/* the real (internal) definition of the parser context */ -struct apr_xml_parser { - apr_xml_doc *doc; /* the doc we're parsing */ - apr_pool_t *p; /* the pool we allocate from */ - apr_xml_elem *cur_elem; /* current element */ - - int error; /* an error has occurred */ -#define APR_XML_ERROR_EXPAT 1 -#define APR_XML_ERROR_PARSE_DONE 2 -/* also: public APR_XML_NS_ERROR_* values (if any) */ - - XML_Parser xp; /* the actual (Expat) XML parser */ - enum XML_Error xp_err; /* stored Expat error code */ -}; - /* struct for scoping namespace declarations */ typedef struct apr_xml_ns_scope { const char *prefix; /* prefix used for this ns */ @@ -139,7 +117,7 @@ static void start_handler(void *userdata, const char *name, const char **attrs) elem->name = elem_name = apr_pstrdup(parser->p, name); /* fill in the attributes (note: ends up in reverse order) */ - while (*attrs) { + while (attrs && *attrs) { attr = apr_palloc(parser->p, sizeof(*attr)); attr->name = apr_pstrdup(parser->p, *attrs++); attr->value = apr_pstrdup(parser->p, *attrs++); @@ -336,111 +314,26 @@ static void cdata_handler(void *userdata, const char *data, int len) apr_text_append(parser->p, hdr, s); } -static apr_status_t cleanup_parser(void *ctx) -{ - apr_xml_parser *parser = ctx; - - XML_ParserFree(parser->xp); - parser->xp = NULL; - - return APR_SUCCESS; -} - -#if XML_MAJOR_VERSION > 1 -/* Stop the parser if an entity declaration is hit. */ -static void entity_declaration(void *userData, const XML_Char *entityName, - int is_parameter_entity, const XML_Char *value, - int value_length, const XML_Char *base, - const XML_Char *systemId, const XML_Char *publicId, - const XML_Char *notationName) -{ - apr_xml_parser *parser = userData; - - XML_StopParser(parser->xp, XML_FALSE); -} -#else -/* A noop default_handler. */ -static void default_handler(void *userData, const XML_Char *s, int len) -{ -} -#endif - APR_DECLARE(apr_xml_parser *) apr_xml_parser_create(apr_pool_t *pool) { - apr_xml_parser *parser = apr_pcalloc(pool, sizeof(*parser)); - - parser->p = pool; - parser->doc = apr_pcalloc(pool, sizeof(*parser->doc)); - - parser->doc->namespaces = apr_array_make(pool, 5, sizeof(const char *)); - - /* ### is there a way to avoid hard-coding this? */ - apr_xml_insert_uri(parser->doc->namespaces, APR_KW_DAV); - - parser->xp = XML_ParserCreate(NULL); - if (parser->xp == NULL) { - (*apr_pool_abort_get(pool))(APR_ENOMEM); - return NULL; - } - - apr_pool_cleanup_register(pool, parser, cleanup_parser, - apr_pool_cleanup_null); - - XML_SetUserData(parser->xp, parser); - XML_SetElementHandler(parser->xp, start_handler, end_handler); - XML_SetCharacterDataHandler(parser->xp, cdata_handler); - - /* Prevent the "billion laughs" attack against expat by disabling - * internal entity expansion. With 2.x, forcibly stop the parser - * if an entity is declared - this is safer and a more obvious - * failure mode. With older versions, installing a noop - * DefaultHandler means that internal entities will be expanded as - * the empty string, which is also sufficient to prevent the - * attack. */ -#if XML_MAJOR_VERSION > 1 - XML_SetEntityDeclHandler(parser->xp, entity_declaration); -#else - XML_SetDefaultHandler(parser->xp, default_handler); -#endif - - return parser; -} - -static apr_status_t do_parse(apr_xml_parser *parser, - const char *data, apr_size_t len, - int is_final) -{ - if (parser->xp == NULL) { - parser->error = APR_XML_ERROR_PARSE_DONE; - } - else { - int rv = XML_Parse(parser->xp, data, (int)len, is_final); - - if (rv == 0) { - parser->error = APR_XML_ERROR_EXPAT; - parser->xp_err = XML_GetErrorCode(parser->xp); - } - } - - /* ### better error code? */ - return parser->error ? APR_EGENERAL : APR_SUCCESS; + return apr_xml_parser_create_ex(pool, &start_handler, &end_handler, &cdata_handler); } APR_DECLARE(apr_status_t) apr_xml_parser_feed(apr_xml_parser *parser, const char *data, apr_size_t len) { - return do_parse(parser, data, len, 0 /* is_final */); + return parser->impl->Parse(parser, data, len, 0 /* is_final */); } APR_DECLARE(apr_status_t) apr_xml_parser_done(apr_xml_parser *parser, apr_xml_doc **pdoc) { char end; - apr_status_t status = do_parse(parser, &end, 0, 1 /* is_final */); + apr_status_t status = parser->impl->Parse(parser, &end, 0, 1 /* is_final */); /* get rid of the parser */ - (void) apr_pool_cleanup_run(parser->p, parser, cleanup_parser); + (void) apr_pool_cleanup_run(parser->p, parser, parser->impl->cleanup); if (status) return status; @@ -476,7 +369,7 @@ APR_DECLARE(char *) apr_xml_parser_geterror(apr_xml_parser *parser, case APR_XML_ERROR_EXPAT: (void) apr_snprintf(errbuf, errbufsize, "XML parser error code: %s (%d)", - XML_ErrorString(parser->xp_err), parser->xp_err); + parser->xp_msg, parser->xp_err); return errbuf; case APR_XML_ERROR_PARSE_DONE: diff --git a/xml/apr_xml_expat.c b/xml/apr_xml_expat.c new file mode 100644 index 00000000000..6d986a6aa56 --- /dev/null +++ b/xml/apr_xml_expat.c @@ -0,0 +1,134 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr.h" +#include "apr_xml.h" + +typedef enum XML_Error XML_Error; +#if defined(HAVE_XMLPARSE_XMLPARSE_H) +#include +#elif defined(HAVE_XMLTOK_XMLPARSE_H) +#include +#elif defined(HAVE_XML_XMLPARSE_H) +#include +#else +#include +#endif + + +#include "apr_xml_internal.h" + +static apr_status_t cleanup_parser(void *ctx) +{ + apr_xml_parser *parser = ctx; + + XML_ParserFree(parser->xp); + parser->xp = NULL; + + return APR_SUCCESS; +} +static apr_status_t do_parse(apr_xml_parser *parser, + const char *data, apr_size_t len, + int is_final) +{ + if (parser->xp == NULL) { + parser->error = APR_XML_ERROR_PARSE_DONE; + } + else { + int rv = XML_Parse(parser->xp, data, (int)len, is_final); + + if (rv == 0) { + parser->error = APR_XML_ERROR_EXPAT; + parser->xp_err = XML_GetErrorCode(parser->xp); + parser->xp_msg = XML_ErrorString(parser->xp_err); + } + } + + /* ### better error code? */ + return parser->error ? APR_EGENERAL : APR_SUCCESS; +} + + +static XMLParserImpl xml_parser_expat = { + do_parse, + cleanup_parser +}; + +XMLParserImpl* apr_xml_get_parser_impl(void) { return &xml_parser_expat; } +static const char APR_KW_DAV[] = { 0x44, 0x41, 0x56, 0x3A, '\0' }; + +#if XML_MAJOR_VERSION > 1 +/* Stop the parser if an entity declaration is hit. */ +static void entity_declaration(void *userData, const XML_Char *entityName, + int is_parameter_entity, const XML_Char *value, + int value_length, const XML_Char *base, + const XML_Char *systemId, const XML_Char *publicId, + const XML_Char *notationName) +{ + apr_xml_parser *parser = userData; + + XML_StopParser(parser->xp, XML_FALSE); +} +#else +/* A noop default_handler. */ +static void default_handler(void *userData, const XML_Char *s, int len) +{ +} +#endif + +APR_DECLARE(apr_xml_parser *) apr_xml_parser_create_ex(apr_pool_t *pool, + void *start_func, void *end_func, void *cdata_func) +{ + apr_xml_parser *parser = apr_pcalloc(pool, sizeof(*parser)); + + parser->impl = apr_xml_get_parser_impl(); + + parser->p = pool; + parser->doc = apr_pcalloc(pool, sizeof(*parser->doc)); + + parser->doc->namespaces = apr_array_make(pool, 5, sizeof(const char *)); + + /* ### is there a way to avoid hard-coding this? */ + apr_xml_insert_uri(parser->doc->namespaces, APR_KW_DAV); + + parser->xp = XML_ParserCreate(NULL); + if (parser->xp == NULL) { + (*apr_pool_abort_get(pool))(APR_ENOMEM); + return NULL; + } + + apr_pool_cleanup_register(pool, parser, cleanup_parser, + apr_pool_cleanup_null); + + XML_SetUserData(parser->xp, parser); + XML_SetElementHandler(parser->xp, start_func, end_func); + XML_SetCharacterDataHandler(parser->xp, cdata_func); + + /* Prevent the "billion laughs" attack against expat by disabling + * internal entity expansion. With 2.x, forcibly stop the parser + * if an entity is declared - this is safer and a more obvious + * failure mode. With older versions, installing a noop + * DefaultHandler means that internal entities will be expanded as + * the empty string, which is also sufficient to prevent the + * attack. */ +#if XML_MAJOR_VERSION > 1 + XML_SetEntityDeclHandler(parser->xp, entity_declaration); +#else + XML_SetDefaultHandler(parser->xp, default_handler); +#endif + + return parser; +} diff --git a/xml/apr_xml_internal.h b/xml/apr_xml_internal.h new file mode 100644 index 00000000000..573d1d5914a --- /dev/null +++ b/xml/apr_xml_internal.h @@ -0,0 +1,50 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_XML_INTERNAL_H +#define APR_XML_INTERNAL_H + + +struct XMLParserImpl { + apr_status_t (*Parse)(apr_xml_parser*, const char*, apr_size_t, int); + apr_status_t (*cleanup)(void*); +}; +typedef struct XMLParserImpl XMLParserImpl; +XMLParserImpl* apr_xml_get_parser_impl(void); + + +/* the real (internal) definition of the parser context */ +struct apr_xml_parser { + apr_xml_doc *doc; /* the doc we're parsing */ + apr_pool_t *p; /* the pool we allocate from */ + apr_xml_elem *cur_elem; /* current element */ + + int error; /* an error has occurred */ +#define APR_XML_ERROR_EXPAT 1 +#define APR_XML_ERROR_PARSE_DONE 2 +/* also: public APR_XML_NS_ERROR_* values (if any) */ + + XML_Parser xp; /* the actual (Expat) XML parser */ + XML_Error xp_err; /* stored Expat error code */ + const char *xp_msg; + XMLParserImpl *impl; +}; + + + +apr_xml_parser *apr_xml_parser_create_ex(apr_pool_t*, void*, void*, void*); + +#endif diff --git a/xml/apr_xml_libxml2.c b/xml/apr_xml_libxml2.c new file mode 100644 index 00000000000..a765f2359e9 --- /dev/null +++ b/xml/apr_xml_libxml2.c @@ -0,0 +1,96 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr.h" +#include "apr_xml.h" + +#include +#include + +typedef xmlParserCtxtPtr XML_Parser; +typedef xmlParserErrors XML_Error; + +#include "apr_xml_internal.h" + +static apr_status_t cleanup_parser(void *ctx) +{ + apr_xml_parser *parser = ctx; + + xmlFreeParserCtxt(parser->xp); + parser->xp = NULL; + + return APR_SUCCESS; +} +static int libxml2_parse(apr_xml_parser* parser, const char* data, + apr_size_t sz, int final) +{ + parser->xp_err = xmlParseChunk(parser->xp, data, sz, final); + if (parser->xp_err != 0) { + xmlErrorPtr errptr = xmlCtxtGetLastError(parser->xp); + parser->xp_msg = errptr->message; + /* this misnomer is used as a test for (any) parser error. */ + parser->error = APR_XML_ERROR_EXPAT; + } + return parser->xp_err; +} +static XMLParserImpl xml_parser_libxml2 = { + libxml2_parse, + cleanup_parser +}; + +static const char APR_KW_DAV[] = { 0x44, 0x41, 0x56, 0x3A, '\0' }; + +XMLParserImpl* apr_xml_get_parser_impl(void) +{ + return &xml_parser_libxml2; +} + + +APR_DECLARE(apr_xml_parser *) apr_xml_parser_create_ex(apr_pool_t *pool, + void *start_func, void *end_func, void *cdata_func) +{ + apr_xml_parser *parser = apr_pcalloc(pool, sizeof(*parser)); + /* FIXME: This is a mismatch. We should create a single global + * sax instance and re-use it for every parser. That means we + * need an up-front initialisation function. + */ + xmlSAXHandlerPtr sax = apr_pcalloc(pool, sizeof(xmlSAXHandler)); + sax->startElement = start_func; + sax->endElement = end_func; + sax->characters = cdata_func; + sax->initialized = 1; + + parser->impl = apr_xml_get_parser_impl(); + + parser->p = pool; + parser->doc = apr_pcalloc(pool, sizeof(*parser->doc)); + + parser->doc->namespaces = apr_array_make(pool, 5, sizeof(const char *)); + + /* ### is there a way to avoid hard-coding this? */ + apr_xml_insert_uri(parser->doc->namespaces, APR_KW_DAV); + + parser->xp = xmlCreatePushParserCtxt(sax, parser, NULL, 0, NULL); + if (parser->xp == NULL) { + (*apr_pool_abort_get(pool))(APR_ENOMEM); + return NULL; + } + + apr_pool_cleanup_register(pool, parser, cleanup_parser, + apr_pool_cleanup_null); + + return parser; +} From 687535dd447ce984be013845577d30febbba8ecd Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Wed, 23 Mar 2011 17:29:35 +0000 Subject: [PATCH 6925/7878] Patch netware auto-build apr_xml_expat. Flying blind here; I have only the auto-build run to go on, so this may be missing the mark. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1084650 13f79535-47bb-0310-9956-ffa450edef68 --- xml/NWGNUmakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/xml/NWGNUmakefile b/xml/NWGNUmakefile index dbbd74cc5ca..3c96ad0e613 100644 --- a/xml/NWGNUmakefile +++ b/xml/NWGNUmakefile @@ -261,6 +261,7 @@ FILES_nlm_exports = \ # FILES_lib_objs = \ $(OBJDIR)/apr_xml.o \ + $(OBJDIR)/apr_xml_expat.o \ $(EOLIST) ifdef EXPATSRC From 0289a449d310b9eca8fed7580ddefd41265eb6db Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 23 Mar 2011 18:13:27 +0000 Subject: [PATCH 6926/7878] fix typo in comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1084659 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index dae8e12165e..c718b1bc0de 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -268,7 +268,7 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, /* Set up socket variables -- note that it may be possible for * *new to be an AF_INET socket when sock is AF_INET6 in some - * dual-stack configurations, so ensure the the remote_/local_addr + * dual-stack configurations, so ensure that the remote_/local_addr * structures are adjusted for the family of the accepted * socket: */ set_socket_vars(*new, sa.sa.sin.sin_family, SOCK_STREAM, sock->protocol); From 22ad036d314bbd3686cb04aa56e37f93890f2ada Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 23 Mar 2011 18:17:38 +0000 Subject: [PATCH 6927/7878] fix extra "the" in comments and license text git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1084662 13f79535-47bb-0310-9956-ffa450edef68 --- LICENSE | 4 ++-- include/apr_network_io.h | 2 +- include/apr_shm.h | 2 +- memcache/apr_memcache.c | 2 +- network_io/unix/sendrecv.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LICENSE b/LICENSE index 02418e19136..cf0fb63058a 100644 --- a/LICENSE +++ b/LICENSE @@ -206,8 +206,8 @@ APACHE PORTABLE RUNTIME SUBCOMPONENTS: The Apache Portable Runtime includes a number of subcomponents with separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. +code for these subcomponents is subject to the terms and conditions +of the following licenses. From strings/apr_fnmatch.c, include/apr_fnmatch.h, misc/unix/getopt.c, file_io/unix/mktemp.c, strings/apr_strings.c: diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 292cc586a74..82d2e822b93 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -710,7 +710,7 @@ APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, /** * Return an address associated with a socket; either the address to - * which the socket is bound locally or the the address of the peer + * which the socket is bound locally or the address of the peer * to which the socket is connected. * @param sa The returned apr_sockaddr_t. * @param which Whether to retrieve the local or remote address diff --git a/include/apr_shm.h b/include/apr_shm.h index e830b96e1c8..f47492ff47a 100644 --- a/include/apr_shm.h +++ b/include/apr_shm.h @@ -81,7 +81,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, * name-based shared memory segments, and will return APR_ENOTIMPL on * platforms without such support. Removing the file while the shm * is in use is not entirely portable, caller may use this to enhance - * obscurity of the resource, but be prepared for the the call to fail, + * obscurity of the resource, but be prepared for the call to fail, * and for concurrent attempts to create a resource of the same name * to also fail. The pool cleanup of apr_shm_create (apr_shm_destroy) * also removes the named resource. diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index 51c411d7b29..064baee0489 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -181,7 +181,7 @@ apr_memcache_find_server_hash_default(void *baton, apr_memcache_t *mc, #if APR_HAS_THREADS apr_thread_mutex_lock(ms->lock); #endif - /* Try the the dead server, every 5 seconds */ + /* Try the dead server, every 5 seconds */ if (curtime - ms->btime > apr_time_from_sec(5)) { if (mc_version_ping(ms) == APR_SUCCESS) { ms->btime = curtime; diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index b19ff5c3f94..133b2ce768b 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -553,7 +553,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, /* On early versions of FreeBSD sendfile, the number of bytes to send * must include the length of the headers. Don't look at the man page - * for this :( Instead, look at the the logic in + * for this :( Instead, look at the logic in * src/sys/kern/uipc_syscalls::sendfile(). * * This was fixed in the middle of 4.6-STABLE From 875822cac16c3c6dee63fb6e3bec63bff99e5faa Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 23 Mar 2011 19:19:25 +0000 Subject: [PATCH 6928/7878] small simplification to the fix in r1065258: just use the Oracle datatype for the type field (http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28395/ociaahan.htm#sthref5358) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1084681 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_oracle.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dbd/apr_dbd_oracle.c b/dbd/apr_dbd_oracle.c index 832677d909f..a851e1f925c 100644 --- a/dbd/apr_dbd_oracle.c +++ b/dbd/apr_dbd_oracle.c @@ -178,7 +178,7 @@ struct apr_dbd_prepared_t { define_arg *out; apr_dbd_t *handle; apr_pool_t *pool; - int type; + ub2 type; }; /* AFAICT from the docs, the OCIEnv thingey can be used async @@ -860,7 +860,6 @@ static int dbd_oracle_prepare(apr_pool_t *pool, apr_dbd_t *sql, int ret = 0; int i; apr_dbd_prepared_t *stmt ; - apr_int16_t type; if (*statement == NULL) { *statement = apr_pcalloc(pool, sizeof(apr_dbd_prepared_t)); @@ -896,12 +895,11 @@ static int dbd_oracle_prepare(apr_pool_t *pool, apr_dbd_t *sql, apr_pool_cleanup_null); /* Perl gets statement type here */ - sql->status = OCIAttrGet(stmt->stmt, OCI_HTYPE_STMT, &type, 0, + sql->status = OCIAttrGet(stmt->stmt, OCI_HTYPE_STMT, &stmt->type, 0, OCI_ATTR_STMT_TYPE, sql->err); if (sql->status != OCI_SUCCESS) { return 1; } - stmt->type = type; /* Perl sets PREFETCH_MEMORY here, but the docs say there's a working default */ #if 0 From 1267ee9ea530af412bba0c9aa6645e234f673496 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 23 Mar 2011 19:25:00 +0000 Subject: [PATCH 6929/7878] yank these entries inherited from apr-1.4.x or apr-util-1.3.x git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1084688 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/CHANGES b/CHANGES index ce4431600e2..31b913b041c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,19 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) Add new configure option --enable-allocator-uses-mmap to use mmap - instead of malloc in apr_allocator_alloc(). This greatly reduces - memory fragmentation with malloc implementations (e.g. glibc) that - don't handle allocationss of a page-size-multiples in an efficient way. - It also makes apr_allocator_max_free_set() actually have some effect - on such platforms. [Stefan Fritsch] - - *) apr_dbd_oracle: fix endianness issue in prepared statements - PR 50690 [Stefan Ruppert ] - - *) Fix address handling when accepting an AF_INET socket from a socket - bound as AF_INET6. PR 49678. [Joe Orton] - *) Hide apr_wait_for_io_or_timeout() from public view and add instead apr_socket_wait() and apr_file_pipe_wait(). [Brian Havard] From ce599d57248e6a6b7bdc7514206ceebfd2b18d51 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 23 Mar 2011 21:40:49 +0000 Subject: [PATCH 6930/7878] WSAPoll() was in 1.4.0 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1084759 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGES b/CHANGES index 31b913b041c..0d20944408e 100644 --- a/CHANGES +++ b/CHANGES @@ -26,9 +26,6 @@ Changes for APR 2.0.0 *) Added Unix domain socket support. [Mladen Turk] - *) Win32: Use WSAPoll as default pollset method if supported and found - inside winsock dll. [Mladen Turk] - *) Introduce APR_PERMS_SET macros for setting the owner/group on objects Currently only implemented for shm, proc and global mutexes on posix platforms. [Mladen Turk] From c6584aff90a3d51b3dd8cb26d967eb96368a86f4 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Thu, 24 Mar 2011 05:46:53 +0000 Subject: [PATCH 6931/7878] Fixed expat build; set new files to eol-style native. Submitted by: NormW git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1084848 13f79535-47bb-0310-9956-ffa450edef68 --- xml/apr_xml_expat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/apr_xml_expat.c b/xml/apr_xml_expat.c index 6d986a6aa56..239ebe504b3 100644 --- a/xml/apr_xml_expat.c +++ b/xml/apr_xml_expat.c @@ -17,7 +17,6 @@ #include "apr.h" #include "apr_xml.h" -typedef enum XML_Error XML_Error; #if defined(HAVE_XMLPARSE_XMLPARSE_H) #include #elif defined(HAVE_XMLTOK_XMLPARSE_H) @@ -28,6 +27,7 @@ typedef enum XML_Error XML_Error; #include #endif +typedef enum XML_Error XML_Error; #include "apr_xml_internal.h" From 476d95f950fbc7b1518231a108ad4054f2b43e0c Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Fri, 25 Mar 2011 12:42:53 +0000 Subject: [PATCH 6932/7878] Support selection of libxml2 vs expat in autoconf build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1085350 13f79535-47bb-0310-9956-ffa450edef68 --- build/apu-conf.m4 | 111 ---------------------- build/xml.m4 | 211 ++++++++++++++++++++++++++++++++++++++++++ configure.in | 5 +- include/apr.h.in | 3 + xml/apr_xml_expat.c | 3 + xml/apr_xml_libxml2.c | 3 + 6 files changed, 223 insertions(+), 113 deletions(-) create mode 100644 build/xml.m4 diff --git a/build/apu-conf.m4 b/build/apu-conf.m4 index a727e58706e..a4078226db0 100644 --- a/build/apu-conf.m4 +++ b/build/apu-conf.m4 @@ -46,117 +46,6 @@ AC_DEFUN([APU_FIND_APR], [ AC_SUBST(APR_BUILD_DIR) ]) -dnl -dnl APU_TRY_EXPAT_LINK( -dnl test-message, cache-var-name, hdrs, libs, -dnl [actions-on-success], [actions-on-failure]) -dnl -dnl Tests linking against expat with libraries 'libs' and includes -dnl 'hdrs', passing message + cache-var-name to AC_CACHE_CHECK. -dnl On success, sets $expat_libs to libs, sets $apu_have_expat to 1, -dnl and runs actions-on-success; on failure runs actions-on-failure. -dnl -AC_DEFUN([APU_TRY_EXPAT_LINK], [ -AC_CACHE_CHECK([$1], [$2], [ - apu_expat_LIBS=$LIBS - apu_expat_CPPFLAGS=$CPPFLAGS - LIBS="$LIBS $4" - CPPFLAGS="$CPPFLAGS $INCLUDES" - AC_TRY_LINK([#include -#include <$3>], [XML_ParserCreate(NULL);], - [$2=yes], [$2=no]) - LIBS=$apu_expat_LIBS - CPPFLAGS=$apu_expat_CPPFLAGS -]) - -if test $[$2] = yes; then - AC_DEFINE([HAVE_]translit([$3], [a-z./], [A-Z__]), 1, - [Define if $3 is available]) - apu_expat_libs="$4" - apu_has_expat=1 - $5 -else - apu_has_expat=0 - $6 -fi -]) - -dnl -dnl APU_SYSTEM_EXPAT: tests for a system expat installation -dnl If present, sets $apu_has_expat to 1 and adjusts LDFLAGS/CPPFLAGS -dnl appropriately. This is mostly for compatibility with existing -dnl expat releases; all but the first APU_TRY_EXPAT_LINK call could -dnl be dropped later. -dnl -AC_DEFUN([APU_SYSTEM_EXPAT], [ - - APU_TRY_EXPAT_LINK([Expat 1.95.x], apu_cv_expat_system, - [expat.h], [-lexpat]) - - if test $apu_has_expat = 0; then - APU_TRY_EXPAT_LINK([old Debian-packaged expat], apu_cv_expat_debian, - [xmltok/xmlparse.h], [-lxmlparse -lxmltok]) - fi - - if test $apu_has_expat = 0; then - APU_TRY_EXPAT_LINK([old FreeBSD-packaged expat], apu_cv_expat_freebsd, - [xml/xmlparse.h], [-lexpat]) - fi - - if test $apu_has_expat = 0; then - APU_TRY_EXPAT_LINK([Expat 1.0/1.1], apu_cv_expat_1011, - [xmlparse/xmlparse.h], [-lexpat]) - fi - - if test $apu_has_expat = 0; then - APR_ADDTO(LDFLAGS, [-L/usr/local/lib]) - APR_ADDTO(INCLUDES, [-I/usr/local/include]) - - APU_TRY_EXPAT_LINK([Expat 1.95.x in /usr/local], - apu_cv_expat_usrlocal, [expat.h], [-lexpat], [], [ - APR_REMOVEFROM(LDFLAGS, [-L/usr/local/lib]) - APR_REMOVEFROM(INCLUDES, [-I/usr/local/include]) - ]) - fi -]) - - -dnl -dnl APU_FIND_EXPAT: figure out where EXPAT is located (or use bundled) -dnl -AC_DEFUN([APU_FIND_EXPAT], [ - -save_cppflags="$CPPFLAGS" - -apu_has_expat=0 - -AC_ARG_WITH([expat], -[ --with-expat=DIR specify Expat location], [ - if test "$withval" = "yes"; then - AC_MSG_ERROR([a directory must be specified for --with-expat]) - elif test "$withval" = "no"; then - AC_MSG_ERROR([Expat cannot be disabled (at this time)]) - else - # Add given path to standard search paths if appropriate: - if test "$withval" != "/usr"; then - APR_ADDTO(INCLUDES, [-I$withval/include]) - APR_ADDTO(LDFLAGS, [-L$withval/lib]) - fi - fi -]) - -APU_SYSTEM_EXPAT -test ${apu_has_expat} != "1" && AC_MSG_ERROR(could not find Expat) - -APR_ADDTO(APRUTIL_EXPORT_LIBS, [$apu_expat_libs]) -APR_ADDTO(LIBS, [$apu_expat_libs]) - -APR_XML_DIR=$bundled_subdir -AC_SUBST(APR_XML_DIR) - -CPPFLAGS=$save_cppflags -]) - dnl dnl Find a particular LDAP library diff --git a/build/xml.m4 b/build/xml.m4 new file mode 100644 index 00000000000..7c8ad2d768e --- /dev/null +++ b/build/xml.m4 @@ -0,0 +1,211 @@ +dnl -------------------------------------------------------- -*- autoconf -*- +dnl Licensed to the Apache Software Foundation (ASF) under one or more +dnl contributor license agreements. See the NOTICE file distributed with +dnl this work for additional information regarding copyright ownership. +dnl The ASF licenses this file to You under the Apache License, Version 2.0 +dnl (the "License"); you may not use this file except in compliance with +dnl the License. You may obtain a copy of the License at +dnl +dnl http://www.apache.org/licenses/LICENSE-2.0 +dnl +dnl Unless required by applicable law or agreed to in writing, software +dnl distributed under the License is distributed on an "AS IS" BASIS, +dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +dnl See the License for the specific language governing permissions and +dnl limitations under the License. + + +dnl +dnl APU_TRY_EXPAT_LINK( +dnl test-message, cache-var-name, hdrs, libs, +dnl [actions-on-success], [actions-on-failure]) +dnl +dnl Tests linking against expat with libraries 'libs' and includes +dnl 'hdrs', passing message + cache-var-name to AC_CACHE_CHECK. +dnl On success, sets $expat_libs to libs, sets $apu_has_expat to 1, +dnl and runs actions-on-success; on failure runs actions-on-failure. +dnl +AC_DEFUN([APU_TRY_EXPAT_LINK], [ +AC_CACHE_CHECK([$1], [$2], [ + apu_expat_LIBS=$LIBS + apu_expat_CPPFLAGS=$CPPFLAGS + LIBS="$LIBS $4" + CPPFLAGS="$CPPFLAGS $INCLUDES" + AC_TRY_LINK([#include +#include <$3>], [XML_ParserCreate(NULL);], + [$2=yes], [$2=no]) + LIBS=$apu_expat_LIBS + CPPFLAGS=$apu_expat_CPPFLAGS +]) + +if test $[$2] = yes; then + AC_DEFINE([HAVE_]translit([$3], [a-z./], [A-Z__]), 1, + [Define if $3 is available]) + apu_expat_libs="$4" + apu_has_expat=1 + $5 + AC_SUBST(apu_has_expat) +else + apu_has_expat=0 + $6 +fi +]) + +dnl +dnl APU_SYSTEM_EXPAT: tests for a system expat installation +dnl If present, sets $apu_has_expat to 1 and adjusts LDFLAGS/CPPFLAGS +dnl appropriately. This is mostly for compatibility with existing +dnl expat releases; all but the first APU_TRY_EXPAT_LINK call could +dnl be dropped later. +dnl +AC_DEFUN([APU_SYSTEM_EXPAT], [ + + APU_TRY_EXPAT_LINK([Expat 1.95.x], apu_cv_expat_system, + [expat.h], [-lexpat]) + + if test $apu_has_expat = 0; then + APU_TRY_EXPAT_LINK([old Debian-packaged expat], apu_cv_expat_debian, + [xmltok/xmlparse.h], [-lxmlparse -lxmltok]) + fi + + if test $apu_has_expat = 0; then + APU_TRY_EXPAT_LINK([old FreeBSD-packaged expat], apu_cv_expat_freebsd, + [xml/xmlparse.h], [-lexpat]) + fi + + if test $apu_has_expat = 0; then + APU_TRY_EXPAT_LINK([Expat 1.0/1.1], apu_cv_expat_1011, + [xmlparse/xmlparse.h], [-lexpat]) + fi + + if test $apu_has_expat = 0; then + APR_ADDTO(LDFLAGS, [-L/usr/local/lib]) + APR_ADDTO(INCLUDES, [-I/usr/local/include]) + + APU_TRY_EXPAT_LINK([Expat 1.95.x in /usr/local], + apu_cv_expat_usrlocal, [expat.h], [-lexpat], [], [ + APR_REMOVEFROM(LDFLAGS, [-L/usr/local/lib]) + APR_REMOVEFROM(INCLUDES, [-I/usr/local/include]) + ]) + fi +]) + + +dnl +dnl APU_FIND_EXPAT: figure out where EXPAT is located (or use bundled) +dnl +AC_DEFUN([APU_FIND_EXPAT], [ + +save_cppflags="$CPPFLAGS" + +apu_has_expat=0 + +AC_ARG_WITH([expat], +[ --with-expat=DIR specify Expat location], [ + if test "$withval" = "yes"; then + AC_MSG_ERROR([a directory must be specified for --with-expat]) + elif test "$withval" = "no"; then + if test "$apu_has_libxml2" != "1"; then + AC_MSG_ERROR([An XML parser is required! If you disable expat, you must select --with-libxml2]) + fi + else + # Add given path to standard search paths if appropriate: + if test "$apu_has_libxml2" = "1"; then + AC_MSG_ERROR(Cannot build with both expat and libxml2 - please select one) + fi + if test "$withval" != "/usr"; then + APR_ADDTO(INCLUDES, [-I$withval/include]) + APR_ADDTO(LDFLAGS, [-L$withval/lib]) + fi + fi +]) + +if test "$apu_has_libxml2" != "1"; then + APU_SYSTEM_EXPAT + + APR_ADDTO(APRUTIL_EXPORT_LIBS, [$apu_expat_libs]) + APR_ADDTO(LIBS, [$apu_expat_libs]) + + APR_XML_DIR=$bundled_subdir + AC_SUBST(APR_XML_DIR) +fi + +CPPFLAGS=$save_cppflags +]) + + +dnl +dnl APU_FIND_LIBXML2: figure out where LIBXML2 is located (or use bundled) +dnl +AC_DEFUN([APU_FIND_LIBXML2], [ + +save_cppflags="$CPPFLAGS" + +apu_has_libxml2=0 +apu_try_libxml2=0 + +AC_ARG_WITH([libxml2], +[ --with-libxml2=DIR specify libxml2 location], [ + if test "$withval" = "yes"; then + apu_try_libxml2=1 + APR_ADDTO(INCLUDES, [-I/usr/include/libxml2]) + elif test "$withval" != "no"; then + apu_try_libxml2=1 + APR_ADDTO(INCLUDES, [-I$withval/include/libxml2]) + if test "$withval" != "/usr"; then + APR_ADDTO(LDFLAGS, [-L$withval/lib]) + fi + fi + if test ${apu_try_libxml2} = "1" ; then + + #test for libxml2 + AC_CACHE_CHECK([libxml2], [apu_cv_libxml2], [ + apu_libxml2_CPPFLAGS=$CPPFLAGS + apu_libxml2_LIBS="$LIBS -lxml2" + CPPFLAGS="$CPPFLAGS $INCLUDES" + LIBS="$LIBS -lxml2" + AC_TRY_LINK( + [#include ], + [xmlSAXHandler sax; xmlCreatePushParserCtxt(&sax, NULL, NULL, 0, NULL);], + [apu_cv_libxml2=yes], + [apu_cv_libxml2=no], + ) + CPPFLAGS=$apu_libxml2_CPPFLAGS + LIBS=$apu_libxml2_LIBS + ]) + if test $apu_cv_libxml2 = yes ; then + AC_DEFINE([HAVE_LIBXML2_H], 1, [libxml2 found]) + apu_has_libxml2=1 + else + apu_has_libxml2=0 + fi + fi +]) +AC_SUBST(apu_has_libxml2) + +if test ${apu_has_libxml2} = "1" ; then + APR_ADDTO(APRUTIL_EXPORT_LIBS, [-lxml2]) + APR_ADDTO(LIBS, [-lxml2]) +fi + +CPPFLAGS=$save_cppflags +]) + +dnl +dnl APU_FIND_XML: Find an XML library +dnl +dnl Logic: we need exactly one but not both XML libraries +dnl Make expat the default for back-compatibility. +dnl Use libxml2 if a --with-libxml2 is specified (and works), +dnl otherwise expat. +dnl +AC_DEFUN([APU_FIND_XML], [ +APU_FIND_LIBXML2 +APU_FIND_EXPAT + +if test ${apu_has_expat} = "1" && test ${apu_has_libxml2} = "1" ; then + AC_MSG_ERROR(Cannot build with both expat and libxml2 - please select one) +elif test ${apu_has_expat} != "1" && test ${apu_has_libxml2} != "1" ; then + AC_MSG_ERROR(No XML parser found! Please specify --with-expat or --with-libxml2) +fi +]) diff --git a/configure.in b/configure.in index f265c9db58b..b9e5fa37c79 100644 --- a/configure.in +++ b/configure.in @@ -27,6 +27,7 @@ sinclude(build/ltversion.m4) sinclude(build/lt~obsolete.m4) sinclude(build/apu-conf.m4) +sinclude(build/xml.m4) sinclude(build/apu-hints.m4) sinclude(build/crypto.m4) sinclude(build/dbm.m4) @@ -2598,8 +2599,8 @@ APU_CHECK_DBD_ORACLE APU_CHECK_DBD_FREETDS APU_CHECK_DBD_ODBC -dnl Find Expat -APU_FIND_EXPAT +dnl select an XML parser +APU_FIND_XML dnl Find iconv implementations APU_FIND_ICONV diff --git a/include/apr.h.in b/include/apr.h.in index d4e72f52fb1..aff8dbbf264 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -667,6 +667,9 @@ typedef int apr_wait_t; #define APU_HAVE_ICONV @have_iconv@ #define APR_HAS_XLATE (APU_HAVE_ICONV) +#define APU_USE_EXPAT @apu_has_expat@ +#define APU_USE_LIBXML2 @apu_has_libxml2@ + /* Definitions that only Win32 programs need to compile properly. */ /* XXX These simply don't belong here, perhaps in apr_portable.h diff --git a/xml/apr_xml_expat.c b/xml/apr_xml_expat.c index 239ebe504b3..ed7571bdc5a 100644 --- a/xml/apr_xml_expat.c +++ b/xml/apr_xml_expat.c @@ -15,6 +15,8 @@ */ #include "apr.h" + +#if APU_USE_EXPAT #include "apr_xml.h" #if defined(HAVE_XMLPARSE_XMLPARSE_H) @@ -132,3 +134,4 @@ APR_DECLARE(apr_xml_parser *) apr_xml_parser_create_ex(apr_pool_t *pool, return parser; } +#endif diff --git a/xml/apr_xml_libxml2.c b/xml/apr_xml_libxml2.c index a765f2359e9..46f28546bd6 100644 --- a/xml/apr_xml_libxml2.c +++ b/xml/apr_xml_libxml2.c @@ -15,6 +15,8 @@ */ #include "apr.h" + +#if APU_USE_LIBXML2 #include "apr_xml.h" #include @@ -94,3 +96,4 @@ APR_DECLARE(apr_xml_parser *) apr_xml_parser_create_ex(apr_pool_t *pool, return parser; } +#endif From 5d6c7e7b5c1def669bb58f9c6162ac8b4e783acf Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Fri, 25 Mar 2011 12:49:39 +0000 Subject: [PATCH 6933/7878] Add CHANGES note for libxml2 support git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1085351 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 0d20944408e..b66ae46e6b3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Support libxml2 as an alternative XML parser to expat [Nick Kew] + *) Hide apr_wait_for_io_or_timeout() from public view and add instead apr_socket_wait() and apr_file_pipe_wait(). [Brian Havard] From 88118dbbe5af9d48a6758ec7ab2fdf521092f014 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 25 Mar 2011 16:45:00 +0000 Subject: [PATCH 6934/7878] Added blocking for MSVC pragma. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1085462 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/win32/apr_atomic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index 973c679e5ea..1ed7df893d8 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -54,7 +54,9 @@ APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint3 } /* Of course we want the 2's compliment of the unsigned value, val */ +#ifdef _MSC_VER #pragma warning(disable: 4146) +#endif APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) { From d8319bcc31928949ef6556806d20f4502eb40109 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 25 Mar 2011 16:55:59 +0000 Subject: [PATCH 6935/7878] Added prototype for getpid. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1085469 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 1f5fd2d970f..021ce9d5ddd 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -29,6 +29,9 @@ #if APR_HAVE_SYS_STAT_H #include #endif +#if APR_HAVE_PROCESS_H +#include /* for getpid() on Win32 */ +#endif #include "apr_arch_misc.h" APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, From 69f8da9366ce9ded280410560117ce2b10671b35 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Fri, 25 Mar 2011 17:03:14 +0000 Subject: [PATCH 6936/7878] Expunge naughty tabs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1085473 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index aff8dbbf264..37bce00e995 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -63,10 +63,10 @@ #define __attribute__(__x) #endif #define APR_INLINE -#define APR_HAS_INLINE 0 +#define APR_HAS_INLINE 0 #else #define APR_INLINE __inline__ -#define APR_HAS_INLINE 1 +#define APR_HAS_INLINE 1 #endif #define APR_HAVE_ARPA_INET_H @arpa_ineth@ @@ -384,7 +384,7 @@ typedef apr_uint32_t apr_uintptr_t; #endif /* Are we big endian? */ -#define APR_IS_BIGENDIAN @bigendian@ +#define APR_IS_BIGENDIAN @bigendian@ /* Mechanisms to properly type numeric literals */ @int64_literal@ @@ -600,9 +600,9 @@ typedef apr_uint32_t apr_uintptr_t; #undef APR_IS_BIGENDIAN #ifdef __BIG_ENDIAN__ - #define APR_IS_BIGENDIAN 1 + #define APR_IS_BIGENDIAN 1 #else - #define APR_IS_BIGENDIAN 0 + #define APR_IS_BIGENDIAN 0 #endif #undef APR_OFF_T_FMT @@ -668,7 +668,7 @@ typedef int apr_wait_t; #define APR_HAS_XLATE (APU_HAVE_ICONV) #define APU_USE_EXPAT @apu_has_expat@ -#define APU_USE_LIBXML2 @apu_has_libxml2@ +#define APU_USE_LIBXML2 @apu_has_libxml2@ /* Definitions that only Win32 programs need to compile properly. */ From 07d7bbd6347e476857b5d26f530b09d31335c4f6 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 25 Mar 2011 19:18:53 +0000 Subject: [PATCH 6937/7878] Added define to build with expat. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1085525 13f79535-47bb-0310-9956-ffa450edef68 --- xml/NWGNUmakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/xml/NWGNUmakefile b/xml/NWGNUmakefile index 3c96ad0e613..02f08e87962 100644 --- a/xml/NWGNUmakefile +++ b/xml/NWGNUmakefile @@ -79,6 +79,7 @@ XCFLAGS += \ # These defines will come after DEFINES # XDEFINES += \ + -DAPU_USE_EXPAT=1 \ -DHAVE_EXPAT_CONFIG_H \ $(EOLIST) From fe6ad7ac4d320e35533afc7b7da979944bce37c8 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sat, 26 Mar 2011 06:24:48 +0000 Subject: [PATCH 6938/7878] Moved apr_os_uuid_get prototype out of APR_HAS_DSO block. This avoids a missing prototype warning since the function's C code gets compiled independent of APR_HAS_DSO. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1085655 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 7e52afc4f28..c915fd037a0 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -471,6 +471,10 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **dso, APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso, apr_dso_handle_t *aprdso); +/** @} */ +#endif /* APR_HAS_DSO */ + + #if APR_HAS_OS_UUID /** * Private: apr-util's apr_uuid module when supported by the platform @@ -478,9 +482,6 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso, APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data); #endif -/** @} */ -#endif /* APR_HAS_DSO */ - /** * Get the name of the system default character set. From e17050e36c9f85c2123f974cd3123b27e276764c Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sat, 26 Mar 2011 07:06:18 +0000 Subject: [PATCH 6939/7878] Fixed process.h detection with configure builds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1085660 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + include/apr.h.in | 1 + 2 files changed, 2 insertions(+) diff --git a/configure.in b/configure.in index b9e5fa37c79..c2321da103f 100644 --- a/configure.in +++ b/configure.in @@ -1391,6 +1391,7 @@ AC_SUBST(timeh) AC_SUBST(unistdh) AC_SUBST(signalh) AC_SUBST(sys_waith) +AC_SUBST(processh) AC_SUBST(pthreadh) AC_SUBST(semaphoreh) AC_SUBST(windowsh) diff --git a/include/apr.h.in b/include/apr.h.in index 37bce00e995..10c6b1ade25 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -85,6 +85,7 @@ #define APR_HAVE_NETINET_SCTP_H @netinet_sctph@ #define APR_HAVE_NETINET_SCTP_UIO_H @netinet_sctp_uioh@ #define APR_HAVE_NETINET_TCP_H @netinet_tcph@ +#define APR_HAVE_PROCESS_H @processh@ #define APR_HAVE_PTHREAD_H @pthreadh@ #define APR_HAVE_SEMAPHORE_H @semaphoreh@ #define APR_HAVE_SIGNAL_H @signalh@ From 3c72980bdf258272e0c8472776629f8431f6f7b2 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 27 Mar 2011 13:57:28 +0000 Subject: [PATCH 6940/7878] Set APR_HAS_OS_UUID=1 for Windows builds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1085937 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index c2321da103f..59eaeb30b81 100644 --- a/configure.in +++ b/configure.in @@ -557,6 +557,7 @@ case $host in ac_cv_file__dev_zero="no" ac_cv_func_setpgrp_void="no" apr_cv_tcp_nodelay_with_cork="no" + apr_cv_osuuid="yes" apr_cv_use_lfs64="yes" enable_threads="system_threads" eolstr="\\r\\n" From ec329fd24f6135f505ef8ea3490da6291b8aecac Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 27 Mar 2011 16:00:39 +0000 Subject: [PATCH 6941/7878] Revert r1085937 per Jeff's suggestion. Such defines should go into build/apr_hints.m4. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1085974 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.in b/configure.in index 59eaeb30b81..c2321da103f 100644 --- a/configure.in +++ b/configure.in @@ -557,7 +557,6 @@ case $host in ac_cv_file__dev_zero="no" ac_cv_func_setpgrp_void="no" apr_cv_tcp_nodelay_with_cork="no" - apr_cv_osuuid="yes" apr_cv_use_lfs64="yes" enable_threads="system_threads" eolstr="\\r\\n" From 0b4c376de07a338ad07d6c77cbe142c2c87050e3 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 27 Mar 2011 16:09:44 +0000 Subject: [PATCH 6942/7878] Removed duplicate already set in build/apr_hints.m4. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1085976 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.in b/configure.in index c2321da103f..273ed306a56 100644 --- a/configure.in +++ b/configure.in @@ -557,7 +557,6 @@ case $host in ac_cv_file__dev_zero="no" ac_cv_func_setpgrp_void="no" apr_cv_tcp_nodelay_with_cork="no" - apr_cv_use_lfs64="yes" enable_threads="system_threads" eolstr="\\r\\n" file_as_socket="0" From 0336aec9cbb1867b6526c6bf394d6fc3fbab3686 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 27 Mar 2011 16:24:31 +0000 Subject: [PATCH 6943/7878] Moved platform-specific stuff to build/apr_hints.m4. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1085978 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 10 +++++++--- configure.in | 5 ----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index ebb1c517058..2784dff9dd9 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -442,16 +442,20 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DCYGWIN]) ;; *mingw*) + APR_ADDTO(CPPFLAGS, [-DWIN32]) APR_ADDTO(LDFLAGS, [-Wl,--enable-auto-import,--subsystem,console]) - APR_SETIFNULL(apr_lock_method, [win32]) - APR_SETIFNULL(apr_process_lock_is_global, [yes]) APR_SETIFNULL(have_unicode_fs, [1]) APR_SETIFNULL(have_proc_invoked, [1]) + APR_SETIFNULL(apr_lock_method, [win32]) + APR_SETIFNULL(apr_process_lock_is_global, [yes]) APR_SETIFNULL(apr_cv_use_lfs64, [yes]) APR_SETIFNULL(apr_cv_osuuid, [yes]) + APR_SETIFNULL(apr_cv_tcp_nodelay_with_cork, [no]) + APR_SETIFNULL(apr_thread_func, [__stdcall]) APR_SETIFNULL(ac_cv_o_nonblock_inherited, [yes]) APR_SETIFNULL(ac_cv_tcp_nodelay_inherited, [yes]) - APR_SETIFNULL(apr_thread_func, [__stdcall]) + APR_SETIFNULL(ac_cv_file__dev_zero, [no]) + APR_SETIFNULL(ac_cv_func_setpgrp_void, [no]) case $host in *mingw32*) APR_SETIFNULL(apr_has_xthread_files, [1]) diff --git a/configure.in b/configure.in index 273ed306a56..3728c5048b5 100644 --- a/configure.in +++ b/configure.in @@ -553,10 +553,6 @@ case $host in ;; *-mingw*) OSDIR="win32" - APR_ADDTO(CPPFLAGS,-DWIN32) - ac_cv_file__dev_zero="no" - ac_cv_func_setpgrp_void="no" - apr_cv_tcp_nodelay_with_cork="no" enable_threads="system_threads" eolstr="\\r\\n" file_as_socket="0" @@ -565,7 +561,6 @@ case $host in ;; *cygwin*) OSDIR="unix" - APR_ADDTO(CPPFLAGS,-DCYGWIN) enable_threads="no" eolstr="\\n" ;; From dbbfdec98085748434dfc68c308a1472d7396b9c Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 27 Mar 2011 16:50:30 +0000 Subject: [PATCH 6944/7878] Fixed mingw platform identifier to catch all cross compilers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1085985 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 3728c5048b5..30d6e851fdd 100644 --- a/configure.in +++ b/configure.in @@ -551,11 +551,11 @@ case $host in OSDIR="as400" eolstr="\\n" ;; - *-mingw*) + *mingw*) OSDIR="win32" enable_threads="system_threads" eolstr="\\r\\n" - file_as_socket="0" + file_as_socket=0 proc_mutex_is_global=1 OBJECTS_PLATFORM='$(OBJECTS_win32)' ;; From 2056cafb801d68d106170a3f508b22a97595e4e2 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 28 Mar 2011 05:32:20 +0000 Subject: [PATCH 6945/7878] Fixed protection of our own struct iovec define. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1086125 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_want.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/include/apr_want.h b/include/apr_want.h index 6b2fbde453e..2863b0018a1 100644 --- a/include/apr_want.h +++ b/include/apr_want.h @@ -89,19 +89,16 @@ #else +#ifndef APR_IOVEC_DEFINED +#define APR_IOVEC_DEFINED struct iovec { void *iov_base; size_t iov_len; }; +#endif /* !APR_IOVEC_DEFINED */ -#endif - -/* apr_want is included at several layers; redefining APR_HAVE_IOVEC - * now to ensure that our struct is not introduced several times. - */ -#undef APR_HAVE_IOVEC -#define APR_HAVE_IOVEC 1 +#endif /* APR_HAVE_IOVEC */ #undef APR_WANT_IOVEC #endif From 8aea84f92621365e1a00cab88a4487e778e30d26 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 29 Mar 2011 13:38:21 +0000 Subject: [PATCH 6946/7878] NetWare awk export script fixes and cleanup. Remove trailing line endings with Linux builds; sync'd add_symbol function with HEAD and moved to top; added License header where missing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1086579 13f79535-47bb-0310-9956-ffa450edef68 --- build/make_nw_export.awk | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index e1c2021cece..60835eb2f59 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -18,7 +18,13 @@ # based on Ryan Bloom's make_export.pl BEGIN { - printf(" ("EXPPREFIX")\n") + printf(" (%s)\n", EXPPREFIX) +} + +function add_symbol(sym_name) { + found++ + sub(" ", "", sym_name) + printf(" %s,\n", sym_name) } # List of functions that we don't support, yet?? @@ -75,10 +81,9 @@ BEGIN { #} /^[ \t]*AP[RUI]?_DECLARE_DATA .*;/ { - varname = $NF; - gsub( /[*;]/, "", varname); - gsub( /\[.*\]/, "", varname); - add_symbol(varname); + gsub(/[*;\n\r]/, "", $NF) + gsub(/\[.*\]/, "", $NF) + add_symbol($NF) } @@ -87,10 +92,3 @@ END { # printf("\n\n#found: %d symbols.\n", found) } -function add_symbol(sym_name) { - found++ - sub (" ", "", sym_name) - printf(" %s,\n", sym_name) -} - - From dc9195c76d75ab02ff2409801c2998b6148084ce Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 29 Mar 2011 15:28:54 +0000 Subject: [PATCH 6947/7878] Added / moved comments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1086627 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 10c6b1ade25..a6ecdf80d3e 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -120,10 +120,10 @@ * or the extern "C" namespace */ +#if APR_HAVE_WINDOWS_H /* If windows.h was already included, our preferences don't matter. * If not, include a restricted set of windows headers to our tastes. */ -#if APR_HAVE_WINDOWS_H #ifndef _WINDOWS_ #ifndef WIN32_LEAN_AND_MEAN @@ -152,8 +152,8 @@ #endif #include -#endif -#endif +#endif /* ndef _WINDOWS_ */ +#endif /* APR_HAVE_WINDOWS_H */ #if APR_HAVE_WINSOCK2_H #include From a7251a32a3e9d95006fb12e466bbf6e9d6a181ed Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 29 Mar 2011 15:38:00 +0000 Subject: [PATCH 6948/7878] Added __MSVCRT__ for MinGW builds. This is required to get the prototype for _beginthreadex(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1086631 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 2784dff9dd9..4cf7882ec87 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -442,7 +442,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DCYGWIN]) ;; *mingw*) - APR_ADDTO(CPPFLAGS, [-DWIN32]) + APR_ADDTO(CPPFLAGS, [-DWIN32 -D__MSVCRT__]) APR_ADDTO(LDFLAGS, [-Wl,--enable-auto-import,--subsystem,console]) APR_SETIFNULL(have_unicode_fs, [1]) APR_SETIFNULL(have_proc_invoked, [1]) From df1c2cd0d10e44d3189dea587c5c2166e5499ece Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 29 Mar 2011 15:49:27 +0000 Subject: [PATCH 6949/7878] Fixed apr_ino_t typedef for MinGW builds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1086633 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index 30d6e851fdd..0db0f5ac518 100644 --- a/configure.in +++ b/configure.in @@ -1720,15 +1720,24 @@ AC_MSG_RESULT($off_t_value) # releases did. To be correct, apr_ino_t should have been made an # ino64_t as apr_off_t is off64_t, but this can't be done now without # breaking ABI. -ino_t_value=ino_t -APR_CHECK_SIZEOF_EXTENDED(AC_INCLUDES_DEFAULT, ino_t, $ac_cv_sizeof_long) -if test $ac_cv_sizeof_ino_t = 4; then - if test $ac_cv_sizeof_long = 4; then - ino_t_value="unsigned long" - else - ino_t_value="unsigned int" + +# Per OS tuning... +case $host in +*mingw*) + ino_t_value=apr_int64_t + ;; +*) + ino_t_value=ino_t + APR_CHECK_SIZEOF_EXTENDED(AC_INCLUDES_DEFAULT, ino_t, $ac_cv_sizeof_long) + if test $ac_cv_sizeof_ino_t = 4; then + if test $ac_cv_sizeof_long = 4; then + ino_t_value="unsigned long" + else + ino_t_value="unsigned int" + fi fi -fi + ;; +esac AC_MSG_NOTICE([using $ino_t_value for ino_t]) # Checks for endianness From 58c093a6dfc77c704b713061a1193257bf0b2e1d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 29 Mar 2011 18:23:37 +0000 Subject: [PATCH 6950/7878] axe some commented-out mingw logic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1086666 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/configure.in b/configure.in index 0db0f5ac518..0f884e8fc23 100644 --- a/configure.in +++ b/configure.in @@ -679,8 +679,6 @@ dnl without the extra " " in that case, but they didn't do that. So, we dnl end up LIBS="-lm -lcrypt -lnsl -ldl" which is an annoyance. case $host in *-mingw*) - dnl APR_ADDTO(LIBS,[-lmsvcrt --lshell32 -ladvapi32 -lws2_32]) - AC_CHECK_LIB(msvcrt, getpid) APR_CHECK_DLL_FUNC(kernel32, SetErrorMode@4) APR_CHECK_DLL_FUNC(advapi32, GetSecurityInfo@32) @@ -1599,8 +1597,6 @@ case $host in size_t_fmt="lu" ;; *-mingw*) -dnl int64_literal='#define APR_INT64_C(val) (val##i64)' -dnl uint64_literal='#define APR_UINT64_C(val) (val##Ui64)' int64_t_fmt='#define APR_INT64_T_FMT "I64d"' uint64_t_fmt='#define APR_UINT64_T_FMT "I64u"' uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "I64x"' @@ -2742,15 +2738,6 @@ for i in $APR_SAVE_HEADERS; do rm -f $i.save done chmod +x apr-$APR_MAJOR_VERSION-config -# for mingw builds, we currently won't allow the unix apr_private.h to exist. -# instead, we will rely on the manually-crafted win32 apr_private.h instead. -case $APR_PLATFORM in - *-mingw*) -dnl XXX rm include/arch/unix/apr_private.h - ;; - *) - ;; -esac ],[ dnl This section is expanded by configure UNQUOTED so variable dnl references must be backslash-escaped as necessary. From 1baa7a020ca44c50b3340ff8770d4131ffdcfbed Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 29 Mar 2011 18:44:16 +0000 Subject: [PATCH 6951/7878] access the def'n of APR_HAS_LDAP, used later in the file git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1086679 13f79535-47bb-0310-9956-ffa450edef68 --- include/private/apu_internal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/private/apu_internal.h b/include/private/apu_internal.h index 8d9a8f8f60f..868dabaaf07 100644 --- a/include/private/apu_internal.h +++ b/include/private/apu_internal.h @@ -17,6 +17,7 @@ #include "apr.h" #include "apr_dso.h" #include "apu.h" +#include "apr_ldap.h" #ifndef APU_INTERNAL_H #define APU_INTERNAL_H From 28b0c38115222e13987d2062b1df3b461af2fe93 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 29 Mar 2011 19:25:28 +0000 Subject: [PATCH 6952/7878] don't override parameter 'flags' within a block (icc complains, I sympathize) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1086692 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 696710867b2..8013ead9331 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -104,13 +104,13 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, #ifndef HAVE_EPOLL_CREATE1 { - int flags; + int fd_flags; - if ((flags = fcntl(fd, F_GETFD)) == -1) + if ((fd_flags = fcntl(fd, F_GETFD)) == -1) return errno; - flags |= FD_CLOEXEC; - if (fcntl(fd, F_SETFD, flags) == -1) + fd_flags |= FD_CLOEXEC; + if (fcntl(fd, F_SETFD, fd_flags) == -1) return errno; } #endif @@ -346,13 +346,13 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, #ifndef HAVE_EPOLL_CREATE1 { - int flags; + int fd_flags; - if ((flags = fcntl(fd, F_GETFD)) == -1) + if ((fd_flags = fcntl(fd, F_GETFD)) == -1) return errno; - flags |= FD_CLOEXEC; - if (fcntl(fd, F_SETFD, flags) == -1) + fd_flags |= FD_CLOEXEC; + if (fcntl(fd, F_SETFD, fd_flags) == -1) return errno; } #endif From 214a440487ccbf644c25ab942741ba97c1fcaa35 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 29 Mar 2011 19:30:22 +0000 Subject: [PATCH 6953/7878] fix a bit of 'if FOO'/'ifdef FOO' confusion git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1086695 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- file_io/unix/pipe.c | 8 ++++---- file_io/unix/readwrite.c | 2 +- include/arch/unix/apr_arch_threadproc.h | 2 +- support/unix/waitio.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index 0f884e8fc23..6f41774bdee 100644 --- a/configure.in +++ b/configure.in @@ -49,7 +49,7 @@ AH_TOP([ dnl Hard-coded inclusion at the tail end of apr_private.h: AH_BOTTOM([ /* switch this on if we have a BeOS version below BONE */ -#if BEOS && !HAVE_BONE_VERSION +#if defined(BEOS) && !defined(HAVE_BONE_VERSION) #define BEOS_R5 1 #else #define BEOS_BONE 1 diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 7b8f01fb92a..571d9bcb8e9 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -25,8 +25,8 @@ * but now fcntl does, hence we need to do this extra checking. * The joys of beta programs. :-) */ -#if BEOS -#if !BONE7 +#if defined(BEOS) +#if !defined(BONE7) # define BEOS_BLOCKING 1 #else # define BEOS_BLOCKING 0 @@ -35,7 +35,7 @@ static apr_status_t pipeblock(apr_file_t *thepipe) { -#if !BEOS_BLOCKING +#if !defined(BEOS) || !BEOS_BLOCKING int fd_flags; fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); @@ -71,7 +71,7 @@ static apr_status_t pipeblock(apr_file_t *thepipe) static apr_status_t pipenonblock(apr_file_t *thepipe) { -#if !BEOS_BLOCKING +#if !defined(BEOS) || !BEOS_BLOCKING int fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); # if defined(O_NONBLOCK) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index f1287387730..98de9e0e119 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -23,7 +23,7 @@ /* The only case where we don't use wait_for_io_or_timeout is on * pre-BONE BeOS, so this check should be sufficient and simpler */ -#if !BEOS_R5 +#if !defined(BEOS_R5) #define USE_WAIT_FOR_IO #endif diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h index ebe5d358a5e..7a3b3c0925b 100644 --- a/include/arch/unix/apr_arch_threadproc.h +++ b/include/arch/unix/apr_arch_threadproc.h @@ -40,7 +40,7 @@ #if APR_HAVE_STRING_H #include #endif -#if HAVE_SCHED_H +#ifdef HAVE_SCHED_H #include #endif /* End System Headers */ diff --git a/support/unix/waitio.c b/support/unix/waitio.c index 19b8b1d6ba2..0d762ea6dd6 100644 --- a/support/unix/waitio.c +++ b/support/unix/waitio.c @@ -22,7 +22,7 @@ /* The only case where we don't use wait_for_io_or_timeout is on * pre-BONE BeOS, so this check should be sufficient and simpler */ -#if !BEOS_R5 && !defined(OS2) && APR_FILES_AS_SOCKETS +#if !defined(BEOS_R5) && !defined(OS2) && APR_FILES_AS_SOCKETS #define USE_WAIT_FOR_IO #endif From 7d958270120af85ac4f636f352075afc993334f1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 29 Mar 2011 22:27:32 +0000 Subject: [PATCH 6954/7878] catch up with XML changes, supporting only expat for now git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1086789 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++++ include/apr.hw | 3 +++ libapr.dsp | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/apr.dsp b/apr.dsp index 4319878fb31..0ed2491b8c2 100644 --- a/apr.dsp +++ b/apr.dsp @@ -766,6 +766,10 @@ SOURCE=.\xlate\xlate.c SOURCE=.\xml\apr_xml.c # End Source File +# Begin Source File + +SOURCE=.\xml\apr_xml_expat.c +# End Source File # End Group # End Group # Begin Group "Private Header Files" diff --git a/include/apr.hw b/include/apr.hw index ddbb25c82c8..a98636e12b4 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -660,6 +660,9 @@ typedef int apr_wait_t; #define APU_HAVE_ICONV 0 #define APR_HAS_XLATE (APU_HAVE_ICONV) +#define APU_USE_EXPAT 1 +#define APU_USE_LIBXML2 0 + /** @} */ /* Definitions that only Win32 programs need to compile properly. */ diff --git a/libapr.dsp b/libapr.dsp index 6ad0be5943b..1f96fdfbded 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -801,6 +801,10 @@ SOURCE=.\xlate\xlate.c SOURCE=.\xml\apr_xml.c # End Source File +# Begin Source File + +SOURCE=.\xml\apr_xml_expat.c +# End Source File # End Group # End Group # Begin Group "Private Header Files" From 956078414ef56d679bc91234c233158fc3c26a20 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 29 Mar 2011 22:29:05 +0000 Subject: [PATCH 6955/7878] fix linkage of apr_parser_create_ex() on Windows Submitted by: Carlo Bramini PR: tiny part of 46175 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1086790 13f79535-47bb-0310-9956-ffa450edef68 --- xml/apr_xml_internal.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/xml/apr_xml_internal.h b/xml/apr_xml_internal.h index 573d1d5914a..7c1ee8744f1 100644 --- a/xml/apr_xml_internal.h +++ b/xml/apr_xml_internal.h @@ -43,8 +43,6 @@ struct apr_xml_parser { XMLParserImpl *impl; }; - - -apr_xml_parser *apr_xml_parser_create_ex(apr_pool_t*, void*, void*, void*); +APR_DECLARE(apr_xml_parser *) apr_xml_parser_create_ex(apr_pool_t*, void*, void*, void*); #endif From aded42823e20117938e2c28976eafdde7984c09d Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 30 Mar 2011 12:50:17 +0000 Subject: [PATCH 6956/7878] Removed tabs + trailing spaces. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1086937 13f79535-47bb-0310-9956-ffa450edef68 --- hooks/apr_hooks.c | 252 +++++++++++++++++++++++----------------------- 1 file changed, 126 insertions(+), 126 deletions(-) diff --git a/hooks/apr_hooks.c b/hooks/apr_hooks.c index 82a3a65c90d..dc3a20dfa64 100644 --- a/hooks/apr_hooks.c +++ b/hooks/apr_hooks.c @@ -30,7 +30,7 @@ #include "apr_want.h" #if 0 -#define apr_palloc(pool,size) malloc(size) +#define apr_palloc(pool,size) malloc(size) #endif APR_DECLARE_DATA apr_pool_t *apr_hook_global_pool = NULL; @@ -84,44 +84,44 @@ static TSort *prepare(apr_pool_t *p,TSortData *pItems,int nItems) { TSort *pData=apr_palloc(p,nItems*sizeof *pData); int n; - + qsort(pItems,nItems,sizeof *pItems,crude_order); for(n=0 ; n < nItems ; ++n) { - pData[n].nPredecessors=0; - pData[n].ppPredecessors=apr_pcalloc(p,nItems*sizeof *pData[n].ppPredecessors); - pData[n].pNext=NULL; - pData[n].pData=&pItems[n]; + pData[n].nPredecessors=0; + pData[n].ppPredecessors=apr_pcalloc(p,nItems*sizeof *pData[n].ppPredecessors); + pData[n].pNext=NULL; + pData[n].pData=&pItems[n]; } for(n=0 ; n < nItems ; ++n) { - int i,k; - - for(i=0 ; pItems[n].aszPredecessors && pItems[n].aszPredecessors[i] ; ++i) - for(k=0 ; k < nItems ; ++k) - if(!strcmp(pItems[k].szName,pItems[n].aszPredecessors[i])) { - int l; - - for(l=0 ; l < pData[n].nPredecessors ; ++l) - if(pData[n].ppPredecessors[l] == &pData[k]) - goto got_it; - pData[n].ppPredecessors[pData[n].nPredecessors]=&pData[k]; - ++pData[n].nPredecessors; - got_it: - break; - } - for(i=0 ; pItems[n].aszSuccessors && pItems[n].aszSuccessors[i] ; ++i) - for(k=0 ; k < nItems ; ++k) - if(!strcmp(pItems[k].szName,pItems[n].aszSuccessors[i])) { - int l; - - for(l=0 ; l < pData[k].nPredecessors ; ++l) - if(pData[k].ppPredecessors[l] == &pData[n]) - goto got_it2; - pData[k].ppPredecessors[pData[k].nPredecessors]=&pData[n]; - ++pData[k].nPredecessors; - got_it2: - break; - } + int i,k; + + for(i=0 ; pItems[n].aszPredecessors && pItems[n].aszPredecessors[i] ; ++i) + for(k=0 ; k < nItems ; ++k) + if(!strcmp(pItems[k].szName,pItems[n].aszPredecessors[i])) { + int l; + + for(l=0 ; l < pData[n].nPredecessors ; ++l) + if(pData[n].ppPredecessors[l] == &pData[k]) + goto got_it; + pData[n].ppPredecessors[pData[n].nPredecessors]=&pData[k]; + ++pData[n].nPredecessors; + got_it: + break; + } + for(i=0 ; pItems[n].aszSuccessors && pItems[n].aszSuccessors[i] ; ++i) + for(k=0 ; k < nItems ; ++k) + if(!strcmp(pItems[k].szName,pItems[n].aszSuccessors[i])) { + int l; + + for(l=0 ; l < pData[k].nPredecessors ; ++l) + if(pData[k].ppPredecessors[l] == &pData[n]) + goto got_it2; + pData[k].ppPredecessors[pData[k].nPredecessors]=&pData[n]; + ++pData[k].nPredecessors; + got_it2: + break; + } } return pData; @@ -143,49 +143,49 @@ static TSort *tsort(TSort *pData,int nItems) TSort *pTail=NULL; for(nTotal=0 ; nTotal < nItems ; ++nTotal) { - int n,i,k; - - for(n=0 ; ; ++n) { - if(n == nItems) - assert(0); /* we have a loop... */ - if(!pData[n].pNext) { - if(pData[n].nPredecessors) { - for(k=0 ; ; ++k) { - assert(k < nItems); - if(pData[n].ppPredecessors[k]) - break; - } - for(i=0 ; ; ++i) { - assert(i < nItems); - if(&pData[i] == pData[n].ppPredecessors[k]) { - n=i-1; - break; - } - } - } else - break; - } - } - if(pTail) - pTail->pNext=&pData[n]; - else - pHead=&pData[n]; - pTail=&pData[n]; - pTail->pNext=pTail; /* fudge it so it looks linked */ - for(i=0 ; i < nItems ; ++i) - for(k=0 ; k < nItems ; ++k) - if(pData[i].ppPredecessors[k] == &pData[n]) { - --pData[i].nPredecessors; - pData[i].ppPredecessors[k]=NULL; - break; - } + int n,i,k; + + for(n=0 ; ; ++n) { + if(n == nItems) + assert(0); /* we have a loop... */ + if(!pData[n].pNext) { + if(pData[n].nPredecessors) { + for(k=0 ; ; ++k) { + assert(k < nItems); + if(pData[n].ppPredecessors[k]) + break; + } + for(i=0 ; ; ++i) { + assert(i < nItems); + if(&pData[i] == pData[n].ppPredecessors[k]) { + n=i-1; + break; + } + } + } else + break; + } + } + if(pTail) + pTail->pNext=&pData[n]; + else + pHead=&pData[n]; + pTail=&pData[n]; + pTail->pNext=pTail; /* fudge it so it looks linked */ + for(i=0 ; i < nItems ; ++i) + for(k=0 ; k < nItems ; ++k) + if(pData[i].ppPredecessors[k] == &pData[n]) { + --pData[i].nPredecessors; + pData[i].ppPredecessors[k]=NULL; + break; + } } pTail->pNext=NULL; /* unfudge the tail */ return pHead; } static apr_array_header_t *sort_hook(apr_array_header_t *pHooks, - const char *szName) + const char *szName) { apr_pool_t *p; TSort *pSort; @@ -197,17 +197,17 @@ static apr_array_header_t *sort_hook(apr_array_header_t *pHooks, pSort=tsort(pSort,pHooks->nelts); pNew=apr_array_make(apr_hook_global_pool,pHooks->nelts,sizeof(TSortData)); if(apr_hook_debug_enabled) - printf("Sorting %s:",szName); + printf("Sorting %s:",szName); for(n=0 ; pSort ; pSort=pSort->pNext,++n) { - TSortData *pHook; - assert(n < pHooks->nelts); - pHook=apr_array_push(pNew); - memcpy(pHook,pSort->pData,sizeof *pHook); - if(apr_hook_debug_enabled) - printf(" %s",pHook->szName); + TSortData *pHook; + assert(n < pHooks->nelts); + pHook=apr_array_push(pNew); + memcpy(pHook,pSort->pData,sizeof *pHook); + if(apr_hook_debug_enabled) + printf(" %s",pHook->szName); } if(apr_hook_debug_enabled) - fputc('\n',stdout); + fputc('\n',stdout); return pNew; } @@ -222,7 +222,7 @@ typedef struct } HookSortEntry; APR_DECLARE(void) apr_hook_sort_register(const char *szHookName, - apr_array_header_t **paHooks) + apr_array_header_t **paHooks) { #ifdef NETWARE get_apd @@ -246,10 +246,10 @@ APR_DECLARE(void) apr_hook_sort_all(void) if (!s_aHooksToSort) { s_aHooksToSort = apr_array_make(apr_hook_global_pool, 1, sizeof(HookSortEntry)); } - + for(n=0 ; n < s_aHooksToSort->nelts ; ++n) { - HookSortEntry *pEntry=&((HookSortEntry *)s_aHooksToSort->elts)[n]; - *pEntry->paHooks=sort_hook(*pEntry->paHooks,pEntry->szHookName); + HookSortEntry *pEntry=&((HookSortEntry *)s_aHooksToSort->elts)[n]; + *pEntry->paHooks=sort_hook(*pEntry->paHooks,pEntry->szHookName); } } @@ -263,7 +263,7 @@ APR_DECLARE(void) apr_hook_deregister_all(void) #ifdef NETWARE get_apd #endif - int n; + int n; if (!s_aHooksToSort) { return; @@ -280,34 +280,34 @@ APR_DECLARE(void) apr_hook_deregister_all(void) APR_DECLARE(void) apr_hook_debug_show(const char *szName, const char * const *aszPre, - const char * const *aszSucc) + const char * const *aszSucc) { int nFirst; printf(" Hooked %s",szName); if(aszPre) { - fputs(" pre(",stdout); - nFirst=1; - while(*aszPre) { - if(!nFirst) - fputc(',',stdout); - nFirst=0; - fputs(*aszPre,stdout); - ++aszPre; - } - fputc(')',stdout); + fputs(" pre(",stdout); + nFirst=1; + while(*aszPre) { + if(!nFirst) + fputc(',',stdout); + nFirst=0; + fputs(*aszPre,stdout); + ++aszPre; + } + fputc(')',stdout); } if(aszSucc) { - fputs(" succ(",stdout); - nFirst=1; - while(*aszSucc) { - if(!nFirst) - fputc(',',stdout); - nFirst=0; - fputs(*aszSucc,stdout); - ++aszSucc; - } - fputc(')',stdout); + fputs(" succ(",stdout); + nFirst=1; + while(*aszSucc) { + if(!nFirst) + fputc(',',stdout); + nFirst=0; + fputs(*aszSucc,stdout); + ++aszSucc; + } + fputc(')',stdout); } fputc('\n',stdout); } @@ -324,16 +324,16 @@ APR_DECLARE(apr_array_header_t *) apr_optional_hook_get(const char *szName) apr_array_header_t **ppArray; if(!s_phOptionalHooks) - return NULL; + return NULL; ppArray=apr_hash_get(s_phOptionalHooks,szName,strlen(szName)); if(!ppArray) - return NULL; + return NULL; return *ppArray; } APR_DECLARE(void) apr_optional_hook_add(const char *szName,void (*pfn)(void), - const char * const *aszPre, - const char * const *aszSucc,int nOrder) + const char * const *aszPre, + const char * const *aszSucc,int nOrder) { #ifdef NETWARE get_apd @@ -342,16 +342,16 @@ APR_DECLARE(void) apr_optional_hook_add(const char *szName,void (*pfn)(void), apr_LINK__optional_t *pHook; if(!pArray) { - apr_array_header_t **ppArray; - - pArray=apr_array_make(apr_hook_global_pool,1, - sizeof(apr_LINK__optional_t)); - if(!s_phOptionalHooks) - s_phOptionalHooks=apr_hash_make(apr_hook_global_pool); - ppArray=apr_palloc(apr_hook_global_pool,sizeof *ppArray); - *ppArray=pArray; - apr_hash_set(s_phOptionalHooks,szName,strlen(szName),ppArray); - apr_hook_sort_register(szName,ppArray); + apr_array_header_t **ppArray; + + pArray=apr_array_make(apr_hook_global_pool,1, + sizeof(apr_LINK__optional_t)); + if(!s_phOptionalHooks) + s_phOptionalHooks=apr_hash_make(apr_hook_global_pool); + ppArray=apr_palloc(apr_hook_global_pool,sizeof *ppArray); + *ppArray=pArray; + apr_hash_set(s_phOptionalHooks,szName,strlen(szName),ppArray); + apr_hook_sort_register(szName,ppArray); } pHook=apr_array_push(pArray); pHook->pFunc=pfn; @@ -360,7 +360,7 @@ APR_DECLARE(void) apr_optional_hook_add(const char *szName,void (*pfn)(void), pHook->nOrder=nOrder; pHook->szName=apr_hook_debug_current; if(apr_hook_debug_enabled) - apr_hook_debug_show(szName,aszPre,aszSucc); + apr_hook_debug_show(szName,aszPre,aszSucc); } /* optional function support */ @@ -371,7 +371,7 @@ APR_DECLARE(apr_opt_fn_t *) apr_dynamic_fn_retrieve(const char *szName) get_apd #endif if(!s_phOptionalFunctions) - return NULL; + return NULL; return (void(*)(void))apr_hash_get(s_phOptionalFunctions,szName,strlen(szName)); } @@ -383,7 +383,7 @@ APR_DECLARE_NONSTD(void) apr_dynamic_fn_register(const char *szName, get_apd #endif if(!s_phOptionalFunctions) - s_phOptionalFunctions=apr_hash_make(apr_hook_global_pool); + s_phOptionalFunctions=apr_hash_make(apr_hook_global_pool); apr_hash_set(s_phOptionalFunctions,szName,strlen(szName),(void *)pfn); } @@ -395,9 +395,9 @@ void main() const char *aszCPost[]={"b",NULL}; TSortData t1[]= { - { "a",aszAPre,NULL }, - { "b",NULL,aszBPost }, - { "c",NULL,aszCPost } + { "a",aszAPre,NULL }, + { "b",NULL,aszBPost }, + { "c",NULL,aszCPost } }; TSort *pResult; @@ -405,6 +405,6 @@ void main() pResult=tsort(pResult,3); for( ; pResult ; pResult=pResult->pNext) - printf("%s\n",pResult->pData->szName); + printf("%s\n",pResult->pData->szName); } #endif From 8d4a9991f8511b1c67830fa396e265d8be8aa41b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 30 Mar 2011 17:40:40 +0000 Subject: [PATCH 6957/7878] fix undeclared variable issue with --disable-threads Submitted by: Carlo Bramini git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1087027 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index ba271cb05dd..ea085f7567c 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -98,8 +98,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, int oflags = 0; #if APR_HAS_THREADS apr_thread_mutex_t *thlock; - apr_status_t rv; #endif + apr_status_t rv; if ((flag & APR_FOPEN_READ) && (flag & APR_FOPEN_WRITE)) { oflags = O_RDWR; From e6466f75e2e16e20063dec0a7e15834c9fde0581 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Thu, 31 Mar 2011 04:47:11 +0000 Subject: [PATCH 6958/7878] Fixed NetWare build output. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1087183 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 76036915533..e6cc66274f7 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -105,7 +105,7 @@ endif ifneq ($(MAKECMDGOALS),clean) $(APRBUILD)/NWGNUversion.inc : $(APRBUILD)/nw_ver.awk $(APR)/include/apr_version.h # @echo Generating $@ - @echo GEN $@ + @echo $(DL)GEN $@$(DL) @$(AWK) -f $^ > $@ -include $(APRBUILD)/NWGNUversion.inc From f8797dbc68c368ce355584a5da221c0d0f00c344 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Thu, 31 Mar 2011 04:57:27 +0000 Subject: [PATCH 6959/7878] Removed dependency on sort command for export list. Added a shell sort function to the NetWare export script which is only few ms slower than the external sort command; this makes the export list now identical on all build platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1087184 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUenvironment.inc | 1 - build/NWGNUmakefile | 2 +- build/make_nw_export.awk | 33 +++++++++++++++++++++++++++------ 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index d85627f9d2b..1ec4e33aa50 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -142,7 +142,6 @@ LIB = mwldnlm -type library -w nocmdline # Setup build tools AWK = awk -SORT = sort # # Declare Command and tool macros here diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index 8b165b7fc15..8be33a105f4 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -27,7 +27,7 @@ nlms :: $(APR)/aprlib.imp $(APR)/aprlib.imp : make_nw_export.awk nw_export.i # @echo Generating $@ @echo $(DL)GEN $@$(DL) - $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ | $(SORT) >$@ + $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ >$@ nw_export.i : nw_export.inc $(FILES_prebuild_headers) cc.opt # @echo Generating $@ diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index 60835eb2f59..14f60ffdbb1 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -13,18 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# # Based on apr's make_export.awk, which is # based on Ryan Bloom's make_export.pl +# BEGIN { - printf(" (%s)\n", EXPPREFIX) + add_symbol("apr_wait_for_io_or_timeout") } function add_symbol(sym_name) { - found++ sub(" ", "", sym_name) - printf(" %s,\n", sym_name) + exports[++idx] = sym_name } # List of functions that we don't support, yet?? @@ -88,7 +87,29 @@ function add_symbol(sym_name) { END { - add_symbol("apr_wait_for_io_or_timeout"); -# printf("\n\n#found: %d symbols.\n", found) + printf("Added %d symbols to export list.\n", idx) > "/dev/stderr" + # sort symbols with shell sort + increment = int(idx / 2) + while (increment > 0) { + for (i = increment+1; i <= idx; i++) { + j = i + temp = exports[i] + while ((j >= increment+1) && (exports[j-increment] > temp)) { + exports[j] = exports[j-increment] + j -= increment + } + exports[j] = temp + } + if (increment == 2) + increment = 1 + else + increment = int(increment*5/11) + } + # print the array + printf(" (%s)\n", EXPPREFIX) + while (x < idx - 1) { + printf(" %s,\n", exports[++x]) + } + printf(" %s\n", exports[++x]) } From b716dcce49c037b130785b80b328b36174c62886 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 2 Apr 2011 13:50:07 +0000 Subject: [PATCH 6960/7878] MinGW/MSYS: Support shared builds of APR, other general improvements to support of this toolchain. test/Makefile.in: * $(LT_LDFLAGS) must be placed after the driver, otherwise it will act exactly like $(LTFLAGS). This is required, otherwise libtool will be never able to recognize the "-no-undefined" flag. * if mod_test.la does not specify $(LOCAL_LIBS), compilation will fail (this is required by both static and shared builds). include/apr.h.in: * It is required to declare APR_DECLARE, APR_DECLARE_NONSTD and APR_DECLARE_DATA as they are in apr.hw, otherwise the generate DLL won't export any symbol. APR_MODULE_DECLARE_DATA is already included, but previous ones are not. configure.in: * $(LT_LDFLAGS) must be placed after the driver, as described for test/Makefile.in. * Added "-no-undefined" flag to $(LT_LDFLAGS) if the target platform is Windows. * Declare APR_DECLARE_EXPORT or APR_DECLARE_STATIC, required by the macro added in include/apr.h.in. * Removed the "strange" libraries detection (btw, probably it was also breaking platforms without __stdcall calling convention, like Windows CE/Mobile/Phone, since function names were decorated), linker gave error without sense if adding "-lkernel32", probably because it creates a conflict of library precedence and dependency. PR: 46175 Submitted by: Carlo Bramini git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1088023 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ build/apr_rules.mk.in | 6 +++++- configure.in | 30 +++++++++++++++++++++--------- include/apr.h.in | 16 ++++++++++++++++ test/Makefile.in | 6 +++--- 5 files changed, 49 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index b66ae46e6b3..e0e8821826b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) MinGW/MSYS: Support shared builds of APR, other general improvements + to support of this toolchain. PR 46175. [Carlo Bramini + ] + *) Support libxml2 as an alternative XML parser to expat [Nick Kew] *) Hide apr_wait_for_io_or_timeout() from public view and add instead diff --git a/build/apr_rules.mk.in b/build/apr_rules.mk.in index 80c2b433b69..9362a20efcf 100644 --- a/build/apr_rules.mk.in +++ b/build/apr_rules.mk.in @@ -55,6 +55,10 @@ EXTRA_LDFLAGS=@EXTRA_LDFLAGS@ EXTRA_LIBS=@EXTRA_LIBS@ EXTRA_INCLUDES=@EXTRA_INCLUDES@ +# CPPFLAGS which are used only while building APR itself +# +INTERNAL_CPPFLAGS=@INTERNAL_CPPFLAGS@ + # NOTEST_* are flags and libraries that can be added by the user without # causing them to be used in configure tests (necessary for things like # -Werror and other strict warnings that maintainers like to use). @@ -70,7 +74,7 @@ NOTEST_LIBS=@NOTEST_LIBS@ # left-to-right precedence and CPPFLAGS may include user-defined overrides. # ALL_CFLAGS = $(EXTRA_CFLAGS) $(NOTEST_CFLAGS) $(CFLAGS) -ALL_CPPFLAGS = $(DEFS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS) +ALL_CPPFLAGS = $(DEFS) $(INTERNAL_CPPFLAGS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS) ALL_LDFLAGS = $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(LDFLAGS) ALL_LIBS = $(LIBS) $(NOTEST_LIBS) $(EXTRA_LIBS) ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) diff --git a/configure.in b/configure.in index 6f41774bdee..3699ee7133a 100644 --- a/configure.in +++ b/configure.in @@ -293,7 +293,7 @@ AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the if test "x$use_libtool" = "xyes"; then lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -o $@ -c $< && touch $@' LT_VERSION="-version-info `$get_version libtool $version_hdr APR`" - link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) \$(LT_VERSION) \$(ALL_LDFLAGS) -o \$@" + link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(COMPILE) \$(LT_LDFLAGS) \$(LT_VERSION) \$(ALL_LDFLAGS) -o \$@" so_ext='lo' lib_target='-rpath $(libdir) $(OBJECTS)' export_lib_target='-rpath \$(libdir) \$(OBJECTS)' @@ -309,6 +309,9 @@ case $host in *-solaris2*) apr_platform_runtime_link_flag="-R" ;; + *-mingw* | *-cygwin*) + LT_LDFLAGS="$LT_LDFLAGS -no-undefined" + ;; *) ;; esac @@ -443,6 +446,20 @@ case "$host:$CC" in APR_SETVAR(CC,mwcc) APR_SETVAR(AR,ar) ;; + +dnl If building static APR, both the APR build and the app build +dnl need -DAPR_DECLARE_STATIC to generate the right linkage from +dnl APR_DECLARE et al. +dnl If building dynamic APR, the APR build needs APR_DECLARE_EXPORT +dnl and the app build should have neither define. + + *-mingw* | *-cygwin*) + if test "$enable_shared" = "yes"; then + APR_ADDTO(INTERNAL_CPPFLAGS, -DAPR_DECLARE_EXPORT) + else + APR_ADDTO(CPPFLAGS, -DAPR_DECLARE_STATIC) + fi + ;; esac AC_CACHE_CHECK([whether the compiler provides atomic builtins], [ap_cv_atomic_builtins], @@ -679,14 +696,8 @@ dnl without the extra " " in that case, but they didn't do that. So, we dnl end up LIBS="-lm -lcrypt -lnsl -ldl" which is an annoyance. case $host in *-mingw*) - AC_CHECK_LIB(msvcrt, getpid) - APR_CHECK_DLL_FUNC(kernel32, SetErrorMode@4) - APR_CHECK_DLL_FUNC(advapi32, GetSecurityInfo@32) - APR_CHECK_DLL_FUNC(ws2_32, gethostbyname@4) - APR_CHECK_DLL_FUNC(shell32, CommandLineToArgvW@8) - APR_CHECK_DLL_FUNC(kernel32,[CreateFileMappingA@24], - [ac_cv_func_CreateFileMapping=$ac_cv_lib_kernel32_CreateFileMappingA]) - APR_CHECK_DLL_FUNC(rpcrt4,[UuidCreate@4]) + APR_ADDTO(LIBS,[-lshell32 -ladvapi32 -lws2_32 -lrpcrt4 -lmswsock]) + ac_cv_func_CreateFileMapping=yes ;; *) AC_SEARCH_LIBS(gethostbyname, nsl) @@ -2668,6 +2679,7 @@ AC_SUBST(NOTEST_INCLUDES) dnl ----------------------------- Construct the files +AC_SUBST(INTERNAL_CPPFLAGS) AC_SUBST(LDLIBS) AC_SUBST(INCLUDES) AC_SUBST(AR) diff --git a/include/apr.h.in b/include/apr.h.in index a6ecdf80d3e..b5bc729997d 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -472,6 +472,8 @@ typedef apr_uint32_t apr_uintptr_t; */ #define APR_THREAD_FUNC @apr_thread_func@ +#if defined(DOXYGEN) || !defined(WIN32) + /** * The public APR functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with @@ -524,6 +526,20 @@ typedef apr_uint32_t apr_uintptr_t; */ #define APR_DECLARE_DATA +#elif defined(APR_DECLARE_STATIC) +#define APR_DECLARE(type) type __stdcall +#define APR_DECLARE_NONSTD(type) type __cdecl +#define APR_DECLARE_DATA +#elif defined(APR_DECLARE_EXPORT) +#define APR_DECLARE(type) __declspec(dllexport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl +#define APR_DECLARE_DATA __declspec(dllexport) +#else +#define APR_DECLARE(type) __declspec(dllimport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl +#define APR_DECLARE_DATA __declspec(dllimport) +#endif + #if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) /** * Declare a dso module's exported module structure as APR_MODULE_DECLARE_DATA. diff --git a/test/Makefile.in b/test/Makefile.in index ca1e53bd3fe..2c8f1725740 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -74,7 +74,7 @@ INCLUDES=-I$(INCDIR) -I$(srcdir)/../include # link programs using -no-install to get real executables not # libtool wrapper scripts which link an executable when first run. -LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) \ +LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LT_LDFLAGS) \ @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@ # STDTEST_PORTABLE; @@ -126,10 +126,10 @@ mod_test.lo: $(srcdir)/mod_test.c -c $(srcdir)/mod_test.c OBJECTS_mod_test = mod_test.lo -mod_test.la: $(OBJECTS_mod_test) +mod_test.la: $(OBJECTS_mod_test) $(LOCAL_LIBS) $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -module \ -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ \ - $(OBJECTS_mod_test) + $(OBJECTS_mod_test) $(LOCAL_LIBS) OBJECTS_libmod_test = mod_test.lo $(LOCAL_LIBS) libmod_test.la: $(OBJECTS_libmod_test) From c07e64d090a271967ace6a0efccf1ea2d30335e2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 2 Apr 2011 14:41:58 +0000 Subject: [PATCH 6961/7878] avoid trying to test crypt[_r]()-based hash on the three platforms which don't provide it (APR currently exports no feature test for this) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1088039 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpass.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/testpass.c b/test/testpass.c index dc287078def..030ef1075f8 100644 --- a/test/testpass.c +++ b/test/testpass.c @@ -28,6 +28,14 @@ #include "abts.h" #include "testutil.h" +#if defined(WIN32) || defined(BEOS) || defined(NETWARE) +#define CRYPT_ALGO_SUPPORTED 0 +#else +#define CRYPT_ALGO_SUPPORTED 1 +#endif + +#if CRYPT_ALGO_SUPPORTED + static struct { const char *password; const char *hash; @@ -104,6 +112,8 @@ static void test_threadsafe(abts_case *tc, void *data) } #endif +#endif /* CRYPT_ALGO_SUPPORTED */ + static void test_shapass(abts_case *tc, void *data) { const char *pass = "hellojed"; @@ -130,10 +140,12 @@ abts_suite *testpass(abts_suite *suite) { suite = ADD_SUITE(suite); +#if CRYPT_ALGO_SUPPORTED abts_run_test(suite, test_crypt, NULL); #if APR_HAS_THREADS abts_run_test(suite, test_threadsafe, NULL); #endif +#endif /* CRYPT_ALGO_SUPPORTED */ abts_run_test(suite, test_shapass, NULL); abts_run_test(suite, test_md5pass, NULL); From 02463b078ea549a1c25e8bb2f6e030248ad00465 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 2 Apr 2011 20:11:54 +0000 Subject: [PATCH 6962/7878] apr_socket_wait() for Windows git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1088103 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sendrecv.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 0fb11add5e1..61bc20746fe 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -457,6 +457,39 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_socket_wait(apr_socket_t *sock, apr_wait_type_t direction) { - return APR_ENOTIMPL; + fd_set fdset, *rptr, *wptr; + int rc; + struct timeval tv, *tvptr; + + FD_ZERO(&fdset); + FD_SET(sock->socketdes, &fdset); + + if (direction == APR_WAIT_READ) { + rptr = &fdset; + wptr = NULL; + } + else { /* APR_WAIT_WRITE */ + rptr = NULL; + wptr = &fdset; + } + + if (sock->timeout < 0) { + tvptr = NULL; + } + else { + /* casts for winsock/timeval definition */ + tv.tv_sec = (long)apr_time_sec(sock->timeout); + tv.tv_usec = (int)apr_time_usec(sock->timeout); + tvptr = &tv; + } + rc = select(/* ignored */ FD_SETSIZE+1, rptr, wptr, NULL, tvptr); + if (rc == SOCKET_ERROR) { + return apr_get_netos_error(); + } + else if (!rc) { + return APR_FROM_OS_ERROR(WSAETIMEDOUT); + } + + return APR_SUCCESS; } From 6e14c8f686d567ccb113da90e197584b0d5891c6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 3 Apr 2011 15:23:21 +0000 Subject: [PATCH 6963/7878] comment spelling git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1088325 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index c718b1bc0de..3c4dbe2f289 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -32,7 +32,7 @@ #define GENERIC_INADDR_ANY_LEN 16 #endif -/* big enough for IPv4, IPv6 and optionaly sun_path */ +/* big enough for IPv4, IPv6 and optionally sun_path */ static char generic_inaddr_any[GENERIC_INADDR_ANY_LEN] = {0}; static apr_status_t socket_cleanup(void *sock) From b607a110b39b9838ef0a57d31e7499a63086589b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 3 Apr 2011 17:50:18 +0000 Subject: [PATCH 6964/7878] Windows: Save a call to getpeername() when trying to retrieve the remote address of a socket created by apr_socket_accept() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1088352 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 62f61fe4a77..081e77c629b 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -252,6 +252,8 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, /* XXX next line looks bogus w.r.t. AF_INET6 support */ (*new)->remote_addr->salen = sizeof((*new)->remote_addr->sa); memcpy (&(*new)->remote_addr->sa, &sa, salen); + (*new)->remote_addr_unknown = 0; + *(*new)->local_addr = *sock->local_addr; /* The above assignment just overwrote the pool entry. Setting the local_addr From b66c54d57460e1fc4a9be196e70a00a6ee850486 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 5 Apr 2011 13:28:59 +0000 Subject: [PATCH 6965/7878] restructure Windows apr_socket_connect() to more closely match the Unix implementation, fixing the getpeername() optimization and WSAEISCONN behavior PR: 48736 (covered WSAISCONN issue) Submitted by: (WSAISCONN handling) Reworked/extended by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1089031 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ network_io/win32/sockets.c | 106 +++++++++++++++++++++++-------------- 2 files changed, 70 insertions(+), 39 deletions(-) diff --git a/CHANGES b/CHANGES index e0e8821826b..3643a3801ac 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_socket_connect() on Windows: Handle WSAEISCONN. PR 48736. + [, Jeff Trawick] + *) MinGW/MSYS: Support shared builds of APR, other general improvements to support of this toolchain. PR 46175. [Carlo Bramini ] diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 081e77c629b..a5ed1589926 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -306,6 +306,47 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, return APR_SUCCESS; } +static apr_status_t wait_for_connect(apr_socket_t *sock) +{ + int rc; + struct timeval tv, *tvptr; + fd_set wfdset, efdset; + + /* wait for the connect to complete or timeout */ + FD_ZERO(&wfdset); + FD_SET(sock->socketdes, &wfdset); + FD_ZERO(&efdset); + FD_SET(sock->socketdes, &efdset); + + if (sock->timeout < 0) { + tvptr = NULL; + } + else { + /* casts for winsock/timeval definition */ + tv.tv_sec = (long)apr_time_sec(sock->timeout); + tv.tv_usec = (int)apr_time_usec(sock->timeout); + tvptr = &tv; + } + rc = select(FD_SETSIZE+1, NULL, &wfdset, &efdset, tvptr); + if (rc == SOCKET_ERROR) { + return apr_get_netos_error(); + } + else if (!rc) { + return APR_FROM_OS_ERROR(WSAETIMEDOUT); + } + /* Evaluate the efdset */ + if (FD_ISSET(sock->socketdes, &efdset)) { + /* The connect failed. */ + int rclen = sizeof(rc); + if (getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR, (char*) &rc, &rclen)) { + return apr_get_netos_error(); + } + return APR_FROM_OS_ERROR(rc); + } + + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) { @@ -317,59 +358,41 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, if (connect(sock->socketdes, (const struct sockaddr *)&sa->sa.sin, sa->salen) == SOCKET_ERROR) { - int rc; - struct timeval tv, *tvptr; - fd_set wfdset, efdset; - rv = apr_get_netos_error(); - if (rv != APR_FROM_OS_ERROR(WSAEWOULDBLOCK)) { - return rv; - } + } + else { + rv = APR_SUCCESS; + } + if (rv == APR_FROM_OS_ERROR(WSAEWOULDBLOCK)) { if (sock->timeout == 0) { /* Tell the app that the connect is in progress... * Gotta play some games here. connect on Unix will return * EINPROGRESS under the same circumstances that Windows * returns WSAEWOULDBLOCK. Do some adhoc canonicalization... */ - return APR_FROM_OS_ERROR(WSAEINPROGRESS); - } - - /* wait for the connect to complete or timeout */ - FD_ZERO(&wfdset); - FD_SET(sock->socketdes, &wfdset); - FD_ZERO(&efdset); - FD_SET(sock->socketdes, &efdset); - - if (sock->timeout < 0) { - tvptr = NULL; + rv = APR_FROM_OS_ERROR(WSAEINPROGRESS); } else { - /* casts for winsock/timeval definition */ - tv.tv_sec = (long)apr_time_sec(sock->timeout); - tv.tv_usec = (int)apr_time_usec(sock->timeout); - tvptr = &tv; - } - rc = select(FD_SETSIZE+1, NULL, &wfdset, &efdset, tvptr); - if (rc == SOCKET_ERROR) { - return apr_get_netos_error(); - } - else if (!rc) { - return APR_FROM_OS_ERROR(WSAETIMEDOUT); - } - /* Evaluate the efdset */ - if (FD_ISSET(sock->socketdes, &efdset)) { - /* The connect failed. */ - int rclen = sizeof(rc); - if (getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR, (char*) &rc, &rclen)) { - return apr_get_netos_error(); + rv = wait_for_connect(sock); + if (rv != APR_SUCCESS) { + return rv; } - return APR_FROM_OS_ERROR(rc); } } - /* connect was OK .. amazing */ - sock->remote_addr = sa; + + if (memcmp(sa->ipaddr_ptr, generic_inaddr_any, sa->ipaddr_len)) { + /* A real remote address was passed in. If the unspecified + * address was used, the actual remote addr will have to be + * determined using getpeername() if required. */ + sock->remote_addr_unknown = 0; + + /* Copy the address structure details in. */ + sock->remote_addr = sa; + } + if (sock->local_addr->sa.sin.sin_port == 0) { + /* connect() got us an ephemeral port */ sock->local_port_unknown = 1; } if (!memcmp(sock->local_addr->ipaddr_ptr, @@ -380,6 +403,11 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, */ sock->local_interface_unknown = 1; } + + if (rv != APR_SUCCESS && rv != APR_FROM_OS_ERROR(WSAEISCONN)) { + return rv; + } + return APR_SUCCESS; } From c540a7eb4b80939886f310a7668a7c4953838d73 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 5 Apr 2011 16:50:28 +0000 Subject: [PATCH 6966/7878] MinGW: Resolve paths to test DSOs and executables within the test suite. PR: 51021 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1089129 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 1 + test/testproc.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 4cf7882ec87..cd13aaa2d71 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -442,6 +442,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DCYGWIN]) ;; *mingw*) + APR_ADDTO(INTERNAL_CPPFLAGS, -DBINPATH=$apr_builddir/test/.libs) APR_ADDTO(CPPFLAGS, [-DWIN32 -D__MSVCRT__]) APR_ADDTO(LDFLAGS, [-Wl,--enable-auto-import,--subsystem,console]) APR_SETIFNULL(have_unicode_fs, [1]) diff --git a/test/testproc.c b/test/testproc.c index c983f2594b7..096ecfdfc59 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -23,6 +23,10 @@ #define TESTSTR "This is a test" +#define PROC_CHILD_NAME TESTBINPATH "proc_child" EXTENSION + +static char *proc_child; + static apr_proc_t newproc; static void test_create_proc(abts_case *tc, void *data) @@ -50,7 +54,7 @@ static void test_create_proc(abts_case *tc, void *data) args[0] = "proc_child" EXTENSION; args[1] = NULL; - rv = apr_proc_create(&newproc, "../" TESTBINPATH "proc_child" EXTENSION, args, NULL, + rv = apr_proc_create(&newproc, proc_child, args, NULL, attr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -126,7 +130,7 @@ static void test_file_redir(abts_case *tc, void *data) args[0] = "proc_child"; args[1] = NULL; - rv = apr_proc_create(&newproc, "../" TESTBINPATH "proc_child" EXTENSION, args, NULL, + rv = apr_proc_create(&newproc, proc_child, args, NULL, attr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -160,6 +164,7 @@ abts_suite *testproc(abts_suite *suite) { suite = ADD_SUITE(suite) + apr_filepath_merge(&proc_child, NULL, PROC_CHILD_NAME, 0, p); abts_run_test(suite, test_create_proc, NULL); abts_run_test(suite, test_proc_wait, NULL); abts_run_test(suite, test_file_redir, NULL); From 81fc751786672424d886b2df5591d7654519bdc9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 6 Apr 2011 12:28:43 +0000 Subject: [PATCH 6967/7878] avoid segfault when setup_socket() fails git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1089424 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/testsock.c b/test/testsock.c index f40a34fa5d3..854fb702cbc 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -346,6 +346,7 @@ static void test_get_addr(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "create subpool", apr_pool_create(&subp, p)); ld = setup_socket(tc); + if (!ld) return; APR_ASSERT_SUCCESS(tc, "get local address of bound socket", @@ -446,6 +447,8 @@ static void test_wait(abts_case *tc, void *data) int connected = FALSE; server = setup_socket(tc); + if (!server) return; + rv = apr_sockaddr_info_get(&server_addr, socket_name, socket_type, 8021, 0, p); APR_ASSERT_SUCCESS(tc, "setting up sockaddr", rv); From f984b9a795ed2aa2aa907fd6962b4f6f8e20854b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 6 Apr 2011 12:38:28 +0000 Subject: [PATCH 6968/7878] add a missing server socket close remove AF_UNIX socket from filsystem before trying to bind, in case it exists from a previous run git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1089428 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/testsock.c b/test/testsock.c index 854fb702cbc..41b2774f764 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -491,6 +491,9 @@ static void test_wait(abts_case *tc, void *data) rv = apr_socket_wait(client, APR_WAIT_READ); APR_ASSERT_SUCCESS(tc, "Wait for socket failed", rv); + + rv = apr_socket_close(server); + APR_ASSERT_SUCCESS(tc, "couldn't close server socket", rv); } abts_suite *testsock(abts_suite *suite) @@ -510,6 +513,8 @@ abts_suite *testsock(abts_suite *suite) #if APR_HAVE_SOCKADDR_UN socket_name = UNIX_SOCKET_NAME; socket_type = APR_UNIX; + /* in case AF_UNIX socket exists from a previous run: */ + apr_file_remove(socket_name, p); abts_run_test(suite, test_create_bind_listen, NULL); abts_run_test(suite, test_send, NULL); abts_run_test(suite, test_recv, NULL); From c7871896e17e67aa5eee2b6f73db9ae3ba81f8a2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 6 Apr 2011 12:51:17 +0000 Subject: [PATCH 6969/7878] poll, pollset, pollcb on Windows: Handle calls with no file/socket descriptors. PR: 49882 Patch for one situation submitted by: Stefan Ruppert Extended by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1089433 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ poll/unix/poll.c | 13 ++++++++++ poll/unix/select.c | 19 ++++++++++++++ test/testpoll.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 99 insertions(+) diff --git a/CHANGES b/CHANGES index 3643a3801ac..518929a740a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) poll, pollset, pollcb on Windows: Handle calls with no file/socket + descriptors. PR 49882. [Stefan Ruppert , Jeff Trawick] + *) apr_socket_connect() on Windows: Handle WSAEISCONN. PR 48736. [, Jeff Trawick] diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 1fe9b91d43c..abdfcad7528 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -240,11 +240,24 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, { int ret; apr_status_t rv = APR_SUCCESS; +#ifdef WIN32 + apr_interval_time_t orig_timeout; +#endif if (timeout > 0) { timeout /= 1000; } #ifdef WIN32 + /* WSAPoll() requires at least one socket. */ + if (pollset->nelts == 0) { + *num = 0; + if (orig_timeout > 0) { + apr_sleep(orig_timeout); + return APR_TIMEUP; + } + return APR_SUCCESS; + } + ret = WSAPoll(pollset->p->pollset, pollset->nelts, (int)timeout); #else ret = poll(pollset->p->pollset, pollset->nelts, timeout); diff --git a/poll/unix/select.c b/poll/unix/select.c index c1ac3c519bb..b12f12ec70c 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -41,6 +41,21 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, apr_datatype_e set_type = APR_NO_DESC; #endif +#ifdef WIN32 + /* On Win32, select() must be presented with at least one socket to + * poll on, or select() will return WSAEINVAL. So, we'll just + * short-circuit and bail now. + */ + if (num == 0) { + (*nsds) = 0; + if (timeout > 0) { + apr_sleep(timeout); + return APR_TIMEUP; + } + return APR_SUCCESS; + } +#endif + if (timeout < 0) { tvptr = NULL; } @@ -339,6 +354,10 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, */ if (pollset->nelts == 0) { (*num) = 0; + if (timeout > 0) { + apr_sleep(timeout); + return APR_TIMEUP; + } return APR_SUCCESS; } #endif diff --git a/test/testpoll.c b/test/testpoll.c index ab31a3deb70..6a247fffee4 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -819,6 +819,69 @@ static void pollcb_wakeup(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_EINTR, rv); } +static void justsleep(abts_case *tc, void *data) +{ + apr_int32_t nsds; + const apr_pollfd_t *hot_files; + apr_pollset_t *pollset; + apr_status_t rv; + apr_time_t t1, t2; + int i; + apr_pollset_method_e methods[] = { + APR_POLLSET_DEFAULT, + APR_POLLSET_SELECT, + APR_POLLSET_KQUEUE, + APR_POLLSET_PORT, + APR_POLLSET_EPOLL, + APR_POLLSET_POLL}; + + nsds = 1; + t1 = apr_time_now(); + rv = apr_poll(NULL, 0, &nsds, apr_time_from_msec(200)); + t2 = apr_time_now(); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 0, nsds); + ABTS_ASSERT(tc, + "apr_poll() didn't sleep", + (t2 - t1) > apr_time_from_msec(100)); + + for (i = 0; i < sizeof methods / sizeof methods[0]; i++) { + rv = apr_pollset_create_ex(&pollset, 5, p, 0, methods[i]); + if (rv != APR_ENOTIMPL) { + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + nsds = 1; + t1 = apr_time_now(); + rv = apr_pollset_poll(pollset, apr_time_from_msec(200), &nsds, + &hot_files); + t2 = apr_time_now(); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_INT_EQUAL(tc, 0, nsds); + ABTS_ASSERT(tc, + "apr_pollset_poll() didn't sleep", + (t2 - t1) > apr_time_from_msec(100)); + + rv = apr_pollset_destroy(pollset); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + } + + rv = apr_pollcb_create_ex(&pollcb, 5, p, 0, methods[0]); + if (rv != APR_ENOTIMPL) { + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + t1 = apr_time_now(); + rv = apr_pollcb_poll(pollcb, apr_time_from_msec(200), NULL, NULL); + t2 = apr_time_now(); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_ASSERT(tc, + "apr_pollcb_poll() didn't sleep", + (t2 - t1) > apr_time_from_msec(100)); + + /* no apr_pollcb_destroy() */ + } + } +} + abts_suite *testpoll(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -858,6 +921,7 @@ abts_suite *testpoll(abts_suite *suite) abts_run_test(suite, close_all_sockets, NULL); abts_run_test(suite, pollset_default, NULL); abts_run_test(suite, pollcb_default, NULL); + abts_run_test(suite, justsleep, NULL); abts_run_test(suite, pollset_wakeup, NULL); abts_run_test(suite, pollcb_wakeup, NULL); From 5451b2f6f6602f6a6868ccedfc3cf8ca2fa9d75a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 6 Apr 2011 13:04:12 +0000 Subject: [PATCH 6970/7878] change apr_palloc+memcpy to apr_pmemdup PR: 47776 Submitted by: Boya Sun git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1089438 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filedup.c | 3 +-- file_io/unix/filedup.c | 3 +-- file_io/win32/filedup.c | 3 +-- strings/apr_strings.c | 3 +-- xlate/xlate.c | 4 ++-- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 810e227fbab..ff937eb686c 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -87,8 +87,7 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { - *new_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t)); - memcpy(*new_file, old_file, sizeof(apr_file_t)); + *new_file = (apr_file_t *)apr_pmemdup(p, old_file, sizeof(apr_file_t)); (*new_file)->pool = p; if (old_file->buffered) { diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index ab31e94434f..797f8045f6b 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -152,8 +152,7 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { - *new_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t)); - memcpy(*new_file, old_file, sizeof(apr_file_t)); + *new_file = (apr_file_t *)apr_pmemdup(p, old_file, sizeof(apr_file_t)); (*new_file)->pool = p; if (old_file->buffered) { (*new_file)->buffer = apr_palloc(p, old_file->bufsize); diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index e1dfc164997..058e0e6cb00 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -187,8 +187,7 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { - *new_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t)); - memcpy(*new_file, old_file, sizeof(apr_file_t)); + *new_file = (apr_file_t *)apr_pmemdup(p, old_file, sizeof(apr_file_t)); (*new_file)->pool = p; if (old_file->buffered) { (*new_file)->buffer = apr_palloc(p, old_file->bufsize); diff --git a/strings/apr_strings.c b/strings/apr_strings.c index d20004eadae..0ba49c844c6 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -75,8 +75,7 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *a, const char *s) return NULL; } len = strlen(s) + 1; - res = apr_palloc(a, len); - memcpy(res, s, len); + res = apr_pmemdup(a, s, len); return res; } diff --git a/xlate/xlate.c b/xlate/xlate.c index 400949f1cb7..ab1c5f50881 100644 --- a/xlate/xlate.c +++ b/xlate/xlate.c @@ -117,8 +117,8 @@ static void check_sbcs(apr_xlate_t *convset) * close the iconv descriptor */ - convset->sbcs_table = apr_palloc(convset->pool, sizeof(outbuf)); - memcpy(convset->sbcs_table, outbuf, sizeof(outbuf)); + convset->sbcs_table = apr_pmemdup(convset->pool, outbuf, sizeof(outbuf)); + iconv_close(convset->ich); convset->ich = (iconv_t)-1; From 7db09ba0e299ef8c41986478cb5578d8443ac927 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 6 Apr 2011 16:34:24 +0000 Subject: [PATCH 6971/7878] fix variable initialization bug in r1089433 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1089528 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index abdfcad7528..871126b343a 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -241,7 +241,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, int ret; apr_status_t rv = APR_SUCCESS; #ifdef WIN32 - apr_interval_time_t orig_timeout; + apr_interval_time_t orig_timeout = timeout; #endif if (timeout > 0) { From 9b2e537e79633bebd0600cea5deac490ef500fa0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 7 Apr 2011 00:21:22 +0000 Subject: [PATCH 6972/7878] trying to build httpd on Win against apr trunk points out the lack of apr_file_rotating_* there git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1089694 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/STATUS b/STATUS index 47a3a9db5a8..038c383e287 100644 --- a/STATUS +++ b/STATUS @@ -112,6 +112,8 @@ RELEASE SHOWSTOPPERS: these into DSO pluggable providers against the various SDK's/Toolkits. Either re-apply r799085, or drop apr_ldap before 2.0.0, per vote on dev@ + * apr_file_rotating_* on most platforms + CURRENT VOTES: From 9eddd164d9147c0b9a17e0401b370220af42a464 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 7 Apr 2011 00:48:34 +0000 Subject: [PATCH 6973/7878] APR_ENOTIMPL versions of apr_file_rotating_check() and apr_file_rotating_manual_check() for Windows git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1089699 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 71b2f2b5a62..ce61b487763 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -243,6 +243,17 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size return rv; } +APR_DECLARE(apr_status_t) apr_file_rotating_check(apr_file_t *thefile) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_file_rotating_manual_check(apr_file_t *thefile, + apr_time_t n) +{ + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { apr_status_t rv; From 233397ddade2deedfc51663b15a71f529bf87695 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 8 Apr 2011 02:58:37 +0000 Subject: [PATCH 6974/7878] Removed tabs and trailing spaces. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1090093 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmemcache.c | 128 ++++++++++++++++++++++---------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/test/testmemcache.c b/test/testmemcache.c index 80bc10bd21b..0d0e7b939a8 100644 --- a/test/testmemcache.c +++ b/test/testmemcache.c @@ -24,7 +24,7 @@ #include "apr_network_io.h" #if APR_HAVE_STDLIB_H -#include /* for exit() */ +#include /* for exit() */ #endif #define HOST "localhost" @@ -57,7 +57,7 @@ const char txt[] = * this datatype is for our custom server determination function. this might * be useful if you don't want to rely on simply hashing keys to determine * where a key belongs, but instead want to write something fancy, or use some - * other kind of configuration data, i.e. a hash plus some data about a + * other kind of configuration data, i.e. a hash plus some data about a * namespace, or whatever. see my_server_func, and test_memcache_user_funcs * for the examples. */ @@ -67,7 +67,7 @@ typedef struct { } my_hash_server_baton; -/* this could do something fancy and return some hash result. +/* this could do something fancy and return some hash result. * for simplicity, just return the same value, so we can test it later on. * if you wanted to use some external hashing library or functions for * consistent hashing, for example, this would be a good place to do it. @@ -82,10 +82,10 @@ static apr_uint32_t my_hash_func(void *baton, const char *data, /* * a fancy function to determine which server to use given some kind of data * and a hash value. this example actually ignores the hash value itself - * and pulls some number from the *baton, which is a struct that has some + * and pulls some number from the *baton, which is a struct that has some * kind of meaningful stuff in it. */ -static apr_memcache_server_t *my_server_func(void *baton, +static apr_memcache_server_t *my_server_func(void *baton, apr_memcache_t *mc, const apr_uint32_t hash) { @@ -94,7 +94,7 @@ static apr_memcache_server_t *my_server_func(void *baton, if(mc->ntotal == 0) { return NULL; - } + } if(mc->ntotal < mhsb->which_server) { return NULL; @@ -112,8 +112,8 @@ static int randval(apr_uint32_t high) double d = 0; if (firsttime == 0) { - srand((unsigned) (getpid())); - firsttime = 1; + srand((unsigned) (getpid())); + firsttime = 1; } d = (double) rand() / ((double) RAND_MAX + 1); @@ -139,40 +139,40 @@ static void test_memcache_create(abts_case * tc, void *data) rv = apr_memcache_create(pool, max_servers, 0, &memcache); ABTS_ASSERT(tc, "memcache create failed", rv == APR_SUCCESS); - + for (i = 1; i <= max_servers; i++) { apr_port_t port; - + port = PORT + i; rv = apr_memcache_server_create(pool, HOST, PORT + i, 0, 1, 1, 60, &server); ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS); - + rv = apr_memcache_add_server(memcache, server); ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); - + s = apr_memcache_find_server(memcache, HOST, port); ABTS_PTR_EQUAL(tc, server, s); - + rv = apr_memcache_disable_server(memcache, s); ABTS_ASSERT(tc, "server disable failed", rv == APR_SUCCESS); - + rv = apr_memcache_enable_server(memcache, s); ABTS_ASSERT(tc, "server enable failed", rv == APR_SUCCESS); - + hash = apr_memcache_hash(memcache, prefix, strlen(prefix)); ABTS_ASSERT(tc, "hash failed", hash > 0); - + s = apr_memcache_find_server_hash(memcache, hash); ABTS_PTR_NOTNULL(tc, s); } rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1, 60, &server); ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS); - + rv = apr_memcache_add_server(memcache, server); ABTS_ASSERT(tc, "server add should have failed", rv != APR_SUCCESS); - + } /* install our own custom hashing and server selection routines. */ @@ -180,13 +180,13 @@ static void test_memcache_create(abts_case * tc, void *data) static int create_test_hash(apr_pool_t *p, apr_hash_t *h) { int i; - + for (i = 0; i < TDATA_SIZE; i++) { char *k, *v; - + k = apr_pstrcat(p, prefix, apr_itoa(p, i), NULL); v = apr_pstrndup(p, txt, randval((apr_uint32_t)strlen(txt))); - + apr_hash_set(h, k, APR_HASH_KEY_STRING, v); } @@ -202,13 +202,13 @@ static void test_memcache_user_funcs(abts_case * tc, void *data) apr_uint32_t max_servers = 10; apr_uint32_t hres; apr_uint32_t i; - my_hash_server_baton *baton = + my_hash_server_baton *baton = apr_pcalloc(pool, sizeof(my_hash_server_baton)); rv = apr_memcache_create(pool, max_servers, 0, &memcache); ABTS_ASSERT(tc, "memcache create failed", rv == APR_SUCCESS); - /* as noted above, install our custom hash function, and call + /* as noted above, install our custom hash function, and call * apr_memcache_hash. the return value should be our predefined number, * and our function just ignores the other args, for simplicity. */ @@ -216,24 +216,24 @@ static void test_memcache_user_funcs(abts_case * tc, void *data) hres = apr_memcache_hash(memcache, "whatever", sizeof("whatever") - 1); ABTS_INT_EQUAL(tc, HASH_FUNC_RESULT, hres); - + /* add some servers */ for(i = 1; i <= 10; i++) { apr_memcache_server_t *ms; rv = apr_memcache_server_create(pool, HOST, i, 0, 1, 1, 60, &ms); ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS); - + rv = apr_memcache_add_server(memcache, ms); ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); } - /* - * set 'which_server' in our server_baton to find the third server + /* + * set 'which_server' in our server_baton to find the third server * which should have the same port. */ baton->which_server = 3; - memcache->server_func = my_server_func; + memcache->server_func = my_server_func; memcache->server_baton = baton; found = apr_memcache_find_server_hash(memcache, 0); ABTS_ASSERT(tc, "wrong server found", found->port == baton->which_server); @@ -266,11 +266,11 @@ static void test_memcache_meta(abts_case * tc, void *data) ABTS_STR_NEQUAL(tc, stats->version, result, 5); - /* + /* * no way to know exactly what will be in most of these, so * just make sure there is something. */ - + ABTS_ASSERT(tc, "pid", stats->pid >= 0); ABTS_ASSERT(tc, "time", stats->time >= 0); /* ABTS_ASSERT(tc, "pointer_size", stats->pointer_size >= 0); */ @@ -283,7 +283,7 @@ static void test_memcache_meta(abts_case * tc, void *data) ABTS_ASSERT(tc, "curr_connections", stats->curr_connections >= 0); ABTS_ASSERT(tc, "total_connections", stats->total_connections >= 0); - ABTS_ASSERT(tc, "connection_structures", + ABTS_ASSERT(tc, "connection_structures", stats->connection_structures >= 0); ABTS_ASSERT(tc, "cmd_get", stats->cmd_get >= 0); @@ -315,13 +315,13 @@ static void test_memcache_addreplace(abts_case * tc, void *data) rv = apr_memcache_create(pool, 1, 0, &memcache); ABTS_ASSERT(tc, "memcache create failed", rv == APR_SUCCESS); - + rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1, 60, &server); ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS); - + rv = apr_memcache_add_server(memcache, server); ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); - + tdata = apr_hash_make(p); create_test_hash(pool, tdata); @@ -336,7 +336,7 @@ static void test_memcache_addreplace(abts_case * tc, void *data) /* doesn't exist yet, fail */ rv = apr_memcache_replace(memcache, key, v, strlen(v) - 1, 0, 27); ABTS_ASSERT(tc, "replace should have failed", rv != APR_SUCCESS); - + /* doesn't exist yet, succeed */ rv = apr_memcache_add(memcache, key, v, strlen(v), 0, 27); ABTS_ASSERT(tc, "add failed", rv == APR_SUCCESS); @@ -374,16 +374,16 @@ static void test_memcache_incrdecr(abts_case * tc, void *data) rv = apr_memcache_create(pool, 1, 0, &memcache); ABTS_ASSERT(tc, "memcache create failed", rv == APR_SUCCESS); - + rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1, 60, &server); ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS); - + rv = apr_memcache_add_server(memcache, server); ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); rv = apr_memcache_set(memcache, prefix, "271", sizeof("271") - 1, 0, 27); ABTS_ASSERT(tc, "set failed", rv == APR_SUCCESS); - + for( i = 1; i <= TDATA_SIZE; i++) { apr_uint32_t expect; @@ -426,16 +426,16 @@ static void test_memcache_multiget(abts_case * tc, void *data) rv = apr_memcache_create(pool, 1, 0, &memcache); ABTS_ASSERT(tc, "memcache create failed", rv == APR_SUCCESS); - + rv = apr_memcache_server_create(pool, HOST, PORT, 0, 1, 1, 60, &server); ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS); - + rv = apr_memcache_add_server(memcache, server); ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); - + values = apr_hash_make(p); tdata = apr_hash_make(p); - + create_test_hash(pool, tdata); for (hi = apr_hash_first(p, tdata); hi; hi = apr_hash_next(hi)) { @@ -449,34 +449,34 @@ static void test_memcache_multiget(abts_case * tc, void *data) rv = apr_memcache_set(memcache, key, v, strlen(v), 0, 27); ABTS_ASSERT(tc, "set failed", rv == APR_SUCCESS); } - + rv = apr_pool_create(&tmppool, pool); for (i = 0; i < TDATA_SET; i++) apr_memcache_add_multget_key(pool, apr_pstrcat(pool, prefix, apr_itoa(pool, i), NULL), &values); - + rv = apr_memcache_multgetp(memcache, tmppool, pool, values); - + ABTS_ASSERT(tc, "multgetp failed", rv == APR_SUCCESS); ABTS_ASSERT(tc, "multgetp returned too few results", apr_hash_count(values) == TDATA_SET); - + for (hi = apr_hash_first(p, tdata); hi; hi = apr_hash_next(hi)) { const void *k; const char *key; - + apr_hash_this(hi, &k, NULL, NULL); key = k; rv = apr_memcache_delete(memcache, key, 0); ABTS_ASSERT(tc, "delete failed", rv == APR_SUCCESS); } - + } /* test setting and getting */ @@ -507,17 +507,17 @@ static void test_memcache_setget(abts_case * tc, void *data) create_test_hash(pool, tdata); for (hi = apr_hash_first(p, tdata); hi; hi = apr_hash_next(hi)) { - const void *k; - void *v; + const void *k; + void *v; const char *key; - apr_hash_this(hi, &k, NULL, &v); + apr_hash_this(hi, &k, NULL, &v); key = k; - rv = apr_memcache_set(memcache, key, v, strlen(v), 0, 27); - ABTS_ASSERT(tc, "set failed", rv == APR_SUCCESS); - rv = apr_memcache_getp(memcache, pool, key, &result, &len, NULL); - ABTS_ASSERT(tc, "get failed", rv == APR_SUCCESS); + rv = apr_memcache_set(memcache, key, v, strlen(v), 0, 27); + ABTS_ASSERT(tc, "set failed", rv == APR_SUCCESS); + rv = apr_memcache_getp(memcache, pool, key, &result, &len, NULL); + ABTS_ASSERT(tc, "get failed", rv == APR_SUCCESS); } rv = apr_memcache_getp(memcache, pool, "nothere3423", &result, &len, NULL); @@ -525,19 +525,19 @@ static void test_memcache_setget(abts_case * tc, void *data) ABTS_ASSERT(tc, "get should have failed", rv != APR_SUCCESS); for (hi = apr_hash_first(p, tdata); hi; hi = apr_hash_next(hi)) { - const void *k; - const char *key; + const void *k; + const char *key; - apr_hash_this(hi, &k, NULL, NULL); - key = k; + apr_hash_this(hi, &k, NULL, NULL); + key = k; - rv = apr_memcache_delete(memcache, key, 0); - ABTS_ASSERT(tc, "delete failed", rv == APR_SUCCESS); + rv = apr_memcache_delete(memcache, key, 0); + ABTS_ASSERT(tc, "delete failed", rv == APR_SUCCESS); } } -/* use apr_socket stuff to see if there is in fact a memcached server - * running on PORT. +/* use apr_socket stuff to see if there is in fact a memcached server + * running on PORT. */ static apr_status_t check_mc(void) { @@ -604,7 +604,7 @@ abts_suite *testmemcache(abts_suite * suite) { apr_status_t rv; suite = ADD_SUITE(suite); - /* check for a running memcached on the typical port before + /* check for a running memcached on the typical port before * trying to run the tests. succeed silently if we don't find one. */ rv = check_mc(); From 1f55ea0d99956a9c7b6c6c0249218c3708091fca Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 9 Apr 2011 20:07:58 +0000 Subject: [PATCH 6975/7878] improve sync between apr.h and apr.hw notably, APR_HAS_SENDFILE and APR_HAS_MMAP are now enabled for MinGW builds git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1090664 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 6 ++++++ configure.in | 13 ++++++++++++- include/apr.hw | 10 ++++++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index cd13aaa2d71..7f2e53c3692 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -457,16 +457,22 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(ac_cv_tcp_nodelay_inherited, [yes]) APR_SETIFNULL(ac_cv_file__dev_zero, [no]) APR_SETIFNULL(ac_cv_func_setpgrp_void, [no]) + APR_SETIFNULL(ac_cv_func_mmap, [yes]) case $host in *mingw32*) APR_SETIFNULL(apr_has_xthread_files, [1]) APR_SETIFNULL(apr_has_user, [1]) APR_SETIFNULL(apr_procattr_user_set_requires_password, [1]) + dnl The real function is TransmitFile(), not sendfile(), but + dnl this bypasses the Linux/Solaris/AIX/etc. test and enables + dnl the TransmitFile() implementation. + APR_SETIFNULL(ac_cv_func_sendfile, [yes]) ;; *mingwce) APR_SETIFNULL(apr_has_xthread_files, [0]) APR_SETIFNULL(apr_has_user, [0]) APR_SETIFNULL(apr_procattr_user_set_requires_password, [0]) + APR_SETIFNULL(ac_cv_func_sendfile, [no]) ;; esac ;; diff --git a/configure.in b/configure.in index 3699ee7133a..095c0d0bac7 100644 --- a/configure.in +++ b/configure.in @@ -1289,7 +1289,6 @@ APR_FLAG_HEADERS( mach-o/dyld.h \ malloc.h \ memory.h \ - mswsock.h \ netdb.h \ osreldate.h \ poll.h \ @@ -1341,6 +1340,18 @@ APR_FLAG_HEADERS( sys/un.h \ sys/wait.h) +# Windows' requires first +AC_CACHE_CHECK([for mswsock.h], [apr_cv_hdr_mswsock_h], +[AC_TRY_CPP( +[#include +#include +], [apr_cv_hdr_mswsock_h=yes], [apr_cv_hdr_mswsock_h=no])]) +if test "$apr_cv_hdr_mswsock_h" = "yes"; then + mswsockh=1 +else + mswsockh=0 +fi + # IRIX 6.5 has a problem in which prevents it from # being included by itself. Check for manually, # including another header file first. diff --git a/include/apr.hw b/include/apr.hw index a98636e12b4..80688d0fe10 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -122,6 +122,7 @@ #define APR_HAVE_DIRENT_H 0 #define APR_HAVE_ERRNO_H APR_NOT_IN_WCE #define APR_HAVE_FCNTL_H APR_NOT_IN_WCE +#define APR_HAVE_IF_ADDRS_H 0 #define APR_HAVE_IO_H APR_NOT_IN_WCE #define APR_HAVE_LIMITS_H APR_NOT_IN_WCE #define APR_HAVE_MSWSOCK_H APR_NOT_IN_WCE @@ -130,6 +131,7 @@ #define APR_HAVE_NETINET_SCTP_H 0 #define APR_HAVE_NETINET_SCTP_UIO_H 0 #define APR_HAVE_NETINET_TCP_H 0 +#define APR_HAVE_PROCESS_H 1 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SEMAPHORE_H 0 #define APR_HAVE_SIGNAL_H APR_NOT_IN_WCE @@ -222,14 +224,14 @@ #include #endif -#if APR_HAVE_SYS_SOCKET_H -#include -#endif - #if APR_HAVE_STDDEF_H #include #endif +#if APR_HAVE_SYS_SOCKET_H +#include +#endif + #if APR_HAVE_STDINT_H #include #endif From cf9339bca711318261641ed70c6ee2543659b71b Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 10 Apr 2011 20:07:31 +0000 Subject: [PATCH 6976/7878] Prepare NetWare build system for other compilers. Initial patch from NormW ; various modifications and adds by fuankg. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1090884 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 14 +-- build/NWGNUenvironment.inc | 157 +++++++++++++++++---------- build/NWGNUmakefile | 39 ++++--- build/NWGNUtail.inc | 81 +++++--------- build/{nw_export.inc => nw_export.h} | 0 file_io/netware/filepath.c | 4 - 6 files changed, 149 insertions(+), 146 deletions(-) rename build/{nw_export.inc => nw_export.h} (100%) diff --git a/NWGNUmakefile b/NWGNUmakefile index 4c96325e155..19884c8e583 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -43,10 +43,9 @@ include $(APR_WORK)/build/NWGNUhead.inc XINCDIRS += \ $(APR)/include \ $(APR)/include/private \ - $(APR)/include/arch/NetWare \ + $(APR)/include/arch/netware \ $(APR)/include/arch/unix \ $(APR)/dbm/sdbm \ - $(APR)/memory/unix \ $(APR)/random/unix \ $(LDAPSDK)/inc \ $(EOLIST) @@ -428,6 +427,7 @@ nlms :: libs $(TARGET_nlm) # Updated this target to create necessary directories and copy files to the # correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples) # + install :: nlms $(INSTDIRS) FORCE $(call COPY,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/) ifndef DEST @@ -453,9 +453,10 @@ endif # Any specialized rules here # +vpath filepath.c file_io/win32 vpath %.c atomic/netware:strings:tables:passwd:time/unix -vpath %.c file_io/unix:locks/netware:misc/netware:misc/unix:threadproc/netware -vpath %.c poll/unix:shmem/unix:support/unix:random/unix +vpath %.c file_io/netware:file_io/unix:locks/netware:misc/netware:misc/unix +vpath %.c threadproc/netware:poll/unix:shmem/unix:support/unix:random/unix vpath %.c dso/netware:memory/unix:mmap/unix:user/netware:util-misc vpath %.c buckets:crypto:dbd:dbm:dbm/sdbm:encoding:hooks:memcache:misc:strmatch:uri:xlate @@ -465,11 +466,6 @@ vpath %.c network_io/win32 endif vpath %.c network_io/unix -$(OBJDIR)/%.o: file_io/netware/%.c $(OBJDIR)/$(NLM_NAME)_cc.opt -# @echo Compiling $< - @echo $(DL)CC $<$(DL) - $(CC) -cwd source -o $@ $< @$(OBJDIR)/$(NLM_NAME)_cc.opt - # # Include the 'tail' makefile that has targets that depend on variables defined # in this makefile diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 1ec4e33aa50..ff868b58a27 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -71,10 +71,6 @@ ifndef EXPAT_INC $(error neither EXPATSDK nor EXPATSRC defined - cant compile without EXPAT SDK or source tree) endif -ifndef METROWERKS -METROWERKS = $(ProgramFiles)\Metrowerks\CodeWarrior -endif - # If LM_LICENSE_FILE isn't defined, define a variable that can be used to # restart make with it defined ifndef LM_LICENSE_FILE @@ -134,14 +130,105 @@ OBJDIR = obj_$(RELEASE) # Setup compiler information # +ifdef METROWERKS # MetroWerks NLM tools -CC = mwccnlm -CPP = mwccnlm -LINK = mwldnlm -LIB = mwldnlm -type library -w nocmdline +#ifndef METROWERKS +#METROWERKS = $(ProgramFiles)\Metrowerks\CodeWarrior +#endif + +CC = mwccnlm -w nocmdline -nosyspath +CPP = $(CC) +CPRE = $(CC) -P -EP +LINK = mwldnlm -w nocmdline +AR = $(LINK) -type library + +ifneq ($(findstring /sh,$(SHELL)),/sh) +PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools +endif + +# MetroWerks static Libraries +CLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime/mwcrtl.lib +MATH3S = +PLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP.lib + +# Base compile flags +# and prefix or precompiled header added here. + +# The default flags are as follows: +# +# -w nocmdline disable command-line driver/parser warnings +# -nosyspath treat #include <...> like #include "..." +# -Cpp_exceptions off disable C++ exceptions +# -RTTI off disable C++ run-time typing information +# -align 4 align on 4 byte bounderies +# -proc PII generate code base on Pentium II instruction set +# -inst mmx use MMX extensions (not used) + +CFLAGS = -proc PII -align 4 +CPFLAGS = -Cpp_exceptions off -RTTI off + +ifeq "$(REQUIRE_PROTOTYPES)" "1" +CFLAGS += -r +endif + +# -g generate debugging information +# -O0 level 0 optimizations +ifeq "$(RELEASE)" "debug" +CFLAGS += -g -O0 +endif + +# -O4,p level 4 optimizations, optimize for speed +ifeq "$(RELEASE)" "release" +CFLAGS += -O4,p +endif + +PRELUDE = $(NOVI)/libcpre.o + +else +# GNU NLM tools (gcc / nlmconv) + +CC = gcc +CPP = g++ +CPRE = $(CC) -E +LINK = nlmconv -UT +AR = ar cru +RANLIB = ranlib + +CFLAGS = -m32 -fno-builtin -fpcc-struct-return -fstrict-aliasing +CFLAGS += -fpack-struct=4 +CFLAGS += -Wall +CFLAGS += -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes + +ifdef MAINTAINER +CFLAGS += \ + -W -Wpointer-arith -Wwrite-strings -Wunused -Wshadow -Winline \ + -Wnested-externs -Wcast-align -Wtype-limits -Wstrict-prototypes \ + -Wfloat-equal -Wno-multichar -Wsign-compare -Wundef -Wendif-labels \ + -Wold-style-declaration -Wmissing-parameter-type -Wempty-body \ + -Wclobbered -Wignored-qualifiers -Wconversion -Wvla -pedantic +endif + +# -g generate debugging information +# -O0 level 0 optimizations +ifeq "$(RELEASE)" "debug" +CFLAGS += -g -O0 +endif + +# -O3 level 3 optimizations, optimize for speed +ifeq "$(RELEASE)" "release" +CFLAGS += -O3 +endif + +PRELUDE = $(NOVI)/libcpre.gcc.o + +endif + +# -prefix apr_arch_pre_nw.h #include pre_nw.h for all files +CFLAGS += -prefix apr_arch_pre_nw.h + # Setup build tools -AWK = awk +AWK = awk # # Declare Command and tool macros here @@ -178,16 +265,14 @@ endif endif NOVI = $(NOVELLLIBC)/imports -PRELUDE = $(NOVI)/libcpre.o - -INCDIRS = $(NOVELLLIBC)/include; +INCDIRS = $(NOVELLLIBC)/include DEFINES = -DNETWARE ifdef USE_STDSOCKETS DEFINES += -DUSE_BSD_SOCKETS else DEFINES += -DUSE_WINSOCK -INCDIRS += $(NOVELLLIBC)/include/winsock; +INCDIRS += $(NOVELLLIBC)/include/winsock endif ifndef DEBUG DEFINES += -DNDEBUG @@ -199,50 +284,6 @@ else VERSION_SKT = (WINSOCK) endif -# MetroWerks static Libraries -CLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime/mwcrtl.lib -MATH3S = -PLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP.lib - -# Base compile flags -# and prefix or precompiled header added here. - -# The default flags are as follows: -# -# -c compile only, no link -# -nosyspath treat #include <...> like #include "..." -# -Cpp_exceptions off disable C++ exceptions -# -RTTI off disable C++ run-time typing information -# -align 4 align on 4 byte bounderies -# -w nocmdline disable command-line driver/parser warnings -# -proc PII generate code base on Pentium II instruction set -# -inst mmx use MMX extensions (not used) - -CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII - -ifeq "$(REQUIRE_PROTOTYPES)" "1" -CFLAGS += -r -endif - -# -g generate debugging information -# -O0 level 0 optimizations -ifeq "$(RELEASE)" "debug" -CFLAGS += -g -O0 -endif - -# -O4,p level 4 optimizations, optimize for speed -ifeq "$(RELEASE)" "release" -CFLAGS += -O4,p -endif - -# -prefix apr_arch_pre_nw.h #include pre_nw.h for all files -CFLAGS += -prefix apr_arch_pre_nw.h - - -ifneq ($(findstring /sh,$(SHELL)),/sh) -PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools -endif - # # Declare major project deliverables output directories here # @@ -270,7 +311,7 @@ endif # Add support for building IPV6 alongside ifneq "$(IPV6)" "" DEFINES += -DNW_BUILD_IPV6 -# INCDIRS := $(NOVELLLIBC)/include/winsock/IPV6;$(INCDIRS) +# INCDIRS := $(NOVELLLIBC)/include/winsock/IPV6 $(INCDIRS) ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6" OBJDIR := $(OBJDIR)_IPV6 diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index 8be33a105f4..fc51a7e3832 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -15,6 +15,23 @@ include $(APR_WORK)/build/NWGNUhead.inc # # build this level's files +# +# Make sure all needed macro's are defined +# + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(APR)/include \ + $(APR)/include/private \ + $(APR)/include/arch/netware \ + $(APR)/include/arch/unix \ + $(APRBUILD) \ + $(LDAPSDK)/inc \ + $(EOLIST) + FILES_prebuild_headers = \ $(APR)/include/apr.h \ $(APR)/include/apu_want.h \ @@ -25,30 +42,12 @@ FILES_prebuild_headers = \ nlms :: $(APR)/aprlib.imp $(APR)/aprlib.imp : make_nw_export.awk nw_export.i -# @echo Generating $@ @echo $(DL)GEN $@$(DL) $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ >$@ -nw_export.i : nw_export.inc $(FILES_prebuild_headers) cc.opt -# @echo Generating $@ +nw_export.i : nw_export.h $(FILES_prebuild_headers) $(CCOPT_DEPENDS) @echo $(DL)GEN $@$(DL) - $(CC) $< @cc.opt - -cc.opt : NWGNUmakefile $(APR)/build/NWGNUenvironment.inc $(APR)/build/NWGNUhead.inc $(APR)/build/NWGNUtail.inc $(CUSTOM_INI) - @echo -P > $@ - @echo -EP >> $@ - @echo -nosyspath >> $@ - @echo -w nocmdline >> $@ - @echo $(DEFINES) -DGENEXPORTS >> $@ - @echo -I$(APR)/include >> $@ - @echo -I$(APR)/include/private >> $@ - @echo -I$(APR)/include/arch/netware >> $@ - @echo -I$(APR)/include/arch/unix >> $@ - @echo -I$(APR)/build >> $@ - @echo -ir $(NOVELLLIBC) >> $@ -ifneq "$(LDAPSDK)" "" - @echo -ir $(LDAPSDK) >> $@ -endif + $(CPRE) $(CCFLAGS) -DGENEXPORTS $< -o $@ %.h: %.hnw @echo Creating $@ diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index e6cc66274f7..9c789eb73ac 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -51,7 +51,6 @@ endif # Create dependency lists based on the files available # - CCOPT_DEPENDS = \ $(APRBUILD)/NWGNUhead.inc \ $(APRBUILD)/NWGNUenvironment.inc \ @@ -94,8 +93,8 @@ endif ifeq "$(wildcard NWGNU$(NLM_NAME))" "NWGNU$(NLM_NAME)" $(NLM_NAME)_LINKOPT_DEPENDS += NWGNU$(NLM_NAME) -CCOPT_DEPENDS += NWGNU$(NLM_NAME) -CPPOPT_DEPENDS += NWGNU$(NLM_NAME) +CCOPT_DEPENDS += NWGNU$(NLM_NAME) +CPPOPT_DEPENDS += NWGNU$(NLM_NAME) endif # @@ -129,69 +128,43 @@ INCLUDE_BLDCMDS = 1 CCOPT_NAME = $(LIB_NAME) endif -ifeq "$(INCLUDE_BLDCMDS)" "1" - -$(OBJDIR)/%.o: %.c $(OBJDIR)/$(CCOPT_NAME)_cc.opt -# @echo Compiling $< - @echo $(DL)CC $<$(DL) - $(CC) -o $@ $< @$(word 2, $^) - -$(OBJDIR)/$(CCOPT_NAME)_cc.opt: $(CCOPT_DEPENDS) - $(call DEL,$@) -ifdef VERBOSE - @echo CCOPT_DEPENDS=$^ -endif -# @echo Generating $@ - @echo $(DL)GEN $@$(DL) +CCFLAGS = ifneq "$(strip $(CFLAGS))" "" - @echo $(DL)$(CFLAGS)$(DL)>> $@ +CCFLAGS += $(CFLAGS) endif ifneq "$(strip $(XCFLAGS))" "" - @echo $(DL)$(XCFLAGS)$(DL)>> $@ +CCFLAGS += $(XCFLAGS) endif ifneq "$(strip $(XINCDIRS))" "" - @echo $(DL)$(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir))$(DL)>> $@ +CCFLAGS += $(foreach xincdir,$(strip $(XINCDIRS)),-I$(xincdir)) endif ifneq "$(strip $(INCDIRS))" "" - @echo $(DL)$(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir))$(DL)>> $@ +CCFLAGS += $(foreach incdir,$(strip $(INCDIRS)),-I$(incdir)) endif ifneq "$(strip $(DEFINES))" "" - @echo $(DL)$(DEFINES)$(DL)>> $@ +CCFLAGS += $(DEFINES) endif ifneq "$(strip $(XDEFINES))" "" - @echo $(DL)$(XDEFINES)$(DL)>> $@ +CCFLAGS += $(XDEFINES) endif -$(OBJDIR)/%.o: %.cpp $(OBJDIR)/$(CCOPT_NAME)_cpp.opt -# @echo Compiling $< - @echo $(DL)CPP $<$(DL) - $(CCP) -o $@ $< @$(word 2, $^) +ifeq "$(INCLUDE_BLDCMDS)" "1" -$(OBJDIR)/$(CCOPT_NAME)_cpp.opt: $(CPPOPT_DEPENDS) - $(call DEL,$@) +$(OBJDIR)/%.o: %.c $(CCOPT_DEPENDS) + @echo $(DL)CC $<$(DL) ifdef VERBOSE - @echo CPPOPT_DEPENDS=$^ -endif -# @echo Generating $@ - @echo $(DL)GEN $@$(DL) -ifneq "$(strip $(CFLAGS))" "" - @echo $(DL)$(CFLAGS)$(DL)>> $@ + @echo CCOPT_DEPENDS=$(CCOPT_DEPENDS) endif -ifneq "$(strip $(XCFLAGS))" "" - @echo $(DL)$(XCFLAGS)$(DL)>> $@ -endif -ifneq "$(strip $(XINCDIRS))" "" - @echo $(DL)$(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir))$(DL)>> $@ -endif -ifneq "$(strip $(INCDIRS))" "" - @echo $(DL)$(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir))$(DL)>> $@ -endif -ifneq "$(strip $(DEFINES))" "" - @echo $(DL)$(DEFINES)$(DL)>> $@ -endif -ifneq "$(strip $(XDEFINES))" "" - @echo $(DL)$(XDEFINES)$(DL)>> $@ + $(CC) $(CCFLAGS) -c -o $@ $< + +CCPFLAGS = $(CPFLAGS) $(CCFLAGS) + +$(OBJDIR)/%.o: %.cpp $(CPPOPT_DEPENDS) + @echo $(DL)CPP $<$(DL) +ifdef VERBOSE + @echo CPPOPT_DEPENDS=$(CPPOPT_DEPENDS) endif + $(CPP) $(CCPFLAGS) -c -o $@ $< endif # one target nlm or lib @@ -205,14 +178,15 @@ ifeq "$(words $(strip $(TARGET_lib)))" "1" $(TARGET_lib) : $(OBJDIR)/$(LIB_NAME)_lib.lst $(call DEL,$@) -# @echo Generating $@ @echo $(DL)AR $@$(DL) - $(LIB) -o $@ @$< + $(AR) -o $@ @$< +ifdef RANLIB + $(RANLIB) $@ +endif $(OBJDIR)/aprlib_lib.lst: $(aprlib_LIBLST_DEPENDS) $(call DEL,$@) ifneq "$(strip $(FILES_lib_objs))" "" -# @echo Generating $@ @echo $(DL)GEN $@$(DL) @echo $(DL)$(wordlist 1, 10, $(FILES_lib_objs))$(DL)>> $@ @echo $(DL)$(wordlist 11, 20, $(FILES_lib_objs))$(DL)>> $@ @@ -230,7 +204,6 @@ endif $(OBJDIR)/%_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS) $(call DEL,$@) ifneq "$(strip $(FILES_lib_objs))" "" -# @echo Generating $@ @echo $(DL)GEN $@$(DL) @echo $(DL)$(FILES_lib_objs)$(DL)>> $@ endif @@ -251,7 +224,6 @@ endif ifeq "$(words $(strip $(TARGET_nlm)))" "1" $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.opt -# @echo Linking $@ @echo $(DL)LINK $@$(DL) $(LINK) @$(OBJDIR)/$(NLM_NAME)_link.opt @@ -261,7 +233,6 @@ $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.o $(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) $(call DEL,$@) $(call DEL,$(@:.opt=.def)) -# @echo Generating $@ @echo $(DL)GEN $@$(DL) @echo $(DL)# Do not edit this file - it is created by make!$(DL) > $@ @echo $(DL)# All your changes will be lost!!$(DL)>> $@ diff --git a/build/nw_export.inc b/build/nw_export.h similarity index 100% rename from build/nw_export.inc rename to build/nw_export.h diff --git a/file_io/netware/filepath.c b/file_io/netware/filepath.c index e4bb3f36cb1..e69de29bb2d 100644 --- a/file_io/netware/filepath.c +++ b/file_io/netware/filepath.c @@ -1,4 +0,0 @@ -/* NetWare & Win32 have much in common with regards to file names (both are - * DOSish) so it makes sense to share some code - */ -#include "../win32/filepath.c" From 13778407b7497852eb7d55587e0d56fb5b6c4977 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 10 Apr 2011 20:10:28 +0000 Subject: [PATCH 6977/7878] Removed file which was left over by commit r1090884. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1090885 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filepath.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 file_io/netware/filepath.c diff --git a/file_io/netware/filepath.c b/file_io/netware/filepath.c deleted file mode 100644 index e69de29bb2d..00000000000 From 583e532aac121269fe878ec9c9d1d3d3f2271e67 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 10 Apr 2011 21:52:38 +0000 Subject: [PATCH 6978/7878] Some more NetWare build fixes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1090896 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUenvironment.inc | 22 +++++++++++----------- build/NWGNUtail.inc | 2 +- ldap/NWGNUmakefile | 2 +- test/NWGNUaprtest | 2 +- test/NWGNUechod | 2 +- test/NWGNUglobalmutexchild | 2 +- test/NWGNUmod_test | 2 +- test/NWGNUproc_child | 2 +- test/NWGNUreadchild | 2 +- test/NWGNUsockchild | 2 +- test/NWGNUsockperf | 2 +- test/NWGNUtestatmc | 2 +- test/NWGNUtryread | 2 +- xml/NWGNUmakefile | 2 +- 14 files changed, 24 insertions(+), 24 deletions(-) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index ff868b58a27..0c85526a10e 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -136,11 +136,11 @@ ifdef METROWERKS #METROWERKS = $(ProgramFiles)\Metrowerks\CodeWarrior #endif -CC = mwccnlm -w nocmdline -nosyspath -CPP = $(CC) -CPRE = $(CC) -P -EP +CC = mwccnlm -w nocmdline -nosyspath +CPP = $(CC) +CPRE = $(CC) -EP LINK = mwldnlm -w nocmdline -AR = $(LINK) -type library +AR = $(LINK) -type library -o ifneq ($(findstring /sh,$(SHELL)),/sh) PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools @@ -187,11 +187,11 @@ PRELUDE = $(NOVI)/libcpre.o else # GNU NLM tools (gcc / nlmconv) -CC = gcc -CPP = g++ -CPRE = $(CC) -E +CC = gcc +CPP = g++ +CPRE = $(CC) -P -E LINK = nlmconv -UT -AR = ar cru +AR = ar cru RANLIB = ranlib CFLAGS = -m32 -fno-builtin -fpcc-struct-return -fstrict-aliasing @@ -223,12 +223,12 @@ PRELUDE = $(NOVI)/libcpre.gcc.o endif -# -prefix apr_arch_pre_nw.h #include pre_nw.h for all files -CFLAGS += -prefix apr_arch_pre_nw.h +# -include apr_arch_pre_nw.h #include pre_nw.h for all files +CFLAGS += -include apr_arch_pre_nw.h # Setup build tools -AWK = awk +AWK = awk # # Declare Command and tool macros here diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 9c789eb73ac..b095f62418f 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -179,7 +179,7 @@ ifeq "$(words $(strip $(TARGET_lib)))" "1" $(TARGET_lib) : $(OBJDIR)/$(LIB_NAME)_lib.lst $(call DEL,$@) @echo $(DL)AR $@$(DL) - $(AR) -o $@ @$< + $(AR) $@ @$< ifdef RANLIB $(RANLIB) $@ endif diff --git a/ldap/NWGNUmakefile b/ldap/NWGNUmakefile index 58bac625123..da6e6f8b503 100644 --- a/ldap/NWGNUmakefile +++ b/ldap/NWGNUmakefile @@ -25,7 +25,7 @@ include $(APR_WORK)/build/NWGNUhead.inc # XINCDIRS += \ $(APR)/include \ - $(APR)/include/arch/NetWare \ + $(APR)/include/arch/netware \ $(APR)/include/private \ $(LDAPSDK)/inc \ $(EOLIST) diff --git a/test/NWGNUaprtest b/test/NWGNUaprtest index 6b6ac26c54e..81bbbde76ba 100644 --- a/test/NWGNUaprtest +++ b/test/NWGNUaprtest @@ -17,7 +17,7 @@ endif # XINCDIRS += \ $(APR)/include \ - $(APR)/include/arch/NetWare \ + $(APR)/include/arch/netware \ $(LDAPSDK)/inc \ $(EOLIST) diff --git a/test/NWGNUechod b/test/NWGNUechod index 54280b14512..39939b8be90 100644 --- a/test/NWGNUechod +++ b/test/NWGNUechod @@ -17,7 +17,7 @@ endif # XINCDIRS += \ $(APR)/include \ - $(APR)/include/arch/NetWare \ + $(APR)/include/arch/netware \ $(EOLIST) # diff --git a/test/NWGNUglobalmutexchild b/test/NWGNUglobalmutexchild index fef38fe6c92..6d8fd5bd281 100644 --- a/test/NWGNUglobalmutexchild +++ b/test/NWGNUglobalmutexchild @@ -17,7 +17,7 @@ endif # XINCDIRS += \ $(APR)/include \ - $(APR)/include/arch/NetWare \ + $(APR)/include/arch/netware \ $(EOLIST) # diff --git a/test/NWGNUmod_test b/test/NWGNUmod_test index 97bdfcd2491..f8f16976eb4 100644 --- a/test/NWGNUmod_test +++ b/test/NWGNUmod_test @@ -17,7 +17,7 @@ endif # XINCDIRS += \ $(APR)/include \ - $(APR)/include/arch/NetWare \ + $(APR)/include/arch/netware \ $(EOLIST) # diff --git a/test/NWGNUproc_child b/test/NWGNUproc_child index 05438aa1a9d..9e190721e29 100644 --- a/test/NWGNUproc_child +++ b/test/NWGNUproc_child @@ -17,7 +17,7 @@ endif # XINCDIRS += \ $(APR)/include \ - $(APR)/include/arch/NetWare \ + $(APR)/include/arch/netware \ $(EOLIST) # diff --git a/test/NWGNUreadchild b/test/NWGNUreadchild index f1836b8f5b7..be111649deb 100644 --- a/test/NWGNUreadchild +++ b/test/NWGNUreadchild @@ -17,7 +17,7 @@ endif # XINCDIRS += \ $(APR)/include \ - $(APR)/include/arch/NetWare \ + $(APR)/include/arch/netware \ $(EOLIST) # diff --git a/test/NWGNUsockchild b/test/NWGNUsockchild index 618ad4760f8..2a7a4f68d0e 100644 --- a/test/NWGNUsockchild +++ b/test/NWGNUsockchild @@ -17,7 +17,7 @@ endif # XINCDIRS += \ $(APR)/include \ - $(APR)/include/arch/NetWare \ + $(APR)/include/arch/netware \ $(EOLIST) # diff --git a/test/NWGNUsockperf b/test/NWGNUsockperf index ea3a55679f7..e10b3f311d0 100644 --- a/test/NWGNUsockperf +++ b/test/NWGNUsockperf @@ -17,7 +17,7 @@ endif # XINCDIRS += \ $(APR)/include \ - $(APR)/include/arch/NetWare \ + $(APR)/include/arch/netware \ $(EOLIST) # diff --git a/test/NWGNUtestatmc b/test/NWGNUtestatmc index 8bb47602fdc..1a0484a5d5b 100644 --- a/test/NWGNUtestatmc +++ b/test/NWGNUtestatmc @@ -17,7 +17,7 @@ endif # XINCDIRS += \ $(APR)/include \ - $(APR)/include/arch/NetWare \ + $(APR)/include/arch/netware \ $(EOLIST) # diff --git a/test/NWGNUtryread b/test/NWGNUtryread index e6c3eee5d56..52246fe62b1 100644 --- a/test/NWGNUtryread +++ b/test/NWGNUtryread @@ -17,7 +17,7 @@ endif # XINCDIRS += \ $(APR)/include \ - $(APR)/include/arch/NetWare \ + $(APR)/include/arch/netware \ $(EOLIST) # diff --git a/xml/NWGNUmakefile b/xml/NWGNUmakefile index 02f08e87962..9225c6bce4d 100644 --- a/xml/NWGNUmakefile +++ b/xml/NWGNUmakefile @@ -66,7 +66,7 @@ XINCDIRS += \ $(EXPAT_INC) \ $(APR)/include \ $(APR)/include/private \ - $(APR)/include/arch/NetWare \ + $(APR)/include/arch/netware \ $(EOLIST) # From 5d16f7e8be137207556fcc12463a289746301ed9 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 11 Apr 2011 00:59:35 +0000 Subject: [PATCH 6979/7878] Avoid redefines. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1090918 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_arch_pre_nw.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/arch/netware/apr_arch_pre_nw.h b/include/arch/netware/apr_arch_pre_nw.h index 7380e118226..9b441402ccc 100644 --- a/include/arch/netware/apr_arch_pre_nw.h +++ b/include/arch/netware/apr_arch_pre_nw.h @@ -18,19 +18,22 @@ #include -#ifndef __GNUC__ +#ifdef __MWERKS__ #pragma precompile_target "precomp.mch" #endif +#ifndef NETWARE #define NETWARE +#endif +#ifndef N_PLAT_NLM #define N_PLAT_NLM +#endif #define FAR #define far -/* no-op for Codewarrior C compiler; a functions are cdecl - by default */ +/* no-op for Codewarrior C compiler; all functions are cdecl by default */ #define cdecl /* if we have wchar_t enabled in C++, predefine this type to avoid From 50a618aef21c2724859cfec5727b1306b337567f Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 11 Apr 2011 18:31:50 +0000 Subject: [PATCH 6980/7878] Cleanup apr_ldap_rebind.c. Removed obsolete header includes; moved apr_ldap.h inclusion + check for APR_HAS_LDAP up so that we skip further senseless header includes when we dont compile with LDAP. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1091161 13f79535-47bb-0310-9956-ffa450edef68 --- ldap/apr_ldap_rebind.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ldap/apr_ldap_rebind.c b/ldap/apr_ldap_rebind.c index 39215770b3f..57786d926d5 100644 --- a/ldap/apr_ldap_rebind.c +++ b/ldap/apr_ldap_rebind.c @@ -22,22 +22,20 @@ */ #include "apr.h" -#include "apu.h" #include "apr_private.h" +#include "apr_ldap.h" + +#if APR_HAS_LDAP #if APR_HAVE_MODULAR_DSO #define APU_DSO_LDAP_BUILD #endif -#include "apr_ldap.h" #include "apr_errno.h" #include "apr_strings.h" -#include "apr_ldap_rebind.h" #include "stdio.h" -#if APR_HAS_LDAP - /* Used to store information about connections for use in the referral rebind callback. */ struct apr_ldap_rebind_entry { apr_pool_t *pool; @@ -50,7 +48,6 @@ typedef struct apr_ldap_rebind_entry apr_ldap_rebind_entry_t; #ifdef NETWARE -#include "apr_private.h" #define get_apd APP_DATA* apd = (APP_DATA*)get_app_data(gLibId); #define apr_ldap_xref_lock ((apr_thread_mutex_t *)(apd->gs_ldap_xref_lock)) #define xref_head ((apr_ldap_rebind_entry_t *)(apd->gs_xref_head)) From 22310e5cb6a16cdfb6c1938ddd52c177e710d37f Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 11 Apr 2011 20:58:47 +0000 Subject: [PATCH 6981/7878] Changed funtion name; removed export declaration. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1091205 13f79535-47bb-0310-9956-ffa450edef68 --- xml/apr_xml.c | 2 +- xml/apr_xml_expat.c | 2 +- xml/apr_xml_internal.h | 2 +- xml/apr_xml_libxml2.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xml/apr_xml.c b/xml/apr_xml.c index 651e40f64c2..18423b564c4 100644 --- a/xml/apr_xml.c +++ b/xml/apr_xml.c @@ -316,7 +316,7 @@ static void cdata_handler(void *userdata, const char *data, int len) APR_DECLARE(apr_xml_parser *) apr_xml_parser_create(apr_pool_t *pool) { - return apr_xml_parser_create_ex(pool, &start_handler, &end_handler, &cdata_handler); + return apr_xml_parser_create_internal(pool, &start_handler, &end_handler, &cdata_handler); } APR_DECLARE(apr_status_t) apr_xml_parser_feed(apr_xml_parser *parser, diff --git a/xml/apr_xml_expat.c b/xml/apr_xml_expat.c index ed7571bdc5a..1df279988cf 100644 --- a/xml/apr_xml_expat.c +++ b/xml/apr_xml_expat.c @@ -91,7 +91,7 @@ static void default_handler(void *userData, const XML_Char *s, int len) } #endif -APR_DECLARE(apr_xml_parser *) apr_xml_parser_create_ex(apr_pool_t *pool, +apr_xml_parser* apr_xml_parser_create_internal(apr_pool_t *pool, void *start_func, void *end_func, void *cdata_func) { apr_xml_parser *parser = apr_pcalloc(pool, sizeof(*parser)); diff --git a/xml/apr_xml_internal.h b/xml/apr_xml_internal.h index 7c1ee8744f1..dfd191e3276 100644 --- a/xml/apr_xml_internal.h +++ b/xml/apr_xml_internal.h @@ -43,6 +43,6 @@ struct apr_xml_parser { XMLParserImpl *impl; }; -APR_DECLARE(apr_xml_parser *) apr_xml_parser_create_ex(apr_pool_t*, void*, void*, void*); +apr_xml_parser* apr_xml_parser_create_internal(apr_pool_t*, void*, void*, void*); #endif diff --git a/xml/apr_xml_libxml2.c b/xml/apr_xml_libxml2.c index 46f28546bd6..ad72441f9a8 100644 --- a/xml/apr_xml_libxml2.c +++ b/xml/apr_xml_libxml2.c @@ -61,7 +61,7 @@ XMLParserImpl* apr_xml_get_parser_impl(void) } -APR_DECLARE(apr_xml_parser *) apr_xml_parser_create_ex(apr_pool_t *pool, +apr_xml_parser* apr_xml_parser_create_internal(apr_pool_t *pool, void *start_func, void *end_func, void *cdata_func) { apr_xml_parser *parser = apr_pcalloc(pool, sizeof(*parser)); From d4e7c98ece49927357570f386e5bbc7877734e8d Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 11 Apr 2011 21:03:29 +0000 Subject: [PATCH 6982/7878] Fixed Netware build issue with the casted defines. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1091211 13f79535-47bb-0310-9956-ffa450edef68 --- ldap/apr_ldap_rebind.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ldap/apr_ldap_rebind.c b/ldap/apr_ldap_rebind.c index 57786d926d5..44772c2e4aa 100644 --- a/ldap/apr_ldap_rebind.c +++ b/ldap/apr_ldap_rebind.c @@ -48,15 +48,16 @@ typedef struct apr_ldap_rebind_entry apr_ldap_rebind_entry_t; #ifdef NETWARE -#define get_apd APP_DATA* apd = (APP_DATA*)get_app_data(gLibId); -#define apr_ldap_xref_lock ((apr_thread_mutex_t *)(apd->gs_ldap_xref_lock)) -#define xref_head ((apr_ldap_rebind_entry_t *)(apd->gs_xref_head)) -#else +#define get_apd \ + APP_DATA* apd = (APP_DATA*)get_app_data(gLibId); \ + apr_ldap_xref_lock = (apr_thread_mutex_t *)apd->gs_ldap_xref_lock; \ + xref_head = (apr_ldap_rebind_entry_t *)apd->gs_xref_head; +#endif + #if APR_HAS_THREADS static apr_thread_mutex_t *apr_ldap_xref_lock = NULL; #endif static apr_ldap_rebind_entry_t *xref_head = NULL; -#endif static int apr_ldap_rebind_set_callback(LDAP *ld); static apr_status_t apr_ldap_rebind_remove_helper(void *data); From 5bef95b3abc35ca74781f6d130c5771f01ae7595 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 11 Apr 2011 22:47:14 +0000 Subject: [PATCH 6983/7878] fix typo in comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1091243 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index 80688d0fe10..33d6a0cdbc4 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -707,7 +707,7 @@ typedef int gid_t; && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) #endif -#endif /* APR_HAS_IPV6 */ +#endif /* APR_HAVE_IPV6 */ #ifdef __cplusplus } From 83956fe035a876d282f00139806ed1832052574b Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 12 Apr 2011 01:15:44 +0000 Subject: [PATCH 6984/7878] Blocked pragmas to avoid warnings with other compilers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1091274 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/libprews.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index 6e37ccf1d39..9f9db5c9c76 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -46,13 +46,7 @@ int _NonAppStart const char **messages ) { -#ifdef USE_WINSOCK - WSADATA wsaData; -#endif - apr_status_t status; - - NX_LOCK_INFO_ALLOC(liblock, "Per-Application Data Lock", 0); - +#ifdef __MWERKS__ #pragma unused(cmdLine) #pragma unused(loadDirPath) #pragma unused(uninitializedDataLength) @@ -62,6 +56,13 @@ int _NonAppStart #pragma unused(customDataSize) #pragma unused(messageCount) #pragma unused(messages) +#endif +#ifdef USE_WINSOCK + WSADATA wsaData; +#endif + apr_status_t status; + + NX_LOCK_INFO_ALLOC(liblock, "Per-Application Data Lock", 0); gLibId = register_library(DisposeLibraryData); From 0cedec04add22a2f83c1cc793be983a905e12241 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 12 Apr 2011 17:00:17 +0000 Subject: [PATCH 6985/7878] for MinGW, hard-code the results of various IPv6 tests instead of butchering them enough to work with Winsock. Use --disable-ipv6 if not desired, or running on ancient machine. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1091498 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 7f2e53c3692..0f68bc4862d 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -458,6 +458,10 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(ac_cv_file__dev_zero, [no]) APR_SETIFNULL(ac_cv_func_setpgrp_void, [no]) APR_SETIFNULL(ac_cv_func_mmap, [yes]) + APR_SETIFNULL(ac_cv_define_sockaddr_in6, [yes]) + APR_SETIFNULL(ac_cv_working_getaddrinfo, [yes]) + APR_SETIFNULL(ac_cv_working_getnameinfo, [yes]) + APR_SETIFNULL(ac_cv_func_gai_strerror, [yes]) case $host in *mingw32*) APR_SETIFNULL(apr_has_xthread_files, [1]) From a710dfbdf9791ae10dfaf03ae894312535229ddc Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 13 Apr 2011 12:01:09 +0000 Subject: [PATCH 6986/7878] IPV6_V6ONLY on Windows: * Deal with SDKs which don't have the symbol definition * Deal with old run-time platforms which don't implement the option and have hard-coded behavior internally (option always on) Behavior changes: run on Windows >= Vista, SDK has IPV6_V6ONLY: no change in behavior run on Windows >= Vista, SDK doesn't have IPV6_V6ONLY: works just like SDK had the def'n (will return APR_SUCCESS on IPv6 socket instead of WSAENOPROTOOPT) run on Windows < Vista, regardless of SDK: socket_opt_get/set(APR_IPV6_V6ONLY) reflect stack behavior (always on) previously, if IPV6_V6ONLY was defined: set returned WSAENOPROTOOPT previously, if IPV6_V6ONLY was not defined: set returned APR_ENOTIMPL previously, regardless of IPV6_V6ONLY presence: get returned not-enabled now: get always returns enabled; set returns APR_SUCCESS when enabling, APR_ENOTIMPL when trying to disable PR: 45321 Submitted by: Sob Tweaked by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1091757 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockets.c | 6 ++++++ network_io/win32/sockopt.c | 21 ++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index a5ed1589926..be7ddcbde99 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -51,6 +51,12 @@ static void set_socket_vars(apr_socket_t *sock, int family, int type, int protoc sock->protocol = protocol; apr_sockaddr_vars_set(sock->local_addr, family, 0); apr_sockaddr_vars_set(sock->remote_addr, family, 0); +#if APR_HAVE_IPV6 + /* hard-coded behavior for older Windows IPv6 */ + if (apr_os_level < APR_WIN_VISTA && family == AF_INET6) { + apr_set_option(sock, APR_IPV6_V6ONLY, 1); + } +#endif } static void alloc_socket(apr_socket_t **new, apr_pool_t *p) { diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index c5a4e77152b..62b50d0a9da 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -15,11 +15,20 @@ */ #include "apr_arch_networkio.h" +#include "apr_arch_misc.h" /* apr_os_level */ #include "apr_network_io.h" #include "apr_general.h" #include "apr_strings.h" #include +/* IPV6_V6ONLY is missing from pre-Windows 2008 SDK as well as MinGW + * (at least up through 1.0.16). + * Runtime support is a separate issue. + */ +#ifndef IPV6_V6ONLY +#define IPV6_V6ONLY 27 +#endif + static apr_status_t soblock(SOCKET sd) { u_long zero = 0; @@ -195,7 +204,17 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, } break; case APR_IPV6_V6ONLY: -#if APR_HAVE_IPV6 && defined(IPV6_V6ONLY) +#if APR_HAVE_IPV6 + if (apr_os_level < APR_WIN_VISTA && + sock->local_addr->family == AF_INET6) { + /* apr_set_option() called at socket creation */ + if (on) { + return APR_SUCCESS; + } + else { + return APR_ENOTIMPL; + } + } /* we don't know the initial setting of this option, * so don't check sock->options since that optimization * won't work From fb8279d3a3981556e7185e10e24043c807b264b5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 13 Apr 2011 17:13:41 +0000 Subject: [PATCH 6987/7878] fix typo in APR_HAVE symbol git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1091851 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index 33d6a0cdbc4..7312205337c 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -122,7 +122,7 @@ #define APR_HAVE_DIRENT_H 0 #define APR_HAVE_ERRNO_H APR_NOT_IN_WCE #define APR_HAVE_FCNTL_H APR_NOT_IN_WCE -#define APR_HAVE_IF_ADDRS_H 0 +#define APR_HAVE_IFADDRS_H 0 #define APR_HAVE_IO_H APR_NOT_IN_WCE #define APR_HAVE_LIMITS_H APR_NOT_IN_WCE #define APR_HAVE_MSWSOCK_H APR_NOT_IN_WCE From 89dcfadb9fd8b65c26443030641f715d3cc65b35 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 14 Apr 2011 07:22:06 +0000 Subject: [PATCH 6988/7878] Fix VC10 release build running on Windows7/Server 2008 Submitted by: Steve Hay Forward ports: 1092025 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1092026 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/start.c | 47 +++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/misc/win32/start.c b/misc/win32/start.c index 22820e8e556..eb77d4a4ddd 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -45,7 +45,9 @@ static int warrsztoastr(const char * const * *retarr, apr_size_t totlen; apr_size_t newlen; apr_size_t wsize; - char **newarr; + char **env; + char *pstrs; + char *strs; int arg; if (args < 0) { @@ -55,37 +57,40 @@ static int warrsztoastr(const char * const * *retarr, } wsize = 1 + wch - arrsz; - newarr = apr_malloc_dbg((args + 1) * sizeof(char *), - __FILE__, __LINE__); - - /* This is a safe max allocation, we will realloc after - * processing and return the excess to the free store. + /* This is a safe max allocation, we will alloc each + * string exactly after processing and return this + * temporary buffer to the free store. * 3 ucs bytes hold any single wchar_t value (16 bits) * 4 ucs bytes will hold a wchar_t pair value (20 bits) */ newlen = totlen = wsize * 3 + 1; - newarr[0] = apr_malloc_dbg(newlen * sizeof(char), - __FILE__, __LINE__); + pstrs = strs = apr_malloc_dbg(newlen * sizeof(char), + __FILE__, __LINE__); - (void)apr_conv_ucs2_to_utf8(arrsz, &wsize, - newarr[0], &newlen); + (void)apr_conv_ucs2_to_utf8(arrsz, &wsize, strs, &newlen); assert(newlen && !wsize); - /* Return to the free store if the heap realloc is the least bit optimized - */ - newarr[0] = apr_realloc_dbg(newarr[0], totlen - newlen, - __FILE__, __LINE__); - for (arg = 1; arg < args; ++arg) { - newarr[arg] = newarr[arg - 1] + 2; - while (*(newarr[arg]++)) { - /* continue */; - } + *retarr = env = apr_malloc_dbg((args + 1) * sizeof(char*), + __FILE__, __LINE__); + for (arg = 0; arg < args; ++arg) { + char* p = pstrs; + int len = 0; + while (*p++) + ++len; + len += 1; + + *env = apr_malloc_dbg(len * sizeof(char), + __FILE__, __LINE__); + memcpy(*env, pstrs, len * sizeof(char)); + + pstrs += len; + ++env; } - newarr[arg] = NULL; + *env = NULL; + free(strs); - *retarr = newarr; return args; } #endif From 48e539d4a5a1fd307187c67fa320e6f0ce3d96d2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 17 Apr 2011 12:54:35 +0000 Subject: [PATCH 6989/7878] indentation fix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1094141 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/configure.in b/configure.in index 095c0d0bac7..c9dfc7a8aa6 100644 --- a/configure.in +++ b/configure.in @@ -447,19 +447,18 @@ case "$host:$CC" in APR_SETVAR(AR,ar) ;; -dnl If building static APR, both the APR build and the app build -dnl need -DAPR_DECLARE_STATIC to generate the right linkage from -dnl APR_DECLARE et al. -dnl If building dynamic APR, the APR build needs APR_DECLARE_EXPORT -dnl and the app build should have neither define. - + dnl If building static APR, both the APR build and the app build + dnl need -DAPR_DECLARE_STATIC to generate the right linkage from + dnl APR_DECLARE et al. + dnl If building dynamic APR, the APR build needs APR_DECLARE_EXPORT + dnl and the app build should have neither define. *-mingw* | *-cygwin*) - if test "$enable_shared" = "yes"; then - APR_ADDTO(INTERNAL_CPPFLAGS, -DAPR_DECLARE_EXPORT) - else - APR_ADDTO(CPPFLAGS, -DAPR_DECLARE_STATIC) - fi - ;; + if test "$enable_shared" = "yes"; then + APR_ADDTO(INTERNAL_CPPFLAGS, -DAPR_DECLARE_EXPORT) + else + APR_ADDTO(CPPFLAGS, -DAPR_DECLARE_STATIC) + fi + ;; esac AC_CACHE_CHECK([whether the compiler provides atomic builtins], [ap_cv_atomic_builtins], From 04441fcbca9f08b81f964de51896b9eaee70e563 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 29 Apr 2011 12:53:01 +0000 Subject: [PATCH 6990/7878] remove mention of Windows poll fix, now in 1.4.x branch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1097798 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGES b/CHANGES index 518929a740a..3643a3801ac 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) poll, pollset, pollcb on Windows: Handle calls with no file/socket - descriptors. PR 49882. [Stefan Ruppert , Jeff Trawick] - *) apr_socket_connect() on Windows: Handle WSAEISCONN. PR 48736. [, Jeff Trawick] From 682d0f1bb6a8d54465695e1972f26991a08c7739 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 1 May 2011 12:24:12 +0000 Subject: [PATCH 6991/7878] Security: CVE-2011-0419 Reported by: Maksymilian Arciemowicz Excessive CPU consumption was possible due to the unconstrained, recursive invocation of apr_fnmatch, as apr_fnmatch processed '*' wildcards. Introduce new apr_fnmatch implementation. This delivers optimizations in some common cases, without the underlying weakness of recursion present in older implementations. Submitted by: William Rowe Forward port: r1098289 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1098292 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 588 +++++++++++++++++++++++++++--------------- 1 file changed, 377 insertions(+), 211 deletions(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index aa250ecdcaa..1de72518949 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -1,50 +1,58 @@ -/* - * Copyright (c) 1989, 1993, 1994 - * The Regents of the University of California. All rights reserved. +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * This code is derived from software contributed to Berkeley by - * Guido van Rossum. + * http://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; -#endif /* LIBC_SCCS and not lint */ -/* - * Function fnmatch() as specified in POSIX 1003.2-1992, section B.6. - * Compares a filename or pathname to a pattern. +/* Derived from The Open Group Base Specifications Issue 7, IEEE Std 1003.1-2008 + * as described in; + * http://pubs.opengroup.org/onlinepubs/9699919799/functions/fnmatch.html + * + * Filename pattern matches defined in section 2.13, "Pattern Matching Notation" + * from chapter 2. "Shell Command Language" + * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13 + * where; 1. A bracket expression starting with an unquoted '^' + * character CONTINUES to specify a non-matching list; 2. an explicit '.' + * in a bracket expression matching list, e.g. "[.abc]" does NOT match a leading + * in a filename; 3. a '[' which does not introduce + * a valid bracket expression is treated as an ordinary character; 4. a differing + * number of consecutive slashes within pattern and string will NOT match; + * 5. a trailing '\' in FNM_ESCAPE mode is treated as an ordinary '\' character. + * + * Bracket expansion defined in section 9.3.5, "RE Bracket Expression", + * from chapter 9, "Regular Expressions" + * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_05 + * with no support for collating symbols, equivalence class expressions or + * character class expressions. A partial range expression with a leading + * hyphen following a valid range expression will match only the ordinary + * and the ending character (e.g. "[a-m-z]" will match characters + * 'a' through 'm', a '-', or a 'z'). + * + * NOTE: Only POSIX/C single byte locales are correctly supported at this time. + * Notably, non-POSIX locales with FNM_CASEFOLD produce undefined results, + * particularly in ranges of mixed case (e.g. "[A-z]") or spanning alpha and + * nonalpha characters within a range. + * + * XXX comments below indicate porting required for multi-byte character sets + * and non-POSIX locale collation orders; requires mbr* APIs to track shift + * state of pattern and string (rewinding pattern and string repeatedly). + * + * Certain parts of the code assume 0x00-0x3F are unique with any MBCS (e.g. + * UTF-8, SHIFT-JIS, etc). Any implementation allowing '\' as an alternate + * path delimiter must be aware that 0x5C is NOT unique within SHIFT-JIS. */ -#ifndef WIN32 -#include "apr_private.h" -#endif + #include "apr_file_info.h" #include "apr_fnmatch.h" #include "apr_tables.h" @@ -55,196 +63,354 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; # include #endif -#define EOS '\0' - -static const char *rangematch(const char *, int, int); -APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, const char *string, int flags) +/* Most MBCS/collation/case issues handled here. Wildcard '*' is not handled. + * EOS '\0' and the FNM_PATHNAME '/' delimiters are not advanced over, + * however the "\/" sequence is advanced to '/'. + * + * Both pattern and string are **char to support pointer increment of arbitrary + * multibyte characters for the given locale, in a later iteration of this code + */ +static __inline int fnmatch_ch(const char **pattern, const char **string, int flags) { - const char *stringstart; - char c, test; - - for (stringstart = string;;) { - switch (c = *pattern++) { - case EOS: - return (*string == EOS ? APR_SUCCESS : APR_FNM_NOMATCH); - case '?': - if (*string == EOS) { - return (APR_FNM_NOMATCH); - } - if (*string == '/' && (flags & APR_FNM_PATHNAME)) { - return (APR_FNM_NOMATCH); - } - if (*string == '.' && (flags & APR_FNM_PERIOD) && - (string == stringstart || - ((flags & APR_FNM_PATHNAME) && *(string - 1) == '/'))) { - return (APR_FNM_NOMATCH); - } - ++string; - break; - case '*': - c = *pattern; - /* Collapse multiple stars. */ - while (c == '*') { - c = *++pattern; - } - - if (*string == '.' && (flags & APR_FNM_PERIOD) && - (string == stringstart || - ((flags & APR_FNM_PATHNAME) && *(string - 1) == '/'))) { - return (APR_FNM_NOMATCH); - } - - /* Optimize for pattern with * at end or before /. */ - if (c == EOS) { - if (flags & APR_FNM_PATHNAME) { - return (strchr(string, '/') == NULL ? APR_SUCCESS : APR_FNM_NOMATCH); - } - else { - return (APR_SUCCESS); - } - } - else if (c == '/' && flags & APR_FNM_PATHNAME) { - if ((string = strchr(string, '/')) == NULL) { - return (APR_FNM_NOMATCH); - } - break; - } - - /* General case, use recursion. */ - while ((test = *string) != EOS) { - if (!apr_fnmatch(pattern, string, flags & ~APR_FNM_PERIOD)) { - return (APR_SUCCESS); - } - if (test == '/' && flags & APR_FNM_PATHNAME) { - break; - } - ++string; - } - return (APR_FNM_NOMATCH); - case '[': - if (*string == EOS) { - return (APR_FNM_NOMATCH); - } - if (*string == '/' && flags & APR_FNM_PATHNAME) { - return (APR_FNM_NOMATCH); - } - if (*string == '.' && (flags & APR_FNM_PERIOD) && - (string == stringstart || - ((flags & APR_FNM_PATHNAME) && *(string - 1) == '/'))) { - return (APR_FNM_NOMATCH); - } - if ((pattern = rangematch(pattern, *string, flags)) == NULL) { - return (APR_FNM_NOMATCH); - } - ++string; - break; - case '\\': - if (!(flags & APR_FNM_NOESCAPE)) { - if ((c = *pattern++) == EOS) { - c = '\\'; - --pattern; - } - } - /* FALLTHROUGH */ - default: - if (flags & APR_FNM_CASE_BLIND) { - if (apr_tolower(c) != apr_tolower(*string)) { - return (APR_FNM_NOMATCH); - } - } - else if (c != *string) { - return (APR_FNM_NOMATCH); - } - string++; - break; - } - /* NOTREACHED */ + const char * const mismatch = *pattern; + const int nocase = !!(flags & APR_FNM_CASE_BLIND); + const int escape = !(flags & APR_FNM_NOESCAPE); + const int slash = !!(flags & APR_FNM_PATHNAME); + int result = APR_FNM_NOMATCH; + const char *startch; + int negate; + + if (**pattern == '[') + { + ++*pattern; + + /* Handle negation, either leading ! or ^ operators (never both) */ + negate = ((**pattern == '!') || (**pattern == '^')); + if (negate) + ++*pattern; + + while (**pattern) + { + /* ']' is an ordinary character at the start of the range pattern */ + if ((**pattern == ']') && (*pattern > mismatch)) { + ++*pattern; + /* XXX: Fix for MBCS character width */ + ++*string; + return (result ^ negate); + } + + if (escape && (**pattern == '\\')) { + ++*pattern; + + /* Patterns must be terminated with ']', not EOS */ + if (!**pattern) + break; + } + + /* Patterns must be terminated with ']' not '/' */ + if (slash && (**pattern == '/')) + break; + + /* Look at only well-formed range patterns; ']' is allowed only if escaped, + * while '/' is not allowed at all in FNM_PATHNAME mode. + */ + /* XXX: Fix for locale/MBCS character width */ + if (((*pattern)[1] == '-') && (*pattern)[2] + && ((escape && ((*pattern)[2] != '\\')) + ? (((*pattern)[2] != ']') && (!slash || ((*pattern)[2] != '/'))) + : (((*pattern)[3]) && (!slash || ((*pattern)[3] != '/'))))) { + startch = *pattern; + *pattern += (escape && ((*pattern)[2] == '\\')) ? 3 : 2; + + /* XXX: handle locale/MBCS comparison, advance by MBCS char width */ + if ((**string >= *startch) && (**string <= **pattern)) + result = 0; + else if (nocase && (isupper(**string) || isupper(*startch) + || isupper(**pattern)) + && (tolower(**string) >= tolower(*startch)) + && (tolower(**string) <= tolower(**pattern))) + result = 0; + + ++*pattern; + continue; + } + + /* XXX: handle locale/MBCS comparison, advance by MBCS char width */ + if ((**string == **pattern)) + result = 0; + else if (nocase && (isupper(**string) || isupper(**pattern)) + && (tolower(**string) == tolower(**pattern))) + result = 0; + + ++*pattern; + } + + /* NOT a properly balanced [expr] pattern; Rewind to test '[' literal */ + *pattern = mismatch; + result = APR_FNM_NOMATCH; + } + else if (**pattern == '?') { + /* Optimize '?' match before unescaping **pattern */ + if (!**string || (!slash || (**string != '/'))) + return APR_FNM_NOMATCH; + result = 0; + goto fnmatch_ch_success; } + else if (escape && (**pattern == '\\') && (*pattern)[1]) { + ++*pattern; + } + + /* XXX: handle locale/MBCS comparison, advance by the MBCS char width */ + if (**string == **pattern) + result = 0; + else if (nocase && (isupper(**string) || isupper(**pattern)) + && (tolower(**string) == tolower(**pattern))) + result = 0; + + /* Refuse to advance over trailing slash or nulls + */ + if (!**string || !**pattern || (slash && ((**string == '/') || (**pattern == '/')))) + return result; + +fnmatch_ch_success: + ++*pattern; + ++*string; + return result; } -static const char *rangematch(const char *pattern, int test, int flags) + +APR_DECLARE(int) apr_fnmatch(const char *pattern, const char *string, int flags) { - int negate, ok; - char c, c2; - - /* - * A bracket expression starting with an unquoted circumflex - * character produces unspecified results (IEEE 1003.2-1992, - * 3.13.2). This implementation treats it like '!', for - * consistency with the regular expression syntax. - * J.T. Conklin (conklin@ngai.kaleida.com) + static const char dummystring[2] = {' ', 0}; + const int escape = !(flags & APR_FNM_NOESCAPE); + const int slash = !!(flags & APR_FNM_PATHNAME); + const char *strendseg; + const char *dummyptr; + const char *matchptr; + int wild; + /* For '*' wild processing only; surpress 'used before initialization' + * warnings with dummy initialization values; */ - if ((negate = (*pattern == '!' || *pattern == '^'))) { - ++pattern; - } + const char *strstartseg = NULL; + const char *mismatch = NULL; + int matchlen = 0; + + while (*pattern) + { + /* Match balanced slashes, starting a new segment pattern + */ + if (slash && escape && (*pattern == '\\') && (pattern[1] == '/')) + ++pattern; + if (slash && (*pattern == '/') && (*string == '/')) { + ++pattern; + ++string; + } + + /* At the beginning of each segment, validate leading period behavior. + */ + if ((flags & APR_FNM_PERIOD) && (*string == '.')) + { + if (*pattern == '.') + ++pattern; + else if (escape && (*pattern == '\\') && (pattern[1] == '.')) + pattern += 2; + else + return APR_FNM_NOMATCH; + ++string; + } + + /* Determine the end of string segment + * + * Presumes '/' character is unique, not composite in any MBCS encoding + */ + if (slash) { + if (!(strendseg = strchr(string, '/'))) + strendseg = strchr(string, '\0'); + } + else { + strendseg = strchr(string, '\0'); + } + + /* Allow pattern '*' to be consumed even with no remaining string to match + */ + while (*pattern && !(slash && ((*pattern == '/') + || (escape && (*pattern == '\\') + && (pattern[1] == '/')))) + && ((string < strendseg) + || ((*pattern == '*') && (string == strendseg)))) + { + /* Reduce groups of '*' and '?' to n '?' matches + * followed by one '*' test for simplicity + */ + for (wild = 0; ((*pattern == '*') || (*pattern == '?')); ++pattern) + { + if (*pattern == '*') { + wild = 1; + } + else if (string < strendseg) { /* && (*pattern == '?') */ + /* XXX: Advance 1 char for MBCS locale */ + ++string; + } + else { /* (string >= strendseg) && (*pattern == '?') */ + return APR_FNM_NOMATCH; + } + } + + if (wild) + { + strstartseg = string; + mismatch = pattern; + + /* Count fixed (non '*') char matches remaining in pattern + * excluding '/' (or "\/") and '*' + */ + for (matchptr = pattern, matchlen = 0; 1; ++matchlen) + { + if ((*matchptr == '\0') + || (slash && ((*matchptr == '/') + || (escape && (*matchptr == '\\') + && (matchptr[1] == '/'))))) + { + /* Compare precisely this many trailing string chars, + * the resulting match needs no wildcard loop + */ + /* XXX: Adjust for MBCS */ + if (string + matchlen > strendseg) + return APR_FNM_NOMATCH; + + string = strendseg - matchlen; + wild = 0; + break; + } + + if (*matchptr == '*') + { + /* Ensure at least this many trailing string chars remain + * for the first comparison + */ + /* XXX: Adjust for MBCS */ + if (string + matchlen > strendseg) + return APR_FNM_NOMATCH; + + /* Begin first wild comparison at the current position */ + break; + } + + /* Skip forward in pattern by a single character match + * Use a dummy fnmatch_ch() test to count one "[range]" escape + */ + /* XXX: Adjust for MBCS */ + if (escape && (*matchptr == '\\') && matchptr[1]) { + matchptr += 2; + } + else if (*matchptr == '[') { + dummyptr = dummystring; + fnmatch_ch(&matchptr, &dummyptr, flags); + } + else { + ++matchptr; + } + } + } + + /* Incrementally match string against the pattern + */ + while (*pattern && (string < strendseg)) + { + /* Success; begin a new wild pattern search + */ + if (*pattern == '*') + break; + + if (slash && ((*string == '/') || (*pattern == '/') + || (escape && (*pattern == '\\') + && (pattern[1] == '/')))) + break; - for (ok = 0; (c = *pattern++) != ']';) { - if (c == '\\' && !(flags & APR_FNM_NOESCAPE)) { - c = *pattern++; - } - if (c == EOS) { - return (NULL); - } - if (*pattern == '-' && (c2 = *(pattern + 1)) != EOS && c2 != ']') { - pattern += 2; - if (c2 == '\\' && !(flags & APR_FNM_NOESCAPE)) { - c2 = *pattern++; - } - if (c2 == EOS) { - return (NULL); - } - if ((c <= test && test <= c2) - || ((flags & APR_FNM_CASE_BLIND) - && ((apr_tolower(c) <= apr_tolower(test)) - && (apr_tolower(test) <= apr_tolower(c2))))) { - ok = 1; - } - } - else if ((c == test) - || ((flags & APR_FNM_CASE_BLIND) - && (apr_tolower(c) == apr_tolower(test)))) { - ok = 1; - } + /* Compare ch's (the pattern is advanced over "\/" to the '/', + * but slashes will mismatch, and are not consumed) + */ + if (!fnmatch_ch(&pattern, &string, flags)) + continue; + + /* Failed to match, loop against next char offset of string segment + * until not enough string chars remain to match the fixed pattern + */ + if (wild) { + /* XXX: Advance 1 char for MBCS locale */ + string = ++strstartseg; + if (string + matchlen > strendseg) + return APR_FNM_NOMATCH; + + pattern = mismatch; + continue; + } + else + return APR_FNM_NOMATCH; + } + } + + if (*string && (!slash || (*string != '/'))) + return APR_FNM_NOMATCH; + + if (*pattern && (!slash || ((*pattern != '/') + && (!escape || (*pattern != '\\') + || (pattern[1] != '/'))))) + return APR_FNM_NOMATCH; } - return (ok == negate ? NULL : pattern); + + /* pattern is at EOS; if string is also, declare success + */ + if (!*string) + return 0; + + /* pattern didn't match to the end of string */ + return APR_FNM_NOMATCH; } -/* This function is an Apache addition */ -/* return non-zero if pattern has any glob chars in it */ +/* This function is an Apache addition + * return non-zero if pattern has any glob chars in it + * @bug Function does not distinguish for FNM_PATHNAME mode, which renders + * a false positive for test[/]this (which is not a range, but + * seperate test[ and ]this segments and no glob.) + * @bug Function does not distinguish for non-FNM_ESCAPE mode. + * @bug Function does not parse []] correctly + * Solution may be to use fnmatch_ch() to walk the patterns? + */ APR_DECLARE(int) apr_fnmatch_test(const char *pattern) { int nesting; nesting = 0; while (*pattern) { - switch (*pattern) { - case '?': - case '*': - return 1; - - case '\\': - if (*++pattern == '\0') { - return 0; - } - break; - - case '[': /* '[' is only a glob if it has a matching ']' */ - ++nesting; - break; - - case ']': - if (nesting) { - return 1; - } - break; - } - ++pattern; - } + switch (*pattern) { + case '?': + case '*': + return 1; + + case '\\': + if (*++pattern == '\0') { + return 0; + } + break; + + case '[': /* '[' is only a glob if it has a matching ']' */ + ++nesting; + break; + + case ']': + if (nesting) { + return 1; + } + break; + } + ++pattern; } return 0; } + /* Find all files matching the specified pattern */ APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, apr_array_header_t **result, From 9932c689b86468432f2aee3fa355e6835a8ac29f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 2 May 2011 14:31:26 +0000 Subject: [PATCH 6992/7878] document return values for apr_os_thread_equal() Submitted by: Stefan Ruppert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1098596 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr_portable.h b/include/apr_portable.h index c915fd037a0..45d53eb1542 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -321,6 +321,7 @@ APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void); * Compare two thread id's * @param tid1 1st Thread ID to compare * @param tid2 2nd Thread ID to compare + * @return non-zero if the two threads are equal, zero otherwise */ APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2); From cb3cd0c17f27fee1071abb5dfac316ebab0c72a1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 2 May 2011 21:50:46 +0000 Subject: [PATCH 6993/7878] Resolve issue identified by Jeff Trawick; '*?' was handled correctly, while 'x?' was not. Resolves one alert, assignment within conditional expression, for pedantic compilers. Forward ports: r1098799 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1098805 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 919 +++++++++++++++++++++--------------------- 1 file changed, 460 insertions(+), 459 deletions(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index 1de72518949..d5eeccd5ec3 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -1,459 +1,460 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -/* Derived from The Open Group Base Specifications Issue 7, IEEE Std 1003.1-2008 - * as described in; - * http://pubs.opengroup.org/onlinepubs/9699919799/functions/fnmatch.html - * - * Filename pattern matches defined in section 2.13, "Pattern Matching Notation" - * from chapter 2. "Shell Command Language" - * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13 - * where; 1. A bracket expression starting with an unquoted '^' - * character CONTINUES to specify a non-matching list; 2. an explicit '.' - * in a bracket expression matching list, e.g. "[.abc]" does NOT match a leading - * in a filename; 3. a '[' which does not introduce - * a valid bracket expression is treated as an ordinary character; 4. a differing - * number of consecutive slashes within pattern and string will NOT match; - * 5. a trailing '\' in FNM_ESCAPE mode is treated as an ordinary '\' character. - * - * Bracket expansion defined in section 9.3.5, "RE Bracket Expression", - * from chapter 9, "Regular Expressions" - * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_05 - * with no support for collating symbols, equivalence class expressions or - * character class expressions. A partial range expression with a leading - * hyphen following a valid range expression will match only the ordinary - * and the ending character (e.g. "[a-m-z]" will match characters - * 'a' through 'm', a '-', or a 'z'). - * - * NOTE: Only POSIX/C single byte locales are correctly supported at this time. - * Notably, non-POSIX locales with FNM_CASEFOLD produce undefined results, - * particularly in ranges of mixed case (e.g. "[A-z]") or spanning alpha and - * nonalpha characters within a range. - * - * XXX comments below indicate porting required for multi-byte character sets - * and non-POSIX locale collation orders; requires mbr* APIs to track shift - * state of pattern and string (rewinding pattern and string repeatedly). - * - * Certain parts of the code assume 0x00-0x3F are unique with any MBCS (e.g. - * UTF-8, SHIFT-JIS, etc). Any implementation allowing '\' as an alternate - * path delimiter must be aware that 0x5C is NOT unique within SHIFT-JIS. - */ - -#include "apr_file_info.h" -#include "apr_fnmatch.h" -#include "apr_tables.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include -#if APR_HAVE_CTYPE_H -# include -#endif - - -/* Most MBCS/collation/case issues handled here. Wildcard '*' is not handled. - * EOS '\0' and the FNM_PATHNAME '/' delimiters are not advanced over, - * however the "\/" sequence is advanced to '/'. - * - * Both pattern and string are **char to support pointer increment of arbitrary - * multibyte characters for the given locale, in a later iteration of this code - */ -static __inline int fnmatch_ch(const char **pattern, const char **string, int flags) -{ - const char * const mismatch = *pattern; - const int nocase = !!(flags & APR_FNM_CASE_BLIND); - const int escape = !(flags & APR_FNM_NOESCAPE); - const int slash = !!(flags & APR_FNM_PATHNAME); - int result = APR_FNM_NOMATCH; - const char *startch; - int negate; - - if (**pattern == '[') - { - ++*pattern; - - /* Handle negation, either leading ! or ^ operators (never both) */ - negate = ((**pattern == '!') || (**pattern == '^')); - if (negate) - ++*pattern; - - while (**pattern) - { - /* ']' is an ordinary character at the start of the range pattern */ - if ((**pattern == ']') && (*pattern > mismatch)) { - ++*pattern; - /* XXX: Fix for MBCS character width */ - ++*string; - return (result ^ negate); - } - - if (escape && (**pattern == '\\')) { - ++*pattern; - - /* Patterns must be terminated with ']', not EOS */ - if (!**pattern) - break; - } - - /* Patterns must be terminated with ']' not '/' */ - if (slash && (**pattern == '/')) - break; - - /* Look at only well-formed range patterns; ']' is allowed only if escaped, - * while '/' is not allowed at all in FNM_PATHNAME mode. - */ - /* XXX: Fix for locale/MBCS character width */ - if (((*pattern)[1] == '-') && (*pattern)[2] - && ((escape && ((*pattern)[2] != '\\')) - ? (((*pattern)[2] != ']') && (!slash || ((*pattern)[2] != '/'))) - : (((*pattern)[3]) && (!slash || ((*pattern)[3] != '/'))))) { - startch = *pattern; - *pattern += (escape && ((*pattern)[2] == '\\')) ? 3 : 2; - - /* XXX: handle locale/MBCS comparison, advance by MBCS char width */ - if ((**string >= *startch) && (**string <= **pattern)) - result = 0; - else if (nocase && (isupper(**string) || isupper(*startch) - || isupper(**pattern)) - && (tolower(**string) >= tolower(*startch)) - && (tolower(**string) <= tolower(**pattern))) - result = 0; - - ++*pattern; - continue; - } - - /* XXX: handle locale/MBCS comparison, advance by MBCS char width */ - if ((**string == **pattern)) - result = 0; - else if (nocase && (isupper(**string) || isupper(**pattern)) - && (tolower(**string) == tolower(**pattern))) - result = 0; - - ++*pattern; - } - - /* NOT a properly balanced [expr] pattern; Rewind to test '[' literal */ - *pattern = mismatch; - result = APR_FNM_NOMATCH; - } - else if (**pattern == '?') { - /* Optimize '?' match before unescaping **pattern */ - if (!**string || (!slash || (**string != '/'))) - return APR_FNM_NOMATCH; - result = 0; - goto fnmatch_ch_success; - } - else if (escape && (**pattern == '\\') && (*pattern)[1]) { - ++*pattern; - } - - /* XXX: handle locale/MBCS comparison, advance by the MBCS char width */ - if (**string == **pattern) - result = 0; - else if (nocase && (isupper(**string) || isupper(**pattern)) - && (tolower(**string) == tolower(**pattern))) - result = 0; - - /* Refuse to advance over trailing slash or nulls - */ - if (!**string || !**pattern || (slash && ((**string == '/') || (**pattern == '/')))) - return result; - -fnmatch_ch_success: - ++*pattern; - ++*string; - return result; -} - - -APR_DECLARE(int) apr_fnmatch(const char *pattern, const char *string, int flags) -{ - static const char dummystring[2] = {' ', 0}; - const int escape = !(flags & APR_FNM_NOESCAPE); - const int slash = !!(flags & APR_FNM_PATHNAME); - const char *strendseg; - const char *dummyptr; - const char *matchptr; - int wild; - /* For '*' wild processing only; surpress 'used before initialization' - * warnings with dummy initialization values; - */ - const char *strstartseg = NULL; - const char *mismatch = NULL; - int matchlen = 0; - - while (*pattern) - { - /* Match balanced slashes, starting a new segment pattern - */ - if (slash && escape && (*pattern == '\\') && (pattern[1] == '/')) - ++pattern; - if (slash && (*pattern == '/') && (*string == '/')) { - ++pattern; - ++string; - } - - /* At the beginning of each segment, validate leading period behavior. - */ - if ((flags & APR_FNM_PERIOD) && (*string == '.')) - { - if (*pattern == '.') - ++pattern; - else if (escape && (*pattern == '\\') && (pattern[1] == '.')) - pattern += 2; - else - return APR_FNM_NOMATCH; - ++string; - } - - /* Determine the end of string segment - * - * Presumes '/' character is unique, not composite in any MBCS encoding - */ - if (slash) { - if (!(strendseg = strchr(string, '/'))) - strendseg = strchr(string, '\0'); - } - else { - strendseg = strchr(string, '\0'); - } - - /* Allow pattern '*' to be consumed even with no remaining string to match - */ - while (*pattern && !(slash && ((*pattern == '/') - || (escape && (*pattern == '\\') - && (pattern[1] == '/')))) - && ((string < strendseg) - || ((*pattern == '*') && (string == strendseg)))) - { - /* Reduce groups of '*' and '?' to n '?' matches - * followed by one '*' test for simplicity - */ - for (wild = 0; ((*pattern == '*') || (*pattern == '?')); ++pattern) - { - if (*pattern == '*') { - wild = 1; - } - else if (string < strendseg) { /* && (*pattern == '?') */ - /* XXX: Advance 1 char for MBCS locale */ - ++string; - } - else { /* (string >= strendseg) && (*pattern == '?') */ - return APR_FNM_NOMATCH; - } - } - - if (wild) - { - strstartseg = string; - mismatch = pattern; - - /* Count fixed (non '*') char matches remaining in pattern - * excluding '/' (or "\/") and '*' - */ - for (matchptr = pattern, matchlen = 0; 1; ++matchlen) - { - if ((*matchptr == '\0') - || (slash && ((*matchptr == '/') - || (escape && (*matchptr == '\\') - && (matchptr[1] == '/'))))) - { - /* Compare precisely this many trailing string chars, - * the resulting match needs no wildcard loop - */ - /* XXX: Adjust for MBCS */ - if (string + matchlen > strendseg) - return APR_FNM_NOMATCH; - - string = strendseg - matchlen; - wild = 0; - break; - } - - if (*matchptr == '*') - { - /* Ensure at least this many trailing string chars remain - * for the first comparison - */ - /* XXX: Adjust for MBCS */ - if (string + matchlen > strendseg) - return APR_FNM_NOMATCH; - - /* Begin first wild comparison at the current position */ - break; - } - - /* Skip forward in pattern by a single character match - * Use a dummy fnmatch_ch() test to count one "[range]" escape - */ - /* XXX: Adjust for MBCS */ - if (escape && (*matchptr == '\\') && matchptr[1]) { - matchptr += 2; - } - else if (*matchptr == '[') { - dummyptr = dummystring; - fnmatch_ch(&matchptr, &dummyptr, flags); - } - else { - ++matchptr; - } - } - } - - /* Incrementally match string against the pattern - */ - while (*pattern && (string < strendseg)) - { - /* Success; begin a new wild pattern search - */ - if (*pattern == '*') - break; - - if (slash && ((*string == '/') || (*pattern == '/') - || (escape && (*pattern == '\\') - && (pattern[1] == '/')))) - break; - - /* Compare ch's (the pattern is advanced over "\/" to the '/', - * but slashes will mismatch, and are not consumed) - */ - if (!fnmatch_ch(&pattern, &string, flags)) - continue; - - /* Failed to match, loop against next char offset of string segment - * until not enough string chars remain to match the fixed pattern - */ - if (wild) { - /* XXX: Advance 1 char for MBCS locale */ - string = ++strstartseg; - if (string + matchlen > strendseg) - return APR_FNM_NOMATCH; - - pattern = mismatch; - continue; - } - else - return APR_FNM_NOMATCH; - } - } - - if (*string && (!slash || (*string != '/'))) - return APR_FNM_NOMATCH; - - if (*pattern && (!slash || ((*pattern != '/') - && (!escape || (*pattern != '\\') - || (pattern[1] != '/'))))) - return APR_FNM_NOMATCH; - } - - /* pattern is at EOS; if string is also, declare success - */ - if (!*string) - return 0; - - /* pattern didn't match to the end of string */ - return APR_FNM_NOMATCH; -} - - -/* This function is an Apache addition - * return non-zero if pattern has any glob chars in it - * @bug Function does not distinguish for FNM_PATHNAME mode, which renders - * a false positive for test[/]this (which is not a range, but - * seperate test[ and ]this segments and no glob.) - * @bug Function does not distinguish for non-FNM_ESCAPE mode. - * @bug Function does not parse []] correctly - * Solution may be to use fnmatch_ch() to walk the patterns? - */ -APR_DECLARE(int) apr_fnmatch_test(const char *pattern) -{ - int nesting; - - nesting = 0; - while (*pattern) { - switch (*pattern) { - case '?': - case '*': - return 1; - - case '\\': - if (*++pattern == '\0') { - return 0; - } - break; - - case '[': /* '[' is only a glob if it has a matching ']' */ - ++nesting; - break; - - case ']': - if (nesting) { - return 1; - } - break; - } - ++pattern; } - return 0; -} - - -/* Find all files matching the specified pattern */ -APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, - apr_array_header_t **result, - apr_pool_t *p) -{ - apr_dir_t *dir; - apr_finfo_t finfo; - apr_status_t rv; - char *path; - - /* XXX So, this is kind of bogus. Basically, I need to strip any leading - * directories off the pattern, but there is no portable way to do that. - * So, for now we just find the last occurance of '/' and if that doesn't - * return anything, then we look for '\'. This means that we could - * screw up on unix if the pattern is something like "foo\.*" That '\' - * isn't a directory delimiter, it is a part of the filename. To fix this, - * we really need apr_filepath_basename, which will be coming as soon as - * I get to it. rbb - */ - char *idx = strrchr(pattern, '/'); - - if (idx == NULL) { - idx = strrchr(pattern, '\\'); - } - if (idx == NULL) { - path = "."; - } - else { - path = apr_pstrndup(p, pattern, idx - pattern); - pattern = idx + 1; - } - - *result = apr_array_make(p, 0, sizeof(char *)); - rv = apr_dir_open(&dir, path, p); - if (rv != APR_SUCCESS) { - return rv; - } - - while (apr_dir_read(&finfo, APR_FINFO_NAME, dir) == APR_SUCCESS) { - if (apr_fnmatch(pattern, finfo.name, 0) == APR_SUCCESS) { - *(const char **)apr_array_push(*result) = apr_pstrdup(p, finfo.name); - } - } - apr_dir_close(dir); - return APR_SUCCESS; -} +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/* Derived from The Open Group Base Specifications Issue 7, IEEE Std 1003.1-2008 + * as described in; + * http://pubs.opengroup.org/onlinepubs/9699919799/functions/fnmatch.html + * + * Filename pattern matches defined in section 2.13, "Pattern Matching Notation" + * from chapter 2. "Shell Command Language" + * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13 + * where; 1. A bracket expression starting with an unquoted '^' + * character CONTINUES to specify a non-matching list; 2. an explicit '.' + * in a bracket expression matching list, e.g. "[.abc]" does NOT match a leading + * in a filename; 3. a '[' which does not introduce + * a valid bracket expression is treated as an ordinary character; 4. a differing + * number of consecutive slashes within pattern and string will NOT match; + * 5. a trailing '\' in FNM_ESCAPE mode is treated as an ordinary '\' character. + * + * Bracket expansion defined in section 9.3.5, "RE Bracket Expression", + * from chapter 9, "Regular Expressions" + * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_05 + * with no support for collating symbols, equivalence class expressions or + * character class expressions. A partial range expression with a leading + * hyphen following a valid range expression will match only the ordinary + * and the ending character (e.g. "[a-m-z]" will match characters + * 'a' through 'm', a '-', or a 'z'). + * + * NOTE: Only POSIX/C single byte locales are correctly supported at this time. + * Notably, non-POSIX locales with FNM_CASEFOLD produce undefined results, + * particularly in ranges of mixed case (e.g. "[A-z]") or spanning alpha and + * nonalpha characters within a range. + * + * XXX comments below indicate porting required for multi-byte character sets + * and non-POSIX locale collation orders; requires mbr* APIs to track shift + * state of pattern and string (rewinding pattern and string repeatedly). + * + * Certain parts of the code assume 0x00-0x3F are unique with any MBCS (e.g. + * UTF-8, SHIFT-JIS, etc). Any implementation allowing '\' as an alternate + * path delimiter must be aware that 0x5C is NOT unique within SHIFT-JIS. + */ + +#include "apr_file_info.h" +#include "apr_fnmatch.h" +#include "apr_tables.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include +#if APR_HAVE_CTYPE_H +# include +#endif + + +/* Most MBCS/collation/case issues handled here. Wildcard '*' is not handled. + * EOS '\0' and the FNM_PATHNAME '/' delimiters are not advanced over, + * however the "\/" sequence is advanced to '/'. + * + * Both pattern and string are **char to support pointer increment of arbitrary + * multibyte characters for the given locale, in a later iteration of this code + */ +static __inline int fnmatch_ch(const char **pattern, const char **string, int flags) +{ + const char * const mismatch = *pattern; + const int nocase = !!(flags & APR_FNM_CASE_BLIND); + const int escape = !(flags & APR_FNM_NOESCAPE); + const int slash = !!(flags & APR_FNM_PATHNAME); + int result = APR_FNM_NOMATCH; + const char *startch; + int negate; + + if (**pattern == '[') + { + ++*pattern; + + /* Handle negation, either leading ! or ^ operators (never both) */ + negate = ((**pattern == '!') || (**pattern == '^')); + if (negate) + ++*pattern; + + while (**pattern) + { + /* ']' is an ordinary character at the start of the range pattern */ + if ((**pattern == ']') && (*pattern > mismatch)) { + ++*pattern; + /* XXX: Fix for MBCS character width */ + ++*string; + return (result ^ negate); + } + + if (escape && (**pattern == '\\')) { + ++*pattern; + + /* Patterns must be terminated with ']', not EOS */ + if (!**pattern) + break; + } + + /* Patterns must be terminated with ']' not '/' */ + if (slash && (**pattern == '/')) + break; + + /* Look at only well-formed range patterns; ']' is allowed only if escaped, + * while '/' is not allowed at all in FNM_PATHNAME mode. + */ + /* XXX: Fix for locale/MBCS character width */ + if (((*pattern)[1] == '-') && (*pattern)[2] + && ((escape && ((*pattern)[2] != '\\')) + ? (((*pattern)[2] != ']') && (!slash || ((*pattern)[2] != '/'))) + : (((*pattern)[3]) && (!slash || ((*pattern)[3] != '/'))))) { + startch = *pattern; + *pattern += (escape && ((*pattern)[2] == '\\')) ? 3 : 2; + + /* XXX: handle locale/MBCS comparison, advance by MBCS char width */ + if ((**string >= *startch) && (**string <= **pattern)) + result = 0; + else if (nocase && (isupper(**string) || isupper(*startch) + || isupper(**pattern)) + && (tolower(**string) >= tolower(*startch)) + && (tolower(**string) <= tolower(**pattern))) + result = 0; + + ++*pattern; + continue; + } + + /* XXX: handle locale/MBCS comparison, advance by MBCS char width */ + if ((**string == **pattern)) + result = 0; + else if (nocase && (isupper(**string) || isupper(**pattern)) + && (tolower(**string) == tolower(**pattern))) + result = 0; + + ++*pattern; + } + + /* NOT a properly balanced [expr] pattern; Rewind to test '[' literal */ + *pattern = mismatch; + result = APR_FNM_NOMATCH; + } + else if (**pattern == '?') { + /* Optimize '?' match before unescaping **pattern */ + if (!**string || (slash && (**string == '/'))) + return APR_FNM_NOMATCH; + result = 0; + goto fnmatch_ch_success; + } + else if (escape && (**pattern == '\\') && (*pattern)[1]) { + ++*pattern; + } + + /* XXX: handle locale/MBCS comparison, advance by the MBCS char width */ + if (**string == **pattern) + result = 0; + else if (nocase && (isupper(**string) || isupper(**pattern)) + && (tolower(**string) == tolower(**pattern))) + result = 0; + + /* Refuse to advance over trailing slash or nulls + */ + if (!**string || !**pattern || (slash && ((**string == '/') || (**pattern == '/')))) + return result; + +fnmatch_ch_success: + ++*pattern; + ++*string; + return result; +} + + +APR_DECLARE(int) apr_fnmatch(const char *pattern, const char *string, int flags) +{ + static const char dummystring[2] = {' ', 0}; + const int escape = !(flags & APR_FNM_NOESCAPE); + const int slash = !!(flags & APR_FNM_PATHNAME); + const char *strendseg; + const char *dummyptr; + const char *matchptr; + int wild; + /* For '*' wild processing only; surpress 'used before initialization' + * warnings with dummy initialization values; + */ + const char *strstartseg = NULL; + const char *mismatch = NULL; + int matchlen = 0; + + while (*pattern) + { + /* Match balanced slashes, starting a new segment pattern + */ + if (slash && escape && (*pattern == '\\') && (pattern[1] == '/')) + ++pattern; + if (slash && (*pattern == '/') && (*string == '/')) { + ++pattern; + ++string; + } + + /* At the beginning of each segment, validate leading period behavior. + */ + if ((flags & APR_FNM_PERIOD) && (*string == '.')) + { + if (*pattern == '.') + ++pattern; + else if (escape && (*pattern == '\\') && (pattern[1] == '.')) + pattern += 2; + else + return APR_FNM_NOMATCH; + ++string; + } + + /* Determine the end of string segment + * + * Presumes '/' character is unique, not composite in any MBCS encoding + */ + if (slash) { + strendseg = strchr(string, '/'); + if (!strendseg) + strendseg = strchr(string, '\0'); + } + else { + strendseg = strchr(string, '\0'); + } + + /* Allow pattern '*' to be consumed even with no remaining string to match + */ + while (*pattern && !(slash && ((*pattern == '/') + || (escape && (*pattern == '\\') + && (pattern[1] == '/')))) + && ((string < strendseg) + || ((*pattern == '*') && (string == strendseg)))) + { + /* Reduce groups of '*' and '?' to n '?' matches + * followed by one '*' test for simplicity + */ + for (wild = 0; ((*pattern == '*') || (*pattern == '?')); ++pattern) + { + if (*pattern == '*') { + wild = 1; + } + else if (string < strendseg) { /* && (*pattern == '?') */ + /* XXX: Advance 1 char for MBCS locale */ + ++string; + } + else { /* (string >= strendseg) && (*pattern == '?') */ + return APR_FNM_NOMATCH; + } + } + + if (wild) + { + strstartseg = string; + mismatch = pattern; + + /* Count fixed (non '*') char matches remaining in pattern + * excluding '/' (or "\/") and '*' + */ + for (matchptr = pattern, matchlen = 0; 1; ++matchlen) + { + if ((*matchptr == '\0') + || (slash && ((*matchptr == '/') + || (escape && (*matchptr == '\\') + && (matchptr[1] == '/'))))) + { + /* Compare precisely this many trailing string chars, + * the resulting match needs no wildcard loop + */ + /* XXX: Adjust for MBCS */ + if (string + matchlen > strendseg) + return APR_FNM_NOMATCH; + + string = strendseg - matchlen; + wild = 0; + break; + } + + if (*matchptr == '*') + { + /* Ensure at least this many trailing string chars remain + * for the first comparison + */ + /* XXX: Adjust for MBCS */ + if (string + matchlen > strendseg) + return APR_FNM_NOMATCH; + + /* Begin first wild comparison at the current position */ + break; + } + + /* Skip forward in pattern by a single character match + * Use a dummy fnmatch_ch() test to count one "[range]" escape + */ + /* XXX: Adjust for MBCS */ + if (escape && (*matchptr == '\\') && matchptr[1]) { + matchptr += 2; + } + else if (*matchptr == '[') { + dummyptr = dummystring; + fnmatch_ch(&matchptr, &dummyptr, flags); + } + else { + ++matchptr; + } + } + } + + /* Incrementally match string against the pattern + */ + while (*pattern && (string < strendseg)) + { + /* Success; begin a new wild pattern search + */ + if (*pattern == '*') + break; + + if (slash && ((*string == '/') || (*pattern == '/') + || (escape && (*pattern == '\\') + && (pattern[1] == '/')))) + break; + + /* Compare ch's (the pattern is advanced over "\/" to the '/', + * but slashes will mismatch, and are not consumed) + */ + if (!fnmatch_ch(&pattern, &string, flags)) + continue; + + /* Failed to match, loop against next char offset of string segment + * until not enough string chars remain to match the fixed pattern + */ + if (wild) { + /* XXX: Advance 1 char for MBCS locale */ + string = ++strstartseg; + if (string + matchlen > strendseg) + return APR_FNM_NOMATCH; + + pattern = mismatch; + continue; + } + else + return APR_FNM_NOMATCH; + } + } + + if (*string && (!slash || (*string != '/'))) + return APR_FNM_NOMATCH; + + if (*pattern && (!slash || ((*pattern != '/') + && (!escape || (*pattern != '\\') + || (pattern[1] != '/'))))) + return APR_FNM_NOMATCH; + } + + /* pattern is at EOS; if string is also, declare success + */ + if (!*string) + return 0; + + /* pattern didn't match to the end of string */ + return APR_FNM_NOMATCH; +} + + +/* This function is an Apache addition + * return non-zero if pattern has any glob chars in it + * @bug Function does not distinguish for FNM_PATHNAME mode, which renders + * a false positive for test[/]this (which is not a range, but + * seperate test[ and ]this segments and no glob.) + * @bug Function does not distinguish for non-FNM_ESCAPE mode. + * @bug Function does not parse []] correctly + * Solution may be to use fnmatch_ch() to walk the patterns? + */ +APR_DECLARE(int) apr_fnmatch_test(const char *pattern) +{ + int nesting; + + nesting = 0; + while (*pattern) { + switch (*pattern) { + case '?': + case '*': + return 1; + + case '\\': + if (*++pattern == '\0') { + return 0; + } + break; + + case '[': /* '[' is only a glob if it has a matching ']' */ + ++nesting; + break; + + case ']': + if (nesting) { + return 1; + } + break; + } + ++pattern; } + return 0; +} + + +/* Find all files matching the specified pattern */ +APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, + apr_array_header_t **result, + apr_pool_t *p) +{ + apr_dir_t *dir; + apr_finfo_t finfo; + apr_status_t rv; + char *path; + + /* XXX So, this is kind of bogus. Basically, I need to strip any leading + * directories off the pattern, but there is no portable way to do that. + * So, for now we just find the last occurance of '/' and if that doesn't + * return anything, then we look for '\'. This means that we could + * screw up on unix if the pattern is something like "foo\.*" That '\' + * isn't a directory delimiter, it is a part of the filename. To fix this, + * we really need apr_filepath_basename, which will be coming as soon as + * I get to it. rbb + */ + char *idx = strrchr(pattern, '/'); + + if (idx == NULL) { + idx = strrchr(pattern, '\\'); + } + if (idx == NULL) { + path = "."; + } + else { + path = apr_pstrndup(p, pattern, idx - pattern); + pattern = idx + 1; + } + + *result = apr_array_make(p, 0, sizeof(char *)); + rv = apr_dir_open(&dir, path, p); + if (rv != APR_SUCCESS) { + return rv; + } + + while (apr_dir_read(&finfo, APR_FINFO_NAME, dir) == APR_SUCCESS) { + if (apr_fnmatch(pattern, finfo.name, 0) == APR_SUCCESS) { + *(const char **)apr_array_push(*result) = apr_pstrdup(p, finfo.name); + } + } + apr_dir_close(dir); + return APR_SUCCESS; +} From 080ae16b6f7736c3d63dba64cfccec08b95f7e55 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 3 May 2011 04:52:38 +0000 Subject: [PATCH 6994/7878] Correct inlining per Jeff Trawick's feedback; Forward ports: r1098902 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1098904 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index d5eeccd5ec3..cc361155d5b 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -71,7 +71,7 @@ * Both pattern and string are **char to support pointer increment of arbitrary * multibyte characters for the given locale, in a later iteration of this code */ -static __inline int fnmatch_ch(const char **pattern, const char **string, int flags) +static APR_INLINE int fnmatch_ch(const char **pattern, const char **string, int flags) { const char * const mismatch = *pattern; const int nocase = !!(flags & APR_FNM_CASE_BLIND); From ee623d0dbaee8b798b7d520316a666f083e7d387 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Wed, 4 May 2011 07:16:37 +0000 Subject: [PATCH 6995/7878] * Update the correct structure element in the case that HAVE_STRUCT_STAT_ST_MTIME_N / HAVE_STRUCT_STAT_ST_ATIME_N is defined. PR: 51146 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1099348 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 9bee651120a..220efd08602 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -95,7 +95,7 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info, #elif defined(HAVE_STRUCT_STAT_ST_ATIMENSEC) finfo->atime += info->st_atimensec / APR_TIME_C(1000); #elif defined(HAVE_STRUCT_STAT_ST_ATIME_N) - finfo->ctime += info->st_atime_n / APR_TIME_C(1000); + finfo->atime += info->st_atime_n / APR_TIME_C(1000); #endif apr_time_ansi_put(&finfo->mtime, info->st_mtime); @@ -104,7 +104,7 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info, #elif defined(HAVE_STRUCT_STAT_ST_MTIMENSEC) finfo->mtime += info->st_mtimensec / APR_TIME_C(1000); #elif defined(HAVE_STRUCT_STAT_ST_MTIME_N) - finfo->ctime += info->st_mtime_n / APR_TIME_C(1000); + finfo->mtime += info->st_mtime_n / APR_TIME_C(1000); #endif apr_time_ansi_put(&finfo->ctime, info->st_ctime); From 64b94c26eb991cc078378b792b996995fc2e9043 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 7 May 2011 03:39:12 +0000 Subject: [PATCH 6996/7878] Fix lineends git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1100438 13f79535-47bb-0310-9956-ffa450edef68 From 7ad7350cc71d20279cb1b8e3575591c86016f0d1 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Mon, 9 May 2011 00:14:50 +0000 Subject: [PATCH 6997/7878] PR51074: APR not linked with libs added to APRUTIL_EXPORT_LIBS after merged APR/APU. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1100846 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 3 ++- build/apu-conf.m4 | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 539d5b9112e..bc8e9d9465c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -35,6 +35,7 @@ INSTALL_DATA = @INSTALL_DATA@ APR_DSO_MODULES = @APR_DSO_MODULES@ LINK_MODULE = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(APRUTIL_LDFLAGS) -release $(APR_MAJOR_VERSION) -module -rpath $(APR_DSO_LIBDIR) APR_DSO_LIBDIR = @APR_DSO_LIBDIR@ +APRUTIL_EXPORT_LIBS = @APRUTIL_EXPORT_LIBS@ # # Rules for building specific targets, starting with 'all' for @@ -117,7 +118,7 @@ install: install-modules $(TARGETS) fi $(TARGET_LIB): $(OBJECTS) - $(LINK) @lib_target@ $(ALL_LIBS) + $(LINK) @lib_target@ $(ALL_LIBS) $(APRUTIL_EXPORT_LIBS) install-modules: install-modules-@APR_HAVE_MODULES@ diff --git a/build/apu-conf.m4 b/build/apu-conf.m4 index a4078226db0..b1a4c72c93f 100644 --- a/build/apu-conf.m4 +++ b/build/apu-conf.m4 @@ -291,6 +291,7 @@ AC_SUBST(apu_has_ldap_tivoli) AC_SUBST(apu_has_ldap_zos) AC_SUBST(apu_has_ldap_other) AC_SUBST(LDADD_ldap) +AC_SUBST(APRUITL_EXPORT_LIBS) ]) From 1a0b7e06ec93d7e874b0e05411d19316854dfdc5 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Mon, 9 May 2011 00:33:27 +0000 Subject: [PATCH 6998/7878] PR51071: check the --with-odbc arg to see if it's an executable file (odbc_config itself) before defaulting to using it as a prefix for libs/includes. Required for getting the right architecture odbc on AIX packaging, which share a prefix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1100848 13f79535-47bb-0310-9956-ffa450edef68 --- build/dbd.m4 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build/dbd.m4 b/build/dbd.m4 index e8697548f78..66677b33207 100644 --- a/build/dbd.m4 +++ b/build/dbd.m4 @@ -504,8 +504,14 @@ AC_DEFUN([APU_CHECK_DBD_ODBC], [ odbc_LDFLAGS="-L`$ODBC_CONFIG --lib-prefix`" odbc_LIBS="`$ODBC_CONFIG --libs`" else - odbc_CPPFLAGS="-I$withval/include" - odbc_LDFLAGS="-L$withval/lib " + if test -f "$withval" && test -x "$withval"; then + odbc_CPPFLAGS="-I`$withval --include-prefix`" + odbc_LDFLAGS="-L`$withval --lib-prefix`" + odbc_LIBS="`$withval --libs`" + else + odbc_CPPFLAGS="-I$withval/include" + odbc_LDFLAGS="-L$withval/lib " + fi fi APR_ADDTO(CPPFLAGS, [$odbc_CPPFLAGS]) From 331177249714f65176926f499c866ac549402f64 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Mon, 9 May 2011 19:54:02 +0000 Subject: [PATCH 6999/7878] fix typo in APRUTIL_EXPORT_LIBS in r1100846 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1101175 13f79535-47bb-0310-9956-ffa450edef68 --- build/apu-conf.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apu-conf.m4 b/build/apu-conf.m4 index b1a4c72c93f..0133b74bae8 100644 --- a/build/apu-conf.m4 +++ b/build/apu-conf.m4 @@ -291,7 +291,7 @@ AC_SUBST(apu_has_ldap_tivoli) AC_SUBST(apu_has_ldap_zos) AC_SUBST(apu_has_ldap_other) AC_SUBST(LDADD_ldap) -AC_SUBST(APRUITL_EXPORT_LIBS) +AC_SUBST(APRUTIL_EXPORT_LIBS) ]) From 6f2632997ec4db66de35b601c1ba646db0edfe9d Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 11 May 2011 14:48:50 +0000 Subject: [PATCH 7000/7878] Merge from 1.4.x branch: * test/testfnmatch.c: Add apr_fnmatch() tests. Submitted by: wrowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1101903 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfnmatch.c | 109 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/test/testfnmatch.c b/test/testfnmatch.c index 379619887d1..51e0a5f144f 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -25,6 +25,114 @@ #define NUM_FILES (5) +#define APR_FNM_BITS 15 +#define APR_FNM_FAILBIT 256 + +#define FAILS_IF(X) 0, X +#define SUCCEEDS_IF(X) X, 256 +#define SUCCEEDS 0, 256 +#define FAILS 256, 0 + +static struct pattern_s { + const char *pattern; + const char *string; + int require_flags; + int fail_flags; +} patterns[] = { + +/* Pattern, String to Test, Flags to Match */ + {"", "test", FAILS}, + {"", "*", FAILS}, + {"test", "*", FAILS}, + {"test", "test", SUCCEEDS}, + + /* Remember C '\\' is a single backslash in pattern */ + {"te\\st", "test", FAILS_IF(APR_FNM_NOESCAPE)}, + {"te\\\\st", "te\\st", FAILS_IF(APR_FNM_NOESCAPE)}, + {"te\\*t", "te*t", FAILS_IF(APR_FNM_NOESCAPE)}, + {"te\\*t", "test", FAILS}, + {"te\\?t", "te?t", FAILS_IF(APR_FNM_NOESCAPE)}, + {"te\\?t", "test", FAILS}, + + {"tesT", "test", SUCCEEDS_IF(APR_FNM_CASE_BLIND)}, + {"test", "Test", SUCCEEDS_IF(APR_FNM_CASE_BLIND)}, + {"tEst", "teSt", SUCCEEDS_IF(APR_FNM_CASE_BLIND)}, + + {"?est", "test", SUCCEEDS}, + {"te?t", "test", SUCCEEDS}, + {"tes?", "test", SUCCEEDS}, + {"test?", "test", FAILS}, + + {"*", "", SUCCEEDS}, + {"*", "test", SUCCEEDS}, + {"*test", "test", SUCCEEDS}, + {"*est", "test", SUCCEEDS}, + {"*st", "test", SUCCEEDS}, + {"t*t", "test", SUCCEEDS}, + {"te*t", "test", SUCCEEDS}, + {"te*st", "test", SUCCEEDS}, + {"te*", "test", SUCCEEDS}, + {"tes*", "test", SUCCEEDS}, + {"test*", "test", SUCCEEDS}, + + {"test/this", "test/", FAILS}, + {"test/", "test/this", FAILS}, + {"test*/this", "test/this", SUCCEEDS}, + {"test/*this", "test/this", SUCCEEDS}, + + {".*", ".this", SUCCEEDS}, + {"*", ".this", FAILS_IF(APR_FNM_PERIOD)}, + {"?this", ".this", FAILS_IF(APR_FNM_PERIOD)}, + {"[.]this", ".this", FAILS_IF(APR_FNM_PERIOD)}, + + {"test/this", "test/this", SUCCEEDS}, + {"test?this", "test/this", FAILS_IF(APR_FNM_PATHNAME)}, + {"test*this", "test/this", FAILS_IF(APR_FNM_PATHNAME)}, + {"test[/]this", "test/this", FAILS_IF(APR_FNM_PATHNAME)}, + + {"test/.*", "test/.this", SUCCEEDS}, + {"test/*", "test/.this", FAILS_IF(APR_FNM_PERIOD | APR_FNM_PATHNAME)}, + {"test/?this", "test/.this", FAILS_IF(APR_FNM_PERIOD | APR_FNM_PATHNAME)}, + {"test/[.]this", "test/.this", FAILS_IF(APR_FNM_PERIOD | APR_FNM_PATHNAME)}, + + {NULL, NULL, 0} +}; + + + +static void test_fnmatch(abts_case *tc, void *data) +{ + struct pattern_s *test = patterns; + char buf[80]; + int i = APR_FNM_BITS + 1; + int res; + + for (test = patterns; test->pattern; ++test) + { + for (i = 0; i <= APR_FNM_BITS; ++i) + { + res = apr_fnmatch(test->pattern, test->string, i); + if (((i & test->require_flags) != test->require_flags) + || ((i & test->fail_flags) == test->fail_flags)) { + if (res != APR_FNM_NOMATCH) + break; + } + else { + if (res != 0) + break; + } + } + if (i <= APR_FNM_BITS) + break; + } + + if (i <= APR_FNM_BITS) { + sprintf(buf, "apr_fnmatch(\"%s\", \"%s\", %d) returns %d\n", + test->pattern, test->string, i, res); + abts_fail(tc, buf, __LINE__); + } +} + static void test_glob(abts_case *tc, void *data) { int i; @@ -68,6 +176,7 @@ abts_suite *testfnmatch(abts_suite *suite) { suite = ADD_SUITE(suite) + abts_run_test(suite, test_fnmatch, NULL); abts_run_test(suite, test_glob, NULL); abts_run_test(suite, test_glob_currdir, NULL); From 91cab279321b6fa11344a10c1cc7319b951aab07 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 11 May 2011 14:51:33 +0000 Subject: [PATCH 7001/7878] * test/testfnmatch.c: Add a few more apr_fnmatch() tests to improve (already good!) coverage a little. (test_fnmatch_test): New test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1101905 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfnmatch.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/test/testfnmatch.c b/test/testfnmatch.c index 51e0a5f144f..5a0813b62c9 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -75,6 +75,24 @@ static struct pattern_s { {"tes*", "test", SUCCEEDS}, {"test*", "test", SUCCEEDS}, + {"test*?*[a-z]*", "testgoop", SUCCEEDS}, + {"te[^x]t", "test", SUCCEEDS}, + {"te[^abc]t", "test", SUCCEEDS}, + {"te[^x]t", "test", SUCCEEDS}, + {"te[!x]t", "test", SUCCEEDS}, + {"te[^x]t", "text", FAILS}, + {"te[^\\x]t", "text", FAILS}, + {"te[^x\\", "text", FAILS}, + {"te[/]t", "text", FAILS}, + {"te[S]t", "test", SUCCEEDS_IF(APR_FNM_CASE_BLIND)}, + {"te[r-t]t", "test", SUCCEEDS}, + {"te[r-t]t", "teSt", SUCCEEDS_IF(APR_FNM_CASE_BLIND)}, + {"te[r-T]t", "test", SUCCEEDS_IF(APR_FNM_CASE_BLIND)}, + {"te[R-T]t", "test", SUCCEEDS_IF(APR_FNM_CASE_BLIND)}, + {"te[r-Tz]t", "tezt", SUCCEEDS}, + {"te[R-T]t", "tent", FAILS}, + {"\\/test", "/test", FAILS_IF(APR_FNM_NOESCAPE)}, + {"test/this", "test/", FAILS}, {"test/", "test/this", FAILS}, {"test*/this", "test/this", SUCCEEDS}, @@ -133,6 +151,35 @@ static void test_fnmatch(abts_case *tc, void *data) } } +static void test_fnmatch_test(abts_case *tc, void *data) +{ + static const struct test { + const char *pattern; + int result; + } ft_tests[] = { + { "a*b", 1 }, + { "a?", 1 }, + { "a\\b?", 1 }, + { "a[b-c]", 1 }, + { "a", 0 }, + { "a\\", 0 }, + { NULL, 0 } + }; + const struct test *t; + + for (t = ft_tests; t->pattern != NULL; t++) { + int res = apr_fnmatch_test(t->pattern); + + if (res != t->result) { + char buf[128]; + + sprintf(buf, "apr_fnmatch_test(\"%s\") = %d, expected %d\n", + t->pattern, res, t->result); + abts_fail(tc, buf, __LINE__); + } + } +} + static void test_glob(abts_case *tc, void *data) { int i; @@ -177,6 +224,7 @@ abts_suite *testfnmatch(abts_suite *suite) suite = ADD_SUITE(suite) abts_run_test(suite, test_fnmatch, NULL); + abts_run_test(suite, test_fnmatch_test, NULL); abts_run_test(suite, test_glob, NULL); abts_run_test(suite, test_glob_currdir, NULL); From c38c46624d42939b5d69b5f2249f172e72b88cd2 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 11 May 2011 23:42:05 +0000 Subject: [PATCH 7002/7878] Don't unconditionally include apr_dbg_win32_handles.h anywhere (misc.c), as it enables special handle debugging support within APR. In lieu of editing apr_private.h, allow enabling this handle debugging by defining APR_DBG_WIN32_HANDLES at compile time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1102138 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_dbg_win32_handles.h | 13 ++++++++++--- include/arch/win32/apr_private.h | 8 ++++++++ misc/win32/misc.c | 5 ++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/include/arch/win32/apr_dbg_win32_handles.h b/include/arch/win32/apr_dbg_win32_handles.h index 471cd66dbfc..5b6acb42a40 100644 --- a/include/arch/win32/apr_dbg_win32_handles.h +++ b/include/arch/win32/apr_dbg_win32_handles.h @@ -23,9 +23,12 @@ extern "C" { /* USAGE: * - * Add the following include to apr_private.h for internal debugging, - * or copy this header into apr/include add the include below to apr.h - * for really global debugging; + * To enable for APR only: + * Define APR_DBG_WIN32_HANDLES at compile time, or edit apr_private.h + * and make the include of apr_dbg_win32_handles.h unconditional. + * + * To enable for APR applications as well: + * Copy this header into apr/include add the include below to apr.h. * * #include "apr_dbg_win32_handles.h" * @@ -53,6 +56,10 @@ extern "C" { * treated as a handle. */ +#ifndef APR_DBG_WIN32_HANDLES +#define APR_DBG_WIN32_HANDLES +#endif + APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, int nh,/* HANDLE *hv, char *dsc */...); diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 10e4656d19e..095e80c22ed 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -193,4 +193,12 @@ APR_DECLARE_DATA int errno; #include #endif +/* Define APR_DBG_WIN32_HANDLES for the APR build, or just unconditionally + * include apr_dbg_win32_handles.h below to enable handle debugging for + * APR internals. See apr_dbg_win32_handles.h for more information. + */ +#ifdef APR_DBG_WIN32_HANDLES +#include "apr_dbg_win32_handles.h" +#endif + #endif /*APR_PRIVATE_H*/ diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 9651561285f..a29d789b847 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -17,7 +17,6 @@ #include "apr_private.h" #include "apr_arch_misc.h" #include "apr_arch_file_io.h" -#include "apr_dbg_win32_handles.h" #include "assert.h" #include "apr_lib.h" #include "tchar.h" @@ -192,7 +191,10 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) } /* Declared in include/arch/win32/apr_dbg_win32_handles.h + * Enabled by defining APR_DBG_WIN32_HANDLES or by including + * apr_dbg_win32_handles.h in specific files. */ +#ifdef APR_DBG_WIN32_HANDLES APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, int nh, /* HANDLE hv, char *dsc */...) { @@ -265,3 +267,4 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, } return ha; } +#endif /* ifdef APR_DBG_WIN32_HANDLES */ From 6d3a0ac4b4dc2ed66252bcdc889db5d9ce20007e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 12 May 2011 00:14:54 +0000 Subject: [PATCH 7003/7878] revert r1102138, as the feature is supposed to be usable by including apr_dbg_win32_handles.h in any particular source file, which in turn requires that apr_dbg_log() always be exported git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1102145 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_dbg_win32_handles.h | 13 +++---------- include/arch/win32/apr_private.h | 8 -------- misc/win32/misc.c | 5 +---- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/include/arch/win32/apr_dbg_win32_handles.h b/include/arch/win32/apr_dbg_win32_handles.h index 5b6acb42a40..471cd66dbfc 100644 --- a/include/arch/win32/apr_dbg_win32_handles.h +++ b/include/arch/win32/apr_dbg_win32_handles.h @@ -23,12 +23,9 @@ extern "C" { /* USAGE: * - * To enable for APR only: - * Define APR_DBG_WIN32_HANDLES at compile time, or edit apr_private.h - * and make the include of apr_dbg_win32_handles.h unconditional. - * - * To enable for APR applications as well: - * Copy this header into apr/include add the include below to apr.h. + * Add the following include to apr_private.h for internal debugging, + * or copy this header into apr/include add the include below to apr.h + * for really global debugging; * * #include "apr_dbg_win32_handles.h" * @@ -56,10 +53,6 @@ extern "C" { * treated as a handle. */ -#ifndef APR_DBG_WIN32_HANDLES -#define APR_DBG_WIN32_HANDLES -#endif - APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, int nh,/* HANDLE *hv, char *dsc */...); diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 095e80c22ed..10e4656d19e 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -193,12 +193,4 @@ APR_DECLARE_DATA int errno; #include #endif -/* Define APR_DBG_WIN32_HANDLES for the APR build, or just unconditionally - * include apr_dbg_win32_handles.h below to enable handle debugging for - * APR internals. See apr_dbg_win32_handles.h for more information. - */ -#ifdef APR_DBG_WIN32_HANDLES -#include "apr_dbg_win32_handles.h" -#endif - #endif /*APR_PRIVATE_H*/ diff --git a/misc/win32/misc.c b/misc/win32/misc.c index a29d789b847..9651561285f 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -17,6 +17,7 @@ #include "apr_private.h" #include "apr_arch_misc.h" #include "apr_arch_file_io.h" +#include "apr_dbg_win32_handles.h" #include "assert.h" #include "apr_lib.h" #include "tchar.h" @@ -191,10 +192,7 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) } /* Declared in include/arch/win32/apr_dbg_win32_handles.h - * Enabled by defining APR_DBG_WIN32_HANDLES or by including - * apr_dbg_win32_handles.h in specific files. */ -#ifdef APR_DBG_WIN32_HANDLES APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, int nh, /* HANDLE hv, char *dsc */...) { @@ -267,4 +265,3 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, } return ha; } -#endif /* ifdef APR_DBG_WIN32_HANDLES */ From 85299809fb2e7072e979f06223eaecce85c6b959 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 12 May 2011 00:42:22 +0000 Subject: [PATCH 7004/7878] revert part of r892177, which inadvertently enabled Win32 handle debugging for this file by including apr_dbg_win32_handles.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1102149 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/misc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 9651561285f..3591f63c611 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -17,7 +17,6 @@ #include "apr_private.h" #include "apr_arch_misc.h" #include "apr_arch_file_io.h" -#include "apr_dbg_win32_handles.h" #include "assert.h" #include "apr_lib.h" #include "tchar.h" From 473830a40f790bf8e0cfa1873075c59c02bd9b74 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Fri, 13 May 2011 12:03:59 +0000 Subject: [PATCH 7005/7878] apr_brigades: prevent infinite loop on a corrupt brigade PR 51062 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1102687 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ buckets/apr_brigade.c | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGES b/CHANGES index 3643a3801ac..9136bb917ee 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_brigades: add a check to prevent infinite while loop in case + of a corrupted brigade. Problem evidenced in PR 51062. Analysis by + Krzysztof Kostałkowicz , patch [Nick Kew]. + *) apr_socket_connect() on Windows: Handle WSAEISCONN. PR 48736. [, Jeff Trawick] diff --git a/buckets/apr_brigade.c b/buckets/apr_brigade.c index a075674e86e..02319214f2d 100644 --- a/buckets/apr_brigade.c +++ b/buckets/apr_brigade.c @@ -38,11 +38,16 @@ APR_DECLARE(apr_status_t) apr_brigade_cleanup(void *data) { apr_bucket_brigade *b = data; apr_bucket *e; + apr_bucket *prev = NULL; APR_BRIGADE_CHECK_CONSISTENCY(b); while (!APR_BRIGADE_EMPTY(b)) { e = APR_BRIGADE_FIRST(b); + if (e == prev) { /* PR#51062: prevent infinite loop on a corrupt brigade */ + return APR_EGENERAL; /* FIXME: this should definitely be a "can't happen"! */ + } + prev = e; apr_bucket_delete(e); } /* We don't need to free(bb) because it's allocated from a pool. */ @@ -323,6 +328,7 @@ APR_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut, apr_off_t maxbytes) { apr_off_t readbytes = 0; + apr_bucket *prev = NULL; while (!APR_BRIGADE_EMPTY(bbIn)) { const char *pos; @@ -332,6 +338,10 @@ APR_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut, apr_bucket *e; e = APR_BRIGADE_FIRST(bbIn); + if (e == prev) { /* PR#51062: prevent infinite loop on a corrupt brigade */ + return APR_EGENERAL; /* FIXME: this should definitely be a "can't happen"! */ + } + prev = e; rv = apr_bucket_read(e, &str, &len, block); if (rv != APR_SUCCESS) { From 1d8f1f2591f218c544667ea351242d0a8b62efa0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 14 May 2011 09:13:59 +0000 Subject: [PATCH 7006/7878] Appears to be required for getpid() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1102978 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmemcache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testmemcache.c b/test/testmemcache.c index 0d0e7b939a8..0bd7f189bdf 100644 --- a/test/testmemcache.c +++ b/test/testmemcache.c @@ -22,6 +22,7 @@ #include "apr_hash.h" #include "apr_memcache.h" #include "apr_network_io.h" +#include "apr_thread_proc.h" #if APR_HAVE_STDLIB_H #include /* for exit() */ From 145d0a4e65866560819212d6a75ebb20a4cb92b5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 14 May 2011 09:14:57 +0000 Subject: [PATCH 7007/7878] Need XML_STATIC to build with expat static .lib's git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1102980 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apr.dsp b/apr.dsp index 0ed2491b8c2..6ca1c5a164d 100644 --- a/apr.dsp +++ b/apr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "XML_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -67,7 +67,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "XML_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /EHsc /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -90,7 +90,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "x64\LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "XML_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -114,7 +114,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/private" /I "./include/arch/win32" /I "./include/arch/unix" /I "../expat/lib" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "XML_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-2" /FD /EHsc /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe From 35566fa5ad56d3b6dc0cb0c5ab6c55efdd30fcca Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 14 May 2011 09:41:52 +0000 Subject: [PATCH 7008/7878] Catch several faulty edgecases, no serious harm done git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1102987 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfnmatch.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/testfnmatch.c b/test/testfnmatch.c index 5a0813b62c9..c27cac76187 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -92,6 +92,16 @@ static struct pattern_s { {"te[r-Tz]t", "tezt", SUCCEEDS}, {"te[R-T]t", "tent", FAILS}, {"\\/test", "/test", FAILS_IF(APR_FNM_NOESCAPE)}, + {"tes[]t]", "test", SUCCEEDS}, + {"tes[t-]", "test", SUCCEEDS}, + {"tes[u-]", "test", FAILS}, + {"tes[t-]", "tes[t-]", FAILS}, + {"test[/-/]", "test[/-/]", SUCCEEDS_IF(APR_FNM_PATHNAME)}, + {"test[\\/-/]", "test[/-/]", APR_FNM_PATHNAME, APR_FNM_NOESCAPE}, + {"test[/-\\/]", "test[/-/]", APR_FNM_PATHNAME, APR_FNM_NOESCAPE}, + {"test[/-/]", "test/", FAILS_IF(APR_FNM_PATHNAME)}, + {"test[\\/-/]", "test/", FAILS_IF(APR_FNM_PATHNAME)}, + {"test[/-\\/]", "test/", FAILS_IF(APR_FNM_PATHNAME)}, {"test/this", "test/", FAILS}, {"test/", "test/this", FAILS}, From 665b9dbb0712a57ef13e3a0637fde14d6b1088d7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 14 May 2011 09:53:06 +0000 Subject: [PATCH 7009/7878] Fix []...] pattern bug noted by jorton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1102992 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index cc361155d5b..489c3a6fd80 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -93,7 +93,7 @@ static APR_INLINE int fnmatch_ch(const char **pattern, const char **string, int while (**pattern) { /* ']' is an ordinary character at the start of the range pattern */ - if ((**pattern == ']') && (*pattern > mismatch)) { + if ((**pattern == ']') && (*pattern > mismatch + 1)) { ++*pattern; /* XXX: Fix for MBCS character width */ ++*string; From 8d82473db95069930c9173031ed2cd3f1f9a1133 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 14 May 2011 09:58:19 +0000 Subject: [PATCH 7010/7878] Optimize []...] pattern case git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1102995 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index 489c3a6fd80..2530dabb17a 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -90,10 +90,13 @@ static APR_INLINE int fnmatch_ch(const char **pattern, const char **string, int if (negate) ++*pattern; + /* ']' is an ordinary character at the start of the range pattern */ + if (**pattern == ']') + goto leadingclosebrace; + while (**pattern) { - /* ']' is an ordinary character at the start of the range pattern */ - if ((**pattern == ']') && (*pattern > mismatch + 1)) { + if (**pattern == ']') { ++*pattern; /* XXX: Fix for MBCS character width */ ++*string; @@ -112,6 +115,7 @@ static APR_INLINE int fnmatch_ch(const char **pattern, const char **string, int if (slash && (**pattern == '/')) break; +leadingclosebrace: /* Look at only well-formed range patterns; ']' is allowed only if escaped, * while '/' is not allowed at all in FNM_PATHNAME mode. */ From bff82ec313fa68c02aab064b0348a10ceec697cc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 14 May 2011 11:15:55 +0000 Subject: [PATCH 7011/7878] Fix another edge case, in [x-/] processing, which I can't seem to compose the proper test-case to expose. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1103041 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index 2530dabb17a..c3eea03d99a 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -121,7 +121,7 @@ static APR_INLINE int fnmatch_ch(const char **pattern, const char **string, int */ /* XXX: Fix for locale/MBCS character width */ if (((*pattern)[1] == '-') && (*pattern)[2] - && ((escape && ((*pattern)[2] != '\\')) + && (!(escape && ((*pattern)[2] == '\\')) ? (((*pattern)[2] != ']') && (!slash || ((*pattern)[2] != '/'))) : (((*pattern)[3]) && (!slash || ((*pattern)[3] != '/'))))) { startch = *pattern; From 362cc2e36d362ed8405b38a31efbd7ed130c50e4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 14 May 2011 11:25:47 +0000 Subject: [PATCH 7012/7878] Refactor a complex test into a very simple test and optimize the exception cases to bust the loop early. Clean up documentation a bit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1103046 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index c3eea03d99a..5d319133a4a 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -116,17 +116,22 @@ static APR_INLINE int fnmatch_ch(const char **pattern, const char **string, int break; leadingclosebrace: - /* Look at only well-formed range patterns; ']' is allowed only if escaped, - * while '/' is not allowed at all in FNM_PATHNAME mode. + /* Look at only well-formed range patterns; + * "x-]" is not allowed unless escaped ("x-\]") */ /* XXX: Fix for locale/MBCS character width */ - if (((*pattern)[1] == '-') && (*pattern)[2] - && (!(escape && ((*pattern)[2] == '\\')) - ? (((*pattern)[2] != ']') && (!slash || ((*pattern)[2] != '/'))) - : (((*pattern)[3]) && (!slash || ((*pattern)[3] != '/'))))) { + if (((*pattern)[1] == '-') && ((*pattern)[2] != ']')) + { startch = *pattern; *pattern += (escape && ((*pattern)[2] == '\\')) ? 3 : 2; + /* NOT a properly balanced [expr] pattern, EOS terminated + * or ranges containing a slash in FNM_PATHNAME mode pattern + * fall out to to the rewind and test '[' literal code path + */ + if (!**pattern || (slash && (**pattern == '\\'))) + break; + /* XXX: handle locale/MBCS comparison, advance by MBCS char width */ if ((**string >= *startch) && (**string <= **pattern)) result = 0; @@ -150,7 +155,9 @@ static APR_INLINE int fnmatch_ch(const char **pattern, const char **string, int ++*pattern; } - /* NOT a properly balanced [expr] pattern; Rewind to test '[' literal */ + /* NOT a properly balanced [expr] pattern; Rewind + * and reset result to test '[' literal + */ *pattern = mismatch; result = APR_FNM_NOMATCH; } From ab5356b52d6e0a0e38dc7cd93de7acd1b42cb158 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 14 May 2011 11:51:55 +0000 Subject: [PATCH 7013/7878] Comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1103066 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index 5d319133a4a..24aca409910 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -118,8 +118,8 @@ static APR_INLINE int fnmatch_ch(const char **pattern, const char **string, int leadingclosebrace: /* Look at only well-formed range patterns; * "x-]" is not allowed unless escaped ("x-\]") + * XXX: Fix for locale/MBCS character width */ - /* XXX: Fix for locale/MBCS character width */ if (((*pattern)[1] == '-') && ((*pattern)[2] != ']')) { startch = *pattern; From a924ed985428dfe99e93b78d69ab0f3b0a2206aa Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 14 May 2011 11:59:32 +0000 Subject: [PATCH 7014/7878] Fix syntax for legibility as suggested by Stefan. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1103070 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index 24aca409910..5e4b0d95fb2 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -363,12 +363,12 @@ APR_DECLARE(int) apr_fnmatch(const char *pattern, const char *string, int flags) } } - if (*string && (!slash || (*string != '/'))) + if (*string && !(slash && (*string == '/'))) return APR_FNM_NOMATCH; - if (*pattern && (!slash || ((*pattern != '/') - && (!escape || (*pattern != '\\') - || (pattern[1] != '/'))))) + if (*pattern && !(slash && ((*pattern == '/') + || (escape && (*pattern == '\\') + && (pattern[1] == '/'))))) return APR_FNM_NOMATCH; } From 9b36433b31cc5d700122e75d6d1a6bd8cb26bfdf Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 14 May 2011 12:39:30 +0000 Subject: [PATCH 7015/7878] Further expression simplification for legibility. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1103091 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index 5e4b0d95fb2..7e5c47dbc68 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -209,7 +209,8 @@ APR_DECLARE(int) apr_fnmatch(const char *pattern, const char *string, int flags) while (*pattern) { - /* Match balanced slashes, starting a new segment pattern + /* Pre-decode "\/" which has no special significance, and + * match balanced slashes, starting a new segment pattern */ if (slash && escape && (*pattern == '\\') && (pattern[1] == '/')) ++pattern; @@ -246,12 +247,17 @@ APR_DECLARE(int) apr_fnmatch(const char *pattern, const char *string, int flags) /* Allow pattern '*' to be consumed even with no remaining string to match */ - while (*pattern && !(slash && ((*pattern == '/') - || (escape && (*pattern == '\\') - && (pattern[1] == '/')))) - && ((string < strendseg) - || ((*pattern == '*') && (string == strendseg)))) + while (*pattern) { + if ((string > strendseg) + || ((string == strendseg) && (*pattern != '*'))) + break; + + if (slash && ((*pattern == '/') + || (escape && (*pattern == '\\') + && (pattern[1] == '/')))) + break; + /* Reduce groups of '*' and '?' to n '?' matches * followed by one '*' test for simplicity */ @@ -335,9 +341,10 @@ APR_DECLARE(int) apr_fnmatch(const char *pattern, const char *string, int flags) if (*pattern == '*') break; - if (slash && ((*string == '/') || (*pattern == '/') - || (escape && (*pattern == '\\') - && (pattern[1] == '/')))) + if (slash && ((*string == '/') + || (*pattern == '/') + || (escape && (*pattern == '\\') + && (pattern[1] == '/')))) break; /* Compare ch's (the pattern is advanced over "\/" to the '/', From 5729c9c41c6c2217f562d1aa32b1e9dcc72fcb82 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 14 May 2011 14:09:19 +0000 Subject: [PATCH 7016/7878] r1098292 appears to have failed to copy line-endings git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1103115 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 956 +++++++++++++++++++++--------------------- 1 file changed, 478 insertions(+), 478 deletions(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index 7e5c47dbc68..0b00846e523 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -1,478 +1,478 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -/* Derived from The Open Group Base Specifications Issue 7, IEEE Std 1003.1-2008 - * as described in; - * http://pubs.opengroup.org/onlinepubs/9699919799/functions/fnmatch.html - * - * Filename pattern matches defined in section 2.13, "Pattern Matching Notation" - * from chapter 2. "Shell Command Language" - * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13 - * where; 1. A bracket expression starting with an unquoted '^' - * character CONTINUES to specify a non-matching list; 2. an explicit '.' - * in a bracket expression matching list, e.g. "[.abc]" does NOT match a leading - * in a filename; 3. a '[' which does not introduce - * a valid bracket expression is treated as an ordinary character; 4. a differing - * number of consecutive slashes within pattern and string will NOT match; - * 5. a trailing '\' in FNM_ESCAPE mode is treated as an ordinary '\' character. - * - * Bracket expansion defined in section 9.3.5, "RE Bracket Expression", - * from chapter 9, "Regular Expressions" - * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_05 - * with no support for collating symbols, equivalence class expressions or - * character class expressions. A partial range expression with a leading - * hyphen following a valid range expression will match only the ordinary - * and the ending character (e.g. "[a-m-z]" will match characters - * 'a' through 'm', a '-', or a 'z'). - * - * NOTE: Only POSIX/C single byte locales are correctly supported at this time. - * Notably, non-POSIX locales with FNM_CASEFOLD produce undefined results, - * particularly in ranges of mixed case (e.g. "[A-z]") or spanning alpha and - * nonalpha characters within a range. - * - * XXX comments below indicate porting required for multi-byte character sets - * and non-POSIX locale collation orders; requires mbr* APIs to track shift - * state of pattern and string (rewinding pattern and string repeatedly). - * - * Certain parts of the code assume 0x00-0x3F are unique with any MBCS (e.g. - * UTF-8, SHIFT-JIS, etc). Any implementation allowing '\' as an alternate - * path delimiter must be aware that 0x5C is NOT unique within SHIFT-JIS. - */ - -#include "apr_file_info.h" -#include "apr_fnmatch.h" -#include "apr_tables.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include -#if APR_HAVE_CTYPE_H -# include -#endif - - -/* Most MBCS/collation/case issues handled here. Wildcard '*' is not handled. - * EOS '\0' and the FNM_PATHNAME '/' delimiters are not advanced over, - * however the "\/" sequence is advanced to '/'. - * - * Both pattern and string are **char to support pointer increment of arbitrary - * multibyte characters for the given locale, in a later iteration of this code - */ -static APR_INLINE int fnmatch_ch(const char **pattern, const char **string, int flags) -{ - const char * const mismatch = *pattern; - const int nocase = !!(flags & APR_FNM_CASE_BLIND); - const int escape = !(flags & APR_FNM_NOESCAPE); - const int slash = !!(flags & APR_FNM_PATHNAME); - int result = APR_FNM_NOMATCH; - const char *startch; - int negate; - - if (**pattern == '[') - { - ++*pattern; - - /* Handle negation, either leading ! or ^ operators (never both) */ - negate = ((**pattern == '!') || (**pattern == '^')); - if (negate) - ++*pattern; - - /* ']' is an ordinary character at the start of the range pattern */ - if (**pattern == ']') - goto leadingclosebrace; - - while (**pattern) - { - if (**pattern == ']') { - ++*pattern; - /* XXX: Fix for MBCS character width */ - ++*string; - return (result ^ negate); - } - - if (escape && (**pattern == '\\')) { - ++*pattern; - - /* Patterns must be terminated with ']', not EOS */ - if (!**pattern) - break; - } - - /* Patterns must be terminated with ']' not '/' */ - if (slash && (**pattern == '/')) - break; - -leadingclosebrace: - /* Look at only well-formed range patterns; - * "x-]" is not allowed unless escaped ("x-\]") - * XXX: Fix for locale/MBCS character width - */ - if (((*pattern)[1] == '-') && ((*pattern)[2] != ']')) - { - startch = *pattern; - *pattern += (escape && ((*pattern)[2] == '\\')) ? 3 : 2; - - /* NOT a properly balanced [expr] pattern, EOS terminated - * or ranges containing a slash in FNM_PATHNAME mode pattern - * fall out to to the rewind and test '[' literal code path - */ - if (!**pattern || (slash && (**pattern == '\\'))) - break; - - /* XXX: handle locale/MBCS comparison, advance by MBCS char width */ - if ((**string >= *startch) && (**string <= **pattern)) - result = 0; - else if (nocase && (isupper(**string) || isupper(*startch) - || isupper(**pattern)) - && (tolower(**string) >= tolower(*startch)) - && (tolower(**string) <= tolower(**pattern))) - result = 0; - - ++*pattern; - continue; - } - - /* XXX: handle locale/MBCS comparison, advance by MBCS char width */ - if ((**string == **pattern)) - result = 0; - else if (nocase && (isupper(**string) || isupper(**pattern)) - && (tolower(**string) == tolower(**pattern))) - result = 0; - - ++*pattern; - } - - /* NOT a properly balanced [expr] pattern; Rewind - * and reset result to test '[' literal - */ - *pattern = mismatch; - result = APR_FNM_NOMATCH; - } - else if (**pattern == '?') { - /* Optimize '?' match before unescaping **pattern */ - if (!**string || (slash && (**string == '/'))) - return APR_FNM_NOMATCH; - result = 0; - goto fnmatch_ch_success; - } - else if (escape && (**pattern == '\\') && (*pattern)[1]) { - ++*pattern; - } - - /* XXX: handle locale/MBCS comparison, advance by the MBCS char width */ - if (**string == **pattern) - result = 0; - else if (nocase && (isupper(**string) || isupper(**pattern)) - && (tolower(**string) == tolower(**pattern))) - result = 0; - - /* Refuse to advance over trailing slash or nulls - */ - if (!**string || !**pattern || (slash && ((**string == '/') || (**pattern == '/')))) - return result; - -fnmatch_ch_success: - ++*pattern; - ++*string; - return result; -} - - -APR_DECLARE(int) apr_fnmatch(const char *pattern, const char *string, int flags) -{ - static const char dummystring[2] = {' ', 0}; - const int escape = !(flags & APR_FNM_NOESCAPE); - const int slash = !!(flags & APR_FNM_PATHNAME); - const char *strendseg; - const char *dummyptr; - const char *matchptr; - int wild; - /* For '*' wild processing only; surpress 'used before initialization' - * warnings with dummy initialization values; - */ - const char *strstartseg = NULL; - const char *mismatch = NULL; - int matchlen = 0; - - while (*pattern) - { - /* Pre-decode "\/" which has no special significance, and - * match balanced slashes, starting a new segment pattern - */ - if (slash && escape && (*pattern == '\\') && (pattern[1] == '/')) - ++pattern; - if (slash && (*pattern == '/') && (*string == '/')) { - ++pattern; - ++string; - } - - /* At the beginning of each segment, validate leading period behavior. - */ - if ((flags & APR_FNM_PERIOD) && (*string == '.')) - { - if (*pattern == '.') - ++pattern; - else if (escape && (*pattern == '\\') && (pattern[1] == '.')) - pattern += 2; - else - return APR_FNM_NOMATCH; - ++string; - } - - /* Determine the end of string segment - * - * Presumes '/' character is unique, not composite in any MBCS encoding - */ - if (slash) { - strendseg = strchr(string, '/'); - if (!strendseg) - strendseg = strchr(string, '\0'); - } - else { - strendseg = strchr(string, '\0'); - } - - /* Allow pattern '*' to be consumed even with no remaining string to match - */ - while (*pattern) - { - if ((string > strendseg) - || ((string == strendseg) && (*pattern != '*'))) - break; - - if (slash && ((*pattern == '/') - || (escape && (*pattern == '\\') - && (pattern[1] == '/')))) - break; - - /* Reduce groups of '*' and '?' to n '?' matches - * followed by one '*' test for simplicity - */ - for (wild = 0; ((*pattern == '*') || (*pattern == '?')); ++pattern) - { - if (*pattern == '*') { - wild = 1; - } - else if (string < strendseg) { /* && (*pattern == '?') */ - /* XXX: Advance 1 char for MBCS locale */ - ++string; - } - else { /* (string >= strendseg) && (*pattern == '?') */ - return APR_FNM_NOMATCH; - } - } - - if (wild) - { - strstartseg = string; - mismatch = pattern; - - /* Count fixed (non '*') char matches remaining in pattern - * excluding '/' (or "\/") and '*' - */ - for (matchptr = pattern, matchlen = 0; 1; ++matchlen) - { - if ((*matchptr == '\0') - || (slash && ((*matchptr == '/') - || (escape && (*matchptr == '\\') - && (matchptr[1] == '/'))))) - { - /* Compare precisely this many trailing string chars, - * the resulting match needs no wildcard loop - */ - /* XXX: Adjust for MBCS */ - if (string + matchlen > strendseg) - return APR_FNM_NOMATCH; - - string = strendseg - matchlen; - wild = 0; - break; - } - - if (*matchptr == '*') - { - /* Ensure at least this many trailing string chars remain - * for the first comparison - */ - /* XXX: Adjust for MBCS */ - if (string + matchlen > strendseg) - return APR_FNM_NOMATCH; - - /* Begin first wild comparison at the current position */ - break; - } - - /* Skip forward in pattern by a single character match - * Use a dummy fnmatch_ch() test to count one "[range]" escape - */ - /* XXX: Adjust for MBCS */ - if (escape && (*matchptr == '\\') && matchptr[1]) { - matchptr += 2; - } - else if (*matchptr == '[') { - dummyptr = dummystring; - fnmatch_ch(&matchptr, &dummyptr, flags); - } - else { - ++matchptr; - } - } - } - - /* Incrementally match string against the pattern - */ - while (*pattern && (string < strendseg)) - { - /* Success; begin a new wild pattern search - */ - if (*pattern == '*') - break; - - if (slash && ((*string == '/') - || (*pattern == '/') - || (escape && (*pattern == '\\') - && (pattern[1] == '/')))) - break; - - /* Compare ch's (the pattern is advanced over "\/" to the '/', - * but slashes will mismatch, and are not consumed) - */ - if (!fnmatch_ch(&pattern, &string, flags)) - continue; - - /* Failed to match, loop against next char offset of string segment - * until not enough string chars remain to match the fixed pattern - */ - if (wild) { - /* XXX: Advance 1 char for MBCS locale */ - string = ++strstartseg; - if (string + matchlen > strendseg) - return APR_FNM_NOMATCH; - - pattern = mismatch; - continue; - } - else - return APR_FNM_NOMATCH; - } - } - - if (*string && !(slash && (*string == '/'))) - return APR_FNM_NOMATCH; - - if (*pattern && !(slash && ((*pattern == '/') - || (escape && (*pattern == '\\') - && (pattern[1] == '/'))))) - return APR_FNM_NOMATCH; - } - - /* pattern is at EOS; if string is also, declare success - */ - if (!*string) - return 0; - - /* pattern didn't match to the end of string */ - return APR_FNM_NOMATCH; -} - - -/* This function is an Apache addition - * return non-zero if pattern has any glob chars in it - * @bug Function does not distinguish for FNM_PATHNAME mode, which renders - * a false positive for test[/]this (which is not a range, but - * seperate test[ and ]this segments and no glob.) - * @bug Function does not distinguish for non-FNM_ESCAPE mode. - * @bug Function does not parse []] correctly - * Solution may be to use fnmatch_ch() to walk the patterns? - */ -APR_DECLARE(int) apr_fnmatch_test(const char *pattern) -{ - int nesting; - - nesting = 0; - while (*pattern) { - switch (*pattern) { - case '?': - case '*': - return 1; - - case '\\': - if (*++pattern == '\0') { - return 0; - } - break; - - case '[': /* '[' is only a glob if it has a matching ']' */ - ++nesting; - break; - - case ']': - if (nesting) { - return 1; - } - break; - } - ++pattern; } - return 0; -} - - -/* Find all files matching the specified pattern */ -APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, - apr_array_header_t **result, - apr_pool_t *p) -{ - apr_dir_t *dir; - apr_finfo_t finfo; - apr_status_t rv; - char *path; - - /* XXX So, this is kind of bogus. Basically, I need to strip any leading - * directories off the pattern, but there is no portable way to do that. - * So, for now we just find the last occurance of '/' and if that doesn't - * return anything, then we look for '\'. This means that we could - * screw up on unix if the pattern is something like "foo\.*" That '\' - * isn't a directory delimiter, it is a part of the filename. To fix this, - * we really need apr_filepath_basename, which will be coming as soon as - * I get to it. rbb - */ - char *idx = strrchr(pattern, '/'); - - if (idx == NULL) { - idx = strrchr(pattern, '\\'); - } - if (idx == NULL) { - path = "."; - } - else { - path = apr_pstrndup(p, pattern, idx - pattern); - pattern = idx + 1; - } - - *result = apr_array_make(p, 0, sizeof(char *)); - rv = apr_dir_open(&dir, path, p); - if (rv != APR_SUCCESS) { - return rv; - } - - while (apr_dir_read(&finfo, APR_FINFO_NAME, dir) == APR_SUCCESS) { - if (apr_fnmatch(pattern, finfo.name, 0) == APR_SUCCESS) { - *(const char **)apr_array_push(*result) = apr_pstrdup(p, finfo.name); - } - } - apr_dir_close(dir); - return APR_SUCCESS; -} +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/* Derived from The Open Group Base Specifications Issue 7, IEEE Std 1003.1-2008 + * as described in; + * http://pubs.opengroup.org/onlinepubs/9699919799/functions/fnmatch.html + * + * Filename pattern matches defined in section 2.13, "Pattern Matching Notation" + * from chapter 2. "Shell Command Language" + * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13 + * where; 1. A bracket expression starting with an unquoted '^' + * character CONTINUES to specify a non-matching list; 2. an explicit '.' + * in a bracket expression matching list, e.g. "[.abc]" does NOT match a leading + * in a filename; 3. a '[' which does not introduce + * a valid bracket expression is treated as an ordinary character; 4. a differing + * number of consecutive slashes within pattern and string will NOT match; + * 5. a trailing '\' in FNM_ESCAPE mode is treated as an ordinary '\' character. + * + * Bracket expansion defined in section 9.3.5, "RE Bracket Expression", + * from chapter 9, "Regular Expressions" + * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_05 + * with no support for collating symbols, equivalence class expressions or + * character class expressions. A partial range expression with a leading + * hyphen following a valid range expression will match only the ordinary + * and the ending character (e.g. "[a-m-z]" will match characters + * 'a' through 'm', a '-', or a 'z'). + * + * NOTE: Only POSIX/C single byte locales are correctly supported at this time. + * Notably, non-POSIX locales with FNM_CASEFOLD produce undefined results, + * particularly in ranges of mixed case (e.g. "[A-z]") or spanning alpha and + * nonalpha characters within a range. + * + * XXX comments below indicate porting required for multi-byte character sets + * and non-POSIX locale collation orders; requires mbr* APIs to track shift + * state of pattern and string (rewinding pattern and string repeatedly). + * + * Certain parts of the code assume 0x00-0x3F are unique with any MBCS (e.g. + * UTF-8, SHIFT-JIS, etc). Any implementation allowing '\' as an alternate + * path delimiter must be aware that 0x5C is NOT unique within SHIFT-JIS. + */ + +#include "apr_file_info.h" +#include "apr_fnmatch.h" +#include "apr_tables.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include +#if APR_HAVE_CTYPE_H +# include +#endif + + +/* Most MBCS/collation/case issues handled here. Wildcard '*' is not handled. + * EOS '\0' and the FNM_PATHNAME '/' delimiters are not advanced over, + * however the "\/" sequence is advanced to '/'. + * + * Both pattern and string are **char to support pointer increment of arbitrary + * multibyte characters for the given locale, in a later iteration of this code + */ +static APR_INLINE int fnmatch_ch(const char **pattern, const char **string, int flags) +{ + const char * const mismatch = *pattern; + const int nocase = !!(flags & APR_FNM_CASE_BLIND); + const int escape = !(flags & APR_FNM_NOESCAPE); + const int slash = !!(flags & APR_FNM_PATHNAME); + int result = APR_FNM_NOMATCH; + const char *startch; + int negate; + + if (**pattern == '[') + { + ++*pattern; + + /* Handle negation, either leading ! or ^ operators (never both) */ + negate = ((**pattern == '!') || (**pattern == '^')); + if (negate) + ++*pattern; + + /* ']' is an ordinary character at the start of the range pattern */ + if (**pattern == ']') + goto leadingclosebrace; + + while (**pattern) + { + if (**pattern == ']') { + ++*pattern; + /* XXX: Fix for MBCS character width */ + ++*string; + return (result ^ negate); + } + + if (escape && (**pattern == '\\')) { + ++*pattern; + + /* Patterns must be terminated with ']', not EOS */ + if (!**pattern) + break; + } + + /* Patterns must be terminated with ']' not '/' */ + if (slash && (**pattern == '/')) + break; + +leadingclosebrace: + /* Look at only well-formed range patterns; + * "x-]" is not allowed unless escaped ("x-\]") + * XXX: Fix for locale/MBCS character width + */ + if (((*pattern)[1] == '-') && ((*pattern)[2] != ']')) + { + startch = *pattern; + *pattern += (escape && ((*pattern)[2] == '\\')) ? 3 : 2; + + /* NOT a properly balanced [expr] pattern, EOS terminated + * or ranges containing a slash in FNM_PATHNAME mode pattern + * fall out to to the rewind and test '[' literal code path + */ + if (!**pattern || (slash && (**pattern == '\\'))) + break; + + /* XXX: handle locale/MBCS comparison, advance by MBCS char width */ + if ((**string >= *startch) && (**string <= **pattern)) + result = 0; + else if (nocase && (isupper(**string) || isupper(*startch) + || isupper(**pattern)) + && (tolower(**string) >= tolower(*startch)) + && (tolower(**string) <= tolower(**pattern))) + result = 0; + + ++*pattern; + continue; + } + + /* XXX: handle locale/MBCS comparison, advance by MBCS char width */ + if ((**string == **pattern)) + result = 0; + else if (nocase && (isupper(**string) || isupper(**pattern)) + && (tolower(**string) == tolower(**pattern))) + result = 0; + + ++*pattern; + } + + /* NOT a properly balanced [expr] pattern; Rewind + * and reset result to test '[' literal + */ + *pattern = mismatch; + result = APR_FNM_NOMATCH; + } + else if (**pattern == '?') { + /* Optimize '?' match before unescaping **pattern */ + if (!**string || (slash && (**string == '/'))) + return APR_FNM_NOMATCH; + result = 0; + goto fnmatch_ch_success; + } + else if (escape && (**pattern == '\\') && (*pattern)[1]) { + ++*pattern; + } + + /* XXX: handle locale/MBCS comparison, advance by the MBCS char width */ + if (**string == **pattern) + result = 0; + else if (nocase && (isupper(**string) || isupper(**pattern)) + && (tolower(**string) == tolower(**pattern))) + result = 0; + + /* Refuse to advance over trailing slash or nulls + */ + if (!**string || !**pattern || (slash && ((**string == '/') || (**pattern == '/')))) + return result; + +fnmatch_ch_success: + ++*pattern; + ++*string; + return result; +} + + +APR_DECLARE(int) apr_fnmatch(const char *pattern, const char *string, int flags) +{ + static const char dummystring[2] = {' ', 0}; + const int escape = !(flags & APR_FNM_NOESCAPE); + const int slash = !!(flags & APR_FNM_PATHNAME); + const char *strendseg; + const char *dummyptr; + const char *matchptr; + int wild; + /* For '*' wild processing only; surpress 'used before initialization' + * warnings with dummy initialization values; + */ + const char *strstartseg = NULL; + const char *mismatch = NULL; + int matchlen = 0; + + while (*pattern) + { + /* Pre-decode "\/" which has no special significance, and + * match balanced slashes, starting a new segment pattern + */ + if (slash && escape && (*pattern == '\\') && (pattern[1] == '/')) + ++pattern; + if (slash && (*pattern == '/') && (*string == '/')) { + ++pattern; + ++string; + } + + /* At the beginning of each segment, validate leading period behavior. + */ + if ((flags & APR_FNM_PERIOD) && (*string == '.')) + { + if (*pattern == '.') + ++pattern; + else if (escape && (*pattern == '\\') && (pattern[1] == '.')) + pattern += 2; + else + return APR_FNM_NOMATCH; + ++string; + } + + /* Determine the end of string segment + * + * Presumes '/' character is unique, not composite in any MBCS encoding + */ + if (slash) { + strendseg = strchr(string, '/'); + if (!strendseg) + strendseg = strchr(string, '\0'); + } + else { + strendseg = strchr(string, '\0'); + } + + /* Allow pattern '*' to be consumed even with no remaining string to match + */ + while (*pattern) + { + if ((string > strendseg) + || ((string == strendseg) && (*pattern != '*'))) + break; + + if (slash && ((*pattern == '/') + || (escape && (*pattern == '\\') + && (pattern[1] == '/')))) + break; + + /* Reduce groups of '*' and '?' to n '?' matches + * followed by one '*' test for simplicity + */ + for (wild = 0; ((*pattern == '*') || (*pattern == '?')); ++pattern) + { + if (*pattern == '*') { + wild = 1; + } + else if (string < strendseg) { /* && (*pattern == '?') */ + /* XXX: Advance 1 char for MBCS locale */ + ++string; + } + else { /* (string >= strendseg) && (*pattern == '?') */ + return APR_FNM_NOMATCH; + } + } + + if (wild) + { + strstartseg = string; + mismatch = pattern; + + /* Count fixed (non '*') char matches remaining in pattern + * excluding '/' (or "\/") and '*' + */ + for (matchptr = pattern, matchlen = 0; 1; ++matchlen) + { + if ((*matchptr == '\0') + || (slash && ((*matchptr == '/') + || (escape && (*matchptr == '\\') + && (matchptr[1] == '/'))))) + { + /* Compare precisely this many trailing string chars, + * the resulting match needs no wildcard loop + */ + /* XXX: Adjust for MBCS */ + if (string + matchlen > strendseg) + return APR_FNM_NOMATCH; + + string = strendseg - matchlen; + wild = 0; + break; + } + + if (*matchptr == '*') + { + /* Ensure at least this many trailing string chars remain + * for the first comparison + */ + /* XXX: Adjust for MBCS */ + if (string + matchlen > strendseg) + return APR_FNM_NOMATCH; + + /* Begin first wild comparison at the current position */ + break; + } + + /* Skip forward in pattern by a single character match + * Use a dummy fnmatch_ch() test to count one "[range]" escape + */ + /* XXX: Adjust for MBCS */ + if (escape && (*matchptr == '\\') && matchptr[1]) { + matchptr += 2; + } + else if (*matchptr == '[') { + dummyptr = dummystring; + fnmatch_ch(&matchptr, &dummyptr, flags); + } + else { + ++matchptr; + } + } + } + + /* Incrementally match string against the pattern + */ + while (*pattern && (string < strendseg)) + { + /* Success; begin a new wild pattern search + */ + if (*pattern == '*') + break; + + if (slash && ((*string == '/') + || (*pattern == '/') + || (escape && (*pattern == '\\') + && (pattern[1] == '/')))) + break; + + /* Compare ch's (the pattern is advanced over "\/" to the '/', + * but slashes will mismatch, and are not consumed) + */ + if (!fnmatch_ch(&pattern, &string, flags)) + continue; + + /* Failed to match, loop against next char offset of string segment + * until not enough string chars remain to match the fixed pattern + */ + if (wild) { + /* XXX: Advance 1 char for MBCS locale */ + string = ++strstartseg; + if (string + matchlen > strendseg) + return APR_FNM_NOMATCH; + + pattern = mismatch; + continue; + } + else + return APR_FNM_NOMATCH; + } + } + + if (*string && !(slash && (*string == '/'))) + return APR_FNM_NOMATCH; + + if (*pattern && !(slash && ((*pattern == '/') + || (escape && (*pattern == '\\') + && (pattern[1] == '/'))))) + return APR_FNM_NOMATCH; + } + + /* pattern is at EOS; if string is also, declare success + */ + if (!*string) + return 0; + + /* pattern didn't match to the end of string */ + return APR_FNM_NOMATCH; +} + + +/* This function is an Apache addition + * return non-zero if pattern has any glob chars in it + * @bug Function does not distinguish for FNM_PATHNAME mode, which renders + * a false positive for test[/]this (which is not a range, but + * seperate test[ and ]this segments and no glob.) + * @bug Function does not distinguish for non-FNM_ESCAPE mode. + * @bug Function does not parse []] correctly + * Solution may be to use fnmatch_ch() to walk the patterns? + */ +APR_DECLARE(int) apr_fnmatch_test(const char *pattern) +{ + int nesting; + + nesting = 0; + while (*pattern) { + switch (*pattern) { + case '?': + case '*': + return 1; + + case '\\': + if (*++pattern == '\0') { + return 0; + } + break; + + case '[': /* '[' is only a glob if it has a matching ']' */ + ++nesting; + break; + + case ']': + if (nesting) { + return 1; + } + break; + } + ++pattern; } + return 0; +} + + +/* Find all files matching the specified pattern */ +APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, + apr_array_header_t **result, + apr_pool_t *p) +{ + apr_dir_t *dir; + apr_finfo_t finfo; + apr_status_t rv; + char *path; + + /* XXX So, this is kind of bogus. Basically, I need to strip any leading + * directories off the pattern, but there is no portable way to do that. + * So, for now we just find the last occurance of '/' and if that doesn't + * return anything, then we look for '\'. This means that we could + * screw up on unix if the pattern is something like "foo\.*" That '\' + * isn't a directory delimiter, it is a part of the filename. To fix this, + * we really need apr_filepath_basename, which will be coming as soon as + * I get to it. rbb + */ + char *idx = strrchr(pattern, '/'); + + if (idx == NULL) { + idx = strrchr(pattern, '\\'); + } + if (idx == NULL) { + path = "."; + } + else { + path = apr_pstrndup(p, pattern, idx - pattern); + pattern = idx + 1; + } + + *result = apr_array_make(p, 0, sizeof(char *)); + rv = apr_dir_open(&dir, path, p); + if (rv != APR_SUCCESS) { + return rv; + } + + while (apr_dir_read(&finfo, APR_FINFO_NAME, dir) == APR_SUCCESS) { + if (apr_fnmatch(pattern, finfo.name, 0) == APR_SUCCESS) { + *(const char **)apr_array_push(*result) = apr_pstrdup(p, finfo.name); + } + } + apr_dir_close(dir); + return APR_SUCCESS; +} From e2ec7966e8302237525440d614cfd95a26bc0f92 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 14 May 2011 20:15:16 +0000 Subject: [PATCH 7017/7878] Add namespace protection for apr_crypto_block_key_type_e and apr_crypto_block_key_mode_e. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1103203 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_nss.c | 18 ++++----- crypto/apr_crypto_openssl.c | 18 ++++----- include/apr_crypto.h | 15 ++++---- test/testcrypto.c | 74 ++++++++++++++++++------------------- 4 files changed, 63 insertions(+), 62 deletions(-) diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 4d3139bc9e0..4531d3078d5 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -332,33 +332,33 @@ static apr_status_t crypto_passphrase(apr_pool_t *p, /* decide on what cipher mechanism we will be using */ switch (type) { - case (KEY_3DES_192) : - if (MODE_CBC == mode) { + case (APR_KEY_3DES_192) : + if (APR_MODE_CBC == mode) { key->cipherOid = SEC_OID_DES_EDE3_CBC; } - else if (MODE_ECB == mode) { + else if (APR_MODE_ECB == mode) { return APR_ENOCIPHER; /* No OID for CKM_DES3_ECB; */ } break; - case (KEY_AES_128) : - if (MODE_CBC == mode) { + case (APR_KEY_AES_128) : + if (APR_MODE_CBC == mode) { key->cipherOid = SEC_OID_AES_128_CBC; } else { key->cipherOid = SEC_OID_AES_128_ECB; } break; - case (KEY_AES_192) : - if (MODE_CBC == mode) { + case (APR_KEY_AES_192) : + if (APR_MODE_CBC == mode) { key->cipherOid = SEC_OID_AES_192_CBC; } else { key->cipherOid = SEC_OID_AES_192_ECB; } break; - case (KEY_AES_256) : - if (MODE_CBC == mode) { + case (APR_KEY_AES_256) : + if (APR_MODE_CBC == mode) { key->cipherOid = SEC_OID_AES_256_CBC; } else { diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 86e81763e30..d0268d55f94 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -253,37 +253,37 @@ static apr_status_t crypto_passphrase(apr_pool_t *p, const apr_crypto_t *f, /* determine the cipher to be used */ switch (type) { - case (KEY_3DES_192): + case (APR_KEY_3DES_192): /* A 3DES key */ - if (mode == MODE_CBC) { + if (mode == APR_MODE_CBC) { key->cipher = EVP_des_ede3_cbc(); } else { key->cipher = EVP_des_ede3_ecb(); } break; - case (KEY_AES_128): + case (APR_KEY_AES_128): - if (mode == MODE_CBC) { + if (mode == APR_MODE_CBC) { key->cipher = EVP_aes_128_cbc(); } else { key->cipher = EVP_aes_128_ecb(); } break; - case (KEY_AES_192): + case (APR_KEY_AES_192): - if (mode == MODE_CBC) { + if (mode == APR_MODE_CBC) { key->cipher = EVP_aes_192_cbc(); } else { key->cipher = EVP_aes_192_ecb(); } break; - case (KEY_AES_256): + case (APR_KEY_AES_256): - if (mode == MODE_CBC) { + if (mode == APR_MODE_CBC) { key->cipher = EVP_aes_256_cbc(); } else { key->cipher = EVP_aes_256_ecb(); @@ -317,7 +317,7 @@ static apr_status_t crypto_passphrase(apr_pool_t *p, const apr_crypto_t *f, /* note: openssl incorrectly returns non zero IV size values for ECB * algorithms, so work around this by ignoring the IV size. */ - if (MODE_ECB != mode) { + if (APR_MODE_ECB != mode) { key->ivSize = EVP_CIPHER_iv_length(key->cipher); } if (ivSize) { diff --git a/include/apr_crypto.h b/include/apr_crypto.h index d03cdd455a5..9d0defde9ad 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -143,17 +143,18 @@ extern "C" { */ typedef enum { - KEY_NONE, KEY_3DES_192, /** 192 bit (3-Key) 3DES */ - KEY_AES_128, /** 128 bit AES */ - KEY_AES_192, /** 192 bit AES */ - KEY_AES_256 + APR_KEY_NONE, + APR_KEY_3DES_192, /** 192 bit (3-Key) 3DES */ + APR_KEY_AES_128, /** 128 bit AES */ + APR_KEY_AES_192, /** 192 bit AES */ + APR_KEY_AES_256 /** 256 bit AES */ } apr_crypto_block_key_type_e; typedef enum { - MODE_NONE, /** An error condition */ - MODE_ECB, /** Electronic Code Book */ - MODE_CBC + APR_MODE_NONE, /** An error condition */ + APR_MODE_ECB, /** Electronic Code Book */ + APR_MODE_CBC /** Cipher Block Chaining */ } apr_crypto_block_key_mode_e; diff --git a/test/testcrypto.c b/test/testcrypto.c index ce9af846e08..1e5220d068d 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -382,21 +382,21 @@ static void test_crypto_block_openssl(abts_case *tc, void *data) { apr_pool_create(&pool, NULL); drivers[0] = get_openssl_driver(tc, pool); drivers[1] = get_openssl_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_CBC, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, "KEY_3DES_192/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 0, in, inlen, "KEY_3DES_192/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_CBC, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, "KEY_AES_256/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, "KEY_AES_256/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_CBC, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, inlen, "KEY_AES_192/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_ECB, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, inlen, "KEY_AES_192/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_CBC, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, inlen, "KEY_AES_128/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_ECB, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, inlen, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); @@ -415,21 +415,21 @@ static void test_crypto_block_nss(abts_case *tc, void *data) { apr_pool_create(&pool, NULL); drivers[0] = get_nss_driver(tc, pool); drivers[1] = get_nss_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_CBC, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 0, in, inlen, "KEY_3DES_192/MODE_ECB"); */ - crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_CBC, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, "KEY_AES_256/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, "KEY_AES_256/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_CBC, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, inlen, "KEY_AES_192/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_ECB, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, inlen, "KEY_AES_192/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_CBC, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, inlen, "KEY_AES_128/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_ECB, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, inlen, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); @@ -449,14 +449,14 @@ static void test_crypto_block_nss_openssl(abts_case *tc, void *data) { drivers[0] = get_nss_driver(tc, pool); drivers[1] = get_openssl_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_CBC, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 0, in, inlen, "KEY_3DES_192/MODE_ECB"); */ - crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_CBC, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, "KEY_AES_256/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, "KEY_AES_256/MODE_ECB"); /* all 4 of these tests fail to interoperate - a clue from the xml-security code is that @@ -486,15 +486,15 @@ static void test_crypto_block_openssl_nss(abts_case *tc, void *data) { apr_pool_create(&pool, NULL); drivers[0] = get_openssl_driver(tc, pool); drivers[1] = get_nss_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_CBC, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 0, in, inlen, "KEY_3DES_192/MODE_ECB"); */ - crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_CBC, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, "KEY_AES_256/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 0, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, "KEY_AES_256/MODE_ECB"); /* all 4 of these tests fail to interoperate - a clue from the xml-security code is that @@ -525,21 +525,21 @@ static void test_crypto_block_openssl_pad(abts_case *tc, void *data) { drivers[0] = get_openssl_driver(tc, pool); drivers[1] = get_openssl_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_CBC, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, in, inlen, "KEY_3DES_192/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 1, in, inlen, "KEY_3DES_192/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_CBC, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, inlen, "KEY_AES_256/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 1, in, inlen, "KEY_AES_256/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_CBC, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, inlen, "KEY_AES_192/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_ECB, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 1, in, inlen, "KEY_AES_192/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_CBC, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, inlen, "KEY_AES_128/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_ECB, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 1, in, inlen, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); @@ -560,24 +560,24 @@ static void test_crypto_block_nss_pad(abts_case *tc, void *data) { drivers[0] = get_nss_driver(tc, pool); drivers[1] = get_nss_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_CBC, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, in, inlen, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 1, in, inlen, "KEY_3DES_192/MODE_ECB"); */ - crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_CBC, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, inlen, "KEY_AES_256/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ /*crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 1, in, inlen, "KEY_AES_256/MODE_ECB");*/ - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_CBC, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, inlen, "KEY_AES_192/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ /*crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_ECB, 1, in, inlen, "KEY_AES_192/MODE_ECB");*/ - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_CBC, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, inlen, "KEY_AES_128/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ @@ -601,13 +601,13 @@ static void test_crypto_block_nss_openssl_pad(abts_case *tc, void *data) { drivers[0] = get_nss_driver(tc, pool); drivers[1] = get_openssl_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_CBC, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, in, inlen, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 1, in, inlen, "KEY_3DES_192/MODE_ECB"); */ - crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_CBC, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, inlen, "KEY_AES_256/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ @@ -640,13 +640,13 @@ static void test_crypto_block_openssl_nss_pad(abts_case *tc, void *data) { apr_pool_create(&pool, NULL); drivers[0] = get_openssl_driver(tc, pool); drivers[1] = get_nss_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_CBC, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, in, inlen, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 1, in, inlen, "KEY_3DES_192/MODE_ECB"); */ - crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_CBC, 1, in, inlen, + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, inlen, "KEY_AES_256/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ From a3aba7e187e2c5b04505f50572b60d53fc13df74 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 14 May 2011 20:18:19 +0000 Subject: [PATCH 7018/7878] Remove unused header file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1103206 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_crypto.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/apr_crypto.h b/include/apr_crypto.h index 9d0defde9ad..38c2d8cfe54 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -20,7 +20,6 @@ #include "apu.h" #include "apr_pools.h" #include "apr_tables.h" -#include "apr_dso.h" #include "apu_errno.h" #ifdef __cplusplus From 560b27a1a949a677b23416ef02b0fbf0d73558d9 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 15 May 2011 00:40:42 +0000 Subject: [PATCH 7019/7878] Reorder parameters. No functional change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1103258 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 156 +++++++++++++------------- crypto/apr_crypto_nss.c | 125 +++++++++------------ crypto/apr_crypto_openssl.c | 106 +++++++++-------- include/apr_crypto.h | 122 ++++++++++---------- include/private/apr_crypto_internal.h | 80 ++++++------- test/testcrypto.c | 48 ++++---- 6 files changed, 314 insertions(+), 323 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 07ba351aafe..f73c4367b93 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -105,9 +105,9 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool, return ret; } -APR_DECLARE(apr_status_t) apr_crypto_get_driver(apr_pool_t *pool, const char *name, - const apr_crypto_driver_t **driver, const apr_array_header_t *params, - const apu_err_t **result) { +APR_DECLARE(apr_status_t) apr_crypto_get_driver(const apr_crypto_driver_t **driver, + const char *name, const apr_array_header_t *params, const apu_err_t **result, + apr_pool_t *pool) { #if APR_HAVE_MODULAR_DSO char modname[32]; char symname[34]; @@ -185,8 +185,8 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver(apr_pool_t *pool, const char *na /** * @brief Return the name of the driver. * - * @param pool - pool to register any shutdown cleanups, etc - * @return APR_SUCCESS for success. + * @param driver - The driver in use. + * @return The name of the driver. */ APR_DECLARE(const char *)apr_crypto_driver_name (const apr_crypto_driver_t *driver) { @@ -196,25 +196,30 @@ APR_DECLARE(const char *)apr_crypto_driver_name (const apr_crypto_driver_t *driv /** * @brief Get the result of the last operation on a context. If the result * is NULL, the operation was successful. - * @param f - context pointer * @param result - the result structure + * @param f - context pointer * @return APR_SUCCESS for success */ -APR_DECLARE(apr_status_t) apr_crypto_error( - const apr_crypto_t *f, const apu_err_t **result) { - return f->provider->error(f, result); +APR_DECLARE(apr_status_t) apr_crypto_error(const apu_err_t **result, + const apr_crypto_t *f) { + return f->provider->error(result, f); } /** - * @brief Create a general encryption context + * @brief Create a context for supporting encryption. Keys, certificates, + * algorithms and other parameters will be set per context. More than + * one context can be created at one time. A cleanup will be automatically + * registered with the given pool to guarantee a graceful shutdown. + * @param f - context pointer will be written here * @param driver - driver to use - * @param pool - process pool * @param params - array of key parameters - * @param f - context pointer will be written here + * @param pool - process pool + * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE + * if the engine cannot be initialised. */ -APR_DECLARE(apr_status_t) apr_crypto_make(const apr_crypto_driver_t *driver, - apr_pool_t *pool, const apr_array_header_t *params, apr_crypto_t **f) { - return driver->make(pool, driver, params, f); +APR_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, const apr_crypto_driver_t *driver, + const apr_array_header_t *params, apr_pool_t *pool) { + return driver->make(f, driver, params, pool); } /** @@ -226,9 +231,9 @@ APR_DECLARE(apr_status_t) apr_crypto_make(const apr_crypto_driver_t *driver, * operations. * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If * *key is not NULL, *key must point at a previously created structure. - * @param driver - driver to use - * @param p The pool to use. - * @param f The context to use. + * @param key The key returned, see note. + * @param ivSize The size of the initialisation vector will be returned, based + * on whether an IV is relevant for this type of crypto. * @param pass The passphrase to use. * @param passLen The passphrase length in bytes * @param salt The salt to use. @@ -236,47 +241,49 @@ APR_DECLARE(apr_status_t) apr_crypto_make(const apr_crypto_driver_t *driver, * @param type 3DES_192, AES_128, AES_192, AES_256. * @param mode Electronic Code Book / Cipher Block Chaining. * @param doPad Pad if necessary. - * @param key The key returned, see note. - * @param ivSize The size of the initialisation vector will be returned, based - * on whether an IV is relevant for this type of crypto. + * @param iterations Number of iterations to use in algorithm + * @param f The context to use. + * @param p The pool to use. * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend * error occurred while generating the key. APR_ENOCIPHER if the type or mode * is not supported by the particular backend. APR_EKEYTYPE if the key type is * not known. APR_EPADDING if padding was requested but is not supported. * APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_passphrase(apr_pool_t *p, const apr_crypto_t *f, - const char *pass, apr_size_t passLen, const unsigned char * salt, - apr_size_t saltLen, const apr_crypto_block_key_type_e type, +APR_DECLARE(apr_status_t) apr_crypto_passphrase(apr_crypto_key_t **key, + apr_size_t *ivSize, const char *pass, apr_size_t passLen, + const unsigned char * salt, apr_size_t saltLen, + const apr_crypto_block_key_type_e type, const apr_crypto_block_key_mode_e mode, const int doPad, - const int iterations, apr_crypto_key_t **key, apr_size_t *ivSize) { - return f->provider->passphrase(p, f, pass, passLen, salt, saltLen, type, mode, - doPad, iterations, key, ivSize); + const int iterations, const apr_crypto_t *f, apr_pool_t *p) +{ + return f->provider->passphrase(key, ivSize, pass, passLen, salt, saltLen, + type, mode, doPad, iterations, f, p); } /** * @brief Initialise a context for encrypting arbitrary data using the given key. * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. - * @param driver - driver to use - * @param p The pool to use. - * @param f The block context to use. - * @param key The key structure to use. + * @param ctx The block context returned, see note. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. * If the buffer pointed to is not NULL, the IV in the buffer will be * used. - * @param ctx The block context returned, see note. + * @param key The key structure to use. * @param blockSize The block size of the cipher. + * @param f The block context to use. + * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init(apr_pool_t *p, - const apr_crypto_t *f, const apr_crypto_key_t *key, - const unsigned char **iv, apr_crypto_block_t **ctx, - apr_size_t *blockSize) { - return f->provider->block_encrypt_init(p, f, key, iv, ctx, blockSize); +APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init( + apr_crypto_block_t **ctx, const unsigned char **iv, + const apr_crypto_key_t *key, apr_size_t *blockSize, + const apr_crypto_t *f, apr_pool_t *p) +{ + return f->provider->block_encrypt_init(ctx, iv, key, blockSize, f, p); } /** @@ -288,21 +295,21 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init(apr_pool_t *p, * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. - * @param driver - driver to use - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. + * @param f The block context to use. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_encrypt( - const apr_crypto_t *f, apr_crypto_block_t *ctx, - unsigned char **out, apr_size_t *outlen, const unsigned char *in, - apr_size_t inlen) { - return f->provider->block_encrypt(ctx, out, outlen, in, inlen); +APR_DECLARE(apr_status_t) apr_crypto_block_encrypt(unsigned char **out, + apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, + const apr_crypto_t *f, apr_crypto_block_t *ctx) +{ + return f->provider->block_encrypt(out, outlen, in, inlen, ctx); } /** @@ -313,43 +320,43 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt( * number of bytes returned as actually written by the * apr_crypto_block_encrypt() call. After this call, the context * is cleaned and can be reused by apr_crypto_block_encrypt_init(). - * @param driver - driver to use - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. + * @param f The block context to use. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish( - const apr_crypto_t *f, apr_crypto_block_t *ctx, - unsigned char *out, apr_size_t *outlen) { - return f->provider->block_encrypt_finish(ctx, out, outlen); +APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(unsigned char *out, + apr_size_t *outlen, const apr_crypto_t *f, apr_crypto_block_t *ctx) +{ + return f->provider->block_encrypt_finish(out, outlen, ctx); } /** * @brief Initialise a context for decrypting arbitrary data using the given key. * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. - * @param driver - driver to use - * @param p The pool to use. - * @param f The block context to use. - * @param key The key structure to use. - * @param iv Optional initialisation vector. * @param ctx The block context returned, see note. * @param blockSize The block size of the cipher. + * @param iv Optional initialisation vector. + * @param key The key structure to use. + * @param f The block context to use. + * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init(apr_pool_t *p, - const apr_crypto_t *f, const apr_crypto_key_t *key, - const unsigned char *iv, apr_crypto_block_t **ctx, - apr_size_t *blockSize) { - return f->provider->block_decrypt_init(p, f, key, iv, ctx, blockSize); +APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init( + apr_crypto_block_t **ctx, apr_size_t *blockSize, + const unsigned char *iv, const apr_crypto_key_t *key, + const apr_crypto_t *f, apr_pool_t *p) +{ + return f->provider->block_decrypt_init(ctx, blockSize, iv, key, f, p); } /** @@ -361,21 +368,21 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init(apr_pool_t *p, * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. - * @param driver - driver to use - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. + * @param f The block context to use. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_decrypt( - const apr_crypto_t *f, apr_crypto_block_t *ctx, - unsigned char **out, apr_size_t *outlen, const unsigned char *in, - apr_size_t inlen) { - return f->provider->block_decrypt(ctx, out, outlen, in, inlen); +APR_DECLARE(apr_status_t) apr_crypto_block_decrypt(unsigned char **out, + apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, + const apr_crypto_t *f, apr_crypto_block_t *ctx) +{ + return f->provider->block_decrypt(out, outlen, in, inlen, ctx); } /** @@ -386,27 +393,27 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt( * number of bytes returned as actually written by the * apr_crypto_block_decrypt() call. After this call, the context * is cleaned and can be reused by apr_crypto_block_decrypt_init(). - * @param driver - driver to use - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. + * @param f The block context to use. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish( - const apr_crypto_t *f, apr_crypto_block_t *ctx, - unsigned char *out, apr_size_t *outlen) { - return f->provider->block_decrypt_finish(ctx, out, outlen); +APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish(unsigned char *out, + apr_size_t *outlen, const apr_crypto_t *f, apr_crypto_block_t *ctx) +{ + return f->provider->block_decrypt_finish(out, outlen, ctx); } /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. - * @param driver - driver to use + * @param f The block context to use. * @param ctx The block context to use. * @return Returns APR_ENOTIMPL if not supported. */ @@ -418,7 +425,6 @@ APR_DECLARE(apr_status_t) apr_crypto_block_cleanup( /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. - * @param driver - driver to use * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 4531d3078d5..52d6822e3ba 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -74,7 +74,7 @@ struct apr_crypto_block_t { /** * Fetch the most recent error from this driver. */ -static apr_status_t crypto_error(const apr_crypto_t *f, const apu_err_t **result) { +static apr_status_t crypto_error(const apu_err_t **result, const apr_crypto_t *f) { *result = f->result; return APR_SUCCESS; } @@ -166,7 +166,7 @@ static apr_status_t crypto_init(apr_pool_t *pool, const apr_array_header_t *para /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. - * @param block The block context to use. + * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ static apr_status_t crypto_block_cleanup(apr_crypto_block_t *block) @@ -218,16 +218,15 @@ static apr_status_t crypto_cleanup_helper(void *data) * algorithms and other parameters will be set per context. More than * one context can be created at one time. A cleanup will be automatically * registered with the given pool to guarantee a graceful shutdown. - * @param pool - process pool + * @param f - context pointer will be written here * @param provider - provider to use * @param params - array of key parameters - * @param ff - context pointer will be written here + * @param pool - process pool * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ -static apr_status_t crypto_make(apr_pool_t *pool, const apr_crypto_driver_t *provider, - const apr_array_header_t *params, - apr_crypto_t **ff) +static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *provider, + const apr_array_header_t *params, apr_pool_t *pool) { apr_crypto_config_t *config = NULL; /* struct apr_crypto_param_t *ents = params ? (struct apr_crypto_param_t *)params->elts : NULL; */ @@ -282,8 +281,9 @@ static apr_status_t crypto_make(apr_pool_t *pool, const apr_crypto_driver_t *pro * operations. * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If * *key is not NULL, *key must point at a previously created structure. - * @param p The pool to use. - * @param f The context to use. + * @param key The key returned, see note. + * @param ivSize The size of the initialisation vector will be returned, based + * on whether an IV is relevant for this type of crypto. * @param pass The passphrase to use. * @param passLen The passphrase length in bytes * @param salt The salt to use. @@ -292,27 +292,19 @@ static apr_status_t crypto_make(apr_pool_t *pool, const apr_crypto_driver_t *pro * @param mode Electronic Code Book / Cipher Block Chaining. * @param doPad Pad if necessary. * @param iterations Iteration count - * @param key The key returned, see note. - * @param ivSize The size of the initialisation vector will be returned, based - * on whether an IV is relevant for this type of crypto. + * @param f The context to use. + * @param p The pool to use. * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend * error occurred while generating the key. APR_ENOCIPHER if the type or mode * is not supported by the particular backend. APR_EKEYTYPE if the key type is * not known. APR_EPADDING if padding was requested but is not supported. * APR_ENOTIMPL if not implemented. */ -static apr_status_t crypto_passphrase(apr_pool_t *p, - const apr_crypto_t *f, - const char *pass, - apr_size_t passLen, - const unsigned char * salt, - apr_size_t saltLen, - const apr_crypto_block_key_type_e type, - const apr_crypto_block_key_mode_e mode, - const int doPad, - const int iterations, - apr_crypto_key_t **k, - apr_size_t *ivSize) +static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, + const char *pass, apr_size_t passLen, const unsigned char * salt, + apr_size_t saltLen, const apr_crypto_block_key_type_e type, + const apr_crypto_block_key_mode_e mode, const int doPad, + const int iterations, const apr_crypto_t *f, apr_pool_t *p) { apr_status_t rv = APR_SUCCESS; PK11SlotInfo * slot; @@ -424,25 +416,22 @@ static apr_status_t crypto_passphrase(apr_pool_t *p, * @brief Initialise a context for encrypting arbitrary data using the given key. * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. - * @param p The pool to use. - * @param f The block context to use. - * @param key The key structure. + * @param ctx The block context returned, see note. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. * If the buffer pointed to is not NULL, the IV in the buffer will be * used. - * @param ctx The block context returned, see note. + * @param key The key structure. * @param blockSize The block size of the cipher. + * @param f The block context to use. + * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ -static apr_status_t crypto_block_encrypt_init(apr_pool_t *p, - const apr_crypto_t *f, - const apr_crypto_key_t *key, - const unsigned char **iv, - apr_crypto_block_t **ctx, - apr_size_t *blockSize) +static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, + const unsigned char **iv, const apr_crypto_key_t *key, + apr_size_t *blockSize, const apr_crypto_t *f, apr_pool_t *p) { PRErrorCode perr; SECItem * secParam; @@ -515,20 +504,18 @@ static apr_status_t crypto_block_encrypt_init(apr_pool_t *p, * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. - * @param block The block context to use. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ -static apr_status_t crypto_block_encrypt(apr_crypto_block_t *block, - unsigned char **out, - apr_size_t *outlen, - const unsigned char *in, - apr_size_t inlen) +static apr_status_t crypto_block_encrypt(unsigned char **out, + apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, + apr_crypto_block_t *ctx) { unsigned char *buffer; @@ -568,19 +555,18 @@ static apr_status_t crypto_block_encrypt(apr_crypto_block_t *block, * number of bytes returned as actually written by the * apr_crypto_block_encrypt() call. After this call, the context * is cleaned and can be reused by apr_crypto_block_encrypt_init(). - * @param block The block context to use. * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. */ -static apr_status_t crypto_block_encrypt_finish(apr_crypto_block_t *block, - unsigned char *out, - apr_size_t *outlen) +static apr_status_t crypto_block_encrypt_finish(unsigned char *out, + apr_size_t *outlen, apr_crypto_block_t *ctx) { apr_status_t rv = APR_SUCCESS; @@ -607,25 +593,21 @@ static apr_status_t crypto_block_encrypt_finish(apr_crypto_block_t *block, * @brief Initialise a context for decrypting arbitrary data using the given key. * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. - * @param p The pool to use. - * @param f The block context to use. - * @param key The key structure. - * @param iv Optional initialisation vector. If the buffer pointed to is NULL, - * an IV will be created at random, in space allocated from the pool. - * If the buffer pointed to is not NULL, the IV in the buffer will be - * used. * @param ctx The block context returned, see note. * @param blockSize The block size of the cipher. + * @param iv Optional initialisation vector. If the buffer pointed to is NULL, + * an IV will be created at random, in space allocated from the pool. + * If the buffer is not NULL, the IV in the buffer will be used. + * @param key The key structure. + * @param f The block context to use. + * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ -static apr_status_t crypto_block_decrypt_init(apr_pool_t *p, - const apr_crypto_t *f, - const apr_crypto_key_t *key, - const unsigned char *iv, - apr_crypto_block_t **ctx, - apr_size_t *blockSize) +static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, + apr_size_t *blockSize, const unsigned char *iv, + const apr_crypto_key_t *key, const apr_crypto_t *f, apr_pool_t *p) { PRErrorCode perr; SECItem * secParam; @@ -679,24 +661,22 @@ static apr_status_t crypto_block_decrypt_init(apr_pool_t *p, * @note The number of bytes written will be written to outlen. If * out is NULL, outlen will contain the maximum size of the * buffer needed to hold the data, including any data - * generated by apr_crypto_block_final below. If *out points + * generated by apr_crypto_block_decrypt_finish below. If *out points * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. - * @param block The block context to use. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ -static apr_status_t crypto_block_decrypt(apr_crypto_block_t *block, - unsigned char **out, - apr_size_t *outlen, - const unsigned char *in, - apr_size_t inlen) +static apr_status_t crypto_block_decrypt(unsigned char **out, + apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, + apr_crypto_block_t *block) { unsigned char *buffer; @@ -729,26 +709,25 @@ static apr_status_t crypto_block_decrypt(apr_crypto_block_t *block, } /** - * @brief Encrypt final data block, write it to out. + * @brief Decrypt final data block, write it to out. * @note If necessary the final block will be written out after being * padded. Typically the final block will be written to the - * same buffer used by apr_evp_crypt, offset by the number of - * bytes returned as actually written by the apr_evp_crypt() - * call. After this call, the context is cleaned and can be - * reused by apr_env_encrypt_init() or apr_env_decrypt_init(). - * @param block The block context to use. + * same buffer used by apr_crypto_block_decrypt, offset by the + * number of bytes returned as actually written by the + * apr_crypto_block_decrypt() call. After this call, the context + * is cleaned and can be reused by apr_crypto_block_decrypt_init(). * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. */ -static apr_status_t crypto_block_decrypt_finish(apr_crypto_block_t *block, - unsigned char *out, - apr_size_t *outlen) +static apr_status_t crypto_block_decrypt_finish(unsigned char *out, + apr_size_t *outlen, apr_crypto_block_t *block) { apr_status_t rv = APR_SUCCESS; diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index d0268d55f94..272fa4a4170 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -68,7 +68,7 @@ struct apr_crypto_block_t { /** * Fetch the most recent error from this driver. */ -static apr_status_t crypto_error(const apr_crypto_t *f, const apu_err_t **result) { +static apr_status_t crypto_error(const apu_err_t **result, const apr_crypto_t *f) { *result = f->result; return APR_SUCCESS; } @@ -155,15 +155,16 @@ static apr_status_t crypto_cleanup_helper(void *data) { * algorithms and other parameters will be set per context. More than * one context can be created at one time. A cleanup will be automatically * registered with the given pool to guarantee a graceful shutdown. - * @param pool - process pool + * @param f - context pointer will be written here * @param provider - provider to use * @param params - array of key parameters - * @param ff - context pointer will be written here + * @param pool - process pool * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ -static apr_status_t crypto_make(apr_pool_t *pool, const apr_crypto_driver_t *provider, - const apr_array_header_t *params, apr_crypto_t **ff) { +static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *provider, + const apr_array_header_t *params, apr_pool_t *pool) +{ apr_crypto_config_t *config = NULL; struct apr_crypto_param_t *ents = params ? (struct apr_crypto_param_t *) params->elts : NULL; @@ -217,8 +218,9 @@ static apr_status_t crypto_make(apr_pool_t *pool, const apr_crypto_driver_t *pro * operations. * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If * *key is not NULL, *key must point at a previously created structure. - * @param p The pool to use. - * @param f The context to use. + * @param key The key returned, see note. + * @param ivSize The size of the initialisation vector will be returned, based + * on whether an IV is relevant for this type of crypto. * @param pass The passphrase to use. * @param passLen The passphrase length in bytes * @param salt The salt to use. @@ -227,20 +229,20 @@ static apr_status_t crypto_make(apr_pool_t *pool, const apr_crypto_driver_t *pro * @param mode Electronic Code Book / Cipher Block Chaining. * @param doPad Pad if necessary. * @param iterations Iteration count - * @param key The key returned, see note. - * @param ivSize The size of the initialisation vector will be returned, based - * on whether an IV is relevant for this type of crypto. + * @param f The context to use. + * @param p The pool to use. * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend * error occurred while generating the key. APR_ENOCIPHER if the type or mode * is not supported by the particular backend. APR_EKEYTYPE if the key type is * not known. APR_EPADDING if padding was requested but is not supported. * APR_ENOTIMPL if not implemented. */ -static apr_status_t crypto_passphrase(apr_pool_t *p, const apr_crypto_t *f, +static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, const char *pass, apr_size_t passLen, const unsigned char * salt, apr_size_t saltLen, const apr_crypto_block_key_type_e type, const apr_crypto_block_key_mode_e mode, const int doPad, - const int iterations, apr_crypto_key_t **k, apr_size_t *ivSize) { + const int iterations, const apr_crypto_t *f, apr_pool_t *p) +{ apr_crypto_key_t *key = *k; if (!key) { @@ -331,20 +333,23 @@ static apr_status_t crypto_passphrase(apr_pool_t *p, const apr_crypto_t *f, * @brief Initialise a context for encrypting arbitrary data using the given key. * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. - * @param p The pool to use. - * @param f The block context to use. - * @param key The key - * @param iv Optional initialisation vector. * @param ctx The block context returned, see note. + * @param iv Optional initialisation vector. If the buffer pointed to is NULL, + * an IV will be created at random, in space allocated from the pool. + * If the buffer pointed to is not NULL, the IV in the buffer will be + * used. + * @param key The key structure. * @param blockSize The block size of the cipher. + * @param f The block context to use. + * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ -static apr_status_t crypto_block_encrypt_init(apr_pool_t *p, - const apr_crypto_t *f, const apr_crypto_key_t *key, - const unsigned char **iv, apr_crypto_block_t **ctx, - apr_size_t *blockSize) { +static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, + const unsigned char **iv, const apr_crypto_key_t *key, + apr_size_t *blockSize, const apr_crypto_t *f, apr_pool_t *p) +{ unsigned char *usedIv; apr_crypto_config_t *config = f->config; apr_crypto_block_t *block = *ctx; @@ -417,18 +422,19 @@ static apr_status_t crypto_block_encrypt_init(apr_pool_t *p, * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ -static apr_status_t crypto_block_encrypt(apr_crypto_block_t *ctx, - unsigned char **out, apr_size_t *outlen, const unsigned char *in, - apr_size_t inlen) { +static apr_status_t crypto_block_encrypt(unsigned char **out, + apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, + apr_crypto_block_t *ctx) +{ int outl = *outlen; unsigned char *buffer; @@ -469,18 +475,19 @@ static apr_status_t crypto_block_encrypt(apr_crypto_block_t *ctx, * number of bytes returned as actually written by the * apr_crypto_block_encrypt() call. After this call, the context * is cleaned and can be reused by apr_crypto_block_encrypt_init(). - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. */ -static apr_status_t crypto_block_encrypt_finish(apr_crypto_block_t *ctx, - unsigned char *out, apr_size_t *outlen) { +static apr_status_t crypto_block_encrypt_finish(unsigned char *out, + apr_size_t *outlen, apr_crypto_block_t *ctx) +{ int len = *outlen; if (EVP_EncryptFinal_ex(&ctx->cipherCtx, out, &len) == 0) { @@ -496,22 +503,22 @@ static apr_status_t crypto_block_encrypt_finish(apr_crypto_block_t *ctx, * @brief Initialise a context for decrypting arbitrary data using the given key. * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. - * @param p The pool to use. - * @param f The block context to use. - * @param key The key structure. + * @param ctx The block context returned, see note. + * @param blockSize The block size of the cipher. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. * If the buffer is not NULL, the IV in the buffer will be used. - * @param ctx The block context returned, see note. - * @param blockSize The block size of the cipher. + * @param key The key structure. + * @param f The block context to use. + * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ -static apr_status_t crypto_block_decrypt_init(apr_pool_t *p, - const apr_crypto_t *f, const apr_crypto_key_t *key, - const unsigned char *iv, apr_crypto_block_t **ctx, - apr_size_t *blockSize) { +static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, + apr_size_t *blockSize, const unsigned char *iv, + const apr_crypto_key_t *key, const apr_crypto_t *f, apr_pool_t *p) +{ apr_crypto_config_t *config = f->config; apr_crypto_block_t *block = *ctx; if (!block) { @@ -565,23 +572,23 @@ static apr_status_t crypto_block_decrypt_init(apr_pool_t *p, * @note The number of bytes written will be written to outlen. If * out is NULL, outlen will contain the maximum size of the * buffer needed to hold the data, including any data - * generated by apr_crypto_block_final below. If *out points + * generated by apr_crypto_block_decrypt_finish below. If *out points * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ -static apr_status_t crypto_block_decrypt(apr_crypto_block_t *ctx, - unsigned char **out, apr_size_t *outlen, const unsigned char *in, - apr_size_t inlen) { - +static apr_status_t crypto_block_decrypt(unsigned char **out, + apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, + apr_crypto_block_t *ctx) +{ int outl = *outlen; unsigned char *buffer; @@ -618,22 +625,23 @@ static apr_status_t crypto_block_decrypt(apr_crypto_block_t *ctx, * @brief Decrypt final data block, write it to out. * @note If necessary the final block will be written out after being * padded. Typically the final block will be written to the - * same buffer used by apr_evp_crypt, offset by the number of - * bytes returned as actually written by the apr_evp_crypt() - * call. After this call, the context is cleaned and can be - * reused by apr_env_encrypt_init() or apr_env_decrypt_init(). - * @param ctx The block context to use. + * same buffer used by apr_crypto_block_decrypt, offset by the + * number of bytes returned as actually written by the + * apr_crypto_block_decrypt() call. After this call, the context + * is cleaned and can be reused by apr_crypto_block_decrypt_init(). * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. */ -static apr_status_t crypto_block_decrypt_finish(apr_crypto_block_t *ctx, - unsigned char *out, apr_size_t *outlen) { +static apr_status_t crypto_block_decrypt_finish(unsigned char *out, + apr_size_t *outlen, apr_crypto_block_t *ctx) +{ int len = *outlen; diff --git a/include/apr_crypto.h b/include/apr_crypto.h index 38c2d8cfe54..f77d222731f 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -185,6 +185,7 @@ typedef struct apr_crypto_block_t apr_crypto_block_t; * @brief Perform once-only initialisation. Call once only. * * @param pool - pool to register any shutdown cleanups, etc + * @param params - array of initialisation parameters * @return APR_NOTIMPL in case of no crypto support. */ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool, @@ -193,17 +194,19 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool, /** * @brief Get the driver struct for a name * - * @param pool - (process) pool to register cleanup - * @param name - driver name * @param driver - pointer to driver struct. + * @param name - driver name + * @param params - array of initialisation parameters + * @param result - result and error message on failure + * @param pool - (process) pool to register cleanup * @return APR_SUCCESS for success * @return APR_ENOTIMPL for no driver (when DSO not enabled) * @return APR_EDSOOPEN if DSO driver file can't be opened * @return APR_ESYMNOTFOUND if the driver file doesn't contain a driver */ -APR_DECLARE(apr_status_t) apr_crypto_get_driver(apr_pool_t *pool, const char *name, - const apr_crypto_driver_t **driver, const apr_array_header_t *params, - const apu_err_t **result); +APR_DECLARE(apr_status_t) apr_crypto_get_driver(const apr_crypto_driver_t **driver, + const char *name, const apr_array_header_t *params, const apu_err_t **result, + apr_pool_t *pool); /** * @brief Return the name of the driver. @@ -216,27 +219,27 @@ APR_DECLARE(const char *) apr_crypto_driver_name(const apr_crypto_driver_t *driv /** * @brief Get the result of the last operation on a context. If the result * is NULL, the operation was successful. - * @param f - context pointer * @param result - the result structure + * @param f - context pointer * @return APR_SUCCESS for success */ -APR_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_t *f, - const apu_err_t **result); +APR_DECLARE(apr_status_t) apr_crypto_error(const apu_err_t **result, + const apr_crypto_t *f); /** * @brief Create a context for supporting encryption. Keys, certificates, * algorithms and other parameters will be set per context. More than * one context can be created at one time. A cleanup will be automatically * registered with the given pool to guarantee a graceful shutdown. + * @param f - context pointer will be written here * @param driver - driver to use - * @param pool - process pool * @param params - array of key parameters - * @param f - context pointer will be written here + * @param pool - process pool * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ -APR_DECLARE(apr_status_t) apr_crypto_make(const apr_crypto_driver_t *driver, - apr_pool_t *pool, const apr_array_header_t *params, apr_crypto_t **f); +APR_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, const apr_crypto_driver_t *driver, + const apr_array_header_t *params, apr_pool_t *pool); /** * @brief Create a key from the given passphrase. By default, the PBKDF2 @@ -247,9 +250,9 @@ APR_DECLARE(apr_status_t) apr_crypto_make(const apr_crypto_driver_t *driver, * operations. * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If * *key is not NULL, *key must point at a previously created structure. - * @param driver - driver to use - * @param p The pool to use. - * @param f The context to use. + * @param key The key returned, see note. + * @param ivSize The size of the initialisation vector will be returned, based + * on whether an IV is relevant for this type of crypto. * @param pass The passphrase to use. * @param passLen The passphrase length in bytes * @param salt The salt to use. @@ -257,43 +260,43 @@ APR_DECLARE(apr_status_t) apr_crypto_make(const apr_crypto_driver_t *driver, * @param type 3DES_192, AES_128, AES_192, AES_256. * @param mode Electronic Code Book / Cipher Block Chaining. * @param doPad Pad if necessary. - * @param key The key returned, see note. - * @param ivSize The size of the initialisation vector will be returned, based - * on whether an IV is relevant for this type of crypto. + * @param iterations Number of iterations to use in algorithm + * @param f The context to use. + * @param p The pool to use. * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend * error occurred while generating the key. APR_ENOCIPHER if the type or mode * is not supported by the particular backend. APR_EKEYTYPE if the key type is * not known. APR_EPADDING if padding was requested but is not supported. * APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_passphrase(apr_pool_t *p, const apr_crypto_t *f, - const char *pass, apr_size_t passLen, const unsigned char * salt, - apr_size_t saltLen, const apr_crypto_block_key_type_e type, +APR_DECLARE(apr_status_t) apr_crypto_passphrase(apr_crypto_key_t **key, + apr_size_t *ivSize, const char *pass, apr_size_t passLen, + const unsigned char * salt, apr_size_t saltLen, + const apr_crypto_block_key_type_e type, const apr_crypto_block_key_mode_e mode, const int doPad, - const int iterations, apr_crypto_key_t **key, apr_size_t *ivSize); + const int iterations, const apr_crypto_t *f, apr_pool_t *p); /** * @brief Initialise a context for encrypting arbitrary data using the given key. * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. - * @param driver - driver to use - * @param p The pool to use. - * @param f The block context to use. - * @param key The key structure to use. + * @param ctx The block context returned, see note. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. * If the buffer pointed to is not NULL, the IV in the buffer will be * used. - * @param ctx The block context returned, see note. + * @param key The key structure to use. * @param blockSize The block size of the cipher. + * @param f The block context to use. + * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init(apr_pool_t *p, - const apr_crypto_t *f, const apr_crypto_key_t *key, - const unsigned char **iv, apr_crypto_block_t **ctx, - apr_size_t *blockSize); +APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init( + apr_crypto_block_t **ctx, const unsigned char **iv, + const apr_crypto_key_t *key, apr_size_t *blockSize, + const apr_crypto_t *f, apr_pool_t *p); /** * @brief Encrypt data provided by in, write it to out. @@ -304,19 +307,19 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init(apr_pool_t *p, * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. - * @param driver - driver to use - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. + * @param f The block context to use. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_encrypt(const apr_crypto_t *f, - apr_crypto_block_t *ctx, unsigned char **out, apr_size_t *outlen, - const unsigned char *in, apr_size_t inlen); +APR_DECLARE(apr_status_t) apr_crypto_block_encrypt(unsigned char **out, + apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, + const apr_crypto_t *f, apr_crypto_block_t *ctx); /** * @brief Encrypt final data block, write it to out. @@ -326,39 +329,38 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt(const apr_crypto_t *f, * number of bytes returned as actually written by the * apr_crypto_block_encrypt() call. After this call, the context * is cleaned and can be reused by apr_crypto_block_encrypt_init(). - * @param driver - driver to use - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. + * @param f The block context to use. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(const apr_crypto_t *f, - apr_crypto_block_t *ctx, unsigned char *out, apr_size_t *outlen); +APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(unsigned char *out, + apr_size_t *outlen, const apr_crypto_t *f, apr_crypto_block_t *ctx); /** * @brief Initialise a context for decrypting arbitrary data using the given key. * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. - * @param driver - driver to use - * @param p The pool to use. - * @param f The block context to use. - * @param key The key structure to use. - * @param iv Optional initialisation vector. * @param ctx The block context returned, see note. * @param blockSize The block size of the cipher. + * @param iv Optional initialisation vector. + * @param key The key structure to use. + * @param f The block context to use. + * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init(apr_pool_t *p, - const apr_crypto_t *f, const apr_crypto_key_t *key, - const unsigned char *iv, apr_crypto_block_t **ctx, - apr_size_t *blockSize); +APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init( + apr_crypto_block_t **ctx, apr_size_t *blockSize, + const unsigned char *iv, const apr_crypto_key_t *key, + const apr_crypto_t *f, apr_pool_t *p); /** * @brief Decrypt data provided by in, write it to out. @@ -369,19 +371,19 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init(apr_pool_t *p, * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. - * @param driver - driver to use - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. + * @param f The block context to use. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_decrypt(const apr_crypto_t *f, - apr_crypto_block_t *ctx, unsigned char **out, apr_size_t *outlen, - const unsigned char *in, apr_size_t inlen); +APR_DECLARE(apr_status_t) apr_crypto_block_decrypt(unsigned char **out, + apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, + const apr_crypto_t *f, apr_crypto_block_t *ctx); /** * @brief Decrypt final data block, write it to out. @@ -391,25 +393,24 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt(const apr_crypto_t *f, * number of bytes returned as actually written by the * apr_crypto_block_decrypt() call. After this call, the context * is cleaned and can be reused by apr_crypto_block_decrypt_init(). - * @param driver - driver to use - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. + * @param f The block context to use. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. */ -APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish( - const apr_crypto_t *f, apr_crypto_block_t *ctx, - unsigned char *out, apr_size_t *outlen); +APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish(unsigned char *out, + apr_size_t *outlen, const apr_crypto_t *f, apr_crypto_block_t *ctx); /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. - * @param driver - driver to use + * @param f The block context to use. * @param ctx The block context to use. * @return Returns APR_ENOTIMPL if not supported. */ @@ -419,7 +420,6 @@ APR_DECLARE(apr_status_t) apr_crypto_block_cleanup( /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. - * @param driver - driver to use * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index ea67cb80e6f..501947d42ba 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -46,15 +46,15 @@ struct apr_crypto_driver_t { * algorithms and other parameters will be set per context. More than * one context can be created at one time. A cleanup will be automatically * registered with the given pool to guarantee a graceful shutdown. + * @param f - context pointer will be written here * @param provider - provider to use - * @param pool - process pool * @param params - array of key parameters - * @param f - context pointer will be written here + * @param pool - process pool * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ - apr_status_t (*make)(apr_pool_t *pool, const apr_crypto_driver_t *provider, - const apr_array_header_t *params, apr_crypto_t **f); + apr_status_t (*make)(apr_crypto_t **f, const apr_crypto_driver_t *provider, + const apr_array_header_t *params, apr_pool_t *pool); /** * @brief Create a key from the given passphrase. By default, the PBKDF2 @@ -65,8 +65,9 @@ struct apr_crypto_driver_t { * operations. * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If * *key is not NULL, *key must point at a previously created structure. - * @param p The pool to use. - * @param f The context to use. + * @param key The key returned, see note. + * @param ivSize The size of the initialisation vector will be returned, based + * on whether an IV is relevant for this type of crypto. * @param pass The passphrase to use. * @param passLen The passphrase length in bytes * @param salt The salt to use. @@ -75,41 +76,40 @@ struct apr_crypto_driver_t { * @param mode Electronic Code Book / Cipher Block Chaining. * @param doPad Pad if necessary. * @param iterations Iteration count - * @param key The key returned, see note. - * @param ivSize The size of the initialisation vector will be returned, based - * on whether an IV is relevant for this type of crypto. + * @param f The context to use. + * @param p The pool to use. * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend * error occurred while generating the key. APR_ENOCIPHER if the type or mode * is not supported by the particular backend. APR_EKEYTYPE if the key type is * not known. APR_EPADDING if padding was requested but is not supported. * APR_ENOTIMPL if not implemented. */ - apr_status_t (*passphrase)(apr_pool_t *p, const apr_crypto_t *f, + apr_status_t (*passphrase)(apr_crypto_key_t **key, apr_size_t *ivSize, const char *pass, apr_size_t passLen, const unsigned char * salt, apr_size_t saltLen, const apr_crypto_block_key_type_e type, const apr_crypto_block_key_mode_e mode, const int doPad, - const int iterations, apr_crypto_key_t **key, apr_size_t *ivSize); + const int iterations, const apr_crypto_t *f, apr_pool_t *p); /** * @brief Initialise a context for encrypting arbitrary data using the given key. * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. - * @param p The pool to use. - * @param f The block context to use. - * @param key The key structure. + * @param ctx The block context returned, see note. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. * If the buffer pointed to is not NULL, the IV in the buffer will be * used. - * @param ctx The block context returned, see note. + * @param key The key structure. * @param blockSize The block size of the cipher. + * @param f The block context to use. + * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ - apr_status_t (*block_encrypt_init)(apr_pool_t *p, const apr_crypto_t *f, - const apr_crypto_key_t *key, const unsigned char **iv, - apr_crypto_block_t **ctx, apr_size_t *blockSize); + apr_status_t (*block_encrypt_init)(apr_crypto_block_t **ctx, + const unsigned char **iv, const apr_crypto_key_t *key, + apr_size_t *blockSize, const apr_crypto_t *f, apr_pool_t *p); /** * @brief Encrypt data provided by in, write it to out. @@ -120,17 +120,17 @@ struct apr_crypto_driver_t { * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ - apr_status_t (*block_encrypt)(apr_crypto_block_t *ctx, unsigned char **out, - apr_size_t *outlen, const unsigned char *in, apr_size_t inlen); + apr_status_t (*block_encrypt)(unsigned char **out, apr_size_t *outlen, + const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *ctx); /** * @brief Encrypt final data block, write it to out. @@ -140,38 +140,38 @@ struct apr_crypto_driver_t { * number of bytes returned as actually written by the * apr_crypto_block_encrypt() call. After this call, the context * is cleaned and can be reused by apr_crypto_block_encrypt_init(). - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. */ - apr_status_t (*block_encrypt_finish)(apr_crypto_block_t *ctx, - unsigned char *out, apr_size_t *outlen); + apr_status_t (*block_encrypt_finish)(unsigned char *out, apr_size_t *outlen, + apr_crypto_block_t *ctx); /** * @brief Initialise a context for decrypting arbitrary data using the given key. * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. - * @param p The pool to use. - * @param f The block context to use. - * @param key The key structure. + * @param ctx The block context returned, see note. + * @param blockSize The block size of the cipher. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. * If the buffer is not NULL, the IV in the buffer will be used. - * @param ctx The block context returned, see note. - * @param blockSize The block size of the cipher. + * @param key The key structure. + * @param f The block context to use. + * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ - apr_status_t (*block_decrypt_init)(apr_pool_t *p, const apr_crypto_t *f, - const apr_crypto_key_t *key, const unsigned char *iv, - apr_crypto_block_t **ctx, apr_size_t *blockSize); + apr_status_t (*block_decrypt_init)(apr_crypto_block_t **ctx, + apr_size_t *blockSize, const unsigned char *iv, + const apr_crypto_key_t *key, const apr_crypto_t *f, apr_pool_t *p); /** * @brief Decrypt data provided by in, write it to out. @@ -182,17 +182,17 @@ struct apr_crypto_driver_t { * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ - apr_status_t (*block_decrypt)(apr_crypto_block_t *ctx, unsigned char **out, - apr_size_t *outlen, const unsigned char *in, apr_size_t inlen); + apr_status_t (*block_decrypt)(unsigned char **out, apr_size_t *outlen, + const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *ctx); /** * @brief Decrypt final data block, write it to out. @@ -202,18 +202,18 @@ struct apr_crypto_driver_t { * number of bytes returned as actually written by the * apr_crypto_block_decrypt() call. After this call, the context * is cleaned and can be reused by apr_crypto_block_decrypt_init(). - * @param ctx The block context to use. * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. + * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. */ - apr_status_t (*block_decrypt_finish)(apr_crypto_block_t *ctx, - unsigned char *out, apr_size_t *outlen); + apr_status_t (*block_decrypt_finish)(unsigned char *out, + apr_size_t *outlen, apr_crypto_block_t *ctx); /** * @brief Clean encryption / decryption context. @@ -241,11 +241,11 @@ struct apr_crypto_driver_t { /** * @brief: fetch the most recent error from this driver. - * @param f - context pointer * @param result - the result structure + * @param f - context pointer * @return APR_SUCCESS for success. */ - apr_status_t (*error)(const apr_crypto_t *f, const apu_err_t **result); + apr_status_t (*error)(const apu_err_t **result, const apr_crypto_t *f); }; diff --git a/test/testcrypto.c b/test/testcrypto.c index 1e5220d068d..41e1b29215e 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -38,7 +38,7 @@ static const apr_crypto_driver_t *get_driver(abts_case *tc, apr_pool_t *pool, rv = apr_crypto_init(pool, params); ABTS_ASSERT(tc, "failed to init apr_crypto", rv == APR_SUCCESS); - rv = apr_crypto_get_driver(pool, name, &driver, params, &err); + rv = apr_crypto_get_driver(&driver, name, params, &err, pool); if (APR_SUCCESS != rv && err) { ABTS_NOT_IMPL(tc, err->msg); return NULL; @@ -89,7 +89,7 @@ static apr_crypto_t *make(abts_case *tc, apr_pool_t *pool, } /* get the context */ - apr_crypto_make(driver, pool, NULL, &f); + apr_crypto_make(&f, driver, NULL, pool); ABTS_ASSERT(tc, "apr_crypto_make returned NULL", f != NULL); return f; @@ -112,11 +112,11 @@ static const apr_crypto_key_t *passphrase(abts_case *tc, apr_pool_t *pool, } /* init the passphrase */ - rv = apr_crypto_passphrase(pool, f, pass, strlen(pass), - (unsigned char *) salt, strlen(salt), type, mode, doPad, 4096, - &key, NULL); + rv = apr_crypto_passphrase(&key, NULL, pass, strlen(pass), + (unsigned char *) salt, strlen(salt), type, mode, doPad, 4096, f, + pool); if (APR_ENOCIPHER == rv) { - apr_crypto_error(f, &result); + apr_crypto_error(&result, f); ABTS_NOT_IMPL(tc, apr_psprintf(pool, "skipped: %s %s passphrase return APR_ENOCIPHER: error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, @@ -124,7 +124,7 @@ static const apr_crypto_key_t *passphrase(abts_case *tc, apr_pool_t *pool, return NULL; } else { if (APR_SUCCESS != rv) { - apr_crypto_error(f, &result); + apr_crypto_error(&result, f); fprintf(stderr, "passphrase: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", @@ -160,13 +160,12 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, } /* init the encryption */ - rv = apr_crypto_block_encrypt_init(pool, f, key, iv, &block, - blockSize); + rv = apr_crypto_block_encrypt_init(&block, iv, key, blockSize, f, pool); if (APR_ENOTIMPL == rv) { ABTS_NOT_IMPL(tc, "apr_crypto_block_encrypt_init returned APR_ENOTIMPL"); } else { if (APR_SUCCESS != rv) { - apr_crypto_error(f, &result); + apr_crypto_error(&result, f); fprintf(stderr, "encrypt_init: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", @@ -184,10 +183,10 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, } /* encrypt the block */ - rv = apr_crypto_block_encrypt(f, block, cipherText, - cipherTextLen, in, inlen); + rv = apr_crypto_block_encrypt(cipherText, cipherTextLen, in, inlen, f, + block); if (APR_SUCCESS != rv) { - apr_crypto_error(f, &result); + apr_crypto_error(&result, f); fprintf(stderr, "encrypt: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", @@ -201,10 +200,10 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, } /* finalise the encryption */ - rv = apr_crypto_block_encrypt_finish(f, block, *cipherText - + *cipherTextLen, &len); + rv = apr_crypto_block_encrypt_finish(*cipherText + *cipherTextLen, &len, f, + block); if (APR_SUCCESS != rv) { - apr_crypto_error(f, &result); + apr_crypto_error(&result, f); fprintf(stderr, "encrypt_finish: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", @@ -240,13 +239,12 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, } /* init the decryption */ - rv = apr_crypto_block_decrypt_init(pool, f, key, iv, &block, - blockSize); + rv = apr_crypto_block_decrypt_init(&block, blockSize, iv, key, f, pool); if (APR_ENOTIMPL == rv) { ABTS_NOT_IMPL(tc, "apr_crypto_block_decrypt_init returned APR_ENOTIMPL"); } else { if (APR_SUCCESS != rv) { - apr_crypto_error(f, &result); + apr_crypto_error(&result, f); fprintf(stderr, "decrypt_init: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", @@ -264,10 +262,10 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, } /* decrypt the block */ - rv = apr_crypto_block_decrypt(f, block, plainText, plainTextLen, - cipherText, cipherTextLen); + rv = apr_crypto_block_decrypt(plainText, plainTextLen, + cipherText, cipherTextLen, f, block); if (APR_SUCCESS != rv) { - apr_crypto_error(f, &result); + apr_crypto_error(&result, f); fprintf(stderr, "decrypt: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", @@ -281,10 +279,10 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, } /* finalise the decryption */ - rv = apr_crypto_block_decrypt_finish(f, block, *plainText - + *plainTextLen, &len); + rv = apr_crypto_block_decrypt_finish(*plainText + *plainTextLen, &len, f, + block); if (APR_SUCCESS != rv) { - apr_crypto_error(f, &result); + apr_crypto_error(&result, f); fprintf(stderr, "decrypt_finish: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", From a5ac125f467f7b555d4a998896cf11bdedaa1500 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sun, 15 May 2011 10:26:47 +0000 Subject: [PATCH 7020/7878] Add some nonnull and pure attributes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1103310 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 27 +++++--- include/apr_base64.h | 21 ++++--- include/apr_buckets.h | 132 +++++++++++++++++++++++++++------------- include/apr_pools.h | 105 ++++++++++++++++++-------------- 4 files changed, 181 insertions(+), 104 deletions(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 5aaeb1b2faf..5d6677645db 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -71,7 +71,8 @@ struct apr_memnode_t { * @param allocator The allocator we have just created. * */ -APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator); +APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator) + __attribute__((nonnull(1))); /** * Destroy an allocator @@ -79,7 +80,8 @@ APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator); * @remark Any memnodes not given back to the allocator prior to destroying * will _not_ be free()d. */ -APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator); +APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) + __attribute__((nonnull(1))); /** * Allocate a block of mem from the allocator @@ -88,7 +90,8 @@ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator); * memnode structure) */ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, - apr_size_t size); + apr_size_t size) + __attribute__((nonnull(1))); /** * Free a list of blocks of mem, giving them back to the allocator. @@ -98,7 +101,8 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, * @param memnode The memory node to return */ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, - apr_memnode_t *memnode); + apr_memnode_t *memnode) + __attribute__((nonnull(1,2))); #include "apr_pools.h" @@ -114,13 +118,15 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, * the allocator will never be destroyed. */ APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator, - apr_pool_t *pool); + apr_pool_t *pool) + __attribute__((nonnull(1))); /** * Get the current owner of the allocator * @param allocator The allocator to get the owner from */ -APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator); +APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator) + __attribute__((nonnull(1))); /** * Set the current threshold at which the allocator should start @@ -129,7 +135,8 @@ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator); * @param size The threshold. 0 == unlimited. */ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, - apr_size_t size); + apr_size_t size) + __attribute__((nonnull(1))); #include "apr_thread_mutex.h" @@ -140,14 +147,16 @@ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, * @param mutex The mutex */ APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator, - apr_thread_mutex_t *mutex); + apr_thread_mutex_t *mutex) + __attribute__((nonnull(1))); /** * Get the mutex currently set for the allocator * @param allocator The allocator */ APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get( - apr_allocator_t *allocator); + apr_allocator_t *allocator) + __attribute__((nonnull(1))); #endif /* APR_HAS_THREADS */ diff --git a/include/apr_base64.h b/include/apr_base64.h index 6ba5d94f17a..b3c4fec1d35 100644 --- a/include/apr_base64.h +++ b/include/apr_base64.h @@ -57,7 +57,7 @@ extern "C" { * @return the length of the string after it is encrypted, including the * trailing \0 */ -APR_DECLARE(int) apr_base64_encode_len(int len); +APR_DECLARE(int) apr_base64_encode_len(int len) __attribute__((pure)); /** * Encode a text string using base64encoding. On EBCDIC machines, the input @@ -69,7 +69,8 @@ APR_DECLARE(int) apr_base64_encode_len(int len); * @return the length of the encoded string, including the trailing \0 */ APR_DECLARE(int) apr_base64_encode(char * coded_dst, const char *plain_src, - int len_plain_src); + int len_plain_src) + __attribute__((nonnull(1,2))); /** * Encode an text string using base64encoding. This is the same as @@ -81,9 +82,10 @@ APR_DECLARE(int) apr_base64_encode(char * coded_dst, const char *plain_src, * @param len_plain_src The length of the plain text string * @return the length of the encoded string, including the trailing \0 */ -APR_DECLARE(int) apr_base64_encode_binary(char * coded_dst, - const unsigned char *plain_src, - int len_plain_src); +APR_DECLARE(int) apr_base64_encode_binary(char * coded_dst, + const unsigned char *plain_src, + int len_plain_src) + __attribute__((nonnull(1,2))); /** * Determine the maximum buffer length required to decode the plain text @@ -91,7 +93,8 @@ APR_DECLARE(int) apr_base64_encode_binary(char * coded_dst, * @param coded_src The encoded string * @return the maximum required buffer length for the plain text string */ -APR_DECLARE(int) apr_base64_decode_len(const char * coded_src); +APR_DECLARE(int) apr_base64_decode_len(const char * coded_src) + __attribute__((nonnull(1))) __attribute__((pure)); /** * Decode a string to plain text. On EBCDIC machines, the result is then @@ -101,7 +104,8 @@ APR_DECLARE(int) apr_base64_decode_len(const char * coded_src); * @param coded_src The encoded string * @return the length of the plain text string (excluding the trailing \0) */ -APR_DECLARE(int) apr_base64_decode(char * plain_dst, const char *coded_src); +APR_DECLARE(int) apr_base64_decode(char * plain_dst, const char *coded_src) + __attribute__((nonnull(1,2))); /** * Decode an string to plain text. This is the same as apr_base64_decode() @@ -113,7 +117,8 @@ APR_DECLARE(int) apr_base64_decode(char * plain_dst, const char *coded_src); * @return the length of the plain text string */ APR_DECLARE(int) apr_base64_decode_binary(unsigned char * plain_dst, - const char *coded_src); + const char *coded_src) + __attribute__((nonnull(1,2))); /** @} */ #ifdef __cplusplus diff --git a/include/apr_buckets.h b/include/apr_buckets.h index d3ef9bc2336..c367755f2f7 100644 --- a/include/apr_buckets.h +++ b/include/apr_buckets.h @@ -659,14 +659,16 @@ union apr_bucket_structs { * @return The empty bucket brigade */ APR_DECLARE(apr_bucket_brigade *) apr_brigade_create(apr_pool_t *p, - apr_bucket_alloc_t *list); + apr_bucket_alloc_t *list) + __attribute__((nonnull(1,2))); /** * Destroy an entire bucket brigade. This includes destroying all of the * buckets within the bucket brigade's bucket list. * @param b The bucket brigade to destroy */ -APR_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b); +APR_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b) + __attribute__((nonnull(1))); /** * Empty out an entire bucket brigade. This includes destroying all of the @@ -679,7 +681,8 @@ APR_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b); * you wish to reuse many times by destroying all of the buckets in * the brigade and putting new buckets into it later. */ -APR_DECLARE(apr_status_t) apr_brigade_cleanup(void *data); +APR_DECLARE(apr_status_t) apr_brigade_cleanup(void *data) + __attribute__((nonnull(1))); /** * Move the buckets from the tail end of the existing brigade @a b into @@ -697,7 +700,8 @@ APR_DECLARE(apr_status_t) apr_brigade_cleanup(void *data); */ APR_DECLARE(apr_bucket_brigade *) apr_brigade_split_ex(apr_bucket_brigade *b, apr_bucket *e, - apr_bucket_brigade *a); + apr_bucket_brigade *a) + __attribute__((nonnull(1,2))); /** * Create a new bucket brigade and move the buckets from the tail end @@ -711,7 +715,8 @@ APR_DECLARE(apr_bucket_brigade *) apr_brigade_split_ex(apr_bucket_brigade *b, * so memory consumption should be carefully considered. */ APR_DECLARE(apr_bucket_brigade *) apr_brigade_split(apr_bucket_brigade *b, - apr_bucket *e); + apr_bucket *e) + __attribute__((nonnull(1,2))); /** * Partition a bucket brigade at a given offset (in bytes from the start of @@ -727,7 +732,8 @@ APR_DECLARE(apr_bucket_brigade *) apr_brigade_split(apr_bucket_brigade *b, */ APR_DECLARE(apr_status_t) apr_brigade_partition(apr_bucket_brigade *b, apr_off_t point, - apr_bucket **after_point); + apr_bucket **after_point) + __attribute__((nonnull(1,3))); /** * Return the total length of the brigade. @@ -739,7 +745,8 @@ APR_DECLARE(apr_status_t) apr_brigade_partition(apr_bucket_brigade *b, */ APR_DECLARE(apr_status_t) apr_brigade_length(apr_bucket_brigade *bb, int read_all, - apr_off_t *length); + apr_off_t *length) + __attribute__((nonnull(1,3))); /** * Take a bucket brigade and store the data in a flat char* @@ -750,7 +757,8 @@ APR_DECLARE(apr_status_t) apr_brigade_length(apr_bucket_brigade *bb, */ APR_DECLARE(apr_status_t) apr_brigade_flatten(apr_bucket_brigade *bb, char *c, - apr_size_t *len); + apr_size_t *len) + __attribute__((nonnull(1,2,3))); /** * Creates a pool-allocated string representing a flat bucket brigade @@ -762,7 +770,8 @@ APR_DECLARE(apr_status_t) apr_brigade_flatten(apr_bucket_brigade *bb, APR_DECLARE(apr_status_t) apr_brigade_pflatten(apr_bucket_brigade *bb, char **c, apr_size_t *len, - apr_pool_t *pool); + apr_pool_t *pool) + __attribute__((nonnull(1,2,3,4))); /** * Split a brigade to represent one LF line. @@ -775,7 +784,8 @@ APR_DECLARE(apr_status_t) apr_brigade_pflatten(apr_bucket_brigade *bb, APR_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut, apr_bucket_brigade *bbIn, apr_read_type_e block, - apr_off_t maxbytes); + apr_off_t maxbytes) + __attribute__((nonnull(1,2))); /** * Create an iovec of the elements in a bucket_brigade... return number @@ -787,7 +797,8 @@ APR_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut, * number of iovec elements actually filled out. */ APR_DECLARE(apr_status_t) apr_brigade_to_iovec(apr_bucket_brigade *b, - struct iovec *vec, int *nvec); + struct iovec *vec, int *nvec) + __attribute__((nonnull(1,2,3))); /** * This function writes a list of strings into a bucket brigade. @@ -800,7 +811,8 @@ APR_DECLARE(apr_status_t) apr_brigade_to_iovec(apr_bucket_brigade *b, APR_DECLARE(apr_status_t) apr_brigade_vputstrs(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, - va_list va); + va_list va) + __attribute__((nonnull(1))); /** * This function writes a string into a bucket brigade. @@ -827,7 +839,8 @@ APR_DECLARE(apr_status_t) apr_brigade_vputstrs(apr_bucket_brigade *b, */ APR_DECLARE(apr_status_t) apr_brigade_write(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, - const char *str, apr_size_t nbyte); + const char *str, apr_size_t nbyte) + __attribute__((nonnull(1,4))); /** * This function writes multiple strings into a bucket brigade. @@ -842,7 +855,8 @@ APR_DECLARE(apr_status_t) apr_brigade_writev(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const struct iovec *vec, - apr_size_t nvec); + apr_size_t nvec) + __attribute__((nonnull(1,4))); /** * This function writes a string into a bucket brigade. @@ -854,7 +868,8 @@ APR_DECLARE(apr_status_t) apr_brigade_writev(apr_bucket_brigade *b, */ APR_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb, apr_brigade_flush flush, void *ctx, - const char *str); + const char *str) + __attribute__((nonnull(1,4))); /** * This function writes a character into a bucket brigade. @@ -866,7 +881,8 @@ APR_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb, */ APR_DECLARE(apr_status_t) apr_brigade_putc(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, - const char c); + const char c) + __attribute__((nonnull(1))); /** * This function writes an unspecified number of strings into a bucket brigade. @@ -882,6 +898,7 @@ APR_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b, #if defined(__GNUC__) && __GNUC__ >= 4 __attribute__((sentinel)) #endif + __attribute__((nonnull(1))) ; /** @@ -898,7 +915,8 @@ APR_DECLARE_NONSTD(apr_status_t) apr_brigade_printf(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const char *fmt, ...) - __attribute__((format(printf,4,5))); + __attribute__((format(printf,4,5))) + __attribute__((nonnull(1))); /** * Evaluate a printf and put the resulting string at the end @@ -913,7 +931,8 @@ APR_DECLARE_NONSTD(apr_status_t) apr_brigade_printf(apr_bucket_brigade *b, APR_DECLARE(apr_status_t) apr_brigade_vprintf(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, - const char *fmt, va_list va); + const char *fmt, va_list va) + __attribute__((nonnull(1,4))); /** * Utility function to insert a file (or a segment of a file) onto the @@ -931,7 +950,8 @@ APR_DECLARE(apr_bucket *) apr_brigade_insert_file(apr_bucket_brigade *bb, apr_file_t *f, apr_off_t start, apr_off_t len, - apr_pool_t *p); + apr_pool_t *p) + __attribute__((nonnull(1,2,5))); @@ -959,26 +979,32 @@ APR_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create(apr_pool_t *p); * apr_allocator_t -- no automatic cleanups will happen. * @warning The allocator must never be used by more than one thread at a time. */ -APR_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create_ex(apr_allocator_t *allocator); +APR_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create_ex( + apr_allocator_t *allocator) + __attribute__((nonnull(1))); /** * Destroy a bucket allocator. * @param list The allocator to be destroyed */ -APR_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list); +APR_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list) + __attribute__((nonnull(1))); /** * Allocate memory for use by the buckets. * @param size The amount to allocate. * @param list The allocator from which to allocate the memory. */ -APR_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size, apr_bucket_alloc_t *list); +APR_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size, + apr_bucket_alloc_t *list) + __attribute__((nonnull(2))); /** * Free memory previously allocated with apr_bucket_alloc(). * @param block The block of memory to be freed. */ -APR_DECLARE_NONSTD(void) apr_bucket_free(void *block); +APR_DECLARE_NONSTD(void) apr_bucket_free(void *block) + __attribute__((nonnull(1))); /* ***** Bucket Functions ***** */ @@ -1339,7 +1365,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_eos_create(apr_bucket_alloc_t *list); * @param b The bucket to make into an EOS bucket * @return The new bucket, or NULL if allocation failed */ -APR_DECLARE(apr_bucket *) apr_bucket_eos_make(apr_bucket *b); +APR_DECLARE(apr_bucket *) apr_bucket_eos_make(apr_bucket *b) + __attribute__((nonnull(1))); /** * Create a flush bucket. This indicates that filters should flush their @@ -1348,7 +1375,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_eos_make(apr_bucket *b); * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ -APR_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_bucket_alloc_t *list); +APR_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_bucket_alloc_t *list) + __attribute__((nonnull(1))); /** * Make the bucket passed in a FLUSH bucket. This indicates that filters @@ -1357,7 +1385,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_bucket_alloc_t *list); * @param b The bucket to make into a FLUSH bucket * @return The new bucket, or NULL if allocation failed */ -APR_DECLARE(apr_bucket *) apr_bucket_flush_make(apr_bucket *b); +APR_DECLARE(apr_bucket *) apr_bucket_flush_make(apr_bucket *b) + __attribute__((nonnull(1))); /** * Create a bucket referring to long-lived data. @@ -1368,7 +1397,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_flush_make(apr_bucket *b); */ APR_DECLARE(apr_bucket *) apr_bucket_immortal_create(const char *buf, apr_size_t nbyte, - apr_bucket_alloc_t *list); + apr_bucket_alloc_t *list) + __attribute__((nonnull(1,3))); /** * Make the bucket passed in a bucket refer to long-lived data @@ -1379,7 +1409,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_immortal_create(const char *buf, */ APR_DECLARE(apr_bucket *) apr_bucket_immortal_make(apr_bucket *b, const char *buf, - apr_size_t nbyte); + apr_size_t nbyte) + __attribute__((nonnull(1,2))); /** * Create a bucket referring to data on the stack. @@ -1390,7 +1421,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_immortal_make(apr_bucket *b, */ APR_DECLARE(apr_bucket *) apr_bucket_transient_create(const char *buf, apr_size_t nbyte, - apr_bucket_alloc_t *list); + apr_bucket_alloc_t *list) + __attribute__((nonnull(1,3))); /** * Make the bucket passed in a bucket refer to stack data @@ -1401,7 +1433,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_transient_create(const char *buf, */ APR_DECLARE(apr_bucket *) apr_bucket_transient_make(apr_bucket *b, const char *buf, - apr_size_t nbyte); + apr_size_t nbyte) + __attribute__((nonnull(1,2))); /** * Create a bucket referring to memory on the heap. If the caller asks @@ -1420,7 +1453,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_transient_make(apr_bucket *b, APR_DECLARE(apr_bucket *) apr_bucket_heap_create(const char *buf, apr_size_t nbyte, void (*free_func)(void *data), - apr_bucket_alloc_t *list); + apr_bucket_alloc_t *list) + __attribute__((nonnull(1,4))); /** * Make the bucket passed in a bucket refer to heap data * @param b The bucket to make into a HEAP bucket @@ -1432,7 +1466,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_heap_create(const char *buf, */ APR_DECLARE(apr_bucket *) apr_bucket_heap_make(apr_bucket *b, const char *buf, apr_size_t nbyte, - void (*free_func)(void *data)); + void (*free_func)(void *data)) + __attribute__((nonnull(1,2))); /** * Create a bucket referring to memory allocated from a pool. @@ -1446,7 +1481,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_heap_make(apr_bucket *b, const char *buf, APR_DECLARE(apr_bucket *) apr_bucket_pool_create(const char *buf, apr_size_t length, apr_pool_t *pool, - apr_bucket_alloc_t *list); + apr_bucket_alloc_t *list) + __attribute__((nonnull(1,3,4))); /** * Make the bucket passed in a bucket refer to pool data @@ -1458,7 +1494,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_pool_create(const char *buf, */ APR_DECLARE(apr_bucket *) apr_bucket_pool_make(apr_bucket *b, const char *buf, apr_size_t length, - apr_pool_t *pool); + apr_pool_t *pool) + __attribute__((nonnull(1,2,4))); #if APR_HAS_MMAP /** @@ -1473,7 +1510,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_pool_make(apr_bucket *b, const char *buf, APR_DECLARE(apr_bucket *) apr_bucket_mmap_create(apr_mmap_t *mm, apr_off_t start, apr_size_t length, - apr_bucket_alloc_t *list); + apr_bucket_alloc_t *list) + __attribute__((nonnull(1,4))); /** * Make the bucket passed in a bucket refer to an MMAP'ed file @@ -1486,7 +1524,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_mmap_create(apr_mmap_t *mm, */ APR_DECLARE(apr_bucket *) apr_bucket_mmap_make(apr_bucket *b, apr_mmap_t *mm, apr_off_t start, - apr_size_t length); + apr_size_t length) + __attribute__((nonnull(1,2))); #endif /** @@ -1496,7 +1535,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_mmap_make(apr_bucket *b, apr_mmap_t *mm, * @return The new bucket, or NULL if allocation failed */ APR_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *thissock, - apr_bucket_alloc_t *list); + apr_bucket_alloc_t *list) + __attribute__((nonnull(1,2))); /** * Make the bucket passed in a bucket refer to a socket * @param b The bucket to make into a SOCKET bucket @@ -1504,7 +1544,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *thissock, * @return The new bucket, or NULL if allocation failed */ APR_DECLARE(apr_bucket *) apr_bucket_socket_make(apr_bucket *b, - apr_socket_t *thissock); + apr_socket_t *thissock) + __attribute__((nonnull(1,2))); /** * Create a bucket referring to a pipe. @@ -1513,7 +1554,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_socket_make(apr_bucket *b, * @return The new bucket, or NULL if allocation failed */ APR_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *thispipe, - apr_bucket_alloc_t *list); + apr_bucket_alloc_t *list) + __attribute__((nonnull(1,2))); /** * Make the bucket passed in a bucket refer to a pipe @@ -1522,7 +1564,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *thispipe, * @return The new bucket, or NULL if allocation failed */ APR_DECLARE(apr_bucket *) apr_bucket_pipe_make(apr_bucket *b, - apr_file_t *thispipe); + apr_file_t *thispipe) + __attribute__((nonnull(1,2))); /** * Create a bucket referring to a file. @@ -1544,7 +1587,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_file_create(apr_file_t *fd, apr_off_t offset, apr_size_t len, apr_pool_t *p, - apr_bucket_alloc_t *list); + apr_bucket_alloc_t *list) + __attribute__((nonnull(1,4,5))); /** * Make the bucket passed in a bucket refer to a file @@ -1558,7 +1602,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_file_create(apr_file_t *fd, */ APR_DECLARE(apr_bucket *) apr_bucket_file_make(apr_bucket *b, apr_file_t *fd, apr_off_t offset, - apr_size_t len, apr_pool_t *p); + apr_size_t len, apr_pool_t *p) + __attribute__((nonnull(1,2,5))); /** * Enable or disable memory-mapping for a FILE bucket (default is enabled) @@ -1567,7 +1612,8 @@ APR_DECLARE(apr_bucket *) apr_bucket_file_make(apr_bucket *b, apr_file_t *fd, * @return APR_SUCCESS normally, or an error code if the operation fails */ APR_DECLARE(apr_status_t) apr_bucket_file_enable_mmap(apr_bucket *b, - int enabled); + int enabled) + __attribute__((nonnull(1))); /** @} */ #ifdef __cplusplus diff --git a/include/apr_pools.h b/include/apr_pools.h index ae189e22965..7d3a548099a 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -196,7 +196,8 @@ APR_DECLARE(void) apr_pool_terminate(void); APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, - apr_allocator_t *allocator); + apr_allocator_t *allocator) + __attribute__((nonnull(1))); /** * Create a new unmanaged pool. @@ -216,7 +217,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, */ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, - apr_allocator_t *allocator); + apr_allocator_t *allocator) + __attribute__((nonnull(1))); /** * Debug version of apr_pool_create_ex. @@ -238,7 +240,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, - const char *file_line); + const char *file_line) + __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pool_create_ex(newpool, parent, abort_fn, allocator) \ @@ -264,7 +267,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, - const char *file_line); + const char *file_line) + __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator) \ @@ -320,7 +324,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool); * Find the pool's allocator * @param pool The pool to get the allocator from. */ -APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool); +APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool) + __attribute__((nonnull(1))); /** * Clear all memory in the pool and run all the cleanups. This also destroys all @@ -330,7 +335,7 @@ APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool); * to re-use this memory for the next allocation. * @see apr_pool_destroy() */ -APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); +APR_DECLARE(void) apr_pool_clear(apr_pool_t *p) __attribute__((nonnull(1))); /** * Debug version of apr_pool_clear. @@ -346,7 +351,8 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); * and don't call apr_pool_destroy_clear directly. */ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p, - const char *file_line); + const char *file_line) + __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pool_clear(p) \ @@ -359,7 +365,7 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p, * @param p The pool to destroy * @remark This will actually free the memory */ -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p) __attribute__((nonnull(1))); /** * Debug version of apr_pool_destroy. @@ -375,7 +381,8 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); * and don't call apr_pool_destroy_debug directly. */ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, - const char *file_line); + const char *file_line) + __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pool_destroy(p) \ @@ -393,7 +400,8 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, * @param size The amount of memory to allocate * @return The allocated memory */ -APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size); +APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size) + __attribute__((nonnull(1))); /** * Debug version of apr_palloc @@ -404,7 +412,8 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size); * @return See: apr_palloc */ APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size, - const char *file_line); + const char *file_line) + __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_palloc(p, size) \ @@ -432,7 +441,8 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); * @return See: apr_pcalloc */ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size, - const char *file_line); + const char *file_line) + __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pcalloc(p, size) \ @@ -453,21 +463,24 @@ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size, * deal with the error accordingly. */ APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc_t abortfunc, - apr_pool_t *pool); + apr_pool_t *pool) + __attribute__((nonnull(2))); /** * Get the abort function associated with the specified pool. * @param pool The pool for retrieving the abort function. * @return The abort function for the given pool. */ -APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool); +APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool) + __attribute__((nonnull(1))); /** * Get the parent pool of the specified pool. * @param pool The pool for retrieving the parent pool. * @return The parent of the given pool. */ -APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool); +APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool) + __attribute__((nonnull(1))); /** * Determine if pool a is an ancestor of pool b. @@ -487,7 +500,8 @@ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); * @param pool The pool to tag * @param tag The tag */ -APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag); +APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag) + __attribute__((nonnull(1))); /* @@ -513,11 +527,11 @@ APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag); * key names is a typical way to help ensure this uniqueness. * */ -APR_DECLARE(apr_status_t) apr_pool_userdata_set( - const void *data, - const char *key, - apr_status_t (*cleanup)(void *), - apr_pool_t *pool); +APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, + const char *key, + apr_status_t (*cleanup)(void *), + apr_pool_t *pool) + __attribute__((nonnull(2,4))); /** * Set the data associated with the current pool @@ -539,10 +553,10 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set( * */ APR_DECLARE(apr_status_t) apr_pool_userdata_setn( - const void *data, - const char *key, - apr_status_t (*cleanup)(void *), - apr_pool_t *pool); + const void *data, const char *key, + apr_status_t (*cleanup)(void *), + apr_pool_t *pool) + __attribute__((nonnull(2,4))); /** * Return the data associated with the current pool. @@ -551,7 +565,8 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_setn( * @param pool The current pool. */ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, - apr_pool_t *pool); + apr_pool_t *pool) + __attribute__((nonnull(1,2,3))); /** @@ -578,10 +593,10 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, * to exec - this function is called in the child, obviously! */ APR_DECLARE(void) apr_pool_cleanup_register( - apr_pool_t *p, - const void *data, - apr_status_t (*plain_cleanup)(void *), - apr_status_t (*child_cleanup)(void *)); + apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup)(void *), + apr_status_t (*child_cleanup)(void *)) + __attribute__((nonnull(3,4))); /** * Register a function to be called when a pool is cleared or destroyed. @@ -596,9 +611,9 @@ APR_DECLARE(void) apr_pool_cleanup_register( * or destroyed */ APR_DECLARE(void) apr_pool_pre_cleanup_register( - apr_pool_t *p, - const void *data, - apr_status_t (*plain_cleanup)(void *)); + apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup)(void *)) + __attribute__((nonnull(3))); /** * Remove a previously registered cleanup function. @@ -613,7 +628,8 @@ APR_DECLARE(void) apr_pool_pre_cleanup_register( * function */ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup)(void *)); + apr_status_t (*cleanup)(void *)) + __attribute__((nonnull(3))); /** * Replace the child cleanup function of a previously registered cleanup. @@ -628,10 +644,10 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, * @param child_cleanup The function to register as the child cleanup */ APR_DECLARE(void) apr_pool_child_cleanup_set( - apr_pool_t *p, - const void *data, - apr_status_t (*plain_cleanup)(void *), - apr_status_t (*child_cleanup)(void *)); + apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup)(void *), + apr_status_t (*child_cleanup)(void *)) + __attribute__((nonnull(3,4))); /** * Run the specified cleanup function immediately and unregister it. @@ -644,10 +660,9 @@ APR_DECLARE(void) apr_pool_child_cleanup_set( * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup */ -APR_DECLARE(apr_status_t) apr_pool_cleanup_run( - apr_pool_t *p, - void *data, - apr_status_t (*cleanup)(void *)); +APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, + apr_status_t (*cleanup)(void *)) + __attribute__((nonnull(3))); /** * An empty cleanup function. @@ -716,7 +731,8 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); * @param p The parent pool * @param sub The subpool */ -APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub); +APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) + __attribute__((nonnull(2))); /** * Find a pool from something allocated in it. @@ -731,7 +747,8 @@ APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem); * @param recurse Recurse/include the subpools' sizes * @return The number of bytes */ -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse); +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse) + __attribute__((nonnull(1))); /** * Lock a pool From 96c74b166f4e152c2f775208ed259bff02fe6c80 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 15 May 2011 13:11:58 +0000 Subject: [PATCH 7021/7878] Remove the pool from the apr_crypto shutdown call. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1103367 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 7 +++---- crypto/apr_crypto_nss.c | 4 ++-- crypto/apr_crypto_openssl.c | 4 ++-- include/apr_crypto.h | 4 +--- include/private/apr_crypto_internal.h | 3 +-- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index f73c4367b93..1bfdbacfa26 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -436,12 +436,11 @@ APR_DECLARE(apr_status_t) apr_crypto_cleanup(apr_crypto_t *f) { * @brief Shutdown the crypto library. * @note After shutdown, it is expected that the init function can be called again. * @param driver - driver to use - * @param p The pool to use. * @return Returns APR_ENOTIMPL if not supported. */ -APR_DECLARE(apr_status_t) apr_crypto_shutdown(const apr_crypto_driver_t *driver, - apr_pool_t *p) { - return driver->shutdown(p); +APR_DECLARE(apr_status_t) apr_crypto_shutdown(const apr_crypto_driver_t *driver) +{ + return driver->shutdown(); } #endif /* APU_HAVE_CRYPTO */ diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 52d6822e3ba..9c37a2d0d32 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -84,7 +84,7 @@ static apr_status_t crypto_error(const apu_err_t **result, const apr_crypto_t *f * * It is safe to shut down twice. */ -static apr_status_t crypto_shutdown(apr_pool_t *pool) +static apr_status_t crypto_shutdown() { if (NSS_IsInitialized()) { SECStatus s = NSS_Shutdown(); @@ -98,7 +98,7 @@ static apr_status_t crypto_shutdown(apr_pool_t *pool) static apr_status_t crypto_shutdown_helper(void *data) { apr_pool_t *pool = (apr_pool_t *) data; - return crypto_shutdown(pool); + return crypto_shutdown(); } /** diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 272fa4a4170..1c7cb46abcf 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -76,7 +76,7 @@ static apr_status_t crypto_error(const apu_err_t **result, const apr_crypto_t *f /** * Shutdown the crypto library and release resources. */ -static apr_status_t crypto_shutdown(apr_pool_t *pool) { +static apr_status_t crypto_shutdown() { ERR_free_strings(); EVP_cleanup(); ENGINE_cleanup(); @@ -85,7 +85,7 @@ static apr_status_t crypto_shutdown(apr_pool_t *pool) { static apr_status_t crypto_shutdown_helper(void *data) { apr_pool_t *pool = (apr_pool_t *) data; - return crypto_shutdown(pool); + return crypto_shutdown(); } /** diff --git a/include/apr_crypto.h b/include/apr_crypto.h index f77d222731f..c686379b71a 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -429,11 +429,9 @@ APR_DECLARE(apr_status_t) apr_crypto_cleanup(apr_crypto_t *f); * @brief Shutdown the crypto library. * @note After shutdown, it is expected that the init function can be called again. * @param driver - driver to use - * @param p The pool to use. * @return Returns APR_ENOTIMPL if not supported. */ -APR_DECLARE(apr_status_t) apr_crypto_shutdown(const apr_crypto_driver_t *driver, - apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_crypto_shutdown(const apr_crypto_driver_t *driver); #endif /* APU_HAVE_CRYPTO */ diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index 501947d42ba..1511cc82ba9 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -234,10 +234,9 @@ struct apr_crypto_driver_t { /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. - * @param pool The pool to use. * @return Returns APR_ENOTIMPL if not supported. */ - apr_status_t (*shutdown)(apr_pool_t *p); + apr_status_t (*shutdown)(); /** * @brief: fetch the most recent error from this driver. From 9987579294db44fb6a8bde8457dbe22acfc21fff Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 15 May 2011 14:07:20 +0000 Subject: [PATCH 7022/7878] Remove the apr_crypto_t context from calls where the apr_crypto_block_t is passed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1103382 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 54 ++++++++++++++------------- crypto/apr_crypto_nss.c | 21 +++++++---- crypto/apr_crypto_openssl.c | 25 ++++++++----- include/apr_crypto.h | 24 ++++-------- include/private/apr_crypto_internal.h | 6 +-- test/testcrypto.c | 20 +++++----- 6 files changed, 77 insertions(+), 73 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 1bfdbacfa26..89ab566c805 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -44,6 +44,18 @@ APR_TYPEDEF_STRUCT(apr_crypto_t, \ apr_crypto_driver_t *provider; \ ) +APR_TYPEDEF_STRUCT(apr_crypto_key_t, \ + apr_pool_t *pool; \ + apr_crypto_driver_t *provider; \ + const apr_crypto_t *f; +) + +APR_TYPEDEF_STRUCT(apr_crypto_block_t, \ + apr_pool_t *pool; \ + apr_crypto_driver_t *provider; \ + const apr_crypto_t *f; +) + #if !APR_HAVE_MODULAR_DSO #define DRIVER_LOAD(name,driver,pool,params) \ { \ @@ -272,7 +284,6 @@ APR_DECLARE(apr_status_t) apr_crypto_passphrase(apr_crypto_key_t **key, * used. * @param key The key structure to use. * @param blockSize The block size of the cipher. - * @param f The block context to use. * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns @@ -280,10 +291,9 @@ APR_DECLARE(apr_status_t) apr_crypto_passphrase(apr_crypto_key_t **key, */ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init( apr_crypto_block_t **ctx, const unsigned char **iv, - const apr_crypto_key_t *key, apr_size_t *blockSize, - const apr_crypto_t *f, apr_pool_t *p) + const apr_crypto_key_t *key, apr_size_t *blockSize, apr_pool_t *p) { - return f->provider->block_encrypt_init(ctx, iv, key, blockSize, f, p); + return key->provider->block_encrypt_init(ctx, iv, key, blockSize, p); } /** @@ -300,16 +310,15 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init( * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. - * @param f The block context to use. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, - const apr_crypto_t *f, apr_crypto_block_t *ctx) + apr_crypto_block_t *ctx) { - return f->provider->block_encrypt(out, outlen, in, inlen, ctx); + return ctx->provider->block_encrypt(out, outlen, in, inlen, ctx); } /** @@ -324,7 +333,6 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt(unsigned char **out, * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. - * @param f The block context to use. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly @@ -332,9 +340,9 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt(unsigned char **out, * @return APR_ENOTIMPL if not implemented. */ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(unsigned char *out, - apr_size_t *outlen, const apr_crypto_t *f, apr_crypto_block_t *ctx) + apr_size_t *outlen, apr_crypto_block_t *ctx) { - return f->provider->block_encrypt_finish(out, outlen, ctx); + return ctx->provider->block_encrypt_finish(out, outlen, ctx); } /** @@ -345,7 +353,6 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(unsigned char *out, * @param blockSize The block size of the cipher. * @param iv Optional initialisation vector. * @param key The key structure to use. - * @param f The block context to use. * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns @@ -353,10 +360,9 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(unsigned char *out, */ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init( apr_crypto_block_t **ctx, apr_size_t *blockSize, - const unsigned char *iv, const apr_crypto_key_t *key, - const apr_crypto_t *f, apr_pool_t *p) + const unsigned char *iv, const apr_crypto_key_t *key, apr_pool_t *p) { - return f->provider->block_decrypt_init(ctx, blockSize, iv, key, f, p); + return key->provider->block_decrypt_init(ctx, blockSize, iv, key, p); } /** @@ -373,16 +379,15 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init( * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. - * @param f The block context to use. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, - const apr_crypto_t *f, apr_crypto_block_t *ctx) + apr_crypto_block_t *ctx) { - return f->provider->block_decrypt(out, outlen, in, inlen, ctx); + return ctx->provider->block_decrypt(out, outlen, in, inlen, ctx); } /** @@ -397,7 +402,6 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt(unsigned char **out, * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. - * @param f The block context to use. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly @@ -405,21 +409,20 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt(unsigned char **out, * @return APR_ENOTIMPL if not implemented. */ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish(unsigned char *out, - apr_size_t *outlen, const apr_crypto_t *f, apr_crypto_block_t *ctx) + apr_size_t *outlen, apr_crypto_block_t *ctx) { - return f->provider->block_decrypt_finish(out, outlen, ctx); + return ctx->provider->block_decrypt_finish(out, outlen, ctx); } /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. - * @param f The block context to use. * @param ctx The block context to use. * @return Returns APR_ENOTIMPL if not supported. */ -APR_DECLARE(apr_status_t) apr_crypto_block_cleanup( - const apr_crypto_t *f, apr_crypto_block_t *ctx) { - return f->provider->block_cleanup(ctx); +APR_DECLARE(apr_status_t) apr_crypto_block_cleanup(apr_crypto_block_t *ctx) +{ + return ctx->provider->block_cleanup(ctx); } /** @@ -428,7 +431,8 @@ APR_DECLARE(apr_status_t) apr_crypto_block_cleanup( * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ -APR_DECLARE(apr_status_t) apr_crypto_cleanup(apr_crypto_t *f) { +APR_DECLARE(apr_status_t) apr_crypto_cleanup(apr_crypto_t *f) +{ return f->provider->cleanup(f); } diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 9c37a2d0d32..af4b87819ae 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -57,6 +57,9 @@ struct apr_crypto_config_t { }; struct apr_crypto_key_t { + apr_pool_t *pool; + const apr_crypto_driver_t *provider; + const apr_crypto_t *f; CK_MECHANISM_TYPE cipherMech; SECOidTag cipherOid; PK11SymKey *symKey; @@ -64,8 +67,9 @@ struct apr_crypto_key_t { }; struct apr_crypto_block_t { - const apr_crypto_t *f; apr_pool_t *pool; + const apr_crypto_driver_t *provider; + const apr_crypto_t *f; PK11Context *ctx; apr_crypto_key_t *key; int blockSize; @@ -321,6 +325,9 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, return APR_ENOMEM; } + key->f = f; + key->provider = f->provider; + /* decide on what cipher mechanism we will be using */ switch (type) { @@ -423,7 +430,6 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, * used. * @param key The key structure. * @param blockSize The block size of the cipher. - * @param f The block context to use. * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns @@ -431,7 +437,7 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, */ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, const unsigned char **iv, const apr_crypto_key_t *key, - apr_size_t *blockSize, const apr_crypto_t *f, apr_pool_t *p) + apr_size_t *blockSize, apr_pool_t *p) { PRErrorCode perr; SECItem * secParam; @@ -444,8 +450,9 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, if (!block) { return APR_ENOMEM; } - block->f = f; + block->f = key->f; block->pool = p; + block->provider = key->provider; apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, @@ -599,7 +606,6 @@ static apr_status_t crypto_block_encrypt_finish(unsigned char *out, * an IV will be created at random, in space allocated from the pool. * If the buffer is not NULL, the IV in the buffer will be used. * @param key The key structure. - * @param f The block context to use. * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns @@ -607,7 +613,7 @@ static apr_status_t crypto_block_encrypt_finish(unsigned char *out, */ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, apr_size_t *blockSize, const unsigned char *iv, - const apr_crypto_key_t *key, const apr_crypto_t *f, apr_pool_t *p) + const apr_crypto_key_t *key, apr_pool_t *p) { PRErrorCode perr; SECItem * secParam; @@ -618,8 +624,9 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, if (!block) { return APR_ENOMEM; } - block->f = f; + block->f = key->f; block->pool = p; + block->provider = key->provider; apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 1c7cb46abcf..32e65d9c4fd 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -48,6 +48,9 @@ struct apr_crypto_config_t { }; struct apr_crypto_key_t { + apr_pool_t *pool; + const apr_crypto_driver_t *provider; + const apr_crypto_t *f; const EVP_CIPHER * cipher; unsigned char *key; int keyLen; @@ -56,8 +59,9 @@ struct apr_crypto_key_t { }; struct apr_crypto_block_t { - const apr_crypto_t *f; apr_pool_t *pool; + const apr_crypto_driver_t *provider; + const apr_crypto_t *f; EVP_CIPHER_CTX cipherCtx; int initialised; int ivSize; @@ -252,6 +256,9 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, return APR_ENOMEM; } + key->f = f; + key->provider = f->provider; + /* determine the cipher to be used */ switch (type) { @@ -340,7 +347,6 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, * used. * @param key The key structure. * @param blockSize The block size of the cipher. - * @param f The block context to use. * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns @@ -348,10 +354,10 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, */ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, const unsigned char **iv, const apr_crypto_key_t *key, - apr_size_t *blockSize, const apr_crypto_t *f, apr_pool_t *p) + apr_size_t *blockSize, apr_pool_t *p) { unsigned char *usedIv; - apr_crypto_config_t *config = f->config; + apr_crypto_config_t *config = key->f->config; apr_crypto_block_t *block = *ctx; if (!block) { *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t)); @@ -359,8 +365,9 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, if (!block) { return APR_ENOMEM; } - block->f = f; + block->f = key->f; block->pool = p; + block->provider = key->provider; apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, apr_pool_cleanup_null); @@ -509,7 +516,6 @@ static apr_status_t crypto_block_encrypt_finish(unsigned char *out, * an IV will be created at random, in space allocated from the pool. * If the buffer is not NULL, the IV in the buffer will be used. * @param key The key structure. - * @param f The block context to use. * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns @@ -517,9 +523,9 @@ static apr_status_t crypto_block_encrypt_finish(unsigned char *out, */ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, apr_size_t *blockSize, const unsigned char *iv, - const apr_crypto_key_t *key, const apr_crypto_t *f, apr_pool_t *p) + const apr_crypto_key_t *key, apr_pool_t *p) { - apr_crypto_config_t *config = f->config; + apr_crypto_config_t *config = key->f->config; apr_crypto_block_t *block = *ctx; if (!block) { *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t)); @@ -527,8 +533,9 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, if (!block) { return APR_ENOMEM; } - block->f = f; + block->f = key->f; block->pool = p; + block->provider = key->provider; apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, apr_pool_cleanup_null); diff --git a/include/apr_crypto.h b/include/apr_crypto.h index c686379b71a..dc335ff5aa1 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -287,7 +287,6 @@ APR_DECLARE(apr_status_t) apr_crypto_passphrase(apr_crypto_key_t **key, * used. * @param key The key structure to use. * @param blockSize The block size of the cipher. - * @param f The block context to use. * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns @@ -295,8 +294,7 @@ APR_DECLARE(apr_status_t) apr_crypto_passphrase(apr_crypto_key_t **key, */ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init( apr_crypto_block_t **ctx, const unsigned char **iv, - const apr_crypto_key_t *key, apr_size_t *blockSize, - const apr_crypto_t *f, apr_pool_t *p); + const apr_crypto_key_t *key, apr_size_t *blockSize, apr_pool_t *p); /** * @brief Encrypt data provided by in, write it to out. @@ -312,14 +310,13 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init( * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. - * @param f The block context to use. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, - const apr_crypto_t *f, apr_crypto_block_t *ctx); + apr_crypto_block_t *ctx); /** * @brief Encrypt final data block, write it to out. @@ -333,7 +330,6 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt(unsigned char **out, * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. - * @param f The block context to use. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly @@ -341,7 +337,7 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt(unsigned char **out, * @return APR_ENOTIMPL if not implemented. */ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(unsigned char *out, - apr_size_t *outlen, const apr_crypto_t *f, apr_crypto_block_t *ctx); + apr_size_t *outlen, apr_crypto_block_t *ctx); /** * @brief Initialise a context for decrypting arbitrary data using the given key. @@ -351,7 +347,6 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(unsigned char *out, * @param blockSize The block size of the cipher. * @param iv Optional initialisation vector. * @param key The key structure to use. - * @param f The block context to use. * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns @@ -359,8 +354,7 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(unsigned char *out, */ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init( apr_crypto_block_t **ctx, apr_size_t *blockSize, - const unsigned char *iv, const apr_crypto_key_t *key, - const apr_crypto_t *f, apr_pool_t *p); + const unsigned char *iv, const apr_crypto_key_t *key, apr_pool_t *p); /** * @brief Decrypt data provided by in, write it to out. @@ -376,14 +370,13 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init( * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. - * @param f The block context to use. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, - const apr_crypto_t *f, apr_crypto_block_t *ctx); + apr_crypto_block_t *ctx); /** * @brief Decrypt final data block, write it to out. @@ -397,7 +390,6 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt(unsigned char **out, * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. - * @param f The block context to use. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly @@ -405,17 +397,15 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt(unsigned char **out, * @return APR_ENOTIMPL if not implemented. */ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish(unsigned char *out, - apr_size_t *outlen, const apr_crypto_t *f, apr_crypto_block_t *ctx); + apr_size_t *outlen, apr_crypto_block_t *ctx); /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. - * @param f The block context to use. * @param ctx The block context to use. * @return Returns APR_ENOTIMPL if not supported. */ -APR_DECLARE(apr_status_t) apr_crypto_block_cleanup( - const apr_crypto_t *f, apr_crypto_block_t *ctx); +APR_DECLARE(apr_status_t) apr_crypto_block_cleanup(apr_crypto_block_t *ctx); /** * @brief Clean encryption / decryption context. diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index 1511cc82ba9..d32af297276 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -101,7 +101,6 @@ struct apr_crypto_driver_t { * used. * @param key The key structure. * @param blockSize The block size of the cipher. - * @param f The block context to use. * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns @@ -109,7 +108,7 @@ struct apr_crypto_driver_t { */ apr_status_t (*block_encrypt_init)(apr_crypto_block_t **ctx, const unsigned char **iv, const apr_crypto_key_t *key, - apr_size_t *blockSize, const apr_crypto_t *f, apr_pool_t *p); + apr_size_t *blockSize, apr_pool_t *p); /** * @brief Encrypt data provided by in, write it to out. @@ -163,7 +162,6 @@ struct apr_crypto_driver_t { * an IV will be created at random, in space allocated from the pool. * If the buffer is not NULL, the IV in the buffer will be used. * @param key The key structure. - * @param f The block context to use. * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns @@ -171,7 +169,7 @@ struct apr_crypto_driver_t { */ apr_status_t (*block_decrypt_init)(apr_crypto_block_t **ctx, apr_size_t *blockSize, const unsigned char *iv, - const apr_crypto_key_t *key, const apr_crypto_t *f, apr_pool_t *p); + const apr_crypto_key_t *key, apr_pool_t *p); /** * @brief Decrypt data provided by in, write it to out. diff --git a/test/testcrypto.c b/test/testcrypto.c index 41e1b29215e..7863da40f01 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -160,7 +160,7 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, } /* init the encryption */ - rv = apr_crypto_block_encrypt_init(&block, iv, key, blockSize, f, pool); + rv = apr_crypto_block_encrypt_init(&block, iv, key, blockSize, pool); if (APR_ENOTIMPL == rv) { ABTS_NOT_IMPL(tc, "apr_crypto_block_encrypt_init returned APR_ENOTIMPL"); } else { @@ -183,8 +183,7 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, } /* encrypt the block */ - rv = apr_crypto_block_encrypt(cipherText, cipherTextLen, in, inlen, f, - block); + rv = apr_crypto_block_encrypt(cipherText, cipherTextLen, in, inlen, block); if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); fprintf(stderr, "encrypt: %s %s native error %d: %s (%s)\n", @@ -200,8 +199,7 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, } /* finalise the encryption */ - rv = apr_crypto_block_encrypt_finish(*cipherText + *cipherTextLen, &len, f, - block); + rv = apr_crypto_block_encrypt_finish(*cipherText + *cipherTextLen, &len, block); if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); fprintf(stderr, "encrypt_finish: %s %s native error %d: %s (%s)\n", @@ -213,7 +211,7 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, ABTS_ASSERT(tc, "apr_crypto_block_encrypt_finish returned APR_EPADDING", rv != APR_EPADDING); ABTS_ASSERT(tc, "failed to apr_crypto_block_encrypt_finish", rv == APR_SUCCESS); *cipherTextLen += len; - apr_crypto_block_cleanup(f, block); + apr_crypto_block_cleanup(block); if (rv) { return NULL; } @@ -239,7 +237,7 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, } /* init the decryption */ - rv = apr_crypto_block_decrypt_init(&block, blockSize, iv, key, f, pool); + rv = apr_crypto_block_decrypt_init(&block, blockSize, iv, key, pool); if (APR_ENOTIMPL == rv) { ABTS_NOT_IMPL(tc, "apr_crypto_block_decrypt_init returned APR_ENOTIMPL"); } else { @@ -262,8 +260,8 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, } /* decrypt the block */ - rv = apr_crypto_block_decrypt(plainText, plainTextLen, - cipherText, cipherTextLen, f, block); + rv = apr_crypto_block_decrypt(plainText, plainTextLen, cipherText, + cipherTextLen, block); if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); fprintf(stderr, "decrypt: %s %s native error %d: %s (%s)\n", @@ -279,7 +277,7 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, } /* finalise the decryption */ - rv = apr_crypto_block_decrypt_finish(*plainText + *plainTextLen, &len, f, + rv = apr_crypto_block_decrypt_finish(*plainText + *plainTextLen, &len, block); if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); @@ -296,7 +294,7 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, } *plainTextLen += len; - apr_crypto_block_cleanup(f, block); + apr_crypto_block_cleanup(block); return *plainText; From 450518370cb627d86438b70ef080b1b91fe033fc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 17 May 2011 19:57:57 +0000 Subject: [PATCH 7023/7878] Worked out a test to reveal the flaw corrected by r1103041 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1104503 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfnmatch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/testfnmatch.c b/test/testfnmatch.c index c27cac76187..2df70ff0e88 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -94,6 +94,8 @@ static struct pattern_s { {"\\/test", "/test", FAILS_IF(APR_FNM_NOESCAPE)}, {"tes[]t]", "test", SUCCEEDS}, {"tes[t-]", "test", SUCCEEDS}, + {"tes[t-]]", "test]", SUCCEEDS}, + {"tes[t-]]", "test", FAILS}, {"tes[u-]", "test", FAILS}, {"tes[t-]", "tes[t-]", FAILS}, {"test[/-/]", "test[/-/]", SUCCEEDS_IF(APR_FNM_PATHNAME)}, From 31241f9cf4ca463c925547591be54e7bfac6d473 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 18 May 2011 16:24:49 +0000 Subject: [PATCH 7024/7878] Add more pattern tests involving slashes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1124322 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfnmatch.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/testfnmatch.c b/test/testfnmatch.c index 2df70ff0e88..87fe3e8739b 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -91,7 +91,6 @@ static struct pattern_s { {"te[R-T]t", "test", SUCCEEDS_IF(APR_FNM_CASE_BLIND)}, {"te[r-Tz]t", "tezt", SUCCEEDS}, {"te[R-T]t", "tent", FAILS}, - {"\\/test", "/test", FAILS_IF(APR_FNM_NOESCAPE)}, {"tes[]t]", "test", SUCCEEDS}, {"tes[t-]", "test", SUCCEEDS}, {"tes[t-]]", "test]", SUCCEEDS}, @@ -105,9 +104,20 @@ static struct pattern_s { {"test[\\/-/]", "test/", FAILS_IF(APR_FNM_PATHNAME)}, {"test[/-\\/]", "test/", FAILS_IF(APR_FNM_PATHNAME)}, + {"/", "", FAILS}, + {"", "/", FAILS}, + {"/test", "test", FAILS}, + {"test", "/test", FAILS}, + {"test/", "test", FAILS}, + {"test", "test/", FAILS}, + {"\\/test", "/test", FAILS_IF(APR_FNM_NOESCAPE)}, + {"*test", "/test", FAILS_IF(APR_FNM_PATHNAME)}, + {"/*/test/", "/test", FAILS}, + {"/*/test/", "/test/test/", SUCCEEDS}, {"test/this", "test/", FAILS}, {"test/", "test/this", FAILS}, {"test*/this", "test/this", SUCCEEDS}, + {"test*/this", "test/that", FAILS}, {"test/*this", "test/this", SUCCEEDS}, {".*", ".this", SUCCEEDS}, From 0b64a8d908923898a6166020dc2e95ef8b43f4a9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 18 May 2011 16:27:46 +0000 Subject: [PATCH 7025/7878] Fix PR 51219, /foo against /foo/bar. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1124326 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index 0b00846e523..b6741ef4ee5 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -207,7 +207,10 @@ APR_DECLARE(int) apr_fnmatch(const char *pattern, const char *string, int flags) const char *mismatch = NULL; int matchlen = 0; - while (*pattern) + if (*pattern == '*') + goto firstsegment; + + while (*pattern && *string) { /* Pre-decode "\/" which has no special significance, and * match balanced slashes, starting a new segment pattern @@ -219,6 +222,7 @@ APR_DECLARE(int) apr_fnmatch(const char *pattern, const char *string, int flags) ++string; } +firstsegment: /* At the beginning of each segment, validate leading period behavior. */ if ((flags & APR_FNM_PERIOD) && (*string == '.')) @@ -379,9 +383,9 @@ APR_DECLARE(int) apr_fnmatch(const char *pattern, const char *string, int flags) return APR_FNM_NOMATCH; } - /* pattern is at EOS; if string is also, declare success + /* Where both pattern and string are at EOS, declare success */ - if (!*string) + if (!*string && !*pattern) return 0; /* pattern didn't match to the end of string */ From a4b5445861bfa1a9475b1aff3d54557a47549d0a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 19 May 2011 16:18:19 +0000 Subject: [PATCH 7026/7878] Document another unexpected failure, researching git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1124983 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfnmatch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testfnmatch.c b/test/testfnmatch.c index 87fe3e8739b..17a75441543 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -75,6 +75,7 @@ static struct pattern_s { {"tes*", "test", SUCCEEDS}, {"test*", "test", SUCCEEDS}, + {".[\\-\\t]", ".t", SUCCEEDS}, {"test*?*[a-z]*", "testgoop", SUCCEEDS}, {"te[^x]t", "test", SUCCEEDS}, {"te[^abc]t", "test", SUCCEEDS}, From fe0244e715b2d5aa54652aa3ac6d22989cde1108 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 19 May 2011 17:05:21 +0000 Subject: [PATCH 7027/7878] Fix t ~= [/-/t] mismatch, observed by jorton. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1124997 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index b6741ef4ee5..c1c0e4af54b 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -129,7 +129,7 @@ static APR_INLINE int fnmatch_ch(const char **pattern, const char **string, int * or ranges containing a slash in FNM_PATHNAME mode pattern * fall out to to the rewind and test '[' literal code path */ - if (!**pattern || (slash && (**pattern == '\\'))) + if (!**pattern || (slash && (**pattern == '/'))) break; /* XXX: handle locale/MBCS comparison, advance by MBCS char width */ From 5cd123b806b1f0037c5e69b19d3d9b88b0ae4fe5 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Fri, 20 May 2011 14:34:55 +0000 Subject: [PATCH 7028/7878] rpm spec file: BuildPrereq is deprecated, use BuildRequires instead. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1125417 13f79535-47bb-0310-9956-ffa450edef68 --- build/rpm/apr.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/rpm/apr.spec.in b/build/rpm/apr.spec.in index 662ab4ca340..0f9f3a2654d 100644 --- a/build/rpm/apr.spec.in +++ b/build/rpm/apr.spec.in @@ -10,7 +10,7 @@ Group: System Environment/Libraries URL: http://apr.apache.org/ Source0: http://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot -BuildPrereq: autoconf, libtool, doxygen, python +BuildRequires: autoconf, libtool, doxygen, python %description The mission of the Apache Portable Runtime (APR) is to provide a From cf88c9437fa0840378374016274c040988e27d3e Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 20 May 2011 15:59:57 +0000 Subject: [PATCH 7029/7878] Fix indentation, no functional change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1125444 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/buildconf b/buildconf index e5f8926cc73..ba5a8a138e8 100755 --- a/buildconf +++ b/buildconf @@ -54,14 +54,14 @@ if test "$1" = "1"; then if [ -f libtool.m4 ]; then ltfile=`pwd`/libtool.m4 else - ltfindcmd="`sed -n \"/=[^\\\`]/p;/libtool_m4=/{s/.*=/echo /p;q;}\" \ + ltfindcmd="`sed -n \"/=[^\\\`]/p;/libtool_m4=/{s/.*=/echo /p;q;}\" \ < $libtoolize`" - ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`} - # Expecting the code above to be very portable, but just in case... - if [ -z "$ltfile" -o ! -f "$ltfile" ]; then - ltpath=`dirname $libtoolize` - ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 - fi + ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`} + # Expecting the code above to be very portable, but just in case... + if [ -z "$ltfile" -o ! -f "$ltfile" ]; then + ltpath=`dirname $libtoolize` + ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 + fi fi if [ ! -f $ltfile ]; then echo "$ltfile not found" From c419e0279b849088a8e0e8c34fec2744d9ccb951 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 20 May 2011 17:14:53 +0000 Subject: [PATCH 7030/7878] Silence autoconf 2.68 warnings. Add AC_LANG_SOURCE to AC_COMPILE_IFELSE in apr_common.m4. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1125472 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index d0efc1e9206..bd320ead976 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -500,12 +500,14 @@ AC_DEFUN([APR_TRY_COMPILE_NO_WARNING], CFLAGS="$CFLAGS -Werror" fi AC_COMPILE_IFELSE( - [#include "confdefs.h" - ] - [[$1]] - [int main(int argc, const char *const *argv) {] - [[$2]] - [ return 0; }], + [AC_LANG_SOURCE( + [#include "confdefs.h" + ] + [[$1]] + [int main(int argc, const char *const *argv) {] + [[$2]] + [ return 0; }] + )], [$3], [$4]) CFLAGS=$apr_save_CFLAGS ]) From 2d9811967427aed75399f055c6831a5a3a6f462c Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 20 May 2011 17:21:16 +0000 Subject: [PATCH 7031/7878] Minor cleanups in buildconf: - Correct and add a few comments - Remove "$verbose" from libtool 1 call (it doesn't implement it) - Reduce code duplication Will backport to 1.5 and 1.4 after more testing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1125475 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/buildconf b/buildconf index ba5a8a138e8..2fa18a8be28 100755 --- a/buildconf +++ b/buildconf @@ -42,21 +42,33 @@ fi # echo "buildconf: copying libtool helper files using $libtoolize" -# Remove any libtool files so one can switch between libtool 1.3 -# and libtool 1.4 by simply rerunning the buildconf script. +# Remove any libtool files so one can switch between libtool versions +# by simply rerunning the buildconf script. +rm -f aclocal.m4 libtool.m4 (cd build ; rm -f ltconfig ltmain.sh libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4) +# Determine libtool version, because --copy behaves differently +# w.r.t. copying libtool.m4 lt_pversion=`$libtoolize --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` IFS=.; set $lt_version; IFS=' ' + +# libtool 1 if test "$1" = "1"; then - $libtoolize --copy --automake $verbose + $libtoolize --copy --automake + # Unlikely, maybe for old versions the file exists if [ -f libtool.m4 ]; then ltfile=`pwd`/libtool.m4 else + + # Extract all lines setting variables from libtoolize up until + # libtool_m4 gets set ltfindcmd="`sed -n \"/=[^\\\`]/p;/libtool_m4=/{s/.*=/echo /p;q;}\" \ < $libtoolize`" + + # Get path to libtool.m4 either from LIBTOOL_M4 env var or our libtoolize based script ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`} + # Expecting the code above to be very portable, but just in case... if [ -z "$ltfile" -o ! -f "$ltfile" ]; then ltpath=`dirname $libtoolize` @@ -70,16 +82,20 @@ if test "$1" = "1"; then # Do we need this anymore? echo "buildconf: Using libtool.m4 at ${ltfile}." rm -f build/libtool.m4 - cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 -fi -if test "$1" = "2"; then - $libtoolize --copy --automake $verbose - # Wouldn't it just be better to define top_builddir?? - mv build/libtool.m4 build/libtool.m4.$$ - cat build/libtool.m4.$$ | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 - rm -f build/libtool.m4.$$ + cp -p $ltfile build/libtool.m4 + +# libtool 2 +elif test "$1" = "2"; then + $libtoolize --copy --quiet $verbose fi +# Replace top_builddir by apr_builddir. +# Wouldn't it just be better to define top_builddir?? +# Not sure, wuld it interfere with httpd top_builddir when bundled? +mv build/libtool.m4 build/libtool.m4.$$ +sed -e 's/\(LIBTOOL=.*\)top_build/\1apr_build/' < build/libtool.m4.$$ > build/libtool.m4 +rm -f build/libtool.m4.$$ + # Clean up any leftovers rm -f aclocal.m4 libtool.m4 From 0b8f47234ba4de77d86b12ea4f21474fceb393d8 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 20 May 2011 19:00:30 +0000 Subject: [PATCH 7032/7878] Add forgotten argz.m4 to libtool m4 cleanup. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1125507 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildconf b/buildconf index 2fa18a8be28..e9a63dc9f75 100755 --- a/buildconf +++ b/buildconf @@ -45,7 +45,7 @@ echo "buildconf: copying libtool helper files using $libtoolize" # Remove any libtool files so one can switch between libtool versions # by simply rerunning the buildconf script. rm -f aclocal.m4 libtool.m4 -(cd build ; rm -f ltconfig ltmain.sh libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4) +(cd build ; rm -f ltconfig ltmain.sh argz.m4 libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4) # Determine libtool version, because --copy behaves differently # w.r.t. copying libtool.m4 From 167f8354820928e6cc49ad1a88418d0df2d78408 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 20 May 2011 19:31:10 +0000 Subject: [PATCH 7033/7878] Fix extraclean make target: also remove libtool2 files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1125522 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index bc8e9d9465c..adf313b431c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -57,7 +57,10 @@ DISTCLEAN_TARGETS = config.cache config.log config.status \ libtool $(APR_CONFIG) build/apr_rules.mk apr.pc \ build/pkg/pkginfo EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in \ - build-outputs.mk build/ltcf-c.sh build/ltmain.sh build/libtool.m4 + build-outputs.mk build/ltcf-c.sh build/aclocal.m4 \ + build/ltconfig build/ltmain.sh \ + build/argz.m4 build/libtool.m4 build/ltoptions.m4 \ + build/ltsugar.m4 build/ltversion.m4 build/lt~obsolete.m4 prefix=@prefix@ exec_prefix=@exec_prefix@ From b419a91f14d8dff91793a3096a7cba2355790979 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 20 May 2011 19:50:41 +0000 Subject: [PATCH 7034/7878] Fix nasty comment typo. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1125527 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildconf b/buildconf index e9a63dc9f75..b70fa53eca1 100755 --- a/buildconf +++ b/buildconf @@ -91,7 +91,7 @@ fi # Replace top_builddir by apr_builddir. # Wouldn't it just be better to define top_builddir?? -# Not sure, wuld it interfere with httpd top_builddir when bundled? +# Not sure, would it interfere with httpd top_builddir when bundled? mv build/libtool.m4 build/libtool.m4.$$ sed -e 's/\(LIBTOOL=.*\)top_build/\1apr_build/' < build/libtool.m4.$$ > build/libtool.m4 rm -f build/libtool.m4.$$ From 1ead2b6b60e039aa67bc830409e0759fc7d8190e Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 20 May 2011 20:21:06 +0000 Subject: [PATCH 7035/7878] Yearly config.(guess|sub) update. Detects more platforms, like AIX 7, Android etc. Source taken from http://git.savannah.gnu.org/cgit/config.git/tree/ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1125545 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 223 ++++++++++++++++++++++++--------------------- build/config.sub | 107 ++++++++++++++-------- 2 files changed, 187 insertions(+), 143 deletions(-) diff --git a/build/config.guess b/build/config.guess index 115f944a61d..40eaed4821e 100755 --- a/build/config.guess +++ b/build/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. -timestamp='2010-04-03' +timestamp='2011-05-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -57,7 +57,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -92,7 +92,7 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' HUP INT TERM +trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -106,7 +106,7 @@ trap 'exit 1' HUP INT TERM set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || @@ -181,7 +181,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -224,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -270,7 +270,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -296,7 +299,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -395,23 +398,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -481,8 +484,8 @@ EOF echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -495,7 +498,7 @@ EOF else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -552,7 +555,7 @@ EOF echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[456]) + *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -595,52 +598,52 @@ EOF 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c - #define _HPUX_SOURCE - #include - #include + #define _HPUX_SOURCE + #include + #include - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -731,22 +734,22 @@ EOF exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -770,14 +773,14 @@ EOF exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -805,14 +808,14 @@ EOF echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; @@ -867,7 +870,7 @@ EOF EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; - esac + esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} @@ -879,7 +882,13 @@ EOF then echo ${UNAME_MACHINE}-unknown-linux-gnu else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi fi exit ;; avr32*:Linux:*:*) @@ -892,7 +901,7 @@ EOF echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -960,7 +969,7 @@ EOF echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -968,6 +977,9 @@ EOF sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-tilera-linux-gnu + exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; @@ -975,7 +987,7 @@ EOF echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -984,11 +996,11 @@ EOF echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1020,7 +1032,7 @@ EOF fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1048,13 +1060,13 @@ EOF exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp - exit ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1089,8 +1101,8 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1133,10 +1145,10 @@ EOF echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1162,11 +1174,11 @@ EOF exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1231,6 +1243,9 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; @@ -1276,13 +1291,13 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1322,11 +1337,11 @@ main () #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif diff --git a/build/config.sub b/build/config.sub index 204218c0738..30fdca81215 100755 --- a/build/config.sub +++ b/build/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. -timestamp='2010-05-21' +timestamp='2011-03-23' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -76,7 +76,7 @@ version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -158,8 +158,8 @@ case $os in os= basic_machine=$1 ;; - -bluegene*) - os=-cnk + -bluegene*) + os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= @@ -175,10 +175,10 @@ case $os in os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -283,11 +283,13 @@ case $basic_machine in | moxie \ | mt \ | msp430 \ + | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ + | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ @@ -295,12 +297,12 @@ case $basic_machine in | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; @@ -324,6 +326,18 @@ case $basic_machine in basic_machine=mt-unknown ;; + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -378,26 +392,28 @@ case $basic_machine in | mmix-* \ | mt-* \ | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -422,7 +438,7 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -505,7 +521,7 @@ case $basic_machine in basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -537,7 +553,7 @@ case $basic_machine in basic_machine=craynv-cray os=-unicosmp ;; - cr16) + cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; @@ -753,7 +769,7 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze) basic_machine=microblaze-xilinx ;; mingw32) @@ -860,6 +876,12 @@ case $basic_machine in np1) basic_machine=np1-gould ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -942,9 +964,10 @@ case $basic_machine in ;; power) basic_machine=power-ibm ;; - ppc) basic_machine=powerpc-unknown + ppc | ppcbe) basic_machine=powerpc-unknown ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -1038,6 +1061,9 @@ case $basic_machine in basic_machine=i860-stratus os=-sysv4 ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; sun2) basic_machine=m68000-sun ;; @@ -1094,8 +1120,8 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - # This must be matched before tile*. - tilegx*) + # This must be matched before tile*. + tilegx*) basic_machine=tilegx-unknown os=-linux-gnu ;; @@ -1170,6 +1196,9 @@ case $basic_machine in xps | xps100) basic_machine=xps100-honeywell ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1267,11 +1296,11 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + -auroraux) + os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` @@ -1356,7 +1385,7 @@ case $os in -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1405,7 +1434,7 @@ case $os in -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1450,8 +1479,8 @@ case $os in -dicos*) os=-dicos ;; - -nacl*) - ;; + -nacl*) + ;; -none) ;; *) @@ -1474,10 +1503,10 @@ else # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1489,8 +1518,8 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff ;; tic54x-*) os=-coff @@ -1526,7 +1555,7 @@ case $basic_machine in m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1553,7 +1582,7 @@ case $basic_machine in *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) From 4bda37371e86d2f9b86475cf4efc4cce4a5131ba Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sun, 22 May 2011 20:10:42 +0000 Subject: [PATCH 7036/7878] Fix thread unsafe pool usage. This is a potential culprit for the occasional testreslist failures. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1126207 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ util-misc/apr_thread_pool.c | 15 ++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 9136bb917ee..13923a72b90 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_thread_pool: Fix thread unsafe pool usage. [Stefan Fritsch] + *) apr_brigades: add a check to prevent infinite while loop in case of a corrupted brigade. Problem evidenced in PR 51062. Analysis by Krzysztof Kostałkowicz , patch [Nick Kew]. diff --git a/util-misc/apr_thread_pool.c b/util-misc/apr_thread_pool.c index 9ec046077ce..006370bae42 100644 --- a/util-misc/apr_thread_pool.c +++ b/util-misc/apr_thread_pool.c @@ -353,13 +353,18 @@ APR_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t ** me, *me = NULL; tp = apr_pcalloc(pool, sizeof(apr_thread_pool_t)); - tp->pool = pool; - + /* + * This pool will be used by different threads. As we cannot ensure that + * our caller won't use the pool without acquiring the mutex, we must + * create a new sub pool. + */ + rv = apr_pool_create(&tp->pool, pool); + if (APR_SUCCESS != rv) + return rv; rv = thread_pool_construct(tp, init_threads, max_threads); - if (APR_SUCCESS != rv) { + if (APR_SUCCESS != rv) return rv; - } - apr_pool_cleanup_register(pool, tp, thread_pool_cleanup, + apr_pool_cleanup_register(tp->pool, tp, thread_pool_cleanup, apr_pool_cleanup_null); while (init_threads) { From 2299a75f95352d0b7619616977dbed86778924cf Mon Sep 17 00:00:00 2001 From: Issac Goldstand Date: Tue, 24 May 2011 13:52:38 +0000 Subject: [PATCH 7037/7878] https://issues.apache.org/bugzilla/show_bug.cgi?id=51256 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1127053 13f79535-47bb-0310-9956-ffa450edef68 --- hooks/apr_hooks.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hooks/apr_hooks.c b/hooks/apr_hooks.c index dc3a20dfa64..22045620433 100644 --- a/hooks/apr_hooks.c +++ b/hooks/apr_hooks.c @@ -208,6 +208,10 @@ static apr_array_header_t *sort_hook(apr_array_header_t *pHooks, } if(apr_hook_debug_enabled) fputc('\n',stdout); + + /* destroy the pool - the sorted hooks were already copied */ + apr_pool_destroy(p); + return pNew; } From 46715e2b34b992d3b7f72d88b65eda5b2823a1d5 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Wed, 25 May 2011 19:38:23 +0000 Subject: [PATCH 7038/7878] apr_crypto: Make sure we can find the nss headers on RHEL5. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1127648 13f79535-47bb-0310-9956-ffa450edef68 --- build/crypto.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/crypto.m4 b/build/crypto.m4 index 44f621e5517..0a4f43c9fe3 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -163,7 +163,7 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [ apu_have_nss=0 elif test "x$withval" != "x"; then - nss_CPPFLAGS="-I$withval/include -I$withval/../public" + nss_CPPFLAGS="-I$withval/include/nss -I$withval/include/nss3 -I$withval/include/nspr -I$withval/include/nspr4 -I$withval/include -I$withval/../public" nss_LDFLAGS="-L$withval/lib " APR_ADDTO(CPPFLAGS, [$nss_CPPFLAGS]) From afe4e5b5042de3b40fad076dd0706720db91ad88 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Wed, 25 May 2011 19:39:36 +0000 Subject: [PATCH 7039/7878] apr_crypto: Correct the variables passed in the API, fix build breakage for the nss implementation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1127649 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_nss.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index af4b87819ae..5ee99f6008c 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -489,8 +489,8 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, /* did an error occur? */ perr = PORT_GetError(); if (perr || !block->ctx) { - f->result->rc = perr; - f->result->msg = PR_ErrorToName(perr); + key->f->result->rc = perr; + key->f->result->msg = PR_ErrorToName(perr); return APR_EINIT; } @@ -522,7 +522,7 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, */ static apr_status_t crypto_block_encrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, - apr_crypto_block_t *ctx) + apr_crypto_block_t *block) { unsigned char *buffer; @@ -573,7 +573,7 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, * @return APR_ENOTIMPL if not implemented. */ static apr_status_t crypto_block_encrypt_finish(unsigned char *out, - apr_size_t *outlen, apr_crypto_block_t *ctx) + apr_size_t *outlen, apr_crypto_block_t *block) { apr_status_t rv = APR_SUCCESS; @@ -650,8 +650,8 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, /* did an error occur? */ perr = PORT_GetError(); if (perr || !block->ctx) { - f->result->rc = perr; - f->result->msg = PR_ErrorToName(perr); + key->f->result->rc = perr; + key->f->result->msg = PR_ErrorToName(perr); return APR_EINIT; } From 2a7678e252a1e6d692b673ff424c794cf2102937 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sun, 29 May 2011 07:30:21 +0000 Subject: [PATCH 7040/7878] Fix compilation with C90 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1128838 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_nss.c | 11 +++++++---- crypto/apr_crypto_openssl.c | 2 +- include/private/apr_crypto_internal.h | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 5ee99f6008c..fafa4f4082e 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -88,7 +88,7 @@ static apr_status_t crypto_error(const apu_err_t **result, const apr_crypto_t *f * * It is safe to shut down twice. */ -static apr_status_t crypto_shutdown() +static apr_status_t crypto_shutdown(void) { if (NSS_IsInitialized()) { SECStatus s = NSS_Shutdown(); @@ -463,11 +463,12 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, return APR_ENOIV; } if (*iv == NULL) { + SECStatus s; usedIv = apr_pcalloc(p, key->ivSize); if (!usedIv) { return APR_ENOMEM; } - SECStatus s = PK11_GenerateRandom(usedIv, key->ivSize); + s = PK11_GenerateRandom(usedIv, key->ivSize); if (s != SECSuccess) { return APR_ENOIV; } @@ -527,6 +528,7 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, unsigned char *buffer; int outl = (int) *outlen; + SECStatus s; if (!out) { *outlen = inlen + block->blockSize; return APR_SUCCESS; @@ -539,7 +541,7 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, *out = buffer; } - SECStatus s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*)in, inlen); + s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*)in, inlen); if (s != SECSuccess) { PRErrorCode perr = PORT_GetError(); if (perr) { @@ -688,6 +690,7 @@ static apr_status_t crypto_block_decrypt(unsigned char **out, unsigned char *buffer; int outl = (int) *outlen; + SECStatus s; if (!out) { *outlen = inlen + block->blockSize; return APR_SUCCESS; @@ -700,7 +703,7 @@ static apr_status_t crypto_block_decrypt(unsigned char **out, *out = buffer; } - SECStatus s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*)in, inlen); + s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*)in, inlen); if (s != SECSuccess) { PRErrorCode perr = PORT_GetError(); if (perr) { diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 32e65d9c4fd..ade9ada90e8 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -80,7 +80,7 @@ static apr_status_t crypto_error(const apu_err_t **result, const apr_crypto_t *f /** * Shutdown the crypto library and release resources. */ -static apr_status_t crypto_shutdown() { +static apr_status_t crypto_shutdown(void) { ERR_free_strings(); EVP_cleanup(); ENGINE_cleanup(); diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index d32af297276..4bb670ae841 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -234,7 +234,7 @@ struct apr_crypto_driver_t { * @note After cleanup, a context is free to be reused if necessary. * @return Returns APR_ENOTIMPL if not supported. */ - apr_status_t (*shutdown)(); + apr_status_t (*shutdown)(void); /** * @brief: fetch the most recent error from this driver. From cce7f1439f5801cea343ee61f991ee60a6db5277 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 29 May 2011 14:59:30 +0000 Subject: [PATCH 7041/7878] Begin refactoring to prepare for ldap removal git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1128885 13f79535-47bb-0310-9956-ffa450edef68 --- build/apu-conf.m4 | 248 ------------------------------------------ build/apu-ldap.m4 | 266 ++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 1 + 3 files changed, 267 insertions(+), 248 deletions(-) create mode 100644 build/apu-ldap.m4 diff --git a/build/apu-conf.m4 b/build/apu-conf.m4 index 0133b74bae8..61f27d83b77 100644 --- a/build/apu-conf.m4 +++ b/build/apu-conf.m4 @@ -47,254 +47,6 @@ AC_DEFUN([APU_FIND_APR], [ ]) -dnl -dnl Find a particular LDAP library -dnl -AC_DEFUN([APU_FIND_LDAPLIB], [ - if test ${apu_has_ldap} != "1"; then - ldaplib=$1 - extralib=$2 - # Clear the cache entry for subsequent APU_FIND_LDAPLIB invocations. - changequote(,) - ldaplib_cache_id="`echo $ldaplib | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - changequote([,]) - unset ac_cv_lib_${ldaplib_cache_id}_ldap_init - unset ac_cv_lib_${ldaplib_cache_id}___ldap_init - AC_CHECK_LIB(${ldaplib}, ldap_init, - [ - LDADD_ldap="-l${ldaplib} ${extralib}" - AC_CHECK_LIB(${ldaplib}, ldapssl_client_init, apu_has_ldapssl_client_init="1", , ${extralib}) - AC_CHECK_LIB(${ldaplib}, ldapssl_client_deinit, apu_has_ldapssl_client_deinit="1", , ${extralib}) - AC_CHECK_LIB(${ldaplib}, ldapssl_add_trusted_cert, apu_has_ldapssl_add_trusted_cert="1", , ${extralib}) - AC_CHECK_LIB(${ldaplib}, ldap_start_tls_s, apu_has_ldap_start_tls_s="1", , ${extralib}) - AC_CHECK_LIB(${ldaplib}, ldap_sslinit, apu_has_ldap_sslinit="1", , ${extralib}) - AC_CHECK_LIB(${ldaplib}, ldapssl_init, apu_has_ldapssl_init="1", , ${extralib}) - AC_CHECK_LIB(${ldaplib}, ldapssl_install_routines, apu_has_ldapssl_install_routines="1", , ${extralib}) - apu_has_ldap="1"; - ], , ${extralib}) - fi -]) - - -dnl -dnl APU_FIND_LDAP: figure out where LDAP is located -dnl -AC_DEFUN([APU_FIND_LDAP], [ - -echo $ac_n "${nl}checking for ldap support..." - -apu_has_ldap="0"; -apu_has_ldapssl_client_init="0" -apu_has_ldapssl_client_deinit="0" -apu_has_ldapssl_add_trusted_cert="0" -apu_has_ldap_start_tls_s="0" -apu_has_ldapssl_init="0" -apu_has_ldap_sslinit="0" -apu_has_ldapssl_install_routines="0" -apu_has_ldap_openldap="0" -apu_has_ldap_solaris="0" -apu_has_ldap_novell="0" -apu_has_ldap_microsoft="0" -apu_has_ldap_netscape="0" -apu_has_ldap_mozilla="0" -apu_has_ldap_tivoli="0" -apu_has_ldap_zos="0" -apu_has_ldap_other="0" -LDADD_ldap="" - -AC_ARG_WITH(lber,[ --with-lber=library lber library to use], - [ - if test "$withval" = "yes"; then - apu_liblber_name="lber" - else - apu_liblber_name="$withval" - fi - ], - [ - apu_liblber_name="lber" - ]) - -AC_ARG_WITH(ldap-include,[ --with-ldap-include=path path to ldap include files with trailing slash]) -AC_ARG_WITH(ldap-lib,[ --with-ldap-lib=path path to ldap lib file]) -AC_ARG_WITH(ldap,[ --with-ldap=library ldap library to use], - [ - if test "$with_ldap" != "no"; then - save_cppflags="$CPPFLAGS" - save_ldflags="$LDFLAGS" - save_libs="$LIBS" - if test -n "$with_ldap_include"; then - CPPFLAGS="$CPPFLAGS -I$with_ldap_include" - APR_ADDTO(INCLUDES, [-I$with_ldap_include]) - fi - if test -n "$with_ldap_lib"; then - APR_ADDTO(LDFLAGS, [-L$with_ldap_lib]) - fi - - LIBLDAP="$withval" - if test "$LIBLDAP" = "yes"; then - dnl The iPlanet C SDK 5.0 is as yet untested... - APU_FIND_LDAPLIB("ldap50", "-lnspr4 -lplc4 -lplds4 -liutil50 -llber50 -lldif50 -lnss3 -lprldap50 -lssl3 -lssldap50") - APU_FIND_LDAPLIB("ldapssl41", "-lnspr3 -lplc3 -lplds3") - APU_FIND_LDAPLIB("ldapssl40") - APU_FIND_LDAPLIB("ldapssl30") - APU_FIND_LDAPLIB("ldapssl20") - APU_FIND_LDAPLIB("ldapsdk", "-lldapx -lldapssl -lldapgss -lgssapi_krb5") - APU_FIND_LDAPLIB("ldapsdk", "-lldapx -lldapssl -lldapgss -lgss -lresolv -lsocket") - APU_FIND_LDAPLIB("ldap", "-llber") - APU_FIND_LDAPLIB("ldap", "-llber -lresolv") - APU_FIND_LDAPLIB("ldap", "-llber -lresolv -lsocket -lnsl") - APU_FIND_LDAPLIB("ldap", "-ldl -lpthread") - else - APU_FIND_LDAPLIB($LIBLDAP) - APU_FIND_LDAPLIB($LIBLDAP, "-lresolv") - APU_FIND_LDAPLIB($LIBLDAP, "-lresolv -lsocket -lnsl") - APU_FIND_LDAPLIB($LIBLDAP, "-ldl -lpthread") - fi - - test ${apu_has_ldap} != "1" && AC_MSG_ERROR(could not find an LDAP library) - AC_CHECK_LIB($apu_liblber_name, ber_init, - [LDADD_ldap="${LDADD_ldap} -l${apu_liblber_name}"]) - - AC_CHECK_HEADERS(lber.h, lber_h=["#include "]) - - # Solaris has a problem in which prevents it from - # being included by itself. Check for manually, - # including lber.h first. - AC_CACHE_CHECK([for ldap.h], [apr_cv_hdr_ldap_h], - [AC_TRY_CPP( - [#ifdef HAVE_LBER_H - #include - #endif - #include - ], [apr_cv_hdr_ldap_h=yes], [apr_cv_hdr_ldap_h=no])]) - if test "$apr_cv_hdr_ldap_h" = "yes"; then - ldap_h=["#include "] - AC_DEFINE([HAVE_LDAP_H], 1, [Defined if ldap.h is present]) - fi - - AC_CHECK_HEADERS(ldap_ssl.h, ldap_ssl_h=["#include "]) - - if test "$apr_cv_hdr_ldap_h" = "yes"; then - AC_CACHE_CHECK([for LDAP toolkit], - [apr_cv_ldap_toolkit], [ - if test "x$apr_cv_ldap_toolkit" = "x"; then - AC_EGREP_CPP([OpenLDAP], [$lber_h - $ldap_h - LDAP_VENDOR_NAME], [apu_has_ldap_openldap="1" - apr_cv_ldap_toolkit="OpenLDAP"]) - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - AC_EGREP_CPP([Sun Microsystems Inc.], [$lber_h - $ldap_h - LDAP_VENDOR_NAME], [apu_has_ldap_solaris="1" - apr_cv_ldap_toolkit="Solaris"]) - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - AC_EGREP_CPP([Novell], [$lber_h - $ldap_h - LDAP_VENDOR_NAME], [apu_has_ldap_novell="1" - apr_cv_ldap_toolkit="Novell"]) - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - AC_EGREP_CPP([Microsoft Corporation.], [$lber_h - $ldap_h - LDAP_VENDOR_NAME], [apu_has_ldap_microsoft="1" - apr_cv_ldap_toolkit="Microsoft"]) - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - AC_EGREP_CPP([Netscape Communications Corp.], [$lber_h - $ldap_h - LDAP_VENDOR_NAME], [apu_has_ldap_netscape="1" - apr_cv_ldap_toolkit="Netscape"]) - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - AC_EGREP_CPP([mozilla.org], [$lber_h - $ldap_h - LDAP_VENDOR_NAME], [apu_has_ldap_mozilla="1" - apr_cv_ldap_toolkit="Mozilla"]) - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - AC_EGREP_CPP([International Business Machines], [$lber_h - $ldap_h - LDAP_VENDOR_NAME], [apu_has_ldap_tivoli="1" - apr_cv_ldap_toolkit="Tivoli"]) - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - case "$host" in - *-ibm-os390) - AC_EGREP_CPP([IBM], [$lber_h - $ldap_h], [apu_has_ldap_zos="1" - apr_cv_ldap_toolkit="z/OS"]) - ;; - esac - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - apu_has_ldap_other="1" - apr_cv_ldap_toolkit="unknown" - fi - ]) - fi - - CPPFLAGS=$save_cppflags - LDFLAGS=$save_ldflags - LIBS=$save_libs - fi - ]) - -if test "$apu_has_ldap_openldap" = "1"; then - save_cppflags="$CPPFLAGS" - save_ldflags="$LDFLAGS" - save_libs="$LIBS" - - CPPFLAGS="$CPPFLAGS $INCLUDES" - AC_CACHE_CHECK([style of ldap_set_rebind_proc routine], ac_cv_ldap_set_rebind_proc_style, - APR_TRY_COMPILE_NO_WARNING([ - #ifdef HAVE_LBER_H - #include - #endif - #ifdef HAVE_LDAP_H - #include - #endif - ], [ - int tmp = ldap_set_rebind_proc((LDAP *)0, (LDAP_REBIND_PROC *)0, (void *)0); - /* use tmp to suppress the warning */ - tmp=0; - ], ac_cv_ldap_set_rebind_proc_style=three, ac_cv_ldap_set_rebind_proc_style=two)) - - if test "$ac_cv_ldap_set_rebind_proc_style" = "three"; then - AC_DEFINE(LDAP_SET_REBIND_PROC_THREE, 1, [Define if ldap_set_rebind_proc takes three arguments]) - fi - - CPPFLAGS="$save_cppflags" - LDFLAGS="$save_ldflags" - LIBS="$save_libs" -fi - -AC_SUBST(ldap_h) -AC_SUBST(lber_h) -AC_SUBST(ldap_ssl_h) -AC_SUBST(apu_has_ldapssl_client_init) -AC_SUBST(apu_has_ldapssl_client_deinit) -AC_SUBST(apu_has_ldapssl_add_trusted_cert) -AC_SUBST(apu_has_ldap_start_tls_s) -AC_SUBST(apu_has_ldapssl_init) -AC_SUBST(apu_has_ldap_sslinit) -AC_SUBST(apu_has_ldapssl_install_routines) -AC_SUBST(apu_has_ldap) -AC_SUBST(apu_has_ldap_openldap) -AC_SUBST(apu_has_ldap_solaris) -AC_SUBST(apu_has_ldap_novell) -AC_SUBST(apu_has_ldap_microsoft) -AC_SUBST(apu_has_ldap_netscape) -AC_SUBST(apu_has_ldap_mozilla) -AC_SUBST(apu_has_ldap_tivoli) -AC_SUBST(apu_has_ldap_zos) -AC_SUBST(apu_has_ldap_other) -AC_SUBST(LDADD_ldap) -AC_SUBST(APRUTIL_EXPORT_LIBS) - -]) - dnl dnl APU_CHECK_CRYPT_R_STYLE dnl diff --git a/build/apu-ldap.m4 b/build/apu-ldap.m4 new file mode 100644 index 00000000000..9bff35620dd --- /dev/null +++ b/build/apu-ldap.m4 @@ -0,0 +1,266 @@ +dnl -------------------------------------------------------- -*- autoconf -*- +dnl Licensed to the Apache Software Foundation (ASF) under one or more +dnl contributor license agreements. See the NOTICE file distributed with +dnl this work for additional information regarding copyright ownership. +dnl The ASF licenses this file to You under the Apache License, Version 2.0 +dnl (the "License"); you may not use this file except in compliance with +dnl the License. You may obtain a copy of the License at +dnl +dnl http://www.apache.org/licenses/LICENSE-2.0 +dnl +dnl Unless required by applicable law or agreed to in writing, software +dnl distributed under the License is distributed on an "AS IS" BASIS, +dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +dnl See the License for the specific language governing permissions and +dnl limitations under the License. + + +dnl +dnl Find a particular LDAP library +dnl +AC_DEFUN([APU_FIND_LDAPLIB], [ + if test ${apu_has_ldap} != "1"; then + ldaplib=$1 + extralib=$2 + # Clear the cache entry for subsequent APU_FIND_LDAPLIB invocations. + changequote(,) + ldaplib_cache_id="`echo $ldaplib | sed -e 's/[^a-zA-Z0-9_]/_/g'`" + changequote([,]) + unset ac_cv_lib_${ldaplib_cache_id}_ldap_init + unset ac_cv_lib_${ldaplib_cache_id}___ldap_init + AC_CHECK_LIB(${ldaplib}, ldap_init, + [ + LDADD_ldap="-l${ldaplib} ${extralib}" + AC_CHECK_LIB(${ldaplib}, ldapssl_client_init, apu_has_ldapssl_client_init="1", , ${extralib}) + AC_CHECK_LIB(${ldaplib}, ldapssl_client_deinit, apu_has_ldapssl_client_deinit="1", , ${extralib}) + AC_CHECK_LIB(${ldaplib}, ldapssl_add_trusted_cert, apu_has_ldapssl_add_trusted_cert="1", , ${extralib}) + AC_CHECK_LIB(${ldaplib}, ldap_start_tls_s, apu_has_ldap_start_tls_s="1", , ${extralib}) + AC_CHECK_LIB(${ldaplib}, ldap_sslinit, apu_has_ldap_sslinit="1", , ${extralib}) + AC_CHECK_LIB(${ldaplib}, ldapssl_init, apu_has_ldapssl_init="1", , ${extralib}) + AC_CHECK_LIB(${ldaplib}, ldapssl_install_routines, apu_has_ldapssl_install_routines="1", , ${extralib}) + apu_has_ldap="1"; + ], , ${extralib}) + fi +]) + + +dnl +dnl APU_FIND_LDAP: figure out where LDAP is located +dnl +AC_DEFUN([APU_FIND_LDAP], [ + +echo $ac_n "${nl}checking for ldap support..." + +apu_has_ldap="0"; +apu_has_ldapssl_client_init="0" +apu_has_ldapssl_client_deinit="0" +apu_has_ldapssl_add_trusted_cert="0" +apu_has_ldap_start_tls_s="0" +apu_has_ldapssl_init="0" +apu_has_ldap_sslinit="0" +apu_has_ldapssl_install_routines="0" +apu_has_ldap_openldap="0" +apu_has_ldap_solaris="0" +apu_has_ldap_novell="0" +apu_has_ldap_microsoft="0" +apu_has_ldap_netscape="0" +apu_has_ldap_mozilla="0" +apu_has_ldap_tivoli="0" +apu_has_ldap_zos="0" +apu_has_ldap_other="0" +LDADD_ldap="" + +AC_ARG_WITH(lber,[ --with-lber=library lber library to use], + [ + if test "$withval" = "yes"; then + apu_liblber_name="lber" + else + apu_liblber_name="$withval" + fi + ], + [ + apu_liblber_name="lber" + ]) + +AC_ARG_WITH(ldap-include,[ --with-ldap-include=path path to ldap include files with trailing slash]) +AC_ARG_WITH(ldap-lib,[ --with-ldap-lib=path path to ldap lib file]) +AC_ARG_WITH(ldap,[ --with-ldap=library ldap library to use], + [ + if test "$with_ldap" != "no"; then + save_cppflags="$CPPFLAGS" + save_ldflags="$LDFLAGS" + save_libs="$LIBS" + if test -n "$with_ldap_include"; then + CPPFLAGS="$CPPFLAGS -I$with_ldap_include" + APR_ADDTO(INCLUDES, [-I$with_ldap_include]) + fi + if test -n "$with_ldap_lib"; then + APR_ADDTO(LDFLAGS, [-L$with_ldap_lib]) + fi + + LIBLDAP="$withval" + if test "$LIBLDAP" = "yes"; then + dnl The iPlanet C SDK 5.0 is as yet untested... + APU_FIND_LDAPLIB("ldap50", "-lnspr4 -lplc4 -lplds4 -liutil50 -llber50 -lldif50 -lnss3 -lprldap50 -lssl3 -lssldap50") + APU_FIND_LDAPLIB("ldapssl41", "-lnspr3 -lplc3 -lplds3") + APU_FIND_LDAPLIB("ldapssl40") + APU_FIND_LDAPLIB("ldapssl30") + APU_FIND_LDAPLIB("ldapssl20") + APU_FIND_LDAPLIB("ldapsdk", "-lldapx -lldapssl -lldapgss -lgssapi_krb5") + APU_FIND_LDAPLIB("ldapsdk", "-lldapx -lldapssl -lldapgss -lgss -lresolv -lsocket") + APU_FIND_LDAPLIB("ldap", "-llber") + APU_FIND_LDAPLIB("ldap", "-llber -lresolv") + APU_FIND_LDAPLIB("ldap", "-llber -lresolv -lsocket -lnsl") + APU_FIND_LDAPLIB("ldap", "-ldl -lpthread") + else + APU_FIND_LDAPLIB($LIBLDAP) + APU_FIND_LDAPLIB($LIBLDAP, "-lresolv") + APU_FIND_LDAPLIB($LIBLDAP, "-lresolv -lsocket -lnsl") + APU_FIND_LDAPLIB($LIBLDAP, "-ldl -lpthread") + fi + + test ${apu_has_ldap} != "1" && AC_MSG_ERROR(could not find an LDAP library) + AC_CHECK_LIB($apu_liblber_name, ber_init, + [LDADD_ldap="${LDADD_ldap} -l${apu_liblber_name}"]) + + AC_CHECK_HEADERS(lber.h, lber_h=["#include "]) + + # Solaris has a problem in which prevents it from + # being included by itself. Check for manually, + # including lber.h first. + AC_CACHE_CHECK([for ldap.h], [apr_cv_hdr_ldap_h], + [AC_TRY_CPP( + [#ifdef HAVE_LBER_H + #include + #endif + #include + ], [apr_cv_hdr_ldap_h=yes], [apr_cv_hdr_ldap_h=no])]) + if test "$apr_cv_hdr_ldap_h" = "yes"; then + ldap_h=["#include "] + AC_DEFINE([HAVE_LDAP_H], 1, [Defined if ldap.h is present]) + fi + + AC_CHECK_HEADERS(ldap_ssl.h, ldap_ssl_h=["#include "]) + + if test "$apr_cv_hdr_ldap_h" = "yes"; then + AC_CACHE_CHECK([for LDAP toolkit], + [apr_cv_ldap_toolkit], [ + if test "x$apr_cv_ldap_toolkit" = "x"; then + AC_EGREP_CPP([OpenLDAP], [$lber_h + $ldap_h + LDAP_VENDOR_NAME], [apu_has_ldap_openldap="1" + apr_cv_ldap_toolkit="OpenLDAP"]) + fi + if test "x$apr_cv_ldap_toolkit" = "x"; then + AC_EGREP_CPP([Sun Microsystems Inc.], [$lber_h + $ldap_h + LDAP_VENDOR_NAME], [apu_has_ldap_solaris="1" + apr_cv_ldap_toolkit="Solaris"]) + fi + if test "x$apr_cv_ldap_toolkit" = "x"; then + AC_EGREP_CPP([Novell], [$lber_h + $ldap_h + LDAP_VENDOR_NAME], [apu_has_ldap_novell="1" + apr_cv_ldap_toolkit="Novell"]) + fi + if test "x$apr_cv_ldap_toolkit" = "x"; then + AC_EGREP_CPP([Microsoft Corporation.], [$lber_h + $ldap_h + LDAP_VENDOR_NAME], [apu_has_ldap_microsoft="1" + apr_cv_ldap_toolkit="Microsoft"]) + fi + if test "x$apr_cv_ldap_toolkit" = "x"; then + AC_EGREP_CPP([Netscape Communications Corp.], [$lber_h + $ldap_h + LDAP_VENDOR_NAME], [apu_has_ldap_netscape="1" + apr_cv_ldap_toolkit="Netscape"]) + fi + if test "x$apr_cv_ldap_toolkit" = "x"; then + AC_EGREP_CPP([mozilla.org], [$lber_h + $ldap_h + LDAP_VENDOR_NAME], [apu_has_ldap_mozilla="1" + apr_cv_ldap_toolkit="Mozilla"]) + fi + if test "x$apr_cv_ldap_toolkit" = "x"; then + AC_EGREP_CPP([International Business Machines], [$lber_h + $ldap_h + LDAP_VENDOR_NAME], [apu_has_ldap_tivoli="1" + apr_cv_ldap_toolkit="Tivoli"]) + fi + if test "x$apr_cv_ldap_toolkit" = "x"; then + case "$host" in + *-ibm-os390) + AC_EGREP_CPP([IBM], [$lber_h + $ldap_h], [apu_has_ldap_zos="1" + apr_cv_ldap_toolkit="z/OS"]) + ;; + esac + fi + if test "x$apr_cv_ldap_toolkit" = "x"; then + apu_has_ldap_other="1" + apr_cv_ldap_toolkit="unknown" + fi + ]) + fi + + CPPFLAGS=$save_cppflags + LDFLAGS=$save_ldflags + LIBS=$save_libs + fi + ]) + +if test "$apu_has_ldap_openldap" = "1"; then + save_cppflags="$CPPFLAGS" + save_ldflags="$LDFLAGS" + save_libs="$LIBS" + + CPPFLAGS="$CPPFLAGS $INCLUDES" + AC_CACHE_CHECK([style of ldap_set_rebind_proc routine], ac_cv_ldap_set_rebind_proc_style, + APR_TRY_COMPILE_NO_WARNING([ + #ifdef HAVE_LBER_H + #include + #endif + #ifdef HAVE_LDAP_H + #include + #endif + ], [ + int tmp = ldap_set_rebind_proc((LDAP *)0, (LDAP_REBIND_PROC *)0, (void *)0); + /* use tmp to suppress the warning */ + tmp=0; + ], ac_cv_ldap_set_rebind_proc_style=three, ac_cv_ldap_set_rebind_proc_style=two)) + + if test "$ac_cv_ldap_set_rebind_proc_style" = "three"; then + AC_DEFINE(LDAP_SET_REBIND_PROC_THREE, 1, [Define if ldap_set_rebind_proc takes three arguments]) + fi + + CPPFLAGS="$save_cppflags" + LDFLAGS="$save_ldflags" + LIBS="$save_libs" +fi + +AC_SUBST(ldap_h) +AC_SUBST(lber_h) +AC_SUBST(ldap_ssl_h) +AC_SUBST(apu_has_ldapssl_client_init) +AC_SUBST(apu_has_ldapssl_client_deinit) +AC_SUBST(apu_has_ldapssl_add_trusted_cert) +AC_SUBST(apu_has_ldap_start_tls_s) +AC_SUBST(apu_has_ldapssl_init) +AC_SUBST(apu_has_ldap_sslinit) +AC_SUBST(apu_has_ldapssl_install_routines) +AC_SUBST(apu_has_ldap) +AC_SUBST(apu_has_ldap_openldap) +AC_SUBST(apu_has_ldap_solaris) +AC_SUBST(apu_has_ldap_novell) +AC_SUBST(apu_has_ldap_microsoft) +AC_SUBST(apu_has_ldap_netscape) +AC_SUBST(apu_has_ldap_mozilla) +AC_SUBST(apu_has_ldap_tivoli) +AC_SUBST(apu_has_ldap_zos) +AC_SUBST(apu_has_ldap_other) +AC_SUBST(LDADD_ldap) +AC_SUBST(APRUTIL_EXPORT_LIBS) + +]) + + diff --git a/configure.in b/configure.in index c9dfc7a8aa6..f4e7c867623 100644 --- a/configure.in +++ b/configure.in @@ -27,6 +27,7 @@ sinclude(build/ltversion.m4) sinclude(build/lt~obsolete.m4) sinclude(build/apu-conf.m4) +sinclude(build/apu-ldap.m4) sinclude(build/xml.m4) sinclude(build/apu-hints.m4) sinclude(build/crypto.m4) From 1a23f1fed3ee03411804570d403bcfe8afa1f1c7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 29 May 2011 20:35:41 +0000 Subject: [PATCH 7042/7878] Fix badly misplaced SUBST git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1128947 13f79535-47bb-0310-9956-ffa450edef68 --- build/apu-ldap.m4 | 1 - configure.in | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build/apu-ldap.m4 b/build/apu-ldap.m4 index 9bff35620dd..59f66afd2ee 100644 --- a/build/apu-ldap.m4 +++ b/build/apu-ldap.m4 @@ -259,7 +259,6 @@ AC_SUBST(apu_has_ldap_tivoli) AC_SUBST(apu_has_ldap_zos) AC_SUBST(apu_has_ldap_other) AC_SUBST(LDADD_ldap) -AC_SUBST(APRUTIL_EXPORT_LIBS) ]) diff --git a/configure.in b/configure.in index f4e7c867623..ee46957a470 100644 --- a/configure.in +++ b/configure.in @@ -2664,6 +2664,10 @@ AC_SUBST(APR_DSO_LIBDIR) AC_SUBST(APR_DSO_MODULES) AC_SUBST(EXTRA_OBJECTS) +dnl XXX FIXME; used for -lexpat, -liconv etc? +AC_SUBST(APRUTIL_EXPORT_LIBS) + + dnl dnl Prep all the flags and stuff for compilation and export to other builds dnl From 4418d8606664213b547e5e618d198796929ef3dd Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 30 May 2011 23:30:24 +0000 Subject: [PATCH 7043/7878] apr_crypto: Add apr_crypto_get_block_key_types() and apr_crypto_get_block_key_modes() to provide a way to programmatically query what key types and modes are supported by a provider, either per mode/type, or by iterating through a hashtable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1129433 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 28 +++++ crypto/apr_crypto_nss.c | 56 +++++++++ crypto/apr_crypto_openssl.c | 67 ++++++++++- include/apr_crypto.h | 23 ++++ include/private/apr_crypto_internal.h | 22 ++++ test/testcrypto.c | 164 ++++++++++++++++++++++++++ 6 files changed, 357 insertions(+), 3 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 89ab566c805..9162e52baa5 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -234,6 +234,34 @@ APR_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, const apr_crypto_dri return driver->make(f, driver, params, pool); } +/** + * @brief Get a hash table of key types, keyed by the name of the type against + * an integer pointer constant. + * + * @param types - hashtable of key types keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +APR_DECLARE(apr_status_t) apr_crypto_get_block_key_types(apr_hash_t **types, + const apr_crypto_t *f) +{ + return f->provider->get_block_key_types(types, f); +} + +/** + * @brief Get a hash table of key modes, keyed by the name of the mode against + * an integer pointer constant. + * + * @param modes - hashtable of key modes keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +APR_DECLARE(apr_status_t) apr_crypto_get_block_key_modes(apr_hash_t **modes, + const apr_crypto_t *f) +{ + return f->provider->get_block_key_modes(modes, f); +} + /** * @brief Create a key from the given passphrase. By default, the PBKDF2 * algorithm is used to generate the key from the passphrase. It is expected diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index fafa4f4082e..3c9339f0410 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -51,6 +51,8 @@ struct apr_crypto_t { apu_err_t *result; apr_array_header_t *keys; apr_crypto_config_t *config; + apr_hash_t *types; + apr_hash_t *modes; }; struct apr_crypto_config_t { @@ -75,6 +77,14 @@ struct apr_crypto_block_t { int blockSize; }; +static int key_3des_192 = APR_KEY_3DES_192; +static int key_aes_128 = APR_KEY_AES_128; +static int key_aes_192 = APR_KEY_AES_192; +static int key_aes_256 = APR_KEY_AES_256; + +static int mode_ecb = APR_MODE_ECB; +static int mode_cbc = APR_MODE_CBC; + /** * Fetch the most recent error from this driver. */ @@ -255,6 +265,22 @@ static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *pr f->keys = apr_array_make(pool, 10, sizeof(apr_crypto_key_t)); + f->types = apr_hash_make(pool); + if (!f->types) { + return APR_ENOMEM; + } + apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_3des_192)); + apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_aes_128)); + apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_aes_192)); + apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_aes_256)); + + f->modes = apr_hash_make(pool); + if (!f->modes) { + return APR_ENOMEM; + } + apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(mode_ecb)); + apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(mode_cbc)); + apr_pool_cleanup_register(pool, f, crypto_cleanup_helper, apr_pool_cleanup_null); @@ -276,6 +302,34 @@ static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *pr } +/** + * @brief Get a hash table of key types, keyed by the name of the type against + * an integer pointer constant. + * + * @param types - hashtable of key types keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +static apr_status_t crypto_get_block_key_types(apr_hash_t **types, + const apr_crypto_t *f) +{ + *types = f->types; +} + +/** + * @brief Get a hash table of key modes, keyed by the name of the mode against + * an integer pointer constant. + * + * @param modes - hashtable of key modes keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +static apr_status_t crypto_get_block_key_modes(apr_hash_t **modes, + const apr_crypto_t *f) +{ + *modes = f->modes; +} + /** * @brief Create a key from the given passphrase. By default, the PBKDF2 * algorithm is used to generate the key from the passphrase. It is expected @@ -767,6 +821,8 @@ APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_nss_driver = { "nss", crypto_init, crypto_make, + crypto_get_block_key_types, + crypto_get_block_key_modes, crypto_passphrase, crypto_block_encrypt_init, crypto_block_encrypt, diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index ade9ada90e8..e6efebc46db 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -41,6 +41,8 @@ struct apr_crypto_t { apu_err_t *result; apr_array_header_t *keys; apr_crypto_config_t *config; + apr_hash_t *types; + apr_hash_t *modes; }; struct apr_crypto_config_t { @@ -69,6 +71,14 @@ struct apr_crypto_block_t { int doPad; }; +static int key_3des_192 = APR_KEY_3DES_192; +static int key_aes_128 = APR_KEY_AES_128; +static int key_aes_192 = APR_KEY_AES_192; +static int key_aes_256 = APR_KEY_AES_256; + +static int mode_ecb = APR_MODE_ECB; +static int mode_cbc = APR_MODE_CBC; + /** * Fetch the most recent error from this driver. */ @@ -184,11 +194,32 @@ static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *pr if (!config) { return APR_ENOMEM; } + f->result = apr_pcalloc(pool, sizeof(apu_err_t)); if (!f->result) { return APR_ENOMEM; } + f->keys = apr_array_make(pool, 10, sizeof(apr_crypto_key_t)); + if (!f->keys) { + return APR_ENOMEM; + } + + f->types = apr_hash_make(pool); + if (!f->types) { + return APR_ENOMEM; + } + apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_3des_192)); + apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_aes_128)); + apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_aes_192)); + apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_aes_256)); + + f->modes = apr_hash_make(pool); + if (!f->modes) { + return APR_ENOMEM; + } + apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(mode_ecb)); + apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(mode_cbc)); apr_pool_cleanup_register(pool, f, crypto_cleanup_helper, apr_pool_cleanup_null); @@ -213,6 +244,34 @@ static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *pr } +/** + * @brief Get a hash table of key types, keyed by the name of the type against + * an integer pointer constant. + * + * @param types - hashtable of key types keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +static apr_status_t crypto_get_block_key_types(apr_hash_t **types, + const apr_crypto_t *f) +{ + *types = f->types; +} + +/** + * @brief Get a hash table of key modes, keyed by the name of the mode against + * an integer pointer constant. + * + * @param modes - hashtable of key modes keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +static apr_status_t crypto_get_block_key_modes(apr_hash_t **modes, + const apr_crypto_t *f) +{ + *modes = f->modes; +} + /** * @brief Create a key from the given passphrase. By default, the PBKDF2 * algorithm is used to generate the key from the passphrase. It is expected @@ -664,11 +723,13 @@ static apr_status_t crypto_block_decrypt_finish(unsigned char *out, /** * OpenSSL module. */ -APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_openssl_driver = { - "openssl", crypto_init, crypto_make, crypto_passphrase, +APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_openssl_driver = +{ "openssl", crypto_init, crypto_make, crypto_get_block_key_types, + crypto_get_block_key_modes, crypto_passphrase, crypto_block_encrypt_init, crypto_block_encrypt, crypto_block_encrypt_finish, crypto_block_decrypt_init, crypto_block_decrypt, crypto_block_decrypt_finish, - crypto_block_cleanup, crypto_cleanup, crypto_shutdown, crypto_error }; + crypto_block_cleanup, crypto_cleanup, crypto_shutdown, crypto_error +}; #endif diff --git a/include/apr_crypto.h b/include/apr_crypto.h index dc335ff5aa1..8a96de355d7 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -20,6 +20,7 @@ #include "apu.h" #include "apr_pools.h" #include "apr_tables.h" +#include "apr_hash.h" #include "apu_errno.h" #ifdef __cplusplus @@ -241,6 +242,28 @@ APR_DECLARE(apr_status_t) apr_crypto_error(const apu_err_t **result, APR_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, const apr_crypto_driver_t *driver, const apr_array_header_t *params, apr_pool_t *pool); +/** + * @brief Get a hash table of key types, keyed by the name of the type against + * an integer pointer constant. + * + * @param types - hashtable of key types keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +APR_DECLARE(apr_status_t) apr_crypto_get_block_key_types(apr_hash_t **types, + const apr_crypto_t *f); + +/** + * @brief Get a hash table of key modes, keyed by the name of the mode against + * an integer pointer constant. + * + * @param modes - hashtable of key modes keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +APR_DECLARE(apr_status_t) apr_crypto_get_block_key_modes(apr_hash_t **modes, + const apr_crypto_t *f); + /** * @brief Create a key from the given passphrase. By default, the PBKDF2 * algorithm is used to generate the key from the passphrase. It is expected diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index 4bb670ae841..1d9e169d9dd 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -56,6 +56,28 @@ struct apr_crypto_driver_t { apr_status_t (*make)(apr_crypto_t **f, const apr_crypto_driver_t *provider, const apr_array_header_t *params, apr_pool_t *pool); + /** + * @brief Get a hash table of key types, keyed by the name of the type against + * an integer pointer constant. + * + * @param types - hashtable of key types keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ + apr_status_t (*get_block_key_types)(apr_hash_t **types, + const apr_crypto_t *f); + + /** + * @brief Get a hash table of key modes, keyed by the name of the mode against + * an integer pointer constant. + * + * @param modes - hashtable of key modes keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ + apr_status_t (*get_block_key_modes)(apr_hash_t **modes, + const apr_crypto_t *f); + /** * @brief Create a key from the given passphrase. By default, the PBKDF2 * algorithm is used to generate the key from the passphrase. It is expected diff --git a/test/testcrypto.c b/test/testcrypto.c index 7863da40f01..9e7626b7cca 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -662,6 +662,158 @@ static void test_crypto_block_openssl_nss_pad(abts_case *tc, void *data) { } +/** + * Get Types, OpenSSL. + */ +static void test_crypto_get_block_key_types_openssl(abts_case *tc, void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *driver; + apr_crypto_t *f; + apr_hash_t *types; + int *key_3des_192; + int *key_aes_128; + int *key_aes_192; + int *key_aes_256; + + apr_pool_create(&pool, NULL); + driver = get_openssl_driver(tc, pool); + if (driver) { + + f = make(tc, pool, driver); + apr_crypto_get_block_key_types(&types, f); + + key_3des_192 = apr_hash_get(types, "3des192", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, key_3des_192); + ABTS_INT_EQUAL(tc, *key_3des_192, APR_KEY_3DES_192); + + key_aes_128 = apr_hash_get(types, "aes128", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, key_aes_128); + ABTS_INT_EQUAL(tc, *key_aes_128, APR_KEY_AES_128); + + key_aes_192 = apr_hash_get(types, "aes192", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, key_aes_192); + ABTS_INT_EQUAL(tc, *key_aes_192, APR_KEY_AES_192); + + key_aes_256 = apr_hash_get(types, "aes256", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, key_aes_256); + ABTS_INT_EQUAL(tc, *key_aes_256, APR_KEY_AES_256); + + } + + apr_pool_destroy(pool); + +} + +/** + * Get Types, NSS. + */ +static void test_crypto_get_block_key_types_nss(abts_case *tc, void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *driver; + apr_crypto_t *f; + apr_hash_t *types; + int *key_3des_192; + int *key_aes_128; + int *key_aes_192; + int *key_aes_256; + + apr_pool_create(&pool, NULL); + driver = get_nss_driver(tc, pool); + if (driver) { + + f = make(tc, pool, driver); + apr_crypto_get_block_key_types(&types, f); + + key_3des_192 = apr_hash_get(types, "3des192", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, key_3des_192); + ABTS_INT_EQUAL(tc, *key_3des_192, APR_KEY_3DES_192); + + key_aes_128 = apr_hash_get(types, "aes128", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, key_aes_128); + ABTS_INT_EQUAL(tc, *key_aes_128, APR_KEY_AES_128); + + key_aes_192 = apr_hash_get(types, "aes192", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, key_aes_192); + ABTS_INT_EQUAL(tc, *key_aes_192, APR_KEY_AES_192); + + key_aes_256 = apr_hash_get(types, "aes256", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, key_aes_256); + ABTS_INT_EQUAL(tc, *key_aes_256, APR_KEY_AES_256); + + } + + apr_pool_destroy(pool); + +} + +/** + * Get Modes, OpenSSL. + */ +static void test_crypto_get_block_key_modes_openssl(abts_case *tc, void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *driver; + apr_crypto_t *f; + apr_hash_t *modes; + int *mode_ecb; + int *mode_cbc; + + apr_pool_create(&pool, NULL); + driver = get_openssl_driver(tc, pool); + if (driver) { + + f = make(tc, pool, driver); + apr_crypto_get_block_key_modes(&modes, f); + + mode_ecb = apr_hash_get(modes, "ecb", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, mode_ecb); + ABTS_INT_EQUAL(tc, *mode_ecb, APR_MODE_ECB); + + mode_cbc = apr_hash_get(modes, "cbc", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, mode_cbc); + ABTS_INT_EQUAL(tc, *mode_cbc, APR_MODE_CBC); + + } + + apr_pool_destroy(pool); + +} + +/** + * Get Modes, NSS. + */ +static void test_crypto_get_block_key_modes_nss(abts_case *tc, void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *driver; + apr_crypto_t *f; + apr_hash_t *modes; + int *mode_ecb; + int *mode_cbc; + + apr_pool_create(&pool, NULL); + driver = get_nss_driver(tc, pool); + if (driver) { + + f = make(tc, pool, driver); + apr_crypto_get_block_key_modes(&modes, f); + + mode_ecb = apr_hash_get(modes, "ecb", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, mode_ecb); + ABTS_INT_EQUAL(tc, *mode_ecb, APR_MODE_ECB); + + mode_cbc = apr_hash_get(modes, "cbc", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, mode_cbc); + ABTS_INT_EQUAL(tc, *mode_cbc, APR_MODE_CBC); + + } + + apr_pool_destroy(pool); + +} + abts_suite *testcrypto(abts_suite *suite) { suite = ADD_SUITE(suite); @@ -692,6 +844,18 @@ abts_suite *testcrypto(abts_suite *suite) { /* test padded encrypt openssl / decrypt nss */ abts_run_test(suite, test_crypto_block_openssl_nss_pad, NULL); + /* test block key types openssl */ + abts_run_test(suite, test_crypto_get_block_key_types_openssl, NULL); + + /* test block key types nss */ + abts_run_test(suite, test_crypto_get_block_key_types_nss, NULL); + + /* test block key modes openssl */ + abts_run_test(suite, test_crypto_get_block_key_modes_openssl, NULL); + + /* test block key modes nss */ + abts_run_test(suite, test_crypto_get_block_key_modes_nss, NULL); + return suite; } From aa96741e0ab079075cd79d1651813dafbbb75bae Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 31 May 2011 17:11:33 +0000 Subject: [PATCH 7044/7878] Drop the incomplete LDAP abstraction layer from APR 2.0 as decided on-list. It was not possible to use this interface without ldap provider internals. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1129809 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 - Makefile.in | 1 - README | 7 +- SConscript | 2 +- STATUS | 4 - apr-config.in | 5 - apr.dsp | 79 ---- build.conf | 10 +- build/aprenv.py | 14 - build/apu-ldap.m4 | 265 ----------- build/dso.m4 | 6 - build/nw_export.h | 5 - build/rpm/apr.spec.in | 15 +- configure.in | 6 - include/apr_crypto.h | 4 +- include/apr_ldap.h.in | 197 -------- include/apr_ldap.hnw | 158 ------- include/apr_ldap.hw | 197 -------- include/apr_ldap_init.h | 165 ------- include/apr_ldap_option.h | 254 ----------- include/apr_ldap_rebind.h | 98 ---- include/apr_ldap_url.h | 120 ----- include/arch/netware/apr_private.h | 1 - include/private/apu_internal.h | 29 +- ldap/apr_ldap.dsp | 227 ---------- ldap/apr_ldap_init.c | 219 --------- ldap/apr_ldap_option.c | 672 ---------------------------- ldap/apr_ldap_rebind.c | 375 ---------------- ldap/apr_ldap_stub.c | 145 ------ ldap/apr_ldap_url.c | 694 ----------------------------- libapr.dsp | 79 ---- misc/netware/start.c | 4 - test/Makefile.in | 8 +- test/Makefile.win | 1 - test/abts_tests.h | 1 - test/testldap.c | 250 ----------- test/testutil.h | 1 - 37 files changed, 13 insertions(+), 4308 deletions(-) delete mode 100644 build/apu-ldap.m4 delete mode 100644 include/apr_ldap.h.in delete mode 100644 include/apr_ldap.hnw delete mode 100644 include/apr_ldap.hw delete mode 100644 include/apr_ldap_init.h delete mode 100644 include/apr_ldap_option.h delete mode 100644 include/apr_ldap_rebind.h delete mode 100644 include/apr_ldap_url.h delete mode 100644 ldap/apr_ldap.dsp delete mode 100644 ldap/apr_ldap_init.c delete mode 100644 ldap/apr_ldap_option.c delete mode 100644 ldap/apr_ldap_rebind.c delete mode 100644 ldap/apr_ldap_stub.c delete mode 100644 ldap/apr_ldap_url.c delete mode 100644 test/testldap.c diff --git a/CHANGES b/CHANGES index 13923a72b90..3904d4b552f 100644 --- a/CHANGES +++ b/CHANGES @@ -27,9 +27,6 @@ Changes for APR 2.0.0 pipe in non blocking module through the APR_FOPEN_NONBLOCK flag. [Graham Leggett] - *) Enable per-connection LDAP client certificates for - openldap by requesting a new SSL context. [Eric Covener] - *) Support connecttimeout, readtimeout and writetimeout MySQL options PR 48251 [Marko Kevac ] diff --git a/Makefile.in b/Makefile.in index adf313b431c..afac20873ba 100644 --- a/Makefile.in +++ b/Makefile.in @@ -79,7 +79,6 @@ LDADD_dbd_odbc = @LDADD_dbd_odbc@ LDADD_dbm_db = @LDADD_dbm_db@ LDADD_dbm_gdbm = @LDADD_dbm_gdbm@ LDADD_dbm_ndbm = @LDADD_dbm_ndbm@ -LDADD_ldap = @LDADD_ldap@ LDADD_crypto_openssl = @LDADD_crypto_openssl@ LDADD_crypto_nss = @LDADD_crypto_nss@ diff --git a/README b/README index 1358063e713..4222d61580e 100644 --- a/README +++ b/README @@ -43,7 +43,6 @@ Apache Portable Runtime Library (APR) Multiple SQL DBD client interfaces Multiple flat-database DBM client interfaces Typesafe function Hooks abstraction - LDAP SSL connections for a variety of LDAP toolkits MemCache interface Date parsing rourtines Resource Lists @@ -228,8 +227,6 @@ code and source code. The following provides more details on the included cryptographic software: - APR-Util provides an abstract interface for SSL encrypted LDAP (ldaps - and STARTTLS style) connections, which can be powered by OpenLDAP, - Netscape LDAP SDK, Mozilla LDAP SDK, or other platform specific ldap - interfaces. + APR provides an abstract interface for SSL cryptographic functions, + specifically @bug XXX Fill This In XXX! diff --git a/SConscript b/SConscript index 4f98e7b585e..b2c60a8a991 100644 --- a/SConscript +++ b/SConscript @@ -18,7 +18,7 @@ tests = Split(""" testatomic.c testflock.c testsock.c testglobalmutex.c teststrnatcmp.c testfilecopy.c testtemp.c testlfs.c testcond.c testuri.c testmemcache.c testdate.c - testxlate.c testdbd.c testrmm.c testldap.c testmd4.c + testxlate.c testdbd.c testrmm.c testmd4.c teststrmatch.c testpass.c testcrypto.c testqueue.c testbuckets.c testxml.c testdbm.c testuuid.c testmd5.c testreslist.c dbd.c diff --git a/STATUS b/STATUS index 038c383e287..ab252fac608 100644 --- a/STATUS +++ b/STATUS @@ -108,10 +108,6 @@ Contributors looking for a mission: RELEASE SHOWSTOPPERS: - * Refactor apr_ldap as a proper/complete API. Brownie points for making - these into DSO pluggable providers against the various SDK's/Toolkits. - Either re-apply r799085, or drop apr_ldap before 2.0.0, per vote on dev@ - * apr_file_rotating_* on most platforms CURRENT VOTES: diff --git a/apr-config.in b/apr-config.in index e6b518137d2..84b407356b6 100644 --- a/apr-config.in +++ b/apr-config.in @@ -44,7 +44,6 @@ APR_BUILD_DIR="@apr_builddir@" APR_SO_EXT="@so_ext@" APR_LIB_TARGET="@export_lib_target@" APR_LIBNAME="@APR_LIBNAME@" -LDAP_LIBS="@LDADD_ldap@" # NOTE: the following line is modified during 'make install': alter with care! location=@APR_CONFIG_LOCATION@ @@ -65,7 +64,6 @@ Known values for OPTION are: --includes print include information --ldflags print linker flags --libs print additional libraries to link against - --ldap-libs print additional library information to link with ldap --srcdir print APR source directory --installbuilddir print APR build helper directory --link-ld print link switch(es) for linking to APR @@ -150,9 +148,6 @@ while test $# -gt 0; do --libs) flags="$flags $LIBS" ;; - --ldap-libs) - flags="$flags $LDAP_LIBS" - ;; --ldflags) flags="$flags $LDFLAGS" ;; diff --git a/apr.dsp b/apr.dsp index 6ca1c5a164d..8e7f2d0b5f3 100644 --- a/apr.dsp +++ b/apr.dsp @@ -374,30 +374,6 @@ SOURCE=.\file_io\unix\tempdir.c SOURCE=.\hooks\apr_hooks.c # End Source File # End Group -# Begin Group "ldap" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\ldap\apr_ldap_init.c -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_option.c -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_rebind.c -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_stub.c -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_url.c -# End Source File -# End Group # Begin Group "locks" # PROP Default_Filter "" @@ -934,61 +910,6 @@ SOURCE=.\include\apr_inherit.h # End Source File # Begin Source File -SOURCE=.\include\apr_ldap.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apr_ldap.hnw -# End Source File -# Begin Source File - -SOURCE=.\include\apr_ldap.hw - -!IF "$(CFG)" == "apr - Win32 Release" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - Win32 Debug" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - x64 Release" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "apr - x64 Debug" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - SOURCE=.\include\apr_lib.h # End Source File # Begin Source File diff --git a/build.conf b/build.conf index 1fa1eae48f7..4933d15cdf1 100644 --- a/build.conf +++ b/build.conf @@ -21,8 +21,6 @@ paths = dbm/sdbm/*.c encoding/*.c hooks/*.c - ldap/apr_ldap_stub.c - ldap/apr_ldap_url.c misc/*.c memcache/*.c uri/apr_uri.c @@ -51,7 +49,7 @@ headers = include/*.h dsp = libapr.dsp modules = - ldap crypto_openssl crypto_nss dbd_pgsql + crypto_openssl crypto_nss dbd_pgsql dbd_sqlite2 dbd_sqlite3 dbd_oracle dbd_mysql dbd_freetds dbd_odbc dbm_db dbm_gdbm dbm_ndbm @@ -108,9 +106,3 @@ target = dbm/apr_dbm_gdbm.la paths = dbm/apr_dbm_ndbm.c target = dbm/apr_dbm_ndbm.la -[ldap] -paths = ldap/apr_ldap_init.c - ldap/apr_ldap_option.c - ldap/apr_ldap_rebind.c -target = ldap/apr_ldap.la - diff --git a/build/aprenv.py b/build/aprenv.py index 248639fe5c4..a4091aa18f2 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -683,22 +683,8 @@ def APRAutoconf(self): subst['@have_iconv@'] = 0 - # ldap stuff, remove soon. - subst['@apu_has_ldap@'] = 0 - - subst['@apu_has_ldap_netscape@'] = 0 - subst['@apu_has_ldap_solaris@'] = 0 - subst['@apu_has_ldap_novell@'] = 0 - subst['@apu_has_ldap_mozilla@'] = 0 - subst['@apu_has_ldap_openldap@'] = 0 - subst['@apu_has_ldap_microsoft@'] = 0 - subst['@apu_has_ldap_tivoli@'] = 0 - subst['@apu_has_ldap_zos@'] = 0 - subst['@apu_has_ldap_other@'] = 0 - self.SubstFile('include/apr.h', 'include/apr.h.in', SUBST_DICT = subst) self.SubstFile('include/apu.h', 'include/apu.h.in', SUBST_DICT = subst) - self.SubstFile('include/apr_ldap.h', 'include/apr_ldap.h.in', SUBST_DICT = subst) self.SubstFile('include/apu_want.h', 'include/apu_want.h.in', SUBST_DICT = subst) self.SubstFile('include/private/apu_select_dbm.h', 'include/private/apu_select_dbm.h.in', SUBST_DICT = subst) if hasattr(conf, "config_h_text"): diff --git a/build/apu-ldap.m4 b/build/apu-ldap.m4 deleted file mode 100644 index 59f66afd2ee..00000000000 --- a/build/apu-ldap.m4 +++ /dev/null @@ -1,265 +0,0 @@ -dnl -------------------------------------------------------- -*- autoconf -*- -dnl Licensed to the Apache Software Foundation (ASF) under one or more -dnl contributor license agreements. See the NOTICE file distributed with -dnl this work for additional information regarding copyright ownership. -dnl The ASF licenses this file to You under the Apache License, Version 2.0 -dnl (the "License"); you may not use this file except in compliance with -dnl the License. You may obtain a copy of the License at -dnl -dnl http://www.apache.org/licenses/LICENSE-2.0 -dnl -dnl Unless required by applicable law or agreed to in writing, software -dnl distributed under the License is distributed on an "AS IS" BASIS, -dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -dnl See the License for the specific language governing permissions and -dnl limitations under the License. - - -dnl -dnl Find a particular LDAP library -dnl -AC_DEFUN([APU_FIND_LDAPLIB], [ - if test ${apu_has_ldap} != "1"; then - ldaplib=$1 - extralib=$2 - # Clear the cache entry for subsequent APU_FIND_LDAPLIB invocations. - changequote(,) - ldaplib_cache_id="`echo $ldaplib | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - changequote([,]) - unset ac_cv_lib_${ldaplib_cache_id}_ldap_init - unset ac_cv_lib_${ldaplib_cache_id}___ldap_init - AC_CHECK_LIB(${ldaplib}, ldap_init, - [ - LDADD_ldap="-l${ldaplib} ${extralib}" - AC_CHECK_LIB(${ldaplib}, ldapssl_client_init, apu_has_ldapssl_client_init="1", , ${extralib}) - AC_CHECK_LIB(${ldaplib}, ldapssl_client_deinit, apu_has_ldapssl_client_deinit="1", , ${extralib}) - AC_CHECK_LIB(${ldaplib}, ldapssl_add_trusted_cert, apu_has_ldapssl_add_trusted_cert="1", , ${extralib}) - AC_CHECK_LIB(${ldaplib}, ldap_start_tls_s, apu_has_ldap_start_tls_s="1", , ${extralib}) - AC_CHECK_LIB(${ldaplib}, ldap_sslinit, apu_has_ldap_sslinit="1", , ${extralib}) - AC_CHECK_LIB(${ldaplib}, ldapssl_init, apu_has_ldapssl_init="1", , ${extralib}) - AC_CHECK_LIB(${ldaplib}, ldapssl_install_routines, apu_has_ldapssl_install_routines="1", , ${extralib}) - apu_has_ldap="1"; - ], , ${extralib}) - fi -]) - - -dnl -dnl APU_FIND_LDAP: figure out where LDAP is located -dnl -AC_DEFUN([APU_FIND_LDAP], [ - -echo $ac_n "${nl}checking for ldap support..." - -apu_has_ldap="0"; -apu_has_ldapssl_client_init="0" -apu_has_ldapssl_client_deinit="0" -apu_has_ldapssl_add_trusted_cert="0" -apu_has_ldap_start_tls_s="0" -apu_has_ldapssl_init="0" -apu_has_ldap_sslinit="0" -apu_has_ldapssl_install_routines="0" -apu_has_ldap_openldap="0" -apu_has_ldap_solaris="0" -apu_has_ldap_novell="0" -apu_has_ldap_microsoft="0" -apu_has_ldap_netscape="0" -apu_has_ldap_mozilla="0" -apu_has_ldap_tivoli="0" -apu_has_ldap_zos="0" -apu_has_ldap_other="0" -LDADD_ldap="" - -AC_ARG_WITH(lber,[ --with-lber=library lber library to use], - [ - if test "$withval" = "yes"; then - apu_liblber_name="lber" - else - apu_liblber_name="$withval" - fi - ], - [ - apu_liblber_name="lber" - ]) - -AC_ARG_WITH(ldap-include,[ --with-ldap-include=path path to ldap include files with trailing slash]) -AC_ARG_WITH(ldap-lib,[ --with-ldap-lib=path path to ldap lib file]) -AC_ARG_WITH(ldap,[ --with-ldap=library ldap library to use], - [ - if test "$with_ldap" != "no"; then - save_cppflags="$CPPFLAGS" - save_ldflags="$LDFLAGS" - save_libs="$LIBS" - if test -n "$with_ldap_include"; then - CPPFLAGS="$CPPFLAGS -I$with_ldap_include" - APR_ADDTO(INCLUDES, [-I$with_ldap_include]) - fi - if test -n "$with_ldap_lib"; then - APR_ADDTO(LDFLAGS, [-L$with_ldap_lib]) - fi - - LIBLDAP="$withval" - if test "$LIBLDAP" = "yes"; then - dnl The iPlanet C SDK 5.0 is as yet untested... - APU_FIND_LDAPLIB("ldap50", "-lnspr4 -lplc4 -lplds4 -liutil50 -llber50 -lldif50 -lnss3 -lprldap50 -lssl3 -lssldap50") - APU_FIND_LDAPLIB("ldapssl41", "-lnspr3 -lplc3 -lplds3") - APU_FIND_LDAPLIB("ldapssl40") - APU_FIND_LDAPLIB("ldapssl30") - APU_FIND_LDAPLIB("ldapssl20") - APU_FIND_LDAPLIB("ldapsdk", "-lldapx -lldapssl -lldapgss -lgssapi_krb5") - APU_FIND_LDAPLIB("ldapsdk", "-lldapx -lldapssl -lldapgss -lgss -lresolv -lsocket") - APU_FIND_LDAPLIB("ldap", "-llber") - APU_FIND_LDAPLIB("ldap", "-llber -lresolv") - APU_FIND_LDAPLIB("ldap", "-llber -lresolv -lsocket -lnsl") - APU_FIND_LDAPLIB("ldap", "-ldl -lpthread") - else - APU_FIND_LDAPLIB($LIBLDAP) - APU_FIND_LDAPLIB($LIBLDAP, "-lresolv") - APU_FIND_LDAPLIB($LIBLDAP, "-lresolv -lsocket -lnsl") - APU_FIND_LDAPLIB($LIBLDAP, "-ldl -lpthread") - fi - - test ${apu_has_ldap} != "1" && AC_MSG_ERROR(could not find an LDAP library) - AC_CHECK_LIB($apu_liblber_name, ber_init, - [LDADD_ldap="${LDADD_ldap} -l${apu_liblber_name}"]) - - AC_CHECK_HEADERS(lber.h, lber_h=["#include "]) - - # Solaris has a problem in which prevents it from - # being included by itself. Check for manually, - # including lber.h first. - AC_CACHE_CHECK([for ldap.h], [apr_cv_hdr_ldap_h], - [AC_TRY_CPP( - [#ifdef HAVE_LBER_H - #include - #endif - #include - ], [apr_cv_hdr_ldap_h=yes], [apr_cv_hdr_ldap_h=no])]) - if test "$apr_cv_hdr_ldap_h" = "yes"; then - ldap_h=["#include "] - AC_DEFINE([HAVE_LDAP_H], 1, [Defined if ldap.h is present]) - fi - - AC_CHECK_HEADERS(ldap_ssl.h, ldap_ssl_h=["#include "]) - - if test "$apr_cv_hdr_ldap_h" = "yes"; then - AC_CACHE_CHECK([for LDAP toolkit], - [apr_cv_ldap_toolkit], [ - if test "x$apr_cv_ldap_toolkit" = "x"; then - AC_EGREP_CPP([OpenLDAP], [$lber_h - $ldap_h - LDAP_VENDOR_NAME], [apu_has_ldap_openldap="1" - apr_cv_ldap_toolkit="OpenLDAP"]) - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - AC_EGREP_CPP([Sun Microsystems Inc.], [$lber_h - $ldap_h - LDAP_VENDOR_NAME], [apu_has_ldap_solaris="1" - apr_cv_ldap_toolkit="Solaris"]) - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - AC_EGREP_CPP([Novell], [$lber_h - $ldap_h - LDAP_VENDOR_NAME], [apu_has_ldap_novell="1" - apr_cv_ldap_toolkit="Novell"]) - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - AC_EGREP_CPP([Microsoft Corporation.], [$lber_h - $ldap_h - LDAP_VENDOR_NAME], [apu_has_ldap_microsoft="1" - apr_cv_ldap_toolkit="Microsoft"]) - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - AC_EGREP_CPP([Netscape Communications Corp.], [$lber_h - $ldap_h - LDAP_VENDOR_NAME], [apu_has_ldap_netscape="1" - apr_cv_ldap_toolkit="Netscape"]) - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - AC_EGREP_CPP([mozilla.org], [$lber_h - $ldap_h - LDAP_VENDOR_NAME], [apu_has_ldap_mozilla="1" - apr_cv_ldap_toolkit="Mozilla"]) - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - AC_EGREP_CPP([International Business Machines], [$lber_h - $ldap_h - LDAP_VENDOR_NAME], [apu_has_ldap_tivoli="1" - apr_cv_ldap_toolkit="Tivoli"]) - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - case "$host" in - *-ibm-os390) - AC_EGREP_CPP([IBM], [$lber_h - $ldap_h], [apu_has_ldap_zos="1" - apr_cv_ldap_toolkit="z/OS"]) - ;; - esac - fi - if test "x$apr_cv_ldap_toolkit" = "x"; then - apu_has_ldap_other="1" - apr_cv_ldap_toolkit="unknown" - fi - ]) - fi - - CPPFLAGS=$save_cppflags - LDFLAGS=$save_ldflags - LIBS=$save_libs - fi - ]) - -if test "$apu_has_ldap_openldap" = "1"; then - save_cppflags="$CPPFLAGS" - save_ldflags="$LDFLAGS" - save_libs="$LIBS" - - CPPFLAGS="$CPPFLAGS $INCLUDES" - AC_CACHE_CHECK([style of ldap_set_rebind_proc routine], ac_cv_ldap_set_rebind_proc_style, - APR_TRY_COMPILE_NO_WARNING([ - #ifdef HAVE_LBER_H - #include - #endif - #ifdef HAVE_LDAP_H - #include - #endif - ], [ - int tmp = ldap_set_rebind_proc((LDAP *)0, (LDAP_REBIND_PROC *)0, (void *)0); - /* use tmp to suppress the warning */ - tmp=0; - ], ac_cv_ldap_set_rebind_proc_style=three, ac_cv_ldap_set_rebind_proc_style=two)) - - if test "$ac_cv_ldap_set_rebind_proc_style" = "three"; then - AC_DEFINE(LDAP_SET_REBIND_PROC_THREE, 1, [Define if ldap_set_rebind_proc takes three arguments]) - fi - - CPPFLAGS="$save_cppflags" - LDFLAGS="$save_ldflags" - LIBS="$save_libs" -fi - -AC_SUBST(ldap_h) -AC_SUBST(lber_h) -AC_SUBST(ldap_ssl_h) -AC_SUBST(apu_has_ldapssl_client_init) -AC_SUBST(apu_has_ldapssl_client_deinit) -AC_SUBST(apu_has_ldapssl_add_trusted_cert) -AC_SUBST(apu_has_ldap_start_tls_s) -AC_SUBST(apu_has_ldapssl_init) -AC_SUBST(apu_has_ldap_sslinit) -AC_SUBST(apu_has_ldapssl_install_routines) -AC_SUBST(apu_has_ldap) -AC_SUBST(apu_has_ldap_openldap) -AC_SUBST(apu_has_ldap_solaris) -AC_SUBST(apu_has_ldap_novell) -AC_SUBST(apu_has_ldap_microsoft) -AC_SUBST(apu_has_ldap_netscape) -AC_SUBST(apu_has_ldap_mozilla) -AC_SUBST(apu_has_ldap_tivoli) -AC_SUBST(apu_has_ldap_zos) -AC_SUBST(apu_has_ldap_other) -AC_SUBST(LDADD_ldap) - -]) - - diff --git a/build/dso.m4 b/build/dso.m4 index 4b4bd600f60..5589183c11d 100644 --- a/build/dso.m4 +++ b/build/dso.m4 @@ -46,9 +46,6 @@ AC_DEFUN([APR_MODULAR_DSO], [ test $apu_have_db = 1 && objs="$objs dbm/apr_dbm_berkeleydb.lo" test $apu_have_gdbm = 1 && objs="$objs dbm/apr_dbm_gdbm.lo" test $apu_have_ndbm = 1 && objs="$objs dbm/apr_dbm_ndbm.lo" - test $apu_has_ldap = 1 && objs="$objs ldap/apr_ldap_init.lo" - test $apu_has_ldap = 1 && objs="$objs ldap/apr_ldap_option.lo" - test $apu_has_ldap = 1 && objs="$objs ldap/apr_ldap_rebind.lo" EXTRA_OBJECTS="$EXTRA_OBJECTS $objs" # Use libtool *.la for mysql if available @@ -68,11 +65,9 @@ AC_DEFUN([APR_MODULAR_DSO], [ LIBS="$LIBS $LDADD_crypto_openssl $LDADD_crypto_nss" LIBS="$LIBS $LDADD_dbd_pgsql $LDADD_dbd_sqlite2 $LDADD_dbd_sqlite3 $LDADD_dbd_oracle $LDADD_dbd_mysql $LDADD_dbd_freetds $LDADD_dbd_odbc" LIBS="$LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm" - LIBS="$LIBS $LDADD_ldap" APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_crypto_openssl $LDADD_crypto_nss" APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbd_pgsql $LDADD_dbd_sqlite2 $LDADD_dbd_sqlite3 $LDADD_dbd_oracle $LDADD_dbd_mysql $LDADD_dbd_freetds $LDADD_dbd_odbc" APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm" - APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_ldap" else @@ -90,7 +85,6 @@ AC_DEFUN([APR_MODULAR_DSO], [ test $apu_have_db = 1 && dsos="$dsos dbm/apr_dbm_db.la" test $apu_have_gdbm = 1 && dsos="$dsos dbm/apr_dbm_gdbm.la" test $apu_have_ndbm = 1 && dsos="$dsos dbm/apr_dbm_ndbm.la" - test $apu_has_ldap = 1 && dsos="$dsos ldap/apr_ldap.la" if test -n "$dsos"; then APR_DSO_MODULES="$APR_DSO_MODULES $dsos" diff --git a/build/nw_export.h b/build/nw_export.h index f3743d464b2..6bc856bf2ee 100644 --- a/build/nw_export.h +++ b/build/nw_export.h @@ -31,11 +31,6 @@ #include "apr_hash.h" #include "apr_hooks.h" #include "apr_inherit.h" -#include "apr_ldap.h" -#include "apr_ldap_init.h" -#include "apr_ldap_option.h" -#include "apr_ldap_rebind.h" -#include "apr_ldap_url.h" #include "apr_lib.h" #include "apr_md4.h" #include "apr_md5.h" diff --git a/build/rpm/apr.spec.in b/build/rpm/apr.spec.in index 0f9f3a2654d..1303222ffb6 100644 --- a/build/rpm/apr.spec.in +++ b/build/rpm/apr.spec.in @@ -88,15 +88,6 @@ Requires: apr-util = %{version}-%{release} This package provides the ODBC driver for the apr-util DBD (database abstraction) interface. -%package ldap -Group: Development/Libraries -Summary: APR utility library LDAP support -BuildRequires: openldap-devel -Requires: apr-util = %{version}-%{release} - -%description ldap -This package provides the LDAP support for the apr-util. - %package openssl Group: Development/Libraries Summary: APR utility library OpenSSL crypto support @@ -126,7 +117,7 @@ This package provides crypto support for apr-util based on Mozilla NSS. --includedir=%{_includedir}/apr-%{aprver} \ --with-installbuilddir=%{_libdir}/apr/build-%{aprver} \ --with-devrandom=/dev/urandom \ - --with-ldap --without-gdbm \ + --without-gdbm \ --with-sqlite3 --with-pgsql --with-mysql --with-freetds --with-odbc \ --with-berkeley-db \ --with-crypto --with-openssl --with-nss \ @@ -188,10 +179,6 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %{_libdir}/apr-%{aprver}/apr_dbd_odbc* -%files ldap -%defattr(-,root,root,-) -%{_libdir}/apr-%{aprver}/apr_ldap* - %files openssl %defattr(-,root,root,-) %{_libdir}/apr-%{aprver}/apr_crypto_openssl* diff --git a/configure.in b/configure.in index ee46957a470..ac6ea4d1a23 100644 --- a/configure.in +++ b/configure.in @@ -27,7 +27,6 @@ sinclude(build/ltversion.m4) sinclude(build/lt~obsolete.m4) sinclude(build/apu-conf.m4) -sinclude(build/apu-ldap.m4) sinclude(build/xml.m4) sinclude(build/apu-hints.m4) sinclude(build/crypto.m4) @@ -2608,9 +2607,6 @@ APU_CHECK_CRYPTO APU_CHECK_CRYPTO_OPENSSL APU_CHECK_CRYPTO_NSS -dnl Find LDAP library -APU_FIND_LDAP - dnl Find DBM and DBD backends to use. APU_CHECK_DBM APU_CHECK_DBD @@ -2667,7 +2663,6 @@ AC_SUBST(EXTRA_OBJECTS) dnl XXX FIXME; used for -lexpat, -liconv etc? AC_SUBST(APRUTIL_EXPORT_LIBS) - dnl dnl Prep all the flags and stuff for compilation and export to other builds dnl @@ -2749,7 +2744,6 @@ if test -d $srcdir/test; then fi AC_CONFIG_FILES([include/private/apu_select_dbm.h - include/apr_ldap.h include/apu_want.h]) dir=include/arch/unix diff --git a/include/apr_crypto.h b/include/apr_crypto.h index 8a96de355d7..0f16036fee6 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -162,9 +162,7 @@ typedef enum { * Certificate and private key structure. * * The various crypto backends expect certificates and keys in a wide - * array of formats. This structure is analogous to apr_ldap_opt_tls_cert_t - * from the LDAP interface. Ultimately that interface should be meshed with - * this one. + * array of formats. * @param type Type of certificate APR_CRYPTO_*_TYPE_* * @param path Path, file or nickname of the certificate * @param password Optional password, can be NULL diff --git a/include/apr_ldap.h.in b/include/apr_ldap.h.in deleted file mode 100644 index c548b55113f..00000000000 --- a/include/apr_ldap.h.in +++ /dev/null @@ -1,197 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h - */ -/** - * @file apr_ldap.h - * @brief APR-UTIL LDAP - */ -#ifndef APU_LDAP_H -#define APU_LDAP_H - -/** - * @defgroup APR_Util_LDAP LDAP - * @ingroup APR_Util - * @{ - */ - -/* this will be defined if LDAP support was compiled into apr-util */ -#define APR_HAS_LDAP @apu_has_ldap@ - -/* identify the LDAP toolkit used */ -#define APR_HAS_NETSCAPE_LDAPSDK @apu_has_ldap_netscape@ -#define APR_HAS_SOLARIS_LDAPSDK @apu_has_ldap_solaris@ -#define APR_HAS_NOVELL_LDAPSDK @apu_has_ldap_novell@ -#define APR_HAS_MOZILLA_LDAPSDK @apu_has_ldap_mozilla@ -#define APR_HAS_OPENLDAP_LDAPSDK @apu_has_ldap_openldap@ -#define APR_HAS_MICROSOFT_LDAPSDK @apu_has_ldap_microsoft@ -#define APR_HAS_TIVOLI_LDAPSDK @apu_has_ldap_tivoli@ -#define APR_HAS_ZOS_LDAPSDK @apu_has_ldap_zos@ -#define APR_HAS_OTHER_LDAPSDK @apu_has_ldap_other@ - - -/* - * Handle the case when LDAP is enabled - */ -#if APR_HAS_LDAP - -/* - * The following #defines are DEPRECATED and should not be used for - * anything. They remain to maintain binary compatibility. - * The original code defined the OPENLDAP SDK as present regardless - * of what really was there, which was way bogus. In addition, the - * apr_ldap_url_parse*() functions have been rewritten specifically for - * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero. - */ -#if APR_HAS_TIVOLI_LDAPSDK -#define APR_HAS_LDAP_SSL 0 -#else -#define APR_HAS_LDAP_SSL 1 -#endif -#define APR_HAS_LDAP_URL_PARSE 0 - -#if APR_HAS_OPENLDAP_LDAPSDK && !defined(LDAP_DEPRECATED) -/* Ensure that the "deprecated" interfaces are still exposed - * with OpenLDAP >= 2.3; these were exposed by default in earlier - * releases. */ -#define LDAP_DEPRECATED 1 -#endif - -/* - * Include the standard LDAP header files. - */ - -@lber_h@ -@ldap_h@ -@ldap_ssl_h@ - - -/* - * Detected standard functions - */ -#define APR_HAS_LDAPSSL_CLIENT_INIT @apu_has_ldapssl_client_init@ -#define APR_HAS_LDAPSSL_CLIENT_DEINIT @apu_has_ldapssl_client_deinit@ -#define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT @apu_has_ldapssl_add_trusted_cert@ -#define APR_HAS_LDAP_START_TLS_S @apu_has_ldap_start_tls_s@ -#define APR_HAS_LDAP_SSLINIT @apu_has_ldap_sslinit@ -#define APR_HAS_LDAPSSL_INIT @apu_has_ldapssl_init@ -#define APR_HAS_LDAPSSL_INSTALL_ROUTINES @apu_has_ldapssl_install_routines@ - -/* - * Make sure the secure LDAP port is defined - */ -#ifndef LDAPS_PORT -#define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */ -#endif - -/* - * For ldap function calls that input a size limit on the number of returned elements - * Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0) - * LDAP_DEFAULT_LIMIT is preferred as it allows inheritance from whatever the SDK - * or process is configured for. - */ -#ifdef LDAP_DEFAULT_LIMIT -#define APR_LDAP_SIZELIMIT LDAP_DEFAULT_LIMIT -#else -#ifdef LDAP_NO_LIMIT -#define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT -#endif -#endif - -#ifndef APR_LDAP_SIZELIMIT -#define APR_LDAP_SIZELIMIT 0 /* equivalent to LDAP_NO_LIMIT, and what goes on the wire */ -#endif - -/* - * z/OS is missing some defines - */ -#ifndef LDAP_VERSION_MAX -#define LDAP_VERSION_MAX LDAP_VERSION -#endif -#if APR_HAS_ZOS_LDAPSDK -#define LDAP_VENDOR_NAME "IBM z/OS" -#endif - -/* Note: Macros defining const casting has been removed in APR v1.0, - * pending real support for LDAP v2.0 toolkits. - * - * In the mean time, please use an LDAP v3.0 toolkit. - */ -#if LDAP_VERSION_MAX <= 2 -#error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit. -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** - * This structure allows the C LDAP API error codes to be returned - * along with plain text error messages that explain to us mere mortals - * what really happened. - */ -typedef struct apr_ldap_err_t { - const char *reason; - const char *msg; - int rc; -} apr_ldap_err_t; - -#ifdef __cplusplus -} -#endif - -/* The MS SDK returns LDAP_UNAVAILABLE when the backend has closed the connection - * between LDAP calls. Protect with APR_HAS_MICROSOFT_LDAPSDK in case someone - * manually chooses another SDK on Windows - */ -#if APR_HAS_MICROSOFT_LDAPSDK -#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN \ - || (s) == LDAP_UNAVAILABLE) -#else -#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN) -#endif - -/* These symbols are not actually exported in a DSO build, but mapped into - * a private exported function array for apr_ldap_stub to bind dynamically. - * Rename them appropriately to protect the global namespace. - */ -#ifdef APU_DSO_LDAP_BUILD - -#define apr_ldap_info apr__ldap_info -#define apr_ldap_init apr__ldap_init -#define apr_ldap_ssl_init apr__ldap_ssl_init -#define apr_ldap_ssl_deinit apr__ldap_ssl_deinit -#define apr_ldap_get_option apr__ldap_get_option -#define apr_ldap_set_option apr__ldap_set_option -#define apr_ldap_rebind_init apr__ldap_rebind_init -#define apr_ldap_rebind_add apr__ldap_rebind_add -#define apr_ldap_rebind_remove apr__ldap_rebind_remove - -#define APR_DECLARE_LDAP(type) type -#else -#define APR_DECLARE_LDAP(type) APR_DECLARE(type) -#endif - -#include "apr_ldap_url.h" -#include "apr_ldap_init.h" -#include "apr_ldap_option.h" -#include "apr_ldap_rebind.h" - -#endif /* APR_HAS_LDAP */ -/** @} */ -#endif /* APU_LDAP_H */ diff --git a/include/apr_ldap.hnw b/include/apr_ldap.hnw deleted file mode 100644 index 0b5663cfdbe..00000000000 --- a/include/apr_ldap.hnw +++ /dev/null @@ -1,158 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h - */ -/** - * @file apr_ldap.h - * @brief APR-UTIL LDAP - */ -#ifndef APU_LDAP_H -#define APU_LDAP_H - -/** - * @defgroup APR_Util_LDAP LDAP - * @ingroup APR_Util - * @{ - */ - -/* this will be defined if LDAP support was compiled into apr-util */ -#define APR_HAS_LDAP 1 - -/* identify the LDAP toolkit used */ -#define APR_HAS_NETSCAPE_LDAPSDK 0 -#define APR_HAS_SOLARIS_LDAPSDK 0 -#define APR_HAS_NOVELL_LDAPSDK 1 -#define APR_HAS_MOZILLA_LDAPSDK 0 -#define APR_HAS_OPENLDAP_LDAPSDK 0 -#define APR_HAS_MICROSOFT_LDAPSDK 0 -#define APR_HAS_OTHER_LDAPSDK 0 - - -/* - * Handle the case when LDAP is enabled - */ -#if APR_HAS_LDAP - -/* - * The following #defines are DEPRECATED and should not be used for - * anything. They remain to maintain binary compatibility. - * The original code defined the OPENLDAP SDK as present regardless - * of what really was there, which was way bogus. In addition, the - * apr_ldap_url_parse*() functions have been rewritten specifically for - * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero. - */ -#define APR_HAS_LDAP_SSL 1 -#define APR_HAS_LDAP_URL_PARSE 0 - - -/* - * Include the standard LDAP header files. - */ - -#ifdef GENEXPORTS -#define LDAP_VERSION_MAX 3 -#define LDAP_INSUFFICIENT_ACCESS -#else -#include -#include -#if APR_HAS_LDAP_SSL -#include -#endif -#endif - - -/* - * Detected standard functions - */ -#define APR_HAS_LDAPSSL_CLIENT_INIT 1 -#define APR_HAS_LDAPSSL_CLIENT_DEINIT 1 -#define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT 1 -#define APR_HAS_LDAP_START_TLS_S 0 -#define APR_HAS_LDAP_SSLINIT 0 -#define APR_HAS_LDAPSSL_INIT 1 -#define APR_HAS_LDAPSSL_INSTALL_ROUTINES 0 - - -/* - * Make sure the secure LDAP port is defined - */ -#ifndef LDAPS_PORT -#define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */ -#endif - - -/* Note: Macros defining const casting has been removed in APR v1.0, - * pending real support for LDAP v2.0 toolkits. - * - * In the mean time, please use an LDAP v3.0 toolkit. - */ -#if LDAP_VERSION_MAX <= 2 -#error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit. -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** - * This structure allows the C LDAP API error codes to be returned - * along with plain text error messages that explain to us mere mortals - * what really happened. - */ -typedef struct apr_ldap_err_t { - const char *reason; - const char *msg; - int rc; -} apr_ldap_err_t; - -#ifdef __cplusplus -} -#endif - -#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN) - -/* These symbols are not actually exported in a DSO build, but mapped into - * a private exported function array for apr_ldap_stub to bind dynamically. - * Rename them appropriately to protect the global namespace. - */ -#ifdef APU_DSO_LDAP_BUILD - -#define apr_ldap_info apr__ldap_info -#define apr_ldap_init apr__ldap_init -#define apr_ldap_ssl_init apr__ldap_ssl_init -#define apr_ldap_ssl_deinit apr__ldap_ssl_deinit -#define apr_ldap_get_option apr__ldap_get_option -#define apr_ldap_set_option apr__ldap_set_option -#define apr_ldap_rebind_init apr__ldap_rebind_init -#define apr_ldap_rebind_add apr__ldap_rebind_add -#define apr_ldap_rebind_remove apr__ldap_rebind_remove - -#define APR_DECLARE_LDAP(type) type -#else -#define APR_DECLARE_LDAP(type) APR_DECLARE(type) -#endif - -#include "apr_ldap_url.h" -#include "apr_ldap_init.h" -#include "apr_ldap_option.h" -#include "apr_ldap_rebind.h" - -/** @} */ -#endif /* APR_HAS_LDAP */ -#endif /* APU_LDAP_H */ - diff --git a/include/apr_ldap.hw b/include/apr_ldap.hw deleted file mode 100644 index 42bbf4683b9..00000000000 --- a/include/apr_ldap.hw +++ /dev/null @@ -1,197 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h - */ -/** - * @file apr_ldap.h - * @brief APR-UTIL LDAP - */ -#ifndef APU_LDAP_H -#define APU_LDAP_H - -/** - * @defgroup APR_Util_LDAP LDAP - * @ingroup APR_Util - * @{ - */ - -/* this will be defined if LDAP support was compiled into apr-util */ -#define APR_HAS_LDAP 0 - -/* identify the LDAP toolkit used */ -#define APR_HAS_NETSCAPE_LDAPSDK 0 -#define APR_HAS_SOLARIS_LDAPSDK 0 -#define APR_HAS_NOVELL_LDAPSDK 0 -#define APR_HAS_MOZILLA_LDAPSDK 0 -#define APR_HAS_OPENLDAP_LDAPSDK 0 -#define APR_HAS_MICROSOFT_LDAPSDK 1 -#define APR_HAS_TIVOLI_LDAPSDK 0 -#define APR_HAS_ZOS_LDAPSDK 0 -#define APR_HAS_OTHER_LDAPSDK 0 - - -/* - * Handle the case when LDAP is enabled - */ -#if APR_HAS_LDAP - -/* - * The following #defines are DEPRECATED and should not be used for - * anything. They remain to maintain binary compatibility. - * The original code defined the OPENLDAP SDK as present regardless - * of what really was there, which was way bogus. In addition, the - * apr_ldap_url_parse*() functions have been rewritten specifically for - * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero. - */ -#if APR_HAS_TIVOLI_LDAPSDK -#define APR_HAS_LDAP_SSL 0 -#else -#define APR_HAS_LDAP_SSL 1 -#endif -#define APR_HAS_LDAP_URL_PARSE 0 - -#if APR_HAS_OPENLDAP_LDAPSDK && !defined(LDAP_DEPRECATED) -/* Ensure that the "deprecated" interfaces are still exposed - * with OpenLDAP >= 2.3; these were exposed by default in earlier - * releases. */ -#define LDAP_DEPRECATED 1 -#endif - -/* - * Include the standard LDAP header files. - */ - -#include - - -/* - * Detected standard functions - */ -#define APR_HAS_LDAPSSL_CLIENT_INIT 0 -#define APR_HAS_LDAPSSL_CLIENT_DEINIT 0 -#define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT 0 -#define APR_HAS_LDAP_START_TLS_S 0 -#define APR_HAS_LDAP_SSLINIT 1 -#define APR_HAS_LDAPSSL_INIT 0 -#define APR_HAS_LDAPSSL_INSTALL_ROUTINES 0 - - -/* - * Make sure the secure LDAP port is defined - */ -#ifndef LDAPS_PORT -#define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */ -#endif - - -/* - * For ldap function calls that input a size limit on the number of returned elements - * Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0) - * LDAP_DEFAULT_LIMIT is preferred as it allows inheritance from whatever the SDK - * or process is configured for. - */ -#ifdef LDAP_DEFAULT_LIMIT -#define APR_LDAP_SIZELIMIT LDAP_DEFAULT_LIMIT -#else -#ifdef LDAP_NO_LIMIT -#define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT -#endif -#endif - -#ifndef APR_LDAP_SIZELIMIT -#define APR_LDAP_SIZELIMIT 0 /* equivalent to LDAP_NO_LIMIT, and what goes on the wire */ -#endif - -/* - * z/OS is missing some defines - */ -#ifndef LDAP_VERSION_MAX -#define LDAP_VERSION_MAX LDAP_VERSION -#endif -#if APR_HAS_ZOS_LDAPSDK -#define LDAP_VENDOR_NAME "IBM z/OS" -#endif - -/* Note: Macros defining const casting has been removed in APR v1.0, - * pending real support for LDAP v2.0 toolkits. - * - * In the mean time, please use an LDAP v3.0 toolkit. - */ -#if LDAP_VERSION_MAX <= 2 -#error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit. -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** - * This structure allows the C LDAP API error codes to be returned - * along with plain text error messages that explain to us mere mortals - * what really happened. - */ -typedef struct apr_ldap_err_t { - const char *reason; - const char *msg; - int rc; -} apr_ldap_err_t; - -#ifdef __cplusplus -} -#endif - -/* The MS SDK returns LDAP_UNAVAILABLE when the backend has closed the connection - * between LDAP calls. Protect with APR_HAS_MICROSOFT_LDAPSDK in case someone - * manually chooses another SDK on Windows - */ -#if APR_HAS_MICROSOFT_LDAPSDK -#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN \ - || (s) == LDAP_UNAVAILABLE) -#else -#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN) -#endif - -/* These symbols are not actually exported in a DSO build, but mapped into - * a private exported function array for apr_ldap_stub to bind dynamically. - * Rename them appropriately to protect the global namespace. - */ -#ifdef APU_DSO_LDAP_BUILD - -#define apr_ldap_info apr__ldap_info -#define apr_ldap_init apr__ldap_init -#define apr_ldap_ssl_init apr__ldap_ssl_init -#define apr_ldap_ssl_deinit apr__ldap_ssl_deinit -#define apr_ldap_get_option apr__ldap_get_option -#define apr_ldap_set_option apr__ldap_set_option -#define apr_ldap_rebind_init apr__ldap_rebind_init -#define apr_ldap_rebind_add apr__ldap_rebind_add -#define apr_ldap_rebind_remove apr__ldap_rebind_remove - -#define APR_DECLARE_LDAP(type) type -#else -#define APR_DECLARE_LDAP(type) APR_DECLARE(type) -#endif - -#include "apr_ldap_url.h" -#include "apr_ldap_init.h" -#include "apr_ldap_option.h" -#include "apr_ldap_rebind.h" - -/** @} */ -#endif /* APR_HAS_LDAP */ -#endif /* APU_LDAP_H */ diff --git a/include/apr_ldap_init.h b/include/apr_ldap_init.h deleted file mode 100644 index 0dd66747cce..00000000000 --- a/include/apr_ldap_init.h +++ /dev/null @@ -1,165 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file apr_ldap_init.h - * @brief APR-UTIL LDAP ldap_init() functions - */ -#ifndef APR_LDAP_INIT_H -#define APR_LDAP_INIT_H - -/** - * @addtogroup APR_Util_LDAP - * @{ - */ - -#include "apr_ldap.h" - -#if APR_HAS_LDAP - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/** - * Macro to detect security related return values. - */ -#if defined(LDAP_INSUFFICIENT_ACCESS) -#define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_ACCESS -#elif defined(LDAP_INSUFFICIENT_RIGHTS) -#define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_RIGHTS -#elif defined(APR_HAS_MICROSOFT_LDAPSDK) -/* The macros above fail to contemplate that LDAP_RETCODE values - * may be represented by an enum. autoconf tests would be much - * more robust. - */ -#define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_RIGHTS -#else -#error The security return codes must be added to support this LDAP toolkit. -#endif - -#if defined(LDAP_SECURITY_ERROR) -#define APU_LDAP_SECURITY_ERROR LDAP_SECURITY_ERROR -#else -#define APU_LDAP_SECURITY_ERROR(n) \ - (LDAP_INAPPROPRIATE_AUTH == n) ? 1 \ - : (LDAP_INVALID_CREDENTIALS == n) ? 1 \ - : (APU_LDAP_INSUFFICIENT_ACCESS == n) ? 1 \ - : 0 -#endif - - -/** - * APR LDAP SSL Initialise function - * - * This function initialises SSL on the underlying LDAP toolkit - * if this is necessary. - * - * If a CA certificate is provided, this is set, however the setting - * of certificates via this method has been deprecated and will be removed in - * APR v2.0. - * - * The apr_ldap_set_option() function with the APR_LDAP_OPT_TLS_CERT option - * should be used instead to set certificates. - * - * If SSL support is not available on this platform, or a problem - * was encountered while trying to set the certificate, the function - * will return APR_EGENERAL. Further LDAP specific error information - * can be found in result_err. - * @param pool The pool to use - * @param cert_auth_file The name of the certificate to use, can be NULL - * @param cert_file_type The type of certificate specified. See the - * apr_ldap_set_option() APR_LDAP_OPT_TLS_CERT option for details. - * @param result_err The returned result - */ -APR_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool, - const char *cert_auth_file, - int cert_file_type, - apr_ldap_err_t **result_err); - -/** - * APR LDAP SSL De-Initialise function - * - * This function tears down any SSL certificate setup previously - * set using apr_ldap_ssl_init(). It should be called to clean - * up if a graceful restart of a service is attempted. - * @todo currently we do not check whether apr_ldap_ssl_init() - * has been called first - we probably should. - */ -APR_DECLARE_LDAP(int) apr_ldap_ssl_deinit(void); - -/** - * APR LDAP initialise function - * - * This function is responsible for initialising an LDAP - * connection in a toolkit independant way. It does the - * job of ldap_init() from the C api. - * - * It handles both the SSL and non-SSL case, and attempts - * to hide the complexity setup from the user. This function - * assumes that any certificate setup necessary has already - * been done. - * - * If SSL or STARTTLS needs to be enabled, and the underlying - * toolkit supports it, the following values are accepted for - * secure: - * - * APR_LDAP_NONE: No encryption - * APR_LDAP_SSL: SSL encryption (ldaps://) - * APR_LDAP_STARTTLS: Force STARTTLS on ldap:// - * @remark The Novell toolkit is only able to set the SSL mode via this - * function. To work around this limitation, set the SSL mode here if no - * per connection client certificates are present, otherwise set secure - * APR_LDAP_NONE here, then set the per connection client certificates, - * followed by setting the SSL mode via apr_ldap_set_option(). As Novell - * does not support per connection client certificates, this problem is - * worked around while still being compatible with other LDAP toolkits. - * @param pool The pool to use - * @param ldap The LDAP handle - * @param hostname The name of the host to connect to. This can be either a - * DNS name, or an IP address. - * @param portno The port to connect to - * @param secure The security mode to set - * @param result_err The returned result - */ -APR_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool, - LDAP **ldap, - const char *hostname, - int portno, - int secure, - apr_ldap_err_t **result_err); - -/** - * APR LDAP info function - * - * This function returns a string describing the LDAP toolkit - * currently in use. The string is placed inside result_err->reason. - * @param pool The pool to use - * @param result_err The returned result - */ -APR_DECLARE_LDAP(int) apr_ldap_info(apr_pool_t *pool, - apr_ldap_err_t **result_err); - -#ifdef __cplusplus -} -#endif - -#endif /* APR_HAS_LDAP */ - -/** @} */ - -#endif /* APR_LDAP_URL_H */ diff --git a/include/apr_ldap_option.h b/include/apr_ldap_option.h deleted file mode 100644 index e4ebdb506a0..00000000000 --- a/include/apr_ldap_option.h +++ /dev/null @@ -1,254 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file apr_ldap_option.h - * @brief APR-UTIL LDAP ldap_*_option() functions - */ -#ifndef APR_LDAP_OPTION_H -#define APR_LDAP_OPTION_H - -/** - * @addtogroup APR_Util_LDAP - * @{ - */ - -#include "apr_ldap.h" - -#if APR_HAS_LDAP - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* - * The following defines handle the different TLS certificate - * options available. If these options are missing, APR will try and - * emulate support for this using the deprecated ldap_start_tls_s() - * function. - */ -/** - * Set SSL mode to one of APR_LDAP_NONE, APR_LDAP_SSL, APR_LDAP_STARTTLS - * or APR_LDAP_STOPTLS. - */ -#define APR_LDAP_OPT_TLS 0x6fff -/** - * Set zero or more CA certificates, client certificates or private - * keys globally, or per connection (where supported). - */ -#define APR_LDAP_OPT_TLS_CERT 0x6ffe -/** - * Set the LDAP library to no verify the server certificate. This means - * all servers are considered trusted. - */ -#define APR_LDAP_OPT_VERIFY_CERT 0x6ffd -/** - * Set the LDAP library to indicate if referrals should be chased during - * LDAP searches. - */ -#define APR_LDAP_OPT_REFERRALS 0x6ffc -/** - * Set the LDAP library to indicate a maximum number of referral hops to - * chase before giving up on the search. - */ -#define APR_LDAP_OPT_REFHOPLIMIT 0x6ffb - -/** - * Structures for the apr_set_option() cases - */ - -/** - * APR_LDAP_OPT_TLS_CERT - * - * This structure includes possible options to set certificates on - * system initialisation. Different SDKs have different certificate - * requirements, and to achieve this multiple certificates must be - * specified at once passed as an (apr_array_header_t *). - * - * Netscape: - * Needs the CA cert database (cert7.db), the client cert database (key3.db) - * and the security module file (secmod.db) set at the system initialisation - * time. Three types are supported: APR_LDAP_CERT7_DB, APR_LDAP_KEY3_DB and - * APR_LDAP_SECMOD. - * - * To specify a client cert connection, a certificate nickname needs to be - * provided with a type of APR_LDAP_CERT. - * int ldapssl_enable_clientauth( LDAP *ld, char *keynickname, - * char *keypasswd, char *certnickname ); - * keynickname is currently not used, and should be set to "" - * - * Novell: - * Needs CA certificates and client certificates set at system initialisation - * time. Three types are supported: APR_LDAP_CA*, APR_LDAP_CERT* and - * APR_LDAP_KEY*. - * - * Certificates cannot be specified per connection. - * - * The functions used are: - * ldapssl_add_trusted_cert(serverTrustedRoot, serverTrustedRootEncoding); - * Clients certs and keys are set at system initialisation time with - * int ldapssl_set_client_cert ( - * void *cert, - * int type - * void *password); - * type can be LDAPSSL_CERT_FILETYPE_B64 or LDAPSSL_CERT_FILETYPE_DER - * ldapssl_set_client_private_key(clientPrivateKey, - * clientPrivateKeyEncoding, - * clientPrivateKeyPassword); - * - * OpenSSL: - * Needs one or more CA certificates to be set at system initialisation time - * with a type of APR_LDAP_CA*. - * - * May have one or more client certificates set per connection with a type of - * APR_LDAP_CERT*, and keys with APR_LDAP_KEY*. - */ -/** CA certificate type unknown */ -#define APR_LDAP_CA_TYPE_UNKNOWN 0 -/** binary DER encoded CA certificate */ -#define APR_LDAP_CA_TYPE_DER 1 -/** PEM encoded CA certificate */ -#define APR_LDAP_CA_TYPE_BASE64 2 -/** Netscape/Mozilla cert7.db CA certificate database */ -#define APR_LDAP_CA_TYPE_CERT7_DB 3 -/** Netscape/Mozilla secmod file */ -#define APR_LDAP_CA_TYPE_SECMOD 4 -/** Client certificate type unknown */ -#define APR_LDAP_CERT_TYPE_UNKNOWN 5 -/** binary DER encoded client certificate */ -#define APR_LDAP_CERT_TYPE_DER 6 -/** PEM encoded client certificate */ -#define APR_LDAP_CERT_TYPE_BASE64 7 -/** Netscape/Mozilla key3.db client certificate database */ -#define APR_LDAP_CERT_TYPE_KEY3_DB 8 -/** Netscape/Mozilla client certificate nickname */ -#define APR_LDAP_CERT_TYPE_NICKNAME 9 -/** Private key type unknown */ -#define APR_LDAP_KEY_TYPE_UNKNOWN 10 -/** binary DER encoded private key */ -#define APR_LDAP_KEY_TYPE_DER 11 -/** PEM encoded private key */ -#define APR_LDAP_KEY_TYPE_BASE64 12 -/** PKCS#12 encoded client certificate */ -#define APR_LDAP_CERT_TYPE_PFX 13 -/** PKCS#12 encoded private key */ -#define APR_LDAP_KEY_TYPE_PFX 14 -/** Openldap directory full of base64-encoded cert - * authorities with hashes in corresponding .0 directory - */ -#define APR_LDAP_CA_TYPE_CACERTDIR_BASE64 15 - - -/** - * Certificate structure. - * - * This structure is used to store certificate details. An array of - * these structures is passed to apr_ldap_set_option() to set CA - * and client certificates. - * @param type Type of certificate APR_LDAP_*_TYPE_* - * @param path Path, file or nickname of the certificate - * @param password Optional password, can be NULL - */ -typedef struct apr_ldap_opt_tls_cert_t apr_ldap_opt_tls_cert_t; -struct apr_ldap_opt_tls_cert_t { - int type; - const char *path; - const char *password; -}; - -/** - * APR_LDAP_OPT_TLS - * - * This sets the SSL level on the LDAP handle. - * - * Netscape/Mozilla: - * Supports SSL, but not STARTTLS - * SSL is enabled by calling ldapssl_install_routines(). - * - * Novell: - * Supports SSL and STARTTLS. - * SSL is enabled by calling ldapssl_install_routines(). Note that calling - * other ldap functions before ldapssl_install_routines() may cause this - * function to fail. - * STARTTLS is enabled by calling ldapssl_start_tls_s() after calling - * ldapssl_install_routines() (check this). - * - * OpenLDAP: - * Supports SSL and supports STARTTLS, but none of this is documented: - * http://www.openldap.org/lists/openldap-software/200409/msg00618.html - * Documentation for both SSL support and STARTTLS has been deleted from - * the OpenLDAP documentation and website. - */ - -/** No encryption */ -#define APR_LDAP_NONE 0 -/** SSL encryption (ldaps://) */ -#define APR_LDAP_SSL 1 -/** TLS encryption (STARTTLS) */ -#define APR_LDAP_STARTTLS 2 -/** end TLS encryption (STOPTLS) */ -#define APR_LDAP_STOPTLS 3 - -/** - * APR LDAP get option function - * - * This function gets option values from a given LDAP session if - * one was specified. It maps to the native ldap_get_option() function. - * @param pool The pool to use - * @param ldap The LDAP handle - * @param option The LDAP_OPT_* option to return - * @param outvalue The value returned (if any) - * @param result_err The apr_ldap_err_t structure contained detailed results - * of the operation. - */ -APR_DECLARE_LDAP(int) apr_ldap_get_option(apr_pool_t *pool, - LDAP *ldap, - int option, - void *outvalue, - apr_ldap_err_t **result_err); - -/** - * APR LDAP set option function - * - * This function sets option values to a given LDAP session if - * one was specified. It maps to the native ldap_set_option() function. - * - * Where an option is not supported by an LDAP toolkit, this function - * will try and apply legacy functions to achieve the same effect, - * depending on the platform. - * @param pool The pool to use - * @param ldap The LDAP handle - * @param option The LDAP_OPT_* option to set - * @param invalue The value to set - * @param result_err The apr_ldap_err_t structure contained detailed results - * of the operation. - */ -APR_DECLARE_LDAP(int) apr_ldap_set_option(apr_pool_t *pool, - LDAP *ldap, - int option, - const void *invalue, - apr_ldap_err_t **result_err); - -#ifdef __cplusplus -} -#endif - -#endif /* APR_HAS_LDAP */ - -/** @} */ - -#endif /* APR_LDAP_OPTION_H */ - diff --git a/include/apr_ldap_rebind.h b/include/apr_ldap_rebind.h deleted file mode 100644 index bdd5b3af625..00000000000 --- a/include/apr_ldap_rebind.h +++ /dev/null @@ -1,98 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * The APR LDAP rebind functions provide an implementation of - * a rebind procedure that can be used to allow clients to chase referrals, - * using the same credentials used to log in originally. - * - * Use of this implementation is optional. - * - * @file apr_ldap_rebind.h - * @brief Apache LDAP library - */ - -#ifndef APU_LDAP_REBIND_H -#define APU_LDAP_REBIND_H - -/** - * @addtogroup APR_Util_LDAP - * @{ - **/ - -#if defined(DOXYGEN) -#include "apr_ldap.h" -#endif - -/* - * Handle the case when LDAP is enabled - */ -#if APR_HAS_LDAP - -/** - * APR LDAP initialize rebind lock - * - * This function creates the lock for controlling access to the xref list.. - * @param pool Pool to use when creating the xref_lock. - */ -APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool); - - -/** - * APR LDAP rebind_add function - * - * This function creates a cross reference entry for the specified ldap - * connection. The rebind callback function will look up this ldap - * connection so it can retrieve the bindDN and bindPW for use in any - * binds while referrals are being chased. - * - * This function will add the callback to the LDAP handle passed in. - * - * A cleanup is registered within the pool provided to remove this - * entry when the pool is removed. Alternatively apr_ldap_rebind_remove() - * can be called to explicitly remove the entry at will. - * - * @param pool The pool to use - * @param ld The LDAP connectionhandle - * @param bindDN The bind DN to be used for any binds while chasing - * referrals on this ldap connection. - * @param bindPW The bind Password to be used for any binds while - * chasing referrals on this ldap connection. - */ -APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, - LDAP *ld, - const char *bindDN, - const char *bindPW); - -/** - * APR LDAP rebind_remove function - * - * This function removes the rebind cross reference entry for the - * specified ldap connection. - * - * If not explicitly removed, this function will be called automatically - * when the pool is cleaned up. - * - * @param ld The LDAP connectionhandle - */ -APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld); - -#endif /* APR_HAS_LDAP */ - -/** @} */ - -#endif /* APU_LDAP_REBIND_H */ - diff --git a/include/apr_ldap_url.h b/include/apr_ldap_url.h deleted file mode 100644 index 77543ef82de..00000000000 --- a/include/apr_ldap_url.h +++ /dev/null @@ -1,120 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file apr_ldap_url.h - * @brief APR-UTIL LDAP ldap_init() functions - */ -#ifndef APR_LDAP_URL_H -#define APR_LDAP_URL_H - -/** - * @addtogroup APR_Util_LDAP - * @{ - */ - -#if defined(DOXYGEN) -#include "apr_ldap.h" -#endif - -#if APR_HAS_LDAP - -#include "apu.h" -#include "apr_pools.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** Structure to access an exploded LDAP URL */ -typedef struct apr_ldap_url_desc_t { - struct apr_ldap_url_desc_t *lud_next; - char *lud_scheme; - char *lud_host; - int lud_port; - char *lud_dn; - char **lud_attrs; - int lud_scope; - char *lud_filter; - char **lud_exts; - int lud_crit_exts; -} apr_ldap_url_desc_t; - -#ifndef APR_LDAP_URL_SUCCESS -#define APR_LDAP_URL_SUCCESS 0x00 /* Success */ -#define APR_LDAP_URL_ERR_MEM 0x01 /* can't allocate memory space */ -#define APR_LDAP_URL_ERR_PARAM 0x02 /* parameter is bad */ -#define APR_LDAP_URL_ERR_BADSCHEME 0x03 /* URL doesn't begin with "ldap[si]://" */ -#define APR_LDAP_URL_ERR_BADENCLOSURE 0x04 /* URL is missing trailing ">" */ -#define APR_LDAP_URL_ERR_BADURL 0x05 /* URL is bad */ -#define APR_LDAP_URL_ERR_BADHOST 0x06 /* host port is bad */ -#define APR_LDAP_URL_ERR_BADATTRS 0x07 /* bad (or missing) attributes */ -#define APR_LDAP_URL_ERR_BADSCOPE 0x08 /* scope string is invalid (or missing) */ -#define APR_LDAP_URL_ERR_BADFILTER 0x09 /* bad or missing filter */ -#define APR_LDAP_URL_ERR_BADEXTS 0x0a /* bad or missing extensions */ -#endif - -/** - * Is this URL an ldap url? ldap:// - * @param url The url to test - */ -APR_DECLARE(int) apr_ldap_is_ldap_url(const char *url); - -/** - * Is this URL an SSL ldap url? ldaps:// - * @param url The url to test - */ -APR_DECLARE(int) apr_ldap_is_ldaps_url(const char *url); - -/** - * Is this URL an ldap socket url? ldapi:// - * @param url The url to test - */ -APR_DECLARE(int) apr_ldap_is_ldapi_url(const char *url); - -/** - * Parse an LDAP URL. - * @param pool The pool to use - * @param url_in The URL to parse - * @param ludpp The structure to return the exploded URL - * @param result_err The result structure of the operation - */ -APR_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool, - const char *url_in, - apr_ldap_url_desc_t **ludpp, - apr_ldap_err_t **result_err); - -/** - * Parse an LDAP URL. - * @param pool The pool to use - * @param url_in The URL to parse - * @param ludpp The structure to return the exploded URL - * @param result_err The result structure of the operation - */ -APR_DECLARE(int) apr_ldap_url_parse(apr_pool_t *pool, - const char *url_in, - apr_ldap_url_desc_t **ludpp, - apr_ldap_err_t **result_err); - -#ifdef __cplusplus -} -#endif - -#endif /* APR_HAS_LDAP */ - -/** @} */ - -#endif /* APR_LDAP_URL_H */ diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 23d9203dfe8..844f6f5c730 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -155,7 +155,6 @@ typedef struct app_data { rtag_t gs_lookup_rtag; rtag_t gs_event_rtag; rtag_t gs_pcp_rtag; - void* gs_ldap_xref_lock; void* gs_xref_head; } APP_DATA; diff --git a/include/private/apu_internal.h b/include/private/apu_internal.h index 868dabaaf07..21075c5c4a4 100644 --- a/include/private/apu_internal.h +++ b/include/private/apu_internal.h @@ -17,7 +17,6 @@ #include "apr.h" #include "apr_dso.h" #include "apu.h" -#include "apr_ldap.h" #ifndef APU_INTERNAL_H #define APU_INTERNAL_H @@ -38,31 +37,9 @@ apr_status_t apu_dso_init(apr_pool_t *pool); apr_status_t apu_dso_mutex_lock(void); apr_status_t apu_dso_mutex_unlock(void); -apr_status_t apu_dso_load(apr_dso_handle_t **dso, apr_dso_handle_sym_t *dsoptr, const char *module, - const char *modsym, apr_pool_t *pool); - -#if APR_HAS_LDAP - -/* For LDAP internal builds, wrap our LDAP namespace */ - -struct apr__ldap_dso_fntable { - int (*info)(apr_pool_t *pool, apr_ldap_err_t **result_err); - int (*init)(apr_pool_t *pool, LDAP **ldap, const char *hostname, - int portno, int secure, apr_ldap_err_t **result_err); - int (*ssl_init)(apr_pool_t *pool, const char *cert_auth_file, - int cert_file_type, apr_ldap_err_t **result_err); - int (*ssl_deinit)(void); - int (*get_option)(apr_pool_t *pool, LDAP *ldap, int option, - void *outvalue, apr_ldap_err_t **result_err); - int (*set_option)(apr_pool_t *pool, LDAP *ldap, int option, - const void *invalue, apr_ldap_err_t **result_err); - apr_status_t (*rebind_init)(apr_pool_t *pool); - apr_status_t (*rebind_add)(apr_pool_t *pool, LDAP *ld, - const char *bindDN, const char *bindPW); - apr_status_t (*rebind_remove)(LDAP *ld); -}; - -#endif /* APR_HAS_LDAP */ +apr_status_t apu_dso_load(apr_dso_handle_t **dso, apr_dso_handle_sym_t *dsoptr, + const char *module, const char *modsym, + apr_pool_t *pool); #ifdef __cplusplus } diff --git a/ldap/apr_ldap.dsp b/ldap/apr_ldap.dsp deleted file mode 100644 index 1ec49f2b3c6..00000000000 --- a/ldap/apr_ldap.dsp +++ /dev/null @@ -1,227 +0,0 @@ -# Microsoft Developer Studio Project File - Name="apr_ldap" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=apr_ldap - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr_ldap.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr_ldap.mak" CFG="apr_ldap - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr_ldap - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_ldap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_ldap - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_ldap - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "apr_ldap - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_ldap_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_ldap-1.res" /d DLL_NAME="apr_ldap" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_ldap-1.dll" /pdb:"Release\apr_ldap-1.pdb" /implib:"Release\apr_ldap-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=Release\apr_ldap-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_ldap - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_ldap_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_ldap-1.res" /d DLL_NAME="apr_ldap" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_ldap-1.dll" /pdb:"Debug\apr_ldap-1.pdb" /implib:"Debug\apr_ldap-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=Debug\apr_ldap-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_ldap - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\Release" -# PROP BASE Intermediate_Dir "x64\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\Release" -# PROP Intermediate_Dir "x64\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_ldap_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_ldap-1.res" /d DLL_NAME="apr_ldap" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_ldap-1.dll" /pdb:"x64\Release\apr_ldap-1.pdb" /implib:"x64\Release\apr_ldap-1.lib" /MACHINE:X64 /opt:ref -# Begin Special Build Tool -TargetPath=x64\Release\apr_ldap-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_ldap - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\Debug" -# PROP BASE Intermediate_Dir "x64\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\Debug" -# PROP Intermediate_Dir "x64\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_ldap_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_ldap-1.res" /d DLL_NAME="apr_ldap" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_ldap-1.dll" /pdb:"x64\Debug\apr_ldap-1.pdb" /implib:"x64\Debug\apr_ldap-1.lib" /MACHINE:X64 -# Begin Special Build Tool -TargetPath=x64\Debug\apr_ldap-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "apr_ldap - Win32 Release" -# Name "apr_ldap - Win32 Debug" -# Name "apr_ldap - x64 Release" -# Name "apr_ldap - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\apr_ldap_init.c -# End Source File -# Begin Source File - -SOURCE=.\apr_ldap_option.c -# End Source File -# Begin Source File - -SOURCE=.\apr_ldap_rebind.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\apr_ldap.h -# End Source File -# Begin Source File - -SOURCE=..\include\apr_ldap_init.h -# End Source File -# Begin Source File - -SOURCE=..\include\apr_ldap_option.h -# End Source File -# Begin Source File - -SOURCE=..\include\apr_ldap_rebind.h -# End Source File -# Begin Source File - -SOURCE=..\include\apr_ldap_url.h -# End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\private\apu_config.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_internal.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\libapr.rc -# End Source File -# End Target -# End Project diff --git a/ldap/apr_ldap_init.c b/ldap/apr_ldap_init.c deleted file mode 100644 index a1a1dd3de5d..00000000000 --- a/ldap/apr_ldap_init.c +++ /dev/null @@ -1,219 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * apr_ldap_init.c: LDAP v2/v3 common initialise - * - * Original code from auth_ldap module for Apache v1.3: - * Copyright 1998, 1999 Enbridge Pipelines Inc. - * Copyright 1999-2001 Dave Carrigan - */ - -#include "apr.h" -#include "apu.h" -#include "apr_private.h" - -#if APR_HAVE_MODULAR_DSO -#define APU_DSO_LDAP_BUILD -#endif - -#include "apr_ldap.h" -#include "apu_internal.h" -#include "apr_errno.h" -#include "apr_pools.h" -#include "apr_strings.h" - -#if APR_HAS_LDAP - -/** - * APR LDAP SSL Initialise function - * - * This function initialises SSL on the underlying LDAP toolkit - * if this is necessary. - * - * If a CA certificate is provided, this is set, however the setting - * of certificates via this method has been deprecated and will be removed in - * APR v2.0. - * - * The apr_ldap_set_option() function with the APR_LDAP_OPT_TLS_CERT option - * should be used instead to set certificates. - * - * If SSL support is not available on this platform, or a problem - * was encountered while trying to set the certificate, the function - * will return APR_EGENERAL. Further LDAP specific error information - * can be found in result_err. - */ -APR_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool, - const char *cert_auth_file, - int cert_file_type, - apr_ldap_err_t **result_err) -{ - - apr_ldap_err_t *result = (apr_ldap_err_t *)apr_pcalloc(pool, sizeof(apr_ldap_err_t)); - *result_err = result; - -#if APR_HAS_LDAP_SSL /* compiled with ssl support */ - - /* Novell */ -#if APR_HAS_NOVELL_LDAPSDK - ldapssl_client_init(NULL, NULL); -#endif - - /* if a certificate was specified, set it */ - if (cert_auth_file) { - apr_ldap_opt_tls_cert_t *cert = (apr_ldap_opt_tls_cert_t *)apr_pcalloc(pool, sizeof(apr_ldap_opt_tls_cert_t)); - cert->type = cert_file_type; - cert->path = cert_auth_file; - return apr_ldap_set_option(pool, NULL, APR_LDAP_OPT_TLS_CERT, (void *)cert, result_err); - } - -#else /* not compiled with SSL Support */ - if (cert_auth_file) { - result->reason = "LDAP: Attempt to set certificate store failed. " - "Not built with SSL support"; - result->rc = -1; - } -#endif /* APR_HAS_LDAP_SSL */ - - if (result->rc != -1) { - result->msg = ldap_err2string(result->rc); - } - - if (LDAP_SUCCESS != result->rc) { - return APR_EGENERAL; - } - - return APR_SUCCESS; - -} - - -/** - * APR LDAP SSL De-Initialise function - * - * This function tears down any SSL certificate setup previously - * set using apr_ldap_ssl_init(). It should be called to clean - * up if a graceful restart of a service is attempted. - * - * This function only does anything on Netware. - * - * @todo currently we do not check whether apr_ldap_ssl_init() - * has been called first - should we? - */ -APR_DECLARE_LDAP(int) apr_ldap_ssl_deinit(void) -{ - -#if APR_HAS_LDAP_SSL && APR_HAS_LDAPSSL_CLIENT_DEINIT - ldapssl_client_deinit(); -#endif - return APR_SUCCESS; - -} - - -/** - * APR LDAP initialise function - * - * This function is responsible for initialising an LDAP - * connection in a toolkit independant way. It does the - * job of ldap_init() from the C api. - * - * It handles both the SSL and non-SSL case, and attempts - * to hide the complexity setup from the user. This function - * assumes that any certificate setup necessary has already - * been done. - * - * If SSL or STARTTLS needs to be enabled, and the underlying - * toolkit supports it, the following values are accepted for - * secure: - * - * APR_LDAP_NONE: No encryption - * APR_LDAP_SSL: SSL encryption (ldaps://) - * APR_LDAP_STARTTLS: Force STARTTLS on ldap:// - */ -APR_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool, - LDAP **ldap, - const char *hostname, - int portno, - int secure, - apr_ldap_err_t **result_err) -{ - - apr_ldap_err_t *result = (apr_ldap_err_t *)apr_pcalloc(pool, sizeof(apr_ldap_err_t)); - *result_err = result; - -#if APR_HAS_LDAPSSL_INIT - *ldap = ldapssl_init(hostname, portno, 0); -#elif APR_HAS_LDAP_SSLINIT - *ldap = ldap_sslinit((char *)hostname, portno, 0); -#else - *ldap = ldap_init((char *)hostname, portno); -#endif - if (*ldap != NULL) { - return apr_ldap_set_option(pool, *ldap, APR_LDAP_OPT_TLS, &secure, result_err); - } - else { - /* handle the error case */ - apr_ldap_err_t *result = (apr_ldap_err_t *)apr_pcalloc(pool, sizeof(apr_ldap_err_t)); - *result_err = result; - - result->reason = "APR LDAP: Unable to initialize the LDAP connection"; - result->rc = -1; - return APR_EGENERAL; - } - -} - - -/** - * APR LDAP info function - * - * This function returns a string describing the LDAP toolkit - * currently in use. The string is placed inside result_err->reason. - */ -APR_DECLARE_LDAP(int) apr_ldap_info(apr_pool_t *pool, - apr_ldap_err_t **result_err) -{ - apr_ldap_err_t *result = (apr_ldap_err_t *)apr_pcalloc(pool, sizeof(apr_ldap_err_t)); - *result_err = result; - - result->reason = "APR LDAP: Built with " - LDAP_VENDOR_NAME - " LDAP SDK"; - return APR_SUCCESS; - -} - -#if APR_HAVE_MODULAR_DSO - -/* For DSO builds, export the table of entry points into the apr_ldap DSO - * See include/private/apu_internal.h for the corresponding declarations - */ -APR_MODULE_DECLARE_DATA struct apr__ldap_dso_fntable apr__ldap_fns = { - apr_ldap_info, - apr_ldap_init, - apr_ldap_ssl_init, - apr_ldap_ssl_deinit, - apr_ldap_get_option, - apr_ldap_set_option, - apr_ldap_rebind_init, - apr_ldap_rebind_add, - apr_ldap_rebind_remove -}; - -#endif /* APR_HAVE_MODULAR_DSO */ - -#endif /* APR_HAS_LDAP */ diff --git a/ldap/apr_ldap_option.c b/ldap/apr_ldap_option.c deleted file mode 100644 index ea8a19c1265..00000000000 --- a/ldap/apr_ldap_option.c +++ /dev/null @@ -1,672 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* apr_ldap_option.c -- LDAP options - * - * The LDAP SDK allows the getting and setting of options on an LDAP - * connection. - * - */ - -#include "apr.h" -#include "apu.h" -#include "apr_private.h" - -#if APR_HAVE_MODULAR_DSO -#define APU_DSO_LDAP_BUILD -#endif - -#include "apr_ldap.h" -#include "apr_errno.h" -#include "apr_pools.h" -#include "apr_strings.h" -#include "apr_tables.h" - -#if APR_HAS_LDAP - -static void option_set_cert(apr_pool_t *pool, LDAP *ldap, const void *invalue, - apr_ldap_err_t *result); -static void option_set_tls(apr_pool_t *pool, LDAP *ldap, const void *invalue, - apr_ldap_err_t *result); - -/** - * APR LDAP get option function - * - * This function gets option values from a given LDAP session if - * one was specified. - */ -APR_DECLARE_LDAP(int) apr_ldap_get_option(apr_pool_t *pool, - LDAP *ldap, - int option, - void *outvalue, - apr_ldap_err_t **result_err) -{ - apr_ldap_err_t *result; - - result = apr_pcalloc(pool, sizeof(apr_ldap_err_t)); - *result_err = result; - if (!result) { - return APR_ENOMEM; - } - - /* get the option specified using the native LDAP function */ - result->rc = ldap_get_option(ldap, option, outvalue); - - /* handle the error case */ - if (result->rc != LDAP_SUCCESS) { - result->msg = ldap_err2string(result-> rc); - result->reason = apr_pstrdup(pool, "LDAP: Could not get an option"); - return APR_EGENERAL; - } - - return APR_SUCCESS; - -} - -/** - * APR LDAP set option function - * - * This function sets option values to a given LDAP session if - * one was specified. - * - * Where an option is not supported by an LDAP toolkit, this function - * will try and apply legacy functions to achieve the same effect, - * depending on the platform. - */ -APR_DECLARE_LDAP(int) apr_ldap_set_option(apr_pool_t *pool, - LDAP *ldap, - int option, - const void *invalue, - apr_ldap_err_t **result_err) -{ - apr_ldap_err_t *result; - - result = apr_pcalloc(pool, sizeof(apr_ldap_err_t)); - *result_err = result; - if (!result) { - return APR_ENOMEM; - } - - switch (option) { - case APR_LDAP_OPT_TLS_CERT: - option_set_cert(pool, ldap, invalue, result); - break; - - case APR_LDAP_OPT_TLS: - option_set_tls(pool, ldap, invalue, result); - break; - - case APR_LDAP_OPT_VERIFY_CERT: -#if APR_HAS_NETSCAPE_LDAPSDK || APR_HAS_SOLARIS_LDAPSDK || APR_HAS_MOZILLA_LDAPSK - result->reason = "LDAP: Verify certificate not yet supported by APR on the " - "Netscape, Solaris or Mozilla LDAP SDKs"; - result->rc = -1; - return APR_EGENERAL; -#endif -#if APR_HAS_NOVELL_LDAPSDK - if (*((int*)invalue)) { - result->rc = ldapssl_set_verify_mode(LDAPSSL_VERIFY_SERVER); - } - else { - result->rc = ldapssl_set_verify_mode(LDAPSSL_VERIFY_NONE); - } -#endif -#if APR_HAS_OPENLDAP_LDAPSDK -#ifdef LDAP_OPT_X_TLS - /* This is not a per-connection setting so just pass NULL for the - Ldap connection handle */ - if (*((int*)invalue)) { - int i = LDAP_OPT_X_TLS_DEMAND; - result->rc = ldap_set_option(NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &i); - } - else { - int i = LDAP_OPT_X_TLS_NEVER; - result->rc = ldap_set_option(NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &i); - } -#else - result->reason = "LDAP: SSL/TLS not yet supported by APR on this " - "version of the OpenLDAP toolkit"; - result->rc = -1; - return APR_EGENERAL; -#endif -#endif - - /* handle the error case */ - if (result->rc != LDAP_SUCCESS) { - result->msg = ldap_err2string(result->rc); - result->reason = "LDAP: Could not set verify mode"; - } - break; - - case APR_LDAP_OPT_REFERRALS: - /* Setting this option is supported on at least TIVOLI_SDK and OpenLDAP. Folks - * who know the NOVELL, NETSCAPE, MOZILLA, and SOLARIS SDKs should note here if - * the SDK at least tolerates this option being set, or add an elif to handle - * special cases (i.e. different LDAP_OPT_X value). - */ - result->rc = ldap_set_option(ldap, LDAP_OPT_REFERRALS, (void *)invalue); - - if (result->rc != LDAP_SUCCESS) { - result->reason = "Unable to set LDAP_OPT_REFERRALS."; - return(result->rc); - } - break; - - case APR_LDAP_OPT_REFHOPLIMIT: -#if !defined(LDAP_OPT_REFHOPLIMIT) || APR_HAS_NOVELL_LDAPSDK - /* If the LDAP_OPT_REFHOPLIMIT symbol is missing, assume that the - * particular LDAP library has a reasonable default. So far certain - * versions of the OpenLDAP SDK miss this symbol (but default to 5), - * and the Microsoft SDK misses the symbol (the default is not known). - */ - result->rc = LDAP_SUCCESS; -#else - /* Setting this option is supported on at least TIVOLI_SDK. Folks who know - * the NOVELL, NETSCAPE, MOZILLA, and SOLARIS SDKs should note here if - * the SDK at least tolerates this option being set, or add an elif to handle - * special cases so an error isn't returned if there is a perfectly good - * default value that just can't be changed (like openLDAP). - */ - result->rc = ldap_set_option(ldap, LDAP_OPT_REFHOPLIMIT, (void *)invalue); -#endif - - if (result->rc != LDAP_SUCCESS) { - result->reason = "Unable to set LDAP_OPT_REFHOPLIMIT."; - return(result->rc); - } - break; - - default: - /* set the option specified using the native LDAP function */ - result->rc = ldap_set_option(ldap, option, (void *)invalue); - - /* handle the error case */ - if (result->rc != LDAP_SUCCESS) { - result->msg = ldap_err2string(result->rc); - result->reason = "LDAP: Could not set an option"; - } - break; - } - - /* handle the error case */ - if (result->rc != LDAP_SUCCESS) { - return APR_EGENERAL; - } - - return APR_SUCCESS; - -} - -/** - * Handle APR_LDAP_OPT_TLS - * - * This function sets the type of TLS to be applied to this connection. - * The options are: - * APR_LDAP_NONE: no encryption - * APR_LDAP_SSL: SSL encryption (ldaps://) - * APR_LDAP_STARTTLS: STARTTLS encryption - * APR_LDAP_STOPTLS: Stop existing TLS connecttion - */ -static void option_set_tls(apr_pool_t *pool, LDAP *ldap, const void *invalue, - apr_ldap_err_t *result) -{ -#if APR_HAS_LDAP_SSL /* compiled with ssl support */ - - int tls = * (const int *)invalue; - - /* Netscape/Mozilla/Solaris SDK */ -#if APR_HAS_NETSCAPE_LDAPSDK || APR_HAS_SOLARIS_LDAPSDK || APR_HAS_MOZILLA_LDAPSK -#if APR_HAS_LDAPSSL_INSTALL_ROUTINES - if (tls == APR_LDAP_SSL) { - result->rc = ldapssl_install_routines(ldap); -#ifdef LDAP_OPT_SSL - /* apparently Netscape and Mozilla need this too, Solaris doesn't */ - if (result->rc == LDAP_SUCCESS) { - result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, LDAP_OPT_ON); - } -#endif - if (result->rc != LDAP_SUCCESS) { - result->msg = ldap_err2string(result->rc); - result->reason = "LDAP: Could not switch SSL on for this " - "connection."; - } - } - else if (tls == APR_LDAP_STARTTLS) { - result->reason = "LDAP: STARTTLS is not supported by the " - "Netscape/Mozilla/Solaris SDK"; - result->rc = -1; - } - else if (tls == APR_LDAP_STOPTLS) { - result->reason = "LDAP: STOPTLS is not supported by the " - "Netscape/Mozilla/Solaris SDK"; - result->rc = -1; - } -#else - if (tls != APR_LDAP_NONE) { - result->reason = "LDAP: SSL/TLS is not supported by this version " - "of the Netscape/Mozilla/Solaris SDK"; - result->rc = -1; - } -#endif -#endif - - /* Novell SDK */ -#if APR_HAS_NOVELL_LDAPSDK - /* ldapssl_install_routines(ldap) - * Behavior is unpredictable when other LDAP functions are called - * between the ldap_init function and the ldapssl_install_routines - * function. - * - * STARTTLS is supported by the ldap_start_tls_s() method - */ - if (tls == APR_LDAP_SSL) { - result->rc = ldapssl_install_routines(ldap); - if (result->rc != LDAP_SUCCESS) { - result->msg = ldap_err2string(result->rc); - result->reason = "LDAP: Could not switch SSL on for this " - "connection."; - } - } - if (tls == APR_LDAP_STARTTLS) { - result->rc = ldapssl_start_tls(ldap); - if (result->rc != LDAP_SUCCESS) { - result->msg = ldap_err2string(result->rc); - result->reason = "LDAP: Could not start TLS on this connection"; - } - } - else if (tls == APR_LDAP_STOPTLS) { - result->rc = ldapssl_stop_tls(ldap); - if (result->rc != LDAP_SUCCESS) { - result->msg = ldap_err2string(result->rc); - result->reason = "LDAP: Could not stop TLS on this connection"; - } - } -#endif - - /* OpenLDAP SDK */ -#if APR_HAS_OPENLDAP_LDAPSDK -#ifdef LDAP_OPT_X_TLS - if (tls == APR_LDAP_SSL) { - int SSLmode = LDAP_OPT_X_TLS_HARD; - result->rc = ldap_set_option(ldap, LDAP_OPT_X_TLS, &SSLmode); - if (result->rc != LDAP_SUCCESS) { - result->reason = "LDAP: ldap_set_option failed. " - "Could not set LDAP_OPT_X_TLS to " - "LDAP_OPT_X_TLS_HARD"; - result->msg = ldap_err2string(result->rc); - } - } - else if (tls == APR_LDAP_STARTTLS) { - result->rc = ldap_start_tls_s(ldap, NULL, NULL); - if (result->rc != LDAP_SUCCESS) { - result->reason = "LDAP: ldap_start_tls_s() failed"; - result->msg = ldap_err2string(result->rc); - } - } - else if (tls == APR_LDAP_STOPTLS) { - result->reason = "LDAP: STOPTLS is not supported by the " - "OpenLDAP SDK"; - result->rc = -1; - } -#else - if (tls != APR_LDAP_NONE) { - result->reason = "LDAP: SSL/TLS not yet supported by APR on this " - "version of the OpenLDAP toolkit"; - result->rc = -1; - } -#endif -#endif - - /* Microsoft SDK */ -#if APR_HAS_MICROSOFT_LDAPSDK - if (tls == APR_LDAP_NONE) { - ULONG ul = (ULONG) LDAP_OPT_OFF; - result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, &ul); - if (result->rc != LDAP_SUCCESS) { - result->reason = "LDAP: an attempt to set LDAP_OPT_SSL off " - "failed."; - result->msg = ldap_err2string(result->rc); - } - } - else if (tls == APR_LDAP_SSL) { - ULONG ul = (ULONG) LDAP_OPT_ON; - result->rc = ldap_set_option(ldap, LDAP_OPT_SSL, &ul); - if (result->rc != LDAP_SUCCESS) { - result->reason = "LDAP: an attempt to set LDAP_OPT_SSL on " - "failed."; - result->msg = ldap_err2string(result->rc); - } - } -#if APR_HAS_LDAP_START_TLS_S - else if (tls == APR_LDAP_STARTTLS) { - result->rc = ldap_start_tls_s(ldap, NULL, NULL, NULL, NULL); - if (result->rc != LDAP_SUCCESS) { - result->reason = "LDAP: ldap_start_tls_s() failed"; - result->msg = ldap_err2string(result->rc); - } - } - else if (tls == APR_LDAP_STOPTLS) { - result->rc = ldap_stop_tls_s(ldap); - if (result->rc != LDAP_SUCCESS) { - result->reason = "LDAP: ldap_stop_tls_s() failed"; - result->msg = ldap_err2string(result->rc); - } - } -#endif -#endif - -#if APR_HAS_OTHER_LDAPSDK - if (tls != APR_LDAP_NONE) { - result->reason = "LDAP: SSL/TLS is currently not supported by " - "APR on this LDAP SDK"; - result->rc = -1; - } -#endif - -#endif /* APR_HAS_LDAP_SSL */ - -} - -/** - * Handle APR_LDAP_OPT_TLS_CACERTFILE - * - * This function sets the CA certificate for further SSL/TLS connections. - * - * The file provided are in different formats depending on the toolkit used: - * - * Netscape: cert7.db file - * Novell: PEM or DER - * OpenLDAP: PEM (others supported?) - * Microsoft: unknown - * Solaris: unknown - */ -static void option_set_cert(apr_pool_t *pool, LDAP *ldap, - const void *invalue, apr_ldap_err_t *result) -{ -#if APR_HAS_LDAP_SSL -#if APR_HAS_LDAPSSL_CLIENT_INIT || APR_HAS_OPENLDAP_LDAPSDK - apr_array_header_t *certs = (apr_array_header_t *)invalue; - struct apr_ldap_opt_tls_cert_t *ents = (struct apr_ldap_opt_tls_cert_t *)certs->elts; - int i = 0; -#endif - - /* Netscape/Mozilla/Solaris SDK */ -#if APR_HAS_NETSCAPE_LDAPSDK || APR_HAS_SOLARIS_LDAPSDK || APR_HAS_MOZILLA_LDAPSDK -#if APR_HAS_LDAPSSL_CLIENT_INIT - const char *nickname = NULL; - const char *secmod = NULL; - const char *key3db = NULL; - const char *cert7db = NULL; - const char *password = NULL; - - /* set up cert7.db, key3.db and secmod parameters */ - for (i = 0; i < certs->nelts; i++) { - switch (ents[i].type) { - case APR_LDAP_CA_TYPE_CERT7_DB: - cert7db = ents[i].path; - break; - case APR_LDAP_CA_TYPE_SECMOD: - secmod = ents[i].path; - break; - case APR_LDAP_CERT_TYPE_KEY3_DB: - key3db = ents[i].path; - break; - case APR_LDAP_CERT_TYPE_NICKNAME: - nickname = ents[i].path; - password = ents[i].password; - break; - default: - result->rc = -1; - result->reason = "LDAP: The Netscape/Mozilla LDAP SDK only " - "understands the CERT7, KEY3 and SECMOD " - "file types."; - break; - } - if (result->rc != LDAP_SUCCESS) { - break; - } - } - - /* actually set the certificate parameters */ - if (result->rc == LDAP_SUCCESS) { - if (nickname) { - result->rc = ldapssl_enable_clientauth(ldap, "", - (char *)password, - (char *)nickname); - if (result->rc != LDAP_SUCCESS) { - result->reason = "LDAP: could not set client certificate: " - "ldapssl_enable_clientauth() failed."; - result->msg = ldap_err2string(result->rc); - } - } - else if (secmod) { - result->rc = ldapssl_advclientauth_init(cert7db, NULL, - key3db ? 1 : 0, key3db, NULL, - 1, secmod, LDAPSSL_AUTH_CNCHECK); - if (result->rc != LDAP_SUCCESS) { - result->reason = "LDAP: ldapssl_advclientauth_init() failed."; - result->msg = ldap_err2string(result->rc); - } - } - else if (key3db) { - result->rc = ldapssl_clientauth_init(cert7db, NULL, - 1, key3db, NULL); - if (result->rc != LDAP_SUCCESS) { - result->reason = "LDAP: ldapssl_clientauth_init() failed."; - result->msg = ldap_err2string(result->rc); - } - } - else { - result->rc = ldapssl_client_init(cert7db, NULL); - if (result->rc != LDAP_SUCCESS) { - result->reason = "LDAP: ldapssl_client_init() failed."; - result->msg = ldap_err2string(result->rc); - } - } - } -#else - result->reason = "LDAP: SSL/TLS ldapssl_client_init() function not " - "supported by this Netscape/Mozilla/Solaris SDK. " - "Certificate authority file not set"; - result->rc = -1; -#endif -#endif - - /* Novell SDK */ -#if APR_HAS_NOVELL_LDAPSDK -#if APR_HAS_LDAPSSL_CLIENT_INIT && APR_HAS_LDAPSSL_ADD_TRUSTED_CERT && APR_HAS_LDAPSSL_CLIENT_DEINIT - /* The Novell library cannot support per connection certificates. Error - * out if the ldap handle is provided. - */ - if (ldap) { - result->rc = -1; - result->reason = "LDAP: The Novell LDAP SDK cannot support the setting " - "of certificates or keys on a per connection basis."; - } - /* Novell's library needs to be initialised first */ - else { - result->rc = ldapssl_client_init(NULL, NULL); - if (result->rc != LDAP_SUCCESS) { - result->msg = ldap_err2string(result-> rc); - result->reason = apr_pstrdup(pool, "LDAP: Could not " - "initialize SSL"); - } - } - /* set one or more certificates */ - for (i = 0; LDAP_SUCCESS == result->rc && i < certs->nelts; i++) { - /* Novell SDK supports DER or BASE64 files. */ - switch (ents[i].type) { - case APR_LDAP_CA_TYPE_DER: - result->rc = ldapssl_add_trusted_cert((void *)ents[i].path, - LDAPSSL_CERT_FILETYPE_DER); - result->msg = ldap_err2string(result->rc); - break; - case APR_LDAP_CA_TYPE_BASE64: - result->rc = ldapssl_add_trusted_cert((void *)ents[i].path, - LDAPSSL_CERT_FILETYPE_B64); - result->msg = ldap_err2string(result->rc); - break; - case APR_LDAP_CERT_TYPE_DER: - result->rc = ldapssl_set_client_cert((void *)ents[i].path, - LDAPSSL_CERT_FILETYPE_DER, - (void*)ents[i].password); - result->msg = ldap_err2string(result->rc); - break; - case APR_LDAP_CERT_TYPE_BASE64: - result->rc = ldapssl_set_client_cert((void *)ents[i].path, - LDAPSSL_CERT_FILETYPE_B64, - (void*)ents[i].password); - result->msg = ldap_err2string(result->rc); - break; - case APR_LDAP_CERT_TYPE_PFX: - result->rc = ldapssl_set_client_cert((void *)ents[i].path, - LDAPSSL_FILETYPE_P12, - (void*)ents[i].password); - result->msg = ldap_err2string(result->rc); - break; - case APR_LDAP_KEY_TYPE_DER: - result->rc = ldapssl_set_client_private_key((void *)ents[i].path, - LDAPSSL_CERT_FILETYPE_DER, - (void*)ents[i].password); - result->msg = ldap_err2string(result->rc); - break; - case APR_LDAP_KEY_TYPE_BASE64: - result->rc = ldapssl_set_client_private_key((void *)ents[i].path, - LDAPSSL_CERT_FILETYPE_B64, - (void*)ents[i].password); - result->msg = ldap_err2string(result->rc); - break; - case APR_LDAP_KEY_TYPE_PFX: - result->rc = ldapssl_set_client_private_key((void *)ents[i].path, - LDAPSSL_FILETYPE_P12, - (void*)ents[i].password); - result->msg = ldap_err2string(result->rc); - break; - default: - result->rc = -1; - result->reason = "LDAP: The Novell LDAP SDK only understands the " - "DER and PEM (BASE64) file types."; - break; - } - if (result->rc != LDAP_SUCCESS) { - break; - } - } -#else - result->reason = "LDAP: ldapssl_client_init(), " - "ldapssl_add_trusted_cert() or " - "ldapssl_client_deinit() functions not supported " - "by this Novell SDK. Certificate authority file " - "not set"; - result->rc = -1; -#endif -#endif - - /* OpenLDAP SDK */ -#if APR_HAS_OPENLDAP_LDAPSDK -#ifdef LDAP_OPT_X_TLS_CACERTFILE -#ifndef LDAP_OPT_X_TLS_NEWCTX - if (ldap) { - result->reason = "LDAP: The OpenLDAP SDK cannot support the setting " - "of certificates or keys on a per connection basis."; - result->rc = -1; - return; - } -#endif - - /* set one or more certificates */ - /* FIXME: make it support setting directories as well as files */ - for (i = 0; i < certs->nelts; i++) { - /* OpenLDAP SDK supports BASE64 files. */ - switch (ents[i].type) { - case APR_LDAP_CA_TYPE_BASE64: - result->rc = ldap_set_option(ldap, LDAP_OPT_X_TLS_CACERTFILE, - (void *)ents[i].path); - result->msg = ldap_err2string(result->rc); - break; - case APR_LDAP_CERT_TYPE_BASE64: - result->rc = ldap_set_option(ldap, LDAP_OPT_X_TLS_CERTFILE, - (void *)ents[i].path); - result->msg = ldap_err2string(result->rc); - break; - case APR_LDAP_KEY_TYPE_BASE64: - result->rc = ldap_set_option(ldap, LDAP_OPT_X_TLS_KEYFILE, - (void *)ents[i].path); - result->msg = ldap_err2string(result->rc); - break; -#ifdef LDAP_OPT_X_TLS_CACERTDIR - case APR_LDAP_CA_TYPE_CACERTDIR_BASE64: - result->rc = ldap_set_option(ldap, LDAP_OPT_X_TLS_CACERTDIR, - (void *)ents[i].path); - result->msg = ldap_err2string(result->rc); - break; -#endif - default: - result->rc = -1; - result->reason = "LDAP: The OpenLDAP SDK only understands the " - "PEM (BASE64) file type."; - break; - } - if (result->rc != LDAP_SUCCESS) { - break; - } - } -#ifdef LDAP_OPT_X_TLS_NEWCTX - /* Certificate settings are now configured, but we also need a new - * TLS context to be created. This applies to both gnuTLS and openssl - */ - if (ldap && (result->rc == LDAP_SUCCESS)) { - int IS_SERVER = 0; - result->rc = ldap_set_option(ldap, LDAP_OPT_X_TLS_NEWCTX, &IS_SERVER); - result->msg = ldap_err2string(result->rc); - } -#endif - -#else - result->reason = "LDAP: LDAP_OPT_X_TLS_CACERTFILE not " - "defined by this OpenLDAP SDK. Certificate " - "authority file not set"; - result->rc = -1; -#endif -#endif - - /* Microsoft SDK */ -#if APR_HAS_MICROSOFT_LDAPSDK - /* Microsoft SDK use the registry certificate store - error out - * here with a message explaining this. */ - result->reason = "LDAP: CA certificates cannot be set using this method, " - "as they are stored in the registry instead."; - result->rc = -1; -#endif - - /* SDK not recognised */ -#if APR_HAS_OTHER_LDAPSDK - result->reason = "LDAP: LDAP_OPT_X_TLS_CACERTFILE not " - "defined by this LDAP SDK. Certificate " - "authority file not set"; - result->rc = -1; -#endif - -#else /* not compiled with SSL Support */ - result->reason = "LDAP: Attempt to set certificate(s) failed. " - "Not built with SSL support"; - result->rc = -1; -#endif /* APR_HAS_LDAP_SSL */ - -} - -#endif /* APR_HAS_LDAP */ - diff --git a/ldap/apr_ldap_rebind.c b/ldap/apr_ldap_rebind.c deleted file mode 100644 index 44772c2e4aa..00000000000 --- a/ldap/apr_ldap_rebind.c +++ /dev/null @@ -1,375 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* apr_ldap_rebind.c -- LDAP rebind callbacks for referrals - * - * The LDAP SDK allows a callback to be set to enable rebinding - * for referral processing. - * - */ - -#include "apr.h" -#include "apr_private.h" -#include "apr_ldap.h" - -#if APR_HAS_LDAP - -#if APR_HAVE_MODULAR_DSO -#define APU_DSO_LDAP_BUILD -#endif - -#include "apr_errno.h" -#include "apr_strings.h" - -#include "stdio.h" - -/* Used to store information about connections for use in the referral rebind callback. */ -struct apr_ldap_rebind_entry { - apr_pool_t *pool; - LDAP *index; - const char *bindDN; - const char *bindPW; - struct apr_ldap_rebind_entry *next; -}; -typedef struct apr_ldap_rebind_entry apr_ldap_rebind_entry_t; - - -#ifdef NETWARE -#define get_apd \ - APP_DATA* apd = (APP_DATA*)get_app_data(gLibId); \ - apr_ldap_xref_lock = (apr_thread_mutex_t *)apd->gs_ldap_xref_lock; \ - xref_head = (apr_ldap_rebind_entry_t *)apd->gs_xref_head; -#endif - -#if APR_HAS_THREADS -static apr_thread_mutex_t *apr_ldap_xref_lock = NULL; -#endif -static apr_ldap_rebind_entry_t *xref_head = NULL; - -static int apr_ldap_rebind_set_callback(LDAP *ld); -static apr_status_t apr_ldap_rebind_remove_helper(void *data); - -static apr_status_t apr_ldap_pool_cleanup_set_null(void *data_) -{ - void **ptr = (void **)data_; - *ptr = NULL; - return APR_SUCCESS; -} - - -/* APR utility routine used to create the xref_lock. */ -APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool) -{ - apr_status_t retcode = APR_SUCCESS; - -#ifdef NETWARE - get_apd -#endif - - /* run after apr_thread_mutex_create cleanup */ - apr_pool_cleanup_register(pool, &apr_ldap_xref_lock, apr_ldap_pool_cleanup_set_null, - apr_pool_cleanup_null); - -#if APR_HAS_THREADS - if (apr_ldap_xref_lock == NULL) { - retcode = apr_thread_mutex_create(&apr_ldap_xref_lock, APR_THREAD_MUTEX_DEFAULT, pool); - } -#endif - - return(retcode); -} - - -APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, - LDAP *ld, - const char *bindDN, - const char *bindPW) -{ - apr_status_t retcode = APR_SUCCESS; - apr_ldap_rebind_entry_t *new_xref; - -#ifdef NETWARE - get_apd -#endif - - new_xref = (apr_ldap_rebind_entry_t *)apr_pcalloc(pool, sizeof(apr_ldap_rebind_entry_t)); - if (new_xref) { - new_xref->pool = pool; - new_xref->index = ld; - if (bindDN) { - new_xref->bindDN = apr_pstrdup(pool, bindDN); - } - if (bindPW) { - new_xref->bindPW = apr_pstrdup(pool, bindPW); - } - -#if APR_HAS_THREADS - retcode = apr_thread_mutex_lock(apr_ldap_xref_lock); - if (retcode != APR_SUCCESS) { - return retcode; - } -#endif - - new_xref->next = xref_head; - xref_head = new_xref; - -#if APR_HAS_THREADS - retcode = apr_thread_mutex_unlock(apr_ldap_xref_lock); - if (retcode != APR_SUCCESS) { - return retcode; - } -#endif - } - else { - return(APR_ENOMEM); - } - - retcode = apr_ldap_rebind_set_callback(ld); - if (APR_SUCCESS != retcode) { - apr_ldap_rebind_remove(ld); - return retcode; - } - - apr_pool_cleanup_register(pool, ld, - apr_ldap_rebind_remove_helper, - apr_pool_cleanup_null); - - return(APR_SUCCESS); -} - - -APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld) -{ - apr_ldap_rebind_entry_t *tmp_xref, *prev = NULL; - apr_status_t retcode = 0; - -#ifdef NETWARE - get_apd -#endif - -#if APR_HAS_THREADS - retcode = apr_thread_mutex_lock(apr_ldap_xref_lock); - if (retcode != APR_SUCCESS) { - return retcode; - } -#endif - tmp_xref = xref_head; - - while ((tmp_xref) && (tmp_xref->index != ld)) { - prev = tmp_xref; - tmp_xref = tmp_xref->next; - } - - if (tmp_xref) { - if (tmp_xref == xref_head) { - xref_head = xref_head->next; - } - else { - prev->next = tmp_xref->next; - } - - /* tmp_xref and its contents were pool allocated so they don't need to be freed here. */ - - /* remove the cleanup, just in case this was done manually */ - apr_pool_cleanup_kill(tmp_xref->pool, tmp_xref->index, - apr_ldap_rebind_remove_helper); - } - -#if APR_HAS_THREADS - retcode = apr_thread_mutex_unlock(apr_ldap_xref_lock); - if (retcode != APR_SUCCESS) { - return retcode; - } -#endif - return APR_SUCCESS; -} - - -static apr_status_t apr_ldap_rebind_remove_helper(void *data) -{ - LDAP *ld = (LDAP *)data; - apr_ldap_rebind_remove(ld); - return APR_SUCCESS; -} - -#if APR_HAS_TIVOLI_LDAPSDK || APR_HAS_OPENLDAP_LDAPSDK || APR_HAS_NOVELL_LDAPSDK -static apr_ldap_rebind_entry_t *apr_ldap_rebind_lookup(LDAP *ld) -{ - apr_ldap_rebind_entry_t *tmp_xref, *match = NULL; - -#ifdef NETWARE - get_apd -#endif - -#if APR_HAS_THREADS - apr_thread_mutex_lock(apr_ldap_xref_lock); -#endif - tmp_xref = xref_head; - - while (tmp_xref) { - if (tmp_xref->index == ld) { - match = tmp_xref; - tmp_xref = NULL; - } - else { - tmp_xref = tmp_xref->next; - } - } - -#if APR_HAS_THREADS - apr_thread_mutex_unlock(apr_ldap_xref_lock); -#endif - - return (match); -} -#endif - -#if APR_HAS_TIVOLI_LDAPSDK - -/* LDAP_rebindproc() Tivoli LDAP style - * Rebind callback function. Called when chasing referrals. See API docs. - * ON ENTRY: - * ld Pointer to an LDAP control structure. (input only) - * binddnp Pointer to an Application DName used for binding (in *or* out) - * passwdp Pointer to the password associated with the DName (in *or* out) - * methodp Pointer to the Auth method (output only) - * freeit Flag to indicate if this is a lookup or a free request (input only) - */ -static int LDAP_rebindproc(LDAP *ld, char **binddnp, char **passwdp, int *methodp, int freeit) -{ - if (!freeit) { - apr_ldap_rebind_entry_t *my_conn; - - *methodp = LDAP_AUTH_SIMPLE; - my_conn = apr_ldap_rebind_lookup(ld); - - if ((my_conn) && (my_conn->bindDN != NULL)) { - *binddnp = strdup(my_conn->bindDN); - *passwdp = strdup(my_conn->bindPW); - } else { - *binddnp = NULL; - *passwdp = NULL; - } - } else { - if (*binddnp) { - free(*binddnp); - } - if (*passwdp) { - free(*passwdp); - } - } - - return LDAP_SUCCESS; -} - -static int apr_ldap_rebind_set_callback(LDAP *ld) -{ - ldap_set_rebind_proc(ld, (LDAPRebindProc)LDAP_rebindproc); - return APR_SUCCESS; -} - -#elif APR_HAS_OPENLDAP_LDAPSDK - -/* LDAP_rebindproc() openLDAP V3 style - * ON ENTRY: - * ld Pointer to an LDAP control structure. (input only) - * url Unused in this routine - * request Unused in this routine - * msgid Unused in this routine - * params Unused in this routine - * - * or - * - * ld Pointer to an LDAP control structure. (input only) - * url Unused in this routine - * request Unused in this routine - * msgid Unused in this routine - */ -#if defined(LDAP_SET_REBIND_PROC_THREE) -static int LDAP_rebindproc(LDAP *ld, LDAP_CONST char *url, ber_tag_t request, - ber_int_t msgid, void *params) -#else -static int LDAP_rebindproc(LDAP *ld, LDAP_CONST char *url, int request, - ber_int_t msgid) -#endif -{ - apr_ldap_rebind_entry_t *my_conn; - const char *bindDN = NULL; - const char *bindPW = NULL; - - my_conn = apr_ldap_rebind_lookup(ld); - - if ((my_conn) && (my_conn->bindDN != NULL)) { - bindDN = my_conn->bindDN; - bindPW = my_conn->bindPW; - } - - return (ldap_bind_s(ld, bindDN, bindPW, LDAP_AUTH_SIMPLE)); -} - -static int apr_ldap_rebind_set_callback(LDAP *ld) -{ -#if defined(LDAP_SET_REBIND_PROC_THREE) - ldap_set_rebind_proc(ld, LDAP_rebindproc, NULL); -#else - ldap_set_rebind_proc(ld, LDAP_rebindproc); -#endif - return APR_SUCCESS; -} - -#elif APR_HAS_NOVELL_LDAPSDK - -/* LDAP_rebindproc() openLDAP V3 style - * ON ENTRY: - * ld Pointer to an LDAP control structure. (input only) - * url Unused in this routine - * request Unused in this routine - * msgid Unused in this routine - */ -static int LDAP_rebindproc(LDAP *ld, LDAP_CONST char *url, int request, ber_int_t msgid) -{ - - apr_ldap_rebind_entry_t *my_conn; - const char *bindDN = NULL; - const char *bindPW = NULL; - - my_conn = apr_ldap_rebind_lookup(ld); - - if ((my_conn) && (my_conn->bindDN != NULL)) { - bindDN = my_conn->bindDN; - bindPW = my_conn->bindPW; - } - - return (ldap_bind_s(ld, bindDN, bindPW, LDAP_AUTH_SIMPLE)); -} - -static int apr_ldap_rebind_set_callback(LDAP *ld) -{ - ldap_set_rebind_proc(ld, LDAP_rebindproc); - return APR_SUCCESS; -} - -#else /* Implementation not recognised */ - -static int apr_ldap_rebind_set_callback(LDAP *ld) -{ - return APR_ENOTIMPL; -} - -#endif - - -#endif /* APR_HAS_LDAP */ diff --git a/ldap/apr_ldap_stub.c b/ldap/apr_ldap_stub.c deleted file mode 100644 index 929351b0c0b..00000000000 --- a/ldap/apr_ldap_stub.c +++ /dev/null @@ -1,145 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "apr.h" -#include "apu.h" -#include "apr_private.h" -#include "apr_ldap.h" -#include "apu_internal.h" -#include "apr_dso.h" -#include "apr_errno.h" -#include "apr_pools.h" -#include "apr_strings.h" -#include "apr_version.h" - -#if APR_HAS_LDAP - -#if APR_HAVE_MODULAR_DSO - -static struct apr__ldap_dso_fntable *lfn = NULL; - -static apr_status_t load_ldap(apr_pool_t *pool) -{ - char *modname; - apr_dso_handle_sym_t symbol; - apr_status_t rv; - - /* deprecate in 2.0 - permit implicit initialization */ - apu_dso_init(pool); - - rv = apu_dso_mutex_lock(); - if (rv) { - return rv; - } - -#if defined(WIN32) - modname = "apr_ldap-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll"; -#else - modname = "apr_ldap-" APR_STRINGIFY(APR_MAJOR_VERSION) ".so"; -#endif - rv = apu_dso_load(NULL, &symbol, modname, "apr__ldap_fns", pool); - if (rv == APR_SUCCESS) { - lfn = symbol; - } - apu_dso_mutex_unlock(); - - return rv; -} - -#define LOAD_LDAP_STUB(pool, failres) \ - if (!lfn && (load_ldap(pool) != APR_SUCCESS)) \ - return failres; - -APR_DECLARE_LDAP(int) apr_ldap_info(apr_pool_t *pool, - apr_ldap_err_t **result_err) -{ - LOAD_LDAP_STUB(pool, -1); - return lfn->info(pool, result_err); -} - -APR_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool, - LDAP **ldap, - const char *hostname, - int portno, - int secure, - apr_ldap_err_t **result_err) -{ - LOAD_LDAP_STUB(pool, -1); - return lfn->init(pool, ldap, hostname, portno, secure, result_err); -} - -APR_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool, - const char *cert_auth_file, - int cert_file_type, - apr_ldap_err_t **result_err) -{ - LOAD_LDAP_STUB(pool, -1); - return lfn->ssl_init(pool, cert_auth_file, cert_file_type, result_err); -} - -APR_DECLARE_LDAP(int) apr_ldap_ssl_deinit(void) -{ - if (!lfn) - return -1; - return lfn->ssl_deinit(); -} - -APR_DECLARE_LDAP(int) apr_ldap_get_option(apr_pool_t *pool, - LDAP *ldap, - int option, - void *outvalue, - apr_ldap_err_t **result_err) -{ - LOAD_LDAP_STUB(pool, -1); - return lfn->get_option(pool, ldap, option, outvalue, result_err); -} - -APR_DECLARE_LDAP(int) apr_ldap_set_option(apr_pool_t *pool, - LDAP *ldap, - int option, - const void *invalue, - apr_ldap_err_t **result_err) -{ - LOAD_LDAP_STUB(pool, -1); - return lfn->set_option(pool, ldap, option, invalue, result_err); -} - -APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool) -{ - LOAD_LDAP_STUB(pool, APR_EGENERAL); - return lfn->rebind_init(pool); -} - -APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, - LDAP *ld, - const char *bindDN, - const char *bindPW) -{ - LOAD_LDAP_STUB(pool, APR_EGENERAL); - return lfn->rebind_add(pool, ld, bindDN, bindPW); -} - -APR_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld) -{ - if (!lfn) - return APR_EGENERAL; - return lfn->rebind_remove(ld); -} - -#endif /* APR_HAVE_MODULAR_DSO */ - -#endif /* APR_HAS_LDAP */ - diff --git a/ldap/apr_ldap_url.c b/ldap/apr_ldap_url.c deleted file mode 100644 index da6efde7dff..00000000000 --- a/ldap/apr_ldap_url.c +++ /dev/null @@ -1,694 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Portions Copyright 1998-2002 The OpenLDAP Foundation - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted only as authorized by the OpenLDAP - * Public License. A copy of this license is available at - * http://www.OpenLDAP.org/license.html or in file LICENSE in the - * top-level directory of the distribution. - * - * OpenLDAP is a registered trademark of the OpenLDAP Foundation. - * - * Individual files and/or contributed packages may be copyright by - * other parties and subject to additional restrictions. - * - * This work is derived from the University of Michigan LDAP v3.3 - * distribution. Information concerning this software is available - * at: http://www.umich.edu/~dirsvcs/ldap/ - * - * This work also contains materials derived from public sources. - * - * Additional information about OpenLDAP can be obtained at: - * http://www.openldap.org/ - */ - -/* - * Portions Copyright (c) 1992-1996 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -/* apr_ldap_url.c -- LDAP URL (RFC 2255) related routines - * - * Win32 and perhaps other non-OpenLDAP based ldap libraries may be - * missing ldap_url_* APIs. We focus here on the one significant - * aspect, which is parsing. We have [for the time being] omitted - * the ldap_url_search APIs. - * - * LDAP URLs look like this: - * ldap[is]://host:port[/[dn[?[attributes][?[scope][?[filter][?exts]]]]]] - * - * where: - * attributes is a comma separated list - * scope is one of these three strings: base one sub (default=base) - * filter is an string-represented filter as in RFC 2254 - * - * e.g., ldap://host:port/dc=com?o,cn?base?o=openldap?extension - * - * Tolerates URLs that look like: and - */ - -#include "apu.h" -#include "apr_pools.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_ldap.h" - -#if APR_HAS_LDAP - -#if APR_HAVE_STDLIB_H -#include -#endif - -#ifndef LDAPS_PORT -#define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */ -#endif - -#define APR_LDAP_URL_PREFIX "ldap://" -#define APR_LDAP_URL_PREFIX_LEN (sizeof(APR_LDAP_URL_PREFIX)-1) -#define APR_LDAPS_URL_PREFIX "ldaps://" -#define APR_LDAPS_URL_PREFIX_LEN (sizeof(APR_LDAPS_URL_PREFIX)-1) -#define APR_LDAPI_URL_PREFIX "ldapi://" -#define APR_LDAPI_URL_PREFIX_LEN (sizeof(APR_LDAPI_URL_PREFIX)-1) -#define APR_LDAP_URL_URLCOLON "URL:" -#define APR_LDAP_URL_URLCOLON_LEN (sizeof(APR_LDAP_URL_URLCOLON)-1) - - -/* local functions */ -static const char* skip_url_prefix(const char *url, - int *enclosedp, - const char **scheme); - -static void apr_ldap_pvt_hex_unescape(char *s); - -static int apr_ldap_pvt_unhex(int c); - -static char **apr_ldap_str2charray(apr_pool_t *pool, - const char *str, - const char *brkstr); - - -/** - * Is this URL an ldap url? - * - */ -APR_DECLARE(int) apr_ldap_is_ldap_url(const char *url) -{ - int enclosed; - const char * scheme; - - if( url == NULL ) { - return 0; - } - - if( skip_url_prefix( url, &enclosed, &scheme ) == NULL ) { - return 0; - } - - return 1; -} - -/** - * Is this URL a secure ldap url? - * - */ -APR_DECLARE(int) apr_ldap_is_ldaps_url(const char *url) -{ - int enclosed; - const char * scheme; - - if( url == NULL ) { - return 0; - } - - if( skip_url_prefix( url, &enclosed, &scheme ) == NULL ) { - return 0; - } - - return strcmp(scheme, "ldaps") == 0; -} - -/** - * Is this URL an ldap socket url? - * - */ -APR_DECLARE(int) apr_ldap_is_ldapi_url(const char *url) -{ - int enclosed; - const char * scheme; - - if( url == NULL ) { - return 0; - } - - if( skip_url_prefix( url, &enclosed, &scheme ) == NULL ) { - return 0; - } - - return strcmp(scheme, "ldapi") == 0; -} - - -static const char *skip_url_prefix(const char *url, int *enclosedp, - const char **scheme) -{ - /* - * return non-zero if this looks like a LDAP URL; zero if not - * if non-zero returned, *urlp will be moved past "ldap://" part of URL - */ - const char *p; - - if ( url == NULL ) { - return( NULL ); - } - - p = url; - - /* skip leading '<' (if any) */ - if ( *p == '<' ) { - *enclosedp = 1; - ++p; - } else { - *enclosedp = 0; - } - - /* skip leading "URL:" (if any) */ - if ( strncasecmp( p, APR_LDAP_URL_URLCOLON, APR_LDAP_URL_URLCOLON_LEN ) == 0 ) { - p += APR_LDAP_URL_URLCOLON_LEN; - } - - /* check for "ldap://" prefix */ - if ( strncasecmp( p, APR_LDAP_URL_PREFIX, APR_LDAP_URL_PREFIX_LEN ) == 0 ) { - /* skip over "ldap://" prefix and return success */ - p += APR_LDAP_URL_PREFIX_LEN; - *scheme = "ldap"; - return( p ); - } - - /* check for "ldaps://" prefix */ - if ( strncasecmp( p, APR_LDAPS_URL_PREFIX, APR_LDAPS_URL_PREFIX_LEN ) == 0 ) { - /* skip over "ldaps://" prefix and return success */ - p += APR_LDAPS_URL_PREFIX_LEN; - *scheme = "ldaps"; - return( p ); - } - - /* check for "ldapi://" prefix */ - if ( strncasecmp( p, APR_LDAPI_URL_PREFIX, APR_LDAPI_URL_PREFIX_LEN ) == 0 ) { - /* skip over "ldapi://" prefix and return success */ - p += APR_LDAPI_URL_PREFIX_LEN; - *scheme = "ldapi"; - return( p ); - } - - return( NULL ); -} - - -static int str2scope(const char *p) -{ - if ( strcasecmp( p, "one" ) == 0 ) { - return LDAP_SCOPE_ONELEVEL; - - } else if ( strcasecmp( p, "onetree" ) == 0 ) { - return LDAP_SCOPE_ONELEVEL; - - } else if ( strcasecmp( p, "base" ) == 0 ) { - return LDAP_SCOPE_BASE; - - } else if ( strcasecmp( p, "sub" ) == 0 ) { - return LDAP_SCOPE_SUBTREE; - - } else if ( strcasecmp( p, "subtree" ) == 0 ) { - return LDAP_SCOPE_SUBTREE; - } - - return( -1 ); -} - - -/** - * Parse the URL provided into an apr_ldap_url_desc_t object. - * - * APR_SUCCESS is returned on success, APR_EGENERAL on failure. - * The LDAP result code and reason string is returned in the - * apr_ldap_err_t structure. - */ -APR_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool, - const char *url_in, - apr_ldap_url_desc_t **ludpp, - apr_ldap_err_t **result_err) -{ - apr_ldap_url_desc_t *ludp; - char *p, *q, *r; - int i, enclosed; - const char *scheme = NULL; - const char *url_tmp; - char *url; - - apr_ldap_err_t *result = (apr_ldap_err_t *)apr_pcalloc(pool, sizeof(apr_ldap_err_t)); - *result_err = result; - - /* sanity check our parameters */ - if( url_in == NULL || ludpp == NULL ) { - result->reason = "Either the LDAP URL, or the URL structure was NULL. Oops."; - result->rc = APR_LDAP_URL_ERR_PARAM; - return APR_EGENERAL; - } - - *ludpp = NULL; /* pessimistic */ - - url_tmp = skip_url_prefix( url_in, &enclosed, &scheme ); - if ( url_tmp == NULL ) { - result->reason = "The scheme was not recognised as a valid LDAP URL scheme."; - result->rc = APR_LDAP_URL_ERR_BADSCHEME; - return APR_EGENERAL; - } - - /* make working copy of the remainder of the URL */ - url = (char *)apr_pstrdup(pool, url_tmp); - if ( url == NULL ) { - result->reason = "Out of memory parsing LDAP URL."; - result->rc = APR_LDAP_URL_ERR_MEM; - return APR_EGENERAL; - } - - if ( enclosed ) { - p = &url[strlen(url)-1]; - - if( *p != '>' ) { - result->reason = "Bad enclosure error while parsing LDAP URL."; - result->rc = APR_LDAP_URL_ERR_BADENCLOSURE; - return APR_EGENERAL; - } - - *p = '\0'; - } - - /* allocate return struct */ - ludp = (apr_ldap_url_desc_t *)apr_pcalloc(pool, sizeof(apr_ldap_url_desc_t)); - if ( ludp == NULL ) { - result->reason = "Out of memory parsing LDAP URL."; - result->rc = APR_LDAP_URL_ERR_MEM; - return APR_EGENERAL; - } - - ludp->lud_next = NULL; - ludp->lud_host = NULL; - ludp->lud_port = LDAP_PORT; - ludp->lud_dn = NULL; - ludp->lud_attrs = NULL; - ludp->lud_filter = NULL; - ludp->lud_scope = -1; - ludp->lud_filter = NULL; - ludp->lud_exts = NULL; - - ludp->lud_scheme = (char *)apr_pstrdup(pool, scheme); - if ( ludp->lud_scheme == NULL ) { - result->reason = "Out of memory parsing LDAP URL."; - result->rc = APR_LDAP_URL_ERR_MEM; - return APR_EGENERAL; - } - - if( strcasecmp( ludp->lud_scheme, "ldaps" ) == 0 ) { - ludp->lud_port = LDAPS_PORT; - } - - /* scan forward for '/' that marks end of hostport and begin. of dn */ - p = strchr( url, '/' ); - - if( p != NULL ) { - /* terminate hostport; point to start of dn */ - *p++ = '\0'; - } - - /* IPv6 syntax with [ip address]:port */ - if ( *url == '[' ) { - r = strchr( url, ']' ); - if ( r == NULL ) { - result->reason = "Bad LDAP URL while parsing IPV6 syntax."; - result->rc = APR_LDAP_URL_ERR_BADURL; - return APR_EGENERAL; - } - *r++ = '\0'; - q = strrchr( r, ':' ); - } else { - q = strrchr( url, ':' ); - } - - if ( q != NULL ) { - apr_ldap_pvt_hex_unescape( ++q ); - - if( *q == '\0' ) { - result->reason = "Bad LDAP URL while parsing."; - result->rc = APR_LDAP_URL_ERR_BADURL; - return APR_EGENERAL; - } - - ludp->lud_port = atoi( q ); - } - - apr_ldap_pvt_hex_unescape( url ); - - /* If [ip address]:port syntax, url is [ip and we skip the [ */ - ludp->lud_host = (char *)apr_pstrdup(pool, url + ( *url == '[' )); - if( ludp->lud_host == NULL ) { - result->reason = "Out of memory parsing LDAP URL."; - result->rc = APR_LDAP_URL_ERR_MEM; - return APR_EGENERAL; - } - - /* - * Kludge. ldap://111.222.333.444:389??cn=abc,o=company - * - * On early Novell releases, search references/referrals were returned - * in this format, i.e., the dn was kind of in the scope position, - * but the required slash is missing. The whole thing is illegal syntax, - * but we need to account for it. Fortunately it can't be confused with - * anything real. - */ - if( (p == NULL) && (q != NULL) && ((q = strchr( q, '?')) != NULL)) { - q++; - /* ? immediately followed by question */ - if( *q == '?') { - q++; - if( *q != '\0' ) { - /* parse dn part */ - apr_ldap_pvt_hex_unescape( q ); - ludp->lud_dn = (char *)apr_pstrdup(pool, q); - } else { - ludp->lud_dn = (char *)apr_pstrdup(pool, ""); - } - - if( ludp->lud_dn == NULL ) { - result->reason = "Out of memory parsing LDAP URL."; - result->rc = APR_LDAP_URL_ERR_MEM; - return APR_EGENERAL; - } - } - } - - if( p == NULL ) { - *ludpp = ludp; - return APR_SUCCESS; - } - - /* scan forward for '?' that may marks end of dn */ - q = strchr( p, '?' ); - - if( q != NULL ) { - /* terminate dn part */ - *q++ = '\0'; - } - - if( *p != '\0' ) { - /* parse dn part */ - apr_ldap_pvt_hex_unescape( p ); - ludp->lud_dn = (char *)apr_pstrdup(pool, p); - } else { - ludp->lud_dn = (char *)apr_pstrdup(pool, ""); - } - - if( ludp->lud_dn == NULL ) { - result->reason = "Out of memory parsing LDAP URL."; - result->rc = APR_LDAP_URL_ERR_MEM; - return APR_EGENERAL; - } - - if( q == NULL ) { - /* no more */ - *ludpp = ludp; - return APR_SUCCESS; - } - - /* scan forward for '?' that may marks end of attributes */ - p = q; - q = strchr( p, '?' ); - - if( q != NULL ) { - /* terminate attributes part */ - *q++ = '\0'; - } - - if( *p != '\0' ) { - /* parse attributes */ - apr_ldap_pvt_hex_unescape( p ); - ludp->lud_attrs = apr_ldap_str2charray(pool, p, ","); - - if( ludp->lud_attrs == NULL ) { - result->reason = "Bad attributes encountered while parsing LDAP URL."; - result->rc = APR_LDAP_URL_ERR_BADATTRS; - return APR_EGENERAL; - } - } - - if ( q == NULL ) { - /* no more */ - *ludpp = ludp; - return APR_SUCCESS; - } - - /* scan forward for '?' that may marks end of scope */ - p = q; - q = strchr( p, '?' ); - - if( q != NULL ) { - /* terminate the scope part */ - *q++ = '\0'; - } - - if( *p != '\0' ) { - /* parse the scope */ - apr_ldap_pvt_hex_unescape( p ); - ludp->lud_scope = str2scope( p ); - - if( ludp->lud_scope == -1 ) { - result->reason = "Bad scope encountered while parsing LDAP URL."; - result->rc = APR_LDAP_URL_ERR_BADSCOPE; - return APR_EGENERAL; - } - } - - if ( q == NULL ) { - /* no more */ - *ludpp = ludp; - return APR_SUCCESS; - } - - /* scan forward for '?' that may marks end of filter */ - p = q; - q = strchr( p, '?' ); - - if( q != NULL ) { - /* terminate the filter part */ - *q++ = '\0'; - } - - if( *p != '\0' ) { - /* parse the filter */ - apr_ldap_pvt_hex_unescape( p ); - - if( ! *p ) { - /* missing filter */ - result->reason = "Bad filter encountered while parsing LDAP URL."; - result->rc = APR_LDAP_URL_ERR_BADFILTER; - return APR_EGENERAL; - } - - ludp->lud_filter = (char *)apr_pstrdup(pool, p); - if( ludp->lud_filter == NULL ) { - result->reason = "Out of memory parsing LDAP URL."; - result->rc = APR_LDAP_URL_ERR_MEM; - return APR_EGENERAL; - } - } - - if ( q == NULL ) { - /* no more */ - *ludpp = ludp; - return APR_SUCCESS; - } - - /* scan forward for '?' that may marks end of extensions */ - p = q; - q = strchr( p, '?' ); - - if( q != NULL ) { - /* extra '?' */ - result->reason = "Bad URL encountered while parsing LDAP URL."; - result->rc = APR_LDAP_URL_ERR_BADURL; - return APR_EGENERAL; - } - - /* parse the extensions */ - ludp->lud_exts = apr_ldap_str2charray(pool, p, ","); - if( ludp->lud_exts == NULL ) { - result->reason = "Bad extensions encountered while parsing LDAP URL."; - result->rc = APR_LDAP_URL_ERR_BADEXTS; - return APR_EGENERAL; - } - - for( i=0; ludp->lud_exts[i] != NULL; i++ ) { - apr_ldap_pvt_hex_unescape( ludp->lud_exts[i] ); - - if( *ludp->lud_exts[i] == '!' ) { - /* count the number of critical extensions */ - ludp->lud_crit_exts++; - } - } - - if( i == 0 ) { - /* must have 1 or more */ - result->reason = "Bad extensions encountered while parsing LDAP URL."; - result->rc = APR_LDAP_URL_ERR_BADEXTS; - return APR_EGENERAL; - } - - /* no more */ - *ludpp = ludp; - return APR_SUCCESS; -} - - -/** - * Parse the URL provided into an apr_ldap_url_desc_t object. - * - * APR_SUCCESS is returned on success, APR_EGENERAL on failure. - * The LDAP result code and reason string is returned in the - * apr_ldap_err_t structure. - */ -APR_DECLARE(int) apr_ldap_url_parse(apr_pool_t *pool, - const char *url_in, - apr_ldap_url_desc_t **ludpp, - apr_ldap_err_t **result_err) -{ - - int rc = apr_ldap_url_parse_ext(pool, url_in, ludpp, result_err); - if( rc != APR_SUCCESS ) { - return rc; - } - - if ((*ludpp)->lud_scope == -1) { - (*ludpp)->lud_scope = LDAP_SCOPE_BASE; - } - - if ((*ludpp)->lud_host != NULL && *(*ludpp)->lud_host == '\0') { - (*ludpp)->lud_host = NULL; - } - - return rc; - -} - - -static void apr_ldap_pvt_hex_unescape(char *s) -{ - /* - * Remove URL hex escapes from s... done in place. The basic concept for - * this routine is borrowed from the WWW library HTUnEscape() routine. - */ - char *p; - - for ( p = s; *s != '\0'; ++s ) { - if ( *s == '%' ) { - if ( *++s == '\0' ) { - break; - } - *p = apr_ldap_pvt_unhex( *s ) << 4; - if ( *++s == '\0' ) { - break; - } - *p++ += apr_ldap_pvt_unhex( *s ); - } else { - *p++ = *s; - } - } - - *p = '\0'; -} - - -static int apr_ldap_pvt_unhex(int c) -{ - return( c >= '0' && c <= '9' ? c - '0' - : c >= 'A' && c <= 'F' ? c - 'A' + 10 - : c - 'a' + 10 ); -} - - -/** - * Convert a string to a character array - */ -static char **apr_ldap_str2charray(apr_pool_t *pool, - const char *str_in, - const char *brkstr) -{ - char **res; - char *str, *s; - char *lasts; - int i; - - /* protect the input string from strtok */ - str = (char *)apr_pstrdup(pool, str_in); - if( str == NULL ) { - return NULL; - } - - i = 1; - for ( s = str; *s; s++ ) { - /* Warning: this strchr was previously ldap_utf8_strchr(), check - * whether this particular code has any charset issues. - */ - if ( strchr( brkstr, *s ) != NULL ) { - i++; - } - } - - res = (char **) apr_pcalloc(pool, (i + 1) * sizeof(char *)); - if( res == NULL ) { - return NULL; - } - - i = 0; - - for ( s = (char *)apr_strtok( str, brkstr, &lasts ); - s != NULL; - s = (char *)apr_strtok( NULL, brkstr, &lasts ) ) { - - res[i] = (char *)apr_pstrdup(pool, s); - if(res[i] == NULL) { - return NULL; - } - - i++; - } - - res[i] = NULL; - - return( res ); - -} - -#endif /* APR_HAS_LDAP */ diff --git a/libapr.dsp b/libapr.dsp index 1f96fdfbded..bd598bf39be 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -409,30 +409,6 @@ SOURCE=.\file_io\unix\tempdir.c SOURCE=.\hooks\apr_hooks.c # End Source File # End Group -# Begin Group "ldap" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\ldap\apr_ldap_init.c -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_option.c -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_rebind.c -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_stub.c -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_url.c -# End Source File -# End Group # Begin Group "locks" # PROP Default_Filter "" @@ -969,61 +945,6 @@ SOURCE=.\include\apr_inherit.h # End Source File # Begin Source File -SOURCE=.\include\apr_ldap.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apr_ldap.hnw -# End Source File -# Begin Source File - -SOURCE=.\include\apr_ldap.hw - -!IF "$(CFG)" == "libapr - Win32 Release" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - Win32 Debug" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - x64 Release" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - x64 Debug" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - SOURCE=.\include\apr_lib.h # End Source File # Begin Source File diff --git a/misc/netware/start.c b/misc/netware/start.c index 76817d96c00..e044a102283 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -22,7 +22,6 @@ #include "apr_arch_misc.h" /* for WSAHighByte / WSALowByte */ #include "apr_arch_proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ #include "apr_arch_internal_time.h" -#include "apr_ldap.h" /* for apr_ldap_rebind_init() */ #ifdef USE_WINSOCK /* Prototypes missing from older NDKs */ @@ -163,9 +162,6 @@ APR_DECLARE(apr_status_t) apr_initialize(void) #endif apr_signal_init(pool); -#if APR_HAS_LDAP - apr_ldap_rebind_init(pool); -#endif return APR_SUCCESS; } diff --git a/test/Makefile.in b/test/Makefile.in index 2c8f1725740..62f7b6bd3db 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -31,7 +31,7 @@ TESTS = testtime.lo teststr.lo testvsn.lo testipsub.lo testshm.lo \ testatomic.lo testflock.lo testsock.lo testglobalmutex.lo \ teststrnatcmp.lo testfilecopy.lo testtemp.lo testlfs.lo \ testcond.lo testuri.lo testmemcache.lo testdate.lo \ - testxlate.lo testdbd.lo testrmm.lo testldap.lo testmd4.lo \ + testxlate.lo testdbd.lo testrmm.lo testmd4.lo \ teststrmatch.lo testpass.lo testcrypto.lo testqueue.lo \ testbuckets.lo testxml.lo testdbm.lo testuuid.lo testmd5.lo \ testreslist.lo testbase64.lo testhooks.lo testlfsabi.lo \ @@ -87,7 +87,7 @@ testutil.lo: $(srcdir)/abts.c $(srcdir)/abts.h $(srcdir)/abts_tests.h \ OBJECTS_testall = abts.lo testutil.lo $(TESTS) $(LOCAL_LIBS) testall@EXEEXT@: $(OBJECTS_testall) - $(LINK_PROG) $(OBJECTS_testall) $(ALL_LIBS) @LDADD_ldap@ + $(LINK_PROG) $(OBJECTS_testall) $(ALL_LIBS) # For VPATH builds; where we have no ./data, copy us some data # if we wait until 'make check', then 'make; ./testall' fails; if test ! -d "./data"; then cp -r $(srcdir)/data data; fi @@ -176,7 +176,7 @@ check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) if test "$$prog" = 'dbd'; then \ for driver in none @apu_dbd_tests@; do \ if test "$$driver" != 'none'; then \ - @shlibpath_var@="`echo "../dbm/.libs:../dbd/.libs:../ldap/.libs:$$@shlibpath_var@" | sed -e 's/::*$$//'`" \ + @shlibpath_var@="`echo "../dbm/.libs:../dbd/.libs:$$@shlibpath_var@" | sed -e 's/::*$$//'`" \ ./$$prog $$driver; \ status=$$?; \ if test $$status != 0; then \ @@ -186,7 +186,7 @@ check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) fi; \ done; \ else \ - @shlibpath_var@="`echo "../dbm/.libs:../dbd/.libs:../ldap/.libs:$$@shlibpath_var@" | sed -e 's/::*$$//'`" \ + @shlibpath_var@="`echo "../dbm/.libs:../dbd/.libs:$$@shlibpath_var@" | sed -e 's/::*$$//'`" \ ./$$prog; \ status=$$?; \ if test $$status != 0; then \ diff --git a/test/Makefile.win b/test/Makefile.win index e9e5e884db6..23f474bb1ea 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -101,7 +101,6 @@ ALL_TESTS = \ $(INTDIR)\testhash.obj \ $(INTDIR)\testhooks.obj \ $(INTDIR)\testipsub.obj \ - $(INTDIR)\testldap.obj \ $(INTDIR)\testlfs.obj \ $(INTDIR)\testlfsabi.obj \ $(INTDIR)\testlfsabi32.obj \ diff --git a/test/abts_tests.h b/test/abts_tests.h index 01234354ae7..09713659c8d 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -77,7 +77,6 @@ const struct testlist { {testmd4}, {testmd5}, {testcrypto}, - {testldap}, {testdbd}, {testdate}, {testmemcache}, diff --git a/test/testldap.c b/test/testldap.c deleted file mode 100644 index 4f4fef907bc..00000000000 --- a/test/testldap.c +++ /dev/null @@ -1,250 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - /* Setup: - * - Create or edit the file data/host.data and add an - * ldap server DN. Multiple DNs may be listed on - * a single line. - * - Copy the server certificates to the data/ directory. - * All DER type certificates must have the .der extention. - * All BASE64 or PEM certificates must have the .b64 - * extension. All certificate files copied to the /data - * directory will be added to the ldap certificate store. - */ - - /* This test covers the following three types of connections: - * - Unsecure ldap:// - * - Secure ldaps:// - * - Secure ldap://+Start_TLS - * - * - (TBD) Mutual authentication - * - * There are other variations that should be tested: - * - All of the above with multiple redundant LDAP servers - * This can be done by listing more than one server DN - * in the host.data file. The DNs should all be listed - * on one line separated by a space. - * - All of the above with multiple certificates - * If more than one certificate is found in the data/ - * directory, each certificate found will be added - * to the certificate store. - * - All of the above on alternate ports - * An alternate port can be specified as part of the - * host in the host.data file. The ":port" should - * follow each DN listed. Default is 389 and 636. - * - Secure connections with mutual authentication - */ - -#include "testutil.h" - -#include "apr.h" -#include "apr_general.h" -#include "apr_ldap.h" -#include "apr_file_io.h" -#include "apr_file_info.h" -#include "apr_strings.h" -#if APR_HAVE_STDLIB_H -#include -#endif -#define APR_WANT_STDIO -#define APR_WANT_STRFUNC -#include "apr_want.h" - -#define DIRNAME "data" -#define FILENAME DIRNAME "/host.data" -#define CERTFILEDER DIRNAME "/*.der" -#define CERTFILEB64 DIRNAME "/*.b64" - -#if APR_HAS_LDAP - -static char ldap_host[256]; - -static int get_ldap_host(void) -{ - apr_status_t rv; - apr_file_t *thefile = NULL; - char *ptr; - - ldap_host[0] = '\0'; - rv = apr_file_open(&thefile, FILENAME, - APR_FOPEN_READ, - APR_UREAD | APR_UWRITE | APR_GREAD, p); - if (rv != APR_SUCCESS) { - return 0; - } - - rv = apr_file_gets(ldap_host, sizeof(ldap_host), thefile); - if (rv != APR_SUCCESS) { - return 0; - } - - ptr = strstr (ldap_host, "\r\n"); - if (ptr) { - *ptr = '\0'; - } - apr_file_close(thefile); - - return 1; - -} - -static int add_ldap_certs(abts_case *tc) -{ - apr_status_t status; - apr_dir_t *thedir; - apr_finfo_t dirent; - apr_ldap_err_t *result = NULL; - - if ((status = apr_dir_open(&thedir, DIRNAME, p)) == APR_SUCCESS) { - apr_ldap_opt_tls_cert_t *cert = (apr_ldap_opt_tls_cert_t *)apr_pcalloc(p, sizeof(apr_ldap_opt_tls_cert_t)); - - do { - status = apr_dir_read(&dirent, APR_FINFO_MIN | APR_FINFO_NAME, thedir); - if (APR_STATUS_IS_INCOMPLETE(status)) { - continue; /* ignore un-stat()able files */ - } - else if (status != APR_SUCCESS) { - break; - } - - if (strstr(dirent.name, ".der")) { - cert->type = APR_LDAP_CA_TYPE_DER; - cert->path = apr_pstrcat (p, DIRNAME, "/", dirent.name, NULL); - apr_ldap_set_option(p, NULL, APR_LDAP_OPT_TLS_CERT, (void *)cert, &result); - ABTS_TRUE(tc, result->rc == LDAP_SUCCESS); - } - if (strstr(dirent.name, ".b64")) { - cert->type = APR_LDAP_CA_TYPE_BASE64; - cert->path = apr_pstrcat (p, DIRNAME, "/", dirent.name, NULL); - apr_ldap_set_option(p, NULL, APR_LDAP_OPT_TLS_CERT, (void *)cert, &result); - ABTS_TRUE(tc, result->rc == LDAP_SUCCESS); - } - - } while (1); - - apr_dir_close(thedir); - } - return 0; -} - -static void test_ldap_connection(abts_case *tc, LDAP *ldap) -{ - int version = LDAP_VERSION3; - int failures, result; - - /* always default to LDAP V3 */ - ldap_set_option(ldap, LDAP_OPT_PROTOCOL_VERSION, &version); - - for (failures=0; failures<10; failures++) - { - result = ldap_simple_bind_s(ldap, - (char *)NULL, - (char *)NULL); - if (LDAP_SERVER_DOWN != result) - break; - } - - ABTS_TRUE(tc, result == LDAP_SUCCESS); - if (result != LDAP_SUCCESS) { - abts_log_message("%s\n", ldap_err2string(result)); - } - - ldap_unbind_s(ldap); - - return; -} - -static void test_ldap(abts_case *tc, void *data) -{ - apr_pool_t *pool = p; - LDAP *ldap; - apr_ldap_err_t *result = NULL; - - - ABTS_ASSERT(tc, "failed to get host", ldap_host[0] != '\0'); - - apr_ldap_init(pool, &ldap, - ldap_host, LDAP_PORT, - APR_LDAP_NONE, &(result)); - - ABTS_TRUE(tc, ldap != NULL); - ABTS_PTR_NOTNULL(tc, result); - - if (result->rc == LDAP_SUCCESS) { - test_ldap_connection(tc, ldap); - } -} - -static void test_ldaps(abts_case *tc, void *data) -{ - apr_pool_t *pool = p; - LDAP *ldap; - apr_ldap_err_t *result = NULL; - - apr_ldap_init(pool, &ldap, - ldap_host, LDAPS_PORT, - APR_LDAP_SSL, &(result)); - - ABTS_TRUE(tc, ldap != NULL); - ABTS_PTR_NOTNULL(tc, result); - - if (result->rc == LDAP_SUCCESS) { - add_ldap_certs(tc); - - test_ldap_connection(tc, ldap); - } -} - -static void test_ldap_tls(abts_case *tc, void *data) -{ - apr_pool_t *pool = p; - LDAP *ldap; - apr_ldap_err_t *result = NULL; - - apr_ldap_init(pool, &ldap, - ldap_host, LDAP_PORT, - APR_LDAP_STARTTLS, &(result)); - - ABTS_TRUE(tc, ldap != NULL); - ABTS_PTR_NOTNULL(tc, result); - - if (result->rc == LDAP_SUCCESS) { - add_ldap_certs(tc); - - test_ldap_connection(tc, ldap); - } -} - -#endif /* APR_HAS_LDAP */ - -abts_suite *testldap(abts_suite *suite) -{ -#if APR_HAS_LDAP - apr_ldap_err_t *result = NULL; - suite = ADD_SUITE(suite); - - apr_ldap_ssl_init(p, NULL, 0, &result); - - if (get_ldap_host()) { - abts_run_test(suite, test_ldap, NULL); - abts_run_test(suite, test_ldaps, NULL); - abts_run_test(suite, test_ldap_tls, NULL); - } -#endif /* APR_HAS_LDAP */ - - return suite; -} - diff --git a/test/testutil.h b/test/testutil.h index 3d28401b967..d5fb4b1a3c4 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -113,7 +113,6 @@ abts_suite *testbase64(abts_suite *suite); abts_suite *testmd4(abts_suite *suite); abts_suite *testmd5(abts_suite *suite); abts_suite *testcrypto(abts_suite *suite); -abts_suite *testldap(abts_suite *suite); abts_suite *testdbd(abts_suite *suite); abts_suite *testdate(abts_suite *suite); abts_suite *testmemcache(abts_suite *suite); From 343ac317a00ea01529dc6d9776cc0f86ab1e3817 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 1 Jun 2011 05:13:55 +0000 Subject: [PATCH 7045/7878] Some quick fixes to get us back compiling on Netware Submitted by: NormW git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1130002 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 19 --- build/NWGNUenvironment.inc | 9 -- build/NWGNUmakefile | 2 - ldap/NWGNUmakefile | 254 ------------------------------------- 4 files changed, 284 deletions(-) delete mode 100644 ldap/NWGNUmakefile diff --git a/NWGNUmakefile b/NWGNUmakefile index 19884c8e583..ff9ebc67568 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -4,7 +4,6 @@ SUBDIRS = \ build \ - ldap \ xml \ $(EOLIST) @@ -47,7 +46,6 @@ XINCDIRS += \ $(APR)/include/arch/unix \ $(APR)/dbm/sdbm \ $(APR)/random/unix \ - $(LDAPSDK)/inc \ $(EOLIST) # @@ -203,7 +201,6 @@ FILES_nlm_objs = \ FILES_nlm_libs = \ $(PRELUDE) \ $(APRLIB) \ - $(APRLDAPLIB) \ $(APRXMLLIB) \ $(EOLIST) @@ -229,14 +226,6 @@ FILES_nlm_modules += ws2_32 \ $(EOLIST) endif -#If the LDAP support is defined then add the auto-load modules -ifneq "$(LDAPSDK)" "" -FILES_nlm_modules += \ - lldapsdk \ - lldapssl \ - $(EOLIST) -endif - ifdef EXPATSDK ifndef EXPAT_LINK_STATIC FILES_nlm_modules += \ @@ -277,14 +266,6 @@ FILES_nlm_Ximports += \ $(EOLIST) endif -#If the LDAP support is defined then add the imports -ifneq "$(LDAPSDK)" "" -FILES_nlm_Ximports += \ - @lldapsdk.imp \ - @lldapssl.imp \ - $(EOLIST) -endif - ifdef EXPATSDK ifndef EXPAT_LINK_STATIC FILES_nlm_Ximports += \ diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 0c85526a10e..4d28957b100 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -42,13 +42,6 @@ ifneq "$(wildcard $(NOVELLLIBC)/include/ndkvers.h)" "$(NOVELLLIBC)/include/ndkve $(error NOVELLLIBC does not point to a valid Novell LIBC SDK) endif -ifndef LDAPSDK -LDAPSDK = C:/novell/ndk/cldapsdk/NetWare/libc -endif -ifneq "$(wildcard $(LDAPSDK)/inc/ldap.h)" "$(LDAPSDK)/inc/ldap.h" -$(error LDAPSDK does not point to a valid Novell CLDAP SDK) -endif - ifdef EXPATSDK ifeq "$(wildcard $(EXPATSDK)/include/expat.h)" "$(EXPATSDK)/include/expat.h" EXPAT_IMP = $(EXPATSDK)/imports/expatlbc.imp @@ -353,7 +346,6 @@ INSTDIRS += \ APR = $(subst \,/,$(APR_WORK)) APRBUILD = $(APR)/build -APRLDAP = $(APR)/ldap APRXML = $(APR)/xml APRTEST = $(APR)/test @@ -362,7 +354,6 @@ APRTEST = $(APR)/test # APRLIB = $(APR)/$(OBJDIR)/aprlib.lib -APRLDAPLIB = $(APRLDAP)/$(OBJDIR)/ldap.lib APRXMLLIB = $(APRXML)/$(OBJDIR)/xml.lib # diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index fc51a7e3832..f3b0625c11d 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -29,13 +29,11 @@ XINCDIRS += \ $(APR)/include/arch/netware \ $(APR)/include/arch/unix \ $(APRBUILD) \ - $(LDAPSDK)/inc \ $(EOLIST) FILES_prebuild_headers = \ $(APR)/include/apr.h \ $(APR)/include/apu_want.h \ - $(APR)/include/apr_ldap.h \ $(APR)/include/private/apu_select_dbm.h \ $(EOLIST) diff --git a/ldap/NWGNUmakefile b/ldap/NWGNUmakefile deleted file mode 100644 index da6e6f8b503..00000000000 --- a/ldap/NWGNUmakefile +++ /dev/null @@ -1,254 +0,0 @@ -# -# Declare the sub-directories to be built here -# - -SUBDIRS = \ - $(EOLIST) - -# -# Get the 'head' of the build environment. This includes default targets and -# paths to tools -# - -include $(APR_WORK)/build/NWGNUhead.inc - -# -# build this level's files - -# -# Make sure all needed macro's are defined -# - -# -# These directories will be at the beginning of the include list, followed by -# INCDIRS -# -XINCDIRS += \ - $(APR)/include \ - $(APR)/include/arch/netware \ - $(APR)/include/private \ - $(LDAPSDK)/inc \ - $(EOLIST) - -# -# These flags will come after CFLAGS -# -XCFLAGS += \ - $(EOLIST) - -# -# These defines will come after DEFINES -# -XDEFINES += \ - $(EOLIST) - -# -# These flags will be added to the link.opt file -# -XLFLAGS += \ - $(EOLIST) - -# -# These values will be appended to the correct variables based on the value of -# RELEASE -# -ifeq "$(RELEASE)" "debug" -XINCDIRS += \ - $(EOLIST) - -XCFLAGS += \ - $(EOLIST) - -XDEFINES += \ - $(EOLIST) - -XLFLAGS += \ - $(EOLIST) -endif - -ifeq "$(RELEASE)" "noopt" -XINCDIRS += \ - $(EOLIST) - -XCFLAGS += \ - $(EOLIST) - -XDEFINES += \ - $(EOLIST) - -XLFLAGS += \ - $(EOLIST) -endif - -ifeq "$(RELEASE)" "release" -XINCDIRS += \ - $(EOLIST) - -XCFLAGS += \ - $(EOLIST) - -XDEFINES += \ - $(EOLIST) - -XLFLAGS += \ - $(EOLIST) -endif - -# -# These are used by the link target if an NLM is being generated -# This is used by the link 'name' directive to name the nlm. If left blank -# TARGET_nlm (see below) will be used. -# -NLM_NAME = - -# -# This is used by the link '-desc ' directive. -# If left blank, NLM_NAME will be used. -# -NLM_DESCRIPTION = - -# -# This is used by the '-threadname' directive. If left blank, -# NLM_NAME Thread will be used. -# -NLM_THREAD_NAME = -# -# If this is specified, it will override VERSION value in -# $(APR_WORK)/build/NWGNUenvironment.inc -# -NLM_VERSION = - -# -# If this is specified, it will override the default of 64K -# -NLM_STACK_SIZE = - -# -# If this is specified it will be used by the link '-entry' directive -# -NLM_ENTRY_SYM = - -# -# If this is specified it will be used by the link '-exit' directive -# -NLM_EXIT_SYM = - -# -# If this is specified it will be used by the link '-check' directive -# -NLM_CHECK_SYM = - -# -# If this is specified it will be used by the link '-flags' directive -# -NLM_FLAGS = - -# -# If this is specified it will be linked in with the XDCData option in the def -# file instead of the default of $(APR)/misc/netware/apache.xdc. XDCData can -# be disabled by setting APACHE_UNIPROC in the environment -# -XDCDATA = - -# -# Declare all target files (you must add your files here) -# - -# -# If there is an NLM target, put it here -# -TARGET_nlm = \ - $(EOLIST) - -# -# If there is an LIB target, put it here -# -TARGET_lib = \ - $(OBJDIR)/ldap.lib \ - $(EOLIST) - -# -# These are the OBJ files needed to create the NLM target above. -# Paths must all use the '/' character -# -FILES_nlm_objs = \ - $(EOLIST) - -# -# These are the LIB files needed to create the NLM target above. -# These will be added as a library command in the link.opt file. -# -FILES_nlm_libs = \ - $(EOLIST) - -# -# These are the modules that the above NLM target depends on to load. -# These will be added as a module command in the link.opt file. -# -FILES_nlm_modules = \ - $(EOLIST) - -# -# If the nlm has a msg file, put it's path here -# -FILE_nlm_msg = - -# -# If the nlm has a hlp file put it's path here -# -FILE_nlm_hlp = - -# -# If this is specified, it will override the default copyright. -# -FILE_nlm_copyright = - -# -# Any additional imports go here -# -FILES_nlm_Ximports = \ - $(EOLIST) - -# -# Any symbols exported to here -# -FILES_nlm_exports = \ - $(EOLIST) - -# -# These are the OBJ files needed to create the LIB target above. -# Paths must all use the '/' character -# -FILES_lib_objs = \ - $(OBJDIR)/apr_ldap_init.o \ - $(OBJDIR)/apr_ldap_option.o \ - $(OBJDIR)/apr_ldap_url.o \ - $(OBJDIR)/apr_ldap_rebind.o \ - $(OBJDIR)/apr_ldap_stub.o \ - $(EOLIST) - -# -# implement targets and dependancies (leave this section alone) -# - -libs :: $(OBJDIR) $(TARGET_lib) - -nlms :: libs $(TARGET_nlm) - -# -# Updated this target to create necessary directories and copy files to the -# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples) -# -install :: nlms FORCE - -# -# Any specialized rules here -# - -# -# Include the 'tail' makefile that has targets that depend on variables defined -# in this makefile -# - -include $(APRBUILD)/NWGNUtail.inc - From e59aa1375a3f4d7d66e74ef8f84237c58ee373d6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 1 Jun 2011 05:14:33 +0000 Subject: [PATCH 7046/7878] And the tree can now be pruned git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1130003 13f79535-47bb-0310-9956-ffa450edef68 From 7ad03cc03f1159cd2de77091a7c68c42fb03798d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 1 Jun 2011 06:56:49 +0000 Subject: [PATCH 7047/7878] Refactored for single apr/ tree git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1130019 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_freetds.dsp | 16 ++++++++-------- dbd/apr_dbd_mysql.dsp | 16 ++++++++-------- dbd/apr_dbd_odbc.dsp | 16 ++++++++-------- dbd/apr_dbd_oracle.dsp | 16 ++++++++-------- dbd/apr_dbd_pgsql.dsp | 16 ++++++++-------- dbd/apr_dbd_sqlite2.dsp | 16 ++++++++-------- dbd/apr_dbd_sqlite3.dsp | 16 ++++++++-------- dbm/apr_dbm_db.dsp | 16 ++++++++-------- dbm/apr_dbm_gdbm.dsp | 16 ++++++++-------- 9 files changed, 72 insertions(+), 72 deletions(-) diff --git a/dbd/apr_dbd_freetds.dsp b/dbd/apr_dbd_freetds.dsp index 84535ecf109..ae5756b74d9 100644 --- a/dbd/apr_dbd_freetds.dsp +++ b/dbd/apr_dbd_freetds.dsp @@ -45,11 +45,11 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Release/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -77,11 +77,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Debug/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -109,11 +109,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -141,11 +141,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/dbd/apr_dbd_mysql.dsp b/dbd/apr_dbd_mysql.dsp index 40c955355fb..9b56e0c3e45 100644 --- a/dbd/apr_dbd_mysql.dsp +++ b/dbd/apr_dbd_mysql.dsp @@ -45,11 +45,11 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Release/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -77,11 +77,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Debug/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -109,11 +109,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -141,11 +141,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/dbd/apr_dbd_odbc.dsp b/dbd/apr_dbd_odbc.dsp index 4e6cf4c30d7..3ea69f1a304 100644 --- a/dbd/apr_dbd_odbc.dsp +++ b/dbd/apr_dbd_odbc.dsp @@ -45,11 +45,11 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "HAVE_SQL_H" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "HAVE_SQL_H" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Release/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -77,11 +77,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /D "HAVE_SQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /D "HAVE_SQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Debug/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -109,11 +109,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "HAVE_SQL_H" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "HAVE_SQL_H" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64\Release/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64\Release/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -141,11 +141,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /D "HAVE_SQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /D "HAVE_SQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/debug/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/debug/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/dbd/apr_dbd_oracle.dsp b/dbd/apr_dbd_oracle.dsp index bdaa4a2285d..91134138807 100644 --- a/dbd/apr_dbd_oracle.dsp +++ b/dbd/apr_dbd_oracle.dsp @@ -45,11 +45,11 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Release/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -77,11 +77,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Debug/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -109,11 +109,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -141,11 +141,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/dbd/apr_dbd_pgsql.dsp b/dbd/apr_dbd_pgsql.dsp index da6d29d57ad..03526576fd3 100644 --- a/dbd/apr_dbd_pgsql.dsp +++ b/dbd/apr_dbd_pgsql.dsp @@ -45,11 +45,11 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Release/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -77,11 +77,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Debug/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -109,11 +109,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -141,11 +141,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/dbd/apr_dbd_sqlite2.dsp b/dbd/apr_dbd_sqlite2.dsp index 67478a760ae..8a0047e678a 100644 --- a/dbd/apr_dbd_sqlite2.dsp +++ b/dbd/apr_dbd_sqlite2.dsp @@ -45,11 +45,11 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Release/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -77,11 +77,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Debug/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -109,11 +109,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -141,11 +141,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/dbd/apr_dbd_sqlite3.dsp b/dbd/apr_dbd_sqlite3.dsp index 199622ac72b..32efdecb82e 100644 --- a/dbd/apr_dbd_sqlite3.dsp +++ b/dbd/apr_dbd_sqlite3.dsp @@ -45,11 +45,11 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Release/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -77,11 +77,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Debug/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -109,11 +109,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -141,11 +141,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/dbm/apr_dbm_db.dsp b/dbm/apr_dbm_db.dsp index f66aa4ab20b..c4a94756a9b 100644 --- a/dbm/apr_dbm_db.dsp +++ b/dbm/apr_dbm_db.dsp @@ -45,11 +45,11 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Release/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -77,11 +77,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Debug/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -109,11 +109,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -141,11 +141,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/dbm/apr_dbm_gdbm.dsp b/dbm/apr_dbm_gdbm.dsp index a19e9e1c2cb..d2fa6d65ce5 100644 --- a/dbm/apr_dbm_gdbm.dsp +++ b/dbm/apr_dbm_gdbm.dsp @@ -45,11 +45,11 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Release/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -77,11 +77,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"Debug/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -109,11 +109,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Release/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -141,11 +141,11 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo From 7fdb444b0b131c97e84fa294330dc481c46d700a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 1 Jun 2011 16:45:20 +0000 Subject: [PATCH 7048/7878] Fixes to finish cleaning up Netware builds/tests Submitted by: NormW git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1130218 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 4 ---- test/NWGNUaprtest | 10 ---------- 2 files changed, 14 deletions(-) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index b095f62418f..f56051bf736 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -251,7 +251,6 @@ else @echo $(DL)-sym internal$(DL)>> $@ endif @echo $(DL)-l $(APR)/$(OBJDIR)$(DL)>> $@ - @echo $(DL)-l $(APRLDAP)/$(OBJDIR)$(DL)>> $@ @echo $(DL)-l $(APRXML)/$(OBJDIR)$(DL)>> $@ @echo $(DL)-l $(APR)/misc/netware$(DL)>> $@ @echo $(DL)-l $(APR)$(DL)>> $@ @@ -261,9 +260,6 @@ ifneq "$(IPV6)" "" @echo $(DL)-l $(NOVELLLIBC)/include/winsock/IPV6$(DL)>> $@ endif @echo $(DL)-l $(NOVELLLIBC)/imports$(DL)>> $@ -ifneq "$(LDAPSDK)" "" - @echo $(DL)-l $(LDAPSDK)/imports$(DL)>> $@ -endif @echo $(DL)-nodefaults$(DL)>> $@ @echo $(DL)-map $(OBJDIR)/$(NLM_NAME).map$(DL)>> $@ ifneq "$(strip $(XLFLAGS))" "" diff --git a/test/NWGNUaprtest b/test/NWGNUaprtest index 81bbbde76ba..5ed6a26e0e5 100644 --- a/test/NWGNUaprtest +++ b/test/NWGNUaprtest @@ -18,7 +18,6 @@ endif XINCDIRS += \ $(APR)/include \ $(APR)/include/arch/netware \ - $(LDAPSDK)/inc \ $(EOLIST) # @@ -194,7 +193,6 @@ FILES_nlm_objs = \ $(OBJDIR)/testhash.o \ $(OBJDIR)/testhooks.o \ $(OBJDIR)/testipsub.o \ - $(OBJDIR)/testldap.o \ $(OBJDIR)/testlfs.o \ $(OBJDIR)/testlfsabi.o \ $(OBJDIR)/testlfsabi32.o \ @@ -291,14 +289,6 @@ FILES_nlm_Ximports += \ $(EOLIST) endif -#If the LDAP support is defined then add the imports -ifneq "$(LDAPSDK)" "" -FILES_nlm_Ximports += \ - @lldapsdk.imp \ - @lldapssl.imp \ - $(EOLIST) -endif - # # Any symbols exported to here # From 3d2c16f36cefadec91ee8d66b9ef0ada40a2681e Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Wed, 1 Jun 2011 19:40:14 +0000 Subject: [PATCH 7049/7878] Fix some "no return statement in function returning non-void" warnings git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1130269 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_nss.c | 2 ++ crypto/apr_crypto_openssl.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 3c9339f0410..153dd5c9952 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -314,6 +314,7 @@ static apr_status_t crypto_get_block_key_types(apr_hash_t **types, const apr_crypto_t *f) { *types = f->types; + return APR_SUCCESS; } /** @@ -328,6 +329,7 @@ static apr_status_t crypto_get_block_key_modes(apr_hash_t **modes, const apr_crypto_t *f) { *modes = f->modes; + return APR_SUCCESS; } /** diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index e6efebc46db..e4d69bc89f2 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -256,6 +256,7 @@ static apr_status_t crypto_get_block_key_types(apr_hash_t **types, const apr_crypto_t *f) { *types = f->types; + return APR_SUCCESS; } /** @@ -270,6 +271,7 @@ static apr_status_t crypto_get_block_key_modes(apr_hash_t **modes, const apr_crypto_t *f) { *modes = f->modes; + return APR_SUCCESS; } /** From 50f9878c854062832a9e72a636d9f0beee86bda4 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Wed, 1 Jun 2011 19:45:24 +0000 Subject: [PATCH 7050/7878] Fix crash with --enable-allocator-uses-mmap on machines with pagesize >= 8k. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1130270 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index c0d470b034d..968123c1ba7 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -47,7 +47,12 @@ * Magic numbers */ -#define MIN_ALLOC 8192 +/* + * XXX: This is not optimal for machines with large pagesize, but currently + * XXX: the sink is assumed to be index 0, so MIN_ALLOC must be at least two + * XXX: pages. + */ +#define MIN_ALLOC (2 * BOUNDARY_SIZE) #define MAX_INDEX 20 #if APR_ALLOCATOR_USES_MMAP && defined(_SC_PAGESIZE) From 8a287fe66a9aad37fa3f192bcfdb7d62a6d7b8b9 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Wed, 1 Jun 2011 19:48:57 +0000 Subject: [PATCH 7051/7878] extend comment a bit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1130274 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 968123c1ba7..da8b2122565 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -48,9 +48,9 @@ */ /* - * XXX: This is not optimal for machines with large pagesize, but currently - * XXX: the sink is assumed to be index 0, so MIN_ALLOC must be at least two - * XXX: pages. + * XXX: This is not optimal when using --enable-allocator-uses-mmap on + * XXX: machines with large pagesize, but currently the sink is assumed + * XXX: to be index 0, so MIN_ALLOC must be at least two pages. */ #define MIN_ALLOC (2 * BOUNDARY_SIZE) #define MAX_INDEX 20 From 5b7540dd063ba3ef819f8458b2d31df18a425f3b Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Wed, 8 Jun 2011 22:32:48 +0000 Subject: [PATCH 7052/7878] apr_crypto: Remove an unused parameter from the apr_crypto_init() function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1133587 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 3 +-- include/apr_crypto.h | 4 +--- test/testcrypto.c | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 9162e52baa5..48947478a79 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -77,8 +77,7 @@ static apr_status_t apr_crypto_term(void *ptr) { return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool, - const apr_array_header_t *params) { +APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) { apr_status_t ret = APR_SUCCESS; apr_pool_t *parent; diff --git a/include/apr_crypto.h b/include/apr_crypto.h index 0f16036fee6..4c89d5c0e67 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -184,11 +184,9 @@ typedef struct apr_crypto_block_t apr_crypto_block_t; * @brief Perform once-only initialisation. Call once only. * * @param pool - pool to register any shutdown cleanups, etc - * @param params - array of initialisation parameters * @return APR_NOTIMPL in case of no crypto support. */ -APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool, - const apr_array_header_t *params); +APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool); /** * @brief Get the driver struct for a name diff --git a/test/testcrypto.c b/test/testcrypto.c index 9e7626b7cca..1631f7be344 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -35,7 +35,7 @@ static const apr_crypto_driver_t *get_driver(abts_case *tc, apr_pool_t *pool, const apu_err_t *err = NULL; apr_status_t rv; - rv = apr_crypto_init(pool, params); + rv = apr_crypto_init(pool); ABTS_ASSERT(tc, "failed to init apr_crypto", rv == APR_SUCCESS); rv = apr_crypto_get_driver(&driver, name, params, &err, pool); @@ -358,7 +358,7 @@ static void test_crypto_init(abts_case *tc, void *data) { apr_pool_create(&pool, NULL); - rv = apr_crypto_init(pool, NULL); + rv = apr_crypto_init(pool); ABTS_ASSERT(tc, "failed to init apr_crypto", rv == APR_SUCCESS); apr_pool_destroy(pool); From d5fde65c179e3ab05b83e88a8768e68691f3f012 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Tue, 28 Jun 2011 23:13:54 +0000 Subject: [PATCH 7053/7878] There exist no dynamically created apr_*.h header files right now. Trying to install "apr_*.h" from the build directory actually removes all files matching "apr_*.h" (which are the headers already installed from the source directory). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1140897 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index afac20873ba..4042d9ff685 100644 --- a/Makefile.in +++ b/Makefile.in @@ -98,7 +98,7 @@ install: install-modules $(TARGETS) for f in $(top_srcdir)/include/apr_*.h $(top_srcdir)/include/apu_*.h; do \ $(INSTALL_DATA) $${f} $(DESTDIR)$(includedir); \ done - for f in $(top_blddir)/include/apr_*.h $(top_blddir)/include/apu_*.h; do \ + for f in $(top_blddir)/include/apu_*.h; do \ $(INSTALL_DATA) $${f} $(DESTDIR)$(includedir); \ done $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(TARGET_LIB) $(DESTDIR)$(libdir) From 9015b91c5aca1e77f8a0324e6e57259d90c9244b Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Tue, 28 Jun 2011 23:15:58 +0000 Subject: [PATCH 7054/7878] Remove unused variable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1140899 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_openssl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index e4d69bc89f2..084d3cae221 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -98,7 +98,6 @@ static apr_status_t crypto_shutdown(void) { } static apr_status_t crypto_shutdown_helper(void *data) { - apr_pool_t *pool = (apr_pool_t *) data; return crypto_shutdown(); } From 07b536602994007d354950e1b8990cc17416177e Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 22 Jul 2011 18:44:37 +0000 Subject: [PATCH 7055/7878] z/OS iconv uses ISO charset names with only one dash, e.g. ISO8859-1 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1149692 13f79535-47bb-0310-9956-ffa450edef68 --- xlate/xlate.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xlate/xlate.c b/xlate/xlate.c index ab1c5f50881..6a84c31443e 100644 --- a/xlate/xlate.c +++ b/xlate/xlate.c @@ -69,6 +69,11 @@ static const char *handle_special_names(const char *page, apr_pool_t *pool) else if (page == APR_LOCALE_CHARSET) { return apr_os_locale_encoding(pool); } +#ifdef __MVS__ + else if (!strcasecmp(page, "ISO-8859-1")) { + return "ISO8859-1"; /* z/OS ASCII name has no dash after ISO */ + } +#endif else { return page; } From be4197123329472f9952766acf7ca2b2d45f8b0e Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 29 Jul 2011 17:28:40 +0000 Subject: [PATCH 7056/7878] Fix flag character '#' in combination with format character 'x' in apr snprintf implementations. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1152309 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 7c1aee52e72..6a689a61453 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -704,7 +704,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), apr_int64_t i_quad = 0; apr_uint64_t ui_quad; apr_int32_t i_num = 0; - apr_uint32_t ui_num; + apr_uint32_t ui_num = 0; char num_buf[NUM_BUF_SIZE]; char char_buf[2]; /* for printing %% and % */ @@ -959,7 +959,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), &num_buf[NUM_BUF_SIZE], &s_len); } FIX_PRECISION(adjust_precision, precision, s, s_len); - if (alternate_form && i_num != 0) { + if (alternate_form && ui_num != 0) { *--s = *fmt; /* 'x' or 'X' */ *--s = '0'; s_len += 2; From c690bc10e9b62f682cbbef6a744d90231cf2a681 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 1 Aug 2011 15:58:25 +0000 Subject: [PATCH 7057/7878] Also for OSX 10.7 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1152847 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 0f68bc4862d..2c768f00fe1 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -203,7 +203,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(ac_cv_func_kqueue, [no]) APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332 ;; - *-apple-darwin10.*) + *-apple-darwin1[01].*) APR_ADDTO(CPPFLAGS, [-DDARWIN_10]) ;; esac From 07a4ce020f70234fdba6d5900fea79e4ec145cac Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 1 Aug 2011 16:04:37 +0000 Subject: [PATCH 7058/7878] darwin-10/darwin-11 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1152852 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 2c768f00fe1..df7e3d8b6c6 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -203,7 +203,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(ac_cv_func_kqueue, [no]) APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332 ;; - *-apple-darwin1[01].*) + *-apple-darwin1[[01]].*) APR_ADDTO(CPPFLAGS, [-DDARWIN_10]) ;; esac From 901e9335473410a9ed57ae0780c206f6c552f0fc Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 19 Sep 2011 21:11:38 +0000 Subject: [PATCH 7059/7878] Fix issue found by PVS-Studio static analyzer: Correctly clear whole sha256 state PR: 51542 Submitted by: Andrey Karpov git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1172825 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/sha2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/random/unix/sha2.c b/random/unix/sha2.c index 070526d9d34..212c1b732a4 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -557,7 +557,7 @@ void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { } /* Clean up state data: */ - MEMSET_BZERO(context, sizeof(context)); + MEMSET_BZERO(context, sizeof(*context)); usedspace = 0; } @@ -578,7 +578,7 @@ char *apr__SHA256_End(SHA256_CTX* context, char buffer[]) { } *buffer = (char)0; } else { - MEMSET_BZERO(context, sizeof(context)); + MEMSET_BZERO(context, sizeof(*context)); } MEMSET_BZERO(digest, SHA256_DIGEST_LENGTH); return buffer; @@ -889,7 +889,7 @@ void apr__SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { } /* Zero out state data */ - MEMSET_BZERO(context, sizeof(context)); + MEMSET_BZERO(context, sizeof(*context)); } char *apr__SHA512_End(SHA512_CTX* context, char buffer[]) { @@ -909,7 +909,7 @@ char *apr__SHA512_End(SHA512_CTX* context, char buffer[]) { } *buffer = (char)0; } else { - MEMSET_BZERO(context, sizeof(context)); + MEMSET_BZERO(context, sizeof(*context)); } MEMSET_BZERO(digest, SHA512_DIGEST_LENGTH); return buffer; @@ -964,7 +964,7 @@ void apr__SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { } /* Zero out state data */ - MEMSET_BZERO(context, sizeof(context)); + MEMSET_BZERO(context, sizeof(*context)); } char *apr__SHA384_End(SHA384_CTX* context, char buffer[]) { @@ -984,7 +984,7 @@ char *apr__SHA384_End(SHA384_CTX* context, char buffer[]) { } *buffer = (char)0; } else { - MEMSET_BZERO(context, sizeof(context)); + MEMSET_BZERO(context, sizeof(*context)); } MEMSET_BZERO(digest, SHA384_DIGEST_LENGTH); return buffer; From c333305361be48fb66b89725e13b149939008a5e Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 15 Oct 2011 20:46:08 +0000 Subject: [PATCH 7060/7878] Clarify that it is save to call apr_initialize several times. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1183683 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index cf65945c0a1..b47ff3eccb5 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -182,7 +182,8 @@ struct type { \ /** * Setup any APR internal data structures. This MUST be the first function - * called for any APR library. + * called for any APR library. It is save to call apr_initialize several + * times as long as apr_terminate is called the same number of times. * @remark See apr_app_initialize if this is an application, rather than * a library consumer of apr. */ @@ -206,7 +207,8 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, /** * Tear down any APR internal data structures which aren't torn down - * automatically. + * automatically. apr_terminate must be called once for every call to + * apr_initialize() or apr_app_initialize(). * @remark An APR program must call this function at termination once it * has stopped using APR services. The APR developers suggest using * atexit to ensure this is called. When using APR from a language From 686e8adae8e109225a2fa2c6262ad626752f5dec Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 15 Oct 2011 20:47:15 +0000 Subject: [PATCH 7061/7878] Don't close any of the new stdin/stdout/stderr FDs in the child if it already has the correct FD. PR: 51995 Submitted by: Dan Ports ] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1183685 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ threadproc/unix/proc.c | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 3904d4b552f..61675ff75e3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_proc_create: Don't close any of the new stdin/stdout/stderr in the + child if it already has the correct FD. PR 51995. + [Dan Ports ] + *) apr_thread_pool: Fix thread unsafe pool usage. [Stefan Fritsch] *) apr_brigades: add a check to prevent infinite while loop in case diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 593eb5ad1eb..8ded39177c7 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -431,7 +431,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if ((attr->child_in) && (attr->child_in->filedes == -1)) { close(STDIN_FILENO); } - else if (attr->child_in) { + else if (attr->child_in && + attr->child_in->filedes != STDIN_FILENO) { dup2(attr->child_in->filedes, STDIN_FILENO); apr_file_close(attr->child_in); } @@ -439,7 +440,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if ((attr->child_out) && (attr->child_out->filedes == -1)) { close(STDOUT_FILENO); } - else if (attr->child_out) { + else if (attr->child_out && + attr->child_out->filedes != STDOUT_FILENO) { dup2(attr->child_out->filedes, STDOUT_FILENO); apr_file_close(attr->child_out); } @@ -447,7 +449,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if ((attr->child_err) && (attr->child_err->filedes == -1)) { close(STDERR_FILENO); } - else if (attr->child_err) { + else if (attr->child_err && + attr->child_err->filedes != STDERR_FILENO) { dup2(attr->child_err->filedes, STDERR_FILENO); apr_file_close(attr->child_err); } From 9ec5c8555274a762ff72ec35ad684307f3b366af Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 15 Oct 2011 20:47:58 +0000 Subject: [PATCH 7062/7878] Fix APR_RESTORE_THE_ENVIRONMENT if the original variable was a single space Autoconf selects a POSIX shell for us, so we can get rid of sed, here. PR 50334 Submitted by: Nathan Phillip Brink git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1183686 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ build/apr_common.m4 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 61675ff75e3..624cc2720b4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) configure: Fix APR_RESTORE_THE_ENVIRONMENT if the original variable was + a single space. PR 50334. [Nathan Phillip Brink ] + *) apr_proc_create: Don't close any of the new stdin/stdout/stderr in the child if it already has the correct FD. PR 51995. [Dan Ports ] diff --git a/build/apr_common.m4 b/build/apr_common.m4 index bd320ead976..d0f0601d4e5 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -209,7 +209,7 @@ else if test "x$apr_ste_save_$1" = "x$$1"; then $2$1= else - $2$1=`echo $$1 | sed -e "s%${apr_ste_save_$1}%%"` + $2$1="${$1#"${apr_ste_save_$1}"}" $1="$apr_ste_save_$1" fi fi From 25bd0fd15c64b62f5e5f7212dfa05e77b2f7f98d Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 15 Oct 2011 20:48:52 +0000 Subject: [PATCH 7063/7878] Fix race condition that could lead to EEXIST being returned PR: 51254 Submitted by: William Lee , Wim Lewis git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1183688 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ file_io/os2/dir_make_recurse.c | 12 ++++++++---- file_io/unix/dir.c | 11 ++++++++--- file_io/win32/dir.c | 12 +++++++++--- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 624cc2720b4..e83fd210609 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_dir_make_recursive: Fix race condition that could lead to EEXIST + being returned. PR 51254. [William Lee , + Wim Lewis ] + *) configure: Fix APR_RESTORE_THE_ENVIRONMENT if the original variable was a single space. PR 50334. [Nathan Phillip Brink ] diff --git a/file_io/os2/dir_make_recurse.c b/file_io/os2/dir_make_recurse.c index 1f645b7dda7..602a621ae7e 100644 --- a/file_io/os2/dir_make_recurse.c +++ b/file_io/os2/dir_make_recurse.c @@ -67,10 +67,6 @@ apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, apr_err = apr_dir_make(path, perm, pool); /* Try to make PATH right out */ - if (APR_STATUS_IS_EEXIST(apr_err)) { /* It's OK if PATH exists */ - return APR_SUCCESS; - } - if (APR_STATUS_IS_ENOENT(apr_err)) { /* Missing an intermediate dir */ char *dir; @@ -82,5 +78,13 @@ apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, } } + /* + * It's OK if PATH exists. Timing issues can lead to the second + * apr_dir_make being called on existing dir, therefore this check + * has to come last. + */ + if (APR_STATUS_IS_EEXIST(apr_err)) + return APR_SUCCESS; + return apr_err; } diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index f58a4496ba6..28d9e069928 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -305,9 +305,6 @@ apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, apr_err = apr_dir_make (path, perm, pool); /* Try to make PATH right out */ - if (apr_err == EEXIST) /* It's OK if PATH exists */ - return APR_SUCCESS; - if (apr_err == ENOENT) { /* Missing an intermediate dir */ char *dir; @@ -323,6 +320,14 @@ apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, apr_err = apr_dir_make (path, perm, pool); } + /* + * It's OK if PATH exists. Timing issues can lead to the second + * apr_dir_make being called on existing dir, therefore this check + * has to come last. + */ + if (APR_STATUS_IS_EEXIST(apr_err)) + return APR_SUCCESS; + return apr_err; } diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 574e7270ce1..18420c1411f 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -333,9 +333,6 @@ APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, rv = apr_dir_make (path, perm, pool); /* Try to make PATH right out */ - if (APR_STATUS_IS_EEXIST(rv)) /* It's OK if PATH exists */ - return APR_SUCCESS; - if (APR_STATUS_IS_ENOENT(rv)) { /* Missing an intermediate dir */ char *dir; @@ -347,6 +344,15 @@ APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, if (rv == APR_SUCCESS) rv = apr_dir_make (dir, perm, pool); /* And complete the path */ } + + /* + * It's OK if PATH exists. Timing issues can lead to the second + * apr_dir_make being called on existing dir, therefore this check + * has to come last. + */ + if (APR_STATUS_IS_EEXIST(apr_err)) + return APR_SUCCESS; + return rv; } From 202d6830516a44fa0576337c77aaa57dc3928a36 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 15 Oct 2011 20:49:40 +0000 Subject: [PATCH 7064/7878] Fix possible segfault. PR: 51064 Submitted by: Michajlo Matijkiw git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1183689 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ memcache/apr_memcache.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index e83fd210609..5b448d1b0c9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_memcache_server_create: Fix possible segfault. PR 51064. + [Michajlo Matijkiw ] + *) apr_dir_make_recursive: Fix race condition that could lead to EEXIST being returned. PR 51254. [William Lee , Wim Lewis ] diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index 064baee0489..222f65d970b 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -418,15 +418,17 @@ APR_DECLARE(apr_status_t) apr_memcache_server_create(apr_pool_t *p, mc_conn_construct, /* Make a New Connection */ mc_conn_destruct, /* Kill Old Connection */ server, np); + if (rv != APR_SUCCESS) { + return rv; + } apr_reslist_cleanup_order_set(server->conns, APR_RESLIST_CLEANUP_FIRST); #else rv = mc_conn_construct((void**)&(server->conn), server, np); -#endif - if (rv != APR_SUCCESS) { return rv; } +#endif *ms = server; From 60731af053bdcd2cd22b396700efdb8eb7f8d4e3 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 15 Oct 2011 20:51:40 +0000 Subject: [PATCH 7065/7878] Add support for APR_SO_BROADCAST MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR: 46389 Submitted by: Armin Müller git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1183693 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_network_io.h | 2 ++ network_io/os2/sockopt.c | 5 +++++ network_io/unix/sockopt.c | 12 ++++++++++++ network_io/win32/sockopt.c | 9 +++++++++ 5 files changed, 31 insertions(+) diff --git a/CHANGES b/CHANGES index 5b448d1b0c9..5c2f8efa045 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_socket_opt_set: Add support for APR_SO_BROADCAST. PR 46389. + [Armin Müller ] + *) apr_memcache_server_create: Fix possible segfault. PR 51064. [Michajlo Matijkiw ] diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 82d2e822b93..753e5a4ede4 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -103,6 +103,8 @@ extern "C" { * until data is available. * @see apr_socket_accept_filter */ +#define APR_SO_BROADCAST 65536 /**< Allow broadcast + */ /** @} */ diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index a7556dadc80..2ada4fc4760 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -58,6 +58,11 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, return APR_FROM_OS_ERROR(sock_errno()); } } + if (opt & APR_SO_BROADCAST) { + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_BROADCAST, (void *)&one, sizeof(int)) == -1) { + return APR_FROM_OS_ERROR(sock_errno()); + } + } if (opt & APR_SO_REUSEADDR) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { return APR_FROM_OS_ERROR(sock_errno()); diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index a5885afeff0..47c6927760b 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -141,6 +141,18 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, apr_set_option(sock, APR_SO_DEBUG, on); } break; + case APR_SO_BROADCAST: +#ifdef SO_BROADCAST + if (on != apr_is_option_set(sock, APR_SO_BROADCAST)) { + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_BROADCAST, (void *)&one, sizeof(int)) == -1) { + return errno; + } + apr_set_option(sock, APR_SO_BROADCAST, on); + } +#else + return APR_ENOTIMPL; +#endif + break; case APR_SO_REUSEADDR: if (on != apr_is_option_set(sock, APR_SO_REUSEADDR)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 62b50d0a9da..3675383d676 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -134,6 +134,15 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, return apr_get_netos_error(); } break; + case APR_SO_BROADCAST: + if (on != apr_is_option_set(sock, APR_SO_BROADCAST)) { + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_BROADCAST, + (void *)&one, sizeof(int)) == -1) { + return apr_get_netos_error(); + } + apr_set_option(sock, APR_SO_BROADCAST, on); + } + break; case APR_SO_REUSEADDR: if (on != apr_is_option_set(sock, APR_SO_REUSEADDR)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, From e82b0c4de6f5ed2070328f296279395b5b2f6bb4 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 15 Oct 2011 20:54:07 +0000 Subject: [PATCH 7066/7878] Avoid fcntl() calls if support for O_CLOEXEC works. PR: 48557 Submitted by: Mike Frysinger git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1183698 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/unix/open.c | 28 +++++++++++++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index 5c2f8efa045..ccbdf1f29cb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_file_open: Avoid fcntl() calls if support for O_CLOEXEC works. + PR 48557. [Mike Frysinger ] + *) apr_socket_opt_set: Add support for APR_SO_BROADCAST. PR 46389. [Armin Müller ] diff --git a/file_io/unix/open.c b/file_io/unix/open.c index ea085f7567c..36be4a706bf 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -178,19 +178,29 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, return errno; } if (!(flag & APR_FOPEN_NOCLEANUP)) { - int flags; - - if ((flags = fcntl(fd, F_GETFD)) == -1) { - close(fd); - return errno; - } +#ifdef O_CLOEXEC + static int has_o_cloexec = 0; + if (!has_o_cloexec) +#endif + { + int flags; - if ((flags & FD_CLOEXEC) == 0) { - flags |= FD_CLOEXEC; - if (fcntl(fd, F_SETFD, flags) == -1) { + if ((flags = fcntl(fd, F_GETFD)) == -1) { close(fd); return errno; } + if ((flags & FD_CLOEXEC) == 0) { + flags |= FD_CLOEXEC; + if (fcntl(fd, F_SETFD, flags) == -1) { + close(fd); + return errno; + } + } +#ifdef O_CLOEXEC + else { + has_o_cloexec = 1; + } +#endif } } From f7875b893839663a832c830922a302dc5ca974f5 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 23 Oct 2011 16:00:54 +0000 Subject: [PATCH 7067/7878] apr_crypto: Replace the LDAP inspired constant-based parameter passing with the apr_dbd inspired string passing, and simplify configuration. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1187914 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 11 ++-- crypto/apr_crypto_nss.c | 95 ++++++++++++++++----------- crypto/apr_crypto_openssl.c | 75 ++++++++++++++++----- include/apr_crypto.h | 72 ++++---------------- include/private/apr_crypto_internal.h | 6 +- test/testcrypto.c | 13 +--- 6 files changed, 139 insertions(+), 133 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 48947478a79..6af3bcb7ec0 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -116,9 +116,9 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) { return ret; } -APR_DECLARE(apr_status_t) apr_crypto_get_driver(const apr_crypto_driver_t **driver, - const char *name, const apr_array_header_t *params, const apu_err_t **result, - apr_pool_t *pool) { +APR_DECLARE(apr_status_t) apr_crypto_get_driver( + const apr_crypto_driver_t **driver, const char *name, + const char *params, const apu_err_t **result, apr_pool_t *pool) { #if APR_HAVE_MODULAR_DSO char modname[32]; char symname[34]; @@ -227,9 +227,12 @@ APR_DECLARE(apr_status_t) apr_crypto_error(const apu_err_t **result, * @param pool - process pool * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. + * @remarks NSS: currently no params are supported. + * @remarks OpenSSL: the params can have "engine" as a key, followed by an equal + * sign and a value. */ APR_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, const apr_crypto_driver_t *driver, - const apr_array_header_t *params, apr_pool_t *pool) { + const char *params, apr_pool_t *pool) { return driver->make(f, driver, params, pool); } diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 153dd5c9952..36b18afda1d 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -118,7 +118,7 @@ static apr_status_t crypto_shutdown_helper(void *data) /** * Initialise the crypto library and perform one time initialisation. */ -static apr_status_t crypto_init(apr_pool_t *pool, const apr_array_header_t *params, int *rc) +static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc) { SECStatus s; const char *dir = NULL; @@ -126,37 +126,69 @@ static apr_status_t crypto_init(apr_pool_t *pool, const apr_array_header_t *para const char *certPrefix = NULL; const char *secmod = NULL; PRUint32 flags = 0; - struct apr_crypto_param_t *ents = params ? (struct apr_crypto_param_t *)params->elts : NULL; - int i = 0; + + struct { + const char *field; + char *value; + } fields[] = { + {"dir", NULL}, + {"key3", NULL}, + {"cert7", NULL}, + {"secmod", NULL}, + {NULL, NULL} + }; + int i; + const char *ptr; + const char *key; + size_t klen; + const char *value; + size_t vlen; + static const char *const delims = " \r\n\t;|,"; /* sanity check - we can only initialise NSS once */ if (NSS_IsInitialized()) { return APR_EREINIT; } + /* snitch parsing from the MySQL driver */ + for (ptr = strchr(params, '='); ptr; ptr = strchr(ptr, '=')) { + /* don't dereference memory that may not belong to us */ + if (ptr == params) { + ++ptr; + continue; + } + for (key = ptr-1; apr_isspace(*key); --key); + klen = 0; + while (apr_isalpha(*key)) { + if (key == params) { + /* Don't parse off the front of the params */ + --key; + ++klen; + break; + } + --key; + ++klen; + } + ++key; + for (value = ptr+1; apr_isspace(*value); ++value); + vlen = strcspn(value, delims); + for (i=0; fields[i].field != NULL; ++i) { + if (!strncasecmp(fields[i].field, key, klen)) { + fields[i].value = apr_pstrndup(pool, value, vlen); + break; + } + } + ptr = value+vlen; + } + dir = fields[0].value; + keyPrefix = fields[1].value; + certPrefix = fields[2].value; + secmod = fields[3].value; + apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, apr_pool_cleanup_null); - for (i = 0; params && i < params->nelts; i++) { - switch (ents[i].type) { - case APR_CRYPTO_CA_TYPE_DIR: - dir = ents[i].path; - break; - case APR_CRYPTO_CERT_TYPE_KEY3_DB: - keyPrefix = ents[i].path; - break; - case APR_CRYPTO_CA_TYPE_CERT7_DB: - certPrefix = ents[i].path; - break; - case APR_CRYPTO_CA_TYPE_SECMOD: - secmod = ents[i].path; - break; - default: - return APR_EINIT; - } - } - if (keyPrefix || certPrefix || secmod) { s = NSS_Initialize(dir, certPrefix, keyPrefix, secmod, flags); } @@ -234,17 +266,15 @@ static apr_status_t crypto_cleanup_helper(void *data) * registered with the given pool to guarantee a graceful shutdown. * @param f - context pointer will be written here * @param provider - provider to use - * @param params - array of key parameters + * @param params - parameter string * @param pool - process pool * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *provider, - const apr_array_header_t *params, apr_pool_t *pool) + const char *params, apr_pool_t *pool) { apr_crypto_config_t *config = NULL; - /* struct apr_crypto_param_t *ents = params ? (struct apr_crypto_param_t *)params->elts : NULL; */ - /* int i = 0; */ apr_crypto_t *f; f = apr_pcalloc(pool, sizeof(apr_crypto_t)); @@ -285,19 +315,6 @@ static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *pr crypto_cleanup_helper, apr_pool_cleanup_null); - /* - for (i = 0; params && i < params->nelts; i++) { - switch (ents[i].type) { - default: - f->result->rc = -1; - f->result->reason = "The NSS module currently supports " - "no per context initialisation parameters at this time, but " - "may do in future."; - return APR_EINIT; - } - } - */ - return APR_SUCCESS; } diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 084d3cae221..d227284e53a 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "apr_lib.h" #include "apu.h" #include "apr_private.h" #include "apu_errno.h" @@ -105,7 +106,7 @@ static apr_status_t crypto_shutdown_helper(void *data) { * Initialise the crypto library and perform one time initialisation. */ static apr_status_t crypto_init(apr_pool_t *pool, - const apr_array_header_t *params, int *rc) { + const char *params, int *rc) { CRYPTO_malloc_init(); ERR_load_crypto_strings(); /* SSL_load_error_strings(); */ @@ -176,13 +177,27 @@ static apr_status_t crypto_cleanup_helper(void *data) { * if the engine cannot be initialised. */ static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *provider, - const apr_array_header_t *params, apr_pool_t *pool) + const char *params, apr_pool_t *pool) { apr_crypto_config_t *config = NULL; - struct apr_crypto_param_t *ents = - params ? (struct apr_crypto_param_t *) params->elts : NULL; - int i = 0; apr_crypto_t *f = apr_pcalloc(pool, sizeof(apr_crypto_t)); + + struct { + const char *field; + char *value; + } fields[] = { + {"engine", NULL}, + {NULL, NULL} + }; + int i; + const char *ptr; + const char *key; + size_t klen; + const char *value; + size_t vlen; + static const char *const delims = " \r\n\t;|,"; + const char *engine; + if (!f) { return APR_ENOMEM; } @@ -223,19 +238,47 @@ static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *pr apr_pool_cleanup_register(pool, f, crypto_cleanup_helper, apr_pool_cleanup_null); - for (i = 0; params && i < params->nelts; i++) { - switch (ents[i].type) { - case APR_CRYPTO_ENGINE: - config->engine = ENGINE_by_id(ents[i].path); - if (!config->engine) { - return APR_ENOENGINE; + /* snitch parsing from the MySQL driver */ + for (ptr = strchr(params, '='); ptr; ptr = strchr(ptr, '=')) { + /* don't dereference memory that may not belong to us */ + if (ptr == params) { + ++ptr; + continue; + } + for (key = ptr-1; apr_isspace(*key); --key); + klen = 0; + while (apr_isalpha(*key)) { + if (key == params) { + /* Don't parse off the front of the params */ + --key; + ++klen; + break; } - if (!ENGINE_init(config->engine)) { - ENGINE_free(config->engine); - config->engine = NULL; - return APR_EINITENGINE; + --key; + ++klen; + } + ++key; + for (value = ptr+1; apr_isspace(*value); ++value); + vlen = strcspn(value, delims); + for (i=0; fields[i].field != NULL; ++i) { + if (!strncasecmp(fields[i].field, key, klen)) { + fields[i].value = apr_pstrndup(pool, value, vlen); + break; } - break; + } + ptr = value+vlen; + } + engine = fields[0].value; + + if (engine) { + config->engine = ENGINE_by_id(engine); + if (!config->engine) { + return APR_ENOENGINE; + } + if (!ENGINE_init(config->engine)) { + ENGINE_free(config->engine); + config->engine = NULL; + return APR_EINITENGINE; } } diff --git a/include/apr_crypto.h b/include/apr_crypto.h index 4c89d5c0e67..9ee42692650 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -37,49 +37,6 @@ extern "C" { * @{ */ -/** CA certificate type unknown */ -#define APR_CRYPTO_CA_TYPE_UNKNOWN 0 -/** binary DER encoded CA certificate */ -#define APR_CRYPTO_CA_TYPE_DER 1 -/** PEM encoded CA certificate */ -#define APR_CRYPTO_CA_TYPE_BASE64 2 -/** Netscape/Mozilla cert7.db CA certificate database */ -#define APR_CRYPTO_CA_TYPE_CERT7_DB 3 -/** Netscape/Mozilla secmod file */ -#define APR_CRYPTO_CA_TYPE_SECMOD 4 -/** Client certificate type unknown */ -#define APR_CRYPTO_CERT_TYPE_UNKNOWN 5 -/** binary DER encoded client certificate */ -#define APR_CRYPTO_CERT_TYPE_DER 6 -/** PEM encoded client certificate */ -#define APR_CRYPTO_CERT_TYPE_BASE64 7 -/** Netscape/Mozilla key3.db client certificate database */ -#define APR_CRYPTO_CERT_TYPE_KEY3_DB 8 -/** Netscape/Mozilla client certificate nickname */ -#define APR_CRYPTO_CERT_TYPE_NICKNAME 9 -/** Private key type unknown */ -#define APR_CRYPTO_KEY_TYPE_UNKNOWN 10 -/** binary DER encoded private key */ -#define APR_CRYPTO_KEY_TYPE_DER 11 -/** PEM encoded private key */ -#define APR_CRYPTO_KEY_TYPE_BASE64 12 -/** PKCS#12 encoded client certificate */ -#define APR_CRYPTO_CERT_TYPE_PFX 13 -/** PKCS#12 encoded private key */ -#define APR_CRYPTO_KEY_TYPE_PFX 14 -/** Openldap directory full of base64-encoded cert - * authorities with hashes in corresponding .0 directory - */ -#define APR_CRYPTO_CA_TYPE_CACERTDIR_BASE64 15 -/** CMS Key Database with private key and cert chain */ -#define APR_CRYPTO_CA_TYPE_CMS 16 -/** Symmetrical key */ -#define APR_CRYPTO_KEY_TYPE_SYM 17 -/** Netscape/Mozilla certificate database directory */ -#define APR_CRYPTO_CA_TYPE_DIR 18 -/** Crypto engine */ -#define APR_CRYPTO_ENGINE 101 - #if APU_HAVE_CRYPTO #ifndef APU_CRYPTO_RECOMMENDED_DRIVER @@ -158,21 +115,6 @@ typedef enum { /** Cipher Block Chaining */ } apr_crypto_block_key_mode_e; -/** - * Certificate and private key structure. - * - * The various crypto backends expect certificates and keys in a wide - * array of formats. - * @param type Type of certificate APR_CRYPTO_*_TYPE_* - * @param path Path, file or nickname of the certificate - * @param password Optional password, can be NULL - */ -typedef struct apr_crypto_param_t { - int type; - const char *path; - const char *password; -} apr_crypto_param_t; - /* These are opaque structs. Instantiation is up to each backend */ typedef struct apr_crypto_driver_t apr_crypto_driver_t; typedef struct apr_crypto_t apr_crypto_t; @@ -200,9 +142,13 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool); * @return APR_ENOTIMPL for no driver (when DSO not enabled) * @return APR_EDSOOPEN if DSO driver file can't be opened * @return APR_ESYMNOTFOUND if the driver file doesn't contain a driver + * @remarks NSS: the params can have "dir", "key3", "cert7" and "secmod" + * keys, each followed by an equal sign and a value. Such key/value pairs can + * be delimited by space, CR, LF, tab, semicolon, vertical bar or comma. + * @remarks OpenSSL: currently no params are supported. */ APR_DECLARE(apr_status_t) apr_crypto_get_driver(const apr_crypto_driver_t **driver, - const char *name, const apr_array_header_t *params, const apu_err_t **result, + const char *name, const char *params, const apu_err_t **result, apr_pool_t *pool); /** @@ -234,9 +180,13 @@ APR_DECLARE(apr_status_t) apr_crypto_error(const apu_err_t **result, * @param pool - process pool * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. + * @remarks NSS: currently no params are supported. + * @remarks OpenSSL: the params can have "engine" as a key, followed by an equal + * sign and a value. */ -APR_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, const apr_crypto_driver_t *driver, - const apr_array_header_t *params, apr_pool_t *pool); +APR_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, + const apr_crypto_driver_t *driver, + const char *params, apr_pool_t *pool); /** * @brief Get a hash table of key types, keyed by the name of the type against diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index 1d9e169d9dd..18c104f61c4 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -36,10 +36,10 @@ struct apr_crypto_driver_t { * @brief: allow driver to perform once-only initialisation. * Called once only. * @param pool The pool to register the cleanup in. - * @param params An array of optional init parameters. + * @param params Optional init parameter string. * @param rc Driver-specific additional error code */ - apr_status_t (*init)(apr_pool_t *pool, const apr_array_header_t *params, int *rc); + apr_status_t (*init)(apr_pool_t *pool, const char *params, int *rc); /** * @brief Create a context for supporting encryption. Keys, certificates, @@ -54,7 +54,7 @@ struct apr_crypto_driver_t { * if the engine cannot be initialised. */ apr_status_t (*make)(apr_crypto_t **f, const apr_crypto_driver_t *provider, - const apr_array_header_t *params, apr_pool_t *pool); + const char *params, apr_pool_t *pool); /** * @brief Get a hash table of key types, keyed by the name of the type against diff --git a/test/testcrypto.c b/test/testcrypto.c index 1631f7be344..8f31feba481 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -29,7 +29,7 @@ #define ALIGNED_STRING "123456789012345" static const apr_crypto_driver_t *get_driver(abts_case *tc, apr_pool_t *pool, - const char *name, const apr_array_header_t *params) { + const char *name, const char *params) { const apr_crypto_driver_t *driver = NULL; const apu_err_t *err = NULL; @@ -60,15 +60,8 @@ static const apr_crypto_driver_t *get_driver(abts_case *tc, apr_pool_t *pool, static const apr_crypto_driver_t *get_nss_driver(abts_case *tc, apr_pool_t *pool) { - apr_array_header_t *params; - apr_crypto_param_t *param; - /* initialise NSS */ - params = apr_array_make(pool, 10, sizeof(apr_crypto_param_t)); - param = apr_array_push(params); - param->type = APR_CRYPTO_CA_TYPE_DIR; - param->path = "data"; - return get_driver(tc, pool, "nss", params); + return get_driver(tc, pool, "nss", "dir=data"); } @@ -89,7 +82,7 @@ static apr_crypto_t *make(abts_case *tc, apr_pool_t *pool, } /* get the context */ - apr_crypto_make(&f, driver, NULL, pool); + apr_crypto_make(&f, driver, "engine=openssl", pool); ABTS_ASSERT(tc, "apr_crypto_make returned NULL", f != NULL); return f; From 8ea01a25b5132affbdd251f9ae32bf625ffc31ee Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 23 Oct 2011 17:05:19 +0000 Subject: [PATCH 7068/7878] Formatting, no functional change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1187932 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 45 +++-- crypto/apr_crypto_nss.c | 113 ++++++------ crypto/apr_crypto_openssl.c | 74 ++++---- include/apr_crypto.h | 27 +-- include/private/apr_crypto_internal.h | 4 +- test/testcrypto.c | 239 ++++++++++++++------------ 6 files changed, 272 insertions(+), 230 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 6af3bcb7ec0..4b28dd2e264 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -39,21 +39,21 @@ static apr_hash_t *drivers = NULL; #define CLEANUP_CAST (apr_status_t (*)(void*)) -APR_TYPEDEF_STRUCT(apr_crypto_t, \ - apr_pool_t *pool; \ - apr_crypto_driver_t *provider; \ +APR_TYPEDEF_STRUCT(apr_crypto_t, + apr_pool_t *pool; + apr_crypto_driver_t *provider; ) -APR_TYPEDEF_STRUCT(apr_crypto_key_t, \ - apr_pool_t *pool; \ - apr_crypto_driver_t *provider; \ - const apr_crypto_t *f; +APR_TYPEDEF_STRUCT(apr_crypto_key_t, + apr_pool_t *pool; + apr_crypto_driver_t *provider; + const apr_crypto_t *f; ) -APR_TYPEDEF_STRUCT(apr_crypto_block_t, \ - apr_pool_t *pool; \ - apr_crypto_driver_t *provider; \ - const apr_crypto_t *f; +APR_TYPEDEF_STRUCT(apr_crypto_block_t, + apr_pool_t *pool; + apr_crypto_driver_t *provider; + const apr_crypto_t *f; ) #if !APR_HAVE_MODULAR_DSO @@ -67,7 +67,8 @@ APR_TYPEDEF_STRUCT(apr_crypto_block_t, \ } #endif -static apr_status_t apr_crypto_term(void *ptr) { +static apr_status_t apr_crypto_term(void *ptr) +{ /* set drivers to NULL so init can work again */ drivers = NULL; @@ -77,7 +78,8 @@ static apr_status_t apr_crypto_term(void *ptr) { return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) { +APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) +{ apr_status_t ret = APR_SUCCESS; apr_pool_t *parent; @@ -118,7 +120,8 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) { APR_DECLARE(apr_status_t) apr_crypto_get_driver( const apr_crypto_driver_t **driver, const char *name, - const char *params, const apu_err_t **result, apr_pool_t *pool) { + const char *params, const apu_err_t **result, apr_pool_t *pool) +{ #if APR_HAVE_MODULAR_DSO char modname[32]; char symname[34]; @@ -153,7 +156,8 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( apr_snprintf(modname, sizeof(modname), "apr_crypto_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll", name); #else - apr_snprintf(modname, sizeof(modname), "apr_crypto_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".so", name); + apr_snprintf(modname, sizeof(modname), + "apr_crypto_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".so", name); #endif apr_snprintf(symname, sizeof(symname), "apr_crypto_%s_driver", name); rv = apu_dso_load(&dso, &symbol, modname, symname, pool); @@ -199,7 +203,8 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( * @param driver - The driver in use. * @return The name of the driver. */ -APR_DECLARE(const char *)apr_crypto_driver_name (const apr_crypto_driver_t *driver) +APR_DECLARE(const char *)apr_crypto_driver_name( + const apr_crypto_driver_t *driver) { return driver->name; } @@ -212,7 +217,8 @@ APR_DECLARE(const char *)apr_crypto_driver_name (const apr_crypto_driver_t *driv * @return APR_SUCCESS for success */ APR_DECLARE(apr_status_t) apr_crypto_error(const apu_err_t **result, - const apr_crypto_t *f) { + const apr_crypto_t *f) +{ return f->provider->error(result, f); } @@ -231,8 +237,9 @@ APR_DECLARE(apr_status_t) apr_crypto_error(const apu_err_t **result, * @remarks OpenSSL: the params can have "engine" as a key, followed by an equal * sign and a value. */ -APR_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, const apr_crypto_driver_t *driver, - const char *params, apr_pool_t *pool) { +APR_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, + const apr_crypto_driver_t *driver, const char *params, apr_pool_t *pool) +{ return driver->make(f, driver, params, pool); } diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 36b18afda1d..00d5293af1c 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -88,7 +88,9 @@ static int mode_cbc = APR_MODE_CBC; /** * Fetch the most recent error from this driver. */ -static apr_status_t crypto_error(const apu_err_t **result, const apr_crypto_t *f) { +static apr_status_t crypto_error(const apu_err_t **result, + const apr_crypto_t *f) +{ *result = f->result; return APR_SUCCESS; } @@ -131,11 +133,11 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc) const char *field; char *value; } fields[] = { - {"dir", NULL}, - {"key3", NULL}, - {"cert7", NULL}, - {"secmod", NULL}, - {NULL, NULL} + { "dir", NULL }, + { "key3", NULL }, + { "cert7", NULL }, + { "secmod", NULL }, + { NULL, NULL } }; int i; const char *ptr; @@ -143,7 +145,7 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc) size_t klen; const char *value; size_t vlen; - static const char *const delims = " \r\n\t;|,"; + static const char * const delims = " \r\n\t;|,"; /* sanity check - we can only initialise NSS once */ if (NSS_IsInitialized()) { @@ -157,7 +159,7 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc) ++ptr; continue; } - for (key = ptr-1; apr_isspace(*key); --key); + for (key = ptr - 1; apr_isspace(*key); --key); klen = 0; while (apr_isalpha(*key)) { if (key == params) { @@ -170,24 +172,23 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc) ++klen; } ++key; - for (value = ptr+1; apr_isspace(*value); ++value); + for (value = ptr + 1; apr_isspace(*value); ++value); vlen = strcspn(value, delims); - for (i=0; fields[i].field != NULL; ++i) { + for (i = 0; fields[i].field != NULL; ++i) { if (!strncasecmp(fields[i].field, key, klen)) { fields[i].value = apr_pstrndup(pool, value, vlen); break; } } - ptr = value+vlen; + ptr = value + vlen; } dir = fields[0].value; keyPrefix = fields[1].value; certPrefix = fields[2].value; secmod = fields[3].value; - apr_pool_cleanup_register(pool, pool, - crypto_shutdown_helper, - apr_pool_cleanup_null); + apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, + apr_pool_cleanup_null); if (keyPrefix || certPrefix || secmod) { s = NSS_Initialize(dir, certPrefix, keyPrefix, secmod, flags); @@ -271,8 +272,9 @@ static apr_status_t crypto_cleanup_helper(void *data) * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ -static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *provider, - const char *params, apr_pool_t *pool) +static apr_status_t crypto_make(apr_crypto_t **ff, + const apr_crypto_driver_t *provider, const char *params, + apr_pool_t *pool) { apr_crypto_config_t *config = NULL; apr_crypto_t *f; @@ -292,8 +294,7 @@ static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *pr if (!f->result) { return APR_ENOMEM; } - f->keys = apr_array_make(pool, - 10, sizeof(apr_crypto_key_t)); + f->keys = apr_array_make(pool, 10, sizeof(apr_crypto_key_t)); f->types = apr_hash_make(pool); if (!f->types) { @@ -311,9 +312,8 @@ static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *pr apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(mode_ecb)); apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(mode_cbc)); - apr_pool_cleanup_register(pool, f, - crypto_cleanup_helper, - apr_pool_cleanup_null); + apr_pool_cleanup_register(pool, f, crypto_cleanup_helper, + apr_pool_cleanup_null); return APR_SUCCESS; @@ -404,7 +404,7 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, /* decide on what cipher mechanism we will be using */ switch (type) { - case (APR_KEY_3DES_192) : + case (APR_KEY_3DES_192): if (APR_MODE_CBC == mode) { key->cipherOid = SEC_OID_DES_EDE3_CBC; } @@ -413,7 +413,7 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, /* No OID for CKM_DES3_ECB; */ } break; - case (APR_KEY_AES_128) : + case (APR_KEY_AES_128): if (APR_MODE_CBC == mode) { key->cipherOid = SEC_OID_AES_128_CBC; } @@ -421,7 +421,7 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, key->cipherOid = SEC_OID_AES_128_ECB; } break; - case (APR_KEY_AES_192) : + case (APR_KEY_AES_192): if (APR_MODE_CBC == mode) { key->cipherOid = SEC_OID_AES_192_CBC; } @@ -429,7 +429,7 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, key->cipherOid = SEC_OID_AES_192_ECB; } break; - case (APR_KEY_AES_256) : + case (APR_KEY_AES_256): if (APR_MODE_CBC == mode) { key->cipherOid = SEC_OID_AES_256_CBC; } @@ -450,25 +450,28 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, if (doPad) { CK_MECHANISM_TYPE paddedMech; paddedMech = PK11_GetPadMechanism(key->cipherMech); - if (CKM_INVALID_MECHANISM == paddedMech || key->cipherMech == paddedMech) { + if (CKM_INVALID_MECHANISM == paddedMech || key->cipherMech + == paddedMech) { return APR_EPADDING; } key->cipherMech = paddedMech; } /* Turn the raw passphrase and salt into SECItems */ - passItem.data = (unsigned char*)pass; + passItem.data = (unsigned char*) pass; passItem.len = passLen; - saltItem.data = (unsigned char*)salt; + saltItem.data = (unsigned char*) salt; saltItem.len = saltLen; /* generate the key */ /* pbeAlg and cipherAlg are the same. NSS decides the keylength. */ - algid = PK11_CreatePBEV2AlgorithmID(key->cipherOid, key->cipherOid, SEC_OID_HMAC_SHA1, 0, iterations, &saltItem); + algid = PK11_CreatePBEV2AlgorithmID(key->cipherOid, key->cipherOid, + SEC_OID_HMAC_SHA1, 0, iterations, &saltItem); if (algid) { slot = PK11_GetBestSlot(key->cipherMech, wincx); if (slot) { - key->symKey = PK11_PBEKeyGen(slot, algid, &passItem, PR_FALSE, wincx); + key->symKey = PK11_PBEKeyGen(slot, algid, &passItem, PR_FALSE, + wincx); PK11_FreeSlot(slot); } SECOID_DestroyAlgorithmID(algid, PR_TRUE); @@ -527,9 +530,8 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, block->pool = p; block->provider = key->provider; - apr_pool_cleanup_register(p, block, - crypto_block_cleanup_helper, - apr_pool_cleanup_null); + apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, + apr_pool_cleanup_null); if (key->ivSize) { if (iv == NULL) { @@ -548,7 +550,7 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, *iv = usedIv; } else { - usedIv = (unsigned char *)*iv; + usedIv = (unsigned char *) *iv; } ivItem.data = usedIv; ivItem.len = key->ivSize; @@ -558,7 +560,8 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, secParam = PK11_GenerateNewParam(key->cipherMech, key->symKey); } block->blockSize = PK11_GetBlockSize(key->cipherMech, secParam); - block->ctx = PK11_CreateContextBySymKey(key->cipherMech, CKA_ENCRYPT, key->symKey, secParam); + block->ctx = PK11_CreateContextBySymKey(key->cipherMech, CKA_ENCRYPT, + key->symKey, secParam); /* did an error occur? */ perr = PORT_GetError(); @@ -569,7 +572,7 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, } if (blockSize) { - *blockSize = PK11_GetBlockSize(key->cipherMech, secParam); + *blockSize = PK11_GetBlockSize(key->cipherMech, secParam); } return APR_SUCCESS; @@ -614,7 +617,8 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, *out = buffer; } - s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*)in, inlen); + s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*) in, + inlen); if (s != SECSuccess) { PRErrorCode perr = PORT_GetError(); if (perr) { @@ -703,16 +707,15 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, block->pool = p; block->provider = key->provider; - apr_pool_cleanup_register(p, block, - crypto_block_cleanup_helper, - apr_pool_cleanup_null); + apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, + apr_pool_cleanup_null); if (key->ivSize) { SECItem ivItem; if (iv == NULL) { return APR_ENOIV; /* Cannot initialise without an IV */ } - ivItem.data = (unsigned char*)iv; + ivItem.data = (unsigned char*) iv; ivItem.len = key->ivSize; secParam = PK11_ParamFromIV(key->cipherMech, &ivItem); } @@ -720,7 +723,8 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, secParam = PK11_GenerateNewParam(key->cipherMech, key->symKey); } block->blockSize = PK11_GetBlockSize(key->cipherMech, secParam); - block->ctx = PK11_CreateContextBySymKey(key->cipherMech, CKA_DECRYPT, key->symKey, secParam); + block->ctx = PK11_CreateContextBySymKey(key->cipherMech, CKA_DECRYPT, + key->symKey, secParam); /* did an error occur? */ perr = PORT_GetError(); @@ -776,7 +780,8 @@ static apr_status_t crypto_block_decrypt(unsigned char **out, *out = buffer; } - s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*)in, inlen); + s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*) in, + inlen); if (s != SECSuccess) { PRErrorCode perr = PORT_GetError(); if (perr) { @@ -837,22 +842,12 @@ static apr_status_t crypto_block_decrypt_finish(unsigned char *out, * NSS module. */ APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_nss_driver = { - "nss", - crypto_init, - crypto_make, - crypto_get_block_key_types, - crypto_get_block_key_modes, - crypto_passphrase, - crypto_block_encrypt_init, - crypto_block_encrypt, - crypto_block_encrypt_finish, - crypto_block_decrypt_init, - crypto_block_decrypt, - crypto_block_decrypt_finish, - crypto_block_cleanup, - crypto_cleanup, - crypto_shutdown, - crypto_error + "nss", crypto_init, crypto_make, crypto_get_block_key_types, + crypto_get_block_key_modes, crypto_passphrase, + crypto_block_encrypt_init, crypto_block_encrypt, + crypto_block_encrypt_finish, crypto_block_decrypt_init, + crypto_block_decrypt, crypto_block_decrypt_finish, + crypto_block_cleanup, crypto_cleanup, crypto_shutdown, crypto_error }; #endif diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index d227284e53a..63155162737 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -83,7 +83,9 @@ static int mode_cbc = APR_MODE_CBC; /** * Fetch the most recent error from this driver. */ -static apr_status_t crypto_error(const apu_err_t **result, const apr_crypto_t *f) { +static apr_status_t crypto_error(const apu_err_t **result, + const apr_crypto_t *f) +{ *result = f->result; return APR_SUCCESS; } @@ -91,22 +93,24 @@ static apr_status_t crypto_error(const apu_err_t **result, const apr_crypto_t *f /** * Shutdown the crypto library and release resources. */ -static apr_status_t crypto_shutdown(void) { +static apr_status_t crypto_shutdown(void) +{ ERR_free_strings(); EVP_cleanup(); ENGINE_cleanup(); return APR_SUCCESS; } -static apr_status_t crypto_shutdown_helper(void *data) { +static apr_status_t crypto_shutdown_helper(void *data) +{ return crypto_shutdown(); } /** * Initialise the crypto library and perform one time initialisation. */ -static apr_status_t crypto_init(apr_pool_t *pool, - const char *params, int *rc) { +static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc) +{ CRYPTO_malloc_init(); ERR_load_crypto_strings(); /* SSL_load_error_strings(); */ @@ -126,7 +130,8 @@ static apr_status_t crypto_init(apr_pool_t *pool, * @param ctx The block context to use. * @return Returns APR_ENOTIMPL if not supported. */ -static apr_status_t crypto_block_cleanup(apr_crypto_block_t *ctx) { +static apr_status_t crypto_block_cleanup(apr_crypto_block_t *ctx) +{ if (ctx->initialised) { EVP_CIPHER_CTX_cleanup(&ctx->cipherCtx); @@ -137,7 +142,8 @@ static apr_status_t crypto_block_cleanup(apr_crypto_block_t *ctx) { } -static apr_status_t crypto_block_cleanup_helper(void *data) { +static apr_status_t crypto_block_cleanup_helper(void *data) +{ apr_crypto_block_t *block = (apr_crypto_block_t *) data; return crypto_block_cleanup(block); } @@ -148,7 +154,8 @@ static apr_status_t crypto_block_cleanup_helper(void *data) { * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ -static apr_status_t crypto_cleanup(apr_crypto_t *f) { +static apr_status_t crypto_cleanup(apr_crypto_t *f) +{ if (f->config->engine) { ENGINE_finish(f->config->engine); @@ -159,7 +166,8 @@ static apr_status_t crypto_cleanup(apr_crypto_t *f) { } -static apr_status_t crypto_cleanup_helper(void *data) { +static apr_status_t crypto_cleanup_helper(void *data) +{ apr_crypto_t *f = (apr_crypto_t *) data; return crypto_cleanup(f); } @@ -176,8 +184,9 @@ static apr_status_t crypto_cleanup_helper(void *data) { * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ -static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *provider, - const char *params, apr_pool_t *pool) +static apr_status_t crypto_make(apr_crypto_t **ff, + const apr_crypto_driver_t *provider, const char *params, + apr_pool_t *pool) { apr_crypto_config_t *config = NULL; apr_crypto_t *f = apr_pcalloc(pool, sizeof(apr_crypto_t)); @@ -186,8 +195,8 @@ static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *pr const char *field; char *value; } fields[] = { - {"engine", NULL}, - {NULL, NULL} + { "engine", NULL }, + { NULL, NULL } }; int i; const char *ptr; @@ -195,7 +204,7 @@ static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *pr size_t klen; const char *value; size_t vlen; - static const char *const delims = " \r\n\t;|,"; + static const char * const delims = " \r\n\t;|,"; const char *engine; if (!f) { @@ -245,7 +254,7 @@ static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *pr ++ptr; continue; } - for (key = ptr-1; apr_isspace(*key); --key); + for (key = ptr - 1; apr_isspace(*key); --key); klen = 0; while (apr_isalpha(*key)) { if (key == params) { @@ -258,15 +267,15 @@ static apr_status_t crypto_make(apr_crypto_t **ff, const apr_crypto_driver_t *pr ++klen; } ++key; - for (value = ptr+1; apr_isspace(*value); ++value); + for (value = ptr + 1; apr_isspace(*value); ++value); vlen = strcspn(value, delims); - for (i=0; fields[i].field != NULL; ++i) { + for (i = 0; fields[i].field != NULL; ++i) { if (!strncasecmp(fields[i].field, key, klen)) { fields[i].value = apr_pstrndup(pool, value, vlen); break; } } - ptr = value+vlen; + ptr = value + vlen; } engine = fields[0].value; @@ -370,7 +379,8 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, /* A 3DES key */ if (mode == APR_MODE_CBC) { key->cipher = EVP_des_ede3_cbc(); - } else { + } + else { key->cipher = EVP_des_ede3_ecb(); } break; @@ -379,7 +389,8 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, if (mode == APR_MODE_CBC) { key->cipher = EVP_aes_128_cbc(); - } else { + } + else { key->cipher = EVP_aes_128_ecb(); } break; @@ -388,7 +399,8 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, if (mode == APR_MODE_CBC) { key->cipher = EVP_aes_192_cbc(); - } else { + } + else { key->cipher = EVP_aes_192_ecb(); } break; @@ -397,7 +409,8 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, if (mode == APR_MODE_CBC) { key->cipher = EVP_aes_256_cbc(); - } else { + } + else { key->cipher = EVP_aes_256_ecb(); } break; @@ -495,7 +508,8 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, return APR_ENOIV; } *iv = usedIv; - } else { + } + else { usedIv = (unsigned char *) *iv; } } @@ -767,13 +781,13 @@ static apr_status_t crypto_block_decrypt_finish(unsigned char *out, /** * OpenSSL module. */ -APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_openssl_driver = -{ "openssl", crypto_init, crypto_make, crypto_get_block_key_types, - crypto_get_block_key_modes, crypto_passphrase, - crypto_block_encrypt_init, crypto_block_encrypt, - crypto_block_encrypt_finish, crypto_block_decrypt_init, - crypto_block_decrypt, crypto_block_decrypt_finish, - crypto_block_cleanup, crypto_cleanup, crypto_shutdown, crypto_error +APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_openssl_driver = { + "openssl", crypto_init, crypto_make, crypto_get_block_key_types, + crypto_get_block_key_modes, crypto_passphrase, + crypto_block_encrypt_init, crypto_block_encrypt, + crypto_block_encrypt_finish, crypto_block_decrypt_init, + crypto_block_decrypt, crypto_block_decrypt_finish, + crypto_block_cleanup, crypto_cleanup, crypto_shutdown, crypto_error }; #endif diff --git a/include/apr_crypto.h b/include/apr_crypto.h index 9ee42692650..eba0ef618e3 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -99,16 +99,17 @@ extern "C" { * aligned data, use 3DES_192/CBC, AES_256/CBC or AES_256/ECB. */ -typedef enum { - APR_KEY_NONE, - APR_KEY_3DES_192, /** 192 bit (3-Key) 3DES */ +typedef enum +{ + APR_KEY_NONE, APR_KEY_3DES_192, /** 192 bit (3-Key) 3DES */ APR_KEY_AES_128, /** 128 bit AES */ APR_KEY_AES_192, /** 192 bit AES */ APR_KEY_AES_256 /** 256 bit AES */ } apr_crypto_block_key_type_e; -typedef enum { +typedef enum +{ APR_MODE_NONE, /** An error condition */ APR_MODE_ECB, /** Electronic Code Book */ APR_MODE_CBC @@ -147,9 +148,9 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool); * be delimited by space, CR, LF, tab, semicolon, vertical bar or comma. * @remarks OpenSSL: currently no params are supported. */ -APR_DECLARE(apr_status_t) apr_crypto_get_driver(const apr_crypto_driver_t **driver, - const char *name, const char *params, const apu_err_t **result, - apr_pool_t *pool); +APR_DECLARE(apr_status_t) apr_crypto_get_driver( + const apr_crypto_driver_t **driver, const char *name, + const char *params, const apu_err_t **result, apr_pool_t *pool); /** * @brief Return the name of the driver. @@ -157,7 +158,8 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver(const apr_crypto_driver_t **driv * @param driver - The driver in use. * @return The name of the driver. */ -APR_DECLARE(const char *) apr_crypto_driver_name(const apr_crypto_driver_t *driver); +APR_DECLARE(const char *) apr_crypto_driver_name( + const apr_crypto_driver_t *driver); /** * @brief Get the result of the last operation on a context. If the result @@ -184,9 +186,9 @@ APR_DECLARE(apr_status_t) apr_crypto_error(const apu_err_t **result, * @remarks OpenSSL: the params can have "engine" as a key, followed by an equal * sign and a value. */ -APR_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, - const apr_crypto_driver_t *driver, - const char *params, apr_pool_t *pool); +APR_DECLARE(apr_status_t) + apr_crypto_make(apr_crypto_t **f, const apr_crypto_driver_t *driver, + const char *params, apr_pool_t *pool); /** * @brief Get a hash table of key types, keyed by the name of the type against @@ -390,7 +392,8 @@ APR_DECLARE(apr_status_t) apr_crypto_cleanup(apr_crypto_t *f); * @param driver - driver to use * @return Returns APR_ENOTIMPL if not supported. */ -APR_DECLARE(apr_status_t) apr_crypto_shutdown(const apr_crypto_driver_t *driver); +APR_DECLARE(apr_status_t) + apr_crypto_shutdown(const apr_crypto_driver_t *driver); #endif /* APU_HAVE_CRYPTO */ diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index 18c104f61c4..b571451a23c 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -171,8 +171,8 @@ struct apr_crypto_driver_t { * formatted. * @return APR_ENOTIMPL if not implemented. */ - apr_status_t (*block_encrypt_finish)(unsigned char *out, apr_size_t *outlen, - apr_crypto_block_t *ctx); + apr_status_t (*block_encrypt_finish)(unsigned char *out, + apr_size_t *outlen, apr_crypto_block_t *ctx); /** * @brief Initialise a context for decrypting arbitrary data using the given key. diff --git a/test/testcrypto.c b/test/testcrypto.c index 8f31feba481..335c3ae65d7 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -29,7 +29,8 @@ #define ALIGNED_STRING "123456789012345" static const apr_crypto_driver_t *get_driver(abts_case *tc, apr_pool_t *pool, - const char *name, const char *params) { + const char *name, const char *params) +{ const apr_crypto_driver_t *driver = NULL; const apu_err_t *err = NULL; @@ -58,7 +59,8 @@ static const apr_crypto_driver_t *get_driver(abts_case *tc, apr_pool_t *pool, } static const apr_crypto_driver_t *get_nss_driver(abts_case *tc, - apr_pool_t *pool) { + apr_pool_t *pool) +{ /* initialise NSS */ return get_driver(tc, pool, "nss", "dir=data"); @@ -66,14 +68,16 @@ static const apr_crypto_driver_t *get_nss_driver(abts_case *tc, } static const apr_crypto_driver_t *get_openssl_driver(abts_case *tc, - apr_pool_t *pool) { + apr_pool_t *pool) +{ return get_driver(tc, pool, "openssl", NULL); } static apr_crypto_t *make(abts_case *tc, apr_pool_t *pool, - const apr_crypto_driver_t *driver) { + const apr_crypto_driver_t *driver) +{ apr_crypto_t *f = NULL; @@ -92,7 +96,8 @@ static apr_crypto_t *make(abts_case *tc, apr_pool_t *pool, static const apr_crypto_key_t *passphrase(abts_case *tc, apr_pool_t *pool, const apr_crypto_driver_t *driver, const apr_crypto_t *f, apr_crypto_block_key_type_e type, apr_crypto_block_key_mode_e mode, - int doPad, const char *description) { + int doPad, const char *description) +{ apr_crypto_key_t *key = NULL; const apu_err_t *result = NULL; @@ -111,11 +116,12 @@ static const apr_crypto_key_t *passphrase(abts_case *tc, apr_pool_t *pool, if (APR_ENOCIPHER == rv) { apr_crypto_error(&result, f); ABTS_NOT_IMPL(tc, apr_psprintf(pool, - "skipped: %s %s passphrase return APR_ENOCIPHER: error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), result->rc, - result->reason ? result->reason : "", result->msg ? result->msg : "")); + "skipped: %s %s passphrase return APR_ENOCIPHER: error %d: %s (%s)\n", + description, apr_crypto_driver_name(driver), result->rc, + result->reason ? result->reason : "", result->msg ? result->msg : "")); return NULL; - } else { + } + else { if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); fprintf(stderr, "passphrase: %s %s native error %d: %s (%s)\n", @@ -141,7 +147,8 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, const apr_crypto_key_t *key, const unsigned char *in, const apr_size_t inlen, unsigned char **cipherText, apr_size_t *cipherTextLen, const unsigned char **iv, - apr_size_t *blockSize, const char *description) { + apr_size_t *blockSize, const char *description) +{ apr_crypto_block_t *block = NULL; const apu_err_t *result = NULL; @@ -156,7 +163,8 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, rv = apr_crypto_block_encrypt_init(&block, iv, key, blockSize, pool); if (APR_ENOTIMPL == rv) { ABTS_NOT_IMPL(tc, "apr_crypto_block_encrypt_init returned APR_ENOTIMPL"); - } else { + } + else { if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); fprintf(stderr, "encrypt_init: %s %s native error %d: %s (%s)\n", @@ -181,8 +189,8 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, apr_crypto_error(&result, f); fprintf(stderr, "encrypt: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, - result->reason ? result->reason : "", - result->msg ? result->msg : ""); + result->reason ? result->reason : "", result->msg ? result->msg + : ""); } ABTS_ASSERT(tc, "apr_crypto_block_encrypt returned APR_ECRYPT", rv != APR_ECRYPT); ABTS_ASSERT(tc, "failed to apr_crypto_block_encrypt", rv == APR_SUCCESS); @@ -192,13 +200,14 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, } /* finalise the encryption */ - rv = apr_crypto_block_encrypt_finish(*cipherText + *cipherTextLen, &len, block); + rv = apr_crypto_block_encrypt_finish(*cipherText + *cipherTextLen, &len, + block); if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); fprintf(stderr, "encrypt_finish: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, - result->reason ? result->reason : "", - result->msg ? result->msg : ""); + result->reason ? result->reason : "", result->msg ? result->msg + : ""); } ABTS_ASSERT(tc, "apr_crypto_block_encrypt_finish returned APR_ECRYPT", rv != APR_ECRYPT); ABTS_ASSERT(tc, "apr_crypto_block_encrypt_finish returned APR_EPADDING", rv != APR_EPADDING); @@ -218,7 +227,8 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, const apr_crypto_key_t *key, unsigned char *cipherText, apr_size_t cipherTextLen, unsigned char **plainText, apr_size_t *plainTextLen, const unsigned char *iv, - apr_size_t *blockSize, const char *description) { + apr_size_t *blockSize, const char *description) +{ apr_crypto_block_t *block = NULL; const apu_err_t *result = NULL; @@ -233,7 +243,8 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, rv = apr_crypto_block_decrypt_init(&block, blockSize, iv, key, pool); if (APR_ENOTIMPL == rv) { ABTS_NOT_IMPL(tc, "apr_crypto_block_decrypt_init returned APR_ENOTIMPL"); - } else { + } + else { if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); fprintf(stderr, "decrypt_init: %s %s native error %d: %s (%s)\n", @@ -259,8 +270,8 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, apr_crypto_error(&result, f); fprintf(stderr, "decrypt: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, - result->reason ? result->reason : "", - result->msg ? result->msg : ""); + result->reason ? result->reason : "", result->msg ? result->msg + : ""); } ABTS_ASSERT(tc, "apr_crypto_block_decrypt returned APR_ECRYPT", rv != APR_ECRYPT); ABTS_ASSERT(tc, "failed to apr_crypto_block_decrypt", rv == APR_SUCCESS); @@ -276,8 +287,8 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, apr_crypto_error(&result, f); fprintf(stderr, "decrypt_finish: %s %s native error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, - result->reason ? result->reason : "", - result->msg ? result->msg : ""); + result->reason ? result->reason : "", result->msg ? result->msg + : ""); } ABTS_ASSERT(tc, "apr_crypto_block_decrypt_finish returned APR_ECRYPT", rv != APR_ECRYPT); ABTS_ASSERT(tc, "apr_crypto_block_decrypt_finish returned APR_EPADDING", rv != APR_EPADDING); @@ -305,7 +316,8 @@ static void crypto_block_cross(abts_case *tc, apr_pool_t *pool, const apr_crypto_driver_t **drivers, const apr_crypto_block_key_type_e type, const apr_crypto_block_key_mode_e mode, int doPad, - const unsigned char *in, apr_size_t inlen, const char *description) { + const unsigned char *in, apr_size_t inlen, const char *description) +{ const apr_crypto_driver_t *driver1 = drivers[0]; const apr_crypto_driver_t *driver2 = drivers[1]; apr_crypto_t *f1 = NULL; @@ -345,7 +357,8 @@ static void crypto_block_cross(abts_case *tc, apr_pool_t *pool, /** * Test initialisation. */ -static void test_crypto_init(abts_case *tc, void *data) { +static void test_crypto_init(abts_case *tc, void *data) +{ apr_pool_t *pool = NULL; apr_status_t rv; @@ -361,7 +374,8 @@ static void test_crypto_init(abts_case *tc, void *data) { /** * Simple test of OpenSSL block crypt. */ -static void test_crypto_block_openssl(abts_case *tc, void *data) { +static void test_crypto_block_openssl(abts_case *tc, void *data) +{ apr_pool_t *pool = NULL; const apr_crypto_driver_t *drivers[] = { NULL, NULL }; @@ -371,22 +385,22 @@ static void test_crypto_block_openssl(abts_case *tc, void *data) { apr_pool_create(&pool, NULL); drivers[0] = get_openssl_driver(tc, pool); drivers[1] = get_openssl_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, - "KEY_3DES_192/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 0, in, inlen, - "KEY_3DES_192/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, - "KEY_AES_256/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, - "KEY_AES_256/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, inlen, - "KEY_AES_192/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, inlen, - "KEY_AES_192/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, inlen, - "KEY_AES_128/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, inlen, - "KEY_AES_128/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, + in, inlen, "KEY_3DES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 0, + in, inlen, "KEY_3DES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_256/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_256/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_128/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); } @@ -394,7 +408,8 @@ static void test_crypto_block_openssl(abts_case *tc, void *data) { /** * Simple test of NSS block crypt. */ -static void test_crypto_block_nss(abts_case *tc, void *data) { +static void test_crypto_block_nss(abts_case *tc, void *data) +{ apr_pool_t *pool = NULL; const apr_crypto_driver_t *drivers[] = { NULL, NULL }; @@ -404,22 +419,22 @@ static void test_crypto_block_nss(abts_case *tc, void *data) { apr_pool_create(&pool, NULL); drivers[0] = get_nss_driver(tc, pool); drivers[1] = get_nss_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, - "KEY_3DES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, + in, inlen, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 0, in, inlen, "KEY_3DES_192/MODE_ECB"); */ - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, - "KEY_AES_256/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, - "KEY_AES_256/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, inlen, - "KEY_AES_192/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, inlen, - "KEY_AES_192/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, inlen, - "KEY_AES_128/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, inlen, - "KEY_AES_128/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_256/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_256/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_128/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); } @@ -427,7 +442,8 @@ static void test_crypto_block_nss(abts_case *tc, void *data) { /** * Encrypt NSS, decrypt OpenSSL. */ -static void test_crypto_block_nss_openssl(abts_case *tc, void *data) { +static void test_crypto_block_nss_openssl(abts_case *tc, void *data) +{ apr_pool_t *pool = NULL; const apr_crypto_driver_t *drivers[] = { NULL, NULL }; @@ -438,15 +454,15 @@ static void test_crypto_block_nss_openssl(abts_case *tc, void *data) { drivers[0] = get_nss_driver(tc, pool); drivers[1] = get_openssl_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, - "KEY_3DES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, + in, inlen, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 0, in, inlen, "KEY_3DES_192/MODE_ECB"); */ - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, - "KEY_AES_256/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, - "KEY_AES_256/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_256/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_256/MODE_ECB"); /* all 4 of these tests fail to interoperate - a clue from the xml-security code is that * NSS cannot distinguish between the 128 and 192 bit versions of AES. Will need to be @@ -465,7 +481,8 @@ static void test_crypto_block_nss_openssl(abts_case *tc, void *data) { /** * Encrypt OpenSSL, decrypt NSS. */ -static void test_crypto_block_openssl_nss(abts_case *tc, void *data) { +static void test_crypto_block_openssl_nss(abts_case *tc, void *data) +{ apr_pool_t *pool = NULL; const apr_crypto_driver_t *drivers[] = { NULL, NULL }; @@ -475,16 +492,16 @@ static void test_crypto_block_openssl_nss(abts_case *tc, void *data) { apr_pool_create(&pool, NULL); drivers[0] = get_openssl_driver(tc, pool); drivers[1] = get_nss_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, - "KEY_3DES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, + in, inlen, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 0, in, inlen, "KEY_3DES_192/MODE_ECB"); */ - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, - "KEY_AES_256/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, - "KEY_AES_256/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_256/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_256/MODE_ECB"); /* all 4 of these tests fail to interoperate - a clue from the xml-security code is that * NSS cannot distinguish between the 128 and 192 bit versions of AES. Will need to be @@ -503,7 +520,8 @@ static void test_crypto_block_openssl_nss(abts_case *tc, void *data) { /** * Simple test of OpenSSL block crypt. */ -static void test_crypto_block_openssl_pad(abts_case *tc, void *data) { +static void test_crypto_block_openssl_pad(abts_case *tc, void *data) +{ apr_pool_t *pool = NULL; const apr_crypto_driver_t *drivers[] = { NULL, NULL }; @@ -514,22 +532,22 @@ static void test_crypto_block_openssl_pad(abts_case *tc, void *data) { drivers[0] = get_openssl_driver(tc, pool); drivers[1] = get_openssl_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, in, inlen, - "KEY_3DES_192/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 1, in, inlen, - "KEY_3DES_192/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, inlen, - "KEY_AES_256/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 1, in, inlen, - "KEY_AES_256/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, inlen, - "KEY_AES_192/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 1, in, inlen, - "KEY_AES_192/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, inlen, - "KEY_AES_128/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 1, in, inlen, - "KEY_AES_128/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, + in, inlen, "KEY_3DES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 1, + in, inlen, "KEY_3DES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_256/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 1, in, + inlen, "KEY_AES_256/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 1, in, + inlen, "KEY_AES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_128/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 1, in, + inlen, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); @@ -538,9 +556,11 @@ static void test_crypto_block_openssl_pad(abts_case *tc, void *data) { /** * Simple test of NSS block crypt. */ -static void test_crypto_block_nss_pad(abts_case *tc, void *data) { +static void test_crypto_block_nss_pad(abts_case *tc, void *data) +{ apr_pool_t *pool = NULL; - const apr_crypto_driver_t *drivers[] = { NULL, NULL }; + const apr_crypto_driver_t *drivers[] = + { NULL, NULL }; const unsigned char *in = (const unsigned char *) TEST_STRING; apr_size_t inlen = sizeof(TEST_STRING); @@ -549,25 +569,25 @@ static void test_crypto_block_nss_pad(abts_case *tc, void *data) { drivers[0] = get_nss_driver(tc, pool); drivers[1] = get_nss_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, in, inlen, - "KEY_3DES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, + in, inlen, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 1, in, inlen, "KEY_3DES_192/MODE_ECB"); */ - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, inlen, - "KEY_AES_256/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_256/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ /*crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 1, in, inlen, "KEY_AES_256/MODE_ECB");*/ - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, inlen, - "KEY_AES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_192/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ /*crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_ECB, 1, in, inlen, "KEY_AES_192/MODE_ECB");*/ - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, inlen, - "KEY_AES_128/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_128/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ /*crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_ECB, 1, in, inlen, "KEY_AES_128/MODE_ECB");*/ @@ -579,7 +599,8 @@ static void test_crypto_block_nss_pad(abts_case *tc, void *data) { /** * Encrypt NSS, decrypt OpenSSL. */ -static void test_crypto_block_nss_openssl_pad(abts_case *tc, void *data) { +static void test_crypto_block_nss_openssl_pad(abts_case *tc, void *data) +{ apr_pool_t *pool = NULL; const apr_crypto_driver_t *drivers[] = { NULL, NULL }; @@ -590,14 +611,14 @@ static void test_crypto_block_nss_openssl_pad(abts_case *tc, void *data) { drivers[0] = get_nss_driver(tc, pool); drivers[1] = get_openssl_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, in, inlen, - "KEY_3DES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, + in, inlen, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 1, in, inlen, "KEY_3DES_192/MODE_ECB"); */ - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, inlen, - "KEY_AES_256/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_256/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ /*crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 1, in, inlen, "KEY_AES_256/MODE_ECB");*/ @@ -619,7 +640,8 @@ static void test_crypto_block_nss_openssl_pad(abts_case *tc, void *data) { /** * Encrypt OpenSSL, decrypt NSS. */ -static void test_crypto_block_openssl_nss_pad(abts_case *tc, void *data) { +static void test_crypto_block_openssl_nss_pad(abts_case *tc, void *data) +{ apr_pool_t *pool = NULL; const apr_crypto_driver_t *drivers[] = { NULL, NULL }; @@ -629,14 +651,14 @@ static void test_crypto_block_openssl_nss_pad(abts_case *tc, void *data) { apr_pool_create(&pool, NULL); drivers[0] = get_openssl_driver(tc, pool); drivers[1] = get_nss_driver(tc, pool); - crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, in, inlen, - "KEY_3DES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, + in, inlen, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 1, in, inlen, "KEY_3DES_192/MODE_ECB"); */ - crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, inlen, - "KEY_AES_256/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_256/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ /*crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 1, in, inlen, "KEY_AES_256/MODE_ECB");*/ @@ -807,7 +829,8 @@ static void test_crypto_get_block_key_modes_nss(abts_case *tc, void *data) } -abts_suite *testcrypto(abts_suite *suite) { +abts_suite *testcrypto(abts_suite *suite) +{ suite = ADD_SUITE(suite); /* test simple init and shutdown */ From c915e05cb9a56cc647200e460b90c231d94f3455 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 23 Oct 2011 22:07:04 +0000 Subject: [PATCH 7069/7878] apr_crypto: Teach the apr_crypto_nss driver to support the "noinit" option for where NSS is initialised elsewhere. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1187984 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_nss.c | 87 ++++++++++++++++++++----------------- crypto/apr_crypto_openssl.c | 79 ++++++++++++++++----------------- 2 files changed, 84 insertions(+), 82 deletions(-) diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 00d5293af1c..56c0ceb82fa 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "apr_lib.h" #include "apu.h" #include "apr_private.h" #include "apu_errno.h" @@ -127,65 +128,69 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc) const char *keyPrefix = NULL; const char *certPrefix = NULL; const char *secmod = NULL; + int noinit = 0; PRUint32 flags = 0; struct { const char *field; - char *value; + const char *value; + int set; } fields[] = { - { "dir", NULL }, - { "key3", NULL }, - { "cert7", NULL }, - { "secmod", NULL }, - { NULL, NULL } + { "dir", NULL, 0 }, + { "key3", NULL, 0 }, + { "cert7", NULL, 0 }, + { "secmod", NULL, 0 }, + { "noinit", NULL, 0 }, + { NULL, NULL, 0 } }; - int i; const char *ptr; - const char *key; size_t klen; - const char *value; - size_t vlen; - static const char * const delims = " \r\n\t;|,"; - - /* sanity check - we can only initialise NSS once */ - if (NSS_IsInitialized()) { - return APR_EREINIT; - } - - /* snitch parsing from the MySQL driver */ - for (ptr = strchr(params, '='); ptr; ptr = strchr(ptr, '=')) { - /* don't dereference memory that may not belong to us */ - if (ptr == params) { - ++ptr; - continue; + char **elts = NULL; + char *elt; + int i = 0, j; + apr_status_t status; + + if (APR_SUCCESS != (status = apr_tokenize_to_argv(params, &elts, pool))) { + return status; + } + while ((elt = elts[i])) { + ptr = strchr(elt, '='); + if (ptr) { + for (klen = ptr - elt; klen && apr_isspace(elt[klen - 1]); --klen); + ptr++; } - for (key = ptr - 1; apr_isspace(*key); --key); - klen = 0; - while (apr_isalpha(*key)) { - if (key == params) { - /* Don't parse off the front of the params */ - --key; - ++klen; - break; - } - --key; - ++klen; + else { + for (klen = strlen(elt); klen && apr_isspace(elt[klen - 1]); --klen); } - ++key; - for (value = ptr + 1; apr_isspace(*value); ++value); - vlen = strcspn(value, delims); - for (i = 0; fields[i].field != NULL; ++i) { - if (!strncasecmp(fields[i].field, key, klen)) { - fields[i].value = apr_pstrndup(pool, value, vlen); + elt[klen] = 0; + + for (j = 0; fields[j].field != NULL; ++j) { + if (klen && !strcasecmp(fields[j].field, elt)) { + fields[j].set = 1; + if (ptr) { + fields[j].value = ptr; + } break; } } - ptr = value + vlen; + + i++; } dir = fields[0].value; keyPrefix = fields[1].value; certPrefix = fields[2].value; secmod = fields[3].value; + noinit = fields[4].set; + + /* if we've been asked to bypass, do so here */ + if (noinit) { + return APR_SUCCESS; + } + + /* sanity check - we can only initialise NSS once */ + if (NSS_IsInitialized()) { + return APR_EREINIT; + } apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, apr_pool_cleanup_null); diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 63155162737..2c2178bb453 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -191,21 +191,50 @@ static apr_status_t crypto_make(apr_crypto_t **ff, apr_crypto_config_t *config = NULL; apr_crypto_t *f = apr_pcalloc(pool, sizeof(apr_crypto_t)); + const char *engine; + struct { const char *field; - char *value; + const char *value; + int set; } fields[] = { - { "engine", NULL }, - { NULL, NULL } + { "engine", NULL, 0 }, + { NULL, NULL, 0 } }; - int i; const char *ptr; - const char *key; size_t klen; - const char *value; - size_t vlen; - static const char * const delims = " \r\n\t;|,"; - const char *engine; + char **elts = NULL; + char *elt; + int i = 0, j; + apr_status_t status; + + if (APR_SUCCESS != (status = apr_tokenize_to_argv(params, &elts, pool))) { + return status; + } + while ((elt = elts[i])) { + ptr = strchr(elt, '='); + if (ptr) { + for (klen = ptr - elt; klen && apr_isspace(elt[klen - 1]); --klen); + ptr++; + } + else { + for (klen = strlen(elt); klen && apr_isspace(elt[klen - 1]); --klen); + } + elt[klen] = 0; + + for (j = 0; fields[j].field != NULL; ++j) { + if (!strcasecmp(fields[j].field, elt)) { + fields[j].set = 1; + if (ptr) { + fields[j].value = ptr; + } + break; + } + } + + i++; + } + engine = fields[0].value; if (!f) { return APR_ENOMEM; @@ -247,38 +276,6 @@ static apr_status_t crypto_make(apr_crypto_t **ff, apr_pool_cleanup_register(pool, f, crypto_cleanup_helper, apr_pool_cleanup_null); - /* snitch parsing from the MySQL driver */ - for (ptr = strchr(params, '='); ptr; ptr = strchr(ptr, '=')) { - /* don't dereference memory that may not belong to us */ - if (ptr == params) { - ++ptr; - continue; - } - for (key = ptr - 1; apr_isspace(*key); --key); - klen = 0; - while (apr_isalpha(*key)) { - if (key == params) { - /* Don't parse off the front of the params */ - --key; - ++klen; - break; - } - --key; - ++klen; - } - ++key; - for (value = ptr + 1; apr_isspace(*value); ++value); - vlen = strcspn(value, delims); - for (i = 0; fields[i].field != NULL; ++i) { - if (!strncasecmp(fields[i].field, key, klen)) { - fields[i].value = apr_pstrndup(pool, value, vlen); - break; - } - } - ptr = value + vlen; - } - engine = fields[0].value; - if (engine) { config->engine = ENGINE_by_id(engine); if (!config->engine) { From e0f8893c316ef520373a4dd88ce98fb4b6261846 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 23 Oct 2011 22:28:05 +0000 Subject: [PATCH 7070/7878] apr_crypto: Docs fix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1187994 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_crypto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_crypto.h b/include/apr_crypto.h index eba0ef618e3..98ddbd7f705 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -145,7 +145,8 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool); * @return APR_ESYMNOTFOUND if the driver file doesn't contain a driver * @remarks NSS: the params can have "dir", "key3", "cert7" and "secmod" * keys, each followed by an equal sign and a value. Such key/value pairs can - * be delimited by space, CR, LF, tab, semicolon, vertical bar or comma. + * be delimited by space or tab. If the value contains a space, surround the + * whole key value pair in quotes: "dir=My Directory". * @remarks OpenSSL: currently no params are supported. */ APR_DECLARE(apr_status_t) apr_crypto_get_driver( From 235a77b8903b4898594af296813e6e64497bcef4 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 25 Oct 2011 21:19:03 +0000 Subject: [PATCH 7071/7878] apr_crypto: Support NULL values for the params field. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1188920 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_nss.c | 56 ++++++++++++++++++++----------------- crypto/apr_crypto_openssl.c | 50 ++++++++++++++++++--------------- 2 files changed, 57 insertions(+), 49 deletions(-) diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 56c0ceb82fa..4a4b2fca656 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -150,37 +150,41 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc) int i = 0, j; apr_status_t status; - if (APR_SUCCESS != (status = apr_tokenize_to_argv(params, &elts, pool))) { - return status; - } - while ((elt = elts[i])) { - ptr = strchr(elt, '='); - if (ptr) { - for (klen = ptr - elt; klen && apr_isspace(elt[klen - 1]); --klen); - ptr++; + if (params) { + if (APR_SUCCESS != (status = apr_tokenize_to_argv(params, &elts, pool))) { + return status; } - else { - for (klen = strlen(elt); klen && apr_isspace(elt[klen - 1]); --klen); - } - elt[klen] = 0; - - for (j = 0; fields[j].field != NULL; ++j) { - if (klen && !strcasecmp(fields[j].field, elt)) { - fields[j].set = 1; - if (ptr) { - fields[j].value = ptr; + while ((elt = elts[i])) { + ptr = strchr(elt, '='); + if (ptr) { + for (klen = ptr - elt; klen && apr_isspace(elt[klen - 1]); --klen) + ; + ptr++; + } + else { + for (klen = strlen(elt); klen && apr_isspace(elt[klen - 1]); --klen) + ; + } + elt[klen] = 0; + + for (j = 0; fields[j].field != NULL; ++j) { + if (klen && !strcasecmp(fields[j].field, elt)) { + fields[j].set = 1; + if (ptr) { + fields[j].value = ptr; + } + break; } - break; } - } - i++; + i++; + } + dir = fields[0].value; + keyPrefix = fields[1].value; + certPrefix = fields[2].value; + secmod = fields[3].value; + noinit = fields[4].set; } - dir = fields[0].value; - keyPrefix = fields[1].value; - certPrefix = fields[2].value; - secmod = fields[3].value; - noinit = fields[4].set; /* if we've been asked to bypass, do so here */ if (noinit) { diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 2c2178bb453..4708ecd360b 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -191,7 +191,7 @@ static apr_status_t crypto_make(apr_crypto_t **ff, apr_crypto_config_t *config = NULL; apr_crypto_t *f = apr_pcalloc(pool, sizeof(apr_crypto_t)); - const char *engine; + const char *engine = NULL; struct { const char *field; @@ -208,33 +208,37 @@ static apr_status_t crypto_make(apr_crypto_t **ff, int i = 0, j; apr_status_t status; - if (APR_SUCCESS != (status = apr_tokenize_to_argv(params, &elts, pool))) { - return status; - } - while ((elt = elts[i])) { - ptr = strchr(elt, '='); - if (ptr) { - for (klen = ptr - elt; klen && apr_isspace(elt[klen - 1]); --klen); - ptr++; - } - else { - for (klen = strlen(elt); klen && apr_isspace(elt[klen - 1]); --klen); + if (params) { + if (APR_SUCCESS != (status = apr_tokenize_to_argv(params, &elts, pool))) { + return status; } - elt[klen] = 0; - - for (j = 0; fields[j].field != NULL; ++j) { - if (!strcasecmp(fields[j].field, elt)) { - fields[j].set = 1; - if (ptr) { - fields[j].value = ptr; + while ((elt = elts[i])) { + ptr = strchr(elt, '='); + if (ptr) { + for (klen = ptr - elt; klen && apr_isspace(elt[klen - 1]); --klen) + ; + ptr++; + } + else { + for (klen = strlen(elt); klen && apr_isspace(elt[klen - 1]); --klen) + ; + } + elt[klen] = 0; + + for (j = 0; fields[j].field != NULL; ++j) { + if (!strcasecmp(fields[j].field, elt)) { + fields[j].set = 1; + if (ptr) { + fields[j].value = ptr; + } + break; } - break; } - } - i++; + i++; + } + engine = fields[0].value; } - engine = fields[0].value; if (!f) { return APR_ENOMEM; From 960a962d8108d159509f1519d1884aa141ca0d38 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 4 Nov 2011 02:52:16 +0000 Subject: [PATCH 7072/7878] fix typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1197393 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_general.h b/include/apr_general.h index b47ff3eccb5..510ef4590cb 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -182,7 +182,7 @@ struct type { \ /** * Setup any APR internal data structures. This MUST be the first function - * called for any APR library. It is save to call apr_initialize several + * called for any APR library. It is safe to call apr_initialize several * times as long as apr_terminate is called the same number of times. * @remark See apr_app_initialize if this is an application, rather than * a library consumer of apr. From fae4f2190c95b66c1130c405e4e798a5c5c7d3b3 Mon Sep 17 00:00:00 2001 From: Sander Temme Date: Mon, 7 Nov 2011 18:29:46 +0000 Subject: [PATCH 7073/7878] Clarify what happens to the proc structure used by apr_fork(). Set the proc->pid field to the pid of the newly created child. Note that a mere pid value provides little entropy to mix into the child random pool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1198860 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/apr_random.c | 5 +++++ threadproc/unix/proc.c | 10 +++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c index c6d671c6bd2..852cfd6e35f 100644 --- a/random/unix/apr_random.c +++ b/random/unix/apr_random.c @@ -159,6 +159,11 @@ APR_DECLARE(void) apr_random_after_fork(apr_proc_t *proc) apr_random_t *r; for (r = all_random; r; r = r->next) + /* + * XXX Note: the pid does not provide sufficient entropy to + * actually call this secure. See Ben's paper referenced at + * the top of this file. + */ mixer(r,proc->pid); } diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 8ded39177c7..004772ff88e 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -219,15 +219,14 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) { int pid; + + memset(proc, 0, sizeof(apr_proc_t)); if ((pid = fork()) < 0) { return errno; } else if (pid == 0) { - proc->pid = pid; - proc->in = NULL; - proc->out = NULL; - proc->err = NULL; + proc->pid = getpid(); apr_random_after_fork(proc); @@ -235,9 +234,6 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) } proc->pid = pid; - proc->in = NULL; - proc->out = NULL; - proc->err = NULL; return APR_INPARENT; } From efedcad302f4aa8d9f2f0f2ff9df12064879113c Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 7 Nov 2011 20:42:08 +0000 Subject: [PATCH 7074/7878] Clean up references to rng struct when pool is destroyed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1198921 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/apr_random.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/random/unix/apr_random.c b/random/unix/apr_random.c index 852cfd6e35f..b042b66bdf5 100644 --- a/random/unix/apr_random.c +++ b/random/unix/apr_random.c @@ -86,6 +86,23 @@ struct apr_random_t { static apr_random_t *all_random; +static apr_status_t random_cleanup(void *data) +{ + apr_random_t *remove_this = data, + *cur = all_random, + **prev_ptr = &all_random; + while (cur) { + if (cur == remove_this) { + *prev_ptr = cur->next; + break; + } + prev_ptr = &cur->next; + cur = cur->next; + } + return APR_SUCCESS; +} + + APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p, apr_crypto_hash_t *pool_hash, apr_crypto_hash_t *key_hash, @@ -128,6 +145,7 @@ APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p, g->next = all_random; all_random = g; + apr_pool_cleanup_register(p, g, random_cleanup, apr_pool_cleanup_null); } static void mix_pid(apr_random_t *g,unsigned char *H,pid_t pid) From 36b9c91e4f8025f04b02e6f237828d04747ee1bb Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Mon, 7 Nov 2011 20:48:37 +0000 Subject: [PATCH 7075/7878] Fix test case for child randomness. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1198923 13f79535-47bb-0310-9956-ffa450edef68 --- test/testrand.c | 138 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 97 insertions(+), 41 deletions(-) diff --git a/test/testrand.c b/test/testrand.c index 333491f3e90..46c55d29f79 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -15,16 +15,20 @@ */ #include "apr_general.h" +#include "apr_pools.h" #include "apr_random.h" #include "apr_thread_proc.h" #include #include #include "testutil.h" -static void hexdump(const unsigned char *b, int n) +#define RANDOM_BUF_SZ 128 + +static void hexdump(const char *msg, const unsigned char *b, int n) { int i; + printf("\n%s", msg); for (i = 0; i < n; ++i) { #if 0 if ((i & 0xf) == 0) @@ -47,35 +51,48 @@ typedef apr_status_t APR_THREAD_FUNC rnd_fn(apr_random_t * r, void *b, apr_size_t n); static void rand_run_kat(abts_case *tc, rnd_fn *f, apr_random_t *r, - const unsigned char expected[128]) + const unsigned char expected[RANDOM_BUF_SZ]) { - unsigned char c[128]; + unsigned char c[RANDOM_BUF_SZ]; apr_status_t rv; - rv = f(r, c, 128); + rv = f(r, c, RANDOM_BUF_SZ); ABTS_INT_EQUAL(tc, 0, rv); if (rv) return; - if (memcmp(c, expected, 128)) { - hexdump(c, 128); - hexdump(expected, 128); + if (memcmp(c, expected, RANDOM_BUF_SZ)) { + hexdump("Generated: ", c, RANDOM_BUF_SZ); + hexdump("Expected: ", expected, RANDOM_BUF_SZ); ABTS_FAIL(tc, "Randomness mismatch"); } } #if APR_HAS_FORK static int rand_check_kat(rnd_fn *f, apr_random_t *r, - const unsigned char expected[128]) + const unsigned char expected[RANDOM_BUF_SZ], + apr_file_t *readp, apr_file_t *writep) { - unsigned char c[128]; + apr_size_t nbytes = RANDOM_BUF_SZ; + apr_size_t cmd_size = 1; + unsigned char c[RANDOM_BUF_SZ]; + char ack; apr_status_t rv; - rv = f(r, c, 128); + rv = f(r, c, RANDOM_BUF_SZ); if (rv) return 2; - if (memcmp(c, expected, 128)) - return 1; - return 0; + rv = 0; + if (memcmp(c, expected, RANDOM_BUF_SZ)) { + rv = 1; + } else { + hexdump("Generated: ", c, RANDOM_BUF_SZ); + hexdump("Previous: ", expected, RANDOM_BUF_SZ); + } + /* Report back our random values for comparison in another child */ + apr_file_write(writep, c, &nbytes); + /* Wait for our parent ack the data */ + apr_file_read(readp, &ack, &cmd_size); + return rv; } #endif @@ -107,7 +124,7 @@ static void rand_seed_short(abts_case *tc, void *data) static void rand_kat(abts_case *tc, void *data) { - unsigned char expected[128] = { + unsigned char expected[RANDOM_BUF_SZ] = { 0x82, 0x04, 0xad, 0xd2, 0x0b, 0xd5, 0xac, 0xda, 0x3d, 0x85, 0x58, 0x38, 0x54, 0x6b, 0x69, 0x45, 0x37, 0x4c, 0xc7, 0xd7, 0x87, 0xeb, 0xbf, 0xd9, @@ -137,7 +154,7 @@ static void rand_seed_short2(abts_case *tc, void *data) static void rand_kat2(abts_case *tc, void *data) { - unsigned char expected[128] = { + unsigned char expected[RANDOM_BUF_SZ] = { 0x38, 0x8f, 0x01, 0x29, 0x5a, 0x5c, 0x1f, 0xa8, 0x00, 0xde, 0x16, 0x4c, 0xe5, 0xf7, 0x1f, 0x58, 0xc0, 0x67, 0xe2, 0x98, 0x3d, 0xde, 0x4a, 0x75, @@ -168,7 +185,7 @@ static void rand_barrier(abts_case *tc, void *data) static void rand_kat3(abts_case *tc, void *data) { - unsigned char expected[128] = { + unsigned char expected[RANDOM_BUF_SZ] = { 0xe8, 0xe7, 0xc9, 0x45, 0xe2, 0x2a, 0x54, 0xb2, 0xdd, 0xe0, 0xf9, 0xbc, 0x3d, 0xf9, 0xce, 0x3c, 0x4c, 0xbd, 0xc9, 0xe2, 0x20, 0x4a, 0x35, 0x1c, @@ -192,7 +209,7 @@ static void rand_kat3(abts_case *tc, void *data) static void rand_kat4(abts_case *tc, void *data) { - unsigned char expected[128] = { + unsigned char expected[RANDOM_BUF_SZ] = { 0x7d, 0x0e, 0xc4, 0x4e, 0x3e, 0xac, 0x86, 0x50, 0x37, 0x95, 0x7a, 0x98, 0x23, 0x26, 0xa7, 0xbf, 0x60, 0xfb, 0xa3, 0x70, 0x90, 0xc3, 0x58, 0xc6, @@ -220,7 +237,10 @@ static void rand_fork(abts_case *tc, void *data) { apr_proc_t proc; apr_status_t rv; - unsigned char expected[128] = { + apr_size_t nbytes = RANDOM_BUF_SZ; + apr_size_t cmd_size = 1; + char cmd = 'X'; + unsigned char expected[RANDOM_BUF_SZ] = { 0xac, 0x93, 0xd2, 0x5c, 0xc7, 0xf5, 0x8d, 0xc2, 0xd8, 0x8d, 0xb6, 0x7a, 0x94, 0xe1, 0x83, 0x4c, 0x26, 0xe2, 0x38, 0x6d, 0xf5, 0xbd, 0x9d, 0x6e, @@ -239,32 +259,68 @@ static void rand_fork(abts_case *tc, void *data) 0xc1, 0x7f, 0x10, 0x2e, 0x08, 0x1c, 0x28, 0x4b, }; - rv = apr_proc_fork(&proc, p); - if (rv == APR_INCHILD) { - int n = rand_check_kat(apr_random_secure_bytes, r, expected); - exit(n); - } - else if (rv == APR_INPARENT) { - int exitcode; - apr_exit_why_e why; - - rand_run_kat(tc, apr_random_secure_bytes, r, expected); - apr_proc_wait(&proc, &exitcode, &why, APR_WAIT); - if (why != APR_PROC_EXIT) { - ABTS_FAIL(tc, "Child terminated abnormally"); - } - else if (exitcode == 0) { - ABTS_FAIL(tc, "Child produced our randomness"); - } - else if (exitcode == 2) { - ABTS_FAIL(tc, "Child randomness failed"); + apr_file_t *readdatap = NULL; + apr_file_t *writedatap = NULL; + apr_file_t *readcmdp = NULL; + apr_file_t *writecmdp = NULL; + apr_pool_t *p; + int i; + + apr_pool_create(&p, NULL); + /* Set up data pipe for children */ + rv = apr_file_pipe_create(&readdatap, &writedatap, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, readdatap); + ABTS_PTR_NOTNULL(tc, writedatap); + /* Set up cmd pipe for children */ + rv = apr_file_pipe_create(&readcmdp, &writecmdp, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, readcmdp); + ABTS_PTR_NOTNULL(tc, writecmdp); + + rand_run_kat(tc, apr_random_secure_bytes, r, expected); + + for (i = 0; i< 10; i++) + { + rv = apr_proc_fork(&proc, p); + if (rv == APR_INCHILD) { + int n = rand_check_kat(apr_random_secure_bytes, r, expected, readcmdp, writedatap); + exit(n); } - else if (exitcode != 1) { - ABTS_FAIL(tc, "Uknown child error"); + else if (rv == APR_INPARENT) { + int exitcode; + apr_exit_why_e why; + + /* Read the random data generated by child */ + rv = apr_file_read(readdatap, expected, &nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + /* Tell child to finish */ + rv = apr_file_write(writecmdp, &cmd, &cmd_size); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + apr_proc_wait(&proc, &exitcode, &why, APR_WAIT); + if (why != APR_PROC_EXIT) { + ABTS_FAIL(tc, "Child terminated abnormally"); + } + else if (exitcode == 0) { + if (i == 0) + { + ABTS_FAIL(tc, "Child produced our randomness"); + } else + { + ABTS_FAIL(tc, "Child produced randomness of previous child"); + } + } + else if (exitcode == 2) { + ABTS_FAIL(tc, "Child randomness failed"); + } + else if (exitcode != 1) { + ABTS_FAIL(tc, "Unknown child error"); + } + } else { + ABTS_FAIL(tc, "Fork failed"); } - } else { - ABTS_FAIL(tc, "Fork failed"); } + } #endif From 163b41abebf85cbdb015b525eb11aaaac0212340 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Tue, 8 Nov 2011 02:44:21 +0000 Subject: [PATCH 7076/7878] BZ 50334: Change back fix for APR_RESTORE_THE_ENVIRONMENT to sed use, because ${A#B} is not available in all shells, especially not in /bin/sh on Solaris. The original problem of only whitespace in the saved variable is fixed by a better test condition. The additional possible problem of sed or regexp meta characters in the variable value is still open but yet has to be observed in the wild. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1199072 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index d0f0601d4e5..6b5c0f033b9 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -202,14 +202,18 @@ dnl and restoring the original variable contents. This makes it possible dnl for a user to override configure when it does something stupid. dnl AC_DEFUN([APR_RESTORE_THE_ENVIRONMENT], [ -if test "x$apr_ste_save_$1" = "x"; then +dnl Check whether $apr_ste_save_$1 is empty or +dnl only whitespace. The verbatim "X" is token number 1, +dnl the following whitespace will be ignored. +set X $apr_ste_save_$1 +if test ${#} -eq 1; then $2$1="$$1" $1= else if test "x$apr_ste_save_$1" = "x$$1"; then $2$1= else - $2$1="${$1#"${apr_ste_save_$1}"}" + $2$1=`echo "$$1" | sed -e "s%${apr_ste_save_$1}%%"` $1="$apr_ste_save_$1" fi fi From 02185b36a5d34cb6f5549c0f7ab11a1654371f9b Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 19 Nov 2011 16:15:02 +0000 Subject: [PATCH 7077/7878] Fix cut'n'paste error git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1204008 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 18420c1411f..f6eeb87256a 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -350,7 +350,7 @@ APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, * apr_dir_make being called on existing dir, therefore this check * has to come last. */ - if (APR_STATUS_IS_EEXIST(apr_err)) + if (APR_STATUS_IS_EEXIST(rv)) return APR_SUCCESS; return rv; From d1a80cc00e05d74f41e7dd5a29e7bff5669e0ebd Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 28 Nov 2011 22:56:35 +0000 Subject: [PATCH 7078/7878] RPM: Ensure we depend correctly on libuuid-devel at build time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1207679 13f79535-47bb-0310-9956-ffa450edef68 --- build/rpm/apr.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/rpm/apr.spec.in b/build/rpm/apr.spec.in index 1303222ffb6..aa9a9bca2ea 100644 --- a/build/rpm/apr.spec.in +++ b/build/rpm/apr.spec.in @@ -10,7 +10,7 @@ Group: System Environment/Libraries URL: http://apr.apache.org/ Source0: http://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot -BuildRequires: autoconf, libtool, doxygen, python +BuildRequires: autoconf, libtool, doxygen, python, libuuid %description The mission of the Apache Portable Runtime (APR) is to provide a From acfc1f67eba6fec39b158601e8e14bb4fdd9e1ff Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 28 Nov 2011 22:58:09 +0000 Subject: [PATCH 7079/7878] Remove variables that we assign but never read. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1207680 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_nss.c | 1 - dbd/apr_dbd_sqlite3.c | 2 -- dbm/apr_dbm_sdbm.c | 3 +-- test/testreslist.c | 3 --- util-misc/apr_thread_pool.c | 5 ++--- 5 files changed, 3 insertions(+), 11 deletions(-) diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 4a4b2fca656..bb5c3756ded 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -114,7 +114,6 @@ static apr_status_t crypto_shutdown(void) static apr_status_t crypto_shutdown_helper(void *data) { - apr_pool_t *pool = (apr_pool_t *) data; return crypto_shutdown(); } diff --git a/dbd/apr_dbd_sqlite3.c b/dbd/apr_dbd_sqlite3.c index 2dd51d217a6..33f3034f787 100644 --- a/dbd/apr_dbd_sqlite3.c +++ b/dbd/apr_dbd_sqlite3.c @@ -118,7 +118,6 @@ static int dbd_sqlite3_select_internal(apr_pool_t *pool, } } else if (ret == SQLITE_ROW) { int length; - apr_dbd_column_t *col; row = apr_palloc(pool, sizeof(apr_dbd_row_t)); row->res = *results; increment = sizeof(apr_dbd_column_t *); @@ -157,7 +156,6 @@ static int dbd_sqlite3_select_internal(apr_pool_t *pool, case SQLITE_NULL: break; } - col = row->columns[i]; } row->rownum = num_tuples++; row->next_row = 0; diff --git a/dbm/apr_dbm_sdbm.c b/dbm/apr_dbm_sdbm.c index a3735e04efe..009192a4cc1 100644 --- a/dbm/apr_dbm_sdbm.c +++ b/dbm/apr_dbm_sdbm.c @@ -184,10 +184,9 @@ static apr_status_t vt_sdbm_firstkey(apr_dbm_t *dbm, apr_datum_t *pkey) static apr_status_t vt_sdbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey) { - apr_status_t rv; apr_sdbm_datum_t rd; - rv = apr_sdbm_nextkey(dbm->file, &rd); + apr_sdbm_nextkey(dbm->file, &rd); pkey->dptr = rd.dptr; pkey->dsize = rd.dsize; diff --git a/test/testreslist.c b/test/testreslist.c index aa2481529cc..36333a1533e 100644 --- a/test/testreslist.c +++ b/test/testreslist.c @@ -142,7 +142,6 @@ static void test_timeout(abts_case *tc, apr_reslist_t *rl) { apr_status_t rv; my_resource_t *resources[RESLIST_HMAX]; - my_resource_t *res; void *vp; int i; @@ -163,8 +162,6 @@ static void test_timeout(abts_case *tc, apr_reslist_t *rl) rv = apr_reslist_acquire(rl, &vp); ABTS_TRUE(tc, APR_STATUS_IS_TIMEUP(rv)); - res = vp; - /* release the resources; otherwise the destroy operation * will blow */ diff --git a/util-misc/apr_thread_pool.c b/util-misc/apr_thread_pool.c index 006370bae42..e8a245b26dc 100644 --- a/util-misc/apr_thread_pool.c +++ b/util-misc/apr_thread_pool.c @@ -237,7 +237,6 @@ static struct apr_thread_list_elt *elt_new(apr_thread_pool_t * me, */ static void *APR_THREAD_FUNC thread_pool_func(apr_thread_t * t, void *param) { - apr_status_t rv = APR_SUCCESS; apr_thread_pool_t *me = param; apr_thread_pool_task_t *task = NULL; apr_interval_time_t wait; @@ -313,10 +312,10 @@ static void *APR_THREAD_FUNC thread_pool_func(apr_thread_t * t, void *param) wait = -1; if (wait >= 0) { - rv = apr_thread_cond_timedwait(me->cond, me->lock, wait); + apr_thread_cond_timedwait(me->cond, me->lock, wait); } else { - rv = apr_thread_cond_wait(me->cond, me->lock); + apr_thread_cond_wait(me->cond, me->lock); } } From d7589517e8fef19790fff515174c2eb196464017 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 28 Nov 2011 23:51:24 +0000 Subject: [PATCH 7080/7878] Suppress a potential warning about an ignored return value. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1207704 13f79535-47bb-0310-9956-ffa450edef68 --- dbm/apr_dbm_sdbm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbm/apr_dbm_sdbm.c b/dbm/apr_dbm_sdbm.c index 009192a4cc1..ac3192e632c 100644 --- a/dbm/apr_dbm_sdbm.c +++ b/dbm/apr_dbm_sdbm.c @@ -186,7 +186,7 @@ static apr_status_t vt_sdbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey) { apr_sdbm_datum_t rd; - apr_sdbm_nextkey(dbm->file, &rd); + (void)apr_sdbm_nextkey(dbm->file, &rd); pkey->dptr = rd.dptr; pkey->dsize = rd.dsize; From 76e618d79521ec2dc2b98ecda0b8d84fe268ab04 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Fri, 2 Dec 2011 14:07:53 +0000 Subject: [PATCH 7081/7878] Update the crypto notices for apr_crypto. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1209490 13f79535-47bb-0310-9956-ffa450edef68 --- README | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README b/README index 4222d61580e..016c8f16951 100644 --- a/README +++ b/README @@ -227,6 +227,9 @@ code and source code. The following provides more details on the included cryptographic software: - APR provides an abstract interface for SSL cryptographic functions, - specifically @bug XXX Fill This In XXX! + APR provides an abstract interface for symmetrical cryptographic + functions that make use of a general-purpose encryption library, + such as OpenSSL, NSS, or the operating system's platform-specific + facilities. This interface is known as the apr_crypto interface, + with implementation beneath the /crypto directory. From afeb2c5113af0fb7c4d416866182c841eef96525 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 5 Dec 2011 16:51:07 +0000 Subject: [PATCH 7082/7878] apr_crypto: Clear out buffers that are allocated by us when the pool from which the memory was allocated from is cleaned up. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1210524 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 30 ++++++++++++++++++++++++++++++ crypto/apr_crypto_nss.c | 3 +++ crypto/apr_crypto_openssl.c | 4 ++++ include/apr_crypto.h | 11 +++++++++++ 4 files changed, 48 insertions(+) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 4b28dd2e264..4484cae3b23 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -56,6 +56,11 @@ APR_TYPEDEF_STRUCT(apr_crypto_block_t, const apr_crypto_t *f; ) +typedef struct apr_crypto_clear_t { + void *buffer; + apr_size_t size; +} apr_crypto_clear_t; + #if !APR_HAVE_MODULAR_DSO #define DRIVER_LOAD(name,driver,pool,params) \ { \ @@ -118,6 +123,31 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) return ret; } +static apr_status_t crypto_clear(void *ptr) +{ + apr_crypto_clear_t *clear = (apr_crypto_clear_t *)ptr; + + memset(clear->buffer, 0, clear->size); + clear->buffer = NULL; + clear->size = 0; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_crypto_clear(apr_pool_t *pool, + void *buffer, apr_size_t size) +{ + apr_crypto_clear_t *clear = apr_palloc(pool, sizeof(apr_crypto_clear_t)); + + clear->buffer = buffer; + clear->size = size; + + apr_pool_cleanup_register(pool, clear, crypto_clear, + apr_pool_cleanup_null); + + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_crypto_get_driver( const apr_crypto_driver_t **driver, const char *name, const char *params, const apu_err_t **result, apr_pool_t *pool) diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index bb5c3756ded..e52fe99bd2c 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -551,6 +551,7 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, if (!usedIv) { return APR_ENOMEM; } + apr_crypto_clear(p, usedIv, key->ivSize); s = PK11_GenerateRandom(usedIv, key->ivSize); if (s != SECSuccess) { return APR_ENOIV; @@ -622,6 +623,7 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, if (!buffer) { return APR_ENOMEM; } + apr_crypto_clear(block->pool, buffer, inlen + block->blockSize); *out = buffer; } @@ -785,6 +787,7 @@ static apr_status_t crypto_block_decrypt(unsigned char **out, if (!buffer) { return APR_ENOMEM; } + apr_crypto_clear(block->pool, buffer, inlen + block->blockSize); *out = buffer; } diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 4708ecd360b..993fa9f503f 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -431,6 +431,7 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, if (!key->key) { return APR_ENOMEM; } + apr_crypto_clear(p, key->key, key->keyLen); /* generate the key */ if (PKCS5_PBKDF2_HMAC_SHA1(pass, passLen, (unsigned char *) salt, saltLen, @@ -504,6 +505,7 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, if (!usedIv) { return APR_ENOMEM; } + apr_crypto_clear(p, usedIv, key->ivSize); if (!((RAND_status() == 1) && (RAND_bytes(usedIv, key->ivSize) == 1))) { return APR_ENOIV; @@ -575,6 +577,7 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, if (!buffer) { return APR_ENOMEM; } + apr_crypto_clear(ctx->pool, buffer, inlen + EVP_MAX_BLOCK_LENGTH); *out = buffer; } @@ -729,6 +732,7 @@ static apr_status_t crypto_block_decrypt(unsigned char **out, if (!buffer) { return APR_ENOMEM; } + apr_crypto_clear(ctx->pool, buffer, inlen + EVP_MAX_BLOCK_LENGTH); *out = buffer; } diff --git a/include/apr_crypto.h b/include/apr_crypto.h index 98ddbd7f705..9b04d4fb4c2 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -131,6 +131,17 @@ typedef struct apr_crypto_block_t apr_crypto_block_t; */ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool); +/** + * @brief Register a cleanup to zero out the buffer provided + * when the pool is cleaned up. + * + * @param pool - pool to register the cleanup + * @param buffer - buffer to zero out + * @param size - size of the buffer to zero out + */ +APR_DECLARE(apr_status_t) apr_crypto_clear(apr_pool_t *pool, void *buffer, + apr_size_t size); + /** * @brief Get the driver struct for a name * From aa37a7f7c6f5dd453d167d80fc402739e6a2f8e8 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 8 Dec 2011 15:09:20 +0000 Subject: [PATCH 7083/7878] * include/: Fix doxygen group for headers from apr-util. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1211928 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_base64.h | 2 +- include/apr_buckets.h | 2 +- include/apr_crypto.h | 2 +- include/apr_date.h | 2 +- include/apr_dbd.h | 2 +- include/apr_dbm.h | 2 +- include/apr_hooks.h | 2 +- include/apr_md4.h | 2 +- include/apr_memcache.h | 2 +- include/apr_optional.h | 2 +- include/apr_queue.h | 2 +- include/apr_reslist.h | 2 +- include/apr_rmm.h | 2 +- include/apr_strmatch.h | 2 +- include/apr_thread_pool.h | 2 +- include/apr_uri.h | 2 +- include/apr_xml.h | 2 +- include/apu_errno.h | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/apr_base64.h b/include/apr_base64.h index b3c4fec1d35..526b8ab3e5c 100644 --- a/include/apr_base64.h +++ b/include/apr_base64.h @@ -33,7 +33,7 @@ extern "C" { /** * @defgroup APR_Util_Base64 Base64 Encoding - * @ingroup APR_Util + * @ingroup APR * @{ */ diff --git a/include/apr_buckets.h b/include/apr_buckets.h index c367755f2f7..14192de1176 100644 --- a/include/apr_buckets.h +++ b/include/apr_buckets.h @@ -46,7 +46,7 @@ extern "C" { /** * @defgroup APR_Util_Bucket_Brigades Bucket Brigades - * @ingroup APR_Util + * @ingroup APR * @{ */ diff --git a/include/apr_crypto.h b/include/apr_crypto.h index 9b04d4fb4c2..de3dd2a9519 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -33,7 +33,7 @@ extern "C" { */ /** * @defgroup APR_Util_Crypto Crypto routines - * @ingroup APR_Util + * @ingroup APR * @{ */ diff --git a/include/apr_date.h b/include/apr_date.h index c9ac1992546..52a6d79da25 100644 --- a/include/apr_date.h +++ b/include/apr_date.h @@ -24,7 +24,7 @@ /** * @defgroup APR_Util_Date Date routines - * @ingroup APR_Util + * @ingroup APR * @{ */ diff --git a/include/apr_dbd.h b/include/apr_dbd.h index 5eb6e1c3419..0fe0688badb 100644 --- a/include/apr_dbd.h +++ b/include/apr_dbd.h @@ -34,7 +34,7 @@ extern "C" { */ /** * @defgroup APR_Util_DBD DBD routines - * @ingroup APR_Util + * @ingroup APR * @{ */ diff --git a/include/apr_dbm.h b/include/apr_dbm.h index 47beef10811..017b9edea54 100644 --- a/include/apr_dbm.h +++ b/include/apr_dbm.h @@ -33,7 +33,7 @@ extern "C" { */ /** * @defgroup APR_Util_DBM DBM routines - * @ingroup APR_Util + * @ingroup APR * @{ */ /** diff --git a/include/apr_hooks.h b/include/apr_hooks.h index ff8e4b1b1ff..8330b8aa870 100644 --- a/include/apr_hooks.h +++ b/include/apr_hooks.h @@ -31,7 +31,7 @@ extern "C" { #endif /** * @defgroup APR_Util_Hook Hook Functions - * @ingroup APR_Util + * @ingroup APR * @{ */ diff --git a/include/apr_md4.h b/include/apr_md4.h index f6bcfc2c4a2..e1336d6686b 100644 --- a/include/apr_md4.h +++ b/include/apr_md4.h @@ -53,7 +53,7 @@ extern "C" { /** * @defgroup APR_Util_MD4 MD4 Library - * @ingroup APR_Util + * @ingroup APR * @{ */ diff --git a/include/apr_memcache.h b/include/apr_memcache.h index c930b27b726..ac11370c367 100644 --- a/include/apr_memcache.h +++ b/include/apr_memcache.h @@ -41,7 +41,7 @@ extern "C" { /** * @defgroup APR_Util_MC Memcached Client Routines - * @ingroup APR_Util + * @ingroup APR * @{ */ diff --git a/include/apr_optional.h b/include/apr_optional.h index 4f2a40f862e..e628fa0d35c 100644 --- a/include/apr_optional.h +++ b/include/apr_optional.h @@ -28,7 +28,7 @@ extern "C" { /** * @defgroup APR_Util_Opt Optional Functions - * @ingroup APR_Util + * @ingroup APR * * Typesafe registration and retrieval of functions that may not be present * (i.e. functions exported by optional modules) diff --git a/include/apr_queue.h b/include/apr_queue.h index 58a2e71feac..f672bf2434b 100644 --- a/include/apr_queue.h +++ b/include/apr_queue.h @@ -37,7 +37,7 @@ extern "C" { /** * @defgroup APR_Util_FIFO Thread Safe FIFO bounded queue - * @ingroup APR_Util + * @ingroup APR * @{ */ diff --git a/include/apr_reslist.h b/include/apr_reslist.h index 4c90df89070..ee94f07e980 100644 --- a/include/apr_reslist.h +++ b/include/apr_reslist.h @@ -30,7 +30,7 @@ /** * @defgroup APR_Util_RL Resource List Routines - * @ingroup APR_Util + * @ingroup APR * @{ */ diff --git a/include/apr_rmm.h b/include/apr_rmm.h index 25a368bd10b..cdb7e39d73f 100644 --- a/include/apr_rmm.h +++ b/include/apr_rmm.h @@ -22,7 +22,7 @@ */ /** * @defgroup APR_Util_RMM Relocatable Memory Management Routines - * @ingroup APR_Util + * @ingroup APR * @{ */ diff --git a/include/apr_strmatch.h b/include/apr_strmatch.h index 3b23a9d6467..713970c9081 100644 --- a/include/apr_strmatch.h +++ b/include/apr_strmatch.h @@ -30,7 +30,7 @@ extern "C" { /** * @defgroup APR_Util_StrMatch String matching routines - * @ingroup APR_Util + * @ingroup APR * @{ */ diff --git a/include/apr_thread_pool.h b/include/apr_thread_pool.h index 8fbb19d0ec0..639c3a60872 100644 --- a/include/apr_thread_pool.h +++ b/include/apr_thread_pool.h @@ -50,7 +50,7 @@ extern "C" { /** * @defgroup APR_Util_TP Thread Pool routines - * @ingroup APR_Util + * @ingroup APR * @{ */ diff --git a/include/apr_uri.h b/include/apr_uri.h index 63b3e207fcd..25ad8f281af 100644 --- a/include/apr_uri.h +++ b/include/apr_uri.h @@ -36,7 +36,7 @@ extern "C" { /** * @defgroup APR_Util_URI URI - * @ingroup APR_Util + * @ingroup APR * @{ */ diff --git a/include/apr_xml.h b/include/apr_xml.h index 9198cc4b46f..ffd6716288a 100644 --- a/include/apr_xml.h +++ b/include/apr_xml.h @@ -22,7 +22,7 @@ /** * @defgroup APR_Util_XML XML - * @ingroup APR_Util + * @ingroup APR * @{ */ #include "apr_pools.h" diff --git a/include/apu_errno.h b/include/apu_errno.h index c0a8ec7d41d..58585b71483 100644 --- a/include/apu_errno.h +++ b/include/apu_errno.h @@ -31,7 +31,7 @@ extern "C" { /** * @defgroup apu_errno Error Codes - * @ingroup APR_Util + * @ingroup APR * @{ */ From 045702778bb83f08737bf7ee1c8923df83eced44 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Thu, 8 Dec 2011 17:11:05 +0000 Subject: [PATCH 7084/7878] apr_crypto: Move the static initialisation of DRIVER_LOAD from apr_crypto_init() to apr_crypto_get_driver(), so that we don't lose the parameters. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1211987 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 59 ++++++++++++++++----------- crypto/apr_crypto_nss.c | 11 +++-- crypto/apr_crypto_openssl.c | 3 +- include/private/apr_crypto_internal.h | 3 +- 4 files changed, 47 insertions(+), 29 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 4484cae3b23..a7eac07f7ea 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -62,12 +62,12 @@ typedef struct apr_crypto_clear_t { } apr_crypto_clear_t; #if !APR_HAVE_MODULAR_DSO -#define DRIVER_LOAD(name,driver,pool,params) \ +#define DRIVER_LOAD(name,driver,pool,params,rv,result) \ { \ extern const apr_crypto_driver_t driver; \ apr_hash_set(drivers,name,APR_HASH_KEY_STRING,&driver); \ if (driver.init) { \ - driver.init(pool, params); \ + rv = driver.init(pool, params, result); \ } \ } #endif @@ -101,22 +101,6 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) #endif drivers = apr_hash_make(pool); -#if !APR_HAVE_MODULAR_DSO - /* Load statically-linked drivers: */ -#if APU_HAVE_OPENSSL - DRIVER_LOAD("openssl", apr_crypto_openssl_driver, pool, params); -#endif -#if APU_HAVE_NSS - DRIVER_LOAD("nss", apr_crypto_nss_driver, pool, params); -#endif -#if APU_HAVE_MSCAPI - DRIVER_LOAD("mscapi", apr_crypto_mscapi_driver, pool, params); -#endif -#if APU_HAVE_MSCNG - DRIVER_LOAD("mscng", apr_crypto_mscng_driver, pool, params); -#endif -#endif /* APR_HAVE_MODULAR_DSO */ - apr_pool_cleanup_register(pool, NULL, apr_crypto_term, apr_pool_cleanup_null); @@ -159,7 +143,10 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( apr_dso_handle_sym_t symbol; #endif apr_status_t rv; - int rc = 0; + + if (result) { + *result = NULL; /* until further notice */ + } #if APR_HAVE_MODULAR_DSO rv = apu_dso_mutex_lock(); @@ -201,27 +188,51 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( } *driver = symbol; if ((*driver)->init) { - rv = (*driver)->init(pool, params, &rc); + rv = (*driver)->init(pool, params, result); + } + if (rv == APR_SUCCESS) { + name = apr_pstrdup(pool, name); + apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver); } - name = apr_pstrdup(pool, name); - apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver); unlock: apu_dso_mutex_unlock(); - if (APR_SUCCESS != rv && result) { + if (APR_SUCCESS != rv && result && !*result) { char *buffer = apr_pcalloc(pool, ERROR_SIZE); apu_err_t *err = apr_pcalloc(pool, sizeof(apu_err_t)); if (err && buffer) { apr_dso_error(dso, buffer, ERROR_SIZE - 1); err->msg = buffer; err->reason = modname; - err->rc = rc; *result = err; } } #else /* not builtin and !APR_HAS_DSO => not implemented */ rv = APR_ENOTIMPL; + + /* Load statically-linked drivers: */ +#if APU_HAVE_OPENSSL + if (name[0] == 'o' && !strcmp(name, "openssl")) { + DRIVER_LOAD("openssl", apr_crypto_openssl_driver, pool, params, rv, result); + } +#endif +#if APU_HAVE_NSS + else if (name[0] == 'n' && !strcmp(name, "nss")) { + DRIVER_LOAD("nss", apr_crypto_nss_driver, pool, params, rv, result); + } +#endif +#if APU_HAVE_MSCAPI + else if (name[0] == 'm' && !strcmp(name, "mscapi")) { + DRIVER_LOAD("mscapi", apr_crypto_mscapi_driver, pool, params, rv, result); + } +#endif +#if APU_HAVE_MSCNG + else if (name[0] == 'm' && !strcmp(name, "mscng")) { + DRIVER_LOAD("mscng", apr_crypto_mscng_driver, pool, params, rv, result); + } +#endif + #endif return rv; diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index e52fe99bd2c..29519e77c6f 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -120,7 +120,8 @@ static apr_status_t crypto_shutdown_helper(void *data) /** * Initialise the crypto library and perform one time initialisation. */ -static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc) +static apr_status_t crypto_init(apr_pool_t *pool, const char *params, + const apu_err_t **result) { SECStatus s; const char *dir = NULL; @@ -208,8 +209,12 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc) s = NSS_NoDB_Init(NULL); } if (s != SECSuccess) { - if (rc) { - *rc = PR_GetError(); + if (result) { + apu_err_t *err = apr_pcalloc(pool, sizeof(apu_err_t)); + err->rc = PR_GetError(); + err->msg = PR_ErrorToName(s); + err->reason = "Error during 'nss' initialisation"; + *result = err; } return APR_ECRYPT; } diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 993fa9f503f..17e8d7be854 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -109,7 +109,8 @@ static apr_status_t crypto_shutdown_helper(void *data) /** * Initialise the crypto library and perform one time initialisation. */ -static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc) +static apr_status_t crypto_init(apr_pool_t *pool, const char *params, + const apu_err_t **result) { CRYPTO_malloc_init(); ERR_load_crypto_strings(); diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index b571451a23c..5da92e55887 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -39,7 +39,8 @@ struct apr_crypto_driver_t { * @param params Optional init parameter string. * @param rc Driver-specific additional error code */ - apr_status_t (*init)(apr_pool_t *pool, const char *params, int *rc); + apr_status_t (*init)(apr_pool_t *pool, const char *params, + const apu_err_t **result); /** * @brief Create a context for supporting encryption. Keys, certificates, From ff05448823270c29482addf82b43f4b42c1d9508 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Thu, 8 Dec 2011 20:55:57 +0000 Subject: [PATCH 7085/7878] Backport windows crypto build files from apr-util. We still need port module build part for Makefile.win git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1212119 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 + apr.dsw | 30 +++++ crypto/apr_crypto_nss.dsp | 203 ++++++++++++++++++++++++++++++++++ crypto/apr_crypto_openssl.dsp | 203 ++++++++++++++++++++++++++++++++++ libapr.dsp | 4 + 5 files changed, 444 insertions(+) create mode 100644 crypto/apr_crypto_nss.dsp create mode 100644 crypto/apr_crypto_openssl.dsp diff --git a/apr.dsp b/apr.dsp index 8e7f2d0b5f3..ad54e04ef5e 100644 --- a/apr.dsp +++ b/apr.dsp @@ -204,6 +204,10 @@ SOURCE=.\buckets\apr_buckets_socket.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\crypto\apr_crypto.c +# End Source File +# Begin Source File + SOURCE=.\crypto\apr_md4.c # End Source File # Begin Source File diff --git a/apr.dsw b/apr.dsw index 6d67f34055d..ff7dadd8cb3 100644 --- a/apr.dsw +++ b/apr.dsw @@ -87,6 +87,36 @@ Package=<4> ############################################################################### +Project: "apr_crypto_nss"=".\crypto\apr_crypto_nss.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libapr + End Project Dependency +}}} + +############################################################################### + +Project: "apr_crypto_openssl"=".\crypto\apr_crypto_openssl.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libapr + End Project Dependency +}}} + +############################################################################### + Global: Package=<5> diff --git a/crypto/apr_crypto_nss.dsp b/crypto/apr_crypto_nss.dsp new file mode 100644 index 00000000000..663b240c47b --- /dev/null +++ b/crypto/apr_crypto_nss.dsp @@ -0,0 +1,203 @@ +# Microsoft Developer Studio Project File - Name="apr_crypto_nss" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=apr_crypto_nss - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr_crypto_nss.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr_crypto_nss.mak" CFG="apr_crypto_nss - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr_crypto_nss - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_crypto_nss - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_crypto_nss - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_crypto_nss - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "apr_crypto_nss - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_NSS=1 /D HAVE_NSS_H=1 /D HAVE_PK11PUB_H=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_nss_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"Release/apr_crypto_nss-1.res" /d DLL_NAME="apr_crypto_nss" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_crypto_nss-1.dll" /pdb:"Release\apr_crypto_nss-1.pdb" /implib:"Release\apr_crypto_nss-1.lib" /MACHINE:X86 /opt:ref +# Begin Special Build Tool +TargetPath=Release\apr_crypto_nss-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_crypto_nss - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_NSS=1 /D HAVE_NSS_H=1 /D HAVE_PK11PUB_H=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_nss_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"Debug/apr_crypto_nss-1.res" /d DLL_NAME="apr_crypto_nss" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_crypto_nss-1.dll" /pdb:"Debug\apr_crypto_nss-1.pdb" /implib:"Debug\apr_crypto_nss-1.lib" /MACHINE:X86 +# Begin Special Build Tool +TargetPath=Debug\apr_crypto_nss-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_crypto_nss - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\Release" +# PROP BASE Intermediate_Dir "x64\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\Release" +# PROP Intermediate_Dir "x64\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_NSS=1 /D HAVE_NSS_H=1 /D HAVE_PK11PUB_H=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_nss_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"x64/Release/apr_crypto_nss-1.res" /d DLL_NAME="apr_crypto_nss" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_crypto_nss-1.dll" /pdb:"x64\Release\apr_crypto_nss-1.pdb" /implib:"x64\Release\apr_crypto_nss-1.lib" /MACHINE:X64 /opt:ref +# Begin Special Build Tool +TargetPath=x64\Release\apr_crypto_nss-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_crypto_nss - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\Debug" +# PROP BASE Intermediate_Dir "x64\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\Debug" +# PROP Intermediate_Dir "x64\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_NSS=1 /D HAVE_NSS_H=1 /D HAVE_PK11PUB_H=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_nss_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_crypto_nss-1.res" /d DLL_NAME="apr_crypto_nss" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_crypto_nss-1.dll" /pdb:"x64\Debug\apr_crypto_nss-1.pdb" /implib:"x64\Debug\apr_crypto_nss-1.lib" /MACHINE:X64 +# Begin Special Build Tool +TargetPath=x64\Debug\apr_crypto_nss-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "apr_crypto_nss - Win32 Release" +# Name "apr_crypto_nss - Win32 Debug" +# Name "apr_crypto_nss - x64 Release" +# Name "apr_crypto_nss - x64 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\apr_crypto_nss.c +# End Source File +# End Group +# Begin Group "Public Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\apr_crypto.h +# End Source File +# End Group +# Begin Group "Internal Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\private\apu_config.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_internal.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\libaprutil.rc +# End Source File +# End Target +# End Project diff --git a/crypto/apr_crypto_openssl.dsp b/crypto/apr_crypto_openssl.dsp new file mode 100644 index 00000000000..90114ce4352 --- /dev/null +++ b/crypto/apr_crypto_openssl.dsp @@ -0,0 +1,203 @@ +# Microsoft Developer Studio Project File - Name="apr_crypto_openssl" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=apr_crypto_openssl - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "apr_crypto_openssl.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "apr_crypto_openssl.mak" CFG="apr_crypto_openssl - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "apr_crypto_openssl - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_crypto_openssl - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_crypto_openssl - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "apr_crypto_openssl - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "apr_crypto_openssl - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_OPENSSL=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_openssl_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"Release/apr_crypto_openssl-1.res" /d DLL_NAME="apr_crypto_openssl" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_crypto_openssl-1.dll" /pdb:"Release\apr_crypto_openssl-1.pdb" /implib:"Release\apr_crypto_openssl-1.lib" /MACHINE:X86 /opt:ref +# Begin Special Build Tool +TargetPath=Release\apr_crypto_openssl-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_crypto_openssl - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_OPENSSL=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_openssl_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"Debug/apr_crypto_openssl-1.res" /d DLL_NAME="apr_crypto_openssl" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_crypto_openssl-1.dll" /pdb:"Debug\apr_crypto_openssl-1.pdb" /implib:"Debug\apr_crypto_openssl-1.lib" /MACHINE:X86 +# Begin Special Build Tool +TargetPath=Debug\apr_crypto_openssl-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_crypto_openssl - x64 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "x64\Release" +# PROP BASE Intermediate_Dir "x64\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "x64\Release" +# PROP Intermediate_Dir "x64\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_OPENSSL=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_openssl_src" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /fo"x64/Release/apr_crypto_openssl-1.res" /d DLL_NAME="apr_crypto_openssl" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_crypto_openssl-1.dll" /pdb:"x64\Release\apr_crypto_openssl-1.pdb" /implib:"x64\Release\apr_crypto_openssl-1.lib" /MACHINE:X64 /opt:ref +# Begin Special Build Tool +TargetPath=x64\Release\apr_crypto_openssl-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ELSEIF "$(CFG)" == "apr_crypto_openssl - x64 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "x64\Debug" +# PROP BASE Intermediate_Dir "x64\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "x64\Debug" +# PROP Intermediate_Dir "x64\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_OPENSSL=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_openssl_src" /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /fo"x64/Debug/apr_crypto_openssl-1.res" /d DLL_NAME="apr_crypto_openssl" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_crypto_openssl-1.dll" /pdb:"x64\Debug\apr_crypto_openssl-1.pdb" /implib:"x64\Debug\apr_crypto_openssl-1.lib" /MACHINE:X64 +# Begin Special Build Tool +TargetPath=x64\Debug\apr_crypto_openssl-1.dll +SOURCE="$(InputPath)" +PostBuild_Desc=Embed .manifest +PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "apr_crypto_openssl - Win32 Release" +# Name "apr_crypto_openssl - Win32 Debug" +# Name "apr_crypto_openssl - x64 Release" +# Name "apr_crypto_openssl - x64 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\apr_crypto_openssl.c +# End Source File +# End Group +# Begin Group "Public Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\apr_crypto.h +# End Source File +# End Group +# Begin Group "Internal Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\include\private\apu_config.h +# End Source File +# Begin Source File + +SOURCE=..\include\private\apu_internal.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\libaprutil.rc +# End Source File +# End Target +# End Project diff --git a/libapr.dsp b/libapr.dsp index bd598bf39be..ef0139d5fc5 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -239,6 +239,10 @@ SOURCE=.\buckets\apr_buckets_socket.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\crypto\apr_crypto.c +# End Source File +# Begin Source File + SOURCE=.\crypto\apr_md4.c # End Source File # Begin Source File From e30fba054fa958674c6e5d68cc1dcaa623f954b3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 12 Dec 2011 19:23:12 +0000 Subject: [PATCH 7086/7878] definAtely git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1213382 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 2 +- threadproc/win32/signals.c | 2 +- uri/apr_uri.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index c6afa5fe810..55397ca6906 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -55,7 +55,7 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, apr_status_t rv; /* This is correct, we don't twist the filename if it is will - * definately be shorter than 248 characters. It merits some + * definitely be shorter than 248 characters. It merits some * performance testing to see if this has any effect, but there * seem to be applications that get confused by the resulting * Unicode \\?\ style file names, especially if they use argv[0] diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index f19fb03248a..48676d856ca 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -31,7 +31,7 @@ /* Windows only really support killing process, but that will do for now. * * ### Actually, closing the input handle to the proc should also do fine - * for most console apps. This definately needs improvement... + * for most console apps. This definitely needs improvement... */ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signal) { diff --git a/uri/apr_uri.c b/uri/apr_uri.c index 5f16c664b7e..cd8e6ff4b8d 100644 --- a/uri/apr_uri.c +++ b/uri/apr_uri.c @@ -334,7 +334,7 @@ APR_DECLARE(apr_status_t) apr_uri_parse(apr_pool_t *p, const char *uri, /* If there's a username:password@host:port, the @ we want is the last @... * too bad there's no memrchr()... For the C purists, note that hostinfo - * is definately not the first character of the original uri so therefore + * is definitely not the first character of the original uri so therefore * &hostinfo[-1] < &hostinfo[0] ... and this loop is valid C. */ do { From 52552cf57a52140380127637aaf09a4694999a96 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Wed, 14 Dec 2011 22:39:34 +0000 Subject: [PATCH 7087/7878] apr_crypto: Crypto library detection runs twice (from main configure logic as well as from APU_CHECK_CRYPTO). Crypto enablement depends on enablement of a crypto library, but forgetting to enable a crypto library silently proceeds without failing. Submitted by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1214516 13f79535-47bb-0310-9956-ffa450edef68 --- build/crypto.m4 | 3 +++ configure.in | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build/crypto.m4 b/build/crypto.m4 index 0a4f43c9fe3..d15a8e8276c 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -34,6 +34,9 @@ AC_DEFUN([APU_CHECK_CRYPTO], [ APU_CHECK_CRYPTO_OPENSSL APU_CHECK_CRYPTO_NSS dnl add checks for other varieties of ssl here + if test "$apu_have_crypto" == "0"; then + AC_ERROR(Crypto was requested but no crypto library was enabled) + fi fi ], [ apu_have_crypto=0 diff --git a/configure.in b/configure.in index ac6ea4d1a23..1aeddb7daad 100644 --- a/configure.in +++ b/configure.in @@ -2604,8 +2604,6 @@ APU_PRELOAD dnl Find crypto libraries APU_CHECK_CRYPTO -APU_CHECK_CRYPTO_OPENSSL -APU_CHECK_CRYPTO_NSS dnl Find DBM and DBD backends to use. APU_CHECK_DBM From 6ea660eda7f5ada8cc276fc041860863fdfaf457 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 18 Dec 2011 13:35:39 +0000 Subject: [PATCH 7088/7878] Fix "test" syntax introduced in r1214516. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1220395 13f79535-47bb-0310-9956-ffa450edef68 --- build/crypto.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/crypto.m4 b/build/crypto.m4 index d15a8e8276c..11f2e2bef7f 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -34,7 +34,7 @@ AC_DEFUN([APU_CHECK_CRYPTO], [ APU_CHECK_CRYPTO_OPENSSL APU_CHECK_CRYPTO_NSS dnl add checks for other varieties of ssl here - if test "$apu_have_crypto" == "0"; then + if test "$apu_have_crypto" = "0"; then AC_ERROR(Crypto was requested but no crypto library was enabled) fi fi From aa7d63500ae033299c41abcabae218ef8810b813 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Sun, 15 Jan 2012 00:37:14 +0000 Subject: [PATCH 7089/7878] Randomise hashes by providing a seed. This is supposed to be a "good enough" approach. Using a crypto quality function like apr_generate_random_bytes() may be stronger, but this function may block, so it will be avoided for now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1231605 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index d64e77941bb..f899d5156ec 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -18,6 +18,10 @@ #include "apr_general.h" #include "apr_pools.h" +#include "apr_time.h" +#if APR_HAVE_STDLIB_H +#include /* for rand, srand */ +#endif #include "apr_hash.h" @@ -75,7 +79,7 @@ struct apr_hash_t { apr_pool_t *pool; apr_hash_entry_t **array; apr_hash_index_t iterator; /* For apr_hash_first(NULL, ...) */ - unsigned int count, max; + unsigned int count, max, seed; apr_hashfunc_t hash_func; apr_hash_entry_t *free; /* List of recycled entries */ }; @@ -95,13 +99,18 @@ static apr_hash_entry_t **alloc_array(apr_hash_t *ht, unsigned int max) APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) { apr_hash_t *ht; + apr_time_t now = apr_time_now(); + ht = apr_palloc(pool, sizeof(apr_hash_t)); ht->pool = pool; ht->free = NULL; ht->count = 0; ht->max = INITIAL_MAX; + srand((unsigned int)((now >> 32) ^ now ^ (apr_uintptr_t)ht)); + ht->seed = (unsigned int)(rand()); ht->array = alloc_array(ht, ht->max); - ht->hash_func = apr_hashfunc_default; + ht->hash_func = NULL; + return ht; } @@ -201,10 +210,10 @@ static void expand_array(apr_hash_t *ht) ht->max = new_max; } -APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, - apr_ssize_t *klen) +static unsigned int apr_hashfunc_default_internal(const char *char_key, + apr_ssize_t *klen, + unsigned int hash) { - unsigned int hash = 0; const unsigned char *key = (const unsigned char *)char_key; const unsigned char *p; apr_ssize_t i; @@ -246,7 +255,7 @@ APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, * * -- Ralf S. Engelschall */ - + if (*klen == APR_HASH_KEY_STRING) { for (p = key; *p; p++) { hash = hash * 33 + *p; @@ -262,6 +271,11 @@ APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, return hash; } +APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, + apr_ssize_t *klen) +{ + return apr_hashfunc_default_internal(char_key, klen, 0); +} /* * This is where we keep the details of the hash function and control @@ -280,7 +294,10 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, apr_hash_entry_t **hep, *he; unsigned int hash; - hash = ht->hash_func(key, &klen); + if (ht->hash_func) + hash = ht->hash_func(key, &klen); + else + hash = apr_hashfunc_default_internal(key, &klen, ht->seed); /* scan linked list */ for (hep = &ht->array[hash & ht->max], he = *hep; @@ -322,6 +339,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, ht->free = NULL; ht->count = orig->count; ht->max = orig->max; + ht->seed = orig->seed; ht->hash_func = orig->hash_func; ht->array = (apr_hash_entry_t **)((char *)ht + sizeof(apr_hash_t)); From 8fee546beeca0418aa216c2a530c0b09234da5e5 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Mon, 16 Jan 2012 08:20:56 +0000 Subject: [PATCH 7090/7878] Do not use srand()/rand() to randomise hashes. Use just "random" data instead. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1231858 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index f899d5156ec..013e2e1af9b 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -19,9 +19,6 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_time.h" -#if APR_HAVE_STDLIB_H -#include /* for rand, srand */ -#endif #include "apr_hash.h" @@ -106,8 +103,8 @@ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) ht->free = NULL; ht->count = 0; ht->max = INITIAL_MAX; - srand((unsigned int)((now >> 32) ^ now ^ (apr_uintptr_t)ht)); - ht->seed = (unsigned int)(rand()); + ht->seed = (unsigned int)((now >> 32) ^ now ^ (apr_uintptr_t)pool ^ + (apr_uintptr_t)ht ^ (apr_uintptr_t)&now) - 1; ht->array = alloc_array(ht, ht->max); ht->hash_func = NULL; From 645073561e4434e7b7c5ed2156f8a156f56518e4 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Tue, 17 Jan 2012 06:45:02 +0000 Subject: [PATCH 7091/7878] Revert hash randomisation for now. Causing regressions in httpd. It is incomplete and possibly incorrect as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1232320 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 013e2e1af9b..d64e77941bb 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -18,7 +18,6 @@ #include "apr_general.h" #include "apr_pools.h" -#include "apr_time.h" #include "apr_hash.h" @@ -76,7 +75,7 @@ struct apr_hash_t { apr_pool_t *pool; apr_hash_entry_t **array; apr_hash_index_t iterator; /* For apr_hash_first(NULL, ...) */ - unsigned int count, max, seed; + unsigned int count, max; apr_hashfunc_t hash_func; apr_hash_entry_t *free; /* List of recycled entries */ }; @@ -96,18 +95,13 @@ static apr_hash_entry_t **alloc_array(apr_hash_t *ht, unsigned int max) APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) { apr_hash_t *ht; - apr_time_t now = apr_time_now(); - ht = apr_palloc(pool, sizeof(apr_hash_t)); ht->pool = pool; ht->free = NULL; ht->count = 0; ht->max = INITIAL_MAX; - ht->seed = (unsigned int)((now >> 32) ^ now ^ (apr_uintptr_t)pool ^ - (apr_uintptr_t)ht ^ (apr_uintptr_t)&now) - 1; ht->array = alloc_array(ht, ht->max); - ht->hash_func = NULL; - + ht->hash_func = apr_hashfunc_default; return ht; } @@ -207,10 +201,10 @@ static void expand_array(apr_hash_t *ht) ht->max = new_max; } -static unsigned int apr_hashfunc_default_internal(const char *char_key, - apr_ssize_t *klen, - unsigned int hash) +APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, + apr_ssize_t *klen) { + unsigned int hash = 0; const unsigned char *key = (const unsigned char *)char_key; const unsigned char *p; apr_ssize_t i; @@ -252,7 +246,7 @@ static unsigned int apr_hashfunc_default_internal(const char *char_key, * * -- Ralf S. Engelschall */ - + if (*klen == APR_HASH_KEY_STRING) { for (p = key; *p; p++) { hash = hash * 33 + *p; @@ -268,11 +262,6 @@ static unsigned int apr_hashfunc_default_internal(const char *char_key, return hash; } -APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, - apr_ssize_t *klen) -{ - return apr_hashfunc_default_internal(char_key, klen, 0); -} /* * This is where we keep the details of the hash function and control @@ -291,10 +280,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, apr_hash_entry_t **hep, *he; unsigned int hash; - if (ht->hash_func) - hash = ht->hash_func(key, &klen); - else - hash = apr_hashfunc_default_internal(key, &klen, ht->seed); + hash = ht->hash_func(key, &klen); /* scan linked list */ for (hep = &ht->array[hash & ht->max], he = *hep; @@ -336,7 +322,6 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, ht->free = NULL; ht->count = orig->count; ht->max = orig->max; - ht->seed = orig->seed; ht->hash_func = orig->hash_func; ht->array = (apr_hash_entry_t **)((char *)ht + sizeof(apr_hash_t)); From ffb3c1929f1cef8c31f9b143dcd836c4d1f404c6 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sun, 22 Jan 2012 10:12:07 +0000 Subject: [PATCH 7092/7878] Clarify docs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1234474 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_buckets.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_buckets.h b/include/apr_buckets.h index 14192de1176..84d68102ea1 100644 --- a/include/apr_buckets.h +++ b/include/apr_buckets.h @@ -693,7 +693,8 @@ APR_DECLARE(apr_status_t) apr_brigade_cleanup(void *data) * @param b The brigade to split * @param e The first bucket to move * @param a The brigade which should be used for the result or NULL if - * a new brigade should be created. + * a new brigade should be created. The brigade @param a will be + * cleared if it is not empty. * @return The brigade supplied in @param a or a new one if @param a was NULL. * @warning Note that this function allocates a new brigade if @param a is * NULL so memory consumption should be carefully considered. From 6f42dc6ce23909a1d211d9eb39442005a2e694ac Mon Sep 17 00:00:00 2001 From: "Philip M. Gollucci" Date: Mon, 23 Jan 2012 22:45:12 +0000 Subject: [PATCH 7093/7878] Fix compile w/ clang and IPv6 Submitted by: Yuri Pankov via freebsd ports/164420 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1235047 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index e2fdbdae38c..e41abcc0dc3 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -64,7 +64,7 @@ AC_DEFUN([APR_CHECK_WORKING_GETADDRINFO], [ #include #endif -void main(void) { +int main(void) { struct addrinfo hints, *ai; int error; @@ -152,7 +152,7 @@ AC_DEFUN([APR_CHECK_WORKING_GETNAMEINFO], [ #include #endif -void main(void) { +int main(void) { struct sockaddr_in sa; char hbuf[256]; int error; @@ -195,7 +195,7 @@ AC_DEFUN([APR_CHECK_NEGATIVE_EAI], [ #include #endif -void main(void) { +int main(void) { if (EAI_ADDRFAMILY < 0) { exit(0); } From 75bfd422c2c58c8e8dd1b1a0c1537917f11f3600 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Fri, 27 Jan 2012 11:48:54 +0000 Subject: [PATCH 7094/7878] Randomise hashes by providing a seed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1236642 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 23 +++++++++++---- test/testhash.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 5 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index d64e77941bb..720cfdeabaa 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -18,6 +18,7 @@ #include "apr_general.h" #include "apr_pools.h" +#include "apr_time.h" #include "apr_hash.h" @@ -75,7 +76,7 @@ struct apr_hash_t { apr_pool_t *pool; apr_hash_entry_t **array; apr_hash_index_t iterator; /* For apr_hash_first(NULL, ...) */ - unsigned int count, max; + unsigned int count, max, seed; apr_hashfunc_t hash_func; apr_hash_entry_t *free; /* List of recycled entries */ }; @@ -95,13 +96,18 @@ static apr_hash_entry_t **alloc_array(apr_hash_t *ht, unsigned int max) APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) { apr_hash_t *ht; + apr_time_t now = apr_time_now(); + ht = apr_palloc(pool, sizeof(apr_hash_t)); ht->pool = pool; ht->free = NULL; ht->count = 0; ht->max = INITIAL_MAX; + ht->seed = (unsigned int)((now >> 32) ^ now ^ (apr_uintptr_t)pool ^ + (apr_uintptr_t)ht ^ (apr_uintptr_t)&now) - 1; ht->array = alloc_array(ht, ht->max); ht->hash_func = apr_hashfunc_default; + return ht; } @@ -280,7 +286,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, apr_hash_entry_t **hep, *he; unsigned int hash; - hash = ht->hash_func(key, &klen); + hash = ht->seed ^ ht->hash_func(key, &klen); /* scan linked list */ for (hep = &ht->array[hash & ht->max], he = *hep; @@ -322,6 +328,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, ht->free = NULL; ht->count = orig->count; ht->max = orig->max; + ht->seed = orig->seed; ht->hash_func = orig->hash_func; ht->array = (apr_hash_entry_t **)((char *)ht + sizeof(apr_hash_t)); @@ -419,7 +426,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, apr_hash_entry_t *new_vals = NULL; apr_hash_entry_t *iter; apr_hash_entry_t *ent; - unsigned int i,j,k; + unsigned int i, j, k, hash; #if APR_POOL_DEBUG /* we don't copy keys and values, so it's necessary that @@ -447,6 +454,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, if (base->count + overlay->count > res->max) { res->max = res->max * 2 + 1; } + res->seed = base->seed; res->array = alloc_array(res, res->max); if (base->count + overlay->count) { new_vals = apr_palloc(p, sizeof(apr_hash_entry_t) * @@ -468,7 +476,12 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, for (k = 0; k <= overlay->max; k++) { for (iter = overlay->array[k]; iter; iter = iter->next) { - i = iter->hash & res->max; + if (res->hash_func == overlay->hash_func) + hash = iter->hash ^ overlay->seed; + else + hash = res->hash_func(iter->key, &iter->klen); + hash = res->seed ^ hash; + i = hash & res->max; for (ent = res->array[i]; ent; ent = ent->next) { if ((ent->klen == iter->klen) && (memcmp(ent->key, iter->key, iter->klen) == 0)) { @@ -486,7 +499,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, new_vals[j].klen = iter->klen; new_vals[j].key = iter->key; new_vals[j].val = iter->val; - new_vals[j].hash = iter->hash; + new_vals[j].hash = hash; new_vals[j].next = res->array[i]; res->array[i] = &new_vals[j]; res->count++; diff --git a/test/testhash.c b/test/testhash.c index 8c1735a99cc..3c841902418 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -438,6 +438,79 @@ static void overlay_same(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "#entries 5\n", StrArray[5]); } +static void overlay_fetch(abts_case *tc, void *data) +{ + apr_hash_t *base = NULL; + apr_hash_t *overlay = NULL; + apr_hash_t *result = NULL; + int count; + + base = apr_hash_make(p); + overlay = apr_hash_make(p); + ABTS_PTR_NOTNULL(tc, base); + ABTS_PTR_NOTNULL(tc, overlay); + + apr_hash_set(base, "base1", APR_HASH_KEY_STRING, "value1"); + apr_hash_set(base, "base2", APR_HASH_KEY_STRING, "value2"); + apr_hash_set(base, "base3", APR_HASH_KEY_STRING, "value3"); + apr_hash_set(base, "base4", APR_HASH_KEY_STRING, "value4"); + apr_hash_set(base, "base5", APR_HASH_KEY_STRING, "value5"); + + apr_hash_set(overlay, "overlay1", APR_HASH_KEY_STRING, "value1"); + apr_hash_set(overlay, "overlay2", APR_HASH_KEY_STRING, "value2"); + apr_hash_set(overlay, "overlay3", APR_HASH_KEY_STRING, "value3"); + apr_hash_set(overlay, "overlay4", APR_HASH_KEY_STRING, "value4"); + apr_hash_set(overlay, "overlay5", APR_HASH_KEY_STRING, "value5"); + + result = apr_hash_overlay(p, overlay, base); + + count = apr_hash_count(result); + ABTS_INT_EQUAL(tc, 10, count); + + ABTS_STR_EQUAL(tc, "value1", + apr_hash_get(result, "base1", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value2", + apr_hash_get(result, "base2", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value3", + apr_hash_get(result, "base3", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value4", + apr_hash_get(result, "base4", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value5", + apr_hash_get(result, "base5", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value1", + apr_hash_get(result, "overlay1", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value2", + apr_hash_get(result, "overlay2", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value3", + apr_hash_get(result, "overlay3", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value4", + apr_hash_get(result, "overlay4", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value5", + apr_hash_get(result, "overlay5", APR_HASH_KEY_STRING)); + + ABTS_STR_EQUAL(tc, "value1", + apr_hash_get(base, "base1", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value2", + apr_hash_get(base, "base2", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value3", + apr_hash_get(base, "base3", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value4", + apr_hash_get(base, "base4", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value5", + apr_hash_get(base, "base5", APR_HASH_KEY_STRING)); + + ABTS_STR_EQUAL(tc, "value1", + apr_hash_get(overlay, "overlay1", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value2", + apr_hash_get(overlay, "overlay2", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value3", + apr_hash_get(overlay, "overlay3", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value4", + apr_hash_get(overlay, "overlay4", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value5", + apr_hash_get(overlay, "overlay5", APR_HASH_KEY_STRING)); +} + abts_suite *testhash(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -461,6 +534,7 @@ abts_suite *testhash(abts_suite *suite) abts_run_test(suite, overlay_empty, NULL); abts_run_test(suite, overlay_2unique, NULL); abts_run_test(suite, overlay_same, NULL); + abts_run_test(suite, overlay_fetch, NULL); return suite; } From f06401eb2937a36e19b1d7cefa24c460ceb83159 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Sat, 28 Jan 2012 03:00:40 +0000 Subject: [PATCH 7095/7878] Revert hash randomisation again. Elegant, but ultimately ineffective. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1236967 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 23 ++++----------- test/testhash.c | 74 ----------------------------------------------- 2 files changed, 5 insertions(+), 92 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 720cfdeabaa..d64e77941bb 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -18,7 +18,6 @@ #include "apr_general.h" #include "apr_pools.h" -#include "apr_time.h" #include "apr_hash.h" @@ -76,7 +75,7 @@ struct apr_hash_t { apr_pool_t *pool; apr_hash_entry_t **array; apr_hash_index_t iterator; /* For apr_hash_first(NULL, ...) */ - unsigned int count, max, seed; + unsigned int count, max; apr_hashfunc_t hash_func; apr_hash_entry_t *free; /* List of recycled entries */ }; @@ -96,18 +95,13 @@ static apr_hash_entry_t **alloc_array(apr_hash_t *ht, unsigned int max) APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) { apr_hash_t *ht; - apr_time_t now = apr_time_now(); - ht = apr_palloc(pool, sizeof(apr_hash_t)); ht->pool = pool; ht->free = NULL; ht->count = 0; ht->max = INITIAL_MAX; - ht->seed = (unsigned int)((now >> 32) ^ now ^ (apr_uintptr_t)pool ^ - (apr_uintptr_t)ht ^ (apr_uintptr_t)&now) - 1; ht->array = alloc_array(ht, ht->max); ht->hash_func = apr_hashfunc_default; - return ht; } @@ -286,7 +280,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, apr_hash_entry_t **hep, *he; unsigned int hash; - hash = ht->seed ^ ht->hash_func(key, &klen); + hash = ht->hash_func(key, &klen); /* scan linked list */ for (hep = &ht->array[hash & ht->max], he = *hep; @@ -328,7 +322,6 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, ht->free = NULL; ht->count = orig->count; ht->max = orig->max; - ht->seed = orig->seed; ht->hash_func = orig->hash_func; ht->array = (apr_hash_entry_t **)((char *)ht + sizeof(apr_hash_t)); @@ -426,7 +419,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, apr_hash_entry_t *new_vals = NULL; apr_hash_entry_t *iter; apr_hash_entry_t *ent; - unsigned int i, j, k, hash; + unsigned int i,j,k; #if APR_POOL_DEBUG /* we don't copy keys and values, so it's necessary that @@ -454,7 +447,6 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, if (base->count + overlay->count > res->max) { res->max = res->max * 2 + 1; } - res->seed = base->seed; res->array = alloc_array(res, res->max); if (base->count + overlay->count) { new_vals = apr_palloc(p, sizeof(apr_hash_entry_t) * @@ -476,12 +468,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, for (k = 0; k <= overlay->max; k++) { for (iter = overlay->array[k]; iter; iter = iter->next) { - if (res->hash_func == overlay->hash_func) - hash = iter->hash ^ overlay->seed; - else - hash = res->hash_func(iter->key, &iter->klen); - hash = res->seed ^ hash; - i = hash & res->max; + i = iter->hash & res->max; for (ent = res->array[i]; ent; ent = ent->next) { if ((ent->klen == iter->klen) && (memcmp(ent->key, iter->key, iter->klen) == 0)) { @@ -499,7 +486,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, new_vals[j].klen = iter->klen; new_vals[j].key = iter->key; new_vals[j].val = iter->val; - new_vals[j].hash = hash; + new_vals[j].hash = iter->hash; new_vals[j].next = res->array[i]; res->array[i] = &new_vals[j]; res->count++; diff --git a/test/testhash.c b/test/testhash.c index 3c841902418..8c1735a99cc 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -438,79 +438,6 @@ static void overlay_same(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "#entries 5\n", StrArray[5]); } -static void overlay_fetch(abts_case *tc, void *data) -{ - apr_hash_t *base = NULL; - apr_hash_t *overlay = NULL; - apr_hash_t *result = NULL; - int count; - - base = apr_hash_make(p); - overlay = apr_hash_make(p); - ABTS_PTR_NOTNULL(tc, base); - ABTS_PTR_NOTNULL(tc, overlay); - - apr_hash_set(base, "base1", APR_HASH_KEY_STRING, "value1"); - apr_hash_set(base, "base2", APR_HASH_KEY_STRING, "value2"); - apr_hash_set(base, "base3", APR_HASH_KEY_STRING, "value3"); - apr_hash_set(base, "base4", APR_HASH_KEY_STRING, "value4"); - apr_hash_set(base, "base5", APR_HASH_KEY_STRING, "value5"); - - apr_hash_set(overlay, "overlay1", APR_HASH_KEY_STRING, "value1"); - apr_hash_set(overlay, "overlay2", APR_HASH_KEY_STRING, "value2"); - apr_hash_set(overlay, "overlay3", APR_HASH_KEY_STRING, "value3"); - apr_hash_set(overlay, "overlay4", APR_HASH_KEY_STRING, "value4"); - apr_hash_set(overlay, "overlay5", APR_HASH_KEY_STRING, "value5"); - - result = apr_hash_overlay(p, overlay, base); - - count = apr_hash_count(result); - ABTS_INT_EQUAL(tc, 10, count); - - ABTS_STR_EQUAL(tc, "value1", - apr_hash_get(result, "base1", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value2", - apr_hash_get(result, "base2", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value3", - apr_hash_get(result, "base3", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value4", - apr_hash_get(result, "base4", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value5", - apr_hash_get(result, "base5", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value1", - apr_hash_get(result, "overlay1", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value2", - apr_hash_get(result, "overlay2", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value3", - apr_hash_get(result, "overlay3", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value4", - apr_hash_get(result, "overlay4", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value5", - apr_hash_get(result, "overlay5", APR_HASH_KEY_STRING)); - - ABTS_STR_EQUAL(tc, "value1", - apr_hash_get(base, "base1", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value2", - apr_hash_get(base, "base2", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value3", - apr_hash_get(base, "base3", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value4", - apr_hash_get(base, "base4", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value5", - apr_hash_get(base, "base5", APR_HASH_KEY_STRING)); - - ABTS_STR_EQUAL(tc, "value1", - apr_hash_get(overlay, "overlay1", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value2", - apr_hash_get(overlay, "overlay2", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value3", - apr_hash_get(overlay, "overlay3", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value4", - apr_hash_get(overlay, "overlay4", APR_HASH_KEY_STRING)); - ABTS_STR_EQUAL(tc, "value5", - apr_hash_get(overlay, "overlay5", APR_HASH_KEY_STRING)); -} - abts_suite *testhash(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -534,7 +461,6 @@ abts_suite *testhash(abts_suite *suite) abts_run_test(suite, overlay_empty, NULL); abts_run_test(suite, overlay_2unique, NULL); abts_run_test(suite, overlay_same, NULL); - abts_run_test(suite, overlay_fetch, NULL); return suite; } From 1c622360c43b27825636f6d65a0d6538e178dc27 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Sat, 28 Jan 2012 03:23:11 +0000 Subject: [PATCH 7096/7878] Randomise hashes by providing a seed (initial hash value). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1236970 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 41 +++++++++++++++++++------- test/testhash.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 10 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index d64e77941bb..772a2ded5bb 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -18,6 +18,7 @@ #include "apr_general.h" #include "apr_pools.h" +#include "apr_time.h" #include "apr_hash.h" @@ -75,7 +76,7 @@ struct apr_hash_t { apr_pool_t *pool; apr_hash_entry_t **array; apr_hash_index_t iterator; /* For apr_hash_first(NULL, ...) */ - unsigned int count, max; + unsigned int count, max, seed; apr_hashfunc_t hash_func; apr_hash_entry_t *free; /* List of recycled entries */ }; @@ -95,13 +96,18 @@ static apr_hash_entry_t **alloc_array(apr_hash_t *ht, unsigned int max) APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) { apr_hash_t *ht; + apr_time_t now = apr_time_now(); + ht = apr_palloc(pool, sizeof(apr_hash_t)); ht->pool = pool; ht->free = NULL; ht->count = 0; ht->max = INITIAL_MAX; + ht->seed = (unsigned int)((now >> 32) ^ now ^ (apr_uintptr_t)pool ^ + (apr_uintptr_t)ht ^ (apr_uintptr_t)&now) - 1; ht->array = alloc_array(ht, ht->max); - ht->hash_func = apr_hashfunc_default; + ht->hash_func = NULL; + return ht; } @@ -201,10 +207,10 @@ static void expand_array(apr_hash_t *ht) ht->max = new_max; } -APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, - apr_ssize_t *klen) +static unsigned int apr_hashfunc_default_internal(const char *char_key, + apr_ssize_t *klen, + unsigned int hash) { - unsigned int hash = 0; const unsigned char *key = (const unsigned char *)char_key; const unsigned char *p; apr_ssize_t i; @@ -246,7 +252,7 @@ APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, * * -- Ralf S. Engelschall */ - + if (*klen == APR_HASH_KEY_STRING) { for (p = key; *p; p++) { hash = hash * 33 + *p; @@ -262,6 +268,11 @@ APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, return hash; } +APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, + apr_ssize_t *klen) +{ + return apr_hashfunc_default_internal(char_key, klen, 0); +} /* * This is where we keep the details of the hash function and control @@ -280,7 +291,10 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, apr_hash_entry_t **hep, *he; unsigned int hash; - hash = ht->hash_func(key, &klen); + if (ht->hash_func) + hash = ht->hash_func(key, &klen); + else + hash = apr_hashfunc_default_internal(key, &klen, ht->seed); /* scan linked list */ for (hep = &ht->array[hash & ht->max], he = *hep; @@ -322,6 +336,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, ht->free = NULL; ht->count = orig->count; ht->max = orig->max; + ht->seed = orig->seed; ht->hash_func = orig->hash_func; ht->array = (apr_hash_entry_t **)((char *)ht + sizeof(apr_hash_t)); @@ -419,7 +434,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, apr_hash_entry_t *new_vals = NULL; apr_hash_entry_t *iter; apr_hash_entry_t *ent; - unsigned int i,j,k; + unsigned int i, j, k, hash; #if APR_POOL_DEBUG /* we don't copy keys and values, so it's necessary that @@ -447,6 +462,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, if (base->count + overlay->count > res->max) { res->max = res->max * 2 + 1; } + res->seed = base->seed; res->array = alloc_array(res, res->max); if (base->count + overlay->count) { new_vals = apr_palloc(p, sizeof(apr_hash_entry_t) * @@ -468,7 +484,12 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, for (k = 0; k <= overlay->max; k++) { for (iter = overlay->array[k]; iter; iter = iter->next) { - i = iter->hash & res->max; + if (res->hash_func) + hash = res->hash_func(iter->key, &iter->klen); + else + hash = apr_hashfunc_default_internal(iter->key, &iter->klen, + res->seed); + i = hash & res->max; for (ent = res->array[i]; ent; ent = ent->next) { if ((ent->klen == iter->klen) && (memcmp(ent->key, iter->key, iter->klen) == 0)) { @@ -486,7 +507,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, new_vals[j].klen = iter->klen; new_vals[j].key = iter->key; new_vals[j].val = iter->val; - new_vals[j].hash = iter->hash; + new_vals[j].hash = hash; new_vals[j].next = res->array[i]; res->array[i] = &new_vals[j]; res->count++; diff --git a/test/testhash.c b/test/testhash.c index 8c1735a99cc..3c841902418 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -438,6 +438,79 @@ static void overlay_same(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "#entries 5\n", StrArray[5]); } +static void overlay_fetch(abts_case *tc, void *data) +{ + apr_hash_t *base = NULL; + apr_hash_t *overlay = NULL; + apr_hash_t *result = NULL; + int count; + + base = apr_hash_make(p); + overlay = apr_hash_make(p); + ABTS_PTR_NOTNULL(tc, base); + ABTS_PTR_NOTNULL(tc, overlay); + + apr_hash_set(base, "base1", APR_HASH_KEY_STRING, "value1"); + apr_hash_set(base, "base2", APR_HASH_KEY_STRING, "value2"); + apr_hash_set(base, "base3", APR_HASH_KEY_STRING, "value3"); + apr_hash_set(base, "base4", APR_HASH_KEY_STRING, "value4"); + apr_hash_set(base, "base5", APR_HASH_KEY_STRING, "value5"); + + apr_hash_set(overlay, "overlay1", APR_HASH_KEY_STRING, "value1"); + apr_hash_set(overlay, "overlay2", APR_HASH_KEY_STRING, "value2"); + apr_hash_set(overlay, "overlay3", APR_HASH_KEY_STRING, "value3"); + apr_hash_set(overlay, "overlay4", APR_HASH_KEY_STRING, "value4"); + apr_hash_set(overlay, "overlay5", APR_HASH_KEY_STRING, "value5"); + + result = apr_hash_overlay(p, overlay, base); + + count = apr_hash_count(result); + ABTS_INT_EQUAL(tc, 10, count); + + ABTS_STR_EQUAL(tc, "value1", + apr_hash_get(result, "base1", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value2", + apr_hash_get(result, "base2", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value3", + apr_hash_get(result, "base3", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value4", + apr_hash_get(result, "base4", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value5", + apr_hash_get(result, "base5", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value1", + apr_hash_get(result, "overlay1", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value2", + apr_hash_get(result, "overlay2", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value3", + apr_hash_get(result, "overlay3", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value4", + apr_hash_get(result, "overlay4", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value5", + apr_hash_get(result, "overlay5", APR_HASH_KEY_STRING)); + + ABTS_STR_EQUAL(tc, "value1", + apr_hash_get(base, "base1", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value2", + apr_hash_get(base, "base2", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value3", + apr_hash_get(base, "base3", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value4", + apr_hash_get(base, "base4", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value5", + apr_hash_get(base, "base5", APR_HASH_KEY_STRING)); + + ABTS_STR_EQUAL(tc, "value1", + apr_hash_get(overlay, "overlay1", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value2", + apr_hash_get(overlay, "overlay2", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value3", + apr_hash_get(overlay, "overlay3", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value4", + apr_hash_get(overlay, "overlay4", APR_HASH_KEY_STRING)); + ABTS_STR_EQUAL(tc, "value5", + apr_hash_get(overlay, "overlay5", APR_HASH_KEY_STRING)); +} + abts_suite *testhash(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -461,6 +534,7 @@ abts_suite *testhash(abts_suite *suite) abts_run_test(suite, overlay_empty, NULL); abts_run_test(suite, overlay_2unique, NULL); abts_run_test(suite, overlay_same, NULL); + abts_run_test(suite, overlay_fetch, NULL); return suite; } From 54ed1816f0fe4e1a7532e4bdac65683429e7600f Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Sat, 28 Jan 2012 15:54:22 +0000 Subject: [PATCH 7097/7878] Further improve hash randomisation: Fix naming of a static function. Randomise final hash produced by any hash function, using default hash function and seed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1237078 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 772a2ded5bb..93bc424e364 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -106,7 +106,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) ht->seed = (unsigned int)((now >> 32) ^ now ^ (apr_uintptr_t)pool ^ (apr_uintptr_t)ht ^ (apr_uintptr_t)&now) - 1; ht->array = alloc_array(ht, ht->max); - ht->hash_func = NULL; + ht->hash_func = apr_hashfunc_default; return ht; } @@ -207,9 +207,8 @@ static void expand_array(apr_hash_t *ht) ht->max = new_max; } -static unsigned int apr_hashfunc_default_internal(const char *char_key, - apr_ssize_t *klen, - unsigned int hash) +static unsigned int hashfunc_default(const char *char_key, apr_ssize_t *klen, + unsigned int hash) { const unsigned char *key = (const unsigned char *)char_key; const unsigned char *p; @@ -271,7 +270,7 @@ static unsigned int apr_hashfunc_default_internal(const char *char_key, APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, apr_ssize_t *klen) { - return apr_hashfunc_default_internal(char_key, klen, 0); + return hashfunc_default(char_key, klen, 0); } /* @@ -290,11 +289,10 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, { apr_hash_entry_t **hep, *he; unsigned int hash; + apr_ssize_t hlen = sizeof(hash); - if (ht->hash_func) - hash = ht->hash_func(key, &klen); - else - hash = apr_hashfunc_default_internal(key, &klen, ht->seed); + hash = ht->hash_func(key, &klen); + hash = hashfunc_default((char *)&hash, &hlen, ht->seed); /* scan linked list */ for (hep = &ht->array[hash & ht->max], he = *hep; @@ -435,6 +433,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, apr_hash_entry_t *iter; apr_hash_entry_t *ent; unsigned int i, j, k, hash; + apr_ssize_t hlen = sizeof(hash); #if APR_POOL_DEBUG /* we don't copy keys and values, so it's necessary that @@ -484,11 +483,8 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, for (k = 0; k <= overlay->max; k++) { for (iter = overlay->array[k]; iter; iter = iter->next) { - if (res->hash_func) - hash = res->hash_func(iter->key, &iter->klen); - else - hash = apr_hashfunc_default_internal(iter->key, &iter->klen, - res->seed); + hash = res->hash_func(iter->key, &iter->klen); + hash = hashfunc_default((char*)&hash, &hlen, res->seed); i = hash & res->max; for (ent = res->array[i]; ent; ent = ent->next) { if ((ent->klen == iter->klen) && From f472f92c0148e7a846f4f0b02e3c01a8100ebb3a Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Sun, 29 Jan 2012 07:49:30 +0000 Subject: [PATCH 7098/7878] Fix doxygen typos in apr_buckets.h. Patch by Hiroaki KAWAI . PR: 52521. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1237208 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_buckets.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/apr_buckets.h b/include/apr_buckets.h index 84d68102ea1..179ccd9af03 100644 --- a/include/apr_buckets.h +++ b/include/apr_buckets.h @@ -693,10 +693,10 @@ APR_DECLARE(apr_status_t) apr_brigade_cleanup(void *data) * @param b The brigade to split * @param e The first bucket to move * @param a The brigade which should be used for the result or NULL if - * a new brigade should be created. The brigade @param a will be + * a new brigade should be created. The brigade @a a will be * cleared if it is not empty. - * @return The brigade supplied in @param a or a new one if @param a was NULL. - * @warning Note that this function allocates a new brigade if @param a is + * @return The brigade supplied in @a a or a new one if @a a was NULL. + * @warning Note that this function allocates a new brigade if @a a is * NULL so memory consumption should be carefully considered. */ APR_DECLARE(apr_bucket_brigade *) apr_brigade_split_ex(apr_bucket_brigade *b, @@ -707,8 +707,8 @@ APR_DECLARE(apr_bucket_brigade *) apr_brigade_split_ex(apr_bucket_brigade *b, /** * Create a new bucket brigade and move the buckets from the tail end * of an existing brigade into the new brigade. Buckets from - * @param e to the last bucket (inclusively) of brigade @param b - * are moved from @param b to the returned brigade. + * @a e to the last bucket (inclusively) of brigade @a b + * are moved from @a b to the returned brigade. * @param b The brigade to split * @param e The first bucket to move * @return The new brigade From 687d47c0bda692eb600887c90d99c3db6bbd268f Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Sun, 29 Jan 2012 23:38:20 +0000 Subject: [PATCH 7099/7878] Revert r1237078 partially: do not hash the hash. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1237507 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_hash.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 93bc424e364..0bf4d28c294 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -106,7 +106,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) ht->seed = (unsigned int)((now >> 32) ^ now ^ (apr_uintptr_t)pool ^ (apr_uintptr_t)ht ^ (apr_uintptr_t)&now) - 1; ht->array = alloc_array(ht, ht->max); - ht->hash_func = apr_hashfunc_default; + ht->hash_func = NULL; return ht; } @@ -289,10 +289,11 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, { apr_hash_entry_t **hep, *he; unsigned int hash; - apr_ssize_t hlen = sizeof(hash); - hash = ht->hash_func(key, &klen); - hash = hashfunc_default((char *)&hash, &hlen, ht->seed); + if (ht->hash_func) + hash = ht->hash_func(key, &klen); + else + hash = hashfunc_default(key, &klen, ht->seed); /* scan linked list */ for (hep = &ht->array[hash & ht->max], he = *hep; @@ -433,7 +434,6 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, apr_hash_entry_t *iter; apr_hash_entry_t *ent; unsigned int i, j, k, hash; - apr_ssize_t hlen = sizeof(hash); #if APR_POOL_DEBUG /* we don't copy keys and values, so it's necessary that @@ -483,8 +483,10 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, for (k = 0; k <= overlay->max; k++) { for (iter = overlay->array[k]; iter; iter = iter->next) { - hash = res->hash_func(iter->key, &iter->klen); - hash = hashfunc_default((char*)&hash, &hlen, res->seed); + if (res->hash_func) + hash = res->hash_func(iter->key, &iter->klen); + else + hash = hashfunc_default(iter->key, &iter->klen, res->seed); i = hash & res->max; for (ent = res->array[i]; ent; ent = ent->next) { if ((ent->klen == iter->klen) && From 06a57ac6c41d66231d96df024791a2336e22da35 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 4 Feb 2012 09:45:16 +0000 Subject: [PATCH 7100/7878] Reserve a range of USERERR values for HTTPD git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1240472 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_errno.h b/include/apr_errno.h index b54dbe891db..57ad99269ca 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -158,6 +158,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * Subversion - Defined ranges, of less than 100, at intervals of 5000 * starting at an offset of 5000, e.g. * +5000 to 5100, +10000 to 10100 + * + * Apache HTTPD - +2000 to 2999 */ #define APR_OS_START_USERERR (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE) /** From e673f43db48f56e4e65e247cca08010906f19a02 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 1 Mar 2012 12:27:25 +0000 Subject: [PATCH 7101/7878] Use _WIN64 instead of WIN64 (compiler define vs. SDK define) in .c/.h. WIN64 wasn't defined, resulting in crashes in httpd. PR: 49155 Submitted by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1295535 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 4 ++-- shmem/win32/shm.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index 7312205337c..39bcbc6a35f 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -385,7 +385,7 @@ typedef long apr_off_t; typedef int apr_socklen_t; typedef apr_uint64_t apr_ino_t; -#ifdef WIN64 +#ifdef _WIN64 #define APR_SIZEOF_VOIDP 8 #else #define APR_SIZEOF_VOIDP 4 @@ -586,7 +586,7 @@ typedef apr_uint32_t apr_uintptr_t; * if ssize_t is a long int we define it to be "ld", * if ssize_t is 64-bit, we define it to be msvc specific "I64d" */ -#ifdef WIN64 +#ifdef _WIN64 #define APR_SSIZE_T_FMT "I64d" #define APR_SIZE_T_FMT "I64u" #else diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index d16de5469fb..117e4c81f45 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -82,7 +82,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* Compute the granualar multiple of the pagesize */ size = memblock * (1 + (reqsize - 1) / memblock); sizelo = (DWORD)size; -#ifdef WIN64 +#ifdef _WIN64 sizehi = (DWORD)(size >> 32); #else sizehi = 0; From b6cf7943a2adb637f71f23d2beb545f81ecbf6bd Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 1 Apr 2012 12:00:12 +0000 Subject: [PATCH 7102/7878] apr_crypto: Ensure the *driver variable is initialised when the library has already been loaded. Fix ported from apr_dbd. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1308087 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ crypto/apr_crypto.c | 22 +++++++--------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index ccbdf1f29cb..350a2bc3fcc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_crypto: Ensure the *driver variable is initialised when the library + has already been loaded. Fix ported from apr_dbd. [Graham Leggett] + *) apr_file_open: Avoid fcntl() calls if support for O_CLOEXEC works. PR 48557. [Mike Frysinger ] diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index a7eac07f7ea..7f67356f2fa 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -178,24 +178,16 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( #endif apr_snprintf(symname, sizeof(symname), "apr_crypto_%s_driver", name); rv = apu_dso_load(&dso, &symbol, modname, symname, pool); - if (rv != APR_SUCCESS) { /* APR_EDSOOPEN or APR_ESYMNOTFOUND? */ - if (rv == APR_EINIT) { /* previously loaded?!? */ - name = apr_pstrdup(pool, name); - apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver); - rv = APR_SUCCESS; - } - goto unlock; - } - *driver = symbol; - if ((*driver)->init) { - rv = (*driver)->init(pool, params, result); - } - if (rv == APR_SUCCESS) { + if (rv == APR_SUCCESS || rv == APR_EINIT) { /* previously loaded?!? */ + *driver = symbol; name = apr_pstrdup(pool, name); apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver); + rv = APR_SUCCESS; + if ((*driver)->init) { + rv = (*driver)->init(pool, params, result); + } } - - unlock: apu_dso_mutex_unlock(); + apu_dso_mutex_unlock(); if (APR_SUCCESS != rv && result && !*result) { char *buffer = apr_pcalloc(pool, ERROR_SIZE); From 6564dee12b5ea65c5f7476465bb50d45e3d88b2a Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 1 Apr 2012 14:46:16 +0000 Subject: [PATCH 7103/7878] Pass through the EXTRA_OBJECTS into the build. Allows the DSO modules to be built statically. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1308127 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 4042d9ff685..561718dd7b5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -32,6 +32,7 @@ APR_CONFIG = apr-$(APR_MAJOR_VERSION)-config INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ +EXTRA_OBJECTS = @EXTRA_OBJECTS@ APR_DSO_MODULES = @APR_DSO_MODULES@ LINK_MODULE = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(APRUTIL_LDFLAGS) -release $(APR_MAJOR_VERSION) -module -rpath $(APR_DSO_LIBDIR) APR_DSO_LIBDIR = @APR_DSO_LIBDIR@ @@ -119,8 +120,8 @@ install: install-modules $(TARGETS) done \ fi -$(TARGET_LIB): $(OBJECTS) - $(LINK) @lib_target@ $(ALL_LIBS) $(APRUTIL_EXPORT_LIBS) +$(TARGET_LIB): $(OBJECTS) $(EXTRA_OBJECTS) + $(LINK) @lib_target@ $(EXTRA_OBJECTS) $(ALL_LIBS) $(APRUTIL_EXPORT_LIBS) install-modules: install-modules-@APR_HAVE_MODULES@ From dcf4c9fda71e685ddac401543ed9e1236a65d7af Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 1 Apr 2012 15:16:54 +0000 Subject: [PATCH 7104/7878] apr_crypto: Ensure the *driver variable is initialised when a statically compiled library is initialised for the first time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1308131 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 7f67356f2fa..b7d937703c9 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -62,13 +62,14 @@ typedef struct apr_crypto_clear_t { } apr_crypto_clear_t; #if !APR_HAVE_MODULAR_DSO -#define DRIVER_LOAD(name,driver,pool,params,rv,result) \ +#define DRIVER_LOAD(name,driver_name,pool,params,rv,result) \ { \ - extern const apr_crypto_driver_t driver; \ - apr_hash_set(drivers,name,APR_HASH_KEY_STRING,&driver); \ - if (driver.init) { \ - rv = driver.init(pool, params, result); \ + extern const apr_crypto_driver_t driver_name; \ + apr_hash_set(drivers,name,APR_HASH_KEY_STRING,&driver_name); \ + if (driver_name.init) { \ + rv = driver_name.init(pool, params, result); \ } \ + *driver = &driver_name; \ } #endif From 1b3f30edc532d530c6279aaeab1ce40601ac2738 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 2 Apr 2012 12:29:57 +0000 Subject: [PATCH 7105/7878] apr_crypto: Ensure that the if/else that governs the static initialisation of each crypto driver works when the first driver isn't in use. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1308318 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ crypto/apr_crypto.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 350a2bc3fcc..c3e24a4c32e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_crypto: Ensure that the if/else that governs the static + initialisation of each crypto driver works when the first driver + isn't in use. [Graham Leggett] + *) apr_crypto: Ensure the *driver variable is initialised when the library has already been loaded. Fix ported from apr_dbd. [Graham Leggett] diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index b7d937703c9..396528d96f3 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -211,17 +211,17 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( } #endif #if APU_HAVE_NSS - else if (name[0] == 'n' && !strcmp(name, "nss")) { + if (name[0] == 'n' && !strcmp(name, "nss")) { DRIVER_LOAD("nss", apr_crypto_nss_driver, pool, params, rv, result); } #endif #if APU_HAVE_MSCAPI - else if (name[0] == 'm' && !strcmp(name, "mscapi")) { + if (name[0] == 'm' && !strcmp(name, "mscapi")) { DRIVER_LOAD("mscapi", apr_crypto_mscapi_driver, pool, params, rv, result); } #endif #if APU_HAVE_MSCNG - else if (name[0] == 'm' && !strcmp(name, "mscng")) { + if (name[0] == 'm' && !strcmp(name, "mscng")) { DRIVER_LOAD("mscng", apr_crypto_mscng_driver, pool, params, rv, result); } #endif From a834ae9633486d70d19d856a47fe42a3d56c2f05 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 2 Apr 2012 12:53:27 +0000 Subject: [PATCH 7106/7878] And now take it all out again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1308329 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 ------- 1 file changed, 7 deletions(-) diff --git a/CHANGES b/CHANGES index c3e24a4c32e..ccbdf1f29cb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,13 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) apr_crypto: Ensure that the if/else that governs the static - initialisation of each crypto driver works when the first driver - isn't in use. [Graham Leggett] - - *) apr_crypto: Ensure the *driver variable is initialised when the library - has already been loaded. Fix ported from apr_dbd. [Graham Leggett] - *) apr_file_open: Avoid fcntl() calls if support for O_CLOEXEC works. PR 48557. [Mike Frysinger ] From 99c10ed1830e9d0399b74381e3c5f60478e512e2 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 3 Apr 2012 13:48:06 +0000 Subject: [PATCH 7107/7878] support for thread-hopping apr_pollset_* using z/OS async i/o. no support for apr_pollcb yet. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1308910 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 + include/apr_poll.h | 1 + include/arch/unix/apr_arch_poll_private.h | 10 +- poll/unix/pollset.c | 8 + poll/unix/z_asio.c | 741 ++++++++++++++++++++++ 5 files changed, 761 insertions(+), 1 deletion(-) create mode 100644 poll/unix/z_asio.c diff --git a/configure.in b/configure.in index 1aeddb7daad..b945bebccda 100644 --- a/configure.in +++ b/configure.in @@ -1271,6 +1271,7 @@ dnl ----------------------------- Checks for Any required Headers AC_HEADER_STDC APR_FLAG_HEADERS( + aio.h \ ByteOrder.h \ conio.h \ crypt.h \ @@ -1368,6 +1369,7 @@ else netinet_tcph=0 fi +AC_SUBST(aioh) AC_SUBST(arpa_ineth) AC_SUBST(conioh) AC_SUBST(ctypeh) diff --git a/include/apr_poll.h b/include/apr_poll.h index 02c1275a87d..a113204f1f0 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -77,6 +77,7 @@ typedef enum { APR_POLLSET_KQUEUE, /**< Poll uses kqueue method */ APR_POLLSET_PORT, /**< Poll uses Solaris event port method */ APR_POLLSET_EPOLL, /**< Poll uses epoll method */ + APR_POLLSET_ASIO, /**< Poll uses z/OS async i/o method */ APR_POLLSET_POLL /**< Poll uses poll method */ } apr_pollset_method_e; diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index a82c3810754..9a8eea90639 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -45,6 +45,11 @@ #define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0 #endif +#ifdef HAVE_AIO_H +#define _AIO_OS390 /* enable a bunch of z/OS aio.h definitions */ +#include /* aiocb */ +#endif + /* Choose the best method platform specific to use in apr_pollset */ #ifdef HAVE_KQUEUE #define POLLSET_USES_KQUEUE @@ -55,6 +60,9 @@ #elif defined(HAVE_EPOLL) #define POLLSET_USES_EPOLL #define POLLSET_DEFAULT_METHOD APR_POLLSET_EPOLL +#elif defined(HAVE_AIO_H) +#define POLLSET_USES_ASIO +#define POLLSET_DEFAULT_METHOD APR_POLLSET_ASIO #elif defined(HAVE_POLL) #define POLLSET_USES_POLL #define POLLSET_DEFAULT_METHOD APR_POLLSET_POLL @@ -75,7 +83,7 @@ #endif #endif -#if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT) +#if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT) || defined(POLLSET_USES_ASIO) #include "apr_ring.h" diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index f8a12d235b9..5bc496c15b2 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -52,6 +52,9 @@ extern apr_pollset_provider_t *apr_pollset_provider_port; #if defined(HAVE_EPOLL) extern apr_pollset_provider_t *apr_pollset_provider_epoll; #endif +#if defined(HAVE_AIO_H) +extern apr_pollset_provider_t *apr_pollset_provider_asio; +#endif #if defined(HAVE_POLL) extern apr_pollset_provider_t *apr_pollset_provider_poll; #endif @@ -74,6 +77,11 @@ static apr_pollset_provider_t *pollset_provider(apr_pollset_method_e method) case APR_POLLSET_EPOLL: #if defined(HAVE_EPOLL) provider = apr_pollset_provider_epoll; +#endif + break; + case APR_POLLSET_ASIO: +#if defined(HAVE_AIO_H) + provider = apr_pollset_provider_asio; #endif break; case APR_POLLSET_POLL: diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c new file mode 100644 index 00000000000..dec620dc5ea --- /dev/null +++ b/poll/unix/z_asio.c @@ -0,0 +1,741 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + ****************************************************************************** + * + * This implementation is based on the z/OS sockets async i/o facility. When a + * socket is added to the pollset, an async poll is issued for that individual + * socket. It specifies that the kernel should send an IPC message when the + * socket becomes ready. The IPC messages are sent to a single message queue + * that is part of the pollset. apr_pollset_poll waits on the arrival of IPC + * messages or the specified timeout. + * + * Since z/OS does not support async i/o for pipes or files at present, this + * implementation falls back to using ordinary poll() when + * APR_POLLSET_THREADSAFE is unset. + * + * Greg Ames + * April 2012 + */ + +#include "apr.h" +#include "apr_hash.h" +#include "apr_poll.h" +#include "apr_time.h" +#include "apr_portable.h" +#include "apr_arch_inherit.h" +#include "apr_arch_file_io.h" +#include "apr_arch_networkio.h" +#include "apr_arch_poll_private.h" + +#ifdef HAVE_AIO_H + +#include /* msgget etc */ +#include /* timestruct */ +#include /* pollfd */ +#include /* MAX_INT */ + +struct apr_pollset_private_t +{ + int msg_q; /* IPC message queue. The z/OS kernel sends messages + * to this queue when our async polls on individual + * file descriptors complete + */ + apr_pollfd_t *result_set; + apr_uint32_t size; + +#if APR_HAS_THREADS + /* A thread mutex to protect operations on the rings and the hash */ + apr_thread_mutex_t *ring_lock; +#endif + + /* A hash of all active elements used for O(1) garbage collection */ + apr_hash_t *elems; + + APR_RING_HEAD(ready_ring_t, asio_elem_t) ready_ring; + APR_RING_HEAD(prior_ready_ring_t, asio_elem_t) prior_ready_ring; + APR_RING_HEAD(free_ring_t, asio_elem_t) free_ring; + + /* for pipes etc with no asio */ + struct pollfd *pollset; + apr_pollfd_t *query_set; +}; + +typedef enum { + ASIO_INIT = 0, + ASIO_CANCELLED +} asio_state_e; + +typedef struct asio_elem_t asio_elem_t; + +struct asio_msgbuf_t { + long msg_type; /* must be > 0 */ + asio_elem_t *msg_elem; +}; + +struct asio_elem_t +{ + APR_RING_ENTRY(asio_elem_t) link; + apr_pollfd_t pfd; + struct pollfd os_pfd; + struct aiocb a; + asio_state_e state; + struct asio_msgbuf_t msg; +}; + +#define DEBUG 0 + +/* DEBUG settings: 0 - no debug messages at all, + * 1 - should not occur messages, + * 2 - apr_pollset_* entry and exit messages, + * 3 - state changes, memory usage, + * 4 - z/OS, APR, and internal calls, + * 5 - everything else except the timer pop path, + * 6 - everything, including the Event 1 sec timer pop path + * + * each DEBUG level includes all messages produced by lower numbered levels + */ + +#if DEBUG + +#include +#include /* getpid */ + +#define DBG_BUFF char dbg_msg_buff[256]; + +#define DBG_TEST(lvl) if (lvl <= DEBUG) { + +#define DBG_CORE(msg) sprintf(dbg_msg_buff, "% 8d " __FUNCTION__ \ + " " msg, getpid()), \ + fprintf(stderr, "%s", dbg_msg_buff); +#define DBG_CORE1(msg, var1) sprintf(dbg_msg_buff, "% 8d " __FUNCTION__ \ + " " msg, getpid(), var1), \ + fprintf(stderr, "%s", dbg_msg_buff); +#define DBG_CORE2(msg, var1, var2) sprintf(dbg_msg_buff, "% 8d " __FUNCTION__ \ + " " msg, getpid(), var1, var2), \ + fprintf(stderr, "%s", dbg_msg_buff); +#define DBG_CORE3(msg, var1, var2, var3) \ + sprintf(dbg_msg_buff, "% 8d " __FUNCTION__ \ + " " msg, getpid(), var1, var2, var3), \ + fprintf(stderr, "%s", dbg_msg_buff); +#define DBG_CORE4(msg, var1, var2, var3, var4) \ + sprintf(dbg_msg_buff, "% 8d " __FUNCTION__ \ + " " msg, getpid(), var1, var2, var3, var4),\ + fprintf(stderr, "%s", dbg_msg_buff); + +#define DBG_END } + +#define DBG(lvl, msg) DBG_TEST(lvl) \ + DBG_CORE(msg) \ + DBG_END + +#define DBG1(lvl, msg, var1) DBG_TEST(lvl) \ + DBG_CORE1(msg, var1) \ + DBG_END + +#define DBG2(lvl, msg, var1, var2) DBG_TEST(lvl) \ + DBG_CORE2(msg, var1, var2) \ + DBG_END + +#define DBG3(lvl, msg, var1, var2, var3) \ + DBG_TEST(lvl) \ + DBG_CORE3(msg, var1, var2, var3) \ + DBG_END + +#define DBG4(lvl, msg, var1, var2, var3, var4) \ + DBG_TEST(lvl) \ + DBG_CORE4(msg, var1, var2, var3, var4) \ + DBG_END + +#else /* DEBUG is 0 */ +#define DBG_BUFF +#define DBG(lvl, msg) ((void)0) +#define DBG1(lvl, msg, var1) ((void)0) +#define DBG2(lvl, msg, var1, var2) ((void)0) +#define DBG3(lvl, msg, var1, var2, var3) ((void)0) +#define DBG4(lvl, msg, var1, var2, var3, var4) ((void)0) + +#endif /* DEBUG */ + +static int asyncio(asio_elem_t *elem) +{ + DBG_BUFF + int rv; + +#ifdef _LP64 +#define AIO BPX4AIO +#else +#define AIO BPX1AIO +#endif + + AIO(sizeof(struct aiocb), &(elem->a), &rv, &errno, __err2ad()); + DBG3(4, "BPX4AIO aiocb %p elem %p rv %d\n", + &(elem->a), elem, rv); +#ifdef DEBUG + if (rv < 0) { + DBG2(4, "errno %d errnojr %08x\n", + errno, *__err2ad()); + } +#endif + return rv; +} + +static apr_int16_t get_event(apr_int16_t event) +{ + DBG_BUFF + apr_int16_t rv = 0; + DBG(4, "entered\n"); + + if (event & APR_POLLIN) + rv |= POLLIN; + if (event & APR_POLLPRI) + rv |= POLLPRI; + if (event & APR_POLLOUT) + rv |= POLLOUT; + if (event & APR_POLLERR) + rv |= POLLERR; + if (event & APR_POLLHUP) + rv |= POLLHUP; + if (event & APR_POLLNVAL) + rv |= POLLNVAL; + + DBG(4, "exiting\n"); + return rv; +} + +static apr_int16_t get_revent(apr_int16_t event) +{ + DBG_BUFF + apr_int16_t rv = 0; + DBG(4, "entered\n"); + + if (event & POLLIN) + rv |= APR_POLLIN; + if (event & POLLPRI) + rv |= APR_POLLPRI; + if (event & POLLOUT) + rv |= APR_POLLOUT; + if (event & POLLERR) + rv |= APR_POLLERR; + if (event & POLLHUP) + rv |= APR_POLLHUP; + if (event & POLLNVAL) + rv |= APR_POLLNVAL; + + DBG(4, "exiting\n"); + return rv; +} + +static apr_status_t asio_pollset_cleanup(apr_pollset_t *pollset) +{ + DBG_BUFF + int rv; + + DBG(4, "entered\n"); + rv = msgctl(pollset->p->msg_q, IPC_RMID, NULL); + + DBG1(4, "exiting, msgctl(IPC_RMID) returned %d\n", rv); + return rv; +} + +static apr_status_t asio_pollset_create(apr_pollset_t *pollset, + apr_uint32_t size, + apr_pool_t *p, + apr_uint32_t flags) +{ + DBG_BUFF + apr_status_t rv; + apr_pollset_private_t *priv; + + DBG1(2, "entered, flags: %x\n", flags); + + priv = pollset->p = apr_palloc(p, sizeof(*priv)); + + if (flags & APR_POLLSET_THREADSAFE) { +#if APR_HAS_THREADS + if (rv = apr_thread_mutex_create(&(priv->ring_lock), + APR_THREAD_MUTEX_DEFAULT, + p) != APR_SUCCESS) { + DBG1(1, "apr_thread_mutex_create returned %d\n", rv); + pollset = NULL; + return rv; + } + rv = msgget(IPC_PRIVATE, S_IWUSR+S_IRUSR); /* user r/w perms */ + if (rv < 0) { +#if DEBUG + perror(__FUNCTION__ " msgget returned < 0 "); +#endif + pollset = NULL; + return rv; + } + + DBG2(4, "pollset %p msgget was OK, rv=%d\n", pollset, rv); + priv->msg_q = rv; + priv->elems = apr_hash_make(p); + + APR_RING_INIT(&priv->free_ring, asio_elem_t, link); + APR_RING_INIT(&priv->prior_ready_ring, asio_elem_t, link); + +#else /* APR doesn't have threads but caller wants a threadsafe pollset */ + pollset = NULL; + return APR_ENOTIMPL; +#endif + + } else { /* APR_POLLSET_THREADSAFE not set, i.e. no async i/o, + * init fields only needed in old style pollset + */ + + priv->pollset = apr_palloc(p, size * sizeof(struct pollfd)); + priv->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + + if ((!priv->pollset) || (!priv->query_set)) { + return APR_ENOMEM; + } + } + + pollset->nelts = 0; + pollset->flags = flags; + pollset->pool = p; + priv->size = size; + priv->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + if (!priv->result_set) { + return APR_ENOMEM; + } + + DBG2(2, "exiting, pollset: %p, type: %s\n", + pollset, + flags & APR_POLLSET_THREADSAFE ? "async" : "POSIX"); + + + return APR_SUCCESS; + +} /* end of asio_pollset_create */ + +static apr_status_t posix_add(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) +{ + DBG_BUFF + int fd; + apr_pool_t *p = pollset->pool; + apr_pollset_private_t *priv = pollset->p; + + DBG(4, "entered\n"); + + if (pollset->nelts == priv->size) { + return APR_ENOMEM; + } + + priv->query_set[pollset->nelts] = *descriptor; + if (descriptor->desc_type == APR_POLL_SOCKET) { + fd = descriptor->desc.s->socketdes; + } + else { + fd = descriptor->desc.f->filedes; + } + + priv->pollset[pollset->nelts].fd = fd; + + priv->pollset[pollset->nelts].events = + get_event(descriptor->reqevents); + + pollset->nelts++; + + DBG2(4, "exiting, fd %d added to pollset %p\n", fd, pollset); + + return APR_SUCCESS; +} /* end of posix_add */ + + +static apr_status_t asio_pollset_add(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) +{ + DBG_BUFF + asio_elem_t *elem; + apr_status_t rv = APR_SUCCESS; + apr_pollset_private_t *priv = pollset->p; + + pollset_lock_rings(); + DBG(2, "entered\n"); + + if (pollset->flags & APR_POLLSET_THREADSAFE) { + + if (!APR_RING_EMPTY(&(priv->free_ring), asio_elem_t, link)) { + elem = APR_RING_FIRST(&(priv->free_ring)); + APR_RING_REMOVE(elem, link); + DBG1(3, "used recycled memory at %08p\n", elem); + elem->state = ASIO_INIT; + } + else { + elem = (asio_elem_t *) apr_pcalloc(pollset->pool, sizeof(asio_elem_t)); + DBG1(3, "alloced new memory at %08p\n", elem); + + elem->a.aio_notifytype = AIO_MSGQ; + elem->a.aio_msgev_qid = priv->msg_q; + DBG1(5, "aio_msgev_quid = %d \n", elem->a.aio_msgev_qid); + elem->a.aio_msgev_size = sizeof(asio_elem_t *); + elem->a.aio_msgev_flag = 0; /* wait if queue is full */ + elem->a.aio_msgev_addr = &(elem->msg); + elem->a.aio_buf = &(elem->os_pfd); + elem->a.aio_nbytes = 1; /* number of pfds to poll */ + elem->msg.msg_type = 1; + elem->msg.msg_elem = elem; + } + + /* z/OS only supports async I/O for sockets for now */ + elem->os_pfd.fd = descriptor->desc.s->socketdes; + + APR_RING_ELEM_INIT(elem, link); + elem->a.aio_cmd = AIO_SELPOLL; + elem->a.aio_cflags &= ~AIO_OK2COMPIMD; /* not OK to complete inline*/ + elem->pfd = *descriptor; + elem->os_pfd.events = get_event(descriptor->reqevents); + + if (0 != asyncio(elem)) { + rv = errno; + DBG3(4, "pollset %p asio failed fd %d, errno %p\n", + pollset, elem->os_pfd.fd, rv); +#if DEBUG + perror(__FUNCTION__ " asio failure"); +#endif + } + else { + DBG2(4, "good asio call, adding fd %d to pollset %p\n", + elem->os_pfd.fd, pollset); + + pollset->nelts++; + apr_hash_set(priv->elems, &(elem->os_pfd.fd), sizeof(int), elem); + } + } + else { + /* APR_POLLSET_THREADSAFE isn't set. use POSIX poll in case + * pipes or files are used with this pollset + */ + + rv = posix_add(pollset, descriptor); + } + + DBG1(2, "exiting, rv = %d\n", rv); + + pollset_unlock_rings(); + return rv; +} /* end of asio_pollset_add */ + +static posix_remove(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) +{ + DBG_BUFF + apr_uint32_t i; + apr_pollset_private_t *priv = pollset->p; + + DBG(4, "entered\n"); + for (i = 0; i < pollset->nelts; i++) { + if (descriptor->desc.s == priv->query_set[i].desc.s) { + /* Found an instance of the fd: remove this and any other copies */ + apr_uint32_t dst = i; + apr_uint32_t old_nelts = pollset->nelts; + pollset->nelts--; + for (i++; i < old_nelts; i++) { + if (descriptor->desc.s == priv->query_set[i].desc.s) { + pollset->nelts--; + } + else { + priv->pollset[dst] = priv->pollset[i]; + priv->query_set[dst] = priv->query_set[i]; + dst++; + } + } + DBG(4, "returning OK\n"); + return APR_SUCCESS; + } + } + + DBG(1, "returning APR_NOTFOUND\n"); + return APR_NOTFOUND; + +} /* end of posix_remove */ + +static apr_status_t asio_pollset_remove(apr_pollset_t *pollset, + const apr_pollfd_t *descriptor) +{ + DBG_BUFF + asio_elem_t *elem; + apr_status_t rv = APR_SUCCESS; + apr_pollset_private_t *priv = pollset->p; + + int fd; + + DBG(2, "entered\n"); + + if (!(pollset->flags & APR_POLLSET_THREADSAFE)) { + return posix_remove(pollset, descriptor); + } + + pollset_lock_rings(); + +#if DEBUG + assert(descriptor->desc_type == APR_POLL_SOCKET); +#endif + /* zOS 1.12 doesn't support files for async i/o */ + fd = descriptor->desc.s->socketdes; + + elem = apr_hash_get(priv->elems, &(fd), sizeof(int)); + if (elem == NULL) { + DBG1(1, "couldn't find fd %d\n", fd); + rv = APR_NOTFOUND; + } else { + DBG1(5, "hash found fd %d\n", fd); + /* delete this fd from the hash */ + apr_hash_set(priv->elems, &(fd), sizeof(int), NULL); + /* asyncio call to cancel */ + elem->a.aio_cmd = AIO_CANCEL; + + /* elem->a.aio_cflags = AIO_CANCELNONOTIFY; */ + /* we want *msgrcv to collect cancel notifications to remove races + * in garbage collection */ + + rv = asyncio(elem); + DBG1(4, "asyncio returned %d\n", rv); + + if (rv == 1) { + elem->state = ASIO_CANCELLED; + rv = APR_SUCCESS; + } + } + + DBG1(2, "exiting, rv: %d\n", rv); + + pollset_unlock_rings(); + + return rv; +} /* end of asio_pollset_remove */ + +static posix_poll(apr_pollset_t *pollset, + apr_interval_time_t timeout, + apr_int32_t *num, + const apr_pollfd_t **descriptors) +{ + DBG_BUFF + int rv; + apr_uint32_t i, j; + apr_pollset_private_t *priv = pollset->p; + + DBG(4, "entered\n"); + + if (timeout > 0) { + timeout /= 1000; + } + rv = poll(priv->pollset, pollset->nelts, timeout); + (*num) = rv; + if (rv < 0) { + return apr_get_netos_error(); + } + if (rv == 0) { + return APR_TIMEUP; + } + j = 0; + for (i = 0; i < pollset->nelts; i++) { + if (priv->pollset[i].revents != 0) { + priv->result_set[j] = priv->query_set[i]; + priv->result_set[j].rtnevents = + get_revent(priv->pollset[i].revents); + j++; + } + } + if (descriptors) + *descriptors = priv->result_set; + + DBG(4, "exiting ok\n"); + return APR_SUCCESS; + +} /* end of posix_poll */ + +static process_msg(apr_pollset_t *pollset, struct asio_msgbuf_t *msg) +{ + DBG_BUFF + asio_elem_t *elem = msg->msg_elem; + + if (elem->state == ASIO_CANCELLED) { + DBG2(5, "for cancelled elem, recycling memory - elem %08p, fd %d\n", + elem, elem->os_pfd.fd); + APR_RING_INSERT_TAIL(&(pollset->p->free_ring), elem, + asio_elem_t, link); + } else { + DBG2(4, "adding to ready ring: elem %08p, fd %d\n", + elem, elem->os_pfd.fd); + APR_RING_INSERT_TAIL(&(pollset->p->ready_ring), elem, + asio_elem_t, link); + } +} + +static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, + apr_interval_time_t timeout, + apr_int32_t *num, + const apr_pollfd_t **descriptors) +{ + DBG_BUFF + int i, ret; + asio_elem_t *elem, *next_elem; + struct asio_msgbuf_t msg_buff; + struct timespec tv; + apr_status_t rv = APR_SUCCESS; + apr_pollset_private_t *priv = pollset->p; + + DBG(6, "entered\n"); /* chatty - traces every second w/Event */ + + if ((pollset->flags & APR_POLLSET_THREADSAFE) == 0 ) { + return posix_poll(pollset, timeout, num, descriptors); + } + + pollset_lock_rings(); + APR_RING_INIT(&(priv->ready_ring), asio_elem_t, link); + + while (!APR_RING_EMPTY(&(priv->prior_ready_ring), asio_elem_t, link)) { + elem = APR_RING_FIRST(&(priv->prior_ready_ring)); + DBG3(5, "pollset %p elem %p fd %d on prior ready ring\n", + pollset, + elem, + elem->os_pfd.fd); + + APR_RING_REMOVE(elem, link); + + /* + * since USS does not remember what's in our pollset, we have + * to re-add fds which have not been apr_pollset_remove'd + * + * there may have been too many ready fd's to return in the + * result set last time. re-poll inline for both cases + */ + + if (elem->state == ASIO_CANCELLED) { + continue; /* do not re-add if it has been _removed */ + } + + elem->a.aio_cflags = AIO_OK2COMPIMD; + + if (0 != (ret = asyncio(elem))) { + if (ret == 1) { + DBG(4, "asyncio() completed inline\n"); + /* it's ready now */ + APR_RING_INSERT_TAIL(&(priv->ready_ring), elem, asio_elem_t, + link); + } + else { + DBG2(1, "asyncio() failed, ret: %d, errno: %d\n", + ret, errno); + pollset_unlock_rings(); + return errno; + } + } + DBG1(4, "asyncio() completed rc %d\n", ret); + } + + DBG(6, "after prior ready loop\n"); /* chatty w/timeouts, hence 6 */ + + /* Gather async poll completions that have occurred since the last call */ + while (0 < msgrcv(priv->msg_q, &msg_buff, sizeof(asio_elem_t *), 0, + IPC_NOWAIT)) { + process_msg(pollset, &msg_buff); + } + + /* Suspend if nothing is ready yet. */ + if (APR_RING_EMPTY(&(priv->ready_ring), asio_elem_t, link)) { + + if (timeout >= 0) { + tv.tv_sec = apr_time_sec(timeout); + tv.tv_nsec = apr_time_usec(timeout) * 1000; + } else { + tv.tv_sec = INT_MAX; /* block until something is ready */ + } + + DBG2(6, "nothing on the ready ring " + "- blocking for %d seconds %d ns\n", + tv.tv_sec, tv.tv_nsec); + + pollset_unlock_rings(); /* allow other apr_pollset_* calls while blocked */ + + if (0 >= (ret = __msgrcv_timed(priv->msg_q, &msg_buff, + sizeof(asio_elem_t *), 0, NULL, &tv))) { +#if DEBUG + if (errno == EAGAIN) { + DBG(6, "__msgrcv_timed timed out\n"); /* timeout path, so 6 */ + } + else { + DBG(1, "__msgrcv_timed failed!\n"); + } +#endif + return (errno == EAGAIN) ? APR_TIMEUP : errno; + } + + pollset_lock_rings(); + + process_msg(pollset, &msg_buff); + } + + APR_RING_INIT(&priv->prior_ready_ring, asio_elem_t, link); + + (*num) = 0; + elem = APR_RING_FIRST(&(priv->ready_ring)); + + for (i = 0; + + i < priv->size + && elem != APR_RING_SENTINEL(&(priv->ready_ring), asio_elem_t, link); + i++) { + DBG2(5, "ready ring: elem %08p, fd %d\n", elem, elem->os_pfd.fd); + + priv->result_set[i] = elem->pfd; + priv->result_set[i].rtnevents + = get_revent(elem->os_pfd.revents); + (*num)++; + + elem = APR_RING_NEXT(elem, link); + +#if DEBUG + if (elem == APR_RING_SENTINEL(&(priv->ready_ring), asio_elem_t, link)) { + DBG(5, "end of ready ring reached\n"); + } +#endif + } + + if (descriptors) { + *descriptors = priv->result_set; + } + + /* if the result size is too small, remember which descriptors + * haven't had results reported yet. we will look + * at these descriptors on the next apr_pollset_poll call + */ + + APR_RING_CONCAT(&priv->prior_ready_ring, &(priv->ready_ring), asio_elem_t, link); + + DBG1(2, "exiting, rv = %d\n", rv); + + pollset_unlock_rings(); + + return rv; +} /* end of asio_pollset_poll */ + +static apr_pollset_provider_t impl = { + asio_pollset_create, + asio_pollset_add, + asio_pollset_remove, + asio_pollset_poll, + asio_pollset_cleanup, + "asio" +}; + +apr_pollset_provider_t *apr_pollset_provider_asio = &impl; + +#endif /* __MVS__ */ From 16d42ab112271a84f1f03fbdc3c22453cadc8405 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 3 Apr 2012 14:07:38 +0000 Subject: [PATCH 7108/7878] apr buildbot is dying trying to compile z/OS unique source. apparently it found an aio.h header file. add a test for the intended platform too. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1308923 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_poll_private.h | 4 ++-- poll/unix/z_asio.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index 9a8eea90639..eab61a8e670 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -45,7 +45,7 @@ #define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0 #endif -#ifdef HAVE_AIO_H +#if defined(HAVE_AIO_H) && defined(__MVS__) #define _AIO_OS390 /* enable a bunch of z/OS aio.h definitions */ #include /* aiocb */ #endif @@ -60,7 +60,7 @@ #elif defined(HAVE_EPOLL) #define POLLSET_USES_EPOLL #define POLLSET_DEFAULT_METHOD APR_POLLSET_EPOLL -#elif defined(HAVE_AIO_H) +#elif defined(HAVE_AIO_H) && defined(__MVS__) #define POLLSET_USES_ASIO #define POLLSET_DEFAULT_METHOD APR_POLLSET_ASIO #elif defined(HAVE_POLL) diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index dec620dc5ea..7cab7197f3b 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -41,7 +41,7 @@ #include "apr_arch_networkio.h" #include "apr_arch_poll_private.h" -#ifdef HAVE_AIO_H +#if defined(HAVE_AIO_H) && defined(__MVS__) #include /* msgget etc */ #include /* timestruct */ @@ -738,4 +738,4 @@ static apr_pollset_provider_t impl = { apr_pollset_provider_t *apr_pollset_provider_asio = &impl; -#endif /* __MVS__ */ +#endif /* HAVE_ASIO && __MVS__ */ From a8ef6b0fb2589abdc7747ce6b0b56c5b02a92253 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 3 Apr 2012 14:29:38 +0000 Subject: [PATCH 7109/7878] one more HAVE_AIO_H that is intented for z/OS only git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1308938 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index 5bc496c15b2..f422d4c8e33 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -52,7 +52,7 @@ extern apr_pollset_provider_t *apr_pollset_provider_port; #if defined(HAVE_EPOLL) extern apr_pollset_provider_t *apr_pollset_provider_epoll; #endif -#if defined(HAVE_AIO_H) +#if defined(HAVE_AIO_H) && defined(__MVS__) extern apr_pollset_provider_t *apr_pollset_provider_asio; #endif #if defined(HAVE_POLL) From 95fe7e5dc65205c55352d1c668af2199b19066e1 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 3 Apr 2012 14:38:59 +0000 Subject: [PATCH 7110/7878] qualify another HAVE_AIO_H reference git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1308950 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index f422d4c8e33..ef894b2ee9f 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -80,7 +80,7 @@ static apr_pollset_provider_t *pollset_provider(apr_pollset_method_e method) #endif break; case APR_POLLSET_ASIO: -#if defined(HAVE_AIO_H) +#if defined(HAVE_AIO_H) && defined(__MVS__) provider = apr_pollset_provider_asio; #endif break; From 328c6dfcddb97335d84e6090d936ed78da974b62 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Wed, 4 Apr 2012 11:20:43 +0000 Subject: [PATCH 7111/7878] Fix apr_mcast_hops returning EINVAL for IPv6 sockets. The soket option value is supposed to be 4 not 1 byte. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1309332 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/multicast.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index 7b4978995cc..18786b4d415 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -217,6 +217,7 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, } } else if (sock_is_ipv6(sock)) { + unsigned int hopsopt = value; if (type == IP_MULTICAST_TTL) { type = IPV6_MULTICAST_HOPS; } @@ -225,7 +226,7 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, } if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - &value, sizeof(value)) == -1) { + (const void *) &hopsopt, sizeof(hopsopt)) == -1) { rv = errno; } } From 93347ff82f295a7b16f145a1b508f65d2a4e8591 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Wed, 4 Apr 2012 11:34:44 +0000 Subject: [PATCH 7112/7878] Add testsuite for r1309332 fix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1309336 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsockets.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testsockets.c b/test/testsockets.c index 2c0bb576ac4..2a7499aa781 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -129,6 +129,10 @@ static void sendto_receivefrom_helper(abts_case *tc, const char *addr, rv = apr_socket_bind(sock, to); APR_ASSERT_SUCCESS(tc, "Could not bind socket", rv); + if (rv != APR_SUCCESS) + return; + rv = apr_mcast_hops(sock, 10); + APR_ASSERT_SUCCESS(tc, "Could not set multicast hops", rv); if (rv != APR_SUCCESS) return; From 947d0b9bad6027e2abbfad15ddc558926930bf4d Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Wed, 4 Apr 2012 11:53:00 +0000 Subject: [PATCH 7113/7878] ... and update changelog for mcast TTL fix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1309344 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index ccbdf1f29cb..48c60cb526d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_mcast_hops: Fix EINVAL for IPv6 sockets caused by using byte + instead integer for setsockopt. [Mladen Turk] + *) apr_file_open: Avoid fcntl() calls if support for O_CLOEXEC works. PR 48557. [Mike Frysinger ] From 04f4e54e1dd1cb2709aff5e27eeb61afd80b2bab Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Wed, 4 Apr 2012 13:33:26 +0000 Subject: [PATCH 7114/7878] Make sure the IPv4 setsockopt also uses 4 byte optval type. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1309376 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/multicast.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index 18786b4d415..81051a18d1a 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -197,7 +197,7 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock, } static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, - apr_byte_t value) + apr_uint32_t value) { apr_status_t rv = APR_SUCCESS; @@ -209,15 +209,13 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, } #if APR_HAVE_IPV6 else if (sock_is_ipv6(sock) && type == IP_MULTICAST_LOOP) { - unsigned int loopopt = value; type = IPV6_MULTICAST_LOOP; if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - (const void *) &loopopt, sizeof(loopopt)) == -1) { + (const void *) &value, sizeof(value)) == -1) { rv = errno; } } else if (sock_is_ipv6(sock)) { - unsigned int hopsopt = value; if (type == IP_MULTICAST_TTL) { type = IPV6_MULTICAST_HOPS; } @@ -226,7 +224,7 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, } if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - (const void *) &hopsopt, sizeof(hopsopt)) == -1) { + (const void *) &value, sizeof(value)) == -1) { rv = errno; } } From c532d40eca7727f92febffdfb2e9580dad6ade95 Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Wed, 4 Apr 2012 13:39:48 +0000 Subject: [PATCH 7115/7878] Simplify internal do_mcast_opt option path. No need for double checks and double code git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1309379 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/multicast.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index 81051a18d1a..d6e2ca7b7fc 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -208,17 +208,13 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, } } #if APR_HAVE_IPV6 - else if (sock_is_ipv6(sock) && type == IP_MULTICAST_LOOP) { - type = IPV6_MULTICAST_LOOP; - if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - (const void *) &value, sizeof(value)) == -1) { - rv = errno; - } - } else if (sock_is_ipv6(sock)) { if (type == IP_MULTICAST_TTL) { type = IPV6_MULTICAST_HOPS; } + else if (type == IP_MULTICAST_LOOP) { + type = IPV6_MULTICAST_LOOP; + } else { return APR_ENOTIMPL; } From 5fa6482ac77641a6cdf05df16641fad92df01dc4 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 13 Apr 2012 20:54:35 +0000 Subject: [PATCH 7116/7878] z/OS "threadsafe" apr_pollset_poll depends on async i/o feeding an IPC message queue. Create a configure test for that combo and test it elsewhere. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1325944 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 19 +++++++++++++++++++ include/apr_poll.h | 2 +- include/arch/unix/apr_arch_poll_private.h | 15 ++++++++------- poll/unix/pollset.c | 10 +++++----- poll/unix/z_asio.c | 6 +++--- 5 files changed, 36 insertions(+), 16 deletions(-) diff --git a/configure.in b/configure.in index b945bebccda..3a17628a5f8 100644 --- a/configure.in +++ b/configure.in @@ -885,6 +885,25 @@ if test "$apr_cv_epoll_create1" = "yes"; then AC_DEFINE([HAVE_EPOLL_CREATE1], 1, [Define if epoll_create1 function is supported]) fi +# Check for z/OS async i/o support. +AC_CACHE_CHECK([for asio -> message queue support], [apr_cv_aio_msgq], +[AC_TRY_RUN([ +#define _AIO_OS390 +#include + +int main() +{ + struct aiocb a; + + a.aio_notifytype = AIO_MSGQ; /* use IPC message queue for notification */ + + return aio_cancel(2, NULL) == -1; +}], [apr_cv_aio_msgq=yes], [apr_cv_aio_msgq=no], [apr_cv_aio_msgq=no])]) + +if test "$apr_cv_aio_msgq" = "yes"; then + AC_DEFINE([HAVE_AIO_MSGQ], 1, [Define if async i/o supports message q's]) +fi + # test for dup3 AC_CACHE_CHECK([for dup3 support], [apr_cv_dup3], [AC_TRY_RUN([ diff --git a/include/apr_poll.h b/include/apr_poll.h index a113204f1f0..9cdd0746c27 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -77,7 +77,7 @@ typedef enum { APR_POLLSET_KQUEUE, /**< Poll uses kqueue method */ APR_POLLSET_PORT, /**< Poll uses Solaris event port method */ APR_POLLSET_EPOLL, /**< Poll uses epoll method */ - APR_POLLSET_ASIO, /**< Poll uses z/OS async i/o method */ + APR_POLLSET_AIO_MSGQ, /**< Poll uses z/OS asio method */ APR_POLLSET_POLL /**< Poll uses poll method */ } apr_pollset_method_e; diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index eab61a8e670..5c50e9843a1 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -45,9 +45,9 @@ #define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0 #endif -#if defined(HAVE_AIO_H) && defined(__MVS__) -#define _AIO_OS390 /* enable a bunch of z/OS aio.h definitions */ -#include /* aiocb */ +#if defined(HAVE_AIO_H) && defined(HAVE_AIO_MSGQ) +#define _AIO_OS390 /* enable a bunch of z/OS aio.h definitions */ +#include /* aiocb */ #endif /* Choose the best method platform specific to use in apr_pollset */ @@ -60,9 +60,9 @@ #elif defined(HAVE_EPOLL) #define POLLSET_USES_EPOLL #define POLLSET_DEFAULT_METHOD APR_POLLSET_EPOLL -#elif defined(HAVE_AIO_H) && defined(__MVS__) -#define POLLSET_USES_ASIO -#define POLLSET_DEFAULT_METHOD APR_POLLSET_ASIO +#elif defined(HAVE_AIO_MSGQ) +#define POLLSET_USES_AIO_MSGQ +#define POLLSET_DEFAULT_METHOD APR_POLLSET_AIO_MSGQ #elif defined(HAVE_POLL) #define POLLSET_USES_POLL #define POLLSET_DEFAULT_METHOD APR_POLLSET_POLL @@ -83,7 +83,7 @@ #endif #endif -#if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT) || defined(POLLSET_USES_ASIO) +#if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT) || defined(POLLSET_USES_AIO_MSGQ) #include "apr_ring.h" @@ -115,6 +115,7 @@ struct pfd_elem_t { typedef struct apr_pollset_private_t apr_pollset_private_t; typedef struct apr_pollset_provider_t apr_pollset_provider_t; typedef struct apr_pollcb_provider_t apr_pollcb_provider_t; + struct apr_pollset_t { apr_pool_t *pool; diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index ef894b2ee9f..4fa4ffad3eb 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -52,8 +52,8 @@ extern apr_pollset_provider_t *apr_pollset_provider_port; #if defined(HAVE_EPOLL) extern apr_pollset_provider_t *apr_pollset_provider_epoll; #endif -#if defined(HAVE_AIO_H) && defined(__MVS__) -extern apr_pollset_provider_t *apr_pollset_provider_asio; +#if defined(HAVE_AIO_MSGQ) +extern apr_pollset_provider_t *apr_pollset_provider_aio_msgq; #endif #if defined(HAVE_POLL) extern apr_pollset_provider_t *apr_pollset_provider_poll; @@ -79,9 +79,9 @@ static apr_pollset_provider_t *pollset_provider(apr_pollset_method_e method) provider = apr_pollset_provider_epoll; #endif break; - case APR_POLLSET_ASIO: -#if defined(HAVE_AIO_H) && defined(__MVS__) - provider = apr_pollset_provider_asio; + case APR_POLLSET_AIO_MSGQ: +#if defined(HAVE_AIO_MSGQ) + provider = apr_pollset_provider_aio_msgq; #endif break; case APR_POLLSET_POLL: diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index 7cab7197f3b..b08ebe2332c 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -41,7 +41,7 @@ #include "apr_arch_networkio.h" #include "apr_arch_poll_private.h" -#if defined(HAVE_AIO_H) && defined(__MVS__) +#ifdef HAVE_AIO_MSGQ #include /* msgget etc */ #include /* timestruct */ @@ -736,6 +736,6 @@ static apr_pollset_provider_t impl = { "asio" }; -apr_pollset_provider_t *apr_pollset_provider_asio = &impl; +apr_pollset_provider_t *apr_pollset_provider_aio_msgq = &impl; -#endif /* HAVE_ASIO && __MVS__ */ +#endif /* HAVE_AIO_MSGQ */ From c1be6f8afece096106c107e6bc9cbff187c47a62 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 13 Apr 2012 21:15:28 +0000 Subject: [PATCH 7117/7878] mention z/OS fancy apr_pollset_poll support, needed by httpd's Event MPM git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1325955 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 48c60cb526d..e5d37a1a904 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_pollset_poll: add z/OS async poll support for sockets [Greg Ames] + *) apr_mcast_hops: Fix EINVAL for IPv6 sockets caused by using byte instead integer for setsockopt. [Mladen Turk] From 9ed325f4bf80f7e27d818c3cde194af0018d4cf4 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Wed, 18 Apr 2012 19:29:06 +0000 Subject: [PATCH 7118/7878] Switch pgsql module from PQescapeString (which pgsql now deprecates) to PQescapeStringConn git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1327636 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_pgsql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbd/apr_dbd_pgsql.c b/dbd/apr_dbd_pgsql.c index 989945c06a6..dcc434d8e35 100644 --- a/dbd/apr_dbd_pgsql.c +++ b/dbd/apr_dbd_pgsql.c @@ -469,7 +469,7 @@ static const char *dbd_pgsql_escape(apr_pool_t *pool, const char *arg, { size_t len = strlen(arg); char *ret = apr_palloc(pool, 2*len + 2); - PQescapeString(ret, arg, len); + PQescapeStringConn(sql->conn, ret, arg, len, NULL); return ret; } From 835b2dffcf611da109ef7b02ddd835fd4869218c Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 2 May 2012 20:56:07 +0000 Subject: [PATCH 7119/7878] NetWare build tweaks to enable nlmconv linker. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1333202 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 10 ++-- build/NWGNUenvironment.inc | 4 +- build/NWGNUtail.inc | 110 ++++++++++++++++++++++++------------- dbd/NWGNUdbdfreetds | 9 +-- dbd/NWGNUdbdmysql | 7 +-- dbd/NWGNUdbdpgsql | 8 +-- dbd/NWGNUdbdsqli2 | 12 ++-- dbd/NWGNUdbdsqli3 | 10 ++-- test/NWGNUaprtest | 8 ++- test/NWGNUechod | 6 +- test/NWGNUglobalmutexchild | 6 +- test/NWGNUmod_test | 6 +- test/NWGNUproc_child | 6 +- test/NWGNUreadchild | 6 +- test/NWGNUsockchild | 6 +- test/NWGNUsockperf | 6 +- test/NWGNUtestatmc | 8 +-- test/NWGNUtryread | 6 +- 18 files changed, 138 insertions(+), 96 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index ff9ebc67568..1ab8b347aa4 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -217,7 +217,7 @@ endif # These will be added as a module command in the link.opt file. # FILES_nlm_modules = \ - Libc \ + libc \ $(EOLIST) # Include the Winsock libraries if Winsock is being used @@ -253,14 +253,16 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @libc.imp \ - @netware.imp \ + @$(NOVI)/libc.imp \ + @$(NOVI)/netware.imp \ $(EOLIST) # Include the Winsock imports if Winsock is being used ifndef USE_STDSOCKETS FILES_nlm_Ximports += \ - @ws2nlm.imp \ + @$(NOVI)/ws2nlm.imp \ + $(EOLIST) +FILES_nlm_imports += \ WSAStartupRTags \ WSACleanupRTag \ $(EOLIST) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 4d28957b100..c2b68d9a52a 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -183,11 +183,11 @@ else CC = gcc CPP = g++ CPRE = $(CC) -P -E -LINK = nlmconv -UT +LINK = nlmconv AR = ar cru RANLIB = ranlib -CFLAGS = -m32 -fno-builtin -fpcc-struct-return -fstrict-aliasing +CFLAGS = -m32 -fno-builtin -fpcc-struct-return -fno-strict-aliasing CFLAGS += -fpack-struct=4 CFLAGS += -Wall CFLAGS += -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index f56051bf736..9463f668e93 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -28,7 +28,8 @@ NLM_COPYRIGHT = Licensed under the Apache License, Version 2.0 endif ifeq "$(NLM_FLAGS)" "" -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +#NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = flag_on 72 endif ifeq "$(NLM_STACK_SIZE)" "" @@ -43,6 +44,10 @@ ifeq "$(NLM_EXIT_SYM)" "" NLM_EXIT_SYM = _LibCPostlude endif +ifeq "$(XDCDATA)" "" +XDCDATA = $(APR)/misc/netware/apr.xdc +endif + ifeq "$(NLM_VERSION)" "" NLM_VERSION = $(VERSION) endif @@ -223,7 +228,7 @@ endif # If we only have one target NLM then build it ifeq "$(words $(strip $(TARGET_nlm)))" "1" -$(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.opt +$(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.opt $(OBJDIR)/$(NLM_NAME)_link.def @echo $(DL)LINK $@$(DL) $(LINK) @$(OBJDIR)/$(NLM_NAME)_link.opt @@ -232,36 +237,31 @@ $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.o $(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) $(call DEL,$@) - $(call DEL,$(@:.opt=.def)) @echo $(DL)GEN $@$(DL) +ifdef METROWERKS @echo $(DL)# Do not edit this file - it is created by make!$(DL) > $@ @echo $(DL)# All your changes will be lost!!$(DL)>> $@ @echo $(DL)-warnings off$(DL)>> $@ @echo $(DL)-zerobss$(DL)>> $@ + @echo $(DL)-nodefaults$(DL)>> $@ + @echo $(DL)-map $(OBJDIR)/$(NLM_NAME).map$(DL)>> $@ @echo $(DL)-o $(TARGET_nlm)$(DL)>> $@ ifneq "$(FILE_nlm_copyright)" "" @-$(CAT) $(FILE_nlm_copyright) >> $@ endif ifeq "$(RELEASE)" "debug" @echo $(DL)-g$(DL)>> $@ - @echo $(DL)-sym internal$(DL)>> $@ @echo $(DL)-sym codeview4$(DL)>> $@ @echo $(DL)-osym $(OBJDIR)/$(NLM_NAME).sym$(DL)>> $@ -else - @echo $(DL)-sym internal$(DL)>> $@ endif - @echo $(DL)-l $(APR)/$(OBJDIR)$(DL)>> $@ - @echo $(DL)-l $(APRXML)/$(OBJDIR)$(DL)>> $@ - @echo $(DL)-l $(APR)/misc/netware$(DL)>> $@ - @echo $(DL)-l $(APR)$(DL)>> $@ - @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime"$(DL)>> $@ - @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++"$(DL)>> $@ + @echo $(DL)-sym internal$(DL)>> $@ + @echo $(DL)-L$(APR)/misc/netware$(DL)>> $@ + @echo $(DL)-L"$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime"$(DL)>> $@ + @echo $(DL)-L"$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++"$(DL)>> $@ ifneq "$(IPV6)" "" - @echo $(DL)-l $(NOVELLLIBC)/include/winsock/IPV6$(DL)>> $@ + @echo $(DL)-L$(NOVELLLIBC)/include/winsock/IPV6$(DL)>> $@ endif - @echo $(DL)-l $(NOVELLLIBC)/imports$(DL)>> $@ - @echo $(DL)-nodefaults$(DL)>> $@ - @echo $(DL)-map $(OBJDIR)/$(NLM_NAME).map$(DL)>> $@ + @echo $(DL)-L$(NOVELLLIBC)/imports$(DL)>> $@ ifneq "$(strip $(XLFLAGS))" "" @echo $(DL)$(XLFLAGS)$(DL)>> $@ endif @@ -269,46 +269,80 @@ ifneq "$(strip $(FILES_nlm_objs))" "" @echo $(DL)$(foreach objfile,$(strip $(FILES_nlm_objs)),$(objfile))$(DL)>> $@ endif ifneq "$(FILES_nlm_libs)" "" - @echo $(DL)$(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(libfile))$(DL)>> $@ + @echo $(DL)$(foreach libpath,$(dir $(strip $(FILES_nlm_libs))),-L$(libpath))$(DL)>> $@ + @echo $(DL)$(foreach libfile,$(notdir $(strip $(FILES_nlm_libs))),-l$(libfile))$(DL)>> $@ +endif +ifneq "$(FILES_nlm_Ximports)" "" + @echo $(DL)$(foreach imppath,$(dir $(strip $(FILES_nlm_Ximports))),$(subst @,-L,$(imppath)))$(DL)>> $@ endif @echo $(DL)-commandfile $(@:.opt=.def)$(DL)>> $@ - @echo $(DL)# Do not edit this file - it is created by make!$(DL)> $(@:.opt=.def) - @echo $(DL)# All your changes will be lost!!$(DL)>> $(@:.opt=.def) +else + @echo $(DL)-UT $(@:.opt=.def)$(DL)>> $@ +endif + +$(OBJDIR)/$(NLM_NAME)_link.def : $($(NLM_NAME)_LINKOPT_DEPENDS) + $(call DEL,$@) + @echo $(DL)GEN $@$(DL) + @echo $(DL)# Do not edit this file - it is created by make!$(DL)> $@ + @echo $(DL)# All your changes will be lost!!$(DL)>> $@ ifneq "$(FILE_nlm_msg)" "" - @echo $(DL)Messages $(FILE_nlm_msg)$(DL)>> $(@:.opt=.def) + @echo $(DL)Messages $(FILE_nlm_msg)$(DL)>> $@ endif ifneq "$(FILE_nlm_hlp)" "" - @echo $(DL)Help $(FILE_nlm_hlp)$(DL)>> $(@:.opt=.def) + @echo $(DL)Help $(FILE_nlm_hlp)$(DL)>> $@ endif ifeq "$(FILE_nlm_copyright)" "" - @echo $(DL)copyright "$(NLM_COPYRIGHT)"$(DL)>> $(@:.opt=.def) -endif - @echo $(DL)description "$(NLM_DESCRIPTION)"$(DL)>> $(@:.opt=.def) - @echo $(DL)threadname "$(NLM_THREAD_NAME)"$(DL)>> $(@:.opt=.def) - @echo $(DL)screenname "$(NLM_SCREEN_NAME)"$(DL)>> $(@:.opt=.def) - @echo $(DL)stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE))))$(DL)>> $(@:.opt=.def) - @echo $(DL)version $(NLM_VERSION) $(DL)>> $(@:.opt=.def) - @echo $(DL)$(strip $(NLM_FLAGS))$(DL)>> $(@:.opt=.def) - @echo $(DL)start $(NLM_ENTRY_SYM)$(DL)>> $(@:.opt=.def) - @echo $(DL)exit $(NLM_EXIT_SYM)$(DL)>> $(@:.opt=.def) + @echo $(DL)copyright "$(NLM_COPYRIGHT)"$(DL)>> $@ +endif + @echo $(DL)description "$(NLM_DESCRIPTION)"$(DL)>> $@ + @echo $(DL)threadname "$(NLM_THREAD_NAME)"$(DL)>> $@ + @echo $(DL)screenname "$(NLM_SCREEN_NAME)"$(DL)>> $@ + @echo $(DL)stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE))))$(DL)>> $@ + @echo $(DL)version $(NLM_VERSION) $(DL)>> $@ + @echo $(DL)$(strip $(NLM_FLAGS))$(DL)>> $@ + @echo $(DL)start $(NLM_ENTRY_SYM)$(DL)>> $@ + @echo $(DL)exit $(NLM_EXIT_SYM)$(DL)>> $@ +# @echo $(DL)map $(OBJDIR)/$(NLM_NAME).map$(DL)>> $@ ifneq "$(NLM_CHECK_SYM)" "" - @echo $(DL)check $(NLM_CHECK_SYM)$(DL)>> $(@:.opt=.def) + @echo $(DL)check $(NLM_CHECK_SYM)$(DL)>> $@ endif ifneq "$(FILES_nlm_modules)" "" - @echo $(DL)module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(module))$(DL)>> $(@:.opt=.def) + @echo $(DL)module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(module))$(DL)>> $@ endif +ifneq "$(FILES_nlm_imports)" "" + @echo $(DL)import $(foreach import,$(strip $(FILES_nlm_imports)),$(import))$(DL)>> $@ +endif +ifdef METROWERKS ifneq "$(FILES_nlm_Ximports)" "" - @echo $(DL)import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(import))$(DL)>> $(@:.opt=.def) + @echo $(DL)import $(foreach import,$(notdir $(strip $(FILES_nlm_Ximports))),@$(import))$(DL)>> $@ endif ifneq "$(FILES_nlm_exports)" "" - @echo $(DL)export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export))$(DL)>> $(@:.opt=.def) + @echo $(DL)export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export))$(DL)>> $@ endif # if APACHE_UNIPROC is defined, don't include XDCData ifndef APACHE_UNIPROC -ifneq "$(string $(XDCDATA))" "" - @echo $(DL)xdcdata $(XDCDATA)$(DL)>> $(@:.opt=.def) + @echo $(DL)xdcdata $(notdir $(XDCDATA))$(DL)>> $@ +endif else - @echo $(DL)xdcdata apr.xdc$(DL)>> $(@:.opt=.def) +ifneq "$(FILES_nlm_Ximports)" "" + @echo $(DL)import $(foreach import,$(strip $(FILES_nlm_Ximports)),$(import))$(DL)>> $@ +endif +ifneq "$(FILES_nlm_exports)" "" + @echo $(DL)export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export))$(DL)>> $@ +endif +# if APACHE_UNIPROC is defined, don't include XDCData +ifndef APACHE_UNIPROC + @echo $(DL)xdcdata $(XDCDATA)$(DL)>> $@ +endif +ifneq "$(strip $(FILES_nlm_objs))" "" + @echo $(DL)input $(foreach objfile,$(strip $(FILES_nlm_objs)),$(objfile))$(DL)>> $@ +endif +ifneq "$(FILES_nlm_libs)" "" + @echo $(DL)input $(foreach libfile,$(strip $(FILES_nlm_libs)),$(libfile))$(DL)>> $@ +endif + @echo $(DL)output $(TARGET_nlm)$(DL)>> $@ +ifeq "$(RELEASE)" "debug" + @echo $(DL)debug$(DL)>> $@ endif endif diff --git a/dbd/NWGNUdbdfreetds b/dbd/NWGNUdbdfreetds index 8692ff3bc2f..71af8d15159 100644 --- a/dbd/NWGNUdbdfreetds +++ b/dbd/NWGNUdbdfreetds @@ -52,6 +52,8 @@ XCFLAGS += \ XDEFINES += \ -DAPU_HAVE_FREETDS=1 \ -DAPU_DSO_MODULE_BUILD \ + -DHAVE_SYBDB_H=1 \ + -DSYBDBLIB \ $(EOLIST) # @@ -61,7 +63,6 @@ XLFLAGS += \ $(EOLIST) XLFLAGS += \ - -l $(FREETDSSDK)/lib \ $(EOLIST) # @@ -236,13 +237,13 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) ifneq ($(LINK_STATIC),1) FILES_nlm_Ximports += \ - @$(notdir $(FREETDS_IMP)) \ + @$(FREETDS_IMP) \ $(EOLIST) endif diff --git a/dbd/NWGNUdbdmysql b/dbd/NWGNUdbdmysql index c3e9c811f98..bc799eb52a0 100644 --- a/dbd/NWGNUdbdmysql +++ b/dbd/NWGNUdbdmysql @@ -65,7 +65,6 @@ XLFLAGS += \ $(EOLIST) XLFLAGS += \ - -l $(MYSQLSDK)/lib \ $(EOLIST) # @@ -240,13 +239,13 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) ifneq ($(LINK_STATIC),1) FILES_nlm_Ximports += \ - @$(notdir $(MYSQL_IMP)) \ + @$(MYSQL_IMP) \ $(EOLIST) endif diff --git a/dbd/NWGNUdbdpgsql b/dbd/NWGNUdbdpgsql index 05e67bcb06c..61946df51f6 100644 --- a/dbd/NWGNUdbdpgsql +++ b/dbd/NWGNUdbdpgsql @@ -63,11 +63,9 @@ XLFLAGS += \ ifdef LINK_STATIC XLFLAGS += \ - -l $(PGSQLSDK)/lib \ $(EOLIST) else XLFLAGS += \ - -l $(PGSQLSDK)/imp \ $(EOLIST) endif @@ -243,13 +241,13 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) ifneq ($(LINK_STATIC),1) FILES_nlm_Ximports += \ - @$(notdir $(PGSQL_IMP)) \ + @$(PGSQL_IMP) \ $(EOLIST) endif diff --git a/dbd/NWGNUdbdsqli2 b/dbd/NWGNUdbdsqli2 index 3caef7a4869..8887a53ffa9 100644 --- a/dbd/NWGNUdbdsqli2 +++ b/dbd/NWGNUdbdsqli2 @@ -61,7 +61,6 @@ XLFLAGS += \ $(EOLIST) XLFLAGS += \ - -l $(SQLITE2SDK) \ $(EOLIST) # @@ -236,13 +235,18 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ + $(EOLIST) + +FILES_nlm_imports = \ + apr_dbd_mutex_lock \ + apr_dbd_mutex_unlock \ $(EOLIST) ifneq ($(LINK_STATIC),1) FILES_nlm_Ximports += \ - @$(notdir $(SQLITE2_IMP)) \ + @$(SQLITE2_IMP) \ $(EOLIST) endif diff --git a/dbd/NWGNUdbdsqli3 b/dbd/NWGNUdbdsqli3 index e66f2347ed7..cf495d21cfc 100644 --- a/dbd/NWGNUdbdsqli3 +++ b/dbd/NWGNUdbdsqli3 @@ -61,7 +61,6 @@ XLFLAGS += \ $(EOLIST) XLFLAGS += \ - -l $(SQLITE3SDK) \ $(EOLIST) # @@ -236,15 +235,18 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ + $(EOLIST) + +FILES_nlm_imports = \ apr_dbd_mutex_lock \ apr_dbd_mutex_unlock \ $(EOLIST) ifneq ($(LINK_STATIC),1) FILES_nlm_Ximports += \ - @$(notdir $(SQLITE3_IMP)) \ + @$(SQLITE3_IMP) \ $(EOLIST) endif diff --git a/test/NWGNUaprtest b/test/NWGNUaprtest index 5ed6a26e0e5..57b00da49b4 100644 --- a/test/NWGNUaprtest +++ b/test/NWGNUaprtest @@ -276,14 +276,16 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) # Include the Winsock imports if Winsock is being used ifndef USE_STDSOCKETS FILES_nlm_Ximports += \ - @ws2nlm.imp \ + @$(NOVI)/ws2nlm.imp \ + $(EOLIST) +FILES_nlm_imports += \ WSAStartupRTags \ WSACleanupRTag \ $(EOLIST) diff --git a/test/NWGNUechod b/test/NWGNUechod index 39939b8be90..470c0cd8765 100644 --- a/test/NWGNUechod +++ b/test/NWGNUechod @@ -187,7 +187,7 @@ FILES_nlm_libs = \ # FILES_nlm_modules = \ aprlib \ - Libc \ + libc \ $(EOLIST) # @@ -209,8 +209,8 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) # diff --git a/test/NWGNUglobalmutexchild b/test/NWGNUglobalmutexchild index 6d8fd5bd281..9a1518a63fc 100644 --- a/test/NWGNUglobalmutexchild +++ b/test/NWGNUglobalmutexchild @@ -188,7 +188,7 @@ FILES_nlm_libs = \ # FILES_nlm_modules = \ aprlib \ - Libc \ + libc \ $(EOLIST) # @@ -210,8 +210,8 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) # diff --git a/test/NWGNUmod_test b/test/NWGNUmod_test index f8f16976eb4..a69f4eab832 100644 --- a/test/NWGNUmod_test +++ b/test/NWGNUmod_test @@ -186,7 +186,7 @@ FILES_nlm_libs = \ # FILES_nlm_modules = \ aprlib \ - Libc \ + libc \ $(EOLIST) # @@ -208,8 +208,8 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) # diff --git a/test/NWGNUproc_child b/test/NWGNUproc_child index 9e190721e29..423089c8ab6 100644 --- a/test/NWGNUproc_child +++ b/test/NWGNUproc_child @@ -186,7 +186,7 @@ FILES_nlm_libs = \ # FILES_nlm_modules = \ aprlib \ - Libc \ + libc \ $(EOLIST) # @@ -208,8 +208,8 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) # diff --git a/test/NWGNUreadchild b/test/NWGNUreadchild index be111649deb..451407f9452 100644 --- a/test/NWGNUreadchild +++ b/test/NWGNUreadchild @@ -186,7 +186,7 @@ FILES_nlm_libs = \ # FILES_nlm_modules = \ aprlib \ - Libc \ + libc \ $(EOLIST) # @@ -208,8 +208,8 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) # diff --git a/test/NWGNUsockchild b/test/NWGNUsockchild index 2a7a4f68d0e..5ed87ab218b 100644 --- a/test/NWGNUsockchild +++ b/test/NWGNUsockchild @@ -186,7 +186,7 @@ FILES_nlm_libs = \ # FILES_nlm_modules = \ aprlib \ - Libc \ + libc \ $(EOLIST) # @@ -208,8 +208,8 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) # diff --git a/test/NWGNUsockperf b/test/NWGNUsockperf index e10b3f311d0..db6486af4e6 100644 --- a/test/NWGNUsockperf +++ b/test/NWGNUsockperf @@ -187,7 +187,7 @@ FILES_nlm_libs = \ # FILES_nlm_modules = \ aprlib \ - Libc \ + libc \ $(EOLIST) # @@ -209,8 +209,8 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) # diff --git a/test/NWGNUtestatmc b/test/NWGNUtestatmc index 1a0484a5d5b..977fd8bfcc0 100644 --- a/test/NWGNUtestatmc +++ b/test/NWGNUtestatmc @@ -187,8 +187,8 @@ FILES_nlm_libs = \ # These will be added as a module command in the link.opt file. # FILES_nlm_modules = \ - Libc \ - APRLIB \ + aprlib \ + libc \ $(EOLIST) # @@ -210,8 +210,8 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) # diff --git a/test/NWGNUtryread b/test/NWGNUtryread index 52246fe62b1..f18d20d32a8 100644 --- a/test/NWGNUtryread +++ b/test/NWGNUtryread @@ -186,7 +186,7 @@ FILES_nlm_libs = \ # FILES_nlm_modules = \ aprlib \ - Libc \ + libc \ $(EOLIST) # @@ -208,8 +208,8 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) # From dc4107f7f50e8724d6d30fbd3bd84aa486429936 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Thu, 3 May 2012 00:15:40 +0000 Subject: [PATCH 7120/7878] Few more NetWare build tweaks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1333274 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 9463f668e93..11c9efb10b9 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -44,14 +44,19 @@ ifeq "$(NLM_EXIT_SYM)" "" NLM_EXIT_SYM = _LibCPostlude endif -ifeq "$(XDCDATA)" "" -XDCDATA = $(APR)/misc/netware/apr.xdc -endif - ifeq "$(NLM_VERSION)" "" NLM_VERSION = $(VERSION) endif +# if APACHE_UNIPROC is defined, don't include XDCData +ifndef APACHE_UNIPROC +ifneq "$(XDCDATA)" "" +NLM_XDCDATA = $(XDCDATA) +else +NLM_XDCDATA = $(APR)/misc/netware/apr.xdc +endif +endif + # # Create dependency lists based on the files available # @@ -238,7 +243,7 @@ $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.o $(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) $(call DEL,$@) @echo $(DL)GEN $@$(DL) -ifdef METROWERKS +ifeq "$(findstring mwldnlm,$(LINK))" "mwldnlm" # for Metrowerks CodeWarrior @echo $(DL)# Do not edit this file - it is created by make!$(DL) > $@ @echo $(DL)# All your changes will be lost!!$(DL)>> $@ @echo $(DL)-warnings off$(DL)>> $@ @@ -276,7 +281,7 @@ ifneq "$(FILES_nlm_Ximports)" "" @echo $(DL)$(foreach imppath,$(dir $(strip $(FILES_nlm_Ximports))),$(subst @,-L,$(imppath)))$(DL)>> $@ endif @echo $(DL)-commandfile $(@:.opt=.def)$(DL)>> $@ -else +else # for GNU nlmconv @echo $(DL)-UT $(@:.opt=.def)$(DL)>> $@ endif @@ -307,38 +312,36 @@ ifneq "$(NLM_CHECK_SYM)" "" @echo $(DL)check $(NLM_CHECK_SYM)$(DL)>> $@ endif ifneq "$(FILES_nlm_modules)" "" - @echo $(DL)module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(module))$(DL)>> $@ + @echo $(DL)module $(strip $(FILES_nlm_modules))$(DL)>> $@ endif ifneq "$(FILES_nlm_imports)" "" - @echo $(DL)import $(foreach import,$(strip $(FILES_nlm_imports)),$(import))$(DL)>> $@ + @echo $(DL)import $(strip $(FILES_nlm_imports))$(DL)>> $@ endif -ifdef METROWERKS +ifeq "$(findstring mwldnlm,$(LINK))" "mwldnlm" # for Metrowerks CodeWarrior ifneq "$(FILES_nlm_Ximports)" "" @echo $(DL)import $(foreach import,$(notdir $(strip $(FILES_nlm_Ximports))),@$(import))$(DL)>> $@ endif ifneq "$(FILES_nlm_exports)" "" @echo $(DL)export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export))$(DL)>> $@ endif -# if APACHE_UNIPROC is defined, don't include XDCData -ifndef APACHE_UNIPROC - @echo $(DL)xdcdata $(notdir $(XDCDATA))$(DL)>> $@ +ifneq "$(NLM_XDCDATA)" "" + @echo $(DL)xdcdata $(notdir $(NLM_XDCDATA))$(DL)>> $@ endif -else +else # for GNU nlmconv ifneq "$(FILES_nlm_Ximports)" "" - @echo $(DL)import $(foreach import,$(strip $(FILES_nlm_Ximports)),$(import))$(DL)>> $@ + @echo $(DL)import $(strip $(FILES_nlm_Ximports))$(DL)>> $@ endif ifneq "$(FILES_nlm_exports)" "" @echo $(DL)export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export))$(DL)>> $@ endif -# if APACHE_UNIPROC is defined, don't include XDCData -ifndef APACHE_UNIPROC - @echo $(DL)xdcdata $(XDCDATA)$(DL)>> $@ +ifneq "$(NLM_XDCDATA)" "" + @echo $(DL)xdcdata $(NLM_XDCDATA)$(DL)>> $@ endif ifneq "$(strip $(FILES_nlm_objs))" "" - @echo $(DL)input $(foreach objfile,$(strip $(FILES_nlm_objs)),$(objfile))$(DL)>> $@ + @echo $(DL)input $(strip $(FILES_nlm_objs))$(DL)>> $@ endif ifneq "$(FILES_nlm_libs)" "" - @echo $(DL)input $(foreach libfile,$(strip $(FILES_nlm_libs)),$(libfile))$(DL)>> $@ + @echo $(DL)input $(strip $(FILES_nlm_libs))$(DL)>> $@ endif @echo $(DL)output $(TARGET_nlm)$(DL)>> $@ ifeq "$(RELEASE)" "debug" From a045bee8802bdf069f7ae4e7722130e47b746b99 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Thu, 3 May 2012 00:37:50 +0000 Subject: [PATCH 7121/7878] And some more NetWare tweaks (forgotten files). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1333282 13f79535-47bb-0310-9956-ffa450edef68 --- dbm/NWGNUdbmdb | 8 +++----- dbm/NWGNUdbmgdbm | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/dbm/NWGNUdbmdb b/dbm/NWGNUdbmdb index a79edf08742..266d0d06730 100644 --- a/dbm/NWGNUdbmdb +++ b/dbm/NWGNUdbmdb @@ -64,11 +64,9 @@ XLFLAGS += \ ifdef LINK_STATIC XLFLAGS += \ - -l $(DBSDK)/lib \ $(EOLIST) else XLFLAGS += \ - -l $(DBSDK)/imp \ $(EOLIST) endif @@ -244,13 +242,13 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) ifneq ($(LINK_STATIC),1) FILES_nlm_Ximports += \ - @$(notdir $(DB_IMP)) \ + @$(DB_IMP) \ $(EOLIST) endif diff --git a/dbm/NWGNUdbmgdbm b/dbm/NWGNUdbmgdbm index dc0c2b0ebc0..f72ce53e634 100644 --- a/dbm/NWGNUdbmgdbm +++ b/dbm/NWGNUdbmgdbm @@ -63,11 +63,9 @@ XLFLAGS += \ ifdef LINK_STATIC XLFLAGS += \ - -l $(GDBMSDK)/lib \ $(EOLIST) else XLFLAGS += \ - -l $(GDBMSDK)/imp \ $(EOLIST) endif @@ -243,13 +241,13 @@ FILE_nlm_copyright = # Any additional imports go here # FILES_nlm_Ximports = \ - @aprlib.imp \ - @libc.imp \ + @$(APR)/aprlib.imp \ + @$(NOVI)/libc.imp \ $(EOLIST) ifneq ($(LINK_STATIC),1) FILES_nlm_Ximports += \ - @$(notdir $(GDBM_IMP)) \ + @$(GDBM_IMP) \ $(EOLIST) endif From 5b1e1f5e486b542482fff524b2fb156e59637003 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 18 May 2012 22:21:58 +0000 Subject: [PATCH 7122/7878] Make mkdir.sh save to use in parallel builds: Don't fail if a formerly missing directory has been created by another process in the meantime. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1340286 13f79535-47bb-0310-9956-ffa450edef68 --- build/mkdir.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build/mkdir.sh b/build/mkdir.sh index b947c926060..c59f03e181b 100755 --- a/build/mkdir.sh +++ b/build/mkdir.sh @@ -28,7 +28,13 @@ for file in ${1+"$@"} ; do esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 - mkdir "$pathcomp" || errstatus=$? + thiserrstatus=0 + mkdir "$pathcomp" || thiserrstatus=$? + # ignore errors due to races if a parallel mkdir.sh already + # created the dir + if test $thiserrstatus != 0 && test ! -d "$pathcomp" ; then + errstatus=$thiserrstatus + fi fi pathcomp="$pathcomp/" done From 9f9293dda7c7282c9003026e72648be0520122dc Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 18 May 2012 22:23:35 +0000 Subject: [PATCH 7123/7878] Update hints for hurd Submitted by: Pino Toscano , Stefan Fritsch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1340288 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index df7e3d8b6c6..e0ce0547941 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -129,9 +129,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? esac APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE]) ;; - *-GNU*) - APR_ADDTO(CPPFLAGS, [-DHURD -D_GNU_SOURCE]) - ;; *-lynx-lynxos) APR_ADDTO(CPPFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) APR_ADDTO(LIBS, [-lbsd]) @@ -180,6 +177,9 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-k*bsd*-gnu) APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE]) ;; + *-gnu*|*-GNU*) + APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE -DHURD]) + ;; *-next-nextstep*) APR_SETIFNULL(CFLAGS, [-O]) APR_ADDTO(CPPFLAGS, [-DNEXT]) From d952f828aa6e39ecfde5fb07a77f2cce6d18a522 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 19 May 2012 13:12:28 +0000 Subject: [PATCH 7124/7878] Hurd's sendfile works like Linux's git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1340470 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 133b2ce768b..d50f4f0f627 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -250,7 +250,7 @@ apr_status_t apr_socket_wait(apr_socket_t *sock, apr_wait_type_t direction) /* Define a structure to pass in when we have a NULL header value */ static apr_hdtr_t no_hdtr; -#if defined(__linux__) && defined(HAVE_WRITEV) +#if (defined(__linux__) || defined(__GNU__)) && defined(HAVE_WRITEV) apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, From 8a2e64c1231951bb05270dfb9dde62f5bd4786ed Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 21 May 2012 20:28:05 +0000 Subject: [PATCH 7125/7878] add attribute alloc_size to a few functions This allows gcc's -D_FORTIFY_SOURCE=2 to do some overflow checks git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1341193 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 6 ++++++ include/apr_strings.h | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 7d3a548099a..755320e5c8e 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -401,6 +401,9 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, * @return The allocated memory */ APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size) +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + __attribute__((alloc_size(2))) +#endif __attribute__((nonnull(1))); /** @@ -413,6 +416,9 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size) */ APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size, const char *file_line) +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + __attribute__((alloc_size(2))) +#endif __attribute__((nonnull(1))); #if APR_POOL_DEBUG diff --git a/include/apr_strings.h b/include/apr_strings.h index 6b71ff17eb6..457217358c8 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -106,7 +106,11 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); * has 'n' or more characters. If the string might contain * fewer characters, use apr_pstrndup. */ -APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n); +APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n) +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + __attribute__((alloc_size(3))) +#endif + ; /** * Duplicate at most n characters of a string into memory allocated @@ -128,7 +132,11 @@ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); * @param n The number of bytes to duplicate * @return The new block of memory */ -APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n); +APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n) +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + __attribute__((alloc_size(3))) +#endif + ; /** * Concatenate multiple strings, allocating memory out a pool From b67e1d3a68f456c7973c45924cb5884f2bc7c524 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 21 May 2012 20:38:41 +0000 Subject: [PATCH 7126/7878] If we retry getaddrinfo() without AI_ADDRCONFIG, we should really only remove AI_ADDRCONFIG and not all flags. When the retry logic was added in r64571, this was equivalent because not other flags were set. But this has changed since then. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1341196 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 3a98267c95b..efa7ee09e44 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -365,8 +365,8 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, error = getaddrinfo(hostname, servname, &hints, &ai_list); #ifdef HAVE_GAI_ADDRCONFIG if (error == EAI_BADFLAGS && family == APR_UNSPEC) { - /* Retry with no flags if AI_ADDRCONFIG was rejected. */ - hints.ai_flags = 0; + /* Retry without AI_ADDRCONFIG if it was rejected. */ + hints.ai_flags &= ~AI_ADDRCONFIG; error = getaddrinfo(hostname, servname, &hints, &ai_list); } #endif From c4e03352fe5e1b6b135b46a4d6e86c5de41b5a8c Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 28 May 2012 13:01:04 +0000 Subject: [PATCH 7127/7878] Improve handling of AI_ADDRCONFIG with getaddrinfo() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using AI_ADDRCONFIG involves some unfortunate guesswork because it does not consider loopback addresses when trying to determine if IPv4 or IPv6 is configured (RFC 3493). This is a problem if one actually wants to listen on or connect to the loopback address of a protocol family that is not otherwise configured on the system. Also, some implementations (glibc, cough) behave strangely if no other addresses besides 127.0.0.1 and ::1 are configured. A real fix would enhance apr_sockaddr_info_get's interface to allow the caller to specify if he wants to use the address for listen() or connect(), and if he wants to make the result dependant on the presence of non-loopback addresses. Then apr_sockaddr_info_get could pass the right combination of AI_ADDRCONFIG and AI_PASSIVE to getaddrinfo(). As a workaround, retry getaddrinfo() without AI_ADDRCONFIG in case of EAI_ADDRFAMILY. This solves the most common problems but not all corner cases. PR: 52709 Submitted by: Nirgal Vourgère , Stefan Fritsch Many thanks also to Aurelien Jarno for helping to debug this. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1343233 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index efa7ee09e44..fe42998e7b4 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -364,8 +364,23 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, } error = getaddrinfo(hostname, servname, &hints, &ai_list); #ifdef HAVE_GAI_ADDRCONFIG - if (error == EAI_BADFLAGS && family == APR_UNSPEC) { - /* Retry without AI_ADDRCONFIG if it was rejected. */ + /* + * Using AI_ADDRCONFIG involves some unfortunate guesswork because it + * does not consider loopback addresses when trying to determine if + * IPv4 or IPv6 is configured on a system (see RFC 3493). + * This is a problem if one actually wants to listen on or connect to + * the loopback address of a protocol family that is not otherwise + * configured on the system. See PR 52709. + * To work around some of the problems, retry without AI_ADDRCONFIG + * in case of EAI_ADDRFAMILY. + * XXX: apr_sockaddr_info_get() should really accept a flag to determine + * XXX: if AI_ADDRCONFIG's guesswork is wanted and if the address is + * XXX: to be used for listen() or connect(). + * + * In case of EAI_BADFLAGS, AI_ADDRCONFIG is not supported. + */ + if ((family == APR_UNSPEC) && (error == EAI_BADFLAGS + || error == EAI_ADDRFAMILY)) { hints.ai_flags &= ~AI_ADDRCONFIG; error = getaddrinfo(hostname, servname, &hints, &ai_list); } From 00c340c10df04fbe520020fd3785d4ef7745e1d6 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 28 May 2012 13:20:00 +0000 Subject: [PATCH 7128/7878] Guard against EAI_ADDRFAMILY not being defined, it seems to be glibc specific git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1343243 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index fe42998e7b4..e6c10353170 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -380,7 +380,10 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, * In case of EAI_BADFLAGS, AI_ADDRCONFIG is not supported. */ if ((family == APR_UNSPEC) && (error == EAI_BADFLAGS - || error == EAI_ADDRFAMILY)) { +#ifdef EAI_ADDRFAMILY + || error == EAI_ADDRFAMILY +#endif + )) { hints.ai_flags &= ~AI_ADDRCONFIG; error = getaddrinfo(hostname, servname, &hints, &ai_list); } From edb0eeead650761df8a798b7b8d9a5b84746ff46 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 6 Jun 2012 12:47:23 +0000 Subject: [PATCH 7129/7878] * configure.in: Use AC_MSG_* rather than direct echo, making --quiet mode work (better). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1346860 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 65 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/configure.in b/configure.in index 3a17628a5f8..708c6f28030 100644 --- a/configure.in +++ b/configure.in @@ -125,8 +125,8 @@ dnl APR_CONFIG_NICE(config.nice) AC_CANONICAL_SYSTEM -echo "Configuring APR library" -echo "Platform: $host" +AC_MSG_NOTICE([Configuring APR library]) +AC_MSG_NOTICE([Platform: $host]) dnl Some initial steps for configuration. We setup the default directory dnl and which files are to be configured. @@ -175,7 +175,7 @@ APR_DOTTED_VERSION="`$get_version all $version_hdr APR`" AC_SUBST(APR_DOTTED_VERSION) AC_SUBST(APR_MAJOR_VERSION) -echo "APR Version: ${APR_DOTTED_VERSION}" +AC_MSG_NOTICE([APR Version: ${APR_DOTTED_VERSION}]) dnl Enable the layout handling code, then reparse the prefix-style dnl arguments due to autoconf being a PITA. @@ -204,7 +204,7 @@ APR_PRELOAD dnl These added to allow default directories to be used... DEFAULT_OSDIR="unix" -echo "(Default will be ${DEFAULT_OSDIR})" +AC_MSG_NOTICE([(Default will be ${DEFAULT_OSDIR})]) apr_modules="file_io network_io threadproc misc locks time mmap shmem user memory atomic poll support random" @@ -237,7 +237,7 @@ AC_SUBST(APR_LIBNAME) dnl prep libtool dnl -echo "performing libtool configuration..." +AC_MSG_NOTICE([performing libtool configuration...]) AC_ARG_ENABLE(experimental-libtool,[ --enable-experimental-libtool Use experimental custom libtool], [experimental_libtool=$enableval],[experimental_libtool=no]) @@ -250,7 +250,7 @@ fi case $host in *-os2*) # Use a custom-made libtool replacement - echo "using aplibtool" + AC_MSG_NOTICE([using aplibtool]) LIBTOOL="$apr_builddir/build/aplibtool" LIBTOOL_SRC="$apr_srcdir/build/aplibtool.c" $CC $CFLAGS $CPPFLAGS -o $LIBTOOL.exe $LIBTOOL_SRC @@ -261,7 +261,7 @@ case $host in fi if test "$experimental_libtool" = "yes"; then # Use a custom-made libtool replacement - echo "using jlibtool" + AC_MSG_NOTICE([using jlibtool]) LIBTOOL="$apr_builddir/libtool" LIBTOOL_SRC="$apr_srcdir/build/jlibtool.c" $CC $CFLAGS $CPPFLAGS -o $LIBTOOL $LIBTOOL_SRC @@ -329,7 +329,8 @@ AC_SUBST(LT_VERSION) dnl ----------------------------- Checks for compiler flags nl=' ' -echo "${nl}Check for compiler flags..." +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([Check for compiler flags...]) dnl AC_PROG_CC sets -g in CFLAGS (and -O2 for gcc) by default. dnl On OS/390 this causes the compiler to insert extra debugger @@ -686,7 +687,8 @@ case $host in ;; esac -echo "${nl}Checking for libraries..." +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([Checking for libraries...]) dnl ----------------------------- Checks for Any required Libraries dnl Note: Autoconf will always append LIBS with an extra " " in AC_CHECK_LIB. @@ -709,7 +711,7 @@ case $host in esac dnl ----------------------------- Checking for Threads -echo "${nl}Checking for Threads..." +AC_MSG_NOTICE([${nl}Checking for Threads...]) if test -z "$enable_threads"; then AC_ARG_ENABLE(threads, @@ -788,7 +790,7 @@ ac_cv_define_GETHOSTBYNAME_IS_THREAD_SAFE=no ac_cv_define_GETHOSTBYADDR_IS_THREAD_SAFE=no ac_cv_define_GETSERVBYNAME_IS_THREAD_SAFE=no if test "$threads" = "1"; then - echo "APR will use threads" + AC_MSG_NOTICE([APR will use threads]) AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE, 1, [Define if readdir is thread safe])) @@ -815,7 +817,7 @@ if test "$threads" = "1"; then fi AC_CHECK_FUNCS(gethostbyname_r gethostbyaddr_r getservbyname_r) else - echo "APR will be non-threaded" + AC_MSG_NOTICE([APR will be non-threaded]) fi dnl Electric Fence malloc checker. @@ -982,7 +984,8 @@ dnl ----------------------------- Checking for missing POSIX thread functions AC_CHECK_FUNCS([getpwnam_r getpwuid_r getgrnam_r getgrgid_r]) dnl ----------------------------- Checking for Shared Memory Support -echo "${nl}Checking for Shared Memory Support..." +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([Checking for Shared Memory Support...]) # The real-time POSIX extensions (e.g. shm_*, sem_*) may only # be available if linking against librt. @@ -1250,7 +1253,7 @@ AC_ARG_WITH(sendfile, [ --with-sendfile Override decision to use sendfi ;; esac if test "$orig_sendfile" != "$sendfile"; then - echo "sendfile support disabled to avoid system problem" + AC_MSG_NOTICE([sendfile support disabled to avoid system problem]) fi ] ) AC_SUBST(sendfile) @@ -1854,7 +1857,9 @@ AC_DEFINE_UNQUOTED(APR_OFF_T_STRFN, [$off_t_strfn], [Define as function used for conversion of strings to apr_off_t]) dnl ----------------------------- Checking for DSO support -echo "${nl}Checking for DSO..." +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([Checking for DSO...]) + AC_ARG_ENABLE(dso, [ --disable-dso Disable DSO support ], [if test "x$enableval" = "xyes"; then @@ -1898,7 +1903,7 @@ if test "$dsotype" = "any"; then [AC_CHECK_LIB(dl, dlsym, [APR_ADDTO(LIBS, -ldl)], [dsotype=any - echo "Weird: dlopen() was found but dlsym() was not found!"])]) + AC_MSG_WARN([Weird: dlopen() was found but dlsym() was not found!])])]) fi if test "$dsotype" = "any"; then # BeOS: @@ -1937,7 +1942,8 @@ fi AC_SUBST(aprdso) dnl ----------------------------- Checking for Processes -echo "${nl}Checking for Processes..." +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([Checking for Processes...]) AC_CHECK_FUNCS(waitpid) @@ -1989,7 +1995,8 @@ test "x$ac_cv_struct_rlimit" = xyes && struct_rlimit=1 AC_SUBST(struct_rlimit) dnl ----------------------------- Checking for Locking Characteristics -echo "${nl}Checking for Locking..." +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([Checking for Locking...]) AC_CHECK_FUNCS(semget semctl flock) AC_CHECK_HEADERS(semaphore.h OS.h) @@ -2362,7 +2369,8 @@ fi AC_SUBST(rand) dnl ----------------------------- Checking for File Info Support -echo "${nl}Checking for File Info Support..." +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([Checking for File Info Support...]) AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_atimensec, struct stat.st_ctimensec, struct stat.st_mtimensec, struct stat.st_atim.tv_nsec, struct stat.st_ctim.tv_nsec, struct stat.st_mtim.tv_nsec, @@ -2381,7 +2389,8 @@ APR_CHECK_DIRENT_INODE APR_CHECK_DIRENT_TYPE dnl ----------------------------- Checking for UUID Support -echo "${nl}Checking for OS UUID Support..." +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([Checking for OS UUID Support...]) AC_CHECK_HEADERS(uuid.h uuid/uuid.h sys/uuid.h, break) @@ -2441,14 +2450,16 @@ AC_SUBST(osuuid) dnl ----------------------------- Checking for Time Support -echo "${nl}Checking for Time Support..." +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([Checking for Time Support...]) AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.__tm_gmtoff],,,[ #include #include ]) dnl ----------------------------- Checking for Networking Support -echo "${nl}Checking for Networking support..." +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([Checking for Networking support...]) APR_TYPE_IN_ADDR if test "$ac_cv_type_in_addr" = "yes"; then have_in_addr="1" @@ -2459,9 +2470,9 @@ fi AC_MSG_CHECKING([if fd == socket on this platform]) if test "x$file_as_socket" != "x0" ; then file_as_socket="1"; - echo "yes" + AC_MSG_RESULT([yes]) else - echo "no" + AC_MSG_RESULT([no]) fi AC_SUBST(have_in_addr) @@ -2533,7 +2544,8 @@ AC_SUBST(have_sctp) AC_CHECK_FUNCS(set_h_errno) -echo "${nl}Checking for IPv6 Networking support..." +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([Checking for IPv6 Networking support...]) dnl Start of checking for IPv6 support... AC_ARG_ENABLE(ipv6, @@ -2693,7 +2705,8 @@ AC_SUBST(LDFLAGS) dnl ----------------------------- Finalize the variables -echo "${nl}Restore user-defined environment settings..." +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([Restore user-defined environment settings...]) APR_RESTORE_THE_ENVIRONMENT(CPPFLAGS, EXTRA_) APR_RESTORE_THE_ENVIRONMENT(CFLAGS, EXTRA_) From 970b68331fbc7dac82c28942d12edb85b9bf2020 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 6 Jun 2012 12:53:33 +0000 Subject: [PATCH 7130/7878] * build/crypto.m4: Always define apu_have_openssl, apu_have_nss to avoid sh warning when testing these variables if modular-dso is disabled. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1346865 13f79535-47bb-0310-9956-ffa450edef68 --- build/crypto.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/crypto.m4 b/build/crypto.m4 index 11f2e2bef7f..34bd1999836 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -23,6 +23,8 @@ dnl APU_CHECK_CRYPTO: look for crypto libraries and headers dnl AC_DEFUN([APU_CHECK_CRYPTO], [ apu_have_crypto=0 + apu_have_openssl=0 + apu_have_nss=0 old_libs="$LIBS" old_cppflags="$CPPFLAGS" @@ -48,7 +50,6 @@ AC_DEFUN([APU_CHECK_CRYPTO], [ dnl AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ - apu_have_openssl=0 openssl_have_headers=0 openssl_have_libs=0 @@ -137,7 +138,6 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ ]) AC_DEFUN([APU_CHECK_CRYPTO_NSS], [ - apu_have_nss=0 nss_have_headers=0 nss_have_libs=0 From 3c252533d444910bcdcf23a2bcab940e389ed825 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Thu, 5 Jul 2012 17:41:44 +0000 Subject: [PATCH 7131/7878] Add an APR_ASSERT_FAILURE macro for tests that must fail git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1357761 13f79535-47bb-0310-9956-ffa450edef68 --- test/testutil.c | 12 ++++++++++++ test/testutil.h | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/test/testutil.c b/test/testutil.c index c433e92c398..d3c1ff8ac95 100644 --- a/test/testutil.c +++ b/test/testutil.c @@ -36,6 +36,18 @@ void apr_assert_success(abts_case* tc, const char* context, apr_status_t rv, } } +void apr_assert_failure(abts_case* tc, const char* context, apr_status_t rv, + int lineno) +{ + if (rv == APR_ENOTIMPL) { + abts_not_impl(tc, context, lineno); + } else if (rv == APR_SUCCESS) { + char buf[STRING_MAX]; + sprintf(buf, "%s (%d): expected failure, got success\n", context, rv); + abts_fail(tc, buf, lineno); + } +} + void initialize(void) { apr_initialize(); atexit(apr_terminate); diff --git a/test/testutil.h b/test/testutil.h index d5fb4b1a3c4..8bb508d283d 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -58,6 +58,12 @@ void apr_assert_success(abts_case* tc, const char *context, #define APR_ASSERT_SUCCESS(tc, ctxt, rv) \ apr_assert_success(tc, ctxt, rv, __LINE__) +void apr_assert_failure(abts_case* tc, const char *context, + apr_status_t rv, int lineno); +#define APR_ASSERT_FAILURE(tc, ctxt, rv) \ + apr_assert_failure(tc, ctxt, rv, __LINE__) + + void initialize(void); abts_suite *testatomic(abts_suite *suite); From 87458fee151ffb979d6aa214cf5b5a3b7b77dc65 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Thu, 5 Jul 2012 18:02:28 +0000 Subject: [PATCH 7132/7878] Move non-MD5-related things from apr_md5.c to new file apr_passwd.c git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1357772 13f79535-47bb-0310-9956-ffa450edef68 --- build.conf | 1 + crypto/apr_md5.c | 145 +------------------------------------ crypto/apr_passwd.c | 169 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 171 insertions(+), 144 deletions(-) create mode 100644 crypto/apr_passwd.c diff --git a/build.conf b/build.conf index 4933d15cdf1..fc110e2eb70 100644 --- a/build.conf +++ b/build.conf @@ -13,6 +13,7 @@ paths = crypto/apr_crypto.c crypto/apr_md4.c crypto/apr_md5.c + crypto/apr_passwd.c crypto/apr_sha1.c crypto/getuuid.c crypto/uuid.c diff --git a/crypto/apr_md5.c b/crypto/apr_md5.c index d618a459b93..d685322c0fc 100644 --- a/crypto/apr_md5.c +++ b/crypto/apr_md5.c @@ -61,20 +61,10 @@ #include "apr_md5.h" #include "apr_lib.h" #include "apr_private.h" -#include "apr_sha1.h" #if APR_HAVE_STRING_H #include #endif -#if APR_HAVE_CRYPT_H -#include -#endif -#if APR_HAVE_UNISTD_H -#include -#endif -#if APR_HAVE_PTHREAD_H -#include -#endif /* Constants for MD5Transform routine. */ @@ -478,7 +468,7 @@ APR_DECLARE(apr_status_t) apr_MD5InitEBCDIC(apr_xlate_t *xlate) * Define the Magic String prefix that identifies a password as being * hashed using our algorithm. */ -static const char *apr1_id = "$apr1$"; +static const char const *apr1_id = "$apr1$"; /* * The following MD5 password encryption code was largely borrowed from @@ -660,136 +650,3 @@ APR_DECLARE(apr_status_t) apr_md5_encode(const char *pw, const char *salt, apr_cpystrn(result, passwd, nbytes - 1); return APR_SUCCESS; } - -#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) -#if defined(APU_CRYPT_THREADSAFE) || !APR_HAS_THREADS || \ - defined(CRYPT_R_CRYPTD) || defined(CRYPT_R_STRUCT_CRYPT_DATA) - -#define crypt_mutex_lock() -#define crypt_mutex_unlock() - -#elif APR_HAVE_PTHREAD_H && defined(PTHREAD_MUTEX_INITIALIZER) - -static pthread_mutex_t crypt_mutex = PTHREAD_MUTEX_INITIALIZER; -static void crypt_mutex_lock(void) -{ - pthread_mutex_lock(&crypt_mutex); -} - -static void crypt_mutex_unlock(void) -{ - pthread_mutex_unlock(&crypt_mutex); -} - -#elif defined(OS2) - -static HMTX crypt_mutex = 0; -static void crypt_mutex_lock() -{ - if (crypt_mutex == 0) { - /* Prevent race condition where two threads could try to create the - * mutex concurrently - */ - DosEnterCritSec(); - - if (crypt_mutex == 0) { - DosCreateMutexSem(NULL, &crypt_mutex, 0, FALSE); - } - - DosExitCritSec(); - } - - DosRequestMutexSem(crypt_mutex, SEM_INDEFINITE_WAIT); -} - -static void crypt_mutex_unlock() -{ - DosReleaseMutexSem(crypt_mutex); -} - -#else - -#error apr_password_validate() is not threadsafe. rebuild APR without thread support. - -#endif -#endif - -/* - * Validate a plaintext password against a smashed one. Uses either - * crypt() (if available) or apr_md5_encode() or apr_sha1_base64(), depending - * upon the format of the smashed input password. Returns APR_SUCCESS if - * they match, or APR_EMISMATCH if they don't. If the platform doesn't - * support crypt, then the default check is against a clear text string. - */ -APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, - const char *hash) -{ - char sample[120]; -#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) - char *crypt_pw; -#endif - if (!strncmp(hash, apr1_id, strlen(apr1_id))) { - /* - * The hash was created using our custom algorithm. - */ - apr_md5_encode(passwd, hash, sample, sizeof(sample)); - } - else if (!strncmp(hash, APR_SHA1PW_ID, APR_SHA1PW_IDLEN)) { - apr_sha1_base64(passwd, (int)strlen(passwd), sample); - } - else { - /* - * It's not our algorithm, so feed it to crypt() if possible. - */ -#if defined(WIN32) || defined(BEOS) || defined(NETWARE) - apr_cpystrn(sample, passwd, sizeof(sample) - 1); -#elif defined(CRYPT_R_CRYPTD) - CRYPTD buffer; - - crypt_pw = crypt_r(passwd, hash, &buffer); - if (!crypt_pw) { - return APR_EMISMATCH; - } - apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); -#elif defined(CRYPT_R_STRUCT_CRYPT_DATA) - struct crypt_data buffer; - -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,4) - buffer.initialized = 0; -#else - /* - * glibc before 2.3.2 had a bug that required clearing the - * whole struct - */ - memset(&buffer, 0, sizeof(buffer)); -#endif - crypt_pw = crypt_r(passwd, hash, &buffer); - if (!crypt_pw) { - return APR_EMISMATCH; - } - apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); -#else - /* Do a bit of sanity checking since we know that crypt_r() - * should always be used for threaded builds on AIX, and - * problems in configure logic can result in the wrong - * choice being made. - */ -#if defined(_AIX) && APR_HAS_THREADS -#error Configuration error! crypt_r() should have been selected! -#endif - - /* Handle thread safety issues by holding a mutex around the - * call to crypt(). - */ - crypt_mutex_lock(); - crypt_pw = crypt(passwd, hash); - if (!crypt_pw) { - crypt_mutex_unlock(); - return APR_EMISMATCH; - } - apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); - crypt_mutex_unlock(); -#endif - } - return (strcmp(sample, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; -} diff --git a/crypto/apr_passwd.c b/crypto/apr_passwd.c new file mode 100644 index 00000000000..7b236c599b3 --- /dev/null +++ b/crypto/apr_passwd.c @@ -0,0 +1,169 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_strings.h" +#include "apr_md5.h" +#include "apr_lib.h" +#include "apr_private.h" +#include "apr_sha1.h" + +#if APR_HAVE_STRING_H +#include +#endif +#if APR_HAVE_CRYPT_H +#include +#endif +#if APR_HAVE_UNISTD_H +#include +#endif +#if APR_HAVE_PTHREAD_H +#include +#endif + +static const char const *apr1_id = "$apr1$"; + +#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) +#if defined(APU_CRYPT_THREADSAFE) || !APR_HAS_THREADS || \ + defined(CRYPT_R_CRYPTD) || defined(CRYPT_R_STRUCT_CRYPT_DATA) + +#define crypt_mutex_lock() +#define crypt_mutex_unlock() + +#elif APR_HAVE_PTHREAD_H && defined(PTHREAD_MUTEX_INITIALIZER) + +static pthread_mutex_t crypt_mutex = PTHREAD_MUTEX_INITIALIZER; +static void crypt_mutex_lock(void) +{ + pthread_mutex_lock(&crypt_mutex); +} + +static void crypt_mutex_unlock(void) +{ + pthread_mutex_unlock(&crypt_mutex); +} + +#elif defined(OS2) + +static HMTX crypt_mutex = 0; +static void crypt_mutex_lock() +{ + if (crypt_mutex == 0) { + /* Prevent race condition where two threads could try to create the + * mutex concurrently + */ + DosEnterCritSec(); + + if (crypt_mutex == 0) { + DosCreateMutexSem(NULL, &crypt_mutex, 0, FALSE); + } + + DosExitCritSec(); + } + + DosRequestMutexSem(crypt_mutex, SEM_INDEFINITE_WAIT); +} + +static void crypt_mutex_unlock() +{ + DosReleaseMutexSem(crypt_mutex); +} + +#else + +#error apr_password_validate() is not threadsafe. rebuild APR without thread support. + +#endif +#endif + +/* + * Validate a plaintext password against a smashed one. Uses either + * crypt() (if available) or apr_md5_encode() or apr_sha1_base64(), depending + * upon the format of the smashed input password. Returns APR_SUCCESS if + * they match, or APR_EMISMATCH if they don't. If the platform doesn't + * support crypt, then the default check is against a clear text string. + */ +APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, + const char *hash) +{ + char sample[120]; +#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) + char *crypt_pw; +#endif + if (!strncmp(hash, apr1_id, strlen(apr1_id))) { + /* + * The hash was created using our custom algorithm. + */ + apr_md5_encode(passwd, hash, sample, sizeof(sample)); + } + else if (!strncmp(hash, APR_SHA1PW_ID, APR_SHA1PW_IDLEN)) { + apr_sha1_base64(passwd, (int)strlen(passwd), sample); + } + else { + /* + * It's not our algorithm, so feed it to crypt() if possible. + */ +#if defined(WIN32) || defined(BEOS) || defined(NETWARE) + apr_cpystrn(sample, passwd, sizeof(sample) - 1); +#elif defined(CRYPT_R_CRYPTD) + CRYPTD buffer; + + crypt_pw = crypt_r(passwd, hash, &buffer); + if (!crypt_pw) { + return APR_EMISMATCH; + } + apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); +#elif defined(CRYPT_R_STRUCT_CRYPT_DATA) + struct crypt_data buffer; + +#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,4) + buffer.initialized = 0; +#else + /* + * glibc before 2.3.2 had a bug that required clearing the + * whole struct + */ + memset(&buffer, 0, sizeof(buffer)); +#endif + crypt_pw = crypt_r(passwd, hash, &buffer); + if (!crypt_pw) { + return APR_EMISMATCH; + } + apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); +#else + /* Do a bit of sanity checking since we know that crypt_r() + * should always be used for threaded builds on AIX, and + * problems in configure logic can result in the wrong + * choice being made. + */ +#if defined(_AIX) && APR_HAS_THREADS +#error Configuration error! crypt_r() should have been selected! +#endif + + /* Handle thread safety issues by holding a mutex around the + * call to crypt(). + */ + crypt_mutex_lock(); + crypt_pw = crypt(passwd, hash); + if (!crypt_pw) { + crypt_mutex_unlock(); + return APR_EMISMATCH; + } + apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); + crypt_mutex_unlock(); +#endif + } + return (strcmp(sample, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; +} From b35b27cf9a23b35263b14f94b9451661dea45c7e Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Thu, 5 Jul 2012 18:13:34 +0000 Subject: [PATCH 7133/7878] Add support for bcrypt encoded passwords. The bcrypt implementation uses code from crypt_blowfish written by Solar Designer . The x86 assembler implementation is not used becaused it did not result in significant speed-up on my system. apr_bcrypt_encode creates hashes with "$2y$" prefix, but apr_password_validate also accepts the old prefix "$2a$". * crypto/crypt_blowfish.[ch]: Imported from crypt_blowfish 1.2. The only change compared to the upstream version is setting BF_ASM to 0. * crypto/apr_passwd.c: Add bcrypt support to apr_password_validate, add apr_bcrypt_encode * test/testpass.c: Add new tests, for bcrypt and the old schemes. * include/apr_md5.h: apr_password_validate() is left here fore backward compatibility and apr_bcrypt_encode() is added here as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1357780 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 + build.conf | 1 + crypto/apr_passwd.c | 37 +- crypto/crypt_blowfish.c | 902 ++++++++++++++++++++++++++++++++++++++++ crypto/crypt_blowfish.h | 27 ++ include/apr_md5.h | 18 +- test/testpass.c | 27 ++ 7 files changed, 1011 insertions(+), 7 deletions(-) create mode 100644 crypto/crypt_blowfish.c create mode 100644 crypto/crypt_blowfish.h diff --git a/CHANGES b/CHANGES index e5d37a1a904..bd2800ebee5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,12 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_password_validate, apr_bcrypt_encode: Add support for bcrypt encoded + passwords. The bcrypt implementation uses code from crypt_blowfish + written by Solar Designer . apr_bcrypt_encode creates + hashes with "$2y$" prefix, but apr_password_validate also accepts the old + prefix "$2a$". [Stefan Fritsch] + *) apr_pollset_poll: add z/OS async poll support for sockets [Greg Ames] *) apr_mcast_hops: Fix EINVAL for IPv6 sockets caused by using byte diff --git a/build.conf b/build.conf index fc110e2eb70..3c6ad6189cd 100644 --- a/build.conf +++ b/build.conf @@ -17,6 +17,7 @@ paths = crypto/apr_sha1.c crypto/getuuid.c crypto/uuid.c + crypto/crypt_blowfish.c dbm/apr_dbm_sdbm.c dbm/apr_dbm.c dbm/sdbm/*.c diff --git a/crypto/apr_passwd.c b/crypto/apr_passwd.c index 7b236c599b3..a81ccc36911 100644 --- a/crypto/apr_passwd.c +++ b/crypto/apr_passwd.c @@ -19,6 +19,7 @@ #include "apr_lib.h" #include "apr_private.h" #include "apr_sha1.h" +#include "crypt_blowfish.h" #if APR_HAVE_STRING_H #include @@ -102,11 +103,19 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, #if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) char *crypt_pw; #endif - if (!strncmp(hash, apr1_id, strlen(apr1_id))) { - /* - * The hash was created using our custom algorithm. - */ - apr_md5_encode(passwd, hash, sample, sizeof(sample)); + if (hash[0] == '$') { + if (hash[1] == '2' && (hash[2] == 'a' || hash[2] == 'y') + && hash[3] == '$') + { + if (_crypt_blowfish_rn(passwd, hash, sample, sizeof(sample)) == NULL) + return APR_FROM_OS_ERROR(errno); + } + else if (!strncmp(hash, apr1_id, strlen(apr1_id))) { + /* + * The hash was created using our custom algorithm. + */ + apr_md5_encode(passwd, hash, sample, sizeof(sample)); + } } else if (!strncmp(hash, APR_SHA1PW_ID, APR_SHA1PW_IDLEN)) { apr_sha1_base64(passwd, (int)strlen(passwd), sample); @@ -167,3 +176,21 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, } return (strcmp(sample, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; } + +static const char const *bcrypt_id = "$2y$"; +APR_DECLARE(apr_status_t) apr_bcrypt_encode(const char *pw, + unsigned int count, + const unsigned char *salt, + apr_size_t salt_len, + char *out, apr_size_t out_len) +{ + apr_size_t len; + char setting[40]; + if (_crypt_gensalt_blowfish_rn(bcrypt_id, count, (const char *)salt, + salt_len, setting, sizeof(setting)) == NULL) + return APR_FROM_OS_ERROR(errno); + len = strlen(out); + if (_crypt_blowfish_rn(pw, setting, out, out_len - len) == NULL) + return APR_FROM_OS_ERROR(errno); + return APR_SUCCESS; +} diff --git a/crypto/crypt_blowfish.c b/crypto/crypt_blowfish.c new file mode 100644 index 00000000000..ec9a188b3a2 --- /dev/null +++ b/crypto/crypt_blowfish.c @@ -0,0 +1,902 @@ +/* + * The crypt_blowfish homepage is: + * + * http://www.openwall.com/crypt/ + * + * This code comes from John the Ripper password cracker, with reentrant + * and crypt(3) interfaces added, but optimizations specific to password + * cracking removed. + * + * Written by Solar Designer in 1998-2011. + * No copyright is claimed, and the software is hereby placed in the public + * domain. In case this attempt to disclaim copyright and place the software + * in the public domain is deemed null and void, then the software is + * Copyright (c) 1998-2011 Solar Designer and it is hereby released to the + * general public under the following terms: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted. + * + * There's ABSOLUTELY NO WARRANTY, express or implied. + * + * It is my intent that you should be able to use this on your system, + * as part of a software package, or anywhere else to improve security, + * ensure compatibility, or for any other purpose. I would appreciate + * it if you give credit where it is due and keep your modifications in + * the public domain as well, but I don't require that in order to let + * you place this code and any modifications you make under a license + * of your choice. + * + * This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix + * "$2a$") by Niels Provos , and uses some of his + * ideas. The password hashing algorithm was designed by David Mazieres + * . For more information on the level of compatibility, + * prefer refer to the comments in BF_set_key() below and to the included + * crypt(3) man page. + * + * There's a paper on the algorithm that explains its design decisions: + * + * http://www.usenix.org/events/usenix99/provos.html + * + * Some of the tricks in BF_ROUND might be inspired by Eric Young's + * Blowfish library (I can't be sure if I would think of something if I + * hadn't seen his code). + */ + +#include + +#include +#ifndef __set_errno +#define __set_errno(val) errno = (val) +#endif + +/* Just to make sure the prototypes match the actual definitions */ +#include "crypt_blowfish.h" + +#ifdef __i386__ +#define BF_ASM 0 +#define BF_SCALE 1 +#elif defined(__x86_64__) || defined(__alpha__) || defined(__hppa__) +#define BF_ASM 0 +#define BF_SCALE 1 +#else +#define BF_ASM 0 +#define BF_SCALE 0 +#endif + +typedef unsigned int BF_word; +typedef signed int BF_word_signed; + +/* Number of Blowfish rounds, this is also hardcoded into a few places */ +#define BF_N 16 + +typedef BF_word BF_key[BF_N + 2]; + +typedef struct { + BF_word S[4][0x100]; + BF_key P; +} BF_ctx; + +/* + * Magic IV for 64 Blowfish encryptions that we do at the end. + * The string is "OrpheanBeholderScryDoubt" on big-endian. + */ +static BF_word BF_magic_w[6] = { + 0x4F727068, 0x65616E42, 0x65686F6C, + 0x64657253, 0x63727944, 0x6F756274 +}; + +/* + * P-box and S-box tables initialized with digits of Pi. + */ +static BF_ctx BF_init_state = { + { + { + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, + 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, + 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, + 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, + 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, + 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, + 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, + 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, + 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, + 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, + 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, + 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, + 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, + 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, + 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, + 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, + 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, + 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, + 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, + 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, + 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, + 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, + 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, + 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, + 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, + 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, + 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, + 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, + 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, + 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, + 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, + 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, + 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, + 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, + 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a + }, { + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, + 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, + 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, + 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, + 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, + 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, + 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, + 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, + 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, + 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, + 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, + 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, + 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, + 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, + 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, + 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, + 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, + 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, + 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, + 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, + 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, + 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, + 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, + 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, + 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, + 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, + 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, + 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, + 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, + 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, + 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, + 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, + 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, + 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, + 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 + }, { + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, + 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, + 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, + 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, + 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, + 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, + 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, + 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, + 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, + 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, + 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, + 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, + 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, + 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, + 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, + 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, + 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, + 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, + 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, + 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, + 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, + 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, + 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, + 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, + 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, + 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, + 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, + 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, + 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, + 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, + 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, + 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, + 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, + 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, + 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, + 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, + 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, + 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, + 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, + 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, + 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0 + }, { + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, + 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, + 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, + 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, + 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, + 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, + 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, + 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, + 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, + 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, + 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, + 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, + 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, + 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, + 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, + 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, + 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, + 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, + 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, + 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, + 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, + 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, + 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, + 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, + 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, + 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, + 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, + 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, + 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, + 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, + 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, + 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, + 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, + 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, + 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 + } + }, { + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, + 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b + } +}; + +static unsigned char BF_itoa64[64 + 1] = + "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + +static unsigned char BF_atoi64[0x60] = { + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 1, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 64, 64, 64, 64, 64, + 64, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 64, 64, 64, 64, 64, + 64, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 64, 64, 64, 64, 64 +}; + +#define BF_safe_atoi64(dst, src) \ +{ \ + tmp = (unsigned char)(src); \ + if ((unsigned int)(tmp -= 0x20) >= 0x60) return -1; \ + tmp = BF_atoi64[tmp]; \ + if (tmp > 63) return -1; \ + (dst) = tmp; \ +} + +static int BF_decode(BF_word *dst, const char *src, int size) +{ + unsigned char *dptr = (unsigned char *)dst; + unsigned char *end = dptr + size; + const unsigned char *sptr = (const unsigned char *)src; + unsigned int tmp, c1, c2, c3, c4; + + do { + BF_safe_atoi64(c1, *sptr++); + BF_safe_atoi64(c2, *sptr++); + *dptr++ = (c1 << 2) | ((c2 & 0x30) >> 4); + if (dptr >= end) break; + + BF_safe_atoi64(c3, *sptr++); + *dptr++ = ((c2 & 0x0F) << 4) | ((c3 & 0x3C) >> 2); + if (dptr >= end) break; + + BF_safe_atoi64(c4, *sptr++); + *dptr++ = ((c3 & 0x03) << 6) | c4; + } while (dptr < end); + + return 0; +} + +static void BF_encode(char *dst, const BF_word *src, int size) +{ + const unsigned char *sptr = (const unsigned char *)src; + const unsigned char *end = sptr + size; + unsigned char *dptr = (unsigned char *)dst; + unsigned int c1, c2; + + do { + c1 = *sptr++; + *dptr++ = BF_itoa64[c1 >> 2]; + c1 = (c1 & 0x03) << 4; + if (sptr >= end) { + *dptr++ = BF_itoa64[c1]; + break; + } + + c2 = *sptr++; + c1 |= c2 >> 4; + *dptr++ = BF_itoa64[c1]; + c1 = (c2 & 0x0f) << 2; + if (sptr >= end) { + *dptr++ = BF_itoa64[c1]; + break; + } + + c2 = *sptr++; + c1 |= c2 >> 6; + *dptr++ = BF_itoa64[c1]; + *dptr++ = BF_itoa64[c2 & 0x3f]; + } while (sptr < end); +} + +static void BF_swap(BF_word *x, int count) +{ + static int endianness_check = 1; + char *is_little_endian = (char *)&endianness_check; + BF_word tmp; + + if (*is_little_endian) + do { + tmp = *x; + tmp = (tmp << 16) | (tmp >> 16); + *x++ = ((tmp & 0x00FF00FF) << 8) | ((tmp >> 8) & 0x00FF00FF); + } while (--count); +} + +#if BF_SCALE +/* Architectures which can shift addresses left by 2 bits with no extra cost */ +#define BF_ROUND(L, R, N) \ + tmp1 = L & 0xFF; \ + tmp2 = L >> 8; \ + tmp2 &= 0xFF; \ + tmp3 = L >> 16; \ + tmp3 &= 0xFF; \ + tmp4 = L >> 24; \ + tmp1 = data.ctx.S[3][tmp1]; \ + tmp2 = data.ctx.S[2][tmp2]; \ + tmp3 = data.ctx.S[1][tmp3]; \ + tmp3 += data.ctx.S[0][tmp4]; \ + tmp3 ^= tmp2; \ + R ^= data.ctx.P[N + 1]; \ + tmp3 += tmp1; \ + R ^= tmp3; +#else +/* Architectures with no complicated addressing modes supported */ +#define BF_INDEX(S, i) \ + (*((BF_word *)(((unsigned char *)S) + (i)))) +#define BF_ROUND(L, R, N) \ + tmp1 = L & 0xFF; \ + tmp1 <<= 2; \ + tmp2 = L >> 6; \ + tmp2 &= 0x3FC; \ + tmp3 = L >> 14; \ + tmp3 &= 0x3FC; \ + tmp4 = L >> 22; \ + tmp4 &= 0x3FC; \ + tmp1 = BF_INDEX(data.ctx.S[3], tmp1); \ + tmp2 = BF_INDEX(data.ctx.S[2], tmp2); \ + tmp3 = BF_INDEX(data.ctx.S[1], tmp3); \ + tmp3 += BF_INDEX(data.ctx.S[0], tmp4); \ + tmp3 ^= tmp2; \ + R ^= data.ctx.P[N + 1]; \ + tmp3 += tmp1; \ + R ^= tmp3; +#endif + +/* + * Encrypt one block, BF_N is hardcoded here. + */ +#define BF_ENCRYPT \ + L ^= data.ctx.P[0]; \ + BF_ROUND(L, R, 0); \ + BF_ROUND(R, L, 1); \ + BF_ROUND(L, R, 2); \ + BF_ROUND(R, L, 3); \ + BF_ROUND(L, R, 4); \ + BF_ROUND(R, L, 5); \ + BF_ROUND(L, R, 6); \ + BF_ROUND(R, L, 7); \ + BF_ROUND(L, R, 8); \ + BF_ROUND(R, L, 9); \ + BF_ROUND(L, R, 10); \ + BF_ROUND(R, L, 11); \ + BF_ROUND(L, R, 12); \ + BF_ROUND(R, L, 13); \ + BF_ROUND(L, R, 14); \ + BF_ROUND(R, L, 15); \ + tmp4 = R; \ + R = L; \ + L = tmp4 ^ data.ctx.P[BF_N + 1]; + +#if BF_ASM +#define BF_body() \ + _BF_body_r(&data.ctx); +#else +#define BF_body() \ + L = R = 0; \ + ptr = data.ctx.P; \ + do { \ + ptr += 2; \ + BF_ENCRYPT; \ + *(ptr - 2) = L; \ + *(ptr - 1) = R; \ + } while (ptr < &data.ctx.P[BF_N + 2]); \ +\ + ptr = data.ctx.S[0]; \ + do { \ + ptr += 2; \ + BF_ENCRYPT; \ + *(ptr - 2) = L; \ + *(ptr - 1) = R; \ + } while (ptr < &data.ctx.S[3][0xFF]); +#endif + +static void BF_set_key(const char *key, BF_key expanded, BF_key initial, + unsigned char flags) +{ + const char *ptr = key; + unsigned int bug, i, j; + BF_word safety, sign, diff, tmp[2]; + +/* + * There was a sign extension bug in older revisions of this function. While + * we would have liked to simply fix the bug and move on, we have to provide + * a backwards compatibility feature (essentially the bug) for some systems and + * a safety measure for some others. The latter is needed because for certain + * multiple inputs to the buggy algorithm there exist easily found inputs to + * the correct algorithm that produce the same hash. Thus, we optionally + * deviate from the correct algorithm just enough to avoid such collisions. + * While the bug itself affected the majority of passwords containing + * characters with the 8th bit set (although only a percentage of those in a + * collision-producing way), the anti-collision safety measure affects + * only a subset of passwords containing the '\xff' character (not even all of + * those passwords, just some of them). This character is not found in valid + * UTF-8 sequences and is rarely used in popular 8-bit character encodings. + * Thus, the safety measure is unlikely to cause much annoyance, and is a + * reasonable tradeoff to use when authenticating against existing hashes that + * are not reliably known to have been computed with the correct algorithm. + * + * We use an approach that tries to minimize side-channel leaks of password + * information - that is, we mostly use fixed-cost bitwise operations instead + * of branches or table lookups. (One conditional branch based on password + * length remains. It is not part of the bug aftermath, though, and is + * difficult and possibly unreasonable to avoid given the use of C strings by + * the caller, which results in similar timing leaks anyway.) + * + * For actual implementation, we set an array index in the variable "bug" + * (0 means no bug, 1 means sign extension bug emulation) and a flag in the + * variable "safety" (bit 16 is set when the safety measure is requested). + * Valid combinations of settings are: + * + * Prefix "$2a$": bug = 0, safety = 0x10000 + * Prefix "$2x$": bug = 1, safety = 0 + * Prefix "$2y$": bug = 0, safety = 0 + */ + bug = (unsigned int)flags & 1; + safety = ((BF_word)flags & 2) << 15; + + sign = diff = 0; + + for (i = 0; i < BF_N + 2; i++) { + tmp[0] = tmp[1] = 0; + for (j = 0; j < 4; j++) { + tmp[0] <<= 8; + tmp[0] |= (unsigned char)*ptr; /* correct */ + tmp[1] <<= 8; + tmp[1] |= (BF_word_signed)(signed char)*ptr; /* bug */ +/* + * Sign extension in the first char has no effect - nothing to overwrite yet, + * and those extra 24 bits will be fully shifted out of the 32-bit word. For + * chars 2, 3, 4 in each four-char block, we set bit 7 of "sign" if sign + * extension in tmp[1] occurs. Once this flag is set, it remains set. + */ + if (j) + sign |= tmp[1] & 0x80; + if (!*ptr) + ptr = key; + else + ptr++; + } + diff |= tmp[0] ^ tmp[1]; /* Non-zero on any differences */ + + expanded[i] = tmp[bug]; + initial[i] = BF_init_state.P[i] ^ tmp[bug]; + } + +/* + * At this point, "diff" is zero iff the correct and buggy algorithms produced + * exactly the same result. If so and if "sign" is non-zero, which indicates + * that there was a non-benign sign extension, this means that we have a + * collision between the correctly computed hash for this password and a set of + * passwords that could be supplied to the buggy algorithm. Our safety measure + * is meant to protect from such many-buggy to one-correct collisions, by + * deviating from the correct algorithm in such cases. Let's check for this. + */ + diff |= diff >> 16; /* still zero iff exact match */ + diff &= 0xffff; /* ditto */ + diff += 0xffff; /* bit 16 set iff "diff" was non-zero (on non-match) */ + sign <<= 9; /* move the non-benign sign extension flag to bit 16 */ + sign &= ~diff & safety; /* action needed? */ + +/* + * If we have determined that we need to deviate from the correct algorithm, + * flip bit 16 in initial expanded key. (The choice of 16 is arbitrary, but + * let's stick to it now. It came out of the approach we used above, and it's + * not any worse than any other choice we could make.) + * + * It is crucial that we don't do the same to the expanded key used in the main + * Eksblowfish loop. By doing it to only one of these two, we deviate from a + * state that could be directly specified by a password to the buggy algorithm + * (and to the fully correct one as well, but that's a side-effect). + */ + initial[0] ^= sign; +} + +static char *BF_crypt(const char *key, const char *setting, + char *output, int size, + BF_word min) +{ +#if BF_ASM + extern void _BF_body_r(BF_ctx *ctx); +#endif + static const unsigned char flags_by_subtype[26] = + {2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0}; + struct { + BF_ctx ctx; + BF_key expanded_key; + union { + BF_word salt[4]; + BF_word output[6]; + } binary; + } data; + BF_word L, R; + BF_word tmp1, tmp2, tmp3, tmp4; + BF_word *ptr; + BF_word count; + int i; + + if (size < 7 + 22 + 31 + 1) { + __set_errno(ERANGE); + return NULL; + } + + if (setting[0] != '$' || + setting[1] != '2' || + setting[2] < 'a' || setting[2] > 'z' || + !flags_by_subtype[(unsigned int)(unsigned char)setting[2] - 'a'] || + setting[3] != '$' || + setting[4] < '0' || setting[4] > '3' || + setting[5] < '0' || setting[5] > '9' || + (setting[4] == '3' && setting[5] > '1') || + setting[6] != '$') { + __set_errno(EINVAL); + return NULL; + } + + count = (BF_word)1 << ((setting[4] - '0') * 10 + (setting[5] - '0')); + if (count < min || BF_decode(data.binary.salt, &setting[7], 16)) { + __set_errno(EINVAL); + return NULL; + } + BF_swap(data.binary.salt, 4); + + BF_set_key(key, data.expanded_key, data.ctx.P, + flags_by_subtype[(unsigned int)(unsigned char)setting[2] - 'a']); + + memcpy(data.ctx.S, BF_init_state.S, sizeof(data.ctx.S)); + + L = R = 0; + for (i = 0; i < BF_N + 2; i += 2) { + L ^= data.binary.salt[i & 2]; + R ^= data.binary.salt[(i & 2) + 1]; + BF_ENCRYPT; + data.ctx.P[i] = L; + data.ctx.P[i + 1] = R; + } + + ptr = data.ctx.S[0]; + do { + ptr += 4; + L ^= data.binary.salt[(BF_N + 2) & 3]; + R ^= data.binary.salt[(BF_N + 3) & 3]; + BF_ENCRYPT; + *(ptr - 4) = L; + *(ptr - 3) = R; + + L ^= data.binary.salt[(BF_N + 4) & 3]; + R ^= data.binary.salt[(BF_N + 5) & 3]; + BF_ENCRYPT; + *(ptr - 2) = L; + *(ptr - 1) = R; + } while (ptr < &data.ctx.S[3][0xFF]); + + do { + int done; + + for (i = 0; i < BF_N + 2; i += 2) { + data.ctx.P[i] ^= data.expanded_key[i]; + data.ctx.P[i + 1] ^= data.expanded_key[i + 1]; + } + + done = 0; + do { + BF_body(); + if (done) + break; + done = 1; + + tmp1 = data.binary.salt[0]; + tmp2 = data.binary.salt[1]; + tmp3 = data.binary.salt[2]; + tmp4 = data.binary.salt[3]; + for (i = 0; i < BF_N; i += 4) { + data.ctx.P[i] ^= tmp1; + data.ctx.P[i + 1] ^= tmp2; + data.ctx.P[i + 2] ^= tmp3; + data.ctx.P[i + 3] ^= tmp4; + } + data.ctx.P[16] ^= tmp1; + data.ctx.P[17] ^= tmp2; + } while (1); + } while (--count); + + for (i = 0; i < 6; i += 2) { + L = BF_magic_w[i]; + R = BF_magic_w[i + 1]; + + count = 64; + do { + BF_ENCRYPT; + } while (--count); + + data.binary.output[i] = L; + data.binary.output[i + 1] = R; + } + + memcpy(output, setting, 7 + 22 - 1); + output[7 + 22 - 1] = BF_itoa64[(int) + BF_atoi64[(int)setting[7 + 22 - 1] - 0x20] & 0x30]; + +/* This has to be bug-compatible with the original implementation, so + * only encode 23 of the 24 bytes. :-) */ + BF_swap(data.binary.output, 6); + BF_encode(&output[7 + 22], data.binary.output, 23); + output[7 + 22 + 31] = '\0'; + + return output; +} + +int _crypt_output_magic(const char *setting, char *output, int size) +{ + if (size < 3) + return -1; + + output[0] = '*'; + output[1] = '0'; + output[2] = '\0'; + + if (setting[0] == '*' && setting[1] == '0') + output[1] = '1'; + + return 0; +} + +/* + * Please preserve the runtime self-test. It serves two purposes at once: + * + * 1. We really can't afford the risk of producing incompatible hashes e.g. + * when there's something like gcc bug 26587 again, whereas an application or + * library integrating this code might not also integrate our external tests or + * it might not run them after every build. Even if it does, the miscompile + * might only occur on the production build, but not on a testing build (such + * as because of different optimization settings). It is painful to recover + * from incorrectly-computed hashes - merely fixing whatever broke is not + * enough. Thus, a proactive measure like this self-test is needed. + * + * 2. We don't want to leave sensitive data from our actual password hash + * computation on the stack or in registers. Previous revisions of the code + * would do explicit cleanups, but simply running the self-test after hash + * computation is more reliable. + * + * The performance cost of this quick self-test is around 0.6% at the "$2a$08" + * setting. + */ +char *_crypt_blowfish_rn(const char *key, const char *setting, + char *output, int size) +{ + const char *test_key = "8b \xd0\xc1\xd2\xcf\xcc\xd8"; + const char *test_setting = "$2a$00$abcdefghijklmnopqrstuu"; + static const char * const test_hash[2] = + {"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* $2x$ */ + "i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55"}; /* $2a$, $2y$ */ + char *retval; + const char *p; + int save_errno, ok; + struct { + char s[7 + 22 + 1]; + char o[7 + 22 + 31 + 1 + 1 + 1]; + } buf; + +/* Hash the supplied password */ + _crypt_output_magic(setting, output, size); + retval = BF_crypt(key, setting, output, size, 16); + save_errno = errno; + +/* + * Do a quick self-test. It is important that we make both calls to BF_crypt() + * from the same scope such that they likely use the same stack locations, + * which makes the second call overwrite the first call's sensitive data on the + * stack and makes it more likely that any alignment related issues would be + * detected by the self-test. + */ + memcpy(buf.s, test_setting, sizeof(buf.s)); + if (retval) + buf.s[2] = setting[2]; + memset(buf.o, 0x55, sizeof(buf.o)); + buf.o[sizeof(buf.o) - 1] = 0; + p = BF_crypt(test_key, buf.s, buf.o, sizeof(buf.o) - (1 + 1), 1); + + ok = (p == buf.o && + !memcmp(p, buf.s, 7 + 22) && + !memcmp(p + (7 + 22), + test_hash[(unsigned int)(unsigned char)buf.s[2] & 1], + 31 + 1 + 1 + 1)); + + { + const char *k = "\xff\xa3" "34" "\xff\xff\xff\xa3" "345"; + BF_key ae, ai, ye, yi; + BF_set_key(k, ae, ai, 2); /* $2a$ */ + BF_set_key(k, ye, yi, 4); /* $2y$ */ + ai[0] ^= 0x10000; /* undo the safety (for comparison) */ + ok = ok && ai[0] == 0xdb9c59bc && ye[17] == 0x33343500 && + !memcmp(ae, ye, sizeof(ae)) && + !memcmp(ai, yi, sizeof(ai)); + } + + __set_errno(save_errno); + if (ok) + return retval; + +/* Should not happen */ + _crypt_output_magic(setting, output, size); + __set_errno(EINVAL); /* pretend we don't support this hash type */ + return NULL; +} + +char *_crypt_gensalt_blowfish_rn(const char *prefix, unsigned long count, + const char *input, int size, char *output, int output_size) +{ + if (size < 16 || output_size < 7 + 22 + 1 || + (count && (count < 4 || count > 31)) || + prefix[0] != '$' || prefix[1] != '2' || + (prefix[2] != 'a' && prefix[2] != 'y')) { + if (output_size > 0) output[0] = '\0'; + __set_errno((output_size < 7 + 22 + 1) ? ERANGE : EINVAL); + return NULL; + } + + if (!count) count = 5; + + output[0] = '$'; + output[1] = '2'; + output[2] = prefix[2]; + output[3] = '$'; + output[4] = '0' + count / 10; + output[5] = '0' + count % 10; + output[6] = '$'; + + BF_encode(&output[7], (const BF_word *)input, 16); + output[7 + 22] = '\0'; + + return output; +} diff --git a/crypto/crypt_blowfish.h b/crypto/crypt_blowfish.h new file mode 100644 index 00000000000..2ee0d8c1d80 --- /dev/null +++ b/crypto/crypt_blowfish.h @@ -0,0 +1,27 @@ +/* + * Written by Solar Designer in 2000-2011. + * No copyright is claimed, and the software is hereby placed in the public + * domain. In case this attempt to disclaim copyright and place the software + * in the public domain is deemed null and void, then the software is + * Copyright (c) 2000-2011 Solar Designer and it is hereby released to the + * general public under the following terms: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted. + * + * There's ABSOLUTELY NO WARRANTY, express or implied. + * + * See crypt_blowfish.c for more information. + */ + +#ifndef _CRYPT_BLOWFISH_H +#define _CRYPT_BLOWFISH_H + +extern int _crypt_output_magic(const char *setting, char *output, int size); +extern char *_crypt_blowfish_rn(const char *key, const char *setting, + char *output, int size); +extern char *_crypt_gensalt_blowfish_rn(const char *prefix, + unsigned long count, + const char *input, int size, char *output, int output_size); + +#endif diff --git a/include/apr_md5.h b/include/apr_md5.h index 68bd30ead31..796f9df7298 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -132,16 +132,30 @@ APR_DECLARE(apr_status_t) apr_md5(unsigned char digest[APR_MD5_DIGESTSIZE], /** * Encode a password using an MD5 algorithm * @param password The password to encode - * @param salt The salt to use for the encoding + * @param salt The salt string to use for the encoding * @param result The string to store the encoded password in * @param nbytes The size of the result buffer */ APR_DECLARE(apr_status_t) apr_md5_encode(const char *password, const char *salt, char *result, apr_size_t nbytes); +/** + * Encode a password using the bcrypt algorithm + * @param password The password to encode + * @param count The cost of the encoding, possible values are 4 to 31 + * @param salt Pointer to binary data to be used as salt for the encoding + * @param salt_len The size of the salt data (must be >= 16) + * @param out The string to store the encoded password in + * @param out_len The size of the result buffer (must be >= 61) + */ +APR_DECLARE(apr_status_t) apr_bcrypt_encode(const char *pw, + unsigned int count, + const unsigned char *salt, + apr_size_t salt_len, + char *out, apr_size_t out_len); /** - * Validate hashes created by APR-supported algorithms: md5 and sha1. + * Validate hashes created by APR-supported algorithms: md5, bcrypt, and sha1. * hashes created by crypt are supported only on platforms that provide * crypt(3), so don't rely on that function unless you know that your * application will be run only on platforms that support it. On platforms diff --git a/test/testpass.c b/test/testpass.c index 030ef1075f8..6c39892157d 100644 --- a/test/testpass.c +++ b/test/testpass.c @@ -117,25 +117,51 @@ static void test_threadsafe(abts_case *tc, void *data) static void test_shapass(abts_case *tc, void *data) { const char *pass = "hellojed"; + const char *pass2 = "hellojed2"; char hash[100]; apr_sha1_base64(pass, strlen(pass), hash); APR_ASSERT_SUCCESS(tc, "SHA1 password validated", apr_password_validate(pass, hash)); + APR_ASSERT_FAILURE(tc, "wrong SHA1 password should not validate", + apr_password_validate(pass2, hash)); } static void test_md5pass(abts_case *tc, void *data) { const char *pass = "hellojed", *salt = "sardine"; + const char *pass2 = "hellojed2"; char hash[100]; apr_md5_encode(pass, salt, hash, sizeof hash); APR_ASSERT_SUCCESS(tc, "MD5 password validated", apr_password_validate(pass, hash)); + APR_ASSERT_FAILURE(tc, "wrong MD5 password should not validate", + apr_password_validate(pass2, hash)); } +static void test_bcryptpass(abts_case *tc, void *data) +{ + const char *pass = "hellojed"; + const char *pass2 = "hellojed2"; + unsigned char salt[] = "sardine_sardine"; + char hash[100]; + const char *hash2 = "$2a$08$qipUJiI9fySUN38hcbz.lucXvAmtgowKOWYtB9y3CXyl6lTknruou"; + const char *pass3 = "foobar"; + + apr_bcrypt_encode(pass, 5, salt, sizeof(salt), hash, sizeof(hash)); + + APR_ASSERT_SUCCESS(tc, "bcrypt password validated", + apr_password_validate(pass, hash)); + APR_ASSERT_FAILURE(tc, "wrong bcrypt password should not validate", + apr_password_validate(pass2, hash)); + APR_ASSERT_SUCCESS(tc, "bcrypt password validated", + apr_password_validate(pass3, hash2)); +} + + abts_suite *testpass(abts_suite *suite) { suite = ADD_SUITE(suite); @@ -148,6 +174,7 @@ abts_suite *testpass(abts_suite *suite) #endif /* CRYPT_ALGO_SUPPORTED */ abts_run_test(suite, test_shapass, NULL); abts_run_test(suite, test_md5pass, NULL); + abts_run_test(suite, test_bcryptpass, NULL); return suite; } From 32a8d7b22641a581bb68cc5fc73ba6acb0b2dc7f Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Thu, 5 Jul 2012 21:52:28 +0000 Subject: [PATCH 7134/7878] Run tests with -v by default, to make debugging easier git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1357957 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index 62f7b6bd3db..83a88dd8acf 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -187,7 +187,7 @@ check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) done; \ else \ @shlibpath_var@="`echo "../dbm/.libs:../dbd/.libs:$$@shlibpath_var@" | sed -e 's/::*$$//'`" \ - ./$$prog; \ + ./$$prog -v; \ status=$$?; \ if test $$status != 0; then \ teststatus=$$status; \ From 67fd8e7159a90330d909b88562a620ca50fcfcec Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Thu, 5 Jul 2012 22:09:05 +0000 Subject: [PATCH 7135/7878] add another check git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1357966 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpass.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/testpass.c b/test/testpass.c index 6c39892157d..584c94a0102 100644 --- a/test/testpass.c +++ b/test/testpass.c @@ -151,7 +151,9 @@ static void test_bcryptpass(abts_case *tc, void *data) const char *hash2 = "$2a$08$qipUJiI9fySUN38hcbz.lucXvAmtgowKOWYtB9y3CXyl6lTknruou"; const char *pass3 = "foobar"; - apr_bcrypt_encode(pass, 5, salt, sizeof(salt), hash, sizeof(hash)); + APR_ASSERT_SUCCESS(tc, "bcrypt encode password", + apr_bcrypt_encode(pass, 5, salt, sizeof(salt), hash, + sizeof(hash)); APR_ASSERT_SUCCESS(tc, "bcrypt password validated", apr_password_validate(pass, hash)); From c670f3a34db6f1ed9add120ec52ec772d7eff881 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Thu, 5 Jul 2012 22:10:19 +0000 Subject: [PATCH 7136/7878] fixup previous commit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1357968 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testpass.c b/test/testpass.c index 584c94a0102..4ed40bc9625 100644 --- a/test/testpass.c +++ b/test/testpass.c @@ -153,7 +153,7 @@ static void test_bcryptpass(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "bcrypt encode password", apr_bcrypt_encode(pass, 5, salt, sizeof(salt), hash, - sizeof(hash)); + sizeof(hash))); APR_ASSERT_SUCCESS(tc, "bcrypt password validated", apr_password_validate(pass, hash)); From 3f36f8b7b579dac4ddd38cb150f0dcf8b00322cf Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Thu, 5 Jul 2012 22:36:54 +0000 Subject: [PATCH 7137/7878] fix breakage git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1357979 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_passwd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crypto/apr_passwd.c b/crypto/apr_passwd.c index a81ccc36911..a4eb6ecad05 100644 --- a/crypto/apr_passwd.c +++ b/crypto/apr_passwd.c @@ -184,13 +184,11 @@ APR_DECLARE(apr_status_t) apr_bcrypt_encode(const char *pw, apr_size_t salt_len, char *out, apr_size_t out_len) { - apr_size_t len; char setting[40]; if (_crypt_gensalt_blowfish_rn(bcrypt_id, count, (const char *)salt, salt_len, setting, sizeof(setting)) == NULL) return APR_FROM_OS_ERROR(errno); - len = strlen(out); - if (_crypt_blowfish_rn(pw, setting, out, out_len - len) == NULL) + if (_crypt_blowfish_rn(pw, setting, out, out_len) == NULL) return APR_FROM_OS_ERROR(errno); return APR_SUCCESS; } From 120c7dcbba9ebe2ca5d80ed057b2b5405ccf946c Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 6 Jul 2012 16:32:29 +0000 Subject: [PATCH 7138/7878] Added new stuff to NetWare build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1358295 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 2 ++ build/NWGNUenvironment.inc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 1ab8b347aa4..26b4b36581d 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -316,6 +316,7 @@ FILES_lib_objs = \ $(OBJDIR)/apr_md4.o \ $(OBJDIR)/apr_md5.o \ $(OBJDIR)/apr_memcache.o \ + $(OBJDIR)/apr_passwd.o \ $(OBJDIR)/apr_pools.o \ $(OBJDIR)/apr_queue.o \ $(OBJDIR)/apr_random.o \ @@ -333,6 +334,7 @@ FILES_lib_objs = \ $(OBJDIR)/apu_dso.o \ $(OBJDIR)/buffer.o \ $(OBJDIR)/charset.o \ + $(OBJDIR)/crypt_blowfish.o \ $(OBJDIR)/common.o \ $(OBJDIR)/copy.o \ $(OBJDIR)/dir.o \ diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index c2b68d9a52a..68d341dd01f 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -129,7 +129,7 @@ ifdef METROWERKS #METROWERKS = $(ProgramFiles)\Metrowerks\CodeWarrior #endif -CC = mwccnlm -w nocmdline -nosyspath +CC = mwccnlm -w nocmdline -gccinc CPP = $(CC) CPRE = $(CC) -EP LINK = mwldnlm -w nocmdline From 108f84c10dec0df23935931c1b0a50140ec0beb2 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sat, 7 Jul 2012 00:26:07 +0000 Subject: [PATCH 7139/7878] Fix NetWare build with picky Metrowerks compiler. Suggested by Stefan Fritsch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1358480 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_md5.c | 2 +- crypto/apr_passwd.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/apr_md5.c b/crypto/apr_md5.c index d685322c0fc..3725f27d2c6 100644 --- a/crypto/apr_md5.c +++ b/crypto/apr_md5.c @@ -468,7 +468,7 @@ APR_DECLARE(apr_status_t) apr_MD5InitEBCDIC(apr_xlate_t *xlate) * Define the Magic String prefix that identifies a password as being * hashed using our algorithm. */ -static const char const *apr1_id = "$apr1$"; +static const char * const apr1_id = "$apr1$"; /* * The following MD5 password encryption code was largely borrowed from diff --git a/crypto/apr_passwd.c b/crypto/apr_passwd.c index a4eb6ecad05..980a89ab54c 100644 --- a/crypto/apr_passwd.c +++ b/crypto/apr_passwd.c @@ -34,7 +34,7 @@ #include #endif -static const char const *apr1_id = "$apr1$"; +static const char * const apr1_id = "$apr1$"; #if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) #if defined(APU_CRYPT_THREADSAFE) || !APR_HAS_THREADS || \ @@ -177,7 +177,7 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, return (strcmp(sample, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; } -static const char const *bcrypt_id = "$2y$"; +static const char * const bcrypt_id = "$2y$"; APR_DECLARE(apr_status_t) apr_bcrypt_encode(const char *pw, unsigned int count, const unsigned char *salt, From 052fddf292e48597ba7b2ed79b34628d6c63e3d9 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sun, 15 Jul 2012 21:44:55 +0000 Subject: [PATCH 7140/7878] Increase the buffer size for the hashed string sha512-crypt with custom rounds= prefix needs 115 bytes plus length of the number of rounds string to store the resulting hash. An usable buffer size of 119 limited this to 9999 rounds. Use 200 to allow for future hash algorithms with longer string lengths (e.g. due to longer salt). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1361811 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_passwd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/apr_passwd.c b/crypto/apr_passwd.c index 980a89ab54c..5bf62e13e21 100644 --- a/crypto/apr_passwd.c +++ b/crypto/apr_passwd.c @@ -99,7 +99,7 @@ static void crypt_mutex_unlock() APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, const char *hash) { - char sample[120]; + char sample[200]; #if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) char *crypt_pw; #endif From 1402932565dad74d922bad3e17e4de09f86de1f6 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 16 Jul 2012 20:37:16 +0000 Subject: [PATCH 7141/7878] Avoid copying the hashed password to a temp buffer, if possible. Noted by Jason Ovich PR: 53410 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1362241 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_passwd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto/apr_passwd.c b/crypto/apr_passwd.c index 5bf62e13e21..9c30395c090 100644 --- a/crypto/apr_passwd.c +++ b/crypto/apr_passwd.c @@ -125,7 +125,7 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, * It's not our algorithm, so feed it to crypt() if possible. */ #if defined(WIN32) || defined(BEOS) || defined(NETWARE) - apr_cpystrn(sample, passwd, sizeof(sample) - 1); + return (strcmp(passwd, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; #elif defined(CRYPT_R_CRYPTD) CRYPTD buffer; @@ -133,7 +133,7 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, if (!crypt_pw) { return APR_EMISMATCH; } - apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); + return (strcmp(crypt_pw, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; #elif defined(CRYPT_R_STRUCT_CRYPT_DATA) struct crypt_data buffer; @@ -150,7 +150,7 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, if (!crypt_pw) { return APR_EMISMATCH; } - apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); + return (strcmp(crypt_pw, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; #else /* Do a bit of sanity checking since we know that crypt_r() * should always be used for threaded builds on AIX, and @@ -170,8 +170,8 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, crypt_mutex_unlock(); return APR_EMISMATCH; } - apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); crypt_mutex_unlock(); + return (strcmp(crypt_pw, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; #endif } return (strcmp(sample, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; From bf4135e0eb2f4c008a539e670d8a772ac4765dc2 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 16 Jul 2012 20:54:53 +0000 Subject: [PATCH 7142/7878] Forward port r1211337 from apr-util 1.4: Some compilers don't allow empty structure declarations git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1362248 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_nss.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 29519e77c6f..02b147a6a5e 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -57,6 +57,7 @@ struct apr_crypto_t { }; struct apr_crypto_config_t { + void *opaque; }; struct apr_crypto_key_t { From d4d2fe576cc4c6c6ddf58c42eff655b4f1d27320 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 16 Jul 2012 20:59:41 +0000 Subject: [PATCH 7143/7878] Forward port r1211219 from apr-util 1.4: Use different base. This one was from odbc driver git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1362252 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_freetds.dsp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dbd/apr_dbd_freetds.dsp b/dbd/apr_dbd_freetds.dsp index ae5756b74d9..f69ffac4bba 100644 --- a/dbd/apr_dbd_freetds.dsp +++ b/dbd/apr_dbd_freetds.dsp @@ -54,8 +54,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_freetds-1.dll" /pdb:"Release\apr_dbd_freetds-1.pdb" /implib:"Release\apr_dbd_freetds-1.lib" /MACHINE:X86 /opt:ref +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_freetds-1.dll" /pdb:"Release\apr_dbd_freetds-1.pdb" /implib:"Release\apr_dbd_freetds-1.lib" /MACHINE:X86 /opt:ref # Begin Special Build Tool TargetPath=Release\apr_dbd_freetds-1.dll SOURCE="$(InputPath)" @@ -86,8 +86,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_freetds-1.dll" /pdb:"Debug\apr_dbd_freetds-1.pdb" /implib:"Debug\apr_dbd_freetds-1.lib" /MACHINE:X86 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_freetds-1.dll" /pdb:"Debug\apr_dbd_freetds-1.pdb" /implib:"Debug\apr_dbd_freetds-1.lib" /MACHINE:X86 # Begin Special Build Tool TargetPath=Debug\apr_dbd_freetds-1.dll SOURCE="$(InputPath)" @@ -118,8 +118,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_freetds-1.dll" /pdb:"x64\Release\apr_dbd_freetds-1.pdb" /implib:"x64\Release\apr_dbd_freetds-1.lib" /MACHINE:X64 /opt:ref +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_freetds-1.dll" /pdb:"x64\Release\apr_dbd_freetds-1.pdb" /implib:"x64\Release\apr_dbd_freetds-1.lib" /MACHINE:X64 /opt:ref # Begin Special Build Tool TargetPath=x64\Release\apr_dbd_freetds-1.dll SOURCE="$(InputPath)" @@ -150,8 +150,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_freetds-1.dll" /pdb:"x64\Debug\apr_dbd_freetds-1.pdb" /implib:"x64\Debug\apr_dbd_freetds-1.lib" /MACHINE:X64 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_freetds-1.dll" /pdb:"x64\Debug\apr_dbd_freetds-1.pdb" /implib:"x64\Debug\apr_dbd_freetds-1.lib" /MACHINE:X64 # Begin Special Build Tool TargetPath=x64\Debug\apr_dbd_freetds-1.dll SOURCE="$(InputPath)" From cceabe915789f1497add1494d29f787c349ab4a0 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 16 Jul 2012 21:05:38 +0000 Subject: [PATCH 7144/7878] Forward port r1211223 from 1.4: Use uniques bases. The current one were in collision with dbd drivers git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1362255 13f79535-47bb-0310-9956-ffa450edef68 --- dbm/apr_dbm_db.dsp | 16 ++++++++-------- dbm/apr_dbm_gdbm.dsp | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dbm/apr_dbm_db.dsp b/dbm/apr_dbm_db.dsp index c4a94756a9b..28624419039 100644 --- a/dbm/apr_dbm_db.dsp +++ b/dbm/apr_dbm_db.dsp @@ -54,8 +54,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbm_db-1.dll" /pdb:"Release\apr_dbm_db-1.pdb" /implib:"Release\apr_dbm_db-1.lib" /MACHINE:X86 /opt:ref +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbm_db-1.dll" /pdb:"Release\apr_dbm_db-1.pdb" /implib:"Release\apr_dbm_db-1.lib" /MACHINE:X86 /opt:ref # Begin Special Build Tool TargetPath=Release\apr_dbm_db-1.dll SOURCE="$(InputPath)" @@ -86,8 +86,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbm_db-1.dll" /pdb:"Debug\apr_dbm_db-1.pdb" /implib:"Debug\apr_dbm_db-1.lib" /MACHINE:X86 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbm_db-1.dll" /pdb:"Debug\apr_dbm_db-1.pdb" /implib:"Debug\apr_dbm_db-1.lib" /MACHINE:X86 # Begin Special Build Tool TargetPath=Debug\apr_dbm_db-1.dll SOURCE="$(InputPath)" @@ -118,8 +118,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbm_db-1.dll" /pdb:"x64\Release\apr_dbm_db-1.pdb" /implib:"x64\Release\apr_dbm_db-1.lib" /MACHINE:X64 /opt:ref +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbm_db-1.dll" /pdb:"x64\Release\apr_dbm_db-1.pdb" /implib:"x64\Release\apr_dbm_db-1.lib" /MACHINE:X64 /opt:ref # Begin Special Build Tool TargetPath=x64\Release\apr_dbm_db-1.dll SOURCE="$(InputPath)" @@ -150,8 +150,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbm_db-1.dll" /pdb:"x64\Debug\apr_dbm_db-1.pdb" /implib:"x64\Debug\apr_dbm_db-1.lib" /MACHINE:X64 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbm_db-1.dll" /pdb:"x64\Debug\apr_dbm_db-1.pdb" /implib:"x64\Debug\apr_dbm_db-1.lib" /MACHINE:X64 # Begin Special Build Tool TargetPath=x64\Debug\apr_dbm_db-1.dll SOURCE="$(InputPath)" diff --git a/dbm/apr_dbm_gdbm.dsp b/dbm/apr_dbm_gdbm.dsp index d2fa6d65ce5..eaa51ca515b 100644 --- a/dbm/apr_dbm_gdbm.dsp +++ b/dbm/apr_dbm_gdbm.dsp @@ -54,8 +54,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbm_gdbm-1.dll" /pdb:"Release\apr_dbm_gdbm-1.pdb" /implib:"Release\apr_dbm_gdbm-1.lib" /MACHINE:X86 /opt:ref +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbm_gdbm-1.dll" /pdb:"Release\apr_dbm_gdbm-1.pdb" /implib:"Release\apr_dbm_gdbm-1.lib" /MACHINE:X86 /opt:ref # Begin Special Build Tool TargetPath=Release\apr_dbm_gdbm-1.dll SOURCE="$(InputPath)" @@ -86,8 +86,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbm_gdbm-1.dll" /pdb:"Debug\apr_dbm_gdbm-1.pdb" /implib:"Debug\apr_dbm_gdbm-1.lib" /MACHINE:X86 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbm_gdbm-1.dll" /pdb:"Debug\apr_dbm_gdbm-1.pdb" /implib:"Debug\apr_dbm_gdbm-1.lib" /MACHINE:X86 # Begin Special Build Tool TargetPath=Debug\apr_dbm_gdbm-1.dll SOURCE="$(InputPath)" @@ -118,8 +118,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbm_gdbm-1.dll" /pdb:"x64\Release\apr_dbm_gdbm-1.pdb" /implib:"x64\Release\apr_dbm_gdbm-1.lib" /MACHINE:X64 /opt:ref +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbm_gdbm-1.dll" /pdb:"x64\Release\apr_dbm_gdbm-1.pdb" /implib:"x64\Release\apr_dbm_gdbm-1.lib" /MACHINE:X64 /opt:ref # Begin Special Build Tool TargetPath=x64\Release\apr_dbm_gdbm-1.dll SOURCE="$(InputPath)" @@ -150,8 +150,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbm_gdbm-1.dll" /pdb:"x64\Debug\apr_dbm_gdbm-1.pdb" /implib:"x64\Debug\apr_dbm_gdbm-1.lib" /MACHINE:X64 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbm_gdbm-1.dll" /pdb:"x64\Debug\apr_dbm_gdbm-1.pdb" /implib:"x64\Debug\apr_dbm_gdbm-1.lib" /MACHINE:X64 # Begin Special Build Tool TargetPath=x64\Debug\apr_dbm_gdbm-1.dll SOURCE="$(InputPath)" From e85467294b53e8aa86af4955754004d44e401b8b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 18 Jul 2012 11:51:37 +0000 Subject: [PATCH 7145/7878] APR dbd FreeTDS support: Fix spurious API errors caused by unitialized fields. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use apr_pcalloc instead of apr_palloc when allocating the dbd structure so that all fields are initialized. Submitted by: TROY.LIU åŠ‰æ˜¥å‰ Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1362892 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_freetds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbd/apr_dbd_freetds.c b/dbd/apr_dbd_freetds.c index a00db4b88ce..ab036140595 100644 --- a/dbd/apr_dbd_freetds.c +++ b/dbd/apr_dbd_freetds.c @@ -627,7 +627,7 @@ static apr_dbd_t *dbd_freetds_open(apr_pool_t *pool, const char *params, if (process == NULL) { return NULL; } - sql = apr_palloc (pool, sizeof (apr_dbd_t)); + sql = apr_pcalloc(pool, sizeof (apr_dbd_t)); sql->pool = pool; sql->proc = process; sql->params = params; From db8937da51ba8c4ae96ced402f001cc37a71da79 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Wed, 18 Jul 2012 19:54:39 +0000 Subject: [PATCH 7146/7878] Include new files in Windows build Untested, testers welcome git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1363076 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apr.dsp b/apr.dsp index ad54e04ef5e..e24ab3f4d10 100644 --- a/apr.dsp +++ b/apr.dsp @@ -216,10 +216,22 @@ SOURCE=.\crypto\apr_md5.c # End Source File # Begin Source File +SOURCE=.\crypto\apr_passwd.c +# End Source File +# Begin Source File + SOURCE=.\crypto\apr_sha1.c # End Source File # Begin Source File +SOURCE=.\crypto\crypt_blowfish.c +# End Source File +# Begin Source File + +SOURCE=.\crypto\crypt_blowfish.h +# End Source File +# Begin Source File + SOURCE=.\crypto\getuuid.c # End Source File # Begin Source File From b3a36c2c025cf25a27be7e9afbd185e8785293a0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 18 Jul 2012 23:16:30 +0000 Subject: [PATCH 7147/7878] follow up to r1363076: include new crypto files in libapr.dsp too git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1363168 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libapr.dsp b/libapr.dsp index ef0139d5fc5..a53774d523e 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -251,10 +251,22 @@ SOURCE=.\crypto\apr_md5.c # End Source File # Begin Source File +SOURCE=.\crypto\apr_passwd.c +# End Source File +# Begin Source File + SOURCE=.\crypto\apr_sha1.c # End Source File # Begin Source File +SOURCE=.\crypto\crypt_blowfish.c +# End Source File +# Begin Source File + +SOURCE=.\crypto\crypt_blowfish.h +# End Source File +# Begin Source File + SOURCE=.\crypto\getuuid.c # End Source File # Begin Source File From 594a17f274d476429157fce71a14345275d4c69f Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 20 Jul 2012 02:08:52 +0000 Subject: [PATCH 7148/7878] mwccnlm: search directory of referencing file first for #includes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1363624 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUenvironment.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 68d341dd01f..d9699f41ddb 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -150,7 +150,7 @@ PLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP # The default flags are as follows: # # -w nocmdline disable command-line driver/parser warnings -# -nosyspath treat #include <...> like #include "..." +# -gccinc search directory of referencing file first for #includes # -Cpp_exceptions off disable C++ exceptions # -RTTI off disable C++ run-time typing information # -align 4 align on 4 byte bounderies From ab30abeaa0de11bed91f2b240402af6651ccf0c7 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Mon, 30 Jul 2012 09:47:03 +0000 Subject: [PATCH 7149/7878] * Prevent apr_table_mergen from aborting when APR_POOL_DEBUG is set and key or value are static literals not stored in pool managed memory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1367050 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 51b23407cc0..683f48a16ee 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -730,15 +730,18 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, apr_table_entry_t *next_elt; apr_table_entry_t *end_elt; apr_uint32_t checksum; + apr_pool_t *pool; int hash; #if APR_POOL_DEBUG { - if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) { + pool = apr_pool_find(key); + if ((pool != key) && (!apr_pool_is_ancestor(pool, t->a.pool))) { fprintf(stderr, "apr_table_mergen: key not in ancestor pool of t\n"); abort(); } - if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) { + pool = apr_pool_find(val); + if ((pool != val) && (!apr_pool_is_ancestor(pool, t->a.pool))) { fprintf(stderr, "apr_table_mergen: val not in ancestor pool of t\n"); abort(); } From ed9dfd3bc7f23542873038f94ad8dc2c7fd5d2ee Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 1 Aug 2012 12:02:00 +0000 Subject: [PATCH 7150/7878] Update for Mountain Lion / OSX 10.8 / Darwin 12.x git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1367943 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index e0ce0547941..5cbeb7bc105 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -203,7 +203,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(ac_cv_func_kqueue, [no]) APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332 ;; - *-apple-darwin1[[01]].*) + *-apple-darwin1[[012]].*) APR_ADDTO(CPPFLAGS, [-DDARWIN_10]) ;; esac From 56d10289ef81a14bd085b677b7fd919dbe4adc7a Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Fri, 3 Aug 2012 07:47:37 +0000 Subject: [PATCH 7151/7878] * We only need the pool variable in the debug case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1368819 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 683f48a16ee..7479ef47c7a 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -730,11 +730,11 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, apr_table_entry_t *next_elt; apr_table_entry_t *end_elt; apr_uint32_t checksum; - apr_pool_t *pool; int hash; #if APR_POOL_DEBUG { + apr_pool_t *pool; pool = apr_pool_find(key); if ((pool != key) && (!apr_pool_is_ancestor(pool, t->a.pool))) { fprintf(stderr, "apr_table_mergen: key not in ancestor pool of t\n"); From c1ece9018c60a14c562fd429c604fd94734665db Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sun, 5 Aug 2012 21:06:58 +0000 Subject: [PATCH 7152/7878] Allow apr_dbd_get_row() to be called with a different pool than apr_dbd_select() PR: 53533 Submitted by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1369681 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_freetds.c | 2 +- dbd/apr_dbd_mysql.c | 2 +- dbd/apr_dbd_pgsql.c | 2 +- dbd/apr_dbd_sqlite2.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dbd/apr_dbd_freetds.c b/dbd/apr_dbd_freetds.c index ab036140595..167a8b86374 100644 --- a/dbd/apr_dbd_freetds.c +++ b/dbd/apr_dbd_freetds.c @@ -327,7 +327,7 @@ static int dbd_freetds_get_row(apr_pool_t *pool, apr_dbd_results_t *res, case SUCCEED: return 0; case REG_ROW: return 0; case NO_MORE_ROWS: - apr_pool_cleanup_run(pool, res->proc, clear_result); + apr_pool_cleanup_run(res->pool, res->proc, clear_result); *rowp = NULL; return -1; case FAIL: return 1; diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c index ddad6c89c93..e38925ee4a1 100644 --- a/dbd/apr_dbd_mysql.c +++ b/dbd/apr_dbd_mysql.c @@ -324,7 +324,7 @@ static int dbd_mysql_get_row(apr_pool_t *pool, apr_dbd_results_t *res, (*row)->len = mysql_fetch_lengths(res->res); } else { - apr_pool_cleanup_run(pool, res->res, free_result); + apr_pool_cleanup_run(res->pool, res->res, free_result); } return ret; } diff --git a/dbd/apr_dbd_pgsql.c b/dbd/apr_dbd_pgsql.c index dcc434d8e35..af09e0a478f 100644 --- a/dbd/apr_dbd_pgsql.c +++ b/dbd/apr_dbd_pgsql.c @@ -264,7 +264,7 @@ static int dbd_pgsql_get_row(apr_pool_t *pool, apr_dbd_results_t *res, if (res->random) { if ((row->n >= 0) && (size_t)row->n >= res->ntuples) { *rowp = NULL; - apr_pool_cleanup_run(pool, res->res, clear_result); + apr_pool_cleanup_run(res->pool, res->res, clear_result); res->res = NULL; return -1; } diff --git a/dbd/apr_dbd_sqlite2.c b/dbd/apr_dbd_sqlite2.c index 22bf2de5a5f..af72b931fbd 100644 --- a/dbd/apr_dbd_sqlite2.c +++ b/dbd/apr_dbd_sqlite2.c @@ -153,7 +153,7 @@ static int dbd_sqlite_get_row(apr_pool_t * pool, apr_dbd_results_t * res, if (row->n >= res->ntuples) { *rowp = NULL; - apr_pool_cleanup_run(pool, res->res, free_table); + apr_pool_cleanup_run(res->pool, res->res, free_table); res->res = NULL; return -1; } From b1b30bfca8b22e0a8ef26fc5efcc84624cdee7a2 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Tue, 7 Aug 2012 20:16:38 +0000 Subject: [PATCH 7153/7878] Update config.guess and config.sub from http://git.savannah.gnu.org/cgit/config.git. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1370494 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 61 +++++++++++++++++++++------------- build/config.sub | 82 ++++++++++++++++++++++++++++++---------------- 2 files changed, 93 insertions(+), 50 deletions(-) diff --git a/build/config.guess b/build/config.guess index 40eaed4821e..ad5f74ab8c3 100755 --- a/build/config.guess +++ b/build/config.guess @@ -2,9 +2,9 @@ # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2011-05-11' +timestamp='2012-07-31' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,9 +17,7 @@ timestamp='2011-05-11' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -57,8 +55,8 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -145,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -202,6 +200,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -792,21 +794,26 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 @@ -861,6 +868,13 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -895,13 +909,16 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -943,7 +960,7 @@ EOF test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -978,13 +995,13 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-tilera-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -1246,7 +1263,7 @@ EOF NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; - NSE-?:NONSTOP_KERNEL:*:*) + NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1315,11 +1332,11 @@ EOF i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - eval $set_cc_for_build cat >$dummy.c <. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -76,8 +74,8 @@ version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -132,6 +130,10 @@ case $maybe_os in os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -223,6 +225,12 @@ case $os in -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; -lynx*) os=-lynxos ;; @@ -247,17 +255,22 @@ case $basic_machine in # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ + | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ + | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ @@ -291,7 +304,7 @@ case $basic_machine in | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ - | rx \ + | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ @@ -300,7 +313,7 @@ case $basic_machine in | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ - | v850 | v850e \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -315,8 +328,7 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -329,7 +341,10 @@ case $basic_machine in strongarm | thumb | xscale) basic_machine=arm-unknown ;; - + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; xscaleeb) basic_machine=armeb-unknown ;; @@ -352,11 +367,13 @@ case $basic_machine in # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ + | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ @@ -365,8 +382,10 @@ case $basic_machine in | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ @@ -400,7 +419,7 @@ case $basic_machine in | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | romp-* | rs6000-* | rx-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ @@ -408,10 +427,11 @@ case $basic_machine in | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile-* | tilegx-* \ + | tile*-* \ | tron-* \ | ubicom32-* \ - | v850-* | v850e-* | vax-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -711,7 +731,6 @@ case $basic_machine in i370-ibm* | ibm*) basic_machine=i370-ibm ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -772,6 +791,10 @@ case $basic_machine in microblaze) basic_machine=microblaze-xilinx ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -808,10 +831,18 @@ case $basic_machine in ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; + msys) + basic_machine=i386-pc + os=-msys + ;; mvs) basic_machine=i370-ibm os=-mvs ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -1120,13 +1151,8 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - # This must be matched before tile*. - tilegx*) - basic_machine=tilegx-unknown - os=-linux-gnu - ;; tile*) - basic_machine=tile-unknown + basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) @@ -1330,14 +1356,14 @@ case $os in | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ @@ -1521,6 +1547,9 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + hexagon-*) + os=-elf + ;; tic54x-*) os=-coff ;; @@ -1548,9 +1577,6 @@ case $basic_machine in ;; m68000-sun) os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 ;; m68*-cisco) os=-aout From 92d4cda020e4031dea7347a6eee2c333b01a0f1d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 8 Aug 2012 01:22:44 +0000 Subject: [PATCH 7154/7878] apr_password_validate(): Fix intermittent errors on systems such as FreeBSD where the crypt() function is used. (broken recently by r1362241) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1370626 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_passwd.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/crypto/apr_passwd.c b/crypto/apr_passwd.c index 9c30395c090..73d830a6359 100644 --- a/crypto/apr_passwd.c +++ b/crypto/apr_passwd.c @@ -160,18 +160,23 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, #if defined(_AIX) && APR_HAS_THREADS #error Configuration error! crypt_r() should have been selected! #endif + { + apr_status_t rv; - /* Handle thread safety issues by holding a mutex around the - * call to crypt(). - */ - crypt_mutex_lock(); - crypt_pw = crypt(passwd, hash); - if (!crypt_pw) { + /* Handle thread safety issues by holding a mutex around the + * call to crypt(). + */ + crypt_mutex_lock(); + crypt_pw = crypt(passwd, hash); + if (!crypt_pw) { + rv = APR_EMISMATCH; + } + else { + rv = (strcmp(crypt_pw, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; + } crypt_mutex_unlock(); - return APR_EMISMATCH; + return rv; } - crypt_mutex_unlock(); - return (strcmp(crypt_pw, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; #endif } return (strcmp(sample, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; From 213ceefa7c1b2dee505c4d8cccba46981b40fc40 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 10 Aug 2012 19:34:52 +0000 Subject: [PATCH 7155/7878] Use APR_ADDTO when setting LDADD variables instead of simply overwriting them. . This allows to preset the variables e.g. with rpath flags before running configure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1371811 13f79535-47bb-0310-9956-ffa450edef68 --- build/crypto.m4 | 4 ++-- build/dbd.m4 | 16 ++++++++-------- build/dbm.m4 | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/build/crypto.m4 b/build/crypto.m4 index 34bd1999836..8ed889efd82 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -108,7 +108,7 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_openssl" = "1"; then - LDADD_crypto_openssl="$openssl_LDFLAGS -lssl -lcrypto" + APR_ADDTO(LDADD_crypto_openssl, [$openssl_LDFLAGS -lssl -lcrypto]) apu_have_crypto=1 AC_MSG_CHECKING([for const input buffers in OpenSSL]) @@ -192,7 +192,7 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_nss" = "1"; then - LDADD_crypto_nss="$nss_LDFLAGS -lnspr4 -lnss3" + APR_ADDTO(LDADD_crypto_nss, [$nss_LDFLAGS -lnspr4 -lnss3]) apu_have_crypto=1 fi AC_SUBST(LDADD_crypto_nss) diff --git a/build/dbd.m4 b/build/dbd.m4 index 66677b33207..23098f9345e 100644 --- a/build/dbd.m4 +++ b/build/dbd.m4 @@ -147,7 +147,7 @@ AC_DEFUN([APU_CHECK_DBD], [ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_pgsql" = "1"; then - LDADD_dbd_pgsql="$pgsql_LDFLAGS -lpq $pgsql_LIBS" + APR_ADDTO(LDADD_dbd_pgsql, [$pgsql_LDFLAGS -lpq $pgsql_LIBS]) fi AC_SUBST(LDADD_dbd_pgsql) @@ -229,7 +229,7 @@ AC_DEFUN([APU_CHECK_DBD_MYSQL], [ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_mysql" = "1"; then - LDADD_dbd_mysql="$mysql_LDFLAGS -lmysqlclient_r $mysql_LIBS" + APR_ADDTO(LDADD_dbd_mysql, [$mysql_LDFLAGS -lmysqlclient_r $mysql_LIBS]) fi AC_SUBST(LDADD_dbd_mysql) @@ -273,7 +273,7 @@ AC_DEFUN([APU_CHECK_DBD_SQLITE3], [ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_sqlite3" = "1"; then - LDADD_dbd_sqlite3="$sqlite3_LDFLAGS -lsqlite3" + APR_ADDTO(LDADD_dbd_sqlite3, [$sqlite3_LDFLAGS -lsqlite3]) fi AC_SUBST(LDADD_dbd_sqlite3) @@ -317,7 +317,7 @@ AC_DEFUN([APU_CHECK_DBD_SQLITE2], [ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_sqlite2" = "1"; then - LDADD_dbd_sqlite2="$sqlite2_LDFLAGS -lsqlite" + APR_ADDTO(LDADD_dbd_sqlite2, [$sqlite2_LDFLAGS -lsqlite]) fi AC_SUBST(LDADD_dbd_sqlite2) @@ -399,7 +399,7 @@ AC_DEFUN([APU_CHECK_DBD_ORACLE], [ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_oracle" = "1"; then - LDADD_dbd_oracle="$oracle_LDFLAGS -lclntsh $oracle_LIBS" + APR_ADDTO(LDADD_dbd_oracle, [$oracle_LDFLAGS -lclntsh $oracle_LIBS]) fi AC_SUBST(LDADD_dbd_oracle) @@ -454,10 +454,10 @@ AC_DEFUN([APU_CHECK_DBD_FREETDS], [ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_freetds" = "1"; then - LDADD_dbd_freetds="$sybdb_LDFLAGS -lsybdb" + APR_ADDTO(LDADD_dbd_freetds, [$sybdb_LDFLAGS -lsybdb]) dnl Erm, I needed pcreposix, but I think that dependency has gone dnl from the current code - dnl LDADD_dbd_freetds="$LDADD_dbd_freetds -lsybdb -lpcreposix" + dnl APR_ADDTO(LDADD_dbd_freetds, [-lpcreposix]) fi AC_SUBST(LDADD_dbd_freetds) @@ -551,7 +551,7 @@ AC_DEFUN([APU_CHECK_DBD_ODBC], [ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_odbc" = "1"; then - LDADD_dbd_odbc="$odbc_LDFLAGS -lodbc $odbc_LIBS" + APR_ADDTO(LDADD_dbd_odbc, [$odbc_LDFLAGS -lodbc $odbc_LIBS]) fi AC_SUBST(LDADD_dbd_odbc) diff --git a/build/dbm.m4 b/build/dbm.m4 index 03a82f64d57..0d85d4dcd5a 100644 --- a/build/dbm.m4 +++ b/build/dbm.m4 @@ -1008,20 +1008,20 @@ AC_DEFUN([APU_CHECK_DBM], [ AC_SUBST(apu_db_version) if test "$apu_have_db" = "1"; then - LDADD_dbm_db="-l$apu_db_lib" + APR_ADDTO(LDADD_dbm_db, [-l$apu_db_lib]) if test -n "apu_db_xtra_libs"; then - LDADD_dbm_db="$LDADD_dbm_db $apu_db_xtra_libs" + APR_ADDTO(LDADD_dbm_db, [$apu_db_xtra_libs]) fi fi dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_gdbm" = "1"; then - LDADD_dbm_gdbm="-lgdbm" + APR_ADDTO(LDADD_dbm_gdbm, [-lgdbm]) fi if test "$apu_have_ndbm" = "1"; then - LDADD_dbm_ndbm="-l$apu_ndbm_lib" + APR_ADDTO(LDADD_dbm_ndbm, [-l$apu_ndbm_lib]) fi AC_SUBST(LDADD_dbm_db) From abb417025a7e3e52aa0bbb7de5b50b670cb8ca26 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 10 Aug 2012 19:57:35 +0000 Subject: [PATCH 7156/7878] Reduce code duplication in Berkeley DB detection m4 macros. Add support for BDB 5.2 and 5.3. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1371817 13f79535-47bb-0310-9956-ffa450edef68 --- build/dbm.m4 | 439 +++++++-------------------------------------------- 1 file changed, 59 insertions(+), 380 deletions(-) diff --git a/build/dbm.m4 b/build/dbm.m4 index 0d85d4dcd5a..4df34794430 100644 --- a/build/dbm.m4 +++ b/build/dbm.m4 @@ -367,219 +367,28 @@ AC_DEFUN([APU_CHECK_DB3], [ dnl -dnl APU_CHECK_DB4: is DB4 present? +dnl APU_CHECK_DBXY: is DBX.Y present? dnl dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version dnl -AC_DEFUN([APU_CHECK_DB4], [ +AC_DEFUN([APU_CHECK_DBXY], [ places=$1 + db_major=$2 + db_minor=$3 if test -z "$places"; then - places="std /usr/local /usr/local/BerkeleyDB.4.0 /boot/home/config" + places="std /usr/local /usr/local/BerkeleyDB.${db_major}.${db_minor} /boot/home/config" fi - APU_CHECK_BERKELEY_DB("4", "0", "-1", + APU_CHECK_BERKELEY_DB("${db_major}", "${db_minor}", "-1", "$places", - "db4/db.h db.h", - "db-4.0 db4 db" + "db${db_major}${db_minor}/db.h db${db_major}/db.h db.h", + "db-${db_major}.${db_minor} db${db_major}-${db_major}.${db_minor} db${db_major}${db_minor} db${db_major} db" ) if test "$apu_have_db" = "1"; then - apu_db_version=4 + apu_db_version=${db_major} fi ]) -dnl -dnl APU_CHECK_DB41: is DB4.1 present? -dnl -dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version -dnl -AC_DEFUN([APU_CHECK_DB41], [ - places=$1 - if test -z "$places"; then - places="std /usr/local /usr/local/BerkeleyDB.4.1 /boot/home/config" - fi - APU_CHECK_BERKELEY_DB("4", "1", "-1", - "$places", - "db41/db.h db4/db.h db.h", - "db-4.1 db41 db4 db" - ) - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi -]) - - -dnl -dnl APU_CHECK_DB42: is DB4.2 present? -dnl -dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version -dnl -AC_DEFUN([APU_CHECK_DB42], [ - places=$1 - if test -z "$places"; then - places="std /usr/local /usr/local/BerkeleyDB.4.2 /boot/home/config" - fi - APU_CHECK_BERKELEY_DB("4", "2", "-1", - "$places", - "db42/db.h db4/db.h db.h", - "db-4.2 db42 db4 db" - ) - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi -]) -dnl -dnl APU_CHECK_DB43: is DB4.3 present? -dnl -dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version -dnl -AC_DEFUN([APU_CHECK_DB43], [ - places=$1 - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.3 /boot/home/config" - fi - APU_CHECK_BERKELEY_DB("4", "3", "-1", - "$places", - "db43/db.h db4/db.h db.h", - "db-4.3 db4-4.3 db43 db4 db" - ) - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi -]) -dnl -dnl APU_CHECK_DB44: is DB4.4 present? -dnl -dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version -dnl -AC_DEFUN([APU_CHECK_DB44], [ - places=$1 - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.4 /boot/home/config" - fi - APU_CHECK_BERKELEY_DB("4", "4", "-1", - "$places", - "db44/db.h db4/db.h db.h", - "db-4.4 db4-4.4 db44 db4 db" - ) - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi -]) -dnl -dnl APU_CHECK_DB45: is DB4.5 present? -dnl -dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version -dnl -AC_DEFUN([APU_CHECK_DB45], [ - places=$1 - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.5 /boot/home/config" - fi - APU_CHECK_BERKELEY_DB("4", "5", "-1", - "$places", - "db45/db.h db4/db.h db.h", - "db-4.5 db4-4.5 db45 db4 db" - ) - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi -]) -dnl -dnl APU_CHECK_DB46: is DB4.6 present? -dnl -dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version -dnl -AC_DEFUN([APU_CHECK_DB46], [ - places=$1 - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.6 /boot/home/config" - fi - APU_CHECK_BERKELEY_DB("4", "6", "-1", - "$places", - "db46/db.h db4/db.h db.h", - "db-4.6 db4-4.6 db46 db4 db" - ) - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi -]) -dnl -dnl APU_CHECK_DB47: is DB4.7 present? -dnl -dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version -dnl -AC_DEFUN([APU_CHECK_DB47], [ - places=$1 - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.7 /boot/home/config" - fi - APU_CHECK_BERKELEY_DB("4", "7", "-1", - "$places", - "db47/db.h db4/db.h db.h", - "db-4.7 db4-4.7 db47 db4 db" - ) - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi -]) -dnl -dnl APU_CHECK_DB48: is DB4.8 present? -dnl -dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version -dnl -AC_DEFUN([APU_CHECK_DB48], [ - places=$1 - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.8 /boot/home/config" - fi - APU_CHECK_BERKELEY_DB("4", "8", "-1", - "$places", - "db48/db.h db4/db.h db.h", - "db-4.8 db4-4.8 db48 db4 db" - ) - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi -]) -dnl -dnl APU_CHECK_DB50: is DB5.0 present? -dnl -dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version -dnl -AC_DEFUN([APU_CHECK_DB50], [ - places=$1 - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.5.0 /boot/home/config" - fi - APU_CHECK_BERKELEY_DB("5", "0", "-1", - "$places", - "db50/db.h db5/db.h db.h", - "db-5.0 db5-5.0 db50 db5 db" - ) - if test "$apu_have_db" = "1"; then - apu_db_version=5 - fi -]) -dnl -dnl APU_CHECK_DB51: is DB5.1 present? -dnl -dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version -dnl -AC_DEFUN([APU_CHECK_DB51], [ - places=$1 - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.5.1 /boot/home/config" - fi - APU_CHECK_BERKELEY_DB("5", "1", "-1", - "$places", - "db51/db.h db5/db.h db.h", - "db-5.1 db5-5.1 db51 db5 db" - ) - if test "$apu_have_db" = "1"; then - apu_db_version=5 - fi -]) - AC_DEFUN([APU_CHECK_DB], [ requested=$1 check_places=$2 @@ -615,70 +424,12 @@ AC_DEFUN([APU_CHECK_DB], [ AC_MSG_ERROR(Berkeley db3 not found) fi ;; - db4) - APU_CHECK_DB4("$check_places") - if test "$apu_db_version" != "4"; then - AC_MSG_ERROR(Berkeley db4 not found) - fi - ;; - db41) - APU_CHECK_DB41("$check_places") - if test "$apu_db_version" != "4"; then - AC_MSG_ERROR(Berkeley db4 not found) - fi - ;; - db42) - APU_CHECK_DB42("$check_places") - if test "$apu_db_version" != "4"; then - AC_MSG_ERROR(Berkeley db4 not found) - fi - ;; - db43) - APU_CHECK_DB43("$check_places") - if test "$apu_db_version" != "4"; then - AC_MSG_ERROR(Berkeley db4 not found) - fi - ;; - db44) - APU_CHECK_DB44("$check_places") - if test "$apu_db_version" != "4"; then - AC_MSG_ERROR(Berkeley db4 not found) - fi - ;; - db45) - APU_CHECK_DB45("$check_places") - if test "$apu_db_version" != "4"; then - AC_MSG_ERROR(Berkeley db4 not found) - fi - ;; - db46) - APU_CHECK_DB46("$check_places") - if test "$apu_db_version" != "4"; then - AC_MSG_ERROR(Berkeley db4 not found) - fi - ;; - db47) - APU_CHECK_DB47("$check_places") - if test "$apu_db_version" != "4"; then - AC_MSG_ERROR(Berkeley db4 not found) - fi - ;; - db48) - APU_CHECK_DB48("$check_places") - if test "$apu_db_version" != "4"; then - AC_MSG_ERROR(Berkeley db4 not found) - fi - ;; - db50) - APU_CHECK_DB50("$check_places") - if test "$apu_db_version" != "5"; then - AC_MSG_ERROR(Berkeley db5 not found) - fi - ;; - db51) - APU_CHECK_DB51("$check_places") - if test "$apu_db_version" != "5"; then - AC_MSG_ERROR(Berkeley db5 not found) + db[[45]] | db[[45]][[0-9]]) + db_major=`echo "$requested" | sed -e 's/db//' -e 's/.$//` + db_minor=`echo "$requested" | sed -e 's/db//' -e 's/.//` + APU_CHECK_DBXY("$check_places", "$db_major", "$db_minor") + if test "$apu_db_version" != "$db_major"; then + AC_MSG_ERROR(Berkeley db$db_major not found) fi ;; default) @@ -688,53 +439,34 @@ AC_DEFUN([APU_CHECK_DB], [ ]) dnl -dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 5.1 to 1. +dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 5.X to 1. dnl AC_DEFUN([APU_CHECK_DB_ALL], [ all_places=$1 - APU_CHECK_DB51("$all_places") - if test "$apu_db_version" != "5"; then - APU_CHECK_DB50("$all_places") - if test "$apu_db_version" != "5"; then - APU_CHECK_DB48("$all_places") - if test "$apu_db_version" != "4"; then - APU_CHECK_DB47("$all_places") - if test "$apu_db_version" != "4"; then - APU_CHECK_DB46("$all_places") - if test "$apu_db_version" != "4"; then - APU_CHECK_DB45("$all_places") - if test "$apu_db_version" != "4"; then - APU_CHECK_DB44("$all_places") - if test "$apu_db_version" != "4"; then - APU_CHECK_DB43("$all_places") - if test "$apu_db_version" != "4"; then - APU_CHECK_DB42("$all_places") - if test "$apu_db_version" != "4"; then - APU_CHECK_DB41("$all_places") - if test "$apu_db_version" != "4"; then - APU_CHECK_DB4("$all_places") - if test "$apu_db_version" != "4"; then - APU_CHECK_DB3("$all_places") - if test "$apu_db_version" != "3"; then - APU_CHECK_DB2("$all_places") - if test "$apu_db_version" != "2"; then - APU_CHECK_DB1("$all_places") - if test "$apu_db_version" != "1"; then - APU_CHECK_DB185("$all_places") - fi - fi - fi - fi - fi - fi - fi - fi - fi - fi - fi - fi + # Start version search at version 5.9 + version=59 + while [ $version -ge 40 ] + do + db_major=`echo $version | sed -e 's/.$//'` + db_minor=`echo $version | sed -e 's/.//'` + APU_CHECK_DBXY("$all_places", "$db_major", "$db_minor") + if test "$apu_have_db" = "1"; then + break fi + version=`expr $version - 1` + done + if test "$apu_have_db" = "0"; then + APU_CHECK_DB3("$all_places") + fi + if test "$apu_have_db" = "0"; then + APU_CHECK_DB2("$all_places") + fi + if test "$apu_have_db" = "0"; then + APU_CHECK_DB1("$all_places") + fi + if test "$apu_have_db" = "0"; then + APU_CHECK_DB185("$all_places") fi AC_MSG_CHECKING(for Berkeley DB) if test "$apu_have_db" = "1"; then @@ -762,12 +494,23 @@ AC_DEFUN([APU_CHECK_DBM], [ apu_db_header=db.h # default so apu_select_dbm.h is syntactically correct apu_db_version=0 + db_max_version=53 + db_min_version=41 + dbm_list="sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4" + db_version="$db_min_version" + while [ $version -ge 41 ] + do + dbm_list="$dbm_list, db$db_version" + version=`expr $version - 1` + done + dbm_short_list=`echo $dbm_list | sed -e 's/ //g'` + AC_ARG_WITH(dbm, [APR_HELP_STRING([--with-dbm=DBM], [choose the DBM type to use. - DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db41,db42,db43,db44,db45,db46,db47,db48,db50,db51}])], + DBM={$dbm_short_list}])], [ if test "$withval" = "yes"; then AC_MSG_ERROR([--with-dbm needs to specify a DBM type to use. - One of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48, db50, db51]) + One of: $dbm_list]) fi requested="$withval" ], [ @@ -902,81 +645,17 @@ AC_DEFUN([APU_CHECK_DBM], [ fi case "$requested" in - sdbm) - apu_use_sdbm=1 - apu_default_dbm=sdbm - ;; - gdbm) - apu_use_gdbm=1 - apu_default_dbm=gdbm - ;; - ndbm) - apu_use_ndbm=1 - apu_default_dbm=ndbm - ;; - db) - apu_use_db=1 - apu_default_dbm=db - ;; - db1) - apu_use_db=1 - apu_default_dbm=db1 - ;; - db185) - apu_use_db=1 - apu_default_dbm=db185 - ;; - db2) - apu_use_db=1 - apu_default_dbm=db2 - ;; - db3) - apu_use_db=1 - apu_default_dbm=db3 - ;; - db4) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db41) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db42) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db43) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db44) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db45) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db46) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db47) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db48) - apu_use_db=1 - apu_default_dbm=db4 + sdbm | gdbm | ndbm | db) + eval "apu_use_$requested=1" + apu_default_dbm=$requested ;; - db50) + db185 | db[12345]) apu_use_db=1 - apu_default_dbm=db5 + apu_default_dbm=$requested ;; - db51) + db[45][0-9]) apu_use_db=1 - apu_default_dbm=db5 + apu_default_dbm=`echo $requested | sed -e 's/.$//'` ;; default) dnl ### use more sophisticated DBMs for the default? @@ -985,7 +664,7 @@ AC_DEFUN([APU_CHECK_DBM], [ ;; *) AC_MSG_ERROR([--with-dbm=$look_for is an unknown DBM type. - Use one of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48, db50, db51]) + Use one of: $dbm_list]) ;; esac From 72c803c1343fb0d8b0f2a53f006aedce26682daa Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sat, 11 Aug 2012 11:31:55 +0000 Subject: [PATCH 7157/7878] Followup to r1371817: - Fix bracketing issues. - Comment on version - Support liibrary name db-X - Fix help string - Fix old buggy error message git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1371919 13f79535-47bb-0310-9956-ffa450edef68 --- build/dbm.m4 | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/build/dbm.m4 b/build/dbm.m4 index 4df34794430..f8211495648 100644 --- a/build/dbm.m4 +++ b/build/dbm.m4 @@ -381,7 +381,7 @@ AC_DEFUN([APU_CHECK_DBXY], [ APU_CHECK_BERKELEY_DB("${db_major}", "${db_minor}", "-1", "$places", "db${db_major}${db_minor}/db.h db${db_major}/db.h db.h", - "db-${db_major}.${db_minor} db${db_major}-${db_major}.${db_minor} db${db_major}${db_minor} db${db_major} db" + "db-${db_major}.${db_minor} db${db_major}-${db_major}.${db_minor} db${db_major}${db_minor} db-${db_major} db${db_major} db" ) if test "$apu_have_db" = "1"; then apu_db_version=${db_major} @@ -443,18 +443,18 @@ dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 5.X to 1. dnl AC_DEFUN([APU_CHECK_DB_ALL], [ all_places=$1 - + # Start version search at version 5.9 - version=59 - while [ $version -ge 40 ] + db_version=59 + while [[ $db_version -ge 40 ]] do - db_major=`echo $version | sed -e 's/.$//'` - db_minor=`echo $version | sed -e 's/.//'` + db_major=`echo $db_version | sed -e 's/.$//'` + db_minor=`echo $db_version | sed -e 's/.//'` APU_CHECK_DBXY("$all_places", "$db_major", "$db_minor") if test "$apu_have_db" = "1"; then break fi - version=`expr $version - 1` + db_version=`expr $db_version - 1` done if test "$apu_have_db" = "0"; then APU_CHECK_DB3("$all_places") @@ -494,19 +494,22 @@ AC_DEFUN([APU_CHECK_DBM], [ apu_db_header=db.h # default so apu_select_dbm.h is syntactically correct apu_db_version=0 + # Maximum supported version announced in help string. + # Although we search for all versions up to 5.9, + # we should only include existing versions in our + # help string. db_max_version=53 db_min_version=41 dbm_list="sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4" db_version="$db_min_version" - while [ $version -ge 41 ] + while [[ $db_version -le $db_max_version ]] do dbm_list="$dbm_list, db$db_version" - version=`expr $version - 1` + db_version=`expr $db_version + 1` done - dbm_short_list=`echo $dbm_list | sed -e 's/ //g'` AC_ARG_WITH(dbm, [APR_HELP_STRING([--with-dbm=DBM], [choose the DBM type to use. - DBM={$dbm_short_list}])], + DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db4X,db5X} for some X=0,...,9])], [ if test "$withval" = "yes"; then AC_MSG_ERROR([--with-dbm needs to specify a DBM type to use. @@ -649,11 +652,11 @@ AC_DEFUN([APU_CHECK_DBM], [ eval "apu_use_$requested=1" apu_default_dbm=$requested ;; - db185 | db[12345]) + db185 | db[[12345]]) apu_use_db=1 apu_default_dbm=$requested ;; - db[45][0-9]) + db[[45]][[0-9]]) apu_use_db=1 apu_default_dbm=`echo $requested | sed -e 's/.$//'` ;; @@ -663,7 +666,7 @@ AC_DEFUN([APU_CHECK_DBM], [ apu_use_sdbm=1 ;; *) - AC_MSG_ERROR([--with-dbm=$look_for is an unknown DBM type. + AC_MSG_ERROR([--with-dbm=$requested is an unknown DBM type. Use one of: $dbm_list]) ;; esac From 3e75cac05754a7978c3de052e4998e38b5bcc5f3 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sat, 11 Aug 2012 11:49:24 +0000 Subject: [PATCH 7158/7878] Fix missing end quote. Another followup to r1371817. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1371923 13f79535-47bb-0310-9956-ffa450edef68 --- build/dbm.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/dbm.m4 b/build/dbm.m4 index f8211495648..76c352b3ccb 100644 --- a/build/dbm.m4 +++ b/build/dbm.m4 @@ -425,8 +425,8 @@ AC_DEFUN([APU_CHECK_DB], [ fi ;; db[[45]] | db[[45]][[0-9]]) - db_major=`echo "$requested" | sed -e 's/db//' -e 's/.$//` - db_minor=`echo "$requested" | sed -e 's/db//' -e 's/.//` + db_major=`echo "$requested" | sed -e 's/db//' -e 's/.$//'` + db_minor=`echo "$requested" | sed -e 's/db//' -e 's/.//'` APU_CHECK_DBXY("$check_places", "$db_major", "$db_minor") if test "$apu_db_version" != "$db_major"; then AC_MSG_ERROR(Berkeley db$db_major not found) From 023aec692ccfc65cc226ba77a6dfb9f4b856ae23 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 11 Aug 2012 20:17:05 +0000 Subject: [PATCH 7159/7878] fix print_time() to format the month properly, and adjust the tests to accommodate git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1372018 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testtime.c b/test/testtime.c index 84b47726956..654c1f95c16 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -27,7 +27,7 @@ /* The time value is used throughout the tests, so just make this a global. * Also, we need a single value that we can test for the positive tests, so * I chose the number below, it corresponds to: - * 2002-08-14 12:05:36.186711 -25200 [257 Sat]. + * 2002-09-14 12:05:36.186711 -25200 [257 Sat]. * Which happens to be when I wrote the new tests. */ static apr_time_t now = APR_INT64_C(1032030336186711); @@ -37,7 +37,7 @@ static char* print_time (apr_pool_t *pool, const apr_time_exp_t *xt) return apr_psprintf (pool, "%04d-%02d-%02d %02d:%02d:%02d.%06d %+05d [%d %s]%s", xt->tm_year + 1900, - xt->tm_mon, + xt->tm_mon + 1, xt->tm_mday, xt->tm_hour, xt->tm_min, @@ -78,7 +78,7 @@ static void test_gmtstr(abts_case *tc, void *data) ABTS_NOT_IMPL(tc, "apr_time_exp_gmt"); } ABTS_TRUE(tc, rv == APR_SUCCESS); - ABTS_STR_EQUAL(tc, "2002-08-14 19:05:36.186711 +0000 [257 Sat]", + ABTS_STR_EQUAL(tc, "2002-09-14 19:05:36.186711 +0000 [257 Sat]", print_time(p, &xt)); } From 0133aa2c19263994e08b656a75db3e581c4a98be Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 11 Aug 2012 20:42:45 +0000 Subject: [PATCH 7160/7878] apr_time_exp_*() on Windows: Fix error in the tm_yday field of apr_time_exp_t for times within leap years. PR: 53175 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1372022 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/time/win32/time.c b/time/win32/time.c index ecf022854cc..23497993567 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -32,7 +32,7 @@ /* Leap year is any year divisible by four, but not by 100 unless also * divisible by 400 */ -#define IsLeapYear(y) ((!(y % 4)) ? (((!(y % 400)) && (y % 100)) ? 1 : 0) : 0) +#define IsLeapYear(y) ((!(y % 4)) ? (((y % 400) && !(y % 100)) ? 0 : 1) : 0) static DWORD get_local_timezone(TIME_ZONE_INFORMATION **tzresult) { From db551ae317264e67a1a1401f47252b6bd789af4c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 12 Aug 2012 13:08:05 +0000 Subject: [PATCH 7161/7878] add testcase for PR 53175 (i.e., check all the apr_time_exp_t fields for a leap year date too) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1372085 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/test/testtime.c b/test/testtime.c index 654c1f95c16..d135c1d5584 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -31,6 +31,8 @@ * Which happens to be when I wrote the new tests. */ static apr_time_t now = APR_INT64_C(1032030336186711); +/* 2012-08-11 16:00:55.151600 -14400 [224 Sat] DST */ +static apr_time_t leap_year_now = APR_INT64_C(1344715255151600); static char* print_time (apr_pool_t *pool, const apr_time_exp_t *xt) { @@ -84,30 +86,35 @@ static void test_gmtstr(abts_case *tc, void *data) static void test_exp_lt(abts_case *tc, void *data) { - apr_status_t rv; - apr_time_exp_t xt; - time_t posix_secs = (time_t)apr_time_sec(now); - struct tm *posix_exp = localtime(&posix_secs); + apr_time_t test_times[] = {now, leap_year_now, 0}; + int i; - rv = apr_time_exp_lt(&xt, now); - if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, "apr_time_exp_lt"); - } - ABTS_TRUE(tc, rv == APR_SUCCESS); + for (i = 0; test_times[i] != 0; i++) { + apr_status_t rv; + apr_time_exp_t xt; + time_t posix_secs = (time_t)apr_time_sec(test_times[i]); + struct tm *posix_exp = localtime(&posix_secs); + + rv = apr_time_exp_lt(&xt, test_times[i]); + if (rv == APR_ENOTIMPL) { + ABTS_NOT_IMPL(tc, "apr_time_exp_lt"); + } + ABTS_TRUE(tc, rv == APR_SUCCESS); #define CHK_FIELD(f) \ - ABTS_ASSERT(tc, "Mismatch in " #f, posix_exp->f == xt.f) - - CHK_FIELD(tm_sec); - CHK_FIELD(tm_min); - CHK_FIELD(tm_hour); - CHK_FIELD(tm_mday); - CHK_FIELD(tm_mon); - CHK_FIELD(tm_year); - CHK_FIELD(tm_wday); - CHK_FIELD(tm_yday); - CHK_FIELD(tm_isdst); + ABTS_ASSERT(tc, "Mismatch in " #f, posix_exp->f == xt.f) + + CHK_FIELD(tm_sec); + CHK_FIELD(tm_min); + CHK_FIELD(tm_hour); + CHK_FIELD(tm_mday); + CHK_FIELD(tm_mon); + CHK_FIELD(tm_year); + CHK_FIELD(tm_wday); + CHK_FIELD(tm_yday); + CHK_FIELD(tm_isdst); #undef CHK_FIELD + } } static void test_exp_get_gmt(abts_case *tc, void *data) From fb69291bcf771d86c019576f5a9f54a529dd0dc4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 12 Aug 2012 13:29:36 +0000 Subject: [PATCH 7162/7878] release critical section before returning on error path git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1372093 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index c54d556af91..9414490589c 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -853,6 +853,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, rv = apr_get_os_error(); CloseHandle(attr->user_token); attr->user_token = NULL; + LeaveCriticalSection(&proc_lock); return rv; } rv = CreateProcessAsUserW(attr->user_token, From 5343b14cf76c0fb677dcc02509c33dd24d9831ad Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 12 Aug 2012 21:02:20 +0000 Subject: [PATCH 7163/7878] fix this gcc warning: poll/unix/pollcb.c: In function 'pollcb_provider': poll/unix/pollcb.c:47:5: warning: enumeration value 'APR_POLLSET_AIO_MSGQ' not handled in switch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1372197 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/pollcb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c index e1d0bbd82dd..e01006b38a4 100644 --- a/poll/unix/pollcb.c +++ b/poll/unix/pollcb.c @@ -66,6 +66,7 @@ static apr_pollcb_provider_t *pollcb_provider(apr_pollset_method_e method) #endif break; case APR_POLLSET_SELECT: + case APR_POLLSET_AIO_MSGQ: case APR_POLLSET_DEFAULT: break; } From ab9187b854c00319ef84fdc47b4564c2df48e20f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 13 Aug 2012 18:53:58 +0000 Subject: [PATCH 7164/7878] PR 46175 fix is now in apr/apr-util 1.5.x git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1372551 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGES b/CHANGES index bd2800ebee5..e1e270ac73d 100644 --- a/CHANGES +++ b/CHANGES @@ -41,10 +41,6 @@ Changes for APR 2.0.0 *) apr_socket_connect() on Windows: Handle WSAEISCONN. PR 48736. [, Jeff Trawick] - *) MinGW/MSYS: Support shared builds of APR, other general improvements - to support of this toolchain. PR 46175. [Carlo Bramini - ] - *) Support libxml2 as an alternative XML parser to expat [Nick Kew] *) Hide apr_wait_for_io_or_timeout() from public view and add instead From 06f1a21678b3cd519aa12b5c0d0ad71b355e2a9e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 14 Aug 2012 11:51:51 +0000 Subject: [PATCH 7165/7878] Resolve these warnings when linking test programs with the MinGW/MSYS toolchain: libtool: link: warning: `-no-install' is ignored for i686-pc-mingw32 libtool: link: warning: assuming `-no-fast-install' instead git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1372849 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 708c6f28030..84ba990c184 100644 --- a/configure.in +++ b/configure.in @@ -2731,13 +2731,20 @@ AC_SUBST(DEFAULT_OSDIR) AC_SUBST(EXEEXT) AC_SUBST(LIBTOOL_LIBS) -# Use -no-install to link the test programs on all platforms -# but Darwin, where it would cause the programs to be linked -# against installed versions of libapr instead of those just -# built. +# Use -no-install or -no-fast-install to link the test +# programs on all platforms but Darwin, where it would cause +# the programs to be linked against installed versions of +# libapr instead of those just built. case $host in -*-apple-darwin*) LT_NO_INSTALL="" ;; -*) LT_NO_INSTALL="-no-install" ;; + *-apple-darwin*) + LT_NO_INSTALL="" + ;; + *-mingw*) + LT_NO_INSTALL="-no-fast-install" + ;; + *) + LT_NO_INSTALL="-no-install" + ;; esac AC_SUBST(LT_NO_INSTALL) From 01f0175c76d6a2257a83b1d11c9a358e4926bdb5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 24 Aug 2012 15:19:17 +0000 Subject: [PATCH 7166/7878] spelling git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1376957 13f79535-47bb-0310-9956-ffa450edef68 --- build/lineends.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lineends.pl b/build/lineends.pl index 3e3067f7685..8aa735cc827 100644 --- a/build/lineends.pl +++ b/build/lineends.pl @@ -3,7 +3,7 @@ # Heuristically converts line endings to the current OS's preferred format # # All existing line endings must be identical (e.g. lf's only, or even -# the accedental cr.cr.lf sequence.) If some lines end lf, and others as +# the accidental cr.cr.lf sequence.) If some lines end lf, and others as # cr.lf, the file is presumed binary. If the cr character appears anywhere # except prefixed to an lf, the file is presumed binary. If there is no # change in the resulting file size, or the file is binary, the conversion From c19582d6bef53444e90686a9100fda17d1289381 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 7 Sep 2012 21:14:19 +0000 Subject: [PATCH 7167/7878] Check all DB minor versions if --with-dbm=db5 or --with-dbm=db4 is given git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1382174 13f79535-47bb-0310-9956-ffa450edef68 --- build/dbm.m4 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/build/dbm.m4 b/build/dbm.m4 index 76c352b3ccb..cf925e11542 100644 --- a/build/dbm.m4 +++ b/build/dbm.m4 @@ -424,7 +424,7 @@ AC_DEFUN([APU_CHECK_DB], [ AC_MSG_ERROR(Berkeley db3 not found) fi ;; - db[[45]] | db[[45]][[0-9]]) + db[[45]][[0-9]]) db_major=`echo "$requested" | sed -e 's/db//' -e 's/.$//'` db_minor=`echo "$requested" | sed -e 's/db//' -e 's/.//'` APU_CHECK_DBXY("$check_places", "$db_major", "$db_minor") @@ -432,6 +432,22 @@ AC_DEFUN([APU_CHECK_DB], [ AC_MSG_ERROR(Berkeley db$db_major not found) fi ;; + db[[45]]) + db_major=`echo "$requested" | sed -e 's/db//'` + # Start version search at version x.9 + db_minor=9 + while [[ $db_minor -ge 0 ]] + do + APU_CHECK_DBXY("$check_places", "$db_major", "$db_minor") + if test "$apu_have_db" = "1"; then + break + fi + db_minor=`expr $db_minor - 1` + done + if test "$apu_db_version" != "$db_major"; then + AC_MSG_ERROR(Berkeley db$db_major not found) + fi + ;; default) APU_CHECK_DB_ALL("$check_places") ;; From d33f639c600c0b64704d8936abbb21f69db255d0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 14 Sep 2012 13:30:38 +0000 Subject: [PATCH 7168/7878] spelling fix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1384764 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 9414490589c..cd48117a434 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -465,8 +465,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, new->err = attr->parent_err; if (attr->detached) { - /* If we are creating ourselves detached, Then we should hide the - * window we are starting in. And we had better redfine our + /* If we are creating ourselves detached, then we should hide the + * window we are starting in. And we had better redefine our * handles for STDIN, STDOUT, and STDERR. Do not set the * detached attribute for Win9x. We have found that Win9x does * not manage the stdio handles properly when running old 16 From fdbcb706d82f07664eb2aca02e1628b74fb83cf0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 23 Sep 2012 15:23:42 +0000 Subject: [PATCH 7169/7878] easy fixes for a few warnings about unused variables git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1389077 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 3 +++ test/testlockperf.c | 6 +----- test/testmemcache.c | 3 +-- test/testmmap.c | 1 + 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/test/testfile.c b/test/testfile.c index dad214e35de..fa494a2938d 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -749,6 +749,7 @@ static void test_writev_buffered_seek(abts_case *tc, void *data) APR_OS_DEFAULT, p)); rv = apr_file_read(f, str, &nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, TESTSTR, str); APR_ASSERT_SUCCESS(tc, "buffered seek", apr_file_seek(f, APR_SET, &off)); @@ -1006,6 +1007,7 @@ static void test_xthread(abts_case *tc, void *data) apr_off_t offset = 0; rv = apr_file_seek(f, APR_END, &offset); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } APR_ASSERT_SUCCESS(tc, "more writes should succeed", @@ -1016,6 +1018,7 @@ static void test_xthread(abts_case *tc, void *data) apr_off_t offset = 0; rv = apr_file_seek(f, APR_SET, &offset); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } apr_file_read_full(f, buf, sizeof(buf), NULL); diff --git a/test/testlockperf.c b/test/testlockperf.c index f673e5f7b19..84c0ba99130 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -226,7 +226,6 @@ int main(int argc, const char * const *argv) { apr_status_t rv; char errmsg[200]; - const char *lockname = "multi.lock"; apr_getopt_t *opt; char optchar; const char *optarg; @@ -245,13 +244,10 @@ int main(int argc, const char * const *argv) exit(-1); } - while ((rv = apr_getopt(opt, "vf:", &optchar, &optarg)) == APR_SUCCESS) { + while ((rv = apr_getopt(opt, "v", &optchar, &optarg)) == APR_SUCCESS) { if (optchar == 'v') { verbose = 1; } - if (optchar == 'f') { - lockname = optarg; - } } if (rv != APR_SUCCESS && rv != APR_EOF) { diff --git a/test/testmemcache.c b/test/testmemcache.c index 0bd7f189bdf..3742388285f 100644 --- a/test/testmemcache.c +++ b/test/testmemcache.c @@ -488,7 +488,7 @@ static void test_memcache_setget(abts_case * tc, void *data) apr_status_t rv; apr_memcache_t *memcache; apr_memcache_server_t *server; - apr_hash_t *tdata, *values; + apr_hash_t *tdata; apr_hash_index_t *hi; char *result; apr_size_t len; @@ -503,7 +503,6 @@ static void test_memcache_setget(abts_case * tc, void *data) ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); tdata = apr_hash_make(pool); - values = apr_hash_make(pool); create_test_hash(pool, tdata); diff --git a/test/testmmap.c b/test/testmmap.c index 4063ba62e63..74c0c9f5033 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -125,6 +125,7 @@ static void test_mmap_offset(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, themmap); rv = apr_mmap_offset(&addr, themmap, 5); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* Must use nEquals since the string is not guaranteed to be NULL terminated */ ABTS_STR_NEQUAL(tc, addr, TEST_STRING + 5, thisfsize-5); } From c13152b830ff0c41d6b560ef8e5f3400a7d617d3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 23 Sep 2012 19:18:44 +0000 Subject: [PATCH 7170/7878] if no crypto library is specified in conjuction with --with-crypto, autodetect supported libraries git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1389126 13f79535-47bb-0310-9956-ffa450edef68 --- build/crypto.m4 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/build/crypto.m4 b/build/crypto.m4 index 8ed889efd82..2343d483441 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -33,11 +33,26 @@ AC_DEFUN([APU_CHECK_CRYPTO], [ AC_ARG_WITH([crypto], [APR_HELP_STRING([--with-crypto], [enable crypto support])], [ if test "$withval" = "yes"; then + + crypto_library_enabled=0 + for cryptolib in openssl nss; do + eval v=\$with_$cryptolib + if test "$v" != "" -a "$v" != "no"; then + crypto_library_enabled=1 + fi + done + + if test "$crypto_library_enabled" = "0"; then + AC_MSG_NOTICE(Crypto was requested but no crypto library was found; autodetecting available libraries) + with_openssl=yes + with_nss=yes + fi + APU_CHECK_CRYPTO_OPENSSL APU_CHECK_CRYPTO_NSS dnl add checks for other varieties of ssl here if test "$apu_have_crypto" = "0"; then - AC_ERROR(Crypto was requested but no crypto library was enabled) + AC_ERROR(Crypto was requested but no crypto library was found; specify the location of a crypto library using --with-openssl, --with-nss, etc.) fi fi ], [ From 22f0cb5c900aad3936e4b144b1edef9e0045266c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 23 Sep 2012 19:36:58 +0000 Subject: [PATCH 7171/7878] revert broken r1389129 for the time being git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1389131 13f79535-47bb-0310-9956-ffa450edef68 --- build/crypto.m4 | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/build/crypto.m4 b/build/crypto.m4 index 2343d483441..8ed889efd82 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -33,26 +33,11 @@ AC_DEFUN([APU_CHECK_CRYPTO], [ AC_ARG_WITH([crypto], [APR_HELP_STRING([--with-crypto], [enable crypto support])], [ if test "$withval" = "yes"; then - - crypto_library_enabled=0 - for cryptolib in openssl nss; do - eval v=\$with_$cryptolib - if test "$v" != "" -a "$v" != "no"; then - crypto_library_enabled=1 - fi - done - - if test "$crypto_library_enabled" = "0"; then - AC_MSG_NOTICE(Crypto was requested but no crypto library was found; autodetecting available libraries) - with_openssl=yes - with_nss=yes - fi - APU_CHECK_CRYPTO_OPENSSL APU_CHECK_CRYPTO_NSS dnl add checks for other varieties of ssl here if test "$apu_have_crypto" = "0"; then - AC_ERROR(Crypto was requested but no crypto library was found; specify the location of a crypto library using --with-openssl, --with-nss, etc.) + AC_ERROR(Crypto was requested but no crypto library was enabled) fi fi ], [ From a1cb0c7eccf81ed01dec07f3d4a8a2ccc1718ed9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 23 Sep 2012 22:01:40 +0000 Subject: [PATCH 7172/7878] If --with-crypto was specified without enabling a crypto library, try to autodetect possible crypto libraries, as long as they haven't been explicitly disabled. If you just want OpenSSL regardless of what is available on the system: --with-crypto --with-openssl or --with-crypto --without-nss --without- If a library has to be specified explicitly so that it is found in a non-default location (--with-nss=$HOME/install/nss), other libraries won't be automatically enabled. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1389154 13f79535-47bb-0310-9956-ffa450edef68 --- build/crypto.m4 | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/build/crypto.m4 b/build/crypto.m4 index 8ed889efd82..c30882f69eb 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -32,12 +32,38 @@ AC_DEFUN([APU_CHECK_CRYPTO], [ AC_ARG_WITH([crypto], [APR_HELP_STRING([--with-crypto], [enable crypto support])], [ + cryptolibs="openssl nss" + if test "$withval" = "yes"; then + + crypto_library_enabled=0 + for cryptolib in $cryptolibs; do + eval v=\$with_$cryptolib + if test "$v" != "" -a "$v" != "no"; then + crypto_library_enabled=1 + fi + done + + if test "$crypto_library_enabled" = "0"; then + for cryptolib in $cryptolibs; do + eval v=\$with_$cryptolib + if test "$v" != "no"; then + eval with_$cryptolib=yes + crypto_library_enabled=1 + fi + done + if test "$crypto_library_enabled" = "1"; then + AC_MSG_NOTICE([Crypto was requested but no crypto library was found; autodetecting possible libraries]) + else + AC_ERROR([Crypto was requested but all possible crypto libraries were disabled.]) + fi + fi + APU_CHECK_CRYPTO_OPENSSL APU_CHECK_CRYPTO_NSS dnl add checks for other varieties of ssl here if test "$apu_have_crypto" = "0"; then - AC_ERROR(Crypto was requested but no crypto library was enabled) + AC_ERROR([Crypto was requested but no crypto library could be enabled; specify the location of a crypto library using --with-openssl, --with-nss, etc.]) fi fi ], [ From 431bd670f4cb3cf30b5efc6f9ac6eaa3fdba13b7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 23 Sep 2012 23:22:42 +0000 Subject: [PATCH 7173/7878] fix AC_CHECK_HEADER() usage with APU_CHECK_CRYPTO_NSS The action-if-found is executed if *any* of the headers listed are found, so only equivalent headers should be searched with one invocation if action-if-found is used to flag success. This catches an error such as missing prerror.h at at configure time instead of at build time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1389169 13f79535-47bb-0310-9956-ffa450edef68 --- build/crypto.m4 | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/build/crypto.m4 b/build/crypto.m4 index c30882f69eb..23c556b9b86 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -164,7 +164,6 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ ]) AC_DEFUN([APU_CHECK_CRYPTO_NSS], [ - nss_have_headers=0 nss_have_libs=0 old_libs="$LIBS" @@ -174,7 +173,6 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [ AC_ARG_WITH([nss], [APR_HELP_STRING([--with-nss=DIR], [specify location of NSS])], [ - if test "$withval" = "yes"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) if test -n "$PKG_CONFIG"; then @@ -183,9 +181,15 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [ APR_ADDTO(CPPFLAGS, [$nss_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$nss_LDFLAGS]) fi - AC_CHECK_HEADERS(prerror.h nss/nss.h nss.h nss/pk11pub.h pk11pub.h, [nss_have_headers=1]) + nss_have_prerrorh=0 + nss_have_nssh=0 + nss_have_pk11pubh=0 + AC_CHECK_HEADERS(prerror.h, [nss_have_prerrorh=1]) + AC_CHECK_HEADERS(nss/nss.h nss.h, [nss_have_nssh=1]) + AC_CHECK_HEADERS(nss/pk11pub.h pk11pub.h, [nss_have_pk11pubh=1]) + nss_have_headers=${nss_have_prerrorh}${nss_have_nssh}${nss_have_pk11pubh} AC_CHECK_LIB(nspr4, PR_Initialize, AC_CHECK_LIB(nss3, PK11_CreatePBEV2AlgorithmID, [nss_have_libs=1],,-lnspr4)) - if test "$nss_have_headers" != "0" && test "$nss_have_libs" != "0"; then + if test "$nss_have_headers" = "111" && test "$nss_have_libs" != "0"; then apu_have_nss=1 fi elif test "$withval" = "no"; then @@ -199,9 +203,15 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [ APR_ADDTO(LDFLAGS, [$nss_LDFLAGS]) AC_MSG_NOTICE(checking for nss in $withval) - AC_CHECK_HEADERS(prerror.h nss/nss.h nss.h nss/pk11pub.h pk11pub.h, [nss_have_headers=1]) + nss_have_prerrorh=0 + nss_have_nssh=0 + nss_have_pk11pubh=0 + AC_CHECK_HEADERS(prerror.h, [nss_have_prerrorh=1]) + AC_CHECK_HEADERS(nss/nss.h nss.h, [nss_have_nssh=1]) + AC_CHECK_HEADERS(nss/pk11pub.h pk11pub.h, [nss_have_pk11pubh=1]) + nss_have_headers=${nss_have_prerrorh}${nss_have_nssh}${nss_have_pk11pubh} AC_CHECK_LIB(nspr4, PR_Initialize, AC_CHECK_LIB(nss3, PK11_CreatePBEV2AlgorithmID, [nss_have_libs=1],,-lnspr4)) - if test "$nss_have_headers" != "0" && test "$nss_have_libs" != "0"; then + if test "$nss_have_headers" = "111" && test "$nss_have_libs" != "0"; then apu_have_nss=1 fi From 953737e269a377bc3ccd48b0b21da2854844c41f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 26 Sep 2012 13:17:57 +0000 Subject: [PATCH 7174/7878] memcache test: log a message in verbose mode if memcached isn't running git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1390461 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmemcache.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/testmemcache.c b/test/testmemcache.c index 3742388285f..4ac3694dbfc 100644 --- a/test/testmemcache.c +++ b/test/testmemcache.c @@ -605,10 +605,10 @@ abts_suite *testmemcache(abts_suite * suite) apr_status_t rv; suite = ADD_SUITE(suite); /* check for a running memcached on the typical port before - * trying to run the tests. succeed silently if we don't find one. + * trying to run the tests. succeed if we don't find one. */ rv = check_mc(); - if(rv == APR_SUCCESS) { + if (rv == APR_SUCCESS) { abts_run_test(suite, test_memcache_create, NULL); abts_run_test(suite, test_memcache_user_funcs, NULL); abts_run_test(suite, test_memcache_meta, NULL); @@ -617,6 +617,11 @@ abts_suite *testmemcache(abts_suite * suite) abts_run_test(suite, test_memcache_addreplace, NULL); abts_run_test(suite, test_memcache_incrdecr, NULL); } + else { + abts_log_message("Error %d occurred attempting to reach memcached " + "on %s:%d. Skipping apr_memcache tests...", + rv, HOST, PORT); + } return suite; } From 3fc61bad9ad956ee9f576d79b9b87598710cde8d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 26 Sep 2012 13:37:04 +0000 Subject: [PATCH 7175/7878] Fix dead server retry logic. Submitted by: Gavin Shelley Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1390477 13f79535-47bb-0310-9956-ffa450edef68 --- memcache/apr_memcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index 222f65d970b..504ec37a6fb 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -183,8 +183,8 @@ apr_memcache_find_server_hash_default(void *baton, apr_memcache_t *mc, #endif /* Try the dead server, every 5 seconds */ if (curtime - ms->btime > apr_time_from_sec(5)) { + ms->btime = curtime; if (mc_version_ping(ms) == APR_SUCCESS) { - ms->btime = curtime; make_server_live(mc, ms); #if APR_HAS_THREADS apr_thread_mutex_unlock(ms->lock); From 83a88faeaf7cf31f77e05884069ebaba1e745af7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 26 Sep 2012 14:42:53 +0000 Subject: [PATCH 7176/7878] apr_memcache_server_create(): Fix handling of the ttl parameter. It is documented as a number of seconds but was treated as microseconds. (The current Subversion release passes seconds.) PR: 51511 Submitted by: Tim Whittington Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1390526 13f79535-47bb-0310-9956-ffa450edef68 --- memcache/apr_memcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index 504ec37a6fb..1326e0f90d6 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -414,7 +414,7 @@ APR_DECLARE(apr_status_t) apr_memcache_server_create(apr_pool_t *p, min, /* hard minimum */ smax, /* soft maximum */ max, /* hard maximum */ - ttl, /* Time to live */ + apr_time_from_sec(ttl), /* Time to live */ mc_conn_construct, /* Make a New Connection */ mc_conn_destruct, /* Kill Old Connection */ server, np); From 854d841c645c38eb19238fb7091632b6e8ea1b6b Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 26 Sep 2012 14:59:43 +0000 Subject: [PATCH 7177/7878] Longer term Darwin/OSX solution... Assume Darwin 1?.* works the same. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1390539 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 5cbeb7bc105..62b7132c416 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -203,7 +203,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_SETIFNULL(ac_cv_func_kqueue, [no]) APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332 ;; - *-apple-darwin1[[012]].*) + *-apple-darwin1?.*) APR_ADDTO(CPPFLAGS, [-DDARWIN_10]) ;; esac From 35e47f6a72a786eb0f66a3c1cd0c394e750dab0f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 27 Sep 2012 20:07:15 +0000 Subject: [PATCH 7178/7878] Revert r1390526; ttl is in microseconds git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1391193 13f79535-47bb-0310-9956-ffa450edef68 --- memcache/apr_memcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index 1326e0f90d6..504ec37a6fb 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -414,7 +414,7 @@ APR_DECLARE(apr_status_t) apr_memcache_server_create(apr_pool_t *p, min, /* hard minimum */ smax, /* soft maximum */ max, /* hard maximum */ - apr_time_from_sec(ttl), /* Time to live */ + ttl, /* Time to live */ mc_conn_construct, /* Make a New Connection */ mc_conn_destruct, /* Kill Old Connection */ server, np); From 2622b97d8bf694f038c43944f734b7a81b96eae9 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Fri, 5 Oct 2012 14:46:27 +0000 Subject: [PATCH 7179/7878] apr_crypto: Add a native CommonCrypto implementation for iOS and OSX where OpenSSL has been deprecated. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1394552 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 1 + build.conf | 6 +- build/crypto.m4 | 73 ++- build/dso.m4 | 6 +- crypto/apr_crypto.c | 5 + crypto/apr_crypto_commoncrypto.c | 814 +++++++++++++++++++++++++++++++ include/apr.h.in | 1 + include/apr.hnw | 1 + include/apr.hw | 1 + include/apr_crypto.h | 24 +- test/testcrypto.c | 396 ++++++++++++++- 11 files changed, 1286 insertions(+), 42 deletions(-) create mode 100644 crypto/apr_crypto_commoncrypto.c diff --git a/Makefile.in b/Makefile.in index 561718dd7b5..e2a13c17b24 100644 --- a/Makefile.in +++ b/Makefile.in @@ -82,6 +82,7 @@ LDADD_dbm_gdbm = @LDADD_dbm_gdbm@ LDADD_dbm_ndbm = @LDADD_dbm_ndbm@ LDADD_crypto_openssl = @LDADD_crypto_openssl@ LDADD_crypto_nss = @LDADD_crypto_nss@ +LDADD_crypto_commoncrypto = @LDADD_crypto_commoncrypto@ # Create apr-config script suitable for the install tree apr-config.out: $(APR_CONFIG) diff --git a/build.conf b/build.conf index 3c6ad6189cd..4aa276aa4a0 100644 --- a/build.conf +++ b/build.conf @@ -51,7 +51,7 @@ headers = include/*.h dsp = libapr.dsp modules = - crypto_openssl crypto_nss dbd_pgsql + crypto_openssl crypto_nss crypto_commoncrypto dbd_pgsql dbd_sqlite2 dbd_sqlite3 dbd_oracle dbd_mysql dbd_freetds dbd_odbc dbm_db dbm_gdbm dbm_ndbm @@ -60,6 +60,10 @@ modules = # we have a recursive makefile for the test files (for now) # test/*.c +[crypto_commoncrypto] +paths = crypto/apr_crypto_commoncrypto.c +target = crypto/apr_crypto_commoncrypto.la + [crypto_openssl] paths = crypto/apr_crypto_openssl.c target = crypto/apr_crypto_openssl.la diff --git a/build/crypto.m4 b/build/crypto.m4 index 23c556b9b86..4a99c0746cd 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -25,6 +25,7 @@ AC_DEFUN([APU_CHECK_CRYPTO], [ apu_have_crypto=0 apu_have_openssl=0 apu_have_nss=0 + apu_have_commoncrypto=0 old_libs="$LIBS" old_cppflags="$CPPFLAGS" @@ -32,7 +33,7 @@ AC_DEFUN([APU_CHECK_CRYPTO], [ AC_ARG_WITH([crypto], [APR_HELP_STRING([--with-crypto], [enable crypto support])], [ - cryptolibs="openssl nss" + cryptolibs="openssl nss commoncrypto" if test "$withval" = "yes"; then @@ -61,9 +62,10 @@ AC_DEFUN([APU_CHECK_CRYPTO], [ APU_CHECK_CRYPTO_OPENSSL APU_CHECK_CRYPTO_NSS + APU_CHECK_CRYPTO_COMMONCRYPTO dnl add checks for other varieties of ssl here if test "$apu_have_crypto" = "0"; then - AC_ERROR([Crypto was requested but no crypto library could be enabled; specify the location of a crypto library using --with-openssl, --with-nss, etc.]) + AC_ERROR([Crypto was requested but no crypto library could be enabled; specify the location of a crypto library using --with-openssl, --with-nss, and/or --with-commoncrypto.]) fi fi ], [ @@ -238,4 +240,71 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [ CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" ]) + +AC_DEFUN([APU_CHECK_CRYPTO_COMMONCRYPTO], [ + apu_have_commoncrypto=0 + commoncrypto_have_headers=0 + commoncrypto_have_libs=0 + + old_libs="$LIBS" + old_cppflags="$CPPFLAGS" + old_ldflags="$LDFLAGS" + + AC_ARG_WITH([commoncrypto], + [APR_HELP_STRING([--with-commoncrypto=DIR], [specify location of CommonCrypto])], + [ + if test "$withval" = "yes"; then + AC_CHECK_HEADERS(CommonCrypto/CommonKeyDerivation.h, [commoncrypto_have_headers=1]) + AC_CHECK_LIB(System, CCKeyDerivationPBKDF, AC_CHECK_LIB(System, CCCryptorCreate, [commoncrypto_have_libs=1],,-lcrypto)) + if test "$commoncrypto_have_headers" != "0" && test "$commoncrypto_have_libs" != "0"; then + apu_have_commoncrypto=1 + fi + elif test "$withval" = "no"; then + apu_have_commoncrypto=0 + else + + commoncrypto_CPPFLAGS="-I$withval/include" + commoncrypto_LDFLAGS="-L$withval/lib " + + APR_ADDTO(CPPFLAGS, [$commoncrypto_CPPFLAGS]) + APR_ADDTO(LDFLAGS, [$commoncrypto_LDFLAGS]) + + AC_MSG_NOTICE(checking for commoncrypto in $withval) + AC_CHECK_HEADERS(CommonCrypto/CommonKeyDerivation.h, [commoncrypto_have_headers=1]) + AC_CHECK_LIB(System, CCKeyDerivationPBKDF, AC_CHECK_LIB(System, CCCryptorCreate, [commoncrypto_have_libs=1],,-lcrypto)) + if test "$commoncrypto_have_headers" != "0" && test "$commoncrypto_have_libs" != "0"; then + apu_have_commoncrypto=1 + APR_ADDTO(LDFLAGS, [-L$withval/lib]) + APR_ADDTO(INCLUDES, [-I$withval/include]) + fi + + if test "$apu_have_commoncrypto" != "1"; then + AC_CHECK_HEADERS(CommonCrypto/CommonKeyDerivation.h, [commoncrypto_have_headers=1]) + AC_CHECK_LIB(System, CCKeyDerivationPBKDF, AC_CHECK_LIB(System, CCCryptorCreate, [commoncrypto_have_libs=1],,-lcrypto)) + if test "$commoncrypto_have_headers" != "0" && test "$commoncrypto_have_libs" != "0"; then + apu_have_commoncrypto=1 + APR_ADDTO(LDFLAGS, [-L$withval/lib]) + APR_ADDTO(INCLUDES, [-I$withval/include]) + fi + fi + + fi + ], [ + apu_have_commoncrypto=0 + ]) + + dnl Since we have already done the AC_CHECK_LIB tests, if we have it, + dnl we know the library is there. + if test "$apu_have_commoncrypto" = "1"; then + apu_have_crypto=1 + fi + AC_SUBST(apu_have_commoncrypto) + AC_SUBST(LDADD_crypto_commoncrypto) + AC_SUBST(apu_have_crypto) + + LIBS="$old_libs" + CPPFLAGS="$old_cppflags" + LDFLAGS="$old_ldflags" +]) + dnl diff --git a/build/dso.m4 b/build/dso.m4 index 5589183c11d..5ff41d28b1e 100644 --- a/build/dso.m4 +++ b/build/dso.m4 @@ -36,6 +36,7 @@ AC_DEFUN([APR_MODULAR_DSO], [ objs= test $apu_have_openssl = 1 && objs="$objs crypto/apr_crypto_openssl.lo" test $apu_have_nss = 1 && objs="$objs crypto/apr_crypto_nss.lo" + test $apu_have_commoncrypto = 1 && objs="$objs crypto/apr_crypto_commoncrypto.lo" test $apu_have_oracle = 1 && objs="$objs dbd/apr_dbd_oracle.lo" test $apu_have_pgsql = 1 && objs="$objs dbd/apr_dbd_pgsql.lo" test $apu_have_mysql = 1 && objs="$objs dbd/apr_dbd_mysql.lo" @@ -62,10 +63,10 @@ AC_DEFUN([APR_MODULAR_DSO], [ done fi - LIBS="$LIBS $LDADD_crypto_openssl $LDADD_crypto_nss" + LIBS="$LIBS $LDADD_crypto_openssl $LDADD_crypto_nss $LDADD_crypto_commoncrypto" LIBS="$LIBS $LDADD_dbd_pgsql $LDADD_dbd_sqlite2 $LDADD_dbd_sqlite3 $LDADD_dbd_oracle $LDADD_dbd_mysql $LDADD_dbd_freetds $LDADD_dbd_odbc" LIBS="$LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm" - APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_crypto_openssl $LDADD_crypto_nss" + APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_crypto_openssl $LDADD_crypto_nss $LDADD_crypto_commoncrypto" APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbd_pgsql $LDADD_dbd_sqlite2 $LDADD_dbd_sqlite3 $LDADD_dbd_oracle $LDADD_dbd_mysql $LDADD_dbd_freetds $LDADD_dbd_odbc" APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm" @@ -75,6 +76,7 @@ AC_DEFUN([APR_MODULAR_DSO], [ dsos= test $apu_have_openssl = 1 && dsos="$dsos crypto/apr_crypto_openssl.la" test $apu_have_nss = 1 && dsos="$dsos crypto/apr_crypto_nss.la" + test $apu_have_commoncrypto = 1 && dsos="$dsos crypto/apr_crypto_commoncrypto.la" test $apu_have_oracle = 1 && dsos="$dsos dbd/apr_dbd_oracle.la" test $apu_have_pgsql = 1 && dsos="$dsos dbd/apr_dbd_pgsql.la" test $apu_have_mysql = 1 && dsos="$dsos dbd/apr_dbd_mysql.la" diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 396528d96f3..dbc108f7e2a 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -215,6 +215,11 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( DRIVER_LOAD("nss", apr_crypto_nss_driver, pool, params, rv, result); } #endif +#if APU_HAVE_COMMONCRYPTO + if (name[0] == 'c' && !strcmp(name, "commoncrypto")) { + DRIVER_LOAD("commoncrypto", apr_crypto_commoncrypto_driver, pool, params, rv, result); + } +#endif #if APU_HAVE_MSCAPI if (name[0] == 'm' && !strcmp(name, "mscapi")) { DRIVER_LOAD("mscapi", apr_crypto_mscapi_driver, pool, params, rv, result); diff --git a/crypto/apr_crypto_commoncrypto.c b/crypto/apr_crypto_commoncrypto.c new file mode 100644 index 00000000000..e9136c93ab6 --- /dev/null +++ b/crypto/apr_crypto_commoncrypto.c @@ -0,0 +1,814 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_lib.h" +#include "apu.h" +#include "apr_private.h" +#include "apu_errno.h" + +#include +#include +#include + +#include "apr_strings.h" +#include "apr_time.h" +#include "apr_buckets.h" +#include "apr_random.h" + +#include "apr_crypto_internal.h" + +#if APU_HAVE_CRYPTO + +#include + +#define LOG_PREFIX "apr_crypto_commoncrypto: " + +struct apr_crypto_t +{ + apr_pool_t *pool; + const apr_crypto_driver_t *provider; + apu_err_t *result; + apr_array_header_t *keys; + apr_hash_t *types; + apr_hash_t *modes; + apr_random_t *rng; +}; + +struct apr_crypto_key_t +{ + apr_pool_t *pool; + const apr_crypto_driver_t *provider; + const apr_crypto_t *f; + CCAlgorithm algorithm; + CCOptions options; + unsigned char *key; + int keyLen; + int ivSize; + apr_size_t blockSize; +}; + +struct apr_crypto_block_t +{ + apr_pool_t *pool; + const apr_crypto_driver_t *provider; + const apr_crypto_t *f; + const apr_crypto_key_t *key; + CCCryptorRef ref; +}; + +static int key_3des_192 = APR_KEY_3DES_192; +static int key_aes_128 = APR_KEY_AES_128; +static int key_aes_192 = APR_KEY_AES_192; +static int key_aes_256 = APR_KEY_AES_256; + +static int mode_ecb = APR_MODE_ECB; +static int mode_cbc = APR_MODE_CBC; + +/** + * Fetch the most recent error from this driver. + */ +static apr_status_t crypto_error(const apu_err_t **result, + const apr_crypto_t *f) +{ + *result = f->result; + return APR_SUCCESS; +} + +/** + * Shutdown the crypto library and release resources. + */ +static apr_status_t crypto_shutdown(void) +{ + return APR_SUCCESS; +} + +static apr_status_t crypto_shutdown_helper(void *data) +{ + return crypto_shutdown(); +} + +/** + * Initialise the crypto library and perform one time initialisation. + */ +static apr_status_t crypto_init(apr_pool_t *pool, const char *params, + const apu_err_t **result) +{ + + apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, + apr_pool_cleanup_null); + + return APR_SUCCESS; +} + +/** + * @brief Clean encryption / decryption context. + * @note After cleanup, a context is free to be reused if necessary. + * @param ctx The block context to use. + * @return Returns APR_ENOTIMPL if not supported. + */ +static apr_status_t crypto_block_cleanup(apr_crypto_block_t *ctx) +{ + + if (ctx->ref) { + CCCryptorRelease(ctx->ref); + ctx->ref = NULL; + } + + return APR_SUCCESS; + +} + +static apr_status_t crypto_block_cleanup_helper(void *data) +{ + apr_crypto_block_t *block = (apr_crypto_block_t *) data; + return crypto_block_cleanup(block); +} + +/** + * @brief Clean encryption / decryption context. + * @note After cleanup, a context is free to be reused if necessary. + * @param f The context to use. + * @return Returns APR_ENOTIMPL if not supported. + */ +static apr_status_t crypto_cleanup(apr_crypto_t *f) +{ + + return APR_SUCCESS; + +} + +static apr_status_t crypto_cleanup_helper(void *data) +{ + apr_crypto_t *f = (apr_crypto_t *) data; + return crypto_cleanup(f); +} + +/** + * @brief Create a context for supporting encryption. Keys, certificates, + * algorithms and other parameters will be set per context. More than + * one context can be created at one time. A cleanup will be automatically + * registered with the given pool to guarantee a graceful shutdown. + * @param f - context pointer will be written here + * @param provider - provider to use + * @param params - array of key parameters + * @param pool - process pool + * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE + * if the engine cannot be initialised. + */ +static apr_status_t crypto_make(apr_crypto_t **ff, + const apr_crypto_driver_t *provider, const char *params, + apr_pool_t *pool) +{ + apr_crypto_t *f = apr_pcalloc(pool, sizeof(apr_crypto_t)); + apr_status_t rv; + + if (!f) { + return APR_ENOMEM; + } + *ff = f; + f->pool = pool; + f->provider = provider; + + /* seed the secure random number generator */ + f->rng = apr_random_standard_new(pool); + if (!f->rng) { + return APR_ENOMEM; + } + do { + unsigned char seed[8]; + rv = apr_generate_random_bytes(seed, sizeof(seed)); + if (rv != APR_SUCCESS) { + return rv; + } + apr_random_add_entropy(f->rng, seed, sizeof(seed)); + rv = apr_random_secure_ready(f->rng); + } while (rv == APR_ENOTENOUGHENTROPY); + + f->result = apr_pcalloc(pool, sizeof(apu_err_t)); + if (!f->result) { + return APR_ENOMEM; + } + + f->keys = apr_array_make(pool, 10, sizeof(apr_crypto_key_t)); + if (!f->keys) { + return APR_ENOMEM; + } + + f->types = apr_hash_make(pool); + if (!f->types) { + return APR_ENOMEM; + } + apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_3des_192)); + apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_aes_128)); + apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_aes_192)); + apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_aes_256)); + + f->modes = apr_hash_make(pool); + if (!f->modes) { + return APR_ENOMEM; + } + apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(mode_ecb)); + apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(mode_cbc)); + + apr_pool_cleanup_register(pool, f, crypto_cleanup_helper, + apr_pool_cleanup_null); + + return APR_SUCCESS; + +} + +/** + * @brief Get a hash table of key types, keyed by the name of the type against + * an integer pointer constant. + * + * @param types - hashtable of key types keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +static apr_status_t crypto_get_block_key_types(apr_hash_t **types, + const apr_crypto_t *f) +{ + *types = f->types; + return APR_SUCCESS; +} + +/** + * @brief Get a hash table of key modes, keyed by the name of the mode against + * an integer pointer constant. + * + * @param modes - hashtable of key modes keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +static apr_status_t crypto_get_block_key_modes(apr_hash_t **modes, + const apr_crypto_t *f) +{ + *modes = f->modes; + return APR_SUCCESS; +} + +/** + * @brief Create a key from the given passphrase. By default, the PBKDF2 + * algorithm is used to generate the key from the passphrase. It is expected + * that the same pass phrase will generate the same key, regardless of the + * backend crypto platform used. The key is cleaned up when the context + * is cleaned, and may be reused with multiple encryption or decryption + * operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param key The key returned, see note. + * @param ivSize The size of the initialisation vector will be returned, based + * on whether an IV is relevant for this type of crypto. + * @param pass The passphrase to use. + * @param passLen The passphrase length in bytes + * @param salt The salt to use. + * @param saltLen The salt length in bytes + * @param type 3DES_192, AES_128, AES_192, AES_256. + * @param mode Electronic Code Book / Cipher Block Chaining. + * @param doPad Pad if necessary. + * @param iterations Iteration count + * @param f The context to use. + * @param p The pool to use. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, + const char *pass, apr_size_t passLen, const unsigned char * salt, + apr_size_t saltLen, const apr_crypto_block_key_type_e type, + const apr_crypto_block_key_mode_e mode, const int doPad, + const int iterations, const apr_crypto_t *f, apr_pool_t *p) +{ + apr_crypto_key_t *key = *k; + + if (!key) { + *k = key = apr_array_push(f->keys); + } + if (!key) { + return APR_ENOMEM; + } + + key->f = f; + key->provider = f->provider; + + /* handle padding */ + key->options = doPad ? kCCOptionPKCS7Padding : 0; + + /* determine the algorithm to be used */ + switch (type) { + + case (APR_KEY_3DES_192): + + /* A 3DES key */ + if (mode == APR_MODE_CBC) { + key->algorithm = kCCAlgorithm3DES; + key->keyLen = kCCKeySize3DES; + key->ivSize = kCCBlockSize3DES; + key->blockSize = kCCBlockSize3DES; + } + else { + key->algorithm = kCCAlgorithm3DES; + key->options += kCCOptionECBMode; + key->keyLen = kCCKeySize3DES; + key->ivSize = 0; + key->blockSize = kCCBlockSize3DES; + } + break; + + case (APR_KEY_AES_128): + + if (mode == APR_MODE_CBC) { + key->algorithm = kCCAlgorithmAES128; + key->keyLen = kCCKeySizeAES128; + key->ivSize = kCCBlockSizeAES128; + key->blockSize = kCCBlockSizeAES128; + } + else { + key->algorithm = kCCAlgorithmAES128; + key->options += kCCOptionECBMode; + key->keyLen = kCCKeySizeAES128; + key->ivSize = 0; + key->blockSize = kCCBlockSizeAES128; + } + break; + + case (APR_KEY_AES_192): + + if (mode == APR_MODE_CBC) { + key->algorithm = kCCAlgorithmAES128; + key->keyLen = kCCKeySizeAES192; + key->ivSize = kCCBlockSizeAES128; + key->blockSize = kCCBlockSizeAES128; + } + else { + key->algorithm = kCCAlgorithmAES128; + key->options += kCCOptionECBMode; + key->keyLen = kCCKeySizeAES192; + key->ivSize = 0; + key->blockSize = kCCBlockSizeAES128; + } + break; + + case (APR_KEY_AES_256): + + if (mode == APR_MODE_CBC) { + key->algorithm = kCCAlgorithmAES128; + key->keyLen = kCCKeySizeAES256; + key->ivSize = kCCBlockSizeAES128; + key->blockSize = kCCBlockSizeAES128; + } + else { + key->algorithm = kCCAlgorithmAES128; + key->options += kCCOptionECBMode; + key->keyLen = kCCKeySizeAES256; + key->ivSize = 0; + key->blockSize = kCCBlockSizeAES128; + } + break; + + default: + + /* TODO: Support CAST, Blowfish */ + + /* unknown key type, give up */ + return APR_EKEYTYPE; + + } + + /* make space for the key */ + key->key = apr_pcalloc(p, key->keyLen); + if (!key->key) { + return APR_ENOMEM; + } + apr_crypto_clear(p, key->key, key->keyLen); + + /* generate the key */ + if ((f->result->rc = CCKeyDerivationPBKDF(kCCPBKDF2, pass, passLen, salt, + saltLen, kCCPRFHmacAlgSHA1, iterations, key->key, key->keyLen)) + == kCCParamError) { + return APR_ENOKEY; + } + + if (ivSize) { + *ivSize = key->ivSize; + } + + return APR_SUCCESS; +} + +/** + * @brief Initialise a context for encrypting arbitrary data using the given key. + * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If + * *ctx is not NULL, *ctx must point at a previously created structure. + * @param ctx The block context returned, see note. + * @param iv Optional initialisation vector. If the buffer pointed to is NULL, + * an IV will be created at random, in space allocated from the pool. + * If the buffer pointed to is not NULL, the IV in the buffer will be + * used. + * @param key The key structure. + * @param blockSize The block size of the cipher. + * @param p The pool to use. + * @return Returns APR_ENOIV if an initialisation vector is required but not specified. + * Returns APR_EINIT if the backend failed to initialise the context. Returns + * APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, + const unsigned char **iv, const apr_crypto_key_t *key, + apr_size_t *blockSize, apr_pool_t *p) +{ + unsigned char *usedIv; + apr_crypto_block_t *block = *ctx; + if (!block) { + *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t)); + } + if (!block) { + return APR_ENOMEM; + } + block->f = key->f; + block->pool = p; + block->provider = key->provider; + block->key = key; + + apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, + apr_pool_cleanup_null); + + /* generate an IV, if necessary */ + usedIv = NULL; + if (key->ivSize) { + if (iv == NULL) { + return APR_ENOIV; + } + if (*iv == NULL) { + apr_status_t status; + usedIv = apr_pcalloc(p, key->ivSize); + if (!usedIv) { + return APR_ENOMEM; + } + apr_crypto_clear(p, usedIv, key->ivSize); + status = apr_random_secure_bytes(block->f->rng, usedIv, + key->ivSize); + if (APR_SUCCESS != status) { + return status; + } + *iv = usedIv; + } + else { + usedIv = (unsigned char *) *iv; + } + } + + /* create a new context for encryption */ + switch ((block->f->result->rc = CCCryptorCreate(kCCEncrypt, key->algorithm, + key->options, key->key, key->keyLen, usedIv, &block->ref))) { + case kCCSuccess: { + break; + } + case kCCParamError: { + return APR_EINIT; + } + case kCCMemoryFailure: { + return APR_ENOMEM; + } + case kCCAlignmentError: { + return APR_EPADDING; + } + case kCCUnimplemented: { + return APR_ENOTIMPL; + } + default: { + return APR_EINIT; + } + } + + if (blockSize) { + *blockSize = key->blockSize; + } + + return APR_SUCCESS; + +} + +/** + * @brief Encrypt data provided by in, write it to out. + * @note The number of bytes written will be written to outlen. If + * out is NULL, outlen will contain the maximum size of the + * buffer needed to hold the data, including any data + * generated by apr_crypto_block_encrypt_finish below. If *out points + * to NULL, a buffer sufficiently large will be created from + * the pool provided. If *out points to a not-NULL value, this + * value will be used as a buffer instead. + * @param out Address of a buffer to which data will be written, + * see note. + * @param outlen Length of the output will be written here. + * @param in Address of the buffer to read. + * @param inlen Length of the buffer to read. + * @param ctx The block context to use. + * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if + * not implemented. + */ +static apr_status_t crypto_block_encrypt(unsigned char **out, + apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, + apr_crypto_block_t *ctx) +{ + apr_size_t outl = *outlen; + unsigned char *buffer; + + /* are we after the maximum size of the out buffer? */ + if (!out) { + *outlen = CCCryptorGetOutputLength(ctx->ref, inlen, 1); + return APR_SUCCESS; + } + + /* must we allocate the output buffer from a pool? */ + if (!*out) { + outl = CCCryptorGetOutputLength(ctx->ref, inlen, 1); + buffer = apr_palloc(ctx->pool, outl); + if (!buffer) { + return APR_ENOMEM; + } + apr_crypto_clear(ctx->pool, buffer, outl); + *out = buffer; + } + + switch ((ctx->f->result->rc = CCCryptorUpdate(ctx->ref, in, inlen, (*out), + outl, &outl))) { + case kCCSuccess: { + break; + } + case kCCBufferTooSmall: { + return APR_ENOSPACE; + } + default: { + return APR_ECRYPT; + } + } + *outlen = outl; + + return APR_SUCCESS; + +} + +/** + * @brief Encrypt final data block, write it to out. + * @note If necessary the final block will be written out after being + * padded. Typically the final block will be written to the + * same buffer used by apr_crypto_block_encrypt, offset by the + * number of bytes returned as actually written by the + * apr_crypto_block_encrypt() call. After this call, the context + * is cleaned and can be reused by apr_crypto_block_encrypt_init(). + * @param out Address of a buffer to which data will be written. This + * buffer must already exist, and is usually the same + * buffer used by apr_evp_crypt(). See note. + * @param outlen Length of the output will be written here. + * @param ctx The block context to use. + * @return APR_ECRYPT if an error occurred. + * @return APR_EPADDING if padding was enabled and the block was incorrectly + * formatted. + * @return APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_block_encrypt_finish(unsigned char *out, + apr_size_t *outlen, apr_crypto_block_t *ctx) +{ + apr_size_t len = *outlen; + + ctx->f->result->rc = CCCryptorFinal(ctx->ref, out, + CCCryptorGetOutputLength(ctx->ref, 0, 1), &len); + + /* always clean up */ + crypto_block_cleanup(ctx); + + switch (ctx->f->result->rc) { + case kCCSuccess: { + break; + } + case kCCBufferTooSmall: { + return APR_ENOSPACE; + } + case kCCAlignmentError: { + return APR_EPADDING; + } + case kCCDecodeError: { + return APR_ECRYPT; + } + default: { + return APR_ECRYPT; + } + } + *outlen = len; + + return APR_SUCCESS; + +} + +/** + * @brief Initialise a context for decrypting arbitrary data using the given key. + * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If + * *ctx is not NULL, *ctx must point at a previously created structure. + * @param ctx The block context returned, see note. + * @param blockSize The block size of the cipher. + * @param iv Optional initialisation vector. If the buffer pointed to is NULL, + * an IV will be created at random, in space allocated from the pool. + * If the buffer is not NULL, the IV in the buffer will be used. + * @param key The key structure. + * @param p The pool to use. + * @return Returns APR_ENOIV if an initialisation vector is required but not specified. + * Returns APR_EINIT if the backend failed to initialise the context. Returns + * APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, + apr_size_t *blockSize, const unsigned char *iv, + const apr_crypto_key_t *key, apr_pool_t *p) +{ + apr_crypto_block_t *block = *ctx; + if (!block) { + *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t)); + } + if (!block) { + return APR_ENOMEM; + } + block->f = key->f; + block->pool = p; + block->provider = key->provider; + + apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, + apr_pool_cleanup_null); + + /* generate an IV, if necessary */ + if (key->ivSize) { + if (iv == NULL) { + return APR_ENOIV; + } + } + + /* create a new context for decryption */ + switch ((block->f->result->rc = CCCryptorCreate(kCCDecrypt, key->algorithm, + key->options, key->key, key->keyLen, iv, &block->ref))) { + case kCCSuccess: { + break; + } + case kCCParamError: { + return APR_EINIT; + } + case kCCMemoryFailure: { + return APR_ENOMEM; + } + case kCCAlignmentError: { + return APR_EPADDING; + } + case kCCUnimplemented: { + return APR_ENOTIMPL; + } + default: { + return APR_EINIT; + } + } + + if (blockSize) { + *blockSize = key->blockSize; + } + + return APR_SUCCESS; + +} + +/** + * @brief Decrypt data provided by in, write it to out. + * @note The number of bytes written will be written to outlen. If + * out is NULL, outlen will contain the maximum size of the + * buffer needed to hold the data, including any data + * generated by apr_crypto_block_decrypt_finish below. If *out points + * to NULL, a buffer sufficiently large will be created from + * the pool provided. If *out points to a not-NULL value, this + * value will be used as a buffer instead. + * @param out Address of a buffer to which data will be written, + * see note. + * @param outlen Length of the output will be written here. + * @param in Address of the buffer to read. + * @param inlen Length of the buffer to read. + * @param ctx The block context to use. + * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if + * not implemented. + */ +static apr_status_t crypto_block_decrypt(unsigned char **out, + apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, + apr_crypto_block_t *ctx) +{ + apr_size_t outl = *outlen; + unsigned char *buffer; + + /* are we after the maximum size of the out buffer? */ + if (!out) { + *outlen = CCCryptorGetOutputLength(ctx->ref, inlen, 1); + return APR_SUCCESS; + } + + /* must we allocate the output buffer from a pool? */ + if (!*out) { + outl = CCCryptorGetOutputLength(ctx->ref, inlen, 1); + buffer = apr_palloc(ctx->pool, outl); + if (!buffer) { + return APR_ENOMEM; + } + apr_crypto_clear(ctx->pool, buffer, outl); + *out = buffer; + } + + switch ((ctx->f->result->rc = CCCryptorUpdate(ctx->ref, in, inlen, (*out), + outl, &outl))) { + case kCCSuccess: { + break; + } + case kCCBufferTooSmall: { + return APR_ENOSPACE; + } + default: { + return APR_ECRYPT; + } + } + *outlen = outl; + + return APR_SUCCESS; + +} + +/** + * @brief Decrypt final data block, write it to out. + * @note If necessary the final block will be written out after being + * padded. Typically the final block will be written to the + * same buffer used by apr_crypto_block_decrypt, offset by the + * number of bytes returned as actually written by the + * apr_crypto_block_decrypt() call. After this call, the context + * is cleaned and can be reused by apr_crypto_block_decrypt_init(). + * @param out Address of a buffer to which data will be written. This + * buffer must already exist, and is usually the same + * buffer used by apr_evp_crypt(). See note. + * @param outlen Length of the output will be written here. + * @param ctx The block context to use. + * @return APR_ECRYPT if an error occurred. + * @return APR_EPADDING if padding was enabled and the block was incorrectly + * formatted. + * @return APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_block_decrypt_finish(unsigned char *out, + apr_size_t *outlen, apr_crypto_block_t *ctx) +{ + apr_size_t len = *outlen; + + ctx->f->result->rc = CCCryptorFinal(ctx->ref, out, + CCCryptorGetOutputLength(ctx->ref, 0, 1), &len); + + /* always clean up */ + crypto_block_cleanup(ctx); + + switch (ctx->f->result->rc) { + case kCCSuccess: { + break; + } + case kCCBufferTooSmall: { + return APR_ENOSPACE; + } + case kCCAlignmentError: { + return APR_EPADDING; + } + case kCCDecodeError: { + return APR_ECRYPT; + } + default: { + return APR_ECRYPT; + } + } + *outlen = len; + + return APR_SUCCESS; + +} + +/** + * OSX Common Crypto module. + */ +APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_commoncrypto_driver = +{ + "commoncrypto", crypto_init, crypto_make, crypto_get_block_key_types, + crypto_get_block_key_modes, crypto_passphrase, + crypto_block_encrypt_init, crypto_block_encrypt, + crypto_block_encrypt_finish, crypto_block_decrypt_init, + crypto_block_decrypt, crypto_block_decrypt_finish, crypto_block_cleanup, + crypto_cleanup, crypto_shutdown, crypto_error +}; + +#endif diff --git a/include/apr.h.in b/include/apr.h.in index b5bc729997d..def752ee31e 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -680,6 +680,7 @@ typedef int apr_wait_t; #define APU_HAVE_CRYPTO @apu_have_crypto@ #define APU_HAVE_OPENSSL @apu_have_openssl@ #define APU_HAVE_NSS @apu_have_nss@ +#define APU_HAVE_COMMONCRYPTO @apu_have_commoncrypto@ #define APU_HAVE_ICONV @have_iconv@ #define APR_HAS_XLATE (APU_HAVE_ICONV) diff --git a/include/apr.hnw b/include/apr.hnw index e3e214c7ff2..41e6480e71c 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -484,6 +484,7 @@ typedef int apr_wait_t; #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_OPENSSL 0 #define APU_HAVE_NSS 0 +#define APU_HAVE_COMMONCRYPTO 0 #endif #define APU_HAVE_ICONV 1 diff --git a/include/apr.hw b/include/apr.hw index 39bcbc6a35f..6c4ce56ea5f 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -657,6 +657,7 @@ typedef int apr_wait_t; #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_OPENSSL 0 #define APU_HAVE_NSS 0 +#define APU_HAVE_COMMONCRYPTO 0 #endif #define APU_HAVE_ICONV 0 diff --git a/include/apr_crypto.h b/include/apr_crypto.h index de3dd2a9519..f835ea6de1c 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -40,6 +40,9 @@ extern "C" { #if APU_HAVE_CRYPTO #ifndef APU_CRYPTO_RECOMMENDED_DRIVER +#if APU_HAVE_COMMONCRYPTO +#define APU_CRYPTO_RECOMMENDED_DRIVER "commoncrypto" +#else #if APU_HAVE_OPENSSL #define APU_CRYPTO_RECOMMENDED_DRIVER "openssl" #else @@ -57,6 +60,7 @@ extern "C" { #endif #endif #endif +#endif /** * Symmetric Key types understood by the library. @@ -84,16 +88,16 @@ extern "C" { * the chosen cipher. Padded data is data that is not aligned by block * size and must be padded by the crypto library. * - * OpenSSL NSS Interop - * Align Pad Align Pad Align Pad - * 3DES_192/CBC X X X X X X - * 3DES_192/ECB X X - * AES_256/CBC X X X X X X - * AES_256/ECB X X X X - * AES_192/CBC X X X X - * AES_192/ECB X X X - * AES_128/CBC X X X X - * AES_128/ECB X X X + * OpenSSL CommonCrypto NSS Interop + * Align Pad Align Pad Align Pad Align Pad + * 3DES_192/CBC X X X X X X X X + * 3DES_192/ECB X X X X + * AES_256/CBC X X X X X X X X + * AES_256/ECB X X X X X X + * AES_192/CBC X X X X X X + * AES_192/ECB X X X X X + * AES_128/CBC X X X X X X + * AES_128/ECB X X X X X * * Conclusion: for padded data, use 3DES_192/CBC or AES_256/CBC. For * aligned data, use 3DES_192/CBC, AES_256/CBC or AES_256/ECB. diff --git a/test/testcrypto.c b/test/testcrypto.c index 335c3ae65d7..9018b80b41a 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -45,7 +45,8 @@ static const apr_crypto_driver_t *get_driver(abts_case *tc, apr_pool_t *pool, return NULL; } if (APR_ENOTIMPL == rv) { - ABTS_NOT_IMPL(tc, (char *)driver); + ABTS_NOT_IMPL(tc, + apr_psprintf(pool, "Crypto driver '%s' not implemented, skipping", (char *)name)); return NULL; } ABTS_ASSERT(tc, "failed to apr_crypto_get_driver", rv == APR_SUCCESS); @@ -75,6 +76,14 @@ static const apr_crypto_driver_t *get_openssl_driver(abts_case *tc, } +static const apr_crypto_driver_t *get_commoncrypto_driver(abts_case *tc, + apr_pool_t *pool) +{ + + return get_driver(tc, pool, "commoncrypto", NULL); + +} + static apr_crypto_t *make(abts_case *tc, apr_pool_t *pool, const apr_crypto_driver_t *driver) { @@ -167,17 +176,27 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, else { if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); - fprintf(stderr, "encrypt_init: %s %s native error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), result->rc, + fprintf(stderr, + "encrypt_init: %s %s (APR %d) native error %d: %s (%s)\n", + description, apr_crypto_driver_name(driver), rv, result->rc, result->reason ? result->reason : "", result->msg ? result->msg : ""); } - ABTS_ASSERT(tc, "apr_crypto_block_encrypt_init returned APR_ENOKEY", rv != APR_ENOKEY); - ABTS_ASSERT(tc, "apr_crypto_block_encrypt_init returned APR_ENOIV", rv != APR_ENOIV); - ABTS_ASSERT(tc, "apr_crypto_block_encrypt_init returned APR_EKEYTYPE", rv != APR_EKEYTYPE); - ABTS_ASSERT(tc, "apr_crypto_block_encrypt_init returned APR_EKEYLENGTH", rv != APR_EKEYLENGTH); - ABTS_ASSERT(tc, "failed to apr_crypto_block_encrypt_init", rv == APR_SUCCESS); - ABTS_ASSERT(tc, "apr_crypto_block_encrypt_init returned NULL context", block != NULL); + ABTS_ASSERT(tc, "apr_crypto_block_encrypt_init returned APR_ENOKEY", + rv != APR_ENOKEY); + ABTS_ASSERT(tc, "apr_crypto_block_encrypt_init returned APR_ENOIV", + rv != APR_ENOIV); + ABTS_ASSERT(tc, "apr_crypto_block_encrypt_init returned APR_EKEYTYPE", + rv != APR_EKEYTYPE); + ABTS_ASSERT(tc, "apr_crypto_block_encrypt_init returned APR_EKEYLENGTH", + rv != APR_EKEYLENGTH); + ABTS_ASSERT(tc, + "apr_crypto_block_encrypt_init returned APR_ENOTENOUGHENTROPY", + rv != APR_ENOTENOUGHENTROPY); + ABTS_ASSERT(tc, "failed to apr_crypto_block_encrypt_init", + rv == APR_SUCCESS); + ABTS_ASSERT(tc, "apr_crypto_block_encrypt_init returned NULL context", + block != NULL); } if (!block || rv) { return NULL; @@ -187,10 +206,10 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, rv = apr_crypto_block_encrypt(cipherText, cipherTextLen, in, inlen, block); if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); - fprintf(stderr, "encrypt: %s %s native error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), result->rc, - result->reason ? result->reason : "", result->msg ? result->msg - : ""); + fprintf(stderr, "encrypt: %s %s (APR %d) native error %d: %s (%s)\n", + description, apr_crypto_driver_name(driver), rv, result->rc, + result->reason ? result->reason : "", + result->msg ? result->msg : ""); } ABTS_ASSERT(tc, "apr_crypto_block_encrypt returned APR_ECRYPT", rv != APR_ECRYPT); ABTS_ASSERT(tc, "failed to apr_crypto_block_encrypt", rv == APR_SUCCESS); @@ -204,13 +223,15 @@ static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, block); if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); - fprintf(stderr, "encrypt_finish: %s %s native error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), result->rc, - result->reason ? result->reason : "", result->msg ? result->msg - : ""); + fprintf(stderr, + "encrypt_finish: %s %s (APR %d) native error %d: %s (%s)\n", + description, apr_crypto_driver_name(driver), rv, result->rc, + result->reason ? result->reason : "", + result->msg ? result->msg : ""); } ABTS_ASSERT(tc, "apr_crypto_block_encrypt_finish returned APR_ECRYPT", rv != APR_ECRYPT); ABTS_ASSERT(tc, "apr_crypto_block_encrypt_finish returned APR_EPADDING", rv != APR_EPADDING); + ABTS_ASSERT(tc, "apr_crypto_block_encrypt_finish returned APR_ENOSPACE", rv != APR_ENOSPACE); ABTS_ASSERT(tc, "failed to apr_crypto_block_encrypt_finish", rv == APR_SUCCESS); *cipherTextLen += len; apr_crypto_block_cleanup(block); @@ -247,8 +268,9 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, else { if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); - fprintf(stderr, "decrypt_init: %s %s native error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), result->rc, + fprintf(stderr, + "decrypt_init: %s %s (APR %d) native error %d: %s (%s)\n", + description, apr_crypto_driver_name(driver), rv, result->rc, result->reason ? result->reason : "", result->msg ? result->msg : ""); } @@ -268,10 +290,10 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, cipherTextLen, block); if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); - fprintf(stderr, "decrypt: %s %s native error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), result->rc, - result->reason ? result->reason : "", result->msg ? result->msg - : ""); + fprintf(stderr, "decrypt: %s %s (APR %d) native error %d: %s (%s)\n", + description, apr_crypto_driver_name(driver), rv, result->rc, + result->reason ? result->reason : "", + result->msg ? result->msg : ""); } ABTS_ASSERT(tc, "apr_crypto_block_decrypt returned APR_ECRYPT", rv != APR_ECRYPT); ABTS_ASSERT(tc, "failed to apr_crypto_block_decrypt", rv == APR_SUCCESS); @@ -285,13 +307,15 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool, block); if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); - fprintf(stderr, "decrypt_finish: %s %s native error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), result->rc, - result->reason ? result->reason : "", result->msg ? result->msg - : ""); + fprintf(stderr, + "decrypt_finish: %s %s (APR %d) native error %d: %s (%s)\n", + description, apr_crypto_driver_name(driver), rv, result->rc, + result->reason ? result->reason : "", + result->msg ? result->msg : ""); } ABTS_ASSERT(tc, "apr_crypto_block_decrypt_finish returned APR_ECRYPT", rv != APR_ECRYPT); ABTS_ASSERT(tc, "apr_crypto_block_decrypt_finish returned APR_EPADDING", rv != APR_EPADDING); + ABTS_ASSERT(tc, "apr_crypto_block_decrypt_finish returned APR_ENOSPACE", rv != APR_ENOSPACE); ABTS_ASSERT(tc, "failed to apr_crypto_block_decrypt_finish", rv == APR_SUCCESS); if (rv) { return NULL; @@ -439,6 +463,40 @@ static void test_crypto_block_nss(abts_case *tc, void *data) } +/** + * Simple test of Common Crypto block crypt. + */ +static void test_crypto_block_commoncrypto(abts_case *tc, void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *drivers[] = { NULL, NULL }; + + const unsigned char *in = (const unsigned char *) ALIGNED_STRING; + apr_size_t inlen = sizeof(ALIGNED_STRING); + + apr_pool_create(&pool, NULL); + drivers[0] = get_commoncrypto_driver(tc, pool); + drivers[1] = get_commoncrypto_driver(tc, pool); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, + in, inlen, "KEY_3DES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 0, + in, inlen, "KEY_3DES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_256/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_256/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_128/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_128/MODE_ECB"); + apr_pool_destroy(pool); + +} + /** * Encrypt NSS, decrypt OpenSSL. */ @@ -517,6 +575,78 @@ static void test_crypto_block_openssl_nss(abts_case *tc, void *data) } +/** + * Encrypt OpenSSL, decrypt CommonCrypto. + */ +static void test_crypto_block_openssl_commoncrypto(abts_case *tc, void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *drivers[] = + { NULL, NULL }; + + const unsigned char *in = (const unsigned char *) ALIGNED_STRING; + apr_size_t inlen = sizeof(ALIGNED_STRING); + + apr_pool_create(&pool, NULL); + drivers[0] = get_openssl_driver(tc, pool); + drivers[1] = get_commoncrypto_driver(tc, pool); + + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, in, + inlen, "KEY_3DES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 0, in, + inlen, "KEY_3DES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_256/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_256/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_128/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_128/MODE_ECB"); + apr_pool_destroy(pool); + +} + +/** + * Encrypt OpenSSL, decrypt CommonCrypto. + */ +static void test_crypto_block_commoncrypto_openssl(abts_case *tc, void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *drivers[] = + { NULL, NULL }; + + const unsigned char *in = (const unsigned char *) ALIGNED_STRING; + apr_size_t inlen = sizeof(ALIGNED_STRING); + + apr_pool_create(&pool, NULL); + drivers[0] = get_commoncrypto_driver(tc, pool); + drivers[1] = get_openssl_driver(tc, pool); + + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, in, + inlen, "KEY_3DES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 0, in, + inlen, "KEY_3DES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_256/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_256/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_128/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_128/MODE_ECB"); + apr_pool_destroy(pool); + +} + /** * Simple test of OpenSSL block crypt. */ @@ -596,6 +726,42 @@ static void test_crypto_block_nss_pad(abts_case *tc, void *data) } +/** + * Simple test of Common Crypto block crypt. + */ +static void test_crypto_block_commoncrypto_pad(abts_case *tc, void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *drivers[] = { NULL, NULL }; + + const unsigned char *in = (const unsigned char *) TEST_STRING; + apr_size_t inlen = sizeof(TEST_STRING); + + apr_pool_create(&pool, NULL); + drivers[0] = get_commoncrypto_driver(tc, pool); + drivers[1] = get_commoncrypto_driver(tc, pool); + + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, + in, inlen, "KEY_3DES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 1, + in, inlen, "KEY_3DES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_256/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 1, in, + inlen, "KEY_AES_256/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 1, in, + inlen, "KEY_AES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_128/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 1, in, + inlen, "KEY_AES_128/MODE_ECB"); + + apr_pool_destroy(pool); + +} + /** * Encrypt NSS, decrypt OpenSSL. */ @@ -677,6 +843,82 @@ static void test_crypto_block_openssl_nss_pad(abts_case *tc, void *data) } +/** + * Encrypt CommonCrypto, decrypt OpenSSL. + */ +static void test_crypto_block_commoncrypto_openssl_pad(abts_case *tc, + void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *drivers[] = + { NULL, NULL }; + + const unsigned char *in = (const unsigned char *) TEST_STRING; + apr_size_t inlen = sizeof(TEST_STRING); + + apr_pool_create(&pool, NULL); + drivers[0] = get_commoncrypto_driver(tc, pool); + drivers[1] = get_openssl_driver(tc, pool); + + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, in, + inlen, "KEY_3DES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 1, in, + inlen, "KEY_3DES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_256/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 1, in, + inlen, "KEY_AES_256/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 1, in, + inlen, "KEY_AES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_128/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 1, in, + inlen, "KEY_AES_128/MODE_ECB"); + + apr_pool_destroy(pool); + +} + +/** + * Encrypt OpenSSL, decrypt CommonCrypto. + */ +static void test_crypto_block_openssl_commoncrypto_pad(abts_case *tc, + void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *drivers[] = + { NULL, NULL }; + + const unsigned char *in = (const unsigned char *) TEST_STRING; + apr_size_t inlen = sizeof(TEST_STRING); + + apr_pool_create(&pool, NULL); + drivers[0] = get_openssl_driver(tc, pool); + drivers[1] = get_commoncrypto_driver(tc, pool); + + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, in, + inlen, "KEY_3DES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 1, in, + inlen, "KEY_3DES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_256/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 1, in, + inlen, "KEY_AES_256/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 1, in, + inlen, "KEY_AES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_128/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 1, in, + inlen, "KEY_AES_128/MODE_ECB"); + + apr_pool_destroy(pool); + +} + /** * Get Types, OpenSSL. */ @@ -763,6 +1005,49 @@ static void test_crypto_get_block_key_types_nss(abts_case *tc, void *data) } +/** + * Get Types, Common Crypto. + */ +static void test_crypto_get_block_key_types_commoncrypto(abts_case *tc, void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *driver; + apr_crypto_t *f; + apr_hash_t *types; + int *key_3des_192; + int *key_aes_128; + int *key_aes_192; + int *key_aes_256; + + apr_pool_create(&pool, NULL); + driver = get_commoncrypto_driver(tc, pool); + if (driver) { + + f = make(tc, pool, driver); + apr_crypto_get_block_key_types(&types, f); + + key_3des_192 = apr_hash_get(types, "3des192", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, key_3des_192); + ABTS_INT_EQUAL(tc, *key_3des_192, APR_KEY_3DES_192); + + key_aes_128 = apr_hash_get(types, "aes128", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, key_aes_128); + ABTS_INT_EQUAL(tc, *key_aes_128, APR_KEY_AES_128); + + key_aes_192 = apr_hash_get(types, "aes192", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, key_aes_192); + ABTS_INT_EQUAL(tc, *key_aes_192, APR_KEY_AES_192); + + key_aes_256 = apr_hash_get(types, "aes256", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, key_aes_256); + ABTS_INT_EQUAL(tc, *key_aes_256, APR_KEY_AES_256); + + } + + apr_pool_destroy(pool); + +} + /** * Get Modes, OpenSSL. */ @@ -829,6 +1114,39 @@ static void test_crypto_get_block_key_modes_nss(abts_case *tc, void *data) } +/** + * Get Modes, Common Crypto. + */ +static void test_crypto_get_block_key_modes_commoncrypto(abts_case *tc, void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *driver; + apr_crypto_t *f; + apr_hash_t *modes; + int *mode_ecb; + int *mode_cbc; + + apr_pool_create(&pool, NULL); + driver = get_commoncrypto_driver(tc, pool); + if (driver) { + + f = make(tc, pool, driver); + apr_crypto_get_block_key_modes(&modes, f); + + mode_ecb = apr_hash_get(modes, "ecb", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, mode_ecb); + ABTS_INT_EQUAL(tc, *mode_ecb, APR_MODE_ECB); + + mode_cbc = apr_hash_get(modes, "cbc", APR_HASH_KEY_STRING); + ABTS_PTR_NOTNULL(tc, mode_cbc); + ABTS_INT_EQUAL(tc, *mode_cbc, APR_MODE_CBC); + + } + + apr_pool_destroy(pool); + +} + abts_suite *testcrypto(abts_suite *suite) { suite = ADD_SUITE(suite); @@ -848,6 +1166,12 @@ abts_suite *testcrypto(abts_suite *suite) /* test a padded encrypt / decrypt operation - nss */ abts_run_test(suite, test_crypto_block_nss_pad, NULL); + /* test a simple encrypt / decrypt operation - commoncrypto */ + abts_run_test(suite, test_crypto_block_commoncrypto, NULL); + + /* test a padded encrypt / decrypt operation - commoncrypto */ + abts_run_test(suite, test_crypto_block_commoncrypto_pad, NULL); + /* test encrypt nss / decrypt openssl */ abts_run_test(suite, test_crypto_block_nss_openssl, NULL); @@ -860,18 +1184,36 @@ abts_suite *testcrypto(abts_suite *suite) /* test padded encrypt openssl / decrypt nss */ abts_run_test(suite, test_crypto_block_openssl_nss_pad, NULL); + /* test encrypt openssl / decrypt commoncrypto */ + abts_run_test(suite, test_crypto_block_openssl_commoncrypto, NULL); + + /* test padded encrypt openssl / decrypt commoncrypto */ + abts_run_test(suite, test_crypto_block_openssl_commoncrypto_pad, NULL); + + /* test encrypt commoncrypto / decrypt openssl */ + abts_run_test(suite, test_crypto_block_commoncrypto_openssl, NULL); + + /* test padded encrypt commoncrypto / decrypt openssl */ + abts_run_test(suite, test_crypto_block_commoncrypto_openssl_pad, NULL); + /* test block key types openssl */ abts_run_test(suite, test_crypto_get_block_key_types_openssl, NULL); /* test block key types nss */ abts_run_test(suite, test_crypto_get_block_key_types_nss, NULL); + /* test block key types commoncrypto */ + abts_run_test(suite, test_crypto_get_block_key_types_commoncrypto, NULL); + /* test block key modes openssl */ abts_run_test(suite, test_crypto_get_block_key_modes_openssl, NULL); /* test block key modes nss */ abts_run_test(suite, test_crypto_get_block_key_modes_nss, NULL); + /* test block key modes commoncrypto */ + abts_run_test(suite, test_crypto_get_block_key_modes_commoncrypto, NULL); + return suite; } From 3f2129b69280f74aa5d2546d26d6d231bb259c58 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 19 Oct 2012 18:10:05 +0000 Subject: [PATCH 7180/7878] Fix Linux 3.x detection Submitted by: Gilles Espinasse PR: 54001 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1400200 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 62b7132c416..85cc296bdae 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -119,15 +119,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DHPUX -D_REENTRANT]) ;; *-linux*) - case `uname -r` in - 2.* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2]) - ;; - 1.* ) APR_ADDTO(CPPFLAGS, [-DLINUX=1]) - ;; - * ) - ;; - esac - APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE]) + APR_ADDTO(CPPFLAGS, [-DLINUX -D_REENTRANT -D_GNU_SOURCE]) ;; *-lynx-lynxos) APR_ADDTO(CPPFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) From 149e8420da7965daaedebac1deb9cf1e6f9d6fcf Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 27 Oct 2012 21:01:35 +0000 Subject: [PATCH 7181/7878] Document that some string functions check that the input string is not NULL git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1402868 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index 457217358c8..ed41931fb6d 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -90,7 +90,7 @@ APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b); * duplicate a string into memory allocated out of a pool * @param p The pool to allocate out of * @param s The string to duplicate - * @return The new string + * @return The new string or NULL if s == NULL */ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); @@ -100,7 +100,7 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); * @param p The pool to allocate out of * @param s The block of characters to duplicate * @param n The number of characters to duplicate - * @return The new string + * @return The new string or NULL if s == NULL * @remark This is a faster alternative to apr_pstrndup, for use * when you know that the string being duplicated really * has 'n' or more characters. If the string might contain @@ -118,7 +118,7 @@ APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n) * @param p The pool to allocate out of * @param s The string to duplicate * @param n The maximum number of characters to duplicate - * @return The new string + * @return The new string or NULL if s == NULL * @remark The amount of memory allocated from the pool is the length * of the returned string including the NUL terminator */ @@ -130,7 +130,7 @@ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); * @param p The pool to allocate from * @param m The memory to duplicate * @param n The number of bytes to duplicate - * @return The new block of memory + * @return The new block of memory or NULL if m == NULL */ APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n) #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) From 61fe49c39fab6c20771bd488c2a1208be89e241e Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 27 Oct 2012 21:09:45 +0000 Subject: [PATCH 7182/7878] Remove duplicated logic in apr_brigade_puts(). PR: 53740 Submitted by: Christophe Jaillet git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1402870 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ buckets/apr_brigade.c | 24 +----------------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/CHANGES b/CHANGES index e1e270ac73d..50ef812c439 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Remove duplicated logic in apr_brigade_puts(). PR 53740. [Christophe + Jaillet ] + *) apr_password_validate, apr_bcrypt_encode: Add support for bcrypt encoded passwords. The bcrypt implementation uses code from crypt_blowfish written by Solar Designer . apr_bcrypt_encode creates diff --git a/buckets/apr_brigade.c b/buckets/apr_brigade.c index 02319214f2d..a0fcd878178 100644 --- a/buckets/apr_brigade.c +++ b/buckets/apr_brigade.c @@ -617,29 +617,7 @@ APR_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb, apr_brigade_flush flush, void *ctx, const char *str) { - apr_size_t len = strlen(str); - apr_bucket *bkt = APR_BRIGADE_LAST(bb); - if (!APR_BRIGADE_EMPTY(bb) && APR_BUCKET_IS_HEAP(bkt)) { - /* If there is enough space available in a heap bucket - * at the end of the brigade, copy the string directly - * into the heap bucket - */ - apr_bucket_heap *h = bkt->data; - apr_size_t bytes_avail = h->alloc_len - bkt->length; - - if (bytes_avail >= len) { - char *buf = h->base + bkt->start + bkt->length; - memcpy(buf, str, len); - bkt->length += len; - return APR_SUCCESS; - } - } - - /* If the string could not be copied into an existing heap - * bucket, delegate the work to apr_brigade_write(), which - * knows how to grow the brigade - */ - return apr_brigade_write(bb, flush, ctx, str, len); + return apr_brigade_write(bb, flush, ctx, str, strlen(str)); } APR_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b, From ebe935a62f2033eddbbbeee47e076971e0d771ec Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 27 Oct 2012 21:56:58 +0000 Subject: [PATCH 7183/7878] Fix potential data corruption in apr_brigade_write() and friends if the last bucket of the brigade is a heap bucket that has been split, and there are still references to the next part of the original bucket in use. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1402897 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ buckets/apr_brigade.c | 12 +++++++++--- test/testbuckets.c | 20 ++++++++++++++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 50ef812c439..02eb611c37f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Fix potential data corruption in apr_brigade_write() and friends if + the last bucket of the brigade is a heap bucket that has been split, + and there are still references to the next part of the original bucket + in use. [Stefan Fritsch] + *) Remove duplicated logic in apr_brigade_puts(). PR 53740. [Christophe Jaillet ] diff --git a/buckets/apr_brigade.c b/buckets/apr_brigade.c index a0fcd878178..b22e9822071 100644 --- a/buckets/apr_brigade.c +++ b/buckets/apr_brigade.c @@ -448,7 +448,12 @@ APR_DECLARE(apr_status_t) apr_brigade_write(apr_bucket_brigade *b, apr_size_t remaining = APR_BUCKET_BUFF_SIZE; char *buf = NULL; - if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)) { + /* + * If the last bucket is a heap bucket and its buffer is not shared with + * another bucket, we may write into that bucket. + */ + if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e) + && ((apr_bucket_heap *)(e->data))->refcount.refcount == 1) { apr_bucket_heap *h = e->data; /* HEAP bucket start offsets are always in-memory, safe to cast */ @@ -538,10 +543,11 @@ APR_DECLARE(apr_status_t) apr_brigade_writev(apr_bucket_brigade *b, i = 0; /* If there is a heap bucket at the end of the brigade - * already, copy into the existing bucket. + * already, and its refcount is 1, copy into the existing bucket. */ e = APR_BRIGADE_LAST(b); - if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)) { + if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e) + && ((apr_bucket_heap *)(e->data))->refcount.refcount == 1) { apr_bucket_heap *h = e->data; apr_size_t remaining = h->alloc_len - (e->length + (apr_size_t)e->start); diff --git a/test/testbuckets.c b/test/testbuckets.c index 954b474c565..ec65fa76069 100644 --- a/test/testbuckets.c +++ b/test/testbuckets.c @@ -469,6 +469,25 @@ static void test_partition(abts_case *tc, void *data) apr_bucket_alloc_destroy(ba); } +static void test_write_split(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba = apr_bucket_alloc_create(p); + apr_bucket_brigade *bb1 = apr_brigade_create(p, ba); + apr_bucket_brigade *bb2; + apr_bucket *e; + + e = apr_bucket_heap_create(hello, strlen(hello), NULL, ba); + APR_BRIGADE_INSERT_HEAD(bb1, e); + apr_bucket_split(e, strlen("hello, ")); + bb2 = apr_brigade_split(bb1, APR_BRIGADE_LAST(bb1)); + apr_brigade_write(bb1, NULL, NULL, "foo", strlen("foo")); + test_bucket_content(tc, APR_BRIGADE_FIRST(bb2), "world", 5); + + apr_brigade_destroy(bb1); + apr_brigade_destroy(bb2); + apr_bucket_alloc_destroy(ba); +} + abts_suite *testbuckets(abts_suite *suite) { suite = ADD_SUITE(suite); @@ -484,6 +503,7 @@ abts_suite *testbuckets(abts_suite *suite) abts_run_test(suite, test_manyfile, NULL); abts_run_test(suite, test_truncfile, NULL); abts_run_test(suite, test_partition, NULL); + abts_run_test(suite, test_write_split, NULL); return suite; } From 14e0dba83541ea050d2cd13a2902b98297a7f443 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 27 Oct 2012 22:03:56 +0000 Subject: [PATCH 7184/7878] remove a few entries that already have been included in a apr/apr-util release git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1402899 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/CHANGES b/CHANGES index 02eb611c37f..260bd4be20e 100644 --- a/CHANGES +++ b/CHANGES @@ -9,12 +9,6 @@ Changes for APR 2.0.0 *) Remove duplicated logic in apr_brigade_puts(). PR 53740. [Christophe Jaillet ] - *) apr_password_validate, apr_bcrypt_encode: Add support for bcrypt encoded - passwords. The bcrypt implementation uses code from crypt_blowfish - written by Solar Designer . apr_bcrypt_encode creates - hashes with "$2y$" prefix, but apr_password_validate also accepts the old - prefix "$2a$". [Stefan Fritsch] - *) apr_pollset_poll: add z/OS async poll support for sockets [Greg Ames] *) apr_mcast_hops: Fix EINVAL for IPv6 sockets caused by using byte @@ -29,17 +23,6 @@ Changes for APR 2.0.0 *) apr_memcache_server_create: Fix possible segfault. PR 51064. [Michajlo Matijkiw ] - *) apr_dir_make_recursive: Fix race condition that could lead to EEXIST - being returned. PR 51254. [William Lee , - Wim Lewis ] - - *) configure: Fix APR_RESTORE_THE_ENVIRONMENT if the original variable was - a single space. PR 50334. [Nathan Phillip Brink ] - - *) apr_proc_create: Don't close any of the new stdin/stdout/stderr in the - child if it already has the correct FD. PR 51995. - [Dan Ports ] - *) apr_thread_pool: Fix thread unsafe pool usage. [Stefan Fritsch] *) apr_brigades: add a check to prevent infinite while loop in case From ef48ac86e599c63d5765fe20ce89bc267746f53f Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 27 Oct 2012 22:09:31 +0000 Subject: [PATCH 7185/7878] remove another entry that is already included in a release git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1402900 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGES b/CHANGES index 260bd4be20e..3ce5fb1f799 100644 --- a/CHANGES +++ b/CHANGES @@ -23,8 +23,6 @@ Changes for APR 2.0.0 *) apr_memcache_server_create: Fix possible segfault. PR 51064. [Michajlo Matijkiw ] - *) apr_thread_pool: Fix thread unsafe pool usage. [Stefan Fritsch] - *) apr_brigades: add a check to prevent infinite while loop in case of a corrupted brigade. Problem evidenced in PR 51062. Analysis by Krzysztof KostaÅ‚kowicz , patch [Nick Kew]. From c08f203d0c29ebf2c47b9b47263b817e888885c0 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 27 Oct 2012 22:38:33 +0000 Subject: [PATCH 7186/7878] Make apr_brigade_(v)putstrs more efficient by using apr_brigade_writev instead of apr_brigade_write git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1402903 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_brigade.c | 21 +++++++++++++++++---- test/testbuckets.c | 24 ++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/buckets/apr_brigade.c b/buckets/apr_brigade.c index b22e9822071..42403f4a113 100644 --- a/buckets/apr_brigade.c +++ b/buckets/apr_brigade.c @@ -417,17 +417,30 @@ APR_DECLARE(apr_status_t) apr_brigade_vputstrs(apr_bucket_brigade *b, void *ctx, va_list va) { +#define MAX_VECS 8 + struct iovec vec[MAX_VECS]; + apr_size_t i = 0; + for (;;) { - const char *str = va_arg(va, const char *); + char *str = va_arg(va, char *); apr_status_t rv; if (str == NULL) break; - rv = apr_brigade_write(b, flush, ctx, str, strlen(str)); - if (rv != APR_SUCCESS) - return rv; + vec[i].iov_base = str; + vec[i].iov_len = strlen(str); + i++; + + if (i == MAX_VECS) { + rv = apr_brigade_writev(b, flush, ctx, vec, i); + if (rv != APR_SUCCESS) + return rv; + i = 0; + } } + if (i != 0) + return apr_brigade_writev(b, flush, ctx, vec, i); return APR_SUCCESS; } diff --git a/test/testbuckets.c b/test/testbuckets.c index ec65fa76069..e00f61eb134 100644 --- a/test/testbuckets.c +++ b/test/testbuckets.c @@ -488,6 +488,29 @@ static void test_write_split(abts_case *tc, void *data) apr_bucket_alloc_destroy(ba); } +static void test_write_putstrs(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba = apr_bucket_alloc_create(p); + apr_bucket_brigade *bb = apr_brigade_create(p, ba); + apr_bucket *e; + char buf[30]; + apr_size_t len = sizeof(buf); + const char *expect = "123456789abcdefghij"; + + e = apr_bucket_heap_create("1", 1, NULL, ba); + APR_BRIGADE_INSERT_HEAD(bb, e); + + apr_brigade_putstrs(bb, NULL, NULL, "2", "34", "567", "8", "9a", "bcd", + "e", "f", "gh", "i", NULL); + apr_brigade_putstrs(bb, NULL, NULL, "j", NULL); + APR_ASSERT_SUCCESS(tc, "apr_brigade_flatten", + apr_brigade_flatten(bb, buf, &len)); + ABTS_STR_NEQUAL(tc, expect, buf, strlen(expect)); + + apr_brigade_destroy(bb); + apr_bucket_alloc_destroy(ba); +} + abts_suite *testbuckets(abts_suite *suite) { suite = ADD_SUITE(suite); @@ -504,6 +527,7 @@ abts_suite *testbuckets(abts_suite *suite) abts_run_test(suite, test_truncfile, NULL); abts_run_test(suite, test_partition, NULL); abts_run_test(suite, test_write_split, NULL); + abts_run_test(suite, test_write_putstrs, NULL); return suite; } From e8c321c4c13545f7ff6259940e9d96291175ee73 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 27 Oct 2012 22:56:41 +0000 Subject: [PATCH 7187/7878] If out of mem, abort instead of crashing. Use the pool's abort function if it has one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1402907 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_buckets_alloc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/buckets/apr_buckets_alloc.c b/buckets/apr_buckets_alloc.c index 08c350cdbf3..466eb9f4043 100644 --- a/buckets/apr_buckets_alloc.c +++ b/buckets/apr_buckets_alloc.c @@ -57,11 +57,14 @@ APR_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create(apr_pool_t *p) apr_allocator_t *allocator; apr_bucket_alloc_t *list; - if (apr_allocator_create(&allocator) != APR_SUCCESS) { - abort(); + if (apr_allocator_create(&allocator) != APR_SUCCESS + || (list = apr_bucket_alloc_create_ex(allocator)) == NULL) { + apr_abortfunc_t fn = apr_pool_abort_get(p); + if (fn) + (fn)(APR_ENOMEM); + else + abort(); } - - list = apr_bucket_alloc_create_ex(allocator); list->pool = p; apr_pool_cleanup_register(list->pool, list, alloc_cleanup, apr_pool_cleanup_null); From 13bcf0cbb1721e01a8f1c46016bf82c0e1368526 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 3 Nov 2012 19:05:29 +0000 Subject: [PATCH 7188/7878] apr_socket_accept_filter(): The 2nd and 3rd arguments are now const char * instead of char *. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1405402 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_network_io.h | 4 ++-- network_io/unix/sockopt.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 3ce5fb1f799..d037d397fd4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_socket_accept_filter(): The 2nd and 3rd arguments are now + const char * instead of char *. [Jeff Trawick] + *) Fix potential data corruption in apr_brigade_write() and friends if the last bucket of the brigade is a heap bucket that has been split, and there are still references to the next part of the original bucket diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 753e5a4ede4..a0a386819f9 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -798,8 +798,8 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa); * @param args Any extra args to the accept filter. Passing NULL here removes * the accept filter. */ -apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, - char *args); +apr_status_t apr_socket_accept_filter(apr_socket_t *sock, const char *name, + const char *args); #endif /** diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 47c6927760b..487d309578c 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -393,8 +393,8 @@ apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) } #if APR_HAS_SO_ACCEPTFILTER -apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, - char *args) +apr_status_t apr_socket_accept_filter(apr_socket_t *sock, const char *name, + const char *args) { struct accept_filter_arg af; strncpy(af.af_name, name, 16); From da2d8e410f2ade51bd10ab750e2b78faf61ca48e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 5 Nov 2012 22:07:51 +0000 Subject: [PATCH 7189/7878] * network_io/unix/sockaddr.c (apr_ipsubnet_test): Fix false positive when testing a v4 subnet against a v6 address. * test/testipsub.c (test_interesting_subnets): Add test. PR: 54047 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1405985 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ network_io/unix/sockaddr.c | 4 ++-- test/testipsub.c | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index d037d397fd4..e8f2c2d071d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Fix apr_ipsubnet_test() false positives when comparing IPv4 + subnet representation against an IPv6 address. PR 54047. [Joe Orton] + *) apr_socket_accept_filter(): The 2nd and 3rd arguments are now const char * instead of char *. [Jeff Trawick] diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index e6c10353170..9e98821ee5b 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -1068,7 +1068,7 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa) /* XXX This line will segv on Win32 build with APR_HAVE_IPV6, * but without the IPV6 drivers installed. */ - if (sa->sa.sin.sin_family == AF_INET) { + if (sa->family == AF_INET) { if (ipsub->family == AF_INET && ((sa->sa.sin.sin_addr.s_addr & ipsub->mask[0]) == ipsub->sub[0])) { return 1; @@ -1080,7 +1080,7 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa) return 1; } } - else { + else if (sa->family == AF_INET6 && ipsub->family == AF_INET6) { apr_uint32_t *addr = (apr_uint32_t *)sa->ipaddr_ptr; if ((addr[0] & ipsub->mask[0]) == ipsub->sub[0] && diff --git a/test/testipsub.c b/test/testipsub.c index 8fd36721dd5..804bb3dcd38 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -119,6 +119,7 @@ static void test_interesting_subnets(abts_case *tc, void *data) ,{"127", NULL, APR_INET, "127.0.0.1", "10.1.2.3"} ,{"127.0.0.1", "8", APR_INET, "127.0.0.1", "10.1.2.3"} #if APR_HAVE_IPV6 + ,{"38.0.0.0", "8", APR_INET6, "::ffff:38.1.1.1", "2600::1"} /* PR 54047 */ ,{"fe80::", "8", APR_INET6, "fe80::1", "ff01::1"} ,{"ff01::", "8", APR_INET6, "ff01::1", "fe80::1"} ,{"3FFE:8160::", "28", APR_INET6, "3ffE:816e:abcd:1234::1", "3ffe:8170::1"} From 880c1cfbe97c6597dd219e95dc49ab3e3c9cc471 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Tue, 6 Nov 2012 10:36:42 +0000 Subject: [PATCH 7190/7878] Make sure we abort, even if the abortfunc returns git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1406088 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_buckets_alloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/buckets/apr_buckets_alloc.c b/buckets/apr_buckets_alloc.c index 466eb9f4043..8cdf703dda0 100644 --- a/buckets/apr_buckets_alloc.c +++ b/buckets/apr_buckets_alloc.c @@ -62,8 +62,7 @@ APR_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create(apr_pool_t *p) apr_abortfunc_t fn = apr_pool_abort_get(p); if (fn) (fn)(APR_ENOMEM); - else - abort(); + abort(); } list->pool = p; apr_pool_cleanup_register(list->pool, list, alloc_cleanup, From bbe2efded222d44887f6ef6f357fe5c3b070316c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 7 Nov 2012 16:06:25 +0000 Subject: [PATCH 7191/7878] apr_socket_accept_filter: Return success when trying to again set the filter to the same value as before. Use apr_cpystrn(). PR: 37863 (warning message from Apache httpd during restart) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1406690 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 487d309578c..8ba553230d7 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -397,8 +397,25 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, const char *name, const char *args) { struct accept_filter_arg af; - strncpy(af.af_name, name, 16); - strncpy(af.af_arg, args, 256 - 16); + socklen_t optlen = sizeof(af); + + /* FreeBSD returns an error if the filter is already set; ignore + * this call if we previously set it to the same value. + */ + if ((getsockopt(sock->socketdes, SOL_SOCKET, SO_ACCEPTFILTER, + &af, &optlen)) == 0) { + if (!strcmp(name, af.af_name) && !strcmp(args, af.af_arg)) { + return APR_SUCCESS; + } + } + + /* Uhh, at least in FreeBSD 9 the fields are declared as arrays of + * these lengths; did sizeof not work in some ancient release? + * + * FreeBSD kernel sets the last byte to a '\0'. + */ + apr_cpystrn(af.af_name, name, 16); + apr_cpystrn(af.af_arg, args, 256 - 16); if ((setsockopt(sock->socketdes, SOL_SOCKET, SO_ACCEPTFILTER, &af, sizeof(af))) < 0) { From 8f259dafdff84d1fc1b6ed926e9da3a4417400fe Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Wed, 21 Nov 2012 22:05:04 +0000 Subject: [PATCH 7192/7878] Fix top_builddir in installed apr_rules.mk. Port of r1101302 from 1.5.x resp. r1101301 from 1.4.x. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1412328 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index e2a13c17b24..a72ddb16e46 100644 --- a/Makefile.in +++ b/Makefile.in @@ -90,7 +90,7 @@ apr-config.out: $(APR_CONFIG) # Create apr_rules.mk suitable for the install tree build/apr_rules.out: build/apr_rules.mk - sed 's,^\(apr_build.*=\).*$$,\1$(installbuilddir),' < build/apr_rules.mk > $@ + sed -e 's,^\(apr_build.*=\).*$$,\1$(installbuilddir),' -e 's,^\(top_build.*=\).*$$,\1$(installbuilddir),' < build/apr_rules.mk > $@ install: install-modules $(TARGETS) $(APR_MKDIR) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(installbuilddir) \ From 92691e05539e47e23ff714f99e7da03b02b577e6 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 11 Dec 2012 11:53:48 +0000 Subject: [PATCH 7193/7878] * random/unix/: Remove unused SHA-384/SHA-512 implementations. Submitted by: Jan Kaluza git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1420106 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/sha2.c | 479 --------------------------------------------- random/unix/sha2.h | 31 +-- 2 files changed, 2 insertions(+), 508 deletions(-) diff --git a/random/unix/sha2.c b/random/unix/sha2.c index 212c1b732a4..1f5c1b2e8fb 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -52,8 +52,6 @@ typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ /*** SHA-256/384/512 Various Length Definitions ***********************/ /* NOTE: Most of these are in sha2.h */ #define SHA256_SHORT_BLOCK_LENGTH (SHA256_BLOCK_LENGTH - 8) -#define SHA384_SHORT_BLOCK_LENGTH (SHA384_BLOCK_LENGTH - 16) -#define SHA512_SHORT_BLOCK_LENGTH (SHA512_BLOCK_LENGTH - 16) /*** ENDIAN REVERSAL MACROS *******************************************/ @@ -150,9 +148,7 @@ typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ * library -- they are intended for private internal visibility/use * only. */ -void apr__SHA512_Last(SHA512_CTX*); void apr__SHA256_Transform(SHA256_CTX*, const sha2_word32*); -void apr__SHA512_Transform(SHA512_CTX*, const sha2_word64*); /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ @@ -188,74 +184,6 @@ static const sha2_word32 sha256_initial_hash_value[8] = { 0x5be0cd19UL }; -/* Hash constant words K for SHA-384 and SHA-512: */ -static const sha2_word64 K512[80] = { - APR_UINT64_C(0x428a2f98d728ae22), APR_UINT64_C(0x7137449123ef65cd), - APR_UINT64_C(0xb5c0fbcfec4d3b2f), APR_UINT64_C(0xe9b5dba58189dbbc), - APR_UINT64_C(0x3956c25bf348b538), APR_UINT64_C(0x59f111f1b605d019), - APR_UINT64_C(0x923f82a4af194f9b), APR_UINT64_C(0xab1c5ed5da6d8118), - APR_UINT64_C(0xd807aa98a3030242), APR_UINT64_C(0x12835b0145706fbe), - APR_UINT64_C(0x243185be4ee4b28c), APR_UINT64_C(0x550c7dc3d5ffb4e2), - APR_UINT64_C(0x72be5d74f27b896f), APR_UINT64_C(0x80deb1fe3b1696b1), - APR_UINT64_C(0x9bdc06a725c71235), APR_UINT64_C(0xc19bf174cf692694), - APR_UINT64_C(0xe49b69c19ef14ad2), APR_UINT64_C(0xefbe4786384f25e3), - APR_UINT64_C(0x0fc19dc68b8cd5b5), APR_UINT64_C(0x240ca1cc77ac9c65), - APR_UINT64_C(0x2de92c6f592b0275), APR_UINT64_C(0x4a7484aa6ea6e483), - APR_UINT64_C(0x5cb0a9dcbd41fbd4), APR_UINT64_C(0x76f988da831153b5), - APR_UINT64_C(0x983e5152ee66dfab), APR_UINT64_C(0xa831c66d2db43210), - APR_UINT64_C(0xb00327c898fb213f), APR_UINT64_C(0xbf597fc7beef0ee4), - APR_UINT64_C(0xc6e00bf33da88fc2), APR_UINT64_C(0xd5a79147930aa725), - APR_UINT64_C(0x06ca6351e003826f), APR_UINT64_C(0x142929670a0e6e70), - APR_UINT64_C(0x27b70a8546d22ffc), APR_UINT64_C(0x2e1b21385c26c926), - APR_UINT64_C(0x4d2c6dfc5ac42aed), APR_UINT64_C(0x53380d139d95b3df), - APR_UINT64_C(0x650a73548baf63de), APR_UINT64_C(0x766a0abb3c77b2a8), - APR_UINT64_C(0x81c2c92e47edaee6), APR_UINT64_C(0x92722c851482353b), - APR_UINT64_C(0xa2bfe8a14cf10364), APR_UINT64_C(0xa81a664bbc423001), - APR_UINT64_C(0xc24b8b70d0f89791), APR_UINT64_C(0xc76c51a30654be30), - APR_UINT64_C(0xd192e819d6ef5218), APR_UINT64_C(0xd69906245565a910), - APR_UINT64_C(0xf40e35855771202a), APR_UINT64_C(0x106aa07032bbd1b8), - APR_UINT64_C(0x19a4c116b8d2d0c8), APR_UINT64_C(0x1e376c085141ab53), - APR_UINT64_C(0x2748774cdf8eeb99), APR_UINT64_C(0x34b0bcb5e19b48a8), - APR_UINT64_C(0x391c0cb3c5c95a63), APR_UINT64_C(0x4ed8aa4ae3418acb), - APR_UINT64_C(0x5b9cca4f7763e373), APR_UINT64_C(0x682e6ff3d6b2b8a3), - APR_UINT64_C(0x748f82ee5defb2fc), APR_UINT64_C(0x78a5636f43172f60), - APR_UINT64_C(0x84c87814a1f0ab72), APR_UINT64_C(0x8cc702081a6439ec), - APR_UINT64_C(0x90befffa23631e28), APR_UINT64_C(0xa4506cebde82bde9), - APR_UINT64_C(0xbef9a3f7b2c67915), APR_UINT64_C(0xc67178f2e372532b), - APR_UINT64_C(0xca273eceea26619c), APR_UINT64_C(0xd186b8c721c0c207), - APR_UINT64_C(0xeada7dd6cde0eb1e), APR_UINT64_C(0xf57d4f7fee6ed178), - APR_UINT64_C(0x06f067aa72176fba), APR_UINT64_C(0x0a637dc5a2c898a6), - APR_UINT64_C(0x113f9804bef90dae), APR_UINT64_C(0x1b710b35131c471b), - APR_UINT64_C(0x28db77f523047d84), APR_UINT64_C(0x32caab7b40c72493), - APR_UINT64_C(0x3c9ebe0a15c9bebc), APR_UINT64_C(0x431d67c49c100d4c), - APR_UINT64_C(0x4cc5d4becb3e42b6), APR_UINT64_C(0x597f299cfc657e2a), - APR_UINT64_C(0x5fcb6fab3ad6faec), APR_UINT64_C(0x6c44198c4a475817) -}; - -/* Initial hash value H for SHA-384 */ -static const sha2_word64 sha384_initial_hash_value[8] = { - APR_UINT64_C(0xcbbb9d5dc1059ed8), - APR_UINT64_C(0x629a292a367cd507), - APR_UINT64_C(0x9159015a3070dd17), - APR_UINT64_C(0x152fecd8f70e5939), - APR_UINT64_C(0x67332667ffc00b31), - APR_UINT64_C(0x8eb44a8768581511), - APR_UINT64_C(0xdb0c2e0d64f98fa7), - APR_UINT64_C(0x47b5481dbefa4fa4) -}; - -/* Initial hash value H for SHA-512 */ -static const sha2_word64 sha512_initial_hash_value[8] = { - APR_UINT64_C(0x6a09e667f3bcc908), - APR_UINT64_C(0xbb67ae8584caa73b), - APR_UINT64_C(0x3c6ef372fe94f82b), - APR_UINT64_C(0xa54ff53a5f1d36f1), - APR_UINT64_C(0x510e527fade682d1), - APR_UINT64_C(0x9b05688c2b3e6c1f), - APR_UINT64_C(0x1f83d9abfb41bd6b), - APR_UINT64_C(0x5be0cd19137e2179) -}; - /* * Constant used by SHA256/384/512_End() functions for converting the * digest to a readable hexadecimal character string: @@ -591,410 +519,3 @@ char* apr__SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIG apr__SHA256_Update(&context, data, len); return apr__SHA256_End(&context, digest); } - - -/*** SHA-512: *********************************************************/ -void apr__SHA512_Init(SHA512_CTX* context) { - if (context == (SHA512_CTX*)0) { - return; - } - MEMCPY_BCOPY(context->state, sha512_initial_hash_value, SHA512_DIGEST_LENGTH); - MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH); - context->bitcount[0] = context->bitcount[1] = 0; -} - -#ifdef SHA2_UNROLL_TRANSFORM - -/* Unrolled SHA-512 round macros: */ -#if !APR_IS_BIGENDIAN - -#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ - REVERSE64(*data++, W512[j]); \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ - K512[j] + W512[j]; \ - (d) += T1, \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \ - j++ - - -#else /* APR_IS_BIGENDIAN */ - -#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ - K512[j] + (W512[j] = *data++); \ - (d) += T1; \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ - j++ - -#endif /* APR_IS_BIGENDIAN */ - -#define ROUND512(a,b,c,d,e,f,g,h) \ - s0 = W512[(j+1)&0x0f]; \ - s0 = sigma0_512(s0); \ - s1 = W512[(j+14)&0x0f]; \ - s1 = sigma1_512(s1); \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \ - (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \ - (d) += T1; \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ - j++ - -void apr__SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { - sha2_word64 a, b, c, d, e, f, g, h, s0, s1; - sha2_word64 T1, *W512 = (sha2_word64*)context->buffer; - int j; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { - ROUND512_0_TO_15(a,b,c,d,e,f,g,h); - ROUND512_0_TO_15(h,a,b,c,d,e,f,g); - ROUND512_0_TO_15(g,h,a,b,c,d,e,f); - ROUND512_0_TO_15(f,g,h,a,b,c,d,e); - ROUND512_0_TO_15(e,f,g,h,a,b,c,d); - ROUND512_0_TO_15(d,e,f,g,h,a,b,c); - ROUND512_0_TO_15(c,d,e,f,g,h,a,b); - ROUND512_0_TO_15(b,c,d,e,f,g,h,a); - } while (j < 16); - - /* Now for the remaining rounds up to 79: */ - do { - ROUND512(a,b,c,d,e,f,g,h); - ROUND512(h,a,b,c,d,e,f,g); - ROUND512(g,h,a,b,c,d,e,f); - ROUND512(f,g,h,a,b,c,d,e); - ROUND512(e,f,g,h,a,b,c,d); - ROUND512(d,e,f,g,h,a,b,c); - ROUND512(c,d,e,f,g,h,a,b); - ROUND512(b,c,d,e,f,g,h,a); - } while (j < 80); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = 0; -} - -#else /* SHA2_UNROLL_TRANSFORM */ - -void apr__SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { - sha2_word64 a, b, c, d, e, f, g, h, s0, s1; - sha2_word64 T1, T2, *W512 = (sha2_word64*)context->buffer; - int j; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { -#if !APR_IS_BIGENDIAN - /* Convert TO host byte order */ - REVERSE64(*data++, W512[j]); - /* Apply the SHA-512 compression function to update a..h */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; -#else /* APR_IS_BIGENDIAN */ - /* Apply the SHA-512 compression function to update a..h with copy */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++); -#endif /* APR_IS_BIGENDIAN */ - T2 = Sigma0_512(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 16); - - do { - /* Part of the message block expansion: */ - s0 = W512[(j+1)&0x0f]; - s0 = sigma0_512(s0); - s1 = W512[(j+14)&0x0f]; - s1 = sigma1_512(s1); - - /* Apply the SHA-512 compression function to update a..h */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + - (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); - T2 = Sigma0_512(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 80); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = T2 = 0; -} - -#endif /* SHA2_UNROLL_TRANSFORM */ - -void apr__SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { - unsigned int freespace, usedspace; - - if (len == 0) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - assert(context != (SHA512_CTX*)0 && data != (sha2_byte*)0); - - usedspace = (unsigned int)((context->bitcount[0] >> 3) - % SHA512_BLOCK_LENGTH); - if (usedspace > 0) { - /* Calculate how much free space is available in the buffer */ - freespace = SHA512_BLOCK_LENGTH - usedspace; - - if (len >= freespace) { - /* Fill the buffer completely and process it */ - MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); - ADDINC128(context->bitcount, freespace << 3); - len -= freespace; - data += freespace; - apr__SHA512_Transform(context, (sha2_word64*)context->buffer); - } else { - /* The buffer is not yet full */ - MEMCPY_BCOPY(&context->buffer[usedspace], data, len); - ADDINC128(context->bitcount, len << 3); - /* Clean up: */ - usedspace = freespace = 0; - return; - } - } - while (len >= SHA512_BLOCK_LENGTH) { - /* Process as many complete blocks as we can */ - apr__SHA512_Transform(context, (sha2_word64*)data); - ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3); - len -= SHA512_BLOCK_LENGTH; - data += SHA512_BLOCK_LENGTH; - } - if (len > 0) { - /* There's left-overs, so save 'em */ - MEMCPY_BCOPY(context->buffer, data, len); - ADDINC128(context->bitcount, len << 3); - } - /* Clean up: */ - usedspace = freespace = 0; -} - -void apr__SHA512_Last(SHA512_CTX* context) { - unsigned int usedspace; - - usedspace = (unsigned int)((context->bitcount[0] >> 3) - % SHA512_BLOCK_LENGTH); -#if !APR_IS_BIGENDIAN - /* Convert FROM host byte order */ - REVERSE64(context->bitcount[0],context->bitcount[0]); - REVERSE64(context->bitcount[1],context->bitcount[1]); -#endif - if (usedspace > 0) { - /* Begin padding with a 1 bit: */ - context->buffer[usedspace++] = 0x80; - - if (usedspace <= SHA512_SHORT_BLOCK_LENGTH) { - /* Set-up for the last transform: */ - MEMSET_BZERO(&context->buffer[usedspace], SHA512_SHORT_BLOCK_LENGTH - usedspace); - } else { - if (usedspace < SHA512_BLOCK_LENGTH) { - MEMSET_BZERO(&context->buffer[usedspace], SHA512_BLOCK_LENGTH - usedspace); - } - /* Do second-to-last transform: */ - apr__SHA512_Transform(context, (sha2_word64*)context->buffer); - - /* And set-up for the last transform: */ - MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH - 2); - } - } else { - /* Prepare for final transform: */ - MEMSET_BZERO(context->buffer, SHA512_SHORT_BLOCK_LENGTH); - - /* Begin padding with a 1 bit: */ - *context->buffer = 0x80; - } - /* Store the length of input data (in bits): */ - *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; - *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; - - /* Final transform: */ - apr__SHA512_Transform(context, (sha2_word64*)context->buffer); -} - -void apr__SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { - sha2_word64 *d = (sha2_word64*)digest; - - /* Sanity check: */ - assert(context != (SHA512_CTX*)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha2_byte*)0) { - apr__SHA512_Last(context); - - /* Save the hash data for output: */ -#if !APR_IS_BIGENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < 8; j++) { - REVERSE64(context->state[j],context->state[j]); - *d++ = context->state[j]; - } - } -#else /* APR_IS_BIGENDIAN */ - MEMCPY_BCOPY(d, context->state, SHA512_DIGEST_LENGTH); -#endif /* APR_IS_BIGENDIAN */ - } - - /* Zero out state data */ - MEMSET_BZERO(context, sizeof(*context)); -} - -char *apr__SHA512_End(SHA512_CTX* context, char buffer[]) { - sha2_byte digest[SHA512_DIGEST_LENGTH], *d = digest; - int i; - - /* Sanity check: */ - assert(context != (SHA512_CTX*)0); - - if (buffer != (char*)0) { - apr__SHA512_Final(digest, context); - - for (i = 0; i < SHA512_DIGEST_LENGTH; i++) { - *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha2_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { - MEMSET_BZERO(context, sizeof(*context)); - } - MEMSET_BZERO(digest, SHA512_DIGEST_LENGTH); - return buffer; -} - -char* apr__SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) { - SHA512_CTX context; - - apr__SHA512_Init(&context); - apr__SHA512_Update(&context, data, len); - return apr__SHA512_End(&context, digest); -} - - -/*** SHA-384: *********************************************************/ -void apr__SHA384_Init(SHA384_CTX* context) { - if (context == (SHA384_CTX*)0) { - return; - } - MEMCPY_BCOPY(context->state, sha384_initial_hash_value, SHA512_DIGEST_LENGTH); - MEMSET_BZERO(context->buffer, SHA384_BLOCK_LENGTH); - context->bitcount[0] = context->bitcount[1] = 0; -} - -void apr__SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) { - apr__SHA512_Update((SHA512_CTX*)context, data, len); -} - -void apr__SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { - sha2_word64 *d = (sha2_word64*)digest; - - /* Sanity check: */ - assert(context != (SHA384_CTX*)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha2_byte*)0) { - apr__SHA512_Last((SHA512_CTX*)context); - - /* Save the hash data for output: */ -#if !APR_IS_BIGENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < 6; j++) { - REVERSE64(context->state[j],context->state[j]); - *d++ = context->state[j]; - } - } -#else /* APR_IS_BIGENDIAN */ - MEMCPY_BCOPY(d, context->state, SHA384_DIGEST_LENGTH); -#endif /* APR_IS_BIGENDIAN */ - } - - /* Zero out state data */ - MEMSET_BZERO(context, sizeof(*context)); -} - -char *apr__SHA384_End(SHA384_CTX* context, char buffer[]) { - sha2_byte digest[SHA384_DIGEST_LENGTH], *d = digest; - int i; - - /* Sanity check: */ - assert(context != (SHA384_CTX*)0); - - if (buffer != (char*)0) { - apr__SHA384_Final(digest, context); - - for (i = 0; i < SHA384_DIGEST_LENGTH; i++) { - *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha2_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { - MEMSET_BZERO(context, sizeof(*context)); - } - MEMSET_BZERO(digest, SHA384_DIGEST_LENGTH); - return buffer; -} - -char* apr__SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) { - SHA384_CTX context; - - apr__SHA384_Init(&context); - apr__SHA384_Update(&context, data, len); - return apr__SHA384_End(&context, digest); -} - diff --git a/random/unix/sha2.h b/random/unix/sha2.h index 9f0d93e1e01..0a030d7dbae 100644 --- a/random/unix/sha2.h +++ b/random/unix/sha2.h @@ -29,16 +29,10 @@ extern "C" { #include "apr.h" -/*** SHA-256/384/512 Various Length Definitions ***********************/ +/*** SHA-256 Various Length Definitions ***********************/ #define SHA256_BLOCK_LENGTH 64 #define SHA256_DIGEST_LENGTH 32 #define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) -#define SHA384_BLOCK_LENGTH 128 -#define SHA384_DIGEST_LENGTH 48 -#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) -#define SHA512_BLOCK_LENGTH 128 -#define SHA512_DIGEST_LENGTH 64 -#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) /*** SHA-256/384/512 Context Structures *******************************/ @@ -47,13 +41,6 @@ typedef struct _SHA256_CTX { apr_uint64_t bitcount; apr_byte_t buffer[SHA256_BLOCK_LENGTH]; } SHA256_CTX; -typedef struct _SHA512_CTX { - apr_uint64_t state[8]; - apr_uint64_t bitcount[2]; - apr_byte_t buffer[SHA512_BLOCK_LENGTH]; -} SHA512_CTX; - -typedef SHA512_CTX SHA384_CTX; /*** SHA-256/384/512 Function Prototypes ******************************/ @@ -63,21 +50,7 @@ void apr__SHA256_Final(apr_byte_t [SHA256_DIGEST_LENGTH], SHA256_CTX *); char* apr__SHA256_End(SHA256_CTX *, char [SHA256_DIGEST_STRING_LENGTH]); char* apr__SHA256_Data(const apr_byte_t *, size_t, char [SHA256_DIGEST_STRING_LENGTH]); - -void apr__SHA384_Init(SHA384_CTX *); -void apr__SHA384_Update(SHA384_CTX *, const apr_byte_t *, size_t); -void apr__SHA384_Final(apr_byte_t [SHA384_DIGEST_LENGTH], SHA384_CTX *); -char* apr__SHA384_End(SHA384_CTX *, char [SHA384_DIGEST_STRING_LENGTH]); -char* apr__SHA384_Data(const apr_byte_t *, size_t, - char [SHA384_DIGEST_STRING_LENGTH]); - -void apr__SHA512_Init(SHA512_CTX *); -void apr__SHA512_Update(SHA512_CTX *, const apr_byte_t *, size_t); -void apr__SHA512_Final(apr_byte_t [SHA512_DIGEST_LENGTH], SHA512_CTX *); -char* apr__SHA512_End(SHA512_CTX *, char [SHA512_DIGEST_STRING_LENGTH]); -char* apr__SHA512_Data(const apr_byte_t *, size_t, - char [SHA512_DIGEST_STRING_LENGTH]); - + #ifdef __cplusplus } #endif /* __cplusplus */ From a69b8b4768a41abedbb944b1540d108a658c46cb Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 11 Dec 2012 11:56:10 +0000 Subject: [PATCH 7194/7878] * random/unix/sha2.c (apr__SHA256_Final): Avoid C pointer aliasing violation. Submitted by: Jan Kaluza git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1420109 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/sha2.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/random/unix/sha2.c b/random/unix/sha2.c index 1f5c1b2e8fb..12c257d1fa1 100644 --- a/random/unix/sha2.c +++ b/random/unix/sha2.c @@ -465,7 +465,14 @@ void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { *context->buffer = 0x80; } /* Set the bit count: */ - *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; + { + union dummy { + apr_uint64_t bitcount; + apr_byte_t bytes[8]; + } bitcount; + bitcount.bitcount = context->bitcount; + MEMCPY_BCOPY(&context->buffer[SHA256_SHORT_BLOCK_LENGTH], bitcount.bytes, 8); + } /* Final transform: */ apr__SHA256_Transform(context, (sha2_word32*)context->buffer); From f510128f3a0c2d0b3376b3ff9a7b1a90f6d7618d Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 15 Dec 2012 23:22:34 +0000 Subject: [PATCH 7195/7878] Split glibc version detection in two #if directives. If __GLIBC_PREREQ is undefined, the single-line version expands to '#if 0 && 0(2,4)', which causes a syntax error. PR: 54275 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1422413 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_passwd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crypto/apr_passwd.c b/crypto/apr_passwd.c index 73d830a6359..dc35c0e6a38 100644 --- a/crypto/apr_passwd.c +++ b/crypto/apr_passwd.c @@ -137,7 +137,8 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, #elif defined(CRYPT_R_STRUCT_CRYPT_DATA) struct crypt_data buffer; -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,4) +#ifdef __GLIBC_PREREQ +#if __GLIBC_PREREQ(2,4) buffer.initialized = 0; #else /* @@ -146,6 +147,8 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, */ memset(&buffer, 0, sizeof(buffer)); #endif +#endif /* defined __GLIBC_PREREQ */ + crypt_pw = crypt_r(passwd, hash, &buffer); if (!crypt_pw) { return APR_EMISMATCH; From 8b8a56afe3e1dd96638344857667ca6b8e86c1a1 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 22 Dec 2012 22:19:28 +0000 Subject: [PATCH 7196/7878] doc fixes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1425356 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_base64.h | 8 ++++---- include/apr_thread_proc.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/apr_base64.h b/include/apr_base64.h index 526b8ab3e5c..68b30873f3d 100644 --- a/include/apr_base64.h +++ b/include/apr_base64.h @@ -51,10 +51,10 @@ extern "C" { */ /** - * Given the length of an un-encrypted string, get the length of the - * encrypted string. - * @param len the length of an unencrypted string. - * @return the length of the string after it is encrypted, including the + * Given the length of an un-encoded string, get the length of the + * encoded string. + * @param len the length of an unencoded string. + * @return the length of the string after it is encoded, including the * trailing \0 */ APR_DECLARE(int) apr_base64_encode_len(int len) __attribute__((pure)); diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index ac3b7002ad7..1ecbfaa60ac 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -318,7 +318,7 @@ APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd); /** - * Return the pool associated with the current thread. + * Return user data associated with the current thread. * @param data The user data associated with the thread. * @param key The key to associate with the data * @param thread The currently open thread. @@ -327,7 +327,7 @@ APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread); /** - * Return the pool associated with the current thread. + * Set user data associated with the current thread. * @param data The user data to associate with the thread. * @param key The key to use for associating the data with the thread * @param cleanup The cleanup routine to use when the thread is destroyed. From 642bfe4f2a4c263ece02a126128961c73501e4ee Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 28 Dec 2012 09:38:41 +0000 Subject: [PATCH 7197/7878] Fixup r1422413 so that memset is used on non-glibc platforms Noticed by Alan Hourihane git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1426442 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_passwd.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/crypto/apr_passwd.c b/crypto/apr_passwd.c index dc35c0e6a38..5fcb439ede1 100644 --- a/crypto/apr_passwd.c +++ b/crypto/apr_passwd.c @@ -138,16 +138,21 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, struct crypt_data buffer; #ifdef __GLIBC_PREREQ + /* + * For not too old glibc (>= 2.3.2), it's enough to set + * buffer.initialized = 0. For < 2.3.2 and for other platforms, + * we need to zero the whole struct. + */ #if __GLIBC_PREREQ(2,4) +#define USE_CRYPT_DATA_INITALIZED +#endif +#endif + +#ifdef USE_CRYPT_DATA_INITALIZED buffer.initialized = 0; #else - /* - * glibc before 2.3.2 had a bug that required clearing the - * whole struct - */ memset(&buffer, 0, sizeof(buffer)); #endif -#endif /* defined __GLIBC_PREREQ */ crypt_pw = crypt_r(passwd, hash, &buffer); if (!crypt_pw) { From 5385f84297887f0132c10aeec957bf7eb081dd83 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 28 Dec 2012 10:06:09 +0000 Subject: [PATCH 7198/7878] Fix docs for apr_queue_trypop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR: 54328 Submitted by: Javier Alcázar git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1426448 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_queue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_queue.h b/include/apr_queue.h index f672bf2434b..93bf2e41fa7 100644 --- a/include/apr_queue.h +++ b/include/apr_queue.h @@ -98,7 +98,7 @@ APR_DECLARE(apr_status_t) apr_queue_trypush(apr_queue_t *queue, void *data); * @returns APR_EINTR the blocking operation was interrupted (try again) * @returns APR_EAGAIN the queue is empty * @returns APR_EOF the queue has been terminated - * @returns APR_SUCCESS on a successful push + * @returns APR_SUCCESS on a successful pop */ APR_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data); From 13d95d6c04ef41b526068fa519bec6fb0272411b Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 8 Jan 2013 17:54:31 +0000 Subject: [PATCH 7199/7878] give John Brooks credit for his design, but don't feed his email to the spammers git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1430410 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/z_asio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index b08ebe2332c..d28b4a1ee96 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -16,7 +16,8 @@ * ****************************************************************************** * - * This implementation is based on the z/OS sockets async i/o facility. When a + * This implementation is based on a design by John Brooks (IBM Pok) which uses + * the z/OS sockets async i/o facility. When a * socket is added to the pollset, an async poll is issued for that individual * socket. It specifies that the kernel should send an IPC message when the * socket becomes ready. The IPC messages are sent to a single message queue From 1c7aaa1a99bf3d6c091a9e751de57222b0701187 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 17 Jan 2013 18:44:49 +0000 Subject: [PATCH 7200/7878] no functional change, whitespace only. remove trailing blanks git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1434858 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/z_asio.c | 130 ++++++++++++++++++++++----------------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index d28b4a1ee96..4b78623a94a 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -18,15 +18,15 @@ * * This implementation is based on a design by John Brooks (IBM Pok) which uses * the z/OS sockets async i/o facility. When a - * socket is added to the pollset, an async poll is issued for that individual - * socket. It specifies that the kernel should send an IPC message when the - * socket becomes ready. The IPC messages are sent to a single message queue - * that is part of the pollset. apr_pollset_poll waits on the arrival of IPC + * socket is added to the pollset, an async poll is issued for that individual + * socket. It specifies that the kernel should send an IPC message when the + * socket becomes ready. The IPC messages are sent to a single message queue + * that is part of the pollset. apr_pollset_poll waits on the arrival of IPC * messages or the specified timeout. * * Since z/OS does not support async i/o for pipes or files at present, this - * implementation falls back to using ordinary poll() when - * APR_POLLSET_THREADSAFE is unset. + * implementation falls back to using ordinary poll() when + * APR_POLLSET_THREADSAFE is unset. * * Greg Ames * April 2012 @@ -37,7 +37,7 @@ #include "apr_poll.h" #include "apr_time.h" #include "apr_portable.h" -#include "apr_arch_inherit.h" +#include "apr_arch_inherit.h" #include "apr_arch_file_io.h" #include "apr_arch_networkio.h" #include "apr_arch_poll_private.h" @@ -56,7 +56,7 @@ struct apr_pollset_private_t * file descriptors complete */ apr_pollfd_t *result_set; - apr_uint32_t size; + apr_uint32_t size; #if APR_HAS_THREADS /* A thread mutex to protect operations on the rings and the hash */ @@ -69,7 +69,7 @@ struct apr_pollset_private_t APR_RING_HEAD(ready_ring_t, asio_elem_t) ready_ring; APR_RING_HEAD(prior_ready_ring_t, asio_elem_t) prior_ready_ring; APR_RING_HEAD(free_ring_t, asio_elem_t) free_ring; - + /* for pipes etc with no asio */ struct pollfd *pollset; apr_pollfd_t *query_set; @@ -88,7 +88,7 @@ struct asio_msgbuf_t { }; struct asio_elem_t -{ +{ APR_RING_ENTRY(asio_elem_t) link; apr_pollfd_t pfd; struct pollfd os_pfd; @@ -106,7 +106,7 @@ struct asio_elem_t * 4 - z/OS, APR, and internal calls, * 5 - everything else except the timer pop path, * 6 - everything, including the Event 1 sec timer pop path - * + * * each DEBUG level includes all messages produced by lower numbered levels */ @@ -162,9 +162,9 @@ struct asio_elem_t DBG_END #else /* DEBUG is 0 */ -#define DBG_BUFF -#define DBG(lvl, msg) ((void)0) -#define DBG1(lvl, msg, var1) ((void)0) +#define DBG_BUFF +#define DBG(lvl, msg) ((void)0) +#define DBG1(lvl, msg, var1) ((void)0) #define DBG2(lvl, msg, var1, var2) ((void)0) #define DBG3(lvl, msg, var1, var2, var3) ((void)0) #define DBG4(lvl, msg, var1, var2, var3, var4) ((void)0) @@ -182,12 +182,12 @@ static int asyncio(asio_elem_t *elem) #define AIO BPX1AIO #endif - AIO(sizeof(struct aiocb), &(elem->a), &rv, &errno, __err2ad()); - DBG3(4, "BPX4AIO aiocb %p elem %p rv %d\n", + AIO(sizeof(struct aiocb), &(elem->a), &rv, &errno, __err2ad()); + DBG3(4, "BPX4AIO aiocb %p elem %p rv %d\n", &(elem->a), elem, rv); #ifdef DEBUG if (rv < 0) { - DBG2(4, "errno %d errnojr %08x\n", + DBG2(4, "errno %d errnojr %08x\n", errno, *__err2ad()); } #endif @@ -276,7 +276,7 @@ static apr_status_t asio_pollset_create(apr_pollset_t *pollset, } rv = msgget(IPC_PRIVATE, S_IWUSR+S_IRUSR); /* user r/w perms */ if (rv < 0) { -#if DEBUG +#if DEBUG perror(__FUNCTION__ " msgget returned < 0 "); #endif pollset = NULL; @@ -295,7 +295,7 @@ static apr_status_t asio_pollset_create(apr_pollset_t *pollset, return APR_ENOTIMPL; #endif - } else { /* APR_POLLSET_THREADSAFE not set, i.e. no async i/o, + } else { /* APR_POLLSET_THREADSAFE not set, i.e. no async i/o, * init fields only needed in old style pollset */ @@ -317,8 +317,8 @@ static apr_status_t asio_pollset_create(apr_pollset_t *pollset, } DBG2(2, "exiting, pollset: %p, type: %s\n", - pollset, - flags & APR_POLLSET_THREADSAFE ? "async" : "POSIX"); + pollset, + flags & APR_POLLSET_THREADSAFE ? "async" : "POSIX"); return APR_SUCCESS; @@ -371,7 +371,7 @@ static apr_status_t asio_pollset_add(apr_pollset_t *pollset, pollset_lock_rings(); DBG(2, "entered\n"); - if (pollset->flags & APR_POLLSET_THREADSAFE) { + if (pollset->flags & APR_POLLSET_THREADSAFE) { if (!APR_RING_EMPTY(&(priv->free_ring), asio_elem_t, link)) { elem = APR_RING_FIRST(&(priv->free_ring)); @@ -397,7 +397,7 @@ static apr_status_t asio_pollset_add(apr_pollset_t *pollset, /* z/OS only supports async I/O for sockets for now */ elem->os_pfd.fd = descriptor->desc.s->socketdes; - + APR_RING_ELEM_INIT(elem, link); elem->a.aio_cmd = AIO_SELPOLL; elem->a.aio_cflags &= ~AIO_OK2COMPIMD; /* not OK to complete inline*/ @@ -406,14 +406,14 @@ static apr_status_t asio_pollset_add(apr_pollset_t *pollset, if (0 != asyncio(elem)) { rv = errno; - DBG3(4, "pollset %p asio failed fd %d, errno %p\n", + DBG3(4, "pollset %p asio failed fd %d, errno %p\n", pollset, elem->os_pfd.fd, rv); #if DEBUG perror(__FUNCTION__ " asio failure"); #endif } else { - DBG2(4, "good asio call, adding fd %d to pollset %p\n", + DBG2(4, "good asio call, adding fd %d to pollset %p\n", elem->os_pfd.fd, pollset); pollset->nelts++; @@ -421,11 +421,11 @@ static apr_status_t asio_pollset_add(apr_pollset_t *pollset, } } else { - /* APR_POLLSET_THREADSAFE isn't set. use POSIX poll in case + /* APR_POLLSET_THREADSAFE isn't set. use POSIX poll in case * pipes or files are used with this pollset */ - - rv = posix_add(pollset, descriptor); + + rv = posix_add(pollset, descriptor); } DBG1(2, "exiting, rv = %d\n", rv); @@ -440,7 +440,7 @@ static posix_remove(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) apr_uint32_t i; apr_pollset_private_t *priv = pollset->p; - DBG(4, "entered\n"); + DBG(4, "entered\n"); for (i = 0; i < pollset->nelts; i++) { if (descriptor->desc.s == priv->query_set[i].desc.s) { /* Found an instance of the fd: remove this and any other copies */ @@ -457,12 +457,12 @@ static posix_remove(apr_pollset_t *pollset, const apr_pollfd_t *descriptor) dst++; } } - DBG(4, "returning OK\n"); + DBG(4, "returning OK\n"); return APR_SUCCESS; } } - DBG(1, "returning APR_NOTFOUND\n"); + DBG(1, "returning APR_NOTFOUND\n"); return APR_NOTFOUND; } /* end of posix_remove */ @@ -499,17 +499,17 @@ static apr_status_t asio_pollset_remove(apr_pollset_t *pollset, DBG1(5, "hash found fd %d\n", fd); /* delete this fd from the hash */ apr_hash_set(priv->elems, &(fd), sizeof(int), NULL); - /* asyncio call to cancel */ + /* asyncio call to cancel */ elem->a.aio_cmd = AIO_CANCEL; /* elem->a.aio_cflags = AIO_CANCELNONOTIFY; */ - /* we want *msgrcv to collect cancel notifications to remove races + /* we want *msgrcv to collect cancel notifications to remove races * in garbage collection */ rv = asyncio(elem); DBG1(4, "asyncio returned %d\n", rv); - if (rv == 1) { + if (rv == 1) { elem->state = ASIO_CANCELLED; rv = APR_SUCCESS; } @@ -562,20 +562,20 @@ static posix_poll(apr_pollset_t *pollset, } /* end of posix_poll */ -static process_msg(apr_pollset_t *pollset, struct asio_msgbuf_t *msg) +static process_msg(apr_pollset_t *pollset, struct asio_msgbuf_t *msg) { DBG_BUFF asio_elem_t *elem = msg->msg_elem; if (elem->state == ASIO_CANCELLED) { - DBG2(5, "for cancelled elem, recycling memory - elem %08p, fd %d\n", - elem, elem->os_pfd.fd); - APR_RING_INSERT_TAIL(&(pollset->p->free_ring), elem, + DBG2(5, "for cancelled elem, recycling memory - elem %08p, fd %d\n", + elem, elem->os_pfd.fd); + APR_RING_INSERT_TAIL(&(pollset->p->free_ring), elem, asio_elem_t, link); } else { - DBG2(4, "adding to ready ring: elem %08p, fd %d\n", - elem, elem->os_pfd.fd); - APR_RING_INSERT_TAIL(&(pollset->p->ready_ring), elem, + DBG2(4, "adding to ready ring: elem %08p, fd %d\n", + elem, elem->os_pfd.fd); + APR_RING_INSERT_TAIL(&(pollset->p->ready_ring), elem, asio_elem_t, link); } } @@ -607,7 +607,7 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, DBG3(5, "pollset %p elem %p fd %d on prior ready ring\n", pollset, elem, - elem->os_pfd.fd); + elem->os_pfd.fd); APR_RING_REMOVE(elem, link); @@ -618,11 +618,11 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, * there may have been too many ready fd's to return in the * result set last time. re-poll inline for both cases */ - + if (elem->state == ASIO_CANCELLED) { continue; /* do not re-add if it has been _removed */ - } - + } + elem->a.aio_cflags = AIO_OK2COMPIMD; if (0 != (ret = asyncio(elem))) { @@ -631,7 +631,7 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, /* it's ready now */ APR_RING_INSERT_TAIL(&(priv->ready_ring), elem, asio_elem_t, link); - } + } else { DBG2(1, "asyncio() failed, ret: %d, errno: %d\n", ret, errno); @@ -645,13 +645,13 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, DBG(6, "after prior ready loop\n"); /* chatty w/timeouts, hence 6 */ /* Gather async poll completions that have occurred since the last call */ - while (0 < msgrcv(priv->msg_q, &msg_buff, sizeof(asio_elem_t *), 0, + while (0 < msgrcv(priv->msg_q, &msg_buff, sizeof(asio_elem_t *), 0, IPC_NOWAIT)) { process_msg(pollset, &msg_buff); - } - + } + /* Suspend if nothing is ready yet. */ - if (APR_RING_EMPTY(&(priv->ready_ring), asio_elem_t, link)) { + if (APR_RING_EMPTY(&(priv->ready_ring), asio_elem_t, link)) { if (timeout >= 0) { tv.tv_sec = apr_time_sec(timeout); @@ -664,7 +664,7 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, "- blocking for %d seconds %d ns\n", tv.tv_sec, tv.tv_nsec); - pollset_unlock_rings(); /* allow other apr_pollset_* calls while blocked */ + pollset_unlock_rings(); /* allow other apr_pollset_* calls while blocked */ if (0 >= (ret = __msgrcv_timed(priv->msg_q, &msg_buff, sizeof(asio_elem_t *), 0, NULL, &tv))) { @@ -682,27 +682,27 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); process_msg(pollset, &msg_buff); - } + } - APR_RING_INIT(&priv->prior_ready_ring, asio_elem_t, link); + APR_RING_INIT(&priv->prior_ready_ring, asio_elem_t, link); (*num) = 0; elem = APR_RING_FIRST(&(priv->ready_ring)); for (i = 0; - + i < priv->size && elem != APR_RING_SENTINEL(&(priv->ready_ring), asio_elem_t, link); - i++) { - DBG2(5, "ready ring: elem %08p, fd %d\n", elem, elem->os_pfd.fd); + i++) { + DBG2(5, "ready ring: elem %08p, fd %d\n", elem, elem->os_pfd.fd); priv->result_set[i] = elem->pfd; - priv->result_set[i].rtnevents + priv->result_set[i].rtnevents = get_revent(elem->os_pfd.revents); (*num)++; elem = APR_RING_NEXT(elem, link); - + #if DEBUG if (elem == APR_RING_SENTINEL(&(priv->ready_ring), asio_elem_t, link)) { DBG(5, "end of ready ring reached\n"); @@ -713,15 +713,15 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, if (descriptors) { *descriptors = priv->result_set; } - + /* if the result size is too small, remember which descriptors * haven't had results reported yet. we will look - * at these descriptors on the next apr_pollset_poll call - */ + * at these descriptors on the next apr_pollset_poll call + */ APR_RING_CONCAT(&priv->prior_ready_ring, &(priv->ready_ring), asio_elem_t, link); - DBG1(2, "exiting, rv = %d\n", rv); + DBG1(2, "exiting, rv = %d\n", rv); pollset_unlock_rings(); @@ -730,12 +730,12 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, static apr_pollset_provider_t impl = { asio_pollset_create, - asio_pollset_add, - asio_pollset_remove, + asio_pollset_add, + asio_pollset_remove, asio_pollset_poll, asio_pollset_cleanup, "asio" -}; +}; apr_pollset_provider_t *apr_pollset_provider_aio_msgq = &impl; From 17bd589f5655c5b900f66dbf61863cf88b105b40 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 17 Jan 2013 21:54:58 +0000 Subject: [PATCH 7201/7878] rename state to ASIO_REMOVED to match the name of the apr_pollset_remove API that set it git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1434929 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/z_asio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index 4b78623a94a..fa236f95c1e 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -77,7 +77,7 @@ struct apr_pollset_private_t typedef enum { ASIO_INIT = 0, - ASIO_CANCELLED + ASIO_REMOVED } asio_state_e; typedef struct asio_elem_t asio_elem_t; @@ -510,7 +510,7 @@ static apr_status_t asio_pollset_remove(apr_pollset_t *pollset, DBG1(4, "asyncio returned %d\n", rv); if (rv == 1) { - elem->state = ASIO_CANCELLED; + elem->state = ASIO_REMOVED; rv = APR_SUCCESS; } } @@ -567,7 +567,7 @@ static process_msg(apr_pollset_t *pollset, struct asio_msgbuf_t *msg) DBG_BUFF asio_elem_t *elem = msg->msg_elem; - if (elem->state == ASIO_CANCELLED) { + if (elem->state == ASIO_REMOVED) { DBG2(5, "for cancelled elem, recycling memory - elem %08p, fd %d\n", elem, elem->os_pfd.fd); APR_RING_INSERT_TAIL(&(pollset->p->free_ring), elem, @@ -619,7 +619,7 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, * result set last time. re-poll inline for both cases */ - if (elem->state == ASIO_CANCELLED) { + if (elem->state == ASIO_REMOVED) { continue; /* do not re-add if it has been _removed */ } From 59c59717fc19ef39b555d913f29f0e1e79bde93d Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 17 Jan 2013 22:32:56 +0000 Subject: [PATCH 7202/7878] change asyncio to take a struct aiocb input arg git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1434941 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/z_asio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index fa236f95c1e..9343f6b08d1 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -171,7 +171,7 @@ struct asio_elem_t #endif /* DEBUG */ -static int asyncio(asio_elem_t *elem) +static int asyncio(struct aiocb *a) { DBG_BUFF int rv; @@ -182,9 +182,9 @@ static int asyncio(asio_elem_t *elem) #define AIO BPX1AIO #endif - AIO(sizeof(struct aiocb), &(elem->a), &rv, &errno, __err2ad()); - DBG3(4, "BPX4AIO aiocb %p elem %p rv %d\n", - &(elem->a), elem, rv); + AIO(sizeof(struct aiocb), a, &rv, &errno, __err2ad()); + DBG2(4, "BPX4AIO aiocb %p rv %d\n", + a, rv); #ifdef DEBUG if (rv < 0) { DBG2(4, "errno %d errnojr %08x\n", @@ -404,7 +404,7 @@ static apr_status_t asio_pollset_add(apr_pollset_t *pollset, elem->pfd = *descriptor; elem->os_pfd.events = get_event(descriptor->reqevents); - if (0 != asyncio(elem)) { + if (0 != asyncio(&elem->a)) { rv = errno; DBG3(4, "pollset %p asio failed fd %d, errno %p\n", pollset, elem->os_pfd.fd, rv); @@ -506,7 +506,7 @@ static apr_status_t asio_pollset_remove(apr_pollset_t *pollset, /* we want *msgrcv to collect cancel notifications to remove races * in garbage collection */ - rv = asyncio(elem); + rv = asyncio(&elem->a); DBG1(4, "asyncio returned %d\n", rv); if (rv == 1) { @@ -625,7 +625,7 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, elem->a.aio_cflags = AIO_OK2COMPIMD; - if (0 != (ret = asyncio(elem))) { + if (0 != (ret = asyncio(&elem->a))) { if (ret == 1) { DBG(4, "asyncio() completed inline\n"); /* it's ready now */ From e17cf0b3a921975e69242d27937ffa00f9597837 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 17 Jan 2013 23:46:43 +0000 Subject: [PATCH 7203/7878] * create/set new state ASIO_COMPLETE to track when async i/o is complete * in apr_pollset_remove, don't cancel async i/o if it has already completed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1434971 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/z_asio.c | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index 9343f6b08d1..b584e37cff4 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -77,7 +77,8 @@ struct apr_pollset_private_t typedef enum { ASIO_INIT = 0, - ASIO_REMOVED + ASIO_REMOVED, + ASIO_COMPLETE } asio_state_e; typedef struct asio_elem_t asio_elem_t; @@ -499,20 +500,24 @@ static apr_status_t asio_pollset_remove(apr_pollset_t *pollset, DBG1(5, "hash found fd %d\n", fd); /* delete this fd from the hash */ apr_hash_set(priv->elems, &(fd), sizeof(int), NULL); - /* asyncio call to cancel */ - elem->a.aio_cmd = AIO_CANCEL; - /* elem->a.aio_cflags = AIO_CANCELNONOTIFY; */ - /* we want *msgrcv to collect cancel notifications to remove races - * in garbage collection */ + if (elem->state == ASIO_INIT) { + /* asyncio call to cancel */ + elem->a.aio_cmd = AIO_CANCEL; - rv = asyncio(&elem->a); - DBG1(4, "asyncio returned %d\n", rv); + /* we want the original aiocb to show up on the pollset message queue + * to eliminate race conditions + */ - if (rv == 1) { - elem->state = ASIO_REMOVED; - rv = APR_SUCCESS; + rv = asyncio(&elem->a); + DBG1(4, "asyncio returned %d\n", rv); + +#if DEBUG + assert(rv == 1); +#endif } + elem->state = ASIO_REMOVED; + rv = APR_SUCCESS; } DBG1(2, "exiting, rv: %d\n", rv); @@ -567,16 +572,26 @@ static process_msg(apr_pollset_t *pollset, struct asio_msgbuf_t *msg) DBG_BUFF asio_elem_t *elem = msg->msg_elem; - if (elem->state == ASIO_REMOVED) { + switch(elem->state) { + case ASIO_REMOVED: DBG2(5, "for cancelled elem, recycling memory - elem %08p, fd %d\n", elem, elem->os_pfd.fd); APR_RING_INSERT_TAIL(&(pollset->p->free_ring), elem, asio_elem_t, link); - } else { + break; + case ASIO_INIT: DBG2(4, "adding to ready ring: elem %08p, fd %d\n", elem, elem->os_pfd.fd); + elem->state = ASIO_COMPLETE; APR_RING_INSERT_TAIL(&(pollset->p->ready_ring), elem, asio_elem_t, link); + break; + default: + DBG3(1, "unexpected state: elem %08p, fd %d, state %d\n", + elem, elem->os_pfd.fd, elem->state); +#if DEBUG + assert(0); +#endif } } From d54f4066600a2c23d44e925243a73bcb371637d9 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 18 Jan 2013 00:06:20 +0000 Subject: [PATCH 7204/7878] apr_pollset_remove: use a separate aiocb pointing to the original for cancelling async i/o. this fixes a leak in USS for every keepalive timeout combined with CPU growth on the httpd listener thread git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1434976 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/z_asio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index b584e37cff4..15b05060d2a 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -475,6 +475,7 @@ static apr_status_t asio_pollset_remove(apr_pollset_t *pollset, asio_elem_t *elem; apr_status_t rv = APR_SUCCESS; apr_pollset_private_t *priv = pollset->p; + struct aiocb cancel_a; /* AIO_CANCEL is synchronous, so autodata works fine */ int fd; @@ -503,7 +504,8 @@ static apr_status_t asio_pollset_remove(apr_pollset_t *pollset, if (elem->state == ASIO_INIT) { /* asyncio call to cancel */ - elem->a.aio_cmd = AIO_CANCEL; + cancel_a.aio_cmd = AIO_CANCEL; + cancel_a.aio_buf = &elem->a; /* we want the original aiocb to show up on the pollset message queue * to eliminate race conditions From 1bb12960d090508720dc0e474840dd3871c7a6a5 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 19 Jan 2013 17:04:50 +0000 Subject: [PATCH 7205/7878] Revert r789061, r758414, and r758398 which are leftovers of the palloc uses malloc experiment that were forgotten when reverting to the old code in r795598. This fixes the apr_allocator created by apr_bucket_alloc_create() being leaked by apr_bucket_alloc_destroy. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1435605 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_buckets_alloc.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/buckets/apr_buckets_alloc.c b/buckets/apr_buckets_alloc.c index 8cdf703dda0..c73c7db3557 100644 --- a/buckets/apr_buckets_alloc.c +++ b/buckets/apr_buckets_alloc.c @@ -47,22 +47,37 @@ static apr_status_t alloc_cleanup(void *data) apr_allocator_free(list->allocator, list->blocks); - apr_allocator_destroy(list->allocator); +#if APR_POOL_DEBUG + if (list->pool && list->allocator != apr_pool_allocator_get(list->pool)) { + apr_allocator_destroy(list->allocator); + } +#endif return APR_SUCCESS; } APR_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create(apr_pool_t *p) { - apr_allocator_t *allocator; + apr_allocator_t *allocator = apr_pool_allocator_get(p); apr_bucket_alloc_t *list; - if (apr_allocator_create(&allocator) != APR_SUCCESS - || (list = apr_bucket_alloc_create_ex(allocator)) == NULL) { - apr_abortfunc_t fn = apr_pool_abort_get(p); - if (fn) - (fn)(APR_ENOMEM); - abort(); +#if APR_POOL_DEBUG + /* may be NULL for debug mode. */ + if (allocator == NULL) { + if (apr_allocator_create(&allocator) != APR_SUCCESS) { + apr_abortfunc_t fn = apr_pool_abort_get(p); + if (fn) + (fn)(APR_ENOMEM); + abort(); + } + } +#endif + list = apr_bucket_alloc_create_ex(allocator); + if (list == NULL) { + apr_abortfunc_t fn = apr_pool_abort_get(p); + if (fn) + (fn)(APR_ENOMEM); + abort(); } list->pool = p; apr_pool_cleanup_register(list->pool, list, alloc_cleanup, @@ -99,6 +114,11 @@ APR_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list) apr_allocator_free(list->allocator, list->blocks); +#if APR_POOL_DEBUG + if (list->pool && list->allocator != apr_pool_allocator_get(list->pool)) { + apr_allocator_destroy(list->allocator); + } +#endif } APR_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size, From ec9ec07b4839c619b96ded8439783f063f434abf Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Mon, 21 Jan 2013 22:42:32 +0000 Subject: [PATCH 7206/7878] * don't just initialize cancel_a, use it for the asyncio AIO_CANCEL call * reset the state to ASIO_INIT after finding something that wasn't apr_pollset_remove'd on the prior ready ring thanks to Pat O'Donnell / IBM for debugging assistance git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1436667 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/z_asio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index 15b05060d2a..cdce230e546 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -511,7 +511,7 @@ static apr_status_t asio_pollset_remove(apr_pollset_t *pollset, * to eliminate race conditions */ - rv = asyncio(&elem->a); + rv = asyncio(&cancel_a); DBG1(4, "asyncio returned %d\n", rv); #if DEBUG @@ -640,6 +640,7 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, continue; /* do not re-add if it has been _removed */ } + elem->state = ASIO_INIT; elem->a.aio_cflags = AIO_OK2COMPIMD; if (0 != (ret = asyncio(&elem->a))) { From 52df1014afc5bf81784b8e824e1d65f9744eb5cb Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 22 Jan 2013 19:20:45 +0000 Subject: [PATCH 7207/7878] initialize flags fields to avoid JRAsyncAuthErr git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1437109 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/z_asio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index cdce230e546..3f4bec579f6 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -505,7 +505,10 @@ static apr_status_t asio_pollset_remove(apr_pollset_t *pollset, if (elem->state == ASIO_INIT) { /* asyncio call to cancel */ cancel_a.aio_cmd = AIO_CANCEL; - cancel_a.aio_buf = &elem->a; + cancel_a.aio_buf = &elem->a; /* point to original aiocb */ + + cancel_a.aio_cflags = 0; + cancel_a.aio_cflags2 = 0; /* we want the original aiocb to show up on the pollset message queue * to eliminate race conditions From 512a32d6c6793a995b4600eea0ace9e422fa1a5c Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Wed, 23 Jan 2013 18:10:30 +0000 Subject: [PATCH 7208/7878] no functional change, just flesh out the comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1437607 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/z_asio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index 3f4bec579f6..6d58fa1189d 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -511,7 +511,7 @@ static apr_status_t asio_pollset_remove(apr_pollset_t *pollset, cancel_a.aio_cflags2 = 0; /* we want the original aiocb to show up on the pollset message queue - * to eliminate race conditions + * before recycling its memory to eliminate race conditions */ rv = asyncio(&cancel_a); From a0556ab366ffcfe0baa7cb87e0067c817c087da1 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 26 Jan 2013 18:44:29 +0000 Subject: [PATCH 7209/7878] Don't leak memnodes in apr_pvsprintf() if out of memory and no pool abort function is set. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1438940 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index da8b2122565..d6af9b210fa 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1147,21 +1147,12 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) * room to hold the NUL terminator. */ if (ps.node->first_avail == ps.node->endp) { - if (psprintf_flush(&ps.vbuff) == -1) { - if (pool->abort_fn) { - pool->abort_fn(APR_ENOMEM); - } - - return NULL; - } + if (psprintf_flush(&ps.vbuff) == -1) + goto error; } - if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) { - if (pool->abort_fn) - pool->abort_fn(APR_ENOMEM); - - return NULL; - } + if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) + goto error; strp = ps.vbuff.curpos; *strp++ = '\0'; @@ -1207,6 +1198,15 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) list_insert(active, node); return strp; + +error: + if (pool->abort_fn) + pool->abort_fn(APR_ENOMEM); + if (ps.got_a_new_node) { + ps.node->next = ps.free; + allocator_free(pool->allocator, ps.node); + } + return NULL; } From 45a28ec50105271ba9a9b9cc055a3000b267894f Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 26 Jan 2013 20:41:15 +0000 Subject: [PATCH 7210/7878] Add valgrind support Teach valgrind about apr pools, allocators, and bucket allocators if --with-valgrind is passed to configure. This has less impact on program behavior and performance than compiling with complete pool-debugging. Even with valgrind support compiled in, the performance impact if not running under valgrind should be minimal. It may make sense to use pool-debugging together with valgrind support because pool-debugging does not help with allocators and bucket allocators. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1438957 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + buckets/apr_buckets_alloc.c | 15 +++- configure.in | 16 ++++ include/private/apr_support.h | 20 +++++ memory/unix/apr_pools.c | 145 +++++++++++++++++++++++++++++----- 5 files changed, 177 insertions(+), 22 deletions(-) diff --git a/CHANGES b/CHANGES index e8f2c2d071d..17e642023f4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add support code to teach valgrind about APR pools, allocators, and + bucket allocators. [Stefan Fritsch] + *) Fix apr_ipsubnet_test() false positives when comparing IPv4 subnet representation against an IPv6 address. PR 54047. [Joe Orton] diff --git a/buckets/apr_buckets_alloc.c b/buckets/apr_buckets_alloc.c index c73c7db3557..7241a866bcd 100644 --- a/buckets/apr_buckets_alloc.c +++ b/buckets/apr_buckets_alloc.c @@ -18,6 +18,7 @@ #include "apr_buckets.h" #include "apr_allocator.h" +#include "apr_support.h" #define ALLOC_AMT (8192 - APR_MEMNODE_T_SIZE) @@ -102,7 +103,8 @@ APR_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create_ex( list->freelist = NULL; list->blocks = block; block->first_avail += APR_ALIGN_DEFAULT(sizeof(*list)); - + APR_VALGRIND_NOACCESS(block->first_avail, + block->endp - block->first_avail); return list; } @@ -121,18 +123,21 @@ APR_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list) #endif } -APR_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size, +APR_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t in_size, apr_bucket_alloc_t *list) { node_header_t *node; apr_memnode_t *active = list->blocks; char *endp; + apr_size_t size; - size += SIZEOF_NODE_HEADER_T; + size = in_size + SIZEOF_NODE_HEADER_T; if (size <= SMALL_NODE_SIZE) { if (list->freelist) { node = list->freelist; list->freelist = node->next; + APR_VALGRIND_UNDEFINED((char *)node + SIZEOF_NODE_HEADER_T, + SMALL_NODE_SIZE - SIZEOF_NODE_HEADER_T); } else { endp = active->first_avail + SMALL_NODE_SIZE; @@ -144,8 +149,11 @@ APR_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size, list->blocks->next = active; active = list->blocks; endp = active->first_avail + SMALL_NODE_SIZE; + APR_VALGRIND_NOACCESS(active->first_avail, + active->endp - active->first_avail); } node = (node_header_t *)active->first_avail; + APR_VALGRIND_UNDEFINED(node, SMALL_NODE_SIZE); node->alloc = list; node->memnode = active; node->size = SMALL_NODE_SIZE; @@ -194,6 +202,7 @@ APR_DECLARE_NONSTD(void) apr_bucket_free(void *mem) check_not_already_free(node); node->next = list->freelist; list->freelist = node; + APR_VALGRIND_NOACCESS(mem, SMALL_NODE_SIZE - SIZEOF_NODE_HEADER_T); } else { apr_allocator_free(list->allocator, node->memnode); diff --git a/configure.in b/configure.in index 84ba990c184..91461684610 100644 --- a/configure.in +++ b/configure.in @@ -839,6 +839,22 @@ AC_ARG_WITH(efence, [ AC_MSG_ERROR(Electric Fence requested but not detected) ]) ]) +AC_ARG_WITH(valgrind, + [ --with-valgrind[[=DIR]] Enable code to teach valgrind about apr pools + (optionally: set path to valgrind headers) ], + [ if test "$withval" != no; then + if test "$withval" = yes; then + withval=/usr/include/valgrind + fi + APR_ADDTO(CPPFLAGS, -I$withval) + AC_CHECK_HEADERS(valgrind.h memcheck.h) + APR_IFALLYES(header:valgrind.h header:memcheck.h, + [AC_DEFINE(HAVE_VALGRIND, 1, [Compile in valgrind support]) ], + [AC_MSG_ERROR(valgrind headers not found) ] + ) + fi ] +) + AC_CHECK_FUNCS(sigsuspend, [ have_sigsuspend="1" ], [ have_sigsuspend="0" ]) AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ]) dnl AC_CHECK_FUNCS doesn't work for this on Tru64 since the function diff --git a/include/private/apr_support.h b/include/private/apr_support.h index 79c8cb479e8..90491ec7604 100644 --- a/include/private/apr_support.h +++ b/include/private/apr_support.h @@ -25,6 +25,26 @@ #include "apr.h" #include "apr_network_io.h" #include "apr_file_io.h" +#include "apr_private.h" + +#if HAVE_VALGRIND +#include +#include + +extern int apr_running_on_valgrind; + +#define APR_IF_VALGRIND(x) \ + do { if (apr_running_on_valgrind) { x; } } while (0) + +#else +#define APR_IF_VALGRIND(x) +#endif /* HAVE_VALGRIND */ + +#define APR_VALGRIND_NOACCESS(addr_, size_) \ + APR_IF_VALGRIND(VALGRIND_MAKE_MEM_NOACCESS(addr_, size_)) +#define APR_VALGRIND_UNDEFINED(addr_, size_) \ + APR_IF_VALGRIND(VALGRIND_MAKE_MEM_UNDEFINED(addr_, size_)) + #ifdef __cplusplus extern "C" { diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index d6af9b210fa..9bbfd32aca1 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -27,6 +27,7 @@ #include "apr_thread_mutex.h" #include "apr_hash.h" #include "apr_time.h" +#include "apr_support.h" #define APR_WANT_MEMFUNC #include "apr_want.h" #include "apr_env.h" @@ -43,6 +44,11 @@ #include #endif +#if HAVE_VALGRIND +#define REDZONE APR_ALIGN_DEFAULT(8) +int apr_running_on_valgrind = 0; +#endif + /* * Magic numbers */ @@ -287,10 +293,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) apr_thread_mutex_unlock(allocator->mutex); #endif /* APR_HAS_THREADS */ - node->next = NULL; - node->first_avail = (char *)node + APR_MEMNODE_T_SIZE; - - return node; + goto have_node; } #if APR_HAS_THREADS @@ -327,10 +330,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) apr_thread_mutex_unlock(allocator->mutex); #endif /* APR_HAS_THREADS */ - node->next = NULL; - node->first_avail = (char *)node + APR_MEMNODE_T_SIZE; - - return node; + goto have_node; } #if APR_HAS_THREADS @@ -350,11 +350,15 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) #endif return NULL; - node->next = NULL; node->index = index; - node->first_avail = (char *)node + APR_MEMNODE_T_SIZE; node->endp = (char *)node + size; +have_node: + node->next = NULL; + node->first_avail = (char *)node + APR_MEMNODE_T_SIZE; + + APR_VALGRIND_UNDEFINED(node->first_avail, size - APR_MEMNODE_T_SIZE); + return node; } @@ -381,6 +385,9 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) next = node->next; index = node->index; + APR_VALGRIND_NOACCESS((char *)node + APR_MEMNODE_T_SIZE, + (node->index+1) << BOUNDARY_INDEX); + if (max_free_index != APR_ALLOCATOR_MAX_FREE_UNLIMITED && index + 1 > current_free_index) { node->next = freelist; @@ -576,6 +583,10 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) if (apr_pools_initialized++) return APR_SUCCESS; +#if HAVE_VALGRIND + apr_running_on_valgrind = RUNNING_ON_VALGRIND; +#endif + #if APR_ALLOCATOR_USES_MMAP && defined(_SC_PAGESIZE) boundary_size = sysconf(_SC_PAGESIZE); boundary_index = 12; @@ -672,6 +683,10 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t in_size) apr_size_t size, free_index; size = APR_ALIGN_DEFAULT(in_size); +#if HAVE_VALGRIND + if (apr_running_on_valgrind) + size += 2 * REDZONE; +#endif if (size < in_size) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); @@ -684,8 +699,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t in_size) if (size <= node_free_space(active)) { mem = active->first_avail; active->first_avail += size; - - return mem; + goto have_mem; } node = active->next; @@ -716,7 +730,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t in_size) active->free_index = free_index; node = active->next; if (free_index >= node->free_index) - return mem; + goto have_mem; do { node = node->next; @@ -726,7 +740,19 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t in_size) list_remove(active); list_insert(active, node); +have_mem: +#if HAVE_VALGRIND + if (!apr_running_on_valgrind) { + return mem; + } + else { + mem = (char *)mem + REDZONE; + VALGRIND_MEMPOOL_ALLOC(pool, mem, in_size); + return mem; + } +#else return mem; +#endif } /* Provide an implementation of apr_pcalloc for backward compatibility @@ -786,6 +812,8 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) active = pool->active = pool->self; active->first_avail = pool->self_first_avail; + APR_IF_VALGRIND(VALGRIND_MEMPOOL_TRIM(pool, pool, 1)); + if (active->next == active) return; @@ -863,6 +891,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) if (apr_allocator_owner_get(allocator) == pool) { apr_allocator_destroy(allocator); } + APR_IF_VALGRIND(VALGRIND_DESTROY_MEMPOOL(pool)); } APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, @@ -899,8 +928,23 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, node->next = node; node->ref = &node->next; +#if HAVE_VALGRIND + if (!apr_running_on_valgrind) { + pool = (apr_pool_t *)node->first_avail; + pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; + } + else { + pool = (apr_pool_t *)(node->first_avail + REDZONE); + pool->self_first_avail = (char *)pool + SIZEOF_POOL_T + 2 * REDZONE; + VALGRIND_MAKE_MEM_NOACCESS(pool->self_first_avail, + node->endp - pool->self_first_avail); + VALGRIND_CREATE_MEMPOOL(pool, REDZONE, 0); + } +#else pool = (apr_pool_t *)node->first_avail; - node->first_avail = pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; + pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; +#endif + node->first_avail = pool->self_first_avail; pool->allocator = allocator; pool->active = pool->self = node; @@ -1117,7 +1161,11 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) ps->got_a_new_node = 1; } + APR_VALGRIND_UNDEFINED(node->first_avail, + node->endp - node->first_avail); memcpy(node->first_avail, active->first_avail, cur_len); + APR_VALGRIND_NOACCESS(active->first_avail, + active->endp - active->first_avail); ps->node = node; ps->vbuff.curpos = node->first_avail + cur_len; @@ -1126,6 +1174,35 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) return 0; } +#if HAVE_VALGRIND +static int add_redzone(int (*flush_func)(apr_vformatter_buff_t *b), + struct psprintf_data *ps) +{ + apr_size_t len = ps->vbuff.curpos - ps->node->first_avail + REDZONE; + + while (ps->vbuff.curpos - ps->node->first_avail < len) { + if (ps->vbuff.endpos - ps->node->first_avail >= len) + ps->vbuff.curpos = ps->node->first_avail + len; + else + ps->vbuff.curpos = ps->vbuff.endpos; + + /* + * Prevent valgrind from complaining when psprintf_flush() + * does a memcpy(). The VALGRIND_MEMPOOL_ALLOC() will reset + * the redzone to NOACCESS. + */ + if (ps->vbuff.curpos != ps->node->first_avail) + VALGRIND_MAKE_MEM_DEFINED(ps->node->first_avail, + ps->vbuff.curpos - ps->node->first_avail); + if (ps->vbuff.curpos == ps->vbuff.endpos) { + if (psprintf_flush(&ps->vbuff) == -1) + return -1; + } + } + return 0; +} +#endif + APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) { struct psprintf_data ps; @@ -1148,18 +1225,46 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) */ if (ps.node->first_avail == ps.node->endp) { if (psprintf_flush(&ps.vbuff) == -1) - goto error; + goto error; + } +#if HAVE_VALGRIND + if (apr_running_on_valgrind) { + if (add_redzone(psprintf_flush, &ps) == -1) + goto error; + if (!ps.got_a_new_node) { + /* psprintf_flush() has not been called, allow access to our node */ + VALGRIND_MAKE_MEM_UNDEFINED(ps.vbuff.curpos, + ps.node->endp - ps.vbuff.curpos); + } } +#endif /* HAVE_VALGRIND */ if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) goto error; - strp = ps.vbuff.curpos; - *strp++ = '\0'; + *ps.vbuff.curpos++ = '\0'; - size = strp - ps.node->first_avail; - size = APR_ALIGN_DEFAULT(size); +#if HAVE_VALGRIND + if (!apr_running_on_valgrind) { + strp = ps.node->first_avail; + } + else { + if (add_redzone(psprintf_flush, &ps) == -1) + goto error; + if (ps.node->endp != ps.vbuff.curpos) + APR_VALGRIND_NOACCESS(ps.vbuff.curpos, + ps.node->endp - ps.vbuff.curpos); + strp = ps.node->first_avail + REDZONE; + size = ps.vbuff.curpos - strp; + VALGRIND_MEMPOOL_ALLOC(pool, strp, size); + VALGRIND_MAKE_MEM_DEFINED(strp, size); + } +#else strp = ps.node->first_avail; +#endif + + size = ps.vbuff.curpos - ps.node->first_avail; + size = APR_ALIGN_DEFAULT(size); ps.node->first_avail += size; if (ps.free) @@ -1206,6 +1311,8 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) ps.node->next = ps.free; allocator_free(pool->allocator, ps.node); } + APR_VALGRIND_NOACCESS(pool->active->first_avail, + pool->active->endp - pool->active->first_avail); return NULL; } From b7cf0a57c925ef95a7c93bd983d524d5d0b16e64 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 26 Jan 2013 20:41:53 +0000 Subject: [PATCH 7211/7878] Only fill in apr_sockaddr_vars_set if we have valid data git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1438958 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index d50f4f0f627..fc1c20b7d50 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -174,7 +174,14 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, return errno; } - apr_sockaddr_vars_set(from, from->sa.sin.sin_family, ntohs(from->sa.sin.sin_port)); + /* + * Check if we have a valid address. recvfrom() with MSG_PEEK may return + * success without filling in the address. + */ + if (from->salen > APR_OFFSETOF(struct sockaddr_in, sin_port)) { + apr_sockaddr_vars_set(from, from->sa.sin.sin_family, + ntohs(from->sa.sin.sin_port)); + } (*len) = rv; if (rv == 0 && sock->type == SOCK_STREAM) { From bc1b8184b96d2e25ec143572c9f6c52ff505f3ff Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 26 Jan 2013 20:42:41 +0000 Subject: [PATCH 7212/7878] Minor fixes to quiet valgrind warnings git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1438959 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 2 +- test/testpipe.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 8013ead9331..965e2833c1e 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -366,7 +366,7 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor) { - struct epoll_event ev; + struct epoll_event ev = { 0 }; int ret; ev.events = get_epoll_event(descriptor->reqevents); diff --git a/test/testpipe.c b/test/testpipe.c index 26d9a89762d..d15eacf0a18 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -129,7 +129,7 @@ static void test_pipe_writefull(abts_case *tc, void *data) int iterations = 1000; int i; int bytes_per_iteration = 8000; - char *buf = (char *)malloc(bytes_per_iteration); + char *buf = (char *)calloc(bytes_per_iteration, 1); char responsebuf[128]; apr_size_t nbytes; int bytes_processed; From 98b38dca1b8cdd52e645082b7b269df6b92f57f7 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 26 Jan 2013 20:43:02 +0000 Subject: [PATCH 7213/7878] Don't corrupt the bucket allocator in out-of-mem situation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1438960 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_buckets_alloc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/buckets/apr_buckets_alloc.c b/buckets/apr_buckets_alloc.c index 7241a866bcd..3bfd5b07cc6 100644 --- a/buckets/apr_buckets_alloc.c +++ b/buckets/apr_buckets_alloc.c @@ -144,6 +144,7 @@ APR_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t in_size, if (endp >= active->endp) { list->blocks = apr_allocator_alloc(list->allocator, ALLOC_AMT); if (!list->blocks) { + list->blocks = active; return NULL; } list->blocks->next = active; From c072356bbd5077b5dcc8e43c966c68e8e1822eb3 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Sat, 2 Feb 2013 12:50:58 +0000 Subject: [PATCH 7214/7878] fix memory leak git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1441742 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/z_asio.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index 6d58fa1189d..ce158d3169c 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -63,7 +63,7 @@ struct apr_pollset_private_t apr_thread_mutex_t *ring_lock; #endif - /* A hash of all active elements used for O(1) garbage collection */ + /* A hash of all active elements used for O(1) _remove operations */ apr_hash_t *elems; APR_RING_HEAD(ready_ring_t, asio_elem_t) ready_ring; @@ -640,6 +640,15 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, */ if (elem->state == ASIO_REMOVED) { + + /* + * async i/o is done since it was found on prior_ready + * the state says the caller is done with it too + * so recycle the elem + */ + + APR_RING_INSERT_TAIL(&(priv->free_ring), elem, + asio_elem_t, link); continue; /* do not re-add if it has been _removed */ } From 54ead32d1f0ed1d809884f987b0c5ec5cb5c6ce9 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Wed, 6 Feb 2013 10:57:32 +0000 Subject: [PATCH 7215/7878] Update config.guess and config.sub from http://git.savannah.gnu.org/cgit/config.git. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1442903 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 33 ++++++++++----------- build/config.sub | 71 +++++++++++++++++++++++----------------------- 2 files changed, 50 insertions(+), 54 deletions(-) diff --git a/build/config.guess b/build/config.guess index ad5f74ab8c3..6ea345452a5 100755 --- a/build/config.guess +++ b/build/config.guess @@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2012-07-31' +timestamp='2013-02-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -22,19 +20,17 @@ timestamp='2012-07-31' # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + me=`echo "$0" | sed -e 's,.*/,,'` @@ -54,9 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -306,7 +300,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -1208,6 +1202,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; diff --git a/build/config.sub b/build/config.sub index b15df575116..80211d0d8b2 100755 --- a/build/config.sub +++ b/build/config.sub @@ -1,24 +1,18 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2012-07-31' +timestamp='2013-02-04' -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . @@ -26,11 +20,12 @@ timestamp='2012-07-31' # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -73,9 +68,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -123,7 +116,7 @@ esac maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) @@ -156,7 +149,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) + -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; @@ -259,8 +252,10 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ + | arc \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ @@ -273,7 +268,7 @@ case $basic_machine in | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -291,13 +286,14 @@ case $basic_machine in | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nios | nios2 \ + | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ | or32 \ @@ -389,7 +385,8 @@ case $basic_machine in | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -407,12 +404,13 @@ case $basic_machine in | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ @@ -788,7 +786,7 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze*) basic_machine=microblaze-xilinx ;; mingw64) @@ -1023,7 +1021,11 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; - rdos) + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) basic_machine=i386-pc os=-rdos ;; @@ -1350,7 +1352,7 @@ case $os in -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ + | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ @@ -1364,7 +1366,7 @@ case $os in | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1496,9 +1498,6 @@ case $os in -aros*) os=-aros ;; - -kaos*) - os=-kaos - ;; -zvmoe) os=-zvmoe ;; From 2bda006961bec252389f76ff176fc732373e2b4e Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sat, 23 Feb 2013 12:20:59 +0000 Subject: [PATCH 7216/7878] Fix password validation failure for all crypt and crypt_r based algorithms. PR: 54603 Submitted by: Harvey Eneman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1449308 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_passwd.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/crypto/apr_passwd.c b/crypto/apr_passwd.c index 5fcb439ede1..50d38b4e480 100644 --- a/crypto/apr_passwd.c +++ b/crypto/apr_passwd.c @@ -103,19 +103,18 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, #if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) char *crypt_pw; #endif - if (hash[0] == '$') { - if (hash[1] == '2' && (hash[2] == 'a' || hash[2] == 'y') - && hash[3] == '$') - { - if (_crypt_blowfish_rn(passwd, hash, sample, sizeof(sample)) == NULL) - return APR_FROM_OS_ERROR(errno); - } - else if (!strncmp(hash, apr1_id, strlen(apr1_id))) { - /* - * The hash was created using our custom algorithm. - */ - apr_md5_encode(passwd, hash, sample, sizeof(sample)); - } + if (hash[0] == '$' + && hash[1] == '2' + && (hash[2] == 'a' || hash[2] == 'y') + && hash[3] == '$') { + if (_crypt_blowfish_rn(passwd, hash, sample, sizeof(sample)) == NULL) + return APR_FROM_OS_ERROR(errno); + } + else if (!strncmp(hash, apr1_id, strlen(apr1_id))) { + /* + * The hash was created using our custom algorithm. + */ + apr_md5_encode(passwd, hash, sample, sizeof(sample)); } else if (!strncmp(hash, APR_SHA1PW_ID, APR_SHA1PW_IDLEN)) { apr_sha1_base64(passwd, (int)strlen(passwd), sample); From 6673d95e26f22697e3f4babcbebc7f5175a10a7d Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 23 Feb 2013 13:22:10 +0000 Subject: [PATCH 7217/7878] Add testcases for extended crypt algorithms PR: 54603 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1449314 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpass.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/testpass.c b/test/testpass.c index 4ed40bc9625..34508571fe7 100644 --- a/test/testpass.c +++ b/test/testpass.c @@ -34,6 +34,12 @@ #define CRYPT_ALGO_SUPPORTED 1 #endif +#if defined __GLIBC_PREREQ +#if __GLIBC_PREREQ(2,7) +#define GLIBCSHA_ALGO_SUPPORTED +#endif +#endif + #if CRYPT_ALGO_SUPPORTED static struct { @@ -142,6 +148,33 @@ static void test_md5pass(abts_case *tc, void *data) apr_password_validate(pass2, hash)); } +#ifdef GLIBCSHA_ALGO_SUPPORTED + +static struct { + const char *password; + const char *hash; +} glibc_sha_pws[] = { + /* SHA256 */ + { "secret1", "$5$0123456789abcdef$SFX.CooXBS8oXsbAPgU/UyiCodhrLQ19sBgvcA3Zh1D" }, + { "secret2", "$5$rounds=100000$0123456789abcdef$dLXfO5m4d.xv8G66kpz2LyL0.Mi5wjLlH0m7rtgyhyB" }, + /* SHA512 */ + { "secret3", "$6$0123456789abcdef$idOsOfoWwnCQkJm9hd2hxS4NnEs9nBA9poOFXsvtrYSoSHaOToCfyUoZwKe.ZCZnq7D95tGVoi2jxZZMyVwTL1" }, + { "secret4", "$6$rounds=100000$0123456789abcdef$ZiAMjbeA.iIGTWxq2oks9Bvz9sfxaoGPgAtpwimPEwFwkSNMTK7lLwABzzldds/n4UgCQ16HqawPrCrePr4YX1" }, + { NULL, NULL } +}; + +static void test_glibc_shapass(abts_case *tc, void *data) +{ + int i = 0; + while (glibc_sha_pws[i].password) { + APR_ASSERT_SUCCESS(tc, "check for valid glibc crypt-sha password", + apr_password_validate(glibc_sha_pws[i].password, + glibc_sha_pws[i].hash)); + i++; + } +} +#endif + static void test_bcryptpass(abts_case *tc, void *data) { const char *pass = "hellojed"; @@ -177,6 +210,9 @@ abts_suite *testpass(abts_suite *suite) abts_run_test(suite, test_shapass, NULL); abts_run_test(suite, test_md5pass, NULL); abts_run_test(suite, test_bcryptpass, NULL); +#ifdef GLIBCSHA_ALGO_SUPPORTED + abts_run_test(suite, test_glibc_shapass, NULL); +#endif return suite; } From 580e9ecb8ce8f5bf1551cba9fed6fb8a78055580 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Mon, 25 Feb 2013 00:10:28 +0000 Subject: [PATCH 7218/7878] Fix detection of O_NONBLOCK inheritance. The original test failed occasionally on a busy FreeBSD server when accept() returned EAGAIN. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1449568 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index e41abcc0dc3..0cea93b00a3 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -555,13 +555,24 @@ dnl AC_DEFUN([APR_CHECK_O_NONBLOCK_INHERITED], [ AC_CACHE_CHECK(if O_NONBLOCK setting is inherited from listening sockets, ac_cv_o_nonblock_inherited,[ AC_TRY_RUN( [ +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_STDIO_H #include +#endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif +#ifdef HAVE_SYS_SELECT_H +#include +#endif #ifdef HAVE_NETINET_IN_H #include #endif @@ -632,6 +643,26 @@ int main(void) { exit(1); } sa_len = sizeof sa; + /* 1 second select timeout */ + tv.tv_sec = 1; + tv.tv_usec = 0; + /* Set up fd set */ + FD_ZERO(&fds); + FD_SET(listen_s, &fds); + /* Wait for socket to become readable */ + rc = select(listen_s + 1, &fds, NULL, NULL, &tv); + if (rc < 0) { + perror("select"); + exit(1); + } + if (rc == 0) { + fprintf(stderr, "Socket failed to become readable (timeout)\n"); + exit(1); + } + if (!FD_ISSET(listen_s, &fds)) { + fprintf(stderr, "Socket failed to become readable (selected another fd)\n"); + exit(1); + } connected_s = accept(listen_s, (struct sockaddr *)&sa, &sa_len); if (connected_s < 0) { perror("accept"); From c0cc033c810c51ce1671b56d44ef535a1a4976d8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 14 Mar 2013 13:22:07 +0000 Subject: [PATCH 7219/7878] remove ignored rv git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1456418 13f79535-47bb-0310-9956-ffa450edef68 --- test/echod.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/echod.c b/test/echod.c index 91a91358a8f..052e47d8796 100644 --- a/test/echod.c +++ b/test/echod.c @@ -113,7 +113,6 @@ static apr_status_t glassToWall(apr_port_t port, apr_pool_t *parent) int main(int argc, char **argv) { apr_pool_t *pool; - apr_status_t rv; apr_port_t theport = 4747; printf("APR Test Application: echod\n"); @@ -129,7 +128,7 @@ int main(int argc, char **argv) } fprintf(stdout, "Starting to listen on port %d\n", theport); - rv = glassToWall(theport, pool); + glassToWall(theport, pool); return 0; } From 344152dca783ec0b1afd8136a8bac85af669e4d0 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 22 Mar 2013 21:19:18 +0000 Subject: [PATCH 7220/7878] fix warning: comparison of distinct pointer types lacks a cast git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1459994 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 7479ef47c7a..c80ad30b5ca 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -736,12 +736,14 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, { apr_pool_t *pool; pool = apr_pool_find(key); - if ((pool != key) && (!apr_pool_is_ancestor(pool, t->a.pool))) { + if ((pool != (apr_pool_t *)key) + && (!apr_pool_is_ancestor(pool, t->a.pool))) { fprintf(stderr, "apr_table_mergen: key not in ancestor pool of t\n"); abort(); } pool = apr_pool_find(val); - if ((pool != val) && (!apr_pool_is_ancestor(pool, t->a.pool))) { + if ((pool != (apr_pool_t *)val) + && (!apr_pool_is_ancestor(pool, t->a.pool))) { fprintf(stderr, "apr_table_mergen: val not in ancestor pool of t\n"); abort(); } From e1e5603f042c83763e78e94d04bf07e62d0fc3d0 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 23 Mar 2013 16:03:18 +0000 Subject: [PATCH 7221/7878] fix warning: parameter 'flags' set but not used (Linux sendfile has no flags, anyway) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460179 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index fc1c20b7d50..233bbb301b9 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -297,9 +297,6 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, hdtr = &no_hdtr; } - /* Ignore flags for now. */ - flags = 0; - if (hdtr->numheaders > 0) { apr_size_t hdrbytes; From 4b731e6e7713540383365041c70c95cfc6a2d5f9 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 23 Mar 2013 16:04:32 +0000 Subject: [PATCH 7222/7878] change pool debugging messages to be unique git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460180 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 9bbfd32aca1..5fe0701c717 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1455,7 +1455,7 @@ static void apr_pool_check_integrity(apr_pool_t *pool) if (!apr_pool_is_child_of(pool, global_pool)) { #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) apr_pool_log_event(pool, "LIFE", - __FILE__ ":apr_pool_integrity check", 0); + __FILE__ ":apr_pool_integrity check [lifetime]", 0); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ abort(); } @@ -1466,7 +1466,7 @@ static void apr_pool_check_integrity(apr_pool_t *pool) if (!apr_os_thread_equal(pool->owner, apr_os_thread_current())) { #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) apr_pool_log_event(pool, "THREAD", - __FILE__ ":apr_pool_integrity check", 0); + __FILE__ ":apr_pool_integrity check [owner]", 0); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ abort(); } @@ -1964,7 +1964,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpoo *newpool = pool; #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) - apr_pool_log_event(pool, "CREATE", file_line, 1); + apr_pool_log_event(pool, "CREATEU", file_line, 1); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ return APR_SUCCESS; From 85bae45db264c91c15adb9a5a5facbfbca05f2b1 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 23 Mar 2013 16:12:00 +0000 Subject: [PATCH 7223/7878] Add apr_pool_owner_set function to allow use of pool debugging with threads Actually this function has been mentioned in the docs for over 10 years but has never been implemented. Also consistently destroy the thread's pool when it exits normally, not only on apr_thread_exit(). This was already done on OS2. Other platforms than unix are untested. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460182 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 16 ++++++++++++++++ memory/unix/apr_pools.c | 6 ++++++ threadproc/beos/thread.c | 7 ++++++- threadproc/netware/thread.c | 7 ++++++- threadproc/os2/thread.c | 1 + threadproc/unix/thread.c | 7 ++++++- threadproc/win32/thread.c | 7 ++++++- 7 files changed, 47 insertions(+), 4 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 755320e5c8e..6f50ade8fc2 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -740,6 +740,17 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) __attribute__((nonnull(2))); +/** + * Guarantee that a pool is only used by the current thread. + * This should be used when a pool is created by a different thread than + * the thread it is using, or if there is some locking in use to ensure + * that only one thread uses the pool at the same time. + * + * @param pool The pool + * @param flags Flags, currently unused + */ +APR_DECLARE(void) apr_pool_owner_set(apr_pool_t *pool, apr_uint32_t flags); + /** * Find a pool from something allocated in it. * @param mem The thing allocated in the pool @@ -772,6 +783,11 @@ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); #endif #define apr_pool_join(a,b) +#ifdef apr_pool_owner_set +#undef apr_pool_owner_set +#endif +#define apr_pool_owner_set(a,b) + #ifdef apr_pool_lock #undef apr_pool_lock #endif diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 5fe0701c717..b39e0cf87dd 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1474,6 +1474,12 @@ static void apr_pool_check_integrity(apr_pool_t *pool) #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER) */ } +APR_DECLARE(void) apr_pool_owner_set(apr_pool_t *pool, apr_uint32_t flags) +{ +#if APR_HAS_THREADS && (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER) + pool->owner = apr_os_thread_current(); +#endif +} /* * Initialization (debug) diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 8d838394288..01bc7a9732a 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -65,7 +65,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, static void *dummy_worker(void *opaque) { apr_thread_t *thd = (apr_thread_t*)opaque; - return thd->func(thd, thd->data); + void *ret; + + apr_pool_owner_set(thd->pool, 0); + ret = thd->func(thd, thd->data); + apr_pool_destroy(thd->pool); + return ret; } APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 82b846aaff0..5e3d99d556e 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -67,7 +67,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, static void *dummy_worker(void *opaque) { apr_thread_t *thd = (apr_thread_t *)opaque; - return thd->func(thd, thd->data); + void *ret; + + apr_pool_owner_set(thd->pool, 0); + ret = thd->func(thd, thd->data); + apr_pool_destroy(thd->pool); + return ret; } apr_status_t apr_thread_create(apr_thread_t **new, diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index e2cf3f6a80d..9911034ae7c 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -69,6 +69,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, static void apr_thread_begin(void *arg) { apr_thread_t *thread = (apr_thread_t *)arg; + apr_pool_owner_set(thread->pool, 0); thread->exitval = thread->func(thread, thread->data); apr_pool_destroy(thread->pool); } diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 5639ac70687..6fc949f83a0 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -139,7 +139,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, static void *dummy_worker(void *opaque) { apr_thread_t *thread = (apr_thread_t*)opaque; - return thread->func(thread, thread->data); + void *ret; + + apr_pool_owner_set(thread->pool, 0); + ret = thread->func(thread, thread->data); + apr_pool_destroy(thread->pool); + return ret; } APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 9b9473ad584..c713e1444f3 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -75,8 +75,13 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, static void *dummy_worker(void *opaque) { apr_thread_t *thd = (apr_thread_t *)opaque; + void *ret; + TlsSetValue(tls_apr_thread, thd->td); - return thd->func(thd, thd->data); + apr_pool_owner_set(thd->pool, 0); + ret = thd->func(thd, thd->data); + apr_pool_destroy(thd->pool); + return ret; } APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, From 0d5bf4171eea15fe6bb82f07b3f4875db3a44973 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 23 Mar 2013 16:12:52 +0000 Subject: [PATCH 7224/7878] thread_pool/reslist: take ownership of the pool when we lock the mutex (except in cases where there is no chance that the pool is used) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460183 13f79535-47bb-0310-9956-ffa450edef68 --- util-misc/apr_reslist.c | 6 ++++++ util-misc/apr_thread_pool.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c index f4448493577..ecc17a7d4d6 100644 --- a/util-misc/apr_reslist.c +++ b/util-misc/apr_reslist.c @@ -143,6 +143,7 @@ static apr_status_t reslist_cleanup(void *data_) #if APR_HAS_THREADS apr_thread_mutex_lock(rl->listlock); + apr_pool_owner_set(rl->pool, 0); #endif while (rl->nidle > 0) { @@ -182,6 +183,7 @@ APR_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist) #if APR_HAS_THREADS apr_thread_mutex_lock(reslist->listlock); + apr_pool_owner_set(reslist->pool, 0); #endif /* Check if we need to create more resources, and if we are allowed to. */ @@ -332,6 +334,7 @@ APR_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, #if APR_HAS_THREADS apr_thread_mutex_lock(reslist->listlock); + apr_pool_owner_set(reslist->pool, 0); #endif /* If there are idle resources on the available list, use * them right away. */ @@ -412,6 +415,7 @@ APR_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, #if APR_HAS_THREADS apr_thread_mutex_lock(reslist->listlock); + apr_pool_owner_set(reslist->pool, 0); #endif res = get_container(reslist); res->opaque = resource; @@ -436,6 +440,7 @@ APR_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist) #if APR_HAS_THREADS apr_thread_mutex_lock(reslist->listlock); + apr_pool_owner_set(reslist->pool, 0); #endif count = reslist->ntotal - reslist->nidle; #if APR_HAS_THREADS @@ -451,6 +456,7 @@ APR_DECLARE(apr_status_t) apr_reslist_invalidate(apr_reslist_t *reslist, apr_status_t ret; #if APR_HAS_THREADS apr_thread_mutex_lock(reslist->listlock); + apr_pool_owner_set(reslist->pool, 0); #endif ret = reslist->destructor(resource, reslist->params, reslist->pool); reslist->ntotal--; diff --git a/util-misc/apr_thread_pool.c b/util-misc/apr_thread_pool.c index e8a245b26dc..4c19482fb39 100644 --- a/util-misc/apr_thread_pool.c +++ b/util-misc/apr_thread_pool.c @@ -243,6 +243,7 @@ static void *APR_THREAD_FUNC thread_pool_func(apr_thread_t * t, void *param) struct apr_thread_list_elt *elt; apr_thread_mutex_lock(me->lock); + apr_pool_owner_set(me->pool, 0); elt = elt_new(me, t); if (!elt) { apr_thread_mutex_unlock(me->lock); @@ -265,6 +266,7 @@ static void *APR_THREAD_FUNC thread_pool_func(apr_thread_t * t, void *param) apr_thread_data_set(task, "apr_thread_pool_task", NULL, t); task->func(t, task->param); apr_thread_mutex_lock(me->lock); + apr_pool_owner_set(me->pool, 0); APR_RING_INSERT_TAIL(me->recycled_tasks, task, apr_thread_pool_task, link); elt->current_owner = NULL; @@ -335,6 +337,7 @@ static apr_status_t thread_pool_cleanup(void *me) while (_myself->thd_cnt) { apr_sleep(20 * 1000); /* spin lock with 20 ms */ } + apr_pool_owner_set(_myself->pool, 0); apr_thread_mutex_destroy(_myself->lock); apr_thread_cond_destroy(_myself->cond); return APR_SUCCESS; @@ -372,6 +375,7 @@ APR_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t ** me, * initial threads to create. */ apr_thread_mutex_lock(tp->lock); + apr_pool_owner_set(tp->pool, 0); rv = apr_thread_create(&t, NULL, thread_pool_func, tp, tp->pool); apr_thread_mutex_unlock(tp->lock); if (APR_SUCCESS != rv) { @@ -485,6 +489,7 @@ static apr_status_t schedule_task(apr_thread_pool_t *me, apr_thread_t *thd; apr_status_t rv = APR_SUCCESS; apr_thread_mutex_lock(me->lock); + apr_pool_owner_set(me->pool, 0); t = task_new(me, func, param, 0, owner, time); if (NULL == t) { @@ -535,6 +540,7 @@ static apr_status_t add_task(apr_thread_pool_t *me, apr_thread_start_t func, apr_status_t rv = APR_SUCCESS; apr_thread_mutex_lock(me->lock); + apr_pool_owner_set(me->pool, 0); t = task_new(me, func, param, priority, owner, 0); if (NULL == t) { @@ -696,6 +702,7 @@ APR_DECLARE(apr_status_t) apr_thread_pool_tasks_cancel(apr_thread_pool_t *me, apr_status_t rv = APR_SUCCESS; apr_thread_mutex_lock(me->lock); + apr_pool_owner_set(me->pool, 0); if (me->task_cnt > 0) { rv = remove_tasks(me, owner); } @@ -783,6 +790,7 @@ static struct apr_thread_list_elt *trim_threads(apr_thread_pool_t *me, struct apr_thread_list_elt *head, *tail, *elt; apr_thread_mutex_lock(me->lock); + apr_pool_owner_set(me->pool, 0); if (idle) { thds = me->idle_thds; n = me->idle_cnt; From 57e7578a774a9b8817a24f7418d945c6b1003a4f Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 23 Mar 2013 16:18:08 +0000 Subject: [PATCH 7225/7878] Split apr_pool_check_integrity() into two parts Run the pool owner check part only after pre-cleanups have been run, in order to give them a chance to kill of any threads that may still be accessing the pool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460184 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index b39e0cf87dd..846a9adf15d 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1436,7 +1436,7 @@ static int apr_pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent) } #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) */ -static void apr_pool_check_integrity(apr_pool_t *pool) +static void apr_pool_check_lifetime(apr_pool_t *pool) { /* Rule of thumb: use of the global pool is always * ok, since the only user is apr_pools.c. Unless @@ -1460,7 +1460,10 @@ static void apr_pool_check_integrity(apr_pool_t *pool) abort(); } #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) */ +} +static void apr_pool_check_owner(apr_pool_t *pool) +{ #if (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER) #if APR_HAS_THREADS if (!apr_os_thread_equal(pool->owner, apr_os_thread_current())) { @@ -1474,6 +1477,12 @@ static void apr_pool_check_integrity(apr_pool_t *pool) #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER) */ } +static void apr_pool_check_integrity(apr_pool_t *pool) +{ + apr_pool_check_lifetime(pool); + apr_pool_check_owner(pool); +} + APR_DECLARE(void) apr_pool_owner_set(apr_pool_t *pool, apr_uint32_t flags) { #if APR_HAS_THREADS && (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER) @@ -1668,6 +1677,12 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) run_cleanups(&pool->pre_cleanups); pool->pre_cleanups = NULL; + /* + * Now that we have given the pre cleanups the chance to kill of any + * threads using the pool, the owner must be correct. + */ + apr_pool_check_owner(pool); + /* Destroy the subpools. The subpools will detach themselves from * this pool thus this loop is safe and easy. */ @@ -1716,7 +1731,7 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, apr_thread_mutex_t *mutex = NULL; #endif - apr_pool_check_integrity(pool); + apr_pool_check_lifetime(pool); #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) apr_pool_log_event(pool, "CLEAR", file_line, 1); @@ -1754,7 +1769,7 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, static void pool_destroy_debug(apr_pool_t *pool, const char *file_line) { - apr_pool_check_integrity(pool); + apr_pool_check_lifetime(pool); #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) apr_pool_log_event(pool, "DESTROY", file_line, 1); From 937a1d14f74e93791c92d808e3d6afbf1a485be6 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 23 Mar 2013 16:19:19 +0000 Subject: [PATCH 7226/7878] kill the threads in the thread pool in a pre-cleanup This makes sure that the threads are killed when we start destroying any sub-pools they may be using. This is the last missing part to make the test suite run successfully with full pool debugging enabled. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460185 13f79535-47bb-0310-9956-ffa450edef68 --- util-misc/apr_thread_pool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util-misc/apr_thread_pool.c b/util-misc/apr_thread_pool.c index 4c19482fb39..f5a7a4316f1 100644 --- a/util-misc/apr_thread_pool.c +++ b/util-misc/apr_thread_pool.c @@ -366,8 +366,7 @@ APR_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t ** me, rv = thread_pool_construct(tp, init_threads, max_threads); if (APR_SUCCESS != rv) return rv; - apr_pool_cleanup_register(tp->pool, tp, thread_pool_cleanup, - apr_pool_cleanup_null); + apr_pool_pre_cleanup_register(tp->pool, tp, thread_pool_cleanup); while (init_threads) { /* Grab the mutex as apr_thread_create() and thread_pool_func() will @@ -397,7 +396,8 @@ APR_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t ** me, APR_DECLARE(apr_status_t) apr_thread_pool_destroy(apr_thread_pool_t * me) { - return apr_pool_cleanup_run(me->pool, me, thread_pool_cleanup); + apr_pool_destroy(me->pool); + return APR_SUCCESS; } /* From 4f8604c4b5ea017af0b5afc7c22ff7a2a5a0b28b Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 23 Mar 2013 16:19:46 +0000 Subject: [PATCH 7227/7878] Add CHANGES entry for pool debugging fixes PR: 43375, 52785 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460186 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 17e642023f4..5d5e7715b90 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Fix pool integrity checks with threads. Add new apr_pool_owner_set() + function. PR 43375, 52785. [Stefan Fritsch] + *) Add support code to teach valgrind about APR pools, allocators, and bucket allocators. [Stefan Fritsch] From 3020eefa5ca71326d5bb28b55ee98c47b02d92dd Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 23 Mar 2013 22:18:15 +0000 Subject: [PATCH 7228/7878] add a warning about thread safety git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460241 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index a0a386819f9..14a25faa01a 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -307,6 +307,9 @@ struct apr_hdtr_t { * @param type The type of the socket (e.g., SOCK_STREAM). * @param protocol The protocol of the socket (e.g., APR_PROTO_TCP). * @param cont The pool for the apr_socket_t and associated storage. + * @note The pool will be used by various functions that operate on the + * socket. The caller must ensure that it is not used by other threads + * at the same time. */ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, int family, int type, @@ -362,6 +365,9 @@ APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, * be used for all future communication. * @param sock The socket we are listening on. * @param connection_pool The pool for the new socket. + * @note The pool will be used by various functions that operate on the + * socket. The caller must ensure that it is not used by other threads + * at the same time. */ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new_sock, apr_socket_t *sock, From 33fda3eff409b2d33c2a901a2b752df62097e315 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 23 Mar 2013 22:21:13 +0000 Subject: [PATCH 7229/7878] use heap memory for crypt in apr_password_validate, to reduce stack usage PR: 54572 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460243 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_passwd.c | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/crypto/apr_passwd.c b/crypto/apr_passwd.c index 50d38b4e480..5fe85cda344 100644 --- a/crypto/apr_passwd.c +++ b/crypto/apr_passwd.c @@ -33,6 +33,9 @@ #if APR_HAVE_PTHREAD_H #include #endif +#if APR_HAVE_STDLIB_H +#include +#endif static const char * const apr1_id = "$apr1$"; @@ -126,15 +129,24 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, #if defined(WIN32) || defined(BEOS) || defined(NETWARE) return (strcmp(passwd, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; #elif defined(CRYPT_R_CRYPTD) - CRYPTD buffer; - - crypt_pw = crypt_r(passwd, hash, &buffer); - if (!crypt_pw) { - return APR_EMISMATCH; - } - return (strcmp(crypt_pw, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; + apr_status_t rv; + CRYPTD *buffer = malloc(sizeof(*buffer)); + + if (buffer == NULL) + return APR_ENOMEM; + crypt_pw = crypt_r(passwd, hash, buffer); + if (!crypt_pw) + rv = APR_EMISMATCH; + else + rv = (strcmp(crypt_pw, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; + free(buffer); + return rv; #elif defined(CRYPT_R_STRUCT_CRYPT_DATA) - struct crypt_data buffer; + apr_status_t rv; + struct crypt_data *buffer = malloc(sizeof(*buffer)); + + if (buffer == NULL) + return APR_ENOMEM; #ifdef __GLIBC_PREREQ /* @@ -148,16 +160,18 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, #endif #ifdef USE_CRYPT_DATA_INITALIZED - buffer.initialized = 0; + buffer->initialized = 0; #else - memset(&buffer, 0, sizeof(buffer)); + memset(buffer, 0, sizeof(*buffer)); #endif - crypt_pw = crypt_r(passwd, hash, &buffer); - if (!crypt_pw) { - return APR_EMISMATCH; - } - return (strcmp(crypt_pw, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; + crypt_pw = crypt_r(passwd, hash, buffer); + if (!crypt_pw) + rv = APR_EMISMATCH; + else + rv = (strcmp(crypt_pw, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; + free(buffer); + return rv; #else /* Do a bit of sanity checking since we know that crypt_r() * should always be used for threaded builds on AIX, and From 20adba234214c90bbd58260a6c9049887e0629da Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 23 Mar 2013 23:18:49 +0000 Subject: [PATCH 7230/7878] speed-up md5 by avoiding some memcopies PR: 49011 Submitted by: Stefan Fritsch, Stefan Fuhrmann git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460244 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ crypto/apr_md5.c | 22 ++++++++++++++++++---- test/testmd5.c | 25 +++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 5d5e7715b90..14649559f1b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Speedup md5 calculation by avoiding some copying on little endian + architectures. PR 49011. [Stefan Fritsch, Stefan Fuhrmann + ] + *) Fix pool integrity checks with threads. Add new apr_pool_owner_set() function. PR 43375, 52785. [Stefan Fritsch] diff --git a/crypto/apr_md5.c b/crypto/apr_md5.c index 3725f27d2c6..2aa0b4c4977 100644 --- a/crypto/apr_md5.c +++ b/crypto/apr_md5.c @@ -338,9 +338,18 @@ APR_DECLARE(apr_status_t) apr_md5(unsigned char digest[APR_MD5_DIGESTSIZE], static void MD5Transform(apr_uint32_t state[4], const unsigned char block[64]) { apr_uint32_t a = state[0], b = state[1], c = state[2], d = state[3], - x[APR_MD5_DIGESTSIZE]; + tmpbuf[APR_MD5_DIGESTSIZE]; + const apr_uint32_t *x; - Decode(x, block, 64); +#if !APR_IS_BIGENDIAN + if ((apr_uintptr_t)block % sizeof(apr_uint32_t) == 0) { + x = (apr_uint32_t *)block; + } else +#endif + { + Decode(tmpbuf, block, 64); + x = tmpbuf; + } /* Round 1 */ FF(a, b, c, d, x[0], S11, 0xd76aa478); /* 1 */ @@ -419,8 +428,13 @@ static void MD5Transform(apr_uint32_t state[4], const unsigned char block[64]) state[2] += c; state[3] += d; - /* Zeroize sensitive information. */ - memset(x, 0, sizeof(x)); +#if !APR_IS_BIGENDIAN + if (x == tmpbuf) +#endif + { + /* Zeroize sensitive information. */ + memset(tmpbuf, 0, sizeof(tmpbuf)); + } } /* Encodes input (apr_uint32_t) into output (unsigned char). Assumes len is diff --git a/test/testmd5.c b/test/testmd5.c index 5189993b410..4e13da2371a 100644 --- a/test/testmd5.c +++ b/test/testmd5.c @@ -66,6 +66,30 @@ static void test_md5sum(abts_case *tc, void *data) (memcmp(digest, sum, APR_MD5_DIGESTSIZE) == 0)); } +static void test_md5sum_unaligned(abts_case *tc, void *data) +{ + apr_md5_ctx_t context; + const char *string = "abcdefghijklmnopqrstuvwxyz01234" + "abcdefghijklmnopqrstuvwxyz01234" + "abcdefghijklmnopqrstuvwxyz01234" + "abcdefghijklmnopqrstuvwxyz01234_"; + const char *sum = + "\x93\x17\x22\x78\xee\x30\x82\xb3\xeb\x95\x33\xec\xea\x78\xb7\x89"; + unsigned char digest[APR_MD5_DIGESTSIZE]; + unsigned int i; + + ABTS_ASSERT(tc, "apr_md5_init", (apr_md5_init(&context) == 0)); + for (i = 0; i < 10; i++) { + ABTS_ASSERT(tc, "apr_md5_update", + (apr_md5_update(&context, string, strlen(string)) == 0)); + string++; + } + ABTS_ASSERT(tc, "apr_md5_final", (apr_md5_final(digest, &context) + == 0)); + ABTS_ASSERT(tc, "check for correct md5 digest of unaligned data", + (memcmp(digest, sum, APR_MD5_DIGESTSIZE) == 0)); +} + abts_suite *testmd5(abts_suite *suite) { suite = ADD_SUITE(suite); @@ -73,6 +97,7 @@ abts_suite *testmd5(abts_suite *suite) for (count=0; count < num_sums; count++) { abts_run_test(suite, test_md5sum, NULL); } + abts_run_test(suite, test_md5sum_unaligned, NULL); return suite; } From fb2424fda9f9ea7b1976439abbbc59cef955ef2d Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sun, 24 Mar 2013 13:43:46 +0000 Subject: [PATCH 7231/7878] remove some backported items git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460375 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/CHANGES b/CHANGES index 14649559f1b..dc641e3eb76 100644 --- a/CHANGES +++ b/CHANGES @@ -1,10 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) Speedup md5 calculation by avoiding some copying on little endian - architectures. PR 49011. [Stefan Fritsch, Stefan Fuhrmann - ] - *) Fix pool integrity checks with threads. Add new apr_pool_owner_set() function. PR 43375, 52785. [Stefan Fritsch] @@ -17,14 +13,6 @@ Changes for APR 2.0.0 *) apr_socket_accept_filter(): The 2nd and 3rd arguments are now const char * instead of char *. [Jeff Trawick] - *) Fix potential data corruption in apr_brigade_write() and friends if - the last bucket of the brigade is a heap bucket that has been split, - and there are still references to the next part of the original bucket - in use. [Stefan Fritsch] - - *) Remove duplicated logic in apr_brigade_puts(). PR 53740. [Christophe - Jaillet ] - *) apr_pollset_poll: add z/OS async poll support for sockets [Greg Ames] *) apr_mcast_hops: Fix EINVAL for IPv6 sockets caused by using byte @@ -36,9 +24,6 @@ Changes for APR 2.0.0 *) apr_socket_opt_set: Add support for APR_SO_BROADCAST. PR 46389. [Armin Müller ] - *) apr_memcache_server_create: Fix possible segfault. PR 51064. - [Michajlo Matijkiw ] - *) apr_brigades: add a check to prevent infinite while loop in case of a corrupted brigade. Problem evidenced in PR 51062. Analysis by Krzysztof KostaÅ‚kowicz , patch [Nick Kew]. From aacbc86353852ca56b8e6c9280452bd582a45e78 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 24 Mar 2013 15:26:39 +0000 Subject: [PATCH 7232/7878] clean up a bit of error handling just to get rid of sockperf.c: In function 'main': sockperf.c:206:18: warning: variable 'rv' set but not used [-Wunused-but-set-variable] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460399 13f79535-47bb-0310-9956-ffa450edef68 --- test/sockperf.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/test/sockperf.c b/test/sockperf.c index bc3d1e2f3a3..a18d8ba3f98 100644 --- a/test/sockperf.c +++ b/test/sockperf.c @@ -96,8 +96,10 @@ static apr_status_t sendRecvBuffer(apr_time_t *t, const char *buf, rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, APR_PROTO_TCP, pool); - if (rv != APR_SUCCESS) + if (rv != APR_SUCCESS) { + reportError("Unable to create IPv4 stream socket", rv, pool); return rv; + } rv = apr_socket_connect(sock, sockAddr); if (rv != APR_SUCCESS) { @@ -110,16 +112,21 @@ static apr_status_t sendRecvBuffer(apr_time_t *t, const char *buf, } recvBuf = apr_palloc(pool, size); - if (! recvBuf) + if (! recvBuf) { + reportError("Unable to allocate buffer", ENOMEM, pool); return ENOMEM; + } + *t = 0; /* START! */ testStart = apr_time_now(); rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, APR_PROTO_TCP, pool); - if (rv != APR_SUCCESS) + if (rv != APR_SUCCESS) { + reportError("Unable to create IPv4 stream socket", rv, pool); return rv; + } rv = apr_socket_connect(sock, sockAddr); if (rv != APR_SUCCESS) { @@ -146,8 +153,10 @@ static apr_status_t sendRecvBuffer(apr_time_t *t, const char *buf, do { len = thistime; rv = apr_socket_recv(sock, &recvBuf[size - thistime], &len); - if (rv != APR_SUCCESS) + if (rv != APR_SUCCESS) { + reportError("Error receiving from socket", rv, pool); break; + } thistime -= len; } while (thistime); } @@ -218,14 +227,18 @@ int main(int argc, char **argv) results = (struct testResult *)apr_pcalloc(pool, sizeof(*results) * nTests); - for(i = 0; i < nTests; i++) { + for (i = 0; i < nTests; i++) { printf("Test -> %c\n", testRuns[i].c); results[i].size = testRuns[i].size * (apr_size_t)TEST_SIZE; rv = runTest(&testRuns[i], &results[i], pool); + if (rv != APR_SUCCESS) { + /* error already reported */ + exit(1); + } } printf("Tests Complete!\n"); - for(i = 0; i < nTests; i++) { + for (i = 0; i < nTests; i++) { int j; apr_time_t totTime = 0; printf("%10d byte block:\n", results[i].size); From 28f870cb8d63f88b7dc5d249a6458e235f249700 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 24 Mar 2013 15:34:58 +0000 Subject: [PATCH 7233/7878] hide an unused variable on Unix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1460405 13f79535-47bb-0310-9956-ffa450edef68 --- test/testnames.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testnames.c b/test/testnames.c index 7a310faffe9..5afba0c44c2 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -269,7 +269,9 @@ static void root_from_cwd_and_back(abts_case *tc, void *data) const char *path = "//"; char *origpath; char *testpath; +#if defined(WIN32) || defined(OS2) || defined(NETWARE) int hadfailed; +#endif ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_filepath_get(&origpath, 0, p)); path = origpath; @@ -308,7 +310,9 @@ static void root_from_cwd_and_back(abts_case *tc, void *data) | APR_FILEPATH_NOTABOVEROOT | APR_FILEPATH_NOTRELATIVE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); +#if defined(WIN32) || defined(OS2) || defined(NETWARE) hadfailed = tc->failed; +#endif /* The API doesn't promise equality!!! * apr_filepath_get never promised a canonical filepath. * We'll emit noise under verbose so the user is aware, From d912978f220d5de72692ae8c611be4b4b15d63e3 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Thu, 28 Mar 2013 17:25:19 +0000 Subject: [PATCH 7234/7878] reformat&comment char tables as preparation to add more bits no code change git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1462219 13f79535-47bb-0310-9956-ffa450edef68 --- uri/apr_uri.c | 544 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 512 insertions(+), 32 deletions(-) diff --git a/uri/apr_uri.c b/uri/apr_uri.c index cd8e6ff4b8d..857c18a226b 100644 --- a/uri/apr_uri.c +++ b/uri/apr_uri.c @@ -179,42 +179,522 @@ APR_DECLARE(char *) apr_uri_unparse(apr_pool_t *p, #if APR_CHARSET_EBCDIC /* Delimiter table for the EBCDIC character set */ static const unsigned char uri_delims[256] = { - T_NUL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,T_SLASH,0,0,0,0,0,0,0,0,0,0,0,0,0,T_QUESTION, - 0,0,0,0,0,0,0,0,0,0,T_COLON,T_HASH,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + T_NUL, /* 0x00 */ + 0, /* 0x01 */ + 0, /* 0x02 */ + 0, /* 0x03 */ + 0, /* 0x04 */ + 0, /* 0x05 */ + 0, /* 0x06 */ + 0, /* 0x07 */ + 0, /* 0x08 */ + 0, /* 0x09 */ + 0, /* 0x0a */ + 0, /* 0x0b */ + 0, /* 0x0c */ + 0, /* 0x0d */ + 0, /* 0x0e */ + 0, /* 0x0f */ + 0, /* 0x10 */ + 0, /* 0x11 */ + 0, /* 0x12 */ + 0, /* 0x13 */ + 0, /* 0x14 */ + 0, /* 0x15 */ + 0, /* 0x16 */ + 0, /* 0x17 */ + 0, /* 0x18 */ + 0, /* 0x19 */ + 0, /* 0x1a */ + 0, /* 0x1b */ + 0, /* 0x1c */ + 0, /* 0x1d */ + 0, /* 0x1e */ + 0, /* 0x1f */ + 0, /* 0x20 */ + 0, /* 0x21 */ + 0, /* 0x22 */ + 0, /* 0x23 */ + 0, /* 0x24 */ + 0, /* 0x25 */ + 0, /* 0x26 */ + 0, /* 0x27 */ + 0, /* 0x28 */ + 0, /* 0x29 */ + 0, /* 0x2a */ + 0, /* 0x2b */ + 0, /* 0x2c */ + 0, /* 0x2d */ + 0, /* 0x2e */ + 0, /* 0x2f */ + 0, /* 0x30 */ + 0, /* 0x31 */ + 0, /* 0x32 */ + 0, /* 0x33 */ + 0, /* 0x34 */ + 0, /* 0x35 */ + 0, /* 0x36 */ + 0, /* 0x37 */ + 0, /* 0x38 */ + 0, /* 0x39 */ + 0, /* 0x3a */ + 0, /* 0x3b */ + 0, /* 0x3c */ + 0, /* 0x3d */ + 0, /* 0x3e */ + 0, /* 0x3f */ + 0, /* 0x40 ' ' */ + 0, /* 0x41 */ + 0, /* 0x42 */ + 0, /* 0x43 */ + 0, /* 0x44 */ + 0, /* 0x45 */ + 0, /* 0x46 */ + 0, /* 0x47 */ + 0, /* 0x48 */ + 0, /* 0x49 */ + 0, /* 0x4a '[' */ + 0, /* 0x4b */ + 0, /* 0x4c '<' */ + 0, /* 0x4d '(' */ + 0, /* 0x4e '+' */ + 0, /* 0x4f '!' */ + 0, /* 0x50 '&' */ + 0, /* 0x51 */ + 0, /* 0x52 */ + 0, /* 0x53 */ + 0, /* 0x54 */ + 0, /* 0x55 */ + 0, /* 0x56 */ + 0, /* 0x57 */ + 0, /* 0x58 */ + 0, /* 0x59 */ + 0, /* 0x5a ']' */ + 0, /* 0x5b '$' */ + 0, /* 0x5c '*' */ + 0, /* 0x5d ')' */ + 0, /* 0x5e ';' */ + 0, /* 0x5f '^' */ + 0, /* 0x60 '-' */ + T_SLASH, /* 0x61 '/' */ + 0, /* 0x62 */ + 0, /* 0x63 */ + 0, /* 0x64 */ + 0, /* 0x65 */ + 0, /* 0x66 */ + 0, /* 0x67 */ + 0, /* 0x68 */ + 0, /* 0x69 */ + 0, /* 0x6a '|' */ + 0, /* 0x6b ',' */ + 0, /* 0x6c '%' */ + 0, /* 0x6d '_' */ + 0, /* 0x6e '>' */ + T_QUESTION, /* 0x6f '?' */ + 0, /* 0x70 */ + 0, /* 0x71 */ + 0, /* 0x72 */ + 0, /* 0x73 */ + 0, /* 0x74 */ + 0, /* 0x75 */ + 0, /* 0x76 */ + 0, /* 0x77 */ + 0, /* 0x78 */ + 0, /* 0x79 '`' */ + T_COLON, /* 0x7a ':' */ + T_HASH, /* 0x7b '#' */ + 0, /* 0x7c '@' */ + 0, /* 0x7d ''' */ + 0, /* 0x7e '=' */ + 0, /* 0x7f '"' */ + 0, /* 0x80 */ + 0, /* 0x81 'a' */ + 0, /* 0x82 'b' */ + 0, /* 0x83 'c' */ + 0, /* 0x84 'd' */ + 0, /* 0x85 'e' */ + 0, /* 0x86 'f' */ + 0, /* 0x87 'g' */ + 0, /* 0x88 'h' */ + 0, /* 0x89 'i' */ + 0, /* 0x8a */ + 0, /* 0x8b */ + 0, /* 0x8c */ + 0, /* 0x8d */ + 0, /* 0x8e */ + 0, /* 0x8f */ + 0, /* 0x90 */ + 0, /* 0x91 'j' */ + 0, /* 0x92 'k' */ + 0, /* 0x93 'l' */ + 0, /* 0x94 'm' */ + 0, /* 0x95 'n' */ + 0, /* 0x96 'o' */ + 0, /* 0x97 'p' */ + 0, /* 0x98 'q' */ + 0, /* 0x99 'r' */ + 0, /* 0x9a */ + 0, /* 0x9b */ + 0, /* 0x9c */ + 0, /* 0x9d */ + 0, /* 0x9e */ + 0, /* 0x9f */ + 0, /* 0xa0 */ + 0, /* 0xa1 '~' */ + 0, /* 0xa2 's' */ + 0, /* 0xa3 't' */ + 0, /* 0xa4 'u' */ + 0, /* 0xa5 'v' */ + 0, /* 0xa6 'w' */ + 0, /* 0xa7 'x' */ + 0, /* 0xa8 'y' */ + 0, /* 0xa9 'z' */ + 0, /* 0xaa */ + 0, /* 0xab */ + 0, /* 0xac */ + 0, /* 0xad */ + 0, /* 0xae */ + 0, /* 0xaf */ + 0, /* 0xb0 */ + 0, /* 0xb1 */ + 0, /* 0xb2 */ + 0, /* 0xb3 */ + 0, /* 0xb4 */ + 0, /* 0xb5 */ + 0, /* 0xb6 */ + 0, /* 0xb7 */ + 0, /* 0xb8 */ + 0, /* 0xb9 */ + 0, /* 0xba */ + 0, /* 0xbb */ + 0, /* 0xbc */ + 0, /* 0xbd */ + 0, /* 0xbe */ + 0, /* 0xbf */ + 0, /* 0xc0 '{' */ + 0, /* 0xc1 'A' */ + 0, /* 0xc2 'B' */ + 0, /* 0xc3 'C' */ + 0, /* 0xc4 'D' */ + 0, /* 0xc5 'E' */ + 0, /* 0xc6 'F' */ + 0, /* 0xc7 'G' */ + 0, /* 0xc8 'H' */ + 0, /* 0xc9 'I' */ + 0, /* 0xca */ + 0, /* 0xcb */ + 0, /* 0xcc */ + 0, /* 0xcd */ + 0, /* 0xce */ + 0, /* 0xcf */ + 0, /* 0xd0 '}' */ + 0, /* 0xd1 'J' */ + 0, /* 0xd2 'K' */ + 0, /* 0xd3 'L' */ + 0, /* 0xd4 'M' */ + 0, /* 0xd5 'N' */ + 0, /* 0xd6 'O' */ + 0, /* 0xd7 'P' */ + 0, /* 0xd8 'Q' */ + 0, /* 0xd9 'R' */ + 0, /* 0xda */ + 0, /* 0xdb */ + 0, /* 0xdc */ + 0, /* 0xdd */ + 0, /* 0xde */ + 0, /* 0xdf */ + 0, /* 0xe0 '\' */ + 0, /* 0xe1 */ + 0, /* 0xe2 'S' */ + 0, /* 0xe3 'T' */ + 0, /* 0xe4 'U' */ + 0, /* 0xe5 'V' */ + 0, /* 0xe6 'W' */ + 0, /* 0xe7 'X' */ + 0, /* 0xe8 'Y' */ + 0, /* 0xe9 'Z' */ + 0, /* 0xea */ + 0, /* 0xeb */ + 0, /* 0xec */ + 0, /* 0xed */ + 0, /* 0xee */ + 0, /* 0xef */ + 0, /* 0xf0 '0' */ + 0, /* 0xf1 '1' */ + 0, /* 0xf2 '2' */ + 0, /* 0xf3 '3' */ + 0, /* 0xf4 '4' */ + 0, /* 0xf5 '5' */ + 0, /* 0xf6 '6' */ + 0, /* 0xf7 '7' */ + 0, /* 0xf8 '8' */ + 0, /* 0xf9 '9' */ + 0, /* 0xfa */ + 0, /* 0xfb */ + 0, /* 0xfc */ + 0, /* 0xfd */ + 0, /* 0xfe */ + 0 /* 0xff */ }; #else /* Delimiter table for the ASCII character set */ static const unsigned char uri_delims[256] = { - T_NUL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,T_HASH,0,0,0,0,0,0,0,0,0,0,0,T_SLASH, - 0,0,0,0,0,0,0,0,0,0,T_COLON,0,0,0,0,T_QUESTION, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + T_NUL, /* 0x00 */ + 0, /* 0x01 */ + 0, /* 0x02 */ + 0, /* 0x03 */ + 0, /* 0x04 */ + 0, /* 0x05 */ + 0, /* 0x06 */ + 0, /* 0x07 */ + 0, /* 0x08 */ + 0, /* 0x09 */ + 0, /* 0x0a */ + 0, /* 0x0b */ + 0, /* 0x0c */ + 0, /* 0x0d */ + 0, /* 0x0e */ + 0, /* 0x0f */ + 0, /* 0x10 */ + 0, /* 0x11 */ + 0, /* 0x12 */ + 0, /* 0x13 */ + 0, /* 0x14 */ + 0, /* 0x15 */ + 0, /* 0x16 */ + 0, /* 0x17 */ + 0, /* 0x18 */ + 0, /* 0x19 */ + 0, /* 0x1a */ + 0, /* 0x1b */ + 0, /* 0x1c */ + 0, /* 0x1d */ + 0, /* 0x1e */ + 0, /* 0x1f */ + 0, /* 0x20 ' ' */ + 0, /* 0x21 '!' */ + 0, /* 0x22 '"' */ + T_HASH, /* 0x23 '#' */ + 0, /* 0x24 '$' */ + 0, /* 0x25 '%' */ + 0, /* 0x26 '&' */ + 0, /* 0x27 ''' */ + 0, /* 0x28 '(' */ + 0, /* 0x29 ')' */ + 0, /* 0x2a '*' */ + 0, /* 0x2b '+' */ + 0, /* 0x2c ',' */ + 0, /* 0x2d '-' */ + 0, /* 0x2e '.' */ + T_SLASH, /* 0x2f '/' */ + 0, /* 0x30 '0' */ + 0, /* 0x31 '1' */ + 0, /* 0x32 '2' */ + 0, /* 0x33 '3' */ + 0, /* 0x34 '4' */ + 0, /* 0x35 '5' */ + 0, /* 0x36 '6' */ + 0, /* 0x37 '7' */ + 0, /* 0x38 '8' */ + 0, /* 0x39 '9' */ + T_COLON, /* 0x3a ':' */ + 0, /* 0x3b ';' */ + 0, /* 0x3c '<' */ + 0, /* 0x3d '=' */ + 0, /* 0x3e '>' */ + T_QUESTION, /* 0x3f '?' */ + 0, /* 0x40 '@' */ + 0, /* 0x41 'A' */ + 0, /* 0x42 'B' */ + 0, /* 0x43 'C' */ + 0, /* 0x44 'D' */ + 0, /* 0x45 'E' */ + 0, /* 0x46 'F' */ + 0, /* 0x47 'G' */ + 0, /* 0x48 'H' */ + 0, /* 0x49 'I' */ + 0, /* 0x4a 'J' */ + 0, /* 0x4b 'K' */ + 0, /* 0x4c 'L' */ + 0, /* 0x4d 'M' */ + 0, /* 0x4e 'N' */ + 0, /* 0x4f 'O' */ + 0, /* 0x50 'P' */ + 0, /* 0x51 'Q' */ + 0, /* 0x52 'R' */ + 0, /* 0x53 'S' */ + 0, /* 0x54 'T' */ + 0, /* 0x55 'U' */ + 0, /* 0x56 'V' */ + 0, /* 0x57 'W' */ + 0, /* 0x58 'X' */ + 0, /* 0x59 'Y' */ + 0, /* 0x5a 'Z' */ + 0, /* 0x5b '[' */ + 0, /* 0x5c '\' */ + 0, /* 0x5d ']' */ + 0, /* 0x5e '^' */ + 0, /* 0x5f '_' */ + 0, /* 0x60 '`' */ + 0, /* 0x61 'a' */ + 0, /* 0x62 'b' */ + 0, /* 0x63 'c' */ + 0, /* 0x64 'd' */ + 0, /* 0x65 'e' */ + 0, /* 0x66 'f' */ + 0, /* 0x67 'g' */ + 0, /* 0x68 'h' */ + 0, /* 0x69 'i' */ + 0, /* 0x6a 'j' */ + 0, /* 0x6b 'k' */ + 0, /* 0x6c 'l' */ + 0, /* 0x6d 'm' */ + 0, /* 0x6e 'n' */ + 0, /* 0x6f 'o' */ + 0, /* 0x70 'p' */ + 0, /* 0x71 'q' */ + 0, /* 0x72 'r' */ + 0, /* 0x73 's' */ + 0, /* 0x74 't' */ + 0, /* 0x75 'u' */ + 0, /* 0x76 'v' */ + 0, /* 0x77 'w' */ + 0, /* 0x78 'x' */ + 0, /* 0x79 'y' */ + 0, /* 0x7a 'z' */ + 0, /* 0x7b '{' */ + 0, /* 0x7c '|' */ + 0, /* 0x7d '}' */ + 0, /* 0x7e '~' */ + 0, /* 0x7f */ + 0, /* 0x80 */ + 0, /* 0x81 */ + 0, /* 0x82 */ + 0, /* 0x83 */ + 0, /* 0x84 */ + 0, /* 0x85 */ + 0, /* 0x86 */ + 0, /* 0x87 */ + 0, /* 0x88 */ + 0, /* 0x89 */ + 0, /* 0x8a */ + 0, /* 0x8b */ + 0, /* 0x8c */ + 0, /* 0x8d */ + 0, /* 0x8e */ + 0, /* 0x8f */ + 0, /* 0x90 */ + 0, /* 0x91 */ + 0, /* 0x92 */ + 0, /* 0x93 */ + 0, /* 0x94 */ + 0, /* 0x95 */ + 0, /* 0x96 */ + 0, /* 0x97 */ + 0, /* 0x98 */ + 0, /* 0x99 */ + 0, /* 0x9a */ + 0, /* 0x9b */ + 0, /* 0x9c */ + 0, /* 0x9d */ + 0, /* 0x9e */ + 0, /* 0x9f */ + 0, /* 0xa0 */ + 0, /* 0xa1 */ + 0, /* 0xa2 */ + 0, /* 0xa3 */ + 0, /* 0xa4 */ + 0, /* 0xa5 */ + 0, /* 0xa6 */ + 0, /* 0xa7 */ + 0, /* 0xa8 */ + 0, /* 0xa9 */ + 0, /* 0xaa */ + 0, /* 0xab */ + 0, /* 0xac */ + 0, /* 0xad */ + 0, /* 0xae */ + 0, /* 0xaf */ + 0, /* 0xb0 */ + 0, /* 0xb1 */ + 0, /* 0xb2 */ + 0, /* 0xb3 */ + 0, /* 0xb4 */ + 0, /* 0xb5 */ + 0, /* 0xb6 */ + 0, /* 0xb7 */ + 0, /* 0xb8 */ + 0, /* 0xb9 */ + 0, /* 0xba */ + 0, /* 0xbb */ + 0, /* 0xbc */ + 0, /* 0xbd */ + 0, /* 0xbe */ + 0, /* 0xbf */ + 0, /* 0xc0 */ + 0, /* 0xc1 */ + 0, /* 0xc2 */ + 0, /* 0xc3 */ + 0, /* 0xc4 */ + 0, /* 0xc5 */ + 0, /* 0xc6 */ + 0, /* 0xc7 */ + 0, /* 0xc8 */ + 0, /* 0xc9 */ + 0, /* 0xca */ + 0, /* 0xcb */ + 0, /* 0xcc */ + 0, /* 0xcd */ + 0, /* 0xce */ + 0, /* 0xcf */ + 0, /* 0xd0 */ + 0, /* 0xd1 */ + 0, /* 0xd2 */ + 0, /* 0xd3 */ + 0, /* 0xd4 */ + 0, /* 0xd5 */ + 0, /* 0xd6 */ + 0, /* 0xd7 */ + 0, /* 0xd8 */ + 0, /* 0xd9 */ + 0, /* 0xda */ + 0, /* 0xdb */ + 0, /* 0xdc */ + 0, /* 0xdd */ + 0, /* 0xde */ + 0, /* 0xdf */ + 0, /* 0xe0 */ + 0, /* 0xe1 */ + 0, /* 0xe2 */ + 0, /* 0xe3 */ + 0, /* 0xe4 */ + 0, /* 0xe5 */ + 0, /* 0xe6 */ + 0, /* 0xe7 */ + 0, /* 0xe8 */ + 0, /* 0xe9 */ + 0, /* 0xea */ + 0, /* 0xeb */ + 0, /* 0xec */ + 0, /* 0xed */ + 0, /* 0xee */ + 0, /* 0xef */ + 0, /* 0xf0 */ + 0, /* 0xf1 */ + 0, /* 0xf2 */ + 0, /* 0xf3 */ + 0, /* 0xf4 */ + 0, /* 0xf5 */ + 0, /* 0xf6 */ + 0, /* 0xf7 */ + 0, /* 0xf8 */ + 0, /* 0xf9 */ + 0, /* 0xfa */ + 0, /* 0xfb */ + 0, /* 0xfc */ + 0, /* 0xfd */ + 0, /* 0xfe */ + 0 /* 0xff */ }; #endif From e499d78ccaf5ce31886a91bdea9220a0894672a7 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Thu, 28 Mar 2013 17:35:36 +0000 Subject: [PATCH 7235/7878] apr_uri_parse(): Do not accept invalid characters in the scheme. Per RFC 3986 3.3, enforce that the first segment of a relative path does not contain a colon. PR: 52479 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1462224 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 + test/testuri.c | 60 +++++++++ uri/apr_uri.c | 322 +++++++++++++++++++++++++++---------------------- 3 files changed, 239 insertions(+), 147 deletions(-) diff --git a/CHANGES b/CHANGES index dc641e3eb76..af8de89503a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_uri_parse(): Do not accept invalid characters in the scheme. + Per RFC 3986 3.3, enforce that the first segment of a relative path does + not contain a colon. PR 52479. [Stefan Fritsch] + *) Fix pool integrity checks with threads. Add new apr_pool_owner_set() function. PR 43375, 52785. [Stefan Fritsch] diff --git a/test/testuri.c b/test/testuri.c index ef433888b57..d0b51e16cfb 100644 --- a/test/testuri.c +++ b/test/testuri.c @@ -123,6 +123,66 @@ struct aup_test aup_tests[] = "file:../photos/image.jpg", 0, "file", NULL, NULL, NULL, NULL, NULL, "../photos/image.jpg", NULL, NULL, 0 }, + { + "file+ssh-2:../photos/image.jpg", + 0, "file+ssh-2", NULL, NULL, NULL, NULL, NULL, "../photos/image.jpg", NULL, NULL, 0 + }, + { + "script/foo.js", + 0, NULL, NULL, NULL, NULL, NULL, NULL, "script/foo.js", NULL, NULL, 0 + }, + { + "../foo2.js", + 0, NULL, NULL, NULL, NULL, NULL, NULL, "../foo2.js", NULL, NULL, 0 + }, + { + "foo3.js", + 0, NULL, NULL, NULL, NULL, NULL, NULL, "foo3.js", NULL, NULL, 0 + }, + { + "_foo/bar", + 0, NULL, NULL, NULL, NULL, NULL, NULL, "_foo/bar", NULL, NULL, 0 + }, + { + "_foo:/bar", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + "2foo:/bar", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + ".foo:/bar", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + "-foo:/bar", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + "+foo:/bar", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + "::/bar", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + ":/bar", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + ":foo", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + ":", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + "@localhost::8080", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, }; struct uph_test { diff --git a/uri/apr_uri.c b/uri/apr_uri.c index 857c18a226b..8b22d462f9f 100644 --- a/uri/apr_uri.c +++ b/uri/apr_uri.c @@ -170,10 +170,13 @@ APR_DECLARE(char *) apr_uri_unparse(apr_pool_t *p, * compares for NUL for free -- it's just another delimiter. */ -#define T_COLON 0x01 /* ':' */ -#define T_SLASH 0x02 /* '/' */ -#define T_QUESTION 0x04 /* '?' */ -#define T_HASH 0x08 /* '#' */ +#define T_SLASH 0x01 /* '/' */ +#define T_QUESTION 0x02 /* '?' */ +#define T_HASH 0x04 /* '#' */ +#define T_ALPHA 0x08 /* 'A' ... 'Z', 'a' ... 'z' */ +#define T_SCHEME 0x10 /* '0' ... '9', '-', '+', '.' + * (allowed in scheme except first char) + */ #define T_NUL 0x80 /* '\0' */ #if APR_CHARSET_EBCDIC @@ -254,10 +257,10 @@ static const unsigned char uri_delims[256] = { 0, /* 0x48 */ 0, /* 0x49 */ 0, /* 0x4a '[' */ - 0, /* 0x4b */ + T_SCHEME, /* 0x4b '.' */ 0, /* 0x4c '<' */ 0, /* 0x4d '(' */ - 0, /* 0x4e '+' */ + T_SCHEME, /* 0x4e '+' */ 0, /* 0x4f '!' */ 0, /* 0x50 '&' */ 0, /* 0x51 */ @@ -275,7 +278,7 @@ static const unsigned char uri_delims[256] = { 0, /* 0x5d ')' */ 0, /* 0x5e ';' */ 0, /* 0x5f '^' */ - 0, /* 0x60 '-' */ + T_SCHEME, /* 0x60 '-' */ T_SLASH, /* 0x61 '/' */ 0, /* 0x62 */ 0, /* 0x63 */ @@ -301,22 +304,22 @@ static const unsigned char uri_delims[256] = { 0, /* 0x77 */ 0, /* 0x78 */ 0, /* 0x79 '`' */ - T_COLON, /* 0x7a ':' */ + 0, /* 0x7a ':' */ T_HASH, /* 0x7b '#' */ 0, /* 0x7c '@' */ 0, /* 0x7d ''' */ 0, /* 0x7e '=' */ 0, /* 0x7f '"' */ 0, /* 0x80 */ - 0, /* 0x81 'a' */ - 0, /* 0x82 'b' */ - 0, /* 0x83 'c' */ - 0, /* 0x84 'd' */ - 0, /* 0x85 'e' */ - 0, /* 0x86 'f' */ - 0, /* 0x87 'g' */ - 0, /* 0x88 'h' */ - 0, /* 0x89 'i' */ + T_ALPHA, /* 0x81 'a' */ + T_ALPHA, /* 0x82 'b' */ + T_ALPHA, /* 0x83 'c' */ + T_ALPHA, /* 0x84 'd' */ + T_ALPHA, /* 0x85 'e' */ + T_ALPHA, /* 0x86 'f' */ + T_ALPHA, /* 0x87 'g' */ + T_ALPHA, /* 0x88 'h' */ + T_ALPHA, /* 0x89 'i' */ 0, /* 0x8a */ 0, /* 0x8b */ 0, /* 0x8c */ @@ -324,15 +327,15 @@ static const unsigned char uri_delims[256] = { 0, /* 0x8e */ 0, /* 0x8f */ 0, /* 0x90 */ - 0, /* 0x91 'j' */ - 0, /* 0x92 'k' */ - 0, /* 0x93 'l' */ - 0, /* 0x94 'm' */ - 0, /* 0x95 'n' */ - 0, /* 0x96 'o' */ - 0, /* 0x97 'p' */ - 0, /* 0x98 'q' */ - 0, /* 0x99 'r' */ + T_ALPHA, /* 0x91 'j' */ + T_ALPHA, /* 0x92 'k' */ + T_ALPHA, /* 0x93 'l' */ + T_ALPHA, /* 0x94 'm' */ + T_ALPHA, /* 0x95 'n' */ + T_ALPHA, /* 0x96 'o' */ + T_ALPHA, /* 0x97 'p' */ + T_ALPHA, /* 0x98 'q' */ + T_ALPHA, /* 0x99 'r' */ 0, /* 0x9a */ 0, /* 0x9b */ 0, /* 0x9c */ @@ -341,14 +344,14 @@ static const unsigned char uri_delims[256] = { 0, /* 0x9f */ 0, /* 0xa0 */ 0, /* 0xa1 '~' */ - 0, /* 0xa2 's' */ - 0, /* 0xa3 't' */ - 0, /* 0xa4 'u' */ - 0, /* 0xa5 'v' */ - 0, /* 0xa6 'w' */ - 0, /* 0xa7 'x' */ - 0, /* 0xa8 'y' */ - 0, /* 0xa9 'z' */ + T_ALPHA, /* 0xa2 's' */ + T_ALPHA, /* 0xa3 't' */ + T_ALPHA, /* 0xa4 'u' */ + T_ALPHA, /* 0xa5 'v' */ + T_ALPHA, /* 0xa6 'w' */ + T_ALPHA, /* 0xa7 'x' */ + T_ALPHA, /* 0xa8 'y' */ + T_ALPHA, /* 0xa9 'z' */ 0, /* 0xaa */ 0, /* 0xab */ 0, /* 0xac */ @@ -372,15 +375,15 @@ static const unsigned char uri_delims[256] = { 0, /* 0xbe */ 0, /* 0xbf */ 0, /* 0xc0 '{' */ - 0, /* 0xc1 'A' */ - 0, /* 0xc2 'B' */ - 0, /* 0xc3 'C' */ - 0, /* 0xc4 'D' */ - 0, /* 0xc5 'E' */ - 0, /* 0xc6 'F' */ - 0, /* 0xc7 'G' */ - 0, /* 0xc8 'H' */ - 0, /* 0xc9 'I' */ + T_ALPHA, /* 0xc1 'A' */ + T_ALPHA, /* 0xc2 'B' */ + T_ALPHA, /* 0xc3 'C' */ + T_ALPHA, /* 0xc4 'D' */ + T_ALPHA, /* 0xc5 'E' */ + T_ALPHA, /* 0xc6 'F' */ + T_ALPHA, /* 0xc7 'G' */ + T_ALPHA, /* 0xc8 'H' */ + T_ALPHA, /* 0xc9 'I' */ 0, /* 0xca */ 0, /* 0xcb */ 0, /* 0xcc */ @@ -388,15 +391,15 @@ static const unsigned char uri_delims[256] = { 0, /* 0xce */ 0, /* 0xcf */ 0, /* 0xd0 '}' */ - 0, /* 0xd1 'J' */ - 0, /* 0xd2 'K' */ - 0, /* 0xd3 'L' */ - 0, /* 0xd4 'M' */ - 0, /* 0xd5 'N' */ - 0, /* 0xd6 'O' */ - 0, /* 0xd7 'P' */ - 0, /* 0xd8 'Q' */ - 0, /* 0xd9 'R' */ + T_ALPHA, /* 0xd1 'J' */ + T_ALPHA, /* 0xd2 'K' */ + T_ALPHA, /* 0xd3 'L' */ + T_ALPHA, /* 0xd4 'M' */ + T_ALPHA, /* 0xd5 'N' */ + T_ALPHA, /* 0xd6 'O' */ + T_ALPHA, /* 0xd7 'P' */ + T_ALPHA, /* 0xd8 'Q' */ + T_ALPHA, /* 0xd9 'R' */ 0, /* 0xda */ 0, /* 0xdb */ 0, /* 0xdc */ @@ -405,30 +408,30 @@ static const unsigned char uri_delims[256] = { 0, /* 0xdf */ 0, /* 0xe0 '\' */ 0, /* 0xe1 */ - 0, /* 0xe2 'S' */ - 0, /* 0xe3 'T' */ - 0, /* 0xe4 'U' */ - 0, /* 0xe5 'V' */ - 0, /* 0xe6 'W' */ - 0, /* 0xe7 'X' */ - 0, /* 0xe8 'Y' */ - 0, /* 0xe9 'Z' */ + T_ALPHA, /* 0xe2 'S' */ + T_ALPHA, /* 0xe3 'T' */ + T_ALPHA, /* 0xe4 'U' */ + T_ALPHA, /* 0xe5 'V' */ + T_ALPHA, /* 0xe6 'W' */ + T_ALPHA, /* 0xe7 'X' */ + T_ALPHA, /* 0xe8 'Y' */ + T_ALPHA, /* 0xe9 'Z' */ 0, /* 0xea */ 0, /* 0xeb */ 0, /* 0xec */ 0, /* 0xed */ 0, /* 0xee */ 0, /* 0xef */ - 0, /* 0xf0 '0' */ - 0, /* 0xf1 '1' */ - 0, /* 0xf2 '2' */ - 0, /* 0xf3 '3' */ - 0, /* 0xf4 '4' */ - 0, /* 0xf5 '5' */ - 0, /* 0xf6 '6' */ - 0, /* 0xf7 '7' */ - 0, /* 0xf8 '8' */ - 0, /* 0xf9 '9' */ + T_SCHEME, /* 0xf0 '0' */ + T_SCHEME, /* 0xf1 '1' */ + T_SCHEME, /* 0xf2 '2' */ + T_SCHEME, /* 0xf3 '3' */ + T_SCHEME, /* 0xf4 '4' */ + T_SCHEME, /* 0xf5 '5' */ + T_SCHEME, /* 0xf6 '6' */ + T_SCHEME, /* 0xf7 '7' */ + T_SCHEME, /* 0xf8 '8' */ + T_SCHEME, /* 0xf9 '9' */ 0, /* 0xfa */ 0, /* 0xfb */ 0, /* 0xfc */ @@ -482,86 +485,86 @@ static const unsigned char uri_delims[256] = { 0, /* 0x28 '(' */ 0, /* 0x29 ')' */ 0, /* 0x2a '*' */ - 0, /* 0x2b '+' */ + T_SCHEME, /* 0x2b '+' */ 0, /* 0x2c ',' */ - 0, /* 0x2d '-' */ - 0, /* 0x2e '.' */ + T_SCHEME, /* 0x2d '-' */ + T_SCHEME, /* 0x2e '.' */ T_SLASH, /* 0x2f '/' */ - 0, /* 0x30 '0' */ - 0, /* 0x31 '1' */ - 0, /* 0x32 '2' */ - 0, /* 0x33 '3' */ - 0, /* 0x34 '4' */ - 0, /* 0x35 '5' */ - 0, /* 0x36 '6' */ - 0, /* 0x37 '7' */ - 0, /* 0x38 '8' */ - 0, /* 0x39 '9' */ - T_COLON, /* 0x3a ':' */ + T_SCHEME, /* 0x30 '0' */ + T_SCHEME, /* 0x31 '1' */ + T_SCHEME, /* 0x32 '2' */ + T_SCHEME, /* 0x33 '3' */ + T_SCHEME, /* 0x34 '4' */ + T_SCHEME, /* 0x35 '5' */ + T_SCHEME, /* 0x36 '6' */ + T_SCHEME, /* 0x37 '7' */ + T_SCHEME, /* 0x38 '8' */ + T_SCHEME, /* 0x39 '9' */ + 0, /* 0x3a ':' */ 0, /* 0x3b ';' */ 0, /* 0x3c '<' */ 0, /* 0x3d '=' */ 0, /* 0x3e '>' */ T_QUESTION, /* 0x3f '?' */ 0, /* 0x40 '@' */ - 0, /* 0x41 'A' */ - 0, /* 0x42 'B' */ - 0, /* 0x43 'C' */ - 0, /* 0x44 'D' */ - 0, /* 0x45 'E' */ - 0, /* 0x46 'F' */ - 0, /* 0x47 'G' */ - 0, /* 0x48 'H' */ - 0, /* 0x49 'I' */ - 0, /* 0x4a 'J' */ - 0, /* 0x4b 'K' */ - 0, /* 0x4c 'L' */ - 0, /* 0x4d 'M' */ - 0, /* 0x4e 'N' */ - 0, /* 0x4f 'O' */ - 0, /* 0x50 'P' */ - 0, /* 0x51 'Q' */ - 0, /* 0x52 'R' */ - 0, /* 0x53 'S' */ - 0, /* 0x54 'T' */ - 0, /* 0x55 'U' */ - 0, /* 0x56 'V' */ - 0, /* 0x57 'W' */ - 0, /* 0x58 'X' */ - 0, /* 0x59 'Y' */ - 0, /* 0x5a 'Z' */ + T_ALPHA, /* 0x41 'A' */ + T_ALPHA, /* 0x42 'B' */ + T_ALPHA, /* 0x43 'C' */ + T_ALPHA, /* 0x44 'D' */ + T_ALPHA, /* 0x45 'E' */ + T_ALPHA, /* 0x46 'F' */ + T_ALPHA, /* 0x47 'G' */ + T_ALPHA, /* 0x48 'H' */ + T_ALPHA, /* 0x49 'I' */ + T_ALPHA, /* 0x4a 'J' */ + T_ALPHA, /* 0x4b 'K' */ + T_ALPHA, /* 0x4c 'L' */ + T_ALPHA, /* 0x4d 'M' */ + T_ALPHA, /* 0x4e 'N' */ + T_ALPHA, /* 0x4f 'O' */ + T_ALPHA, /* 0x50 'P' */ + T_ALPHA, /* 0x51 'Q' */ + T_ALPHA, /* 0x52 'R' */ + T_ALPHA, /* 0x53 'S' */ + T_ALPHA, /* 0x54 'T' */ + T_ALPHA, /* 0x55 'U' */ + T_ALPHA, /* 0x56 'V' */ + T_ALPHA, /* 0x57 'W' */ + T_ALPHA, /* 0x58 'X' */ + T_ALPHA, /* 0x59 'Y' */ + T_ALPHA, /* 0x5a 'Z' */ 0, /* 0x5b '[' */ 0, /* 0x5c '\' */ 0, /* 0x5d ']' */ 0, /* 0x5e '^' */ 0, /* 0x5f '_' */ 0, /* 0x60 '`' */ - 0, /* 0x61 'a' */ - 0, /* 0x62 'b' */ - 0, /* 0x63 'c' */ - 0, /* 0x64 'd' */ - 0, /* 0x65 'e' */ - 0, /* 0x66 'f' */ - 0, /* 0x67 'g' */ - 0, /* 0x68 'h' */ - 0, /* 0x69 'i' */ - 0, /* 0x6a 'j' */ - 0, /* 0x6b 'k' */ - 0, /* 0x6c 'l' */ - 0, /* 0x6d 'm' */ - 0, /* 0x6e 'n' */ - 0, /* 0x6f 'o' */ - 0, /* 0x70 'p' */ - 0, /* 0x71 'q' */ - 0, /* 0x72 'r' */ - 0, /* 0x73 's' */ - 0, /* 0x74 't' */ - 0, /* 0x75 'u' */ - 0, /* 0x76 'v' */ - 0, /* 0x77 'w' */ - 0, /* 0x78 'x' */ - 0, /* 0x79 'y' */ - 0, /* 0x7a 'z' */ + T_ALPHA, /* 0x61 'a' */ + T_ALPHA, /* 0x62 'b' */ + T_ALPHA, /* 0x63 'c' */ + T_ALPHA, /* 0x64 'd' */ + T_ALPHA, /* 0x65 'e' */ + T_ALPHA, /* 0x66 'f' */ + T_ALPHA, /* 0x67 'g' */ + T_ALPHA, /* 0x68 'h' */ + T_ALPHA, /* 0x69 'i' */ + T_ALPHA, /* 0x6a 'j' */ + T_ALPHA, /* 0x6b 'k' */ + T_ALPHA, /* 0x6c 'l' */ + T_ALPHA, /* 0x6d 'm' */ + T_ALPHA, /* 0x6e 'n' */ + T_ALPHA, /* 0x6f 'o' */ + T_ALPHA, /* 0x70 'p' */ + T_ALPHA, /* 0x71 'q' */ + T_ALPHA, /* 0x72 'r' */ + T_ALPHA, /* 0x73 's' */ + T_ALPHA, /* 0x74 't' */ + T_ALPHA, /* 0x75 'u' */ + T_ALPHA, /* 0x76 'v' */ + T_ALPHA, /* 0x77 'w' */ + T_ALPHA, /* 0x78 'x' */ + T_ALPHA, /* 0x79 'y' */ + T_ALPHA, /* 0x7a 'z' */ 0, /* 0x7b '{' */ 0, /* 0x7c '|' */ 0, /* 0x7d '}' */ @@ -705,10 +708,6 @@ static const unsigned char uri_delims[256] = { } */ -/* Note that we optimize the scheme scanning here, we cheat and let the - * compiler know that it doesn't have to do the & masking. - */ -#define NOTEND_SCHEME (0xff) #define NOTEND_HOSTINFO (T_SLASH | T_QUESTION | T_HASH | T_NUL) #define NOTEND_PATH (T_QUESTION | T_HASH | T_NUL) @@ -788,21 +787,50 @@ APR_DECLARE(apr_status_t) apr_uri_parse(apr_pool_t *p, const char *uri, /* find the scheme: */ s = uri; - while ((uri_delims[*(unsigned char *)s] & NOTEND_SCHEME) == 0) { + /* first char must be letter */ + if (uri_delims[*(unsigned char *)s] & T_ALPHA) { ++s; + while ((uri_delims[*(unsigned char *)s] & (T_ALPHA|T_SCHEME))) + ++s; } /* scheme must be non-empty and followed by : */ - if (s == uri || s[0] != ':') { - goto deal_with_path; /* backwards predicted taken! */ + if (s != uri && s[0] == ':') { + uptr->scheme = apr_pstrmemdup(p, uri, s - uri); + s++; + } + else { + /* No valid scheme, restart from the beginning */ + s = uri; } - uptr->scheme = apr_pstrmemdup(p, uri, s - uri); - if (s[1] != '/' || s[2] != '/') { - uri = s + 1; + if (s[0] != '/' || s[1] != '/') { + if (uri == s) { + /* + * RFC 3986 3.3: If we have no scheme and no authority, + * the leading segment of a relative path must not contain a ':'. + */ + char *first_slash = strchr(uri, '/'); + if (first_slash) { + while (s < first_slash) { + if (s[0] == ':') + return APR_EGENERAL; + ++s; + } + /* no scheme but relative path, e.g. '../image.jpg' */ + } + else { + if (strchr(uri, ':') != NULL) + return APR_EGENERAL; + /* no scheme, no slash, but relative path, e.g. 'image.jpg' */ + } + goto deal_with_path; + } + /* scheme and relative path */ + uri = s; goto deal_with_path; } - s += 3; + s += 2; deal_with_authority: hostinfo = s; From fd50017ff42a56e6b162c127046017494384e88a Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 29 Mar 2013 12:48:53 +0000 Subject: [PATCH 7236/7878] Remove backported item. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1462462 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGES b/CHANGES index af8de89503a..a6d16f6c1c7 100644 --- a/CHANGES +++ b/CHANGES @@ -40,10 +40,6 @@ Changes for APR 2.0.0 *) Hide apr_wait_for_io_or_timeout() from public view and add instead apr_socket_wait() and apr_file_pipe_wait(). [Brian Havard] - *) Add apr_hash_this_key(), apr_hash_this_key_len(), and - apr_hash_this_val() for easier access to those attributes from - a hash iterator. [Hyrum K. Wright ] - *) Enable platform specific support for the opening of a file or pipe in non blocking module through the APR_FOPEN_NONBLOCK flag. [Graham Leggett] From 84fa2b50dbeb5843bd9eb0715d89307f35b7516b Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 29 Mar 2013 17:49:19 +0000 Subject: [PATCH 7237/7878] remove another backported item git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1462559 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGES b/CHANGES index a6d16f6c1c7..ed251129b11 100644 --- a/CHANGES +++ b/CHANGES @@ -1,10 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) apr_uri_parse(): Do not accept invalid characters in the scheme. - Per RFC 3986 3.3, enforce that the first segment of a relative path does - not contain a colon. PR 52479. [Stefan Fritsch] - *) Fix pool integrity checks with threads. Add new apr_pool_owner_set() function. PR 43375, 52785. [Stefan Fritsch] From f3e2a274e01206d5cf76388372de8e2825b20011 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sat, 30 Mar 2013 12:41:13 +0000 Subject: [PATCH 7238/7878] Fix comment in Windows Makefile. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1462738 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.win | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.win b/Makefile.win index 875519f153b..302b9f921ba 100644 --- a/Makefile.win +++ b/Makefile.win @@ -23,7 +23,7 @@ # # For example; # -# nmake -f Makefile.win PREFIX=C:\APR buildall checkall installall clean +# nmake -f Makefile.win PREFIX=C:\APR buildall checkall install clean # !IF EXIST("apr.sln") && ([devenv /help > NUL 2>&1] == 0) \ From ad224ec54e44020fbd6c3d1c486616130d0364ac Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sat, 30 Mar 2013 14:37:04 +0000 Subject: [PATCH 7239/7878] Copy the data folder too for testing on NetWare. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1462769 13f79535-47bb-0310-9956-ffa450edef68 --- test/NWGNUmakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/test/NWGNUmakefile b/test/NWGNUmakefile index ad46450a94a..350e6652e7d 100644 --- a/test/NWGNUmakefile +++ b/test/NWGNUmakefile @@ -249,6 +249,7 @@ nlms :: libs $(TARGET_nlm) # install :: nlms FORCE $(call COPY,$(OBJDIR)/*.nlm,$(INSTALLBASE)/) + $(call COPYR,data,$(INSTALLBASE)/data/) # # Any specialized rules here From 395cc0e1f846861f1d4c538c01572d5b19bc08ad Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Sat, 30 Mar 2013 14:50:01 +0000 Subject: [PATCH 7240/7878] Mark apr_dbd_freetds as unsupported and remove it from all builds git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1462772 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ Makefile.in | 1 - README | 2 +- README.FREETDS | 11 +++++ apr.dsp | 4 -- build.conf | 6 +-- build/aprenv.py | 1 - build/dbd.m4 | 58 ----------------------- build/dso.m4 | 6 +-- build/rpm/apr.spec.in | 16 +------ configure.in | 1 - dbd/NWGNUmakefile | 3 -- dbd/apr_dbd.c | 3 -- dbd/{ => unsupported}/NWGNUdbdfreetds | 0 dbd/{ => unsupported}/apr_dbd_freetds.c | 4 ++ dbd/{ => unsupported}/apr_dbd_freetds.dsp | 0 include/apr.h.in | 1 - include/apr.hnw | 1 - include/apr.hw | 1 - libapr.dsp | 4 -- 20 files changed, 23 insertions(+), 103 deletions(-) create mode 100644 README.FREETDS rename dbd/{ => unsupported}/NWGNUdbdfreetds (100%) rename dbd/{ => unsupported}/apr_dbd_freetds.c (99%) rename dbd/{ => unsupported}/apr_dbd_freetds.dsp (100%) diff --git a/CHANGES b/CHANGES index ed251129b11..45fbb05f2db 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Mark apr_dbd_freetds as unsupported, and remove it from all builds + [Nick Kew] + *) Fix pool integrity checks with threads. Add new apr_pool_owner_set() function. PR 43375, 52785. [Stefan Fritsch] diff --git a/Makefile.in b/Makefile.in index a72ddb16e46..343920f35a3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -75,7 +75,6 @@ LDADD_dbd_oracle = @LDADD_dbd_oracle@ LDADD_dbd_sqlite2 = @LDADD_dbd_sqlite2@ LDADD_dbd_sqlite3 = @LDADD_dbd_sqlite3@ LDADD_dbd_mysql = @LDADD_dbd_mysql@ -LDADD_dbd_freetds = @LDADD_dbd_freetds@ LDADD_dbd_odbc = @LDADD_dbd_odbc@ LDADD_dbm_db = @LDADD_dbm_db@ LDADD_dbm_gdbm = @LDADD_dbm_gdbm@ diff --git a/README b/README index 016c8f16951..f688fe8b8c2 100644 --- a/README +++ b/README @@ -183,7 +183,7 @@ define APR_DECLARE_STATIC before you include any apr header files in your source, and link to apr.lib instead. On windows, selection of database drivers is via the environment values -DBD_LIST (for freetds, mysql, oracle, pgsql, sqlite2 and/or sqlite3) +DBD_LIST (for mysql, oracle, pgsql, sqlite2 and/or sqlite3) and DBM_LIST (db and/or gdbm). DBD odbc and DBM sdbm are unconditionally compiled and installed, do not include these in the list. diff --git a/README.FREETDS b/README.FREETDS new file mode 100644 index 00000000000..4066a9c78b3 --- /dev/null +++ b/README.FREETDS @@ -0,0 +1,11 @@ +The APR DBD Driver for FreeTDS has been removed from the build. +It is known to have problems, and we are not able to maintain it. + +The source code is still available. If you want it and are able +to manage maintenance for yourself, you can patch the build and +work through issues that affect you, but you're on your own. + +We expect that for most users, the ODBC driver will serve as +an alternative. + +Sorry. diff --git a/apr.dsp b/apr.dsp index e24ab3f4d10..e9f2eaf9ac6 100644 --- a/apr.dsp +++ b/apr.dsp @@ -247,10 +247,6 @@ SOURCE=.\dbd\apr_dbd.c # End Source File # Begin Source File -SOURCE=.\dbd\apr_dbd_freetds.c -# End Source File -# Begin Source File - SOURCE=.\dbd\apr_dbd_mysql.c # End Source File # Begin Source File diff --git a/build.conf b/build.conf index 4aa276aa4a0..d429994c5f6 100644 --- a/build.conf +++ b/build.conf @@ -52,7 +52,7 @@ dsp = libapr.dsp modules = crypto_openssl crypto_nss crypto_commoncrypto dbd_pgsql - dbd_sqlite2 dbd_sqlite3 dbd_oracle dbd_mysql dbd_freetds dbd_odbc + dbd_sqlite2 dbd_sqlite3 dbd_oracle dbd_mysql dbd_odbc dbm_db dbm_gdbm dbm_ndbm # gen_uri_delim.c @@ -92,10 +92,6 @@ target = dbd/apr_dbd_oracle.la paths = dbd/apr_dbd_mysql.c target = dbd/apr_dbd_mysql.la -[dbd_freetds] -paths = dbd/apr_dbd_freetds.c -target = dbd/apr_dbd_freetds.la - [dbd_odbc] paths = dbd/apr_dbd_odbc.c target = dbd/apr_dbd_odbc.la diff --git a/build/aprenv.py b/build/aprenv.py index a4091aa18f2..dadfe809c1a 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -673,7 +673,6 @@ def APRAutoconf(self): subst['@apu_have_sqlite3@'] = 0 subst['@apu_have_sqlite2@'] = 0 subst['@apu_have_oracle@'] = 0 - subst['@apu_have_freetds@'] = 0 subst['@apu_have_odbc@'] = 0 diff --git a/build/dbd.m4 b/build/dbd.m4 index 23098f9345e..f5f6722c7cf 100644 --- a/build/dbd.m4 +++ b/build/dbd.m4 @@ -408,63 +408,6 @@ AC_DEFUN([APU_CHECK_DBD_ORACLE], [ LDFLAGS="$old_ldflags" ]) -dnl -AC_DEFUN([APU_CHECK_DBD_FREETDS], [ - apu_have_freetds=0 - - old_libs="$LIBS" - old_cppflags="$CPPFLAGS" - old_ldflags="$LDFLAGS" - - AC_ARG_WITH([freetds], - APR_HELP_STRING([--with-freetds=DIR], [specify FreeTDS location]), - [ - if test "$withval" = "yes"; then - AC_CHECK_HEADERS(sybdb.h, AC_CHECK_LIB(sybdb, tdsdbopen, [apu_have_freetds=1])) - if test "$apu_have_freetds" = "0"; then - AC_CHECK_HEADERS(freetds/sybdb.h, AC_CHECK_LIB(sybdb, tdsdbopen, [apu_have_freetds=1])) - fi - elif test "$withval" = "no"; then - : - else - sybdb_CPPFLAGS="-I$withval/include" - sybdb_LDFLAGS="-L$withval/lib " - - APR_ADDTO(CPPFLAGS, [$sybdb_CPPFLAGS]) - APR_ADDTO(LDFLAGS, [$sybdb_LDFLAGS]) - - AC_MSG_NOTICE(checking for freetds in $withval) - AC_CHECK_HEADERS(sybdb.h, AC_CHECK_LIB(sybdb, tdsdbopen, [apu_have_freetds=1])) - if test "$apu_have_freetds" = "0"; then - AC_CHECK_HEADERS(freetds/sybdb.h, AC_CHECK_LIB(sybdb, tdsdbopen, [apu_have_freetds=1])) - fi - if test "$apu_have_freetds" != "0"; then - APR_ADDTO(INCLUDES, [-I$withval/include]) - fi - fi - ], [ - AC_CHECK_HEADERS(sybdb.h, AC_CHECK_LIB(sybdb, tdsdbopen, [apu_have_freetds=1])) - if test "$apu_have_freetds" = "0"; then - AC_CHECK_HEADERS(freetds/sybdb.h, AC_CHECK_LIB(sybdb, tdsdbopen, [apu_have_freetds=1])) - fi - ]) - - AC_SUBST(apu_have_freetds) - - dnl Since we have already done the AC_CHECK_LIB tests, if we have it, - dnl we know the library is there. - if test "$apu_have_freetds" = "1"; then - APR_ADDTO(LDADD_dbd_freetds, [$sybdb_LDFLAGS -lsybdb]) - dnl Erm, I needed pcreposix, but I think that dependency has gone - dnl from the current code - dnl APR_ADDTO(LDADD_dbd_freetds, [-lpcreposix]) - fi - AC_SUBST(LDADD_dbd_freetds) - - LIBS="$old_libs" - CPPFLAGS="$old_cppflags" - LDFLAGS="$old_ldflags" -]) dnl AC_DEFUN([APU_CHECK_DBD_ODBC], [ @@ -565,7 +508,6 @@ AC_DEFUN([APU_CHECK_DBD_ODBC], [ test $apu_have_mysql = 1 && apu_dbd_tests="$apu_dbd_tests mysql" test $apu_have_sqlite2 = 1 && apu_dbd_tests="$apu_dbd_tests sqlite2" test $apu_have_sqlite3 = 1 && apu_dbd_tests="$apu_dbd_tests sqlite3" - test $apu_have_freetds = 1 && apu_dbd_tests="$apu_dbd_tests freetds" test $apu_have_odbc = 1 && apu_dbd_tests="$apu_dbd_tests odbc" AC_SUBST(apu_dbd_tests) ]) diff --git a/build/dso.m4 b/build/dso.m4 index 5ff41d28b1e..26dd4128119 100644 --- a/build/dso.m4 +++ b/build/dso.m4 @@ -42,7 +42,6 @@ AC_DEFUN([APR_MODULAR_DSO], [ test $apu_have_mysql = 1 && objs="$objs dbd/apr_dbd_mysql.lo" test $apu_have_sqlite2 = 1 && objs="$objs dbd/apr_dbd_sqlite2.lo" test $apu_have_sqlite3 = 1 && objs="$objs dbd/apr_dbd_sqlite3.lo" - test $apu_have_freetds = 1 && objs="$objs dbd/apr_dbd_freetds.lo" test $apu_have_odbc = 1 && objs="$objs dbd/apr_dbd_odbc.lo" test $apu_have_db = 1 && objs="$objs dbm/apr_dbm_berkeleydb.lo" test $apu_have_gdbm = 1 && objs="$objs dbm/apr_dbm_gdbm.lo" @@ -64,10 +63,10 @@ AC_DEFUN([APR_MODULAR_DSO], [ fi LIBS="$LIBS $LDADD_crypto_openssl $LDADD_crypto_nss $LDADD_crypto_commoncrypto" - LIBS="$LIBS $LDADD_dbd_pgsql $LDADD_dbd_sqlite2 $LDADD_dbd_sqlite3 $LDADD_dbd_oracle $LDADD_dbd_mysql $LDADD_dbd_freetds $LDADD_dbd_odbc" + LIBS="$LIBS $LDADD_dbd_pgsql $LDADD_dbd_sqlite2 $LDADD_dbd_sqlite3 $LDADD_dbd_oracle $LDADD_dbd_mysql $LDADD_dbd_odbc" LIBS="$LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm" APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_crypto_openssl $LDADD_crypto_nss $LDADD_crypto_commoncrypto" - APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbd_pgsql $LDADD_dbd_sqlite2 $LDADD_dbd_sqlite3 $LDADD_dbd_oracle $LDADD_dbd_mysql $LDADD_dbd_freetds $LDADD_dbd_odbc" + APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbd_pgsql $LDADD_dbd_sqlite2 $LDADD_dbd_sqlite3 $LDADD_dbd_oracle $LDADD_dbd_mysql $LDADD_dbd_odbc" APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm" else @@ -82,7 +81,6 @@ AC_DEFUN([APR_MODULAR_DSO], [ test $apu_have_mysql = 1 && dsos="$dsos dbd/apr_dbd_mysql.la" test $apu_have_sqlite2 = 1 && dsos="$dsos dbd/apr_dbd_sqlite2.la" test $apu_have_sqlite3 = 1 && dsos="$dsos dbd/apr_dbd_sqlite3.la" - test $apu_have_freetds = 1 && dsos="$dsos dbd/apr_dbd_freetds.la" test $apu_have_odbc = 1 && dsos="$dsos dbd/apr_dbd_odbc.la" test $apu_have_db = 1 && dsos="$dsos dbm/apr_dbm_db.la" test $apu_have_gdbm = 1 && dsos="$dsos dbm/apr_dbm_gdbm.la" diff --git a/build/rpm/apr.spec.in b/build/rpm/apr.spec.in index aa9a9bca2ea..5111a649954 100644 --- a/build/rpm/apr.spec.in +++ b/build/rpm/apr.spec.in @@ -68,16 +68,6 @@ Requires: apr-util = %{version}-%{release} This package provides the SQLite driver for the apr-util DBD (database abstraction) interface. -%package freetds -Group: Development/Libraries -Summary: APR utility library FreeTDS DBD driver -BuildRequires: freetds-devel -Requires: apr-util = %{version}-%{release} - -%description freetds -This package provides the FreeTDS driver for the apr-util DBD -(database abstraction) interface. - %package odbc Group: Development/Libraries Summary: APR utility library ODBC DBD driver @@ -118,7 +108,7 @@ This package provides crypto support for apr-util based on Mozilla NSS. --with-installbuilddir=%{_libdir}/apr/build-%{aprver} \ --with-devrandom=/dev/urandom \ --without-gdbm \ - --with-sqlite3 --with-pgsql --with-mysql --with-freetds --with-odbc \ + --with-sqlite3 --with-pgsql --with-mysql --with-odbc \ --with-berkeley-db \ --with-crypto --with-openssl --with-nss \ --without-sqlite2 @@ -171,10 +161,6 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %{_libdir}/apr-%{aprver}/apr_dbd_sqlite* -%files freetds -%defattr(-,root,root,-) -%{_libdir}/apr-%{aprver}/apr_dbd_freetds* - %files odbc %defattr(-,root,root,-) %{_libdir}/apr-%{aprver}/apr_dbd_odbc* diff --git a/configure.in b/configure.in index 91461684610..d6b2c1f66f6 100644 --- a/configure.in +++ b/configure.in @@ -2661,7 +2661,6 @@ APU_CHECK_DBD_MYSQL APU_CHECK_DBD_SQLITE3 APU_CHECK_DBD_SQLITE2 APU_CHECK_DBD_ORACLE -APU_CHECK_DBD_FREETDS APU_CHECK_DBD_ODBC dnl select an XML parser diff --git a/dbd/NWGNUmakefile b/dbd/NWGNUmakefile index 6bb7c610de4..90f8aae20d8 100644 --- a/dbd/NWGNUmakefile +++ b/dbd/NWGNUmakefile @@ -166,9 +166,6 @@ endif ifeq "$(APU_HAVE_SQLITE3)" "1" TARGET_nlm += $(OBJDIR)/dbdsqli3.nlm $(OBJDIR)/dbdsqli3.nlm $(EOLIST) endif -ifeq "$(APU_HAVE_FREETDS)" "1" -TARGET_nlm += $(OBJDIR)/dbdfreetds.nlm $(OBJDIR)/dbdfreetds.nlm $(EOLIST) -endif # # If there is an LIB target, put it here diff --git a/dbd/apr_dbd.c b/dbd/apr_dbd.c index 7f6f26ab128..7434badc1f7 100644 --- a/dbd/apr_dbd.c +++ b/dbd/apr_dbd.c @@ -133,9 +133,6 @@ APR_DECLARE(apr_status_t) apr_dbd_init(apr_pool_t *pool) #if APU_HAVE_ORACLE DRIVER_LOAD("oracle", apr_dbd_oracle_driver, pool); #endif -#if APU_HAVE_FREETDS - DRIVER_LOAD("freetds", apr_dbd_freetds_driver, pool); -#endif #if APU_HAVE_ODBC DRIVER_LOAD("odbc", apr_dbd_odbc_driver, pool); #endif diff --git a/dbd/NWGNUdbdfreetds b/dbd/unsupported/NWGNUdbdfreetds similarity index 100% rename from dbd/NWGNUdbdfreetds rename to dbd/unsupported/NWGNUdbdfreetds diff --git a/dbd/apr_dbd_freetds.c b/dbd/unsupported/apr_dbd_freetds.c similarity index 99% rename from dbd/apr_dbd_freetds.c rename to dbd/unsupported/apr_dbd_freetds.c index 167a8b86374..ba952e95b49 100644 --- a/dbd/apr_dbd_freetds.c +++ b/dbd/unsupported/apr_dbd_freetds.c @@ -14,6 +14,8 @@ * limitations under the License. */ +#ifdef I_CAN_DEAL_WITH_THIS_PARTIAL_DRIVER_AND_UNMAINTAINED_CODE_FOR_FREETDS + #include "apu.h" #include "apr_private.h" @@ -803,3 +805,5 @@ APR_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_freetds_driver = { #endif }; #endif + +#endif diff --git a/dbd/apr_dbd_freetds.dsp b/dbd/unsupported/apr_dbd_freetds.dsp similarity index 100% rename from dbd/apr_dbd_freetds.dsp rename to dbd/unsupported/apr_dbd_freetds.dsp diff --git a/include/apr.h.in b/include/apr.h.in index def752ee31e..4d9823851d5 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -674,7 +674,6 @@ typedef int apr_wait_t; #define APU_HAVE_SQLITE3 @apu_have_sqlite3@ #define APU_HAVE_SQLITE2 @apu_have_sqlite2@ #define APU_HAVE_ORACLE @apu_have_oracle@ -#define APU_HAVE_FREETDS @apu_have_freetds@ #define APU_HAVE_ODBC @apu_have_odbc@ #define APU_HAVE_CRYPTO @apu_have_crypto@ diff --git a/include/apr.hnw b/include/apr.hnw index 41e6480e71c..7781063bc17 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -475,7 +475,6 @@ typedef int apr_wait_t; #define APU_HAVE_SQLITE3 0 #define APU_HAVE_SQLITE2 0 #define APU_HAVE_ORACLE 0 -#define APU_HAVE_FREETDS 0 #define APU_HAVE_ODBC 0 #endif diff --git a/include/apr.hw b/include/apr.hw index 6c4ce56ea5f..9d7875d77b9 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -648,7 +648,6 @@ typedef int apr_wait_t; #define APU_HAVE_SQLITE3 0 #define APU_HAVE_SQLITE2 0 #define APU_HAVE_ORACLE 0 -#define APU_HAVE_FREETDS 0 #define APU_HAVE_ODBC 0 #endif diff --git a/libapr.dsp b/libapr.dsp index a53774d523e..719c3fd5420 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -282,10 +282,6 @@ SOURCE=.\dbd\apr_dbd.c # End Source File # Begin Source File -SOURCE=.\dbd\apr_dbd_freetds.c -# End Source File -# Begin Source File - SOURCE=.\dbd\apr_dbd_mysql.c # End Source File # Begin Source File From a961d332bf046610bba9e532aa1395ff0d2171e9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 30 Mar 2013 17:46:22 +0000 Subject: [PATCH 7241/7878] spelling fix git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1462813 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.win | 2 +- test/Makefile.win | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.win b/Makefile.win index 302b9f921ba..1db5bb2f822 100644 --- a/Makefile.win +++ b/Makefile.win @@ -7,7 +7,7 @@ # install - compile everything # clean - mop up everything # -# You can override the build mechansim, choose only one; +# You can override the build mechanism, choose only one; # # USEMAK=1 - compile from exported make files # USEDSW=1 - compile from .dsw / .dsp VC6 projects diff --git a/test/Makefile.win b/test/Makefile.win index 23f474bb1ea..0b11c2ed991 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -10,7 +10,7 @@ # or with special parameters # TESTALL_COMPONENTS # programs such as globalmutexchild which the various TESTS will invoke -# to validate process creation, pipes, dso mechansims and so forth +# to validate process creation, pipes, dso mechanisms and so forth # Windows Specific; # MODEL From 43cc012a388bdcef264a6b7a61c99381250fe2ef Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 20 Apr 2013 16:42:14 +0000 Subject: [PATCH 7242/7878] Fix PPC atomics to work with gcc 4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR: 54840 Submitted by: Mattias EngdegÃ¥rd git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1470186 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ atomic/unix/ppc.c | 48 +++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/CHANGES b/CHANGES index 45fbb05f2db..aea855684d8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Fix PPC atomics to work with gcc 4.0. PR 54840. [Mattias EngdegÃ¥rd + ] + *) Mark apr_dbd_freetds as unsupported, and remove it from all builds [Nick Kew] diff --git a/atomic/unix/ppc.c b/atomic/unix/ppc.c index 6ef429f06b6..ae8d503cc4d 100644 --- a/atomic/unix/ppc.c +++ b/atomic/unix/ppc.c @@ -43,12 +43,12 @@ APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint3 { apr_uint32_t prev, temp; - asm volatile ("loop_%=:\n" /* lost reservation */ + asm volatile ("1:\n" /* lost reservation */ " lwarx %0,0,%3\n" /* load and reserve */ " add %1,%0,%4\n" /* add val and prev */ PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ " stwcx. %1,0,%3\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ + " bne- 1b\n" /* loop if lost */ : "=&r" (prev), "=&r" (temp), "=m" (*mem) : "b" (mem), "r" (val) : "cc", "memory"); @@ -60,12 +60,12 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) { apr_uint32_t temp; - asm volatile ("loop_%=:\n" /* lost reservation */ + asm volatile ("1:\n" /* lost reservation */ " lwarx %0,0,%2\n" /* load and reserve */ " subf %0,%3,%0\n" /* subtract val */ PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ " stwcx. %0,0,%2\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ + " bne- 1b\n" /* loop if lost */ : "=&r" (temp), "=m" (*mem) : "b" (mem), "r" (val) : "cc", "memory"); @@ -75,12 +75,12 @@ APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) { apr_uint32_t prev; - asm volatile ("loop_%=:\n" /* lost reservation */ + asm volatile ("1:\n" /* lost reservation */ " lwarx %0,0,%2\n" /* load and reserve */ " addi %0,%0,1\n" /* add immediate */ PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ " stwcx. %0,0,%2\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ + " bne- 1b\n" /* loop if lost */ " subi %0,%0,1\n" /* return old value */ : "=&b" (prev), "=m" (*mem) : "b" (mem), "m" (*mem) @@ -93,12 +93,12 @@ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) { apr_uint32_t prev; - asm volatile ("loop_%=:\n" /* lost reservation */ + asm volatile ("1:\n" /* lost reservation */ " lwarx %0,0,%2\n" /* load and reserve */ " subi %0,%0,1\n" /* subtract immediate */ PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ " stwcx. %0,0,%2\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ + " bne- 1b\n" /* loop if lost */ : "=&b" (prev), "=m" (*mem) : "b" (mem), "m" (*mem) : "cc", "memory"); @@ -111,13 +111,13 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3 { apr_uint32_t prev; - asm volatile ("loop_%=:\n" /* lost reservation */ + asm volatile ("1:\n" /* lost reservation */ " lwarx %0,0,%1\n" /* load and reserve */ " cmpw %0,%3\n" /* compare operands */ " bne- exit_%=\n" /* skip if not equal */ PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ " stwcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ + " bne- 1b\n" /* loop if lost */ "exit_%=:\n" /* not equal */ : "=&r" (prev) : "b" (mem), "r" (with), "r" (cmp) @@ -130,11 +130,11 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint { apr_uint32_t prev; - asm volatile ("loop_%=:\n" /* lost reservation */ + asm volatile ("1:\n" /* lost reservation */ " lwarx %0,0,%1\n" /* load and reserve */ PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ " stwcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=" /* loop if lost */ + " bne- 1b" /* loop if lost */ : "=&r" (prev) : "b" (mem), "r" (val) : "cc", "memory"); @@ -146,26 +146,26 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void { void *prev; #if APR_SIZEOF_VOIDP == 4 - asm volatile ("loop_%=:\n" /* lost reservation */ + asm volatile ("1:\n" /* lost reservation */ " lwarx %0,0,%1\n" /* load and reserve */ " cmpw %0,%3\n" /* compare operands */ - " bne- exit_%=\n" /* skip if not equal */ + " bne- 2f\n" /* skip if not equal */ PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ " stwcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ - "exit_%=:\n" /* not equal */ + " bne- 1b\n" /* loop if lost */ + "2:\n" /* not equal */ : "=&r" (prev) : "b" (mem), "r" (with), "r" (cmp) : "cc", "memory"); #elif APR_SIZEOF_VOIDP == 8 - asm volatile ("loop_%=:\n" /* lost reservation */ + asm volatile ("1:\n" /* lost reservation */ " ldarx %0,0,%1\n" /* load and reserve */ " cmpd %0,%3\n" /* compare operands */ - " bne- exit_%=\n" /* skip if not equal */ + " bne- 2f\n" /* skip if not equal */ PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ " stdcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ - "exit_%=:\n" /* not equal */ + " bne- 1b\n" /* loop if lost */ + "2:\n" /* not equal */ : "=&r" (prev) : "b" (mem), "r" (with), "r" (cmp) : "cc", "memory"); @@ -179,21 +179,21 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) { void *prev; #if APR_SIZEOF_VOIDP == 4 - asm volatile ("loop_%=:\n" /* lost reservation */ + asm volatile ("1:\n" /* lost reservation */ " lwarx %0,0,%1\n" /* load and reserve */ PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ " stwcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ + " bne- 1b\n" /* loop if lost */ " isync\n" /* memory barrier */ : "=&r" (prev) : "b" (mem), "r" (with) : "cc", "memory"); #elif APR_SIZEOF_VOIDP == 8 - asm volatile ("loop_%=:\n" /* lost reservation */ + asm volatile ("1:\n" /* lost reservation */ " ldarx %0,0,%1\n" /* load and reserve */ PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ " stdcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ + " bne- 1b\n" /* loop if lost */ " isync\n" /* memory barrier */ : "=&r" (prev) : "b" (mem), "r" (with) From 37b929d02a54f14fedd798546e4a797a5bf83bd2 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sun, 21 Apr 2013 21:25:59 +0000 Subject: [PATCH 7243/7878] Fix amd64 assembler version of apr_atomic_xchgptr() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR: 51851 Submitted by: Mattias EngdegÃ¥rd git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1470348 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ atomic/unix/ia32.c | 2 +- test/testatomic.c | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index aea855684d8..751ca3be8b0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Fix amd64 assembler version of apr_atomic_xchgptr(). PR 51851. [Mattias + EngdegÃ¥rd ] + *) Fix PPC atomics to work with gcc 4.0. PR 54840. [Mattias EngdegÃ¥rd ] diff --git a/atomic/unix/ia32.c b/atomic/unix/ia32.c index 3826f927550..63f48a753a9 100644 --- a/atomic/unix/ia32.c +++ b/atomic/unix/ia32.c @@ -117,7 +117,7 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) #elif APR_SIZEOF_VOIDP == 8 asm volatile ("xchgq %q2, %1" : "=a" (prev), "+m" (*mem) - : "r" ((unsigned long)with)); + : "0" (with)); #else #error APR_SIZEOF_VOIDP value not supported #endif diff --git a/test/testatomic.c b/test/testatomic.c index cfea2a62ca3..8e00fb192ea 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -84,11 +84,12 @@ static void test_xchg32(abts_case *tc, void *data) static void test_xchgptr(abts_case *tc, void *data) { int a; - volatile void *target_ptr = NULL; + void *ref = "little piggy"; + volatile void *target_ptr = ref; void *old_ptr; old_ptr = apr_atomic_xchgptr(&target_ptr, &a); - ABTS_PTR_EQUAL(tc, NULL, old_ptr); + ABTS_PTR_EQUAL(tc, ref, old_ptr); ABTS_PTR_EQUAL(tc, &a, (void *) target_ptr); } From b2bd4a8c0fde06ecf3d2a7bc0eee49c36c9807e0 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sat, 27 Apr 2013 08:50:48 +0000 Subject: [PATCH 7244/7878] Update config.guess and config.sub from http://git.savannah.gnu.org/cgit/config.git. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1476533 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 17 +++++++++++++++-- build/config.sub | 11 +++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/build/config.guess b/build/config.guess index 6ea345452a5..2055429b1ab 100755 --- a/build/config.guess +++ b/build/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2013-02-04' +timestamp='2013-04-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -883,6 +883,9 @@ EOF if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ @@ -921,6 +924,11 @@ EOF #ifdef __dietlibc__ LIBC=dietlibc #endif + #else + #include + #ifdef __UCLIBC__ + LIBC=uclibc + #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" @@ -953,6 +961,9 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; @@ -995,7 +1006,9 @@ EOF echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + LIBC=gnu + test -r /lib/libc.so && od -An -S13 /lib/libc.so | grep -q __uClibc_main && LIBC=uclibc + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu diff --git a/build/config.sub b/build/config.sub index 80211d0d8b2..8b612ab89df 100755 --- a/build/config.sub +++ b/build/config.sub @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2013-02-04' +timestamp='2013-04-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -252,7 +252,7 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc \ + | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ @@ -296,7 +296,7 @@ case $basic_machine in | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ - | or32 \ + | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ @@ -366,7 +366,7 @@ case $basic_machine in | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ @@ -1589,6 +1589,9 @@ case $basic_machine in mips*-*) os=-elf ;; + or1k-*) + os=-elf + ;; or32-*) os=-coff ;; From 6fe5645afa6e05929425e7a6697bd7c0b6f4c90c Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Tue, 30 Apr 2013 23:23:34 +0000 Subject: [PATCH 7245/7878] remove a few backported items git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1477871 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/CHANGES b/CHANGES index 751ca3be8b0..dd426f69655 100644 --- a/CHANGES +++ b/CHANGES @@ -1,12 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) Fix amd64 assembler version of apr_atomic_xchgptr(). PR 51851. [Mattias - EngdegÃ¥rd ] - - *) Fix PPC atomics to work with gcc 4.0. PR 54840. [Mattias EngdegÃ¥rd - ] - *) Mark apr_dbd_freetds as unsupported, and remove it from all builds [Nick Kew] @@ -16,20 +10,11 @@ Changes for APR 2.0.0 *) Add support code to teach valgrind about APR pools, allocators, and bucket allocators. [Stefan Fritsch] - *) Fix apr_ipsubnet_test() false positives when comparing IPv4 - subnet representation against an IPv6 address. PR 54047. [Joe Orton] - *) apr_socket_accept_filter(): The 2nd and 3rd arguments are now const char * instead of char *. [Jeff Trawick] *) apr_pollset_poll: add z/OS async poll support for sockets [Greg Ames] - *) apr_mcast_hops: Fix EINVAL for IPv6 sockets caused by using byte - instead integer for setsockopt. [Mladen Turk] - - *) apr_file_open: Avoid fcntl() calls if support for O_CLOEXEC works. - PR 48557. [Mike Frysinger ] - *) apr_socket_opt_set: Add support for APR_SO_BROADCAST. PR 46389. [Armin Müller ] From 07a06441c0d4bd7a37b11346e95f2bca9306f44b Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 3 May 2013 18:35:14 +0000 Subject: [PATCH 7246/7878] Make sure apr_sockaddr_info_get() returns an error if - getaddrinfo() returned only useless entries - getaddrinfo() returned EAI_SYSTEM but errno == 0 - gethostbyname() returns no error but an empty address list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Submitted by: Jan Kaluža , Stefan Fritsch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1478905 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 9e98821ee5b..1ccc3f5715e 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -393,7 +393,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, return apr_get_netos_error(); #else if (error == EAI_SYSTEM) { - return errno; + return errno ? errno : APR_EGENERAL; } else { @@ -448,6 +448,15 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, ai = ai->ai_next; } freeaddrinfo(ai_list); + + if (prev_sa == NULL) { + /* + * getaddrinfo returned only useless entries and *sa is still empty. + * This should be treated as an error. + */ + return APR_EGENERAL; + } + return APR_SUCCESS; } @@ -581,6 +590,11 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, ++curaddr; } + if (prev_sa == NULL) { + /* this should not happen but no result should be treated as error */ + return APR_EGENERAL; + } + return APR_SUCCESS; } From 0a68cba18c29094c497595a86e0d1fb38c1266a5 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 3 May 2013 19:22:11 +0000 Subject: [PATCH 7247/7878] Fix invalid free when destroying pools created with apr_pool_create_unmanaged_ex() PR: 54892 Submitted by: Valeriy V. Argunov git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1478934 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 846a9adf15d..871e9fc234d 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1003,21 +1003,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, if (!apr_pools_initialized) return APR_ENOPOOL; if ((pool_allocator = allocator) == NULL) { -#if !APR_ALLOCATOR_USES_MMAP - if ((pool_allocator = malloc(MIN_ALLOC)) == NULL) { - if (abort_fn) - abort_fn(APR_ENOMEM); - - return APR_ENOMEM; - } - memset(pool_allocator, 0, SIZEOF_ALLOCATOR_T); - pool_allocator->max_free_index = APR_ALLOCATOR_MAX_FREE_UNLIMITED; - node = (apr_memnode_t *)((char *)pool_allocator + SIZEOF_ALLOCATOR_T); - node->next = NULL; - node->index = 1; - node->first_avail = (char *)node + APR_MEMNODE_T_SIZE; - node->endp = (char *)pool_allocator + MIN_ALLOC; -#else if (apr_allocator_create(&pool_allocator) != APR_SUCCESS) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -1031,7 +1016,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, return APR_ENOMEM; } -#endif } else if ((node = allocator_alloc(pool_allocator, MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { From 22882cf118c84428dc8faea07d09229a597336ba Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 3 May 2013 20:07:53 +0000 Subject: [PATCH 7248/7878] Trick autoconf into printing the correct default prefix in the help The defaults of some dirs like libexecdir are still not printed correctly, though. PR: 54032 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1478954 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.in b/configure.in index d6b2c1f66f6..8a956a9abad 100644 --- a/configure.in +++ b/configure.in @@ -180,6 +180,9 @@ AC_MSG_NOTICE([APR Version: ${APR_DOTTED_VERSION}]) dnl Enable the layout handling code, then reparse the prefix-style dnl arguments due to autoconf being a PITA. APR_ENABLE_LAYOUT(apr) +dnl This must be synchronized to the prefix of the apr layout, to make +dnl configure --help print the correct default. +AC_PREFIX_DEFAULT([/usr/local/apr]) APR_PARSE_ARGUMENTS dnl Set optional CC hints here in case autoconf makes an inappropriate choice. From e42018e3aadc875f423340d95e3791f8504063fb Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 7 May 2013 10:05:07 +0000 Subject: [PATCH 7249/7878] Fix forever loop on NetWare when trying to get parent pool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1479836 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 4 +++- dbd/apr_dbd.c | 6 ++++-- dbm/apr_dbm.c | 6 ++++-- util-misc/apu_dso.c | 6 ++++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index dbc108f7e2a..49597f1fd81 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -94,7 +94,9 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) } /* Top level pool scope, need process-scope lifetime */ - for (parent = pool; parent; parent = apr_pool_parent_get(pool)) + for (parent = apr_pool_parent_get(pool); + parent && parent != pool; + parent = apr_pool_parent_get(pool)) pool = parent; #if APR_HAVE_MODULAR_DSO /* deprecate in 2.0 - permit implicit initialization */ diff --git a/dbd/apr_dbd.c b/dbd/apr_dbd.c index 7434badc1f7..decac798061 100644 --- a/dbd/apr_dbd.c +++ b/dbd/apr_dbd.c @@ -101,8 +101,10 @@ APR_DECLARE(apr_status_t) apr_dbd_init(apr_pool_t *pool) } /* Top level pool scope, need process-scope lifetime */ - for (parent = pool; parent; parent = apr_pool_parent_get(pool)) - pool = parent; + for (parent = apr_pool_parent_get(pool); + parent && parent != pool; + parent = apr_pool_parent_get(pool)) + pool = parent; #if APR_HAVE_MODULAR_DSO /* deprecate in 2.0 - permit implicit initialization */ apu_dso_init(pool); diff --git a/dbm/apr_dbm.c b/dbm/apr_dbm.c index 60ec6c5c511..c4c296b1528 100644 --- a/dbm/apr_dbm.c +++ b/dbm/apr_dbm.c @@ -129,8 +129,10 @@ static apr_status_t dbm_open_type(apr_dbm_type_t const* * vtable, apr_pool_t *parent; /* Top level pool scope, need process-scope lifetime */ - for (parent = pool; parent; parent = apr_pool_parent_get(pool)) - pool = parent; + for (parent = apr_pool_parent_get(pool); + parent && parent != pool; + parent = apr_pool_parent_get(pool)) + pool = parent; /* deprecate in 2.0 - permit implicit initialization */ apu_dso_init(pool); diff --git a/util-misc/apu_dso.c b/util-misc/apu_dso.c index a826b83ec1a..b711066d35f 100644 --- a/util-misc/apu_dso.c +++ b/util-misc/apu_dso.c @@ -86,8 +86,10 @@ apr_status_t apu_dso_init(apr_pool_t *pool) } /* Top level pool scope, need process-scope lifetime */ - for (parent = global = pool; parent; parent = apr_pool_parent_get(global)) - global = parent; + for (parent = apr_pool_parent_get(pool); + parent && parent != pool; + parent = apr_pool_parent_get(pool)) + pool = parent; dsos = apr_hash_make(global); From 9a1d0d1b2f31f9c925cedd2ea3411d7b5edc079a Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 7 May 2013 10:56:08 +0000 Subject: [PATCH 7250/7878] Followup fix for incomplete patch with r1479836. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1479853 13f79535-47bb-0310-9956-ffa450edef68 --- util-misc/apu_dso.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/util-misc/apu_dso.c b/util-misc/apu_dso.c index b711066d35f..909af706dbb 100644 --- a/util-misc/apu_dso.c +++ b/util-misc/apu_dso.c @@ -73,7 +73,6 @@ static apr_status_t apu_dso_term(void *ptr) apr_status_t apu_dso_init(apr_pool_t *pool) { apr_status_t ret = APR_SUCCESS; - apr_pool_t *global; apr_pool_t *parent; if (apr_atomic_inc32(&initialised)) { @@ -91,14 +90,14 @@ apr_status_t apu_dso_init(apr_pool_t *pool) parent = apr_pool_parent_get(pool)) pool = parent; - dsos = apr_hash_make(global); + dsos = apr_hash_make(pool); #if APR_HAS_THREADS - ret = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, global); + ret = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, pool); /* This already registers a pool cleanup */ #endif - apr_pool_cleanup_register(global, NULL, apu_dso_term, + apr_pool_cleanup_register(pool, NULL, apu_dso_term, apr_pool_cleanup_null); apr_atomic_dec32(&in_init); From 227af154943b830a020b3fdede4d079c19bbfbea Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 7 May 2013 20:49:15 +0000 Subject: [PATCH 7251/7878] Add the apr_table_getm() call, which transparently handles the merging of keys with multiple values. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1480067 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_tables.h | 12 ++++++++++ tables/apr_tables.c | 56 ++++++++++++++++++++++++++++++++++++++++++++ test/testtable.c | 20 ++++++++++++++++ 4 files changed, 91 insertions(+) diff --git a/CHANGES b/CHANGES index dd426f69655..694254175a2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add the apr_table_getm() call, which transparently handles the + merging of keys with multiple values. [Graham Leggett] + *) Mark apr_dbd_freetds as unsupported, and remove it from all builds [Nick Kew] diff --git a/include/apr_tables.h b/include/apr_tables.h index 1e7a57d1627..00c4d8d2c22 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -267,6 +267,18 @@ APR_DECLARE(void) apr_table_clear(apr_table_t *t); */ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); +/** + * Get values associated with a given key from the table. If more than one + * value exists, return a comma separated list of values. After this call, the + * data is still in the table. + * @param p The pool to allocate the combined value from, if necessary + * @param t The table to search for the key + * @param key The key to search for (case does not matter) + * @return The value associated with the key, or NULL if the key does not exist. + */ +APR_DECLARE(const char *) apr_table_getm(apr_pool_t *p, const apr_table_t *t, + const char *key); + /** * Add a key/value pair to a table. If another element already exists with the * same key, this will overwrite the old data. diff --git a/tables/apr_tables.c b/tables/apr_tables.c index c80ad30b5ca..2f5b4e53745 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -357,6 +357,14 @@ struct apr_table_t { int index_last[TABLE_HASH_SIZE]; }; +/* keep state for apr_table_getm() */ +typedef struct +{ + apr_pool_t *p; + const char *first; + apr_array_header_t *merged; +} table_getm_t; + /* * NOTICE: if you tweak this you should look at is_empty_table() * and table_elts() in alloc.h @@ -1238,3 +1246,51 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, apr_table_compress(a, flags); } + +static int table_getm_do(void *v, const char *key, const char *val) +{ + table_getm_t *state = (table_getm_t *) v; + + if (!state->first) { + /** + * The most common case is a single header, and this is covered by + * a fast path that doesn't allocate any memory. On the second and + * subsequent header, an array is created and the array concatenated + * together to form the final value. + */ + state->first = val; + } + else { + const char **elt; + if (!state->merged) { + state->merged = apr_array_make(state->p, 10, sizeof(const char *)); + elt = apr_array_push(state->merged); + *elt = state->first; + } + elt = apr_array_push(state->merged); + *elt = val; + } + return 1; +} + +APR_DECLARE(const char *) apr_table_getm(apr_pool_t *p, const apr_table_t *t, + const char *key) +{ + table_getm_t state; + + state.p = p; + state.first = NULL; + state.merged = NULL; + + apr_table_do(table_getm_do, &state, t, key, NULL); + + if (!state.first) { + return NULL; + } + else if (!state.merged) { + return state.first; + } + else { + return apr_array_pstrcat(p, state.merged, ','); + } +} diff --git a/test/testtable.c b/test/testtable.c index 0f217787647..d24053edb55 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -57,6 +57,25 @@ static void table_get(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "bar", val); } +static void table_getm(abts_case *tc, void *data) +{ + const char *orig, *val; + apr_pool_t *subp; + + apr_pool_create(&subp, p); + + orig = "bar"; + apr_table_setn(t1, "foo", orig); + val = apr_table_getm(subp, t1, "foo"); + ABTS_PTR_EQUAL(tc, orig, val); + ABTS_STR_EQUAL(tc, "bar", val); + apr_table_add(t1, "foo", "baz"); + val = apr_table_getm(subp, t1, "foo"); + ABTS_STR_EQUAL(tc, "bar,baz", val); + + apr_pool_destroy(subp); +} + static void table_set(abts_case *tc, void *data) { const char *val; @@ -187,6 +206,7 @@ abts_suite *testtable(abts_suite *suite) abts_run_test(suite, array_clear, NULL); abts_run_test(suite, table_make, NULL); abts_run_test(suite, table_get, NULL); + abts_run_test(suite, table_getm, NULL); abts_run_test(suite, table_set, NULL); abts_run_test(suite, table_getnotthere, NULL); abts_run_test(suite, table_add, NULL); From 8806ebcda4b5f047ed14d39bd7ab16ec2fc81393 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 10 May 2013 01:53:49 +0000 Subject: [PATCH 7252/7878] Fix for stupid CodeWarrior compiler which cant deal with vars as initialize value. Submitted by: normw gknw net. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1480851 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/testtime.c b/test/testtime.c index d135c1d5584..30efbb01986 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -86,9 +86,13 @@ static void test_gmtstr(abts_case *tc, void *data) static void test_exp_lt(abts_case *tc, void *data) { - apr_time_t test_times[] = {now, leap_year_now, 0}; + apr_time_t test_times[3]; int i; + test_times[0] = now; + test_times[1] = leap_year_now; + test_times[2] = 0; + for (i = 0; test_times[i] != 0; i++) { apr_status_t rv; apr_time_exp_t xt; From 59bd8daf0b7803ba8218488b133f0bf42cbf1c60 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 10 May 2013 02:05:26 +0000 Subject: [PATCH 7253/7878] Axe tabs and trailing spaces. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1480854 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/test/testtime.c b/test/testtime.c index 30efbb01986..b17fee124a4 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -61,12 +61,12 @@ static void test_now(abts_case *tc, void *data) current = apr_time_now(); time(&os_now); - timediff = os_now - (current / APR_USEC_PER_SEC); + timediff = os_now - (current / APR_USEC_PER_SEC); /* Even though these are called so close together, there is the chance * that the time will be slightly off, so accept anything between -1 and * 1 second. */ - ABTS_ASSERT(tc, "apr_time and OS time do not agree", + ABTS_ASSERT(tc, "apr_time and OS time do not agree", (timediff > -2) && (timediff < 2)); } @@ -80,21 +80,21 @@ static void test_gmtstr(abts_case *tc, void *data) ABTS_NOT_IMPL(tc, "apr_time_exp_gmt"); } ABTS_TRUE(tc, rv == APR_SUCCESS); - ABTS_STR_EQUAL(tc, "2002-09-14 19:05:36.186711 +0000 [257 Sat]", + ABTS_STR_EQUAL(tc, "2002-09-14 19:05:36.186711 +0000 [257 Sat]", print_time(p, &xt)); } static void test_exp_lt(abts_case *tc, void *data) { - apr_time_t test_times[3]; - int i; + apr_time_t test_times[3]; + int i; - test_times[0] = now; - test_times[1] = leap_year_now; - test_times[2] = 0; + test_times[0] = now; + test_times[1] = leap_year_now; + test_times[2] = 0; - for (i = 0; test_times[i] != 0; i++) { - apr_status_t rv; + for (i = 0; test_times[i] != 0; i++) { + apr_status_t rv; apr_time_exp_t xt; time_t posix_secs = (time_t)apr_time_sec(test_times[i]); struct tm *posix_exp = localtime(&posix_secs); @@ -118,7 +118,7 @@ static void test_exp_lt(abts_case *tc, void *data) CHK_FIELD(tm_yday); CHK_FIELD(tm_isdst); #undef CHK_FIELD - } + } } static void test_exp_get_gmt(abts_case *tc, void *data) @@ -249,9 +249,9 @@ static void test_exp_tz(abts_case *tc, void *data) ABTS_NOT_IMPL(tc, "apr_time_exp_tz"); } ABTS_TRUE(tc, rv == APR_SUCCESS); - ABTS_TRUE(tc, (xt.tm_usec == 186711) && + ABTS_TRUE(tc, (xt.tm_usec == 186711) && (xt.tm_sec == 36) && - (xt.tm_min == 5) && + (xt.tm_min == 5) && (xt.tm_hour == 14) && (xt.tm_mday == 14) && (xt.tm_mon == 8) && @@ -289,7 +289,7 @@ static void test_2038(abts_case *tc, void *data) xt.tm_hour = 3; xt.tm_min = 14; xt.tm_sec = 7; - + APR_ASSERT_SUCCESS(tc, "explode January 19th, 2038", apr_time_exp_get(&t, &xt)); } From dd171cd28a61ff0fb591b784941bb268f4b8fd96 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 10 May 2013 02:32:25 +0000 Subject: [PATCH 7254/7878] Slighty modified fix for CodeWarrior. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1480862 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/testtime.c b/test/testtime.c index b17fee124a4..fadef97c47d 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -86,12 +86,11 @@ static void test_gmtstr(abts_case *tc, void *data) static void test_exp_lt(abts_case *tc, void *data) { - apr_time_t test_times[3]; + apr_time_t test_times[] = {0, 0, 0}; int i; test_times[0] = now; test_times[1] = leap_year_now; - test_times[2] = 0; for (i = 0; test_times[i] != 0; i++) { apr_status_t rv; From 8a308fd7e211a63441bc94a95af6325320f0afa4 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 10 May 2013 02:34:09 +0000 Subject: [PATCH 7255/7878] Added test-clean target to NetWare build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1480863 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUhead.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc index 7a96480f60d..f00f618e1ec 100644 --- a/build/NWGNUhead.inc +++ b/build/NWGNUhead.inc @@ -84,7 +84,7 @@ FORCE : ; # Standard targets # -clean :: $(SUBDIRS) $(APRTEST) +clean :: $(SUBDIRS) @echo Cleaning up $(CURDIR) $(call RMDIR,$(OBJDIR)) $(call DEL,*.err) @@ -92,6 +92,9 @@ clean :: $(SUBDIRS) $(APRTEST) $(call DEL,*.tmp) # $(call DEL,*.d) +test-clean :: + $(MAKE) -C $(APRTEST) -f NWGNUmakefile clean + $(OBJDIR) :: $(call MKDIR,$@) From 223e25ac8da1fef5730ee838837a5c46b0fead4a Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 10 May 2013 15:51:32 +0000 Subject: [PATCH 7256/7878] Kill some NetWare build warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1481066 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUhead.inc | 2 ++ build/NWGNUtail.inc | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc index f00f618e1ec..316454dcbec 100644 --- a/build/NWGNUhead.inc +++ b/build/NWGNUhead.inc @@ -72,8 +72,10 @@ test :: default $(SUBDIRS) : FORCE ifneq "$(MAKECMDGOALS)" "clean" +ifneq "$(findstring clobber_,$(MAKECMDGOALS))" "clobber_" @$(ECHONL) @echo Building $(CURDIR)/$@ +endif endif $(MAKE) -C $@ $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(LM_LICENSE_FILE)" @$(ECHONL) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 11c9efb10b9..4ca51496bdd 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -111,7 +111,8 @@ endif # Generic compiler rules # -ifneq ($(MAKECMDGOALS),clean) +ifneq "$(MAKECMDGOALS)" "clean" +ifneq "$(findstring clobber_,$(MAKECMDGOALS))" "clobber_" $(APRBUILD)/NWGNUversion.inc : $(APRBUILD)/nw_ver.awk $(APR)/include/apr_version.h # @echo Generating $@ @echo $(DL)GEN $@$(DL) @@ -127,6 +128,7 @@ VERSION_STR = 2.0.0 VERSION_MAJMIN = 20 endif endif +endif ifeq "$(words $(strip $(TARGET_nlm)))" "1" INCLUDE_BLDCMDS = 1 From e769e4a7984c331ea85a8babf0b76b80e8580d2b Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 10 May 2013 20:58:54 +0000 Subject: [PATCH 7257/7878] Pool debugging fixes - avoid using a destroyed mutex in apr_pool_clear() - if we create a sub-pool, we don't need to own the pool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1481186 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 871e9fc234d..45b2be2cad2 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1742,6 +1742,11 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, * the mutex we obtained above. */ if (mutex != pool->mutex) { + /* + * Prevent apr_palloc() in apr_thread_mutex_create() from trying to + * use the destroyed mutex. + */ + pool->mutex = NULL; (void)apr_thread_mutex_create(&pool->mutex, APR_THREAD_MUTEX_NESTED, pool); @@ -1818,7 +1823,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, parent = global_pool; } else { - apr_pool_check_integrity(parent); + apr_pool_check_lifetime(parent); if (!allocator) allocator = parent->allocator; From 875d27e1f2ca9a9348789da6ba3905741420e207 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sat, 11 May 2013 07:40:54 +0000 Subject: [PATCH 7258/7878] Use correct pthread constant. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1481262 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 6fc949f83a0..f2b21abe0bd 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -96,7 +96,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) #else pthread_attr_getdetachstate(&attr->attr, &state); #endif - if (state == 1) + if (state == PTHREAD_CREATE_DETACHED) return APR_DETACH; return APR_NOTDETACH; } From eca5d58313f14d8fd9906b02ff709c24f2893f66 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sat, 11 May 2013 07:48:11 +0000 Subject: [PATCH 7259/7878] Followup on r1481262: use already existing platform independent macro instead of pthread define. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1481265 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index f2b21abe0bd..dcef500e9f7 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -96,7 +96,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) #else pthread_attr_getdetachstate(&attr->attr, &state); #endif - if (state == PTHREAD_CREATE_DETACHED) + if (state == DETACH_ARG(1)) return APR_DETACH; return APR_NOTDETACH; } From 9b18014c1790bcd4501d44b3eae8ee28cb9e87ed Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 19 May 2013 11:31:05 +0000 Subject: [PATCH 7260/7878] Add support to apr_memcache for unix domain sockets. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1484271 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ memcache/apr_memcache.c | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 694254175a2..fc7ed77132e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add support to apr_memcache for unix domain sockets. PR 54573 [Remi + Gacogne ] + *) Add the apr_table_getm() call, which transparently handles the merging of keys with multiple values. [Graham Leggett] diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index 504ec37a6fb..781f34255d5 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -289,8 +289,13 @@ static apr_status_t conn_connect(apr_memcache_conn_t *conn) { apr_status_t rv = APR_SUCCESS; apr_sockaddr_t *sa; +#if APR_HAVE_SOCKADDR_UN + apr_int32_t family = conn->ms->host[0] != '/' ? APR_INET : APR_UNIX; +#else + apr_int32_t family = APR_INET; +#endif - rv = apr_sockaddr_info_get(&sa, conn->ms->host, APR_INET, conn->ms->port, 0, conn->p); + rv = apr_sockaddr_info_get(&sa, conn->ms->host, family, conn->ms->port, 0, conn->p); if (rv != APR_SUCCESS) { return rv; } @@ -322,6 +327,11 @@ mc_conn_construct(void **conn_, void *params, apr_pool_t *pool) apr_pool_t *np; apr_pool_t *tp; apr_memcache_server_t *ms = params; +#if APR_HAVE_SOCKADDR_UN + apr_int32_t family = conn->ms->host[0] != '/' ? APR_INET : APR_UNIX; +#else + apr_int32_t family = APR_INET; +#endif rv = apr_pool_create(&np, pool); if (rv != APR_SUCCESS) { @@ -339,7 +349,7 @@ mc_conn_construct(void **conn_, void *params, apr_pool_t *pool) conn->p = np; conn->tp = tp; - rv = apr_socket_create(&conn->sock, APR_INET, SOCK_STREAM, 0, np); + rv = apr_socket_create(&conn->sock, family, SOCK_STREAM, 0, np); if (rv != APR_SUCCESS) { apr_pool_destroy(np); From a678b96510228718c0b0db28ee1ee5bf9ecb4ac3 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Thu, 23 May 2013 08:06:28 +0000 Subject: [PATCH 7261/7878] Removed tabs; fixed braces indent; added ASF header. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1485604 13f79535-47bb-0310-9956-ffa450edef68 --- random/unix/sha2_glue.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/random/unix/sha2_glue.c b/random/unix/sha2_glue.c index 4909a8fe1f8..cb6e897802f 100644 --- a/random/unix/sha2_glue.c +++ b/random/unix/sha2_glue.c @@ -1,26 +1,42 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #include #include #include #include "sha2.h" static void sha256_init(apr_crypto_hash_t *h) - { +{ apr__SHA256_Init(h->data); - } +} static void sha256_add(apr_crypto_hash_t *h,const void *data, - apr_size_t bytes) - { + apr_size_t bytes) +{ apr__SHA256_Update(h->data,data,bytes); - } +} static void sha256_finish(apr_crypto_hash_t *h,unsigned char *result) - { +{ apr__SHA256_Final(result,h->data); - } +} APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p) - { +{ apr_crypto_hash_t *h=apr_palloc(p,sizeof *h); h->data=apr_palloc(p,sizeof(SHA256_CTX)); @@ -30,4 +46,4 @@ APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p) h->size=256/8; return h; - } +} From b64661f8ce69f847cbb11587e5367aa6fd6663a0 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 26 May 2013 23:58:15 +0000 Subject: [PATCH 7262/7878] Make APR_IS_DEV_STRING define-able from CFLAGS; simplyfied APu_IS_DEV_STRING define. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1486493 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_version.h | 2 ++ include/apu_version.h | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/apr_version.h b/include/apr_version.h index b47cb7c0fa3..95b26110756 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -90,7 +90,9 @@ #if defined(APR_IS_DEV_VERSION) || defined(DOXYGEN) /** Internal: string form of the "is dev" flag */ +#ifndef APR_IS_DEV_STRING #define APR_IS_DEV_STRING "-dev" +#endif #else #define APR_IS_DEV_STRING "" #endif diff --git a/include/apu_version.h b/include/apu_version.h index 30542257557..b46aad5033f 100644 --- a/include/apu_version.h +++ b/include/apu_version.h @@ -81,11 +81,7 @@ # define APU_IS_DEV_VERSION #endif -#if defined(APU_IS_DEV_VERSION) || defined(DOXYGEN) /** Internal: string form of the "is dev" flag */ -#define APU_IS_DEV_STRING "-dev" -#else -#define APU_IS_DEV_STRING "" -#endif +#define APU_IS_DEV_STRING APR_IS_DEV_STRING #endif /* ndef APU_VERSION_H */ From 33f6918caec5ca9fb05b512d060dd2b0831a5630 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 26 May 2013 23:59:17 +0000 Subject: [PATCH 7263/7878] Update copyright year. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1486494 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_version.h b/include/apr_version.h index 95b26110756..aa08a4dc246 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -38,7 +38,7 @@ */ -#define APR_COPYRIGHT "Copyright (c) 2011 The Apache Software " \ +#define APR_COPYRIGHT "Copyright (c) 2013 The Apache Software " \ "Foundation or its licensors, as applicable." /* The numeric compile-time version constants. These constants are the From fc644fa9c1d3e8a7b7dcb466d2450452ff3cbfab Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Mon, 27 May 2013 00:00:55 +0000 Subject: [PATCH 7264/7878] Use SVN revision for NetWare dev builds version info. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1486495 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 8 ++++++-- build/nw_ver.awk | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 4ca51496bdd..cba5d686052 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -114,9 +114,8 @@ endif ifneq "$(MAKECMDGOALS)" "clean" ifneq "$(findstring clobber_,$(MAKECMDGOALS))" "clobber_" $(APRBUILD)/NWGNUversion.inc : $(APRBUILD)/nw_ver.awk $(APR)/include/apr_version.h -# @echo Generating $@ @echo $(DL)GEN $@$(DL) - @$(AWK) -f $^ > $@ + $(AWK) -f $^ $(APR)/.svn/all-wcprops > $@ -include $(APRBUILD)/NWGNUversion.inc @@ -129,6 +128,11 @@ VERSION_MAJMIN = 20 endif endif endif +ifeq "$(USE_SVNREV)" "1" +ifneq "$(strip $(SVN_REVISION))" "" +CFLAGS += -DAPR_IS_DEV_STRING=\"$(SVN_REVISION)\" +endif +endif ifeq "$(words $(strip $(TARGET_nlm)))" "1" INCLUDE_BLDCMDS = 1 diff --git a/build/nw_ver.awk b/build/nw_ver.awk index e83ea9689d5..405c847bdae 100644 --- a/build/nw_ver.awk +++ b/build/nw_ver.awk @@ -31,7 +31,18 @@ BEGIN { ver_devbuild = 1; } } - ver_str = ver_major "." ver_minor "." ver_patch (ver_devbuild ? "-dev" : ""); + if (ver_devbuild) { + ver_dev = "-dev" + if (ARGV[2]) { + while ((getline < ARGV[2]) > 0) { + if (match ($0, /^\/repos\/asf\/!svn\/ver\/[0-9]+\/apr\/(apr|apr-util)\/(trunk|branches\/[0-9]\.[0-9]\.x)$/)) { + gsub(/^\/repos\/asf\/!svn\/ver\/|\/apr\/(apr|apr-util)\/(trunk|branches\/[0-9]\.[0-9]\.x)$/, "", $0); + ver_dev = svn_rev = "-r" $0; + } + } + } + } + if (WANTED) { ver_num = ver_major * 1000000 + ver_minor * 1000 + ver_patch; if (ver_num < WANTED) { @@ -46,9 +57,12 @@ BEGIN { } } else { ver_nlm = ver_major "," ver_minor "," ver_patch; + ver_str = ver_major "." ver_minor "." ver_patch ver_dev; print "VERSION = " ver_nlm ""; print "VERSION_STR = " ver_str ""; print "VERSION_MAJMIN = " ver_major ver_minor ""; + # print "COPYRIGHT_STR = " copyright_str ""; + print "SVN_REVISION = " svn_rev ""; } } From 7c342971c2e963e54b462087efbfabfbcf1b9a4e Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Tue, 28 May 2013 21:05:50 +0000 Subject: [PATCH 7265/7878] NetWare build: minor change to make the script usable for 1.x. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1487119 13f79535-47bb-0310-9956-ffa450edef68 --- build/nw_ver.awk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/nw_ver.awk b/build/nw_ver.awk index 405c847bdae..0285e990022 100644 --- a/build/nw_ver.awk +++ b/build/nw_ver.awk @@ -18,16 +18,16 @@ BEGIN { # fetch APR version numbers from input file and write them to STDOUT while ((getline < ARGV[1]) > 0) { - if (match ($0, /^#define APR_MAJOR_VERSION/)) { + if (match ($0, /^#define AP._MAJOR_VERSION/)) { ver_major = $3; } - else if (match ($0, /^#define APR_MINOR_VERSION/)) { + else if (match ($0, /^#define AP._MINOR_VERSION/)) { ver_minor = $3; } - else if (match ($0, /^#define APR_PATCH_VERSION/)) { + else if (match ($0, /^#define AP._PATCH_VERSION/)) { ver_patch = $3; } - else if (match ($0, /^#define APR_IS_DEV_VERSION/)) { + else if (match ($0, /^#define AP._IS_DEV_VERSION/)) { ver_devbuild = 1; } } From 9eae9e96f15e1f216162810cef4271a439a74223 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 30 May 2013 09:28:22 +0000 Subject: [PATCH 7266/7878] * network_io/unix/multicast.c (do_mcast_opt): Fix regression in handling IPv4 options introduced in r1309386. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1487796 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/multicast.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index d6e2ca7b7fc..e4e8c80f15d 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -196,12 +196,17 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock, return rv; } +/* Set the IP_MULTICAST_TTL or IP_MULTICAST_LOOP option, or IPv6 + * equivalents, for the socket, to the given value. Note that this + * function *only works* for those particular option types. */ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, - apr_uint32_t value) + apr_byte_t value) { apr_status_t rv = APR_SUCCESS; if (sock_is_ipv4(sock)) { + /* For the IP_MULTICAST_* options, this must be a (char *) + * pointer. */ if (setsockopt(sock->socketdes, IPPROTO_IP, type, (const void *) &value, sizeof(value)) == -1) { rv = errno; @@ -209,6 +214,9 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, } #if APR_HAVE_IPV6 else if (sock_is_ipv6(sock)) { + /* For the IPV6_* options, an (int *) pointer must be used. */ + int ivalue = value; + if (type == IP_MULTICAST_TTL) { type = IPV6_MULTICAST_HOPS; } @@ -220,7 +228,7 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, } if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - (const void *) &value, sizeof(value)) == -1) { + (const void *) &ivalue, sizeof(ivalue)) == -1) { rv = errno; } } From d6e9a514fd95aa043b82f02808f6674efc07f081 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 4 Jun 2013 17:02:17 +0000 Subject: [PATCH 7267/7878] Add the apr_escape interface. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1489517 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + Makefile.in | 14 +- encoding/apr_escape.c | 1156 +++++++++++++++++++++++++++++++++++++++++ include/apr_escape.h | 375 +++++++++++++ test/Makefile.in | 2 +- test/abts_tests.h | 1 + test/testescape.c | 255 +++++++++ test/testutil.h | 1 + tools/gen_test_char.c | 134 +++++ 9 files changed, 1937 insertions(+), 3 deletions(-) create mode 100644 encoding/apr_escape.c create mode 100644 include/apr_escape.h create mode 100644 test/testescape.c create mode 100644 tools/gen_test_char.c diff --git a/CHANGES b/CHANGES index fc7ed77132e..6ae11ae4319 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add the apr_escape interface. [Graham Leggett] + *) Add support to apr_memcache for unix domain sockets. PR 54573 [Remi Gacogne ] diff --git a/Makefile.in b/Makefile.in index 343920f35a3..87cdc5f84b7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -43,7 +43,7 @@ APRUTIL_EXPORT_LIBS = @APRUTIL_EXPORT_LIBS@ # building the entire package. # TARGETS = $(TARGET_LIB) $(APR_DSO_MODULES) \ - apr.exp apr-config.out build/apr_rules.out + include/private/apr_escape_test_char.h apr.exp apr-config.out build/apr_rules.out LT_VERSION = @LT_VERSION@ @@ -52,7 +52,7 @@ LT_VERSION = @LT_VERSION@ @INCLUDE_OUTPUTS@ CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ - build/apr_rules.out + build/apr_rules.out tools/gen_test_char DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ libtool $(APR_CONFIG) build/apr_rules.mk apr.pc \ @@ -157,5 +157,15 @@ check: $(TARGET_LIB) etags: etags `find . -name '*.[ch]'` +OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS) +tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char) + $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS) + +include/private/apr_escape_test_char.h: tools/gen_test_char + tools/gen_test_char > include/private/apr_escape_test_char.h + +LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LT_LDFLAGS) \ + @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@ + # DO NOT REMOVE docs: $(INCDIR)/*.h diff --git a/encoding/apr_escape.c b/encoding/apr_escape.c new file mode 100644 index 00000000000..0516e276c4f --- /dev/null +++ b/encoding/apr_escape.c @@ -0,0 +1,1156 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* escape/unescape functions. + * + * These functions perform various escaping operations, and are provided in + * pairs, a function to query the length of and escape existing buffers, as + * well as companion functions to perform the same process to memory + * allocated from a pool. + * + * The API is designed to have the smallest possible RAM footprint, and so + * will only allocate the exact amount of RAM needed for each conversion. + */ + +#include "apr_escape.h" +#include "apr_escape_test_char.h" +#include "apr_lib.h" +#include "apr_strings.h" + +/* helper for Latin1 <-> entity encoding */ +#if APR_CHARSET_EBCDIC +#include "apr_xlate.h" +#define RAW_ASCII_CHAR(ch) apr_xlate_conv_byte(ap_hdrs_from_ascii, \ + (unsigned char)ch) +#else /* APR_CHARSET_EBCDIC */ +#define RAW_ASCII_CHAR(ch) (ch) +#endif /* !APR_CHARSET_EBCDIC */ + +/* we assume the folks using this ensure 0 <= c < 256... which means + * you need a cast to (unsigned char) first, you can't just plug a + * char in here and get it to work, because if char is signed then it + * will first be sign extended. + */ +#define TEST_CHAR(c, f) (test_char_table[(unsigned)(c)] & (f)) + +APR_DECLARE(apr_status_t) apr_escape_shell(char *escaped, const char *str, + apr_ssize_t slen, apr_size_t *len) +{ + unsigned char *d; + const unsigned char *s; + apr_size_t size = 1; + int found = 0; + + d = (unsigned char *) escaped; + s = (const unsigned char *) str; + + if (s) { + if (d) { + for (; *s && slen; ++s, slen--) { +#if defined(OS2) || defined(WIN32) + /* + * Newlines to Win32/OS2 CreateProcess() are ill advised. + * Convert them to spaces since they are effectively white + * space to most applications + */ + if (*s == '\r' || *s == '\n') { + if (d) { + *d++ = ' '; + found = 1; + } + continue; + } +#endif + if (TEST_CHAR(*s, T_ESCAPE_SHELL_CMD)) { + *d++ = '\\'; + size++; + found = 1; + } + *d++ = *s; + size++; + } + *d = '\0'; + } + else { + for (; *s && slen; ++s, slen--) { + if (TEST_CHAR(*s, T_ESCAPE_SHELL_CMD)) { + size++; + found = 1; + } + size++; + } + } + } + + if (len) { + *len = size; + } + if (!found) { + return APR_NOTFOUND; + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *) apr_pescape_shell(apr_pool_t *p, const char *str) +{ + apr_size_t len; + + switch (apr_escape_shell(NULL, str, APR_ESCAPE_STRING, &len)) { + case APR_SUCCESS: { + char *cmd = apr_palloc(p, len); + apr_escape_shell(cmd, str, APR_ESCAPE_STRING, NULL); + return cmd; + } + case APR_NOTFOUND: { + break; + } + } + + return str; +} + +static char x2c(const char *what) +{ + register char digit; + +#if !APR_CHARSET_EBCDIC + digit = + ((what[0] >= 'A') ? ((what[0] & 0xdf) - 'A') + 10 : (what[0] - '0')); + digit *= 16; + digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A') + 10 : (what[1] - '0')); +#else /*APR_CHARSET_EBCDIC*/ + char xstr[5]; + xstr[0]='0'; + xstr[1]='x'; + xstr[2]=what[0]; + xstr[3]=what[1]; + xstr[4]='\0'; + digit = apr_xlate_conv_byte(ap_hdrs_from_ascii, + 0xFF & strtol(xstr, NULL, 16)); +#endif /*APR_CHARSET_EBCDIC*/ + return (digit); +} + +APR_DECLARE(apr_status_t) apr_unescape_url(char *escaped, const char *url, + apr_ssize_t slen, const char *forbid, const char *reserved, int plus, + apr_size_t *len) +{ + apr_size_t size = 1; + int found = 0; + const char *s = (const char *) url; + char *d = (char *) escaped; + register int badesc, badpath; + + if (!url) { + return APR_NOTFOUND; + } + + badesc = 0; + badpath = 0; + if (s) { + if (d) { + for (; *s && slen; ++s, d++, slen--) { + if (plus && *s == '+') { + *d = ' '; + found = 1; + } + else if (*s != '%') { + *d = *s; + } + else { + if (!apr_isxdigit(*(s + 1)) || !apr_isxdigit(*(s + 2))) { + badesc = 1; + *d = '%'; + } + else { + char decoded; + decoded = x2c(s + 1); + if ((decoded == '\0') + || (forbid && strchr(forbid, decoded))) { + badpath = 1; + *d = decoded; + s += 2; + slen -= 2; + } + else if (reserved && strchr(reserved, decoded)) { + *d++ = *s++; + *d++ = *s++; + *d = *s; + size += 2; + } + else { + *d = decoded; + s += 2; + slen -= 2; + found = 1; + } + } + } + size++; + } + *d = '\0'; + } + else { + for (; *s && slen; ++s, slen--) { + if (plus && *s == '+') { + found = 1; + } + else if (*s != '%') { + /* character unchanged */ + } + else { + if (!apr_isxdigit(*(s + 1)) || !apr_isxdigit(*(s + 2))) { + badesc = 1; + } + else { + char decoded; + decoded = x2c(s + 1); + if ((decoded == '\0') + || (forbid && strchr(forbid, decoded))) { + badpath = 1; + s += 2; + slen -= 2; + } + else if (reserved && strchr(reserved, decoded)) { + s += 2; + slen -= 2; + size += 2; + } + else { + s += 2; + slen -= 2; + found = 1; + } + } + } + size++; + } + } + } + + if (len) { + *len = size; + } + if (badesc) { + return APR_EINVAL; + } + else if (badpath) { + return APR_BADCH; + } + else if (!found) { + return APR_NOTFOUND; + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *) apr_punescape_url(apr_pool_t *p, const char *url, + const char *forbid, const char *reserved, int plus) +{ + apr_size_t len; + + switch (apr_unescape_url(NULL, url, APR_ESCAPE_STRING, forbid, reserved, + plus, &len)) { + case APR_SUCCESS: { + char *buf = apr_palloc(p, len); + apr_unescape_url(buf, url, APR_ESCAPE_STRING, forbid, reserved, plus, + NULL); + return buf; + } + case APR_EINVAL: + case APR_BADCH: { + return NULL; + } + case APR_NOTFOUND: { + break; + } + } + + return url; +} + +/* c2x takes an unsigned, and expects the caller has guaranteed that + * 0 <= what < 256... which usually means that you have to cast to + * unsigned char first, because (unsigned)(char)(x) first goes through + * signed extension to an int before the unsigned cast. + * + * The reason for this assumption is to assist gcc code generation -- + * the unsigned char -> unsigned extension is already done earlier in + * both uses of this code, so there's no need to waste time doing it + * again. + */ +static const char c2x_table[] = "0123456789abcdef"; + +static APR_INLINE unsigned char *c2x(unsigned what, unsigned char prefix, + unsigned char *where) +{ +#if APR_CHARSET_EBCDIC + what = apr_xlate_conv_byte(ap_hdrs_to_ascii, (unsigned char)what); +#endif /*APR_CHARSET_EBCDIC*/ + *where++ = prefix; + *where++ = c2x_table[what >> 4]; + *where++ = c2x_table[what & 0xf]; + return where; +} + +APR_DECLARE(apr_status_t) apr_escape_path_segment(char *escaped, + const char *str, apr_ssize_t slen, apr_size_t *len) +{ + apr_size_t size = 1; + int found = 0; + const unsigned char *s = (const unsigned char *) str; + unsigned char *d = (unsigned char *) escaped; + unsigned c; + + if (s) { + if (d) { + while ((c = *s) && slen) { + if (TEST_CHAR(c, T_ESCAPE_PATH_SEGMENT)) { + d = c2x(c, '%', d); + size += 2; + found = 1; + } + else { + *d++ = c; + } + ++s; + size++; + slen--; + } + *d = '\0'; + } + else { + while ((c = *s) && slen) { + if (TEST_CHAR(c, T_ESCAPE_PATH_SEGMENT)) { + size += 2; + found = 1; + } + ++s; + size++; + slen--; + } + } + } + + if (len) { + *len = size; + } + if (!found) { + return APR_NOTFOUND; + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *) apr_pescape_path_segment(apr_pool_t *p, + const char *str) +{ + apr_size_t len; + + switch (apr_escape_path_segment(NULL, str, APR_ESCAPE_STRING, &len)) { + case APR_SUCCESS: { + char *cmd = apr_palloc(p, len); + apr_escape_path_segment(cmd, str, APR_ESCAPE_STRING, NULL); + return cmd; + } + case APR_NOTFOUND: { + break; + } + } + + return str; +} + +APR_DECLARE(apr_status_t) apr_escape_path(char *escaped, const char *path, + apr_ssize_t slen, int partial, apr_size_t *len) +{ + apr_size_t size = 1; + int found = 0; + const unsigned char *s = (const unsigned char *) path; + unsigned char *d = (unsigned char *) escaped; + unsigned c; + + if (!path) { + return APR_NOTFOUND; + } + + if (!partial) { + const char *colon = strchr(path, ':'); + const char *slash = strchr(path, '/'); + + if (colon && (!slash || colon < slash)) { + if (d) { + *d++ = '.'; + *d++ = '/'; + } + size += 2; + found = 1; + } + } + if (d) { + while ((c = *s) && slen) { + if (TEST_CHAR(c, T_OS_ESCAPE_PATH)) { + d = c2x(c, '%', d); + } + else { + *d++ = c; + } + ++s; + size++; + slen--; + } + *d = '\0'; + } + else { + while ((c = *s) && slen) { + if (TEST_CHAR(c, T_OS_ESCAPE_PATH)) { + size += 2; + found = 1; + } + ++s; + size++; + slen--; + } + } + + if (len) { + *len = size; + } + if (!found) { + return APR_NOTFOUND; + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *) apr_pescape_path(apr_pool_t *p, const char *str, + int partial) +{ + apr_size_t len; + + switch (apr_escape_path(NULL, str, APR_ESCAPE_STRING, partial, &len)) { + case APR_SUCCESS: { + char *path = apr_palloc(p, len); + apr_escape_path(path, str, APR_ESCAPE_STRING, partial, NULL); + return path; + } + case APR_NOTFOUND: { + break; + } + } + + return str; +} + +APR_DECLARE(apr_status_t) apr_escape_urlencoded(char *escaped, const char *str, + apr_ssize_t slen, apr_size_t *len) +{ + apr_size_t size = 1; + int found = 0; + const unsigned char *s = (const unsigned char *) str; + unsigned char *d = (unsigned char *) escaped; + unsigned c; + + if (s) { + if (d) { + while ((c = *s) && slen) { + if (TEST_CHAR(c, T_ESCAPE_URLENCODED)) { + d = c2x(c, '%', d); + size += 2; + found = 1; + } + else if (c == ' ') { + *d++ = '+'; + found = 1; + } + else { + *d++ = c; + } + ++s; + size++; + slen--; + } + *d = '\0'; + } + else { + while ((c = *s) && slen) { + if (TEST_CHAR(c, T_ESCAPE_URLENCODED)) { + size += 2; + found = 1; + } + else if (c == ' ') { + found = 1; + } + ++s; + size++; + slen--; + } + } + } + + if (len) { + *len = size; + } + if (!found) { + return APR_NOTFOUND; + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *) apr_pescape_urlencoded(apr_pool_t *p, const char *str) +{ + apr_size_t len; + + switch (apr_escape_urlencoded(NULL, str, APR_ESCAPE_STRING, &len)) { + case APR_SUCCESS: { + char *encoded = apr_palloc(p, len); + apr_escape_urlencoded(encoded, str, APR_ESCAPE_STRING, NULL); + return encoded; + } + case APR_NOTFOUND: { + break; + } + } + + return str; +} + +APR_DECLARE(apr_status_t) apr_escape_entity(char *escaped, const char *str, + apr_ssize_t slen, int toasc, apr_size_t *len) +{ + apr_size_t size = 1; + int found = 0; + const unsigned char *s = (const unsigned char *) str; + unsigned char *d = (unsigned char *) escaped; + unsigned c; + + if (s) { + if (d) { + while ((c = *s) && slen) { + if (TEST_CHAR(c, T_ESCAPE_XML)) { + switch (c) { + case '>': { + memcpy(d, ">", 4); + size += 4; + d += 4; + break; + } + case '<': { + memcpy(d, "<", 4); + size += 4; + d += 4; + break; + } + case '&': { + memcpy(d, "&", 5); + size += 5; + d += 5; + break; + } + case '\"': { + memcpy(d, """, 6); + size += 6; + d += 6; + break; + } + case '\'': { + memcpy(d, "'", 6); + size += 6; + d += 6; + break; + } + } + found = 1; + } + else if (toasc && !apr_isascii(c)) { + int offset = apr_snprintf((char *) d, 6, "&#%3.3d;", c); + size += offset; + d += offset; + found = 1; + } + else { + *d++ = c; + size++; + } + ++s; + slen--; + } + *d = '\0'; + } + else { + while ((c = *s) && slen) { + if (TEST_CHAR(c, T_ESCAPE_XML)) { + switch (c) { + case '>': { + size += 4; + break; + } + case '<': { + size += 4; + break; + } + case '&': { + size += 5; + break; + } + case '\"': { + size += 6; + break; + } + case '\'': { + size += 6; + break; + } + } + found = 1; + } + else if (toasc && !apr_isascii(c)) { + char buf[8]; + size += apr_snprintf(buf, 6, "&#%3.3d;", c); + found = 1; + } + else { + size++; + } + ++s; + slen--; + } + } + } + + if (len) { + *len = size; + } + if (!found) { + return APR_NOTFOUND; + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *) apr_pescape_entity(apr_pool_t *p, const char *str, + int toasc) +{ + apr_size_t len; + + switch (apr_escape_entity(NULL, str, APR_ESCAPE_STRING, toasc, &len)) { + case APR_SUCCESS: { + char *cmd = apr_palloc(p, len); + apr_escape_entity(cmd, str, APR_ESCAPE_STRING, toasc, NULL); + return cmd; + } + case APR_NOTFOUND: { + break; + } + } + + return str; +} + +/* maximum length of any ISO-LATIN-1 HTML entity name. */ +#define MAXENTLEN (6) + +APR_DECLARE(apr_status_t) apr_unescape_entity(char *unescaped, const char *str, + apr_ssize_t slen, apr_size_t *len) +{ + int found = 0; + apr_size_t size = 1; + int val, i, j; + char *d = unescaped; + const char *s = str; + const char *ents; + static const char * const entlist[MAXENTLEN + 1] = + { + NULL, /* 0 */ + NULL, /* 1 */ + "lt\074gt\076", /* 2 */ + "amp\046ETH\320eth\360", /* 3 */ + "quot\042Auml\304Euml\313Iuml\317Ouml\326Uuml\334auml\344euml" + "\353iuml\357ouml\366uuml\374yuml\377", /* 4 */ + "Acirc\302Aring\305AElig\306Ecirc\312Icirc\316Ocirc\324Ucirc" + "\333THORN\336szlig\337acirc\342aring\345aelig\346ecirc\352" + "icirc\356ocirc\364ucirc\373thorn\376", /* 5 */ + "Agrave\300Aacute\301Atilde\303Ccedil\307Egrave\310Eacute\311" + "Igrave\314Iacute\315Ntilde\321Ograve\322Oacute\323Otilde" + "\325Oslash\330Ugrave\331Uacute\332Yacute\335agrave\340" + "aacute\341atilde\343ccedil\347egrave\350eacute\351igrave" + "\354iacute\355ntilde\361ograve\362oacute\363otilde\365" + "oslash\370ugrave\371uacute\372yacute\375" /* 6 */ + }; + + if (s) { + if (d) { + for (; *s != '\0' && slen; s++, d++, size++, slen--) { + if (*s != '&') { + *d = *s; + continue; + } + /* find end of entity */ + for (i = 1; s[i] != ';' && s[i] != '\0' && (slen - i) != 0; + i++) { + continue; + } + + if (s[i] == '\0' || (slen - i) == 0) { /* treat as normal data */ + *d = *s; + continue; + } + + /* is it numeric ? */ + if (s[1] == '#') { + for (j = 2, val = 0; j < i && apr_isdigit(s[j]); j++) { + val = val * 10 + s[j] - '0'; + } + s += i; + if (j < i || val <= 8 || (val >= 11 && val <= 31) + || (val >= 127 && val <= 160) || val >= 256) { + d--; /* no data to output */ + size--; + } + else { + *d = RAW_ASCII_CHAR(val); + found = 1; + } + } + else { + j = i - 1; + if (j > MAXENTLEN || entlist[j] == NULL) { + /* wrong length */ + *d = '&'; + continue; /* skip it */ + } + for (ents = entlist[j]; *ents != '\0'; ents += i) { + if (strncmp(s + 1, ents, j) == 0) { + break; + } + } + + if (*ents == '\0') { + *d = '&'; /* unknown */ + } + else { + *d = RAW_ASCII_CHAR(((const unsigned char *) ents)[j]); + s += i; + slen -= i; + found = 1; + } + } + } + *d = '\0'; + } + else { + for (; *s != '\0' && slen; s++, size++, slen--) { + if (*s != '&') { + continue; + } + /* find end of entity */ + for (i = 1; s[i] != ';' && s[i] != '\0' && (slen - i) != 0; + i++) { + continue; + } + + if (s[i] == '\0' || (slen - i) == 0) { /* treat as normal data */ + continue; + } + + /* is it numeric ? */ + if (s[1] == '#') { + for (j = 2, val = 0; j < i && apr_isdigit(s[j]); j++) { + val = val * 10 + s[j] - '0'; + } + s += i; + if (j < i || val <= 8 || (val >= 11 && val <= 31) + || (val >= 127 && val <= 160) || val >= 256) { + /* no data to output */ + size--; + } + else { + found = 1; + } + } + else { + j = i - 1; + if (j > MAXENTLEN || entlist[j] == NULL) { + /* wrong length */ + continue; /* skip it */ + } + for (ents = entlist[j]; *ents != '\0'; ents += i) { + if (strncmp(s + 1, ents, j) == 0) { + break; + } + } + + if (*ents == '\0') { + /* unknown */ + } + else { + s += i; + slen -= i; + found = 1; + } + } + } + } + } + + if (len) { + *len = size; + } + if (!found) { + return APR_NOTFOUND; + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *) apr_punescape_entity(apr_pool_t *p, const char *str) +{ + apr_size_t len; + + switch (apr_unescape_entity(NULL, str, APR_ESCAPE_STRING, &len)) { + case APR_SUCCESS: { + char *cmd = apr_palloc(p, len); + apr_unescape_entity(cmd, str, APR_ESCAPE_STRING, NULL); + return cmd; + } + case APR_NOTFOUND: { + break; + } + } + + return str; +} + +APR_DECLARE(apr_status_t) apr_escape_echo(char *escaped, const char *str, + apr_ssize_t slen, int quote, apr_size_t *len) +{ + apr_size_t size = 1; + int found = 0; + const unsigned char *s = (const unsigned char *) str; + unsigned char *d = (unsigned char *) escaped; + unsigned c; + + if (s) { + if (d) { + while ((c = *s) && slen) { + if (TEST_CHAR(c, T_ESCAPE_ECHO)) { + *d++ = '\\'; + size++; + switch (c) { + case '\a': + *d++ = 'a'; + size++; + found = 1; + break; + case '\b': + *d++ = 'b'; + size++; + found = 1; + break; + case '\e': + *d++ = 'e'; + size++; + found = 1; + break; + case '\f': + *d++ = 'f'; + size++; + found = 1; + break; + case '\n': + *d++ = 'n'; + size++; + found = 1; + break; + case '\r': + *d++ = 'r'; + size++; + found = 1; + break; + case '\t': + *d++ = 't'; + size++; + found = 1; + break; + case '\v': + *d++ = 'v'; + size++; + found = 1; + break; + case '\\': + *d++ = '\\'; + size++; + found = 1; + break; + case '"': + if (quote) { + *d++ = c; + size++; + found = 1; + } + else { + d[-1] = c; + } + break; + default: + c2x(c, 'x', d); + d += 3; + size += 3; + found = 1; + break; + } + } + else { + *d++ = c; + size++; + } + ++s; + slen--; + } + *d = '\0'; + } + else { + while ((c = *s) && slen) { + if (TEST_CHAR(c, T_ESCAPE_ECHO)) { + size++; + switch (c) { + case '\a': + case '\b': + case '\e': + case '\f': + case '\n': + case '\r': + case '\t': + case '\v': + case '\\': + size++; + found = 1; + break; + case '"': + if (quote) { + size++; + found = 1; + } + break; + default: + size += 3; + found = 1; + break; + } + } + else { + size++; + } + ++s; + slen--; + } + } + } + + if (len) { + *len = size; + } + if (!found) { + return APR_NOTFOUND; + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *) apr_pescape_echo(apr_pool_t *p, const char *str, + int quote) +{ + apr_size_t len; + + switch (apr_escape_echo(NULL, str, APR_ESCAPE_STRING, quote, &len)) { + case APR_SUCCESS: { + char *cmd = apr_palloc(p, len); + apr_escape_echo(cmd, str, APR_ESCAPE_STRING, quote, NULL); + return cmd; + } + case APR_NOTFOUND: { + break; + } + } + + return str; +} + +APR_DECLARE(apr_status_t) apr_escape_hex(char *dest, const void *src, + apr_size_t srclen, int colon, apr_size_t *len) +{ + const unsigned char *in = src; + apr_size_t size; + + if (!src) { + return APR_NOTFOUND; + } + + if (dest) { + for (size = 0; size < srclen; size++) { + if (colon && size) { + *dest++ = ':'; + } + *dest++ = c2x_table[in[size] >> 4]; + *dest++ = c2x_table[in[size] & 0xf]; + } + *dest = '\0'; + } + + if (len) { + if (colon && srclen) { + *len = srclen * 3; + } + else { + *len = srclen * 2 + 1; + } + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *) apr_pescape_hex(apr_pool_t *p, const void *src, + apr_size_t srclen, int colon) +{ + apr_size_t len; + + switch (apr_escape_hex(NULL, src, srclen, colon, &len)) { + case APR_SUCCESS: { + char *cmd = apr_palloc(p, len); + apr_escape_hex(cmd, src, srclen, colon, NULL); + return cmd; + } + case APR_NOTFOUND: { + break; + } + } + + return src; +} + +APR_DECLARE(apr_status_t) apr_unescape_hex(void *dest, const char *str, + apr_ssize_t slen, int colon, apr_size_t *len) +{ + apr_size_t size = 0; + int flip = 0; + const unsigned char *s = (const unsigned char *) str; + unsigned char *d = (unsigned char *) dest; + unsigned c; + unsigned char u = 0; + + if (s) { + if (d) { + while ((c = *s) && slen) { + + if (!flip) { + u = 0; + } + + if (colon && c == ':' && !flip) { + ++s; + slen--; + continue; + } + else if (apr_isdigit(c)) { + u |= c - '0'; + } + else if (apr_isupper(c) && c <= 'F') { + u |= c - ('A' - 10); + } + else if (apr_islower(c) && c <= 'f') { + u |= c - ('a' - 10); + } + else { + return APR_BADCH; + } + + if (flip) { + *d++ = u; + size++; + } + else { + u <<= 4; + *d = u; + } + flip = !flip; + + ++s; + slen--; + } + } + else { + while ((c = *s) && slen) { + + if (colon && c == ':' && !flip) { + ++s; + slen--; + continue; + } + else if (apr_isdigit(c)) { + /* valid */ + } + else if (apr_isupper(c) && c <= 'F') { + /* valid */ + } + else if (apr_islower(c) && c <= 'f') { + /* valid */ + } + else { + return APR_BADCH; + } + + if (flip) { + size++; + } + flip = !flip; + + ++s; + slen--; + } + } + } + + if (len) { + *len = size; + } + if (!s) { + return APR_NOTFOUND; + } + + return APR_SUCCESS; +} + +APR_DECLARE(const void *) apr_punescape_hex(apr_pool_t *p, const char *str, + int colon, apr_size_t *len) +{ + apr_size_t size; + + switch (apr_unescape_hex(NULL, str, APR_ESCAPE_STRING, colon, &size)) { + case APR_SUCCESS: { + void *cmd = apr_palloc(p, size); + apr_unescape_hex(cmd, str, APR_ESCAPE_STRING, colon, len); + return cmd; + } + case APR_BADCH: + case APR_NOTFOUND: { + break; + } + } + + return NULL; +} diff --git a/include/apr_escape.h b/include/apr_escape.h new file mode 100644 index 00000000000..bc77c3c9d4c --- /dev/null +++ b/include/apr_escape.h @@ -0,0 +1,375 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file apr_escape.h + * @brief APR-UTIL Escaping + */ +#ifndef APR_ESCAPE_H +#define APR_ESCAPE_H +#include "apu.h" +#include "apr_general.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup APR_Util_Escaping Escape functions + * @ingroup APR + * @{ + */ + +/* Simple escape/unescape functions. + * + */ + +/** + * When passing a string to one of the escape functions, this value can be + * passed to indicate a string-valued key, and have the length computed + * automatically. + */ +#define APR_ESCAPE_STRING (-1) + +/** + * Perform shell escaping on the provided string. + * + * Shell escaping causes characters to be prefixed with a '\' character. + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param str The original string + * @param slen The length of the original string, or APR_ESCAPE_STRING + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were + * detected or the string was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_shell(char *escaped, const char *str, + apr_ssize_t slen, apr_size_t *len); + +/** + * Perform shell escaping on the provided string, returning the result + * from the pool. + * + * Shell escaping causes characters to be prefixed with a '\' character. + * + * If no characters were escaped, the original string is returned. + * @param p Pool to allocate from + * @param str The original string + * @return the encoded string, allocated from the pool, or the original + * string if no escaping took place or the string was NULL. + */ +APR_DECLARE(const char *) apr_pescape_shell(apr_pool_t *p, const char *str) + __attribute__((nonnull(1))); + +/* + * Unescapes a URL, leaving reserved characters intact. + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param url String to be unescaped + * @param slen The length of the original url, or APR_ESCAPE_STRING + * @param forbid Optional list of forbidden characters, in addition to + * 0x00 + * @param reserved Optional list of reserved characters that will be + * left unescaped + * @param plus If non zero, '+' is converted to ' ' as per + * application/x-www-form-urlencoded encoding + * @param len If set, the length of the escaped string will be returned + * @return APR_SUCCESS on success, APR_NOTFOUND if no characters are + * decoded or the string is NULL, APR_EINVAL if a bad escape sequence is + * found, APR_BADCH if a character on the forbid list is found. + */ +APR_DECLARE(apr_status_t) apr_unescape_url(char *escaped, const char *url, + apr_ssize_t slen, const char *forbid, const char *reserved, int plus, + apr_size_t *len); + +/* + * Unescapes a URL, leaving reserved characters intact, returning the + * result from a pool. + * @param p Pool to allocate from + * @param url String to be unescaped in place + * @param forbid Optional list of forbidden characters, in addition to + * 0x00 + * @param reserved Optional list of reserved characters that will be + * left unescaped + * @param plus If non zero, '+' is converted to ' ' as per + * application/x-www-form-urlencoded encoding + * @return A string allocated from the pool on success, the original string + * if no characters are decoded, or NULL if a bad escape sequence is found + * or if a character on the forbid list is found, or if the original string + * was NULL. + */ +APR_DECLARE(const char *) apr_punescape_url(apr_pool_t *p, const char *url, + const char *forbid, const char *reserved, int plus) + __attribute__((nonnull(1))); + +/** + * Escape a path segment, as defined in RFC1808. + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param str The original string + * @param slen The length of the original string, or APR_ESCAPE_STRING + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were + * detected or the string was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_path_segment(char *escaped, + const char *str, apr_ssize_t slen, apr_size_t *len); + +/** + * Escape a path segment, as defined in RFC1808, returning the result from a + * pool. + * @param p Pool to allocate from + * @param url String to be escaped + * @return A string allocated from the pool on success, the original string + * if no characters are encoded or the string is NULL. + */ +APR_DECLARE(const char *) apr_pescape_path_segment(apr_pool_t *p, + const char *str) __attribute__((nonnull(1))); + +/** + * Converts an OS path to a URL, in an OS dependent way, as defined in RFC1808. + * In all cases if a ':' occurs before the first '/' in the URL, the URL should + * be prefixed with "./" (or the ':' escaped). In the case of Unix, this means + * leaving '/' alone, but otherwise doing what escape_path_segment() does. For + * efficiency reasons, we don't use escape_path_segment(), which is provided for + * reference. Again, RFC 1808 is where this stuff is defined. + * + * If partial is set, os_escape_path() assumes that the path will be appended to + * something with a '/' in it (and thus does not prefix "./"). + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param str The original string + * @param slen The length of the original string, or APR_ESCAPE_STRING + * @param partial If non zero, suppresses the prepending of "./" + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were + * detected or if the string was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_path(char *escaped, const char *path, + apr_ssize_t slen, int partial, apr_size_t *len); + +/** + * Converts an OS path to a URL, in an OS dependent way, as defined in RFC1808, + * returning the result from a pool. + * + * In all cases if a ':' occurs before the first '/' in the URL, the URL should + * be prefixed with "./" (or the ':' escaped). In the case of Unix, this means + * leaving '/' alone, but otherwise doing what escape_path_segment() does. For + * efficiency reasons, we don't use escape_path_segment(), which is provided for + * reference. Again, RFC 1808 is where this stuff is defined. + * + * If partial is set, os_escape_path() assumes that the path will be appended to + * something with a '/' in it (and thus does not prefix "./"). + * @param p Pool to allocate from + * @param str The original string + * @param partial If non zero, suppresses the prepending of "./" + * @return A string allocated from the pool on success, the original string + * if no characters are encoded or if the string was NULL. + */ +APR_DECLARE(const char *) apr_pescape_path(apr_pool_t *p, const char *str, + int partial) __attribute__((nonnull(1))); + +/** + * Urlencode a string, as defined in + * http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1. + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param str The original string + * @param slen The length of the original string, or APR_ESCAPE_STRING + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were + * detected or if the stirng was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_urlencoded(char *escaped, const char *str, + apr_ssize_t slen, apr_size_t *len); + +/** + * Urlencode a string, as defined in + * http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1, returning + * the result from a pool. + * @param p Pool to allocate from + * @param url String to be escaped + * @return A string allocated from the pool on success, the original string + * if no characters are encoded or if the string was NULL. + */ +APR_DECLARE(const char *) apr_pescape_urlencoded(apr_pool_t *p, + const char *str) __attribute__((nonnull(1))); + +/** + * Apply entity encoding to a string. Characters are replaced as follows: + * '<' becomes '<', '>' becomes '>', '&' becomes '&', the + * double quote becomes '"" and the single quote becomes '''. + * + * If toasc is not zero, any non ascii character will be encoded as + * '%#ddd;', where ddd is the decimal code of the character. + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param str The original string + * @param slen The length of the original string, or APR_ESCAPE_STRING + * @param toasc If non zero, encode non ascii characters + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were + * detected or the string was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_entity(char *escaped, const char *str, + apr_ssize_t slen, int toasc, apr_size_t *len); + +/** + * Apply entity encoding to a string, returning the result from a pool. + * Characters are replaced as follows: '<' becomes '<', '>' becomes + * '>', '&' becomes '&', the double quote becomes '"" and the + * single quote becomes '''. + * @param p Pool to allocate from + * @param str The original string + * @param toasc If non zero, encode non ascii characters + * @return A string allocated from the pool on success, the original string + * if no characters are encoded or the string is NULL. + */ +APR_DECLARE(const char *) apr_pescape_entity(apr_pool_t *p, const char *str, + int toasc) __attribute__((nonnull(1))); + +/* + * Decodes html entities or numeric character references in a string. If + * the string to be unescaped is syntactically incorrect, then the + * following fixups will be made: + * unknown entities will be left undecoded; + * references to unused numeric characters will be deleted. + * In particular, � will not be decoded, but will be deleted. + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param str The original string + * @param slen The length of the original string, or APR_ESCAPE_STRING + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were + * detected or the string was NULL + */ +APR_DECLARE(apr_status_t) apr_unescape_entity(char *unescaped, const char *str, + apr_ssize_t slen, apr_size_t *len); + +/* + * Decodes html entities or numeric character references in a string. If + * the string to be unescaped is syntactically incorrect, then the + * following fixups will be made: + * unknown entities will be left undecoded; + * references to unused numeric characters will be deleted. + * In particular, � will not be decoded, but will be deleted. + * @param p Pool to allocate from + * @param str The original string + * @return A string allocated from the pool on success, the original string + * if no characters are encoded or the string is NULL. + */ +APR_DECLARE(const char *) apr_punescape_entity(apr_pool_t *p, const char *str) + __attribute__((nonnull(1))); + +/** + * Escape control characters in a string, as performed by the shell's + * 'echo' command. Characters are replaced as follows: + * \a alert (bell), \b backspace, \e an escape character, \f form feed, + * \n new line, \r carriage return, \t horizontal tab, \v vertical tab, + * \\ backslash. + * + * Any non ascii character will be encoded as '\xHH', where HH is the hex + * code of the character. + * + * If quote is not zero, the double quote character will also be escaped. + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param str The original string + * @param slen The length of the original string, or APR_ESCAPE_STRING + * @param quote If non zero, encode double quotes + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were + * detected or the string was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_echo(char *escaped, const char *str, + apr_ssize_t slen, int quote, apr_size_t *len); + +/** + * Escape control characters in a string, as performed by the shell's + * 'echo' command, and return the results from a pool. Characters are + * replaced as follows: \a alert (bell), \b backspace, \e an escape + * character, \f form feed, \n new line, \r carriage return, \t + * horizontal tab, \v vertical tab, \\ backslash. + * + * Any non ascii character will be encoded as '\xHH', where HH is the hex + * code of the character. + * + * If quote is not zero, the double quote character will also be escaped. + * @param p Pool to allocate from + * @param str The original string + * @param quote If non zero, encode double quotes + * @return A string allocated from the pool on success, the original string + * if no characters are encoded or the string is NULL. + */ +APR_DECLARE(const char *) apr_pescape_echo(apr_pool_t *p, const char *str, + int quote); + +/** + * Convert binary data to a hex encoding. + * @param dest The destination buffer, can be NULL + * @param src The original buffer + * @param slen The length of the original buffer + * @param colon If not zero, insert colon characters between hex digits. + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_hex(char *dest, const void *src, + apr_size_t srclen, int colon, apr_size_t *len); + +/** + * Convert binary data to a hex encoding, and return the results from a + * pool. + * @param p Pool to allocate from + * @param src The original buffer + * @param srclen The length of the original buffer + * @param colon If not zero, insert colon characters between hex digits. + * @return A zero padded buffer allocated from the pool on success, or + * NULL if src was NULL. + */ +APR_DECLARE(const char *) apr_pescape_hex(apr_pool_t *p, const void *src, + apr_size_t slen, int colon) __attribute__((nonnull(1))); + +/** + * Convert hex encoded string to binary data. + * @param dest The destination buffer, can be NULL + * @param src The original buffer + * @param slen The length of the original buffer + * @param colon If not zero, ignore colon characters between hex digits. + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH + * if a non hex character is present. + */ +APR_DECLARE(apr_status_t) apr_unescape_hex(void *dest, const char *str, + apr_ssize_t slen, int colon, apr_size_t *len); + +/** + * Convert hex encoding to binary data, and return the results from a pool. + * If the colon character appears between pairs of hex digits, it will be + * ignored. + * @param p Pool to allocate from + * @param str The original string + * @param colon If not zero, ignore colon characters between hex digits. + * @param len If present, returns the length of the final buffer + * @return A buffer allocated from the pool on success, or NULL if src was + * NULL, or a bad character was present. + */ +APR_DECLARE(const void *) apr_punescape_hex(apr_pool_t *p, const char *str, + int colon, apr_size_t *len); + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* !APR_ESCAPE_H */ diff --git a/test/Makefile.in b/test/Makefile.in index 83a88dd8acf..d0620934b52 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -35,7 +35,7 @@ TESTS = testtime.lo teststr.lo testvsn.lo testipsub.lo testshm.lo \ teststrmatch.lo testpass.lo testcrypto.lo testqueue.lo \ testbuckets.lo testxml.lo testdbm.lo testuuid.lo testmd5.lo \ testreslist.lo testbase64.lo testhooks.lo testlfsabi.lo \ - testlfsabi32.lo testlfsabi64.lo + testlfsabi32.lo testlfsabi64.lo testescape.lo OTHER_PROGRAMS = \ sendfile@EXEEXT@ \ diff --git a/test/abts_tests.h b/test/abts_tests.h index 09713659c8d..88a4a925c72 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -28,6 +28,7 @@ const struct testlist { {testdso}, {testdup}, {testenv}, + {testescape}, {testfile}, {testfilecopy}, {testfileinfo}, diff --git a/test/testescape.c b/test/testescape.c new file mode 100644 index 00000000000..bbe4ad8a55b --- /dev/null +++ b/test/testescape.c @@ -0,0 +1,255 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "apr_escape.h" +#include "apr_strings.h" + +#include "abts.h" +#include "testutil.h" + +static void test_escape(abts_case *tc, void *data) +{ + apr_pool_t *pool; + const char *src, *target; + const char *dest; + const void *vdest; + apr_size_t len, vlen; + + apr_pool_create(&pool, NULL); + + src = "Hello World &;`'\"|*?~<>^()[]{}$\\\n"; + target = "Hello World \\&\\;\\`\\'\\\"\\|\\*\\?\\~\\<\\>\\^\\(\\)\\[\\]\\{\\}\\$\\\\\\\n"; + dest = apr_pescape_shell(pool, src); + ABTS_ASSERT(tc, "shell escaped matches expected output", + (strcmp(dest, target) == 0)); + apr_escape_shell(NULL, src, APR_ESCAPE_STRING, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "Hello"; + dest = apr_punescape_url(pool, src, NULL, NULL, 0); + ABTS_PTR_EQUAL(tc, src, dest); + + src = "Hello"; + dest = apr_punescape_url(pool, src, NULL, NULL, 1); + ABTS_PTR_EQUAL(tc, src, dest); + + src = "Hello%20"; + dest = apr_punescape_url(pool, src, " ", NULL, 0); + ABTS_PTR_EQUAL(tc, NULL, dest); + + src = "Hello%20World"; + target = "Hello World"; + dest = apr_punescape_url(pool, src, NULL, NULL, 0); + ABTS_STR_EQUAL(tc, target, dest); + apr_unescape_url(NULL, src, APR_ESCAPE_STRING, NULL, NULL, 0, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "Hello+World"; + target = "Hello World"; + dest = apr_punescape_url(pool, src, NULL, NULL, 1); + ABTS_STR_EQUAL(tc, target, dest); + apr_unescape_url(NULL, src, APR_ESCAPE_STRING, NULL, NULL, 1, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "Hello%20World"; + target = "Hello%20World"; + dest = apr_punescape_url(pool, src, NULL, " ", 0); + ABTS_STR_EQUAL(tc, target, dest); + apr_unescape_url(NULL, src, APR_ESCAPE_STRING, NULL, " ", 0, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "Hello"; + dest = apr_pescape_path_segment(pool, src); + ABTS_PTR_EQUAL(tc, src, dest); + + src = "$-_.+!*'(),:@&=/~Hello World"; + target = "$-_.+!*'(),:@&=%2f~Hello%20World"; + dest = apr_pescape_path_segment(pool, src); + ABTS_STR_EQUAL(tc, target, dest); + apr_escape_path_segment(NULL, src, APR_ESCAPE_STRING, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "Hello"; + dest = apr_pescape_path(pool, src, 0); + ABTS_PTR_EQUAL(tc, src, dest); + + src = "$-_.+!*'(),:@&=/~Hello World"; + target = "./$-_.+!*'(),:@&=/~Hello%20World"; + dest = apr_pescape_path(pool, src, 0); + ABTS_STR_EQUAL(tc, target, dest); + apr_escape_path(NULL, src, APR_ESCAPE_STRING, 0, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "Hello"; + dest = apr_pescape_path(pool, src, 1); + ABTS_PTR_EQUAL(tc, src, dest); + + src = "$-_.+!*'(),:@&=/~Hello World"; + target = "$-_.+!*'(),:@&=/~Hello%20World"; + dest = apr_pescape_path(pool, src, 1); + ABTS_STR_EQUAL(tc, target, dest); + apr_escape_path(NULL, src, APR_ESCAPE_STRING, 1, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "Hello"; + dest = apr_pescape_urlencoded(pool, src); + ABTS_PTR_EQUAL(tc, src, dest); + + src = "$-_.+!*'(),:@&=/~Hello World"; + target = "%24-_.%2b%21*%27%28%29%2c%3a%40%26%3d%2f%7eHello+World"; + dest = apr_pescape_urlencoded(pool, src); + ABTS_STR_EQUAL(tc, target, dest); + apr_escape_urlencoded(NULL, src, APR_ESCAPE_STRING, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "Hello"; + dest = apr_pescape_entity(pool, src, 0); + ABTS_PTR_EQUAL(tc, src, dest); + + src = "\xFF<>&\'\"Hello World"; + target = "\xFF<>&'"Hello World"; + dest = apr_pescape_entity(pool, src, 0); + ABTS_STR_EQUAL(tc, target, dest); + apr_escape_entity(NULL, src, APR_ESCAPE_STRING, 0, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "Hello"; + dest = apr_pescape_entity(pool, src, 1); + ABTS_PTR_EQUAL(tc, src, dest); + + src = "\xFF<>&\'\"Hello World"; + target = "ÿ<>&'"Hello World"; + dest = apr_pescape_entity(pool, src, 1); + ABTS_STR_EQUAL(tc, target, dest); + apr_escape_entity(NULL, src, APR_ESCAPE_STRING, 1, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "Hello"; + dest = apr_punescape_entity(pool, src); + ABTS_PTR_EQUAL(tc, src, dest); + + src = "\xFF<>&'"Hello World"; + target = "\xFF<>&\'\"Hello World"; + dest = apr_punescape_entity(pool, src); + ABTS_STR_EQUAL(tc, target, dest); + apr_unescape_entity(NULL, src, APR_ESCAPE_STRING, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "ÿ<>&'"Hello World"; + target = "\xFF<>&\'\"Hello World"; + dest = apr_punescape_entity(pool, src); + ABTS_STR_EQUAL(tc, target, dest); + apr_unescape_entity(NULL, src, APR_ESCAPE_STRING, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = " <>&'"Hello World"; + target = " <>&\'\"Hello World"; + dest = apr_punescape_entity(pool, src); + ABTS_STR_EQUAL(tc, target, dest); + apr_unescape_entity(NULL, src, APR_ESCAPE_STRING, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "Hello"; + dest = apr_pescape_echo(pool, src, 0); + ABTS_PTR_EQUAL(tc, src, dest); + + src = "\a\b\e\f\\n\r\t\v\"Hello World\""; + target = "\\a\\b\\e\\f\\\\n\\r\\t\\v\"Hello World\""; + dest = apr_pescape_echo(pool, src, 0); + ABTS_STR_EQUAL(tc, target, dest); + apr_escape_echo(NULL, src, APR_ESCAPE_STRING, 0, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "\a\b\e\f\\n\r\t\v\"Hello World\""; + target = "\\a\\b\\e\\f\\\\n\\r\\t\\v\\\"Hello World\\\""; + dest = apr_pescape_echo(pool, src, 1); + ABTS_STR_EQUAL(tc, target, dest); + apr_escape_echo(NULL, src, APR_ESCAPE_STRING, 1, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "\xFF\x00\xFF\x00"; + target = "ff00ff00"; + dest = apr_pescape_hex(pool, src, 4, 0); + ABTS_STR_EQUAL(tc, target, dest); + apr_escape_hex(NULL, src, 4, 0, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "\xFF\x00\xFF\x00"; + target = "ff:00:ff:00"; + dest = apr_pescape_hex(pool, src, 4, 1); + ABTS_STR_EQUAL(tc, target, dest); + apr_escape_hex(NULL, src, 4, 1, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "ff:00:ff:00"; + target = "\xFF\x00\xFF\x00"; + vdest = apr_punescape_hex(pool, src, 1, &vlen); + ABTS_ASSERT(tc, "apr_punescape_hex target!=dest", memcmp(target, vdest, 4) == 0); + ABTS_INT_EQUAL(tc, (int)vlen, 4); + apr_unescape_hex(NULL, src, APR_ESCAPE_STRING, 1, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, (apr_size_t)4), + (len == 4)); + + apr_pool_destroy(pool); +} + +abts_suite *testescape(abts_suite *suite) +{ + suite = ADD_SUITE(suite); + + abts_run_test(suite, test_escape, NULL); + + return suite; +} diff --git a/test/testutil.h b/test/testutil.h index 8bb508d283d..286d253bd90 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -110,6 +110,7 @@ abts_suite *testud(abts_suite *suite); abts_suite *testuser(abts_suite *suite); abts_suite *testvsn(abts_suite *suite); +abts_suite *testescape(abts_suite *suite); abts_suite *teststrmatch(abts_suite *suite); abts_suite *testuri(abts_suite *suite); abts_suite *testuuid(abts_suite *suite); diff --git a/tools/gen_test_char.c b/tools/gen_test_char.c new file mode 100644 index 00000000000..fca9850d61b --- /dev/null +++ b/tools/gen_test_char.c @@ -0,0 +1,134 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifdef CROSS_COMPILE + +#define apr_isalnum(c) (isalnum(((unsigned char)(c)))) +#define apr_isalpha(c) (isalpha(((unsigned char)(c)))) +#define apr_iscntrl(c) (iscntrl(((unsigned char)(c)))) +#define apr_isprint(c) (isprint(((unsigned char)(c)))) +#include +#define APR_HAVE_STDIO_H 1 +#define APR_HAVE_STRING_H 1 + +#else + +#include "apr.h" +#include "apr_lib.h" + +#endif + +#if defined(WIN32) || defined(OS2) +#define NEED_ENHANCED_ESCAPES +#endif + +#if APR_HAVE_STDIO_H +#include +#endif +#if APR_HAVE_STRING_H +#include +#endif + +/* A bunch of functions in util.c scan strings looking for certain characters. + * To make that more efficient we encode a lookup table. + */ +#define T_ESCAPE_SHELL_CMD (0x01) +#define T_ESCAPE_PATH_SEGMENT (0x02) +#define T_OS_ESCAPE_PATH (0x04) +#define T_ESCAPE_ECHO (0x08) +#define T_ESCAPE_URLENCODED (0x10) +#define T_ESCAPE_XML (0x20) + +int main(int argc, char *argv[]) +{ + unsigned c; + unsigned char flags; + + printf("/* this file is automatically generated by gen_test_char, " + "do not edit. \"make include/private/apr_escape_test_char.h\" to regenerate. */\n" + "#define T_ESCAPE_SHELL_CMD (%u)\n" + "#define T_ESCAPE_PATH_SEGMENT (%u)\n" + "#define T_OS_ESCAPE_PATH (%u)\n" + "#define T_ESCAPE_ECHO (%u)\n" + "#define T_ESCAPE_URLENCODED (%u)\n" + "#define T_ESCAPE_XML (%u)\n" + "\n" + "static const unsigned char test_char_table[256] = {", + T_ESCAPE_SHELL_CMD, + T_ESCAPE_PATH_SEGMENT, + T_OS_ESCAPE_PATH, + T_ESCAPE_ECHO, + T_ESCAPE_URLENCODED, + T_ESCAPE_XML); + + for (c = 0; c < 256; ++c) { + flags = 0; + if (c % 20 == 0) + printf("\n "); + + /* escape_shell_cmd */ +#ifdef NEED_ENHANCED_ESCAPES + /* Win32/OS2 have many of the same vulnerable characters + * as Unix sh, plus the carriage return and percent char. + * The proper escaping of these characters varies from unix + * since Win32/OS2 use carets or doubled-double quotes, + * and neither lf nor cr can be escaped. We escape unix + * specific as well, to assure that cross-compiled unix + * applications behave similiarly when invoked on win32/os2. + * + * Rem please keep in-sync with apr's list in win32/filesys.c + */ + if (c && strchr("&;`'\"|*?~<>^()[]{}$\\\n\r%", c)) { + flags |= T_ESCAPE_SHELL_CMD; + } +#else + if (c && strchr("&;`'\"|*?~<>^()[]{}$\\\n", c)) { + flags |= T_ESCAPE_SHELL_CMD; + } +#endif + + if (!apr_isalnum(c) && !strchr("$-_.+!*'(),:@&=~", c)) { + flags |= T_ESCAPE_PATH_SEGMENT; + } + + if (!apr_isalnum(c) && !strchr("$-_.+!*'(),:@&=/~", c)) { + flags |= T_OS_ESCAPE_PATH; + } + + if (!apr_isalnum(c) && !strchr(".-*_ ", c)) { + flags |= T_ESCAPE_URLENCODED; + } + + /* For logging, escape all control characters, + * double quotes (because they delimit the request in the log file) + * backslashes (because we use backslash for escaping) + * and 8-bit chars with the high bit set + */ + if (c && (!apr_isprint(c) || c == '"' || c == '\\' || apr_iscntrl(c))) { + flags |= T_ESCAPE_ECHO; + } + + if (strchr("<>&\"", c)) { + flags |= T_ESCAPE_XML; + } + + printf("%u%c", flags, (c < 255) ? ',' : ' '); + } + + printf("\n};\n"); + + return 0; +} From edff3aaa4ee99d08c0077ed520d1c65162008d87 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 4 Jun 2013 17:06:00 +0000 Subject: [PATCH 7268/7878] Check in stable copy of test_char.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1489520 13f79535-47bb-0310-9956-ffa450edef68 --- include/private/apr_escape_test_char.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 include/private/apr_escape_test_char.h diff --git a/include/private/apr_escape_test_char.h b/include/private/apr_escape_test_char.h new file mode 100644 index 00000000000..3cb8443b85a --- /dev/null +++ b/include/private/apr_escape_test_char.h @@ -0,0 +1,23 @@ +/* this file is automatically generated by gen_test_char, do not edit. "make include/private/apr_escape_test_char.h" to regenerate. */ +#define T_ESCAPE_SHELL_CMD (1) +#define T_ESCAPE_PATH_SEGMENT (2) +#define T_OS_ESCAPE_PATH (4) +#define T_ESCAPE_ECHO (8) +#define T_ESCAPE_URLENCODED (16) +#define T_ESCAPE_XML (32) + +static const unsigned char test_char_table[256] = { + 32,30,30,30,30,30,30,30,30,30,31,30,30,30,30,30,30,30,30,30, + 30,30,30,30,30,30,30,30,30,30,30,30,6,16,63,22,17,22,49,17, + 17,17,1,16,16,0,0,18,0,0,0,0,0,0,0,0,0,0,16,23, + 55,16,55,23,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,23,31,23,23,0,23,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,23,23,23,17,30,30,30,30,30,30,30,30,30,30,30,30,30, + 30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30, + 30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30, + 30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30, + 30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30, + 30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30, + 30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30 +}; From e4ceec20625965e7d5a7368b1cc6e311d9d1386e Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Thu, 6 Jun 2013 12:06:29 +0000 Subject: [PATCH 7269/7878] Add apr_pbase64_encode() and apr_pbase64_decode() to encode to/from the pool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1490248 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ encoding/apr_base64.c | 24 ++++++++++++++++++++++++ include/apr_base64.h | 18 ++++++++++++++++++ test/testbase64.c | 4 ++++ 4 files changed, 49 insertions(+) diff --git a/CHANGES b/CHANGES index 6ae11ae4319..70d8d678830 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add apr_pbase64_encode() and apr_pbase64_decode() to encode to/from + the pool. [Graham Leggett] + *) Add the apr_escape interface. [Graham Leggett] *) Add support to apr_memcache for unix domain sockets. PR 54573 [Remi diff --git a/encoding/apr_base64.c b/encoding/apr_base64.c index d553631dc31..82e6e23d11a 100644 --- a/encoding/apr_base64.c +++ b/encoding/apr_base64.c @@ -188,6 +188,18 @@ APR_DECLARE(int) apr_base64_decode_binary(unsigned char *bufplain, return nbytesdecoded; } +APR_DECLARE(char *) apr_pbase64_decode(apr_pool_t *p, const char *bufcoded) +{ + char *decoded; + int l; + + decoded = (char *) apr_palloc(p, 1 + apr_base64_decode_len(bufcoded)); + l = apr_base64_decode(decoded, bufcoded); + decoded[l] = '\0'; /* make binary sequence into string */ + + return decoded; +} + static const char basis_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; @@ -267,3 +279,15 @@ APR_DECLARE(int) apr_base64_encode_binary(char *encoded, *p++ = '\0'; return (int)(p - encoded); } + +APR_DECLARE(char *) apr_pbase64_encode(apr_pool_t *p, const char *string) +{ + char *encoded; + int l = strlen(string); + + encoded = (char *) apr_palloc(p, 1 + apr_base64_encode_len(l)); + l = apr_base64_encode(encoded, string, l); + encoded[l] = '\0'; /* make binary sequence into string */ + + return encoded; +} diff --git a/include/apr_base64.h b/include/apr_base64.h index 68b30873f3d..406ca368eee 100644 --- a/include/apr_base64.h +++ b/include/apr_base64.h @@ -87,6 +87,15 @@ APR_DECLARE(int) apr_base64_encode_binary(char * coded_dst, int len_plain_src) __attribute__((nonnull(1,2))); +/** + * Encode a string into memory allocated from a pool in base 64 format + * @param p The pool to allocate from + * @param string The plaintext string + * @return The encoded string + */ +APR_DECLARE(char *) apr_pbase64_encode(apr_pool_t *p, const char *string) + __attribute__((nonnull(1,2))); + /** * Determine the maximum buffer length required to decode the plain text * string given the encoded string. @@ -120,6 +129,15 @@ APR_DECLARE(int) apr_base64_decode_binary(unsigned char * plain_dst, const char *coded_src) __attribute__((nonnull(1,2))); +/** + * Decode a base64 encoded string into memory allocated from a pool + * @param p The pool to allocate from + * @param bufcoded The encoded string + * @return The decoded string + */ +APR_DECLARE(char *) apr_pbase64_decode(apr_pool_t *p, const char *bufcoded) + __attribute__((nonnull(1,2))); + /** @} */ #ifdef __cplusplus } diff --git a/test/testbase64.c b/test/testbase64.c index 31d897f4a2c..d71b8e929c9 100644 --- a/test/testbase64.c +++ b/test/testbase64.c @@ -66,6 +66,10 @@ static void test_base64(abts_case *tc, void *data) ABTS_ASSERT(tc, "base 64 encoded length", (b64_enc_len == b64_len)); ABTS_ASSERT(tc, "base 64 encoded matches expected output", (memcmp(enc, base64_tbl[i].enc, b64_enc_len) == 0)); + + enc = apr_pbase64_encode(pool, base64_tbl[i].orig); + ABTS_ASSERT(tc, "base 64 encoded from pool matches expected output", + (strcmp(enc, base64_tbl[i].enc) == 0)) } } From 60bf08129578d05eb8a7274a37da3a23580b0bff Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 7 Jun 2013 11:17:37 +0000 Subject: [PATCH 7270/7878] Set platform macro automatically to make commandline compiles easier. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1490588 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/apr.hw b/include/apr.hw index 9d7875d77b9..ce8b5ef1810 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -28,6 +28,19 @@ * apr.hw by the apr.dsp and libapr.dsp projects. */ +/** + * @file apr.h + * @brief APR Platform Definitions + * @remark This is a generated header generated from include/apr.h.in by + * ./configure, or copied from include/apr.hw or include/apr.hnw + * for Win32 or Netware by those build environments, respectively. + */ + +/* Make sure we have our platform identifier macro defined we ask for later. +#if defined(_WIN32) && !defined(WIN32) +#define WIN32 1 +#endif + /* Ignore most warnings (back down to /W3) for poorly constructed headers, * excluded from doxygen parsing */ From 1d33ad919696faa8d7923ca948d4473684fd447a Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Fri, 7 Jun 2013 15:57:56 +0000 Subject: [PATCH 7271/7878] Set platform macro automatically to make commandline compiles easier. Follow-up fix to r1490588. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1490698 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr.hw b/include/apr.hw index ce8b5ef1810..fd34ad42c79 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -37,6 +37,7 @@ */ /* Make sure we have our platform identifier macro defined we ask for later. + */ #if defined(_WIN32) && !defined(WIN32) #define WIN32 1 #endif From e7760a1b481023996497e0887f53db1b4237123d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 17 Jun 2013 11:26:35 +0000 Subject: [PATCH 7272/7878] fix crash introduced in r1484271 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1493715 13f79535-47bb-0310-9956-ffa450edef68 --- memcache/apr_memcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index 781f34255d5..c5710d8b26c 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -328,7 +328,7 @@ mc_conn_construct(void **conn_, void *params, apr_pool_t *pool) apr_pool_t *tp; apr_memcache_server_t *ms = params; #if APR_HAVE_SOCKADDR_UN - apr_int32_t family = conn->ms->host[0] != '/' ? APR_INET : APR_UNIX; + apr_int32_t family = ms->host[0] != '/' ? APR_INET : APR_UNIX; #else apr_int32_t family = APR_INET; #endif From 4f8697f46d88c58add5194bb9ae5c54f6c057b8a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 17 Jun 2013 12:26:59 +0000 Subject: [PATCH 7273/7878] Fix compilation with FreeBSD on ARM. Submitted by: Olli Hauer Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1493731 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_general.h b/include/apr_general.h index 510ef4590cb..07b49f59fbe 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -79,7 +79,7 @@ typedef enum { APR_WAIT_READ, APR_WAIT_WRITE } apr_wait_type_t; * @return offset */ -#if defined(CRAY) || (defined(__arm) && !defined(LINUX)) +#if defined(CRAY) || (defined(__arm) && !(defined(LINUX) || defined(__FreeBSD__))) #ifdef __STDC__ #define APR_OFFSET(p_type,field) _Offsetof(p_type,field) #else From 953ce5eb4968a348ebae9ad8060d0fe66eb29256 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 23 Jun 2013 20:22:26 +0000 Subject: [PATCH 7274/7878] Add support for Berkeley DB 6.0. Before backporting to apr-util this needs some testing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1495887 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ build/dbm.m4 | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 70d8d678830..d5cb3521825 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add support for Berkeley DB 6.0. [Rainer Jung] + *) Add apr_pbase64_encode() and apr_pbase64_decode() to encode to/from the pool. [Graham Leggett] diff --git a/build/dbm.m4 b/build/dbm.m4 index cf925e11542..639487ddc24 100644 --- a/build/dbm.m4 +++ b/build/dbm.m4 @@ -424,7 +424,7 @@ AC_DEFUN([APU_CHECK_DB], [ AC_MSG_ERROR(Berkeley db3 not found) fi ;; - db[[45]][[0-9]]) + db[[456]][[0-9]]) db_major=`echo "$requested" | sed -e 's/db//' -e 's/.$//'` db_minor=`echo "$requested" | sed -e 's/db//' -e 's/.//'` APU_CHECK_DBXY("$check_places", "$db_major", "$db_minor") @@ -432,7 +432,7 @@ AC_DEFUN([APU_CHECK_DB], [ AC_MSG_ERROR(Berkeley db$db_major not found) fi ;; - db[[45]]) + db[[456]]) db_major=`echo "$requested" | sed -e 's/db//'` # Start version search at version x.9 db_minor=9 @@ -523,6 +523,7 @@ AC_DEFUN([APU_CHECK_DBM], [ dbm_list="$dbm_list, db$db_version" db_version=`expr $db_version + 1` done + dbm_list="$dbm_list, db60" AC_ARG_WITH(dbm, [APR_HELP_STRING([--with-dbm=DBM], [choose the DBM type to use. DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db4X,db5X} for some X=0,...,9])], @@ -668,11 +669,11 @@ AC_DEFUN([APU_CHECK_DBM], [ eval "apu_use_$requested=1" apu_default_dbm=$requested ;; - db185 | db[[12345]]) + db185 | db[[123456]]) apu_use_db=1 apu_default_dbm=$requested ;; - db[[45]][[0-9]]) + db[[456]][[0-9]]) apu_use_db=1 apu_default_dbm=`echo $requested | sed -e 's/.$//'` ;; From c5ccc416194e21c42c998bf74b4a95819c65e195 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 23 Jun 2013 20:27:54 +0000 Subject: [PATCH 7275/7878] Fix configure help message for Berkeley DB 6. Addon to r1495887. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1495889 13f79535-47bb-0310-9956-ffa450edef68 --- build/dbm.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dbm.m4 b/build/dbm.m4 index 639487ddc24..8312e0edfaa 100644 --- a/build/dbm.m4 +++ b/build/dbm.m4 @@ -526,7 +526,7 @@ AC_DEFUN([APU_CHECK_DBM], [ dbm_list="$dbm_list, db60" AC_ARG_WITH(dbm, [APR_HELP_STRING([--with-dbm=DBM], [choose the DBM type to use. - DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db4X,db5X} for some X=0,...,9])], + DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db4X,db5X,db6X} for some X=0,...,9])], [ if test "$withval" = "yes"; then AC_MSG_ERROR([--with-dbm needs to specify a DBM type to use. From 602f3ab48089be4101c18686dadff1a360480861 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 25 Jun 2013 10:58:31 +0000 Subject: [PATCH 7276/7878] Fix doc errors in APR header files. PR: 55133 Submitted by: Mike Rumph git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1496407 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 2 +- include/apr_dbd.h | 6 +++--- include/apr_errno.h | 6 +++--- include/apr_escape.h | 10 +++++----- include/apr_file_info.h | 6 +++--- include/apr_hooks.h | 8 ++++---- include/apr_inherit.h | 4 ++-- include/apr_mmap.h | 2 +- include/apr_optional_hooks.h | 4 ++-- include/apr_pools.h | 34 +++++++++++++++++----------------- include/apr_queue.h | 2 +- include/apr_reslist.h | 11 +++++++++-- include/apr_thread_proc.h | 4 ++-- include/apr_user.h | 6 +++--- 14 files changed, 56 insertions(+), 49 deletions(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 5d6677645db..70d31efa0f5 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -131,7 +131,7 @@ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator) /** * Set the current threshold at which the allocator should start * giving blocks back to the system. - * @param allocator The allocator the set the threshold on + * @param allocator The allocator to set the threshold on * @param size The threshold. 0 == unlimited. */ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, diff --git a/include/apr_dbd.h b/include/apr_dbd.h index 0fe0688badb..1e8da00ab26 100644 --- a/include/apr_dbd.h +++ b/include/apr_dbd.h @@ -107,10 +107,10 @@ APR_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name, /** apr_dbd_open_ex: open a connection to a backend * + * @param driver - driver struct. * @param pool - working pool * @param params - arguments to driver (implementation-dependent) * @param handle - pointer to handle to return - * @param driver - driver struct. * @param error - descriptive error. * @return APR_SUCCESS for success * @return APR_EGENERAL if driver exists but connection failed @@ -147,10 +147,10 @@ APR_DECLARE(apr_status_t) apr_dbd_open_ex(const apr_dbd_driver_t *driver, /** apr_dbd_open: open a connection to a backend * + * @param driver - driver struct. * @param pool - working pool * @param params - arguments to driver (implementation-dependent) * @param handle - pointer to handle to return - * @param driver - driver struct. * @return APR_SUCCESS for success * @return APR_EGENERAL if driver exists but connection failed * @see apr_dbd_open_ex @@ -161,8 +161,8 @@ APR_DECLARE(apr_status_t) apr_dbd_open(const apr_dbd_driver_t *driver, /** apr_dbd_close: close a connection to a backend * - * @param handle - handle to close * @param driver - driver struct. + * @param handle - handle to close * @return APR_SUCCESS for success or error status */ APR_DECLARE(apr_status_t) apr_dbd_close(const apr_dbd_driver_t *driver, diff --git a/include/apr_errno.h b/include/apr_errno.h index 57ad99269ca..4ee292e3871 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -45,7 +45,7 @@ typedef int apr_status_t; /** * Return a human readable string describing the specified error. - * @param statcode The error code the get a string for. + * @param statcode The error code to get a string for. * @param buf A buffer to hold the error string. * @param bufsize Size of the buffer to hold the string. */ @@ -126,7 +126,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * use within apr-util. This space is reserved above that used by APR * internally. * @note This number MUST be smaller than APR_OS_ERRSPACE_SIZE by a - * large enough amount that APR has sufficient room for it's + * large enough amount that APR has sufficient room for its * codes. */ #define APR_UTIL_ERRSPACE_SIZE 20000 @@ -135,7 +135,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, */ #define APR_OS_START_STATUS (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE) /** - * APR_UTIL_START_STATUS is where APR-Util starts defining it's + * APR_UTIL_START_STATUS is where APR-Util starts defining its * status codes. */ #define APR_UTIL_START_STATUS (APR_OS_START_STATUS + \ diff --git a/include/apr_escape.h b/include/apr_escape.h index bc77c3c9d4c..73dc6cce01b 100644 --- a/include/apr_escape.h +++ b/include/apr_escape.h @@ -130,7 +130,7 @@ APR_DECLARE(apr_status_t) apr_escape_path_segment(char *escaped, * Escape a path segment, as defined in RFC1808, returning the result from a * pool. * @param p Pool to allocate from - * @param url String to be escaped + * @param str String to be escaped * @return A string allocated from the pool on success, the original string * if no characters are encoded or the string is NULL. */ @@ -149,7 +149,7 @@ APR_DECLARE(const char *) apr_pescape_path_segment(apr_pool_t *p, * something with a '/' in it (and thus does not prefix "./"). * @param escaped Optional buffer to write the encoded string, can be * NULL - * @param str The original string + * @param path The original string * @param slen The length of the original string, or APR_ESCAPE_STRING * @param partial If non zero, suppresses the prepending of "./" * @param len If present, returns the length of the string @@ -199,7 +199,7 @@ APR_DECLARE(apr_status_t) apr_escape_urlencoded(char *escaped, const char *str, * http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1, returning * the result from a pool. * @param p Pool to allocate from - * @param url String to be escaped + * @param str String to be escaped * @return A string allocated from the pool on success, the original string * if no characters are encoded or if the string was NULL. */ @@ -319,7 +319,7 @@ APR_DECLARE(const char *) apr_pescape_echo(apr_pool_t *p, const char *str, * Convert binary data to a hex encoding. * @param dest The destination buffer, can be NULL * @param src The original buffer - * @param slen The length of the original buffer + * @param srclen The length of the original buffer * @param colon If not zero, insert colon characters between hex digits. * @param len If present, returns the length of the string * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL @@ -332,7 +332,7 @@ APR_DECLARE(apr_status_t) apr_escape_hex(char *dest, const void *src, * pool. * @param p Pool to allocate from * @param src The original buffer - * @param srclen The length of the original buffer + * @param slen The length of the original buffer * @param colon If not zero, insert colon characters between hex digits. * @return A zero padded buffer allocated from the pool on success, or * NULL if src was NULL. diff --git a/include/apr_file_info.h b/include/apr_file_info.h index 94e84e87635..b3006ac4cea 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -316,7 +316,7 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); * @param filepath the pathname to parse for its root component * @param flags the desired rules to apply, from *
    - *      APR_FILEPATH_NATIVE    Use native path seperators (e.g. '\' on Win32)
    + *      APR_FILEPATH_NATIVE    Use native path separators (e.g. '\' on Win32)
      *      APR_FILEPATH_TRUENAME  Tests that the root exists, and makes it proper
      * 
    * @param p the pool to allocate the new path string from @@ -328,7 +328,7 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); * test for the validity of that root (e.g., that a drive d:/ or network * share //machine/foovol/). * The function returns APR_ERELATIVE if filepath isn't rooted (an - * error), APR_EINCOMPLETE if the root path is ambigious (but potentially + * error), APR_EINCOMPLETE if the root path is ambiguous (but potentially * legitimate, e.g. "/" on Windows is incomplete because it doesn't specify * the drive letter), or APR_EBADPATH if the root is simply invalid. * APR_SUCCESS is returned if filepath is an absolute path. @@ -362,7 +362,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * @param pathelts the returned components of the search path * @param liststr the search path (e.g., getenv("PATH")) * @param p the pool to allocate the array and path components from - * @remark empty path componenta do not become part of @a pathelts. + * @remark empty path components do not become part of @a pathelts. * @remark the path separator in @a liststr is system specific; * e.g., ':' on Unix, ';' on Windows, etc. */ diff --git a/include/apr_hooks.h b/include/apr_hooks.h index 8330b8aa870..896ea72f3c2 100644 --- a/include/apr_hooks.h +++ b/include/apr_hooks.h @@ -313,24 +313,24 @@ APR_DECLARE_DATA extern apr_pool_t *apr_hook_global_pool; /** * A global variable to determine if debugging information about the - * hooks functions should be printed + * hooks functions should be printed. */ APR_DECLARE_DATA extern int apr_hook_debug_enabled; /** - * The name of the module that is currently registering a function + * The name of the module that is currently registering a function. */ APR_DECLARE_DATA extern const char *apr_hook_debug_current; /** - * Register a hook function to be sorted + * Register a hook function to be sorted. * @param szHookName The name of the Hook the function is registered for * @param aHooks The array which stores all of the functions for this hook */ APR_DECLARE(void) apr_hook_sort_register(const char *szHookName, apr_array_header_t **aHooks); /** - * Sort all of the registerd functions for a given hook + * Sort all of the registered functions for a given hook. */ APR_DECLARE(void) apr_hook_sort_all(void); diff --git a/include/apr_inherit.h b/include/apr_inherit.h index b7f7480f1ff..b9fe56fe449 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -28,7 +28,7 @@ * Prototype for type-specific declarations of apr_foo_inherit_set * functions. * @remark Doxygen unwraps this macro (via doxygen.conf) to provide - * actual help for each specific occurance of apr_foo_inherit_set. + * actual help for each specific occurrence of apr_foo_inherit_set. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ @@ -40,7 +40,7 @@ * Prototype for type-specific declarations of apr_foo_inherit_unset * functions. * @remark Doxygen unwraps this macro (via doxygen.conf) to provide - * actual help for each specific occurance of apr_foo_inherit_unset. + * actual help for each specific occurrence of apr_foo_inherit_unset. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 77d697f5b55..c14de1928ae 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -120,7 +120,7 @@ struct apr_mmap_t { /** * Create a new mmap'ed file out of an existing APR file. * @param newmmap The newly created mmap'ed file. - * @param file The file turn into an mmap. + * @param file The file to turn into an mmap. * @param offset The offset into the file to start the data pointer at. * @param size The size of the file * @param flag bit-wise or of: diff --git a/include/apr_optional_hooks.h b/include/apr_optional_hooks.h index 1e3801a8ea3..ac100a24893 100644 --- a/include/apr_optional_hooks.h +++ b/include/apr_optional_hooks.h @@ -33,11 +33,11 @@ extern "C" { * @{ */ /** - * Function to implemnt the APR_OPTIONAL_HOOK Macro + * Function to implement the APR_OPTIONAL_HOOK Macro * @internal * @see APR_OPTIONAL_HOOK * - * @param name The name of the hook + * @param szName The name of the hook * @param pfn A pointer to a function that will be called * @param aszPre a NULL-terminated array of strings that name modules whose hooks should precede this one * @param aszSucc a NULL-terminated array of strings that name modules whose hooks should succeed this one diff --git a/include/apr_pools.h b/include/apr_pools.h index 6f50ade8fc2..0b17561bbd7 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -71,10 +71,10 @@ typedef struct apr_pool_t apr_pool_t; *
      *    APR_POOL_DECLARE_ACCESSOR(file);
      * becomes:
    - *    APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob);
    + *    APR_DECLARE(apr_pool_t *) apr_file_pool_get(const apr_file_t *thefile);
      * 
    * @remark Doxygen unwraps this macro (via doxygen.conf) to provide - * actual help for each specific occurance of apr_foo_pool_get. + * actual help for each specific occurrence of apr_foo_pool_get. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ @@ -118,15 +118,15 @@ typedef struct apr_pool_t apr_pool_t; * * | | | | | x | | | | Pool owner checking. On each use of a * pool, check if the current thread is the - * pools owner. If not, abort(). In + * pool's owner. If not, abort(). In * combination with the verbose flag above, * it will output OWNER in such an event * prior to aborting. Use the debug * function apr_pool_owner_set() to switch - * a pools ownership. + * a pool's ownership. * * When no debug level was specified, assume general debug mode. - * If level 0 was specified, debugging is switched off + * If level 0 was specified, debugging is switched off. *
    */ #if defined(APR_POOL_DEBUG) @@ -204,7 +204,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, * @param newpool The pool we have just created. * @param abort_fn A function to use if the pool cannot allocate more memory. * @param allocator The allocator to use with the new pool. If NULL a - * new allocator will be crated with newpool as owner. + * new allocator will be created with the new pool as owner. * @remark An unmanaged pool is a special pool without a parent; it will * NOT be destroyed upon apr_terminate. It must be explicitly * destroyed by calling apr_pool_destroy, to prevent memory leaks. @@ -213,7 +213,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, * @warning Any child cleanups registered against the new pool, or * against sub-pools thereof, will not be executed during an * invocation of apr_proc_create(), so resources created in an - * "unmanaged" pool heirarchy will leak to child processes. + * "unmanaged" pool hierarchy will leak to child processes. */ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, @@ -229,7 +229,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. - * Call this directly if you have you apr_pool_create_ex + * Call this directly if you have your apr_pool_create_ex * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have @@ -257,7 +257,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. - * Call this directly if you have you apr_pool_create_unmanaged_ex + * Call this directly if you have your apr_pool_create_unmanaged_ex * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have @@ -304,7 +304,7 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, #endif /** - * Create a new pool. + * Create a new unmanaged pool. * @param newpool The pool we have just created. */ #if defined(DOXYGEN) @@ -343,7 +343,7 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p) __attribute__((nonnull(1))); * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. - * Call this directly if you have you apr_pool_clear + * Call this directly if you have your apr_pool_clear * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have @@ -373,7 +373,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p) __attribute__((nonnull(1))); * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. - * Call this directly if you have you apr_pool_destroy + * Call this directly if you have your apr_pool_destroy * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have @@ -591,7 +591,7 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, /** * Register a function to be called when a pool is cleared or destroyed - * @param p The pool register the cleanup with + * @param p The pool to register the cleanup with * @param data The data to pass to the cleanup function. * @param plain_cleanup The function to call when the pool is cleared * or destroyed @@ -607,11 +607,11 @@ APR_DECLARE(void) apr_pool_cleanup_register( /** * Register a function to be called when a pool is cleared or destroyed. * - * Unlike apr_pool_cleanup_register which register a cleanup - * that is called AFTER all subpools are destroyed this function register - * a function that will be called before any of the subpool is destoryed. + * Unlike apr_pool_cleanup_register which registers a cleanup + * that is called AFTER all subpools are destroyed, this function registers + * a function that will be called before any of the subpools are destroyed. * - * @param p The pool register the cleanup with + * @param p The pool to register the cleanup with * @param data The data to pass to the cleanup function. * @param plain_cleanup The function to call when the pool is cleared * or destroyed diff --git a/include/apr_queue.h b/include/apr_queue.h index 93bf2e41fa7..1d09e9de396 100644 --- a/include/apr_queue.h +++ b/include/apr_queue.h @@ -22,7 +22,7 @@ * @brief Thread Safe FIFO bounded queue * @note Since most implementations of the queue are backed by a condition * variable implementation, it isn't available on systems without threads. - * Although condition variables are some times available without threads. + * Although condition variables are sometimes available without threads. */ #include "apu.h" diff --git a/include/apr_reslist.h b/include/apr_reslist.h index ee94f07e980..4e09e12aacb 100644 --- a/include/apr_reslist.h +++ b/include/apr_reslist.h @@ -44,7 +44,7 @@ typedef struct apr_reslist_t apr_reslist_t; /* Generic constructor called by resource list when it needs to create a * resource. * @param resource opaque resource - * @param param flags + * @param params flags * @param pool Pool */ typedef apr_status_t (*apr_reslist_constructor)(void **resource, void *params, @@ -53,7 +53,7 @@ typedef apr_status_t (*apr_reslist_constructor)(void **resource, void *params, /* Generic destructor called by resource list when it needs to destroy a * resource. * @param resource opaque resource - * @param param flags + * @param params flags * @param pool Pool */ typedef apr_status_t (*apr_reslist_destructor)(void *resource, void *params, @@ -111,12 +111,17 @@ APR_DECLARE(apr_status_t) apr_reslist_destroy(apr_reslist_t *reslist); * Retrieve a resource from the list, creating a new one if necessary. * If we have met our maximum number of resources, we will block * until one becomes available. + * @param reslist The resource list. + * @param resource An address where the pointer to the resource + * will be stored. */ APR_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, void **resource); /** * Return a resource back to the list of available resources. + * @param reslist The resource list. + * @param resource The resource to return to the list. */ APR_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, void *resource); @@ -140,6 +145,8 @@ APR_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist); * Invalidate a resource in the pool - e.g. a database connection * that returns a "lost connection" error and can't be restored. * Use this instead of apr_reslist_release if the resource is bad. + * @param reslist The resource list. + * @param resource The resource to invalidate. */ APR_DECLARE(apr_status_t) apr_reslist_invalidate(apr_reslist_t *reslist, void *resource); diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 1ecbfaa60ac..7fcd4b6eca4 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -115,7 +115,7 @@ typedef enum { #define APR_OC_REASON_DEATH 0 /**< child has died, caller must call * unregister still */ #define APR_OC_REASON_UNWRITABLE 1 /**< currently unused. */ -#define APR_OC_REASON_RESTART 2 /**< a restart is occuring, perform +#define APR_OC_REASON_RESTART 2 /**< a restart is occurring, perform * any necessary cleanup (including * sending a special signal to child) */ @@ -124,7 +124,7 @@ typedef enum { * kill the child) */ #define APR_OC_REASON_LOST 4 /**< somehow the child exited without * us knowing ... buggy os? */ -#define APR_OC_REASON_RUNNING 5 /**< a health check is occuring, +#define APR_OC_REASON_RUNNING 5 /**< a health check is occurring, * for most maintainence functions * this is a no-op. */ diff --git a/include/apr_user.h b/include/apr_user.h index 0179e22644c..0e0a3ac5ac5 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -81,7 +81,7 @@ APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, * Get the userid (and groupid) for the specified username * @param userid Returns the user id * @param groupid Returns the user's group id - * @param username The username to lookup + * @param username The username to look up * @param p The pool from which to allocate working space * @remark This function is available only if APR_HAS_USER is defined. */ @@ -103,7 +103,7 @@ APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, * Compare two user identifiers for equality. * @param left One uid to test * @param right Another uid to test - * @return APR_SUCCESS if the apr_uid_t strutures identify the same user, + * @return APR_SUCCESS if the apr_uid_t structures identify the same user, * APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid. * @remark This function is available only if APR_HAS_USER is defined. */ @@ -137,7 +137,7 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, * Compare two group identifiers for equality. * @param left One gid to test * @param right Another gid to test - * @return APR_SUCCESS if the apr_gid_t strutures identify the same group, + * @return APR_SUCCESS if the apr_gid_t structures identify the same group, * APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid. * @remark This function is available only if APR_HAS_USER is defined. */ From 41061cc4d2a7b2ef2f5734e531adf0d3bb4d0f65 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sat, 13 Jul 2013 15:47:26 +0000 Subject: [PATCH 7277/7878] Fix broken test for O_NONBLOCK inheritance. Followup to r1449568 which misses the variable declaration. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1502804 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 0cea93b00a3..24889828308 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -570,6 +570,9 @@ AC_DEFUN([APR_CHECK_O_NONBLOCK_INHERITED], [ #ifdef HAVE_SYS_SOCKET_H #include #endif +#ifdef HAVE_SYS_TIME_H +#include +#endif #ifdef HAVE_SYS_SELECT_H #include #endif @@ -590,6 +593,8 @@ int main(void) { int listen_port, rc; struct sockaddr_in sa; socklen_t sa_len; + fd_set fds; + struct timeval tv; listen_s = socket(AF_INET, SOCK_STREAM, 0); if (listen_s < 0) { From a5b7d0c1c059bf2031891b1baafde76f49018724 Mon Sep 17 00:00:00 2001 From: "Thomas J. Donovan" Date: Wed, 31 Jul 2013 15:07:28 +0000 Subject: [PATCH 7278/7878] Fix warnings in odbc driver on 64bit systems. PR 55197 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1508903 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_odbc.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index 1775326d2e7..9747828711b 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -114,9 +114,9 @@ struct apr_dbd_t char lastError[MAX_ERROR_STRING]; int defaultBufferSize; /* used for CLOBs in text mode, * and when fld size is indeterminate */ - int transaction_mode; - int dboptions; /* driver options re SQLGetData */ - int default_transaction_mode; + intptr_t transaction_mode; + intptr_t dboptions; /* driver options re SQLGetData */ + intptr_t default_transaction_mode; int can_commit; /* controls end_trans behavior */ }; @@ -359,7 +359,7 @@ static SQLRETURN odbc_set_result_column(int icol, apr_dbd_results_t *res, SQLHANDLE stmt) { SQLRETURN rc; - int maxsize, textsize, realsize, type, isunsigned = 1; + intptr_t maxsize, textsize, realsize, type, isunsigned = 1; /* discover the sql type */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_UNSIGNED, NULL, 0, NULL, @@ -409,7 +409,7 @@ static SQLRETURN odbc_set_result_column(int icol, apr_dbd_results_t *res, type = SQL_C_CHAR; } - res->coltypes[icol] = type; + res->coltypes[icol] = (SQLSMALLINT)type; /* size if retrieved as text */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_DISPLAY_SIZE, NULL, 0, @@ -441,12 +441,12 @@ static SQLRETURN odbc_set_result_column(int icol, apr_dbd_results_t *res, res->colptrs[icol] = NULL; res->colstate[icol] = COL_AVAIL; - res->colsizes[icol] = maxsize; + res->colsizes[icol] = (SQLINTEGER)maxsize; rc = SQL_SUCCESS; } else { res->colptrs[icol] = apr_pcalloc(res->pool, maxsize); - res->colsizes[icol] = maxsize; + res->colsizes[icol] = (SQLINTEGER)maxsize; if (res->apr_dbd->dboptions & SQL_GD_BOUND) { /* we are allowed to call SQLGetData if we need to */ rc = SQLBindCol(stmt, icol + 1, res->coltypes[icol], @@ -747,7 +747,7 @@ static void *odbc_get(const apr_dbd_row_t *row, const int col, SQLRETURN rc; SQLLEN indicator; int state = row->res->colstate[col]; - int options = row->res->apr_dbd->dboptions; + intptr_t options = row->res->apr_dbd->dboptions; switch (state) { case (COL_UNAVAIL): @@ -817,13 +817,13 @@ static apr_status_t odbc_parse_params(apr_pool_t *pool, const char *params, int *connect, SQLCHAR **datasource, SQLCHAR **user, SQLCHAR **password, int *defaultBufferSize, int *nattrs, - int **attrs, int **attrvals) + int **attrs, intptr_t **attrvals) { char *seps, *last, *next, *name[MAX_PARAMS], *val[MAX_PARAMS]; int nparams = 0, i, j; *attrs = apr_pcalloc(pool, MAX_PARAMS * sizeof(char *)); - *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(int)); + *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(intptr_t)); *nattrs = 0; seps = DEFAULTSEPS; name[nparams] = apr_strtok(apr_pstrdup(pool, params), seps, &last); @@ -1062,7 +1062,8 @@ static apr_dbd_t *odbc_open(apr_pool_t *pool, const char *params, const char **e SQLHANDLE err_h = NULL; SQLCHAR *datasource = (SQLCHAR *)"", *user = (SQLCHAR *)"", *password = (SQLCHAR *)""; - int nattrs = 0, *attrs = NULL, *attrvals = NULL, connect = 0; + int nattrs = 0, *attrs = NULL, connect = 0; + intptr_t *attrvals = NULL; err_step = "SQLAllocHandle (SQL_HANDLE_DBC)"; err_htype = SQL_HANDLE_ENV; @@ -1116,10 +1117,10 @@ static apr_dbd_t *odbc_open(apr_pool_t *pool, const char *params, const char **e handle->default_transaction_mode = 0; handle->can_commit = APR_DBD_TRANSACTION_IGNORE_ERRORS; SQLGetInfo(hdbc, SQL_DEFAULT_TXN_ISOLATION, - &(handle->default_transaction_mode), sizeof(int), NULL); + &(handle->default_transaction_mode), sizeof(intptr_t), NULL); handle->transaction_mode = handle->default_transaction_mode; SQLGetInfo(hdbc, SQL_GETDATA_EXTENSIONS ,&(handle->dboptions), - sizeof(int), NULL); + sizeof(intptr_t), NULL); apr_pool_cleanup_register(pool, handle, odbc_close_cleanup, apr_pool_cleanup_null); return handle; } From 1799a669970386a0afdb07b14b76dd7a41c00fd7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 4 Aug 2013 23:00:13 +0000 Subject: [PATCH 7279/7878] minor corrections to apr_socket_sendv() documentation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1510354 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 14a25faa01a..d7ffaf50930 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -526,7 +526,7 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, apr_size_t *len); /** - * Send multiple packets of data over a network. + * Send multiple buffers over a network. * @param sock The socket to send the data over. * @param vec The array of iovec structs containing the data to send * @param nvec The number of iovec structs in the array @@ -536,7 +536,7 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, * This functions acts like a blocking write by default. To change * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK * socket option. - * The number of bytes actually sent is stored in argument 3. + * The number of bytes actually sent is stored in argument 4. * * It is possible for both bytes to be sent and an error to be returned. * From 80b1a0d3bff99f3f326cfcbc0bfc85480694f558 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 21 Aug 2013 19:06:37 +0000 Subject: [PATCH 7280/7878] support Windows-style paths when checking for absolute paths (e.g., cmake-based out of tree build) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1516261 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/abts.c b/test/abts.c index 500d7babf4a..b233787a0f8 100644 --- a/test/abts.c +++ b/test/abts.c @@ -106,6 +106,9 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name_full) /* suite_name_full may be an absolute path depending on __FILE__ * expansion */ suite_name = strrchr(suite_name_full, '/'); + if (!suite_name) { + suite_name = strrchr(suite_name_full, '\\'); + } if (suite_name) { suite_name++; } else { From 0d4c4420e2a30759b7ce9b0b1e6a5a9592a00b4f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 22 Aug 2013 19:11:11 +0000 Subject: [PATCH 7281/7878] eol-style=native (if indeed this was supposed to be committed) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1516541 13f79535-47bb-0310-9956-ffa450edef68 From 458e3faa5a0601eb6a9d9b00959a592295352c4b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 22 Aug 2013 19:22:03 +0000 Subject: [PATCH 7282/7878] Add experimental cmake-based build system for Windows. include/apr.hwc is almost exactly the same as apr.hw; it uses variables for cmake-time feature selection so that cmake can easily generate apr.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1516542 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + CMakeLists.txt | 463 ++++++++++++++++++++++++++++++ include/apr.hwc | 739 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1204 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 include/apr.hwc diff --git a/CHANGES b/CHANGES index d5cb3521825..d5de43a2287 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add experimental cmake-based build system for Windows. [Jeff Trawick] + *) Add support for Berkeley DB 6.0. [Rainer Jung] *) Add apr_pbase64_encode() and apr_pbase64_decode() to encode to/from diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000000..ed996926013 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,463 @@ +PROJECT(APR C) + +# Todos to properly support Windows: +# . Fix problem where srcdir/include/apr.h (if it exists) is found before builddir/apr.h +# (and similar for apu_want.h) +# . Document example 32-bit and 64-bit Windows builds using NMake +# . Build and optionally run gen_test_char +# . Build apr_app.c into libapr-2 properly (what about apr-2.lib?) +# . Options for remaining features, along with finding any necessary libraries +# + APR_POOL_DEBUG +# + APU_DSO_MODULE_BUILD +# + APU_HAVE_GDBM +# + APU_HAVE_NDBM +# + APU_HAVE_DB +# + APU_HAVE_PGSQL +# + APU_HAVE_MYSQL +# + APU_HAVE_SQLITE3 +# + APU_HAVE_SQLITE2 +# + APU_HAVE_ORACLE +# + APU_HAVE_ODBC +# + APU_HAVE_CRYPTO +# + APU_HAVE_OPENSSL +# + APU_HAVE_NSS +# + APU_HAVE_COMMONCRYPTO +# + APU_HAVE_ICONV +# + APU_USE_LIBXML2 (sketched in, but not working) +# . Support static *or* shared build of Expat +# . Some easier way to run the test suite (not just testall.exe) +# . All the other stuff Jeff doesn't know about yet + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +# Either Expat or LibXml2 is required +FIND_PACKAGE(Expat) +FIND_PACKAGE(LibXml2) + +IF(NOT EXPAT_FOUND AND NOT LIBXML2_FOUND) + MESSAGE(FATAL_ERROR "Either Expat or LibXml2 is required, but neither was found") +ENDIF() + +IF(EXPAT_FOUND) + OPTION(APU_USE_EXPAT "Use Expat" ON) + IF(LIBXML2_FOUND) + OPTION(APU_USE_LIBXML2 "Use LibXml2" OFF) + ENDIF() +ELSE() + OPTION(APU_USE_LIBXML2 "Use LibXml2" ON) +ENDIF() + +OPTION(APR_HAVE_IPV6 "IPv6 support" ON) +OPTION(APR_SHOW_SETTINGS "Show the build configuration" ON) +OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) + +IF(APR_HAVE_IPV6) + SET(apr_have_ipv6_10 1) +ELSE() + SET(apr_have_ipv6_10 0) +ENDIF() + +IF(NOT APU_USE_EXPAT AND NOT APU_USE_LIBXML2) + MESSAGE(FATAL_ERROR "Either Expat or LibXml2 must be selected") +ENDIF() +IF(APU_USE_EXPAT AND APU_USE_LIBXML2) + MESSAGE(FATAL_ERROR "Only one of Expat and LibXml2 can be selected") +ENDIF() +IF(APU_USE_EXPAT) + SET(apu_use_expat_10 1) + SET(apu_use_libxml2_10 0) +ELSE() + SET(apu_use_expat_10 0) + SET(apu_use_libxml2_10 1) +ENDIF() + +CONFIGURE_FILE(include/apr.hwc + ${PROJECT_BINARY_DIR}/apr.h) +# "COPYONLY" just because anything else isn't implemented ;) +CONFIGURE_FILE(include/apu_want.hw + ${PROJECT_BINARY_DIR}/apu_want.h + COPYONLY) + +IF(APU_USE_EXPAT) + SET(XMLLIB_INCLUDE_DIR ${EXPAT_INCLUDE_DIRS}) + SET(XMLLIB_LIBRARIES ${EXPAT_LIBRARIES}) +ELSE() + SET(XMLLIB_INCLUDE_DIR ${LIBXML2_INCLUDE_DIR}) + SET(XMLLIB_LIBRARIES ${LIBXML2_LIBRARIES}) +ENDIF() + +# BROKEN: not searching PROJECT_BINARY_DIR first, so I have to +# manually delete apr.h in PROJECT_SOURCE_DIR/include if +# I've generated apr.h before using a Unix-style build +INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/include/private ${PROJECT_SOURCE_DIR}/include/arch/win32 ${PROJECT_SOURCE_DIR}/include/private ${PROJECT_SOURCE_DIR}/include/arch/unix ${XMLLIB_INCLUDE_DIR}) + +SET(APR_HEADERS ${PROJECT_BINARY_DIR}/apr.h) + +# and misc/win32/apr_app.c + +SET(APR_PUBLIC_HEADERS_STATIC + include/apr_allocator.h + include/apr_anylock.h + include/apr_atomic.h + include/apr_base64.h + include/apr_buckets.h + include/apr_crypto.h + include/apr_date.h + include/apr_dbd.h + include/apr_dbm.h + include/apr_dso.h + include/apr_env.h + include/apr_errno.h + include/apr_escape.h + include/apr_file_info.h + include/apr_file_io.h + include/apr_fnmatch.h + include/apr_general.h + include/apr_getopt.h + include/apr_global_mutex.h + include/apr_hash.h + include/apr_hooks.h + include/apr_inherit.h + include/apr_lib.h + include/apr_md4.h + include/apr_md5.h + include/apr_memcache.h + include/apr_mmap.h + include/apr_network_io.h + include/apr_optional.h + include/apr_optional_hooks.h + include/apr_perms_set.h + include/apr_poll.h + include/apr_pools.h + include/apr_portable.h + include/apr_proc_mutex.h + include/apr_queue.h + include/apr_random.h + include/apr_reslist.h + include/apr_ring.h + include/apr_rmm.h + include/apr_sdbm.h + include/apr_sha1.h + include/apr_shm.h + include/apr_signal.h + include/apr_strings.h + include/apr_strmatch.h + include/apr_tables.h + include/apr_thread_cond.h + include/apr_thread_mutex.h + include/apr_thread_pool.h + include/apr_thread_proc.h + include/apr_thread_rwlock.h + include/apr_time.h + include/apr_uri.h + include/apr_user.h + include/apr_uuid.h + include/apr_version.h + include/apr_want.h + include/apr_xlate.h + include/apr_xml.h + include/apu.h + include/apu_errno.h + include/apu_version.h +) +SET(APR_PUBLIC_HEADERS_GENERATED + ${PROJECT_BINARY_DIR}/apr.h + ${PROJECT_BINARY_DIR}/apu_want.h +) + +SET(APR_SOURCES + atomic/win32/apr_atomic.c + buckets/apr_brigade.c + buckets/apr_buckets.c + buckets/apr_buckets_alloc.c + buckets/apr_buckets_eos.c + buckets/apr_buckets_file.c + buckets/apr_buckets_flush.c + buckets/apr_buckets_heap.c + buckets/apr_buckets_mmap.c + buckets/apr_buckets_pipe.c + buckets/apr_buckets_pool.c + buckets/apr_buckets_refcount.c + buckets/apr_buckets_simple.c + buckets/apr_buckets_socket.c + crypto/apr_crypto.c + crypto/apr_crypto_commoncrypto.c + crypto/apr_crypto_nss.c + crypto/apr_crypto_openssl.c + crypto/apr_md4.c + crypto/apr_md5.c + crypto/apr_passwd.c + crypto/apr_sha1.c + crypto/crypt_blowfish.c + crypto/getuuid.c + crypto/uuid.c + dbd/apr_dbd.c + dbd/apr_dbd_mysql.c + dbd/apr_dbd_odbc.c + dbd/apr_dbd_oracle.c + dbd/apr_dbd_pgsql.c + dbd/apr_dbd_sqlite2.c + dbd/apr_dbd_sqlite3.c + dbd/unsupported/apr_dbd_freetds.c + dbm/apr_dbm.c + dbm/apr_dbm_berkeleydb.c + dbm/apr_dbm_gdbm.c + dbm/apr_dbm_ndbm.c + dbm/apr_dbm_sdbm.c + dbm/sdbm/sdbm.c + dbm/sdbm/sdbm_hash.c + dbm/sdbm/sdbm_lock.c + dbm/sdbm/sdbm_pair.c + dso/win32/dso.c + encoding/apr_base64.c + encoding/apr_escape.c + file_io/unix/copy.c + file_io/unix/fileacc.c + file_io/unix/filepath_util.c + file_io/unix/fullrw.c + file_io/unix/mktemp.c + file_io/unix/tempdir.c + file_io/win32/buffer.c + file_io/win32/dir.c + file_io/win32/filedup.c + file_io/win32/filepath.c + file_io/win32/filestat.c + file_io/win32/filesys.c + file_io/win32/flock.c + file_io/win32/open.c + file_io/win32/pipe.c + file_io/win32/readwrite.c + file_io/win32/seek.c + hooks/apr_hooks.c + locks/win32/proc_mutex.c + locks/win32/thread_cond.c + locks/win32/thread_mutex.c + locks/win32/thread_rwlock.c + memcache/apr_memcache.c + memory/unix/apr_pools.c + misc/unix/errorcodes.c + misc/unix/getopt.c + misc/unix/otherchild.c + misc/unix/version.c + misc/win32/charset.c + misc/win32/env.c + misc/win32/internal.c + misc/win32/misc.c + misc/win32/rand.c + misc/win32/start.c + misc/win32/utf8.c + mmap/unix/common.c + mmap/win32/mmap.c + network_io/unix/inet_ntop.c + network_io/unix/inet_pton.c + network_io/unix/multicast.c + network_io/unix/sockaddr.c + network_io/unix/socket_util.c + network_io/win32/sendrecv.c + network_io/win32/sockets.c + network_io/win32/sockopt.c + passwd/apr_getpass.c + poll/unix/poll.c + poll/unix/pollcb.c + poll/unix/pollset.c + poll/unix/select.c + poll/unix/wakeup.c + random/unix/apr_random.c + random/unix/sha2.c + random/unix/sha2_glue.c + shmem/win32/shm.c + strings/apr_cpystrn.c + strings/apr_fnmatch.c + strings/apr_snprintf.c + strings/apr_strings.c + strings/apr_strnatcmp.c + strings/apr_strtok.c + strmatch/apr_strmatch.c + tables/apr_hash.c + tables/apr_tables.c + threadproc/win32/proc.c + threadproc/win32/signals.c + threadproc/win32/thread.c + threadproc/win32/threadpriv.c + time/win32/time.c + time/win32/timestr.c + uri/apr_uri.c + user/win32/groupinfo.c + user/win32/userinfo.c + util-misc/apr_date.c + util-misc/apr_queue.c + util-misc/apr_reslist.c + util-misc/apr_rmm.c + util-misc/apr_thread_pool.c + util-misc/apu_dso.c + xlate/xlate.c + xml/apr_xml.c + xml/apr_xml_expat.c + xml/apr_xml_libxml2.c +) + +SET(APR_TEST_SOURCES + test/abts.c + test/testargs.c + test/testatomic.c + test/testbase64.c + test/testbuckets.c + test/testcond.c + test/testcrypto.c + test/testdate.c + test/testdbd.c + test/testdbm.c + test/testdir.c + test/testdso.c + test/testdup.c + test/testenv.c + test/testescape.c + test/testfile.c + test/testfilecopy.c + test/testfileinfo.c + test/testflock.c + test/testfmt.c + test/testfnmatch.c + test/testglobalmutex.c + test/testhash.c + test/testhooks.c + test/testipsub.c + test/testlfs.c + test/testlfsabi.c + test/testlfsabi32.c + test/testlfsabi64.c + test/testlfsabi_include.c + test/testlock.c + test/testmd4.c + test/testmd5.c + test/testmemcache.c + test/testmmap.c + test/testnames.c + test/testoc.c + test/testpass.c + test/testpath.c + test/testpipe.c + test/testpoll.c + test/testpools.c + test/testproc.c + test/testprocmutex.c + test/testqueue.c + test/testrand.c + test/testreslist.c + test/testrmm.c + test/testshm.c + test/testsleep.c + test/testsock.c + test/testsockets.c + test/testsockopt.c + test/teststr.c + test/teststrmatch.c + test/teststrnatcmp.c + test/testtable.c + test/testtemp.c + test/testthread.c + test/testtime.c + test/testud.c + test/testuri.c + test/testuser.c + test/testutil.c + test/testuuid.c + test/testvsn.c + test/testxlate.c + test/testxml.c +) + +SET(WINDOWS_LIBS + wsock32 + ws2_32 + rpcrt4 +) + +SET(install_targets) + +# libapr-2 is shared, apr-2 is static +ADD_LIBRARY(libapr-2 SHARED ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/apr.h) +SET(install_targets ${install_targets} libapr-2) +TARGET_LINK_LIBRARIES(libapr-2 ${XMLLIB_LIBRARIES} ${WINDOWS_LIBS}) +SET_TARGET_PROPERTIES(libapr-2 PROPERTIES COMPILE_FLAGS -DAPR_DECLARE_EXPORT) + +ADD_LIBRARY(apr-2 STATIC ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/apr.h) +SET(install_targets ${install_targets} apr-2) +TARGET_LINK_LIBRARIES(apr-2 ${XMLLIB_LIBRARIES} ${WINDOWS_LIBS}) +SET_TARGET_PROPERTIES(apr-2 PROPERTIES COMPILE_FLAGS -DAPR_DECLARE_STATIC) + +IF(APR_BUILD_TESTAPR) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/data) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/test/data/billion-laughs.xml ${PROJECT_BINARY_DIR}/data/billion-laughs.xml) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/test/data/file_datafile.txt ${PROJECT_BINARY_DIR}/data/file_datafile.txt) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/test/data/mmap_datafile.txt ${PROJECT_BINARY_DIR}/data/mmap_datafile.txt) + + ADD_EXECUTABLE(testall ${APR_TEST_SOURCES}) + TARGET_LINK_LIBRARIES(testall apr-2 ${XMLLIB_LIBRARIES} ${WINDOWS_LIBS}) + + ADD_LIBRARY(mod_test MODULE test/mod_test.c) + TARGET_LINK_LIBRARIES(mod_test apr-2 ${WINDOWS_LIBS}) + SET_PROPERTY(TARGET mod_test APPEND PROPERTY LINK_FLAGS /export:print_hello) + # nasty work-around for difficulties adding more than one additional flag + # (they get joined in a bad way behind the scenes) + GET_PROPERTY(link_flags TARGET mod_test PROPERTY LINK_FLAGS) + SET(link_flags "${link_flags} /export:count_reps") + SET_TARGET_PROPERTIES(mod_test PROPERTIES LINK_FLAGS ${link_flags}) + + ADD_EXECUTABLE(occhild test/occhild.c) + TARGET_LINK_LIBRARIES(occhild apr-2 ${WINDOWS_LIBS}) + + ADD_EXECUTABLE(globalmutexchild test/globalmutexchild.c) + TARGET_LINK_LIBRARIES(globalmutexchild apr-2 ${WINDOWS_LIBS}) + + ADD_EXECUTABLE(proc_child test/proc_child.c) + TARGET_LINK_LIBRARIES(proc_child apr-2 ${WINDOWS_LIBS}) + + ADD_EXECUTABLE(readchild test/readchild.c) + TARGET_LINK_LIBRARIES(readchild apr-2 ${WINDOWS_LIBS}) + + ADD_EXECUTABLE(sockchild test/sockchild.c) + TARGET_LINK_LIBRARIES(sockchild apr-2 ${WINDOWS_LIBS}) + + ADD_EXECUTABLE(testshmconsumer test/testshmconsumer.c) + TARGET_LINK_LIBRARIES(testshmconsumer apr-2 ${WINDOWS_LIBS}) + + ADD_EXECUTABLE(testshmproducer test/testshmproducer.c) + TARGET_LINK_LIBRARIES(testshmproducer apr-2 ${WINDOWS_LIBS}) + + ADD_EXECUTABLE(tryread test/tryread.c) + TARGET_LINK_LIBRARIES(tryread apr-2 ${WINDOWS_LIBS}) + + SET_TARGET_PROPERTIES(testall mod_test occhild globalmutexchild proc_child readchild sockchild testshmconsumer testshmproducer tryread PROPERTIES COMPILE_FLAGS -DAPR_DECLARE_STATIC) + +ENDIF (APR_BUILD_TESTAPR) + +# Installation + +INSTALL(TARGETS ${install_targets} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) + +INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include) +# Kludges for unexpected dependencies of httpd 2.x; at least segregate them in private_include +INSTALL(FILES include/arch/win32/apr_arch_file_io.h DESTINATION private_include/arch/win32) +INSTALL(FILES include/arch/win32/apr_arch_utf8.h DESTINATION private_include/arch/win32) +INSTALL(FILES include/arch/win32/apr_private.h DESTINATION private_include/arch/win32) +INSTALL(FILES include/arch/win32/apr_arch_misc.h DESTINATION private_include/arch/win32) + +IF(APR_SHOW_SETTINGS) + STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype) + MESSAGE(STATUS "") + MESSAGE(STATUS "") + MESSAGE(STATUS "APR configuration summary:") + MESSAGE(STATUS "") + MESSAGE(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}") + MESSAGE(STATUS " C compiler ...................... : ${CMAKE_C_COMPILER}") + MESSAGE(STATUS " IPv6 : ${APR_HAVE_IPV6}") + MESSAGE(STATUS " Use Expat ....................... : ${APU_USE_EXPAT}") + MESSAGE(STATUS " Use LibXml2 ..................... : ${APU_USE_LIBXML2}") + MESSAGE(STATUS " Library files for XML ........... : ${XMLLIB_LIBRARIES}") + MESSAGE(STATUS " Build test suite ................ : ${APR_BUILD_TESTAPR}") +ENDIF(APR_SHOW_SETTINGS) diff --git a/include/apr.hwc b/include/apr.hwc new file mode 100644 index 00000000000..f97224dc9b4 --- /dev/null +++ b/include/apr.hwc @@ -0,0 +1,739 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef APR_H +#define APR_H + +/* GENERATED FILE WARNING! DO NOT EDIT apr.h + * + * You must modify apr.hwc instead. + * + * And please, make an effort to stub apr.hnw and apr.h.in in the process. + * + * This is the Win32 specific version of apr.h. It is copied from + * apr.hw by the apr.dsp and libapr.dsp projects. + */ + +/** + * @file apr.h + * @brief APR Platform Definitions + * @remark This is a generated header generated from include/apr.h.in by + * ./configure, or copied from include/apr.hw or include/apr.hnw + * for Win32 or Netware by those build environments, respectively. + */ + +/* Make sure we have our platform identifier macro defined we ask for later. + */ +#if defined(_WIN32) && !defined(WIN32) +#define WIN32 1 +#endif + +/* Ignore most warnings (back down to /W3) for poorly constructed headers, + * excluded from doxygen parsing + */ +#if defined(_MSC_VER) && _MSC_VER >= 1200 +#pragma warning(push, 3) +#endif + +/* disable or reduce the frequency of... + * C4057: indirection to slightly different base types + * C4075: slight indirection changes (unsigned short* vs short[]) + * C4100: unreferenced formal parameter + * C4127: conditional expression is constant + * C4163: '_rotl64' : not available as an intrinsic function + * C4201: nonstandard extension nameless struct/unions + * C4244: int to char/short - precision loss + * C4514: unreferenced inline function removed + */ +#if defined(_MSC_VER) +#pragma warning(disable: 4100 4127 4163 4201 4514; once: 4057 4075 4244) +#endif + +/* Ignore Microsoft's interpretation of secure development + * and the POSIX string handling API + */ +#if defined(_MSC_VER) && _MSC_VER >= 1400 +#ifndef _CRT_SECURE_NO_DEPRECATE +#define _CRT_SECURE_NO_DEPRECATE +#endif +#pragma warning(disable: 4996) +#endif + +/** + * @file apr.h + * @brief APR Platform Definitions + * @remark This is a generated header generated from include/apr.h.in by + * ./configure, or copied from include/apr.hw or include/apr.hnw + * for Win32 or Netware by those build environments, respectively. + */ + +/** + * @defgroup APR Apache Portability Runtime library + * @{ + */ +/** + * @defgroup apr_platform Platform Definitions + * @{ + * @warning + * The actual values of macros and typedefs on this page
    + * are platform specific and should NOT be relied upon!
    + */ + +/* So that we can use inline on some critical functions, and use + * GNUC attributes (such as to get -Wall warnings for printf-like + * functions). Only do this in gcc 2.7 or later ... it may work + * on earlier stuff, but why chance it. + * + * We've since discovered that the gcc shipped with NeXT systems + * as "cc" is completely broken. It claims to be __GNUC__ and so + * on, but it doesn't implement half of the things that __GNUC__ + * means. In particular it's missing inline and the __attribute__ + * stuff. So we hack around it. PR#1613. -djg + */ +#if defined(_MSC_VER) +#define APR_INLINE __inline +#define APR_HAS_INLINE 1 +#ifndef __attribute__ +#define __attribute__(__x) +#endif +#elif !defined(__GNUC__) || __GNUC__ < 2 || \ + (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\ + defined(NEXT) +#ifndef __attribute__ +#define __attribute__(__x) +#endif +#define APR_INLINE +#define APR_HAS_INLINE 0 +#else +#define APR_INLINE __inline__ +#define APR_HAS_INLINE 1 +#endif + +#ifdef _WIN32_WCE +#define APR_NOT_IN_WCE 0 +#else +#define APR_NOT_IN_WCE 1 +#endif + +#define APR_HAVE_ARPA_INET_H 0 +#define APR_HAVE_CONIO_H APR_NOT_IN_WCE +#define APR_HAVE_CRYPT_H 0 +#define APR_HAVE_CTYPE_H APR_NOT_IN_WCE +#define APR_HAVE_DIRENT_H 0 +#define APR_HAVE_ERRNO_H APR_NOT_IN_WCE +#define APR_HAVE_FCNTL_H APR_NOT_IN_WCE +#define APR_HAVE_IFADDRS_H 0 +#define APR_HAVE_IO_H APR_NOT_IN_WCE +#define APR_HAVE_LIMITS_H APR_NOT_IN_WCE +#define APR_HAVE_MSWSOCK_H APR_NOT_IN_WCE +#define APR_HAVE_NETDB_H 0 +#define APR_HAVE_NETINET_IN_H 0 +#define APR_HAVE_NETINET_SCTP_H 0 +#define APR_HAVE_NETINET_SCTP_UIO_H 0 +#define APR_HAVE_NETINET_TCP_H 0 +#define APR_HAVE_PROCESS_H 1 +#define APR_HAVE_PTHREAD_H 0 +#define APR_HAVE_SEMAPHORE_H 0 +#define APR_HAVE_SIGNAL_H APR_NOT_IN_WCE +#define APR_HAVE_STDARG_H APR_NOT_IN_WCE +#define APR_HAVE_STDDEF_H APR_NOT_IN_WCE +#define APR_HAVE_STDINT_H 0 +#define APR_HAVE_STDIO_H 1 +#define APR_HAVE_STDLIB_H 1 +#define APR_HAVE_STRING_H 1 +#define APR_HAVE_STRINGS_H 0 +#define APR_HAVE_SYS_IOCTL_H 0 +#define APR_HAVE_SYS_SENDFILE_H 0 +#define APR_HAVE_SYS_SIGNAL_H 0 +#define APR_HAVE_SYS_SOCKET_H 0 +#define APR_HAVE_SYS_SOCKIO_H 0 +#define APR_HAVE_SYS_SYSLIMITS_H 0 +#define APR_HAVE_SYS_TIME_H 0 +#define APR_HAVE_SYS_TYPES_H APR_NOT_IN_WCE +#define APR_HAVE_SYS_UIO_H 0 +#define APR_HAVE_SYS_UN_H 0 +#define APR_HAVE_SYS_WAIT_H 0 +#define APR_HAVE_TIME_H APR_NOT_IN_WCE +#define APR_HAVE_UNISTD_H 0 +#define APR_HAVE_WINDOWS_H 1 +#define APR_HAVE_WINSOCK2_H APR_NOT_IN_WCE +#define APR_HAVE_WS2TCPIP_H APR_NOT_IN_WCE + +/** @} */ +/** @} */ + +/* We don't include our conditional headers within the doxyblocks + * or the extern "C" namespace + */ + +/* If windows.h was already included, our preferences don't matter. + * If not, include a restricted set of windows headers to our tastes. + */ +#if APR_HAVE_WINDOWS_H +#ifndef _WINDOWS_ + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0501 +#endif + +#ifndef NOUSER +#define NOUSER +#endif +#ifndef NOMCX +#define NOMCX +#endif +#ifndef NOIME +#define NOIME +#endif + +/* Impossible to include winsock2.h after winsock.h, while windows.h + * attempts to load winsock. Setting _WINSOCKAPI_ will dodge this. + */ +#if APR_HAVE_WINSOCK2_H +#define _WINSOCKAPI_ +#endif + +#include +#endif +#endif + +#if APR_HAVE_WINSOCK2_H +#include + +#if APR_HAVE_WS2TCPIP_H +#include +#endif + +#if APR_HAVE_MSWSOCK_H +#include +#endif + +#else /* !APR_HAVE_WINSOCK2_H */ + +#if APR_HAVE_WINSOCK_H +#include +#endif + +#endif /* !APR_HAVE_WINSOCK2_H */ + +#if APR_HAVE_SYS_TYPES_H +#include +#endif + +#if APR_HAVE_STDDEF_H +#include +#endif + +#if APR_HAVE_SYS_SOCKET_H +#include +#endif + +#if APR_HAVE_STDINT_H +#include +#endif + +#if APR_HAVE_SYS_WAIT_H +#include +#endif + +/* header files for PATH_MAX, _POSIX_PATH_MAX */ +#if APR_HAVE_LIMITS_H +#include +#else +#if APR_HAVE_SYS_SYSLIMITS_H +#include +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup apr_platform + * @ingroup APR + * @{ + */ + +#define APR_HAVE_SHMEM_MMAP_TMP 0 +#define APR_HAVE_SHMEM_MMAP_SHM 0 +#define APR_HAVE_SHMEM_MMAP_ZERO 0 +#define APR_HAVE_SHMEM_SHMGET_ANON 0 +#define APR_HAVE_SHMEM_SHMGET 0 +#define APR_HAVE_SHMEM_MMAP_ANON 0 +#define APR_HAVE_SHMEM_BEOS 0 + +#define APR_USE_SHMEM_MMAP_TMP 0 +#define APR_USE_SHMEM_MMAP_SHM 0 +#define APR_USE_SHMEM_MMAP_ZERO 0 +#define APR_USE_SHMEM_SHMGET_ANON 0 +#define APR_USE_SHMEM_SHMGET 0 +#define APR_USE_SHMEM_MMAP_ANON 0 +#define APR_USE_SHMEM_BEOS 0 + +#define APR_USE_FLOCK_SERIALIZE 0 +#define APR_USE_SYSVSEM_SERIALIZE 0 +#define APR_USE_POSIXSEM_SERIALIZE 0 +#define APR_USE_FCNTL_SERIALIZE 0 +#define APR_USE_PROC_PTHREAD_SERIALIZE 0 +#define APR_USE_PTHREAD_SERIALIZE 0 + +#define APR_HAS_FLOCK_SERIALIZE 0 +#define APR_HAS_SYSVSEM_SERIALIZE 0 +#define APR_HAS_POSIXSEM_SERIALIZE 0 +#define APR_HAS_FCNTL_SERIALIZE 0 +#define APR_HAS_PROC_PTHREAD_SERIALIZE 0 + +#define APR_PROCESS_LOCK_IS_GLOBAL 0 + +#define APR_HAVE_CORKABLE_TCP 0 +#define APR_HAVE_GETRLIMIT 0 +#define APR_HAVE_ICONV 0 +#define APR_HAVE_IN_ADDR 1 +#define APR_HAVE_INET_ADDR 1 +#define APR_HAVE_INET_NETWORK 0 +#define APR_HAVE_IPV6 @apr_have_ipv6_10@ +#define APR_HAVE_SOCKADDR_UN 0 +#define APR_HAVE_MEMMOVE 1 +#define APR_HAVE_SETRLIMIT 0 +#define APR_HAVE_SIGACTION 0 +#define APR_HAVE_SIGSUSPEND 0 +#define APR_HAVE_SIGWAIT 0 +#define APR_HAVE_SA_STORAGE 0 +#define APR_HAVE_STRCASECMP 0 +#define APR_HAVE_STRDUP 1 +#define APR_HAVE_STRICMP APR_NOT_IN_WCE +#define APR_HAVE_STRNCASECMP 0 +#define APR_HAVE_STRNICMP APR_NOT_IN_WCE +#define APR_HAVE_STRSTR 1 +#define APR_HAVE_MEMCHR 1 +#define APR_HAVE_STRUCT_RLIMIT 0 +#define APR_HAVE_UNION_SEMUN 0 +#define APR_HAVE_SCTP 0 +#define APR_HAVE_IOVEC 0 + +/* APR Feature Macros */ +#define APR_HAS_SHARED_MEMORY 1 +#define APR_HAS_THREADS 1 +#define APR_HAS_SENDFILE APR_NOT_IN_WCE +#define APR_HAS_MMAP 1 +#define APR_HAS_FORK 0 +#define APR_HAS_RANDOM 1 +#define APR_HAS_OTHER_CHILD 1 +#define APR_HAS_DSO 1 +#define APR_HAS_SO_ACCEPTFILTER 0 +#define APR_HAS_UNICODE_FS 1 +#define APR_HAS_PROC_INVOKED 1 +#define APR_HAS_USER APR_NOT_IN_WCE +#define APR_HAS_LARGE_FILES APR_NOT_IN_WCE +#define APR_HAS_XTHREAD_FILES APR_NOT_IN_WCE +#define APR_HAS_OS_UUID 1 + +#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD APR_NOT_IN_WCE + +/* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible + * to poll on files/pipes. + */ +#define APR_FILES_AS_SOCKETS 0 + +/* This macro indicates whether or not EBCDIC is the native character set. + */ +#define APR_CHARSET_EBCDIC 0 + +/* If we have a TCP implementation that can be "corked", what flag + * do we use? + */ +#define APR_TCP_NOPUSH_FLAG 0 + +/* Is the TCP_NODELAY socket option inherited from listening sockets? + */ +#define APR_TCP_NODELAY_INHERITED 1 + +/* Is the O_NONBLOCK flag inherited from listening sockets? + */ +#define APR_O_NONBLOCK_INHERITED 1 + +/* Typedefs that APR needs. */ + +typedef unsigned char apr_byte_t; + +typedef short apr_int16_t; +typedef unsigned short apr_uint16_t; + +typedef int apr_int32_t; +typedef unsigned int apr_uint32_t; + +typedef __int64 apr_int64_t; +typedef unsigned __int64 apr_uint64_t; + +typedef size_t apr_size_t; +#if APR_HAVE_STDDEF_H +typedef ptrdiff_t apr_ssize_t; +#else +typedef int apr_ssize_t; +#endif + +#if APR_HAS_LARGE_FILES +typedef __int64 apr_off_t; +#else +typedef long apr_off_t; +#endif +typedef int apr_socklen_t; +typedef apr_uint64_t apr_ino_t; + +#ifdef _WIN64 +#define APR_SIZEOF_VOIDP 8 +#else +#define APR_SIZEOF_VOIDP 4 +#endif + +#if APR_SIZEOF_VOIDP == 8 +typedef apr_uint64_t apr_uintptr_t; +#else +typedef apr_uint32_t apr_uintptr_t; +#endif + +/* Are we big endian? */ +/* XXX: Fatal assumption on Alpha platforms */ +#define APR_IS_BIGENDIAN 0 + +/* Mechanisms to properly type numeric literals */ + +#ifndef __GNUC__ +#define APR_INT64_C(val) (val##i64) +#define APR_UINT64_C(val) (val##Ui64) +#else +#define APR_INT64_C(val) (val##LL) +#define APR_UINT64_C(val) (val##ULL) +#endif + +#ifdef INT16_MIN +#define APR_INT16_MIN INT16_MIN +#else +#define APR_INT16_MIN (-0x7fff - 1) +#endif + +#ifdef INT16_MAX +#define APR_INT16_MAX INT16_MAX +#else +#define APR_INT16_MAX (0x7fff) +#endif + +#ifdef UINT16_MAX +#define APR_UINT16_MAX UINT16_MAX +#else +#define APR_UINT16_MAX (0xffff) +#endif + +#ifdef INT32_MIN +#define APR_INT32_MIN INT32_MIN +#else +#define APR_INT32_MIN (-0x7fffffff - 1) +#endif + +#ifdef INT32_MAX +#define APR_INT32_MAX INT32_MAX +#else +#define APR_INT32_MAX 0x7fffffff +#endif + +#ifdef UINT32_MAX +#define APR_UINT32_MAX UINT32_MAX +#else +#define APR_UINT32_MAX (0xffffffffU) +#endif + +#ifdef INT64_MIN +#define APR_INT64_MIN INT64_MIN +#else +#define APR_INT64_MIN (APR_INT64_C(-0x7fffffffffffffff) - 1) +#endif + +#ifdef INT64_MAX +#define APR_INT64_MAX INT64_MAX +#else +#define APR_INT64_MAX APR_INT64_C(0x7fffffffffffffff) +#endif + +#ifdef UINT64_MAX +#define APR_UINT64_MAX UINT64_MAX +#else +#define APR_UINT64_MAX APR_UINT64_C(0xffffffffffffffff) +#endif + +#define APR_SIZE_MAX (~((apr_size_t)0)) + +/* Definitions that APR programs need to work properly. */ + +/** + * APR public API wrap for C++ compilers. + */ +#ifdef __cplusplus +#define APR_BEGIN_DECLS extern "C" { +#define APR_END_DECLS } +#else +#define APR_BEGIN_DECLS +#define APR_END_DECLS +#endif + +/** + * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, + * so that they follow the platform's calling convention. + *
    + *
    + * void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
    + *
    + * 
    + */ +#define APR_THREAD_FUNC __stdcall + + +#if defined(DOXYGEN) || !defined(WIN32) + +/** + * The public APR functions are declared with APR_DECLARE(), so they may + * use the most appropriate calling convention. Public APR functions with + * variable arguments must use APR_DECLARE_NONSTD(). + * + * @remark Both the declaration and implementations must use the same macro. + * + *
    + * APR_DECLARE(rettype) apr_func(args)
    + * 
    + * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA + * @remark Note that when APR compiles the library itself, it passes the + * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) + * to export public symbols from the dynamic library build.\n + * The user must define the APR_DECLARE_STATIC when compiling to target + * the static APR library on some platforms (e.g. Win32.) The public symbols + * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n + * By default, compiling an application and including the APR public + * headers, without defining APR_DECLARE_STATIC, will prepare the code to be + * linked to the dynamic library. + */ +#define APR_DECLARE(type) type + +/** + * The public APR functions using variable arguments are declared with + * APR_DECLARE_NONSTD(), as they must follow the C language calling convention. + * @see APR_DECLARE @see APR_DECLARE_DATA + * @remark Both the declaration and implementations must use the same macro. + *
    + *
    + * APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
    + *
    + * 
    + */ +#define APR_DECLARE_NONSTD(type) type + +/** + * The public APR variables are declared with APR_DECLARE_DATA. + * This assures the appropriate indirection is invoked at compile time. + * @see APR_DECLARE @see APR_DECLARE_NONSTD + * @remark Note that the declaration and implementations use different forms, + * but both must include the macro. + * + *
    + *
    + * extern APR_DECLARE_DATA type apr_variable;\n
    + * APR_DECLARE_DATA type apr_variable = value;
    + *
    + * 
    + */ +#define APR_DECLARE_DATA + +#elif defined(APR_DECLARE_STATIC) +#define APR_DECLARE(type) type __stdcall +#define APR_DECLARE_NONSTD(type) type __cdecl +#define APR_DECLARE_DATA +#elif defined(APR_DECLARE_EXPORT) +#define APR_DECLARE(type) __declspec(dllexport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl +#define APR_DECLARE_DATA __declspec(dllexport) +#else +#define APR_DECLARE(type) __declspec(dllimport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl +#define APR_DECLARE_DATA __declspec(dllimport) +#endif + +#if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) +/** + * Declare a dso module's exported module structure as APR_MODULE_DECLARE_DATA. + * + * Unless APR_MODULE_DECLARE_STATIC is defined at compile time, symbols + * declared with APR_MODULE_DECLARE_DATA are always exported. + * @code + * module APR_MODULE_DECLARE_DATA mod_tag + * @endcode + */ +#define APR_MODULE_DECLARE_DATA +#else +#define APR_MODULE_DECLARE_DATA __declspec(dllexport) +#endif + +/** + * @deprecated + * @see APR_MODULE_DECLARE_DATA + */ +#define APU_MODULE_DECLARE_DATA APR_MODULE_DECLARE_DATA + +/* Define APR_SSIZE_T_FMT. + * If ssize_t is an integer we define it to be "d", + * if ssize_t is a long int we define it to be "ld", + * if ssize_t is 64-bit, we define it to be msvc specific "I64d" + */ +#ifdef _WIN64 +#define APR_SSIZE_T_FMT "I64d" +#define APR_SIZE_T_FMT "I64u" +#else +#define APR_SSIZE_T_FMT "d" +#define APR_SIZE_T_FMT "u" +#endif + +#if APR_HAS_LARGE_FILES +#define APR_OFF_T_FMT "I64d" +#else +#define APR_OFF_T_FMT "d" +#endif + +#define APR_PID_T_FMT "d" + +#define APR_INT64_T_FMT "I64d" +#define APR_UINT64_T_FMT "I64u" +#define APR_UINT64_T_HEX_FMT "I64x" + +/* No difference between PROC and GLOBAL mutex */ +#define APR_PROC_MUTEX_IS_GLOBAL 1 + +/* Local machine definition for console and log output. */ +#define APR_EOL_STR "\r\n" + +typedef int apr_wait_t; + +#if APR_HAS_UNICODE_FS +/* An arbitrary size that is digestable. True max is a bit less than 32000 */ +#define APR_PATH_MAX 8192 +#else /* !APR_HAS_UNICODE_FS */ +#define APR_PATH_MAX MAX_PATH +#endif + +#define APR_DSOPATH "PATH" + +/* + * we always have SDBM (it's in our codebase) + */ +#define APU_HAVE_SDBM 1 + +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_GDBM 0 +#define APU_HAVE_NDBM 0 +#define APU_HAVE_DB 0 + +#if APU_HAVE_DB +#define APU_HAVE_DB_VERSION 0 +#endif +#endif + +/* + * we always enable dynamic driver loads within apr_dbd + * driver builds enable these flags individually + */ +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_PGSQL 0 +#define APU_HAVE_MYSQL 0 +#define APU_HAVE_SQLITE3 0 +#define APU_HAVE_SQLITE2 0 +#define APU_HAVE_ORACLE 0 +#define APU_HAVE_ODBC 0 +#endif + +#define APU_HAVE_CRYPTO 0 + +#ifndef APU_DSO_MODULE_BUILD +#define APU_HAVE_OPENSSL 0 +#define APU_HAVE_NSS 0 +#define APU_HAVE_COMMONCRYPTO 0 +#endif + +#define APU_HAVE_ICONV 0 +#define APR_HAS_XLATE (APU_HAVE_ICONV) + +#define APU_USE_EXPAT @apu_use_expat_10@ +#define APU_USE_LIBXML2 @apu_use_libxml2_10@ + +/** @} */ + +/* Definitions that only Win32 programs need to compile properly. */ + +/* XXX These simply don't belong here, perhaps in apr_portable.h + * based on some APR_HAVE_PID/GID/UID? + */ +#ifdef WIN32 +#ifndef __WATCOMC__ +#ifndef __GNUC__ +typedef int pid_t; +#endif +typedef int uid_t; +typedef int gid_t; +#endif +#endif + +/* Typically defined in stdio.h or unistd.h + */ +#ifndef STDIN_FILENO +#define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +#define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +#define STDERR_FILENO 2 +#endif + +#if APR_HAVE_IPV6 + +/* Appears in later flavors, not the originals. */ +#ifndef in_addr6 +#define in6_addr in_addr6 +#endif + +#ifndef WS2TCPIP_INLINE +#define IN6_IS_ADDR_V4MAPPED(a) \ + ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \ + && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) +#endif + +#endif /* APR_HAVE_IPV6 */ + +#ifdef __cplusplus +} +#endif + +/* Done with badly written headers, leave 'deprecated CRT' undeprecated + */ +#if defined(_MSC_VER) && _MSC_VER >= 1200 +#pragma warning(pop) +#if _MSC_VER >= 1400 +#pragma warning(disable: 4996) +#endif +#endif + +#endif /* APR_H */ From ee3367663084d984bd39cfb386b81287e2904237 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 22 Aug 2013 20:52:54 +0000 Subject: [PATCH 7283/7878] Pull some source files out of the apr library that should be enabled in a DSO via APU_HAVE_PGSQL/NSS/etc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1516603 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 44 +++++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed996926013..be51430a910 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,23 +9,26 @@ PROJECT(APR C) # . Options for remaining features, along with finding any necessary libraries # + APR_POOL_DEBUG # + APU_DSO_MODULE_BUILD -# + APU_HAVE_GDBM -# + APU_HAVE_NDBM -# + APU_HAVE_DB -# + APU_HAVE_PGSQL -# + APU_HAVE_MYSQL -# + APU_HAVE_SQLITE3 -# + APU_HAVE_SQLITE2 -# + APU_HAVE_ORACLE -# + APU_HAVE_ODBC -# + APU_HAVE_CRYPTO -# + APU_HAVE_OPENSSL -# + APU_HAVE_NSS -# + APU_HAVE_COMMONCRYPTO +# + DBM: +# . APU_HAVE_GDBM +# . APU_HAVE_NDBM +# . APU_HAVE_DB +# + DBD: +# . APU_HAVE_PGSQL +# . APU_HAVE_MYSQL +# . APU_HAVE_SQLITE3 +# . APU_HAVE_SQLITE2 +# . APU_HAVE_ORACLE +# . APU_HAVE_ODBC +# + CRYPTO: +# . APU_HAVE_CRYPTO +# . APU_HAVE_OPENSSL +# . APU_HAVE_NSS +# . APU_HAVE_COMMONCRYPTO # + APU_HAVE_ICONV # + APU_USE_LIBXML2 (sketched in, but not working) # . Support static *or* shared build of Expat -# . Some easier way to run the test suite (not just testall.exe) +# . Some easier way to run the test suite (the stuff besides testall.exe) # . All the other stuff Jeff doesn't know about yet CMAKE_MINIMUM_REQUIRED(VERSION 2.8) @@ -181,9 +184,6 @@ SET(APR_SOURCES buckets/apr_buckets_simple.c buckets/apr_buckets_socket.c crypto/apr_crypto.c - crypto/apr_crypto_commoncrypto.c - crypto/apr_crypto_nss.c - crypto/apr_crypto_openssl.c crypto/apr_md4.c crypto/apr_md5.c crypto/apr_passwd.c @@ -192,17 +192,7 @@ SET(APR_SOURCES crypto/getuuid.c crypto/uuid.c dbd/apr_dbd.c - dbd/apr_dbd_mysql.c - dbd/apr_dbd_odbc.c - dbd/apr_dbd_oracle.c - dbd/apr_dbd_pgsql.c - dbd/apr_dbd_sqlite2.c - dbd/apr_dbd_sqlite3.c - dbd/unsupported/apr_dbd_freetds.c dbm/apr_dbm.c - dbm/apr_dbm_berkeleydb.c - dbm/apr_dbm_gdbm.c - dbm/apr_dbm_ndbm.c dbm/apr_dbm_sdbm.c dbm/sdbm/sdbm.c dbm/sdbm/sdbm_hash.c From a742ed21fd3fceea24d9dcb737e83b3975484dce Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 22 Aug 2013 21:32:43 +0000 Subject: [PATCH 7284/7878] tiny cleanups based on tdonovan's cmake lists git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1516618 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++- CMakeLists.txt | 54 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/CHANGES b/CHANGES index d5de43a2287..0fb1f6ef013 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) Add experimental cmake-based build system for Windows. [Jeff Trawick] + *) Add experimental cmake-based build system for Windows. [Jeff Trawick, + Tom Donovan] *) Add support for Berkeley DB 6.0. [Rainer Jung] diff --git a/CMakeLists.txt b/CMakeLists.txt index be51430a910..844c56fca9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,10 +89,28 @@ ELSE() SET(XMLLIB_LIBRARIES ${LIBXML2_LIBRARIES}) ENDIF() -# BROKEN: not searching PROJECT_BINARY_DIR first, so I have to +# Generated .h files are stored in PROJECT_BINARY_DIR, not the +# source tree. +# +# BROKEN: not searching PROJECT_BINARY_DIR first, so you have to # manually delete apr.h in PROJECT_SOURCE_DIR/include if -# I've generated apr.h before using a Unix-style build -INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/include/private ${PROJECT_SOURCE_DIR}/include/arch/win32 ${PROJECT_SOURCE_DIR}/include/private ${PROJECT_SOURCE_DIR}/include/arch/unix ${XMLLIB_INCLUDE_DIR}) +# you've generated apr.h before using a different build + +SET(APR_INCLUDE_DIRECTORIES + ${PROJECT_BINARY_DIR} + include + include/arch/win32 + include/arch/unix + include/private +) + +SET(APR_SYSTEM_LIBS + ws2_32 + mswsock + rpcrt4 +) + +INCLUDE_DIRECTORIES(${APR_INCLUDE_DIRECTORIES} ${XMLLIB_INCLUDE_DIR}) SET(APR_HEADERS ${PROJECT_BINARY_DIR}/apr.h) @@ -357,23 +375,17 @@ SET(APR_TEST_SOURCES test/testxml.c ) -SET(WINDOWS_LIBS - wsock32 - ws2_32 - rpcrt4 -) - SET(install_targets) # libapr-2 is shared, apr-2 is static ADD_LIBRARY(libapr-2 SHARED ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/apr.h) SET(install_targets ${install_targets} libapr-2) -TARGET_LINK_LIBRARIES(libapr-2 ${XMLLIB_LIBRARIES} ${WINDOWS_LIBS}) +TARGET_LINK_LIBRARIES(libapr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) SET_TARGET_PROPERTIES(libapr-2 PROPERTIES COMPILE_FLAGS -DAPR_DECLARE_EXPORT) ADD_LIBRARY(apr-2 STATIC ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/apr.h) SET(install_targets ${install_targets} apr-2) -TARGET_LINK_LIBRARIES(apr-2 ${XMLLIB_LIBRARIES} ${WINDOWS_LIBS}) +TARGET_LINK_LIBRARIES(apr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) SET_TARGET_PROPERTIES(apr-2 PROPERTIES COMPILE_FLAGS -DAPR_DECLARE_STATIC) IF(APR_BUILD_TESTAPR) @@ -383,10 +395,10 @@ IF(APR_BUILD_TESTAPR) EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/test/data/mmap_datafile.txt ${PROJECT_BINARY_DIR}/data/mmap_datafile.txt) ADD_EXECUTABLE(testall ${APR_TEST_SOURCES}) - TARGET_LINK_LIBRARIES(testall apr-2 ${XMLLIB_LIBRARIES} ${WINDOWS_LIBS}) + TARGET_LINK_LIBRARIES(testall apr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) ADD_LIBRARY(mod_test MODULE test/mod_test.c) - TARGET_LINK_LIBRARIES(mod_test apr-2 ${WINDOWS_LIBS}) + TARGET_LINK_LIBRARIES(mod_test apr-2 ${APR_SYSTEM_LIBS}) SET_PROPERTY(TARGET mod_test APPEND PROPERTY LINK_FLAGS /export:print_hello) # nasty work-around for difficulties adding more than one additional flag # (they get joined in a bad way behind the scenes) @@ -395,28 +407,28 @@ IF(APR_BUILD_TESTAPR) SET_TARGET_PROPERTIES(mod_test PROPERTIES LINK_FLAGS ${link_flags}) ADD_EXECUTABLE(occhild test/occhild.c) - TARGET_LINK_LIBRARIES(occhild apr-2 ${WINDOWS_LIBS}) + TARGET_LINK_LIBRARIES(occhild apr-2 ${APR_SYSTEM_LIBS}) ADD_EXECUTABLE(globalmutexchild test/globalmutexchild.c) - TARGET_LINK_LIBRARIES(globalmutexchild apr-2 ${WINDOWS_LIBS}) + TARGET_LINK_LIBRARIES(globalmutexchild apr-2 ${APR_SYSTEM_LIBS}) ADD_EXECUTABLE(proc_child test/proc_child.c) - TARGET_LINK_LIBRARIES(proc_child apr-2 ${WINDOWS_LIBS}) + TARGET_LINK_LIBRARIES(proc_child apr-2 ${APR_SYSTEM_LIBS}) ADD_EXECUTABLE(readchild test/readchild.c) - TARGET_LINK_LIBRARIES(readchild apr-2 ${WINDOWS_LIBS}) + TARGET_LINK_LIBRARIES(readchild apr-2 ${APR_SYSTEM_LIBS}) ADD_EXECUTABLE(sockchild test/sockchild.c) - TARGET_LINK_LIBRARIES(sockchild apr-2 ${WINDOWS_LIBS}) + TARGET_LINK_LIBRARIES(sockchild apr-2 ${APR_SYSTEM_LIBS}) ADD_EXECUTABLE(testshmconsumer test/testshmconsumer.c) - TARGET_LINK_LIBRARIES(testshmconsumer apr-2 ${WINDOWS_LIBS}) + TARGET_LINK_LIBRARIES(testshmconsumer apr-2 ${APR_SYSTEM_LIBS}) ADD_EXECUTABLE(testshmproducer test/testshmproducer.c) - TARGET_LINK_LIBRARIES(testshmproducer apr-2 ${WINDOWS_LIBS}) + TARGET_LINK_LIBRARIES(testshmproducer apr-2 ${APR_SYSTEM_LIBS}) ADD_EXECUTABLE(tryread test/tryread.c) - TARGET_LINK_LIBRARIES(tryread apr-2 ${WINDOWS_LIBS}) + TARGET_LINK_LIBRARIES(tryread apr-2 ${APR_SYSTEM_LIBS}) SET_TARGET_PROPERTIES(testall mod_test occhild globalmutexchild proc_child readchild sockchild testshmconsumer testshmproducer tryread PROPERTIES COMPILE_FLAGS -DAPR_DECLARE_STATIC) From b7a81b93c00a15d54c35a9e0f69b692065df110a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 23 Aug 2013 01:21:24 +0000 Subject: [PATCH 7285/7878] Run gen_test_char during the build, as with autoconf-based build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1516674 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 844c56fca9d..98a0c5aad35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,6 @@ PROJECT(APR C) # . Fix problem where srcdir/include/apr.h (if it exists) is found before builddir/apr.h # (and similar for apu_want.h) # . Document example 32-bit and 64-bit Windows builds using NMake -# . Build and optionally run gen_test_char # . Build apr_app.c into libapr-2 properly (what about apr-2.lib?) # . Options for remaining features, along with finding any necessary libraries # + APR_POOL_DEBUG @@ -81,6 +80,19 @@ CONFIGURE_FILE(include/apu_want.hw ${PROJECT_BINARY_DIR}/apu_want.h COPYONLY) +ADD_EXECUTABLE(gen_test_char tools/gen_test_char.c) +GET_TARGET_PROPERTY(GEN_TEST_CHAR_EXE gen_test_char LOCATION) +ADD_CUSTOM_COMMAND( + COMMENT "Generating character tables, apr_escape_test_char.h, for current locale" + DEPENDS gen_test_char + COMMAND ${GEN_TEST_CHAR_EXE} > ${PROJECT_BINARY_DIR}/apr_escape_test_char.h + OUTPUT ${PROJECT_BINARY_DIR}/apr_escape_test_char.h +) +ADD_CUSTOM_TARGET( + test_char_header ALL + DEPENDS ${PROJECT_BINARY_DIR}/apr_escape_test_char.h +) + IF(APU_USE_EXPAT) SET(XMLLIB_INCLUDE_DIR ${EXPAT_INCLUDE_DIRS}) SET(XMLLIB_LIBRARIES ${EXPAT_LIBRARIES}) @@ -382,11 +394,13 @@ ADD_LIBRARY(libapr-2 SHARED ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/ SET(install_targets ${install_targets} libapr-2) TARGET_LINK_LIBRARIES(libapr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) SET_TARGET_PROPERTIES(libapr-2 PROPERTIES COMPILE_FLAGS -DAPR_DECLARE_EXPORT) +ADD_DEPENDENCIES(libapr-2 test_char_header) ADD_LIBRARY(apr-2 STATIC ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/apr.h) SET(install_targets ${install_targets} apr-2) TARGET_LINK_LIBRARIES(apr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) SET_TARGET_PROPERTIES(apr-2 PROPERTIES COMPILE_FLAGS -DAPR_DECLARE_STATIC) +ADD_DEPENDENCIES(apr-2 test_char_header) IF(APR_BUILD_TESTAPR) EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/data) From 3755fef1269aa89dc7a449b5cb1c6f9d514ff38f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 23 Aug 2013 13:16:45 +0000 Subject: [PATCH 7286/7878] Include apr_version.h to get the value of APR_MAJOR_VERSION so that we don't go looking in /apr-APR_MAJOR_VERSION for APU DSOs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1516839 13f79535-47bb-0310-9956-ffa450edef68 --- util-misc/apu_dso.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util-misc/apu_dso.c b/util-misc/apu_dso.c index 909af706dbb..dd29076eb73 100644 --- a/util-misc/apu_dso.c +++ b/util-misc/apu_dso.c @@ -27,6 +27,7 @@ #include "apr_file_io.h" #include "apr_env.h" #include "apr_atomic.h" +#include "apr_version.h" #include "apu_internal.h" From 0c47d99711f32a55ac5d1e199dc206e6262be351 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 23 Aug 2013 13:21:55 +0000 Subject: [PATCH 7287/7878] Provide more information for unexpected APU DSO load errors. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1516842 13f79535-47bb-0310-9956-ffa450edef68 --- test/dbd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/dbd.c b/test/dbd.c index 61f49ab6799..dc2b1fb2401 100644 --- a/test/dbd.c +++ b/test/dbd.c @@ -346,6 +346,7 @@ int main(int argc, char** argv) apr_pool_t *pool = NULL; apr_dbd_t *sql = NULL; const apr_dbd_driver_t *driver = NULL; + char errbuf[256]; int rv; apr_initialize(); @@ -372,6 +373,7 @@ int main(int argc, char** argv) goto finish; default: /* it's a bug if none of the above happen */ printf("Internal error loading %s.\n", name); + printf("(%d)%s\n", rv, apr_strerror(rv, errbuf, sizeof errbuf)); goto finish; } rv = apr_dbd_open(driver, pool, params, &sql); From 2a00ae5f842e56d2fe37531f025dbe780a6f3c3f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 23 Aug 2013 14:36:59 +0000 Subject: [PATCH 7288/7878] Support DBD ODBC driver as an optional feature, defaulting to ON since the libraries are always available on Windows. (A fair amount of this is from Tom Donovan's cmake list.) Enable the DBD test driver when the test suite is being built. Add/clarify a small amount of commentary about the lack of a test suite build for libapr-2 (the DLL) and the manner in which DBD driver are expected to be built. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1516863 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 24 +++++++++++++++++++----- include/apr.hwc | 5 +++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98a0c5aad35..57bd4efdb90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,6 @@ PROJECT(APR C) # . APU_HAVE_SQLITE3 # . APU_HAVE_SQLITE2 # . APU_HAVE_ORACLE -# . APU_HAVE_ODBC # + CRYPTO: # . APU_HAVE_CRYPTO # . APU_HAVE_OPENSSL @@ -26,6 +25,7 @@ PROJECT(APR C) # . APU_HAVE_COMMONCRYPTO # + APU_HAVE_ICONV # + APU_USE_LIBXML2 (sketched in, but not working) +# . Alternate build of test programs to use libapr-2.dll # . Support static *or* shared build of Expat # . Some easier way to run the test suite (the stuff besides testall.exe) # . All the other stuff Jeff doesn't know about yet @@ -49,6 +49,7 @@ ELSE() OPTION(APU_USE_LIBXML2 "Use LibXml2" ON) ENDIF() +OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON) OPTION(APR_HAVE_IPV6 "IPv6 support" ON) OPTION(APR_SHOW_SETTINGS "Show the build configuration" ON) OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) @@ -393,15 +394,23 @@ SET(install_targets) ADD_LIBRARY(libapr-2 SHARED ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/apr.h) SET(install_targets ${install_targets} libapr-2) TARGET_LINK_LIBRARIES(libapr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) -SET_TARGET_PROPERTIES(libapr-2 PROPERTIES COMPILE_FLAGS -DAPR_DECLARE_EXPORT) +SET_TARGET_PROPERTIES(libapr-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_EXPORT;APR_HAVE_MODULAR_DSO") ADD_DEPENDENCIES(libapr-2 test_char_header) ADD_LIBRARY(apr-2 STATIC ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/apr.h) SET(install_targets ${install_targets} apr-2) TARGET_LINK_LIBRARIES(apr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) -SET_TARGET_PROPERTIES(apr-2 PROPERTIES COMPILE_FLAGS -DAPR_DECLARE_STATIC) +SET_TARGET_PROPERTIES(apr-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_HAVE_MODULAR_DSO") ADD_DEPENDENCIES(apr-2 test_char_header) +IF(APU_HAVE_ODBC) + ADD_LIBRARY(apr_dbd_odbc-2 SHARED dbd/apr_dbd_odbc.c) + SET(install_targets ${install_targets} apr_dbd_odbc-2) + TARGET_LINK_LIBRARIES(apr_dbd_odbc-2 libapr-2 ${APR_SYSTEM_LIBS} odbc32 odbccp32) + SET_PROPERTY(TARGET apr_dbd_odbc-2 APPEND PROPERTY LINK_FLAGS /export:apr_dbd_odbc_driver) + SET_TARGET_PROPERTIES(apr_dbd_odbc-2 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APR_DECLARE_EXPORT;APU_DSO_MODULE_BUILD") +ENDIF() + IF(APR_BUILD_TESTAPR) EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/data) EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/test/data/billion-laughs.xml ${PROJECT_BINARY_DIR}/data/billion-laughs.xml) @@ -420,6 +429,9 @@ IF(APR_BUILD_TESTAPR) SET(link_flags "${link_flags} /export:count_reps") SET_TARGET_PROPERTIES(mod_test PROPERTIES LINK_FLAGS ${link_flags}) + ADD_EXECUTABLE(dbd test/dbd.c) + TARGET_LINK_LIBRARIES(dbd apr-2 ${APR_SYSTEM_LIBS}) + ADD_EXECUTABLE(occhild test/occhild.c) TARGET_LINK_LIBRARIES(occhild apr-2 ${APR_SYSTEM_LIBS}) @@ -444,7 +456,8 @@ IF(APR_BUILD_TESTAPR) ADD_EXECUTABLE(tryread test/tryread.c) TARGET_LINK_LIBRARIES(tryread apr-2 ${APR_SYSTEM_LIBS}) - SET_TARGET_PROPERTIES(testall mod_test occhild globalmutexchild proc_child readchild sockchild testshmconsumer testshmproducer tryread PROPERTIES COMPILE_FLAGS -DAPR_DECLARE_STATIC) + # test programs are linked with static library + SET_TARGET_PROPERTIES(testall dbd mod_test occhild globalmutexchild proc_child readchild sockchild testshmconsumer testshmproducer tryread PROPERTIES COMPILE_FLAGS -DAPR_DECLARE_STATIC) ENDIF (APR_BUILD_TESTAPR) @@ -471,7 +484,8 @@ IF(APR_SHOW_SETTINGS) MESSAGE(STATUS "") MESSAGE(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}") MESSAGE(STATUS " C compiler ...................... : ${CMAKE_C_COMPILER}") - MESSAGE(STATUS " IPv6 : ${APR_HAVE_IPV6}") + MESSAGE(STATUS " IPv6 ............................ : ${APR_HAVE_IPV6}") + MESSAGE(STATUS " DBD ODBC driver ................. : ${APU_HAVE_ODBC}") MESSAGE(STATUS " Use Expat ....................... : ${APU_USE_EXPAT}") MESSAGE(STATUS " Use LibXml2 ..................... : ${APU_USE_LIBXML2}") MESSAGE(STATUS " Library files for XML ........... : ${XMLLIB_LIBRARIES}") diff --git a/include/apr.hwc b/include/apr.hwc index f97224dc9b4..570dd8d799e 100644 --- a/include/apr.hwc +++ b/include/apr.hwc @@ -653,8 +653,9 @@ typedef int apr_wait_t; #endif /* - * we always enable dynamic driver loads within apr_dbd - * driver builds enable these flags individually + * Windows: Only dynamic driver loads within apr_dbd + * are supported. The driver builds enable + * these flags individually. */ #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_PGSQL 0 From f64a8e2ea4ddbe769fb99079609586d4ca5ea1da Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 23 Aug 2013 14:45:26 +0000 Subject: [PATCH 7289/7878] tiny cleanup to how feature test values for apr.h are initialized git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1516871 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57bd4efdb90..6308d6048b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,23 +54,26 @@ OPTION(APR_HAVE_IPV6 "IPv6 support" ON) OPTION(APR_SHOW_SETTINGS "Show the build configuration" ON) OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) -IF(APR_HAVE_IPV6) - SET(apr_have_ipv6_10 1) -ELSE() - SET(apr_have_ipv6_10 0) -ENDIF() - IF(NOT APU_USE_EXPAT AND NOT APU_USE_LIBXML2) MESSAGE(FATAL_ERROR "Either Expat or LibXml2 must be selected") ENDIF() IF(APU_USE_EXPAT AND APU_USE_LIBXML2) MESSAGE(FATAL_ERROR "Only one of Expat and LibXml2 can be selected") ENDIF() + +# create 1-or-0 representation of feature tests for apr.h + +SET(apr_have_ipv6_10 0) +SET(apu_use_libxml2_10 0) +SET(apu_use_expat_10 0) + +IF(APR_HAVE_IPV6) + SET(apr_have_ipv6_10 1) +ENDIF() + IF(APU_USE_EXPAT) SET(apu_use_expat_10 1) - SET(apu_use_libxml2_10 0) ELSE() - SET(apu_use_expat_10 0) SET(apu_use_libxml2_10 1) ENDIF() From c6dfdbabd31f0f646e7a05cd5f5e2d4b12edb12e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 23 Aug 2013 15:44:51 +0000 Subject: [PATCH 7290/7878] Change the way that private .h files used by httpd are installed. Instead of always installing them and putting them under private_include, install under include but only if a new option is enabled. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1516901 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6308d6048b1..b1f10d6a240 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,6 +49,7 @@ ELSE() OPTION(APU_USE_LIBXML2 "Use LibXml2" ON) ENDIF() +OPTION(APR_INSTALL_PRIVATE_H "Install selected private .h files (for httpd)" OFF) OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON) OPTION(APR_HAVE_IPV6 "IPv6 support" ON) OPTION(APR_SHOW_SETTINGS "Show the build configuration" ON) @@ -473,11 +474,16 @@ INSTALL(TARGETS ${install_targets} ) INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include) -# Kludges for unexpected dependencies of httpd 2.x; at least segregate them in private_include -INSTALL(FILES include/arch/win32/apr_arch_file_io.h DESTINATION private_include/arch/win32) -INSTALL(FILES include/arch/win32/apr_arch_utf8.h DESTINATION private_include/arch/win32) -INSTALL(FILES include/arch/win32/apr_private.h DESTINATION private_include/arch/win32) -INSTALL(FILES include/arch/win32/apr_arch_misc.h DESTINATION private_include/arch/win32) +IF(APR_INSTALL_PRIVATE_H) + # Kludges for unexpected dependencies of httpd 2.x, not installed by default + SET(APR_PRIVATE_H_FOR_HTTPD + include/arch/win32/apr_arch_file_io.h + include/arch/win32/apr_arch_misc.h + include/arch/win32/apr_arch_utf8.h + include/arch/win32/apr_private.h + ) + INSTALL(FILES ${APR_PRIVATE_H_FOR_HTTPD} DESTINATION include/arch/win32) +ENDIF() IF(APR_SHOW_SETTINGS) STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype) @@ -493,4 +499,5 @@ IF(APR_SHOW_SETTINGS) MESSAGE(STATUS " Use LibXml2 ..................... : ${APU_USE_LIBXML2}") MESSAGE(STATUS " Library files for XML ........... : ${XMLLIB_LIBRARIES}") MESSAGE(STATUS " Build test suite ................ : ${APR_BUILD_TESTAPR}") + MESSAGE(STATUS " Install private .h for httpd .... : ${APR_INSTALL_PRIVATE_H}") ENDIF(APR_SHOW_SETTINGS) From fa3894016c6e4ddb3cc2825107e09f64b34017d1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 27 Aug 2013 19:27:29 +0000 Subject: [PATCH 7291/7878] Add how-to-build at the top of the file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1517944 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1f10d6a240..f39630a4be9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,48 @@ PROJECT(APR C) +# Experimental cmake-based build support for APR on Windows +# +# General usage: +# 0. Read the todos down below and make sure this is good enough for your +# purposes. +# 1. cd to a clean directory for building (i.e., don't build in your +# source tree) +# 2. set CMAKE_LIBRARY_PATH=d:\path\to\prereq1\lib;d:\path\to\prereq2\lib;... +# 3. set CMAKE_INCLUDE_PATH=d:\path\to\prereq1\include;d:\path\to\prereq2\include;... +# 4. cmake -G "some backend, like 'NMake Makefiles'" \ +# -DCMAKE_INSTALL_PREFIX=d:/path/to/aprinst \ +# -DAPR-specific-flags \ +# d:/path/to/aprsource +# Alternately, use cmake-gui and update settings in the GUI. +# +# APR flags: +# APU_USE_EXPAT Use Expat as the underlying XML implementation +# Default: ON +# APU_USE_LIBXML2 Use libxml2 as the underlying XML implementation +# Exactly one of APU_USE_EXPAT and APU_USE_LIBXML2 +# must be specified. +# Default: OFF +# APR_INSTALL_PRIVATE_H Install extra .h files which are required by httpd +# but which aren't intended for use by applications. +# Default: OFF +# APU_HAVE_ODBC Build ODBC DBD driver +# Default: ON +# APR_HAVE_IPV6 Enable IPv6 support +# Default: ON +# APR_SHOW_SETTINGS Display key build settings at the end of build +# generation +# Default: ON +# APR_BUILD_TESTAPR Build APR test suite +# Default: OFF +# +# Other flags of interest: +# CMAKE_C_FLAGS_RELEASE, _DEBUG, _RELWITHDEBINFO, _MINSIZEREL +# CMAKE_BUILD_TYPE +# For NMake Makefiles the choices are at least DEBUG, RELEASE, +# RELWITHDEBINFO, and MINSIZEREL +# Other backends make have other selections. +# 5. build using chosen backend (e.g., "nmake install") +# # Todos to properly support Windows: # . Fix problem where srcdir/include/apr.h (if it exists) is found before builddir/apr.h # (and similar for apu_want.h) From 020124f00566f2c4f1b52805806ed50013ff8587 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 27 Aug 2013 20:10:47 +0000 Subject: [PATCH 7292/7878] Update todo list based on a quick scan of the Windows makefiles for 1.4.x HEAD (more likely to be correct than trunk perhaps?) Delete todo about describing nmake usage, as the doc added in r1517944 should be a big help. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1517968 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f39630a4be9..167ca9ed8d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,6 @@ PROJECT(APR C) # Todos to properly support Windows: # . Fix problem where srcdir/include/apr.h (if it exists) is found before builddir/apr.h # (and similar for apu_want.h) -# . Document example 32-bit and 64-bit Windows builds using NMake # . Build apr_app.c into libapr-2 properly (what about apr-2.lib?) # . Options for remaining features, along with finding any necessary libraries # + APR_POOL_DEBUG @@ -71,6 +70,9 @@ PROJECT(APR C) # . Alternate build of test programs to use libapr-2.dll # . Support static *or* shared build of Expat # . Some easier way to run the test suite (the stuff besides testall.exe) +# . Install CHANGES/LICENSE/NOTICE like Makefile.win +# . test/internal/testucs +# . aprapp-2.lib/libaprapp-2.lib # . All the other stuff Jeff doesn't know about yet CMAKE_MINIMUM_REQUIRED(VERSION 2.8) From f06e3be1da1efa36954f85d619a06ac6175bb433 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 27 Aug 2013 23:04:35 +0000 Subject: [PATCH 7293/7878] when complaining (in -v(erbose) mode) about not finding a driver, add the driver name to the message git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1518026 13f79535-47bb-0310-9956-ffa450edef68 --- test/testcrypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testcrypto.c b/test/testcrypto.c index 9018b80b41a..f0df29b3bd0 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -41,7 +41,7 @@ static const apr_crypto_driver_t *get_driver(abts_case *tc, apr_pool_t *pool, rv = apr_crypto_get_driver(&driver, name, params, &err, pool); if (APR_SUCCESS != rv && err) { - ABTS_NOT_IMPL(tc, err->msg); + ABTS_NOT_IMPL(tc, apr_pstrcat(pool, err->msg, " (", name, ")", NULL)); return NULL; } if (APR_ENOTIMPL == rv) { From 41e45bf1c834ce21fa2344e81c310bf45e00a562 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 27 Aug 2013 23:16:17 +0000 Subject: [PATCH 7294/7878] Add support for APU_HAVE_CRYPTO+APU_HAVE_OPENSSL. (Fully-qualifying the include file paths was implemented as part of specifying the include directories for apr_crypto_openssl-2; relative include paths don't work with SET_TARGET_PROPERTIES( ... INCLUDE_DIRECTORIES ... ) ) Update notes on what needs to be done: . OpenSSL flavor of APU_HAVE_CRYPTO is done as of this commit . COMMONCRYPTO is OS X/iOS, so that isn't applicable to Windows . APU_DSO_MODULE_BUILD is the style we have; static module builds is what is missing git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1518029 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 38 +++++++++++++++++++++++++++++--------- include/apr.hwc | 2 +- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 167ca9ed8d5..32c419c9e96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,6 @@ PROJECT(APR C) # . Build apr_app.c into libapr-2 properly (what about apr-2.lib?) # . Options for remaining features, along with finding any necessary libraries # + APR_POOL_DEBUG -# + APU_DSO_MODULE_BUILD # + DBM: # . APU_HAVE_GDBM # . APU_HAVE_NDBM @@ -61,12 +60,10 @@ PROJECT(APR C) # . APU_HAVE_SQLITE2 # . APU_HAVE_ORACLE # + CRYPTO: -# . APU_HAVE_CRYPTO -# . APU_HAVE_OPENSSL # . APU_HAVE_NSS -# . APU_HAVE_COMMONCRYPTO # + APU_HAVE_ICONV # + APU_USE_LIBXML2 (sketched in, but not working) +# . Static builds of APR modules # . Alternate build of test programs to use libapr-2.dll # . Support static *or* shared build of Expat # . Some easier way to run the test suite (the stuff besides testall.exe) @@ -77,9 +74,10 @@ PROJECT(APR C) CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -# Either Expat or LibXml2 is required +# Either Expat or LibXml2 is required; the others are optional FIND_PACKAGE(Expat) FIND_PACKAGE(LibXml2) +FIND_PACKAGE(OpenSSL) IF(NOT EXPAT_FOUND AND NOT LIBXML2_FOUND) MESSAGE(FATAL_ERROR "Either Expat or LibXml2 is required, but neither was found") @@ -95,6 +93,7 @@ ELSE() ENDIF() OPTION(APR_INSTALL_PRIVATE_H "Install selected private .h files (for httpd)" OFF) +OPTION(APU_HAVE_CRYPTO "Crypto support" OFF) OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON) OPTION(APR_HAVE_IPV6 "IPv6 support" ON) OPTION(APR_SHOW_SETTINGS "Show the build configuration" ON) @@ -107,9 +106,16 @@ IF(APU_USE_EXPAT AND APU_USE_LIBXML2) MESSAGE(FATAL_ERROR "Only one of Expat and LibXml2 can be selected") ENDIF() +IF(APU_HAVE_CRYPTO) +IF(NOT OPENSSL_FOUND) + MESSAGE(FATAL_ERROR "OpenSSL is the only supported crypto implementation, and it wasn't found!") +ENDIF() +ENDIF() + # create 1-or-0 representation of feature tests for apr.h SET(apr_have_ipv6_10 0) +SET(apu_have_crypto_10 0) SET(apu_use_libxml2_10 0) SET(apu_use_expat_10 0) @@ -117,6 +123,10 @@ IF(APR_HAVE_IPV6) SET(apr_have_ipv6_10 1) ENDIF() +IF(APU_HAVE_CRYPTO) + SET(apu_have_crypto_10 1) +ENDIF() + IF(APU_USE_EXPAT) SET(apu_use_expat_10 1) ELSE() @@ -160,10 +170,10 @@ ENDIF() SET(APR_INCLUDE_DIRECTORIES ${PROJECT_BINARY_DIR} - include - include/arch/win32 - include/arch/unix - include/private + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/arch/win32 + ${CMAKE_CURRENT_SOURCE_DIR}/include/arch/unix + ${CMAKE_CURRENT_SOURCE_DIR}/include/private ) SET(APR_SYSTEM_LIBS @@ -452,6 +462,16 @@ TARGET_LINK_LIBRARIES(apr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) SET_TARGET_PROPERTIES(apr-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_HAVE_MODULAR_DSO") ADD_DEPENDENCIES(apr-2 test_char_header) +IF(APU_HAVE_CRYPTO) + IF(NOT OPENSSL_FOUND) + MESSAGE(FATAL_ERROR "Only OpenSSL-based crypto is currently implemented in the cmake build") + ENDIF() + ADD_LIBRARY(apr_crypto_openssl-2 SHARED crypto/apr_crypto_openssl.c) + SET(install_targets ${install_targets} apr_crypto_openssl-2) + SET_TARGET_PROPERTIES(apr_crypto_openssl-2 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OPENSSL_INCLUDE_DIR}") + TARGET_LINK_LIBRARIES(apr_crypto_openssl-2 libapr-2 ${APR_SYSTEM_LIBS} ${OPENSSL_LIBRARIES}) +ENDIF() + IF(APU_HAVE_ODBC) ADD_LIBRARY(apr_dbd_odbc-2 SHARED dbd/apr_dbd_odbc.c) SET(install_targets ${install_targets} apr_dbd_odbc-2) diff --git a/include/apr.hwc b/include/apr.hwc index 570dd8d799e..cf200a279f0 100644 --- a/include/apr.hwc +++ b/include/apr.hwc @@ -666,7 +666,7 @@ typedef int apr_wait_t; #define APU_HAVE_ODBC 0 #endif -#define APU_HAVE_CRYPTO 0 +#define APU_HAVE_CRYPTO @apu_have_crypto_10@ #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_OPENSSL 0 From badc75d72d9efb604d650cd2ea471ff025e2ba3f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 28 Aug 2013 13:55:19 +0000 Subject: [PATCH 7295/7878] APU_USE_LIBXML2: Add LIBXML2_ICONV_INCLUDE_DIR and LIBXML2_ICONV_LIBRARIES settings to use with libxml2 builds that have a prereq on iconv(). (same settings as httpd) Remove the todo, since it works for me. APU_HAVE_CRYPTO: Add missing doc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1518206 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 32c419c9e96..8827d5c5417 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,9 @@ PROJECT(APR C) # APR_INSTALL_PRIVATE_H Install extra .h files which are required by httpd # but which aren't intended for use by applications. # Default: OFF +# APU_HAVE_CRYPTO Build crypt support (only the OpenSSL implementation +# is currently supported) +# Default: OFF # APU_HAVE_ODBC Build ODBC DBD driver # Default: ON # APR_HAVE_IPV6 Enable IPv6 support @@ -36,6 +39,10 @@ PROJECT(APR C) # Default: OFF # # Other flags of interest: +# LIBXML2_ICONV_INCLUDE_DIR, LIBXML2_ICONV_LIBRARIES +# If using libxml2 for the XML implementation and the build of libxml2 +# requires iconv, set these variables to allow iconv includes +# and libraries to be found. # CMAKE_C_FLAGS_RELEASE, _DEBUG, _RELWITHDEBINFO, _MINSIZEREL # CMAKE_BUILD_TYPE # For NMake Makefiles the choices are at least DEBUG, RELEASE, @@ -62,7 +69,6 @@ PROJECT(APR C) # + CRYPTO: # . APU_HAVE_NSS # + APU_HAVE_ICONV -# + APU_USE_LIBXML2 (sketched in, but not working) # . Static builds of APR modules # . Alternate build of test programs to use libapr-2.dll # . Support static *or* shared build of Expat @@ -98,6 +104,8 @@ OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON) OPTION(APR_HAVE_IPV6 "IPv6 support" ON) OPTION(APR_SHOW_SETTINGS "Show the build configuration" ON) OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) +SET(LIBXML2_ICONV_INCLUDE_DIR "" CACHE STRING "Directory with iconv include files for libxml2") +SET(LIBXML2_ICONV_LIBRARIES "" CACHE STRING "iconv libraries to link with for libxml2") IF(NOT APU_USE_EXPAT AND NOT APU_USE_LIBXML2) MESSAGE(FATAL_ERROR "Either Expat or LibXml2 must be selected") @@ -157,8 +165,8 @@ IF(APU_USE_EXPAT) SET(XMLLIB_INCLUDE_DIR ${EXPAT_INCLUDE_DIRS}) SET(XMLLIB_LIBRARIES ${EXPAT_LIBRARIES}) ELSE() - SET(XMLLIB_INCLUDE_DIR ${LIBXML2_INCLUDE_DIR}) - SET(XMLLIB_LIBRARIES ${LIBXML2_LIBRARIES}) + SET(XMLLIB_INCLUDE_DIR "${LIBXML2_INCLUDE_DIR};${LIBXML2_ICONV_INCLUDE_DIR}") + SET(XMLLIB_LIBRARIES "${LIBXML2_LIBRARIES};${LIBXML2_ICONV_LIBRARIES}") ENDIF() # Generated .h files are stored in PROJECT_BINARY_DIR, not the From 7bf81e975d47dc61d549b85057503cdca4395c2f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 29 Aug 2013 18:37:25 +0000 Subject: [PATCH 7296/7878] move cmake howto/buglist to a separate file, README.cmake add license text to CMakeLists.txt git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1518749 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 91 ++++++-------------------------- README.cmake | 137 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 152 insertions(+), 76 deletions(-) create mode 100644 README.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 8827d5c5417..b3c6ca9856e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,82 +1,21 @@ -PROJECT(APR C) - -# Experimental cmake-based build support for APR on Windows -# -# General usage: -# 0. Read the todos down below and make sure this is good enough for your -# purposes. -# 1. cd to a clean directory for building (i.e., don't build in your -# source tree) -# 2. set CMAKE_LIBRARY_PATH=d:\path\to\prereq1\lib;d:\path\to\prereq2\lib;... -# 3. set CMAKE_INCLUDE_PATH=d:\path\to\prereq1\include;d:\path\to\prereq2\include;... -# 4. cmake -G "some backend, like 'NMake Makefiles'" \ -# -DCMAKE_INSTALL_PREFIX=d:/path/to/aprinst \ -# -DAPR-specific-flags \ -# d:/path/to/aprsource -# Alternately, use cmake-gui and update settings in the GUI. +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at # -# APR flags: -# APU_USE_EXPAT Use Expat as the underlying XML implementation -# Default: ON -# APU_USE_LIBXML2 Use libxml2 as the underlying XML implementation -# Exactly one of APU_USE_EXPAT and APU_USE_LIBXML2 -# must be specified. -# Default: OFF -# APR_INSTALL_PRIVATE_H Install extra .h files which are required by httpd -# but which aren't intended for use by applications. -# Default: OFF -# APU_HAVE_CRYPTO Build crypt support (only the OpenSSL implementation -# is currently supported) -# Default: OFF -# APU_HAVE_ODBC Build ODBC DBD driver -# Default: ON -# APR_HAVE_IPV6 Enable IPv6 support -# Default: ON -# APR_SHOW_SETTINGS Display key build settings at the end of build -# generation -# Default: ON -# APR_BUILD_TESTAPR Build APR test suite -# Default: OFF +# http://www.apache.org/licenses/LICENSE-2.0 # -# Other flags of interest: -# LIBXML2_ICONV_INCLUDE_DIR, LIBXML2_ICONV_LIBRARIES -# If using libxml2 for the XML implementation and the build of libxml2 -# requires iconv, set these variables to allow iconv includes -# and libraries to be found. -# CMAKE_C_FLAGS_RELEASE, _DEBUG, _RELWITHDEBINFO, _MINSIZEREL -# CMAKE_BUILD_TYPE -# For NMake Makefiles the choices are at least DEBUG, RELEASE, -# RELWITHDEBINFO, and MINSIZEREL -# Other backends make have other selections. -# 5. build using chosen backend (e.g., "nmake install") +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # -# Todos to properly support Windows: -# . Fix problem where srcdir/include/apr.h (if it exists) is found before builddir/apr.h -# (and similar for apu_want.h) -# . Build apr_app.c into libapr-2 properly (what about apr-2.lib?) -# . Options for remaining features, along with finding any necessary libraries -# + APR_POOL_DEBUG -# + DBM: -# . APU_HAVE_GDBM -# . APU_HAVE_NDBM -# . APU_HAVE_DB -# + DBD: -# . APU_HAVE_PGSQL -# . APU_HAVE_MYSQL -# . APU_HAVE_SQLITE3 -# . APU_HAVE_SQLITE2 -# . APU_HAVE_ORACLE -# + CRYPTO: -# . APU_HAVE_NSS -# + APU_HAVE_ICONV -# . Static builds of APR modules -# . Alternate build of test programs to use libapr-2.dll -# . Support static *or* shared build of Expat -# . Some easier way to run the test suite (the stuff besides testall.exe) -# . Install CHANGES/LICENSE/NOTICE like Makefile.win -# . test/internal/testucs -# . aprapp-2.lib/libaprapp-2.lib -# . All the other stuff Jeff doesn't know about yet +# Read README.cmake before using this. + +PROJECT(APR C) CMAKE_MINIMUM_REQUIRED(VERSION 2.8) diff --git a/README.cmake b/README.cmake new file mode 100644 index 00000000000..e184fab8ae5 --- /dev/null +++ b/README.cmake @@ -0,0 +1,137 @@ +Experimental cmake-based build support for APR on Microsoft Windows + +Status +------ + +This build support is currently intended only for Microsoft Windows. + +This build support is experimental. Specifically, + +* It does not support all features of APR. +* Some components may not be built correctly and/or in a manner + compatible with the previous Windows build support. +* Build interfaces, such as the mechanisms which are used to enable + optional functionality or specify prerequisites, may change from + release to release as feedback is received from users and bugs and + limitations are resolved. + +Important: Refer to the "Known Bugs and Limitations" section for further + information. + + It is beyond the scope of this document to document or explain + how to utilize the various cmake features, such as different + build backends or provisions for finding support libraries. + + Please refer to the cmake documentation for additional information + that applies to building any project with cmake. + +Prerequisites +------------- + +The following tools must be in PATH: + +* cmake, version 2.8 or later +* If using a command-line compiler: compiler and linker and related tools + (Refer to the cmake documentation for more information.) + +The following support libraries are mandatory: + +* Either expat or libxml2 + +Additional support libraries allow optional features of APR to be enabled: + +* OpenSSL +* many others potentially, though the build support isn't currently + implemented + +How to build +------------ + +1. cd to a clean directory for building (i.e., don't build in your + source tree) + +2. Some cmake backends may want your compile tools in PATH. (Hint: "Visual + Studio Command Prompt") + +3. set CMAKE_LIBRARY_PATH=d:\path\to\prereq1\lib;d:\path\to\prereq2\lib;... + +4. set CMAKE_INCLUDE_PATH=d:\path\to\prereq1\include;d:\path\to\prereq2\include;... + +5. cmake -G "some backend, like 'NMake Makefiles'" + -DCMAKE_INSTALL_PREFIX=d:/path/to/aprinst + -DAPR-specific-flags + d:/path/to/aprsource + + Alternately, use cmake-gui and update settings in the GUI. + + APR feature flags: + + Exactly one of APU_USE_EXPAT and APU_USE_LIBXML2 must be specified. + + APU_USE_EXPAT Use Expat as the underlying XML implementation + Default: ON + APU_USE_LIBXML2 Use libxml2 as the underlying XML + implementation + Default: OFF + APR_INSTALL_PRIVATE_H Install extra .h files which are required by + httpd but which aren't intended for use by + applications. + Default: OFF + APU_HAVE_CRYPTO Build crypt support (only the OpenSSL + implementation is currently supported) + Default: OFF + APU_HAVE_ODBC Build ODBC DBD driver + Default: ON + APR_HAVE_IPV6 Enable IPv6 support + Default: ON + APR_SHOW_SETTINGS Display key build settings at the end of build + generation + Default: ON + APR_BUILD_TESTAPR Build APR test suite + Default: OFF + + LIBXML2_ICONV_INCLUDE_DIR, LIBXML2_ICONV_LIBRARIES + + If using libxml2 for the XML implementation and the build of libxml2 + requires iconv, set these variables to allow iconv includes + and libraries to be found. + + CMAKE_C_FLAGS_RELEASE, _DEBUG, _RELWITHDEBINFO, _MINSIZEREL + + CMAKE_BUILD_TYPE + + For NMake Makefiles the choices are at least DEBUG, RELEASE, + RELWITHDEBINFO, and MINSIZEREL + Other backends make have other selections. + +6. build using chosen backend (e.g., "nmake install") + +Known Bugs and Limitations +-------------------------- + +* If include/apr.h or other generated files have been created in the source + directory by another build system, they will be used unexpectedly and + cause the build to fail. +* apr_app.c, aprapp-2.lib, and libaprapp-2.lib are not handled properly. +* Options should be provided for remaining features, along with finding any + necessary libraries + + APR_POOL_DEBUG + + DBM: + . APU_HAVE_GDBM + . APU_HAVE_NDBM + . APU_HAVE_DB + + DBD: + . APU_HAVE_PGSQL + . APU_HAVE_MYSQL + . APU_HAVE_SQLITE3 + . APU_HAVE_SQLITE2 + . APU_HAVE_ORACLE + + CRYPTO: + . APU_HAVE_NSS + + APU_HAVE_ICONV +* Static builds of APR modules are not supported. +* No test program build to use libapr-2.dll is created. +* Support static *or* shared build of Expat. +* No script or other mechanism is provided to run the test suite. +* CHANGES/LICENSE/NOTICE is not installed, unlike Makefile.win. +* test/internal/testucs is not built. From 72c8f24f32b2dbd9c39c6d2714da616d9d66082f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 29 Aug 2013 19:09:23 +0000 Subject: [PATCH 7297/7878] grab more scary text from httpd git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1518767 13f79535-47bb-0310-9956-ffa450edef68 --- README.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.cmake b/README.cmake index e184fab8ae5..9e4872888c5 100644 --- a/README.cmake +++ b/README.cmake @@ -135,3 +135,12 @@ Known Bugs and Limitations * No script or other mechanism is provided to run the test suite. * CHANGES/LICENSE/NOTICE is not installed, unlike Makefile.win. * test/internal/testucs is not built. + +Generally: + +* Many APR features have not been tested with this build. +* Developers need to examine the existing Windows build in great detail and see + what is missing from the cmake-based build, whether a feature or some build + nuance. +* Any feedback you can provide on your experiences with this build will be + helpful. From f1d2d568776b3708dd6a3077376e2331f9268b04 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 29 Aug 2013 19:17:36 +0000 Subject: [PATCH 7298/7878] don't mention the cmake stuff for Windows, which is now in APR/APR-Util 1.x git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1518771 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGES b/CHANGES index 0fb1f6ef013..d5cb3521825 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) Add experimental cmake-based build system for Windows. [Jeff Trawick, - Tom Donovan] - *) Add support for Berkeley DB 6.0. [Rainer Jung] *) Add apr_pbase64_encode() and apr_pbase64_decode() to encode to/from From 7727e6855da53a8844d0b1265a316bb3ea2b125b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 5 Sep 2013 12:59:03 +0000 Subject: [PATCH 7299/7878] APR_INSTALL_PRIVATE_H -- Subversion needs it too (for now continue to default to off) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1520293 13f79535-47bb-0310-9956-ffa450edef68 --- README.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.cmake b/README.cmake index 9e4872888c5..7049199ee1d 100644 --- a/README.cmake +++ b/README.cmake @@ -73,9 +73,9 @@ How to build APU_USE_LIBXML2 Use libxml2 as the underlying XML implementation Default: OFF - APR_INSTALL_PRIVATE_H Install extra .h files which are required by - httpd but which aren't intended for use by - applications. + APR_INSTALL_PRIVATE_H Install extra .h files which are required when + building httpd and Subversion but which aren't + intended for use by applications. Default: OFF APU_HAVE_CRYPTO Build crypt support (only the OpenSSL implementation is currently supported) From b29f4323a03a5b8661bf0caac2435cf1b5a00265 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 7 Sep 2013 21:29:05 +0000 Subject: [PATCH 7300/7878] fix feature test name in comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1520813 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbd/apr_dbd.c b/dbd/apr_dbd.c index decac798061..b7b871fd709 100644 --- a/dbd/apr_dbd.c +++ b/dbd/apr_dbd.c @@ -202,7 +202,7 @@ APR_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name, } apu_dso_mutex_unlock(); -#else /* not builtin and !APR_HAS_DSO => not implemented */ +#else /* not builtin and !APR_HAVE_MODULAR_DSO => not implemented */ rv = APR_ENOTIMPL; #endif From 6478c698d004b909b8b720b840359fcb0d9bbba0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 8 Sep 2013 16:45:16 +0000 Subject: [PATCH 7301/7878] Allow control over the setting of _WINNT_WINNT Default minimum Windows version: 0x0600 (Vista/Windows Server 2008) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1520879 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 19 +++++++++++++++++-- README.cmake | 9 +++++++++ include/apr.hwc | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3c6ca9856e..309d1a70112 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,8 +43,12 @@ OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON) OPTION(APR_HAVE_IPV6 "IPv6 support" ON) OPTION(APR_SHOW_SETTINGS "Show the build configuration" ON) OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) -SET(LIBXML2_ICONV_INCLUDE_DIR "" CACHE STRING "Directory with iconv include files for libxml2") -SET(LIBXML2_ICONV_LIBRARIES "" CACHE STRING "iconv libraries to link with for libxml2") +SET(MIN_WINDOWS_VER "Vista" + CACHE STRING "Minimum Windows version") +SET(LIBXML2_ICONV_INCLUDE_DIR "" + CACHE STRING "Directory with iconv include files for libxml2") +SET(LIBXML2_ICONV_LIBRARIES "" + CACHE STRING "iconv libraries to link with for libxml2") IF(NOT APU_USE_EXPAT AND NOT APU_USE_LIBXML2) MESSAGE(FATAL_ERROR "Either Expat or LibXml2 must be selected") @@ -80,6 +84,16 @@ ELSE() SET(apu_use_libxml2_10 1) ENDIF() +IF("${MIN_WINDOWS_VER}" STREQUAL "") + SET(win32_winnt_str "0x0600") +ELSEIF(${MIN_WINDOWS_VER} STREQUAL "Vista") + SET(win32_winnt_str "0x0600") +ELSEIF(${MIN_WINDOWS_VER} STREQUAL "Windows7") + SET(win32_winnt_str "0x0601") +ELSE() + SET(win32_winnt_str ${MIN_WINDOWS_VER}) +ENDIF() + CONFIGURE_FILE(include/apr.hwc ${PROJECT_BINARY_DIR}/apr.h) # "COPYONLY" just because anything else isn't implemented ;) @@ -509,6 +523,7 @@ IF(APR_SHOW_SETTINGS) MESSAGE(STATUS " DBD ODBC driver ................. : ${APU_HAVE_ODBC}") MESSAGE(STATUS " Use Expat ....................... : ${APU_USE_EXPAT}") MESSAGE(STATUS " Use LibXml2 ..................... : ${APU_USE_LIBXML2}") + MESSAGE(STATUS " Minimum Windows version ......... : ${MIN_WINDOWS_VER}") MESSAGE(STATUS " Library files for XML ........... : ${XMLLIB_LIBRARIES}") MESSAGE(STATUS " Build test suite ................ : ${APR_BUILD_TESTAPR}") MESSAGE(STATUS " Install private .h for httpd .... : ${APR_INSTALL_PRIVATE_H}") diff --git a/README.cmake b/README.cmake index 7049199ee1d..d5dc61305e9 100644 --- a/README.cmake +++ b/README.cmake @@ -89,6 +89,15 @@ How to build Default: ON APR_BUILD_TESTAPR Build APR test suite Default: OFF + MIN_WINDOWS_VER Minimum Windows version supported by this build + (This controls the setting of _WIN32_WINNT.) + "Vista" or "Windows7" or a numeric value like + "0x0601" + Default: "Vista" + For desktop/server equivalence or other values, + refer to + http://msdn.microsoft.com/en-us/library/windows/ + desktop/aa383745(v=vs.85).aspx LIBXML2_ICONV_INCLUDE_DIR, LIBXML2_ICONV_LIBRARIES diff --git a/include/apr.hwc b/include/apr.hwc index cf200a279f0..ebc6ca54d10 100644 --- a/include/apr.hwc +++ b/include/apr.hwc @@ -191,7 +191,7 @@ #endif #ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x0501 +#define _WIN32_WINNT @win32_winnt_str@ #endif #ifndef NOUSER From f6f1ab31aa0a040dc47b4814826f81dad96ec6a6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 10 Sep 2013 12:28:02 +0000 Subject: [PATCH 7302/7878] remove the ability to suppress the build setting display, tweak the todo list git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1521461 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 33 +++++++++++++++------------------ README.cmake | 6 ++---- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 309d1a70112..0e4bc20cc68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,6 @@ OPTION(APR_INSTALL_PRIVATE_H "Install selected private .h files (for httpd)" O OPTION(APU_HAVE_CRYPTO "Crypto support" OFF) OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON) OPTION(APR_HAVE_IPV6 "IPv6 support" ON) -OPTION(APR_SHOW_SETTINGS "Show the build configuration" ON) OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) SET(MIN_WINDOWS_VER "Vista" CACHE STRING "Minimum Windows version") @@ -511,20 +510,18 @@ IF(APR_INSTALL_PRIVATE_H) INSTALL(FILES ${APR_PRIVATE_H_FOR_HTTPD} DESTINATION include/arch/win32) ENDIF() -IF(APR_SHOW_SETTINGS) - STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype) - MESSAGE(STATUS "") - MESSAGE(STATUS "") - MESSAGE(STATUS "APR configuration summary:") - MESSAGE(STATUS "") - MESSAGE(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}") - MESSAGE(STATUS " C compiler ...................... : ${CMAKE_C_COMPILER}") - MESSAGE(STATUS " IPv6 ............................ : ${APR_HAVE_IPV6}") - MESSAGE(STATUS " DBD ODBC driver ................. : ${APU_HAVE_ODBC}") - MESSAGE(STATUS " Use Expat ....................... : ${APU_USE_EXPAT}") - MESSAGE(STATUS " Use LibXml2 ..................... : ${APU_USE_LIBXML2}") - MESSAGE(STATUS " Minimum Windows version ......... : ${MIN_WINDOWS_VER}") - MESSAGE(STATUS " Library files for XML ........... : ${XMLLIB_LIBRARIES}") - MESSAGE(STATUS " Build test suite ................ : ${APR_BUILD_TESTAPR}") - MESSAGE(STATUS " Install private .h for httpd .... : ${APR_INSTALL_PRIVATE_H}") -ENDIF(APR_SHOW_SETTINGS) +STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype) +MESSAGE(STATUS "") +MESSAGE(STATUS "") +MESSAGE(STATUS "APR configuration summary:") +MESSAGE(STATUS "") +MESSAGE(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}") +MESSAGE(STATUS " C compiler ...................... : ${CMAKE_C_COMPILER}") +MESSAGE(STATUS " IPv6 ............................ : ${APR_HAVE_IPV6}") +MESSAGE(STATUS " DBD ODBC driver ................. : ${APU_HAVE_ODBC}") +MESSAGE(STATUS " Use Expat ....................... : ${APU_USE_EXPAT}") +MESSAGE(STATUS " Use LibXml2 ..................... : ${APU_USE_LIBXML2}") +MESSAGE(STATUS " Minimum Windows version ......... : ${MIN_WINDOWS_VER}") +MESSAGE(STATUS " Library files for XML ........... : ${XMLLIB_LIBRARIES}") +MESSAGE(STATUS " Build test suite ................ : ${APR_BUILD_TESTAPR}") +MESSAGE(STATUS " Install private .h for httpd .... : ${APR_INSTALL_PRIVATE_H}") diff --git a/README.cmake b/README.cmake index d5dc61305e9..5c6dea517a9 100644 --- a/README.cmake +++ b/README.cmake @@ -84,9 +84,6 @@ How to build Default: ON APR_HAVE_IPV6 Enable IPv6 support Default: ON - APR_SHOW_SETTINGS Display key build settings at the end of build - generation - Default: ON APR_BUILD_TESTAPR Build APR test suite Default: OFF MIN_WINDOWS_VER Minimum Windows version supported by this build @@ -121,6 +118,7 @@ Known Bugs and Limitations * If include/apr.h or other generated files have been created in the source directory by another build system, they will be used unexpectedly and cause the build to fail. +* .pdb files are not installed * apr_app.c, aprapp-2.lib, and libaprapp-2.lib are not handled properly. * Options should be provided for remaining features, along with finding any necessary libraries @@ -142,7 +140,7 @@ Known Bugs and Limitations * No test program build to use libapr-2.dll is created. * Support static *or* shared build of Expat. * No script or other mechanism is provided to run the test suite. -* CHANGES/LICENSE/NOTICE is not installed, unlike Makefile.win. +* APR-CHANGES.txt, APR-LICENSE.txt, and APR-NOTICE.txt are not installed. * test/internal/testucs is not built. Generally: From 084725c3361057e4cfa1b6757952c7a5278db013 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 11 Sep 2013 17:59:06 +0000 Subject: [PATCH 7303/7878] install .pdb files unless requested otherwise, tweak todo list git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1521957 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 20 ++++++++++++++++++++ README.cmake | 6 ++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e4bc20cc68..4ec49e1972e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,7 @@ OPTION(APR_INSTALL_PRIVATE_H "Install selected private .h files (for httpd)" O OPTION(APU_HAVE_CRYPTO "Crypto support" OFF) OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON) OPTION(APR_HAVE_IPV6 "IPv6 support" ON) +OPTION(INSTALL_PDB "Install .pdb files (if generated)" ON) OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) SET(MIN_WINDOWS_VER "Vista" CACHE STRING "Minimum Windows version") @@ -408,16 +409,20 @@ SET(APR_TEST_SOURCES ) SET(install_targets) +SET(install_bin_pdb) +SET(install_lib_pdb) # libapr-2 is shared, apr-2 is static ADD_LIBRARY(libapr-2 SHARED ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/apr.h) SET(install_targets ${install_targets} libapr-2) +SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libapr-2.pdb) TARGET_LINK_LIBRARIES(libapr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) SET_TARGET_PROPERTIES(libapr-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_EXPORT;APR_HAVE_MODULAR_DSO") ADD_DEPENDENCIES(libapr-2 test_char_header) ADD_LIBRARY(apr-2 STATIC ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/apr.h) SET(install_targets ${install_targets} apr-2) +SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/apr-2.pdb) TARGET_LINK_LIBRARIES(apr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) SET_TARGET_PROPERTIES(apr-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_HAVE_MODULAR_DSO") ADD_DEPENDENCIES(apr-2 test_char_header) @@ -428,6 +433,7 @@ IF(APU_HAVE_CRYPTO) ENDIF() ADD_LIBRARY(apr_crypto_openssl-2 SHARED crypto/apr_crypto_openssl.c) SET(install_targets ${install_targets} apr_crypto_openssl-2) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_crypto_openssl-2.pdb) SET_TARGET_PROPERTIES(apr_crypto_openssl-2 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OPENSSL_INCLUDE_DIR}") TARGET_LINK_LIBRARIES(apr_crypto_openssl-2 libapr-2 ${APR_SYSTEM_LIBS} ${OPENSSL_LIBRARIES}) ENDIF() @@ -435,6 +441,7 @@ ENDIF() IF(APU_HAVE_ODBC) ADD_LIBRARY(apr_dbd_odbc-2 SHARED dbd/apr_dbd_odbc.c) SET(install_targets ${install_targets} apr_dbd_odbc-2) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_dbd_odbc-2.pdb) TARGET_LINK_LIBRARIES(apr_dbd_odbc-2 libapr-2 ${APR_SYSTEM_LIBS} odbc32 odbccp32) SET_PROPERTY(TARGET apr_dbd_odbc-2 APPEND PROPERTY LINK_FLAGS /export:apr_dbd_odbc_driver) SET_TARGET_PROPERTIES(apr_dbd_odbc-2 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APR_DECLARE_EXPORT;APU_DSO_MODULE_BUILD") @@ -498,6 +505,16 @@ INSTALL(TARGETS ${install_targets} ARCHIVE DESTINATION lib ) +IF(INSTALL_PDB) + INSTALL(FILES ${install_bin_pdb} + DESTINATION bin + CONFIGURATIONS RelWithDebInfo Debug) + + INSTALL(FILES ${install_lib_pdb} + DESTINATION lib + CONFIGURATIONS RelWithDebInfo Debug) +ENDIF() + INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include) IF(APR_INSTALL_PRIVATE_H) # Kludges for unexpected dependencies of httpd 2.x, not installed by default @@ -515,6 +532,9 @@ MESSAGE(STATUS "") MESSAGE(STATUS "") MESSAGE(STATUS "APR configuration summary:") MESSAGE(STATUS "") + +MESSAGE(STATUS " Build type ...................... : ${CMAKE_BUILD_TYPE}") +MESSAGE(STATUS " Install .pdb (if available)...... : ${INSTALL_PDB}") MESSAGE(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}") MESSAGE(STATUS " C compiler ...................... : ${CMAKE_C_COMPILER}") MESSAGE(STATUS " IPv6 ............................ : ${APR_HAVE_IPV6}") diff --git a/README.cmake b/README.cmake index 5c6dea517a9..d6948a5a40b 100644 --- a/README.cmake +++ b/README.cmake @@ -95,6 +95,8 @@ How to build refer to http://msdn.microsoft.com/en-us/library/windows/ desktop/aa383745(v=vs.85).aspx + INSTALL_PDB Install .pdb files if generated. + Default: ON LIBXML2_ICONV_INCLUDE_DIR, LIBXML2_ICONV_LIBRARIES @@ -118,7 +120,6 @@ Known Bugs and Limitations * If include/apr.h or other generated files have been created in the source directory by another build system, they will be used unexpectedly and cause the build to fail. -* .pdb files are not installed * apr_app.c, aprapp-2.lib, and libaprapp-2.lib are not handled properly. * Options should be provided for remaining features, along with finding any necessary libraries @@ -140,7 +141,8 @@ Known Bugs and Limitations * No test program build to use libapr-2.dll is created. * Support static *or* shared build of Expat. * No script or other mechanism is provided to run the test suite. -* APR-CHANGES.txt, APR-LICENSE.txt, and APR-NOTICE.txt are not installed. +* APR-CHANGES.txt, APR-LICENSE.txt, and APR-NOTICE.txt are not installed, + though perhaps that is a job for a higher-level script. * test/internal/testucs is not built. Generally: From 8f0b680474296d8435ba96fd80eccce0e6574960 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 12 Sep 2013 16:14:22 +0000 Subject: [PATCH 7304/7878] set binary attributes for dlls via libapr.rc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1522649 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ec49e1972e..20232cbcfb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -413,7 +413,7 @@ SET(install_bin_pdb) SET(install_lib_pdb) # libapr-2 is shared, apr-2 is static -ADD_LIBRARY(libapr-2 SHARED ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/apr.h) +ADD_LIBRARY(libapr-2 SHARED ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/apr.h libapr.rc) SET(install_targets ${install_targets} libapr-2) SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libapr-2.pdb) TARGET_LINK_LIBRARIES(libapr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) @@ -431,7 +431,7 @@ IF(APU_HAVE_CRYPTO) IF(NOT OPENSSL_FOUND) MESSAGE(FATAL_ERROR "Only OpenSSL-based crypto is currently implemented in the cmake build") ENDIF() - ADD_LIBRARY(apr_crypto_openssl-2 SHARED crypto/apr_crypto_openssl.c) + ADD_LIBRARY(apr_crypto_openssl-2 SHARED crypto/apr_crypto_openssl.c libapr.rc) SET(install_targets ${install_targets} apr_crypto_openssl-2) SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_crypto_openssl-2.pdb) SET_TARGET_PROPERTIES(apr_crypto_openssl-2 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OPENSSL_INCLUDE_DIR}") @@ -439,7 +439,7 @@ IF(APU_HAVE_CRYPTO) ENDIF() IF(APU_HAVE_ODBC) - ADD_LIBRARY(apr_dbd_odbc-2 SHARED dbd/apr_dbd_odbc.c) + ADD_LIBRARY(apr_dbd_odbc-2 SHARED dbd/apr_dbd_odbc.c libapr.rc) SET(install_targets ${install_targets} apr_dbd_odbc-2) SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_dbd_odbc-2.pdb) TARGET_LINK_LIBRARIES(apr_dbd_odbc-2 libapr-2 ${APR_SYSTEM_LIBS} odbc32 odbccp32) From 34a8c1a76dfe9de2351671c96363d656268bcb63 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 12 Sep 2013 16:42:50 +0000 Subject: [PATCH 7305/7878] mention libapr.rc/DLL_NAME issue affecting both Windows builds to some extent git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1522659 13f79535-47bb-0310-9956-ffa450edef68 --- README.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.cmake b/README.cmake index d6948a5a40b..8277298c2d1 100644 --- a/README.cmake +++ b/README.cmake @@ -144,6 +144,9 @@ Known Bugs and Limitations * APR-CHANGES.txt, APR-LICENSE.txt, and APR-NOTICE.txt are not installed, though perhaps that is a job for a higher-level script. * test/internal/testucs is not built. +* APR trunk's libapr.rc is missing the DLL_NAME switch from APR-util 1.x + (affects both Windows build systems), and the cmake build system isn't + setting it. Generally: From 1892553698449226fc84646b824a5fb4407d666f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 14 Sep 2013 17:04:54 +0000 Subject: [PATCH 7306/7878] Bring in APR-util's DLL_NAME feature, used to provide a specific name for DSO modules as the Window's File Description. This was lost with the merge of APR-util into APR. Set DLL_NAME in the cmake-based build. (The Visual Studio build already sets it.) The APR-util 1.5.x cmake list already sets it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1523277 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 2 ++ README.cmake | 3 --- libapr.rc | 8 +++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20232cbcfb3..082d49434f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -435,6 +435,7 @@ IF(APU_HAVE_CRYPTO) SET(install_targets ${install_targets} apr_crypto_openssl-2) SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_crypto_openssl-2.pdb) SET_TARGET_PROPERTIES(apr_crypto_openssl-2 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OPENSSL_INCLUDE_DIR}") + SET_TARGET_PROPERTIES(apr_crypto_openssl-2 PROPERTIES COMPILE_FLAGS "-DDLL_NAME=\"\\\"apr_crypto_openssl\\\"\"") TARGET_LINK_LIBRARIES(apr_crypto_openssl-2 libapr-2 ${APR_SYSTEM_LIBS} ${OPENSSL_LIBRARIES}) ENDIF() @@ -445,6 +446,7 @@ IF(APU_HAVE_ODBC) TARGET_LINK_LIBRARIES(apr_dbd_odbc-2 libapr-2 ${APR_SYSTEM_LIBS} odbc32 odbccp32) SET_PROPERTY(TARGET apr_dbd_odbc-2 APPEND PROPERTY LINK_FLAGS /export:apr_dbd_odbc_driver) SET_TARGET_PROPERTIES(apr_dbd_odbc-2 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APR_DECLARE_EXPORT;APU_DSO_MODULE_BUILD") + SET_TARGET_PROPERTIES(apr_dbd_odbc-2 PROPERTIES COMPILE_FLAGS "-DDLL_NAME=\"\\\"apr_dbd_odbc\\\"\"") ENDIF() IF(APR_BUILD_TESTAPR) diff --git a/README.cmake b/README.cmake index 8277298c2d1..d6948a5a40b 100644 --- a/README.cmake +++ b/README.cmake @@ -144,9 +144,6 @@ Known Bugs and Limitations * APR-CHANGES.txt, APR-LICENSE.txt, and APR-NOTICE.txt are not installed, though perhaps that is a job for a higher-level script. * test/internal/testucs is not built. -* APR trunk's libapr.rc is missing the DLL_NAME switch from APR-util 1.x - (affects both Windows build systems), and the cmake build system isn't - setting it. Generally: diff --git a/libapr.rc b/libapr.rc index 604fc7c06e4..d4e828b7142 100644 --- a/libapr.rc +++ b/libapr.rc @@ -14,7 +14,13 @@ "See the License for the specific language governing permissions and " \ "limitations under the License." +#ifdef DLL_NAME +#define APR_DLL_BASENAME APR_STRINGIFY(DLL_NAME) "-" APR_STRINGIFY(APR_MAJOR_VERSION) +#define APR_DLL_DESCRIPTION "Apache Portable Runtime " APR_STRINGIFY(DLL_NAME) " Module" +#else #define APR_DLL_BASENAME "libapr-" APR_STRINGIFY(APR_MAJOR_VERSION) +#define APR_DLL_DESCRIPTION "Apache Portable Runtime Library" +#endif 1 VERSIONINFO @@ -48,7 +54,7 @@ BEGIN BEGIN VALUE "Comments", APR_LICENSE "\0" VALUE "CompanyName", "Apache Software Foundation\0" - VALUE "FileDescription", "Apache Portable Runtime Library\0" + VALUE "FileDescription", APR_DLL_DESCRIPTION "\0" VALUE "FileVersion", APR_VERSION_STRING "\0" VALUE "InternalName", APR_DLL_BASENAME "\0" VALUE "LegalCopyright", APR_COPYRIGHT "\0" From 3f6f5f476355db854270e485de0734d1cf922f4b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 14 Sep 2013 23:30:06 +0000 Subject: [PATCH 7307/7878] build aprapp-2.lib and libaprapp-2 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1523355 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 11 +++++++++++ README.cmake | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 082d49434f4..db3d2388101 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -427,6 +427,17 @@ TARGET_LINK_LIBRARIES(apr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) SET_TARGET_PROPERTIES(apr-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_HAVE_MODULAR_DSO") ADD_DEPENDENCIES(apr-2 test_char_header) +# libaprapp-2 and aprapp-2 are static +ADD_LIBRARY(libaprapp-2 STATIC ${APR_HEADERS} ${PROJECT_BINARY_DIR}/apr.h misc/win32/apr_app.c misc/win32/internal.c) +SET(install_targets ${install_targets} libaprapp-2) +SET(install_lib_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libaprapp-2.pdb) +SET_TARGET_PROPERTIES(libaprapp-2 PROPERTIES COMPILE_DEFINITIONS APR_APP) + +ADD_LIBRARY(aprapp-2 STATIC ${APR_HEADERS} ${PROJECT_BINARY_DIR}/apr.h misc/win32/apr_app.c) +SET(install_targets ${install_targets} aprapp-2) +SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/aprapp-2.pdb) +SET_TARGET_PROPERTIES(libaprapp-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_APP") + IF(APU_HAVE_CRYPTO) IF(NOT OPENSSL_FOUND) MESSAGE(FATAL_ERROR "Only OpenSSL-based crypto is currently implemented in the cmake build") diff --git a/README.cmake b/README.cmake index d6948a5a40b..2cd733f5c86 100644 --- a/README.cmake +++ b/README.cmake @@ -120,7 +120,6 @@ Known Bugs and Limitations * If include/apr.h or other generated files have been created in the source directory by another build system, they will be used unexpectedly and cause the build to fail. -* apr_app.c, aprapp-2.lib, and libaprapp-2.lib are not handled properly. * Options should be provided for remaining features, along with finding any necessary libraries + APR_POOL_DEBUG From 9dae7403c1a4a59ede3ce2fcd806ed221cb85f55 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 15 Sep 2013 01:35:24 +0000 Subject: [PATCH 7308/7878] On Windows, a socket timeout isn't implemented with non-blocking socket + poll. When a socket is non- blocking and a timeout is set, the non-blocking state must be disabled. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1523384 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ network_io/win32/sockopt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index d5cb3521825..3a653485174 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_socket_timeout_set() on Windows: If the socket was in a non- + blocking state before, disable that setting so that timeouts work. + [Jeff Trawick] + *) Add support for Berkeley DB 6.0. [Rainer Jung] *) Add apr_pbase64_encode() and apr_pbase64_decode() to encode to/from diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 3675383d676..7f7a0eda66a 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -63,7 +63,7 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interva } else if (t > 0) { /* Set the socket to blocking if it was previously non-blocking */ - if (sock->timeout == 0) { + if (sock->timeout == 0 || apr_is_option_set(sock, APR_SO_NONBLOCK)) { if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) return stat; } From 739f0c46cbaaf4ced8c958abb969670c3fb80e90 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 15 Sep 2013 19:05:10 +0000 Subject: [PATCH 7309/7878] assert() games: testmutexscope relies on assert() to check as well as to run at all, so make sure NDEBUG isn't defined. testpass and teststr don't use assert(), so don't include . git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1523479 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmutexscope.c | 2 ++ test/testpass.c | 1 - test/teststr.c | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testmutexscope.c b/test/testmutexscope.c index 5318a27c321..57fcaf5aa32 100644 --- a/test/testmutexscope.c +++ b/test/testmutexscope.c @@ -14,6 +14,8 @@ * limitations under the License. */ +/* This program won't run or check correctly if assert() is disabled. */ +#undef NDEBUG #include #include #include diff --git a/test/testpass.c b/test/testpass.c index 34508571fe7..4ba5c69525e 100644 --- a/test/testpass.c +++ b/test/testpass.c @@ -14,7 +14,6 @@ * limitations under the License. */ -#include #include #include diff --git a/test/teststr.c b/test/teststr.c index b682841deb0..1f748d6f22f 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -16,7 +16,6 @@ #include "testutil.h" -#include #include #include #include From 641d54aaac33c506999e83e89e613348ef0c40b8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 15 Sep 2013 19:12:11 +0000 Subject: [PATCH 7310/7878] Hard-code the same address family on the server side as it already is on the client side; otherwise, connect will fail on dual-stack if IPV6_V6ONLY defaults to ON. (The socket setup could stand to be rewritten!) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1523484 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sendfile.c b/test/sendfile.c index e60ec71b2c9..79454e98cf1 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -497,7 +497,7 @@ static int server(void) apr_sockaddr_t *localsa; int family; - family = APR_UNSPEC; + family = APR_INET; apr_setup(&p, &sock, &family); rv = apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1); From 239d0449c7167559e7435f44ef4e1e68c09396ae Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 15 Sep 2013 21:36:08 +0000 Subject: [PATCH 7311/7878] Allow sendfile-as-client to start up the server program and display its output. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1523505 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 315 ++++++++++++++++++++++++------------------------ 1 file changed, 155 insertions(+), 160 deletions(-) diff --git a/test/sendfile.c b/test/sendfile.c index 79454e98cf1..e4c32e3c974 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -23,6 +23,9 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_poll.h" +#include "apr_thread_proc.h" + +#include "testutil.h" #if !APR_HAS_SENDFILE int main(void) @@ -53,36 +56,25 @@ int main(void) typedef enum {BLK, NONBLK, TIMEOUT} client_socket_mode_t; -static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family) +static void aprerr(const char *fn, apr_status_t rv) { char buf[120]; - apr_status_t rv; - rv = apr_initialize(); - if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_initialize()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); - } + printf("aprerr\n"); - atexit(apr_terminate); + fprintf(stderr, "%s->%d/%s\n", + fn, rv, apr_strerror(rv, buf, sizeof buf)); + exit(1); +} - rv = apr_pool_create(p, NULL); - if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_pool_create()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); - } +static void apr_setup(apr_pool_t *p, apr_socket_t **sock, int *family) +{ + apr_status_t rv; *sock = NULL; - rv = apr_socket_create(sock, *family, SOCK_STREAM, 0, *p); + rv = apr_socket_create(sock, *family, SOCK_STREAM, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_create()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_create()", rv); } if (*family == APR_UNSPEC) { @@ -90,10 +82,7 @@ static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family) rv = apr_socket_addr_get(&localsa, APR_LOCAL, *sock); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_addr_get()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_addr_get()", rv); } *family = localsa->family; } @@ -112,9 +101,7 @@ static void create_testfile(apr_pool_t *p, const char *fname) APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_TRUNCATE | APR_FOPEN_BUFFERED, APR_UREAD | APR_UWRITE, p); if (rv) { - fprintf(stderr, "apr_file_open()->%d/%s\n", - rv, apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_file_open()", rv); } buf[0] = FILE_DATA_CHAR; @@ -124,33 +111,25 @@ static void create_testfile(apr_pool_t *p, const char *fname) if ((i % 2) == 0) { rv = apr_file_putc(buf[0], f); if (rv) { - fprintf(stderr, "apr_file_putc()->%d/%s\n", - rv, apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_file_putc()", rv); } } else { rv = apr_file_puts(buf, f); if (rv) { - fprintf(stderr, "apr_file_puts()->%d/%s\n", - rv, apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_file_puts()", rv); } } } rv = apr_file_close(f); if (rv) { - fprintf(stderr, "apr_file_close()->%d/%s\n", - rv, apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_file_close()", rv); } rv = apr_stat(&finfo, fname, APR_FINFO_NORM, p); if (rv != APR_SUCCESS && ! APR_STATUS_IS_INCOMPLETE(rv)) { - fprintf(stderr, "apr_stat()->%d/%s\n", - rv, apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_stat()", rv); } if (finfo.size != FILE_LENGTH) { @@ -164,11 +143,50 @@ static void create_testfile(apr_pool_t *p, const char *fname) } } -static int client(client_socket_mode_t socket_mode, char *host) +static void spawn_server(apr_pool_t *p, apr_proc_t *out_proc) +{ + apr_proc_t proc = {0}; + apr_procattr_t *procattr; + apr_status_t rv; + const char *args[3]; + + rv = apr_procattr_create(&procattr, p); + if (rv != APR_SUCCESS) { + aprerr("apr_procattr_create()", rv); + } + + rv = apr_procattr_io_set(procattr, APR_CHILD_BLOCK, APR_CHILD_BLOCK, + APR_CHILD_BLOCK); + if (rv != APR_SUCCESS) { + aprerr("apr_procattr_io_set()", rv); + } + + rv = apr_procattr_cmdtype_set(procattr, APR_PROGRAM_ENV); + if (rv != APR_SUCCESS) { + aprerr("apr_procattr_cmdtype_set()", rv); + } + + rv = apr_procattr_error_check_set(procattr, 1); + if (rv != APR_SUCCESS) { + aprerr("apr_procattr_error_check_set()", rv); + } + + args[0] = "sendfile" EXTENSION; + args[1] = "server"; + args[2] = NULL; + rv = apr_proc_create(&proc, TESTBINPATH "sendfile" EXTENSION, args, NULL, procattr, p); + if (rv != APR_SUCCESS) { + aprerr("apr_proc_create()", rv); + } + + *out_proc = proc; +} + +static int client(apr_pool_t *p, client_socket_mode_t socket_mode, + const char *host, int start_server) { apr_status_t rv, tmprv; apr_socket_t *sock; - apr_pool_t *p; char buf[120]; apr_file_t *f = NULL; apr_size_t len; @@ -183,17 +201,19 @@ static int client(client_socket_mode_t socket_mode, char *host) int i; int family; apr_sockaddr_t *destsa; + apr_proc_t server; + + if (start_server) { + spawn_server(p, &server); + } family = APR_INET; - apr_setup(&p, &sock, &family); + apr_setup(p, &sock, &family); create_testfile(p, TESTFILE); rv = apr_file_open(&f, TESTFILE, APR_FOPEN_READ, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_file_open()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_file_open()", rv); } if (!host) { @@ -201,18 +221,12 @@ static int client(client_socket_mode_t socket_mode, char *host) } rv = apr_sockaddr_info_get(&destsa, host, family, TESTSF_PORT, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_sockaddr_info_get()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_sockaddr_info_get()", rv); } rv = apr_socket_connect(sock, destsa); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_connect()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_connect()", rv); } switch(socket_mode) { @@ -223,19 +237,14 @@ static int client(client_socket_mode_t socket_mode, char *host) /* set it non-blocking */ rv = apr_socket_opt_set(sock, APR_SO_NONBLOCK, 1); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_opt_set(APR_SO_NONBLOCK)->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_opt_set(APR_SO_NONBLOCK)", rv); } break; case TIMEOUT: /* set a timeout */ rv = apr_socket_timeout_set(sock, 100 * APR_USEC_PER_SEC); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_opt_set(APR_SO_NONBLOCK)->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); + aprerr("apr_socket_opt_set(APR_SO_NONBLOCK)", rv); exit(1); } break; @@ -277,10 +286,7 @@ static int client(client_socket_mode_t socket_mode, char *host) len = FILE_LENGTH; rv = apr_socket_sendfile(sock, f, &hdtr, ¤t_file_offset, &len, 0); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_sendfile()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_sendfile()", rv); } printf("apr_socket_sendfile() updated offset with %ld\n", @@ -428,10 +434,7 @@ static int client(client_socket_mode_t socket_mode, char *host) current_file_offset = 0; rv = apr_file_seek(f, APR_CUR, ¤t_file_offset); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_file_seek()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_file_seek()", rv); } printf("After apr_socket_sendfile(), the kernel file pointer is " @@ -440,10 +443,7 @@ static int client(client_socket_mode_t socket_mode, char *host) rv = apr_socket_shutdown(sock, APR_SHUTDOWN_WRITE); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_shutdown()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_shutdown()", rv); } /* in case this is the non-blocking test, set socket timeout; @@ -451,19 +451,13 @@ static int client(client_socket_mode_t socket_mode, char *host) rv = apr_socket_timeout_set(sock, apr_time_from_sec(3)); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_timeout_set()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_timeout_set()", rv); } bytes_read = 1; rv = apr_socket_recv(sock, buf, &bytes_read); if (rv != APR_EOF) { - fprintf(stderr, "apr_socket_recv()->%d/%s (expected APR_EOF)\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_recv() (expected APR_EOF)", rv); } if (bytes_read != 0) { fprintf(stderr, "We expected to get 0 bytes read with APR_EOF\n" @@ -476,20 +470,38 @@ static int client(client_socket_mode_t socket_mode, char *host) rv = apr_file_remove(TESTFILE, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_file_remove()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_file_remove()", rv); + } + + if (start_server) { + apr_exit_why_e exitwhy; + apr_size_t nbytes; + char responsebuf[1024]; + int exitcode; + + nbytes = sizeof(responsebuf); + rv = apr_file_read(server.out, responsebuf, &nbytes); + if (rv == APR_SUCCESS) { + printf("%.*s", (int)nbytes, responsebuf); + } + + rv = apr_proc_wait(&server, &exitcode, &exitwhy, APR_WAIT); + if (rv != APR_CHILD_DONE) { + aprerr("apr_proc_wait() (expected APR_CHILD_DONE)", rv); + } + if (exitcode != 0) { + fprintf(stderr, "sendfile server returned %d\n", exitcode); + exit(1); + } } return 0; } -static int server(void) +static int server(apr_pool_t *p) { apr_status_t rv; apr_socket_t *sock; - apr_pool_t *p; char buf[120]; int i; apr_socket_t *newsock = NULL; @@ -498,48 +510,33 @@ static int server(void) int family; family = APR_INET; - apr_setup(&p, &sock, &family); + apr_setup(p, &sock, &family); rv = apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_opt_set()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_opt_set()", rv); } rv = apr_sockaddr_info_get(&localsa, NULL, family, TESTSF_PORT, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_sockaddr_info_get()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_sockaddr_info_get()", rv); } rv = apr_socket_bind(sock, localsa); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_bind()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_bind()", rv); } rv = apr_socket_listen(sock, 5); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_listen()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_listen()", rv); } printf("Waiting for a client to connect...\n"); rv = apr_socket_accept(&newsock, sock, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_accept()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_accept()", rv); } printf("Processing a client...\n"); @@ -548,10 +545,7 @@ static int server(void) bytes_read = strlen(HDR1); rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_recv()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_recv()", rv); } if (bytes_read != strlen(HDR1)) { fprintf(stderr, "wrong data read (1)\n"); @@ -568,10 +562,7 @@ static int server(void) bytes_read = strlen(HDR2); rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_recv()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_recv()", rv); } if (bytes_read != strlen(HDR2)) { fprintf(stderr, "wrong data read (3)\n"); @@ -588,10 +579,7 @@ static int server(void) bytes_read = 1; rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_recv()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_recv()", rv); } if (bytes_read != 1) { fprintf(stderr, "apr_socket_recv()->%ld bytes instead of 1\n", @@ -613,10 +601,7 @@ static int server(void) bytes_read = 1; rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_recv()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_recv()", rv); } if (bytes_read != 1) { fprintf(stderr, "apr_socket_recv()->%ld bytes instead of 1\n", @@ -638,10 +623,7 @@ static int server(void) bytes_read = strlen(TRL1); rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_recv()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_recv()", rv); } if (bytes_read != strlen(TRL1)) { fprintf(stderr, "wrong data read (5)\n"); @@ -658,10 +640,7 @@ static int server(void) bytes_read = strlen(TRL2); rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_recv()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_recv()", rv); } if (bytes_read != strlen(TRL2)) { fprintf(stderr, "wrong data read (7)\n"); @@ -678,10 +657,7 @@ static int server(void) bytes_read = 1; rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_recv()->%d/%s\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_recv()", rv); } if (bytes_read != 1) { fprintf(stderr, "apr_socket_recv()->%ld bytes instead of 1\n", @@ -702,10 +678,7 @@ static int server(void) bytes_read = 1; rv = apr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_EOF) { - fprintf(stderr, "apr_socket_recv()->%d/%s (expected APR_EOF)\n", - rv, - apr_strerror(rv, buf, sizeof buf)); - exit(1); + aprerr("apr_socket_recv() (expected APR_EOF)", rv); } if (bytes_read != 0) { fprintf(stderr, "We expected to get 0 bytes read with APR_EOF\n" @@ -721,34 +694,56 @@ static int server(void) int main(int argc, char *argv[]) { + apr_pool_t *p; + apr_status_t rv; + #ifdef SIGPIPE signal(SIGPIPE, SIG_IGN); #endif - /* Gee whiz this is goofy logic but I wanna drive sendfile right now, - * not dork around with the command line! - */ - if (argc >= 3 && !strcmp(argv[1], "client")) { - char *host = 0; - if (argv[3]) { - host = argv[3]; - } - if (!strcmp(argv[2], "blocking")) { - return client(BLK, host); - } - else if (!strcmp(argv[2], "timeout")) { - return client(TIMEOUT, host); - } - else if (!strcmp(argv[2], "nonblocking")) { - return client(NONBLK, host); + rv = apr_initialize(); + if (rv != APR_SUCCESS) { + aprerr("apr_initialize()", rv); + } + + atexit(apr_terminate); + + rv = apr_pool_create(&p, NULL); + if (rv != APR_SUCCESS) { + aprerr("apr_pool_create()", rv); + } + + if (argc >= 2 && !strcmp(argv[1], "client")) { + const char *host = NULL; + int mode = BLK; + int start_server = 0; + int i; + + for (i = 2; i < argc; i++) { + if (!strcmp(argv[i], "blocking")) { + mode = BLK; + } + else if (!strcmp(argv[i], "timeout")) { + mode = TIMEOUT; + } + else if (!strcmp(argv[i], "nonblocking")) { + mode = NONBLK; + } + else if (!strcmp(argv[i], "startserver")) { + start_server = 1; + } + else { + host = argv[i]; + } } + return client(p, mode, host, start_server); } else if (argc == 2 && !strcmp(argv[1], "server")) { - return server(); + return server(p); } fprintf(stderr, - "Usage: %s client {blocking|nonblocking|timeout}\n" + "Usage: %s client {blocking|nonblocking|timeout} [startserver] [server-host]\n" " %s server\n", argv[0], argv[0]); return -1; From cf28492e24eaaf5f5c74b8bb3b2e91a53f28f581 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 16 Sep 2013 01:32:07 +0000 Subject: [PATCH 7312/7878] fix various compile errors and warnings git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1523521 13f79535-47bb-0310-9956-ffa450edef68 --- test/internal/testucs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/internal/testucs.c b/test/internal/testucs.c index 4dc74dae853..bf8874e48b7 100644 --- a/test/internal/testucs.c +++ b/test/internal/testucs.c @@ -17,16 +17,19 @@ #include "apr.h" #include "arch/win32/apr_arch_utf8.h" #include +#include +#include #include #include struct testval { unsigned char n[8]; - int nl; + apr_size_t nl; wchar_t w[4]; - int wl; + apr_size_t wl; }; +#ifdef FOR_REFERENCE /* For reference; a table of invalid utf-8 encoded ucs-2/ucs-4 sequences. * The table consists of start, end pairs for all invalid ranges. * NO_UCS2_PAIRS will pass the reservered D800-DFFF values, halting at FFFF @@ -71,6 +74,7 @@ struct testval malformed[] = [ [[0xFE,], 1,], /* 11111110 invalid "too large" value, no 7 byte seq */ [[0xFF,], 1,], /* 11111111 invalid "too large" value, no 8 byte seq */ ]; +#endif /* FOR_REFERENCE */ void displaynw(struct testval *f, struct testval *l) { @@ -192,7 +196,7 @@ void test_wrange(struct testval *p) } do { - int wl = s.wl, nl = sizeof(s.n); + apr_size_t wl = s.wl, nl = sizeof(s.n); rc = apr_conv_ucs2_to_utf8(s.w, &wl, s.n, &nl); s.nl = sizeof(s.n) - s.nl; if (rc == APR_INCOMPLETE) { From 1e60def691b10454217223f89677514d5d40cd7e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 16 Sep 2013 11:56:15 +0000 Subject: [PATCH 7313/7878] Fix build of aprapp/libaprapp (APR_DECLARE_STATIC was misplaced). Support building test suite against either static or dynamic libs. (Requiring separate builds is ugly, but so is creating a more complex directory structure or naming convention in the build directory and possibly having to modify test program source to find child programs.) Build additional test programs. Add running the test suite to the build system. (Using the "NMake Makefiles" generator, use "nmake test" to run silently, with output logged to some files, or "nmake check" to run with test output logged to the console.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1523604 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 144 +++++++++++++++++++++++++++++++++++-------------- README.cmake | 10 ++-- 2 files changed, 111 insertions(+), 43 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db3d2388101..3da0c48807f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,7 @@ OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON) OPTION(APR_HAVE_IPV6 "IPv6 support" ON) OPTION(INSTALL_PDB "Install .pdb files (if generated)" ON) OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) +OPTION(TEST_STATIC_LIBS "Test programs use APR static libraries instead of shared libraries?" OFF) SET(MIN_WINDOWS_VER "Vista" CACHE STRING "Minimum Windows version") SET(LIBXML2_ICONV_INCLUDE_DIR "" @@ -147,8 +148,6 @@ INCLUDE_DIRECTORIES(${APR_INCLUDE_DIRECTORIES} ${XMLLIB_INCLUDE_DIR}) SET(APR_HEADERS ${PROJECT_BINARY_DIR}/apr.h) -# and misc/win32/apr_app.c - SET(APR_PUBLIC_HEADERS_STATIC include/apr_allocator.h include/apr_anylock.h @@ -411,6 +410,7 @@ SET(APR_TEST_SOURCES SET(install_targets) SET(install_bin_pdb) SET(install_lib_pdb) +SET(dbd_drivers) # libapr-2 is shared, apr-2 is static ADD_LIBRARY(libapr-2 SHARED ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/apr.h libapr.rc) @@ -430,13 +430,13 @@ ADD_DEPENDENCIES(apr-2 test_char_header) # libaprapp-2 and aprapp-2 are static ADD_LIBRARY(libaprapp-2 STATIC ${APR_HEADERS} ${PROJECT_BINARY_DIR}/apr.h misc/win32/apr_app.c misc/win32/internal.c) SET(install_targets ${install_targets} libaprapp-2) -SET(install_lib_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libaprapp-2.pdb) +SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/libaprapp-2.pdb) SET_TARGET_PROPERTIES(libaprapp-2 PROPERTIES COMPILE_DEFINITIONS APR_APP) -ADD_LIBRARY(aprapp-2 STATIC ${APR_HEADERS} ${PROJECT_BINARY_DIR}/apr.h misc/win32/apr_app.c) +ADD_LIBRARY(aprapp-2 STATIC ${APR_HEADERS} ${PROJECT_BINARY_DIR}/apr.h misc/win32/apr_app.c misc/win32/internal.c) SET(install_targets ${install_targets} aprapp-2) SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/aprapp-2.pdb) -SET_TARGET_PROPERTIES(libaprapp-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_APP") +SET_TARGET_PROPERTIES(aprapp-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_APP") IF(APU_HAVE_CRYPTO) IF(NOT OPENSSL_FOUND) @@ -454,6 +454,7 @@ IF(APU_HAVE_ODBC) ADD_LIBRARY(apr_dbd_odbc-2 SHARED dbd/apr_dbd_odbc.c libapr.rc) SET(install_targets ${install_targets} apr_dbd_odbc-2) SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_dbd_odbc-2.pdb) + SET(dbd_drivers ${dbd_drivers} odbc) TARGET_LINK_LIBRARIES(apr_dbd_odbc-2 libapr-2 ${APR_SYSTEM_LIBS} odbc32 odbccp32) SET_PROPERTY(TARGET apr_dbd_odbc-2 APPEND PROPERTY LINK_FLAGS /export:apr_dbd_odbc_driver) SET_TARGET_PROPERTIES(apr_dbd_odbc-2 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APR_DECLARE_EXPORT;APU_DSO_MODULE_BUILD") @@ -461,52 +462,110 @@ IF(APU_HAVE_ODBC) ENDIF() IF(APR_BUILD_TESTAPR) - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/data) - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/test/data/billion-laughs.xml ${PROJECT_BINARY_DIR}/data/billion-laughs.xml) - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/test/data/file_datafile.txt ${PROJECT_BINARY_DIR}/data/file_datafile.txt) - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/test/data/mmap_datafile.txt ${PROJECT_BINARY_DIR}/data/mmap_datafile.txt) + ENABLE_TESTING() + # Create a "check" target that displays test program output to the console. + ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND} --verbose) + + # copy data files to build directory so that we can run programs from there + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory + ${PROJECT_BINARY_DIR}/data) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${PROJECT_SOURCE_DIR}/test/data/billion-laughs.xml + ${PROJECT_BINARY_DIR}/data/billion-laughs.xml) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${PROJECT_SOURCE_DIR}/test/data/file_datafile.txt + ${PROJECT_BINARY_DIR}/data/file_datafile.txt) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${PROJECT_SOURCE_DIR}/test/data/mmap_datafile.txt + ${PROJECT_BINARY_DIR}/data/mmap_datafile.txt) + + IF(TEST_STATIC_LIBS) + SET(whichapr apr-2) + SET(whichaprapp aprapp-2) + SET(apiflag -DAPR_DECLARE_STATIC) + ELSE() + SET(whichapr libapr-2) + SET(whichaprapp libaprapp-2) + SET(apiflag) + ENDIF() + + ADD_EXECUTABLE(testapp test/testapp.c) + TARGET_LINK_LIBRARIES(testapp ${whichapr} ${whichaprapp} ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) + SET_TARGET_PROPERTIES(testapp PROPERTIES LINK_FLAGS /entry:wmainCRTStartup) + IF(apiflag) + SET_TARGET_PROPERTIES(testapp PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + ADD_TEST(NAME testapp COMMAND testapp) ADD_EXECUTABLE(testall ${APR_TEST_SOURCES}) - TARGET_LINK_LIBRARIES(testall apr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) + TARGET_LINK_LIBRARIES(testall ${whichapr} ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) + IF(apiflag) + SET_TARGET_PROPERTIES(testall PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + ADD_TEST(NAME testall COMMAND testall) ADD_LIBRARY(mod_test MODULE test/mod_test.c) - TARGET_LINK_LIBRARIES(mod_test apr-2 ${APR_SYSTEM_LIBS}) + TARGET_LINK_LIBRARIES(mod_test ${whichapr} ${APR_SYSTEM_LIBS}) SET_PROPERTY(TARGET mod_test APPEND PROPERTY LINK_FLAGS /export:print_hello) # nasty work-around for difficulties adding more than one additional flag # (they get joined in a bad way behind the scenes) GET_PROPERTY(link_flags TARGET mod_test PROPERTY LINK_FLAGS) SET(link_flags "${link_flags} /export:count_reps") SET_TARGET_PROPERTIES(mod_test PROPERTIES LINK_FLAGS ${link_flags}) + IF(apiflag) + SET_TARGET_PROPERTIES(mod_test PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() - ADD_EXECUTABLE(dbd test/dbd.c) - TARGET_LINK_LIBRARIES(dbd apr-2 ${APR_SYSTEM_LIBS}) - - ADD_EXECUTABLE(occhild test/occhild.c) - TARGET_LINK_LIBRARIES(occhild apr-2 ${APR_SYSTEM_LIBS}) - - ADD_EXECUTABLE(globalmutexchild test/globalmutexchild.c) - TARGET_LINK_LIBRARIES(globalmutexchild apr-2 ${APR_SYSTEM_LIBS}) - - ADD_EXECUTABLE(proc_child test/proc_child.c) - TARGET_LINK_LIBRARIES(proc_child apr-2 ${APR_SYSTEM_LIBS}) - - ADD_EXECUTABLE(readchild test/readchild.c) - TARGET_LINK_LIBRARIES(readchild apr-2 ${APR_SYSTEM_LIBS}) - - ADD_EXECUTABLE(sockchild test/sockchild.c) - TARGET_LINK_LIBRARIES(sockchild apr-2 ${APR_SYSTEM_LIBS}) - - ADD_EXECUTABLE(testshmconsumer test/testshmconsumer.c) - TARGET_LINK_LIBRARIES(testshmconsumer apr-2 ${APR_SYSTEM_LIBS}) - - ADD_EXECUTABLE(testshmproducer test/testshmproducer.c) - TARGET_LINK_LIBRARIES(testshmproducer apr-2 ${APR_SYSTEM_LIBS}) - - ADD_EXECUTABLE(tryread test/tryread.c) - TARGET_LINK_LIBRARIES(tryread apr-2 ${APR_SYSTEM_LIBS}) - - # test programs are linked with static library - SET_TARGET_PROPERTIES(testall dbd mod_test occhild globalmutexchild proc_child readchild sockchild testshmconsumer testshmproducer tryread PROPERTIES COMPILE_FLAGS -DAPR_DECLARE_STATIC) + # Build all the single-source executable files with no special build + # requirements. + SET(single_source_programs + test/dbd.c + test/echod.c + test/sendfile.c + test/sockperf.c + test/testlockperf.c + test/testmutexscope.c + test/globalmutexchild.c + test/occhild.c + test/proc_child.c + test/readchild.c + test/sockchild.c + test/testshmproducer.c + test/testshmconsumer.c + test/tryread.c + test/internal/testucs.c + ) + + FOREACH(sourcefile ${single_source_programs}) + STRING(REGEX REPLACE ".*/([^\\]+)\\.c" "\\1" proggie ${sourcefile}) + ADD_EXECUTABLE(${proggie} ${sourcefile}) + TARGET_LINK_LIBRARIES(${proggie} ${whichapr} ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) + IF(apiflag) + SET_TARGET_PROPERTIES(${proggie} PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + ENDFOREACH() + + # Add tests for programs that run by themselves with no arguments. + SET(simple_tests + testlockperf + testmutexscope + testucs + ) + + FOREACH(simple ${simple_tests}) + ADD_TEST(NAME ${simple} COMMAND ${simple}) + ENDFOREACH() + + # dbd and sendfile are run multiple times with different parameters. + FOREACH(somedbd ${dbd_drivers}) + ADD_TEST(NAME dbd-${somedbd} COMMAND dbd ${somedbd}) + ENDFOREACH() + + FOREACH(sendfile_mode blocking nonblocking timeout) + ADD_TEST(NAME sendfile-${sendfile_mode} COMMAND sendfile client ${sendfile_mode} startserver) + ENDFOREACH() + + # No test is added for echod+sockperf. Those will have to be run manually. ENDIF (APR_BUILD_TESTAPR) @@ -557,4 +616,9 @@ MESSAGE(STATUS " Use LibXml2 ..................... : ${APU_USE_LIBXML2}") MESSAGE(STATUS " Minimum Windows version ......... : ${MIN_WINDOWS_VER}") MESSAGE(STATUS " Library files for XML ........... : ${XMLLIB_LIBRARIES}") MESSAGE(STATUS " Build test suite ................ : ${APR_BUILD_TESTAPR}") +IF(TEST_STATIC_LIBS) +MESSAGE(STATUS " (testing static libraries)") +ELSE() +MESSAGE(STATUS " (testing dynamic libraries)") +ENDIF() MESSAGE(STATUS " Install private .h for httpd .... : ${APR_INSTALL_PRIVATE_H}") diff --git a/README.cmake b/README.cmake index 2cd733f5c86..60e0f4bea27 100644 --- a/README.cmake +++ b/README.cmake @@ -86,6 +86,13 @@ How to build Default: ON APR_BUILD_TESTAPR Build APR test suite Default: OFF + TEST_STATIC_LIBS Build the test suite to test the APR static + library instead of the APR dynamic library. + Default: OFF + In order to build the test suite against both + static and dynamic libraries, separate builds + will be required, one with TEST_STATIC_LIBS + set to ON. MIN_WINDOWS_VER Minimum Windows version supported by this build (This controls the setting of _WIN32_WINNT.) "Vista" or "Windows7" or a numeric value like @@ -137,12 +144,9 @@ Known Bugs and Limitations . APU_HAVE_NSS + APU_HAVE_ICONV * Static builds of APR modules are not supported. -* No test program build to use libapr-2.dll is created. * Support static *or* shared build of Expat. -* No script or other mechanism is provided to run the test suite. * APR-CHANGES.txt, APR-LICENSE.txt, and APR-NOTICE.txt are not installed, though perhaps that is a job for a higher-level script. -* test/internal/testucs is not built. Generally: From 4bf8648b35181a0fbfaf1d94dc31e6e0865dfc76 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 16 Sep 2013 12:47:06 +0000 Subject: [PATCH 7314/7878] report an error if the client couldn't read stdout from the server within a couple of seconds git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1523613 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/sendfile.c b/test/sendfile.c index e4c32e3c974..264ab2f705a 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -479,12 +479,16 @@ static int client(apr_pool_t *p, client_socket_mode_t socket_mode, char responsebuf[1024]; int exitcode; + rv = apr_file_pipe_timeout_set(server.out, apr_time_from_sec(2)); + if (rv != APR_SUCCESS) { + aprerr("apr_file_pipe_timeout_set()", rv); + } nbytes = sizeof(responsebuf); rv = apr_file_read(server.out, responsebuf, &nbytes); - if (rv == APR_SUCCESS) { - printf("%.*s", (int)nbytes, responsebuf); + if (rv != APR_SUCCESS) { + aprerr("apr_file_read() messages from server", rv); } - + printf("%.*s", (int)nbytes, responsebuf); rv = apr_proc_wait(&server, &exitcode, &exitwhy, APR_WAIT); if (rv != APR_CHILD_DONE) { aprerr("apr_proc_wait() (expected APR_CHILD_DONE)", rv); From 6441fec749133619cb992d18924943f35b565dd6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 16 Sep 2013 12:48:37 +0000 Subject: [PATCH 7315/7878] follow up to r1523384: if we disable non-blocking when a timeout is set, forget that non-blocking is enabled git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1523615 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/win32/sockopt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 7f7a0eda66a..463eeebf55c 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -66,6 +66,7 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interva if (sock->timeout == 0 || apr_is_option_set(sock, APR_SO_NONBLOCK)) { if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) return stat; + apr_set_option(sock, APR_SO_NONBLOCK, 0); } /* Reset socket timeouts if the new timeout differs from the old timeout */ if (sock->timeout != t) From 80c11eafd05a0ac70e58ca374b293bac717ed283 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 16 Sep 2013 23:27:57 +0000 Subject: [PATCH 7316/7878] run the sendfile test automatically git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1523844 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index d0620934b52..2cd43c932ea 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -9,7 +9,7 @@ VPATH = @srcdir@ # STDTEST_NONPORTABLE # test programs invoked via standard user interface, not portable # OTHER_PROGRAMS -# programs such as sendfile, that have to be invoked in a special sequence +# programs such as sockperf, that have to be invoked in a special sequence # or with special parameters # TESTALL_COMPONENTS # programs such as globalmutexchild which the various TESTS will invoke @@ -20,6 +20,7 @@ STDTEST_PORTABLE = \ testmutexscope@EXEEXT@ \ testall@EXEEXT@ \ dbd@EXEEXT@ \ + sendfile@EXEEXT@ \ TESTS = testtime.lo teststr.lo testvsn.lo testipsub.lo testshm.lo \ testmmap.lo testud.lo testtable.lo testsleep.lo testpools.lo \ @@ -38,7 +39,6 @@ TESTS = testtime.lo teststr.lo testvsn.lo testipsub.lo testshm.lo \ testlfsabi32.lo testlfsabi64.lo testescape.lo OTHER_PROGRAMS = \ - sendfile@EXEEXT@ \ echod@EXEEXT@ \ sockperf@EXEEXT@ @@ -185,6 +185,16 @@ check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) fi; \ fi; \ done; \ + elif test "$$prog" = 'sendfile'; then \ + for mode in blocking nonblocking timeout; do \ + @shlibpath_var@="`echo "../dbm/.libs:../dbd/.libs:$$@shlibpath_var@" | sed -e 's/::*$$//'`" \ + ./$$prog client $$mode startserver 127.0.0.1; \ + status=$$?; \ + if test $$status != 0; then \ + teststatus=$$status; \ + progfailed="$$progfailed '$$prog mode $$mode'"; \ + fi; \ + done; \ else \ @shlibpath_var@="`echo "../dbm/.libs:../dbd/.libs:$$@shlibpath_var@" | sed -e 's/::*$$//'`" \ ./$$prog -v; \ From b6b8df283aa437f40c7499103b9b2e267ce14aaf Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 16 Sep 2013 23:28:35 +0000 Subject: [PATCH 7317/7878] typo in comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1523845 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 7fcd4b6eca4..a09bdb0bf49 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -647,7 +647,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc, * APR_NOWAIT -- return immediately regardless of if the * child is dead or not. *
    - * @remark The childs status is in the return code to this process. It is one of: + * @remark The child's status is in the return code to this process. It is one of: *
      *            APR_CHILD_DONE     -- child is no longer running.
      *            APR_CHILD_NOTDONE  -- child is still running.
    
    From e4af46cf9bb61d289af85ae836ac747dcd0e7e1e Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 17 Sep 2013 00:18:25 +0000
    Subject: [PATCH 7318/7878] client mode: wait a bit for the server to start up
     if it was spawned by the client (to solve buildbot failure, presumably)
    
    axe stray "aprerr" emit from aprerr()
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1523853 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/sendfile.c | 13 ++++++++++---
     1 file changed, 10 insertions(+), 3 deletions(-)
    
    diff --git a/test/sendfile.c b/test/sendfile.c
    index 264ab2f705a..68790e0a287 100644
    --- a/test/sendfile.c
    +++ b/test/sendfile.c
    @@ -60,8 +60,6 @@ static void aprerr(const char *fn, apr_status_t rv)
     {
         char buf[120];
     
    -    printf("aprerr\n");
    -
         fprintf(stderr, "%s->%d/%s\n",
                 fn, rv, apr_strerror(rv, buf, sizeof buf));
         exit(1);
    @@ -198,13 +196,16 @@ static int client(apr_pool_t *p, client_socket_mode_t socket_mode,
         apr_size_t bytes_read;
         apr_pollset_t *pset;
         apr_int32_t nsocks;
    +    int connect_tries = 1;
         int i;
         int family;
         apr_sockaddr_t *destsa;
         apr_proc_t server;
    +    apr_interval_time_t connect_retry_interval = apr_time_from_msec(50);
     
         if (start_server) {
             spawn_server(p, &server);
    +        connect_tries = 5; /* give it a chance to start up */
         }
     
         family = APR_INET;
    @@ -224,7 +225,13 @@ static int client(apr_pool_t *p, client_socket_mode_t socket_mode,
             aprerr("apr_sockaddr_info_get()", rv);
         }
     
    -    rv = apr_socket_connect(sock, destsa);
    +    while (connect_tries--) {
    +        rv = apr_socket_connect(sock, destsa);
    +        if (connect_tries && APR_STATUS_IS_ECONNREFUSED(rv)) {
    +            apr_sleep(apr_time_from_msec(connect_retry_interval));
    +            connect_retry_interval *= 2;
    +        }
    +    }
         if (rv != APR_SUCCESS) {
             aprerr("apr_socket_connect()", rv);
         }
    
    From e794b91411cd7eca07a3133006abec34ced7430c Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 17 Sep 2013 12:45:16 +0000
    Subject: [PATCH 7319/7878] fix what is effectively
     apr_time_from_msec(apr_time_from_msec(small))
    
    Reported by: Yann Ylavic 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1524014 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/sendfile.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/sendfile.c b/test/sendfile.c
    index 68790e0a287..d5cac35b2cd 100644
    --- a/test/sendfile.c
    +++ b/test/sendfile.c
    @@ -228,7 +228,7 @@ static int client(apr_pool_t *p, client_socket_mode_t socket_mode,
         while (connect_tries--) {
             rv = apr_socket_connect(sock, destsa);
             if (connect_tries && APR_STATUS_IS_ECONNREFUSED(rv)) {
    -            apr_sleep(apr_time_from_msec(connect_retry_interval));
    +            apr_sleep(connect_retry_interval);
                 connect_retry_interval *= 2;
             }
         }
    
    From 6b2405d446a04c83c1f652372f115e9660ca51c7 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 17 Sep 2013 13:08:18 +0000
    Subject: [PATCH 7320/7878] follow-up to r1523853 and r1524014:   when running
     in automated mode (client starts the server process),   make the client stop
     calling apr_connect() as soon as it works or   some non-ECONNREFUSED error
     occurs
    
    Submitted by: Yann Ylavic 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1524031 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/sendfile.c | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/test/sendfile.c b/test/sendfile.c
    index d5cac35b2cd..61550e8574e 100644
    --- a/test/sendfile.c
    +++ b/test/sendfile.c
    @@ -231,6 +231,9 @@ static int client(apr_pool_t *p, client_socket_mode_t socket_mode,
                 apr_sleep(connect_retry_interval);
                 connect_retry_interval *= 2;
             }
    +        else {
    +            break;
    +        }
         }
         if (rv != APR_SUCCESS) {
             aprerr("apr_socket_connect()", rv);
    
    From 520ab4bafd391f5cd8d75e0001c821702885907e Mon Sep 17 00:00:00 2001
    From: Jim Jagielski 
    Date: Mon, 30 Sep 2013 13:07:52 +0000
    Subject: [PATCH 7321/7878] Add in apr_skiplist
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1527540 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr.dsp                |   8 +
     include/apr_skiplist.h |  82 ++++++
     libapr.dsp             |   9 +-
     tables/apr_skiplist.c  | 650 +++++++++++++++++++++++++++++++++++++++++
     4 files changed, 748 insertions(+), 1 deletion(-)
     create mode 100644 include/apr_skiplist.h
     create mode 100644 tables/apr_skiplist.c
    
    diff --git a/apr.dsp b/apr.dsp
    index e9f2eaf9ac6..9356d7d274a 100644
    --- a/apr.dsp
    +++ b/apr.dsp
    @@ -658,6 +658,10 @@ SOURCE=.\tables\apr_hash.c
     
     SOURCE=.\tables\apr_tables.c
     # End Source File
    +# Begin Source File
    +
    +SOURCE=.\tables\apr_skiplist.c
    +# End Source File
     # End Group
     # Begin Group "threadproc"
     
    @@ -966,6 +970,10 @@ SOURCE=.\include\apr_signal.h
     # End Source File
     # Begin Source File
     
    +SOURCE=.\include\apr_skiplist.h
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\apr_strings.h
     # End Source File
     # Begin Source File
    diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h
    new file mode 100644
    index 00000000000..37306da2a4c
    --- /dev/null
    +++ b/include/apr_skiplist.h
    @@ -0,0 +1,82 @@
    +/* Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +#ifndef _APR_SKIPLIST_P_H
    +#define _APR_SKIPLIST_P_H
    +
    +#include "apr.h"
    +#include "apr_portable.h"
    +#include 
    +
    +
    +/* This is the function type that must be implemented per object type
    +   that is used in a skiplist for comparisons to maintain order */
    +typedef int (*apr_skiplist_compare) (void *, void *);
    +typedef void (*apr_skiplist_freefunc) (void *);
    +
    +struct apr_skiplist;
    +struct apr_skiplistnode;
    +
    +typedef struct apr_skiplistnode apr_skiplistnode;
    +typedef struct apr_skiplist apr_skiplist;
    +
    +APR_DECLARE(void *) apr_skiplist_alloc(apr_skiplist *sl, size_t size);
    +
    +APR_DECLARE(void) apr_skiplist_free(apr_skiplist *sl, void *mem);
    +
    +APR_DECLARE(apr_status_t) apr_skiplist_init(apr_skiplist **sl, apr_pool_t *p);
    +
    +APR_DECLARE(void) apr_skiplist_set_compare(apr_skiplist *sl, apr_skiplist_compare,
    +                             apr_skiplist_compare);
    +
    +APR_DECLARE(void) apr_skiplist_add_index(apr_skiplist *sl, apr_skiplist_compare,
    +                        apr_skiplist_compare);
    +
    +APR_DECLARE(apr_skiplistnode *) apr_skiplist_getlist(apr_skiplist *sl);
    +
    +APR_DECLARE(void *) apr_skiplist_find_compare(apr_skiplist *sl,
    +                               void *data,
    +                               apr_skiplistnode **iter,
    +                               apr_skiplist_compare func);
    +
    +APR_DECLARE(void *) apr_skiplist_find(apr_skiplist *sl, void *data, apr_skiplistnode **iter);
    +
    +APR_DECLARE(void *) apr_skiplist_next(apr_skiplist *sl, apr_skiplistnode **iter);
    +
    +APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **iter);
    +
    +
    +APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl,
    +                                          void *data, apr_skiplist_compare comp);
    +
    +APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist* sl, void *data);
    +
    +APR_DECLARE(int) apr_skiplist_remove_compare(apr_skiplist *sl, void *data,
    +                               apr_skiplist_freefunc myfree, apr_skiplist_compare comp);
    +
    +APR_DECLARE(int) apr_skiplist_remove(apr_skiplist *sl, void *data, apr_skiplist_freefunc myfree);
    +
    +APR_DECLARE(void) apr_skiplist_remove_all(apr_skiplist *sl, apr_skiplist_freefunc myfree);
    +
    +APR_DECLARE(void) apr_skiplist_destroy(apr_skiplist *sl, apr_skiplist_freefunc myfree);
    +
    +APR_DECLARE(void *) apr_skiplist_pop(apr_skiplist *a, apr_skiplist_freefunc myfree);
    +
    +APR_DECLARE(void *) apr_skiplist_peek(apr_skiplist *a);
    +
    +APR_DECLARE(apr_skiplist *) apr_skiplist_merge(apr_skiplist *sl1, apr_skiplist *sl2);
    +
    +#endif
    diff --git a/libapr.dsp b/libapr.dsp
    index 719c3fd5420..ccdb1817e34 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -688,11 +688,14 @@ SOURCE=.\strmatch\apr_strmatch.c
     # Begin Source File
     
     SOURCE=.\tables\apr_hash.c
    -# End Source File
     # Begin Source File
     
     SOURCE=.\tables\apr_tables.c
     # End Source File
    +# Begin Source File
    +
    +SOURCE=.\tables\apr_skiplist.c
    +# End Source File
     # End Group
     # Begin Group "threadproc"
     
    @@ -1001,6 +1004,10 @@ SOURCE=.\include\apr_signal.h
     # End Source File
     # Begin Source File
     
    +SOURCE=.\include\apr_skiplist.h
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\apr_strings.h
     # End Source File
     # Begin Source File
    diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c
    new file mode 100644
    index 00000000000..effcf603b5f
    --- /dev/null
    +++ b/tables/apr_skiplist.c
    @@ -0,0 +1,650 @@
    +/* Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +/*
    + * Modified to use APR and APR pools.
    + *  TODO: Is malloc() better? Will long running skiplists grow too much?
    + *  Keep the skiplist_alloc() and skiplist_free() until we know
    + *  Yeah, if using pools it means some bogus cycles for checks
    + *  (and an useless function call for skiplist_free) which we
    + *  can removed if/when needed.
    + */
    +
    +#include "apr_skiplist.h"
    +
    +struct apr_skiplist {
    +    apr_skiplist_compare compare;
    +    apr_skiplist_compare comparek;
    +    int height;
    +    int preheight;
    +    int size;
    +    apr_skiplistnode *top;
    +    apr_skiplistnode *bottom;
    +    /* These two are needed for appending */
    +    apr_skiplistnode *topend;
    +    apr_skiplistnode *bottomend;
    +    apr_skiplist *index;
    +    apr_array_header_t *memlist;
    +    apr_pool_t *pool;
    +};
    +
    +struct apr_skiplistnode {
    +    void *data;
    +    apr_skiplistnode *next;
    +    apr_skiplistnode *prev;
    +    apr_skiplistnode *down;
    +    apr_skiplistnode *up;
    +    apr_skiplistnode *previndex;
    +    apr_skiplistnode *nextindex;
    +    apr_skiplist *sl;
    +};
    +
    +#ifndef MIN
    +#define MIN(a,b) ((a 31) {              /* Num bits in return of rand() */
    +        ph = 0;
    +        randseq = (apr_uint32_t) rand();
    +    }
    +    ph++;
    +    return ((randseq & (1 << (ph - 1))) >> (ph - 1));
    +}
    +
    +typedef struct {
    +    size_t size;
    +    apr_array_header_t *list;
    +} memlist_t;
    +
    +typedef struct {
    +    void *ptr;
    +    char inuse;
    +} chunk_t;
    +
    +APR_DECLARE(void *) apr_skiplist_alloc(apr_skiplist *sl, size_t size)
    +{
    +    if (sl->pool) {
    +        void *ptr;
    +        int found_size = 0;
    +        int i;
    +        chunk_t *newchunk;
    +        memlist_t *memlist = (memlist_t *)sl->memlist->elts;
    +        for (i = 0; i < sl->memlist->nelts; i++) {
    +            if (memlist->size == size) {
    +                int j;
    +                chunk_t *chunk = (chunk_t *)memlist->list->elts;
    +                found_size = 1;
    +                for (j = 0; j < memlist->list->nelts; j++) {
    +                    if (!chunk->inuse) {
    +                        chunk->inuse = 1;
    +                        return chunk->ptr;
    +                    }
    +                    chunk++;
    +                }
    +                break; /* no free of this size; punt */
    +            }
    +            memlist++;
    +        }
    +        /* no free chunks */
    +        ptr = apr_pcalloc(sl->pool, size);
    +        if (!ptr) {
    +            return ptr;
    +        }
    +        /*
    +         * is this a new sized chunk? If so, we need to create a new
    +         * array of them. Otherwise, re-use what we already have.
    +         */
    +        if (!found_size) {
    +            memlist = apr_array_push(sl->memlist);
    +            memlist->size = size;
    +            memlist->list = apr_array_make(sl->pool, 20, sizeof(chunk_t));
    +        }
    +        newchunk = apr_array_push(memlist->list);
    +        newchunk->ptr = ptr;
    +        newchunk->inuse = 1;
    +        return ptr;
    +    }
    +    else {
    +        return calloc(1, size);
    +    }
    +}
    +
    +APR_DECLARE(void) apr_skiplist_free(apr_skiplist *sl, void *mem)
    +{
    +    if (!sl->pool) {
    +        free(mem);
    +    }
    +    else {
    +        int i;
    +        memlist_t *memlist = (memlist_t *)sl->memlist->elts;
    +        for (i = 0; i < sl->memlist->nelts; i++) {
    +            int j;
    +            chunk_t *chunk = (chunk_t *)memlist->list->elts;
    +            for (j = 0; j < memlist->list->nelts; j++) {
    +                if (chunk->ptr == mem) {
    +                    chunk->inuse = 0;
    +                    return;
    +                }
    +                chunk++;
    +            }
    +            memlist++;
    +        }
    +    }
    +}
    +
    +static apr_status_t skiplisti_init(apr_skiplist **s, apr_pool_t *p)
    +{
    +    apr_skiplist *sl;
    +    if (p) {
    +        sl = apr_pcalloc(p, sizeof(apr_skiplist));
    +        sl->memlist = apr_array_make(p, 20, sizeof(memlist_t));
    +    }
    +    else {
    +        sl = calloc(1, sizeof(apr_skiplist));
    +    }
    +#if 0
    +    sl->compare = (apr_skiplist_compare) NULL;
    +    sl->comparek = (apr_skiplist_compare) NULL;
    +    sl->height = 0;
    +    sl->preheight = 0;
    +    sl->size = 0;
    +    sl->top = NULL;
    +    sl->bottom = NULL;
    +    sl->index = NULL;
    +#endif
    +    sl->pool = p;
    +    *s = sl;
    +    return APR_SUCCESS;
    +}
    +
    +static int indexing_comp(void *a, void *b)
    +{
    +    void *ac = (void *) (((apr_skiplist *) a)->compare);
    +    void *bc = (void *) (((apr_skiplist *) b)->compare);
    +    return ((ac < bc) ? -1 : ((ac > bc) ? 1 : 0));
    +}
    +
    +static int indexing_compk(void *ac, void *b)
    +{
    +    void *bc = (void *) (((apr_skiplist *) b)->compare);
    +    return ((ac < bc) ? -1 : ((ac > bc) ? 1 : 0));
    +}
    +
    +APR_DECLARE(apr_status_t) apr_skiplist_init(apr_skiplist **s, apr_pool_t *p)
    +{
    +    apr_skiplist *sl;
    +    skiplisti_init(s, p);
    +    sl = *s;
    +    skiplisti_init(&(sl->index), p);
    +    apr_skiplist_set_compare(sl->index, indexing_comp, indexing_compk);
    +    return APR_SUCCESS;
    +}
    +
    +APR_DECLARE(void) apr_skiplist_set_compare(apr_skiplist *sl,
    +                          apr_skiplist_compare comp,
    +                          apr_skiplist_compare compk)
    +{
    +    if (sl->compare && sl->comparek) {
    +        apr_skiplist_add_index(sl, comp, compk);
    +    }
    +    else {
    +        sl->compare = comp;
    +        sl->comparek = compk;
    +    }
    +}
    +
    +APR_DECLARE(void) apr_skiplist_add_index(apr_skiplist *sl,
    +                        apr_skiplist_compare comp,
    +                        apr_skiplist_compare compk)
    +{
    +    apr_skiplistnode *m;
    +    apr_skiplist *ni;
    +    int icount = 0;
    +    apr_skiplist_find(sl->index, (void *)comp, &m);
    +    if (m) {
    +        return;                 /* Index already there! */
    +    }
    +    skiplisti_init(&ni, sl->pool);
    +    apr_skiplist_set_compare(ni, comp, compk);
    +    /* Build the new index... This can be expensive! */
    +    m = apr_skiplist_insert(sl->index, ni);
    +    while (m->prev) {
    +        m = m->prev;
    +        icount++;
    +    }
    +    for (m = apr_skiplist_getlist(sl); m; apr_skiplist_next(sl, &m)) {
    +        int j = icount - 1;
    +        apr_skiplistnode *nsln;
    +        nsln = apr_skiplist_insert(ni, m->data);
    +        /* skip from main index down list */
    +        while (j > 0) {
    +            m = m->nextindex;
    +            j--;
    +        }
    +        /* insert this node in the indexlist after m */
    +        nsln->nextindex = m->nextindex;
    +        if (m->nextindex) {
    +            m->nextindex->previndex = nsln;
    +        }
    +        nsln->previndex = m;
    +        m->nextindex = nsln;
    +    }
    +}
    +
    +APR_DECLARE(apr_skiplistnode *) apr_skiplist_getlist(apr_skiplist *sl)
    +{
    +    if (!sl->bottom) {
    +        return NULL;
    +    }
    +    return sl->bottom->next;
    +}
    +
    +APR_DECLARE(void *) apr_skiplist_find(apr_skiplist *sl, void *data, apr_skiplistnode **iter)
    +{
    +    void *ret;
    +    apr_skiplistnode *aiter;
    +    if (!sl->compare) {
    +        return 0;
    +    }
    +    if (iter) {
    +        ret = apr_skiplist_find_compare(sl, data, iter, sl->compare);
    +    }
    +    else {
    +        ret = apr_skiplist_find_compare(sl, data, &aiter, sl->compare);
    +    }
    +    return ret;
    +}
    +
    +static int skiplisti_find_compare(apr_skiplist *sl, void *data,
    +                           apr_skiplistnode **ret,
    +                           apr_skiplist_compare comp)
    +{
    +    apr_skiplistnode *m = NULL;
    +    int count = 0;
    +    m = sl->top;
    +    while (m) {
    +        int compared;
    +        compared = (m->next) ? comp(data, m->next->data) : -1;
    +        if (compared == 0) {
    +            m = m->next;
    +            while (m->down) {
    +                m = m->down;
    +            }
    +            *ret = m;
    +            return count;
    +        }
    +        if ((m->next == NULL) || (compared < 0)) {
    +            m = m->down;
    +            count++;
    +        }
    +        else {
    +            m = m->next;
    +            count++;
    +        }
    +    }
    +    *ret = NULL;
    +    return count;
    +}
    +
    +APR_DECLARE(void *) apr_skiplist_find_compare(apr_skiplist *sli, void *data,
    +                               apr_skiplistnode **iter,
    +                               apr_skiplist_compare comp)
    +{
    +    apr_skiplistnode *m = NULL;
    +    apr_skiplist *sl;
    +    if (comp == sli->compare || !sli->index) {
    +        sl = sli;
    +    }
    +    else {
    +        apr_skiplist_find(sli->index, (void *)comp, &m);
    +        sl = (apr_skiplist *) m->data;
    +    }
    +    skiplisti_find_compare(sl, data, iter, sl->comparek);
    +    return (iter && *iter) ? ((*iter)->data) : NULL;
    +}
    +
    +
    +APR_DECLARE(void *) apr_skiplist_next(apr_skiplist *sl, apr_skiplistnode **iter)
    +{
    +    if (!*iter) {
    +        return NULL;
    +    }
    +    *iter = (*iter)->next;
    +    return (*iter) ? ((*iter)->data) : NULL;
    +}
    +
    +APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **iter)
    +{
    +    if (!*iter) {
    +        return NULL;
    +    }
    +    *iter = (*iter)->prev;
    +    return (*iter) ? ((*iter)->data) : NULL;
    +}
    +
    +APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist *sl, void *data)
    +{
    +    if (!sl->compare) {
    +        return 0;
    +    }
    +    return apr_skiplist_insert_compare(sl, data, sl->compare);
    +}
    +
    +APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, void *data,
    +                                      apr_skiplist_compare comp)
    +{
    +    apr_skiplistnode *m, *p, *tmp, *ret = NULL, **stack;
    +    int nh = 1, ch, stacki;
    +    if (!sl->top) {
    +        sl->height = 1;
    +        sl->topend = sl->bottomend = sl->top = sl->bottom =
    +            (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode));
    +#if 0
    +        sl->top->next = (apr_skiplistnode *)NULL;
    +        sl->top->data = (apr_skiplistnode *)NULL;
    +        sl->top->prev = (apr_skiplistnode *)NULL;
    +        sl->top->up = (apr_skiplistnode *)NULL;
    +        sl->top->down = (apr_skiplistnode *)NULL;
    +        sl->top->nextindex = (apr_skiplistnode *)NULL;
    +        sl->top->previndex = (apr_skiplistnode *)NULL;
    +#endif
    +        sl->top->sl = sl;
    +    }
    +    if (sl->preheight) {
    +        while (nh < sl->preheight && get_b_rand()) {
    +            nh++;
    +        }
    +    }
    +    else {
    +        while (nh <= sl->height && get_b_rand()) {
    +            nh++;
    +        }
    +    }
    +    /* Now we have the new height at which we wish to insert our new node */
    +    /*
    +     * Let us make sure that our tree is a least that tall (grow if
    +     * necessary)
    +     */
    +    for (; sl->height < nh; sl->height++) {
    +        sl->top->up =
    +            (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode));
    +        sl->top->up->down = sl->top;
    +        sl->top = sl->topend = sl->top->up;
    +#if 0
    +        sl->top->prev = sl->top->next = sl->top->nextindex =
    +            sl->top->previndex = sl->top->up = NULL;
    +        sl->top->data = NULL;
    +#endif
    +        sl->top->sl = sl;
    +    }
    +    ch = sl->height;
    +    /* Find the node (or node after which we would insert) */
    +    /* Keep a stack to pop back through for insertion */
    +    /* malloc() is OK since we free the temp stack */
    +    m = sl->top;
    +    stack = (apr_skiplistnode **)malloc(sizeof(apr_skiplistnode *) * (nh));
    +    stacki = 0;
    +    while (m) {
    +        int compared = -1;
    +        if (m->next) {
    +            compared = comp(data, m->next->data);
    +        }
    +        if (compared == 0) {
    +            free(stack);    /* OK. was malloc'ed */
    +            return 0;
    +        }
    +        if ((m->next == NULL) || (compared < 0)) {
    +            if (ch <= nh) {
    +                /* push on stack */
    +                stack[stacki++] = m;
    +            }
    +            m = m->down;
    +            ch--;
    +        }
    +        else {
    +            m = m->next;
    +        }
    +    }
    +    /* Pop the stack and insert nodes */
    +    p = NULL;
    +    for (; stacki > 0; stacki--) {
    +        m = stack[stacki - 1];
    +        tmp = (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode));
    +        tmp->next = m->next;
    +        if (m->next) {
    +            m->next->prev = tmp;
    +        }
    +        tmp->prev = m;
    +        tmp->up = NULL;
    +        tmp->nextindex = tmp->previndex = NULL;
    +        tmp->down = p;
    +        if (p) {
    +            p->up = tmp;
    +        }
    +        tmp->data = data;
    +        tmp->sl = sl;
    +        m->next = tmp;
    +        /* This sets ret to the bottom-most node we are inserting */
    +        if (!p) {
    +            ret = tmp;
    +            sl->size++; /* this seems to go here got each element to be counted */
    +        }
    +        p = tmp;
    +    }
    +    free(stack); /* OK. was malloc'ed */
    +    if (sl->index != NULL) {
    +        /*
    +         * this is a external insertion, we must insert into each index as
    +         * well
    +         */
    +        apr_skiplistnode *ni, *li;
    +        li = ret;
    +        for (p = apr_skiplist_getlist(sl->index); p; apr_skiplist_next(sl->index, &p)) {
    +            ni = apr_skiplist_insert((apr_skiplist *) p->data, ret->data);
    +            li->nextindex = ni;
    +            ni->previndex = li;
    +            li = ni;
    +        }
    +    }
    +    else {
    +        /* sl->size++; */
    +    }
    +    sl->size++;
    +    return ret;
    +}
    +
    +APR_DECLARE(int) apr_skiplist_remove(apr_skiplist *sl, void *data, apr_skiplist_freefunc myfree)
    +{
    +    if (!sl->compare) {
    +        return 0;
    +    }
    +    return apr_skiplist_remove_compare(sl, data, myfree, sl->comparek);
    +}
    +
    +#if 0
    +void skiplist_print_struct(apr_skiplist * sl, char *prefix)
    +{
    +    apr_skiplistnode *p, *q;
    +    fprintf(stderr, "Skiplist Structure (height: %d)\n", sl->height);
    +    p = sl->bottom;
    +    while (p) {
    +        q = p;
    +        fprintf(stderr, prefix);
    +        while (q) {
    +            fprintf(stderr, "%p ", q->data);
    +            q = q->up;
    +        }
    +        fprintf(stderr, "\n");
    +        p = p->next;
    +    }
    +}
    +#endif
    +
    +static int skiplisti_remove(apr_skiplist *sl, apr_skiplistnode *m, apr_skiplist_freefunc myfree)
    +{
    +    apr_skiplistnode *p;
    +    if (!m) {
    +        return 0;
    +    }
    +    if (m->nextindex) {
    +        skiplisti_remove(m->nextindex->sl, m->nextindex, NULL);
    +    }
    +    while (m->up) {
    +        m = m->up;
    +    }
    +    while (m) {
    +        p = m;
    +        p->prev->next = p->next;/* take me out of the list */
    +        if (p->next) {
    +            p->next->prev = p->prev;    /* take me out of the list */
    +        }
    +        m = m->down;
    +        /* This only frees the actual data in the bottom one */
    +        if (!m && myfree && p->data) {
    +            myfree(p->data);
    +        }
    +        apr_skiplist_free(sl, p);
    +    }
    +    sl->size--;
    +    while (sl->top && sl->top->next == NULL) {
    +        /* While the row is empty and we are not on the bottom row */
    +        p = sl->top;
    +        sl->top = sl->top->down;/* Move top down one */
    +        if (sl->top) {
    +            sl->top->up = NULL; /* Make it think its the top */
    +        }
    +        apr_skiplist_free(sl, p);
    +        sl->height--;
    +    }
    +    if (!sl->top) {
    +        sl->bottom = NULL;
    +    }
    +    return sl->height;  /* return 1; ?? */
    +}
    +
    +APR_DECLARE(int) apr_skiplist_remove_compare(apr_skiplist *sli,
    +                            void *data,
    +                            apr_skiplist_freefunc myfree, apr_skiplist_compare comp)
    +{
    +    apr_skiplistnode *m;
    +    apr_skiplist *sl;
    +    if (comp == sli->comparek || !sli->index) {
    +        sl = sli;
    +    }
    +    else {
    +        apr_skiplist_find(sli->index, (void *)comp, &m);
    +        sl = (apr_skiplist *) m->data;
    +    }
    +    skiplisti_find_compare(sl, data, &m, comp);
    +    if (!m) {
    +        return 0;
    +    }
    +    while (m->previndex) {
    +        m = m->previndex;
    +    }
    +    return skiplisti_remove(sl, m, myfree);
    +}
    +
    +APR_DECLARE(void) apr_skiplist_remove_all(apr_skiplist *sl, apr_skiplist_freefunc myfree)
    +{
    +    /*
    +     * This must remove even the place holder nodes (bottom though top)
    +     * because we specify in the API that one can free the Skiplist after
    +     * making this call without memory leaks
    +     */
    +    apr_skiplistnode *m, *p, *u;
    +    m = sl->bottom;
    +    while (m) {
    +        p = m->next;
    +        if (p && myfree && p->data)
    +            myfree(p->data);
    +        while (m) {
    +            u = m->up;
    +            apr_skiplist_free(sl, p);
    +            m = u;
    +        }
    +        m = p;
    +    }
    +    sl->top = sl->bottom = NULL;
    +    sl->height = 0;
    +    sl->size = 0;
    +}
    +
    +APR_DECLARE(void *) apr_skiplist_pop(apr_skiplist *a, apr_skiplist_freefunc myfree)
    +{
    +    apr_skiplistnode *sln;
    +    void *data = NULL;
    +    sln = apr_skiplist_getlist(a);
    +    if (sln) {
    +        data = sln->data;
    +        skiplisti_remove(a, sln, myfree);
    +    }
    +    return data;
    +}
    +
    +APR_DECLARE(void *) apr_skiplist_peek(apr_skiplist *a)
    +{
    +    apr_skiplistnode *sln;
    +    sln = apr_skiplist_getlist(a);
    +    if (sln) {
    +        return sln->data;
    +    }
    +    return NULL;
    +}
    +
    +static void skiplisti_destroy(void *vsl)
    +{
    +    apr_skiplist_destroy((apr_skiplist *) vsl, NULL);
    +    apr_skiplist_free((apr_skiplist *) vsl, vsl);
    +}
    +
    +APR_DECLARE(void) apr_skiplist_destroy(apr_skiplist *sl, apr_skiplist_freefunc myfree)
    +{
    +    while (apr_skiplist_pop(sl->index, skiplisti_destroy) != NULL)
    +        ;
    +    apr_skiplist_remove_all(sl, myfree);
    +}
    +
    +APR_DECLARE(apr_skiplist *) apr_skiplist_merge(apr_skiplist *sl1, apr_skiplist *sl2)
    +{
    +    /* Check integrity! */
    +    apr_skiplist temp;
    +    struct apr_skiplistnode *b2;
    +    if (sl1->bottomend == NULL || sl1->bottomend->prev == NULL) {
    +        apr_skiplist_remove_all(sl1, NULL);
    +        temp = *sl1;
    +        *sl1 = *sl2;
    +        *sl2 = temp;
    +        /* swap them so that sl2 can be freed normally upon return. */
    +        return sl1;
    +    }
    +    if(sl2->bottom == NULL || sl2->bottom->next == NULL) {
    +        apr_skiplist_remove_all(sl2, NULL);
    +        return sl1;
    +    }
    +    /* This is what makes it brute force... Just insert :/ */
    +    b2 = apr_skiplist_getlist(sl2);
    +    while (b2) {
    +        apr_skiplist_insert(sl1, b2->data);
    +        apr_skiplist_next(sl2, &b2);
    +    }
    +    apr_skiplist_remove_all(sl2, NULL);
    +    return sl1;
    +}
    
    From 99728e322ea5c652e16051609c7233d7935d1726 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 2 Oct 2013 23:55:06 +0000
    Subject: [PATCH 7322/7878] add skiplist
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1528690 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CMakeLists.txt | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/CMakeLists.txt b/CMakeLists.txt
    index 3da0c48807f..9e6656fd8fb 100644
    --- a/CMakeLists.txt
    +++ b/CMakeLists.txt
    @@ -193,6 +193,7 @@ SET(APR_PUBLIC_HEADERS_STATIC
       include/apr_sha1.h
       include/apr_shm.h
       include/apr_signal.h
    +  include/apr_skiplist.h
       include/apr_strings.h
       include/apr_strmatch.h
       include/apr_tables.h
    @@ -314,6 +315,7 @@ SET(APR_SOURCES
       strings/apr_strtok.c
       strmatch/apr_strmatch.c
       tables/apr_hash.c
    +  tables/apr_skiplist.c
       tables/apr_tables.c
       threadproc/win32/proc.c
       threadproc/win32/signals.c
    
    From 7c141cd06f48f447b101c39afc16cef81916c03a Mon Sep 17 00:00:00 2001
    From: Rainer Jung 
    Date: Thu, 3 Oct 2013 10:40:02 +0000
    Subject: [PATCH 7323/7878] Whitespace. Sync with branches.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1528797 13f79535-47bb-0310-9956-ffa450edef68
    ---
     passwd/apr_getpass.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c
    index c12826ca2b3..6e4cbef3af8 100644
    --- a/passwd/apr_getpass.c
    +++ b/passwd/apr_getpass.c
    @@ -56,7 +56,7 @@
     #endif
     
     /* Disable getpass() support when PASS_MAX is defined and is "small",
    - * for an arbitrary definition of "small". 
    + * for an arbitrary definition of "small".
      * HP-UX truncates passwords (PR49496) so we disable getpass() for
      * this platform too.
      */
    
    From 48df0b454d056c4c7a61ab3ead832e81b44a1a6f Mon Sep 17 00:00:00 2001
    From: Rainer Jung 
    Date: Thu, 3 Oct 2013 11:31:44 +0000
    Subject: [PATCH 7324/7878] Update config.guess and config.sub from
     http://git.savannah.gnu.org/cgit/config.git.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1528809 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/config.guess | 144 +++++++++++++++++++++++++--------------------
     build/config.sub   |  17 ++++--
     2 files changed, 90 insertions(+), 71 deletions(-)
    
    diff --git a/build/config.guess b/build/config.guess
    index 2055429b1ab..b79252d6b10 100755
    --- a/build/config.guess
    +++ b/build/config.guess
    @@ -2,7 +2,7 @@
     # Attempt to guess a canonical system name.
     #   Copyright 1992-2013 Free Software Foundation, Inc.
     
    -timestamp='2013-04-24'
    +timestamp='2013-06-10'
     
     # This file is free software; you can redistribute it and/or modify it
     # under the terms of the GNU General Public License as published by
    @@ -132,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
     UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
     UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
     
    +case "${UNAME_SYSTEM}" in
    +Linux|GNU|GNU/*)
    +	# If the system lacks a compiler, then just pick glibc.
    +	# We could probably try harder.
    +	LIBC=gnu
    +
    +	eval $set_cc_for_build
    +	cat <<-EOF > $dummy.c
    +	#include 
    +	#if defined(__UCLIBC__)
    +	LIBC=uclibc
    +	#elif defined(__dietlibc__)
    +	LIBC=dietlibc
    +	#else
    +	LIBC=gnu
    +	#endif
    +	EOF
    +	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
    +	;;
    +esac
    +
     # Note: order is significant - the case branches are not exclusive.
     
     case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
    @@ -853,21 +874,21 @@ EOF
     	exit ;;
         *:GNU:*:*)
     	# the GNU system
    -	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
    +	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
     	exit ;;
         *:GNU/*:*:*)
     	# other systems with GNU libc and userland
    -	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
    +	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
     	exit ;;
         i*86:Minix:*:*)
     	echo ${UNAME_MACHINE}-pc-minix
     	exit ;;
         aarch64:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         aarch64_be:Linux:*:*)
     	UNAME_MACHINE=aarch64_be
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         alpha:Linux:*:*)
     	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
    @@ -880,67 +901,54 @@ EOF
     	  EV68*) UNAME_MACHINE=alphaev68 ;;
     	esac
     	objdump --private-headers /bin/sh | grep -q ld.so.1
    -	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
    +	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         arc:Linux:*:* | arceb:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         arm*:Linux:*:*)
     	eval $set_cc_for_build
     	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
     	    | grep -q __ARM_EABI__
     	then
    -	    echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	else
     	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
     		| grep -q __ARM_PCS_VFP
     	    then
    -		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
    +		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
     	    else
    -		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
    +		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
     	    fi
     	fi
     	exit ;;
         avr32*:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         cris:Linux:*:*)
    -	echo ${UNAME_MACHINE}-axis-linux-gnu
    +	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
     	exit ;;
         crisv32:Linux:*:*)
    -	echo ${UNAME_MACHINE}-axis-linux-gnu
    +	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
     	exit ;;
         frv:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         hexagon:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         i*86:Linux:*:*)
    -	LIBC=gnu
    -	eval $set_cc_for_build
    -	sed 's/^	//' << EOF >$dummy.c
    -	#ifdef __dietlibc__
    -	LIBC=dietlibc
    -	#endif
    -	#else
    -	#include 
    -	#ifdef __UCLIBC__
    -	LIBC=uclibc
    -	#endif
    -EOF
    -	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
    -	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
    +	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
     	exit ;;
         ia64:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         m32r*:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         m68*:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         mips:Linux:*:* | mips64:Linux:*:*)
     	eval $set_cc_for_build
    @@ -959,59 +967,63 @@ EOF
     	#endif
     EOF
     	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
    -	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
    +	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
     	;;
         or1k:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         or32:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         padre:Linux:*:*)
    -	echo sparc-unknown-linux-gnu
    +	echo sparc-unknown-linux-${LIBC}
     	exit ;;
         parisc64:Linux:*:* | hppa64:Linux:*:*)
    -	echo hppa64-unknown-linux-gnu
    +	echo hppa64-unknown-linux-${LIBC}
     	exit ;;
         parisc:Linux:*:* | hppa:Linux:*:*)
     	# Look for CPU level
     	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
    -	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
    -	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
    -	  *)    echo hppa-unknown-linux-gnu ;;
    +	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
    +	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
    +	  *)    echo hppa-unknown-linux-${LIBC} ;;
     	esac
     	exit ;;
         ppc64:Linux:*:*)
    -	echo powerpc64-unknown-linux-gnu
    +	echo powerpc64-unknown-linux-${LIBC}
     	exit ;;
         ppc:Linux:*:*)
    -	echo powerpc-unknown-linux-gnu
    +	echo powerpc-unknown-linux-${LIBC}
    +	exit ;;
    +    ppc64le:Linux:*:*)
    +	echo powerpc64le-unknown-linux-${LIBC}
    +	exit ;;
    +    ppcle:Linux:*:*)
    +	echo powerpcle-unknown-linux-${LIBC}
     	exit ;;
         s390:Linux:*:* | s390x:Linux:*:*)
    -	echo ${UNAME_MACHINE}-ibm-linux
    +	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
     	exit ;;
         sh64*:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         sh*:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         sparc:Linux:*:* | sparc64:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         tile*:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         vax:Linux:*:*)
    -	echo ${UNAME_MACHINE}-dec-linux-gnu
    +	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
     	exit ;;
         x86_64:Linux:*:*)
    -	LIBC=gnu
    -	test -r /lib/libc.so && od -An -S13 /lib/libc.so | grep -q __uClibc_main && LIBC=uclibc
     	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         xtensa*:Linux:*:*)
    -	echo ${UNAME_MACHINE}-unknown-linux-gnu
    +	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
     	exit ;;
         i*86:DYNIX/ptx:4*:*)
     	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
    @@ -1244,19 +1256,21 @@ EOF
     	exit ;;
         *:Darwin:*:*)
     	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
    -	case $UNAME_PROCESSOR in
    -	    i386)
    -		eval $set_cc_for_build
    -		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
    -		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
    -		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
    -		      grep IS_64BIT_ARCH >/dev/null
    -		  then
    -		      UNAME_PROCESSOR="x86_64"
    -		  fi
    -		fi ;;
    -	    unknown) UNAME_PROCESSOR=powerpc ;;
    -	esac
    +	eval $set_cc_for_build
    +	if test "$UNAME_PROCESSOR" = unknown ; then
    +	    UNAME_PROCESSOR=powerpc
    +	fi
    +	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
    +	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
    +		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
    +		grep IS_64BIT_ARCH >/dev/null
    +	    then
    +		case $UNAME_PROCESSOR in
    +		    i386) UNAME_PROCESSOR=x86_64 ;;
    +		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
    +		esac
    +	    fi
    +	fi
     	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
     	exit ;;
         *:procnto*:*:* | *:QNX:[0123456789]*:*)
    diff --git a/build/config.sub b/build/config.sub
    index 8b612ab89df..61cb4bc22db 100755
    --- a/build/config.sub
    +++ b/build/config.sub
    @@ -2,7 +2,7 @@
     # Configuration validation subroutine script.
     #   Copyright 1992-2013 Free Software Foundation, Inc.
     
    -timestamp='2013-04-24'
    +timestamp='2013-10-01'
     
     # This file is free software; you can redistribute it and/or modify it
     # under the terms of the GNU General Public License as published by
    @@ -257,7 +257,7 @@ case $basic_machine in
     	| avr | avr32 \
     	| be32 | be64 \
     	| bfin \
    -	| c4x | clipper \
    +	| c4x | c8051 | clipper \
     	| d10v | d30v | dlx | dsp16xx \
     	| epiphany \
     	| fido | fr30 | frv \
    @@ -265,6 +265,7 @@ case $basic_machine in
     	| hexagon \
     	| i370 | i860 | i960 | ia64 \
     	| ip2k | iq2000 \
    +	| k1om \
     	| le32 | le64 \
     	| lm32 \
     	| m32c | m32r | m32rle | m68000 | m68k | m88k \
    @@ -324,7 +325,7 @@ case $basic_machine in
     	c6x)
     		basic_machine=tic6x-unknown
     		;;
    -	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
    +	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
     		basic_machine=$basic_machine-unknown
     		os=-none
     		;;
    @@ -372,7 +373,7 @@ case $basic_machine in
     	| be32-* | be64-* \
     	| bfin-* | bs2000-* \
     	| c[123]* | c30-* | [cjt]90-* | c4x-* \
    -	| clipper-* | craynv-* | cydra-* \
    +	| c8051-* | clipper-* | craynv-* | cydra-* \
     	| d10v-* | d30v-* | dlx-* \
     	| elxsi-* \
     	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
    @@ -381,6 +382,7 @@ case $basic_machine in
     	| hexagon-* \
     	| i*86-* | i860-* | i960-* | ia64-* \
     	| ip2k-* | iq2000-* \
    +	| k1om-* \
     	| le32-* | le64-* \
     	| lm32-* \
     	| m32c-* | m32r-* | m32rle-* \
    @@ -794,7 +796,7 @@ case $basic_machine in
     		os=-mingw64
     		;;
     	mingw32)
    -		basic_machine=i386-pc
    +		basic_machine=i686-pc
     		os=-mingw32
     		;;
     	mingw32ce)
    @@ -830,7 +832,7 @@ case $basic_machine in
     		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
     		;;
     	msys)
    -		basic_machine=i386-pc
    +		basic_machine=i686-pc
     		os=-msys
     		;;
     	mvs)
    @@ -1546,6 +1548,9 @@ case $basic_machine in
     	c4x-* | tic4x-*)
     		os=-coff
     		;;
    +	c8051-*)
    +		os=-elf
    +		;;
     	hexagon-*)
     		os=-elf
     		;;
    
    From 52c46f17dd6bb99f1d3b39d4b57c3efbf2982f26 Mon Sep 17 00:00:00 2001
    From: Rainer Jung 
    Date: Thu, 3 Oct 2013 12:22:42 +0000
    Subject: [PATCH 7325/7878] Remove items backported to 1.5.x.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1528824 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 6 ------
     1 file changed, 6 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 3a653485174..9e9d2bd1238 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -15,9 +15,6 @@ Changes for APR 2.0.0
       *) Add support to apr_memcache for unix domain sockets. PR 54573 [Remi
          Gacogne ]
     
    -  *) Add the apr_table_getm() call, which transparently handles the
    -     merging of keys with multiple values. [Graham Leggett]
    -
       *) Mark apr_dbd_freetds as unsupported, and remove it from all builds
          [Nick Kew]
     
    @@ -32,9 +29,6 @@ Changes for APR 2.0.0
     
       *) apr_pollset_poll:  add z/OS async poll support for sockets [Greg Ames]
     
    -  *) apr_socket_opt_set: Add support for APR_SO_BROADCAST. PR 46389.
    -     [Armin Müller ]
    -
       *) apr_brigades: add a check to prevent infinite while loop in case
          of a corrupted brigade.  Problem evidenced in PR 51062.  Analysis by
          Krzysztof Kostałkowicz , patch [Nick Kew].
    
    From 33765b317559c806e069886c4756f906144de97c Mon Sep 17 00:00:00 2001
    From: Rainer Jung 
    Date: Thu, 3 Oct 2013 12:36:53 +0000
    Subject: [PATCH 7326/7878] Remove items backported to (not yet released apu
     1.5.3).
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1528828 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 6 ------
     1 file changed, 6 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 9e9d2bd1238..048e32aa6a8 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -7,14 +7,8 @@ Changes for APR 2.0.0
     
       *) Add support for Berkeley DB 6.0. [Rainer Jung]
     
    -  *) Add apr_pbase64_encode() and apr_pbase64_decode() to encode to/from
    -     the pool. [Graham Leggett]
    -
       *) Add the apr_escape interface. [Graham Leggett]
          
    -  *) Add support to apr_memcache for unix domain sockets. PR 54573 [Remi
    -     Gacogne ]
    -
       *) Mark apr_dbd_freetds as unsupported, and remove it from all builds
          [Nick Kew]
     
    
    From 0169a7133144348d498f229eb298e16f371dca15 Mon Sep 17 00:00:00 2001
    From: Rainer Jung 
    Date: Thu, 3 Oct 2013 13:54:34 +0000
    Subject: [PATCH 7327/7878] Tab to spaces, sync with 1.5.x.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1528867 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_hints.m4 | 12 ++++++------
     1 file changed, 6 insertions(+), 6 deletions(-)
    
    diff --git a/build/apr_hints.m4 b/build/apr_hints.m4
    index 85cc296bdae..d517390b4b1 100644
    --- a/build/apr_hints.m4
    +++ b/build/apr_hints.m4
    @@ -436,12 +436,12 @@ dnl	       # Not a problem in 10.20.  Otherwise, who knows?
         *mingw*)
             APR_ADDTO(INTERNAL_CPPFLAGS, -DBINPATH=$apr_builddir/test/.libs)
             APR_ADDTO(CPPFLAGS, [-DWIN32 -D__MSVCRT__])
    -	APR_ADDTO(LDFLAGS, [-Wl,--enable-auto-import,--subsystem,console])
    -	APR_SETIFNULL(have_unicode_fs, [1])
    -	APR_SETIFNULL(have_proc_invoked, [1])
    -	APR_SETIFNULL(apr_lock_method, [win32])
    -	APR_SETIFNULL(apr_process_lock_is_global, [yes])
    -	APR_SETIFNULL(apr_cv_use_lfs64, [yes])
    +        APR_ADDTO(LDFLAGS, [-Wl,--enable-auto-import,--subsystem,console])
    +        APR_SETIFNULL(have_unicode_fs, [1])
    +        APR_SETIFNULL(have_proc_invoked, [1])
    +        APR_SETIFNULL(apr_lock_method, [win32])
    +        APR_SETIFNULL(apr_process_lock_is_global, [yes])
    +        APR_SETIFNULL(apr_cv_use_lfs64, [yes])
             APR_SETIFNULL(apr_cv_osuuid, [yes])
             APR_SETIFNULL(apr_cv_tcp_nodelay_with_cork, [no])
             APR_SETIFNULL(apr_thread_func, [__stdcall])
    
    From 32cf4535169225991a857e4c51ec77ae4864ee27 Mon Sep 17 00:00:00 2001
    From: Rainer Jung 
    Date: Thu, 3 Oct 2013 14:48:47 +0000
    Subject: [PATCH 7328/7878] Wrong item removed in r1528828.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1528898 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/CHANGES b/CHANGES
    index 048e32aa6a8..23ccda0776c 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -5,7 +5,8 @@ Changes for APR 2.0.0
          blocking state before, disable that setting so that timeouts work.
          [Jeff Trawick]
     
    -  *) Add support for Berkeley DB 6.0. [Rainer Jung]
    +  *) Add apr_pbase64_encode() and apr_pbase64_decode() to encode to/from
    +     the pool. [Graham Leggett]
     
       *) Add the apr_escape interface. [Graham Leggett]
          
    
    From a600d7f1a171f918bc2f9046ccadafd5c1658cd5 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 5 Oct 2013 18:04:13 +0000
    Subject: [PATCH 7329/7878] style tweak
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1529488 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_tables.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr_tables.h b/include/apr_tables.h
    index 00c4d8d2c22..194af02f2f0 100644
    --- a/include/apr_tables.h
    +++ b/include/apr_tables.h
    @@ -277,7 +277,7 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key);
      * @return The value associated with the key, or NULL if the key does not exist.
      */
     APR_DECLARE(const char *) apr_table_getm(apr_pool_t *p, const apr_table_t *t,
    -        const char *key);
    +                                         const char *key);
     
     /**
      * Add a key/value pair to a table.  If another element already exists with the
    
    From 8bc00b202e73fb362b7da8d0526bc94c4044cdde Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 5 Oct 2013 18:44:55 +0000
    Subject: [PATCH 7330/7878] fix typo
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1529494 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/CHANGES b/CHANGES
    index 23ccda0776c..8f5c0621314 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -37,7 +37,7 @@ Changes for APR 2.0.0
          apr_socket_wait() and apr_file_pipe_wait(). [Brian Havard]
     
       *) Enable platform specific support for the opening of a file or
    -     pipe in non blocking module through the APR_FOPEN_NONBLOCK flag.
    +     pipe in non-blocking mode through the APR_FOPEN_NONBLOCK flag.
          [Graham Leggett]
     
       *) Support connecttimeout, readtimeout and writetimeout MySQL options
    
    From 1ea82dea7c7d6e3f676799c151b776ec1f9769b9 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 5 Oct 2013 18:50:54 +0000
    Subject: [PATCH 7331/7878] Include @EXEEXT@ in references to gen_test_char in
     autoconf-based build in order to fix the build on Windows.
    
    PR: 55628
    Submitted by: Carlo Bramini 
    Reviewed by: trawick
    
    (This issue is only in trunk, which is unreleased.)
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1529495 13f79535-47bb-0310-9956-ffa450edef68
    ---
     Makefile.in | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/Makefile.in b/Makefile.in
    index 87cdc5f84b7..b549c4b92c4 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -52,7 +52,7 @@ LT_VERSION = @LT_VERSION@
     @INCLUDE_OUTPUTS@
     
     CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \
    -	build/apr_rules.out tools/gen_test_char
    +	build/apr_rules.out tools/gen_test_char@EXEEXT@
     DISTCLEAN_TARGETS = config.cache config.log config.status \
     	include/apr.h include/arch/unix/apr_private.h \
     	libtool $(APR_CONFIG) build/apr_rules.mk apr.pc \
    @@ -161,8 +161,8 @@ OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS)
     tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char)
     	$(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)
     
    -include/private/apr_escape_test_char.h: tools/gen_test_char
    -	tools/gen_test_char > include/private/apr_escape_test_char.h
    +include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@
    +	tools/gen_test_char@EXEEXT@ > $@
     
     LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LT_LDFLAGS) \
     	    @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@
    
    From 27b54f292b2e5f444681c7a6cd8bc978fac3c7d2 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 5 Oct 2013 20:46:27 +0000
    Subject: [PATCH 7332/7878] Fix executable file extension on Windows
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1529515 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/Makefile.in | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/test/Makefile.in b/test/Makefile.in
    index 2cd43c932ea..0c5aadd5d15 100644
    --- a/test/Makefile.in
    +++ b/test/Makefile.in
    @@ -173,7 +173,7 @@ check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)
     	teststatus=0; \
     	progfailed=""; \
     	for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \
    -	        if test "$$prog" = 'dbd'; then \
    +	        if test "$$prog" = 'dbd@EXEEXT@'; then \
     			for driver in none @apu_dbd_tests@; do \
     				if test "$$driver" != 'none'; then \
     					@shlibpath_var@="`echo "../dbm/.libs:../dbd/.libs:$$@shlibpath_var@" | sed -e 's/::*$$//'`" \
    @@ -185,7 +185,7 @@ check: $(TESTALL_COMPONENTS) $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE)
     					fi; \
     				fi; \
     			done; \
    -		elif test "$$prog" = 'sendfile'; then \
    +		elif test "$$prog" = 'sendfile@EXEEXT@'; then \
     			for mode in blocking nonblocking timeout; do \
     				@shlibpath_var@="`echo "../dbm/.libs:../dbd/.libs:$$@shlibpath_var@" | sed -e 's/::*$$//'`" \
     				./$$prog client $$mode startserver 127.0.0.1; \
    
    From 7e58c427b66166c256f6b84d0794df3ebe4ae453 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 5 Oct 2013 21:21:10 +0000
    Subject: [PATCH 7333/7878] Don't include windows.h when building for Cygwin.
    
    PR: 55586
    Submitted by: Carlo Bramini 
    Reviewed by: trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1529521 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr.h.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr.h.in b/include/apr.h.in
    index 4d9823851d5..9cc7e31f0b9 100644
    --- a/include/apr.h.in
    +++ b/include/apr.h.in
    @@ -120,7 +120,7 @@
      * or the extern "C" namespace 
      */
     
    -#if APR_HAVE_WINDOWS_H
    +#if APR_HAVE_WINDOWS_H && defined(WIN32)
     /* If windows.h was already included, our preferences don't matter.
      * If not, include a restricted set of windows headers to our tastes.
      */
    
    From 6b087b7293e18b39032828c1b85a881db281f4df Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 5 Oct 2013 23:42:42 +0000
    Subject: [PATCH 7334/7878] APR DSOs have .dll extension on Cygwin too.
    
    PR: 55587
    Submitted by: Carlo Bramini 
    Reviewed by: trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1529554 13f79535-47bb-0310-9956-ffa450edef68
    ---
     crypto/apr_crypto.c | 2 +-
     dbd/apr_dbd.c       | 2 +-
     dbm/apr_dbm.c       | 2 +-
     3 files changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c
    index 49597f1fd81..2633c0406a2 100644
    --- a/crypto/apr_crypto.c
    +++ b/crypto/apr_crypto.c
    @@ -172,7 +172,7 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver(
     
     #if defined(NETWARE)
         apr_snprintf(modname, sizeof(modname), "crypto%s.nlm", name);
    -#elif defined(WIN32)
    +#elif defined(WIN32) || defined(__CYGWIN__)
         apr_snprintf(modname, sizeof(modname),
                 "apr_crypto_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll", name);
     #else
    diff --git a/dbd/apr_dbd.c b/dbd/apr_dbd.c
    index b7b871fd709..be7b61be8ce 100644
    --- a/dbd/apr_dbd.c
    +++ b/dbd/apr_dbd.c
    @@ -182,7 +182,7 @@ APR_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name,
     
     #if defined(NETWARE)
         apr_snprintf(modname, sizeof(modname), "dbd%s.nlm", name);
    -#elif defined(WIN32)
    +#elif defined(WIN32) || defined(__CYGWIN__)
         apr_snprintf(modname, sizeof(modname),
                      "apr_dbd_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll", name);
     #else
    diff --git a/dbm/apr_dbm.c b/dbm/apr_dbm.c
    index c4c296b1528..71ba113ec47 100644
    --- a/dbm/apr_dbm.c
    +++ b/dbm/apr_dbm.c
    @@ -164,7 +164,7 @@ static apr_status_t dbm_open_type(apr_dbm_type_t const* * vtable,
     
     #if defined(NETWARE)
         apr_snprintf(modname, sizeof(modname), "dbm%s.nlm", type);
    -#elif defined(WIN32)
    +#elif defined(WIN32) || defined (__CYGWIN__)
         apr_snprintf(modname, sizeof(modname),
                      "apr_dbm_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll", type);
     #else
    
    From 218775fed656996f3d43da52374b8f3c63567c09 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sun, 6 Oct 2013 18:55:49 +0000
    Subject: [PATCH 7335/7878] Cygwin: Don't define unused symbol "CYGWIN". 
     (__CYGWIN__ is used instead.)
    
    PR: 51016
    Submitted by: Carlo Bramini 
    Reviewed by: trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1529668 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_hints.m4 | 3 ---
     1 file changed, 3 deletions(-)
    
    diff --git a/build/apr_hints.m4 b/build/apr_hints.m4
    index d517390b4b1..3131957d688 100644
    --- a/build/apr_hints.m4
    +++ b/build/apr_hints.m4
    @@ -430,9 +430,6 @@ dnl	       # Not a problem in 10.20.  Otherwise, who knows?
             APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
             APR_SETIFNULL(apr_getservbyname_is_thread_safe, [yes])
             ;;
    -    *cygwin*)
    -	APR_ADDTO(CPPFLAGS, [-DCYGWIN])
    -	;;
         *mingw*)
             APR_ADDTO(INTERNAL_CPPFLAGS, -DBINPATH=$apr_builddir/test/.libs)
             APR_ADDTO(CPPFLAGS, [-DWIN32 -D__MSVCRT__])
    
    From 24b892e8447818a10314423d1b2079b65d2f3e1c Mon Sep 17 00:00:00 2001
    From: Graham Leggett 
    Date: Wed, 9 Oct 2013 20:33:15 +0000
    Subject: [PATCH 7336/7878] Remove non-portable escaping of the escape
     character in apr_escape_echo(). Ensure test case runs correctly on Windows
     and OS/2.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1530786 13f79535-47bb-0310-9956-ffa450edef68
    ---
     encoding/apr_escape.c |  6 ------
     include/apr_escape.h  |  5 ++---
     test/testescape.c     | 28 +++++++++++++++++++++++-----
     3 files changed, 25 insertions(+), 14 deletions(-)
    
    diff --git a/encoding/apr_escape.c b/encoding/apr_escape.c
    index 0516e276c4f..8bb403c140c 100644
    --- a/encoding/apr_escape.c
    +++ b/encoding/apr_escape.c
    @@ -862,11 +862,6 @@ APR_DECLARE(apr_status_t) apr_escape_echo(char *escaped, const char *str,
                             size++;
                             found = 1;
                             break;
    -                    case '\e':
    -                        *d++ = 'e';
    -                        size++;
    -                        found = 1;
    -                        break;
                         case '\f':
                             *d++ = 'f';
                             size++;
    @@ -931,7 +926,6 @@ APR_DECLARE(apr_status_t) apr_escape_echo(char *escaped, const char *str,
                         switch (c) {
                         case '\a':
                         case '\b':
    -                    case '\e':
                         case '\f':
                         case '\n':
                         case '\r':
    diff --git a/include/apr_escape.h b/include/apr_escape.h
    index 73dc6cce01b..63dd2794542 100644
    --- a/include/apr_escape.h
    +++ b/include/apr_escape.h
    @@ -275,9 +275,8 @@ APR_DECLARE(const char *) apr_punescape_entity(apr_pool_t *p, const char *str)
     /**
      * Escape control characters in a string, as performed by the shell's
      * 'echo' command. Characters are replaced as follows:
    - * \a alert (bell), \b backspace, \e an escape character, \f form feed,
    - * \n new line, \r carriage return, \t horizontal tab, \v vertical tab,
    - * \\ backslash.
    + * \a alert (bell), \b backspace, \f form feed, \n new line, \r carriage
    + * return, \t horizontal tab, \v vertical tab, \\ backslash.
      *
      * Any non ascii character will be encoded as '\xHH', where HH is the hex
      * code of the character.
    diff --git a/test/testescape.c b/test/testescape.c
    index bbe4ad8a55b..28e1f0988ad 100644
    --- a/test/testescape.c
    +++ b/test/testescape.c
    @@ -34,15 +34,33 @@ static void test_escape(abts_case *tc, void *data)
     
         apr_pool_create(&pool, NULL);
     
    +    src = "Hello World &;`'\"|*?~<>^()[]{}$\\";
    +    target = "Hello World \\&\\;\\`\\'\\\"\\|\\*\\?\\~\\<\\>\\^\\(\\)\\[\\]\\{\\}\\$\\\\";
    +    dest = apr_pescape_shell(pool, src);
    +    ABTS_ASSERT(tc,
    +                apr_psprintf(pool, "shell escaped (%s) does not match expected output (%s)",
    +                             dest, target),
    +                (strcmp(dest, target) == 0));
    +    apr_escape_shell(NULL, src, APR_ESCAPE_STRING, &len);
    +    ABTS_ASSERT(tc,
    +            apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1),
    +            (len == strlen(dest) + 1));
    +
    +#if !(defined(OS2) || defined(WIN32))
    +    /* Now try with newline, which is converted to a space on OS/2 and Windows.
    +     */
         src = "Hello World &;`'\"|*?~<>^()[]{}$\\\n";
         target = "Hello World \\&\\;\\`\\'\\\"\\|\\*\\?\\~\\<\\>\\^\\(\\)\\[\\]\\{\\}\\$\\\\\\\n";
         dest = apr_pescape_shell(pool, src);
    -    ABTS_ASSERT(tc, "shell escaped matches expected output",
    +    ABTS_ASSERT(tc,
    +                apr_psprintf(pool, "shell escaped (%s) does not match expected output (%s)",
    +                             dest, target),
                     (strcmp(dest, target) == 0));
         apr_escape_shell(NULL, src, APR_ESCAPE_STRING, &len);
         ABTS_ASSERT(tc,
                 apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1),
                 (len == strlen(dest) + 1));
    +#endif
     
         src = "Hello";
         dest = apr_punescape_url(pool, src, NULL, NULL, 0);
    @@ -196,8 +214,8 @@ static void test_escape(abts_case *tc, void *data)
         dest = apr_pescape_echo(pool, src, 0);
         ABTS_PTR_EQUAL(tc, src, dest);
     
    -    src = "\a\b\e\f\\n\r\t\v\"Hello World\"";
    -    target = "\\a\\b\\e\\f\\\\n\\r\\t\\v\"Hello World\"";
    +    src = "\a\b\f\\n\r\t\v\"Hello World\"";
    +    target = "\\a\\b\\f\\\\n\\r\\t\\v\"Hello World\"";
         dest = apr_pescape_echo(pool, src, 0);
         ABTS_STR_EQUAL(tc, target, dest);
         apr_escape_echo(NULL, src, APR_ESCAPE_STRING, 0, &len);
    @@ -205,8 +223,8 @@ static void test_escape(abts_case *tc, void *data)
                 apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1),
                 (len == strlen(dest) + 1));
     
    -    src = "\a\b\e\f\\n\r\t\v\"Hello World\"";
    -    target = "\\a\\b\\e\\f\\\\n\\r\\t\\v\\\"Hello World\\\"";
    +    src = "\a\b\f\\n\r\t\v\"Hello World\"";
    +    target = "\\a\\b\\f\\\\n\\r\\t\\v\\\"Hello World\\\"";
         dest = apr_pescape_echo(pool, src, 1);
         ABTS_STR_EQUAL(tc, target, dest);
         apr_escape_echo(NULL, src, APR_ESCAPE_STRING, 1, &len);
    
    From ea8a81228e278e17f4cdc6372165a0db369ff5fb Mon Sep 17 00:00:00 2001
    From: Graham Leggett 
    Date: Wed, 9 Oct 2013 21:27:50 +0000
    Subject: [PATCH 7337/7878] Remove reference to the escape character.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1530800 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_escape.h | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/include/apr_escape.h b/include/apr_escape.h
    index 63dd2794542..08de7dcf1c0 100644
    --- a/include/apr_escape.h
    +++ b/include/apr_escape.h
    @@ -297,9 +297,9 @@ APR_DECLARE(apr_status_t) apr_escape_echo(char *escaped, const char *str,
     /**
      * Escape control characters in a string, as performed by the shell's
      * 'echo' command, and return the results from a pool. Characters are
    - * replaced as follows: \a alert (bell), \b backspace, \e an escape
    - * character, \f form feed, \n new line, \r carriage return, \t
    - * horizontal tab, \v vertical tab, \\ backslash.
    + * replaced as follows: \a alert (bell), \b backspace, \f form feed,
    + * \n new line, \r carriage return, \t horizontal tab, \v vertical tab,
    + * \\ backslash.
      *
      * Any non ascii character will be encoded as '\xHH', where HH is the hex
      * code of the character.
    
    From 7b23306b0fb466ba7374159c62dbb32ab575181c Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 10 Oct 2013 14:20:38 +0000
    Subject: [PATCH 7338/7878] Axe some redundancy with specification of generated
     apr.h as a dependency of the various binaries.
    
    Pointed out by: Mike Rumph
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1530988 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CMakeLists.txt | 10 ++++------
     1 file changed, 4 insertions(+), 6 deletions(-)
    
    diff --git a/CMakeLists.txt b/CMakeLists.txt
    index 9e6656fd8fb..272b7f2d8f8 100644
    --- a/CMakeLists.txt
    +++ b/CMakeLists.txt
    @@ -146,8 +146,6 @@ SET(APR_SYSTEM_LIBS
     
     INCLUDE_DIRECTORIES(${APR_INCLUDE_DIRECTORIES} ${XMLLIB_INCLUDE_DIR})
     
    -SET(APR_HEADERS ${PROJECT_BINARY_DIR}/apr.h)
    -
     SET(APR_PUBLIC_HEADERS_STATIC
       include/apr_allocator.h
       include/apr_anylock.h
    @@ -415,14 +413,14 @@ SET(install_lib_pdb)
     SET(dbd_drivers)
     
     # libapr-2 is shared, apr-2 is static
    -ADD_LIBRARY(libapr-2 SHARED ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/apr.h libapr.rc)
    +ADD_LIBRARY(libapr-2 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libapr.rc)
     SET(install_targets ${install_targets} libapr-2)
     SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libapr-2.pdb)
     TARGET_LINK_LIBRARIES(libapr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS})
     SET_TARGET_PROPERTIES(libapr-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_EXPORT;APR_HAVE_MODULAR_DSO")
     ADD_DEPENDENCIES(libapr-2 test_char_header)
     
    -ADD_LIBRARY(apr-2 STATIC ${APR_HEADERS} ${APR_SOURCES} ${PROJECT_BINARY_DIR}/apr.h)
    +ADD_LIBRARY(apr-2 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED})
     SET(install_targets ${install_targets} apr-2)
     SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/apr-2.pdb)
     TARGET_LINK_LIBRARIES(apr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS})
    @@ -430,12 +428,12 @@ SET_TARGET_PROPERTIES(apr-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;A
     ADD_DEPENDENCIES(apr-2 test_char_header)
     
     # libaprapp-2 and aprapp-2 are static
    -ADD_LIBRARY(libaprapp-2 STATIC ${APR_HEADERS} ${PROJECT_BINARY_DIR}/apr.h misc/win32/apr_app.c misc/win32/internal.c)
    +ADD_LIBRARY(libaprapp-2 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED})
     SET(install_targets ${install_targets} libaprapp-2)
     SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/libaprapp-2.pdb)
     SET_TARGET_PROPERTIES(libaprapp-2 PROPERTIES COMPILE_DEFINITIONS APR_APP)
     
    -ADD_LIBRARY(aprapp-2 STATIC ${APR_HEADERS} ${PROJECT_BINARY_DIR}/apr.h misc/win32/apr_app.c misc/win32/internal.c)
    +ADD_LIBRARY(aprapp-2 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED})
     SET(install_targets ${install_targets} aprapp-2)
     SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/aprapp-2.pdb)
     SET_TARGET_PROPERTIES(aprapp-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_APP")
    
    From 56837eb00a4abd791821b39661ac9545c5183f99 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 10 Oct 2013 14:56:18 +0000
    Subject: [PATCH 7339/7878] doc improvements for brigade insertion macros
    
    PR: 55115
    Submitted by: Mike Rumph 
    Reviewed by: trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1531009 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_buckets.h | 16 ++++++++--------
     1 file changed, 8 insertions(+), 8 deletions(-)
    
    diff --git a/include/apr_buckets.h b/include/apr_buckets.h
    index 179ccd9af03..2db56c6c288 100644
    --- a/include/apr_buckets.h
    +++ b/include/apr_buckets.h
    @@ -354,9 +354,9 @@ typedef apr_status_t (*apr_brigade_flush)(apr_bucket_brigade *bb, void *ctx);
     #define APR_BRIGADE_LAST(b)	APR_RING_LAST(&(b)->list)
     
     /**
    - * Insert a list of buckets at the front of a brigade
    + * Insert a single bucket at the front of a brigade
      * @param b The brigade to add to
    - * @param e The first bucket in a list of buckets to insert
    + * @param e The bucket to insert
      */
     #define APR_BRIGADE_INSERT_HEAD(b, e) do {				\
     	apr_bucket *ap__b = (e);                                        \
    @@ -365,9 +365,9 @@ typedef apr_status_t (*apr_brigade_flush)(apr_bucket_brigade *bb, void *ctx);
         } while (0)
     
     /**
    - * Insert a list of buckets at the end of a brigade
    + * Insert a single bucket at the end of a brigade
      * @param b The brigade to add to
    - * @param e The first bucket in a list of buckets to insert
    + * @param e The bucket to insert
      */
     #define APR_BRIGADE_INSERT_TAIL(b, e) do {				\
     	apr_bucket *ap__b = (e);					\
    @@ -396,9 +396,9 @@ typedef apr_status_t (*apr_brigade_flush)(apr_bucket_brigade *bb, void *ctx);
         } while (0)
     
     /**
    - * Insert a list of buckets before a specified bucket
    + * Insert a single bucket before a specified bucket
      * @param a The bucket to insert before
    - * @param b The buckets to insert
    + * @param b The bucket to insert
      */
     #define APR_BUCKET_INSERT_BEFORE(a, b) do {				\
     	apr_bucket *ap__a = (a), *ap__b = (b);				\
    @@ -407,9 +407,9 @@ typedef apr_status_t (*apr_brigade_flush)(apr_bucket_brigade *bb, void *ctx);
         } while (0)
     
     /**
    - * Insert a list of buckets after a specified bucket
    + * Insert a single bucket after a specified bucket
      * @param a The bucket to insert after
    - * @param b The buckets to insert
    + * @param b The bucket to insert
      */
     #define APR_BUCKET_INSERT_AFTER(a, b) do {				\
     	apr_bucket *ap__a = (a), *ap__b = (b);				\
    
    From a0ad0b541a764e0d23539bc88102bca386935075 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 10 Oct 2013 20:13:51 +0000
    Subject: [PATCH 7340/7878] remove items that are in apr 1.5.x
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1531098 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 6 ------
     1 file changed, 6 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 8f5c0621314..49824280a9b 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,15 +1,9 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 2.0.0
     
    -  *) apr_socket_timeout_set() on Windows: If the socket was in a non-
    -     blocking state before, disable that setting so that timeouts work.
    -     [Jeff Trawick]
    -
       *) Add apr_pbase64_encode() and apr_pbase64_decode() to encode to/from
          the pool. [Graham Leggett]
     
    -  *) Add the apr_escape interface. [Graham Leggett]
    -     
       *) Mark apr_dbd_freetds as unsupported, and remove it from all builds
          [Nick Kew]
     
    
    From aea10daf217123eea4e406b85e0978c1021c79dc Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 12 Oct 2013 13:50:54 +0000
    Subject: [PATCH 7341/7878] fix spelling error
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1531533 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_shm.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr_shm.h b/include/apr_shm.h
    index f47492ff47a..cf4d6ea261e 100644
    --- a/include/apr_shm.h
    +++ b/include/apr_shm.h
    @@ -44,7 +44,7 @@ extern "C" {
     typedef struct apr_shm_t apr_shm_t;
     
     /**
    - * Create and make accessable a shared memory segment.
    + * Create and make accessible a shared memory segment.
      * @param m The shared memory structure to create.
      * @param reqsize The desired size of the segment.
      * @param filename The file to use for shared memory on platforms that
    
    From cdf031d2881c27fd25a7dce40312a96ffc7f8bfa Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 12 Oct 2013 16:06:15 +0000
    Subject: [PATCH 7342/7878] don't spend 10 minutes in testlockperf during make
     test/check on Windows
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1531554 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CMakeLists.txt      |  4 +++-
     test/testlockperf.c | 20 ++++++++++++--------
     2 files changed, 15 insertions(+), 9 deletions(-)
    
    diff --git a/CMakeLists.txt b/CMakeLists.txt
    index 272b7f2d8f8..4808a4c9bce 100644
    --- a/CMakeLists.txt
    +++ b/CMakeLists.txt
    @@ -547,7 +547,6 @@ IF(APR_BUILD_TESTAPR)
     
       # Add tests for programs that run by themselves with no arguments.
       SET(simple_tests
    -    testlockperf
         testmutexscope
         testucs
       )
    @@ -556,6 +555,9 @@ IF(APR_BUILD_TESTAPR)
         ADD_TEST(NAME ${simple} COMMAND ${simple})
       ENDFOREACH()
     
    +  # testlockperf takes forever on Windows with default counter limit
    +  ADD_TEST(NAME testlockperf COMMAND testlockperf -c 50000)
    +
       # dbd and sendfile are run multiple times with different parameters.
       FOREACH(somedbd ${dbd_drivers})
         ADD_TEST(NAME dbd-${somedbd} COMMAND dbd ${somedbd})
    diff --git a/test/testlockperf.c b/test/testlockperf.c
    index 84c0ba99130..6cca99d16bd 100644
    --- a/test/testlockperf.c
    +++ b/test/testlockperf.c
    @@ -35,11 +35,12 @@ int main(void)
     }
     #else /* !APR_HAS_THREADS */
     
    -#define MAX_COUNTER 1000000
    +#define DEFAULT_MAX_COUNTER 1000000
     #define MAX_THREADS 6
     
     static int verbose = 0;
     static long mutex_counter;
    +static long max_counter = DEFAULT_MAX_COUNTER;
     
     static apr_thread_mutex_t *thread_lock;
     void * APR_THREAD_FUNC thread_mutex_func(apr_thread_t *thd, void *data);
    @@ -58,7 +59,7 @@ void * APR_THREAD_FUNC thread_mutex_func(apr_thread_t *thd, void *data)
     {
         int i;
     
    -    for (i = 0; i < MAX_COUNTER; i++) {
    +    for (i = 0; i < max_counter; i++) {
             apr_thread_mutex_lock(thread_lock);
             mutex_counter++;
             apr_thread_mutex_unlock(thread_lock);
    @@ -70,7 +71,7 @@ void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data)
     {
         int i;
     
    -    for (i = 0; i < MAX_COUNTER; i++) {
    +    for (i = 0; i < max_counter; i++) {
             apr_thread_rwlock_wrlock(thread_rwlock);
             mutex_counter++;
             apr_thread_rwlock_unlock(thread_rwlock);
    @@ -120,7 +121,7 @@ int test_thread_mutex(int num_threads)
         time_stop = apr_time_now();
         printf("microseconds: %" APR_INT64_T_FMT " usec\n",
                (time_stop - time_start));
    -    if (mutex_counter != MAX_COUNTER * num_threads)
    +    if (mutex_counter != max_counter * num_threads)
             printf("error: counter = %ld\n", mutex_counter);
     
         return APR_SUCCESS;
    @@ -168,7 +169,7 @@ int test_thread_mutex_nested(int num_threads)
         time_stop = apr_time_now();
         printf("microseconds: %" APR_INT64_T_FMT " usec\n",
                (time_stop - time_start));
    -    if (mutex_counter != MAX_COUNTER * num_threads)
    +    if (mutex_counter != max_counter * num_threads)
             printf("error: counter = %ld\n", mutex_counter);
     
         return APR_SUCCESS;
    @@ -216,7 +217,7 @@ int test_thread_rwlock(int num_threads)
         time_stop = apr_time_now();
         printf("microseconds: %" APR_INT64_T_FMT " usec\n",
                (time_stop - time_start));
    -    if (mutex_counter != MAX_COUNTER * num_threads)
    +    if (mutex_counter != max_counter * num_threads)
             printf("error: counter = %ld\n", mutex_counter);
     
         return APR_SUCCESS;
    @@ -244,8 +245,11 @@ int main(int argc, const char * const *argv)
             exit(-1);
         }
             
    -    while ((rv = apr_getopt(opt, "v", &optchar, &optarg)) == APR_SUCCESS) {
    -        if (optchar == 'v') {
    +    while ((rv = apr_getopt(opt, "c:v", &optchar, &optarg)) == APR_SUCCESS) {
    +        if (optchar == 'c') {
    +            max_counter = atol(optarg);
    +        }
    +        else if (optchar == 'v') {
                 verbose = 1;
             }
         }
    
    From 3681ad57a87435cc660418aa398a2b62e4867bac Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sun, 13 Oct 2013 22:56:51 +0000
    Subject: [PATCH 7343/7878] Windows:  Create named shared memory segments under
     the "Local" namespace if the caller is unprivileged, fixing an inability of
     unprivileged callers to use apr_shm_create() with named shared memory
     segments under recent Windows.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1531768 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES           |   5 ++
     shmem/win32/shm.c | 114 ++++++++++++++++++++++++++++++++++++++++------
     2 files changed, 104 insertions(+), 15 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 49824280a9b..ffe6cce1a98 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,6 +1,11 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 2.0.0
     
    +  *) Windows:  Create named shared memory segments under the "Local"
    +     namespace if the caller is unprivileged, fixing an inability of
    +     unprivileged callers to use apr_shm_create() with named shared
    +     memory segments under recent Windows.  [Jeff Trawick]
    +
       *) Add apr_pbase64_encode() and apr_pbase64_decode() to encode to/from
          the pool. [Graham Leggett]
     
    diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c
    index 117e4c81f45..930a25c74ee 100644
    --- a/shmem/win32/shm.c
    +++ b/shmem/win32/shm.c
    @@ -56,6 +56,64 @@ static apr_status_t shm_cleanup(void* shm)
         return rv;
     }
     
    +/* See if the caller is able to create a map in the global namespace by
    + * checking if the SE_CREATE_GLOBAL_NAME privilege is enabled.
    + *
    + * Prior to APR 1.5.0, named shared memory segments were always created
    + * in the global segment.  However, with recent versions of Windows this
    + * fails for unprivileged processes.  Thus, with older APR, named shared
    + * memory segments can't be created by unprivileged processes on newer
    + * Windows.
    + *
    + * By checking if the caller has the privilege, shm APIs can decide
    + * whether to use the Global or Local namespace.
    + *
    + * If running on an SDK without the required API definitions *OR*
    + * some processing failure occurs trying to check the privilege, fall
    + * back to earlier behavior -- always try to use the Global namespace.
    + */
    +#ifdef SE_CREATE_GLOBAL_NAME
    +static int can_create_global_maps(void)
    +{
    +    BOOL ok, has_priv;
    +    LUID priv_id;
    +    PRIVILEGE_SET privs;
    +    HANDLE hToken;
    +
    +    ok = OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE, &hToken);
    +    if (!ok && GetLastError() == ERROR_NO_TOKEN) {
    +        /* no thread-specific access token, so try to get process access token
    +         */
    +        ok = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken);
    +    }
    +
    +    if (ok) {
    +        ok = LookupPrivilegeValue(NULL, SE_CREATE_GLOBAL_NAME, &priv_id);
    +    }
    +
    +    if (ok) {
    +        privs.PrivilegeCount = 1;
    +        privs.Control = PRIVILEGE_SET_ALL_NECESSARY;
    +        privs.Privilege[0].Luid = priv_id;
    +        privs.Privilege[0].Attributes = SE_PRIVILEGE_ENABLED;
    +        ok = PrivilegeCheck(hToken, &privs, &has_priv);
    +    }
    +
    +    if (ok && !has_priv) {
    +        return 0;
    +    }
    +    else {
    +        return 1;
    +    }
    +}
    +#else /* SE_CREATE_GLOBAL_NAME */
    +/* SDK definitions missing */
    +static int can_create_global_maps(void)
    +{
    +    return 1;
    +}
    +#endif /* SE_CREATE_GLOBAL_NAME */
    +
     APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
                                              apr_size_t reqsize,
                                              const char *file,
    @@ -112,9 +170,9 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
     
             /* res_name_from_filename turns file into a pseudo-name
              * without slashes or backslashes, and prepends the \global
    -         * prefix on Win2K and later
    +         * or \local prefix on Win2K and later
              */
    -        mapkey = res_name_from_filename(file, 1, pool);
    +        mapkey = res_name_from_filename(file, can_create_global_maps(), pool);
         }
     
     #if APR_HAS_UNICODE_FS
    @@ -183,24 +241,20 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename,
         return apr_file_remove(filename, pool);
     }
     
    -APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
    -                                         const char *file,
    -                                         apr_pool_t *pool)
    +static apr_status_t shm_attach_internal(apr_shm_t **m,
    +                                        const char *file,
    +                                        apr_pool_t *pool,
    +                                        int global)
     {
         HANDLE hMap;
         void *mapkey;
         void *base;
     
    -    if (!file) {
    -        return APR_EINVAL;
    -    }
    -    else {
    -        /* res_name_from_filename turns file into a pseudo-name
    -         * without slashes or backslashes, and prepends the \global
    -         * prefix on Win2K and later
    -         */
    -        mapkey = res_name_from_filename(file, 1, pool);
    -    }
    +    /* res_name_from_filename turns file into a pseudo-name
    +     * without slashes or backslashes, and prepends the \global
    +     * or local prefix on Win2K and later
    +     */
    +    mapkey = res_name_from_filename(file, global, pool);
     
     #if APR_HAS_UNICODE_FS
         IF_WIN_OS_IS_UNICODE
    @@ -264,6 +318,36 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
         return APR_SUCCESS;
     }
     
    +APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
    +                                         const char *file,
    +                                         apr_pool_t *pool)
    +{
    +    apr_status_t rv;
    +    int can_create_global = can_create_global_maps();
    +    int try_global_local[3] = {1, /* first try to find shm under global namespace */
    +                               0, /* next try to find it under local namespace */
    +                               -1}; /* nothing more to try */
    +    int cur;
    +
    +    if (!file) {
    +        return APR_EINVAL;
    +    }
    +
    +    if (!can_create_global) { /* unprivileged process */
    +        try_global_local[0] = 0; /* search local before global */
    +        try_global_local[1] = 1;
    +    }
    +
    +    for (cur = 0; try_global_local[cur] != -1; cur++) {
    +        rv = shm_attach_internal(m, file, pool, try_global_local[cur]);
    +        if (!APR_STATUS_IS_ENOENT(rv)) {
    +            break;
    +        }
    +    }
    +
    +    return rv;
    +}
    +
     APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m)
     {
         apr_status_t rv = shm_cleanup(m);
    
    From 447bc00e7c40248377f479e9a115b85e08c86c1c Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 14 Oct 2013 13:14:21 +0000
    Subject: [PATCH 7344/7878] Close socket and get a new one before retrying
     apr_socket_connect(), resolving an intermittent EINVAL failure from connect()
     on FreeBSD.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1531884 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/sendfile.c | 8 ++++++--
     1 file changed, 6 insertions(+), 2 deletions(-)
    
    diff --git a/test/sendfile.c b/test/sendfile.c
    index 61550e8574e..f92b305f03e 100644
    --- a/test/sendfile.c
    +++ b/test/sendfile.c
    @@ -208,8 +208,6 @@ static int client(apr_pool_t *p, client_socket_mode_t socket_mode,
             connect_tries = 5; /* give it a chance to start up */
         }
     
    -    family = APR_INET;
    -    apr_setup(p, &sock, &family);
         create_testfile(p, TESTFILE);
     
         rv = apr_file_open(&f, TESTFILE, APR_FOPEN_READ, 0, p);
    @@ -220,14 +218,20 @@ static int client(apr_pool_t *p, client_socket_mode_t socket_mode,
         if (!host) {
             host = "127.0.0.1";
         }
    +    family = APR_INET;
         rv = apr_sockaddr_info_get(&destsa, host, family, TESTSF_PORT, 0, p);
         if (rv != APR_SUCCESS) {
             aprerr("apr_sockaddr_info_get()", rv);
         }
     
         while (connect_tries--) {
    +        apr_setup(p, &sock, &family);
             rv = apr_socket_connect(sock, destsa);
             if (connect_tries && APR_STATUS_IS_ECONNREFUSED(rv)) {
    +            apr_status_t tmprv = apr_socket_close(sock);
    +            if (tmprv != APR_SUCCESS) {
    +                aprerr("apr_socket_close()", tmprv);
    +            }
                 apr_sleep(connect_retry_interval);
                 connect_retry_interval *= 2;
             }
    
    From b9fdf014b143145837195adbe85d344a25b6e8db Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 14 Oct 2013 18:58:19 +0000
    Subject: [PATCH 7345/7878] Update support for MINT OS.
    
    PR: 47181
    Submitted by: Alan Hourihane 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1532022 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_hints.m4 | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/build/apr_hints.m4 b/build/apr_hints.m4
    index 3131957d688..7453b987d2a 100644
    --- a/build/apr_hints.m4
    +++ b/build/apr_hints.m4
    @@ -44,8 +44,7 @@ if test "x$apr_preload_done" != "xyes" ; then
     
       case "$host" in
         *mint)
    -	APR_ADDTO(CPPFLAGS, [-DMINT])
    -	APR_ADDTO(LIBS, [-lportlib])
    +	APR_ADDTO(CPPFLAGS, [-DMINT -D_GNU_SOURCE])
     	;;
         *MPE/iX*)
     	APR_ADDTO(CPPFLAGS, [-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE])
    
    From 7b208ee20cec9cee52007b9fd437ab3b75a59dc6 Mon Sep 17 00:00:00 2001
    From: Jim Jagielski 
    Date: Thu, 17 Oct 2013 15:09:43 +0000
    Subject: [PATCH 7346/7878] it should really handle src==NULL
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1533104 13f79535-47bb-0310-9956-ffa450edef68
    ---
     strings/apr_cpystrn.c | 15 +++++++++------
     1 file changed, 9 insertions(+), 6 deletions(-)
    
    diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c
    index 6311c29f3bf..d6c98f7e982 100644
    --- a/strings/apr_cpystrn.c
    +++ b/strings/apr_cpystrn.c
    @@ -38,6 +38,7 @@
      *   (3) Instead of returning the pointer to the beginning of
      *       the destination string, we return a pointer to the
      *       terminating '\0' to allow us to "check" for truncation
    + *   (4) If src is NULL, null terminate dst (empty string copy)
      *
      * apr_cpystrn() follows the same call structure as strncpy().
      */
    @@ -51,13 +52,15 @@ APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, apr_size_t dst_size)
             return (dst);
         }
     
    -    d = dst;
    -    end = dst + dst_size - 1;
    +    if (src) {
    +        d = dst;
    +        end = dst + dst_size - 1;
     
    -    for (; d < end; ++d, ++src) {
    -	if (!(*d = *src)) {
    -	    return (d);
    -	}
    +        for (; d < end; ++d, ++src) {
    +            if (!(*d = *src)) {
    +                return (d);
    +            }
    +        }
         }
     
         *d = '\0';	/* always null terminate */
    
    From 9963e8f5341f1816fedd9d5ac21642e295d24653 Mon Sep 17 00:00:00 2001
    From: Jim Jagielski 
    Date: Thu, 17 Oct 2013 15:22:47 +0000
    Subject: [PATCH 7347/7878] make sure d is inited
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1533111 13f79535-47bb-0310-9956-ffa450edef68
    ---
     strings/apr_cpystrn.c | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c
    index d6c98f7e982..d222d081429 100644
    --- a/strings/apr_cpystrn.c
    +++ b/strings/apr_cpystrn.c
    @@ -46,14 +46,13 @@
     APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, apr_size_t dst_size)
     {
     
    -    char *d, *end;
    +    char *d = dst, *end;
     
         if (dst_size == 0) {
             return (dst);
         }
     
         if (src) {
    -        d = dst;
             end = dst + dst_size - 1;
     
             for (; d < end; ++d, ++src) {
    
    From a426c16b7dbdb855245807c19b7d60922d1c2a60 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sun, 20 Oct 2013 20:43:26 +0000
    Subject: [PATCH 7348/7878] axe old messages about lack of support for libtool
     2.x
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1533975 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/buildcheck.sh | 2 --
     1 file changed, 2 deletions(-)
    
    diff --git a/build/buildcheck.sh b/build/buildcheck.sh
    index 69e38033f4e..532602e911b 100755
    --- a/build/buildcheck.sh
    +++ b/build/buildcheck.sh
    @@ -44,7 +44,6 @@ if test -z "$lt_pversion"; then
     echo "buildconf: libtool not found."
     echo "           You need libtool version 1.4 or newer installed"
     echo "           to build APR from SVN."
    -echo "           (libtool 2.x not supported yet)"
     exit 1
     fi
     lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
    @@ -63,6 +62,5 @@ fi
     echo "buildconf: libtool version $lt_pversion found."
     echo "           You need libtool version 1.4 or newer installed"
     echo "           to build APR from SVN."
    -echo "           (libtool 2.x not supported yet)"
     
     exit 1
    
    From 59e18ad776f78da4363cce693b31d5e8ea571d4a Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sun, 20 Oct 2013 20:50:11 +0000
    Subject: [PATCH 7349/7878] Follow-up to r1531768:
    
    Add apr_shm_create_ex() and apr_shm_attach_ex(), which
    provide the ability to select the Global or Local
    namespace on Windows.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1533979 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES           |  6 ++++-
     include/apr_shm.h | 64 ++++++++++++++++++++++++++++++++++++++++++-
     shmem/beos/shm.c  | 17 ++++++++++++
     shmem/os2/shm.c   | 17 ++++++++++++
     shmem/unix/shm.c  | 17 ++++++++++++
     shmem/win32/shm.c | 69 ++++++++++++++++++++++++++++++++++++-----------
     6 files changed, 173 insertions(+), 17 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index ffe6cce1a98..45637ab2e18 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -4,7 +4,11 @@ Changes for APR 2.0.0
       *) Windows:  Create named shared memory segments under the "Local"
          namespace if the caller is unprivileged, fixing an inability of
          unprivileged callers to use apr_shm_create() with named shared
    -     memory segments under recent Windows.  [Jeff Trawick]
    +     memory segments under recent Windows.  As before, shared memory
    +     segments are created under the "Global" namespace for privileged
    +     callers.  Add apr_shm_create_ex() and apr_shm_attach_ex(), which
    +     provide the ability to override the normal namespace selection.
    +     [Jeff Trawick]
     
       *) Add apr_pbase64_encode() and apr_pbase64_decode() to encode to/from
          the pool. [Graham Leggett]
    diff --git a/include/apr_shm.h b/include/apr_shm.h
    index cf4d6ea261e..2ed86e219e8 100644
    --- a/include/apr_shm.h
    +++ b/include/apr_shm.h
    @@ -44,7 +44,8 @@ extern "C" {
     typedef struct apr_shm_t apr_shm_t;
     
     /**
    - * Create and make accessible a shared memory segment.
    + * Create and make accessible a shared memory segment with default
    + * properties.
      * @param m The shared memory structure to create.
      * @param reqsize The desired size of the segment.
      * @param filename The file to use for shared memory on platforms that
    @@ -71,6 +72,52 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
                                              const char *filename,
                                              apr_pool_t *pool);
     
    +/**
    + * Special processing flags for apr_shm_create_ex() and apr_shm_attach_ex().
    + */
    +#define APR_SHM_NS_LOCAL    1 /* Create or attach to named shared memory
    +                               * segment in the "Local" namespace on
    +                               * Windows.  (Ignored on other platforms.)
    +                               * By default, the "Global" namespace is
    +                               * used for privileged processes and the
    +                               * "Local" namespace is used otherwise.
    +                               */
    +#define APR_SHM_NS_GLOBAL   2 /* Create or attach to named shared memory
    +                               * segment in the "Global" namespace on
    +                               * Windows.  (Ignored on other platforms.)
    +                               */
    +
    +/**
    + * Create and make accessible a shared memory segment with platform-
    + * specific processing.
    + * @param m The shared memory structure to create.
    + * @param reqsize The desired size of the segment.
    + * @param filename The file to use for shared memory on platforms that
    + *        require it.
    + * @param pool the pool from which to allocate the shared memory
    + *        structure.
    + * @param flags mask of APR_SHM_* (defined above)
    + * @remark A note about Anonymous vs. Named shared memory segments:
    + *         Not all plaforms support anonymous shared memory segments, but in
    + *         some cases it is prefered over other types of shared memory
    + *         implementations. Passing a NULL 'file' parameter to this function
    + *         will cause the subsystem to use anonymous shared memory segments.
    + *         If such a system is not available, APR_ENOTIMPL is returned.
    + * @remark A note about allocation sizes:
    + *         On some platforms it is necessary to store some metainformation
    + *         about the segment within the actual segment. In order to supply
    + *         the caller with the requested size it may be necessary for the
    + *         implementation to request a slightly greater segment length
    + *         from the subsystem. In all cases, the apr_shm_baseaddr_get()
    + *         function will return the first usable byte of memory.
    + * 
    + */
    +APR_DECLARE(apr_status_t) apr_shm_create_ex(apr_shm_t **m,
    +                                            apr_size_t reqsize,
    +                                            const char *filename,
    +                                            apr_pool_t *pool,
    +                                            apr_int32_t flags);
    +
     /**
      * Remove named resource associated with a shared memory segment,
      * preventing attachments to the resource, but not destroying it.
    @@ -108,6 +155,21 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
                                              const char *filename,
                                              apr_pool_t *pool);
     
    +/**
    + * Attach to a shared memory segment that was created
    + * by another process, with platform-specific processing.
    + * @param m The shared memory structure to create.
    + * @param filename The file used to create the original segment.
    + *        (This MUST match the original filename.)
    + * @param pool the pool from which to allocate the shared memory
    + *        structure for this process.
    + * @param flags mask of APR_SHM_* (defined above)
    + */
    +APR_DECLARE(apr_status_t) apr_shm_attach_ex(apr_shm_t **m,
    +                                            const char *filename,
    +                                            apr_pool_t *pool,
    +                                            apr_int32_t flags);
    +
     /**
      * Detach from a shared memory segment without destroying it.
      * @param m The shared memory structure representing the segment
    diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c
    index d6b888b0819..db94dce32b1 100644
    --- a/shmem/beos/shm.c
    +++ b/shmem/beos/shm.c
    @@ -71,6 +71,15 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
         return APR_SUCCESS;
     }
     
    +APR_DECLARE(apr_status_t) apr_shm_create_ex(apr_shm_t **m, 
    +                                            apr_size_t reqsize, 
    +                                            const char *filename, 
    +                                            apr_pool_t *p,
    +                                            apr_int32_t flags)
    +{
    +    return apr_shm_create(m, reqsize, filename, p);
    +}
    +
     APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m)
     {
         delete_area(m->aid);
    @@ -133,6 +142,14 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
         return APR_SUCCESS;
     }
     
    +APR_DECLARE(apr_status_t) apr_shm_attach_ex(apr_shm_t **m,
    +                                            const char *filename,
    +                                            apr_pool_t *pool,
    +                                            apr_int32_t flags)
    +{
    +    return apr_shm_attach(m, filename, pool);
    +}
    +
     APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m)
     {
         delete_area(m->aid);
    diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c
    index f2c1b7dfb3c..81de941c20e 100644
    --- a/shmem/os2/shm.c
    +++ b/shmem/os2/shm.c
    @@ -56,6 +56,15 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
         return APR_SUCCESS;
     }
     
    +APR_DECLARE(apr_status_t) apr_shm_create_ex(apr_shm_t **m, 
    +                                            apr_size_t reqsize, 
    +                                            const char *filename, 
    +                                            apr_pool_t *p,
    +                                            apr_int32_t flags)
    +{
    +    return apr_shm_create(m, reqsize, filename, p);
    +}
    +
     APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m)
     {
         DosFreeMem(m->memblock);
    @@ -90,6 +99,14 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
         return APR_SUCCESS;
     }
     
    +APR_DECLARE(apr_status_t) apr_shm_attach_ex(apr_shm_t **m,
    +                                            const char *filename,
    +                                            apr_pool_t *pool,
    +                                            apr_int32_t flags)
    +{
    +    return apr_shm_attach(m, filename, pool);
    +}
    +
     APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m)
     {
         int rc = 0;
    diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c
    index f1259e232c0..f907000c896 100644
    --- a/shmem/unix/shm.c
    +++ b/shmem/unix/shm.c
    @@ -365,6 +365,15 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
         }
     }
     
    +APR_DECLARE(apr_status_t) apr_shm_create_ex(apr_shm_t **m, 
    +                                            apr_size_t reqsize, 
    +                                            const char *filename, 
    +                                            apr_pool_t *p,
    +                                            apr_int32_t flags)
    +{
    +    return apr_shm_create(m, reqsize, filename, p);
    +}
    +
     APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename,
                                              apr_pool_t *pool)
     {
    @@ -569,6 +578,14 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
         }
     }
     
    +APR_DECLARE(apr_status_t) apr_shm_attach_ex(apr_shm_t **m,
    +                                            const char *filename,
    +                                            apr_pool_t *pool,
    +                                            apr_int32_t flags)
    +{
    +    return apr_shm_attach(m, filename, pool);
    +}
    +
     APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m)
     {
         apr_status_t rv = shm_cleanup_attach(m);
    diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c
    index 930a25c74ee..af0115e44f4 100644
    --- a/shmem/win32/shm.c
    +++ b/shmem/win32/shm.c
    @@ -114,10 +114,11 @@ static int can_create_global_maps(void)
     }
     #endif /* SE_CREATE_GLOBAL_NAME */
     
    -APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
    -                                         apr_size_t reqsize,
    -                                         const char *file,
    -                                         apr_pool_t *pool)
    +APR_DECLARE(apr_status_t) apr_shm_create_ex(apr_shm_t **m,
    +                                            apr_size_t reqsize,
    +                                            const char *file,
    +                                            apr_pool_t *pool,
    +                                            apr_int32_t flags)
     {
         static apr_size_t memblock = 0;
         HANDLE hMap, hFile;
    @@ -154,6 +155,8 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
             mapkey = NULL;
         }
         else {
    +        int global;
    +
             /* Do file backed, which is not an inherited handle 
              * While we could open APR_EXCL, it doesn't seem that Unix
              * ever did.  Ignore that error here, but fail later when
    @@ -172,7 +175,16 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
              * without slashes or backslashes, and prepends the \global
              * or \local prefix on Win2K and later
              */
    -        mapkey = res_name_from_filename(file, can_create_global_maps(), pool);
    +        if (flags & APR_SHM_NS_GLOBAL) {
    +            global = 1;
    +        }
    +        else if (flags & APR_SHM_NS_LOCAL) {
    +            global = 0;
    +        }
    +        else {
    +            global = can_create_global_maps();
    +        }
    +        mapkey = res_name_from_filename(file, global, pool);
         }
     
     #if APR_HAS_UNICODE_FS
    @@ -228,6 +240,14 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
         return APR_SUCCESS;
     }
     
    +APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
    +                                         apr_size_t reqsize,
    +                                         const char *file,
    +                                         apr_pool_t *pool)
    +{
    +    return apr_shm_create_ex(m, reqsize, file, pool, 0);
    +}
    +
     APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) 
     {
         apr_status_t rv = shm_cleanup(m);
    @@ -318,24 +338,36 @@ static apr_status_t shm_attach_internal(apr_shm_t **m,
         return APR_SUCCESS;
     }
     
    -APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
    -                                         const char *file,
    -                                         apr_pool_t *pool)
    +APR_DECLARE(apr_status_t) apr_shm_attach_ex(apr_shm_t **m,
    +                                            const char *file,
    +                                            apr_pool_t *pool,
    +                                            apr_int32_t flags)
     {
         apr_status_t rv;
    -    int can_create_global = can_create_global_maps();
    -    int try_global_local[3] = {1, /* first try to find shm under global namespace */
    -                               0, /* next try to find it under local namespace */
    -                               -1}; /* nothing more to try */
    +    int can_create_global;
    +    int try_global_local[3] = {-1, -1, -1};
         int cur;
     
         if (!file) {
             return APR_EINVAL;
         }
     
    -    if (!can_create_global) { /* unprivileged process */
    -        try_global_local[0] = 0; /* search local before global */
    -        try_global_local[1] = 1;
    +    if (flags & APR_SHM_NS_LOCAL) {
    +        try_global_local[0] = 0; /* only search local */
    +    }
    +    else if (flags & APR_SHM_NS_GLOBAL) {
    +        try_global_local[0] = 1; /* only search global */
    +    }
    +    else {
    +        can_create_global = can_create_global_maps();
    +        if (!can_create_global) { /* unprivileged process */
    +            try_global_local[0] = 0; /* search local before global */
    +            try_global_local[1] = 1;
    +        }
    +        else {
    +            try_global_local[0] = 1; /* search global before local */
    +            try_global_local[1] = 0;
    +        }
         }
     
         for (cur = 0; try_global_local[cur] != -1; cur++) {
    @@ -348,6 +380,13 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
         return rv;
     }
     
    +APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
    +                                         const char *file,
    +                                         apr_pool_t *pool)
    +{
    +    return apr_shm_attach_ex(m, file, pool, 0);
    +}
    +
     APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m)
     {
         apr_status_t rv = shm_cleanup(m);
    
    From f82a92c16e621e34de63c8e3c538d2159cce6ea8 Mon Sep 17 00:00:00 2001
    From: Eric Covener 
    Date: Mon, 21 Oct 2013 16:22:28 +0000
    Subject: [PATCH 7350/7878] Changes to apr_pollset_method_e enum value of
     APR_POLLSET_POLL and APR_POLLSET_AIO_MSGQ.  Restore APR_POLLSET_POLL to its
     pre-r1308910 (April 2012) value, and move APR_POLLSET_AIO_MSGQ ahead.
    
    This keeps the enum in the same order as the backport to 1.5.x,
    which needs to not move APR_POLLSET_POLL for apps written against
    1.4.x.
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1534266 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES            | 5 +++++
     include/apr_poll.h | 4 ++--
     2 files changed, 7 insertions(+), 2 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 45637ab2e18..1e1208456c0 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,6 +1,11 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 2.0.0
     
    +  *) Changes to apr_pollset_method_e enum value of APR_POLLSET_POLL and
    +     APR_POLLSET_AIO_MSGQ.  Restore APR_POLLSET_POLL to its pre-r1308910 
    +     (April 2012) value, and move APR_POLLSET_AIO_MSGQ ahead. This restores
    +     ABI compat with released branches.  [Eric Covener]
    +
       *) Windows:  Create named shared memory segments under the "Local"
          namespace if the caller is unprivileged, fixing an inability of
          unprivileged callers to use apr_shm_create() with named shared
    diff --git a/include/apr_poll.h b/include/apr_poll.h
    index 9cdd0746c27..7ddae5bd743 100644
    --- a/include/apr_poll.h
    +++ b/include/apr_poll.h
    @@ -77,8 +77,8 @@ typedef enum {
         APR_POLLSET_KQUEUE,         /**< Poll uses kqueue method */
         APR_POLLSET_PORT,           /**< Poll uses Solaris event port method */
         APR_POLLSET_EPOLL,          /**< Poll uses epoll method */
    -    APR_POLLSET_AIO_MSGQ,       /**< Poll uses z/OS asio method */
    -    APR_POLLSET_POLL            /**< Poll uses poll method */
    +    APR_POLLSET_POLL,           /**< Poll uses poll method */
    +    APR_POLLSET_AIO_MSGQ        /**< Poll uses z/OS asio method */
     } apr_pollset_method_e;
     
     /** Used in apr_pollfd_t to determine what the apr_descriptor is */
    
    From 741d37caffc8b8cd08fd5ced6787894cd5e41a06 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 23 Oct 2013 00:01:44 +0000
    Subject: [PATCH 7351/7878] Windows shm stuff is in the 1.5.x branch via
     r1534011
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1534865 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 9 ---------
     1 file changed, 9 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 1e1208456c0..7fd633bee72 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -6,15 +6,6 @@ Changes for APR 2.0.0
          (April 2012) value, and move APR_POLLSET_AIO_MSGQ ahead. This restores
          ABI compat with released branches.  [Eric Covener]
     
    -  *) Windows:  Create named shared memory segments under the "Local"
    -     namespace if the caller is unprivileged, fixing an inability of
    -     unprivileged callers to use apr_shm_create() with named shared
    -     memory segments under recent Windows.  As before, shared memory
    -     segments are created under the "Global" namespace for privileged
    -     callers.  Add apr_shm_create_ex() and apr_shm_attach_ex(), which
    -     provide the ability to override the normal namespace selection.
    -     [Jeff Trawick]
    -
       *) Add apr_pbase64_encode() and apr_pbase64_decode() to encode to/from
          the pool. [Graham Leggett]
     
    
    From c1db129d29a4076b40dcbc13f42f1cebcde12324 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 23 Oct 2013 00:19:36 +0000
    Subject: [PATCH 7352/7878] clang scan-build noted that we sometimes assigned
     garbage to the mutex field, since the conditions under which we got the mutex
     vs. accessed it were different; simplify
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1534873 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/open.c | 11 +++++------
     1 file changed, 5 insertions(+), 6 deletions(-)
    
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index 36be4a706bf..b7e5bd8981c 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -97,7 +97,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
         apr_os_file_t fd;
         int oflags = 0;
     #if APR_HAS_THREADS
    -    apr_thread_mutex_t *thlock;
    +    apr_thread_mutex_t *thlock = NULL;
     #endif
         apr_status_t rv;
     
    @@ -217,16 +217,15 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
         if ((*new)->buffered) {
             (*new)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE);
             (*new)->bufsize = APR_FILE_DEFAULT_BUFSIZE;
    -#if APR_HAS_THREADS
    -        if ((*new)->flags & APR_FOPEN_XTHREAD) {
    -            (*new)->thlock = thlock;
    -        }
    -#endif
         }
         else {
             (*new)->buffer = NULL;
         }
     
    +#if APR_HAS_THREADS
    +    (*new)->thlock = thlock;
    +#endif
    +
         (*new)->is_pipe = 0;
         (*new)->timeout = -1;
         (*new)->ungetchar = -1;
    
    From b54f5714559a081a68a436eb9d0ac510177142c5 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 23 Oct 2013 00:43:22 +0000
    Subject: [PATCH 7353/7878] fix some minor bugs and useless assignments so that
     clang scan-build is a little quieter
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1534882 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memcache/apr_memcache.c | 9 ++++++---
     strings/apr_snprintf.c  | 1 -
     util-misc/apr_queue.c   | 3 +++
     xml/apr_xml.c           | 2 +-
     4 files changed, 10 insertions(+), 5 deletions(-)
    
    diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c
    index c5710d8b26c..a6b3276cffa 100644
    --- a/memcache/apr_memcache.c
    +++ b/memcache/apr_memcache.c
    @@ -407,6 +407,9 @@ APR_DECLARE(apr_status_t) apr_memcache_server_create(apr_pool_t *p,
         apr_pool_t *np;
     
         rv = apr_pool_create(&np, p);
    +    if (rv != APR_SUCCESS) {
    +        return rv;
    +    }
     
         server = apr_palloc(np, sizeof(apr_memcache_server_t));
     
    @@ -787,8 +790,8 @@ apr_memcache_getp(apr_memcache_t *mc,
             char *last;
             apr_size_t len = 0;
     
    -        flags = apr_strtok(conn->buffer, " ", &last);
    -        flags = apr_strtok(NULL, " ", &last);
    +        apr_strtok(conn->buffer, " ", &last);
    +        apr_strtok(NULL, " ", &last);
             flags = apr_strtok(NULL, " ", &last);
     
             if (flags_) {
    @@ -1359,7 +1362,7 @@ apr_memcache_multgetp(apr_memcache_t *mc,
                    char *data;
                    apr_size_t len = 0;
     
    -               key = apr_strtok(conn->buffer, " ", &last); /* just the VALUE, ignore */
    +               apr_strtok(conn->buffer, " ", &last); /* just the VALUE, ignore */
                    key = apr_strtok(NULL, " ", &last);
                    flags = apr_strtok(NULL, " ", &last);
     
    diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c
    index 6a689a61453..053f098631c 100644
    --- a/strings/apr_snprintf.c
    +++ b/strings/apr_snprintf.c
    @@ -100,7 +100,6 @@ static char *apr_cvt(double arg, int ndigits, int *decpt, int *sign,
             arg = -arg;
         }
         arg = modf(arg, &fi);
    -    p1 = &buf[NDIG];
         /*
          * Do integer part
          */
    diff --git a/util-misc/apr_queue.c b/util-misc/apr_queue.c
    index 413069918c8..09724932915 100644
    --- a/util-misc/apr_queue.c
    +++ b/util-misc/apr_queue.c
    @@ -223,6 +223,9 @@ APR_DECLARE(apr_status_t) apr_queue_trypush(apr_queue_t *queue, void *data)
     
         if (apr_queue_full(queue)) {
             rv = apr_thread_mutex_unlock(queue->one_big_mutex);
    +        if (rv != APR_SUCCESS) {
    +            return rv;
    +        }
             return APR_EAGAIN;
         }
         
    diff --git a/xml/apr_xml.c b/xml/apr_xml.c
    index 18423b564c4..8ea2b32fed9 100644
    --- a/xml/apr_xml.c
    +++ b/xml/apr_xml.c
    @@ -63,7 +63,7 @@ static int find_prefix(apr_xml_parser *parser, const char *prefix)
         ** prefix.
         */
         for (; elem; elem = elem->parent) {
    -        apr_xml_ns_scope *ns_scope = elem->ns_scope;
    +        apr_xml_ns_scope *ns_scope;
     
             for (ns_scope = elem->ns_scope; ns_scope; ns_scope = ns_scope->next) {
                 if (strcmp(prefix, ns_scope->prefix) == 0) {
    
    From aaf732ba3d7fcf58c5fe3c3fe94fa564421e30d5 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Wed, 23 Oct 2013 13:25:47 +0000
    Subject: [PATCH 7354/7878] * configure.in: Fix Linux kernel version detection,
     which did not   anticipate "3.11.x"-style double digit versioning.
    
    PR: 55690
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1535027 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 24 ++++++++++++++++--------
     1 file changed, 16 insertions(+), 8 deletions(-)
    
    diff --git a/configure.in b/configure.in
    index 8a956a9abad..8d331d43cd4 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -680,7 +680,15 @@ case $host in
             fi
             ;;
         *linux*)
    -        os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/'`
    +        os_major=[`uname -r | sed -e 's/\([1-9][0-9]*\)\..*/\1/'`]
    +        os_minor=[`uname -r | sed -e 's/[1-9][0-9]*\.\([1-9][0-9]*\)\..*/\1/'`]
    +        if test $os_major -lt 2 -o \( $os_major -eq 2 -a $os_minor -lt 4 \); then
    +            AC_MSG_WARN([Configured for pre-2.4 Linux $os_major.$os_minor])
    +            os_pre24linux=1
    +        else
    +            os_pre24linux=0
    +            AC_MSG_NOTICE([Configured for Linux $os_major.$os_minor])
    +        fi
             ;;
         *os390)
             os_version=`uname -r | sed -e 's/\.//g'`
    @@ -1091,7 +1099,8 @@ case $host in
             # that it has it.
             # FIXME - find exact 2.3 version that MMANON was fixed in.  It is
             # confirmed fixed in 2.4 series.
    -        if test $os_version -le "240"; then
    +        if test $os_pre24linux -eq 1; then
    +            AC_MSG_WARN([Disabling anon mmap() support for Linux pre-2.4])
                 APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_ZERO USE_SHMEM_SHMGET_ANON)
             fi
             ;;
    @@ -1157,11 +1166,9 @@ APR_IFALLYES(header:windows.h,
                   APR_DECIDE(USE_SHMEM_WIN32, [Windows shared memory])])
     case $host in
         *linux* ) 
    -        # Linux has problems with MM_SHMT_MMANON even though it reports
    -        # that it has it.
    -        # FIXME - find exact 2.3 version that MMANON was fixed in.  It is
    -        # confirmed fixed in 2.4 series.
    -        if test $os_version -le "240"; then
    +        # Linux pre-2.4 had problems with MM_SHMT_MMANON even though
    +        # it reports that it has it.
    +        if test $os_pre24linux -eq 1; then
                 APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_TMP USE_SHMEM_MMAP_SHM dnl
                                       USE_SHMEM_SHMGET)
             fi
    @@ -1258,7 +1265,8 @@ AC_ARG_WITH(sendfile, [  --with-sendfile         Override decision to use sendfi
                 ;;
             s390-*-linux-gnu)
                 # disable sendfile support for 2.2 on S/390
    -            if test $os_version -lt 240; then
    +            if test $os_pre24linux -eq 1; then
    +                AC_MSG_WARN([Disabled sendfile support for Linux 2.2 on S/390])
                     sendfile="0"
                 fi
                 ;;
    
    From 83f34a0e6d5ef8d10365bc67cf67dbc1e00959b0 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Wed, 23 Oct 2013 20:22:57 +0000
    Subject: [PATCH 7355/7878] * configure.in: Fix r1535027 for Linux kernel
     versions x.0.y.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1535157 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/configure.in b/configure.in
    index 8d331d43cd4..55c395242ee 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -681,7 +681,7 @@ case $host in
             ;;
         *linux*)
             os_major=[`uname -r | sed -e 's/\([1-9][0-9]*\)\..*/\1/'`]
    -        os_minor=[`uname -r | sed -e 's/[1-9][0-9]*\.\([1-9][0-9]*\)\..*/\1/'`]
    +        os_minor=[`uname -r | sed -e 's/[1-9][0-9]*\.\([0-9]+\)\..*/\1/'`]
             if test $os_major -lt 2 -o \( $os_major -eq 2 -a $os_minor -lt 4 \); then
                 AC_MSG_WARN([Configured for pre-2.4 Linux $os_major.$os_minor])
                 os_pre24linux=1
    
    From 28024f8b536860e622eecf6b887b6ed20e24be48 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sun, 27 Oct 2013 17:36:31 +0000
    Subject: [PATCH 7356/7878] remove entries for items merge to stable branch
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1536168 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 5 -----
     1 file changed, 5 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index 7fd633bee72..ae24c65f61c 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -21,15 +21,10 @@ Changes for APR 2.0.0
       *) apr_socket_accept_filter(): The 2nd and 3rd arguments are now 
          const char * instead of char *.  [Jeff Trawick]
     
    -  *) apr_pollset_poll:  add z/OS async poll support for sockets [Greg Ames]
    -
       *) apr_brigades: add a check to prevent infinite while loop in case
          of a corrupted brigade.  Problem evidenced in PR 51062.  Analysis by
          Krzysztof Kostałkowicz , patch [Nick Kew].
     
    -  *) apr_socket_connect() on Windows: Handle WSAEISCONN.  PR 48736.
    -     [, Jeff Trawick]
    -
       *) Support libxml2 as an alternative XML parser to expat [Nick Kew]
     
       *) Hide apr_wait_for_io_or_timeout() from public view and add instead
    
    From 9b676724455e76921ddee457fc8b9e3dba0219da Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 29 Oct 2013 14:56:55 +0000
    Subject: [PATCH 7357/7878] trigger the generation of apr_escape_test_char.h
     during the build
    
    clean the most critical gen_test_char artifacts
      (.libs still not removed)
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1536744 13f79535-47bb-0310-9956-ffa450edef68
    ---
     Makefile.in                            |  6 +++++-
     include/private/apr_escape_test_char.h | 23 -----------------------
     2 files changed, 5 insertions(+), 24 deletions(-)
     delete mode 100644 include/private/apr_escape_test_char.h
    
    diff --git a/Makefile.in b/Makefile.in
    index b549c4b92c4..150ce7f7231 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -52,7 +52,9 @@ LT_VERSION = @LT_VERSION@
     @INCLUDE_OUTPUTS@
     
     CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \
    -	build/apr_rules.out tools/gen_test_char@EXEEXT@
    +	build/apr_rules.out tools/gen_test_char@EXEEXT@ \
    +	tools/gen_test_char.o tools/gen_test_char.lo \
    +	include/private/apr_escape_test_char.h
     DISTCLEAN_TARGETS = config.cache config.log config.status \
     	include/apr.h include/arch/unix/apr_private.h \
     	libtool $(APR_CONFIG) build/apr_rules.mk apr.pc \
    @@ -123,6 +125,8 @@ install: install-modules $(TARGETS)
     $(TARGET_LIB): $(OBJECTS) $(EXTRA_OBJECTS)
     	$(LINK) @lib_target@ $(EXTRA_OBJECTS) $(ALL_LIBS) $(APRUTIL_EXPORT_LIBS)
     
    +encoding/apr_escape.lo: include/private/apr_escape_test_char.h 
    +
     install-modules: install-modules-@APR_HAVE_MODULES@
     
     install-modules-no:
    diff --git a/include/private/apr_escape_test_char.h b/include/private/apr_escape_test_char.h
    deleted file mode 100644
    index 3cb8443b85a..00000000000
    --- a/include/private/apr_escape_test_char.h
    +++ /dev/null
    @@ -1,23 +0,0 @@
    -/* this file is automatically generated by gen_test_char, do not edit. "make include/private/apr_escape_test_char.h" to regenerate. */
    -#define T_ESCAPE_SHELL_CMD     (1)
    -#define T_ESCAPE_PATH_SEGMENT  (2)
    -#define T_OS_ESCAPE_PATH       (4)
    -#define T_ESCAPE_ECHO          (8)
    -#define T_ESCAPE_URLENCODED    (16)
    -#define T_ESCAPE_XML           (32)
    -
    -static const unsigned char test_char_table[256] = {
    -    32,30,30,30,30,30,30,30,30,30,31,30,30,30,30,30,30,30,30,30,
    -    30,30,30,30,30,30,30,30,30,30,30,30,6,16,63,22,17,22,49,17,
    -    17,17,1,16,16,0,0,18,0,0,0,0,0,0,0,0,0,0,16,23,
    -    55,16,55,23,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    -    0,0,0,0,0,0,0,0,0,0,0,23,31,23,23,0,23,0,0,0,
    -    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    -    0,0,0,23,23,23,17,30,30,30,30,30,30,30,30,30,30,30,30,30,
    -    30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
    -    30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
    -    30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
    -    30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
    -    30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
    -    30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30 
    -};
    
    From 25a65eb80909088d6830a698d0d62e578d788508 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 29 Oct 2013 15:50:17 +0000
    Subject: [PATCH 7358/7878] Fix line endings of text files
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1536769 13f79535-47bb-0310-9956-ffa450edef68
    
    From ef4b61b5ff72efb6cd8a4f4215bc67d18a3dd923 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 29 Oct 2013 15:51:06 +0000
    Subject: [PATCH 7359/7878] Fix line endings of trunk-specific text files
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1536770 13f79535-47bb-0310-9956-ffa450edef68
    ---
     README.FREETDS                   |   22 +-
     build/xml.m4                     |  422 ++++----
     crypto/apr_crypto_commoncrypto.c | 1628 +++++++++++++++---------------
     3 files changed, 1036 insertions(+), 1036 deletions(-)
    
    diff --git a/README.FREETDS b/README.FREETDS
    index 4066a9c78b3..15eeeaf39a9 100644
    --- a/README.FREETDS
    +++ b/README.FREETDS
    @@ -1,11 +1,11 @@
    -The APR DBD Driver for FreeTDS has been removed from the build.
    -It is known to have problems, and we are not able to maintain it.
    -
    -The source code is still available.  If you want it and are able
    -to manage maintenance for yourself, you can patch the build and
    -work through issues that affect you, but you're on your own.
    -
    -We expect that for most users, the ODBC driver will serve as
    -an alternative.
    -
    -Sorry.
    +The APR DBD Driver for FreeTDS has been removed from the build.
    +It is known to have problems, and we are not able to maintain it.
    +
    +The source code is still available.  If you want it and are able
    +to manage maintenance for yourself, you can patch the build and
    +work through issues that affect you, but you're on your own.
    +
    +We expect that for most users, the ODBC driver will serve as
    +an alternative.
    +
    +Sorry.
    diff --git a/build/xml.m4 b/build/xml.m4
    index 7c8ad2d768e..3c31ea995a0 100644
    --- a/build/xml.m4
    +++ b/build/xml.m4
    @@ -1,211 +1,211 @@
    -dnl -------------------------------------------------------- -*- autoconf -*-
    -dnl Licensed to the Apache Software Foundation (ASF) under one or more
    -dnl contributor license agreements.  See the NOTICE file distributed with
    -dnl this work for additional information regarding copyright ownership.
    -dnl The ASF licenses this file to You under the Apache License, Version 2.0
    -dnl (the "License"); you may not use this file except in compliance with
    -dnl the License.  You may obtain a copy of the License at
    -dnl
    -dnl     http://www.apache.org/licenses/LICENSE-2.0
    -dnl
    -dnl Unless required by applicable law or agreed to in writing, software
    -dnl distributed under the License is distributed on an "AS IS" BASIS,
    -dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -dnl See the License for the specific language governing permissions and
    -dnl limitations under the License.
    -
    -
    -dnl
    -dnl APU_TRY_EXPAT_LINK(
    -dnl      test-message, cache-var-name, hdrs, libs,
    -dnl      [actions-on-success], [actions-on-failure])
    -dnl         
    -dnl Tests linking against expat with libraries 'libs' and includes
    -dnl 'hdrs', passing message + cache-var-name to AC_CACHE_CHECK.
    -dnl On success, sets $expat_libs to libs, sets $apu_has_expat to 1, 
    -dnl and runs actions-on-success; on failure runs actions-on-failure.
    -dnl
    -AC_DEFUN([APU_TRY_EXPAT_LINK], [
    -AC_CACHE_CHECK([$1], [$2], [
    -  apu_expat_LIBS=$LIBS
    -  apu_expat_CPPFLAGS=$CPPFLAGS
    -  LIBS="$LIBS $4"
    -  CPPFLAGS="$CPPFLAGS $INCLUDES"
    -  AC_TRY_LINK([#include 
    -#include <$3>], [XML_ParserCreate(NULL);],
    -    [$2=yes], [$2=no])
    -  LIBS=$apu_expat_LIBS
    -  CPPFLAGS=$apu_expat_CPPFLAGS
    -])
    -
    -if test $[$2] = yes; then
    -   AC_DEFINE([HAVE_]translit([$3], [a-z./], [A-Z__]), 1,
    -             [Define if $3 is available])
    -   apu_expat_libs="$4"
    -   apu_has_expat=1
    -   $5
    -   AC_SUBST(apu_has_expat)
    -else
    -   apu_has_expat=0
    -   $6
    -fi
    -])
    -
    -dnl
    -dnl APU_SYSTEM_EXPAT: tests for a system expat installation
    -dnl If present, sets $apu_has_expat to 1 and adjusts LDFLAGS/CPPFLAGS
    -dnl appropriately.  This is mostly for compatibility with existing
    -dnl expat releases; all but the first APU_TRY_EXPAT_LINK call could
    -dnl be dropped later.
    -dnl
    -AC_DEFUN([APU_SYSTEM_EXPAT], [
    - 
    -  APU_TRY_EXPAT_LINK([Expat 1.95.x], apu_cv_expat_system, 
    -    [expat.h], [-lexpat])
    -
    -  if test $apu_has_expat = 0; then
    -    APU_TRY_EXPAT_LINK([old Debian-packaged expat], apu_cv_expat_debian,
    -       [xmltok/xmlparse.h], [-lxmlparse -lxmltok])
    -  fi
    -
    -  if test $apu_has_expat = 0; then
    -    APU_TRY_EXPAT_LINK([old FreeBSD-packaged expat], apu_cv_expat_freebsd,
    -       [xml/xmlparse.h], [-lexpat])
    -  fi
    -
    -  if test $apu_has_expat = 0; then
    -    APU_TRY_EXPAT_LINK([Expat 1.0/1.1], apu_cv_expat_1011,
    -       [xmlparse/xmlparse.h], [-lexpat])
    -  fi
    -
    -  if test $apu_has_expat = 0; then
    -    APR_ADDTO(LDFLAGS, [-L/usr/local/lib])
    -    APR_ADDTO(INCLUDES, [-I/usr/local/include])
    - 
    -    APU_TRY_EXPAT_LINK([Expat 1.95.x in /usr/local], 
    -       apu_cv_expat_usrlocal, [expat.h], [-lexpat], [], [
    -       APR_REMOVEFROM(LDFLAGS, [-L/usr/local/lib])
    -       APR_REMOVEFROM(INCLUDES, [-I/usr/local/include])
    -      ])
    -  fi
    -])
    -
    -
    -dnl
    -dnl APU_FIND_EXPAT: figure out where EXPAT is located (or use bundled)
    -dnl
    -AC_DEFUN([APU_FIND_EXPAT], [
    -
    -save_cppflags="$CPPFLAGS"
    -
    -apu_has_expat=0
    -
    -AC_ARG_WITH([expat],
    -[  --with-expat=DIR        specify Expat location], [
    -  if test "$withval" = "yes"; then
    -    AC_MSG_ERROR([a directory must be specified for --with-expat])
    -  elif test "$withval" = "no"; then
    -    if test "$apu_has_libxml2" != "1"; then
    -      AC_MSG_ERROR([An XML parser is required!  If you disable expat, you must select --with-libxml2])
    -    fi
    -  else
    -    # Add given path to standard search paths if appropriate:
    -    if test "$apu_has_libxml2" = "1"; then
    -      AC_MSG_ERROR(Cannot build with both expat and libxml2 - please select one)
    -    fi
    -    if test "$withval" != "/usr"; then
    -      APR_ADDTO(INCLUDES, [-I$withval/include])
    -      APR_ADDTO(LDFLAGS, [-L$withval/lib])
    -    fi
    -  fi
    -])
    -
    -if test "$apu_has_libxml2" != "1"; then
    -  APU_SYSTEM_EXPAT
    -
    -  APR_ADDTO(APRUTIL_EXPORT_LIBS, [$apu_expat_libs])
    -  APR_ADDTO(LIBS, [$apu_expat_libs])
    -
    -  APR_XML_DIR=$bundled_subdir
    -  AC_SUBST(APR_XML_DIR)
    -fi
    -
    -CPPFLAGS=$save_cppflags
    -])
    -
    -
    -dnl
    -dnl APU_FIND_LIBXML2: figure out where LIBXML2 is located (or use bundled)
    -dnl
    -AC_DEFUN([APU_FIND_LIBXML2], [
    -
    -save_cppflags="$CPPFLAGS"
    -
    -apu_has_libxml2=0
    -apu_try_libxml2=0
    -
    -AC_ARG_WITH([libxml2],
    -[  --with-libxml2=DIR      specify libxml2 location], [
    -  if test "$withval" = "yes"; then
    -    apu_try_libxml2=1
    -    APR_ADDTO(INCLUDES, [-I/usr/include/libxml2])
    -  elif test "$withval" != "no"; then
    -    apu_try_libxml2=1
    -    APR_ADDTO(INCLUDES, [-I$withval/include/libxml2])
    -    if test "$withval" != "/usr"; then
    -      APR_ADDTO(LDFLAGS, [-L$withval/lib])
    -    fi
    -  fi
    -  if test ${apu_try_libxml2} = "1" ; then
    -
    -    #test for libxml2
    -    AC_CACHE_CHECK([libxml2], [apu_cv_libxml2], [
    -      apu_libxml2_CPPFLAGS=$CPPFLAGS
    -      apu_libxml2_LIBS="$LIBS -lxml2"
    -      CPPFLAGS="$CPPFLAGS $INCLUDES"
    -      LIBS="$LIBS -lxml2"
    -      AC_TRY_LINK(
    -        [#include ],
    -        [xmlSAXHandler sax; xmlCreatePushParserCtxt(&sax, NULL, NULL, 0, NULL);],
    -        [apu_cv_libxml2=yes],
    -        [apu_cv_libxml2=no],
    -      )
    -      CPPFLAGS=$apu_libxml2_CPPFLAGS
    -      LIBS=$apu_libxml2_LIBS
    -    ])
    -    if test $apu_cv_libxml2 = yes ; then
    -      AC_DEFINE([HAVE_LIBXML2_H], 1, [libxml2 found])
    -      apu_has_libxml2=1
    -    else
    -      apu_has_libxml2=0
    -    fi
    -  fi
    -])
    -AC_SUBST(apu_has_libxml2)
    -
    -if test ${apu_has_libxml2} = "1" ; then
    -  APR_ADDTO(APRUTIL_EXPORT_LIBS, [-lxml2])
    -  APR_ADDTO(LIBS, [-lxml2])
    -fi
    -
    -CPPFLAGS=$save_cppflags
    -])
    -
    -dnl
    -dnl APU_FIND_XML: Find an XML library
    -dnl
    -dnl Logic: we need exactly one but not both XML libraries
    -dnl        Make expat the default for back-compatibility.
    -dnl        Use libxml2 if a --with-libxml2 is specified (and works),
    -dnl        otherwise expat.
    -dnl
    -AC_DEFUN([APU_FIND_XML], [
    -APU_FIND_LIBXML2
    -APU_FIND_EXPAT
    -
    -if test ${apu_has_expat} = "1" && test ${apu_has_libxml2} = "1" ; then
    -  AC_MSG_ERROR(Cannot build with both expat and libxml2 - please select one)
    -elif test ${apu_has_expat} != "1" && test ${apu_has_libxml2} != "1" ; then
    -  AC_MSG_ERROR(No XML parser found!  Please specify --with-expat or --with-libxml2)
    -fi
    -])
    +dnl -------------------------------------------------------- -*- autoconf -*-
    +dnl Licensed to the Apache Software Foundation (ASF) under one or more
    +dnl contributor license agreements.  See the NOTICE file distributed with
    +dnl this work for additional information regarding copyright ownership.
    +dnl The ASF licenses this file to You under the Apache License, Version 2.0
    +dnl (the "License"); you may not use this file except in compliance with
    +dnl the License.  You may obtain a copy of the License at
    +dnl
    +dnl     http://www.apache.org/licenses/LICENSE-2.0
    +dnl
    +dnl Unless required by applicable law or agreed to in writing, software
    +dnl distributed under the License is distributed on an "AS IS" BASIS,
    +dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +dnl See the License for the specific language governing permissions and
    +dnl limitations under the License.
    +
    +
    +dnl
    +dnl APU_TRY_EXPAT_LINK(
    +dnl      test-message, cache-var-name, hdrs, libs,
    +dnl      [actions-on-success], [actions-on-failure])
    +dnl         
    +dnl Tests linking against expat with libraries 'libs' and includes
    +dnl 'hdrs', passing message + cache-var-name to AC_CACHE_CHECK.
    +dnl On success, sets $expat_libs to libs, sets $apu_has_expat to 1, 
    +dnl and runs actions-on-success; on failure runs actions-on-failure.
    +dnl
    +AC_DEFUN([APU_TRY_EXPAT_LINK], [
    +AC_CACHE_CHECK([$1], [$2], [
    +  apu_expat_LIBS=$LIBS
    +  apu_expat_CPPFLAGS=$CPPFLAGS
    +  LIBS="$LIBS $4"
    +  CPPFLAGS="$CPPFLAGS $INCLUDES"
    +  AC_TRY_LINK([#include 
    +#include <$3>], [XML_ParserCreate(NULL);],
    +    [$2=yes], [$2=no])
    +  LIBS=$apu_expat_LIBS
    +  CPPFLAGS=$apu_expat_CPPFLAGS
    +])
    +
    +if test $[$2] = yes; then
    +   AC_DEFINE([HAVE_]translit([$3], [a-z./], [A-Z__]), 1,
    +             [Define if $3 is available])
    +   apu_expat_libs="$4"
    +   apu_has_expat=1
    +   $5
    +   AC_SUBST(apu_has_expat)
    +else
    +   apu_has_expat=0
    +   $6
    +fi
    +])
    +
    +dnl
    +dnl APU_SYSTEM_EXPAT: tests for a system expat installation
    +dnl If present, sets $apu_has_expat to 1 and adjusts LDFLAGS/CPPFLAGS
    +dnl appropriately.  This is mostly for compatibility with existing
    +dnl expat releases; all but the first APU_TRY_EXPAT_LINK call could
    +dnl be dropped later.
    +dnl
    +AC_DEFUN([APU_SYSTEM_EXPAT], [
    + 
    +  APU_TRY_EXPAT_LINK([Expat 1.95.x], apu_cv_expat_system, 
    +    [expat.h], [-lexpat])
    +
    +  if test $apu_has_expat = 0; then
    +    APU_TRY_EXPAT_LINK([old Debian-packaged expat], apu_cv_expat_debian,
    +       [xmltok/xmlparse.h], [-lxmlparse -lxmltok])
    +  fi
    +
    +  if test $apu_has_expat = 0; then
    +    APU_TRY_EXPAT_LINK([old FreeBSD-packaged expat], apu_cv_expat_freebsd,
    +       [xml/xmlparse.h], [-lexpat])
    +  fi
    +
    +  if test $apu_has_expat = 0; then
    +    APU_TRY_EXPAT_LINK([Expat 1.0/1.1], apu_cv_expat_1011,
    +       [xmlparse/xmlparse.h], [-lexpat])
    +  fi
    +
    +  if test $apu_has_expat = 0; then
    +    APR_ADDTO(LDFLAGS, [-L/usr/local/lib])
    +    APR_ADDTO(INCLUDES, [-I/usr/local/include])
    + 
    +    APU_TRY_EXPAT_LINK([Expat 1.95.x in /usr/local], 
    +       apu_cv_expat_usrlocal, [expat.h], [-lexpat], [], [
    +       APR_REMOVEFROM(LDFLAGS, [-L/usr/local/lib])
    +       APR_REMOVEFROM(INCLUDES, [-I/usr/local/include])
    +      ])
    +  fi
    +])
    +
    +
    +dnl
    +dnl APU_FIND_EXPAT: figure out where EXPAT is located (or use bundled)
    +dnl
    +AC_DEFUN([APU_FIND_EXPAT], [
    +
    +save_cppflags="$CPPFLAGS"
    +
    +apu_has_expat=0
    +
    +AC_ARG_WITH([expat],
    +[  --with-expat=DIR        specify Expat location], [
    +  if test "$withval" = "yes"; then
    +    AC_MSG_ERROR([a directory must be specified for --with-expat])
    +  elif test "$withval" = "no"; then
    +    if test "$apu_has_libxml2" != "1"; then
    +      AC_MSG_ERROR([An XML parser is required!  If you disable expat, you must select --with-libxml2])
    +    fi
    +  else
    +    # Add given path to standard search paths if appropriate:
    +    if test "$apu_has_libxml2" = "1"; then
    +      AC_MSG_ERROR(Cannot build with both expat and libxml2 - please select one)
    +    fi
    +    if test "$withval" != "/usr"; then
    +      APR_ADDTO(INCLUDES, [-I$withval/include])
    +      APR_ADDTO(LDFLAGS, [-L$withval/lib])
    +    fi
    +  fi
    +])
    +
    +if test "$apu_has_libxml2" != "1"; then
    +  APU_SYSTEM_EXPAT
    +
    +  APR_ADDTO(APRUTIL_EXPORT_LIBS, [$apu_expat_libs])
    +  APR_ADDTO(LIBS, [$apu_expat_libs])
    +
    +  APR_XML_DIR=$bundled_subdir
    +  AC_SUBST(APR_XML_DIR)
    +fi
    +
    +CPPFLAGS=$save_cppflags
    +])
    +
    +
    +dnl
    +dnl APU_FIND_LIBXML2: figure out where LIBXML2 is located (or use bundled)
    +dnl
    +AC_DEFUN([APU_FIND_LIBXML2], [
    +
    +save_cppflags="$CPPFLAGS"
    +
    +apu_has_libxml2=0
    +apu_try_libxml2=0
    +
    +AC_ARG_WITH([libxml2],
    +[  --with-libxml2=DIR      specify libxml2 location], [
    +  if test "$withval" = "yes"; then
    +    apu_try_libxml2=1
    +    APR_ADDTO(INCLUDES, [-I/usr/include/libxml2])
    +  elif test "$withval" != "no"; then
    +    apu_try_libxml2=1
    +    APR_ADDTO(INCLUDES, [-I$withval/include/libxml2])
    +    if test "$withval" != "/usr"; then
    +      APR_ADDTO(LDFLAGS, [-L$withval/lib])
    +    fi
    +  fi
    +  if test ${apu_try_libxml2} = "1" ; then
    +
    +    #test for libxml2
    +    AC_CACHE_CHECK([libxml2], [apu_cv_libxml2], [
    +      apu_libxml2_CPPFLAGS=$CPPFLAGS
    +      apu_libxml2_LIBS="$LIBS -lxml2"
    +      CPPFLAGS="$CPPFLAGS $INCLUDES"
    +      LIBS="$LIBS -lxml2"
    +      AC_TRY_LINK(
    +        [#include ],
    +        [xmlSAXHandler sax; xmlCreatePushParserCtxt(&sax, NULL, NULL, 0, NULL);],
    +        [apu_cv_libxml2=yes],
    +        [apu_cv_libxml2=no],
    +      )
    +      CPPFLAGS=$apu_libxml2_CPPFLAGS
    +      LIBS=$apu_libxml2_LIBS
    +    ])
    +    if test $apu_cv_libxml2 = yes ; then
    +      AC_DEFINE([HAVE_LIBXML2_H], 1, [libxml2 found])
    +      apu_has_libxml2=1
    +    else
    +      apu_has_libxml2=0
    +    fi
    +  fi
    +])
    +AC_SUBST(apu_has_libxml2)
    +
    +if test ${apu_has_libxml2} = "1" ; then
    +  APR_ADDTO(APRUTIL_EXPORT_LIBS, [-lxml2])
    +  APR_ADDTO(LIBS, [-lxml2])
    +fi
    +
    +CPPFLAGS=$save_cppflags
    +])
    +
    +dnl
    +dnl APU_FIND_XML: Find an XML library
    +dnl
    +dnl Logic: we need exactly one but not both XML libraries
    +dnl        Make expat the default for back-compatibility.
    +dnl        Use libxml2 if a --with-libxml2 is specified (and works),
    +dnl        otherwise expat.
    +dnl
    +AC_DEFUN([APU_FIND_XML], [
    +APU_FIND_LIBXML2
    +APU_FIND_EXPAT
    +
    +if test ${apu_has_expat} = "1" && test ${apu_has_libxml2} = "1" ; then
    +  AC_MSG_ERROR(Cannot build with both expat and libxml2 - please select one)
    +elif test ${apu_has_expat} != "1" && test ${apu_has_libxml2} != "1" ; then
    +  AC_MSG_ERROR(No XML parser found!  Please specify --with-expat or --with-libxml2)
    +fi
    +])
    diff --git a/crypto/apr_crypto_commoncrypto.c b/crypto/apr_crypto_commoncrypto.c
    index e9136c93ab6..a584e5baa9e 100644
    --- a/crypto/apr_crypto_commoncrypto.c
    +++ b/crypto/apr_crypto_commoncrypto.c
    @@ -1,814 +1,814 @@
    -/* Licensed to the Apache Software Foundation (ASF) under one or more
    - * contributor license agreements.  See the NOTICE file distributed with
    - * this work for additional information regarding copyright ownership.
    - * The ASF licenses this file to You under the Apache License, Version 2.0
    - * (the "License"); you may not use this file except in compliance with
    - * the License.  You may obtain a copy of the License at
    - *
    - *     http://www.apache.org/licenses/LICENSE-2.0
    - *
    - * Unless required by applicable law or agreed to in writing, software
    - * distributed under the License is distributed on an "AS IS" BASIS,
    - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    - * See the License for the specific language governing permissions and
    - * limitations under the License.
    - */
    -
    -#include "apr_lib.h"
    -#include "apu.h"
    -#include "apr_private.h"
    -#include "apu_errno.h"
    -
    -#include 
    -#include 
    -#include 
    -
    -#include "apr_strings.h"
    -#include "apr_time.h"
    -#include "apr_buckets.h"
    -#include "apr_random.h"
    -
    -#include "apr_crypto_internal.h"
    -
    -#if APU_HAVE_CRYPTO
    -
    -#include 
    -
    -#define LOG_PREFIX "apr_crypto_commoncrypto: "
    -
    -struct apr_crypto_t
    -{
    -    apr_pool_t *pool;
    -    const apr_crypto_driver_t *provider;
    -    apu_err_t *result;
    -    apr_array_header_t *keys;
    -    apr_hash_t *types;
    -    apr_hash_t *modes;
    -    apr_random_t *rng;
    -};
    -
    -struct apr_crypto_key_t
    -{
    -    apr_pool_t *pool;
    -    const apr_crypto_driver_t *provider;
    -    const apr_crypto_t *f;
    -    CCAlgorithm algorithm;
    -    CCOptions options;
    -    unsigned char *key;
    -    int keyLen;
    -    int ivSize;
    -    apr_size_t blockSize;
    -};
    -
    -struct apr_crypto_block_t
    -{
    -    apr_pool_t *pool;
    -    const apr_crypto_driver_t *provider;
    -    const apr_crypto_t *f;
    -    const apr_crypto_key_t *key;
    -    CCCryptorRef ref;
    -};
    -
    -static int key_3des_192 = APR_KEY_3DES_192;
    -static int key_aes_128 = APR_KEY_AES_128;
    -static int key_aes_192 = APR_KEY_AES_192;
    -static int key_aes_256 = APR_KEY_AES_256;
    -
    -static int mode_ecb = APR_MODE_ECB;
    -static int mode_cbc = APR_MODE_CBC;
    -
    -/**
    - * Fetch the most recent error from this driver.
    - */
    -static apr_status_t crypto_error(const apu_err_t **result,
    -        const apr_crypto_t *f)
    -{
    -    *result = f->result;
    -    return APR_SUCCESS;
    -}
    -
    -/**
    - * Shutdown the crypto library and release resources.
    - */
    -static apr_status_t crypto_shutdown(void)
    -{
    -    return APR_SUCCESS;
    -}
    -
    -static apr_status_t crypto_shutdown_helper(void *data)
    -{
    -    return crypto_shutdown();
    -}
    -
    -/**
    - * Initialise the crypto library and perform one time initialisation.
    - */
    -static apr_status_t crypto_init(apr_pool_t *pool, const char *params,
    -        const apu_err_t **result)
    -{
    -
    -    apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper,
    -            apr_pool_cleanup_null);
    -
    -    return APR_SUCCESS;
    -}
    -
    -/**
    - * @brief Clean encryption / decryption context.
    - * @note After cleanup, a context is free to be reused if necessary.
    - * @param ctx The block context to use.
    - * @return Returns APR_ENOTIMPL if not supported.
    - */
    -static apr_status_t crypto_block_cleanup(apr_crypto_block_t *ctx)
    -{
    -
    -    if (ctx->ref) {
    -        CCCryptorRelease(ctx->ref);
    -        ctx->ref = NULL;
    -    }
    -
    -    return APR_SUCCESS;
    -
    -}
    -
    -static apr_status_t crypto_block_cleanup_helper(void *data)
    -{
    -    apr_crypto_block_t *block = (apr_crypto_block_t *) data;
    -    return crypto_block_cleanup(block);
    -}
    -
    -/**
    - * @brief Clean encryption / decryption context.
    - * @note After cleanup, a context is free to be reused if necessary.
    - * @param f The context to use.
    - * @return Returns APR_ENOTIMPL if not supported.
    - */
    -static apr_status_t crypto_cleanup(apr_crypto_t *f)
    -{
    -
    -    return APR_SUCCESS;
    -
    -}
    -
    -static apr_status_t crypto_cleanup_helper(void *data)
    -{
    -    apr_crypto_t *f = (apr_crypto_t *) data;
    -    return crypto_cleanup(f);
    -}
    -
    -/**
    - * @brief Create a context for supporting encryption. Keys, certificates,
    - *        algorithms and other parameters will be set per context. More than
    - *        one context can be created at one time. A cleanup will be automatically
    - *        registered with the given pool to guarantee a graceful shutdown.
    - * @param f - context pointer will be written here
    - * @param provider - provider to use
    - * @param params - array of key parameters
    - * @param pool - process pool
    - * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE
    - * if the engine cannot be initialised.
    - */
    -static apr_status_t crypto_make(apr_crypto_t **ff,
    -        const apr_crypto_driver_t *provider, const char *params,
    -        apr_pool_t *pool)
    -{
    -    apr_crypto_t *f = apr_pcalloc(pool, sizeof(apr_crypto_t));
    -    apr_status_t rv;
    -
    -    if (!f) {
    -        return APR_ENOMEM;
    -    }
    -    *ff = f;
    -    f->pool = pool;
    -    f->provider = provider;
    -
    -    /* seed the secure random number generator */
    -    f->rng = apr_random_standard_new(pool);
    -    if (!f->rng) {
    -        return APR_ENOMEM;
    -    }
    -    do {
    -        unsigned char seed[8];
    -        rv = apr_generate_random_bytes(seed, sizeof(seed));
    -        if (rv != APR_SUCCESS) {
    -            return rv;
    -        }
    -        apr_random_add_entropy(f->rng, seed, sizeof(seed));
    -        rv = apr_random_secure_ready(f->rng);
    -    } while (rv == APR_ENOTENOUGHENTROPY);
    -
    -    f->result = apr_pcalloc(pool, sizeof(apu_err_t));
    -    if (!f->result) {
    -        return APR_ENOMEM;
    -    }
    -
    -    f->keys = apr_array_make(pool, 10, sizeof(apr_crypto_key_t));
    -    if (!f->keys) {
    -        return APR_ENOMEM;
    -    }
    -
    -    f->types = apr_hash_make(pool);
    -    if (!f->types) {
    -        return APR_ENOMEM;
    -    }
    -    apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_3des_192));
    -    apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_aes_128));
    -    apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_aes_192));
    -    apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_aes_256));
    -
    -    f->modes = apr_hash_make(pool);
    -    if (!f->modes) {
    -        return APR_ENOMEM;
    -    }
    -    apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(mode_ecb));
    -    apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(mode_cbc));
    -
    -    apr_pool_cleanup_register(pool, f, crypto_cleanup_helper,
    -            apr_pool_cleanup_null);
    -
    -    return APR_SUCCESS;
    -
    -}
    -
    -/**
    - * @brief Get a hash table of key types, keyed by the name of the type against
    - * an integer pointer constant.
    - *
    - * @param types - hashtable of key types keyed to constants.
    - * @param f - encryption context
    - * @return APR_SUCCESS for success
    - */
    -static apr_status_t crypto_get_block_key_types(apr_hash_t **types,
    -        const apr_crypto_t *f)
    -{
    -    *types = f->types;
    -    return APR_SUCCESS;
    -}
    -
    -/**
    - * @brief Get a hash table of key modes, keyed by the name of the mode against
    - * an integer pointer constant.
    - *
    - * @param modes - hashtable of key modes keyed to constants.
    - * @param f - encryption context
    - * @return APR_SUCCESS for success
    - */
    -static apr_status_t crypto_get_block_key_modes(apr_hash_t **modes,
    -        const apr_crypto_t *f)
    -{
    -    *modes = f->modes;
    -    return APR_SUCCESS;
    -}
    -
    -/**
    - * @brief Create a key from the given passphrase. By default, the PBKDF2
    - *        algorithm is used to generate the key from the passphrase. It is expected
    - *        that the same pass phrase will generate the same key, regardless of the
    - *        backend crypto platform used. The key is cleaned up when the context
    - *        is cleaned, and may be reused with multiple encryption or decryption
    - *        operations.
    - * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If
    - *       *key is not NULL, *key must point at a previously created structure.
    - * @param key The key returned, see note.
    - * @param ivSize The size of the initialisation vector will be returned, based
    - *               on whether an IV is relevant for this type of crypto.
    - * @param pass The passphrase to use.
    - * @param passLen The passphrase length in bytes
    - * @param salt The salt to use.
    - * @param saltLen The salt length in bytes
    - * @param type 3DES_192, AES_128, AES_192, AES_256.
    - * @param mode Electronic Code Book / Cipher Block Chaining.
    - * @param doPad Pad if necessary.
    - * @param iterations Iteration count
    - * @param f The context to use.
    - * @param p The pool to use.
    - * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend
    - *         error occurred while generating the key. APR_ENOCIPHER if the type or mode
    - *         is not supported by the particular backend. APR_EKEYTYPE if the key type is
    - *         not known. APR_EPADDING if padding was requested but is not supported.
    - *         APR_ENOTIMPL if not implemented.
    - */
    -static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize,
    -        const char *pass, apr_size_t passLen, const unsigned char * salt,
    -        apr_size_t saltLen, const apr_crypto_block_key_type_e type,
    -        const apr_crypto_block_key_mode_e mode, const int doPad,
    -        const int iterations, const apr_crypto_t *f, apr_pool_t *p)
    -{
    -    apr_crypto_key_t *key = *k;
    -
    -    if (!key) {
    -        *k = key = apr_array_push(f->keys);
    -    }
    -    if (!key) {
    -        return APR_ENOMEM;
    -    }
    -
    -    key->f = f;
    -    key->provider = f->provider;
    -
    -    /* handle padding */
    -    key->options = doPad ? kCCOptionPKCS7Padding : 0;
    -
    -    /* determine the algorithm to be used */
    -    switch (type) {
    -
    -    case (APR_KEY_3DES_192):
    -
    -        /* A 3DES key */
    -        if (mode == APR_MODE_CBC) {
    -            key->algorithm = kCCAlgorithm3DES;
    -            key->keyLen = kCCKeySize3DES;
    -            key->ivSize = kCCBlockSize3DES;
    -            key->blockSize = kCCBlockSize3DES;
    -        }
    -        else {
    -            key->algorithm = kCCAlgorithm3DES;
    -            key->options += kCCOptionECBMode;
    -            key->keyLen = kCCKeySize3DES;
    -            key->ivSize = 0;
    -            key->blockSize = kCCBlockSize3DES;
    -        }
    -        break;
    -
    -    case (APR_KEY_AES_128):
    -
    -        if (mode == APR_MODE_CBC) {
    -            key->algorithm = kCCAlgorithmAES128;
    -            key->keyLen = kCCKeySizeAES128;
    -            key->ivSize = kCCBlockSizeAES128;
    -            key->blockSize = kCCBlockSizeAES128;
    -        }
    -        else {
    -            key->algorithm = kCCAlgorithmAES128;
    -            key->options += kCCOptionECBMode;
    -            key->keyLen = kCCKeySizeAES128;
    -            key->ivSize = 0;
    -            key->blockSize = kCCBlockSizeAES128;
    -        }
    -        break;
    -
    -    case (APR_KEY_AES_192):
    -
    -        if (mode == APR_MODE_CBC) {
    -            key->algorithm = kCCAlgorithmAES128;
    -            key->keyLen = kCCKeySizeAES192;
    -            key->ivSize = kCCBlockSizeAES128;
    -            key->blockSize = kCCBlockSizeAES128;
    -        }
    -        else {
    -            key->algorithm = kCCAlgorithmAES128;
    -            key->options += kCCOptionECBMode;
    -            key->keyLen = kCCKeySizeAES192;
    -            key->ivSize = 0;
    -            key->blockSize = kCCBlockSizeAES128;
    -        }
    -        break;
    -
    -    case (APR_KEY_AES_256):
    -
    -        if (mode == APR_MODE_CBC) {
    -            key->algorithm = kCCAlgorithmAES128;
    -            key->keyLen = kCCKeySizeAES256;
    -            key->ivSize = kCCBlockSizeAES128;
    -            key->blockSize = kCCBlockSizeAES128;
    -        }
    -        else {
    -            key->algorithm = kCCAlgorithmAES128;
    -            key->options += kCCOptionECBMode;
    -            key->keyLen = kCCKeySizeAES256;
    -            key->ivSize = 0;
    -            key->blockSize = kCCBlockSizeAES128;
    -        }
    -        break;
    -
    -    default:
    -
    -        /* TODO: Support CAST, Blowfish */
    -
    -        /* unknown key type, give up */
    -        return APR_EKEYTYPE;
    -
    -    }
    -
    -    /* make space for the key */
    -    key->key = apr_pcalloc(p, key->keyLen);
    -    if (!key->key) {
    -        return APR_ENOMEM;
    -    }
    -    apr_crypto_clear(p, key->key, key->keyLen);
    -
    -    /* generate the key */
    -    if ((f->result->rc = CCKeyDerivationPBKDF(kCCPBKDF2, pass, passLen, salt,
    -            saltLen, kCCPRFHmacAlgSHA1, iterations, key->key, key->keyLen))
    -            == kCCParamError) {
    -        return APR_ENOKEY;
    -    }
    -
    -    if (ivSize) {
    -        *ivSize = key->ivSize;
    -    }
    -
    -    return APR_SUCCESS;
    -}
    -
    -/**
    - * @brief Initialise a context for encrypting arbitrary data using the given key.
    - * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If
    - *       *ctx is not NULL, *ctx must point at a previously created structure.
    - * @param ctx The block context returned, see note.
    - * @param iv Optional initialisation vector. If the buffer pointed to is NULL,
    - *           an IV will be created at random, in space allocated from the pool.
    - *           If the buffer pointed to is not NULL, the IV in the buffer will be
    - *           used.
    - * @param key The key structure.
    - * @param blockSize The block size of the cipher.
    - * @param p The pool to use.
    - * @return Returns APR_ENOIV if an initialisation vector is required but not specified.
    - *         Returns APR_EINIT if the backend failed to initialise the context. Returns
    - *         APR_ENOTIMPL if not implemented.
    - */
    -static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx,
    -        const unsigned char **iv, const apr_crypto_key_t *key,
    -        apr_size_t *blockSize, apr_pool_t *p)
    -{
    -    unsigned char *usedIv;
    -    apr_crypto_block_t *block = *ctx;
    -    if (!block) {
    -        *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t));
    -    }
    -    if (!block) {
    -        return APR_ENOMEM;
    -    }
    -    block->f = key->f;
    -    block->pool = p;
    -    block->provider = key->provider;
    -    block->key = key;
    -
    -    apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper,
    -            apr_pool_cleanup_null);
    -
    -    /* generate an IV, if necessary */
    -    usedIv = NULL;
    -    if (key->ivSize) {
    -        if (iv == NULL) {
    -            return APR_ENOIV;
    -        }
    -        if (*iv == NULL) {
    -            apr_status_t status;
    -            usedIv = apr_pcalloc(p, key->ivSize);
    -            if (!usedIv) {
    -                return APR_ENOMEM;
    -            }
    -            apr_crypto_clear(p, usedIv, key->ivSize);
    -            status = apr_random_secure_bytes(block->f->rng, usedIv,
    -                    key->ivSize);
    -            if (APR_SUCCESS != status) {
    -                return status;
    -            }
    -            *iv = usedIv;
    -        }
    -        else {
    -            usedIv = (unsigned char *) *iv;
    -        }
    -    }
    -
    -    /* create a new context for encryption */
    -    switch ((block->f->result->rc = CCCryptorCreate(kCCEncrypt, key->algorithm,
    -            key->options, key->key, key->keyLen, usedIv, &block->ref))) {
    -    case kCCSuccess: {
    -        break;
    -    }
    -    case kCCParamError: {
    -        return APR_EINIT;
    -    }
    -    case kCCMemoryFailure: {
    -        return APR_ENOMEM;
    -    }
    -    case kCCAlignmentError: {
    -        return APR_EPADDING;
    -    }
    -    case kCCUnimplemented: {
    -        return APR_ENOTIMPL;
    -    }
    -    default: {
    -        return APR_EINIT;
    -    }
    -    }
    -
    -    if (blockSize) {
    -        *blockSize = key->blockSize;
    -    }
    -
    -    return APR_SUCCESS;
    -
    -}
    -
    -/**
    - * @brief Encrypt data provided by in, write it to out.
    - * @note The number of bytes written will be written to outlen. If
    - *       out is NULL, outlen will contain the maximum size of the
    - *       buffer needed to hold the data, including any data
    - *       generated by apr_crypto_block_encrypt_finish below. If *out points
    - *       to NULL, a buffer sufficiently large will be created from
    - *       the pool provided. If *out points to a not-NULL value, this
    - *       value will be used as a buffer instead.
    - * @param out Address of a buffer to which data will be written,
    - *        see note.
    - * @param outlen Length of the output will be written here.
    - * @param in Address of the buffer to read.
    - * @param inlen Length of the buffer to read.
    - * @param ctx The block context to use.
    - * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if
    - *         not implemented.
    - */
    -static apr_status_t crypto_block_encrypt(unsigned char **out,
    -        apr_size_t *outlen, const unsigned char *in, apr_size_t inlen,
    -        apr_crypto_block_t *ctx)
    -{
    -    apr_size_t outl = *outlen;
    -    unsigned char *buffer;
    -
    -    /* are we after the maximum size of the out buffer? */
    -    if (!out) {
    -        *outlen = CCCryptorGetOutputLength(ctx->ref, inlen, 1);
    -        return APR_SUCCESS;
    -    }
    -
    -    /* must we allocate the output buffer from a pool? */
    -    if (!*out) {
    -        outl = CCCryptorGetOutputLength(ctx->ref, inlen, 1);
    -        buffer = apr_palloc(ctx->pool, outl);
    -        if (!buffer) {
    -            return APR_ENOMEM;
    -        }
    -        apr_crypto_clear(ctx->pool, buffer, outl);
    -        *out = buffer;
    -    }
    -
    -    switch ((ctx->f->result->rc = CCCryptorUpdate(ctx->ref, in, inlen, (*out),
    -            outl, &outl))) {
    -    case kCCSuccess: {
    -        break;
    -    }
    -    case kCCBufferTooSmall: {
    -        return APR_ENOSPACE;
    -    }
    -    default: {
    -        return APR_ECRYPT;
    -    }
    -    }
    -    *outlen = outl;
    -
    -    return APR_SUCCESS;
    -
    -}
    -
    -/**
    - * @brief Encrypt final data block, write it to out.
    - * @note If necessary the final block will be written out after being
    - *       padded. Typically the final block will be written to the
    - *       same buffer used by apr_crypto_block_encrypt, offset by the
    - *       number of bytes returned as actually written by the
    - *       apr_crypto_block_encrypt() call. After this call, the context
    - *       is cleaned and can be reused by apr_crypto_block_encrypt_init().
    - * @param out Address of a buffer to which data will be written. This
    - *            buffer must already exist, and is usually the same
    - *            buffer used by apr_evp_crypt(). See note.
    - * @param outlen Length of the output will be written here.
    - * @param ctx The block context to use.
    - * @return APR_ECRYPT if an error occurred.
    - * @return APR_EPADDING if padding was enabled and the block was incorrectly
    - *         formatted.
    - * @return APR_ENOTIMPL if not implemented.
    - */
    -static apr_status_t crypto_block_encrypt_finish(unsigned char *out,
    -        apr_size_t *outlen, apr_crypto_block_t *ctx)
    -{
    -    apr_size_t len = *outlen;
    -
    -    ctx->f->result->rc = CCCryptorFinal(ctx->ref, out,
    -            CCCryptorGetOutputLength(ctx->ref, 0, 1), &len);
    -
    -    /* always clean up */
    -    crypto_block_cleanup(ctx);
    -
    -    switch (ctx->f->result->rc) {
    -    case kCCSuccess: {
    -        break;
    -    }
    -    case kCCBufferTooSmall: {
    -        return APR_ENOSPACE;
    -    }
    -    case kCCAlignmentError: {
    -        return APR_EPADDING;
    -    }
    -    case kCCDecodeError: {
    -        return APR_ECRYPT;
    -    }
    -    default: {
    -        return APR_ECRYPT;
    -    }
    -    }
    -    *outlen = len;
    -
    -    return APR_SUCCESS;
    -
    -}
    -
    -/**
    - * @brief Initialise a context for decrypting arbitrary data using the given key.
    - * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If
    - *       *ctx is not NULL, *ctx must point at a previously created structure.
    - * @param ctx The block context returned, see note.
    - * @param blockSize The block size of the cipher.
    - * @param iv Optional initialisation vector. If the buffer pointed to is NULL,
    - *           an IV will be created at random, in space allocated from the pool.
    - *           If the buffer is not NULL, the IV in the buffer will be used.
    - * @param key The key structure.
    - * @param p The pool to use.
    - * @return Returns APR_ENOIV if an initialisation vector is required but not specified.
    - *         Returns APR_EINIT if the backend failed to initialise the context. Returns
    - *         APR_ENOTIMPL if not implemented.
    - */
    -static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx,
    -        apr_size_t *blockSize, const unsigned char *iv,
    -        const apr_crypto_key_t *key, apr_pool_t *p)
    -{
    -    apr_crypto_block_t *block = *ctx;
    -    if (!block) {
    -        *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t));
    -    }
    -    if (!block) {
    -        return APR_ENOMEM;
    -    }
    -    block->f = key->f;
    -    block->pool = p;
    -    block->provider = key->provider;
    -
    -    apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper,
    -            apr_pool_cleanup_null);
    -
    -    /* generate an IV, if necessary */
    -    if (key->ivSize) {
    -        if (iv == NULL) {
    -            return APR_ENOIV;
    -        }
    -    }
    -
    -    /* create a new context for decryption */
    -    switch ((block->f->result->rc = CCCryptorCreate(kCCDecrypt, key->algorithm,
    -            key->options, key->key, key->keyLen, iv, &block->ref))) {
    -    case kCCSuccess: {
    -        break;
    -    }
    -    case kCCParamError: {
    -        return APR_EINIT;
    -    }
    -    case kCCMemoryFailure: {
    -        return APR_ENOMEM;
    -    }
    -    case kCCAlignmentError: {
    -        return APR_EPADDING;
    -    }
    -    case kCCUnimplemented: {
    -        return APR_ENOTIMPL;
    -    }
    -    default: {
    -        return APR_EINIT;
    -    }
    -    }
    -
    -    if (blockSize) {
    -        *blockSize = key->blockSize;
    -    }
    -
    -    return APR_SUCCESS;
    -
    -}
    -
    -/**
    - * @brief Decrypt data provided by in, write it to out.
    - * @note The number of bytes written will be written to outlen. If
    - *       out is NULL, outlen will contain the maximum size of the
    - *       buffer needed to hold the data, including any data
    - *       generated by apr_crypto_block_decrypt_finish below. If *out points
    - *       to NULL, a buffer sufficiently large will be created from
    - *       the pool provided. If *out points to a not-NULL value, this
    - *       value will be used as a buffer instead.
    - * @param out Address of a buffer to which data will be written,
    - *        see note.
    - * @param outlen Length of the output will be written here.
    - * @param in Address of the buffer to read.
    - * @param inlen Length of the buffer to read.
    - * @param ctx The block context to use.
    - * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if
    - *         not implemented.
    - */
    -static apr_status_t crypto_block_decrypt(unsigned char **out,
    -        apr_size_t *outlen, const unsigned char *in, apr_size_t inlen,
    -        apr_crypto_block_t *ctx)
    -{
    -    apr_size_t outl = *outlen;
    -    unsigned char *buffer;
    -
    -    /* are we after the maximum size of the out buffer? */
    -    if (!out) {
    -        *outlen = CCCryptorGetOutputLength(ctx->ref, inlen, 1);
    -        return APR_SUCCESS;
    -    }
    -
    -    /* must we allocate the output buffer from a pool? */
    -    if (!*out) {
    -        outl = CCCryptorGetOutputLength(ctx->ref, inlen, 1);
    -        buffer = apr_palloc(ctx->pool, outl);
    -        if (!buffer) {
    -            return APR_ENOMEM;
    -        }
    -        apr_crypto_clear(ctx->pool, buffer, outl);
    -        *out = buffer;
    -    }
    -
    -    switch ((ctx->f->result->rc = CCCryptorUpdate(ctx->ref, in, inlen, (*out),
    -            outl, &outl))) {
    -    case kCCSuccess: {
    -        break;
    -    }
    -    case kCCBufferTooSmall: {
    -        return APR_ENOSPACE;
    -    }
    -    default: {
    -        return APR_ECRYPT;
    -    }
    -    }
    -    *outlen = outl;
    -
    -    return APR_SUCCESS;
    -
    -}
    -
    -/**
    - * @brief Decrypt final data block, write it to out.
    - * @note If necessary the final block will be written out after being
    - *       padded. Typically the final block will be written to the
    - *       same buffer used by apr_crypto_block_decrypt, offset by the
    - *       number of bytes returned as actually written by the
    - *       apr_crypto_block_decrypt() call. After this call, the context
    - *       is cleaned and can be reused by apr_crypto_block_decrypt_init().
    - * @param out Address of a buffer to which data will be written. This
    - *            buffer must already exist, and is usually the same
    - *            buffer used by apr_evp_crypt(). See note.
    - * @param outlen Length of the output will be written here.
    - * @param ctx The block context to use.
    - * @return APR_ECRYPT if an error occurred.
    - * @return APR_EPADDING if padding was enabled and the block was incorrectly
    - *         formatted.
    - * @return APR_ENOTIMPL if not implemented.
    - */
    -static apr_status_t crypto_block_decrypt_finish(unsigned char *out,
    -        apr_size_t *outlen, apr_crypto_block_t *ctx)
    -{
    -    apr_size_t len = *outlen;
    -
    -    ctx->f->result->rc = CCCryptorFinal(ctx->ref, out,
    -            CCCryptorGetOutputLength(ctx->ref, 0, 1), &len);
    -
    -    /* always clean up */
    -    crypto_block_cleanup(ctx);
    -
    -    switch (ctx->f->result->rc) {
    -    case kCCSuccess: {
    -        break;
    -    }
    -    case kCCBufferTooSmall: {
    -        return APR_ENOSPACE;
    -    }
    -    case kCCAlignmentError: {
    -        return APR_EPADDING;
    -    }
    -    case kCCDecodeError: {
    -        return APR_ECRYPT;
    -    }
    -    default: {
    -        return APR_ECRYPT;
    -    }
    -    }
    -    *outlen = len;
    -
    -    return APR_SUCCESS;
    -
    -}
    -
    -/**
    - * OSX Common Crypto module.
    - */
    -APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_commoncrypto_driver =
    -{
    -        "commoncrypto", crypto_init, crypto_make, crypto_get_block_key_types,
    -        crypto_get_block_key_modes, crypto_passphrase,
    -        crypto_block_encrypt_init, crypto_block_encrypt,
    -        crypto_block_encrypt_finish, crypto_block_decrypt_init,
    -        crypto_block_decrypt, crypto_block_decrypt_finish, crypto_block_cleanup,
    -        crypto_cleanup, crypto_shutdown, crypto_error
    -};
    -
    -#endif
    +/* Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +#include "apr_lib.h"
    +#include "apu.h"
    +#include "apr_private.h"
    +#include "apu_errno.h"
    +
    +#include 
    +#include 
    +#include 
    +
    +#include "apr_strings.h"
    +#include "apr_time.h"
    +#include "apr_buckets.h"
    +#include "apr_random.h"
    +
    +#include "apr_crypto_internal.h"
    +
    +#if APU_HAVE_CRYPTO
    +
    +#include 
    +
    +#define LOG_PREFIX "apr_crypto_commoncrypto: "
    +
    +struct apr_crypto_t
    +{
    +    apr_pool_t *pool;
    +    const apr_crypto_driver_t *provider;
    +    apu_err_t *result;
    +    apr_array_header_t *keys;
    +    apr_hash_t *types;
    +    apr_hash_t *modes;
    +    apr_random_t *rng;
    +};
    +
    +struct apr_crypto_key_t
    +{
    +    apr_pool_t *pool;
    +    const apr_crypto_driver_t *provider;
    +    const apr_crypto_t *f;
    +    CCAlgorithm algorithm;
    +    CCOptions options;
    +    unsigned char *key;
    +    int keyLen;
    +    int ivSize;
    +    apr_size_t blockSize;
    +};
    +
    +struct apr_crypto_block_t
    +{
    +    apr_pool_t *pool;
    +    const apr_crypto_driver_t *provider;
    +    const apr_crypto_t *f;
    +    const apr_crypto_key_t *key;
    +    CCCryptorRef ref;
    +};
    +
    +static int key_3des_192 = APR_KEY_3DES_192;
    +static int key_aes_128 = APR_KEY_AES_128;
    +static int key_aes_192 = APR_KEY_AES_192;
    +static int key_aes_256 = APR_KEY_AES_256;
    +
    +static int mode_ecb = APR_MODE_ECB;
    +static int mode_cbc = APR_MODE_CBC;
    +
    +/**
    + * Fetch the most recent error from this driver.
    + */
    +static apr_status_t crypto_error(const apu_err_t **result,
    +        const apr_crypto_t *f)
    +{
    +    *result = f->result;
    +    return APR_SUCCESS;
    +}
    +
    +/**
    + * Shutdown the crypto library and release resources.
    + */
    +static apr_status_t crypto_shutdown(void)
    +{
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t crypto_shutdown_helper(void *data)
    +{
    +    return crypto_shutdown();
    +}
    +
    +/**
    + * Initialise the crypto library and perform one time initialisation.
    + */
    +static apr_status_t crypto_init(apr_pool_t *pool, const char *params,
    +        const apu_err_t **result)
    +{
    +
    +    apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper,
    +            apr_pool_cleanup_null);
    +
    +    return APR_SUCCESS;
    +}
    +
    +/**
    + * @brief Clean encryption / decryption context.
    + * @note After cleanup, a context is free to be reused if necessary.
    + * @param ctx The block context to use.
    + * @return Returns APR_ENOTIMPL if not supported.
    + */
    +static apr_status_t crypto_block_cleanup(apr_crypto_block_t *ctx)
    +{
    +
    +    if (ctx->ref) {
    +        CCCryptorRelease(ctx->ref);
    +        ctx->ref = NULL;
    +    }
    +
    +    return APR_SUCCESS;
    +
    +}
    +
    +static apr_status_t crypto_block_cleanup_helper(void *data)
    +{
    +    apr_crypto_block_t *block = (apr_crypto_block_t *) data;
    +    return crypto_block_cleanup(block);
    +}
    +
    +/**
    + * @brief Clean encryption / decryption context.
    + * @note After cleanup, a context is free to be reused if necessary.
    + * @param f The context to use.
    + * @return Returns APR_ENOTIMPL if not supported.
    + */
    +static apr_status_t crypto_cleanup(apr_crypto_t *f)
    +{
    +
    +    return APR_SUCCESS;
    +
    +}
    +
    +static apr_status_t crypto_cleanup_helper(void *data)
    +{
    +    apr_crypto_t *f = (apr_crypto_t *) data;
    +    return crypto_cleanup(f);
    +}
    +
    +/**
    + * @brief Create a context for supporting encryption. Keys, certificates,
    + *        algorithms and other parameters will be set per context. More than
    + *        one context can be created at one time. A cleanup will be automatically
    + *        registered with the given pool to guarantee a graceful shutdown.
    + * @param f - context pointer will be written here
    + * @param provider - provider to use
    + * @param params - array of key parameters
    + * @param pool - process pool
    + * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE
    + * if the engine cannot be initialised.
    + */
    +static apr_status_t crypto_make(apr_crypto_t **ff,
    +        const apr_crypto_driver_t *provider, const char *params,
    +        apr_pool_t *pool)
    +{
    +    apr_crypto_t *f = apr_pcalloc(pool, sizeof(apr_crypto_t));
    +    apr_status_t rv;
    +
    +    if (!f) {
    +        return APR_ENOMEM;
    +    }
    +    *ff = f;
    +    f->pool = pool;
    +    f->provider = provider;
    +
    +    /* seed the secure random number generator */
    +    f->rng = apr_random_standard_new(pool);
    +    if (!f->rng) {
    +        return APR_ENOMEM;
    +    }
    +    do {
    +        unsigned char seed[8];
    +        rv = apr_generate_random_bytes(seed, sizeof(seed));
    +        if (rv != APR_SUCCESS) {
    +            return rv;
    +        }
    +        apr_random_add_entropy(f->rng, seed, sizeof(seed));
    +        rv = apr_random_secure_ready(f->rng);
    +    } while (rv == APR_ENOTENOUGHENTROPY);
    +
    +    f->result = apr_pcalloc(pool, sizeof(apu_err_t));
    +    if (!f->result) {
    +        return APR_ENOMEM;
    +    }
    +
    +    f->keys = apr_array_make(pool, 10, sizeof(apr_crypto_key_t));
    +    if (!f->keys) {
    +        return APR_ENOMEM;
    +    }
    +
    +    f->types = apr_hash_make(pool);
    +    if (!f->types) {
    +        return APR_ENOMEM;
    +    }
    +    apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_3des_192));
    +    apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_aes_128));
    +    apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_aes_192));
    +    apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_aes_256));
    +
    +    f->modes = apr_hash_make(pool);
    +    if (!f->modes) {
    +        return APR_ENOMEM;
    +    }
    +    apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(mode_ecb));
    +    apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(mode_cbc));
    +
    +    apr_pool_cleanup_register(pool, f, crypto_cleanup_helper,
    +            apr_pool_cleanup_null);
    +
    +    return APR_SUCCESS;
    +
    +}
    +
    +/**
    + * @brief Get a hash table of key types, keyed by the name of the type against
    + * an integer pointer constant.
    + *
    + * @param types - hashtable of key types keyed to constants.
    + * @param f - encryption context
    + * @return APR_SUCCESS for success
    + */
    +static apr_status_t crypto_get_block_key_types(apr_hash_t **types,
    +        const apr_crypto_t *f)
    +{
    +    *types = f->types;
    +    return APR_SUCCESS;
    +}
    +
    +/**
    + * @brief Get a hash table of key modes, keyed by the name of the mode against
    + * an integer pointer constant.
    + *
    + * @param modes - hashtable of key modes keyed to constants.
    + * @param f - encryption context
    + * @return APR_SUCCESS for success
    + */
    +static apr_status_t crypto_get_block_key_modes(apr_hash_t **modes,
    +        const apr_crypto_t *f)
    +{
    +    *modes = f->modes;
    +    return APR_SUCCESS;
    +}
    +
    +/**
    + * @brief Create a key from the given passphrase. By default, the PBKDF2
    + *        algorithm is used to generate the key from the passphrase. It is expected
    + *        that the same pass phrase will generate the same key, regardless of the
    + *        backend crypto platform used. The key is cleaned up when the context
    + *        is cleaned, and may be reused with multiple encryption or decryption
    + *        operations.
    + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If
    + *       *key is not NULL, *key must point at a previously created structure.
    + * @param key The key returned, see note.
    + * @param ivSize The size of the initialisation vector will be returned, based
    + *               on whether an IV is relevant for this type of crypto.
    + * @param pass The passphrase to use.
    + * @param passLen The passphrase length in bytes
    + * @param salt The salt to use.
    + * @param saltLen The salt length in bytes
    + * @param type 3DES_192, AES_128, AES_192, AES_256.
    + * @param mode Electronic Code Book / Cipher Block Chaining.
    + * @param doPad Pad if necessary.
    + * @param iterations Iteration count
    + * @param f The context to use.
    + * @param p The pool to use.
    + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend
    + *         error occurred while generating the key. APR_ENOCIPHER if the type or mode
    + *         is not supported by the particular backend. APR_EKEYTYPE if the key type is
    + *         not known. APR_EPADDING if padding was requested but is not supported.
    + *         APR_ENOTIMPL if not implemented.
    + */
    +static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize,
    +        const char *pass, apr_size_t passLen, const unsigned char * salt,
    +        apr_size_t saltLen, const apr_crypto_block_key_type_e type,
    +        const apr_crypto_block_key_mode_e mode, const int doPad,
    +        const int iterations, const apr_crypto_t *f, apr_pool_t *p)
    +{
    +    apr_crypto_key_t *key = *k;
    +
    +    if (!key) {
    +        *k = key = apr_array_push(f->keys);
    +    }
    +    if (!key) {
    +        return APR_ENOMEM;
    +    }
    +
    +    key->f = f;
    +    key->provider = f->provider;
    +
    +    /* handle padding */
    +    key->options = doPad ? kCCOptionPKCS7Padding : 0;
    +
    +    /* determine the algorithm to be used */
    +    switch (type) {
    +
    +    case (APR_KEY_3DES_192):
    +
    +        /* A 3DES key */
    +        if (mode == APR_MODE_CBC) {
    +            key->algorithm = kCCAlgorithm3DES;
    +            key->keyLen = kCCKeySize3DES;
    +            key->ivSize = kCCBlockSize3DES;
    +            key->blockSize = kCCBlockSize3DES;
    +        }
    +        else {
    +            key->algorithm = kCCAlgorithm3DES;
    +            key->options += kCCOptionECBMode;
    +            key->keyLen = kCCKeySize3DES;
    +            key->ivSize = 0;
    +            key->blockSize = kCCBlockSize3DES;
    +        }
    +        break;
    +
    +    case (APR_KEY_AES_128):
    +
    +        if (mode == APR_MODE_CBC) {
    +            key->algorithm = kCCAlgorithmAES128;
    +            key->keyLen = kCCKeySizeAES128;
    +            key->ivSize = kCCBlockSizeAES128;
    +            key->blockSize = kCCBlockSizeAES128;
    +        }
    +        else {
    +            key->algorithm = kCCAlgorithmAES128;
    +            key->options += kCCOptionECBMode;
    +            key->keyLen = kCCKeySizeAES128;
    +            key->ivSize = 0;
    +            key->blockSize = kCCBlockSizeAES128;
    +        }
    +        break;
    +
    +    case (APR_KEY_AES_192):
    +
    +        if (mode == APR_MODE_CBC) {
    +            key->algorithm = kCCAlgorithmAES128;
    +            key->keyLen = kCCKeySizeAES192;
    +            key->ivSize = kCCBlockSizeAES128;
    +            key->blockSize = kCCBlockSizeAES128;
    +        }
    +        else {
    +            key->algorithm = kCCAlgorithmAES128;
    +            key->options += kCCOptionECBMode;
    +            key->keyLen = kCCKeySizeAES192;
    +            key->ivSize = 0;
    +            key->blockSize = kCCBlockSizeAES128;
    +        }
    +        break;
    +
    +    case (APR_KEY_AES_256):
    +
    +        if (mode == APR_MODE_CBC) {
    +            key->algorithm = kCCAlgorithmAES128;
    +            key->keyLen = kCCKeySizeAES256;
    +            key->ivSize = kCCBlockSizeAES128;
    +            key->blockSize = kCCBlockSizeAES128;
    +        }
    +        else {
    +            key->algorithm = kCCAlgorithmAES128;
    +            key->options += kCCOptionECBMode;
    +            key->keyLen = kCCKeySizeAES256;
    +            key->ivSize = 0;
    +            key->blockSize = kCCBlockSizeAES128;
    +        }
    +        break;
    +
    +    default:
    +
    +        /* TODO: Support CAST, Blowfish */
    +
    +        /* unknown key type, give up */
    +        return APR_EKEYTYPE;
    +
    +    }
    +
    +    /* make space for the key */
    +    key->key = apr_pcalloc(p, key->keyLen);
    +    if (!key->key) {
    +        return APR_ENOMEM;
    +    }
    +    apr_crypto_clear(p, key->key, key->keyLen);
    +
    +    /* generate the key */
    +    if ((f->result->rc = CCKeyDerivationPBKDF(kCCPBKDF2, pass, passLen, salt,
    +            saltLen, kCCPRFHmacAlgSHA1, iterations, key->key, key->keyLen))
    +            == kCCParamError) {
    +        return APR_ENOKEY;
    +    }
    +
    +    if (ivSize) {
    +        *ivSize = key->ivSize;
    +    }
    +
    +    return APR_SUCCESS;
    +}
    +
    +/**
    + * @brief Initialise a context for encrypting arbitrary data using the given key.
    + * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If
    + *       *ctx is not NULL, *ctx must point at a previously created structure.
    + * @param ctx The block context returned, see note.
    + * @param iv Optional initialisation vector. If the buffer pointed to is NULL,
    + *           an IV will be created at random, in space allocated from the pool.
    + *           If the buffer pointed to is not NULL, the IV in the buffer will be
    + *           used.
    + * @param key The key structure.
    + * @param blockSize The block size of the cipher.
    + * @param p The pool to use.
    + * @return Returns APR_ENOIV if an initialisation vector is required but not specified.
    + *         Returns APR_EINIT if the backend failed to initialise the context. Returns
    + *         APR_ENOTIMPL if not implemented.
    + */
    +static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx,
    +        const unsigned char **iv, const apr_crypto_key_t *key,
    +        apr_size_t *blockSize, apr_pool_t *p)
    +{
    +    unsigned char *usedIv;
    +    apr_crypto_block_t *block = *ctx;
    +    if (!block) {
    +        *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t));
    +    }
    +    if (!block) {
    +        return APR_ENOMEM;
    +    }
    +    block->f = key->f;
    +    block->pool = p;
    +    block->provider = key->provider;
    +    block->key = key;
    +
    +    apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper,
    +            apr_pool_cleanup_null);
    +
    +    /* generate an IV, if necessary */
    +    usedIv = NULL;
    +    if (key->ivSize) {
    +        if (iv == NULL) {
    +            return APR_ENOIV;
    +        }
    +        if (*iv == NULL) {
    +            apr_status_t status;
    +            usedIv = apr_pcalloc(p, key->ivSize);
    +            if (!usedIv) {
    +                return APR_ENOMEM;
    +            }
    +            apr_crypto_clear(p, usedIv, key->ivSize);
    +            status = apr_random_secure_bytes(block->f->rng, usedIv,
    +                    key->ivSize);
    +            if (APR_SUCCESS != status) {
    +                return status;
    +            }
    +            *iv = usedIv;
    +        }
    +        else {
    +            usedIv = (unsigned char *) *iv;
    +        }
    +    }
    +
    +    /* create a new context for encryption */
    +    switch ((block->f->result->rc = CCCryptorCreate(kCCEncrypt, key->algorithm,
    +            key->options, key->key, key->keyLen, usedIv, &block->ref))) {
    +    case kCCSuccess: {
    +        break;
    +    }
    +    case kCCParamError: {
    +        return APR_EINIT;
    +    }
    +    case kCCMemoryFailure: {
    +        return APR_ENOMEM;
    +    }
    +    case kCCAlignmentError: {
    +        return APR_EPADDING;
    +    }
    +    case kCCUnimplemented: {
    +        return APR_ENOTIMPL;
    +    }
    +    default: {
    +        return APR_EINIT;
    +    }
    +    }
    +
    +    if (blockSize) {
    +        *blockSize = key->blockSize;
    +    }
    +
    +    return APR_SUCCESS;
    +
    +}
    +
    +/**
    + * @brief Encrypt data provided by in, write it to out.
    + * @note The number of bytes written will be written to outlen. If
    + *       out is NULL, outlen will contain the maximum size of the
    + *       buffer needed to hold the data, including any data
    + *       generated by apr_crypto_block_encrypt_finish below. If *out points
    + *       to NULL, a buffer sufficiently large will be created from
    + *       the pool provided. If *out points to a not-NULL value, this
    + *       value will be used as a buffer instead.
    + * @param out Address of a buffer to which data will be written,
    + *        see note.
    + * @param outlen Length of the output will be written here.
    + * @param in Address of the buffer to read.
    + * @param inlen Length of the buffer to read.
    + * @param ctx The block context to use.
    + * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if
    + *         not implemented.
    + */
    +static apr_status_t crypto_block_encrypt(unsigned char **out,
    +        apr_size_t *outlen, const unsigned char *in, apr_size_t inlen,
    +        apr_crypto_block_t *ctx)
    +{
    +    apr_size_t outl = *outlen;
    +    unsigned char *buffer;
    +
    +    /* are we after the maximum size of the out buffer? */
    +    if (!out) {
    +        *outlen = CCCryptorGetOutputLength(ctx->ref, inlen, 1);
    +        return APR_SUCCESS;
    +    }
    +
    +    /* must we allocate the output buffer from a pool? */
    +    if (!*out) {
    +        outl = CCCryptorGetOutputLength(ctx->ref, inlen, 1);
    +        buffer = apr_palloc(ctx->pool, outl);
    +        if (!buffer) {
    +            return APR_ENOMEM;
    +        }
    +        apr_crypto_clear(ctx->pool, buffer, outl);
    +        *out = buffer;
    +    }
    +
    +    switch ((ctx->f->result->rc = CCCryptorUpdate(ctx->ref, in, inlen, (*out),
    +            outl, &outl))) {
    +    case kCCSuccess: {
    +        break;
    +    }
    +    case kCCBufferTooSmall: {
    +        return APR_ENOSPACE;
    +    }
    +    default: {
    +        return APR_ECRYPT;
    +    }
    +    }
    +    *outlen = outl;
    +
    +    return APR_SUCCESS;
    +
    +}
    +
    +/**
    + * @brief Encrypt final data block, write it to out.
    + * @note If necessary the final block will be written out after being
    + *       padded. Typically the final block will be written to the
    + *       same buffer used by apr_crypto_block_encrypt, offset by the
    + *       number of bytes returned as actually written by the
    + *       apr_crypto_block_encrypt() call. After this call, the context
    + *       is cleaned and can be reused by apr_crypto_block_encrypt_init().
    + * @param out Address of a buffer to which data will be written. This
    + *            buffer must already exist, and is usually the same
    + *            buffer used by apr_evp_crypt(). See note.
    + * @param outlen Length of the output will be written here.
    + * @param ctx The block context to use.
    + * @return APR_ECRYPT if an error occurred.
    + * @return APR_EPADDING if padding was enabled and the block was incorrectly
    + *         formatted.
    + * @return APR_ENOTIMPL if not implemented.
    + */
    +static apr_status_t crypto_block_encrypt_finish(unsigned char *out,
    +        apr_size_t *outlen, apr_crypto_block_t *ctx)
    +{
    +    apr_size_t len = *outlen;
    +
    +    ctx->f->result->rc = CCCryptorFinal(ctx->ref, out,
    +            CCCryptorGetOutputLength(ctx->ref, 0, 1), &len);
    +
    +    /* always clean up */
    +    crypto_block_cleanup(ctx);
    +
    +    switch (ctx->f->result->rc) {
    +    case kCCSuccess: {
    +        break;
    +    }
    +    case kCCBufferTooSmall: {
    +        return APR_ENOSPACE;
    +    }
    +    case kCCAlignmentError: {
    +        return APR_EPADDING;
    +    }
    +    case kCCDecodeError: {
    +        return APR_ECRYPT;
    +    }
    +    default: {
    +        return APR_ECRYPT;
    +    }
    +    }
    +    *outlen = len;
    +
    +    return APR_SUCCESS;
    +
    +}
    +
    +/**
    + * @brief Initialise a context for decrypting arbitrary data using the given key.
    + * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If
    + *       *ctx is not NULL, *ctx must point at a previously created structure.
    + * @param ctx The block context returned, see note.
    + * @param blockSize The block size of the cipher.
    + * @param iv Optional initialisation vector. If the buffer pointed to is NULL,
    + *           an IV will be created at random, in space allocated from the pool.
    + *           If the buffer is not NULL, the IV in the buffer will be used.
    + * @param key The key structure.
    + * @param p The pool to use.
    + * @return Returns APR_ENOIV if an initialisation vector is required but not specified.
    + *         Returns APR_EINIT if the backend failed to initialise the context. Returns
    + *         APR_ENOTIMPL if not implemented.
    + */
    +static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx,
    +        apr_size_t *blockSize, const unsigned char *iv,
    +        const apr_crypto_key_t *key, apr_pool_t *p)
    +{
    +    apr_crypto_block_t *block = *ctx;
    +    if (!block) {
    +        *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t));
    +    }
    +    if (!block) {
    +        return APR_ENOMEM;
    +    }
    +    block->f = key->f;
    +    block->pool = p;
    +    block->provider = key->provider;
    +
    +    apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper,
    +            apr_pool_cleanup_null);
    +
    +    /* generate an IV, if necessary */
    +    if (key->ivSize) {
    +        if (iv == NULL) {
    +            return APR_ENOIV;
    +        }
    +    }
    +
    +    /* create a new context for decryption */
    +    switch ((block->f->result->rc = CCCryptorCreate(kCCDecrypt, key->algorithm,
    +            key->options, key->key, key->keyLen, iv, &block->ref))) {
    +    case kCCSuccess: {
    +        break;
    +    }
    +    case kCCParamError: {
    +        return APR_EINIT;
    +    }
    +    case kCCMemoryFailure: {
    +        return APR_ENOMEM;
    +    }
    +    case kCCAlignmentError: {
    +        return APR_EPADDING;
    +    }
    +    case kCCUnimplemented: {
    +        return APR_ENOTIMPL;
    +    }
    +    default: {
    +        return APR_EINIT;
    +    }
    +    }
    +
    +    if (blockSize) {
    +        *blockSize = key->blockSize;
    +    }
    +
    +    return APR_SUCCESS;
    +
    +}
    +
    +/**
    + * @brief Decrypt data provided by in, write it to out.
    + * @note The number of bytes written will be written to outlen. If
    + *       out is NULL, outlen will contain the maximum size of the
    + *       buffer needed to hold the data, including any data
    + *       generated by apr_crypto_block_decrypt_finish below. If *out points
    + *       to NULL, a buffer sufficiently large will be created from
    + *       the pool provided. If *out points to a not-NULL value, this
    + *       value will be used as a buffer instead.
    + * @param out Address of a buffer to which data will be written,
    + *        see note.
    + * @param outlen Length of the output will be written here.
    + * @param in Address of the buffer to read.
    + * @param inlen Length of the buffer to read.
    + * @param ctx The block context to use.
    + * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if
    + *         not implemented.
    + */
    +static apr_status_t crypto_block_decrypt(unsigned char **out,
    +        apr_size_t *outlen, const unsigned char *in, apr_size_t inlen,
    +        apr_crypto_block_t *ctx)
    +{
    +    apr_size_t outl = *outlen;
    +    unsigned char *buffer;
    +
    +    /* are we after the maximum size of the out buffer? */
    +    if (!out) {
    +        *outlen = CCCryptorGetOutputLength(ctx->ref, inlen, 1);
    +        return APR_SUCCESS;
    +    }
    +
    +    /* must we allocate the output buffer from a pool? */
    +    if (!*out) {
    +        outl = CCCryptorGetOutputLength(ctx->ref, inlen, 1);
    +        buffer = apr_palloc(ctx->pool, outl);
    +        if (!buffer) {
    +            return APR_ENOMEM;
    +        }
    +        apr_crypto_clear(ctx->pool, buffer, outl);
    +        *out = buffer;
    +    }
    +
    +    switch ((ctx->f->result->rc = CCCryptorUpdate(ctx->ref, in, inlen, (*out),
    +            outl, &outl))) {
    +    case kCCSuccess: {
    +        break;
    +    }
    +    case kCCBufferTooSmall: {
    +        return APR_ENOSPACE;
    +    }
    +    default: {
    +        return APR_ECRYPT;
    +    }
    +    }
    +    *outlen = outl;
    +
    +    return APR_SUCCESS;
    +
    +}
    +
    +/**
    + * @brief Decrypt final data block, write it to out.
    + * @note If necessary the final block will be written out after being
    + *       padded. Typically the final block will be written to the
    + *       same buffer used by apr_crypto_block_decrypt, offset by the
    + *       number of bytes returned as actually written by the
    + *       apr_crypto_block_decrypt() call. After this call, the context
    + *       is cleaned and can be reused by apr_crypto_block_decrypt_init().
    + * @param out Address of a buffer to which data will be written. This
    + *            buffer must already exist, and is usually the same
    + *            buffer used by apr_evp_crypt(). See note.
    + * @param outlen Length of the output will be written here.
    + * @param ctx The block context to use.
    + * @return APR_ECRYPT if an error occurred.
    + * @return APR_EPADDING if padding was enabled and the block was incorrectly
    + *         formatted.
    + * @return APR_ENOTIMPL if not implemented.
    + */
    +static apr_status_t crypto_block_decrypt_finish(unsigned char *out,
    +        apr_size_t *outlen, apr_crypto_block_t *ctx)
    +{
    +    apr_size_t len = *outlen;
    +
    +    ctx->f->result->rc = CCCryptorFinal(ctx->ref, out,
    +            CCCryptorGetOutputLength(ctx->ref, 0, 1), &len);
    +
    +    /* always clean up */
    +    crypto_block_cleanup(ctx);
    +
    +    switch (ctx->f->result->rc) {
    +    case kCCSuccess: {
    +        break;
    +    }
    +    case kCCBufferTooSmall: {
    +        return APR_ENOSPACE;
    +    }
    +    case kCCAlignmentError: {
    +        return APR_EPADDING;
    +    }
    +    case kCCDecodeError: {
    +        return APR_ECRYPT;
    +    }
    +    default: {
    +        return APR_ECRYPT;
    +    }
    +    }
    +    *outlen = len;
    +
    +    return APR_SUCCESS;
    +
    +}
    +
    +/**
    + * OSX Common Crypto module.
    + */
    +APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_commoncrypto_driver =
    +{
    +        "commoncrypto", crypto_init, crypto_make, crypto_get_block_key_types,
    +        crypto_get_block_key_modes, crypto_passphrase,
    +        crypto_block_encrypt_init, crypto_block_encrypt,
    +        crypto_block_encrypt_finish, crypto_block_decrypt_init,
    +        crypto_block_decrypt, crypto_block_decrypt_finish, crypto_block_cleanup,
    +        crypto_cleanup, crypto_shutdown, crypto_error
    +};
    +
    +#endif
    
    From de4b8d29a234b1e24d0bc90d2fa73ebea939fc44 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 2 Nov 2013 11:01:38 +0000
    Subject: [PATCH 7360/7878] APR_FOPEN_NONBLOCK is in 1.5.x branch
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1538168 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 4 ----
     1 file changed, 4 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index ae24c65f61c..dd4c17bf05e 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -30,10 +30,6 @@ Changes for APR 2.0.0
       *) Hide apr_wait_for_io_or_timeout() from public view and add instead
          apr_socket_wait() and apr_file_pipe_wait(). [Brian Havard]
     
    -  *) Enable platform specific support for the opening of a file or
    -     pipe in non-blocking mode through the APR_FOPEN_NONBLOCK flag.
    -     [Graham Leggett]
    -
       *) Support connecttimeout, readtimeout and writetimeout MySQL options
          PR 48251 [Marko Kevac ]
     
    
    From 5aba3825bdb3c625fae2a0c2ccaa56c4e5a55751 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 2 Nov 2013 11:17:54 +0000
    Subject: [PATCH 7361/7878] APR_FOPEN_NONBLOCK is expected to be critical for
     an app that uses it; return APR_ENOTIMPL instead of ignoring it if not
     supported.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1538171 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/os2/open.c    | 4 ++++
     file_io/unix/open.c   | 6 ++++--
     file_io/win32/open.c  | 3 +++
     include/apr_file_io.h | 4 ++++
     4 files changed, 15 insertions(+), 2 deletions(-)
    
    diff --git a/file_io/os2/open.c b/file_io/os2/open.c
    index cd629dc8e7f..996e68bb994 100644
    --- a/file_io/os2/open.c
    +++ b/file_io/os2/open.c
    @@ -38,6 +38,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr
         ULONG action;
         apr_file_t *dafile = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t));
     
    +    if (flag & APR_FOPEN_NONBLOCK) {
    +        return APR_ENOTIMPL;
    +    }
    +
         dafile->pool = pool;
         dafile->isopen = FALSE;
         dafile->eof_hit = FALSE;
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index b7e5bd8981c..1e7b5118301 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -136,11 +136,13 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
         }
     #endif
     
    -#ifdef O_NONBLOCK
         if (flag & APR_FOPEN_NONBLOCK) {
    +#ifdef O_NONBLOCK
             oflags |= O_NONBLOCK;
    -    }
    +#else
    +        return APR_ENOTIMPL;
     #endif
    +    }
     
     #ifdef O_CLOEXEC
         /* Introduced in Linux 2.6.23. Silently ignored on earlier Linux kernels.
    diff --git a/file_io/win32/open.c b/file_io/win32/open.c
    index 55397ca6906..b668645bb15 100644
    --- a/file_io/win32/open.c
    +++ b/file_io/win32/open.c
    @@ -329,6 +329,9 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname,
         DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE;
         apr_status_t rv;
     
    +    if (flag & APR_FOPEN_NONBLOCK) {
    +        return APR_ENOTIMPL;
    +    }
         if (flag & APR_FOPEN_READ) {
             oflags |= GENERIC_READ;
         }
    diff --git a/include/apr_file_io.h b/include/apr_file_io.h
    index 61b58ffb569..ea5c66f472e 100644
    --- a/include/apr_file_io.h
    +++ b/include/apr_file_io.h
    @@ -134,6 +134,10 @@ extern "C" {
      * if it was previously created and written without the sparse flag.
      * On platforms which do not understand, or on file systems which
      * cannot handle sparse files, the flag is ignored by apr_file_open().
    + *
    + * @def APR_FOPEN_NONBLOCK
    + * @warning APR_FOPEN_NONBLOCK is not implemented on all platforms.
    + * Callers should be prepared for it to fail with #APR_ENOTIMPL.
      */
     
     /** @} */
    
    From 96539621e386520ff236a1fa1f29a6d9b4cbbb41 Mon Sep 17 00:00:00 2001
    From: Stefan Fritsch 
    Date: Wed, 6 Nov 2013 15:54:40 +0000
    Subject: [PATCH 7362/7878] Use fcntl instead of SOCK_NONBLOCK to make socket
     nonblocking in accept4 check.
    
    There are platforms (e.g. Hurd) that support SOCK_NONBLOCK only
    with accept4(), but not with socket(). See
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=715028
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1539374 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 8 ++++++--
     1 file changed, 6 insertions(+), 2 deletions(-)
    
    diff --git a/configure.in b/configure.in
    index 55c395242ee..157954bb01d 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -961,13 +961,17 @@ AC_CACHE_CHECK([for accept4 support], [apr_cv_accept4],
     #include 
     #include 
     #include 
    +#include 
     
     int main(int argc, char **argv)
     {
    -    int fd;
    +    int fd, flags;
         struct sockaddr_in sin;
     
    -    if ((fd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0)) == -1)
    +    if ((fd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
    +        return 1;
    +    if (fcntl(fd, F_GETFL, &flags) == -1 ||
    +        fcntl(fd, F_SETFL, flags|O_NONBLOCK) == -1)
             return 1;
     
         memset(&sin, 0, sizeof sin);
    
    From 1f3812baf850fe7db8b76c308032eb59cead0669 Mon Sep 17 00:00:00 2001
    From: Stefan Fritsch 
    Date: Wed, 6 Nov 2013 16:38:06 +0000
    Subject: [PATCH 7363/7878] Fix fcntl(fd, F_GETFL) call in r1539374
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1539389 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/configure.in b/configure.in
    index 157954bb01d..eaebac83654 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -970,9 +970,9 @@ int main(int argc, char **argv)
     
         if ((fd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
             return 1;
    -    if (fcntl(fd, F_GETFL, &flags) == -1 ||
    -        fcntl(fd, F_SETFL, flags|O_NONBLOCK) == -1)
    -        return 1;
    +    flags = fcntl(fd, F_GETFL);
    +    if (flags == -1 || fcntl(fd, F_SETFL, flags|O_NONBLOCK) == -1)
    +        return 5;
     
         memset(&sin, 0, sizeof sin);
         sin.sin_family = AF_INET;
    
    From 6834d818fcde7847ebf7a5467e661d16fee0dd37 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 6 Nov 2013 20:48:18 +0000
    Subject: [PATCH 7364/7878] apr_file_dup2() on Windows: Fix debug RTL assertion
     when attempting to _commit(stdout) or _commit(stderr).
    
    Submitted by: Mike Rumph 
    Reviewed by trawick, who adjusted the patch to remove the existing _commit(stdin)
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1539455 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filedup.c | 9 ++++++---
     1 file changed, 6 insertions(+), 3 deletions(-)
    
    diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c
    index 058e0e6cb00..eaafaff4290 100644
    --- a/file_io/win32/filedup.c
    +++ b/file_io/win32/filedup.c
    @@ -88,7 +88,9 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file,
                  */
                 fflush(stderr);
                 setvbuf(stderr, NULL, _IONBF, 0);
    -            _commit(2 /* stderr */);
    +            if (!_isatty(2)) {
    +                _commit(2 /* stderr */);
    +            }
     
                 /* Clone a handle can _close() without harming the source handle,
                  * open an MSVCRT-based pseudo-fd for the file handle, then dup2
    @@ -118,7 +120,9 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file,
                 /* For the process flow see the stderr case above */
                 fflush(stdout);
                 setvbuf(stdout, NULL, _IONBF, 0);
    -            _commit(1 /* stdout */);
    +            if (!_isatty(1)) {
    +                _commit(1 /* stdout */);
    +            }
     
                 if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand,
                                      0, FALSE, DUPLICATE_SAME_ACCESS)) {
    @@ -134,7 +138,6 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file,
                 /* For the process flow see the stderr case above */
                 fflush(stdin);
                 setvbuf(stdin, NULL, _IONBF, 0);
    -            _commit(0 /* stdin */);
     
                 if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand,
                                      0, FALSE, DUPLICATE_SAME_ACCESS)) {
    
    From c507c56dbaa4528a2e4d7dbadc631e344e83930f Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 6 Nov 2013 20:49:23 +0000
    Subject: [PATCH 7365/7878] Handle apu_select_dbm.h (already in apr-util 1.5.x
     branch)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1539456 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CMakeLists.txt | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/CMakeLists.txt b/CMakeLists.txt
    index 4808a4c9bce..bb983b8ebe6 100644
    --- a/CMakeLists.txt
    +++ b/CMakeLists.txt
    @@ -98,6 +98,9 @@ ENDIF()
     CONFIGURE_FILE(include/apr.hwc
                    ${PROJECT_BINARY_DIR}/apr.h)
     # "COPYONLY" just because anything else isn't implemented ;)
    +CONFIGURE_FILE(include/private/apu_select_dbm.hw
    +               ${PROJECT_BINARY_DIR}/apu_select_dbm.h
    +               COPYONLY)
     CONFIGURE_FILE(include/apu_want.hw
                    ${PROJECT_BINARY_DIR}/apu_want.h
                    COPYONLY)
    
    From 7b95915d935c07e65bdcb3989bba1c0239db2cf0 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Thu, 7 Nov 2013 11:59:54 +0000
    Subject: [PATCH 7366/7878] Switch gen_test_char from an APR app to a plain C
     app to give more flexibility to the build systems.
    
    Submitted by: minfrin
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1539603 13f79535-47bb-0310-9956-ffa450edef68
    ---
     tools/gen_test_char.c | 31 ++++++-------------------------
     1 file changed, 6 insertions(+), 25 deletions(-)
    
    diff --git a/tools/gen_test_char.c b/tools/gen_test_char.c
    index fca9850d61b..811c802f215 100644
    --- a/tools/gen_test_char.c
    +++ b/tools/gen_test_char.c
    @@ -14,33 +14,14 @@
      * limitations under the License.
      */
     
    -#ifdef CROSS_COMPILE
    -
    -#define apr_isalnum(c) (isalnum(((unsigned char)(c))))
    -#define apr_isalpha(c) (isalpha(((unsigned char)(c))))
    -#define apr_iscntrl(c) (iscntrl(((unsigned char)(c))))
    -#define apr_isprint(c) (isprint(((unsigned char)(c))))
    -#include 
    -#define APR_HAVE_STDIO_H 1
    -#define APR_HAVE_STRING_H 1
    -
    -#else
    -
    -#include "apr.h"
    -#include "apr_lib.h"
    -
    -#endif
    -
     #if defined(WIN32) || defined(OS2)
     #define NEED_ENHANCED_ESCAPES
     #endif
     
    -#if APR_HAVE_STDIO_H
     #include 
    -#endif
    -#if APR_HAVE_STRING_H
     #include 
    -#endif
    +#include 
    +#include 
     
     /* A bunch of functions in util.c scan strings looking for certain characters.
      * To make that more efficient we encode a lookup table.
    @@ -100,15 +81,15 @@ int main(int argc, char *argv[])
             }
     #endif
     
    -        if (!apr_isalnum(c) && !strchr("$-_.+!*'(),:@&=~", c)) {
    +        if (!isalnum(c) && !strchr("$-_.+!*'(),:@&=~", c)) {
                 flags |= T_ESCAPE_PATH_SEGMENT;
             }
     
    -        if (!apr_isalnum(c) && !strchr("$-_.+!*'(),:@&=/~", c)) {
    +        if (!isalnum(c) && !strchr("$-_.+!*'(),:@&=/~", c)) {
                 flags |= T_OS_ESCAPE_PATH;
             }
     
    -        if (!apr_isalnum(c) && !strchr(".-*_ ", c)) {
    +        if (!isalnum(c) && !strchr(".-*_ ", c)) {
                 flags |= T_ESCAPE_URLENCODED;
             }
     
    @@ -117,7 +98,7 @@ int main(int argc, char *argv[])
              * backslashes (because we use backslash for escaping)
              * and 8-bit chars with the high bit set
              */
    -        if (c && (!apr_isprint(c) || c == '"' || c == '\\' || apr_iscntrl(c))) {
    +        if (c && (!isprint(c) || c == '"' || c == '\\' || iscntrl(c))) {
                 flags |= T_ESCAPE_ECHO;
             }
     
    
    From 8ad2f50ab28092852a0fa2013257908d156153c9 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 12 Nov 2013 13:31:07 +0000
    Subject: [PATCH 7367/7878] Fix error message from ABTS_INT_NEQUAL() and
     ABTS_STR_NEQUAL().
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1541054 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/abts.c | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/test/abts.c b/test/abts.c
    index b233787a0f8..cab2e1aa094 100644
    --- a/test/abts.c
    +++ b/test/abts.c
    @@ -248,7 +248,8 @@ void abts_int_nequal(abts_case *tc, const int expected, const int actual, int li
     
         tc->failed = TRUE;
         if (verbose) {
    -        fprintf(stderr, "Line %d: expected <%d>, but saw <%d>\n", lineno, expected, actual);
    +        fprintf(stderr, "Line %d: expected something other than <%d>, but saw <%d>\n",
    +                lineno, expected, actual);
             fflush(stderr);
         }
     }
    @@ -295,7 +296,8 @@ void abts_str_nequal(abts_case *tc, const char *expected, const char *actual,
     
         tc->failed = TRUE;
         if (verbose) {
    -        fprintf(stderr, "Line %d: expected <%s>, but saw <%s>\n", lineno, expected, actual);
    +        fprintf(stderr, "Line %d: expected something other than <%s>, but saw <%s>\n",
    +                lineno, expected, actual);
             fflush(stderr);
         }
     }
    
    From 0f4c0fee2c72e112281bc430ed5b9b11399dc97a Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 12 Nov 2013 13:48:16 +0000
    Subject: [PATCH 7368/7878] add apr_sockaddr_is_wildcard() API
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1541061 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_network_io.h   | 10 ++++++++++
     network_io/unix/sockaddr.c | 29 +++++++++++++++++++++++++++++
     test/testsock.c            | 11 +++++++++++
     3 files changed, 50 insertions(+)
    
    diff --git a/include/apr_network_io.h b/include/apr_network_io.h
    index d7ffaf50930..8eaed26070c 100644
    --- a/include/apr_network_io.h
    +++ b/include/apr_network_io.h
    @@ -759,6 +759,16 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_getbuf(char *buf, apr_size_t buflen,
     APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1,
                                         const apr_sockaddr_t *addr2);
     
    +/**
    + * See if the IP address in an APR socket address refers to the wildcard
    + * address for the protocol family (e.g., INADDR_ANY for IPv4).
    + *
    + * @param addr The APR socket address to examine.
    + * @remark The return value will be non-zero if the address is
    + * initialized and is the wildcard address.
    + */
    +APR_DECLARE(int) apr_sockaddr_is_wildcard(const apr_sockaddr_t *addr);
    +
     /**
     * Return the type of the socket.
     * @param sock The socket to query.
    diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
    index 1ccc3f5715e..080c7a29830 100644
    --- a/network_io/unix/sockaddr.c
    +++ b/network_io/unix/sockaddr.c
    @@ -879,6 +879,35 @@ APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1,
         return 0; /* not equal */
     }
     
    +APR_DECLARE(int) apr_sockaddr_is_wildcard(const apr_sockaddr_t *addr)
    +{
    +    static const char inaddr_any[
    +#if APR_HAVE_IPV6
    +        sizeof(struct in6_addr)
    +#else
    +        sizeof(struct in_addr)
    +#endif
    +    ] = {0};
    +
    +    if (addr->ipaddr_ptr /* IP address initialized */
    +        && addr->ipaddr_len <= sizeof inaddr_any) { /* else bug elsewhere? */
    +        if (!memcmp(inaddr_any, addr->ipaddr_ptr, addr->ipaddr_len)) {
    +            return 1;
    +        }
    +#if APR_HAVE_IPV6
    +    if (addr->family == AF_INET6
    +        && IN6_IS_ADDR_V4MAPPED((struct in6_addr *)addr->ipaddr_ptr)) {
    +        struct in_addr *v4 = (struct in_addr *)&((apr_uint32_t *)addr->ipaddr_ptr)[3];
    +
    +        if (!memcmp(inaddr_any, v4, sizeof *v4)) {
    +            return 1;
    +        }
    +    }
    +#endif
    +    }
    +    return 0;
    +}
    +
     static apr_status_t parse_network(apr_ipsubnet_t *ipsub, const char *network)
     {
         /* legacy syntax for ip addrs: a.b.c. ==> a.b.c.0/24 for example */
    diff --git a/test/testsock.c b/test/testsock.c
    index 41b2774f764..b2ef80dd10c 100644
    --- a/test/testsock.c
    +++ b/test/testsock.c
    @@ -73,14 +73,21 @@ static void test_addr_info(abts_case *tc, void *data)
     {
         apr_status_t rv;
         apr_sockaddr_t *sa;
    +    int rc;
     
         rv = apr_sockaddr_info_get(&sa, NULL, APR_UNSPEC, 80, 0, p);
         APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv);
     
    +    rc = apr_sockaddr_is_wildcard(sa);
    +    ABTS_INT_NEQUAL(tc, 0, rc);
    +
         rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, 80, 0, p);
         APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv);
         ABTS_STR_EQUAL(tc, "127.0.0.1", sa->hostname);
     
    +    rc = apr_sockaddr_is_wildcard(sa);
    +    ABTS_INT_EQUAL(tc, 0, rc);
    +
         rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, 0, 0, p);
         APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv);
         ABTS_STR_EQUAL(tc, "127.0.0.1", sa->hostname);
    @@ -324,6 +331,10 @@ static void test_print_addr(abts_case *tc, void *data)
         if (rv == APR_SUCCESS && sa) {
             /* sa should now be a v4-mapped IPv6 address. */
             char buf[128];
    +        int rc;
    +
    +        rc = apr_sockaddr_is_wildcard(sa);
    +        ABTS_INT_NEQUAL(tc, 0, rc);
     
             memset(buf, 'z', sizeof buf);
             
    
    From 33eccbb6db9059f74da5510920dd57dac177837d Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 13 Nov 2013 12:03:50 +0000
    Subject: [PATCH 7369/7878] Follow up to r1535027 and r1535157:
    
    Fix sed re escaping issue in recognition of Linux kernel version.
    
    PR: 55690
    Submitted by: Arfrever Frehtes Taifersar Arahesis 
    Reviewed by: trawick
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1541486 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/configure.in b/configure.in
    index eaebac83654..9f224096b35 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -681,7 +681,7 @@ case $host in
             ;;
         *linux*)
             os_major=[`uname -r | sed -e 's/\([1-9][0-9]*\)\..*/\1/'`]
    -        os_minor=[`uname -r | sed -e 's/[1-9][0-9]*\.\([0-9]+\)\..*/\1/'`]
    +        os_minor=[`uname -r | sed -e 's/[1-9][0-9]*\.\([0-9]\+\)\..*/\1/'`]
             if test $os_major -lt 2 -o \( $os_major -eq 2 -a $os_minor -lt 4 \); then
                 AC_MSG_WARN([Configured for pre-2.4 Linux $os_major.$os_minor])
                 os_pre24linux=1
    
    From 719229dba4981294b8e465fafd217a022573b8f1 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 13 Nov 2013 18:44:10 +0000
    Subject: [PATCH 7370/7878] Fix message when !APR_HAS_MMAP
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1541655 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testmmap.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/testmmap.c b/test/testmmap.c
    index 74c0c9f5033..0dcdbe7243e 100644
    --- a/test/testmmap.c
    +++ b/test/testmmap.c
    @@ -31,7 +31,7 @@
     #if !APR_HAS_MMAP
     static void not_implemented(abts_case *tc, void *data)
     {
    -    ABTS_NOT_IMPL(tc, "User functions");
    +    ABTS_NOT_IMPL(tc, "MMAP functions");
     }
     
     #else
    
    From 676d2e16325ac560964108900f431d3cb5d0991b Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Wed, 13 Nov 2013 19:25:12 +0000
    Subject: [PATCH 7371/7878] Read the contents of the test datafile instead of
     hard-coding it in the source and relying on the line ending in the datafile
     to be the same as APR_EOL_STR. (Or, allow building and testing on Windows and
     Unix using the same release tarball.)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1541666 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testmmap.c | 20 +++++++++++++++-----
     1 file changed, 15 insertions(+), 5 deletions(-)
    
    diff --git a/test/testmmap.c b/test/testmmap.c
    index 0dcdbe7243e..140d5c32b03 100644
    --- a/test/testmmap.c
    +++ b/test/testmmap.c
    @@ -26,7 +26,6 @@
      * length on a platform?
      */
     #define PATH_LEN 255
    -#define TEST_STRING "This is the MMAP data file."APR_EOL_STR
     
     #if !APR_HAS_MMAP
     static void not_implemented(abts_case *tc, void *data)
    @@ -36,6 +35,7 @@ static void not_implemented(abts_case *tc, void *data)
     
     #else
     
    +static char test_string[256]; /* read from the datafile */
     static apr_mmap_t *themmap = NULL;
     static apr_file_t *thefile = NULL;
     static char *file1;
    @@ -69,6 +69,17 @@ static void test_file_close(abts_case *tc, void *data)
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     }
        
    +static void read_expected_contents(abts_case *tc, void *data)
    +{
    +    apr_status_t rv;
    +    apr_size_t nbytes = sizeof(test_string) - 1;
    +
    +    rv = apr_file_read(thefile, test_string, &nbytes);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
    +    test_string[nbytes] = '\0';
    +    thisfsize = strlen(test_string);
    +}
    +
     static void test_file_open(abts_case *tc, void *data)
     {
         apr_status_t rv;
    @@ -105,7 +116,7 @@ static void test_mmap_contents(abts_case *tc, void *data)
         ABTS_SIZE_EQUAL(tc, thisfsize, themmap->size);
     
         /* Must use nEquals since the string is not guaranteed to be NULL terminated */
    -    ABTS_STR_NEQUAL(tc, themmap->mm, TEST_STRING, thisfsize);
    +    ABTS_STR_NEQUAL(tc, themmap->mm, test_string, thisfsize);
     }
     
     static void test_mmap_delete(abts_case *tc, void *data)
    @@ -127,7 +138,7 @@ static void test_mmap_offset(abts_case *tc, void *data)
     
         ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
         /* Must use nEquals since the string is not guaranteed to be NULL terminated */
    -    ABTS_STR_NEQUAL(tc, addr, TEST_STRING + 5, thisfsize-5);
    +    ABTS_STR_NEQUAL(tc, addr, test_string + 5, thisfsize-5);
     }
     #endif
     
    @@ -136,10 +147,9 @@ abts_suite *testmmap(abts_suite *suite)
         suite = ADD_SUITE(suite)
     
     #if APR_HAS_MMAP    
    -    thisfsize = strlen(TEST_STRING);
    -
         abts_run_test(suite, create_filename, NULL);
         abts_run_test(suite, test_file_open, NULL);
    +    abts_run_test(suite, read_expected_contents, NULL);
         abts_run_test(suite, test_get_filesize, NULL);
         abts_run_test(suite, test_mmap_create, NULL);
         abts_run_test(suite, test_mmap_contents, NULL);
    
    From 22e392d3f0eff490aaad55f82a7997d2edac3ee7 Mon Sep 17 00:00:00 2001
    From: Rainer Jung 
    Date: Wed, 13 Nov 2013 21:48:30 +0000
    Subject: [PATCH 7372/7878] Support out of tree builds with traditional make.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1541744 13f79535-47bb-0310-9956-ffa450edef68
    ---
     Makefile.in | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/Makefile.in b/Makefile.in
    index 150ce7f7231..9d28d5f302f 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -166,6 +166,7 @@ tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char)
     	$(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)
     
     include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@
    +	$(APR_MKDIR) include/private
     	tools/gen_test_char@EXEEXT@ > $@
     
     LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LT_LDFLAGS) \
    
    From ffae2a2d4fe616cd6fca965b34a56188dedecf07 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 16 Nov 2013 22:21:34 +0000
    Subject: [PATCH 7373/7878] doxygen fixes for apr_escape API
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1542601 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_escape.h | 26 +++++++++++++-------------
     1 file changed, 13 insertions(+), 13 deletions(-)
    
    diff --git a/include/apr_escape.h b/include/apr_escape.h
    index 08de7dcf1c0..17422b3a1b4 100644
    --- a/include/apr_escape.h
    +++ b/include/apr_escape.h
    @@ -72,7 +72,7 @@ APR_DECLARE(apr_status_t) apr_escape_shell(char *escaped, const char *str,
     APR_DECLARE(const char *) apr_pescape_shell(apr_pool_t *p, const char *str)
             __attribute__((nonnull(1)));
     
    -/*
    +/**
      * Unescapes a URL, leaving reserved characters intact.
      * @param escaped Optional buffer to write the encoded string, can be
      * NULL
    @@ -93,7 +93,7 @@ APR_DECLARE(apr_status_t) apr_unescape_url(char *escaped, const char *url,
             apr_ssize_t slen, const char *forbid, const char *reserved, int plus,
             apr_size_t *len);
     
    -/*
    +/**
      * Unescapes a URL, leaving reserved characters intact, returning the
      * result from a pool.
      * @param p Pool to allocate from
    @@ -212,7 +212,7 @@ APR_DECLARE(const char *) apr_pescape_urlencoded(apr_pool_t *p,
      * double quote becomes '"" and the single quote becomes '''.
      *
      * If toasc is not zero, any non ascii character will be encoded as
    - * '%#ddd;', where ddd is the decimal code of the character.
    + * '%\#ddd;', where ddd is the decimal code of the character.
      * @param escaped Optional buffer to write the encoded string, can be
      * NULL
      * @param str The original string
    @@ -239,14 +239,14 @@ APR_DECLARE(apr_status_t) apr_escape_entity(char *escaped, const char *str,
     APR_DECLARE(const char *) apr_pescape_entity(apr_pool_t *p, const char *str,
             int toasc) __attribute__((nonnull(1)));
     
    -/*
    +/**
      * Decodes html entities or numeric character references in a string. If
      * the string to be unescaped is syntactically incorrect, then the
      * following fixups will be made:
      * unknown entities will be left undecoded;
      * references to unused numeric characters will be deleted.
      * In particular, � will not be decoded, but will be deleted.
    - * @param escaped Optional buffer to write the encoded string, can be
    + * @param unescaped Optional buffer to write the encoded string, can be
      * NULL
      * @param str The original string
      * @param slen The length of the original string, or APR_ESCAPE_STRING
    @@ -257,7 +257,7 @@ APR_DECLARE(const char *) apr_pescape_entity(apr_pool_t *p, const char *str,
     APR_DECLARE(apr_status_t) apr_unescape_entity(char *unescaped, const char *str,
             apr_ssize_t slen, apr_size_t *len);
     
    -/*
    +/**
      * Decodes html entities or numeric character references in a string. If
      * the string to be unescaped is syntactically incorrect, then the
      * following fixups will be made:
    @@ -275,10 +275,10 @@ APR_DECLARE(const char *) apr_punescape_entity(apr_pool_t *p, const char *str)
     /**
      * Escape control characters in a string, as performed by the shell's
      * 'echo' command. Characters are replaced as follows:
    - * \a alert (bell), \b backspace, \f form feed, \n new line, \r carriage
    - * return, \t horizontal tab, \v vertical tab, \\ backslash.
    + * \\a alert (bell), \\b backspace, \\f form feed, \\n new line, \\r carriage
    + * return, \\t horizontal tab, \\v vertical tab, \\ backslash.
      *
    - * Any non ascii character will be encoded as '\xHH', where HH is the hex
    + * Any non ascii character will be encoded as '\\xHH', where HH is the hex
      * code of the character.
      *
      * If quote is not zero, the double quote character will also be escaped.
    @@ -297,11 +297,11 @@ APR_DECLARE(apr_status_t) apr_escape_echo(char *escaped, const char *str,
     /**
      * Escape control characters in a string, as performed by the shell's
      * 'echo' command, and return the results from a pool. Characters are
    - * replaced as follows: \a alert (bell), \b backspace, \f form feed,
    - * \n new line, \r carriage return, \t horizontal tab, \v vertical tab,
    + * replaced as follows: \\a alert (bell), \\b backspace, \\f form feed,
    + * \\n new line, \\r carriage return, \\t horizontal tab, \\v vertical tab,
      * \\ backslash.
      *
    - * Any non ascii character will be encoded as '\xHH', where HH is the hex
    + * Any non ascii character will be encoded as '\\xHH', where HH is the hex
      * code of the character.
      *
      * If quote is not zero, the double quote character will also be escaped.
    @@ -342,7 +342,7 @@ APR_DECLARE(const char *) apr_pescape_hex(apr_pool_t *p, const void *src,
     /**
      * Convert hex encoded string to binary data.
      * @param dest The destination buffer, can be NULL
    - * @param src The original buffer
    + * @param str The original buffer
      * @param slen The length of the original buffer
      * @param colon If not zero, ignore colon characters between hex digits.
      * @param len If present, returns the length of the string
    
    From 2e55233bd2a5cf6f535c16a4eb21d425f931eed3 Mon Sep 17 00:00:00 2001
    From: Jim Jagielski 
    Date: Sun, 17 Nov 2013 14:18:25 +0000
    Subject: [PATCH 7374/7878] Close
     https://issues.apache.org/bugzilla/show_bug.cgi?id=53996
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1542728 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES          |  4 ++++
     shmem/unix/shm.c | 16 +++++++++++++---
     2 files changed, 17 insertions(+), 3 deletions(-)
    
    diff --git a/CHANGES b/CHANGES
    index dd4c17bf05e..8a2ea221b9c 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 2.0.0
     
    +  *) When using shmget-based shared memory, the ID used for ftok is
    +     now an APR hash of the filename instead of the constant '1'.
    +     PR 53996 [Jim Jagielski]
    +
       *) Changes to apr_pollset_method_e enum value of APR_POLLSET_POLL and
          APR_POLLSET_AIO_MSGQ.  Restore APR_POLLSET_POLL to its pre-r1308910 
          (April 2012) value, and move APR_POLLSET_AIO_MSGQ ahead. This restores
    diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c
    index f907000c896..27a29e67c99 100644
    --- a/shmem/unix/shm.c
    +++ b/shmem/unix/shm.c
    @@ -21,6 +21,7 @@
     #include "apr_errno.h"
     #include "apr_user.h"
     #include "apr_strings.h"
    +#include "apr_hash.h"
     
     static apr_status_t shm_cleanup_owner(void *m_)
     {
    @@ -103,6 +104,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
     #endif
     #if APR_USE_SHMEM_SHMGET
         apr_size_t nbytes;
    +    apr_ssize_t slen;
     #endif
     #if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_SHMGET || \
         APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM
    @@ -312,7 +314,9 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
     
             /* ftok() (on solaris at least) requires that the file actually
              * exist before calling ftok(). */
    -        new_m->shmkey = ftok(filename, 1);
    +        slen = strlen(filename);
    +        new_m->shmkey = ftok(filename,
    +                             (int)apr_hashfunc_default(filename, &slen));
             if (new_m->shmkey == (key_t)-1) {
                 apr_file_close(file);
                 return errno;
    @@ -382,6 +386,7 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename,
         apr_file_t *file;  
         key_t shmkey;
         int shmid;
    +    apr_ssize_t slen;
     #endif
     
     #if APR_USE_SHMEM_MMAP_TMP
    @@ -401,7 +406,9 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename,
     
         /* ftok() (on solaris at least) requires that the file actually
          * exist before calling ftok(). */
    -    shmkey = ftok(filename, 1);
    +    slen = strlen(filename);
    +    shmkey = ftok(filename,
    +                  (int)apr_hashfunc_default(filename, &slen));
         if (shmkey == (key_t)-1) {
             goto shm_remove_failed;
         }
    @@ -532,6 +539,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
             apr_status_t status;
             apr_file_t *file;   /* file where metadata is stored */
             apr_size_t nbytes;
    +        apr_ssize_t slen;
     
             new_m = apr_palloc(pool, sizeof(apr_shm_t));
     
    @@ -554,7 +562,9 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
     
             new_m->filename = apr_pstrdup(pool, filename);
             new_m->pool = pool;
    -        new_m->shmkey = ftok(filename, 1);
    +        slen = strlen(filename);
    +        new_m->shmkey = ftok(filename,
    +                             (int)apr_hashfunc_default(filename, &slen));
             if (new_m->shmkey == (key_t)-1) {
                 return errno;
             }
    
    From 6ad45bf9e679594b7477e0cd8a50f98681fc99ec Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sun, 17 Nov 2013 18:20:41 +0000
    Subject: [PATCH 7375/7878] add compatibility with C++ applications
    
    use the normal form of preprocessor define for already-included
    
    add rough documentation
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1542779 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_skiplist.h | 203 ++++++++++++++++++++++++++++++++++++++---
     1 file changed, 190 insertions(+), 13 deletions(-)
    
    diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h
    index 37306da2a4c..bc17efd95fa 100644
    --- a/include/apr_skiplist.h
    +++ b/include/apr_skiplist.h
    @@ -14,69 +14,246 @@
      * limitations under the License.
      */
     
    -#ifndef _APR_SKIPLIST_P_H
    -#define _APR_SKIPLIST_P_H
    +#ifndef APR_SKIPLIST_H
    +#define APR_SKIPLIST_H
    +/**
    + * @file apr_skiplist.h
    + * @brief APR skip list implementation
    + */
     
     #include "apr.h"
     #include "apr_portable.h"
     #include 
     
    +#ifdef __cplusplus
    +extern "C" {
    +#endif /* __cplusplus */
    +
    +/**
    + * @defgroup apr_skiplist Skip list implementation
    + * Refer to http://en.wikipedia.org/wiki/Skip_list for information
    + * about the purpose of and ideas behind skip lists.
    + * @ingroup APR
    + * @{
    + */
     
    -/* This is the function type that must be implemented per object type
    -   that is used in a skiplist for comparisons to maintain order */
    +/**
    + * apr_skiplist_compare is the function type that must be implemented 
    + * per object type that is used in a skip list for comparisons to maintain
    + * order
    + * */
     typedef int (*apr_skiplist_compare) (void *, void *);
    +
    +/**
    + * apr_skiplist_freefunc is the function type that must be implemented
    + * to handle elements as they are removed from a skip list.
    + */
     typedef void (*apr_skiplist_freefunc) (void *);
     
    +/** Opaque structure used to represent the skip list */
     struct apr_skiplist;
    -struct apr_skiplistnode;
    +/** Opaque structure used to represent the skip list */
    +typedef struct apr_skiplist apr_skiplist;
     
    +/** 
    + * Opaque structure used to represent abstract nodes in the skip list
    + * (an abstraction above the raw elements which are collected in the
    + * skip list).
    + */
    +struct apr_skiplistnode;
    +/** Opaque structure */
     typedef struct apr_skiplistnode apr_skiplistnode;
    -typedef struct apr_skiplist apr_skiplist;
     
    +/**
    + * Allocate memory using the same mechanism as the skip list.
    + * @param sl The skip list
    + * @param size The amount to allocate
    + * @remark If a pool was provided to apr_skiplist_init(), memory will
    + * be allocated from the pool or from a free list maintained with
    + * the skip list.  Otherwise, memory will be allocated using the
    + * C standard library heap functions.
    + */
     APR_DECLARE(void *) apr_skiplist_alloc(apr_skiplist *sl, size_t size);
     
    +/**
    + * Free memory using the same mechanism as the skip list.
    + * @param sl The skip list
    + * @param mem The object to free
    + * @remark If a pool was provided to apr_skiplist_init(), memory will
    + * be added to a free list maintained with the skip list and be available
    + * to operations on the skip list or to other calls to apr_skiplist_alloc().
    + * Otherwise, memory will be freed using the  C standard library heap
    + * functions.
    + */
     APR_DECLARE(void) apr_skiplist_free(apr_skiplist *sl, void *mem);
     
    +/**
    + * Allocate a new skip list
    + * @param sl The pointer in which to return the newly created skip list
    + * @param p The pool from which to allocate the skip list (optional).
    + * @remark Unlike most APR functions, a pool is optional.  If no pool
    + * is provided, the C standard library heap functions will be used instead.
    + */
     APR_DECLARE(apr_status_t) apr_skiplist_init(apr_skiplist **sl, apr_pool_t *p);
     
    -APR_DECLARE(void) apr_skiplist_set_compare(apr_skiplist *sl, apr_skiplist_compare,
    -                             apr_skiplist_compare);
    +/**
    + * Set the comparison functions to be used for searching the skip list.
    + * @param sl The skip list
    + * @param XXX1 FIXME
    + * @param XXX2 FIXME
    + *
    + * @remark If existing comparison functions are being replaced, the index
    + * will be replaced during this call.  That is a potentially expensive
    + * operation.
    + */
    +APR_DECLARE(void) apr_skiplist_set_compare(apr_skiplist *sl, apr_skiplist_compare XXX1,
    +                             apr_skiplist_compare XXX2);
     
    -APR_DECLARE(void) apr_skiplist_add_index(apr_skiplist *sl, apr_skiplist_compare,
    -                        apr_skiplist_compare);
    +/**
    + * Set the indexing functions to the specified comparison functions and
    + * rebuild the index.
    + * @param sl The skip list
    + * @param XXX1 FIXME
    + * @param XXX2 FIXME
    + *
    + * @remark If an index already exists, it will not be replaced and the
    + * comparison functions will not be changed.
    + */
    +APR_DECLARE(void) apr_skiplist_add_index(apr_skiplist *sl, apr_skiplist_compare XXX1,
    +                        apr_skiplist_compare XXX2);
     
    +/**
    + * Return the list maintained by the skip list abstraction.
    + * @param sl The skip list
    + */
     APR_DECLARE(apr_skiplistnode *) apr_skiplist_getlist(apr_skiplist *sl);
     
    +/**
    + * Return the next matching element in the skip list using the specified
    + * comparison function.
    + * @param sl The skip list
    + * @param data The value to search for
    + * @param iter A pointer to the returned skip list node representing the element
    + * found
    + * @param func The comparison function to use
    + */
     APR_DECLARE(void *) apr_skiplist_find_compare(apr_skiplist *sl,
                                    void *data,
                                    apr_skiplistnode **iter,
                                    apr_skiplist_compare func);
     
    +/**
    + * Return the next matching element in the skip list using the current comparison
    + * function.
    + * @param sl The skip list
    + * @param data The value to search for
    + * @param iter A pointer to the returned skip list node representing the element
    + * found
    + */
     APR_DECLARE(void *) apr_skiplist_find(apr_skiplist *sl, void *data, apr_skiplistnode **iter);
     
    +/**
    + * Return the next element in the skip list.
    + * @param sl The skip list
    + * @param iter On entry, a pointer to the skip list node to start with; on return,
    + * a pointer to the skip list node representing the element returned
    + * @remark If iter points to a NULL value on entry, NULL will be returned.
    + */
     APR_DECLARE(void *) apr_skiplist_next(apr_skiplist *sl, apr_skiplistnode **iter);
     
    +/**
    + * Return the previous element in the skip list.
    + * @param sl The skip list
    + * @param iter On entry, a pointer to the skip list node to start with; on return,
    + * a pointer to the skip list node representing the element returned
    + * @remark If iter points to a NULL value on entry, NULL will be returned.
    + */
     APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **iter);
     
    -
    +/**
    + * Insert an element into the skip list using the specified comparison function.
    + * @param sl The skip list
    + * @param data The element to insert
    + * @param comp The comparison function to use for placement into the skip list
    + */
     APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl,
                                               void *data, apr_skiplist_compare comp);
     
    +/**
    + * Insert an element into the skip list using the existing comparison function.
    + * @param sl The skip list
    + * @param data The element to insert
    + * @remark If no comparison function has been set for the skip list, the element
    + * will not be inserted and NULL will be returned.
    + */
     APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist* sl, void *data);
     
    +/**
    + * Remove an element from the skip list using the specified comparison function for
    + * locating the element.
    + * @param sl The skip list
    + * @param data The element to remove
    + * @param myfree A function to be called for each removed element
    + * @param comp The comparison function to use for placement into the skip list
    + * @remark If the element is not found, 0 will be returned.  Otherwise, the heightXXX
    + * will be returned.
    + */
     APR_DECLARE(int) apr_skiplist_remove_compare(apr_skiplist *sl, void *data,
                                    apr_skiplist_freefunc myfree, apr_skiplist_compare comp);
     
    +/**
    + * Remove an element from the skip list using the existing comparison function for
    + * locating the element.
    + * @param sl The skip list
    + * @param data The element to remove
    + * @param myfree A function to be called for each removed element
    + * @remark If the element is not found, 0 will be returned.  Otherwise, the heightXXX
    + * will be returned.
    + * @remark If no comparison function has been set for the skip list, the element
    + * will not be removed and 0 will be returned.
    + */
     APR_DECLARE(int) apr_skiplist_remove(apr_skiplist *sl, void *data, apr_skiplist_freefunc myfree);
     
    +/**
    + * Remove all elements from the skip list.
    + * @param sl The skip list
    + * @param myfree A function to be called for each removed element
    + */
     APR_DECLARE(void) apr_skiplist_remove_all(apr_skiplist *sl, apr_skiplist_freefunc myfree);
     
    +/**
    + * Remove each element from the skip list.
    + * @param sl The skip list
    + * @param myfree A function to be called for each removed element
    + */
     APR_DECLARE(void) apr_skiplist_destroy(apr_skiplist *sl, apr_skiplist_freefunc myfree);
     
    -APR_DECLARE(void *) apr_skiplist_pop(apr_skiplist *a, apr_skiplist_freefunc myfree);
    +/**
    + * Return the first element in the skip list, leaving the element in the skip list.
    + * @param sl The skip list
    + * @param myfree A function to be called for the removed element
    + * @remark NULL will be returned if there are no elements
    + */
    +APR_DECLARE(void *) apr_skiplist_pop(apr_skiplist *sl, apr_skiplist_freefunc myfree);
     
    -APR_DECLARE(void *) apr_skiplist_peek(apr_skiplist *a);
    +/**
    + * Return the first element in the skip list, leaving the element in the skip list.
    + * @param sl The skip list
    + * @remark NULL will be returned if there are no elements
    + */
    +APR_DECLARE(void *) apr_skiplist_peek(apr_skiplist *sl);
     
    +/**
    + * Merge two skip lists.  XXX SEMANTICS
    + * @param sl1 One of two skip lists to be merged
    + * @param sl2 The other of two skip lists to be merged
    + */
     APR_DECLARE(apr_skiplist *) apr_skiplist_merge(apr_skiplist *sl1, apr_skiplist *sl2);
     
    +/** @} */
    +
    +#ifdef __cplusplus
    +}
     #endif
    +
    +#endif /* ! APR_SKIPLIST_H */
    
    From aa722626b47c75b2cf2c3d4e69ca9ecd6a237c6b Mon Sep 17 00:00:00 2001
    From: Jim Jagielski 
    Date: Mon, 18 Nov 2013 14:10:58 +0000
    Subject: [PATCH 7376/7878] OSX (Darwin) returns APR_POLLHUP|APR_POLLIN, so the
     test for equality fails. Instead, just check for the bit.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1543033 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/socket_util.c | 5 +++++
     1 file changed, 5 insertions(+)
    
    diff --git a/network_io/unix/socket_util.c b/network_io/unix/socket_util.c
    index 6cd28a55c43..5fb2ccfe802 100644
    --- a/network_io/unix/socket_util.c
    +++ b/network_io/unix/socket_util.c
    @@ -46,7 +46,12 @@ APR_DECLARE(apr_status_t) apr_socket_atreadeof(apr_socket_t *sock, int *atreadeo
             /* Some other error -> unexpected error. */
             return rv;
         }
    +#if defined(DARWIN)
    +    /* OSX returns APR_POLLHUP|APR_POLLIN */
    +    else if (nfds == 1 && (pfds[0].rtnevents & APR_POLLIN)  == APR_POLLIN) {
    +#else
         else if (nfds == 1 && pfds[0].rtnevents == APR_POLLIN) {
    +#endif
             apr_sockaddr_t unused;
             apr_size_t len = 1;
             char buf;
    
    From 5482dd9302a29055f56d4c3023bb68fa7db3d458 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Mon, 18 Nov 2013 15:14:19 +0000
    Subject: [PATCH 7377/7878] Follow up to r1543033:
    
    Use the new code required for OS X/Darwin on the other platforms too.
    (IOW, we're willing to peek in the socket as long as APR_POLLIN is
    returned, regardless of other flags.)
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1543056 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/socket_util.c | 6 +-----
     1 file changed, 1 insertion(+), 5 deletions(-)
    
    diff --git a/network_io/unix/socket_util.c b/network_io/unix/socket_util.c
    index 5fb2ccfe802..93fe25976ad 100644
    --- a/network_io/unix/socket_util.c
    +++ b/network_io/unix/socket_util.c
    @@ -46,12 +46,8 @@ APR_DECLARE(apr_status_t) apr_socket_atreadeof(apr_socket_t *sock, int *atreadeo
             /* Some other error -> unexpected error. */
             return rv;
         }
    -#if defined(DARWIN)
    -    /* OSX returns APR_POLLHUP|APR_POLLIN */
    +    /* Many platforms return only APR_POLLIN; OS X returns APR_POLLHUP|APR_POLLIN */
         else if (nfds == 1 && (pfds[0].rtnevents & APR_POLLIN)  == APR_POLLIN) {
    -#else
    -    else if (nfds == 1 && pfds[0].rtnevents == APR_POLLIN) {
    -#endif
             apr_sockaddr_t unused;
             apr_size_t len = 1;
             char buf;
    
    From 52d8c8b7349efe9fd2cde760cbee50496f1e2789 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Tue, 19 Nov 2013 12:22:15 +0000
    Subject: [PATCH 7378/7878] Make DLL_NAME definition compatible with Visual
     Studio generators by removing unnecessary escaped quoting.
    
    Diagnosis and earlier patch by rhuijben
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1543399 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CMakeLists.txt | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/CMakeLists.txt b/CMakeLists.txt
    index bb983b8ebe6..f6a14992915 100644
    --- a/CMakeLists.txt
    +++ b/CMakeLists.txt
    @@ -449,7 +449,7 @@ IF(APU_HAVE_CRYPTO)
       SET(install_targets ${install_targets} apr_crypto_openssl-2)
       SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_crypto_openssl-2.pdb)
       SET_TARGET_PROPERTIES(apr_crypto_openssl-2 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OPENSSL_INCLUDE_DIR}")
    -  SET_TARGET_PROPERTIES(apr_crypto_openssl-2 PROPERTIES COMPILE_FLAGS "-DDLL_NAME=\"\\\"apr_crypto_openssl\\\"\"")
    +  SET_TARGET_PROPERTIES(apr_crypto_openssl-2 PROPERTIES COMPILE_FLAGS "-DDLL_NAME=apr_crypto_openssl")
       TARGET_LINK_LIBRARIES(apr_crypto_openssl-2 libapr-2 ${APR_SYSTEM_LIBS} ${OPENSSL_LIBRARIES})
     ENDIF()
     
    @@ -461,7 +461,7 @@ IF(APU_HAVE_ODBC)
       TARGET_LINK_LIBRARIES(apr_dbd_odbc-2 libapr-2 ${APR_SYSTEM_LIBS} odbc32 odbccp32)
       SET_PROPERTY(TARGET apr_dbd_odbc-2 APPEND PROPERTY LINK_FLAGS /export:apr_dbd_odbc_driver)
       SET_TARGET_PROPERTIES(apr_dbd_odbc-2 PROPERTIES COMPILE_DEFINITIONS "APU_HAVE_ODBC;HAVE_SQL_H;APR_DECLARE_EXPORT;APU_DSO_MODULE_BUILD")
    -  SET_TARGET_PROPERTIES(apr_dbd_odbc-2 PROPERTIES COMPILE_FLAGS "-DDLL_NAME=\"\\\"apr_dbd_odbc\\\"\"")
    +  SET_TARGET_PROPERTIES(apr_dbd_odbc-2 PROPERTIES COMPILE_FLAGS "-DDLL_NAME=apr_dbd_odbc")
     ENDIF()
     
     IF(APR_BUILD_TESTAPR)
    
    From 067b22cc857a85a1dda666e59a605162d56dc2ac Mon Sep 17 00:00:00 2001
    From: Rainer Jung 
    Date: Sat, 23 Nov 2013 17:57:39 +0000
    Subject: [PATCH 7379/7878] Fix detection of Berkeley DB 6. PR 55277 Patch by
     Lars Wendler  (slightly modified)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1544846 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/dbm.m4 | 31 +++++++++++++++++++++++--------
     1 file changed, 23 insertions(+), 8 deletions(-)
    
    diff --git a/build/dbm.m4 b/build/dbm.m4
    index 8312e0edfaa..bbe9c863a60 100644
    --- a/build/dbm.m4
    +++ b/build/dbm.m4
    @@ -112,7 +112,7 @@ AC_DEFUN([APU_CHECK_BERKELEY_DB], [
             changequote([,])
             unset $cache_id
             AC_CHECK_HEADER([$bdb_header], [
    -          if test "$1" = "3" -o "$1" = "4" -o "$1" = "5"; then
    +          if test "$1" = "3" -o "$1" = "4" -o "$1" = "5" -o "$1" = "6"; then
                 # We generate a separate cache variable for each prefix and libname
                 # we search under.  That way, we avoid caching information that
                 # changes if the user runs `configure' with a different set of
    @@ -455,13 +455,13 @@ AC_DEFUN([APU_CHECK_DB], [
     ])
     
     dnl
    -dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 5.X to 1.
    +dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 6.X to 1.
     dnl
     AC_DEFUN([APU_CHECK_DB_ALL], [
       all_places=$1
     
    -  # Start version search at version 5.9
    -  db_version=59
    +  # Start version search at version 6.9
    +  db_version=69
       while [[ $db_version -ge 40 ]]
       do
         db_major=`echo $db_version | sed -e 's/.$//'`
    @@ -511,19 +511,34 @@ AC_DEFUN([APU_CHECK_DBM], [
       apu_db_version=0
     
       # Maximum supported version announced in help string.
    -  # Although we search for all versions up to 5.9,
    +  # Although we search for all versions up to 6.9,
       # we should only include existing versions in our
       # help string.
    -  db_max_version=53
    -  db_min_version=41
       dbm_list="sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4"
    +  db_max_version=48
    +  db_min_version=41
    +  db_version="$db_min_version"
    +  while [[ $db_version -le $db_max_version ]]
    +  do
    +    dbm_list="$dbm_list, db$db_version"
    +    db_version=`expr $db_version + 1`
    +  done
    +  db_max_version=53
    +  db_min_version=50
    +  db_version="$db_min_version"
    +  while [[ $db_version -le $db_max_version ]]
    +  do
    +    dbm_list="$dbm_list, db$db_version"
    +    db_version=`expr $db_version + 1`
    +  done
    +  db_max_version=60
    +  db_min_version=60
       db_version="$db_min_version"
       while [[ $db_version -le $db_max_version ]]
       do
         dbm_list="$dbm_list, db$db_version"
         db_version=`expr $db_version + 1`
       done
    -  dbm_list="$dbm_list, db60"
     
       AC_ARG_WITH(dbm, [APR_HELP_STRING([--with-dbm=DBM], [choose the DBM type to use.
           DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db4X,db5X,db6X} for some X=0,...,9])],
    
    From c33a2ce74c84f0d435bfa2dd8953d132ebf7a77a Mon Sep 17 00:00:00 2001
    From: Jim Jagielski 
    Date: Mon, 25 Nov 2013 13:44:52 +0000
    Subject: [PATCH 7380/7878] Test that adding a negative number works as
     expected
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1545279 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testatomic.c | 12 ++++++++++++
     1 file changed, 12 insertions(+)
    
    diff --git a/test/testatomic.c b/test/testatomic.c
    index 8e00fb192ea..ca0398a2985 100644
    --- a/test/testatomic.c
    +++ b/test/testatomic.c
    @@ -167,6 +167,17 @@ static void test_add32(abts_case *tc, void *data)
         ABTS_INT_EQUAL(tc, 27, y32);
     }
     
    +static void test_add32_neg(abts_case *tc, void *data)
    +{
    +    apr_uint32_t oldval;
    +    apr_uint32_t y32;
    +
    +    apr_atomic_set32(&y32, 23);
    +    oldval = apr_atomic_add32(&y32, -10);
    +    ABTS_INT_EQUAL(tc, 23, oldval);
    +    ABTS_INT_EQUAL(tc, 13, y32);
    +}
    +
     static void test_inc32(abts_case *tc, void *data)
     {
         apr_uint32_t oldval;
    @@ -509,6 +520,7 @@ abts_suite *testatomic(abts_suite *suite)
         abts_run_test(suite, test_casptr_equal_nonnull, NULL);
         abts_run_test(suite, test_casptr_notequal, NULL);
         abts_run_test(suite, test_add32, NULL);
    +    abts_run_test(suite, test_add32_neg, NULL);
         abts_run_test(suite, test_inc32, NULL);
         abts_run_test(suite, test_set_add_inc_sub, NULL);
         abts_run_test(suite, test_wrap_zero, NULL);
    
    From 0a33b2aa9174bcb08681004d08dae32750ba9a66 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 6 Dec 2013 16:05:35 +0000
    Subject: [PATCH 7381/7878] mention non-portability of an odd apr_getnameinfo()
     use
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1548575 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_network_io.h | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/include/apr_network_io.h b/include/apr_network_io.h
    index 8eaed26070c..b8fc69e2af3 100644
    --- a/include/apr_network_io.h
    +++ b/include/apr_network_io.h
    @@ -434,6 +434,8 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa,
      * @param hostname The hostname.
      * @param sa The apr_sockaddr_t.
      * @param flags Special processing flags.
    + * @remark Results can vary significantly between platforms
    + * when processing wildcard socket addresses.
      */
     APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname,
                                               apr_sockaddr_t *sa,
    
    From 6d9c54face68cdd3c6d58d2c29a732c2d47af2eb Mon Sep 17 00:00:00 2001
    From: Rainer Jung 
    Date: Sat, 14 Dec 2013 09:20:41 +0000
    Subject: [PATCH 7382/7878] Fix typo noticed by Mike Rumph and Christophe
     Jaillet.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1550907 13f79535-47bb-0310-9956-ffa450edef68
    ---
     docs/canonical_filenames.html      | 6 +++---
     include/arch/netware/apr_private.h | 2 +-
     2 files changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/docs/canonical_filenames.html b/docs/canonical_filenames.html
    index 10867d3796e..2bd9bdba822 100644
    --- a/docs/canonical_filenames.html
    +++ b/docs/canonical_filenames.html
    @@ -104,9 +104,9 @@ 

    Canonical API

    stat and case canonicalization calls to the OS.

    The comparison operation provides that the APR can postpone correction -of case by simply relying upon the device and inode for equivilance. The +of case by simply relying upon the device and inode for equivalence. The stat implementation provides that two files are the same, while their -strings are not equivilant, and eliminates the need for the operating +strings are not equivalent, and eliminates the need for the operating system to return the proper form of the name.

    In any case, returning the char* path, with a flag to request the proper @@ -153,4 +153,4 @@

    Unix Example

    - \ No newline at end of file + diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 844f6f5c730..c4558afa78c 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -70,7 +70,7 @@ #define HAVE_GETPASS_R 1 /* * Hack around older NDKs which have only the getpassword() function, - * a threadsafe, API-equivilant of getpass_r(). + * a threadsafe, API-equivalent of getpass_r(). */ #if (CURRENT_NDK_THRESHOLD < 709060000) #define getpass_r getpassword From a7a63b00f282a7dedc3580f9469e1df762715153 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 17 Dec 2013 18:35:13 +0000 Subject: [PATCH 7383/7878] Add testcase for broken handling of APR_O_NONBLOCK_INHERITED (as seen on FreeBSD 10). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1551650 13f79535-47bb-0310-9956-ffa450edef68 --- test/sockchild.c | 8 +++++++- test/testsock.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/test/sockchild.c b/test/sockchild.c index e16271bdf25..a1116af2bdc 100644 --- a/test/sockchild.c +++ b/test/sockchild.c @@ -69,8 +69,14 @@ int main(int argc, char *argv[]) exit((int)length); } - else if (!strcmp("write", argv[1])) { + else if (!strcmp("write", argv[1]) + || !strcmp("write_after_delay", argv[1])) { apr_size_t length = strlen(DATASTR); + + if (!strcmp("write_after_delay", argv[1])) { + apr_sleep(apr_time_from_sec(2)); + } + apr_socket_send(sock, DATASTR, &length); apr_socket_close(sock); diff --git a/test/testsock.c b/test/testsock.c index b2ef80dd10c..b469b0bb6d4 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -507,6 +507,54 @@ static void test_wait(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "couldn't close server socket", rv); } +/* Make sure that setting a connected socket non-blocking works + * when the listening socket was non-blocking. + * If APR thinks that non-blocking is inherited but it really + * isn't, this testcase will fail. + */ +static void test_nonblock_inheritance(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_socket_t *sock; + apr_socket_t *sock2; + apr_proc_t proc; + char buffer[10]; + apr_size_t length; + int tries; + + sock = setup_socket(tc); + if (!sock) return; + + rv = apr_socket_opt_set(sock, APR_SO_NONBLOCK, 1); + APR_ASSERT_SUCCESS(tc, "Could not make listening socket nonblocking", rv); + + launch_child(tc, &proc, "write_after_delay", p); + + tries = 10; + while (tries--) { + rv = apr_socket_accept(&sock2, sock, p); + if (!APR_STATUS_IS_EAGAIN(rv)) { + break; + } + apr_sleep(apr_time_from_msec(50)); + } + APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); + + rv = apr_socket_opt_set(sock2, APR_SO_NONBLOCK, 1); + APR_ASSERT_SUCCESS(tc, "Could not make connected socket nonblocking", rv); + + length = sizeof buffer; + rv = apr_socket_recv(sock2, buffer, &length); + ABTS_ASSERT(tc, "should have gotten EAGAIN", APR_STATUS_IS_EAGAIN(rv)); + + wait_child(tc, &proc); + + rv = apr_socket_close(sock2); + APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); + rv = apr_socket_close(sock); + APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); +} + abts_suite *testsock(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -521,6 +569,7 @@ abts_suite *testsock(abts_suite *suite) abts_run_test(suite, test_print_addr, NULL); abts_run_test(suite, test_get_addr, NULL); abts_run_test(suite, test_wait, NULL); + abts_run_test(suite, test_nonblock_inheritance, NULL); #if APR_HAVE_SOCKADDR_UN socket_name = UNIX_SOCKET_NAME; socket_type = APR_UNIX; From 8abca9d7074f7b3ba83e776e0c7ab5605520631e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 17 Dec 2013 19:17:34 +0000 Subject: [PATCH 7384/7878] Fix the inheritance of the non-blocking option across apr_socket_accept() on FreeBSD 10 which was introduced with APR 1.5.0 through an unlikely mechanism: * FreeBSD 10 introduced accept4(). APR uses accept4() where it can find it. accept4() on Linux and FreeBSD 10 both have a SOCK_NONBLOCK flag, but on FreeBSD 10 the SOCK_NONBLOCK is the sole determiner of whether or not the connected socket is non-blocking. * clang is normally used on FreeBSD 10. * APR's configure-time check for inherited O_NONBLOCK didn't work with clang, so initially the lack of inheritance across accept4() wasn't a problem. * APR 1.5.0 allowed the configure-time check to work with clang, exposing the bad expectation about accept4() matching the accept() behavior. With FreeBSD accept4() (avail in 10+), O_NONBLOCK is not inherited (unlike Linux). Mimic the accept() behavior here in a way that may help other platforms as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1551659 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 3c4dbe2f289..9fc774ed0ed 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -250,7 +250,20 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, sa.salen = sizeof(sa.sa); #ifdef HAVE_ACCEPT4 - s = accept4(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen, SOCK_CLOEXEC); + { + int flags = SOCK_CLOEXEC; + +#if defined(SOCK_NONBLOCK) && APR_O_NONBLOCK_INHERITED + /* With FreeBSD accept4() (avail in 10+), O_NONBLOCK is not inherited + * (unlike Linux). Mimic the accept() behavior here in a way that + * may help other platforms. + */ + if (apr_is_option_set(sock, APR_SO_NONBLOCK) == 1) { + flags |= SOCK_NONBLOCK; + } +#endif + s = accept4(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen, flags); + } #else s = accept(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen); #endif From 64900d7333adeb04dab20cfd9de05c87249a44b1 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sat, 21 Dec 2013 00:14:39 +0000 Subject: [PATCH 7385/7878] pick up htons where needed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1552846 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/testsock.c b/test/testsock.c index b469b0bb6d4..da7bc03996a 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -23,6 +23,8 @@ #include "apr_lib.h" #include "apr_strings.h" #include "apr_poll.h" +#define APR_WANT_BYTEFUNC +#include "apr_want.h" #define UNIX_SOCKET_NAME "/tmp/apr-socket" #define IPV4_SOCKET_NAME "127.0.0.1" From 0996c94aa4012bc6cd9b9962b08122c011a12997 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sat, 21 Dec 2013 00:33:05 +0000 Subject: [PATCH 7386/7878] skip entity encode/decode tests on EBCDIC OS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1552849 13f79535-47bb-0310-9956-ffa450edef68 --- test/testescape.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/testescape.c b/test/testescape.c index 28e1f0988ad..323ff56186b 100644 --- a/test/testescape.c +++ b/test/testescape.c @@ -166,6 +166,7 @@ static void test_escape(abts_case *tc, void *data) apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), (len == strlen(dest) + 1)); +#if !APR_CHARSET_EBCDIC src = "Hello"; dest = apr_pescape_entity(pool, src, 1); ABTS_PTR_EQUAL(tc, src, dest); @@ -209,6 +210,7 @@ static void test_escape(abts_case *tc, void *data) ABTS_ASSERT(tc, apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), (len == strlen(dest) + 1)); +#endif src = "Hello"; dest = apr_pescape_echo(pool, src, 0); From 79ea768549eb7c1ec09f5c9bc6ea8c061d77016a Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sat, 21 Dec 2013 00:38:16 +0000 Subject: [PATCH 7387/7878] replace EBCDIC-only remnants of httpd / dependency on apr_xlate that made it into the apr_escape implementation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1552852 13f79535-47bb-0310-9956-ffa450edef68 --- encoding/apr_escape.c | 45 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/encoding/apr_escape.c b/encoding/apr_escape.c index 8bb403c140c..2bcfec418fe 100644 --- a/encoding/apr_escape.c +++ b/encoding/apr_escape.c @@ -30,11 +30,43 @@ #include "apr_lib.h" #include "apr_strings.h" -/* helper for Latin1 <-> entity encoding */ #if APR_CHARSET_EBCDIC -#include "apr_xlate.h" -#define RAW_ASCII_CHAR(ch) apr_xlate_conv_byte(ap_hdrs_from_ascii, \ - (unsigned char)ch) +static int convert_a2e[256] = { + 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, + 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, + 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, + 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D, + 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, + 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x06, 0x17, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x09, 0x0A, 0x1B, + 0x30, 0x31, 0x1A, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3A, 0x3B, 0x04, 0x14, 0x3E, 0xFF, + 0x41, 0xAA, 0x4A, 0xB1, 0x9F, 0xB2, 0x6A, 0xB5, 0xBB, 0xB4, 0x9A, 0x8A, 0xB0, 0xCA, 0xAF, 0xBC, + 0x90, 0x8F, 0xEA, 0xFA, 0xBE, 0xA0, 0xB6, 0xB3, 0x9D, 0xDA, 0x9B, 0x8B, 0xB7, 0xB8, 0xB9, 0xAB, + 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9E, 0x68, 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, + 0xAC, 0x69, 0xED, 0xEE, 0xEB, 0xEF, 0xEC, 0xBF, 0x80, 0xFD, 0xFE, 0xFB, 0xFC, 0xBA, 0xAE, 0x59, + 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9C, 0x48, 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, + 0x8C, 0x49, 0xCD, 0xCE, 0xCB, 0xCF, 0xCC, 0xE1, 0x70, 0xDD, 0xDE, 0xDB, 0xDC, 0x8D, 0x8E, 0xDF }; + +static int convert_e2a[256] = { + 0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x9D, 0x0A, 0x08, 0x87, 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x17, 0x1B, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07, + 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, 0x98, 0x99, 0x9A, 0x9B, 0x14, 0x15, 0x9E, 0x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, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0xB3, 0xDB, 0xDC, 0xD9, 0xDA, 0x9F }; +#define RAW_ASCII_CHAR(ch) convert_e2a[(unsigned char)ch] #else /* APR_CHARSET_EBCDIC */ #define RAW_ASCII_CHAR(ch) (ch) #endif /* !APR_CHARSET_EBCDIC */ @@ -139,8 +171,7 @@ static char x2c(const char *what) xstr[2]=what[0]; xstr[3]=what[1]; xstr[4]='\0'; - digit = apr_xlate_conv_byte(ap_hdrs_from_ascii, - 0xFF & strtol(xstr, NULL, 16)); + digit = convert_a2e[0xFF & strtol(xstr, NULL, 16)]; #endif /*APR_CHARSET_EBCDIC*/ return (digit); } @@ -299,7 +330,7 @@ static APR_INLINE unsigned char *c2x(unsigned what, unsigned char prefix, unsigned char *where) { #if APR_CHARSET_EBCDIC - what = apr_xlate_conv_byte(ap_hdrs_to_ascii, (unsigned char)what); + what = convert_e2a[(unsigned char)what]; #endif /*APR_CHARSET_EBCDIC*/ *where++ = prefix; *where++ = c2x_table[what >> 4]; From b214d018f055f8410d5d78150ff56d83a1856fdf Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 3 Jan 2014 18:48:02 +0000 Subject: [PATCH 7388/7878] Happy new 2014! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1555197 13f79535-47bb-0310-9956-ffa450edef68 --- NOTICE | 4 ++-- include/apr_version.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NOTICE b/NOTICE index 6643ee6d75e..b16965be948 100644 --- a/NOTICE +++ b/NOTICE @@ -1,7 +1,7 @@ Apache Portable Runtime -Copyright (c) 2011 The Apache Software Foundation. +Copyright (c) 2000-2014 The Apache Software Foundation. -This product includes software developed by +This product includes software developed at The Apache Software Foundation (http://www.apache.org/). Portions of this software were developed at the National Center diff --git a/include/apr_version.h b/include/apr_version.h index aa08a4dc246..5f21f1aabab 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -38,7 +38,7 @@ */ -#define APR_COPYRIGHT "Copyright (c) 2013 The Apache Software " \ +#define APR_COPYRIGHT "Copyright (c) 2000-2014 The Apache Software " \ "Foundation or its licensors, as applicable." /* The numeric compile-time version constants. These constants are the From 3fb69d4d8e9fba586a360084d3b63dfa508e8f67 Mon Sep 17 00:00:00 2001 From: "Thomas J. Donovan" Date: Mon, 13 Jan 2014 13:59:22 +0000 Subject: [PATCH 7389/7878] Add signed type apr_intptr_t, because intptr_t is C99, and is not recognized by MSVC6. Changed ODBC dbd driver to use apr_intptr_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1557720 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ dbd/apr_dbd_odbc.c | 20 ++++++++++---------- include/apr.h.in | 2 ++ include/apr.hnw | 2 ++ include/apr.hw | 2 ++ include/apr.hwc | 2 ++ 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 8a2ea221b9c..37cd4666a84 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Added signed apr_intptr_t. Changed ODBC dbd driver to use this. + [Tom Donovan] + *) When using shmget-based shared memory, the ID used for ftok is now an APR hash of the filename instead of the constant '1'. PR 53996 [Jim Jagielski] diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index 9747828711b..65306792026 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -114,9 +114,9 @@ struct apr_dbd_t char lastError[MAX_ERROR_STRING]; int defaultBufferSize; /* used for CLOBs in text mode, * and when fld size is indeterminate */ - intptr_t transaction_mode; - intptr_t dboptions; /* driver options re SQLGetData */ - intptr_t default_transaction_mode; + apr_intptr_t transaction_mode; + apr_intptr_t dboptions; /* driver options re SQLGetData */ + apr_intptr_t default_transaction_mode; int can_commit; /* controls end_trans behavior */ }; @@ -359,7 +359,7 @@ static SQLRETURN odbc_set_result_column(int icol, apr_dbd_results_t *res, SQLHANDLE stmt) { SQLRETURN rc; - intptr_t maxsize, textsize, realsize, type, isunsigned = 1; + apr_intptr_t maxsize, textsize, realsize, type, isunsigned = 1; /* discover the sql type */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_UNSIGNED, NULL, 0, NULL, @@ -747,7 +747,7 @@ static void *odbc_get(const apr_dbd_row_t *row, const int col, SQLRETURN rc; SQLLEN indicator; int state = row->res->colstate[col]; - intptr_t options = row->res->apr_dbd->dboptions; + apr_intptr_t options = row->res->apr_dbd->dboptions; switch (state) { case (COL_UNAVAIL): @@ -817,13 +817,13 @@ static apr_status_t odbc_parse_params(apr_pool_t *pool, const char *params, int *connect, SQLCHAR **datasource, SQLCHAR **user, SQLCHAR **password, int *defaultBufferSize, int *nattrs, - int **attrs, intptr_t **attrvals) + int **attrs, apr_intptr_t **attrvals) { char *seps, *last, *next, *name[MAX_PARAMS], *val[MAX_PARAMS]; int nparams = 0, i, j; *attrs = apr_pcalloc(pool, MAX_PARAMS * sizeof(char *)); - *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(intptr_t)); + *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(apr_intptr_t)); *nattrs = 0; seps = DEFAULTSEPS; name[nparams] = apr_strtok(apr_pstrdup(pool, params), seps, &last); @@ -1063,7 +1063,7 @@ static apr_dbd_t *odbc_open(apr_pool_t *pool, const char *params, const char **e SQLCHAR *datasource = (SQLCHAR *)"", *user = (SQLCHAR *)"", *password = (SQLCHAR *)""; int nattrs = 0, *attrs = NULL, connect = 0; - intptr_t *attrvals = NULL; + apr_intptr_t *attrvals = NULL; err_step = "SQLAllocHandle (SQL_HANDLE_DBC)"; err_htype = SQL_HANDLE_ENV; @@ -1117,10 +1117,10 @@ static apr_dbd_t *odbc_open(apr_pool_t *pool, const char *params, const char **e handle->default_transaction_mode = 0; handle->can_commit = APR_DBD_TRANSACTION_IGNORE_ERRORS; SQLGetInfo(hdbc, SQL_DEFAULT_TXN_ISOLATION, - &(handle->default_transaction_mode), sizeof(intptr_t), NULL); + &(handle->default_transaction_mode), sizeof(apr_intptr_t), NULL); handle->transaction_mode = handle->default_transaction_mode; SQLGetInfo(hdbc, SQL_GETDATA_EXTENSIONS ,&(handle->dboptions), - sizeof(intptr_t), NULL); + sizeof(apr_intptr_t), NULL); apr_pool_cleanup_register(pool, handle, odbc_close_cleanup, apr_pool_cleanup_null); return handle; } diff --git a/include/apr.h.in b/include/apr.h.in index 9cc7e31f0b9..9d6ebb4304e 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -380,8 +380,10 @@ typedef @ino_t_value@ apr_ino_t; #if APR_SIZEOF_VOIDP == 8 typedef apr_uint64_t apr_uintptr_t; +typedef apr_int64_t apr_intptr_t; #else typedef apr_uint32_t apr_uintptr_t; +typedef apr_int32_t apr_intptr_t; #endif /* Are we big endian? */ diff --git a/include/apr.hnw b/include/apr.hnw index 7781063bc17..120201bcee5 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -269,8 +269,10 @@ typedef apr_uint64_t apr_ino_t; #if APR_SIZEOF_VOIDP == 8 typedef apr_uint64_t apr_uintptr_t; +typedef apr_int64_t apr_intptr_t; #else typedef apr_uint32_t apr_uintptr_t; +typedef apr_int32_t apr_intptr_t; #endif /* Mechanisms to properly type numeric literals */ diff --git a/include/apr.hw b/include/apr.hw index fd34ad42c79..94bf7607ed3 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -407,8 +407,10 @@ typedef apr_uint64_t apr_ino_t; #if APR_SIZEOF_VOIDP == 8 typedef apr_uint64_t apr_uintptr_t; +typedef apr_int64_t apr_intptr_t; #else typedef apr_uint32_t apr_uintptr_t; +typedef apr_int32_t apr_intptr_t; #endif /* Are we big endian? */ diff --git a/include/apr.hwc b/include/apr.hwc index ebc6ca54d10..061a5299c0c 100644 --- a/include/apr.hwc +++ b/include/apr.hwc @@ -407,8 +407,10 @@ typedef apr_uint64_t apr_ino_t; #if APR_SIZEOF_VOIDP == 8 typedef apr_uint64_t apr_uintptr_t; +typedef apr_int64_t apr_intptr_t; #else typedef apr_uint32_t apr_uintptr_t; +typedef apr_int32_t apr_intptr_t; #endif /* Are we big endian? */ From c0a82754994a45d54a37bb928da6f54ba3b0a609 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 16 Jan 2014 19:51:44 +0000 Subject: [PATCH 7390/7878] Build system support for Win9x was removed in r891502. (There's still dead code to be removed over time.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1558898 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 37cd4666a84..965c3b59a79 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Windows platform: Remove support for Windows 9x. + *) Added signed apr_intptr_t. Changed ODBC dbd driver to use this. [Tom Donovan] From f3324d1882b7559c0917b5985ab3209d70fd8ce3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 16 Jan 2014 20:23:49 +0000 Subject: [PATCH 7391/7878] Doxygen formatting fixes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1558905 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index 682deae3088..c86217f9195 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -111,19 +111,19 @@ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); *
      * The extensions are:
      *
    - * %%pA	takes a struct in_addr *, and prints it as a.b.c.d
    - * %%pI	takes an apr_sockaddr_t * and prints it as a.b.c.d:port or
    - *      [ipv6-address]:port
    - * %%pT takes an apr_os_thread_t * and prints it in decimal
    - *      ('0' is printed if !APR_HAS_THREADS)
    - * %%pt takes an apr_os_thread_t * and prints it in hexadecimal
    - *      ('0' is printed if !APR_HAS_THREADS)
    - * %%pm takes an apr_status_t * and prints the appropriate error
    - *      string (from apr_strerror) corresponding to that error code.
    - * %%pp takes a void * and outputs it in hex
    - * %%pB takes a apr_uint32_t * as bytes and outputs it's apr_strfsize
    - * %%pF same as above, but takes a apr_off_t *
    - * %%pS same as above, but takes a apr_size_t *
    + * - %%pA takes a struct in_addr *, and prints it as a.b.c.d
    + * - %%pI takes an apr_sockaddr_t * and prints it as a.b.c.d:port or
    + * \[ipv6-address\]:port
    + * - %%pT takes an apr_os_thread_t * and prints it in decimal
    + * ('0' is printed if !APR_HAS_THREADS)
    + * - %%pt takes an apr_os_thread_t * and prints it in hexadecimal
    + * ('0' is printed if !APR_HAS_THREADS)
    + * - %%pm takes an apr_status_t * and prints the appropriate error
    + * string (from apr_strerror) corresponding to that error code.
    + * - %%pp takes a void * and outputs it in hex
    + * - %%pB takes a apr_uint32_t * as bytes and outputs it's apr_strfsize
    + * - %%pF same as above, but takes a apr_off_t *
    + * - %%pS same as above, but takes a apr_size_t *
      *
      * %%pA, %%pI, %%pT, %%pp are available from APR 1.0.0 onwards (and in 0.9.x).
      * %%pt is only available from APR 1.2.0 onwards.
    
    From fbf90778510c2724b5eeb1c1ca06e3b9ed27d941 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Sat, 18 Jan 2014 13:40:24 +0000
    Subject: [PATCH 7392/7878] stop using deprecated versions of APR_FOPEN_* and
     APR_FPROT_*
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1559343 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/netware/filestat.c | 24 ++++++-------
     file_io/netware/mktemp.c   |  2 +-
     file_io/unix/copy.c        |  4 +--
     file_io/unix/fileacc.c     | 48 +++++++++++++-------------
     file_io/unix/filestat.c    | 24 ++++++-------
     file_io/unix/mktemp.c      |  2 +-
     file_io/unix/open.c        |  2 +-
     file_io/unix/readwrite.c   |  2 +-
     file_io/win32/filestat.c   | 18 +++++-----
     include/apr_sdbm.h         | 19 +++++-----
     locks/unix/proc_mutex.c    |  4 +--
     memory/unix/apr_pools.c    |  5 +--
     shmem/unix/shm.c           | 24 ++++++-------
     shmem/win32/shm.c          |  6 ++--
     test/sendfile.c            |  2 +-
     test/testbuckets.c         |  4 +--
     test/testdbm.c             |  4 +--
     test/testdir.c             | 22 +++++++-----
     test/testdup.c             |  8 ++---
     test/testfile.c            | 71 ++++++++++++++++++++------------------
     test/testfilecopy.c        | 12 +++----
     test/testfileinfo.c        |  8 ++---
     test/testflock.c           |  2 +-
     test/testlfs.c             | 16 ++++-----
     test/testmmap.c            |  3 +-
     test/testproc.c            |  6 ++--
     test/tryread.c             |  2 +-
     threadproc/os2/proc.c      |  3 +-
     28 files changed, 180 insertions(+), 167 deletions(-)
    
    diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c
    index 662795128b1..85d73c30d13 100644
    --- a/file_io/netware/filestat.c
    +++ b/file_io/netware/filestat.c
    @@ -160,16 +160,16 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname,
         {
             if (attributes & APR_FILE_ATTR_READONLY)
             {
    -            finfo.protection &= ~APR_UWRITE;
    -            finfo.protection &= ~APR_GWRITE;
    -            finfo.protection &= ~APR_WWRITE;
    +            finfo.protection &= ~APR_FPROT_UWRITE;
    +            finfo.protection &= ~APR_FPROT_GWRITE;
    +            finfo.protection &= ~APR_FPROT_WWRITE;
             }
             else
             {
                 /* ### umask this! */
    -            finfo.protection |= APR_UWRITE;
    -            finfo.protection |= APR_GWRITE;
    -            finfo.protection |= APR_WWRITE;
    +            finfo.protection |= APR_FPROT_UWRITE;
    +            finfo.protection |= APR_FPROT_GWRITE;
    +            finfo.protection |= APR_FPROT_WWRITE;
             }
         }
     
    @@ -178,15 +178,15 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname,
             if (attributes & APR_FILE_ATTR_EXECUTABLE)
             {
                 /* ### umask this! */
    -            finfo.protection |= APR_UEXECUTE;
    -            finfo.protection |= APR_GEXECUTE;
    -            finfo.protection |= APR_WEXECUTE;
    +            finfo.protection |= APR_FPROT_UEXECUTE;
    +            finfo.protection |= APR_FPROT_GEXECUTE;
    +            finfo.protection |= APR_FPROT_WEXECUTE;
             }
             else
             {
    -            finfo.protection &= ~APR_UEXECUTE;
    -            finfo.protection &= ~APR_GEXECUTE;
    -            finfo.protection &= ~APR_WEXECUTE;
    +            finfo.protection &= ~APR_FPROT_UEXECUTE;
    +            finfo.protection &= ~APR_FPROT_GEXECUTE;
    +            finfo.protection &= ~APR_FPROT_WEXECUTE;
             }
         }
     
    diff --git a/file_io/netware/mktemp.c b/file_io/netware/mktemp.c
    index 4f78226e63d..f37cab85bdc 100644
    --- a/file_io/netware/mktemp.c
    +++ b/file_io/netware/mktemp.c
    @@ -40,7 +40,7 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i
          */
         close(fd);
         if ((rv = apr_file_open(fp, template, flags|APR_FOPEN_NOCLEANUP,
    -                            APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) {
    +                            APR_FPROT_UREAD | APR_FPROT_UWRITE, p)) == APR_SUCCESS) {
     
     
     	if (!(flags & APR_FOPEN_NOCLEANUP)) {
    diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c
    index df3a49c8209..91e4f550841 100644
    --- a/file_io/unix/copy.c
    +++ b/file_io/unix/copy.c
    @@ -29,12 +29,12 @@ static apr_status_t apr_file_transfer_contents(const char *from_path,
         apr_fileperms_t perms;
     
         /* Open source file. */
    -    status = apr_file_open(&s, from_path, APR_FOPEN_READ, APR_OS_DEFAULT, pool);
    +    status = apr_file_open(&s, from_path, APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, pool);
         if (status)
             return status;
     
         /* Maybe get its permissions. */
    -    if (to_perms == APR_FILE_SOURCE_PERMS) {
    +    if (to_perms == APR_FPROT_FILE_SOURCE_PERMS) {
             status = apr_file_info_get(&finfo, APR_FINFO_PROT, s);
             if (status != APR_SUCCESS && status != APR_INCOMPLETE) {
                 apr_file_close(s);  /* toss any error */
    diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c
    index 437f3589f55..d44e4e17b3b 100644
    --- a/file_io/unix/fileacc.c
    +++ b/file_io/unix/fileacc.c
    @@ -36,33 +36,33 @@ mode_t apr_unix_perms2mode(apr_fileperms_t perms)
     {
         mode_t mode = 0;
     
    -    if (perms & APR_USETID)
    +    if (perms & APR_FPROT_USETID)
             mode |= S_ISUID;
    -    if (perms & APR_UREAD)
    +    if (perms & APR_FPROT_UREAD)
             mode |= S_IRUSR;
    -    if (perms & APR_UWRITE)
    +    if (perms & APR_FPROT_UWRITE)
             mode |= S_IWUSR;
    -    if (perms & APR_UEXECUTE)
    +    if (perms & APR_FPROT_UEXECUTE)
             mode |= S_IXUSR;
     
    -    if (perms & APR_GSETID)
    +    if (perms & APR_FPROT_GSETID)
             mode |= S_ISGID;
    -    if (perms & APR_GREAD)
    +    if (perms & APR_FPROT_GREAD)
             mode |= S_IRGRP;
    -    if (perms & APR_GWRITE)
    +    if (perms & APR_FPROT_GWRITE)
             mode |= S_IWGRP;
    -    if (perms & APR_GEXECUTE)
    +    if (perms & APR_FPROT_GEXECUTE)
             mode |= S_IXGRP;
     
     #ifdef S_ISVTX
    -    if (perms & APR_WSTICKY)
    +    if (perms & APR_FPROT_WSTICKY)
             mode |= S_ISVTX;
     #endif
    -    if (perms & APR_WREAD)
    +    if (perms & APR_FPROT_WREAD)
             mode |= S_IROTH;
    -    if (perms & APR_WWRITE)
    +    if (perms & APR_FPROT_WWRITE)
             mode |= S_IWOTH;
    -    if (perms & APR_WEXECUTE)
    +    if (perms & APR_FPROT_WEXECUTE)
             mode |= S_IXOTH;
     
         return mode;
    @@ -73,33 +73,33 @@ apr_fileperms_t apr_unix_mode2perms(mode_t mode)
         apr_fileperms_t perms = 0;
     
         if (mode & S_ISUID)
    -        perms |= APR_USETID;
    +        perms |= APR_FPROT_USETID;
         if (mode & S_IRUSR)
    -        perms |= APR_UREAD;
    +        perms |= APR_FPROT_UREAD;
         if (mode & S_IWUSR)
    -        perms |= APR_UWRITE;
    +        perms |= APR_FPROT_UWRITE;
         if (mode & S_IXUSR)
    -        perms |= APR_UEXECUTE;
    +        perms |= APR_FPROT_UEXECUTE;
     
         if (mode & S_ISGID)
    -        perms |= APR_GSETID;
    +        perms |= APR_FPROT_GSETID;
         if (mode & S_IRGRP)
    -        perms |= APR_GREAD;
    +        perms |= APR_FPROT_GREAD;
         if (mode & S_IWGRP)
    -        perms |= APR_GWRITE;
    +        perms |= APR_FPROT_GWRITE;
         if (mode & S_IXGRP)
    -        perms |= APR_GEXECUTE;
    +        perms |= APR_FPROT_GEXECUTE;
     
     #ifdef S_ISVTX
         if (mode & S_ISVTX)
    -        perms |= APR_WSTICKY;
    +        perms |= APR_FPROT_WSTICKY;
     #endif
         if (mode & S_IROTH)
    -        perms |= APR_WREAD;
    +        perms |= APR_FPROT_WREAD;
         if (mode & S_IWOTH)
    -        perms |= APR_WWRITE;
    +        perms |= APR_FPROT_WWRITE;
         if (mode & S_IXOTH)
    -        perms |= APR_WEXECUTE;
    +        perms |= APR_FPROT_WEXECUTE;
     
         return perms;
     }
    diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c
    index 220efd08602..65918c2127e 100644
    --- a/file_io/unix/filestat.c
    +++ b/file_io/unix/filestat.c
    @@ -203,16 +203,16 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname,
         {
             if (attributes & APR_FILE_ATTR_READONLY)
             {
    -            finfo.protection &= ~APR_UWRITE;
    -            finfo.protection &= ~APR_GWRITE;
    -            finfo.protection &= ~APR_WWRITE;
    +            finfo.protection &= ~APR_FPROT_UWRITE;
    +            finfo.protection &= ~APR_FPROT_GWRITE;
    +            finfo.protection &= ~APR_FPROT_WWRITE;
             }
             else
             {
                 /* ### umask this! */
    -            finfo.protection |= APR_UWRITE;
    -            finfo.protection |= APR_GWRITE;
    -            finfo.protection |= APR_WWRITE;
    +            finfo.protection |= APR_FPROT_UWRITE;
    +            finfo.protection |= APR_FPROT_GWRITE;
    +            finfo.protection |= APR_FPROT_WWRITE;
             }
         }
     
    @@ -221,15 +221,15 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname,
             if (attributes & APR_FILE_ATTR_EXECUTABLE)
             {
                 /* ### umask this! */
    -            finfo.protection |= APR_UEXECUTE;
    -            finfo.protection |= APR_GEXECUTE;
    -            finfo.protection |= APR_WEXECUTE;
    +            finfo.protection |= APR_FPROT_UEXECUTE;
    +            finfo.protection |= APR_FPROT_GEXECUTE;
    +            finfo.protection |= APR_FPROT_WEXECUTE;
             }
             else
             {
    -            finfo.protection &= ~APR_UEXECUTE;
    -            finfo.protection &= ~APR_GEXECUTE;
    -            finfo.protection &= ~APR_WEXECUTE;
    +            finfo.protection &= ~APR_FPROT_UEXECUTE;
    +            finfo.protection &= ~APR_FPROT_GEXECUTE;
    +            finfo.protection &= ~APR_FPROT_WEXECUTE;
             }
         }
     
    diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c
    index 28aaf90e25e..89d9842d419 100644
    --- a/file_io/unix/mktemp.c
    +++ b/file_io/unix/mktemp.c
    @@ -141,7 +141,7 @@ static int gettemp(char *path, apr_file_t **doopen, apr_int32_t flags, apr_pool_
     
         for (;;) {
             if ((rv = apr_file_open(doopen, path, flags,
    -                                APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS)
    +                                APR_FPROT_UREAD | APR_FPROT_UWRITE, p)) == APR_SUCCESS)
                 return APR_SUCCESS;
             if (!APR_STATUS_IS_EEXIST(rv))
                 return rv;
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index 1e7b5118301..770d438ae34 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -170,7 +170,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
         }
     #endif
     
    -    if (perm == APR_OS_DEFAULT) {
    +    if (perm == APR_FPROT_OS_DEFAULT) {
             fd = open(fname, oflags, 0666);
         }
         else {
    diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c
    index 98de9e0e119..dd424cd647a 100644
    --- a/file_io/unix/readwrite.c
    +++ b/file_io/unix/readwrite.c
    @@ -170,7 +170,7 @@ static apr_status_t do_rotating_check(apr_file_t *thefile, apr_time_t now)
                 close(thefile->filedes);
                 thefile->filedes = -1;
     
    -            if (thefile->rotating->perm == APR_OS_DEFAULT) {
    +            if (thefile->rotating->perm == APR_FPROT_OS_DEFAULT) {
                     thefile->filedes = open(thefile->fname,
                                             thefile->rotating->oflags,
                                             0666);
    diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
    index 79193bdccb3..20397d22aad 100644
    --- a/file_io/win32/filestat.c
    +++ b/file_io/win32/filestat.c
    @@ -80,11 +80,11 @@ static apr_fileperms_t convert_prot(ACCESS_MASK acc, prot_scope_e scope)
          */
         apr_fileperms_t prot = 0;
         if (acc & FILE_EXECUTE)
    -        prot |= APR_WEXECUTE;
    +        prot |= APR_FPROT_WEXECUTE;
         if (acc & FILE_WRITE_DATA)
    -        prot |= APR_WWRITE;
    +        prot |= APR_FPROT_WWRITE;
         if (acc & FILE_READ_DATA)
    -        prot |= APR_WREAD;
    +        prot |= APR_FPROT_WREAD;
         return (prot << scope);
     }
     
    @@ -157,7 +157,7 @@ static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname,
                               | ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0)
                               | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER))
                                     ? APR_READCONTROL : 0),
    -                            APR_OS_DEFAULT, pool)) == APR_SUCCESS) {
    +                            APR_FPROT_OS_DEFAULT, pool)) == APR_SUCCESS) {
             rv = apr_file_info_get(finfo, wanted, thefile);
             finfo->filehand = NULL;
             apr_file_close(thefile);
    @@ -169,7 +169,7 @@ static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname,
              */
             if ((rv = apr_file_open(&thefile, fname, APR_OPENINFO
                                   | ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0),
    -                                APR_OS_DEFAULT, pool)) == APR_SUCCESS) {
    +                                APR_FPROT_OS_DEFAULT, pool)) == APR_SUCCESS) {
                 rv = apr_file_info_get(finfo, wanted & ~(APR_FINFO_PROT 
                                                      | APR_FINFO_OWNER),
                                      thefile);
    @@ -197,10 +197,10 @@ static apr_status_t guess_protection_bits(apr_finfo_t *finfo,
          * The same holds on NT if a file doesn't have a DACL (e.g., on FAT)
          */
         if (finfo->protection & APR_FREADONLY) {
    -        finfo->protection |= APR_WREAD | APR_WEXECUTE;
    +        finfo->protection |= APR_FPROT_WREAD | APR_FPROT_WEXECUTE;
         }
         else {
    -        finfo->protection |= APR_WREAD | APR_WEXECUTE | APR_WWRITE;
    +        finfo->protection |= APR_FPROT_WREAD | APR_FPROT_WEXECUTE | APR_FPROT_WWRITE;
         }
         finfo->protection |= (finfo->protection << prot_scope_group)
                            | (finfo->protection << prot_scope_user);
    @@ -590,7 +590,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
                     finfo->pool = pool;
                     finfo->filetype = 0;
                     finfo->mtime = apr_time_now();
    -                finfo->protection |= APR_WREAD | APR_WEXECUTE | APR_WWRITE;
    +                finfo->protection |= APR_FPROT_WREAD | APR_FPROT_WEXECUTE | APR_FPROT_WWRITE;
                     finfo->protection |= (finfo->protection << prot_scope_group) 
                                        | (finfo->protection << prot_scope_user);
                     finfo->valid |= APR_FINFO_TYPE | APR_FINFO_PROT 
    @@ -782,7 +782,7 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname,
     
         rv = apr_file_open(&thefile, fname,
                            APR_FOPEN_READ | APR_WRITEATTRS,
    -                       APR_OS_DEFAULT, pool);
    +                       APR_FPROT_OS_DEFAULT, pool);
         if (!rv)
         {
             FILETIME file_ctime;
    diff --git a/include/apr_sdbm.h b/include/apr_sdbm.h
    index 59fd3488a3a..632ee2386c3 100644
    --- a/include/apr_sdbm.h
    +++ b/include/apr_sdbm.h
    @@ -69,14 +69,15 @@ typedef struct {
      * Open an sdbm database by file name
      * @param db The newly opened database
      * @param name The sdbm file to open
    - * @param mode The flag values (APR_READ and APR_BINARY flags are implicit)
    + * @param mode The flag values (APR_FOPEN_READ and APR_FOPEN_BINARY flags are
    + * implicit)
      * 
    - *           APR_WRITE          open for read-write access
    - *           APR_CREATE         create the sdbm if it does not exist
    - *           APR_TRUNCATE       empty the contents of the sdbm
    - *           APR_EXCL           fail for APR_CREATE if the file exists
    - *           APR_DELONCLOSE     delete the sdbm when closed
    - *           APR_SHARELOCK      support locking across process/machines
    + *           APR_FOPEN_WRITE      open for read-write access
    + *           APR_FOPEN_CREATE     create the sdbm if it does not exist
    + *           APR_FOPEN_TRUNCATE   empty the contents of the sdbm
    + *           APR_FOPEN_EXCL       fail for APR_FOPEN_CREATE if the file exists
    + *           APR_FOPEN_DELONCLOSE delete the sdbm when closed
    + *           APR_FOPEN_SHARELOCK  support locking across process/machines
      * 
    * @param perms Permissions to apply to if created * @param p The pool to use when creating the sdbm @@ -106,7 +107,7 @@ APR_DECLARE(apr_status_t) apr_sdbm_close(apr_sdbm_t *db); * portably promoted to an APR_FLOCK_EXCLUSIVE lock, apr_sdbm_store and * apr_sdbm_delete calls will fail if an APR_FLOCK_SHARED lock is held. * The apr_sdbm_lock call requires the database to be opened with the - * APR_SHARELOCK mode value. + * APR_FOPEN_SHARELOCK mode value. */ APR_DECLARE(apr_status_t) apr_sdbm_lock(apr_sdbm_t *db, int type); @@ -154,7 +155,7 @@ APR_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db, * @param db The database * @param key The key datum of the first record * @remark The keys returned are not ordered. To traverse the list of keys - * for an sdbm opened with APR_SHARELOCK, the caller must use apr_sdbm_lock + * for an sdbm opened with APR_FOPEN_SHARELOCK, the caller must use apr_sdbm_lock * prior to retrieving the first record, and hold the lock until after the * last call to apr_sdbm_nextkey. */ diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 2c154516f01..728506583b2 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -570,7 +570,7 @@ static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, new_mutex->fname = apr_pstrdup(new_mutex->pool, fname); rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_EXCL, - APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD, + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD | APR_FPROT_WREAD, new_mutex->pool); } else { @@ -707,7 +707,7 @@ static apr_status_t proc_mutex_flock_create(apr_proc_mutex_t *new_mutex, new_mutex->fname = apr_pstrdup(new_mutex->pool, fname); rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_EXCL, - APR_UREAD | APR_UWRITE, + APR_FPROT_UREAD | APR_FPROT_UWRITE, new_mutex->pool); } else { diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 45b2be2cad2..b516187afc2 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1526,8 +1526,9 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) * may attempt to use then then non-NULL but partially set up file * object. */ if (rv == APR_SUCCESS) { - apr_file_open(&debug_log, logpath, APR_APPEND|APR_WRITE|APR_CREATE, - APR_OS_DEFAULT, global_pool); + apr_file_open(&debug_log, logpath, + APR_FOPEN_APPEND|APR_FOPEN_WRITE|APR_FOPEN_CREATE, + APR_FPROT_OS_DEFAULT, global_pool); } else { apr_file_open_stderr(&debug_log, global_pool); diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 27a29e67c99..d93a98beacd 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -122,8 +122,8 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, new_m->filename = NULL; #if APR_USE_SHMEM_MMAP_ZERO - status = apr_file_open(&file, "/dev/zero", APR_READ | APR_WRITE, - APR_OS_DEFAULT, pool); + status = apr_file_open(&file, "/dev/zero", APR_FOPEN_READ | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, pool); if (status != APR_SUCCESS) { return status; } @@ -231,10 +231,10 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, status = APR_SUCCESS; #if APR_USE_SHMEM_MMAP_TMP - /* FIXME: Is APR_OS_DEFAULT sufficient? */ + /* FIXME: Is APR_FPROT_OS_DEFAULT sufficient? */ status = apr_file_open(&file, filename, - APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, - APR_OS_DEFAULT, pool); + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL, + APR_FPROT_OS_DEFAULT, pool); if (status != APR_SUCCESS) { return status; } @@ -269,7 +269,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, } status = apr_os_file_put(&file, &tmpfd, - APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL, pool); if (status != APR_SUCCESS) { return status; @@ -304,10 +304,10 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #elif APR_USE_SHMEM_SHMGET new_m->realsize = reqsize; - /* FIXME: APR_OS_DEFAULT is too permissive, switch to 600 I think. */ + /* FIXME: APR_FPROT_OS_DEFAULT is too permissive, switch to 600 I think. */ status = apr_file_open(&file, filename, APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL, - APR_OS_DEFAULT, pool); + APR_FPROT_OS_DEFAULT, pool); if (status != APR_SUCCESS) { return status; } @@ -399,7 +399,7 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, #elif APR_USE_SHMEM_SHMGET /* Presume that the file already exists; just open for writing */ status = apr_file_open(&file, filename, APR_FOPEN_WRITE, - APR_OS_DEFAULT, pool); + APR_FPROT_OS_DEFAULT, pool); if (status) { return status; } @@ -491,8 +491,8 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, new_m->filename = apr_pstrdup(pool, filename); status = apr_file_open(&file, filename, - APR_READ | APR_WRITE, - APR_OS_DEFAULT, pool); + APR_FOPEN_READ | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, pool); if (status != APR_SUCCESS) { return status; } @@ -544,7 +544,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, new_m = apr_palloc(pool, sizeof(apr_shm_t)); status = apr_file_open(&file, filename, - APR_FOPEN_READ, APR_OS_DEFAULT, pool); + APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, pool); if (status != APR_SUCCESS) { return status; } diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index af0115e44f4..28ce9406ba5 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -158,13 +158,13 @@ APR_DECLARE(apr_status_t) apr_shm_create_ex(apr_shm_t **m, int global; /* Do file backed, which is not an inherited handle - * While we could open APR_EXCL, it doesn't seem that Unix + * While we could open APR_FOPEN_EXCL, it doesn't seem that Unix * ever did. Ignore that error here, but fail later when * we discover we aren't the creator of the file map object. */ rv = apr_file_open(&f, file, - APR_READ | APR_WRITE | APR_BINARY | APR_CREATE, - APR_UREAD | APR_UWRITE, pool); + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_BINARY | APR_FOPEN_CREATE, + APR_FPROT_UREAD | APR_FPROT_UWRITE, pool); if ((rv != APR_SUCCESS) || ((rv = apr_os_file_get(&hFile, f)) != APR_SUCCESS)) { return rv; diff --git a/test/sendfile.c b/test/sendfile.c index f92b305f03e..f8de309846a 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -97,7 +97,7 @@ static void create_testfile(apr_pool_t *p, const char *fname) printf("Creating a test file...\n"); rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_TRUNCATE | APR_FOPEN_BUFFERED, - APR_UREAD | APR_UWRITE, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE, p); if (rv) { aprerr("apr_file_open()", rv); } diff --git a/test/testbuckets.c b/test/testbuckets.c index e00f61eb134..077a139361d 100644 --- a/test/testbuckets.c +++ b/test/testbuckets.c @@ -317,7 +317,7 @@ static void test_insertfile(abts_case *tc, void *ctx) apr_file_open(&f, TIF_FNAME, APR_FOPEN_WRITE | APR_FOPEN_TRUNCATE | APR_FOPEN_CREATE | APR_FOPEN_SPARSE, - APR_OS_DEFAULT, p) == APR_SUCCESS); + APR_FPROT_OS_DEFAULT, p) == APR_SUCCESS); if (apr_file_trunc(f, bignum)) { apr_file_close(f); @@ -369,7 +369,7 @@ static apr_file_t *make_test_file(abts_case *tc, const char *fname, ABTS_ASSERT(tc, "create test file", apr_file_open(&f, fname, APR_FOPEN_READ|APR_FOPEN_WRITE|APR_FOPEN_TRUNCATE|APR_FOPEN_CREATE, - APR_OS_DEFAULT, p) == APR_SUCCESS); + APR_FPROT_OS_DEFAULT, p) == APR_SUCCESS); ABTS_ASSERT(tc, "write test file contents", apr_file_puts(contents, f) == APR_SUCCESS); diff --git a/test/testdbm.c b/test/testdbm.c index 4f6becb46d0..aaea4116bc2 100644 --- a/test/testdbm.c +++ b/test/testdbm.c @@ -171,7 +171,7 @@ static void test_dbm(abts_case *tc, void *data) const char *type = data; const char *file = apr_pstrcat(p, "data/test-", type, NULL); - rv = apr_dbm_open_ex(&db, type, file, APR_DBM_RWCREATE, APR_OS_DEFAULT, p); + rv = apr_dbm_open_ex(&db, type, file, APR_DBM_RWCREATE, APR_FPROT_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); if (rv != APR_SUCCESS) @@ -187,7 +187,7 @@ static void test_dbm(abts_case *tc, void *data) apr_dbm_close(db); - rv = apr_dbm_open_ex(&db, type, file, APR_DBM_READONLY, APR_OS_DEFAULT, p); + rv = apr_dbm_open_ex(&db, type, file, APR_DBM_READONLY, APR_FPROT_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); if (rv != APR_SUCCESS) diff --git a/test/testdir.c b/test/testdir.c index 417a1d7b226..08ee7ec2c57 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -29,7 +29,9 @@ static void test_mkdir(abts_case *tc, void *data) apr_status_t rv; apr_finfo_t finfo; - rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); + rv = apr_dir_make("data/testdir", + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, + p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p); @@ -43,7 +45,8 @@ static void test_mkdir_recurs(abts_case *tc, void *data) apr_finfo_t finfo; rv = apr_dir_make_recursive("data/one/two/three", - APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, + p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, "data/one", APR_FINFO_TYPE, p); @@ -105,10 +108,12 @@ static void test_mkdir_twice(abts_case *tc, void *data) { apr_status_t rv; - rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); + rv = apr_dir_make("data/testdir", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, + p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); + rv = apr_dir_make("data/testdir", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, + p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EEXIST(rv)); rv = apr_dir_remove("data/testdir", p); @@ -175,12 +180,13 @@ static void test_uncleared_errno(abts_case *tc, void *data) apr_dir_t *this_dir; apr_status_t rv; - rv = apr_dir_make("dir1", APR_OS_DEFAULT, p); + rv = apr_dir_make("dir1", APR_FPROT_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_dir_make("dir2", APR_OS_DEFAULT, p); + rv = apr_dir_make("dir2", APR_FPROT_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_open(&thefile, "dir1/file1", - APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE, APR_OS_DEFAULT, p); + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE, + APR_FPROT_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_close(thefile); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -224,7 +230,7 @@ static void test_rmkdir_nocwd(abts_case *tc, void *data) char *cwd, *path; APR_ASSERT_SUCCESS(tc, "make temp dir", - apr_dir_make("dir3", APR_OS_DEFAULT, p)); + apr_dir_make("dir3", APR_FPROT_OS_DEFAULT, p)); APR_ASSERT_SUCCESS(tc, "obtain cwd", apr_filepath_get(&cwd, 0, p)); diff --git a/test/testdup.c b/test/testdup.c index fd88f223ee3..2a261f2d798 100644 --- a/test/testdup.c +++ b/test/testdup.c @@ -35,7 +35,7 @@ static void test_file_dup(abts_case *tc, void *data) /* First, create a new file, empty... */ rv = apr_file_open(&file1, FILEPATH "testdup.file", APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | - APR_FOPEN_DELONCLOSE, APR_OS_DEFAULT, p); + APR_FOPEN_DELONCLOSE, APR_FPROT_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, file1); @@ -66,7 +66,7 @@ static void test_file_readwrite(abts_case *tc, void *data) /* First, create a new file, empty... */ rv = apr_file_open(&file1, FILEPATH "testdup.readwrite.file", APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | - APR_FOPEN_DELONCLOSE, APR_OS_DEFAULT, p); + APR_FOPEN_DELONCLOSE, APR_FPROT_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, file1); @@ -107,7 +107,7 @@ static void test_dup2(abts_case *tc, void *data) rv = apr_file_open(&testfile, FILEPATH "testdup2.file", APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | - APR_FOPEN_DELONCLOSE, APR_OS_DEFAULT, p); + APR_FOPEN_DELONCLOSE, APR_FPROT_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, testfile); @@ -144,7 +144,7 @@ static void test_dup2_readwrite(abts_case *tc, void *data) rv = apr_file_open(&testfile, FILEPATH "testdup2.readwrite.file", APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | - APR_FOPEN_DELONCLOSE, APR_OS_DEFAULT, p); + APR_FOPEN_DELONCLOSE, APR_FPROT_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, testfile); diff --git a/test/testfile.c b/test/testfile.c index fa494a2938d..99c6255e3e6 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -39,7 +39,7 @@ static void test_open_noreadwrite(abts_case *tc, void *data) rv = apr_file_open(&thefile, FILENAME, APR_FOPEN_CREATE | APR_FOPEN_EXCL, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); ABTS_TRUE(tc, rv != APR_SUCCESS); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EACCES(rv)); ABTS_PTR_EQUAL(tc, NULL, thefile); @@ -52,7 +52,7 @@ static void test_open_excl(abts_case *tc, void *data) rv = apr_file_open(&thefile, FILENAME, APR_FOPEN_CREATE | APR_FOPEN_EXCL | APR_FOPEN_WRITE, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); ABTS_TRUE(tc, rv != APR_SUCCESS); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EEXIST(rv)); ABTS_PTR_EQUAL(tc, NULL, thefile); @@ -65,7 +65,7 @@ static void test_open_read(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, filetest); apr_file_close(filetest); @@ -97,7 +97,7 @@ static void test_read(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); @@ -115,7 +115,7 @@ static void test_readzero(abts_case *tc, void *data) char *str = NULL; apr_file_t *filetest; - rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ, APR_OS_DEFAULT, p); + rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); @@ -133,7 +133,7 @@ static void test_filename(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); rv = apr_file_name_get(&str, filetest); @@ -152,7 +152,7 @@ static void test_fileclose(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); rv = apr_file_close(filetest); @@ -171,7 +171,7 @@ static void test_file_remove(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); } @@ -183,7 +183,7 @@ static void test_open_write(abts_case *tc, void *data) filetest = NULL; rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_WRITE, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); ABTS_PTR_EQUAL(tc, NULL, filetest); } @@ -196,7 +196,7 @@ static void test_open_writecreate(abts_case *tc, void *data) filetest = NULL; rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_WRITE | APR_FOPEN_CREATE, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); apr_file_close(filetest); @@ -210,7 +210,7 @@ static void test_write(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_WRITE | APR_FOPEN_CREATE, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_write(filetest, TESTSTR, &bytes); @@ -227,7 +227,7 @@ static void test_open_readwrite(abts_case *tc, void *data) filetest = NULL; rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ | APR_FOPEN_WRITE, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, filetest); @@ -244,7 +244,7 @@ static void test_seek(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); @@ -268,7 +268,7 @@ static void test_seek(abts_case *tc, void *data) buffered files. */ rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ | APR_FOPEN_BUFFERED, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv); offset = -5; @@ -293,7 +293,7 @@ static void test_userdata_set(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_WRITE, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_data_set(filetest, "This is a test", @@ -311,7 +311,7 @@ static void test_userdata_get(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_WRITE, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_data_set(filetest, "This is a test", @@ -334,7 +334,7 @@ static void test_userdata_getnokey(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_WRITE, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_data_get(&teststr, "nokey", filetest); @@ -352,7 +352,7 @@ static void test_buffer_set_get(abts_case *tc, void *data) rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_WRITE | APR_FOPEN_BUFFERED, - APR_UREAD | APR_UWRITE | APR_GREAD, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); bufsize = apr_file_buffer_size_get(filetest); @@ -467,7 +467,7 @@ static void test_bigread(abts_case *tc, void *data) */ rv = apr_file_open(&f, "data/created_file", APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_TRUNCATE, - APR_UREAD | APR_UWRITE, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); nbytes = APR_BUFFERSIZE; @@ -511,7 +511,8 @@ static void test_mod_neg(abts_case *tc, void *data) const char *fname = "data/modneg.dat"; rv = apr_file_open(&f, fname, - APR_FOPEN_CREATE | APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE, p); + APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_UREAD | APR_FPROT_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); s = "body56789\n"; @@ -611,7 +612,7 @@ static void test_puts(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open file for writing", apr_file_open(&f, fname, APR_FOPEN_WRITE|APR_FOPEN_CREATE|APR_FOPEN_TRUNCATE, - APR_OS_DEFAULT, p)); + APR_FPROT_OS_DEFAULT, p)); APR_ASSERT_SUCCESS(tc, "write line to file", apr_file_puts(LINE1, f)); @@ -634,7 +635,7 @@ static void test_writev(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open file for writing", apr_file_open(&f, fname, APR_FOPEN_WRITE|APR_FOPEN_CREATE|APR_FOPEN_TRUNCATE, - APR_OS_DEFAULT, p)); + APR_FPROT_OS_DEFAULT, p)); vec[0].iov_base = LINE1; vec[0].iov_len = strlen(LINE1); @@ -676,7 +677,7 @@ static void test_writev_full(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open file for writing", apr_file_open(&f, fname, APR_FOPEN_WRITE|APR_FOPEN_CREATE|APR_FOPEN_TRUNCATE, - APR_OS_DEFAULT, p)); + APR_FPROT_OS_DEFAULT, p)); vec[0].iov_base = LINE1; vec[0].iov_len = strlen(LINE1); @@ -712,7 +713,7 @@ static void test_writev_buffered(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open file for writing", apr_file_open(&f, fname, APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE | - APR_FOPEN_BUFFERED, APR_OS_DEFAULT, p)); + APR_FOPEN_BUFFERED, APR_FPROT_OS_DEFAULT, p)); nbytes = strlen(TESTSTR); APR_ASSERT_SUCCESS(tc, "buffered write", @@ -746,7 +747,7 @@ static void test_writev_buffered_seek(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open file for writing", apr_file_open(&f, fname, APR_FOPEN_WRITE | APR_FOPEN_READ | APR_FOPEN_BUFFERED, - APR_OS_DEFAULT, p)); + APR_FPROT_OS_DEFAULT, p)); rv = apr_file_read(f, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -784,7 +785,8 @@ static void test_truncate(abts_case *tc, void *data) apr_file_remove(fname, p); rv = apr_file_open(&f, fname, - APR_FOPEN_CREATE | APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE, p); + APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_UREAD | APR_FPROT_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); s = "some data"; @@ -797,7 +799,8 @@ static void test_truncate(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_open(&f, fname, - APR_FOPEN_TRUNCATE | APR_FOPEN_WRITE, APR_UREAD | APR_UWRITE, p); + APR_FOPEN_TRUNCATE | APR_FOPEN_WRITE, + APR_FPROT_UREAD | APR_FPROT_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_close(f); @@ -826,7 +829,7 @@ static void test_file_trunc(abts_case *tc, void *data) rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_READ | APR_FOPEN_WRITE, - APR_UREAD | APR_UWRITE, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); s = "some data"; @@ -848,7 +851,7 @@ static void test_file_trunc(abts_case *tc, void *data) rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_BUFFERED, - APR_UREAD | APR_UWRITE, p); + APR_FPROT_UREAD | APR_FPROT_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); nbytes = strlen(s); @@ -879,7 +882,7 @@ static void test_bigfprintf(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open test file", apr_file_open(&f, fname, APR_FOPEN_CREATE|APR_FOPEN_WRITE, - APR_UREAD|APR_UWRITE, p)); + APR_FPROT_UREAD|APR_FPROT_UWRITE, p)); to_write = malloc(HUGE_STRING_LEN + 3); @@ -912,7 +915,7 @@ static void test_fail_write_flush(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open test file", apr_file_open(&f, fname, APR_FOPEN_CREATE|APR_FOPEN_READ|APR_FOPEN_BUFFERED, - APR_UREAD|APR_UWRITE, p)); + APR_FPROT_UREAD|APR_FPROT_UWRITE, p)); memset(buf, 'A', sizeof buf); @@ -942,7 +945,7 @@ static void test_fail_read_flush(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open test file", apr_file_open(&f, fname, APR_FOPEN_CREATE|APR_FOPEN_READ|APR_FOPEN_BUFFERED, - APR_UREAD|APR_UWRITE, p)); + APR_FPROT_UREAD|APR_FPROT_UWRITE, p)); /* this write should be buffered. */ APR_ASSERT_SUCCESS(tc, "buffered write should succeed", @@ -991,7 +994,7 @@ static void test_xthread(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open test file", apr_file_open(&f, fname, flags, - APR_UREAD|APR_UWRITE, p)); + APR_FPROT_UREAD|APR_FPROT_UWRITE, p)); APR_ASSERT_SUCCESS(tc, "write should succeed", apr_file_puts("hello", f)); @@ -1000,7 +1003,7 @@ static void test_xthread(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "open test file", apr_file_open(&f, fname, flags, - APR_UREAD|APR_UWRITE, p)); + APR_FPROT_UREAD|APR_FPROT_UWRITE, p)); /* Seek to the end. */ { diff --git a/test/testfilecopy.c b/test/testfilecopy.c index 5b64bc0538d..fc2dea48b06 100644 --- a/test/testfilecopy.c +++ b/test/testfilecopy.c @@ -63,7 +63,7 @@ static void copy_short_file(abts_case *tc, void *data) apr_file_remove("data/file_copy.txt", p); copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", - APR_FILE_SOURCE_PERMS, 0, p); + APR_FPROT_FILE_SOURCE_PERMS, 0, p); rv = apr_file_remove("data/file_copy.txt", p); APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } @@ -80,10 +80,10 @@ static void copy_over_existing(abts_case *tc, void *data) * this works. */ copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", - APR_FILE_SOURCE_PERMS, 0, p); + APR_FPROT_FILE_SOURCE_PERMS, 0, p); copy_helper(tc, "data/mmap_datafile.txt", "data/file_copy.txt", - APR_FILE_SOURCE_PERMS, 0, p); + APR_FPROT_FILE_SOURCE_PERMS, 0, p); rv = apr_file_remove("data/file_copy.txt", p); APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); @@ -97,7 +97,7 @@ static void append_nonexist(abts_case *tc, void *data) apr_file_remove("data/file_copy.txt", p); copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", - APR_FILE_SOURCE_PERMS, 0, p); + APR_FPROT_FILE_SOURCE_PERMS, 0, p); rv = apr_file_remove("data/file_copy.txt", p); APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } @@ -114,10 +114,10 @@ static void append_exist(abts_case *tc, void *data) * this works. */ copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", - APR_FILE_SOURCE_PERMS, 0, p); + APR_FPROT_FILE_SOURCE_PERMS, 0, p); copy_helper(tc, "data/mmap_datafile.txt", "data/file_copy.txt", - APR_FILE_SOURCE_PERMS, 1, p); + APR_FPROT_FILE_SOURCE_PERMS, 1, p); rv = apr_file_remove("data/file_copy.txt", p); APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); diff --git a/test/testfileinfo.c b/test/testfileinfo.c index ff085930d16..ce3f461fc48 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -109,7 +109,7 @@ static void test_info_get(abts_case *tc, void *data) apr_finfo_t finfo; apr_status_t rv; - rv = apr_file_open(&thefile, FILENAME, APR_FOPEN_READ, APR_OS_DEFAULT, p); + rv = apr_file_open(&thefile, FILENAME, APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); @@ -155,7 +155,7 @@ static void test_stat_eq_finfo(abts_case *tc, void *data) apr_finfo_t stat_finfo; apr_status_t rv; - rv = apr_file_open(&thefile, FILENAME, APR_FOPEN_READ, APR_OS_DEFAULT, p); + rv = apr_file_open(&thefile, FILENAME, APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); @@ -182,7 +182,7 @@ static void test_buffered_write_size(abts_case *tc, void *data) rv = apr_file_open(&thefile, NEWFILENAME, APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE | APR_FOPEN_BUFFERED | APR_FOPEN_DELONCLOSE, - APR_OS_DEFAULT, p); + APR_FPROT_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "open file", rv); /* A funny thing happened to me the other day: I wrote something @@ -215,7 +215,7 @@ static void test_mtime_set(abts_case *tc, void *data) rv = apr_file_open(&thefile, NEWFILENAME, APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE | APR_FOPEN_BUFFERED | APR_FOPEN_DELONCLOSE, - APR_OS_DEFAULT, p); + APR_FPROT_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "open file", rv); /* Check that the current mtime is not the epoch */ diff --git a/test/testflock.c b/test/testflock.c index b9e8c79281f..2cf9f358ea1 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -64,7 +64,7 @@ static void test_withlock(abts_case *tc, void *data) int code; rv = apr_file_open(&file, TESTFILE, APR_FOPEN_WRITE|APR_FOPEN_CREATE, - APR_OS_DEFAULT, p); + APR_FPROT_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "Could not create file.", rv); ABTS_PTR_NOTNULL(tc, file); diff --git a/test/testlfs.c b/test/testlfs.c index a81d5366857..aa5357389fc 100644 --- a/test/testlfs.c +++ b/test/testlfs.c @@ -50,7 +50,7 @@ static void test_open(abts_case *tc, void *data) apr_finfo_t testsize; apr_status_t rv; - rv = apr_dir_make(TESTDIR, APR_OS_DEFAULT, p); + rv = apr_dir_make(TESTDIR, APR_FPROT_OS_DEFAULT, p); if (rv && !APR_STATUS_IS_EEXIST(rv)) { APR_ASSERT_SUCCESS(tc, "make test directory", rv); } @@ -58,7 +58,7 @@ static void test_open(abts_case *tc, void *data) /* First attempt a 1MB sparse file so we don't tax the poor test box */ rv = apr_file_open(&f, TESTFN, APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_TRUNCATE | APR_FOPEN_SPARSE, - APR_OS_DEFAULT, p); + APR_FPROT_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "open file", rv); @@ -114,7 +114,7 @@ static void test_reopen(abts_case *tc, void *data) PRECOND; rv = apr_file_open(&fh, TESTFN, APR_FOPEN_SPARSE | APR_FOPEN_READ, - APR_OS_DEFAULT, p); + APR_FPROT_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "re-open 8GB file", rv); APR_ASSERT_SUCCESS(tc, "file_info_get failed", @@ -180,7 +180,7 @@ static void test_append(abts_case *tc, void *data) rv = apr_file_open(&fh, TESTFN, APR_FOPEN_SPARSE | APR_FOPEN_WRITE | APR_FOPEN_APPEND, - APR_OS_DEFAULT, p); + APR_FPROT_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "open 8GB file for append", rv); APR_ASSERT_SUCCESS(tc, "append to 8GB file", @@ -204,7 +204,7 @@ static void test_seek(abts_case *tc, void *data) PRECOND; rv = apr_file_open(&fh, TESTFN, APR_FOPEN_SPARSE | APR_FOPEN_WRITE, - APR_OS_DEFAULT, p); + APR_FPROT_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "open 8GB file for writing", rv); pos = 0; @@ -232,7 +232,7 @@ static void test_write(abts_case *tc, void *data) PRECOND; rv = apr_file_open(&fh, TESTFN, APR_FOPEN_SPARSE | APR_FOPEN_WRITE, - APR_OS_DEFAULT, p); + APR_FPROT_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "re-open 8GB file", rv); APR_ASSERT_SUCCESS(tc, "seek to 8GB - 4", @@ -259,7 +259,7 @@ static void test_mmap(abts_case *tc, void *data) PRECOND; rv = apr_file_open(&fh, TESTFN, APR_FOPEN_SPARSE | APR_FOPEN_READ, - APR_OS_DEFAULT, p); + APR_FPROT_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "open 8gb file for mmap", rv); APR_ASSERT_SUCCESS(tc, "mmap 8GB file", @@ -304,7 +304,7 @@ static void test_buffered(abts_case *tc, void *data) rv = apr_file_open(&f, TESTBUFFN, APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_TRUNCATE | APR_FOPEN_BUFFERED | APR_FOPEN_SPARSE, - APR_OS_DEFAULT, p); + APR_FPROT_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "open buffered file", rv); APR_ASSERT_SUCCESS(tc, "truncate to 8GB", diff --git a/test/testmmap.c b/test/testmmap.c index 140d5c32b03..aeff1a66a1f 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -84,7 +84,8 @@ static void test_file_open(abts_case *tc, void *data) { apr_status_t rv; - rv = apr_file_open(&thefile, file1, APR_FOPEN_READ, APR_UREAD | APR_GREAD, p); + rv = apr_file_open(&thefile, file1, APR_FOPEN_READ, + APR_FPROT_UREAD | APR_FPROT_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, thefile); } diff --git a/test/testproc.c b/test/testproc.c index 096ecfdfc59..c86fb2997b5 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -96,15 +96,15 @@ static void test_file_redir(abts_case *tc, void *data) testfile = NULL; rv = apr_file_open(&testfile, "data/stdin", APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL, - APR_OS_DEFAULT, p); + APR_FPROT_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_open(&testout, "data/stdout", APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL, - APR_OS_DEFAULT, p); + APR_FPROT_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_file_open(&testerr, "data/stderr", APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL, - APR_OS_DEFAULT, p); + APR_FPROT_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); length = strlen(TESTSTR); diff --git a/test/tryread.c b/test/tryread.c index 569d647c36b..843abe70aac 100644 --- a/test/tryread.c +++ b/test/tryread.c @@ -33,7 +33,7 @@ int main(int argc, const char * const *argv) apr_initialize(); apr_pool_create(&p, NULL); - if (apr_file_open(&file, TESTFILE, APR_FOPEN_WRITE, APR_OS_DEFAULT, p) + if (apr_file_open(&file, TESTFILE, APR_FOPEN_WRITE, APR_FPROT_OS_DEFAULT, p) != APR_SUCCESS) { exit(UNEXPECTED_ERROR); diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 7047401b158..cd750012966 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -380,7 +380,8 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname strcpy(interpreter, "#!" SHELL_PATH); extra_arg = "/C"; } else if (stricmp(extension, ".exe") != 0) { - status = apr_file_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, pool); + status = apr_file_open(&progfile, progname, + APR_FOPEN_READ|APR_FOPEN_BUFFERED, 0, pool); if (status != APR_SUCCESS && APR_STATUS_IS_ENOENT(status)) { progname = apr_pstrcat(pool, progname, ".exe", NULL); From 077732adb3e5c202745a0aeda135111a588d4166 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 18 Jan 2014 14:06:03 +0000 Subject: [PATCH 7393/7878] mention generators expected to work, tweak todos git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1559345 13f79535-47bb-0310-9956-ffa450edef68 --- README.cmake | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.cmake b/README.cmake index 60e0f4bea27..cf8b8817361 100644 --- a/README.cmake +++ b/README.cmake @@ -121,6 +121,18 @@ How to build 6. build using chosen backend (e.g., "nmake install") +Tested generators +----------------- + +1. NMake Makefiles + +This has been tested successfully with the following: + +* Visual Studio 2008 64-bit (requires KB948127 hot fix) +* Visual Studio 2012 64-bit + +2. Visual Studio 11 (Visual Studio 2012 project files) + Known Bugs and Limitations -------------------------- @@ -144,9 +156,8 @@ Known Bugs and Limitations . APU_HAVE_NSS + APU_HAVE_ICONV * Static builds of APR modules are not supported. -* Support static *or* shared build of Expat. -* APR-CHANGES.txt, APR-LICENSE.txt, and APR-NOTICE.txt are not installed, - though perhaps that is a job for a higher-level script. +* XML implementation (i.e., Expat or libxml2) could support static XML impl + with apr-2.lib. Generally: From 2bc37d0975c143e3f14c9af3c8aace1ffa76e2f5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 18 Jan 2014 17:49:52 +0000 Subject: [PATCH 7394/7878] fix typo in comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1559376 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/unix/start.c b/misc/unix/start.c index 4b8ad990de6..8dcc1d9897e 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -61,7 +61,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) apr_pool_tag(pool, "apr_initialize"); - /* apr_atomic_init() used to be called from here aswell. + /* apr_atomic_init() used to be called from here as well. * Pools rely on mutexes though, which can be backed by * atomics. Due to this circular dependency * apr_pool_initialize() is taking care of calling From ea515f3347650096fc5dec4d78cecbee8f12bb41 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 18 Jan 2014 18:05:36 +0000 Subject: [PATCH 7395/7878] improve formatting of poll options and pollset flags (section headings were mangled) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1559382 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index 7ddae5bd743..482d6ee1db7 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -42,7 +42,9 @@ extern "C" { */ /** - * Poll options + * @defgroup pollopts Poll options + * @ingroup apr_poll + * @{ */ #define APR_POLLIN 0x001 /**< Can read without blocking */ #define APR_POLLPRI 0x002 /**< Priority data available */ @@ -50,9 +52,12 @@ extern "C" { #define APR_POLLERR 0x010 /**< Pending error */ #define APR_POLLHUP 0x020 /**< Hangup occurred */ #define APR_POLLNVAL 0x040 /**< Descriptor invalid */ +/** @} */ /** - * Pollset Flags + * @defgroup pollflags Pollset Flags + * @ingroup apr_poll + * @{ */ #define APR_POLLSET_THREADSAFE 0x001 /**< Adding or removing a descriptor is * thread-safe @@ -67,6 +72,7 @@ extern "C" { * the specified non-default method cannot be * used */ +/** @} */ /** * Pollset Methods From 2f03ba2f827af6130741a260e838a67a7a863247 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 18 Jan 2014 20:15:12 +0000 Subject: [PATCH 7396/7878] Remove more Win9x support (trunk only). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1559408 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/apr_arch_misc.h | 102 +---------------------------- libapr.rc | 4 -- misc/win32/misc.c | 27 -------- 3 files changed, 1 insertion(+), 132 deletions(-) diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index bf783c1d28a..b2fb98b0736 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -122,11 +122,7 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *); * the unicode eqivilant. */ -#if defined(_WIN32_WCE) || defined(WINNT) #define APR_HAS_ANSI_FS 0 -#else -#define APR_HAS_ANSI_FS 1 -#endif /* IF_WIN_OS_IS_UNICODE / ELSE_WIN_OS_IS_ANSI help us keep the code trivial * where have runtime tests for unicode-ness, that aren't needed in any @@ -138,7 +134,7 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *); #else /* APR_HAS_UNICODE_FS */ #define IF_WIN_OS_IS_UNICODE #define ELSE_WIN_OS_IS_ANSI -#endif /* WINNT */ +#endif /* APR_HAS_ANSI_FS && APR_HAS_UNICODE_FS */ #if defined(_MSC_VER) && !defined(_WIN32_WCE) #include "crtdbg.h" @@ -223,102 +219,6 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); * In the case of non-text functions, simply #define the original name */ -#if !defined(_WIN32_WCE) && !defined(WINNT) -/* This group is available to all versions of WINNT 4.0 SP6 and later */ - -#ifdef GetFileAttributesExA -#undef GetFileAttributesExA -#endif -APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( - IN LPCSTR lpFileName, - IN GET_FILEEX_INFO_LEVELS fInfoLevelId, - OUT LPVOID lpFileInformation), - (lpFileName, fInfoLevelId, lpFileInformation)); -#define GetFileAttributesExA apr_winapi_GetFileAttributesExA -#undef GetFileAttributesEx -#define GetFileAttributesEx apr_winapi_GetFileAttributesExA - -#ifdef GetFileAttributesExW -#undef GetFileAttributesExW -#endif -APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExW, 0, ( - IN LPCWSTR lpFileName, - IN GET_FILEEX_INFO_LEVELS fInfoLevelId, - OUT LPVOID lpFileInformation), - (lpFileName, fInfoLevelId, lpFileInformation)); -#define GetFileAttributesExW apr_winapi_GetFileAttributesExW - -APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( - IN HANDLE hFile), - (hFile)); -#define CancelIo apr_winapi_CancelIo - -APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, TryEnterCriticalSection, 0, ( - LPCRITICAL_SECTION lpCriticalSection), - (lpCriticalSection)); -#define TryEnterCriticalSection apr_winapi_TryEnterCriticalSection - -APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, SwitchToThread, 0, ( - void), - ()); -#define SwitchToThread apr_winapi_SwitchToThread - -APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetEffectiveRightsFromAclW, 0, ( - IN PACL pacl, - IN PTRUSTEE_W pTrustee, - OUT PACCESS_MASK pAccessRights), - (pacl, pTrustee, pAccessRights)); -#define GetEffectiveRightsFromAclW apr_winapi_GetEffectiveRightsFromAclW - -APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoW, 0, ( - IN LPWSTR pObjectName, - IN SE_OBJECT_TYPE ObjectType, - IN SECURITY_INFORMATION SecurityInfo, - OUT PSID *ppsidOwner, - OUT PSID *ppsidGroup, - OUT PACL *ppDacl, - OUT PACL *ppSacl, - OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor), - (pObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup, - ppDacl, ppSacl, ppSecurityDescriptor)); -#define GetNamedSecurityInfoW apr_winapi_GetNamedSecurityInfoW - -APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoA, 0, ( - IN LPSTR pObjectName, - IN SE_OBJECT_TYPE ObjectType, - IN SECURITY_INFORMATION SecurityInfo, - OUT PSID *ppsidOwner, - OUT PSID *ppsidGroup, - OUT PACL *ppDacl, - OUT PACL *ppSacl, - OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor), - (pObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup, - ppDacl, ppSacl, ppSecurityDescriptor)); -#define GetNamedSecurityInfoA apr_winapi_GetNamedSecurityInfoA -#undef GetNamedSecurityInfo -#define GetNamedSecurityInfo apr_winapi_GetNamedSecurityInfoA - -APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetSecurityInfo, 0, ( - IN HANDLE handle, - IN SE_OBJECT_TYPE ObjectType, - IN SECURITY_INFORMATION SecurityInfo, - OUT PSID *ppsidOwner, - OUT PSID *ppsidGroup, - OUT PACL *ppDacl, - OUT PACL *ppSacl, - OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor), - (handle, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup, - ppDacl, ppSacl, ppSecurityDescriptor)); -#define GetSecurityInfo apr_winapi_GetSecurityInfo - -APR_DECLARE_LATE_DLL_FUNC(DLL_SHSTDAPI, LPWSTR *, WINAPI, CommandLineToArgvW, 0, ( - LPCWSTR lpCmdLine, - int *pNumArgs), - (lpCmdLine, pNumArgs)); -#define CommandLineToArgvW apr_winapi_CommandLineToArgvW - -#endif /* !defined(_WIN32_WCE) && !defined(WINNT) */ - #if !defined(_WIN32_WCE) /* This group is NOT available to all versions of WinNT, * these we must always look up diff --git a/libapr.rc b/libapr.rc index d4e828b7142..f7386f06d97 100644 --- a/libapr.rc +++ b/libapr.rc @@ -40,11 +40,7 @@ FILEFLAGS 0x00L #endif #endif -#if defined(WINNT) || defined(WIN64) FILEOS 0x40004L -#else - FILEOS 0x4L -#endif FILETYPE 0x2L FILESUBTYPE 0x0L BEGIN diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 3591f63c611..c4c5a4473cc 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -106,33 +106,6 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) apr_os_level = APR_WIN_XP; } } -#ifndef WINNT - else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { - TCHAR *prevision; - if (prevision = oslev.szCSDVersion) { - while (*prevision && !apr_isupper(*prevision)) { - prevision++; - } - } - else prevision = _T(""); - - if (oslev.dwMinorVersion < 10) { - if (*prevision < _T('C')) - apr_os_level = APR_WIN_95; - else - apr_os_level = APR_WIN_95_OSR2; - } - else if (oslev.dwMinorVersion < 90) { - if (*prevision < _T('A')) - apr_os_level = APR_WIN_98; - else - apr_os_level = APR_WIN_98_SE; - } - else { - apr_os_level = APR_WIN_ME; - } - } -#endif #ifdef _WIN32_WCE else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_CE) { From 1d7f658f0eabce29ca20c55a3530747167cf606f Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Tue, 21 Jan 2014 01:17:29 +0000 Subject: [PATCH 7397/7878] Fix timing bug in parallel apr_dir_make_recursive on Windows. * file_io/win32/dir.c (dir_make_parent): When parent just got created, continue creating children. (apr_dir_make_recursive): Only handle EEXIST of the requested directory as success, not any ancestor. Patch by: rhuijben * test/testdir.c (test_mkdir_recurs_parallel): New multithreaded test case. (test_removeall): Clean up after test_mkdir_recurs_parallel. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1559873 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/dir.c | 41 +++++++++------ test/testdir.c | 122 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+), 17 deletions(-) diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index f6eeb87256a..5c30af8fdc3 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -316,8 +316,8 @@ static apr_status_t dir_make_parent(char *path, if (APR_STATUS_IS_ENOENT(rv)) { /* Missing an intermediate dir */ rv = dir_make_parent(path, perm, pool); - if (rv == APR_SUCCESS) { - rv = apr_dir_make (path, perm, pool); /* And complete the path */ + if (rv == APR_SUCCESS || APR_STATUS_IS_EEXIST(rv)) { + rv = apr_dir_make(path, perm, pool); /* And complete the path */ } } @@ -330,28 +330,35 @@ APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, apr_pool_t *pool) { apr_status_t rv = 0; - + rv = apr_dir_make (path, perm, pool); /* Try to make PATH right out */ - + if (APR_STATUS_IS_ENOENT(rv)) { /* Missing an intermediate dir */ char *dir; - + rv = apr_filepath_merge(&dir, "", path, APR_FILEPATH_NATIVE, pool); - if (rv == APR_SUCCESS) - rv = dir_make_parent(dir, perm, pool); /* Make intermediate dirs */ - - if (rv == APR_SUCCESS) + if (rv != APR_SUCCESS) + return rv; + + rv = dir_make_parent(dir, perm, pool); /* Make intermediate dirs */ + + if (rv == APR_SUCCESS || APR_STATUS_IS_EEXIST(rv)) { rv = apr_dir_make (dir, perm, pool); /* And complete the path */ - } - /* - * It's OK if PATH exists. Timing issues can lead to the second - * apr_dir_make being called on existing dir, therefore this check - * has to come last. - */ - if (APR_STATUS_IS_EEXIST(rv)) - return APR_SUCCESS; + if (APR_STATUS_IS_EEXIST(rv)) { + rv = APR_SUCCESS; /* Timing issue; see comment below */ + } + } + } + else if (APR_STATUS_IS_EEXIST(rv)) { + /* + * It's OK if PATH exists. Timing issues can lead to the + * second apr_dir_make being called on existing dir, therefore + * this check has to come last. + */ + rv = APR_SUCCESS; + } return rv; } diff --git a/test/testdir.c b/test/testdir.c index 08ee7ec2c57..53972009581 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -22,6 +22,7 @@ #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" +#include "apr_thread_proc.h" #include "testutil.h" static void test_mkdir(abts_case *tc, void *data) @@ -62,6 +63,60 @@ static void test_mkdir_recurs(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype); } +static void *APR_THREAD_FUNC thread_mkdir_func(apr_thread_t *thd, void *data) +{ + abts_case *tc = data; + apr_status_t s1, s2, s3, s4, s5; + + s1 = apr_dir_make_recursive("data/prll/one/thwo/three", + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, + p); + s2 = apr_dir_make_recursive("data/prll/four/five/six/seven/eight", + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, + p); + s3 = apr_dir_make_recursive("data/prll/nine/ten", + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, + p); + s4 = apr_dir_make_recursive("data/prll/11/12/13/14/15/16/17/18/19/20", + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, + p); + s5 = apr_dir_make_recursive("data/fortytwo", + APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, + p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s2); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s3); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s4); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s5); + return NULL; +} + +static void test_mkdir_recurs_parallel(abts_case *tc, void *data) +{ + apr_thread_t *t1, *t2, *t3, *t4; + apr_status_t s1, s2, s3, s4; + + s1 = apr_thread_create(&t1, NULL, thread_mkdir_func, tc, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); + s2 = apr_thread_create(&t2, NULL, thread_mkdir_func, tc, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s2); + s3 = apr_thread_create(&t3, NULL, thread_mkdir_func, tc, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s3); + s4 = apr_thread_create(&t4, NULL, thread_mkdir_func, tc, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s4); + + apr_thread_join(&s1, t1); + apr_thread_join(&s2, t2); + apr_thread_join(&s3, t3); + apr_thread_join(&s4, t4); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s2); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s3); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s4); +} + static void test_remove(abts_case *tc, void *data) { apr_status_t rv; @@ -94,6 +149,72 @@ static void test_removeall(abts_case *tc, void *data) rv = apr_dir_remove("data/one", p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/one/thwo/three", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/one/thwo", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/one", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/four/five/six/seven/eight", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/four/five/six/seven", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/four/five/six", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/four/five", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/four", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/nine/ten", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/nine", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/11/12/13/14/15/16/17/18/19/20", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/11/12/13/14/15/16/17/18/19", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/11/12/13/14/15/16/17/18", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/11/12/13/14/15/16/17", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/11/12/13/14/15/16", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/11/12/13/14/15", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/11/12/13/14", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/11/12/13", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/11/12", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll/11", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/prll", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_dir_remove("data/fortytwo", p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void test_remove_notthere(abts_case *tc, void *data) @@ -251,6 +372,7 @@ abts_suite *testdir(abts_suite *suite) abts_run_test(suite, test_mkdir, NULL); abts_run_test(suite, test_mkdir_recurs, NULL); + abts_run_test(suite, test_mkdir_recurs_parallel, NULL); abts_run_test(suite, test_remove, NULL); abts_run_test(suite, test_removeall_fail, NULL); abts_run_test(suite, test_removeall, NULL); From edea0d1252a60f53fd082a26e87a924d569268bc Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Tue, 21 Jan 2014 11:20:15 +0000 Subject: [PATCH 7398/7878] Give every thread in the parallel recursive mkdir test its own pool to play with, to prevent weird data interdependencies. * test/testdir.c (struct thread_data): Encapsulates abts_case and per-thread pool. (thread_mkdir_func): Thread data is thread_data, not abts_case. (test_mkdir_recurs_parallel): Create a separate pool and thread data struct for each thread. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1559975 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdir.c | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/test/testdir.c b/test/testdir.c index 53972009581..87085bd0a0f 100644 --- a/test/testdir.c +++ b/test/testdir.c @@ -63,47 +63,60 @@ static void test_mkdir_recurs(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype); } +struct thread_data +{ + abts_case *tc; + apr_pool_t *pool; +}; + static void *APR_THREAD_FUNC thread_mkdir_func(apr_thread_t *thd, void *data) { - abts_case *tc = data; + struct thread_data *td = data; apr_status_t s1, s2, s3, s4, s5; s1 = apr_dir_make_recursive("data/prll/one/thwo/three", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - p); + td->pool); s2 = apr_dir_make_recursive("data/prll/four/five/six/seven/eight", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - p); + td->pool); s3 = apr_dir_make_recursive("data/prll/nine/ten", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - p); + td->pool); s4 = apr_dir_make_recursive("data/prll/11/12/13/14/15/16/17/18/19/20", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - p); + td->pool); s5 = apr_dir_make_recursive("data/fortytwo", APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_UEXECUTE, - p); + td->pool); - ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); - ABTS_INT_EQUAL(tc, APR_SUCCESS, s2); - ABTS_INT_EQUAL(tc, APR_SUCCESS, s3); - ABTS_INT_EQUAL(tc, APR_SUCCESS, s4); - ABTS_INT_EQUAL(tc, APR_SUCCESS, s5); + ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s1); + ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s2); + ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s3); + ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s4); + ABTS_INT_EQUAL(td->tc, APR_SUCCESS, s5); return NULL; } static void test_mkdir_recurs_parallel(abts_case *tc, void *data) { + struct thread_data td1, td2, td3, td4; apr_thread_t *t1, *t2, *t3, *t4; apr_status_t s1, s2, s3, s4; - s1 = apr_thread_create(&t1, NULL, thread_mkdir_func, tc, p); + td1.tc = td2.tc = td3.tc = td4.tc = tc; + apr_pool_create(&td1.pool, p); + apr_pool_create(&td2.pool, p); + apr_pool_create(&td3.pool, p); + apr_pool_create(&td4.pool, p); + + s1 = apr_thread_create(&t1, NULL, thread_mkdir_func, &td1, td1.pool); ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); - s2 = apr_thread_create(&t2, NULL, thread_mkdir_func, tc, p); + s2 = apr_thread_create(&t2, NULL, thread_mkdir_func, &td2, td2.pool); ABTS_INT_EQUAL(tc, APR_SUCCESS, s2); - s3 = apr_thread_create(&t3, NULL, thread_mkdir_func, tc, p); + s3 = apr_thread_create(&t3, NULL, thread_mkdir_func, &td3, td3.pool); ABTS_INT_EQUAL(tc, APR_SUCCESS, s3); - s4 = apr_thread_create(&t4, NULL, thread_mkdir_func, tc, p); + s4 = apr_thread_create(&t4, NULL, thread_mkdir_func, &td4, td4.pool); ABTS_INT_EQUAL(tc, APR_SUCCESS, s4); apr_thread_join(&s1, t1); From b01536baef69c7f701dc6029d2e6b4a3584a3e9a Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 24 Jan 2014 15:46:04 +0000 Subject: [PATCH 7399/7878] Using UDS, we sometime try ops not supported on UDS. Make this a known (and therfore handable) issue git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1561040 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index 4ee292e3871..b322d49671a 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -839,6 +839,13 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_EAFNOSUPPORT (APR_OS_START_CANONERR + 27) #endif +/** @see APR_STATUS_IS_EOPNOTSUPP */ +#ifdef EOPNOTSUPP +#define APR_EOPNOTSUPP EOPNOTSUPP +#else +#define APR_EOPNOTSUPP (APR_OS_START_CANONERR + 28) +#endif + /** @} */ #if defined(OS2) && !defined(DOXYGEN) @@ -979,6 +986,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED) #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_AFNOSUPPORT \ || (s) == APR_OS_START_SYSERR + SOCEAFNOSUPPORT) +#define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP \ + || (s) == APR_OS_START_SYSERR + SOCEOPNOTSUPP) /* Sorry, too tired to wrap this up for OS2... feel free to @@ -992,7 +1001,6 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, { SOCENOPROTOOPT, ENOPROTOOPT }, { SOCEPROTONOSUPPORT, EPROTONOSUPPORT }, { SOCESOCKTNOSUPPORT, ESOCKTNOSUPPORT }, - { SOCEOPNOTSUPP, EOPNOTSUPP }, { SOCEPFNOSUPPORT, EPFNOSUPPORT }, { SOCEADDRINUSE, EADDRINUSE }, { SOCEADDRNOTAVAIL, EADDRNOTAVAIL }, @@ -1124,6 +1132,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY) #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT \ || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT) +#define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP \ + || (s) == APR_OS_START_SYSERR + WSAEOPNOTSUPP) #elif defined(NETWARE) && defined(USE_WINSOCK) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */ @@ -1185,6 +1195,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY) #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT \ || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT) +#define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP \ + || (s) == APR_OS_START_SYSERR + WSAEOPNOTSUPP) #else /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */ @@ -1304,6 +1316,8 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, (s) == APR_EEXIST) /** Address Family not supported */ #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT) +/** Socket operation not supported */ +#define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP) /** @} */ #endif /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */ From 083e5d0e0fdb017c978aa7238c66b65721bcebb3 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 24 Jan 2014 22:07:54 +0000 Subject: [PATCH 7400/7878] Not now... revert git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1561209 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ---- shmem/unix/shm.c | 15 +++------------ 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/CHANGES b/CHANGES index 965c3b59a79..243262151a3 100644 --- a/CHANGES +++ b/CHANGES @@ -6,10 +6,6 @@ Changes for APR 2.0.0 *) Added signed apr_intptr_t. Changed ODBC dbd driver to use this. [Tom Donovan] - *) When using shmget-based shared memory, the ID used for ftok is - now an APR hash of the filename instead of the constant '1'. - PR 53996 [Jim Jagielski] - *) Changes to apr_pollset_method_e enum value of APR_POLLSET_POLL and APR_POLLSET_AIO_MSGQ. Restore APR_POLLSET_POLL to its pre-r1308910 (April 2012) value, and move APR_POLLSET_AIO_MSGQ ahead. This restores diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index d93a98beacd..060a3694570 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -104,7 +104,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #endif #if APR_USE_SHMEM_SHMGET apr_size_t nbytes; - apr_ssize_t slen; #endif #if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_SHMGET || \ APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM @@ -314,9 +313,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* ftok() (on solaris at least) requires that the file actually * exist before calling ftok(). */ - slen = strlen(filename); - new_m->shmkey = ftok(filename, - (int)apr_hashfunc_default(filename, &slen)); + new_m->shmkey = ftok(filename, 1); if (new_m->shmkey == (key_t)-1) { apr_file_close(file); return errno; @@ -386,7 +383,6 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, apr_file_t *file; key_t shmkey; int shmid; - apr_ssize_t slen; #endif #if APR_USE_SHMEM_MMAP_TMP @@ -406,9 +402,7 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, /* ftok() (on solaris at least) requires that the file actually * exist before calling ftok(). */ - slen = strlen(filename); - shmkey = ftok(filename, - (int)apr_hashfunc_default(filename, &slen)); + shmkey = ftok(filename, 1); if (shmkey == (key_t)-1) { goto shm_remove_failed; } @@ -539,7 +533,6 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, apr_status_t status; apr_file_t *file; /* file where metadata is stored */ apr_size_t nbytes; - apr_ssize_t slen; new_m = apr_palloc(pool, sizeof(apr_shm_t)); @@ -562,9 +555,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, new_m->filename = apr_pstrdup(pool, filename); new_m->pool = pool; - slen = strlen(filename); - new_m->shmkey = ftok(filename, - (int)apr_hashfunc_default(filename, &slen)); + new_m->shmkey = ftok(filename, 1); if (new_m->shmkey == (key_t)-1) { return errno; } From 0b1f1a19e5beb3f88a2a2dbf19cd318759956693 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 25 Jan 2014 05:51:13 +0000 Subject: [PATCH 7401/7878] *) Fix POSIX shared memory (shm_open) use for named shared memory. PR 55928. [Jozef Hatala ] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1561260 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ configure.in | 14 +++++--- shmem/unix/shm.c | 88 ++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 94 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index 243262151a3..f75b226f89b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Fix POSIX shared memory (shm_open) use for named shared memory. + PR 55928. [Jozef Hatala ] + *) Windows platform: Remove support for Windows 9x. *) Added signed apr_intptr_t. Changed ODBC dbd driver to use this. diff --git a/configure.in b/configure.in index 9f224096b35..331a5779efd 100644 --- a/configure.in +++ b/configure.in @@ -1150,11 +1150,6 @@ APR_IFALLYES(header:sys/mman.h func:mmap func:munmap, [havemmaptmp="1" APR_DECIDE(USE_SHMEM_MMAP_TMP, [Classical mmap() on temporary file])]) -APR_IFALLYES(header:sys/mman.h func:mmap func:munmap func:shm_open dnl - func:shm_unlink, - [havemmapshm="1" - APR_DECIDE(USE_SHMEM_MMAP_SHM, - [mmap() via POSIX.1 shm_open() on temporary file])]) APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl func:shmget func:shmat func:shmdt func:shmctl, [haveshmget="1" @@ -1168,6 +1163,15 @@ APR_IFALLYES(header:os2.h, APR_IFALLYES(header:windows.h, [havewin32shm="1" APR_DECIDE(USE_SHMEM_WIN32, [Windows shared memory])]) +AC_ARG_ENABLE(posix-shm, +[ --enable-posix-shm Use POSIX shared memory (shm_open) if available], +[ +APR_IFALLYES(header:sys/mman.h func:mmap func:munmap func:shm_open dnl + func:shm_unlink, + [havemmapshm="1" + APR_DECIDE(USE_SHMEM_MMAP_SHM, + [mmap() via POSIX.1 shm_open() on temporary file])]) +]) case $host in *linux* ) # Linux pre-2.4 had problems with MM_SHMT_MMANON even though diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 060a3694570..90dc3061ae4 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -23,6 +23,61 @@ #include "apr_strings.h" #include "apr_hash.h" +#if APR_USE_SHMEM_MMAP_SHM +/* + * For portable use, a shared memory object should be identified by a name of + * the form /somename; that is, a null-terminated string of up to NAME_MAX + * (i.e., 255) characters consisting of an initial slash, followed by one or + * more characters, none of which are slashes. + */ +#ifndef NAME_MAX +#define NAME_MAX 255 +#endif +static const char *make_shm_open_safe_name(const char *filename, + apr_pool_t *pool) +{ + const char *in; + char *result; + char *out; + apr_size_t len = 0; + + if (filename == NULL) + return NULL; + + len = strlen(filename); + if (filename[0] != '/') { + ++len; + } + if (len > NAME_MAX) { + len = NAME_MAX; + } + /* Allocate the required string */ + result = apr_palloc(pool, len+1); + + in = filename; + if (*in == '/') { + ++in; + } + + out = result; + *out++ = '/'; + + for ( ; --len; ++in, ++out) { + if (*in == '/') { + /* '/' becomes '|' */ + *out = '|'; + } else { + /* Everything else remains unchanged */ + *out = *in; + } + } + + *out = '\0'; + + return result; +} +#endif + static apr_status_t shm_cleanup_owner(void *m_) { apr_shm_t *m = (apr_shm_t *)m_; @@ -60,7 +115,7 @@ static apr_status_t shm_cleanup_owner(void *m_) if (munmap(m->base, m->realsize) == -1) { return errno; } - if (shm_unlink(m->filename) == -1) { + if (shm_unlink(make_shm_open_safe_name(m->filename, m->pool)) == -1 && errno != ENOENT) { return errno; } return APR_SUCCESS; @@ -221,7 +276,9 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, new_m->pool = pool; new_m->reqsize = reqsize; new_m->filename = apr_pstrdup(pool, filename); - +#if APR_USE_SHMEM_MMAP_SHM + const char *shm_name = make_shm_open_safe_name(filename, pool); +#endif #if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM new_m->realsize = reqsize + APR_ALIGN_DEFAULT(sizeof(apr_size_t)); /* room for metadata */ @@ -262,7 +319,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, } #endif /* APR_USE_SHMEM_MMAP_TMP */ #if APR_USE_SHMEM_MMAP_SHM - tmpfd = shm_open(filename, O_RDWR | O_CREAT | O_EXCL, 0644); + tmpfd = shm_open(shm_name, O_RDWR | O_CREAT | O_EXCL, 0644); if (tmpfd == -1) { return errno; } @@ -276,10 +333,10 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, status = apr_file_trunc(file, new_m->realsize); if (status != APR_SUCCESS) { - shm_unlink(filename); /* we're failing, remove the object */ + shm_unlink(shm_name); /* we're failing, remove the object */ return status; } - new_m->base = mmap(NULL, reqsize, PROT_READ | PROT_WRITE, + new_m->base = mmap(NULL, new_m->realsize, PROT_READ | PROT_WRITE, MAP_SHARED, tmpfd, 0); /* FIXME: check for errors */ @@ -388,7 +445,8 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, #if APR_USE_SHMEM_MMAP_TMP return apr_file_remove(filename, pool); #elif APR_USE_SHMEM_MMAP_SHM - if (shm_unlink(filename) == -1) { + const char *shm_name = make_shm_open_safe_name(filename, pool); + if (shm_unlink(shm_name) == -1) { return errno; } return APR_SUCCESS; @@ -483,7 +541,22 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, new_m = apr_palloc(pool, sizeof(apr_shm_t)); new_m->pool = pool; new_m->filename = apr_pstrdup(pool, filename); +#if APR_USE_SHMEM_MMAP_SHM + const char *shm_name = make_shm_open_safe_name(filename, pool); + + tmpfd = shm_open(shm_name, O_RDWR, 0644); + if (tmpfd == -1) { + return errno; + } + status = apr_os_file_put(&file, &tmpfd, + APR_READ | APR_WRITE, + pool); + if (status != APR_SUCCESS) { + return status; + } + +#elif APR_USE_SHMEM_MMAP_TMP status = apr_file_open(&file, filename, APR_FOPEN_READ | APR_FOPEN_WRITE, APR_FPROT_OS_DEFAULT, pool); @@ -494,6 +567,9 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, if (status != APR_SUCCESS) { return status; } +#else + return APR_ENOTIMPL; +#endif nbytes = sizeof(new_m->realsize); status = apr_file_read(file, (void *)&(new_m->realsize), From 08d690682a9551ee416d47631dd3961e00e47a0e Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 25 Jan 2014 06:36:15 +0000 Subject: [PATCH 7402/7878] Because of Darwin/OSX, we need to worry about the pathlength, which is much less than 255. So use the method from posix sems, which we've used for years! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1561265 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- shmem/unix/shm.c | 55 +++++++++++++++++++----------------------------- 2 files changed, 23 insertions(+), 34 deletions(-) diff --git a/CHANGES b/CHANGES index f75b226f89b..04e4c7ed6e6 100644 --- a/CHANGES +++ b/CHANGES @@ -2,7 +2,7 @@ Changes for APR 2.0.0 *) Fix POSIX shared memory (shm_open) use for named shared memory. - PR 55928. [Jozef Hatala ] + PR 55928. [Jozef Hatala , Jim Jagielski] *) Windows platform: Remove support for Windows 9x. diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 90dc3061ae4..3fb20123d9c 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -33,48 +33,37 @@ #ifndef NAME_MAX #define NAME_MAX 255 #endif -static const char *make_shm_open_safe_name(const char *filename, - apr_pool_t *pool) -{ - const char *in; - char *result; - char *out; - apr_size_t len = 0; - if (filename == NULL) - return NULL; +/* See proc_mutex.c and sem_open for the reason for all this! */ +static unsigned int rshash (const char *p) { + /* hash function from Robert Sedgwicks 'Algorithms in C' book */ + unsigned int b = 378551; + unsigned int a = 63689; + unsigned int retval = 0; - len = strlen(filename); - if (filename[0] != '/') { - ++len; + for( ; *p; p++) { + retval = retval * a + (*p); + a *= b; } - if (len > NAME_MAX) { - len = NAME_MAX; - } - /* Allocate the required string */ - result = apr_palloc(pool, len+1); - in = filename; - if (*in == '/') { - ++in; - } + return retval; +} - out = result; - *out++ = '/'; +static const char *make_shm_open_safe_name(const char *filename, + apr_pool_t *pool) +{ + apr_ssize_t flen; + unsigned int h1, h2; - for ( ; --len; ++in, ++out) { - if (*in == '/') { - /* '/' becomes '|' */ - *out = '|'; - } else { - /* Everything else remains unchanged */ - *out = *in; - } + if (filename == NULL) { + return NULL; } - *out = '\0'; + flen = strlen(filename); + h1 = (apr_hashfunc_default(filename, &flen) & 0xffffffff); + h2 = (rshash(filename) & 0xffffffff); + return apr_psprintf(pool, "/ShM.%xH%x", h1, h2); - return result; } #endif From 1d5c6c81e9439cbff8871572f4d466d692706455 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 25 Jan 2014 15:17:01 +0000 Subject: [PATCH 7403/7878] Maintain ordering but use OVERRIDE if enabled AND found git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1561321 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 331a5779efd..bd86b30bfb6 100644 --- a/configure.in +++ b/configure.in @@ -1150,6 +1150,11 @@ APR_IFALLYES(header:sys/mman.h func:mmap func:munmap, [havemmaptmp="1" APR_DECIDE(USE_SHMEM_MMAP_TMP, [Classical mmap() on temporary file])]) +APR_IFALLYES(header:sys/mman.h func:mmap func:munmap func:shm_open dnl + func:shm_unlink, + [havemmapshm="1" + APR_DECIDE(USE_SHMEM_MMAP_SHM, + [mmap() via POSIX.1 shm_open() on temporary file])]) APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl func:shmget func:shmat func:shmdt func:shmctl, [haveshmget="1" @@ -1166,11 +1171,9 @@ APR_IFALLYES(header:windows.h, AC_ARG_ENABLE(posix-shm, [ --enable-posix-shm Use POSIX shared memory (shm_open) if available], [ -APR_IFALLYES(header:sys/mman.h func:mmap func:munmap func:shm_open dnl - func:shm_unlink, - [havemmapshm="1" - APR_DECIDE(USE_SHMEM_MMAP_SHM, - [mmap() via POSIX.1 shm_open() on temporary file])]) +if test "$havemmapshm" = "1"; then + APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_SHM) +fi ]) case $host in *linux* ) From d6e001121e85d4bfa687a56836ed7a0633a1720e Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 25 Jan 2014 17:57:25 +0000 Subject: [PATCH 7404/7878] Revert mistaken c/p git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1561347 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 3fb20123d9c..0d026e31cc1 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -325,7 +325,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, shm_unlink(shm_name); /* we're failing, remove the object */ return status; } - new_m->base = mmap(NULL, new_m->realsize, PROT_READ | PROT_WRITE, + new_m->base = mmap(NULL, reqsize, PROT_READ | PROT_WRITE, MAP_SHARED, tmpfd, 0); /* FIXME: check for errors */ From 153e99052486ac7f9ec047396dc70821a01198d5 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 25 Jan 2014 18:21:54 +0000 Subject: [PATCH 7405/7878] Get working on OSX and others. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1561356 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 0d026e31cc1..f180c204401 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -292,7 +292,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, } status = apr_file_trunc(file, new_m->realsize); - if (status != APR_SUCCESS) { + if (status != APR_SUCCESS && status != APR_ESPIPE) { apr_file_close(file); /* ignore errors, we're failing */ apr_file_remove(new_m->filename, new_m->pool); return status; @@ -321,10 +321,11 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, } status = apr_file_trunc(file, new_m->realsize); - if (status != APR_SUCCESS) { + if (status != APR_SUCCESS && status != APR_ESPIPE) { shm_unlink(shm_name); /* we're failing, remove the object */ return status; } + /* TODO: should we use new_m->realsize instead of reqsize ?? */ new_m->base = mmap(NULL, reqsize, PROT_READ | PROT_WRITE, MAP_SHARED, tmpfd, 0); From f55a421fbd0021230b6582b5ab9edfb975b653ca Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 25 Jan 2014 18:29:33 +0000 Subject: [PATCH 7406/7878] Note userland changes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1561361 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 04e4c7ed6e6..318502f1fc1 100644 --- a/CHANGES +++ b/CHANGES @@ -2,7 +2,9 @@ Changes for APR 2.0.0 *) Fix POSIX shared memory (shm_open) use for named shared memory. - PR 55928. [Jozef Hatala , Jim Jagielski] + Includes adding '--enable-posix-shm' to force POSIX shm if + available, and OSX compatibility. PR 55928. + [Jozef Hatala , Jim Jagielski] *) Windows platform: Remove support for Windows 9x. From d51741986df50e2896afed5777da52beddb92f23 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 25 Jan 2014 20:07:52 +0000 Subject: [PATCH 7407/7878] FIXME comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1561384 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index f180c204401..bdb7e6615b4 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -308,6 +308,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, } #endif /* APR_USE_SHMEM_MMAP_TMP */ #if APR_USE_SHMEM_MMAP_SHM + /* FIXME: SysV uses 0600... should we? */ tmpfd = shm_open(shm_name, O_RDWR | O_CREAT | O_EXCL, 0644); if (tmpfd == -1) { return errno; @@ -534,6 +535,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, #if APR_USE_SHMEM_MMAP_SHM const char *shm_name = make_shm_open_safe_name(filename, pool); + /* FIXME: SysV uses 0600... should we? */ tmpfd = shm_open(shm_name, O_RDWR, 0644); if (tmpfd == -1) { return errno; From 62a269458ceb630e202bc0385982940b7ac476ff Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 25 Jan 2014 20:35:02 +0000 Subject: [PATCH 7408/7878] Okey dokey... how we gen the key isn't part of our ABI, so we can fix it without breaking it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1561394 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ shmem/unix/shm.c | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 318502f1fc1..479646acc0e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) When using shmget-based shared memory, the ID used for ftok is + now an APR hash of the filename instead of the constant '1'. + We do this to help avoid collisions. PR 53996 [Jim Jagielski] + *) Fix POSIX shared memory (shm_open) use for named shared memory. Includes adding '--enable-posix-shm' to force POSIX shm if available, and OSX compatibility. PR 55928. diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index bdb7e6615b4..39b64472c70 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -67,6 +67,17 @@ static const char *make_shm_open_safe_name(const char *filename, } #endif +#if APR_USE_SHMEM_SHMGET +static key_t our_ftok(const char *filename) +{ + /* to help avoid collisions while still using + * an easily recreated proj_id */ + apr_ssize_t slen = strlen(filename); + return ftok(filename, + (int)apr_hashfunc_default(filename, &slen)); +} +#endif + static apr_status_t shm_cleanup_owner(void *m_) { apr_shm_t *m = (apr_shm_t *)m_; @@ -361,7 +372,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* ftok() (on solaris at least) requires that the file actually * exist before calling ftok(). */ - new_m->shmkey = ftok(filename, 1); + new_m->shmkey = our_ftok(filename); if (new_m->shmkey == (key_t)-1) { apr_file_close(file); return errno; @@ -451,7 +462,7 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, /* ftok() (on solaris at least) requires that the file actually * exist before calling ftok(). */ - shmkey = ftok(filename, 1); + shmkey = our_ftok(filename); if (shmkey == (key_t)-1) { goto shm_remove_failed; } @@ -623,7 +634,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, new_m->filename = apr_pstrdup(pool, filename); new_m->pool = pool; - new_m->shmkey = ftok(filename, 1); + new_m->shmkey = our_ftok(filename); if (new_m->shmkey == (key_t)-1) { return errno; } From 259a7fda1b3419a6ac3adc5d22c4a2dd6dddb3b7 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sun, 26 Jan 2014 22:02:57 +0000 Subject: [PATCH 7409/7878] Ahh... found a testcase which req's this. FIX data corruption git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1561555 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/unix/shm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 39b64472c70..91b620a75e1 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -337,8 +337,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, shm_unlink(shm_name); /* we're failing, remove the object */ return status; } - /* TODO: should we use new_m->realsize instead of reqsize ?? */ - new_m->base = mmap(NULL, reqsize, PROT_READ | PROT_WRITE, + new_m->base = mmap(NULL, new_m->realsize, PROT_READ | PROT_WRITE, MAP_SHARED, tmpfd, 0); /* FIXME: check for errors */ From 071f1167b3c7a5fc6e04ae77e9217618a89a16b5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 12 Feb 2014 19:18:23 +0000 Subject: [PATCH 7410/7878] Correct nonsense test for non-exported sys/stat.h autoconf flag Introduce non-exported sys/attr.h autoconf flag for OS/X git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1567722 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + file_io/unix/mktemp.c | 2 +- file_io/win32/open.c | 2 +- file_io/win32/pipe.c | 2 +- include/arch/unix/apr_arch_file_io.h | 3 +++ 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index bd86b30bfb6..fba4bd0dc9c 100644 --- a/configure.in +++ b/configure.in @@ -1379,6 +1379,7 @@ APR_FLAG_HEADERS( netinet/in.h \ netinet/sctp.h \ netinet/sctp_uio.h \ + sys/attr.h \ sys/file.h \ sys/ioctl.h \ sys/mman.h \ diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 89d9842d419..760f04a4a88 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -74,7 +74,7 @@ #if APR_HAVE_SYS_TYPES_H #include #endif -#if APR_HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H #include #endif #if APR_HAVE_FCNTL_H diff --git a/file_io/win32/open.c b/file_io/win32/open.c index b668645bb15..3c00bfc79cd 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -26,7 +26,7 @@ #endif #include #include -#if APR_HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H #include #endif #include "apr_arch_misc.h" diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 021ce9d5ddd..010cee97e21 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -26,7 +26,7 @@ #if APR_HAVE_SYS_TYPES_H #include #endif -#if APR_HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H #include #endif #if APR_HAVE_PROCESS_H diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index 5847cdc2c79..a3102fa7efa 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -54,6 +54,9 @@ #ifdef HAVE_SYS_STAT_H #include #endif +#ifdef HAVE_SYS_ATTR_H +#include +#endif #if APR_HAVE_UNISTD_H #include #endif From 8fbda57afd318e6576d0de8f484a31e1855a3510 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 12 Feb 2014 21:17:16 +0000 Subject: [PATCH 7411/7878] Revert sys/attr.h test for the time being, reapplying later as a complete patch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1567758 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 - include/arch/unix/apr_arch_file_io.h | 3 --- 2 files changed, 4 deletions(-) diff --git a/configure.in b/configure.in index fba4bd0dc9c..bd86b30bfb6 100644 --- a/configure.in +++ b/configure.in @@ -1379,7 +1379,6 @@ APR_FLAG_HEADERS( netinet/in.h \ netinet/sctp.h \ netinet/sctp_uio.h \ - sys/attr.h \ sys/file.h \ sys/ioctl.h \ sys/mman.h \ diff --git a/include/arch/unix/apr_arch_file_io.h b/include/arch/unix/apr_arch_file_io.h index a3102fa7efa..5847cdc2c79 100644 --- a/include/arch/unix/apr_arch_file_io.h +++ b/include/arch/unix/apr_arch_file_io.h @@ -54,9 +54,6 @@ #ifdef HAVE_SYS_STAT_H #include #endif -#ifdef HAVE_SYS_ATTR_H -#include -#endif #if APR_HAVE_UNISTD_H #include #endif From bf5c5893d3a441c69c6cc9b53c6a78973d4eadac Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 26 Feb 2014 01:23:12 +0000 Subject: [PATCH 7412/7878] minor Doxygen and editorial fixes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1571894 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/include/apr_time.h b/include/apr_time.h index 6dd70cc8d01..15e0b961152 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -42,7 +42,7 @@ APR_DECLARE_DATA extern const char apr_month_snames[12][4]; APR_DECLARE_DATA extern const char apr_day_snames[7][4]; -/** number of microseconds since 00:00:00 january 1, 1970 UTC */ +/** number of microseconds since 00:00:00 January 1, 1970 UTC */ typedef apr_int64_t apr_time_t; @@ -93,7 +93,7 @@ typedef struct apr_time_exp_t apr_time_exp_t; /** * a structure similar to ANSI struct tm with the following differences: * - tm_usec isn't an ANSI field - * - tm_gmtoff isn't an ANSI field (it's a bsdism) + * - tm_gmtoff isn't an ANSI field (it's a BSDism) */ struct apr_time_exp_t { /** microseconds past tm_sec */ @@ -110,9 +110,9 @@ struct apr_time_exp_t { apr_int32_t tm_mon; /** year since 1900 */ apr_int32_t tm_year; - /** (0-6) days since sunday */ + /** (0-6) days since Sunday */ apr_int32_t tm_wday; - /** (0-365) days since jan 1 */ + /** (0-365) days since January 1 */ apr_int32_t tm_yday; /** daylight saving time */ apr_int32_t tm_isdst; @@ -121,7 +121,7 @@ struct apr_time_exp_t { }; /** - * convert an ansi time_t to an apr_time_t + * Convert an ansi time_t to an apr_time_t * @param result the resulting apr_time_t * @param input the time_t to convert */ @@ -129,8 +129,8 @@ APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, time_t input); /** - * convert a time to its human readable components using an offset - * from GMT + * Convert a time to its human readable components using an offset + * from GMT. * @param result the exploded time * @param input the time to explode * @param offs the number of seconds offset to apply @@ -140,7 +140,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, apr_int32_t offs); /** - * convert a time to its human readable components in GMT timezone + * Convert a time to its human readable components (GMT). * @param result the exploded time * @param input the time to explode */ @@ -148,7 +148,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, apr_time_t input); /** - * convert a time to its human readable components in local timezone + * Convert a time to its human readable components in the local timezone. * @param result the exploded time * @param input the time to explode */ @@ -156,8 +156,8 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, apr_time_t input); /** - * Convert time value from human readable format to a numeric apr_time_t - * e.g. elapsed usec since epoch + * Convert time value from human readable format to a numeric apr_time_t + * (elapsed microseconds since the epoch). * @param result the resulting imploded time * @param input the input exploded time */ @@ -166,7 +166,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *result, /** * Convert time value from human readable format to a numeric apr_time_t that - * always represents GMT + * always represents GMT. * @param result the resulting imploded time * @param input the input exploded time */ @@ -185,7 +185,7 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t); /** * apr_rfc822_date formats dates in the RFC822 * format in an efficient manner. It is a fixed length - * format which requires the indicated amount of storage, + * format which requires APR_RFC822_DATA_LEN bytes of storage, * including the trailing NUL terminator. * @param date_str String to write to. * @param t the time to convert @@ -196,18 +196,18 @@ APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t); #define APR_CTIME_LEN (25) /** * apr_ctime formats dates in the ctime() format - * in an efficient manner. it is a fixed length format - * and requires the indicated amount of storage including + * in an efficient manner. It is a fixed length format + * and requires APR_CTIME_LEN bytes of storage including * the trailing NUL terminator. * Unlike ANSI/ISO C ctime(), apr_ctime() does not include - * a \n at the end of the string. + * a \\n at the end of the string. * @param date_str String to write to. * @param t the time to convert */ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t); /** - * formats the exploded time according to the format specified + * Formats the exploded time according to the format specified * @param s string to write to * @param retsize The length of the returned string * @param max The maximum length of the string @@ -220,7 +220,7 @@ APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, /** * Improve the clock resolution for the lifetime of the given pool. - * Generally this is only desireable on benchmarking and other very + * Generally this is only desirable on benchmarking and other very * time-sensitive applications, and has no impact on most platforms. * @param p The pool to associate the finer clock resolution */ From 71b15391252d93b5277aa11270e34969e8967f79 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 7 Mar 2014 17:48:50 +0000 Subject: [PATCH 7413/7878] A mechanism to avoid strlen reparsing of newly parsed apr_strtok elements git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1575340 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index ed41931fb6d..c0642adb211 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -235,8 +235,14 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, * first call to apr_strtok() for a given string, and NULL * on subsequent calls. * @param sep The set of delimiters - * @param last Internal state saved by apr_strtok() between calls. + * @param last State saved by apr_strtok() between calls. * @return The next token from the string + * @note the 'last' state points to the trailing NUL char of the final + * token, otherwise it points to the character following the current + * token (all successive or empty occurances of sep are skiped on the + * subsequent call to apr_strtok). Therefore it is possible to avoid + * a strlen() determination, with the following logic; + * toklen = last - retval; if (*last) --toklen; */ APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last); From 44c9fcd2f6b26baeb8377bff820acf702f5a99ee Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sat, 8 Mar 2014 10:57:39 +0000 Subject: [PATCH 7414/7878] Update config.guess and config.sub from http://git.savannah.gnu.org/cgit/config.git. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1575509 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 184 ++++++--------------------------------------- build/config.sub | 6 +- 2 files changed, 26 insertions(+), 164 deletions(-) diff --git a/build/config.guess b/build/config.guess index b79252d6b10..72625d40c00 100755 --- a/build/config.guess +++ b/build/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2013-06-10' +timestamp='2014-02-12' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -149,7 +149,7 @@ Linux|GNU|GNU/*) LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac @@ -1260,16 +1260,26 @@ EOF if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; @@ -1361,154 +1371,6 @@ EOF exit ;; esac -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - cat >&2 <." version="\ GNU config.sub ($timestamp) -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." From e66d6eeff6c885c2c09ba7090069f3529e3bc325 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Mon, 17 Mar 2014 15:08:15 +0000 Subject: [PATCH 7415/7878] Fix another "out of tree build" problem for gen_test_char when using an old libtool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1578420 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile.in b/Makefile.in index 9d28d5f302f..7935036a71a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -161,7 +161,11 @@ check: $(TARGET_LIB) etags: etags `find . -name '*.[ch]'` +make_tools_dir: + $(APR_MKDIR) tools + OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS) +tools/gen_test_char.lo: make_tools_dir tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char) $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS) From 248a7bb828a9e73ced964161146c667d8b692330 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 13 Apr 2014 17:10:56 +0000 Subject: [PATCH 7416/7878] Add apr_sockaddr_info_copy(), for making a deep copy of an apr_sockaddr_t into a specified pool. Submitted by: Yann Ylavic Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1587045 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_network_io.h | 9 +++++++++ network_io/unix/sockaddr.c | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/CHANGES b/CHANGES index 479646acc0e..b92c1228cb6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add apr_sockaddr_info_copy(), for making a deep copy of an + apr_sockaddr_t into a specified pool. [Yann Ylavic + ] + *) When using shmget-based shared memory, the ID used for ftok is now an APR hash of the filename instead of the constant '1'. We do this to help avoid collisions. PR 53996 [Jim Jagielski] diff --git a/include/apr_network_io.h b/include/apr_network_io.h index b8fc69e2af3..12998a3cdc2 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -428,6 +428,15 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, apr_int32_t flags, apr_pool_t *p); +/** + * Copy apr_sockaddr_t src to dst on pool p. + * @param dst The destination apr_sockaddr_t. + * @param src The source apr_sockaddr_t. + * @param p The pool for the apr_sockaddr_t and associated storage. + */ +APR_DECLARE(apr_status_t) apr_sockaddr_info_copy(apr_sockaddr_t **dst, + const apr_sockaddr_t *src, + apr_pool_t *p); /** * Look up the host name from an apr_sockaddr_t. diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 080c7a29830..d51556e2583 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -660,6 +660,42 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, return find_addresses(sa, hostname, family, port, flags, p); } +APR_DECLARE(apr_status_t) apr_sockaddr_info_copy(apr_sockaddr_t **dst, + const apr_sockaddr_t *src, + apr_pool_t *p) +{ + apr_sockaddr_t *d; + const apr_sockaddr_t *s; + + for (*dst = d = NULL, s = src; s; s = s->next) { + if (!d) { + *dst = d = apr_pmemdup(p, s, sizeof *s); + } + else { + d = d->next = apr_pmemdup(p, s, sizeof *s); + } + if (s->hostname) { + if (s == src || s->hostname != src->hostname) { + d->hostname = apr_pstrdup(p, s->hostname); + } + else { + d->hostname = (*dst)->hostname; + } + } + if (s->servname) { + if (s == src || s->servname != src->servname) { + d->servname = apr_pstrdup(p, s->servname); + } + else { + d->servname = (*dst)->servname; + } + } + d->pool = p; + apr_sockaddr_vars_set(d, s->family, s->port); + } + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, apr_sockaddr_t *sockaddr, apr_int32_t flags) From e807a665d22727d33244e84641ddc96e41865fd1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 13 Apr 2014 18:05:37 +0000 Subject: [PATCH 7417/7878] apr_os_proc_mutex_get() on Unix: Avoid segfault for cross- process pthread mutexes. Submitted by: Yann Ylavic Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1587063 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 728506583b2..f229b19b174 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -1013,7 +1013,12 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, apr_proc_mutex_t *pmutex) { #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE - ospmutex->crossproc = pmutex->interproc->filedes; + if (pmutex->interproc) { + ospmutex->crossproc = pmutex->interproc->filedes; + } + else { + ospmutex->crossproc = -1; + } #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE ospmutex->pthread_interproc = pmutex->pthread_interproc; From 58f5d08316ff97325a60f24c8b4d13cd8b647bdb Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 13 Apr 2014 18:15:27 +0000 Subject: [PATCH 7418/7878] Complain about apr_os_prox_mutex_get() interface. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1587066 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/STATUS b/STATUS index ab252fac608..9dc9f5d6730 100644 --- a/STATUS +++ b/STATUS @@ -109,6 +109,9 @@ Contributors looking for a mission: RELEASE SHOWSTOPPERS: * apr_file_rotating_* on most platforms + * Fix apr_os_proc_mutex_get() API. The apr_os_proc_mutex_t structure + used on Unix must tell you what kind of mutex it is, and it may as + well be used on all platforms. CURRENT VOTES: From 02c5729f1c5e5463e34b8297c2f65ddc81e85a6b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 15 Apr 2014 12:14:36 +0000 Subject: [PATCH 7419/7878] Add testcase for apr_sockaddr_info_copy() Submitted by: Yann Ylavic Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1587543 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/test/testsock.c b/test/testsock.c index da7bc03996a..620c3f6a6e8 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -97,6 +97,56 @@ static void test_addr_info(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, 0, ntohs(sa->sa.sin.sin_port)); } +static void test_addr_copy(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_sockaddr_t *sa1, *sa2; + int rc; + const char *hosts[] = { + "127.0.0.1", +#if APR_HAVE_IPV6 + "::1", +#endif + NULL + }, **host = hosts; + + /* Loop up to and including NULL */ + do { + rv = apr_sockaddr_info_get(&sa1, *host, APR_UNSPEC, 80, 0, p); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); + + rv = apr_sockaddr_info_copy(&sa2, sa1, p); + APR_ASSERT_SUCCESS(tc, "Problem copying sockaddr", rv); + + ABTS_PTR_NOTNULL(tc, sa1); + do { + ABTS_PTR_NOTNULL(tc, sa2); + + rc = apr_sockaddr_equal(sa2, sa1); + ABTS_INT_NEQUAL(tc, 0, rc); + ABTS_INT_EQUAL(tc, 80, sa1->port); + ABTS_INT_EQUAL(tc, sa2->port, sa1->port); + ABTS_INT_EQUAL(tc, 80, ntohs(sa1->sa.sin.sin_port)); + ABTS_INT_EQUAL(tc, ntohs(sa2->sa.sin.sin_port), ntohs(sa1->sa.sin.sin_port)); + + if (*host) { + ABTS_PTR_NOTNULL(tc, sa1->hostname); + ABTS_PTR_NOTNULL(tc, sa2->hostname); + ABTS_STR_EQUAL(tc, *host, sa1->hostname); + ABTS_STR_EQUAL(tc, sa1->hostname, sa2->hostname); + ABTS_TRUE(tc, sa1->hostname != sa2->hostname); + } + else { + ABTS_PTR_EQUAL(tc, NULL, sa1->hostname); + ABTS_PTR_EQUAL(tc, NULL, sa2->hostname); + } + + } while ((sa2 = sa2->next, sa1 = sa1->next)); + ABTS_PTR_EQUAL(tc, NULL, sa2); + + } while (*host++); +} + static void test_serv_by_name(abts_case *tc, void *data) { apr_status_t rv; @@ -562,6 +612,7 @@ abts_suite *testsock(abts_suite *suite) suite = ADD_SUITE(suite) socket_name = IPV4_SOCKET_NAME; abts_run_test(suite, test_addr_info, NULL); + abts_run_test(suite, test_addr_copy, NULL); abts_run_test(suite, test_serv_by_name, NULL); abts_run_test(suite, test_create_bind_listen, NULL); abts_run_test(suite, test_send, NULL); From 2c1114d06aeea9ef2bc066d9984a037c45a9c922 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 15 Apr 2014 12:18:34 +0000 Subject: [PATCH 7420/7878] minor API doc improvements git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1587545 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_info.h | 2 +- include/apr_fnmatch.h | 18 +++++++++++------- include/apr_thread_mutex.h | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/include/apr_file_info.h b/include/apr_file_info.h index b3006ac4cea..1d19eb6a3f4 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -208,7 +208,7 @@ struct apr_finfo_t { const char *fname; /** The file's name (no path) in filesystem case */ const char *name; - /** The file's handle, if accessed (can be submitted to apr_duphandle) */ + /** Unused */ struct apr_file_t *filehand; }; diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index ef6d0b25086..e8f6b03cfbc 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -60,9 +60,7 @@ extern "C" { #define APR_FNM_NOESCAPE 0x01 /**< Disable backslash escaping. */ #define APR_FNM_PATHNAME 0x02 /**< Slash must be matched by slash. */ #define APR_FNM_PERIOD 0x04 /**< Period must be matched by period. */ -#define APR_FNM_CASE_BLIND 0x08 /**< Compare characters case-insensitively. - * @remark This flag is an Apache addition - */ +#define APR_FNM_CASE_BLIND 0x08 /**< Compare characters case-insensitively. */ /** * Try to match the string to the given pattern, return APR_SUCCESS if @@ -130,13 +128,19 @@ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, APR_DECLARE(int) apr_fnmatch_test(const char *pattern); /** - * Find all files that match a specified pattern. - * @param pattern The pattern to use for finding files. + * Find all files that match a specified pattern in a directory. + * @param dir_pattern The pattern to use for finding files, appended + * to the search directory. The pattern is anything following the + * final forward or backward slash in the parameter. If no slash + * is found, the current directory is searched. * @param result Array to use when storing the results * @param p The pool to use. - * @return non-zero if pattern has any glob characters in it + * @return APR_SUCCESS if no processing errors occurred, APR error + * code otherwise + * @remark The returned array may be empty even if APR_SUCCESS was + * returned. */ -APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, +APR_DECLARE(apr_status_t) apr_match_glob(const char *dir_pattern, apr_array_header_t **result, apr_pool_t *p); diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 4596dce5d22..193a70a3822 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -59,7 +59,7 @@ typedef struct apr_thread_mutex_t apr_thread_mutex_t; *
    * @param pool the pool from which to allocate the mutex. * @warning Be cautious in using APR_THREAD_MUTEX_DEFAULT. While this is the - * most optimial mutex based on a given platform's performance charateristics, + * most optimal mutex based on a given platform's performance characteristics, * it will behave as either a nested or an unnested lock. */ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, From 14d8873bf9cb2edfbac235fb783f06265f9e6824 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 21 Apr 2014 12:57:43 +0000 Subject: [PATCH 7421/7878] Add apr_escape_ldap() and apr_pescape_ldap(), escaping characters as described by RFC4514 and RFC4515 respectively. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1588878 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ encoding/apr_escape.c | 68 +++++++++++++++++++++++++++++++++++++++++++ include/apr_escape.h | 25 ++++++++++++++++ test/testescape.c | 12 ++++++++ tools/gen_test_char.c | 10 ++++++- 5 files changed, 117 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index b92c1228cb6..604f54e6e17 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add apr_escape_ldap() and apr_pescape_ldap(), escaping characters + as described by RFC4514 and RFC4515 respectively. [Graham Leggett] + *) Add apr_sockaddr_info_copy(), for making a deep copy of an apr_sockaddr_t into a specified pool. [Yann Ylavic ] diff --git a/encoding/apr_escape.c b/encoding/apr_escape.c index 2bcfec418fe..33705c7390d 100644 --- a/encoding/apr_escape.c +++ b/encoding/apr_escape.c @@ -1179,3 +1179,71 @@ APR_DECLARE(const void *) apr_punescape_hex(apr_pool_t *p, const char *str, return NULL; } + +APR_DECLARE(apr_status_t) apr_escape_ldap(char *escaped, const void *str, + apr_ssize_t slen, apr_size_t *len) +{ + apr_size_t size = 1; + int found = 0; + const unsigned char *s = (const unsigned char *) str; + unsigned char *d = (unsigned char *) escaped; + unsigned c; + + if (s) { + if (d) { + while (((c = *s) && slen) || (slen > 0)) { + if (TEST_CHAR(c, T_ESCAPE_LDAP)) { + d = c2x(c, '\\', d); + size += 2; + found = 1; + } + else { + *d++ = c; + } + ++s; + size++; + slen--; + } + *d = '\0'; + } + else { + while (((c = *s) && slen) || (slen > 0)) { + if (TEST_CHAR(c, T_ESCAPE_LDAP)) { + size += 2; + found = 1; + } + ++s; + size++; + slen--; + } + } + } + + if (len) { + *len = size; + } + if (!found) { + return APR_NOTFOUND; + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *) apr_pescape_ldap(apr_pool_t *p, const void *src, apr_ssize_t srclen) +{ + apr_size_t len; + + switch (apr_escape_ldap(NULL, src, srclen, &len)) { + case APR_SUCCESS: { + char *encoded = apr_palloc(p, len); + apr_escape_ldap(encoded, src, srclen, NULL); + return encoded; + } + case APR_NOTFOUND: { + break; + } + } + + return src; +} + diff --git a/include/apr_escape.h b/include/apr_escape.h index 17422b3a1b4..f1968be0cee 100644 --- a/include/apr_escape.h +++ b/include/apr_escape.h @@ -366,6 +366,31 @@ APR_DECLARE(apr_status_t) apr_unescape_hex(void *dest, const char *str, APR_DECLARE(const void *) apr_punescape_hex(apr_pool_t *p, const char *str, int colon, apr_size_t *len); +/** + * Apply LDAP escaping to binary data. Characters from RFC4514 and RFC4515 + * are escaped with their hex equivalents. + * @param dest The destination buffer, can be NULL + * @param src The original buffer + * @param srclen The length of the original buffer + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_ldap(char *dest, const void *src, + apr_ssize_t srclen, apr_size_t *len); + +/** + * Apply LDAP escaping to binary data, and return the results from a + * pool. Characters from RFC4514 and RFC4515 are escaped with their hex + * equivalents. + * @param p Pool to allocate from + * @param src The original buffer + * @param slen The length of the original buffer + * @return A zero padded buffer allocated from the pool on success, or + * NULL if src was NULL. + */ +APR_DECLARE(const char *) apr_pescape_ldap(apr_pool_t *p, const void *src, + apr_ssize_t slen) __attribute__((nonnull(1))); + /** @} */ #ifdef __cplusplus } diff --git a/test/testescape.c b/test/testescape.c index 323ff56186b..8d537de0e18 100644 --- a/test/testescape.c +++ b/test/testescape.c @@ -262,6 +262,18 @@ static void test_escape(abts_case *tc, void *data) apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, (apr_size_t)4), (len == 4)); + src = "Parens R Us (for all your parenthetical needs) plus asterisk* \"+,;<>\\"; + target = "Parens R Us \\28for all your parenthetical needs\\29 plus asterisk\\2a \\22\\2b\\2c\\3b\\3c\\3e\\5c"; + dest = apr_pescape_ldap(pool, src, APR_ESCAPE_STRING); + ABTS_ASSERT(tc, + apr_psprintf(pool, "shell escaped (%s) does not match expected output (%s)", + dest, target), + (strcmp(dest, target) == 0)); + apr_escape_ldap(NULL, src, APR_ESCAPE_STRING, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + apr_pool_destroy(pool); } diff --git a/tools/gen_test_char.c b/tools/gen_test_char.c index 811c802f215..156b3314550 100644 --- a/tools/gen_test_char.c +++ b/tools/gen_test_char.c @@ -32,6 +32,7 @@ #define T_ESCAPE_ECHO (0x08) #define T_ESCAPE_URLENCODED (0x10) #define T_ESCAPE_XML (0x20) +#define T_ESCAPE_LDAP (0x40) int main(int argc, char *argv[]) { @@ -46,6 +47,7 @@ int main(int argc, char *argv[]) "#define T_ESCAPE_ECHO (%u)\n" "#define T_ESCAPE_URLENCODED (%u)\n" "#define T_ESCAPE_XML (%u)\n" + "#define T_ESCAPE_LDAP (%u)\n" "\n" "static const unsigned char test_char_table[256] = {", T_ESCAPE_SHELL_CMD, @@ -53,7 +55,8 @@ int main(int argc, char *argv[]) T_OS_ESCAPE_PATH, T_ESCAPE_ECHO, T_ESCAPE_URLENCODED, - T_ESCAPE_XML); + T_ESCAPE_XML, + T_ESCAPE_LDAP); for (c = 0; c < 256; ++c) { flags = 0; @@ -106,6 +109,11 @@ int main(int argc, char *argv[]) flags |= T_ESCAPE_XML; } + /* LDAP DN escaping (RFC4514) and LDAP filter escaping (RFC4515) */ + if (!isprint(c) || strchr("\"+,;<>\\", c) || strchr("*()\\", c)) { + flags |= T_ESCAPE_LDAP; + } + printf("%u%c", flags, (c < 255) ? ',' : ' '); } From a198e23253eb7e245ecd8cb86d5a78ea19cedecf Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 21 Apr 2014 17:45:58 +0000 Subject: [PATCH 7422/7878] Split the ability to filter LDAP escape sequences into DN escaping or filter escaping, allowing the option to escape both at the same time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1588937 13f79535-47bb-0310-9956-ffa450edef68 --- encoding/apr_escape.c | 15 +++++++++------ include/apr_escape.h | 25 ++++++++++++++++++++++--- test/testescape.c | 30 +++++++++++++++++++++++++++--- tools/gen_test_char.c | 20 ++++++++++++++------ 4 files changed, 72 insertions(+), 18 deletions(-) diff --git a/encoding/apr_escape.c b/encoding/apr_escape.c index 33705c7390d..eda46759342 100644 --- a/encoding/apr_escape.c +++ b/encoding/apr_escape.c @@ -1181,7 +1181,7 @@ APR_DECLARE(const void *) apr_punescape_hex(apr_pool_t *p, const char *str, } APR_DECLARE(apr_status_t) apr_escape_ldap(char *escaped, const void *str, - apr_ssize_t slen, apr_size_t *len) + apr_ssize_t slen, int flags, apr_size_t *len) { apr_size_t size = 1; int found = 0; @@ -1192,7 +1192,8 @@ APR_DECLARE(apr_status_t) apr_escape_ldap(char *escaped, const void *str, if (s) { if (d) { while (((c = *s) && slen) || (slen > 0)) { - if (TEST_CHAR(c, T_ESCAPE_LDAP)) { + if (((flags & APR_ESCAPE_LDAP_DN) && TEST_CHAR(c, T_ESCAPE_LDAP_DN)) + || ((flags & APR_ESCAPE_LDAP_FILTER) && TEST_CHAR(c, T_ESCAPE_LDAP_FILTER))) { d = c2x(c, '\\', d); size += 2; found = 1; @@ -1208,7 +1209,8 @@ APR_DECLARE(apr_status_t) apr_escape_ldap(char *escaped, const void *str, } else { while (((c = *s) && slen) || (slen > 0)) { - if (TEST_CHAR(c, T_ESCAPE_LDAP)) { + if (((flags & APR_ESCAPE_LDAP_DN) && TEST_CHAR(c, T_ESCAPE_LDAP_DN)) + || ((flags & APR_ESCAPE_LDAP_FILTER) && TEST_CHAR(c, T_ESCAPE_LDAP_FILTER))) { size += 2; found = 1; } @@ -1229,14 +1231,15 @@ APR_DECLARE(apr_status_t) apr_escape_ldap(char *escaped, const void *str, return APR_SUCCESS; } -APR_DECLARE(const char *) apr_pescape_ldap(apr_pool_t *p, const void *src, apr_ssize_t srclen) +APR_DECLARE(const char *) apr_pescape_ldap(apr_pool_t *p, const void *src, + apr_ssize_t srclen, int flags) { apr_size_t len; - switch (apr_escape_ldap(NULL, src, srclen, &len)) { + switch (apr_escape_ldap(NULL, src, srclen, flags, &len)) { case APR_SUCCESS: { char *encoded = apr_palloc(p, len); - apr_escape_ldap(encoded, src, srclen, NULL); + apr_escape_ldap(encoded, src, srclen, flags, NULL); return encoded; } case APR_NOTFOUND: { diff --git a/include/apr_escape.h b/include/apr_escape.h index f1968be0cee..6d4e08be0f3 100644 --- a/include/apr_escape.h +++ b/include/apr_escape.h @@ -40,7 +40,22 @@ extern "C" { * passed to indicate a string-valued key, and have the length computed * automatically. */ -#define APR_ESCAPE_STRING (-1) +#define APR_ESCAPE_STRING (-1) + +/** + * Apply LDAP distinguished name escaping as per RFC4514. + */ +#define APR_ESCAPE_LDAP_DN (0x01) + +/** + * Apply LDAP filter escaping as per RFC4515. + */ +#define APR_ESCAPE_LDAP_FILTER (0x02) + +/** + * Apply both RFC4514 and RFC4515 LDAP escaping. + */ +#define APR_ESCAPE_LDAP_ALL (0x03) /** * Perform shell escaping on the provided string. @@ -372,11 +387,13 @@ APR_DECLARE(const void *) apr_punescape_hex(apr_pool_t *p, const char *str, * @param dest The destination buffer, can be NULL * @param src The original buffer * @param srclen The length of the original buffer + * @param flags APR_ESCAPE_LDAP_DN for RFC4514, APR_ESCAPE_LDAP_FILTER for + * RFC4515, APR_ESCAPE_LDAP_ALL for both * @param len If present, returns the length of the string * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL */ APR_DECLARE(apr_status_t) apr_escape_ldap(char *dest, const void *src, - apr_ssize_t srclen, apr_size_t *len); + apr_ssize_t srclen, int flags, apr_size_t *len); /** * Apply LDAP escaping to binary data, and return the results from a @@ -385,11 +402,13 @@ APR_DECLARE(apr_status_t) apr_escape_ldap(char *dest, const void *src, * @param p Pool to allocate from * @param src The original buffer * @param slen The length of the original buffer + * @param flags APR_ESCAPE_LDAP_DN for RFC4514, APR_ESCAPE_LDAP_FILTER for + * RFC4515, APR_ESCAPE_LDAP_ALL for both * @return A zero padded buffer allocated from the pool on success, or * NULL if src was NULL. */ APR_DECLARE(const char *) apr_pescape_ldap(apr_pool_t *p, const void *src, - apr_ssize_t slen) __attribute__((nonnull(1))); + apr_ssize_t slen, int flags) __attribute__((nonnull(1))); /** @} */ #ifdef __cplusplus diff --git a/test/testescape.c b/test/testescape.c index 8d537de0e18..66452274d5f 100644 --- a/test/testescape.c +++ b/test/testescape.c @@ -262,14 +262,38 @@ static void test_escape(abts_case *tc, void *data) apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, (apr_size_t)4), (len == 4)); + src = "Parens R Us (for all your parenthetical needs) plus asterisk* \"+,;<>\\"; + target = "Parens R Us (for all your parenthetical needs) plus asterisk* \\22\\2b\\2c\\3b\\3c\\3e\\5c"; + dest = apr_pescape_ldap(pool, src, APR_ESCAPE_STRING, APR_ESCAPE_LDAP_DN); + ABTS_ASSERT(tc, + apr_psprintf(pool, "ldap escaped (%s) does not match expected output (%s)", + dest, target), + (strcmp(dest, target) == 0)); + apr_escape_ldap(NULL, src, APR_ESCAPE_STRING, APR_ESCAPE_LDAP_DN, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "Parens R Us (for all your parenthetical needs) plus asterisk* \"+,;<>\\"; + target = "Parens R Us \\28for all your parenthetical needs\\29 plus asterisk\\2a \"+,;<>\\5c"; + dest = apr_pescape_ldap(pool, src, APR_ESCAPE_STRING, APR_ESCAPE_LDAP_FILTER); + ABTS_ASSERT(tc, + apr_psprintf(pool, "ldap escaped (%s) does not match expected output (%s)", + dest, target), + (strcmp(dest, target) == 0)); + apr_escape_ldap(NULL, src, APR_ESCAPE_STRING, APR_ESCAPE_LDAP_FILTER, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + src = "Parens R Us (for all your parenthetical needs) plus asterisk* \"+,;<>\\"; target = "Parens R Us \\28for all your parenthetical needs\\29 plus asterisk\\2a \\22\\2b\\2c\\3b\\3c\\3e\\5c"; - dest = apr_pescape_ldap(pool, src, APR_ESCAPE_STRING); + dest = apr_pescape_ldap(pool, src, APR_ESCAPE_STRING, APR_ESCAPE_LDAP_ALL); ABTS_ASSERT(tc, - apr_psprintf(pool, "shell escaped (%s) does not match expected output (%s)", + apr_psprintf(pool, "ldap escaped (%s) does not match expected output (%s)", dest, target), (strcmp(dest, target) == 0)); - apr_escape_ldap(NULL, src, APR_ESCAPE_STRING, &len); + apr_escape_ldap(NULL, src, APR_ESCAPE_STRING, APR_ESCAPE_LDAP_ALL, &len); ABTS_ASSERT(tc, apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), (len == strlen(dest) + 1)); diff --git a/tools/gen_test_char.c b/tools/gen_test_char.c index 156b3314550..c48d2cbe743 100644 --- a/tools/gen_test_char.c +++ b/tools/gen_test_char.c @@ -32,7 +32,8 @@ #define T_ESCAPE_ECHO (0x08) #define T_ESCAPE_URLENCODED (0x10) #define T_ESCAPE_XML (0x20) -#define T_ESCAPE_LDAP (0x40) +#define T_ESCAPE_LDAP_DN (0x40) +#define T_ESCAPE_LDAP_FILTER (0x80) int main(int argc, char *argv[]) { @@ -47,7 +48,8 @@ int main(int argc, char *argv[]) "#define T_ESCAPE_ECHO (%u)\n" "#define T_ESCAPE_URLENCODED (%u)\n" "#define T_ESCAPE_XML (%u)\n" - "#define T_ESCAPE_LDAP (%u)\n" + "#define T_ESCAPE_LDAP_DN (%u)\n" + "#define T_ESCAPE_LDAP_FILTER (%u)\n" "\n" "static const unsigned char test_char_table[256] = {", T_ESCAPE_SHELL_CMD, @@ -56,7 +58,8 @@ int main(int argc, char *argv[]) T_ESCAPE_ECHO, T_ESCAPE_URLENCODED, T_ESCAPE_XML, - T_ESCAPE_LDAP); + T_ESCAPE_LDAP_DN, + T_ESCAPE_LDAP_FILTER); for (c = 0; c < 256; ++c) { flags = 0; @@ -109,9 +112,14 @@ int main(int argc, char *argv[]) flags |= T_ESCAPE_XML; } - /* LDAP DN escaping (RFC4514) and LDAP filter escaping (RFC4515) */ - if (!isprint(c) || strchr("\"+,;<>\\", c) || strchr("*()\\", c)) { - flags |= T_ESCAPE_LDAP; + /* LDAP DN escaping (RFC4514) */ + if (!isprint(c) || strchr("\"+,;<>\\", c)) { + flags |= T_ESCAPE_LDAP_DN; + } + + /* LDAP filter escaping (RFC4515) */ + if (!isprint(c) || strchr("*()\\", c)) { + flags |= T_ESCAPE_LDAP_FILTER; } printf("%u%c", flags, (c < 255) ? ',' : ' '); From efd2d5041683cab6606db81214e6cea638b46a96 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 25 Apr 2014 10:42:40 +0000 Subject: [PATCH 7423/7878] Avoid remaking gen_test_char and the library unnecessarily. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1589982 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7935036a71a..c3c203bcf42 100644 --- a/Makefile.in +++ b/Makefile.in @@ -161,11 +161,11 @@ check: $(TARGET_LIB) etags: etags `find . -name '*.[ch]'` -make_tools_dir: +OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS) +tools/gen_test_char.lo: tools/gen_test_char.c $(APR_MKDIR) tools + $(LT_COMPILE) -OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS) -tools/gen_test_char.lo: make_tools_dir tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char) $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS) From 643b41f99e91c1c077bee542bab2360b7c2f1b78 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 28 Apr 2014 13:14:45 +0000 Subject: [PATCH 7424/7878] Add apr_shm_delete() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1590624 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++++++ include/apr_shm.h | 15 +++++++++++++++ shmem/beos/shm.c | 10 ++++++++++ shmem/os2/shm.c | 5 +++++ shmem/unix/shm.c | 10 ++++++++++ shmem/win32/shm.c | 10 ++++++++++ test/testshm.c | 41 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 99 insertions(+) diff --git a/CHANGES b/CHANGES index 604f54e6e17..7d17165d03d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add apr_shm_delete() to compliment apr_shm_remove(). + [Jim Jagielski] + *) Add apr_escape_ldap() and apr_pescape_ldap(), escaping characters as described by RFC4514 and RFC4515 respectively. [Graham Leggett] @@ -68,6 +71,11 @@ Changes for APR 2.0.0 *) Merge APR-util into APR. [various] +Changes for APR and APR-util 1.6.x and later: + + *) http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/CHANGES?view=markup + *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.6.x/CHANGES?view=markup + Changes for APR and APR-util 1.5.x and later: *) http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/CHANGES?view=markup diff --git a/include/apr_shm.h b/include/apr_shm.h index 2ed86e219e8..635c654b17f 100644 --- a/include/apr_shm.h +++ b/include/apr_shm.h @@ -136,6 +136,21 @@ APR_DECLARE(apr_status_t) apr_shm_create_ex(apr_shm_t **m, APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, apr_pool_t *pool); +/** + * Delete named resource associated with a shared memory segment, + * preventing attachments to the resource. + * @param m The shared memory segment structure to delete. + * @remark This function is only supported on platforms which support + * name-based shared memory segments, and will return APR_ENOTIMPL on + * platforms without such support. Removing the file while the shm + * is in use is not entirely portable, caller may use this to enhance + * obscurity of the resource, but be prepared for the call to fail, + * and for concurrent attempts to create a resource of the same name + * to also fail. The pool cleanup of apr_shm_create (apr_shm_destroy) + * also removes the named resource. + */ +APR_DECLARE(apr_status_t) apr_shm_delete(apr_shm_t *m); + /** * Destroy a shared memory segment and associated memory. * @param m The shared memory segment structure to destroy. diff --git a/shmem/beos/shm.c b/shmem/beos/shm.c index db94dce32b1..fcd7c84d1e6 100644 --- a/shmem/beos/shm.c +++ b/shmem/beos/shm.c @@ -100,6 +100,16 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_shm_delete(apr_shm_t *m) +{ + if (m->filename) { + return apr_shm_remove(m->filename, m->pool); + } + else { + return APR_ENOTIMPL; + } +} + APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, const char *filename, apr_pool_t *pool) diff --git a/shmem/os2/shm.c b/shmem/os2/shm.c index 81de941c20e..b6ef7811aea 100644 --- a/shmem/os2/shm.c +++ b/shmem/os2/shm.c @@ -77,6 +77,11 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, return APR_ENOTIMPL; } +APR_DECLARE(apr_status_t) apr_shm_delete(apr_shm_t *m) +{ + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, const char *filename, apr_pool_t *pool) diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 91b620a75e1..f93efb5fc44 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -492,6 +492,16 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, #endif } +APR_DECLARE(apr_status_t) apr_shm_delete(apr_shm_t *m) +{ + if (m->filename) { + return apr_shm_remove(m->filename, m->pool); + } + else { + return APR_ENOTIMPL; + } +} + APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) { return apr_pool_cleanup_run(m->pool, m, shm_cleanup_owner); diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 28ce9406ba5..b01411ebd5e 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -261,6 +261,16 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, return apr_file_remove(filename, pool); } +APR_DECLARE(apr_status_t) apr_shm_delete(apr_shm_t *m) +{ + if (m->filename) { + return apr_shm_remove(m->filename, m->pool); + } + else { + return APR_ENOTIMPL; + } +} + static apr_status_t shm_attach_internal(apr_shm_t **m, const char *file, apr_pool_t *pool, diff --git a/test/testshm.c b/test/testshm.c index bbaf6250445..73870690631 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -268,6 +268,46 @@ static void test_named_remove(abts_case *tc, void *data) ABTS_TRUE(tc, rv != 0); } +static void test_named_delete(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_shm_t *shm, *shm2; + + apr_shm_remove(SHARED_FILENAME, p); + + rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); + if (rv != APR_SUCCESS) { + return; + } + ABTS_PTR_NOTNULL(tc, shm); + + rv = apr_shm_delete(shm); + + /* On platforms which acknowledge the removal of the shared resource, + * ensure another of the same name may be created after removal; + */ + if (rv == APR_SUCCESS) + { + rv = apr_shm_create(&shm2, SHARED_SIZE, SHARED_FILENAME, p); + APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); + if (rv != APR_SUCCESS) { + return; + } + ABTS_PTR_NOTNULL(tc, shm2); + + rv = apr_shm_destroy(shm2); + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); + } + + rv = apr_shm_destroy(shm); + APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); + + /* Now ensure no named resource remains which we may attach to */ + rv = apr_shm_attach(&shm, SHARED_FILENAME, p); + ABTS_TRUE(tc, rv != 0); +} + #endif abts_suite *testshm(abts_suite *suite) @@ -283,6 +323,7 @@ abts_suite *testshm(abts_suite *suite) #endif abts_run_test(suite, test_named, NULL); abts_run_test(suite, test_named_remove, NULL); + abts_run_test(suite, test_named_delete, NULL); #endif return suite; From 7a0dab6d49f18df957502012dba5e94b28307d02 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 28 Apr 2014 14:57:53 +0000 Subject: [PATCH 7425/7878] In 1.5/1.6 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1590663 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/CHANGES b/CHANGES index 7d17165d03d..ecd64657169 100644 --- a/CHANGES +++ b/CHANGES @@ -1,25 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) Add apr_shm_delete() to compliment apr_shm_remove(). - [Jim Jagielski] - - *) Add apr_escape_ldap() and apr_pescape_ldap(), escaping characters - as described by RFC4514 and RFC4515 respectively. [Graham Leggett] - *) Add apr_sockaddr_info_copy(), for making a deep copy of an apr_sockaddr_t into a specified pool. [Yann Ylavic ] - *) When using shmget-based shared memory, the ID used for ftok is - now an APR hash of the filename instead of the constant '1'. - We do this to help avoid collisions. PR 53996 [Jim Jagielski] - - *) Fix POSIX shared memory (shm_open) use for named shared memory. - Includes adding '--enable-posix-shm' to force POSIX shm if - available, and OSX compatibility. PR 55928. - [Jozef Hatala , Jim Jagielski] - *) Windows platform: Remove support for Windows 9x. *) Added signed apr_intptr_t. Changed ODBC dbd driver to use this. From d838e3b1fbde3e811b9345e970dc35e17b66fc58 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 9 May 2014 19:57:16 +0000 Subject: [PATCH 7426/7878] Add some missing error messages to apr_error_string git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1593611 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 75567c24657..f553a37b614 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -39,6 +39,8 @@ static char *stuffbuffer(char *buf, apr_size_t bufsize, const char *s) static char *apr_error_string(apr_status_t statcode) { switch (statcode) { + case APR_ENOSTAT: + return "Could not perform a stat on the file."; case APR_ENOPOOL: return "A new pool could not be created."; case APR_EBADDATE: @@ -73,7 +75,10 @@ static char *apr_error_string(apr_status_t statcode) return "The specified IP address is invalid."; case APR_EBADMASK: return "The specified network mask is invalid."; - + case APR_ESYMNOTFOUND: + return "Could not find the requested symbol."; + case APR_ENOTENOUGHENTROPY: + return "Not enough entropy to continue."; case APR_INCHILD: return "Your code just forked, and you are currently executing in the " @@ -128,10 +133,12 @@ static char *apr_error_string(apr_status_t statcode) return "The given path is misformatted or contained invalid characters"; case APR_EPATHWILD: return "The given path contained wildcard characters"; + case APR_EBUSY: + return "The given lock was busy."; case APR_EPROC_UNKNOWN: return "The process is not recognized."; case APR_EGENERAL: - return "Internal error"; + return "Internal error (specific information not available)"; default: return "Error string not specified yet"; } From db028c4754a9de20bbd0da99df13aee75b37472c Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 9 May 2014 20:14:01 +0000 Subject: [PATCH 7427/7878] Option to detect concurrent accesses to pools Enabled by new configure option --enable-pool-concurrency-check. Compared to pool-owner-debugging, this only detects cases where there is actual contention between accesses. The advantage is that runtime costs should be relatively low. The diagnostic messages could still use some improvement. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1593614 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++ configure.in | 8 ++++ memory/unix/apr_pools.c | 104 ++++++++++++++++++++++++++++++++++++++-- 3 files changed, 113 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index ecd64657169..efe4f28f2ae 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add new --enable-pool-concurrency-check configure option to detect + thread-unsafe concurrent accesses to pools. Runtime costs should be + relatively low. [Stefan Fritsch] + *) Add apr_sockaddr_info_copy(), for making a deep copy of an apr_sockaddr_t into a specified pool. [Yann Ylavic ] diff --git a/configure.in b/configure.in index bd86b30bfb6..e8fe8d21f5e 100644 --- a/configure.in +++ b/configure.in @@ -1492,6 +1492,14 @@ AC_ARG_ENABLE(allocator-uses-mmap, fi ] ) +AC_ARG_ENABLE(pool-concurrency-check, + [ --enable-pool-concurrency-check Check for concurrent usage of memory pools], + [ if test "$enableval" = "yes"; then + AC_DEFINE(APR_POOL_CONCURRENCY_CHECK, 1, + [Define if pool functions should abort if concurrent usage is detected]) + fi ] +) + dnl ----------------------------- Checks for standard typedefs AC_TYPE_OFF_T AC_TYPE_PID_T diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index b516187afc2..f12f27e9e5b 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -49,6 +49,11 @@ int apr_running_on_valgrind = 0; #endif +#if APR_POOL_CONCURRENCY_CHECK && !APR_HAS_THREADS +#error pool-concurrency-check does not make sense without threads +#endif + + /* * Magic numbers */ @@ -540,6 +545,10 @@ struct apr_pool_t { apr_os_proc_t owner_proc; #endif /* defined(NETWARE) */ cleanup_t *pre_cleanups; +#if APR_POOL_CONCURRENCY_CHECK + volatile apr_uint32_t in_use; + apr_os_thread_t in_use_by; +#endif /* APR_POOL_CONCURRENCY_CHECK */ }; #define SIZEOF_POOL_T APR_ALIGN_DEFAULT(sizeof(apr_pool_t)) @@ -672,6 +681,65 @@ APR_DECLARE(void) apr_pool_terminate(void) /* Returns the amount of free space in the given node. */ #define node_free_space(node_) ((apr_size_t)(node_->endp - node_->first_avail)) +/* + * Helpers to mark pool as in-use/free. Used for finding thread-unsafe + * concurrent accesses from different threads. + */ +#if APR_POOL_CONCURRENCY_CHECK +static void pool_concurrency_abort(apr_pool_t *pool, const char *func, apr_uint32_t old) +{ + fprintf(stderr, "%s: previous state %d in_use_by/cur %lx/%lx pool %p(%s)\n", + func, old, + (unsigned long)pool->in_use_by, + (unsigned long)apr_os_thread_current(), + pool, pool->tag); + abort(); +} + +static APR_INLINE void pool_concurrency_set_used(apr_pool_t *pool) +{ + apr_uint32_t old; + + old = apr_atomic_cas32(&pool->in_use, 1, 0); + + if (old == 2 && pool->in_use_by == apr_os_thread_current()) { + /* cleanups may use the pool */ + return; + } + + if (old != 0) + pool_concurrency_abort(pool, __func__, old); + + pool->in_use_by = apr_os_thread_current(); +} + +static APR_INLINE void pool_concurrency_set_idle(apr_pool_t *pool) +{ + apr_uint32_t old; + + old = apr_atomic_cas32(&pool->in_use, 0, 1); + + if (old != 1) + pool_concurrency_abort(pool, __func__, old); +} + +static APR_INLINE void pool_concurrency_init(apr_pool_t *pool) +{ + pool->in_use = 0; +} + +static APR_INLINE void pool_concurrency_set_destroyed(apr_pool_t *pool) +{ + apr_atomic_set32(&pool->in_use, 3); + pool->in_use_by = apr_os_thread_current(); +} +#else +static APR_INLINE void pool_concurrency_init(apr_pool_t *pool) { } +static APR_INLINE void pool_concurrency_set_used(apr_pool_t *pool) { } +static APR_INLINE void pool_concurrency_set_idle(apr_pool_t *pool) { } +static APR_INLINE void pool_concurrency_set_destroyed(apr_pool_t *pool) { } +#endif /* APR_POOL_CONCURRENCY_CHECK */ + /* * Memory allocation */ @@ -682,12 +750,14 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t in_size) void *mem; apr_size_t size, free_index; + pool_concurrency_set_used(pool); size = APR_ALIGN_DEFAULT(in_size); #if HAVE_VALGRIND if (apr_running_on_valgrind) size += 2 * REDZONE; #endif if (size < in_size) { + pool_concurrency_set_idle(pool); if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); @@ -708,6 +778,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t in_size) } else { if ((node = allocator_alloc(pool->allocator, size)) == NULL) { + pool_concurrency_set_idle(pool); if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); @@ -743,14 +814,17 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t in_size) have_mem: #if HAVE_VALGRIND if (!apr_running_on_valgrind) { + pool_concurrency_set_idle(pool); return mem; } else { mem = (char *)mem + REDZONE; VALGRIND_MEMPOOL_ALLOC(pool, mem, in_size); + pool_concurrency_set_idle(pool); return mem; } #else + pool_concurrency_set_idle(pool); return mem; #endif } @@ -786,7 +860,10 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) /* Run pre destroy cleanups */ run_cleanups(&pool->pre_cleanups); + + pool_concurrency_set_used(pool); pool->pre_cleanups = NULL; + pool_concurrency_set_idle(pool); /* Destroy the subpools. The subpools will detach themselves from * this pool thus this loop is safe and easy. @@ -796,6 +873,8 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) /* Run cleanups */ run_cleanups(&pool->cleanups); + + pool_concurrency_set_used(pool); pool->cleanups = NULL; pool->free_cleanups = NULL; @@ -814,13 +893,17 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) APR_IF_VALGRIND(VALGRIND_MEMPOOL_TRIM(pool, pool, 1)); - if (active->next == active) + if (active->next == active) { + pool_concurrency_set_idle(pool); return; + } *active->ref = NULL; allocator_free(pool->allocator, active->next); active->next = active; active->ref = &active->next; + + pool_concurrency_set_idle(pool); } APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) @@ -830,7 +913,10 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) /* Run pre destroy cleanups */ run_cleanups(&pool->pre_cleanups); + + pool_concurrency_set_used(pool); pool->pre_cleanups = NULL; + pool_concurrency_set_idle(pool); /* Destroy the subpools. The subpools will detach themselve from * this pool thus this loop is safe and easy. @@ -840,6 +926,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) /* Run cleanups */ run_cleanups(&pool->cleanups); + pool_concurrency_set_destroyed(pool); /* Free subprocesses */ free_proc_chain(pool->subprocesses); @@ -985,6 +1072,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, pool->ref = NULL; } + pool_concurrency_init(pool); + *newpool = pool; return APR_SUCCESS; @@ -1050,6 +1139,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, #endif /* defined(NETWARE) */ if (!allocator) pool_allocator->owner = pool; + + pool_concurrency_init(pool); *newpool = pool; return APR_SUCCESS; @@ -1195,6 +1286,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) apr_memnode_t *active, *node; apr_size_t free_index; + pool_concurrency_set_used(pool); ps.node = active = pool->active; ps.pool = pool; ps.vbuff.curpos = ps.node->first_avail; @@ -1257,8 +1349,10 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) /* * Link the node in if it's a new one */ - if (!ps.got_a_new_node) + if (!ps.got_a_new_node) { + pool_concurrency_set_idle(pool); return strp; + } active = pool->active; node = ps.node; @@ -1275,8 +1369,10 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) active->free_index = free_index; node = active->next; - if (free_index >= node->free_index) + if (free_index >= node->free_index) { + pool_concurrency_set_idle(pool); return strp; + } do { node = node->next; @@ -1286,9 +1382,11 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) list_remove(active); list_insert(active, node); + pool_concurrency_set_idle(pool); return strp; error: + pool_concurrency_set_idle(pool); if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); if (ps.got_a_new_node) { From 4fd3bd6ab6040d52da699118e88158bcd274d056 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 9 May 2014 20:29:25 +0000 Subject: [PATCH 7428/7878] Add option to use guard pages Add new --enable-allocator-guard-pages configure option which works like --enable-allocator-uses-mmap, but will also add inaccessible guard pages before and after each memnode. This will result in higher ressource usage but allow to find/protect against certain buffer overflow/overread bugs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1593615 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ configure.in | 15 ++++++++++++++- memory/unix/apr_pools.c | 32 +++++++++++++++++++++++++++++--- 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index efe4f28f2ae..b9f64b9b9da 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add new --enable-allocator-guard-pages which is like allocator-uses-mmap, + but will also add inaccessible guard pages before and after each memnode. + This will result in higher ressource usage but allow to find/protect + against certain buffer overflow/overread bugs. [Stefan Fritsch] + *) Add new --enable-pool-concurrency-check configure option to detect thread-unsafe concurrent accesses to pools. Runtime costs should be relatively low. [Stefan Fritsch] diff --git a/configure.in b/configure.in index e8fe8d21f5e..d6831aa04c6 100644 --- a/configure.in +++ b/configure.in @@ -1032,7 +1032,7 @@ esac AC_CHECK_HEADERS([sys/types.h sys/mman.h sys/ipc.h sys/mutex.h sys/shm.h sys/file.h kernel/OS.h os2.h windows.h]) AC_CHECK_FUNCS([mmap munmap shm_open shm_unlink shmget shmat shmdt shmctl \ - create_area]) + create_area mprotect]) APR_CHECK_DEFINE(MAP_ANON, sys/mman.h) AC_CHECK_FILE(/dev/zero) @@ -1492,6 +1492,19 @@ AC_ARG_ENABLE(allocator-uses-mmap, fi ] ) +AC_ARG_ENABLE(allocator-guard-pages, + [ --enable-allocator-guard-pages Use guard pages in apr_allocator + (implies --enable-allocator-uses-mmap) ] , + [ if test "$enableval" = "yes"; then + APR_IFALLYES(header:sys/mman.h func:mmap func:munmap func:mprotect define:MAP_ANON, + [AC_DEFINE(APR_ALLOCATOR_GUARD_PAGES, 1, + [Define if apr_allocator should use guard pages]) ], + [AC_MSG_ERROR([mmap()/MAP_ANON/mprotect() not supported]) ] + ) + fi ] +) + + AC_ARG_ENABLE(pool-concurrency-check, [ --enable-pool-concurrency-check Check for concurrent usage of memory pools], [ if test "$enableval" = "yes"; then diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index f12f27e9e5b..fdfe4af6f7b 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -40,6 +40,10 @@ #include /* for getpid and sysconf */ #endif +#if APR_ALLOCATOR_GUARD_PAGES && !APR_ALLOCATOR_USES_MMAP +#define APR_ALLOCATOR_USES_MMAP 1 +#endif + #if APR_ALLOCATOR_USES_MMAP #include #endif @@ -76,6 +80,16 @@ static unsigned int boundary_size; #define BOUNDARY_SIZE (1 << BOUNDARY_INDEX) #endif +#if APR_ALLOCATOR_GUARD_PAGES +#if defined(_SC_PAGESIZE) +#define GUARDPAGE_SIZE boundary_size +#else +#error Cannot determine page size +#endif /* _SC_PAGESIZE */ +#else +#define GUARDPAGE_SIZE 0 +#endif /* APR_ALLOCATOR_GUARD_PAGES */ + /* * Timing constants for killing subprocesses * There is a total 3-second delay between sending a SIGINT @@ -158,7 +172,8 @@ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) while ((node = *ref) != NULL) { *ref = node->next; #if APR_ALLOCATOR_USES_MMAP - munmap(node, (node->index+1) << BOUNDARY_INDEX); + munmap((char *)node - GUARDPAGE_SIZE, + 2 * GUARDPAGE_SIZE + ((node->index+1) << BOUNDARY_INDEX)); #else free(node); #endif @@ -347,7 +362,10 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) /* If we haven't got a suitable node, malloc a new one * and initialize it. */ -#if APR_ALLOCATOR_USES_MMAP +#if APR_ALLOCATOR_GUARD_PAGES + if ((node = mmap(NULL, size + 2 * GUARDPAGE_SIZE, PROT_NONE, + MAP_PRIVATE|MAP_ANON, -1, 0)) == MAP_FAILED) +#elif APR_ALLOCATOR_USES_MMAP if ((node = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0)) == MAP_FAILED) #else @@ -355,6 +373,13 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) #endif return NULL; +#if APR_ALLOCATOR_GUARD_PAGES + node = (apr_memnode_t *)((char *)node + GUARDPAGE_SIZE); + if (mprotect(node, size, PROT_READ|PROT_WRITE) != 0) { + munmap((char *)node - GUARDPAGE_SIZE, size + 2 * GUARDPAGE_SIZE); + return NULL; + } +#endif node->index = index; node->endp = (char *)node + size; @@ -437,7 +462,8 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) node = freelist; freelist = node->next; #if APR_ALLOCATOR_USES_MMAP - munmap(node, (node->index+1) << BOUNDARY_INDEX); + munmap((char *)node - GUARDPAGE_SIZE, + 2 * GUARDPAGE_SIZE + ((node->index+1) << BOUNDARY_INDEX)); #else free(node); #endif From d0eb64e198ddc0cf61ea181f7b0c1a2dbbd3dd4b Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 10 May 2014 10:27:29 +0000 Subject: [PATCH 7429/7878] Fix NULL pointer dereference if out of mem in strdup() fallback function PR: 56385 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1593680 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_cpystrn.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index d222d081429..fb96025a00a 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -235,6 +235,8 @@ char *strdup(const char *str) size_t len = strlen(str) + 1; sdup = (char *) malloc(len); + if (sdup == NULL) + return NULL; memcpy(sdup, str, len); return sdup; From ac93f9223085b6828a0a24d26b5239cceb8fb0c2 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Wed, 14 May 2014 19:30:46 +0000 Subject: [PATCH 7430/7878] fix comment typos s/appropiate/appropriate/ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1594684 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 +- memory/unix/apr_pools.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index b322d49671a..78dbedf27bd 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -1305,7 +1305,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH) /** network is unreachable */ #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH) -/** inappropiate file type or format */ +/** inappropriate file type or format */ #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) /** broken pipe */ #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index fdfe4af6f7b..cd4ae112d9d 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -424,8 +424,8 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) freelist = node; } else if (index < MAX_INDEX) { - /* Add the node to the appropiate 'size' bucket. Adjust - * the max_index when appropiate. + /* Add the node to the appropriate 'size' bucket. Adjust + * the max_index when appropriate. */ if ((node->next = allocator->free[index]) == NULL && index > max_index) { From 9fb60c0cbec959298f0b41de3d327cd957496af9 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Wed, 14 May 2014 20:44:02 +0000 Subject: [PATCH 7431/7878] Add a pointer to /proc/sys/vm/max_map_count for the guard page feature git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1594708 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index b9f64b9b9da..37940457c0b 100644 --- a/CHANGES +++ b/CHANGES @@ -4,7 +4,8 @@ Changes for APR 2.0.0 *) Add new --enable-allocator-guard-pages which is like allocator-uses-mmap, but will also add inaccessible guard pages before and after each memnode. This will result in higher ressource usage but allow to find/protect - against certain buffer overflow/overread bugs. [Stefan Fritsch] + against certain buffer overflow/overread bugs. Under Linux, it may be + necessary to increase /proc/sys/vm/max_map_count . [Stefan Fritsch] *) Add new --enable-pool-concurrency-check configure option to detect thread-unsafe concurrent accesses to pools. Runtime costs should be From c3691b7308922f2a6803e51e4daeb0d3f7e03a61 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Wed, 14 May 2014 21:27:47 +0000 Subject: [PATCH 7432/7878] Remove some items that have been merged into 1.6 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1594727 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/CHANGES b/CHANGES index 37940457c0b..51ad084190d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,20 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) Add new --enable-allocator-guard-pages which is like allocator-uses-mmap, - but will also add inaccessible guard pages before and after each memnode. - This will result in higher ressource usage but allow to find/protect - against certain buffer overflow/overread bugs. Under Linux, it may be - necessary to increase /proc/sys/vm/max_map_count . [Stefan Fritsch] - - *) Add new --enable-pool-concurrency-check configure option to detect - thread-unsafe concurrent accesses to pools. Runtime costs should be - relatively low. [Stefan Fritsch] - - *) Add apr_sockaddr_info_copy(), for making a deep copy of an - apr_sockaddr_t into a specified pool. [Yann Ylavic - ] - *) Windows platform: Remove support for Windows 9x. *) Added signed apr_intptr_t. Changed ODBC dbd driver to use this. @@ -60,10 +46,6 @@ Changes for APR 2.0.0 *) Added Unix domain socket support. [Mladen Turk] - *) Introduce APR_PERMS_SET macros for setting the owner/group on objects - Currently only implemented for shm, proc and global mutexes on posix - platforms. [Mladen Turk] - *) Merge APR-util into APR. [various] Changes for APR and APR-util 1.6.x and later: From 8c59195da6c09739e5c6af6757e75dd5734b59f6 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Wed, 14 May 2014 21:30:48 +0000 Subject: [PATCH 7433/7878] Don't waste memory when creating or allocating from small, long-lived APR pools after clearing or destroying pools that allocated larger nodes. When allocating nodes from the bucket allocator (<= 80k or 20 pages), we would eagerly reuse *any* free node that is at least the minimum size. Depending on the pool usage scheme, that extra memory would never be used. This patch limits the node to approximate twice the minimum. * memory/unix/apr_pools.c (allocator_alloc): When searching the buckets for free nodes, limit the range to twice the starting index. Submitted by: Stefan Fuhrmann git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1594729 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ memory/unix/apr_pools.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 51ad084190d..82033a39956 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_allocator: Be less wasteful and don't return a memnode that is + much larger than what was requested. [Stefan Fuhrmann + ] + *) Windows platform: Remove support for Windows 9x. *) Added signed apr_intptr_t. Changed ODBC dbd driver to use this. diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index cd4ae112d9d..da33c78da31 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -239,7 +239,7 @@ static APR_INLINE apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) { apr_memnode_t *node, **ref; - apr_uint32_t max_index; + apr_uint32_t max_index, upper_index; apr_size_t size, i, index; /* Round up the block size to the next boundary, but always @@ -273,6 +273,11 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) /* Walk the free list to see if there are * any nodes on it of the requested size * + * If there is no exact match, look for nodes + * of up to twice the requested size, so we + * won't unnecessarily allocate more memory + * nor waste too much of what we have. + * * NOTE: an optimization would be to check * allocator->free[index] first and if no * node is present, directly use @@ -281,9 +286,10 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) * memory waste. */ max_index = allocator->max_index; + upper_index = 2 * index < max_index ? 2 * index : max_index; ref = &allocator->free[index]; i = index; - while (*ref == NULL && i < max_index) { + while (*ref == NULL && i < upper_index) { ref++; i++; } From d2af17ca6ae76d88c38b37633ce65e85f9e1694a Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 17 May 2014 22:08:46 +0000 Subject: [PATCH 7434/7878] Some improvements to the pool concurrency check code * use defined constants for in_use * don't use C99's __func__ * improve abort message * fix some confusion wrt the destroyed state git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1595549 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 45 ++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index da33c78da31..8c1b2a48e05 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -578,6 +578,10 @@ struct apr_pool_t { #endif /* defined(NETWARE) */ cleanup_t *pre_cleanups; #if APR_POOL_CONCURRENCY_CHECK + +#define IDLE 0 +#define IN_USE 1 +#define DESTROYED 2 volatile apr_uint32_t in_use; apr_os_thread_t in_use_by; #endif /* APR_POOL_CONCURRENCY_CHECK */ @@ -718,13 +722,16 @@ APR_DECLARE(void) apr_pool_terminate(void) * concurrent accesses from different threads. */ #if APR_POOL_CONCURRENCY_CHECK -static void pool_concurrency_abort(apr_pool_t *pool, const char *func, apr_uint32_t old) + +static const char * const in_use_string[] = { "idle", "in use", "destroyed" }; + +static void pool_concurrency_abort(apr_pool_t *pool, apr_uint32_t new, apr_uint32_t old) { - fprintf(stderr, "%s: previous state %d in_use_by/cur %lx/%lx pool %p(%s)\n", - func, old, - (unsigned long)pool->in_use_by, - (unsigned long)apr_os_thread_current(), - pool, pool->tag); + fprintf(stderr, "pool concurrency check: pool %p(%s), thread cur %lx " + "in use by %lx, state %s -> %s \n", + pool, pool->tag, (unsigned long)apr_os_thread_current(), + (unsigned long)pool->in_use_by, + in_use_string[old], in_use_string[new]); abort(); } @@ -732,15 +739,10 @@ static APR_INLINE void pool_concurrency_set_used(apr_pool_t *pool) { apr_uint32_t old; - old = apr_atomic_cas32(&pool->in_use, 1, 0); + old = apr_atomic_cas32(&pool->in_use, IN_USE, IDLE); - if (old == 2 && pool->in_use_by == apr_os_thread_current()) { - /* cleanups may use the pool */ - return; - } - - if (old != 0) - pool_concurrency_abort(pool, __func__, old); + if (old != IDLE) + pool_concurrency_abort(pool, IN_USE, old); pool->in_use_by = apr_os_thread_current(); } @@ -749,20 +751,25 @@ static APR_INLINE void pool_concurrency_set_idle(apr_pool_t *pool) { apr_uint32_t old; - old = apr_atomic_cas32(&pool->in_use, 0, 1); + old = apr_atomic_cas32(&pool->in_use, IDLE, IN_USE); - if (old != 1) - pool_concurrency_abort(pool, __func__, old); + if (old != IN_USE) + pool_concurrency_abort(pool, IDLE, old); } static APR_INLINE void pool_concurrency_init(apr_pool_t *pool) { - pool->in_use = 0; + pool->in_use = IDLE; } static APR_INLINE void pool_concurrency_set_destroyed(apr_pool_t *pool) { - apr_atomic_set32(&pool->in_use, 3); + apr_uint32_t old; + + old = apr_atomic_cas32(&pool->in_use, DESTROYED, IDLE); + + if (old != IDLE) + pool_concurrency_abort(pool, DESTROYED, old); pool->in_use_by = apr_os_thread_current(); } #else From 72265a1abd98a9d0f9a570d29ef62a17d5273d21 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 27 May 2014 14:20:29 +0000 Subject: [PATCH 7435/7878] apr_skiplist_add()... idea from yann git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1597797 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ include/apr_skiplist.h | 13 ++++++++++++- tables/apr_skiplist.c | 44 ++++++++++++++++++++++++++++++------------ 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index 82033a39956..9defd959add 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_skiplist: Add apr_skiplist_add() to support multiple values. + *) apr_allocator: Be less wasteful and don't return a memnode that is much larger than what was requested. [Stefan Fuhrmann ] diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h index bc17efd95fa..e93814c83ea 100644 --- a/include/apr_skiplist.h +++ b/include/apr_skiplist.h @@ -179,12 +179,23 @@ APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **i APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, void *data, apr_skiplist_compare comp); +/** + * Add an element into the skip list using the existing comparison function. + * @param sl The skip list + * @param data The element to insert + * @remark If no comparison function has been set for the skip list, the element + * will not be inserted and NULL will be returned. This allows for multiple + * values to be added to the skiplist. To replace values, use apr_skiplist_insert(). + */ +APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist* sl, void *data); + /** * Insert an element into the skip list using the existing comparison function. * @param sl The skip list * @param data The element to insert * @remark If no comparison function has been set for the skip list, the element - * will not be inserted and NULL will be returned. + * will not be inserted and NULL will be returned. Previous values will + * be over-written. Use apr_skiplist_add() to allow multiple values. */ APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist* sl, void *data); diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index effcf603b5f..a638a698a72 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -339,16 +339,8 @@ APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **i return (*iter) ? ((*iter)->data) : NULL; } -APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist *sl, void *data) -{ - if (!sl->compare) { - return 0; - } - return apr_skiplist_insert_compare(sl, data, sl->compare); -} - -APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, void *data, - apr_skiplist_compare comp) +static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, + apr_skiplist_compare comp, int replace) { apr_skiplistnode *m, *p, *tmp, *ret = NULL, **stack; int nh = 1, ch, stacki; @@ -406,11 +398,11 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, vo if (m->next) { compared = comp(data, m->next->data); } - if (compared == 0) { + if (compared == 0 && replace) { free(stack); /* OK. was malloc'ed */ return 0; } - if ((m->next == NULL) || (compared < 0)) { + if ( (compared < 0) || (replace && (m->next == NULL)) ) { if (ch <= nh) { /* push on stack */ stack[stacki++] = m; @@ -470,6 +462,34 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, vo return ret; } +APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist *sl, void *data) +{ + if (!sl->compare) { + return 0; + } + return insert_compare(sl, data, sl->compare, 1); +} + +APR_DECLARE(apr_skiplistnode *) apr_skiplist_add_compare(apr_skiplist *sl, void *data, + apr_skiplist_compare comp) +{ + return insert_compare(sl, data, comp, 0); +} + +APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist *sl, void *data) +{ + if (!sl->compare) { + return 0; + } + return insert_compare(sl, data, sl->compare, 0); +} + +APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, void *data, + apr_skiplist_compare comp) +{ + return insert_compare(sl, data, comp, 1); +} + APR_DECLARE(int) apr_skiplist_remove(apr_skiplist *sl, void *data, apr_skiplist_freefunc myfree) { if (!sl->compare) { From 1e4968214a701cf3caab4913ba015807c3cede76 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 27 May 2014 15:14:44 +0000 Subject: [PATCH 7436/7878] update docco git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1597803 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_skiplist.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h index e93814c83ea..e4a573f365a 100644 --- a/include/apr_skiplist.h +++ b/include/apr_skiplist.h @@ -185,7 +185,7 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, * @param data The element to insert * @remark If no comparison function has been set for the skip list, the element * will not be inserted and NULL will be returned. This allows for multiple - * values to be added to the skiplist. To replace values, use apr_skiplist_insert(). + * values to be added to the skiplist. To retain value, use apr_skiplist_insert(). */ APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist* sl, void *data); @@ -195,7 +195,7 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist* sl, void *data); * @param data The element to insert * @remark If no comparison function has been set for the skip list, the element * will not be inserted and NULL will be returned. Previous values will - * be over-written. Use apr_skiplist_add() to allow multiple values. + * be not be over-written. Use apr_skiplist_add() to allow multiple values. */ APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist* sl, void *data); From e05730aa83f706aab525a65e52fd1b0b62448cbb Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sun, 22 Jun 2014 14:28:09 +0000 Subject: [PATCH 7437/7878] correct doc for apr_skiplist_pop -- "leaving the element in the skip list." text inadvertently copied from apr_skiplist_peek(). Submitted By: Takashi Sato Committed By: covener git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1604590 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_skiplist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h index e4a573f365a..71349b94f4d 100644 --- a/include/apr_skiplist.h +++ b/include/apr_skiplist.h @@ -240,7 +240,7 @@ APR_DECLARE(void) apr_skiplist_remove_all(apr_skiplist *sl, apr_skiplist_freefun APR_DECLARE(void) apr_skiplist_destroy(apr_skiplist *sl, apr_skiplist_freefunc myfree); /** - * Return the first element in the skip list, leaving the element in the skip list. + * Return the first element in the skip list, removing the element from the skip list. * @param sl The skip list * @param myfree A function to be called for the removed element * @remark NULL will be returned if there are no elements From a33a5f640ecb1ba84cb87321446156b6818f239b Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sun, 22 Jun 2014 14:56:29 +0000 Subject: [PATCH 7438/7878] Add a basic skiplist test. Based on test program posted to PR 56654 by Takashi Sato. Submitted By: Takashi Sato, covener Committed By: covener git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1604596 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- test/abts_tests.h | 3 +- test/testskiplist.c | 100 ++++++++++++++++++++++++++++++++++++++++++++ test/testutil.h | 1 + 4 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 test/testskiplist.c diff --git a/test/Makefile.in b/test/Makefile.in index 0c5aadd5d15..57df29bd5b9 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -36,7 +36,7 @@ TESTS = testtime.lo teststr.lo testvsn.lo testipsub.lo testshm.lo \ teststrmatch.lo testpass.lo testcrypto.lo testqueue.lo \ testbuckets.lo testxml.lo testdbm.lo testuuid.lo testmd5.lo \ testreslist.lo testbase64.lo testhooks.lo testlfsabi.lo \ - testlfsabi32.lo testlfsabi64.lo testescape.lo + testlfsabi32.lo testlfsabi64.lo testescape.lo testtable.lo OTHER_PROGRAMS = \ echod@EXEEXT@ \ diff --git a/test/abts_tests.h b/test/abts_tests.h index 88a4a925c72..b7cc8ef16ea 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -87,7 +87,8 @@ const struct testlist { {testdbm}, {testqueue}, {testreslist}, - {testlfsabi} + {testlfsabi}, + {testskiplist} }; #endif /* APR_TEST_INCLUDES */ diff --git a/test/testskiplist.c b/test/testskiplist.c new file mode 100644 index 00000000000..95f0a7d961b --- /dev/null +++ b/test/testskiplist.c @@ -0,0 +1,100 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "testutil.h" +#include "apr.h" +#include "apr_strings.h" +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_skiplist.h" +#if APR_HAVE_STDIO_H +#include +#endif +#if APR_HAVE_STDLIB_H +#include +#endif +#if APR_HAVE_STRING_H +#include +#endif + +static void add_int_to_skiplist(apr_skiplist *list, int n){ + int* a = apr_skiplist_alloc(list, sizeof(int)); + *a = n; + apr_skiplist_insert(list, a); +} + +static int comp(void *a, void *b){ + return *((int*) a) - *((int*) b); +} + + +static int compk(void *a, void *b){ + return comp(a, b); +} + +static void skiplist_test(abts_case *tc, void *data) { + int test_elems = 10; + int i = 0, j = 0; + int *val = NULL; + apr_skiplist * list = NULL; + apr_pool_t *p; + + apr_pool_create(&p, NULL); + apr_skiplist_init(&list, p); + apr_skiplist_set_compare(list, comp, compk); + + /* insert 10 objects */ + for (i = 0; i < test_elems; ++i){ + add_int_to_skiplist(list, i); + } + + /* remove all objects */ + while (val = apr_skiplist_pop(list, NULL)){ + ABTS_INT_EQUAL(tc, *val, j++); + } + + /* insert 10 objects again */ + for (i = test_elems; i < test_elems+test_elems; ++i){ + add_int_to_skiplist(list, i); + } + + j = test_elems; + while (val = apr_skiplist_pop(list, NULL)){ + ABTS_INT_EQUAL(tc, *val, j++); + } + + /* empty */ + val = apr_skiplist_pop(list, NULL); + ABTS_PTR_EQUAL(tc, val, NULL); + + add_int_to_skiplist(list, 42); + val = apr_skiplist_pop(list, NULL); + ABTS_INT_EQUAL(tc, *val, 42); + + /* empty */ + val = apr_skiplist_pop(list, NULL); + ABTS_PTR_EQUAL(tc, val, NULL); +} + +abts_suite *testskiplist(abts_suite *suite) +{ + suite = ADD_SUITE(suite) + + abts_run_test(suite, skiplist_test, NULL); + + return suite; +} + diff --git a/test/testutil.h b/test/testutil.h index 286d253bd90..02e3f243c68 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -130,5 +130,6 @@ abts_suite *testxlate(abts_suite *suite); abts_suite *testrmm(abts_suite *suite); abts_suite *testdbm(abts_suite *suite); abts_suite *testlfsabi(abts_suite *suite); +abts_suite *testskiplist(abts_suite *suite); #endif /* APR_TEST_INCLUDES */ From ee2ca30b36117c09cad331791a9c78d1b77d70bc Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sun, 22 Jun 2014 15:00:57 +0000 Subject: [PATCH 7439/7878] typo in r1604596 that wasn't in my hand-modified Makefile git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1604597 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index 57df29bd5b9..7edb62e50a9 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -36,7 +36,7 @@ TESTS = testtime.lo teststr.lo testvsn.lo testipsub.lo testshm.lo \ teststrmatch.lo testpass.lo testcrypto.lo testqueue.lo \ testbuckets.lo testxml.lo testdbm.lo testuuid.lo testmd5.lo \ testreslist.lo testbase64.lo testhooks.lo testlfsabi.lo \ - testlfsabi32.lo testlfsabi64.lo testescape.lo testtable.lo + testlfsabi32.lo testlfsabi64.lo testescape.lo testskiplist.lo OTHER_PROGRAMS = \ echod@EXEEXT@ \ From 283647e7a02041f3ccbbed0d9b90d669df1be5c4 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sun, 22 Jun 2014 15:10:20 +0000 Subject: [PATCH 7440/7878] apr_skiplist becomes corrupt when nodes are reused. Submitted By: Takashi Sato , covener committed By: covener git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1604598 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ tables/apr_skiplist.c | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 9defd959add..700cff5e03a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_skiplist: Fix potential corruption of skiplists leading to + results or crashes. [Takashi Sato , Eric Covener] + PR 56654. + *) apr_skiplist: Add apr_skiplist_add() to support multiple values. *) apr_allocator: Be less wasteful and don't return a memnode that is diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index a638a698a72..12205440ff6 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -379,11 +379,9 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode)); sl->top->up->down = sl->top; sl->top = sl->topend = sl->top->up; -#if 0 sl->top->prev = sl->top->next = sl->top->nextindex = sl->top->previndex = sl->top->up = NULL; sl->top->data = NULL; -#endif sl->top->sl = sl; } ch = sl->height; From ba69c10dda67e739b8fbd1ee7166252df43ea2de Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 24 Jun 2014 15:05:26 +0000 Subject: [PATCH 7441/7878] missing proto git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1605104 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_skiplist.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h index 71349b94f4d..1f85087272a 100644 --- a/include/apr_skiplist.h +++ b/include/apr_skiplist.h @@ -179,6 +179,15 @@ APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **i APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, void *data, apr_skiplist_compare comp); +/** + * Add an element into the skip list using the specified comparison function. + * @param sl The skip list + * @param data The element to add + * @param comp The comparison function to use for placement into the skip list + */ +APR_DECLARE(apr_skiplistnode *) apr_skiplist_add_compare(apr_skiplist *sl, + void *data, apr_skiplist_compare comp); + /** * Add an element into the skip list using the existing comparison function. * @param sl The skip list From 9128ecb6ca9ec9bc187c12c433a2fe739b7b19da Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Thu, 26 Jun 2014 12:45:03 +0000 Subject: [PATCH 7442/7878] missing word git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1605767 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 700cff5e03a..33b22de61f4 100644 --- a/CHANGES +++ b/CHANGES @@ -2,8 +2,8 @@ Changes for APR 2.0.0 *) apr_skiplist: Fix potential corruption of skiplists leading to - results or crashes. [Takashi Sato , Eric Covener] - PR 56654. + unexpected results or crashes. + [Takashi Sato , Eric Covener] PR 56654. *) apr_skiplist: Add apr_skiplist_add() to support multiple values. From 053abb6e7bc923e036176d13122f8d436213ae61 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Wed, 9 Jul 2014 00:51:46 +0000 Subject: [PATCH 7443/7878] Fix the documentation for APR_FNM_PERIOD in include/apr_fnmatch.h. Submitted by: breser git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1608974 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_fnmatch.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index e8f6b03cfbc..f8c26cf3e1b 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -59,7 +59,7 @@ extern "C" { #define APR_FNM_NOESCAPE 0x01 /**< Disable backslash escaping. */ #define APR_FNM_PATHNAME 0x02 /**< Slash must be matched by slash. */ -#define APR_FNM_PERIOD 0x04 /**< Period must be matched by period. */ +#define APR_FNM_PERIOD 0x04 /**< Leading period must be matched by period. */ #define APR_FNM_CASE_BLIND 0x08 /**< Compare characters case-insensitively. */ /** @@ -112,7 +112,7 @@ extern "C" { *
      *              APR_FNM_NOESCAPE       Disable backslash escaping
      *              APR_FNM_PATHNAME       Slash must be matched by slash
    - *              APR_FNM_PERIOD         Period must be matched by period
    + *              APR_FNM_PERIOD         Leading period must be matched by period
      *              APR_FNM_CASE_BLIND     Compare characters case-insensitively.
      * 
    */ From 3c319dc8912d10390dae3bdbe021adb2a7eab54c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 15 Jul 2014 21:27:27 +0000 Subject: [PATCH 7444/7878] Resolve failures with the POSIX sem implementation of APR process mutexes (and thus global mutexes) in environments which receive signals. EINTR is now handled on the sem_* calls that are documented as exposing EINTR in the Linux, FreeBSD, and/or Solaris docs. There are a few other calls that haven't been updated: sem_unlink(), sem_post(), and sem_close(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1610854 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index f229b19b174..4105ff3ef53 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -115,7 +115,9 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, usec = apr_time_usec(now); apr_snprintf(semname, sizeof(semname), "/ApR.%lxZ%lx", sec, usec); } - psem = sem_open(semname, O_CREAT | O_EXCL, 0644, 1); + do { + psem = sem_open(semname, O_CREAT | O_EXCL, 0644, 1); + } while (psem == (sem_t *)SEM_FAILED && errno == EINTR); if (psem == (sem_t *)SEM_FAILED) { if (errno == ENAMETOOLONG) { /* Oh well, good try */ @@ -123,7 +125,9 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, } else { return errno; } - psem = sem_open(semname, O_CREAT | O_EXCL, 0644, 1); + do { + psem = sem_open(semname, O_CREAT | O_EXCL, 0644, 1); + } while (psem == (sem_t *)SEM_FAILED && errno == EINTR); } if (psem == (sem_t *)SEM_FAILED) { @@ -141,7 +145,12 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, static apr_status_t proc_mutex_posix_acquire(apr_proc_mutex_t *mutex) { - if (sem_wait(mutex->psem_interproc) < 0) { + int rc; + + do { + rc = sem_wait(mutex->psem_interproc); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { return errno; } mutex->curr_locked = 1; @@ -150,7 +159,12 @@ static apr_status_t proc_mutex_posix_acquire(apr_proc_mutex_t *mutex) static apr_status_t proc_mutex_posix_tryacquire(apr_proc_mutex_t *mutex) { - if (sem_trywait(mutex->psem_interproc) < 0) { + int rc; + + do { + rc = sem_trywait(mutex->psem_interproc); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { if (errno == EAGAIN) { return APR_EBUSY; } From 03a56e8b2e44943bd6e383a805b8d6fa267d173a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 16 Jul 2014 13:32:42 +0000 Subject: [PATCH 7445/7878] Merge forward r1610988 from 1.6.x branch: Fix gcc -Wparentheses warnings git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611004 13f79535-47bb-0310-9956-ffa450edef68 --- test/testskiplist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testskiplist.c b/test/testskiplist.c index 95f0a7d961b..8d25c45545d 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -62,7 +62,7 @@ static void skiplist_test(abts_case *tc, void *data) { } /* remove all objects */ - while (val = apr_skiplist_pop(list, NULL)){ + while ((val = apr_skiplist_pop(list, NULL))){ ABTS_INT_EQUAL(tc, *val, j++); } @@ -72,7 +72,7 @@ static void skiplist_test(abts_case *tc, void *data) { } j = test_elems; - while (val = apr_skiplist_pop(list, NULL)){ + while ((val = apr_skiplist_pop(list, NULL))){ ABTS_INT_EQUAL(tc, *val, j++); } From c2ef23255976fe92f44cb3e49267b1e8505c9747 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 16 Jul 2014 14:32:05 +0000 Subject: [PATCH 7446/7878] Three fixes: - double size increment in insert_compare(), - multiple apr_skiplist_free() called on the same value in remove_compare(), - return 0 instead of NULL for void*. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611023 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 12205440ff6..42ef396c23f 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -261,7 +261,7 @@ APR_DECLARE(void *) apr_skiplist_find(apr_skiplist *sl, void *data, apr_skiplist void *ret; apr_skiplistnode *aiter; if (!sl->compare) { - return 0; + return NULL; } if (iter) { ret = apr_skiplist_find_compare(sl, data, iter, sl->compare); @@ -398,7 +398,7 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, } if (compared == 0 && replace) { free(stack); /* OK. was malloc'ed */ - return 0; + return NULL; } if ( (compared < 0) || (replace && (m->next == NULL)) ) { if (ch <= nh) { @@ -434,7 +434,6 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, /* This sets ret to the bottom-most node we are inserting */ if (!p) { ret = tmp; - sl->size++; /* this seems to go here got each element to be counted */ } p = tmp; } @@ -453,9 +452,6 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, li = ni; } } - else { - /* sl->size++; */ - } sl->size++; return ret; } @@ -463,7 +459,7 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist *sl, void *data) { if (!sl->compare) { - return 0; + return NULL; } return insert_compare(sl, data, sl->compare, 1); } @@ -477,7 +473,7 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_add_compare(apr_skiplist *sl, void APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist *sl, void *data) { if (!sl->compare) { - return 0; + return NULL; } return insert_compare(sl, data, sl->compare, 0); } @@ -595,12 +591,13 @@ APR_DECLARE(void) apr_skiplist_remove_all(apr_skiplist *sl, apr_skiplist_freefun myfree(p->data); while (m) { u = m->up; - apr_skiplist_free(sl, p); + apr_skiplist_free(sl, m); m = u; } m = p; } sl->top = sl->bottom = NULL; + sl->topend = sl->bottomend = NULL; sl->height = 0; sl->size = 0; } From cc3b217f8e2849548866de05cad493e89ccb1f32 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 16 Jul 2014 15:23:37 +0000 Subject: [PATCH 7447/7878] Fixed type; fixed comments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611046 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/thread.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index 5e3d99d556e..a34bada9b1a 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -82,7 +82,7 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_pool_t *pool) { apr_status_t stat; - long flags = NX_THR_BIND_CONTEXT; + unsigned long flags = NX_THR_BIND_CONTEXT; char threadName[NX_MAX_OBJECT_NAME_LEN+1]; size_t stack_size = APR_DEFAULT_STACK_SIZE; @@ -125,8 +125,8 @@ apr_status_t apr_thread_create(apr_thread_t **new, /* void(*start_routine)(void *arg)*/(void (*)(void *)) dummy_worker, /* void *arg */ (*new), /* int priority */ NX_PRIO_MED, - /* NXSize_t stackSize */ stack_size, - /* long flags */ NX_CTX_NORMAL, + /* size_t stackSize */ stack_size, + /* unsigned long flags */ NX_CTX_NORMAL, /* int *error */ &stat); @@ -136,7 +136,7 @@ apr_status_t apr_thread_create(apr_thread_t **new, stat = NXThreadCreate( /* NXContext_t context */ (*new)->ctx, - /* long flags */ flags, + /* unsigned long flags */ flags, /* NXThreadId_t *thread_id */ &(*new)->td); if (stat == 0) From fd9c033af5c5c987bf3369caa55cb1118fb5c6a4 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 16 Jul 2014 15:27:38 +0000 Subject: [PATCH 7448/7878] Fixed indent - no code change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611050 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/thread.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index a34bada9b1a..a37b107a02e 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -122,22 +122,21 @@ apr_status_t apr_thread_create(apr_thread_t **new, } (*new)->ctx = NXContextAlloc( - /* void(*start_routine)(void *arg)*/(void (*)(void *)) dummy_worker, - /* void *arg */ (*new), - /* int priority */ NX_PRIO_MED, - /* size_t stackSize */ stack_size, - /* unsigned long flags */ NX_CTX_NORMAL, - /* int *error */ &stat); - + /* void(*start_routine)(void *arg) */ (void (*)(void *)) dummy_worker, + /* void *arg */ (*new), + /* int priority */ NX_PRIO_MED, + /* size_t stackSize */ stack_size, + /* unsigned long flags */ NX_CTX_NORMAL, + /* int *error */ &stat); stat = NXContextSetName( - /* NXContext_t ctx */ (*new)->ctx, - /* const char *name */ threadName); + /* NXContext_t ctx */ (*new)->ctx, + /* const char *name */ threadName); stat = NXThreadCreate( - /* NXContext_t context */ (*new)->ctx, - /* unsigned long flags */ flags, - /* NXThreadId_t *thread_id */ &(*new)->td); + /* NXContext_t context */ (*new)->ctx, + /* unsigned long flags */ flags, + /* NXThreadId_t *thread_id */ &(*new)->td); if (stat == 0) return APR_SUCCESS; From ae1ee402dc3dd1ce1b74f6cc1827eac114e54cfe Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 16 Jul 2014 17:38:03 +0000 Subject: [PATCH 7449/7878] We do not garantee zero-ed memory for apr_skiplist_alloc(), neither in the description, nor in the code for reused chunks. So always allocate raw memory and don't rely on zero-ed one after internal calls to apr_skiplist_alloc(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611107 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 42ef396c23f..7fca4a42a96 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -52,10 +52,6 @@ struct apr_skiplistnode { apr_skiplist *sl; }; -#ifndef MIN -#define MIN(a,b) ((apool, size); + ptr = apr_palloc(sl->pool, size); if (!ptr) { return ptr; } @@ -122,7 +118,7 @@ APR_DECLARE(void *) apr_skiplist_alloc(apr_skiplist *sl, size_t size) return ptr; } else { - return calloc(1, size); + return malloc(size); } } @@ -348,15 +344,13 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, sl->height = 1; sl->topend = sl->bottomend = sl->top = sl->bottom = (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode)); -#if 0 - sl->top->next = (apr_skiplistnode *)NULL; - sl->top->data = (apr_skiplistnode *)NULL; - sl->top->prev = (apr_skiplistnode *)NULL; - sl->top->up = (apr_skiplistnode *)NULL; - sl->top->down = (apr_skiplistnode *)NULL; - sl->top->nextindex = (apr_skiplistnode *)NULL; - sl->top->previndex = (apr_skiplistnode *)NULL; -#endif + sl->top->next = NULL; + sl->top->data = NULL; + sl->top->prev = NULL; + sl->top->up = NULL; + sl->top->down = NULL; + sl->top->nextindex = NULL; + sl->top->previndex = NULL; sl->top->sl = sl; } if (sl->preheight) { From 8cd033a0286284d29dc4496a3daba4b34a4b5a01 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 16 Jul 2014 17:42:22 +0000 Subject: [PATCH 7450/7878] Improve skiplist tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611110 13f79535-47bb-0310-9956-ffa450edef68 --- test/testskiplist.c | 217 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 213 insertions(+), 4 deletions(-) diff --git a/test/testskiplist.c b/test/testskiplist.c index 8d25c45545d..1832284cbfe 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -30,6 +30,201 @@ #include #endif +static apr_pool_t *ptmp = NULL; +static apr_skiplist *skiplist = NULL; + +/* apr_skiplist_size() is missing in 1.5.x, wrap it */ +static int apr_skiplist_size(apr_skiplist *sl) +{ + int size = 0; + apr_skiplistnode *n; + for (n = apr_skiplist_getlist(sl); n; apr_skiplist_next(sl, &n)) { + ++size; + } + return size; +} + +static void skiplist_init(abts_case *tc, void *data) +{ + apr_time_t now = apr_time_now(); + srand((unsigned int)(((now >> 32) ^ now) & 0xffffffff)); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&skiplist, p)); + ABTS_PTR_NOTNULL(tc, skiplist); + apr_skiplist_set_compare(skiplist, (void*)strcmp, (void*)strcmp); +} + +static void skiplist_find(abts_case *tc, void *data) +{ + const char *val; + + apr_skiplist_insert(skiplist, "baton"); + val = apr_skiplist_find(skiplist, "baton", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "baton", val); +} + +static void skiplist_dontfind(abts_case *tc, void *data) +{ + const char *val; + + val = apr_skiplist_find(skiplist, "keynotthere", NULL); + ABTS_PTR_EQUAL(tc, NULL, (void *)val); +} + +static void skiplist_insert(abts_case *tc, void *data) +{ + const char *val; + int i; + + for (i = 0; i < 10; ++i) { + apr_skiplist_insert(skiplist, "baton"); + ABTS_INT_EQUAL(tc, 1, apr_skiplist_size(skiplist)); + val = apr_skiplist_find(skiplist, "baton", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "baton", val); + } + + apr_skiplist_insert(skiplist, "foo"); + ABTS_INT_EQUAL(tc, 2, apr_skiplist_size(skiplist)); + val = apr_skiplist_find(skiplist, "foo", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "foo", val); +} + +static void skiplist_add(abts_case *tc, void *data) +{ + const char *val; + size_t i, n = apr_skiplist_size(skiplist); + + for (i = 0; i < 100; ++i) { + n++; + apr_skiplist_add(skiplist, "daton"); + ABTS_INT_EQUAL(tc, n, apr_skiplist_size(skiplist)); + val = apr_skiplist_find(skiplist, "daton", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "daton", val); + + n++; + apr_skiplist_add(skiplist, "baton"); + ABTS_INT_EQUAL(tc, n, apr_skiplist_size(skiplist)); + val = apr_skiplist_find(skiplist, "baton", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "baton", val); + + n++; + apr_skiplist_add(skiplist, "caton"); + ABTS_INT_EQUAL(tc, n, apr_skiplist_size(skiplist)); + val = apr_skiplist_find(skiplist, "caton", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "caton", val); + + n++; + apr_skiplist_add(skiplist, "aaton"); + ABTS_INT_EQUAL(tc, n, apr_skiplist_size(skiplist)); + val = apr_skiplist_find(skiplist, "aaton", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "aaton", val); + } +} + +static void skiplist_destroy(abts_case *tc, void *data) +{ + apr_skiplist_destroy(skiplist, NULL); + ABTS_INT_EQUAL(tc, 0, apr_skiplist_size(skiplist)); +} + +static void skiplist_size(abts_case *tc, void *data) +{ + const char *val; + + ABTS_INT_EQUAL(tc, 0, apr_skiplist_size(skiplist)); + + apr_skiplist_insert(skiplist, "abc"); + apr_skiplist_insert(skiplist, "ghi"); + apr_skiplist_insert(skiplist, "def"); + val = apr_skiplist_find(skiplist, "abc", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "abc", val); + val = apr_skiplist_find(skiplist, "ghi", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "ghi", val); + val = apr_skiplist_find(skiplist, "def", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "def", val); + + ABTS_INT_EQUAL(tc, 3, apr_skiplist_size(skiplist)); + apr_skiplist_destroy(skiplist, NULL); +} + +static void skiplist_remove(abts_case *tc, void *data) +{ + const char *val; + + ABTS_INT_EQUAL(tc, 0, apr_skiplist_size(skiplist)); + + apr_skiplist_add(skiplist, "baton"); + ABTS_INT_EQUAL(tc, 1, apr_skiplist_size(skiplist)); + val = apr_skiplist_find(skiplist, "baton", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "baton", val); + + apr_skiplist_add(skiplist, "baton"); + ABTS_INT_EQUAL(tc, 2, apr_skiplist_size(skiplist)); + val = apr_skiplist_find(skiplist, "baton", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "baton", val); + + apr_skiplist_remove(skiplist, "baton", NULL); + ABTS_INT_EQUAL(tc, 1, apr_skiplist_size(skiplist)); + val = apr_skiplist_find(skiplist, "baton", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "baton", val); + + apr_skiplist_add(skiplist, "baton"); + ABTS_INT_EQUAL(tc, 2, apr_skiplist_size(skiplist)); + val = apr_skiplist_find(skiplist, "baton", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "baton", val); + + /* remove all "baton"s */ + while (apr_skiplist_remove(skiplist, "baton", NULL)) + ; + ABTS_INT_EQUAL(tc, 0, apr_skiplist_size(skiplist)); + val = apr_skiplist_find(skiplist, "baton", NULL); + ABTS_PTR_EQUAL(tc, NULL, val); +} + +#define NUM_RAND (100) +#define NUM_FIND (3 * NUM_RAND) +static void skiplist_random_loop(abts_case *tc, void *data) +{ + char **batons; + apr_skiplist *sl; + const char *val; + int i; + + ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&sl, ptmp)); + apr_skiplist_set_compare(sl, (void*)strcmp, (void*)strcmp); + batons = apr_palloc(ptmp, NUM_FIND * sizeof(char*)); + + for (i = 0; i < NUM_FIND; ++i) { + if (i < NUM_RAND) { + batons[i] = apr_psprintf(ptmp, "%.6u", rand() % 1000000); + } + else { + batons[i] = apr_pstrdup(ptmp, batons[i % NUM_RAND]); + } + apr_skiplist_add(sl, batons[i]); + val = apr_skiplist_find(sl, batons[i], NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, batons[i], val); + } + + apr_pool_clear(ptmp); +} + + static void add_int_to_skiplist(apr_skiplist *list, int n){ int* a = apr_skiplist_alloc(list, sizeof(int)); *a = n; @@ -40,7 +235,6 @@ static int comp(void *a, void *b){ return *((int*) a) - *((int*) b); } - static int compk(void *a, void *b){ return comp(a, b); } @@ -50,10 +244,8 @@ static void skiplist_test(abts_case *tc, void *data) { int i = 0, j = 0; int *val = NULL; apr_skiplist * list = NULL; - apr_pool_t *p; - apr_pool_create(&p, NULL); - apr_skiplist_init(&list, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&list, ptmp)); apr_skiplist_set_compare(list, comp, compk); /* insert 10 objects */ @@ -87,14 +279,31 @@ static void skiplist_test(abts_case *tc, void *data) { /* empty */ val = apr_skiplist_pop(list, NULL); ABTS_PTR_EQUAL(tc, val, NULL); + + apr_pool_clear(ptmp); } + abts_suite *testskiplist(abts_suite *suite) { suite = ADD_SUITE(suite) + apr_pool_create(&ptmp, p); + + abts_run_test(suite, skiplist_init, NULL); + abts_run_test(suite, skiplist_find, NULL); + abts_run_test(suite, skiplist_dontfind, NULL); + abts_run_test(suite, skiplist_insert, NULL); + abts_run_test(suite, skiplist_add, NULL); + abts_run_test(suite, skiplist_destroy, NULL); + abts_run_test(suite, skiplist_size, NULL); + abts_run_test(suite, skiplist_remove, NULL); + abts_run_test(suite, skiplist_random_loop, NULL); + abts_run_test(suite, skiplist_test, NULL); + apr_pool_destroy(ptmp); + return suite; } From 10bb61acb3088f8523e8caa048ec74557f7038df Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 16 Jul 2014 17:59:50 +0000 Subject: [PATCH 7451/7878] Use apr_skiplist_add() instead of apr_skiplist_insert() to merge skiplists since doublons need to be merged too. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611117 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 7fca4a42a96..3cd05e4cdcb 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -648,10 +648,10 @@ APR_DECLARE(apr_skiplist *) apr_skiplist_merge(apr_skiplist *sl1, apr_skiplist * apr_skiplist_remove_all(sl2, NULL); return sl1; } - /* This is what makes it brute force... Just insert :/ */ + /* This is what makes it brute force... Just add :/ */ b2 = apr_skiplist_getlist(sl2); while (b2) { - apr_skiplist_insert(sl1, b2->data); + apr_skiplist_add(sl1, b2->data); apr_skiplist_next(sl2, &b2); } apr_skiplist_remove_all(sl2, NULL); From 86193a971b67fca3d1d807f6afc7e69fcf5aea8a Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 16 Jul 2014 18:10:33 +0000 Subject: [PATCH 7452/7878] Call free() on the skiplist structure in apr_skiplist_destroy() if it was apr_skiplist_init()ialized without a pool (ie. malloc()ed). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611120 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 3cd05e4cdcb..25d20e30947 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -629,6 +629,9 @@ APR_DECLARE(void) apr_skiplist_destroy(apr_skiplist *sl, apr_skiplist_freefunc m while (apr_skiplist_pop(sl->index, skiplisti_destroy) != NULL) ; apr_skiplist_remove_all(sl, myfree); + if (!sl->pool) { + free(sl); + } } APR_DECLARE(apr_skiplist *) apr_skiplist_merge(apr_skiplist *sl1, apr_skiplist *sl2) From b8d41d225046c892c5b591e96a7f07011701f817 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 16 Jul 2014 18:21:33 +0000 Subject: [PATCH 7453/7878] Let apr_skiplist_find_compare() handle given NULL iterator, and be safe from NULL returns. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611125 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 25d20e30947..c671cd83388 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -154,6 +154,9 @@ static apr_status_t skiplisti_init(apr_skiplist **s, apr_pool_t *p) } else { sl = calloc(1, sizeof(apr_skiplist)); + if (!sl) { + return APR_ENOMEM; + } } #if 0 sl->compare = (apr_skiplist_compare) NULL; @@ -254,26 +257,18 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_getlist(apr_skiplist *sl) APR_DECLARE(void *) apr_skiplist_find(apr_skiplist *sl, void *data, apr_skiplistnode **iter) { - void *ret; - apr_skiplistnode *aiter; if (!sl->compare) { return NULL; } - if (iter) { - ret = apr_skiplist_find_compare(sl, data, iter, sl->compare); - } - else { - ret = apr_skiplist_find_compare(sl, data, &aiter, sl->compare); - } - return ret; + return apr_skiplist_find_compare(sl, data, iter, sl->compare); } static int skiplisti_find_compare(apr_skiplist *sl, void *data, apr_skiplistnode **ret, apr_skiplist_compare comp) { - apr_skiplistnode *m = NULL; int count = 0; + apr_skiplistnode *m; m = sl->top; while (m) { int compared; @@ -286,7 +281,7 @@ static int skiplisti_find_compare(apr_skiplist *sl, void *data, *ret = m; return count; } - if ((m->next == NULL) || (compared < 0)) { + if (compared < 0) { m = m->down; count++; } @@ -303,17 +298,26 @@ APR_DECLARE(void *) apr_skiplist_find_compare(apr_skiplist *sli, void *data, apr_skiplistnode **iter, apr_skiplist_compare comp) { - apr_skiplistnode *m = NULL; + apr_skiplistnode *m; apr_skiplist *sl; if (comp == sli->compare || !sli->index) { sl = sli; } else { apr_skiplist_find(sli->index, (void *)comp, &m); + if (!m) { + if (iter) { + *iter = NULL; + } + return NULL; + } sl = (apr_skiplist *) m->data; } - skiplisti_find_compare(sl, data, iter, sl->comparek); - return (iter && *iter) ? ((*iter)->data) : NULL; + skiplisti_find_compare(sl, data, &m, sl->comparek); + if (iter) { + *iter = m; + } + return (m) ? m->data : NULL; } @@ -558,6 +562,9 @@ APR_DECLARE(int) apr_skiplist_remove_compare(apr_skiplist *sli, } else { apr_skiplist_find(sli->index, (void *)comp, &m); + if (!m) { + return 0; + } sl = (apr_skiplist *) m->data; } skiplisti_find_compare(sl, data, &m, comp); From 55655fb1d7b8f6eab687b456658652243e27be0f Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 16 Jul 2014 20:53:11 +0000 Subject: [PATCH 7454/7878] Reuse the skiplist's stack needed by insert_compare() by growing it with adds. Rename the "replace" argument as "add" (negating the boolean) to avoid confusion since the skiplist never replaces any element (add or preserve semantic). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611184 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 87 ++++++++++++++++++++++++++++++------------- 1 file changed, 62 insertions(+), 25 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index c671cd83388..6d29b0730fb 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -38,6 +38,9 @@ struct apr_skiplist { apr_skiplistnode *bottomend; apr_skiplist *index; apr_array_header_t *memlist; + apr_skiplistnode **stack; + size_t stack_pos, + stack_len; apr_pool_t *pool; }; @@ -145,6 +148,43 @@ APR_DECLARE(void) apr_skiplist_free(apr_skiplist *sl, void *mem) } } +static apr_status_t skiplist_stack_push(apr_skiplist *sl, apr_skiplistnode *m) +{ + if (sl->stack_pos >= sl->stack_len) { + apr_skiplistnode **ptr; + size_t len = sl->stack_pos * 2; + if (len < 32) { + len = 32; + } + if (sl->pool) { + ptr = apr_palloc(sl->pool, len * sizeof(*ptr)); + if (ptr) { + memcpy(ptr, sl->stack, sl->stack_pos * sizeof(*ptr)); + } + } + else { + ptr = realloc(sl->stack, len * sizeof(*ptr)); + } + if (!ptr) { + return APR_ENOMEM; + } + sl->stack = ptr; + sl->stack_len = len; + } + sl->stack[sl->stack_pos++] = m; + return APR_SUCCESS; +} + +static APR_INLINE apr_skiplistnode *skiplist_stack_pop(apr_skiplist *sl) +{ + return (sl->stack_pos > 0) ? sl->stack[--sl->stack_pos] : NULL; +} + +static APR_INLINE void skiplist_stack_clear(apr_skiplist *sl) +{ + sl->stack_pos = 0; +} + static apr_status_t skiplisti_init(apr_skiplist **s, apr_pool_t *p) { apr_skiplist *sl; @@ -340,10 +380,10 @@ APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **i } static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, - apr_skiplist_compare comp, int replace) + apr_skiplist_compare comp, int add) { - apr_skiplistnode *m, *p, *tmp, *ret = NULL, **stack; - int nh = 1, ch, stacki; + apr_skiplistnode *m, *p, *tmp, *ret = NULL; + int nh = 1, ch; if (!sl->top) { sl->height = 1; sl->topend = sl->bottomend = sl->top = sl->bottom = @@ -387,21 +427,20 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, /* Keep a stack to pop back through for insertion */ /* malloc() is OK since we free the temp stack */ m = sl->top; - stack = (apr_skiplistnode **)malloc(sizeof(apr_skiplistnode *) * (nh)); - stacki = 0; while (m) { int compared = -1; if (m->next) { compared = comp(data, m->next->data); } - if (compared == 0 && replace) { - free(stack); /* OK. was malloc'ed */ + if (compared == 0 && !add) { + /* Keep the existing element(s) */ + skiplist_stack_clear(sl); return NULL; } - if ( (compared < 0) || (replace && (m->next == NULL)) ) { + if (compared < 0) { if (ch <= nh) { /* push on stack */ - stack[stacki++] = m; + skiplist_stack_push(sl, m); } m = m->down; ch--; @@ -412,8 +451,7 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, } /* Pop the stack and insert nodes */ p = NULL; - for (; stacki > 0; stacki--) { - m = stack[stacki - 1]; + while ((m = skiplist_stack_pop(sl))) { tmp = (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode)); tmp->next = m->next; if (m->next) { @@ -426,16 +464,15 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, if (p) { p->up = tmp; } + else { + /* This sets ret to the bottom-most node we are inserting */ + ret = tmp; + } tmp->data = data; tmp->sl = sl; m->next = tmp; - /* This sets ret to the bottom-most node we are inserting */ - if (!p) { - ret = tmp; - } p = tmp; } - free(stack); /* OK. was malloc'ed */ if (sl->index != NULL) { /* * this is a external insertion, we must insert into each index as @@ -454,18 +491,24 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, return ret; } +APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, void *data, + apr_skiplist_compare comp) +{ + return insert_compare(sl, data, comp, 0); +} + APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist *sl, void *data) { if (!sl->compare) { return NULL; } - return insert_compare(sl, data, sl->compare, 1); + return insert_compare(sl, data, sl->compare, 0); } APR_DECLARE(apr_skiplistnode *) apr_skiplist_add_compare(apr_skiplist *sl, void *data, apr_skiplist_compare comp) { - return insert_compare(sl, data, comp, 0); + return insert_compare(sl, data, comp, 1); } APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist *sl, void *data) @@ -473,13 +516,7 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist *sl, void *data) if (!sl->compare) { return NULL; } - return insert_compare(sl, data, sl->compare, 0); -} - -APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, void *data, - apr_skiplist_compare comp) -{ - return insert_compare(sl, data, comp, 1); + return insert_compare(sl, data, sl->compare, 1); } APR_DECLARE(int) apr_skiplist_remove(apr_skiplist *sl, void *data, apr_skiplist_freefunc myfree) From 8cd2feb786c70493a95e4b167cb5d56721b97e4f Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 16 Jul 2014 21:16:06 +0000 Subject: [PATCH 7455/7878] Don't grow the skiplist's height if the element is finally not inserted (preserve semantic). Do this by moving the top node creation after insertion occured, and linking to the just inserted node(s). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611193 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 51 ++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 6d29b0730fb..1a57d4ee799 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -407,25 +407,15 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, nh++; } } - /* Now we have the new height at which we wish to insert our new node */ - /* - * Let us make sure that our tree is a least that tall (grow if - * necessary) - */ - for (; sl->height < nh; sl->height++) { - sl->top->up = - (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode)); - sl->top->up->down = sl->top; - sl->top = sl->topend = sl->top->up; - sl->top->prev = sl->top->next = sl->top->nextindex = - sl->top->previndex = sl->top->up = NULL; - sl->top->data = NULL; - sl->top->sl = sl; - } ch = sl->height; - /* Find the node (or node after which we would insert) */ - /* Keep a stack to pop back through for insertion */ - /* malloc() is OK since we free the temp stack */ + + /* Now we have in nh the height at which we wish to insert our new node, + * and in ch the current height: don't create skip paths to the inserted + * element until the walk down through the tree (which decrements ch) + * reaches nh. From there, any walk down pushes the current node on a + * stack (the node(s) after which we would insert) to pop back through + * for insertion later. + */ m = sl->top; while (m) { int compared = -1; @@ -473,6 +463,31 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, m->next = tmp; p = tmp; } + + /* Now we are sure the node is inserted, grow our tree to 'nh' tall */ + for (; sl->height < nh; sl->height++) { + m = (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode)); + tmp = (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode)); + m->up = m->prev = m->nextindex = m->previndex = NULL; + m->next = tmp; + m->down = sl->top; + m->data = NULL; + m->sl = sl; + if (sl->top) { + sl->top->up = m; + } + else { + sl->bottom = sl->bottomend = m; + } + sl->top = sl->topend = tmp->prev = m; + tmp->up = tmp->next = tmp->nextindex = tmp->previndex = NULL; + tmp->down = p; + if (p) { + p->up = tmp; + } + tmp->data = data; + tmp->sl = sl; + } if (sl->index != NULL) { /* * this is a external insertion, we must insert into each index as From 203386f06711379ebf5342d556e65a89b0ea781b Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 17 Jul 2014 20:26:30 +0000 Subject: [PATCH 7456/7878] Follow up to r1611193: update the inserted node's top while looping should we have to create more than one top node (eg. preheight > 0). (the check on p != NULL can be omited since it can't be here). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611466 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 1a57d4ee799..a299b7b160f 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -482,11 +482,9 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, sl->top = sl->topend = tmp->prev = m; tmp->up = tmp->next = tmp->nextindex = tmp->previndex = NULL; tmp->down = p; - if (p) { - p->up = tmp; - } tmp->data = data; tmp->sl = sl; + p = p->up = tmp; } if (sl->index != NULL) { /* From d9641e738aae6e0aafc6982a6f78dd453d36ef74 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 17 Jul 2014 23:58:02 +0000 Subject: [PATCH 7457/7878] Provide apr_skiplist_size/height/preheight() to get the corresponding values in O(1), and apr_skiplist_set_preheight() to configure preheight mode. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611515 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_skiplist.h | 34 +++++++++++++++++++++++++ tables/apr_skiplist.c | 24 +++++++++++++++++- test/testskiplist.c | 56 +++++++++++++++++++++++++++--------------- 3 files changed, 93 insertions(+), 21 deletions(-) diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h index 1f85087272a..0ebb2bfb3fe 100644 --- a/include/apr_skiplist.h +++ b/include/apr_skiplist.h @@ -263,6 +263,40 @@ APR_DECLARE(void *) apr_skiplist_pop(apr_skiplist *sl, apr_skiplist_freefunc myf */ APR_DECLARE(void *) apr_skiplist_peek(apr_skiplist *sl); +/** + * Return the size of the list (number of elements), in O(1). + * @param sl The skip list + */ +APR_DECLARE(size_t) apr_skiplist_size(const apr_skiplist *sl); + +/** + * Return the height of the list (number of skip paths), in O(1). + * @param sl The skip list + */ +APR_DECLARE(int) apr_skiplist_height(const apr_skiplist *sl); + +/** + * Return the predefined maximum height of the skip list. + * @param sl The skip list + */ +APR_DECLARE(int) apr_skiplist_preheight(const apr_skiplist *sl); + +/** + * Set a predefined maximum height for the skip list. + * @param sl The skip list + * @param to The preheight to set, or a nul/negative value to disable. + * @remark When a preheight is used, the height of each inserted element is + * computed randomly up to this preheight instead of the current skip list's + * height plus one used by the default implementation. Using a preheight can + * probably ensure more fairness with long living elements (since with an + * adaptative height, former elements may have been created with a low height, + * hence a longest path to reach them while the skip list grows). On the other + * hand, the default behaviour (preheight <= 0) with a growing and decreasing + * maximum height is more adaptative/suitable for short living values. + * @note Should be called before any insertion/add. + */ +APR_DECLARE(void) apr_skiplist_set_preheight(apr_skiplist *sl, int to); + /** * Merge two skip lists. XXX SEMANTICS * @param sl1 One of two skip lists to be merged diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index a299b7b160f..a101ea6faa5 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -25,12 +25,14 @@ #include "apr_skiplist.h" +#include /* for INT_MAX */ + struct apr_skiplist { apr_skiplist_compare compare; apr_skiplist_compare comparek; int height; int preheight; - int size; + size_t size; apr_skiplistnode *top; apr_skiplistnode *bottom; /* These two are needed for appending */ @@ -675,6 +677,26 @@ APR_DECLARE(void *) apr_skiplist_peek(apr_skiplist *a) return NULL; } +APR_DECLARE(size_t) apr_skiplist_size(const apr_skiplist *sl) +{ + return sl->size; +} + +APR_DECLARE(int) apr_skiplist_height(const apr_skiplist *sl) +{ + return sl->height; +} + +APR_DECLARE(int) apr_skiplist_preheight(const apr_skiplist *sl) +{ + return sl->preheight; +} + +APR_DECLARE(void) apr_skiplist_set_preheight(apr_skiplist *sl, int to) +{ + sl->preheight = (to > 0) ? to : 0; +} + static void skiplisti_destroy(void *vsl) { apr_skiplist_destroy((apr_skiplist *) vsl, NULL); diff --git a/test/testskiplist.c b/test/testskiplist.c index 1832284cbfe..fe7a3caf1f9 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -33,14 +33,14 @@ static apr_pool_t *ptmp = NULL; static apr_skiplist *skiplist = NULL; -/* apr_skiplist_size() is missing in 1.5.x, wrap it */ -static int apr_skiplist_size(apr_skiplist *sl) +static int skiplist_get_size(abts_case *tc, apr_skiplist *sl) { - int size = 0; + size_t size = 0; apr_skiplistnode *n; for (n = apr_skiplist_getlist(sl); n; apr_skiplist_next(sl, &n)) { ++size; } + ABTS_TRUE(tc, size == apr_skiplist_size(sl)); return size; } @@ -75,53 +75,66 @@ static void skiplist_dontfind(abts_case *tc, void *data) static void skiplist_insert(abts_case *tc, void *data) { const char *val; - int i; + int i, height = 0; for (i = 0; i < 10; ++i) { apr_skiplist_insert(skiplist, "baton"); - ABTS_INT_EQUAL(tc, 1, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, 1 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); + + if (height == 0) { + height = apr_skiplist_height(skiplist); + } + else { + ABTS_INT_EQUAL(tc, height, apr_skiplist_height(skiplist)); + } } apr_skiplist_insert(skiplist, "foo"); - ABTS_INT_EQUAL(tc, 2, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, 2 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "foo", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "foo", val); + + apr_skiplist_insert(skiplist, "atfirst"); + ABTS_TRUE(tc, 3 == skiplist_get_size(tc, skiplist)); + val = apr_skiplist_find(skiplist, "atfirst", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "atfirst", val); } static void skiplist_add(abts_case *tc, void *data) { const char *val; - size_t i, n = apr_skiplist_size(skiplist); + size_t i, n = skiplist_get_size(tc, skiplist); for (i = 0; i < 100; ++i) { n++; apr_skiplist_add(skiplist, "daton"); - ABTS_INT_EQUAL(tc, n, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "daton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "daton", val); n++; apr_skiplist_add(skiplist, "baton"); - ABTS_INT_EQUAL(tc, n, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); n++; apr_skiplist_add(skiplist, "caton"); - ABTS_INT_EQUAL(tc, n, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "caton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "caton", val); n++; apr_skiplist_add(skiplist, "aaton"); - ABTS_INT_EQUAL(tc, n, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "aaton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "aaton", val); @@ -131,14 +144,14 @@ static void skiplist_add(abts_case *tc, void *data) static void skiplist_destroy(abts_case *tc, void *data) { apr_skiplist_destroy(skiplist, NULL); - ABTS_INT_EQUAL(tc, 0, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, 0 == skiplist_get_size(tc, skiplist)); } static void skiplist_size(abts_case *tc, void *data) { const char *val; - ABTS_INT_EQUAL(tc, 0, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, 0 == skiplist_get_size(tc, skiplist)); apr_skiplist_insert(skiplist, "abc"); apr_skiplist_insert(skiplist, "ghi"); @@ -153,7 +166,7 @@ static void skiplist_size(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "def", val); - ABTS_INT_EQUAL(tc, 3, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, 3 == skiplist_get_size(tc, skiplist)); apr_skiplist_destroy(skiplist, NULL); } @@ -161,28 +174,28 @@ static void skiplist_remove(abts_case *tc, void *data) { const char *val; - ABTS_INT_EQUAL(tc, 0, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, 0 == skiplist_get_size(tc, skiplist)); apr_skiplist_add(skiplist, "baton"); - ABTS_INT_EQUAL(tc, 1, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, 1 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); apr_skiplist_add(skiplist, "baton"); - ABTS_INT_EQUAL(tc, 2, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, 2 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); apr_skiplist_remove(skiplist, "baton", NULL); - ABTS_INT_EQUAL(tc, 1, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, 1 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); apr_skiplist_add(skiplist, "baton"); - ABTS_INT_EQUAL(tc, 2, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, 2 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); @@ -190,7 +203,7 @@ static void skiplist_remove(abts_case *tc, void *data) /* remove all "baton"s */ while (apr_skiplist_remove(skiplist, "baton", NULL)) ; - ABTS_INT_EQUAL(tc, 0, apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, 0 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_EQUAL(tc, NULL, val); } @@ -206,6 +219,9 @@ static void skiplist_random_loop(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&sl, ptmp)); apr_skiplist_set_compare(sl, (void*)strcmp, (void*)strcmp); + apr_skiplist_set_preheight(sl, 7); + ABTS_INT_EQUAL(tc, 7, apr_skiplist_preheight(sl)); + batons = apr_palloc(ptmp, NUM_FIND * sizeof(char*)); for (i = 0; i < NUM_FIND; ++i) { From 50b94fbab9e432cff6b1fa5a5a8c7e4c4aaf472f Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 18 Jul 2014 00:25:24 +0000 Subject: [PATCH 7458/7878] Follow up to r1611515: remove useless inclusion (for unused INT_MAX). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611517 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index a101ea6faa5..c18b2ace310 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -25,8 +25,6 @@ #include "apr_skiplist.h" -#include /* for INT_MAX */ - struct apr_skiplist { apr_skiplist_compare compare; apr_skiplist_compare comparek; From dd9711228e7c3f806d06a14292e1065e959d4965 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Thu, 24 Jul 2014 12:03:25 +0000 Subject: [PATCH 7459/7878] NetWare build fixes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1613086 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 + build/NWGNUenvironment.inc | 23 ++++++++++++++++++++++- build/NWGNUmakefile | 10 ++++++++++ build/NWGNUtail.inc | 1 + build/nw_export.h | 1 + 5 files changed, 35 insertions(+), 1 deletion(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 26b4b36581d..a722fcc5820 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -309,6 +309,7 @@ FILES_lib_objs = \ $(OBJDIR)/apr_dbm.o \ $(OBJDIR)/apr_dbm_berkeleydb.o \ $(OBJDIR)/apr_dbm_sdbm.o \ + $(OBJDIR)/apr_escape.o \ $(OBJDIR)/apr_fnmatch.o \ $(OBJDIR)/apr_getpass.o \ $(OBJDIR)/apr_hash.o \ diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index d9699f41ddb..9b6c5e4761c 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -134,6 +134,7 @@ CPP = $(CC) CPRE = $(CC) -EP LINK = mwldnlm -w nocmdline AR = $(LINK) -type library -o +WIN_CC = mwcc ifneq ($(findstring /sh,$(SHELL)),/sh) PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools @@ -144,6 +145,20 @@ CLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime/mwcrt MATH3S = PLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP.lib +ifeq "$(OS)" "Windows_NT" +# MetroWerks Win32 build flags to create build tools +MWCW_MSL = "$(METROWERKS)/MSL" +MWCW_W32 = "$(METROWERKS)/Win32-x86 Support" +CC_FOR_BUILD = $(WIN_CC) +CFLAGS_FOR_BUILD = -O2 -gccinc -nodefaults -proc 586 -w off +CFLAGS_FOR_BUILD += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32) +CFLAGS_FOR_BUILD += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib +else +# GNUC build flags to create build tools +CC_FOR_BUILD = gcc +CFLAGS_FOR_BUILD = -Wall -O2 +endif + # Base compile flags # and prefix or precompiled header added here. @@ -160,6 +175,12 @@ PLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP CFLAGS = -proc PII -align 4 CPFLAGS = -Cpp_exceptions off -RTTI off +ifdef CC_MAX_ERRORS +CFLAGS += -maxerrors $(CC_MAX_ERRORS) +else +CFLAGS += -maxerrors 1 +endif + ifeq "$(REQUIRE_PROTOTYPES)" "1" CFLAGS += -r endif @@ -216,7 +237,7 @@ PRELUDE = $(NOVI)/libcpre.gcc.o endif -# -include apr_arch_pre_nw.h #include pre_nw.h for all files +# -include apr_arch_pre_nw.h #include apr_arch_pre_nw.h for all files CFLAGS += -include apr_arch_pre_nw.h diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index f3b0625c11d..3d323be4496 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -35,6 +35,7 @@ FILES_prebuild_headers = \ $(APR)/include/apr.h \ $(APR)/include/apu_want.h \ $(APR)/include/private/apu_select_dbm.h \ + $(APR)/include/private/apr_escape_test_char.h \ $(EOLIST) nlms :: $(APR)/aprlib.imp @@ -55,6 +56,14 @@ nw_export.i : nw_export.h $(FILES_prebuild_headers) $(CCOPT_DEPENDS) @echo Creating $@ $(call COPY,$<,$@) +$(APR)/include/private/apr_escape_test_char.h: gen_test_char.exe $(APR)/tools/gen_test_char.c + @echo $(DL)GEN $@$(DL) + $< > $@ + +%.exe: $(APR)/tools/%.c + @echo $(DL)Creating Build Helper $@$(DL) + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -DCROSS_COMPILE $< -o $@ + # # You can use this target if all that is needed is to copy files to the # installation area @@ -68,6 +77,7 @@ clean :: $(call DEL,NWGNUversion.inc) $(call DEL,$(APR)/aprlib.imp) $(foreach file,$(FILES_prebuild_headers),$(call DEL,$(file))) + $(call DEL,gen_test_char.exe) # # Include the 'tail' makefile that has targets that depend on variables defined diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index cba5d686052..9444e9ae82b 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -215,6 +215,7 @@ ifneq "$(strip $(FILES_lib_objs))" "" @echo $(DL)$(wordlist 81, 90, $(FILES_lib_objs))$(DL)>> $@ @echo $(DL)$(wordlist 91, 100, $(FILES_lib_objs))$(DL)>> $@ @echo $(DL)$(wordlist 101, 110, $(FILES_lib_objs))$(DL)>> $@ + @echo $(DL)$(wordlist 111, 120, $(FILES_lib_objs))$(DL)>> $@ endif $(OBJDIR)/%_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS) diff --git a/build/nw_export.h b/build/nw_export.h index 6bc856bf2ee..92d9bd20180 100644 --- a/build/nw_export.h +++ b/build/nw_export.h @@ -22,6 +22,7 @@ #include "apr_dso.h" #include "apr_env.h" #include "apr_errno.h" +#include "apr_escape.h" #include "apr_file_info.h" #include "apr_file_io.h" #include "apr_fnmatch.h" From 0bcdce8fa4110e6084af406de66dfb7431b6c319 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Thu, 24 Jul 2014 13:19:33 +0000 Subject: [PATCH 7460/7878] Some more NetWare build fixes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1613114 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 + build/nw_export.h | 1 + test/NWGNUaprtest | 2 ++ 3 files changed, 4 insertions(+) diff --git a/NWGNUmakefile b/NWGNUmakefile index a722fcc5820..79f1962c6e9 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -324,6 +324,7 @@ FILES_lib_objs = \ $(OBJDIR)/apr_reslist.o \ $(OBJDIR)/apr_rmm.o \ $(OBJDIR)/apr_sha1.o \ + $(OBJDIR)/apr_skiplist.o \ $(OBJDIR)/apr_snprintf.o \ $(OBJDIR)/apr_strings.o \ $(OBJDIR)/apr_strmatch.o \ diff --git a/build/nw_export.h b/build/nw_export.h index 92d9bd20180..cc83064bc68 100644 --- a/build/nw_export.h +++ b/build/nw_export.h @@ -53,6 +53,7 @@ #include "apr_sha1.h" #include "apr_shm.h" #include "apr_signal.h" +#include "apr_skiplist.h" #include "apr_strings.h" #include "apr_strmatch.h" #include "apr_support.h" diff --git a/test/NWGNUaprtest b/test/NWGNUaprtest index 57b00da49b4..f0b496ceff1 100644 --- a/test/NWGNUaprtest +++ b/test/NWGNUaprtest @@ -183,6 +183,7 @@ FILES_nlm_objs = \ $(OBJDIR)/testdup.o \ $(OBJDIR)/testdso.o \ $(OBJDIR)/testenv.o \ + $(OBJDIR)/testescape.o \ $(OBJDIR)/testfilecopy.o \ $(OBJDIR)/testfileinfo.o \ $(OBJDIR)/testfile.o \ @@ -216,6 +217,7 @@ FILES_nlm_objs = \ $(OBJDIR)/testrand.o \ $(OBJDIR)/testrmm.o \ $(OBJDIR)/testshm.o \ + $(OBJDIR)/testskiplist.o \ $(OBJDIR)/testsleep.o \ $(OBJDIR)/testsock.o \ $(OBJDIR)/testsockets.o \ From 9bc5b11847a83cb53b719596b760198fd6ada7a8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 19 Aug 2014 11:32:37 +0000 Subject: [PATCH 7461/7878] Fix Android compile error caused by assumption that crypt is available. PR: 56627 Submitted by: Fredrik Fornwall , trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1618843 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_passwd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crypto/apr_passwd.c b/crypto/apr_passwd.c index 5fe85cda344..01e9860b857 100644 --- a/crypto/apr_passwd.c +++ b/crypto/apr_passwd.c @@ -92,6 +92,12 @@ static void crypt_mutex_unlock() #endif #endif +#if defined(WIN32) || defined(BEOS) || defined(NETWARE) || defined(__ANDROID__) +#define CRYPT_MISSING 1 +#else +#define CRYPT_MISSING 0 +#endif + /* * Validate a plaintext password against a smashed one. Uses either * crypt() (if available) or apr_md5_encode() or apr_sha1_base64(), depending @@ -103,7 +109,7 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, const char *hash) { char sample[200]; -#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) +#if !CRYPT_MISSING char *crypt_pw; #endif if (hash[0] == '$' @@ -126,7 +132,7 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, /* * It's not our algorithm, so feed it to crypt() if possible. */ -#if defined(WIN32) || defined(BEOS) || defined(NETWARE) +#if CRYPT_MISSING return (strcmp(passwd, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; #elif defined(CRYPT_R_CRYPTD) apr_status_t rv; From 737a8c124794b8f53cc0a0c3337d6e2c7cde81f6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 21 Aug 2014 15:26:34 +0000 Subject: [PATCH 7462/7878] apr_crypto_get_driver(): Fix invalid storage reference on error path. Submitted by: Philip Martin Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1619438 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 2633c0406a2..52930c16658 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -198,7 +198,7 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( if (err && buffer) { apr_dso_error(dso, buffer, ERROR_SIZE - 1); err->msg = buffer; - err->reason = modname; + err->reason = apr_pstrdup(pool, modname); *result = err; } } From c929a05fc3ebb7e957639caa4325f384cfae82d1 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 31 Aug 2014 13:50:02 +0000 Subject: [PATCH 7463/7878] Fix NetWare build: set NLM version with commandline option instead of linker def file due to bug with mwldnlm linker where patch version > 26 is ignored from def file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1621593 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 9444e9ae82b..b98ed96f7f8 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -253,6 +253,7 @@ $(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) ifeq "$(findstring mwldnlm,$(LINK))" "mwldnlm" # for Metrowerks CodeWarrior @echo $(DL)# Do not edit this file - it is created by make!$(DL) > $@ @echo $(DL)# All your changes will be lost!!$(DL)>> $@ + @echo $(DL)-nlmversion=$(NLM_VERSION)$(DL)>> $@ @echo $(DL)-warnings off$(DL)>> $@ @echo $(DL)-zerobss$(DL)>> $@ @echo $(DL)-nodefaults$(DL)>> $@ @@ -310,11 +311,9 @@ endif @echo $(DL)threadname "$(NLM_THREAD_NAME)"$(DL)>> $@ @echo $(DL)screenname "$(NLM_SCREEN_NAME)"$(DL)>> $@ @echo $(DL)stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE))))$(DL)>> $@ - @echo $(DL)version $(NLM_VERSION) $(DL)>> $@ @echo $(DL)$(strip $(NLM_FLAGS))$(DL)>> $@ @echo $(DL)start $(NLM_ENTRY_SYM)$(DL)>> $@ @echo $(DL)exit $(NLM_EXIT_SYM)$(DL)>> $@ -# @echo $(DL)map $(OBJDIR)/$(NLM_NAME).map$(DL)>> $@ ifneq "$(NLM_CHECK_SYM)" "" @echo $(DL)check $(NLM_CHECK_SYM)$(DL)>> $@ endif @@ -334,6 +333,7 @@ endif ifneq "$(NLM_XDCDATA)" "" @echo $(DL)xdcdata $(notdir $(NLM_XDCDATA))$(DL)>> $@ endif + @echo $(DL)map $(OBJDIR)/$(NLM_NAME).map$(DL)>> $@ else # for GNU nlmconv ifneq "$(FILES_nlm_Ximports)" "" @echo $(DL)import $(strip $(FILES_nlm_Ximports))$(DL)>> $@ @@ -354,6 +354,7 @@ endif ifeq "$(RELEASE)" "debug" @echo $(DL)debug$(DL)>> $@ endif + @echo $(DL)version $(NLM_VERSION) $(DL)>> $@ endif else # more than one target so look for individual makefiles. From 308c90dcfab3acb981790d93606f24e11cb66fe5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 15 Sep 2014 22:13:11 +0000 Subject: [PATCH 7464/7878] Follow up to r1604596: include skiplist test in the cmake-based build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1625173 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6a14992915..ab966e2c374 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -389,6 +389,7 @@ SET(APR_TEST_SOURCES test/testreslist.c test/testrmm.c test/testshm.c + test/testskiplist.c test/testsleep.c test/testsock.c test/testsockets.c From 61a5c68ad0dec7ea8b0181758d33a9a6a94f17b8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 15 Sep 2014 22:45:55 +0000 Subject: [PATCH 7465/7878] cmake >= 2.8.12 doesn't generate .pdb files for static libs, and points out that they aren't useful anyway: http://public.kitware.com/Bug/view.php?id=14600 remove .pdb handling for static libs regardless of cmake version git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1625175 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab966e2c374..2a5c4c30e82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -413,7 +413,6 @@ SET(APR_TEST_SOURCES SET(install_targets) SET(install_bin_pdb) -SET(install_lib_pdb) SET(dbd_drivers) # libapr-2 is shared, apr-2 is static @@ -426,7 +425,7 @@ ADD_DEPENDENCIES(libapr-2 test_char_header) ADD_LIBRARY(apr-2 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED}) SET(install_targets ${install_targets} apr-2) -SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/apr-2.pdb) +# no .pdb file generated for static libraries TARGET_LINK_LIBRARIES(apr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) SET_TARGET_PROPERTIES(apr-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_HAVE_MODULAR_DSO") ADD_DEPENDENCIES(apr-2 test_char_header) @@ -434,12 +433,10 @@ ADD_DEPENDENCIES(apr-2 test_char_header) # libaprapp-2 and aprapp-2 are static ADD_LIBRARY(libaprapp-2 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED}) SET(install_targets ${install_targets} libaprapp-2) -SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/libaprapp-2.pdb) SET_TARGET_PROPERTIES(libaprapp-2 PROPERTIES COMPILE_DEFINITIONS APR_APP) ADD_LIBRARY(aprapp-2 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED}) SET(install_targets ${install_targets} aprapp-2) -SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/aprapp-2.pdb) SET_TARGET_PROPERTIES(aprapp-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_APP") IF(APU_HAVE_CRYPTO) @@ -587,10 +584,6 @@ IF(INSTALL_PDB) INSTALL(FILES ${install_bin_pdb} DESTINATION bin CONFIGURATIONS RelWithDebInfo Debug) - - INSTALL(FILES ${install_lib_pdb} - DESTINATION lib - CONFIGURATIONS RelWithDebInfo Debug) ENDIF() INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include) From 140dfcaccaf9b4e9c3b608d1811dd38b5f349c50 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 16 Sep 2014 11:40:03 +0000 Subject: [PATCH 7466/7878] MySQL driver: Fix incorrect check for bad parameter in the driver support for apr_dbd_transaction_end(). PR: 56330 Submitted by: Weiqiang Li git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1625247 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_mysql.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c index e38925ee4a1..9d715855b21 100644 --- a/dbd/apr_dbd_mysql.c +++ b/dbd/apr_dbd_mysql.c @@ -1057,9 +1057,9 @@ static int dbd_mysql_end_transaction(apr_dbd_transaction_t *trans) else { ret = mysql_commit(trans->handle->conn); } + ret |= mysql_autocommit(trans->handle->conn, 1); + trans->handle->trans = NULL; } - ret |= mysql_autocommit(trans->handle->conn, 1); - trans->handle->trans = NULL; return ret; } /* Whether or not transactions work depends on whether the From bc80d9114b7d4c64c31654b20a13b914578d122e Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 21 Sep 2014 10:57:21 +0000 Subject: [PATCH 7467/7878] apr_crypto_nss: Explicitly declare key sizes when using NSS. Not all versions of NSS detect key sizes correctly, leading to test failures. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1626561 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_nss.c | 9 ++++- test/testcrypto.c | 86 +++++++++++++++++++++-------------------- 2 files changed, 51 insertions(+), 44 deletions(-) diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 02b147a6a5e..f65f60a427a 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -68,6 +68,7 @@ struct apr_crypto_key_t { SECOidTag cipherOid; PK11SymKey *symKey; int ivSize; + int keyLength; }; struct apr_crypto_block_t { @@ -426,6 +427,7 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, return APR_ENOCIPHER; /* No OID for CKM_DES3_ECB; */ } + key->keyLength = 24; break; case (APR_KEY_AES_128): if (APR_MODE_CBC == mode) { @@ -434,6 +436,7 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, else { key->cipherOid = SEC_OID_AES_128_ECB; } + key->keyLength = 16; break; case (APR_KEY_AES_192): if (APR_MODE_CBC == mode) { @@ -442,6 +445,7 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, else { key->cipherOid = SEC_OID_AES_192_ECB; } + key->keyLength = 24; break; case (APR_KEY_AES_256): if (APR_MODE_CBC == mode) { @@ -450,6 +454,7 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, else { key->cipherOid = SEC_OID_AES_256_ECB; } + key->keyLength = 32; break; default: /* unknown key type, give up */ @@ -478,9 +483,9 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, saltItem.len = saltLen; /* generate the key */ - /* pbeAlg and cipherAlg are the same. NSS decides the keylength. */ + /* pbeAlg and cipherAlg are the same. */ algid = PK11_CreatePBEV2AlgorithmID(key->cipherOid, key->cipherOid, - SEC_OID_HMAC_SHA1, 0, iterations, &saltItem); + SEC_OID_HMAC_SHA1, key->keyLength, iterations, &saltItem); if (algid) { slot = PK11_GetBestSlot(key->cipherMech, wincx); if (slot) { diff --git a/test/testcrypto.c b/test/testcrypto.c index f0df29b3bd0..6fa6185d819 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -521,17 +521,14 @@ static void test_crypto_block_nss_openssl(abts_case *tc, void *data) inlen, "KEY_AES_256/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, "KEY_AES_256/MODE_ECB"); - - /* all 4 of these tests fail to interoperate - a clue from the xml-security code is that - * NSS cannot distinguish between the 128 and 192 bit versions of AES. Will need to be - * investigated. - */ - /* - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_CBC, 0, in, inlen, "KEY_AES_192/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_ECB, 0, in, inlen, "KEY_AES_192/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_CBC, 0, in, inlen, "KEY_AES_128/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_ECB, 0, in, inlen, "KEY_AES_128/MODE_ECB"); - */ + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_128/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); } @@ -560,17 +557,14 @@ static void test_crypto_block_openssl_nss(abts_case *tc, void *data) inlen, "KEY_AES_256/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, "KEY_AES_256/MODE_ECB"); - - /* all 4 of these tests fail to interoperate - a clue from the xml-security code is that - * NSS cannot distinguish between the 128 and 192 bit versions of AES. Will need to be - * investigated. - */ - /* - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_CBC, 0, in, inlen, "KEY_AES_192/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_ECB, 0, in, inlen, "KEY_AES_192/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_CBC, 0, in, inlen, "KEY_AES_128/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_ECB, 0, in, inlen, "KEY_AES_128/MODE_ECB"); - */ + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_192/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_192/MODE_ECB"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, + inlen, "KEY_AES_128/MODE_CBC"); + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, + inlen, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); } @@ -789,16 +783,20 @@ static void test_crypto_block_nss_openssl_pad(abts_case *tc, void *data) /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ /*crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 1, in, inlen, "KEY_AES_256/MODE_ECB");*/ - /* all 4 of these tests fail to interoperate - a clue from the xml-security code is that - * NSS cannot distinguish between the 128 and 192 bit versions of AES. Will need to be - * investigated. - */ - /* - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_CBC, 1, in, inlen, "KEY_AES_192/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_ECB, 1, in, inlen, "KEY_AES_192/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_CBC, 1, in, inlen, "KEY_AES_128/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_ECB, 1, in, inlen, "KEY_AES_128/MODE_ECB"); - */ + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_192/MODE_CBC"); + + /* KEY_AES_192 / MODE_ECB doesn't support padding on NSS */ + /*crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 1, in, + inlen, "KEY_AES_192/MODE_ECB");*/ + + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, + inlen, "KEY_AES_128/MODE_CBC"); + + /* KEY_AES_192 / MODE_ECB doesn't support padding on NSS */ + /*crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 1, in, + inlen, "KEY_AES_128/MODE_ECB");*/ + apr_pool_destroy(pool); } @@ -829,16 +827,20 @@ static void test_crypto_block_openssl_nss_pad(abts_case *tc, void *data) /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ /*crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 1, in, inlen, "KEY_AES_256/MODE_ECB");*/ - /* all 4 of these tests fail to interoperate - a clue from the xml-security code is that - * NSS cannot distinguish between the 128 and 192 bit versions of AES. Will need to be - * investigated. - */ - /* - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_CBC, 1, in, inlen, "KEY_AES_192/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_ECB, 1, in, inlen, "KEY_AES_192/MODE_ECB"); - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_CBC, 1, in, inlen, "KEY_AES_128/MODE_CBC"); - crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_ECB, 1, in, inlen, "KEY_AES_128/MODE_ECB"); - */ + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, inlen, + "KEY_AES_192/MODE_CBC"); + + /* KEY_AES_192 / MODE_ECB doesn't support padding on NSS */ + /*crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 1, in, inlen, + "KEY_AES_192/MODE_ECB");*/ + + crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, inlen, + "KEY_AES_128/MODE_CBC"); + + /* KEY_AES_128 / MODE_ECB doesn't support padding on NSS */ + /*crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 1, in, inlen, + "KEY_AES_128/MODE_ECB");*/ + apr_pool_destroy(pool); } From 35c8e94840d14192a54c862ad86928c899477cdf Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 21 Sep 2014 11:09:04 +0000 Subject: [PATCH 7468/7878] Update config.guess and config.sub from http://git.savannah.gnu.org/cgit/config.git. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1626564 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 10 +++++----- build/config.sub | 22 ++++++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/build/config.guess b/build/config.guess index 72625d40c00..1f5c50c0d15 100755 --- a/build/config.guess +++ b/build/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2014-02-12' +timestamp='2014-03-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -826,7 +826,7 @@ EOF *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -969,10 +969,10 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) + or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) diff --git a/build/config.sub b/build/config.sub index 092cff00ea7..bba4efb8057 100755 --- a/build/config.sub +++ b/build/config.sub @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2014-01-01' +timestamp='2014-09-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -283,8 +283,10 @@ case $basic_machine in | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -296,11 +298,11 @@ case $basic_machine in | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -402,8 +404,10 @@ case $basic_machine in | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -415,6 +419,7 @@ case $basic_machine in | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ @@ -824,6 +829,10 @@ case $basic_machine in basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -1369,14 +1378,14 @@ case $os in | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1594,9 +1603,6 @@ case $basic_machine in mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;; From d4444a6bbd2705bb2c39104cee4611e402c60fe2 Mon Sep 17 00:00:00 2001 From: "Gregg L. Smith" Date: Mon, 22 Sep 2014 02:37:07 +0000 Subject: [PATCH 7469/7878] The better way git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1626658 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++---- libapr.dsp | 85 +++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 163 insertions(+), 9 deletions(-) diff --git a/apr.dsp b/apr.dsp index 9356d7d274a..e0485981373 100644 --- a/apr.dsp +++ b/apr.dsp @@ -305,6 +305,10 @@ SOURCE=.\dso\win32\dso.c SOURCE=.\encoding\apr_base64.c # End Source File +# Begin Source File + +SOURCE=.\encoding\apr_escape.c +# End Source File # End Group # Begin Group "file_io" @@ -831,7 +835,7 @@ SOURCE=.\include\apr.hw !IF "$(CFG)" == "apr - Win32 Release" -# Begin Custom Build - Creating apr.h from apr.hw +# Begin Custom Build - Creating apr.h from apr.hw, apr_escape_test_char.h from gen_test_char.exe InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" @@ -841,7 +845,7 @@ InputPath=.\include\apr.hw !ELSEIF "$(CFG)" == "apr - Win32 Debug" -# Begin Custom Build - Creating apr.h from apr.hw +# Begin Custom Build - Creating apr.h from apr.hw, apr_escape_test_char.h from gen_test_char.exe InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" @@ -849,9 +853,9 @@ InputPath=.\include\apr.hw # End Custom Build -!ELSEIF "$(CFG)" == "apr - x64 Release" +!ELSEIF "$(CFG)" == "apr - Win32 Release9x" -# Begin Custom Build - Creating apr.h from apr.hw +# Begin Custom Build - Creating apr.h from apr.hw, apr_escape_test_char.h from gen_test_char.exe InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" @@ -861,7 +865,7 @@ InputPath=.\include\apr.hw !ELSEIF "$(CFG)" == "apr - x64 Debug" -# Begin Custom Build - Creating apr.h from apr.hw +# Begin Custom Build - Creating apr.h from apr.hw, apr_escape_test_char.h from gen_test_char.exe InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" @@ -894,6 +898,79 @@ SOURCE=.\include\apr_errno.h # End Source File # Begin Source File +SOURCE=.\include\apr_escape.h + +!IF "$(CFG)" == "libapr - Win32 Release" + +# Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h +InputPath=.\include\apr_escape.h + +".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + cl.exe /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I ".\include" /Fo.\Release\gen_test_char /Fe.\Release\gen_test_char.exe .\tools\gen_test_char.c + .\Release\gen_test_char.exe > .\include\apr_escape_test_char.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +# Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h +InputPath=.\include\apr_escape.h + +".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + cl.exe /nologo /W3 /EHsc /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I ".\include" /Fo.\Debug\gen_test_char /Fe.\Debug\gen_test_char.exe .\tools\gen_test_char.c + .\Debug\gen_test_char.exe > .\include\apr_escape_test_char.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Release9x" + +# Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h +InputPath=.\include\apr_escape.h + +".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + cl.exe /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I ".\include" /Fo.\9x\Release\gen_test_char /Fe.\9x\Release\gen_test_char.exe .\tools\gen_test_char.c + .\9x\Release\gen_test_char.exe > .\include\apr_escape_test_char.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug9x" + +# Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h +InputPath=.\include\apr_escape.h + +".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + cl.exe /nologo /W3 /EHsc /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I ".\include" /Fo.\9x\Debug\gen_test_char /Fe.\9x\Debug\gen_test_char.exe .\tools\gen_test_char.c + .\9x\Debug\gen_test_char.exe > .\include\apr_escape_test_char.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Release" + +# Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h +InputPath=.\include\apr_escape.h + +".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + cl.exe /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I ".\include" /Fo.\x64\Release\gen_test_char /Fe.\x64\Release\gen_test_char.exe .\tools\gen_test_char.c + .\x64\Release\gen_test_char.exe > .\include\apr_escape_test_char.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Debug" + +# Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h +InputPath=.\include\apr_escape.h + +".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + cl.exe /nologo /W3 /EHsc /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I ".\include" /Fo.\x64\Debug\gen_test_char /Fe.\x64\Debug\gen_test_char.exe .\tools\gen_test_char.c + .\x64\Debug\gen_test_char.exe > .\include\apr_escape_test_char.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=.\include\apr_file_info.h # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index ccdb1817e34..eb5a02d9024 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -340,6 +340,10 @@ SOURCE=.\dso\win32\dso.c SOURCE=.\encoding\apr_base64.c # End Source File +# Begin Source File + +SOURCE=.\encoding\apr_escape.c +# End Source File # End Group # Begin Group "file_io" @@ -865,7 +869,7 @@ SOURCE=.\include\apr.hw !IF "$(CFG)" == "libapr - Win32 Release" -# Begin Custom Build - Creating apr.h from apr.hw +# Begin Custom Build - Creating apr.h from apr.hw, apr_escape_test_char.h from gen_test_char.exe InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" @@ -875,7 +879,7 @@ InputPath=.\include\apr.hw !ELSEIF "$(CFG)" == "libapr - Win32 Debug" -# Begin Custom Build - Creating apr.h from apr.hw +# Begin Custom Build - Creating apr.h from apr.hw, apr_escape_test_char.h from gen_test_char.exe InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" @@ -885,7 +889,7 @@ InputPath=.\include\apr.hw !ELSEIF "$(CFG)" == "libapr - x64 Release" -# Begin Custom Build - Creating apr.h from apr.hw +# Begin Custom Build - Creating apr.h from apr.hw, apr_escape_test_char.h from gen_test_char.exe InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" @@ -895,7 +899,7 @@ InputPath=.\include\apr.hw !ELSEIF "$(CFG)" == "libapr - x64 Debug" -# Begin Custom Build - Creating apr.h from apr.hw +# Begin Custom Build - Creating apr.h from apr.hw, apr_escape_test_char.h from gen_test_char.exe InputPath=.\include\apr.hw ".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" @@ -928,6 +932,79 @@ SOURCE=.\include\apr_errno.h # End Source File # Begin Source File +SOURCE=.\include\apr_escape.h + +!IF "$(CFG)" == "libapr - Win32 Release" + +# Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h +InputPath=.\include\apr_escape.h + +".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + cl.exe /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I ".\include" /Fo.\Release\gen_test_char /Fe.\Release\gen_test_char.exe .\tools\gen_test_char.c + .\Release\gen_test_char.exe > .\include\apr_escape_test_char.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug" + +# Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h +InputPath=.\include\apr_escape.h + +".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + cl.exe /nologo /W3 /EHsc /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I ".\include" /Fo.\Debug\gen_test_char /Fe.\Debug\gen_test_char.exe .\tools\gen_test_char.c + .\Debug\gen_test_char.exe > .\include\apr_escape_test_char.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Release9x" + +# Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h +InputPath=.\include\apr_escape.h + +".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + cl.exe /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I ".\include" /Fo.\9x\Release\gen_test_char /Fe.\9x\Release\gen_test_char.exe .\tools\gen_test_char.c + .\9x\Release\gen_test_char.exe > .\include\apr_escape_test_char.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - Win32 Debug9x" + +# Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h +InputPath=.\include\apr_escape.h + +".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + cl.exe /nologo /W3 /EHsc /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I ".\include" /Fo.\9x\Debug\gen_test_char /Fe.\9x\Debug\gen_test_char.exe .\tools\gen_test_char.c + .\9x\Debug\gen_test_char.exe > .\include\apr_escape_test_char.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Release" + +# Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h +InputPath=.\include\apr_escape.h + +".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + cl.exe /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I ".\include" /Fo.\x64\Release\gen_test_char /Fe.\x64\Release\gen_test_char.exe .\tools\gen_test_char.c + .\x64\Release\gen_test_char.exe > .\include\apr_escape_test_char.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "libapr - x64 Debug" + +# Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h +InputPath=.\include\apr_escape.h + +".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + cl.exe /nologo /W3 /EHsc /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I ".\include" /Fo.\x64\Debug\gen_test_char /Fe.\x64\Debug\gen_test_char.exe .\tools\gen_test_char.c + .\x64\Debug\gen_test_char.exe > .\include\apr_escape_test_char.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=.\include\apr_file_info.h # End Source File # Begin Source File From 01d209fb32b938780157e92444b9f3f7a6110f6e Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Mon, 27 Oct 2014 17:46:28 +0000 Subject: [PATCH 7470/7878] *) On z/OS, apr_sockaddr_info_get() with family == APR_UNSPEC was not returning IPv4 addresses if any IPv6 addresses were returned. [Eric Covener] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1634615 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ network_io/unix/sockaddr.c | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGES b/CHANGES index 33b22de61f4..da76f8af7b4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) On z/OS, apr_sockaddr_info_get() with family == APR_UNSPEC was not + returning IPv4 addresses if any IPv6 addresses were returned. + [Eric Covener] + *) apr_skiplist: Fix potential corruption of skiplists leading to unexpected results or crashes. [Takashi Sato , Eric Covener] PR 56654. diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index d51556e2583..7417073698a 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -333,6 +333,16 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, hints.ai_flags = AI_ADDRCONFIG; } #endif + +#ifdef __MVS__ + /* z/OS will not return IPv4 address under AF_UNSPEC if any IPv6 results + * are returned, w/o AI_ALL. + */ + if (family == APR_UNSPEC) { + hints.ai_flags |= AI_ALL; + } +#endif + if(hostname == NULL) { #ifdef AI_PASSIVE /* If hostname is NULL, assume we are trying to bind to all From 353757332ad63f43ebc8907a5586b9053ad08566 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Thu, 27 Nov 2014 14:26:03 +0000 Subject: [PATCH 7471/7878] * Correctly calculate the size of the returned string and set the correct return value in case we actually escape the string. PR: 57230 Submitted by: Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1642159 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ encoding/apr_escape.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index da76f8af7b4..42ebfe9f4a6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_escape: Correctly calculate the size of the returned string in + apr_escape_path and set the correct return value in case we actually + escape the string. [] PR 57230. + *) On z/OS, apr_sockaddr_info_get() with family == APR_UNSPEC was not returning IPv4 addresses if any IPv6 addresses were returned. [Eric Covener] diff --git a/encoding/apr_escape.c b/encoding/apr_escape.c index eda46759342..3be9eb99ec1 100644 --- a/encoding/apr_escape.c +++ b/encoding/apr_escape.c @@ -436,6 +436,8 @@ APR_DECLARE(apr_status_t) apr_escape_path(char *escaped, const char *path, while ((c = *s) && slen) { if (TEST_CHAR(c, T_OS_ESCAPE_PATH)) { d = c2x(c, '%', d); + size += 2; + found = 1; } else { *d++ = c; From 3efd1f704e4436767ee56fd1dff1e75a8985d874 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Fri, 19 Dec 2014 22:21:59 +0000 Subject: [PATCH 7472/7878] apr_pollset state fixes for z/OS Submitted By: Pat Odonnell Committed By: covener git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1646891 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ poll/unix/z_asio.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 42ebfe9f4a6..59989a38138 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_pollset: On z/OS, threadsafe apr_pollset_poll() may return + "EDC8102I Operation would block" under load. + [Pat Odonnell patod us.ibm.com ] + *) apr_escape: Correctly calculate the size of the returned string in apr_escape_path and set the correct return value in case we actually escape the string. [] PR 57230. diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index ce158d3169c..d2df69638ad 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -379,6 +379,7 @@ static apr_status_t asio_pollset_add(apr_pollset_t *pollset, APR_RING_REMOVE(elem, link); DBG1(3, "used recycled memory at %08p\n", elem); elem->state = ASIO_INIT; + elem->a.aio_cflags = 0; } else { elem = (asio_elem_t *) apr_pcalloc(pollset->pool, sizeof(asio_elem_t)); @@ -659,6 +660,7 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, if (ret == 1) { DBG(4, "asyncio() completed inline\n"); /* it's ready now */ + elem->state = ASIO_COMPLETE; APR_RING_INSERT_TAIL(&(priv->ready_ring), elem, asio_elem_t, link); } From 9d71b0ed591a010877abd48774eb77f61824754a Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Fri, 19 Dec 2014 22:22:55 +0000 Subject: [PATCH 7473/7878] fix email addr syntax git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1646892 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 59989a38138..e21ba88b947 100644 --- a/CHANGES +++ b/CHANGES @@ -3,7 +3,7 @@ Changes for APR 2.0.0 *) apr_pollset: On z/OS, threadsafe apr_pollset_poll() may return "EDC8102I Operation would block" under load. - [Pat Odonnell patod us.ibm.com ] + [Pat Odonnell ] *) apr_escape: Correctly calculate the size of the returned string in apr_escape_path and set the correct return value in case we actually From 6422227d69605e664ae6e97825e698c0f1c06622 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Fri, 19 Dec 2014 22:23:43 +0000 Subject: [PATCH 7474/7878] typo again, sigh git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1646893 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index e21ba88b947..4f37655c6b0 100644 --- a/CHANGES +++ b/CHANGES @@ -3,7 +3,7 @@ Changes for APR 2.0.0 *) apr_pollset: On z/OS, threadsafe apr_pollset_poll() may return "EDC8102I Operation would block" under load. - [Pat Odonnell ] + [Pat Odonnell ] *) apr_escape: Correctly calculate the size of the returned string in apr_escape_path and set the correct return value in case we actually From 3c818c6d7351f0130282d212a69035642f5fecad Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Thu, 1 Jan 2015 12:32:58 +0000 Subject: [PATCH 7475/7878] Happy New Year 2015 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1648830 13f79535-47bb-0310-9956-ffa450edef68 --- NOTICE | 2 +- include/apr_version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NOTICE b/NOTICE index b16965be948..cd3576db205 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Apache Portable Runtime -Copyright (c) 2000-2014 The Apache Software Foundation. +Copyright (c) 2000-2015 The Apache Software Foundation. This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff --git a/include/apr_version.h b/include/apr_version.h index 5f21f1aabab..f02b57d0e3c 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -38,7 +38,7 @@ */ -#define APR_COPYRIGHT "Copyright (c) 2000-2014 The Apache Software " \ +#define APR_COPYRIGHT "Copyright (c) 2000-2015 The Apache Software " \ "Foundation or its licensors, as applicable." /* The numeric compile-time version constants. These constants are the From 9e2079aac04b3b76f0a1eb93078a6cc3e93ea94e Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Wed, 4 Mar 2015 17:13:47 +0000 Subject: [PATCH 7476/7878] =?UTF-8?q?Remove=20the=20--parents=20option=20t?= =?UTF-8?q?hat=20causes=20rpmbuild=20on=20CentOS7=20to=20break.=20Reported?= =?UTF-8?q?=20by=20=E6=B2=B3=E6=9C=AC=E5=92=8C=E5=BD=A6=20kohmoto=20iris?= =?UTF-8?q?=20eonet=20ne=20jp.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664074 13f79535-47bb-0310-9956-ffa450edef68 --- build/rpm/apr.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/rpm/apr.spec.in b/build/rpm/apr.spec.in index 5111a649954..62656aba7b5 100644 --- a/build/rpm/apr.spec.in +++ b/build/rpm/apr.spec.in @@ -177,7 +177,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %doc docs/APRDesign.html docs/canonical_filenames.html %doc docs/incomplete_types docs/non_apr_programs -%doc --parents html +%doc html %{_bindir}/apr*config %{_libdir}/libapr-%{aprver}.*a %{_libdir}/libapr-%{aprver}.so From 304e78d7029ba56884328324df18342b50ae9bf4 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 5 Mar 2015 16:51:39 +0000 Subject: [PATCH 7477/7878] FIX: Skiplists should allow for dups by default. Also, when added, dups are added *after* each other, not before git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664406 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_skiplist.h | 26 ++++++++++++++------------ tables/apr_skiplist.c | 14 +++++++------- test/testskiplist.c | 38 +++++++++++++++++++------------------- 3 files changed, 40 insertions(+), 38 deletions(-) diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h index 0ebb2bfb3fe..cf700e564ea 100644 --- a/include/apr_skiplist.h +++ b/include/apr_skiplist.h @@ -171,7 +171,8 @@ APR_DECLARE(void *) apr_skiplist_next(apr_skiplist *sl, apr_skiplistnode **iter) APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **iter); /** - * Insert an element into the skip list using the specified comparison function. + * Insert an element into the skip list using the specified comparison function + * allowing for duplicates. * @param sl The skip list * @param data The element to insert * @param comp The comparison function to use for placement into the skip list @@ -180,37 +181,38 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, void *data, apr_skiplist_compare comp); /** - * Add an element into the skip list using the specified comparison function. + * Add an element into the skip list using the specified comparison function + * if it does not already exist. * @param sl The skip list * @param data The element to add * @param comp The comparison function to use for placement into the skip list */ -APR_DECLARE(apr_skiplistnode *) apr_skiplist_add_compare(apr_skiplist *sl, +APR_DECLARE(apr_skiplistnode *) apr_skiplist_addne_compare(apr_skiplist *sl, void *data, apr_skiplist_compare comp); /** - * Add an element into the skip list using the existing comparison function. + * Add an element into the skip list using the existing comparison function + * if it does not already exist. * @param sl The skip list * @param data The element to insert * @remark If no comparison function has been set for the skip list, the element - * will not be inserted and NULL will be returned. This allows for multiple - * values to be added to the skiplist. To retain value, use apr_skiplist_insert(). + * will not be inserted and NULL will be returned. */ -APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist* sl, void *data); +APR_DECLARE(apr_skiplistnode *) apr_skiplist_addne(apr_skiplist* sl, void *data); /** - * Insert an element into the skip list using the existing comparison function. + * Insert an element into the skip list using the existing comparison function + * allowing for duplicates. * @param sl The skip list * @param data The element to insert * @remark If no comparison function has been set for the skip list, the element - * will not be inserted and NULL will be returned. Previous values will - * be not be over-written. Use apr_skiplist_add() to allow multiple values. + * will not be inserted and NULL will be returned. */ APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist* sl, void *data); /** * Remove an element from the skip list using the specified comparison function for - * locating the element. + * locating the element. In the case of duplicates, the 1st entry will be removed. * @param sl The skip list * @param data The element to remove * @param myfree A function to be called for each removed element @@ -223,7 +225,7 @@ APR_DECLARE(int) apr_skiplist_remove_compare(apr_skiplist *sl, void *data, /** * Remove an element from the skip list using the existing comparison function for - * locating the element. + * locating the element. In the case of duplicates, the 1st entry will be removed. * @param sl The skip list * @param data The element to remove * @param myfree A function to be called for each removed element diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index c18b2ace310..25a6ad662b0 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -427,7 +427,7 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, skiplist_stack_clear(sl); return NULL; } - if (compared < 0) { + if (compared < 0 || ((compared <= 0) && add)) { if (ch <= nh) { /* push on stack */ skiplist_stack_push(sl, m); @@ -507,7 +507,7 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, void *data, apr_skiplist_compare comp) { - return insert_compare(sl, data, comp, 0); + return insert_compare(sl, data, comp, 1); } APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist *sl, void *data) @@ -515,21 +515,21 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist *sl, void *data if (!sl->compare) { return NULL; } - return insert_compare(sl, data, sl->compare, 0); + return insert_compare(sl, data, sl->compare, 1); } -APR_DECLARE(apr_skiplistnode *) apr_skiplist_add_compare(apr_skiplist *sl, void *data, +APR_DECLARE(apr_skiplistnode *) apr_skiplist_addne_compare(apr_skiplist *sl, void *data, apr_skiplist_compare comp) { - return insert_compare(sl, data, comp, 1); + return insert_compare(sl, data, comp, 0); } -APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist *sl, void *data) +APR_DECLARE(apr_skiplistnode *) apr_skiplist_addne(apr_skiplist *sl, void *data) { if (!sl->compare) { return NULL; } - return insert_compare(sl, data, sl->compare, 1); + return insert_compare(sl, data, sl->compare, 0); } APR_DECLARE(int) apr_skiplist_remove(apr_skiplist *sl, void *data, apr_skiplist_freefunc myfree) diff --git a/test/testskiplist.c b/test/testskiplist.c index fe7a3caf1f9..29796468e9c 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -58,7 +58,7 @@ static void skiplist_find(abts_case *tc, void *data) { const char *val; - apr_skiplist_insert(skiplist, "baton"); + apr_skiplist_addne(skiplist, "baton"); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); @@ -72,13 +72,13 @@ static void skiplist_dontfind(abts_case *tc, void *data) ABTS_PTR_EQUAL(tc, NULL, (void *)val); } -static void skiplist_insert(abts_case *tc, void *data) +static void skiplist_addne(abts_case *tc, void *data) { const char *val; int i, height = 0; for (i = 0; i < 10; ++i) { - apr_skiplist_insert(skiplist, "baton"); + apr_skiplist_addne(skiplist, "baton"); ABTS_TRUE(tc, 1 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); @@ -92,48 +92,48 @@ static void skiplist_insert(abts_case *tc, void *data) } } - apr_skiplist_insert(skiplist, "foo"); + apr_skiplist_addne(skiplist, "foo"); ABTS_TRUE(tc, 2 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "foo", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "foo", val); - apr_skiplist_insert(skiplist, "atfirst"); + apr_skiplist_addne(skiplist, "atfirst"); ABTS_TRUE(tc, 3 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "atfirst", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "atfirst", val); } -static void skiplist_add(abts_case *tc, void *data) +static void skiplist_insert(abts_case *tc, void *data) { const char *val; size_t i, n = skiplist_get_size(tc, skiplist); for (i = 0; i < 100; ++i) { n++; - apr_skiplist_add(skiplist, "daton"); + apr_skiplist_insert(skiplist, "daton"); ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "daton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "daton", val); n++; - apr_skiplist_add(skiplist, "baton"); + apr_skiplist_insert(skiplist, "baton"); ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); n++; - apr_skiplist_add(skiplist, "caton"); + apr_skiplist_insert(skiplist, "caton"); ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "caton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "caton", val); n++; - apr_skiplist_add(skiplist, "aaton"); + apr_skiplist_insert(skiplist, "aaton"); ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "aaton", NULL); ABTS_PTR_NOTNULL(tc, val); @@ -153,9 +153,9 @@ static void skiplist_size(abts_case *tc, void *data) ABTS_TRUE(tc, 0 == skiplist_get_size(tc, skiplist)); - apr_skiplist_insert(skiplist, "abc"); - apr_skiplist_insert(skiplist, "ghi"); - apr_skiplist_insert(skiplist, "def"); + apr_skiplist_addne(skiplist, "abc"); + apr_skiplist_addne(skiplist, "ghi"); + apr_skiplist_addne(skiplist, "def"); val = apr_skiplist_find(skiplist, "abc", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "abc", val); @@ -176,13 +176,13 @@ static void skiplist_remove(abts_case *tc, void *data) ABTS_TRUE(tc, 0 == skiplist_get_size(tc, skiplist)); - apr_skiplist_add(skiplist, "baton"); + apr_skiplist_insert(skiplist, "baton"); ABTS_TRUE(tc, 1 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); - apr_skiplist_add(skiplist, "baton"); + apr_skiplist_insert(skiplist, "baton"); ABTS_TRUE(tc, 2 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); @@ -194,7 +194,7 @@ static void skiplist_remove(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); - apr_skiplist_add(skiplist, "baton"); + apr_skiplist_insert(skiplist, "baton"); ABTS_TRUE(tc, 2 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); @@ -231,7 +231,7 @@ static void skiplist_random_loop(abts_case *tc, void *data) else { batons[i] = apr_pstrdup(ptmp, batons[i % NUM_RAND]); } - apr_skiplist_add(sl, batons[i]); + apr_skiplist_insert(sl, batons[i]); val = apr_skiplist_find(sl, batons[i], NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, batons[i], val); @@ -244,7 +244,7 @@ static void skiplist_random_loop(abts_case *tc, void *data) static void add_int_to_skiplist(apr_skiplist *list, int n){ int* a = apr_skiplist_alloc(list, sizeof(int)); *a = n; - apr_skiplist_insert(list, a); + apr_skiplist_addne(list, a); } static int comp(void *a, void *b){ @@ -309,8 +309,8 @@ abts_suite *testskiplist(abts_suite *suite) abts_run_test(suite, skiplist_init, NULL); abts_run_test(suite, skiplist_find, NULL); abts_run_test(suite, skiplist_dontfind, NULL); + abts_run_test(suite, skiplist_addne, NULL); abts_run_test(suite, skiplist_insert, NULL); - abts_run_test(suite, skiplist_add, NULL); abts_run_test(suite, skiplist_destroy, NULL); abts_run_test(suite, skiplist_size, NULL); abts_run_test(suite, skiplist_remove, NULL); From caebbcc9a596ab0e68c1613b6f7e3a836957f165 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 5 Mar 2015 18:31:45 +0000 Subject: [PATCH 7478/7878] skiplist: Follow up to r1664406: use insert() in apr_skiplist_merge and optimize test in insert_compare(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664447 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 25a6ad662b0..e691b97e116 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -418,16 +418,18 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, */ m = sl->top; while (m) { - int compared = -1; - if (m->next) { - compared = comp(data, m->next->data); - } + int compared; + compared = (m->next) ? comp(data, m->next->data) : -1; if (compared == 0 && !add) { /* Keep the existing element(s) */ skiplist_stack_clear(sl); return NULL; } - if (compared < 0 || ((compared <= 0) && add)) { + /* + * To maintain stability, dups must be added AFTER each + * other. + */ + if (compared <= 0) { if (ch <= nh) { /* push on stack */ skiplist_stack_push(sl, m); @@ -728,10 +730,10 @@ APR_DECLARE(apr_skiplist *) apr_skiplist_merge(apr_skiplist *sl1, apr_skiplist * apr_skiplist_remove_all(sl2, NULL); return sl1; } - /* This is what makes it brute force... Just add :/ */ + /* This is what makes it brute force... Just insert :/ */ b2 = apr_skiplist_getlist(sl2); while (b2) { - apr_skiplist_add(sl1, b2->data); + apr_skiplist_insert(sl1, b2->data); apr_skiplist_next(sl2, &b2); } apr_skiplist_remove_all(sl2, NULL); From 1de0df66dacafdff0da25584e57c5af38c785fe0 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 5 Mar 2015 18:42:35 +0000 Subject: [PATCH 7479/7878] skiplist: Follow up to r1664406+r1664447: Better optimize test in insert_compare() and keep find_compare() in sync. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664451 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index e691b97e116..9dd595f0f4d 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -312,14 +312,19 @@ static int skiplisti_find_compare(apr_skiplist *sl, void *data, m = sl->top; while (m) { int compared; - compared = (m->next) ? comp(data, m->next->data) : -1; - if (compared == 0) { - m = m->next; - while (m->down) { - m = m->down; + if (m->next) { + compared = comp(data, m->next->data); + if (compared == 0) { + m = m->next; + while (m->down) { + m = m->down; + } + *ret = m; + return count; } - *ret = m; - return count; + } + else { + compared = -1; } if (compared < 0) { m = m->down; @@ -419,11 +424,16 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, m = sl->top; while (m) { int compared; - compared = (m->next) ? comp(data, m->next->data) : -1; - if (compared == 0 && !add) { - /* Keep the existing element(s) */ - skiplist_stack_clear(sl); - return NULL; + if (m->next) { + compared = comp(data, m->next->data); + if (compared == 0 && !add) { + /* Keep the existing element(s) */ + skiplist_stack_clear(sl); + return NULL; + } + } + else { + compared = -1; } /* * To maintain stability, dups must be added AFTER each From de29540ddfbb5b1b7f5883d43d8b89dfb3472e79 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 5 Mar 2015 19:54:15 +0000 Subject: [PATCH 7480/7878] skiplist: keep tests in sync with 1.5.x and 1.6.x. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664467 13f79535-47bb-0310-9956-ffa450edef68 --- test/testskiplist.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/testskiplist.c b/test/testskiplist.c index 29796468e9c..811c75c7592 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -244,7 +244,7 @@ static void skiplist_random_loop(abts_case *tc, void *data) static void add_int_to_skiplist(apr_skiplist *list, int n){ int* a = apr_skiplist_alloc(list, sizeof(int)); *a = n; - apr_skiplist_addne(list, a); + apr_skiplist_insert(list, a); } static int comp(void *a, void *b){ @@ -296,6 +296,23 @@ static void skiplist_test(abts_case *tc, void *data) { val = apr_skiplist_pop(list, NULL); ABTS_PTR_EQUAL(tc, val, NULL); + add_int_to_skiplist(list, 42); + add_int_to_skiplist(list, 1); + add_int_to_skiplist(list, 142); + add_int_to_skiplist(list, 42); + val = apr_skiplist_peek(list); + ABTS_INT_EQUAL(tc, *val, 1); + val = apr_skiplist_pop(list, NULL); + ABTS_INT_EQUAL(tc, *val, 1); + val = apr_skiplist_peek(list); + ABTS_INT_EQUAL(tc, *val, 42); + val = apr_skiplist_pop(list, NULL); + ABTS_INT_EQUAL(tc, *val, 42); + val = apr_skiplist_pop(list, NULL); + ABTS_INT_EQUAL(tc, *val, 42); + val = apr_skiplist_peek(list); + ABTS_INT_EQUAL(tc, *val, 142); + apr_pool_clear(ptmp); } From 7ec926807fce13d942729ed485f0590a8d0b345a Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 5 Mar 2015 20:00:25 +0000 Subject: [PATCH 7481/7878] skiplist: improve duplicates ordering test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664471 13f79535-47bb-0310-9956-ffa450edef68 --- test/testskiplist.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/testskiplist.c b/test/testskiplist.c index 811c75c7592..e2571f2cda1 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -260,6 +260,8 @@ static void skiplist_test(abts_case *tc, void *data) { int i = 0, j = 0; int *val = NULL; apr_skiplist * list = NULL; + int first_forty_two = 42, + second_forty_two = 42; ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&list, ptmp)); apr_skiplist_set_compare(list, comp, compk); @@ -296,19 +298,22 @@ static void skiplist_test(abts_case *tc, void *data) { val = apr_skiplist_pop(list, NULL); ABTS_PTR_EQUAL(tc, val, NULL); - add_int_to_skiplist(list, 42); + apr_skiplist_insert(list, &first_forty_two); add_int_to_skiplist(list, 1); add_int_to_skiplist(list, 142); - add_int_to_skiplist(list, 42); + apr_skiplist_insert(list, &second_forty_two); val = apr_skiplist_peek(list); ABTS_INT_EQUAL(tc, *val, 1); val = apr_skiplist_pop(list, NULL); ABTS_INT_EQUAL(tc, *val, 1); val = apr_skiplist_peek(list); + ABTS_PTR_EQUAL(tc, val, &second_forty_two); ABTS_INT_EQUAL(tc, *val, 42); val = apr_skiplist_pop(list, NULL); + ABTS_PTR_EQUAL(tc, val, &second_forty_two); ABTS_INT_EQUAL(tc, *val, 42); val = apr_skiplist_pop(list, NULL); + ABTS_PTR_EQUAL(tc, val, &first_forty_two); ABTS_INT_EQUAL(tc, *val, 42); val = apr_skiplist_peek(list); ABTS_INT_EQUAL(tc, *val, 142); From d7c432c920bd55faa1245e0da5baadca049327ec Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sat, 7 Mar 2015 00:52:11 +0000 Subject: [PATCH 7482/7878] skiplist: more optimizations. We don't need to create the top before inserting, this will be done if/once the value is really added (since r1611193). Check compare value only if m->next is not NULL, otherwise we already known it is to be handled as negative (down). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664769 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 71 ++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 45 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 9dd595f0f4d..1bc38e64fd1 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -311,9 +311,8 @@ static int skiplisti_find_compare(apr_skiplist *sl, void *data, apr_skiplistnode *m; m = sl->top; while (m) { - int compared; if (m->next) { - compared = comp(data, m->next->data); + int compared = comp(data, m->next->data); if (compared == 0) { m = m->next; while (m->down) { @@ -322,18 +321,14 @@ static int skiplisti_find_compare(apr_skiplist *sl, void *data, *ret = m; return count; } + if (compared > 0) { + m = m->next; + count++; + continue; + } } - else { - compared = -1; - } - if (compared < 0) { - m = m->down; - count++; - } - else { - m = m->next; - count++; - } + m = m->down; + count++; } *ret = NULL; return count; @@ -389,19 +384,7 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, { apr_skiplistnode *m, *p, *tmp, *ret = NULL; int nh = 1, ch; - if (!sl->top) { - sl->height = 1; - sl->topend = sl->bottomend = sl->top = sl->bottom = - (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode)); - sl->top->next = NULL; - sl->top->data = NULL; - sl->top->prev = NULL; - sl->top->up = NULL; - sl->top->down = NULL; - sl->top->nextindex = NULL; - sl->top->previndex = NULL; - sl->top->sl = sl; - } + if (sl->preheight) { while (nh < sl->preheight && get_b_rand()) { nh++; @@ -423,33 +406,28 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, */ m = sl->top; while (m) { - int compared; + /* + * To maintain stability, dups (compared == 0) must be added + * AFTER each other. + */ if (m->next) { - compared = comp(data, m->next->data); + int compared = comp(data, m->next->data); if (compared == 0 && !add) { /* Keep the existing element(s) */ skiplist_stack_clear(sl); return NULL; } - } - else { - compared = -1; - } - /* - * To maintain stability, dups must be added AFTER each - * other. - */ - if (compared <= 0) { - if (ch <= nh) { - /* push on stack */ - skiplist_stack_push(sl, m); + if (compared > 0) { + m = m->next; + continue; } - m = m->down; - ch--; } - else { - m = m->next; + if (ch <= nh) { + /* push on stack */ + skiplist_stack_push(sl, m); } + m = m->down; + ch--; } /* Pop the stack and insert nodes */ p = NULL; @@ -496,7 +474,10 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, tmp->down = p; tmp->data = data; tmp->sl = sl; - p = p->up = tmp; + if (p) { + p->up = tmp; + } + p = tmp; } if (sl->index != NULL) { /* From 96d837f69009b03b65b101ca1363cd8a966a540e Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sat, 7 Mar 2015 00:55:16 +0000 Subject: [PATCH 7483/7878] skiplist: provide apr_skiplist_element(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664770 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_skiplist.h | 6 ++++++ tables/apr_skiplist.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h index cf700e564ea..8ea17a9be14 100644 --- a/include/apr_skiplist.h +++ b/include/apr_skiplist.h @@ -170,6 +170,12 @@ APR_DECLARE(void *) apr_skiplist_next(apr_skiplist *sl, apr_skiplistnode **iter) */ APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **iter); +/** + * Return the element of the skip list node + * @param iter The skip list node + */ +APR_DECLARE(void *) apr_skiplist_element(apr_skiplistnode *iter); + /** * Insert an element into the skip list using the specified comparison function * allowing for duplicates. diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 1bc38e64fd1..8ce508ab8be 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -379,6 +379,11 @@ APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **i return (*iter) ? ((*iter)->data) : NULL; } +APR_DECLARE(void *) apr_skiplist_element(apr_skiplistnode *node) +{ + return node->data; +} + static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, apr_skiplist_compare comp, int add) { From ff225d4588af72a70c6d2c0543675e543426d8f1 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sat, 7 Mar 2015 01:29:20 +0000 Subject: [PATCH 7484/7878] skiplist: Generalize the internal stack structure as a queue (FIFO), and use it for the spare nodes (instead of apr_skiplist_alloc()/free()) and the insertion stack. Fix a memory leak in destroy() when memory is malloc()ed (pool is NULL). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664775 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 116 ++++++++++++++++++++++++------------------ 1 file changed, 66 insertions(+), 50 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 8ce508ab8be..45827712581 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -25,6 +25,12 @@ #include "apr_skiplist.h" +typedef struct { + apr_skiplistnode **data; + size_t size, pos; + apr_pool_t *p; +} apr_skiplist_q; + struct apr_skiplist { apr_skiplist_compare compare; apr_skiplist_compare comparek; @@ -38,9 +44,8 @@ struct apr_skiplist { apr_skiplistnode *bottomend; apr_skiplist *index; apr_array_header_t *memlist; - apr_skiplistnode **stack; - size_t stack_pos, - stack_len; + apr_skiplist_q nodes_q, + stack_q; apr_pool_t *pool; }; @@ -148,41 +153,57 @@ APR_DECLARE(void) apr_skiplist_free(apr_skiplist *sl, void *mem) } } -static apr_status_t skiplist_stack_push(apr_skiplist *sl, apr_skiplistnode *m) +static apr_status_t skiplist_qpush(apr_skiplist_q *q, apr_skiplistnode *m) { - if (sl->stack_pos >= sl->stack_len) { - apr_skiplistnode **ptr; - size_t len = sl->stack_pos * 2; - if (len < 32) { - len = 32; - } - if (sl->pool) { - ptr = apr_palloc(sl->pool, len * sizeof(*ptr)); - if (ptr) { - memcpy(ptr, sl->stack, sl->stack_pos * sizeof(*ptr)); + if (q->pos >= q->size) { + apr_skiplistnode **data; + size_t size = (q->pos) ? q->pos * 2 : 32; + if (q->p) { + data = apr_palloc(q->p, size * sizeof(*data)); + if (data) { + memcpy(data, q->data, q->pos * sizeof(*data)); } } else { - ptr = realloc(sl->stack, len * sizeof(*ptr)); + data = realloc(q->data, size * sizeof(*data)); } - if (!ptr) { + if (!data) { return APR_ENOMEM; } - sl->stack = ptr; - sl->stack_len = len; + q->data = data; + q->size = size; } - sl->stack[sl->stack_pos++] = m; + q->data[q->pos++] = m; return APR_SUCCESS; } -static APR_INLINE apr_skiplistnode *skiplist_stack_pop(apr_skiplist *sl) +static APR_INLINE apr_skiplistnode *skiplist_qpop(apr_skiplist_q *q) { - return (sl->stack_pos > 0) ? sl->stack[--sl->stack_pos] : NULL; + return (q->pos > 0) ? q->data[--q->pos] : NULL; } -static APR_INLINE void skiplist_stack_clear(apr_skiplist *sl) +static APR_INLINE void skiplist_qclear(apr_skiplist_q *q) { - sl->stack_pos = 0; + q->pos = 0; +} + +static apr_skiplistnode *skiplist_new_node(apr_skiplist *sl) +{ + apr_skiplistnode *m = skiplist_qpop(&sl->nodes_q); + if (!m) { + if (sl->pool) { + m = apr_palloc(sl->pool, sizeof *m); + } + else { + m = malloc(sizeof *m); + } + } + return m; +} + +static apr_status_t skiplist_free_node(apr_skiplist *sl, apr_skiplistnode *m) +{ + return skiplist_qpush(&sl->nodes_q, m); } static apr_status_t skiplisti_init(apr_skiplist **s, apr_pool_t *p) @@ -191,6 +212,7 @@ static apr_status_t skiplisti_init(apr_skiplist **s, apr_pool_t *p) if (p) { sl = apr_pcalloc(p, sizeof(apr_skiplist)); sl->memlist = apr_array_make(p, 20, sizeof(memlist_t)); + sl->pool = sl->nodes_q.p = sl->stack_q.p = p; } else { sl = calloc(1, sizeof(apr_skiplist)); @@ -198,17 +220,6 @@ static apr_status_t skiplisti_init(apr_skiplist **s, apr_pool_t *p) return APR_ENOMEM; } } -#if 0 - sl->compare = (apr_skiplist_compare) NULL; - sl->comparek = (apr_skiplist_compare) NULL; - sl->height = 0; - sl->preheight = 0; - sl->size = 0; - sl->top = NULL; - sl->bottom = NULL; - sl->index = NULL; -#endif - sl->pool = p; *s = sl; return APR_SUCCESS; } @@ -419,7 +430,7 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, int compared = comp(data, m->next->data); if (compared == 0 && !add) { /* Keep the existing element(s) */ - skiplist_stack_clear(sl); + skiplist_qclear(&sl->stack_q); return NULL; } if (compared > 0) { @@ -429,19 +440,20 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, } if (ch <= nh) { /* push on stack */ - skiplist_stack_push(sl, m); + skiplist_qpush(&sl->stack_q, m); } m = m->down; ch--; } /* Pop the stack and insert nodes */ p = NULL; - while ((m = skiplist_stack_pop(sl))) { - tmp = (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode)); + while ((m = skiplist_qpop(&sl->stack_q))) { + tmp = skiplist_new_node(sl); tmp->next = m->next; if (m->next) { m->next->prev = tmp; } + m->next = tmp; tmp->prev = m; tmp->up = NULL; tmp->nextindex = tmp->previndex = NULL; @@ -455,14 +467,13 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, } tmp->data = data; tmp->sl = sl; - m->next = tmp; p = tmp; } /* Now we are sure the node is inserted, grow our tree to 'nh' tall */ for (; sl->height < nh; sl->height++) { - m = (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode)); - tmp = (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode)); + m = skiplist_new_node(sl); + tmp = skiplist_new_node(sl); m->up = m->prev = m->nextindex = m->previndex = NULL; m->next = tmp; m->down = sl->top; @@ -492,7 +503,8 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, apr_skiplistnode *ni, *li; li = ret; for (p = apr_skiplist_getlist(sl->index); p; apr_skiplist_next(sl->index, &p)) { - ni = apr_skiplist_insert((apr_skiplist *) p->data, ret->data); + apr_skiplist *sli = (apr_skiplist *)p->data; + ni = insert_compare(sli, ret->data, sli->compare, add); li->nextindex = ni; ni->previndex = li; li = ni; @@ -580,7 +592,7 @@ static int skiplisti_remove(apr_skiplist *sl, apr_skiplistnode *m, apr_skiplist_ if (!m && myfree && p->data) { myfree(p->data); } - apr_skiplist_free(sl, p); + skiplist_free_node(sl, p); } sl->size--; while (sl->top && sl->top->next == NULL) { @@ -590,7 +602,7 @@ static int skiplisti_remove(apr_skiplist *sl, apr_skiplistnode *m, apr_skiplist_ if (sl->top) { sl->top->up = NULL; /* Make it think its the top */ } - apr_skiplist_free(sl, p); + skiplist_free_node(sl, p); sl->height--; } if (!sl->top) { @@ -636,13 +648,14 @@ APR_DECLARE(void) apr_skiplist_remove_all(apr_skiplist *sl, apr_skiplist_freefun m = sl->bottom; while (m) { p = m->next; - if (p && myfree && p->data) + if (myfree && p && p->data) { myfree(p->data); - while (m) { + } + do { u = m->up; - apr_skiplist_free(sl, m); + skiplist_free_node(sl, m); m = u; - } + } while (m); m = p; } sl->top = sl->bottom = NULL; @@ -695,8 +708,7 @@ APR_DECLARE(void) apr_skiplist_set_preheight(apr_skiplist *sl, int to) static void skiplisti_destroy(void *vsl) { - apr_skiplist_destroy((apr_skiplist *) vsl, NULL); - apr_skiplist_free((apr_skiplist *) vsl, vsl); + apr_skiplist_destroy(vsl, NULL); } APR_DECLARE(void) apr_skiplist_destroy(apr_skiplist *sl, apr_skiplist_freefunc myfree) @@ -705,6 +717,10 @@ APR_DECLARE(void) apr_skiplist_destroy(apr_skiplist *sl, apr_skiplist_freefunc m ; apr_skiplist_remove_all(sl, myfree); if (!sl->pool) { + while (sl->nodes_q.pos) + free(sl->nodes_q.data[--sl->nodes_q.pos]); + free(sl->nodes_q.data); + free(sl->stack_q.data); free(sl); } } From 6fd5e8ffa751603bc8cac3fded77f6ff870cfe5c Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 7 Mar 2015 19:53:46 +0000 Subject: [PATCH 7485/7878] Adj test to ensure that dups are entered AFTER existing ones git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664900 13f79535-47bb-0310-9956-ffa450edef68 --- test/testskiplist.c | 55 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/test/testskiplist.c b/test/testskiplist.c index e2571f2cda1..57d3a59b4fa 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -240,6 +240,11 @@ static void skiplist_random_loop(abts_case *tc, void *data) apr_pool_clear(ptmp); } +typedef struct elem { + int a; + int b; +} elem; + static void add_int_to_skiplist(apr_skiplist *list, int n){ int* a = apr_skiplist_alloc(list, sizeof(int)); @@ -247,6 +252,12 @@ static void add_int_to_skiplist(apr_skiplist *list, int n){ apr_skiplist_insert(list, a); } +static void add_elem_to_skiplist(apr_skiplist *list, elem n){ + elem* a = apr_skiplist_alloc(list, sizeof(elem)); + *a = n; + apr_skiplist_insert(list, a); +} + static int comp(void *a, void *b){ return *((int*) a) - *((int*) b); } @@ -255,13 +266,29 @@ static int compk(void *a, void *b){ return comp(a, b); } +static int scomp(void *a, void *b){ + return ((elem*) a)->a - ((elem*) b)->a; +} + +static int scompk(void *a, void *b){ + return scomp(a, b); +} + static void skiplist_test(abts_case *tc, void *data) { int test_elems = 10; int i = 0, j = 0; int *val = NULL; + elem *val2 = NULL; apr_skiplist * list = NULL; + apr_skiplist * list2 = NULL; int first_forty_two = 42, second_forty_two = 42; + elem t1, t2, t3, t4, t5; + t1.a = 1; t1.b = 1; + t2.a = 42; t2.b = 1; + t3.a = 42; t3.b = 2; + t4.a = 42; t4.b = 3; + t5.a = 142; t5.b = 1; ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&list, ptmp)); apr_skiplist_set_compare(list, comp, compk); @@ -318,6 +345,34 @@ static void skiplist_test(abts_case *tc, void *data) { val = apr_skiplist_peek(list); ABTS_INT_EQUAL(tc, *val, 142); + ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&list2, ptmp)); + apr_skiplist_set_compare(list2, scomp, scompk); + add_elem_to_skiplist(list2, t2); + add_elem_to_skiplist(list2, t1); + add_elem_to_skiplist(list2, t3); + add_elem_to_skiplist(list2, t5); + add_elem_to_skiplist(list2, t4); + val2 = apr_skiplist_pop(list2, NULL); + printf("%d %d\n", val2->a, val2->b); + ABTS_INT_EQUAL(tc, val2->a, 1); + val2 = apr_skiplist_pop(list2, NULL); + printf("%d %d\n", val2->a, val2->b); + ABTS_INT_EQUAL(tc, val2->a, 42); + ABTS_INT_EQUAL(tc, val2->b, 1); + val2 = apr_skiplist_pop(list2, NULL); + printf("%d %d\n", val2->a, val2->b); + ABTS_INT_EQUAL(tc, val2->a, 42); + ABTS_INT_EQUAL(tc, val2->b, 2); + val2 = apr_skiplist_pop(list2, NULL); + printf("%d %d\n", val2->a, val2->b); + ABTS_INT_EQUAL(tc, val2->a, 42); + ABTS_INT_EQUAL(tc, val2->b, 1); + val2 = apr_skiplist_pop(list2, NULL); + printf("%d %d\n", val2->a, val2->b); + ABTS_INT_EQUAL(tc, val2->a, 142); + ABTS_INT_EQUAL(tc, val2->b, 1); + + apr_pool_clear(ptmp); } From 945c6f119684a6c9dce8d2e9c30bc2da138faf47 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 7 Mar 2015 19:54:49 +0000 Subject: [PATCH 7486/7878] remove debug git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664901 13f79535-47bb-0310-9956-ffa450edef68 --- test/testskiplist.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/testskiplist.c b/test/testskiplist.c index 57d3a59b4fa..3f89c1b117e 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -353,22 +353,17 @@ static void skiplist_test(abts_case *tc, void *data) { add_elem_to_skiplist(list2, t5); add_elem_to_skiplist(list2, t4); val2 = apr_skiplist_pop(list2, NULL); - printf("%d %d\n", val2->a, val2->b); ABTS_INT_EQUAL(tc, val2->a, 1); val2 = apr_skiplist_pop(list2, NULL); - printf("%d %d\n", val2->a, val2->b); ABTS_INT_EQUAL(tc, val2->a, 42); ABTS_INT_EQUAL(tc, val2->b, 1); val2 = apr_skiplist_pop(list2, NULL); - printf("%d %d\n", val2->a, val2->b); ABTS_INT_EQUAL(tc, val2->a, 42); ABTS_INT_EQUAL(tc, val2->b, 2); val2 = apr_skiplist_pop(list2, NULL); - printf("%d %d\n", val2->a, val2->b); ABTS_INT_EQUAL(tc, val2->a, 42); ABTS_INT_EQUAL(tc, val2->b, 1); val2 = apr_skiplist_pop(list2, NULL); - printf("%d %d\n", val2->a, val2->b); ABTS_INT_EQUAL(tc, val2->a, 142); ABTS_INT_EQUAL(tc, val2->b, 1); From d5d7952cf8be83385bff9d5f4c6bdcb5230c4e32 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 7 Mar 2015 19:56:38 +0000 Subject: [PATCH 7487/7878] fix test git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664904 13f79535-47bb-0310-9956-ffa450edef68 --- test/testskiplist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testskiplist.c b/test/testskiplist.c index 3f89c1b117e..01bd441c156 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -362,7 +362,7 @@ static void skiplist_test(abts_case *tc, void *data) { ABTS_INT_EQUAL(tc, val2->b, 2); val2 = apr_skiplist_pop(list2, NULL); ABTS_INT_EQUAL(tc, val2->a, 42); - ABTS_INT_EQUAL(tc, val2->b, 1); + ABTS_INT_EQUAL(tc, val2->b, 3); val2 = apr_skiplist_pop(list2, NULL); ABTS_INT_EQUAL(tc, val2->a, 142); ABTS_INT_EQUAL(tc, val2->b, 1); From 169bead2cb12291c9e7367519b98e38fc53dbc8a Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 7 Mar 2015 20:18:54 +0000 Subject: [PATCH 7488/7878] Maintain stability ordering git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664911 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 45827712581..acaec16ba2f 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -433,7 +433,7 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, skiplist_qclear(&sl->stack_q); return NULL; } - if (compared > 0) { + if (compared >= 0) { m = m->next; continue; } From c2e17d5af4b149577d6ab2d63245efac4b9444f2 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sun, 8 Mar 2015 10:10:01 +0000 Subject: [PATCH 7489/7878] skiplist: When removing the last node, we have top = bottom = NULL, and must set topend = bottomend = NULL too. Also fix test from r1664471 according to r1664911. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664958 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 3 ++- test/testskiplist.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index acaec16ba2f..2734fbad589 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -606,7 +606,8 @@ static int skiplisti_remove(apr_skiplist *sl, apr_skiplistnode *m, apr_skiplist_ sl->height--; } if (!sl->top) { - sl->bottom = NULL; + sl->bottom = sl->bottomend = NULL; + sl->topend = NULL; } return sl->height; /* return 1; ?? */ } diff --git a/test/testskiplist.c b/test/testskiplist.c index 01bd441c156..59f16d91fdc 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -334,13 +334,13 @@ static void skiplist_test(abts_case *tc, void *data) { val = apr_skiplist_pop(list, NULL); ABTS_INT_EQUAL(tc, *val, 1); val = apr_skiplist_peek(list); - ABTS_PTR_EQUAL(tc, val, &second_forty_two); + ABTS_PTR_EQUAL(tc, val, &first_forty_two); ABTS_INT_EQUAL(tc, *val, 42); val = apr_skiplist_pop(list, NULL); - ABTS_PTR_EQUAL(tc, val, &second_forty_two); + ABTS_PTR_EQUAL(tc, val, &first_forty_two); ABTS_INT_EQUAL(tc, *val, 42); val = apr_skiplist_pop(list, NULL); - ABTS_PTR_EQUAL(tc, val, &first_forty_two); + ABTS_PTR_EQUAL(tc, val, &second_forty_two); ABTS_INT_EQUAL(tc, *val, 42); val = apr_skiplist_peek(list); ABTS_INT_EQUAL(tc, *val, 142); From b96d8e292a19c2b0def44a658e053fbe767cb077 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 11 Mar 2015 17:54:48 +0000 Subject: [PATCH 7490/7878] apr_hash: introduce apr_hash_get_or_set(). Allows to get an entry, or if it does not exist set a new one in the same pass. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1665952 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 14 ++++++++++++++ tables/apr_hash.c | 19 +++++++++++++++++++ test/testhash.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) diff --git a/include/apr_hash.h b/include/apr_hash.h index 37d972f9dd7..7ad9380eb17 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -117,6 +117,20 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key, APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, apr_ssize_t klen); +/** + * Look up the value associated with a key in a hash table, or if none exists + * associate a value. + * @param ht The hash table + * @param key Pointer to the key + * @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string + * length. + * @param val Value to associate with the key (if none exists). + * @return Returns the existing value if any, the given value otherwise. + * @remark If the given value is NULL and a hash entry exists, nothing is done. + */ +APR_DECLARE(void *) apr_hash_get_or_set(apr_hash_t *ht, const void *key, + apr_ssize_t klen, const void *val); + /** * Start iterating over the entries in a hash table. * @param p The pool to allocate the apr_hash_index_t iterator. If this diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 0bf4d28c294..d4567710d66 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -399,6 +399,25 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, /* else key not present and val==NULL */ } +APR_DECLARE(void *) apr_hash_get_or_set(apr_hash_t *ht, + const void *key, + apr_ssize_t klen, + const void *val) +{ + apr_hash_entry_t **hep; + hep = find_entry(ht, key, klen, val); + if (*hep) { + val = (*hep)->val; + /* check that the collision rate isn't too high */ + if (ht->count > ht->max) { + expand_array(ht); + } + return (void *)val; + } + /* else key not present and val==NULL */ + return NULL; +} + APR_DECLARE(unsigned int) apr_hash_count(apr_hash_t *ht) { return ht->count; diff --git a/test/testhash.c b/test/testhash.c index 3c841902418..9dd5804b818 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -97,6 +97,34 @@ static void hash_set(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "value", result); } +static void hash_get_or_set(abts_case *tc, void *data) +{ + apr_hash_t *h = NULL; + char *result = NULL; + + h = apr_hash_make(p); + ABTS_PTR_NOTNULL(tc, h); + + result = apr_hash_get_or_set(h, "key", APR_HASH_KEY_STRING, "value"); + ABTS_STR_EQUAL(tc, "value", result); + + result = apr_hash_get_or_set(h, "key", APR_HASH_KEY_STRING, "other"); + ABTS_STR_EQUAL(tc, "value", result); + + result = apr_hash_get_or_set(h, "key", APR_HASH_KEY_STRING, NULL); + ABTS_STR_EQUAL(tc, "value", result); + + apr_hash_set(h, "key", APR_HASH_KEY_STRING, NULL); + result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); + ABTS_PTR_EQUAL(tc, NULL, result); + + result = apr_hash_get_or_set(h, "key", APR_HASH_KEY_STRING, NULL); + ABTS_PTR_EQUAL(tc, NULL, result); + + result = apr_hash_get_or_set(h, "key", APR_HASH_KEY_STRING, "other"); + ABTS_STR_EQUAL(tc, "other", result); +} + static void hash_reset(abts_case *tc, void *data) { apr_hash_t *h = NULL; @@ -517,6 +545,7 @@ abts_suite *testhash(abts_suite *suite) abts_run_test(suite, hash_make, NULL); abts_run_test(suite, hash_set, NULL); + abts_run_test(suite, hash_get_or_set, NULL); abts_run_test(suite, hash_reset, NULL); abts_run_test(suite, same_value, NULL); abts_run_test(suite, same_value_custom, NULL); From 125b34fbbae53b7ed680cbde90082b0bbcf13ab3 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 13 Mar 2015 00:27:19 +0000 Subject: [PATCH 7491/7878] apr_poll(cb): fix error paths returned values and leaks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1666341 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 35 +++++++++++++++++++++++++++-------- poll/unix/kqueue.c | 33 +++++++++++++++++++++++++-------- poll/unix/poll.c | 14 ++++++-------- poll/unix/pollcb.c | 3 +++ poll/unix/port.c | 33 +++++++++++++++++++++++++-------- poll/unix/z_asio.c | 11 ++++++++--- 6 files changed, 94 insertions(+), 35 deletions(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 965e2833c1e..23686d5f5af 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -106,12 +106,20 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, { int fd_flags; - if ((fd_flags = fcntl(fd, F_GETFD)) == -1) - return errno; + if ((fd_flags = fcntl(fd, F_GETFD)) == -1) { + rv = errno; + close(fd); + pollset->p = NULL; + return rv; + } fd_flags |= FD_CLOEXEC; - if (fcntl(fd, F_SETFD, fd_flags) == -1) - return errno; + if (fcntl(fd, F_SETFD, fd_flags) == -1) { + rv = errno; + close(fd); + pollset->p = NULL; + return rv; + } } #endif @@ -122,11 +130,13 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, ((rv = apr_thread_mutex_create(&pollset->p->ring_lock, APR_THREAD_MUTEX_DEFAULT, p)) != APR_SUCCESS)) { + close(fd); pollset->p = NULL; return rv; } #else if (flags & APR_POLLSET_THREADSAFE) { + close(fd); pollset->p = NULL; return APR_ENOTIMPL; } @@ -347,13 +357,22 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, #ifndef HAVE_EPOLL_CREATE1 { int fd_flags; + apr_status_t rv; - if ((fd_flags = fcntl(fd, F_GETFD)) == -1) - return errno; + if ((fd_flags = fcntl(fd, F_GETFD)) == -1) { + rv = errno; + close(fd); + pollcb->fd = -1; + return rv; + } fd_flags |= FD_CLOEXEC; - if (fcntl(fd, F_SETFD, fd_flags) == -1) - return errno; + if (fcntl(fd, F_SETFD, fd_flags) == -1) { + rv = errno; + close(fd); + pollcb->fd = -1; + return rv; + } } #endif diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 2e25c9fdec1..355ccba994e 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -115,12 +115,20 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, { int flags; - if ((flags = fcntl(pollset->p->kqueue_fd, F_GETFD)) == -1) - return errno; + if ((flags = fcntl(pollset->p->kqueue_fd, F_GETFD)) == -1) { + rv = errno; + close(pollset->p->kqueue_fd); + pollset->p = NULL; + return rv; + } flags |= FD_CLOEXEC; - if (fcntl(pollset->p->kqueue_fd, F_SETFD, flags) == -1) - return errno; + if (fcntl(pollset->p->kqueue_fd, F_SETFD, flags) == -1) { + rv = errno; + close(pollset->p->kqueue_fd); + pollset->p = NULL; + return rv; + } } pollset->p->result_set = apr_palloc(p, pollset->p->setsize * sizeof(apr_pollfd_t)); @@ -338,13 +346,22 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, { int flags; + apr_status_t rv; - if ((flags = fcntl(fd, F_GETFD)) == -1) - return errno; + if ((flags = fcntl(fd, F_GETFD)) == -1) { + rv = errno; + close(fd); + pollcb->fd = -1; + return rv; + } flags |= FD_CLOEXEC; - if (fcntl(fd, F_SETFD, flags) == -1) - return errno; + if (fcntl(fd, F_SETFD, flags) == -1) { + rv = errno; + close(fd); + pollcb->fd = -1; + return rv; + } } pollcb->fd = fd; diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 871126b343a..a11e7a93298 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -240,24 +240,22 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, { int ret; apr_status_t rv = APR_SUCCESS; -#ifdef WIN32 - apr_interval_time_t orig_timeout = timeout; -#endif - if (timeout > 0) { - timeout /= 1000; - } #ifdef WIN32 /* WSAPoll() requires at least one socket. */ if (pollset->nelts == 0) { *num = 0; - if (orig_timeout > 0) { - apr_sleep(orig_timeout); + if (timeout > 0) { + apr_sleep(timeout); return APR_TIMEUP; } return APR_SUCCESS; } + if (timeout > 0) { + timeout /= 1000; + } + ret = WSAPoll(pollset->p->pollset, pollset->nelts, (int)timeout); #else ret = poll(pollset->p->pollset, pollset->nelts, timeout); diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c index e01006b38a4..ca98125204e 100644 --- a/poll/unix/pollcb.c +++ b/poll/unix/pollcb.c @@ -156,6 +156,9 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **ret_pollcb, } pollcb->provider = provider; } + else if (rv != APR_SUCCESS) { + return rv; + } if (flags & APR_POLLSET_WAKEABLE) { /* Create wakeup pipe */ diff --git a/poll/unix/port.c b/poll/unix/port.c index 8f14488bd16..ee770097006 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -188,12 +188,20 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, { int flags; - if ((flags = fcntl(pollset->p->port_fd, F_GETFD)) == -1) - return errno; + if ((flags = fcntl(pollset->p->port_fd, F_GETFD)) == -1) { + rv = errno; + close(pollset->p->port_fd); + pollset->p = NULL; + return rv; + } flags |= FD_CLOEXEC; - if (fcntl(pollset->p->port_fd, F_SETFD, flags) == -1) - return errno; + if (fcntl(pollset->p->port_fd, F_SETFD, flags) == -1) { + rv = errno; + close(pollset->p->port_fd); + pollset->p = NULL; + return rv; + } } pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); @@ -477,13 +485,22 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, { int flags; + apr_status_t rv; - if ((flags = fcntl(pollcb->fd, F_GETFD)) == -1) - return errno; + if ((flags = fcntl(pollcb->fd, F_GETFD)) == -1) { + rv = errno; + close(pollcb->fd); + pollcb->fd = -1; + return rv; + } flags |= FD_CLOEXEC; - if (fcntl(pollcb->fd, F_SETFD, flags) == -1) - return errno; + if (fcntl(pollcb->fd, F_SETFD, flags) == -1) { + rv = errno; + close(pollcb->fd); + pollcb->fd = -1; + return rv; + } } pollcb->pollset.port = apr_palloc(p, size * sizeof(port_event_t)); diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index d2df69638ad..7e0fd89a549 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -272,7 +272,7 @@ static apr_status_t asio_pollset_create(apr_pollset_t *pollset, APR_THREAD_MUTEX_DEFAULT, p) != APR_SUCCESS) { DBG1(1, "apr_thread_mutex_create returned %d\n", rv); - pollset = NULL; + pollset->p = NULL; return rv; } rv = msgget(IPC_PRIVATE, S_IWUSR+S_IRUSR); /* user r/w perms */ @@ -280,7 +280,7 @@ static apr_status_t asio_pollset_create(apr_pollset_t *pollset, #if DEBUG perror(__FUNCTION__ " msgget returned < 0 "); #endif - pollset = NULL; + pollset->p = NULL; return rv; } @@ -292,7 +292,7 @@ static apr_status_t asio_pollset_create(apr_pollset_t *pollset, APR_RING_INIT(&priv->prior_ready_ring, asio_elem_t, link); #else /* APR doesn't have threads but caller wants a threadsafe pollset */ - pollset = NULL; + pollset->p = NULL; return APR_ENOTIMPL; #endif @@ -304,6 +304,7 @@ static apr_status_t asio_pollset_create(apr_pollset_t *pollset, priv->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); if ((!priv->pollset) || (!priv->query_set)) { + pollset->p = NULL; return APR_ENOMEM; } } @@ -314,6 +315,10 @@ static apr_status_t asio_pollset_create(apr_pollset_t *pollset, priv->size = size; priv->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); if (!priv->result_set) { + if (flags & APR_POLLSET_THREADSAFE) { + msgctl(priv->msg_q, IPC_RMID, NULL); + } + pollset->p = NULL; return APR_ENOMEM; } From ec9485a99dc018a6ca3e125919b7399fbff15667 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 13 Mar 2015 11:57:26 +0000 Subject: [PATCH 7492/7878] skiplist: restore back add-if-not-exist semantic to apr_skiplist_insert(), and hence add-next-to-any-existing semantic to apr_skiplist_add(), getting rid of apr_skiplist_addne(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1666411 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_skiplist.h | 28 +++++++++++++-------------- tables/apr_skiplist.c | 36 +++++++++++++++++----------------- test/testskiplist.c | 44 +++++++++++++++++++++--------------------- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h index 8ea17a9be14..a4e20bdf2ee 100644 --- a/include/apr_skiplist.h +++ b/include/apr_skiplist.h @@ -178,7 +178,7 @@ APR_DECLARE(void *) apr_skiplist_element(apr_skiplistnode *iter); /** * Insert an element into the skip list using the specified comparison function - * allowing for duplicates. + * if it does not already exist. * @param sl The skip list * @param data The element to insert * @param comp The comparison function to use for placement into the skip list @@ -187,34 +187,34 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, void *data, apr_skiplist_compare comp); /** - * Add an element into the skip list using the specified comparison function + * Insert an element into the skip list using the existing comparison function * if it does not already exist. * @param sl The skip list - * @param data The element to add - * @param comp The comparison function to use for placement into the skip list + * @param data The element to insert + * @remark If no comparison function has been set for the skip list, the element + * will not be inserted and NULL will be returned. */ -APR_DECLARE(apr_skiplistnode *) apr_skiplist_addne_compare(apr_skiplist *sl, - void *data, apr_skiplist_compare comp); +APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist* sl, void *data); /** - * Add an element into the skip list using the existing comparison function - * if it does not already exist. + * Add an element into the skip list using the specified comparison function + * allowing for duplicates. * @param sl The skip list - * @param data The element to insert - * @remark If no comparison function has been set for the skip list, the element - * will not be inserted and NULL will be returned. + * @param data The element to add + * @param comp The comparison function to use for placement into the skip list */ -APR_DECLARE(apr_skiplistnode *) apr_skiplist_addne(apr_skiplist* sl, void *data); +APR_DECLARE(apr_skiplistnode *) apr_skiplist_add_compare(apr_skiplist *sl, + void *data, apr_skiplist_compare comp); /** - * Insert an element into the skip list using the existing comparison function + * Add an element into the skip list using the existing comparison function * allowing for duplicates. * @param sl The skip list * @param data The element to insert * @remark If no comparison function has been set for the skip list, the element * will not be inserted and NULL will be returned. */ -APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist* sl, void *data); +APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist* sl, void *data); /** * Remove an element from the skip list using the specified comparison function for diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 2734fbad589..3bcc38b7ab8 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -517,37 +517,29 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, void *data, apr_skiplist_compare comp) { - return insert_compare(sl, data, comp, 1); -} - -APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist *sl, void *data) -{ - if (!sl->compare) { + if (!comp) { return NULL; } - return insert_compare(sl, data, sl->compare, 1); + return insert_compare(sl, data, comp, 0); } -APR_DECLARE(apr_skiplistnode *) apr_skiplist_addne_compare(apr_skiplist *sl, void *data, - apr_skiplist_compare comp) +APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist *sl, void *data) { - return insert_compare(sl, data, comp, 0); + return apr_skiplist_insert_compare(sl, data, sl->compare); } -APR_DECLARE(apr_skiplistnode *) apr_skiplist_addne(apr_skiplist *sl, void *data) +APR_DECLARE(apr_skiplistnode *) apr_skiplist_add_compare(apr_skiplist *sl, void *data, + apr_skiplist_compare comp) { - if (!sl->compare) { + if (!comp) { return NULL; } - return insert_compare(sl, data, sl->compare, 0); + return insert_compare(sl, data, comp, 1); } -APR_DECLARE(int) apr_skiplist_remove(apr_skiplist *sl, void *data, apr_skiplist_freefunc myfree) +APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist *sl, void *data) { - if (!sl->compare) { - return 0; - } - return apr_skiplist_remove_compare(sl, data, myfree, sl->comparek); + return apr_skiplist_add_compare(sl, data, sl->compare); } #if 0 @@ -618,6 +610,9 @@ APR_DECLARE(int) apr_skiplist_remove_compare(apr_skiplist *sli, { apr_skiplistnode *m; apr_skiplist *sl; + if (!comp) { + return 0; + } if (comp == sli->comparek || !sli->index) { sl = sli; } @@ -638,6 +633,11 @@ APR_DECLARE(int) apr_skiplist_remove_compare(apr_skiplist *sli, return skiplisti_remove(sl, m, myfree); } +APR_DECLARE(int) apr_skiplist_remove(apr_skiplist *sl, void *data, apr_skiplist_freefunc myfree) +{ + return apr_skiplist_remove_compare(sl, data, myfree, sl->comparek); +} + APR_DECLARE(void) apr_skiplist_remove_all(apr_skiplist *sl, apr_skiplist_freefunc myfree) { /* diff --git a/test/testskiplist.c b/test/testskiplist.c index 59f16d91fdc..9ee3fffe68f 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -58,7 +58,7 @@ static void skiplist_find(abts_case *tc, void *data) { const char *val; - apr_skiplist_addne(skiplist, "baton"); + apr_skiplist_insert(skiplist, "baton"); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); @@ -72,13 +72,13 @@ static void skiplist_dontfind(abts_case *tc, void *data) ABTS_PTR_EQUAL(tc, NULL, (void *)val); } -static void skiplist_addne(abts_case *tc, void *data) +static void skiplist_insert(abts_case *tc, void *data) { const char *val; int i, height = 0; for (i = 0; i < 10; ++i) { - apr_skiplist_addne(skiplist, "baton"); + apr_skiplist_insert(skiplist, "baton"); ABTS_TRUE(tc, 1 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); @@ -92,48 +92,48 @@ static void skiplist_addne(abts_case *tc, void *data) } } - apr_skiplist_addne(skiplist, "foo"); + apr_skiplist_insert(skiplist, "foo"); ABTS_TRUE(tc, 2 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "foo", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "foo", val); - apr_skiplist_addne(skiplist, "atfirst"); + apr_skiplist_insert(skiplist, "atfirst"); ABTS_TRUE(tc, 3 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "atfirst", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "atfirst", val); } -static void skiplist_insert(abts_case *tc, void *data) +static void skiplist_add(abts_case *tc, void *data) { const char *val; size_t i, n = skiplist_get_size(tc, skiplist); for (i = 0; i < 100; ++i) { n++; - apr_skiplist_insert(skiplist, "daton"); + apr_skiplist_add(skiplist, "daton"); ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "daton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "daton", val); n++; - apr_skiplist_insert(skiplist, "baton"); + apr_skiplist_add(skiplist, "baton"); ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); n++; - apr_skiplist_insert(skiplist, "caton"); + apr_skiplist_add(skiplist, "caton"); ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "caton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "caton", val); n++; - apr_skiplist_insert(skiplist, "aaton"); + apr_skiplist_add(skiplist, "aaton"); ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "aaton", NULL); ABTS_PTR_NOTNULL(tc, val); @@ -153,9 +153,9 @@ static void skiplist_size(abts_case *tc, void *data) ABTS_TRUE(tc, 0 == skiplist_get_size(tc, skiplist)); - apr_skiplist_addne(skiplist, "abc"); - apr_skiplist_addne(skiplist, "ghi"); - apr_skiplist_addne(skiplist, "def"); + apr_skiplist_insert(skiplist, "abc"); + apr_skiplist_insert(skiplist, "ghi"); + apr_skiplist_insert(skiplist, "def"); val = apr_skiplist_find(skiplist, "abc", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "abc", val); @@ -176,13 +176,13 @@ static void skiplist_remove(abts_case *tc, void *data) ABTS_TRUE(tc, 0 == skiplist_get_size(tc, skiplist)); - apr_skiplist_insert(skiplist, "baton"); + apr_skiplist_add(skiplist, "baton"); ABTS_TRUE(tc, 1 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); - apr_skiplist_insert(skiplist, "baton"); + apr_skiplist_add(skiplist, "baton"); ABTS_TRUE(tc, 2 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); @@ -194,7 +194,7 @@ static void skiplist_remove(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); - apr_skiplist_insert(skiplist, "baton"); + apr_skiplist_add(skiplist, "baton"); ABTS_TRUE(tc, 2 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); @@ -231,7 +231,7 @@ static void skiplist_random_loop(abts_case *tc, void *data) else { batons[i] = apr_pstrdup(ptmp, batons[i % NUM_RAND]); } - apr_skiplist_insert(sl, batons[i]); + apr_skiplist_add(sl, batons[i]); val = apr_skiplist_find(sl, batons[i], NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, batons[i], val); @@ -249,13 +249,13 @@ typedef struct elem { static void add_int_to_skiplist(apr_skiplist *list, int n){ int* a = apr_skiplist_alloc(list, sizeof(int)); *a = n; - apr_skiplist_insert(list, a); + apr_skiplist_add(list, a); } static void add_elem_to_skiplist(apr_skiplist *list, elem n){ elem* a = apr_skiplist_alloc(list, sizeof(elem)); *a = n; - apr_skiplist_insert(list, a); + apr_skiplist_add(list, a); } static int comp(void *a, void *b){ @@ -325,10 +325,10 @@ static void skiplist_test(abts_case *tc, void *data) { val = apr_skiplist_pop(list, NULL); ABTS_PTR_EQUAL(tc, val, NULL); - apr_skiplist_insert(list, &first_forty_two); + apr_skiplist_add(list, &first_forty_two); add_int_to_skiplist(list, 1); add_int_to_skiplist(list, 142); - apr_skiplist_insert(list, &second_forty_two); + apr_skiplist_add(list, &second_forty_two); val = apr_skiplist_peek(list); ABTS_INT_EQUAL(tc, *val, 1); val = apr_skiplist_pop(list, NULL); @@ -381,8 +381,8 @@ abts_suite *testskiplist(abts_suite *suite) abts_run_test(suite, skiplist_init, NULL); abts_run_test(suite, skiplist_find, NULL); abts_run_test(suite, skiplist_dontfind, NULL); - abts_run_test(suite, skiplist_addne, NULL); abts_run_test(suite, skiplist_insert, NULL); + abts_run_test(suite, skiplist_add, NULL); abts_run_test(suite, skiplist_destroy, NULL); abts_run_test(suite, skiplist_size, NULL); abts_run_test(suite, skiplist_remove, NULL); From 2bad7eb1ba6b2d9bf3e848acd09bb2035f026c97 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 13 Mar 2015 14:11:41 +0000 Subject: [PATCH 7493/7878] skiplist: check NULL compare function in apr_skiplist_find_compare() instead of apr_skiplist_find() so that both functions act the same way in this case, like insert[_compare]() and remove[_compare](). Rearrange apr_skiplist_find() after apr_skiplist_find_compare() (still like others, the former calling the latter), and also move apr_skiplist_getlist() near to apr_skiplist_{next,previous}(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1666458 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 3bcc38b7ab8..6ceb7df9dd6 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -298,22 +298,6 @@ APR_DECLARE(void) apr_skiplist_add_index(apr_skiplist *sl, } } -APR_DECLARE(apr_skiplistnode *) apr_skiplist_getlist(apr_skiplist *sl) -{ - if (!sl->bottom) { - return NULL; - } - return sl->bottom->next; -} - -APR_DECLARE(void *) apr_skiplist_find(apr_skiplist *sl, void *data, apr_skiplistnode **iter) -{ - if (!sl->compare) { - return NULL; - } - return apr_skiplist_find_compare(sl, data, iter, sl->compare); -} - static int skiplisti_find_compare(apr_skiplist *sl, void *data, apr_skiplistnode **ret, apr_skiplist_compare comp) @@ -351,6 +335,12 @@ APR_DECLARE(void *) apr_skiplist_find_compare(apr_skiplist *sli, void *data, { apr_skiplistnode *m; apr_skiplist *sl; + if (!comp) { + if (iter) { + *iter = NULL; + } + return NULL; + } if (comp == sli->compare || !sli->index) { sl = sli; } @@ -371,6 +361,19 @@ APR_DECLARE(void *) apr_skiplist_find_compare(apr_skiplist *sli, void *data, return (m) ? m->data : NULL; } +APR_DECLARE(void *) apr_skiplist_find(apr_skiplist *sl, void *data, apr_skiplistnode **iter) +{ + return apr_skiplist_find_compare(sl, data, iter, sl->compare); +} + + +APR_DECLARE(apr_skiplistnode *) apr_skiplist_getlist(apr_skiplist *sl) +{ + if (!sl->bottom) { + return NULL; + } + return sl->bottom->next; +} APR_DECLARE(void *) apr_skiplist_next(apr_skiplist *sl, apr_skiplistnode **iter) { From c1470ab21b4523f69fd4d3a9ae48627ba55b2254 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 13 Mar 2015 22:53:19 +0000 Subject: [PATCH 7494/7878] skiplist: sync tests with 1.5.x. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1666602 13f79535-47bb-0310-9956-ffa450edef68 --- test/testskiplist.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testskiplist.c b/test/testskiplist.c index 9ee3fffe68f..1f53a40ba9f 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -249,17 +249,17 @@ typedef struct elem { static void add_int_to_skiplist(apr_skiplist *list, int n){ int* a = apr_skiplist_alloc(list, sizeof(int)); *a = n; - apr_skiplist_add(list, a); + apr_skiplist_insert(list, a); } static void add_elem_to_skiplist(apr_skiplist *list, elem n){ elem* a = apr_skiplist_alloc(list, sizeof(elem)); *a = n; - apr_skiplist_add(list, a); + apr_skiplist_insert(list, a); } static int comp(void *a, void *b){ - return *((int*) a) - *((int*) b); + return (*((int*) a) < *((int*) b)) ? -1 : 1; } static int compk(void *a, void *b){ @@ -267,7 +267,7 @@ static int compk(void *a, void *b){ } static int scomp(void *a, void *b){ - return ((elem*) a)->a - ((elem*) b)->a; + return (((elem*) a)->a < ((elem*) b)->a) ? -1 : 1; } static int scompk(void *a, void *b){ From 6529ebc5ab82b221252f4c60fc94c57c48063039 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 13 Mar 2015 23:21:50 +0000 Subject: [PATCH 7495/7878] testskiplist: revert r1666602. We want to test the real apr_skiplist_add() in trunk. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1666605 13f79535-47bb-0310-9956-ffa450edef68 --- test/testskiplist.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testskiplist.c b/test/testskiplist.c index 1f53a40ba9f..9ee3fffe68f 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -249,17 +249,17 @@ typedef struct elem { static void add_int_to_skiplist(apr_skiplist *list, int n){ int* a = apr_skiplist_alloc(list, sizeof(int)); *a = n; - apr_skiplist_insert(list, a); + apr_skiplist_add(list, a); } static void add_elem_to_skiplist(apr_skiplist *list, elem n){ elem* a = apr_skiplist_alloc(list, sizeof(elem)); *a = n; - apr_skiplist_insert(list, a); + apr_skiplist_add(list, a); } static int comp(void *a, void *b){ - return (*((int*) a) < *((int*) b)) ? -1 : 1; + return *((int*) a) - *((int*) b); } static int compk(void *a, void *b){ @@ -267,7 +267,7 @@ static int compk(void *a, void *b){ } static int scomp(void *a, void *b){ - return (((elem*) a)->a < ((elem*) b)->a) ? -1 : 1; + return ((elem*) a)->a - ((elem*) b)->a; } static int scompk(void *a, void *b){ From f8365da9f51f5f8100d244362bfef7ec076274a2 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 13 Mar 2015 23:46:58 +0000 Subject: [PATCH 7496/7878] testskiplist: Add a test to show that comparek == compare is required for apr_skiplist_remove() and apr_skiplist_find() to work. It also shows that a single compare function can be used for add semantic with apr_skiplist_insert() (and unique pointers). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1666611 13f79535-47bb-0310-9956-ffa450edef68 --- test/testskiplist.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/test/testskiplist.c b/test/testskiplist.c index 9ee3fffe68f..59f76e2216b 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -241,8 +241,8 @@ static void skiplist_random_loop(abts_case *tc, void *data) } typedef struct elem { - int a; int b; + int a; } elem; @@ -262,16 +262,17 @@ static int comp(void *a, void *b){ return *((int*) a) - *((int*) b); } -static int compk(void *a, void *b){ - return comp(a, b); -} - static int scomp(void *a, void *b){ return ((elem*) a)->a - ((elem*) b)->a; } -static int scompk(void *a, void *b){ - return scomp(a, b); +static int acomp(void *a, void *b){ + if (a != b) { + return (scomp(a, b) < 0) ? -1 : 1; + } + else { + return 0; + } } static void skiplist_test(abts_case *tc, void *data) { @@ -281,6 +282,7 @@ static void skiplist_test(abts_case *tc, void *data) { elem *val2 = NULL; apr_skiplist * list = NULL; apr_skiplist * list2 = NULL; + apr_skiplist * list3 = NULL; int first_forty_two = 42, second_forty_two = 42; elem t1, t2, t3, t4, t5; @@ -291,7 +293,7 @@ static void skiplist_test(abts_case *tc, void *data) { t5.a = 142; t5.b = 1; ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&list, ptmp)); - apr_skiplist_set_compare(list, comp, compk); + apr_skiplist_set_compare(list, comp, comp); /* insert 10 objects */ for (i = 0; i < test_elems; ++i){ @@ -346,7 +348,7 @@ static void skiplist_test(abts_case *tc, void *data) { ABTS_INT_EQUAL(tc, *val, 142); ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&list2, ptmp)); - apr_skiplist_set_compare(list2, scomp, scompk); + apr_skiplist_set_compare(list2, scomp, scomp); add_elem_to_skiplist(list2, t2); add_elem_to_skiplist(list2, t1); add_elem_to_skiplist(list2, t3); @@ -367,6 +369,20 @@ static void skiplist_test(abts_case *tc, void *data) { ABTS_INT_EQUAL(tc, val2->a, 142); ABTS_INT_EQUAL(tc, val2->b, 1); + ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&list3, ptmp)); + apr_skiplist_set_compare(list3, acomp, acomp); + apr_skiplist_insert(list3, &t2); + val2 = apr_skiplist_find(list3, &t2, NULL); + ABTS_PTR_EQUAL(tc, &t2, val2); + apr_skiplist_insert(list3, &t3); + val2 = apr_skiplist_find(list3, &t3, NULL); + ABTS_PTR_EQUAL(tc, &t3, val2); + apr_skiplist_remove(list3, &t3, NULL); + val2 = apr_skiplist_find(list3, &t3, NULL); + ABTS_PTR_EQUAL(tc, NULL, val2); + apr_skiplist_remove(list3, &t2, NULL); + val2 = apr_skiplist_find(list3, &t2, NULL); + ABTS_PTR_EQUAL(tc, NULL, val2); apr_pool_clear(ptmp); } From 54782eec349101f8071e446e7cad7a8cdff36dc8 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 15 Mar 2015 15:52:38 +0000 Subject: [PATCH 7497/7878] Add some release dates. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1666811 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 9dc9f5d6730..da2cb980f5c 100644 --- a/STATUS +++ b/STATUS @@ -29,7 +29,7 @@ Releases: 2.0.0 : in development on trunk/ 1.5.0 : in development on branches/1.5.x/ 1.4.3 : in development on branches/1.4.x/ - 1.4.2 : tagged January 20, 2010 + 1.4.2 : released April 3, 2010 1.4.1 : not released 1.4.0 : not released 1.3.9 : released September 23, 2009 @@ -45,7 +45,7 @@ Releases: 1.2.12 : released November 25, 2007 1.2.11 : released September 6, 2007 1.2.10 : not released - 1.2.9 : tagged June 4, 2007 + 1.2.9 : released June 7, 2007 1.2.8 : released December 4, 2006 1.2.7 : released April 14, 2006 1.2.6 : released March 25, 2006 @@ -64,7 +64,7 @@ Releases: 0.9.17 : released November 25, 2007 0.9.16 : released September 6, 2007 0.9.15 : not released - 0.9.14 : tagged June 4, 2007 + 0.9.14 : released June 7, 2007 0.9.13 : released December 4, 2006 0.9.12 : released April 13, 2006 0.9.11 : released March 30, 2006 From 85ca5e6343046ecfbd0cf2ce822ac2b05bf22448 Mon Sep 17 00:00:00 2001 From: "Gregg L. Smith" Date: Mon, 16 Mar 2015 07:15:33 +0000 Subject: [PATCH 7498/7878] Add testescape to windows test git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1666877 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Makefile.win b/test/Makefile.win index 0b11c2ed991..0479a49078b 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -91,6 +91,7 @@ ALL_TESTS = \ $(INTDIR)\testdso.obj \ $(INTDIR)\testdup.obj \ $(INTDIR)\testenv.obj \ + $(INTDIR)\testescape.obj \ $(INTDIR)\testfile.obj \ $(INTDIR)\testfilecopy.obj \ $(INTDIR)\testfileinfo.obj \ From 1c977f816853b94956d017d653e40287a221394f Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 16 Mar 2015 17:18:11 +0000 Subject: [PATCH 7499/7878] apr_queue: Add apr_queue_timedpush() and apr_queue_timedpop() to support timedout operations. PR 56951. Submitted by: Travis Cross Reviewed/Modified: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667073 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++ include/apr_queue.h | 35 ++++++++++- test/testqueue.c | 50 ++++++++++++++++ util-misc/apr_queue.c | 135 ++++++++++++++++++------------------------ 4 files changed, 144 insertions(+), 80 deletions(-) diff --git a/CHANGES b/CHANGES index 4f37655c6b0..c778fac675b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_queue: Add apr_queue_timedpush() and apr_queue_timedpop() to + support timedout operations. PR 56951. [Travis Cross + , Yann Ylavic]. + *) apr_pollset: On z/OS, threadsafe apr_pollset_poll() may return "EDC8102I Operation would block" under load. [Pat Odonnell ] diff --git a/include/apr_queue.h b/include/apr_queue.h index 1d09e9de396..e345da5d453 100644 --- a/include/apr_queue.h +++ b/include/apr_queue.h @@ -28,6 +28,7 @@ #include "apu.h" #include "apr_errno.h" #include "apr_pools.h" +#include "apr_time.h" #if APR_HAS_THREADS @@ -91,7 +92,7 @@ APR_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data); APR_DECLARE(apr_status_t) apr_queue_trypush(apr_queue_t *queue, void *data); /** - * pop/get an object to the queue, returning immediately if the queue is empty + * pop/get an object from the queue, returning immediately if the queue is empty * * @param queue the queue * @param data the data @@ -102,6 +103,38 @@ APR_DECLARE(apr_status_t) apr_queue_trypush(apr_queue_t *queue, void *data); */ APR_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data); +/** + * push/add an object to the queue, waiting a maximum of timeout microseconds + * before returning if the queue is empty + * + * @param queue the queue + * @param data the data + * @param timeout the timeout + * @returns APR_EINTR the blocking operation was interrupted (try again) + * @returns APR_EAGAIN the queue is empty and timeout is 0 + * @returns APR_TIMEUP the queue is empty and the timeout expired + * @returns APR_EOF the queue has been terminated + * @returns APR_SUCCESS on a successful pop + */ +APR_DECLARE(apr_status_t) apr_queue_timedpush(apr_queue_t *queue, void *data, + apr_interval_time_t timeout); + +/** + * pop/get an object from the queue, waiting a maximum of timeout microseconds + * before returning if the queue is empty + * + * @param queue the queue + * @param data the data + * @param timeout the timeout + * @returns APR_EINTR the blocking operation was interrupted (try again) + * @returns APR_EAGAIN the queue is empty and timeout is 0 + * @returns APR_TIMEUP the queue is empty and the timeout expired + * @returns APR_EOF the queue has been terminated + * @returns APR_SUCCESS on a successful pop + */ +APR_DECLARE(apr_status_t) apr_queue_timedpop(apr_queue_t *queue, void **data, + apr_interval_time_t timeout); + /** * returns the size of the queue. * diff --git a/test/testqueue.c b/test/testqueue.c index 8f71775fda2..264e4d3a1cd 100644 --- a/test/testqueue.c +++ b/test/testqueue.c @@ -121,6 +121,55 @@ static void test_queue_producer_consumer(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } +static void test_queue_timeout(abts_case *tc, void *data) +{ + apr_queue_t *q; + apr_status_t rv; + apr_time_t start; + unsigned int i; + void *value; + + rv = apr_queue_create(&q, 5, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + for (i = 0; i < 2; ++i) { + rv = apr_queue_timedpush(q, NULL, apr_time_from_msec(1)); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + } + for (i = 0; i < 3; ++i) { + rv = apr_queue_trypush(q, NULL); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + } + + start = apr_time_now(); + rv = apr_queue_timedpush(q, NULL, apr_time_from_msec(1)); + ABTS_TRUE(tc, APR_STATUS_IS_TIMEUP(rv)); + ABTS_TRUE(tc, apr_time_now() - start >= apr_time_from_msec(1)); + + rv = apr_queue_trypush(q, NULL); + ABTS_TRUE(tc, APR_STATUS_IS_EAGAIN(rv)); + + for (i = 0; i < 2; ++i) { + rv = apr_queue_timedpop(q, &value, apr_time_from_msec(1)); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + } + for (i = 0; i < 3; ++i) { + rv = apr_queue_trypop(q, &value); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + } + + start = apr_time_now(); + rv = apr_queue_timedpop(q, &value, apr_time_from_sec(1)); + ABTS_TRUE(tc, APR_STATUS_IS_TIMEUP(rv)); + ABTS_TRUE(tc, apr_time_now() - start >= apr_time_from_msec(1)); + + rv = apr_queue_trypop(q, &value); + ABTS_TRUE(tc, APR_STATUS_IS_EAGAIN(rv)); + + rv = apr_queue_term(q); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); +} + #endif /* APR_HAS_THREADS */ abts_suite *testqueue(abts_suite *suite) @@ -129,6 +178,7 @@ abts_suite *testqueue(abts_suite *suite) #if APR_HAS_THREADS abts_run_test(suite, test_queue_producer_consumer, NULL); + abts_run_test(suite, test_queue_timeout, NULL); #endif /* APR_HAS_THREADS */ return suite; diff --git a/util-misc/apr_queue.c b/util-misc/apr_queue.c index 09724932915..dbc879b3544 100644 --- a/util-misc/apr_queue.c +++ b/util-misc/apr_queue.c @@ -145,7 +145,8 @@ APR_DECLARE(apr_status_t) apr_queue_create(apr_queue_t **q, * the push operation has completed, it signals other threads waiting * in apr_queue_pop() that they may continue consuming sockets. */ -APR_DECLARE(apr_status_t) apr_queue_push(apr_queue_t *queue, void *data) +static apr_status_t queue_push(apr_queue_t *queue, void *data, + apr_interval_time_t timeout) { apr_status_t rv; @@ -159,9 +160,21 @@ APR_DECLARE(apr_status_t) apr_queue_push(apr_queue_t *queue, void *data) } if (apr_queue_full(queue)) { + if (!timeout) { + apr_thread_mutex_unlock(queue->one_big_mutex); + return APR_EAGAIN; + } if (!queue->terminated) { queue->full_waiters++; - rv = apr_thread_cond_wait(queue->not_full, queue->one_big_mutex); + if (timeout > 0) { + rv = apr_thread_cond_timedwait(queue->not_full, + queue->one_big_mutex, + timeout); + } + else { + rv = apr_thread_cond_wait(queue->not_full, + queue->one_big_mutex); + } queue->full_waiters--; if (rv != APR_SUCCESS) { apr_thread_mutex_unlock(queue->one_big_mutex); @@ -203,6 +216,11 @@ APR_DECLARE(apr_status_t) apr_queue_push(apr_queue_t *queue, void *data) return rv; } +APR_DECLARE(apr_status_t) apr_queue_push(apr_queue_t *queue, void *data) +{ + return queue_push(queue, data, -1); +} + /** * Push new data onto the queue. If the queue is full, return APR_EAGAIN. If * the push operation completes successfully, it signals other threads @@ -210,42 +228,13 @@ APR_DECLARE(apr_status_t) apr_queue_push(apr_queue_t *queue, void *data) */ APR_DECLARE(apr_status_t) apr_queue_trypush(apr_queue_t *queue, void *data) { - apr_status_t rv; - - if (queue->terminated) { - return APR_EOF; /* no more elements ever again */ - } - - rv = apr_thread_mutex_lock(queue->one_big_mutex); - if (rv != APR_SUCCESS) { - return rv; - } - - if (apr_queue_full(queue)) { - rv = apr_thread_mutex_unlock(queue->one_big_mutex); - if (rv != APR_SUCCESS) { - return rv; - } - return APR_EAGAIN; - } - - queue->data[queue->in] = data; - queue->in++; - if (queue->in >= queue->bounds) - queue->in -= queue->bounds; - queue->nelts++; - - if (queue->empty_waiters) { - Q_DBG("sig !empty", queue); - rv = apr_thread_cond_signal(queue->not_empty); - if (rv != APR_SUCCESS) { - apr_thread_mutex_unlock(queue->one_big_mutex); - return rv; - } - } + return queue_push(queue, data, 0); +} - rv = apr_thread_mutex_unlock(queue->one_big_mutex); - return rv; +APR_DECLARE(apr_status_t) apr_queue_timedpush(apr_queue_t *queue, void *data, + apr_interval_time_t timeout) +{ + return queue_push(queue, data, timeout); } /** @@ -257,11 +246,13 @@ APR_DECLARE(unsigned int) apr_queue_size(apr_queue_t *queue) { /** * Retrieves the next item from the queue. If there are no - * items available, it will block until one becomes available. - * Once retrieved, the item is placed into the address specified by - * 'data'. + * items available, it will either return APR_EAGAIN (timeout = 0), + * or block until one becomes available (infinitely with timeout < 0, + * otherwise until the given timeout expires). Once retrieved, the + * item is placed into the address specified by 'data'. */ -APR_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data) +static apr_status_t queue_pop(apr_queue_t *queue, void **data, + apr_interval_time_t timeout) { apr_status_t rv; @@ -276,9 +267,21 @@ APR_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data) /* Keep waiting until we wake up and find that the queue is not empty. */ if (apr_queue_empty(queue)) { + if (!timeout) { + apr_thread_mutex_unlock(queue->one_big_mutex); + return APR_EAGAIN; + } if (!queue->terminated) { queue->empty_waiters++; - rv = apr_thread_cond_wait(queue->not_empty, queue->one_big_mutex); + if (timeout > 0) { + rv = apr_thread_cond_timedwait(queue->not_empty, + queue->one_big_mutex, + timeout); + } + else { + rv = apr_thread_cond_wait(queue->not_empty, + queue->one_big_mutex); + } queue->empty_waiters--; if (rv != APR_SUCCESS) { apr_thread_mutex_unlock(queue->one_big_mutex); @@ -320,46 +323,20 @@ APR_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data) return rv; } -/** - * Retrieves the next item from the queue. If there are no - * items available, return APR_EAGAIN. Once retrieved, - * the item is placed into the address specified by 'data'. - */ -APR_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data) +APR_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data) { - apr_status_t rv; - - if (queue->terminated) { - return APR_EOF; /* no more elements ever again */ - } - - rv = apr_thread_mutex_lock(queue->one_big_mutex); - if (rv != APR_SUCCESS) { - return rv; - } - - if (apr_queue_empty(queue)) { - (void)apr_thread_mutex_unlock(queue->one_big_mutex); - return APR_EAGAIN; - } - - *data = queue->data[queue->out]; - queue->nelts--; + return queue_pop(queue, data, -1); +} - queue->out++; - if (queue->out >= queue->bounds) - queue->out -= queue->bounds; - if (queue->full_waiters) { - Q_DBG("signal !full", queue); - rv = apr_thread_cond_signal(queue->not_full); - if (rv != APR_SUCCESS) { - apr_thread_mutex_unlock(queue->one_big_mutex); - return rv; - } - } +APR_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data) +{ + return queue_pop(queue, data, 0); +} - rv = apr_thread_mutex_unlock(queue->one_big_mutex); - return rv; +APR_DECLARE(apr_status_t) apr_queue_timedpop(apr_queue_t *queue, void **data, + apr_interval_time_t timeout) +{ + return queue_pop(queue, data, timeout); } APR_DECLARE(apr_status_t) apr_queue_interrupt_all(apr_queue_t *queue) From 125f440022bc9458e46272b5bc1e5c1e64fa7275 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 16 Mar 2015 17:24:04 +0000 Subject: [PATCH 7500/7878] apr_queue: follow up to r1667073. Correct author name of the original patch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667075 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index c778fac675b..1eb1661a674 100644 --- a/CHANGES +++ b/CHANGES @@ -2,8 +2,8 @@ Changes for APR 2.0.0 *) apr_queue: Add apr_queue_timedpush() and apr_queue_timedpop() to - support timedout operations. PR 56951. [Travis Cross - , Yann Ylavic]. + support timedout operations. PR 56951. [Anthony Minessale , Travis Cross , Yann Ylavic]. *) apr_pollset: On z/OS, threadsafe apr_pollset_poll() may return "EDC8102I Operation would block" under load. From b6007953997faff7d39fd40cbde33a473780b9de Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 17 Mar 2015 22:42:46 +0000 Subject: [PATCH 7501/7878] skiplist: Introduce apr_skiplist_replace[_compare](). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667420 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_skiplist.h | 28 ++++++++++++++- tables/apr_skiplist.c | 80 ++++++++++++++++++++++++++++++------------ test/testskiplist.c | 49 ++++++++++++++++++++++++-- 3 files changed, 131 insertions(+), 26 deletions(-) diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h index a4e20bdf2ee..1b5c8860518 100644 --- a/include/apr_skiplist.h +++ b/include/apr_skiplist.h @@ -216,12 +216,38 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_add_compare(apr_skiplist *sl, */ APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist* sl, void *data); +/** + * Add an element into the skip list using the specified comparison function + * removing the existing duplicates. + * @param sl The skip list + * @param data The element to insert + * @param comp The comparison function to use for placement into the skip list + * @param myfree A function to be called for each replaced element + * @remark If no comparison function has been set for the skip list, the element + * will not be inserted, none will be replaced, and NULL will be returned. + */ +APR_DECLARE(apr_skiplistnode *) apr_skiplist_replace_compare(apr_skiplist *sl, + void *data, apr_skiplist_freefunc myfree, + apr_skiplist_compare comp); + +/** + * Add an element into the skip list using the existing comparison function + * removing the existing duplicates. + * @param sl The skip list + * @param data The element to insert + * @param myfree A function to be called for each removed duplicate + * @remark If no comparison function has been set for the skip list, the element + * will not be inserted, none will be replaced, and NULL will be returned. + */ +APR_DECLARE(apr_skiplistnode *) apr_skiplist_replace(apr_skiplist *sl, + void *data, apr_skiplist_freefunc myfree); + /** * Remove an element from the skip list using the specified comparison function for * locating the element. In the case of duplicates, the 1st entry will be removed. * @param sl The skip list * @param data The element to remove - * @param myfree A function to be called for each removed element + * @param myfree A function to be called for each removed duplicate * @param comp The comparison function to use for placement into the skip list * @remark If the element is not found, 0 will be returned. Otherwise, the heightXXX * will be returned. diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 6ceb7df9dd6..e053c56e3bb 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -201,7 +201,7 @@ static apr_skiplistnode *skiplist_new_node(apr_skiplist *sl) return m; } -static apr_status_t skiplist_free_node(apr_skiplist *sl, apr_skiplistnode *m) +static apr_status_t skiplist_put_node(apr_skiplist *sl, apr_skiplistnode *m) { return skiplist_qpush(&sl->nodes_q, m); } @@ -304,8 +304,7 @@ static int skiplisti_find_compare(apr_skiplist *sl, void *data, { int count = 0; apr_skiplistnode *m; - m = sl->top; - while (m) { + for (m = sl->top; m; count++) { if (m->next) { int compared = comp(data, m->next->data); if (compared == 0) { @@ -318,12 +317,10 @@ static int skiplisti_find_compare(apr_skiplist *sl, void *data, } if (compared > 0) { m = m->next; - count++; continue; } } m = m->down; - count++; } *ret = NULL; return count; @@ -398,11 +395,16 @@ APR_DECLARE(void *) apr_skiplist_element(apr_skiplistnode *node) return node->data; } +/* forward declared */ +static int skiplisti_remove(apr_skiplist *sl, apr_skiplistnode *m, + apr_skiplist_freefunc myfree); + static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, - apr_skiplist_compare comp, int add) + apr_skiplist_compare comp, int add, + apr_skiplist_freefunc myfree) { apr_skiplistnode *m, *p, *tmp, *ret = NULL; - int nh = 1, ch; + int ch, nh = 1; if (sl->preheight) { while (nh < sl->preheight && get_b_rand()) { @@ -431,10 +433,26 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, */ if (m->next) { int compared = comp(data, m->next->data); - if (compared == 0 && !add) { - /* Keep the existing element(s) */ - skiplist_qclear(&sl->stack_q); - return NULL; + if (compared == 0) { + if (!add) { + /* Keep the existing element(s) */ + skiplist_qclear(&sl->stack_q); + return NULL; + } + if (add < 0) { + /* Remove this element and continue with the next node + * or the new top if the current one is also removed. + */ + apr_skiplistnode *top = sl->top; + skiplisti_remove(sl, m->next, myfree); + if (top != sl->top) { + m = sl->top; + skiplist_qclear(&sl->stack_q); + ch = sl->height; + nh = ch + 1; + } + continue; + } } if (compared >= 0) { m = m->next; @@ -507,7 +525,7 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, li = ret; for (p = apr_skiplist_getlist(sl->index); p; apr_skiplist_next(sl->index, &p)) { apr_skiplist *sli = (apr_skiplist *)p->data; - ni = insert_compare(sli, ret->data, sli->compare, add); + ni = insert_compare(sli, ret->data, sli->compare, add, myfree); li->nextindex = ni; ni->previndex = li; li = ni; @@ -523,7 +541,7 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, vo if (!comp) { return NULL; } - return insert_compare(sl, data, comp, 0); + return insert_compare(sl, data, comp, 0, NULL); } APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist *sl, void *data) @@ -537,7 +555,7 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_add_compare(apr_skiplist *sl, void if (!comp) { return NULL; } - return insert_compare(sl, data, comp, 1); + return insert_compare(sl, data, comp, 1, NULL); } APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist *sl, void *data) @@ -545,6 +563,22 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist *sl, void *data) return apr_skiplist_add_compare(sl, data, sl->compare); } +APR_DECLARE(apr_skiplistnode *) apr_skiplist_replace_compare(apr_skiplist *sl, + void *data, apr_skiplist_freefunc myfree, + apr_skiplist_compare comp) +{ + if (!comp) { + return NULL; + } + return insert_compare(sl, data, comp, -1, myfree); +} + +APR_DECLARE(apr_skiplistnode *) apr_skiplist_replace(apr_skiplist *sl, + void *data, apr_skiplist_freefunc myfree) +{ + return apr_skiplist_replace_compare(sl, data, myfree, sl->compare); +} + #if 0 void skiplist_print_struct(apr_skiplist * sl, char *prefix) { @@ -564,7 +598,8 @@ void skiplist_print_struct(apr_skiplist * sl, char *prefix) } #endif -static int skiplisti_remove(apr_skiplist *sl, apr_skiplistnode *m, apr_skiplist_freefunc myfree) +static int skiplisti_remove(apr_skiplist *sl, apr_skiplistnode *m, + apr_skiplist_freefunc myfree) { apr_skiplistnode *p; if (!m) { @@ -576,19 +611,20 @@ static int skiplisti_remove(apr_skiplist *sl, apr_skiplistnode *m, apr_skiplist_ while (m->up) { m = m->up; } - while (m) { + do { p = m; - p->prev->next = p->next;/* take me out of the list */ + /* take me out of the list */ + p->prev->next = p->next; if (p->next) { - p->next->prev = p->prev; /* take me out of the list */ + p->next->prev = p->prev; } m = m->down; /* This only frees the actual data in the bottom one */ if (!m && myfree && p->data) { myfree(p->data); } - skiplist_free_node(sl, p); - } + skiplist_put_node(sl, p); + } while (m); sl->size--; while (sl->top && sl->top->next == NULL) { /* While the row is empty and we are not on the bottom row */ @@ -597,7 +633,7 @@ static int skiplisti_remove(apr_skiplist *sl, apr_skiplistnode *m, apr_skiplist_ if (sl->top) { sl->top->up = NULL; /* Make it think its the top */ } - skiplist_free_node(sl, p); + skiplist_put_node(sl, p); sl->height--; } if (!sl->top) { @@ -657,7 +693,7 @@ APR_DECLARE(void) apr_skiplist_remove_all(apr_skiplist *sl, apr_skiplist_freefun } do { u = m->up; - skiplist_free_node(sl, m); + skiplist_put_node(sl, m); m = u; } while (m); m = p; diff --git a/test/testskiplist.c b/test/testskiplist.c index 59f76e2216b..5f5b77c6a91 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -105,12 +105,16 @@ static void skiplist_insert(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "atfirst", val); } +#define NUM_ADDS 100 static void skiplist_add(abts_case *tc, void *data) { const char *val; - size_t i, n = skiplist_get_size(tc, skiplist); + size_t i, n = 0; - for (i = 0; i < 100; ++i) { + apr_skiplist_remove_all(skiplist, NULL); + ABTS_TRUE(tc, 0 == skiplist_get_size(tc, skiplist)); + + for (i = 0; i < NUM_ADDS; ++i) { n++; apr_skiplist_add(skiplist, "daton"); ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); @@ -141,10 +145,48 @@ static void skiplist_add(abts_case *tc, void *data) } } +static void skiplist_replace(abts_case *tc, void *data) +{ + const char *val; + size_t n = skiplist_get_size(tc, skiplist); + + n -= NUM_ADDS - 1; + apr_skiplist_replace(skiplist, "daton", NULL); + ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); + val = apr_skiplist_find(skiplist, "daton", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "daton", val); + + n -= NUM_ADDS - 1; + apr_skiplist_replace(skiplist, "baton", NULL); + ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); + val = apr_skiplist_find(skiplist, "baton", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "baton", val); + + n -= NUM_ADDS - 1; + apr_skiplist_replace(skiplist, "caton", NULL); + ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); + val = apr_skiplist_find(skiplist, "caton", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "caton", val); + + n -= NUM_ADDS - 1; + apr_skiplist_replace(skiplist, "aaton", NULL); + ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); + val = apr_skiplist_find(skiplist, "aaton", NULL); + ABTS_PTR_NOTNULL(tc, val); + ABTS_STR_EQUAL(tc, "aaton", val); + + ABTS_TRUE(tc, n == 4); +} + static void skiplist_destroy(abts_case *tc, void *data) { apr_skiplist_destroy(skiplist, NULL); - ABTS_TRUE(tc, 0 == skiplist_get_size(tc, skiplist)); + ABTS_TRUE(tc, 0 == apr_skiplist_size(skiplist)); + ABTS_TRUE(tc, 0 == apr_skiplist_height(skiplist)); + ABTS_TRUE(tc, NULL == apr_skiplist_getlist(skiplist)); } static void skiplist_size(abts_case *tc, void *data) @@ -399,6 +441,7 @@ abts_suite *testskiplist(abts_suite *suite) abts_run_test(suite, skiplist_dontfind, NULL); abts_run_test(suite, skiplist_insert, NULL); abts_run_test(suite, skiplist_add, NULL); + abts_run_test(suite, skiplist_replace, NULL); abts_run_test(suite, skiplist_destroy, NULL); abts_run_test(suite, skiplist_size, NULL); abts_run_test(suite, skiplist_remove, NULL); From 07536b404292cb30d8ab9aea9ef50d4a1df92e66 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 17 Mar 2015 22:46:06 +0000 Subject: [PATCH 7502/7878] skiplist: follow up to r1667420: fix bad copy/paste in description. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667421 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_skiplist.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h index 1b5c8860518..b8528967415 100644 --- a/include/apr_skiplist.h +++ b/include/apr_skiplist.h @@ -222,7 +222,7 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_add(apr_skiplist* sl, void *data); * @param sl The skip list * @param data The element to insert * @param comp The comparison function to use for placement into the skip list - * @param myfree A function to be called for each replaced element + * @param myfree A function to be called for each removed duplicate * @remark If no comparison function has been set for the skip list, the element * will not be inserted, none will be replaced, and NULL will be returned. */ @@ -247,7 +247,7 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_replace(apr_skiplist *sl, * locating the element. In the case of duplicates, the 1st entry will be removed. * @param sl The skip list * @param data The element to remove - * @param myfree A function to be called for each removed duplicate + * @param myfree A function to be called for each removed element * @param comp The comparison function to use for placement into the skip list * @remark If the element is not found, 0 will be returned. Otherwise, the heightXXX * will be returned. From 67c9f2798557598d61de0a27a6956c93667ddd66 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 17 Mar 2015 23:00:08 +0000 Subject: [PATCH 7503/7878] skiplist: follow up to r1667420: add to the index (never replace). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667423 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index e053c56e3bb..a8794c069ab 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -525,7 +525,7 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, li = ret; for (p = apr_skiplist_getlist(sl->index); p; apr_skiplist_next(sl->index, &p)) { apr_skiplist *sli = (apr_skiplist *)p->data; - ni = insert_compare(sli, ret->data, sli->compare, add, myfree); + ni = insert_compare(sli, ret->data, sli->compare, 1, NULL); li->nextindex = ni; ni->previndex = li; li = ni; From a3a6669b7221a4b40328bab7c48ece0145b9ce1e Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 19 Mar 2015 23:38:38 +0000 Subject: [PATCH 7504/7878] locks: introduce apr_{thread,proc,global}_mutex_timedlock(). For proc mutexes, the new mechanism APR_LOCK_DEFAULT_TIMED usable at creation time allows for the best mechanism to be elected (unixes: 1 to 3, or specific: 4 to 7): 1. PROC_PTHREAD if pthread_mutex_timedlock() and pthread_mutex_set_robust_np() are both available, 2. SYSV if semtimedop() is availale, 3. POSIXSEM if sem_timedwait() is available, 4. BeOS' acquire_sem_etc() if available, 5. NetWare falls back to apr_thread_mutex_timedlock() as for others functions, 6. OS2's DosRequestMutexSem(), 7. Windows' WaitForSingleObject(). Otherwise (like when fcntl and flock only are availble, if that's ever possible), APR_ENOTIMPL is returned. For thread mutexes, the new flag APR_THREAD_MUTEX_TIMED, usable at create() time still, allows to switch to an implementation using a condition variable and apr_thread_cond_timedwait() when if no native mechanism is available (eg. NetWare, pthreads but without pthread_mutex_timedlock() available). On windows, this initializes a WaitForSingleObject()able handle (Mutex) instead of the fastest (but not timeout-able) CRITICAL_SECTION used by default. All apr_{thread,proc,global}_mutex_timedlock() functions can take a relative or absolute time, thanks to the last (boolean) argument. Test suite updated accordingly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667900 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 26 ++- include/apr_global_mutex.h | 13 ++ include/apr_proc_mutex.h | 15 +- include/apr_thread_mutex.h | 13 ++ include/apr_time.h | 4 +- include/arch/netware/apr_arch_thread_mutex.h | 3 + include/arch/unix/apr_arch_proc_mutex.h | 2 + include/arch/unix/apr_arch_thread_mutex.h | 3 + locks/beos/proc_mutex.c | 81 ++++++-- locks/beos/thread_cond.c | 2 +- locks/beos/thread_mutex.c | 95 +++++++-- locks/netware/proc_mutex.c | 26 ++- locks/netware/thread_mutex.c | 104 +++++++++- locks/os2/proc_mutex.c | 33 +++- locks/os2/thread_mutex.c | 26 +++ locks/unix/global_mutex.c | 32 +++ locks/unix/proc_mutex.c | 135 +++++++++++++ locks/unix/thread_mutex.c | 194 ++++++++++++++++++- locks/win32/proc_mutex.c | 27 +++ locks/win32/thread_mutex.c | 38 +++- test/abts_tests.h | 2 + test/testglobalmutex.c | 3 + test/testlock.c | 73 ++++++- test/testlockperf.c | 64 +++++- test/testmutexscope.c | 37 ++-- test/testprocmutex.c | 119 ++++++++---- 26 files changed, 1063 insertions(+), 107 deletions(-) diff --git a/configure.in b/configure.in index d6831aa04c6..fefb8897084 100644 --- a/configure.in +++ b/configure.in @@ -2057,10 +2057,17 @@ dnl ----------------------------- Checking for Locking Characteristics AC_MSG_NOTICE([]) AC_MSG_NOTICE([Checking for Locking...]) -AC_CHECK_FUNCS(semget semctl flock) -AC_CHECK_HEADERS(semaphore.h OS.h) +AC_CHECK_FUNCS(semget semctl semop semtimedop flock) +APR_IFALLYES(func:semtimedop, have_semtimedop="1", have_semtimedop="0") + +AC_CHECK_HEADERS(semaphore.h) AC_SEARCH_LIBS(sem_open, rt) -AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait create_sem) +AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait sem_timedwait) +APR_IFALLYES(func:sem_timedwait, have_sem_timedwait="1", have_sem_timedwait="0") + +AC_CHECK_HEADERS(OS.h) +AC_CHECK_FUNCS(create_sem acquire_sem acquire_sem_etc) +APR_IFALLYES(header:OS.h func:acquire_sem_etc, have_acquire_sem_etc="1", have_acquire_sem_etc="0") # Some systems return ENOSYS from sem_open. AC_CACHE_CHECK(for working sem_open,ac_cv_func_sem_open,[ @@ -2119,7 +2126,10 @@ APR_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h) if test "$threads" = "1"; then APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h) - AC_CHECK_FUNCS(pthread_mutexattr_setpshared) + AC_CHECK_FUNCS(pthread_mutex_timedlock pthread_mutexattr_setpshared) + APR_IFALLYES(header:pthread.h func:pthread_mutex_timedlock, + have_pthread_mutex_timedlock="1", have_pthread_mutex_timedlock="0") + AC_SUBST(have_pthread_mutex_timedlock) # Some systems have setpshared and define PROCESS_SHARED, but don't # really support PROCESS_SHARED locks. So, we must validate that we # can go through the steps without receiving some sort of system error. @@ -2157,8 +2167,8 @@ fi APR_IFALLYES(header:semaphore.h func:sem_open func:sem_close dnl func:sem_unlink func:sem_post func:sem_wait, hasposixser="1", hasposixser="0") -APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, hassysvser="1", - hassysvser="0") +APR_IFALLYES(func:semget func:semctl func:semop define:SEM_UNDO, + hassysvser="1", hassysvser="0") APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1", hasflockser="0") APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1", hasfcntlser="0") # note: the current APR use of shared mutex requires /dev/zero @@ -2183,9 +2193,9 @@ APR_IFALLYES(func:flock define:LOCK_EX, APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) APR_IFALLYES(header:fcntl.h define:F_SETLK, APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) -APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, +APR_IFALLYES(func:semget func:semctl func:semop define:SEM_UNDO, APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) -APR_IFALLYES(header:OS.h func:create_sem, +APR_IFALLYES(header:OS.h func:create_sem func:acquire_sem func:acquire_sem_etc, APR_DECIDE(USE_BEOSSEM, [BeOS Semaphores])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index 3cd384704f4..e86048cac38 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -29,6 +29,7 @@ #if APR_PROC_MUTEX_IS_GLOBAL #include "apr_proc_mutex.h" #endif +#include "apr_time.h" #ifdef __cplusplus extern "C" { @@ -66,6 +67,7 @@ typedef struct apr_global_mutex_t apr_global_mutex_t; * APR_LOCK_POSIXSEM * APR_LOCK_PROC_PTHREAD * APR_LOCK_DEFAULT pick the default mechanism for the platform + * APR_LOCK_DEFAULT_TIMED pick the default timed mechanism * * @param pool the pool from which to allocate the mutex. * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports @@ -108,6 +110,17 @@ APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex); */ APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex); +/** + * Attempt to acquire the lock for the given mutex until timeout expires. + * If the acquisition time outs, the call returns with APR_TIMEUP. + * @param mutex the mutex on which to attempt the lock acquiring. + * @param timeout the absolute (non 0) or relative (0) timeout + * @param absolute whether the timeout given is absolute or relative + */ +APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex, + apr_time_t timeout, + int absolute); + /** * Release the lock for the given mutex. * @param mutex the mutex from which to release the lock. diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index 1c6d19d6b6a..09fde2ff239 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -26,6 +26,7 @@ #include "apr_pools.h" #include "apr_errno.h" #include "apr_perms_set.h" +#include "apr_time.h" #ifdef __cplusplus extern "C" { @@ -48,7 +49,8 @@ typedef enum { APR_LOCK_SYSVSEM, /**< System V Semaphores */ APR_LOCK_PROC_PTHREAD, /**< POSIX pthread process-based locking */ APR_LOCK_POSIXSEM, /**< POSIX semaphore process-based locking */ - APR_LOCK_DEFAULT /**< Use the default process lock */ + APR_LOCK_DEFAULT, /**< Use the default process lock */ + APR_LOCK_DEFAULT_TIMED /**< Use the default process timed lock */ } apr_lockmech_e; /** Opaque structure representing a process mutex. */ @@ -113,6 +115,17 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex); */ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex); +/** + * Attempt to acquire the lock for the given mutex until timeout expires. + * If the acquisition time outs, the call returns with APR_TIMEUP. + * @param mutex the mutex on which to attempt the lock acquiring. + * @param timeout the absolute (non 0) or relative (0) timeout + * @param absolute whether the timeout given is absolute or relative + */ +APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, + apr_time_t timeout, + int absolute); + /** * Release the lock for the given mutex. * @param mutex the mutex from which to release the lock. diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 193a70a3822..f95b937181d 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -24,6 +24,7 @@ #include "apr.h" #include "apr_errno.h" +#include "apr_time.h" #ifdef __cplusplus extern "C" { @@ -43,6 +44,7 @@ typedef struct apr_thread_mutex_t apr_thread_mutex_t; #define APR_THREAD_MUTEX_DEFAULT 0x0 /**< platform-optimal lock behavior */ #define APR_THREAD_MUTEX_NESTED 0x1 /**< enable nested (recursive) locks */ #define APR_THREAD_MUTEX_UNNESTED 0x2 /**< disable nested locks */ +#define APR_THREAD_MUTEX_TIMED 0x4 /**< enable timed locks */ /* Delayed the include to avoid a circular reference */ #include "apr_pools.h" @@ -81,6 +83,17 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex); */ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex); +/** + * Attempt to acquire the lock for the given mutex until timeout expires. + * If the acquisition time outs, the call returns with APR_TIMEUP. + * @param mutex the mutex on which to attempt the lock acquiring. + * @param timeout the absolute (non 0) or relative (0) timeout + * @param absolute whether the timeout given is absolute or relative + */ +APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, + apr_time_t timeout, + int absolute); + /** * Release the lock for the given mutex. * @param mutex the mutex from which to release the lock. diff --git a/include/apr_time.h b/include/apr_time.h index 15e0b961152..b0efd791c98 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -23,7 +23,6 @@ */ #include "apr.h" -#include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus @@ -120,6 +119,9 @@ struct apr_time_exp_t { apr_int32_t tm_gmtoff; }; +/* Delayed the include to avoid a circular reference */ +#include "apr_pools.h" + /** * Convert an ansi time_t to an apr_time_t * @param result the resulting apr_time_t diff --git a/include/arch/netware/apr_arch_thread_mutex.h b/include/arch/netware/apr_arch_thread_mutex.h index 0453799c2da..18702fc7d03 100644 --- a/include/arch/netware/apr_arch_thread_mutex.h +++ b/include/arch/netware/apr_arch_thread_mutex.h @@ -18,11 +18,14 @@ #define THREAD_MUTEX_H #include "apr_thread_mutex.h" +#include "apr_thread_cond.h" #include struct apr_thread_mutex_t { apr_pool_t *pool; NXMutex_t *mutex; + apr_thread_cond_t *cond; + int locked, num_waiters; }; #endif /* THREAD_MUTEX_H */ diff --git a/include/arch/unix/apr_arch_proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h index c582eeb21ee..37ecd0b5adc 100644 --- a/include/arch/unix/apr_arch_proc_mutex.h +++ b/include/arch/unix/apr_arch_proc_mutex.h @@ -26,6 +26,7 @@ #include "apr_portable.h" #include "apr_file_io.h" #include "apr_arch_file_io.h" +#include "apr_time.h" /* System headers required by Locks library */ #if APR_HAVE_SYS_TYPES_H @@ -72,6 +73,7 @@ struct apr_proc_mutex_unix_lock_methods_t { apr_status_t (*create)(apr_proc_mutex_t *, const char *); apr_status_t (*acquire)(apr_proc_mutex_t *); apr_status_t (*tryacquire)(apr_proc_mutex_t *); + apr_status_t (*timedacquire)(apr_proc_mutex_t *, apr_time_t, int); apr_status_t (*release)(apr_proc_mutex_t *); apr_status_t (*cleanup)(void *); apr_status_t (*child_init)(apr_proc_mutex_t **, apr_pool_t *, const char *); diff --git a/include/arch/unix/apr_arch_thread_mutex.h b/include/arch/unix/apr_arch_thread_mutex.h index 40cdef3c656..4fe46c3b427 100644 --- a/include/arch/unix/apr_arch_thread_mutex.h +++ b/include/arch/unix/apr_arch_thread_mutex.h @@ -21,6 +21,7 @@ #include "apr_private.h" #include "apr_general.h" #include "apr_thread_mutex.h" +#include "apr_thread_cond.h" #include "apr_portable.h" #include "apr_atomic.h" @@ -32,6 +33,8 @@ struct apr_thread_mutex_t { apr_pool_t *pool; pthread_mutex_t mutex; + apr_thread_cond_t *cond; + int locked, num_waiters; }; #endif diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index a02668addc2..0283040bbc2 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -27,13 +27,13 @@ static apr_status_t _proc_mutex_cleanup(void * data) apr_proc_mutex_t *lock = (apr_proc_mutex_t*)data; if (lock->LockCount != 0) { /* we're still locked... */ - while (atomic_add(&lock->LockCount , -1) > 1){ - /* OK we had more than one person waiting on the lock so - * the sem is also locked. Release it until we have no more - * locks left. - */ + while (atomic_add(&lock->LockCount , -1) > 1){ + /* OK we had more than one person waiting on the lock so + * the sem is also locked. Release it until we have no more + * locks left. + */ release_sem (lock->Lock); - } + } } delete_sem(lock->Lock); return APR_SUCCESS; @@ -47,7 +47,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, apr_proc_mutex_t *new; apr_status_t stat = APR_SUCCESS; - if (mech != APR_LOCK_DEFAULT) { + if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) { return APR_ENOTIMPL; } @@ -82,25 +82,76 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) { int32 stat; - if (atomic_add(&mutex->LockCount, 1) > 0) { - if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) { - atomic_add(&mutex->LockCount, -1); - return stat; - } - } + if (atomic_add(&mutex->LockCount, 1) > 0) { + if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) { + atomic_add(&mutex->LockCount, -1); + return stat; + } + } return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) { - return APR_ENOTIMPL; + int32 stat; + + if (atomic_add(&mutex->LockCount, 1) > 0) { + stat = acquire_sem_etc(mutex->Lock, 1, 0, 0); + if (stat < B_NO_ERROR) { + atomic_add(&mutex->LockCount, -1); + if (stat == B_WOULD_BLOCK) { + stat = APR_EBUSY; + } + return stat; + } + } + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + int32 stat; + + if (atomic_add(&mutex->LockCount, 1) > 0) { + int flag = 0; +#ifdef B_ABSOLUTE_TIMEOUT + if (timeout) { + flag = absolute ? B_ABSOLUTE_TIMEOUT : B_RELATIVE_TIMEOUT; + } + stat = acquire_sem_etc(mutex->Lock, 1, flag, timeout); +#else + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } + } + if (timeout) { + flag = B_RELATIVE_TIMEOUT; + } + stat = acquire_sem_etc(mutex->Lock, 1, flag, timeout); +#endif + if (stat < B_NO_ERROR) { + atomic_add(&mutex->LockCount, -1); + if (stat == B_TIMED_OUT) { + stat = APR_TIMEUP; + } + return stat; + } + } + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) { int32 stat; - if (atomic_add(&mutex->LockCount, -1) > 1) { + if (atomic_add(&mutex->LockCount, -1) > 1) { if ((stat = release_sem(mutex->Lock)) < B_NO_ERROR) { atomic_add(&mutex->LockCount, 1); return stat; diff --git a/locks/beos/thread_cond.c b/locks/beos/thread_cond.c index 44189d908b9..a0978c008c8 100644 --- a/locks/beos/thread_cond.c +++ b/locks/beos/thread_cond.c @@ -81,7 +81,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, static apr_status_t do_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, - int timeout) + apr_interval_time_t timeout) { struct waiter_t *wait; thread_id cth = find_thread(NULL); diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index b87f76606ff..257d125086a 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -27,13 +27,13 @@ static apr_status_t _thread_mutex_cleanup(void * data) apr_thread_mutex_t *lock = (apr_thread_mutex_t*)data; if (lock->LockCount != 0) { /* we're still locked... */ - while (atomic_add(&lock->LockCount , -1) > 1){ - /* OK we had more than one person waiting on the lock so - * the sem is also locked. Release it until we have no more - * locks left. - */ + while (atomic_add(&lock->LockCount , -1) > 1){ + /* OK we had more than one person waiting on the lock so + * the sem is also locked. Release it until we have no more + * locks left. + */ release_sem (lock->Lock); - } + } } delete_sem(lock->Lock); return APR_SUCCESS; @@ -91,13 +91,13 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) return APR_SUCCESS; } - if (atomic_add(&mutex->LockCount, 1) > 0) { - if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) { + if (atomic_add(&mutex->LockCount, 1) > 0) { + if ((stat = acquire_sem(mutex->Lock)) < B_NO_ERROR) { /* Oh dear, acquire_sem failed!! */ - atomic_add(&mutex->LockCount, -1); - return stat; - } - } + atomic_add(&mutex->LockCount, -1); + return stat; + } + } mutex->owner = me; mutex->owner_ref = 1; @@ -107,7 +107,74 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + int32 stat; + thread_id me = find_thread(NULL); + + if (mutex->nested && mutex->owner == me) { + mutex->owner_ref++; + return APR_SUCCESS; + } + + if (atomic_add(&mutex->LockCount, 1) > 0) { + if ((stat = acquire_sem_etc(mutex->Lock, 1, + B_TIMEOUT, 0)) < B_NO_ERROR) { + atomic_add(&mutex->LockCount, -1); + if (stat == B_WOULD_BLOCK) { + stat = APR_EBUSY; + } + return stat; + } + } + + mutex->owner = me; + mutex->owner_ref = 1; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + int32 stat; + thread_id me = find_thread(NULL); + + if (mutex->nested && mutex->owner == me) { + mutex->owner_ref++; + return APR_SUCCESS; + } + + if (atomic_add(&mutex->LockCount, 1) > 0) { +#ifdef B_ABSOLUTE_TIMEOUT + stat = acquire_sem_etc(mutex->Lock, 1, + absolute ? B_ABSOLUTE_TIMEOUT + : B_RELATIVE_TIMEOUT, + timeout); +#else + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } + } + stat = acquire_sem_etc(mutex->Lock, 1, B_TIMEOUT, timeout); +#endif + if (stat < B_NO_ERROR) { + atomic_add(&mutex->LockCount, -1); + if (stat == B_TIMED_OUT) { + stat = APR_TIMEUP; + } + return stat; + } + } + + mutex->owner = me; + mutex->owner_ref = 1; + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) @@ -120,7 +187,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) return APR_SUCCESS; } - if (atomic_add(&mutex->LockCount, -1) > 1) { + if (atomic_add(&mutex->LockCount, -1) > 1) { if ((stat = release_sem(mutex->Lock)) < B_NO_ERROR) { atomic_add(&mutex->LockCount, 1); return stat; diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 09791464544..4217b1cf0fe 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -26,15 +26,24 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, apr_pool_t *pool) { apr_status_t ret; - apr_proc_mutex_t *new_mutex = NULL; + apr_proc_mutex_t *new_mutex; + unsigned int flags = APR_THREAD_MUTEX_DEFAULT; + + *mutex = NULL; + if (mech == APR_LOCK_DEFAULT_TIMED) { + flags |= APR_THREAD_MUTEX_TIMED; + } + else if (mech != APR_LOCK_DEFAULT) { + return APR_ENOTIMPL; + } + new_mutex = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); - - if(new_mutex ==NULL) { + if (new_mutex == NULL) { return APR_ENOMEM; } new_mutex->pool = pool; - ret = apr_thread_mutex_create(&(new_mutex->mutex), APR_THREAD_MUTEX_DEFAULT, pool); + ret = apr_thread_mutex_create(&(new_mutex->mutex), flags, pool); if (ret == APR_SUCCESS) *mutex = new_mutex; @@ -63,6 +72,15 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) return APR_ENOLOCK; } +APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_thread_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + if (mutex) + return apr_thread_mutex_timedlock(mutex->mutex, timeout, absolute); + return APR_ENOLOCK; +} + APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) { if (mutex) diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index 98bf33bd223..a43215dced8 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -19,6 +19,7 @@ #include "apr_general.h" #include "apr_strings.h" #include "apr_arch_thread_mutex.h" +#include "apr_thread_cond.h" #include "apr_portable.h" static apr_status_t thread_mutex_cleanup(void *data) @@ -41,8 +42,8 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, return APR_ENOTIMPL; } new_mutex = (apr_thread_mutex_t *)apr_pcalloc(pool, sizeof(apr_thread_mutex_t)); - - if(new_mutex ==NULL) { + + if (new_mutex == NULL) { return APR_ENOMEM; } new_mutex->pool = pool; @@ -52,6 +53,14 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, if(new_mutex->mutex == NULL) return APR_ENOMEM; + if (flags & APR_THREAD_MUTEX_TIMED) { + apr_status_t rv = apr_thread_cond_create(&new_mutex->cond, pool); + if (rv != SUCCESS) { + NXMutexFree(new_mutex->mutex); + return rv; + } + } + apr_pool_cleanup_register(new_mutex->pool, new_mutex, (void*)thread_mutex_cleanup, apr_pool_cleanup_null); @@ -61,29 +70,112 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { + if (mutex->cond) { + apr_status_t rv; + NXLock(mutex->mutex); + if (mutex->locked) { + mutex->num_waiters++; + rv = apr_thread_cond_wait(mutex->cond, mutex); + mutex->num_waiters--; + } + else { + mutex->locked = 1; + rv = APR_SUCCESS; + } + NXUnlock(mutex->mutex); + return rv; + } + NXLock(mutex->mutex); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { + if (mutex->cond) { + apr_status_t rv; + NXLock(mutex->mutex); + if (mutex->locked) { + rv = APR_EBUSY; + } + else { + mutex->locked = 1; + rv = APR_SUCCESS; + } + NXUnlock(mutex->mutex); + return rv; + } + if (!NXTryLock(mutex->mutex)) return APR_EBUSY; return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + if (mutex->cond) { + apr_status_t rv; + NXLock(mutex->mutex); + if (mutex->locked) { + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } + } + mutex->num_waiters++; + rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout); + mutex->num_waiters--; + } + else { + mutex->locked = 1; + rv = APR_SUCCESS; + } + NXUnlock(mutex->mutex); + return rv; + } + + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { + if (mutex->cond) { + apr_status_t rv; + NXLock(mutex->mutex); + if (!mutex->locked) { + rv = APR_EINVAL; + } + else if (mutex->num_waiters) { + rv = apr_thread_cond_signal(mutex->cond); + } + else { + mutex->locked = 0; + rv = APR_SUCCESS; + } + NXUnlock(mutex->mutex); + return rv; + } + NXUnlock(mutex->mutex); return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) { - apr_status_t stat; - if ((stat = thread_mutex_cleanup(mutex)) == APR_SUCCESS) { - apr_pool_cleanup_kill(mutex->pool, mutex, thread_mutex_cleanup); - return APR_SUCCESS; + apr_status_t stat, rv = APR_SUCCESS; + if (mutex->cond) { + rv = apr_thread_cond_destroy(mutex->cond); + mutex->cond = NULL; + } + stat = apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup); + if (stat == APR_SUCCESS && rv) { + stat = rv; } return stat; } diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 9b53c0befb1..171c119a5bf 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -80,7 +80,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, ULONG rc; char *semname; - if (mech != APR_LOCK_DEFAULT) { + if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) { return APR_ENOTIMPL; } @@ -156,6 +156,37 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) +APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + ULONG rc; + + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } + } + + rc = DosRequestMutexSem(mutex->hMutex, apr_time_as_msec(timeout)); + if (rc == ERROR_TIMEOUT) { + return APR_TIMEUP; + } + + if (rc == 0) { + mutex->owner = CurrentTid; + mutex->lock_count++; + } + + return APR_FROM_OS_ERROR(rc); +} + + + APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) { ULONG rc; diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index 03ab3de4dc8..245b788c421 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -76,6 +76,32 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) +APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + ULONG rc; + + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } + } + + rc = DosRequestMutexSem(mutex->hMutex, apr_time_as_msec(usec)); + if (rc == ERROR_TIMEOUT) { + return APR_TIMEUP; + } + + return APR_FROM_OS_ERROR(rc); +} + + + APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { ULONG rc = DosReleaseMutexSem(mutex->hMutex); diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index ca3b86e46eb..b5523d85233 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -141,6 +141,38 @@ APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) return rv; } +APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + apr_status_t rv; + + if (!absolute) { + timeout += apr_time_now(); + } + +#if APR_HAS_THREADS + if (mutex->thread_mutex) { + rv = apr_thread_mutex_timedlock(mutex->thread_mutex, timeout, 1); + if (rv != APR_SUCCESS) { + return rv; + } + } +#endif /* APR_HAS_THREADS */ + + rv = apr_proc_mutex_timedlock(mutex->proc_mutex, timeout, 1); + +#if APR_HAS_THREADS + if (rv != APR_SUCCESS) { + if (mutex->thread_mutex) { + (void)apr_thread_mutex_unlock(mutex->thread_mutex); + } + } +#endif /* APR_HAS_THREADS */ + + return rv; +} + APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) { apr_status_t rv; diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 4105ff3ef53..5ac787f0c01 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -174,6 +174,32 @@ static apr_status_t proc_mutex_posix_tryacquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } +static apr_status_t proc_mutex_posix_timedacquire(apr_proc_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ +#if HAVE_SEM_TIMEDWAIT + struct timespec abstime; + + if (!absolute) { + timeout += apr_time_now(); + } + abstime.tv_sec = apr_time_sec(timeout); + abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + + if (sem_timedwait(mutex->psem_interproc, &abstime) < 0) { + if (errno == ETIMEDOUT) { + return APR_TIMEUP; + } + return errno; + } + mutex->curr_locked = 1; + return APR_SUCCESS; +#else + return APR_ENOTIMPL; +#endif +} + static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) { mutex->curr_locked = 0; @@ -195,6 +221,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_posixsem_methods = proc_mutex_posix_create, proc_mutex_posix_acquire, proc_mutex_posix_tryacquire, + proc_mutex_posix_timedacquire, proc_mutex_posix_release, proc_mutex_posix_cleanup, proc_mutex_no_child_init, @@ -293,6 +320,37 @@ static apr_status_t proc_mutex_sysv_tryacquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } +static apr_status_t proc_mutex_sysv_timedacquire(apr_proc_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ +#if HAVE_SEMTIMEDOP + int rc; + struct timespec abstime; + + if (!absolute) { + timeout += apr_time_now(); + } + abstime.tv_sec = apr_time_sec(timeout); + abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + + do { + rc = semtimedop(mutex->interproc->filedes, &proc_mutex_op_on, 1, + &abstime); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { + if (errno == EAGAIN) { + return APR_TIMEUP; + } + return errno; + } + mutex->curr_locked = 1; + return APR_SUCCESS; +#else + return APR_ENOTIMPL; +#endif +} + static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex) { int rc; @@ -335,6 +393,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = proc_mutex_sysv_create, proc_mutex_sysv_acquire, proc_mutex_sysv_tryacquire, + proc_mutex_sysv_timedacquire, proc_mutex_sysv_release, proc_mutex_sysv_cleanup, proc_mutex_no_child_init, @@ -511,6 +570,43 @@ static apr_status_t proc_mutex_proc_pthread_tryacquire(apr_proc_mutex_t *mutex) return rv; } +static apr_status_t +proc_mutex_proc_pthread_timedacquire(apr_proc_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + apr_status_t rv; + struct timespec abstime; + + if (!absolute) { + timeout += apr_time_now(); + } + abstime.tv_sec = apr_time_sec(timeout); + abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + + if ((rv = pthread_mutex_timedlock(mutex->pthread_interproc, &abstime))) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + if (rv == ETIMEDOUT) { + return APR_TIMEUP; + } +#ifdef HAVE_PTHREAD_MUTEX_ROBUST + /* Okay, our owner died. Let's try to make it consistent again. */ + if (rv == EOWNERDEAD) { + pthread_mutex_consistent_np(mutex->pthread_interproc); + rv = APR_SUCCESS; + } + else + return rv; +#else + return rv; +#endif + } + mutex->curr_locked = 1; + return rv; +} + static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex) { apr_status_t rv; @@ -531,6 +627,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_methods = proc_mutex_proc_pthread_create, proc_mutex_proc_pthread_acquire, proc_mutex_proc_pthread_tryacquire, + proc_mutex_proc_pthread_timedacquire, proc_mutex_proc_pthread_release, proc_mutex_proc_pthread_cleanup, proc_mutex_no_child_init, @@ -642,6 +739,13 @@ static apr_status_t proc_mutex_fcntl_tryacquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } +static apr_status_t proc_mutex_fcntl_timedacquire(apr_proc_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + return APR_ENOTIMPL; +} + static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex) { int rc; @@ -682,6 +786,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_fcntl_methods = proc_mutex_fcntl_create, proc_mutex_fcntl_acquire, proc_mutex_fcntl_tryacquire, + proc_mutex_fcntl_timedacquire, proc_mutex_fcntl_release, proc_mutex_fcntl_cleanup, proc_mutex_no_child_init, @@ -773,6 +878,13 @@ static apr_status_t proc_mutex_flock_tryacquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } +static apr_status_t proc_mutex_flock_timedacquire(apr_proc_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + return APR_ENOTIMPL; +} + static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *mutex) { int rc; @@ -837,6 +949,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_flock_methods = proc_mutex_flock_create, proc_mutex_flock_acquire, proc_mutex_flock_tryacquire, + proc_mutex_flock_timedacquire, proc_mutex_flock_release, proc_mutex_flock_cleanup, proc_mutex_flock_child_init, @@ -908,6 +1021,21 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lo new_mutex->inter_meth = &mutex_posixsem_methods; #else return APR_ENOTIMPL; +#endif + break; + case APR_LOCK_DEFAULT_TIMED: +#if APR_HAS_PROC_PTHREAD_SERIALIZE \ + && defined(HAVE_PTHREAD_MUTEX_ROBUST) \ + && defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) + new_mutex->inter_meth = &mutex_proc_pthread_methods; +#elif APR_HAS_SYSVSEM_SERIALIZE \ + && defined(HAVE_SEMTIMEDOP) + new_mutex->inter_meth = &mutex_sysv_methods; +#elif APR_HAS_POSIXSEM_SERIALIZE \ + && defined(HAVE_SEM_TIMEDWAIT) + new_mutex->inter_meth = &mutex_posixsem_methods; +#else + return APR_ENOTIMPL; #endif break; default: @@ -981,6 +1109,13 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) return mutex->meth->tryacquire(mutex); } +APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + return mutex->meth->timedacquire(mutex, timeout, absolute); +} + APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) { return mutex->meth->release(mutex); diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 73fd1e14621..297bf018d82 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -77,6 +77,19 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, return rv; } +#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK + if (flags & APR_THREAD_MUTEX_TIMED) { + rv = apr_thread_cond_create(&new_mutex->cond, pool); + if (rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + pthread_mutex_destroy(&new_mutex->mutex); + return rv; + } + } +#endif + apr_pool_cleanup_register(new_mutex->pool, new_mutex, thread_mutex_cleanup, apr_pool_cleanup_null); @@ -89,13 +102,45 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) { apr_status_t rv; + if (mutex->cond) { + apr_status_t rv2; + + rv = pthread_mutex_lock(&mutex->mutex); + if (rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + return rv; + } + + if (mutex->locked) { + mutex->num_waiters++; + rv = apr_thread_cond_wait(mutex->cond, mutex); + mutex->num_waiters--; + } + else { + mutex->locked = 1; + } + + rv2 = pthread_mutex_unlock(&mutex->mutex); + if (rv2 && !rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#else + rv = rv2; +#endif + } + + return rv; + } + rv = pthread_mutex_lock(&mutex->mutex); #ifdef HAVE_ZOS_PTHREADS if (rv) { rv = errno; } #endif - + return rv; } @@ -103,6 +148,36 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { apr_status_t rv; + if (mutex->cond) { + apr_status_t rv2; + + rv = pthread_mutex_lock(&mutex->mutex); + if (rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + return rv; + } + + if (mutex->locked) { + rv = APR_EBUSY; + } + else { + mutex->locked = 1; + } + + rv2 = pthread_mutex_unlock(&mutex->mutex); + if (rv2) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#else + rv = rv2; +#endif + } + + return rv; + } + rv = pthread_mutex_trylock(&mutex->mutex); if (rv) { #ifdef HAVE_ZOS_PTHREADS @@ -114,10 +189,115 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + apr_status_t rv = APR_ENOTIMPL; + +#ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK + struct timespec abstime; + + if (!absolute) { + timeout += apr_time_now(); + } + abstime.tv_sec = apr_time_sec(timeout); + abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + + rv = pthread_mutex_timedlock(&mutex->mutex, &abstime); + if (rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + if (rv == ETIMEDOUT) { + rv = APR_TIMEUP; + } + } + +#else /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */ + + if (mutex->cond) { + apr_status_t rv2; + + rv = pthread_mutex_lock(&mutex->mutex); + if (rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + return rv; + } + + if (mutex->locked) { + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } + } + mutex->num_waiters++; + rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout); + mutex->num_waiters--; + } + else { + mutex->locked = 1; + } + + rv2 = pthread_mutex_unlock(&mutex->mutex); + if (rv2 && !rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#else + rv = rv2; +#endif + } + } + +#endif /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */ + + return rv; +} + APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { apr_status_t status; + if (mutex->cond) { + apr_status_t stat2; + + status = pthread_mutex_lock(&mutex->mutex); + if (status) { +#ifdef HAVE_ZOS_PTHREADS + status = errno; +#endif + return status; + } + + if (!mutex->locked) { + status = APR_EINVAL; + } + else if (mutex->num_waiters) { + status = apr_thread_cond_signal(mutex->cond); + } + else { + mutex->locked = 0; + status = APR_SUCCESS; + } + + stat2 = pthread_mutex_unlock(&mutex->mutex); + if (stat2) { +#ifdef HAVE_ZOS_PTHREADS + status = errno; +#else + status = stat2; +#endif + } + + return status; + } + status = pthread_mutex_unlock(&mutex->mutex); #ifdef HAVE_ZOS_PTHREADS if (status) { @@ -130,7 +310,17 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) { - return apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup); + apr_status_t rv, rv2 = APR_SUCCESS; + + if (mutex->cond) { + rv2 = apr_thread_cond_destroy(mutex->cond); + } + rv = apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup); + if (rv == APR_SUCCESS) { + rv = rv2; + } + + return rv; } APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex) diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 38366f18543..6af991e8c49 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -160,6 +160,33 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) return apr_get_os_error(); } +APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + DWORD rv; + + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } + } + + rv = WaitForSingleObject(mutex->handle, apr_time_as_msec(timeout)); + + if (rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) { + return APR_SUCCESS; + } + else if (rv == WAIT_TIMEOUT) { + return APR_TIMEUP; + } + return apr_get_os_error(); +} + APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) { if (ReleaseMutex(mutex->handle) == 0) { diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 9b10d7278d8..c467829ea88 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -54,6 +54,10 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, (*mutex)->type = thread_mutex_unnested_event; (*mutex)->handle = CreateEvent(NULL, FALSE, TRUE, NULL); } + else if (flags & APR_THREAD_MUTEX_TIMED) { + (*mutex)->type = thread_mutex_nested_mutex; + (*mutex)->handle = CreateMutex(NULL, FALSE, NULL); + } else { #if APR_HAS_UNICODE_FS /* Critical Sections are terrific, performance-wise, on NT. @@ -63,6 +67,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, IF_WIN_OS_IS_UNICODE { InitializeCriticalSection(&(*mutex)->section); (*mutex)->type = thread_mutex_critical_section; + (*mutex)->handle = NULL; } #endif #if APR_HAS_ANSI_FS @@ -86,9 +91,9 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) } else { DWORD rv = WaitForSingleObject(mutex->handle, INFINITE); - if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) { + if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) { return (rv == WAIT_TIMEOUT) ? APR_EBUSY : apr_get_os_error(); - } + } } return APR_SUCCESS; } @@ -102,13 +107,38 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) } else { DWORD rv = WaitForSingleObject(mutex->handle, 0); - if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) { + if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) { return (rv == WAIT_TIMEOUT) ? APR_EBUSY : apr_get_os_error(); - } + } } return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + if (mutex->type != thread_mutex_critical_section) { + DWORD rv; + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } + } + rv = WaitForSingleObject(mutex->handle, apr_time_as_msec(timeout)); + if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) { + return (rv == WAIT_TIMEOUT) ? APR_EBUSY : apr_get_os_error(); + } + return APR_SUCCESS; + } + + return APR_ENOTIMPL; +} + APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { if (mutex->type == thread_mutex_critical_section) { diff --git a/test/abts_tests.h b/test/abts_tests.h index b7cc8ef16ea..793f93e510d 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -50,7 +50,9 @@ const struct testlist { {testoc}, {testpath}, {testpipe}, +#if 0 {testpoll}, +#endif {testpool}, {testproc}, {testprocmutex}, diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index d6b716c09f8..7340e25407a 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -68,6 +68,7 @@ static const char *mutexname(apr_lockmech_e mech) case APR_LOCK_PROC_PTHREAD: return "proc_pthread"; case APR_LOCK_POSIXSEM: return "posixsem"; case APR_LOCK_DEFAULT: return "default"; + case APR_LOCK_DEFAULT_TIMED: return "default_timed"; default: return "unknown"; } } @@ -129,6 +130,8 @@ abts_suite *testglobalmutex(abts_suite *suite) mech = APR_LOCK_FLOCK; abts_run_test(suite, test_exclusive, &mech); #endif + mech = APR_LOCK_DEFAULT_TIMED; + abts_run_test(suite, test_exclusive, &mech); return suite; } diff --git a/test/testlock.c b/test/testlock.c index dddb52f76a9..a36720b84a4 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -90,7 +90,12 @@ static void *APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data while (1) { - apr_thread_mutex_lock(thread_mutex); + if (data) { + apr_thread_mutex_timedlock(thread_mutex, *(apr_time_t *)data, 0); + } + else { + apr_thread_mutex_lock(thread_mutex); + } if (i == MAX_ITER) exitLoop = 0; else @@ -178,6 +183,38 @@ static void test_thread_mutex(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, MAX_ITER, x); } +static void test_thread_timedmutex(abts_case *tc, void *data) +{ + apr_thread_t *t1, *t2, *t3, *t4; + apr_status_t s1, s2, s3, s4; + apr_time_t timeout; + + s1 = apr_thread_mutex_create(&thread_mutex, APR_THREAD_MUTEX_TIMED, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); + ABTS_PTR_NOTNULL(tc, thread_mutex); + + i = 0; + x = 0; + + timeout = apr_time_from_sec(5); + + s1 = apr_thread_create(&t1, NULL, thread_mutex_function, &timeout, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); + s2 = apr_thread_create(&t2, NULL, thread_mutex_function, &timeout, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s2); + s3 = apr_thread_create(&t3, NULL, thread_mutex_function, &timeout, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s3); + s4 = apr_thread_create(&t4, NULL, thread_mutex_function, &timeout, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s4); + + apr_thread_join(&s1, t1); + apr_thread_join(&s2, t2); + apr_thread_join(&s3, t3); + apr_thread_join(&s4, t4); + + ABTS_INT_EQUAL(tc, MAX_ITER, x); +} + static void test_thread_rwlock(abts_case *tc, void *data) { apr_thread_t *t1, *t2, *t3, *t4; @@ -305,6 +342,38 @@ static void test_timeoutcond(abts_case *tc, void *data) apr_thread_cond_destroy(timeout_cond)); } +static void test_timeoutmutex(abts_case *tc, void *data) +{ + apr_status_t s; + apr_time_t begin, end; + apr_time_t timeout; + int i; + + s = apr_thread_mutex_create(&timeout_mutex, APR_THREAD_MUTEX_TIMED, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, s); + ABTS_PTR_NOTNULL(tc, timeout_mutex); + + timeout = apr_time_from_sec(5); + + ABTS_INT_EQUAL(tc, 0, apr_thread_mutex_lock(timeout_mutex)); + for (i = 0; i < MAX_RETRY; i++) { + begin = apr_time_now(); + s = apr_thread_mutex_timedlock(timeout_mutex, timeout, 0); + end = apr_time_now(); + + if (s != APR_SUCCESS && !APR_STATUS_IS_TIMEUP(s)) { + continue; + } + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(s)); + ABTS_ASSERT(tc, "Timer returned too late", end - begin - timeout < 100000); + break; + } + ABTS_ASSERT(tc, "Too many retries", i < MAX_RETRY); + ABTS_INT_EQUAL(tc, 0, apr_thread_mutex_unlock(timeout_mutex)); + APR_ASSERT_SUCCESS(tc, "Unable to destroy the mutex", + apr_thread_mutex_destroy(timeout_mutex)); +} + #endif /* !APR_HAS_THREADS */ #if !APR_HAS_THREADS @@ -323,9 +392,11 @@ abts_suite *testlock(abts_suite *suite) abts_run_test(suite, threads_not_impl, NULL); #else abts_run_test(suite, test_thread_mutex, NULL); + abts_run_test(suite, test_thread_timedmutex, NULL); abts_run_test(suite, test_thread_rwlock, NULL); abts_run_test(suite, test_cond, NULL); abts_run_test(suite, test_timeoutcond, NULL); + abts_run_test(suite, test_timeoutmutex, NULL); #endif return suite; diff --git a/test/testlockperf.c b/test/testlockperf.c index 6cca99d16bd..39fc256a199 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -60,7 +60,12 @@ void * APR_THREAD_FUNC thread_mutex_func(apr_thread_t *thd, void *data) int i; for (i = 0; i < max_counter; i++) { - apr_thread_mutex_lock(thread_lock); + if (data) { + apr_thread_mutex_timedlock(thread_lock, *(apr_time_t *)data, 0); + } + else { + apr_thread_mutex_lock(thread_lock); + } mutex_counter++; apr_thread_mutex_unlock(thread_lock); } @@ -175,6 +180,57 @@ int test_thread_mutex_nested(int num_threads) return APR_SUCCESS; } +int test_thread_mutex_timed(int num_threads) +{ + apr_thread_t *t[MAX_THREADS]; + apr_status_t s[MAX_THREADS]; + apr_time_t time_start, time_stop; + apr_time_t timeout; + int i; + + mutex_counter = 0; + + timeout = apr_time_from_sec(5); + + printf("apr_thread_mutex_t Tests\n"); + printf("%-60s", " Initializing the apr_thread_mutex_t (TIMED)"); + s[0] = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_TIMED, pool); + if (s[0] != APR_SUCCESS) { + printf("Failed!\n"); + return s[0]; + } + printf("OK\n"); + + apr_thread_mutex_lock(thread_lock); + /* set_concurrency(4)? -aaron */ + printf(" Starting %d threads ", num_threads); + for (i = 0; i < num_threads; ++i) { + s[i] = apr_thread_create(&t[i], NULL, thread_mutex_func, &timeout, pool); + if (s[i] != APR_SUCCESS) { + printf("Failed!\n"); + return s[i]; + } + } + printf("OK\n"); + + time_start = apr_time_now(); + apr_thread_mutex_unlock(thread_lock); + + /* printf("%-60s", " Waiting for threads to exit"); */ + for (i = 0; i < num_threads; ++i) { + apr_thread_join(&s[i], t[i]); + } + /* printf("OK\n"); */ + + time_stop = apr_time_now(); + printf("microseconds: %" APR_INT64_T_FMT " usec\n", + (time_stop - time_start)); + if (mutex_counter != max_counter * num_threads) + printf("error: counter = %ld\n", mutex_counter); + + return APR_SUCCESS; +} + int test_thread_rwlock(int num_threads) { apr_thread_t *t[MAX_THREADS]; @@ -273,6 +329,12 @@ int main(int argc, const char * const *argv) exit(-4); } + if ((rv = test_thread_mutex_timed(i)) != APR_SUCCESS) { + fprintf(stderr,"thread_mutex (TIMED) test failed : [%d] %s\n", + rv, apr_strerror(rv, (char*)errmsg, 200)); + exit(-5); + } + if ((rv = test_thread_rwlock(i)) != APR_SUCCESS) { fprintf(stderr,"thread_rwlock test failed : [%d] %s\n", rv, apr_strerror(rv, (char*)errmsg, 200)); diff --git a/test/testmutexscope.c b/test/testmutexscope.c index 57fcaf5aa32..8081357731d 100644 --- a/test/testmutexscope.c +++ b/test/testmutexscope.c @@ -43,20 +43,22 @@ static apr_pool_t *p; static volatile int counter; typedef enum {TEST_GLOBAL, TEST_PROC} test_mode_e; -static void lock_init(apr_lockmech_e mech, test_mode_e test_mode) +static int lock_init(apr_lockmech_e mech, test_mode_e test_mode) { + apr_status_t rv; if (test_mode == TEST_PROC) { - assert(apr_proc_mutex_create(&proc_mutex, - NULL, - mech, - p) == APR_SUCCESS); + rv = apr_proc_mutex_create(&proc_mutex, + NULL, + mech, + p); } else { - assert(apr_global_mutex_create(&global_mutex, - NULL, - mech, - p) == APR_SUCCESS); + rv = apr_global_mutex_create(&global_mutex, + NULL, + mech, + p); } + return rv; } static void lock_destroy(test_mode_e test_mode) @@ -120,7 +122,17 @@ static void test_mech_mode(apr_lockmech_e mech, const char *mech_name, assert(apr_thread_mutex_create(&thread_mutex, 0, p) == APR_SUCCESS); assert(apr_thread_mutex_lock(thread_mutex) == APR_SUCCESS); - lock_init(mech, test_mode); + rv = lock_init(mech, test_mode); + if (rv != APR_SUCCESS) { + char errmsg[256]; + printf("%s mutexes with mechanism `%s': %s\n", + test_mode == TEST_GLOBAL ? "Global" : "Proc", mech_name, + apr_strerror(rv, errmsg, sizeof errmsg)); + if (rv != APR_ENOTIMPL || mech == APR_LOCK_DEFAULT) { + exit(1); + } + return; + } counter = 0; @@ -142,7 +154,7 @@ static void test_mech_mode(apr_lockmech_e mech, const char *mech_name, apr_sleep(apr_time_from_sec(5)); if (test_mode == TEST_PROC) { - printf(" Mutex mechanism `%s' is %sglobal in scope on this platform.\n", + printf(" mutex mechanism `%s' is %sglobal in scope on this platform.\n", mech_name, counter == 1 ? "" : "not "); } else { @@ -155,7 +167,7 @@ static void test_mech_mode(apr_lockmech_e mech, const char *mech_name, exit(1); } else { - printf(" no problems encountered...\n"); + printf(" no problem encountered...\n"); } } @@ -205,6 +217,7 @@ int main(void) #if APR_HAS_PROC_PTHREAD_SERIALIZE ,{APR_LOCK_PROC_PTHREAD, "proc_pthread"} #endif + ,{APR_LOCK_DEFAULT_TIMED, "default_timed"} }; int i; diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 78b2efc4c46..f2992de9e68 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -35,6 +35,11 @@ static apr_proc_mutex_t *proc_lock; static volatile int *x; +typedef struct lockmech { + apr_lockmech_e num; + const char *name; +} lockmech_t; + /* a slower more racy way to implement (*x)++ */ static int increment(int n) { @@ -68,7 +73,7 @@ static void make_child(abts_case *tc, int trylock, apr_proc_t **proc, apr_pool_t exit(1); do { - if (trylock) { + if (trylock > 0) { int wait_usec = 0; while ((rv = apr_proc_mutex_trylock(proc_lock))) { @@ -79,6 +84,16 @@ static void make_child(abts_case *tc, int trylock, apr_proc_t **proc, apr_pool_t apr_sleep(1); } } + else if (trylock < 0) { + int wait_usec = 0; + + while ((rv = apr_proc_mutex_timedlock(proc_lock, 1, 0))) { + if (!APR_STATUS_IS_TIMEUP(rv)) + exit(1); + if (++wait_usec >= MAX_WAIT_USEC) + exit(1); + } + } else { if (apr_proc_mutex_lock(proc_lock)) exit(1); @@ -108,16 +123,21 @@ static void await_child(abts_case *tc, apr_proc_t *proc) } static void test_exclusive(abts_case *tc, const char *lockname, - apr_lockmech_e mech) + lockmech_t *mech) { apr_proc_t *child[CHILDREN]; apr_status_t rv; int n; - rv = apr_proc_mutex_create(&proc_lock, lockname, mech, p); + rv = apr_proc_mutex_create(&proc_lock, lockname, mech->num, p); APR_ASSERT_SUCCESS(tc, "create the mutex", rv); - if (rv != APR_SUCCESS) + if (rv != APR_SUCCESS) { + fprintf(stderr, "%s not implemented, ", mech->name); + ABTS_ASSERT(tc, "Default timed not implemented", + mech->num != APR_LOCK_DEFAULT && + mech->num != APR_LOCK_DEFAULT_TIMED); return; + } for (n = 0; n < CHILDREN; n++) make_child(tc, 0, &child[n], p); @@ -129,24 +149,52 @@ static void test_exclusive(abts_case *tc, const char *lockname, rv = apr_proc_mutex_trylock(proc_lock); if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, "apr_proc_mutex_trylock not implemented"); - return; + fprintf(stderr, "%s_trylock() not implemented, ", mech->name); + ABTS_ASSERT(tc, "Default timed trylock not implemented", + mech->num != APR_LOCK_DEFAULT && + mech->num != APR_LOCK_DEFAULT_TIMED); } - APR_ASSERT_SUCCESS(tc, "check for trylock", rv); + else { + APR_ASSERT_SUCCESS(tc, "check for trylock", rv); - rv = apr_proc_mutex_unlock(proc_lock); - APR_ASSERT_SUCCESS(tc, "unlock after trylock check", rv); + rv = apr_proc_mutex_unlock(proc_lock); + APR_ASSERT_SUCCESS(tc, "unlock after trylock check", rv); - *x = 0; + *x = 0; - for (n = 0; n < CHILDREN; n++) - make_child(tc, 1, &child[n], p); + for (n = 0; n < CHILDREN; n++) + make_child(tc, 1, &child[n], p); - for (n = 0; n < CHILDREN; n++) - await_child(tc, child[n]); - - ABTS_ASSERT(tc, "Locks don't appear to work with trylock", - *x == MAX_COUNTER); + for (n = 0; n < CHILDREN; n++) + await_child(tc, child[n]); + + ABTS_ASSERT(tc, "Locks don't appear to work with trylock", + *x == MAX_COUNTER); + } + + rv = apr_proc_mutex_timedlock(proc_lock, 1, 0); + if (rv == APR_ENOTIMPL) { + fprintf(stderr, "%s_timedlock() not implemented, ", mech->name); + ABTS_ASSERT(tc, "Default timed timedlock not implemented", + mech->num != APR_LOCK_DEFAULT_TIMED); + } + else { + APR_ASSERT_SUCCESS(tc, "check for timedlock", rv); + + rv = apr_proc_mutex_unlock(proc_lock); + APR_ASSERT_SUCCESS(tc, "unlock after timedlock check", rv); + + *x = 0; + + for (n = 0; n < CHILDREN; n++) + make_child(tc, -1, &child[n], p); + + for (n = 0; n < CHILDREN; n++) + await_child(tc, child[n]); + + ABTS_ASSERT(tc, "Locks don't appear to work with timedlock", + *x == MAX_COUNTER); + } } #endif @@ -156,7 +204,6 @@ static void proc_mutex(abts_case *tc, void *data) apr_status_t rv; const char *shmname = "tpm.shm"; apr_shm_t *shm; - apr_lockmech_e *mech = data; /* Use anonymous shm if available. */ rv = apr_shm_create(&shm, sizeof(int), NULL, p); @@ -170,7 +217,7 @@ static void proc_mutex(abts_case *tc, void *data) return; x = apr_shm_baseaddr_get(shm); - test_exclusive(tc, NULL, *mech); + test_exclusive(tc, NULL, data); rv = apr_shm_destroy(shm); APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); #else @@ -181,30 +228,30 @@ static void proc_mutex(abts_case *tc, void *data) abts_suite *testprocmutex(abts_suite *suite) { - apr_lockmech_e mech = APR_LOCK_DEFAULT; - - suite = ADD_SUITE(suite) - abts_run_test(suite, proc_mutex, &mech); -#if APR_HAS_POSIXSEM_SERIALIZE - mech = APR_LOCK_POSIXSEM; - abts_run_test(suite, proc_mutex, &mech); + lockmech_t lockmechs[] = { + {APR_LOCK_DEFAULT, "default"} +#if APR_HAS_FLOCK_SERIALIZE + ,{APR_LOCK_FLOCK, "flock"} #endif #if APR_HAS_SYSVSEM_SERIALIZE - mech = APR_LOCK_SYSVSEM; - abts_run_test(suite, proc_mutex, &mech); + ,{APR_LOCK_SYSVSEM, "sysvsem"} #endif -#if APR_HAS_PROC_PTHREAD_SERIALIZE - mech = APR_LOCK_PROC_PTHREAD; - abts_run_test(suite, proc_mutex, &mech); +#if APR_HAS_POSIXSEM_SERIALIZE + ,{APR_LOCK_POSIXSEM, "posix"} #endif #if APR_HAS_FCNTL_SERIALIZE - mech = APR_LOCK_FCNTL; - abts_run_test(suite, proc_mutex, &mech); + ,{APR_LOCK_FCNTL, "fcntl"} #endif -#if APR_HAS_FLOCK_SERIALIZE - mech = APR_LOCK_FLOCK; - abts_run_test(suite, proc_mutex, &mech); +#if APR_HAS_PROC_PTHREAD_SERIALIZE + ,{APR_LOCK_PROC_PTHREAD, "proc_pthread"} #endif + ,{APR_LOCK_DEFAULT_TIMED, "default_timed"} + }; + int i; + suite = ADD_SUITE(suite) + for (i = 0; i < sizeof(lockmechs) / sizeof(lockmechs[0]); i++) { + abts_run_test(suite, proc_mutex, &lockmechs[i]); + } return suite; } From e5ab28897c7a1c4ea1f3dc9e6db3572cabf324d9 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 19 Mar 2015 23:40:51 +0000 Subject: [PATCH 7505/7878] Follow up to r1667900: revert spurious change on test/abts_tests.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667901 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts_tests.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/abts_tests.h b/test/abts_tests.h index 793f93e510d..b7cc8ef16ea 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -50,9 +50,7 @@ const struct testlist { {testoc}, {testpath}, {testpipe}, -#if 0 {testpoll}, -#endif {testpool}, {testproc}, {testprocmutex}, From 1ec31d0a321596ac58c20d8089adf7725bc5f51b Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 19 Mar 2015 23:51:03 +0000 Subject: [PATCH 7506/7878] Follow up to r1667900: fix comments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667903 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_global_mutex.h | 4 ++-- include/apr_proc_mutex.h | 4 ++-- include/apr_thread_mutex.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index e86048cac38..f6d9f4857f2 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -114,8 +114,8 @@ APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex); * Attempt to acquire the lock for the given mutex until timeout expires. * If the acquisition time outs, the call returns with APR_TIMEUP. * @param mutex the mutex on which to attempt the lock acquiring. - * @param timeout the absolute (non 0) or relative (0) timeout - * @param absolute whether the timeout given is absolute or relative + * @param timeout the absolute time or relative timeout (microseconds) + * @param absolute whether the timeout given is absolute (!0) or relative (0) */ APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex, apr_time_t timeout, diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index 09fde2ff239..d6f05d48983 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -119,8 +119,8 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex); * Attempt to acquire the lock for the given mutex until timeout expires. * If the acquisition time outs, the call returns with APR_TIMEUP. * @param mutex the mutex on which to attempt the lock acquiring. - * @param timeout the absolute (non 0) or relative (0) timeout - * @param absolute whether the timeout given is absolute or relative + * @param timeout the absolute time or relative timeout (microseconds) + * @param absolute whether the timeout given is absolute (!0) or relative (0) */ APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, apr_time_t timeout, diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index f95b937181d..819173a24cf 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -87,8 +87,8 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex); * Attempt to acquire the lock for the given mutex until timeout expires. * If the acquisition time outs, the call returns with APR_TIMEUP. * @param mutex the mutex on which to attempt the lock acquiring. - * @param timeout the absolute (non 0) or relative (0) timeout - * @param absolute whether the timeout given is absolute or relative + * @param timeout the absolute time or relative timeout (microseconds) + * @param absolute whether the timeout given is absolute (!0) or relative (0) */ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, apr_time_t timeout, From c02d1bb77c7de9b7248c0e316cb3c8eb827a68b3 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 20 Mar 2015 00:58:42 +0000 Subject: [PATCH 7507/7878] Follow up to r1666341: fix timeout given to poll() from usecs to msecs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667914 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index a11e7a93298..4414ee10763 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -251,13 +251,14 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, } return APR_SUCCESS; } - if (timeout > 0) { timeout /= 1000; } - ret = WSAPoll(pollset->p->pollset, pollset->nelts, (int)timeout); #else + if (timeout > 0) { + timeout /= 1000; + } ret = poll(pollset->p->pollset, pollset->nelts, timeout); #endif (*num) = ret; From 35735971de13422694c0d2621bbec3cf07a315bf Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 20 Mar 2015 01:02:14 +0000 Subject: [PATCH 7508/7878] Follow up to r1089433: handle impl_pollcb_poll(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667915 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 4414ee10763..0764d5f982e 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -397,12 +397,23 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, apr_status_t rv = APR_SUCCESS; apr_uint32_t i; +#ifdef WIN32 + /* WSAPoll() requires at least one socket. */ + if (pollcb->nelts == 0) { + if (timeout > 0) { + apr_sleep(timeout); + return APR_TIMEUP; + } + return APR_SUCCESS; + } if (timeout > 0) { timeout /= 1000; } -#ifdef WIN32 ret = WSAPoll(pollcb->pollset.ps, pollcb->nelts, (int)timeout); #else + if (timeout > 0) { + timeout /= 1000; + } ret = poll(pollcb->pollset.ps, pollcb->nelts, timeout); #endif if (ret < 0) { From 98b58b77a98baf7d80076de573ff81b13ba8f599 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 20 Mar 2015 01:09:21 +0000 Subject: [PATCH 7509/7878] Follow up to r1666341: fix missing apr_socket_create() and apr_socket_accept() cases. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667916 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 9fc774ed0ed..e95ce2c7dde 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -175,18 +175,21 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, #ifndef HAVE_SOCK_CLOEXEC { int flags; + apr_status_t rv; if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1) { + rv = errno; close((*new)->socketdes); (*new)->socketdes = -1; - return errno; + return rv; } flags |= FD_CLOEXEC; if (fcntl((*new)->socketdes, F_SETFD, flags) == -1) { + rv = errno; close((*new)->socketdes); (*new)->socketdes = -1; - return errno; + return rv; } } #endif @@ -357,18 +360,21 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, #ifndef HAVE_ACCEPT4 { int flags; + apr_status_t rv; if ((flags = fcntl((*new)->socketdes, F_GETFD)) == -1) { + rv = errno; close((*new)->socketdes); (*new)->socketdes = -1; - return errno; + return rv; } flags |= FD_CLOEXEC; if (fcntl((*new)->socketdes, F_SETFD, flags) == -1) { + rv = errno; close((*new)->socketdes); (*new)->socketdes = -1; - return errno; + return rv; } } #endif From f84390c43b4a5cf0641e9d8bea02f23647483e40 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 20 Mar 2015 09:16:56 +0000 Subject: [PATCH 7510/7878] Follow up to r1667900: handle negative (infinite) timeout in mutex/cond timedlock/timedwait. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667962 13f79535-47bb-0310-9956-ffa450edef68 --- locks/beos/proc_mutex.c | 37 ++++++------ locks/beos/thread_mutex.c | 40 ++++++------ locks/netware/thread_cond.c | 19 ++++-- locks/netware/thread_mutex.c | 23 ++++--- locks/os2/proc_mutex.c | 27 +++++---- locks/os2/thread_cond.c | 3 +- locks/os2/thread_mutex.c | 26 ++++---- locks/unix/global_mutex.c | 2 +- locks/unix/proc_mutex.c | 114 ++++++++++++++++++++--------------- locks/unix/thread_cond.c | 32 ++++++---- locks/unix/thread_mutex.c | 55 +++++++++++------ locks/win32/proc_mutex.c | 26 ++++---- locks/win32/thread_cond.c | 13 ++-- locks/win32/thread_mutex.c | 26 +++++--- 14 files changed, 263 insertions(+), 180 deletions(-) diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index 0283040bbc2..4408df0940a 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -115,27 +115,28 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, int32 stat; if (atomic_add(&mutex->LockCount, 1) > 0) { - int flag = 0; -#ifdef B_ABSOLUTE_TIMEOUT - if (timeout) { - flag = absolute ? B_ABSOLUTE_TIMEOUT : B_RELATIVE_TIMEOUT; + if (timeout < 0) { + stat = acquire_sem(mutex->Lock); } - stat = acquire_sem_etc(mutex->Lock, 1, flag, timeout); -#else - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; + else { + int flag = 0; + if (timeout > 0) { + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } + flag = B_ABSOLUTE_TIMEOUT; + } + else { + flag = B_RELATIVE_TIMEOUT; + } } - else { - timeout = 0; - } - } - if (timeout) { - flag = B_RELATIVE_TIMEOUT; + stat = acquire_sem_etc(mutex->Lock, 1, flag, timeout); } - stat = acquire_sem_etc(mutex->Lock, 1, flag, timeout); -#endif if (stat < B_NO_ERROR) { atomic_add(&mutex->LockCount, -1); if (stat == B_TIMED_OUT) { diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index 257d125086a..2fa1bc70b2d 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -116,8 +116,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) } if (atomic_add(&mutex->LockCount, 1) > 0) { - if ((stat = acquire_sem_etc(mutex->Lock, 1, - B_TIMEOUT, 0)) < B_NO_ERROR) { + if ((stat = acquire_sem_etc(mutex->Lock, 1, 0, 0)) < B_NO_ERROR) { atomic_add(&mutex->LockCount, -1); if (stat == B_WOULD_BLOCK) { stat = APR_EBUSY; @@ -145,24 +144,29 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, } if (atomic_add(&mutex->LockCount, 1) > 0) { -#ifdef B_ABSOLUTE_TIMEOUT - stat = acquire_sem_etc(mutex->Lock, 1, - absolute ? B_ABSOLUTE_TIMEOUT - : B_RELATIVE_TIMEOUT, - timeout); -#else - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; - } - else { - timeout = 0; + if (timeout < 0) { + stat = acquire_sem(mutex->Lock); + } + else { + int flag = 0; + if (timeout > 0) { + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } + flag = B_ABSOLUTE_TIMEOUT; + } + else { + flag = B_RELATIVE_TIMEOUT; + } } + stat = acquire_sem_etc(mutex->Lock, 1, flag, timeout); } - stat = acquire_sem_etc(mutex->Lock, 1, B_TIMEOUT, timeout); -#endif - if (stat < B_NO_ERROR) { + if (stat < B_NO_ERROR) { atomic_add(&mutex->LockCount, -1); if (stat == B_TIMED_OUT) { stat = APR_TIMEUP; diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c index dcb21edc9e0..da1162bc27c 100644 --- a/locks/netware/thread_cond.c +++ b/locks/netware/thread_cond.c @@ -66,10 +66,21 @@ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, - apr_interval_time_t timeout){ - if (NXCondTimedWait(cond->cond, mutex->mutex, - (timeout*1000)/NXGetSystemTick()) == NX_ETIMEDOUT) { - return APR_TIMEUP; + apr_interval_time_t timeout) +{ + int rc; + if (timeout < 0) { + rc = NXCondWait(cond->cond, mutex->mutex); + } + else { + timeout = timeout * 1000 / XGetSystemTick(); + rc = NXCondTimedWait(cond->cond, mutex->mutex, timeout); + if (rc == NX_ETIMEDOUT) { + return APR_TIMEUP; + } + } + if (rc != 0) { + return APR_EINTR; } return APR_SUCCESS; } diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index a43215dced8..a11ad834504 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -119,17 +119,22 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, apr_status_t rv; NXLock(mutex->mutex); if (mutex->locked) { - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; - } - else { - timeout = 0; + mutex->num_waiters++; + if (timeout < 0) { + rv = apr_thread_cond_dwait(mutex->cond, mutex); + } + else { + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } } + rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout); } - mutex->num_waiters++; - rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout); mutex->num_waiters--; } else { diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 171c119a5bf..e873963f2fe 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -162,19 +162,24 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, { ULONG rc; - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; - } - else { - timeout = 0; - } + if (timeout < 0) { + rc = DosRequestMutexSem(mutex->hMutex, SEM_INDEFINITE_WAIT); } + else { + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } + } - rc = DosRequestMutexSem(mutex->hMutex, apr_time_as_msec(timeout)); - if (rc == ERROR_TIMEOUT) { - return APR_TIMEUP; + rc = DosRequestMutexSem(mutex->hMutex, apr_time_as_msec(timeout)); + if (rc == ERROR_TIMEOUT) { + return APR_TIMEUP; + } } if (rc == 0) { diff --git a/locks/os2/thread_cond.c b/locks/os2/thread_cond.c index 284bd00f197..86dbb8881ad 100644 --- a/locks/os2/thread_cond.c +++ b/locks/os2/thread_cond.c @@ -131,7 +131,8 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, apr_interval_time_t timeout) { - ULONG timeout_ms = apr_time_as_msec(timeout); + ULONG timeout_ms = (timeout >= 0) ? apr_time_as_msec(timeout) + : SEM_INDEFINITE_WAIT; return thread_cond_timedwait(cond, mutex, timeout_ms); } diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index 245b788c421..1efd6ac14ed 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -82,21 +82,25 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, { ULONG rc; - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; + if (timeout < 0) { + rc = DosRequestMutexSem(mutex->hMutex, SEM_INDEFINITE_WAIT); + } + else { + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } } - else { - timeout = 0; + rc = DosRequestMutexSem(mutex->hMutex, apr_time_as_msec(usec)); + if (rc == ERROR_TIMEOUT) { + return APR_TIMEUP; } } - rc = DosRequestMutexSem(mutex->hMutex, apr_time_as_msec(usec)); - if (rc == ERROR_TIMEOUT) { - return APR_TIMEUP; - } - return APR_FROM_OS_ERROR(rc); } diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index b5523d85233..4525eaeee2a 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -147,7 +147,7 @@ APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex, { apr_status_t rv; - if (!absolute) { + if (timeout >= 0 && !absolute) { timeout += apr_time_now(); } diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 5ac787f0c01..f66cd6c9cc6 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -179,19 +179,28 @@ static apr_status_t proc_mutex_posix_timedacquire(apr_proc_mutex_t *mutex, int absolute) { #if HAVE_SEM_TIMEDWAIT - struct timespec abstime; - - if (!absolute) { - timeout += apr_time_now(); + if (timeout < 0) { + return proc_mutex_posix_acquire(mutex); } - abstime.tv_sec = apr_time_sec(timeout); - abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + else { + int rc; + struct timespec abstime; - if (sem_timedwait(mutex->psem_interproc, &abstime) < 0) { - if (errno == ETIMEDOUT) { - return APR_TIMEUP; + if (!absolute) { + timeout += apr_time_now(); + } + abstime.tv_sec = apr_time_sec(timeout); + abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + + do { + rc = sem_timedwait(mutex->psem_interproc, &abstime); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { + if (errno == ETIMEDOUT) { + return APR_TIMEUP; + } + return errno; } - return errno; } mutex->curr_locked = 1; return APR_SUCCESS; @@ -325,24 +334,27 @@ static apr_status_t proc_mutex_sysv_timedacquire(apr_proc_mutex_t *mutex, int absolute) { #if HAVE_SEMTIMEDOP - int rc; - struct timespec abstime; - - if (!absolute) { - timeout += apr_time_now(); + if (timeout < 0) { + return proc_mutex_sysv_acquire(mutex); } - abstime.tv_sec = apr_time_sec(timeout); - abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ - - do { - rc = semtimedop(mutex->interproc->filedes, &proc_mutex_op_on, 1, - &abstime); - } while (rc < 0 && errno == EINTR); - if (rc < 0) { - if (errno == EAGAIN) { - return APR_TIMEUP; + else { + int rc; + struct timespec abstime; + if (!absolute) { + timeout += apr_time_now(); + } + abstime.tv_sec = apr_time_sec(timeout); + abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + do { + rc = semtimedop(mutex->interproc->filedes, &proc_mutex_op_on, 1, + &abstime); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { + if (errno == EAGAIN) { + return APR_TIMEUP; + } + return errno; } - return errno; } mutex->curr_locked = 1; return APR_SUCCESS; @@ -567,7 +579,7 @@ static apr_status_t proc_mutex_proc_pthread_tryacquire(apr_proc_mutex_t *mutex) #endif } mutex->curr_locked = 1; - return rv; + return APR_SUCCESS; } static apr_status_t @@ -575,36 +587,42 @@ proc_mutex_proc_pthread_timedacquire(apr_proc_mutex_t *mutex, apr_time_t timeout, int absolute) { - apr_status_t rv; - struct timespec abstime; - - if (!absolute) { - timeout += apr_time_now(); + if (timeout < 0) { + return proc_mutex_proc_pthread_acquire(mutex); } - abstime.tv_sec = apr_time_sec(timeout); - abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + else { + apr_status_t rv; + struct timespec abstime; + + if (!absolute) { + timeout += apr_time_now(); + } + abstime.tv_sec = apr_time_sec(timeout); + abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ - if ((rv = pthread_mutex_timedlock(mutex->pthread_interproc, &abstime))) { + if ((rv = pthread_mutex_timedlock(mutex->pthread_interproc, + &abstime))) { #ifdef HAVE_ZOS_PTHREADS - rv = errno; + rv = errno; #endif - if (rv == ETIMEDOUT) { - return APR_TIMEUP; - } + if (rv == ETIMEDOUT) { + return APR_TIMEUP; + } #ifdef HAVE_PTHREAD_MUTEX_ROBUST - /* Okay, our owner died. Let's try to make it consistent again. */ - if (rv == EOWNERDEAD) { - pthread_mutex_consistent_np(mutex->pthread_interproc); - rv = APR_SUCCESS; - } - else - return rv; + /* Okay, our owner died. Let's try to make it consistent again. */ + if (rv == EOWNERDEAD) { + pthread_mutex_consistent_np(mutex->pthread_interproc); + rv = APR_SUCCESS; + } + else + return rv; #else - return rv; + return rv; #endif + } } mutex->curr_locked = 1; - return rv; + return APR_SUCCESS; } static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex) diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c index db7dd4f0d97..3c8e3170a0d 100644 --- a/locks/unix/thread_cond.c +++ b/locks/unix/thread_cond.c @@ -79,21 +79,31 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, apr_interval_time_t timeout) { apr_status_t rv; - apr_time_t then; - struct timespec abstime; + if (timeout < 0) { + rv = pthread_cond_wait(&cond->cond, &mutex->mutex); +#ifdef HAVE_ZOS_PTHREADS + if (rv) { + rv = errno; + } +#endif + } + else { + apr_time_t then; + struct timespec abstime; - then = apr_time_now() + timeout; - abstime.tv_sec = apr_time_sec(then); - abstime.tv_nsec = apr_time_usec(then) * 1000; /* nanoseconds */ + then = apr_time_now() + timeout; + abstime.tv_sec = apr_time_sec(then); + abstime.tv_nsec = apr_time_usec(then) * 1000; /* nanoseconds */ - rv = pthread_cond_timedwait(&cond->cond, &mutex->mutex, &abstime); + rv = pthread_cond_timedwait(&cond->cond, &mutex->mutex, &abstime); #ifdef HAVE_ZOS_PTHREADS - if (rv) { - rv = errno; - } + if (rv) { + rv = errno; + } #endif - if (ETIMEDOUT == rv) { - return APR_TIMEUP; + if (ETIMEDOUT == rv) { + return APR_TIMEUP; + } } return rv; } diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 297bf018d82..fe515b2e653 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -196,21 +196,31 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, apr_status_t rv = APR_ENOTIMPL; #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK - struct timespec abstime; - - if (!absolute) { - timeout += apr_time_now(); + if (timeout < 0) { + rv = pthread_mutex_lock(&mutex->mutex); + if (rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + } } - abstime.tv_sec = apr_time_sec(timeout); - abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + else { + struct timespec abstime; - rv = pthread_mutex_timedlock(&mutex->mutex, &abstime); - if (rv) { + if (!absolute) { + timeout += apr_time_now(); + } + abstime.tv_sec = apr_time_sec(timeout); + abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + + rv = pthread_mutex_timedlock(&mutex->mutex, &abstime); + if (rv) { #ifdef HAVE_ZOS_PTHREADS - rv = errno; + rv = errno; #endif - if (rv == ETIMEDOUT) { - rv = APR_TIMEUP; + if (rv == ETIMEDOUT) { + rv = APR_TIMEUP; + } } } @@ -228,17 +238,22 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, } if (mutex->locked) { - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; - } - else { - timeout = 0; + mutex->num_waiters++; + if (timeout < 0) { + rv = apr_thread_cond_wait(mutex->cond, mutex); + } + else { + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } } + rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout); } - mutex->num_waiters++; - rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout); mutex->num_waiters--; } else { diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 6af991e8c49..5ec9b2648a8 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -166,24 +166,28 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, { DWORD rv; - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; + if (timeout < 0) { + rv = WaitForSingleObject(mutex->handle, INFINITE); + } + else { + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } } - else { - timeout = 0; + rv = WaitForSingleObject(mutex->handle, apr_time_as_msec(timeout)); + if (rv == WAIT_TIMEOUT) { + return APR_TIMEUP; } } - rv = WaitForSingleObject(mutex->handle, apr_time_as_msec(timeout)); - if (rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) { return APR_SUCCESS; } - else if (rv == WAIT_TIMEOUT) { - return APR_TIMEUP; - } return apr_get_os_error(); } diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index 60286e542d1..b2ac1c8ff1e 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -61,9 +61,9 @@ APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) return apr_pool_cleanup_run(cond->pool, cond, thread_cond_cleanup); } -static APR_INLINE apr_status_t _thread_cond_timedwait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex, - DWORD timeout_ms ) +static APR_INLINE apr_status_t thread_cond_timedwait(apr_thread_cond_t *cond, + apr_thread_mutex_t *mutex, + DWORD timeout_ms ) { DWORD res; apr_status_t rv; @@ -115,16 +115,15 @@ static APR_INLINE apr_status_t _thread_cond_timedwait(apr_thread_cond_t *cond, APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex) { - return _thread_cond_timedwait(cond, mutex, INFINITE); + return thread_cond_timedwait(cond, mutex, INFINITE); } APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, apr_interval_time_t timeout) { - DWORD timeout_ms = (DWORD) apr_time_as_msec(timeout); - - return _thread_cond_timedwait(cond, mutex, timeout_ms); + DWORD timeout_ms = (timeout >= 0) ? apr_time_as_msec(timeout) : INFINITE; + return thread_cond_timedwait(cond, mutex, timeout_ms); } APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index c467829ea88..cd0ccf5ba5b 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -119,19 +119,25 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, int absolute) { if (mutex->type != thread_mutex_critical_section) { - DWORD rv; - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; - } - else { - timeout = 0; + DWORD rv, timeout_ms; + if (timeout < 0) { + timeout_ms = INFINITE; + } + else { + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } } + timeout_ms = apr_time_as_msec(timeout); } - rv = WaitForSingleObject(mutex->handle, apr_time_as_msec(timeout)); + rv = WaitForSingleObject(mutex->handle, timeout_ms); if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) { - return (rv == WAIT_TIMEOUT) ? APR_EBUSY : apr_get_os_error(); + return (rv == WAIT_TIMEOUT) ? APR_TIMEUP : apr_get_os_error(); } return APR_SUCCESS; } From 1f1d22a95826bf50c51b49e6afe98dfffadaf3be Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 24 Mar 2015 12:44:48 +0000 Subject: [PATCH 7511/7878] Add hint on a version of cmake that works with OpenSSL 1.0.2. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1668865 13f79535-47bb-0310-9956-ffa450edef68 --- README.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.cmake b/README.cmake index cf8b8817361..2e9108088e8 100644 --- a/README.cmake +++ b/README.cmake @@ -31,6 +31,8 @@ Prerequisites The following tools must be in PATH: * cmake, version 2.8 or later + (It has been reported that cmake version 3.1.3 is needed if you build + APR in conjunction with OpenSSL 1.0.2.) * If using a command-line compiler: compiler and linker and related tools (Refer to the cmake documentation for more information.) From eeb735fab146d01cf1ff43a3a4fee68bdcec6ced Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Wed, 25 Mar 2015 06:56:52 +0000 Subject: [PATCH 7512/7878] Fix doxygen error git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1669056 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_memcache.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/apr_memcache.h b/include/apr_memcache.h index ac11370c367..2a3bcaab88b 100644 --- a/include/apr_memcache.h +++ b/include/apr_memcache.h @@ -370,7 +370,6 @@ APR_DECLARE(apr_status_t) apr_memcache_decr(apr_memcache_t *mc, * @param ms server to query * @param p Pool to allocate answer from * @param baton location to store server version string - * @param len length of the server version string */ APR_DECLARE(apr_status_t) apr_memcache_version(apr_memcache_server_t *ms, apr_pool_t *p, From c3a063e39775feb9e8b68a82787e1af1a1a3d236 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Wed, 25 Mar 2015 07:09:05 +0000 Subject: [PATCH 7513/7878] Fix doxygen error git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1669057 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_pool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_pool.h b/include/apr_thread_pool.h index 639c3a60872..84abd661e87 100644 --- a/include/apr_thread_pool.h +++ b/include/apr_thread_pool.h @@ -267,7 +267,7 @@ APR_DECLARE(apr_size_t) apr_thread_pool_thread_max_get(apr_thread_pool_t *me); /** * Access function for the threshold of tasks in queue to trigger a new thread. * @param me The thread pool - * @param cnt The new threshold + * @param val The new threshold * @return The original threshold */ APR_DECLARE(apr_size_t) apr_thread_pool_threshold_set(apr_thread_pool_t *me, From 0f22b40af5e83e22d3ece4a9819005d98bc5fd85 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Wed, 25 Mar 2015 07:14:20 +0000 Subject: [PATCH 7514/7878] Fix doxygen error + be consistent in parameter naming git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1669058 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_md5.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_md5.h b/include/apr_md5.h index 796f9df7298..1e5ba359ec5 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -131,17 +131,17 @@ APR_DECLARE(apr_status_t) apr_md5(unsigned char digest[APR_MD5_DIGESTSIZE], /** * Encode a password using an MD5 algorithm - * @param password The password to encode + * @param pw The password to encode * @param salt The salt string to use for the encoding * @param result The string to store the encoded password in * @param nbytes The size of the result buffer */ -APR_DECLARE(apr_status_t) apr_md5_encode(const char *password, const char *salt, +APR_DECLARE(apr_status_t) apr_md5_encode(const char *pw, const char *salt, char *result, apr_size_t nbytes); /** * Encode a password using the bcrypt algorithm - * @param password The password to encode + * @param pw The password to encode * @param count The cost of the encoding, possible values are 4 to 31 * @param salt Pointer to binary data to be used as salt for the encoding * @param salt_len The size of the salt data (must be >= 16) From 5b8da7ceb8f269d945c24c4dc24f128e81d8cdb5 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Wed, 25 Mar 2015 07:17:48 +0000 Subject: [PATCH 7515/7878] Fix doxygen error git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1669059 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_dbd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_dbd.h b/include/apr_dbd.h index 1e8da00ab26..6b9032778b0 100644 --- a/include/apr_dbd.h +++ b/include/apr_dbd.h @@ -231,8 +231,8 @@ APR_DECLARE(int) apr_dbd_transaction_start(const apr_dbd_driver_t *driver, * May be a no-op. * * @param driver - the driver - * @param handle - the db connection - * @param trans - the transaction. + * @param pool - working pool + * @param trans - the transaction * @return 0 for success or error code */ APR_DECLARE(int) apr_dbd_transaction_end(const apr_dbd_driver_t *driver, From 378caa39dc9f36bf746d13b9de56bb0661e23515 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 25 Mar 2015 09:07:34 +0000 Subject: [PATCH 7516/7878] locks: follow up to r1667900. In apr_global_mutex_timedlock(), we can avoid converting from relative to absolute time if thread locking is not needed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1669077 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/global_mutex.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index 4525eaeee2a..19485c48756 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -147,20 +147,22 @@ APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex, { apr_status_t rv; - if (timeout >= 0 && !absolute) { - timeout += apr_time_now(); - } - #if APR_HAS_THREADS if (mutex->thread_mutex) { - rv = apr_thread_mutex_timedlock(mutex->thread_mutex, timeout, 1); + if (timeout >= 0 && !absolute) { + timeout += apr_time_now(); + absolute = 1; + } + rv = apr_thread_mutex_timedlock(mutex->thread_mutex, timeout, + absolute); if (rv != APR_SUCCESS) { return rv; } } #endif /* APR_HAS_THREADS */ - rv = apr_proc_mutex_timedlock(mutex->proc_mutex, timeout, 1); + rv = apr_proc_mutex_timedlock(mutex->proc_mutex, timeout, + absolute); #if APR_HAS_THREADS if (rv != APR_SUCCESS) { From 79ba66ba1c4db705b5b46440ff13f6f46b2a5601 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 4 Apr 2015 18:05:29 +0000 Subject: [PATCH 7517/7878] Remove entries for features/fixes already merged back to apr 1.5.x or 1.6.x git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1671286 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/CHANGES b/CHANGES index 1eb1661a674..ab78a0542cc 100644 --- a/CHANGES +++ b/CHANGES @@ -5,24 +5,10 @@ Changes for APR 2.0.0 support timedout operations. PR 56951. [Anthony Minessale , Travis Cross , Yann Ylavic]. - *) apr_pollset: On z/OS, threadsafe apr_pollset_poll() may return - "EDC8102I Operation would block" under load. - [Pat Odonnell ] - *) apr_escape: Correctly calculate the size of the returned string in apr_escape_path and set the correct return value in case we actually escape the string. [] PR 57230. - *) On z/OS, apr_sockaddr_info_get() with family == APR_UNSPEC was not - returning IPv4 addresses if any IPv6 addresses were returned. - [Eric Covener] - - *) apr_skiplist: Fix potential corruption of skiplists leading to - unexpected results or crashes. - [Takashi Sato , Eric Covener] PR 56654. - - *) apr_skiplist: Add apr_skiplist_add() to support multiple values. - *) apr_allocator: Be less wasteful and don't return a memnode that is much larger than what was requested. [Stefan Fuhrmann ] @@ -67,9 +53,6 @@ Changes for APR 2.0.0 *) Transfer the apr-util spec file contents to apr.spec. [Graham Leggett] - *) apr_thread_cond_*wait() on BeOS: Fix broken logic. PR 45800. - [Jochen Voss (no e-mail)] - *) Added Unix domain socket support. [Mladen Turk] *) Merge APR-util into APR. [various] From a3ef0fcfb4183a440b27930f38d28829ea4de23f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 4 Apr 2015 18:46:25 +0000 Subject: [PATCH 7518/7878] PR 57230 fix now in 1.6.x and 1.5.x branches git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1671291 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGES b/CHANGES index ab78a0542cc..04563e1a71b 100644 --- a/CHANGES +++ b/CHANGES @@ -5,10 +5,6 @@ Changes for APR 2.0.0 support timedout operations. PR 56951. [Anthony Minessale , Travis Cross , Yann Ylavic]. - *) apr_escape: Correctly calculate the size of the returned string in - apr_escape_path and set the correct return value in case we actually - escape the string. [] PR 57230. - *) apr_allocator: Be less wasteful and don't return a memnode that is much larger than what was requested. [Stefan Fuhrmann ] From 5d9522c50a26a7daeb8d545ed58fe3afa3b4ef24 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 4 Apr 2015 18:54:26 +0000 Subject: [PATCH 7519/7878] make internal function static to avoid a warning git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1671292 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlockperf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testlockperf.c b/test/testlockperf.c index 39fc256a199..10442710d84 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -180,7 +180,7 @@ int test_thread_mutex_nested(int num_threads) return APR_SUCCESS; } -int test_thread_mutex_timed(int num_threads) +static int test_thread_mutex_timed(int num_threads) { apr_thread_t *t[MAX_THREADS]; apr_status_t s[MAX_THREADS]; From a775ad7041e641ebe984b1927daa3686989d2c54 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 4 Apr 2015 19:23:03 +0000 Subject: [PATCH 7520/7878] build: Correctly use AC_(PATH|CHECK)_TOOL to support cross compilation. PR: 56866 Submitted by: Timothy Gu Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1671296 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ build/dbd.m4 | 16 ++++++++-------- configure.in | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 04563e1a71b..0093051c0cb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) build: Correctly use AC_(PATH|CHECK)_TOOL to support cross compilation. + PR: 56866. [Timothy Gu ] + *) apr_queue: Add apr_queue_timedpush() and apr_queue_timedpop() to support timedout operations. PR 56951. [Anthony Minessale , Travis Cross , Yann Ylavic]. diff --git a/build/dbd.m4 b/build/dbd.m4 index f5f6722c7cf..3ae9679928e 100644 --- a/build/dbd.m4 +++ b/build/dbd.m4 @@ -31,7 +31,7 @@ AC_DEFUN([APU_CHECK_DBD], [ AC_ARG_WITH([pgsql], APR_HELP_STRING([--with-pgsql=DIR], [specify PostgreSQL location]), [ if test "$withval" = "yes"; then - AC_PATH_PROG([PGSQL_CONFIG],[pg_config]) + AC_PATH_TOOL([PGSQL_CONFIG],[pg_config]) if test "x$PGSQL_CONFIG" != 'x'; then pgsql_CPPFLAGS="-I`$PGSQL_CONFIG --includedir`" pgsql_LDFLAGS="-L`$PGSQL_CONFIG --libdir`" @@ -68,7 +68,7 @@ AC_DEFUN([APU_CHECK_DBD], [ elif test "$withval" = "no"; then : else - AC_PATH_PROG([PGSQL_CONFIG],[pg_config],,[$withval/bin]) + AC_PATH_TOOL([PGSQL_CONFIG],[pg_config],,[$withval/bin]) if test "x$PGSQL_CONFIG" != 'x'; then pgsql_CPPFLAGS="-I`$PGSQL_CONFIG --includedir`" pgsql_LDFLAGS="-L`$PGSQL_CONFIG --libdir`" @@ -108,7 +108,7 @@ AC_DEFUN([APU_CHECK_DBD], [ fi fi ], [ - AC_PATH_PROG([PGSQL_CONFIG],[pg_config]) + AC_PATH_TOOL([PGSQL_CONFIG],[pg_config]) if test "x$PGSQL_CONFIG" != 'x'; then pgsql_CPPFLAGS="-I`$PGSQL_CONFIG --includedir`" pgsql_LDFLAGS="-L`$PGSQL_CONFIG --libdir`" @@ -166,7 +166,7 @@ AC_DEFUN([APU_CHECK_DBD_MYSQL], [ AC_ARG_WITH([mysql], APR_HELP_STRING([--with-mysql=DIR], [enable MySQL DBD driver]), [ if test "$withval" = "yes"; then - AC_PATH_PROG([MYSQL_CONFIG],[mysql_config]) + AC_PATH_TOOL([MYSQL_CONFIG],[mysql_config]) if test "x$MYSQL_CONFIG" != 'x'; then mysql_CPPFLAGS="`$MYSQL_CONFIG --include`" mysql_LDFLAGS="`$MYSQL_CONFIG --libs_r | sed -e 's/-l[[^ ]]\+//g'`" @@ -192,7 +192,7 @@ AC_DEFUN([APU_CHECK_DBD_MYSQL], [ elif test "$withval" = "no"; then : else - AC_PATH_PROG([MYSQL_CONFIG],[mysql_config],,[$withval/bin]) + AC_PATH_TOOL([MYSQL_CONFIG],[mysql_config],,[$withval/bin]) if test "x$MYSQL_CONFIG" != 'x'; then mysql_CPPFLAGS="`$MYSQL_CONFIG --include`" mysql_LDFLAGS="`$MYSQL_CONFIG --libs_r | sed -e 's/-l[[^ ]]\+//g'`" @@ -420,7 +420,7 @@ AC_DEFUN([APU_CHECK_DBD_ODBC], [ AC_ARG_WITH([odbc], APR_HELP_STRING([--with-odbc=DIR], [specify ODBC location]), [ if test "$withval" = "yes"; then - AC_PATH_PROG([ODBC_CONFIG],[odbc_config]) + AC_PATH_TOOL([ODBC_CONFIG],[odbc_config]) if test "x$ODBC_CONFIG" != 'x'; then odbc_CPPFLAGS="-I`$ODBC_CONFIG --include-prefix`" odbc_LDFLAGS="-L`$ODBC_CONFIG --lib-prefix`" @@ -441,7 +441,7 @@ AC_DEFUN([APU_CHECK_DBD_ODBC], [ elif test "$withval" = "no"; then : else - AC_PATH_PROG([ODBC_CONFIG],[odbc_config],,[$withval/bin]) + AC_PATH_TOOL([ODBC_CONFIG],[odbc_config],,[$withval/bin]) if test "x$ODBC_CONFIG" != 'x'; then odbc_CPPFLAGS="-I`$ODBC_CONFIG --include-prefix`" odbc_LDFLAGS="-L`$ODBC_CONFIG --lib-prefix`" @@ -471,7 +471,7 @@ AC_DEFUN([APU_CHECK_DBD_ODBC], [ fi fi ], [ - AC_PATH_PROG([ODBC_CONFIG],[odbc_config]) + AC_PATH_TOOL([ODBC_CONFIG],[odbc_config]) if test "x$ODBC_CONFIG" != 'x'; then odbc_CPPFLAGS="-I`$ODBC_CONFIG --include-prefix`" odbc_LDFLAGS="-L`$ODBC_CONFIG --lib-prefix`" diff --git a/configure.in b/configure.in index fefb8897084..61a526732e0 100644 --- a/configure.in +++ b/configure.in @@ -219,8 +219,8 @@ AC_PROG_LN_S AC_PROG_RANLIB AC_PROG_INSTALL AC_CHECK_PROG(RM, rm, rm) -AC_CHECK_PROG(AS, as, as) -AC_CHECK_PROG(ASCPP, cpp, cpp) +AC_CHECK_TOOL(AS, as, as) +AC_CHECK_TOOL(ASCPP, cpp, cpp) AC_CHECK_TOOL(AR, ar, ar) dnl Various OS checks that apparently set required flags From 8652cc9e4f8674064af30d10305be956f2c9f117 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 4 Apr 2015 20:52:49 +0000 Subject: [PATCH 7521/7878] Stop using -no-cpp-precomp on Darwin or OS X. The Apple-modified gcc hasn't needed it in over a decade, and GNU gcc spews warnings about it. Misty De Meo provided the best research: The last release I can find where -cpp-precomp did anything is 2.95.2 (Apple build 937.2), from the December 2002 Xcode, prior to the release of Xcode 1.0 (presumably the one that shipped with it): http://opensource.apple.com/source/gcc/gcc-1640/gcc/gcc.c In subsequent releases -cpp-precomp and -no-cpp-precomp were both made no-ops. The last time they were mentioned was in the install.texi from Apple GCC build 1765, from the WWDC 2004 developer tools; it was already a no-op by then. Submitted by: Neil Conway , Misty De Meo Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1671329 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- build/aprenv.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 7453b987d2a..549a2db2237 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -183,7 +183,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DRHAPSODY]) ;; *-apple-darwin*) - APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp]) + APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK]) APR_SETIFNULL(apr_posixsem_is_global, [yes]) case $host in *-apple-darwin[[1-9]].*) diff --git a/build/aprenv.py b/build/aprenv.py index dadfe809c1a..b1e7c0c30ef 100644 --- a/build/aprenv.py +++ b/build/aprenv.py @@ -122,7 +122,7 @@ def Filter(self, **kw): def APRHints(self): # TOOD: port more from apr_hints.m4 if self['PLATFORM'] == 'darwin': - self.AppendUnique(CPPFLAGS=['-DDARWIN', '-DSIGPROCMASK_SETS_THREAD_MASK', '-no-cpp-precomp']) + self.AppendUnique(CPPFLAGS=['-DDARWIN', '-DSIGPROCMASK_SETS_THREAD_MASK']) def critical_value(self, f, value, *args): From 1bad2f93be404876d0c9576a6e93c36c97b97b47 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 4 Apr 2015 22:20:59 +0000 Subject: [PATCH 7522/7878] Don't use mkstemp() on HP-UX. It is limited to creation of 26 temporary files. PR: 57677 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1671356 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 61a526732e0..231b70456b7 100644 --- a/configure.in +++ b/configure.in @@ -1312,7 +1312,15 @@ if test "$native_mmap_emul" = "1"; then mmap="1" fi AC_CHECK_FUNCS(memmove, [ have_memmove="1" ], [have_memmove="0" ]) -AC_CHECK_FUNCS([getpass getpassphrase gmtime_r localtime_r mkstemp]) +AC_CHECK_FUNCS([getpass getpassphrase gmtime_r localtime_r]) +case $host in + *-hp-hpux*) + dnl mkstemp is limited to 26 temporary files (a-z); use APR replacement + ;; + *) + AC_CHECK_FUNCS(mkstemp) + ;; +esac AC_SUBST(fork) AC_SUBST(have_inet_addr) @@ -1754,7 +1762,15 @@ APR_CHECK_SIZEOF_EXTENDED([#include ], off_t, 8) if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then # Enable LFS aprlfs=1 - AC_CHECK_FUNCS([mmap64 sendfile64 sendfilev64 mkstemp64 readdir64_r]) + AC_CHECK_FUNCS([mmap64 sendfile64 sendfilev64 readdir64_r]) + case $host in + *-hp-hpux*) + dnl mkstemp64 is limited to 26 temporary files (a-z); use APR replacement + ;; + *) + AC_CHECK_FUNCS(mkstemp64) + ;; + esac elif test "${ac_cv_sizeof_off_t}" != "${ac_cv_sizeof_size_t}"; then # unsure of using -gt above is as portable, can can't forsee where # off_t can legitimately be smaller than size_t From e282819440197f668dcbafe7564c44cf9bffeb46 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 5 Apr 2015 01:06:02 +0000 Subject: [PATCH 7523/7878] Fix the statement about OpenSSL and cmake 3.1.3. (Thanks, Bert) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1671362 13f79535-47bb-0310-9956-ffa450edef68 --- README.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.cmake b/README.cmake index 2e9108088e8..380f97bce55 100644 --- a/README.cmake +++ b/README.cmake @@ -31,8 +31,8 @@ Prerequisites The following tools must be in PATH: * cmake, version 2.8 or later - (It has been reported that cmake version 3.1.3 is needed if you build - APR in conjunction with OpenSSL 1.0.2.) + cmake version 3.1.3 or later is required to work with current OpenSSL + releases. (OpenSSL is an optional prerequisite of APR.) * If using a command-line compiler: compiler and linker and related tools (Refer to the cmake documentation for more information.) From e53b7b34f9a29e3c7f43a714f64e6ad701d102bf Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 5 Apr 2015 11:50:45 +0000 Subject: [PATCH 7524/7878] Fix build on non-Unix. This test was never implemented if !APR_HAS_FORK, but the capability check was error prone. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1671386 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index f2992de9e68..ba19b9897ec 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -196,11 +196,9 @@ static void test_exclusive(abts_case *tc, const char *lockname, *x == MAX_COUNTER); } } -#endif static void proc_mutex(abts_case *tc, void *data) { -#if APR_HAS_FORK apr_status_t rv; const char *shmname = "tpm.shm"; apr_shm_t *shm; @@ -220,9 +218,6 @@ static void proc_mutex(abts_case *tc, void *data) test_exclusive(tc, NULL, data); rv = apr_shm_destroy(shm); APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); -#else - ABTS_NOT_IMPL(tc, "APR lacks fork() support"); -#endif } @@ -255,3 +250,18 @@ abts_suite *testprocmutex(abts_suite *suite) } return suite; } + +#else /* APR_HAS_FORK */ + +static void proc_mutex(abts_case *tc, void *data) +{ + ABTS_NOT_IMPL(tc, "APR lacks fork() support"); +} + +abts_suite *testprocmutex(abts_suite *suite) +{ + suite = ADD_SUITE(suite); + abts_run_test(suite, proc_mutex, NULL); + return suite; +} +#endif /* APR_HAS_FORK */ From 1bd210e933132927c3cb57cbf99988b29be29055 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 5 Apr 2015 12:50:54 +0000 Subject: [PATCH 7525/7878] poll() implementation of apr_pollset_poll(): Return APR_EINTR as appropriate. (APR_SUCCESS was returned instead in that scenario.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1671389 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 0764d5f982e..b9c41f38b16 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -261,7 +261,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, } ret = poll(pollset->p->pollset, pollset->nelts, timeout); #endif - (*num) = ret; + *num = 0; if (ret < 0) { return apr_get_netos_error(); } @@ -290,8 +290,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, } } } - if (((*num) = j) > 0) - rv = APR_SUCCESS; + *num = j; } if (descriptors && (*num)) *descriptors = pollset->p->result_set; From aea6f6161ebae4abc12d71bc9a03d877f6566592 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 6 Apr 2015 11:26:42 +0000 Subject: [PATCH 7526/7878] Revert r1671389; apr_pollset_poll() should return APR_SUCCESS and the real event if a real event occurs AND apr_pollset_wakeup() is called before apr_pollset_poll() is called and/or awakened. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1671513 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index b9c41f38b16..9f7ef241055 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -290,7 +290,9 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, } } } - *num = j; + if ((*num = j)) { /* any event besides wakeup pipe? */ + rv = APR_SUCCESS; + } } if (descriptors && (*num)) *descriptors = pollset->p->result_set; From 35bf784bc9d3f5187bc41f991927617883e9fe40 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 6 Apr 2015 11:28:58 +0000 Subject: [PATCH 7527/7878] Test the scenario where apr_pollset_poll() is called after a real event occurs AND apr_pollset_wakeup() has been called. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1671514 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/test/testpoll.c b/test/testpoll.c index 6a247fffee4..588b98d6b4d 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -42,6 +42,11 @@ static apr_pollfd_t *pollarray; static apr_pollfd_t *pollarray_large; #endif +/* default_pollset_impl can be overridden temporarily to control + * testcases which don't specify an implementation explicitly + */ +static int default_pollset_impl = APR_POLLSET_DEFAULT; + static void make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, apr_port_t port, apr_pool_t *p, abts_case *tc) { @@ -287,7 +292,8 @@ static void recv_large_pollarray(abts_case *tc, void *data) static void setup_pollset(abts_case *tc, void *data) { apr_status_t rv; - rv = apr_pollset_create(&pollset, LARGE_NUM_SOCKETS, p, 0); + rv = apr_pollset_create_ex(&pollset, LARGE_NUM_SOCKETS, p, 0, + default_pollset_impl); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } @@ -492,7 +498,8 @@ static void pollset_remove(abts_case *tc, void *data) apr_pollfd_t pfd; apr_int32_t num; - rv = apr_pollset_create(&pollset, 5, p, 0); + rv = apr_pollset_create_ex(&pollset, 5, p, 0, + default_pollset_impl); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); pfd.p = p; @@ -772,21 +779,42 @@ static void pollcb_default(abts_case *tc, void *data) static void pollset_wakeup(abts_case *tc, void *data) { apr_status_t rv; + apr_pollfd_t socket_pollfd; apr_pollset_t *pollset; apr_int32_t num; const apr_pollfd_t *descriptors; - rv = apr_pollset_create(&pollset, 1, p, APR_POLLSET_WAKEABLE); + rv = apr_pollset_create_ex(&pollset, 1, p, APR_POLLSET_WAKEABLE, + default_pollset_impl); if (rv == APR_ENOTIMPL) { ABTS_NOT_IMPL(tc, "apr_pollset_wakeup() not supported"); return; } + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + /* send wakeup but no data; apr_pollset_poll() should return APR_EINTR */ rv = apr_pollset_wakeup(pollset); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_pollset_poll(pollset, -1, &num, &descriptors); ABTS_INT_EQUAL(tc, APR_EINTR, rv); + + /* send wakeup and data; apr_pollset_poll() should return APR_SUCCESS */ + socket_pollfd.desc_type = APR_POLL_SOCKET; + socket_pollfd.reqevents = APR_POLLIN; + socket_pollfd.desc.s = s[0]; + socket_pollfd.client_data = s[0]; + rv = apr_pollset_add(pollset, &socket_pollfd); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + send_msg(s, sa, 0, tc); + + rv = apr_pollset_wakeup(pollset); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_pollset_poll(pollset, -1, &num, &descriptors); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 1, num); } /* Should never be invoked */ @@ -918,12 +946,12 @@ abts_suite *testpoll(abts_suite *suite) abts_run_test(suite, trigger_pollcb, NULL); abts_run_test(suite, timeout_pollcb, NULL); abts_run_test(suite, timeout_pollin_pollcb, NULL); + abts_run_test(suite, pollset_wakeup, NULL); abts_run_test(suite, close_all_sockets, NULL); abts_run_test(suite, pollset_default, NULL); abts_run_test(suite, pollcb_default, NULL); abts_run_test(suite, justsleep, NULL); - abts_run_test(suite, pollset_wakeup, NULL); abts_run_test(suite, pollcb_wakeup, NULL); return suite; } From b295a7a60ac4a28e6a7e55fda2ddbe2229fc5356 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 7 Apr 2015 21:35:50 +0000 Subject: [PATCH 7528/7878] Introduce apr_skiplist_last[_compare]() and apr_skiplist_remove_node(). The apr_skiplist_last[_compare]() functions return the last matching element (duplicate) whereas the existing apr_skiplist_find[_compare]() return the first one encountered during the walk. The function apr_skiplist_remove_node() function allows to remove an element given its node, e.g. an iterator from apr_skiplist_{getlist,previous,next}(). The goal is to have a reliable way to find (and remove) any element having a unique address/pointer, by starting with the last duplicate and then iterating on the previous ones until the match (see example in testskiplist.c). apr_skiplist_last() is much more efficient than apr_skiplist_first() would be, git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1671957 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_skiplist.h | 34 ++++++++++++++++++ tables/apr_skiplist.c | 80 +++++++++++++++++++++++++++++++++--------- test/testskiplist.c | 62 ++++++++++++++++++++++++++++++++ 3 files changed, 159 insertions(+), 17 deletions(-) diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h index b8528967415..1e7ab258c44 100644 --- a/include/apr_skiplist.h +++ b/include/apr_skiplist.h @@ -152,6 +152,30 @@ APR_DECLARE(void *) apr_skiplist_find_compare(apr_skiplist *sl, */ APR_DECLARE(void *) apr_skiplist_find(apr_skiplist *sl, void *data, apr_skiplistnode **iter); +/** + * Return the last matching element in the skip list using the specified + * comparison function. + * @param sl The skip list + * @param data The value to search for + * @param iter A pointer to the returned skip list node representing the element + * found + * @param func The comparison function to use + */ +APR_DECLARE(void *) apr_skiplist_last_compare(apr_skiplist *sli, void *data, + apr_skiplistnode **iter, + apr_skiplist_compare comp); + +/** + * Return the last matching element in the skip list using the current comparison + * function. + * @param sl The skip list + * @param data The value to search for + * @param iter A pointer to the returned skip list node representing the element + * found + */ +APR_DECLARE(void *) apr_skiplist_last(apr_skiplist *sl, void *data, + apr_skiplistnode **iter); + /** * Return the next element in the skip list. * @param sl The skip list @@ -242,6 +266,16 @@ APR_DECLARE(apr_skiplistnode *) apr_skiplist_replace_compare(apr_skiplist *sl, APR_DECLARE(apr_skiplistnode *) apr_skiplist_replace(apr_skiplist *sl, void *data, apr_skiplist_freefunc myfree); +/** + * Remove a node from the skip list. + * @param sl The skip list + * @param iter The skip list node to remove + * @param myfree A function to be called for the removed element + */ +APR_DECLARE(int) apr_skiplist_remove_node(apr_skiplist *sl, + apr_skiplistnode *iter, + apr_skiplist_freefunc myfree); + /** * Remove an element from the skip list using the specified comparison function for * locating the element. In the case of duplicates, the 1st entry will be removed. diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index a8794c069ab..4078dd03eed 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -299,21 +299,21 @@ APR_DECLARE(void) apr_skiplist_add_index(apr_skiplist *sl, } static int skiplisti_find_compare(apr_skiplist *sl, void *data, - apr_skiplistnode **ret, - apr_skiplist_compare comp) + apr_skiplistnode **ret, + apr_skiplist_compare comp, + int last) { int count = 0; - apr_skiplistnode *m; + apr_skiplistnode *m, *found = NULL; for (m = sl->top; m; count++) { if (m->next) { int compared = comp(data, m->next->data); if (compared == 0) { - m = m->next; - while (m->down) { - m = m->down; + found = m = m->next; + if (!last) { + break; } - *ret = m; - return count; + continue; } if (compared > 0) { m = m->next; @@ -322,13 +322,22 @@ static int skiplisti_find_compare(apr_skiplist *sl, void *data, } m = m->down; } - *ret = NULL; + if (found) { + while (found->down) { + found = found->down; + } + *ret = found; + } + else { + *ret = NULL; + } return count; } -APR_DECLARE(void *) apr_skiplist_find_compare(apr_skiplist *sli, void *data, - apr_skiplistnode **iter, - apr_skiplist_compare comp) +static void *find_compare(apr_skiplist *sli, void *data, + apr_skiplistnode **iter, + apr_skiplist_compare comp, + int last) { apr_skiplistnode *m; apr_skiplist *sl; @@ -351,16 +360,36 @@ APR_DECLARE(void *) apr_skiplist_find_compare(apr_skiplist *sli, void *data, } sl = (apr_skiplist *) m->data; } - skiplisti_find_compare(sl, data, &m, sl->comparek); + skiplisti_find_compare(sl, data, &m, sl->comparek, last); if (iter) { *iter = m; } return (m) ? m->data : NULL; } +APR_DECLARE(void *) apr_skiplist_find_compare(apr_skiplist *sl, void *data, + apr_skiplistnode **iter, + apr_skiplist_compare comp) +{ + return find_compare(sl, data, iter, comp, 0); +} + APR_DECLARE(void *) apr_skiplist_find(apr_skiplist *sl, void *data, apr_skiplistnode **iter) { - return apr_skiplist_find_compare(sl, data, iter, sl->compare); + return find_compare(sl, data, iter, sl->compare, 0); +} + +APR_DECLARE(void *) apr_skiplist_last_compare(apr_skiplist *sl, void *data, + apr_skiplistnode **iter, + apr_skiplist_compare comp) +{ + return find_compare(sl, data, iter, comp, 1); +} + +APR_DECLARE(void *) apr_skiplist_last(apr_skiplist *sl, void *data, + apr_skiplistnode **iter) +{ + return find_compare(sl, data, iter, sl->compare, 1); } @@ -390,9 +419,9 @@ APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **i return (*iter) ? ((*iter)->data) : NULL; } -APR_DECLARE(void *) apr_skiplist_element(apr_skiplistnode *node) +APR_DECLARE(void *) apr_skiplist_element(apr_skiplistnode *iter) { - return node->data; + return (iter) ? iter->data : NULL; } /* forward declared */ @@ -643,6 +672,23 @@ static int skiplisti_remove(apr_skiplist *sl, apr_skiplistnode *m, return sl->height; /* return 1; ?? */ } +APR_DECLARE(int) apr_skiplist_remove_node(apr_skiplist *sl, + apr_skiplistnode *iter, + apr_skiplist_freefunc myfree) +{ + apr_skiplistnode *m = iter; + if (!m) { + return 0; + } + while (m->down) { + m = m->down; + } + while (m->previndex) { + m = m->previndex; + } + return skiplisti_remove(sl, m, myfree); +} + APR_DECLARE(int) apr_skiplist_remove_compare(apr_skiplist *sli, void *data, apr_skiplist_freefunc myfree, apr_skiplist_compare comp) @@ -662,7 +708,7 @@ APR_DECLARE(int) apr_skiplist_remove_compare(apr_skiplist *sli, } sl = (apr_skiplist *) m->data; } - skiplisti_find_compare(sl, data, &m, comp); + skiplisti_find_compare(sl, data, &m, comp, 0); if (!m) { return 0; } diff --git a/test/testskiplist.c b/test/testskiplist.c index 5f5b77c6a91..91a4403df21 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -317,6 +317,34 @@ static int acomp(void *a, void *b){ } } +/* If we add multiple duplicates and then try to remove each one + * individually (unique pointer) in arbitrary order, by using: + * - apr_skiplist_remove_compare(..., scomp, NULL) + * There is no pointer comparison with scomp(), so will likely + * remove any duplicate (the first encountered in the walking path). + * - apr_skiplist_remove_compare(..., acomp, NULL) + * The exact element to be removed may be skipped in the walking path + * because some "bigger" element (or duplicate) was added later with a + * higher height. + * Hence we use skiplist_remove_scomp() which will go straight to the last + * duplicate (using scomp) and then iterate on the previous elements until + * pointers match. + * This pattern could be reused by any application which wants to remove + * elements by (unique) pointer. + */ +static void skiplist_remove_scomp(abts_case *tc, apr_skiplist *list, elem *n) +{ + elem *e; + apr_skiplistnode *iter = NULL; + e = apr_skiplist_last(list, n, &iter); + while (e && e != n) { + ABTS_INT_EQUAL(tc, 0, scomp(n, e)); + e = apr_skiplist_previous(list, &iter); + } + ABTS_PTR_EQUAL(tc, n, apr_skiplist_element(iter)); + apr_skiplist_remove_node(list, iter, NULL); +} + static void skiplist_test(abts_case *tc, void *data) { int test_elems = 10; int i = 0, j = 0; @@ -325,6 +353,7 @@ static void skiplist_test(abts_case *tc, void *data) { apr_skiplist * list = NULL; apr_skiplist * list2 = NULL; apr_skiplist * list3 = NULL; + apr_skiplist * list4 = NULL; int first_forty_two = 42, second_forty_two = 42; elem t1, t2, t3, t4, t5; @@ -426,6 +455,39 @@ static void skiplist_test(abts_case *tc, void *data) { val2 = apr_skiplist_find(list3, &t2, NULL); ABTS_PTR_EQUAL(tc, NULL, val2); + ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&list4, ptmp)); + apr_skiplist_set_compare(list4, scomp, scomp); + for (i = 0; i < 5; ++i){ + add_elem_to_skiplist(list4, t1); + } + for (i = 0; i < 5; ++i){ + add_elem_to_skiplist(list4, t2); + } + apr_skiplist_add(list4, &t2); + for (i = 0; i < 5; ++i){ + add_elem_to_skiplist(list4, t2); + } + for (i = 0; i < 5; ++i){ + add_elem_to_skiplist(list4, t3); + } + apr_skiplist_add(list4, &t3); + for (i = 0; i < 5; ++i){ + add_elem_to_skiplist(list4, t3); + } + for (i = 0; i < 5; ++i){ + add_elem_to_skiplist(list4, t4); + } + apr_skiplist_add(list4, &t4); + for (i = 0; i < 5; ++i){ + add_elem_to_skiplist(list4, t4); + } + for (i = 0; i < 5; ++i){ + add_elem_to_skiplist(list4, t5); + } + skiplist_remove_scomp(tc, list4, &t2); + skiplist_remove_scomp(tc, list4, &t3); + skiplist_remove_scomp(tc, list4, &t4); + apr_pool_clear(ptmp); } From bb83726ce6c2d38ab84e89b110ff706c51b26be4 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 9 Apr 2015 13:54:26 +0000 Subject: [PATCH 7529/7878] skiplist: follow up to r1664769. Fix insert_compare() returning NULL on the very first insertion (top is NULL). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1672354 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 4 ++ test/testskiplist.c | 88 +++++++++++++++++++++---------------------- 2 files changed, 48 insertions(+), 44 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 4078dd03eed..6075bb60c42 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -543,6 +543,10 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, if (p) { p->up = tmp; } + else { + /* This sets ret to the bottom-most node we are inserting */ + ret = tmp; + } p = tmp; } if (sl->index != NULL) { diff --git a/test/testskiplist.c b/test/testskiplist.c index 91a4403df21..f342abf4feb 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -58,7 +58,7 @@ static void skiplist_find(abts_case *tc, void *data) { const char *val; - apr_skiplist_insert(skiplist, "baton"); + ABTS_PTR_NOTNULL(tc, apr_skiplist_insert(skiplist, "baton")); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); @@ -78,7 +78,7 @@ static void skiplist_insert(abts_case *tc, void *data) int i, height = 0; for (i = 0; i < 10; ++i) { - apr_skiplist_insert(skiplist, "baton"); + ABTS_PTR_EQUAL(tc, NULL, apr_skiplist_insert(skiplist, "baton")); ABTS_TRUE(tc, 1 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); @@ -92,13 +92,13 @@ static void skiplist_insert(abts_case *tc, void *data) } } - apr_skiplist_insert(skiplist, "foo"); + ABTS_PTR_NOTNULL(tc, apr_skiplist_insert(skiplist, "foo")); ABTS_TRUE(tc, 2 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "foo", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "foo", val); - apr_skiplist_insert(skiplist, "atfirst"); + ABTS_PTR_NOTNULL(tc, apr_skiplist_insert(skiplist, "atfirst")); ABTS_TRUE(tc, 3 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "atfirst", NULL); ABTS_PTR_NOTNULL(tc, val); @@ -116,28 +116,28 @@ static void skiplist_add(abts_case *tc, void *data) for (i = 0; i < NUM_ADDS; ++i) { n++; - apr_skiplist_add(skiplist, "daton"); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(skiplist, "daton")); ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "daton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "daton", val); n++; - apr_skiplist_add(skiplist, "baton"); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(skiplist, "baton")); ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); n++; - apr_skiplist_add(skiplist, "caton"); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(skiplist, "caton")); ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "caton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "caton", val); n++; - apr_skiplist_add(skiplist, "aaton"); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(skiplist, "aaton")); ABTS_TRUE(tc, n == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "aaton", NULL); ABTS_PTR_NOTNULL(tc, val); @@ -195,9 +195,9 @@ static void skiplist_size(abts_case *tc, void *data) ABTS_TRUE(tc, 0 == skiplist_get_size(tc, skiplist)); - apr_skiplist_insert(skiplist, "abc"); - apr_skiplist_insert(skiplist, "ghi"); - apr_skiplist_insert(skiplist, "def"); + ABTS_PTR_NOTNULL(tc, apr_skiplist_insert(skiplist, "abc")); + ABTS_PTR_NOTNULL(tc, apr_skiplist_insert(skiplist, "ghi")); + ABTS_PTR_NOTNULL(tc, apr_skiplist_insert(skiplist, "def")); val = apr_skiplist_find(skiplist, "abc", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "abc", val); @@ -218,13 +218,13 @@ static void skiplist_remove(abts_case *tc, void *data) ABTS_TRUE(tc, 0 == skiplist_get_size(tc, skiplist)); - apr_skiplist_add(skiplist, "baton"); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(skiplist, "baton")); ABTS_TRUE(tc, 1 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); - apr_skiplist_add(skiplist, "baton"); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(skiplist, "baton")); ABTS_TRUE(tc, 2 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); @@ -236,7 +236,7 @@ static void skiplist_remove(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); - apr_skiplist_add(skiplist, "baton"); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(skiplist, "baton")); ABTS_TRUE(tc, 2 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); @@ -273,7 +273,7 @@ static void skiplist_random_loop(abts_case *tc, void *data) else { batons[i] = apr_pstrdup(ptmp, batons[i % NUM_RAND]); } - apr_skiplist_add(sl, batons[i]); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(sl, batons[i])); val = apr_skiplist_find(sl, batons[i], NULL); ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, batons[i], val); @@ -288,16 +288,16 @@ typedef struct elem { } elem; -static void add_int_to_skiplist(apr_skiplist *list, int n){ +static void add_int_to_skiplist(abts_case *tc, apr_skiplist *list, int n){ int* a = apr_skiplist_alloc(list, sizeof(int)); *a = n; - apr_skiplist_add(list, a); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(list, a)); } -static void add_elem_to_skiplist(apr_skiplist *list, elem n){ +static void add_elem_to_skiplist(abts_case *tc, apr_skiplist *list, elem n){ elem* a = apr_skiplist_alloc(list, sizeof(elem)); *a = n; - apr_skiplist_add(list, a); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(list, a)); } static int comp(void *a, void *b){ @@ -368,7 +368,7 @@ static void skiplist_test(abts_case *tc, void *data) { /* insert 10 objects */ for (i = 0; i < test_elems; ++i){ - add_int_to_skiplist(list, i); + add_int_to_skiplist(tc, list, i); } /* remove all objects */ @@ -378,7 +378,7 @@ static void skiplist_test(abts_case *tc, void *data) { /* insert 10 objects again */ for (i = test_elems; i < test_elems+test_elems; ++i){ - add_int_to_skiplist(list, i); + add_int_to_skiplist(tc, list, i); } j = test_elems; @@ -390,7 +390,7 @@ static void skiplist_test(abts_case *tc, void *data) { val = apr_skiplist_pop(list, NULL); ABTS_PTR_EQUAL(tc, val, NULL); - add_int_to_skiplist(list, 42); + add_int_to_skiplist(tc, list, 42); val = apr_skiplist_pop(list, NULL); ABTS_INT_EQUAL(tc, *val, 42); @@ -398,10 +398,10 @@ static void skiplist_test(abts_case *tc, void *data) { val = apr_skiplist_pop(list, NULL); ABTS_PTR_EQUAL(tc, val, NULL); - apr_skiplist_add(list, &first_forty_two); - add_int_to_skiplist(list, 1); - add_int_to_skiplist(list, 142); - apr_skiplist_add(list, &second_forty_two); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(list, &first_forty_two)); + add_int_to_skiplist(tc, list, 1); + add_int_to_skiplist(tc, list, 142); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(list, &second_forty_two)); val = apr_skiplist_peek(list); ABTS_INT_EQUAL(tc, *val, 1); val = apr_skiplist_pop(list, NULL); @@ -420,11 +420,11 @@ static void skiplist_test(abts_case *tc, void *data) { ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&list2, ptmp)); apr_skiplist_set_compare(list2, scomp, scomp); - add_elem_to_skiplist(list2, t2); - add_elem_to_skiplist(list2, t1); - add_elem_to_skiplist(list2, t3); - add_elem_to_skiplist(list2, t5); - add_elem_to_skiplist(list2, t4); + add_elem_to_skiplist(tc, list2, t2); + add_elem_to_skiplist(tc, list2, t1); + add_elem_to_skiplist(tc, list2, t3); + add_elem_to_skiplist(tc, list2, t5); + add_elem_to_skiplist(tc, list2, t4); val2 = apr_skiplist_pop(list2, NULL); ABTS_INT_EQUAL(tc, val2->a, 1); val2 = apr_skiplist_pop(list2, NULL); @@ -442,10 +442,10 @@ static void skiplist_test(abts_case *tc, void *data) { ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&list3, ptmp)); apr_skiplist_set_compare(list3, acomp, acomp); - apr_skiplist_insert(list3, &t2); + ABTS_PTR_NOTNULL(tc, apr_skiplist_insert(list3, &t2)); val2 = apr_skiplist_find(list3, &t2, NULL); ABTS_PTR_EQUAL(tc, &t2, val2); - apr_skiplist_insert(list3, &t3); + ABTS_PTR_NOTNULL(tc, apr_skiplist_insert(list3, &t3)); val2 = apr_skiplist_find(list3, &t3, NULL); ABTS_PTR_EQUAL(tc, &t3, val2); apr_skiplist_remove(list3, &t3, NULL); @@ -458,31 +458,31 @@ static void skiplist_test(abts_case *tc, void *data) { ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&list4, ptmp)); apr_skiplist_set_compare(list4, scomp, scomp); for (i = 0; i < 5; ++i){ - add_elem_to_skiplist(list4, t1); + add_elem_to_skiplist(tc, list4, t1); } for (i = 0; i < 5; ++i){ - add_elem_to_skiplist(list4, t2); + add_elem_to_skiplist(tc, list4, t2); } - apr_skiplist_add(list4, &t2); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(list4, &t2)); for (i = 0; i < 5; ++i){ - add_elem_to_skiplist(list4, t2); + add_elem_to_skiplist(tc, list4, t2); } for (i = 0; i < 5; ++i){ - add_elem_to_skiplist(list4, t3); + add_elem_to_skiplist(tc, list4, t3); } - apr_skiplist_add(list4, &t3); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(list4, &t3)); for (i = 0; i < 5; ++i){ - add_elem_to_skiplist(list4, t3); + add_elem_to_skiplist(tc, list4, t3); } for (i = 0; i < 5; ++i){ - add_elem_to_skiplist(list4, t4); + add_elem_to_skiplist(tc, list4, t4); } - apr_skiplist_add(list4, &t4); + ABTS_PTR_NOTNULL(tc, apr_skiplist_add(list4, &t4)); for (i = 0; i < 5; ++i){ - add_elem_to_skiplist(list4, t4); + add_elem_to_skiplist(tc, list4, t4); } for (i = 0; i < 5; ++i){ - add_elem_to_skiplist(list4, t5); + add_elem_to_skiplist(tc, list4, t5); } skiplist_remove_scomp(tc, list4, &t2); skiplist_remove_scomp(tc, list4, &t3); From f0f6e32a256efb9faeeb9d5c7c3b198c64302b5b Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 9 Apr 2015 14:36:27 +0000 Subject: [PATCH 7530/7878] skiplist: fix the minimum height (to one). The height of a skiplist is always at least one, for the top node, even if our implementation may delay its creation on the first insert or delete it on the last remove. This also helps apr_skiplist_remove() to never return zero (not found) when it deletes the last node. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1672366 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 24 +++++++++++++++++------- test/testskiplist.c | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 6075bb60c42..b5027ecf798 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -428,24 +428,34 @@ APR_DECLARE(void *) apr_skiplist_element(apr_skiplistnode *iter) static int skiplisti_remove(apr_skiplist *sl, apr_skiplistnode *m, apr_skiplist_freefunc myfree); +static APR_INLINE int skiplist_height(const apr_skiplist *sl) +{ + /* Skiplists (even empty) always have a top node, although this + * implementation defers its creation until the first insert, or + * deletes it with the last remove. We want the real height here. + */ + return sl->height ? sl->height : 1; +} + static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, apr_skiplist_compare comp, int add, apr_skiplist_freefunc myfree) { apr_skiplistnode *m, *p, *tmp, *ret = NULL; - int ch, nh = 1; + int ch, top_nh, nh = 1; + ch = skiplist_height(sl); if (sl->preheight) { while (nh < sl->preheight && get_b_rand()) { nh++; } } else { - while (nh <= sl->height && get_b_rand()) { + while (nh <= ch && get_b_rand()) { nh++; } } - ch = sl->height; + top_nh = nh; /* Now we have in nh the height at which we wish to insert our new node, * and in ch the current height: don't create skip paths to the inserted @@ -477,8 +487,8 @@ static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data, if (top != sl->top) { m = sl->top; skiplist_qclear(&sl->stack_q); - ch = sl->height; - nh = ch + 1; + ch = skiplist_height(sl); + nh = top_nh; } continue; } @@ -673,7 +683,7 @@ static int skiplisti_remove(apr_skiplist *sl, apr_skiplistnode *m, sl->bottom = sl->bottomend = NULL; sl->topend = NULL; } - return sl->height; /* return 1; ?? */ + return skiplist_height(sl); } APR_DECLARE(int) apr_skiplist_remove_node(apr_skiplist *sl, @@ -783,7 +793,7 @@ APR_DECLARE(size_t) apr_skiplist_size(const apr_skiplist *sl) APR_DECLARE(int) apr_skiplist_height(const apr_skiplist *sl) { - return sl->height; + return skiplist_height(sl); } APR_DECLARE(int) apr_skiplist_preheight(const apr_skiplist *sl) diff --git a/test/testskiplist.c b/test/testskiplist.c index f342abf4feb..3e5570f736f 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -185,7 +185,7 @@ static void skiplist_destroy(abts_case *tc, void *data) { apr_skiplist_destroy(skiplist, NULL); ABTS_TRUE(tc, 0 == apr_skiplist_size(skiplist)); - ABTS_TRUE(tc, 0 == apr_skiplist_height(skiplist)); + ABTS_TRUE(tc, 1 == apr_skiplist_height(skiplist)); ABTS_TRUE(tc, NULL == apr_skiplist_getlist(skiplist)); } From cb5555b3b305236b85dd007c98729f06f68c1e8a Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 9 Apr 2015 21:24:35 +0000 Subject: [PATCH 7531/7878] testskiplist: axe buggy compare function acomp() and associated test. Instead, define and use ecomp() which bases uniqueness on both elem's a and b, and test it with multiple duplicates inserted/found/removed in arbitray order. Improve comment on when/how these compare functions could be used in real apps. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1672495 13f79535-47bb-0310-9956-ffa450edef68 --- test/testskiplist.c | 88 +++++++++++++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 31 deletions(-) diff --git a/test/testskiplist.c b/test/testskiplist.c index 3e5570f736f..e95edf4bf34 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -230,7 +230,7 @@ static void skiplist_remove(abts_case *tc, void *data) ABTS_PTR_NOTNULL(tc, val); ABTS_STR_EQUAL(tc, "baton", val); - apr_skiplist_remove(skiplist, "baton", NULL); + ABTS_TRUE(tc, apr_skiplist_remove(skiplist, "baton", NULL) != 0); ABTS_TRUE(tc, 1 == skiplist_get_size(tc, skiplist)); val = apr_skiplist_find(skiplist, "baton", NULL); ABTS_PTR_NOTNULL(tc, val); @@ -308,29 +308,46 @@ static int scomp(void *a, void *b){ return ((elem*) a)->a - ((elem*) b)->a; } -static int acomp(void *a, void *b){ - if (a != b) { - return (scomp(a, b) < 0) ? -1 : 1; +static int ecomp(void *a, void *b) +{ + elem const * const e1 = a; + elem const * const e2 = b; + if (e1->a < e2->a) { + return -1; + } + else if (e1->a > e2->a) { + return +1; + } + else if (e1->b < e2->b) { + return -1; + } + else if (e1->b > e2->b) { + return +1; } else { return 0; } } -/* If we add multiple duplicates and then try to remove each one - * individually (unique pointer) in arbitrary order, by using: - * - apr_skiplist_remove_compare(..., scomp, NULL) - * There is no pointer comparison with scomp(), so will likely - * remove any duplicate (the first encountered in the walking path). - * - apr_skiplist_remove_compare(..., acomp, NULL) - * The exact element to be removed may be skipped in the walking path - * because some "bigger" element (or duplicate) was added later with a - * higher height. - * Hence we use skiplist_remove_scomp() which will go straight to the last - * duplicate (using scomp) and then iterate on the previous elements until - * pointers match. - * This pattern could be reused by any application which wants to remove - * elements by (unique) pointer. +/* Some tests below add multiple duplicates and then try to remove each one + * individually, in arbitrary order. + * + * Using apr_skiplist_remove_compare(..., scomp, NULL) would not work because + * it will likely remove any duplicate (the first one) encountered on the path, + * hence possibly not the expected one. + * + * Using apr_skiplist_remove_compare(..., ecomp, NULL) works provided all the + * duplicates (same a) don't also have the same b (which is the case in the + * test below), hence uniqueness is cooked in the elem itself. + * + * Another possibility is to rely on unique pointers, and then cook a remove + * function, like the following skiplist_remove_scomp(), which will go straight + * to the last duplicate (using scomp) and then iterate on the previous elems + * until pointers match. + * + * Providing uniqueness in the elem itself is the more clean/efficient option, + * but if all you have is a unique pointer the pattern in the function may be + * worth it ( or it's just a way to test several skiplist functionalities :) */ static void skiplist_remove_scomp(abts_case *tc, apr_skiplist *list, elem *n) { @@ -356,6 +373,7 @@ static void skiplist_test(abts_case *tc, void *data) { apr_skiplist * list4 = NULL; int first_forty_two = 42, second_forty_two = 42; + apr_array_header_t *array; elem t1, t2, t3, t4, t5; t1.a = 1; t1.b = 1; t2.a = 42; t2.b = 1; @@ -441,19 +459,27 @@ static void skiplist_test(abts_case *tc, void *data) { ABTS_INT_EQUAL(tc, val2->b, 1); ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&list3, ptmp)); - apr_skiplist_set_compare(list3, acomp, acomp); - ABTS_PTR_NOTNULL(tc, apr_skiplist_insert(list3, &t2)); - val2 = apr_skiplist_find(list3, &t2, NULL); - ABTS_PTR_EQUAL(tc, &t2, val2); - ABTS_PTR_NOTNULL(tc, apr_skiplist_insert(list3, &t3)); - val2 = apr_skiplist_find(list3, &t3, NULL); - ABTS_PTR_EQUAL(tc, &t3, val2); - apr_skiplist_remove(list3, &t3, NULL); - val2 = apr_skiplist_find(list3, &t3, NULL); - ABTS_PTR_EQUAL(tc, NULL, val2); - apr_skiplist_remove(list3, &t2, NULL); - val2 = apr_skiplist_find(list3, &t2, NULL); - ABTS_PTR_EQUAL(tc, NULL, val2); + apr_skiplist_set_compare(list3, ecomp, ecomp); + array = apr_array_make(ptmp, 10, sizeof(elem *)); + for (i = 0; i < 10; ++i) { + elem *e = apr_palloc(ptmp, sizeof *e); + e->a = 4224; + e->b = i; + APR_ARRAY_PUSH(array, elem *) = e; + ABTS_PTR_NOTNULL(tc, apr_skiplist_insert(list3, e)); + } + for (i = 0; i < 5; ++i) { + elem *e = APR_ARRAY_IDX(array, i, elem *); + val2 = apr_skiplist_find(list3, e, NULL); + ABTS_PTR_EQUAL(tc, e, val2); + ABTS_TRUE(tc, apr_skiplist_remove(list3, e, NULL) != 0); + } + for (i = 0; i < 5; ++i) { + elem *e = APR_ARRAY_IDX(array, 9 - i, elem *); + val2 = apr_skiplist_find(list3, e, NULL); + ABTS_PTR_EQUAL(tc, e, val2); + ABTS_TRUE(tc, apr_skiplist_remove(list3, e, NULL) != 0); + } ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&list4, ptmp)); apr_skiplist_set_compare(list4, scomp, scomp); From 2f24e818be9b96363d4c9ba1ccf516ce1834d196 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 10 Apr 2015 07:51:08 +0000 Subject: [PATCH 7532/7878] skiplist: avoid (undefined) unsigned to signed conversion and save cycles in the hot path get_b_rand(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1672575 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index b5027ecf798..5ea8643dbf2 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -63,13 +63,12 @@ struct apr_skiplistnode { static int get_b_rand(void) { static int ph = 32; /* More bits than we will ever use */ - static apr_uint32_t randseq; + static int randseq; if (ph > 31) { /* Num bits in return of rand() */ ph = 0; - randseq = (apr_uint32_t) rand(); + randseq = rand(); } - ph++; - return ((randseq & (1 << (ph - 1))) >> (ph - 1)); + return randseq & (1 << ph++); } typedef struct { From 63c50c342aed1a41811ce2faa5d2db2a4d922ef3 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sat, 18 Apr 2015 19:14:19 +0000 Subject: [PATCH 7533/7878] Expand apr pools debug output with parent information. * memory/unix/apr_pools.c (apr_pool_initialize): Add parent to debug header. (apr_pool_log_event): Add parent to debug output. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1674566 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 8c1b2a48e05..eb83d9d66e5 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1501,6 +1501,7 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, "(%10lu/%10lu/%10lu) " "0x%pp \"%s\" " "<%s> " + "0x%pp " "(%u/%u/%u) " "\n", (unsigned long)getpid(), @@ -1513,6 +1514,7 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, (unsigned long)apr_pool_num_bytes(global_pool, 1), pool, pool->tag, file_line, + pool->parent, pool->stat_alloc, pool->stat_total_alloc, pool->stat_clear); } else { @@ -1681,7 +1683,7 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) "/TID" #endif /* APR_HAS_THREADS */ "] ACTION (SIZE /POOL SIZE /TOTAL SIZE) " - "POOL \"TAG\" <__FILE__:__LINE__> (ALLOCS/TOTAL ALLOCS/CLEARS)\n"); + "POOL \"TAG\" <__FILE__:__LINE__> PARENT (ALLOCS/TOTAL ALLOCS/CLEARS)\n"); apr_pool_log_event(global_pool, "GLOBAL", __FILE__ ":apr_pool_initialize", 0); } From 975e610f452db058d93182cf48946231c8f0b813 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 23 Apr 2015 10:56:39 +0000 Subject: [PATCH 7534/7878] fix whitespace regression compared with 1.6.x git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1675571 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 010cee97e21..931ff517086 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -85,7 +85,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, char name[50]; sa.nLength = sizeof(sa); - + #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE sa.bInheritHandle = FALSE; @@ -145,9 +145,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, dwOpenMode, dwPipeMode, 1, /* nMaxInstances, */ - 0, /* nOutBufferSize, */ - 65536, /* nInBufferSize, */ - 1, /* nDefaultTimeOut, */ + 0, /* nOutBufferSize, */ + 65536, /* nInBufferSize, */ + 1, /* nDefaultTimeOut, */ &sa); /* Create the write end of the pipe */ @@ -159,7 +159,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, (*out)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); (*out)->timeout = 0; } - + (*out)->filehand = CreateFile(name, GENERIC_WRITE, /* access mode */ 0, /* share mode */ @@ -235,7 +235,7 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, static apr_status_t create_socket_pipe(SOCKET *rd, SOCKET *wr) { static int id = 0; - FD_SET rs; + FD_SET rs; SOCKET ls; struct timeval socktm; struct sockaddr_in pa; From e1da721f50e0e27401f6f1970bc72c6bc0b915ba Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 23 Apr 2015 15:39:41 +0000 Subject: [PATCH 7535/7878] testskiplist: silence Sun compiler warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1675644 13f79535-47bb-0310-9956-ffa450edef68 --- test/testskiplist.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/testskiplist.c b/test/testskiplist.c index e95edf4bf34..e1f64bad658 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -51,7 +51,8 @@ static void skiplist_init(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&skiplist, p)); ABTS_PTR_NOTNULL(tc, skiplist); - apr_skiplist_set_compare(skiplist, (void*)strcmp, (void*)strcmp); + apr_skiplist_set_compare(skiplist, (apr_skiplist_compare)strcmp, + (apr_skiplist_compare)strcmp); } static void skiplist_find(abts_case *tc, void *data) @@ -260,7 +261,8 @@ static void skiplist_random_loop(abts_case *tc, void *data) int i; ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_skiplist_init(&sl, ptmp)); - apr_skiplist_set_compare(sl, (void*)strcmp, (void*)strcmp); + apr_skiplist_set_compare(sl, (apr_skiplist_compare)strcmp, + (apr_skiplist_compare)strcmp); apr_skiplist_set_preheight(sl, 7); ABTS_INT_EQUAL(tc, 7, apr_skiplist_preheight(sl)); From ef63066a20d49067fb1ed5f0ac464fcc4fe7ec25 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 23 Apr 2015 15:49:05 +0000 Subject: [PATCH 7536/7878] testatomic: silence Sun compiler warning. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1675656 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index ca0398a2985..b3862a8b06b 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -205,7 +205,7 @@ static void test_wrap_zero(abts_case *tc, void *data) { apr_uint32_t y32; apr_uint32_t rv; - apr_uint32_t minus1 = -1; + apr_uint32_t minus1 = (apr_uint32_t)-1; char *str; apr_atomic_set32(&y32, 0); @@ -218,8 +218,8 @@ static void test_wrap_zero(abts_case *tc, void *data) static void test_inc_neg1(abts_case *tc, void *data) { - apr_uint32_t y32 = -1; - apr_uint32_t minus1 = -1; + apr_uint32_t y32 = (apr_uint32_t)-1; + apr_uint32_t minus1 = (apr_uint32_t)-1; apr_uint32_t rv; char *str; From 6167481a8b9955f685815773bb4c2e3e0a1f356c Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 23 Apr 2015 16:03:00 +0000 Subject: [PATCH 7537/7878] Switch to generic atomics for (unpatched) Solaris 10 not exporting some atomic functions. PR 55418. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1675668 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 231b70456b7..c22c45289bd 100644 --- a/configure.in +++ b/configure.in @@ -656,7 +656,20 @@ AC_ARG_ENABLE(nonportable-atomics, ], [case $host_cpu in i[[456]]86) force_generic_atomics=yes ;; - *) force_generic_atomics=no ;; + *) force_generic_atomics=no + case $host in + *solaris2.10*) + AC_TRY_COMPILE( + [#include ], + [void *ptr = NULL; atomic_cas_ptr(&ptr, NULL, NULL);],, + [force_generic_atomics=yes] + ) + if test $force_generic_atomics = yes; then + AC_MSG_NOTICE([nonportable atomic support disabled, system needs Patch-ID 118884 or 118885]) + fi + ;; + esac + ;; esac ]) From 88c13ce77b25bed81d7fb6abeab6ad5df165a32f Mon Sep 17 00:00:00 2001 From: "Gregg L. Smith" Date: Fri, 24 Apr 2015 02:39:14 +0000 Subject: [PATCH 7538/7878] Fix errors when building on Visual Studio 2013 while maintaining the ability to build on Visual Studio 6 with Windows Server 2003 R2 SDK. PR: 57191 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1675751 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++ atomic/win32/apr_atomic.c | 57 ++++++--------------------------------- 2 files changed, 12 insertions(+), 49 deletions(-) diff --git a/CHANGES b/CHANGES index 0093051c0cb..ab586ddb36d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_atomic: Fix errors when building on Visual Studio 2013 while + maintaining the ability to build on Visual Studio 6 with Windows + Server 2003 R2 SDK. PR 57191. [Gregg Smith] + *) build: Correctly use AC_(PATH|CHECK)_TOOL to support cross compilation. PR: 56866. [Timothy Gu ] diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index 1ed7df893d8..e1bc18e904e 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -23,33 +23,12 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) return APR_SUCCESS; } -/* - * Remapping function pointer type to accept apr_uint32_t's type-safely - * as the arguments for as our apr_atomic_foo32 Functions - */ -typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_fn) - (apr_uint32_t volatile *); -typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_fn) - (apr_uint32_t volatile *, - apr_uint32_t); -typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_val_fn) - (apr_uint32_t volatile *, - apr_uint32_t, apr_uint32_t); -typedef WINBASEAPI void * (WINAPI * apr_atomic_win32_ptr_ptr_ptr_fn) - (volatile void **, - void *, const void *); -typedef WINBASEAPI void * (WINAPI * apr_atomic_win32_ptr_ptr_fn) - (volatile void **, - void *); - APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { #if (defined(_M_IA64) || defined(_M_AMD64)) return InterlockedExchangeAdd(mem, val); -#elif defined(__MINGW32__) - return InterlockedExchangeAdd((long *)mem, val); #else - return ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val); + return InterlockedExchangeAdd((long *)mem, val); #endif } @@ -62,10 +41,8 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) { #if (defined(_M_IA64) || defined(_M_AMD64)) InterlockedExchangeAdd(mem, -val); -#elif defined(__MINGW32__) - InterlockedExchangeAdd((long *)mem, -val); #else - ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, -val); + InterlockedExchangeAdd((long *)mem, -val); #endif } @@ -74,10 +51,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) /* we return old value, win32 returns new value :( */ #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedIncrement(mem) - 1; -#elif defined(__MINGW32__) - return InterlockedIncrement((long *)mem) - 1; #else - return ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem) - 1; + return InterlockedIncrement((long *)mem) - 1; #endif } @@ -85,10 +60,8 @@ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedDecrement(mem); -#elif defined(__MINGW32__) - return InterlockedDecrement((long *)mem); #else - return ((apr_atomic_win32_ptr_fn)InterlockedDecrement)(mem); + return InterlockedDecrement((long *)mem); #endif } @@ -96,10 +69,8 @@ APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) InterlockedExchange(mem, val); -#elif defined(__MINGW32__) - InterlockedExchange((long*)mem, val); #else - ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); + InterlockedExchange((long*)mem, val); #endif } @@ -113,10 +84,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3 { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedCompareExchange(mem, with, cmp); -#elif defined(__MINGW32__) - return InterlockedCompareExchange((long*)mem, with, cmp); #else - return ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem, with, cmp); + return InterlockedCompareExchange((long*)mem, with, cmp); #endif } @@ -124,11 +93,8 @@ APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const voi { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedCompareExchangePointer((void* volatile*)mem, with, (void*)cmp); -#elif defined(__MINGW32__) - return InterlockedCompareExchangePointer((void**)mem, with, (void*)cmp); #else - /* Too many VC6 users have stale win32 API files, stub this */ - return ((apr_atomic_win32_ptr_ptr_ptr_fn)InterlockedCompareExchange)(mem, with, cmp); + return InterlockedCompareExchangePointer((void**)mem, with, (void*)cmp); #endif } @@ -136,19 +102,12 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedExchange(mem, val); -#elif defined(__MINGW32__) - return InterlockedExchange((long *)mem, val); #else - return ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); + return InterlockedExchange((long *)mem, val); #endif } APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) { -#if (defined(_M_IA64) || defined(_M_AMD64) || defined(__MINGW32__)) && !defined(RC_INVOKED) return InterlockedExchangePointer((void**)mem, with); -#else - /* Too many VC6 users have stale win32 API files, stub this */ - return ((apr_atomic_win32_ptr_ptr_fn)InterlockedExchange)(mem, with); -#endif } From 74b21dfa85af6fe6ef89caf4e13ade299ba1dc9d Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Fri, 24 Apr 2015 22:31:23 +0000 Subject: [PATCH 7539/7878] Fix pool debugging output so that creation events are always emitted before allocation events and subpool destruction events are emitted on pool clear/destroy for proper accounting. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1675967 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ memory/unix/apr_pools.c | 27 +++++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/CHANGES b/CHANGES index ab586ddb36d..2f28379ae44 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_pools: Fix pool debugging output so that creation events are + always emitted before allocation events and subpool destruction + events are emitted on pool clear/destroy for proper accounting. + [Brane Čibej] + *) apr_atomic: Fix errors when building on Visual Studio 2013 while maintaining the ability to build on Visual Studio 6 with Windows Server 2003 R2 SDK. PR 57191. [Gregg Smith] diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index eb83d9d66e5..b6660cc9a22 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1857,10 +1857,6 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, apr_pool_check_lifetime(pool); -#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) - apr_pool_log_event(pool, "CLEAR", file_line, 1); -#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ - #if APR_HAS_THREADS if (pool->parent != NULL) mutex = pool->parent->mutex; @@ -1876,6 +1872,10 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, pool_clear_debug(pool, file_line); +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) + apr_pool_log_event(pool, "CLEAR", file_line, 1); +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ + #if APR_HAS_THREADS /* If we had our own mutex, it will have been destroyed by * the registered cleanups. Recreate the mutex. Unlock @@ -1900,12 +1900,12 @@ static void pool_destroy_debug(apr_pool_t *pool, const char *file_line) { apr_pool_check_lifetime(pool); + pool_clear_debug(pool, file_line); + #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) apr_pool_log_event(pool, "DESTROY", file_line, 1); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ - pool_clear_debug(pool, file_line); - /* Remove the pool from the parents child list */ if (pool->parent) { #if APR_HAS_THREADS @@ -2014,6 +2014,9 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, pool->owner_proc = (apr_os_proc_t)getnlmhandle(); #endif /* defined(NETWARE) */ +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) + apr_pool_log_event(pool, "CREATE", file_line, 1); +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ if (parent == NULL || parent->allocator != allocator) { #if APR_HAS_THREADS @@ -2043,10 +2046,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, *newpool = pool; -#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) - apr_pool_log_event(pool, "CREATE", file_line, 1); -#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ - return APR_SUCCESS; } @@ -2091,6 +2090,10 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpoo } pool->allocator = pool_allocator; +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) + apr_pool_log_event(pool, "CREATEU", file_line, 1); +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ + if (pool->allocator != allocator) { #if APR_HAS_THREADS apr_status_t rv; @@ -2113,10 +2116,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpoo *newpool = pool; -#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) - apr_pool_log_event(pool, "CREATEU", file_line, 1); -#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ - return APR_SUCCESS; } From 9322533111732eb75840dd3e79b145362e1dc98a Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Fri, 24 Apr 2015 22:54:24 +0000 Subject: [PATCH 7540/7878] Follow up to r1675967: When pool debugging is enabled, make sure we don't try to emit any debug events after the debug log file handle has been closed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1675970 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index b6660cc9a22..6d02e1bdc1c 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -603,6 +603,12 @@ static apr_allocator_t *global_allocator = NULL; #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) static apr_file_t *file_stderr = NULL; +static apr_status_t apr_pool_cleanup_file_stderr(void *data) +{ + file_stderr = NULL; + return APR_SUCCESS; +} + #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ /* @@ -1677,6 +1683,13 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) file_stderr = debug_log; if (file_stderr) { + /* Add a cleanup handler that sets the debug log file handle + * to NULL, otherwise we'll try to log the global pool + * destruction event with predictably disastrous results. */ + apr_pool_cleanup_register(global_pool, NULL, + apr_pool_cleanup_file_stderr, + apr_pool_cleanup_null); + apr_file_printf(file_stderr, "POOL DEBUG: [PID" #if APR_HAS_THREADS From 337e8ca24148ebe5e622de1f11cb0f2d191d2bf0 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Fri, 24 Apr 2015 23:04:54 +0000 Subject: [PATCH 7541/7878] Register the pool debug log cleanup handler after emitting the global pool creation event. This ensures that the allocation event from the cleanup registration written after the creation event. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1675982 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 6d02e1bdc1c..138180b7723 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1683,13 +1683,6 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) file_stderr = debug_log; if (file_stderr) { - /* Add a cleanup handler that sets the debug log file handle - * to NULL, otherwise we'll try to log the global pool - * destruction event with predictably disastrous results. */ - apr_pool_cleanup_register(global_pool, NULL, - apr_pool_cleanup_file_stderr, - apr_pool_cleanup_null); - apr_file_printf(file_stderr, "POOL DEBUG: [PID" #if APR_HAS_THREADS @@ -1699,6 +1692,13 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) "POOL \"TAG\" <__FILE__:__LINE__> PARENT (ALLOCS/TOTAL ALLOCS/CLEARS)\n"); apr_pool_log_event(global_pool, "GLOBAL", __FILE__ ":apr_pool_initialize", 0); + + /* Add a cleanup handler that sets the debug log file handle + * to NULL, otherwise we'll try to log the global pool + * destruction event with predictably disastrous results. */ + apr_pool_cleanup_register(global_pool, NULL, + apr_pool_cleanup_file_stderr, + apr_pool_cleanup_null); } #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ From 61dde587598467613a3f6f373795a970129ba38f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 25 Apr 2015 11:43:04 +0000 Subject: [PATCH 7542/7878] SECURITY: CVE-2015-1829 (cve.mitre.org) APR applications using APR named pipe support on Windows can be vulnerable to a pipe squatting attack from a local process; the extent of the vulnerability, when present, depends on the application. Initial analysis and report was provided by John Hernandez of Casaba Security via HP SSRT Security Alert. Submitted by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1676013 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 931ff517086..bb6e0c15dbb 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -18,6 +18,7 @@ #include "apr_file_io.h" #include "apr_general.h" #include "apr_strings.h" +#include "apr_escape.h" #if APR_HAVE_ERRNO_H #include #endif @@ -82,7 +83,6 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, static unsigned long id = 0; DWORD dwPipeMode; DWORD dwOpenMode; - char name[50]; sa.nLength = sizeof(sa); @@ -127,8 +127,26 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, (void) apr_pollset_create(&(*out)->pollset, 1, p, 0); #endif if (apr_os_level >= APR_WIN_NT) { + char rand[8]; + int pid = getpid(); +#define FMT_PIPE_NAME "\\\\.\\pipe\\apr-pipe-%x.%lx." + /* ^ ^ ^ + * pid | | + * | | + * id | + * | + * hex-escaped rand[8] (16 bytes) + */ + char name[sizeof FMT_PIPE_NAME + 2 * sizeof(pid) + + 2 * sizeof(id) + + 2 * sizeof(rand)]; + apr_size_t pos; + /* Create the read end of the pipe */ dwOpenMode = PIPE_ACCESS_INBOUND; +#ifdef FILE_FLAG_FIRST_PIPE_INSTANCE + dwOpenMode |= FILE_FLAG_FIRST_PIPE_INSTANCE; +#endif if (blocking == APR_WRITE_BLOCK /* READ_NONBLOCK */ || blocking == APR_FULL_NONBLOCK) { dwOpenMode |= FILE_FLAG_OVERLAPPED; @@ -136,10 +154,11 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, (*in)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); (*in)->timeout = 0; } - dwPipeMode = 0; - sprintf(name, "\\\\.\\pipe\\apr-pipe-%u.%lu", getpid(), id++); + apr_generate_random_bytes(rand, sizeof rand); + pos = apr_snprintf(name, sizeof name, FMT_PIPE_NAME, pid, id++); + apr_escape_hex(name + pos, rand, sizeof rand, 0, NULL); (*in)->filehand = CreateNamedPipe(name, dwOpenMode, @@ -149,6 +168,11 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, 65536, /* nInBufferSize, */ 1, /* nDefaultTimeOut, */ &sa); + if ((*in)->filehand == INVALID_HANDLE_VALUE) { + apr_status_t rv = apr_get_os_error(); + file_cleanup(*in); + return rv; + } /* Create the write end of the pipe */ dwOpenMode = FILE_ATTRIBUTE_NORMAL; @@ -167,6 +191,12 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, OPEN_EXISTING, /* dwCreationDisposition */ dwOpenMode, /* Pipe attributes */ NULL); /* handle to template file */ + if ((*out)->filehand == INVALID_HANDLE_VALUE) { + apr_status_t rv = apr_get_os_error(); + file_cleanup(*out); + file_cleanup(*in); + return rv; + } } else { /* Pipes on Win9* are blocking. Live with it. */ From 2088b6d4bbee14ad2f579b87a45500024f6c4bfc Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Wed, 3 Jun 2015 04:24:26 +0000 Subject: [PATCH 7543/7878] Fix indent git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1683221 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_snprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 053f098631c..4acbe2fa5b0 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -1327,7 +1327,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), */ if (print_something == YES) { for (i = s_len; i != 0; i--) { - INS_CHAR(*s, sp, bep, cc); + INS_CHAR(*s, sp, bep, cc); s++; } } From a36541035e2d903a998d2af731cff12b829d0adb Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 4 Jun 2015 11:23:26 +0000 Subject: [PATCH 7544/7878] * configure.in: Detect mkostemp, mkostemp64. * file_io/unix/mktemp.c (apr_file_mktemp): Use glibc mkostemp or mkostemp64 where available to set FD_CLOEXEC without the extra system calls. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1683520 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 4 ++-- file_io/unix/mktemp.c | 20 ++++++++++++++------ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 2f28379ae44..52c1455bbbf 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_file_mktemp: Use mkostemp() where available to save on system + calls. [Joe Orton] + *) apr_pools: Fix pool debugging output so that creation events are always emitted before allocation events and subpool destruction events are emitted on pool clear/destroy for proper accounting. diff --git a/configure.in b/configure.in index c22c45289bd..b7d2750f50b 100644 --- a/configure.in +++ b/configure.in @@ -1331,7 +1331,7 @@ case $host in dnl mkstemp is limited to 26 temporary files (a-z); use APR replacement ;; *) - AC_CHECK_FUNCS(mkstemp) + AC_CHECK_FUNCS(mkstemp mkostemp) ;; esac @@ -1781,7 +1781,7 @@ if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then dnl mkstemp64 is limited to 26 temporary files (a-z); use APR replacement ;; *) - AC_CHECK_FUNCS(mkstemp64) + AC_CHECK_FUNCS(mkstemp64 mkostemp64) ;; esac elif test "${ac_cv_sizeof_off_t}" != "${ac_cv_sizeof_size_t}"; then diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 760f04a4a88..4ba28a7b44c 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -173,6 +173,16 @@ static int gettemp(char *path, apr_file_t **doopen, apr_int32_t flags, apr_pool_ #endif #endif /* !defined(HAVE_MKSTEMP) */ +#if defined(HAVE_MKOSTEMP64) +#define wrap_mkostemp(t, f) mkostemp64(t, (f)) +#elif defined(HAVE_MKOSTEMP) +#define wrap_mkostemp(t, f) mkostemp(t, (f)) +#elif defined(HAVE_MKSTEMP64) +#define wrap_mkostemp(t, f) mkstemp64(t) +#else +#define wrap_mkostemp(t, f) mkstemp(t) +#endif + APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_int32_t flags, apr_pool_t *p) { #ifdef HAVE_MKSTEMP @@ -184,12 +194,8 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i return gettemp(template, fp, flags, p); #else -#ifdef HAVE_MKSTEMP64 - fd = mkstemp64(template); -#else - fd = mkstemp(template); -#endif - + fd = wrap_mkostemp(template, + (flags & APR_FOPEN_NOCLEANUP) ? 0 : O_CLOEXEC); if (fd == -1) { return errno; } @@ -204,6 +210,7 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i (*fp)->fname = apr_pstrdup(p, template); if (!(flags & APR_FOPEN_NOCLEANUP)) { +#if !defined(HAVE_MKOSTEMP64) && !defined(HAVE_MKOSTEMP) int flags; if ((flags = fcntl(fd, F_GETFD)) == -1) @@ -212,6 +219,7 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i flags |= FD_CLOEXEC; if (fcntl(fd, F_SETFD, flags) == -1) return errno; +#endif apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), apr_unix_file_cleanup, From 96ed28e2e540e77e75f6afd12b6d9740baf7723c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 4 Jun 2015 11:24:20 +0000 Subject: [PATCH 7545/7878] * network_io/unix/sockaddr.c (apr_parse_addr_port): Simplify to use apr_pstrmemdup, no functional change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1683521 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 7417073698a..9963c56bac6 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -277,19 +277,13 @@ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, return APR_EINVAL; } addrlen = scope_delim - str - 1; - *scope_id = apr_palloc(p, end_bracket - scope_delim); - memcpy(*scope_id, scope_delim + 1, end_bracket - scope_delim - 1); - (*scope_id)[end_bracket - scope_delim - 1] = '\0'; + *scope_id = apr_pstrmemdup(p, scope_delim, end_bracket - scope_delim - 1); } else { addrlen = addrlen - 2; /* minus 2 for '[' and ']' */ } - *addr = apr_palloc(p, addrlen + 1); - memcpy(*addr, - str + 1, - addrlen); - (*addr)[addrlen] = '\0'; + *addr = apr_pstrmemdup(p, str + 1, addrlen); if (apr_inet_pton(AF_INET6, *addr, &ipaddr) != 1) { *addr = NULL; *scope_id = NULL; @@ -303,9 +297,7 @@ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, /* XXX If '%' is not a valid char in a DNS name, we *could* check * for bogus scope ids first. */ - *addr = apr_palloc(p, addrlen + 1); - memcpy(*addr, str, addrlen); - (*addr)[addrlen] = '\0'; + *addr = apr_pstrmemdup(p, str, addrlen); } return APR_SUCCESS; } From 738e0f14c569d300bc65fc1fae91fa8ab67e90f2 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Wed, 17 Jun 2015 03:40:20 +0000 Subject: [PATCH 7546/7878] apr_filepath_merge: Fix truename length calculation on Windows in cases where the "short" name variant is actually longer than the "long" or "true" name. Patch submitted bu Bert Huijben . git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1685929 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ file_io/win32/filepath.c | 4 ++-- test/testnames.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 52c1455bbbf..71d5df3d37b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_filepath_merge: Fix truename length calculation on Windows + in cases where the "short" name variant is actually longer than + the "long" or "true" name. See: testnames.c:merge_shortname(). + [Bert Huijben ] + *) apr_file_mktemp: Use mkostemp() where available to save on system calls. [Joe Orton] diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 0bf5cc0ba3d..23870bc5461 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -890,9 +890,9 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, memmove(path + keptlen + namelen + 1, path + keptlen + seglen + 1, pathlen - keptlen - seglen); - pathlen += namelen - seglen; - seglen = namelen; } + pathlen += namelen - seglen; + seglen = namelen; } else { /* namelen > seglen */ if (pathlen + namelen - seglen >= sizeof(path)) diff --git a/test/testnames.c b/test/testnames.c index 5afba0c44c2..4fcd3c033f5 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -214,6 +214,39 @@ static void merge_lowercasedrive(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } + +static void merge_shortname(abts_case *tc, void *data) +{ + apr_status_t rv; + char *long_path; + char short_path[MAX_PATH+1]; + DWORD short_len; + char *result_path; + + /* 'A b.c' is not a valid short path, so will have multiple representations + when short path name generation is enabled... but its 'short' path will + most likely be longer than the long path */ + rv = apr_dir_make_recursive("C:/data/short/A b.c", + APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_filepath_merge(&long_path, NULL, "C:/data/short/A b.c", + APR_FILEPATH_NOTRELATIVE, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + short_len = GetShortPathName(long_path, short_path, sizeof(short_path)); + if (short_len > MAX_PATH) + return; /* Unable to test. Impossible shortname */ + + if (! strcmp(long_path, short_path)) + return; /* Unable to test. 8dot3name option is probably not enabled */ + + rv = apr_filepath_merge(&result_path, "", short_path, APR_FILEPATH_TRUENAME, + p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + ABTS_STR_EQUAL(tc, long_path, result_path); +} #endif static void root_absolute(abts_case *tc, void *data) @@ -341,6 +374,7 @@ abts_suite *testnames(abts_suite *suite) abts_run_test(suite, merge_dotdot_dotdot_dotdot, NULL); #if defined(WIN32) abts_run_test(suite, merge_lowercasedrive, NULL); + abts_run_test(suite, merge_shortname, NULL); #endif abts_run_test(suite, root_absolute, NULL); From 084408c9a2ab18a64d5efe1edf9735ca562083b8 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 25 Jun 2015 19:51:03 +0000 Subject: [PATCH 7547/7878] Delete stale 9x custom action git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1687622 13f79535-47bb-0310-9956-ffa450edef68 --- libapr.dsp | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/libapr.dsp b/libapr.dsp index eb5a02d9024..07a77ad759f 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -956,28 +956,6 @@ InputPath=.\include\apr_escape.h # End Custom Build -!ELSEIF "$(CFG)" == "libapr - Win32 Release9x" - -# Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h -InputPath=.\include\apr_escape.h - -".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - cl.exe /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I ".\include" /Fo.\9x\Release\gen_test_char /Fe.\9x\Release\gen_test_char.exe .\tools\gen_test_char.c - .\9x\Release\gen_test_char.exe > .\include\apr_escape_test_char.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libapr - Win32 Debug9x" - -# Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h -InputPath=.\include\apr_escape.h - -".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - cl.exe /nologo /W3 /EHsc /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I ".\include" /Fo.\9x\Debug\gen_test_char /Fe.\9x\Debug\gen_test_char.exe .\tools\gen_test_char.c - .\9x\Debug\gen_test_char.exe > .\include\apr_escape_test_char.h - -# End Custom Build - !ELSEIF "$(CFG)" == "libapr - x64 Release" # Begin Custom Build - Creating gen_test_char.exe and apr_escape_test_char.h From 3237bfa1d5b4d7bbd4a571e24c1f52b7c002680f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 25 Jun 2015 20:34:05 +0000 Subject: [PATCH 7548/7878] Reflect -2 suffixes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1687638 13f79535-47bb-0310-9956-ffa450edef68 --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index f688fe8b8c2..c97cd704601 100644 --- a/README +++ b/README @@ -178,9 +178,9 @@ can load apr.dsw in Visual Studio 2002 (.NET) or later, which will convert these for you into apr.sln and associated .vcproj files. When using APR as a dynamic library, nothing special is required, -simply link to libapr.lib. To use it as a static library, simply +simply link to libapr-2.lib. To use it as a static library, simply define APR_DECLARE_STATIC before you include any apr header files -in your source, and link to apr.lib instead. +in your source, and link to apr-2.lib instead. On windows, selection of database drivers is via the environment values DBD_LIST (for mysql, oracle, pgsql, sqlite2 and/or sqlite3) From edb41728a9778a717d83b3ccec27feb8f096d712 Mon Sep 17 00:00:00 2001 From: "Gregg L. Smith" Date: Thu, 25 Jun 2015 22:01:39 +0000 Subject: [PATCH 7549/7878] Add include and lib paths for dependecies in some of the DBD and DBM drivers/modules git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1687654 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_mysql.dsp | 20 ++++++++++---------- dbd/apr_dbd_sqlite3.dsp | 16 ++++++++-------- dbm/apr_dbm_db.dsp | 16 ++++++++-------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/dbd/apr_dbd_mysql.dsp b/dbd/apr_dbd_mysql.dsp index 9b56e0c3e45..dbaff5d3e33 100644 --- a/dbd/apr_dbd_mysql.dsp +++ b/dbd/apr_dbd_mysql.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /I "../../mysql/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -55,7 +55,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_mysql-1.dll" /pdb:"Release\apr_dbd_mysql-1.pdb" /implib:"Release\apr_dbd_mysql-1.lib" /MACHINE:X86 /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /libpath:"..\..\mysql\lib" /out:"Release\apr_dbd_mysql-1.dll" /pdb:"Release\apr_dbd_mysql-1.pdb" /implib:"Release\apr_dbd_mysql-1.lib" /MACHINE:X86 /opt:ref # Begin Special Build Tool TargetPath=Release\apr_dbd_mysql-1.dll SOURCE="$(InputPath)" @@ -77,7 +77,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /I "../../mysql/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -86,8 +86,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_mysql-1.dll" /pdb:"Debug\apr_dbd_mysql-1.pdb" /implib:"Debug\apr_dbd_mysql-1.lib" /MACHINE:X86 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysqld.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysqld.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /libpath:"..\..\mysql\lib" /out:"Debug\apr_dbd_mysql-1.dll" /pdb:"Debug\apr_dbd_mysql-1.pdb" /implib:"Debug\apr_dbd_mysql-1.lib" /MACHINE:X86 # Begin Special Build Tool TargetPath=Debug\apr_dbd_mysql-1.dll SOURCE="$(InputPath)" @@ -109,7 +109,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /I "../../mysql/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -119,7 +119,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_mysql-1.dll" /pdb:"x64\Release\apr_dbd_mysql-1.pdb" /implib:"x64\Release\apr_dbd_mysql-1.lib" /MACHINE:X64 /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /libpath:"..\..\mysql\lib" /out:"x64\Release\apr_dbd_mysql-1.dll" /pdb:"x64\Release\apr_dbd_mysql-1.pdb" /implib:"x64\Release\apr_dbd_mysql-1.lib" /MACHINE:X64 /opt:ref # Begin Special Build Tool TargetPath=x64\Release\apr_dbd_mysql-1.dll SOURCE="$(InputPath)" @@ -141,7 +141,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /I "../../mysql/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -150,8 +150,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_mysql-1.dll" /pdb:"x64\Debug\apr_dbd_mysql-1.pdb" /implib:"x64\Debug\apr_dbd_mysql-1.lib" /MACHINE:X64 +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysqld.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysqld.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /libpath:"..\..\mysql\lib" /out:"x64\Debug\apr_dbd_mysql-1.dll" /pdb:"x64\Debug\apr_dbd_mysql-1.pdb" /implib:"x64\Debug\apr_dbd_mysql-1.lib" /MACHINE:X64 # Begin Special Build Tool TargetPath=x64\Debug\apr_dbd_mysql-1.dll SOURCE="$(InputPath)" diff --git a/dbd/apr_dbd_sqlite3.dsp b/dbd/apr_dbd_sqlite3.dsp index 32efdecb82e..961461de8c7 100644 --- a/dbd/apr_dbd_sqlite3.dsp +++ b/dbd/apr_dbd_sqlite3.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /I "../../sqlite3" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -55,7 +55,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_sqlite3-1.dll" /pdb:"Release\apr_dbd_sqlite3-1.pdb" /implib:"Release\apr_dbd_sqlite3-1.lib" /MACHINE:X86 /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /libpath:"..\..\sqlite3" /out:"Release\apr_dbd_sqlite3-1.dll" /pdb:"Release\apr_dbd_sqlite3-1.pdb" /implib:"Release\apr_dbd_sqlite3-1.lib" /MACHINE:X86 /opt:ref # Begin Special Build Tool TargetPath=Release\apr_dbd_sqlite3-1.dll SOURCE="$(InputPath)" @@ -77,7 +77,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /I "../../sqlite3" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -87,7 +87,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_sqlite3-1.dll" /pdb:"Debug\apr_dbd_sqlite3-1.pdb" /implib:"Debug\apr_dbd_sqlite3-1.lib" /MACHINE:X86 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /libpath:"..\..\sqlite3" /out:"Debug\apr_dbd_sqlite3-1.dll" /pdb:"Debug\apr_dbd_sqlite3-1.pdb" /implib:"Debug\apr_dbd_sqlite3-1.lib" /MACHINE:X86 # Begin Special Build Tool TargetPath=Debug\apr_dbd_sqlite3-1.dll SOURCE="$(InputPath)" @@ -109,7 +109,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /I "../../sqlite3" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -119,7 +119,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_sqlite3-1.dll" /pdb:"x64\Release\apr_dbd_sqlite3-1.pdb" /implib:"x64\Release\apr_dbd_sqlite3-1.lib" /MACHINE:X64 /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /libpath:"..\..\sqlite3" /debug /out:"x64\Release\apr_dbd_sqlite3-1.dll" /pdb:"x64\Release\apr_dbd_sqlite3-1.pdb" /implib:"x64\Release\apr_dbd_sqlite3-1.lib" /MACHINE:X64 /opt:ref # Begin Special Build Tool TargetPath=x64\Release\apr_dbd_sqlite3-1.dll SOURCE="$(InputPath)" @@ -141,7 +141,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /I "../../sqlite3" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -151,7 +151,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_sqlite3-1.dll" /pdb:"x64\Debug\apr_dbd_sqlite3-1.pdb" /implib:"x64\Debug\apr_dbd_sqlite3-1.lib" /MACHINE:X64 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /libpath:"..\..\sqlite3" /debug /out:"x64\Debug\apr_dbd_sqlite3-1.dll" /pdb:"x64\Debug\apr_dbd_sqlite3-1.pdb" /implib:"x64\Debug\apr_dbd_sqlite3-1.lib" /MACHINE:X64 # Begin Special Build Tool TargetPath=x64\Debug\apr_dbd_sqlite3-1.dll SOURCE="$(InputPath)" diff --git a/dbm/apr_dbm_db.dsp b/dbm/apr_dbm_db.dsp index 28624419039..78d7fde7e6e 100644 --- a/dbm/apr_dbm_db.dsp +++ b/dbm/apr_dbm_db.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /I "../../db" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -55,7 +55,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbm_db-1.dll" /pdb:"Release\apr_dbm_db-1.pdb" /implib:"Release\apr_dbm_db-1.lib" /MACHINE:X86 /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /libpath:"..\..\db" /debug /out:"Release\apr_dbm_db-1.dll" /pdb:"Release\apr_dbm_db-1.pdb" /implib:"Release\apr_dbm_db-1.lib" /MACHINE:X86 /opt:ref # Begin Special Build Tool TargetPath=Release\apr_dbm_db-1.dll SOURCE="$(InputPath)" @@ -77,7 +77,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /I "../../db" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -87,7 +87,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbm_db-1.dll" /pdb:"Debug\apr_dbm_db-1.pdb" /implib:"Debug\apr_dbm_db-1.lib" /MACHINE:X86 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /libpath:"..\..\db" /debug /out:"Debug\apr_dbm_db-1.dll" /pdb:"Debug\apr_dbm_db-1.pdb" /implib:"Debug\apr_dbm_db-1.lib" /MACHINE:X86 # Begin Special Build Tool TargetPath=Debug\apr_dbm_db-1.dll SOURCE="$(InputPath)" @@ -109,7 +109,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../include/arch/win32" /I "../include/private" /I "../../db" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -119,7 +119,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbm_db-1.dll" /pdb:"x64\Release\apr_dbm_db-1.pdb" /implib:"x64\Release\apr_dbm_db-1.lib" /MACHINE:X64 /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /libpath:"..\..\db" /debug /out:"x64\Release\apr_dbm_db-1.dll" /pdb:"x64\Release\apr_dbm_db-1.pdb" /implib:"x64\Release\apr_dbm_db-1.lib" /MACHINE:X64 /opt:ref # Begin Special Build Tool TargetPath=x64\Release\apr_dbm_db-1.dll SOURCE="$(InputPath)" @@ -141,7 +141,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /EHsc /c +# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../include/arch/win32" /I "../include/private" /I "../../db" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /EHsc /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -151,7 +151,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbm_db-1.dll" /pdb:"x64\Debug\apr_dbm_db-1.pdb" /implib:"x64\Debug\apr_dbm_db-1.lib" /MACHINE:X64 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /libpath:"..\..\db" /debug /out:"x64\Debug\apr_dbm_db-1.dll" /pdb:"x64\Debug\apr_dbm_db-1.pdb" /implib:"x64\Debug\apr_dbm_db-1.lib" /MACHINE:X64 # Begin Special Build Tool TargetPath=x64\Debug\apr_dbm_db-1.dll SOURCE="$(InputPath)" From 89cc9343a4aa7e39393d7da85928e480e4ebbc6b Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sun, 16 Aug 2015 14:14:42 +0000 Subject: [PATCH 7550/7878] fix comparison of sin6_addr One cannot assume that sin6_addr is located at the start of sa_data. For example, glibc puts sin6_flowinfo there. Fix by casting to the proper type first. Reported by Andre Naujoks via https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759534 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1696140 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/multicast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/multicast.c b/network_io/unix/multicast.c index e4e8c80f15d..a8c85ce69ec 100644 --- a/network_io/unix/multicast.c +++ b/network_io/unix/multicast.c @@ -65,7 +65,7 @@ static unsigned int find_if_index(const apr_sockaddr_t *iface) for (ifp = ifs; ifp; ifp = ifp->ifa_next) { if (ifp->ifa_addr != NULL && ifp->ifa_addr->sa_family == AF_INET6) { if (memcmp(&iface->sa.sin6.sin6_addr, - &ifp->ifa_addr->sa_data[0], + &((struct sockaddr_in6*)ifp->ifa_addr)->sin6_addr, sizeof(iface->sa.sin6.sin6_addr)) == 0) { index = if_nametoindex(ifp->ifa_name); break; From b5aeddc4cc229c4c9c68f4d1758b83524bd85d60 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Thu, 20 Aug 2015 11:30:52 +0000 Subject: [PATCH 7551/7878] Fix comments for fcntl lock apr_file_lock() should lock the whole file. The code uses SEEK_SET which means 'start of file' and is correct, but the comments describe the SEEK_CUR behavior. Fix comments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1696767 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/flock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c index f400a96701d..01e8a639ba9 100644 --- a/file_io/unix/flock.c +++ b/file_io/unix/flock.c @@ -32,8 +32,8 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) struct flock l = { 0 }; int fc; - l.l_whence = SEEK_SET; /* lock from current point */ - l.l_start = 0; /* begin lock at this offset */ + l.l_whence = SEEK_SET; /* count l_start from start of file */ + l.l_start = 0; /* lock from start of file */ l.l_len = 0; /* lock to end of file */ if ((type & APR_FLOCK_TYPEMASK) == APR_FLOCK_SHARED) l.l_type = F_RDLCK; @@ -90,8 +90,8 @@ APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) { struct flock l = { 0 }; - l.l_whence = SEEK_SET; /* lock from current point */ - l.l_start = 0; /* begin lock at this offset */ + l.l_whence = SEEK_SET; /* count l_start from start of file */ + l.l_start = 0; /* lock from start of file */ l.l_len = 0; /* lock to end of file */ l.l_type = F_UNLCK; From 3c87ddd0ef612e6aa25ae7f9dc4e5b0feb08ebda Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Sep 2015 17:40:34 +0000 Subject: [PATCH 7552/7878] Unusual case I tripped over in re-buildconf'ing a tree and preparing to build out-of-tree. This deserves a non-lethal alert if .h.in results are picked up. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1702061 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/buildconf b/buildconf index b70fa53eca1..45a31598b27 100755 --- a/buildconf +++ b/buildconf @@ -131,4 +131,14 @@ if [ -f `which cut` ]; then > apr.spec ) fi +# Verify the tree was clean, notify user if not (normal in development) +# +if [ -f "include/apr.h" -o -f "include/arch/unix/apr_private.h" -o \ + -f "include/apu_want.h" -o -f "include/private/apu_select_dbm.h" ]; then + echo "" + echo "Generated include files already exist, the tree is not clean." + echo "The resulting build-outputs.mk file is incorrect" + exit 1 +fi + exit 0 From b797e468a53c6cc2ec1a0c1d54c8b92ce2239d32 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 9 Sep 2015 18:27:30 +0000 Subject: [PATCH 7553/7878] For buildbot's sake, keep these non-fatal when scriped, for the time being git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1702075 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 1 - 1 file changed, 1 deletion(-) diff --git a/buildconf b/buildconf index 45a31598b27..113c3c7f620 100755 --- a/buildconf +++ b/buildconf @@ -138,7 +138,6 @@ if [ -f "include/apr.h" -o -f "include/arch/unix/apr_private.h" -o \ echo "" echo "Generated include files already exist, the tree is not clean." echo "The resulting build-outputs.mk file is incorrect" - exit 1 fi exit 0 From 1cf591615c4d5c7df5a582aa6e3389c88af2204a Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Fri, 18 Sep 2015 15:30:00 +0000 Subject: [PATCH 7554/7878] Clarify under what circumstances memory is allocated in apr_os_sock_put(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1703886 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 45d53eb1542..98e19bfec48 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -380,7 +380,10 @@ APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, apr_pool_t *cont); /** - * Convert a socket from the os specific type to the apr type + * Convert a socket from the os specific type to the APR type. If + * sock points to NULL, a socket will be created from the pool + * provided. If **sock does not point to NULL, the structure pointed + * to by sock will be reused and updated with the given socket. * @param sock The pool to use. * @param thesock The socket to convert to. * @param cont The socket we are converting to an apr type. From 05136e417369f1c7e4a1de0687f414ac1242b2dd Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Thu, 1 Oct 2015 09:51:14 +0000 Subject: [PATCH 7555/7878] RPM spec: Add libuuid-devel to the build requirements to avoid autoconf from compensating for it by silently leaving it out. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1706211 13f79535-47bb-0310-9956-ffa450edef68 --- build/rpm/apr.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/rpm/apr.spec.in b/build/rpm/apr.spec.in index 62656aba7b5..4a2645527b6 100644 --- a/build/rpm/apr.spec.in +++ b/build/rpm/apr.spec.in @@ -10,7 +10,7 @@ Group: System Environment/Libraries URL: http://apr.apache.org/ Source0: http://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot -BuildRequires: autoconf, libtool, doxygen, python, libuuid +BuildRequires: autoconf, libtool, doxygen, libuuid-devel, python %description The mission of the Apache Portable Runtime (APR) is to provide a From 754fa5bf9673699703b84c58dddabb30cb987ac1 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Sat, 24 Oct 2015 05:40:19 +0000 Subject: [PATCH 7556/7878] Use 'apr_pstrmemdup' instead of 'apr_pstrndup' when applicable in order to save a few cycles. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1710307 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_fnmatch.c | 2 +- threadproc/win32/proc.c | 6 +++--- user/win32/groupinfo.c | 4 ++-- user/win32/userinfo.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index c1c0e4af54b..7dfa846993b 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -462,7 +462,7 @@ APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, path = "."; } else { - path = apr_pstrndup(p, pattern, idx - pattern); + path = apr_pstrmemdup(p, pattern, idx - pattern); pattern = idx + 1; } diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index cd48117a434..0357b0bd87d 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -486,7 +486,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * XXX progname must be NULL if this is a 16 bit app running in WOW */ if (progname[0] == '\"') { - progname = apr_pstrndup(pool, progname + 1, strlen(progname) - 2); + progname = apr_pstrmemdup(pool, progname + 1, strlen(progname) - 2); } if (attr->cmdtype == APR_PROGRAM || attr->cmdtype == APR_PROGRAM_ENV) { @@ -546,7 +546,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, return APR_EINVAL; } if (shellcmd[0] == '"') { - progname = apr_pstrndup(pool, shellcmd + 1, strlen(shellcmd) - 2); + progname = apr_pstrmemdup(pool, shellcmd + 1, strlen(shellcmd) - 2); } else { progname = shellcmd; @@ -588,7 +588,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, return APR_EINVAL; } if (shellcmd[0] == '"') { - progname = apr_pstrndup(pool, shellcmd + 1, strlen(shellcmd) - 2); + progname = apr_pstrmemdup(pool, shellcmd + 1, strlen(shellcmd) - 2); } else { progname = shellcmd; diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index 585642f0740..b53656962a2 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -37,11 +37,11 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *gid, char *pos; if ((pos = strchr(groupname, '/'))) { - domain = apr_pstrndup(p, groupname, pos - groupname); + domain = apr_pstrmemdup(p, groupname, pos - groupname); groupname = pos + 1; } else if ((pos = strchr(groupname, '\\'))) { - domain = apr_pstrndup(p, groupname, pos - groupname); + domain = apr_pstrmemdup(p, groupname, pos - groupname); groupname = pos + 1; } else { diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 12931ade6c3..c6b5084a536 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -212,11 +212,11 @@ APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *uid, apr_gid_t *gid, char *pos; if ((pos = strchr(username, '/'))) { - domain = apr_pstrndup(p, username, pos - username); + domain = apr_pstrmemdup(p, username, pos - username); username = pos + 1; } else if ((pos = strchr(username, '\\'))) { - domain = apr_pstrndup(p, username, pos - username); + domain = apr_pstrmemdup(p, username, pos - username); username = pos + 1; } else { From 2166cc3bcc084ea1be783f5088f44c9d89152861 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sat, 31 Oct 2015 17:52:28 +0000 Subject: [PATCH 7557/7878] apr_memcache: Better validate the values' length provided by the memcached to terminate the connection appropriately in getp() and avoid an infinite loop in multigetp(). Reported/Proposed by: Jeffrey Crowell Adapted/Committed by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1711657 13f79535-47bb-0310-9956-ffa450edef68 --- memcache/apr_memcache.c | 149 ++++++++++++++++++++++------------------ 1 file changed, 82 insertions(+), 67 deletions(-) diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index a6b3276cffa..65247f87e3e 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -731,6 +731,26 @@ apr_memcache_replace(apr_memcache_t *mc, } +/* + * Parses a decimal size from size_str, returning the value in *size. + * Returns 1 if parsing was successful, 0 if parsing failed. + */ +static int parse_size(const char *size_str, apr_size_t *size) +{ + char *endptr; + long size_as_long; + + errno = 0; + size_as_long = strtol(size_str, &endptr, 10); + if ((size_as_long < 0) || (errno != 0) || (endptr == size_str) || + (endptr[0] != ' ' && (endptr[0] != '\r' || endptr[1] != '\n'))) { + return 0; + } + + *size = (unsigned long)size_as_long; + return 1; +} + APR_DECLARE(apr_status_t) apr_memcache_getp(apr_memcache_t *mc, apr_pool_t *p, @@ -799,13 +819,10 @@ apr_memcache_getp(apr_memcache_t *mc, } length = apr_strtok(NULL, " ", &last); - if (length) { - len = strtol(length, (char **)NULL, 10); - } - - if (len == 0 ) { - *new_length = 0; - *baton = NULL; + if (!length || !parse_size(length, &len)) { + ms_bad_conn(ms, conn); + apr_memcache_disable_server(mc, ms); + return APR_EGENERAL; } else { apr_bucket_brigade *bbb; @@ -813,7 +830,6 @@ apr_memcache_getp(apr_memcache_t *mc, /* eat the trailing \r\n */ rv = apr_brigade_partition(conn->bb, len+2, &e); - if (rv != APR_SUCCESS) { ms_bad_conn(ms, conn); apr_memcache_disable_server(mc, ms); @@ -823,17 +839,14 @@ apr_memcache_getp(apr_memcache_t *mc, bbb = apr_brigade_split(conn->bb, e); rv = apr_brigade_pflatten(conn->bb, baton, &len, p); - if (rv != APR_SUCCESS) { ms_bad_conn(ms, conn); - apr_memcache_disable_server(mc, ms); return rv; } rv = apr_brigade_destroy(conn->bb); if (rv != APR_SUCCESS) { ms_bad_conn(ms, conn); - apr_memcache_disable_server(mc, ms); return rv; } @@ -851,14 +864,18 @@ apr_memcache_getp(apr_memcache_t *mc, } if (strncmp(MS_END, conn->buffer, MS_END_LEN) != 0) { - rv = APR_EGENERAL; + ms_bad_conn(ms, conn); + apr_memcache_disable_server(mc, ms); + return APR_EGENERAL; } } else if (strncmp(MS_END, conn->buffer, MS_END_LEN) == 0) { rv = APR_NOTFOUND; } else { - rv = APR_EGENERAL; + ms_bad_conn(ms, conn); + apr_memcache_disable_server(mc, ms); + return APR_EGENERAL; } ms_release_conn(ms, conn); @@ -1361,74 +1378,68 @@ apr_memcache_multgetp(apr_memcache_t *mc, char *last; char *data; apr_size_t len = 0; + apr_bucket *e = NULL; apr_strtok(conn->buffer, " ", &last); /* just the VALUE, ignore */ key = apr_strtok(NULL, " ", &last); flags = apr_strtok(NULL, " ", &last); - - length = apr_strtok(NULL, " ", &last); - if (length) { - len = strtol(length, (char **) NULL, 10); + + if (!length || !parse_size(length, &len)) { + rv = APR_EGENERAL; + } + else { + /* eat the trailing \r\n */ + rv = apr_brigade_partition(conn->bb, len+2, &e); + } + if (rv != APR_SUCCESS) { + apr_pollset_remove (pollset, &activefds[i]); + mget_conn_result(TRUE, FALSE, rv, mc, ms, conn, + server_query, values, server_queries); + queries_sent--; + continue; } value = apr_hash_get(values, key, strlen(key)); - - if (value) { - if (len != 0) { - apr_bucket_brigade *bbb; - apr_bucket *e; - - /* eat the trailing \r\n */ - rv = apr_brigade_partition(conn->bb, len+2, &e); - - if (rv != APR_SUCCESS) { - apr_pollset_remove (pollset, &activefds[i]); - mget_conn_result(FALSE, FALSE, rv, mc, ms, conn, - server_query, values, server_queries); - queries_sent--; - continue; - } - - bbb = apr_brigade_split(conn->bb, e); - - rv = apr_brigade_pflatten(conn->bb, &data, &len, data_pool); - - if (rv != APR_SUCCESS) { - apr_pollset_remove (pollset, &activefds[i]); - mget_conn_result(FALSE, FALSE, rv, mc, ms, conn, - server_query, values, server_queries); - queries_sent--; - continue; - } - - rv = apr_brigade_destroy(conn->bb); - if (rv != APR_SUCCESS) { - apr_pollset_remove (pollset, &activefds[i]); - mget_conn_result(FALSE, FALSE, rv, mc, ms, conn, - server_query, values, server_queries); - queries_sent--; - continue; - } - - conn->bb = bbb; - - value->len = len - 2; - data[value->len] = '\0'; - value->data = data; + apr_bucket_brigade *bbb; + + bbb = apr_brigade_split(conn->bb, e); + + rv = apr_brigade_pflatten(conn->bb, &data, &len, data_pool); + if (rv != APR_SUCCESS) { + apr_pollset_remove (pollset, &activefds[i]); + mget_conn_result(TRUE, FALSE, rv, mc, ms, conn, + server_query, values, server_queries); + queries_sent--; + continue; + } + + rv = apr_brigade_destroy(conn->bb); + if (rv != APR_SUCCESS) { + apr_pollset_remove (pollset, &activefds[i]); + mget_conn_result(TRUE, FALSE, rv, mc, ms, conn, + server_query, values, server_queries); + queries_sent--; + continue; } - + + conn->bb = bbb; + + value->len = len - 2; + data[value->len] = '\0'; + value->data = data; + value->status = rv; value->flags = atoi(flags); - + /* stay on the server */ i--; - } else { - /* TODO: Server Sent back a key I didn't ask for or my - * hash is corrupt */ + /* Server Sent back a key I didn't ask for or my + * hash is corrupt */ + rv = APR_EGENERAL; } } else if (strncmp(MS_END, conn->buffer, MS_END_LEN) == 0) { @@ -1436,14 +1447,18 @@ apr_memcache_multgetp(apr_memcache_t *mc, apr_pollset_remove (pollset, &activefds[i]); ms_release_conn(ms, conn); apr_hash_set(server_queries, &ms, sizeof(ms), NULL); - queries_sent--; } else { /* unknown reply? */ rv = APR_EGENERAL; } - + if (rv != APR_SUCCESS) { + apr_pollset_remove (pollset, &activefds[i]); + mget_conn_result(TRUE, FALSE, rv, mc, ms, conn, + server_query, values, server_queries); + queries_sent--; + } } /* /for */ } /* /while */ From 9a4d54e5af8449e00ade9dad6eb37753c60f5a1e Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 1 Jan 2016 19:33:09 +0000 Subject: [PATCH 7558/7878] Happy New Year 2016 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1722547 13f79535-47bb-0310-9956-ffa450edef68 --- NOTICE | 2 +- include/apr_version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NOTICE b/NOTICE index cd3576db205..873d5084765 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Apache Portable Runtime -Copyright (c) 2000-2015 The Apache Software Foundation. +Copyright (c) 2000-2016 The Apache Software Foundation. This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff --git a/include/apr_version.h b/include/apr_version.h index f02b57d0e3c..0741b209402 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -38,7 +38,7 @@ */ -#define APR_COPYRIGHT "Copyright (c) 2000-2015 The Apache Software " \ +#define APR_COPYRIGHT "Copyright (c) 2000-2016 The Apache Software " \ "Foundation or its licensors, as applicable." /* The numeric compile-time version constants. These constants are the From 34e234ebf3787fa1e3f96f022ae6880ae31e2c1c Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Fri, 1 Jan 2016 19:48:32 +0000 Subject: [PATCH 7559/7878] Update config.guess and config.sub from http://git.savannah.gnu.org/cgit/config.git. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1722557 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 61 +++++++++++++++++++++++++++++++++------------- build/config.sub | 44 +++++++++++++++++++++------------ 2 files changed, 73 insertions(+), 32 deletions(-) diff --git a/build/config.guess b/build/config.guess index 1f5c50c0d15..dcd5149681d 100755 --- a/build/config.guess +++ b/build/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2014-03-23' +timestamp='2016-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ timestamp='2014-03-23' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -168,20 +168,27 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -197,6 +204,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in os=netbsd ;; esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need @@ -207,13 +221,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` @@ -235,6 +249,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -579,8 +596,9 @@ EOF else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -932,6 +950,9 @@ EOF crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -944,6 +965,9 @@ EOF ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -1020,7 +1044,7 @@ EOF echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} @@ -1099,7 +1123,7 @@ EOF # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1369,6 +1393,9 @@ EOF x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; esac cat >&2 <. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -33,7 +33,7 @@ timestamp='2014-09-11' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,8 +53,7 @@ timestamp='2014-09-11' me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. @@ -68,7 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -117,7 +116,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -255,12 +254,13 @@ case $basic_machine in | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ @@ -305,7 +305,7 @@ case $basic_machine in | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -313,6 +313,7 @@ case $basic_machine in | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -327,6 +328,9 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none @@ -372,12 +376,13 @@ case $basic_machine in | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ @@ -424,12 +429,13 @@ case $basic_machine in | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -437,6 +443,7 @@ case $basic_machine in | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -513,6 +520,9 @@ case $basic_machine in basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -774,6 +784,9 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -1365,7 +1378,7 @@ case $os in | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1385,7 +1398,8 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) From c990a3175e240d407638c7917497741a238727ee Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 27 Jan 2016 00:09:02 +0000 Subject: [PATCH 7560/7878] Introduce the subset of svn_cstring_ functions into APR as the apr_cstr_ family of functions. Requires the introduction of APR_ERANGE. Solves apr_cstr_casecmp[n] for ASCII and EBCDIC and borrows from the work of jim, ylavic and wrowe, see r1715401 forwards in; http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util.c?view=log&pathrev=1722194 More performance review is needed against different compilers, so went ahead and borrowed original svn implementation as a basis, and we can port whichever performance enhancements test out more efficiently. Proposing for APR 1.6.0 which is the thought behind the initial @since tags. These must be changed if not accepted for backport. Note that the svn_cstring_join function could not be implemented as-is due to the absence of svn's counted string functionality. It deserves an implementation if not already present, or should be removed before tagging or backporting. No whitespace/formatting cleanup on this pass in order to preserve as much of the svn attributions as possible. This can happen in a later pass to conform to APR's style conventions. While renaming the functions, declarations themsel git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1726928 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 2 + SConscript | 2 +- include/apr_cstr.h | 282 +++++++++++++++++++++++++++++++ include/apr_errno.h | 13 ++ strings/apr_cstr.c | 392 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 690 insertions(+), 1 deletion(-) create mode 100644 include/apr_cstr.h create mode 100644 strings/apr_cstr.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a5c4c30e82..07e93ee51ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,6 +156,7 @@ SET(APR_PUBLIC_HEADERS_STATIC include/apr_base64.h include/apr_buckets.h include/apr_crypto.h + include/apr_cstr.h include/apr_date.h include/apr_dbd.h include/apr_dbm.h @@ -309,6 +310,7 @@ SET(APR_SOURCES random/unix/sha2_glue.c shmem/win32/shm.c strings/apr_cpystrn.c + strings/apr_cstr.c strings/apr_fnmatch.c strings/apr_snprintf.c strings/apr_strings.c diff --git a/SConscript b/SConscript index b2c60a8a991..afe261850f3 100644 --- a/SConscript +++ b/SConscript @@ -8,7 +8,7 @@ files = env.core_lib_files() libapr = env.SharedLibrary('apr-%d' % (major), files) tests = Split(""" abts.c testutil.c - testtime.c teststr.c testvsn.c testipsub.c testshm.c + testtime.c testcstr.c teststr.c testvsn.c testipsub.c testshm.c testmmap.c testud.c testtable.c testsleep.c testpools.c testfmt.c testfile.c testdir.c testfileinfo.c testrand.c testdso.c testoc.c testdup.c testsockets.c testproc.c diff --git a/include/apr_cstr.h b/include/apr_cstr.h new file mode 100644 index 00000000000..3a7506f358b --- /dev/null +++ b/include/apr_cstr.h @@ -0,0 +1,282 @@ +/* ==================================================================== + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * ==================================================================== + */ + +/** + * @file apr_cstr.h + * @brief C string goodies. + */ + +#ifndef APR_CSTR_H +#define APR_CSTR_H + +#include /* for apr_size_t */ +#include /* for apr_pool_t */ +#include /* for apr_array_header_t */ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @defgroup apr_cstr C (POSIX) locale string functions + * @ingroup apr_strings + * + * The apr_cstr_* functions provide traditional C char * string text handling, + * and notabilty they treat all text in the C (a.k.a. POSIX) locale using the + * minimal POSIX character set, represented in either ASCII or a corresponding + * EBCDIC subset. + * + * Character values outside of that set are treated as opaque bytes, and all + * multi-byte character sequences are handled as individual distinct octets. + * + * Multi-byte characters sequences whose octets fall in the ASCII range cause + * unexpected results, such as in the ISO-2022-JP code page where ASCII octets + * occur within both shift-state and multibyte sequences. + * + * In the case of the UTF-8 encoding, all multibyte characters all fall outside + * of the C/POSIX range of characters, so these functions are generally safe + * to use on UTF-8 strings. The programmer must be aware that each octet may + * not represent a distinct printable character in such encodings. + * + * The standard C99/POSIX string functions, rather than apr_cstr, should be + * used in all cases where the current locale and encoding of the text is + * significant. + * @{ + */ + + +/** Divide @a input into substrings, interpreting any char from @a sep + * as a token separator. + * + * Return an array of copies of those substrings (plain const char*), + * allocating both the array and the copies in @a pool. + * + * None of the elements added to the array contain any of the + * characters in @a sep_chars, and none of the new elements are empty + * (thus, it is possible that the returned array will have length + * zero). + * + * If @a chop_whitespace is TRUE, then remove leading and trailing + * whitespace from the returned strings. + * + * @since New in 1.6 + */ +apr_array_header_t * apr_cstr_split(const char *input, + const char *sep_chars, + int chop_whitespace, + apr_pool_t *pool); + +/** Like apr_cstr_split(), but append to existing @a array instead of + * creating a new one. Allocate the copied substrings in @a pool + * (i.e., caller decides whether or not to pass @a array->pool as @a pool). + * + * @since New in 1.6 + */ +void apr_cstr_split_append(apr_array_header_t *array, + const char *input, + const char *sep_chars, + int chop_whitespace, + apr_pool_t *pool); + + +/** Return @c TRUE iff @a str matches any of the elements of @a list, a list + * of zero or more glob patterns. + * + * @since New in 1.6 + */ +int apr_cstr_match_glob_list(const char *str, const apr_array_header_t *list); + +/** Return @c TRUE iff @a str exactly matches any of the elements of @a list. + * + * @since New in 1.6 + */ +int apr_cstr_match_list(const char *str, const apr_array_header_t *list); + +/** + * Get the next token from @a *str interpreting any char from @a sep as a + * token separator. Separators at the beginning of @a str will be skipped. + * Returns a pointer to the beginning of the first token in @a *str or NULL + * if no token is left. Modifies @a str such that the next call will return + * the next token. + * + * @note The content of @a *str may be modified by this function. + * + * @since New in 1.6. + */ +char * apr_cstr_tokenize(const char *sep, char **str); + +/** + * Return the number of line breaks in @a msg, allowing any kind of newline + * termination (CR, LF, CRLF, or LFCR), even inconsistent. + * + * @since New in 1.6. + */ +int apr_cstr_count_newlines(const char *msg); + +#if 0 /* XXX: stringbuf logic is not present in APR */ +/** + * Return a cstring which is the concatenation of @a strings (an array + * of char *) each followed by @a separator (that is, @a separator + * will also end the resulting string). Allocate the result in @a pool. + * If @a strings is empty, then return the empty string. + * + * @since New in 1.6. + */ +char * apr_cstr_join(const apr_array_header_t *strings, + const char *separator, + apr_pool_t *pool); +#endif + +/** + * Compare two strings @a atr1 and @a atr2, treating case-equivalent + * unaccented Latin (C/POSIX ASCII subset) alpha characters as equal. + * + * Returns in integer greater than, equal to, or less than 0, + * according to whether @a str1 is considered greater than, equal to, + * or less than @a str2. + * + * @since New in 1.6. + */ +int apr_cstr_casecmp(const char *str1, const char *str2); + +/** + * Compare two strings @a atr1 and @a atr2 of @n (or shorter) length, + * treating case-equivalent unaccented Latin (C/POSIX ASCII subset) + * alpha characters as equal. + * + * Returns in integer greater than, equal to, or less than 0, + * according to whether @a str1 is considered greater than, equal to, + * or less than @a str2. + * + * @since New in 1.6. + */ +int apr_cstr_casecmpn(const char *str1, const char *str2, apr_size_t n); + +/** + * Parse the C string @a str into a 64 bit number, and return it in @a *n. + * Assume that the number is represented in base @a base. + * Raise an error if conversion fails (e.g. due to overflow), or if the + * converted number is smaller than @a minval or larger than @a maxval. + * + * Leading whitespace in @a str is skipped in a locale-dependent way. + * After that, the string may contain an optional '+' (positive, default) + * or '-' (negative) character, followed by an optional '0x' prefix if + * @a base is 0 or 16, followed by numeric digits appropriate for the base. + * If there are any more characters after the numeric digits, an error is + * returned. + * + * If @a base is zero, then a leading '0x' or '0X' prefix means hexadecimal, + * else a leading '0' means octal (implemented, though not documented, in + * apr_strtoi64() in APR 0.9.0 through 1.5.0), else use base ten. + * + * @since New in 1.6. + */ +apr_status_t apr_cstr_strtoi64(apr_int64_t *n, const char *str, + apr_int64_t minval, apr_int64_t maxval, + int base); + +/** + * Parse the C string @a str into a 64 bit number, and return it in @a *n. + * Assume that the number is represented in base 10. + * Raise an error if conversion fails (e.g. due to overflow). + * + * The behaviour otherwise is as described for apr_cstr_strtoi64(). + * + * @since New in 1.6. + */ +apr_status_t apr_cstr_atoi64(apr_int64_t *n, const char *str); + +/** + * Parse the C string @a str into a 32 bit number, and return it in @a *n. + * Assume that the number is represented in base 10. + * Raise an error if conversion fails (e.g. due to overflow). + * + * The behaviour otherwise is as described for apr_cstr_strtoi64(). + * + * @since New in 1.6. + */ +apr_status_t apr_cstr_atoi(int *n, const char *str); + +/** + * Parse the C string @a str into an unsigned 64 bit number, and return + * it in @a *n. Assume that the number is represented in base @a base. + * Raise an error if conversion fails (e.g. due to overflow), or if the + * converted number is smaller than @a minval or larger than @a maxval. + * + * Leading whitespace in @a str is skipped in a locale-dependent way. + * After that, the string may contain an optional '+' (positive, default) + * or '-' (negative) character, followed by an optional '0x' prefix if + * @a base is 0 or 16, followed by numeric digits appropriate for the base. + * If there are any more characters after the numeric digits, an error is + * returned. + * + * If @a base is zero, then a leading '0x' or '0X' prefix means hexadecimal, + * else a leading '0' means octal (as implemented, though not documented, in + * apr_strtoi64(), else use base ten. + * + * @warning The implementation returns APR_ERANGE if the parsed number + * is greater than APR_INT64_MAX, even if it is not greater than @a maxval. + * + * @since New in 1.6. + */ +apr_status_t apr_cstr_strtoui64(apr_uint64_t *n, const char *str, + apr_uint64_t minval, apr_uint64_t maxval, + int base); + +/** + * Parse the C string @a str into an unsigned 64 bit number, and return + * it in @a *n. Assume that the number is represented in base 10. + * Raise an error if conversion fails (e.g. due to overflow). + * + * The behaviour otherwise is as described for apr_cstr_strtoui64(), + * including the upper limit of APR_INT64_MAX. + * + * @since New in 1.6. + */ +apr_status_t apr_cstr_atoui64(apr_uint64_t *n, const char *str); + +/** + * Parse the C string @a str into an unsigned 32 bit number, and return + * it in @a *n. Assume that the number is represented in base 10. + * Raise an error if conversion fails (e.g. due to overflow). + * + * The behaviour otherwise is as described for apr_cstr_strtoui64(), + * including the upper limit of APR_INT64_MAX. + * + * @since New in 1.6. + */ +apr_status_t apr_cstr_atoui(unsigned int *n, const char *str); + +/** + * Skip the common prefix @a prefix from the C string @a str, and return + * a pointer to the next character after the prefix. + * Return @c NULL if @a str does not start with @a prefix. + * + * @since New in 1.6. + */ +const char * apr_cstr_skip_prefix(const char *str, const char *prefix); + +/** @} */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* SVN_STRING_H */ diff --git a/include/apr_errno.h b/include/apr_errno.h index 78dbedf27bd..d2abfb18f8b 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -846,6 +846,13 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_EOPNOTSUPP (APR_OS_START_CANONERR + 28) #endif +/** @see APR_STATUS_IS_ERANGE */ +#ifdef ERANGE +#define APR_ERANGE ERANGE +#else +#define APR_ERANGE (APR_OS_START_CANONERR + 29) +#endif + /** @} */ #if defined(OS2) && !defined(DOXYGEN) @@ -988,6 +995,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + SOCEAFNOSUPPORT) #define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP \ || (s) == APR_OS_START_SYSERR + SOCEOPNOTSUPP) +#define APR_STATUS_IS_ERANGE(s) ((s) == APR_ERANGE) /* Sorry, too tired to wrap this up for OS2... feel free to @@ -1134,6 +1142,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT) #define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP \ || (s) == APR_OS_START_SYSERR + WSAEOPNOTSUPP) +#define APR_STATUS_IS_ERANGE(s) ((s) == APR_ERANGE) #elif defined(NETWARE) && defined(USE_WINSOCK) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */ @@ -1197,6 +1206,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT) #define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP \ || (s) == APR_OS_START_SYSERR + WSAEOPNOTSUPP) +#define APR_STATUS_IS_ERANGE(s) ((s) == APR_ERANGE) #else /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */ @@ -1318,6 +1328,9 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT) /** Socket operation not supported */ #define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP) + +/** Numeric value not representable */ +#define APR_STATUS_IS_ERANGE(s) ((s) == APR_ERANGE) /** @} */ #endif /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */ diff --git a/strings/apr_cstr.c b/strings/apr_cstr.c new file mode 100644 index 00000000000..1e0de5af469 --- /dev/null +++ b/strings/apr_cstr.c @@ -0,0 +1,392 @@ +/* Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "apr.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include "apr_fnmatch.h" +#if 0 +#define APR_WANT_STDIO +#define APR_WANT_STRFUNC +#endif +#include "apr_want.h" +#include "apr_cstr.h" + +void apr_cstr_split_append(apr_array_header_t *array, + const char *input, + const char *sep_chars, + int chop_whitespace, + apr_pool_t *pool) +{ + char *pats; + char *p; + + pats = apr_pstrdup(pool, input); /* strtok wants non-const data */ + p = apr_cstr_tokenize(sep_chars, &pats); + + while (p) + { + if (chop_whitespace) + { + while (apr_isspace(*p)) + p++; + + { + char *e = p + (strlen(p) - 1); + while ((e >= p) && (apr_isspace(*e))) + e--; + *(++e) = '\0'; + } + } + + if (p[0] != '\0') + APR_ARRAY_PUSH(array, const char *) = p; + + p = apr_cstr_tokenize(sep_chars, &pats); + } + + return; +} + + +apr_array_header_t * apr_cstr_split(const char *input, + const char *sep_chars, + int chop_whitespace, + apr_pool_t *pool) +{ + apr_array_header_t *a = apr_array_make(pool, 5, sizeof(input)); + apr_cstr_split_append(a, input, sep_chars, chop_whitespace, pool); + return a; +} + + +int apr_cstr_match_glob_list(const char *str, + const apr_array_header_t *list) +{ + int i; + + for (i = 0; i < list->nelts; i++) + { + const char *this_pattern = APR_ARRAY_IDX(list, i, char *); + + if (apr_fnmatch(this_pattern, str, 0) == APR_SUCCESS) + return TRUE; + } + + return FALSE; +} + +int apr_cstr_match_list(const char *str, const apr_array_header_t *list) +{ + int i; + + for (i = 0; i < list->nelts; i++) + { + const char *this_str = APR_ARRAY_IDX(list, i, char *); + + if (strcmp(this_str, str) == 0) + return TRUE; + } + + return FALSE; +} + +char * apr_cstr_tokenize(const char *sep, char **str) +{ + char *token; + char *next; + char csep; + + /* check parameters */ + if ((sep == NULL) || (str == NULL) || (*str == NULL)) + return NULL; + + /* let APR handle edge cases and multiple separators */ + csep = *sep; + if (csep == '\0' || sep[1] != '\0') + return apr_strtok(NULL, sep, str); + + /* skip characters in sep (will terminate at '\0') */ + token = *str; + while (*token == csep) + ++token; + + if (!*token) /* no more tokens */ + return NULL; + + /* skip valid token characters to terminate token and + * prepare for the next call (will terminate at '\0) + */ + next = strchr(token, csep); + if (next == NULL) + { + *str = token + strlen(token); + } + else + { + *next = '\0'; + *str = next + 1; + } + + return token; +} + +int apr_cstr_count_newlines(const char *msg) +{ + int count = 0; + const char *p; + + for (p = msg; *p; p++) + { + if (*p == '\n') + { + count++; + if (*(p + 1) == '\r') + p++; + } + else if (*p == '\r') + { + count++; + if (*(p + 1) == '\n') + p++; + } + } + + return count; +} + +#if 0 /* XXX: stringbuf logic is not present in APR */ +char * apr_cstr_join(const apr_array_header_t *strings, + const char *separator, + apr_pool_t *pool) +{ + svn_stringbuf_t *new_str = svn_stringbuf_create_empty(pool); + size_t sep_len = strlen(separator); + int i; + + for (i = 0; i < strings->nelts; i++) + { + const char *string = APR_ARRAY_IDX(strings, i, const char *); + svn_stringbuf_appendbytes(new_str, string, strlen(string)); + svn_stringbuf_appendbytes(new_str, separator, sep_len); + } + return new_str->data; +} +#endif + +#if !APR_CHARSET_EBCDIC +/* + * Our own known-fast translation table for casecmp by character. + * Only ASCII alpha characters 41-5A are folded to 61-7A, other + * octets (such as extended latin alphabetics) are never case-folded. + * NOTE: Other than Alpha A-Z/a-z, each code point is unique! + */ +static const unsigned char ucharmap[] = { + 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, + 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff +}; +#else /* APR_CHARSET_EBCDIC */ +/* + * Derived from apr-iconv/ccs/cp037.c for EBCDIC case comparison, + * provides unique identity of every char value (strict ISO-646 + * conformance, arbitrary election of an ISO-8859-1 ordering, and + * very arbitrary control code assignments into C1 to achieve + * identity and a reversible mapping of code points), + * then folding the equivalences of ASCII 41-5A into 61-7A, + * presenting comparison results in a somewhat ISO/IEC 10646 + * (ASCII-like) order, depending on the EBCDIC code page in use. + * + * NOTE: Other than Alpha A-Z/a-z, each code point is unique! + */ +static const unsigned char ucharmap[] = { + 0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, + 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x9D, 0x85, 0x08, 0x87, + 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x0A, 0x17, 0x1B, + 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07, + 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, + 0x98, 0x99, 0x9A, 0x9B, 0x14, 0x15, 0x9E, 0x1A, + 0x20, 0xA0, 0xE2, 0xE4, 0xE0, 0xE1, 0xE3, 0xE5, + 0xE7, 0xF1, 0xA2, 0x2E, 0x3C, 0x28, 0x2B, 0x7C, + 0x26, 0xE9, 0xEA, 0xEB, 0xE8, 0xED, 0xEE, 0xEF, + 0xEC, 0xDF, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0xAC, + 0x2D, 0x2F, 0xC2, 0xC4, 0xC0, 0xC1, 0xC3, 0xC5, + 0xC7, 0xD1, 0xA6, 0x2C, 0x25, 0x5F, 0x3E, 0x3F, + 0xF8, 0xC9, 0xCA, 0xCB, 0xC8, 0xCD, 0xCE, 0xCF, + 0xCC, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22, + 0xD8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0xAB, 0xBB, 0xF0, 0xFD, 0xFE, 0xB1, + 0xB0, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, + 0x71, 0x72, 0xAA, 0xBA, 0xE6, 0xB8, 0xC6, 0xA4, + 0xB5, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, + 0x79, 0x7A, 0xA1, 0xBF, 0xD0, 0xDD, 0xDE, 0xAE, + 0x5E, 0xA3, 0xA5, 0xB7, 0xA9, 0xA7, 0xB6, 0xBC, + 0xBD, 0xBE, 0x5B, 0x5D, 0xAF, 0xA8, 0xB4, 0xD7, + 0x7B, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0xAD, 0xF4, 0xF6, 0xF2, 0xF3, 0xF5, + 0x7D, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, + 0x71, 0x72, 0xB9, 0xFB, 0xFC, 0xF9, 0xFA, 0xFF, + 0x5C, 0xF7, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, + 0x79, 0x7A, 0xB2, 0xD4, 0xD6, 0xD2, 0xD3, 0xD5, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0xB3, 0xDB, 0xDC, 0xD9, 0xDA, 0x9F +}; +#endif + +int apr_cstr_casecmp(const char *str1, const char *str2) +{ + for (;;) + { + const int c1 = (int)(*((const unsigned char *)str1++)); + const int c2 = (int)(*((const unsigned char *)str2++)); + const int cmp = ucharmap[c1] - ucharmap[c2]; + if (cmp || !c1 || !c2) + return cmp; + } +} + +int apr_cstr_casecmpn(const char *str1, const char *str2, apr_size_t n) +{ + while (n--) + { + const int c1 = (int)(*((const unsigned char *)str1++)); + const int c2 = (int)(*((const unsigned char *)str2++)); + const int cmp = ucharmap[c1] - ucharmap[c2]; + if (cmp || !c1 || !c2) + return cmp; + } + return 0; +} + +apr_status_t apr_cstr_strtoui64(apr_uint64_t *n, const char *str, + apr_uint64_t minval, apr_uint64_t maxval, + int base) +{ + apr_int64_t val; + char *endptr; + + /* We assume errno is thread-safe. */ + errno = 0; /* APR-0.9 doesn't always set errno */ + + /* ### We're throwing away half the number range here. + * ### APR needs a apr_strtoui64() function. */ + val = apr_strtoi64(str, &endptr, base); + if (errno == EINVAL || endptr == str || str[0] == '\0' || *endptr != '\0') + return APR_EINVAL; + if ((errno == ERANGE && (val == APR_INT64_MIN || val == APR_INT64_MAX)) || + val < 0 || (apr_uint64_t)val < minval || (apr_uint64_t)val > maxval) + return APR_ERANGE; + *n = val; + return APR_SUCCESS; +} + +apr_status_t apr_cstr_atoui64(apr_uint64_t *n, const char *str) +{ + return apr_cstr_strtoui64(n, str, 0, APR_UINT64_MAX, 10); +} + +apr_status_t apr_cstr_atoui(unsigned int *n, const char *str) +{ + apr_uint64_t val; + apr_status_t rv = apr_cstr_strtoui64(&val, str, 0, APR_UINT32_MAX, 10); + if (rv == APR_SUCCESS) + *n = (unsigned int)val; + return rv; +} + +apr_status_t apr_cstr_strtoi64(apr_int64_t *n, const char *str, + apr_int64_t minval, apr_int64_t maxval, + int base) +{ + apr_int64_t val; + char *endptr; + + /* We assume errno is thread-safe. */ + errno = 0; /* APR-0.9 doesn't always set errno */ + + val = apr_strtoi64(str, &endptr, base); + if (errno == EINVAL || endptr == str || str[0] == '\0' || *endptr != '\0') + return APR_EINVAL; + if ((errno == ERANGE && (val == APR_INT64_MIN || val == APR_INT64_MAX)) || + val < minval || val > maxval) + return APR_ERANGE; + *n = val; + return APR_SUCCESS; +} + +apr_status_t apr_cstr_atoi64(apr_int64_t *n, const char *str) +{ + return apr_cstr_strtoi64(n, str, APR_INT64_MIN, APR_INT64_MAX, 10); +} + +apr_status_t apr_cstr_atoi(int *n, const char *str) +{ + apr_int64_t val; + apr_status_t rv; + + rv = apr_cstr_strtoi64(&val, str, APR_INT32_MIN, APR_INT32_MAX, 10); + if (rv == APR_SUCCESS) + *n = (int)val; + return rv; +} + +const char * +apr_cstr_skip_prefix(const char *str, const char *prefix) +{ + apr_size_t len = strlen(prefix); + + if (strncmp(str, prefix, len) == 0) + { + return str + len; + } + else + { + return NULL; + } +} From 6e6d835bb1e334f891e34b7774fe2ae30298ccb0 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 27 Jan 2016 12:38:00 +0000 Subject: [PATCH 7561/7878] not perfect, but at least makes it more clear that the comparison ignores case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1727020 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_cstr.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/apr_cstr.h b/include/apr_cstr.h index 3a7506f358b..f976b1b68d4 100644 --- a/include/apr_cstr.h +++ b/include/apr_cstr.h @@ -145,8 +145,9 @@ char * apr_cstr_join(const apr_array_header_t *strings, #endif /** - * Compare two strings @a atr1 and @a atr2, treating case-equivalent - * unaccented Latin (C/POSIX ASCII subset) alpha characters as equal. + * Perform a case-insensitive comparison of two strings @a atr1 and @a atr2, + * treating case-equivalent unaccented Latin (C/POSIX ASCII subset) alpha + * characters as equal. * * Returns in integer greater than, equal to, or less than 0, * according to whether @a str1 is considered greater than, equal to, @@ -157,9 +158,9 @@ char * apr_cstr_join(const apr_array_header_t *strings, int apr_cstr_casecmp(const char *str1, const char *str2); /** - * Compare two strings @a atr1 and @a atr2 of @n (or shorter) length, - * treating case-equivalent unaccented Latin (C/POSIX ASCII subset) - * alpha characters as equal. + * Perform a case-insensitive comparison of two strings @a atr1 and @a atr2, + * of @n (or shorter) length, treating case-equivalent unaccented Latin + * (C/POSIX ASCII subset) alpha characters as equal. * * Returns in integer greater than, equal to, or less than 0, * according to whether @a str1 is considered greater than, equal to, From a0db2db6f186cab6226ab03974fbda665a266445 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 27 Jan 2016 16:46:00 +0000 Subject: [PATCH 7562/7878] Revert testcstr.c for the time being while tests are structured git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1727127 13f79535-47bb-0310-9956-ffa450edef68 --- SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConscript b/SConscript index afe261850f3..b2c60a8a991 100644 --- a/SConscript +++ b/SConscript @@ -8,7 +8,7 @@ files = env.core_lib_files() libapr = env.SharedLibrary('apr-%d' % (major), files) tests = Split(""" abts.c testutil.c - testtime.c testcstr.c teststr.c testvsn.c testipsub.c testshm.c + testtime.c teststr.c testvsn.c testipsub.c testshm.c testmmap.c testud.c testtable.c testsleep.c testpools.c testfmt.c testfile.c testdir.c testfileinfo.c testrand.c testdso.c testoc.c testdup.c testsockets.c testproc.c From 2cb7abd8e27fb78976ce8aaa9ed907a326a6096c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 27 Jan 2016 19:31:17 +0000 Subject: [PATCH 7563/7878] Agree with jim, that "case-equivalent unaccented Latin (C/POSIX ASCII subset) alpha characters" literally means the values "A-Z" (all equivilant in case), distinct from the values "a-z" (all equivilant in case). We also can't say "ASCII" when we mean either "ASCII" or original "EBCDIC" alpha characters, so rephrase this strictly in terms of C/POSIX, signify the number of characters in that set, and explicitly call out that locale is ignored... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1727160 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_cstr.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/apr_cstr.h b/include/apr_cstr.h index f976b1b68d4..7256e9ea0e0 100644 --- a/include/apr_cstr.h +++ b/include/apr_cstr.h @@ -146,8 +146,9 @@ char * apr_cstr_join(const apr_array_header_t *strings, /** * Perform a case-insensitive comparison of two strings @a atr1 and @a atr2, - * treating case-equivalent unaccented Latin (C/POSIX ASCII subset) alpha - * characters as equal. + * treating upper and lower case values of the 26 standard C/POSIX alphabetic + * characters as equivilant. Extended latin characters outside of this set + * are treated as unique octets, irrespective of the current locale. * * Returns in integer greater than, equal to, or less than 0, * according to whether @a str1 is considered greater than, equal to, @@ -159,8 +160,9 @@ int apr_cstr_casecmp(const char *str1, const char *str2); /** * Perform a case-insensitive comparison of two strings @a atr1 and @a atr2, - * of @n (or shorter) length, treating case-equivalent unaccented Latin - * (C/POSIX ASCII subset) alpha characters as equal. + * treating upper and lower case values of the 26 standard C/POSIX alphabetic + * characters as equivilant. Extended latin characters outside of this set + * are treated as unique octets, irrespective of the current locale. * * Returns in integer greater than, equal to, or less than 0, * according to whether @a str1 is considered greater than, equal to, From dafb2bf264d012883a9f7dec459becdd73cda6c0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 27 Jan 2016 20:11:03 +0000 Subject: [PATCH 7564/7878] Add ivan's r1612823 test cases for apr_cstr_skip_prefix Found no other svn_cstring_ test cases to import, so skipping the creation of a testcstr.c module for the time being. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1727175 13f79535-47bb-0310-9956-ffa450edef68 --- test/teststr.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/teststr.c b/test/teststr.c index 1f748d6f22f..c722d2abd72 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -382,6 +382,17 @@ static void snprintf_overflow(abts_case *tc, void *data) ABTS_TRUE(tc, buf[2] == '4' && buf[3] == '2'); } +static void skip_prefix(abts_case *tc, void *data) +{ + ABTS_STR_EQUAL(tc, apr_cstr_skip_prefix("12345", "12345"), ""); + ABTS_STR_EQUAL(tc, apr_cstr_skip_prefix("12345", "123"), "45"); + ABTS_STR_EQUAL(tc, apr_cstr_skip_prefix("12345", ""), "12345"); + ABTS_STR_EQUAL(tc, apr_cstr_skip_prefix("12345", "23"), NULL); + ABTS_STR_EQUAL(tc, apr_cstr_skip_prefix("1", "12"), NULL); + ABTS_STR_EQUAL(tc, apr_cstr_skip_prefix("", ""), ""); + ABTS_STR_EQUAL(tc, apr_cstr_skip_prefix("", "12"), NULL); +} + abts_suite *teststr(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -399,6 +410,7 @@ abts_suite *teststr(abts_suite *suite) abts_run_test(suite, string_strfsize, NULL); abts_run_test(suite, string_cpystrn, NULL); abts_run_test(suite, snprintf_overflow, NULL); + abts_run_test(suite, skip_prefix, NULL); return suite; } From 995ddcab0389062d154692a9d0ed79cf4319eeff Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 27 Jan 2016 21:23:52 +0000 Subject: [PATCH 7565/7878] Fix spelling,w noted by mrumph git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1727199 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_cstr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_cstr.h b/include/apr_cstr.h index 7256e9ea0e0..a583ae1900b 100644 --- a/include/apr_cstr.h +++ b/include/apr_cstr.h @@ -147,7 +147,7 @@ char * apr_cstr_join(const apr_array_header_t *strings, /** * Perform a case-insensitive comparison of two strings @a atr1 and @a atr2, * treating upper and lower case values of the 26 standard C/POSIX alphabetic - * characters as equivilant. Extended latin characters outside of this set + * characters as equivalent. Extended latin characters outside of this set * are treated as unique octets, irrespective of the current locale. * * Returns in integer greater than, equal to, or less than 0, @@ -161,7 +161,7 @@ int apr_cstr_casecmp(const char *str1, const char *str2); /** * Perform a case-insensitive comparison of two strings @a atr1 and @a atr2, * treating upper and lower case values of the 26 standard C/POSIX alphabetic - * characters as equivilant. Extended latin characters outside of this set + * characters as equivalent. Extended latin characters outside of this set * are treated as unique octets, irrespective of the current locale. * * Returns in integer greater than, equal to, or less than 0, From f61182d6323dc2be48f0d1999ef01c0ea143b753 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 7 Feb 2016 13:03:33 +0000 Subject: [PATCH 7566/7878] Add header file include needed for using the new apr_cstr_skip_prefix(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1728957 13f79535-47bb-0310-9956-ffa450edef68 --- test/teststr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/teststr.c b/test/teststr.c index c722d2abd72..d9a5054758a 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -26,6 +26,7 @@ #include "apr_general.h" #include "apr_strings.h" +#include "apr_cstr.h" #include "apr_errno.h" /* I haven't bothered to check for APR_ENOTIMPL here, AFAIK, all string From 214d195550374312fac3353be39a203a413a3c3c Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 7 Feb 2016 13:04:42 +0000 Subject: [PATCH 7567/7878] Switch configure test for OpenSSL libcrypto from BN_init() to BN_new(). BN_init() is gone in OpenSSL 1.1.0. BN_new() exists at least since 0.9.8. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1728958 13f79535-47bb-0310-9956-ffa450edef68 --- build/crypto.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/crypto.m4 b/build/crypto.m4 index 4a99c0746cd..f3bee05fc3b 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -90,7 +90,7 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ [ if test "$withval" = "yes"; then AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1]) - AC_CHECK_LIB(crypto, BN_init, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) + AC_CHECK_LIB(crypto, BN_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then apu_have_openssl=1 fi @@ -106,7 +106,7 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ AC_MSG_NOTICE(checking for openssl in $withval) AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1]) - AC_CHECK_LIB(crypto, BN_init, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) + AC_CHECK_LIB(crypto, BN_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then apu_have_openssl=1 APR_ADDTO(LDFLAGS, [-L$withval/lib]) @@ -115,7 +115,7 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ if test "$apu_have_openssl" != "1"; then AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1]) - AC_CHECK_LIB(crypto, BN_init, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) + AC_CHECK_LIB(crypto, BN_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then apu_have_openssl=1 APR_ADDTO(LDFLAGS, [-L$withval/lib]) From 2ad4de130dcce64e3bf81031c60c71c9e600cc50 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 7 Feb 2016 14:16:13 +0000 Subject: [PATCH 7568/7878] Add support for OpenSSL 1.1.0: - choose OPENSSL_malloc_init() instead of CRYPTO_malloc_init - make cipherCtx a pointer. Type EVP_CIPHER_CTX is now opaque. - use EVP_CIPHER_CTX_new() in init() functions if initialised flag is not set (and set flag) - use EVP_CIPHER_CTX_free() in cleanup function - Improve reuse cleanup - call EVP_CIPHER_CTX_reset() resp. EVP_CIPHER_CTX_cleanup() in finish functions - call EVP_CIPHER_CTX_reset() resp. EVP_CIPHER_CTX_cleanup() when Update fails git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1728963 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_openssl.c | 83 ++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 17e8d7be854..debc4111b6b 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -65,7 +65,7 @@ struct apr_crypto_block_t { apr_pool_t *pool; const apr_crypto_driver_t *provider; const apr_crypto_t *f; - EVP_CIPHER_CTX cipherCtx; + EVP_CIPHER_CTX *cipherCtx; int initialised; int ivSize; int blockSize; @@ -112,7 +112,11 @@ static apr_status_t crypto_shutdown_helper(void *data) static apr_status_t crypto_init(apr_pool_t *pool, const char *params, const apu_err_t **result) { +#if OPENSSL_VERSION_NUMBER < 0x10100000L CRYPTO_malloc_init(); +#else + OPENSSL_malloc_init(); +#endif ERR_load_crypto_strings(); /* SSL_load_error_strings(); */ OpenSSL_add_all_algorithms(); @@ -135,7 +139,7 @@ static apr_status_t crypto_block_cleanup(apr_crypto_block_t *ctx) { if (ctx->initialised) { - EVP_CIPHER_CTX_cleanup(&ctx->cipherCtx); + EVP_CIPHER_CTX_free(ctx->cipherCtx); ctx->initialised = 0; } @@ -492,8 +496,10 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, apr_pool_cleanup_null); /* create a new context for encryption */ - EVP_CIPHER_CTX_init(&block->cipherCtx); - block->initialised = 1; + if (!block->initialised) { + block->cipherCtx = EVP_CIPHER_CTX_new(); + block->initialised = 1; + } /* generate an IV, if necessary */ usedIv = NULL; @@ -520,16 +526,16 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, /* set up our encryption context */ #if CRYPTO_OPENSSL_CONST_BUFFERS - if (!EVP_EncryptInit_ex(&block->cipherCtx, key->cipher, config->engine, + if (!EVP_EncryptInit_ex(block->cipherCtx, key->cipher, config->engine, key->key, usedIv)) { #else - if (!EVP_EncryptInit_ex(&block->cipherCtx, key->cipher, config->engine, (unsigned char *) key->key, (unsigned char *) usedIv)) { + if (!EVP_EncryptInit_ex(block->cipherCtx, key->cipher, config->engine, (unsigned char *) key->key, (unsigned char *) usedIv)) { #endif return APR_EINIT; } /* Clear up any read padding */ - if (!EVP_CIPHER_CTX_set_padding(&block->cipherCtx, key->doPad)) { + if (!EVP_CIPHER_CTX_set_padding(block->cipherCtx, key->doPad)) { return APR_EPADDING; } @@ -583,10 +589,15 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, } #if CRYPT_OPENSSL_CONST_BUFFERS - if (!EVP_EncryptUpdate(&ctx->cipherCtx, (*out), &outl, in, inlen)) { + if (!EVP_EncryptUpdate(ctx->cipherCtx, (*out), &outl, in, inlen)) { #else - if (!EVP_EncryptUpdate(&ctx->cipherCtx, (*out), &outl, + if (!EVP_EncryptUpdate(ctx->cipherCtx, (*out), &outl, (unsigned char *) in, inlen)) { +#endif +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); +#else + EVP_CIPHER_CTX_reset(ctx->cipherCtx); #endif return APR_ECRYPT; } @@ -617,14 +628,22 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, static apr_status_t crypto_block_encrypt_finish(unsigned char *out, apr_size_t *outlen, apr_crypto_block_t *ctx) { + apr_status_t rc = APR_SUCCESS; int len = *outlen; - if (EVP_EncryptFinal_ex(&ctx->cipherCtx, out, &len) == 0) { - return APR_EPADDING; + if (EVP_EncryptFinal_ex(ctx->cipherCtx, out, &len) == 0) { + rc = APR_EPADDING; + } + else { + *outlen = len; } - *outlen = len; +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); +#else + EVP_CIPHER_CTX_reset(ctx->cipherCtx); +#endif - return APR_SUCCESS; + return rc; } @@ -663,8 +682,10 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, apr_pool_cleanup_null); /* create a new context for encryption */ - EVP_CIPHER_CTX_init(&block->cipherCtx); - block->initialised = 1; + if (!block->initialised) { + block->cipherCtx = EVP_CIPHER_CTX_new(); + block->initialised = 1; + } /* generate an IV, if necessary */ if (key->ivSize) { @@ -675,16 +696,16 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, /* set up our encryption context */ #if CRYPTO_OPENSSL_CONST_BUFFERS - if (!EVP_DecryptInit_ex(&block->cipherCtx, key->cipher, config->engine, + if (!EVP_DecryptInit_ex(block->cipherCtx, key->cipher, config->engine, key->key, iv)) { #else - if (!EVP_DecryptInit_ex(&block->cipherCtx, key->cipher, config->engine, (unsigned char *) key->key, (unsigned char *) iv)) { + if (!EVP_DecryptInit_ex(block->cipherCtx, key->cipher, config->engine, (unsigned char *) key->key, (unsigned char *) iv)) { #endif return APR_EINIT; } /* Clear up any read padding */ - if (!EVP_CIPHER_CTX_set_padding(&block->cipherCtx, key->doPad)) { + if (!EVP_CIPHER_CTX_set_padding(block->cipherCtx, key->doPad)) { return APR_EPADDING; } @@ -738,10 +759,15 @@ static apr_status_t crypto_block_decrypt(unsigned char **out, } #if CRYPT_OPENSSL_CONST_BUFFERS - if (!EVP_DecryptUpdate(&ctx->cipherCtx, *out, &outl, in, inlen)) { + if (!EVP_DecryptUpdate(ctx->cipherCtx, *out, &outl, in, inlen)) { #else - if (!EVP_DecryptUpdate(&ctx->cipherCtx, *out, &outl, (unsigned char *) in, + if (!EVP_DecryptUpdate(ctx->cipherCtx, *out, &outl, (unsigned char *) in, inlen)) { +#endif +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); +#else + EVP_CIPHER_CTX_reset(ctx->cipherCtx); #endif return APR_ECRYPT; } @@ -772,15 +798,22 @@ static apr_status_t crypto_block_decrypt(unsigned char **out, static apr_status_t crypto_block_decrypt_finish(unsigned char *out, apr_size_t *outlen, apr_crypto_block_t *ctx) { - + apr_status_t rc = APR_SUCCESS; int len = *outlen; - if (EVP_DecryptFinal_ex(&ctx->cipherCtx, out, &len) == 0) { - return APR_EPADDING; + if (EVP_DecryptFinal_ex(ctx->cipherCtx, out, &len) == 0) { + rc = APR_EPADDING; } - *outlen = len; + else { + *outlen = len; + } +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); +#else + EVP_CIPHER_CTX_reset(ctx->cipherCtx); +#endif - return APR_SUCCESS; + return rc; } From 3a18bf012cc74e9b7955ad2ced1d6328c6ab9331 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 14 Feb 2016 14:25:01 +0000 Subject: [PATCH 7569/7878] r1728963 introduced the use of EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free() in apr crypto. These OpenSSL functions have only been added in 0.9.8b. Since apr trunk is expected to have even higher OpenSSL version requirements at GA time, check for the function during configure. The removed check for BN_new was only there to check for a working crypto lib. We didn't actually use BN_new. In apr-util 1.5.x where we still support 0.9.8 even before 0.9.8b, I added a definition for EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free() in r1730342. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1730344 13f79535-47bb-0310-9956-ffa450edef68 --- build/crypto.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/crypto.m4 b/build/crypto.m4 index f3bee05fc3b..65ed15eb5d8 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -90,7 +90,7 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ [ if test "$withval" = "yes"; then AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1]) - AC_CHECK_LIB(crypto, BN_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) + AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then apu_have_openssl=1 fi @@ -106,7 +106,7 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ AC_MSG_NOTICE(checking for openssl in $withval) AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1]) - AC_CHECK_LIB(crypto, BN_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) + AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then apu_have_openssl=1 APR_ADDTO(LDFLAGS, [-L$withval/lib]) @@ -115,7 +115,7 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ if test "$apu_have_openssl" != "1"; then AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1]) - AC_CHECK_LIB(crypto, BN_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) + AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then apu_have_openssl=1 APR_ADDTO(LDFLAGS, [-L$withval/lib]) From 5ab0a29f6ca1a580f53741e9f07635e825b1fb8e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 25 Feb 2016 15:08:43 +0000 Subject: [PATCH 7570/7878] Seems we forgot to merge apr-util/LICENSE while folding apr-util into apr git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1732317 13f79535-47bb-0310-9956-ffa450edef68 --- LICENSE | 147 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/LICENSE b/LICENSE index cf0fb63058a..f517ea3dc8d 100644 --- a/LICENSE +++ b/LICENSE @@ -338,4 +338,151 @@ From strings/apr_snprintf.c: ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +For the include\apr_md5.h component: + + * This is work is derived from material Copyright RSA Data Security, Inc. + * + * The RSA copyright statement and Licence for that original material is + * included below. This is followed by the Apache copyright statement and + * licence for the modifications made to that material. + + Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All + rights reserved. + + License to copy and use this software is granted provided that it + is identified as the "RSA Data Security, Inc. MD5 Message-Digest + Algorithm" in all material mentioning or referencing this software + or this function. + + License is also granted to make and use derivative works provided + that such works are identified as "derived from the RSA Data + Security, Inc. MD5 Message-Digest Algorithm" in all material + mentioning or referencing the derived work. + + RSA Data Security, Inc. makes no representations concerning either + the merchantability of this software or the suitability of this + software for any particular purpose. It is provided "as is" + without express or implied warranty of any kind. + + These notices must be retained in any copies of any part of this + documentation and/or software. + +For the passwd\apr_md5.c component: + + * This is work is derived from material Copyright RSA Data Security, Inc. + * + * The RSA copyright statement and Licence for that original material is + * included below. This is followed by the Apache copyright statement and + * licence for the modifications made to that material. + + Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All + rights reserved. + + License to copy and use this software is granted provided that it + is identified as the "RSA Data Security, Inc. MD5 Message-Digest + Algorithm" in all material mentioning or referencing this software + or this function. + + License is also granted to make and use derivative works provided + that such works are identified as "derived from the RSA Data + Security, Inc. MD5 Message-Digest Algorithm" in all material + mentioning or referencing the derived work. + + RSA Data Security, Inc. makes no representations concerning either + the merchantability of this software or the suitability of this + software for any particular purpose. It is provided "as is" + without express or implied warranty of any kind. + + These notices must be retained in any copies of any part of this + documentation and/or software. + + * The apr_md5_encode() routine uses much code obtained from the FreeBSD 3.0 + * MD5 crypt() function, which is licenced as follows: + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp + * ---------------------------------------------------------------------------- + +For the crypto\apr_md4.c component: + + * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All + * rights reserved. + * + * License to copy and use this software is granted provided that it + * is identified as the "RSA Data Security, Inc. MD4 Message-Digest + * Algorithm" in all material mentioning or referencing this software + * or this function. + * + * License is also granted to make and use derivative works provided + * that such works are identified as "derived from the RSA Data + * Security, Inc. MD4 Message-Digest Algorithm" in all material + * mentioning or referencing the derived work. + * + * RSA Data Security, Inc. makes no representations concerning either + * the merchantability of this software or the suitability of this + * software for any particular purpose. It is provided "as is" + * without express or implied warranty of any kind. + * + * These notices must be retained in any copies of any part of this + * documentation and/or software. + +For the crypto\crypt_blowfish.c(.h) component: + + * Written by Solar Designer in 1998-2011. + * No copyright is claimed, and the software is hereby placed in the public + * domain. In case this attempt to disclaim copyright and place the software + * in the public domain is deemed null and void, then the software is + * Copyright (c) 1998-2011 Solar Designer and it is hereby released to the + * general public under the following terms: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted. + * + * There's ABSOLUTELY NO WARRANTY, express or implied. + + See crypto/crypt_blowfish.c for more information. + +For the include\apr_md4.h component: + + * This is derived from material copyright RSA Data Security, Inc. + * Their notice is reproduced below in its entirety. + * + * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All + * rights reserved. + * + * License to copy and use this software is granted provided that it + * is identified as the "RSA Data Security, Inc. MD4 Message-Digest + * Algorithm" in all material mentioning or referencing this software + * or this function. + * + * License is also granted to make and use derivative works provided + * that such works are identified as "derived from the RSA Data + * Security, Inc. MD4 Message-Digest Algorithm" in all material + * mentioning or referencing the derived work. + * + * RSA Data Security, Inc. makes no representations concerning either + * the merchantability of this software or the suitability of this + * software for any particular purpose. It is provided "as is" + * without express or implied warranty of any kind. + * + * These notices must be retained in any copies of any part of this + * documentation and/or software. + +For the test\testmd4.c component: + + * This is derived from material copyright RSA Data Security, Inc. + * Their notice is reproduced below in its entirety. + * + * Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All + * rights reserved. + * + * RSA Data Security, Inc. makes no representations concerning either + * the merchantability of this software or the suitability of this + * software for any particular purpose. It is provided "as is" + * without express or implied warranty of any kind. + * + * These notices must be retained in any copies of any part of this + * documentation and/or software. From 259cf1d392eb5e8ec0dddd94e85e7b8744bf3acb Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 26 Feb 2016 23:39:50 +0000 Subject: [PATCH 7571/7878] Avoid a circular reference (PR 59068). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1732582 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_mutex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 819173a24cf..5dd729d0768 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -24,7 +24,6 @@ #include "apr.h" #include "apr_errno.h" -#include "apr_time.h" #ifdef __cplusplus extern "C" { @@ -48,6 +47,7 @@ typedef struct apr_thread_mutex_t apr_thread_mutex_t; /* Delayed the include to avoid a circular reference */ #include "apr_pools.h" +#include "apr_time.h" /** * Create and initialize a mutex that can be used to synchronize threads. From 814d275c5e99ea59260ec4c3a7f8681078604cd1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 3 Mar 2016 12:00:20 +0000 Subject: [PATCH 7572/7878] * include/apr_network_io.h (APR_SO_FREEBIND): Add option. * network_io/unix/sockopt.c (apr_socket_opt_set): Implement APR_SO_FREEBIND on Linux with IP_FREEBIND * test/testsock.c (test_freebind): Add test case. Submitted by: Ashley GC, jkaluza, jorton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1733451 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 3 +++ network_io/unix/sockopt.c | 14 ++++++++++++++ test/testsock.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 12998a3cdc2..d9714a6a62e 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -105,6 +105,9 @@ extern "C" { */ #define APR_SO_BROADCAST 65536 /**< Allow broadcast */ +#define APR_SO_FREEBIND 131072 /**< Allow binding to addresses not owned + * by any interface + */ /** @} */ diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 8ba553230d7..26e2271c92e 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -328,6 +328,20 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, apr_set_option(sock, APR_IPV6_V6ONLY, on); #else return APR_ENOTIMPL; +#endif + break; + case APR_SO_FREEBIND: +#if defined(IP_FREEBIND) + if (setsockopt(sock->socketdes, SOL_IP, IP_FREEBIND, + (void *)&one, sizeof(int)) == -1) { + return errno; + } + apr_set_option(sock, APR_SO_FREEBIND, on); +#elif defined(IP_BINDANY) + /* TODO: insert FreeBSD support here, note family specific + * options, IP_BINDANY vs IPV6_BINDANY */ +#else + return APR_ENOTIMPL; #endif break; default: diff --git a/test/testsock.c b/test/testsock.c index 620c3f6a6e8..70f8235ee08 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -607,6 +607,39 @@ static void test_nonblock_inheritance(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } +static void test_freebind(abts_case *tc, void *data) +{ +#ifdef IP_FREEBIND + apr_status_t rv; + apr_socket_t *sock; + apr_sockaddr_t *sa; + apr_int32_t on; + + /* RFC 5737 address */ + rv = apr_sockaddr_info_get(&sa, "192.0.2.1", APR_INET, 8080, 0, p); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); + + rv = apr_socket_create(&sock, sa->family, SOCK_STREAM, APR_PROTO_TCP, p); + APR_ASSERT_SUCCESS(tc, "Problem creating socket", rv); + + rv = apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1); + APR_ASSERT_SUCCESS(tc, "Could not set REUSEADDR on socket", rv); + + rv = apr_socket_opt_set(sock, APR_SO_FREEBIND, 1); + APR_ASSERT_SUCCESS(tc, "Could not enable FREEBIND option", rv); + + rv = apr_socket_opt_get(sock, APR_SO_FREEBIND, &on); + APR_ASSERT_SUCCESS(tc, "Could not retrieve FREEBIND option", rv); + ABTS_INT_EQUAL(tc, 1, on); + + rv = apr_socket_bind(sock, sa); + APR_ASSERT_SUCCESS(tc, "Problem binding to port with FREEBIND", rv); + + rv = apr_socket_close(sock); + APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); +#endif +} + abts_suite *testsock(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -623,6 +656,7 @@ abts_suite *testsock(abts_suite *suite) abts_run_test(suite, test_get_addr, NULL); abts_run_test(suite, test_wait, NULL); abts_run_test(suite, test_nonblock_inheritance, NULL); + abts_run_test(suite, test_freebind, NULL); #if APR_HAVE_SOCKADDR_UN socket_name = UNIX_SOCKET_NAME; socket_type = APR_UNIX; From b9c1b534fbec949be88f354f40d40061a2763b34 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 3 Mar 2016 12:12:34 +0000 Subject: [PATCH 7573/7878] Committed to 1.6.x branch first in error in r1733456: * include/apr_network_io.h: Document APR_SO_FREEBIND here. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1733457 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index d9714a6a62e..8c7f52b13d4 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -671,6 +671,7 @@ APR_DECLARE(apr_status_t) apr_socket_wait(apr_socket_t *sock, * of local addresses. * APR_SO_SNDBUF -- Set the SendBufferSize * APR_SO_RCVBUF -- Set the ReceiveBufferSize + * APR_SO_FREEBIND -- Allow binding to non-local IP address. * * @param on Value for the option. */ From dd6ba9bd9599d96283dc3b27c3b890486d276e6e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Mar 2016 13:06:39 +0000 Subject: [PATCH 7574/7878] * network_io/unix/sockopt.c (apr_socket_opt_set): Return APR_ENOTIMPL for APR_SO_FREEBIND on FreeBSD. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1733594 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockopt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 26e2271c92e..c48ab06a540 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -337,7 +337,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, return errno; } apr_set_option(sock, APR_SO_FREEBIND, on); -#elif defined(IP_BINDANY) +#elif 0 /* defined(IP_BINDANY) ... */ /* TODO: insert FreeBSD support here, note family specific * options, IP_BINDANY vs IPV6_BINDANY */ #else From ebde1a6c3f306b1487ca90a6561c9c7345849088 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sat, 5 Mar 2016 09:29:08 +0000 Subject: [PATCH 7575/7878] apr_proc_mutex-pthread: Refcount shared mutexes usage to avoid destruction while still is use by some process(es). PR 49504. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1733694 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++ locks/unix/proc_mutex.c | 54 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 71d5df3d37b..4f9a6496442 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_proc_mutex-pthread: Refcount shared mutexes usage to avoid + destruction while still is use by some process(es). PR 49504. + [Yann Ylavic] + *) apr_filepath_merge: Fix truename length calculation on Windows in cases where the "short" name variant is actually longer than the "long" or "true" name. See: testnames.c:merge_shortname(). diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index f66cd6c9cc6..41830f82258 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -19,6 +19,7 @@ #include "apr_arch_proc_mutex.h" #include "apr_arch_file_io.h" /* for apr_mkstemp() */ #include "apr_md5.h" /* for apr_md5() */ +#include "apr_atomic.h" APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) { @@ -417,7 +418,24 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = #if APR_HAS_PROC_PTHREAD_SERIALIZE -static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_) +/* The mmap()ed pthread_interproc is the native pthread_mutex_t followed + * by a refcounter to track children using it. We want to avoid calling + * pthread_mutex_destroy() on the shared mutex area while it is in use by + * another process, because this may mark the shared pthread_mutex_t as + * invalid for everyone, including forked children (unlike "sysvsem" for + * example), causing unexpected errors or deadlocks (PR 49504). So the + * last process (parent or child) referencing the mutex will effectively + * destroy it. + */ +typedef struct { + pthread_mutex_t mutex; + apr_uint32_t refcount; +} proc_pthread_mutex_t; + +#define proc_pthread_mutex_refcount(m) \ + (((proc_pthread_mutex_t *)(m)->pthread_interproc)->refcount) + +static apr_status_t proc_pthread_mutex_unref(void *mutex_) { apr_proc_mutex_t *mutex=mutex_; apr_status_t rv; @@ -430,8 +448,7 @@ static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_) return rv; } } - /* curr_locked is set to -1 until the mutex has been created */ - if (mutex->curr_locked != -1) { + if (!apr_atomic_dec32(&proc_pthread_mutex_refcount(mutex))) { if ((rv = pthread_mutex_destroy(mutex->pthread_interproc))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; @@ -439,6 +456,20 @@ static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_) return rv; } } + return APR_SUCCESS; +} + +static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_) +{ + apr_proc_mutex_t *mutex=mutex_; + apr_status_t rv; + + /* curr_locked is set to -1 until the mutex has been created */ + if (mutex->curr_locked != -1) { + if ((rv = proc_pthread_mutex_unref(mutex))) { + return rv; + } + } if (munmap((caddr_t)mutex->pthread_interproc, sizeof(pthread_mutex_t))) { return errno; } @@ -459,7 +490,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, new_mutex->pthread_interproc = (pthread_mutex_t *)mmap( (caddr_t) 0, - sizeof(pthread_mutex_t), + sizeof(proc_pthread_mutex_t), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (new_mutex->pthread_interproc == (pthread_mutex_t *) (caddr_t) -1) { @@ -515,6 +546,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, return rv; } + proc_pthread_mutex_refcount(new_mutex) = 1; /* first/parent reference */ new_mutex->curr_locked = 0; /* mutex created now */ if ((rv = pthread_mutexattr_destroy(&mattr))) { @@ -532,6 +564,17 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, return APR_SUCCESS; } +static apr_status_t proc_mutex_proc_pthread_child_init(apr_proc_mutex_t **mutex, + apr_pool_t *pool, + const char *fname) +{ + (*mutex)->curr_locked = 0; + apr_atomic_inc32(&proc_pthread_mutex_refcount(*mutex)); + apr_pool_cleanup_register(pool, *mutex, proc_pthread_mutex_unref, + apr_pool_cleanup_null); + return APR_SUCCESS; +} + static apr_status_t proc_mutex_proc_pthread_acquire(apr_proc_mutex_t *mutex) { apr_status_t rv; @@ -543,6 +586,7 @@ static apr_status_t proc_mutex_proc_pthread_acquire(apr_proc_mutex_t *mutex) #ifdef HAVE_PTHREAD_MUTEX_ROBUST /* Okay, our owner died. Let's try to make it consistent again. */ if (rv == EOWNERDEAD) { + apr_atomic_dec32(&proc_pthread_mutex_refcount(mutex)); pthread_mutex_consistent_np(mutex->pthread_interproc); } else @@ -648,7 +692,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_methods = proc_mutex_proc_pthread_timedacquire, proc_mutex_proc_pthread_release, proc_mutex_proc_pthread_cleanup, - proc_mutex_no_child_init, + proc_mutex_proc_pthread_child_init, proc_mutex_no_perms_set, "pthread" }; From a9d6d7792e5eb88b39e46ba3ae818772e0bd2744 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sat, 5 Mar 2016 12:08:15 +0000 Subject: [PATCH 7576/7878] apr_proc_mutex-pthread: follow up to r1733694. Add missing refcount decrement when recovering the mutex from died owner, like in proc_mutex_proc_pthread_acquire() but this time for proc_mutex_proc_pthread_tryacquire() and proc_mutex_proc_pthread_timedacquire(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1733706 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 41830f82258..4487cda7433 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -613,6 +613,7 @@ static apr_status_t proc_mutex_proc_pthread_tryacquire(apr_proc_mutex_t *mutex) #ifdef HAVE_PTHREAD_MUTEX_ROBUST /* Okay, our owner died. Let's try to make it consistent again. */ if (rv == EOWNERDEAD) { + apr_atomic_dec32(&proc_pthread_mutex_refcount(mutex)); pthread_mutex_consistent_np(mutex->pthread_interproc); rv = APR_SUCCESS; } @@ -655,6 +656,7 @@ proc_mutex_proc_pthread_timedacquire(apr_proc_mutex_t *mutex, #ifdef HAVE_PTHREAD_MUTEX_ROBUST /* Okay, our owner died. Let's try to make it consistent again. */ if (rv == EOWNERDEAD) { + apr_atomic_dec32(&proc_pthread_mutex_refcount(mutex)); pthread_mutex_consistent_np(mutex->pthread_interproc); rv = APR_SUCCESS; } From e56f136e167d3a30716f83abb2c250f0274d409c Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sat, 5 Mar 2016 12:15:02 +0000 Subject: [PATCH 7577/7878] apr_proc_mutex-pthread: follow up to r1733694. Simplify #if/#else/#endif logic, no functional change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1733708 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 4487cda7433..9325c2114e5 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -590,10 +590,8 @@ static apr_status_t proc_mutex_proc_pthread_acquire(apr_proc_mutex_t *mutex) pthread_mutex_consistent_np(mutex->pthread_interproc); } else - return rv; -#else - return rv; #endif + return rv; } mutex->curr_locked = 1; return APR_SUCCESS; @@ -615,13 +613,10 @@ static apr_status_t proc_mutex_proc_pthread_tryacquire(apr_proc_mutex_t *mutex) if (rv == EOWNERDEAD) { apr_atomic_dec32(&proc_pthread_mutex_refcount(mutex)); pthread_mutex_consistent_np(mutex->pthread_interproc); - rv = APR_SUCCESS; } else - return rv; -#else - return rv; #endif + return rv; } mutex->curr_locked = 1; return APR_SUCCESS; @@ -658,13 +653,10 @@ proc_mutex_proc_pthread_timedacquire(apr_proc_mutex_t *mutex, if (rv == EOWNERDEAD) { apr_atomic_dec32(&proc_pthread_mutex_refcount(mutex)); pthread_mutex_consistent_np(mutex->pthread_interproc); - rv = APR_SUCCESS; } else - return rv; -#else - return rv; #endif + return rv; } } mutex->curr_locked = 1; From 48f1465414d4ece402743efbedc33f93c044ad70 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sat, 5 Mar 2016 23:14:29 +0000 Subject: [PATCH 7578/7878] Windows' proc_mutex doesn't require require an additional thread_mutex to synchronize inside the same process, and hence can simply be mapped to a global_mutex, saving both a double lock and a resource for the latter. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1733774 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/apr.h.in b/include/apr.h.in index 9d6ebb4304e..ea936158a50 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -630,7 +630,11 @@ typedef apr_int32_t apr_intptr_t; #endif /* DARWIN_10 */ /* Does the proc mutex lock threads too */ +#ifdef WIN32 +#define APR_PROC_MUTEX_IS_GLOBAL 1 +#else #define APR_PROC_MUTEX_IS_GLOBAL @proc_mutex_is_global@ +#endif /* Local machine definition for console and log output. */ #define APR_EOL_STR "@eolstr@" From 7951861fb029fd0fb60e5ec8da73015d03afa28d Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sun, 6 Mar 2016 00:19:51 +0000 Subject: [PATCH 7579/7878] apr_proc/global_mutex: Fix API regarding the native OS mutexes accessors from/to available APR mechanisms, adding the new functions apr_os_proc_mutex_get_ex() and apr_os_proc_mutex_set_ex() which give control to the user over the selected mechanisms, including the missing POSIX semaphores (sem_t) on platforms supporting them. For POSIX sems, this moves the "sem_t *psem_interproc;" member from struct apr_proc_mutex_t to apr_os_proc_mutex_t (now complete) so that we can avoid members duplication between the two structs, and hence replace all the doublons in apr_os_proc_mutex_t with an apr_os_proc_mutex_t member, called "os", to be used for runtime. This first commit aims to be backportable to 1.6.x, thus does not address the Netware case which requires an incompatible change of the apr_proc_mutex_t to a pointer type (the implementation is here since very similar to other changes is this commit, but it is commented out for now, a simple follow up is coming with the type change for trunk only...). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1733775 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 + include/apr_global_mutex.h | 16 +- include/apr_portable.h | 37 ++- include/apr_proc_mutex.h | 13 +- include/arch/unix/apr_arch_proc_mutex.h | 25 +- locks/beos/proc_mutex.c | 32 ++- locks/netware/proc_mutex.c | 68 ++++- locks/os2/proc_mutex.c | 37 ++- locks/unix/global_mutex.c | 9 +- locks/unix/proc_mutex.c | 347 +++++++++++++++++------- locks/win32/proc_mutex.c | 36 ++- 11 files changed, 485 insertions(+), 142 deletions(-) diff --git a/CHANGES b/CHANGES index 4f9a6496442..26cd4003151 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,13 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_proc/global_mutex: Fix API regarding the native OS mutexes + accessors from/to available APR mechanisms, adding the new functions + apr_os_proc_mutex_get_ex() and apr_os_proc_mutex_set_ex() which give + control to the user over the selected mechanisms, including the missing + POSIX semaphores (sem_t) on platforms supporting them. + [Yann Ylavic] + *) apr_proc_mutex-pthread: Refcount shared mutexes usage to avoid destruction while still is use by some process(es). PR 49504. [Yann Ylavic] diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index f6d9f4857f2..f6deb8d17eb 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -141,10 +141,16 @@ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex); APR_DECLARE(const char *) apr_global_mutex_lockfile(apr_global_mutex_t *mutex); /** - * Display the name of the mutex, as it relates to the actual method used - * for the underlying apr_proc_mutex_t, if any. NULL is returned if - * there is no underlying apr_proc_mutex_t. - * @param mutex the name of the mutex + * Get the mechanism of the mutex, as it relates to the actual method + * used for the underlying apr_proc_mutex_t. + * @param mutex the mutex to get the mechanism from. + */ +APR_DECLARE(apr_lockmech_e) apr_global_mutex_mech(apr_global_mutex_t *mutex); + +/** + * Get the mechanism's name of the mutex, as it relates to the actual method + * used for the underlying apr_proc_mutex_t. + * @param mutex the mutex to get the mechanism's name from. */ APR_DECLARE(const char *) apr_global_mutex_name(apr_global_mutex_t *mutex); @@ -174,7 +180,9 @@ APR_POOL_DECLARE_ACCESSOR(global_mutex); #define apr_global_mutex_unlock apr_proc_mutex_unlock #define apr_global_mutex_destroy apr_proc_mutex_destroy #define apr_global_mutex_lockfile apr_proc_mutex_lockfile +#define apr_global_mutex_mech apr_proc_mutex_mech #define apr_global_mutex_name apr_proc_mutex_name +#define apr_global_mutex_perms_set apr_proc_mutex_perms_set #define apr_global_mutex_pool_get apr_proc_mutex_pool_get #endif diff --git a/include/apr_portable.h b/include/apr_portable.h index 98e19bfec48..7ba8215ad79 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -46,6 +46,9 @@ #if APR_HAVE_PTHREAD_H #include #endif +#if APR_HAVE_SEMAPHORE_H +#include +#endif #ifdef __cplusplus extern "C" { @@ -140,6 +143,10 @@ struct apr_os_proc_mutex_t { pthread_mutex_t *intraproc; #endif #endif +#if APR_HAS_POSIXSEM_SERIALIZE + /** Value used for POSIX semaphores serialization */ + sem_t *psem_interproc; +#endif }; typedef int apr_os_file_t; /**< native file */ @@ -241,13 +248,26 @@ APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock); /** - * Convert the proc mutex from os specific type to apr type + * Convert the proc mutex from apr type to os specific type * @param ospmutex The os specific proc mutex we are converting to. * @param pmutex The apr proc mutex to convert. */ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, apr_proc_mutex_t *pmutex); +/** + * Convert the proc mutex from apr type to os specific type, also + * providing the mechanism used by the apr mutex. + * @param ospmutex The os specific proc mutex we are converting to. + * @param pmutex The apr proc mutex to convert. + * @param mech The mechanism used by the apr proc mutex (if not NULL). + * @remark Allows for disambiguation for platforms with multiple mechanisms + * available. + */ +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get_ex(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex, + apr_lockmech_e *mech); + /** * Get the exploded time in the platforms native format. * @param ostime the native time format @@ -418,6 +438,21 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *cont); +/** + * Convert the proc mutex from os specific type to apr type, using the + * specified mechanism. + * @param pmutex The apr proc mutex we are converting to. + * @param ospmutex The os specific proc mutex to convert. + * @param mech The apr mutex locking mechanism + * @param cont The pool to use if it is needed. + * @remark Allows for disambiguation for platforms with multiple mechanisms + * available. + */ +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, + apr_os_proc_mutex_t *ospmutex, + apr_lockmech_e mech, + apr_pool_t *cont); + /** * Put the imploded time in the APR format. * @param aprtime the APR time format diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index d6f05d48983..15312b2bdbd 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -154,9 +154,16 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex); APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex); /** - * Display the name of the mutex, as it relates to the actual method used. - * This matches the valid options for Apache's AcceptMutex directive - * @param mutex the name of the mutex + * Get the mechanism of the mutex, as it relates to the actual method + * used for the underlying apr_proc_mutex_t. + * @param mutex the mutex to get the mechanism from. + */ +APR_DECLARE(apr_lockmech_e) apr_proc_mutex_mech(apr_proc_mutex_t *mutex); + +/** + * Get the mechanism's name of the mutex, as it relates to the actual method + * used for the underlying apr_proc_mutex_t. + * @param mutex the mutex to get the mechanism's name from. */ APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex); diff --git a/include/arch/unix/apr_arch_proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h index 37ecd0b5adc..9988248471a 100644 --- a/include/arch/unix/apr_arch_proc_mutex.h +++ b/include/arch/unix/apr_arch_proc_mutex.h @@ -63,9 +63,6 @@ #if APR_HAVE_PTHREAD_H #include #endif -#if APR_HAVE_SEMAPHORE_H -#include -#endif /* End System Headers */ struct apr_proc_mutex_unix_lock_methods_t { @@ -78,6 +75,7 @@ struct apr_proc_mutex_unix_lock_methods_t { apr_status_t (*cleanup)(void *); apr_status_t (*child_init)(apr_proc_mutex_t **, apr_pool_t *, const char *); apr_status_t (*perms_set)(apr_proc_mutex_t *, apr_fileperms_t, apr_uid_t, apr_gid_t); + apr_lockmech_e mech; const char *name; }; typedef struct apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_lock_methods_t; @@ -96,17 +94,24 @@ union semun { struct apr_proc_mutex_t { apr_pool_t *pool; const apr_proc_mutex_unix_lock_methods_t *meth; - const apr_proc_mutex_unix_lock_methods_t *inter_meth; int curr_locked; char *fname; -#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE - apr_file_t *interproc; -#endif -#if APR_HAS_POSIXSEM_SERIALIZE - sem_t *psem_interproc; + + apr_os_proc_mutex_t os; /* Native mutex holder. */ + +#if APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE + apr_file_t *interproc; /* For apr_file_ calls on native fd. */ + int interproc_closing; /* whether the native fd is opened/closed with + * 'interproc' or apr_os_file_put()ed (hence + * needing an an explicit close for consistency + * with other methods). + */ #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE - pthread_mutex_t *pthread_interproc; + int pthread_refcounting; /* Whether the native mutex is refcounted or + * apr_os_proc_mutex_put()ed, which makes + * refcounting impossible/undesirable. + */ #endif }; diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index 4408df0940a..d5c681741f6 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -182,6 +182,11 @@ APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) return NULL; } +APR_DECLARE(apr_lockmech_e) apr_proc_mutex_mech(apr_proc_mutex_t *mutex) +{ + return APR_LOCK_DEFAULT_TIMED; +} + APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) { return "beossem"; @@ -198,21 +203,35 @@ APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ -APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, - apr_proc_mutex_t *pmutex) +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get_ex(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex, + apr_lockmech_e *mech) { ospmutex->sem = pmutex->Lock; ospmutex->ben = pmutex->LockCount; + if (mech) { + *mech = APR_LOCK_DEFAULT_TIMED; + } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex) +{ + return apr_os_proc_mutex_get_ex(ospmutex, pmutex, NULL); +} + +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, + apr_lockmech_e mech, apr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } + if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) { + return APR_ENOTIMPL; + } if ((*pmutex) == NULL) { (*pmutex) = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); (*pmutex)->pool = pool; @@ -222,3 +241,10 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, + apr_os_proc_mutex_t *ospmutex, + apr_pool_t *pool) +{ + return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT_TIMED, pool); +} + diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 4217b1cf0fe..04b7672f926 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -105,6 +105,11 @@ APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) return NULL; } +APR_DECLARE(apr_lockmech_e) apr_proc_mutex_mech(apr_proc_mutex_t *mutex) +{ + return APR_LOCK_DEFAULT; +} + APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) { return "netwarethread"; @@ -121,18 +126,65 @@ APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ -apr_status_t apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, - apr_proc_mutex_t *pmutex) +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get_ex(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex, + apr_lockmech_e *mech) { - if (pmutex) - ospmutex = pmutex->mutex->mutex; - return APR_ENOLOCK; +#if 1 + /* We need to change apr_os_proc_mutex_t to a pointer type + * to be able to implement this function. + */ + return APR_ENOTIMPL; +#else + if (!pmutex->mutex) { + return APR_ENOLOCK; + } + *ospmutex = pmutex->mutex->mutex; + if (mech) { + *mech = APR_LOCK_DEFAULT; + } + return APR_SUCCESS; +#endif +} + +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex) +{ + return apr_os_proc_mutex_get_ex(ospmutex, pmutex, NULL); } -apr_status_t apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, - apr_os_proc_mutex_t *ospmutex, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, + apr_os_proc_mutex_t *ospmutex, + apr_lockmech_e mech, + apr_pool_t *pool) { + if (pool == NULL) { + return APR_ENOPOOL; + } + if (mech != APR_LOCK_DEFAULT) { + return APR_ENOTIMPL; + } +#if 1 + /* We need to change apr_os_proc_mutex_t to a pointer type + * to be able to implement this function. + */ return APR_ENOTIMPL; +#else + if ((*pmutex) == NULL) { + (*pmutex) = apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); + (*pmutex)->pool = pool; + } + (*pmutex)->mutex = apr_pcalloc(pool, sizeof(apr_thread_mutex_t)); + (*pmutex)->mutex->mutex = *ospmutex; + (*pmutex)->mutex->pool = pool; + return APR_SUCCESS; +#endif +} + +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, + apr_os_proc_mutex_t *ospmutex, + apr_pool_t *pool) +{ + return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT, pool); } diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index e873963f2fe..83f64c84866 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -60,6 +60,11 @@ APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) return NULL; } +APR_DECLARE(apr_lockmech_e) apr_proc_mutex_mech(apr_proc_mutex_t *mutex) +{ + return APR_LOCK_DEFAULT_TIMED; +} + APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) { return "os2sem"; @@ -243,20 +248,35 @@ APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ -APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, - apr_proc_mutex_t *pmutex) +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get_ex(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex, + apr_lockmech_e *mech) { *ospmutex = pmutex->hMutex; - return APR_ENOTIMPL; + if (mech) { + *mech = APR_LOCK_DEFAULT_TIMED; + } + return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex) +{ + return apr_os_proc_mutex_get_ex(ospmutex, pmutex, NULL); +} - -APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, + apr_lockmech_e mech, apr_pool_t *pool) { apr_proc_mutex_t *new; + if (pool == NULL) { + return APR_ENOPOOL; + } + if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) { + return APR_ENOTIMPL; + } new = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); new->pool = pool; @@ -268,3 +288,10 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, + apr_os_proc_mutex_t *ospmutex, + apr_pool_t *pool) +{ + return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT_TIMED, pool); +} + diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index 19485c48756..b343e23ad7e 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -15,6 +15,7 @@ */ #include "apr.h" + #include "apr_strings.h" #include "apr_arch_global_mutex.h" #include "apr_proc_mutex.h" @@ -59,7 +60,7 @@ APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, } #if APR_HAS_THREADS - if (m->proc_mutex->inter_meth->flags & APR_PROCESS_LOCK_MECH_IS_GLOBAL) { + if (m->proc_mutex->meth->flags & APR_PROCESS_LOCK_MECH_IS_GLOBAL) { m->thread_mutex = NULL; /* We don't need a thread lock. */ } else { @@ -214,6 +215,11 @@ APR_DECLARE(const char *) apr_global_mutex_lockfile(apr_global_mutex_t *mutex) return apr_proc_mutex_lockfile(mutex->proc_mutex); } +APR_DECLARE(apr_lockmech_e) apr_global_mutex_mech(apr_global_mutex_t *mutex) +{ + return apr_proc_mutex_mech(mutex->proc_mutex); +} + APR_DECLARE(const char *) apr_global_mutex_name(apr_global_mutex_t *mutex) { return apr_proc_mutex_name(mutex->proc_mutex); @@ -229,3 +235,4 @@ APR_PERMS_SET_IMPLEMENT(global_mutex) } APR_POOL_IMPLEMENT_ACCESSOR(global_mutex) + diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 9325c2114e5..9b623c6bc00 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -57,7 +57,7 @@ static apr_status_t proc_mutex_posix_cleanup(void *mutex_) { apr_proc_mutex_t *mutex = mutex_; - if (sem_close(mutex->psem_interproc) < 0) { + if (sem_close(mutex->os.psem_interproc) < 0) { return errno; } @@ -72,8 +72,6 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, sem_t *psem; char semname[APR_MD5_DIGESTSIZE * 2 + 2]; - new_mutex->interproc = apr_palloc(new_mutex->pool, - sizeof(*new_mutex->interproc)); /* * This bogusness is to follow what appears to be the * lowest common denominator in Posix semaphore naming: @@ -136,7 +134,7 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, } /* Ahhh. The joys of Posix sems. Predelete it... */ sem_unlink(semname); - new_mutex->psem_interproc = psem; + new_mutex->os.psem_interproc = psem; new_mutex->fname = apr_pstrdup(new_mutex->pool, semname); apr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, apr_proc_mutex_cleanup, @@ -149,7 +147,7 @@ static apr_status_t proc_mutex_posix_acquire(apr_proc_mutex_t *mutex) int rc; do { - rc = sem_wait(mutex->psem_interproc); + rc = sem_wait(mutex->os.psem_interproc); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -163,7 +161,7 @@ static apr_status_t proc_mutex_posix_tryacquire(apr_proc_mutex_t *mutex) int rc; do { - rc = sem_trywait(mutex->psem_interproc); + rc = sem_trywait(mutex->os.psem_interproc); } while (rc < 0 && errno == EINTR); if (rc < 0) { if (errno == EAGAIN) { @@ -194,7 +192,7 @@ static apr_status_t proc_mutex_posix_timedacquire(apr_proc_mutex_t *mutex, abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ do { - rc = sem_timedwait(mutex->psem_interproc, &abstime); + rc = sem_timedwait(mutex->os.psem_interproc, &abstime); } while (rc < 0 && errno == EINTR); if (rc < 0) { if (errno == ETIMEDOUT) { @@ -213,7 +211,7 @@ static apr_status_t proc_mutex_posix_timedacquire(apr_proc_mutex_t *mutex, static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) { mutex->curr_locked = 0; - if (sem_post(mutex->psem_interproc) < 0) { + if (sem_post(mutex->os.psem_interproc) < 0) { /* any failure is probably fatal, so no big deal to leave * ->curr_locked at 0. */ return errno; @@ -236,6 +234,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_posixsem_methods = proc_mutex_posix_cleanup, proc_mutex_no_child_init, proc_mutex_no_perms_set, + APR_LOCK_POSIXSEM, "posixsem" }; @@ -265,9 +264,9 @@ static apr_status_t proc_mutex_sysv_cleanup(void *mutex_) apr_proc_mutex_t *mutex=mutex_; union semun ick; - if (mutex->interproc->filedes != -1) { + if (mutex->os.crossproc != -1) { ick.val = 0; - semctl(mutex->interproc->filedes, 0, IPC_RMID, ick); + semctl(mutex->os.crossproc, 0, IPC_RMID, ick); } return APR_SUCCESS; } @@ -278,18 +277,17 @@ static apr_status_t proc_mutex_sysv_create(apr_proc_mutex_t *new_mutex, union semun ick; apr_status_t rv; - new_mutex->interproc = apr_palloc(new_mutex->pool, sizeof(*new_mutex->interproc)); - new_mutex->interproc->filedes = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600); - - if (new_mutex->interproc->filedes < 0) { + new_mutex->os.crossproc = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600); + if (new_mutex->os.crossproc == -1) { rv = errno; proc_mutex_sysv_cleanup(new_mutex); return rv; } ick.val = 1; - if (semctl(new_mutex->interproc->filedes, 0, SETVAL, ick) < 0) { + if (semctl(new_mutex->os.crossproc, 0, SETVAL, ick) < 0) { rv = errno; proc_mutex_sysv_cleanup(new_mutex); + new_mutex->os.crossproc = -1; return rv; } new_mutex->curr_locked = 0; @@ -304,7 +302,7 @@ static apr_status_t proc_mutex_sysv_acquire(apr_proc_mutex_t *mutex) int rc; do { - rc = semop(mutex->interproc->filedes, &proc_mutex_op_on, 1); + rc = semop(mutex->os.crossproc, &proc_mutex_op_on, 1); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -318,7 +316,7 @@ static apr_status_t proc_mutex_sysv_tryacquire(apr_proc_mutex_t *mutex) int rc; do { - rc = semop(mutex->interproc->filedes, &proc_mutex_op_try, 1); + rc = semop(mutex->os.crossproc, &proc_mutex_op_try, 1); } while (rc < 0 && errno == EINTR); if (rc < 0) { if (errno == EAGAIN) { @@ -347,7 +345,7 @@ static apr_status_t proc_mutex_sysv_timedacquire(apr_proc_mutex_t *mutex, abstime.tv_sec = apr_time_sec(timeout); abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ do { - rc = semtimedop(mutex->interproc->filedes, &proc_mutex_op_on, 1, + rc = semtimedop(mutex->os.crossproc, &proc_mutex_op_on, 1, &abstime); } while (rc < 0 && errno == EINTR); if (rc < 0) { @@ -370,7 +368,7 @@ static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex) mutex->curr_locked = 0; do { - rc = semop(mutex->interproc->filedes, &proc_mutex_op_off, 1); + rc = semop(mutex->os.crossproc, &proc_mutex_op_off, 1); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -390,7 +388,7 @@ static apr_status_t proc_mutex_sysv_perms_set(apr_proc_mutex_t *mutex, buf.sem_perm.gid = gid; buf.sem_perm.mode = apr_unix_perms2mode(perms); ick.buf = &buf; - if (semctl(mutex->interproc->filedes, 0, IPC_SET, ick) < 0) { + if (semctl(mutex->os.crossproc, 0, IPC_SET, ick) < 0) { return errno; } return APR_SUCCESS; @@ -411,6 +409,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = proc_mutex_sysv_cleanup, proc_mutex_no_child_init, proc_mutex_sysv_perms_set, + APR_LOCK_SYSVSEM, "sysvsem" }; @@ -433,7 +432,24 @@ typedef struct { } proc_pthread_mutex_t; #define proc_pthread_mutex_refcount(m) \ - (((proc_pthread_mutex_t *)(m)->pthread_interproc)->refcount) + (((proc_pthread_mutex_t *)(m)->os.pthread_interproc)->refcount) + +static APR_INLINE int proc_pthread_mutex_inc(apr_proc_mutex_t *mutex) +{ + if (mutex->pthread_refcounting) { + apr_atomic_inc32(&proc_pthread_mutex_refcount(mutex)); + return 1; + } + return 0; +} + +static APR_INLINE int proc_pthread_mutex_dec(apr_proc_mutex_t *mutex) +{ + if (mutex->pthread_refcounting) { + return apr_atomic_dec32(&proc_pthread_mutex_refcount(mutex)); + } + return 0; +} static apr_status_t proc_pthread_mutex_unref(void *mutex_) { @@ -441,15 +457,15 @@ static apr_status_t proc_pthread_mutex_unref(void *mutex_) apr_status_t rv; if (mutex->curr_locked == 1) { - if ((rv = pthread_mutex_unlock(mutex->pthread_interproc))) { + if ((rv = pthread_mutex_unlock(mutex->os.pthread_interproc))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif return rv; } } - if (!apr_atomic_dec32(&proc_pthread_mutex_refcount(mutex))) { - if ((rv = pthread_mutex_destroy(mutex->pthread_interproc))) { + if (!proc_pthread_mutex_dec(mutex)) { + if ((rv = pthread_mutex_destroy(mutex->os.pthread_interproc))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif @@ -470,7 +486,7 @@ static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_) return rv; } } - if (munmap((caddr_t)mutex->pthread_interproc, sizeof(pthread_mutex_t))) { + if (munmap(mutex->os.pthread_interproc, sizeof(proc_pthread_mutex_t))) { return errno; } return APR_SUCCESS; @@ -488,16 +504,16 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, return errno; } - new_mutex->pthread_interproc = (pthread_mutex_t *)mmap( - (caddr_t) 0, - sizeof(proc_pthread_mutex_t), - PROT_READ | PROT_WRITE, MAP_SHARED, - fd, 0); - if (new_mutex->pthread_interproc == (pthread_mutex_t *) (caddr_t) -1) { + new_mutex->os.pthread_interproc = mmap(NULL, sizeof(proc_pthread_mutex_t), + PROT_READ | PROT_WRITE, MAP_SHARED, + fd, 0); + if (new_mutex->os.pthread_interproc == MAP_FAILED) { + new_mutex->os.pthread_interproc = NULL; + rv = errno; close(fd); - return errno; + return rv; } - close(fd); + new_mutex->pthread_refcounting = 1; new_mutex->curr_locked = -1; /* until the mutex has been created */ @@ -537,7 +553,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, } #endif /* HAVE_PTHREAD_MUTEX_ROBUST */ - if ((rv = pthread_mutex_init(new_mutex->pthread_interproc, &mattr))) { + if ((rv = pthread_mutex_init(new_mutex->os.pthread_interproc, &mattr))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif @@ -569,9 +585,10 @@ static apr_status_t proc_mutex_proc_pthread_child_init(apr_proc_mutex_t **mutex, const char *fname) { (*mutex)->curr_locked = 0; - apr_atomic_inc32(&proc_pthread_mutex_refcount(*mutex)); - apr_pool_cleanup_register(pool, *mutex, proc_pthread_mutex_unref, - apr_pool_cleanup_null); + if (proc_pthread_mutex_inc(*mutex)) { + apr_pool_cleanup_register(pool, *mutex, proc_pthread_mutex_unref, + apr_pool_cleanup_null); + } return APR_SUCCESS; } @@ -579,15 +596,15 @@ static apr_status_t proc_mutex_proc_pthread_acquire(apr_proc_mutex_t *mutex) { apr_status_t rv; - if ((rv = pthread_mutex_lock(mutex->pthread_interproc))) { + if ((rv = pthread_mutex_lock(mutex->os.pthread_interproc))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif #ifdef HAVE_PTHREAD_MUTEX_ROBUST /* Okay, our owner died. Let's try to make it consistent again. */ if (rv == EOWNERDEAD) { - apr_atomic_dec32(&proc_pthread_mutex_refcount(mutex)); - pthread_mutex_consistent_np(mutex->pthread_interproc); + proc_pthread_mutex_dec(mutex); + pthread_mutex_consistent_np(mutex->os.pthread_interproc); } else #endif @@ -601,7 +618,7 @@ static apr_status_t proc_mutex_proc_pthread_tryacquire(apr_proc_mutex_t *mutex) { apr_status_t rv; - if ((rv = pthread_mutex_trylock(mutex->pthread_interproc))) { + if ((rv = pthread_mutex_trylock(mutex->os.pthread_interproc))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif @@ -611,8 +628,8 @@ static apr_status_t proc_mutex_proc_pthread_tryacquire(apr_proc_mutex_t *mutex) #ifdef HAVE_PTHREAD_MUTEX_ROBUST /* Okay, our owner died. Let's try to make it consistent again. */ if (rv == EOWNERDEAD) { - apr_atomic_dec32(&proc_pthread_mutex_refcount(mutex)); - pthread_mutex_consistent_np(mutex->pthread_interproc); + proc_pthread_mutex_dec(mutex); + pthread_mutex_consistent_np(mutex->os.pthread_interproc); } else #endif @@ -640,7 +657,7 @@ proc_mutex_proc_pthread_timedacquire(apr_proc_mutex_t *mutex, abstime.tv_sec = apr_time_sec(timeout); abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ - if ((rv = pthread_mutex_timedlock(mutex->pthread_interproc, + if ((rv = pthread_mutex_timedlock(mutex->os.pthread_interproc, &abstime))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; @@ -651,8 +668,8 @@ proc_mutex_proc_pthread_timedacquire(apr_proc_mutex_t *mutex, #ifdef HAVE_PTHREAD_MUTEX_ROBUST /* Okay, our owner died. Let's try to make it consistent again. */ if (rv == EOWNERDEAD) { - apr_atomic_dec32(&proc_pthread_mutex_refcount(mutex)); - pthread_mutex_consistent_np(mutex->pthread_interproc); + proc_pthread_mutex_dec(mutex); + pthread_mutex_consistent_np(mutex->os.pthread_interproc); } else #endif @@ -668,7 +685,7 @@ static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex) apr_status_t rv; mutex->curr_locked = 0; - if ((rv = pthread_mutex_unlock(mutex->pthread_interproc))) { + if ((rv = pthread_mutex_unlock(mutex->os.pthread_interproc))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif @@ -688,6 +705,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_methods = proc_mutex_proc_pthread_cleanup, proc_mutex_proc_pthread_child_init, proc_mutex_no_perms_set, + APR_LOCK_PROC_PTHREAD, "pthread" }; @@ -716,7 +734,7 @@ static void proc_mutex_fcntl_setup(void) static apr_status_t proc_mutex_fcntl_cleanup(void *mutex_) { - apr_status_t status; + apr_status_t status = APR_SUCCESS; apr_proc_mutex_t *mutex=mutex_; if (mutex->curr_locked == 1) { @@ -725,7 +743,16 @@ static apr_status_t proc_mutex_fcntl_cleanup(void *mutex_) return status; } - return apr_file_close(mutex->interproc); + if (mutex->interproc) { + status = apr_file_close(mutex->interproc); + } + if (!mutex->interproc_closing + && mutex->os.crossproc != -1 + && close(mutex->os.crossproc) == -1 + && status == APR_SUCCESS) { + status = errno; + } + return status; } static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, @@ -751,6 +778,8 @@ static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, return rv; } + new_mutex->os.crossproc = new_mutex->interproc->filedes; + new_mutex->interproc_closing = 1; new_mutex->curr_locked = 0; unlink(new_mutex->fname); apr_pool_cleanup_register(new_mutex->pool, @@ -765,7 +794,7 @@ static apr_status_t proc_mutex_fcntl_acquire(apr_proc_mutex_t *mutex) int rc; do { - rc = fcntl(mutex->interproc->filedes, F_SETLKW, &proc_mutex_lock_it); + rc = fcntl(mutex->os.crossproc, F_SETLKW, &proc_mutex_lock_it); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -779,7 +808,7 @@ static apr_status_t proc_mutex_fcntl_tryacquire(apr_proc_mutex_t *mutex) int rc; do { - rc = fcntl(mutex->interproc->filedes, F_SETLK, &proc_mutex_lock_it); + rc = fcntl(mutex->os.crossproc, F_SETLK, &proc_mutex_lock_it); } while (rc < 0 && errno == EINTR); if (rc < 0) { #if FCNTL_TRYACQUIRE_EACCES @@ -808,7 +837,7 @@ static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex) mutex->curr_locked=0; do { - rc = fcntl(mutex->interproc->filedes, F_SETLKW, &proc_mutex_unlock_it); + rc = fcntl(mutex->os.crossproc, F_SETLKW, &proc_mutex_unlock_it); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -825,7 +854,7 @@ static apr_status_t proc_mutex_fcntl_perms_set(apr_proc_mutex_t *mutex, if (mutex->fname) { if (!(perms & APR_FPROT_GSETID)) gid = -1; - if (fchown(mutex->interproc->filedes, uid, gid) < 0) { + if (fchown(mutex->os.crossproc, uid, gid) < 0) { return errno; } } @@ -847,6 +876,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_fcntl_methods = proc_mutex_fcntl_cleanup, proc_mutex_no_child_init, proc_mutex_fcntl_perms_set, + APR_LOCK_FCNTL, "fcntl" }; @@ -858,7 +888,7 @@ static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *); static apr_status_t proc_mutex_flock_cleanup(void *mutex_) { - apr_status_t status; + apr_status_t status = APR_SUCCESS; apr_proc_mutex_t *mutex=mutex_; if (mutex->curr_locked == 1) { @@ -867,10 +897,18 @@ static apr_status_t proc_mutex_flock_cleanup(void *mutex_) return status; } if (mutex->interproc) { /* if it was opened properly */ - apr_file_close(mutex->interproc); + status = apr_file_close(mutex->interproc); } - unlink(mutex->fname); - return APR_SUCCESS; + if (!mutex->interproc_closing + && mutex->os.crossproc != -1 + && close(mutex->os.crossproc) == -1 + && status == APR_SUCCESS) { + status = errno; + } + if (mutex->fname) { + unlink(mutex->fname); + } + return status; } static apr_status_t proc_mutex_flock_create(apr_proc_mutex_t *new_mutex, @@ -894,8 +932,11 @@ static apr_status_t proc_mutex_flock_create(apr_proc_mutex_t *new_mutex, if (rv != APR_SUCCESS) { proc_mutex_flock_cleanup(new_mutex); - return errno; + return rv; } + + new_mutex->os.crossproc = new_mutex->interproc->filedes; + new_mutex->interproc_closing = 1; new_mutex->curr_locked = 0; apr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, apr_proc_mutex_cleanup, @@ -908,7 +949,7 @@ static apr_status_t proc_mutex_flock_acquire(apr_proc_mutex_t *mutex) int rc; do { - rc = flock(mutex->interproc->filedes, LOCK_EX); + rc = flock(mutex->os.crossproc, LOCK_EX); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -922,7 +963,7 @@ static apr_status_t proc_mutex_flock_tryacquire(apr_proc_mutex_t *mutex) int rc; do { - rc = flock(mutex->interproc->filedes, LOCK_EX | LOCK_NB); + rc = flock(mutex->os.crossproc, LOCK_EX | LOCK_NB); } while (rc < 0 && errno == EINTR); if (rc < 0) { if (errno == EWOULDBLOCK || errno == EAGAIN) { @@ -947,7 +988,7 @@ static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *mutex) mutex->curr_locked = 0; do { - rc = flock(mutex->interproc->filedes, LOCK_UN); + rc = flock(mutex->os.crossproc, LOCK_UN); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; @@ -962,19 +1003,25 @@ static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, apr_proc_mutex_t *new_mutex; int rv; - new_mutex = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); - - memcpy(new_mutex, *mutex, sizeof *new_mutex); - new_mutex->pool = pool; if (!fname) { fname = (*mutex)->fname; + if (!fname) { + return APR_SUCCESS; + } } + + new_mutex = (apr_proc_mutex_t *)apr_pmemdup(pool, *mutex, + sizeof(apr_proc_mutex_t)); + new_mutex->pool = pool; new_mutex->fname = apr_pstrdup(pool, fname); rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, APR_FOPEN_WRITE, 0, new_mutex->pool); if (rv != APR_SUCCESS) { return rv; } + new_mutex->os.crossproc = new_mutex->interproc->filedes; + new_mutex->interproc_closing = 1; + *mutex = new_mutex; return APR_SUCCESS; } @@ -988,7 +1035,7 @@ static apr_status_t proc_mutex_flock_perms_set(apr_proc_mutex_t *mutex, if (mutex->fname) { if (!(perms & APR_FPROT_GSETID)) gid = -1; - if (fchown(mutex->interproc->filedes, uid, gid) < 0) { + if (fchown(mutex->os.crossproc, uid, gid) < 0) { return errno; } } @@ -1010,6 +1057,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_flock_methods = proc_mutex_flock_cleanup, proc_mutex_flock_child_init, proc_mutex_flock_perms_set, + APR_LOCK_FLOCK, "flock" }; @@ -1026,55 +1074,132 @@ void apr_proc_mutex_unix_setup_lock(void) #endif } -static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lockmech_e mech) +static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, + apr_lockmech_e mech, + apr_os_proc_mutex_t *ospmutex) { +#if APR_HAS_PROC_PTHREAD_SERIALIZE + new_mutex->os.pthread_interproc = NULL; +#endif +#if APR_HAS_POSIXSEM_SERIALIZE + new_mutex->os.psem_interproc = NULL; +#endif +#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE + new_mutex->os.crossproc = -1; + +#if APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE + new_mutex->interproc = NULL; + new_mutex->interproc_closing = 0; +#endif +#endif + switch (mech) { case APR_LOCK_FCNTL: #if APR_HAS_FCNTL_SERIALIZE - new_mutex->inter_meth = &mutex_fcntl_methods; + new_mutex->meth = &mutex_fcntl_methods; + if (ospmutex) { + if (ospmutex->crossproc == -1) { + return APR_EINVAL; + } + new_mutex->os.crossproc = ospmutex->crossproc; + } #else return APR_ENOTIMPL; #endif break; case APR_LOCK_FLOCK: #if APR_HAS_FLOCK_SERIALIZE - new_mutex->inter_meth = &mutex_flock_methods; + new_mutex->meth = &mutex_flock_methods; + if (ospmutex) { + if (ospmutex->crossproc == -1) { + return APR_EINVAL; + } + new_mutex->os.crossproc = ospmutex->crossproc; + } #else return APR_ENOTIMPL; #endif break; case APR_LOCK_SYSVSEM: #if APR_HAS_SYSVSEM_SERIALIZE - new_mutex->inter_meth = &mutex_sysv_methods; + new_mutex->meth = &mutex_sysv_methods; + if (ospmutex) { + if (ospmutex->crossproc == -1) { + return APR_EINVAL; + } + new_mutex->os.crossproc = ospmutex->crossproc; + } #else return APR_ENOTIMPL; #endif break; case APR_LOCK_POSIXSEM: #if APR_HAS_POSIXSEM_SERIALIZE - new_mutex->inter_meth = &mutex_posixsem_methods; + new_mutex->meth = &mutex_posixsem_methods; + if (ospmutex) { + if (ospmutex->psem_interproc == NULL) { + return APR_EINVAL; + } + new_mutex->os.psem_interproc = ospmutex->psem_interproc; + } #else return APR_ENOTIMPL; #endif break; case APR_LOCK_PROC_PTHREAD: #if APR_HAS_PROC_PTHREAD_SERIALIZE - new_mutex->inter_meth = &mutex_proc_pthread_methods; + new_mutex->meth = &mutex_proc_pthread_methods; + if (ospmutex) { + if (ospmutex->pthread_interproc == NULL) { + return APR_EINVAL; + } + new_mutex->os.pthread_interproc = ospmutex->pthread_interproc; + } #else return APR_ENOTIMPL; #endif break; case APR_LOCK_DEFAULT: #if APR_USE_FLOCK_SERIALIZE - new_mutex->inter_meth = &mutex_flock_methods; + new_mutex->meth = &mutex_flock_methods; + if (ospmutex) { + if (ospmutex->crossproc == -1) { + return APR_EINVAL; + } + new_mutex->os.crossproc = ospmutex->crossproc; + } #elif APR_USE_SYSVSEM_SERIALIZE - new_mutex->inter_meth = &mutex_sysv_methods; + new_mutex->meth = &mutex_sysv_methods; + if (ospmutex) { + if (ospmutex->crossproc == -1) { + return APR_EINVAL; + } + new_mutex->os.crossproc = ospmutex->crossproc; + } #elif APR_USE_FCNTL_SERIALIZE - new_mutex->inter_meth = &mutex_fcntl_methods; + new_mutex->meth = &mutex_fcntl_methods; + if (ospmutex) { + if (ospmutex->crossproc == -1) { + return APR_EINVAL; + } + new_mutex->os.crossproc = ospmutex->crossproc; + } #elif APR_USE_PROC_PTHREAD_SERIALIZE - new_mutex->inter_meth = &mutex_proc_pthread_methods; + new_mutex->meth = &mutex_proc_pthread_methods; + if (ospmutex) { + if (ospmutex->pthread_interproc == NULL) { + return APR_EINVAL; + } + new_mutex->os.pthread_interproc = ospmutex->pthread_interproc; + } #elif APR_USE_POSIXSEM_SERIALIZE - new_mutex->inter_meth = &mutex_posixsem_methods; + new_mutex->meth = &mutex_posixsem_methods; + if (ospmutex) { + if (ospmutex->psem_interproc == NULL) { + return APR_EINVAL; + } + new_mutex->os.psem_interproc = ospmutex->psem_interproc; + } #else return APR_ENOTIMPL; #endif @@ -1083,13 +1208,13 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lo #if APR_HAS_PROC_PTHREAD_SERIALIZE \ && defined(HAVE_PTHREAD_MUTEX_ROBUST) \ && defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) - new_mutex->inter_meth = &mutex_proc_pthread_methods; + new_mutex->meth = &mutex_proc_pthread_methods; #elif APR_HAS_SYSVSEM_SERIALIZE \ && defined(HAVE_SEMTIMEDOP) - new_mutex->inter_meth = &mutex_sysv_methods; + new_mutex->meth = &mutex_sysv_methods; #elif APR_HAS_POSIXSEM_SERIALIZE \ && defined(HAVE_SEM_TIMEDWAIT) - new_mutex->inter_meth = &mutex_posixsem_methods; + new_mutex->meth = &mutex_posixsem_methods; #else return APR_ENOTIMPL; #endif @@ -1105,10 +1230,10 @@ APR_DECLARE(const char *) apr_proc_mutex_defname(void) apr_status_t rv; apr_proc_mutex_t mutex; - if ((rv = proc_mutex_choose_method(&mutex, APR_LOCK_DEFAULT)) != APR_SUCCESS) { + if ((rv = proc_mutex_choose_method(&mutex, APR_LOCK_DEFAULT, + NULL)) != APR_SUCCESS) { return "unknown"; } - mutex.meth = mutex.inter_meth; return apr_proc_mutex_name(&mutex); } @@ -1117,12 +1242,11 @@ static apr_status_t proc_mutex_create(apr_proc_mutex_t *new_mutex, apr_lockmech_ { apr_status_t rv; - if ((rv = proc_mutex_choose_method(new_mutex, mech)) != APR_SUCCESS) { + if ((rv = proc_mutex_choose_method(new_mutex, mech, + NULL)) != APR_SUCCESS) { return rv; } - new_mutex->meth = new_mutex->inter_meth; - if ((rv = new_mutex->meth->create(new_mutex, fname)) != APR_SUCCESS) { return rv; } @@ -1182,6 +1306,11 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex) return ((apr_proc_mutex_t *)mutex)->meth->cleanup(mutex); } +APR_DECLARE(apr_lockmech_e) apr_proc_mutex_mech(apr_proc_mutex_t *mutex) +{ + return mutex->meth->mech; +} + APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) { return mutex->meth->name; @@ -1214,27 +1343,29 @@ APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ -APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, - apr_proc_mutex_t *pmutex) +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get_ex(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex, + apr_lockmech_e *mech) { -#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE - if (pmutex->interproc) { - ospmutex->crossproc = pmutex->interproc->filedes; - } - else { - ospmutex->crossproc = -1; + *ospmutex = pmutex->os; + if (mech) { + *mech = pmutex->meth->mech; } -#endif -#if APR_HAS_PROC_PTHREAD_SERIALIZE - ospmutex->pthread_interproc = pmutex->pthread_interproc; -#endif return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex) +{ + return apr_os_proc_mutex_get_ex(ospmutex, pmutex, NULL); +} + +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, + apr_lockmech_e mech, apr_pool_t *pool) { + apr_status_t rv; if (pool == NULL) { return APR_ENOPOOL; } @@ -1243,12 +1374,20 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, sizeof(apr_proc_mutex_t)); (*pmutex)->pool = pool; } -#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE - apr_os_file_put(&(*pmutex)->interproc, &ospmutex->crossproc, 0, pool); -#endif -#if APR_HAS_PROC_PTHREAD_SERIALIZE - (*pmutex)->pthread_interproc = ospmutex->pthread_interproc; + rv = proc_mutex_choose_method(*pmutex, mech, ospmutex); +#if APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE + if (rv == APR_SUCCESS) { + rv = apr_os_file_put(&(*pmutex)->interproc, &(*pmutex)->os.crossproc, + 0, pool); + } #endif - return APR_SUCCESS; + return rv; +} + +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, + apr_os_proc_mutex_t *ospmutex, + apr_pool_t *pool) +{ + return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT, pool); } diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 5ec9b2648a8..83042ce3506 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -43,6 +43,10 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, HANDLE hMutex; void *mutexkey; + if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) { + return APR_ENOTIMPL; + } + /* res_name_from_filename turns fname into a pseduo-name * without slashes or backslashes, and prepends the \global * prefix on Win2K and later @@ -220,6 +224,11 @@ APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) return mutex->fname; } +APR_DECLARE(apr_lockmech_e) apr_proc_mutex_mech(apr_proc_mutex_t *mutex) +{ + return APR_LOCK_DEFAULT_TIMED; +} + APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) { return apr_proc_mutex_defname(); @@ -236,20 +245,34 @@ APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ -APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, - apr_proc_mutex_t *mutex) +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get_ex(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex, + apr_lockmech_e *mech) { *ospmutex = mutex->handle; + if (mech) { + *mech = APR_LOCK_DEFAULT_TIMED; + } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, +APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, + apr_proc_mutex_t *pmutex) +{ + return apr_os_proc_mutex_get_ex(ospmutex, pmutex, NULL); +} + +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, + apr_lockmech_e mech, apr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } + if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) { + return APR_ENOTIMPL; + } if ((*pmutex) == NULL) { (*pmutex) = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); @@ -259,3 +282,10 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, + apr_os_proc_mutex_t *ospmutex, + apr_pool_t *pool) +{ + return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT_TIMED, pool); +} + From 8fa7d195dfa122aeafaf64c6feb14662cd36531d Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sun, 6 Mar 2016 00:26:20 +0000 Subject: [PATCH 7580/7878] proc_mutex-netware: follow up to r1733775. Make apr_os_proc_mutex_{get,set}[_ex]() available by changing the native apr_os_proc_mutex_t accessor type to a pointer. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1733776 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 2 +- locks/netware/proc_mutex.c | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 7ba8215ad79..7b90a220f95 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -112,7 +112,7 @@ typedef void* apr_os_shm_t; typedef int apr_os_file_t; typedef DIR apr_os_dir_t; typedef int apr_os_sock_t; -typedef NXMutex_t apr_os_proc_mutex_t; +typedef NXMutex_t * apr_os_proc_mutex_t; typedef NXThreadId_t apr_os_thread_t; typedef long apr_os_proc_t; typedef NXKey_t apr_os_threadkey_t; diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 04b7672f926..95dc8f8f4e2 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -130,21 +130,15 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get_ex(apr_os_proc_mutex_t *ospmutex apr_proc_mutex_t *pmutex, apr_lockmech_e *mech) { -#if 1 - /* We need to change apr_os_proc_mutex_t to a pointer type - * to be able to implement this function. - */ - return APR_ENOTIMPL; -#else if (!pmutex->mutex) { return APR_ENOLOCK; } + *ospmutex = pmutex->mutex->mutex; if (mech) { *mech = APR_LOCK_DEFAULT; } return APR_SUCCESS; -#endif } APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, @@ -164,12 +158,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, if (mech != APR_LOCK_DEFAULT) { return APR_ENOTIMPL; } -#if 1 - /* We need to change apr_os_proc_mutex_t to a pointer type - * to be able to implement this function. - */ - return APR_ENOTIMPL; -#else + if ((*pmutex) == NULL) { (*pmutex) = apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); (*pmutex)->pool = pool; @@ -178,7 +167,6 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, (*pmutex)->mutex->mutex = *ospmutex; (*pmutex)->mutex->pool = pool; return APR_SUCCESS; -#endif } APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, From f7ac9c1b9cabb76d7c501704c6513d92273bac0f Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sun, 6 Mar 2016 00:30:18 +0000 Subject: [PATCH 7581/7878] proc_mutex-unixes: the apr_os_proc_mutex_t member intraproc is not used internally and can then be axed for 2.0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1733777 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 7b90a220f95..7b4c5be924d 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -136,13 +136,6 @@ struct apr_os_proc_mutex_t { /** Value used for PTHREAD serialization */ pthread_mutex_t *pthread_interproc; #endif -#if APR_HAS_THREADS - /* If no threads, no need for thread locks */ -#if APR_USE_PTHREAD_SERIALIZE - /** This value is currently unused within APR and Apache */ - pthread_mutex_t *intraproc; -#endif -#endif #if APR_HAS_POSIXSEM_SERIALIZE /** Value used for POSIX semaphores serialization */ sem_t *psem_interproc; From 294e69d7ddbd79ab3712c1f5fd4181a14455b66d Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sun, 6 Mar 2016 00:32:49 +0000 Subject: [PATCH 7582/7878] Axe addressed showstopper (r1733775 and follow ups). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1733778 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 3 --- 1 file changed, 3 deletions(-) diff --git a/STATUS b/STATUS index da2cb980f5c..e2bfe7670f7 100644 --- a/STATUS +++ b/STATUS @@ -109,9 +109,6 @@ Contributors looking for a mission: RELEASE SHOWSTOPPERS: * apr_file_rotating_* on most platforms - * Fix apr_os_proc_mutex_get() API. The apr_os_proc_mutex_t structure - used on Unix must tell you what kind of mutex it is, and it may as - well be used on all platforms. CURRENT VOTES: From 9c5684cf70c7b600102c03054ad2da5399ae0bb3 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 7 Mar 2016 23:36:23 +0000 Subject: [PATCH 7583/7878] apr_table_overlap: Add APR_OVERLAP_TABLES_ADD to merge and set when overlapping tables. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1734004 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_tables.h | 9 ++++++++- tables/apr_tables.c | 4 ++++ test/testtable.c | 24 ++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 26cd4003151..91a20505594 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_table_overlap: Add APR_OVERLAP_TABLES_ADD to merge and set when + overlapping tables. [Graham Leggett] + *) apr_proc/global_mutex: Fix API regarding the native OS mutexes accessors from/to available APR mechanisms, adding the new functions apr_os_proc_mutex_get_ex() and apr_os_proc_mutex_set_ex() which give diff --git a/include/apr_tables.h b/include/apr_tables.h index 194af02f2f0..c100f42d2ee 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -436,6 +436,8 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, #define APR_OVERLAP_TABLES_SET (0) /** flag for overlap to use apr_table_mergen */ #define APR_OVERLAP_TABLES_MERGE (1) +/** flag for overlap to use apr_table_addn */ +#define APR_OVERLAP_TABLES_ADD (2) /** * For each element in table b, either use setn or mergen to add the data * to table a. Which method is used is determined by the flags passed in. @@ -444,6 +446,7 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, * @param flags How to add the table to table a. One of: * APR_OVERLAP_TABLES_SET Use apr_table_setn * APR_OVERLAP_TABLES_MERGE Use apr_table_mergen + * APR_OVERLAP_TABLES_ADD Use apr_table_addn * @remark When merging duplicates, the two values are concatenated, * separated by the string ", ". * @remark This function is highly optimized, and uses less memory and CPU cycles @@ -461,6 +464,9 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, * if (flags & APR_OVERLAP_TABLES_MERGE) { * apr_table_mergen(a, belt[i].key, belt[i].val); * } + * else if (flags & APR_OVERLAP_TABLES_ADD) { + * apr_table_addn(a, belt[i].key, belt[i].val); + * } * else { * apr_table_setn(a, belt[i].key, belt[i].val); * } @@ -484,7 +490,8 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, * * @param t Table. * @param flags APR_OVERLAP_TABLES_MERGE to merge, or - * APR_OVERLAP_TABLES_SET to overwrite + * APR_OVERLAP_TABLES_SET to overwrite, or + * APR_OVERLAP_TABLES_ADD to add * @remark When merging duplicates, the two values are concatenated, * separated by the string ", ". */ diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 2f5b4e53745..6d9aff88168 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -1103,6 +1103,10 @@ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags) int i; int dups_found; + if (flags == APR_OVERLAP_TABLES_ADD) { + return; + } + if (t->a.nelts <= 1) { return; } diff --git a/test/testtable.c b/test/testtable.c index d24053edb55..0a9960f12c8 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -199,6 +199,29 @@ static void table_overlap2(abts_case *tc, void *data) } +static void table_overlap3(abts_case *tc, void *data) +{ + apr_pool_t *subp; + apr_table_t *t1, *t2; + + apr_pool_create(&subp, p); + + t1 = apr_table_make(subp, 1); + t2 = apr_table_make(p, 1); + apr_table_addn(t1, "t1", "one"); + apr_table_addn(t1, "t1", "overlay"); + apr_table_addn(t2, "t2", "two"); + apr_table_addn(t2, "t2", "overlay"); + + apr_table_overlap(t1, t2, APR_OVERLAP_TABLES_ADD); + + ABTS_INT_EQUAL(tc, 4, apr_table_elts(t1)->nelts); + + ABTS_STR_EQUAL(tc, "one", apr_table_get(t1, "t1")); + ABTS_STR_EQUAL(tc, "two", apr_table_get(t1, "t2")); + +} + abts_suite *testtable(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -215,6 +238,7 @@ abts_suite *testtable(abts_suite *suite) abts_run_test(suite, table_unset, NULL); abts_run_test(suite, table_overlap, NULL); abts_run_test(suite, table_overlap2, NULL); + abts_run_test(suite, table_overlap3, NULL); return suite; } From 72d7d0922949f47d58574c3d638d9d8c30a08e3f Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 13 Mar 2016 15:09:03 +0000 Subject: [PATCH 7584/7878] apr_file_io: Add apr_file_pipe_create_pools() allowing a pair of pipes to be created, each in a different pool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1734816 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++ file_io/netware/pipe.c | 68 ++++++++++++++++++++++++++----------- file_io/os2/pipe.c | 76 +++++++++++++++++++++++++++++------------- file_io/unix/pipe.c | 64 +++++++++++++++++++++++++---------- file_io/win32/pipe.c | 25 ++++++++++---- include/apr_file_io.h | 30 ++++++++++++++++- test/testpipe.c | 4 +-- 7 files changed, 199 insertions(+), 71 deletions(-) diff --git a/CHANGES b/CHANGES index 91a20505594..605e3c03e13 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_file_io: Add apr_file_pipe_create_pools() allowing a pair of + pipes to be created, each in a different pool. [Graham Leggett] + *) apr_table_overlap: Add APR_OVERLAP_TABLES_ADD to merge and set when overlapping tables. [Graham Leggett] diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index adc53ee96e1..b918a290d51 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -133,7 +133,8 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, return apr_os_pipe_put_ex(file, thefile, 0, pool); } -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) +static apr_status_t file_pipe_create(apr_file_t **in, apr_file_t **out, + apr_pool_t *pool_in, apr_pool_t *pool_out) { int filedes[2]; @@ -141,11 +142,11 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return errno; } - (*in) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); - (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*in) = (apr_file_t *)apr_pcalloc(pool_in, sizeof(apr_file_t)); + (*out) = (apr_file_t *)apr_pcalloc(pool_out, sizeof(apr_file_t)); - (*in)->pool = - (*out)->pool = pool; + (*in)->pool = pool_in; + (*out)->pool = pool_out; (*in)->filedes = filedes[0]; (*out)->filedes = filedes[1]; (*in)->flags = APR_INHERIT; @@ -163,8 +164,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->ungetchar = -1; (*in)->thlock = (*out)->thlock = NULL; - (void) apr_pollset_create(&(*in)->pollset, 1, pool, 0); - (void) apr_pollset_create(&(*out)->pollset, 1, pool, 0); + (void) apr_pollset_create(&(*in)->pollset, 1, pool_in, 0); + (void) apr_pollset_create(&(*out)->pollset, 1, pool_out, 0); apr_pool_cleanup_register((*in)->pool, (void *)(*in), apr_unix_file_cleanup, apr_pool_cleanup_null); @@ -174,6 +175,30 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return APR_SUCCESS; } +static void file_pipe_block(apr_file_t **in, apr_file_t **out, + apr_int32_t blocking) +{ + switch (blocking) { + case APR_FULL_BLOCK: + break; + case APR_READ_BLOCK: + apr_file_pipe_timeout_set(*out, 0); + break; + case APR_WRITE_BLOCK: + apr_file_pipe_timeout_set(*in, 0); + break; + default: + apr_file_pipe_timeout_set(*out, 0); + apr_file_pipe_timeout_set(*in, 0); + break; + } +} + +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) +{ + return file_pipe_create(in, out, pool, pool); +} + APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, apr_file_t **out, apr_int32_t blocking, @@ -181,23 +206,26 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, { apr_status_t status; - if ((status = apr_file_pipe_create(in, out, pool)) != APR_SUCCESS) + if ((status = file_pipe_create(in, out, pool, pool)) != APR_SUCCESS) { return status; + } - switch (blocking) { - case APR_FULL_BLOCK: - break; - case APR_READ_BLOCK: - apr_file_pipe_timeout_set(*out, 0); - break; - case APR_WRITE_BLOCK: - apr_file_pipe_timeout_set(*in, 0); - break; - default: - apr_file_pipe_timeout_set(*out, 0); - apr_file_pipe_timeout_set(*in, 0); + file_pipe_block(in, out, blocking); + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in, + apr_file_t **out, apr_int32_t blocking, apr_pool_t *pool_in, apr_pool_t *pool_out) +{ + apr_status_t status; + + if ((status = file_pipe_create(in, out, pool_in, pool_out)) != APR_SUCCESS) { + return status; } + file_pipe_block(in, out, blocking); + return APR_SUCCESS; } diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index bf0aaae05f5..914b77782a8 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -24,7 +24,8 @@ #include #include -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) +static apr_status_t file_pipe_create(apr_file_t **in, apr_file_t **out, + apr_pool_t *pool_in, apr_pool_t *pool_out) { ULONG filedes[2]; ULONG rc, action; @@ -54,7 +55,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return APR_FROM_OS_ERROR(rc); } - (*in) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); + (*in) = (apr_file_t *)apr_palloc(pool_in, sizeof(apr_file_t)); rc = DosCreateEventSem(NULL, &(*in)->pipeSem, DC_SEM_SHARED, FALSE); if (rc) { @@ -76,9 +77,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return APR_FROM_OS_ERROR(rc); } - (*in)->pool = pool; + (*in)->pool = pool_in; (*in)->filedes = filedes[0]; - (*in)->fname = apr_pstrdup(pool, pipename); + (*in)->fname = apr_pstrdup(pool_in, pipename); (*in)->isopen = TRUE; (*in)->buffered = FALSE; (*in)->flags = APR_FOPEN_READ; @@ -86,9 +87,10 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->timeout = -1; (*in)->blocking = BLK_ON; (*in)->ungetchar = -1; - apr_pool_cleanup_register(pool, *in, apr_file_cleanup, apr_pool_cleanup_null); + apr_pool_cleanup_register(pool_in, *in, apr_file_cleanup, + apr_pool_cleanup_null); - (*out) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); + (*out) = (apr_file_t *)apr_palloc(pool_out, sizeof(apr_file_t)); rc = DosCreateEventSem(NULL, &(*out)->pipeSem, DC_SEM_SHARED, FALSE); if (rc) { @@ -108,9 +110,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return APR_FROM_OS_ERROR(rc); } - (*out)->pool = pool; + (*out)->pool = pool_out; (*out)->filedes = filedes[1]; - (*out)->fname = apr_pstrdup(pool, pipename); + (*out)->fname = apr_pstrdup(pool_out, pipename); (*out)->isopen = TRUE; (*out)->buffered = FALSE; (*out)->flags = APR_FOPEN_WRITE; @@ -118,12 +120,37 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*out)->timeout = -1; (*out)->blocking = BLK_ON; (*out)->ungetchar = -1; - apr_pool_cleanup_register(pool, *out, apr_file_cleanup, apr_pool_cleanup_null); + apr_pool_cleanup_register(pool_out, *out, apr_file_cleanup, + apr_pool_cleanup_null); return APR_SUCCESS; } +static void file_pipe_block(apr_file_t **in, apr_file_t **out, + apr_int32_t blocking) +{ + switch (blocking) { + case APR_FULL_BLOCK: + break; + case APR_READ_BLOCK: + apr_file_pipe_timeout_set(*out, 0); + break; + case APR_WRITE_BLOCK: + apr_file_pipe_timeout_set(*in, 0); + break; + default: + apr_file_pipe_timeout_set(*out, 0); + apr_file_pipe_timeout_set(*in, 0); + break; + } +} +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, + apr_file_t **out, + apr_pool_t *pool) +{ + return file_pipe_create(in, out, pool, pool); +} APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, apr_file_t **out, @@ -132,26 +159,29 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, { apr_status_t status; - if ((status = apr_file_pipe_create(in, out, pool)) != APR_SUCCESS) + if ((status = file_pipe_create(in, out, pool, pool)) != APR_SUCCESS) return status; - switch (blocking) { - case APR_FULL_BLOCK: - break; - case APR_READ_BLOCK: - apr_file_pipe_timeout_set(*out, 0); - break; - case APR_WRITE_BLOCK: - apr_file_pipe_timeout_set(*in, 0); - break; - default: - apr_file_pipe_timeout_set(*out, 0); - apr_file_pipe_timeout_set(*in, 0); - } + file_pipe_block(in, out, blocking); return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in, + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *pool_in, + apr_pool_t *pool_out) +{ + apr_status_t status; + + if ((status = file_pipe_create(in, out, pool_in, pool_out)) != APR_SUCCESS) + return status; + + file_pipe_block(in, out, blocking); + + return APR_SUCCESS; +} APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *pool) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 571d9bcb8e9..7be16e5d0a1 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -176,7 +176,8 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, return apr_os_pipe_put_ex(file, thefile, 0, pool); } -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) +static apr_status_t file_pipe_create(apr_file_t **in, apr_file_t **out, + apr_pool_t *pool_in, apr_pool_t *pool_out) { int filedes[2]; @@ -184,8 +185,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return errno; } - (*in) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); - (*in)->pool = pool; + (*in) = (apr_file_t *)apr_pcalloc(pool_in, sizeof(apr_file_t)); + (*in)->pool = pool_in; (*in)->filedes = filedes[0]; (*in)->is_pipe = 1; (*in)->fname = NULL; @@ -200,8 +201,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out #ifndef WAITIO_USES_POLL (*in)->pollset = NULL; #endif - (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); - (*out)->pool = pool; + (*out) = (apr_file_t *)apr_pcalloc(pool_out, sizeof(apr_file_t)); + (*out)->pool = pool_out; (*out)->filedes = filedes[1]; (*out)->is_pipe = 1; (*out)->fname = NULL; @@ -222,6 +223,30 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return APR_SUCCESS; } +static void file_pipe_block(apr_file_t **in, apr_file_t **out, apr_int32_t blocking) +{ + switch (blocking) { + case APR_FULL_BLOCK: + break; + case APR_READ_BLOCK: + apr_file_pipe_timeout_set(*out, 0); + break; + case APR_WRITE_BLOCK: + apr_file_pipe_timeout_set(*in, 0); + break; + default: + apr_file_pipe_timeout_set(*out, 0); + apr_file_pipe_timeout_set(*in, 0); + break; + } +} + +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, + apr_file_t **out, apr_pool_t *pool) +{ + return file_pipe_create(in, out, pool, pool); +} + APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, apr_file_t **out, apr_int32_t blocking, @@ -229,23 +254,26 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, { apr_status_t status; - if ((status = apr_file_pipe_create(in, out, pool)) != APR_SUCCESS) + if ((status = file_pipe_create(in, out, pool, pool)) != APR_SUCCESS) { return status; + } - switch (blocking) { - case APR_FULL_BLOCK: - break; - case APR_READ_BLOCK: - apr_file_pipe_timeout_set(*out, 0); - break; - case APR_WRITE_BLOCK: - apr_file_pipe_timeout_set(*in, 0); - break; - default: - apr_file_pipe_timeout_set(*out, 0); - apr_file_pipe_timeout_set(*in, 0); + file_pipe_block(in, out, blocking); + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in, + apr_file_t **out, apr_int32_t blocking, apr_pool_t *pool_in, apr_pool_t *pool_out) +{ + apr_status_t status; + + if ((status = file_pipe_create(in, out, pool_in, pool_out)) != APR_SUCCESS) { + return status; } + file_pipe_block(in, out, blocking); + return APR_SUCCESS; } diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index bb6e0c15dbb..491a1a5f510 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -68,13 +68,22 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_pool_t *p) { /* Unix creates full blocking pipes. */ - return apr_file_pipe_create_ex(in, out, APR_FULL_BLOCK, p); + return apr_file_pipe_create_pools(in, out, APR_FULL_BLOCK, p, p); } APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, apr_file_t **out, apr_int32_t blocking, apr_pool_t *p) +{ + return apr_file_pipe_create_pools(in, out, APR_FULL_BLOCK, p, p); +} + +APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in, + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *pool_in, + apr_pool_t *pool_out) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -96,8 +105,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, #endif sa.lpSecurityDescriptor = NULL; - (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); - (*in)->pool = p; + (*in) = (apr_file_t *)apr_pcalloc(pool_in, sizeof(apr_file_t)); + (*in)->pool = pool_in; (*in)->fname = NULL; (*in)->pipe = 1; (*in)->timeout = -1; @@ -111,8 +120,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, #if APR_FILES_AS_SOCKETS (void) apr_pollset_create(&(*in)->pollset, 1, p, 0); #endif - (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); - (*out)->pool = p; + (*out) = (apr_file_t *)apr_pcalloc(pool_out, sizeof(apr_file_t)); + (*out)->pool = pool_out; (*out)->fname = NULL; (*out)->pipe = 1; (*out)->timeout = -1; @@ -150,7 +159,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, if (blocking == APR_WRITE_BLOCK /* READ_NONBLOCK */ || blocking == APR_FULL_NONBLOCK) { dwOpenMode |= FILE_FLAG_OVERLAPPED; - (*in)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED)); + (*in)->pOverlapped = + (OVERLAPPED*) apr_pcalloc((*in)->pool, sizeof(OVERLAPPED)); (*in)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); (*in)->timeout = 0; } @@ -179,7 +189,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, if (blocking == APR_READ_BLOCK /* WRITE_NONBLOCK */ || blocking == APR_FULL_NONBLOCK) { dwOpenMode |= FILE_FLAG_OVERLAPPED; - (*out)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED)); + (*out)->pOverlapped = + (OVERLAPPED*) apr_pcalloc((*out)->pool, sizeof(OVERLAPPED)); (*out)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); (*out)->timeout = 0; } diff --git a/include/apr_file_io.h b/include/apr_file_io.h index ea5c66f472e..59a502d7649 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -714,7 +714,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, * @bug Some platforms cannot toggle between blocking and nonblocking, * and when passing a pipe as a standard handle to an application which * does not expect it, a non-blocking stream will fluxor the client app. - * @deprecated @see apr_file_pipe_create_ex() + * @deprecated @see apr_file_pipe_create_pools() */ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, @@ -738,12 +738,40 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, * does not expect it, a non-blocking stream will fluxor the client app. * Use this function rather than apr_file_pipe_create() to create pipes * where one or both ends require non-blocking semantics. + * @deprecated @see apr_file_pipe_create_pools() */ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, apr_file_t **out, apr_int32_t blocking, apr_pool_t *pool); +/** + * Create an anonymous pipe which portably supports async timeout options, + * placing each side of the pipe in a different pool. + * @param in The newly created pipe's file for reading. + * @param out The newly created pipe's file for writing. + * @param blocking one of these values defined in apr_thread_proc.h; + * @li #APR_FULL_BLOCK + * @li #APR_READ_BLOCK + * @li #APR_WRITE_BLOCK + * @li #APR_FULL_NONBLOCK + * @param pool_in The pool for the reading pipe. + * @param pool_out The pool for the writing pipe. + * @remark By default, the returned file descriptors will be inherited + * by child processes created using apr_proc_create(). This can be + * changed using apr_file_inherit_unset(). + * @remark Some platforms cannot toggle between blocking and nonblocking, + * and when passing a pipe as a standard handle to an application which + * does not expect it, a non-blocking stream will fluxor the client app. + * Use this function rather than apr_file_pipe_create() to create pipes + * where one or both ends require non-blocking semantics. + */ +APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in, + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *pool_in, + apr_pool_t *pool_out); + /** * Create a named pipe. * @param filename The filename of the named pipe diff --git a/test/testpipe.c b/test/testpipe.c index d15eacf0a18..810ffe7b505 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -56,7 +56,7 @@ static void set_timeout(abts_case *tc, void *data) apr_status_t rv; apr_interval_time_t timeout; - rv = apr_file_pipe_create_ex(&readp, &writep, APR_WRITE_BLOCK, p); + rv = apr_file_pipe_create_pools(&readp, &writep, APR_WRITE_BLOCK, p, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, readp); ABTS_PTR_NOTNULL(tc, writep); @@ -83,7 +83,7 @@ static void read_write(abts_case *tc, void *data) nbytes = strlen("this is a test"); buf = (char *)apr_palloc(p, nbytes + 1); - rv = apr_file_pipe_create_ex(&readp, &writep, APR_WRITE_BLOCK, p); + rv = apr_file_pipe_create_pools(&readp, &writep, APR_WRITE_BLOCK, p, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, readp); ABTS_PTR_NOTNULL(tc, writep); From 5de426d4733fec7eea13974af1c6b0c1cf8ed924 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Fri, 25 Mar 2016 10:27:07 +0000 Subject: [PATCH 7585/7878] Clarify the behaviour of apr_hash_set(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1736552 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index 7ad9380eb17..10922de8f14 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -102,7 +102,8 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, * @param key Pointer to the key * @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string length. * @param val Value to associate with the key - * @remark If the value is NULL the hash entry is deleted. + * @remark If the value is NULL the hash entry is deleted. The key is stored as is, + * and so must have a lifetime at least as long as the hash table's pool. */ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key, apr_ssize_t klen, const void *val); From 82e2cc3a22e6ce32ad9785f994787ce124aaca26 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 12 Apr 2016 12:29:21 +0000 Subject: [PATCH 7586/7878] proc_mutex-unix: follow up to r1733775. Restore mmap-ed fd close stripped by above commit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1738791 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 9b623c6bc00..2edeed34bc1 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -513,8 +513,9 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, close(fd); return rv; } - new_mutex->pthread_refcounting = 1; + close(fd); + new_mutex->pthread_refcounting = 1; new_mutex->curr_locked = -1; /* until the mutex has been created */ if ((rv = pthread_mutexattr_init(&mattr))) { From 9af8fde24e7755d7a3f3f603b67613d7ca0777e1 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 12 Apr 2016 16:00:05 +0000 Subject: [PATCH 7587/7878] Axe some backported entries. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1738822 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/CHANGES b/CHANGES index 605e3c03e13..7ab9a5ad12c 100644 --- a/CHANGES +++ b/CHANGES @@ -7,17 +7,6 @@ Changes for APR 2.0.0 *) apr_table_overlap: Add APR_OVERLAP_TABLES_ADD to merge and set when overlapping tables. [Graham Leggett] - *) apr_proc/global_mutex: Fix API regarding the native OS mutexes - accessors from/to available APR mechanisms, adding the new functions - apr_os_proc_mutex_get_ex() and apr_os_proc_mutex_set_ex() which give - control to the user over the selected mechanisms, including the missing - POSIX semaphores (sem_t) on platforms supporting them. - [Yann Ylavic] - - *) apr_proc_mutex-pthread: Refcount shared mutexes usage to avoid - destruction while still is use by some process(es). PR 49504. - [Yann Ylavic] - *) apr_filepath_merge: Fix truename length calculation on Windows in cases where the "short" name variant is actually longer than the "long" or "true" name. See: testnames.c:merge_shortname(). From ab94915fe5d7d41ed8a12c114c7ce644c1d5b6a2 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 13 Apr 2016 11:47:40 +0000 Subject: [PATCH 7588/7878] apr_os_proc_mutex_put_ex: Allow to specify whether the OS native mutex should or not be cleaned up (destroyed) with the constructed APR mutex (given pool), and default to not for the simple _put() function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1738925 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ include/apr_portable.h | 3 +++ locks/beos/proc_mutex.c | 10 +++++++++- locks/netware/proc_mutex.c | 9 ++++++++- locks/os2/proc_mutex.c | 8 +++++++- locks/unix/proc_mutex.c | 10 +++++++++- locks/win32/proc_mutex.c | 10 +++++++++- 7 files changed, 50 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 7ab9a5ad12c..46e1cdf2a6a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_os_proc_mutex_put_ex: Allow to specify whether the OS native + mutex should or not be cleaned up (destroyed) with the constructed + APR mutex (given pool), and default to not for the simple _put() + function. [Yann Ylavic] + *) apr_file_io: Add apr_file_pipe_create_pools() allowing a pair of pipes to be created, each in a different pool. [Graham Leggett] diff --git a/include/apr_portable.h b/include/apr_portable.h index 7b4c5be924d..7bb7a3568e2 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -437,6 +437,8 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, * @param pmutex The apr proc mutex we are converting to. * @param ospmutex The os specific proc mutex to convert. * @param mech The apr mutex locking mechanism + * @param register_cleanup Whether to destroy the os mutex with the apr + * one (either on explicit destroy or pool cleanup). * @param cont The pool to use if it is needed. * @remark Allows for disambiguation for platforms with multiple mechanisms * available. @@ -444,6 +446,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_lockmech_e mech, + int register_cleanup, apr_pool_t *cont); /** diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index d5c681741f6..1b468714cff 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -224,6 +224,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_lockmech_e mech, + int register_cleanup, apr_pool_t *pool) { if (pool == NULL) { @@ -232,12 +233,18 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) { return APR_ENOTIMPL; } + if ((*pmutex) == NULL) { (*pmutex) = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); (*pmutex)->pool = pool; } (*pmutex)->Lock = ospmutex->sem; (*pmutex)->LockCount = ospmutex->ben; + + if (register_cleanup) { + apr_pool_cleanup_register(pool, *pmutex, _proc_mutex_cleanup, + apr_pool_cleanup_null); + } return APR_SUCCESS; } @@ -245,6 +252,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *pool) { - return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT_TIMED, pool); + return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT_TIMED, + 0, pool); } diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 95dc8f8f4e2..581b24350d1 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -150,6 +150,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_lockmech_e mech, + int register_cleanup, apr_pool_t *pool) { if (pool == NULL) { @@ -166,6 +167,11 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, (*pmutex)->mutex = apr_pcalloc(pool, sizeof(apr_thread_mutex_t)); (*pmutex)->mutex->mutex = *ospmutex; (*pmutex)->mutex->pool = pool; + + if (register_cleanup) { + apr_pool_cleanup_register(pool, *pmutex, apr_proc_mutex_cleanup, + apr_pool_cleanup_null); + } return APR_SUCCESS; } @@ -173,6 +179,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *pool) { - return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT, pool); + return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT, + 0, pool); } diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 83f64c84866..847f775da71 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -268,6 +268,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_lockmech_e mech, + int register_cleanup, apr_pool_t *pool) { apr_proc_mutex_t *new; @@ -285,6 +286,10 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, new->hMutex = *ospmutex; *pmutex = new; + if (register_cleanup) { + apr_pool_cleanup_register(pool, *pmutex, apr_proc_mutex_cleanup, + apr_pool_cleanup_null); + } return APR_SUCCESS; } @@ -292,6 +297,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *pool) { - return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT_TIMED, pool); + return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT_TIMED, + 0, pool); } diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 2edeed34bc1..93df3ad27f6 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -1364,12 +1364,14 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_lockmech_e mech, + int register_cleanup, apr_pool_t *pool) { apr_status_t rv; if (pool == NULL) { return APR_ENOPOOL; } + if ((*pmutex) == NULL) { (*pmutex) = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); @@ -1382,6 +1384,11 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, 0, pool); } #endif + + if (rv == APR_SUCCESS && register_cleanup) { + apr_pool_cleanup_register(pool, *pmutex, apr_proc_mutex_cleanup, + apr_pool_cleanup_null); + } return rv; } @@ -1389,6 +1396,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *pool) { - return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT, pool); + return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT, + 0, pool); } diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 83042ce3506..9e227f762b5 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -265,6 +265,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_lockmech_e mech, + int register_cleanup, apr_pool_t *pool) { if (pool == NULL) { @@ -273,12 +274,18 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) { return APR_ENOTIMPL; } + if ((*pmutex) == NULL) { (*pmutex) = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); (*pmutex)->pool = pool; } (*pmutex)->handle = *ospmutex; + + if (register_cleanup) { + apr_pool_cleanup_register(pool, *pmutex, proc_mutex_cleanup, + apr_pool_cleanup_null); + } return APR_SUCCESS; } @@ -286,6 +293,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *pool) { - return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT_TIMED, pool); + return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT_TIMED, + 0, pool); } From 4aa03c56a06fe721ed07e4b231911acc13e999aa Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 13 Apr 2016 11:58:06 +0000 Subject: [PATCH 7589/7878] apr_os_proc_mutex-unix: For consistency with other OS native to APR types constructors/_put()ers and non-unix mutex mechanisms, always destroy the underlying native mutex when apr_proc_mutex_destroy() is called explicitly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1738926 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ locks/unix/proc_mutex.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 46e1cdf2a6a..94b992f2176 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_os_proc_mutex-unix: For consistency with other OS native to APR + types constructors/_put()ers and non-unix mutex mechanisms, always + destroy the underlying native mutex when apr_proc_mutex_destroy() is + called explicitly. [Yann Ylavic] + *) apr_os_proc_mutex_put_ex: Allow to specify whether the OS native mutex should or not be cleaned up (destroyed) with the constructed APR mutex (given pool), and default to not for the simple _put() diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 93df3ad27f6..e29978a0774 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -23,7 +23,11 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) { - return apr_pool_cleanup_run(mutex->pool, mutex, apr_proc_mutex_cleanup); + apr_status_t rv = apr_proc_mutex_cleanup(mutex); + if (rv == APR_SUCCESS) { + apr_pool_cleanup_kill(mutex->pool, mutex, apr_proc_mutex_cleanup); + } + return rv; } #if APR_HAS_POSIXSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || \ From ace114c4fe489368734f108a685b39e43447153e Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 4 May 2016 06:03:28 +0000 Subject: [PATCH 7590/7878] OS/2: Fix compile breakage in apr_thread_mutex_timedlock() due to incorrect variable name. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1742215 13f79535-47bb-0310-9956-ffa450edef68 --- locks/os2/thread_mutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index 1efd6ac14ed..fa2d2c1f667 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -95,7 +95,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, timeout = 0; } } - rc = DosRequestMutexSem(mutex->hMutex, apr_time_as_msec(usec)); + rc = DosRequestMutexSem(mutex->hMutex, apr_time_as_msec(timeout)); if (rc == ERROR_TIMEOUT) { return APR_TIMEUP; } From f8f9ec1f249dd552065aa37c983bed4d4d869bb0 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Thu, 19 May 2016 16:58:58 +0000 Subject: [PATCH 7591/7878] poll/unix/z_asio.c:271]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses. PR59582 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1744600 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/z_asio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index 7e0fd89a549..6537d490948 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -268,9 +268,9 @@ static apr_status_t asio_pollset_create(apr_pollset_t *pollset, if (flags & APR_POLLSET_THREADSAFE) { #if APR_HAS_THREADS - if (rv = apr_thread_mutex_create(&(priv->ring_lock), + if ((rv = apr_thread_mutex_create(&(priv->ring_lock), APR_THREAD_MUTEX_DEFAULT, - p) != APR_SUCCESS) { + p)) != APR_SUCCESS) { DBG1(1, "apr_thread_mutex_create returned %d\n", rv); pollset->p = NULL; return rv; From 6ade07162908b28259fe15f1f5ae670788dd7cd5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 8 Jun 2016 17:37:26 +0000 Subject: [PATCH 7592/7878] 17% speedup by eliminating redundant eos test git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1747424 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_cstr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/strings/apr_cstr.c b/strings/apr_cstr.c index 1e0de5af469..6c27702e47a 100644 --- a/strings/apr_cstr.c +++ b/strings/apr_cstr.c @@ -286,7 +286,8 @@ int apr_cstr_casecmp(const char *str1, const char *str2) const int c1 = (int)(*((const unsigned char *)str1++)); const int c2 = (int)(*((const unsigned char *)str2++)); const int cmp = ucharmap[c1] - ucharmap[c2]; - if (cmp || !c1 || !c2) + /* Not necessary to test for !c2, this is caught by cmp */ + if (cmp || !c1) return cmp; } } @@ -298,7 +299,8 @@ int apr_cstr_casecmpn(const char *str1, const char *str2, apr_size_t n) const int c1 = (int)(*((const unsigned char *)str1++)); const int c2 = (int)(*((const unsigned char *)str2++)); const int cmp = ucharmap[c1] - ucharmap[c2]; - if (cmp || !c1 || !c2) + /* Not necessary to test for !c2, this is caught by cmp */ + if (cmp || !c1) return cmp; } return 0; From 4d7b7ec9879e573583ef4ba5b4a655aeb7bee934 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 8 Jun 2016 17:41:41 +0000 Subject: [PATCH 7593/7878] Additional 17% speedup by deferring unused pointer increments git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1747425 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_cstr.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/strings/apr_cstr.c b/strings/apr_cstr.c index 6c27702e47a..fb940c42c04 100644 --- a/strings/apr_cstr.c +++ b/strings/apr_cstr.c @@ -283,12 +283,14 @@ int apr_cstr_casecmp(const char *str1, const char *str2) { for (;;) { - const int c1 = (int)(*((const unsigned char *)str1++)); - const int c2 = (int)(*((const unsigned char *)str2++)); + const int c1 = (int)(*((const unsigned char *)str1)); + const int c2 = (int)(*((const unsigned char *)str2)); const int cmp = ucharmap[c1] - ucharmap[c2]; /* Not necessary to test for !c2, this is caught by cmp */ if (cmp || !c1) return cmp; + str1++; + str2++; } } @@ -296,12 +298,14 @@ int apr_cstr_casecmpn(const char *str1, const char *str2, apr_size_t n) { while (n--) { - const int c1 = (int)(*((const unsigned char *)str1++)); - const int c2 = (int)(*((const unsigned char *)str2++)); + const int c1 = (int)(*((const unsigned char *)str1)); + const int c2 = (int)(*((const unsigned char *)str2)); const int cmp = ucharmap[c1] - ucharmap[c2]; /* Not necessary to test for !c2, this is caught by cmp */ if (cmp || !c1) return cmp; + str1++; + str2++; } return 0; } From b65726d0823c1e4c64a434635556c1a1fa2acb58 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 8 Jun 2016 22:13:41 +0000 Subject: [PATCH 7594/7878] Third optimization, use short type, which is the smallest functional int which requires 1. no unsigned -> signed promotion, 2. fetches from a word aligned offset from the lookup table, 3. is easily promoted to int upon the function's return. This introduces a very small 2% speed improvement in several cases. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1747460 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_cstr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/strings/apr_cstr.c b/strings/apr_cstr.c index fb940c42c04..a79bf0f61df 100644 --- a/strings/apr_cstr.c +++ b/strings/apr_cstr.c @@ -196,7 +196,7 @@ char * apr_cstr_join(const apr_array_header_t *strings, * octets (such as extended latin alphabetics) are never case-folded. * NOTE: Other than Alpha A-Z/a-z, each code point is unique! */ -static const unsigned char ucharmap[] = { +static const short ucharmap[] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, @@ -243,7 +243,7 @@ static const unsigned char ucharmap[] = { * * NOTE: Other than Alpha A-Z/a-z, each code point is unique! */ -static const unsigned char ucharmap[] = { +static const short ucharmap[] = { 0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x9D, 0x85, 0x08, 0x87, @@ -283,9 +283,9 @@ int apr_cstr_casecmp(const char *str1, const char *str2) { for (;;) { - const int c1 = (int)(*((const unsigned char *)str1)); - const int c2 = (int)(*((const unsigned char *)str2)); - const int cmp = ucharmap[c1] - ucharmap[c2]; + const short c1 = (short)(*((const unsigned char *)str1)); + const short c2 = (short)(*((const unsigned char *)str2)); + const short cmp = ucharmap[c1] - ucharmap[c2]; /* Not necessary to test for !c2, this is caught by cmp */ if (cmp || !c1) return cmp; @@ -298,9 +298,9 @@ int apr_cstr_casecmpn(const char *str1, const char *str2, apr_size_t n) { while (n--) { - const int c1 = (int)(*((const unsigned char *)str1)); - const int c2 = (int)(*((const unsigned char *)str2)); - const int cmp = ucharmap[c1] - ucharmap[c2]; + const short c1 = (short)(*((const unsigned char *)str1)); + const short c2 = (short)(*((const unsigned char *)str2)); + const short cmp = ucharmap[c1] - ucharmap[c2]; /* Not necessary to test for !c2, this is caught by cmp */ if (cmp || !c1) return cmp; From f4d474d9874d69a06e9dfbab1e33ed6e412d41b9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 8 Jun 2016 22:39:58 +0000 Subject: [PATCH 7595/7878] Upon closer scrutiny, the optimization of using short variables (as opposed to the array of shorts) really didn't hold up. Revert back to processing in 'int' amounts, persist in using short values in the character case folding table, which are more easily retrieved based on word alignment. Aligning and representing the table values as 'int' doesn't exhibit any additional benefit and wastes some DATA page space. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1747461 13f79535-47bb-0310-9956-ffa450edef68 --- strings/apr_cstr.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/strings/apr_cstr.c b/strings/apr_cstr.c index a79bf0f61df..7c4145109e4 100644 --- a/strings/apr_cstr.c +++ b/strings/apr_cstr.c @@ -279,13 +279,15 @@ static const short ucharmap[] = { }; #endif -int apr_cstr_casecmp(const char *str1, const char *str2) +int apr_cstr_casecmp(const char *s1, const char *s2) { + const unsigned char *str1 = (const unsigned char *)s1; + const unsigned char *str2 = (const unsigned char *)s2; for (;;) { - const short c1 = (short)(*((const unsigned char *)str1)); - const short c2 = (short)(*((const unsigned char *)str2)); - const short cmp = ucharmap[c1] - ucharmap[c2]; + const int c1 = (int)(*str1); + const int c2 = (int)(*str2); + const int cmp = ucharmap[c1] - ucharmap[c2]; /* Not necessary to test for !c2, this is caught by cmp */ if (cmp || !c1) return cmp; @@ -294,13 +296,15 @@ int apr_cstr_casecmp(const char *str1, const char *str2) } } -int apr_cstr_casecmpn(const char *str1, const char *str2, apr_size_t n) +int apr_cstr_casecmpn(const char *s1, const char *s2, apr_size_t n) { + const unsigned char *str1 = (const unsigned char *)s1; + const unsigned char *str2 = (const unsigned char *)s2; while (n--) { - const short c1 = (short)(*((const unsigned char *)str1)); - const short c2 = (short)(*((const unsigned char *)str2)); - const short cmp = ucharmap[c1] - ucharmap[c2]; + const int c1 = (int)(*str1); + const int c2 = (int)(*str2); + const int cmp = ucharmap[c1] - ucharmap[c2]; /* Not necessary to test for !c2, this is caught by cmp */ if (cmp || !c1) return cmp; From 0cb6581ea9a968bcdbfb03dd5e3454f763e0fabb Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 12 Jun 2016 00:02:22 +0000 Subject: [PATCH 7596/7878] apr_xml_to_text: Add style APR_XML_X2T_PARSED to maintain a consistent namespace prefix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1747941 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++ include/apr_xml.h | 2 ++ xml/apr_xml.c | 82 +++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 82 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 94b992f2176..80b970df714 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_xml_to_text: Add style APR_XML_X2T_PARSED to maintain a + consistent namespace prefix. [Jari Urpalainen + ] + *) apr_os_proc_mutex-unix: For consistency with other OS native to APR types constructors/_put()ers and non-unix mutex mechanisms, always destroy the underlying native mutex when apr_proc_mutex_destroy() is diff --git a/include/apr_xml.h b/include/apr_xml.h index ffd6716288a..bd0b1000ca0 100644 --- a/include/apr_xml.h +++ b/include/apr_xml.h @@ -276,6 +276,7 @@ APR_DECLARE(char *) apr_xml_parser_geterror(apr_xml_parser *parser, * APR_XML_X2T_INNER contents only * APR_XML_X2T_LANG_INNER xml:lang + inner contents * APR_XML_X2T_FULL_NS_LANG FULL + ns defns + xml:lang + * APR_XML_X2T_PARSED original prefixes * * @param namespaces The namespace of the current XML element * @param ns_map Namespace mapping @@ -292,6 +293,7 @@ APR_DECLARE(void) apr_xml_to_text(apr_pool_t *p, const apr_xml_elem *elem, #define APR_XML_X2T_INNER 1 /**< contents only */ #define APR_XML_X2T_LANG_INNER 2 /**< xml:lang + inner contents */ #define APR_XML_X2T_FULL_NS_LANG 3 /**< FULL + ns defns + xml:lang */ +#define APR_XML_X2T_PARSED 4 /**< original prefixes */ /** * empty XML element diff --git a/xml/apr_xml.c b/xml/apr_xml.c index 8ea2b32fed9..82791f49da9 100644 --- a/xml/apr_xml.c +++ b/xml/apr_xml.c @@ -97,6 +97,25 @@ static int find_prefix(apr_xml_parser *parser, const char *prefix) return APR_XML_NS_ERROR_UNKNOWN_PREFIX; } +/* return original prefix given ns index */ +static const char * find_prefix_name(const apr_xml_elem *elem, int ns, int parent) +{ + /* + ** Walk up the tree, looking for a namespace scope that defines this + ** prefix. + */ + for (; elem; elem = parent ? elem->parent : NULL) { + apr_xml_ns_scope *ns_scope = elem->ns_scope; + + for (; ns_scope; ns_scope = ns_scope->next) { + if (ns_scope->ns == ns) + return ns_scope->prefix; + } + } + /* not found */ + return ""; +} + static void start_handler(void *userdata, const char *name, const char **attrs) { apr_xml_parser *parser = userdata; @@ -538,7 +557,8 @@ static apr_size_t elem_size(const apr_xml_elem *elem, int style, { apr_size_t size; - if (style == APR_XML_X2T_FULL || style == APR_XML_X2T_FULL_NS_LANG) { + if (style == APR_XML_X2T_FULL || style == APR_XML_X2T_FULL_NS_LANG || + style == APR_XML_X2T_PARSED) { const apr_xml_attr *attr; size = 0; @@ -562,11 +582,29 @@ static apr_size_t elem_size(const apr_xml_elem *elem, int style, size += 11 + strlen(elem->lang) + 1; } } + else if (style == APR_XML_X2T_PARSED) { + apr_xml_ns_scope *ns_scope = elem->ns_scope; + + /* compute size of: ' xmlns:%s="%s"' */ + for (; ns_scope; ns_scope = ns_scope->next) { + size += 10 + strlen(find_prefix_name(elem, ns_scope->ns, 0)) + + strlen(APR_XML_GET_URI_ITEM(namespaces, ns_scope->ns)); + } + + if (elem->lang != NULL) { + /* compute size of: ' xml:lang="%s"' */ + size += 11 + strlen(elem->lang) + 1; + } + } if (elem->ns == APR_XML_NS_NONE) { /* compute size of: <%s> */ size += 1 + strlen(elem->name) + 1; } + else if (style == APR_XML_X2T_PARSED) { + /* compute size of: <%s:%s> */ + size += 3 + strlen(find_prefix_name(elem, elem->ns, 1)) + strlen(elem->name); + } else { int ns = ns_map ? ns_map[elem->ns] : elem->ns; @@ -592,6 +630,10 @@ static apr_size_t elem_size(const apr_xml_elem *elem, int style, /* compute size of: ' %s="%s"' */ size += 1 + strlen(attr->name) + 2 + strlen(attr->value) + 1; } + else if (style == APR_XML_X2T_PARSED) { + /* compute size of: ' %s:%s="%s"' */ + size += 5 + strlen(find_prefix_name(elem, attr->ns, 1)) + strlen(attr->name) + strlen(attr->value); + } else { /* compute size of: ' ns%d:%s="%s"' */ int ns = ns_map ? ns_map[attr->ns] : attr->ns; @@ -625,7 +667,7 @@ static apr_size_t elem_size(const apr_xml_elem *elem, int style, for (elem = elem->first_child; elem; elem = elem->next) { /* the size of the child element plus the CDATA that follows it */ - size += (elem_size(elem, APR_XML_X2T_FULL, NULL, ns_map) + + size += (elem_size(elem, style == APR_XML_X2T_PARSED ? APR_XML_X2T_PARSED : APR_XML_X2T_FULL, NULL, ns_map) + text_size(elem->following_cdata.first)); } @@ -649,13 +691,17 @@ static char *write_elem(char *s, const apr_xml_elem *elem, int style, apr_size_t len; int ns; - if (style == APR_XML_X2T_FULL || style == APR_XML_X2T_FULL_NS_LANG) { + if (style == APR_XML_X2T_FULL || style == APR_XML_X2T_FULL_NS_LANG || + style == APR_XML_X2T_PARSED) { int empty = APR_XML_ELEM_IS_EMPTY(elem); const apr_xml_attr *attr; if (elem->ns == APR_XML_NS_NONE) { len = sprintf(s, "<%s", elem->name); } + else if (style == APR_XML_X2T_PARSED) { + len = sprintf(s, "<%s:%s", find_prefix_name(elem, elem->ns, 1), elem->name); + } else { ns = ns_map ? ns_map[elem->ns] : elem->ns; len = sprintf(s, "name); @@ -663,8 +709,13 @@ static char *write_elem(char *s, const apr_xml_elem *elem, int style, s += len; for (attr = elem->attr; attr; attr = attr->next) { - if (attr->ns == APR_XML_NS_NONE) + if (attr->ns == APR_XML_NS_NONE) { len = sprintf(s, " %s=\"%s\"", attr->name, attr->value); + } + else if (style == APR_XML_X2T_PARSED) { + len = sprintf(s, " %s:%s=\"%s\"", + find_prefix_name(elem, attr->ns, 1), attr->name, attr->value); + } else { ns = ns_map ? ns_map[attr->ns] : attr->ns; len = sprintf(s, " ns%d:%s=\"%s\"", ns, attr->name, attr->value); @@ -692,6 +743,19 @@ static char *write_elem(char *s, const apr_xml_elem *elem, int style, } } + else if (style == APR_XML_X2T_PARSED) { + apr_xml_ns_scope *ns_scope = elem->ns_scope; + + for (; ns_scope; ns_scope = ns_scope->next) { + const char *prefix = find_prefix_name(elem, ns_scope->ns, 0); + + len = sprintf(s, " xmlns%s%s=\"%s\"", + *prefix ? ":" : "", *prefix ? prefix : "", + APR_XML_GET_URI_ITEM(namespaces, ns_scope->ns)); + s += len; + } + } + /* no more to do. close it up and go. */ if (empty) { *s++ = '/'; @@ -715,14 +779,20 @@ static char *write_elem(char *s, const apr_xml_elem *elem, int style, s = write_text(s, elem->first_cdata.first); for (child = elem->first_child; child; child = child->next) { - s = write_elem(s, child, APR_XML_X2T_FULL, NULL, ns_map); + s = write_elem(s, child, + style == APR_XML_X2T_PARSED ? APR_XML_X2T_PARSED : APR_XML_X2T_FULL, + NULL, ns_map); s = write_text(s, child->following_cdata.first); } - if (style == APR_XML_X2T_FULL || style == APR_XML_X2T_FULL_NS_LANG) { + if (style == APR_XML_X2T_FULL || style == APR_XML_X2T_FULL_NS_LANG || + style == APR_XML_X2T_PARSED) { if (elem->ns == APR_XML_NS_NONE) { len = sprintf(s, "", elem->name); } + else if (style == APR_XML_X2T_PARSED) { + len = sprintf(s, "", find_prefix_name(elem, elem->ns, 1), elem->name); + } else { ns = ns_map ? ns_map[elem->ns] : elem->ns; len = sprintf(s, "", ns, elem->name); From 0077a7f76e1bf80344a703ee490c1210e4f25402 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Mon, 27 Jun 2016 16:01:23 +0000 Subject: [PATCH 7597/7878] Fix a case where the cleanup for a pollset w/o the thread-safe flag would try to zap a random/garbage message queue identifier. In httpd, this could happen with e.g. mod_cgi's short-lived, non-threadsafe pollset. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1750374 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/z_asio.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index 6537d490948..6da4ee8e901 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -247,9 +247,11 @@ static apr_status_t asio_pollset_cleanup(apr_pollset_t *pollset) int rv; DBG(4, "entered\n"); - rv = msgctl(pollset->p->msg_q, IPC_RMID, NULL); + if (pollset->flags & APR_POLLSET_THREADSAFE) { + rv = msgctl(pollset->p->msg_q, IPC_RMID, NULL); + DBG1(4, "asio_pollset_cleanup: msgctl(IPC_RMID) returned %d\n", rv); + } - DBG1(4, "exiting, msgctl(IPC_RMID) returned %d\n", rv); return rv; } @@ -264,7 +266,7 @@ static apr_status_t asio_pollset_create(apr_pollset_t *pollset, DBG1(2, "entered, flags: %x\n", flags); - priv = pollset->p = apr_palloc(p, sizeof(*priv)); + priv = pollset->p = apr_pcalloc(p, sizeof(*priv)); if (flags & APR_POLLSET_THREADSAFE) { #if APR_HAS_THREADS From fd3068864cd3ad6e08669166c49afdd249b98840 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 5 Jul 2016 22:54:14 +0000 Subject: [PATCH 7598/7878] Remove unnecessary duplication of autoconf tests for openssl and commoncrypto. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1751567 13f79535-47bb-0310-9956-ffa450edef68 --- build/crypto.m4 | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/build/crypto.m4 b/build/crypto.m4 index 65ed15eb5d8..e972494d719 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -113,16 +113,6 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ APR_ADDTO(INCLUDES, [-I$withval/include]) fi - if test "$apu_have_openssl" != "1"; then - AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1]) - AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) - if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then - apu_have_openssl=1 - APR_ADDTO(LDFLAGS, [-L$withval/lib]) - APR_ADDTO(INCLUDES, [-I$withval/include]) - fi - fi - AC_CHECK_DECLS([EVP_PKEY_CTX_new], [], [], [#include ]) @@ -278,16 +268,6 @@ AC_DEFUN([APU_CHECK_CRYPTO_COMMONCRYPTO], [ APR_ADDTO(INCLUDES, [-I$withval/include]) fi - if test "$apu_have_commoncrypto" != "1"; then - AC_CHECK_HEADERS(CommonCrypto/CommonKeyDerivation.h, [commoncrypto_have_headers=1]) - AC_CHECK_LIB(System, CCKeyDerivationPBKDF, AC_CHECK_LIB(System, CCCryptorCreate, [commoncrypto_have_libs=1],,-lcrypto)) - if test "$commoncrypto_have_headers" != "0" && test "$commoncrypto_have_libs" != "0"; then - apu_have_commoncrypto=1 - APR_ADDTO(LDFLAGS, [-L$withval/lib]) - APR_ADDTO(INCLUDES, [-I$withval/include]) - fi - fi - fi ], [ apu_have_commoncrypto=0 From be19b08ffa345ea58cf502b69d222e60f4a74521 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Thu, 7 Jul 2016 12:12:25 +0000 Subject: [PATCH 7599/7878] testcrypto: Don't silently swallow errors when the driver loads but the underlying library refuses to initialise. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1751783 13f79535-47bb-0310-9956-ffa450edef68 --- test/testcrypto.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/test/testcrypto.c b/test/testcrypto.c index 6fa6185d819..58428d243e5 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -33,24 +33,33 @@ static const apr_crypto_driver_t *get_driver(abts_case *tc, apr_pool_t *pool, { const apr_crypto_driver_t *driver = NULL; - const apu_err_t *err = NULL; + const apu_err_t *result = NULL; apr_status_t rv; rv = apr_crypto_init(pool); ABTS_ASSERT(tc, "failed to init apr_crypto", rv == APR_SUCCESS); - rv = apr_crypto_get_driver(&driver, name, params, &err, pool); - if (APR_SUCCESS != rv && err) { - ABTS_NOT_IMPL(tc, apr_pstrcat(pool, err->msg, " (", name, ")", NULL)); + rv = apr_crypto_get_driver(&driver, name, params, &result, pool); + if (APR_ENOTIMPL == rv) { + ABTS_NOT_IMPL(tc, + apr_psprintf(pool, "\nCrypto driver '%s' not implemented, skipping", (char *)name)); return NULL; } - if (APR_ENOTIMPL == rv) { + if (APR_EDSOOPEN == rv) { ABTS_NOT_IMPL(tc, - apr_psprintf(pool, "Crypto driver '%s' not implemented, skipping", (char *)name)); + apr_psprintf(pool, "\nCrypto driver '%s' DSO could not be opened, skipping", (char *)name)); return NULL; } - ABTS_ASSERT(tc, "failed to apr_crypto_get_driver", rv == APR_SUCCESS); - ABTS_ASSERT(tc, "apr_crypto_get_driver returned NULL", driver != NULL); + if (APR_SUCCESS != rv && result) { + char err[1024]; + apr_strerror(rv, err, sizeof(err) - 1); + fprintf(stderr, "\nget_driver error %d: %s: '%s' native error %d: %s (%s)\n", + rv, err, name, result->rc, result->reason ? result->reason : "", + result->msg ? result->msg : ""); + } + ABTS_ASSERT(tc, apr_psprintf(pool, "\nfailed to apr_crypto_get_driver for '%s' with %d", + name, rv), rv == APR_SUCCESS); + ABTS_ASSERT(tc, "\napr_crypto_get_driver returned NULL", driver != NULL); if (!driver || rv) { return NULL; } From 42fa31d7219e9371771a1549e3c63c68f74a1540 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Thu, 7 Jul 2016 14:55:34 +0000 Subject: [PATCH 7600/7878] apr_crypto: Don't cache the driver if initialisation fails. This stops the second and subsequent attempt to use the API from failing claiming the library is not initialised. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1751806 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ crypto/apr_crypto.c | 13 ++++++++----- crypto/apr_crypto_nss.c | 11 ++++++----- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 80b970df714..5d65a653793 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_crypto: Don't cache the driver if initialisation fails. This + stops the second and subsequent attempt to use the API from failing + claiming the library is not initialised. [Graham Leggett] + *) apr_xml_to_text: Add style APR_XML_X2T_PARSED to maintain a consistent namespace prefix. [Jari Urpalainen ] diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 52930c16658..d10e6dec8b6 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -182,12 +182,15 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( apr_snprintf(symname, sizeof(symname), "apr_crypto_%s_driver", name); rv = apu_dso_load(&dso, &symbol, modname, symname, pool); if (rv == APR_SUCCESS || rv == APR_EINIT) { /* previously loaded?!? */ - *driver = symbol; - name = apr_pstrdup(pool, name); - apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver); + apr_crypto_driver_t *d = symbol; rv = APR_SUCCESS; - if ((*driver)->init) { - rv = (*driver)->init(pool, params, result); + if (d->init) { + rv = d->init(pool, params, result); + } + if (APR_SUCCESS == rv) { + *driver = symbol; + name = apr_pstrdup(pool, name); + apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver); } } apu_dso_mutex_unlock(); diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index f65f60a427a..1a92c85f245 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -198,9 +198,6 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, return APR_EREINIT; } - apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, - apr_pool_cleanup_null); - if (keyPrefix || certPrefix || secmod) { s = NSS_Initialize(dir, certPrefix, keyPrefix, secmod, flags); } @@ -212,15 +209,19 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, } if (s != SECSuccess) { if (result) { + /* Note: all memory must be owned by the caller, in case we're unloaded */ apu_err_t *err = apr_pcalloc(pool, sizeof(apu_err_t)); err->rc = PR_GetError(); - err->msg = PR_ErrorToName(s); - err->reason = "Error during 'nss' initialisation"; + err->msg = apr_pstrdup(pool, PR_ErrorToName(s)); + err->reason = apr_pstrdup(pool, "Error during 'nss' initialisation"); *result = err; } return APR_ECRYPT; } + apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, + apr_pool_cleanup_null); + return APR_SUCCESS; } From ccd7dfdaf9c993785858e24bcba320d31b44a027 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Fri, 8 Jul 2016 13:18:07 +0000 Subject: [PATCH 7601/7878] apr_crypto_nss: Ensure the SECItem returned by PK11_ParamFromIV is properly freed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1751898 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ crypto/apr_crypto_nss.c | 35 +++++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 5d65a653793..90348e72248 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_crypto_nss: Ensure the SECItem returned by PK11_ParamFromIV + is properly freed. [Graham Leggett] + *) apr_crypto: Don't cache the driver if initialisation fails. This stops the second and subsequent attempt to use the API from failing claiming the library is not initialised. [Graham Leggett] diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 1a92c85f245..8949b6b62f5 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -77,6 +77,7 @@ struct apr_crypto_block_t { const apr_crypto_t *f; PK11Context *ctx; apr_crypto_key_t *key; + SECItem *secParam; int blockSize; }; @@ -108,6 +109,8 @@ static apr_status_t crypto_shutdown(void) if (NSS_IsInitialized()) { SECStatus s = NSS_Shutdown(); if (s != SECSuccess) { + fprintf(stderr, "NSS failed to shutdown, possible leak: %d: %s", + PR_GetError(), PR_ErrorToName(s)); return APR_EINIT; } } @@ -216,6 +219,11 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, err->reason = apr_pstrdup(pool, "Error during 'nss' initialisation"); *result = err; } + s = NSS_Shutdown(); + if (s != SECSuccess) { + return APR_ECRYPT; + } + return APR_ECRYPT; } @@ -235,6 +243,11 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, static apr_status_t crypto_block_cleanup(apr_crypto_block_t *block) { + if (block->secParam) { + SECITEM_FreeItem(block->secParam, PR_TRUE); + block->secParam = NULL; + } + if (block->ctx) { PK11_DestroyContext(block->ctx, PR_TRUE); block->ctx = NULL; @@ -536,7 +549,6 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, apr_size_t *blockSize, apr_pool_t *p) { PRErrorCode perr; - SECItem * secParam; SECItem ivItem; unsigned char * usedIv; apr_crypto_block_t *block = *ctx; @@ -575,14 +587,14 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, } ivItem.data = usedIv; ivItem.len = key->ivSize; - secParam = PK11_ParamFromIV(key->cipherMech, &ivItem); + block->secParam = PK11_ParamFromIV(key->cipherMech, &ivItem); } else { - secParam = PK11_GenerateNewParam(key->cipherMech, key->symKey); + block->secParam = PK11_GenerateNewParam(key->cipherMech, key->symKey); } - block->blockSize = PK11_GetBlockSize(key->cipherMech, secParam); + block->blockSize = PK11_GetBlockSize(key->cipherMech, block->secParam); block->ctx = PK11_CreateContextBySymKey(key->cipherMech, CKA_ENCRYPT, - key->symKey, secParam); + key->symKey, block->secParam); /* did an error occur? */ perr = PORT_GetError(); @@ -593,7 +605,7 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, } if (blockSize) { - *blockSize = PK11_GetBlockSize(key->cipherMech, secParam); + *blockSize = PK11_GetBlockSize(key->cipherMech, block->secParam); } return APR_SUCCESS; @@ -717,7 +729,6 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, const apr_crypto_key_t *key, apr_pool_t *p) { PRErrorCode perr; - SECItem * secParam; apr_crypto_block_t *block = *ctx; if (!block) { *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t)); @@ -739,14 +750,14 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, } ivItem.data = (unsigned char*) iv; ivItem.len = key->ivSize; - secParam = PK11_ParamFromIV(key->cipherMech, &ivItem); + block->secParam = PK11_ParamFromIV(key->cipherMech, &ivItem); } else { - secParam = PK11_GenerateNewParam(key->cipherMech, key->symKey); + block->secParam = PK11_GenerateNewParam(key->cipherMech, key->symKey); } - block->blockSize = PK11_GetBlockSize(key->cipherMech, secParam); + block->blockSize = PK11_GetBlockSize(key->cipherMech, block->secParam); block->ctx = PK11_CreateContextBySymKey(key->cipherMech, CKA_DECRYPT, - key->symKey, secParam); + key->symKey, block->secParam); /* did an error occur? */ perr = PORT_GetError(); @@ -757,7 +768,7 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, } if (blockSize) { - *blockSize = PK11_GetBlockSize(key->cipherMech, secParam); + *blockSize = PK11_GetBlockSize(key->cipherMech, block->secParam); } return APR_SUCCESS; From 1ecace384ed1c10361a3d93b9780ee83ad3c511a Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 9 Jul 2016 14:13:07 +0000 Subject: [PATCH 7602/7878] apr_crypto: Add apr_crypto_key() function which supports keys generated from a passphrase or a raw secret provided by the caller. Deprecate apr_crypto_passphrase(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1752008 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 + crypto/apr_crypto.c | 28 +- crypto/apr_crypto_commoncrypto.c | 218 ++++++++---- crypto/apr_crypto_nss.c | 350 +++++++++++++++---- crypto/apr_crypto_openssl.c | 229 +++++++++---- include/apr_crypto.h | 68 +++- include/private/apr_crypto_internal.h | 23 +- test/testcrypto.c | 468 +++++++++++++++++++------- 8 files changed, 1071 insertions(+), 317 deletions(-) diff --git a/CHANGES b/CHANGES index 90348e72248..8340365ea7c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_crypto: Add apr_crypto_key() function which supports keys + generated from a passphrase or a raw secret provided by the caller. + Deprecate apr_crypto_passphrase(). [Graham Leggett] + *) apr_crypto_nss: Ensure the SECItem returned by PK11_ParamFromIV is properly freed. [Graham Leggett] diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index d10e6dec8b6..2ce022f6659 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -289,7 +289,8 @@ APR_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, /** * @brief Get a hash table of key types, keyed by the name of the type against - * an integer pointer constant. + * a pointer to apr_crypto_block_key_type_t, which in turn begins with an + * integer. * * @param types - hashtable of key types keyed to constants. * @param f - encryption context @@ -303,7 +304,8 @@ APR_DECLARE(apr_status_t) apr_crypto_get_block_key_types(apr_hash_t **types, /** * @brief Get a hash table of key modes, keyed by the name of the mode against - * an integer pointer constant. + * a pointer to apr_crypto_block_key_mode_t, which in turn begins with an + * integer. * * @param modes - hashtable of key modes keyed to constants. * @param f - encryption context @@ -315,6 +317,28 @@ APR_DECLARE(apr_status_t) apr_crypto_get_block_key_modes(apr_hash_t **modes, return f->provider->get_block_key_modes(modes, f); } +/** + * @brief Create a key from the provided secret or passphrase. The key is cleaned + * up when the context is cleaned, and may be reused with multiple encryption + * or decryption operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param key The key returned, see note. + * @param rec The key record, from which the key will be derived. + * @param f The context to use. + * @param p The pool to use. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ +APR_DECLARE(apr_status_t) apr_crypto_key(apr_crypto_key_t **key, + const apr_crypto_key_rec_t *rec, const apr_crypto_t *f, apr_pool_t *p) +{ + return f->provider->key(key, rec, f, p); +} + /** * @brief Create a key from the given passphrase. By default, the PBKDF2 * algorithm is used to generate the key from the passphrase. It is expected diff --git a/crypto/apr_crypto_commoncrypto.c b/crypto/apr_crypto_commoncrypto.c index a584e5baa9e..ab216cc8fb5 100644 --- a/crypto/apr_crypto_commoncrypto.c +++ b/crypto/apr_crypto_commoncrypto.c @@ -69,13 +69,17 @@ struct apr_crypto_block_t CCCryptorRef ref; }; -static int key_3des_192 = APR_KEY_3DES_192; -static int key_aes_128 = APR_KEY_AES_128; -static int key_aes_192 = APR_KEY_AES_192; -static int key_aes_256 = APR_KEY_AES_256; +static struct apr_crypto_block_key_type_t key_types[] = +{ +{ APR_KEY_3DES_192, 24, 8, 8 }, +{ APR_KEY_AES_128, 16, 16, 16 }, +{ APR_KEY_AES_192, 24, 16, 16 }, +{ APR_KEY_AES_256, 32, 16, 16 } }; -static int mode_ecb = APR_MODE_ECB; -static int mode_cbc = APR_MODE_CBC; +static struct apr_crypto_block_key_mode_t key_modes[] = +{ +{ APR_MODE_ECB }, +{ APR_MODE_CBC } }; /** * Fetch the most recent error from this driver. @@ -211,17 +215,17 @@ static apr_status_t crypto_make(apr_crypto_t **ff, if (!f->types) { return APR_ENOMEM; } - apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_3des_192)); - apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_aes_128)); - apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_aes_192)); - apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_aes_256)); + apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_types[0])); + apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_types[1])); + apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_types[2])); + apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_types[3])); f->modes = apr_hash_make(pool); if (!f->modes) { return APR_ENOMEM; } - apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(mode_ecb)); - apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(mode_cbc)); + apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(key_modes[0])); + apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(key_modes[1])); apr_pool_cleanup_register(pool, f, crypto_cleanup_helper, apr_pool_cleanup_null); @@ -232,7 +236,7 @@ static apr_status_t crypto_make(apr_crypto_t **ff, /** * @brief Get a hash table of key types, keyed by the name of the type against - * an integer pointer constant. + * a pointer to apr_crypto_block_key_type_t. * * @param types - hashtable of key types keyed to constants. * @param f - encryption context @@ -247,7 +251,7 @@ static apr_status_t crypto_get_block_key_types(apr_hash_t **types, /** * @brief Get a hash table of key modes, keyed by the name of the mode against - * an integer pointer constant. + * a pointer to apr_crypto_block_key_mode_t. * * @param modes - hashtable of key modes keyed to constants. * @param f - encryption context @@ -260,52 +264,13 @@ static apr_status_t crypto_get_block_key_modes(apr_hash_t **modes, return APR_SUCCESS; } -/** - * @brief Create a key from the given passphrase. By default, the PBKDF2 - * algorithm is used to generate the key from the passphrase. It is expected - * that the same pass phrase will generate the same key, regardless of the - * backend crypto platform used. The key is cleaned up when the context - * is cleaned, and may be reused with multiple encryption or decryption - * operations. - * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If - * *key is not NULL, *key must point at a previously created structure. - * @param key The key returned, see note. - * @param ivSize The size of the initialisation vector will be returned, based - * on whether an IV is relevant for this type of crypto. - * @param pass The passphrase to use. - * @param passLen The passphrase length in bytes - * @param salt The salt to use. - * @param saltLen The salt length in bytes - * @param type 3DES_192, AES_128, AES_192, AES_256. - * @param mode Electronic Code Book / Cipher Block Chaining. - * @param doPad Pad if necessary. - * @param iterations Iteration count - * @param f The context to use. - * @param p The pool to use. - * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend - * error occurred while generating the key. APR_ENOCIPHER if the type or mode - * is not supported by the particular backend. APR_EKEYTYPE if the key type is - * not known. APR_EPADDING if padding was requested but is not supported. - * APR_ENOTIMPL if not implemented. +/* + * Work out which mechanism to use. */ -static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, - const char *pass, apr_size_t passLen, const unsigned char * salt, - apr_size_t saltLen, const apr_crypto_block_key_type_e type, - const apr_crypto_block_key_mode_e mode, const int doPad, - const int iterations, const apr_crypto_t *f, apr_pool_t *p) +static apr_status_t crypto_cipher_mechanism(apr_crypto_key_t *key, + const apr_crypto_block_key_type_e type, + const apr_crypto_block_key_mode_e mode, const int doPad, apr_pool_t *p) { - apr_crypto_key_t *key = *k; - - if (!key) { - *k = key = apr_array_push(f->keys); - } - if (!key) { - return APR_ENOMEM; - } - - key->f = f; - key->provider = f->provider; - /* handle padding */ key->options = doPad ? kCCOptionPKCS7Padding : 0; @@ -391,12 +356,145 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, } /* make space for the key */ - key->key = apr_pcalloc(p, key->keyLen); + key->key = apr_palloc(p, key->keyLen); if (!key->key) { return APR_ENOMEM; } apr_crypto_clear(p, key->key, key->keyLen); + return APR_SUCCESS; +} + +/** + * @brief Create a key from the provided secret or passphrase. The key is cleaned + * up when the context is cleaned, and may be reused with multiple encryption + * or decryption operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param key The key returned, see note. + * @param rec The key record, from which the key will be derived. + * @param f The context to use. + * @param p The pool to use. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_key(apr_crypto_key_t **k, + const apr_crypto_key_rec_t *rec, const apr_crypto_t *f, apr_pool_t *p) +{ + apr_status_t rv; + apr_crypto_key_t *key = *k; + + if (!key) { + *k = key = apr_array_push(f->keys); + } + if (!key) { + return APR_ENOMEM; + } + + key->f = f; + key->provider = f->provider; + + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad, p); + if (APR_SUCCESS != rv) { + return rv; + } + + switch (rec->ktype) { + + case APR_CRYPTO_KTYPE_PASSPHRASE: { + + /* generate the key */ + if ((f->result->rc = CCKeyDerivationPBKDF(kCCPBKDF2, + rec->k.passphrase.pass, rec->k.passphrase.passLen, + rec->k.passphrase.salt, rec->k.passphrase.saltLen, + kCCPRFHmacAlgSHA1, rec->k.passphrase.iterations, key->key, + key->keyLen)) == kCCParamError) { + return APR_ENOKEY; + } + + break; + } + + case APR_CRYPTO_KTYPE_SECRET: { + + /* sanity check - key correct size? */ + if (rec->k.secret.secretLen != key->keyLen) { + return APR_EKEYLENGTH; + } + + /* copy the key */ + memcpy(key->key, rec->k.secret.secret, rec->k.secret.secretLen); + + break; + } + + default: { + + return APR_ENOKEY; + + } + } + + return APR_SUCCESS; +} + +/** + * @brief Create a key from the given passphrase. By default, the PBKDF2 + * algorithm is used to generate the key from the passphrase. It is expected + * that the same pass phrase will generate the same key, regardless of the + * backend crypto platform used. The key is cleaned up when the context + * is cleaned, and may be reused with multiple encryption or decryption + * operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param key The key returned, see note. + * @param ivSize The size of the initialisation vector will be returned, based + * on whether an IV is relevant for this type of crypto. + * @param pass The passphrase to use. + * @param passLen The passphrase length in bytes + * @param salt The salt to use. + * @param saltLen The salt length in bytes + * @param type 3DES_192, AES_128, AES_192, AES_256. + * @param mode Electronic Code Book / Cipher Block Chaining. + * @param doPad Pad if necessary. + * @param iterations Iteration count + * @param f The context to use. + * @param p The pool to use. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, + const char *pass, apr_size_t passLen, const unsigned char * salt, + apr_size_t saltLen, const apr_crypto_block_key_type_e type, + const apr_crypto_block_key_mode_e mode, const int doPad, + const int iterations, const apr_crypto_t *f, apr_pool_t *p) +{ + apr_status_t rv; + apr_crypto_key_t *key = *k; + + if (!key) { + *k = key = apr_array_push(f->keys); + } + if (!key) { + return APR_ENOMEM; + } + + key->f = f; + key->provider = f->provider; + + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, type, mode, doPad, p); + if (APR_SUCCESS != rv) { + return rv; + } + /* generate the key */ if ((f->result->rc = CCKeyDerivationPBKDF(kCCPBKDF2, pass, passLen, salt, saltLen, kCCPRFHmacAlgSHA1, iterations, key->key, key->keyLen)) @@ -808,7 +906,7 @@ APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_commoncrypto_driver crypto_block_encrypt_init, crypto_block_encrypt, crypto_block_encrypt_finish, crypto_block_decrypt_init, crypto_block_decrypt, crypto_block_decrypt_finish, crypto_block_cleanup, - crypto_cleanup, crypto_shutdown, crypto_error + crypto_cleanup, crypto_shutdown, crypto_error, crypto_key }; #endif diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 8949b6b62f5..e57241cb9dc 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -81,13 +81,20 @@ struct apr_crypto_block_t { int blockSize; }; -static int key_3des_192 = APR_KEY_3DES_192; -static int key_aes_128 = APR_KEY_AES_128; -static int key_aes_192 = APR_KEY_AES_192; -static int key_aes_256 = APR_KEY_AES_256; +static struct apr_crypto_block_key_type_t key_types[] = +{ +{ APR_KEY_3DES_192, 24, 8, 8 }, +{ APR_KEY_AES_128, 16, 16, 16 }, +{ APR_KEY_AES_192, 24, 16, 16 }, +{ APR_KEY_AES_256, 32, 16, 16 } }; + +static struct apr_crypto_block_key_mode_t key_modes[] = +{ +{ APR_MODE_ECB }, +{ APR_MODE_CBC } }; -static int mode_ecb = APR_MODE_ECB; -static int mode_cbc = APR_MODE_CBC; +/* sufficient space to wrap a key */ +#define BUFFER_SIZE 128 /** * Fetch the most recent error from this driver. @@ -219,10 +226,6 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, err->reason = apr_pstrdup(pool, "Error during 'nss' initialisation"); *result = err; } - s = NSS_Shutdown(); - if (s != SECSuccess) { - return APR_ECRYPT; - } return APR_ECRYPT; } @@ -329,17 +332,17 @@ static apr_status_t crypto_make(apr_crypto_t **ff, if (!f->types) { return APR_ENOMEM; } - apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_3des_192)); - apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_aes_128)); - apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_aes_192)); - apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_aes_256)); + apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_types[0])); + apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_types[1])); + apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_types[2])); + apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_types[3])); f->modes = apr_hash_make(pool); if (!f->modes) { return APR_ENOMEM; } - apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(mode_ecb)); - apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(mode_cbc)); + apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(key_modes[0])); + apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(key_modes[1])); apr_pool_cleanup_register(pool, f, crypto_cleanup_helper, apr_pool_cleanup_null); @@ -350,7 +353,7 @@ static apr_status_t crypto_make(apr_crypto_t **ff, /** * @brief Get a hash table of key types, keyed by the name of the type against - * an integer pointer constant. + * a pointer to apr_crypto_block_key_type_t. * * @param types - hashtable of key types keyed to constants. * @param f - encryption context @@ -365,7 +368,7 @@ static apr_status_t crypto_get_block_key_types(apr_hash_t **types, /** * @brief Get a hash table of key modes, keyed by the name of the mode against - * an integer pointer constant. + * a pointer to apr_crypto_block_key_mode_t. * * @param modes - hashtable of key modes keyed to constants. * @param f - encryption context @@ -378,57 +381,13 @@ static apr_status_t crypto_get_block_key_modes(apr_hash_t **modes, return APR_SUCCESS; } -/** - * @brief Create a key from the given passphrase. By default, the PBKDF2 - * algorithm is used to generate the key from the passphrase. It is expected - * that the same pass phrase will generate the same key, regardless of the - * backend crypto platform used. The key is cleaned up when the context - * is cleaned, and may be reused with multiple encryption or decryption - * operations. - * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If - * *key is not NULL, *key must point at a previously created structure. - * @param key The key returned, see note. - * @param ivSize The size of the initialisation vector will be returned, based - * on whether an IV is relevant for this type of crypto. - * @param pass The passphrase to use. - * @param passLen The passphrase length in bytes - * @param salt The salt to use. - * @param saltLen The salt length in bytes - * @param type 3DES_192, AES_128, AES_192, AES_256. - * @param mode Electronic Code Book / Cipher Block Chaining. - * @param doPad Pad if necessary. - * @param iterations Iteration count - * @param f The context to use. - * @param p The pool to use. - * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend - * error occurred while generating the key. APR_ENOCIPHER if the type or mode - * is not supported by the particular backend. APR_EKEYTYPE if the key type is - * not known. APR_EPADDING if padding was requested but is not supported. - * APR_ENOTIMPL if not implemented. +/* + * Work out which mechanism to use. */ -static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, - const char *pass, apr_size_t passLen, const unsigned char * salt, - apr_size_t saltLen, const apr_crypto_block_key_type_e type, - const apr_crypto_block_key_mode_e mode, const int doPad, - const int iterations, const apr_crypto_t *f, apr_pool_t *p) +static apr_status_t crypto_cipher_mechanism(apr_crypto_key_t *key, + const apr_crypto_block_key_type_e type, + const apr_crypto_block_key_mode_e mode, const int doPad) { - apr_status_t rv = APR_SUCCESS; - PK11SlotInfo * slot; - SECItem passItem; - SECItem saltItem; - SECAlgorithmID *algid; - void *wincx = NULL; /* what is wincx? */ - apr_crypto_key_t *key = *k; - - if (!key) { - *k = key = apr_array_push(f->keys); - } - if (!key) { - return APR_ENOMEM; - } - - key->f = f; - key->provider = f->provider; /* decide on what cipher mechanism we will be using */ switch (type) { @@ -483,13 +442,262 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, if (doPad) { CK_MECHANISM_TYPE paddedMech; paddedMech = PK11_GetPadMechanism(key->cipherMech); - if (CKM_INVALID_MECHANISM == paddedMech || key->cipherMech - == paddedMech) { + if (CKM_INVALID_MECHANISM == paddedMech + || key->cipherMech == paddedMech) { return APR_EPADDING; } key->cipherMech = paddedMech; } + key->ivSize = PK11_GetIVLength(key->cipherMech); + + return APR_SUCCESS; +} + +/** + * @brief Create a key from the provided secret or passphrase. The key is cleaned + * up when the context is cleaned, and may be reused with multiple encryption + * or decryption operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param key The key returned, see note. + * @param rec The key record, from which the key will be derived. + * @param f The context to use. + * @param p The pool to use. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_key(apr_crypto_key_t **k, + const apr_crypto_key_rec_t *rec, const apr_crypto_t *f, apr_pool_t *p) +{ + apr_status_t rv = APR_SUCCESS; + PK11SlotInfo *slot, *tslot; + PK11SymKey *tkey; + SECItem secretItem; + SECItem wrappedItem; + SECItem *secParam; + PK11Context *ctx; + SECStatus s; + SECItem passItem; + SECItem saltItem; + SECAlgorithmID *algid; + void *wincx = NULL; /* what is wincx? */ + apr_crypto_key_t *key; + int blockSize; + int remainder; + + key = *k; + if (!key) { + *k = key = apr_array_push(f->keys); + } + if (!key) { + return APR_ENOMEM; + } + + key->f = f; + key->provider = f->provider; + + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad); + if (APR_SUCCESS != rv) { + return rv; + } + + switch (rec->ktype) { + + case APR_CRYPTO_KTYPE_PASSPHRASE: { + + /* Turn the raw passphrase and salt into SECItems */ + passItem.data = (unsigned char*) rec->k.passphrase.pass; + passItem.len = rec->k.passphrase.passLen; + saltItem.data = (unsigned char*) rec->k.passphrase.salt; + saltItem.len = rec->k.passphrase.saltLen; + + /* generate the key */ + /* pbeAlg and cipherAlg are the same. */ + algid = PK11_CreatePBEV2AlgorithmID(key->cipherOid, key->cipherOid, + SEC_OID_HMAC_SHA1, key->keyLength, + rec->k.passphrase.iterations, &saltItem); + if (algid) { + slot = PK11_GetBestSlot(key->cipherMech, wincx); + if (slot) { + key->symKey = PK11_PBEKeyGen(slot, algid, &passItem, PR_FALSE, + wincx); + PK11_FreeSlot(slot); + } + SECOID_DestroyAlgorithmID(algid, PR_TRUE); + } + + break; + } + + case APR_CRYPTO_KTYPE_SECRET: { + + /* + * NSS is by default in FIPS mode, which disallows the use of unencrypted + * symmetrical keys. As per http://permalink.gmane.org/gmane.comp.mozilla.crypto/7947 + * we do the following: + * + * 1. Generate a (temporary) symmetric key in NSS. + * 2. Use that symmetric key to encrypt your symmetric key as data. + * 3. Unwrap your wrapped symmetric key, using the symmetric key + * you generated in Step 1 as the unwrapping key. + * + * http://permalink.gmane.org/gmane.comp.mozilla.crypto/7947 + */ + + /* generate the key */ + slot = PK11_GetBestSlot(key->cipherMech, NULL); + if (slot) { + unsigned char data[BUFFER_SIZE]; + + /* sanity check - key correct size? */ + if (rec->k.secret.secretLen != key->keyLength) { + PK11_FreeSlot(slot); + return APR_EKEYLENGTH; + } + + tslot = PK11_GetBestSlot(CKM_AES_ECB, NULL); + if (tslot) { + + /* generate a temporary wrapping key */ + tkey = PK11_KeyGen(tslot, CKM_AES_ECB, 0, PK11_GetBestKeyLength(tslot, CKM_AES_ECB), 0); + + /* prepare the key to wrap */ + secretItem.data = (unsigned char *) rec->k.secret.secret; + secretItem.len = rec->k.secret.secretLen; + + /* ensure our key matches the blocksize */ + secParam = PK11_GenerateNewParam(CKM_AES_ECB, tkey); + blockSize = PK11_GetBlockSize(CKM_AES_ECB, secParam); + remainder = rec->k.secret.secretLen % blockSize; + if (remainder) { + secretItem.data = + apr_pcalloc(p, rec->k.secret.secretLen + remainder); + apr_crypto_clear(p, secretItem.data, + rec->k.secret.secretLen); + memcpy(secretItem.data, rec->k.secret.secret, + rec->k.secret.secretLen); + secretItem.len += remainder; + } + + /* prepare a space for the wrapped key */ + wrappedItem.data = data; + + /* wrap the key */ + ctx = PK11_CreateContextBySymKey(CKM_AES_ECB, CKA_ENCRYPT, tkey, + secParam); + if (ctx) { + s = PK11_CipherOp(ctx, wrappedItem.data, + (int *) (&wrappedItem.len), BUFFER_SIZE, + secretItem.data, secretItem.len); + if (s == SECSuccess) { + + /* unwrap the key again */ + key->symKey = PK11_UnwrapSymKeyWithFlags(tkey, + CKM_AES_ECB, NULL, &wrappedItem, + key->cipherMech, CKA_ENCRYPT, + rec->k.secret.secretLen, 0); + + } + + PK11_DestroyContext(ctx, PR_TRUE); + } + + /* clean up */ + SECITEM_FreeItem(secParam, PR_TRUE); + PK11_FreeSymKey(tkey); + PK11_FreeSlot(tslot); + + } + + PK11_FreeSlot(slot); + } + + break; + } + + default: { + + return APR_ENOKEY; + + } + } + + /* sanity check? */ + if (!key->symKey) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + f->result->rc = perr; + f->result->msg = PR_ErrorToName(perr); + rv = APR_ENOKEY; + } + } + + return rv; +} + +/** + * @brief Create a key from the given passphrase. By default, the PBKDF2 + * algorithm is used to generate the key from the passphrase. It is expected + * that the same pass phrase will generate the same key, regardless of the + * backend crypto platform used. The key is cleaned up when the context + * is cleaned, and may be reused with multiple encryption or decryption + * operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param key The key returned, see note. + * @param ivSize The size of the initialisation vector will be returned, based + * on whether an IV is relevant for this type of crypto. + * @param pass The passphrase to use. + * @param passLen The passphrase length in bytes + * @param salt The salt to use. + * @param saltLen The salt length in bytes + * @param type 3DES_192, AES_128, AES_192, AES_256. + * @param mode Electronic Code Book / Cipher Block Chaining. + * @param doPad Pad if necessary. + * @param iterations Iteration count + * @param f The context to use. + * @param p The pool to use. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, + const char *pass, apr_size_t passLen, const unsigned char * salt, + apr_size_t saltLen, const apr_crypto_block_key_type_e type, + const apr_crypto_block_key_mode_e mode, const int doPad, + const int iterations, const apr_crypto_t *f, apr_pool_t *p) +{ + apr_status_t rv = APR_SUCCESS; + PK11SlotInfo * slot; + SECItem passItem; + SECItem saltItem; + SECAlgorithmID *algid; + void *wincx = NULL; /* what is wincx? */ + apr_crypto_key_t *key = *k; + + if (!key) { + *k = key = apr_array_push(f->keys); + } + if (!key) { + return APR_ENOMEM; + } + + key->f = f; + key->provider = f->provider; + + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, type, mode, doPad); + if (APR_SUCCESS != rv) { + return rv; + } + /* Turn the raw passphrase and salt into SECItems */ passItem.data = (unsigned char*) pass; passItem.len = passLen; @@ -520,7 +728,6 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, } } - key->ivSize = PK11_GetIVLength(key->cipherMech); if (ivSize) { *ivSize = key->ivSize; } @@ -881,7 +1088,8 @@ APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_nss_driver = { crypto_block_encrypt_init, crypto_block_encrypt, crypto_block_encrypt_finish, crypto_block_decrypt_init, crypto_block_decrypt, crypto_block_decrypt_finish, - crypto_block_cleanup, crypto_cleanup, crypto_shutdown, crypto_error + crypto_block_cleanup, crypto_cleanup, crypto_shutdown, crypto_error, + crypto_key }; #endif diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index debc4111b6b..3f4dddb3712 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -72,13 +72,20 @@ struct apr_crypto_block_t { int doPad; }; -static int key_3des_192 = APR_KEY_3DES_192; -static int key_aes_128 = APR_KEY_AES_128; -static int key_aes_192 = APR_KEY_AES_192; -static int key_aes_256 = APR_KEY_AES_256; +static struct apr_crypto_block_key_type_t key_types[] = +{ +{ APR_KEY_3DES_192, 24, 8, 8 }, +{ APR_KEY_AES_128, 16, 16, 16 }, +{ APR_KEY_AES_192, 24, 16, 16 }, +{ APR_KEY_AES_256, 32, 16, 16 } }; + +static struct apr_crypto_block_key_mode_t key_modes[] = +{ +{ APR_MODE_ECB }, +{ APR_MODE_CBC } }; -static int mode_ecb = APR_MODE_ECB; -static int mode_cbc = APR_MODE_CBC; +/* sufficient space to wrap a key */ +#define BUFFER_SIZE 128 /** * Fetch the most recent error from this driver. @@ -270,17 +277,17 @@ static apr_status_t crypto_make(apr_crypto_t **ff, if (!f->types) { return APR_ENOMEM; } - apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_3des_192)); - apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_aes_128)); - apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_aes_192)); - apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_aes_256)); + apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_types[0])); + apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_types[1])); + apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_types[2])); + apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_types[3])); f->modes = apr_hash_make(pool); if (!f->modes) { return APR_ENOMEM; } - apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(mode_ecb)); - apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(mode_cbc)); + apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(key_modes[0])); + apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(key_modes[1])); apr_pool_cleanup_register(pool, f, crypto_cleanup_helper, apr_pool_cleanup_null); @@ -303,7 +310,7 @@ static apr_status_t crypto_make(apr_crypto_t **ff, /** * @brief Get a hash table of key types, keyed by the name of the type against - * an integer pointer constant. + * a pointer to apr_crypto_block_key_type_t. * * @param types - hashtable of key types keyed to constants. * @param f - encryption context @@ -318,7 +325,7 @@ static apr_status_t crypto_get_block_key_types(apr_hash_t **types, /** * @brief Get a hash table of key modes, keyed by the name of the mode against - * an integer pointer constant. + * a pointer to apr_crypto_block_key_mode_t. * * @param modes - hashtable of key modes keyed to constants. * @param f - encryption context @@ -331,52 +338,13 @@ static apr_status_t crypto_get_block_key_modes(apr_hash_t **modes, return APR_SUCCESS; } -/** - * @brief Create a key from the given passphrase. By default, the PBKDF2 - * algorithm is used to generate the key from the passphrase. It is expected - * that the same pass phrase will generate the same key, regardless of the - * backend crypto platform used. The key is cleaned up when the context - * is cleaned, and may be reused with multiple encryption or decryption - * operations. - * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If - * *key is not NULL, *key must point at a previously created structure. - * @param key The key returned, see note. - * @param ivSize The size of the initialisation vector will be returned, based - * on whether an IV is relevant for this type of crypto. - * @param pass The passphrase to use. - * @param passLen The passphrase length in bytes - * @param salt The salt to use. - * @param saltLen The salt length in bytes - * @param type 3DES_192, AES_128, AES_192, AES_256. - * @param mode Electronic Code Book / Cipher Block Chaining. - * @param doPad Pad if necessary. - * @param iterations Iteration count - * @param f The context to use. - * @param p The pool to use. - * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend - * error occurred while generating the key. APR_ENOCIPHER if the type or mode - * is not supported by the particular backend. APR_EKEYTYPE if the key type is - * not known. APR_EPADDING if padding was requested but is not supported. - * APR_ENOTIMPL if not implemented. +/* + * Work out which mechanism to use. */ -static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, - const char *pass, apr_size_t passLen, const unsigned char * salt, - apr_size_t saltLen, const apr_crypto_block_key_type_e type, - const apr_crypto_block_key_mode_e mode, const int doPad, - const int iterations, const apr_crypto_t *f, apr_pool_t *p) +static apr_status_t crypto_cipher_mechanism(apr_crypto_key_t *key, + const apr_crypto_block_key_type_e type, + const apr_crypto_block_key_mode_e mode, const int doPad, apr_pool_t *p) { - apr_crypto_key_t *key = *k; - - if (!key) { - *k = key = apr_array_push(f->keys); - } - if (!key) { - return APR_ENOMEM; - } - - key->f = f; - key->provider = f->provider; - /* determine the cipher to be used */ switch (type) { @@ -438,6 +406,148 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, } apr_crypto_clear(p, key->key, key->keyLen); + return APR_SUCCESS; +} + +/** + * @brief Create a key from the provided secret or passphrase. The key is cleaned + * up when the context is cleaned, and may be reused with multiple encryption + * or decryption operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param key The key returned, see note. + * @param rec The key record, from which the key will be derived. + * @param f The context to use. + * @param p The pool to use. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_key(apr_crypto_key_t **k, + const apr_crypto_key_rec_t *rec, const apr_crypto_t *f, apr_pool_t *p) +{ + apr_crypto_key_t *key = *k; + apr_status_t rv; + + if (!key) { + *k = key = apr_array_push(f->keys); + } + if (!key) { + return APR_ENOMEM; + } + + key->f = f; + key->provider = f->provider; + + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad, p); + if (APR_SUCCESS != rv) { + return rv; + } + + switch (rec->ktype) { + + case APR_CRYPTO_KTYPE_PASSPHRASE: { + + /* generate the key */ + if (PKCS5_PBKDF2_HMAC_SHA1(rec->k.passphrase.pass, + rec->k.passphrase.passLen, + (unsigned char *) rec->k.passphrase.salt, + rec->k.passphrase.saltLen, rec->k.passphrase.iterations, + key->keyLen, key->key) == 0) { + return APR_ENOKEY; + } + + break; + } + + case APR_CRYPTO_KTYPE_SECRET: { + + /* sanity check - key correct size? */ + if (rec->k.secret.secretLen != key->keyLen) { + return APR_EKEYLENGTH; + } + + /* copy the key */ + memcpy(key->key, rec->k.secret.secret, rec->k.secret.secretLen); + + break; + } + + default: { + + return APR_ENOKEY; + + } + } + + key->doPad = rec->pad; + + /* note: openssl incorrectly returns non zero IV size values for ECB + * algorithms, so work around this by ignoring the IV size. + */ + if (APR_MODE_ECB != rec->mode) { + key->ivSize = EVP_CIPHER_iv_length(key->cipher); + } + + return APR_SUCCESS; +} + +/** + * @brief Create a key from the given passphrase. By default, the PBKDF2 + * algorithm is used to generate the key from the passphrase. It is expected + * that the same pass phrase will generate the same key, regardless of the + * backend crypto platform used. The key is cleaned up when the context + * is cleaned, and may be reused with multiple encryption or decryption + * operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param key The key returned, see note. + * @param ivSize The size of the initialisation vector will be returned, based + * on whether an IV is relevant for this type of crypto. + * @param pass The passphrase to use. + * @param passLen The passphrase length in bytes + * @param salt The salt to use. + * @param saltLen The salt length in bytes + * @param type 3DES_192, AES_128, AES_192, AES_256. + * @param mode Electronic Code Book / Cipher Block Chaining. + * @param doPad Pad if necessary. + * @param iterations Iteration count + * @param f The context to use. + * @param p The pool to use. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, + const char *pass, apr_size_t passLen, const unsigned char * salt, + apr_size_t saltLen, const apr_crypto_block_key_type_e type, + const apr_crypto_block_key_mode_e mode, const int doPad, + const int iterations, const apr_crypto_t *f, apr_pool_t *p) +{ + apr_crypto_key_t *key = *k; + apr_status_t rv; + + if (!key) { + *k = key = apr_array_push(f->keys); + } + if (!key) { + return APR_ENOMEM; + } + + key->f = f; + key->provider = f->provider; + + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, type, mode, doPad, p); + if (APR_SUCCESS != rv) { + return rv; + } + /* generate the key */ if (PKCS5_PBKDF2_HMAC_SHA1(pass, passLen, (unsigned char *) salt, saltLen, iterations, key->keyLen, key->key) == 0) { @@ -826,7 +936,8 @@ APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_openssl_driver = { crypto_block_encrypt_init, crypto_block_encrypt, crypto_block_encrypt_finish, crypto_block_decrypt_init, crypto_block_decrypt, crypto_block_decrypt_finish, - crypto_block_cleanup, crypto_cleanup, crypto_shutdown, crypto_error + crypto_block_cleanup, crypto_cleanup, crypto_shutdown, crypto_error, + crypto_key }; #endif diff --git a/include/apr_crypto.h b/include/apr_crypto.h index f835ea6de1c..d76b1d629c3 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -127,6 +127,48 @@ typedef struct apr_crypto_config_t apr_crypto_config_t; typedef struct apr_crypto_key_t apr_crypto_key_t; typedef struct apr_crypto_block_t apr_crypto_block_t; +typedef struct apr_crypto_block_key_type_t { + apr_crypto_block_key_type_e type; + int keysize; + int blocksize; + int ivsize; +} apr_crypto_block_key_type_t; + +typedef struct apr_crypto_block_key_mode_t { + apr_crypto_block_key_mode_e mode; +} apr_crypto_block_key_mode_t; + +typedef struct apr_crypto_passphrase_t { + const char *pass; + apr_size_t passLen; + const unsigned char * salt; + apr_size_t saltLen; + int iterations; +} apr_crypto_passphrase_t; + +typedef struct apr_crypto_secret_t { + const unsigned char *secret; + apr_size_t secretLen; +} apr_crypto_secret_t; + +typedef enum { + /** Key is derived from a passphrase */ + APR_CRYPTO_KTYPE_PASSPHRASE = 1, + /** Key is derived from a raw key */ + APR_CRYPTO_KTYPE_SECRET = 2, +} apr_crypto_key_type; + +typedef struct apr_crypto_key_rec_t { + apr_crypto_key_type ktype; + apr_crypto_block_key_type_e type; + apr_crypto_block_key_mode_e mode; + int pad; + union { + apr_crypto_passphrase_t passphrase; + apr_crypto_secret_t secret; + } k; +} apr_crypto_key_rec_t; + /** * @brief Perform once-only initialisation. Call once only. * @@ -208,7 +250,8 @@ APR_DECLARE(apr_status_t) /** * @brief Get a hash table of key types, keyed by the name of the type against - * an integer pointer constant. + * a pointer to apr_crypto_block_key_type_t, which in turn begins with an + * integer. * * @param types - hashtable of key types keyed to constants. * @param f - encryption context @@ -219,7 +262,8 @@ APR_DECLARE(apr_status_t) apr_crypto_get_block_key_types(apr_hash_t **types, /** * @brief Get a hash table of key modes, keyed by the name of the mode against - * an integer pointer constant. + * a pointer to apr_crypto_block_key_mode_t, which in turn begins with an + * integer. * * @param modes - hashtable of key modes keyed to constants. * @param f - encryption context @@ -228,6 +272,25 @@ APR_DECLARE(apr_status_t) apr_crypto_get_block_key_types(apr_hash_t **types, APR_DECLARE(apr_status_t) apr_crypto_get_block_key_modes(apr_hash_t **modes, const apr_crypto_t *f); +/** + * @brief Create a key from the provided secret or passphrase. The key is cleaned + * up when the context is cleaned, and may be reused with multiple encryption + * or decryption operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param key The key returned, see note. + * @param rec The key record, from which the key will be derived. + * @param f The context to use. + * @param p The pool to use. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ +APR_DECLARE(apr_status_t) apr_crypto_key(apr_crypto_key_t **key, + const apr_crypto_key_rec_t *rec, const apr_crypto_t *f, apr_pool_t *p); + /** * @brief Create a key from the given passphrase. By default, the PBKDF2 * algorithm is used to generate the key from the passphrase. It is expected @@ -255,6 +318,7 @@ APR_DECLARE(apr_status_t) apr_crypto_get_block_key_modes(apr_hash_t **modes, * is not supported by the particular backend. APR_EKEYTYPE if the key type is * not known. APR_EPADDING if padding was requested but is not supported. * APR_ENOTIMPL if not implemented. + * @deprecated Replaced by apr_crypto_key(). */ APR_DECLARE(apr_status_t) apr_crypto_passphrase(apr_crypto_key_t **key, apr_size_t *ivSize, const char *pass, apr_size_t passLen, diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index 5da92e55887..1ea838bfb7d 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -59,7 +59,7 @@ struct apr_crypto_driver_t { /** * @brief Get a hash table of key types, keyed by the name of the type against - * an integer pointer constant. + * a pointer to apr_crypto_block_key_type_t. * * @param types - hashtable of key types keyed to constants. * @param f - encryption context @@ -70,7 +70,7 @@ struct apr_crypto_driver_t { /** * @brief Get a hash table of key modes, keyed by the name of the mode against - * an integer pointer constant. + * a pointer to apr_crypto_block_key_mode_t. * * @param modes - hashtable of key modes keyed to constants. * @param f - encryption context @@ -267,6 +267,25 @@ struct apr_crypto_driver_t { */ apr_status_t (*error)(const apu_err_t **result, const apr_crypto_t *f); + /** + * @brief Create a key from the provided secret or passphrase. The key is cleaned + * up when the context is cleaned, and may be reused with multiple encryption + * or decryption operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param key The key returned, see note. + * @param rec The key record, from which the key will be derived. + * @param f The context to use. + * @param p The pool to use. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ + apr_status_t (*key)(apr_crypto_key_t **key, const apr_crypto_key_rec_t *rec, + const apr_crypto_t *f, apr_pool_t *p); + }; #endif diff --git a/test/testcrypto.c b/test/testcrypto.c index 58428d243e5..7d66feec664 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -42,24 +42,24 @@ static const apr_crypto_driver_t *get_driver(abts_case *tc, apr_pool_t *pool, rv = apr_crypto_get_driver(&driver, name, params, &result, pool); if (APR_ENOTIMPL == rv) { ABTS_NOT_IMPL(tc, - apr_psprintf(pool, "\nCrypto driver '%s' not implemented, skipping", (char *)name)); + apr_psprintf(pool, "Crypto driver '%s' not implemented", (char *)name)); return NULL; } if (APR_EDSOOPEN == rv) { ABTS_NOT_IMPL(tc, - apr_psprintf(pool, "\nCrypto driver '%s' DSO could not be opened, skipping", (char *)name)); + apr_psprintf(pool, "Crypto driver '%s' DSO could not be opened", (char *)name)); return NULL; } if (APR_SUCCESS != rv && result) { char err[1024]; apr_strerror(rv, err, sizeof(err) - 1); - fprintf(stderr, "\nget_driver error %d: %s: '%s' native error %d: %s (%s)\n", + fprintf(stderr, "get_driver error %d: %s: '%s' native error %d: %s (%s),", rv, err, name, result->rc, result->reason ? result->reason : "", result->msg ? result->msg : ""); } - ABTS_ASSERT(tc, apr_psprintf(pool, "\nfailed to apr_crypto_get_driver for '%s' with %d", + ABTS_ASSERT(tc, apr_psprintf(pool, "failed to apr_crypto_get_driver for '%s' with %d", name, rv), rv == APR_SUCCESS); - ABTS_ASSERT(tc, "\napr_crypto_get_driver returned NULL", driver != NULL); + ABTS_ASSERT(tc, "apr_crypto_get_driver returned NULL", driver != NULL); if (!driver || rv) { return NULL; } @@ -73,7 +73,7 @@ static const apr_crypto_driver_t *get_nss_driver(abts_case *tc, { /* initialise NSS */ - return get_driver(tc, pool, "nss", "dir=data"); + return get_driver(tc, pool, "nss", ""); } @@ -111,6 +111,59 @@ static apr_crypto_t *make(abts_case *tc, apr_pool_t *pool, } +static const apr_crypto_key_t *keysecret(abts_case *tc, apr_pool_t *pool, + const apr_crypto_driver_t *driver, const apr_crypto_t *f, + apr_crypto_block_key_type_e type, apr_crypto_block_key_mode_e mode, + int doPad, apr_size_t secretLen, const char *description) +{ + apr_crypto_key_t *key = NULL; + const apu_err_t *result = NULL; + apr_crypto_key_rec_t *rec = apr_pcalloc(pool, sizeof(apr_crypto_key_rec_t)); + apr_status_t rv; + + if (!f) { + return NULL; + } + + rec->ktype = APR_CRYPTO_KTYPE_SECRET; + rec->type = type; + rec->mode = mode; + rec->pad = doPad; + rec->k.secret.secret = apr_pcalloc(pool, secretLen); + rec->k.secret.secretLen = secretLen; + + /* init the passphrase */ + rv = apr_crypto_key(&key, rec, f, pool); + if (APR_ENOCIPHER == rv) { + apr_crypto_error(&result, f); + ABTS_NOT_IMPL(tc, + apr_psprintf(pool, "skipped: %s %s key return APR_ENOCIPHER: error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", result->msg ? result->msg : "")); + return NULL; + } + else { + if (APR_SUCCESS != rv) { + apr_crypto_error(&result, f); + fprintf(stderr, "key: %s %s apr error %d / native error %d: %s (%s)\n", + description, apr_crypto_driver_name(driver), rv, result->rc, + result->reason ? result->reason : "", + result->msg ? result->msg : ""); + } + ABTS_ASSERT(tc, "apr_crypto_key returned APR_EKEYLENGTH", rv != APR_EKEYLENGTH); + ABTS_ASSERT(tc, "apr_crypto_key returned APR_ENOKEY", rv != APR_ENOKEY); + ABTS_ASSERT(tc, "apr_crypto_key returned APR_EPADDING", + rv != APR_EPADDING); + ABTS_ASSERT(tc, "apr_crypto_key returned APR_EKEYTYPE", + rv != APR_EKEYTYPE); + ABTS_ASSERT(tc, "failed to apr_crypto_key", rv == APR_SUCCESS); + ABTS_ASSERT(tc, "apr_crypto_key returned NULL context", key != NULL); + } + if (rv) { + return NULL; + } + return key; + +} + static const apr_crypto_key_t *passphrase(abts_case *tc, apr_pool_t *pool, const apr_crypto_driver_t *driver, const apr_crypto_t *f, apr_crypto_block_key_type_e type, apr_crypto_block_key_mode_e mode, @@ -142,8 +195,8 @@ static const apr_crypto_key_t *passphrase(abts_case *tc, apr_pool_t *pool, else { if (APR_SUCCESS != rv) { apr_crypto_error(&result, f); - fprintf(stderr, "passphrase: %s %s native error %d: %s (%s)\n", - description, apr_crypto_driver_name(driver), result->rc, + fprintf(stderr, "passphrase: %s %s apr error %d / native error %d: %s (%s)\n", + description, apr_crypto_driver_name(driver), rv, result->rc, result->reason ? result->reason : "", result->msg ? result->msg : ""); } @@ -160,6 +213,64 @@ static const apr_crypto_key_t *passphrase(abts_case *tc, apr_pool_t *pool, } +static const apr_crypto_key_t *keypassphrase(abts_case *tc, apr_pool_t *pool, + const apr_crypto_driver_t *driver, const apr_crypto_t *f, + apr_crypto_block_key_type_e type, apr_crypto_block_key_mode_e mode, + int doPad, const char *description) +{ + + apr_crypto_key_t *key = NULL; + const apu_err_t *result = NULL; + const char *pass = "secret"; + const char *salt = "salt"; + apr_crypto_key_rec_t *rec = apr_pcalloc(pool, sizeof(apr_crypto_key_rec_t)); + apr_status_t rv; + + if (!f) { + return NULL; + } + + rec->ktype = APR_CRYPTO_KTYPE_PASSPHRASE; + rec->type = type; + rec->mode = mode; + rec->pad = doPad; + rec->k.passphrase.pass = pass; + rec->k.passphrase.passLen = strlen(pass); + rec->k.passphrase.salt = (unsigned char *)salt; + rec->k.passphrase.saltLen = strlen(salt); + rec->k.passphrase.iterations = 4096; + + /* init the passphrase */ + rv = apr_crypto_key(&key, rec, f, pool); + if (APR_ENOCIPHER == rv) { + apr_crypto_error(&result, f); + ABTS_NOT_IMPL(tc, apr_psprintf(pool, + "skipped: %s %s key passphrase return APR_ENOCIPHER: error %d: %s (%s)\n", + description, apr_crypto_driver_name(driver), result->rc, + result->reason ? result->reason : "", result->msg ? result->msg : "")); + return NULL; + } + else { + if (APR_SUCCESS != rv) { + apr_crypto_error(&result, f); + fprintf(stderr, "key passphrase: %s %s apr error %d / native error %d: %s (%s)\n", + description, apr_crypto_driver_name(driver), rv, result->rc, + result->reason ? result->reason : "", + result->msg ? result->msg : ""); + } + ABTS_ASSERT(tc, "apr_crypto_key returned APR_ENOKEY", rv != APR_ENOKEY); + ABTS_ASSERT(tc, "apr_crypto_key returned APR_EPADDING", rv != APR_EPADDING); + ABTS_ASSERT(tc, "apr_crypto_key returned APR_EKEYTYPE", rv != APR_EKEYTYPE); + ABTS_ASSERT(tc, "failed to apr_crypto_key", rv == APR_SUCCESS); + ABTS_ASSERT(tc, "apr_crypto_key returned NULL context", key != NULL); + } + if (rv) { + return NULL; + } + return key; + +} + static unsigned char *encrypt_block(abts_case *tc, apr_pool_t *pool, const apr_crypto_driver_t *driver, const apr_crypto_t *f, const apr_crypto_key_t *key, const unsigned char *in, @@ -349,7 +460,8 @@ static void crypto_block_cross(abts_case *tc, apr_pool_t *pool, const apr_crypto_driver_t **drivers, const apr_crypto_block_key_type_e type, const apr_crypto_block_key_mode_e mode, int doPad, - const unsigned char *in, apr_size_t inlen, const char *description) + const unsigned char *in, apr_size_t inlen, apr_size_t secretLen, + const char *description) { const apr_crypto_driver_t *driver1 = drivers[0]; const apr_crypto_driver_t *driver2 = drivers[1]; @@ -357,6 +469,10 @@ static void crypto_block_cross(abts_case *tc, apr_pool_t *pool, apr_crypto_t *f2 = NULL; const apr_crypto_key_t *key1 = NULL; const apr_crypto_key_t *key2 = NULL; + const apr_crypto_key_t *key3 = NULL; + const apr_crypto_key_t *key4 = NULL; + const apr_crypto_key_t *key5 = NULL; + const apr_crypto_key_t *key6 = NULL; unsigned char *cipherText = NULL; apr_size_t cipherTextLen = 0; @@ -378,7 +494,51 @@ static void crypto_block_cross(abts_case *tc, apr_pool_t *pool, if (cipherText && plainText) { if (memcmp(in, plainText, inlen)) { - fprintf(stderr, "cross mismatch: %s %s/%s\n", description, + fprintf(stderr, "passphrase cross mismatch: %s %s/%s\n", description, + apr_crypto_driver_name(driver1), apr_crypto_driver_name( + driver2)); + } + ABTS_STR_EQUAL(tc, (char *)in, (char *)plainText); + } + + key3 = keysecret(tc, pool, driver1, f1, type, mode, doPad, secretLen, description); + key4 = keysecret(tc, pool, driver2, f2, type, mode, doPad, secretLen, description); + + iv = NULL; + blockSize = 0; + cipherText = NULL; + plainText = NULL; + cipherText = encrypt_block(tc, pool, driver1, f1, key3, in, inlen, + &cipherText, &cipherTextLen, &iv, &blockSize, description); + plainText = decrypt_block(tc, pool, driver2, f2, key4, cipherText, + cipherTextLen, &plainText, &plainTextLen, iv, &blockSize, + description); + + if (cipherText && plainText) { + if (memcmp(in, plainText, inlen)) { + fprintf(stderr, "key secret cross mismatch: %s %s/%s\n", description, + apr_crypto_driver_name(driver1), apr_crypto_driver_name( + driver2)); + } + ABTS_STR_EQUAL(tc, (char *)in, (char *)plainText); + } + + key5 = keypassphrase(tc, pool, driver1, f1, type, mode, doPad, description); + key6 = keypassphrase(tc, pool, driver2, f2, type, mode, doPad, description); + + iv = NULL; + blockSize = 0; + cipherText = NULL; + plainText = NULL; + cipherText = encrypt_block(tc, pool, driver1, f1, key5, in, inlen, + &cipherText, &cipherTextLen, &iv, &blockSize, description); + plainText = decrypt_block(tc, pool, driver2, f2, key6, cipherText, + cipherTextLen, &plainText, &plainTextLen, iv, &blockSize, + description); + + if (cipherText && plainText) { + if (memcmp(in, plainText, inlen)) { + fprintf(stderr, "key passphrase cross mismatch: %s %s/%s\n", description, apr_crypto_driver_name(driver1), apr_crypto_driver_name( driver2)); } @@ -404,6 +564,63 @@ static void test_crypto_init(abts_case *tc, void *data) } +/** + * Simple test of OpenSSL key. + */ +static void test_crypto_key_openssl(abts_case *tc, void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *driver; + apr_crypto_t *f = NULL; + + apr_pool_create(&pool, NULL); + driver = get_openssl_driver(tc, pool); + + f = make(tc, pool, driver); + keysecret(tc, pool, driver, f, APR_KEY_AES_256, APR_MODE_CBC, 1, 32, + "KEY_AES_256/MODE_CBC"); + apr_pool_destroy(pool); + +} + +/** + * Simple test of NSS key. + */ +static void test_crypto_key_nss(abts_case *tc, void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *driver; + apr_crypto_t *f = NULL; + + apr_pool_create(&pool, NULL); + driver = get_nss_driver(tc, pool); + + f = make(tc, pool, driver); + keysecret(tc, pool, driver, f, APR_KEY_AES_256, APR_MODE_CBC, 1, 32, + "KEY_AES_256/MODE_CBC"); + apr_pool_destroy(pool); + +} + +/** + * Simple test of CommonCrypto key. + */ +static void test_crypto_key_commoncrypto(abts_case *tc, void *data) +{ + apr_pool_t *pool = NULL; + const apr_crypto_driver_t *driver; + apr_crypto_t *f = NULL; + + apr_pool_create(&pool, NULL); + driver = get_commoncrypto_driver(tc, pool); + + f = make(tc, pool, driver); + keysecret(tc, pool, driver, f, APR_KEY_AES_256, APR_MODE_CBC, 1, 32, + "KEY_AES_256/MODE_CBC"); + apr_pool_destroy(pool); + +} + /** * Simple test of OpenSSL block crypt. */ @@ -419,21 +636,21 @@ static void test_crypto_block_openssl(abts_case *tc, void *data) drivers[0] = get_openssl_driver(tc, pool); drivers[1] = get_openssl_driver(tc, pool); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, - in, inlen, "KEY_3DES_192/MODE_CBC"); + in, inlen, 24, "KEY_3DES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 0, - in, inlen, "KEY_3DES_192/MODE_ECB"); + in, inlen, 24, "KEY_3DES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_256/MODE_CBC"); + inlen, 32, "KEY_AES_256/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_256/MODE_ECB"); + inlen, 32, "KEY_AES_256/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_192/MODE_CBC"); + inlen, 24, "KEY_AES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_192/MODE_ECB"); + inlen, 24, "KEY_AES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_128/MODE_CBC"); + inlen, 16, "KEY_AES_128/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_128/MODE_ECB"); + inlen, 16, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); } @@ -453,21 +670,21 @@ static void test_crypto_block_nss(abts_case *tc, void *data) drivers[0] = get_nss_driver(tc, pool); drivers[1] = get_nss_driver(tc, pool); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, - in, inlen, "KEY_3DES_192/MODE_CBC"); + in, inlen, 24, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 0, in, inlen, "KEY_3DES_192/MODE_ECB"); */ crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_256/MODE_CBC"); + inlen, 32, "KEY_AES_256/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_256/MODE_ECB"); + inlen, 32, "KEY_AES_256/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_192/MODE_CBC"); + inlen, 24, "KEY_AES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_192/MODE_ECB"); + inlen, 24, "KEY_AES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_128/MODE_CBC"); + inlen, 16, "KEY_AES_128/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_128/MODE_ECB"); + inlen, 16, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); } @@ -487,21 +704,21 @@ static void test_crypto_block_commoncrypto(abts_case *tc, void *data) drivers[0] = get_commoncrypto_driver(tc, pool); drivers[1] = get_commoncrypto_driver(tc, pool); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, - in, inlen, "KEY_3DES_192/MODE_CBC"); + in, inlen, 24, "KEY_3DES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 0, - in, inlen, "KEY_3DES_192/MODE_ECB"); + in, inlen, 24, "KEY_3DES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_256/MODE_CBC"); + inlen, 32, "KEY_AES_256/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_256/MODE_ECB"); + inlen, 32, "KEY_AES_256/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_192/MODE_CBC"); + inlen, 24, "KEY_AES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_192/MODE_ECB"); + inlen, 24, "KEY_AES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_128/MODE_CBC"); + inlen, 16, "KEY_AES_128/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_128/MODE_ECB"); + inlen, 16, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); } @@ -522,22 +739,22 @@ static void test_crypto_block_nss_openssl(abts_case *tc, void *data) drivers[1] = get_openssl_driver(tc, pool); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, - in, inlen, "KEY_3DES_192/MODE_CBC"); + in, inlen, 24, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ - /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 0, in, inlen, "KEY_3DES_192/MODE_ECB"); */ + /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 0, in, inlen, 24, "KEY_3DES_192/MODE_ECB"); */ crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_256/MODE_CBC"); + inlen, 32, "KEY_AES_256/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_256/MODE_ECB"); + inlen, 32, "KEY_AES_256/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_192/MODE_CBC"); + inlen, 24, "KEY_AES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_192/MODE_ECB"); + inlen, 24, "KEY_AES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_128/MODE_CBC"); + inlen, 16, "KEY_AES_128/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_128/MODE_ECB"); + inlen, 16, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); } @@ -557,23 +774,23 @@ static void test_crypto_block_openssl_nss(abts_case *tc, void *data) drivers[0] = get_openssl_driver(tc, pool); drivers[1] = get_nss_driver(tc, pool); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, - in, inlen, "KEY_3DES_192/MODE_CBC"); + in, inlen, 24, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ - /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 0, in, inlen, "KEY_3DES_192/MODE_ECB"); */ + /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 0, in, inlen, 24, "KEY_3DES_192/MODE_ECB"); */ crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_256/MODE_CBC"); + inlen, 32, "KEY_AES_256/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_256/MODE_ECB"); + inlen, 32, "KEY_AES_256/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_192/MODE_CBC"); + inlen, 24, "KEY_AES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_192/MODE_ECB"); + inlen, 24, "KEY_AES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_128/MODE_CBC"); + inlen, 16, "KEY_AES_128/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_128/MODE_ECB"); + inlen, 16, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); } @@ -595,21 +812,21 @@ static void test_crypto_block_openssl_commoncrypto(abts_case *tc, void *data) drivers[1] = get_commoncrypto_driver(tc, pool); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, in, - inlen, "KEY_3DES_192/MODE_CBC"); + inlen, 24, "KEY_3DES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 0, in, - inlen, "KEY_3DES_192/MODE_ECB"); + inlen, 24, "KEY_3DES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_256/MODE_CBC"); + inlen, 32, "KEY_AES_256/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_256/MODE_ECB"); + inlen, 32, "KEY_AES_256/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_192/MODE_CBC"); + inlen, 24, "KEY_AES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_192/MODE_ECB"); + inlen, 24, "KEY_AES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_128/MODE_CBC"); + inlen, 16, "KEY_AES_128/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_128/MODE_ECB"); + inlen, 16, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); } @@ -631,21 +848,21 @@ static void test_crypto_block_commoncrypto_openssl(abts_case *tc, void *data) drivers[1] = get_openssl_driver(tc, pool); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 0, in, - inlen, "KEY_3DES_192/MODE_CBC"); + inlen, 24, "KEY_3DES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 0, in, - inlen, "KEY_3DES_192/MODE_ECB"); + inlen, 24, "KEY_3DES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_256/MODE_CBC"); + inlen, 32, "KEY_AES_256/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_256/MODE_ECB"); + inlen, 32, "KEY_AES_256/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_192/MODE_CBC"); + inlen, 24, "KEY_AES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_192/MODE_ECB"); + inlen, 24, "KEY_AES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 0, in, - inlen, "KEY_AES_128/MODE_CBC"); + inlen, 16, "KEY_AES_128/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 0, in, - inlen, "KEY_AES_128/MODE_ECB"); + inlen, 16, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); } @@ -666,21 +883,21 @@ static void test_crypto_block_openssl_pad(abts_case *tc, void *data) drivers[1] = get_openssl_driver(tc, pool); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, - in, inlen, "KEY_3DES_192/MODE_CBC"); + in, inlen, 24, "KEY_3DES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 1, - in, inlen, "KEY_3DES_192/MODE_ECB"); + in, inlen, 24, "KEY_3DES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_256/MODE_CBC"); + inlen, 32, "KEY_AES_256/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 1, in, - inlen, "KEY_AES_256/MODE_ECB"); + inlen, 32, "KEY_AES_256/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_192/MODE_CBC"); + inlen, 24, "KEY_AES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 1, in, - inlen, "KEY_AES_192/MODE_ECB"); + inlen, 24, "KEY_AES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_128/MODE_CBC"); + inlen, 16, "KEY_AES_128/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 1, in, - inlen, "KEY_AES_128/MODE_ECB"); + inlen, 16, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); @@ -703,27 +920,27 @@ static void test_crypto_block_nss_pad(abts_case *tc, void *data) drivers[1] = get_nss_driver(tc, pool); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, - in, inlen, "KEY_3DES_192/MODE_CBC"); + in, inlen, 24, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ - /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 1, in, inlen, "KEY_3DES_192/MODE_ECB"); */ + /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 1, in, inlen, 24, "KEY_3DES_192/MODE_ECB"); */ crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_256/MODE_CBC"); + inlen, 32, "KEY_AES_256/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ - /*crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 1, in, inlen, "KEY_AES_256/MODE_ECB");*/ + /*crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 1, in, inlen, 32, "KEY_AES_256/MODE_ECB");*/ crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_192/MODE_CBC"); + inlen, 24, "KEY_AES_192/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ - /*crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_ECB, 1, in, inlen, "KEY_AES_192/MODE_ECB");*/ + /*crypto_block_cross(tc, pool, drivers, KEY_AES_192, MODE_ECB, 1, in, inlen, 24, "KEY_AES_192/MODE_ECB");*/ crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_128/MODE_CBC"); + inlen, 16, "KEY_AES_128/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ - /*crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_ECB, 1, in, inlen, "KEY_AES_128/MODE_ECB");*/ + /*crypto_block_cross(tc, pool, drivers, KEY_AES_128, MODE_ECB, 1, in, inlen, 16, "KEY_AES_128/MODE_ECB");*/ apr_pool_destroy(pool); @@ -745,21 +962,21 @@ static void test_crypto_block_commoncrypto_pad(abts_case *tc, void *data) drivers[1] = get_commoncrypto_driver(tc, pool); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, - in, inlen, "KEY_3DES_192/MODE_CBC"); + in, inlen, 24, "KEY_3DES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 1, - in, inlen, "KEY_3DES_192/MODE_ECB"); + in, inlen, 24, "KEY_3DES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_256/MODE_CBC"); + inlen, 32, "KEY_AES_256/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 1, in, - inlen, "KEY_AES_256/MODE_ECB"); + inlen, 32, "KEY_AES_256/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_192/MODE_CBC"); + inlen, 24, "KEY_AES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 1, in, - inlen, "KEY_AES_192/MODE_ECB"); + inlen, 24, "KEY_AES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_128/MODE_CBC"); + inlen, 16, "KEY_AES_128/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 1, in, - inlen, "KEY_AES_128/MODE_ECB"); + inlen, 16, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); @@ -781,30 +998,30 @@ static void test_crypto_block_nss_openssl_pad(abts_case *tc, void *data) drivers[1] = get_openssl_driver(tc, pool); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, - in, inlen, "KEY_3DES_192/MODE_CBC"); + in, inlen, 24, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ - /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 1, in, inlen, "KEY_3DES_192/MODE_ECB"); */ + /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 1, in, inlen, 24, "KEY_3DES_192/MODE_ECB"); */ crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_256/MODE_CBC"); + inlen, 32, "KEY_AES_256/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ - /*crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 1, in, inlen, "KEY_AES_256/MODE_ECB");*/ + /*crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 1, in, inlen, 32, "KEY_AES_256/MODE_ECB");*/ crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_192/MODE_CBC"); + inlen, 24, "KEY_AES_192/MODE_CBC"); /* KEY_AES_192 / MODE_ECB doesn't support padding on NSS */ /*crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 1, in, - inlen, "KEY_AES_192/MODE_ECB");*/ + inlen, 24, "KEY_AES_192/MODE_ECB");*/ crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_128/MODE_CBC"); + inlen, 16, "KEY_AES_128/MODE_CBC"); /* KEY_AES_192 / MODE_ECB doesn't support padding on NSS */ /*crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 1, in, - inlen, "KEY_AES_128/MODE_ECB");*/ + inlen, 16, "KEY_AES_128/MODE_ECB");*/ apr_pool_destroy(pool); @@ -825,30 +1042,30 @@ static void test_crypto_block_openssl_nss_pad(abts_case *tc, void *data) drivers[0] = get_openssl_driver(tc, pool); drivers[1] = get_nss_driver(tc, pool); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, - in, inlen, "KEY_3DES_192/MODE_CBC"); + in, inlen, 24, "KEY_3DES_192/MODE_CBC"); /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */ - /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 1, in, inlen, "KEY_3DES_192/MODE_ECB"); */ + /* crypto_block_cross(tc, pool, drivers, KEY_3DES_192, MODE_ECB, 1, in, inlen, 24, "KEY_3DES_192/MODE_ECB"); */ crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_256/MODE_CBC"); + inlen, 32, "KEY_AES_256/MODE_CBC"); /* KEY_AES_256 / MODE_ECB doesn't support padding on NSS */ - /*crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 1, in, inlen, "KEY_AES_256/MODE_ECB");*/ + /*crypto_block_cross(tc, pool, drivers, KEY_AES_256, MODE_ECB, 1, in, inlen, 32, "KEY_AES_256/MODE_ECB");*/ crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, inlen, - "KEY_AES_192/MODE_CBC"); + 24, "KEY_AES_192/MODE_CBC"); /* KEY_AES_192 / MODE_ECB doesn't support padding on NSS */ /*crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 1, in, inlen, - "KEY_AES_192/MODE_ECB");*/ + 24, "KEY_AES_192/MODE_ECB");*/ crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, inlen, - "KEY_AES_128/MODE_CBC"); + 16, "KEY_AES_128/MODE_CBC"); /* KEY_AES_128 / MODE_ECB doesn't support padding on NSS */ /*crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 1, in, inlen, - "KEY_AES_128/MODE_ECB");*/ + 16, "KEY_AES_128/MODE_ECB");*/ apr_pool_destroy(pool); @@ -872,21 +1089,21 @@ static void test_crypto_block_commoncrypto_openssl_pad(abts_case *tc, drivers[1] = get_openssl_driver(tc, pool); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, in, - inlen, "KEY_3DES_192/MODE_CBC"); + inlen, 24, "KEY_3DES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 1, in, - inlen, "KEY_3DES_192/MODE_ECB"); + inlen, 24, "KEY_3DES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_256/MODE_CBC"); + inlen, 32, "KEY_AES_256/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 1, in, - inlen, "KEY_AES_256/MODE_ECB"); + inlen, 32, "KEY_AES_256/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_192/MODE_CBC"); + inlen, 24, "KEY_AES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 1, in, - inlen, "KEY_AES_192/MODE_ECB"); + inlen, 24, "KEY_AES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_128/MODE_CBC"); + inlen, 16, "KEY_AES_128/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 1, in, - inlen, "KEY_AES_128/MODE_ECB"); + inlen, 16, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); @@ -910,21 +1127,21 @@ static void test_crypto_block_openssl_commoncrypto_pad(abts_case *tc, drivers[1] = get_commoncrypto_driver(tc, pool); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_CBC, 1, in, - inlen, "KEY_3DES_192/MODE_CBC"); + inlen, 24, "KEY_3DES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_3DES_192, APR_MODE_ECB, 1, in, - inlen, "KEY_3DES_192/MODE_ECB"); + inlen, 24, "KEY_3DES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_256/MODE_CBC"); + inlen, 32, "KEY_AES_256/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_256, APR_MODE_ECB, 1, in, - inlen, "KEY_AES_256/MODE_ECB"); + inlen, 32, "KEY_AES_256/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_192/MODE_CBC"); + inlen, 24, "KEY_AES_192/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_192, APR_MODE_ECB, 1, in, - inlen, "KEY_AES_192/MODE_ECB"); + inlen, 24, "KEY_AES_192/MODE_ECB"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_CBC, 1, in, - inlen, "KEY_AES_128/MODE_CBC"); + inlen, 16, "KEY_AES_128/MODE_CBC"); crypto_block_cross(tc, pool, drivers, APR_KEY_AES_128, APR_MODE_ECB, 1, in, - inlen, "KEY_AES_128/MODE_ECB"); + inlen, 16, "KEY_AES_128/MODE_ECB"); apr_pool_destroy(pool); @@ -1165,6 +1382,15 @@ abts_suite *testcrypto(abts_suite *suite) /* test simple init and shutdown */ abts_run_test(suite, test_crypto_init, NULL); + /* test key parsing - openssl */ + abts_run_test(suite, test_crypto_key_openssl, NULL); + + /* test key parsing - nss */ + abts_run_test(suite, test_crypto_key_nss, NULL); + + /* test key parsing - commoncrypto */ + abts_run_test(suite, test_crypto_key_commoncrypto, NULL); + /* test a simple encrypt / decrypt operation - openssl */ abts_run_test(suite, test_crypto_block_openssl, NULL); From 7ca939fa6a5ae7cb89a00696c47464e2a92ce989 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Wed, 10 Aug 2016 10:17:11 +0000 Subject: [PATCH 7603/7878] Reduce code drift between trunk and 1.6.x. Choose the more logical order which was introduced when backporting r899905 from trunk to 1.6.x as r1736521. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1755709 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testpoll.c b/test/testpoll.c index 588b98d6b4d..342f7090070 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -947,12 +947,12 @@ abts_suite *testpoll(abts_suite *suite) abts_run_test(suite, timeout_pollcb, NULL); abts_run_test(suite, timeout_pollin_pollcb, NULL); abts_run_test(suite, pollset_wakeup, NULL); + abts_run_test(suite, pollcb_wakeup, NULL); abts_run_test(suite, close_all_sockets, NULL); abts_run_test(suite, pollset_default, NULL); abts_run_test(suite, pollcb_default, NULL); abts_run_test(suite, justsleep, NULL); - abts_run_test(suite, pollcb_wakeup, NULL); return suite; } From 403224119030f1032c258192093f01622f1378e9 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 10 Aug 2016 13:27:00 +0000 Subject: [PATCH 7604/7878] apr_pollset_poll(): OS/2: follow up to r923311. Don't return APR_EINTR (woken up) unless we actually read something on the wakeup pipe (which we must drain), and also return APR_SUCCESS if at least some other event is available simultaneously. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1755740 13f79535-47bb-0310-9956-ffa450edef68 --- poll/os2/pollset.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c index e1263b5f211..3fe2d3eb4ea 100644 --- a/poll/os2/pollset.c +++ b/poll/os2/pollset.c @@ -266,15 +266,25 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, struct apr_sockaddr_t from_addr; char buffer[16]; apr_size_t buflen; - rc = APR_EINTR; - - do { + for (;;) { buflen = sizeof(buffer); - } while (apr_socket_recvfrom(&from_addr, pollset->wake_listen, MSG_DONTWAIT, buffer, &buflen) == APR_SUCCESS); + rv = apr_socket_recvfrom(&from_addr, pollset->wake_listen, + MSG_DONTWAIT, buffer, &buflen); + if (rv != APR_SUCCESS) { + break; + } + /* Woken up, drain the pipe still. */ + rc = APR_EINTR; + if (buflen < sizeof(buf)) { + break; + } + } } else { pollset->result_set[*num] = pollset->query_set[i]; pollset->result_set[*num].rtnevents = rtnevents; + /* Event(s) besides wakeup pipe. */ + rc = APR_SUCCESS; (*num)++; } } From d119f908d3aeab4a0ac2d9ef7d7e40f234703cf0 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 10 Aug 2016 13:45:13 +0000 Subject: [PATCH 7605/7878] apr_pollset_poll(): OS/2: follow up to r1755740. The UNIX socket is SOCK_DGRAM, so draining the pipe is another read().. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1755746 13f79535-47bb-0310-9956-ffa450edef68 --- poll/os2/pollset.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/poll/os2/pollset.c b/poll/os2/pollset.c index 3fe2d3eb4ea..2ec848105be 100644 --- a/poll/os2/pollset.c +++ b/poll/os2/pollset.c @@ -275,9 +275,6 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, } /* Woken up, drain the pipe still. */ rc = APR_EINTR; - if (buflen < sizeof(buf)) { - break; - } } } else { From 0c4bc1cb4198f80b238994fe2080dca5d38d8188 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 10 Aug 2016 14:41:08 +0000 Subject: [PATCH 7606/7878] apr_pollset_poll(): don't return a positive (nay negative in case of error) number of descriptors/events, before the returned descriptors are actually initialized. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1755758 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 4 ++-- poll/unix/kqueue.c | 3 ++- poll/unix/poll.c | 4 ++-- poll/unix/port.c | 2 +- poll/unix/select.c | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 23686d5f5af..af10145aa4d 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -258,14 +258,14 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, int ret; apr_status_t rv = APR_SUCCESS; + *num = 0; + if (timeout > 0) { timeout /= 1000; } ret = epoll_wait(pollset->p->epoll_fd, pollset->p->pollset, pollset->nalloc, timeout); - (*num) = ret; - if (ret < 0) { rv = apr_get_netos_error(); } diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 355ccba994e..d8043490388 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -259,6 +259,8 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, apr_status_t rv = APR_SUCCESS; apr_pollfd_t fd; + *num = 0; + if (timeout < 0) { tvptr = NULL; } @@ -270,7 +272,6 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, ret = kevent(pollset->p->kqueue_fd, NULL, 0, pollset->p->ke_set, pollset->p->setsize, tvptr); - (*num) = ret; if (ret < 0) { rv = apr_get_netos_error(); } diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 9f7ef241055..d8989aa430f 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -241,10 +241,11 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, int ret; apr_status_t rv = APR_SUCCESS; + *num = 0; + #ifdef WIN32 /* WSAPoll() requires at least one socket. */ if (pollset->nelts == 0) { - *num = 0; if (timeout > 0) { apr_sleep(timeout); return APR_TIMEUP; @@ -261,7 +262,6 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, } ret = poll(pollset->p->pollset, pollset->nelts, timeout); #endif - *num = 0; if (ret < 0) { return apr_get_netos_error(); } diff --git a/poll/unix/port.c b/poll/unix/port.c index ee770097006..67432937fc4 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -360,6 +360,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, apr_status_t rv = APR_SUCCESS; apr_pollfd_t fp; + *num = 0; nget = 1; pollset_lock_rings(); @@ -403,7 +404,6 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, port_associate within apr_pollset_add() */ apr_atomic_dec32(&pollset->p->waiting); - (*num) = nget; if (nget) { pollset_lock_rings(); diff --git a/poll/unix/select.c b/poll/unix/select.c index b12f12ec70c..214111a40e2 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -347,13 +347,14 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, fd_set readset, writeset, exceptset; apr_status_t rv = APR_SUCCESS; + *num = 0; + #ifdef WIN32 /* On Win32, select() must be presented with at least one socket to * poll on, or select() will return WSAEINVAL. So, we'll just * short-circuit and bail now. */ if (pollset->nelts == 0) { - (*num) = 0; if (timeout > 0) { apr_sleep(timeout); return APR_TIMEUP; @@ -385,7 +386,6 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, rs = select(pollset->p->maxfd + 1, &readset, &writeset, &exceptset, tvptr); - (*num) = rs; if (rs < 0) { return apr_get_netos_error(); } From efbb036a5d9537769755896edb979f1b055a91ac Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 11 Aug 2016 11:47:55 +0000 Subject: [PATCH 7607/7878] apr_os_proc_mutex_get_ex: win32: fix typo (s/mutex/pmutex/) leading to: locks\win32\proc_mutex.c(252): error C2065: 'mutex' : undeclared identifier Submitted by: Ivan Zhakov git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1755954 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/proc_mutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 9e227f762b5..b51f856c009 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -249,7 +249,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get_ex(apr_os_proc_mutex_t *ospmutex apr_proc_mutex_t *pmutex, apr_lockmech_e *mech) { - *ospmutex = mutex->handle; + *ospmutex = pmutex->handle; if (mech) { *mech = APR_LOCK_DEFAULT_TIMED; } From c72aba54218d32c76464d92aebbf65818c66c806 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Fri, 2 Sep 2016 18:46:35 +0000 Subject: [PATCH 7608/7878] clear the aiocb structure used for asyncio cancel The underlying syscall sanity checks some fields we don't later specify, possibly even some fields that are n/a for a cancel operation, which may result in a cancel call failing. outstanding aysnc I/O requests are cancelled when the fd is closed, but with very long-lived sockets, failing cancels could result in elevated CPU during BP4XAIO of type select or cancel. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1759009 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/z_asio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index 6da4ee8e901..ae03079fb53 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -483,7 +483,8 @@ static apr_status_t asio_pollset_remove(apr_pollset_t *pollset, asio_elem_t *elem; apr_status_t rv = APR_SUCCESS; apr_pollset_private_t *priv = pollset->p; - struct aiocb cancel_a; /* AIO_CANCEL is synchronous, so autodata works fine */ + /* AIO_CANCEL is synchronous, so autodata works fine. */ + struct aiocb cancel_a = {0}; int fd; From 72e5b956a2e5099f6c91b0dc1c06ae17ec3de8a3 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sat, 17 Sep 2016 21:22:25 +0000 Subject: [PATCH 7609/7878] locks/netware: follow up to r1667962 and r1667900: fix typos (compile errors). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1761279 13f79535-47bb-0310-9956-ffa450edef68 --- locks/netware/proc_mutex.c | 2 +- locks/netware/thread_cond.c | 2 +- locks/netware/thread_mutex.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 581b24350d1..231f242b459 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -72,7 +72,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) return APR_ENOLOCK; } -APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_thread_mutex_t *mutex, +APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, apr_time_t timeout, int absolute) { diff --git a/locks/netware/thread_cond.c b/locks/netware/thread_cond.c index da1162bc27c..432b0d2908b 100644 --- a/locks/netware/thread_cond.c +++ b/locks/netware/thread_cond.c @@ -73,7 +73,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, rc = NXCondWait(cond->cond, mutex->mutex); } else { - timeout = timeout * 1000 / XGetSystemTick(); + timeout = timeout * 1000 / NXGetSystemTick(); rc = NXCondTimedWait(cond->cond, mutex->mutex, timeout); if (rc == NX_ETIMEDOUT) { return APR_TIMEUP; diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index a11ad834504..c634edfac10 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -55,7 +55,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, if (flags & APR_THREAD_MUTEX_TIMED) { apr_status_t rv = apr_thread_cond_create(&new_mutex->cond, pool); - if (rv != SUCCESS) { + if (rv != APR_SUCCESS) { NXMutexFree(new_mutex->mutex); return rv; } @@ -121,7 +121,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, if (mutex->locked) { mutex->num_waiters++; if (timeout < 0) { - rv = apr_thread_cond_dwait(mutex->cond, mutex); + rv = apr_thread_cond_wait(mutex->cond, mutex); } else { if (absolute) { From 9982e3e4a26a1ad20b074eb7d7c4b87d3086e9f2 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 26 Sep 2016 12:01:17 +0000 Subject: [PATCH 7610/7878] apr_crypto_commoncrypto: set native eol. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1762325 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_commoncrypto.c | 1824 +++++++++++++++--------------- 1 file changed, 912 insertions(+), 912 deletions(-) diff --git a/crypto/apr_crypto_commoncrypto.c b/crypto/apr_crypto_commoncrypto.c index ab216cc8fb5..f06f2ca3c1f 100644 --- a/crypto/apr_crypto_commoncrypto.c +++ b/crypto/apr_crypto_commoncrypto.c @@ -1,912 +1,912 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "apr_lib.h" -#include "apu.h" -#include "apr_private.h" -#include "apu_errno.h" - -#include -#include -#include - -#include "apr_strings.h" -#include "apr_time.h" -#include "apr_buckets.h" -#include "apr_random.h" - -#include "apr_crypto_internal.h" - -#if APU_HAVE_CRYPTO - -#include - -#define LOG_PREFIX "apr_crypto_commoncrypto: " - -struct apr_crypto_t -{ - apr_pool_t *pool; - const apr_crypto_driver_t *provider; - apu_err_t *result; - apr_array_header_t *keys; - apr_hash_t *types; - apr_hash_t *modes; - apr_random_t *rng; -}; - -struct apr_crypto_key_t -{ - apr_pool_t *pool; - const apr_crypto_driver_t *provider; - const apr_crypto_t *f; - CCAlgorithm algorithm; - CCOptions options; - unsigned char *key; - int keyLen; - int ivSize; - apr_size_t blockSize; -}; - -struct apr_crypto_block_t -{ - apr_pool_t *pool; - const apr_crypto_driver_t *provider; - const apr_crypto_t *f; - const apr_crypto_key_t *key; - CCCryptorRef ref; -}; - -static struct apr_crypto_block_key_type_t key_types[] = -{ -{ APR_KEY_3DES_192, 24, 8, 8 }, -{ APR_KEY_AES_128, 16, 16, 16 }, -{ APR_KEY_AES_192, 24, 16, 16 }, -{ APR_KEY_AES_256, 32, 16, 16 } }; - -static struct apr_crypto_block_key_mode_t key_modes[] = -{ -{ APR_MODE_ECB }, -{ APR_MODE_CBC } }; - -/** - * Fetch the most recent error from this driver. - */ -static apr_status_t crypto_error(const apu_err_t **result, - const apr_crypto_t *f) -{ - *result = f->result; - return APR_SUCCESS; -} - -/** - * Shutdown the crypto library and release resources. - */ -static apr_status_t crypto_shutdown(void) -{ - return APR_SUCCESS; -} - -static apr_status_t crypto_shutdown_helper(void *data) -{ - return crypto_shutdown(); -} - -/** - * Initialise the crypto library and perform one time initialisation. - */ -static apr_status_t crypto_init(apr_pool_t *pool, const char *params, - const apu_err_t **result) -{ - - apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, - apr_pool_cleanup_null); - - return APR_SUCCESS; -} - -/** - * @brief Clean encryption / decryption context. - * @note After cleanup, a context is free to be reused if necessary. - * @param ctx The block context to use. - * @return Returns APR_ENOTIMPL if not supported. - */ -static apr_status_t crypto_block_cleanup(apr_crypto_block_t *ctx) -{ - - if (ctx->ref) { - CCCryptorRelease(ctx->ref); - ctx->ref = NULL; - } - - return APR_SUCCESS; - -} - -static apr_status_t crypto_block_cleanup_helper(void *data) -{ - apr_crypto_block_t *block = (apr_crypto_block_t *) data; - return crypto_block_cleanup(block); -} - -/** - * @brief Clean encryption / decryption context. - * @note After cleanup, a context is free to be reused if necessary. - * @param f The context to use. - * @return Returns APR_ENOTIMPL if not supported. - */ -static apr_status_t crypto_cleanup(apr_crypto_t *f) -{ - - return APR_SUCCESS; - -} - -static apr_status_t crypto_cleanup_helper(void *data) -{ - apr_crypto_t *f = (apr_crypto_t *) data; - return crypto_cleanup(f); -} - -/** - * @brief Create a context for supporting encryption. Keys, certificates, - * algorithms and other parameters will be set per context. More than - * one context can be created at one time. A cleanup will be automatically - * registered with the given pool to guarantee a graceful shutdown. - * @param f - context pointer will be written here - * @param provider - provider to use - * @param params - array of key parameters - * @param pool - process pool - * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE - * if the engine cannot be initialised. - */ -static apr_status_t crypto_make(apr_crypto_t **ff, - const apr_crypto_driver_t *provider, const char *params, - apr_pool_t *pool) -{ - apr_crypto_t *f = apr_pcalloc(pool, sizeof(apr_crypto_t)); - apr_status_t rv; - - if (!f) { - return APR_ENOMEM; - } - *ff = f; - f->pool = pool; - f->provider = provider; - - /* seed the secure random number generator */ - f->rng = apr_random_standard_new(pool); - if (!f->rng) { - return APR_ENOMEM; - } - do { - unsigned char seed[8]; - rv = apr_generate_random_bytes(seed, sizeof(seed)); - if (rv != APR_SUCCESS) { - return rv; - } - apr_random_add_entropy(f->rng, seed, sizeof(seed)); - rv = apr_random_secure_ready(f->rng); - } while (rv == APR_ENOTENOUGHENTROPY); - - f->result = apr_pcalloc(pool, sizeof(apu_err_t)); - if (!f->result) { - return APR_ENOMEM; - } - - f->keys = apr_array_make(pool, 10, sizeof(apr_crypto_key_t)); - if (!f->keys) { - return APR_ENOMEM; - } - - f->types = apr_hash_make(pool); - if (!f->types) { - return APR_ENOMEM; - } - apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_types[0])); - apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_types[1])); - apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_types[2])); - apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_types[3])); - - f->modes = apr_hash_make(pool); - if (!f->modes) { - return APR_ENOMEM; - } - apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(key_modes[0])); - apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(key_modes[1])); - - apr_pool_cleanup_register(pool, f, crypto_cleanup_helper, - apr_pool_cleanup_null); - - return APR_SUCCESS; - -} - -/** - * @brief Get a hash table of key types, keyed by the name of the type against - * a pointer to apr_crypto_block_key_type_t. - * - * @param types - hashtable of key types keyed to constants. - * @param f - encryption context - * @return APR_SUCCESS for success - */ -static apr_status_t crypto_get_block_key_types(apr_hash_t **types, - const apr_crypto_t *f) -{ - *types = f->types; - return APR_SUCCESS; -} - -/** - * @brief Get a hash table of key modes, keyed by the name of the mode against - * a pointer to apr_crypto_block_key_mode_t. - * - * @param modes - hashtable of key modes keyed to constants. - * @param f - encryption context - * @return APR_SUCCESS for success - */ -static apr_status_t crypto_get_block_key_modes(apr_hash_t **modes, - const apr_crypto_t *f) -{ - *modes = f->modes; - return APR_SUCCESS; -} - -/* - * Work out which mechanism to use. - */ -static apr_status_t crypto_cipher_mechanism(apr_crypto_key_t *key, - const apr_crypto_block_key_type_e type, - const apr_crypto_block_key_mode_e mode, const int doPad, apr_pool_t *p) -{ - /* handle padding */ - key->options = doPad ? kCCOptionPKCS7Padding : 0; - - /* determine the algorithm to be used */ - switch (type) { - - case (APR_KEY_3DES_192): - - /* A 3DES key */ - if (mode == APR_MODE_CBC) { - key->algorithm = kCCAlgorithm3DES; - key->keyLen = kCCKeySize3DES; - key->ivSize = kCCBlockSize3DES; - key->blockSize = kCCBlockSize3DES; - } - else { - key->algorithm = kCCAlgorithm3DES; - key->options += kCCOptionECBMode; - key->keyLen = kCCKeySize3DES; - key->ivSize = 0; - key->blockSize = kCCBlockSize3DES; - } - break; - - case (APR_KEY_AES_128): - - if (mode == APR_MODE_CBC) { - key->algorithm = kCCAlgorithmAES128; - key->keyLen = kCCKeySizeAES128; - key->ivSize = kCCBlockSizeAES128; - key->blockSize = kCCBlockSizeAES128; - } - else { - key->algorithm = kCCAlgorithmAES128; - key->options += kCCOptionECBMode; - key->keyLen = kCCKeySizeAES128; - key->ivSize = 0; - key->blockSize = kCCBlockSizeAES128; - } - break; - - case (APR_KEY_AES_192): - - if (mode == APR_MODE_CBC) { - key->algorithm = kCCAlgorithmAES128; - key->keyLen = kCCKeySizeAES192; - key->ivSize = kCCBlockSizeAES128; - key->blockSize = kCCBlockSizeAES128; - } - else { - key->algorithm = kCCAlgorithmAES128; - key->options += kCCOptionECBMode; - key->keyLen = kCCKeySizeAES192; - key->ivSize = 0; - key->blockSize = kCCBlockSizeAES128; - } - break; - - case (APR_KEY_AES_256): - - if (mode == APR_MODE_CBC) { - key->algorithm = kCCAlgorithmAES128; - key->keyLen = kCCKeySizeAES256; - key->ivSize = kCCBlockSizeAES128; - key->blockSize = kCCBlockSizeAES128; - } - else { - key->algorithm = kCCAlgorithmAES128; - key->options += kCCOptionECBMode; - key->keyLen = kCCKeySizeAES256; - key->ivSize = 0; - key->blockSize = kCCBlockSizeAES128; - } - break; - - default: - - /* TODO: Support CAST, Blowfish */ - - /* unknown key type, give up */ - return APR_EKEYTYPE; - - } - - /* make space for the key */ - key->key = apr_palloc(p, key->keyLen); - if (!key->key) { - return APR_ENOMEM; - } - apr_crypto_clear(p, key->key, key->keyLen); - - return APR_SUCCESS; -} - -/** - * @brief Create a key from the provided secret or passphrase. The key is cleaned - * up when the context is cleaned, and may be reused with multiple encryption - * or decryption operations. - * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If - * *key is not NULL, *key must point at a previously created structure. - * @param key The key returned, see note. - * @param rec The key record, from which the key will be derived. - * @param f The context to use. - * @param p The pool to use. - * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend - * error occurred while generating the key. APR_ENOCIPHER if the type or mode - * is not supported by the particular backend. APR_EKEYTYPE if the key type is - * not known. APR_EPADDING if padding was requested but is not supported. - * APR_ENOTIMPL if not implemented. - */ -static apr_status_t crypto_key(apr_crypto_key_t **k, - const apr_crypto_key_rec_t *rec, const apr_crypto_t *f, apr_pool_t *p) -{ - apr_status_t rv; - apr_crypto_key_t *key = *k; - - if (!key) { - *k = key = apr_array_push(f->keys); - } - if (!key) { - return APR_ENOMEM; - } - - key->f = f; - key->provider = f->provider; - - /* decide on what cipher mechanism we will be using */ - rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad, p); - if (APR_SUCCESS != rv) { - return rv; - } - - switch (rec->ktype) { - - case APR_CRYPTO_KTYPE_PASSPHRASE: { - - /* generate the key */ - if ((f->result->rc = CCKeyDerivationPBKDF(kCCPBKDF2, - rec->k.passphrase.pass, rec->k.passphrase.passLen, - rec->k.passphrase.salt, rec->k.passphrase.saltLen, - kCCPRFHmacAlgSHA1, rec->k.passphrase.iterations, key->key, - key->keyLen)) == kCCParamError) { - return APR_ENOKEY; - } - - break; - } - - case APR_CRYPTO_KTYPE_SECRET: { - - /* sanity check - key correct size? */ - if (rec->k.secret.secretLen != key->keyLen) { - return APR_EKEYLENGTH; - } - - /* copy the key */ - memcpy(key->key, rec->k.secret.secret, rec->k.secret.secretLen); - - break; - } - - default: { - - return APR_ENOKEY; - - } - } - - return APR_SUCCESS; -} - -/** - * @brief Create a key from the given passphrase. By default, the PBKDF2 - * algorithm is used to generate the key from the passphrase. It is expected - * that the same pass phrase will generate the same key, regardless of the - * backend crypto platform used. The key is cleaned up when the context - * is cleaned, and may be reused with multiple encryption or decryption - * operations. - * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If - * *key is not NULL, *key must point at a previously created structure. - * @param key The key returned, see note. - * @param ivSize The size of the initialisation vector will be returned, based - * on whether an IV is relevant for this type of crypto. - * @param pass The passphrase to use. - * @param passLen The passphrase length in bytes - * @param salt The salt to use. - * @param saltLen The salt length in bytes - * @param type 3DES_192, AES_128, AES_192, AES_256. - * @param mode Electronic Code Book / Cipher Block Chaining. - * @param doPad Pad if necessary. - * @param iterations Iteration count - * @param f The context to use. - * @param p The pool to use. - * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend - * error occurred while generating the key. APR_ENOCIPHER if the type or mode - * is not supported by the particular backend. APR_EKEYTYPE if the key type is - * not known. APR_EPADDING if padding was requested but is not supported. - * APR_ENOTIMPL if not implemented. - */ -static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, - const char *pass, apr_size_t passLen, const unsigned char * salt, - apr_size_t saltLen, const apr_crypto_block_key_type_e type, - const apr_crypto_block_key_mode_e mode, const int doPad, - const int iterations, const apr_crypto_t *f, apr_pool_t *p) -{ - apr_status_t rv; - apr_crypto_key_t *key = *k; - - if (!key) { - *k = key = apr_array_push(f->keys); - } - if (!key) { - return APR_ENOMEM; - } - - key->f = f; - key->provider = f->provider; - - /* decide on what cipher mechanism we will be using */ - rv = crypto_cipher_mechanism(key, type, mode, doPad, p); - if (APR_SUCCESS != rv) { - return rv; - } - - /* generate the key */ - if ((f->result->rc = CCKeyDerivationPBKDF(kCCPBKDF2, pass, passLen, salt, - saltLen, kCCPRFHmacAlgSHA1, iterations, key->key, key->keyLen)) - == kCCParamError) { - return APR_ENOKEY; - } - - if (ivSize) { - *ivSize = key->ivSize; - } - - return APR_SUCCESS; -} - -/** - * @brief Initialise a context for encrypting arbitrary data using the given key. - * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If - * *ctx is not NULL, *ctx must point at a previously created structure. - * @param ctx The block context returned, see note. - * @param iv Optional initialisation vector. If the buffer pointed to is NULL, - * an IV will be created at random, in space allocated from the pool. - * If the buffer pointed to is not NULL, the IV in the buffer will be - * used. - * @param key The key structure. - * @param blockSize The block size of the cipher. - * @param p The pool to use. - * @return Returns APR_ENOIV if an initialisation vector is required but not specified. - * Returns APR_EINIT if the backend failed to initialise the context. Returns - * APR_ENOTIMPL if not implemented. - */ -static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, - const unsigned char **iv, const apr_crypto_key_t *key, - apr_size_t *blockSize, apr_pool_t *p) -{ - unsigned char *usedIv; - apr_crypto_block_t *block = *ctx; - if (!block) { - *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t)); - } - if (!block) { - return APR_ENOMEM; - } - block->f = key->f; - block->pool = p; - block->provider = key->provider; - block->key = key; - - apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, - apr_pool_cleanup_null); - - /* generate an IV, if necessary */ - usedIv = NULL; - if (key->ivSize) { - if (iv == NULL) { - return APR_ENOIV; - } - if (*iv == NULL) { - apr_status_t status; - usedIv = apr_pcalloc(p, key->ivSize); - if (!usedIv) { - return APR_ENOMEM; - } - apr_crypto_clear(p, usedIv, key->ivSize); - status = apr_random_secure_bytes(block->f->rng, usedIv, - key->ivSize); - if (APR_SUCCESS != status) { - return status; - } - *iv = usedIv; - } - else { - usedIv = (unsigned char *) *iv; - } - } - - /* create a new context for encryption */ - switch ((block->f->result->rc = CCCryptorCreate(kCCEncrypt, key->algorithm, - key->options, key->key, key->keyLen, usedIv, &block->ref))) { - case kCCSuccess: { - break; - } - case kCCParamError: { - return APR_EINIT; - } - case kCCMemoryFailure: { - return APR_ENOMEM; - } - case kCCAlignmentError: { - return APR_EPADDING; - } - case kCCUnimplemented: { - return APR_ENOTIMPL; - } - default: { - return APR_EINIT; - } - } - - if (blockSize) { - *blockSize = key->blockSize; - } - - return APR_SUCCESS; - -} - -/** - * @brief Encrypt data provided by in, write it to out. - * @note The number of bytes written will be written to outlen. If - * out is NULL, outlen will contain the maximum size of the - * buffer needed to hold the data, including any data - * generated by apr_crypto_block_encrypt_finish below. If *out points - * to NULL, a buffer sufficiently large will be created from - * the pool provided. If *out points to a not-NULL value, this - * value will be used as a buffer instead. - * @param out Address of a buffer to which data will be written, - * see note. - * @param outlen Length of the output will be written here. - * @param in Address of the buffer to read. - * @param inlen Length of the buffer to read. - * @param ctx The block context to use. - * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if - * not implemented. - */ -static apr_status_t crypto_block_encrypt(unsigned char **out, - apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, - apr_crypto_block_t *ctx) -{ - apr_size_t outl = *outlen; - unsigned char *buffer; - - /* are we after the maximum size of the out buffer? */ - if (!out) { - *outlen = CCCryptorGetOutputLength(ctx->ref, inlen, 1); - return APR_SUCCESS; - } - - /* must we allocate the output buffer from a pool? */ - if (!*out) { - outl = CCCryptorGetOutputLength(ctx->ref, inlen, 1); - buffer = apr_palloc(ctx->pool, outl); - if (!buffer) { - return APR_ENOMEM; - } - apr_crypto_clear(ctx->pool, buffer, outl); - *out = buffer; - } - - switch ((ctx->f->result->rc = CCCryptorUpdate(ctx->ref, in, inlen, (*out), - outl, &outl))) { - case kCCSuccess: { - break; - } - case kCCBufferTooSmall: { - return APR_ENOSPACE; - } - default: { - return APR_ECRYPT; - } - } - *outlen = outl; - - return APR_SUCCESS; - -} - -/** - * @brief Encrypt final data block, write it to out. - * @note If necessary the final block will be written out after being - * padded. Typically the final block will be written to the - * same buffer used by apr_crypto_block_encrypt, offset by the - * number of bytes returned as actually written by the - * apr_crypto_block_encrypt() call. After this call, the context - * is cleaned and can be reused by apr_crypto_block_encrypt_init(). - * @param out Address of a buffer to which data will be written. This - * buffer must already exist, and is usually the same - * buffer used by apr_evp_crypt(). See note. - * @param outlen Length of the output will be written here. - * @param ctx The block context to use. - * @return APR_ECRYPT if an error occurred. - * @return APR_EPADDING if padding was enabled and the block was incorrectly - * formatted. - * @return APR_ENOTIMPL if not implemented. - */ -static apr_status_t crypto_block_encrypt_finish(unsigned char *out, - apr_size_t *outlen, apr_crypto_block_t *ctx) -{ - apr_size_t len = *outlen; - - ctx->f->result->rc = CCCryptorFinal(ctx->ref, out, - CCCryptorGetOutputLength(ctx->ref, 0, 1), &len); - - /* always clean up */ - crypto_block_cleanup(ctx); - - switch (ctx->f->result->rc) { - case kCCSuccess: { - break; - } - case kCCBufferTooSmall: { - return APR_ENOSPACE; - } - case kCCAlignmentError: { - return APR_EPADDING; - } - case kCCDecodeError: { - return APR_ECRYPT; - } - default: { - return APR_ECRYPT; - } - } - *outlen = len; - - return APR_SUCCESS; - -} - -/** - * @brief Initialise a context for decrypting arbitrary data using the given key. - * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If - * *ctx is not NULL, *ctx must point at a previously created structure. - * @param ctx The block context returned, see note. - * @param blockSize The block size of the cipher. - * @param iv Optional initialisation vector. If the buffer pointed to is NULL, - * an IV will be created at random, in space allocated from the pool. - * If the buffer is not NULL, the IV in the buffer will be used. - * @param key The key structure. - * @param p The pool to use. - * @return Returns APR_ENOIV if an initialisation vector is required but not specified. - * Returns APR_EINIT if the backend failed to initialise the context. Returns - * APR_ENOTIMPL if not implemented. - */ -static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, - apr_size_t *blockSize, const unsigned char *iv, - const apr_crypto_key_t *key, apr_pool_t *p) -{ - apr_crypto_block_t *block = *ctx; - if (!block) { - *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t)); - } - if (!block) { - return APR_ENOMEM; - } - block->f = key->f; - block->pool = p; - block->provider = key->provider; - - apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, - apr_pool_cleanup_null); - - /* generate an IV, if necessary */ - if (key->ivSize) { - if (iv == NULL) { - return APR_ENOIV; - } - } - - /* create a new context for decryption */ - switch ((block->f->result->rc = CCCryptorCreate(kCCDecrypt, key->algorithm, - key->options, key->key, key->keyLen, iv, &block->ref))) { - case kCCSuccess: { - break; - } - case kCCParamError: { - return APR_EINIT; - } - case kCCMemoryFailure: { - return APR_ENOMEM; - } - case kCCAlignmentError: { - return APR_EPADDING; - } - case kCCUnimplemented: { - return APR_ENOTIMPL; - } - default: { - return APR_EINIT; - } - } - - if (blockSize) { - *blockSize = key->blockSize; - } - - return APR_SUCCESS; - -} - -/** - * @brief Decrypt data provided by in, write it to out. - * @note The number of bytes written will be written to outlen. If - * out is NULL, outlen will contain the maximum size of the - * buffer needed to hold the data, including any data - * generated by apr_crypto_block_decrypt_finish below. If *out points - * to NULL, a buffer sufficiently large will be created from - * the pool provided. If *out points to a not-NULL value, this - * value will be used as a buffer instead. - * @param out Address of a buffer to which data will be written, - * see note. - * @param outlen Length of the output will be written here. - * @param in Address of the buffer to read. - * @param inlen Length of the buffer to read. - * @param ctx The block context to use. - * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if - * not implemented. - */ -static apr_status_t crypto_block_decrypt(unsigned char **out, - apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, - apr_crypto_block_t *ctx) -{ - apr_size_t outl = *outlen; - unsigned char *buffer; - - /* are we after the maximum size of the out buffer? */ - if (!out) { - *outlen = CCCryptorGetOutputLength(ctx->ref, inlen, 1); - return APR_SUCCESS; - } - - /* must we allocate the output buffer from a pool? */ - if (!*out) { - outl = CCCryptorGetOutputLength(ctx->ref, inlen, 1); - buffer = apr_palloc(ctx->pool, outl); - if (!buffer) { - return APR_ENOMEM; - } - apr_crypto_clear(ctx->pool, buffer, outl); - *out = buffer; - } - - switch ((ctx->f->result->rc = CCCryptorUpdate(ctx->ref, in, inlen, (*out), - outl, &outl))) { - case kCCSuccess: { - break; - } - case kCCBufferTooSmall: { - return APR_ENOSPACE; - } - default: { - return APR_ECRYPT; - } - } - *outlen = outl; - - return APR_SUCCESS; - -} - -/** - * @brief Decrypt final data block, write it to out. - * @note If necessary the final block will be written out after being - * padded. Typically the final block will be written to the - * same buffer used by apr_crypto_block_decrypt, offset by the - * number of bytes returned as actually written by the - * apr_crypto_block_decrypt() call. After this call, the context - * is cleaned and can be reused by apr_crypto_block_decrypt_init(). - * @param out Address of a buffer to which data will be written. This - * buffer must already exist, and is usually the same - * buffer used by apr_evp_crypt(). See note. - * @param outlen Length of the output will be written here. - * @param ctx The block context to use. - * @return APR_ECRYPT if an error occurred. - * @return APR_EPADDING if padding was enabled and the block was incorrectly - * formatted. - * @return APR_ENOTIMPL if not implemented. - */ -static apr_status_t crypto_block_decrypt_finish(unsigned char *out, - apr_size_t *outlen, apr_crypto_block_t *ctx) -{ - apr_size_t len = *outlen; - - ctx->f->result->rc = CCCryptorFinal(ctx->ref, out, - CCCryptorGetOutputLength(ctx->ref, 0, 1), &len); - - /* always clean up */ - crypto_block_cleanup(ctx); - - switch (ctx->f->result->rc) { - case kCCSuccess: { - break; - } - case kCCBufferTooSmall: { - return APR_ENOSPACE; - } - case kCCAlignmentError: { - return APR_EPADDING; - } - case kCCDecodeError: { - return APR_ECRYPT; - } - default: { - return APR_ECRYPT; - } - } - *outlen = len; - - return APR_SUCCESS; - -} - -/** - * OSX Common Crypto module. - */ -APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_commoncrypto_driver = -{ - "commoncrypto", crypto_init, crypto_make, crypto_get_block_key_types, - crypto_get_block_key_modes, crypto_passphrase, - crypto_block_encrypt_init, crypto_block_encrypt, - crypto_block_encrypt_finish, crypto_block_decrypt_init, - crypto_block_decrypt, crypto_block_decrypt_finish, crypto_block_cleanup, - crypto_cleanup, crypto_shutdown, crypto_error, crypto_key -}; - -#endif +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_lib.h" +#include "apu.h" +#include "apr_private.h" +#include "apu_errno.h" + +#include +#include +#include + +#include "apr_strings.h" +#include "apr_time.h" +#include "apr_buckets.h" +#include "apr_random.h" + +#include "apr_crypto_internal.h" + +#if APU_HAVE_CRYPTO + +#include + +#define LOG_PREFIX "apr_crypto_commoncrypto: " + +struct apr_crypto_t +{ + apr_pool_t *pool; + const apr_crypto_driver_t *provider; + apu_err_t *result; + apr_array_header_t *keys; + apr_hash_t *types; + apr_hash_t *modes; + apr_random_t *rng; +}; + +struct apr_crypto_key_t +{ + apr_pool_t *pool; + const apr_crypto_driver_t *provider; + const apr_crypto_t *f; + CCAlgorithm algorithm; + CCOptions options; + unsigned char *key; + int keyLen; + int ivSize; + apr_size_t blockSize; +}; + +struct apr_crypto_block_t +{ + apr_pool_t *pool; + const apr_crypto_driver_t *provider; + const apr_crypto_t *f; + const apr_crypto_key_t *key; + CCCryptorRef ref; +}; + +static struct apr_crypto_block_key_type_t key_types[] = +{ +{ APR_KEY_3DES_192, 24, 8, 8 }, +{ APR_KEY_AES_128, 16, 16, 16 }, +{ APR_KEY_AES_192, 24, 16, 16 }, +{ APR_KEY_AES_256, 32, 16, 16 } }; + +static struct apr_crypto_block_key_mode_t key_modes[] = +{ +{ APR_MODE_ECB }, +{ APR_MODE_CBC } }; + +/** + * Fetch the most recent error from this driver. + */ +static apr_status_t crypto_error(const apu_err_t **result, + const apr_crypto_t *f) +{ + *result = f->result; + return APR_SUCCESS; +} + +/** + * Shutdown the crypto library and release resources. + */ +static apr_status_t crypto_shutdown(void) +{ + return APR_SUCCESS; +} + +static apr_status_t crypto_shutdown_helper(void *data) +{ + return crypto_shutdown(); +} + +/** + * Initialise the crypto library and perform one time initialisation. + */ +static apr_status_t crypto_init(apr_pool_t *pool, const char *params, + const apu_err_t **result) +{ + + apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, + apr_pool_cleanup_null); + + return APR_SUCCESS; +} + +/** + * @brief Clean encryption / decryption context. + * @note After cleanup, a context is free to be reused if necessary. + * @param ctx The block context to use. + * @return Returns APR_ENOTIMPL if not supported. + */ +static apr_status_t crypto_block_cleanup(apr_crypto_block_t *ctx) +{ + + if (ctx->ref) { + CCCryptorRelease(ctx->ref); + ctx->ref = NULL; + } + + return APR_SUCCESS; + +} + +static apr_status_t crypto_block_cleanup_helper(void *data) +{ + apr_crypto_block_t *block = (apr_crypto_block_t *) data; + return crypto_block_cleanup(block); +} + +/** + * @brief Clean encryption / decryption context. + * @note After cleanup, a context is free to be reused if necessary. + * @param f The context to use. + * @return Returns APR_ENOTIMPL if not supported. + */ +static apr_status_t crypto_cleanup(apr_crypto_t *f) +{ + + return APR_SUCCESS; + +} + +static apr_status_t crypto_cleanup_helper(void *data) +{ + apr_crypto_t *f = (apr_crypto_t *) data; + return crypto_cleanup(f); +} + +/** + * @brief Create a context for supporting encryption. Keys, certificates, + * algorithms and other parameters will be set per context. More than + * one context can be created at one time. A cleanup will be automatically + * registered with the given pool to guarantee a graceful shutdown. + * @param f - context pointer will be written here + * @param provider - provider to use + * @param params - array of key parameters + * @param pool - process pool + * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE + * if the engine cannot be initialised. + */ +static apr_status_t crypto_make(apr_crypto_t **ff, + const apr_crypto_driver_t *provider, const char *params, + apr_pool_t *pool) +{ + apr_crypto_t *f = apr_pcalloc(pool, sizeof(apr_crypto_t)); + apr_status_t rv; + + if (!f) { + return APR_ENOMEM; + } + *ff = f; + f->pool = pool; + f->provider = provider; + + /* seed the secure random number generator */ + f->rng = apr_random_standard_new(pool); + if (!f->rng) { + return APR_ENOMEM; + } + do { + unsigned char seed[8]; + rv = apr_generate_random_bytes(seed, sizeof(seed)); + if (rv != APR_SUCCESS) { + return rv; + } + apr_random_add_entropy(f->rng, seed, sizeof(seed)); + rv = apr_random_secure_ready(f->rng); + } while (rv == APR_ENOTENOUGHENTROPY); + + f->result = apr_pcalloc(pool, sizeof(apu_err_t)); + if (!f->result) { + return APR_ENOMEM; + } + + f->keys = apr_array_make(pool, 10, sizeof(apr_crypto_key_t)); + if (!f->keys) { + return APR_ENOMEM; + } + + f->types = apr_hash_make(pool); + if (!f->types) { + return APR_ENOMEM; + } + apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_types[0])); + apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_types[1])); + apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_types[2])); + apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_types[3])); + + f->modes = apr_hash_make(pool); + if (!f->modes) { + return APR_ENOMEM; + } + apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(key_modes[0])); + apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(key_modes[1])); + + apr_pool_cleanup_register(pool, f, crypto_cleanup_helper, + apr_pool_cleanup_null); + + return APR_SUCCESS; + +} + +/** + * @brief Get a hash table of key types, keyed by the name of the type against + * a pointer to apr_crypto_block_key_type_t. + * + * @param types - hashtable of key types keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +static apr_status_t crypto_get_block_key_types(apr_hash_t **types, + const apr_crypto_t *f) +{ + *types = f->types; + return APR_SUCCESS; +} + +/** + * @brief Get a hash table of key modes, keyed by the name of the mode against + * a pointer to apr_crypto_block_key_mode_t. + * + * @param modes - hashtable of key modes keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +static apr_status_t crypto_get_block_key_modes(apr_hash_t **modes, + const apr_crypto_t *f) +{ + *modes = f->modes; + return APR_SUCCESS; +} + +/* + * Work out which mechanism to use. + */ +static apr_status_t crypto_cipher_mechanism(apr_crypto_key_t *key, + const apr_crypto_block_key_type_e type, + const apr_crypto_block_key_mode_e mode, const int doPad, apr_pool_t *p) +{ + /* handle padding */ + key->options = doPad ? kCCOptionPKCS7Padding : 0; + + /* determine the algorithm to be used */ + switch (type) { + + case (APR_KEY_3DES_192): + + /* A 3DES key */ + if (mode == APR_MODE_CBC) { + key->algorithm = kCCAlgorithm3DES; + key->keyLen = kCCKeySize3DES; + key->ivSize = kCCBlockSize3DES; + key->blockSize = kCCBlockSize3DES; + } + else { + key->algorithm = kCCAlgorithm3DES; + key->options += kCCOptionECBMode; + key->keyLen = kCCKeySize3DES; + key->ivSize = 0; + key->blockSize = kCCBlockSize3DES; + } + break; + + case (APR_KEY_AES_128): + + if (mode == APR_MODE_CBC) { + key->algorithm = kCCAlgorithmAES128; + key->keyLen = kCCKeySizeAES128; + key->ivSize = kCCBlockSizeAES128; + key->blockSize = kCCBlockSizeAES128; + } + else { + key->algorithm = kCCAlgorithmAES128; + key->options += kCCOptionECBMode; + key->keyLen = kCCKeySizeAES128; + key->ivSize = 0; + key->blockSize = kCCBlockSizeAES128; + } + break; + + case (APR_KEY_AES_192): + + if (mode == APR_MODE_CBC) { + key->algorithm = kCCAlgorithmAES128; + key->keyLen = kCCKeySizeAES192; + key->ivSize = kCCBlockSizeAES128; + key->blockSize = kCCBlockSizeAES128; + } + else { + key->algorithm = kCCAlgorithmAES128; + key->options += kCCOptionECBMode; + key->keyLen = kCCKeySizeAES192; + key->ivSize = 0; + key->blockSize = kCCBlockSizeAES128; + } + break; + + case (APR_KEY_AES_256): + + if (mode == APR_MODE_CBC) { + key->algorithm = kCCAlgorithmAES128; + key->keyLen = kCCKeySizeAES256; + key->ivSize = kCCBlockSizeAES128; + key->blockSize = kCCBlockSizeAES128; + } + else { + key->algorithm = kCCAlgorithmAES128; + key->options += kCCOptionECBMode; + key->keyLen = kCCKeySizeAES256; + key->ivSize = 0; + key->blockSize = kCCBlockSizeAES128; + } + break; + + default: + + /* TODO: Support CAST, Blowfish */ + + /* unknown key type, give up */ + return APR_EKEYTYPE; + + } + + /* make space for the key */ + key->key = apr_palloc(p, key->keyLen); + if (!key->key) { + return APR_ENOMEM; + } + apr_crypto_clear(p, key->key, key->keyLen); + + return APR_SUCCESS; +} + +/** + * @brief Create a key from the provided secret or passphrase. The key is cleaned + * up when the context is cleaned, and may be reused with multiple encryption + * or decryption operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param key The key returned, see note. + * @param rec The key record, from which the key will be derived. + * @param f The context to use. + * @param p The pool to use. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_key(apr_crypto_key_t **k, + const apr_crypto_key_rec_t *rec, const apr_crypto_t *f, apr_pool_t *p) +{ + apr_status_t rv; + apr_crypto_key_t *key = *k; + + if (!key) { + *k = key = apr_array_push(f->keys); + } + if (!key) { + return APR_ENOMEM; + } + + key->f = f; + key->provider = f->provider; + + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad, p); + if (APR_SUCCESS != rv) { + return rv; + } + + switch (rec->ktype) { + + case APR_CRYPTO_KTYPE_PASSPHRASE: { + + /* generate the key */ + if ((f->result->rc = CCKeyDerivationPBKDF(kCCPBKDF2, + rec->k.passphrase.pass, rec->k.passphrase.passLen, + rec->k.passphrase.salt, rec->k.passphrase.saltLen, + kCCPRFHmacAlgSHA1, rec->k.passphrase.iterations, key->key, + key->keyLen)) == kCCParamError) { + return APR_ENOKEY; + } + + break; + } + + case APR_CRYPTO_KTYPE_SECRET: { + + /* sanity check - key correct size? */ + if (rec->k.secret.secretLen != key->keyLen) { + return APR_EKEYLENGTH; + } + + /* copy the key */ + memcpy(key->key, rec->k.secret.secret, rec->k.secret.secretLen); + + break; + } + + default: { + + return APR_ENOKEY; + + } + } + + return APR_SUCCESS; +} + +/** + * @brief Create a key from the given passphrase. By default, the PBKDF2 + * algorithm is used to generate the key from the passphrase. It is expected + * that the same pass phrase will generate the same key, regardless of the + * backend crypto platform used. The key is cleaned up when the context + * is cleaned, and may be reused with multiple encryption or decryption + * operations. + * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If + * *key is not NULL, *key must point at a previously created structure. + * @param key The key returned, see note. + * @param ivSize The size of the initialisation vector will be returned, based + * on whether an IV is relevant for this type of crypto. + * @param pass The passphrase to use. + * @param passLen The passphrase length in bytes + * @param salt The salt to use. + * @param saltLen The salt length in bytes + * @param type 3DES_192, AES_128, AES_192, AES_256. + * @param mode Electronic Code Book / Cipher Block Chaining. + * @param doPad Pad if necessary. + * @param iterations Iteration count + * @param f The context to use. + * @param p The pool to use. + * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. APR_EKEYTYPE if the key type is + * not known. APR_EPADDING if padding was requested but is not supported. + * APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, + const char *pass, apr_size_t passLen, const unsigned char * salt, + apr_size_t saltLen, const apr_crypto_block_key_type_e type, + const apr_crypto_block_key_mode_e mode, const int doPad, + const int iterations, const apr_crypto_t *f, apr_pool_t *p) +{ + apr_status_t rv; + apr_crypto_key_t *key = *k; + + if (!key) { + *k = key = apr_array_push(f->keys); + } + if (!key) { + return APR_ENOMEM; + } + + key->f = f; + key->provider = f->provider; + + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, type, mode, doPad, p); + if (APR_SUCCESS != rv) { + return rv; + } + + /* generate the key */ + if ((f->result->rc = CCKeyDerivationPBKDF(kCCPBKDF2, pass, passLen, salt, + saltLen, kCCPRFHmacAlgSHA1, iterations, key->key, key->keyLen)) + == kCCParamError) { + return APR_ENOKEY; + } + + if (ivSize) { + *ivSize = key->ivSize; + } + + return APR_SUCCESS; +} + +/** + * @brief Initialise a context for encrypting arbitrary data using the given key. + * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If + * *ctx is not NULL, *ctx must point at a previously created structure. + * @param ctx The block context returned, see note. + * @param iv Optional initialisation vector. If the buffer pointed to is NULL, + * an IV will be created at random, in space allocated from the pool. + * If the buffer pointed to is not NULL, the IV in the buffer will be + * used. + * @param key The key structure. + * @param blockSize The block size of the cipher. + * @param p The pool to use. + * @return Returns APR_ENOIV if an initialisation vector is required but not specified. + * Returns APR_EINIT if the backend failed to initialise the context. Returns + * APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, + const unsigned char **iv, const apr_crypto_key_t *key, + apr_size_t *blockSize, apr_pool_t *p) +{ + unsigned char *usedIv; + apr_crypto_block_t *block = *ctx; + if (!block) { + *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t)); + } + if (!block) { + return APR_ENOMEM; + } + block->f = key->f; + block->pool = p; + block->provider = key->provider; + block->key = key; + + apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, + apr_pool_cleanup_null); + + /* generate an IV, if necessary */ + usedIv = NULL; + if (key->ivSize) { + if (iv == NULL) { + return APR_ENOIV; + } + if (*iv == NULL) { + apr_status_t status; + usedIv = apr_pcalloc(p, key->ivSize); + if (!usedIv) { + return APR_ENOMEM; + } + apr_crypto_clear(p, usedIv, key->ivSize); + status = apr_random_secure_bytes(block->f->rng, usedIv, + key->ivSize); + if (APR_SUCCESS != status) { + return status; + } + *iv = usedIv; + } + else { + usedIv = (unsigned char *) *iv; + } + } + + /* create a new context for encryption */ + switch ((block->f->result->rc = CCCryptorCreate(kCCEncrypt, key->algorithm, + key->options, key->key, key->keyLen, usedIv, &block->ref))) { + case kCCSuccess: { + break; + } + case kCCParamError: { + return APR_EINIT; + } + case kCCMemoryFailure: { + return APR_ENOMEM; + } + case kCCAlignmentError: { + return APR_EPADDING; + } + case kCCUnimplemented: { + return APR_ENOTIMPL; + } + default: { + return APR_EINIT; + } + } + + if (blockSize) { + *blockSize = key->blockSize; + } + + return APR_SUCCESS; + +} + +/** + * @brief Encrypt data provided by in, write it to out. + * @note The number of bytes written will be written to outlen. If + * out is NULL, outlen will contain the maximum size of the + * buffer needed to hold the data, including any data + * generated by apr_crypto_block_encrypt_finish below. If *out points + * to NULL, a buffer sufficiently large will be created from + * the pool provided. If *out points to a not-NULL value, this + * value will be used as a buffer instead. + * @param out Address of a buffer to which data will be written, + * see note. + * @param outlen Length of the output will be written here. + * @param in Address of the buffer to read. + * @param inlen Length of the buffer to read. + * @param ctx The block context to use. + * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if + * not implemented. + */ +static apr_status_t crypto_block_encrypt(unsigned char **out, + apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, + apr_crypto_block_t *ctx) +{ + apr_size_t outl = *outlen; + unsigned char *buffer; + + /* are we after the maximum size of the out buffer? */ + if (!out) { + *outlen = CCCryptorGetOutputLength(ctx->ref, inlen, 1); + return APR_SUCCESS; + } + + /* must we allocate the output buffer from a pool? */ + if (!*out) { + outl = CCCryptorGetOutputLength(ctx->ref, inlen, 1); + buffer = apr_palloc(ctx->pool, outl); + if (!buffer) { + return APR_ENOMEM; + } + apr_crypto_clear(ctx->pool, buffer, outl); + *out = buffer; + } + + switch ((ctx->f->result->rc = CCCryptorUpdate(ctx->ref, in, inlen, (*out), + outl, &outl))) { + case kCCSuccess: { + break; + } + case kCCBufferTooSmall: { + return APR_ENOSPACE; + } + default: { + return APR_ECRYPT; + } + } + *outlen = outl; + + return APR_SUCCESS; + +} + +/** + * @brief Encrypt final data block, write it to out. + * @note If necessary the final block will be written out after being + * padded. Typically the final block will be written to the + * same buffer used by apr_crypto_block_encrypt, offset by the + * number of bytes returned as actually written by the + * apr_crypto_block_encrypt() call. After this call, the context + * is cleaned and can be reused by apr_crypto_block_encrypt_init(). + * @param out Address of a buffer to which data will be written. This + * buffer must already exist, and is usually the same + * buffer used by apr_evp_crypt(). See note. + * @param outlen Length of the output will be written here. + * @param ctx The block context to use. + * @return APR_ECRYPT if an error occurred. + * @return APR_EPADDING if padding was enabled and the block was incorrectly + * formatted. + * @return APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_block_encrypt_finish(unsigned char *out, + apr_size_t *outlen, apr_crypto_block_t *ctx) +{ + apr_size_t len = *outlen; + + ctx->f->result->rc = CCCryptorFinal(ctx->ref, out, + CCCryptorGetOutputLength(ctx->ref, 0, 1), &len); + + /* always clean up */ + crypto_block_cleanup(ctx); + + switch (ctx->f->result->rc) { + case kCCSuccess: { + break; + } + case kCCBufferTooSmall: { + return APR_ENOSPACE; + } + case kCCAlignmentError: { + return APR_EPADDING; + } + case kCCDecodeError: { + return APR_ECRYPT; + } + default: { + return APR_ECRYPT; + } + } + *outlen = len; + + return APR_SUCCESS; + +} + +/** + * @brief Initialise a context for decrypting arbitrary data using the given key. + * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If + * *ctx is not NULL, *ctx must point at a previously created structure. + * @param ctx The block context returned, see note. + * @param blockSize The block size of the cipher. + * @param iv Optional initialisation vector. If the buffer pointed to is NULL, + * an IV will be created at random, in space allocated from the pool. + * If the buffer is not NULL, the IV in the buffer will be used. + * @param key The key structure. + * @param p The pool to use. + * @return Returns APR_ENOIV if an initialisation vector is required but not specified. + * Returns APR_EINIT if the backend failed to initialise the context. Returns + * APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, + apr_size_t *blockSize, const unsigned char *iv, + const apr_crypto_key_t *key, apr_pool_t *p) +{ + apr_crypto_block_t *block = *ctx; + if (!block) { + *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t)); + } + if (!block) { + return APR_ENOMEM; + } + block->f = key->f; + block->pool = p; + block->provider = key->provider; + + apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, + apr_pool_cleanup_null); + + /* generate an IV, if necessary */ + if (key->ivSize) { + if (iv == NULL) { + return APR_ENOIV; + } + } + + /* create a new context for decryption */ + switch ((block->f->result->rc = CCCryptorCreate(kCCDecrypt, key->algorithm, + key->options, key->key, key->keyLen, iv, &block->ref))) { + case kCCSuccess: { + break; + } + case kCCParamError: { + return APR_EINIT; + } + case kCCMemoryFailure: { + return APR_ENOMEM; + } + case kCCAlignmentError: { + return APR_EPADDING; + } + case kCCUnimplemented: { + return APR_ENOTIMPL; + } + default: { + return APR_EINIT; + } + } + + if (blockSize) { + *blockSize = key->blockSize; + } + + return APR_SUCCESS; + +} + +/** + * @brief Decrypt data provided by in, write it to out. + * @note The number of bytes written will be written to outlen. If + * out is NULL, outlen will contain the maximum size of the + * buffer needed to hold the data, including any data + * generated by apr_crypto_block_decrypt_finish below. If *out points + * to NULL, a buffer sufficiently large will be created from + * the pool provided. If *out points to a not-NULL value, this + * value will be used as a buffer instead. + * @param out Address of a buffer to which data will be written, + * see note. + * @param outlen Length of the output will be written here. + * @param in Address of the buffer to read. + * @param inlen Length of the buffer to read. + * @param ctx The block context to use. + * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if + * not implemented. + */ +static apr_status_t crypto_block_decrypt(unsigned char **out, + apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, + apr_crypto_block_t *ctx) +{ + apr_size_t outl = *outlen; + unsigned char *buffer; + + /* are we after the maximum size of the out buffer? */ + if (!out) { + *outlen = CCCryptorGetOutputLength(ctx->ref, inlen, 1); + return APR_SUCCESS; + } + + /* must we allocate the output buffer from a pool? */ + if (!*out) { + outl = CCCryptorGetOutputLength(ctx->ref, inlen, 1); + buffer = apr_palloc(ctx->pool, outl); + if (!buffer) { + return APR_ENOMEM; + } + apr_crypto_clear(ctx->pool, buffer, outl); + *out = buffer; + } + + switch ((ctx->f->result->rc = CCCryptorUpdate(ctx->ref, in, inlen, (*out), + outl, &outl))) { + case kCCSuccess: { + break; + } + case kCCBufferTooSmall: { + return APR_ENOSPACE; + } + default: { + return APR_ECRYPT; + } + } + *outlen = outl; + + return APR_SUCCESS; + +} + +/** + * @brief Decrypt final data block, write it to out. + * @note If necessary the final block will be written out after being + * padded. Typically the final block will be written to the + * same buffer used by apr_crypto_block_decrypt, offset by the + * number of bytes returned as actually written by the + * apr_crypto_block_decrypt() call. After this call, the context + * is cleaned and can be reused by apr_crypto_block_decrypt_init(). + * @param out Address of a buffer to which data will be written. This + * buffer must already exist, and is usually the same + * buffer used by apr_evp_crypt(). See note. + * @param outlen Length of the output will be written here. + * @param ctx The block context to use. + * @return APR_ECRYPT if an error occurred. + * @return APR_EPADDING if padding was enabled and the block was incorrectly + * formatted. + * @return APR_ENOTIMPL if not implemented. + */ +static apr_status_t crypto_block_decrypt_finish(unsigned char *out, + apr_size_t *outlen, apr_crypto_block_t *ctx) +{ + apr_size_t len = *outlen; + + ctx->f->result->rc = CCCryptorFinal(ctx->ref, out, + CCCryptorGetOutputLength(ctx->ref, 0, 1), &len); + + /* always clean up */ + crypto_block_cleanup(ctx); + + switch (ctx->f->result->rc) { + case kCCSuccess: { + break; + } + case kCCBufferTooSmall: { + return APR_ENOSPACE; + } + case kCCAlignmentError: { + return APR_EPADDING; + } + case kCCDecodeError: { + return APR_ECRYPT; + } + default: { + return APR_ECRYPT; + } + } + *outlen = len; + + return APR_SUCCESS; + +} + +/** + * OSX Common Crypto module. + */ +APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_commoncrypto_driver = +{ + "commoncrypto", crypto_init, crypto_make, crypto_get_block_key_types, + crypto_get_block_key_modes, crypto_passphrase, + crypto_block_encrypt_init, crypto_block_encrypt, + crypto_block_encrypt_finish, crypto_block_decrypt_init, + crypto_block_decrypt, crypto_block_decrypt_finish, crypto_block_cleanup, + crypto_cleanup, crypto_shutdown, crypto_error, crypto_key +}; + +#endif From 952115b8698aa992860a99ec2d430ccfbcf11228 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 26 Sep 2016 12:01:45 +0000 Subject: [PATCH 7611/7878] Native eol. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1762326 13f79535-47bb-0310-9956-ffa450edef68 From a1ee495d330590e9c9626744e8d71b78a492b807 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 6 Oct 2016 21:11:43 +0000 Subject: [PATCH 7612/7878] crypto: provide apr_crypto_memzero, garanteed to not be optimized out by compilers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1763665 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 53 ++++++++++++++++++++++++++++++++++++++++++++ crypto/apr_crypto.c | 34 +++++++++++++++++++++++++++- include/apr_crypto.h | 12 ++++++++-- 3 files changed, 96 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index b7d2750f50b..2664b4e137e 100644 --- a/configure.in +++ b/configure.in @@ -507,6 +507,22 @@ if test "$ap_cv_atomic_builtins" = "yes"; then AC_DEFINE(HAVE_ATOMIC_BUILTINS, 1, [Define if compiler provides atomic builtins]) fi +AC_CACHE_CHECK([whether the compiler handles weak symbols], [ap_cv_weak_symbols], +[AC_TRY_RUN([ +__attribute__ ((weak)) +int weak_noop(void) +{ + return 0; +} +int main() +{ + return weak_noop(); +}], [ap_cv_weak_symbols=yes], [ap_cv_weak_symbols=no], [ap_cv_weak_symbols=no])]) + +if test "$ap_cv_weak_symbols" = "yes"; then + AC_DEFINE(HAVE_WEAK_SYMBOLS, 1, [Define if compiler handles weak symbols]) +fi + case $host in powerpc-405-*) # The IBM ppc405cr processor has a bugged stwcx instruction. @@ -1938,6 +1954,43 @@ AC_SUBST(have_strdup) AC_SUBST(have_strstr) AC_SUBST(have_memchr) +AC_CACHE_CHECK([for memset_s support], [apr_cv_memset_s], +[AC_TRY_RUN([ +#ifdef HAVE_STRING_H +#define __STDC_WANT_LIB_EXT1__ 1 +#include +#endif + +int main(int argc, const char **argv) +{ + char buf[1] = "1"; + return memset_s(buf, sizeof buf, 0, sizeof buf) != 0 || *buf != '\0'; +}], [apr_cv_memset_s=yes], [apr_cv_memset_s=no], [apr_cv_memset_s=no])]) + +if test "$apr_cv_memset_s" = "yes"; then + AC_DEFINE([HAVE_MEMSET_S], 1, [Define if memset_s function is supported]) +fi + +AC_CACHE_CHECK([for explicit_bzero support], [apr_cv_explicit_bzero], +[AC_TRY_RUN([ +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_STRINGS_H +#include +#endif + +int main(int argc, const char **argv) +{ + char buf[1] = "1"; + explicit_bzero(buf, sizeof buf); + return *buf != '\0'; +}], [apr_cv_explicit_bzero=yes], [apr_cv_explicit_bzero=no], [apr_cv_explicit_bzero=no])]) + +if test "$apr_cv_explicit_bzero" = "yes"; then + AC_DEFINE([HAVE_EXPLICIT_BZERO], 1, [Define if explicit_bzero function is supported]) +fi + if test "$off_t_strfn" = "apr_strtoi64" && test "$have_int64_strfn" = "1"; then off_t_strfn=$int64_strfn fi diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 2ce022f6659..f57b95f6122 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -114,7 +114,7 @@ static apr_status_t crypto_clear(void *ptr) { apr_crypto_clear_t *clear = (apr_crypto_clear_t *)ptr; - memset(clear->buffer, 0, clear->size); + apr_crypto_memzero(clear->buffer, clear->size); clear->buffer = NULL; clear->size = 0; @@ -135,6 +135,38 @@ APR_DECLARE(apr_status_t) apr_crypto_clear(apr_pool_t *pool, return APR_SUCCESS; } +#if defined(HAVE_WEAK_SYMBOLS) +void apr__memzero_explicit(void *buffer, apr_size_t size); + +__attribute__ ((weak)) +void apr__memzero_explicit(void *buffer, apr_size_t size) +{ + memset(buffer, 0, size); +} +#endif + +APR_DECLARE(apr_status_t) apr_crypto_memzero(void *buffer, apr_size_t size) +{ +#if defined(WIN32) + SecureZeroMemory(buffer, size); +#elif defined(HAVE_MEMSET_S) + if (size) { + return memset_s(buffer, (rsize_t)size, 0, (rsize_t)size); + } +#elif defined(HAVE_EXPLICIT_BZERO) + explicit_bzero(buffer, size); +#elif defined(HAVE_WEAK_SYMBOLS) + apr__memzero_explicit(buffer, size); +#else + apr_size_t i; + volatile unsigned char *volatile ptr = buffer; + for (i = 0; i < size; ++i) { + ptr[i] = 0; + } +#endif + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_crypto_get_driver( const apr_crypto_driver_t **driver, const char *name, const char *params, const apu_err_t **result, apr_pool_t *pool) diff --git a/include/apr_crypto.h b/include/apr_crypto.h index d76b1d629c3..bf921cbffee 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -178,8 +178,7 @@ typedef struct apr_crypto_key_rec_t { APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool); /** - * @brief Register a cleanup to zero out the buffer provided - * when the pool is cleaned up. + * @brief Zero out the buffer provided when the pool is cleaned up. * * @param pool - pool to register the cleanup * @param buffer - buffer to zero out @@ -188,6 +187,15 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool); APR_DECLARE(apr_status_t) apr_crypto_clear(apr_pool_t *pool, void *buffer, apr_size_t size); +/** + * @brief Always zero out the buffer provided, without being optimized out by + * the compiler. + * + * @param buffer - buffer to zero out + * @param size - size of the buffer to zero out + */ +APR_DECLARE(apr_status_t) apr_crypto_memzero(void *buffer, apr_size_t size); + /** * @brief Get the driver struct for a name * From e79a421fa352a9c803fec29410433e850ac3e056 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 6 Oct 2016 21:20:04 +0000 Subject: [PATCH 7613/7878] atomic: fix API of atomic_{cas,xchg}ptr() for APR-2. The pointer ought to be declared volatile, not void. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1763666 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/netware/apr_atomic.c | 4 ++-- atomic/os390/atomic.c | 6 +++--- atomic/unix/builtins.c | 4 ++-- atomic/unix/ia32.c | 4 ++-- atomic/unix/mutex.c | 4 ++-- atomic/unix/ppc.c | 4 ++-- atomic/unix/s390.c | 4 ++-- atomic/unix/solaris.c | 4 ++-- atomic/win32/apr_atomic.c | 6 +++--- include/apr_atomic.h | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index b5d965b09b2..d7e00cd4e8f 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -64,12 +64,12 @@ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) return (atomic_xchgadd((unsigned long *)mem, 0xFFFFFFFF) - 1); } -APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +APR_DECLARE(void *) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp) { return (void*)atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with); } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with) { return (void*)atomic_xchg((unsigned long *)mem,(unsigned long)with); } diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c index 1d44ca3d1a3..8fd1586022c 100644 --- a/atomic/os390/atomic.c +++ b/atomic/os390/atomic.c @@ -83,7 +83,7 @@ apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t swap, } #if APR_SIZEOF_VOIDP == 4 -void *apr_atomic_casptr(volatile void **mem_ptr, +void *apr_atomic_casptr(void *volatile *mem_ptr, void *swap_ptr, const void *cmp_ptr) { @@ -93,7 +93,7 @@ void *apr_atomic_casptr(volatile void **mem_ptr, return (void *)cmp_ptr; } #elif APR_SIZEOF_VOIDP == 8 -void *apr_atomic_casptr(volatile void **mem_ptr, +void *apr_atomic_casptr(void *volatile *mem_ptr, void *swap_ptr, const void *cmp_ptr) { @@ -118,7 +118,7 @@ apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) return old; } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem_ptr, void *new_ptr) +APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem_ptr, void *new_ptr) { void *old_ptr; diff --git a/atomic/unix/builtins.c b/atomic/unix/builtins.c index 745acf155c0..ebf8833d193 100644 --- a/atomic/unix/builtins.c +++ b/atomic/unix/builtins.c @@ -66,12 +66,12 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint return __sync_lock_test_and_set(mem, val); } -APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp) { return (void*) __sync_val_compare_and_swap(mem, cmp, with); } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with) { __sync_synchronize(); diff --git a/atomic/unix/ia32.c b/atomic/unix/ia32.c index 63f48a753a9..9941af5f5f3 100644 --- a/atomic/unix/ia32.c +++ b/atomic/unix/ia32.c @@ -89,7 +89,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint return prev; } -APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp) { void *prev; #if APR_SIZEOF_VOIDP == 4 @@ -107,7 +107,7 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return prev; } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with) { void *prev; #if APR_SIZEOF_VOIDP == 4 diff --git a/atomic/unix/mutex.c b/atomic/unix/mutex.c index fba3be2ba15..4ec5451e144 100644 --- a/atomic/unix/mutex.c +++ b/atomic/unix/mutex.c @@ -174,7 +174,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint return prev; } -APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp) { void *prev; DECLARE_MUTEX_LOCKED(mutex, *mem); @@ -189,7 +189,7 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return prev; } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with) { void *prev; DECLARE_MUTEX_LOCKED(mutex, *mem); diff --git a/atomic/unix/ppc.c b/atomic/unix/ppc.c index ae8d503cc4d..87c6900d384 100644 --- a/atomic/unix/ppc.c +++ b/atomic/unix/ppc.c @@ -142,7 +142,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint return prev; } -APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp) { void *prev; #if APR_SIZEOF_VOIDP == 4 @@ -175,7 +175,7 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return prev; } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with) { void *prev; #if APR_SIZEOF_VOIDP == 4 diff --git a/atomic/unix/s390.c b/atomic/unix/s390.c index b6b6f42de02..cc139b83795 100644 --- a/atomic/unix/s390.c +++ b/atomic/unix/s390.c @@ -110,7 +110,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint return prev; } -APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp) { void *prev = (void *) cmp; #if APR_SIZEOF_VOIDP == 4 @@ -129,7 +129,7 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return prev; } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with) { void *prev = (void *) *mem; #if APR_SIZEOF_VOIDP == 4 diff --git a/atomic/unix/solaris.c b/atomic/unix/solaris.c index 547499a55ea..a160f6808cd 100644 --- a/atomic/unix/solaris.c +++ b/atomic/unix/solaris.c @@ -66,12 +66,12 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint return atomic_swap_32(mem, val); } -APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp) { return atomic_cas_ptr(mem, (void*) cmp, with); } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with) { return atomic_swap_ptr(mem, with); } diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index e1bc18e904e..9228d0a3da2 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -89,10 +89,10 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3 #endif } -APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +APR_DECLARE(void *) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp) { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) - return InterlockedCompareExchangePointer((void* volatile*)mem, with, (void*)cmp); + return InterlockedCompareExchangePointer(mem, with, (void*)cmp); #else return InterlockedCompareExchangePointer((void**)mem, with, (void*)cmp); #endif @@ -107,7 +107,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint #endif } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with) { return InterlockedExchangePointer((void**)mem, with); } diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 60e4bb54d0e..f34fdd2bd2e 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -121,7 +121,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint * @param cmp the value to compare it to * @return the old value of the pointer */ -APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); +APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp); /** * exchange a pair of pointer values @@ -129,7 +129,7 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void * @param with what to swap it with * @return the old value of the pointer */ -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with); +APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with); /** @} */ From 254f0cf6db1e43dfbd04aeb0c7d3485ed71d6483 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 6 Oct 2016 21:28:22 +0000 Subject: [PATCH 7614/7878] Follow up to r1763665: use correct array initializer. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1763667 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 2664b4e137e..b406562a612 100644 --- a/configure.in +++ b/configure.in @@ -1963,7 +1963,7 @@ AC_CACHE_CHECK([for memset_s support], [apr_cv_memset_s], int main(int argc, const char **argv) { - char buf[1] = "1"; + char buf[1] = {1}; return memset_s(buf, sizeof buf, 0, sizeof buf) != 0 || *buf != '\0'; }], [apr_cv_memset_s=yes], [apr_cv_memset_s=no], [apr_cv_memset_s=no])]) @@ -1982,7 +1982,7 @@ AC_CACHE_CHECK([for explicit_bzero support], [apr_cv_explicit_bzero], int main(int argc, const char **argv) { - char buf[1] = "1"; + char buf[1] = {1}; explicit_bzero(buf, sizeof buf); return *buf != '\0'; }], [apr_cv_explicit_bzero=yes], [apr_cv_explicit_bzero=no], [apr_cv_explicit_bzero=no])]) From 94ee5dea884daa2a3a412c561e5b3faa88cd753a Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 6 Oct 2016 22:25:22 +0000 Subject: [PATCH 7615/7878] crypto: provide apr_crypto_equals(), a timing attacks safe buffers comparison function. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1763669 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 15 +++++++++++++++ include/apr_crypto.h | 12 ++++++++++++ 2 files changed, 27 insertions(+) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index f57b95f6122..3b50ca531f2 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -167,6 +167,21 @@ APR_DECLARE(apr_status_t) apr_crypto_memzero(void *buffer, apr_size_t size) return APR_SUCCESS; } +APR_DECLARE(int) apr_crypto_equals(const void *buf1, const void *buf2, + apr_size_t size) +{ + const unsigned char *p1 = buf1; + const unsigned char *p2 = buf2; + unsigned char diff = 0; + apr_size_t i; + + for (i = 0; i < size; ++i) { + diff |= p1[i] ^ p2[i]; + } + + return 1 & ((diff - 1) >> 8); +} + APR_DECLARE(apr_status_t) apr_crypto_get_driver( const apr_crypto_driver_t **driver, const char *name, const char *params, const apu_err_t **result, apr_pool_t *pool) diff --git a/include/apr_crypto.h b/include/apr_crypto.h index bf921cbffee..68b196ad6e9 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -196,6 +196,18 @@ APR_DECLARE(apr_status_t) apr_crypto_clear(apr_pool_t *pool, void *buffer, */ APR_DECLARE(apr_status_t) apr_crypto_memzero(void *buffer, apr_size_t size); +/** + * @brief Timing attacks safe buffers comparison, where the executing time does + * not depend on the bytes compared but solely on the number of bytes. + * + * @param buf1 - first buffer to compare + * @param buf2 - second buffer to compare + * @param size - size of the buffers to compare + * @return 1 if the buffers are equals, 0 otherwise. + */ +APR_DECLARE(int) apr_crypto_equals(const void *buf1, const void *buf2, + apr_size_t size); + /** * @brief Get the driver struct for a name * From 9aae1eb99a026eb12c38c26a0a6653d2ee962201 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 7 Oct 2016 00:50:38 +0000 Subject: [PATCH 7616/7878] Follow up to r1763666: adapt unit test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1763670 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index b3862a8b06b..4bf2caa4688 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -85,7 +85,7 @@ static void test_xchgptr(abts_case *tc, void *data) { int a; void *ref = "little piggy"; - volatile void *target_ptr = ref; + void *target_ptr = ref; void *old_ptr; old_ptr = apr_atomic_xchgptr(&target_ptr, &a); @@ -126,7 +126,7 @@ static void test_cas_notequal(abts_case *tc, void *data) static void test_casptr_equal(abts_case *tc, void *data) { int a; - volatile void *target_ptr = NULL; + void *target_ptr = NULL; void *old_ptr; old_ptr = apr_atomic_casptr(&target_ptr, &a, NULL); @@ -137,7 +137,7 @@ static void test_casptr_equal(abts_case *tc, void *data) static void test_casptr_equal_nonnull(abts_case *tc, void *data) { int a, b; - volatile void *target_ptr = &a; + void *target_ptr = &a; void *old_ptr; old_ptr = apr_atomic_casptr(&target_ptr, &b, &a); @@ -148,7 +148,7 @@ static void test_casptr_equal_nonnull(abts_case *tc, void *data) static void test_casptr_notequal(abts_case *tc, void *data) { int a, b; - volatile void *target_ptr = &a; + void *target_ptr = &a; void *old_ptr; old_ptr = apr_atomic_casptr(&target_ptr, &a, &b); From 7640989b92d4535918951ee51c0b1d5accafe629 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 7 Oct 2016 00:56:18 +0000 Subject: [PATCH 7617/7878] Follow up to r1763666: CHANGES entry. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1763671 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 8340365ea7c..9c405602926 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_atomic: change the API of apr_atomic_casptr() apr_atomic_xchgptr() + functions to take a volatile pointer to void instead of pointer to + volatile void. [Yann Ylavic] + *) apr_crypto: Add apr_crypto_key() function which supports keys generated from a passphrase or a raw secret provided by the caller. Deprecate apr_crypto_passphrase(). [Graham Leggett] From 51a844b04dfee0856ee468062d769996a6d517cb Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 7 Oct 2016 00:59:05 +0000 Subject: [PATCH 7618/7878] Provide apr_siphash*() functions family. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1763672 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + CMakeLists.txt | 2 + NWGNUmakefile | 1 + apr.dsp | 4 + build.conf | 1 + crypto/apr_siphash.c | 196 ++++++++++++++++++++++++++++++++++++++++++ include/apr_siphash.h | 147 +++++++++++++++++++++++++++++++ libapr.dsp | 4 + test/Makefile.in | 5 +- test/Makefile.win | 1 + test/NWGNUaprtest | 1 + test/abts_tests.h | 7 +- test/testsiphash.c | 157 +++++++++++++++++++++++++++++++++ test/testutil.h | 1 + 14 files changed, 526 insertions(+), 3 deletions(-) create mode 100644 crypto/apr_siphash.c create mode 100644 include/apr_siphash.h create mode 100644 test/testsiphash.c diff --git a/CHANGES b/CHANGES index 9c405602926..fe238b7616c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_siphash: Implement keyed hash function SipHash. [Yann Ylavic] + *) apr_atomic: change the API of apr_atomic_casptr() apr_atomic_xchgptr() functions to take a volatile pointer to void instead of pointer to volatile void. [Yann Ylavic] diff --git a/CMakeLists.txt b/CMakeLists.txt index 07e93ee51ed..ab5b100798c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -195,6 +195,7 @@ SET(APR_PUBLIC_HEADERS_STATIC include/apr_sha1.h include/apr_shm.h include/apr_signal.h + include/apr_siphash.h include/apr_skiplist.h include/apr_strings.h include/apr_strmatch.h @@ -241,6 +242,7 @@ SET(APR_SOURCES crypto/apr_md5.c crypto/apr_passwd.c crypto/apr_sha1.c + crypto/apr_siphash.c crypto/crypt_blowfish.c crypto/getuuid.c crypto/uuid.c diff --git a/NWGNUmakefile b/NWGNUmakefile index 79f1962c6e9..1a86d7a1e48 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -324,6 +324,7 @@ FILES_lib_objs = \ $(OBJDIR)/apr_reslist.o \ $(OBJDIR)/apr_rmm.o \ $(OBJDIR)/apr_sha1.o \ + $(OBJDIR)/apr_siphash.o \ $(OBJDIR)/apr_skiplist.o \ $(OBJDIR)/apr_snprintf.o \ $(OBJDIR)/apr_strings.o \ diff --git a/apr.dsp b/apr.dsp index e0485981373..c5b3f480d3f 100644 --- a/apr.dsp +++ b/apr.dsp @@ -224,6 +224,10 @@ SOURCE=.\crypto\apr_sha1.c # End Source File # Begin Source File +SOURCE=.\crypto\apr_siphash.c +# End Source File +# Begin Source File + SOURCE=.\crypto\crypt_blowfish.c # End Source File # Begin Source File diff --git a/build.conf b/build.conf index d429994c5f6..8fbcfc8951d 100644 --- a/build.conf +++ b/build.conf @@ -15,6 +15,7 @@ paths = crypto/apr_md5.c crypto/apr_passwd.c crypto/apr_sha1.c + crypto/apr_siphash.c crypto/getuuid.c crypto/uuid.c crypto/crypt_blowfish.c diff --git a/crypto/apr_siphash.c b/crypto/apr_siphash.c new file mode 100644 index 00000000000..41cff70f231 --- /dev/null +++ b/crypto/apr_siphash.c @@ -0,0 +1,196 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * SipHash (C reference implementation, APR-ized), originating from: + * https://131002.net/siphash/siphash24.c. + */ + +#include "apr_siphash.h" + +#define ROTL64(x, n) (((x) << (n)) | ((x) >> (64 - (n)))) + +#define U8TO64_LE(p) \ + (((apr_uint64_t)((p)[0]) ) | \ + ((apr_uint64_t)((p)[1]) << 8) | \ + ((apr_uint64_t)((p)[2]) << 16) | \ + ((apr_uint64_t)((p)[3]) << 24) | \ + ((apr_uint64_t)((p)[4]) << 32) | \ + ((apr_uint64_t)((p)[5]) << 40) | \ + ((apr_uint64_t)((p)[6]) << 48) | \ + ((apr_uint64_t)((p)[7]) << 56)) + +#define U64TO8_LE(p, v) \ +do { \ + (p)[0] = (unsigned char)((v) ); \ + (p)[1] = (unsigned char)((v) >> 8); \ + (p)[2] = (unsigned char)((v) >> 16); \ + (p)[3] = (unsigned char)((v) >> 24); \ + (p)[4] = (unsigned char)((v) >> 32); \ + (p)[5] = (unsigned char)((v) >> 40); \ + (p)[6] = (unsigned char)((v) >> 48); \ + (p)[7] = (unsigned char)((v) >> 56); \ +} while (0) + +#define SIPROUND() \ +do { \ + v0 += v1; v1=ROTL64(v1,13); v1 ^= v0; v0=ROTL64(v0,32); \ + v2 += v3; v3=ROTL64(v3,16); v3 ^= v2; \ + v0 += v3; v3=ROTL64(v3,21); v3 ^= v0; \ + v2 += v1; v1=ROTL64(v1,17); v1 ^= v2; v2=ROTL64(v2,32); \ +} while(0) + +#define SIPHASH(r, s, n, k) \ +do { \ + const unsigned char *ptr, *end; \ + apr_uint64_t v0, v1, v2, v3, m; \ + apr_uint64_t k0, k1; \ + unsigned int rem; \ + \ + k0 = U8TO64_LE(k + 0); \ + k1 = U8TO64_LE(k + 8); \ + v3 = k1 ^ (apr_uint64_t)0x7465646279746573ULL; \ + v2 = k0 ^ (apr_uint64_t)0x6c7967656e657261ULL; \ + v1 = k1 ^ (apr_uint64_t)0x646f72616e646f6dULL; \ + v0 = k0 ^ (apr_uint64_t)0x736f6d6570736575ULL; \ + \ + rem = (unsigned int)(n & 0x7); \ + for (ptr = s, end = ptr + n - rem; ptr < end; ptr += 8) { \ + m = U8TO64_LE(ptr); \ + v3 ^= m; \ + cROUNDS \ + v0 ^= m; \ + } \ + m = (apr_uint64_t)(n & 0xff) << 56; \ + switch (rem) { \ + case 7: m |= (apr_uint64_t)ptr[6] << 48; \ + case 6: m |= (apr_uint64_t)ptr[5] << 40; \ + case 5: m |= (apr_uint64_t)ptr[4] << 32; \ + case 4: m |= (apr_uint64_t)ptr[3] << 24; \ + case 3: m |= (apr_uint64_t)ptr[2] << 16; \ + case 2: m |= (apr_uint64_t)ptr[1] << 8; \ + case 1: m |= (apr_uint64_t)ptr[0]; \ + case 0: break; \ + } \ + v3 ^= m; \ + cROUNDS \ + v0 ^= m; \ + \ + v2 ^= 0xff; \ + dROUNDS \ + \ + r = v0 ^ v1 ^ v2 ^ v3; \ +} while (0) + +APR_DECLARE(apr_uint64_t) apr_siphash(const void *src, apr_size_t len, + const unsigned char key[APR_SIPHASH_KSIZE], + unsigned int c, unsigned int d) +{ + apr_uint64_t h; + unsigned int i; + +#undef cROUNDS +#define cROUNDS \ + for (i = 0; i < c; ++i) { \ + SIPROUND(); \ + } + +#undef dROUNDS +#define dROUNDS \ + for (i = 0; i < d; ++i) { \ + SIPROUND(); \ + } + + SIPHASH(h, src, len, key); + return h; +} + +APR_DECLARE(void) apr_siphash_auth(unsigned char out[APR_SIPHASH_DSIZE], + const void *src, apr_size_t len, + const unsigned char key[APR_SIPHASH_KSIZE], + unsigned int c, unsigned int d) +{ + apr_uint64_t h; + h = apr_siphash(src, len, key, c, d); + U64TO8_LE(out, h); +} + +APR_DECLARE(apr_uint64_t) apr_siphash24(const void *src, apr_size_t len, + const unsigned char key[APR_SIPHASH_KSIZE]) +{ + apr_uint64_t h; + +#undef cROUNDS +#define cROUNDS \ + SIPROUND(); \ + SIPROUND(); + +#undef dROUNDS +#define dROUNDS \ + SIPROUND(); \ + SIPROUND(); \ + SIPROUND(); \ + SIPROUND(); + + SIPHASH(h, src, len, key); + return h; +} + +APR_DECLARE(void) apr_siphash24_auth(unsigned char out[APR_SIPHASH_DSIZE], + const void *src, apr_size_t len, + const unsigned char key[APR_SIPHASH_KSIZE]) +{ + apr_uint64_t h; + h = apr_siphash24(src, len, key); + U64TO8_LE(out, h); +} + +APR_DECLARE(apr_uint64_t) apr_siphash48(const void *src, apr_size_t len, + const unsigned char key[APR_SIPHASH_KSIZE]) +{ + apr_uint64_t h; + +#undef cROUNDS +#define cROUNDS \ + SIPROUND(); \ + SIPROUND(); \ + SIPROUND(); \ + SIPROUND(); + +#undef dROUNDS +#define dROUNDS \ + SIPROUND(); \ + SIPROUND(); \ + SIPROUND(); \ + SIPROUND(); \ + SIPROUND(); \ + SIPROUND(); \ + SIPROUND(); \ + SIPROUND(); + + SIPHASH(h, src, len, key); + return h; +} + +APR_DECLARE(void) apr_siphash48_auth(unsigned char out[APR_SIPHASH_DSIZE], + const void *src, apr_size_t len, + const unsigned char key[APR_SIPHASH_KSIZE]) +{ + apr_uint64_t h; + h = apr_siphash48(src, len, key); + U64TO8_LE(out, h); +} + diff --git a/include/apr_siphash.h b/include/apr_siphash.h new file mode 100644 index 00000000000..d25498bfaf0 --- /dev/null +++ b/include/apr_siphash.h @@ -0,0 +1,147 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + SipHash reference C implementation + Copyright (c) 2012-2014 Jean-Philippe Aumasson + + Copyright (c) 2012-2014 Daniel J. Bernstein + To the extent possible under law, the author(s) have dedicated all copyright + and related and neighboring rights to this software to the public domain + worldwide. This software is distributed without any warranty. + You should have received a copy of the CC0 Public Domain Dedication along + with this software. If not, see + . + */ + +#ifndef APR_SIPHASH_H +#define APR_SIPHASH_H + +#include "apr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file apr_siphash.h + * @brief APR-UTIL siphash library + * "SipHash-c-d is a family of pseudorandom functions (a.k.a. keyed + * hash functions) optimized for speed on short messages", designed by + * Jean-Philippe Aumasson and Daniel J. Bernstein. It generates a 64bit + * hash (or MAC) from the message and a 128bit key. + * See http://cr.yp.to/siphash/siphash-20120620.pdf for the details, + * c is the number of compression rounds, d the number of finalization + * rounds; we also define fast implementations for c = 2 with d = 4 (aka + * siphash-2-4), and c = 4 with d = 8 (aka siphash-4-8), as recommended + * parameters per the authors. + */ + +/** size of the siphash digest */ +#define APR_SIPHASH_DSIZE 8 + +/** size of the siphash key */ +#define APR_SIPHASH_KSIZE 16 + + +/** + * @brief Computes SipHash-c-d, producing a 64bit (APR_SIPHASH_DSIZE) hash + * from a message and a 128bit (APR_SIPHASH_KSIZE) secret key. + * @param src The message + * @param len The length of the message + * @param key The secret key + * @param c The number of compression rounds + * @param d The number of finalization rounds + * @return The hash value as a 64bit unsigned integer + */ +APR_DECLARE(apr_uint64_t) apr_siphash(const void *src, apr_size_t len, + const unsigned char key[APR_SIPHASH_KSIZE], + unsigned int c, unsigned int d); + +/** + * @brief Computes SipHash-c-d, producing a 64bit (APR_SIPHASH_DSIZE) hash + * from a message and a 128bit (APR_SIPHASH_KSIZE) secret key, into a possibly + * unaligned buffer (using the little endian representation as defined by the + * authors for interoperabilty) usable as a MAC. + * @param out The output buffer (or MAC) + * @param src The message + * @param len The length of the message + * @param key The secret key + * @param c The number of compression rounds + * @param d The number of finalization rounds + * @return The hash value as a 64bit unsigned integer + */ +APR_DECLARE(void) apr_siphash_auth(unsigned char out[APR_SIPHASH_DSIZE], + const void *src, apr_size_t len, + const unsigned char key[APR_SIPHASH_KSIZE], + unsigned int c, unsigned int d); + +/** + * @brief Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash + * from a message and a 128bit (APR_SIPHASH_KSIZE) secret key. + * @param src The message to hash + * @param len The length of the message + * @param key The secret key + * @return The hash value as a 64bit unsigned integer + */ +APR_DECLARE(apr_uint64_t) apr_siphash24(const void *src, apr_size_t len, + const unsigned char key[APR_SIPHASH_KSIZE]); + +/** + * @brief Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash + * from a message and a 128bit (APR_SIPHASH_KSIZE) secret key, into a possibly + * unaligned buffer (using the little endian representation as defined by the + * authors for interoperabilty) usable as a MAC. + * @param out The output buffer (or MAC) + * @param src The message + * @param len The length of the message + * @param key The secret key + * @return The hash value as a 64bit unsigned integer + */ +APR_DECLARE(void) apr_siphash24_auth(unsigned char out[APR_SIPHASH_DSIZE], + const void *src, apr_size_t len, + const unsigned char key[APR_SIPHASH_KSIZE]); + +/** + * @brief Computes SipHash-4-8, producing a 64bit (APR_SIPHASH_DSIZE) hash + * from a message and a 128bit (APR_SIPHASH_KSIZE) secret key. + * @param src The message + * @param len The length of the message + * @param key The secret key + * @return The hash value as a 64bit unsigned integer + */ +APR_DECLARE(apr_uint64_t) apr_siphash48(const void *src, apr_size_t len, + const unsigned char key[APR_SIPHASH_KSIZE]); + +/** + * @brief Computes SipHash-4-8, producing a 64bit (APR_SIPHASH_DSIZE) hash + * from a message and a 128bit (APR_SIPHASH_KSIZE) secret key, into a possibly + * unaligned buffer (using the little endian representation as defined by the + * authors for interoperabilty) usable as a MAC. + * @param out The output buffer (or MAC) + * @param src The message + * @param len The length of the message + * @param key The secret key + * @return The hash value as a 64bit unsigned integer + */ +APR_DECLARE(void) apr_siphash48_auth(unsigned char out[APR_SIPHASH_DSIZE], + const void *src, apr_size_t len, + const unsigned char key[APR_SIPHASH_KSIZE]); + +#ifdef __cplusplus +} +#endif + +#endif /* APR_SIPHASH_H */ diff --git a/libapr.dsp b/libapr.dsp index 07a77ad759f..3c4e53b54c5 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -259,6 +259,10 @@ SOURCE=.\crypto\apr_sha1.c # End Source File # Begin Source File +SOURCE=.\crypto\apr_siphash.c +# End Source File +# Begin Source File + SOURCE=.\crypto\crypt_blowfish.c # End Source File # Begin Source File diff --git a/test/Makefile.in b/test/Makefile.in index 7edb62e50a9..bde23a246fc 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -35,8 +35,9 @@ TESTS = testtime.lo teststr.lo testvsn.lo testipsub.lo testshm.lo \ testxlate.lo testdbd.lo testrmm.lo testmd4.lo \ teststrmatch.lo testpass.lo testcrypto.lo testqueue.lo \ testbuckets.lo testxml.lo testdbm.lo testuuid.lo testmd5.lo \ - testreslist.lo testbase64.lo testhooks.lo testlfsabi.lo \ - testlfsabi32.lo testlfsabi64.lo testescape.lo testskiplist.lo + testreslist.lo testbase64.lo testhooks.lo testlfsabi.lo \ + testlfsabi32.lo testlfsabi64.lo testescape.lo testskiplist.lo \ + testsiphash.lo OTHER_PROGRAMS = \ echod@EXEEXT@ \ diff --git a/test/Makefile.win b/test/Makefile.win index 0479a49078b..cea9c426fe0 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -125,6 +125,7 @@ ALL_TESTS = \ $(INTDIR)\testreslist.obj \ $(INTDIR)\testrmm.obj \ $(INTDIR)\testshm.obj \ + $(INTDIR)\testsiphash.obj \ $(INTDIR)\testsleep.obj \ $(INTDIR)\testsock.obj \ $(INTDIR)\testsockets.obj \ diff --git a/test/NWGNUaprtest b/test/NWGNUaprtest index f0b496ceff1..0a8bc01ceb9 100644 --- a/test/NWGNUaprtest +++ b/test/NWGNUaprtest @@ -217,6 +217,7 @@ FILES_nlm_objs = \ $(OBJDIR)/testrand.o \ $(OBJDIR)/testrmm.o \ $(OBJDIR)/testshm.o \ + $(OBJDIR)/testsiphash.o \ $(OBJDIR)/testskiplist.o \ $(OBJDIR)/testsleep.o \ $(OBJDIR)/testsock.o \ diff --git a/test/abts_tests.h b/test/abts_tests.h index b7cc8ef16ea..700fa33a983 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -23,6 +23,7 @@ const struct testlist { abts_suite *(*func)(abts_suite *suite); } alltests[] = { +#if 0 {testatomic}, {testdir}, {testdso}, @@ -77,7 +78,9 @@ const struct testlist { {testbase64}, {testmd4}, {testmd5}, +#endif {testcrypto}, +#if 0 {testdbd}, {testdate}, {testmemcache}, @@ -88,7 +91,9 @@ const struct testlist { {testqueue}, {testreslist}, {testlfsabi}, - {testskiplist} + {testskiplist}, +#endif + {testsiphash} }; #endif /* APR_TEST_INCLUDES */ diff --git a/test/testsiphash.c b/test/testsiphash.c new file mode 100644 index 00000000000..a986a935d8e --- /dev/null +++ b/test/testsiphash.c @@ -0,0 +1,157 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "apr_siphash.h" +#include "apr_crypto.h" + +#include "abts.h" +#include "testutil.h" + + +/* + * Wrapped test vectors from the authors, see + * https://131002.net/siphash/siphash24.c + */ +#define crypto_auth apr_siphash24_auth +typedef unsigned char u8; + +/* + SipHash-2-4 output with + k = 00 01 02 ... + and + in = (empty string) + in = 00 (1 byte) + in = 00 01 (2 bytes) + in = 00 01 02 (3 bytes) + ... + in = 00 01 02 ... 3e (63 bytes) +*/ +static u8 vectors[64][8] = +{ + { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, }, + { 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, }, + { 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d, }, + { 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85, }, + { 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf, }, + { 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18, }, + { 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb, }, + { 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab, }, + { 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93, }, + { 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e, }, + { 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a, }, + { 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4, }, + { 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75, }, + { 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14, }, + { 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7, }, + { 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1, }, + { 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f, }, + { 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69, }, + { 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b, }, + { 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb, }, + { 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe, }, + { 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0, }, + { 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93, }, + { 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8, }, + { 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8, }, + { 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc, }, + { 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17, }, + { 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f, }, + { 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde, }, + { 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6, }, + { 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad, }, + { 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32, }, + { 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71, }, + { 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7, }, + { 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12, }, + { 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15, }, + { 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, }, + { 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, }, + { 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, }, + { 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, }, + { 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, }, + { 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad, }, + { 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18, }, + { 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4, }, + { 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9, }, + { 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9, }, + { 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb, }, + { 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0, }, + { 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6, }, + { 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7, }, + { 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee, }, + { 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1, }, + { 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a, }, + { 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81, }, + { 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f, }, + { 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24, }, + { 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7, }, + { 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea, }, + { 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60, }, + { 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66, }, + { 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c, }, + { 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f, }, + { 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, }, + { 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, } +}; + +static int test_vectors(void) +{ +#define MAXLEN 64 + u8 in[MAXLEN], out[8], k[16]; + int i; + int ok = 1; + + for( i = 0; i < 16; ++i ) k[i] = i; + + for( i = 0; i < MAXLEN; ++i ) + { + in[i] = i; + crypto_auth( out, in, i, k ); + + if ( memcmp( out, vectors[i], 8 ) ) + { + printf( "test vector failed for %d bytes\n", i ); + ok = 0; + } + /* added validation (basic) of apr_crypto_equals() */ + else if ( !apr_crypto_equals(out, vectors[i], 8) + || apr_crypto_equals(out, vectors[(i + 1) % MAXLEN], 8) ) + { + printf( "apr_crypto_equals() failed for %d bytes\n", i ); + ok = 0; + } + } + + return ok; +} + + +static void test_siphash(abts_case *tc, void *data) +{ + ABTS_ASSERT(tc, "test vectors", (test_vectors() != 0)); +} + +abts_suite *testsiphash(abts_suite *suite) +{ + suite = ADD_SUITE(suite); + + abts_run_test(suite, test_siphash, NULL); + + return suite; +} diff --git a/test/testutil.h b/test/testutil.h index 02e3f243c68..cdd96a3b372 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -131,5 +131,6 @@ abts_suite *testrmm(abts_suite *suite); abts_suite *testdbm(abts_suite *suite); abts_suite *testlfsabi(abts_suite *suite); abts_suite *testskiplist(abts_suite *suite); +abts_suite *testsiphash(abts_suite *suite); #endif /* APR_TEST_INCLUDES */ From c86002311b0007663b62443b4b732c6775c4b7f6 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 7 Oct 2016 01:07:40 +0000 Subject: [PATCH 7619/7878] Follow up to r1763672: remove debug triks :p git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1763673 13f79535-47bb-0310-9956-ffa450edef68 --- test/abts_tests.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/abts_tests.h b/test/abts_tests.h index 700fa33a983..a88f1082414 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -23,7 +23,6 @@ const struct testlist { abts_suite *(*func)(abts_suite *suite); } alltests[] = { -#if 0 {testatomic}, {testdir}, {testdso}, @@ -78,9 +77,7 @@ const struct testlist { {testbase64}, {testmd4}, {testmd5}, -#endif {testcrypto}, -#if 0 {testdbd}, {testdate}, {testmemcache}, @@ -92,7 +89,6 @@ const struct testlist { {testreslist}, {testlfsabi}, {testskiplist}, -#endif {testsiphash} }; From 63e74e45c9f959aac3646232f7bb627ec3a77fce Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 7 Oct 2016 21:49:04 +0000 Subject: [PATCH 7620/7878] crypto: follow up to r1763669. Add tests for apr_crypto_memzero() and apr_crypto_equals. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1763842 13f79535-47bb-0310-9956-ffa450edef68 --- test/testcrypto.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/test/testcrypto.c b/test/testcrypto.c index 7d66feec664..865cffc6d5e 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -1375,6 +1375,81 @@ static void test_crypto_get_block_key_modes_commoncrypto(abts_case *tc, void *da } +static void test_crypto_memzero(abts_case *tc, void *data) +{ + /* Aligned message */ + struct { + char buf[7 * sizeof(int)]; + int untouched; + } msg; + /* A bit of type punning such that 'msg' might look unused + * after the call to apr_crypto_memzero(). + */ + int *ptr = (int *)&msg; + int i; + + /* Fill buf with non-zeros (odds) */ + for (i = 1; i < 2 * sizeof(msg.buf); i += 2) { + msg.buf[i / 2] = (char)i; + ABTS_ASSERT(tc, "test_crypto_memzero() barrier", msg.buf[i / 2] != 0); + } + + /* Zero out the whole, and check it */ + apr_crypto_memzero(&msg, sizeof msg); + for (i = 0; i < sizeof(msg) / sizeof(*ptr); ++i) { + ABTS_ASSERT(tc, "test_crypto_memzero() optimized out", ptr[i] == 0); + } +} + +static void test_crypto_equals(abts_case *tc, void *data) +{ + /* Buffers of each type of scalar */ + union { + char c; + short s; + int i; + long l; + float f; + double d; + void *p; + } buf0[7], buf1[7], buf[7]; + char *ptr = (char *)buf; + int i; + +#define TEST_SCALAR_MATCH(i, x, r) \ + ABTS_ASSERT(tc, "test_crypto_equals(" APR_STRINGIFY(x) ")" \ + " != " APR_STRINGIFY(r), \ + apr_crypto_equals(&buf##r[i].x, &buf[i].x, \ + sizeof(buf[i].x)) == r) + + /* Fill buf with non-zeros (odds) */ + for (i = 1; i < 2 * sizeof(buf); i += 2) { + ptr[i / 2] = (char)i; + } + /* Set buf1 = buf */ + memcpy(buf1, buf, sizeof buf); + /* Set buf0 = {0} */ + memset(buf0, 0, sizeof buf0); + + /* Check that buf1 == buf for each scalar */ + TEST_SCALAR_MATCH(0, c, 1); + TEST_SCALAR_MATCH(1, s, 1); + TEST_SCALAR_MATCH(2, i, 1); + TEST_SCALAR_MATCH(3, l, 1); + TEST_SCALAR_MATCH(4, f, 1); + TEST_SCALAR_MATCH(5, d, 1); + TEST_SCALAR_MATCH(6, p, 1); + + /* Check that buf0 != buf for each scalar */ + TEST_SCALAR_MATCH(0, c, 0); + TEST_SCALAR_MATCH(1, s, 0); + TEST_SCALAR_MATCH(2, i, 0); + TEST_SCALAR_MATCH(3, l, 0); + TEST_SCALAR_MATCH(4, f, 0); + TEST_SCALAR_MATCH(5, d, 0); + TEST_SCALAR_MATCH(6, p, 0); +} + abts_suite *testcrypto(abts_suite *suite) { suite = ADD_SUITE(suite); @@ -1451,6 +1526,9 @@ abts_suite *testcrypto(abts_suite *suite) /* test block key modes commoncrypto */ abts_run_test(suite, test_crypto_get_block_key_modes_commoncrypto, NULL); + abts_run_test(suite, test_crypto_memzero, NULL); + abts_run_test(suite, test_crypto_equals, NULL); + return suite; } From f22e9adb18a29741fc43f36ace93cde2175c2db6 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 7 Oct 2016 21:51:06 +0000 Subject: [PATCH 7621/7878] siphash: follow up to r1763672. apr_crypto_equals() has its own test now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1763843 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsiphash.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/test/testsiphash.c b/test/testsiphash.c index a986a935d8e..58321adebd8 100644 --- a/test/testsiphash.c +++ b/test/testsiphash.c @@ -18,18 +18,18 @@ #include #include "apr_siphash.h" -#include "apr_crypto.h" #include "abts.h" #include "testutil.h" - /* * Wrapped test vectors from the authors, see * https://131002.net/siphash/siphash24.c */ -#define crypto_auth apr_siphash24_auth typedef unsigned char u8; +#define crypto_auth apr_siphash24_auth + +#define MAXLEN 64 /* SipHash-2-4 output with @@ -42,7 +42,7 @@ typedef unsigned char u8; ... in = 00 01 02 ... 3e (63 bytes) */ -static u8 vectors[64][8] = +static const u8 vectors[MAXLEN][8] = { { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, }, { 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, }, @@ -112,7 +112,6 @@ static u8 vectors[64][8] = static int test_vectors(void) { -#define MAXLEN 64 u8 in[MAXLEN], out[8], k[16]; int i; int ok = 1; @@ -129,29 +128,21 @@ static int test_vectors(void) printf( "test vector failed for %d bytes\n", i ); ok = 0; } - /* added validation (basic) of apr_crypto_equals() */ - else if ( !apr_crypto_equals(out, vectors[i], 8) - || apr_crypto_equals(out, vectors[(i + 1) % MAXLEN], 8) ) - { - printf( "apr_crypto_equals() failed for %d bytes\n", i ); - ok = 0; - } } return ok; } - -static void test_siphash(abts_case *tc, void *data) +static void test_siphash_vectors(abts_case *tc, void *data) { - ABTS_ASSERT(tc, "test vectors", (test_vectors() != 0)); + ABTS_ASSERT(tc, "SipHash-2-4 test vectors", test_vectors()); } abts_suite *testsiphash(abts_suite *suite) { suite = ADD_SUITE(suite); - abts_run_test(suite, test_siphash, NULL); + abts_run_test(suite, test_siphash_vectors, NULL); return suite; } From 748f354f8bbfbee7139343b87603f617f2bfb2b7 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 17 Oct 2016 22:38:28 +0000 Subject: [PATCH 7622/7878] Follow up to r1763672: missing nw_export.h update. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1765378 13f79535-47bb-0310-9956-ffa450edef68 --- build/nw_export.h | 1 + 1 file changed, 1 insertion(+) diff --git a/build/nw_export.h b/build/nw_export.h index cc83064bc68..c69442e8c3e 100644 --- a/build/nw_export.h +++ b/build/nw_export.h @@ -53,6 +53,7 @@ #include "apr_sha1.h" #include "apr_shm.h" #include "apr_signal.h" +#include "apr_siphash.h" #include "apr_skiplist.h" #include "apr_strings.h" #include "apr_strmatch.h" From 93c5b6ceda7b63168ec8543aaaa8e7f4c6bb832b Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Fri, 28 Oct 2016 13:12:06 +0000 Subject: [PATCH 7623/7878] Follow-up to r1726928: Add APR_DECLARE() to apr_cstr_*() functions declaration to fix Windows build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1767019 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_cstr.h | 65 +++++++++++++++++++++++++-------------------- strings/apr_cstr.c | 66 +++++++++++++++++++++++++--------------------- 2 files changed, 72 insertions(+), 59 deletions(-) diff --git a/include/apr_cstr.h b/include/apr_cstr.h index a583ae1900b..3f1b1a0995a 100644 --- a/include/apr_cstr.h +++ b/include/apr_cstr.h @@ -78,10 +78,10 @@ extern "C" { * * @since New in 1.6 */ -apr_array_header_t * apr_cstr_split(const char *input, - const char *sep_chars, - int chop_whitespace, - apr_pool_t *pool); +APR_DECLARE(apr_array_header_t *) apr_cstr_split(const char *input, + const char *sep_chars, + int chop_whitespace, + apr_pool_t *pool); /** Like apr_cstr_split(), but append to existing @a array instead of * creating a new one. Allocate the copied substrings in @a pool @@ -89,11 +89,11 @@ apr_array_header_t * apr_cstr_split(const char *input, * * @since New in 1.6 */ -void apr_cstr_split_append(apr_array_header_t *array, - const char *input, - const char *sep_chars, - int chop_whitespace, - apr_pool_t *pool); +APR_DECLARE(void) apr_cstr_split_append(apr_array_header_t *array, + const char *input, + const char *sep_chars, + int chop_whitespace, + apr_pool_t *pool); /** Return @c TRUE iff @a str matches any of the elements of @a list, a list @@ -101,13 +101,15 @@ void apr_cstr_split_append(apr_array_header_t *array, * * @since New in 1.6 */ -int apr_cstr_match_glob_list(const char *str, const apr_array_header_t *list); +APR_DECLARE(int) apr_cstr_match_glob_list(const char *str, + const apr_array_header_t *list); /** Return @c TRUE iff @a str exactly matches any of the elements of @a list. * * @since New in 1.6 */ -int apr_cstr_match_list(const char *str, const apr_array_header_t *list); +APR_DECLARE(int) apr_cstr_match_list(const char *str, + const apr_array_header_t *list); /** * Get the next token from @a *str interpreting any char from @a sep as a @@ -120,7 +122,7 @@ int apr_cstr_match_list(const char *str, const apr_array_header_t *list); * * @since New in 1.6. */ -char * apr_cstr_tokenize(const char *sep, char **str); +APR_DECLARE(char *) apr_cstr_tokenize(const char *sep, char **str); /** * Return the number of line breaks in @a msg, allowing any kind of newline @@ -128,7 +130,7 @@ char * apr_cstr_tokenize(const char *sep, char **str); * * @since New in 1.6. */ -int apr_cstr_count_newlines(const char *msg); +APR_DECLARE(int) apr_cstr_count_newlines(const char *msg); #if 0 /* XXX: stringbuf logic is not present in APR */ /** @@ -139,9 +141,9 @@ int apr_cstr_count_newlines(const char *msg); * * @since New in 1.6. */ -char * apr_cstr_join(const apr_array_header_t *strings, - const char *separator, - apr_pool_t *pool); +APR_DECLARE(char *) apr_cstr_join(const apr_array_header_t *strings, + const char *separator, + apr_pool_t *pool); #endif /** @@ -156,7 +158,7 @@ char * apr_cstr_join(const apr_array_header_t *strings, * * @since New in 1.6. */ -int apr_cstr_casecmp(const char *str1, const char *str2); +APR_DECLARE(int) apr_cstr_casecmp(const char *str1, const char *str2); /** * Perform a case-insensitive comparison of two strings @a atr1 and @a atr2, @@ -170,7 +172,9 @@ int apr_cstr_casecmp(const char *str1, const char *str2); * * @since New in 1.6. */ -int apr_cstr_casecmpn(const char *str1, const char *str2, apr_size_t n); +APR_DECLARE(int) apr_cstr_casecmpn(const char *str1, + const char *str2, + apr_size_t n); /** * Parse the C string @a str into a 64 bit number, and return it in @a *n. @@ -191,9 +195,10 @@ int apr_cstr_casecmpn(const char *str1, const char *str2, apr_size_t n); * * @since New in 1.6. */ -apr_status_t apr_cstr_strtoi64(apr_int64_t *n, const char *str, - apr_int64_t minval, apr_int64_t maxval, - int base); +APR_DECLARE(apr_status_t) apr_cstr_strtoi64(apr_int64_t *n, const char *str, + apr_int64_t minval, + apr_int64_t maxval, + int base); /** * Parse the C string @a str into a 64 bit number, and return it in @a *n. @@ -204,7 +209,7 @@ apr_status_t apr_cstr_strtoi64(apr_int64_t *n, const char *str, * * @since New in 1.6. */ -apr_status_t apr_cstr_atoi64(apr_int64_t *n, const char *str); +APR_DECLARE(apr_status_t) apr_cstr_atoi64(apr_int64_t *n, const char *str); /** * Parse the C string @a str into a 32 bit number, and return it in @a *n. @@ -215,7 +220,7 @@ apr_status_t apr_cstr_atoi64(apr_int64_t *n, const char *str); * * @since New in 1.6. */ -apr_status_t apr_cstr_atoi(int *n, const char *str); +APR_DECLARE(apr_status_t) apr_cstr_atoi(int *n, const char *str); /** * Parse the C string @a str into an unsigned 64 bit number, and return @@ -239,9 +244,10 @@ apr_status_t apr_cstr_atoi(int *n, const char *str); * * @since New in 1.6. */ -apr_status_t apr_cstr_strtoui64(apr_uint64_t *n, const char *str, - apr_uint64_t minval, apr_uint64_t maxval, - int base); +APR_DECLARE(apr_status_t) apr_cstr_strtoui64(apr_uint64_t *n, const char *str, + apr_uint64_t minval, + apr_uint64_t maxval, + int base); /** * Parse the C string @a str into an unsigned 64 bit number, and return @@ -253,7 +259,7 @@ apr_status_t apr_cstr_strtoui64(apr_uint64_t *n, const char *str, * * @since New in 1.6. */ -apr_status_t apr_cstr_atoui64(apr_uint64_t *n, const char *str); +APR_DECLARE(apr_status_t) apr_cstr_atoui64(apr_uint64_t *n, const char *str); /** * Parse the C string @a str into an unsigned 32 bit number, and return @@ -265,7 +271,7 @@ apr_status_t apr_cstr_atoui64(apr_uint64_t *n, const char *str); * * @since New in 1.6. */ -apr_status_t apr_cstr_atoui(unsigned int *n, const char *str); +APR_DECLARE(apr_status_t) apr_cstr_atoui(unsigned int *n, const char *str); /** * Skip the common prefix @a prefix from the C string @a str, and return @@ -274,7 +280,8 @@ apr_status_t apr_cstr_atoui(unsigned int *n, const char *str); * * @since New in 1.6. */ -const char * apr_cstr_skip_prefix(const char *str, const char *prefix); +APR_DECLARE(const char *) apr_cstr_skip_prefix(const char *str, + const char *prefix); /** @} */ diff --git a/strings/apr_cstr.c b/strings/apr_cstr.c index 7c4145109e4..7717c4406e7 100644 --- a/strings/apr_cstr.c +++ b/strings/apr_cstr.c @@ -27,11 +27,11 @@ #include "apr_want.h" #include "apr_cstr.h" -void apr_cstr_split_append(apr_array_header_t *array, - const char *input, - const char *sep_chars, - int chop_whitespace, - apr_pool_t *pool) +APR_DECLARE(void) apr_cstr_split_append(apr_array_header_t *array, + const char *input, + const char *sep_chars, + int chop_whitespace, + apr_pool_t *pool) { char *pats; char *p; @@ -64,10 +64,10 @@ void apr_cstr_split_append(apr_array_header_t *array, } -apr_array_header_t * apr_cstr_split(const char *input, - const char *sep_chars, - int chop_whitespace, - apr_pool_t *pool) +APR_DECLARE(apr_array_header_t *) apr_cstr_split(const char *input, + const char *sep_chars, + int chop_whitespace, + apr_pool_t *pool) { apr_array_header_t *a = apr_array_make(pool, 5, sizeof(input)); apr_cstr_split_append(a, input, sep_chars, chop_whitespace, pool); @@ -75,8 +75,8 @@ apr_array_header_t * apr_cstr_split(const char *input, } -int apr_cstr_match_glob_list(const char *str, - const apr_array_header_t *list) +APR_DECLARE(int) apr_cstr_match_glob_list(const char *str, + const apr_array_header_t *list) { int i; @@ -91,7 +91,8 @@ int apr_cstr_match_glob_list(const char *str, return FALSE; } -int apr_cstr_match_list(const char *str, const apr_array_header_t *list) +APR_DECLARE(int) apr_cstr_match_list(const char *str, + const apr_array_header_t *list) { int i; @@ -106,7 +107,7 @@ int apr_cstr_match_list(const char *str, const apr_array_header_t *list) return FALSE; } -char * apr_cstr_tokenize(const char *sep, char **str) +APR_DECLARE(char *) apr_cstr_tokenize(const char *sep, char **str) { char *token; char *next; @@ -146,7 +147,7 @@ char * apr_cstr_tokenize(const char *sep, char **str) return token; } -int apr_cstr_count_newlines(const char *msg) +APR_DECLARE(int) apr_cstr_count_newlines(const char *msg) { int count = 0; const char *p; @@ -171,9 +172,9 @@ int apr_cstr_count_newlines(const char *msg) } #if 0 /* XXX: stringbuf logic is not present in APR */ -char * apr_cstr_join(const apr_array_header_t *strings, - const char *separator, - apr_pool_t *pool) +APR_DECLARE(char *) apr_cstr_join(const apr_array_header_t *strings, + const char *separator, + apr_pool_t *pool) { svn_stringbuf_t *new_str = svn_stringbuf_create_empty(pool); size_t sep_len = strlen(separator); @@ -279,7 +280,7 @@ static const short ucharmap[] = { }; #endif -int apr_cstr_casecmp(const char *s1, const char *s2) +APR_DECLARE(int) apr_cstr_casecmp(const char *s1, const char *s2) { const unsigned char *str1 = (const unsigned char *)s1; const unsigned char *str2 = (const unsigned char *)s2; @@ -296,7 +297,8 @@ int apr_cstr_casecmp(const char *s1, const char *s2) } } -int apr_cstr_casecmpn(const char *s1, const char *s2, apr_size_t n) +APR_DECLARE(int) apr_cstr_casecmpn(const char *s1, const char *s2, + apr_size_t n) { const unsigned char *str1 = (const unsigned char *)s1; const unsigned char *str2 = (const unsigned char *)s2; @@ -314,9 +316,11 @@ int apr_cstr_casecmpn(const char *s1, const char *s2, apr_size_t n) return 0; } -apr_status_t apr_cstr_strtoui64(apr_uint64_t *n, const char *str, - apr_uint64_t minval, apr_uint64_t maxval, - int base) +APR_DECLARE(apr_status_t) apr_cstr_strtoui64(apr_uint64_t *n, + const char *str, + apr_uint64_t minval, + apr_uint64_t maxval, + int base) { apr_int64_t val; char *endptr; @@ -336,12 +340,12 @@ apr_status_t apr_cstr_strtoui64(apr_uint64_t *n, const char *str, return APR_SUCCESS; } -apr_status_t apr_cstr_atoui64(apr_uint64_t *n, const char *str) +APR_DECLARE(apr_status_t) apr_cstr_atoui64(apr_uint64_t *n, const char *str) { return apr_cstr_strtoui64(n, str, 0, APR_UINT64_MAX, 10); } -apr_status_t apr_cstr_atoui(unsigned int *n, const char *str) +APR_DECLARE(apr_status_t) apr_cstr_atoui(unsigned int *n, const char *str) { apr_uint64_t val; apr_status_t rv = apr_cstr_strtoui64(&val, str, 0, APR_UINT32_MAX, 10); @@ -350,9 +354,11 @@ apr_status_t apr_cstr_atoui(unsigned int *n, const char *str) return rv; } -apr_status_t apr_cstr_strtoi64(apr_int64_t *n, const char *str, - apr_int64_t minval, apr_int64_t maxval, - int base) +APR_DECLARE(apr_status_t) apr_cstr_strtoi64(apr_int64_t *n, + const char *str, + apr_int64_t minval, + apr_int64_t maxval, + int base) { apr_int64_t val; char *endptr; @@ -370,12 +376,12 @@ apr_status_t apr_cstr_strtoi64(apr_int64_t *n, const char *str, return APR_SUCCESS; } -apr_status_t apr_cstr_atoi64(apr_int64_t *n, const char *str) +APR_DECLARE(apr_status_t) apr_cstr_atoi64(apr_int64_t *n, const char *str) { return apr_cstr_strtoi64(n, str, APR_INT64_MIN, APR_INT64_MAX, 10); } -apr_status_t apr_cstr_atoi(int *n, const char *str) +APR_DECLARE(apr_status_t) apr_cstr_atoi(int *n, const char *str) { apr_int64_t val; apr_status_t rv; @@ -386,7 +392,7 @@ apr_status_t apr_cstr_atoi(int *n, const char *str) return rv; } -const char * +APR_DECLARE(const char *) apr_cstr_skip_prefix(const char *str, const char *prefix) { apr_size_t len = strlen(prefix); From b35dbf153cc2b787f794a58d0c0cc7b540dbb24e Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Fri, 28 Oct 2016 23:00:24 +0000 Subject: [PATCH 7624/7878] Follow-up to r1604596: Fix Windows build. * test/Makefile.win (ALL_TESTS): Add testskiplist.obj git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1767091 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Makefile.win b/test/Makefile.win index cea9c426fe0..f99fa64f490 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -133,6 +133,7 @@ ALL_TESTS = \ $(INTDIR)\teststr.obj \ $(INTDIR)\teststrmatch.obj \ $(INTDIR)\teststrnatcmp.obj \ + $(INTDIR)\testskiplist.obj \ $(INTDIR)\testtable.obj \ $(INTDIR)\testtemp.obj \ $(INTDIR)\testthread.obj \ From 0428a67f2b10bf9663e0204aabe3f7096fb21d3d Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sat, 5 Nov 2016 18:37:49 +0000 Subject: [PATCH 7625/7878] Redis in APR_2.0 too git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1768269 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 3 + NWGNUmakefile | 3 +- build.conf | 1 + include/apr_redis.h | 457 +++++++++++++ redis/apr_redis.c | 1544 +++++++++++++++++++++++++++++++++++++++++++ test/Makefile.in | 2 +- test/Makefile.win | 1 + test/abts_tests.h | 1 + test/testredis.c | 552 ++++++++++++++++ test/testutil.h | 1 + 10 files changed, 2563 insertions(+), 2 deletions(-) create mode 100644 include/apr_redis.h create mode 100644 redis/apr_redis.c create mode 100644 test/testredis.c diff --git a/CMakeLists.txt b/CMakeLists.txt index ab5b100798c..c4936325b89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,6 +188,7 @@ SET(APR_PUBLIC_HEADERS_STATIC include/apr_proc_mutex.h include/apr_queue.h include/apr_random.h + include/apr_redis.h include/apr_reslist.h include/apr_ring.h include/apr_rmm.h @@ -310,6 +311,7 @@ SET(APR_SOURCES random/unix/apr_random.c random/unix/sha2.c random/unix/sha2_glue.c + redis/apr_redis.c shmem/win32/shm.c strings/apr_cpystrn.c strings/apr_cstr.c @@ -390,6 +392,7 @@ SET(APR_TEST_SOURCES test/testprocmutex.c test/testqueue.c test/testrand.c + test/testredis.c test/testreslist.c test/testrmm.c test/testshm.c diff --git a/NWGNUmakefile b/NWGNUmakefile index 1a86d7a1e48..9b472007760 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -321,6 +321,7 @@ FILES_lib_objs = \ $(OBJDIR)/apr_pools.o \ $(OBJDIR)/apr_queue.o \ $(OBJDIR)/apr_random.o \ + $(OBJDIR)/apr_redis.o \ $(OBJDIR)/apr_reslist.o \ $(OBJDIR)/apr_rmm.o \ $(OBJDIR)/apr_sha1.o \ @@ -446,7 +447,7 @@ vpath %.c atomic/netware:strings:tables:passwd:time/unix vpath %.c file_io/netware:file_io/unix:locks/netware:misc/netware:misc/unix vpath %.c threadproc/netware:poll/unix:shmem/unix:support/unix:random/unix vpath %.c dso/netware:memory/unix:mmap/unix:user/netware:util-misc -vpath %.c buckets:crypto:dbd:dbm:dbm/sdbm:encoding:hooks:memcache:misc:strmatch:uri:xlate +vpath %.c buckets:crypto:dbd:dbm:dbm/sdbm:encoding:hooks:memcache:redis:misc:strmatch:uri:xlate # Use the win32 network_io if Winsock is being used ifndef USE_STDSOCKETS diff --git a/build.conf b/build.conf index 8fbcfc8951d..d01fd1dc627 100644 --- a/build.conf +++ b/build.conf @@ -26,6 +26,7 @@ paths = hooks/*.c misc/*.c memcache/*.c + redis/*.c uri/apr_uri.c xml/*.c strmatch/*.c diff --git a/include/apr_redis.h b/include/apr_redis.h new file mode 100644 index 00000000000..9684bf4c1de --- /dev/null +++ b/include/apr_redis.h @@ -0,0 +1,457 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file apr_redis.h + * @brief Client interface for redis + * @remark To use this interface you must have a separate redis + * for more information. + */ + +#ifndef APR_REDIS_H +#define APR_REDIS_H + +#include "apr.h" +#include "apr_pools.h" +#include "apr_time.h" +#include "apr_strings.h" +#include "apr_network_io.h" +#include "apr_ring.h" +#include "apr_buckets.h" +#include "apr_reslist.h" +#include "apr_hash.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#ifndef RC_DEFAULT_SERVER_PORT +#define RC_DEFAULT_SERVER_PORT 6379 +#endif + +#ifndef RC_DEFAULT_SERVER_MIN +#define RC_DEFAULT_SERVER_MIN 0 +#endif + +#ifndef RC_DEFAULT_SERVER_SMAX +#define RC_DEFAULT_SERVER_SMAX 1 +#endif + +#ifndef RC_DEFAULT_SERVER_TTL +#define RC_DEFAULT_SERVER_TTL 600 +#endif + +/** + * @defgroup APR_Util_RC Redis Client Routines + * @ingroup APR_Util + * @{ + */ + +/** Specifies the status of a redis server */ +typedef enum +{ + APR_RC_SERVER_LIVE, /**< Server is alive and responding to requests */ + APR_RC_SERVER_DEAD /**< Server is not responding to requests */ +} apr_redis_server_status_t; + +/** Opaque redis client connection object */ +typedef struct apr_redis_conn_t apr_redis_conn_t; + +/** Redis Server Info Object */ +typedef struct apr_redis_server_t apr_redis_server_t; +struct apr_redis_server_t +{ + const char *host; /**< Hostname of this Server */ + apr_port_t port; /**< Port of this Server */ + apr_redis_server_status_t status; /**< @see apr_redis_server_status_t */ +#if APR_HAS_THREADS || defined(DOXYGEN) + apr_reslist_t *conns; /**< Resource list of actual client connections */ +#else + apr_redis_conn_t *conn; +#endif + apr_pool_t *p; /** Pool to use for private allocations */ +#if APR_HAS_THREADS + apr_thread_mutex_t *lock; +#endif + apr_time_t btime; + apr_uint32_t rwto; + struct + { + int major; + int minor; + int patch; + char *number; + } version; +}; + +typedef struct apr_redis_t apr_redis_t; + +/* Custom hash callback function prototype, user for server selection. +* @param baton user selected baton +* @param data data to hash +* @param data_len length of data +*/ +typedef apr_uint32_t (*apr_redis_hash_func)(void *baton, + const char *data, + const apr_size_t data_len); +/* Custom Server Select callback function prototype. +* @param baton user selected baton +* @param rc redis instance, use rc->live_servers to select a node +* @param hash hash of the selected key. +*/ +typedef apr_redis_server_t* (*apr_redis_server_func)(void *baton, + apr_redis_t *rc, + const apr_uint32_t hash); + +/** Container for a set of redis servers */ +struct apr_redis_t +{ + apr_uint32_t flags; /**< Flags, Not currently used */ + apr_uint16_t nalloc; /**< Number of Servers Allocated */ + apr_uint16_t ntotal; /**< Number of Servers Added */ + apr_redis_server_t **live_servers; /**< Array of Servers */ + apr_pool_t *p; /** Pool to use for allocations */ + void *hash_baton; + apr_redis_hash_func hash_func; + void *server_baton; + apr_redis_server_func server_func; +}; + +/** + * Creates a crc32 hash used to split keys between servers + * @param rc The redis client object to use + * @param data Data to be hashed + * @param data_len Length of the data to use + * @return crc32 hash of data + * @remark The crc32 hash is not compatible with old redisd clients. + */ +APR_DECLARE(apr_uint32_t) apr_redis_hash(apr_redis_t *rc, + const char *data, + const apr_size_t data_len); + +/** + * Pure CRC32 Hash. Used by some clients. + */ +APR_DECLARE(apr_uint32_t) apr_redis_hash_crc32(void *baton, + const char *data, + const apr_size_t data_len); + +/** + * hash compatible with the standard Perl Client. + */ +APR_DECLARE(apr_uint32_t) apr_redis_hash_default(void *baton, + const char *data, + const apr_size_t data_len); + +/** + * Picks a server based on a hash + * @param rc The redis client object to use + * @param hash Hashed value of a Key + * @return server that controls specified hash + * @see apr_redis_hash + */ +APR_DECLARE(apr_redis_server_t *) apr_redis_find_server_hash(apr_redis_t *rc, + const apr_uint32_t hash); + +/** + * server selection compatible with the standard Perl Client. + */ +APR_DECLARE(apr_redis_server_t *) apr_redis_find_server_hash_default(void *baton, + apr_redis_t *rc, + const apr_uint32_t hash); + +/** + * Adds a server to a client object + * @param rc The redis client object to use + * @param server Server to add + * @remark Adding servers is not thread safe, and should be done once at startup. + * @warning Changing servers after startup may cause keys to go to + * different servers. + */ +APR_DECLARE(apr_status_t) apr_redis_add_server(apr_redis_t *rc, + apr_redis_server_t *server); + + +/** + * Finds a Server object based on a hostname/port pair + * @param rc The redis client object to use + * @param host Hostname of the server + * @param port Port of the server + * @return Server with matching Hostname and Port, or NULL if none was found. + */ +APR_DECLARE(apr_redis_server_t *) apr_redis_find_server(apr_redis_t *rc, + const char *host, + apr_port_t port); + +/** + * Enables a Server for use again + * @param rc The redis client object to use + * @param rs Server to Activate + */ +APR_DECLARE(apr_status_t) apr_redis_enable_server(apr_redis_t *rc, + apr_redis_server_t *rs); + + +/** + * Disable a Server + * @param rc The redis client object to use + * @param rs Server to Disable + */ +APR_DECLARE(apr_status_t) apr_redis_disable_server(apr_redis_t *rc, + apr_redis_server_t *rs); + +/** + * Creates a new Server Object + * @param p Pool to use + * @param host hostname of the server + * @param port port of the server + * @param min minimum number of client sockets to open + * @param smax soft maximum number of client connections to open + * @param max hard maximum number of client connections + * @param ttl time to live in microseconds of a client connection + * @param rwto r/w timeout value in seconds of a client connection + * @param ns location of the new server object + * @see apr_reslist_create + * @remark min, smax, and max are only used when APR_HAS_THREADS + */ +APR_DECLARE(apr_status_t) apr_redis_server_create(apr_pool_t *p, + const char *host, + apr_port_t port, + apr_uint32_t min, + apr_uint32_t smax, + apr_uint32_t max, + apr_uint32_t ttl, + apr_uint32_t rwto, + apr_redis_server_t **ns); +/** + * Creates a new redisd client object + * @param p Pool to use + * @param max_servers maximum number of servers + * @param flags Not currently used + * @param rc location of the new redis client object + */ +APR_DECLARE(apr_status_t) apr_redis_create(apr_pool_t *p, + apr_uint16_t max_servers, + apr_uint32_t flags, + apr_redis_t **rc); + +/** + * Gets a value from the server, allocating the value out of p + * @param rc client to use + * @param p Pool to use + * @param key null terminated string containing the key + * @param baton location of the allocated value + * @param len length of data at baton + * @param flags any flags set by the client for this key + * @return + */ +APR_DECLARE(apr_status_t) apr_redis_getp(apr_redis_t *rc, + apr_pool_t *p, + const char* key, + char **baton, + apr_size_t *len, + apr_uint16_t *flags); + +/** + * Sets a value by key on the server + * @param rc client to use + * @param key null terminated string containing the key + * @param baton data to store on the server + * @param data_size length of data at baton + * @param flags any flags set by the client for this key + */ +APR_DECLARE(apr_status_t) apr_redis_set(apr_redis_t *rc, + const char *key, + char *baton, + const apr_size_t data_size, + apr_uint16_t flags); + +/** + * Sets a value by key on the server + * @param rc client to use + * @param key null terminated string containing the key + * @param baton data to store on the server + * @param data_size length of data at baton + * @param timeout time in seconds for the data to live on the server + * @param flags any flags set by the client for this key + */ +APR_DECLARE(apr_status_t) apr_redis_setex(apr_redis_t *rc, + const char *key, + char *baton, + const apr_size_t data_size, + apr_uint32_t timeout, + apr_uint16_t flags); + +/** + * Deletes a key from a server + * @param rc client to use + * @param key null terminated string containing the key + * @param timeout time for the delete to stop other clients from adding + */ +APR_DECLARE(apr_status_t) apr_redis_delete(apr_redis_t *rc, + const char *key, + apr_uint32_t timeout); + +/** + * Query a server's version + * @param rs server to query + * @param p Pool to allocate answer from + * @param baton location to store server version string + */ +APR_DECLARE(apr_status_t) apr_redis_version(apr_redis_server_t *rs, + apr_pool_t *p, + char **baton); + +/** + * Query a server's INFO + * @param rs server to query + * @param p Pool to allocate answer from + * @param baton location to store server INFO response string + */ +APR_DECLARE(apr_status_t) apr_redis_info(apr_redis_server_t *rs, + apr_pool_t *p, + char **baton); + +/** + * Increments a value + * @param rc client to use + * @param key null terminated string containing the key + * @param inc number to increment by + * @param new_value new value after incrementing + */ +APR_DECLARE(apr_status_t) apr_redis_incr(apr_redis_t *rc, + const char *key, + apr_int32_t inc, + apr_uint32_t *new_value); +/** + * Decrements a value + * @param rc client to use + * @param key null terminated string containing the key + * @param inc number to decrement by + * @param new_value new value after decrementing + */ +APR_DECLARE(apr_status_t) apr_redis_decr(apr_redis_t *rc, + const char *key, + apr_int32_t inc, + apr_uint32_t *new_value); + + +/** + * Pings the server + * @param rs Server to ping + */ +APR_DECLARE(apr_status_t) apr_redis_ping(apr_redis_server_t *rs); + +/** + * Gets multiple values from the server, allocating the values out of p + * @param rc client to use + * @param temp_pool Pool used for temporary allocations. May be cleared inside this + * call. + * @param data_pool Pool used to allocate data for the returned values. + * @param values hash of apr_redis_value_t keyed by strings, contains the + * result of the multiget call. + * @return + */ +APR_DECLARE(apr_status_t) apr_redis_multgetp(apr_redis_t *rc, + apr_pool_t *temp_pool, + apr_pool_t *data_pool, + apr_hash_t *values); + +typedef enum +{ + APR_RS_SERVER_MASTER, /**< Server is a master */ + APR_RS_SERVER_SLAVE, /**< Server is a slave */ + APR_RS_SERVER_UNKNOWN /**< Server role is unknown */ +} apr_redis_server_role_t; + +typedef struct +{ +/* # Server */ + /** Major version number of this server */ + apr_uint32_t major; + /** Minor version number of this server */ + apr_uint32_t minor; + /** Patch version number of this server */ + apr_uint32_t patch; + /** Process id of this server process */ + apr_uint32_t process_id; + /** Number of seconds this server has been running */ + apr_uint32_t uptime_in_seconds; + /** Bitsize of the arch on the current machine */ + apr_uint32_t arch_bits; + +/* # Clients */ + /** Number of connected clients */ + apr_uint32_t connected_clients; + /** Number of blocked clients */ + apr_uint32_t blocked_clients; + +/* # Memory */ + /** Max memory of this server */ + apr_uint64_t maxmemory; + /** Amount of used memory */ + apr_uint64_t used_memory; + /** Total memory available on this server */ + apr_uint64_t total_system_memory; + +/* # Stats */ + /** Total connections received */ + apr_uint64_t total_connections_received; + /** Total commands processed */ + apr_uint64_t total_commands_processed; + /** Total net input bytes */ + apr_uint64_t total_net_input_bytes; + /** Total net output bytes */ + apr_uint64_t total_net_output_bytes; + /** Keyspace hits */ + apr_uint32_t keyspace_hits; + /** Keyspace misses */ + apr_uint32_t keyspace_misses; + +/* # Replication */ + /** Role */ + apr_redis_server_role_t role; + /** Number of connected slave */ + apr_uint32_t connected_slaves; + +/* # CPU */ + /** Accumulated CPU user time for this process */ + apr_uint32_t used_cpu_sys; + /** Accumulated CPU system time for this process */ + apr_uint32_t used_cpu_user; + +/* # Cluster */ + /** Is cluster enabled */ + apr_uint32_t cluster_enabled; +} apr_redis_stats_t; + +/** + * Query a server for statistics + * @param rs server to query + * @param p Pool to allocate answer from + * @param stats location of the new statistics structure + */ +APR_DECLARE(apr_status_t) apr_redis_stats(apr_redis_server_t *rs, + apr_pool_t *p, + apr_redis_stats_t **stats); + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* APR_REDIS_H */ diff --git a/redis/apr_redis.c b/redis/apr_redis.c new file mode 100644 index 00000000000..905281a279e --- /dev/null +++ b/redis/apr_redis.c @@ -0,0 +1,1544 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_redis.h" +#include "apr_poll.h" +#include "apr_version.h" +#include +#include + +#define BUFFER_SIZE 512 +#define LILBUFF_SIZE 64 +struct apr_redis_conn_t +{ + char *buffer; + apr_size_t blen; + apr_pool_t *p; + apr_pool_t *tp; + apr_socket_t *sock; + apr_bucket_brigade *bb; + apr_bucket_brigade *tb; + apr_redis_server_t *rs; +}; + +/* Strings for Client Commands */ + +#define RC_EOL "\r\n" +#define RC_EOL_LEN (sizeof(RC_EOL)-1) + +#define RC_WS " " +#define RC_WS_LEN (sizeof(RC_WS)-1) + +#define RC_RESP_1 "*1\r\n" +#define RC_RESP_1_LEN (sizeof(RC_RESP_1)-1) + +#define RC_RESP_2 "*2\r\n" +#define RC_RESP_2_LEN (sizeof(RC_RESP_2)-1) + +#define RC_RESP_3 "*3\r\n" +#define RC_RESP_3_LEN (sizeof(RC_RESP_3)-1) + +#define RC_RESP_4 "*4\r\n" +#define RC_RESP_4_LEN (sizeof(RC_RESP_4)-1) + +#define RC_GET "GET\r\n" +#define RC_GET_LEN (sizeof(RC_GET)-1) + +#define RC_GET_SIZE "$3\r\n" +#define RC_GET_SIZE_LEN (sizeof(RC_GET_SIZE)-1) + +#define RC_SET "SET\r\n" +#define RC_SET_LEN (sizeof(RC_SET)-1) + +#define RC_SET_SIZE "$3\r\n" +#define RC_SET_SIZE_LEN (sizeof(RC_SET_SIZE)-1) + +#define RC_SETEX "SETEX\r\n" +#define RC_SETEX_LEN (sizeof(RC_SETEX)-1) + +#define RC_SETEX_SIZE "$5\r\n" +#define RC_SETEX_SIZE_LEN (sizeof(RC_SETEX_SIZE)-1) + +#define RC_DEL "DEL\r\n" +#define RC_DEL_LEN (sizeof(RC_DEL)-1) + +#define RC_DEL_SIZE "$3\r\n" +#define RC_DEL_SIZE_LEN (sizeof(RC_DEL_SIZE)-1) + +#define RC_QUIT "QUIT\r\n" +#define RC_QUIT_LEN (sizeof(RC_QUIT)-1) + +#define RC_QUIT_SIZE "$4\r\n" +#define RC_QUIT_SIZE_LEN (sizeof(RC_QUIT_SIZE)-1) + +#define RC_PING "PING\r\n" +#define RC_PING_LEN (sizeof(RC_PING)-1) + +#define RC_PING_SIZE "$4\r\n" +#define RC_PING_SIZE_LEN (sizeof(RC_PING_SIZE)-1) + +#define RC_INFO "INFO\r\n" +#define RC_INFO_LEN (sizeof(RC_INFO)-1) + +#define RC_INFO_SIZE "$4\r\n" +#define RC_INFO_SIZE_LEN (sizeof(RC_INFO_SIZE)-1) + +/* Strings for Server Replies */ + +#define RS_STORED "+OK" +#define RS_STORED_LEN (sizeof(RS_STORED)-1) + +#define RS_NOT_STORED "$-1" +#define RS_NOT_STORED_LEN (sizeof(RS_NOT_STORED)-1) + +#define RS_DELETED ":1" +#define RS_DELETED_LEN (sizeof(RS_DELETED)-1) + +#define RS_NOT_FOUND_GET "$-1" +#define RS_NOT_FOUND_GET_LEN (sizeof(RS_NOT_FOUND_GET)-1) + +#define RS_NOT_FOUND_DEL ":0" +#define RS_NOT_FOUND_DEL_LEN (sizeof(RS_NOT_FOUND_DEL)-1) + +#define RS_TYPE_STRING "$" +#define RS_TYPE_STRING_LEN (sizeof(RS_TYPE_STRING)-1) + +#define RS_END "\r\n" +#define RS_END_LEN (sizeof(RS_END)-1) + +static apr_status_t make_server_dead(apr_redis_t *rc, + apr_redis_server_t *rs) +{ +#if APR_HAS_THREADS + apr_thread_mutex_lock(rs->lock); +#endif + rs->status = APR_RC_SERVER_DEAD; + rs->btime = apr_time_now(); +#if APR_HAS_THREADS + apr_thread_mutex_unlock(rs->lock); +#endif + return APR_SUCCESS; +} + +static apr_status_t make_server_live(apr_redis_t *rc, + apr_redis_server_t *rs) +{ + rs->status = APR_RC_SERVER_LIVE; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_redis_add_server(apr_redis_t *rc, + apr_redis_server_t *rs) +{ + apr_status_t rv = APR_SUCCESS; + + if (rc->ntotal >= rc->nalloc) { + return APR_ENOMEM; + } + rc->live_servers[rc->ntotal] = rs; + rc->ntotal++; + make_server_live(rc, rs); + return rv; +} + +APR_DECLARE(apr_redis_server_t *) +apr_redis_find_server_hash(apr_redis_t *rc, const apr_uint32_t hash) +{ + if (rc->server_func) { + return rc->server_func(rc->server_baton, rc, hash); + } + else { + return apr_redis_find_server_hash_default(NULL, rc, hash); + } +} + +APR_DECLARE(apr_redis_server_t *) +apr_redis_find_server_hash_default(void *baton, apr_redis_t *rc, + const apr_uint32_t hash) +{ + apr_redis_server_t *rs = NULL; + apr_uint32_t h = hash ? hash : 1; + apr_uint32_t i = 0; + apr_time_t curtime = 0; + + if (rc->ntotal == 0) { + return NULL; + } + + do { + rs = rc->live_servers[h % rc->ntotal]; + if (rs->status == APR_RC_SERVER_LIVE) { + break; + } + else { + if (curtime == 0) { + curtime = apr_time_now(); + } +#if APR_HAS_THREADS + apr_thread_mutex_lock(rs->lock); +#endif + /* Try the dead server, every 5 seconds */ + if (curtime - rs->btime > apr_time_from_sec(5)) { + rs->btime = curtime; + if (apr_redis_ping(rs) == APR_SUCCESS) { + make_server_live(rc, rs); +#if APR_HAS_THREADS + apr_thread_mutex_unlock(rs->lock); +#endif + break; + } + } +#if APR_HAS_THREADS + apr_thread_mutex_unlock(rs->lock); +#endif + } + h++; + i++; + } while (i < rc->ntotal); + + if (i == rc->ntotal) { + rs = NULL; + } + + return rs; +} + +APR_DECLARE(apr_redis_server_t *) apr_redis_find_server(apr_redis_t *rc, + const char *host, + apr_port_t port) +{ + int i; + + for (i = 0; i < rc->ntotal; i++) { + if (strcmp(rc->live_servers[i]->host, host) == 0 + && rc->live_servers[i]->port == port) { + + return rc->live_servers[i]; + } + } + + return NULL; +} + +static apr_status_t rs_find_conn(apr_redis_server_t *rs, + apr_redis_conn_t ** conn) +{ + apr_status_t rv; + apr_bucket_alloc_t *balloc; + apr_bucket *e; + +#if APR_HAS_THREADS + rv = apr_reslist_acquire(rs->conns, (void **) conn); +#else + *conn = rs->conn; + rv = APR_SUCCESS; +#endif + + if (rv != APR_SUCCESS) { + return rv; + } + + balloc = apr_bucket_alloc_create((*conn)->tp); + (*conn)->bb = apr_brigade_create((*conn)->tp, balloc); + (*conn)->tb = apr_brigade_create((*conn)->tp, balloc); + + e = apr_bucket_socket_create((*conn)->sock, balloc); + APR_BRIGADE_INSERT_TAIL((*conn)->bb, e); + + return rv; +} + +static apr_status_t rs_bad_conn(apr_redis_server_t *rs, + apr_redis_conn_t *conn) +{ +#if APR_HAS_THREADS + return apr_reslist_invalidate(rs->conns, conn); +#else + return APR_SUCCESS; +#endif +} + +static apr_status_t rs_release_conn(apr_redis_server_t *rs, + apr_redis_conn_t *conn) +{ + apr_pool_clear(conn->tp); +#if APR_HAS_THREADS + return apr_reslist_release(rs->conns, conn); +#else + return APR_SUCCESS; +#endif +} + +APR_DECLARE(apr_status_t) apr_redis_enable_server(apr_redis_t *rc, + apr_redis_server_t *rs) +{ + apr_status_t rv = APR_SUCCESS; + + if (rs->status == APR_RC_SERVER_LIVE) { + return rv; + } + rv = make_server_live(rc, rs); + return rv; +} + +APR_DECLARE(apr_status_t) apr_redis_disable_server(apr_redis_t *rc, + apr_redis_server_t *rs) +{ + return make_server_dead(rc, rs); +} + +static apr_status_t conn_connect(apr_redis_conn_t *conn) +{ + apr_status_t rv = APR_SUCCESS; + apr_sockaddr_t *sa; +#if APR_HAVE_SOCKADDR_UN + apr_int32_t family = conn->rs->host[0] != '/' ? APR_INET : APR_UNIX; +#else + apr_int32_t family = APR_INET; +#endif + + rv = apr_sockaddr_info_get(&sa, conn->rs->host, family, conn->rs->port, 0, + conn->p); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_socket_timeout_set(conn->sock, 1 * APR_USEC_PER_SEC); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_socket_connect(conn->sock, sa); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_socket_timeout_set(conn->sock, + conn->rs->rwto * APR_USEC_PER_SEC); + if (rv != APR_SUCCESS) { + return rv; + } + + return rv; +} + +static apr_status_t +rc_conn_construct(void **conn_, void *params, apr_pool_t *pool) +{ + apr_status_t rv = APR_SUCCESS; + apr_redis_conn_t *conn; + apr_pool_t *np; + apr_pool_t *tp; + apr_redis_server_t *rs = params; +#if APR_HAVE_SOCKADDR_UN + apr_int32_t family = rs->host[0] != '/' ? APR_INET : APR_UNIX; +#else + apr_int32_t family = APR_INET; +#endif + + rv = apr_pool_create(&np, pool); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_pool_create(&tp, np); + if (rv != APR_SUCCESS) { + apr_pool_destroy(np); + return rv; + } + + conn = apr_palloc(np, sizeof(apr_redis_conn_t)); + + conn->p = np; + conn->tp = tp; + + rv = apr_socket_create(&conn->sock, family, SOCK_STREAM, 0, np); + + if (rv != APR_SUCCESS) { + apr_pool_destroy(np); + return rv; + } + + conn->buffer = apr_palloc(conn->p, BUFFER_SIZE); + conn->blen = 0; + conn->rs = rs; + + rv = conn_connect(conn); + if (rv != APR_SUCCESS) { + apr_pool_destroy(np); + } + else { + *conn_ = conn; + } + + return rv; +} + +#if APR_HAS_THREADS +static apr_status_t +rc_conn_destruct(void *conn_, void *params, apr_pool_t *pool) +{ + apr_redis_conn_t *conn = (apr_redis_conn_t *) conn_; + struct iovec vec[3]; + apr_size_t written; + + /* send a quit message to the Redis server to be nice about it. */ + + /* + * RESP Command: + * *1 + * $4 + * QUIT + */ + vec[0].iov_base = RC_RESP_1; + vec[0].iov_len = RC_RESP_1_LEN; + + vec[1].iov_base = RC_QUIT_SIZE; + vec[1].iov_len = RC_QUIT_SIZE_LEN; + + vec[2].iov_base = RC_QUIT; + vec[2].iov_len = RC_QUIT_LEN; + + /* Return values not checked, since we just want to make it go away. */ + apr_socket_sendv(conn->sock, vec, 3, &written); + apr_socket_close(conn->sock); + + apr_pool_destroy(conn->p); + + return APR_SUCCESS; +} +#endif + +APR_DECLARE(apr_status_t) apr_redis_server_create(apr_pool_t *p, + const char *host, + apr_port_t port, + apr_uint32_t min, + apr_uint32_t smax, + apr_uint32_t max, + apr_uint32_t ttl, + apr_uint32_t rwto, + apr_redis_server_t **rs) +{ + apr_status_t rv = APR_SUCCESS; + apr_redis_server_t *server; + apr_pool_t *np; + + rv = apr_pool_create(&np, p); + + server = apr_palloc(np, sizeof(apr_redis_server_t)); + + server->p = np; + server->host = apr_pstrdup(np, host); + server->port = port; + server->status = APR_RC_SERVER_DEAD; + server->rwto = rwto; + server->version.major = 0; + server->version.minor = 0; + server->version.patch = 0; + +#if APR_HAS_THREADS + rv = apr_thread_mutex_create(&server->lock, APR_THREAD_MUTEX_DEFAULT, np); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_reslist_create(&server->conns, + min, /* hard minimum */ + smax, /* soft maximum */ + max, /* hard maximum */ + ttl, /* Time to live */ + rc_conn_construct, /* Make a New Connection */ + rc_conn_destruct, /* Kill Old Connection */ + server, np); + if (rv != APR_SUCCESS) { + return rv; + } + + apr_reslist_cleanup_order_set(server->conns, APR_RESLIST_CLEANUP_FIRST); +#else + rv = rc_conn_construct((void **) &(server->conn), server, np); + if (rv != APR_SUCCESS) { + return rv; + } +#endif + + *rs = server; + + return rv; +} + +APR_DECLARE(apr_status_t) apr_redis_create(apr_pool_t *p, + apr_uint16_t max_servers, + apr_uint32_t flags, + apr_redis_t **redis) +{ + apr_status_t rv = APR_SUCCESS; + apr_redis_t *rc; + + rc = apr_palloc(p, sizeof(apr_redis_t)); + rc->p = p; + rc->nalloc = max_servers; + rc->ntotal = 0; + rc->live_servers = + apr_palloc(p, rc->nalloc * sizeof(struct apr_redis_server_t *)); + rc->hash_func = NULL; + rc->hash_baton = NULL; + rc->server_func = NULL; + rc->server_baton = NULL; + *redis = rc; + return rv; +} + + +/* The crc32 functions and data was originally written by Spencer + * Garrett and was gleaned from the PostgreSQL source + * tree via the files contrib/ltree/crc32.[ch] and from FreeBSD at + * src/usr.bin/cksum/crc32.c. + */ + +static const apr_uint32_t crc32tab[256] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, +}; + +APR_DECLARE(apr_uint32_t) apr_redis_hash_crc32(void *baton, + const char *data, + const apr_size_t data_len) +{ + apr_uint32_t i; + apr_uint32_t crc; + crc = ~0; + + for (i = 0; i < data_len; i++) + crc = (crc >> 8) ^ crc32tab[(crc ^ (data[i])) & 0xff]; + + return ~crc; +} + +APR_DECLARE(apr_uint32_t) apr_redis_hash_default(void *baton, + const char *data, + const apr_size_t data_len) +{ + /* The default Perl Client doesn't actually use just crc32 -- it shifts it again + * like this.... + */ + return ((apr_redis_hash_crc32(baton, data, data_len) >> 16) & 0x7fff); +} + +APR_DECLARE(apr_uint32_t) apr_redis_hash(apr_redis_t *rc, + const char *data, + const apr_size_t data_len) +{ + if (rc->hash_func) { + return rc->hash_func(rc->hash_baton, data, data_len); + } + else { + return apr_redis_hash_default(NULL, data, data_len); + } +} + +static apr_status_t get_server_line(apr_redis_conn_t *conn) +{ + apr_size_t bsize = BUFFER_SIZE; + apr_status_t rv = APR_SUCCESS; + + rv = apr_brigade_split_line(conn->tb, conn->bb, APR_BLOCK_READ, + BUFFER_SIZE); + + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_brigade_flatten(conn->tb, conn->buffer, &bsize); + + if (rv != APR_SUCCESS) { + return rv; + } + + conn->blen = bsize; + conn->buffer[bsize] = '\0'; + + return apr_brigade_cleanup(conn->tb); +} + +APR_DECLARE(apr_status_t) apr_redis_set(apr_redis_t *rc, + const char *key, + char *data, + const apr_size_t data_size, + apr_uint16_t flags) +{ + apr_uint32_t hash; + apr_redis_server_t *rs; + apr_redis_conn_t *conn; + apr_status_t rv; + apr_size_t written; + struct iovec vec[9]; + char keysize_str[LILBUFF_SIZE]; + char datasize_str[LILBUFF_SIZE]; + apr_size_t len, klen; + + klen = strlen(key); + hash = apr_redis_hash(rc, key, klen); + + rs = apr_redis_find_server_hash(rc, hash); + + if (rs == NULL) + return APR_NOTFOUND; + + rv = rs_find_conn(rs, &conn); + + if (rv != APR_SUCCESS) { + apr_redis_disable_server(rc, rs); + return rv; + } + + /* + * RESP Command: + * *3 + * $3 + * SET + * $ + * key + * $ + * data + */ + + vec[0].iov_base = RC_RESP_3; + vec[0].iov_len = RC_RESP_3_LEN; + + vec[1].iov_base = RC_SET_SIZE; + vec[1].iov_len = RC_SET_SIZE_LEN; + + vec[2].iov_base = RC_SET; + vec[2].iov_len = RC_SET_LEN; + + len = apr_snprintf(keysize_str, LILBUFF_SIZE, "$%" APR_SIZE_T_FMT "\r\n", klen); + vec[3].iov_base = keysize_str; + vec[3].iov_len = len; + + vec[4].iov_base = (void *) key; + vec[4].iov_len = klen; + + vec[5].iov_base = RC_EOL; + vec[5].iov_len = RC_EOL_LEN; + + len = apr_snprintf(datasize_str, LILBUFF_SIZE, "$%" APR_SIZE_T_FMT "\r\n", + data_size); + vec[6].iov_base = datasize_str; + vec[6].iov_len = len; + + vec[7].iov_base = data; + vec[7].iov_len = data_size; + + vec[8].iov_base = RC_EOL; + vec[8].iov_len = RC_EOL_LEN; + + rv = apr_socket_sendv(conn->sock, vec, 9, &written); + + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + apr_redis_disable_server(rc, rs); + return rv; + } + + rv = get_server_line(conn); + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + apr_redis_disable_server(rc, rs); + return rv; + } + + if (strcmp(conn->buffer, RS_STORED RC_EOL) == 0) { + rv = APR_SUCCESS; + } + else if (strcmp(conn->buffer, RS_NOT_STORED RC_EOL) == 0) { + rv = APR_EEXIST; + } + else { + rv = APR_EGENERAL; + } + + rs_release_conn(rs, conn); + return rv; +} + +APR_DECLARE(apr_status_t) apr_redis_setex(apr_redis_t *rc, + const char *key, + char *data, + const apr_size_t data_size, + apr_uint32_t timeout, + apr_uint16_t flags) +{ + apr_uint32_t hash; + apr_redis_server_t *rs; + apr_redis_conn_t *conn; + apr_status_t rv; + apr_size_t written; + struct iovec vec[11]; + char keysize_str[LILBUFF_SIZE]; + char expire_str[LILBUFF_SIZE]; + char expiresize_str[LILBUFF_SIZE]; + char datasize_str[LILBUFF_SIZE]; + apr_size_t len, klen, expire_len; + + + klen = strlen(key); + hash = apr_redis_hash(rc, key, klen); + + rs = apr_redis_find_server_hash(rc, hash); + + if (rs == NULL) + return APR_NOTFOUND; + + rv = rs_find_conn(rs, &conn); + + if (rv != APR_SUCCESS) { + apr_redis_disable_server(rc, rs); + return rv; + } + + /* + * RESP Command: + * *4 + * $5 + * SETEX + * $ + * key + * $ + * expirey + * $ + * data + */ + + vec[0].iov_base = RC_RESP_4; + vec[0].iov_len = RC_RESP_4_LEN; + + vec[1].iov_base = RC_SETEX_SIZE; + vec[1].iov_len = RC_SETEX_SIZE_LEN; + + vec[2].iov_base = RC_SETEX; + vec[2].iov_len = RC_SETEX_LEN; + + len = apr_snprintf(keysize_str, LILBUFF_SIZE, "$%" APR_SIZE_T_FMT "\r\n", klen); + vec[3].iov_base = keysize_str; + vec[3].iov_len = len; + + vec[4].iov_base = (void *) key; + vec[4].iov_len = klen; + + vec[5].iov_base = RC_EOL; + vec[5].iov_len = RC_EOL_LEN; + + expire_len = apr_snprintf(expire_str, LILBUFF_SIZE, "%u\r\n", timeout); + len = apr_snprintf(expiresize_str, LILBUFF_SIZE, "$%" APR_SIZE_T_FMT "\r\n", + expire_len - 2); + vec[6].iov_base = (void *) expiresize_str; + vec[6].iov_len = len; + + vec[7].iov_base = (void *) expire_str; + vec[7].iov_len = expire_len; + + len = apr_snprintf(datasize_str, LILBUFF_SIZE, "$%" APR_SIZE_T_FMT "\r\n", + data_size); + vec[8].iov_base = datasize_str; + vec[8].iov_len = len; + + vec[9].iov_base = data; + vec[9].iov_len = data_size; + + vec[10].iov_base = RC_EOL; + vec[10].iov_len = RC_EOL_LEN; + + rv = apr_socket_sendv(conn->sock, vec, 11, &written); + + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + apr_redis_disable_server(rc, rs); + return rv; + } + + rv = get_server_line(conn); + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + apr_redis_disable_server(rc, rs); + return rv; + } + + if (strcmp(conn->buffer, RS_STORED RC_EOL) == 0) { + rv = APR_SUCCESS; + } + else if (strcmp(conn->buffer, RS_NOT_STORED RC_EOL) == 0) { + rv = APR_EEXIST; + } + else { + rv = APR_EGENERAL; + } + + rs_release_conn(rs, conn); + return rv; +} + +static apr_status_t grab_bulk_resp(apr_redis_server_t *rs, apr_redis_t *rc, + apr_redis_conn_t *conn, apr_pool_t *p, + char **baton, apr_size_t *new_length) +{ + char *length; + char *last; + apr_size_t len = 0; + *new_length = 0; + apr_status_t rv; + + length = apr_strtok(conn->buffer + 1, " ", &last); + if (length) { + len = strtol(length, (char **) NULL, 10); + } + + if (len == 0) { + *new_length = 0; + *baton = NULL; + } + else { + apr_bucket_brigade *bbb; + apr_bucket *e; + + /* eat the trailing \r\n */ + rv = apr_brigade_partition(conn->bb, len + 2, &e); + + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + if (rc) + apr_redis_disable_server(rc, rs); + return rv; + } + + bbb = apr_brigade_split(conn->bb, e); + + rv = apr_brigade_pflatten(conn->bb, baton, &len, p); + + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + if (rc) + apr_redis_disable_server(rc, rs); + return rv; + } + + rv = apr_brigade_destroy(conn->bb); + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + if (rc) + apr_redis_disable_server(rc, rs); + return rv; + } + + conn->bb = bbb; + + *new_length = len - 2; + (*baton)[*new_length] = '\0'; + } + return APR_SUCCESS; + +} + +APR_DECLARE(apr_status_t) apr_redis_getp(apr_redis_t *rc, + apr_pool_t *p, + const char *key, + char **baton, + apr_size_t *new_length, + apr_uint16_t *flags) +{ + apr_status_t rv; + apr_redis_server_t *rs; + apr_redis_conn_t *conn; + apr_uint32_t hash; + apr_size_t written; + apr_size_t len, klen; + struct iovec vec[6]; + char keysize_str[LILBUFF_SIZE]; + + klen = strlen(key); + hash = apr_redis_hash(rc, key, klen); + rs = apr_redis_find_server_hash(rc, hash); + + if (rs == NULL) + return APR_NOTFOUND; + + rv = rs_find_conn(rs, &conn); + + if (rv != APR_SUCCESS) { + apr_redis_disable_server(rc, rs); + return rv; + } + + /* + * RESP Command: + * *2 + * $3 + * GET + * $ + * key + */ + vec[0].iov_base = RC_RESP_2; + vec[0].iov_len = RC_RESP_2_LEN; + + vec[1].iov_base = RC_GET_SIZE; + vec[1].iov_len = RC_GET_SIZE_LEN; + + vec[2].iov_base = RC_GET; + vec[2].iov_len = RC_GET_LEN; + + len = apr_snprintf(keysize_str, LILBUFF_SIZE, "$%" APR_SIZE_T_FMT "\r\n", + klen); + vec[3].iov_base = keysize_str; + vec[3].iov_len = len; + + vec[4].iov_base = (void *) key; + vec[4].iov_len = klen; + + vec[5].iov_base = RC_EOL; + vec[5].iov_len = RC_EOL_LEN; + + rv = apr_socket_sendv(conn->sock, vec, 6, &written); + + + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + apr_redis_disable_server(rc, rs); + return rv; + } + + rv = get_server_line(conn); + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + apr_redis_disable_server(rc, rs); + return rv; + } + if (strncmp(RS_NOT_FOUND_GET, conn->buffer, RS_NOT_FOUND_GET_LEN) == 0) { + rv = APR_NOTFOUND; + } + else if (strncmp(RS_TYPE_STRING, conn->buffer, RS_TYPE_STRING_LEN) == 0) { + rv = grab_bulk_resp(rs, rc, conn, p, baton, new_length); + } + else { + rv = APR_EGENERAL; + } + + rs_release_conn(rs, conn); + return rv; +} + +APR_DECLARE(apr_status_t) + apr_redis_delete(apr_redis_t *rc, const char *key, apr_uint32_t timeout) +{ + apr_status_t rv; + apr_redis_server_t *rs; + apr_redis_conn_t *conn; + apr_uint32_t hash; + apr_size_t written; + struct iovec vec[6]; + apr_size_t len, klen; + char keysize_str[LILBUFF_SIZE]; + + klen = strlen(key); + hash = apr_redis_hash(rc, key, klen); + rs = apr_redis_find_server_hash(rc, hash); + if (rs == NULL) + return APR_NOTFOUND; + + rv = rs_find_conn(rs, &conn); + + if (rv != APR_SUCCESS) { + apr_redis_disable_server(rc, rs); + return rv; + } + + /* + * RESP Command: + * *2 + * $3 + * DEL + * $ + * key + */ + vec[0].iov_base = RC_RESP_2; + vec[0].iov_len = RC_RESP_2_LEN; + + vec[1].iov_base = RC_DEL_SIZE; + vec[1].iov_len = RC_DEL_SIZE_LEN; + + vec[2].iov_base = RC_DEL; + vec[2].iov_len = RC_DEL_LEN; + + len = apr_snprintf(keysize_str, LILBUFF_SIZE, "$%" APR_SIZE_T_FMT "\r\n", + klen); + vec[3].iov_base = keysize_str; + vec[3].iov_len = len; + + vec[4].iov_base = (void *) key; + vec[4].iov_len = klen; + + vec[5].iov_base = RC_EOL; + vec[5].iov_len = RC_EOL_LEN; + + rv = apr_socket_sendv(conn->sock, vec, 6, &written); + + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + apr_redis_disable_server(rc, rs); + return rv; + } + + rv = get_server_line(conn); + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + apr_redis_disable_server(rc, rs); + return rv; + } + + if (strncmp(RS_DELETED, conn->buffer, RS_DELETED_LEN) == 0) { + rv = APR_SUCCESS; + } + else if (strncmp(RS_NOT_FOUND_DEL, conn->buffer, RS_NOT_FOUND_DEL_LEN) == 0) { + rv = APR_NOTFOUND; + } + else { + rv = APR_EGENERAL; + } + + rs_release_conn(rs, conn); + return rv; +} + +APR_DECLARE(apr_status_t) +apr_redis_ping(apr_redis_server_t *rs) +{ + apr_status_t rv; + apr_size_t written; + struct iovec vec[3]; + apr_redis_conn_t *conn; + + rv = rs_find_conn(rs, &conn); + + if (rv != APR_SUCCESS) { + return rv; + } + + /* + * RESP Command: + * *1 + * $4 + * PING + */ + vec[0].iov_base = RC_RESP_1; + vec[0].iov_len = RC_RESP_1_LEN; + + vec[1].iov_base = RC_PING_SIZE; + vec[1].iov_len = RC_PING_SIZE_LEN; + + vec[2].iov_base = RC_PING; + vec[2].iov_len = RC_PING_LEN; + + rv = apr_socket_sendv(conn->sock, vec, 3, &written); + + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + return rv; + } + + rv = get_server_line(conn); + if (rv == APR_SUCCESS) { + /* we got *something*. Was it Redis? */ + if (strncmp(conn->buffer, "+PONG", sizeof("+PONG")-1) != 0) { + rv = APR_EGENERAL; + } + } + rs_release_conn(rs, conn); + return rv; +} + +APR_DECLARE(apr_status_t) +apr_redis_info(apr_redis_server_t *rs, apr_pool_t *p, char **baton) +{ + apr_status_t rv; + apr_redis_conn_t *conn; + apr_size_t written; + struct iovec vec[3]; + + rv = rs_find_conn(rs, &conn); + + if (rv != APR_SUCCESS) { + return rv; + } + + /* + * RESP Command: + * *1 + * $4 + * INFO + */ + vec[0].iov_base = RC_RESP_1; + vec[0].iov_len = RC_RESP_1_LEN; + + vec[1].iov_base = RC_INFO_SIZE; + vec[1].iov_len = RC_INFO_SIZE_LEN; + + vec[2].iov_base = RC_INFO; + vec[2].iov_len = RC_INFO_LEN; + + rv = apr_socket_sendv(conn->sock, vec, 3, &written); + + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + return rv; + } + + rv = get_server_line(conn); + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + return rv; + } + + if (strncmp(RS_TYPE_STRING, conn->buffer, RS_TYPE_STRING_LEN) == 0) { + apr_size_t nl; + rv = grab_bulk_resp(rs, NULL, conn, p, baton, &nl); + } else { + rs_bad_conn(rs, conn); + rv = APR_EGENERAL; + } + + rs_release_conn(rs, conn); + return rv; +} + +#define RV_FIELD "redis_version:" +APR_DECLARE(apr_status_t) +apr_redis_version(apr_redis_server_t *rs, apr_pool_t *p, char **baton) +{ + apr_status_t rv; + char *ptr, *eptr; + apr_pool_t *subpool; + + /* Have we already obtained the version number? */ + if (rs->version.minor != 0) { + if (baton) + *baton = apr_pstrdup(p, rs->version.number); + return APR_SUCCESS; + } + if (apr_pool_create(&subpool, p) != APR_SUCCESS) { + /* well, we tried */ + subpool = p; + } + rv = apr_redis_info(rs, subpool, baton); + + if (rv != APR_SUCCESS) { + if (subpool != p) { + apr_pool_destroy(subpool); + } + return rv; + } + + ptr = strstr(*baton, RV_FIELD); + if (ptr) { + rs->version.major = strtol(ptr + sizeof(RV_FIELD) - 1, &eptr, 10); + ptr = eptr + 1; + rs->version.minor = strtol(ptr, &eptr, 10); + ptr = eptr + 1; + rs->version.patch = strtol(ptr, &eptr, 10); + rs->version.number = apr_psprintf(rs->p, "%d.%d.%d", + rs->version.major, rs->version.minor, + rs->version.patch); + } + if (baton) + *baton = apr_pstrdup(p, rs->version.number); + if (subpool != p) { + apr_pool_destroy(subpool); + } + return APR_SUCCESS; +} + +static apr_status_t plus_minus(apr_redis_t *rc, + int incr, + const char *key, + apr_int32_t inc, + apr_uint32_t *new_value) +{ + apr_status_t rv; + apr_redis_server_t *rs; + apr_redis_conn_t *conn; + apr_uint32_t hash; + apr_size_t written; + apr_size_t len, klen; + struct iovec vec[12]; + char keysize_str[LILBUFF_SIZE]; + char inc_str[LILBUFF_SIZE]; + char inc_str_len[LILBUFF_SIZE]; + int i = 0; + + klen = strlen(key); + hash = apr_redis_hash(rc, key, klen); + rs = apr_redis_find_server_hash(rc, hash); + if (rs == NULL) + return APR_NOTFOUND; + + rv = rs_find_conn(rs, &conn); + + if (rv != APR_SUCCESS) { + apr_redis_disable_server(rc, rs); + return rv; + } + + /* + * RESP Command: + * *2|*3 + * $4|$6 + * INCR/DECR|INCRBY/DECRBY + * $ + * key + * <:inc> + */ + if (inc == 1) { + vec[i].iov_base = RC_RESP_2; + vec[i].iov_len = RC_RESP_2_LEN; + i++; + + vec[i].iov_base = "$4\r\n"; + vec[i].iov_len = sizeof("$4\r\n")-1; + i++; + + if (incr) + vec[i].iov_base = "INCR\r\n"; + else + vec[i].iov_base = "DECR\r\n"; + vec[i].iov_len = sizeof("INCR\r\n")-1; + i++; + } + else { + vec[i].iov_base = RC_RESP_3; + vec[i].iov_len = RC_RESP_3_LEN; + i++; + + vec[i].iov_base = "$6\r\n"; + vec[i].iov_len = sizeof("$6\r\n")-1; + i++; + + if (incr) + vec[i].iov_base = "INCRBY\r\n"; + else + vec[i].iov_base = "DECRBY\r\n"; + vec[i].iov_len = sizeof("INCRBY\r\n")-1; + i++; + } + + len = apr_snprintf(keysize_str, LILBUFF_SIZE, "$%" APR_SIZE_T_FMT "\r\n", + klen); + vec[i].iov_base = keysize_str; + vec[i].iov_len = len; + i++; + + vec[i].iov_base = (void *) key; + vec[i].iov_len = klen; + i++; + + vec[i].iov_base = RC_EOL; + vec[i].iov_len = RC_EOL_LEN; + i++; + + if (inc != 1) { + len = apr_snprintf(inc_str, LILBUFF_SIZE, "%d\r\n", inc); + klen = apr_snprintf(inc_str_len, LILBUFF_SIZE, "$%d\r\n", (int)(len-2)); + vec[i].iov_base = inc_str_len; + vec[i].iov_len = klen; + i++; + + vec[i].iov_base = inc_str; + vec[i].iov_len = len; + i++; + + vec[i].iov_base = RC_EOL; + vec[i].iov_len = RC_EOL_LEN; + i++; + } + + rv = apr_socket_sendv(conn->sock, vec, i, &written); + + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + apr_redis_disable_server(rc, rs); + return rv; + } + + rv = get_server_line(conn); + if (rv != APR_SUCCESS) { + rs_bad_conn(rs, conn); + apr_redis_disable_server(rc, rs); + return rv; + } + if (strncmp(RS_NOT_FOUND_GET, conn->buffer, RS_NOT_FOUND_GET_LEN) == 0) { + rv = APR_NOTFOUND; + } + else if (*conn->buffer == ':') { + *new_value = atoi((const char *)(conn->buffer + 1)); + rv = APR_SUCCESS; + } + else { + rv = APR_EGENERAL; + } + rs_release_conn(rs, conn); + return rv; +} + +APR_DECLARE(apr_status_t) +apr_redis_incr(apr_redis_t *rc, const char *key, apr_int32_t inc, apr_uint32_t *new_value) +{ + return plus_minus(rc, 1, key, inc, new_value); +} + +APR_DECLARE(apr_status_t) +apr_redis_decr(apr_redis_t *rc, const char *key, apr_int32_t inc, apr_uint32_t *new_value) +{ + return plus_minus(rc, 0, key, inc, new_value); +} + +APR_DECLARE(apr_status_t) +apr_redis_multgetp(apr_redis_t *rc, + apr_pool_t *temp_pool, + apr_pool_t *data_pool, + apr_hash_t *values) +{ + return APR_ENOTIMPL; +} + +/** + * Define all of the strings for stats + */ + +#define STAT_process_id "process_id:" +#define STAT_process_id_LEN (sizeof(STAT_process_id)-1) + +#define STAT_uptime_in_seconds "uptime_in_seconds:" +#define STAT_uptime_in_seconds_LEN (sizeof(STAT_uptime_in_seconds)-1) + +#define STAT_arch_bits "arch_bits:" +#define STAT_arch_bits_LEN (sizeof(STAT_arch_bits)-1) + +#define STAT_connected_clients "connected_clients:" +#define STAT_connected_clients_LEN (sizeof(STAT_connected_clients)-1) + +#define STAT_blocked_clients "blocked_clients:" +#define STAT_blocked_clients_LEN (sizeof(STAT_blocked_clients)-1) + +#define STAT_maxmemory "maxmemory:" +#define STAT_maxmemory_LEN (sizeof(STAT_maxmemory)-1) + +#define STAT_used_memory "used_memory:" +#define STAT_used_memory_LEN (sizeof(STAT_used_memory)-1) + +#define STAT_total_system_memory "total_system_memory:" +#define STAT_total_system_memory_LEN (sizeof(STAT_total_system_memory)-1) + +#define STAT_total_connections_received "total_connections_received:" +#define STAT_total_connections_received_LEN (sizeof(STAT_total_connections_received)-1) + +#define STAT_total_commands_processed "total_commands_processed:" +#define STAT_total_commands_processed_LEN (sizeof(STAT_total_commands_processed)-1) + +#define STAT_total_net_input_bytes "total_net_input_bytes:" +#define STAT_total_net_input_bytes_LEN (sizeof(STAT_total_net_input_bytes)-1) + +#define STAT_total_net_output_bytes "total_net_output_bytes:" +#define STAT_total_net_output_bytes_LEN (sizeof(STAT_total_net_output_bytes)-1) + +#define STAT_keyspace_hits "keyspace_hits:" +#define STAT_keyspace_hits_LEN (sizeof(STAT_keyspace_hits)-1) + +#define STAT_keyspace_misses "keyspace_misses:" +#define STAT_keyspace_misses_LEN (sizeof(STAT_keyspace_misses)-1) + +#define STAT_connected_slaves "connected_slaves:" +#define STAT_connected_slaves_LEN (sizeof(STAT_connected_slaves)-1) + +#define STAT_used_cpu_sys "used_cpu_sys:" +#define STAT_used_cpu_sys_LEN (sizeof(STAT_used_cpu_sys)-1) + +#define STAT_used_cpu_user "used_cpu_user:" +#define STAT_used_cpu_user_LEN (sizeof(STAT_used_cpu_user)-1) + +#define STAT_cluster_enabled "cluster_enabled:" +#define STAT_cluster_enabled_LEN (sizeof(STAT_cluster_enabled)-1) + +static apr_uint32_t stat_read_uint32( char *buf) +{ + return atoi(buf); +} + +static apr_uint64_t stat_read_uint64(char *buf) +{ + return apr_atoi64(buf); +} + +#define rc_do_stat(name, type) \ + if ((ptr = strstr(info , STAT_ ## name )) != NULL ) { \ + char *str = ptr + (STAT_ ## name ## _LEN ); \ + stats-> name = stat_read_ ## type (str); \ + } + +static void update_stats(char *info, apr_redis_stats_t *stats) +{ + char *ptr; + + rc_do_stat(process_id, uint32); + rc_do_stat(uptime_in_seconds, uint32); + rc_do_stat(arch_bits, uint32); + rc_do_stat(connected_clients, uint32); + rc_do_stat(blocked_clients, uint32); + rc_do_stat(maxmemory, uint64); + rc_do_stat(used_memory, uint64); + rc_do_stat(total_system_memory, uint64); + rc_do_stat(total_connections_received, uint64); + rc_do_stat(total_commands_processed, uint64); + rc_do_stat(total_net_input_bytes, uint64); + rc_do_stat(total_net_output_bytes, uint64); + rc_do_stat(keyspace_hits, uint32); + rc_do_stat(keyspace_misses, uint32); + rc_do_stat(connected_slaves, uint32); + rc_do_stat(used_cpu_sys, uint32); + rc_do_stat(used_cpu_user, uint32); + rc_do_stat(cluster_enabled, uint32); +} + +APR_DECLARE(apr_status_t) +apr_redis_stats(apr_redis_server_t *rs, + apr_pool_t *p, + apr_redis_stats_t **stats) +{ + apr_status_t rv; + char *info; + apr_pool_t *subpool; + apr_redis_stats_t *ret; + char *ptr; + + if (apr_pool_create(&subpool, p) != APR_SUCCESS) { + /* well, we tried */ + subpool = p; + } + rv = apr_redis_info(rs, subpool, &info); + + if (rv != APR_SUCCESS) { + if (subpool != p) { + apr_pool_destroy(subpool); + } + return rv; + } + ret = apr_pcalloc(p, sizeof(apr_redis_stats_t)); + /* Get the bulk of the stats */ + update_stats(info, ret); + + /* Now the version number */ + if (rs->version.major != 0) { + ret->major = rs->version.major; + ret->minor = rs->version.minor; + ret->patch = rs->version.patch; + } + else { + char *eptr; + ptr = strstr(info, RV_FIELD); + if (ptr) { + ret->major = rs->version.major = strtol(ptr + sizeof(RV_FIELD) - 1, &eptr, 10); + ptr = eptr + 1; + ret->minor = rs->version.minor = strtol(ptr, &eptr, 10); + ptr = eptr + 1; + ret->patch = rs->version.patch = strtol(ptr, &eptr, 10); + } + } + + /* Finally, the role */ + ptr = strstr(info, "role:"); + if (!ptr) { + ret->role = APR_RS_SERVER_UNKNOWN; + } + else if (!strncmp("master", ptr + sizeof("role:") - 1, sizeof("master")-1)) { + ret->role = APR_RS_SERVER_MASTER; + } + else { + ret->role = APR_RS_SERVER_SLAVE; + } + if (stats) { + *stats = ret; + } + + return APR_SUCCESS; +} diff --git a/test/Makefile.in b/test/Makefile.in index bde23a246fc..4fb4d94d36e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -37,7 +37,7 @@ TESTS = testtime.lo teststr.lo testvsn.lo testipsub.lo testshm.lo \ testbuckets.lo testxml.lo testdbm.lo testuuid.lo testmd5.lo \ testreslist.lo testbase64.lo testhooks.lo testlfsabi.lo \ testlfsabi32.lo testlfsabi64.lo testescape.lo testskiplist.lo \ - testsiphash.lo + testsiphash.lo testredis.lo OTHER_PROGRAMS = \ echod@EXEEXT@ \ diff --git a/test/Makefile.win b/test/Makefile.win index f99fa64f490..21344ea0309 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -122,6 +122,7 @@ ALL_TESTS = \ $(INTDIR)\testprocmutex.obj \ $(INTDIR)\testqueue.obj \ $(INTDIR)\testrand.obj \ + $(INTDIR)\testredis.obj \ $(INTDIR)\testreslist.obj \ $(INTDIR)\testrmm.obj \ $(INTDIR)\testshm.obj \ diff --git a/test/abts_tests.h b/test/abts_tests.h index a88f1082414..bfd83cf428d 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -81,6 +81,7 @@ const struct testlist { {testdbd}, {testdate}, {testmemcache}, + {testredis}, {testxml}, {testxlate}, {testrmm}, diff --git a/test/testredis.c b/test/testredis.c new file mode 100644 index 00000000000..4b654322f54 --- /dev/null +++ b/test/testredis.c @@ -0,0 +1,552 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "testutil.h" +#include "apr.h" +#include "apu.h" +#include "apr_general.h" +#include "apr_strings.h" +#include "apr_hash.h" +#include "apr_redis.h" +#include "apr_network_io.h" + +#include +#if APR_HAVE_STDLIB_H +#include /* for exit() */ +#endif + +#define HOST "localhost" +#define PORT 6379 + +/* the total number of items to use for set/get testing */ +#define TDATA_SIZE 3000 + +/* some smaller subset of TDATA_SIZE used for multiget testing */ +#define TDATA_SET 100 + +/* our custom hash function just returns this all the time */ +#define HASH_FUNC_RESULT 510 + +/* all keys will be prefixed with this */ +static const char prefix[] = "testredis"; + +/* text for values we store */ +static const char txt[] = +"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis at" +"lacus in ligula hendrerit consectetuer. Vestibulum tristique odio" +"iaculis leo. In massa arcu, ultricies a, laoreet nec, hendrerit non," +"neque. Nulla sagittis sapien ac risus. Morbi ligula dolor, vestibulum" +"nec, viverra id, placerat dapibus, arcu. Curabitur egestas feugiat" +"tellus. Donec dignissim. Nunc ante. Curabitur id lorem. In mollis" +"tortor sit amet eros auctor dapibus. Proin nulla sem, tristique in," +"convallis id, iaculis feugiat cras amet."; + +/* + * this datatype is for our custom server determination function. this might + * be useful if you don't want to rely on simply hashing keys to determine + * where a key belongs, but instead want to write something fancy, or use some + * other kind of configuration data, i.e. a hash plus some data about a + * namespace, or whatever. see my_server_func, and test_redis_user_funcs + * for the examples. + */ +typedef struct { + const char *someval; + apr_uint32_t which_server; +} my_hash_server_baton; + + +/* this could do something fancy and return some hash result. + * for simplicity, just return the same value, so we can test it later on. + * if you wanted to use some external hashing library or functions for + * consistent hashing, for example, this would be a good place to do it. + */ +static apr_uint32_t my_hash_func(void *baton, const char *data, + apr_size_t data_len) +{ + + return HASH_FUNC_RESULT; +} + +/* + * a fancy function to determine which server to use given some kind of data + * and a hash value. this example actually ignores the hash value itself + * and pulls some number from the *baton, which is a struct that has some + * kind of meaningful stuff in it. + */ +static apr_redis_server_t *my_server_func(void *baton, + apr_redis_t *mc, + const apr_uint32_t hash) +{ + apr_redis_server_t *ms = NULL; + my_hash_server_baton *mhsb = (my_hash_server_baton *)baton; + + if(mc->ntotal == 0) { + return NULL; + } + + if(mc->ntotal < mhsb->which_server) { + return NULL; + } + + ms = mc->live_servers[mhsb->which_server - 1]; + + return ms; +} + +static apr_uint16_t firsttime = 0; +static int randval(apr_uint32_t high) +{ + apr_uint32_t i = 0; + double d = 0; + + if (firsttime == 0) { + srand((unsigned) (getpid())); + firsttime = 1; + } + + d = (double) rand() / ((double) RAND_MAX + 1); + i = (int) (d * (high - 0 + 1)); + + return i > 0 ? i : 1; +} + +/* + * general test to make sure we can create the redis struct and add + * some servers, but not more than we tell it we can add + */ + +static void test_redis_create(abts_case * tc, void *data) +{ + apr_pool_t *pool = p; + apr_status_t rv; + apr_redis_t *redis; + apr_redis_server_t *server, *s; + apr_uint32_t max_servers = 10; + apr_uint32_t i; + apr_uint32_t hash; + + rv = apr_redis_create(pool, max_servers, 0, &redis); + ABTS_ASSERT(tc, "redis create failed", rv == APR_SUCCESS); + + for (i = 1; i <= max_servers; i++) { + apr_port_t port; + + port = PORT + i; + rv = + apr_redis_server_create(pool, HOST, PORT + i, 0, 1, 1, 60, 60, &server); + ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS); + + rv = apr_redis_add_server(redis, server); + ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); + + s = apr_redis_find_server(redis, HOST, port); + ABTS_PTR_EQUAL(tc, server, s); + + rv = apr_redis_disable_server(redis, s); + ABTS_ASSERT(tc, "server disable failed", rv == APR_SUCCESS); + + rv = apr_redis_enable_server(redis, s); + ABTS_ASSERT(tc, "server enable failed", rv == APR_SUCCESS); + + hash = apr_redis_hash(redis, prefix, strlen(prefix)); + ABTS_ASSERT(tc, "hash failed", hash > 0); + + s = apr_redis_find_server_hash(redis, hash); + ABTS_PTR_NOTNULL(tc, s); + } + + rv = apr_redis_server_create(pool, HOST, PORT, 0, 1, 1, 60, 60, &server); + ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS); + + rv = apr_redis_add_server(redis, server); + ABTS_ASSERT(tc, "server add should have failed", rv != APR_SUCCESS); + +} + +/* install our own custom hashing and server selection routines. */ + +static int create_test_hash(apr_pool_t *p, apr_hash_t *h) +{ + int i; + + for (i = 0; i < TDATA_SIZE; i++) { + char *k, *v; + + k = apr_pstrcat(p, prefix, apr_itoa(p, i), NULL); + v = apr_pstrndup(p, txt, randval((apr_uint32_t)strlen(txt))); + + apr_hash_set(h, k, APR_HASH_KEY_STRING, v); + } + + return i; +} + +static void test_redis_user_funcs(abts_case * tc, void *data) +{ + apr_pool_t *pool = p; + apr_status_t rv; + apr_redis_t *redis; + apr_redis_server_t *found; + apr_uint32_t max_servers = 10; + apr_uint32_t hres; + apr_uint32_t i; + my_hash_server_baton *baton = + apr_pcalloc(pool, sizeof(my_hash_server_baton)); + + rv = apr_redis_create(pool, max_servers, 0, &redis); + ABTS_ASSERT(tc, "redis create failed", rv == APR_SUCCESS); + + /* as noted above, install our custom hash function, and call + * apr_redis_hash. the return value should be our predefined number, + * and our function just ignores the other args, for simplicity. + */ + redis->hash_func = my_hash_func; + + hres = apr_redis_hash(redis, "whatever", sizeof("whatever") - 1); + ABTS_INT_EQUAL(tc, HASH_FUNC_RESULT, hres); + + /* add some servers */ + for(i = 1; i <= 10; i++) { + apr_redis_server_t *ms; + + rv = apr_redis_server_create(pool, HOST, i, 0, 1, 1, 60, 60, &ms); + ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS); + + rv = apr_redis_add_server(redis, ms); + ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); + } + + /* + * set 'which_server' in our server_baton to find the third server + * which should have the same port. + */ + baton->which_server = 3; + redis->server_func = my_server_func; + redis->server_baton = baton; + found = apr_redis_find_server_hash(redis, 0); + ABTS_ASSERT(tc, "wrong server found", found->port == baton->which_server); +} + +/* test non data related commands like stats and version */ +static void test_redis_meta(abts_case * tc, void *data) +{ + apr_pool_t *pool = p; + apr_redis_t *redis; + apr_redis_server_t *server; + apr_redis_stats_t *stats; + char *result; + apr_status_t rv; + + rv = apr_redis_create(pool, 1, 0, &redis); + ABTS_ASSERT(tc, "redis create failed", rv == APR_SUCCESS); + + rv = apr_redis_server_create(pool, HOST, PORT, 0, 1, 1, 60, 60, &server); + ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS); + + rv = apr_redis_add_server(redis, server); + ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); + + rv = apr_redis_version(server, pool, &result); + ABTS_PTR_NOTNULL(tc, result); + + rv = apr_redis_stats(server, p, &stats); + ABTS_PTR_NOTNULL(tc, stats); + + /* + * no way to know exactly what will be in most of these, so + * just make sure there is something. + */ + ABTS_ASSERT(tc, "major", stats->major >= 1); + ABTS_ASSERT(tc, "minor", stats->minor >= 0); + ABTS_ASSERT(tc, "patch", stats->patch >= 0); + ABTS_ASSERT(tc, "process_id", stats->process_id >= 0); + ABTS_ASSERT(tc, "uptime_in_seconds", stats->uptime_in_seconds >= 0); + ABTS_ASSERT(tc, "arch_bits", stats->arch_bits >= 0); + ABTS_ASSERT(tc, "connected_clients", stats->connected_clients >= 0); + ABTS_ASSERT(tc, "blocked_clients", stats->blocked_clients >= 0); + ABTS_ASSERT(tc, "maxmemory", stats->maxmemory >= 0); + ABTS_ASSERT(tc, "used_memory", stats->used_memory >= 0); + ABTS_ASSERT(tc, "total_system_memory", stats->total_system_memory >= 0); + ABTS_ASSERT(tc, "total_connections_received", stats->total_connections_received >= 0); + ABTS_ASSERT(tc, "total_commands_processed", stats->total_commands_processed >= 0); + ABTS_ASSERT(tc, "total_net_input_bytes", stats->total_net_input_bytes >= 0); + ABTS_ASSERT(tc, "total_net_output_bytes", stats->total_net_output_bytes >= 0); + ABTS_ASSERT(tc, "keyspace_hits", stats->keyspace_hits >= 0); + ABTS_ASSERT(tc, "keyspace_misses", stats->keyspace_misses >= 0); + ABTS_ASSERT(tc, "role", stats->role >= 0); + ABTS_ASSERT(tc, "connected_slaves", stats->connected_slaves >= 0); + ABTS_ASSERT(tc, "used_cpu_sys", stats->used_cpu_sys >= 0); + ABTS_ASSERT(tc, "used_cpu_user", stats->used_cpu_user >= 0); + ABTS_ASSERT(tc, "cluster_enabled", stats->cluster_enabled >= 0); +} + + +/* basic tests of the increment and decrement commands */ +static void test_redis_incrdecr(abts_case * tc, void *data) +{ + apr_pool_t *pool = p; + apr_status_t rv; + apr_redis_t *redis; + apr_redis_server_t *server; + apr_uint32_t new; + char *result; + apr_size_t len; + apr_uint32_t i; + + rv = apr_redis_create(pool, 1, 0, &redis); + ABTS_ASSERT(tc, "redis create failed", rv == APR_SUCCESS); + + rv = apr_redis_server_create(pool, HOST, PORT, 0, 1, 1, 60, 60, &server); + ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS); + + rv = apr_redis_add_server(redis, server); + ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); + + rv = apr_redis_set(redis, prefix, "271", sizeof("271") - 1, 27); + ABTS_ASSERT(tc, "set failed", rv == APR_SUCCESS); + + for( i = 1; i <= TDATA_SIZE; i++) { + apr_uint32_t expect; + + rv = apr_redis_getp(redis, pool, prefix, &result, &len, NULL); + ABTS_ASSERT(tc, "get failed", rv == APR_SUCCESS); + + expect = i + atoi(result); + + rv = apr_redis_incr(redis, prefix, i, &new); + ABTS_ASSERT(tc, "incr failed", rv == APR_SUCCESS); + + ABTS_INT_EQUAL(tc, expect, new); + + rv = apr_redis_decr(redis, prefix, i, &new); + ABTS_ASSERT(tc, "decr failed", rv == APR_SUCCESS); + + ABTS_INT_EQUAL(tc, atoi(result), new); + + } + + rv = apr_redis_getp(redis, pool, prefix, &result, &len, NULL); + ABTS_ASSERT(tc, "get failed", rv == APR_SUCCESS); + + ABTS_INT_EQUAL(tc, 271, atoi(result)); + + rv = apr_redis_delete(redis, prefix, 0); + ABTS_ASSERT(tc, "delete failed", rv == APR_SUCCESS); +} + + +/* test setting and getting */ + +static void test_redis_setget(abts_case * tc, void *data) +{ + apr_pool_t *pool = p; + apr_status_t rv; + apr_redis_t *redis; + apr_redis_server_t *server; + apr_hash_t *tdata; + apr_hash_index_t *hi; + char *result; + apr_size_t len; + + rv = apr_redis_create(pool, 1, 0, &redis); + ABTS_ASSERT(tc, "redis create failed", rv == APR_SUCCESS); + + rv = apr_redis_server_create(pool, HOST, PORT, 0, 1, 1, 60, 60, &server); + ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS); + + rv = apr_redis_add_server(redis, server); + ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); + + tdata = apr_hash_make(pool); + + create_test_hash(pool, tdata); + + for (hi = apr_hash_first(p, tdata); hi; hi = apr_hash_next(hi)) { + const void *k; + void *v; + const char *key; + + apr_hash_this(hi, &k, NULL, &v); + key = k; + + rv = apr_redis_set(redis, key, v, strlen(v), 27); + ABTS_ASSERT(tc, "set failed", rv == APR_SUCCESS); + rv = apr_redis_getp(redis, pool, key, &result, &len, NULL); + ABTS_ASSERT(tc, "get failed", rv == APR_SUCCESS); + } + + rv = apr_redis_getp(redis, pool, "nothere3423", &result, &len, NULL); + + ABTS_ASSERT(tc, "get should have failed", rv != APR_SUCCESS); + + for (hi = apr_hash_first(p, tdata); hi; hi = apr_hash_next(hi)) { + const void *k; + const char *key; + + apr_hash_this(hi, &k, NULL, NULL); + key = k; + + rv = apr_redis_delete(redis, key, 0); + ABTS_ASSERT(tc, "delete failed", rv == APR_SUCCESS); + } +} + +/* test setting and getting */ + +static void test_redis_setexget(abts_case * tc, void *data) +{ + apr_pool_t *pool = p; + apr_status_t rv; + apr_redis_t *redis; + apr_redis_server_t *server; + apr_hash_t *tdata; + apr_hash_index_t *hi; + char *result; + apr_size_t len; + + rv = apr_redis_create(pool, 1, 0, &redis); + ABTS_ASSERT(tc, "redis create failed", rv == APR_SUCCESS); + + rv = apr_redis_server_create(pool, HOST, PORT, 0, 1, 1, 60, 60, &server); + ABTS_ASSERT(tc, "server create failed", rv == APR_SUCCESS); + + rv = apr_redis_add_server(redis, server); + ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); + + tdata = apr_hash_make(pool); + + create_test_hash(pool, tdata); + + for (hi = apr_hash_first(p, tdata); hi; hi = apr_hash_next(hi)) { + const void *k; + void *v; + const char *key; + + apr_hash_this(hi, &k, NULL, &v); + key = k; + + rv = apr_redis_ping(server); + ABTS_ASSERT(tc, "ping failed", rv == APR_SUCCESS); + rv = apr_redis_setex(redis, key, v, strlen(v), 10, 27); + ABTS_ASSERT(tc, "set failed", rv == APR_SUCCESS); + rv = apr_redis_getp(redis, pool, key, &result, &len, NULL); + ABTS_ASSERT(tc, "get failed", rv == APR_SUCCESS); + } + + rv = apr_redis_getp(redis, pool, "nothere3423", &result, &len, NULL); + + ABTS_ASSERT(tc, "get should have failed", rv != APR_SUCCESS); + + for (hi = apr_hash_first(p, tdata); hi; hi = apr_hash_next(hi)) { + const void *k; + const char *key; + + apr_hash_this(hi, &k, NULL, NULL); + key = k; + + rv = apr_redis_delete(redis, key, 0); + ABTS_ASSERT(tc, "delete failed", rv == APR_SUCCESS); + } +} + +/* use apr_socket stuff to see if there is in fact a Redis server + * running on PORT. + */ +static apr_status_t check_redis(void) +{ + apr_pool_t *pool = p; + apr_status_t rv; + apr_socket_t *sock = NULL; + apr_sockaddr_t *sa; + struct iovec vec[2]; + apr_size_t written; + char buf[128]; + apr_size_t len; + + rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, 0, pool); + if(rv != APR_SUCCESS) { + return rv; + } + + rv = apr_sockaddr_info_get(&sa, HOST, APR_INET, PORT, 0, pool); + if(rv != APR_SUCCESS) { + return rv; + } + + rv = apr_socket_timeout_set(sock, 1 * APR_USEC_PER_SEC); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_socket_connect(sock, sa); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_socket_timeout_set(sock, -1); + if (rv != APR_SUCCESS) { + return rv; + } + + vec[0].iov_base = "PING"; + vec[0].iov_len = sizeof("PING") - 1; + + vec[1].iov_base = "\r\n"; + vec[1].iov_len = sizeof("\r\n") -1; + + rv = apr_socket_sendv(sock, vec, 2, &written); + if (rv != APR_SUCCESS) { + return rv; + } + + len = sizeof(buf); + rv = apr_socket_recv(sock, buf, &len); + if(rv != APR_SUCCESS) { + return rv; + } + if(strncmp(buf, "+PONG", sizeof("+PONG")-1) != 0) { + rv = APR_EGENERAL; + } + + apr_socket_close(sock); + return rv; +} + +abts_suite *testredis(abts_suite * suite) +{ + apr_status_t rv; + suite = ADD_SUITE(suite); + /* check for a running redis on the typical port before + * trying to run the tests. succeed if we don't find one. + */ + rv = check_redis(); + if (rv == APR_SUCCESS) { + abts_run_test(suite, test_redis_create, NULL); + abts_run_test(suite, test_redis_user_funcs, NULL); + abts_run_test(suite, test_redis_meta, NULL); + abts_run_test(suite, test_redis_setget, NULL); + abts_run_test(suite, test_redis_setexget, NULL); + /* abts_run_test(suite, test_redis_multiget, NULL); */ + abts_run_test(suite, test_redis_incrdecr, NULL); + } + else { + abts_log_message("Error %d occurred attempting to reach Redis " + "on %s:%d. Skipping apr_redis tests...", + rv, HOST, PORT); + } + + return suite; +} diff --git a/test/testutil.h b/test/testutil.h index cdd96a3b372..f2a66b585ec 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -123,6 +123,7 @@ abts_suite *testcrypto(abts_suite *suite); abts_suite *testdbd(abts_suite *suite); abts_suite *testdate(abts_suite *suite); abts_suite *testmemcache(abts_suite *suite); +abts_suite *testredis(abts_suite *suite); abts_suite *testreslist(abts_suite *suite); abts_suite *testqueue(abts_suite *suite); abts_suite *testxml(abts_suite *suite); From 714383bc48776db8a315572888c4a6d9f45233cf Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sun, 6 Nov 2016 20:20:54 +0000 Subject: [PATCH 7626/7878] Force commit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1768388 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_redis.h | 6 ++++-- redis/apr_redis.c | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/apr_redis.h b/include/apr_redis.h index 9684bf4c1de..6333ae0e6be 100644 --- a/include/apr_redis.h +++ b/include/apr_redis.h @@ -412,14 +412,16 @@ typedef struct apr_uint64_t total_connections_received; /** Total commands processed */ apr_uint64_t total_commands_processed; + /** Total commands rejected */ + apr_uint64_t rejected_connections; /** Total net input bytes */ apr_uint64_t total_net_input_bytes; /** Total net output bytes */ apr_uint64_t total_net_output_bytes; /** Keyspace hits */ - apr_uint32_t keyspace_hits; + apr_uint64_t keyspace_hits; /** Keyspace misses */ - apr_uint32_t keyspace_misses; + apr_uint64_t keyspace_misses; /* # Replication */ /** Role */ diff --git a/redis/apr_redis.c b/redis/apr_redis.c index 905281a279e..0b2c5ecbfe1 100644 --- a/redis/apr_redis.c +++ b/redis/apr_redis.c @@ -1416,6 +1416,9 @@ apr_redis_multgetp(apr_redis_t *rc, #define STAT_total_commands_processed "total_commands_processed:" #define STAT_total_commands_processed_LEN (sizeof(STAT_total_commands_processed)-1) +#define STAT_rejected_connections "rejected_connections:" +#define STAT_rejected_connections_LEN (sizeof(STAT_rejected_connections)-1) + #define STAT_total_net_input_bytes "total_net_input_bytes:" #define STAT_total_net_input_bytes_LEN (sizeof(STAT_total_net_input_bytes)-1) @@ -1470,10 +1473,11 @@ static void update_stats(char *info, apr_redis_stats_t *stats) rc_do_stat(total_system_memory, uint64); rc_do_stat(total_connections_received, uint64); rc_do_stat(total_commands_processed, uint64); + rc_do_stat(rejected_connections, uint64); rc_do_stat(total_net_input_bytes, uint64); rc_do_stat(total_net_output_bytes, uint64); - rc_do_stat(keyspace_hits, uint32); - rc_do_stat(keyspace_misses, uint32); + rc_do_stat(keyspace_hits, uint64); + rc_do_stat(keyspace_misses, uint64); rc_do_stat(connected_slaves, uint32); rc_do_stat(used_cpu_sys, uint32); rc_do_stat(used_cpu_user, uint32); From 7d925b0c255a0383fb07619acf9e72531305dd25 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Sat, 19 Nov 2016 08:30:55 +0000 Subject: [PATCH 7627/7878] Add test for apr_file_open(APR_FOPEN_APPEND). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1770471 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/test/testfile.c b/test/testfile.c index 99c6255e3e6..2514bc23856 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -1031,6 +1031,75 @@ static void test_xthread(abts_case *tc, void *data) apr_file_close(f); } +static void test_append(abts_case *tc, void *data) +{ + apr_file_t *f1; + apr_file_t *f2; + const char *fname = "data/testappend.dat"; + apr_status_t rv; + apr_int32_t flags = APR_FOPEN_CREATE | APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_APPEND; + char buf[128]; + apr_off_t offset; + + apr_file_remove(fname, p); + + /* Open test file with APR_FOPEN_APPEND, but without APR_FOPEN_XTHREAD. */ + APR_ASSERT_SUCCESS(tc, "open test file", + apr_file_open(&f1, fname, flags, APR_FPROT_OS_DEFAULT, p)); + + /* Open test file with APR_FOPEN_APPEND and APR_FOPEN_XTHREAD. */ + APR_ASSERT_SUCCESS(tc, "open test file", + apr_file_open(&f2, fname, flags | APR_FOPEN_XTHREAD, APR_FPROT_OS_DEFAULT, p)); + + APR_ASSERT_SUCCESS(tc, "write should succeed", + apr_file_puts("w1", f1)); + offset = 0; + APR_ASSERT_SUCCESS(tc, "seek should succeed", + apr_file_seek(f1, APR_CUR, &offset)); + ABTS_INT_EQUAL(tc, 2, offset); + + APR_ASSERT_SUCCESS(tc, "write should succeed", + apr_file_puts("w2", f2)); + offset = 0; + APR_ASSERT_SUCCESS(tc, "seek should succeed", + apr_file_seek(f2, APR_CUR, &offset)); + ABTS_INT_EQUAL(tc, 4, (int) offset); + + APR_ASSERT_SUCCESS(tc, "write should succeed", + apr_file_puts("w3", f1)); + offset = 0; + APR_ASSERT_SUCCESS(tc, "seek should succeed", + apr_file_seek(f1, APR_CUR, &offset)); + ABTS_INT_EQUAL(tc, 6, (int) offset); + + APR_ASSERT_SUCCESS(tc, "write should succeed", + apr_file_puts("w4", f2)); + + offset = 0; + APR_ASSERT_SUCCESS(tc, "seek should succeed", + apr_file_seek(f2, APR_CUR, &offset)); + ABTS_INT_EQUAL(tc, 8, (int) offset); + + /* Check file content file using F1. */ + offset = 0; + APR_ASSERT_SUCCESS(tc, "seek should succeed", + apr_file_seek(f1, APR_SET, &offset)); + memset(buf, 0, sizeof(buf)); + apr_file_read_full(f1, buf, sizeof(buf), NULL); + ABTS_STR_EQUAL(tc, "w1w2w3w4", buf); + + /* Check file content file using F2. */ + offset = 0; + APR_ASSERT_SUCCESS(tc, "seek should succeed", + apr_file_seek(f2, APR_SET, &offset)); + memset(buf, 0, sizeof(buf)); + apr_file_read_full(f2, buf, sizeof(buf), NULL); + ABTS_STR_EQUAL(tc, "w1w2w3w4", buf); + + apr_file_close(f1); + apr_file_close(f2); +} + abts_suite *testfile(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -1071,6 +1140,7 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_fail_read_flush, NULL); abts_run_test(suite, test_buffer_set_get, NULL); abts_run_test(suite, test_xthread, NULL); + abts_run_test(suite, test_append, NULL); return suite; } From 0980775e8d34f2e748f4e94ef7f3e5adbdbe9bc1 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Sat, 19 Nov 2016 12:03:06 +0000 Subject: [PATCH 7628/7878] Follow-up to r1770471: resolve two compiler warnings in testfile.c. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1770489 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/testfile.c b/test/testfile.c index 2514bc23856..ddb1460091f 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -1036,7 +1036,6 @@ static void test_append(abts_case *tc, void *data) apr_file_t *f1; apr_file_t *f2; const char *fname = "data/testappend.dat"; - apr_status_t rv; apr_int32_t flags = APR_FOPEN_CREATE | APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_APPEND; char buf[128]; apr_off_t offset; @@ -1056,7 +1055,7 @@ static void test_append(abts_case *tc, void *data) offset = 0; APR_ASSERT_SUCCESS(tc, "seek should succeed", apr_file_seek(f1, APR_CUR, &offset)); - ABTS_INT_EQUAL(tc, 2, offset); + ABTS_INT_EQUAL(tc, 2, (int) offset); APR_ASSERT_SUCCESS(tc, "write should succeed", apr_file_puts("w2", f2)); From 30253307c1be473f75be0c5ac55a834eddd27c0f Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 22 Nov 2016 12:43:47 +0000 Subject: [PATCH 7629/7878] NetWare issue git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1770832 13f79535-47bb-0310-9956-ffa450edef68 --- redis/apr_redis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/apr_redis.c b/redis/apr_redis.c index 0b2c5ecbfe1..dff1502b1a3 100644 --- a/redis/apr_redis.c +++ b/redis/apr_redis.c @@ -859,9 +859,9 @@ static apr_status_t grab_bulk_resp(apr_redis_server_t *rs, apr_redis_t *rc, { char *length; char *last; + apr_status_t rv; apr_size_t len = 0; *new_length = 0; - apr_status_t rv; length = apr_strtok(conn->buffer + 1, " ", &last); if (length) { From 61719db4a502905e8c046735a6067f892b16e3ec Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 2 Dec 2016 22:01:09 +0000 Subject: [PATCH 7630/7878] apr_crypto: axe the un(thread)safe key cache, creating each key on the pool given to crypto_key()/crypto_passphrase(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1772414 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_commoncrypto.c | 16 ++++--------- crypto/apr_crypto_nss.c | 40 +++++++++++++++++--------------- crypto/apr_crypto_openssl.c | 22 +++++++----------- 3 files changed, 34 insertions(+), 44 deletions(-) diff --git a/crypto/apr_crypto_commoncrypto.c b/crypto/apr_crypto_commoncrypto.c index f06f2ca3c1f..9138933067f 100644 --- a/crypto/apr_crypto_commoncrypto.c +++ b/crypto/apr_crypto_commoncrypto.c @@ -41,7 +41,6 @@ struct apr_crypto_t apr_pool_t *pool; const apr_crypto_driver_t *provider; apu_err_t *result; - apr_array_header_t *keys; apr_hash_t *types; apr_hash_t *modes; apr_random_t *rng; @@ -206,11 +205,6 @@ static apr_status_t crypto_make(apr_crypto_t **ff, return APR_ENOMEM; } - f->keys = apr_array_make(pool, 10, sizeof(apr_crypto_key_t)); - if (!f->keys) { - return APR_ENOMEM; - } - f->types = apr_hash_make(pool); if (!f->types) { return APR_ENOMEM; @@ -388,7 +382,7 @@ static apr_status_t crypto_key(apr_crypto_key_t **k, apr_crypto_key_t *key = *k; if (!key) { - *k = key = apr_array_push(f->keys); + *k = key = apr_pcalloc(p, sizeof *key); } if (!key) { return APR_ENOMEM; @@ -480,10 +474,10 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, apr_crypto_key_t *key = *k; if (!key) { - *k = key = apr_array_push(f->keys); - } - if (!key) { - return APR_ENOMEM; + *k = key = apr_pcalloc(p, sizeof *key); + if (!key) { + return APR_ENOMEM; + } } key->f = f; diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index e57241cb9dc..1c3bb2c6afa 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -50,7 +50,6 @@ struct apr_crypto_t { apr_pool_t *pool; const apr_crypto_driver_t *provider; apu_err_t *result; - apr_array_header_t *keys; apr_crypto_config_t *config; apr_hash_t *types; apr_hash_t *modes; @@ -266,6 +265,15 @@ static apr_status_t crypto_block_cleanup_helper(void *data) return crypto_block_cleanup(block); } +static apr_status_t crypto_key_cleanup(void *data) +{ + apr_crypto_key_t *key = data; + if (key->symKey) { + PK11_FreeSymKey(key->symKey); + key->symKey = NULL; + } + return APR_SUCCESS; +} /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. @@ -274,15 +282,6 @@ static apr_status_t crypto_block_cleanup_helper(void *data) */ static apr_status_t crypto_cleanup(apr_crypto_t *f) { - apr_crypto_key_t *key; - if (f->keys) { - while ((key = apr_array_pop(f->keys))) { - if (key->symKey) { - PK11_FreeSymKey(key->symKey); - key->symKey = NULL; - } - } - } return APR_SUCCESS; } @@ -326,7 +325,6 @@ static apr_status_t crypto_make(apr_crypto_t **ff, if (!f->result) { return APR_ENOMEM; } - f->keys = apr_array_make(pool, 10, sizeof(apr_crypto_key_t)); f->types = apr_hash_make(pool); if (!f->types) { @@ -491,10 +489,12 @@ static apr_status_t crypto_key(apr_crypto_key_t **k, key = *k; if (!key) { - *k = key = apr_array_push(f->keys); - } - if (!key) { - return APR_ENOMEM; + *k = key = apr_pcalloc(p, sizeof *key); + if (!key) { + return APR_ENOMEM; + } + apr_pool_cleanup_register(p, key, crypto_key_cleanup, + apr_pool_cleanup_null); } key->f = f; @@ -683,10 +683,12 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, apr_crypto_key_t *key = *k; if (!key) { - *k = key = apr_array_push(f->keys); - } - if (!key) { - return APR_ENOMEM; + *k = key = apr_pcalloc(p, sizeof *key); + if (!key) { + return APR_ENOMEM; + } + apr_pool_cleanup_register(p, key, crypto_key_cleanup, + apr_pool_cleanup_null); } key->f = f; diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 3f4dddb3712..594fc1467c7 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -40,7 +40,6 @@ struct apr_crypto_t { apr_pool_t *pool; const apr_crypto_driver_t *provider; apu_err_t *result; - apr_array_header_t *keys; apr_crypto_config_t *config; apr_hash_t *types; apr_hash_t *modes; @@ -268,11 +267,6 @@ static apr_status_t crypto_make(apr_crypto_t **ff, return APR_ENOMEM; } - f->keys = apr_array_make(pool, 10, sizeof(apr_crypto_key_t)); - if (!f->keys) { - return APR_ENOMEM; - } - f->types = apr_hash_make(pool); if (!f->types) { return APR_ENOMEM; @@ -432,10 +426,10 @@ static apr_status_t crypto_key(apr_crypto_key_t **k, apr_status_t rv; if (!key) { - *k = key = apr_array_push(f->keys); - } - if (!key) { - return APR_ENOMEM; + *k = key = apr_pcalloc(p, sizeof *key); + if (!key) { + return APR_ENOMEM; + } } key->f = f; @@ -533,10 +527,10 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, apr_status_t rv; if (!key) { - *k = key = apr_array_push(f->keys); - } - if (!key) { - return APR_ENOMEM; + *k = key = apr_pcalloc(p, sizeof *key); + if (!key) { + return APR_ENOMEM; + } } key->f = f; From 02ef46936504dc3cb3ad28742c07f99cc5ad00c6 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Mon, 5 Dec 2016 20:56:59 +0000 Subject: [PATCH 7631/7878] =?UTF-8?q?apr=5Fcrypt:=20avoid=20excessive=20it?= =?UTF-8?q?eration=20in=20bcrypt=20hash.=20Patch=20by=20Hanno=20B=C3=B6ck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1772803 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ crypto/crypt_blowfish.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index fe238b7616c..2f9bfb9b5ab 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_crypto: avoid excessive iteration in bcrypt hash. + [Hanno Böck ] + *) apr_siphash: Implement keyed hash function SipHash. [Yann Ylavic] *) apr_atomic: change the API of apr_atomic_casptr() apr_atomic_xchgptr() diff --git a/crypto/crypt_blowfish.c b/crypto/crypt_blowfish.c index ec9a188b3a2..013c1ed82f4 100644 --- a/crypto/crypt_blowfish.c +++ b/crypto/crypt_blowfish.c @@ -877,7 +877,7 @@ char *_crypt_gensalt_blowfish_rn(const char *prefix, unsigned long count, const char *input, int size, char *output, int output_size) { if (size < 16 || output_size < 7 + 22 + 1 || - (count && (count < 4 || count > 31)) || + (count && (count < 4 || count > 17)) || prefix[0] != '$' || prefix[1] != '2' || (prefix[2] != 'a' && prefix[2] != 'y')) { if (output_size > 0) output[0] = '\0'; From 7bbacde3829b2cd52dd57c91d462905ec7abaf49 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 12 Dec 2016 18:48:08 +0000 Subject: [PATCH 7632/7878] Rather convoluted, fix doxygen and @see references for the table_do logic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1773849 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index c100f42d2ee..60ca54cf121 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -380,6 +380,7 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, * @remark Iteration continues while this callback function returns non-zero. * To export the callback function for apr_table_[v]do() it must be declared * in the _NONSTD convention. + * @see apr_table_do @see apr_table_vdo */ typedef int (apr_table_do_callback_fn_t)(void *rec, const char *key, const char *value); @@ -392,7 +393,7 @@ typedef int (apr_table_do_callback_fn_t)(void *rec, const char *key, * in the table. Otherwise, the function is invoked only for those * elements matching the keys specified. * - * If an invocation of the @param comp function returns zero, + * If an invocation of the comp function returns zero, * iteration will continue using the next specified key, if any. * * @param comp The function to run @@ -401,7 +402,7 @@ typedef int (apr_table_do_callback_fn_t)(void *rec, const char *key, * @param ... A varargs array of zero or more (char *) keys followed by NULL * @return FALSE if one of the comp() iterations returned zero; TRUE if all * iterations returned non-zero - * @see apr_table_do_callback_fn_t + * @see apr_table_do_callback_fn_t @see apr_table_vdo */ APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, void *rec, const apr_table_t *t, ...) @@ -418,7 +419,7 @@ APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, * every element in the table. Otherwise, the function is invoked * only for those elements matching the keys specified. * - * If an invocation of the @param comp function returns zero, + * If an invocation of the comp function returns zero, * iteration will continue using the next specified key, if any. * * @param comp The function to run @@ -427,7 +428,7 @@ APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, * @param vp List of zero or more (char *) keys followed by NULL * @return FALSE if one of the comp() iterations returned zero; TRUE if all * iterations returned non-zero - * @see apr_table_do_callback_fn_t + * @see apr_table_do_callback_fn_t @see apr_table_do */ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, void *rec, const apr_table_t *t, va_list vp); From fcf6fac996797cd8267fe0f35927e781e5f3818c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 12 Dec 2016 18:50:11 +0000 Subject: [PATCH 7633/7878] Fix a second doxygen syntax error git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1773852 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index 60ca54cf121..fe3084bd646 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -413,7 +413,7 @@ APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, /** * Iterate over a table running the provided function once for every - * element in the table. The @param vp varargs parameter must be a + * element in the table. The vp varargs parameter must be a * list of zero or more (char *) keys followed by a NULL pointer. If * zero keys are given, the @param comp function will be invoked for * every element in the table. Otherwise, the function is invoked From 09a659a94ffbd7acc4cabd209ea699d3cf20fde9 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 13 Dec 2016 08:36:47 +0000 Subject: [PATCH 7634/7878] apr_crypto: blowfish: follow up to r1772803: also cap hash verification time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1773929 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/crypt_blowfish.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/crypt_blowfish.c b/crypto/crypt_blowfish.c index 013c1ed82f4..23580c2b43d 100644 --- a/crypto/crypt_blowfish.c +++ b/crypto/crypt_blowfish.c @@ -684,7 +684,8 @@ static char *BF_crypt(const char *key, const char *setting, } count = (BF_word)1 << ((setting[4] - '0') * 10 + (setting[5] - '0')); - if (count < min || BF_decode(data.binary.salt, &setting[7], 16)) { + if (count < min || count > 17 || + BF_decode(data.binary.salt, &setting[7], 16)) { __set_errno(EINVAL); return NULL; } From d0b0d71d115e2ad2c7c763ab0aec638d11d27f4b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 14 Dec 2016 20:45:04 +0000 Subject: [PATCH 7635/7878] Nobody should be running pre-IPV6 flavors of Windows OS abandonware anymore git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1774348 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr.hw b/include/apr.hw index 94bf7607ed3..6366ba93290 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -310,7 +310,7 @@ extern "C" { #define APR_HAVE_IN_ADDR 1 #define APR_HAVE_INET_ADDR 1 #define APR_HAVE_INET_NETWORK 0 -#define APR_HAVE_IPV6 0 +#define APR_HAVE_IPV6 1 #define APR_HAVE_SOCKADDR_UN 0 #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 From d0c516b96d584bc00b266548646305d67bfff8ae Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Sat, 17 Dec 2016 07:42:40 +0000 Subject: [PATCH 7636/7878] Optimize apr_file_info_get(APR_FINFO_SIZE) on Windows. * file_io/win32/filestat.c (apr_file_info_get): Use GetFileSizeEx() instead of GetFileInformationByHandleEx() when only APR_FINFO_SIZE is requested. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1774712 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 20397d22aad..ba4160785d6 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -427,6 +427,24 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want return rv; } + /* GetFileInformationByHandle() is implemented via two syscalls: + * QueryInformationVolume and QueryAllInformationFile. Use cheaper + * GetFileSizeEx() API if we only need to get the file size. */ + if (wanted == APR_FINFO_SIZE) { + LARGE_INTEGER size; + + if (!GetFileSizeEx(thefile->filehand, &size)) { + return apr_get_os_error(); + } + + finfo->pool = thefile->pool; + finfo->fname = thefile->fname; + finfo->size = size.QuadPart; + finfo->valid = APR_FINFO_SIZE; + + return APR_SUCCESS; + } + if (!GetFileInformationByHandle(thefile->filehand, &FileInfo)) { return apr_get_os_error(); } From c418d3e9b2afc3dd426c85e08ad96279e3a250f0 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Sat, 17 Dec 2016 07:48:44 +0000 Subject: [PATCH 7637/7878] Add tsvn:logminsize, tsvn:logwidthmarker, tsvn:projectlanguage and webviewer:projectlanguage properties for TortoiseSVN. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1774713 13f79535-47bb-0310-9956-ffa450edef68 From 4badf430e36c20ffe3c69c443b2c5eb4ad3cbdcc Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Sat, 17 Dec 2016 07:54:33 +0000 Subject: [PATCH 7638/7878] Add svn:auto-props to automatically add svn:eol-style=native for most commonly used file types. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1774714 13f79535-47bb-0310-9956-ffa450edef68 From c6b22788b88c847ec0ebdca7b3c68a8cc90a1e1a Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Sat, 17 Dec 2016 07:57:46 +0000 Subject: [PATCH 7639/7878] Add svn:eol-style=native for apr_redis.h, apr_redis.c and testredis.c. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1774715 13f79535-47bb-0310-9956-ffa450edef68 From a641e917551791edf410b0c13d74a6ca18b044fe Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Sun, 18 Dec 2016 18:13:22 +0000 Subject: [PATCH 7640/7878] Use CreateFileMappingW on Unicode capable Windows. * mmap/win32/mmap.c (apr_mmap_create): Use CreateFileMappingW() if APR_HAS_UNICODE_FS and IF_WIN_OS_IS_UNICODE. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1774923 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/win32/mmap.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index d5d88aebd00..8fbb2f25bb0 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -108,8 +108,20 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, * of the mapped region! */ - (*new)->mhandle = CreateFileMapping(file->filehand, NULL, fmaccess, - 0, 0, NULL); +#if APR_HAS_UNICODE_FS + IF_WIN_OS_IS_UNICODE + { + (*new)->mhandle = CreateFileMappingW(file->filehand, NULL, fmaccess, + 0, 0, NULL); + } +#endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI + { + (*new)->mhandle = CreateFileMappingA(file->filehand, NULL, fmaccess, + 0, 0, NULL); + } +#endif if (!(*new)->mhandle || (*new)->mhandle == INVALID_HANDLE_VALUE) { *new = NULL; From 1b19c5d3e93286c4989edcda01dd357e5a24f317 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 19 Dec 2016 00:45:38 +0000 Subject: [PATCH 7641/7878] locks: follow up to r1667900. As noticed by rjung, not all pthread implementations have mutex_timedlock(), like Solaris 8, so proc_mutex_proc_pthread_timedacquire() can return APR_ENOTIMPL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1774973 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index e29978a0774..c9e4b20f9a4 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -649,6 +649,7 @@ proc_mutex_proc_pthread_timedacquire(apr_proc_mutex_t *mutex, apr_time_t timeout, int absolute) { +#ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK if (timeout < 0) { return proc_mutex_proc_pthread_acquire(mutex); } @@ -683,6 +684,9 @@ proc_mutex_proc_pthread_timedacquire(apr_proc_mutex_t *mutex, } mutex->curr_locked = 1; return APR_SUCCESS; +#else + return APR_ENOTIMPL; +#endif } static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex) From 7d8af8c3efed89a156fdd071f53512089ec32440 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 19 Dec 2016 01:53:30 +0000 Subject: [PATCH 7642/7878] apr_crypto: blowfish: revert r1773929. Wrong place for this check, and wrong value too (should be 1 << 17). But actually the max is already caped by _crypt_gensalt_blowfish_rn() which is necessarily called previously in apr_bcrypt_encode(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1774976 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/crypt_blowfish.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crypto/crypt_blowfish.c b/crypto/crypt_blowfish.c index 23580c2b43d..013c1ed82f4 100644 --- a/crypto/crypt_blowfish.c +++ b/crypto/crypt_blowfish.c @@ -684,8 +684,7 @@ static char *BF_crypt(const char *key, const char *setting, } count = (BF_word)1 << ((setting[4] - '0') * 10 + (setting[5] - '0')); - if (count < min || count > 17 || - BF_decode(data.binary.salt, &setting[7], 16)) { + if (count < min || BF_decode(data.binary.salt, &setting[7], 16)) { __set_errno(EINVAL); return NULL; } From 3fcdd5d1e065cf551610750ffbbf5a94de16c744 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 19 Dec 2016 11:54:41 +0000 Subject: [PATCH 7643/7878] proc_mutex_pthread: simplify (shorten) methods' names by removing the second/double proc_ (consistently with other mechanisms). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1775069 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 53 ++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index c9e4b20f9a4..0971f952c28 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -479,7 +479,7 @@ static apr_status_t proc_pthread_mutex_unref(void *mutex_) return APR_SUCCESS; } -static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_) +static apr_status_t proc_mutex_pthread_cleanup(void *mutex_) { apr_proc_mutex_t *mutex=mutex_; apr_status_t rv; @@ -496,8 +496,8 @@ static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_) return APR_SUCCESS; } -static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, - const char *fname) +static apr_status_t proc_mutex_pthread_create(apr_proc_mutex_t *new_mutex, + const char *fname) { apr_status_t rv; int fd; @@ -526,14 +526,14 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif - proc_mutex_proc_pthread_cleanup(new_mutex); + proc_mutex_pthread_cleanup(new_mutex); return rv; } if ((rv = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif - proc_mutex_proc_pthread_cleanup(new_mutex); + proc_mutex_pthread_cleanup(new_mutex); pthread_mutexattr_destroy(&mattr); return rv; } @@ -544,7 +544,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif - proc_mutex_proc_pthread_cleanup(new_mutex); + proc_mutex_pthread_cleanup(new_mutex); pthread_mutexattr_destroy(&mattr); return rv; } @@ -552,7 +552,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif - proc_mutex_proc_pthread_cleanup(new_mutex); + proc_mutex_pthread_cleanup(new_mutex); pthread_mutexattr_destroy(&mattr); return rv; } @@ -562,7 +562,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif - proc_mutex_proc_pthread_cleanup(new_mutex); + proc_mutex_pthread_cleanup(new_mutex); pthread_mutexattr_destroy(&mattr); return rv; } @@ -574,7 +574,7 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif - proc_mutex_proc_pthread_cleanup(new_mutex); + proc_mutex_pthread_cleanup(new_mutex); return rv; } @@ -585,9 +585,9 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, return APR_SUCCESS; } -static apr_status_t proc_mutex_proc_pthread_child_init(apr_proc_mutex_t **mutex, - apr_pool_t *pool, - const char *fname) +static apr_status_t proc_mutex_pthread_child_init(apr_proc_mutex_t **mutex, + apr_pool_t *pool, + const char *fname) { (*mutex)->curr_locked = 0; if (proc_pthread_mutex_inc(*mutex)) { @@ -597,7 +597,7 @@ static apr_status_t proc_mutex_proc_pthread_child_init(apr_proc_mutex_t **mutex, return APR_SUCCESS; } -static apr_status_t proc_mutex_proc_pthread_acquire(apr_proc_mutex_t *mutex) +static apr_status_t proc_mutex_pthread_acquire(apr_proc_mutex_t *mutex) { apr_status_t rv; @@ -619,7 +619,7 @@ static apr_status_t proc_mutex_proc_pthread_acquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_proc_pthread_tryacquire(apr_proc_mutex_t *mutex) +static apr_status_t proc_mutex_pthread_tryacquire(apr_proc_mutex_t *mutex) { apr_status_t rv; @@ -644,14 +644,13 @@ static apr_status_t proc_mutex_proc_pthread_tryacquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t -proc_mutex_proc_pthread_timedacquire(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute) +static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, + apr_time_t timeout, + int absolute) { #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK if (timeout < 0) { - return proc_mutex_proc_pthread_acquire(mutex); + return proc_mutex_pthread_acquire(mutex); } else { apr_status_t rv; @@ -689,7 +688,7 @@ proc_mutex_proc_pthread_timedacquire(apr_proc_mutex_t *mutex, #endif } -static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex) +static apr_status_t proc_mutex_pthread_release(apr_proc_mutex_t *mutex) { apr_status_t rv; @@ -706,13 +705,13 @@ static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex) static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_methods = { APR_PROCESS_LOCK_MECH_IS_GLOBAL, - proc_mutex_proc_pthread_create, - proc_mutex_proc_pthread_acquire, - proc_mutex_proc_pthread_tryacquire, - proc_mutex_proc_pthread_timedacquire, - proc_mutex_proc_pthread_release, - proc_mutex_proc_pthread_cleanup, - proc_mutex_proc_pthread_child_init, + proc_mutex_pthread_create, + proc_mutex_pthread_acquire, + proc_mutex_pthread_tryacquire, + proc_mutex_pthread_timedacquire, + proc_mutex_pthread_release, + proc_mutex_pthread_cleanup, + proc_mutex_pthread_child_init, proc_mutex_no_perms_set, APR_LOCK_PROC_PTHREAD, "pthread" From 68af0b5ed794dbcc548f1eb7f9d77ee0515cb945 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Mon, 2 Jan 2017 19:42:49 +0000 Subject: [PATCH 7644/7878] Happy New Year 2017 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1776994 13f79535-47bb-0310-9956-ffa450edef68 --- NOTICE | 2 +- include/apr_version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NOTICE b/NOTICE index 873d5084765..1d72bb175ec 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Apache Portable Runtime -Copyright (c) 2000-2016 The Apache Software Foundation. +Copyright (c) 2000-2017 The Apache Software Foundation. This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff --git a/include/apr_version.h b/include/apr_version.h index 0741b209402..50c4b63d94a 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -38,7 +38,7 @@ */ -#define APR_COPYRIGHT "Copyright (c) 2000-2016 The Apache Software " \ +#define APR_COPYRIGHT "Copyright (c) 2000-2017 The Apache Software " \ "Foundation or its licensors, as applicable." /* The numeric compile-time version constants. These constants are the From afe3d34d6e5496985db2293d5befd91eb0282d85 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Mon, 2 Jan 2017 20:00:26 +0000 Subject: [PATCH 7645/7878] Update config.guess and config.sub from http://git.savannah.gnu.org/cgit/config.git. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1776998 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 123 +++++++++++++++++++++++++-------------------- build/config.sub | 35 +++++++++---- 2 files changed, 94 insertions(+), 64 deletions(-) diff --git a/build/config.guess b/build/config.guess index dcd5149681d..bbd48b60e88 100755 --- a/build/config.guess +++ b/build/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2016-01-01' +timestamp='2017-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -186,9 +186,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. + # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in - arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -237,6 +240,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; @@ -268,42 +275,42 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 @@ -376,16 +383,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build - SUN_ARCH="i386" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` @@ -410,7 +417,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} @@ -635,13 +642,13 @@ EOF sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi @@ -680,11 +687,11 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build @@ -697,12 +704,12 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} @@ -807,14 +814,14 @@ EOF echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) @@ -896,7 +903,7 @@ EOF exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix @@ -919,7 +926,7 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) @@ -993,6 +1000,9 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + mips64el:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; @@ -1025,6 +1035,9 @@ EOF ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; @@ -1272,6 +1285,9 @@ EOF SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; @@ -1285,9 +1301,9 @@ EOF UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in @@ -1309,7 +1325,7 @@ EOF exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi @@ -1340,7 +1356,7 @@ EOF # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" @@ -1382,7 +1398,7 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos @@ -1401,18 +1417,17 @@ esac cat >&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp diff --git a/build/config.sub b/build/config.sub index da6d1b6826a..7e792b4ae17 100755 --- a/build/config.sub +++ b/build/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2016-01-01' +timestamp='2017-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -67,7 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -117,7 +117,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -301,6 +301,7 @@ case $basic_machine in | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ @@ -428,6 +429,7 @@ case $basic_machine in | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ @@ -643,6 +645,14 @@ case $basic_machine in basic_machine=m68k-bull os=-sysv3 ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; ebmon29k) basic_machine=a29k-amd os=-ebmon @@ -1022,7 +1032,7 @@ case $basic_machine in ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) @@ -1032,7 +1042,7 @@ case $basic_machine in ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) @@ -1382,14 +1392,14 @@ case $os in | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ @@ -1399,7 +1409,7 @@ case $os in | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos*) + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1531,6 +1541,8 @@ case $os in ;; -nacl*) ;; + -ios) + ;; -none) ;; *) @@ -1626,6 +1638,9 @@ case $basic_machine in sparc-* | *-sun) os=-sunos4.1.1 ;; + pru-*) + os=-elf + ;; *-be) os=-beos ;; From 8c60e2674846c0d6bbdc2653e691f94e4c45148b Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 10 Jan 2017 16:01:49 +0000 Subject: [PATCH 7646/7878] race condition git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1778149 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testpoll.c b/test/testpoll.c index 342f7090070..644983df3b9 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -807,7 +807,7 @@ static void pollset_wakeup(abts_case *tc, void *data) rv = apr_pollset_add(pollset, &socket_pollfd); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - send_msg(s, sa, 0, tc); + send_msg(s, sa, 0, tc); apr_sleep(1000); rv = apr_pollset_wakeup(pollset); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); From 82d06e52d251ca4dd3c802120e8f43cf1dc62ddc Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 10 Jan 2017 16:08:09 +0000 Subject: [PATCH 7647/7878] Register testsiphash for cmake. Submitted by: Michal Karm Babacek Reviewed by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1778153 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4936325b89..9a36de9c26e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -396,6 +396,7 @@ SET(APR_TEST_SOURCES test/testreslist.c test/testrmm.c test/testshm.c + test/testsiphash.c test/testskiplist.c test/testsleep.c test/testsock.c From dbc452734752bb68997c81763b6865cbf9706db8 Mon Sep 17 00:00:00 2001 From: Dirk-Willem van Gulik Date: Thu, 19 Jan 2017 17:58:57 +0000 Subject: [PATCH 7648/7878] Add a few error code strings that got lost/awal in the apr-util migration. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1779500 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index f553a37b614..4f9b1d92474 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -19,6 +19,8 @@ #include "apr_lib.h" #include "apr_dso.h" +#include "apu_errno.h" + #if APR_HAVE_NETDB_H #include #endif @@ -139,6 +141,15 @@ static char *apr_error_string(apr_status_t statcode) return "The process is not recognized."; case APR_EGENERAL: return "Internal error (specific information not available)"; + +/* APR Util error codes */ + case APR_ECRYPT: + return "Internal error in the crypto subsystem (specific information not available)"; + case APR_ENOENGINE: + return "No engine found for crypto subsystem"; + case APR_EINITENGINE: + return "Failed to init engine for crypto subsystem"; + default: return "Error string not specified yet"; } From bb65527ec0390788209bb2853a436cfe54e00420 Mon Sep 17 00:00:00 2001 From: Dirk-Willem van Gulik Date: Tue, 24 Jan 2017 07:46:10 +0000 Subject: [PATCH 7649/7878] apr_base64_encode_len() already inclues the \0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1780034 13f79535-47bb-0310-9956-ffa450edef68 --- encoding/apr_base64.c | 2 +- test/testbase64.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/encoding/apr_base64.c b/encoding/apr_base64.c index 82e6e23d11a..b07aede010b 100644 --- a/encoding/apr_base64.c +++ b/encoding/apr_base64.c @@ -285,7 +285,7 @@ APR_DECLARE(char *) apr_pbase64_encode(apr_pool_t *p, const char *string) char *encoded; int l = strlen(string); - encoded = (char *) apr_palloc(p, 1 + apr_base64_encode_len(l)); + encoded = (char *) apr_palloc(p, apr_base64_encode_len(l)); l = apr_base64_encode(encoded, string, l); encoded[l] = '\0'; /* make binary sequence into string */ diff --git a/test/testbase64.c b/test/testbase64.c index d71b8e929c9..92cccb712f0 100644 --- a/test/testbase64.c +++ b/test/testbase64.c @@ -69,7 +69,8 @@ static void test_base64(abts_case *tc, void *data) enc = apr_pbase64_encode(pool, base64_tbl[i].orig); ABTS_ASSERT(tc, "base 64 encoded from pool matches expected output", - (strcmp(enc, base64_tbl[i].enc) == 0)) + (strcmp(enc, base64_tbl[i].enc) == 0)); + ABTS_ASSERT(tc, "base 64 length", strlen(enc) == strlen(base64_tbl[i].enc)); } } From 79193c3e1f557dda7fc29f9e05314d62e518e2fa Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 2 Feb 2017 13:14:16 +0000 Subject: [PATCH 7650/7878] apr_crypto: follow up to r1772803. Still avoid excessive bcrypt iterations, verification side this time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1781391 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/crypt_blowfish.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/crypt_blowfish.c b/crypto/crypt_blowfish.c index 013c1ed82f4..3d306cf8d3f 100644 --- a/crypto/crypt_blowfish.c +++ b/crypto/crypt_blowfish.c @@ -675,9 +675,9 @@ static char *BF_crypt(const char *key, const char *setting, setting[2] < 'a' || setting[2] > 'z' || !flags_by_subtype[(unsigned int)(unsigned char)setting[2] - 'a'] || setting[3] != '$' || - setting[4] < '0' || setting[4] > '3' || + setting[4] < '0' || setting[4] > '1' || setting[5] < '0' || setting[5] > '9' || - (setting[4] == '3' && setting[5] > '1') || + (setting[4] == '1' && setting[5] > '7') || setting[6] != '$') { __set_errno(EINVAL); return NULL; From 16131f2c73f064fa83b0427fbece09f99ee98a34 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 7 Feb 2017 18:29:17 +0000 Subject: [PATCH 7651/7878] apr_redis: reserve buffer space for trailing \0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1782042 13f79535-47bb-0310-9956-ffa450edef68 --- redis/apr_redis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/apr_redis.c b/redis/apr_redis.c index dff1502b1a3..77692736619 100644 --- a/redis/apr_redis.c +++ b/redis/apr_redis.c @@ -372,7 +372,7 @@ rc_conn_construct(void **conn_, void *params, apr_pool_t *pool) return rv; } - conn->buffer = apr_palloc(conn->p, BUFFER_SIZE); + conn->buffer = apr_palloc(conn->p, BUFFER_SIZE + 1); conn->blen = 0; conn->rs = rs; From cab696cc17cd2d2d3a01f8c72decc5c8bcbc1102 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 7 Feb 2017 18:36:09 +0000 Subject: [PATCH 7652/7878] apr_memcache: reserve buffer space for trailing \0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1782045 13f79535-47bb-0310-9956-ffa450edef68 --- memcache/apr_memcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index 65247f87e3e..8cd1e1d0e70 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -356,7 +356,7 @@ mc_conn_construct(void **conn_, void *params, apr_pool_t *pool) return rv; } - conn->buffer = apr_palloc(conn->p, BUFFER_SIZE); + conn->buffer = apr_palloc(conn->p, BUFFER_SIZE + 1); conn->blen = 0; conn->ms = ms; From b6cf8547fe42d36ca937d2df5d9bbdfb6b1a6ff9 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Thu, 2 Mar 2017 06:16:20 +0000 Subject: [PATCH 7653/7878] Win32: Improve apr_file_gets() performance on buffered files by not calling apr_file_read() on each byte. The benchmark shows that this makes the function roughly 4 times faster: 4.202 ms -> 1.042 ms (I measured multiple calls for the same test file) Also see https://svn.apache.org/r65294 * file_io/win32/readwrite.c (apr_file_read): Factor out the part of this function that handles reading from buffered files ... (read_buffered): ...into this new helper. (apr_file_gets): Use the buffer directly for buffered files, the same way as in the Unix implementation. * test/testfile.c (test_gets, test_gets_buffered): Extend these tests with read-after-EOF checks. (test_gets_empty, test_gets_multiline, test_gets_small_buf, test_gets_ungetc, test_gets_buffered_big): New tests. (testfile): Run the new tests. Patch by: Evgeny Kotkov git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1785072 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 210 ++++++++++++++++++++++++------------ test/testfile.c | 217 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 362 insertions(+), 65 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index ce61b487763..f473b18311a 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -140,6 +140,56 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le return rv; } +static apr_status_t read_buffered(apr_file_t *thefile, void *buf, apr_size_t *len) +{ + apr_status_t rv; + char *pos = (char *)buf; + apr_size_t blocksize; + apr_size_t size = *len; + + if (thefile->direction == 1) { + rv = apr_file_flush(thefile); + if (rv != APR_SUCCESS) { + return rv; + } + thefile->bufpos = 0; + thefile->direction = 0; + thefile->dataRead = 0; + } + + rv = 0; + while (rv == 0 && size > 0) { + if (thefile->bufpos >= thefile->dataRead) { + apr_size_t read; + rv = read_with_timeout(thefile, thefile->buffer, + thefile->bufsize, &read); + if (read == 0) { + if (rv == APR_EOF) + thefile->eof_hit = TRUE; + break; + } + else { + thefile->dataRead = read; + thefile->filePtr += thefile->dataRead; + thefile->bufpos = 0; + } + } + + blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size; + memcpy(pos, thefile->buffer + thefile->bufpos, blocksize); + thefile->bufpos += blocksize; + pos += blocksize; + size -= blocksize; + } + + *len = pos - (char *)buf; + if (*len) { + rv = APR_SUCCESS; + } + + return rv; +} + APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *len) { apr_status_t rv; @@ -177,57 +227,10 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } } if (thefile->buffered) { - char *pos = (char *)buf; - apr_size_t blocksize; - apr_size_t size = *len; - if (thefile->flags & APR_FOPEN_XTHREAD) { apr_thread_mutex_lock(thefile->mutex); } - - if (thefile->direction == 1) { - rv = apr_file_flush(thefile); - if (rv != APR_SUCCESS) { - if (thefile->flags & APR_FOPEN_XTHREAD) { - apr_thread_mutex_unlock(thefile->mutex); - } - return rv; - } - thefile->bufpos = 0; - thefile->direction = 0; - thefile->dataRead = 0; - } - - rv = 0; - while (rv == 0 && size > 0) { - if (thefile->bufpos >= thefile->dataRead) { - apr_size_t read; - rv = read_with_timeout(thefile, thefile->buffer, - thefile->bufsize, &read); - if (read == 0) { - if (rv == APR_EOF) - thefile->eof_hit = TRUE; - break; - } - else { - thefile->dataRead = read; - thefile->filePtr += thefile->dataRead; - thefile->bufpos = 0; - } - } - - blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size; - memcpy(pos, thefile->buffer + thefile->bufpos, blocksize); - thefile->bufpos += blocksize; - pos += blocksize; - size -= blocksize; - } - - *len = pos - (char *)buf; - if (*len) { - rv = APR_SUCCESS; - } - + rv = read_buffered(thefile, buf, len); if (thefile->flags & APR_FOPEN_XTHREAD) { apr_thread_mutex_unlock(thefile->mutex); } @@ -466,30 +469,107 @@ APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile) APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) { - apr_size_t readlen; apr_status_t rv = APR_SUCCESS; - int i; - - for (i = 0; i < len-1; i++) { - readlen = 1; - rv = apr_file_read(thefile, str+i, &readlen); + apr_size_t nbytes; + const char *str_start = str; + char *final = str + len - 1; - if (rv != APR_SUCCESS && rv != APR_EOF) + /* If the file is open for xthread support, allocate and + * initialize the overlapped and io completion event (hEvent). + * Threads should NOT share an apr_file_t or its hEvent. + */ + if ((thefile->flags & APR_FOPEN_XTHREAD) && !thefile->pOverlapped) { + thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->pool, + sizeof(OVERLAPPED)); + thefile->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + if (!thefile->pOverlapped->hEvent) { + rv = apr_get_os_error(); return rv; + } + } - if (readlen == 0) { - /* If we have bytes, defer APR_EOF to the next call */ - if (i > 0) - rv = APR_SUCCESS; - break; + /* Handle the ungetchar if there is one. */ + if (thefile->ungetchar != -1 && str < final) { + *str = thefile->ungetchar; + thefile->ungetchar = -1; + if (*str == '\n') { + *(++str) = '\0'; + return APR_SUCCESS; } - - if (str[i] == '\n') { - i++; /* don't clobber this char below */ - break; + ++str; + } + + /* If we have an underlying buffer, we can be *much* more efficient + * and skip over the read_with_timeout() calls. + */ + if (thefile->buffered) { + if (thefile->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_lock(thefile->mutex); + } + + if (thefile->direction == 1) { + rv = apr_file_flush(thefile); + if (rv) { + if (thefile->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_unlock(thefile->mutex); + } + return rv; + } + + thefile->direction = 0; + thefile->bufpos = 0; + thefile->dataRead = 0; + } + + while (str < final) { /* leave room for trailing '\0' */ + if (thefile->bufpos < thefile->dataRead) { + *str = thefile->buffer[thefile->bufpos++]; + } + else { + nbytes = 1; + rv = read_buffered(thefile, str, &nbytes); + if (rv != APR_SUCCESS) { + break; + } + } + if (*str == '\n') { + ++str; + break; + } + ++str; + } + if (thefile->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_unlock(thefile->mutex); + } + } + else { + while (str < final) { /* leave room for trailing '\0' */ + nbytes = 1; + rv = read_with_timeout(thefile, str, nbytes, &nbytes); + if (rv == APR_EOF) + thefile->eof_hit = TRUE; + + if (rv != APR_SUCCESS) { + break; + } + if (*str == '\n') { + ++str; + break; + } + ++str; } } - str[i] = 0; + + /* We must store a terminating '\0' if we've stored any chars. We can + * get away with storing it if we hit an error first. + */ + *str = '\0'; + if (str > str_start) { + /* We stored chars; don't report EOF or any other errors; + * the app will find out about that on the next call. + */ + return APR_SUCCESS; + } return rv; } diff --git a/test/testfile.c b/test/testfile.c index ddb1460091f..f4a74264304 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -430,6 +430,10 @@ static void test_gets(abts_case *tc, void *data) rv = apr_file_gets(str, 256, f); ABTS_INT_EQUAL(tc, APR_EOF, rv); ABTS_STR_EQUAL(tc, "", str); + /* Calling gets after EOF should return EOF. */ + rv = apr_file_gets(str, 256, f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", str); apr_file_close(f); } @@ -453,6 +457,214 @@ static void test_gets_buffered(abts_case *tc, void *data) rv = apr_file_gets(str, 256, f); ABTS_INT_EQUAL(tc, APR_EOF, rv); ABTS_STR_EQUAL(tc, "", str); + /* Calling gets after EOF should return EOF. */ + rv = apr_file_gets(str, 256, f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", str); + apr_file_close(f); +} + +static void test_gets_empty(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testgets_empty.txt"; + char buf[256]; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "re-open test file", rv); + + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + /* Calling gets after EOF should return EOF. */ + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + apr_file_close(f); +} + +static void test_gets_multiline(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testgets_multiline.txt"; + char buf[256]; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file", rv); + rv = apr_file_puts("a\nb\n", f); + APR_ASSERT_SUCCESS(tc, "write test data", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "re-open test file", rv); + + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read first line", rv); + ABTS_STR_EQUAL(tc, "a\n", buf); + + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read second line", rv); + ABTS_STR_EQUAL(tc, "b\n", buf); + + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + /* Calling gets after EOF should return EOF. */ + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + apr_file_close(f); +} + +static void test_gets_small_buf(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testgets_small_buf.txt"; + char buf[2]; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file", rv); + rv = apr_file_puts("ab\n", f); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "re-open test file", rv); + /* Buffer is too small to hold the full line, test that gets properly + * returns the line content character by character. + */ + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read first chunk", rv); + ABTS_STR_EQUAL(tc, "a", buf); + + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read second chunk", rv); + ABTS_STR_EQUAL(tc, "b", buf); + + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read third chunk", rv); + ABTS_STR_EQUAL(tc, "\n", buf); + + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + /* Calling gets after EOF should return EOF. */ + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + apr_file_close(f); +} + +static void test_gets_ungetc(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testgets_ungetc.txt"; + char buf[256]; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file", rv); + rv = apr_file_puts("a\n", f); + APR_ASSERT_SUCCESS(tc, "write test data", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "re-open test file", rv); + + rv = apr_file_ungetc('b', f); + APR_ASSERT_SUCCESS(tc, "call ungetc", rv); + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read line", rv); + ABTS_STR_EQUAL(tc, "ba\n", buf); + + rv = apr_file_ungetc('\n', f); + APR_ASSERT_SUCCESS(tc, "call ungetc with EOL", rv); + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read line", rv); + ABTS_STR_EQUAL(tc, "\n", buf); + + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + /* Calling gets after EOF should return EOF. */ + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + apr_file_close(f); +} + +static void test_gets_buffered_big(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testgets_buffered_big.txt"; + char hugestr[APR_BUFFERSIZE + 2]; + char buf[APR_BUFFERSIZE + 2]; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file", rv); + /* Test an edge case with a buffered file and the line that exceeds + * the default buffer size by 1 (the line itself fits into the buffer, + * but the line + EOL does not). + */ + memset(hugestr, 'a', sizeof(hugestr)); + hugestr[sizeof(hugestr) - 2] = '\n'; + hugestr[sizeof(hugestr) - 1] = '\0'; + rv = apr_file_puts(hugestr, f); + APR_ASSERT_SUCCESS(tc, "write first line", rv); + rv = apr_file_puts("b\n", f); + APR_ASSERT_SUCCESS(tc, "write second line", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "re-open test file", rv); + + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read first line", rv); + ABTS_STR_EQUAL(tc, hugestr, buf); + + memset(buf, 0, sizeof(buf)); + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read second line", rv); + ABTS_STR_EQUAL(tc, "b\n", buf); + + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); + /* Calling gets after EOF should return EOF. */ + rv = apr_file_gets(buf, sizeof(buf), f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_STR_EQUAL(tc, "", buf); apr_file_close(f); } @@ -1125,6 +1337,11 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_ungetc, NULL); abts_run_test(suite, test_gets, NULL); abts_run_test(suite, test_gets_buffered, NULL); + abts_run_test(suite, test_gets_empty, NULL); + abts_run_test(suite, test_gets_multiline, NULL); + abts_run_test(suite, test_gets_small_buf, NULL); + abts_run_test(suite, test_gets_ungetc, NULL); + abts_run_test(suite, test_gets_buffered_big, NULL); abts_run_test(suite, test_puts, NULL); abts_run_test(suite, test_writev, NULL); abts_run_test(suite, test_writev_full, NULL); From 240bee2fa22f0f65ae6baf5db0f3e3cd2a0f3a46 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 23 Mar 2017 21:34:25 +0000 Subject: [PATCH 7654/7878] apr_allocator: Provide apr_allocator_align() to get the true size that would be allocated for the given size (including the header and alignment). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1788334 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_allocator.h | 8 ++++++++ memory/unix/apr_pools.c | 30 ++++++++++++++++++++++++++---- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 2f9bfb9b5ab..4adac968c8a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_allocator: Provide apr_allocator_align() to get the true size that + would be allocated for the given size (including the header and + alignment). [Yann Ylavic] + *) apr_crypto: avoid excessive iteration in bcrypt hash. [Hanno Böck ] diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 70d31efa0f5..88d9e4d15dc 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -103,6 +103,14 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, apr_memnode_t *memnode) __attribute__((nonnull(1,2))); + +/** + * Return the aligned (round up) size that an allocator would use for + * the given size. + * @param size The size to align + * @return The aligned size (or zero on apr_size_t overflow) + */ +APR_DECLARE(apr_size_t) apr_allocator_align(apr_size_t size); #include "apr_pools.h" diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 138180b7723..784280f2c92 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -235,6 +235,30 @@ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, #endif } +static APR_INLINE +apr_size_t allocator_align(apr_size_t in_size) +{ + apr_size_t size = in_size; + + /* Round up the block size to the next boundary, but always + * allocate at least a certain size (MIN_ALLOC). + */ + size = APR_ALIGN(size + APR_MEMNODE_T_SIZE, BOUNDARY_SIZE); + if (size < in_size) { + return 0; + } + if (size < MIN_ALLOC) { + size = MIN_ALLOC; + } + + return size; +} + +APR_DECLARE(apr_size_t) apr_allocator_align(apr_size_t size) +{ + return allocator_align(size); +} + static APR_INLINE apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) { @@ -245,12 +269,10 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) /* Round up the block size to the next boundary, but always * allocate at least a certain size (MIN_ALLOC). */ - size = APR_ALIGN(in_size + APR_MEMNODE_T_SIZE, BOUNDARY_SIZE); - if (size < in_size) { + size = allocator_align(in_size); + if (!size) { return NULL; } - if (size < MIN_ALLOC) - size = MIN_ALLOC; /* Find the index for this node size by * dividing its size by the boundary size From fdbe6829b06369bce6bb2c805e7ff9b9c8aa90a9 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 23 Mar 2017 21:51:00 +0000 Subject: [PATCH 7655/7878] apr_buckets: Add apr_bucket_file_set_buf_size() which allows to configure the size of the buffer used to read files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1788335 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ buckets/apr_buckets_alloc.c | 18 ++++++++++++++++++ buckets/apr_buckets_file.c | 20 +++++++++++++++++--- include/apr_buckets.h | 24 ++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 4adac968c8a..680b0ee29a5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_buckets: Add apr_bucket_file_set_buf_size() which allows to configure + the size of the buffer used to read files. [Yann Ylavic] + *) apr_allocator: Provide apr_allocator_align() to get the true size that would be allocated for the given size (including the header and alignment). [Yann Ylavic] diff --git a/buckets/apr_buckets_alloc.c b/buckets/apr_buckets_alloc.c index 3bfd5b07cc6..833621c4a82 100644 --- a/buckets/apr_buckets_alloc.c +++ b/buckets/apr_buckets_alloc.c @@ -123,6 +123,24 @@ APR_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list) #endif } +APR_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_aligned_floor(apr_size_t size) +{ + if (size <= SMALL_NODE_SIZE) { + size = SMALL_NODE_SIZE; + } + else { + if (size < APR_MEMNODE_T_SIZE) { + size = apr_allocator_align(0); + } + else { + size = apr_allocator_align(size - APR_MEMNODE_T_SIZE); + } + size -= APR_MEMNODE_T_SIZE; + } + size -= SIZEOF_NODE_HEADER_T; + return size; +} + APR_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t in_size, apr_bucket_alloc_t *list) { diff --git a/buckets/apr_buckets_file.c b/buckets/apr_buckets_file.c index c26089496ab..7cea3a40d67 100644 --- a/buckets/apr_buckets_file.c +++ b/buckets/apr_buckets_file.c @@ -108,10 +108,8 @@ static apr_status_t file_bucket_read(apr_bucket *e, const char **str, } #endif - *len = (filelength > APR_BUCKET_BUFF_SIZE) - ? APR_BUCKET_BUFF_SIZE - : filelength; *str = NULL; /* in case we die prematurely */ + *len = (filelength > a->read_size) ? a->read_size : filelength; buf = apr_bucket_alloc(*len, e->list); /* Handle offset ... */ @@ -165,6 +163,7 @@ APR_DECLARE(apr_bucket *) apr_bucket_file_make(apr_bucket *b, apr_file_t *fd, #if APR_HAS_MMAP f->can_mmap = 1; #endif + f->read_size = APR_BUCKET_BUFF_SIZE; b = apr_bucket_shared_make(b, f, offset, len); b->type = &apr_bucket_type_file; @@ -197,6 +196,21 @@ APR_DECLARE(apr_status_t) apr_bucket_file_enable_mmap(apr_bucket *e, #endif /* APR_HAS_MMAP */ } +APR_DECLARE(apr_status_t) apr_bucket_file_set_buf_size(apr_bucket *e, + apr_size_t size) +{ + apr_bucket_file *a = e->data; + + if (size <= APR_BUCKET_BUFF_SIZE) { + a->read_size = APR_BUCKET_BUFF_SIZE; + } + else { + apr_size_t floor = apr_bucket_alloc_aligned_floor(size); + a->read_size = (size < floor) ? size : floor; + } + + return APR_SUCCESS; +} static apr_status_t file_bucket_setaside(apr_bucket *data, apr_pool_t *reqpool) { diff --git a/include/apr_buckets.h b/include/apr_buckets.h index 2db56c6c288..ba1762efc38 100644 --- a/include/apr_buckets.h +++ b/include/apr_buckets.h @@ -625,6 +625,8 @@ struct apr_bucket_file { * a caller tries to read from it */ int can_mmap; #endif /* APR_HAS_MMAP */ + /** File read block size */ + apr_size_t read_size; }; /** @see apr_bucket_structs */ @@ -991,6 +993,15 @@ APR_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create_ex( APR_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list) __attribute__((nonnull(1))); +/** + * Get the aligned size corresponding to the requested size, but minus the + * allocator(s) overhead such that the allocation would remain in the + * same boundary. + * @param size The requested size. + * @return The corresponding aligned/floored size. + */ +APR_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_aligned_floor(apr_size_t size); + /** * Allocate memory for use by the buckets. * @param size The amount to allocate. @@ -1616,6 +1627,19 @@ APR_DECLARE(apr_status_t) apr_bucket_file_enable_mmap(apr_bucket *b, int enabled) __attribute__((nonnull(1))); +/** + * Set the size of the read buffer allocated by a FILE bucket (default + * is @a APR_BUCKET_BUFF_SIZE) + * memory-mapping is disabled only) + * @param b The bucket + * @param size Size of the allocated buffers + * @return APR_SUCCESS normally, or an error code if the operation fails + * @remark Relevant/used only when memory-mapping is disabled (@see + * apr_bucket_file_enable_mmap) + */ +APR_DECLARE(apr_status_t) apr_bucket_file_set_buf_size(apr_bucket *e, + apr_size_t size); + /** @} */ #ifdef __cplusplus } From c0b5b630160f1aa27a81ff22239a7876c541f286 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 23 Mar 2017 22:26:26 +0000 Subject: [PATCH 7656/7878] Follow up to r1788334: better apr_allocator_align() description. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1788337 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 88d9e4d15dc..fb4a6375b49 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -105,8 +105,8 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, __attribute__((nonnull(1,2))); /** - * Return the aligned (round up) size that an allocator would use for - * the given size. + * Get the true size that would be allocated for the given size (including + * the header and alignment). * @param size The size to align * @return The aligned size (or zero on apr_size_t overflow) */ From dc9706568f06ed3023061a99454696af35d30175 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 23 Mar 2017 23:50:39 +0000 Subject: [PATCH 7657/7878] apr_allocator, apr_pools: Add apr_allocator_page_size(), apr_allocator_min_order_set() and apr_pool_alloc_order_set() to respectively get the (system's) page size in use, set the minimum allocation size for an allocator and the pool default allocation size (expressed in 2^order pages). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1788346 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 +++ include/apr_allocator.h | 15 +++++++ include/apr_pools.h | 8 ++++ memory/unix/apr_pools.c | 94 ++++++++++++++++++++++++++++++----------- 4 files changed, 99 insertions(+), 24 deletions(-) diff --git a/CHANGES b/CHANGES index 680b0ee29a5..e44b81673c3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,12 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_allocator, apr_pools: Add apr_allocator_page_size(), + apr_allocator_min_order_set() and apr_pool_alloc_order_set() to + respectively get the (system's) page size in use, set the minimum + allocation size for an allocator and the pool default allocation + size (expressed in 2^order pages). [Yann Ylavic] + *) apr_buckets: Add apr_bucket_file_set_buf_size() which allows to configure the size of the buffer used to read files. [Yann Ylavic] diff --git a/include/apr_allocator.h b/include/apr_allocator.h index fb4a6375b49..32cffd7f400 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -104,6 +104,21 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, apr_memnode_t *memnode) __attribute__((nonnull(1,2))); +/** + * Get the page/boundary size. + * @return The page size + */ +APR_DECLARE(apr_size_t) apr_allocator_page_size(void); + +/** + * Setup the minimum allocation order (in 2^order pages). + * @param order The order to set + * @return APR_SUCCESS, or APR_EINVAL if @a order above 9. + * @note Default is order-1 (e.g. 8K on systems with 4K pages). + * @remark Should be done at initialization time, never concurrently. + */ +APR_DECLARE(apr_status_t) apr_allocator_min_order_set(unsigned int order); + /** * Get the true size that would be allocated for the given size (including * the header and alignment). diff --git a/include/apr_pools.h b/include/apr_pools.h index 0b17561bbd7..958d254f35f 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -171,6 +171,14 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void); */ APR_DECLARE(void) apr_pool_terminate(void); +/** + * Setup the allocation order (in 2^order pages) when creating a pool. + * @param order The order to set + * @return APR_SUCCESS, or APR_EINVAL if @a order above 9. + * @note Default is order-1 (e.g. 8K on systems with 4K pages). + * @remark Should be done at initialization time, never concurrently. + */ +APR_DECLARE(apr_status_t) apr_pool_alloc_order_set(unsigned int order); /* * Pool creation/destruction diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 784280f2c92..79c7eae0ea5 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -63,19 +63,20 @@ int apr_running_on_valgrind = 0; */ /* - * XXX: This is not optimal when using --enable-allocator-uses-mmap on - * XXX: machines with large pagesize, but currently the sink is assumed - * XXX: to be index 0, so MIN_ALLOC must be at least two pages. + * Recycle up to MAX_INDEX in slots, larger indexes go to + * the sink slot at MAX_INDEX. */ -#define MIN_ALLOC (2 * BOUNDARY_SIZE) #define MAX_INDEX 20 -#if APR_ALLOCATOR_USES_MMAP && defined(_SC_PAGESIZE) +/* + * Determines the boundary/page size. + */ +#if defined(_SC_PAGESIZE) || defined(WIN32) static unsigned int boundary_index; static unsigned int boundary_size; #define BOUNDARY_INDEX boundary_index #define BOUNDARY_SIZE boundary_size -#else +#else /* Assume 4K pages */ #define BOUNDARY_INDEX 12 #define BOUNDARY_SIZE (1 << BOUNDARY_INDEX) #endif @@ -90,6 +91,16 @@ static unsigned int boundary_size; #define GUARDPAGE_SIZE 0 #endif /* APR_ALLOCATOR_GUARD_PAGES */ +/* + * Allocate at least MIN_ALLOC bytes (2^order boundaries/pages), + * and POOL_SIZE bytes for each pool. + */ +#define MAX_ALLOC_ORDER 9 +static unsigned int min_alloc_order = 1; +#define MIN_ALLOC (BOUNDARY_SIZE << min_alloc_order) +static unsigned int pool_alloc_order = 1; +#define POOL_SIZE (BOUNDARY_SIZE << pool_alloc_order) + /* * Timing constants for killing subprocesses * There is a total 3-second delay between sending a SIGINT @@ -126,16 +137,17 @@ struct apr_allocator_t { #endif /* APR_HAS_THREADS */ apr_pool_t *owner; /** - * Lists of free nodes. Slot 0 is used for oversized nodes, - * and the slots 1..MAX_INDEX-1 contain nodes of sizes + * Lists of free nodes. Slot MAX_INDEX is used for oversized nodes, + * and the slots 0..MAX_INDEX-1 contain nodes of sizes * (i+1) * BOUNDARY_SIZE. Example for BOUNDARY_INDEX == 12: - * slot 0: nodes larger than 81920 + * slot 0: size 4096 * slot 1: size 8192 * slot 2: size 12288 * ... * slot 19: size 81920 + * slot 20: nodes larger than 81920 */ - apr_memnode_t *free[MAX_INDEX]; + apr_memnode_t *free[MAX_INDEX + 1]; }; #define SIZEOF_ALLOCATOR_T APR_ALIGN_DEFAULT(sizeof(apr_allocator_t)) @@ -167,7 +179,7 @@ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) apr_uint32_t index; apr_memnode_t *node, **ref; - for (index = 0; index < MAX_INDEX; index++) { + for (index = 0; index <= MAX_INDEX; index++) { ref = &allocator->free[index]; while ((node = *ref) != NULL) { *ref = node->next; @@ -350,10 +362,10 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) #endif /* APR_HAS_THREADS */ } - /* If we found nothing, seek the sink (at index 0), if + /* If we found nothing, seek the sink (at index MAX_INDEX), if * it is not empty. */ - else if (allocator->free[0]) { + else if (allocator->free[MAX_INDEX]) { #if APR_HAS_THREADS if (allocator->mutex) apr_thread_mutex_lock(allocator->mutex); @@ -362,7 +374,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) /* Walk the free list to see if there are * any nodes on it of the requested size */ - ref = &allocator->free[0]; + ref = &allocator->free[MAX_INDEX]; while ((node = *ref) != NULL && index > node->index) ref = &node->next; @@ -467,10 +479,10 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) } else { /* This node is too large to keep in a specific size bucket, - * just add it to the sink (at index 0). + * just add it to the sink (at index MAX_INDEX). */ - node->next = allocator->free[0]; - allocator->free[0] = node; + node->next = allocator->free[MAX_INDEX]; + allocator->free[MAX_INDEX] = node; if (current_free_index >= index + 1) current_free_index -= index + 1; else @@ -510,6 +522,28 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, allocator_free(allocator, node); } +APR_DECLARE(apr_size_t) apr_allocator_page_size(void) +{ + return boundary_size; +} + +APR_DECLARE(apr_status_t) apr_allocator_min_order_set(unsigned int order) +{ + if (order > MAX_ALLOC_ORDER) { + return APR_EINVAL; + } + min_alloc_order = order; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_pool_alloc_order_set(unsigned int order) +{ + if (order > MAX_ALLOC_ORDER) { + return APR_EINVAL; + } + pool_alloc_order = order; + return APR_SUCCESS; +} /* @@ -660,13 +694,19 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) apr_running_on_valgrind = RUNNING_ON_VALGRIND; #endif -#if APR_ALLOCATOR_USES_MMAP && defined(_SC_PAGESIZE) +#if defined(_SC_PAGESIZE) boundary_size = sysconf(_SC_PAGESIZE); +#elif defined(WIN32) + { + SYSTEM_INFO si; + GetSystemInfo(&si); + boundary_size = si.dwPageSize; + } +#endif boundary_index = 12; while ( (1 << boundary_index) < boundary_size) boundary_index++; boundary_size = (1 << boundary_index); -#endif if ((rv = apr_allocator_create(&global_allocator)) != APR_SUCCESS) { apr_pools_initialized = 0; @@ -1072,7 +1112,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, allocator = parent->allocator; if ((node = allocator_alloc(allocator, - MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { + POOL_SIZE - APR_MEMNODE_T_SIZE)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -1166,7 +1206,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, return APR_ENOMEM; } if ((node = allocator_alloc(pool_allocator, - MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { + POOL_SIZE - APR_MEMNODE_T_SIZE)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -1174,7 +1214,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, } } else if ((node = allocator_alloc(pool_allocator, - MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { + POOL_SIZE - APR_MEMNODE_T_SIZE)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -1656,13 +1696,19 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) if (apr_pools_initialized++) return APR_SUCCESS; -#if APR_ALLOCATOR_USES_MMAP && defined(_SC_PAGESIZE) +#if defined(_SC_PAGESIZE) boundary_size = sysconf(_SC_PAGESIZE); +#elif defined(WIN32) + { + SYSTEM_INFO si; + GetSystemInfo(&si); + boundary_size = si.dwPageSize; + } +#endif boundary_index = 12; while ( (1 << boundary_index) < boundary_size) boundary_index++; boundary_size = (1 << boundary_index); -#endif /* Since the debug code works a bit differently then the * regular pools code, we ask for a lock here. The regular From 57765c4cd9de58c26cbc7b58a88b5ddd80f6e0ec Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 24 Mar 2017 08:19:41 +0000 Subject: [PATCH 7658/7878] Follow up to r1788346: we don't really need a separate "order" setting for allocators and pools, so axe apr_pool_alloc_order_set(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1788376 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 9 ++++----- include/apr_pools.h | 9 --------- memory/unix/apr_pools.c | 37 +++++++++++-------------------------- 3 files changed, 15 insertions(+), 40 deletions(-) diff --git a/CHANGES b/CHANGES index e44b81673c3..9a062032b94 100644 --- a/CHANGES +++ b/CHANGES @@ -1,11 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) apr_allocator, apr_pools: Add apr_allocator_page_size(), - apr_allocator_min_order_set() and apr_pool_alloc_order_set() to - respectively get the (system's) page size in use, set the minimum - allocation size for an allocator and the pool default allocation - size (expressed in 2^order pages). [Yann Ylavic] + *) apr_allocator, apr_pools: Add apr_allocator_page_size() and + apr_allocator_min_order_set() to respectively get the (system's) page size + in use and set the minimum allocation size for an allocator (expressed in + 2^order pages). [Yann Ylavic] *) apr_buckets: Add apr_bucket_file_set_buf_size() which allows to configure the size of the buffer used to read files. [Yann Ylavic] diff --git a/include/apr_pools.h b/include/apr_pools.h index 958d254f35f..3020c996abd 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -171,15 +171,6 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void); */ APR_DECLARE(void) apr_pool_terminate(void); -/** - * Setup the allocation order (in 2^order pages) when creating a pool. - * @param order The order to set - * @return APR_SUCCESS, or APR_EINVAL if @a order above 9. - * @note Default is order-1 (e.g. 8K on systems with 4K pages). - * @remark Should be done at initialization time, never concurrently. - */ -APR_DECLARE(apr_status_t) apr_pool_alloc_order_set(unsigned int order); - /* * Pool creation/destruction */ diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 79c7eae0ea5..e3d82d0f73b 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -63,10 +63,14 @@ int apr_running_on_valgrind = 0; */ /* - * Recycle up to MAX_INDEX in slots, larger indexes go to - * the sink slot at MAX_INDEX. + * Recycle up to MAX_INDEX in slots, larger indexes go to the + * sink slot at MAX_INDEX, and allocate at least MIN_ALLOC + * bytes (2^order boundaries/pages). */ #define MAX_INDEX 20 +#define MAX_ORDER 9 +static unsigned int min_order = 1; +#define MIN_ALLOC (BOUNDARY_SIZE << min_order) /* * Determines the boundary/page size. @@ -91,16 +95,6 @@ static unsigned int boundary_size; #define GUARDPAGE_SIZE 0 #endif /* APR_ALLOCATOR_GUARD_PAGES */ -/* - * Allocate at least MIN_ALLOC bytes (2^order boundaries/pages), - * and POOL_SIZE bytes for each pool. - */ -#define MAX_ALLOC_ORDER 9 -static unsigned int min_alloc_order = 1; -#define MIN_ALLOC (BOUNDARY_SIZE << min_alloc_order) -static unsigned int pool_alloc_order = 1; -#define POOL_SIZE (BOUNDARY_SIZE << pool_alloc_order) - /* * Timing constants for killing subprocesses * There is a total 3-second delay between sending a SIGINT @@ -529,19 +523,10 @@ APR_DECLARE(apr_size_t) apr_allocator_page_size(void) APR_DECLARE(apr_status_t) apr_allocator_min_order_set(unsigned int order) { - if (order > MAX_ALLOC_ORDER) { - return APR_EINVAL; - } - min_alloc_order = order; - return APR_SUCCESS; -} - -APR_DECLARE(apr_status_t) apr_pool_alloc_order_set(unsigned int order) -{ - if (order > MAX_ALLOC_ORDER) { + if (order > MAX_ORDER) { return APR_EINVAL; } - pool_alloc_order = order; + min_order = order; return APR_SUCCESS; } @@ -1112,7 +1097,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, allocator = parent->allocator; if ((node = allocator_alloc(allocator, - POOL_SIZE - APR_MEMNODE_T_SIZE)) == NULL) { + MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -1206,7 +1191,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, return APR_ENOMEM; } if ((node = allocator_alloc(pool_allocator, - POOL_SIZE - APR_MEMNODE_T_SIZE)) == NULL) { + MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); @@ -1214,7 +1199,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, } } else if ((node = allocator_alloc(pool_allocator, - POOL_SIZE - APR_MEMNODE_T_SIZE)) == NULL) { + MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) { if (abort_fn) abort_fn(APR_ENOMEM); From 81aa418673c6cbfb896b58ef86e6f0665ab16daa Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 24 Mar 2017 15:13:57 +0000 Subject: [PATCH 7659/7878] Backported to 1.6.x. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1788468 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 ------- 1 file changed, 7 deletions(-) diff --git a/CHANGES b/CHANGES index 9a062032b94..1c3dcad8efc 100644 --- a/CHANGES +++ b/CHANGES @@ -6,13 +6,6 @@ Changes for APR 2.0.0 in use and set the minimum allocation size for an allocator (expressed in 2^order pages). [Yann Ylavic] - *) apr_buckets: Add apr_bucket_file_set_buf_size() which allows to configure - the size of the buffer used to read files. [Yann Ylavic] - - *) apr_allocator: Provide apr_allocator_align() to get the true size that - would be allocated for the given size (including the header and - alignment). [Yann Ylavic] - *) apr_crypto: avoid excessive iteration in bcrypt hash. [Hanno Böck ] From ffe70908c8b8ac372dd7189bb19a334606a64bdf Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Mon, 27 Mar 2017 13:33:54 +0000 Subject: [PATCH 7660/7878] Fix two issues with apr_file_trunc() for buffered files: - The Win32 implementation incorrectly flushes the buffered writes _after_ truncating a file. Such files will have unexpected data written after the position at which they should've been truncated. PR 51017. (Under Unix, this issue has been fixed in r1044440) - Both Win32 and Unix implementations incorrectly keep the data read into a buffer after the file is truncated. Thus, reading from a file after apr_file_trunc() can return invalid data from the previous file offset. * file_io/win32/seek.c (apr_file_trunc): Flush the write buffer or discard the read buffer before truncating. Propely update the internal file offset (filePtr) and the eof_hit marker. * file_io/unix/seek.c (apr_file_trunc): Discard the read buffer before truncating. * test/testfile.c (test_file_trunc): Extend the checks. Factor out part of this test... (test_file_trunc_buffered_write): ...into this new test. (test_file_trunc_buffered_write2, test_file_trunc_buffered_read): New tests. (testfile): Run the new tests. Patch by: Evgeny Kotkov git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1788929 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 +++ file_io/unix/seek.c | 7 +++ file_io/win32/seek.c | 34 ++++++++-- test/testfile.c | 146 +++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 187 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 1c3dcad8efc..c92afa72af2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,14 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_file_trunc: Truncating a buffered file could add unexpected + data after the truncate position. PR 51017. + [Evgeny Kotkov ] + + *) apr_file_trunc: Fix an issue where reading from a buffered file + after truncate could return stale data from the buffer. + [Evgeny Kotkov ] + *) apr_allocator, apr_pools: Add apr_allocator_page_size() and apr_allocator_min_order_set() to respectively get the (system's) page size in use and set the minimum allocation size for an allocator (expressed in diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 3f5aa00e956..2e973377bf8 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -117,6 +117,13 @@ apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset) /* Reset buffer positions for write mode */ fp->bufpos = fp->direction = fp->dataRead = 0; } + else if (fp->direction == 0) { + /* Discard the read buffer, as we are about to reposition + * ourselves to the end of file. + */ + fp->bufpos = 0; + fp->dataRead = 0; + } file_unlock(fp); if (rc) { return rc; diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index b412fd4cbf5..afe6edb0050 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -161,17 +161,43 @@ APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *thefile, apr_off_t offset) LONG offhi = (LONG)(offset >> 32); DWORD rc; + if (thefile->buffered) { + if (thefile->direction == 1) { + /* Figure out what needs to be flushed. Don't flush the part + * of the write buffer that will get truncated anyway. + */ + if (offset < thefile->filePtr) { + thefile->bufpos = 0; + } + else if (offset < thefile->filePtr + (apr_off_t)thefile->bufpos) { + thefile->bufpos = offset - thefile->filePtr; + } + + if (thefile->bufpos != 0) { + rv = apr_file_flush(thefile); + if (rv != APR_SUCCESS) + return rv; + } + } + else if (thefile->direction == 0) { + /* Discard the read buffer, as we are about to reposition + * ourselves to the end of file. + */ + thefile->bufpos = 0; + thefile->dataRead = 0; + } + } + rc = SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); if (rc == 0xFFFFFFFF) if ((rv = apr_get_os_error()) != APR_SUCCESS) return rv; + thefile->filePtr = offset; + /* Don't report EOF until the next read. */ + thefile->eof_hit = 0; if (!SetEndOfFile(thefile->filehand)) return apr_get_os_error(); - if (thefile->buffered) { - return setptr(thefile, offset); - } - return APR_SUCCESS; } diff --git a/test/testfile.c b/test/testfile.c index f4a74264304..477f5791f9f 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -1034,10 +1034,10 @@ static void test_file_trunc(abts_case *tc, void *data) const char *s; apr_size_t nbytes; apr_finfo_t finfo; + char c; apr_file_remove(fname, p); - /* Test unbuffered */ rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_READ | APR_FOPEN_WRITE, @@ -1051,37 +1051,172 @@ static void test_file_trunc(abts_case *tc, void *data) ABTS_SIZE_EQUAL(tc, strlen(s), nbytes); rv = apr_file_trunc(f, 4); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + /* Test apr_file_info_get(). */ + rv = apr_file_info_get(&finfo, APR_FINFO_SIZE, f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 4, (int)finfo.size); + /* EOF is not reported until the next read. */ + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_file_getc(&c, f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + rv = apr_file_close(f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, fname, APR_FINFO_SIZE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_ASSERT(tc, "File size mismatch, expected 4", finfo.size == 4); + ABTS_INT_EQUAL(tc, 4, (int)finfo.size); rv = apr_file_remove(fname, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - /* Test buffered */ +} + +static void test_file_trunc_buffered_write(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtruncate_buffered_write.dat"; + const char *s; + apr_size_t nbytes; + apr_finfo_t finfo; + char c; + + apr_file_remove(fname, p); + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_BUFFERED, APR_FPROT_UREAD | APR_FPROT_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + s = "some data"; nbytes = strlen(s); rv = apr_file_write(f, s, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_SIZE_EQUAL(tc, strlen(s), nbytes); rv = apr_file_trunc(f, 4); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + /* Test apr_file_info_get(). */ + rv = apr_file_info_get(&finfo, APR_FINFO_SIZE, f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 4, (int)finfo.size); + /* EOF is not reported until the next read. */ + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_file_getc(&c, f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + rv = apr_file_close(f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); rv = apr_stat(&finfo, fname, APR_FINFO_SIZE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_ASSERT(tc, "File size mismatch, expected 4", finfo.size == 4); + ABTS_INT_EQUAL(tc, 4, (int)finfo.size); rv = apr_file_remove(fname, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } +static void test_file_trunc_buffered_write2(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtruncate_buffered_write2.dat"; + apr_finfo_t finfo; + char c; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, + APR_FOPEN_CREATE | APR_FOPEN_READ | + APR_FOPEN_WRITE | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file", rv); + + rv = apr_file_puts("abc", f); + APR_ASSERT_SUCCESS(tc, "write first string", rv); + rv = apr_file_flush(f); + APR_ASSERT_SUCCESS(tc, "flush", rv); + rv = apr_file_puts("def", f); + APR_ASSERT_SUCCESS(tc, "write second string", rv); + /* Truncate behind the write buffer. */ + rv = apr_file_trunc(f, 2); + APR_ASSERT_SUCCESS(tc, "truncate the file", rv); + /* Test apr_file_info_get(). */ + rv = apr_file_info_get(&finfo, APR_FINFO_SIZE, f); + APR_ASSERT_SUCCESS(tc, "get file info", rv); + ABTS_INT_EQUAL(tc, 2, (int)finfo.size); + /* EOF is not reported until the next read. */ + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_file_getc(&c, f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + + apr_file_close(f); + + rv = apr_stat(&finfo, fname, APR_FINFO_SIZE, p); + APR_ASSERT_SUCCESS(tc, "stat file", rv); + ABTS_INT_EQUAL(tc, 2, (int)finfo.size); + + apr_file_remove(fname, p); +} + +static void test_file_trunc_buffered_read(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtruncate_buffered_read.dat"; + apr_finfo_t finfo; + char c; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, + APR_FOPEN_CREATE | APR_FOPEN_READ | + APR_FOPEN_WRITE, APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file", rv); + + rv = apr_file_puts("abc", f); + APR_ASSERT_SUCCESS(tc, "write test data", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, + APR_FOPEN_READ | APR_FOPEN_WRITE | + APR_FOPEN_BUFFERED, APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "re-open test file", rv); + + /* Read to fill in the buffer. */ + rv = apr_file_getc(&c, f); + APR_ASSERT_SUCCESS(tc, "read char", rv); + /* Truncate the file. */ + rv = apr_file_trunc(f, 1); + APR_ASSERT_SUCCESS(tc, "truncate the file", rv); + /* Test apr_file_info_get(). */ + rv = apr_file_info_get(&finfo, APR_FINFO_SIZE, f); + APR_ASSERT_SUCCESS(tc, "get file info", rv); + ABTS_INT_EQUAL(tc, 1, (int)finfo.size); + /* EOF is not reported until the next read. */ + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_file_getc(&c, f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + + apr_file_close(f); + + rv = apr_stat(&finfo, fname, APR_FINFO_SIZE, p); + APR_ASSERT_SUCCESS(tc, "stat file", rv); + ABTS_INT_EQUAL(tc, 1, (int)finfo.size); + + apr_file_remove(fname, p); +} + static void test_bigfprintf(abts_case *tc, void *data) { apr_file_t *f; @@ -1351,6 +1486,9 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_mod_neg, NULL); abts_run_test(suite, test_truncate, NULL); abts_run_test(suite, test_file_trunc, NULL); + abts_run_test(suite, test_file_trunc_buffered_write, NULL); + abts_run_test(suite, test_file_trunc_buffered_write2, NULL); + abts_run_test(suite, test_file_trunc_buffered_read, NULL); abts_run_test(suite, test_bigfprintf, NULL); abts_run_test(suite, test_fail_write_flush, NULL); abts_run_test(suite, test_fail_read_flush, NULL); From 1e229b40637409335cab8273e0fa4588ddbb550c Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Mon, 27 Mar 2017 13:37:34 +0000 Subject: [PATCH 7661/7878] Follow-up to r1785072: Add CHANGES entry. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1788930 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index c92afa72af2..c38fd0e76b2 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,9 @@ Changes for APR 2.0.0 in use and set the minimum allocation size for an allocator (expressed in 2^order pages). [Yann Ylavic] + *) apr_file_gets: Optimize for buffered files on Windows. + [Evgeny Kotkov ] + *) apr_crypto: avoid excessive iteration in bcrypt hash. [Hanno Böck ] From 1bec3f7c357f7c8282d2fedc0a6be923e1a7db49 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 28 Mar 2017 21:56:28 +0000 Subject: [PATCH 7662/7878] apr_socket_sendfile: don't reset APR_TCP_NOPUSH if we didn't set it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1789249 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 233bbb301b9..6da7457aa49 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -264,6 +264,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, apr_size_t *len, apr_int32_t flags) { int rv, nbytes = 0, total_hdrbytes, i; + int nopush_set = 0; apr_status_t arv; #if APR_HAS_LARGE_FILES && defined(HAVE_SENDFILE64) @@ -296,15 +297,18 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, if (!hdtr) { hdtr = &no_hdtr; } - - if (hdtr->numheaders > 0) { - apr_size_t hdrbytes; - + else if ((hdtr->numheaders > 0 || hdtr->numtrailers > 0) + && !apr_is_option_set(sock, APR_TCP_NOPUSH)) { /* cork before writing headers */ rv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 1); if (rv != APR_SUCCESS) { return rv; } + nopush_set = 1; + } + + if (hdtr->numheaders > 0) { + apr_size_t hdrbytes; /* Now write the headers */ arv = apr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, @@ -325,7 +329,10 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } if (hdrbytes < total_hdrbytes) { *len = hdrbytes; - return apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); + if (nopush_set) { + return apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); + } + return APR_SUCCESS; } } @@ -362,7 +369,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, if (rv == -1) { *len = nbytes; rv = errno; - apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); + if (nopush_set) { + apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); + } return rv; } @@ -370,7 +379,12 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, if (rv < *len) { *len = nbytes; - arv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); + if (nopush_set) { + arv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); + } + else { + arv = APR_SUCCESS; + } if (rv > 0) { /* If this was a partial write, return now with the @@ -398,16 +412,16 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, arv = apr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trbytes); nbytes += trbytes; + if (nopush_set) { + apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); + } if (arv != APR_SUCCESS) { *len = nbytes; rv = errno; - apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); return rv; } } - apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); - (*len) = nbytes; return rv < 0 ? errno : APR_SUCCESS; } From 1a358b386cd160b63ca683a93dcb0bc54130663b Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 28 Mar 2017 23:54:49 +0000 Subject: [PATCH 7663/7878] apr_socket_sendfile: Be accurate (and consistent accross unixes) with the returned number of bytes written (note that it is possible for both bytes to be sent and an error to be returned, due to headers and trailers handling). Fix some returned errno vs apr_status_t in some error paths. Fix BSDs nonblocking/busy retry on EAGAIN when nothing is written. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1789257 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 1 + network_io/unix/sendrecv.c | 144 ++++++++++++++++++------------------- 2 files changed, 69 insertions(+), 76 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 8c7f52b13d4..5395f99b011 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -610,6 +610,7 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, * The number of bytes actually sent is stored in the len parameter. * The offset parameter is passed by reference for no reason; its * value will never be modified by the apr_socket_sendfile() function. + * It is possible for both bytes to be sent and an error to be returned. */ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 6da7457aa49..b9e580b1b01 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -263,9 +263,10 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags) { - int rv, nbytes = 0, total_hdrbytes, i; - int nopush_set = 0; + int nopush_set = 0, rv, i; + apr_size_t bytes_to_send = *len; apr_status_t arv; + apr_size_t n; #if APR_HAS_LARGE_FILES && defined(HAVE_SENDFILE64) apr_off_t off = *offset; @@ -276,7 +277,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, * past the 2Gb limit. */ off_t off; - if ((apr_int64_t)*offset + *len > INT_MAX) { + if ((apr_int64_t)*offset + bytes_to_send > INT_MAX) { + *len = 0; return EINVAL; } @@ -289,11 +291,14 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, * passed a >=2Gb count value on some 64-bit kernels. It won't * noticably hurt performance to limit each call to <2Gb at a * time, so avoid that issue here: */ - if (sizeof(off_t) == 8 && *len > INT_MAX) { - *len = INT_MAX; + if (sizeof(off_t) == 8 && bytes_to_send > INT_MAX) { + bytes_to_send = INT_MAX; } #endif + /* Until further notice. */ + *len = 0; + if (!hdtr) { hdtr = &no_hdtr; } @@ -308,16 +313,14 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } if (hdtr->numheaders > 0) { - apr_size_t hdrbytes; + apr_size_t total_hdrbytes; /* Now write the headers */ - arv = apr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, - &hdrbytes); + arv = apr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, &n); + *len += n; if (arv != APR_SUCCESS) { - *len = 0; - return errno; + return arv; } - nbytes += hdrbytes; /* If this was a partial write and we aren't doing timeouts, * return now with the partial byte count; this is a non-blocking @@ -327,8 +330,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, for (i = 0; i < hdtr->numheaders; i++) { total_hdrbytes += hdtr->headers[i].iov_len; } - if (hdrbytes < total_hdrbytes) { - *len = hdrbytes; + if (n < total_hdrbytes) { if (nopush_set) { return apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); } @@ -345,7 +347,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, rv = sendfile(sock->socketdes, /* socket */ file->filedes, /* open file descriptor of the file to be sent */ &off, /* where in the file to start */ - *len); /* number of bytes to send */ + bytes_to_send); /* number of bytes to send */ } while (rv == -1 && errno == EINTR); while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) @@ -353,7 +355,6 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { - *len = 0; return arv; } else { @@ -361,24 +362,22 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, rv = sendfile(sock->socketdes, /* socket */ file->filedes, /* open file descriptor of the file to be sent */ &off, /* where in the file to start */ - *len); /* number of bytes to send */ + bytes_to_send); /* number of bytes to send */ } while (rv == -1 && errno == EINTR); } } if (rv == -1) { - *len = nbytes; - rv = errno; + arv = errno; if (nopush_set) { apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); } - return rv; + return arv; } - nbytes += rv; + *len += rv; - if (rv < *len) { - *len = nbytes; + if ((apr_size_t)rv < bytes_to_send) { if (nopush_set) { arv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); } @@ -408,22 +407,17 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, /* Now write the footers */ if (hdtr->numtrailers > 0) { - apr_size_t trbytes; - arv = apr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, - &trbytes); - nbytes += trbytes; + arv = apr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, &n); + *len += n; if (nopush_set) { apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); } if (arv != APR_SUCCESS) { - *len = nbytes; - rv = errno; - return rv; + return arv; } } - (*len) = nbytes; - return rv < 0 ? errno : APR_SUCCESS; + return APR_SUCCESS; } #elif defined(DARWIN) @@ -434,11 +428,14 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, apr_size_t *len, apr_int32_t flags) { apr_off_t nbytes = 0; - apr_off_t bytes_to_send = *len; - apr_off_t bytes_sent = 0; + apr_size_t bytes_to_send = *len; apr_status_t arv; + apr_size_t n; int rv = 0; + /* Until further notice. */ + *len = 0; + /* Ignore flags for now. */ flags = 0; @@ -451,24 +448,21 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, * apr_socket_sendv() instead. */ if (hdtr->numheaders > 0) { - apr_size_t hbytes; + apr_size_t total_hdrbytes; int i; /* Now write the headers */ - arv = apr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, - &hbytes); + arv = apr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, &n); + *len += n; if (arv != APR_SUCCESS) { - *len = 0; - return errno; + return arv; } - bytes_sent = hbytes; - hbytes = 0; + total_hdrbytes = 0; for (i = 0; i < hdtr->numheaders; i++) { - hbytes += hdtr->headers[i].iov_len; + total_hdrbytes += hdtr->headers[i].iov_len; } - if (bytes_sent < hbytes) { - *len = bytes_sent; + if (n < total_hdrbytes) { return APR_SUCCESS; } } @@ -482,7 +476,6 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, sock->options &= ~APR_INCOMPLETE_WRITE; arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { - *len = 0; return arv; } } @@ -505,42 +498,40 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, * semantics w.r.t. bytes sent. */ if (nbytes) { - bytes_sent += nbytes; + *len += nbytes; /* normal exit for a big file & non-blocking io */ - (*len) = bytes_sent; return APR_SUCCESS; } + if (sock->timeout <= 0) { + /* normal exit for a non-blocking io which would block */ + break; + } } } else { /* rv == 0 (or the kernel is broken) */ - bytes_sent += nbytes; if (nbytes == 0) { /* Most likely the file got smaller after the stat. * Return an error so the caller can do the Right Thing. */ - (*len) = bytes_sent; return APR_EOF; } + *len += nbytes; } } while (rv == -1 && (errno == EINTR || errno == EAGAIN)); + if (rv == -1) { + return errno; + } + /* Now write the footers */ if (hdtr->numtrailers > 0) { - apr_size_t tbytes; - arv = apr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, - &tbytes); - bytes_sent += tbytes; + arv = apr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, &n); + *len += n; if (arv != APR_SUCCESS) { - *len = bytes_sent; - rv = errno; - return rv; + return arv; } } - (*len) = bytes_sent; - if (rv == -1) { - return errno; - } return APR_SUCCESS; } @@ -558,6 +549,10 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, #endif struct sf_hdtr headerstruct; apr_size_t bytes_to_send = *len; + apr_status_t arv; + + /* Until further notice. */ + *len = 0; /* Ignore flags for now. */ flags = 0; @@ -590,11 +585,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, /* FreeBSD can send the headers/footers as part of the system call */ do { if (sock->options & APR_INCOMPLETE_WRITE) { - apr_status_t arv; sock->options &= ~APR_INCOMPLETE_WRITE; arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { - *len = 0; return arv; } } @@ -621,10 +614,14 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, * semantics w.r.t. bytes sent. */ if (nbytes) { + *len += nbytes; /* normal exit for a big file & non-blocking io */ - (*len) = nbytes; return APR_SUCCESS; } + if (sock->timeout <= 0) { + /* normal exit for a non-blocking io which would block */ + break; + } } } else { /* rv == 0 (or the kernel is broken) */ @@ -632,9 +629,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, /* Most likely the file got smaller after the stat. * Return an error so the caller can do the Right Thing. */ - (*len) = nbytes; return APR_EOF; } + *len += nbytes; } } else { @@ -644,24 +641,19 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, hdtr->trailers, hdtr->numtrailers); if (rv > 0) { - nbytes = rv; - rv = 0; - } - else { - nbytes = 0; + *len += rv; } - } - if ((rv == -1) && (errno == EAGAIN) - && (sock->timeout > 0)) { - apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; + else if (rv == -1 && errno == EAGAIN) { + if (sock->timeout > 0) { + sock->options |= APR_INCOMPLETE_WRITE; + } + else { + break; + } } } } while (rv == -1 && (errno == EINTR || errno == EAGAIN)); - (*len) = nbytes; if (rv == -1) { return errno; } From ec446f9f99b31aed0bdef589b3d8d62b2717a1c3 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 29 Mar 2017 00:00:11 +0000 Subject: [PATCH 7664/7878] apr_dir_read: Since readdir() is now thread safe on most (if not all) unixes and readdir_r() is defective and deprecated, use the former by default unless APR_USE_READDIR_R is defined (no use case currently hence not autoconfigured). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1789258 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 28d9e069928..a94eb8e7fb8 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -138,7 +138,9 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_filetype_e type; #endif #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ - && !defined(READDIR_IS_THREAD_SAFE) + && !defined(READDIR_IS_THREAD_SAFE) \ + && (defined(APR_USE_READDIR64_R) \ + || defined(APR_USE_READDIR_R)) #ifdef APR_USE_READDIR64_R struct dirent64 *retent; @@ -179,9 +181,10 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, ret = APR_ENOENT; } #else - /* We're about to call a non-thread-safe readdir() that may - possibly set `errno', and the logic below actually cares about - errno after the call. Therefore we need to clear errno first. */ + /* We're about to call readdir() that may possibly set errno, and the + * logic below actually cares about errno after the call. Therefore + * we need to clear errno first. + */ errno = 0; thedir->entry = readdir(thedir->dirstruct); if (thedir->entry == NULL) { From 57338631709089760db97f1e3efb7ce86a22b94a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 30 Mar 2017 19:50:55 +0000 Subject: [PATCH 7665/7878] Note initial/current behavior apr_file_copy API git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1789560 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 6 ++++++ include/apr_file_io.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/Makefile.in b/Makefile.in index c3c203bcf42..7c687e3ff9d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -151,6 +151,12 @@ apr.exp: exports.c export_vars.c dox: doxygen $(top_srcdir)/docs/doxygen.conf +dox-vpath: + -mkdir docs 2> /dev/null + sed -e "s#\(INPUT=\.\)#\1 $(top_srcdir)#;" \ + < $(top_srcdir)/docs/doxygen.conf > docs/doxygen.conf + doxygen docs/doxygen.conf + gcov: @build/run-gcov.sh diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 59a502d7649..4611b1a153a 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -324,6 +324,10 @@ APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path, * file's permissions are copied. * @param pool The pool to use. * @remark The new file does not need to exist, it will be created if required. + * @remark Note that advanced filesystem permissions such as ACLs are not + * duplicated by this API. The target permissions (including duplicating the + * source file permissions) are assigned only when the target file does not yet + * exist. */ APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, const char *to_path, From 5bfce3686524630cc6bc3877890dd6524860aa9f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 30 Mar 2017 19:52:59 +0000 Subject: [PATCH 7666/7878] Remove my experimental vpath dox regen logic, at least till I validate it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1789562 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7c687e3ff9d..c3c203bcf42 100644 --- a/Makefile.in +++ b/Makefile.in @@ -151,12 +151,6 @@ apr.exp: exports.c export_vars.c dox: doxygen $(top_srcdir)/docs/doxygen.conf -dox-vpath: - -mkdir docs 2> /dev/null - sed -e "s#\(INPUT=\.\)#\1 $(top_srcdir)#;" \ - < $(top_srcdir)/docs/doxygen.conf > docs/doxygen.conf - doxygen docs/doxygen.conf - gcov: @build/run-gcov.sh From c655f732ad9f25667cda8686e888ee9aec5050b9 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Sun, 2 Apr 2017 16:27:10 +0000 Subject: [PATCH 7667/7878] PR#59927: build apu with modern MySQL. Patch: Petr Sumbera Following the comments on the PR, it seems mysqlclient_r has been superfluous since MySQL 5.5 in 2010 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1789894 13f79535-47bb-0310-9956-ffa450edef68 --- build/dbd.m4 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/dbd.m4 b/build/dbd.m4 index 3ae9679928e..77e3af10ab8 100644 --- a/build/dbd.m4 +++ b/build/dbd.m4 @@ -177,12 +177,12 @@ AC_DEFUN([APU_CHECK_DBD_MYSQL], [ fi AC_CHECK_HEADERS([mysql.h my_global.h my_sys.h], - AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]), + AC_CHECK_LIB(mysqlclient, mysql_init, [apu_have_mysql=1]), [apu_have_mysql=0; break], [#include ]) if test "$apu_have_mysql" = "0"; then AC_CHECK_HEADERS([mysql/mysql.h mysql/my_global.h mysql/my_sys.h], - AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]), + AC_CHECK_LIB(mysqlclient, mysql_init, [apu_have_mysql=1]), [apu_have_mysql=0; break], [#include ]) fi @@ -208,13 +208,13 @@ AC_DEFUN([APU_CHECK_DBD_MYSQL], [ AC_MSG_NOTICE(checking for mysql in $withval) AC_CHECK_HEADERS([mysql.h my_global.h my_sys.h], - AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]), + AC_CHECK_LIB(mysqlclient, mysql_init, [apu_have_mysql=1]), [apu_have_mysql=0; break], [#include ]) if test "$apu_have_mysql" != "1"; then AC_CHECK_HEADERS([mysql/mysql.h mysql/my_global.h mysql/my_sys.h], - AC_CHECK_LIB(mysqlclient_r, mysql_init, [apu_have_mysql=1]), + AC_CHECK_LIB(mysqlclient, mysql_init, [apu_have_mysql=1]), [apu_have_mysql=0; break], [#include ]) fi @@ -229,7 +229,7 @@ AC_DEFUN([APU_CHECK_DBD_MYSQL], [ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_mysql" = "1"; then - APR_ADDTO(LDADD_dbd_mysql, [$mysql_LDFLAGS -lmysqlclient_r $mysql_LIBS]) + APR_ADDTO(LDADD_dbd_mysql, [$mysql_LDFLAGS -lmysqlclient $mysql_LIBS]) fi AC_SUBST(LDADD_dbd_mysql) From d6f9c3d4e6ca2bbd526c95868d11b2480a7f5968 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 3 Apr 2017 10:50:44 +0000 Subject: [PATCH 7668/7878] Follow up to r1788334: apr_allocator_align() should take an allocator as argument, for better scalability of the API. Update apr_bucket_alloc_aligned_floor() from r1788335 accordingly. Suggested by ivan. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1789947 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_buckets_alloc.c | 8 +++++--- buckets/apr_buckets_file.c | 2 +- include/apr_allocator.h | 4 +++- include/apr_buckets.h | 5 ++++- memory/unix/apr_pools.c | 4 +++- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/buckets/apr_buckets_alloc.c b/buckets/apr_buckets_alloc.c index 833621c4a82..79ac9293e8f 100644 --- a/buckets/apr_buckets_alloc.c +++ b/buckets/apr_buckets_alloc.c @@ -123,17 +123,19 @@ APR_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list) #endif } -APR_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_aligned_floor(apr_size_t size) +APR_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_aligned_floor(apr_bucket_alloc_t *list, + apr_size_t size) { if (size <= SMALL_NODE_SIZE) { size = SMALL_NODE_SIZE; } else { if (size < APR_MEMNODE_T_SIZE) { - size = apr_allocator_align(0); + size = apr_allocator_align(list->allocator, 0); } else { - size = apr_allocator_align(size - APR_MEMNODE_T_SIZE); + size = apr_allocator_align(list->allocator, + size - APR_MEMNODE_T_SIZE); } size -= APR_MEMNODE_T_SIZE; } diff --git a/buckets/apr_buckets_file.c b/buckets/apr_buckets_file.c index 7cea3a40d67..82bb2d1721e 100644 --- a/buckets/apr_buckets_file.c +++ b/buckets/apr_buckets_file.c @@ -205,7 +205,7 @@ APR_DECLARE(apr_status_t) apr_bucket_file_set_buf_size(apr_bucket *e, a->read_size = APR_BUCKET_BUFF_SIZE; } else { - apr_size_t floor = apr_bucket_alloc_aligned_floor(size); + apr_size_t floor = apr_bucket_alloc_aligned_floor(e->list, size); a->read_size = (size < floor) ? size : floor; } diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 32cffd7f400..4d9d7622066 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -122,10 +122,12 @@ APR_DECLARE(apr_status_t) apr_allocator_min_order_set(unsigned int order); /** * Get the true size that would be allocated for the given size (including * the header and alignment). + * @param list The allocator from which to the memory would be allocated * @param size The size to align * @return The aligned size (or zero on apr_size_t overflow) */ -APR_DECLARE(apr_size_t) apr_allocator_align(apr_size_t size); +APR_DECLARE(apr_size_t) apr_allocator_align(apr_allocator_t *allocator, + apr_size_t size); #include "apr_pools.h" diff --git a/include/apr_buckets.h b/include/apr_buckets.h index ba1762efc38..abecd16ef8a 100644 --- a/include/apr_buckets.h +++ b/include/apr_buckets.h @@ -997,10 +997,13 @@ APR_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list) * Get the aligned size corresponding to the requested size, but minus the * allocator(s) overhead such that the allocation would remain in the * same boundary. + * @param list The allocator from which to the memory would be allocated. * @param size The requested size. * @return The corresponding aligned/floored size. */ -APR_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_aligned_floor(apr_size_t size); +APR_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_aligned_floor(apr_bucket_alloc_t *list, + apr_size_t size) + __attribute__((nonnull(1))); /** * Allocate memory for use by the buckets. diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index e3d82d0f73b..d2ff53dcdcc 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -260,8 +260,10 @@ apr_size_t allocator_align(apr_size_t in_size) return size; } -APR_DECLARE(apr_size_t) apr_allocator_align(apr_size_t size) +APR_DECLARE(apr_size_t) apr_allocator_align(apr_allocator_t *allocator, + apr_size_t size) { + (void)allocator; return allocator_align(size); } From 21a19db3fb448ef7bf2e26f092db908104567cc9 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 3 Apr 2017 14:06:16 +0000 Subject: [PATCH 7669/7878] Follow up to r1733694: proc-pthreads have their own child_init() now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1789998 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 0971f952c28..e66f2674afc 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -31,7 +31,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) } #if APR_HAS_POSIXSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || \ - APR_HAS_PROC_PTHREAD_SERIALIZE || APR_HAS_SYSVSEM_SERIALIZE + APR_HAS_SYSVSEM_SERIALIZE static apr_status_t proc_mutex_no_child_init(apr_proc_mutex_t **mutex, apr_pool_t *cont, const char *fname) From 303eef0eafb91ec34214914d18537eb19b7f2719 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 3 Apr 2017 20:16:22 +0000 Subject: [PATCH 7670/7878] Follow up to r1667900: don't fail test{proc,global}mutex if APR_LOCK_DEFAULT_TIMED is not implemented (e.g. MacOS). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790045 13f79535-47bb-0310-9956-ffa450edef68 --- test/testglobalmutex.c | 5 +++++ test/testprocmutex.c | 10 ++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/test/testglobalmutex.c b/test/testglobalmutex.c index 7340e25407a..c79884cfcf5 100644 --- a/test/testglobalmutex.c +++ b/test/testglobalmutex.c @@ -84,6 +84,11 @@ static void test_exclusive(abts_case *tc, void *data) abts_log_message(mutexname(mech)); rv = apr_global_mutex_create(&global_lock, LOCKNAME, mech, p); + if (rv == APR_ENOTIMPL) { + /* MacOS lacks TIMED implementation, so don't fail for ENOTIMPL */ + ABTS_NOT_IMPL(tc, "global mutex TIMED not implemented"); + return; + } APR_ASSERT_SUCCESS(tc, "Error creating mutex", rv); launch_child(tc, mech, &p1, p); diff --git a/test/testprocmutex.c b/test/testprocmutex.c index ba19b9897ec..599d585204b 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -130,14 +130,12 @@ static void test_exclusive(abts_case *tc, const char *lockname, int n; rv = apr_proc_mutex_create(&proc_lock, lockname, mech->num, p); - APR_ASSERT_SUCCESS(tc, "create the mutex", rv); - if (rv != APR_SUCCESS) { - fprintf(stderr, "%s not implemented, ", mech->name); - ABTS_ASSERT(tc, "Default timed not implemented", - mech->num != APR_LOCK_DEFAULT && - mech->num != APR_LOCK_DEFAULT_TIMED); + if (rv == APR_ENOTIMPL) { + /* MacOS lacks TIMED implementation, so don't fail for ENOTIMPL */ + fprintf(stderr, "method %s not implemented, ", mech->name); return; } + APR_ASSERT_SUCCESS(tc, "create the mutex", rv); for (n = 0; n < CHILDREN; n++) make_child(tc, 0, &child[n], p); From 1465146b36696ef3b9bb2b7ebf2dbd6b67505c98 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 4 Apr 2017 13:14:15 +0000 Subject: [PATCH 7671/7878] Add in our own pthread_mutex_timedlock impl for those OSs, like osx/macos that don't have it. Be a bit more generous in the test git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790107 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/misc.c | 74 +++++++++++++++++++++++++++++++++++++++ locks/unix/proc_mutex.c | 10 +++--- locks/unix/thread_mutex.c | 67 +++-------------------------------- test/testlock.c | 2 +- 4 files changed, 83 insertions(+), 70 deletions(-) create mode 100644 locks/unix/misc.c diff --git a/locks/unix/misc.c b/locks/unix/misc.c new file mode 100644 index 00000000000..3aacfe71de5 --- /dev/null +++ b/locks/unix/misc.c @@ -0,0 +1,74 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_private.h" +#include "apr_arch_thread_mutex.h" +#define APR_WANT_MEMFUNC +#include "apr_want.h" +#include +#if APR_HAS_THREADS + +#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK +extern int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abs_timeout); +#define SLEEP_TIME_NS 10000000 +#define NANOSECS_PER_SEC 1000000000 +/* +* A pthread_mutex_timedlock() impl for OSX/macOS, which lacks the +* real thing. +* NOTE: Unlike the real McCoy, won't return EOWNERDEAD, EDEADLK +* or EOWNERDEAD +*/ +int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abs_timeout) +{ + int rv; + struct timespec remaining, ts, tod; + apr_time_t now; + + remaining = *abs_timeout; + now = apr_time_now(); + tod.tv_sec = apr_time_sec(now); + tod.tv_nsec = apr_time_usec(now) * 1000; /* nanoseconds */ + + remaining.tv_sec -= tod.tv_sec; + if (tod.tv_nsec <= remaining.tv_nsec) { + remaining.tv_nsec -= tod.tv_nsec; + } + else { + remaining.tv_sec--; + remaining.tv_nsec = (NANOSECS_PER_SEC - (tod.tv_nsec - remaining.tv_nsec)); + } + while ((rv = pthread_mutex_trylock(mutex)) == EBUSY) { + ts.tv_sec = 0; + ts.tv_nsec = (remaining.tv_sec > 0 ? SLEEP_TIME_NS : + (remaining.tv_nsec < SLEEP_TIME_NS ? remaining.tv_nsec : SLEEP_TIME_NS)); + nanosleep(&ts, &ts); + if (ts.tv_nsec <= remaining.tv_nsec) { + remaining.tv_nsec -= ts.tv_nsec; + } + else { + remaining.tv_sec--; + remaining.tv_nsec = (NANOSECS_PER_SEC - (ts.tv_nsec - remaining.tv_nsec)); + } + if (remaining.tv_sec < 0 || (!remaining.tv_sec && remaining.tv_nsec <= SLEEP_TIME_NS)) { + return ETIMEDOUT; + } + } + + return rv; +} + +#endif /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */ +#endif /* APR_HAS_THREADS */ diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index e66f2674afc..9ef9962045d 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -648,7 +648,9 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, apr_time_t timeout, int absolute) { -#ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK +#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK +extern int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abs_timeout); +#endif if (timeout < 0) { return proc_mutex_pthread_acquire(mutex); } @@ -683,9 +685,6 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, } mutex->curr_locked = 1; return APR_SUCCESS; -#else - return APR_ENOTIMPL; -#endif } static apr_status_t proc_mutex_pthread_release(apr_proc_mutex_t *mutex) @@ -1214,8 +1213,7 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, break; case APR_LOCK_DEFAULT_TIMED: #if APR_HAS_PROC_PTHREAD_SERIALIZE \ - && defined(HAVE_PTHREAD_MUTEX_ROBUST) \ - && defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) + && defined(HAVE_PTHREAD_MUTEX_ROBUST) new_mutex->meth = &mutex_proc_pthread_methods; #elif APR_HAS_SYSVSEM_SERIALIZE \ && defined(HAVE_SEMTIMEDOP) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index fe515b2e653..5c671665838 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -77,19 +77,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, return rv; } -#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK - if (flags & APR_THREAD_MUTEX_TIMED) { - rv = apr_thread_cond_create(&new_mutex->cond, pool); - if (rv) { -#ifdef HAVE_ZOS_PTHREADS - rv = errno; -#endif - pthread_mutex_destroy(&new_mutex->mutex); - return rv; - } - } -#endif - apr_pool_cleanup_register(new_mutex->pool, new_mutex, thread_mutex_cleanup, apr_pool_cleanup_null); @@ -195,7 +182,10 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, { apr_status_t rv = APR_ENOTIMPL; -#ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK +#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK +extern int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abs_timeout); +#endif + if (timeout < 0) { rv = pthread_mutex_lock(&mutex->mutex); if (rv) { @@ -223,55 +213,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, } } } - -#else /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */ - - if (mutex->cond) { - apr_status_t rv2; - - rv = pthread_mutex_lock(&mutex->mutex); - if (rv) { -#ifdef HAVE_ZOS_PTHREADS - rv = errno; -#endif - return rv; - } - - if (mutex->locked) { - mutex->num_waiters++; - if (timeout < 0) { - rv = apr_thread_cond_wait(mutex->cond, mutex); - } - else { - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; - } - else { - timeout = 0; - } - } - rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout); - } - mutex->num_waiters--; - } - else { - mutex->locked = 1; - } - - rv2 = pthread_mutex_unlock(&mutex->mutex); - if (rv2 && !rv) { -#ifdef HAVE_ZOS_PTHREADS - rv = errno; -#else - rv = rv2; -#endif - } - } - -#endif /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */ - return rv; } diff --git a/test/testlock.c b/test/testlock.c index a36720b84a4..45eddb02e56 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -365,7 +365,7 @@ static void test_timeoutmutex(abts_case *tc, void *data) continue; } ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(s)); - ABTS_ASSERT(tc, "Timer returned too late", end - begin - timeout < 100000); + ABTS_ASSERT(tc, "Timer returned too late", end - begin - timeout < 1000000); break; } ABTS_ASSERT(tc, "Too many retries", i < MAX_RETRY); From 5c423cdbc178ac380c79457aa2519a7e0cfd284d Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 4 Apr 2017 13:40:53 +0000 Subject: [PATCH 7672/7878] Be safe... if we had a super small timeout then by the time we call us, we could have blown past it... in that case, just try the lock git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790111 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/misc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/locks/unix/misc.c b/locks/unix/misc.c index 3aacfe71de5..84a4a073ac3 100644 --- a/locks/unix/misc.c +++ b/locks/unix/misc.c @@ -50,6 +50,10 @@ int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abs_t remaining.tv_sec--; remaining.tv_nsec = (NANOSECS_PER_SEC - (tod.tv_nsec - remaining.tv_nsec)); } + /* If we had a REALLY small timeout ;) */ + if (remaining.tv_sec < 0) { + return pthread_mutex_trylock(mutex); + } while ((rv = pthread_mutex_trylock(mutex)) == EBUSY) { ts.tv_sec = 0; ts.tv_nsec = (remaining.tv_sec > 0 ? SLEEP_TIME_NS : From 6c887f6416b0228bc4326110fa82481d861ce0e5 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 4 Apr 2017 16:35:51 +0000 Subject: [PATCH 7673/7878] There are 10 lights! I mean files git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790145 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfnmatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testfnmatch.c b/test/testfnmatch.c index 17a75441543..1d1c0315dbd 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -23,7 +23,7 @@ * .txt extension in the data directory at the time testfnmatch * happens to be run (!?!). */ -#define NUM_FILES (5) +#define NUM_FILES (10) #define APR_FNM_BITS 15 #define APR_FNM_FAILBIT 256 From b9395d559fd88437163af8a1535656854efbec09 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 4 Apr 2017 17:47:30 +0000 Subject: [PATCH 7674/7878] make this more obvious git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790149 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmutexscope.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testmutexscope.c b/test/testmutexscope.c index 8081357731d..2120fff24f5 100644 --- a/test/testmutexscope.c +++ b/test/testmutexscope.c @@ -155,7 +155,7 @@ static void test_mech_mode(apr_lockmech_e mech, const char *mech_name, if (test_mode == TEST_PROC) { printf(" mutex mechanism `%s' is %sglobal in scope on this platform.\n", - mech_name, counter == 1 ? "" : "not "); + mech_name, counter == 1 ? "" : "*NOT* "); } else { if (counter != 1) { From 5d6570232c34281879335bc55ab0113eea1b164a Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 4 Apr 2017 19:08:39 +0000 Subject: [PATCH 7675/7878] the rest git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790157 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/misc.c | 227 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 180 insertions(+), 47 deletions(-) diff --git a/locks/unix/misc.c b/locks/unix/misc.c index 84a4a073ac3..b3bc21828aa 100644 --- a/locks/unix/misc.c +++ b/locks/unix/misc.c @@ -18,61 +18,194 @@ #include "apr_arch_thread_mutex.h" #define APR_WANT_MEMFUNC #include "apr_want.h" -#include -#if APR_HAS_THREADS -#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK -extern int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abs_timeout); +#if APR_HAS_THREADS +#if APR_HAS_SYSVSEM_SERIALIZE +#if !HAVE_SEMTIMEDOP +#include +#endif +#endif #define SLEEP_TIME_NS 10000000 #define NANOSECS_PER_SEC 1000000000 +extern int errno; + +#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK +extern int pthread_mutex_timedlock(pthread_mutex_t * mutex, + const struct timespec *abs_timeout); /* -* A pthread_mutex_timedlock() impl for OSX/macOS, which lacks the -* real thing. -* NOTE: Unlike the real McCoy, won't return EOWNERDEAD, EDEADLK -* or EOWNERDEAD -*/ -int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abs_timeout) + * A pthread_mutex_timedlock() impl for OSX/macOS, which lacks the + * real thing. + * NOTE: Unlike the real McCoy, won't return EOWNERDEAD, EDEADLK + * or EOWNERDEAD + */ +int pthread_mutex_timedlock(pthread_mutex_t * mutex, + const struct timespec *abs_timeout) { - int rv; - struct timespec remaining, ts, tod; - apr_time_t now; + int rv; + struct timespec remaining, ts, tod; + apr_time_t now; - remaining = *abs_timeout; - now = apr_time_now(); - tod.tv_sec = apr_time_sec(now); - tod.tv_nsec = apr_time_usec(now) * 1000; /* nanoseconds */ + remaining = *abs_timeout; + now = apr_time_now(); + tod.tv_sec = apr_time_sec(now); + tod.tv_nsec = apr_time_usec(now) * 1000; /* nanoseconds */ - remaining.tv_sec -= tod.tv_sec; - if (tod.tv_nsec <= remaining.tv_nsec) { - remaining.tv_nsec -= tod.tv_nsec; - } - else { - remaining.tv_sec--; - remaining.tv_nsec = (NANOSECS_PER_SEC - (tod.tv_nsec - remaining.tv_nsec)); - } - /* If we had a REALLY small timeout ;) */ - if (remaining.tv_sec < 0) { - return pthread_mutex_trylock(mutex); - } - while ((rv = pthread_mutex_trylock(mutex)) == EBUSY) { - ts.tv_sec = 0; - ts.tv_nsec = (remaining.tv_sec > 0 ? SLEEP_TIME_NS : - (remaining.tv_nsec < SLEEP_TIME_NS ? remaining.tv_nsec : SLEEP_TIME_NS)); - nanosleep(&ts, &ts); - if (ts.tv_nsec <= remaining.tv_nsec) { - remaining.tv_nsec -= ts.tv_nsec; - } - else { - remaining.tv_sec--; - remaining.tv_nsec = (NANOSECS_PER_SEC - (ts.tv_nsec - remaining.tv_nsec)); - } - if (remaining.tv_sec < 0 || (!remaining.tv_sec && remaining.tv_nsec <= SLEEP_TIME_NS)) { - return ETIMEDOUT; - } - } + remaining.tv_sec -= tod.tv_sec; + if (tod.tv_nsec <= remaining.tv_nsec) { + remaining.tv_nsec -= tod.tv_nsec; + } + else { + remaining.tv_sec--; + remaining.tv_nsec = + (NANOSECS_PER_SEC - (tod.tv_nsec - remaining.tv_nsec)); + } + /* If we had a REALLY small timeout ;) */ + if (remaining.tv_sec < 0) { + return ETIMEDOUT; + } + while ((rv = pthread_mutex_trylock(mutex)) == EBUSY) { + ts.tv_sec = 0; + ts.tv_nsec = (remaining.tv_sec > 0 ? SLEEP_TIME_NS : + (remaining.tv_nsec < + SLEEP_TIME_NS ? remaining.tv_nsec : SLEEP_TIME_NS)); + nanosleep(&ts, &ts); + if (ts.tv_nsec <= remaining.tv_nsec) { + remaining.tv_nsec -= ts.tv_nsec; + } + else { + remaining.tv_sec--; + remaining.tv_nsec = + (NANOSECS_PER_SEC - (ts.tv_nsec - remaining.tv_nsec)); + } + if (remaining.tv_sec < 0 + || (!remaining.tv_sec && remaining.tv_nsec <= SLEEP_TIME_NS)) { + return ETIMEDOUT; + } + } - return rv; + return rv; } - #endif /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */ + +#if APR_HAS_POSIXSEM_SERIALIZE +#if !HAVE_SEM_TIMEDWAIT +extern int sem_timedwait(sem_t * sem, const struct timespec *abs_timeout); +/* + * A sem_timedwait() impl for OSX/macOS, which lacks the + * real thing. + */ +int sem_timedwait(sem_t * sem, const struct timespec *abs_timeout) +{ + int rv; + struct timespec remaining, ts, tod; + apr_time_t now; + + remaining = *abs_timeout; + now = apr_time_now(); + tod.tv_sec = apr_time_sec(now); + tod.tv_nsec = apr_time_usec(now) * 1000; /* nanoseconds */ + + remaining.tv_sec -= tod.tv_sec; + if (tod.tv_nsec <= remaining.tv_nsec) { + remaining.tv_nsec -= tod.tv_nsec; + } + else { + remaining.tv_sec--; + remaining.tv_nsec = + (NANOSECS_PER_SEC - (tod.tv_nsec - remaining.tv_nsec)); + } + /* If we had a REALLY small timeout ;) */ + if (remaining.tv_sec < 0) { + return ETIMEDOUT; + } + errno = 0; + while (((rv = sem_trywait(sem)) != 0) && (errno == EAGAIN)) { + ts.tv_sec = 0; + ts.tv_nsec = (remaining.tv_sec > 0 ? SLEEP_TIME_NS : + (remaining.tv_nsec < + SLEEP_TIME_NS ? remaining.tv_nsec : SLEEP_TIME_NS)); + nanosleep(&ts, &ts); + if (ts.tv_nsec <= remaining.tv_nsec) { + remaining.tv_nsec -= ts.tv_nsec; + } + else { + remaining.tv_sec--; + remaining.tv_nsec = + (NANOSECS_PER_SEC - (ts.tv_nsec - remaining.tv_nsec)); + } + if (remaining.tv_sec < 0 + || (!remaining.tv_sec && remaining.tv_nsec <= SLEEP_TIME_NS)) { + return ETIMEDOUT; + } + } + return rv; +} +#endif /* HAVE_SEM_TIMEDWAIT */ +#endif /* APR_HAS_POSIXSEM_SERIALIZE */ + +#if APR_HAS_SYSVSEM_SERIALIZE +#if !HAVE_SEMTIMEDOP +extern int semtimedop(int semid, struct sembuf *sops, unsigned nsops, + const struct timespec *abs_timeout); +/* + * A semtimedop() impl for OSX/macOS, which lacks the + * real thing. + */ +int semtimedop(int semid, struct sembuf *sops, unsigned nsops, + const struct timespec *abs_timeout) +{ + int rv; + struct timespec remaining, ts, tod; + apr_time_t now; + struct sembuf proc_mutex_op_try; + + proc_mutex_op_try.sem_num = 0; + proc_mutex_op_try.sem_op = -1; + proc_mutex_op_try.sem_flg = SEM_UNDO | IPC_NOWAIT; + + remaining = *abs_timeout; + now = apr_time_now(); + tod.tv_sec = apr_time_sec(now); + tod.tv_nsec = apr_time_usec(now) * 1000; /* nanoseconds */ + + remaining.tv_sec -= tod.tv_sec; + if (tod.tv_nsec <= remaining.tv_nsec) { + remaining.tv_nsec -= tod.tv_nsec; + } + else { + remaining.tv_sec--; + remaining.tv_nsec = + (NANOSECS_PER_SEC - (tod.tv_nsec - remaining.tv_nsec)); + } + /* If we had a REALLY small timeout ;) */ + if (remaining.tv_sec < 0) { + return ETIMEDOUT; + } + errno = 0; + while (((rv = semop(semid, &proc_mutex_op_try, nsops)) != 0) + && (errno == EAGAIN)) { + ts.tv_sec = 0; + ts.tv_nsec = (remaining.tv_sec > 0 ? SLEEP_TIME_NS : + (remaining.tv_nsec < + SLEEP_TIME_NS ? remaining.tv_nsec : SLEEP_TIME_NS)); + nanosleep(&ts, &ts); + if (ts.tv_nsec <= remaining.tv_nsec) { + remaining.tv_nsec -= ts.tv_nsec; + } + else { + remaining.tv_sec--; + remaining.tv_nsec = + (NANOSECS_PER_SEC - (ts.tv_nsec - remaining.tv_nsec)); + } + if (remaining.tv_sec < 0 + || (!remaining.tv_sec && remaining.tv_nsec <= SLEEP_TIME_NS)) { + return ETIMEDOUT; + } + } + return rv; +} +#endif /* HAVE_SEMTIMEDOP */ +#endif /* APR_HAS_SYSVSEM_SERIALIZE */ + + #endif /* APR_HAS_THREADS */ From 62afce7c4bf5b777eee1789f4a3ec532fd7246f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branko=20=C4=8Cibej?= Date: Wed, 5 Apr 2017 10:18:57 +0000 Subject: [PATCH 7676/7878] Do not try to use fdatasync() on macOS. Use the platform-specific fcntl(fd, F_FULLFSYNC) instead. See http://apr.markmail.org/thread/hlgqd5yr6j4auxol git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790200 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 +++++ file_io/unix/readwrite.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/configure.in b/configure.in index b406562a612..5dcef8aa4d2 100644 --- a/configure.in +++ b/configure.in @@ -578,6 +578,11 @@ case $host in ;; esac ;; + *apple-darwin*) + ac_cv_func_fdatasync="no" # Mac OS X wrongly reports it has fdatasync() + OSDIR="unix" + eolstr="\\n" + ;; *os390) OSDIR="os390" OBJECTS_PLATFORM='$(OBJECTS_os390)' diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index dd424cd647a..f9c7b06bdb4 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -476,6 +476,8 @@ APR_DECLARE(apr_status_t) apr_file_datasync(apr_file_t *thefile) #ifdef HAVE_FDATASYNC if (fdatasync(thefile->filedes)) { +#elif defined(F_FULLFSYNC) + if (fcntl(thefile->filedes, F_FULLFSYNC)) { #else if (fsync(thefile->filedes)) { #endif From 115ab98900e365d2ba983183a2f819c728339d56 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 5 Apr 2017 16:24:00 +0000 Subject: [PATCH 7677/7878] Follow up to r1667900: semtimedop() should be passed a relative timeout rather then absolute. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790296 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 9ef9962045d..1ae4be8a522 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -343,8 +343,11 @@ static apr_status_t proc_mutex_sysv_timedacquire(apr_proc_mutex_t *mutex, else { int rc; struct timespec abstime; - if (!absolute) { - timeout += apr_time_now(); + if (absolute) { + timeout -= apr_time_now(); + if (timeout < 0) { + return proc_mutex_sysv_tryacquire(mutex); + } } abstime.tv_sec = apr_time_sec(timeout); abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ From 3fd19cf0e7976de9609e81302cd644c9c72ae4ad Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 5 Apr 2017 17:10:04 +0000 Subject: [PATCH 7678/7878] semtimedop() takes a delta time, so accept what is given as the "time remaining" rr1790301 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790302 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/misc.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/locks/unix/misc.c b/locks/unix/misc.c index b3bc21828aa..d7018fc3a94 100644 --- a/locks/unix/misc.c +++ b/locks/unix/misc.c @@ -146,41 +146,23 @@ int sem_timedwait(sem_t * sem, const struct timespec *abs_timeout) #if APR_HAS_SYSVSEM_SERIALIZE #if !HAVE_SEMTIMEDOP extern int semtimedop(int semid, struct sembuf *sops, unsigned nsops, - const struct timespec *abs_timeout); + const struct timespec *timeout); /* * A semtimedop() impl for OSX/macOS, which lacks the * real thing. */ int semtimedop(int semid, struct sembuf *sops, unsigned nsops, - const struct timespec *abs_timeout) + const struct timespec *timeout) { int rv; - struct timespec remaining, ts, tod; - apr_time_t now; + struct timespec remaining, ts; struct sembuf proc_mutex_op_try; proc_mutex_op_try.sem_num = 0; proc_mutex_op_try.sem_op = -1; proc_mutex_op_try.sem_flg = SEM_UNDO | IPC_NOWAIT; - remaining = *abs_timeout; - now = apr_time_now(); - tod.tv_sec = apr_time_sec(now); - tod.tv_nsec = apr_time_usec(now) * 1000; /* nanoseconds */ - - remaining.tv_sec -= tod.tv_sec; - if (tod.tv_nsec <= remaining.tv_nsec) { - remaining.tv_nsec -= tod.tv_nsec; - } - else { - remaining.tv_sec--; - remaining.tv_nsec = - (NANOSECS_PER_SEC - (tod.tv_nsec - remaining.tv_nsec)); - } - /* If we had a REALLY small timeout ;) */ - if (remaining.tv_sec < 0) { - return ETIMEDOUT; - } + remaining = *timeout; errno = 0; while (((rv = semop(semid, &proc_mutex_op_try, nsops)) != 0) && (errno == EAGAIN)) { From 15170d588a34fd3a84765cee95e89537709c5816 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 5 Apr 2017 17:10:31 +0000 Subject: [PATCH 7679/7878] Use our "portable" versions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790303 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 1ae4be8a522..e8f4604108e 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -181,7 +181,9 @@ static apr_status_t proc_mutex_posix_timedacquire(apr_proc_mutex_t *mutex, apr_time_t timeout, int absolute) { -#if HAVE_SEM_TIMEDWAIT +#if !HAVE_SEM_TIMEDWAIT +extern int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout); +#endif if (timeout < 0) { return proc_mutex_posix_acquire(mutex); } @@ -207,9 +209,6 @@ static apr_status_t proc_mutex_posix_timedacquire(apr_proc_mutex_t *mutex, } mutex->curr_locked = 1; return APR_SUCCESS; -#else - return APR_ENOTIMPL; -#endif } static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) @@ -336,7 +335,10 @@ static apr_status_t proc_mutex_sysv_timedacquire(apr_proc_mutex_t *mutex, apr_time_t timeout, int absolute) { -#if HAVE_SEMTIMEDOP +#if !HAVE_SEMTIMEDOP +extern int semtimedop(int semid, struct sembuf *sops, unsigned nsops, + const struct timespec *abs_timeout); +#endif if (timeout < 0) { return proc_mutex_sysv_acquire(mutex); } @@ -364,9 +366,6 @@ static apr_status_t proc_mutex_sysv_timedacquire(apr_proc_mutex_t *mutex, } mutex->curr_locked = 1; return APR_SUCCESS; -#else - return APR_ENOTIMPL; -#endif } static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex) From c0e25b70a4fb24852c63d21f1729b04a5de6d1f4 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 5 Apr 2017 17:11:44 +0000 Subject: [PATCH 7680/7878] Make clear this is a delta timeout git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790304 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index e8f4604108e..990bd15f09f 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -337,7 +337,7 @@ static apr_status_t proc_mutex_sysv_timedacquire(apr_proc_mutex_t *mutex, { #if !HAVE_SEMTIMEDOP extern int semtimedop(int semid, struct sembuf *sops, unsigned nsops, - const struct timespec *abs_timeout); + const struct timespec *timeout); #endif if (timeout < 0) { return proc_mutex_sysv_acquire(mutex); From cb5a29b01cbfc2e900398f8499136d00323b37a6 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 5 Apr 2017 22:50:27 +0000 Subject: [PATCH 7681/7878] locks: when pthread_mutex_timedlock() isn't available, fall back to an implementation based on pthread_cond_timedwait() when possible. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790330 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 + locks/unix/proc_mutex.c | 301 ++++++++++++++++++++++++++++++++------ locks/unix/thread_mutex.c | 67 ++++++++- 3 files changed, 323 insertions(+), 50 deletions(-) diff --git a/configure.in b/configure.in index 5dcef8aa4d2..a7139b41422 100644 --- a/configure.in +++ b/configure.in @@ -2265,6 +2265,11 @@ APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl hasprocpthreadser="1", hasprocpthreadser="0") APR_IFALLYES(header:OS.h func:create_sem, hasbeossem="1", hasbeossem="0") +AC_CHECK_FUNCS(pthread_condattr_setpshared) +APR_IFALLYES(header:pthread.h func:pthread_condattr_setpshared, + have_pthread_condattr_setpshared="1", have_pthread_condattr_setpshared="0") +AC_SUBST(have_pthread_condattr_setpshared) + # See which lock mechanism we'll select by default on this system. # The last APR_DECIDE to execute sets the default. # At this stage, we match the ordering in Apache 1.3 diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 990bd15f09f..8fc0bd2d993 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -423,6 +423,12 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = #if APR_HAS_PROC_PTHREAD_SERIALIZE +#if defined(HAVE_PTHREAD_MUTEX_ROBUST) \ + && defined(HAVE_PTHREAD_CONDATTR_SETPSHARED) \ + && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) +#define USE_PTHREAD_MUTEX_COND +#endif + /* The mmap()ed pthread_interproc is the native pthread_mutex_t followed * by a refcounter to track children using it. We want to avoid calling * pthread_mutex_destroy() on the shared mutex area while it is in use by @@ -434,12 +440,27 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = */ typedef struct { pthread_mutex_t mutex; +#ifdef USE_PTHREAD_MUTEX_COND + pthread_cond_t cond; + apr_int32_t cond_locked; + apr_uint32_t cond_num_waiters; +#define proc_pthread_mutex_cond(m) \ + (((proc_pthread_mutex_t *)(m)->os.pthread_interproc)->cond) +#define proc_pthread_mutex_cond_locked(m) \ + (((proc_pthread_mutex_t *)(m)->os.pthread_interproc)->cond_locked) +#define proc_pthread_mutex_cond_num_waiters(m) \ + (((proc_pthread_mutex_t *)(m)->os.pthread_interproc)->cond_num_waiters) +#endif /* USE_PTHREAD_MUTEX_COND */ apr_uint32_t refcount; } proc_pthread_mutex_t; #define proc_pthread_mutex_refcount(m) \ (((proc_pthread_mutex_t *)(m)->os.pthread_interproc)->refcount) +static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, + apr_time_t timeout, + int absolute); + static APR_INLINE int proc_pthread_mutex_inc(apr_proc_mutex_t *mutex) { if (mutex->pthread_refcounting) { @@ -471,6 +492,16 @@ static apr_status_t proc_pthread_mutex_unref(void *mutex_) } } if (!proc_pthread_mutex_dec(mutex)) { +#ifdef USE_PTHREAD_MUTEX_COND + if (proc_pthread_mutex_cond_locked(mutex) != -1 && + (rv = pthread_cond_destroy(&proc_pthread_mutex_cond(mutex)))) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + return rv; + } +#endif /* USE_PTHREAD_MUTEX_COND */ + if ((rv = pthread_mutex_destroy(mutex->os.pthread_interproc))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; @@ -523,6 +554,9 @@ static apr_status_t proc_mutex_pthread_create(apr_proc_mutex_t *new_mutex, new_mutex->pthread_refcounting = 1; new_mutex->curr_locked = -1; /* until the mutex has been created */ +#ifdef USE_PTHREAD_MUTEX_COND + proc_pthread_mutex_cond_locked(new_mutex) = -1; +#endif if ((rv = pthread_mutexattr_init(&mattr))) { #ifdef HAVE_ZOS_PTHREADS @@ -601,64 +635,129 @@ static apr_status_t proc_mutex_pthread_child_init(apr_proc_mutex_t **mutex, static apr_status_t proc_mutex_pthread_acquire(apr_proc_mutex_t *mutex) { - apr_status_t rv; - - if ((rv = pthread_mutex_lock(mutex->os.pthread_interproc))) { -#ifdef HAVE_ZOS_PTHREADS - rv = errno; -#endif -#ifdef HAVE_PTHREAD_MUTEX_ROBUST - /* Okay, our owner died. Let's try to make it consistent again. */ - if (rv == EOWNERDEAD) { - proc_pthread_mutex_dec(mutex); - pthread_mutex_consistent_np(mutex->os.pthread_interproc); - } - else -#endif - return rv; - } - mutex->curr_locked = 1; - return APR_SUCCESS; + return proc_mutex_pthread_timedacquire(mutex, -1, 0); } static apr_status_t proc_mutex_pthread_tryacquire(apr_proc_mutex_t *mutex) +{ + return proc_mutex_pthread_timedacquire(mutex, 0, 0); +} + +static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, + apr_time_t timeout, + int absolute) { apr_status_t rv; - - if ((rv = pthread_mutex_trylock(mutex->os.pthread_interproc))) { + +#ifdef USE_PTHREAD_MUTEX_COND + if (proc_pthread_mutex_cond_locked(mutex) != -1) { + if ((rv = pthread_mutex_lock(mutex->os.pthread_interproc))) { #ifdef HAVE_ZOS_PTHREADS - rv = errno; + rv = errno; #endif - if (rv == EBUSY) { - return APR_EBUSY; - } #ifdef HAVE_PTHREAD_MUTEX_ROBUST - /* Okay, our owner died. Let's try to make it consistent again. */ - if (rv == EOWNERDEAD) { - proc_pthread_mutex_dec(mutex); - pthread_mutex_consistent_np(mutex->os.pthread_interproc); + /* Okay, our owner died. Let's try to make it consistent again. */ + if (rv == EOWNERDEAD) { + proc_pthread_mutex_dec(mutex); + pthread_mutex_consistent_np(mutex->os.pthread_interproc); + } + else +#endif + return rv; + } + + if (!proc_pthread_mutex_cond_locked(mutex)) { + proc_pthread_mutex_cond_locked(mutex) = 1; + } + else if (timeout == 0) { + rv = APR_EBUSY; } - else + else { + proc_pthread_mutex_cond_num_waiters(mutex)++; + if (timeout < 0) { + rv = pthread_cond_wait(&proc_pthread_mutex_cond(mutex), + mutex->os.pthread_interproc); +#ifdef HAVE_ZOS_PTHREADS + if (rv) { + rv = errno; + } #endif - return rv; - } - mutex->curr_locked = 1; - return APR_SUCCESS; -} + } + else { + struct timespec abstime; + if (!absolute) { + timeout += apr_time_now(); + } + abstime.tv_sec = apr_time_sec(timeout); + abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + rv = pthread_cond_timedwait(&proc_pthread_mutex_cond(mutex), + mutex->os.pthread_interproc, + &abstime); + if (rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + if (rv == ETIMEDOUT) { + rv = APR_TIMEUP; + } + } + } + proc_pthread_mutex_cond_num_waiters(mutex)--; + } + if (rv) { + pthread_mutex_unlock(mutex->os.pthread_interproc); + return rv; + } -static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute) -{ -#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK -extern int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abs_timeout); + rv = pthread_mutex_unlock(mutex->os.pthread_interproc); + if (rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; #endif - if (timeout < 0) { - return proc_mutex_pthread_acquire(mutex); + return rv; + } + } + else +#endif /* USE_PTHREAD_MUTEX_COND */ + if (timeout <= 0) { + if (timeout < 0) { + rv = pthread_mutex_lock(mutex->os.pthread_interproc); + if (rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + } + } + else { + rv = pthread_mutex_trylock(mutex->os.pthread_interproc); + if (rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + if (rv == EBUSY) { + rv = APR_EBUSY; + } + } + } + if (rv) { +#ifdef HAVE_PTHREAD_MUTEX_ROBUST + /* Okay, our owner died. Let's try to make it consistent again. */ + if (rv == EOWNERDEAD) { + proc_pthread_mutex_dec(mutex); + pthread_mutex_consistent_np(mutex->os.pthread_interproc); + } + else +#endif + return rv; + } } else { apr_status_t rv; struct timespec abstime; +#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK + extern int pthread_mutex_timedlock(pthread_mutex_t *mutex, + const struct timespec *abs_timeout); +#endif if (!absolute) { timeout += apr_time_now(); @@ -671,9 +770,6 @@ extern int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif - if (rv == ETIMEDOUT) { - return APR_TIMEUP; - } #ifdef HAVE_PTHREAD_MUTEX_ROBUST /* Okay, our owner died. Let's try to make it consistent again. */ if (rv == EOWNERDEAD) { @@ -682,9 +778,15 @@ extern int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec } else #endif - return rv; + if (rv == ETIMEDOUT) { + return APR_TIMEUP; + } + else { + return rv; + } } } + mutex->curr_locked = 1; return APR_SUCCESS; } @@ -693,6 +795,45 @@ static apr_status_t proc_mutex_pthread_release(apr_proc_mutex_t *mutex) { apr_status_t rv; +#ifdef USE_PTHREAD_MUTEX_COND + if (proc_pthread_mutex_cond_locked(mutex) != -1) { + if ((rv = pthread_mutex_lock(mutex->os.pthread_interproc))) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif +#ifdef HAVE_PTHREAD_MUTEX_ROBUST + /* Okay, our owner died. Let's try to make it consistent again. */ + if (rv == EOWNERDEAD) { + proc_pthread_mutex_dec(mutex); + pthread_mutex_consistent_np(mutex->os.pthread_interproc); + } + else +#endif + return rv; + } + + if (!proc_pthread_mutex_cond_locked(mutex)) { + rv = APR_EINVAL; + } + else if (proc_pthread_mutex_cond_num_waiters(mutex)) { + rv = pthread_cond_signal(&proc_pthread_mutex_cond(mutex)); + if (rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + } + } + else { + proc_pthread_mutex_cond_locked(mutex) = 0; + rv = APR_SUCCESS; + } + if (rv) { + pthread_mutex_unlock(mutex->os.pthread_interproc); + return rv; + } + } +#endif /* USE_PTHREAD_MUTEX_COND */ + mutex->curr_locked = 0; if ((rv = pthread_mutex_unlock(mutex->os.pthread_interproc))) { #ifdef HAVE_ZOS_PTHREADS @@ -700,6 +841,7 @@ static apr_status_t proc_mutex_pthread_release(apr_proc_mutex_t *mutex) #endif return rv; } + return APR_SUCCESS; } @@ -718,6 +860,69 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_methods = "pthread" }; +#ifdef USE_PTHREAD_MUTEX_COND +static apr_status_t proc_mutex_pthread_cond_create(apr_proc_mutex_t *new_mutex, + const char *fname) +{ + apr_status_t rv; + pthread_condattr_t cattr; + + rv = proc_mutex_pthread_create(new_mutex, fname); + if (rv != APR_SUCCESS) { + return rv; + } + + if ((rv = pthread_condattr_init(&cattr))) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + apr_pool_cleanup_run(new_mutex->pool, new_mutex, + apr_proc_mutex_cleanup); + return rv; + } + if ((rv = pthread_condattr_setpshared(&cattr, PTHREAD_PROCESS_SHARED))) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + pthread_condattr_destroy(&cattr); + apr_pool_cleanup_run(new_mutex->pool, new_mutex, + apr_proc_mutex_cleanup); + return rv; + } + if ((rv = pthread_cond_init(&proc_pthread_mutex_cond(new_mutex), + &cattr))) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + pthread_condattr_destroy(&cattr); + apr_pool_cleanup_run(new_mutex->pool, new_mutex, + apr_proc_mutex_cleanup); + return rv; + } + pthread_condattr_destroy(&cattr); + + proc_pthread_mutex_cond_locked(new_mutex) = 0; + proc_pthread_mutex_cond_num_waiters(new_mutex) = 0; + + return APR_SUCCESS; +} + +static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_cond_methods = +{ + APR_PROCESS_LOCK_MECH_IS_GLOBAL, + proc_mutex_pthread_cond_create, + proc_mutex_pthread_acquire, + proc_mutex_pthread_tryacquire, + proc_mutex_pthread_timedacquire, + proc_mutex_pthread_release, + proc_mutex_pthread_cleanup, + proc_mutex_pthread_child_init, + proc_mutex_no_perms_set, + APR_LOCK_DEFAULT_TIMED, + "default_timed" +}; +#endif + #endif #if APR_HAS_FCNTL_SERIALIZE @@ -1216,7 +1421,11 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, case APR_LOCK_DEFAULT_TIMED: #if APR_HAS_PROC_PTHREAD_SERIALIZE \ && defined(HAVE_PTHREAD_MUTEX_ROBUST) +#ifdef USE_PTHREAD_MUTEX_COND + new_mutex->meth = &mutex_proc_pthread_cond_methods; +#else new_mutex->meth = &mutex_proc_pthread_methods; +#endif #elif APR_HAS_SYSVSEM_SERIALIZE \ && defined(HAVE_SEMTIMEDOP) new_mutex->meth = &mutex_sysv_methods; diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 5c671665838..fe515b2e653 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -77,6 +77,19 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, return rv; } +#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK + if (flags & APR_THREAD_MUTEX_TIMED) { + rv = apr_thread_cond_create(&new_mutex->cond, pool); + if (rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + pthread_mutex_destroy(&new_mutex->mutex); + return rv; + } + } +#endif + apr_pool_cleanup_register(new_mutex->pool, new_mutex, thread_mutex_cleanup, apr_pool_cleanup_null); @@ -182,10 +195,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, { apr_status_t rv = APR_ENOTIMPL; -#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK -extern int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abs_timeout); -#endif - +#ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK if (timeout < 0) { rv = pthread_mutex_lock(&mutex->mutex); if (rv) { @@ -213,6 +223,55 @@ extern int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec } } } + +#else /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */ + + if (mutex->cond) { + apr_status_t rv2; + + rv = pthread_mutex_lock(&mutex->mutex); + if (rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#endif + return rv; + } + + if (mutex->locked) { + mutex->num_waiters++; + if (timeout < 0) { + rv = apr_thread_cond_wait(mutex->cond, mutex); + } + else { + if (absolute) { + apr_time_t now = apr_time_now(); + if (timeout > now) { + timeout -= now; + } + else { + timeout = 0; + } + } + rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout); + } + mutex->num_waiters--; + } + else { + mutex->locked = 1; + } + + rv2 = pthread_mutex_unlock(&mutex->mutex); + if (rv2 && !rv) { +#ifdef HAVE_ZOS_PTHREADS + rv = errno; +#else + rv = rv2; +#endif + } + } + +#endif /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */ + return rv; } From 682015d598878a1341d63f0a575f976750b5879c Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 5 Apr 2017 22:51:33 +0000 Subject: [PATCH 7682/7878] Avoid a compiler warning by using system's errno. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790331 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/misc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/locks/unix/misc.c b/locks/unix/misc.c index d7018fc3a94..8b19882eac0 100644 --- a/locks/unix/misc.c +++ b/locks/unix/misc.c @@ -19,6 +19,8 @@ #define APR_WANT_MEMFUNC #include "apr_want.h" +#include + #if APR_HAS_THREADS #if APR_HAS_SYSVSEM_SERIALIZE #if !HAVE_SEMTIMEDOP @@ -27,7 +29,6 @@ #endif #define SLEEP_TIME_NS 10000000 #define NANOSECS_PER_SEC 1000000000 -extern int errno; #ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK extern int pthread_mutex_timedlock(pthread_mutex_t * mutex, From 333496b7b963baf226da2a148c1947bd71d8e69b Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 6 Apr 2017 18:38:32 +0000 Subject: [PATCH 7683/7878] locks: follow up to r1790330. When no native timedlock is available, fall back to a common/generic spin sleep proc_mutex_spinsleep_timedacquire() based on the configured APR_USE_*_SERIALIZE trylock. Otherwise, choose the best timedlock mechanism in the following order: 1. PTHREAD if HAVE_PTHREAD_MUTEX_ROBUST && (HAVE_PTHREAD_MUTEX_TIMEDLOCK || HAVE_PTHREAD_CONDATTR_SETPSHARED) 2. SYSV if HAVE_SEMTIMEDOP 3. POSIX if HAVE_SEM_TIMEDWAIT 4. The one of APR_USE_*_SERIALIZE, hence possibly non-robust and/or spinning with the same robustness as the underlying apr_proc_mutex_trylock() call. apr_proc_mutex_timedlock() won't return ENOTIMPL anymore. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790436 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 255 ++++++++++++++++++++++++---------------- test/testprocmutex.c | 27 +++++ 2 files changed, 181 insertions(+), 101 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 8fc0bd2d993..fa68440c2f1 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -50,6 +50,56 @@ static apr_status_t proc_mutex_no_perms_set(apr_proc_mutex_t *mutex, } #endif +#if APR_HAS_FCNTL_SERIALIZE \ + || APR_HAS_FLOCK_SERIALIZE \ + || (APR_HAS_SYSVSEM_SERIALIZE \ + && !defined(HAVE_SEMTIMEDOP)) \ + || (APR_HAS_POSIXSEM_SERIALIZE \ + && !defined(HAVE_SEM_TIMEDWAIT)) \ + || (APR_HAS_PROC_PTHREAD_SERIALIZE \ + && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) \ + && !defined(HAVE_PTHREAD_CONDATTR_SETPSHARED)) +static apr_status_t proc_mutex_spinsleep_timedacquire(apr_proc_mutex_t *mutex, + apr_time_t timeout, + int absolute) +{ + apr_status_t rv; + if (absolute) { + timeout -= apr_time_now(); + if (timeout < 0) { + timeout = 0; + } + } + if (timeout < 0) { + rv = apr_proc_mutex_lock(mutex); + } + else { +#define SLEEP_TIME apr_time_from_msec(10) + for (;;) { + rv = apr_proc_mutex_trylock(mutex); + if (!APR_STATUS_IS_EBUSY(rv)) { + if (rv == APR_SUCCESS) { + mutex->curr_locked = 1; + } + break; + } + if (!timeout) { + rv = APR_TIMEUP; + break; + } + if (timeout > SLEEP_TIME) { + apr_sleep(SLEEP_TIME); + timeout -= SLEEP_TIME; + } + else { + apr_sleep(timeout); + timeout = 0; + } + } + } + return rv; +} +#endif #if APR_HAS_POSIXSEM_SERIALIZE @@ -177,13 +227,11 @@ static apr_status_t proc_mutex_posix_tryacquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } +#if defined(HAVE_SEM_TIMEDWAIT) static apr_status_t proc_mutex_posix_timedacquire(apr_proc_mutex_t *mutex, apr_time_t timeout, int absolute) { -#if !HAVE_SEM_TIMEDWAIT -extern int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout); -#endif if (timeout < 0) { return proc_mutex_posix_acquire(mutex); } @@ -210,6 +258,7 @@ extern int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout); mutex->curr_locked = 1; return APR_SUCCESS; } +#endif static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) { @@ -232,7 +281,11 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_posixsem_methods = proc_mutex_posix_create, proc_mutex_posix_acquire, proc_mutex_posix_tryacquire, +#if defined(HAVE_SEM_TIMEDWAIT) proc_mutex_posix_timedacquire, +#else + proc_mutex_spinsleep_timedacquire, +#endif proc_mutex_posix_release, proc_mutex_posix_cleanup, proc_mutex_no_child_init, @@ -331,31 +384,28 @@ static apr_status_t proc_mutex_sysv_tryacquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } +#if defined(HAVE_SEMTIMEDOP) static apr_status_t proc_mutex_sysv_timedacquire(apr_proc_mutex_t *mutex, apr_time_t timeout, int absolute) { -#if !HAVE_SEMTIMEDOP -extern int semtimedop(int semid, struct sembuf *sops, unsigned nsops, - const struct timespec *timeout); -#endif if (timeout < 0) { return proc_mutex_sysv_acquire(mutex); } else { int rc; - struct timespec abstime; + struct timespec reltime; if (absolute) { timeout -= apr_time_now(); if (timeout < 0) { return proc_mutex_sysv_tryacquire(mutex); } } - abstime.tv_sec = apr_time_sec(timeout); - abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + reltime.tv_sec = apr_time_sec(timeout); + reltime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ do { rc = semtimedop(mutex->os.crossproc, &proc_mutex_op_on, 1, - &abstime); + &reltime); } while (rc < 0 && errno == EINTR); if (rc < 0) { if (errno == EAGAIN) { @@ -367,6 +417,7 @@ extern int semtimedop(int semid, struct sembuf *sops, unsigned nsops, mutex->curr_locked = 1; return APR_SUCCESS; } +#endif static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex) { @@ -410,7 +461,11 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = proc_mutex_sysv_create, proc_mutex_sysv_acquire, proc_mutex_sysv_tryacquire, +#if defined(HAVE_SEMTIMEDOP) proc_mutex_sysv_timedacquire, +#else + proc_mutex_spinsleep_timedacquire, +#endif proc_mutex_sysv_release, proc_mutex_sysv_cleanup, proc_mutex_no_child_init, @@ -423,10 +478,10 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = #if APR_HAS_PROC_PTHREAD_SERIALIZE -#if defined(HAVE_PTHREAD_MUTEX_ROBUST) \ - && defined(HAVE_PTHREAD_CONDATTR_SETPSHARED) \ - && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) -#define USE_PTHREAD_MUTEX_COND +#ifndef APR_USE_PROC_PTHREAD_MUTEX_COND +#define APR_USE_PROC_PTHREAD_MUTEX_COND \ + (defined(HAVE_PTHREAD_CONDATTR_SETPSHARED) \ + && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK)) #endif /* The mmap()ed pthread_interproc is the native pthread_mutex_t followed @@ -440,7 +495,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = */ typedef struct { pthread_mutex_t mutex; -#ifdef USE_PTHREAD_MUTEX_COND +#if APR_USE_PROC_PTHREAD_MUTEX_COND pthread_cond_t cond; apr_int32_t cond_locked; apr_uint32_t cond_num_waiters; @@ -450,7 +505,7 @@ typedef struct { (((proc_pthread_mutex_t *)(m)->os.pthread_interproc)->cond_locked) #define proc_pthread_mutex_cond_num_waiters(m) \ (((proc_pthread_mutex_t *)(m)->os.pthread_interproc)->cond_num_waiters) -#endif /* USE_PTHREAD_MUTEX_COND */ +#endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */ apr_uint32_t refcount; } proc_pthread_mutex_t; @@ -483,6 +538,12 @@ static apr_status_t proc_pthread_mutex_unref(void *mutex_) apr_proc_mutex_t *mutex=mutex_; apr_status_t rv; +#if APR_USE_PROC_PTHREAD_MUTEX_COND + if (proc_pthread_mutex_cond_locked(mutex) != -1) { + mutex->curr_locked = 0; + } + else +#endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */ if (mutex->curr_locked == 1) { if ((rv = pthread_mutex_unlock(mutex->os.pthread_interproc))) { #ifdef HAVE_ZOS_PTHREADS @@ -492,7 +553,7 @@ static apr_status_t proc_pthread_mutex_unref(void *mutex_) } } if (!proc_pthread_mutex_dec(mutex)) { -#ifdef USE_PTHREAD_MUTEX_COND +#if APR_USE_PROC_PTHREAD_MUTEX_COND if (proc_pthread_mutex_cond_locked(mutex) != -1 && (rv = pthread_cond_destroy(&proc_pthread_mutex_cond(mutex)))) { #ifdef HAVE_ZOS_PTHREADS @@ -500,7 +561,7 @@ static apr_status_t proc_pthread_mutex_unref(void *mutex_) #endif return rv; } -#endif /* USE_PTHREAD_MUTEX_COND */ +#endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */ if ((rv = pthread_mutex_destroy(mutex->os.pthread_interproc))) { #ifdef HAVE_ZOS_PTHREADS @@ -554,7 +615,7 @@ static apr_status_t proc_mutex_pthread_create(apr_proc_mutex_t *new_mutex, new_mutex->pthread_refcounting = 1; new_mutex->curr_locked = -1; /* until the mutex has been created */ -#ifdef USE_PTHREAD_MUTEX_COND +#if APR_USE_PROC_PTHREAD_MUTEX_COND proc_pthread_mutex_cond_locked(new_mutex) = -1; #endif @@ -640,16 +701,20 @@ static apr_status_t proc_mutex_pthread_acquire(apr_proc_mutex_t *mutex) static apr_status_t proc_mutex_pthread_tryacquire(apr_proc_mutex_t *mutex) { - return proc_mutex_pthread_timedacquire(mutex, 0, 0); + apr_status_t rv = proc_mutex_pthread_timedacquire(mutex, 0, 0); + return (rv == APR_TIMEUP) ? APR_EBUSY : rv; } static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, apr_time_t timeout, int absolute) { +#if !APR_USE_PROC_PTHREAD_MUTEX_COND && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) + return proc_mutex_spinsleep_timedacquire(mutex, timeout, absolute); +#else apr_status_t rv; -#ifdef USE_PTHREAD_MUTEX_COND +#if APR_USE_PROC_PTHREAD_MUTEX_COND if (proc_pthread_mutex_cond_locked(mutex) != -1) { if ((rv = pthread_mutex_lock(mutex->os.pthread_interproc))) { #ifdef HAVE_ZOS_PTHREADS @@ -669,8 +734,8 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, if (!proc_pthread_mutex_cond_locked(mutex)) { proc_pthread_mutex_cond_locked(mutex) = 1; } - else if (timeout == 0) { - rv = APR_EBUSY; + else if (!timeout) { + rv = APR_TIMEUP; } else { proc_pthread_mutex_cond_num_waiters(mutex)++; @@ -718,8 +783,8 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, } } else -#endif /* USE_PTHREAD_MUTEX_COND */ - if (timeout <= 0) { +#endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */ + { if (timeout < 0) { rv = pthread_mutex_lock(mutex->os.pthread_interproc); if (rv) { @@ -728,48 +793,35 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, #endif } } - else { + else if (!timeout) { rv = pthread_mutex_trylock(mutex->os.pthread_interproc); if (rv) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif if (rv == EBUSY) { - rv = APR_EBUSY; + return APR_TIMEUP; } } } - if (rv) { -#ifdef HAVE_PTHREAD_MUTEX_ROBUST - /* Okay, our owner died. Let's try to make it consistent again. */ - if (rv == EOWNERDEAD) { - proc_pthread_mutex_dec(mutex); - pthread_mutex_consistent_np(mutex->os.pthread_interproc); + else { + struct timespec abstime; + if (!absolute) { + timeout += apr_time_now(); } - else -#endif - return rv; - } - } - else { - apr_status_t rv; - struct timespec abstime; -#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK - extern int pthread_mutex_timedlock(pthread_mutex_t *mutex, - const struct timespec *abs_timeout); -#endif - - if (!absolute) { - timeout += apr_time_now(); - } - abstime.tv_sec = apr_time_sec(timeout); - abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ - - if ((rv = pthread_mutex_timedlock(mutex->os.pthread_interproc, - &abstime))) { + abstime.tv_sec = apr_time_sec(timeout); + abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + rv = pthread_mutex_timedlock(mutex->os.pthread_interproc, &abstime); + if (rv) { #ifdef HAVE_ZOS_PTHREADS - rv = errno; + rv = errno; #endif + if (rv == ETIMEDOUT) { + return APR_TIMEUP; + } + } + } + if (rv) { #ifdef HAVE_PTHREAD_MUTEX_ROBUST /* Okay, our owner died. Let's try to make it consistent again. */ if (rv == EOWNERDEAD) { @@ -778,24 +830,20 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, } else #endif - if (rv == ETIMEDOUT) { - return APR_TIMEUP; - } - else { - return rv; - } + return rv; } } mutex->curr_locked = 1; return APR_SUCCESS; +#endif } static apr_status_t proc_mutex_pthread_release(apr_proc_mutex_t *mutex) { apr_status_t rv; -#ifdef USE_PTHREAD_MUTEX_COND +#if APR_USE_PROC_PTHREAD_MUTEX_COND if (proc_pthread_mutex_cond_locked(mutex) != -1) { if ((rv = pthread_mutex_lock(mutex->os.pthread_interproc))) { #ifdef HAVE_ZOS_PTHREADS @@ -832,7 +880,7 @@ static apr_status_t proc_mutex_pthread_release(apr_proc_mutex_t *mutex) return rv; } } -#endif /* USE_PTHREAD_MUTEX_COND */ +#endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */ mutex->curr_locked = 0; if ((rv = pthread_mutex_unlock(mutex->os.pthread_interproc))) { @@ -860,7 +908,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_methods = "pthread" }; -#ifdef USE_PTHREAD_MUTEX_COND +#if APR_USE_PROC_PTHREAD_MUTEX_COND static apr_status_t proc_mutex_pthread_cond_create(apr_proc_mutex_t *new_mutex, const char *fname) { @@ -918,8 +966,8 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_cond_methods proc_mutex_pthread_cleanup, proc_mutex_pthread_child_init, proc_mutex_no_perms_set, - APR_LOCK_DEFAULT_TIMED, - "default_timed" + APR_LOCK_PROC_PTHREAD, + "pthread" }; #endif @@ -1038,13 +1086,6 @@ static apr_status_t proc_mutex_fcntl_tryacquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_fcntl_timedacquire(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute) -{ - return APR_ENOTIMPL; -} - static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex) { int rc; @@ -1085,7 +1126,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_fcntl_methods = proc_mutex_fcntl_create, proc_mutex_fcntl_acquire, proc_mutex_fcntl_tryacquire, - proc_mutex_fcntl_timedacquire, + proc_mutex_spinsleep_timedacquire, proc_mutex_fcntl_release, proc_mutex_fcntl_cleanup, proc_mutex_no_child_init, @@ -1189,13 +1230,6 @@ static apr_status_t proc_mutex_flock_tryacquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_flock_timedacquire(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute) -{ - return APR_ENOTIMPL; -} - static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *mutex) { int rc; @@ -1266,7 +1300,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_flock_methods = proc_mutex_flock_create, proc_mutex_flock_acquire, proc_mutex_flock_tryacquire, - proc_mutex_flock_timedacquire, + proc_mutex_spinsleep_timedacquire, proc_mutex_flock_release, proc_mutex_flock_cleanup, proc_mutex_flock_child_init, @@ -1373,6 +1407,43 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, return APR_ENOTIMPL; #endif break; + case APR_LOCK_DEFAULT_TIMED: +#if APR_HAS_PROC_PTHREAD_SERIALIZE \ + && (APR_USE_PROC_PTHREAD_MUTEX_COND \ + || defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK)) \ + && defined(HAVE_PTHREAD_MUTEX_ROBUST) +#if APR_USE_PROC_PTHREAD_MUTEX_COND + new_mutex->meth = &mutex_proc_pthread_cond_methods; +#else + new_mutex->meth = &mutex_proc_pthread_methods; +#endif + if (ospmutex) { + if (ospmutex->pthread_interproc == NULL) { + return APR_EINVAL; + } + new_mutex->os.pthread_interproc = ospmutex->pthread_interproc; + } + break; +#elif APR_HAS_SYSVSEM_SERIALIZE && defined(HAVE_SEMTIMEDOP) + new_mutex->meth = &mutex_sysv_methods; + if (ospmutex) { + if (ospmutex->crossproc == -1) { + return APR_EINVAL; + } + new_mutex->os.crossproc = ospmutex->crossproc; + } + break; +#elif APR_HAS_POSIXSEM_SERIALIZE && defined(HAVE_SEM_TIMEDWAIT) + new_mutex->meth = &mutex_posixsem_methods; + if (ospmutex) { + if (ospmutex->psem_interproc == NULL) { + return APR_EINVAL; + } + new_mutex->os.psem_interproc = ospmutex->psem_interproc; + } + break; +#endif + /* fall trough */ case APR_LOCK_DEFAULT: #if APR_USE_FLOCK_SERIALIZE new_mutex->meth = &mutex_flock_methods; @@ -1416,24 +1487,6 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, } #else return APR_ENOTIMPL; -#endif - break; - case APR_LOCK_DEFAULT_TIMED: -#if APR_HAS_PROC_PTHREAD_SERIALIZE \ - && defined(HAVE_PTHREAD_MUTEX_ROBUST) -#ifdef USE_PTHREAD_MUTEX_COND - new_mutex->meth = &mutex_proc_pthread_cond_methods; -#else - new_mutex->meth = &mutex_proc_pthread_methods; -#endif -#elif APR_HAS_SYSVSEM_SERIALIZE \ - && defined(HAVE_SEMTIMEDOP) - new_mutex->meth = &mutex_sysv_methods; -#elif APR_HAS_POSIXSEM_SERIALIZE \ - && defined(HAVE_SEM_TIMEDWAIT) - new_mutex->meth = &mutex_posixsem_methods; -#else - return APR_ENOTIMPL; #endif break; default: diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 599d585204b..3aff25b88a7 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -20,6 +20,7 @@ #include "apr_proc_mutex.h" #include "apr_errno.h" #include "apr_general.h" +#include "apr_strings.h" #include "apr_getopt.h" #include #include @@ -155,6 +156,19 @@ static void test_exclusive(abts_case *tc, const char *lockname, else { APR_ASSERT_SUCCESS(tc, "check for trylock", rv); + for (n = 0; n < 2; n++) { + rv = apr_proc_mutex_trylock(proc_lock); + /* Some mech (eg. flock or fcntl) may succeed when the + * lock is re-acquired in the same process. + */ + if (rv != APR_SUCCESS) { + ABTS_ASSERT(tc, + apr_psprintf(p, "%s_trylock() should be busy => %pm", + mech->name, &rv), + APR_STATUS_IS_EBUSY(rv)); + } + } + rv = apr_proc_mutex_unlock(proc_lock); APR_ASSERT_SUCCESS(tc, "unlock after trylock check", rv); @@ -179,6 +193,19 @@ static void test_exclusive(abts_case *tc, const char *lockname, else { APR_ASSERT_SUCCESS(tc, "check for timedlock", rv); + for (n = 0; n < 2; n++) { + rv = apr_proc_mutex_timedlock(proc_lock, 1, 0); + /* Some mech (eg. flock or fcntl) may succeed when the + * lock is re-acquired in the same process. + */ + if (rv != APR_SUCCESS) { + ABTS_ASSERT(tc, + apr_psprintf(p, "%s_timedlock() should time out => %pm", + mech->name, &rv), + APR_STATUS_IS_TIMEUP(rv)); + } + } + rv = apr_proc_mutex_unlock(proc_lock); APR_ASSERT_SUCCESS(tc, "unlock after timedlock check", rv); From a40fd8526f361c3aaf83fbe3b53c854497342170 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 6 Apr 2017 19:13:54 +0000 Subject: [PATCH 7684/7878] locks: follow up to r1790330 and r1790436. unix/misc.c is not needed anymore since we use apr_proc_mutex_trylock() directly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790439 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/misc.c | 194 ---------------------------------------------- 1 file changed, 194 deletions(-) delete mode 100644 locks/unix/misc.c diff --git a/locks/unix/misc.c b/locks/unix/misc.c deleted file mode 100644 index 8b19882eac0..00000000000 --- a/locks/unix/misc.c +++ /dev/null @@ -1,194 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "apr_private.h" -#include "apr_arch_thread_mutex.h" -#define APR_WANT_MEMFUNC -#include "apr_want.h" - -#include - -#if APR_HAS_THREADS -#if APR_HAS_SYSVSEM_SERIALIZE -#if !HAVE_SEMTIMEDOP -#include -#endif -#endif -#define SLEEP_TIME_NS 10000000 -#define NANOSECS_PER_SEC 1000000000 - -#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK -extern int pthread_mutex_timedlock(pthread_mutex_t * mutex, - const struct timespec *abs_timeout); -/* - * A pthread_mutex_timedlock() impl for OSX/macOS, which lacks the - * real thing. - * NOTE: Unlike the real McCoy, won't return EOWNERDEAD, EDEADLK - * or EOWNERDEAD - */ -int pthread_mutex_timedlock(pthread_mutex_t * mutex, - const struct timespec *abs_timeout) -{ - int rv; - struct timespec remaining, ts, tod; - apr_time_t now; - - remaining = *abs_timeout; - now = apr_time_now(); - tod.tv_sec = apr_time_sec(now); - tod.tv_nsec = apr_time_usec(now) * 1000; /* nanoseconds */ - - remaining.tv_sec -= tod.tv_sec; - if (tod.tv_nsec <= remaining.tv_nsec) { - remaining.tv_nsec -= tod.tv_nsec; - } - else { - remaining.tv_sec--; - remaining.tv_nsec = - (NANOSECS_PER_SEC - (tod.tv_nsec - remaining.tv_nsec)); - } - /* If we had a REALLY small timeout ;) */ - if (remaining.tv_sec < 0) { - return ETIMEDOUT; - } - while ((rv = pthread_mutex_trylock(mutex)) == EBUSY) { - ts.tv_sec = 0; - ts.tv_nsec = (remaining.tv_sec > 0 ? SLEEP_TIME_NS : - (remaining.tv_nsec < - SLEEP_TIME_NS ? remaining.tv_nsec : SLEEP_TIME_NS)); - nanosleep(&ts, &ts); - if (ts.tv_nsec <= remaining.tv_nsec) { - remaining.tv_nsec -= ts.tv_nsec; - } - else { - remaining.tv_sec--; - remaining.tv_nsec = - (NANOSECS_PER_SEC - (ts.tv_nsec - remaining.tv_nsec)); - } - if (remaining.tv_sec < 0 - || (!remaining.tv_sec && remaining.tv_nsec <= SLEEP_TIME_NS)) { - return ETIMEDOUT; - } - } - - return rv; -} -#endif /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */ - -#if APR_HAS_POSIXSEM_SERIALIZE -#if !HAVE_SEM_TIMEDWAIT -extern int sem_timedwait(sem_t * sem, const struct timespec *abs_timeout); -/* - * A sem_timedwait() impl for OSX/macOS, which lacks the - * real thing. - */ -int sem_timedwait(sem_t * sem, const struct timespec *abs_timeout) -{ - int rv; - struct timespec remaining, ts, tod; - apr_time_t now; - - remaining = *abs_timeout; - now = apr_time_now(); - tod.tv_sec = apr_time_sec(now); - tod.tv_nsec = apr_time_usec(now) * 1000; /* nanoseconds */ - - remaining.tv_sec -= tod.tv_sec; - if (tod.tv_nsec <= remaining.tv_nsec) { - remaining.tv_nsec -= tod.tv_nsec; - } - else { - remaining.tv_sec--; - remaining.tv_nsec = - (NANOSECS_PER_SEC - (tod.tv_nsec - remaining.tv_nsec)); - } - /* If we had a REALLY small timeout ;) */ - if (remaining.tv_sec < 0) { - return ETIMEDOUT; - } - errno = 0; - while (((rv = sem_trywait(sem)) != 0) && (errno == EAGAIN)) { - ts.tv_sec = 0; - ts.tv_nsec = (remaining.tv_sec > 0 ? SLEEP_TIME_NS : - (remaining.tv_nsec < - SLEEP_TIME_NS ? remaining.tv_nsec : SLEEP_TIME_NS)); - nanosleep(&ts, &ts); - if (ts.tv_nsec <= remaining.tv_nsec) { - remaining.tv_nsec -= ts.tv_nsec; - } - else { - remaining.tv_sec--; - remaining.tv_nsec = - (NANOSECS_PER_SEC - (ts.tv_nsec - remaining.tv_nsec)); - } - if (remaining.tv_sec < 0 - || (!remaining.tv_sec && remaining.tv_nsec <= SLEEP_TIME_NS)) { - return ETIMEDOUT; - } - } - return rv; -} -#endif /* HAVE_SEM_TIMEDWAIT */ -#endif /* APR_HAS_POSIXSEM_SERIALIZE */ - -#if APR_HAS_SYSVSEM_SERIALIZE -#if !HAVE_SEMTIMEDOP -extern int semtimedop(int semid, struct sembuf *sops, unsigned nsops, - const struct timespec *timeout); -/* - * A semtimedop() impl for OSX/macOS, which lacks the - * real thing. - */ -int semtimedop(int semid, struct sembuf *sops, unsigned nsops, - const struct timespec *timeout) -{ - int rv; - struct timespec remaining, ts; - struct sembuf proc_mutex_op_try; - - proc_mutex_op_try.sem_num = 0; - proc_mutex_op_try.sem_op = -1; - proc_mutex_op_try.sem_flg = SEM_UNDO | IPC_NOWAIT; - - remaining = *timeout; - errno = 0; - while (((rv = semop(semid, &proc_mutex_op_try, nsops)) != 0) - && (errno == EAGAIN)) { - ts.tv_sec = 0; - ts.tv_nsec = (remaining.tv_sec > 0 ? SLEEP_TIME_NS : - (remaining.tv_nsec < - SLEEP_TIME_NS ? remaining.tv_nsec : SLEEP_TIME_NS)); - nanosleep(&ts, &ts); - if (ts.tv_nsec <= remaining.tv_nsec) { - remaining.tv_nsec -= ts.tv_nsec; - } - else { - remaining.tv_sec--; - remaining.tv_nsec = - (NANOSECS_PER_SEC - (ts.tv_nsec - remaining.tv_nsec)); - } - if (remaining.tv_sec < 0 - || (!remaining.tv_sec && remaining.tv_nsec <= SLEEP_TIME_NS)) { - return ETIMEDOUT; - } - } - return rv; -} -#endif /* HAVE_SEMTIMEDOP */ -#endif /* APR_HAS_SYSVSEM_SERIALIZE */ - - -#endif /* APR_HAS_THREADS */ From f513c250341a7287e444727b173086fbe2405b6e Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 6 Apr 2017 19:53:50 +0000 Subject: [PATCH 7685/7878] locks: follow up to r1790330. No functional change, more helpers/macros to help identify struct proc_pthread_mutex_t members. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790444 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 52 ++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index fa68440c2f1..4ad6c412e8e 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -494,23 +494,27 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = * destroy it. */ typedef struct { +#define proc_pthread_cast(m) \ + ((proc_pthread_mutex_t *)(m)->os.pthread_interproc) pthread_mutex_t mutex; +#define proc_pthread_mutex(m) \ + (proc_pthread_cast(m)->mutex) #if APR_USE_PROC_PTHREAD_MUTEX_COND pthread_cond_t cond; - apr_int32_t cond_locked; - apr_uint32_t cond_num_waiters; #define proc_pthread_mutex_cond(m) \ - (((proc_pthread_mutex_t *)(m)->os.pthread_interproc)->cond) + (proc_pthread_cast(m)->cond) + apr_int32_t cond_locked; #define proc_pthread_mutex_cond_locked(m) \ - (((proc_pthread_mutex_t *)(m)->os.pthread_interproc)->cond_locked) + (proc_pthread_cast(m)->cond_locked) + apr_uint32_t cond_num_waiters; #define proc_pthread_mutex_cond_num_waiters(m) \ - (((proc_pthread_mutex_t *)(m)->os.pthread_interproc)->cond_num_waiters) + (proc_pthread_cast(m)->cond_num_waiters) #endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */ apr_uint32_t refcount; +#define proc_pthread_mutex_refcount(m) \ + (proc_pthread_cast(m)->refcount) } proc_pthread_mutex_t; -#define proc_pthread_mutex_refcount(m) \ - (((proc_pthread_mutex_t *)(m)->os.pthread_interproc)->refcount) static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, apr_time_t timeout, @@ -545,7 +549,7 @@ static apr_status_t proc_pthread_mutex_unref(void *mutex_) else #endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */ if (mutex->curr_locked == 1) { - if ((rv = pthread_mutex_unlock(mutex->os.pthread_interproc))) { + if ((rv = pthread_mutex_unlock(&proc_pthread_mutex(mutex)))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif @@ -563,7 +567,7 @@ static apr_status_t proc_pthread_mutex_unref(void *mutex_) } #endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */ - if ((rv = pthread_mutex_destroy(mutex->os.pthread_interproc))) { + if ((rv = pthread_mutex_destroy(&proc_pthread_mutex(mutex)))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif @@ -655,7 +659,7 @@ static apr_status_t proc_mutex_pthread_create(apr_proc_mutex_t *new_mutex, } #endif /* HAVE_PTHREAD_MUTEX_ROBUST */ - if ((rv = pthread_mutex_init(new_mutex->os.pthread_interproc, &mattr))) { + if ((rv = pthread_mutex_init(&proc_pthread_mutex(new_mutex), &mattr))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif @@ -716,7 +720,7 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, #if APR_USE_PROC_PTHREAD_MUTEX_COND if (proc_pthread_mutex_cond_locked(mutex) != -1) { - if ((rv = pthread_mutex_lock(mutex->os.pthread_interproc))) { + if ((rv = pthread_mutex_lock(&proc_pthread_mutex(mutex)))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif @@ -724,7 +728,7 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, /* Okay, our owner died. Let's try to make it consistent again. */ if (rv == EOWNERDEAD) { proc_pthread_mutex_dec(mutex); - pthread_mutex_consistent_np(mutex->os.pthread_interproc); + pthread_mutex_consistent_np(&proc_pthread_mutex(mutex)); } else #endif @@ -741,7 +745,7 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, proc_pthread_mutex_cond_num_waiters(mutex)++; if (timeout < 0) { rv = pthread_cond_wait(&proc_pthread_mutex_cond(mutex), - mutex->os.pthread_interproc); + &proc_pthread_mutex(mutex)); #ifdef HAVE_ZOS_PTHREADS if (rv) { rv = errno; @@ -756,7 +760,7 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, abstime.tv_sec = apr_time_sec(timeout); abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ rv = pthread_cond_timedwait(&proc_pthread_mutex_cond(mutex), - mutex->os.pthread_interproc, + &proc_pthread_mutex(mutex), &abstime); if (rv) { #ifdef HAVE_ZOS_PTHREADS @@ -770,11 +774,11 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, proc_pthread_mutex_cond_num_waiters(mutex)--; } if (rv) { - pthread_mutex_unlock(mutex->os.pthread_interproc); + pthread_mutex_unlock(&proc_pthread_mutex(mutex)); return rv; } - rv = pthread_mutex_unlock(mutex->os.pthread_interproc); + rv = pthread_mutex_unlock(&proc_pthread_mutex(mutex)); if (rv) { #ifdef HAVE_ZOS_PTHREADS rv = errno; @@ -786,7 +790,7 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, #endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */ { if (timeout < 0) { - rv = pthread_mutex_lock(mutex->os.pthread_interproc); + rv = pthread_mutex_lock(&proc_pthread_mutex(mutex)); if (rv) { #ifdef HAVE_ZOS_PTHREADS rv = errno; @@ -794,7 +798,7 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, } } else if (!timeout) { - rv = pthread_mutex_trylock(mutex->os.pthread_interproc); + rv = pthread_mutex_trylock(&proc_pthread_mutex(mutex)); if (rv) { #ifdef HAVE_ZOS_PTHREADS rv = errno; @@ -811,7 +815,7 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, } abstime.tv_sec = apr_time_sec(timeout); abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ - rv = pthread_mutex_timedlock(mutex->os.pthread_interproc, &abstime); + rv = pthread_mutex_timedlock(&proc_pthread_mutex(mutex), &abstime); if (rv) { #ifdef HAVE_ZOS_PTHREADS rv = errno; @@ -826,7 +830,7 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, /* Okay, our owner died. Let's try to make it consistent again. */ if (rv == EOWNERDEAD) { proc_pthread_mutex_dec(mutex); - pthread_mutex_consistent_np(mutex->os.pthread_interproc); + pthread_mutex_consistent_np(&proc_pthread_mutex(mutex)); } else #endif @@ -845,7 +849,7 @@ static apr_status_t proc_mutex_pthread_release(apr_proc_mutex_t *mutex) #if APR_USE_PROC_PTHREAD_MUTEX_COND if (proc_pthread_mutex_cond_locked(mutex) != -1) { - if ((rv = pthread_mutex_lock(mutex->os.pthread_interproc))) { + if ((rv = pthread_mutex_lock(&proc_pthread_mutex(mutex)))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif @@ -853,7 +857,7 @@ static apr_status_t proc_mutex_pthread_release(apr_proc_mutex_t *mutex) /* Okay, our owner died. Let's try to make it consistent again. */ if (rv == EOWNERDEAD) { proc_pthread_mutex_dec(mutex); - pthread_mutex_consistent_np(mutex->os.pthread_interproc); + pthread_mutex_consistent_np(&proc_pthread_mutex(mutex)); } else #endif @@ -876,14 +880,14 @@ static apr_status_t proc_mutex_pthread_release(apr_proc_mutex_t *mutex) rv = APR_SUCCESS; } if (rv) { - pthread_mutex_unlock(mutex->os.pthread_interproc); + pthread_mutex_unlock(&proc_pthread_mutex(mutex)); return rv; } } #endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */ mutex->curr_locked = 0; - if ((rv = pthread_mutex_unlock(mutex->os.pthread_interproc))) { + if ((rv = pthread_mutex_unlock(&proc_pthread_mutex(mutex)))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif From 75625947f5af58ff7507c2e65ea1bb4d54309f01 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 6 Apr 2017 19:57:33 +0000 Subject: [PATCH 7686/7878] locks: follow up to r1790330. Don't try to access proc_pthread_mutex_t's condvar if the mutex was _put[_ex]() and not _create()d, this is a real pthread_mutex_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790446 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 4ad6c412e8e..435adc9cd49 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -505,7 +505,7 @@ typedef struct { (proc_pthread_cast(m)->cond) apr_int32_t cond_locked; #define proc_pthread_mutex_cond_locked(m) \ - (proc_pthread_cast(m)->cond_locked) + ((m)->pthread_refcounting ? proc_pthread_cast(m)->cond_locked : -1) apr_uint32_t cond_num_waiters; #define proc_pthread_mutex_cond_num_waiters(m) \ (proc_pthread_cast(m)->cond_num_waiters) From e7459ef64345bdde7adf870786104d055438107b Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 7 Apr 2017 00:01:16 +0000 Subject: [PATCH 7687/7878] locks: follow up to r1667900. Axe the 'absolute' argument of apr_{thread,proc,global}_mutex_timedlock() which was confusing, hence 'timeout' is always relative now. It still makes sense (to me) to handle a negative timeout as INFINITE, a nul one as IMMEDIATE, and a positive one as an upper bound timeout (like most if not all of the underlying system calls...). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790488 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_global_mutex.h | 6 +-- include/apr_proc_mutex.h | 6 +-- include/apr_thread_mutex.h | 6 +-- include/arch/unix/apr_arch_proc_mutex.h | 2 +- locks/beos/proc_mutex.c | 27 +++-------- locks/beos/thread_mutex.c | 27 +++-------- locks/netware/proc_mutex.c | 5 +- locks/netware/thread_mutex.c | 26 +++++----- locks/os2/proc_mutex.c | 23 +++------ locks/os2/thread_mutex.c | 26 +++------- locks/unix/global_mutex.c | 21 ++++---- locks/unix/proc_mutex.c | 64 +++++++++++-------------- locks/unix/thread_mutex.c | 59 +++++++++++++---------- locks/win32/proc_mutex.c | 12 +---- locks/win32/thread_mutex.c | 12 +---- test/testlock.c | 4 +- test/testlockperf.c | 2 +- test/testprocmutex.c | 6 +-- 18 files changed, 128 insertions(+), 206 deletions(-) diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index f6deb8d17eb..183f31083f2 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -114,12 +114,10 @@ APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex); * Attempt to acquire the lock for the given mutex until timeout expires. * If the acquisition time outs, the call returns with APR_TIMEUP. * @param mutex the mutex on which to attempt the lock acquiring. - * @param timeout the absolute time or relative timeout (microseconds) - * @param absolute whether the timeout given is absolute (!0) or relative (0) + * @param timeout the relative timeout (microseconds) */ APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex, - apr_time_t timeout, - int absolute); + apr_time_t timeout); /** * Release the lock for the given mutex. diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index 15312b2bdbd..4c0f92bc0a0 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -119,12 +119,10 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex); * Attempt to acquire the lock for the given mutex until timeout expires. * If the acquisition time outs, the call returns with APR_TIMEUP. * @param mutex the mutex on which to attempt the lock acquiring. - * @param timeout the absolute time or relative timeout (microseconds) - * @param absolute whether the timeout given is absolute (!0) or relative (0) + * @param timeout the relative timeout (microseconds) */ APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute); + apr_time_t timeout); /** * Release the lock for the given mutex. diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 5dd729d0768..efc62f65a20 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -87,12 +87,10 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex); * Attempt to acquire the lock for the given mutex until timeout expires. * If the acquisition time outs, the call returns with APR_TIMEUP. * @param mutex the mutex on which to attempt the lock acquiring. - * @param timeout the absolute time or relative timeout (microseconds) - * @param absolute whether the timeout given is absolute (!0) or relative (0) + * @param timeout the relative timeout (microseconds) */ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, - apr_time_t timeout, - int absolute); + apr_time_t timeout); /** * Release the lock for the given mutex. diff --git a/include/arch/unix/apr_arch_proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h index 9988248471a..86aaab5dc0a 100644 --- a/include/arch/unix/apr_arch_proc_mutex.h +++ b/include/arch/unix/apr_arch_proc_mutex.h @@ -70,7 +70,7 @@ struct apr_proc_mutex_unix_lock_methods_t { apr_status_t (*create)(apr_proc_mutex_t *, const char *); apr_status_t (*acquire)(apr_proc_mutex_t *); apr_status_t (*tryacquire)(apr_proc_mutex_t *); - apr_status_t (*timedacquire)(apr_proc_mutex_t *, apr_time_t, int); + apr_status_t (*timedacquire)(apr_proc_mutex_t *, apr_time_t); apr_status_t (*release)(apr_proc_mutex_t *); apr_status_t (*cleanup)(void *); apr_status_t (*child_init)(apr_proc_mutex_t **, apr_pool_t *, const char *); diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index 1b468714cff..dba07c0a593 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -109,33 +109,20 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { int32 stat; if (atomic_add(&mutex->LockCount, 1) > 0) { - if (timeout < 0) { + if (!timeout) { + stat = B_TIMED_OUT; + } + else if (timeout < 0) { stat = acquire_sem(mutex->Lock); } else { - int flag = 0; - if (timeout > 0) { - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; - } - else { - timeout = 0; - } - flag = B_ABSOLUTE_TIMEOUT; - } - else { - flag = B_RELATIVE_TIMEOUT; - } - } - stat = acquire_sem_etc(mutex->Lock, 1, flag, timeout); + stat = acquire_sem_etc(mutex->Lock, 1, B_RELATIVE_TIMEOUT, + timeout); } if (stat < B_NO_ERROR) { atomic_add(&mutex->LockCount, -1); diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index 2fa1bc70b2d..62e81319e13 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -132,8 +132,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { int32 stat; thread_id me = find_thread(NULL); @@ -144,27 +143,15 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, } if (atomic_add(&mutex->LockCount, 1) > 0) { - if (timeout < 0) { + if (!timeout) { + stat = B_TIMED_OUT; + } + else if (timeout < 0) { stat = acquire_sem(mutex->Lock); } else { - int flag = 0; - if (timeout > 0) { - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; - } - else { - timeout = 0; - } - flag = B_ABSOLUTE_TIMEOUT; - } - else { - flag = B_RELATIVE_TIMEOUT; - } - } - stat = acquire_sem_etc(mutex->Lock, 1, flag, timeout); + stat = acquire_sem_etc(mutex->Lock, 1, B_RELATIVE_TIMEOUT, + timeout); } if (stat < B_NO_ERROR) { atomic_add(&mutex->LockCount, -1); diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 231f242b459..01cd7cfec23 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -73,11 +73,10 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { if (mutex) - return apr_thread_mutex_timedlock(mutex->mutex, timeout, absolute); + return apr_thread_mutex_timedlock(mutex->mutex, timeout); return APR_ENOLOCK; } diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index c634edfac10..ecb0112f444 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -112,30 +112,26 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { if (mutex->cond) { apr_status_t rv; NXLock(mutex->mutex); if (mutex->locked) { - mutex->num_waiters++; - if (timeout < 0) { - rv = apr_thread_cond_wait(mutex->cond, mutex); + if (!timeout) { + rv = APR_TIMEUP; } else { - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; - } - else { - timeout = 0; - } + mutex->num_waiters++; + if (timeout < 0) { + rv = apr_thread_cond_wait(mutex->cond, mutex); + } + else { + rv = apr_thread_cond_timedwait(mutex->cond, mutex, + timeout); } - rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout); + mutex->num_waiters--; } - mutex->num_waiters--; } else { mutex->locked = 1; diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 847f775da71..2fe75afa023 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -156,35 +156,24 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) mutex->lock_count++; } - return APR_FROM_OS_ERROR(rc); + return (rc == ERROR_TIMEOUT) ? APR_EBUSY : APR_FROM_OS_ERROR(rc); } APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { ULONG rc; if (timeout < 0) { rc = DosRequestMutexSem(mutex->hMutex, SEM_INDEFINITE_WAIT); } + else if (!timeout) { + rc = DosRequestMutexSem(mutex->hMutex, SEM_IMMEDIATE_RETURN); + } else { - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; - } - else { - timeout = 0; - } - } - rc = DosRequestMutexSem(mutex->hMutex, apr_time_as_msec(timeout)); - if (rc == ERROR_TIMEOUT) { - return APR_TIMEUP; - } } if (rc == 0) { @@ -192,7 +181,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, mutex->lock_count++; } - return APR_FROM_OS_ERROR(rc); + return (rc == ERROR_TIMEOUT) ? APR_TIMEUP : APR_FROM_OS_ERROR(rc); } diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index fa2d2c1f667..fa79ee7a4f9 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -67,41 +67,27 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { ULONG rc = DosRequestMutexSem(mutex->hMutex, SEM_IMMEDIATE_RETURN); - if (rc == ERROR_TIMEOUT) { - return APR_EBUSY; - } - - return APR_FROM_OS_ERROR(rc); + return (rc == ERROR_TIMEOUT) ? APR_EBUSY : APR_FROM_OS_ERROR(rc); } APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { ULONG rc; if (timeout < 0) { rc = DosRequestMutexSem(mutex->hMutex, SEM_INDEFINITE_WAIT); } + else if (!timeout) { + rc = DosRequestMutexSem(mutex->hMutex, SEM_IMMEDIATE_RETURN); + } else { - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; - } - else { - timeout = 0; - } - } rc = DosRequestMutexSem(mutex->hMutex, apr_time_as_msec(timeout)); - if (rc == ERROR_TIMEOUT) { - return APR_TIMEUP; - } } - return APR_FROM_OS_ERROR(rc); + return (rc == ERROR_TIMEOUT) ? APR_TIMEUP : APR_FROM_OS_ERROR(rc); } diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index b343e23ad7e..9aa213eb26b 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -143,27 +143,30 @@ APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { apr_status_t rv; #if APR_HAS_THREADS if (mutex->thread_mutex) { - if (timeout >= 0 && !absolute) { - timeout += apr_time_now(); - absolute = 1; + apr_time_t expiry = 0; + if (timeout > 0) { + expiry = apr_time_now() + timeout; } - rv = apr_thread_mutex_timedlock(mutex->thread_mutex, timeout, - absolute); + rv = apr_thread_mutex_timedlock(mutex->thread_mutex, timeout); if (rv != APR_SUCCESS) { return rv; } + if (expiry) { + timeout = expiry - apr_time_now(); + if (timeout < 0) { + timeout = 0; + } + } } #endif /* APR_HAS_THREADS */ - rv = apr_proc_mutex_timedlock(mutex->proc_mutex, timeout, - absolute); + rv = apr_proc_mutex_timedlock(mutex->proc_mutex, timeout); #if APR_HAS_THREADS if (rv != APR_SUCCESS) { diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 435adc9cd49..b181da5a600 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -60,16 +60,9 @@ static apr_status_t proc_mutex_no_perms_set(apr_proc_mutex_t *mutex, && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) \ && !defined(HAVE_PTHREAD_CONDATTR_SETPSHARED)) static apr_status_t proc_mutex_spinsleep_timedacquire(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { apr_status_t rv; - if (absolute) { - timeout -= apr_time_now(); - if (timeout < 0) { - timeout = 0; - } - } if (timeout < 0) { rv = apr_proc_mutex_lock(mutex); } @@ -229,19 +222,20 @@ static apr_status_t proc_mutex_posix_tryacquire(apr_proc_mutex_t *mutex) #if defined(HAVE_SEM_TIMEDWAIT) static apr_status_t proc_mutex_posix_timedacquire(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { if (timeout < 0) { return proc_mutex_posix_acquire(mutex); } + else if (!timeout) { + apr_status_t rv = proc_mutex_posix_tryacquire(mutex); + return (rv == APR_EBUSY) ? APR_TIMEUP : rv; + } else { int rc; struct timespec abstime; - if (!absolute) { - timeout += apr_time_now(); - } + timeout += apr_time_now(); abstime.tv_sec = apr_time_sec(timeout); abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ @@ -386,23 +380,22 @@ static apr_status_t proc_mutex_sysv_tryacquire(apr_proc_mutex_t *mutex) #if defined(HAVE_SEMTIMEDOP) static apr_status_t proc_mutex_sysv_timedacquire(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { if (timeout < 0) { return proc_mutex_sysv_acquire(mutex); } + else if (!timeout) { + apr_status_t rv = proc_mutex_sysv_tryacquire(mutex); + return (rv == APR_EBUSY) ? APR_TIMEUP : rv; + } else { int rc; struct timespec reltime; - if (absolute) { - timeout -= apr_time_now(); - if (timeout < 0) { - return proc_mutex_sysv_tryacquire(mutex); - } - } + reltime.tv_sec = apr_time_sec(timeout); reltime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + do { rc = semtimedop(mutex->os.crossproc, &proc_mutex_op_on, 1, &reltime); @@ -517,8 +510,7 @@ typedef struct { static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute); + apr_time_t timeout); static APR_INLINE int proc_pthread_mutex_inc(apr_proc_mutex_t *mutex) { @@ -700,21 +692,20 @@ static apr_status_t proc_mutex_pthread_child_init(apr_proc_mutex_t **mutex, static apr_status_t proc_mutex_pthread_acquire(apr_proc_mutex_t *mutex) { - return proc_mutex_pthread_timedacquire(mutex, -1, 0); + return proc_mutex_pthread_timedacquire(mutex, -1); } static apr_status_t proc_mutex_pthread_tryacquire(apr_proc_mutex_t *mutex) { - apr_status_t rv = proc_mutex_pthread_timedacquire(mutex, 0, 0); + apr_status_t rv = proc_mutex_pthread_timedacquire(mutex, 0); return (rv == APR_TIMEUP) ? APR_EBUSY : rv; } static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { #if !APR_USE_PROC_PTHREAD_MUTEX_COND && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) - return proc_mutex_spinsleep_timedacquire(mutex, timeout, absolute); + return proc_mutex_spinsleep_timedacquire(mutex, timeout); #else apr_status_t rv; @@ -754,11 +745,11 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, } else { struct timespec abstime; - if (!absolute) { - timeout += apr_time_now(); - } + + timeout += apr_time_now(); abstime.tv_sec = apr_time_sec(timeout); abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + rv = pthread_cond_timedwait(&proc_pthread_mutex_cond(mutex), &proc_pthread_mutex(mutex), &abstime); @@ -810,11 +801,11 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, } else { struct timespec abstime; - if (!absolute) { - timeout += apr_time_now(); - } + + timeout += apr_time_now(); abstime.tv_sec = apr_time_sec(timeout); abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + rv = pthread_mutex_timedlock(&proc_pthread_mutex(mutex), &abstime); if (rv) { #ifdef HAVE_ZOS_PTHREADS @@ -1564,10 +1555,9 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { - return mutex->meth->timedacquire(mutex, timeout, absolute); + return mutex->meth->timedacquire(mutex, timeout); } APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index fe515b2e653..be2d86586a6 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -190,26 +190,34 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { apr_status_t rv = APR_ENOTIMPL; #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK if (timeout < 0) { rv = pthread_mutex_lock(&mutex->mutex); +#ifdef HAVE_ZOS_PTHREADS + if (rv) { + rv = errno; + } +#endif + } + else if (!timeout) { + rv = pthread_mutex_trylock(&mutex->mutex); if (rv) { #ifdef HAVE_ZOS_PTHREADS rv = errno; #endif + if (rv == EBUSY) { + rv = APR_TIMEUP; + } } } else { struct timespec abstime; - if (!absolute) { - timeout += apr_time_now(); - } + timeout += apr_time_now(); abstime.tv_sec = apr_time_sec(timeout); abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ @@ -227,8 +235,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, #else /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */ if (mutex->cond) { - apr_status_t rv2; - rv = pthread_mutex_lock(&mutex->mutex); if (rv) { #ifdef HAVE_ZOS_PTHREADS @@ -238,35 +244,40 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, } if (mutex->locked) { - mutex->num_waiters++; - if (timeout < 0) { - rv = apr_thread_cond_wait(mutex->cond, mutex); + if (!timeout) { + rv = APR_TIMEUP; } else { - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; - } - else { - timeout = 0; - } + mutex->num_waiters++; + if (timeout < 0) { + rv = apr_thread_cond_wait(mutex->cond, mutex); + } + else { + rv = apr_thread_cond_timedwait(mutex->cond, mutex, + timeout); } - rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout); +#ifdef HAVE_ZOS_PTHREADS + if (rv) { + rv = errno; + } +#endif + mutex->num_waiters--; } - mutex->num_waiters--; } else { mutex->locked = 1; } + if (rv) { + pthread_mutex_unlock(&mutex->mutex); + return rv; + } - rv2 = pthread_mutex_unlock(&mutex->mutex); - if (rv2 && !rv) { + rv = pthread_mutex_unlock(&mutex->mutex); + if (rv) { #ifdef HAVE_ZOS_PTHREADS rv = errno; -#else - rv = rv2; #endif + return rv; } } diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index b51f856c009..7c3df23dc46 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -165,8 +165,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { DWORD rv; @@ -174,15 +173,6 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, rv = WaitForSingleObject(mutex->handle, INFINITE); } else { - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; - } - else { - timeout = 0; - } - } rv = WaitForSingleObject(mutex->handle, apr_time_as_msec(timeout)); if (rv == WAIT_TIMEOUT) { return APR_TIMEUP; diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index cd0ccf5ba5b..05dc3d5fb4a 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -115,8 +115,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, - apr_time_t timeout, - int absolute) + apr_time_t timeout) { if (mutex->type != thread_mutex_critical_section) { DWORD rv, timeout_ms; @@ -124,15 +123,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, timeout_ms = INFINITE; } else { - if (absolute) { - apr_time_t now = apr_time_now(); - if (timeout > now) { - timeout -= now; - } - else { - timeout = 0; - } - } timeout_ms = apr_time_as_msec(timeout); } rv = WaitForSingleObject(mutex->handle, timeout_ms); diff --git a/test/testlock.c b/test/testlock.c index 45eddb02e56..095134e05a6 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -91,7 +91,7 @@ static void *APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data while (1) { if (data) { - apr_thread_mutex_timedlock(thread_mutex, *(apr_time_t *)data, 0); + apr_thread_mutex_timedlock(thread_mutex, *(apr_time_t *)data); } else { apr_thread_mutex_lock(thread_mutex); @@ -358,7 +358,7 @@ static void test_timeoutmutex(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, 0, apr_thread_mutex_lock(timeout_mutex)); for (i = 0; i < MAX_RETRY; i++) { begin = apr_time_now(); - s = apr_thread_mutex_timedlock(timeout_mutex, timeout, 0); + s = apr_thread_mutex_timedlock(timeout_mutex, timeout); end = apr_time_now(); if (s != APR_SUCCESS && !APR_STATUS_IS_TIMEUP(s)) { diff --git a/test/testlockperf.c b/test/testlockperf.c index 10442710d84..c91f1a87bc8 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -61,7 +61,7 @@ void * APR_THREAD_FUNC thread_mutex_func(apr_thread_t *thd, void *data) for (i = 0; i < max_counter; i++) { if (data) { - apr_thread_mutex_timedlock(thread_lock, *(apr_time_t *)data, 0); + apr_thread_mutex_timedlock(thread_lock, *(apr_time_t *)data); } else { apr_thread_mutex_lock(thread_lock); diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 3aff25b88a7..983aa953a00 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -88,7 +88,7 @@ static void make_child(abts_case *tc, int trylock, apr_proc_t **proc, apr_pool_t else if (trylock < 0) { int wait_usec = 0; - while ((rv = apr_proc_mutex_timedlock(proc_lock, 1, 0))) { + while ((rv = apr_proc_mutex_timedlock(proc_lock, 1))) { if (!APR_STATUS_IS_TIMEUP(rv)) exit(1); if (++wait_usec >= MAX_WAIT_USEC) @@ -184,7 +184,7 @@ static void test_exclusive(abts_case *tc, const char *lockname, *x == MAX_COUNTER); } - rv = apr_proc_mutex_timedlock(proc_lock, 1, 0); + rv = apr_proc_mutex_timedlock(proc_lock, 1); if (rv == APR_ENOTIMPL) { fprintf(stderr, "%s_timedlock() not implemented, ", mech->name); ABTS_ASSERT(tc, "Default timed timedlock not implemented", @@ -194,7 +194,7 @@ static void test_exclusive(abts_case *tc, const char *lockname, APR_ASSERT_SUCCESS(tc, "check for timedlock", rv); for (n = 0; n < 2; n++) { - rv = apr_proc_mutex_timedlock(proc_lock, 1, 0); + rv = apr_proc_mutex_timedlock(proc_lock, 1); /* Some mech (eg. flock or fcntl) may succeed when the * lock is re-acquired in the same process. */ From a701bf859b37b60a5ac4568d2fe1070453894557 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 7 Apr 2017 08:36:27 +0000 Subject: [PATCH 7688/7878] locks: follow up to r1790488. Make it clear in the type that it's a relative/interval time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790521 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_global_mutex.h | 2 +- include/apr_proc_mutex.h | 2 +- include/apr_thread_mutex.h | 2 +- locks/beos/proc_mutex.c | 2 +- locks/beos/thread_mutex.c | 2 +- locks/netware/proc_mutex.c | 2 +- locks/netware/thread_mutex.c | 2 +- locks/os2/proc_mutex.c | 2 +- locks/os2/thread_mutex.c | 2 +- locks/unix/global_mutex.c | 2 +- locks/unix/proc_mutex.c | 2 +- locks/unix/thread_mutex.c | 2 +- locks/win32/proc_mutex.c | 2 +- locks/win32/thread_mutex.c | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index 183f31083f2..083e83a6e32 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -117,7 +117,7 @@ APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex); * @param timeout the relative timeout (microseconds) */ APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex, - apr_time_t timeout); + apr_interval_time_t timeout); /** * Release the lock for the given mutex. diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index 4c0f92bc0a0..75e255a4ca9 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -122,7 +122,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex); * @param timeout the relative timeout (microseconds) */ APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, - apr_time_t timeout); + apr_interval_time_t timeout); /** * Release the lock for the given mutex. diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index efc62f65a20..5279a9fa6db 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -90,7 +90,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex); * @param timeout the relative timeout (microseconds) */ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, - apr_time_t timeout); + apr_interval_time_t timeout); /** * Release the lock for the given mutex. diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index dba07c0a593..e97a2ee802f 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -109,7 +109,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { int32 stat; diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index 62e81319e13..f9353509fb6 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -132,7 +132,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { int32 stat; thread_id me = find_thread(NULL); diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 01cd7cfec23..287011b0683 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -73,7 +73,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { if (mutex) return apr_thread_mutex_timedlock(mutex->mutex, timeout); diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index ecb0112f444..127610d3e4d 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -112,7 +112,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { if (mutex->cond) { apr_status_t rv; diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 2fe75afa023..564c49cf659 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -162,7 +162,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { ULONG rc; diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index fa79ee7a4f9..f7f46aadd68 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -73,7 +73,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { ULONG rc; diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index 9aa213eb26b..22592060d2f 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -143,7 +143,7 @@ APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { apr_status_t rv; diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index b181da5a600..f35104c11bd 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -1555,7 +1555,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { return mutex->meth->timedacquire(mutex, timeout); } diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index be2d86586a6..6a26ff23941 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -190,7 +190,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { apr_status_t rv = APR_ENOTIMPL; diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 7c3df23dc46..c85853d63a9 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -165,7 +165,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { DWORD rv; diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 05dc3d5fb4a..49198427a17 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -115,7 +115,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) } APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { if (mutex->type != thread_mutex_critical_section) { DWORD rv, timeout_ms; From 83b2c59a1b0f7f909ac96116e290a75e06527897 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 7 Apr 2017 08:44:02 +0000 Subject: [PATCH 7689/7878] locks: follow up to r1790488 and r1790521: likewise for the apr_proc_mutex_unix_lock_methods_t's timedacquired method. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790523 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_proc_mutex.h | 2 +- locks/unix/proc_mutex.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/arch/unix/apr_arch_proc_mutex.h b/include/arch/unix/apr_arch_proc_mutex.h index 86aaab5dc0a..cfa0049f754 100644 --- a/include/arch/unix/apr_arch_proc_mutex.h +++ b/include/arch/unix/apr_arch_proc_mutex.h @@ -70,7 +70,7 @@ struct apr_proc_mutex_unix_lock_methods_t { apr_status_t (*create)(apr_proc_mutex_t *, const char *); apr_status_t (*acquire)(apr_proc_mutex_t *); apr_status_t (*tryacquire)(apr_proc_mutex_t *); - apr_status_t (*timedacquire)(apr_proc_mutex_t *, apr_time_t); + apr_status_t (*timedacquire)(apr_proc_mutex_t *, apr_interval_time_t); apr_status_t (*release)(apr_proc_mutex_t *); apr_status_t (*cleanup)(void *); apr_status_t (*child_init)(apr_proc_mutex_t **, apr_pool_t *, const char *); diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index f35104c11bd..d49bfe10c64 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -60,7 +60,7 @@ static apr_status_t proc_mutex_no_perms_set(apr_proc_mutex_t *mutex, && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) \ && !defined(HAVE_PTHREAD_CONDATTR_SETPSHARED)) static apr_status_t proc_mutex_spinsleep_timedacquire(apr_proc_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { apr_status_t rv; if (timeout < 0) { @@ -222,7 +222,7 @@ static apr_status_t proc_mutex_posix_tryacquire(apr_proc_mutex_t *mutex) #if defined(HAVE_SEM_TIMEDWAIT) static apr_status_t proc_mutex_posix_timedacquire(apr_proc_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { if (timeout < 0) { return proc_mutex_posix_acquire(mutex); @@ -380,7 +380,7 @@ static apr_status_t proc_mutex_sysv_tryacquire(apr_proc_mutex_t *mutex) #if defined(HAVE_SEMTIMEDOP) static apr_status_t proc_mutex_sysv_timedacquire(apr_proc_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { if (timeout < 0) { return proc_mutex_sysv_acquire(mutex); @@ -510,7 +510,7 @@ typedef struct { static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, - apr_time_t timeout); + apr_interval_time_t timeout); static APR_INLINE int proc_pthread_mutex_inc(apr_proc_mutex_t *mutex) { @@ -702,7 +702,7 @@ static apr_status_t proc_mutex_pthread_tryacquire(apr_proc_mutex_t *mutex) } static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, - apr_time_t timeout) + apr_interval_time_t timeout) { #if !APR_USE_PROC_PTHREAD_MUTEX_COND && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) return proc_mutex_spinsleep_timedacquire(mutex, timeout); From 623b93ecc1e75e2e24bf16d87a8e0e45d5bdc327 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 7 Apr 2017 12:52:54 +0000 Subject: [PATCH 7690/7878] No longer return NOTIMPL for macOS git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790546 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 983aa953a00..24cc4418977 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -131,11 +131,6 @@ static void test_exclusive(abts_case *tc, const char *lockname, int n; rv = apr_proc_mutex_create(&proc_lock, lockname, mech->num, p); - if (rv == APR_ENOTIMPL) { - /* MacOS lacks TIMED implementation, so don't fail for ENOTIMPL */ - fprintf(stderr, "method %s not implemented, ", mech->name); - return; - } APR_ASSERT_SUCCESS(tc, "create the mutex", rv); for (n = 0; n < CHILDREN; n++) From 48622769a084c19c5323e021e7da6cac208a86fc Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 7 Apr 2017 15:14:51 +0000 Subject: [PATCH 7691/7878] locks: follow up to r1790488, r1790521 and r1790523: likewise for the tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790569 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 6 +++--- test/testlockperf.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testlock.c b/test/testlock.c index 095134e05a6..40da791b793 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -91,7 +91,7 @@ static void *APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data while (1) { if (data) { - apr_thread_mutex_timedlock(thread_mutex, *(apr_time_t *)data); + apr_thread_mutex_timedlock(thread_mutex, *(apr_interval_time_t *)data); } else { apr_thread_mutex_lock(thread_mutex); @@ -187,7 +187,7 @@ static void test_thread_timedmutex(abts_case *tc, void *data) { apr_thread_t *t1, *t2, *t3, *t4; apr_status_t s1, s2, s3, s4; - apr_time_t timeout; + apr_interval_time_t timeout; s1 = apr_thread_mutex_create(&thread_mutex, APR_THREAD_MUTEX_TIMED, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); @@ -345,8 +345,8 @@ static void test_timeoutcond(abts_case *tc, void *data) static void test_timeoutmutex(abts_case *tc, void *data) { apr_status_t s; + apr_interval_time_t timeout; apr_time_t begin, end; - apr_time_t timeout; int i; s = apr_thread_mutex_create(&timeout_mutex, APR_THREAD_MUTEX_TIMED, p); diff --git a/test/testlockperf.c b/test/testlockperf.c index c91f1a87bc8..f89d7900b76 100644 --- a/test/testlockperf.c +++ b/test/testlockperf.c @@ -61,7 +61,7 @@ void * APR_THREAD_FUNC thread_mutex_func(apr_thread_t *thd, void *data) for (i = 0; i < max_counter; i++) { if (data) { - apr_thread_mutex_timedlock(thread_lock, *(apr_time_t *)data); + apr_thread_mutex_timedlock(thread_lock, *(apr_interval_time_t *)data); } else { apr_thread_mutex_lock(thread_lock); From 9bb247569b16dd4947665bd255274e140bd03ce1 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 7 Apr 2017 21:17:41 +0000 Subject: [PATCH 7692/7878] apr_{thread,proc,global}_timedlock() with negative timeout is now equivalent to apr_{thread,proc,global}_trylock(), i.e. immediate attempt to acquire the lock (but returning APR_TIMEUP if busy). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790632 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_global_mutex.h | 4 +- include/apr_proc_mutex.h | 4 +- include/apr_thread_mutex.h | 4 +- locks/beos/proc_mutex.c | 5 +- locks/beos/thread_mutex.c | 5 +- locks/netware/thread_mutex.c | 10 +--- locks/os2/proc_mutex.c | 5 +- locks/os2/thread_mutex.c | 5 +- locks/unix/proc_mutex.c | 88 ++++++++++++++++-------------------- locks/unix/thread_mutex.c | 20 ++------ locks/win32/proc_mutex.c | 15 ++---- locks/win32/thread_mutex.c | 8 +--- 12 files changed, 64 insertions(+), 109 deletions(-) diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h index 083e83a6e32..d57ca453d9f 100644 --- a/include/apr_global_mutex.h +++ b/include/apr_global_mutex.h @@ -114,7 +114,9 @@ APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex); * Attempt to acquire the lock for the given mutex until timeout expires. * If the acquisition time outs, the call returns with APR_TIMEUP. * @param mutex the mutex on which to attempt the lock acquiring. - * @param timeout the relative timeout (microseconds) + * @param timeout the relative timeout (microseconds). + * @note A negative or nul timeout means immediate attempt, returning + * APR_TIMEUP without blocking if it the lock is already acquired. */ APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex, apr_interval_time_t timeout); diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index 75e255a4ca9..418c95048a7 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -119,7 +119,9 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex); * Attempt to acquire the lock for the given mutex until timeout expires. * If the acquisition time outs, the call returns with APR_TIMEUP. * @param mutex the mutex on which to attempt the lock acquiring. - * @param timeout the relative timeout (microseconds) + * @param timeout the relative timeout (microseconds). + * @note A negative or nul timeout means immediate attempt, returning + * APR_TIMEUP without blocking if it the lock is already acquired. */ APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, apr_interval_time_t timeout); diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 5279a9fa6db..8eb617291b8 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -87,7 +87,9 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex); * Attempt to acquire the lock for the given mutex until timeout expires. * If the acquisition time outs, the call returns with APR_TIMEUP. * @param mutex the mutex on which to attempt the lock acquiring. - * @param timeout the relative timeout (microseconds) + * @param timeout the relative timeout (microseconds). + * @note A timeout negative or nul means immediate attempt, returning + * APR_TIMEUP without blocking if it the lock is already acquired. */ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, apr_interval_time_t timeout); diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index e97a2ee802f..d253ad5be88 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -114,12 +114,9 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, int32 stat; if (atomic_add(&mutex->LockCount, 1) > 0) { - if (!timeout) { + if (timeout <= 0) { stat = B_TIMED_OUT; } - else if (timeout < 0) { - stat = acquire_sem(mutex->Lock); - } else { stat = acquire_sem_etc(mutex->Lock, 1, B_RELATIVE_TIMEOUT, timeout); diff --git a/locks/beos/thread_mutex.c b/locks/beos/thread_mutex.c index f9353509fb6..e4099d8826d 100644 --- a/locks/beos/thread_mutex.c +++ b/locks/beos/thread_mutex.c @@ -143,12 +143,9 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, } if (atomic_add(&mutex->LockCount, 1) > 0) { - if (!timeout) { + if (timeout <= 0) { stat = B_TIMED_OUT; } - else if (timeout < 0) { - stat = acquire_sem(mutex->Lock); - } else { stat = acquire_sem_etc(mutex->Lock, 1, B_RELATIVE_TIMEOUT, timeout); diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index 127610d3e4d..9c21642786b 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -118,18 +118,12 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, apr_status_t rv; NXLock(mutex->mutex); if (mutex->locked) { - if (!timeout) { + if (timeout <= 0) { rv = APR_TIMEUP; } else { mutex->num_waiters++; - if (timeout < 0) { - rv = apr_thread_cond_wait(mutex->cond, mutex); - } - else { - rv = apr_thread_cond_timedwait(mutex->cond, mutex, - timeout); - } + rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout); mutex->num_waiters--; } } diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 564c49cf659..de2e66aeb19 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -166,10 +166,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, { ULONG rc; - if (timeout < 0) { - rc = DosRequestMutexSem(mutex->hMutex, SEM_INDEFINITE_WAIT); - } - else if (!timeout) { + if (timeout <= 0) { rc = DosRequestMutexSem(mutex->hMutex, SEM_IMMEDIATE_RETURN); } else { diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c index f7f46aadd68..884004ce2de 100644 --- a/locks/os2/thread_mutex.c +++ b/locks/os2/thread_mutex.c @@ -77,10 +77,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, { ULONG rc; - if (timeout < 0) { - rc = DosRequestMutexSem(mutex->hMutex, SEM_INDEFINITE_WAIT); - } - else if (!timeout) { + if (timeout <= 0) { rc = DosRequestMutexSem(mutex->hMutex, SEM_IMMEDIATE_RETURN); } else { diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index d49bfe10c64..8b576a8909a 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -62,32 +62,27 @@ static apr_status_t proc_mutex_no_perms_set(apr_proc_mutex_t *mutex, static apr_status_t proc_mutex_spinsleep_timedacquire(apr_proc_mutex_t *mutex, apr_interval_time_t timeout) { - apr_status_t rv; - if (timeout < 0) { - rv = apr_proc_mutex_lock(mutex); - } - else { #define SLEEP_TIME apr_time_from_msec(10) - for (;;) { - rv = apr_proc_mutex_trylock(mutex); - if (!APR_STATUS_IS_EBUSY(rv)) { - if (rv == APR_SUCCESS) { - mutex->curr_locked = 1; - } - break; - } - if (!timeout) { - rv = APR_TIMEUP; - break; - } - if (timeout > SLEEP_TIME) { - apr_sleep(SLEEP_TIME); - timeout -= SLEEP_TIME; - } - else { - apr_sleep(timeout); - timeout = 0; + apr_status_t rv; + for (;;) { + rv = apr_proc_mutex_trylock(mutex); + if (!APR_STATUS_IS_EBUSY(rv)) { + if (rv == APR_SUCCESS) { + mutex->curr_locked = 1; } + break; + } + if (timeout <= 0) { + rv = APR_TIMEUP; + break; + } + if (timeout > SLEEP_TIME) { + apr_sleep(SLEEP_TIME); + timeout -= SLEEP_TIME; + } + else { + apr_sleep(timeout); + timeout = 0; } } return rv; @@ -224,10 +219,7 @@ static apr_status_t proc_mutex_posix_tryacquire(apr_proc_mutex_t *mutex) static apr_status_t proc_mutex_posix_timedacquire(apr_proc_mutex_t *mutex, apr_interval_time_t timeout) { - if (timeout < 0) { - return proc_mutex_posix_acquire(mutex); - } - else if (!timeout) { + if (timeout <= 0) { apr_status_t rv = proc_mutex_posix_tryacquire(mutex); return (rv == APR_EBUSY) ? APR_TIMEUP : rv; } @@ -382,10 +374,7 @@ static apr_status_t proc_mutex_sysv_tryacquire(apr_proc_mutex_t *mutex) static apr_status_t proc_mutex_sysv_timedacquire(apr_proc_mutex_t *mutex, apr_interval_time_t timeout) { - if (timeout < 0) { - return proc_mutex_sysv_acquire(mutex); - } - else if (!timeout) { + if (timeout <= 0) { apr_status_t rv = proc_mutex_sysv_tryacquire(mutex); return (rv == APR_EBUSY) ? APR_TIMEUP : rv; } @@ -509,9 +498,6 @@ typedef struct { } proc_pthread_mutex_t; -static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, - apr_interval_time_t timeout); - static APR_INLINE int proc_pthread_mutex_inc(apr_proc_mutex_t *mutex) { if (mutex->pthread_refcounting) { @@ -690,19 +676,8 @@ static apr_status_t proc_mutex_pthread_child_init(apr_proc_mutex_t **mutex, return APR_SUCCESS; } -static apr_status_t proc_mutex_pthread_acquire(apr_proc_mutex_t *mutex) -{ - return proc_mutex_pthread_timedacquire(mutex, -1); -} - -static apr_status_t proc_mutex_pthread_tryacquire(apr_proc_mutex_t *mutex) -{ - apr_status_t rv = proc_mutex_pthread_timedacquire(mutex, 0); - return (rv == APR_TIMEUP) ? APR_EBUSY : rv; -} - -static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, - apr_interval_time_t timeout) +static apr_status_t proc_mutex_pthread_acquire_ex(apr_proc_mutex_t *mutex, + apr_interval_time_t timeout) { #if !APR_USE_PROC_PTHREAD_MUTEX_COND && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) return proc_mutex_spinsleep_timedacquire(mutex, timeout); @@ -834,6 +809,23 @@ static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, #endif } +static apr_status_t proc_mutex_pthread_acquire(apr_proc_mutex_t *mutex) +{ + return proc_mutex_pthread_acquire_ex(mutex, -1); +} + +static apr_status_t proc_mutex_pthread_tryacquire(apr_proc_mutex_t *mutex) +{ + apr_status_t rv = proc_mutex_pthread_acquire_ex(mutex, 0); + return (rv == APR_TIMEUP) ? APR_EBUSY : rv; +} + +static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex, + apr_interval_time_t timeout) +{ + return proc_mutex_pthread_acquire_ex(mutex, (timeout <= 0) ? 0 : timeout); +} + static apr_status_t proc_mutex_pthread_release(apr_proc_mutex_t *mutex) { apr_status_t rv; diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 6a26ff23941..cf859e6ad1d 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -195,15 +195,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, apr_status_t rv = APR_ENOTIMPL; #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK - if (timeout < 0) { - rv = pthread_mutex_lock(&mutex->mutex); -#ifdef HAVE_ZOS_PTHREADS - if (rv) { - rv = errno; - } -#endif - } - else if (!timeout) { + if (timeout <= 0) { rv = pthread_mutex_trylock(&mutex->mutex); if (rv) { #ifdef HAVE_ZOS_PTHREADS @@ -244,18 +236,12 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, } if (mutex->locked) { - if (!timeout) { + if (timeout <= 0) { rv = APR_TIMEUP; } else { mutex->num_waiters++; - if (timeout < 0) { - rv = apr_thread_cond_wait(mutex->cond, mutex); - } - else { - rv = apr_thread_cond_timedwait(mutex->cond, mutex, - timeout); - } + rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout); #ifdef HAVE_ZOS_PTHREADS if (rv) { rv = errno; diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index c85853d63a9..648c7a14df8 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -167,18 +167,13 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, apr_interval_time_t timeout) { - DWORD rv; + DWORD rv, timeout_ms = (timeout <= 0) ? 0 : apr_time_as_msec(timeout); - if (timeout < 0) { - rv = WaitForSingleObject(mutex->handle, INFINITE); - } - else { - rv = WaitForSingleObject(mutex->handle, apr_time_as_msec(timeout)); - if (rv == WAIT_TIMEOUT) { - return APR_TIMEUP; - } - } + rv = WaitForSingleObject(mutex->handle, timeout_ms); + if (rv == WAIT_TIMEOUT) { + return APR_TIMEUP; + } if (rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) { return APR_SUCCESS; } diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 49198427a17..2eac69cdbfc 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -118,13 +118,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, apr_interval_time_t timeout) { if (mutex->type != thread_mutex_critical_section) { - DWORD rv, timeout_ms; - if (timeout < 0) { - timeout_ms = INFINITE; - } - else { - timeout_ms = apr_time_as_msec(timeout); - } + DWORD rv, timeout_ms = (timeout <= 0) ? 0 : apr_time_as_msec(timeout); rv = WaitForSingleObject(mutex->handle, timeout_ms); if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) { return (rv == WAIT_TIMEOUT) ? APR_TIMEUP : apr_get_os_error(); From d63e0fad6611d1e091c60f37382a83c7b9bbff0b Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Tue, 11 Apr 2017 21:20:14 +0000 Subject: [PATCH 7693/7878] Set perms correctly on file copy where destination exists git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1791029 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/copy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index 91e4f550841..bf844aa46e0 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -41,6 +41,7 @@ static apr_status_t apr_file_transfer_contents(const char *from_path, return status; } perms = finfo.protection; + apr_file_perms_set(to_path, perms); /* ignore any failure */ } else perms = to_perms; From a468734f5040816509a4eb3e5534e81384fbdfda Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sun, 16 Apr 2017 11:04:05 +0000 Subject: [PATCH 7694/7878] Update config.guess and config.sub from http://git.savannah.gnu.org/cgit/config.git. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1791598 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 12 ++++++++---- build/config.sub | 14 +++++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/build/config.guess b/build/config.guess index bbd48b60e88..69ed3e573bb 100755 --- a/build/config.guess +++ b/build/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2017-01-01' +timestamp='2017-03-05' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -837,10 +837,11 @@ EOF UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -1343,6 +1344,9 @@ EOF NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; + NSX-?:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk${UNAME_RELEASE} + exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; diff --git a/build/config.sub b/build/config.sub index 7e792b4ae17..40ea5dfe115 100755 --- a/build/config.sub +++ b/build/config.sub @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2017-01-01' +timestamp='2017-04-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -263,7 +263,7 @@ case $basic_machine in | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ - | i370 | i860 | i960 | ia64 \ + | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ @@ -315,6 +315,7 @@ case $basic_machine in | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ + | wasm32 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -388,7 +389,7 @@ case $basic_machine in | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ @@ -446,6 +447,7 @@ case $basic_machine in | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ + | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -948,6 +950,9 @@ case $basic_machine in nsr-tandem) basic_machine=nsr-tandem ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf @@ -1243,6 +1248,9 @@ case $basic_machine in basic_machine=a29k-wrs os=-vxworks ;; + wasm32) + basic_machine=wasm32-unknown + ;; w65*) basic_machine=w65-wdc os=-none From 6856a652cc014a3a608cb1c1c9ddfa658fe92c9b Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 17 Apr 2017 20:08:37 +0000 Subject: [PATCH 7695/7878] locks: follow up to r1790446. Since proc_pthread_mutex_cond_locked() macro is also used as an lvalue, don't define it as a conditional and put the condition where needed in the code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1791718 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 8b576a8909a..03110e0db25 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -487,7 +487,7 @@ typedef struct { (proc_pthread_cast(m)->cond) apr_int32_t cond_locked; #define proc_pthread_mutex_cond_locked(m) \ - ((m)->pthread_refcounting ? proc_pthread_cast(m)->cond_locked : -1) + (proc_pthread_cast(m)->cond_locked) apr_uint32_t cond_num_waiters; #define proc_pthread_mutex_cond_num_waiters(m) \ (proc_pthread_cast(m)->cond_num_waiters) @@ -521,7 +521,8 @@ static apr_status_t proc_pthread_mutex_unref(void *mutex_) apr_status_t rv; #if APR_USE_PROC_PTHREAD_MUTEX_COND - if (proc_pthread_mutex_cond_locked(mutex) != -1) { + if (mutex->pthread_refcounting && + proc_pthread_mutex_cond_locked(mutex) != -1) { mutex->curr_locked = 0; } else @@ -536,7 +537,8 @@ static apr_status_t proc_pthread_mutex_unref(void *mutex_) } if (!proc_pthread_mutex_dec(mutex)) { #if APR_USE_PROC_PTHREAD_MUTEX_COND - if (proc_pthread_mutex_cond_locked(mutex) != -1 && + if (mutex->pthread_refcounting && + proc_pthread_mutex_cond_locked(mutex) != -1 && (rv = pthread_cond_destroy(&proc_pthread_mutex_cond(mutex)))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; @@ -685,7 +687,8 @@ static apr_status_t proc_mutex_pthread_acquire_ex(apr_proc_mutex_t *mutex, apr_status_t rv; #if APR_USE_PROC_PTHREAD_MUTEX_COND - if (proc_pthread_mutex_cond_locked(mutex) != -1) { + if (mutex->pthread_refcounting && + proc_pthread_mutex_cond_locked(mutex) != -1) { if ((rv = pthread_mutex_lock(&proc_pthread_mutex(mutex)))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; @@ -831,7 +834,8 @@ static apr_status_t proc_mutex_pthread_release(apr_proc_mutex_t *mutex) apr_status_t rv; #if APR_USE_PROC_PTHREAD_MUTEX_COND - if (proc_pthread_mutex_cond_locked(mutex) != -1) { + if (mutex->pthread_refcounting && + proc_pthread_mutex_cond_locked(mutex) != -1) { if ((rv = pthread_mutex_lock(&proc_pthread_mutex(mutex)))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; From ea1881bcbe26b5697fc0c19b1660466e03e20d18 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 17 Apr 2017 21:53:45 +0000 Subject: [PATCH 7696/7878] locks: follow up to r1790436. Fix proc_mutex_pthread_acquire_ex() for the APR_USE_PROC_PTHREAD_MUTEX_COND case which shouldn't use undefined pthread_cond_timedwait(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1791728 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 03110e0db25..3dedbefcad4 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -681,9 +681,6 @@ static apr_status_t proc_mutex_pthread_child_init(apr_proc_mutex_t **mutex, static apr_status_t proc_mutex_pthread_acquire_ex(apr_proc_mutex_t *mutex, apr_interval_time_t timeout) { -#if !APR_USE_PROC_PTHREAD_MUTEX_COND && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) - return proc_mutex_spinsleep_timedacquire(mutex, timeout); -#else apr_status_t rv; #if APR_USE_PROC_PTHREAD_MUTEX_COND @@ -777,7 +774,9 @@ static apr_status_t proc_mutex_pthread_acquire_ex(apr_proc_mutex_t *mutex, } } } - else { + else +#if defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) + { struct timespec abstime; timeout += apr_time_now(); @@ -805,11 +804,13 @@ static apr_status_t proc_mutex_pthread_acquire_ex(apr_proc_mutex_t *mutex, #endif return rv; } +#else /* !HAVE_PTHREAD_MUTEX_TIMEDLOCK */ + return proc_mutex_spinsleep_timedacquire(mutex, timeout); +#endif } mutex->curr_locked = 1; return APR_SUCCESS; -#endif } static apr_status_t proc_mutex_pthread_acquire(apr_proc_mutex_t *mutex) From e4aba1f46d6e4e99cb860bca702af8e5191e4b8d Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 25 Apr 2017 15:09:54 +0000 Subject: [PATCH 7697/7878] locks: Windows: work around 64bit usecs to native 32bit msecs timeouts for apr_{proc,thread}_{mutex,cond}_timed{lock,wait}(), such that the given timeout interval value is not truncated or switched from/to signed/unsigned. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1792620 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/proc_mutex.c | 23 ++++++++++++++++++++--- locks/win32/thread_cond.c | 31 ++++++++++++++++++++++++++----- locks/win32/thread_mutex.c | 23 +++++++++++++++++++++-- 3 files changed, 67 insertions(+), 10 deletions(-) diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 648c7a14df8..2370bcc8e89 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -167,9 +167,26 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, apr_interval_time_t timeout) { - DWORD rv, timeout_ms = (timeout <= 0) ? 0 : apr_time_as_msec(timeout); - - rv = WaitForSingleObject(mutex->handle, timeout_ms); + DWORD rv, timeout_ms = 0; + apr_interval_time_t t = timeout; + + do { + if (t > 0) { + /* Given timeout is 64bit usecs whereas Windows timeouts are + * 32bit msecs and below INFINITE (2^32 - 1), so we may need + * multiple timed out waits... + */ + if (t > apr_time_from_msec(INFINITE - 1)) { + timeout_ms = INFINITE - 1; + t -= apr_time_from_msec(INFINITE - 1); + } + else { + timeout_ms = (DWORD)apr_time_as_msec(t); + t = 0; + } + } + rv = WaitForSingleObject(mutex->handle, timeout_ms); + } while (rv == WAIT_TIMEOUT && t > 0); if (rv == WAIT_TIMEOUT) { return APR_TIMEUP; diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index b2ac1c8ff1e..d22567a88e0 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -63,12 +63,13 @@ APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) static APR_INLINE apr_status_t thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, - DWORD timeout_ms ) + apr_interval_time_t timeout) { DWORD res; apr_status_t rv; unsigned int wake = 0; unsigned long generation; + DWORD timeout_ms = 0; EnterCriticalSection(&cond->csection); cond->num_waiting++; @@ -78,7 +79,28 @@ static APR_INLINE apr_status_t thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_unlock(mutex); do { - res = WaitForSingleObject(cond->semaphore, timeout_ms); + apr_interval_time_t t = timeout; + + do { + if (t < 0) { + timeout_ms = INFINITE; + } + else if (t > 0) { + /* Given timeout is 64bit usecs whereas Windows timeouts are + * 32bit msecs and below INFINITE (2^32 - 1), so we may need + * multiple timed out waits... + */ + if (t > apr_time_from_msec(INFINITE - 1)) { + timeout_ms = INFINITE - 1; + t -= apr_time_from_msec(INFINITE - 1); + } + else { + timeout_ms = (DWORD)apr_time_as_msec(t); + t = 0; + } + } + res = WaitForSingleObject(mutex->handle, timeout_ms); + } while (res == WAIT_TIMEOUT && t > 0); EnterCriticalSection(&cond->csection); @@ -115,15 +137,14 @@ static APR_INLINE apr_status_t thread_cond_timedwait(apr_thread_cond_t *cond, APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex) { - return thread_cond_timedwait(cond, mutex, INFINITE); + return thread_cond_timedwait(cond, mutex, (apr_interval_time_t)-1); } APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, apr_interval_time_t timeout) { - DWORD timeout_ms = (timeout >= 0) ? apr_time_as_msec(timeout) : INFINITE; - return thread_cond_timedwait(cond, mutex, timeout_ms); + return thread_cond_timedwait(cond, mutex, timeout); } APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index 2eac69cdbfc..f19152495f6 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -118,8 +118,27 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, apr_interval_time_t timeout) { if (mutex->type != thread_mutex_critical_section) { - DWORD rv, timeout_ms = (timeout <= 0) ? 0 : apr_time_as_msec(timeout); - rv = WaitForSingleObject(mutex->handle, timeout_ms); + DWORD rv, timeout_ms = 0; + apr_interval_time_t t = timeout; + + do { + if (t > 0) { + /* Given timeout is 64bit usecs whereas Windows timeouts are + * 32bit msecs and below INFINITE (2^32 - 1), so we may need + * multiple timed out waits... + */ + if (t > apr_time_from_msec(INFINITE - 1)) { + timeout_ms = INFINITE - 1; + t -= apr_time_from_msec(INFINITE - 1); + } + else { + timeout_ms = (DWORD)apr_time_as_msec(t); + t = 0; + } + } + rv = WaitForSingleObject(mutex->handle, timeout_ms); + } while (rv == WAIT_TIMEOUT && t > 0); + if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) { return (rv == WAIT_TIMEOUT) ? APR_TIMEUP : apr_get_os_error(); } From c336a0c4f820e8728662e0543eb8f90163695378 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 25 Apr 2017 15:17:56 +0000 Subject: [PATCH 7698/7878] locks: unix: provide a macro helper for a pattern used several times. No functional change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1792621 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 3dedbefcad4..5ed289b6026 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -491,6 +491,8 @@ typedef struct { apr_uint32_t cond_num_waiters; #define proc_pthread_mutex_cond_num_waiters(m) \ (proc_pthread_cast(m)->cond_num_waiters) +#define proc_pthread_mutex_is_cond(m) \ + ((m)->pthread_refcounting && proc_pthread_mutex_cond_locked(m) != -1) #endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */ apr_uint32_t refcount; #define proc_pthread_mutex_refcount(m) \ @@ -521,8 +523,7 @@ static apr_status_t proc_pthread_mutex_unref(void *mutex_) apr_status_t rv; #if APR_USE_PROC_PTHREAD_MUTEX_COND - if (mutex->pthread_refcounting && - proc_pthread_mutex_cond_locked(mutex) != -1) { + if (proc_pthread_mutex_is_cond(mutex)) { mutex->curr_locked = 0; } else @@ -537,8 +538,7 @@ static apr_status_t proc_pthread_mutex_unref(void *mutex_) } if (!proc_pthread_mutex_dec(mutex)) { #if APR_USE_PROC_PTHREAD_MUTEX_COND - if (mutex->pthread_refcounting && - proc_pthread_mutex_cond_locked(mutex) != -1 && + if (proc_pthread_mutex_is_cond(mutex) && (rv = pthread_cond_destroy(&proc_pthread_mutex_cond(mutex)))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; @@ -684,8 +684,7 @@ static apr_status_t proc_mutex_pthread_acquire_ex(apr_proc_mutex_t *mutex, apr_status_t rv; #if APR_USE_PROC_PTHREAD_MUTEX_COND - if (mutex->pthread_refcounting && - proc_pthread_mutex_cond_locked(mutex) != -1) { + if (proc_pthread_mutex_is_cond(mutex)) { if ((rv = pthread_mutex_lock(&proc_pthread_mutex(mutex)))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; @@ -835,8 +834,7 @@ static apr_status_t proc_mutex_pthread_release(apr_proc_mutex_t *mutex) apr_status_t rv; #if APR_USE_PROC_PTHREAD_MUTEX_COND - if (mutex->pthread_refcounting && - proc_pthread_mutex_cond_locked(mutex) != -1) { + if (proc_pthread_mutex_is_cond(mutex)) { if ((rv = pthread_mutex_lock(&proc_pthread_mutex(mutex)))) { #ifdef HAVE_ZOS_PTHREADS rv = errno; From 0c6fd0a9f415aa7a803ca4aad54bc9870b69ddb1 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 25 Apr 2017 15:25:31 +0000 Subject: [PATCH 7699/7878] locks: unix: timedlock: better handling of spurious wakeups that may be inherent to some native/OS condvar implementation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1792622 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 45 ++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 5ed289b6026..a96e27acdcb 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -701,29 +701,33 @@ static apr_status_t proc_mutex_pthread_acquire_ex(apr_proc_mutex_t *mutex, } if (!proc_pthread_mutex_cond_locked(mutex)) { - proc_pthread_mutex_cond_locked(mutex) = 1; + rv = APR_SUCCESS; } else if (!timeout) { rv = APR_TIMEUP; } else { + struct timespec abstime; + + if (timeout > 0) { + timeout += apr_time_now(); + abstime.tv_sec = apr_time_sec(timeout); + abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ + } + proc_pthread_mutex_cond_num_waiters(mutex)++; + do { if (timeout < 0) { rv = pthread_cond_wait(&proc_pthread_mutex_cond(mutex), &proc_pthread_mutex(mutex)); -#ifdef HAVE_ZOS_PTHREADS if (rv) { +#ifdef HAVE_ZOS_PTHREADS rv = errno; - } #endif + break; + } } else { - struct timespec abstime; - - timeout += apr_time_now(); - abstime.tv_sec = apr_time_sec(timeout); - abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */ - rv = pthread_cond_timedwait(&proc_pthread_mutex_cond(mutex), &proc_pthread_mutex(mutex), &abstime); @@ -734,15 +738,19 @@ static apr_status_t proc_mutex_pthread_acquire_ex(apr_proc_mutex_t *mutex, if (rv == ETIMEDOUT) { rv = APR_TIMEUP; } + break; } } + } while (proc_pthread_mutex_cond_locked(mutex)); proc_pthread_mutex_cond_num_waiters(mutex)--; } - if (rv) { + if (rv != APR_SUCCESS) { pthread_mutex_unlock(&proc_pthread_mutex(mutex)); return rv; } + proc_pthread_mutex_cond_locked(mutex) = 1; + rv = pthread_mutex_unlock(&proc_pthread_mutex(mutex)); if (rv) { #ifdef HAVE_ZOS_PTHREADS @@ -853,22 +861,23 @@ static apr_status_t proc_mutex_pthread_release(apr_proc_mutex_t *mutex) if (!proc_pthread_mutex_cond_locked(mutex)) { rv = APR_EINVAL; } - else if (proc_pthread_mutex_cond_num_waiters(mutex)) { + else if (!proc_pthread_mutex_cond_num_waiters(mutex)) { + rv = APR_SUCCESS; + } + else { rv = pthread_cond_signal(&proc_pthread_mutex_cond(mutex)); - if (rv) { #ifdef HAVE_ZOS_PTHREADS + if (rv) { rv = errno; -#endif } +#endif } - else { - proc_pthread_mutex_cond_locked(mutex) = 0; - rv = APR_SUCCESS; - } - if (rv) { + if (rv != APR_SUCCESS) { pthread_mutex_unlock(&proc_pthread_mutex(mutex)); return rv; } + + proc_pthread_mutex_cond_locked(mutex) = 0; } #endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */ From 56e4475f777992ff4e326495e6934e87a4f65dba Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 25 Apr 2017 15:35:55 +0000 Subject: [PATCH 7700/7878] locks: unix: follow up to r1792622. Indent block previously preserved (for easier review), no functional change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1792625 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index a96e27acdcb..a8002c6bd4b 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -717,30 +717,30 @@ static apr_status_t proc_mutex_pthread_acquire_ex(apr_proc_mutex_t *mutex, proc_pthread_mutex_cond_num_waiters(mutex)++; do { - if (timeout < 0) { - rv = pthread_cond_wait(&proc_pthread_mutex_cond(mutex), - &proc_pthread_mutex(mutex)); - if (rv) { + if (timeout < 0) { + rv = pthread_cond_wait(&proc_pthread_mutex_cond(mutex), + &proc_pthread_mutex(mutex)); + if (rv) { #ifdef HAVE_ZOS_PTHREADS - rv = errno; + rv = errno; #endif - break; + break; + } } - } - else { - rv = pthread_cond_timedwait(&proc_pthread_mutex_cond(mutex), - &proc_pthread_mutex(mutex), - &abstime); - if (rv) { + else { + rv = pthread_cond_timedwait(&proc_pthread_mutex_cond(mutex), + &proc_pthread_mutex(mutex), + &abstime); + if (rv) { #ifdef HAVE_ZOS_PTHREADS - rv = errno; + rv = errno; #endif - if (rv == ETIMEDOUT) { - rv = APR_TIMEUP; + if (rv == ETIMEDOUT) { + rv = APR_TIMEUP; + } + break; } - break; } - } } while (proc_pthread_mutex_cond_locked(mutex)); proc_pthread_mutex_cond_num_waiters(mutex)--; } From 3c3ebefdf90f9ea12de4dac7038dc3a2d9bf8d3b Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Thu, 27 Apr 2017 21:47:11 +0000 Subject: [PATCH 7701/7878] pthread_mutex_timedlock is broken on Solaris 10. It can block without timeout in case of EDEADLK. On Solaris 8 it does not exist, on Solaris 11 it is fixed. For Solaris 10 no patch is available. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1792961 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 549a2db2237..c2e59e5f0df 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -119,6 +119,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-linux*) APR_ADDTO(CPPFLAGS, [-DLINUX -D_REENTRANT -D_GNU_SOURCE]) + APR_SETIFNULL(ac_cv_func_pthread_mutex_timedlock, [no]) ;; *-lynx-lynxos) APR_ADDTO(CPPFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) @@ -237,6 +238,11 @@ dnl # Not a problem in 10.20. Otherwise, who knows? *-solaris2*) PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'` APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT]) + if test $PLATOSVERS -eq 10; then + # pthread_mutex_timedlock is broken on Solaris 10. + # It can block without timeout in case of EDEADLK. + APR_SETIFNULL(ac_cv_func_pthread_mutex_timedlock, [no]) + fi if test $PLATOSVERS -ge 10; then APR_SETIFNULL(apr_lock_method, [USE_PROC_PTHREAD_SERIALIZE]) else From 63c80e87c92554aca19b9d88eb851182373aabac Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Thu, 27 Apr 2017 22:07:57 +0000 Subject: [PATCH 7702/7878] Remove unintended change from r1792961. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1792963 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 1 - 1 file changed, 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index c2e59e5f0df..fd3d33de059 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -119,7 +119,6 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; *-linux*) APR_ADDTO(CPPFLAGS, [-DLINUX -D_REENTRANT -D_GNU_SOURCE]) - APR_SETIFNULL(ac_cv_func_pthread_mutex_timedlock, [no]) ;; *-lynx-lynxos) APR_ADDTO(CPPFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS]) From 10e4e46c5fd9b17be67a9821cd2fc80be3180b94 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sun, 7 May 2017 21:35:30 +0000 Subject: [PATCH 7703/7878] locks: thread: timedlock: better handling of spurious wakeups that may be inherent to some native/OS condvar implementation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1794266 13f79535-47bb-0310-9956-ffa450edef68 --- locks/netware/thread_mutex.c | 22 ++++++++++-------- locks/unix/thread_mutex.c | 44 +++++++++++++++--------------------- 2 files changed, 30 insertions(+), 36 deletions(-) diff --git a/locks/netware/thread_mutex.c b/locks/netware/thread_mutex.c index 9c21642786b..435abebba30 100644 --- a/locks/netware/thread_mutex.c +++ b/locks/netware/thread_mutex.c @@ -115,7 +115,8 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, apr_interval_time_t timeout) { if (mutex->cond) { - apr_status_t rv; + apr_status_t rv = APR_SUCCESS; + NXLock(mutex->mutex); if (mutex->locked) { if (timeout <= 0) { @@ -123,13 +124,15 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, } else { mutex->num_waiters++; - rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout); + do { + rv = apr_thread_cond_timedwait(mutex->cond, mutex, + timeout); + } while (rv == APR_SUCCESS && mutex->locked); mutex->num_waiters--; } } - else { + if (rv == APR_SUCCESS) { mutex->locked = 1; - rv = APR_SUCCESS; } NXUnlock(mutex->mutex); return rv; @@ -140,25 +143,24 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) { + apr_status_t rv = APR_SUCCESS; + if (mutex->cond) { - apr_status_t rv; NXLock(mutex->mutex); + if (!mutex->locked) { rv = APR_EINVAL; } else if (mutex->num_waiters) { rv = apr_thread_cond_signal(mutex->cond); } - else { + if (rv == APR_SUCCESS) { mutex->locked = 0; - rv = APR_SUCCESS; } - NXUnlock(mutex->mutex); - return rv; } NXUnlock(mutex->mutex); - return APR_SUCCESS; + return rv; } APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index cf859e6ad1d..f027c791f2e 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -241,23 +241,26 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex, } else { mutex->num_waiters++; - rv = apr_thread_cond_timedwait(mutex->cond, mutex, timeout); + do { + rv = apr_thread_cond_timedwait(mutex->cond, mutex, + timeout); + if (rv) { #ifdef HAVE_ZOS_PTHREADS - if (rv) { - rv = errno; - } + rv = errno; #endif + break; + } + } while (mutex->locked); mutex->num_waiters--; } - } - else { - mutex->locked = 1; - } - if (rv) { - pthread_mutex_unlock(&mutex->mutex); - return rv; + if (rv) { + pthread_mutex_unlock(&mutex->mutex); + return rv; + } } + mutex->locked = 1; + rv = pthread_mutex_unlock(&mutex->mutex); if (rv) { #ifdef HAVE_ZOS_PTHREADS @@ -277,8 +280,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) apr_status_t status; if (mutex->cond) { - apr_status_t stat2; - status = pthread_mutex_lock(&mutex->mutex); if (status) { #ifdef HAVE_ZOS_PTHREADS @@ -293,21 +294,12 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) else if (mutex->num_waiters) { status = apr_thread_cond_signal(mutex->cond); } - else { - mutex->locked = 0; - status = APR_SUCCESS; - } - - stat2 = pthread_mutex_unlock(&mutex->mutex); - if (stat2) { -#ifdef HAVE_ZOS_PTHREADS - status = errno; -#else - status = stat2; -#endif + if (status) { + pthread_mutex_unlock(&mutex->mutex); + return status; } - return status; + mutex->locked = 0; } status = pthread_mutex_unlock(&mutex->mutex); From f3e077c6061cff22f55b09fa8930e51c889cc9fc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 2 Jun 2017 18:35:07 +0000 Subject: [PATCH 7704/7878] On Windows, OS2 and BEOS, the singluar lock mechanisms were already compatible with timed locks, so there is no delta between DEFAULT and DEFAULT_TIMED. Avoid gratuitous API changes to typical OS lock information. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1797415 13f79535-47bb-0310-9956-ffa450edef68 --- locks/beos/proc_mutex.c | 6 +++--- locks/os2/proc_mutex.c | 6 +++--- locks/win32/proc_mutex.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index d253ad5be88..35a5e8f107e 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -168,7 +168,7 @@ APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) APR_DECLARE(apr_lockmech_e) apr_proc_mutex_mech(apr_proc_mutex_t *mutex) { - return APR_LOCK_DEFAULT_TIMED; + return APR_LOCK_DEFAULT; } APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) @@ -194,7 +194,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get_ex(apr_os_proc_mutex_t *ospmutex ospmutex->sem = pmutex->Lock; ospmutex->ben = pmutex->LockCount; if (mech) { - *mech = APR_LOCK_DEFAULT_TIMED; + *mech = APR_LOCK_DEFAULT; } return APR_SUCCESS; } @@ -236,7 +236,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *pool) { - return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT_TIMED, + return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT, 0, pool); } diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index de2e66aeb19..a86c208b324 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -62,7 +62,7 @@ APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) APR_DECLARE(apr_lockmech_e) apr_proc_mutex_mech(apr_proc_mutex_t *mutex) { - return APR_LOCK_DEFAULT_TIMED; + return APR_LOCK_DEFAULT; } APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) @@ -240,7 +240,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get_ex(apr_os_proc_mutex_t *ospmutex { *ospmutex = pmutex->hMutex; if (mech) { - *mech = APR_LOCK_DEFAULT_TIMED; + *mech = APR_LOCK_DEFAULT; } return APR_SUCCESS; } @@ -283,7 +283,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *pool) { - return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT_TIMED, + return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT, 0, pool); } diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 2370bcc8e89..e132e20a2e3 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -228,7 +228,7 @@ APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) APR_DECLARE(apr_lockmech_e) apr_proc_mutex_mech(apr_proc_mutex_t *mutex) { - return APR_LOCK_DEFAULT_TIMED; + return APR_LOCK_DEFAULT; } APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) @@ -253,7 +253,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get_ex(apr_os_proc_mutex_t *ospmutex { *ospmutex = pmutex->handle; if (mech) { - *mech = APR_LOCK_DEFAULT_TIMED; + *mech = APR_LOCK_DEFAULT; } return APR_SUCCESS; } @@ -295,7 +295,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *pool) { - return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT_TIMED, + return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT, 0, pool); } From ce544b0c6148873e531b17297fc8cb73946a3b9d Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Fri, 2 Jun 2017 19:58:55 +0000 Subject: [PATCH 7705/7878] Save some cycles by not copying the pollfds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1797422 13f79535-47bb-0310-9956-ffa450edef68 --- memcache/apr_memcache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c index 8cd1e1d0e70..cfaf5db92d6 100644 --- a/memcache/apr_memcache.c +++ b/memcache/apr_memcache.c @@ -1296,7 +1296,8 @@ apr_memcache_multgetp(apr_memcache_t *mc, /* create polling structures */ pollfds = apr_pcalloc(temp_pool, apr_hash_count(server_queries) * sizeof(apr_pollfd_t)); - rv = apr_pollset_create(&pollset, apr_hash_count(server_queries), temp_pool, 0); + rv = apr_pollset_create(&pollset, apr_hash_count(server_queries), temp_pool, + APR_POLLSET_NOCOPY); if (rv != APR_SUCCESS) { query_hash_index = apr_hash_first(temp_pool, server_queries); From 1116d61e301a749eaedc8fbf827d89e66a01ac86 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 8 Jun 2017 18:39:35 +0000 Subject: [PATCH 7706/7878] Rather than fetch-me-a-rock, report all tool check results for all the tools on any attempt, then fail if any of the tools are missing/old. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1798105 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 78 ++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 532602e911b..ab5df445c4a 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -1,35 +1,37 @@ #! /bin/sh echo "buildconf: checking installation..." +res=0 # any python python=`build/PrintPath python` if test -z "$python"; then -echo "buildconf: python not found." -echo " You need python installed" -echo " to build APR from SVN." -exit 1 + echo "buildconf: python not found." + echo " You need python installed" + echo " to build APR from SVN." + res=1 else -py_version=`python -c 'import sys; print sys.version' 2>&1|sed 's/ .*//;q'` -echo "buildconf: python version $py_version (ok)" + py_version=`python -c 'import sys; print sys.version' 2>&1|sed 's/ .*//;q'` + echo "buildconf: python version $py_version (ok)" fi # autoconf 2.59 or newer ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;q'` if test -z "$ac_version"; then -echo "buildconf: autoconf not found." -echo " You need autoconf version 2.59 or newer installed" -echo " to build APR from SVN." -exit 1 -fi -IFS=.; set $ac_version; IFS=' ' -if test "$1" = "2" -a "$2" -lt "59" || test "$1" -lt "2"; then -echo "buildconf: autoconf version $ac_version found." -echo " You need autoconf version 2.59 or newer installed" -echo " to build APR from SVN." -exit 1 + echo "buildconf: autoconf not found." + echo " You need autoconf version 2.59 or newer installed" + echo " to build APR from SVN." + res=1 else -echo "buildconf: autoconf version $ac_version (ok)" + IFS=.; set $ac_version; IFS=' ' + if test "$1" = "2" -a "$2" -lt "59" || test "$1" -lt "2"; then + echo "buildconf: autoconf version $ac_version found." + echo " You need autoconf version 2.59 or newer installed" + echo " to build APR from SVN." + res=1 + else + echo "buildconf: autoconf version $ac_version (ok)" + fi fi # Sample libtool --version outputs: @@ -41,26 +43,28 @@ fi libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14` lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` if test -z "$lt_pversion"; then -echo "buildconf: libtool not found." -echo " You need libtool version 1.4 or newer installed" -echo " to build APR from SVN." -exit 1 -fi -lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` -IFS=.; set $lt_version; IFS=' ' -lt_status="good" -if test "$1" = "1"; then - if test "$2" -lt "4"; then + echo "buildconf: libtool not found." + echo " You need libtool version 1.4 or newer installed" + echo " to build APR from SVN." + res=1 +else + lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` + IFS=.; set $lt_version; IFS=' ' + lt_status="good" + if test "$1" = "1"; then + if test "$2" -lt "4"; then lt_status="bad" - fi -fi -if test $lt_status = "good"; then - echo "buildconf: libtool version $lt_pversion (ok)" - exit 0 + fi + fi + if test $lt_status = "good"; then + echo "buildconf: libtool version $lt_pversion (ok)" + else + echo "buildconf: libtool version $lt_pversion found." + echo " You need libtool version 1.4 or newer installed" + echo " to build APR from SVN." + res=1 + fi fi -echo "buildconf: libtool version $lt_pversion found." -echo " You need libtool version 1.4 or newer installed" -echo " to build APR from SVN." +exit $res -exit 1 From 9c527d66732cbd568d2eefa595ffd098229b48d6 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Thu, 17 Aug 2017 15:56:48 +0000 Subject: [PATCH 7707/7878] apr_socket_listen(): Allow larger backlog queue lengths on Windows 8+. Starting with Windows 8, the socket listen() function accepts a special SOMAXCONN_HINT(N) argument that allows making the backlog queue length larger than the otherwise predefined limit of around 200: https://msdn.microsoft.com/en-us/library/windows/desktop/ms739168 https://blogs.msdn.microsoft.com/winsdk/2015/06/01/winsocks-listen-backlog-offers-more-flexibility-in-windows-8/ Having a larger listen backlog can be used for certain high performance applications that need to handle lots of incoming connections. One example would be the httpd server with it's "ListenBacklog" directive where setting it to a larger value currently allows serving more concurrent connections on Windows with mpm_winnt. * include/arch/win32/apr_arch_misc.h (enum apr_oslevel_e): Add APR_WIN_8. * misc/win32/misc.c (apr_get_oslevel): Determine whether we are running on Windows 7 or on Windows 8+. * network_io/win32/sockets.c (apr_socket_listen): Use SOMAXCONN_HINT() if it's supported by both the SDK we are building against and the Windows version we are running on. Patch by: Evgeny Kotkov git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1805309 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/arch/win32/apr_arch_misc.h | 3 ++- misc/win32/misc.c | 4 +++- network_io/win32/sockets.c | 23 ++++++++++++++++++++++- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index c38fd0e76b2..a0823b77f37 100644 --- a/CHANGES +++ b/CHANGES @@ -129,6 +129,9 @@ Changes for APR 2.0.0 *) Merge APR-util into APR. [various] + *) apr_socket_listen: Allow larger listen backlog values on Windows 8+. + [Evgeny Kotkov ] + Changes for APR and APR-util 1.6.x and later: *) http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/CHANGES?view=markup diff --git a/include/arch/win32/apr_arch_misc.h b/include/arch/win32/apr_arch_misc.h index b2fb98b0736..2ee562ec375 100644 --- a/include/arch/win32/apr_arch_misc.h +++ b/include/arch/win32/apr_arch_misc.h @@ -105,7 +105,8 @@ typedef enum { APR_WIN_XP_SP2 = 62, APR_WIN_2003 = 70, APR_WIN_VISTA = 80, - APR_WIN_7 = 90 + APR_WIN_7 = 90, + APR_WIN_8 = 100 } apr_oslevel_e; extern APR_DECLARE_DATA apr_oslevel_e apr_os_level; diff --git a/misc/win32/misc.c b/misc/win32/misc.c index c4c5a4473cc..337739ca128 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -99,8 +99,10 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) else if (oslev.dwMajorVersion == 6) { if (oslev.dwMinorVersion == 0) apr_os_level = APR_WIN_VISTA; - else + else if (oslev.dwMinorVersion == 1) apr_os_level = APR_WIN_7; + else + apr_os_level = APR_WIN_8; } else { apr_os_level = APR_WIN_XP; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index be7ddcbde99..9c30f70eb4d 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -24,6 +24,13 @@ #include "apr_arch_inherit.h" #include "apr_arch_misc.h" +/* Borrow the definition of SOMAXCONN_HINT() from Windows SDK 8, + * in case the SDK we are building against doesn't have it. + */ +#ifndef SOMAXCONN_HINT +#define SOMAXCONN_HINT(b) (-(b)) +#endif + static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */ static apr_status_t socket_cleanup(void *sock) @@ -223,7 +230,21 @@ APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, apr_int32_t backlog) { - if (listen(sock->socketdes, backlog) == SOCKET_ERROR) + int backlog_val; + + if (apr_os_level >= APR_WIN_8) { + /* Starting from Windows 8, listen() accepts a special SOMAXCONN_HINT() + * arg that allows setting the listen backlog value to a larger + * value than the predefined Winsock 2 limit (several hundred). + * https://blogs.msdn.microsoft.com/winsdk/2015/06/01/winsocks-listen-backlog-offers-more-flexibility-in-windows-8/ + */ + backlog_val = SOMAXCONN_HINT(backlog); + } + else { + backlog_val = backlog; + } + + if (listen(sock->socketdes, backlog_val) == SOCKET_ERROR) return apr_get_netos_error(); else return APR_SUCCESS; From bbb6f299e7ad9fce0c48bc39d69f77380964c46e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 18 Aug 2017 08:40:35 +0000 Subject: [PATCH 7708/7878] * include/arch/unix/apr_arch_poll_private.h, poll/unix/poll/*.c: Constify all apr_pollcb_provider_t and apr_pollset_provider_t structures. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1805380 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_poll_private.h | 4 ++-- poll/unix/epoll.c | 8 ++++---- poll/unix/kqueue.c | 8 ++++---- poll/unix/poll.c | 8 ++++---- poll/unix/pollcb.c | 14 +++++++------- poll/unix/pollset.c | 20 ++++++++++---------- poll/unix/port.c | 8 ++++---- poll/unix/select.c | 4 ++-- poll/unix/z_asio.c | 4 ++-- 9 files changed, 39 insertions(+), 39 deletions(-) diff --git a/include/arch/unix/apr_arch_poll_private.h b/include/arch/unix/apr_arch_poll_private.h index 5c50e9843a1..ff813123134 100644 --- a/include/arch/unix/apr_arch_poll_private.h +++ b/include/arch/unix/apr_arch_poll_private.h @@ -126,7 +126,7 @@ struct apr_pollset_t apr_file_t *wakeup_pipe[2]; apr_pollfd_t wakeup_pfd; apr_pollset_private_t *p; - apr_pollset_provider_t *provider; + const apr_pollset_provider_t *provider; }; typedef union { @@ -156,7 +156,7 @@ struct apr_pollcb_t { int fd; apr_pollcb_pset pollset; apr_pollfd_t **copyset; - apr_pollcb_provider_t *provider; + const apr_pollcb_provider_t *provider; }; struct apr_pollset_provider_t { diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index af10145aa4d..02db48a4028 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -320,7 +320,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, return rv; } -static apr_pollset_provider_t impl = { +static const apr_pollset_provider_t impl = { impl_pollset_create, impl_pollset_add, impl_pollset_remove, @@ -329,7 +329,7 @@ static apr_pollset_provider_t impl = { "epoll" }; -apr_pollset_provider_t *apr_pollset_provider_epoll = &impl; +const apr_pollset_provider_t *const apr_pollset_provider_epoll = &impl; static apr_status_t impl_pollcb_cleanup(apr_pollcb_t *pollcb) { @@ -476,7 +476,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, return rv; } -static apr_pollcb_provider_t impl_cb = { +static const apr_pollcb_provider_t impl_cb = { impl_pollcb_create, impl_pollcb_add, impl_pollcb_remove, @@ -485,6 +485,6 @@ static apr_pollcb_provider_t impl_cb = { "epoll" }; -apr_pollcb_provider_t *apr_pollcb_provider_epoll = &impl_cb; +const apr_pollcb_provider_t *const apr_pollcb_provider_epoll = &impl_cb; #endif /* HAVE_EPOLL */ diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index d8043490388..6a0ae614a95 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -316,7 +316,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, return rv; } -static apr_pollset_provider_t impl = { +static const apr_pollset_provider_t impl = { impl_pollset_create, impl_pollset_add, impl_pollset_remove, @@ -325,7 +325,7 @@ static apr_pollset_provider_t impl = { "kqueue" }; -apr_pollset_provider_t *apr_pollset_provider_kqueue = &impl; +const apr_pollset_provider_t *apr_pollset_provider_kqueue = &impl; static apr_status_t impl_pollcb_cleanup(apr_pollcb_t *pollcb) { @@ -491,7 +491,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, return rv; } -static apr_pollcb_provider_t impl_cb = { +static const apr_pollcb_provider_t impl_cb = { impl_pollcb_create, impl_pollcb_add, impl_pollcb_remove, @@ -500,6 +500,6 @@ static apr_pollcb_provider_t impl_cb = { "kqueue" }; -apr_pollcb_provider_t *apr_pollcb_provider_kqueue = &impl_cb; +const apr_pollcb_provider_t *apr_pollcb_provider_kqueue = &impl_cb; #endif /* HAVE_KQUEUE */ diff --git a/poll/unix/poll.c b/poll/unix/poll.c index d8989aa430f..f148f5e50d3 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -299,7 +299,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, return rv; } -static apr_pollset_provider_t impl = { +static const apr_pollset_provider_t impl = { impl_pollset_create, impl_pollset_add, impl_pollset_remove, @@ -308,7 +308,7 @@ static apr_pollset_provider_t impl = { "poll" }; -apr_pollset_provider_t *apr_pollset_provider_poll = &impl; +const apr_pollset_provider_t *apr_pollset_provider_poll = &impl; /* Poll method pollcb. * This is probably usable only for WIN32 having WSAPoll @@ -446,7 +446,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, return rv; } -static apr_pollcb_provider_t impl_cb = { +static const apr_pollcb_provider_t impl_cb = { impl_pollcb_create, impl_pollcb_add, impl_pollcb_remove, @@ -455,6 +455,6 @@ static apr_pollcb_provider_t impl_cb = { "poll" }; -apr_pollcb_provider_t *apr_pollcb_provider_poll = &impl_cb; +const apr_pollcb_provider_t *apr_pollcb_provider_poll = &impl_cb; #endif /* HAVE_POLL */ diff --git a/poll/unix/pollcb.c b/poll/unix/pollcb.c index ca98125204e..a63ad5c9cad 100644 --- a/poll/unix/pollcb.c +++ b/poll/unix/pollcb.c @@ -29,21 +29,21 @@ static apr_pollset_method_e pollset_default_method = POLLSET_DEFAULT_METHOD; #if defined(HAVE_KQUEUE) -extern apr_pollcb_provider_t *apr_pollcb_provider_kqueue; +extern const apr_pollcb_provider_t *apr_pollcb_provider_kqueue; #endif #if defined(HAVE_PORT_CREATE) -extern apr_pollcb_provider_t *apr_pollcb_provider_port; +extern const apr_pollcb_provider_t *apr_pollcb_provider_port; #endif #if defined(HAVE_EPOLL) -extern apr_pollcb_provider_t *apr_pollcb_provider_epoll; +extern const apr_pollcb_provider_t *apr_pollcb_provider_epoll; #endif #if defined(HAVE_POLL) -extern apr_pollcb_provider_t *apr_pollcb_provider_poll; +extern const apr_pollcb_provider_t *apr_pollcb_provider_poll; #endif -static apr_pollcb_provider_t *pollcb_provider(apr_pollset_method_e method) +static const apr_pollcb_provider_t *pollcb_provider(apr_pollset_method_e method) { - apr_pollcb_provider_t *provider = NULL; + const apr_pollcb_provider_t *provider = NULL; switch (method) { case APR_POLLSET_KQUEUE: #if defined(HAVE_KQUEUE) @@ -95,7 +95,7 @@ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **ret_pollcb, { apr_status_t rv; apr_pollcb_t *pollcb; - apr_pollcb_provider_t *provider = NULL; + const apr_pollcb_provider_t *provider = NULL; *ret_pollcb = NULL; diff --git a/poll/unix/pollset.c b/poll/unix/pollset.c index 4fa4ffad3eb..8fa817330f6 100644 --- a/poll/unix/pollset.c +++ b/poll/unix/pollset.c @@ -44,25 +44,25 @@ static apr_status_t pollset_cleanup(void *p) } #if defined(HAVE_KQUEUE) -extern apr_pollset_provider_t *apr_pollset_provider_kqueue; +extern const apr_pollset_provider_t *apr_pollset_provider_kqueue; #endif #if defined(HAVE_PORT_CREATE) -extern apr_pollset_provider_t *apr_pollset_provider_port; +extern const apr_pollset_provider_t *apr_pollset_provider_port; #endif #if defined(HAVE_EPOLL) -extern apr_pollset_provider_t *apr_pollset_provider_epoll; +extern const apr_pollset_provider_t *apr_pollset_provider_epoll; #endif #if defined(HAVE_AIO_MSGQ) -extern apr_pollset_provider_t *apr_pollset_provider_aio_msgq; +extern const apr_pollset_provider_t *apr_pollset_provider_aio_msgq; #endif #if defined(HAVE_POLL) -extern apr_pollset_provider_t *apr_pollset_provider_poll; +extern const apr_pollset_provider_t *apr_pollset_provider_poll; #endif -extern apr_pollset_provider_t *apr_pollset_provider_select; +extern const apr_pollset_provider_t *apr_pollset_provider_select; -static apr_pollset_provider_t *pollset_provider(apr_pollset_method_e method) +static const apr_pollset_provider_t *pollset_provider(apr_pollset_method_e method) { - apr_pollset_provider_t *provider = NULL; + const apr_pollset_provider_t *provider = NULL; switch (method) { case APR_POLLSET_KQUEUE: #if defined(HAVE_KQUEUE) @@ -106,7 +106,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **ret_pollset, { apr_status_t rv; apr_pollset_t *pollset; - apr_pollset_provider_t *provider = NULL; + const apr_pollset_provider_t *provider = NULL; *ret_pollset = NULL; @@ -190,7 +190,7 @@ APR_DECLARE(const char *) apr_pollset_method_name(apr_pollset_t *pollset) APR_DECLARE(const char *) apr_poll_method_defname() { - apr_pollset_provider_t *provider = NULL; + const apr_pollset_provider_t *provider = NULL; provider = pollset_provider(pollset_default_method); if (provider) diff --git a/poll/unix/port.c b/poll/unix/port.c index 67432937fc4..a436f62d840 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -455,7 +455,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, return rv; } -static apr_pollset_provider_t impl = { +static const apr_pollset_provider_t impl = { impl_pollset_create, impl_pollset_add, impl_pollset_remove, @@ -464,7 +464,7 @@ static apr_pollset_provider_t impl = { "port" }; -apr_pollset_provider_t *apr_pollset_provider_port = &impl; +const apr_pollset_provider_t *apr_pollset_provider_port = &impl; static apr_status_t impl_pollcb_cleanup(apr_pollcb_t *pollcb) { @@ -588,7 +588,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, return rv; } -static apr_pollcb_provider_t impl_cb = { +static const apr_pollcb_provider_t impl_cb = { impl_pollcb_create, impl_pollcb_add, impl_pollcb_remove, @@ -597,6 +597,6 @@ static apr_pollcb_provider_t impl_cb = { "port" }; -apr_pollcb_provider_t *apr_pollcb_provider_port = &impl_cb; +const apr_pollcb_provider_t *apr_pollcb_provider_port = &impl_cb; #endif /* HAVE_PORT_CREATE */ diff --git a/poll/unix/select.c b/poll/unix/select.c index 214111a40e2..51be3c1cd5f 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -437,7 +437,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, return rv; } -static apr_pollset_provider_t impl = { +static const apr_pollset_provider_t impl = { impl_pollset_create, impl_pollset_add, impl_pollset_remove, @@ -446,4 +446,4 @@ static apr_pollset_provider_t impl = { "select" }; -apr_pollset_provider_t *apr_pollset_provider_select = &impl; +const apr_pollset_provider_t *apr_pollset_provider_select = &impl; diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index ae03079fb53..48b531cc8c7 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -768,7 +768,7 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, return rv; } /* end of asio_pollset_poll */ -static apr_pollset_provider_t impl = { +static const apr_pollset_provider_t impl = { asio_pollset_create, asio_pollset_add, asio_pollset_remove, @@ -777,6 +777,6 @@ static apr_pollset_provider_t impl = { "asio" }; -apr_pollset_provider_t *apr_pollset_provider_aio_msgq = &impl; +const apr_pollset_provider_t *apr_pollset_provider_aio_msgq = &impl; #endif /* HAVE_AIO_MSGQ */ From 9cdc87d35dd60ee762f51739a445169be74d9fbb Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Sat, 26 Aug 2017 13:36:40 +0000 Subject: [PATCH 7709/7878] Factor out common code in apr_pools.c. No function changes intended. * memory/unix/apr_pools.c (allocator_lock, allocator_unlock): New helpers. (apr_allocator_max_free_set, allocator_alloc, allocator_free): Use allocator_lock() and allocator_unlock(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1806296 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 71 ++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 43 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index d2ff53dcdcc..3146433590b 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -151,6 +151,24 @@ struct apr_allocator_t { * Allocator */ +static APR_INLINE +void allocator_lock(apr_allocator_t *allocator) +{ +#if APR_HAS_THREADS + if (allocator->mutex) + apr_thread_mutex_lock(allocator->mutex); +#endif /* APR_HAS_THREADS */ +} + +static APR_INLINE +void allocator_unlock(apr_allocator_t *allocator) +{ +#if APR_HAS_THREADS + if (allocator->mutex) + apr_thread_mutex_unlock(allocator->mutex); +#endif /* APR_HAS_THREADS */ +} + APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator) { apr_allocator_t *new_allocator; @@ -220,13 +238,7 @@ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, apr_uint32_t max_free_index; apr_size_t size = in_size; -#if APR_HAS_THREADS - apr_thread_mutex_t *mutex; - - mutex = apr_allocator_mutex_get(allocator); - if (mutex != NULL) - apr_thread_mutex_lock(mutex); -#endif /* APR_HAS_THREADS */ + allocator_lock(allocator); max_free_index = APR_ALIGN(size, BOUNDARY_SIZE) >> BOUNDARY_INDEX; allocator->current_free_index += max_free_index; @@ -235,10 +247,7 @@ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, if (allocator->current_free_index > max_free_index) allocator->current_free_index = max_free_index; -#if APR_HAS_THREADS - if (mutex != NULL) - apr_thread_mutex_unlock(mutex); -#endif + allocator_unlock(allocator); } static APR_INLINE @@ -295,10 +304,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) * our node will fit into. */ if (index <= allocator->max_index) { -#if APR_HAS_THREADS - if (allocator->mutex) - apr_thread_mutex_lock(allocator->mutex); -#endif /* APR_HAS_THREADS */ + allocator_lock(allocator); /* Walk the free list to see if there are * any nodes on it of the requested size @@ -344,28 +350,19 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) if (allocator->current_free_index > allocator->max_free_index) allocator->current_free_index = allocator->max_free_index; -#if APR_HAS_THREADS - if (allocator->mutex) - apr_thread_mutex_unlock(allocator->mutex); -#endif /* APR_HAS_THREADS */ + allocator_unlock(allocator); goto have_node; } -#if APR_HAS_THREADS - if (allocator->mutex) - apr_thread_mutex_unlock(allocator->mutex); -#endif /* APR_HAS_THREADS */ + allocator_unlock(allocator); } /* If we found nothing, seek the sink (at index MAX_INDEX), if * it is not empty. */ else if (allocator->free[MAX_INDEX]) { -#if APR_HAS_THREADS - if (allocator->mutex) - apr_thread_mutex_lock(allocator->mutex); -#endif /* APR_HAS_THREADS */ + allocator_lock(allocator); /* Walk the free list to see if there are * any nodes on it of the requested size @@ -381,18 +378,12 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) if (allocator->current_free_index > allocator->max_free_index) allocator->current_free_index = allocator->max_free_index; -#if APR_HAS_THREADS - if (allocator->mutex) - apr_thread_mutex_unlock(allocator->mutex); -#endif /* APR_HAS_THREADS */ + allocator_unlock(allocator); goto have_node; } -#if APR_HAS_THREADS - if (allocator->mutex) - apr_thread_mutex_unlock(allocator->mutex); -#endif /* APR_HAS_THREADS */ + allocator_unlock(allocator); } /* If we haven't got a suitable node, malloc a new one @@ -435,10 +426,7 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) apr_uint32_t index, max_index; apr_uint32_t max_free_index, current_free_index; -#if APR_HAS_THREADS - if (allocator->mutex) - apr_thread_mutex_lock(allocator->mutex); -#endif /* APR_HAS_THREADS */ + allocator_lock(allocator); max_index = allocator->max_index; max_free_index = allocator->max_free_index; @@ -489,10 +477,7 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) allocator->max_index = max_index; allocator->current_free_index = current_free_index; -#if APR_HAS_THREADS - if (allocator->mutex) - apr_thread_mutex_unlock(allocator->mutex); -#endif /* APR_HAS_THREADS */ + allocator_unlock(allocator); while (freelist != NULL) { node = freelist; From f6dacb9000fbeb6a4119c6256ed5664652c17c79 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Sat, 26 Aug 2017 13:49:39 +0000 Subject: [PATCH 7710/7878] Factor out a helper function that adapts WriteFile() to apr_size_t instead of DWORD. * file_io/win32/readwrite.c (write_helper): New helper function, factored out from ... (apr_file_flush): ...here. Patch by: Evgeny Kotkov git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1806299 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 60 +++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index f473b18311a..02f882616dd 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -257,6 +257,38 @@ APR_DECLARE(apr_status_t) apr_file_rotating_manual_check(apr_file_t *thefile, return APR_ENOTIMPL; } +/* Helper function that adapts WriteFile() to apr_size_t instead + * of DWORD. */ +static apr_status_t write_helper(HANDLE filehand, const char *buf, + apr_size_t len, apr_size_t *pwritten) +{ + apr_size_t remaining = len; + + *pwritten = 0; + do { + DWORD to_write; + DWORD written; + + if (remaining > APR_DWORD_MAX) { + to_write = APR_DWORD_MAX; + } + else { + to_write = (DWORD)remaining; + } + + if (!WriteFile(filehand, buf, to_write, &written, NULL)) { + *pwritten += written; + return apr_get_os_error(); + } + + *pwritten += written; + remaining -= written; + buf += written; + } while (remaining); + + return APR_SUCCESS; +} + APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { apr_status_t rv; @@ -576,34 +608,14 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) { if (thefile->buffered) { - DWORD numbytes, written = 0; apr_status_t rc = 0; - char *buffer; - apr_size_t bytesleft; if (thefile->direction == 1 && thefile->bufpos) { - buffer = thefile->buffer; - bytesleft = thefile->bufpos; - - do { - if (bytesleft > APR_DWORD_MAX) { - numbytes = APR_DWORD_MAX; - } - else { - numbytes = (DWORD)bytesleft; - } - - if (!WriteFile(thefile->filehand, buffer, numbytes, &written, NULL)) { - rc = apr_get_os_error(); - thefile->filePtr += written; - break; - } - - thefile->filePtr += written; - bytesleft -= written; - buffer += written; + apr_size_t written; - } while (bytesleft > 0); + rc = write_helper(thefile->filehand, thefile->buffer, + thefile->bufpos, &written); + thefile->filePtr += written; if (rc == 0) thefile->bufpos = 0; From 8e2b0b4a3e711d656dede0332521319b7db0e9ae Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Sat, 26 Aug 2017 13:57:26 +0000 Subject: [PATCH 7711/7878] Factor out a helper function that contains the implementation of writing to buffered files. * file_io/win32/readwrite.c (write_buffered): New helper function, factored out from ... (apr_file_write): ...here. Patch by: Evgeny Kotkov git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1806301 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 63 +++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 02f882616dd..ee36afc6fc8 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -289,6 +289,39 @@ static apr_status_t write_helper(HANDLE filehand, const char *buf, return APR_SUCCESS; } +static apr_status_t write_buffered(apr_file_t *thefile, const char *buf, + apr_size_t len) +{ + apr_size_t blocksize; + apr_status_t rv; + + if (thefile->direction == 0) { + /* Position file pointer for writing at the offset we are logically reading from */ + apr_off_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + DWORD offlo = (DWORD)offset; + LONG offhi = (LONG)(offset >> 32); + if (offset != thefile->filePtr) + SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); + thefile->bufpos = thefile->dataRead = 0; + thefile->direction = 1; + } + + rv = 0; + while (rv == 0 && len > 0) { + if (thefile->bufpos == thefile->bufsize) /* write buffer is full */ + rv = apr_file_flush(thefile); + + blocksize = len > thefile->bufsize - thefile->bufpos ? + thefile->bufsize - thefile->bufpos : len; + memcpy(thefile->buffer + thefile->bufpos, buf, blocksize); + thefile->bufpos += blocksize; + buf += blocksize; + len -= blocksize; + } + + return rv; +} + APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) { apr_status_t rv; @@ -309,38 +342,10 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } if (thefile->buffered) { - char *pos = (char *)buf; - apr_size_t blocksize; - apr_size_t size = *nbytes; - if (thefile->flags & APR_FOPEN_XTHREAD) { apr_thread_mutex_lock(thefile->mutex); } - - if (thefile->direction == 0) { - /* Position file pointer for writing at the offset we are logically reading from */ - apr_off_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; - DWORD offlo = (DWORD)offset; - LONG offhi = (LONG)(offset >> 32); - if (offset != thefile->filePtr) - SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); - thefile->bufpos = thefile->dataRead = 0; - thefile->direction = 1; - } - - rv = 0; - while (rv == 0 && size > 0) { - if (thefile->bufpos == thefile->bufsize) /* write buffer is full */ - rv = apr_file_flush(thefile); - - blocksize = size > thefile->bufsize - thefile->bufpos ? - thefile->bufsize - thefile->bufpos : size; - memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); - thefile->bufpos += blocksize; - pos += blocksize; - size -= blocksize; - } - + rv = write_buffered(thefile, buf, *nbytes, nbytes); if (thefile->flags & APR_FOPEN_XTHREAD) { apr_thread_mutex_unlock(thefile->mutex); } From a4a0feef5c186e7bd402a6ce04a74137c8c404a5 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Sat, 26 Aug 2017 15:20:02 +0000 Subject: [PATCH 7712/7878] Win32: Improve apr_file_write() performance on buffered files by reducing the amount of WriteFile() calls for large writes. Previously, writing has been implemented with a loop that keeps copying the data to the internal 4KB buffer and writing this buffer to disk by calling WriteFile(4096). This patch reduces the amount of syscalls for large writes by performing them with a single syscall, if possible. If the buffer is not empty at the moment when the large write occurs, it is first filled up to its 4KB capacity, flushed, and the remaining part of the data is written with a single syscall. * file_io/win32/readwrite.c (write_buffered): Within the write loop, check if we have a situation with an empty buffer and a large chunk pending to be written. In this case, bypass the buffering and write the remaining chunk with a single syscall. Return an appropriate number of written bytes to satisfy the apr_file_write() function contract. (apr_file_write): Adjust call to write_buffered(). * test/testfile.c (test_large_write_buffered, test_two_large_writes_buffered, test_small_and_large_writes_buffered, test_write_buffered_spanning_over_bufsize): New tests. (testfile): Run the new tests. Patch by: Evgeny Kotkov git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1806308 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 44 ++++++--- test/testfile.c | 186 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 218 insertions(+), 12 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index ee36afc6fc8..8e9ab6f47bf 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -290,9 +290,8 @@ static apr_status_t write_helper(HANDLE filehand, const char *buf, } static apr_status_t write_buffered(apr_file_t *thefile, const char *buf, - apr_size_t len) + apr_size_t len, apr_size_t *pwritten) { - apr_size_t blocksize; apr_status_t rv; if (thefile->direction == 0) { @@ -306,20 +305,41 @@ static apr_status_t write_buffered(apr_file_t *thefile, const char *buf, thefile->direction = 1; } - rv = 0; - while (rv == 0 && len > 0) { - if (thefile->bufpos == thefile->bufsize) /* write buffer is full */ + *pwritten = 0; + + while (len > 0) { + if (thefile->bufpos == thefile->bufsize) { /* write buffer is full */ rv = apr_file_flush(thefile); + if (rv) { + return rv; + } + } + /* If our buffer is empty, and we cannot fit the remaining chunk + * into it, write the chunk with a single syscall and return. + */ + if (thefile->bufpos == 0 && len > thefile->bufsize) { + apr_size_t written; - blocksize = len > thefile->bufsize - thefile->bufpos ? - thefile->bufsize - thefile->bufpos : len; - memcpy(thefile->buffer + thefile->bufpos, buf, blocksize); - thefile->bufpos += blocksize; - buf += blocksize; - len -= blocksize; + rv = write_helper(thefile->filehand, buf, len, &written); + thefile->filePtr += written; + *pwritten += written; + return rv; + } + else { + apr_size_t blocksize = len; + + if (blocksize > thefile->bufsize - thefile->bufpos) { + blocksize = thefile->bufsize - thefile->bufpos; + } + memcpy(thefile->buffer + thefile->bufpos, buf, blocksize); + thefile->bufpos += blocksize; + buf += blocksize; + len -= blocksize; + *pwritten += blocksize; + } } - return rv; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) diff --git a/test/testfile.c b/test/testfile.c index 477f5791f9f..c4328040535 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -1446,6 +1446,188 @@ static void test_append(abts_case *tc, void *data) apr_file_close(f2); } +static void test_large_write_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testlarge_write_buffered.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, + APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + + /* Test a single large write. */ + len = 80000; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + rv = apr_file_write_full(f, buf, len, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + ABTS_INT_EQUAL(tc, (int)len, (int)bytes_written); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + buf2 = apr_palloc(p, len + 1); + rv = apr_file_read_full(f, buf2, len + 1, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, (int)len, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, len) == 0); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_two_large_writes_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtwo_large_writes_buffered.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, + APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + + /* Test two consecutive large writes. */ + len = 80000; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + + rv = apr_file_write_full(f, buf, len / 2, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + ABTS_INT_EQUAL(tc, (int)(len / 2), (int)bytes_written); + + rv = apr_file_write_full(f, buf, len / 2, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + ABTS_INT_EQUAL(tc, (int)(len / 2), (int)bytes_written); + + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + buf2 = apr_palloc(p, len + 1); + rv = apr_file_read_full(f, buf2, len + 1, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, (int) len, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, len) == 0); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_small_and_large_writes_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtwo_large_writes_buffered.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, + APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + + /* Test small write followed by a large write. */ + len = 80000; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + + rv = apr_file_write_full(f, buf, 5, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + ABTS_INT_EQUAL(tc, 5, (int)bytes_written); + + rv = apr_file_write_full(f, buf, len - 5, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + ABTS_INT_EQUAL(tc, (int)(len - 5), (int)bytes_written); + + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + buf2 = apr_palloc(p, len + 1); + rv = apr_file_read_full(f, buf2, len + 1, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, (int) len, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, len) == 0); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_write_buffered_spanning_over_bufsize(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testwrite_buffered_spanning_over_bufsize.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, + APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + + /* Test three writes than span over the default buffer size. */ + len = APR_BUFFERSIZE + 1; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + + rv = apr_file_write_full(f, buf, APR_BUFFERSIZE - 1, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + ABTS_INT_EQUAL(tc, APR_BUFFERSIZE - 1, (int)bytes_written); + + rv = apr_file_write_full(f, buf, 2, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + ABTS_INT_EQUAL(tc, 2, (int)bytes_written); + + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + buf2 = apr_palloc(p, len + 1); + rv = apr_file_read_full(f, buf2, len + 1, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, (int)len, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, len) == 0); + apr_file_close(f); + + apr_file_remove(fname, p); +} + abts_suite *testfile(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -1495,6 +1677,10 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_buffer_set_get, NULL); abts_run_test(suite, test_xthread, NULL); abts_run_test(suite, test_append, NULL); + abts_run_test(suite, test_large_write_buffered, NULL); + abts_run_test(suite, test_two_large_writes_buffered, NULL); + abts_run_test(suite, test_small_and_large_writes_buffered, NULL); + abts_run_test(suite, test_write_buffered_spanning_over_bufsize, NULL); return suite; } From 6425b867b24db7ee1aa9537a6cffebf083de6696 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Tue, 29 Aug 2017 13:49:03 +0000 Subject: [PATCH 7713/7878] Minor refactoring of the Win32 file write code. * file_io/win32/readwrite.c (apr_file_write): Reuse the existing 'rv' variable to store the status code. Reduce the scope of the 'offset' variable. Patch by: Evgeny Kotkov git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1806592 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 8e9ab6f47bf..8daa220de1b 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -372,24 +372,24 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a return rv; } else { if (!thefile->pipe) { - apr_off_t offset = 0; - apr_status_t rc; if (thefile->append) { + apr_off_t offset = 0; + /* apr_file_lock will mutex the file across processes. * The call to apr_thread_mutex_lock is added to avoid * a race condition between LockFile and WriteFile * that occasionally leads to deadlocked threads. */ apr_thread_mutex_lock(thefile->mutex); - rc = apr_file_lock(thefile, APR_FLOCK_EXCLUSIVE); - if (rc != APR_SUCCESS) { + rv = apr_file_lock(thefile, APR_FLOCK_EXCLUSIVE); + if (rv != APR_SUCCESS) { apr_thread_mutex_unlock(thefile->mutex); - return rc; + return rv; } - rc = apr_file_seek(thefile, APR_END, &offset); - if (rc != APR_SUCCESS) { + rv = apr_file_seek(thefile, APR_END, &offset); + if (rv != APR_SUCCESS) { apr_thread_mutex_unlock(thefile->mutex); - return rc; + return rv; } } if (thefile->pOverlapped) { From 535c285d94c36499263ade2f8ff1a3d34f722874 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Tue, 29 Aug 2017 14:59:11 +0000 Subject: [PATCH 7714/7878] Minor refactoring of the Win32 file write code. * file_io/win32/readwrite.c (apr_file_write): Update filePtr in the asynchronous I/O mode after the WriteFile() call. This allows simplifying the condition by not checking for thefile->pipe property. Patch by: Evgeny Kotkov git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1806603 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 8daa220de1b..e68fe9e113c 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -398,6 +398,9 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote, thefile->pOverlapped); + if (rv == APR_SUCCESS && thefile->pOverlapped) { + thefile->filePtr += *nbytes; + } if (thefile->append) { apr_file_unlock(thefile); apr_thread_mutex_unlock(thefile->mutex); @@ -453,9 +456,6 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } } } - if (rv == APR_SUCCESS && thefile->pOverlapped && !thefile->pipe) { - thefile->filePtr += *nbytes; - } } return rv; } From b385b9a94f80aaff3e7694e3f699129e2c359f5c Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Tue, 29 Aug 2017 15:03:27 +0000 Subject: [PATCH 7715/7878] Minor refactoring of the Win32 file write code. * file_io/win32/readwrite.c (apr_file_write): Invert the if-else clauses to test against the positive condition. Patch by: Evgeny Kotkov git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1806604 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index e68fe9e113c..5b7f9b56ae2 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -371,7 +371,11 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } return rv; } else { - if (!thefile->pipe) { + if (thefile->pipe) { + rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote, + thefile->pOverlapped); + } + else { if (thefile->append) { apr_off_t offset = 0; @@ -406,10 +410,6 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a apr_thread_mutex_unlock(thefile->mutex); } } - else { - rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote, - thefile->pOverlapped); - } if (rv) { *nbytes = bwrote; rv = APR_SUCCESS; From ebf178a20a4b3c3a78fd931e435e4e48e7ff52d3 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Tue, 29 Aug 2017 15:14:44 +0000 Subject: [PATCH 7716/7878] Win32: Fix a deadlock when appending to locked files (PR50058). Currently, appending data to a file opened with APR_FOPEN_APPEND that has been locked by apr_file_lock() will cause a deadlock on Windows. [See PR50058, https://bz.apache.org/bugzilla/show_bug.cgi?id=50058] This issue happens because atomic O_APPEND-style appends on Windows are implemented using file locks. An append happens while holding the file lock acquired with LockFile(), which is required to avoid a race condition between seeking to the end of file and writing data. The race is possible when multiple threads or processes are appending data to the same file. This approach causes a deadlock if the file has been previously locked with apr_file_lock(). (Note that it's perfectly legit to lock the file or its portion and perform the append after that.) Apart from this, using file locks for file appends impacts their speed and robustness. There is an overhead associated with locking the file, especially if the file is not local. The robustness is affected, because other writes to the same file may fail due to it being locked. Also, if a process is terminated in the middle of the append operation, it might take some time for the OS to release the file lock. During this time, the file would be inaccessible to other processes. This may affect applications such as httpd (with a multi-process MPM) that use APR_FOPEN_APPEND files for logging. This patch fixes the issue by switching to the documented way to atomically append data with a single WriteFile() call. It requires passing special OVERLAPPED.Offset and OffsetHigh values (0xFFFFFFFF). On the ZwWriteFile() layer, this maps to a FILE_WRITE_TO_END_OF_FILE constant that instructs the OS (the corresponding file system driver) to write data to the file's end. Note that this approach is only used for files opened for synchronous I/O because in this case the I/O Manager maintains the current file position. Otherwise, the file offset returned or changed by the SetFilePointer() API is not guaranteed to be valid and that could, for instance, break apr_file_seek() calls after appending data. Sadly, if a file is opened for asynchronous I/O, this call to WriteFile() doesn't update the OVERLAPPED.Offset member to reflect the actual offset used when appending the data (which we could then use to make seeking and other operations involving filePtr work). Therefore, when appending to files opened for asynchronous I/O, we still use the old LockFile + SetFilePointer + WriteFile approach. Additional details on this can be found in: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365747 https://msdn.microsoft.com/en-us/library/windows/hardware/ff567121 * file_io/win32/readwrite.c (apr_file_write): For files opened for synchronous I/O, use the documented way to perform an atomic append with a single WriteFile(). * test/testfile.c (): Include apr_thread_proc.h and apr_strings_.h (struct thread_file_append_ctx_t, thread_file_append_func): New test helpers. (test_atomic_append, test_append_locked): New tests. (testfile): Run the new tests. * CHANGES: Add changelog entry. Patch by: Evgeny Kotkov git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1806608 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + file_io/win32/readwrite.c | 33 ++++++++ test/testfile.c | 167 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 203 insertions(+) diff --git a/CHANGES b/CHANGES index a0823b77f37..6b926195c3e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Fix a deadlock when writing to locked files opened with APR_FOPEN_APPEND + on Windows. PR 50058. + [Evgeny Kotkov ] *) apr_file_trunc: Truncating a buffered file could add unexpected data after the truncate position. PR 51017. diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 5b7f9b56ae2..8aec4c80fff 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -375,6 +375,39 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote, thefile->pOverlapped); } + else if (thefile->append && !thefile->pOverlapped) { + OVERLAPPED ov = {0}; + + /* If the file is opened for synchronous I/O, take advantage of the + * documented way to atomically append data by calling WriteFile() + * with both the OVERLAPPED.Offset and OffsetHigh members set to + * 0xFFFFFFFF. This avoids calling LockFile() that is otherwise + * required to avoid a race condition between seeking to the end + * and writing data. Not locking the file improves robustness of + * such appends and avoids a deadlock when appending to an already + * locked file, as described in PR50058. + * + * We use this approach only for files opened for synchronous I/O + * because in this case the I/O Manager maintains the current file + * position. Otherwise, the file offset returned or changed by + * the SetFilePointer() API is not guaranteed to be valid and that + * could, for instance, break apr_file_seek() calls after appending + * data. Sadly, if a file is opened for asynchronous I/O, this + * call doesn't update the OVERLAPPED.Offset member to reflect the + * actual offset used when appending the data (which we could then + * use to make seeking and other operations involving filePtr work). + * Therefore, when appending to files opened for asynchronous I/O, + * we still use the LockFile + SetFilePointer + WriteFile approach. + * + * References: + * https://bz.apache.org/bugzilla/show_bug.cgi?id=50058 + * https://msdn.microsoft.com/en-us/library/windows/desktop/aa365747 + * https://msdn.microsoft.com/en-us/library/windows/hardware/ff567121 + */ + ov.Offset = MAXDWORD; + ov.OffsetHigh = MAXDWORD; + rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote, &ov); + } else { if (thefile->append) { apr_off_t offset = 0; diff --git a/test/testfile.c b/test/testfile.c index c4328040535..f3cccdbb105 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -21,6 +21,8 @@ #include "apr_general.h" #include "apr_poll.h" #include "apr_lib.h" +#include "apr_strings.h" +#include "apr_thread_proc.h" #include "testutil.h" #define DIRNAME "data" @@ -1628,6 +1630,169 @@ static void test_write_buffered_spanning_over_bufsize(abts_case *tc, void *data) apr_file_remove(fname, p); } +typedef struct thread_file_append_ctx_t { + apr_pool_t *pool; + const char *fname; + apr_size_t chunksize; + char val; + int num_writes; + char *errmsg; +} thread_file_append_ctx_t; + +static void * APR_THREAD_FUNC thread_file_append_func(apr_thread_t *thd, void *data) +{ + thread_file_append_ctx_t *ctx = data; + apr_status_t rv; + apr_file_t *f; + int i; + char *writebuf; + char *readbuf; + + rv = apr_file_open(&f, ctx->fname, + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_APPEND, + APR_FPROT_OS_DEFAULT, ctx->pool); + if (rv) { + apr_thread_exit(thd, rv); + return NULL; + } + + writebuf = apr_palloc(ctx->pool, ctx->chunksize); + memset(writebuf, ctx->val, ctx->chunksize); + readbuf = apr_palloc(ctx->pool, ctx->chunksize); + + for (i = 0; i < ctx->num_writes; i++) { + apr_size_t bytes_written; + apr_size_t bytes_read; + apr_off_t offset; + + rv = apr_file_write_full(f, writebuf, ctx->chunksize, &bytes_written); + if (rv) { + apr_thread_exit(thd, rv); + return NULL; + } + /* After writing the data, seek back from the current offset and + * verify what we just wrote. */ + offset = -((apr_off_t)ctx->chunksize); + rv = apr_file_seek(f, APR_CUR, &offset); + if (rv) { + apr_thread_exit(thd, rv); + return NULL; + } + rv = apr_file_read_full(f, readbuf, ctx->chunksize, &bytes_read); + if (rv) { + apr_thread_exit(thd, rv); + return NULL; + } + if (memcmp(readbuf, writebuf, ctx->chunksize) != 0) { + ctx->errmsg = apr_psprintf( + ctx->pool, + "Unexpected data at file offset %" APR_OFF_T_FMT, + offset); + apr_thread_exit(thd, APR_SUCCESS); + return NULL; + } + } + + apr_file_close(f); + apr_thread_exit(thd, APR_SUCCESS); + + return NULL; +} + +static void test_atomic_append(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_status_t thread_rv; + apr_file_t *f; + const char *fname = "data/testatomic_append.dat"; + unsigned int seed; + thread_file_append_ctx_t ctx1 = {0}; + thread_file_append_ctx_t ctx2 = {0}; + apr_thread_t *t1; + apr_thread_t *t2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_WRITE | APR_FOPEN_CREATE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "create file", rv); + apr_file_close(f); + + seed = (unsigned int)apr_time_now(); + abts_log_message("Random seed for test_atomic_append() is %u", seed); + srand(seed); + + /* Create two threads appending data to the same file. */ + apr_pool_create(&ctx1.pool, p); + ctx1.fname = fname; + ctx1.chunksize = 1 + rand() % 8192; + ctx1.val = 'A'; + ctx1.num_writes = 1000; + rv = apr_thread_create(&t1, NULL, thread_file_append_func, &ctx1, p); + APR_ASSERT_SUCCESS(tc, "create thread", rv); + + apr_pool_create(&ctx2.pool, p); + ctx2.fname = fname; + ctx2.chunksize = 1 + rand() % 8192; + ctx2.val = 'B'; + ctx2.num_writes = 1000; + rv = apr_thread_create(&t2, NULL, thread_file_append_func, &ctx2, p); + APR_ASSERT_SUCCESS(tc, "create thread", rv); + + rv = apr_thread_join(&thread_rv, t1); + APR_ASSERT_SUCCESS(tc, "join thread", rv); + APR_ASSERT_SUCCESS(tc, "no thread errors", thread_rv); + if (ctx1.errmsg) { + ABTS_FAIL(tc, ctx1.errmsg); + } + rv = apr_thread_join(&thread_rv, t2); + APR_ASSERT_SUCCESS(tc, "join thread", rv); + APR_ASSERT_SUCCESS(tc, "no thread errors", thread_rv); + if (ctx2.errmsg) { + ABTS_FAIL(tc, ctx2.errmsg); + } + + apr_file_remove(fname, p); +} + +static void test_append_locked(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testappend_locked.dat"; + apr_size_t bytes_written; + apr_size_t bytes_read; + char buf[64] = {0}; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, + APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_APPEND, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "create file", rv); + + rv = apr_file_lock(f, APR_FLOCK_EXCLUSIVE); + APR_ASSERT_SUCCESS(tc, "lock file", rv); + + /* PR50058: Appending to a locked file should not deadlock. */ + rv = apr_file_write_full(f, "abc", 3, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + + apr_file_unlock(f); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open file", rv); + + rv = apr_file_read_full(f, buf, sizeof(buf), &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, 3, (int)bytes_read); + ABTS_STR_EQUAL(tc, "abc", buf); + + apr_file_close(f); + apr_file_remove(fname, p); +} + abts_suite *testfile(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -1681,6 +1846,8 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_two_large_writes_buffered, NULL); abts_run_test(suite, test_small_and_large_writes_buffered, NULL); abts_run_test(suite, test_write_buffered_spanning_over_bufsize, NULL); + abts_run_test(suite, test_atomic_append, NULL); + abts_run_test(suite, test_append_locked, NULL); return suite; } From af4e6793035c706fd15832d4f1d5d1f5baafa007 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Tue, 29 Aug 2017 15:15:56 +0000 Subject: [PATCH 7717/7878] Follow-up to r1806308: Add CHANGES entry. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1806610 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 6b926195c3e..34bd8b8d3b8 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,9 @@ Changes for APR 2.0.0 on Windows. PR 50058. [Evgeny Kotkov ] + *) apr_file_write: Optimize large writes to buffered files on Windows. + [Evgeny Kotkov ] + *) apr_file_trunc: Truncating a buffered file could add unexpected data after the truncate position. PR 51017. [Evgeny Kotkov ] From 82b13d2271923a0c7279aac683b4f1e1f0cf3a6d Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Tue, 29 Aug 2017 15:16:49 +0000 Subject: [PATCH 7718/7878] Follow-up to r1806608: Restore formatting in CHANGES file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1806611 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES b/CHANGES index 34bd8b8d3b8..8fef4a0b0e8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Fix a deadlock when writing to locked files opened with APR_FOPEN_APPEND on Windows. PR 50058. [Evgeny Kotkov ] From 55e518ca2df0ceba3b702f3b748fec3847df62eb Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Wed, 30 Aug 2017 15:23:41 +0000 Subject: [PATCH 7719/7878] Revert r1806592 and r1806603 that were meant to be a refactoring of the Win32 file write code, but inadvertently changed the observed behavior. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1806701 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 8aec4c80fff..e2e3e10ca8e 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -409,24 +409,24 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote, &ov); } else { + apr_off_t offset = 0; + apr_status_t rc; if (thefile->append) { - apr_off_t offset = 0; - /* apr_file_lock will mutex the file across processes. * The call to apr_thread_mutex_lock is added to avoid * a race condition between LockFile and WriteFile * that occasionally leads to deadlocked threads. */ apr_thread_mutex_lock(thefile->mutex); - rv = apr_file_lock(thefile, APR_FLOCK_EXCLUSIVE); - if (rv != APR_SUCCESS) { + rc = apr_file_lock(thefile, APR_FLOCK_EXCLUSIVE); + if (rc != APR_SUCCESS) { apr_thread_mutex_unlock(thefile->mutex); - return rv; + return rc; } - rv = apr_file_seek(thefile, APR_END, &offset); - if (rv != APR_SUCCESS) { + rc = apr_file_seek(thefile, APR_END, &offset); + if (rc != APR_SUCCESS) { apr_thread_mutex_unlock(thefile->mutex); - return rv; + return rc; } } if (thefile->pOverlapped) { @@ -435,9 +435,6 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote, thefile->pOverlapped); - if (rv == APR_SUCCESS && thefile->pOverlapped) { - thefile->filePtr += *nbytes; - } if (thefile->append) { apr_file_unlock(thefile); apr_thread_mutex_unlock(thefile->mutex); @@ -489,6 +486,9 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } } } + if (rv == APR_SUCCESS && thefile->pOverlapped && !thefile->pipe) { + thefile->filePtr += *nbytes; + } } return rv; } From ad958385a4180d7a83d90589689fcd36e3bbc57a Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Sun, 10 Sep 2017 22:30:14 +0000 Subject: [PATCH 7720/7878] Bounds-check human-readable date fields (credit: Stefan Sperling) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1807975 13f79535-47bb-0310-9956-ffa450edef68 --- time/unix/time.c | 3 +++ time/win32/time.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/time/unix/time.c b/time/unix/time.c index dfa45e690c6..7f095819276 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -142,6 +142,9 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt) static const int dayoffset[12] = {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; + if (xt->tm_mon < 0 || xt->tm_mon >= 12) + return APR_EBADDATE; + /* shift new year to 1st March in order to make leap year calc easy */ if (xt->tm_mon < 2) diff --git a/time/win32/time.c b/time/win32/time.c index 23497993567..1a705443b2b 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -54,6 +54,9 @@ static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm) static const int dayoffset[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; + if (tm->wMonth < 1 || tm->wMonth > 12) + return APR_EBADDATE; + /* Note; the caller is responsible for filling in detailed tm_usec, * tm_gmtoff and tm_isdst data when applicable. */ @@ -224,6 +227,9 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, static const int dayoffset[12] = {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; + if (xt->tm_mon < 0 || xt->tm_mon >= 12) + return APR_EBADDATE; + /* shift new year to 1st March in order to make leap year calc easy */ if (xt->tm_mon < 2) From 16033d58fceae5ef924cfb94d3cfa7fabde7ce64 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 11 Sep 2017 14:57:08 +0000 Subject: [PATCH 7721/7878] * network_io/unix/sockaddr.c (looks_like_ip): Fail for the empty string. * test/testipsub.c: Test that calling apr_ipsubnet_create with the empty string fails. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1808039 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 4 ++++ test/testipsub.c | 1 + 2 files changed, 5 insertions(+) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 9963c56bac6..54539b8bf6f 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -1053,6 +1053,10 @@ static apr_status_t parse_ip(apr_ipsubnet_t *ipsub, const char *ipstr, int netwo static int looks_like_ip(const char *ipstr) { + if (strlen(ipstr) == 0) { + return 0; + } + if (strchr(ipstr, ':')) { /* definitely not a hostname; assume it is intended to be an IPv6 address */ return 1; diff --git a/test/testipsub.c b/test/testipsub.c index 804bb3dcd38..89a3a1fa143 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -45,6 +45,7 @@ static void test_bad_input(abts_case *tc, void *data) ,{"127.0.0.1.2", NULL, APR_EBADIP} ,{"127.0.0.1.2", "8", APR_EBADIP} ,{"127", "255.0.0.0", APR_EBADIP} /* either EBADIP or EBADMASK seems fine */ + ,{"", NULL, APR_EBADIP} #if APR_HAVE_IPV6 ,{"::1", NULL, APR_SUCCESS} ,{"::1", "20", APR_SUCCESS} From f1437f19bd8e8b56be64688c529e674badb78da2 Mon Sep 17 00:00:00 2001 From: Evgeny Kotkov Date: Fri, 15 Sep 2017 13:25:08 +0000 Subject: [PATCH 7722/7878] Win32: Don't seek to the end when opening files with APR_FOPEN_APPEND. Apparently, this is a leftover from the very first version of handling file appends (https://svn.apache.org/r59449) that performed a single seek to the file's end when opening it and did not support proper atomic appends with multiple process or threads writing to the same file. Since then, such atomic appends have been implemented, but the seek was not removed. It can cause unexpected behavior when reading from a file opened with APR_FOPEN_APPEND, assuming no writes happened to the file. In this case, as there have been no writes, the file offset should not be repositioned and reading should start from the beginning of the file. However, due to the unwanted seek during open, the actual reading would instead start from the file's end and cause an unexpected EOF. * file_io/win32/open.c (apr_file_open): Don't seek to the file's end when the file is opened with APR_FOPEN_APPEND. * test/testfile.c (test_append_read): New test. (testfile): Run the new test. * CHANGES: Add changelog entry. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1808456 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/win32/open.c | 1 - test/testfile.c | 51 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8fef4a0b0e8..e00640dc9d3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Don't seek to the end when opening files with APR_FOPEN_APPEND on Windows. + [Evgeny Kotkov ] + *) Fix a deadlock when writing to locked files opened with APR_FOPEN_APPEND on Windows. PR 50058. [Evgeny Kotkov ] diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 3c00bfc79cd..f1a46286d2c 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -445,7 +445,6 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, if (flag & APR_FOPEN_APPEND) { (*new)->append = 1; - SetFilePointer((*new)->filehand, 0, NULL, FILE_END); } if (flag & APR_FOPEN_BUFFERED) { (*new)->buffered = 1; diff --git a/test/testfile.c b/test/testfile.c index f3cccdbb105..73b13c4bf14 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -1793,6 +1793,56 @@ static void test_append_locked(abts_case *tc, void *data) apr_file_remove(fname, p); } +static void test_append_read(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testappend_read.dat"; + apr_off_t offset; + char buf[64]; + + apr_file_remove(fname, p); + + /* Create file with contents. */ + rv = apr_file_open(&f, fname, APR_FOPEN_WRITE | APR_FOPEN_CREATE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "create file", rv); + + rv = apr_file_puts("abc", f); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + /* Re-open it with APR_FOPEN_APPEND. */ + rv = apr_file_open(&f, fname, + APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_APPEND, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open file", rv); + + /* Test the initial file offset. Even though we used APR_FOPEN_APPEND, + * the offset should be kept in the beginning of the file until the + * first append. (Previously, the Windows implementation performed + * an erroneous seek to the file's end right after opening it.) + */ + offset = 0; + rv = apr_file_seek(f, APR_CUR, &offset); + APR_ASSERT_SUCCESS(tc, "get file offset", rv); + ABTS_INT_EQUAL(tc, 0, (int)offset); + + /* Test reading from the file. */ + rv = apr_file_gets(buf, sizeof(buf), f); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_STR_EQUAL(tc, "abc", buf); + + /* Test the file offset after reading. */ + offset = 0; + rv = apr_file_seek(f, APR_CUR, &offset); + APR_ASSERT_SUCCESS(tc, "get file offset", rv); + ABTS_INT_EQUAL(tc, 3, (int)offset); + + apr_file_close(f); + apr_file_remove(fname, p); +} + abts_suite *testfile(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -1848,6 +1898,7 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_write_buffered_spanning_over_bufsize, NULL); abts_run_test(suite, test_atomic_append, NULL); abts_run_test(suite, test_append_locked, NULL); + abts_run_test(suite, test_append_read, NULL); return suite; } From 691f0b2357fdf63861d668de1febbef7f9738a8b Mon Sep 17 00:00:00 2001 From: Evgeny Kotkov Date: Fri, 15 Sep 2017 13:31:10 +0000 Subject: [PATCH 7723/7878] Win32: Create and use file mutex only for files opened with APR_FOPEN_XTHREAD. There are some cases in the Windows implementation of the file I/O that cause the unnecessary creation and acquisitions of the file mutex. These cases include handling O_APPEND-style writes and the implementation of the apr_file_buffer_set(). Creating and acquiring the file mutex is only required for files opened with the APR_FOPEN_XTHREAD flag. Otherwise, concurrent operations on the same apr_file_t instance should be serialized by the user, and the mutex is not required. This patch tweaks the implementation to only create and acquire/release the mutex for files opened with APR_FOPEN_XTHREAD. * file_io/win32/open.c (apr_file_open, apr_os_file_put): Create the file mutex only with APR_FOPEN_XTHREAD. * file_io/win32/buffer.c (apr_file_buffer_set): Use the file mutex only with APR_FOPEN_XTHREAD. * file_io/win32/readwrite.c (apr_file_write): Use the file mutex only with APR_FOPEN_XTHREAD. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1808457 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/buffer.c | 8 ++++++-- file_io/win32/open.c | 7 +++---- file_io/win32/readwrite.c | 26 +++++++++++++++++--------- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/file_io/win32/buffer.c b/file_io/win32/buffer.c index 34e4e639347..1b7d857ca39 100644 --- a/file_io/win32/buffer.c +++ b/file_io/win32/buffer.c @@ -23,7 +23,9 @@ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, { apr_status_t rv; - apr_thread_mutex_lock(file->mutex); + if (file->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_lock(file->mutex); + } if(file->buffered) { /* Flush the existing buffer */ @@ -48,7 +50,9 @@ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, file->buffered = 0; } - apr_thread_mutex_unlock(file->mutex); + if (file->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_unlock(file->mutex); + } return APR_SUCCESS; } diff --git a/file_io/win32/open.c b/file_io/win32/open.c index f1a46286d2c..b6c01432e81 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -451,8 +451,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, (*new)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); (*new)->bufsize = APR_FILE_DEFAULT_BUFSIZE; } - /* Need the mutex to handled buffered and O_APPEND style file i/o */ - if ((*new)->buffered || (*new)->append) { + /* Need the mutex to share an apr_file_t across multiple threads */ + if (flag & APR_FOPEN_XTHREAD) { rv = apr_thread_mutex_create(&(*new)->mutex, APR_THREAD_MUTEX_DEFAULT, pool); if (rv) { @@ -644,8 +644,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE); (*file)->bufsize = APR_FILE_DEFAULT_BUFSIZE; } - - if ((*file)->append || (*file)->buffered) { + if (flags & APR_FOPEN_XTHREAD) { apr_status_t rv; rv = apr_thread_mutex_create(&(*file)->mutex, APR_THREAD_MUTEX_DEFAULT, pool); diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index e2e3e10ca8e..5ad2c3b83ce 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -412,20 +412,26 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a apr_off_t offset = 0; apr_status_t rc; if (thefile->append) { - /* apr_file_lock will mutex the file across processes. - * The call to apr_thread_mutex_lock is added to avoid - * a race condition between LockFile and WriteFile - * that occasionally leads to deadlocked threads. - */ - apr_thread_mutex_lock(thefile->mutex); + if (thefile->flags & APR_FOPEN_XTHREAD) { + /* apr_file_lock will mutex the file across processes. + * The call to apr_thread_mutex_lock is added to avoid + * a race condition between LockFile and WriteFile + * that occasionally leads to deadlocked threads. + */ + apr_thread_mutex_lock(thefile->mutex); + } rc = apr_file_lock(thefile, APR_FLOCK_EXCLUSIVE); if (rc != APR_SUCCESS) { - apr_thread_mutex_unlock(thefile->mutex); + if (thefile->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_unlock(thefile->mutex); + } return rc; } rc = apr_file_seek(thefile, APR_END, &offset); if (rc != APR_SUCCESS) { - apr_thread_mutex_unlock(thefile->mutex); + if (thefile->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_unlock(thefile->mutex); + } return rc; } } @@ -437,7 +443,9 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a thefile->pOverlapped); if (thefile->append) { apr_file_unlock(thefile); - apr_thread_mutex_unlock(thefile->mutex); + if (thefile->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_unlock(thefile->mutex); + } } } if (rv) { From 7e7ed6c635ff8cc71244caeaa645ef01ad27258b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 19 Sep 2017 08:05:07 +0000 Subject: [PATCH 7724/7878] * test/testipsub.c (test_bad_input): Fix test in r1808832 to match failure code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1808836 13f79535-47bb-0310-9956-ffa450edef68 --- test/testipsub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testipsub.c b/test/testipsub.c index 89a3a1fa143..342b5ca37ed 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -45,7 +45,7 @@ static void test_bad_input(abts_case *tc, void *data) ,{"127.0.0.1.2", NULL, APR_EBADIP} ,{"127.0.0.1.2", "8", APR_EBADIP} ,{"127", "255.0.0.0", APR_EBADIP} /* either EBADIP or EBADMASK seems fine */ - ,{"", NULL, APR_EBADIP} + ,{"", NULL, APR_EINVAL} #if APR_HAVE_IPV6 ,{"::1", NULL, APR_SUCCESS} ,{"::1", "20", APR_SUCCESS} From d6d48ddd4c3a5ef04749475ed75d26330a3e0dc6 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 19 Sep 2017 16:38:40 +0000 Subject: [PATCH 7725/7878] * test/testlock.c (test_timeoutcond): Increase fudge factor in checking timeout precision; 100ms failed regularly in Fedora builds, 500ms has Never Failed(TM). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1808910 13f79535-47bb-0310-9956-ffa450edef68 --- test/testlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testlock.c b/test/testlock.c index 40da791b793..cd48768ca67 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -334,7 +334,7 @@ static void test_timeoutcond(abts_case *tc, void *data) continue; } ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(s)); - ABTS_ASSERT(tc, "Timer returned too late", end - begin - timeout < 100000); + ABTS_ASSERT(tc, "Timer returned too late", end - begin - timeout < 500000); break; } ABTS_ASSERT(tc, "Too many retries", i < MAX_RETRY); From f672b565c825c34de9ee298b5bdc62c01cdd6147 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sat, 23 Sep 2017 11:15:36 +0000 Subject: [PATCH 7726/7878] sdbm: better database/page validation to fail cleanly when corrupted. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1809394 13f79535-47bb-0310-9956-ffa450edef68 --- dbm/sdbm/sdbm.c | 78 ++++++++++++++++++++++---------------------- dbm/sdbm/sdbm_pair.c | 3 +- 2 files changed, 41 insertions(+), 40 deletions(-) diff --git a/dbm/sdbm/sdbm.c b/dbm/sdbm/sdbm.c index 3f4d65d92dc..9ad9d20ff5f 100644 --- a/dbm/sdbm/sdbm.c +++ b/dbm/sdbm/sdbm.c @@ -40,7 +40,7 @@ */ static int getdbit (apr_sdbm_t *, long); static apr_status_t setdbit(apr_sdbm_t *, long); -static apr_status_t getpage(apr_sdbm_t *db, long); +static apr_status_t getpage(apr_sdbm_t *db, long, int, int); static apr_status_t getnext(apr_sdbm_datum_t *key, apr_sdbm_t *db); static apr_status_t makroom(apr_sdbm_t *, long, int); @@ -93,6 +93,7 @@ static apr_status_t prep(apr_sdbm_t **pdb, const char *dirname, const char *pagn db = malloc(sizeof(*db)); memset(db, 0, sizeof(*db)); + db->pagbno = -1L; db->pool = p; @@ -193,7 +194,7 @@ APR_DECLARE(apr_status_t) apr_sdbm_fetch(apr_sdbm_t *db, apr_sdbm_datum_t *val, if ((status = apr_sdbm_lock(db, APR_FLOCK_SHARED)) != APR_SUCCESS) return status; - if ((status = getpage(db, exhash(key))) == APR_SUCCESS) { + if ((status = getpage(db, exhash(key), 0, 1)) == APR_SUCCESS) { *val = getpair(db->pagbuf, key); /* ### do we want a not-found result? */ } @@ -227,7 +228,7 @@ APR_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db, if ((status = apr_sdbm_lock(db, APR_FLOCK_EXCLUSIVE)) != APR_SUCCESS) return status; - if ((status = getpage(db, exhash(key))) == APR_SUCCESS) { + if ((status = getpage(db, exhash(key), 0, 1)) == APR_SUCCESS) { if (!delpair(db->pagbuf, key)) /* ### should we define some APRUTIL codes? */ status = APR_EGENERAL; @@ -261,7 +262,7 @@ APR_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key, if ((status = apr_sdbm_lock(db, APR_FLOCK_EXCLUSIVE)) != APR_SUCCESS) return status; - if ((status = getpage(db, (hash = exhash(key)))) == APR_SUCCESS) { + if ((status = getpage(db, (hash = exhash(key)), 0, 1)) == APR_SUCCESS) { /* * if we need to replace, delete the key/data pair @@ -376,17 +377,19 @@ static apr_status_t makroom(apr_sdbm_t *db, long hash, int need) /* Reads 'len' bytes from file 'f' at offset 'off' into buf. * 'off' is given relative to the start of the file. - * If EOF is returned while reading, this is taken as success. + * If 'create' is asked and EOF is returned while reading, this is taken + * as success (i.e. a cleared buffer is returned). */ static apr_status_t read_from(apr_file_t *f, void *buf, - apr_off_t off, apr_size_t len) + apr_off_t off, apr_size_t len, + int create) { apr_status_t status; if ((status = apr_file_seek(f, APR_SET, &off)) != APR_SUCCESS || ((status = apr_file_read_full(f, buf, len, NULL)) != APR_SUCCESS)) { /* if EOF is reached, pretend we read all zero's */ - if (status == APR_EOF) { + if (status == APR_EOF && create) { memset(buf, 0, len); status = APR_SUCCESS; } @@ -410,9 +413,7 @@ APR_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db, /* * start at page 0 */ - if ((status = read_from(db->pagf, db->pagbuf, OFF_PAG(0), PBLKSIZ)) - == APR_SUCCESS) { - db->pagbno = 0; + if ((status = getpage(db, 0, 1, 1)) == APR_SUCCESS) { db->blkptr = 0; db->keyptr = 0; status = getnext(key, db); @@ -441,24 +442,28 @@ APR_DECLARE(apr_status_t) apr_sdbm_nextkey(apr_sdbm_t *db, /* * all important binary tree traversal */ -static apr_status_t getpage(apr_sdbm_t *db, long hash) +static apr_status_t getpage(apr_sdbm_t *db, long hash, int by_num, int create) { - register int hbit; - register long dbit; - register long pagb; apr_status_t status; + register long pagb; - dbit = 0; - hbit = 0; - while (dbit < db->maxbno && getdbit(db, dbit)) - dbit = 2 * dbit + ((hash & (1 << hbit++)) ? 2 : 1); + if (by_num) { + pagb = hash; + } + else { + register int hbit = 0; + register long dbit = 0; - debug(("dbit: %d...", dbit)); + while (dbit < db->maxbno && getdbit(db, dbit)) + dbit = 2 * dbit + ((hash & (1 << hbit++)) ? 2 : 1); + debug(("dbit: %d...", dbit)); - db->curbit = dbit; - db->hmask = masks[hbit]; + db->curbit = dbit; + db->hmask = masks[hbit]; + + pagb = hash & db->hmask; + } - pagb = hash & db->hmask; /* * see if the block we need is already in memory. * note: this lookaside cache has about 10% hit rate. @@ -470,12 +475,14 @@ static apr_status_t getpage(apr_sdbm_t *db, long hash) * ### joe: this assumption was surely never correct? but * ### we make it so in read_from anyway. */ - if ((status = read_from(db->pagf, db->pagbuf, OFF_PAG(pagb), PBLKSIZ)) - != APR_SUCCESS) + if ((status = read_from(db->pagf, db->pagbuf, + OFF_PAG(pagb), PBLKSIZ, + create)) != APR_SUCCESS) return status; if (!chkpage(db->pagbuf)) return APR_ENOSPC; /* ### better error? */ + db->pagbno = pagb; debug(("pag read: %d\n", pagb)); @@ -492,8 +499,9 @@ static int getdbit(apr_sdbm_t *db, long dbit) dirb = c / DBLKSIZ; if (dirb != db->dirbno) { - if (read_from(db->dirf, db->dirbuf, OFF_DIR(dirb), DBLKSIZ) - != APR_SUCCESS) + if (read_from(db->dirf, db->dirbuf, + OFF_DIR(dirb), DBLKSIZ, + 1) != APR_SUCCESS) return 0; db->dirbno = dirb; @@ -515,8 +523,9 @@ static apr_status_t setdbit(apr_sdbm_t *db, long dbit) dirb = c / DBLKSIZ; if (dirb != db->dirbno) { - if ((status = read_from(db->dirf, db->dirbuf, OFF_DIR(dirb), DBLKSIZ)) - != APR_SUCCESS) + if ((status = read_from(db->dirf, db->dirbuf, + OFF_DIR(dirb), DBLKSIZ, + 1)) != APR_SUCCESS) return status; db->dirbno = dirb; @@ -553,21 +562,12 @@ static apr_status_t getnext(apr_sdbm_datum_t *key, apr_sdbm_t *db) * try the next one... If we lost our position on the * file, we will have to seek. */ + db->blkptr++; db->keyptr = 0; - if (db->pagbno != db->blkptr++) { - apr_off_t off = OFF_PAG(db->blkptr); - if ((status = apr_file_seek(db->pagf, APR_SET, &off)) - != APR_SUCCESS) - return status; - } - db->pagbno = db->blkptr; /* ### EOF acceptable here too? */ - if ((status = apr_file_read_full(db->pagf, db->pagbuf, PBLKSIZ, NULL)) - != APR_SUCCESS) + if ((status = getpage(db, db->blkptr, 1, 0)) != APR_SUCCESS) return status; - if (!chkpage(db->pagbuf)) - return APR_EGENERAL; /* ### need better error */ } /* NOTREACHED */ diff --git a/dbm/sdbm/sdbm_pair.c b/dbm/sdbm/sdbm_pair.c index 2130200734e..50d7965b141 100644 --- a/dbm/sdbm/sdbm_pair.c +++ b/dbm/sdbm/sdbm_pair.c @@ -308,7 +308,8 @@ char *pag; if (n > 0) { off = PBLKSIZ; for (ino++; n > 0; ino += 2) { - if (ino[0] > off || ino[1] > off || + if (ino[0] < 0 || ino[0] > off || + ino[1] < 0 || ino[1] > off || ino[1] > ino[0]) return 0; off = ino[1]; From c8cb4750762cc95876aba9d3bd0e7c283482270e Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Mon, 25 Sep 2017 18:17:01 +0000 Subject: [PATCH 7727/7878] Update config.guess and config.sub from http://git.savannah.gnu.org/cgit/config.git. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1809649 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 62 ++++++++++++++++------------------------------ build/config.sub | 20 +++++++-------- 2 files changed, 32 insertions(+), 50 deletions(-) diff --git a/build/config.guess b/build/config.guess index 69ed3e573bb..8bd1095f112 100755 --- a/build/config.guess +++ b/build/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2017-03-05' +timestamp='2017-09-16' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ timestamp='2017-03-05' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,7 +27,7 @@ timestamp='2017-03-05' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . @@ -259,6 +259,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:Sortix:*:*) echo ${UNAME_MACHINE}-unknown-sortix exit ;; + *:Redox:*:*) + echo ${UNAME_MACHINE}-unknown-redox + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -315,15 +318,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exitcode=$? trap '' 0 exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; @@ -855,10 +849,6 @@ EOF *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; @@ -874,27 +864,12 @@ EOF echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; @@ -1304,14 +1279,21 @@ EOF if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub @@ -1335,16 +1317,16 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) + NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; - NSR-?:NONSTOP_KERNEL:*:*) + NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; - NSX-?:NONSTOP_KERNEL:*:*) + NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) @@ -1422,12 +1404,12 @@ cat >&2 <. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -33,7 +33,7 @@ timestamp='2017-04-02' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -229,9 +229,6 @@ case $os in -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; -psos*) os=-psos ;; @@ -1259,6 +1256,9 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; + x64) + basic_machine=x86_64-pc + ;; xbox) basic_machine=i686-pc os=-mingw32 @@ -1366,8 +1366,8 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases that might get confused + # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux @@ -1387,9 +1387,9 @@ case $os in -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; - # First accept the basic system types. + # Now accept the basic system types. # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. + # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ From 35f9b09f662324c4e8dcd1c751a3dc1cd5119a90 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 26 Sep 2017 15:27:35 +0000 Subject: [PATCH 7728/7878] pipe: fix apr_file_pipe_create_ex()'s blocking parameter forwarding. Proposed by: Steven Nairn Reviewed by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1809753 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 491a1a5f510..8164fe63865 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -76,7 +76,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, apr_int32_t blocking, apr_pool_t *p) { - return apr_file_pipe_create_pools(in, out, APR_FULL_BLOCK, p, p); + return apr_file_pipe_create_pools(in, out, blocking, p, p); } APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in, From 8b129a4cacd5a75a7a7e618391c80145dac8d535 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 26 Sep 2017 15:37:42 +0000 Subject: [PATCH 7729/7878] pipe: factorize apr_file_pipe_create*() in terms of static helper file_pipe_create(), to avoid duplicated code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1809757 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 48 +++++++++++++++------------------------- file_io/os2/pipe.c | 28 +++++------------------ file_io/unix/pipe.c | 43 ++++++++++++++---------------------- file_io/win32/pipe.c | 50 ++++++++++++++++++++++++------------------ 4 files changed, 68 insertions(+), 101 deletions(-) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index b918a290d51..1a3a5e87932 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -133,10 +133,13 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, return apr_os_pipe_put_ex(file, thefile, 0, pool); } -static apr_status_t file_pipe_create(apr_file_t **in, apr_file_t **out, - apr_pool_t *pool_in, apr_pool_t *pool_out) +static apr_status_t file_pipe_create(apr_file_t **in, + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *pool_in, + apr_pool_t *pool_out) { - int filedes[2]; + int filedes[2]; if (pipe(filedes) == -1) { return errno; @@ -172,12 +175,6 @@ static apr_status_t file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_cleanup_register((*out)->pool, (void *)(*out), apr_unix_file_cleanup, apr_pool_cleanup_null); - return APR_SUCCESS; -} - -static void file_pipe_block(apr_file_t **in, apr_file_t **out, - apr_int32_t blocking) -{ switch (blocking) { case APR_FULL_BLOCK: break; @@ -192,11 +189,15 @@ static void file_pipe_block(apr_file_t **in, apr_file_t **out, apr_file_pipe_timeout_set(*in, 0); break; } + return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, + apr_file_t **out, + apr_pool_t *pool) { - return file_pipe_create(in, out, pool, pool); + /* Default is full blocking pipes. */ + return file_pipe_create(in, out, APR_FULL_BLOCK, pool, pool); } APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, @@ -204,29 +205,16 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, apr_int32_t blocking, apr_pool_t *pool) { - apr_status_t status; - - if ((status = file_pipe_create(in, out, pool, pool)) != APR_SUCCESS) { - return status; - } - - file_pipe_block(in, out, blocking); - - return APR_SUCCESS; + return file_pipe_create(in, out, blocking, pool, pool); } APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in, - apr_file_t **out, apr_int32_t blocking, apr_pool_t *pool_in, apr_pool_t *pool_out) + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *pool_in, + apr_pool_t *pool_out) { - apr_status_t status; - - if ((status = file_pipe_create(in, out, pool_in, pool_out)) != APR_SUCCESS) { - return status; - } - - file_pipe_block(in, out, blocking); - - return APR_SUCCESS; + return file_pipe_create(in, out, blocking, pool_in, pool_out); } APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 914b77782a8..4dbe30dbf33 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -123,12 +123,6 @@ static apr_status_t file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_cleanup_register(pool_out, *out, apr_file_cleanup, apr_pool_cleanup_null); - return APR_SUCCESS; -} - -static void file_pipe_block(apr_file_t **in, apr_file_t **out, - apr_int32_t blocking) -{ switch (blocking) { case APR_FULL_BLOCK: break; @@ -143,13 +137,15 @@ static void file_pipe_block(apr_file_t **in, apr_file_t **out, apr_file_pipe_timeout_set(*in, 0); break; } + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) { - return file_pipe_create(in, out, pool, pool); + /* Default is full blocking pipes. */ + return file_pipe_create(in, out, APR_FULL_BLOCK, pool, pool); } APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, @@ -157,14 +153,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, apr_int32_t blocking, apr_pool_t *pool) { - apr_status_t status; - - if ((status = file_pipe_create(in, out, pool, pool)) != APR_SUCCESS) - return status; - - file_pipe_block(in, out, blocking); - - return APR_SUCCESS; + return file_pipe_create(in, out, blocking, pool, pool); } APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in, @@ -173,14 +162,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in, apr_pool_t *pool_in, apr_pool_t *pool_out) { - apr_status_t status; - - if ((status = file_pipe_create(in, out, pool_in, pool_out)) != APR_SUCCESS) - return status; - - file_pipe_block(in, out, blocking); - - return APR_SUCCESS; + return file_pipe_create(in, out, blocking, pool_in, pool_out); } diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 7be16e5d0a1..b68ac65423e 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -176,8 +176,11 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, return apr_os_pipe_put_ex(file, thefile, 0, pool); } -static apr_status_t file_pipe_create(apr_file_t **in, apr_file_t **out, - apr_pool_t *pool_in, apr_pool_t *pool_out) +static apr_status_t file_pipe_create(apr_file_t **in, + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *pool_in, + apr_pool_t *pool_out) { int filedes[2]; @@ -220,11 +223,7 @@ static apr_status_t file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_cleanup_null); apr_pool_cleanup_register((*out)->pool, (void *)(*out), apr_unix_file_cleanup, apr_pool_cleanup_null); - return APR_SUCCESS; -} -static void file_pipe_block(apr_file_t **in, apr_file_t **out, apr_int32_t blocking) -{ switch (blocking) { case APR_FULL_BLOCK: break; @@ -239,12 +238,15 @@ static void file_pipe_block(apr_file_t **in, apr_file_t **out, apr_int32_t block apr_file_pipe_timeout_set(*in, 0); break; } + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, - apr_file_t **out, apr_pool_t *pool) + apr_file_t **out, + apr_pool_t *pool) { - return file_pipe_create(in, out, pool, pool); + /* Default is full blocking pipes. */ + return file_pipe_create(in, out, APR_FULL_BLOCK, pool, pool); } APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, @@ -252,29 +254,16 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, apr_int32_t blocking, apr_pool_t *pool) { - apr_status_t status; - - if ((status = file_pipe_create(in, out, pool, pool)) != APR_SUCCESS) { - return status; - } - - file_pipe_block(in, out, blocking); - - return APR_SUCCESS; + return file_pipe_create(in, out, blocking, pool, pool); } APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in, - apr_file_t **out, apr_int32_t blocking, apr_pool_t *pool_in, apr_pool_t *pool_out) + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *pool_in, + apr_pool_t *pool_out) { - apr_status_t status; - - if ((status = file_pipe_create(in, out, pool_in, pool_out)) != APR_SUCCESS) { - return status; - } - - file_pipe_block(in, out, blocking); - - return APR_SUCCESS; + return file_pipe_create(in, out, blocking, pool_in, pool_out); } APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 8164fe63865..6014582583d 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -63,27 +63,11 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, - apr_file_t **out, - apr_pool_t *p) -{ - /* Unix creates full blocking pipes. */ - return apr_file_pipe_create_pools(in, out, APR_FULL_BLOCK, p, p); -} - -APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, - apr_file_t **out, - apr_int32_t blocking, - apr_pool_t *p) -{ - return apr_file_pipe_create_pools(in, out, blocking, p, p); -} - -APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in, - apr_file_t **out, - apr_int32_t blocking, - apr_pool_t *pool_in, - apr_pool_t *pool_out) +static apr_status_t file_pipe_create(apr_file_t **in, + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *pool_in, + apr_pool_t *pool_out) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -224,6 +208,30 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in, #endif /* _WIN32_WCE */ } +APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, + apr_file_t **out, + apr_pool_t *pool) +{ + /* Default is full blocking pipes. */ + return file_pipe_create(in, out, APR_FULL_BLOCK, pool, pool); +} + +APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *pool) +{ + return file_pipe_create(in, out, blocking, pool, pool); +} + +APR_DECLARE(apr_status_t) apr_file_pipe_create_pools(apr_file_t **in, + apr_file_t **out, + apr_int32_t blocking, + apr_pool_t *pool_in, + apr_pool_t *pool_out) +{ + return file_pipe_create(in, out, blocking, pool_in, pool_out); +} APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, From 2c1a373cd0c7fc38b4123c3c74a4b1e33aa31ad6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 27 Sep 2017 14:48:47 +0000 Subject: [PATCH 7730/7878] Added little but causes silly deltas git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1809854 13f79535-47bb-0310-9956-ffa450edef68 --- docs/pool-design.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/pool-design.html b/docs/pool-design.html index 0669bdfc99e..46b63d62b2b 100644 --- a/docs/pool-design.html +++ b/docs/pool-design.html @@ -3,10 +3,6 @@ Using APR Pools -
    - Last modified at [$Date$] -
    -

    Using APR Pools

    From a14a3026ff799b86ca38c5f888e85109b32f25b9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 27 Sep 2017 14:53:04 +0000 Subject: [PATCH 7731/7878] Fix regex syntax git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1809857 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl index 49853b34b30..76b7f00ca90 100644 --- a/build/fixwin32mak.pl +++ b/build/fixwin32mak.pl @@ -140,7 +140,7 @@ sub fixcwd { $dstfl = new IO::File $tname, "w" || die; while ($src = <$srcfl>) { if (($src =~ m/^\t"(\.\.\\)+(apr|apr-util|apr-iconv)\\.*"\\/) || - ($src =~ m/^\t{\$\(INCLUDE\)}".*"\\/)) { + ($src =~ m/^\t\{\$\(INCLUDE\)\}".*"\\/)) { $verchg = -1; } else { From 3ca6f0c3d1dacd8afdeadaaaf7a0c238f195c8c5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 27 Sep 2017 14:58:35 +0000 Subject: [PATCH 7732/7878] Ensure /machine is also corrected git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1809858 13f79535-47bb-0310-9956-ffa450edef68 --- build/fixwin32mak.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl index 76b7f00ca90..6f53987ecf8 100644 --- a/build/fixwin32mak.pl +++ b/build/fixwin32mak.pl @@ -92,7 +92,7 @@ sub fixcwd { # that we also link here to the default CPU. Omitting the # /machine spec from the .dsp was not enough, MSVC put it back. # - if ($src =~ s#^(LINK32_FLAGS=.*) /machine:(x|IX|I3)86 #$1 #) { + if ($src =~ s#^(LINK32_FLAGS=.*) /machine:(x|IX|I3)86 #$1 #i) { $verchg = -1; } print $dstfl $src; From f6825333681d64a9ac8dc7176e6cab0ad223c7c0 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 2 Oct 2017 15:31:35 +0000 Subject: [PATCH 7733/7878] Get maint mode working again w/ macOS Xcode 9 (clang-900) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1810450 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.in b/configure.in index a7139b41422..d5aeb1dcbc0 100644 --- a/configure.in +++ b/configure.in @@ -361,6 +361,11 @@ AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and [APR_ADDTO(CFLAGS,-g) if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations]) + case `($CC --version) 2>/dev/null` in + *clang-900*) + APACHE_ADD_GCC_CFLAG([-Wno-error=strict-prototypes]) + ;; + esac elif test "$AIX_XLC" = "yes"; then APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE -qcheck=all -qinfo=pro) fi From 3aa62f5ef220b768d72b147c8b5fec72e395e1c0 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 2 Oct 2017 15:35:54 +0000 Subject: [PATCH 7734/7878] Macro doesn't exit here git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1810452 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index d5aeb1dcbc0..3d801a1a437 100644 --- a/configure.in +++ b/configure.in @@ -363,7 +363,7 @@ AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations]) case `($CC --version) 2>/dev/null` in *clang-900*) - APACHE_ADD_GCC_CFLAG([-Wno-error=strict-prototypes]) + APR_ADDTO(CFLAGS,[-Wno-error=strict-prototypes]) ;; esac elif test "$AIX_XLC" = "yes"; then From 062cf3355a88044553535dacb1863cd43193d7d1 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 3 Oct 2017 12:54:54 +0000 Subject: [PATCH 7735/7878] Also affects clang 5 (and maybe older versions too) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1811000 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 3d801a1a437..11a8ff1755d 100644 --- a/configure.in +++ b/configure.in @@ -362,7 +362,7 @@ AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations]) case `($CC --version) 2>/dev/null` in - *clang-900*) + *clang-900* | *"clang version 5.0.0"*) APR_ADDTO(CFLAGS,[-Wno-error=strict-prototypes]) ;; esac From c0a1340d55404eeab54f4b57f38dba3db38db0c9 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sun, 8 Oct 2017 11:22:53 +0000 Subject: [PATCH 7736/7878] apr_crypto: Fix compatibility with LibreSSL. PR 61596. Proposed by: Bernard Spil Reviewed by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1811470 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ crypto/apr_crypto_openssl.c | 25 +++++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index e00640dc9d3..49bbbc9af21 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_crypto: Fix compatibility with LibreSSL. PR 61596. + [Bernard Spil , Yann Ylavic] + *) Don't seek to the end when opening files with APR_FOPEN_APPEND on Windows. [Evgeny Kotkov ] diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 594fc1467c7..76f318411da 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -32,10 +32,23 @@ #if APU_HAVE_CRYPTO #include +#include #include #define LOG_PREFIX "apr_crypto_openssl: " +#ifndef APR_USE_OPENSSL_PRE_1_1_API +#if defined(LIBRESSL_VERSION_NUMBER) +/* LibreSSL declares OPENSSL_VERSION_NUMBER == 2.0 but does not include most + * changes from OpenSSL >= 1.1 (new functions, macros, deprecations, ...), so + * we have to work around this... + */ +#define APR_USE_OPENSSL_PRE_1_1_API (1) +#else +#define APR_USE_OPENSSL_PRE_1_1_API (OPENSSL_VERSION_NUMBER < 0x10100000L) +#endif +#endif + struct apr_crypto_t { apr_pool_t *pool; const apr_crypto_driver_t *provider; @@ -118,8 +131,8 @@ static apr_status_t crypto_shutdown_helper(void *data) static apr_status_t crypto_init(apr_pool_t *pool, const char *params, const apu_err_t **result) { -#if OPENSSL_VERSION_NUMBER < 0x10100000L - CRYPTO_malloc_init(); +#if APR_USE_OPENSSL_PRE_1_1_API + (void)CRYPTO_malloc_init(); #else OPENSSL_malloc_init(); #endif @@ -698,7 +711,7 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, if (!EVP_EncryptUpdate(ctx->cipherCtx, (*out), &outl, (unsigned char *) in, inlen)) { #endif -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if APR_USE_OPENSSL_PRE_1_1_API EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); #else EVP_CIPHER_CTX_reset(ctx->cipherCtx); @@ -741,7 +754,7 @@ static apr_status_t crypto_block_encrypt_finish(unsigned char *out, else { *outlen = len; } -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if APR_USE_OPENSSL_PRE_1_1_API EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); #else EVP_CIPHER_CTX_reset(ctx->cipherCtx); @@ -868,7 +881,7 @@ static apr_status_t crypto_block_decrypt(unsigned char **out, if (!EVP_DecryptUpdate(ctx->cipherCtx, *out, &outl, (unsigned char *) in, inlen)) { #endif -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if APR_USE_OPENSSL_PRE_1_1_API EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); #else EVP_CIPHER_CTX_reset(ctx->cipherCtx); @@ -911,7 +924,7 @@ static apr_status_t crypto_block_decrypt_finish(unsigned char *out, else { *outlen = len; } -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if APR_USE_OPENSSL_PRE_1_1_API EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); #else EVP_CIPHER_CTX_reset(ctx->cipherCtx); From fec7059238d28723597420831f4cdddb9c063779 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sun, 8 Oct 2017 11:33:12 +0000 Subject: [PATCH 7737/7878] Backported. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1811472 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGES b/CHANGES index 49bbbc9af21..e00640dc9d3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) apr_crypto: Fix compatibility with LibreSSL. PR 61596. - [Bernard Spil , Yann Ylavic] - *) Don't seek to the end when opening files with APR_FOPEN_APPEND on Windows. [Evgeny Kotkov ] From 79c7acce84e62bf73f6d6bdc5abf30e2518bb7cd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 23 Oct 2017 14:52:07 +0000 Subject: [PATCH 7738/7878] Update STATUSes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1813022 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index e2bfe7670f7..50a9e98c935 100644 --- a/STATUS +++ b/STATUS @@ -27,8 +27,21 @@ Patches considered for backport are noted in their branches' STATUS: Releases: 2.0.0 : in development on trunk/ - 1.5.0 : in development on branches/1.5.x/ - 1.4.3 : in development on branches/1.4.x/ + 1.7.0 : in development on branches/1.7.x + 1.6.4 : in maintenance + 1.6.3 : released October 22, 2017 + 1.6.2 : released June 14, 2017 + 1.6.1 : not released + 1.6.0 : not released + 1.5.2 : released April 29, 2015 + 1.5.1 : released April 20, 2014 + 1.5.0 : released November 18, 2013 + 1.4.8 : released June 21, 2013 + 1.4.7 : not released + 1.4.6 : released Feb 14, 2012 + 1.4.5 : released May 22, 2011 + 1.4.4 : released May 9, 2011 + 1.4.3 : not released 1.4.2 : released April 3, 2010 1.4.1 : not released 1.4.0 : not released From cbfbc023551719f93eb1aa37bcbc661f189221f0 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 25 Oct 2017 13:18:20 +0000 Subject: [PATCH 7739/7878] * network_io/unix/sockaddr.c (apr_parse_addr_port): Fix regression in scope id parsing introduced in r1683521. * test/testipsub.c (test_parse_addr_port): New function. Submitted by: rjung, jorton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1813286 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 2 +- test/testipsub.c | 47 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 54539b8bf6f..57bc0cb7ede 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -277,7 +277,7 @@ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, return APR_EINVAL; } addrlen = scope_delim - str - 1; - *scope_id = apr_pstrmemdup(p, scope_delim, end_bracket - scope_delim - 1); + *scope_id = apr_pstrmemdup(p, scope_delim + 1, end_bracket - scope_delim - 1); } else { addrlen = addrlen - 2; /* minus 2 for '[' and ']' */ diff --git a/test/testipsub.c b/test/testipsub.c index 342b5ca37ed..6b1b92625a2 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -165,6 +165,52 @@ static void test_badip_str(abts_case *tc, void *data) "The specified IP address is invalid."); } +static void test_parse_addr_port(abts_case *tc, void *data) +{ + const struct { + const char *input; + apr_status_t rv; + const char *addr, *scope_id; + apr_port_t port; + } *test, testcases[] = { + { "localhost:80", APR_SUCCESS, "localhost", NULL, 80 } + ,{ "www.example.com:8080", APR_SUCCESS, "www.example.com", NULL, 8080 } + ,{ "w:1", APR_SUCCESS, "w", NULL, 1 } + ,{ "127.0.0.1:80", APR_SUCCESS, "127.0.0.1", NULL, 80 } + ,{ "[::]:80", APR_SUCCESS, "::", NULL, 80 } + ,{ "localhost:999999", APR_EINVAL, NULL, NULL, 0 } + ,{ "localhost:0", APR_EINVAL, NULL, NULL, 0 } + ,{ "[::]z:80", APR_EINVAL, NULL, NULL, 0 } + ,{ "[:::80", APR_EINVAL, NULL, NULL, 0 } + ,{ "[zzzz]:80", APR_EINVAL, NULL, NULL, 0 } + ,{ "[::%]:80", APR_EINVAL, NULL, NULL, 0 } + ,{ "[::%eth0]:80", APR_SUCCESS, "::", "eth0", 80 } +/* ,{ "127.0.0.1:80x", APR_EINVAL, NULL, NULL, 0 } <- should fail, doesn't */ +/* ,{ "127.0.0.1x:80", APR_EINVAL, NULL, NULL, 0 } <- maybe should fail?, doesn't */ +/* ,{ "localhost:-1", APR_EINVAL, NULL, NULL, 0 } <- should fail, doesn't */ + }; + unsigned i; + + for (i = 0; i < (sizeof testcases / sizeof testcases[0]); i++) { + char *addr, *scope_id; + apr_port_t port; + apr_status_t rv; + + test = &testcases[i]; + + rv = apr_parse_addr_port(&addr, &scope_id, &port, test->input, p); + ABTS_INT_EQUAL(tc, test->rv, rv); + + if (test->rv != APR_SUCCESS) continue; + + APR_ASSERT_SUCCESS(tc, "parse address", test->rv); + + ABTS_STR_EQUAL(tc, test->addr, addr); + ABTS_STR_EQUAL(tc, test->scope_id, scope_id); + ABTS_INT_EQUAL(tc, test->port, port); + } +} + abts_suite *testipsub(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -174,6 +220,7 @@ abts_suite *testipsub(abts_suite *suite) abts_run_test(suite, test_interesting_subnets, NULL); abts_run_test(suite, test_badmask_str, NULL); abts_run_test(suite, test_badip_str, NULL); + abts_run_test(suite, test_parse_addr_port, NULL); return suite; } From 6d85691b7ccb8582847c444499801699a50d4d1e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 25 Oct 2017 18:07:03 +0000 Subject: [PATCH 7740/7878] * test/testipsub.c (test_parse_addr_port): More tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1813330 13f79535-47bb-0310-9956-ffa450edef68 --- test/testipsub.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/testipsub.c b/test/testipsub.c index 6b1b92625a2..7bdb8ccb4e1 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -173,18 +173,25 @@ static void test_parse_addr_port(abts_case *tc, void *data) const char *addr, *scope_id; apr_port_t port; } *test, testcases[] = { + /* Success cases */ { "localhost:80", APR_SUCCESS, "localhost", NULL, 80 } + ,{ "localhost", APR_SUCCESS, "localhost", NULL, 0 } ,{ "www.example.com:8080", APR_SUCCESS, "www.example.com", NULL, 8080 } ,{ "w:1", APR_SUCCESS, "w", NULL, 1 } ,{ "127.0.0.1:80", APR_SUCCESS, "127.0.0.1", NULL, 80 } ,{ "[::]:80", APR_SUCCESS, "::", NULL, 80 } + ,{ "[::%eth0]:80", APR_SUCCESS, "::", "eth0", 80 } + ,{ "[::%eth0]", APR_SUCCESS, "::", "eth0", 0 } + ,{ "8080", APR_SUCCESS, NULL, NULL, 8080 } /* API doc has this case */ + + /* Failure cases */ ,{ "localhost:999999", APR_EINVAL, NULL, NULL, 0 } ,{ "localhost:0", APR_EINVAL, NULL, NULL, 0 } + ,{ "[abc]", APR_EINVAL, NULL, NULL, 0 } ,{ "[::]z:80", APR_EINVAL, NULL, NULL, 0 } ,{ "[:::80", APR_EINVAL, NULL, NULL, 0 } ,{ "[zzzz]:80", APR_EINVAL, NULL, NULL, 0 } ,{ "[::%]:80", APR_EINVAL, NULL, NULL, 0 } - ,{ "[::%eth0]:80", APR_SUCCESS, "::", "eth0", 80 } /* ,{ "127.0.0.1:80x", APR_EINVAL, NULL, NULL, 0 } <- should fail, doesn't */ /* ,{ "127.0.0.1x:80", APR_EINVAL, NULL, NULL, 0 } <- maybe should fail?, doesn't */ /* ,{ "localhost:-1", APR_EINVAL, NULL, NULL, 0 } <- should fail, doesn't */ From c560d9aa6f204b361940c3d86e2cb88369752c43 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 3 Nov 2017 23:28:21 +0000 Subject: [PATCH 7741/7878] rand: add support for the arc4random API as an entropy source. The arc4random API originates from OpenBSD where it supersedes random(3), rand(3), and files in the /dev filesystem. Use it for apr_generate_random_bytes(). Proposed by: Christian Weisgerber Reviewed by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1814239 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 9 +++++++++ misc/unix/rand.c | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 11a8ff1755d..2c960c9276d 100644 --- a/configure.in +++ b/configure.in @@ -2453,6 +2453,8 @@ else fi dnl ----------------------------- Checking for /dev/random +AC_CHECK_FUNCS(arc4random_buf) + AC_MSG_CHECKING(for entropy source) why_no_rand="" @@ -2470,6 +2472,13 @@ AC_ARG_WITH(egd, rand="1" ]) +if test "$rand" != "1"; then + if test "$ac_cv_func_arc4random_buf" = yes; then + AC_MSG_RESULT(arc4random) + rand="1" + fi +fi + if test "$rand" != "1"; then AC_ARG_WITH(devrandom, [ --with-devrandom[[=DEV]] use /dev/random or compatible [[searches by default]]], diff --git a/misc/unix/rand.c b/misc/unix/rand.c index c1e1e8f60db..1e4bd71b9ea 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -87,7 +87,11 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, apr_size_t length) { -#ifdef DEV_RANDOM +#if defined(HAVE_ARC4RANDOM) + + arc4random_buf(buf, length); + +#elif defined(DEV_RANDOM) int fd = -1; From 5afa6b002c459467b369a69f88d91068c81eb91a Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sat, 4 Nov 2017 00:12:45 +0000 Subject: [PATCH 7742/7878] rand: add support for getrandom() on Linux as an entropy source. Use it for apr_generate_random_bytes() when available, reading from the urandom source, and non-blocking such that the call fails with EINVAL if there is not enough entropy on the system (which shouldn't be the case in userspace). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1814240 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 ++++++++++ misc/unix/rand.c | 22 +++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 2c960c9276d..7ab0ec2f1ae 100644 --- a/configure.in +++ b/configure.in @@ -2453,6 +2453,9 @@ else fi dnl ----------------------------- Checking for /dev/random +AC_CHECK_HEADERS(sys/random.h) +AC_CHECK_FUNCS(getrandom) + AC_CHECK_FUNCS(arc4random_buf) AC_MSG_CHECKING(for entropy source) @@ -2472,6 +2475,13 @@ AC_ARG_WITH(egd, rand="1" ]) +if test "$rand" != "1"; then + if test "$ac_cv_func_getrandom" = yes; then + AC_MSG_RESULT(getrandom) + rand="1" + fi +fi + if test "$rand" != "1"; then if test "$ac_cv_func_arc4random_buf" = yes; then AC_MSG_RESULT(arc4random) diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 1e4bd71b9ea..89ffe255081 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -42,6 +42,9 @@ #elif defined(HAVE_SYS_UUID_H) #include #endif +#ifdef HAVE_GETRANDOM +#include +#endif #ifndef SHUT_RDWR #define SHUT_RDWR 2 @@ -87,7 +90,24 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, apr_size_t length) { -#if defined(HAVE_ARC4RANDOM) +#if defined(HAVE_GETRANDOM) + + do { + int rc; + + rc = getrandom(buf, length, GRND_NONBLOCK); + if (rc == -1) { + if (errno == EINTR) { + continue; + } + return errno; + } + + buf += rc; + length -= rc; + } while (length > 0); + +#elif defined(HAVE_ARC4RANDOM) arc4random_buf(buf, length); From ff9bff778636368fcd95405c4623d157b2fb6c28 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sat, 4 Nov 2017 22:02:54 +0000 Subject: [PATCH 7743/7878] rand: follow up to r1814240. Fall back to using SYS_getrandom syscall when it's available in linux (3.17+) but not in glibc (2.25+, not very deployed yet). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1814326 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 7 +++++++ misc/unix/rand.c | 23 +++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 7ab0ec2f1ae..cfd400144ab 100644 --- a/configure.in +++ b/configure.in @@ -2456,6 +2456,10 @@ dnl ----------------------------- Checking for /dev/random AC_CHECK_HEADERS(sys/random.h) AC_CHECK_FUNCS(getrandom) +AC_CHECK_HEADERS(sys/syscall.h) +AC_CHECK_HEADERS(linux/random.h) +AC_CHECK_DECLS([SYS_getrandom], [], [], [#include ]) + AC_CHECK_FUNCS(arc4random_buf) AC_MSG_CHECKING(for entropy source) @@ -2479,6 +2483,9 @@ if test "$rand" != "1"; then if test "$ac_cv_func_getrandom" = yes; then AC_MSG_RESULT(getrandom) rand="1" + elif test "$ac_cv_have_decl_SYS_getrandom" = yes; then + AC_MSG_RESULT(SYS_getrandom) + rand="1" fi fi diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 89ffe255081..449819a2157 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -42,9 +42,28 @@ #elif defined(HAVE_SYS_UUID_H) #include #endif -#ifdef HAVE_GETRANDOM + +#if defined(HAVE_SYS_RANDOM_H) + #include +#define USE_GETRANDOM + +#elif defined(HAVE_SYS_SYSCALL_H) && \ + defined(HAVE_LINUX_RANDOM_H) && \ + HAVE_DECL_SYS_GETRANDOM + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE #endif +#include +#include +#include + +#define getrandom(buf, buflen, flags) \ + syscall(SYS_getrandom, (buf), (buflen), (flags)) +#define USE_GETRANDOM + +#endif /* HAVE_SYS_RANDOM_H */ #ifndef SHUT_RDWR #define SHUT_RDWR 2 @@ -90,7 +109,7 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, apr_size_t length) { -#if defined(HAVE_GETRANDOM) +#if defined(USE_GETRANDOM) do { int rc; From 3d651dade97e12ddc60bfac4a8d921ded32149a0 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sat, 4 Nov 2017 22:39:22 +0000 Subject: [PATCH 7744/7878] rand: follow up to r1814240 and r1814326. Thanks Brane, may be available w/o getrandom(), and obviously we must not USE_GETRANDOM in this case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1814329 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/rand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 449819a2157..c0f02eca7db 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -43,13 +43,15 @@ #include #endif -#if defined(HAVE_SYS_RANDOM_H) +#if defined(HAVE_SYS_RANDOM_H) && \ + defined(HAVE_GETRANDOM) #include #define USE_GETRANDOM #elif defined(HAVE_SYS_SYSCALL_H) && \ defined(HAVE_LINUX_RANDOM_H) && \ + defined(HAVE_DECL_SYS_GETRANDOM) && \ HAVE_DECL_SYS_GETRANDOM #ifndef _GNU_SOURCE From 008ce98b5327ea8fdfbfdca26dc761c4dc4cc4d9 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Sun, 5 Nov 2017 00:58:05 +0000 Subject: [PATCH 7745/7878] rand: follow up to r1814239, r1814240 and r1814326. The above commits added the checks for HAVE_GETRANDOM and HAVE_ARC4RANDOM first in configure.in so to avoid breaking the AC_MESSAGE_CHECKING/RESULT line, thus it also defined the macros unconditionally (while the others were and still are only defined if no previous one is elected already). Yet the top priority one should remain HAVE_EGD when --with-egd is specified, so we now have to rearrange apr_generate_random_bytes()'s #ifdefs to preserve that now. While at it, let's add an #error for the "should not happen" case where APR_HAS_RANDOM is defined but no implementation is found. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1814331 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/rand.c | 132 +++++++++++++++++++++++++---------------------- 1 file changed, 69 insertions(+), 63 deletions(-) diff --git a/misc/unix/rand.c b/misc/unix/rand.c index c0f02eca7db..24221c8cacc 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -111,69 +111,7 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, apr_size_t length) { -#if defined(USE_GETRANDOM) - - do { - int rc; - - rc = getrandom(buf, length, GRND_NONBLOCK); - if (rc == -1) { - if (errno == EINTR) { - continue; - } - return errno; - } - - buf += rc; - length -= rc; - } while (length > 0); - -#elif defined(HAVE_ARC4RANDOM) - - arc4random_buf(buf, length); - -#elif defined(DEV_RANDOM) - - int fd = -1; - - /* On BSD/OS 4.1, /dev/random gives out 8 bytes at a time, then - * gives EOF, so reading 'length' bytes may require opening the - * device several times. */ - do { - apr_ssize_t rc; - - if (fd == -1) - if ((fd = open(DEV_RANDOM, O_RDONLY)) == -1) - return errno; - - do { - rc = read(fd, buf, length); - } while (rc == -1 && errno == EINTR); - - if (rc < 0) { - int errnum = errno; - close(fd); - return errnum; - } - else if (rc == 0) { - close(fd); - fd = -1; /* force open() again */ - } - else { - buf += rc; - length -= rc; - } - } while (length > 0); - - close(fd); -#elif defined(OS2) - static UCHAR randbyte(); - unsigned int idx; - - for (idx=0; idx 0); + +#elif defined(HAVE_ARC4RANDOM) + + arc4random_buf(buf, length); + +#elif defined(DEV_RANDOM) + + int fd = -1; + + /* On BSD/OS 4.1, /dev/random gives out 8 bytes at a time, then + * gives EOF, so reading 'length' bytes may require opening the + * device several times. */ + do { + apr_ssize_t rc; + + if (fd == -1) + if ((fd = open(DEV_RANDOM, O_RDONLY)) == -1) + return errno; + + do { + rc = read(fd, buf, length); + } while (rc == -1 && errno == EINTR); + + if (rc < 0) { + int errnum = errno; + close(fd); + return errnum; + } + else if (rc == 0) { + close(fd); + fd = -1; /* force open() again */ + } + else { + buf += rc; + length -= rc; + } + } while (length > 0); + + close(fd); + +#elif defined(OS2) + + static UCHAR randbyte(); + unsigned int idx; + + for (idx=0; idx Date: Tue, 28 Nov 2017 08:53:13 +0000 Subject: [PATCH 7746/7878] Support IPv6 link-local address scope/zone mapping. * network_io/unix/sockaddr.c (apr_sockaddr_zone_set, apr_sockaddr_zone_get): New functions. (apr_sockaddr_ip_getbuf): Append %scope for link-local address. (apr_sockaddr_equal): Compare link-local address with different scopes as not equal. * include/apr_network_io.h: Add function declarations. * configure.in: Test for if_indextoname and if_nametoindex. * test/testsock.c (test_zone): New test case. * include/arch/win32/apr_private.h: Assume Windows supports if_nametoindex and if_indextoname. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1816527 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 9 +++ configure.in | 6 +- include/apr_network_io.h | 23 +++++++ include/arch/win32/apr_private.h | 2 + network_io/unix/sockaddr.c | 100 ++++++++++++++++++++++++++++++- test/testsock.c | 93 ++++++++++++++++++++++++++++ 6 files changed, 228 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index e00640dc9d3..d80b6425574 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,15 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add apr_sockaddr_zone_set, apr_sockaddr_zone_set to set and retrieve + the zone for link-local IPv6 addresses. [Joe Orton] + + *) apr_sockaddr_equal: Compare link-local IPv6 addresses with different + zones as not equal. [Joe Orton] + + *) apr_sockaddr_ip_getbuf, apr_sockaddr_ip_get: Append "%zone" for + IPv6 link-local addresses. [Joe Orton] + *) Don't seek to the end when opening files with APR_FOPEN_APPEND on Windows. [Evgeny Kotkov ] diff --git a/configure.in b/configure.in index cfd400144ab..b9d537cdb56 100644 --- a/configure.in +++ b/configure.in @@ -1069,7 +1069,9 @@ case $host in #endif";; esac -AC_CHECK_HEADERS([sys/types.h sys/mman.h sys/ipc.h sys/mutex.h sys/shm.h sys/file.h kernel/OS.h os2.h windows.h]) +AC_CHECK_HEADERS([sys/types.h sys/mman.h sys/ipc.h sys/mutex.h \ + sys/shm.h sys/file.h kernel/OS.h os2.h windows.h \ + net/if.h]) AC_CHECK_FUNCS([mmap munmap shm_open shm_unlink shmget shmat shmdt shmctl \ create_area mprotect]) @@ -2755,7 +2757,7 @@ esac AC_SEARCH_LIBS(getaddrinfo, socket inet6) AC_SEARCH_LIBS(gai_strerror, socket inet6) AC_SEARCH_LIBS(getnameinfo, socket inet6) -AC_CHECK_FUNCS(gai_strerror) +AC_CHECK_FUNCS(gai_strerror if_nametoindex if_indextoname) APR_CHECK_WORKING_GETADDRINFO APR_CHECK_NEGATIVE_EAI APR_CHECK_WORKING_GETNAMEINFO diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 5395f99b011..e26959cddf2 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -441,6 +441,29 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_copy(apr_sockaddr_t **dst, const apr_sockaddr_t *src, apr_pool_t *p); +/* Set the zone of an IPv6 link-local address object. + * @param sa Socket address object + * @param zone_id Zone ID (textual "eth0" or numeric "3"). + */ +APR_DECLARE(apr_status_t) apr_sockaddr_zone_set(apr_sockaddr_t *sa, + const char *zone_id); + + +/* Retrieve the zone of an IPv6 link-local address object. + * @param sa Socket address object + * @param name If non-NULL, set to the textual representation of the zone id + * @param id If non-NULL, set to the integer zone id + * @param p Pool from which *name is allocated if used. + * @return Returns APR_EBADIP for non-IPv6 socket or socket without any zone id + * set, or other error if the interface could not be mapped to a name. + * @remark Both name and id may be NULL, neither are modified if + * non-NULL in error cases. + */ +APR_DECLARE(apr_status_t) apr_sockaddr_zone_get(const apr_sockaddr_t *sa, + const char **name, + apr_uint32_t *id, + apr_pool_t *p); + /** * Look up the host name from an apr_sockaddr_t. * @param hostname The hostname. diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h index 10e4656d19e..9f12efa189d 100644 --- a/include/arch/win32/apr_private.h +++ b/include/arch/win32/apr_private.h @@ -134,6 +134,8 @@ APR_DECLARE_DATA int errno; #if APR_HAVE_IPV6 #define HAVE_GETADDRINFO 1 #define HAVE_GETNAMEINFO 1 +#define HAVE_IF_INDEXTONAME 1 +#define HAVE_IF_NAMETOINDEX 1 #endif /* MSVC 7.0 introduced _strtoi64 */ diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 57bc0cb7ede..3b711fd5ba6 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -25,6 +25,10 @@ #include #endif +#ifdef HAVE_NET_IF_H +#include +#endif + #define APR_WANT_STRFUNC #include "apr_want.h" @@ -125,9 +129,31 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_getbuf(char *buf, apr_size_t buflen, memmove(buf, buf + strlen("::ffff:"), strlen(buf + strlen("::ffff:"))+1); } -#endif + /* ensure NUL termination if the buffer is too short */ buf[buflen-1] = '\0'; + +#ifdef HAVE_IF_INDEXTONAME + /* Append scope name for link-local addresses. */ + if (sockaddr->family == AF_INET6 + && IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)sockaddr->ipaddr_ptr)) { + char scbuf[IF_NAMESIZE], *p = buf + strlen(buf); + + if (if_indextoname(sockaddr->sa.sin6.sin6_scope_id, scbuf) == scbuf) { + /* Space check, need room for buf + '%' + scope + '\0'. + * Assert: buflen >= strlen(buf) + strlen(scbuf) + 2 + * Equiv: buflen >= (p-buf) + strlen(buf) + 2 + * Thus, fail in inverse condition: */ + if (buflen < strlen(scbuf) + (p - buf) + 2) { + return APR_ENOSPC; + } + *p++ = '%'; + memcpy(p, scbuf, strlen(scbuf) + 1); + } + } +#endif /* HAVE_IF_INDEXTONAME */ +#endif /* APR_HAVE_IPV6 */ + return APR_SUCCESS; } @@ -899,11 +925,19 @@ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, &((struct in6_addr *)(b)->ipaddr_ptr)->s6_addr[12], \ (a)->ipaddr_len)) +#if APR_HAVE_IPV6 +#define SCOPE_OR_ZERO(sa_) ((sa_)->family != AF_INET6 ? 0 : \ + ((sa_)->sa.sin6.sin6_scope_id)) +#else +#define SCOPE_OR_ZERO(sa_) (0) +#endif + APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1, const apr_sockaddr_t *addr2) { - if (addr1->ipaddr_len == addr2->ipaddr_len && - !memcmp(addr1->ipaddr_ptr, addr2->ipaddr_ptr, addr1->ipaddr_len)) { + if (addr1->ipaddr_len == addr2->ipaddr_len + && !memcmp(addr1->ipaddr_ptr, addr2->ipaddr_ptr, addr1->ipaddr_len) + && SCOPE_OR_ZERO(addr1) == SCOPE_OR_ZERO(addr2)) { return 1; } #if APR_HAVE_IPV6 @@ -1182,3 +1216,63 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa) #endif /* APR_HAVE_IPV6 */ return 0; /* no match */ } + +APR_DECLARE(apr_status_t) apr_sockaddr_zone_set(apr_sockaddr_t *sa, + const char *zone_id) +{ +#if !APR_HAVE_IPV6 || !defined(HAVE_IF_NAMETOINDEX) + return APR_ENOTIMPL; +#else + unsigned int idx; + + if (sa->family != APR_INET6) { + return APR_EBADIP; + } + + idx = if_nametoindex(zone_id); + if (idx) { + sa->sa.sin6.sin6_scope_id = idx; + return APR_SUCCESS; + } + + if (errno != ENODEV) { + return errno; + } + else { + char *endptr; + apr_int64_t i = apr_strtoi64(zone_id, &endptr, 10); + + if (*endptr != '\0' || errno || i < 1 || i > APR_INT16_MAX) { + return APR_EGENERAL; + } + + sa->sa.sin6.sin6_scope_id = i; + return APR_SUCCESS; + } +#endif +} + +APR_DECLARE(apr_status_t) apr_sockaddr_zone_get(const apr_sockaddr_t *sa, + const char **name, + apr_uint32_t *id, + apr_pool_t *p) +{ +#if !APR_HAVE_IPV6 || !defined(HAVE_IF_INDEXTONAME) + return APR_ENOTIMPL; +#else + if (sa->family != APR_INET6 || !sa->sa.sin6.sin6_scope_id) { + return APR_EBADIP; + } + + if (name) { + char *buf = apr_palloc(p, IF_NAMESIZE); + if (if_indextoname(sa->sa.sin6.sin6_scope_id, buf) == NULL) + return errno; + *name = buf; + } + + if (id) *id = sa->sa.sin6.sin6_scope_id; + + return APR_SUCCESS; +#endif +} diff --git a/test/testsock.c b/test/testsock.c index 70f8235ee08..933aa1da8d4 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -640,6 +640,98 @@ static void test_freebind(abts_case *tc, void *data) #endif } +#define TEST_ZONE_ADDR "fe80::1" + +#ifdef __linux__ +/* Reasonable bet that "lo" will exist. */ +#define TEST_ZONE_NAME "lo" +/* ... fill in other platforms here */ +#endif + +#ifdef TEST_ZONE_NAME +#define TEST_ZONE_FULLADDR TEST_ZONE_ADDR "%" TEST_ZONE_NAME +#endif + +static void test_zone(abts_case *tc, void *data) +{ +#if APR_HAVE_IPV6 + apr_sockaddr_t *sa; + apr_status_t rv; + const char *name = NULL; + apr_uint32_t id = 0; + + /* RFC 5737 address */ + rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_INET, 8080, 0, p); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); + + /* Fail for an IPv4 address! */ + ABTS_INT_EQUAL(tc, APR_EBADIP, + apr_sockaddr_zone_set(sa, "1")); + ABTS_INT_EQUAL(tc, APR_EBADIP, + apr_sockaddr_zone_get(sa, &name, &id, p)); + + rv = apr_sockaddr_info_get(&sa, TEST_ZONE_ADDR, APR_INET6, 8080, 0, p); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); + + rv = apr_sockaddr_info_get(&sa, TEST_ZONE_ADDR, APR_INET6, 8080, 0, p); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); + + ABTS_INT_EQUAL(tc, APR_EBADIP, apr_sockaddr_zone_get(sa, &name, &id, p)); + +#ifdef TEST_ZONE_NAME + { + apr_sockaddr_t *sa2; + char buf[50]; + + APR_ASSERT_SUCCESS(tc, "Set zone to " TEST_ZONE_NAME, + apr_sockaddr_zone_set(sa, TEST_ZONE_NAME)); + + APR_ASSERT_SUCCESS(tc, "Get zone", + apr_sockaddr_zone_get(sa, NULL, NULL, p)); + + APR_ASSERT_SUCCESS(tc, "Get zone", + apr_sockaddr_zone_get(sa, &name, &id, p)); + ABTS_STR_EQUAL(tc, TEST_ZONE_NAME, name); + ABTS_INT_NEQUAL(tc, 0, id); /* Only guarantee is that it should be non-zero */ + + /* Check string translation. */ + APR_ASSERT_SUCCESS(tc, "get IP address", + apr_sockaddr_ip_getbuf(buf, 50, sa)); + ABTS_STR_EQUAL(tc, TEST_ZONE_FULLADDR, buf); + + memset(buf, 'A', sizeof buf); + ABTS_INT_EQUAL(tc, APR_ENOSPC, apr_sockaddr_ip_getbuf(buf, strlen(TEST_ZONE_ADDR), sa)); + ABTS_INT_EQUAL(tc, APR_ENOSPC, apr_sockaddr_ip_getbuf(buf, strlen(TEST_ZONE_FULLADDR), sa)); + + APR_ASSERT_SUCCESS(tc, "get IP address", + apr_sockaddr_ip_getbuf(buf, strlen(TEST_ZONE_FULLADDR) + 1, sa)); + /* Check for overflow. */ + ABTS_INT_EQUAL(tc, 'A', buf[strlen(buf) + 1]); + + rv = apr_sockaddr_info_copy(&sa2, sa, p); + APR_ASSERT_SUCCESS(tc, "Problem copying sockaddr", rv); + + /* Copy copied zone matches */ + APR_ASSERT_SUCCESS(tc, "Get zone", + apr_sockaddr_zone_get(sa2, &name, &id, p)); + ABTS_STR_EQUAL(tc, TEST_ZONE_NAME, name); + ABTS_INT_NEQUAL(tc, 0, id); /* Only guarantee is that it should be non-zero */ + + /* Should match self and copy */ + ABTS_INT_NEQUAL(tc, 0, apr_sockaddr_equal(sa, sa)); + ABTS_INT_NEQUAL(tc, 0, apr_sockaddr_equal(sa2, sa2)); + ABTS_INT_NEQUAL(tc, 0, apr_sockaddr_equal(sa2, sa)); + + /* Should not match against copy without zone set. */ + rv = apr_sockaddr_info_get(&sa2, TEST_ZONE_ADDR, APR_INET6, 8080, 0, p); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); + + ABTS_INT_EQUAL(tc, 0, apr_sockaddr_equal(sa2, sa)); + } +#endif /* TEST_ZONE_NAME */ +#endif /* APR_HAVE_IPV6 */ +} + abts_suite *testsock(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -657,6 +749,7 @@ abts_suite *testsock(abts_suite *suite) abts_run_test(suite, test_wait, NULL); abts_run_test(suite, test_nonblock_inheritance, NULL); abts_run_test(suite, test_freebind, NULL); + abts_run_test(suite, test_zone, NULL); #if APR_HAVE_SOCKADDR_UN socket_name = UNIX_SOCKET_NAME; socket_type = APR_UNIX; From 624111a670f29113b8fb15e40688652974456f32 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 29 Nov 2017 13:31:09 +0000 Subject: [PATCH 7747/7878] * network_io/unix/sockaddr.c (apr_sockaddr_zone_set): Fail for an address which is not link-local. * include/apr_network_io.h: Document the above. * test/testsock.c (test_zone): Test for that. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1816628 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 2 ++ network_io/unix/sockaddr.c | 3 ++- test/testsock.c | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index e26959cddf2..733bf5a1791 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -444,6 +444,8 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_copy(apr_sockaddr_t **dst, /* Set the zone of an IPv6 link-local address object. * @param sa Socket address object * @param zone_id Zone ID (textual "eth0" or numeric "3"). + * @return Returns APR_EBADIP for non-IPv6 socket or an IPv6 address + * which isn't link-local. */ APR_DECLARE(apr_status_t) apr_sockaddr_zone_set(apr_sockaddr_t *sa, const char *zone_id); diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 3b711fd5ba6..8e4bde3e3b4 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -1225,7 +1225,8 @@ APR_DECLARE(apr_status_t) apr_sockaddr_zone_set(apr_sockaddr_t *sa, #else unsigned int idx; - if (sa->family != APR_INET6) { + if (sa->family != APR_INET6 + || !IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)sa->ipaddr_ptr)) { return APR_EBADIP; } diff --git a/test/testsock.c b/test/testsock.c index 933aa1da8d4..64df725ea06 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -660,7 +660,6 @@ static void test_zone(abts_case *tc, void *data) const char *name = NULL; apr_uint32_t id = 0; - /* RFC 5737 address */ rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_INET, 8080, 0, p); APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); @@ -669,6 +668,12 @@ static void test_zone(abts_case *tc, void *data) apr_sockaddr_zone_set(sa, "1")); ABTS_INT_EQUAL(tc, APR_EBADIP, apr_sockaddr_zone_get(sa, &name, &id, p)); + + rv = apr_sockaddr_info_get(&sa, "::1", APR_INET6, 8080, 0, p); + APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); + + /* Fail for an address which isn't link-local */ + ABTS_INT_EQUAL(tc, APR_EBADIP, apr_sockaddr_zone_set(sa, "1")); rv = apr_sockaddr_info_get(&sa, TEST_ZONE_ADDR, APR_INET6, 8080, 0, p); APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); From 5b2dc6183ac99d2b9829dbd8ff52e1258cfc0752 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 8 Dec 2017 11:24:18 +0000 Subject: [PATCH 7748/7878] * test/testsock.c (test_zone): Remove duplicate test, thanks to rpluem. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1817485 13f79535-47bb-0310-9956-ffa450edef68 --- test/testsock.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/testsock.c b/test/testsock.c index 64df725ea06..23a0073fe42 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -678,9 +678,6 @@ static void test_zone(abts_case *tc, void *data) rv = apr_sockaddr_info_get(&sa, TEST_ZONE_ADDR, APR_INET6, 8080, 0, p); APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); - rv = apr_sockaddr_info_get(&sa, TEST_ZONE_ADDR, APR_INET6, 8080, 0, p); - APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); - ABTS_INT_EQUAL(tc, APR_EBADIP, apr_sockaddr_zone_get(sa, &name, &id, p)); #ifdef TEST_ZONE_NAME From ab38ff8d84f79efbf72f5e7e58419528a7cca007 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 12 Dec 2017 08:33:18 +0000 Subject: [PATCH 7749/7878] Add apr_pool_get_tag to retrieve the pool tag name. * memory/unix/apr_pools.c (apr_pool_get_tag): New function. * test/testpools.c: Test it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1817892 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ include/apr_pools.h | 7 +++++++ memory/unix/apr_pools.c | 4 ++++ test/testpools.c | 8 ++++++++ 4 files changed, 21 insertions(+) diff --git a/CHANGES b/CHANGES index d80b6425574..2f92d163a9d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add apr_pool_tag_get to retrieve the pool tag name. [Joe Orton] + *) Add apr_sockaddr_zone_set, apr_sockaddr_zone_set to set and retrieve the zone for link-local IPv6 addresses. [Joe Orton] diff --git a/include/apr_pools.h b/include/apr_pools.h index 3020c996abd..f87b90b98e6 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -508,6 +508,13 @@ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag) __attribute__((nonnull(1))); +/** + * Retrieve the tag name. + * @param pool The pool + * @return Tag name, or NULL if no name is set. + */ +APR_DECLARE(const char *) apr_pool_get_tag(apr_pool_t *pool) + __attribute__((nonnull(1))); /* * User data management diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 3146433590b..d9eb59998c0 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -2432,6 +2432,10 @@ APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag) pool->tag = tag; } +APR_DECLARE(const char *) apr_pool_get_tag(apr_pool_t *pool) +{ + return pool->tag; +} /* * User data management diff --git a/test/testpools.c b/test/testpools.c index dd0919d06b4..8b00393893b 100644 --- a/test/testpools.c +++ b/test/testpools.c @@ -139,6 +139,13 @@ static void test_cleanups(abts_case *tc, void *data) } } +static void test_tags(abts_case *tc, void *data) +{ + ABTS_PTR_EQUAL(tc, NULL, apr_pool_get_tag(pmain)); + apr_pool_tag(pmain, "main pool"); + ABTS_STR_EQUAL(tc, "main pool", apr_pool_get_tag(pmain)); +} + abts_suite *testpool(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -150,6 +157,7 @@ abts_suite *testpool(abts_suite *suite) abts_run_test(suite, alloc_bytes, NULL); abts_run_test(suite, calloc_bytes, NULL); abts_run_test(suite, test_cleanups, NULL); + abts_run_test(suite, test_tags, NULL); return suite; } From 0689ec20e2f3c117e7dcaf247f9bbb5b034c4895 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 2 Jan 2018 17:23:45 +0000 Subject: [PATCH 7750/7878] testpoll: check that the wakeup pipe is still in the pollset after returning from poll(), e.g. APR_POLLSET_PORT should re-arm it automatically. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1819857 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/test/testpoll.c b/test/testpoll.c index 644983df3b9..9f90af2dd50 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -783,6 +783,7 @@ static void pollset_wakeup(abts_case *tc, void *data) apr_pollset_t *pollset; apr_int32_t num; const apr_pollfd_t *descriptors; + int i; rv = apr_pollset_create_ex(&pollset, 1, p, APR_POLLSET_WAKEABLE, default_pollset_impl); @@ -792,12 +793,18 @@ static void pollset_wakeup(abts_case *tc, void *data) } ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - /* send wakeup but no data; apr_pollset_poll() should return APR_EINTR */ - rv = apr_pollset_wakeup(pollset); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + /* Send wakeup but no data; apr_pollset_poll() should return APR_EINTR. + * Do it twice to test implementations that need to re-arm the events after + * poll()ing (e.g. APR_POLLSET_PORT), hence verify that the wakeup pipe is + * still in the place afterward. + */ + for (i = 0; i < 2; ++i) { + rv = apr_pollset_wakeup(pollset); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_pollset_poll(pollset, -1, &num, &descriptors); - ABTS_INT_EQUAL(tc, APR_EINTR, rv); + rv = apr_pollset_poll(pollset, -1, &num, &descriptors); + ABTS_INT_EQUAL(tc, APR_EINTR, rv); + } /* send wakeup and data; apr_pollset_poll() should return APR_SUCCESS */ socket_pollfd.desc_type = APR_POLL_SOCKET; From 698cc66cb99a4516a53b482d0745029d4877a39d Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 2 Jan 2018 17:28:53 +0000 Subject: [PATCH 7751/7878] poll, port: re-add the wakeup pipe to the pollset after it triggered. Just like user fds (file, socket), otherwise it's one shot only (PR-61786). Corresponding test committed in r1819857. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1819858 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index a436f62d840..8e2894f4888 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -358,7 +358,6 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, unsigned int nget; pfd_elem_t *ep; apr_status_t rv = APR_SUCCESS; - apr_pollfd_t fp; *num = 0; nget = 1; @@ -409,32 +408,30 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); for (i = 0, j = 0; i < nget; i++) { - fp = (((pfd_elem_t*)(pollset->p->port_set[i].portev_user))->pfd); + ep = (pfd_elem_t *)pollset->p->port_set[i].portev_user; if ((pollset->flags & APR_POLLSET_WAKEABLE) && - fp.desc_type == APR_POLL_FILE && - fp.desc.f == pollset->wakeup_pipe[0]) { + ep->pfd.desc_type == APR_POLL_FILE && + ep->pfd.desc.f == pollset->wakeup_pipe[0]) { apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe); rv = APR_EINTR; } else { - pollset->p->result_set[j] = fp; + pollset->p->result_set[j] = ep->pfd; pollset->p->result_set[j].rtnevents = get_revent(pollset->p->port_set[i].portev_events); - - /* If the ring element is still on the query ring, move it - * to the add ring for re-association with the event port - * later. (It may have already been moved to the dead ring - * by a call to pollset_remove on another thread.) - */ - ep = (pfd_elem_t *)pollset->p->port_set[i].portev_user; - if (ep->on_query_ring) { - APR_RING_REMOVE(ep, link); - ep->on_query_ring = 0; - APR_RING_INSERT_TAIL(&(pollset->p->add_ring), ep, - pfd_elem_t, link); - } j++; } + /* If the ring element is still on the query ring, move it + * to the add ring for re-association with the event port + * later. (It may have already been moved to the dead ring + * by a call to pollset_remove on another thread.) + */ + if (ep->on_query_ring) { + APR_RING_REMOVE(ep, link); + ep->on_query_ring = 0; + APR_RING_INSERT_TAIL(&(pollset->p->add_ring), ep, + pfd_elem_t, link); + } } pollset_unlock_rings(); if ((*num = j)) { /* any event besides wakeup pipe? */ From e8946419306bc3c6e38187845a121b1c4950f3fb Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 2 Jan 2018 18:06:42 +0000 Subject: [PATCH 7752/7878] poll, port: no need to release and re-acquire the lock in between walking the pollset and handling the dead ring, all is simple/fast/nonblocking ops. Also, set types of "i" and "j" respectively to the ones of nget and *num. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1819860 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index 8e2894f4888..b33c9b0eea2 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -354,8 +354,9 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, const apr_pollfd_t **descriptors) { apr_os_sock_t fd; - int ret, i, j; - unsigned int nget; + int ret; + unsigned int nget, i; + apr_int32_t j; pfd_elem_t *ep; apr_status_t rv = APR_SUCCESS; @@ -403,10 +404,9 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, port_associate within apr_pollset_add() */ apr_atomic_dec32(&pollset->p->waiting); - if (nget) { - - pollset_lock_rings(); + pollset_lock_rings(); + if (nget) { for (i = 0, j = 0; i < nget; i++) { ep = (pfd_elem_t *)pollset->p->port_set[i].portev_user; if ((pollset->flags & APR_POLLSET_WAKEABLE) && @@ -433,7 +433,6 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, pfd_elem_t, link); } } - pollset_unlock_rings(); if ((*num = j)) { /* any event besides wakeup pipe? */ rv = APR_SUCCESS; if (descriptors) { @@ -442,8 +441,6 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, } } - pollset_lock_rings(); - /* Shift all PFDs in the Dead Ring to the Free Ring */ APR_RING_CONCAT(&(pollset->p->free_ring), &(pollset->p->dead_ring), pfd_elem_t, link); From 00de4e1fb9fbaf8f4fd77fbd030affd151f6a767 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 2 Jan 2018 18:09:46 +0000 Subject: [PATCH 7753/7878] poll, port: follow up to r1819860. This test is redundant now, axe it (no functional change). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1819861 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/port.c | 60 +++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/poll/unix/port.c b/poll/unix/port.c index b33c9b0eea2..c1e599412ec 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -406,38 +406,36 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, pollset_lock_rings(); - if (nget) { - for (i = 0, j = 0; i < nget; i++) { - ep = (pfd_elem_t *)pollset->p->port_set[i].portev_user; - if ((pollset->flags & APR_POLLSET_WAKEABLE) && - ep->pfd.desc_type == APR_POLL_FILE && - ep->pfd.desc.f == pollset->wakeup_pipe[0]) { - apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe); - rv = APR_EINTR; - } - else { - pollset->p->result_set[j] = ep->pfd; - pollset->p->result_set[j].rtnevents = - get_revent(pollset->p->port_set[i].portev_events); - j++; - } - /* If the ring element is still on the query ring, move it - * to the add ring for re-association with the event port - * later. (It may have already been moved to the dead ring - * by a call to pollset_remove on another thread.) - */ - if (ep->on_query_ring) { - APR_RING_REMOVE(ep, link); - ep->on_query_ring = 0; - APR_RING_INSERT_TAIL(&(pollset->p->add_ring), ep, - pfd_elem_t, link); - } + for (i = 0, j = 0; i < nget; i++) { + ep = (pfd_elem_t *)pollset->p->port_set[i].portev_user; + if ((pollset->flags & APR_POLLSET_WAKEABLE) && + ep->pfd.desc_type == APR_POLL_FILE && + ep->pfd.desc.f == pollset->wakeup_pipe[0]) { + apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe); + rv = APR_EINTR; } - if ((*num = j)) { /* any event besides wakeup pipe? */ - rv = APR_SUCCESS; - if (descriptors) { - *descriptors = pollset->p->result_set; - } + else { + pollset->p->result_set[j] = ep->pfd; + pollset->p->result_set[j].rtnevents = + get_revent(pollset->p->port_set[i].portev_events); + j++; + } + /* If the ring element is still on the query ring, move it + * to the add ring for re-association with the event port + * later. (It may have already been moved to the dead ring + * by a call to pollset_remove on another thread.) + */ + if (ep->on_query_ring) { + APR_RING_REMOVE(ep, link); + ep->on_query_ring = 0; + APR_RING_INSERT_TAIL(&(pollset->p->add_ring), ep, + pfd_elem_t, link); + } + } + if ((*num = j)) { /* any event besides wakeup pipe? */ + rv = APR_SUCCESS; + if (descriptors) { + *descriptors = pollset->p->result_set; } } From 17b13ce6dc69d1b3cbe8deec5eb33f9b7574ca05 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 3 Jan 2018 09:33:47 +0000 Subject: [PATCH 7754/7878] poll, kqueue: save a pollfd (mem)copy per returned event. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1819934 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/kqueue.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 6a0ae614a95..548464db148 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -257,7 +257,6 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, int ret; struct timespec tv, *tvptr; apr_status_t rv = APR_SUCCESS; - apr_pollfd_t fd; *num = 0; @@ -280,17 +279,18 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, } else { int i, j; + const apr_pollfd_t *fd; for (i = 0, j = 0; i < ret; i++) { - fd = (((pfd_elem_t *)(pollset->p->ke_set[i].udata))->pfd); + fd = &((pfd_elem_t *)pollset->p->ke_set[i].udata)->pfd; if ((pollset->flags & APR_POLLSET_WAKEABLE) && - fd.desc_type == APR_POLL_FILE && - fd.desc.f == pollset->wakeup_pipe[0]) { + fd->desc_type == APR_POLL_FILE && + fd->desc.f == pollset->wakeup_pipe[0]) { apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe); rv = APR_EINTR; } else { - pollset->p->result_set[j] = fd; + pollset->p->result_set[j] = *fd; pollset->p->result_set[j].rtnevents = get_kqueue_revent(pollset->p->ke_set[i].filter, pollset->p->ke_set[i].flags); From 86ba7fdc615d919ebed13d2fa4ebf2b9238b4c85 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 3 Jan 2018 09:46:39 +0000 Subject: [PATCH 7755/7878] poll, epoll: pollset's pfd is not modified on poll(), mark it const. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1819935 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/epoll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 02db48a4028..4ab03f67ccc 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -274,7 +274,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, } else { int i, j; - apr_pollfd_t *fdptr; + const apr_pollfd_t *fdptr; for (i = 0, j = 0; i < ret; i++) { if (pollset->flags & APR_POLLSET_NOCOPY) { From fc76900cf918f3d7f9a58b11439f389ea28a9d43 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Thu, 4 Jan 2018 12:49:31 +0000 Subject: [PATCH 7756/7878] Happy New Year 2018 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1820080 13f79535-47bb-0310-9956-ffa450edef68 --- NOTICE | 2 +- include/apr_version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NOTICE b/NOTICE index 1d72bb175ec..e8117bf13a5 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Apache Portable Runtime -Copyright (c) 2000-2017 The Apache Software Foundation. +Copyright (c) 2000-2018 The Apache Software Foundation. This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff --git a/include/apr_version.h b/include/apr_version.h index 50c4b63d94a..c528be42d98 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -38,7 +38,7 @@ */ -#define APR_COPYRIGHT "Copyright (c) 2000-2017 The Apache Software " \ +#define APR_COPYRIGHT "Copyright (c) 2000-2018 The Apache Software " \ "Foundation or its licensors, as applicable." /* The numeric compile-time version constants. These constants are the From 1a32a2ac7b9881578f39800a4c1e1fbd3f3e4885 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Thu, 4 Jan 2018 19:46:53 +0000 Subject: [PATCH 7757/7878] Update config.guess and config.sub from https://git.savannah.gnu.org/cgit/config.git. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1820186 13f79535-47bb-0310-9956-ffa450edef68 --- build/config.guess | 48 +++++++++++++++++++++++++++++++--------------- build/config.sub | 34 +++++++++++++++++++++----------- 2 files changed, 56 insertions(+), 26 deletions(-) diff --git a/build/config.guess b/build/config.guess index 8bd1095f112..588fe82a42a 100755 --- a/build/config.guess +++ b/build/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2017 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2017-09-16' +timestamp='2018-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -39,7 +39,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2017 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -244,6 +244,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} exit ;; + *:MidnightBSD:*:*) + echo ${UNAME_MACHINE}-unknown-midnightbsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; @@ -262,6 +265,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:Redox:*:*) echo ${UNAME_MACHINE}-unknown-redox exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -479,13 +485,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); @@ -608,7 +614,7 @@ EOF *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and @@ -629,8 +635,8 @@ EOF 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` @@ -743,7 +749,7 @@ EOF { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -752,7 +758,7 @@ EOF *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -1072,7 +1078,7 @@ EOF i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + i*86:*:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} @@ -1400,8 +1406,20 @@ EOF exit ;; esac +echo "$0: unable to guess system type" >&2 + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 <." version="\ GNU config.sub ($timestamp) -Copyright 1992-2017 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -313,7 +313,6 @@ case $basic_machine in | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ - | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown @@ -640,7 +639,7 @@ case $basic_machine in basic_machine=rs6000-bull os=-bosx ;; - dpx2* | dpx2*-bull) + dpx2*) basic_machine=m68k-bull os=-sysv3 ;; @@ -902,7 +901,7 @@ case $basic_machine in basic_machine=v70-nec os=-sysv ;; - next | m*-next ) + next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) @@ -1417,7 +1416,7 @@ case $os in | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1492,7 +1491,7 @@ case $os in -nova*) os=-rtmk-nova ;; - -ns2 ) + -ns2) os=-nextstep2 ;; -nsk*) @@ -1547,6 +1546,19 @@ case $os in -dicos*) os=-dicos ;; + -pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $basic_machine in + arm*) + os=-eabi + ;; + *) + os=-elf + ;; + esac + ;; -nacl*) ;; -ios) @@ -1694,7 +1706,7 @@ case $basic_machine in m88k-omron*) os=-luna ;; - *-next ) + *-next) os=-nextstep ;; *-sequent) @@ -1829,7 +1841,7 @@ echo $basic_machine$os exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" From 8d78010883dce847b298f86f7e4c9e8fff914102 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Wed, 10 Jan 2018 14:53:43 +0000 Subject: [PATCH 7758/7878] fix ifdef for arc4random r1814239 added: AC_CHECK_FUNCS(arc4random_buf) Which only defines HAVE_ARC4RANDOM_BUF git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1820755 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/rand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 24221c8cacc..5e235990196 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -224,7 +224,7 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, length -= rc; } while (length > 0); -#elif defined(HAVE_ARC4RANDOM) +#elif defined(HAVE_ARC4RANDOM_BUF) arc4random_buf(buf, length); From 8c3e7fa67830e8bc2c5ae6158b29a064498e9d05 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Fri, 26 Jan 2018 15:24:40 +0000 Subject: [PATCH 7759/7878] * We cannot access list any longer after we called apr_allocator_free as it points to memory we just freed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1822315 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_buckets_alloc.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/buckets/apr_buckets_alloc.c b/buckets/apr_buckets_alloc.c index 79ac9293e8f..a2a25d42628 100644 --- a/buckets/apr_buckets_alloc.c +++ b/buckets/apr_buckets_alloc.c @@ -45,12 +45,21 @@ struct apr_bucket_alloc_t { static apr_status_t alloc_cleanup(void *data) { apr_bucket_alloc_t *list = data; +#if APR_POOL_DEBUG + apr_allocator_t *allocator = NULL; +#endif + +#if APR_POOL_DEBUG + if (list->pool && list->allocator != apr_pool_allocator_get(list->pool)) { + allocator = list->allocator; + } +#endif apr_allocator_free(list->allocator, list->blocks); #if APR_POOL_DEBUG - if (list->pool && list->allocator != apr_pool_allocator_get(list->pool)) { - apr_allocator_destroy(list->allocator); + if (allocator) { + apr_allocator_destroy(allocator); } #endif From 3d61931f94016ba5e8cae514abe67e21a9b5fd4e Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 26 Jan 2018 22:00:17 +0000 Subject: [PATCH 7760/7878] apr_pools: make index(es) an apr_size_t everywhere. Avoids "conversion from 'size_t' to 'apr_uint32_t', possible loss" warnings. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1822357 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index d9eb59998c0..5fa7da1b5be 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -188,7 +188,7 @@ APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator) APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) { - apr_uint32_t index; + apr_size_t index; apr_memnode_t *node, **ref; for (index = 0; index <= MAX_INDEX; index++) { @@ -235,7 +235,7 @@ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator) APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, apr_size_t in_size) { - apr_uint32_t max_free_index; + apr_size_t max_free_index; apr_size_t size = in_size; allocator_lock(allocator); @@ -280,7 +280,7 @@ static APR_INLINE apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) { apr_memnode_t *node, **ref; - apr_uint32_t max_index, upper_index; + apr_size_t max_index, upper_index; apr_size_t size, i, index; /* Round up the block size to the next boundary, but always @@ -341,7 +341,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t in_size) ref--; max_index--; } - while (*ref == NULL && max_index > 0); + while (*ref == NULL && max_index); allocator->max_index = max_index; } @@ -423,8 +423,8 @@ static APR_INLINE void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) { apr_memnode_t *next, *freelist = NULL; - apr_uint32_t index, max_index; - apr_uint32_t max_free_index, current_free_index; + apr_size_t index, max_index; + apr_size_t max_free_index, current_free_index; allocator_lock(allocator); @@ -554,7 +554,7 @@ typedef struct debug_node_t debug_node_t; struct debug_node_t { debug_node_t *next; - apr_uint32_t index; + apr_size_t index; void *beginp[64]; void *endp[64]; }; @@ -1848,7 +1848,7 @@ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *pool, apr_size_t size, static void pool_clear_debug(apr_pool_t *pool, const char *file_line) { debug_node_t *node; - apr_uint32_t index; + apr_size_t index; /* Run pre destroy cleanups */ run_cleanups(&pool->pre_cleanups); @@ -2265,7 +2265,7 @@ static int pool_find(apr_pool_t *pool, void *data) { void **pmem = (void **)data; debug_node_t *node; - apr_uint32_t index; + apr_size_t index; node = pool->nodes; @@ -2298,7 +2298,7 @@ static int pool_num_bytes(apr_pool_t *pool, void *data) { apr_size_t *psize = (apr_size_t *)data; debug_node_t *node; - apr_uint32_t index; + apr_size_t index; node = pool->nodes; From 71cf5aa36f5c5138d3bad87c6c1e8124b8df457f Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sun, 25 Feb 2018 16:36:31 +0000 Subject: [PATCH 7761/7878] Fix error handling in gdbm Only check for gdbm_errno if the return value of the called gdbm_* function says so. This fixes apr-util with gdbm 1.14, which does not seem to always reset gdbm_errno. Also make the gdbm driver return error codes starting with APR_OS_START_USEERR instead of always returning APR_EGENERAL. This is what the berkleydb driver already does. Also ensure that dsize is 0 if dptr == NULL. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1825311 13f79535-47bb-0310-9956-ffa450edef68 --- dbm/apr_dbm_gdbm.c | 48 ++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/dbm/apr_dbm_gdbm.c b/dbm/apr_dbm_gdbm.c index 1d8c96a6398..76fd86361f9 100644 --- a/dbm/apr_dbm_gdbm.c +++ b/dbm/apr_dbm_gdbm.c @@ -36,8 +36,20 @@ static apr_status_t g2s(int gerr) { if (gerr == -1) { - /* ### need to fix this */ - return APR_EGENERAL; + if (gdbm_errno == GDBM_NO_ERROR) + return APR_SUCCESS; + return APR_OS_START_USEERR + gdbm_errno; + } + + return APR_SUCCESS; +} + +static apr_status_t gdat2s(datum d) +{ + if (d.dptr == NULL) { + if (gdbm_errno == GDBM_NO_ERROR || gdbm_errno == GDBM_ITEM_NOT_FOUND) + return APR_SUCCESS; + return APR_OS_START_USEERR + gdbm_errno; } return APR_SUCCESS; @@ -53,22 +65,14 @@ static apr_status_t datum_cleanup(void *dptr) static apr_status_t set_error(apr_dbm_t *dbm, apr_status_t dbm_said) { - apr_status_t rv = APR_SUCCESS; - - /* ### ignore whatever the DBM said (dbm_said); ask it explicitly */ + dbm->errcode = dbm_said; - if ((dbm->errcode = gdbm_errno) == GDBM_NO_ERROR) { + if (dbm_said == APR_SUCCESS) dbm->errmsg = NULL; - } - else { - dbm->errmsg = gdbm_strerror(gdbm_errno); - rv = APR_EGENERAL; /* ### need something better */ - } - - /* captured it. clear it now. */ - gdbm_errno = GDBM_NO_ERROR; + else + dbm->errmsg = gdbm_strerror(dbm_said - APR_OS_START_USEERR); - return rv; + return dbm_said; } /* -------------------------------------------------------------------------- @@ -107,7 +111,7 @@ static apr_status_t vt_gdbm_open(apr_dbm_t **pdb, const char *pathname, NULL); if (file == NULL) - return APR_EGENERAL; /* ### need a better error */ + return APR_OS_START_USEERR + gdbm_errno; /* we have an open database... return it */ *pdb = apr_pcalloc(pool, sizeof(**pdb)); @@ -141,10 +145,12 @@ static apr_status_t vt_gdbm_fetch(apr_dbm_t *dbm, apr_datum_t key, if (pvalue->dptr) apr_pool_cleanup_register(dbm->pool, pvalue->dptr, datum_cleanup, apr_pool_cleanup_null); + else + pvalue->dsize = 0; /* store the error info into DBM, and return a status code. Also, note that *pvalue should have been cleared on error. */ - return set_error(dbm, APR_SUCCESS); + return set_error(dbm, gdat2s(rd)); } static apr_status_t vt_gdbm_store(apr_dbm_t *dbm, apr_datum_t key, @@ -201,9 +207,11 @@ static apr_status_t vt_gdbm_firstkey(apr_dbm_t *dbm, apr_datum_t *pkey) if (pkey->dptr) apr_pool_cleanup_register(dbm->pool, pkey->dptr, datum_cleanup, apr_pool_cleanup_null); + else + pkey->dsize = 0; /* store any error info into DBM, and return a status code. */ - return set_error(dbm, APR_SUCCESS); + return set_error(dbm, gdat2s(rd)); } static apr_status_t vt_gdbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey) @@ -221,9 +229,11 @@ static apr_status_t vt_gdbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey) if (pkey->dptr) apr_pool_cleanup_register(dbm->pool, pkey->dptr, datum_cleanup, apr_pool_cleanup_null); + else + pkey->dsize = 0; /* store any error info into DBM, and return a status code. */ - return set_error(dbm, APR_SUCCESS); + return set_error(dbm, gdat2s(rd)); } static void vt_gdbm_freedatum(apr_dbm_t *dbm, apr_datum_t data) From 9e90afedc3426bb634e85d3477c42e4224ebbe56 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 22 Mar 2018 22:46:30 +0000 Subject: [PATCH 7762/7878] configure: fix detection of net/if.h on openbsd. Depends on sys/socket.h. PR-61976. Proposed by: David Carlier Reviewed by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1827534 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index b9d537cdb56..71c4b6b48b7 100644 --- a/configure.in +++ b/configure.in @@ -1070,8 +1070,14 @@ case $host in esac AC_CHECK_HEADERS([sys/types.h sys/mman.h sys/ipc.h sys/mutex.h \ - sys/shm.h sys/file.h kernel/OS.h os2.h windows.h \ - net/if.h]) + sys/shm.h sys/file.h sys/socket.h kernel/OS.h os2.h windows.h]) +AC_CHECK_HEADERS([net/if.h],[],[], +[ +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#include +]) AC_CHECK_FUNCS([mmap munmap shm_open shm_unlink shmget shmat shmdt shmctl \ create_area mprotect]) From 204c72b9182c6aae4dd2e84ea1fcf14bf466cb45 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 3 Apr 2018 22:00:10 +0000 Subject: [PATCH 7763/7878] reslist: Add apr_reslist_fifo_set(). This allows to reuse resources in FIFO mode instead of the default LIFO mode. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1828289 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_reslist.h | 7 +++++++ util-misc/apr_reslist.c | 13 ++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 2f92d163a9d..d6294d3ceda 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) reslist: Add apr_reslist_fifo_set() to allow for reusing resources + in FIFO mode instead of the default LIFO mode. [Yann Ylavic] + *) Add apr_pool_tag_get to retrieve the pool tag name. [Joe Orton] *) Add apr_sockaddr_zone_set, apr_sockaddr_zone_set to set and retrieve diff --git a/include/apr_reslist.h b/include/apr_reslist.h index 4e09e12aacb..c0e111fd5dc 100644 --- a/include/apr_reslist.h +++ b/include/apr_reslist.h @@ -134,6 +134,13 @@ APR_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, */ APR_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, apr_interval_time_t timeout); +/** + * Set whether the reslist reuses resources as FIFO (First In First Out) or + * LIFO (Last In First Out). + * @param reslist The resource list. + * @param fifo Set as FIFO (non zero) or LIFO (zero). + */ +APR_DECLARE(void) apr_reslist_fifo_set(apr_reslist_t *reslist, int to); /** * Return the number of outstanding resources. diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c index ecc17a7d4d6..57b583089e7 100644 --- a/util-misc/apr_reslist.c +++ b/util-misc/apr_reslist.c @@ -58,6 +58,7 @@ struct apr_reslist_t { apr_thread_mutex_t *listlock; apr_thread_cond_t *avail; #endif + int fifo; }; /** @@ -80,7 +81,12 @@ static apr_res_t *pop_resource(apr_reslist_t *reslist) */ static void push_resource(apr_reslist_t *reslist, apr_res_t *resource) { - APR_RING_INSERT_HEAD(&reslist->avail_list, resource, apr_res_t, link); + if (reslist->fifo) { + APR_RING_INSERT_TAIL(&reslist->avail_list, resource, apr_res_t, link); + } + else { + APR_RING_INSERT_HEAD(&reslist->avail_list, resource, apr_res_t, link); + } resource->freed = apr_time_now(); reslist->nidle++; } @@ -434,6 +440,11 @@ APR_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, reslist->timeout = timeout; } +APR_DECLARE(void) apr_reslist_fifo_set(apr_reslist_t *reslist, int to) +{ + reslist->fifo = to; +} + APR_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist) { apr_uint32_t count; From 9aad979cf4fea4a0e796cc39553c6f61f5842d38 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 4 Apr 2018 17:15:27 +0000 Subject: [PATCH 7764/7878] reslist: follow up to r1828289: name fifo arg according to doxygen. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1828367 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_reslist.h | 2 +- util-misc/apr_reslist.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_reslist.h b/include/apr_reslist.h index c0e111fd5dc..291cc5593a1 100644 --- a/include/apr_reslist.h +++ b/include/apr_reslist.h @@ -140,7 +140,7 @@ APR_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, * @param reslist The resource list. * @param fifo Set as FIFO (non zero) or LIFO (zero). */ -APR_DECLARE(void) apr_reslist_fifo_set(apr_reslist_t *reslist, int to); +APR_DECLARE(void) apr_reslist_fifo_set(apr_reslist_t *reslist, int fifo); /** * Return the number of outstanding resources. diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c index 57b583089e7..48c4d36cebe 100644 --- a/util-misc/apr_reslist.c +++ b/util-misc/apr_reslist.c @@ -440,9 +440,9 @@ APR_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, reslist->timeout = timeout; } -APR_DECLARE(void) apr_reslist_fifo_set(apr_reslist_t *reslist, int to) +APR_DECLARE(void) apr_reslist_fifo_set(apr_reslist_t *reslist, int fifo) { - reslist->fifo = to; + reslist->fifo = fifo; } APR_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist) From 5df07beb06ee24873855755a5f57b4bdec3033ad Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 4 Apr 2018 17:43:46 +0000 Subject: [PATCH 7765/7878] reslist: follow up to r1828289: adjust maintenance top too. Also, clarify in doxygen when apr_reslist_fifo_set() should be called. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1828369 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_reslist.h | 6 ++++++ util-misc/apr_reslist.c | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/apr_reslist.h b/include/apr_reslist.h index 291cc5593a1..d1947944a4e 100644 --- a/include/apr_reslist.h +++ b/include/apr_reslist.h @@ -134,11 +134,17 @@ APR_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, */ APR_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, apr_interval_time_t timeout); + /** * Set whether the reslist reuses resources as FIFO (First In First Out) or * LIFO (Last In First Out). * @param reslist The resource list. * @param fifo Set as FIFO (non zero) or LIFO (zero). + * @remark This function should be called before any resource is in the + * the reslist, otherwise maintenance optimizations based on the expiration + * time relative to the order of insertion (i.e. position in the list) won't + * work as expected. + * */ APR_DECLARE(void) apr_reslist_fifo_set(apr_reslist_t *reslist, int fifo); diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c index 48c4d36cebe..ddc9eb5eaf5 100644 --- a/util-misc/apr_reslist.c +++ b/util-misc/apr_reslist.c @@ -229,8 +229,13 @@ APR_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist) /* Check if we need to expire old resources */ now = apr_time_now(); while (reslist->nidle > reslist->smax && reslist->nidle > 0) { - /* Peak at the last resource in the list */ - res = APR_RING_LAST(&reslist->avail_list); + /* Peek at the next expiring resource in the list */ + if (reslist->fifo) { + res = APR_RING_FIRST(&reslist->avail_list); + } + else { + res = APR_RING_LAST(&reslist->avail_list); + } /* See if the oldest entry should be expired */ if (now - res->freed < reslist->ttl) { /* If this entry is too young, none of the others From 207ae81c466a29efa5070b5b060803c39cc8024e Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 6 Apr 2018 07:53:02 +0000 Subject: [PATCH 7766/7878] reslist: follow up to r1828289: enfore empty list requirement when setting fifo. The doxygen remark wasn't enough as noted by Ruediger. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1828492 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_reslist.h | 15 ++++++++------- util-misc/apr_reslist.c | 8 +++++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/include/apr_reslist.h b/include/apr_reslist.h index d1947944a4e..7690a8e574f 100644 --- a/include/apr_reslist.h +++ b/include/apr_reslist.h @@ -136,17 +136,18 @@ APR_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, apr_interval_time_t timeout); /** - * Set whether the reslist reuses resources as FIFO (First In First Out) or - * LIFO (Last In First Out). + * Set whether the reslist should maintain resources as FIFO (First In First + * Out) or LIFO (Last In First Out). * @param reslist The resource list. * @param fifo Set as FIFO (non zero) or LIFO (zero). - * @remark This function should be called before any resource is in the - * the reslist, otherwise maintenance optimizations based on the expiration - * time relative to the order of insertion (i.e. position in the list) won't - * work as expected. + * @return APR_SUCCESS, or APR_EBUSY if the resource is not empty. + * @remark The reslist is required to be empty because some maintenance + * optimizations are based on the relative position of resources in the list + * to determine their expiry. * */ -APR_DECLARE(void) apr_reslist_fifo_set(apr_reslist_t *reslist, int fifo); +APR_DECLARE(apr_status_t) apr_reslist_fifo_set(apr_reslist_t *reslist, + int fifo); /** * Return the number of outstanding resources. diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c index ddc9eb5eaf5..6e477110f15 100644 --- a/util-misc/apr_reslist.c +++ b/util-misc/apr_reslist.c @@ -445,9 +445,15 @@ APR_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, reslist->timeout = timeout; } -APR_DECLARE(void) apr_reslist_fifo_set(apr_reslist_t *reslist, int fifo) +APR_DECLARE(apr_status_t) apr_reslist_fifo_set(apr_reslist_t *reslist, + int fifo) { + if (!APR_RING_EMPTY(&reslist->avail_list, apr_res_t, link)) { + return APR_EBUSY; + } + reslist->fifo = fifo; + return APR_SUCCESS; } APR_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist) From 42abd9a8ef9158cdfe35ecc60c0a76541d7c2632 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 6 Apr 2018 08:26:23 +0000 Subject: [PATCH 7767/7878] reslist: follow up to r1828289: fix typo and wording. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1828497 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_reslist.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_reslist.h b/include/apr_reslist.h index 7690a8e574f..3bdb07c5b1b 100644 --- a/include/apr_reslist.h +++ b/include/apr_reslist.h @@ -140,10 +140,10 @@ APR_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, * Out) or LIFO (Last In First Out). * @param reslist The resource list. * @param fifo Set as FIFO (non zero) or LIFO (zero). - * @return APR_SUCCESS, or APR_EBUSY if the resource is not empty. + * @return APR_SUCCESS, or APR_EBUSY if the reslist is not empty. * @remark The reslist is required to be empty because some maintenance - * optimizations are based on the relative position of resources in the list - * to determine their expiry. + * optimizations are based on the relative positions of resources in the + * list to determine their expiry. * */ APR_DECLARE(apr_status_t) apr_reslist_fifo_set(apr_reslist_t *reslist, From c06ca1cbc06b6e0044e4a6fccc87630ea479e0b1 Mon Sep 17 00:00:00 2001 From: Evgeny Kotkov Date: Fri, 6 Apr 2018 11:26:47 +0000 Subject: [PATCH 7768/7878] Win32: Improve apr_file_read() performance on buffered files by reducing the amount of ReadFile() calls for large reads. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, reading has been implemented with a loop that keeps filling in the internal 4KB buffer and copying the data from it. This patch reduces the amount of syscalls for large reads by performing them with a single syscall, if possible. With the new approach, reads are first handled from the buffer — however, once the buffer is empty and the remaining chunk exceeds the capacity of the internal buffer, it will be read with a single syscall. Otherwise, the behavior is unchanged: we fill in the buffer up to its capacity and serve the requested part from it. To avoid introducing a regression in the case when the large read happens with a single syscall, copy the final part of the data into the internal buffer so that seeking backwards (within the bufsize) and reading would work from the buffer. A quick benchmark shows the significant reduction of the CPU time for an application that uses buffered files with both small and large reads (the large reads are approximately 128 KB-sized): CPU time: 27.250 s → 17.203 s Amount of syscalls: 1,579,587 → 139,899 * file_io/win32/readwrite.c (read_buffered): Reimplement the core part of this function as described above. Note that the new approach no longer requires a loop, as in the case when the buffer is empty, we only need to make a single syscall, either to fill the internal buffer or to read directly into the destination buffer. Rename a couple of local variables for clarity. * test/testfile.c (test_empty_read_buffered, test_large_read_buffered, test_two_large_reads_buffered, test_small_and_large_reads_buffered, test_read_buffered_spanning_over_bufsize, test_single_byte_reads_buffered, test_read_buffered_seek): New tests. (testfile): Run the new tests. * CHANGES: Add entry. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1828509 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + file_io/win32/readwrite.c | 80 ++++++--- test/testfile.c | 365 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 425 insertions(+), 23 deletions(-) diff --git a/CHANGES b/CHANGES index d6294d3ceda..cbabe2ec618 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_file_write: Optimize large reads from buffered files on Windows. + [Evgeny Kotkov] + *) reslist: Add apr_reslist_fifo_set() to allow for reusing resources in FIFO mode instead of the default LIFO mode. [Yann Ylavic] diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 5ad2c3b83ce..99c4bdfe9fb 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -144,8 +144,9 @@ static apr_status_t read_buffered(apr_file_t *thefile, void *buf, apr_size_t *le { apr_status_t rv; char *pos = (char *)buf; - apr_size_t blocksize; - apr_size_t size = *len; + apr_size_t bytes_read; + apr_size_t size; + apr_size_t remaining = *len; if (thefile->direction == 1) { rv = apr_file_flush(thefile); @@ -157,29 +158,62 @@ static apr_status_t read_buffered(apr_file_t *thefile, void *buf, apr_size_t *le thefile->dataRead = 0; } - rv = 0; - while (rv == 0 && size > 0) { - if (thefile->bufpos >= thefile->dataRead) { - apr_size_t read; - rv = read_with_timeout(thefile, thefile->buffer, - thefile->bufsize, &read); - if (read == 0) { - if (rv == APR_EOF) - thefile->eof_hit = TRUE; - break; - } - else { - thefile->dataRead = read; - thefile->filePtr += thefile->dataRead; - thefile->bufpos = 0; - } + /* Copy the data we have in the buffer. */ + size = thefile->dataRead - thefile->bufpos; + if (size > remaining) { + size = remaining; + } + memcpy(pos, thefile->buffer + thefile->bufpos, size); + pos += size; + remaining -= size; + thefile->bufpos += size; + + if (remaining == 0) { + /* Nothing to do more, keep *LEN unchanged and return. */ + return APR_SUCCESS; + } + /* The buffer is empty, but the caller wants more. + * Decide on the most appropriate way to read from the file: + */ + if (remaining > thefile->bufsize) { + /* If the remaining chunk won't fit into the buffer, read it into + * the destination buffer with a single syscall. + */ + rv = read_with_timeout(thefile, pos, remaining, &bytes_read); + thefile->filePtr += bytes_read; + pos += bytes_read; + /* Also, copy the last BUFSIZE (or less in case of a short read) bytes + * from the chunk to our buffer so that seeking backwards and reading + * would work from the buffer. + */ + size = thefile->bufsize; + if (size > bytes_read) { + size = bytes_read; } + memcpy(thefile->buffer, pos - size, size); + thefile->bufpos = size; + thefile->dataRead = size; + } + else { + /* The remaining chunk fits into the buffer. Read up to BUFSIZE bytes + * from the file to our internal buffer. + */ + rv = read_with_timeout(thefile, thefile->buffer, thefile->bufsize, &bytes_read); + thefile->filePtr += bytes_read; + thefile->bufpos = 0; + thefile->dataRead = bytes_read; + /* Copy the required part to the caller. */ + size = remaining; + if (size > bytes_read) { + size = bytes_read; + } + memcpy(pos, thefile->buffer, size); + pos += size; + thefile->bufpos += size; + } - blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size; - memcpy(pos, thefile->buffer + thefile->bufpos, blocksize); - thefile->bufpos += blocksize; - pos += blocksize; - size -= blocksize; + if (bytes_read == 0 && rv == APR_EOF) { + thefile->eof_hit = TRUE; } *len = pos - (char *)buf; diff --git a/test/testfile.c b/test/testfile.c index 73b13c4bf14..7493047b7d8 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -1843,6 +1843,364 @@ static void test_append_read(abts_case *tc, void *data) apr_file_remove(fname, p); } +static void test_empty_read_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testempty_read_buffered.dat"; + apr_size_t len; + apr_size_t bytes_read; + char buf[64]; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "create empty test file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + /* Test an empty read. */ + len = 1; + rv = apr_file_read_full(f, buf, len, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, 0, (int)bytes_read); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_large_read_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testlarge_read_buffered.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + len = 80000; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + rv = apr_file_write_full(f, buf, len, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + /* Test a single large read. */ + buf2 = apr_palloc(p, len); + rv = apr_file_read_full(f, buf2, len, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, (int)len, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, bytes_read) == 0); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + /* Test that we receive an EOF. */ + len = 1; + rv = apr_file_read_full(f, buf2, len, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, 0, (int)bytes_read); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_two_large_reads_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtwo_large_reads_buffered.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + len = 80000; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + rv = apr_file_write_full(f, buf, len, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + /* Test two consecutive large reads. */ + buf2 = apr_palloc(p, len); + memset(buf2, 0, len); + rv = apr_file_read_full(f, buf2, len / 2, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, (int)(len / 2), (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, bytes_read) == 0); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + memset(buf2, 0, len); + rv = apr_file_read_full(f, buf2, len / 2, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, (int)(len / 2), (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf + len / 2, buf2, bytes_read) == 0); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + /* Test that we receive an EOF. */ + len = 1; + rv = apr_file_read_full(f, buf2, len, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, 0, (int)bytes_read); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_small_and_large_reads_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtwo_large_reads_buffered.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + len = 80000; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + rv = apr_file_write_full(f, buf, len, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + /* Test small read followed by a large read. */ + buf2 = apr_palloc(p, len); + memset(buf2, 0, len); + rv = apr_file_read_full(f, buf2, 5, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, 5, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, bytes_read) == 0); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + memset(buf2, 0, len); + rv = apr_file_read_full(f, buf2, len - 5, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, (int)(len - 5), (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf + 5, buf2, bytes_read) == 0); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + /* Test that we receive an EOF. */ + len = 1; + rv = apr_file_read_full(f, buf2, len, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, 0, (int)bytes_read); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_read_buffered_spanning_over_bufsize(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testread_buffered_spanning_over_bufsize.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + char *buf2; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + len = APR_BUFFERSIZE + 1; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + rv = apr_file_write_full(f, buf, len, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + /* Test reads than span over the default buffer size. */ + buf2 = apr_palloc(p, len); + memset(buf2, 0, len); + rv = apr_file_read_full(f, buf2, APR_BUFFERSIZE - 1, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, APR_BUFFERSIZE - 1, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, bytes_read) == 0); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + memset(buf2, 0, len); + rv = apr_file_read_full(f, buf2, 2, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, 2, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, buf2, bytes_read) == 0); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + /* Test that we receive an EOF. */ + len = 1; + rv = apr_file_read_full(f, buf2, len, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, 0, (int)bytes_read); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_single_byte_reads_buffered(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testsingle_byte_reads_buffered.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char *buf; + apr_size_t total; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + len = 40000; + buf = apr_palloc(p, len); + memset(buf, 'a', len); + rv = apr_file_write_full(f, buf, len, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + total = 0; + while (1) { + memset(buf, 0, len); + rv = apr_file_read_full(f, buf, 1, &bytes_read); + if (rv == APR_EOF) { + break; + } + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, 1, (int)bytes_read); + ABTS_INT_EQUAL(tc, 'a', buf[0]); + total += bytes_read; + } + ABTS_INT_EQUAL(tc, (int)len, (int)total); + + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + apr_file_close(f); + + apr_file_remove(fname, p); +} + +static void test_read_buffered_seek(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtest_read_buffered_seek.dat"; + apr_size_t len; + apr_size_t bytes_written; + apr_size_t bytes_read; + char buf[64]; + apr_off_t off; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, APR_FOPEN_CREATE | APR_FOPEN_WRITE, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for writing", rv); + rv = apr_file_write_full(f, "abcdef", 6, &bytes_written); + APR_ASSERT_SUCCESS(tc, "write to file", rv); + apr_file_close(f); + + rv = apr_file_open(&f, fname, APR_FOPEN_READ | APR_FOPEN_BUFFERED, + APR_FPROT_OS_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "open test file for reading", rv); + + /* Read one byte. */ + memset(buf, 0, sizeof(buf)); + rv = apr_file_read_full(f, buf, 1, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, 1, (int)bytes_read); + ABTS_INT_EQUAL(tc, 'a', buf[0]); + + /* Seek into the middle of the file. */ + off = 3; + rv = apr_file_seek(f, APR_SET, &off); + APR_ASSERT_SUCCESS(tc, "change file read offset", rv); + ABTS_INT_EQUAL(tc, 3, (int)off); + + /* Read three bytes. */ + memset(buf, 0, sizeof(buf)); + rv = apr_file_read_full(f, buf, 3, &bytes_read); + APR_ASSERT_SUCCESS(tc, "read from file", rv); + ABTS_INT_EQUAL(tc, 3, (int)bytes_read); + ABTS_TRUE(tc, memcmp(buf, "def", bytes_read) == 0); + + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + /* Test that we receive an EOF. */ + len = 1; + rv = apr_file_read_full(f, buf, len, &bytes_read); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + ABTS_INT_EQUAL(tc, 0, (int)bytes_read); + rv = apr_file_eof(f); + ABTS_INT_EQUAL(tc, APR_EOF, rv); + apr_file_close(f); + + apr_file_remove(fname, p); +} + abts_suite *testfile(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -1899,6 +2257,13 @@ abts_suite *testfile(abts_suite *suite) abts_run_test(suite, test_atomic_append, NULL); abts_run_test(suite, test_append_locked, NULL); abts_run_test(suite, test_append_read, NULL); + abts_run_test(suite, test_empty_read_buffered, NULL); + abts_run_test(suite, test_large_read_buffered, NULL); + abts_run_test(suite, test_two_large_reads_buffered, NULL); + abts_run_test(suite, test_small_and_large_reads_buffered, NULL); + abts_run_test(suite, test_read_buffered_spanning_over_bufsize, NULL); + abts_run_test(suite, test_single_byte_reads_buffered, NULL); + abts_run_test(suite, test_read_buffered_seek, NULL); return suite; } From 627bb283a309fe17fadc03c0ec2f1efd6f359bb8 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 13 Apr 2018 21:02:00 +0000 Subject: [PATCH 7769/7878] evert apr_reslist_fifo_set() (r1828289 and follow ups). Will re-implement the feature through apr_reslist_acquire_fifo(), as proposed by Bill. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1829102 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 --- include/apr_reslist.h | 14 -------------- util-misc/apr_reslist.c | 28 +++------------------------- 3 files changed, 3 insertions(+), 42 deletions(-) diff --git a/CHANGES b/CHANGES index cbabe2ec618..ae24bb443e6 100644 --- a/CHANGES +++ b/CHANGES @@ -4,9 +4,6 @@ Changes for APR 2.0.0 *) apr_file_write: Optimize large reads from buffered files on Windows. [Evgeny Kotkov] - *) reslist: Add apr_reslist_fifo_set() to allow for reusing resources - in FIFO mode instead of the default LIFO mode. [Yann Ylavic] - *) Add apr_pool_tag_get to retrieve the pool tag name. [Joe Orton] *) Add apr_sockaddr_zone_set, apr_sockaddr_zone_set to set and retrieve diff --git a/include/apr_reslist.h b/include/apr_reslist.h index 3bdb07c5b1b..4e09e12aacb 100644 --- a/include/apr_reslist.h +++ b/include/apr_reslist.h @@ -135,20 +135,6 @@ APR_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, APR_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, apr_interval_time_t timeout); -/** - * Set whether the reslist should maintain resources as FIFO (First In First - * Out) or LIFO (Last In First Out). - * @param reslist The resource list. - * @param fifo Set as FIFO (non zero) or LIFO (zero). - * @return APR_SUCCESS, or APR_EBUSY if the reslist is not empty. - * @remark The reslist is required to be empty because some maintenance - * optimizations are based on the relative positions of resources in the - * list to determine their expiry. - * - */ -APR_DECLARE(apr_status_t) apr_reslist_fifo_set(apr_reslist_t *reslist, - int fifo); - /** * Return the number of outstanding resources. * @param reslist The resource list. diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c index 6e477110f15..ecc17a7d4d6 100644 --- a/util-misc/apr_reslist.c +++ b/util-misc/apr_reslist.c @@ -58,7 +58,6 @@ struct apr_reslist_t { apr_thread_mutex_t *listlock; apr_thread_cond_t *avail; #endif - int fifo; }; /** @@ -81,12 +80,7 @@ static apr_res_t *pop_resource(apr_reslist_t *reslist) */ static void push_resource(apr_reslist_t *reslist, apr_res_t *resource) { - if (reslist->fifo) { - APR_RING_INSERT_TAIL(&reslist->avail_list, resource, apr_res_t, link); - } - else { - APR_RING_INSERT_HEAD(&reslist->avail_list, resource, apr_res_t, link); - } + APR_RING_INSERT_HEAD(&reslist->avail_list, resource, apr_res_t, link); resource->freed = apr_time_now(); reslist->nidle++; } @@ -229,13 +223,8 @@ APR_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist) /* Check if we need to expire old resources */ now = apr_time_now(); while (reslist->nidle > reslist->smax && reslist->nidle > 0) { - /* Peek at the next expiring resource in the list */ - if (reslist->fifo) { - res = APR_RING_FIRST(&reslist->avail_list); - } - else { - res = APR_RING_LAST(&reslist->avail_list); - } + /* Peak at the last resource in the list */ + res = APR_RING_LAST(&reslist->avail_list); /* See if the oldest entry should be expired */ if (now - res->freed < reslist->ttl) { /* If this entry is too young, none of the others @@ -445,17 +434,6 @@ APR_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, reslist->timeout = timeout; } -APR_DECLARE(apr_status_t) apr_reslist_fifo_set(apr_reslist_t *reslist, - int fifo) -{ - if (!APR_RING_EMPTY(&reslist->avail_list, apr_res_t, link)) { - return APR_EBUSY; - } - - reslist->fifo = fifo; - return APR_SUCCESS; -} - APR_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist) { apr_uint32_t count; From 003c0d10177998068ceca1c7c618b2cee59badcd Mon Sep 17 00:00:00 2001 From: Mladen Turk Date: Tue, 24 Apr 2018 07:14:11 +0000 Subject: [PATCH 7770/7878] Unlock mutex only if APR_FOPEN_XTHREAD flag is set git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1829962 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/buffer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file_io/win32/buffer.c b/file_io/win32/buffer.c index 1b7d857ca39..7f5d9d375bd 100644 --- a/file_io/win32/buffer.c +++ b/file_io/win32/buffer.c @@ -31,7 +31,9 @@ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *file, /* Flush the existing buffer */ rv = apr_file_flush(file); if (rv != APR_SUCCESS) { - apr_thread_mutex_unlock(file->mutex); + if (file->flags & APR_FOPEN_XTHREAD) { + apr_thread_mutex_unlock(file->mutex); + } return rv; } } From 2f35531c25b65b96999ece39246891b6db17e2a8 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Thu, 24 May 2018 21:15:53 +0000 Subject: [PATCH 7771/7878] Fix a potential usage of an un-init variable. (i.e. 'wch') Up to now, this can NOT happen, because the only caller passes -1 for 'args'. So axe this useless parameter to avoid troubles. See PR 60086. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1832203 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/start.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/misc/win32/start.c b/misc/win32/start.c index eb77d4a4ddd..131d55622e1 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -39,7 +39,7 @@ int APR_DECLARE_DATA apr_app_init_complete = 0; * _CRT_BLOCK to trick the system into trusting our store. */ static int warrsztoastr(const char * const * *retarr, - const wchar_t * arrsz, int args) + const wchar_t * arrsz) { const apr_wchar_t *wch; apr_size_t totlen; @@ -50,11 +50,9 @@ static int warrsztoastr(const char * const * *retarr, char *strs; int arg; - if (args < 0) { - for (args = 1, wch = arrsz; wch[0] || wch[1]; ++wch) - if (!*wch) - ++args; - } + for (args = 1, wch = arrsz; wch[0] || wch[1]; ++wch) + if (!*wch) + ++args; wsize = 1 + wch - arrsz; /* This is a safe max allocation, we will alloc each @@ -134,7 +132,7 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, } sysstr = GetEnvironmentStringsW(); - dupenv = warrsztoastr(&_environ, sysstr, -1); + dupenv = warrsztoastr(&_environ, sysstr); if (env) { *env = apr_malloc_dbg((dupenv + 1) * sizeof (char *), From b64327662d993e9f028d64578c328ebabd765681 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Mon, 28 May 2018 19:45:56 +0000 Subject: [PATCH 7772/7878] Better stack memseting of sensitive information. Why is 'apr_crypto_memzero()' only available if APU_HAVE_CRYPTO=1? See PR 55738 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1832415 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_md4.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crypto/apr_md4.c b/crypto/apr_md4.c index d983cbae5c2..22a0926e752 100644 --- a/crypto/apr_md4.c +++ b/crypto/apr_md4.c @@ -41,6 +41,7 @@ #include "apr_strings.h" #include "apr_md4.h" #include "apr_lib.h" +#include "apr_crypto.h" /* for apr_crypto_memzero, if available */ #if APR_HAVE_STRING_H #include @@ -359,7 +360,11 @@ static void MD4Transform(apr_uint32_t state[4], const unsigned char block[64]) state[3] += d; /* Zeroize sensitive information. */ +#if APU_HAVE_CRYPTO + apr_crypto_memzero(x, sizeof(x)); +#else memset(x, 0, sizeof(x)); +#endif } /* Encodes input (apr_uint32_t) into output (unsigned char). Assumes len is From d253e74f32a0a88f0a10f80ac99cb25a2d78a2f0 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 1 Jun 2018 13:53:50 +0000 Subject: [PATCH 7773/7878] rand: follow up to r1814240: still honor --with-devrandom if specified. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1832691 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 30 +++++++++++++++++------------- misc/unix/rand.c | 9 +++++---- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/configure.in b/configure.in index 71c4b6b48b7..4fc185c9450 100644 --- a/configure.in +++ b/configure.in @@ -2489,25 +2489,25 @@ AC_ARG_WITH(egd, if test "$rand" != "1"; then if test "$ac_cv_func_getrandom" = yes; then - AC_MSG_RESULT(getrandom) - rand="1" + rand="getrandom" elif test "$ac_cv_have_decl_SYS_getrandom" = yes; then - AC_MSG_RESULT(SYS_getrandom) - rand="1" - fi -fi - -if test "$rand" != "1"; then - if test "$ac_cv_func_arc4random_buf" = yes; then - AC_MSG_RESULT(arc4random) - rand="1" + rand="SYS_getrandom" + elif test "$ac_cv_func_arc4random_buf" = yes; then + rand="arc4random" fi fi if test "$rand" != "1"; then AC_ARG_WITH(devrandom, [ --with-devrandom[[=DEV]] use /dev/random or compatible [[searches by default]]], - [ apr_devrandom="$withval" ], [ apr_devrandom="yes" ]) + [ apr_devrandom="$withval" ], [ apr_devrandom="no" ]) + if test "$apr_devrandom" = "no"; then + if test -z "$rand"; then + apr_devrandom="yes" + else + apr_devrandom="no" + fi + fi if test "$apr_devrandom" = "yes"; then # /dev/random on OpenBSD doesn't provide random data, so @@ -2515,7 +2515,7 @@ if test "$rand" != "1"; then for f in /dev/arandom /dev/urandom /dev/random; do if test -r $f; then apr_devrandom=$f - rand=1 + rand="1" break fi done @@ -2541,6 +2541,10 @@ if test "$rand" != "1"; then if test "$rand" = "1"; then AC_DEFINE_UNQUOTED(DEV_RANDOM, ["$apr_devrandom"], [Define to path of random device]) AC_MSG_RESULT([$apr_devrandom]) + elif test -n "$rand"; then + AC_DEFINE_UNQUOTED(SYS_RANDOM, ["$rand"], [Define system call of random]) + AC_MSG_RESULT([$rand]) + rand="1" fi fi diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 5e235990196..c0567a667e3 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -43,6 +43,7 @@ #include #endif +#if defined(SYS_RANDOM) #if defined(HAVE_SYS_RANDOM_H) && \ defined(HAVE_GETRANDOM) @@ -60,12 +61,12 @@ #include #include #include - #define getrandom(buf, buflen, flags) \ syscall(SYS_getrandom, (buf), (buflen), (flags)) #define USE_GETRANDOM #endif /* HAVE_SYS_RANDOM_H */ +#endif /* SYS_RANDOM */ #ifndef SHUT_RDWR #define SHUT_RDWR 2 @@ -207,12 +208,12 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, return bad_errno; } -#elif defined(USE_GETRANDOM) +#elif defined(SYS_RANDOM) && defined(USE_GETRANDOM) do { int rc; - rc = getrandom(buf, length, GRND_NONBLOCK); + rc = getrandom(buf, length, 0); if (rc == -1) { if (errno == EINTR) { continue; @@ -224,7 +225,7 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, length -= rc; } while (length > 0); -#elif defined(HAVE_ARC4RANDOM_BUF) +#elif defined(SYS_RANDOM) && defined(HAVE_ARC4RANDOM_BUF) arc4random_buf(buf, length); From 2e8fbff4ecf82d0decf6baf774c209948f2f4998 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 6 Jun 2018 07:16:48 +0000 Subject: [PATCH 7774/7878] * test/teststr.c (overflow_strfsize): Iterate from LONG_MAX downwards, avoiding signed integer overflow (undefined behaviour which gcc 8.1 turns into a non-terminating loop). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1832985 13f79535-47bb-0310-9956-ffa450edef68 --- test/teststr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/teststr.c b/test/teststr.c index d9a5054758a..951a83001e9 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -307,7 +307,7 @@ static void overflow_strfsize(abts_case *tc, void *data) for (; off < 999999999; off += 999) { apr_strfsize(off, buf); } - for (off = 1; off < LONG_MAX && off > 0; off *= 2) { + for (off = LONG_MAX; off > 1; off /= 2) { apr_strfsize(off, buf); apr_strfsize(off + 1, buf); apr_strfsize(off - 1, buf); From 2921cf1c5feb636effa5f15009e3722b7549bbc9 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 11 Jun 2018 22:06:09 +0000 Subject: [PATCH 7775/7878] Cryptographic Pseudo Random Number Generator (CPRNG). New apr_crypto_prng API and apr_crypto[_thread]_random_bytes() functions. Allows to generate cryptographically secure random bytes indefinitely given an initial seed of APR_CRYPTO_PRNG_SEED_SIZE bytes (32), which is either provided by the caller or automatically gathered from the system. The CPRNG can also be re-seeded at any time, or after a process is fork()ed. The internal key is renewed every APR_CRYPTO_PRNG_SEED_SIZE random bytes produced and those data once returned to the caller are cleared from the internal state, which ensures forward secrecy. This CPRNG is fast, based on a stream cipher, and will never block besides the initial seed or any reseed if it depends on the system entropy. Finally, it can be used either globally (locked in multithread environment), per-thread (a lock free instance is automatically created for each thread on first use), or created as standalone instance (manageable independently). For now it's only implemented with the OpenSSL library as underlying crypto, that is --with-crypto --with-openssl needs to be configured, and the latter links libcrypto with APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833359 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + CMakeLists.txt | 1 + build.conf | 1 + build/crypto.m4 | 11 + crypto/apr_crypto.c | 12 +- crypto/apr_crypto_prng.c | 471 +++++++++++++++++++++++++++++++++++++++ include/apr.h.in | 1 + include/apr_crypto.h | 141 ++++++++++++ test/testcrypto.c | 241 ++++++++++++++++++++ threadproc/unix/proc.c | 4 + 10 files changed, 884 insertions(+), 2 deletions(-) create mode 100644 crypto/apr_crypto_prng.c diff --git a/CHANGES b/CHANGES index ae24bb443e6..1922c5b7ed0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) New apr_crypto_prng API and apr_crypto[_thread]_random_bytes() functions. + [Yann Ylavic] + *) apr_file_write: Optimize large reads from buffered files on Windows. [Evgeny Kotkov] diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a36de9c26e..f347531ee70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -239,6 +239,7 @@ SET(APR_SOURCES buckets/apr_buckets_simple.c buckets/apr_buckets_socket.c crypto/apr_crypto.c + crypto/apr_crypto_prng.c crypto/apr_md4.c crypto/apr_md5.c crypto/apr_passwd.c diff --git a/build.conf b/build.conf index d01fd1dc627..1dfc3b4ed1f 100644 --- a/build.conf +++ b/build.conf @@ -11,6 +11,7 @@ paths = tables/*.c buckets/*.c crypto/apr_crypto.c + crypto/apr_crypto_prng.c crypto/apr_md4.c crypto/apr_md5.c crypto/apr_passwd.c diff --git a/build/crypto.m4 b/build/crypto.m4 index e972494d719..7d69ed02776 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -23,6 +23,7 @@ dnl APU_CHECK_CRYPTO: look for crypto libraries and headers dnl AC_DEFUN([APU_CHECK_CRYPTO], [ apu_have_crypto=0 + apu_have_crypto_prng=0 apu_have_openssl=0 apu_have_nss=0 apu_have_commoncrypto=0 @@ -66,13 +67,18 @@ AC_DEFUN([APU_CHECK_CRYPTO], [ dnl add checks for other varieties of ssl here if test "$apu_have_crypto" = "0"; then AC_ERROR([Crypto was requested but no crypto library could be enabled; specify the location of a crypto library using --with-openssl, --with-nss, and/or --with-commoncrypto.]) + elif test "$apu_have_openssl" = "1"; then + dnl PRNG only implemented with openssl for now + apu_have_crypto_prng=1 fi fi ], [ apu_have_crypto=0 + apu_have_crypto_prng=0 ]) AC_SUBST(apu_have_crypto) + AC_SUBST(apu_have_crypto_prng) ]) dnl @@ -153,6 +159,11 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ LIBS="$old_libs" CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" + + if test "$apu_have_openssl" = "1"; then + APR_ADDTO(APRUTIL_EXPORT_LIBS, [-lcrypto]) + APR_ADDTO(LIBS, [-lcrypto]) + fi ]) AC_DEFUN([APU_CHECK_CRYPTO_NSS], [ diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 3b50ca531f2..821775f4720 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -86,7 +86,7 @@ static apr_status_t apr_crypto_term(void *ptr) APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) { - apr_status_t ret = APR_SUCCESS; + apr_status_t rv; apr_pool_t *parent; if (drivers != NULL) { @@ -107,7 +107,15 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) apr_pool_cleanup_register(pool, NULL, apr_crypto_term, apr_pool_cleanup_null); - return ret; + /* apr_crypto_prng_init() may already have been called with + * non-default parameters, so ignore APR_EREINIT. + */ + rv = apr_crypto_prng_init(pool, 0, NULL, 0); + if (rv != APR_SUCCESS && rv != APR_EREINIT) { + return rv; + } + + return APR_SUCCESS; } static apr_status_t crypto_clear(void *ptr) diff --git a/crypto/apr_crypto_prng.c b/crypto/apr_crypto_prng.c new file mode 100644 index 00000000000..cbbf3c4fea4 --- /dev/null +++ b/crypto/apr_crypto_prng.c @@ -0,0 +1,471 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Cryptographic Pseudo Random Number Generator (CPRNG), based on + * "Fast-key-erasure random-number generators" from D.J. Bernstein ([1]), + * and public domain implementation in libpqcrypto's randombytes() ([2]). + * [1] https://blog.cr.yp.to/20170723-random.html + * [2] https://libpqcrypto.org/ + */ + +#include "apu.h" + +#include "apr_crypto.h" + +#if APU_HAVE_CRYPTO +#if APU_HAVE_CRYPTO_PRNG + +#include "apr_pools.h" +#include "apr_strings.h" +#include "apr_thread_mutex.h" +#include "apr_thread_proc.h" + +#include /* for malloc() */ + +#define APR_CRYPTO_PRNG_KEY_SIZE 32 +#if APR_CRYPTO_PRNG_SEED_SIZE > APR_CRYPTO_PRNG_KEY_SIZE +#error apr_crypto_prng uses 256bit stream ciphers only +#endif + +#define APR_CRYPTO_PRNG_BUF_SIZE_MIN (APR_CRYPTO_PRNG_KEY_SIZE * (8 - 1)) +#define APR_CRYPTO_PRNG_BUF_SIZE_DEF (APR_CRYPTO_PRNG_KEY_SIZE * (24 - 1)) + +#if APU_HAVE_OPENSSL + +#include + +#include /* for NID_* */ +#if !defined(NID_chacha20) && !defined(NID_aes_256_ctr) +/* XXX: APU_HAVE_CRYPTO_PRNG && APU_HAVE_OPENSSL shoudn't be defined! */ +#error apr_crypto_prng needs OpenSSL implementation for Chacha20 or AES256-CTR +#endif + +typedef EVP_CIPHER_CTX cprng_stream_ctx_t; + +static apr_status_t cprng_stream_ctx_make(cprng_stream_ctx_t **pctx) +{ + EVP_CIPHER_CTX *ctx; + const EVP_CIPHER *cipher; + + ctx = EVP_CIPHER_CTX_new(); + if (!ctx) { + return APR_ENOMEM; + } + +#if defined(NID_chacha20) + cipher = EVP_chacha20(); +#else + cipher = EVP_aes_256_ctr(); +#endif + if (EVP_EncryptInit_ex(ctx, cipher, NULL, NULL, NULL) <= 0) { + EVP_CIPHER_CTX_free(ctx); + return APR_ENOMEM; + } + + *pctx = ctx; + return APR_SUCCESS; +} + +static APR_INLINE +void cprng_stream_ctx_free(cprng_stream_ctx_t *ctx) +{ + EVP_CIPHER_CTX_free(ctx); +} + +static APR_INLINE +apr_status_t cprng_stream_ctx_mix(cprng_stream_ctx_t **pctx, + unsigned char *key, unsigned char *to, + const unsigned char *z, apr_size_t n) +{ + cprng_stream_ctx_t *ctx = *pctx; + int len; + + EVP_EncryptInit_ex(ctx, NULL, NULL, key, NULL); + EVP_CIPHER_CTX_set_padding(ctx, 0); + + memset(key, 0, APR_CRYPTO_PRNG_KEY_SIZE); + EVP_EncryptUpdate(ctx, key, &len, key, APR_CRYPTO_PRNG_KEY_SIZE); + EVP_EncryptUpdate(ctx, to, &len, z, n); + + return APR_SUCCESS; +} + +#else /* APU_HAVE_OPENSSL */ + +/* XXX: APU_HAVE_CRYPTO_PRNG shoudn't be defined! */ +#error apr_crypto_prng implemented with OpenSSL only for now + +#endif /* APU_HAVE_OPENSSL */ + +struct apr_crypto_prng_t { + apr_pool_t *pool; + cprng_stream_ctx_t *ctx; +#if APR_HAS_THREADS + apr_thread_mutex_t *lock; +#endif + unsigned char *key, *buf; + apr_size_t len, pos; + int flags; +}; + +static apr_crypto_prng_t *cprng_global = NULL; + +#if APR_HAS_THREADS +static apr_threadkey_t *cprng_thread_key = NULL; + +static void cprng_thread_destroy(void *cprng) +{ + if (!cprng_global) { + apr_threadkey_private_delete(cprng_thread_key); + cprng_thread_key = NULL; + } + apr_crypto_prng_destroy(cprng); +} +#endif + +APR_DECLARE(apr_status_t) apr_crypto_prng_init(apr_pool_t *pool, + apr_size_t bufsize, + const unsigned char seed[], + int flags) +{ + if (cprng_global) { + return APR_EREINIT; + } + + if (flags & APR_CRYPTO_PRNG_PER_THREAD) { +#if !APR_HAS_THREADS + return APR_ENOTIMPL; +#else + apr_status_t rv; + rv = apr_threadkey_private_create(&cprng_thread_key, + cprng_thread_destroy, pool); + if (rv != APR_SUCCESS) { + return rv; + } +#endif + } + +#if APR_HAS_THREADS + /* Global CPRNG is locked */ + flags = (flags | APR_CRYPTO_PRNG_LOCKED) & ~APR_CRYPTO_PRNG_PER_THREAD; +#endif + return apr_crypto_prng_create(&cprng_global, bufsize, flags, seed, pool); +} + +APR_DECLARE(apr_status_t) apr_crypto_prng_term(void) +{ + if (!cprng_global) { + return APR_EINIT; + } + + apr_crypto_prng_destroy(cprng_global); + cprng_global = NULL; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(void) +{ + if (!cprng_global) { + return APR_EINIT; + } + + return apr_crypto_prng_reseed(cprng_global, NULL); +} + +APR_DECLARE(apr_status_t) apr_crypto_random_bytes(unsigned char *buf, + apr_size_t len) +{ + if (!cprng_global) { + return APR_EINIT; + } + + return apr_crypto_prng_bytes(cprng_global, buf, len); +} + +#if APR_HAS_THREADS +APR_DECLARE(apr_status_t) apr_crypto_thread_random_bytes(unsigned char *buf, + apr_size_t len) +{ + apr_status_t rv; + apr_crypto_prng_t *cprng; + void *private = NULL; + + if (!cprng_thread_key) { + return APR_EINIT; + } + + rv = apr_threadkey_private_get(&private, cprng_thread_key); + if (rv != APR_SUCCESS) { + return rv; + } + + cprng = private; + if (!cprng) { + rv = apr_crypto_prng_create(&cprng, 0, 0, NULL, NULL); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_threadkey_private_set(cprng, cprng_thread_key); + if (rv != APR_SUCCESS) { + apr_crypto_prng_destroy(cprng); + return rv; + } + } + + return apr_crypto_prng_bytes(cprng, buf, len); +} +#endif + +static apr_status_t cprng_cleanup(void *arg) +{ + apr_crypto_prng_t *cprng = arg; + + if (cprng == cprng_global) { + cprng_global = NULL; + } + + if (cprng->ctx) { + cprng_stream_ctx_free(cprng->ctx); + } + + if (cprng->key) { + apr_crypto_memzero(cprng->key, APR_CRYPTO_PRNG_KEY_SIZE + cprng->len); + } + + if (!cprng->pool) { + free(cprng->key); + free(cprng); + } + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_crypto_prng_create(apr_crypto_prng_t **pcprng, + apr_size_t bufsize, int flags, + const unsigned char seed[], + apr_pool_t *pool) +{ + apr_status_t rv; + apr_crypto_prng_t *cprng; + + *pcprng = NULL; + + if (bufsize > APR_INT32_MAX - APR_CRYPTO_PRNG_KEY_SIZE + || (flags & APR_CRYPTO_PRNG_LOCKED && !pool) + || (flags & ~APR_CRYPTO_PRNG_MASK)) { + return APR_EINVAL; + } + +#if !APR_HAS_THREADS + if (flags & (APR_CRYPTO_PRNG_LOCKED | APR_CRYPTO_PRNG_PER_THREAD)) { + return APR_ENOTIMPL; + } +#endif + + if (pool) { + cprng = apr_pcalloc(pool, sizeof(*cprng)); + } + else { + cprng = calloc(1, sizeof(*cprng)); + } + if (!cprng) { + return APR_ENOMEM; + } + cprng->flags = flags; + cprng->pool = pool; + + if (bufsize == 0) { + bufsize = APR_CRYPTO_PRNG_BUF_SIZE_DEF; + } + else if (bufsize < APR_CRYPTO_PRNG_BUF_SIZE_MIN) { + bufsize = APR_CRYPTO_PRNG_BUF_SIZE_MIN; + } + else if (bufsize % APR_CRYPTO_PRNG_KEY_SIZE) { + bufsize += APR_CRYPTO_PRNG_KEY_SIZE; + bufsize -= bufsize % APR_CRYPTO_PRNG_KEY_SIZE; + } + if (pool) { + cprng->key = apr_palloc(pool, APR_CRYPTO_PRNG_KEY_SIZE + bufsize); + } + else { + cprng->key = malloc(APR_CRYPTO_PRNG_KEY_SIZE + bufsize); + } + if (!cprng->key) { + cprng_cleanup(cprng); + return APR_ENOMEM; + } + cprng->buf = cprng->key + APR_CRYPTO_PRNG_KEY_SIZE; + cprng->len = bufsize; + + if (seed) { + memset(cprng->key, 0, APR_CRYPTO_PRNG_KEY_SIZE); + } + rv = apr_crypto_prng_reseed(cprng, seed); + if (rv != APR_SUCCESS) { + cprng_cleanup(cprng); + return rv; + } + +#if APR_HAS_THREADS + if (flags & APR_CRYPTO_PRNG_LOCKED) { + rv = apr_thread_mutex_create(&cprng->lock, APR_THREAD_MUTEX_DEFAULT, + pool); + if (rv != APR_SUCCESS) { + cprng_cleanup(cprng); + return rv; + } + } +#endif + + rv = cprng_stream_ctx_make(&cprng->ctx); + if (rv != APR_SUCCESS) { + cprng_cleanup(cprng); + return rv; + } + + if (pool) { + apr_pool_cleanup_register(pool, cprng, cprng_cleanup, + apr_pool_cleanup_null); + } + + *pcprng = cprng; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_crypto_prng_destroy(apr_crypto_prng_t *cprng) +{ + if (!cprng->pool) { + return cprng_cleanup(cprng); + } + + return apr_pool_cleanup_run(cprng->pool, cprng, cprng_cleanup); +} + +APR_DECLARE(apr_status_t) apr_crypto_prng_reseed(apr_crypto_prng_t *cprng, + const unsigned char seed[]) +{ + apr_status_t rv = APR_SUCCESS; + +#if APR_HAS_THREADS + if (cprng->lock) { + rv = apr_thread_mutex_lock(cprng->lock); + if (rv != APR_SUCCESS) { + return rv; + } + } +#endif + + if (seed) { + apr_size_t n = 0; + do { + cprng->key[n] ^= seed[n]; + } while (++n < APR_CRYPTO_PRNG_KEY_SIZE); + } + else { + rv = apr_generate_random_bytes(cprng->key, APR_CRYPTO_PRNG_KEY_SIZE); + } + apr_crypto_memzero(cprng->buf, cprng->len); + cprng->pos = cprng->len; + +#if APR_HAS_THREADS + if (cprng->lock) { + apr_status_t rt = apr_thread_mutex_unlock(cprng->lock); + if (rv == APR_SUCCESS && rt != APR_SUCCESS) { + rv = rt; + } + } +#endif + + return rv; +} + +static APR_INLINE +apr_status_t cprng_stream_mix(apr_crypto_prng_t *cprng, unsigned char *to) +{ + return cprng_stream_ctx_mix(&cprng->ctx, cprng->key, to, + cprng->buf, cprng->len); +} + +APR_DECLARE(apr_status_t) apr_crypto_prng_bytes(apr_crypto_prng_t *cprng, + unsigned char *buf, + apr_size_t len) +{ + apr_status_t rv; + apr_size_t n; + +#if APR_HAS_THREADS + if (cprng->lock) { + rv = apr_thread_mutex_lock(cprng->lock); + if (rv != APR_SUCCESS) { + return rv; + } + } +#endif + + while (len) { + if (cprng->pos == cprng->len) { + if (len >= cprng->len) { + do { + rv = cprng_stream_mix(cprng, buf); + if (rv != APR_SUCCESS) { + return rv; + } + buf += cprng->len; + len -= cprng->len; + } while (len >= cprng->len); + if (!len) { + break; + } + } + rv = cprng_stream_mix(cprng, cprng->buf); + if (rv != APR_SUCCESS) { + return rv; + } + cprng->pos = 0; + } + + /* Random bytes are consumed then zero-ed to ensure + * both forward secrecy and cleared next mixed data. + */ + n = cprng->len - cprng->pos; + if (n > len) { + n = len; + } + memcpy(buf, cprng->buf + cprng->pos, n); + apr_crypto_memzero(cprng->buf + cprng->pos, n); + cprng->pos += n; + + buf += n; + len -= n; + } + +#if APR_HAS_THREADS + if (cprng->lock) { + apr_status_t rt = apr_thread_mutex_unlock(cprng->lock); + if (rv == APR_SUCCESS && rt != APR_SUCCESS) { + rv = rt; + } + } +#endif + + return APR_SUCCESS; +} + +#endif /* APU_HAVE_CRYPTO_PRNG */ +#endif /* APU_HAVE_CRYPTO */ diff --git a/include/apr.h.in b/include/apr.h.in index ea936158a50..2cdb555e49b 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -683,6 +683,7 @@ typedef int apr_wait_t; #define APU_HAVE_ODBC @apu_have_odbc@ #define APU_HAVE_CRYPTO @apu_have_crypto@ +#define APU_HAVE_CRYPTO_PRNG @apu_have_crypto_prng@ #define APU_HAVE_OPENSSL @apu_have_openssl@ #define APU_HAVE_NSS @apu_have_nss@ #define APU_HAVE_COMMONCRYPTO @apu_have_commoncrypto@ diff --git a/include/apr_crypto.h b/include/apr_crypto.h index 68b196ad6e9..0ca8e524c12 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -495,6 +495,147 @@ APR_DECLARE(apr_status_t) apr_crypto_cleanup(apr_crypto_t *f); APR_DECLARE(apr_status_t) apr_crypto_shutdown(const apr_crypto_driver_t *driver); + +/** + * Cryptographic Pseudo Random Number Generator (CPRNG). + * + * Allows to generate cryptographically secure random bytes indefinitely + * given an initial seed of \ref APR_CRYPTO_PRNG_SEED_SIZE bytes (32), which + * is either provided by the caller or automatically gathered from the system. + * The CPRNG can also be re-seeded at any time, or after a process is fork()ed. + * + * The internal key is renewed every \ref APR_CRYPTO_PRNG_SEED_SIZE random + * bytes produced and those data once returned to the caller are cleared from + * the internal state, which ensures forward secrecy. + * + * This CPRNG is fast, based on a stream cipher, and will never block besides + * the initial seed or any reseed if it depends on the system entropy. + * + * Finally, it can be used either globally (locked in multithread environment), + * per-thread (a lock free instance is automatically created for each thread on + * first use), or created as standalone instance (manageable independently). + */ + +#define APR_CRYPTO_PRNG_SEED_SIZE 32 + +#define APR_CRYPTO_PRNG_LOCKED (0x1) +#define APR_CRYPTO_PRNG_PER_THREAD (0x2) +#define APR_CRYPTO_PRNG_MASK (0x3) + +/** Opaque CPRNG state */ +typedef struct apr_crypto_prng_t apr_crypto_prng_t; + +/** + * @brief Perform global initialisation. Call once only. + * + * @param pool Used to allocate memory and register cleanups + * @param bufsize The size of the buffer used to cache upcoming random bytes. + * @param seed A custom seed of \ref APR_CRYPTO_PRNG_SEED_SIZE bytes, + * or NULL for the seed to be gathered from system entropy. + * @param flags \ref APR_CRYPTO_PRNG_PER_THREAD to allow for per-thread CPRNG, + * or zero. + * @return APR_EREINIT if called more than once, + * any system error (APR_ENOMEM, ...). + */ +APR_DECLARE(apr_status_t) apr_crypto_prng_init(apr_pool_t *pool, + apr_size_t bufsize, + const unsigned char seed[], + int flags); +/** + * @brief Terminate global initialisation if needed, before automatic cleanups. + * + * @return APR_EINIT if \ref apr_crypto_prng_init() was not called. + */ +APR_DECLARE(apr_status_t) apr_crypto_prng_term(void); + +/** + * @brief Reseed global CPRNG after a process is fork()ed to avoid any + * duplicated state. + * + * @return Any system error (APR_ENOMEM, ...). + */ +APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(void); + +/** + * @brief Generate cryptographically secure random bytes from the global CPRNG. + * + * @param buf The destination buffer + * @param len The destination length + * @return APR_EINIT if \ref apr_crypto_prng_init() was not called. + * any system error (APR_ENOMEM, ...). + */ +APR_DECLARE(apr_status_t) apr_crypto_random_bytes(unsigned char *buf, + apr_size_t len); + +#if APR_HAS_THREADS +/** + * @brief Generate cryptographically secure random bytes from the CPRNG of + * the current thread. + * + * @param buf The destination buffer + * @param len The destination length + * @return APR_EINIT if \ref apr_crypto_prng_init() was not called or + * called without \ref APR_CRYPTO_PRNG_PER_THREAD, + * any system error (APR_ENOMEM, ...). + */ +APR_DECLARE(apr_status_t) apr_crypto_thread_random_bytes(unsigned char *buf, + apr_size_t len); +#endif + +/** + * @brief Create a standalone CPRNG. + * + * @param pcprng The CPRNG created. + * @param bufsize The size of the buffer used to cache upcoming random bytes. + * @param flags \ref APR_CRYPTO_PRNG_LOCKED to control concurrent accesses, + * or zero. + * @param seed A custom seed of \ref APR_CRYPTO_PRNG_SEED_SIZE bytes, + * or NULL for the seed to be gathered from system entropy. + * @param pool Used to allocate memory and register cleanups, or NULL + * if the memory should be managed outside (besides per-thread + * which has an automatic memory management with no pool, when + * NULL is given the caller is responsible for calling + * \ref apr_crypto_prng_destroy() or some memory would leak. + * @return APR_EINVAL if \ref bufsize is too large or flags are unknown, + * APR_ENOTIMPL if \ref APR_CRYPTO_PRNG_LOCKED with !APR_HAS_THREADS, + * any system error (APR_ENOMEM, ...). + */ +APR_DECLARE(apr_status_t) apr_crypto_prng_create(apr_crypto_prng_t **pcprng, + apr_size_t bufsize, int flags, + const unsigned char seed[], + apr_pool_t *pool); + +/** + * @brief Destroy a standalone CPRNG. + * + * @param cprng The CPRNG to destroy. + * @return APR_SUCCESS. + */ +APR_DECLARE(apr_status_t) apr_crypto_prng_destroy(apr_crypto_prng_t *cprng); + +/** + * @brief Reseed a standalone CPRNG. + * + * @param cprng The CPRNG to reseed. + * @param seed A custom seed of \ref APR_CRYPTO_PRNG_SEED_SIZE bytes, + * or NULL for the seed to be gathered from system entropy. + * @return Any system error (APR_ENOMEM, ...). + */ +APR_DECLARE(apr_status_t) apr_crypto_prng_reseed(apr_crypto_prng_t *cprng, + const unsigned char seed[]); + +/** + * @brief Generate cryptographically secure random bytes a standalone CPRNG. + * + * @param cprng The CPRNG. + * @param buf The destination buffer + * @param len The destination length + * @return Any system error (APR_ENOMEM, ...). + */ +APR_DECLARE(apr_status_t) apr_crypto_prng_bytes(apr_crypto_prng_t *cprng, + unsigned char *buf, + apr_size_t len); + #endif /* APU_HAVE_CRYPTO */ /** @} */ diff --git a/test/testcrypto.c b/test/testcrypto.c index 865cffc6d5e..3720974091a 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -22,6 +22,8 @@ #include "apr_dso.h" #include "apr_crypto.h" #include "apr_strings.h" +#include "apr_file_io.h" +#include "apr_thread_proc.h" #if APU_HAVE_CRYPTO @@ -554,9 +556,16 @@ static void test_crypto_init(abts_case *tc, void *data) { apr_pool_t *pool = NULL; apr_status_t rv; + int flags = 0; apr_pool_create(&pool, NULL); +#if APR_HAS_THREADS + flags = APR_CRYPTO_PRNG_PER_THREAD; +#endif + rv = apr_crypto_prng_init(apr_pool_parent_get(pool), 0, NULL, flags); + ABTS_ASSERT(tc, "failed to init apr_crypto_prng", rv == APR_SUCCESS); + rv = apr_crypto_init(pool); ABTS_ASSERT(tc, "failed to init apr_crypto", rv == APR_SUCCESS); @@ -1450,6 +1459,230 @@ static void test_crypto_equals(abts_case *tc, void *data) TEST_SCALAR_MATCH(6, p, 0); } +#if APU_HAVE_OPENSSL +#include /* for NID_* */ +#endif +#if defined(NID_chacha20) +/* + * KAT for CHACHA20 with key, IV and plaintext full of zeros: + * $ openssl enc -chacha20 -in /dev/zero \ + * -K `printf "%.64d" 0` -iv `printf "%.32d" 0` \ + * -e | xxd -l128 -i -c8 + */ +static const unsigned char test_PRNG_kat0[128] = { + 0x76, 0xb8, 0xe0, 0xad, 0xa0, 0xf1, 0x3d, 0x90, + 0x40, 0x5d, 0x6a, 0xe5, 0x53, 0x86, 0xbd, 0x28, + 0xbd, 0xd2, 0x19, 0xb8, 0xa0, 0x8d, 0xed, 0x1a, + 0xa8, 0x36, 0xef, 0xcc, 0x8b, 0x77, 0x0d, 0xc7, + 0xda, 0x41, 0x59, 0x7c, 0x51, 0x57, 0x48, 0x8d, + 0x77, 0x24, 0xe0, 0x3f, 0xb8, 0xd8, 0x4a, 0x37, + 0x6a, 0x43, 0xb8, 0xf4, 0x15, 0x18, 0xa1, 0x1c, + 0xc3, 0x87, 0xb6, 0x69, 0xb2, 0xee, 0x65, 0x86, + 0x9f, 0x07, 0xe7, 0xbe, 0x55, 0x51, 0x38, 0x7a, + 0x98, 0xba, 0x97, 0x7c, 0x73, 0x2d, 0x08, 0x0d, + 0xcb, 0x0f, 0x29, 0xa0, 0x48, 0xe3, 0x65, 0x69, + 0x12, 0xc6, 0x53, 0x3e, 0x32, 0xee, 0x7a, 0xed, + 0x29, 0xb7, 0x21, 0x76, 0x9c, 0xe6, 0x4e, 0x43, + 0xd5, 0x71, 0x33, 0xb0, 0x74, 0xd8, 0x39, 0xd5, + 0x31, 0xed, 0x1f, 0x28, 0x51, 0x0a, 0xfb, 0x45, + 0xac, 0xe1, 0x0a, 0x1f, 0x4b, 0x79, 0x4d, 0x6f +}; +#else +/* + * KAT for AES256-CTR with key, IV and plaintext full of zeros: + * $ openssl enc -aes-256-ctr -in /dev/zero \ + * -K `printf "%.64d" 0` -iv `printf "%.32d" 0` \ + * -e | xxd -l128 -i -c8 + */ +static const unsigned char test_PRNG_kat0[128] = { + 0xdc, 0x95, 0xc0, 0x78, 0xa2, 0x40, 0x89, 0x89, + 0xad, 0x48, 0xa2, 0x14, 0x92, 0x84, 0x20, 0x87, + 0x53, 0x0f, 0x8a, 0xfb, 0xc7, 0x45, 0x36, 0xb9, + 0xa9, 0x63, 0xb4, 0xf1, 0xc4, 0xcb, 0x73, 0x8b, + 0xce, 0xa7, 0x40, 0x3d, 0x4d, 0x60, 0x6b, 0x6e, + 0x07, 0x4e, 0xc5, 0xd3, 0xba, 0xf3, 0x9d, 0x18, + 0x72, 0x60, 0x03, 0xca, 0x37, 0xa6, 0x2a, 0x74, + 0xd1, 0xa2, 0xf5, 0x8e, 0x75, 0x06, 0x35, 0x8e, + 0xdd, 0x4a, 0xb1, 0x28, 0x4d, 0x4a, 0xe1, 0x7b, + 0x41, 0xe8, 0x59, 0x24, 0x47, 0x0c, 0x36, 0xf7, + 0x47, 0x41, 0xcb, 0xe1, 0x81, 0xbb, 0x7f, 0x30, + 0x61, 0x7c, 0x1d, 0xe3, 0xab, 0x0c, 0x3a, 0x1f, + 0xd0, 0xc4, 0x8f, 0x73, 0x21, 0xa8, 0x2d, 0x37, + 0x60, 0x95, 0xac, 0xe0, 0x41, 0x91, 0x67, 0xa0, + 0xbc, 0xaf, 0x49, 0xb0, 0xc0, 0xce, 0xa6, 0x2d, + 0xe6, 0xbc, 0x1c, 0x66, 0x54, 0x5e, 0x1d, 0xad +}; +#endif + +static void test_crypto_prng(abts_case *tc, void *data) +{ + unsigned char randbytes[128], seed[APR_CRYPTO_PRNG_SEED_SIZE]; + apr_crypto_prng_t *cprng; + apr_pool_t *pool = NULL; + apr_status_t rv; + int i; + + rv = apr_pool_create(&pool, NULL); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, pool); + + for (i = 0; i < 10; ++i) { + /* Initial seed full of zeros (deterministic) */ + memset(seed, 0, sizeof(seed)); + + rv = apr_crypto_prng_create(&cprng, 0, 0, seed, pool); + ABTS_ASSERT(tc, "apr_crypto_prng_create failed", rv == APR_SUCCESS); + + /* Second time and more, change one bit of the seed */ + if (i != 0) { + unsigned char pos = 0; + rv = apr_generate_random_bytes(&pos, sizeof pos); + ABTS_ASSERT(tc, "apr_generate_random_bytes failed", + rv == APR_SUCCESS); + + seed[pos % APR_CRYPTO_PRNG_SEED_SIZE] = 1; + rv = apr_crypto_prng_reseed(cprng, seed); + ABTS_ASSERT(tc, "apr_crypto_prng_reseed failed", + rv == APR_SUCCESS); + } + + rv = apr_crypto_prng_bytes(cprng, randbytes, 128 - 32); + ABTS_ASSERT(tc, "apr_crypto_prng_bytes failed", rv == APR_SUCCESS); + + /* Should match the first time only */ + if (i != 0) { + ABTS_ASSERT(tc, "test vector should not match", + /* first 32 bytes (256 bits) are used for the next key */ + memcmp(randbytes, test_PRNG_kat0 + 32, 128 - 32) != 0); + } + else { + ABTS_ASSERT(tc, "test vector should match", + /* first 32 bytes (256 bits) are used for the next key */ + memcmp(randbytes, test_PRNG_kat0 + 32, 128 - 32) == 0); + } + + rv = apr_crypto_prng_destroy(cprng); + ABTS_ASSERT(tc, "apr_crypto_prng_destroy failed", rv == APR_SUCCESS); + } + + apr_pool_destroy(pool); +} + +#if APR_HAS_FORK +static void test_crypto_fork_random(abts_case *tc, void *data) +{ + unsigned char randbytes[1024]; + apr_pool_t *pool = NULL; + apr_file_t *pread = NULL; + apr_file_t *pwrite = NULL; + apr_size_t nbytes; + apr_proc_t proc; + apr_status_t rv; + + rv = apr_pool_create(&pool, NULL); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, pool); + + rv = apr_file_pipe_create(&pread, &pwrite, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, pread); + ABTS_PTR_NOTNULL(tc, pwrite); + + rv = apr_proc_fork(&proc, pool); + if (rv == APR_INCHILD) { + apr_file_close(pread); + rv = apr_crypto_random_bytes(randbytes, 1024); + if (rv == APR_SUCCESS) { + apr_file_write_full(pwrite, randbytes, 1024, &nbytes); + } + apr_file_close(pwrite); + + exit(rv != APR_SUCCESS); + } + else if (rv == APR_INPARENT) { + int exitcode; + apr_exit_why_e why; + unsigned char childbytes[1024]; + + apr_file_close(pwrite); + rv = apr_file_read_full(pread, childbytes, 1024, &nbytes); + ABTS_INT_EQUAL(tc, (int)nbytes, 1024); + apr_file_close(pread); + + apr_proc_wait(&proc, &exitcode, &why, APR_WAIT); + if (why != APR_PROC_EXIT) { + ABTS_FAIL(tc, "child terminated abnormally"); + } + else if (exitcode != 0) { + ABTS_FAIL(tc, "apr_crypto_random_bytes failed in child"); + } + + rv = apr_crypto_random_bytes(randbytes, 1024); + ABTS_ASSERT(tc, "apr_crypto_random_bytes failed in parent", + rv == APR_SUCCESS); + ABTS_ASSERT(tc, "parent and child generated same random bytes", + memcmp(randbytes, childbytes, 1024) != 0); + } + else { + ABTS_FAIL(tc, "apr_proc_fork failed"); + } + + apr_pool_destroy(pool); +} +#endif + +#if APR_HAS_THREADS +#define NUM_THREADS 8 + +static void *APR_THREAD_FUNC thread_func(apr_thread_t *thd, void *data) +{ + unsigned char *randbytes = data; + apr_status_t rv; + + rv = apr_crypto_thread_random_bytes(randbytes, 800); + apr_thread_exit(thd, rv); + + return NULL; +} + +static void test_crypto_thread_random(abts_case *tc, void *data) +{ + static unsigned char zerobytes[800]; + unsigned char *randbytes[NUM_THREADS]; + apr_thread_t *threads[NUM_THREADS]; + apr_pool_t *pool = NULL; + apr_status_t rv, ret; + int i, j; + + rv = apr_pool_create(&pool, NULL); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, pool); + + for (i = 0; i < NUM_THREADS; ++i) { + randbytes[i] = apr_pcalloc(pool, 800); + rv = apr_thread_create(&threads[i], NULL, thread_func, + randbytes[i], pool); + ABTS_ASSERT(tc, "apr_thread_create failed", rv == APR_SUCCESS); + } + for (i = 0; i < NUM_THREADS; ++i) { + rv = apr_thread_join(&ret, threads[i]); + ABTS_ASSERT(tc, "apr_thread_join failed", rv == APR_SUCCESS); + ABTS_ASSERT(tc, "apr_crypto_thread_random_bytes failed", + ret == APR_SUCCESS); + } + for (i = 0; i < NUM_THREADS; ++i) { + ABTS_ASSERT(tc, "some thread generated zero bytes", + memcmp(randbytes[i], zerobytes, 800) != 0); + for (j = 0; j < i; ++j) { + ABTS_ASSERT(tc, "two threads generated same random bytes", + memcmp(randbytes[i], randbytes[j], 800) != 0); + } + } + + apr_pool_destroy(pool); +} +#endif + abts_suite *testcrypto(abts_suite *suite) { suite = ADD_SUITE(suite); @@ -1529,6 +1762,14 @@ abts_suite *testcrypto(abts_suite *suite) abts_run_test(suite, test_crypto_memzero, NULL); abts_run_test(suite, test_crypto_equals, NULL); + abts_run_test(suite, test_crypto_prng, NULL); +#if APR_HAS_FORK + abts_run_test(suite, test_crypto_fork_random, NULL); +#endif +#if APR_HAS_THREADS + abts_run_test(suite, test_crypto_thread_random, NULL); +#endif + return suite; } diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 004772ff88e..de9720045c5 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -19,6 +19,7 @@ #include "apr_portable.h" #include "apr_signal.h" #include "apr_random.h" +#include "apr_crypto.h" /* Heavy on no'ops, here's what we want to pass if there is APR_NO_FILE * requested for a specific child handle; @@ -229,6 +230,9 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) proc->pid = getpid(); apr_random_after_fork(proc); +#if APU_HAVE_CRYPTO_PRNG + apr_crypto_prng_after_fork(); +#endif return APR_INCHILD; } From f03200f0d38bf677cf8d43344ac51b93e2e4d801 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 11 Jun 2018 22:20:14 +0000 Subject: [PATCH 7776/7878] Add missing svn:eol-style = native flags. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833360 13f79535-47bb-0310-9956-ffa450edef68 --- README.FREETDS | 22 +-- build/xml.m4 | 422 ++++++++++++++++++++++++------------------------- 2 files changed, 222 insertions(+), 222 deletions(-) diff --git a/README.FREETDS b/README.FREETDS index 15eeeaf39a9..4066a9c78b3 100644 --- a/README.FREETDS +++ b/README.FREETDS @@ -1,11 +1,11 @@ -The APR DBD Driver for FreeTDS has been removed from the build. -It is known to have problems, and we are not able to maintain it. - -The source code is still available. If you want it and are able -to manage maintenance for yourself, you can patch the build and -work through issues that affect you, but you're on your own. - -We expect that for most users, the ODBC driver will serve as -an alternative. - -Sorry. +The APR DBD Driver for FreeTDS has been removed from the build. +It is known to have problems, and we are not able to maintain it. + +The source code is still available. If you want it and are able +to manage maintenance for yourself, you can patch the build and +work through issues that affect you, but you're on your own. + +We expect that for most users, the ODBC driver will serve as +an alternative. + +Sorry. diff --git a/build/xml.m4 b/build/xml.m4 index 3c31ea995a0..7c8ad2d768e 100644 --- a/build/xml.m4 +++ b/build/xml.m4 @@ -1,211 +1,211 @@ -dnl -------------------------------------------------------- -*- autoconf -*- -dnl Licensed to the Apache Software Foundation (ASF) under one or more -dnl contributor license agreements. See the NOTICE file distributed with -dnl this work for additional information regarding copyright ownership. -dnl The ASF licenses this file to You under the Apache License, Version 2.0 -dnl (the "License"); you may not use this file except in compliance with -dnl the License. You may obtain a copy of the License at -dnl -dnl http://www.apache.org/licenses/LICENSE-2.0 -dnl -dnl Unless required by applicable law or agreed to in writing, software -dnl distributed under the License is distributed on an "AS IS" BASIS, -dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -dnl See the License for the specific language governing permissions and -dnl limitations under the License. - - -dnl -dnl APU_TRY_EXPAT_LINK( -dnl test-message, cache-var-name, hdrs, libs, -dnl [actions-on-success], [actions-on-failure]) -dnl -dnl Tests linking against expat with libraries 'libs' and includes -dnl 'hdrs', passing message + cache-var-name to AC_CACHE_CHECK. -dnl On success, sets $expat_libs to libs, sets $apu_has_expat to 1, -dnl and runs actions-on-success; on failure runs actions-on-failure. -dnl -AC_DEFUN([APU_TRY_EXPAT_LINK], [ -AC_CACHE_CHECK([$1], [$2], [ - apu_expat_LIBS=$LIBS - apu_expat_CPPFLAGS=$CPPFLAGS - LIBS="$LIBS $4" - CPPFLAGS="$CPPFLAGS $INCLUDES" - AC_TRY_LINK([#include -#include <$3>], [XML_ParserCreate(NULL);], - [$2=yes], [$2=no]) - LIBS=$apu_expat_LIBS - CPPFLAGS=$apu_expat_CPPFLAGS -]) - -if test $[$2] = yes; then - AC_DEFINE([HAVE_]translit([$3], [a-z./], [A-Z__]), 1, - [Define if $3 is available]) - apu_expat_libs="$4" - apu_has_expat=1 - $5 - AC_SUBST(apu_has_expat) -else - apu_has_expat=0 - $6 -fi -]) - -dnl -dnl APU_SYSTEM_EXPAT: tests for a system expat installation -dnl If present, sets $apu_has_expat to 1 and adjusts LDFLAGS/CPPFLAGS -dnl appropriately. This is mostly for compatibility with existing -dnl expat releases; all but the first APU_TRY_EXPAT_LINK call could -dnl be dropped later. -dnl -AC_DEFUN([APU_SYSTEM_EXPAT], [ - - APU_TRY_EXPAT_LINK([Expat 1.95.x], apu_cv_expat_system, - [expat.h], [-lexpat]) - - if test $apu_has_expat = 0; then - APU_TRY_EXPAT_LINK([old Debian-packaged expat], apu_cv_expat_debian, - [xmltok/xmlparse.h], [-lxmlparse -lxmltok]) - fi - - if test $apu_has_expat = 0; then - APU_TRY_EXPAT_LINK([old FreeBSD-packaged expat], apu_cv_expat_freebsd, - [xml/xmlparse.h], [-lexpat]) - fi - - if test $apu_has_expat = 0; then - APU_TRY_EXPAT_LINK([Expat 1.0/1.1], apu_cv_expat_1011, - [xmlparse/xmlparse.h], [-lexpat]) - fi - - if test $apu_has_expat = 0; then - APR_ADDTO(LDFLAGS, [-L/usr/local/lib]) - APR_ADDTO(INCLUDES, [-I/usr/local/include]) - - APU_TRY_EXPAT_LINK([Expat 1.95.x in /usr/local], - apu_cv_expat_usrlocal, [expat.h], [-lexpat], [], [ - APR_REMOVEFROM(LDFLAGS, [-L/usr/local/lib]) - APR_REMOVEFROM(INCLUDES, [-I/usr/local/include]) - ]) - fi -]) - - -dnl -dnl APU_FIND_EXPAT: figure out where EXPAT is located (or use bundled) -dnl -AC_DEFUN([APU_FIND_EXPAT], [ - -save_cppflags="$CPPFLAGS" - -apu_has_expat=0 - -AC_ARG_WITH([expat], -[ --with-expat=DIR specify Expat location], [ - if test "$withval" = "yes"; then - AC_MSG_ERROR([a directory must be specified for --with-expat]) - elif test "$withval" = "no"; then - if test "$apu_has_libxml2" != "1"; then - AC_MSG_ERROR([An XML parser is required! If you disable expat, you must select --with-libxml2]) - fi - else - # Add given path to standard search paths if appropriate: - if test "$apu_has_libxml2" = "1"; then - AC_MSG_ERROR(Cannot build with both expat and libxml2 - please select one) - fi - if test "$withval" != "/usr"; then - APR_ADDTO(INCLUDES, [-I$withval/include]) - APR_ADDTO(LDFLAGS, [-L$withval/lib]) - fi - fi -]) - -if test "$apu_has_libxml2" != "1"; then - APU_SYSTEM_EXPAT - - APR_ADDTO(APRUTIL_EXPORT_LIBS, [$apu_expat_libs]) - APR_ADDTO(LIBS, [$apu_expat_libs]) - - APR_XML_DIR=$bundled_subdir - AC_SUBST(APR_XML_DIR) -fi - -CPPFLAGS=$save_cppflags -]) - - -dnl -dnl APU_FIND_LIBXML2: figure out where LIBXML2 is located (or use bundled) -dnl -AC_DEFUN([APU_FIND_LIBXML2], [ - -save_cppflags="$CPPFLAGS" - -apu_has_libxml2=0 -apu_try_libxml2=0 - -AC_ARG_WITH([libxml2], -[ --with-libxml2=DIR specify libxml2 location], [ - if test "$withval" = "yes"; then - apu_try_libxml2=1 - APR_ADDTO(INCLUDES, [-I/usr/include/libxml2]) - elif test "$withval" != "no"; then - apu_try_libxml2=1 - APR_ADDTO(INCLUDES, [-I$withval/include/libxml2]) - if test "$withval" != "/usr"; then - APR_ADDTO(LDFLAGS, [-L$withval/lib]) - fi - fi - if test ${apu_try_libxml2} = "1" ; then - - #test for libxml2 - AC_CACHE_CHECK([libxml2], [apu_cv_libxml2], [ - apu_libxml2_CPPFLAGS=$CPPFLAGS - apu_libxml2_LIBS="$LIBS -lxml2" - CPPFLAGS="$CPPFLAGS $INCLUDES" - LIBS="$LIBS -lxml2" - AC_TRY_LINK( - [#include ], - [xmlSAXHandler sax; xmlCreatePushParserCtxt(&sax, NULL, NULL, 0, NULL);], - [apu_cv_libxml2=yes], - [apu_cv_libxml2=no], - ) - CPPFLAGS=$apu_libxml2_CPPFLAGS - LIBS=$apu_libxml2_LIBS - ]) - if test $apu_cv_libxml2 = yes ; then - AC_DEFINE([HAVE_LIBXML2_H], 1, [libxml2 found]) - apu_has_libxml2=1 - else - apu_has_libxml2=0 - fi - fi -]) -AC_SUBST(apu_has_libxml2) - -if test ${apu_has_libxml2} = "1" ; then - APR_ADDTO(APRUTIL_EXPORT_LIBS, [-lxml2]) - APR_ADDTO(LIBS, [-lxml2]) -fi - -CPPFLAGS=$save_cppflags -]) - -dnl -dnl APU_FIND_XML: Find an XML library -dnl -dnl Logic: we need exactly one but not both XML libraries -dnl Make expat the default for back-compatibility. -dnl Use libxml2 if a --with-libxml2 is specified (and works), -dnl otherwise expat. -dnl -AC_DEFUN([APU_FIND_XML], [ -APU_FIND_LIBXML2 -APU_FIND_EXPAT - -if test ${apu_has_expat} = "1" && test ${apu_has_libxml2} = "1" ; then - AC_MSG_ERROR(Cannot build with both expat and libxml2 - please select one) -elif test ${apu_has_expat} != "1" && test ${apu_has_libxml2} != "1" ; then - AC_MSG_ERROR(No XML parser found! Please specify --with-expat or --with-libxml2) -fi -]) +dnl -------------------------------------------------------- -*- autoconf -*- +dnl Licensed to the Apache Software Foundation (ASF) under one or more +dnl contributor license agreements. See the NOTICE file distributed with +dnl this work for additional information regarding copyright ownership. +dnl The ASF licenses this file to You under the Apache License, Version 2.0 +dnl (the "License"); you may not use this file except in compliance with +dnl the License. You may obtain a copy of the License at +dnl +dnl http://www.apache.org/licenses/LICENSE-2.0 +dnl +dnl Unless required by applicable law or agreed to in writing, software +dnl distributed under the License is distributed on an "AS IS" BASIS, +dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +dnl See the License for the specific language governing permissions and +dnl limitations under the License. + + +dnl +dnl APU_TRY_EXPAT_LINK( +dnl test-message, cache-var-name, hdrs, libs, +dnl [actions-on-success], [actions-on-failure]) +dnl +dnl Tests linking against expat with libraries 'libs' and includes +dnl 'hdrs', passing message + cache-var-name to AC_CACHE_CHECK. +dnl On success, sets $expat_libs to libs, sets $apu_has_expat to 1, +dnl and runs actions-on-success; on failure runs actions-on-failure. +dnl +AC_DEFUN([APU_TRY_EXPAT_LINK], [ +AC_CACHE_CHECK([$1], [$2], [ + apu_expat_LIBS=$LIBS + apu_expat_CPPFLAGS=$CPPFLAGS + LIBS="$LIBS $4" + CPPFLAGS="$CPPFLAGS $INCLUDES" + AC_TRY_LINK([#include +#include <$3>], [XML_ParserCreate(NULL);], + [$2=yes], [$2=no]) + LIBS=$apu_expat_LIBS + CPPFLAGS=$apu_expat_CPPFLAGS +]) + +if test $[$2] = yes; then + AC_DEFINE([HAVE_]translit([$3], [a-z./], [A-Z__]), 1, + [Define if $3 is available]) + apu_expat_libs="$4" + apu_has_expat=1 + $5 + AC_SUBST(apu_has_expat) +else + apu_has_expat=0 + $6 +fi +]) + +dnl +dnl APU_SYSTEM_EXPAT: tests for a system expat installation +dnl If present, sets $apu_has_expat to 1 and adjusts LDFLAGS/CPPFLAGS +dnl appropriately. This is mostly for compatibility with existing +dnl expat releases; all but the first APU_TRY_EXPAT_LINK call could +dnl be dropped later. +dnl +AC_DEFUN([APU_SYSTEM_EXPAT], [ + + APU_TRY_EXPAT_LINK([Expat 1.95.x], apu_cv_expat_system, + [expat.h], [-lexpat]) + + if test $apu_has_expat = 0; then + APU_TRY_EXPAT_LINK([old Debian-packaged expat], apu_cv_expat_debian, + [xmltok/xmlparse.h], [-lxmlparse -lxmltok]) + fi + + if test $apu_has_expat = 0; then + APU_TRY_EXPAT_LINK([old FreeBSD-packaged expat], apu_cv_expat_freebsd, + [xml/xmlparse.h], [-lexpat]) + fi + + if test $apu_has_expat = 0; then + APU_TRY_EXPAT_LINK([Expat 1.0/1.1], apu_cv_expat_1011, + [xmlparse/xmlparse.h], [-lexpat]) + fi + + if test $apu_has_expat = 0; then + APR_ADDTO(LDFLAGS, [-L/usr/local/lib]) + APR_ADDTO(INCLUDES, [-I/usr/local/include]) + + APU_TRY_EXPAT_LINK([Expat 1.95.x in /usr/local], + apu_cv_expat_usrlocal, [expat.h], [-lexpat], [], [ + APR_REMOVEFROM(LDFLAGS, [-L/usr/local/lib]) + APR_REMOVEFROM(INCLUDES, [-I/usr/local/include]) + ]) + fi +]) + + +dnl +dnl APU_FIND_EXPAT: figure out where EXPAT is located (or use bundled) +dnl +AC_DEFUN([APU_FIND_EXPAT], [ + +save_cppflags="$CPPFLAGS" + +apu_has_expat=0 + +AC_ARG_WITH([expat], +[ --with-expat=DIR specify Expat location], [ + if test "$withval" = "yes"; then + AC_MSG_ERROR([a directory must be specified for --with-expat]) + elif test "$withval" = "no"; then + if test "$apu_has_libxml2" != "1"; then + AC_MSG_ERROR([An XML parser is required! If you disable expat, you must select --with-libxml2]) + fi + else + # Add given path to standard search paths if appropriate: + if test "$apu_has_libxml2" = "1"; then + AC_MSG_ERROR(Cannot build with both expat and libxml2 - please select one) + fi + if test "$withval" != "/usr"; then + APR_ADDTO(INCLUDES, [-I$withval/include]) + APR_ADDTO(LDFLAGS, [-L$withval/lib]) + fi + fi +]) + +if test "$apu_has_libxml2" != "1"; then + APU_SYSTEM_EXPAT + + APR_ADDTO(APRUTIL_EXPORT_LIBS, [$apu_expat_libs]) + APR_ADDTO(LIBS, [$apu_expat_libs]) + + APR_XML_DIR=$bundled_subdir + AC_SUBST(APR_XML_DIR) +fi + +CPPFLAGS=$save_cppflags +]) + + +dnl +dnl APU_FIND_LIBXML2: figure out where LIBXML2 is located (or use bundled) +dnl +AC_DEFUN([APU_FIND_LIBXML2], [ + +save_cppflags="$CPPFLAGS" + +apu_has_libxml2=0 +apu_try_libxml2=0 + +AC_ARG_WITH([libxml2], +[ --with-libxml2=DIR specify libxml2 location], [ + if test "$withval" = "yes"; then + apu_try_libxml2=1 + APR_ADDTO(INCLUDES, [-I/usr/include/libxml2]) + elif test "$withval" != "no"; then + apu_try_libxml2=1 + APR_ADDTO(INCLUDES, [-I$withval/include/libxml2]) + if test "$withval" != "/usr"; then + APR_ADDTO(LDFLAGS, [-L$withval/lib]) + fi + fi + if test ${apu_try_libxml2} = "1" ; then + + #test for libxml2 + AC_CACHE_CHECK([libxml2], [apu_cv_libxml2], [ + apu_libxml2_CPPFLAGS=$CPPFLAGS + apu_libxml2_LIBS="$LIBS -lxml2" + CPPFLAGS="$CPPFLAGS $INCLUDES" + LIBS="$LIBS -lxml2" + AC_TRY_LINK( + [#include ], + [xmlSAXHandler sax; xmlCreatePushParserCtxt(&sax, NULL, NULL, 0, NULL);], + [apu_cv_libxml2=yes], + [apu_cv_libxml2=no], + ) + CPPFLAGS=$apu_libxml2_CPPFLAGS + LIBS=$apu_libxml2_LIBS + ]) + if test $apu_cv_libxml2 = yes ; then + AC_DEFINE([HAVE_LIBXML2_H], 1, [libxml2 found]) + apu_has_libxml2=1 + else + apu_has_libxml2=0 + fi + fi +]) +AC_SUBST(apu_has_libxml2) + +if test ${apu_has_libxml2} = "1" ; then + APR_ADDTO(APRUTIL_EXPORT_LIBS, [-lxml2]) + APR_ADDTO(LIBS, [-lxml2]) +fi + +CPPFLAGS=$save_cppflags +]) + +dnl +dnl APU_FIND_XML: Find an XML library +dnl +dnl Logic: we need exactly one but not both XML libraries +dnl Make expat the default for back-compatibility. +dnl Use libxml2 if a --with-libxml2 is specified (and works), +dnl otherwise expat. +dnl +AC_DEFUN([APU_FIND_XML], [ +APU_FIND_LIBXML2 +APU_FIND_EXPAT + +if test ${apu_has_expat} = "1" && test ${apu_has_libxml2} = "1" ; then + AC_MSG_ERROR(Cannot build with both expat and libxml2 - please select one) +elif test ${apu_has_expat} != "1" && test ${apu_has_libxml2} != "1" ; then + AC_MSG_ERROR(No XML parser found! Please specify --with-expat or --with-libxml2) +fi +]) From f1eace80be8fd28026ae6bb11aafb075065104f2 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 11 Jun 2018 22:26:23 +0000 Subject: [PATCH 7777/7878] Correct spelling. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833361 13f79535-47bb-0310-9956-ffa450edef68 --- encoding/apr_base64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encoding/apr_base64.c b/encoding/apr_base64.c index b07aede010b..e4fb90b5942 100644 --- a/encoding/apr_base64.c +++ b/encoding/apr_base64.c @@ -170,7 +170,7 @@ APR_DECLARE(int) apr_base64_decode_binary(unsigned char *bufplain, nprbytes -= 4; } - /* Note: (nprbytes == 1) would be an error, so just ingore that case */ + /* Note: (nprbytes == 1) would be an error, so just ignore that case */ if (nprbytes > 1) { *(bufout++) = (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4); From 58e8d719377f9950a18eb04036cd1ec1843646a0 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 11 Jun 2018 23:10:04 +0000 Subject: [PATCH 7778/7878] Follow up to r1833359: apr_crypto_prng API depends on APU_HAVE_CRYPTO_PRNG. Also switches apr_crypto_{prng,[thread_]random}_bytes() destination buffer type to void *. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833366 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_prng.c | 17 ++++++++--------- include/apr_crypto.h | 11 ++++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crypto/apr_crypto_prng.c b/crypto/apr_crypto_prng.c index cbbf3c4fea4..12f581a26d8 100644 --- a/crypto/apr_crypto_prng.c +++ b/crypto/apr_crypto_prng.c @@ -187,8 +187,7 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(void) return apr_crypto_prng_reseed(cprng_global, NULL); } -APR_DECLARE(apr_status_t) apr_crypto_random_bytes(unsigned char *buf, - apr_size_t len) +APR_DECLARE(apr_status_t) apr_crypto_random_bytes(void *buf, apr_size_t len) { if (!cprng_global) { return APR_EINIT; @@ -198,7 +197,7 @@ APR_DECLARE(apr_status_t) apr_crypto_random_bytes(unsigned char *buf, } #if APR_HAS_THREADS -APR_DECLARE(apr_status_t) apr_crypto_thread_random_bytes(unsigned char *buf, +APR_DECLARE(apr_status_t) apr_crypto_thread_random_bytes(void *buf, apr_size_t len) { apr_status_t rv; @@ -403,9 +402,9 @@ apr_status_t cprng_stream_mix(apr_crypto_prng_t *cprng, unsigned char *to) } APR_DECLARE(apr_status_t) apr_crypto_prng_bytes(apr_crypto_prng_t *cprng, - unsigned char *buf, - apr_size_t len) + void *buf, apr_size_t len) { + unsigned char *ptr = buf; apr_status_t rv; apr_size_t n; @@ -422,11 +421,11 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_bytes(apr_crypto_prng_t *cprng, if (cprng->pos == cprng->len) { if (len >= cprng->len) { do { - rv = cprng_stream_mix(cprng, buf); + rv = cprng_stream_mix(cprng, ptr); if (rv != APR_SUCCESS) { return rv; } - buf += cprng->len; + ptr += cprng->len; len -= cprng->len; } while (len >= cprng->len); if (!len) { @@ -447,11 +446,11 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_bytes(apr_crypto_prng_t *cprng, if (n > len) { n = len; } - memcpy(buf, cprng->buf + cprng->pos, n); + memcpy(ptr, cprng->buf + cprng->pos, n); apr_crypto_memzero(cprng->buf + cprng->pos, n); cprng->pos += n; - buf += n; + ptr += n; len -= n; } diff --git a/include/apr_crypto.h b/include/apr_crypto.h index 0ca8e524c12..55ae4494ef4 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -496,6 +496,8 @@ APR_DECLARE(apr_status_t) apr_crypto_shutdown(const apr_crypto_driver_t *driver); +#if APU_HAVE_CRYPTO_PRNG + /** * Cryptographic Pseudo Random Number Generator (CPRNG). * @@ -564,8 +566,7 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(void); * @return APR_EINIT if \ref apr_crypto_prng_init() was not called. * any system error (APR_ENOMEM, ...). */ -APR_DECLARE(apr_status_t) apr_crypto_random_bytes(unsigned char *buf, - apr_size_t len); +APR_DECLARE(apr_status_t) apr_crypto_random_bytes(void *buf, apr_size_t len); #if APR_HAS_THREADS /** @@ -578,7 +579,7 @@ APR_DECLARE(apr_status_t) apr_crypto_random_bytes(unsigned char *buf, * called without \ref APR_CRYPTO_PRNG_PER_THREAD, * any system error (APR_ENOMEM, ...). */ -APR_DECLARE(apr_status_t) apr_crypto_thread_random_bytes(unsigned char *buf, +APR_DECLARE(apr_status_t) apr_crypto_thread_random_bytes(void *buf, apr_size_t len); #endif @@ -633,8 +634,8 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_reseed(apr_crypto_prng_t *cprng, * @return Any system error (APR_ENOMEM, ...). */ APR_DECLARE(apr_status_t) apr_crypto_prng_bytes(apr_crypto_prng_t *cprng, - unsigned char *buf, - apr_size_t len); + void *buf, apr_size_t len); +#endif /* APU_HAVE_CRYPTO_PRNG */ #endif /* APU_HAVE_CRYPTO */ From f5cb9f6b827e8520b32baac28b2501298cefbd25 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 12 Jun 2018 07:51:40 +0000 Subject: [PATCH 7779/7878] Follow up to r1833359: apr_crypto_prng_after_fork() can now use a PID. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833382 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_prng.c | 27 +++++++++++++++++++++++++-- include/apr_crypto.h | 4 +++- threadproc/unix/proc.c | 2 +- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/crypto/apr_crypto_prng.c b/crypto/apr_crypto_prng.c index 12f581a26d8..b136212c3d7 100644 --- a/crypto/apr_crypto_prng.c +++ b/crypto/apr_crypto_prng.c @@ -47,6 +47,7 @@ #if APU_HAVE_OPENSSL #include +#include #include /* for NID_* */ #if !defined(NID_chacha20) && !defined(NID_aes_256_ctr) @@ -104,6 +105,17 @@ apr_status_t cprng_stream_ctx_mix(cprng_stream_ctx_t **pctx, return APR_SUCCESS; } +static apr_status_t cprng_hash_to_seed(pid_t pid, unsigned char seed[]) +{ + SHA256_CTX ctx; + + SHA256_Init(&ctx); + SHA256_Update(&ctx, &pid, sizeof(pid)); + SHA256_Final(seed, &ctx); + + return APR_SUCCESS; +} + #else /* APU_HAVE_OPENSSL */ /* XXX: APU_HAVE_CRYPTO_PRNG shoudn't be defined! */ @@ -178,13 +190,24 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_term(void) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(void) +APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(apr_proc_t *proc) { + unsigned char seedb[APR_CRYPTO_PRNG_SEED_SIZE], *seed = NULL; + if (!cprng_global) { return APR_EINIT; } - return apr_crypto_prng_reseed(cprng_global, NULL); + if (proc) { + apr_status_t rv; + rv = cprng_hash_to_seed(proc->pid, seedb); + if (rv != APR_SUCCESS) { + return rv; + } + seed = seedb; + } + + return apr_crypto_prng_reseed(cprng_global, seed); } APR_DECLARE(apr_status_t) apr_crypto_random_bytes(void *buf, apr_size_t len) diff --git a/include/apr_crypto.h b/include/apr_crypto.h index 55ae4494ef4..f569cf0da4f 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -22,6 +22,7 @@ #include "apr_tables.h" #include "apr_hash.h" #include "apu_errno.h" +#include "apr_thread_proc.h" #ifdef __cplusplus extern "C" { @@ -554,9 +555,10 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_term(void); * @brief Reseed global CPRNG after a process is fork()ed to avoid any * duplicated state. * + * @param proc The child process (including its PID). * @return Any system error (APR_ENOMEM, ...). */ -APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(void); +APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(apr_proc_t *proc); /** * @brief Generate cryptographically secure random bytes from the global CPRNG. diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index de9720045c5..f7d02d20470 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -231,7 +231,7 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) apr_random_after_fork(proc); #if APU_HAVE_CRYPTO_PRNG - apr_crypto_prng_after_fork(); + apr_crypto_prng_after_fork(proc); #endif return APR_INCHILD; From 4a7dc7c7db641975b4a88cf8c513ce80ee2263d5 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 12 Jun 2018 20:11:09 +0000 Subject: [PATCH 7780/7878] apr_crypto: follow up to r1833359. Link underlying crypto libraries (openssl, nss, and commoncrypto) with libapr when the corresponding --with is configured, and allow to initialize, terminate or check whether initialized with respectively them with apr_crypto_lib_init(), apr_crypto_lib_term() or apr_crypto_lib_is_initialized(). This allows for users to control the (un)initialization of those libraries, notably when they are also used independently in the user code and that doing this multiple times can cause leaks or unexpected behaviour. The initialization code is moved from "apr_crypto_{openssl,nss,commoncrypto}.c" where previously loaded dynamically (DSO) to "apr_crypto_internal.c" which is linked with libapr. Now apr_crypto_prng_init() can make sure the underlying crypto lib is ready. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833421 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 1 + build.conf | 1 + build/crypto.m4 | 10 ++ crypto/apr_crypto.c | 156 ++++++++++++++++- crypto/apr_crypto_commoncrypto.c | 15 +- crypto/apr_crypto_internal.c | 238 ++++++++++++++++++++++++++ crypto/apr_crypto_nss.c | 118 +------------ crypto/apr_crypto_openssl.c | 28 +-- crypto/apr_crypto_prng.c | 13 +- include/apr_crypto.h | 9 + include/private/apr_crypto_internal.h | 35 ++++ test/testcrypto.c | 7 - 12 files changed, 469 insertions(+), 162 deletions(-) create mode 100644 crypto/apr_crypto_internal.c diff --git a/CMakeLists.txt b/CMakeLists.txt index f347531ee70..a1052edd885 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -240,6 +240,7 @@ SET(APR_SOURCES buckets/apr_buckets_socket.c crypto/apr_crypto.c crypto/apr_crypto_prng.c + crypto/apr_crypto_internal.c crypto/apr_md4.c crypto/apr_md5.c crypto/apr_passwd.c diff --git a/build.conf b/build.conf index 1dfc3b4ed1f..af1e99894bf 100644 --- a/build.conf +++ b/build.conf @@ -12,6 +12,7 @@ paths = buckets/*.c crypto/apr_crypto.c crypto/apr_crypto_prng.c + crypto/apr_crypto_internal.c crypto/apr_md4.c crypto/apr_md5.c crypto/apr_passwd.c diff --git a/build/crypto.m4 b/build/crypto.m4 index 7d69ed02776..c9294851035 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -240,6 +240,11 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [ LIBS="$old_libs" CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" + + if test "$apu_have_nss" = "1"; then + APR_ADDTO(APRUTIL_EXPORT_LIBS, [-lnspr4 -lnss3]) + APR_ADDTO(LIBS, [-lnspr4 -lnss3]) + fi ]) AC_DEFUN([APU_CHECK_CRYPTO_COMMONCRYPTO], [ @@ -296,6 +301,11 @@ AC_DEFUN([APU_CHECK_CRYPTO_COMMONCRYPTO], [ LIBS="$old_libs" CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" + + if test "$apu_have_commoncrypto" = "1"; then + APR_ADDTO(APRUTIL_EXPORT_LIBS, [-lcrypto]) + APR_ADDTO(LIBS, [-lcrypto]) + fi ]) dnl diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 821775f4720..221792d2603 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -33,6 +33,7 @@ #include "apr_crypto.h" #include "apr_version.h" +static apr_hash_t *crypto_libs = NULL; static apr_hash_t *drivers = NULL; #define ERROR_SIZE 1024 @@ -88,6 +89,7 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) { apr_status_t rv; apr_pool_t *parent; + int flags = 0; if (drivers != NULL) { return APR_SUCCESS; @@ -110,7 +112,10 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) /* apr_crypto_prng_init() may already have been called with * non-default parameters, so ignore APR_EREINIT. */ - rv = apr_crypto_prng_init(pool, 0, NULL, 0); +#if APR_HAS_THREADS + flags = APR_CRYPTO_PRNG_PER_THREAD; +#endif + rv = apr_crypto_prng_init(pool, 0, NULL, flags); if (rv != APR_SUCCESS && rv != APR_EREINIT) { return rv; } @@ -241,11 +246,15 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( rv = APR_SUCCESS; if (d->init) { rv = d->init(pool, params, result); + if (rv == APR_EREINIT) { + rv = APR_SUCCESS; + } } - if (APR_SUCCESS == rv) { + if (rv == APR_SUCCESS) { *driver = symbol; name = apr_pstrdup(pool, name); apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver); + rv = APR_SUCCESS; } } apu_dso_mutex_unlock(); @@ -296,6 +305,149 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( return rv; } +static apr_status_t crypto_libs_cleanup(void *arg) +{ + apr_hash_index_t *hi; + + for (hi = apr_hash_first(NULL, crypto_libs); hi; hi = apr_hash_next(hi)) { + const char *name = apr_hash_this_key(hi); + if (name) { + apr_crypto_lib_term(name); + } + } + crypto_libs = NULL; + + return APR_SUCCESS; +} + +APR_DECLARE(int) apr_crypto_lib_is_initialized(const char *name) +{ + return crypto_libs && apr_hash_get(crypto_libs, name, APR_HASH_KEY_STRING); +} + +APR_DECLARE(apr_status_t) apr_crypto_lib_init(const char *name, + const char *params, + const apu_err_t **result, + apr_pool_t *pool) +{ + apr_status_t rv; + apr_pool_t *parent; + + if (!name) { + return APR_EINVAL; + } + + if (apr_crypto_lib_is_initialized(name)) { + return APR_EREINIT; + } + + while ((parent = apr_pool_parent_get(pool))) { + pool = parent; + } + + if (!crypto_libs) { + crypto_libs = apr_hash_make(pool); + if (!crypto_libs) { + return APR_ENOMEM; + } + apr_pool_cleanup_register(pool, NULL, crypto_libs_cleanup, + apr_pool_cleanup_null); + } + + rv = APR_ENOTIMPL; +#if APU_HAVE_OPENSSL + if (!strcmp(name, "openssl")) { + rv = apr__crypto_openssl_init(params, result, pool); + } + else +#endif +#if APU_HAVE_NSS + if (!strcmp(name, "nss")) { + rv = apr__crypto_nss_init(params, result, pool); + } + else +#endif +#if APU_HAVE_COMMONCRYPTO + if (!strcmp(name, "commoncrypto")) { + rv = apr__crypto_commoncrypto_init(params, result, pool); + } + else +#endif +#if APU_HAVE_MSCAPI + if (!strcmp(name, "mscapi")) { + rv = apr__crypto_mscapi_init(params, result, pool); + } + else +#endif +#if APU_HAVE_MSCNG + if (!strcmp(name, "mscng")) { + rv = apr__crypto_mscng_init(params, result, pool); + } + else +#endif + ; + if (rv == APR_SUCCESS) { + name = apr_pstrdup(pool, name); + apr_hash_set(crypto_libs, name, APR_HASH_KEY_STRING, name); + } + return rv; +} + +APR_DECLARE(apr_status_t) apr_crypto_lib_term(const char *name) +{ + apr_status_t rv; + + if (!crypto_libs) { + return APR_EINIT; + } + + if (!name) { + apr_pool_t *pool = apr_hash_pool_get(crypto_libs); + return apr_pool_cleanup_run(pool, NULL, crypto_libs_cleanup); + } + + if (!apr_hash_get(crypto_libs, name, APR_HASH_KEY_STRING)) { + return APR_EINIT; + } + + rv = APR_ENOTIMPL; +#if APU_HAVE_OPENSSL + if (!strcmp(name, "openssl")) { + rv = apr__crypto_openssl_term(); + } + else +#endif +#if APU_HAVE_NSS + if (!strcmp(name, "nss")) { + rv = apr__crypto_nss_term(); + } + else +#endif +#if APU_HAVE_COMMONCRYPTO + if (!strcmp(name, "commoncrypto")) { + rv = apr__crypto_commoncrypto_term(); + } + else +#endif +#if APU_HAVE_MSCAPI + if (!strcmp(name, "mscapi")) { + rv = apr__crypto_mscapi_term(); + } + else +#endif +#if APU_HAVE_MSCNG + if (!strcmp(name, "mscng")) { + rv = apr__crypto_mscng_term(); + } + else +#endif + ; + if (rv == APR_SUCCESS) { + apr_hash_set(crypto_libs, name, APR_HASH_KEY_STRING, NULL); + } + return rv; +} + /** * @brief Return the name of the driver. * diff --git a/crypto/apr_crypto_commoncrypto.c b/crypto/apr_crypto_commoncrypto.c index 9138933067f..83886bce3af 100644 --- a/crypto/apr_crypto_commoncrypto.c +++ b/crypto/apr_crypto_commoncrypto.c @@ -95,25 +95,16 @@ static apr_status_t crypto_error(const apu_err_t **result, */ static apr_status_t crypto_shutdown(void) { - return APR_SUCCESS; -} - -static apr_status_t crypto_shutdown_helper(void *data) -{ - return crypto_shutdown(); + return apr_crypto_lib_term("commoncrypto"); } /** * Initialise the crypto library and perform one time initialisation. */ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, - const apu_err_t **result) + const apu_err_t **result) { - - apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, - apr_pool_cleanup_null); - - return APR_SUCCESS; + return apr_crypto_lib_init("commoncrypto", params, result, pool); } /** diff --git a/crypto/apr_crypto_internal.c b/crypto/apr_crypto_internal.c new file mode 100644 index 00000000000..66e340c05f6 --- /dev/null +++ b/crypto/apr_crypto_internal.c @@ -0,0 +1,238 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apu.h" +#include "apr_crypto.h" +#include "apr_crypto_internal.h" + +#if APU_HAVE_CRYPTO + +#if APU_HAVE_OPENSSL + +#include +#include +#include + +apr_status_t apr__crypto_openssl_init(const char *params, + const apu_err_t **result, + apr_pool_t *pool) +{ +#if APR_USE_OPENSSL_PRE_1_1_API + (void)CRYPTO_malloc_init(); +#else + OPENSSL_malloc_init(); +#endif + ERR_load_crypto_strings(); + /* SSL_load_error_strings(); */ + OpenSSL_add_all_algorithms(); + ENGINE_load_builtin_engines(); + ENGINE_register_all_complete(); + + return APR_SUCCESS; +} + +apr_status_t apr__crypto_openssl_term(void) +{ + ERR_free_strings(); + EVP_cleanup(); + ENGINE_cleanup(); + + return APR_SUCCESS; +} + +#endif /* APU_HAVE_OPENSSL */ + + +#if APU_HAVE_NSS + +#include + +#ifdef HAVE_NSS_NSS_H +#include +#endif +#ifdef HAVE_NSS_H +#include +#endif + +apr_status_t apr__crypto_nss_init(const char *params, + const apu_err_t **result, + apr_pool_t *pool) +{ + SECStatus s; + const char *dir = NULL; + const char *keyPrefix = NULL; + const char *certPrefix = NULL; + const char *secmod = NULL; + int noinit = 0; + PRUint32 flags = 0; + + struct { + const char *field; + const char *value; + int set; + } fields[] = { + { "dir", NULL, 0 }, + { "key3", NULL, 0 }, + { "cert7", NULL, 0 }, + { "secmod", NULL, 0 }, + { "noinit", NULL, 0 }, + { NULL, NULL, 0 } + }; + const char *ptr; + size_t klen; + char **elts = NULL; + char *elt; + int i = 0, j; + apr_status_t status; + + if (params) { + if (APR_SUCCESS != (status = apr_tokenize_to_argv(params, &elts, pool))) { + return status; + } + while ((elt = elts[i])) { + ptr = strchr(elt, '='); + if (ptr) { + for (klen = ptr - elt; klen && apr_isspace(elt[klen - 1]); --klen) + ; + ptr++; + } + else { + for (klen = strlen(elt); klen && apr_isspace(elt[klen - 1]); --klen) + ; + } + elt[klen] = 0; + + for (j = 0; fields[j].field != NULL; ++j) { + if (klen && !strcasecmp(fields[j].field, elt)) { + fields[j].set = 1; + if (ptr) { + fields[j].value = ptr; + } + break; + } + } + + i++; + } + dir = fields[0].value; + keyPrefix = fields[1].value; + certPrefix = fields[2].value; + secmod = fields[3].value; + noinit = fields[4].set; + } + + /* if we've been asked to bypass, do so here */ + if (noinit) { + return APR_SUCCESS; + } + + /* sanity check - we can only initialise NSS once */ + if (NSS_IsInitialized()) { + return APR_EREINIT; + } + + if (keyPrefix || certPrefix || secmod) { + s = NSS_Initialize(dir, certPrefix, keyPrefix, secmod, flags); + } + else if (dir) { + s = NSS_InitReadWrite(dir); + } + else { + s = NSS_NoDB_Init(NULL); + } + if (s != SECSuccess) { + if (result) { + /* Note: all memory must be owned by the caller, in case we're unloaded */ + apu_err_t *err = apr_pcalloc(pool, sizeof(apu_err_t)); + err->rc = PR_GetError(); + err->msg = apr_pstrdup(pool, PR_ErrorToName(s)); + err->reason = apr_pstrdup(pool, "Error during 'nss' initialisation"); + *result = err; + } + + return APR_ECRYPT; + } + + return APR_SUCCESS; +} + +apr_status_t apr__crypto_nss_term(void) +{ + if (NSS_IsInitialized()) { + SECStatus s = NSS_Shutdown(); + if (s != SECSuccess) { + fprintf(stderr, "NSS failed to shutdown, possible leak: %d: %s", + PR_GetError(), PR_ErrorToName(s)); + return APR_EINIT; + } + } + return APR_SUCCESS; +} + +#endif /* APU_HAVE_NSS */ + + +#if APU_HAVE_COMMONCRYPTO + +apr_status_t apr__crypto_commoncrypto_init(const char *params, + const apu_err_t **result, + apr_pool_t *pool) +{ + return APR_SUCCESS; +} + +apr_status_t apr__crypto_commoncrypto_term(void) +{ + return APR_SUCCESS; +} + +#endif /* APU_HAVE_COMMONCRYPTO */ + + +#if APU_HAVE_MSCAPI + +apr_status_t apr__crypto_commoncrypto_init(const char *params, + const apu_err_t **result, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr__crypto_commoncrypto_term(void) +{ + return APR_ENOTIMPL; +} + +#endif /* APU_HAVE_MSCAPI */ + + +#if APU_HAVE_MSCNG + +apr_status_t apr__crypto_commoncrypto_init(const char *params, + const apu_err_t **result, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +apr_status_t apr__crypto_commoncrypto_term(void) +{ + return APR_ENOTIMPL; +} + +#endif /* APU_HAVE_MSCNG */ + +#endif /* APU_HAVE_CRYPTO */ diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 1c3bb2c6afa..52898f69d16 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -112,128 +112,16 @@ static apr_status_t crypto_error(const apu_err_t **result, */ static apr_status_t crypto_shutdown(void) { - if (NSS_IsInitialized()) { - SECStatus s = NSS_Shutdown(); - if (s != SECSuccess) { - fprintf(stderr, "NSS failed to shutdown, possible leak: %d: %s", - PR_GetError(), PR_ErrorToName(s)); - return APR_EINIT; - } - } - return APR_SUCCESS; -} - -static apr_status_t crypto_shutdown_helper(void *data) -{ - return crypto_shutdown(); + return apr_crypto_lib_term("nss"); } /** * Initialise the crypto library and perform one time initialisation. */ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, - const apu_err_t **result) + const apu_err_t **result) { - SECStatus s; - const char *dir = NULL; - const char *keyPrefix = NULL; - const char *certPrefix = NULL; - const char *secmod = NULL; - int noinit = 0; - PRUint32 flags = 0; - - struct { - const char *field; - const char *value; - int set; - } fields[] = { - { "dir", NULL, 0 }, - { "key3", NULL, 0 }, - { "cert7", NULL, 0 }, - { "secmod", NULL, 0 }, - { "noinit", NULL, 0 }, - { NULL, NULL, 0 } - }; - const char *ptr; - size_t klen; - char **elts = NULL; - char *elt; - int i = 0, j; - apr_status_t status; - - if (params) { - if (APR_SUCCESS != (status = apr_tokenize_to_argv(params, &elts, pool))) { - return status; - } - while ((elt = elts[i])) { - ptr = strchr(elt, '='); - if (ptr) { - for (klen = ptr - elt; klen && apr_isspace(elt[klen - 1]); --klen) - ; - ptr++; - } - else { - for (klen = strlen(elt); klen && apr_isspace(elt[klen - 1]); --klen) - ; - } - elt[klen] = 0; - - for (j = 0; fields[j].field != NULL; ++j) { - if (klen && !strcasecmp(fields[j].field, elt)) { - fields[j].set = 1; - if (ptr) { - fields[j].value = ptr; - } - break; - } - } - - i++; - } - dir = fields[0].value; - keyPrefix = fields[1].value; - certPrefix = fields[2].value; - secmod = fields[3].value; - noinit = fields[4].set; - } - - /* if we've been asked to bypass, do so here */ - if (noinit) { - return APR_SUCCESS; - } - - /* sanity check - we can only initialise NSS once */ - if (NSS_IsInitialized()) { - return APR_EREINIT; - } - - if (keyPrefix || certPrefix || secmod) { - s = NSS_Initialize(dir, certPrefix, keyPrefix, secmod, flags); - } - else if (dir) { - s = NSS_InitReadWrite(dir); - } - else { - s = NSS_NoDB_Init(NULL); - } - if (s != SECSuccess) { - if (result) { - /* Note: all memory must be owned by the caller, in case we're unloaded */ - apu_err_t *err = apr_pcalloc(pool, sizeof(apu_err_t)); - err->rc = PR_GetError(); - err->msg = apr_pstrdup(pool, PR_ErrorToName(s)); - err->reason = apr_pstrdup(pool, "Error during 'nss' initialisation"); - *result = err; - } - - return APR_ECRYPT; - } - - apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, - apr_pool_cleanup_null); - - return APR_SUCCESS; - + return apr_crypto_lib_init("nss", params, result, pool); } /** diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 76f318411da..7d969924226 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -114,38 +114,16 @@ static apr_status_t crypto_error(const apu_err_t **result, */ static apr_status_t crypto_shutdown(void) { - ERR_free_strings(); - EVP_cleanup(); - ENGINE_cleanup(); - return APR_SUCCESS; -} - -static apr_status_t crypto_shutdown_helper(void *data) -{ - return crypto_shutdown(); + return apr_crypto_lib_term("openssl"); } /** * Initialise the crypto library and perform one time initialisation. */ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, - const apu_err_t **result) + const apu_err_t **result) { -#if APR_USE_OPENSSL_PRE_1_1_API - (void)CRYPTO_malloc_init(); -#else - OPENSSL_malloc_init(); -#endif - ERR_load_crypto_strings(); - /* SSL_load_error_strings(); */ - OpenSSL_add_all_algorithms(); - ENGINE_load_builtin_engines(); - ENGINE_register_all_complete(); - - apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, - apr_pool_cleanup_null); - - return APR_SUCCESS; + return apr_crypto_lib_init("openssl", params, result, pool); } /** diff --git a/crypto/apr_crypto_prng.c b/crypto/apr_crypto_prng.c index b136212c3d7..2c2f15f2db1 100644 --- a/crypto/apr_crypto_prng.c +++ b/crypto/apr_crypto_prng.c @@ -57,6 +57,11 @@ typedef EVP_CIPHER_CTX cprng_stream_ctx_t; +static apr_status_t cprng_lib_init(apr_pool_t *pool) +{ + return apr_crypto_lib_init("openssl", NULL, NULL, pool); +} + static apr_status_t cprng_stream_ctx_make(cprng_stream_ctx_t **pctx) { EVP_CIPHER_CTX *ctx; @@ -154,15 +159,21 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_init(apr_pool_t *pool, const unsigned char seed[], int flags) { + apr_status_t rv; + if (cprng_global) { return APR_EREINIT; } + rv = cprng_lib_init(pool); + if (rv != APR_SUCCESS && rv != APR_EREINIT) { + return rv; + } + if (flags & APR_CRYPTO_PRNG_PER_THREAD) { #if !APR_HAS_THREADS return APR_ENOTIMPL; #else - apr_status_t rv; rv = apr_threadkey_private_create(&cprng_thread_key, cprng_thread_destroy, pool); if (rv != APR_SUCCESS) { diff --git a/include/apr_crypto.h b/include/apr_crypto.h index f569cf0da4f..28d1089ef41 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -178,6 +178,15 @@ typedef struct apr_crypto_key_rec_t { */ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool); +APR_DECLARE(apr_status_t) apr_crypto_lib_init(const char *name, + const char *params, + const apu_err_t **result, + apr_pool_t *pool); + +APR_DECLARE(apr_status_t) apr_crypto_lib_term(const char *name); + +APR_DECLARE(int) apr_crypto_lib_is_initialized(const char *name); + /** * @brief Zero out the buffer provided when the pool is cleaned up. * diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index 1ea838bfb7d..bb212ba7d5e 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -288,6 +288,41 @@ struct apr_crypto_driver_t { }; +#if APU_HAVE_OPENSSL +apr_status_t apr__crypto_openssl_init(const char *params, + const apu_err_t **result, + apr_pool_t *pool); +apr_status_t apr__crypto_openssl_term(void); +#endif + +#if APU_HAVE_NSS +apr_status_t apr__crypto_nss_init(const char *params, + const apu_err_t **result, + apr_pool_t *pool); +apr_status_t apr__crypto_nss_term(void); +#endif + +#if APU_HAVE_COMMONCRYPTO +apr_status_t apr__crypto_commoncrypto_init(const char *params, + const apu_err_t **result, + apr_pool_t *pool); +apr_status_t apr__crypto_commoncrypto_term(void); +#endif + +#if APU_HAVE_MSCAPI +apr_status_t apr__crypto_mscapi_init(const char *params, + const apu_err_t **result, + apr_pool_t *pool); +apr_status_t apr__crypto_mscapi_term(void); +#endif + +#if APU_HAVE_MSCNG +apr_status_t apr__crypto_msccng_init(const char *params, + const apu_err_t **result, + apr_pool_t *pool); +apr_status_t apr__crypto_msccng_term(void); +#endif + #endif #ifdef __cplusplus diff --git a/test/testcrypto.c b/test/testcrypto.c index 3720974091a..e2509545058 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -556,16 +556,9 @@ static void test_crypto_init(abts_case *tc, void *data) { apr_pool_t *pool = NULL; apr_status_t rv; - int flags = 0; apr_pool_create(&pool, NULL); -#if APR_HAS_THREADS - flags = APR_CRYPTO_PRNG_PER_THREAD; -#endif - rv = apr_crypto_prng_init(apr_pool_parent_get(pool), 0, NULL, flags); - ABTS_ASSERT(tc, "failed to init apr_crypto_prng", rv == APR_SUCCESS); - rv = apr_crypto_init(pool); ABTS_ASSERT(tc, "failed to init apr_crypto", rv == APR_SUCCESS); From 25cc4e1461c01022b69efa86ddf31107680fb9ea Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 12 Jun 2018 21:33:39 +0000 Subject: [PATCH 7781/7878] apr_crypto: follow up to r1833359: export full _LDFLAGS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833425 13f79535-47bb-0310-9956-ffa450edef68 --- build/crypto.m4 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build/crypto.m4 b/build/crypto.m4 index c9294851035..d4719b34f33 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -132,7 +132,7 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_openssl" = "1"; then - APR_ADDTO(LDADD_crypto_openssl, [$openssl_LDFLAGS -lssl -lcrypto]) + APR_ADDTO(LDADD_crypto_openssl, [$openssl_LDFLAGS -lcrypto]) apu_have_crypto=1 AC_MSG_CHECKING([for const input buffers in OpenSSL]) @@ -161,8 +161,8 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ LDFLAGS="$old_ldflags" if test "$apu_have_openssl" = "1"; then - APR_ADDTO(APRUTIL_EXPORT_LIBS, [-lcrypto]) - APR_ADDTO(LIBS, [-lcrypto]) + APR_ADDTO(APRUTIL_EXPORT_LIBS, [$LDADD_crypto_openssl]) + APR_ADDTO(LIBS, [$LDADD_crypto_openssl]) fi ]) @@ -242,8 +242,8 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [ LDFLAGS="$old_ldflags" if test "$apu_have_nss" = "1"; then - APR_ADDTO(APRUTIL_EXPORT_LIBS, [-lnspr4 -lnss3]) - APR_ADDTO(LIBS, [-lnspr4 -lnss3]) + APR_ADDTO(APRUTIL_EXPORT_LIBS, [$LDADD_crypto_nss]) + APR_ADDTO(LIBS, [$LDADD_crypto_nss]) fi ]) @@ -303,8 +303,8 @@ AC_DEFUN([APU_CHECK_CRYPTO_COMMONCRYPTO], [ LDFLAGS="$old_ldflags" if test "$apu_have_commoncrypto" = "1"; then - APR_ADDTO(APRUTIL_EXPORT_LIBS, [-lcrypto]) - APR_ADDTO(LIBS, [-lcrypto]) + APR_ADDTO(APRUTIL_EXPORT_LIBS, [$LDADD_crypto_commoncrypto]) + APR_ADDTO(LIBS, [$LDADD_crypto_commoncrypto]) fi ]) From c0edb66d8941f2dec833c5d673ff914a2395c371 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 12 Jun 2018 21:38:24 +0000 Subject: [PATCH 7782/7878] apr_crypto: follow up to r1833359: more openssl _term() cleanups. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833426 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_internal.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/crypto/apr_crypto_internal.c b/crypto/apr_crypto_internal.c index 66e340c05f6..d22564230a9 100644 --- a/crypto/apr_crypto_internal.c +++ b/crypto/apr_crypto_internal.c @@ -24,19 +24,32 @@ #include #include +#include +#include #include +#ifndef APR_USE_OPENSSL_PRE_1_1_API +#if defined(LIBRESSL_VERSION_NUMBER) +/* LibreSSL declares OPENSSL_VERSION_NUMBER == 2.0 but does not include most + * changes from OpenSSL >= 1.1 (new functions, macros, deprecations, ...), so + * we have to work around this... + */ +#define APR_USE_OPENSSL_PRE_1_1_API (1) +#else +#define APR_USE_OPENSSL_PRE_1_1_API (OPENSSL_VERSION_NUMBER < 0x10100000L) +#endif +#endif + apr_status_t apr__crypto_openssl_init(const char *params, const apu_err_t **result, apr_pool_t *pool) { #if APR_USE_OPENSSL_PRE_1_1_API - (void)CRYPTO_malloc_init(); + CRYPTO_malloc_init(); #else OPENSSL_malloc_init(); #endif ERR_load_crypto_strings(); - /* SSL_load_error_strings(); */ OpenSSL_add_all_algorithms(); ENGINE_load_builtin_engines(); ENGINE_register_all_complete(); @@ -46,9 +59,24 @@ apr_status_t apr__crypto_openssl_init(const char *params, apr_status_t apr__crypto_openssl_term(void) { - ERR_free_strings(); +#if APR_USE_OPENSSL_PRE_1_1_API +#ifdef OPENSSL_FIPS + FIPS_mode_set(0); +#endif + CONF_modules_unload(1); + OBJ_cleanup(); EVP_cleanup(); + RAND_cleanup(); ENGINE_cleanup(); + ERR_free_strings(); + ERR_remove_thread_state(NULL); + CRYPTO_cleanup_all_ex_data(); +#ifndef OPENSSL_NO_COMP + COMP_zlib_cleanup(); +#endif +#else /* !APR_USE_OPENSSL_PRE_1_1_API */ + OPENSSL_cleanup(); +#endif /* !APR_USE_OPENSSL_PRE_1_1_API */ return APR_SUCCESS; } From d3f30fb2c09875ef3db267eca2155833e09317c9 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Wed, 13 Jun 2018 06:21:31 +0000 Subject: [PATCH 7783/7878] * Add missing includes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833440 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_internal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/apr_crypto_internal.c b/crypto/apr_crypto_internal.c index d22564230a9..8e81f83611f 100644 --- a/crypto/apr_crypto_internal.c +++ b/crypto/apr_crypto_internal.c @@ -14,9 +14,12 @@ * limitations under the License. */ +#include "apr_lib.h" #include "apu.h" +#include "apr_private.h" #include "apr_crypto.h" #include "apr_crypto_internal.h" +#include "apr_strings.h" #if APU_HAVE_CRYPTO From 0219678bd0462479cdcaef64421082085a29596c Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 13 Jun 2018 09:18:19 +0000 Subject: [PATCH 7784/7878] apr_crypto: follow up to r1833359: crypto libs initialization scope. The crypto libs initialized on (and terminated with) the given pool, not the root pool. The latter is used only to maintain the active libs. This allows the users to control the scope of the lib, e.g. when itself is called by dynamic linking or DSO. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833449 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 153 ++++++++++++++++++++++++++--------- crypto/apr_crypto_internal.c | 12 ++- include/apr_crypto.h | 2 +- 3 files changed, 125 insertions(+), 42 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 221792d2603..8b1b0888b91 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -33,7 +33,6 @@ #include "apr_crypto.h" #include "apr_version.h" -static apr_hash_t *crypto_libs = NULL; static apr_hash_t *drivers = NULL; #define ERROR_SIZE 1024 @@ -305,24 +304,56 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( return rv; } -static apr_status_t crypto_libs_cleanup(void *arg) +struct crypto_lib { + const char *name; + apr_pool_t *pool; + apr_status_t (*term)(void); + struct crypto_lib *next; +}; +static apr_hash_t *active_libs = NULL; +static struct crypto_lib *spare_libs = NULL; + +static apr_status_t crypto_libs_cleanup(void *nil) { - apr_hash_index_t *hi; + active_libs = NULL; + spare_libs = NULL; + return APR_SUCCESS; +} - for (hi = apr_hash_first(NULL, crypto_libs); hi; hi = apr_hash_next(hi)) { - const char *name = apr_hash_this_key(hi); - if (name) { - apr_crypto_lib_term(name); - } +static void spare_lib_push(struct crypto_lib *lib) +{ + lib->name = NULL; + lib->pool = NULL; + lib->term = NULL; + lib->next = spare_libs; + spare_libs = lib; +} + +static struct crypto_lib *spare_lib_pop(void) +{ + struct crypto_lib *lib; + lib = spare_libs; + if (lib) { + spare_libs = lib->next; + lib->next = NULL; } - crypto_libs = NULL; + return lib; +} + +static apr_status_t crypto_lib_cleanup(void *arg) +{ + struct crypto_lib *lib = arg; + + apr_hash_set(active_libs, lib->name, APR_HASH_KEY_STRING, NULL); + lib->term(); + spare_lib_push(lib); return APR_SUCCESS; } -APR_DECLARE(int) apr_crypto_lib_is_initialized(const char *name) +APR_DECLARE(int) apr_crypto_lib_is_active(const char *name) { - return crypto_libs && apr_hash_get(crypto_libs, name, APR_HASH_KEY_STRING); + return active_libs && apr_hash_get(active_libs, name, APR_HASH_KEY_STRING); } APR_DECLARE(apr_status_t) apr_crypto_lib_init(const char *name, @@ -331,123 +362,169 @@ APR_DECLARE(apr_status_t) apr_crypto_lib_init(const char *name, apr_pool_t *pool) { apr_status_t rv; - apr_pool_t *parent; + apr_pool_t *rootp, *p; + struct crypto_lib *lib; if (!name) { return APR_EINVAL; } - if (apr_crypto_lib_is_initialized(name)) { + if (apr_crypto_lib_is_active(name)) { return APR_EREINIT; } - while ((parent = apr_pool_parent_get(pool))) { - pool = parent; + rootp = pool; + while ((p = apr_pool_parent_get(rootp))) { + rootp = p; } - if (!crypto_libs) { - crypto_libs = apr_hash_make(pool); - if (!crypto_libs) { + if (!active_libs) { + active_libs = apr_hash_make(rootp); + if (!active_libs) { return APR_ENOMEM; } - apr_pool_cleanup_register(pool, NULL, crypto_libs_cleanup, + apr_pool_cleanup_register(rootp, NULL, crypto_libs_cleanup, apr_pool_cleanup_null); } + lib = spare_lib_pop(); + if (!lib) { + lib = apr_pcalloc(rootp, sizeof(*lib)); + if (!lib) { + return APR_ENOMEM; + } + } + lib->pool = pool; + rv = APR_ENOTIMPL; #if APU_HAVE_OPENSSL if (!strcmp(name, "openssl")) { rv = apr__crypto_openssl_init(params, result, pool); + if (rv == APR_SUCCESS) { + lib->term = apr__crypto_openssl_term; + lib->name = "openssl"; + } } else #endif #if APU_HAVE_NSS if (!strcmp(name, "nss")) { rv = apr__crypto_nss_init(params, result, pool); + if (rv == APR_SUCCESS) { + lib->term = apr__crypto_nss_term; + lib->name = "nss"; + } } else #endif #if APU_HAVE_COMMONCRYPTO if (!strcmp(name, "commoncrypto")) { rv = apr__crypto_commoncrypto_init(params, result, pool); + if (rv == APR_SUCCESS) { + lib->term = apr__crypto_commoncrypto_term; + lib->name = "commoncrypto"; + } } else #endif #if APU_HAVE_MSCAPI if (!strcmp(name, "mscapi")) { rv = apr__crypto_mscapi_init(params, result, pool); + if (rv == APR_SUCCESS) { + lib->term = apr__crypto_mscapi_term; + lib->name = "mscapi"; + } } else #endif #if APU_HAVE_MSCNG if (!strcmp(name, "mscng")) { rv = apr__crypto_mscng_init(params, result, pool); + if (rv == APR_SUCCESS) { + lib->term = apr__crypto_mscng_term; + lib->name = "mscng"; + } } else #endif ; if (rv == APR_SUCCESS) { - name = apr_pstrdup(pool, name); - apr_hash_set(crypto_libs, name, APR_HASH_KEY_STRING, name); + apr_hash_set(active_libs, lib->name, APR_HASH_KEY_STRING, lib); + apr_pool_cleanup_register(pool, lib, crypto_lib_cleanup, + apr_pool_cleanup_null); + } + else { + spare_lib_push(lib); } return rv; } -APR_DECLARE(apr_status_t) apr_crypto_lib_term(const char *name) +static apr_status_t crypto_lib_term(const char *name) { apr_status_t rv; + struct crypto_lib *lib; - if (!crypto_libs) { - return APR_EINIT; - } - - if (!name) { - apr_pool_t *pool = apr_hash_pool_get(crypto_libs); - return apr_pool_cleanup_run(pool, NULL, crypto_libs_cleanup); - } - - if (!apr_hash_get(crypto_libs, name, APR_HASH_KEY_STRING)) { + lib = apr_hash_get(active_libs, name, APR_HASH_KEY_STRING); + if (!lib) { return APR_EINIT; } rv = APR_ENOTIMPL; #if APU_HAVE_OPENSSL if (!strcmp(name, "openssl")) { - rv = apr__crypto_openssl_term(); + rv = APR_SUCCESS; } else #endif #if APU_HAVE_NSS if (!strcmp(name, "nss")) { - rv = apr__crypto_nss_term(); + rv = APR_SUCCESS; } else #endif #if APU_HAVE_COMMONCRYPTO if (!strcmp(name, "commoncrypto")) { - rv = apr__crypto_commoncrypto_term(); + rv = APR_SUCCESS; } else #endif #if APU_HAVE_MSCAPI if (!strcmp(name, "mscapi")) { - rv = apr__crypto_mscapi_term(); + rv = APR_SUCCESS; } else #endif #if APU_HAVE_MSCNG if (!strcmp(name, "mscng")) { - rv = apr__crypto_mscng_term(); + rv = APR_SUCCESS; } else #endif ; if (rv == APR_SUCCESS) { - apr_hash_set(crypto_libs, name, APR_HASH_KEY_STRING, NULL); + rv = apr_pool_cleanup_run(lib->pool, lib, crypto_lib_cleanup); } return rv; } +APR_DECLARE(apr_status_t) apr_crypto_lib_term(const char *name) +{ + if (!active_libs) { + return APR_EINIT; + } + + if (!name) { + apr_hash_index_t *hi = apr_hash_first(NULL, active_libs); + for (; hi; hi = apr_hash_next(hi)) { + name = apr_hash_this_key(hi); + crypto_lib_term(name); + } + return APR_SUCCESS; + } + + return crypto_lib_term(name); +} + /** * @brief Return the name of the driver. * diff --git a/crypto/apr_crypto_internal.c b/crypto/apr_crypto_internal.c index 8e81f83611f..901d69d45bd 100644 --- a/crypto/apr_crypto_internal.c +++ b/crypto/apr_crypto_internal.c @@ -63,6 +63,7 @@ apr_status_t apr__crypto_openssl_init(const char *params, apr_status_t apr__crypto_openssl_term(void) { #if APR_USE_OPENSSL_PRE_1_1_API + #ifdef OPENSSL_FIPS FIPS_mode_set(0); #endif @@ -71,12 +72,17 @@ apr_status_t apr__crypto_openssl_term(void) EVP_cleanup(); RAND_cleanup(); ENGINE_cleanup(); - ERR_free_strings(); - ERR_remove_thread_state(NULL); - CRYPTO_cleanup_all_ex_data(); #ifndef OPENSSL_NO_COMP COMP_zlib_cleanup(); #endif +#if OPENSSL_VERSION_NUMBER >= 0x1000000fL + ERR_remove_thread_state(NULL); +#else + ERR_remove_state(0); +#endif + ERR_free_strings(); + CRYPTO_cleanup_all_ex_data(); + #else /* !APR_USE_OPENSSL_PRE_1_1_API */ OPENSSL_cleanup(); #endif /* !APR_USE_OPENSSL_PRE_1_1_API */ diff --git a/include/apr_crypto.h b/include/apr_crypto.h index 28d1089ef41..c1d39d01625 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -185,7 +185,7 @@ APR_DECLARE(apr_status_t) apr_crypto_lib_init(const char *name, APR_DECLARE(apr_status_t) apr_crypto_lib_term(const char *name); -APR_DECLARE(int) apr_crypto_lib_is_initialized(const char *name); +APR_DECLARE(int) apr_crypto_lib_is_active(const char *name); /** * @brief Zero out the buffer provided when the pool is cleaned up. From 01794827ad651b29101f9452bc576f0c3a5c9436 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 13 Jun 2018 09:33:02 +0000 Subject: [PATCH 7785/7878] apr_crypto: follow up to r1833359: don't ignore lib->term() return value. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833450 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 8b1b0888b91..6170825b509 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -394,7 +394,6 @@ APR_DECLARE(apr_status_t) apr_crypto_lib_init(const char *name, return APR_ENOMEM; } } - lib->pool = pool; rv = APR_ENOTIMPL; #if APU_HAVE_OPENSSL @@ -449,8 +448,9 @@ APR_DECLARE(apr_status_t) apr_crypto_lib_init(const char *name, #endif ; if (rv == APR_SUCCESS) { + lib->pool = pool; apr_hash_set(active_libs, lib->name, APR_HASH_KEY_STRING, lib); - apr_pool_cleanup_register(pool, lib, crypto_lib_cleanup, + apr_pool_cleanup_register(lib->pool, lib, crypto_lib_cleanup, apr_pool_cleanup_null); } else { @@ -502,7 +502,10 @@ static apr_status_t crypto_lib_term(const char *name) #endif ; if (rv == APR_SUCCESS) { - rv = apr_pool_cleanup_run(lib->pool, lib, crypto_lib_cleanup); + apr_hash_set(active_libs, lib->name, APR_HASH_KEY_STRING, NULL); + apr_pool_cleanup_kill(lib->pool, lib, crypto_lib_cleanup); + rv = lib->term(); + spare_lib_push(lib); } return rv; } From dd5d113659b0159af986853f2310272b54d52b07 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 13 Jun 2018 09:44:11 +0000 Subject: [PATCH 7786/7878] apr_crypto: follow up to r1833359: reuse crypto_lib_free() code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833451 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 6170825b509..ac8c8d0138c 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -340,14 +340,21 @@ static struct crypto_lib *spare_lib_pop(void) return lib; } -static apr_status_t crypto_lib_cleanup(void *arg) +static apr_status_t crypto_lib_free(struct crypto_lib *lib) { - struct crypto_lib *lib = arg; + apr_status_t rv; apr_hash_set(active_libs, lib->name, APR_HASH_KEY_STRING, NULL); - lib->term(); + rv = lib->term(); spare_lib_push(lib); + return rv; +} + +static apr_status_t crypto_lib_cleanup(void *arg) +{ + crypto_lib_free(arg); + return APR_SUCCESS; } @@ -502,10 +509,8 @@ static apr_status_t crypto_lib_term(const char *name) #endif ; if (rv == APR_SUCCESS) { - apr_hash_set(active_libs, lib->name, APR_HASH_KEY_STRING, NULL); apr_pool_cleanup_kill(lib->pool, lib, crypto_lib_cleanup); - rv = lib->term(); - spare_lib_push(lib); + rv = crypto_lib_free(lib); } return rv; } From b6721fd36032e4a0d0e1d390d906b3b4d617ab22 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 13 Jun 2018 11:06:21 +0000 Subject: [PATCH 7787/7878] apr_crypto: follow up to r1833359: helper to get crypto lib version. While at it, also fix bad copy/paste function names for MSCNG/MSCAPI. (BTW, those libs are totally ENOTIMPL/unplugged for now). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833456 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 47 +++++++++++++++++++++++++-- crypto/apr_crypto_internal.c | 37 +++++++++++++++++---- include/apr_crypto.h | 24 +++++--------- include/private/apr_crypto_internal.h | 13 +++++--- 4 files changed, 93 insertions(+), 28 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index ac8c8d0138c..07cc672d9a1 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -358,9 +358,47 @@ static apr_status_t crypto_lib_cleanup(void *arg) return APR_SUCCESS; } -APR_DECLARE(int) apr_crypto_lib_is_active(const char *name) +APR_DECLARE(apr_status_t) apr_crypto_lib_version(const char *name, + const char **version) { - return active_libs && apr_hash_get(active_libs, name, APR_HASH_KEY_STRING); + apr_status_t rv = APR_ENOTIMPL; +#if APU_HAVE_OPENSSL + if (!strcmp(name, "openssl")) { + *version = apr__crypto_openssl_version(); + rv = *version ? APR_SUCCESS : APR_NOTFOUND; + } + else +#endif +#if APU_HAVE_NSS + if (!strcmp(name, "nss")) { + *version = apr__crypto_nss_version(); + rv = *version ? APR_SUCCESS : APR_NOTFOUND; + } + else +#endif +#if APU_HAVE_COMMONCRYPTO + if (!strcmp(name, "commoncrypto")) { + *version = apr__crypto_commoncrypto_version(); + rv = *version ? APR_SUCCESS : APR_NOTFOUND; + } + else +#endif +#if APU_HAVE_MSCAPI + if (!strcmp(name, "mscapi")) { + *version = apr__crypto_mscapi_version(); + rv = *version ? APR_SUCCESS : APR_NOTFOUND; + } + else +#endif +#if APU_HAVE_MSCNG + if (!strcmp(name, "mscng")) { + *version = apr__crypto_mscng_version(); + rv = *version ? APR_SUCCESS : APR_NOTFOUND; + } + else +#endif + ; + return rv; } APR_DECLARE(apr_status_t) apr_crypto_lib_init(const char *name, @@ -533,6 +571,11 @@ APR_DECLARE(apr_status_t) apr_crypto_lib_term(const char *name) return crypto_lib_term(name); } +APR_DECLARE(int) apr_crypto_lib_is_active(const char *name) +{ + return active_libs && apr_hash_get(active_libs, name, APR_HASH_KEY_STRING); +} + /** * @brief Return the name of the driver. * diff --git a/crypto/apr_crypto_internal.c b/crypto/apr_crypto_internal.c index 901d69d45bd..09148e386d9 100644 --- a/crypto/apr_crypto_internal.c +++ b/crypto/apr_crypto_internal.c @@ -43,6 +43,11 @@ #endif #endif +const char *apr__crypto_openssl_version(void) +{ + return OPENSSL_VERSION_TEXT; +} + apr_status_t apr__crypto_openssl_init(const char *params, const apu_err_t **result, apr_pool_t *pool) @@ -104,6 +109,11 @@ apr_status_t apr__crypto_openssl_term(void) #include #endif +const char *apr__crypto_nss_version(void) +{ + return NSS_VERSION; +} + apr_status_t apr__crypto_nss_init(const char *params, const apu_err_t **result, apr_pool_t *pool) @@ -224,6 +234,11 @@ apr_status_t apr__crypto_nss_term(void) #if APU_HAVE_COMMONCRYPTO +const char *apr__crypto_commoncrypto_version(void) +{ + return NULL; +} + apr_status_t apr__crypto_commoncrypto_init(const char *params, const apu_err_t **result, apr_pool_t *pool) @@ -241,14 +256,19 @@ apr_status_t apr__crypto_commoncrypto_term(void) #if APU_HAVE_MSCAPI -apr_status_t apr__crypto_commoncrypto_init(const char *params, - const apu_err_t **result, - apr_pool_t *pool) +const char *apr__crypto_mscapi_version(void) +{ + return NULL; +} + +apr_status_t apr__crypto_mscapi_init(const char *params, + const apu_err_t **result, + apr_pool_t *pool) { return APR_ENOTIMPL; } -apr_status_t apr__crypto_commoncrypto_term(void) +apr_status_t apr__crypto_mscapi_term(void) { return APR_ENOTIMPL; } @@ -258,14 +278,19 @@ apr_status_t apr__crypto_commoncrypto_term(void) #if APU_HAVE_MSCNG -apr_status_t apr__crypto_commoncrypto_init(const char *params, +const char *apr__crypto_mscng_version(void) +{ + return NULL; +} + +apr_status_t apr__crypto_mscng_init(const char *params, const apu_err_t **result, apr_pool_t *pool) { return APR_ENOTIMPL; } -apr_status_t apr__crypto_commoncrypto_term(void) +apr_status_t apr__crypto_mscng_term(void) { return APR_ENOTIMPL; } diff --git a/include/apr_crypto.h b/include/apr_crypto.h index c1d39d01625..9a615410304 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -43,25 +43,16 @@ extern "C" { #ifndef APU_CRYPTO_RECOMMENDED_DRIVER #if APU_HAVE_COMMONCRYPTO #define APU_CRYPTO_RECOMMENDED_DRIVER "commoncrypto" -#else -#if APU_HAVE_OPENSSL +#elif APU_HAVE_OPENSSL #define APU_CRYPTO_RECOMMENDED_DRIVER "openssl" -#else -#if APU_HAVE_NSS +#elif APU_HAVE_NSS #define APU_CRYPTO_RECOMMENDED_DRIVER "nss" -#else -#if APU_HAVE_MSCNG +#elif APU_HAVE_MSCNG #define APU_CRYPTO_RECOMMENDED_DRIVER "mscng" -#else -#if APU_HAVE_MSCAPI +#elif APU_HAVE_MSCAPI #define APU_CRYPTO_RECOMMENDED_DRIVER "mscapi" -#else -#endif -#endif -#endif -#endif -#endif #endif +#endif /* APU_CRYPTO_RECOMMENDED_DRIVER */ /** * Symmetric Key types understood by the library. @@ -178,13 +169,14 @@ typedef struct apr_crypto_key_rec_t { */ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool); +/* TODO: doxygen */ +APR_DECLARE(apr_status_t) apr_crypto_lib_version(const char *name, + const char **version); APR_DECLARE(apr_status_t) apr_crypto_lib_init(const char *name, const char *params, const apu_err_t **result, apr_pool_t *pool); - APR_DECLARE(apr_status_t) apr_crypto_lib_term(const char *name); - APR_DECLARE(int) apr_crypto_lib_is_active(const char *name); /** diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h index bb212ba7d5e..77581bd156f 100644 --- a/include/private/apr_crypto_internal.h +++ b/include/private/apr_crypto_internal.h @@ -289,6 +289,7 @@ struct apr_crypto_driver_t { }; #if APU_HAVE_OPENSSL +const char *apr__crypto_openssl_version(void); apr_status_t apr__crypto_openssl_init(const char *params, const apu_err_t **result, apr_pool_t *pool); @@ -296,6 +297,7 @@ apr_status_t apr__crypto_openssl_term(void); #endif #if APU_HAVE_NSS +const char *apr__crypto_nss_version(void); apr_status_t apr__crypto_nss_init(const char *params, const apu_err_t **result, apr_pool_t *pool); @@ -303,6 +305,7 @@ apr_status_t apr__crypto_nss_term(void); #endif #if APU_HAVE_COMMONCRYPTO +const char *apr__crypto_commoncrypto_version(void); apr_status_t apr__crypto_commoncrypto_init(const char *params, const apu_err_t **result, apr_pool_t *pool); @@ -310,6 +313,7 @@ apr_status_t apr__crypto_commoncrypto_term(void); #endif #if APU_HAVE_MSCAPI +const char *apr__crypto_mscapi_version(void); apr_status_t apr__crypto_mscapi_init(const char *params, const apu_err_t **result, apr_pool_t *pool); @@ -317,10 +321,11 @@ apr_status_t apr__crypto_mscapi_term(void); #endif #if APU_HAVE_MSCNG -apr_status_t apr__crypto_msccng_init(const char *params, - const apu_err_t **result, - apr_pool_t *pool); -apr_status_t apr__crypto_msccng_term(void); +const char *apr__crypto_mscng_version(void); +apr_status_t apr__crypto_mscng_init(const char *params, + const apu_err_t **result, + apr_pool_t *pool); +apr_status_t apr__crypto_mscng_term(void); #endif #endif From 1734f20ede87666c620d5e89000983fc9a59d22a Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 14 Jun 2018 16:34:49 +0000 Subject: [PATCH 7788/7878] apr_crypto: follow up to r1833359: fix some root pool scopes (possible leaks). Keep the root pool scope for things that need it only (global lists of drivers or libs), but otherwise use the passed in pool (default/global PRNG, errors). This allows the caller to control the scope of initialization functions, and for instance be able to re-initialize when apr_crypto is unloaded/reloaded from a DSO attached to the passed-in pool (e.g. mod_ssl in httpd). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833525 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 84 ++++++++++++++++++++++-------------- crypto/apr_crypto_internal.c | 4 +- test/testcrypto.c | 7 ++- util-misc/apu_dso.c | 17 ++++++-- 4 files changed, 72 insertions(+), 40 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 07cc672d9a1..e7c11b73435 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -37,8 +37,6 @@ static apr_hash_t *drivers = NULL; #define ERROR_SIZE 1024 -#define CLEANUP_CAST (apr_status_t (*)(void*)) - APR_TYPEDEF_STRUCT(apr_crypto_t, apr_pool_t *pool; apr_crypto_driver_t *provider; @@ -87,26 +85,29 @@ static apr_status_t apr_crypto_term(void *ptr) APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) { apr_status_t rv; - apr_pool_t *parent; + apr_pool_t *rootp; int flags = 0; if (drivers != NULL) { return APR_SUCCESS; } - /* Top level pool scope, need process-scope lifetime */ - for (parent = apr_pool_parent_get(pool); - parent && parent != pool; - parent = apr_pool_parent_get(pool)) - pool = parent; + /* Top level pool scope, for drivers' process-scope lifetime */ + rootp = pool; + for (;;) { + apr_pool_t *p = apr_pool_parent_get(rootp); + if (!p || p == rootp) { + break; + } + rootp = p; + } #if APR_HAVE_MODULAR_DSO /* deprecate in 2.0 - permit implicit initialization */ - apu_dso_init(pool); + apu_dso_init(rootp); #endif - drivers = apr_hash_make(pool); - - apr_pool_cleanup_register(pool, NULL, apr_crypto_term, - apr_pool_cleanup_null); + drivers = apr_hash_make(rootp); + apr_pool_cleanup_register(rootp, NULL, apr_crypto_term, + apr_pool_cleanup_null); /* apr_crypto_prng_init() may already have been called with * non-default parameters, so ignore APR_EREINIT. @@ -203,6 +204,7 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( char symname[34]; apr_dso_handle_t *dso; apr_dso_handle_sym_t symbol; + apr_pool_t *rootp; #endif apr_status_t rv; @@ -227,7 +229,7 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( #if APR_HAVE_MODULAR_DSO /* The driver DSO must have exactly the same lifetime as the * drivers hash table; ignore the passed-in pool */ - pool = apr_hash_pool_get(drivers); + rootp = apr_hash_pool_get(drivers); #if defined(NETWARE) apr_snprintf(modname, sizeof(modname), "crypto%s.nlm", name); @@ -239,21 +241,19 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( "apr_crypto_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".so", name); #endif apr_snprintf(symname, sizeof(symname), "apr_crypto_%s_driver", name); - rv = apu_dso_load(&dso, &symbol, modname, symname, pool); + rv = apu_dso_load(&dso, &symbol, modname, symname, rootp); if (rv == APR_SUCCESS || rv == APR_EINIT) { /* previously loaded?!? */ apr_crypto_driver_t *d = symbol; rv = APR_SUCCESS; if (d->init) { - rv = d->init(pool, params, result); + rv = d->init(rootp, params, result); if (rv == APR_EREINIT) { rv = APR_SUCCESS; } } if (rv == APR_SUCCESS) { - *driver = symbol; - name = apr_pstrdup(pool, name); - apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver); - rv = APR_SUCCESS; + apr_hash_set(drivers, d->name, APR_HASH_KEY_STRING, d); + *driver = d; } } apu_dso_mutex_unlock(); @@ -274,32 +274,38 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver( /* Load statically-linked drivers: */ #if APU_HAVE_OPENSSL - if (name[0] == 'o' && !strcmp(name, "openssl")) { + if (!strcmp(name, "openssl")) { DRIVER_LOAD("openssl", apr_crypto_openssl_driver, pool, params, rv, result); } + else #endif #if APU_HAVE_NSS - if (name[0] == 'n' && !strcmp(name, "nss")) { + if (!strcmp(name, "nss")) { DRIVER_LOAD("nss", apr_crypto_nss_driver, pool, params, rv, result); } + else #endif #if APU_HAVE_COMMONCRYPTO - if (name[0] == 'c' && !strcmp(name, "commoncrypto")) { + if (!strcmp(name, "commoncrypto")) { DRIVER_LOAD("commoncrypto", apr_crypto_commoncrypto_driver, pool, params, rv, result); } + else #endif #if APU_HAVE_MSCAPI - if (name[0] == 'm' && !strcmp(name, "mscapi")) { + if (!strcmp(name, "mscapi")) { DRIVER_LOAD("mscapi", apr_crypto_mscapi_driver, pool, params, rv, result); } + else #endif #if APU_HAVE_MSCNG - if (name[0] == 'm' && !strcmp(name, "mscng")) { + if (!strcmp(name, "mscng")) { DRIVER_LOAD("mscng", apr_crypto_mscng_driver, pool, params, rv, result); } + else #endif + ; -#endif +#endif /* !APR_HAVE_MODULAR_DSO */ return rv; } @@ -407,7 +413,7 @@ APR_DECLARE(apr_status_t) apr_crypto_lib_init(const char *name, apr_pool_t *pool) { apr_status_t rv; - apr_pool_t *rootp, *p; + apr_pool_t *rootp; struct crypto_lib *lib; if (!name) { @@ -419,7 +425,11 @@ APR_DECLARE(apr_status_t) apr_crypto_lib_init(const char *name, } rootp = pool; - while ((p = apr_pool_parent_get(rootp))) { + for (;;) { + apr_pool_t *p = apr_pool_parent_get(rootp); + if (!p || p == rootp) { + break; + } rootp = p; } @@ -495,8 +505,10 @@ APR_DECLARE(apr_status_t) apr_crypto_lib_init(const char *name, if (rv == APR_SUCCESS) { lib->pool = pool; apr_hash_set(active_libs, lib->name, APR_HASH_KEY_STRING, lib); - apr_pool_cleanup_register(lib->pool, lib, crypto_lib_cleanup, - apr_pool_cleanup_null); + if (apr_pool_parent_get(pool)) { + apr_pool_cleanup_register(pool, lib, crypto_lib_cleanup, + apr_pool_cleanup_null); + } } else { spare_lib_push(lib); @@ -513,6 +525,9 @@ static apr_status_t crypto_lib_term(const char *name) if (!lib) { return APR_EINIT; } + if (!apr_pool_parent_get(lib->pool)) { + return APR_EBUSY; + } rv = APR_ENOTIMPL; #if APU_HAVE_OPENSSL @@ -560,12 +575,15 @@ APR_DECLARE(apr_status_t) apr_crypto_lib_term(const char *name) } if (!name) { + apr_status_t rv = APR_SUCCESS; apr_hash_index_t *hi = apr_hash_first(NULL, active_libs); for (; hi; hi = apr_hash_next(hi)) { - name = apr_hash_this_key(hi); - crypto_lib_term(name); + apr_status_t rt = crypto_lib_term(apr_hash_this_key(hi)); + if (rt != APR_SUCCESS && (rv == APR_SUCCESS || rv == APR_EBUSY)) { + rv = rt; + } } - return APR_SUCCESS; + return rv; } return crypto_lib_term(name); diff --git a/crypto/apr_crypto_internal.c b/crypto/apr_crypto_internal.c index 09148e386d9..3f09f417f07 100644 --- a/crypto/apr_crypto_internal.c +++ b/crypto/apr_crypto_internal.c @@ -284,8 +284,8 @@ const char *apr__crypto_mscng_version(void) } apr_status_t apr__crypto_mscng_init(const char *params, - const apu_err_t **result, - apr_pool_t *pool) + const apu_err_t **result, + apr_pool_t *pool) { return APR_ENOTIMPL; } diff --git a/test/testcrypto.c b/test/testcrypto.c index e2509545058..7c8a7c95e58 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -559,7 +559,10 @@ static void test_crypto_init(abts_case *tc, void *data) apr_pool_create(&pool, NULL); - rv = apr_crypto_init(pool); + /* Use root pool (top level init) so that the crypto lib is + * not cleanup on pool destroy below (e.g. openssl can't re-init). + */ + rv = apr_crypto_init(apr_pool_parent_get(pool)); ABTS_ASSERT(tc, "failed to init apr_crypto", rv == APR_SUCCESS); apr_pool_destroy(pool); @@ -1680,7 +1683,7 @@ abts_suite *testcrypto(abts_suite *suite) { suite = ADD_SUITE(suite); - /* test simple init and shutdown */ + /* test simple init and shutdown (keep first) */ abts_run_test(suite, test_crypto_init, NULL); /* test key parsing - openssl */ diff --git a/util-misc/apu_dso.c b/util-misc/apu_dso.c index dd29076eb73..83ab33eca4b 100644 --- a/util-misc/apu_dso.c +++ b/util-misc/apu_dso.c @@ -106,6 +106,11 @@ apr_status_t apu_dso_init(apr_pool_t *pool) return ret; } +struct dso_entry { + apr_dso_handle_t *handle; + apr_dso_handle_sym_t *sym; +}; + apr_status_t apu_dso_load(apr_dso_handle_t **dlhandleptr, apr_dso_handle_sym_t *dsoptr, const char *module, @@ -118,11 +123,14 @@ apr_status_t apu_dso_load(apr_dso_handle_t **dlhandleptr, apr_array_header_t *paths; apr_pool_t *global; apr_status_t rv = APR_EDSOOPEN; + struct dso_entry *entry; char *eos = NULL; int i; - *dsoptr = apr_hash_get(dsos, module, APR_HASH_KEY_STRING); - if (*dsoptr) { + entry = apr_hash_get(dsos, module, APR_HASH_KEY_STRING); + if (entry) { + *dlhandleptr = entry->handle; + *dsoptr = entry->sym; return APR_EINIT; } @@ -199,7 +207,10 @@ apr_status_t apu_dso_load(apr_dso_handle_t **dlhandleptr, } else { module = apr_pstrdup(global, module); - apr_hash_set(dsos, module, APR_HASH_KEY_STRING, *dsoptr); + entry = apr_palloc(global, sizeof(*entry)); + entry->handle = dlhandle; + entry->sym = *dsoptr; + apr_hash_set(dsos, module, APR_HASH_KEY_STRING, entry); } return rv; } From eb9f474649774d388b572d33a932d111e4d43cdb Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 15 Jun 2018 14:43:32 +0000 Subject: [PATCH 7789/7878] apr_crypto: LibreSSL compatibility. It's clearer address openssl vs libressl discrepancies with LIBRESSL_VERSION checks in the code than defining the misleading APR_USE_OPENSSL_PRE_1_1_API in multiple places (openssl-1.1 API compatibility is missing for all libressl versions, and the APR cases are simple for now). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833599 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_internal.c | 25 ++++++++----------------- crypto/apr_crypto_openssl.c | 20 ++++---------------- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/crypto/apr_crypto_internal.c b/crypto/apr_crypto_internal.c index 3f09f417f07..6b4c1c9eb32 100644 --- a/crypto/apr_crypto_internal.c +++ b/crypto/apr_crypto_internal.c @@ -31,18 +31,6 @@ #include #include -#ifndef APR_USE_OPENSSL_PRE_1_1_API -#if defined(LIBRESSL_VERSION_NUMBER) -/* LibreSSL declares OPENSSL_VERSION_NUMBER == 2.0 but does not include most - * changes from OpenSSL >= 1.1 (new functions, macros, deprecations, ...), so - * we have to work around this... - */ -#define APR_USE_OPENSSL_PRE_1_1_API (1) -#else -#define APR_USE_OPENSSL_PRE_1_1_API (OPENSSL_VERSION_NUMBER < 0x10100000L) -#endif -#endif - const char *apr__crypto_openssl_version(void) { return OPENSSL_VERSION_TEXT; @@ -52,9 +40,10 @@ apr_status_t apr__crypto_openssl_init(const char *params, const apu_err_t **result, apr_pool_t *pool) { -#if APR_USE_OPENSSL_PRE_1_1_API + /* Both undefined (or no-op) with LibreSSL */ +#if OPENSSL_VERSION_NUMBER < 0x10100000L CRYPTO_malloc_init(); -#else +#elif !defined(LIBRESSL_VERSION_NUMBER) OPENSSL_malloc_init(); #endif ERR_load_crypto_strings(); @@ -67,7 +56,7 @@ apr_status_t apr__crypto_openssl_init(const char *params, apr_status_t apr__crypto_openssl_term(void) { -#if APR_USE_OPENSSL_PRE_1_1_API +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) #ifdef OPENSSL_FIPS FIPS_mode_set(0); @@ -75,7 +64,9 @@ apr_status_t apr__crypto_openssl_term(void) CONF_modules_unload(1); OBJ_cleanup(); EVP_cleanup(); +#if !defined(LIBRESSL_VERSION_NUMBER) RAND_cleanup(); +#endif ENGINE_cleanup(); #ifndef OPENSSL_NO_COMP COMP_zlib_cleanup(); @@ -88,9 +79,9 @@ apr_status_t apr__crypto_openssl_term(void) ERR_free_strings(); CRYPTO_cleanup_all_ex_data(); -#else /* !APR_USE_OPENSSL_PRE_1_1_API */ +#else /* OPENSSL_VERSION_NUMBER >= 0x10100000L */ OPENSSL_cleanup(); -#endif /* !APR_USE_OPENSSL_PRE_1_1_API */ +#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */ return APR_SUCCESS; } diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index 7d969924226..c4b06ab051b 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -37,18 +37,6 @@ #define LOG_PREFIX "apr_crypto_openssl: " -#ifndef APR_USE_OPENSSL_PRE_1_1_API -#if defined(LIBRESSL_VERSION_NUMBER) -/* LibreSSL declares OPENSSL_VERSION_NUMBER == 2.0 but does not include most - * changes from OpenSSL >= 1.1 (new functions, macros, deprecations, ...), so - * we have to work around this... - */ -#define APR_USE_OPENSSL_PRE_1_1_API (1) -#else -#define APR_USE_OPENSSL_PRE_1_1_API (OPENSSL_VERSION_NUMBER < 0x10100000L) -#endif -#endif - struct apr_crypto_t { apr_pool_t *pool; const apr_crypto_driver_t *provider; @@ -689,7 +677,7 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, if (!EVP_EncryptUpdate(ctx->cipherCtx, (*out), &outl, (unsigned char *) in, inlen)) { #endif -#if APR_USE_OPENSSL_PRE_1_1_API +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); #else EVP_CIPHER_CTX_reset(ctx->cipherCtx); @@ -732,7 +720,7 @@ static apr_status_t crypto_block_encrypt_finish(unsigned char *out, else { *outlen = len; } -#if APR_USE_OPENSSL_PRE_1_1_API +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); #else EVP_CIPHER_CTX_reset(ctx->cipherCtx); @@ -859,7 +847,7 @@ static apr_status_t crypto_block_decrypt(unsigned char **out, if (!EVP_DecryptUpdate(ctx->cipherCtx, *out, &outl, (unsigned char *) in, inlen)) { #endif -#if APR_USE_OPENSSL_PRE_1_1_API +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); #else EVP_CIPHER_CTX_reset(ctx->cipherCtx); @@ -902,7 +890,7 @@ static apr_status_t crypto_block_decrypt_finish(unsigned char *out, else { *outlen = len; } -#if APR_USE_OPENSSL_PRE_1_1_API +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); #else EVP_CIPHER_CTX_reset(ctx->cipherCtx); From ffb6815e17ffcb2d8e1bbb2f1a94ab6e846417f0 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 21 Jun 2018 10:52:18 +0000 Subject: [PATCH 7790/7878] apr_crypto: follow up to r1833359: consistent apr_crypto_random_ prefix. Was not for apr_crypto_thread_random_bytes(), so align with other functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833993 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_prng.c | 2 +- include/apr_crypto.h | 2 +- test/testcrypto.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto/apr_crypto_prng.c b/crypto/apr_crypto_prng.c index 2c2f15f2db1..4b302fb3303 100644 --- a/crypto/apr_crypto_prng.c +++ b/crypto/apr_crypto_prng.c @@ -231,7 +231,7 @@ APR_DECLARE(apr_status_t) apr_crypto_random_bytes(void *buf, apr_size_t len) } #if APR_HAS_THREADS -APR_DECLARE(apr_status_t) apr_crypto_thread_random_bytes(void *buf, +APR_DECLARE(apr_status_t) apr_crypto_random_thread_bytes(void *buf, apr_size_t len) { apr_status_t rv; diff --git a/include/apr_crypto.h b/include/apr_crypto.h index 9a615410304..f8627b937bc 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -582,7 +582,7 @@ APR_DECLARE(apr_status_t) apr_crypto_random_bytes(void *buf, apr_size_t len); * called without \ref APR_CRYPTO_PRNG_PER_THREAD, * any system error (APR_ENOMEM, ...). */ -APR_DECLARE(apr_status_t) apr_crypto_thread_random_bytes(void *buf, +APR_DECLARE(apr_status_t) apr_crypto_random_thread_bytes(void *buf, apr_size_t len); #endif diff --git a/test/testcrypto.c b/test/testcrypto.c index 7c8a7c95e58..2789adcb065 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -1635,7 +1635,7 @@ static void *APR_THREAD_FUNC thread_func(apr_thread_t *thd, void *data) unsigned char *randbytes = data; apr_status_t rv; - rv = apr_crypto_thread_random_bytes(randbytes, 800); + rv = apr_crypto_random_thread_bytes(randbytes, 800); apr_thread_exit(thd, rv); return NULL; @@ -1663,7 +1663,7 @@ static void test_crypto_thread_random(abts_case *tc, void *data) for (i = 0; i < NUM_THREADS; ++i) { rv = apr_thread_join(&ret, threads[i]); ABTS_ASSERT(tc, "apr_thread_join failed", rv == APR_SUCCESS); - ABTS_ASSERT(tc, "apr_crypto_thread_random_bytes failed", + ABTS_ASSERT(tc, "apr_crypto_random_thread_bytes failed", ret == APR_SUCCESS); } for (i = 0; i < NUM_THREADS; ++i) { From 18e62eec59c060013d1f8b82ecd01d60d7945be8 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 21 Jun 2018 11:00:49 +0000 Subject: [PATCH 7791/7878] apr_crypto: follow up to r1833599: simpler #ifdef-ery. Turn multiple checks for {Open,Libre}SSL versions into a single one by: #define EVP_CIPHER_CTX_reset EVP_CIPHER_CTX_cleanup when needed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833995 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_openssl.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index c4b06ab051b..b7bed223a10 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -37,6 +37,10 @@ #define LOG_PREFIX "apr_crypto_openssl: " +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) +#define EVP_CIPHER_CTX_reset EVP_CIPHER_CTX_cleanup +#endif + struct apr_crypto_t { apr_pool_t *pool; const apr_crypto_driver_t *provider; @@ -677,11 +681,7 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, if (!EVP_EncryptUpdate(ctx->cipherCtx, (*out), &outl, (unsigned char *) in, inlen)) { #endif -#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); -#else EVP_CIPHER_CTX_reset(ctx->cipherCtx); -#endif return APR_ECRYPT; } *outlen = outl; @@ -720,11 +720,7 @@ static apr_status_t crypto_block_encrypt_finish(unsigned char *out, else { *outlen = len; } -#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); -#else EVP_CIPHER_CTX_reset(ctx->cipherCtx); -#endif return rc; @@ -847,11 +843,7 @@ static apr_status_t crypto_block_decrypt(unsigned char **out, if (!EVP_DecryptUpdate(ctx->cipherCtx, *out, &outl, (unsigned char *) in, inlen)) { #endif -#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); -#else EVP_CIPHER_CTX_reset(ctx->cipherCtx); -#endif return APR_ECRYPT; } *outlen = outl; @@ -890,11 +882,7 @@ static apr_status_t crypto_block_decrypt_finish(unsigned char *out, else { *outlen = len; } -#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); -#else EVP_CIPHER_CTX_reset(ctx->cipherCtx); -#endif return rc; From 6aa161a464e3881360e49aac4b07718c6eb44a96 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 21 Jun 2018 12:44:03 +0000 Subject: [PATCH 7792/7878] apr_crypto_prng API backported to 1.7.x. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834006 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGES b/CHANGES index 1922c5b7ed0..ae24bb443e6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,6 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 - *) New apr_crypto_prng API and apr_crypto[_thread]_random_bytes() functions. - [Yann Ylavic] - *) apr_file_write: Optimize large reads from buffered files on Windows. [Evgeny Kotkov] From f17239503770cf6a531bc0d1d4bd599d03badbad Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 21 Jun 2018 14:26:56 +0000 Subject: [PATCH 7793/7878] apr_reslist: test for ttl = 0 The current reslist implementation handles ttl=0 as no TTL when acquiring resources (expected and documented), but as zero TTL when releasing (immediate expiry, so resources are never recycled). This commit adds a test to validate the upcoming fix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834022 13f79535-47bb-0310-9956-ffa450edef68 --- test/testreslist.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/test/testreslist.c b/test/testreslist.c index 36333a1533e..78c908d2bfc 100644 --- a/test/testreslist.c +++ b/test/testreslist.c @@ -258,6 +258,44 @@ static void test_reslist(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } +static void test_reslist_no_ttl(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_reslist_t *rl; + my_parameters_t *params; + my_resource_t *res; + + /* Parameters (sleep not used) */ + params = apr_pcalloc(p, sizeof(*params)); + + rv = apr_reslist_create(&rl, + /*no min*/0, /*no smax*/0, /*max*/1, /*no ttl*/0, + my_constructor, my_destructor, params, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + /* Acquire/contruct one resource */ + rv = apr_reslist_acquire(rl, (void **)&res); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 0, res->id); + + /* Release it before next check */ + rv = apr_reslist_release(rl, res); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + /* Re-acquire/release: the resource should be the same */ + rv = apr_reslist_acquire(rl, (void **)&res); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, 0, res->id); + + /* Release it before cleanup */ + rv = apr_reslist_release(rl, res); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_reslist_destroy(rl); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_INT_EQUAL(tc, params->d_count, 1); +} + #endif /* APR_HAS_THREADS */ abts_suite *testreslist(abts_suite *suite) @@ -266,6 +304,7 @@ abts_suite *testreslist(abts_suite *suite) #if APR_HAS_THREADS abts_run_test(suite, test_reslist, NULL); + abts_run_test(suite, test_reslist_no_ttl, NULL); #endif return suite; From 1bcd3779da92abbbc625297914fa08ed712eaa47 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 21 Jun 2018 14:35:17 +0000 Subject: [PATCH 7794/7878] apr_reslist: fix release of resource with zero/no TTL. Ignore expiry when ttl=0 in apr_reslist_maintain(), like apr_reslist_acquire(). While ttl=0 is supposed to mean no TTL/expiry, apr_reslist_maintain() hence apr_reslist_release() were destroying all resources in this case. Corresponding test already committed in r1834022. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834023 13f79535-47bb-0310-9956-ffa450edef68 --- util-misc/apr_reslist.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c index ecc17a7d4d6..0373fbc53fd 100644 --- a/util-misc/apr_reslist.c +++ b/util-misc/apr_reslist.c @@ -212,8 +212,10 @@ APR_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist) created_one++; } - /* We don't need to see if we're over the max if we were under it before */ - if (created_one) { + /* We don't need to see if we're over the max if we were under it before, + * nor need we check for expiry if no ttl is configure. + */ + if (created_one || !reslist->ttl) { #if APR_HAS_THREADS apr_thread_mutex_unlock(reslist->listlock); #endif From 78424581018bbe9a9d7a03cb895b64360fc8f50d Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 21 Jun 2018 14:45:47 +0000 Subject: [PATCH 7795/7878] apr_reslist: follow up to r1834023: avoid unnecessary apr_time_now() calls. When ttl=0 is configured, we never need to check for expiry. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834024 13f79535-47bb-0310-9956-ffa450edef68 --- util-misc/apr_reslist.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c index 0373fbc53fd..3a146d74682 100644 --- a/util-misc/apr_reslist.c +++ b/util-misc/apr_reslist.c @@ -81,7 +81,9 @@ static apr_res_t *pop_resource(apr_reslist_t *reslist) static void push_resource(apr_reslist_t *reslist, apr_res_t *resource) { APR_RING_INSERT_HEAD(&reslist->avail_list, resource, apr_res_t, link); - resource->freed = apr_time_now(); + if (reslist->ttl) { + resource->freed = apr_time_now(); + } reslist->nidle++; } @@ -332,7 +334,7 @@ APR_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, { apr_status_t rv; apr_res_t *res; - apr_time_t now; + apr_time_t now = 0; #if APR_HAS_THREADS apr_thread_mutex_lock(reslist->listlock); @@ -340,7 +342,9 @@ APR_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, #endif /* If there are idle resources on the available list, use * them right away. */ - now = apr_time_now(); + if (reslist->ttl) { + now = apr_time_now(); + } while (reslist->nidle > 0) { /* Pop off the first resource */ res = pop_resource(reslist); From e91d0b60273bdbca5b842eb7793938edee6fa091 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 21 Jun 2018 17:06:34 +0000 Subject: [PATCH 7796/7878] apr_reslist: always expire oldest entries first. When a resource is to be acquired, we should check for expiring entries starting from the oldest to the youngest one, otherwise it's only when the latter expires that all of the resources are killed in a batch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834030 13f79535-47bb-0310-9956-ffa450edef68 --- util-misc/apr_reslist.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c index 3a146d74682..7b6ff3507ea 100644 --- a/util-misc/apr_reslist.c +++ b/util-misc/apr_reslist.c @@ -227,14 +227,14 @@ APR_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist) /* Check if we need to expire old resources */ now = apr_time_now(); while (reslist->nidle > reslist->smax && reslist->nidle > 0) { - /* Peak at the last resource in the list */ + /* Peek at the oldest resource in the list */ res = APR_RING_LAST(&reslist->avail_list); - /* See if the oldest entry should be expired */ if (now - res->freed < reslist->ttl) { /* If this entry is too young, none of the others * will be ready to be expired either, so we are done. */ break; } + /* this res is expired - kill it */ APR_RING_REMOVE(res, link); reslist->nidle--; reslist->ntotal--; @@ -334,22 +334,26 @@ APR_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, { apr_status_t rv; apr_res_t *res; - apr_time_t now = 0; #if APR_HAS_THREADS apr_thread_mutex_lock(reslist->listlock); apr_pool_owner_set(reslist->pool, 0); #endif - /* If there are idle resources on the available list, use + /* If there are expired resources in the available list, kill * them right away. */ - if (reslist->ttl) { - now = apr_time_now(); - } - while (reslist->nidle > 0) { - /* Pop off the first resource */ - res = pop_resource(reslist); - if (reslist->ttl && (now - res->freed >= reslist->ttl)) { + if (reslist->ttl && reslist->nidle > 0) { + apr_time_t now = apr_time_now(); + do { + /* Peek at the oldest resource in the list */ + res = APR_RING_LAST(&reslist->avail_list); + if (now - res->freed < reslist->ttl) { + /* If this entry is too young, none of the others + * will be ready to be expired either, so we are done. */ + break; + } /* this res is expired - kill it */ + APR_RING_REMOVE(res, link); + reslist->nidle--; reslist->ntotal--; rv = destroy_resource(reslist, res); free_container(reslist, res); @@ -359,8 +363,11 @@ APR_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, #endif return rv; /* FIXME: this might cause unnecessary fails */ } - continue; - } + } while (reslist->nidle > 0); + } + /* If there is still an idle resource, use it right away */ + if (reslist->nidle > 0) { + res = pop_resource(reslist); *resource = res->opaque; free_container(reslist, res); #if APR_HAS_THREADS From 554dbca27f8f9a11332627bd25e441f744905839 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 21 Jun 2018 17:37:31 +0000 Subject: [PATCH 7797/7878] apr_reslist: add apr_reslist_acquire_ex(). Allows to control acquire order, either LIFO (default and current behaviour) or FIFO. Associated test upcoming... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834034 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_reslist.h | 20 +++++++++++++++++++- util-misc/apr_reslist.c | 39 +++++++++++++++++++++++++++++++-------- 3 files changed, 53 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index ae24bb443e6..fdd532e2aa1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add apr_reslist_acquire_ex() which allows to control acquire order, + that is LIFO (default) or FIFO. [Yann Ylavic] + *) apr_file_write: Optimize large reads from buffered files on Windows. [Evgeny Kotkov] diff --git a/include/apr_reslist.h b/include/apr_reslist.h index 4e09e12aacb..85e5258217b 100644 --- a/include/apr_reslist.h +++ b/include/apr_reslist.h @@ -107,8 +107,26 @@ APR_DECLARE(apr_status_t) apr_reslist_create(apr_reslist_t **reslist, */ APR_DECLARE(apr_status_t) apr_reslist_destroy(apr_reslist_t *reslist); +/* Acquire order modes */ +#define APR_RESLIST_ACQUIRE_LIFO 0x0 +#define APR_RESLIST_ACQUIRE_FIFO 0x1 +#define APR_RESLIST_ACQUIRE_MASK 0x1 + +/** + * Retrieve a resource from the list, either the oldest (FIFO) or + * latest (LIFO), creating a new one if necessary. + * If we have met our maximum number of resources, we will block + * until one becomes available. + * @param reslist The resource list. + * @param resource An address where the pointer to the resource + * will be stored. + * @param flags Bitmask of APR_RESLIST_ACQUIRE_* flags. + */ +APR_DECLARE(apr_status_t) apr_reslist_acquire_ex(apr_reslist_t *reslist, + void **resource, int flags); + /** - * Retrieve a resource from the list, creating a new one if necessary. + * Retrieve the latest resource from the list, creating a new one if necessary. * If we have met our maximum number of resources, we will block * until one becomes available. * @param reslist The resource list. diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c index 7b6ff3507ea..dadc3529a59 100644 --- a/util-misc/apr_reslist.c +++ b/util-misc/apr_reslist.c @@ -61,13 +61,18 @@ struct apr_reslist_t { }; /** - * Grab a resource from the front of the resource list. + * Grab a resource from the resource list, latest or oldest depending on fifo. * Assumes: that the reslist is locked. */ -static apr_res_t *pop_resource(apr_reslist_t *reslist) +static apr_res_t *pop_resource(apr_reslist_t *reslist, int fifo) { apr_res_t *res; - res = APR_RING_FIRST(&reslist->avail_list); + if (fifo) { + res = APR_RING_LAST(&reslist->avail_list); + } + else { + res = APR_RING_FIRST(&reslist->avail_list); + } APR_RING_REMOVE(res, link); reslist->nidle--; return res; @@ -150,7 +155,7 @@ static apr_status_t reslist_cleanup(void *data_) while (rl->nidle > 0) { apr_status_t rv1; - res = pop_resource(rl); + res = pop_resource(rl, 0); rl->ntotal--; rv1 = destroy_resource(rl, res); if (rv1 != APR_SUCCESS) { @@ -329,11 +334,17 @@ APR_DECLARE(apr_status_t) apr_reslist_destroy(apr_reslist_t *reslist) return apr_pool_cleanup_run(reslist->pool, reslist, reslist_cleanup); } -APR_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, - void **resource) +static apr_status_t reslist_acquire(apr_reslist_t *reslist, + void **resource, int flags) { apr_status_t rv; apr_res_t *res; + int fifo; + + if (flags & ~APR_RESLIST_ACQUIRE_MASK) { + return APR_EINVAL; + } + fifo = flags & APR_RESLIST_ACQUIRE_FIFO; #if APR_HAS_THREADS apr_thread_mutex_lock(reslist->listlock); @@ -367,7 +378,7 @@ APR_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, } /* If there is still an idle resource, use it right away */ if (reslist->nidle > 0) { - res = pop_resource(reslist); + res = pop_resource(reslist, fifo); *resource = res->opaque; free_container(reslist, res); #if APR_HAS_THREADS @@ -396,7 +407,7 @@ APR_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, /* If we popped out of the loop, first try to see if there * are new resources available for immediate use. */ if (reslist->nidle > 0) { - res = pop_resource(reslist); + res = pop_resource(reslist, fifo); *resource = res->opaque; free_container(reslist, res); #if APR_HAS_THREADS @@ -421,6 +432,18 @@ APR_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, } } +APR_DECLARE(apr_status_t) apr_reslist_acquire_ex(apr_reslist_t *reslist, + void **resource, int flags) +{ + return reslist_acquire(reslist, resource, flags); +} + +APR_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, + void **resource) +{ + return reslist_acquire(reslist, resource, 0); +} + APR_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, void *resource) { From 17d4a7dbe7d44f8bd90ddeb1e67e16c11cfdd1f1 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 21 Jun 2018 21:40:29 +0000 Subject: [PATCH 7798/7878] Reduce reslist test execution time. It takes almost 2 minutes with 250 iterations, using 100 iterations takes around 40 seconds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834057 13f79535-47bb-0310-9956-ffa450edef68 --- test/testreslist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testreslist.c b/test/testreslist.c index 78c908d2bfc..eef848f2fa6 100644 --- a/test/testreslist.c +++ b/test/testreslist.c @@ -36,7 +36,7 @@ #define RESLIST_HMAX 20 #define RESLIST_TTL APR_TIME_C(35000) /* 35 ms */ #define CONSUMER_THREADS 25 -#define CONSUMER_ITERATIONS 250 +#define CONSUMER_ITERATIONS 100 #define CONSTRUCT_SLEEP_TIME APR_TIME_C(25000) /* 25 ms */ #define DESTRUCT_SLEEP_TIME APR_TIME_C(10000) /* 10 ms */ #define WORK_DELAY_SLEEP_TIME APR_TIME_C(15000) /* 15 ms */ From 818ed2f12fa230a9df33cda6eee5407ac1e46989 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 21 Jun 2018 21:49:40 +0000 Subject: [PATCH 7799/7878] apr_reslist: don't release/re-acquire the mutex in apr_reslist_release(). We can hold the mutex for the whole release time by adding and using an unlocked reslist_maintain() helper, and ensure more fairness for the releaser. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834061 13f79535-47bb-0310-9956-ffa450edef68 --- util-misc/apr_reslist.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c index dadc3529a59..76e35c349b5 100644 --- a/util-misc/apr_reslist.c +++ b/util-misc/apr_reslist.c @@ -181,27 +181,19 @@ static apr_status_t reslist_cleanup(void *data_) * Perform routine maintenance on the resource list. This call * may instantiate new resources or expire old resources. */ -APR_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist) +static apr_status_t reslist_maintain(apr_reslist_t *reslist) { apr_time_t now; apr_status_t rv; apr_res_t *res; int created_one = 0; -#if APR_HAS_THREADS - apr_thread_mutex_lock(reslist->listlock); - apr_pool_owner_set(reslist->pool, 0); -#endif - /* Check if we need to create more resources, and if we are allowed to. */ while (reslist->nidle < reslist->min && reslist->ntotal < reslist->hmax) { /* Create the resource */ rv = create_resource(reslist, &res); if (rv != APR_SUCCESS) { free_container(reslist, res); -#if APR_HAS_THREADS - apr_thread_mutex_unlock(reslist->listlock); -#endif return rv; } /* Add it to the list */ @@ -212,7 +204,6 @@ APR_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist) #if APR_HAS_THREADS rv = apr_thread_cond_signal(reslist->avail); if (rv != APR_SUCCESS) { - apr_thread_mutex_unlock(reslist->listlock); return rv; } #endif @@ -223,9 +214,6 @@ APR_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist) * nor need we check for expiry if no ttl is configure. */ if (created_one || !reslist->ttl) { -#if APR_HAS_THREADS - apr_thread_mutex_unlock(reslist->listlock); -#endif return APR_SUCCESS; } @@ -246,17 +234,26 @@ APR_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist) rv = destroy_resource(reslist, res); free_container(reslist, res); if (rv != APR_SUCCESS) { -#if APR_HAS_THREADS - apr_thread_mutex_unlock(reslist->listlock); -#endif return rv; } } + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist) +{ + apr_status_t rv; + +#if APR_HAS_THREADS + apr_thread_mutex_lock(reslist->listlock); + apr_pool_owner_set(reslist->pool, 0); +#endif + rv = reslist_maintain(reslist); #if APR_HAS_THREADS apr_thread_mutex_unlock(reslist->listlock); #endif - return APR_SUCCESS; + return rv; } APR_DECLARE(apr_status_t) apr_reslist_create(apr_reslist_t **reslist, @@ -313,7 +310,7 @@ APR_DECLARE(apr_status_t) apr_reslist_create(apr_reslist_t **reslist, } #endif - rv = apr_reslist_maintain(rl); + rv = reslist_maintain(rl); if (rv != APR_SUCCESS) { /* Destroy what we've created so far. */ @@ -447,6 +444,7 @@ APR_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, APR_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, void *resource) { + apr_status_t rv; apr_res_t *res; #if APR_HAS_THREADS @@ -458,10 +456,12 @@ APR_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, push_resource(reslist, res); #if APR_HAS_THREADS apr_thread_cond_signal(reslist->avail); +#endif + rv = reslist_maintain(reslist); +#if APR_HAS_THREADS apr_thread_mutex_unlock(reslist->listlock); #endif - - return apr_reslist_maintain(reslist); + return rv; } APR_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, From 25a651ece6b1d11acfde4babca210d42aeb486a0 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 21 Jun 2018 22:17:48 +0000 Subject: [PATCH 7800/7878] apr_reslist: put common code in push_resource(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834064 13f79535-47bb-0310-9956-ffa450edef68 --- util-misc/apr_reslist.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/util-misc/apr_reslist.c b/util-misc/apr_reslist.c index 76e35c349b5..7e87be828da 100644 --- a/util-misc/apr_reslist.c +++ b/util-misc/apr_reslist.c @@ -83,13 +83,23 @@ static apr_res_t *pop_resource(apr_reslist_t *reslist, int fifo) * it was added to the list. * Assumes: that the reslist is locked. */ -static void push_resource(apr_reslist_t *reslist, apr_res_t *resource) +static apr_status_t push_resource(apr_reslist_t *reslist, + apr_res_t *resource, int new) { APR_RING_INSERT_HEAD(&reslist->avail_list, resource, apr_res_t, link); if (reslist->ttl) { resource->freed = apr_time_now(); } reslist->nidle++; + if (new) { + reslist->ntotal++; + } +#if APR_HAS_THREADS + /* If someone is waiting on that guy, wake them up. */ + return apr_thread_cond_signal(reslist->avail); +#else + return APR_SUCCESS; +#endif } /** @@ -197,16 +207,10 @@ static apr_status_t reslist_maintain(apr_reslist_t *reslist) return rv; } /* Add it to the list */ - push_resource(reslist, res); - /* Update our counters */ - reslist->ntotal++; - /* If someone is waiting on that guy, wake them up. */ -#if APR_HAS_THREADS - rv = apr_thread_cond_signal(reslist->avail); + rv = push_resource(reslist, res, 1); if (rv != APR_SUCCESS) { return rv; } -#endif created_one++; } @@ -453,10 +457,7 @@ APR_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, #endif res = get_container(reslist); res->opaque = resource; - push_resource(reslist, res); -#if APR_HAS_THREADS - apr_thread_cond_signal(reslist->avail); -#endif + push_resource(reslist, res, 0); rv = reslist_maintain(reslist); #if APR_HAS_THREADS apr_thread_mutex_unlock(reslist->listlock); From 87c696f9d9da07ac3610d75296aa755bb59ce4c3 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Sun, 24 Jun 2018 16:14:13 +0000 Subject: [PATCH 7801/7878] Fix some doxygen comments git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834253 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 2 +- include/apr_buckets.h | 2 +- include/apr_skiplist.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 4d9d7622066..7f65f2631c4 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -122,7 +122,7 @@ APR_DECLARE(apr_status_t) apr_allocator_min_order_set(unsigned int order); /** * Get the true size that would be allocated for the given size (including * the header and alignment). - * @param list The allocator from which to the memory would be allocated + * @param allocator The allocator from which to the memory would be allocated * @param size The size to align * @return The aligned size (or zero on apr_size_t overflow) */ diff --git a/include/apr_buckets.h b/include/apr_buckets.h index abecd16ef8a..0208035e1f0 100644 --- a/include/apr_buckets.h +++ b/include/apr_buckets.h @@ -1640,7 +1640,7 @@ APR_DECLARE(apr_status_t) apr_bucket_file_enable_mmap(apr_bucket *b, * @remark Relevant/used only when memory-mapping is disabled (@see * apr_bucket_file_enable_mmap) */ -APR_DECLARE(apr_status_t) apr_bucket_file_set_buf_size(apr_bucket *e, +APR_DECLARE(apr_status_t) apr_bucket_file_set_buf_size(apr_bucket *b, apr_size_t size); /** @} */ diff --git a/include/apr_skiplist.h b/include/apr_skiplist.h index 1e7ab258c44..eeab10bf9f4 100644 --- a/include/apr_skiplist.h +++ b/include/apr_skiplist.h @@ -159,9 +159,9 @@ APR_DECLARE(void *) apr_skiplist_find(apr_skiplist *sl, void *data, apr_skiplist * @param data The value to search for * @param iter A pointer to the returned skip list node representing the element * found - * @param func The comparison function to use + * @param comp The comparison function to use */ -APR_DECLARE(void *) apr_skiplist_last_compare(apr_skiplist *sli, void *data, +APR_DECLARE(void *) apr_skiplist_last_compare(apr_skiplist *sl, void *data, apr_skiplistnode **iter, apr_skiplist_compare comp); From 1695fb3ba5998d1d0bbdcef56e6296039f002e28 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 25 Jun 2018 20:32:37 +0000 Subject: [PATCH 7802/7878] Add the apr_encode_* API that implements RFC4648 and RFC7515 compliant BASE64, BASE64URL, BASE32, BASE32HEX and BASE16 encode/decode functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834371 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 + encoding/apr_encode.c | 1419 ++++++++++++++++++++++++++ encoding/apr_escape.c | 48 +- include/apr_encode.h | 569 +++++++++++ include/apr_escape.h | 13 + include/private/apr_encode_private.h | 84 ++ test/Makefile.in | 2 +- test/abts_tests.h | 1 + test/testencode.c | 1117 ++++++++++++++++++++ test/testutil.h | 1 + 10 files changed, 3213 insertions(+), 45 deletions(-) create mode 100644 encoding/apr_encode.c create mode 100644 include/apr_encode.h create mode 100644 include/private/apr_encode_private.h create mode 100644 test/testencode.c diff --git a/CHANGES b/CHANGES index fdd532e2aa1..ef289085569 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Add the apr_encode_* API that implements RFC4648 and RFC7515 + compliant BASE64, BASE64URL, BASE32, BASE32HEX and BASE16 + encode/decode functions. [Graham Leggett] + *) Add apr_reslist_acquire_ex() which allows to control acquire order, that is LIFO (default) or FIFO. [Yann Ylavic] diff --git a/encoding/apr_encode.c b/encoding/apr_encode.c new file mode 100644 index 00000000000..905185921d9 --- /dev/null +++ b/encoding/apr_encode.c @@ -0,0 +1,1419 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* encode/decode functions. + * + * These functions perform various encoding operations, and are provided in + * pairs, a function to query the length of and encode existing buffers, as + * well as companion functions to perform the same process to memory + * allocated from a pool. + * + * The API is designed to have the smallest possible RAM footprint, and so + * will only allocate the exact amount of RAM needed for each conversion. + */ + +#include "apr_encode.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include "apr_encode_private.h" + +/* lookup table: fast and const should make it shared text page. */ +static const unsigned char pr2six[256] = +{ +#if !APR_CHARSET_EBCDIC + /* ASCII table */ + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 62, 64, 63, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 128, 64, 64, + 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 63, + 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 +#else /* APR_CHARSET_EBCDIC */ + /* EBCDIC table */ + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 62, 63, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 63, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 128, 64, + 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 64, 64, 64, 64, 64, 64, + 64, 35, 36, 37, 38, 39, 40, 41, 42, 43, 64, 64, 64, 64, 64, 64, + 64, 64, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 64, 64, 64, 64, 64, 64, + 64, 9, 10, 11, 12, 13, 14, 15, 16, 17, 64, 64, 64, 64, 64, 64, + 64, 64, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64, 64, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64 +#endif /* APR_CHARSET_EBCDIC */ +}; + +static const unsigned char pr2five[256] = +{ +#if !APR_CHARSET_EBCDIC + /* ASCII table */ + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 26, 27, 28, 29, 30, 31, 32, 32, 32, 32, 32, 128, 32, 32, + 32, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 +#else /* APR_CHARSET_EBCDIC */ + /* EBCDIC table */ + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 128, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 0, 1, 2, 3, 4, 5, 6, 7, 8, 32, 32, 32, 32, 32, 32, + 32, 9, 10, 11, 12, 13, 14, 15, 16, 17, 32, 32, 32, 32, 32, 32, + 32, 32, 18, 19, 20, 21, 22, 23, 24, 25, 32, 32, 32, 32, 32, 32, + 32, 32, 26, 27, 28, 29, 30, 31, 32, 32, 32, 32, 32, 32, 32, 32 +#endif /* APR_CHARSET_EBCDIC */ +}; + +static const unsigned char pr2fivehex[256] = +{ +#if !APR_CHARSET_EBCDIC + /* ASCII table */ + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 32, 32, 32, 128, 32, 32, + 32, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 +#else /* APR_CHARSET_EBCDIC */ + /* EBCDIC table */ + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 128, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 10, 11, 12, 13, 14, 15, 16, 17, 18, 32, 32, 32, 32, 32, 32, + 32, 19, 20, 21, 22, 23, 24, 25, 26, 27, 32, 32, 32, 32, 32, 32, + 32, 32, 28, 29, 30, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 32, 32, 32, 32, 32, 32 +#endif /* APR_CHARSET_EBCDIC */ +}; + +static const unsigned char pr2two[256] = +{ +#if !APR_CHARSET_EBCDIC + /* ASCII table */ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 32, 16, 16, 16, 16, 16, + 16, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 +#else /* APR_CHARSET_EBCDIC */ + /* EBCDIC table */ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 32, 16, 16, 16, 16, 16, + 16, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16, 16, 16, 16, 16, 16 +#endif /* APR_CHARSET_EBCDIC */ +}; + +static const char base64[] = +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +static const char base64url[] = +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + +static const char base32[] = +"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; +static const char base32hex[] = +"0123456789ABCDEFGHIJKLMNOPQRSTUV"; + +static const char base16[] = "0123456789ABCDEF"; +static const char base16lower[] = "0123456789abcdef"; + +APR_DECLARE(apr_status_t) apr_encode_base64(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) +{ + const char *base; + + if (!src) { + return APR_NOTFOUND; + } + + if (APR_ENCODE_STRING == slen) { + slen = strlen(src); + } + + if (dest) { + register char *bufout = dest; + int i; + + if (0 == ((flags & APR_ENCODE_BASE64URL))) { + base = base64; + } + else { + base = base64url; + } + + for (i = 0; i < slen - 2; i += 3) { + *bufout++ = base[ENCODE_TO_ASCII(((src[i]) >> 2) & 0x3F)]; + *bufout++ = base[ENCODE_TO_ASCII((((src[i]) & 0x3) << 4) + | ((int)((src[i + 1]) & 0xF0) >> 4))]; + *bufout++ = base[ENCODE_TO_ASCII((((src[i + 1]) & 0xF) << 2) + | ((int)(ENCODE_TO_ASCII(src[i + 2]) & 0xC0) >> 6))]; + *bufout++ = base[ENCODE_TO_ASCII((src[i + 2]) & 0x3F)]; + } + if (i < slen) { + *bufout++ = base[ENCODE_TO_ASCII(((src[i]) >> 2) & 0x3F)]; + if (i == (slen - 1)) { + *bufout++ = base[ENCODE_TO_ASCII((((src[i]) & 0x3) << 4))]; + if (!(flags & APR_ENCODE_NOPADDING)) { + *bufout++ = '='; + } + } + else { + *bufout++ = base[ENCODE_TO_ASCII((((src[i]) & 0x3) << 4) + | ((int)((src[i + 1]) & 0xF0) >> 4))]; + *bufout++ = base[ENCODE_TO_ASCII(((src[i + 1]) & 0xF) << 2)]; + } + if (!(flags & APR_ENCODE_NOPADDING)) { + *bufout++ = '='; + } + } + + if (len) { + *len = bufout - dest; + } + + *bufout++ = '\0'; + + return APR_SUCCESS; + } + + if (len) { + *len = ((slen + 2) / 3 * 4) + 1; + } + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_encode_base64_binary(char *dest, const unsigned char *src, + apr_ssize_t slen, int flags, apr_size_t * len) +{ + const char *base; + + if (!src) { + return APR_NOTFOUND; + } + + if (dest) { + register char *bufout = dest; + int i; + + if (0 == ((flags & APR_ENCODE_BASE64URL))) { + base = base64; + } + else { + base = base64url; + } + + for (i = 0; i < slen - 2; i += 3) { + *bufout++ = base[(src[i] >> 2) & 0x3F]; + *bufout++ = base[((src[i] & 0x3) << 4) + | ((int)(src[i + 1] & 0xF0) >> 4)]; + *bufout++ = base[((src[i + 1] & 0xF) << 2) + | ((int)(src[i + 2] & 0xC0) >> 6)]; + *bufout++ = base[src[i + 2] & 0x3F]; + } + if (i < slen) { + *bufout++ = base[(src[i] >> 2) & 0x3F]; + if (i == (slen - 1)) { + *bufout++ = base[((src[i] & 0x3) << 4)]; + if (!(flags & APR_ENCODE_NOPADDING)) { + *bufout++ = '='; + } + } + else { + *bufout++ = base[((src[i] & 0x3) << 4) + | ((int)(src[i + 1] & 0xF0) >> 4)]; + *bufout++ = base[((src[i + 1] & 0xF) << 2)]; + } + if (!(flags & APR_ENCODE_NOPADDING)) { + *bufout++ = '='; + } + } + + if (len) { + *len = bufout - dest; + } + + *bufout++ = '\0'; + + return APR_SUCCESS; + } + + if (len) { + *len = ((slen + 2) / 3 * 4) + 1; + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *)apr_pencode_base64(apr_pool_t * p, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) +{ + apr_size_t size; + + switch (apr_encode_base64(NULL, src, slen, flags, &size)) { + case APR_SUCCESS:{ + char *cmd = apr_palloc(p, size); + apr_encode_base64(cmd, src, slen, flags, len); + return cmd; + } + case APR_NOTFOUND:{ + break; + } + } + + return NULL; +} + +APR_DECLARE(const char *)apr_pencode_base64_binary(apr_pool_t * p, const unsigned char *src, + apr_ssize_t slen, int flags, apr_size_t * len) +{ + apr_size_t size; + + switch (apr_encode_base64_binary(NULL, src, slen, flags, &size)) { + case APR_SUCCESS:{ + char *cmd = apr_palloc(p, size); + apr_encode_base64_binary(cmd, src, slen, flags, len); + return cmd; + } + case APR_NOTFOUND:{ + break; + } + } + + return NULL; +} + +APR_DECLARE(apr_status_t) apr_decode_base64(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) +{ + if (!src) { + return APR_NOTFOUND; + } + + if (APR_ENCODE_STRING == slen) { + slen = strlen(src); + } + + if (dest) { + register const unsigned char *bufin; + register unsigned char *bufout; + register apr_size_t nprbytes; + register apr_size_t count = slen; + + apr_status_t status; + + bufin = (const unsigned char *)src; + while (pr2six[*(bufin++)] < 64 && count) + count--; + nprbytes = (bufin - (const unsigned char *)src) - 1; + while (pr2six[*(bufin++)] > 64 && count) + count--; + + status = flags & APR_ENCODE_RELAXED ? APR_SUCCESS : + count ? APR_BADCH : APR_SUCCESS; + + bufout = (unsigned char *)dest; + bufin = (const unsigned char *)src; + + while (nprbytes > 4) { + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE(pr2six[bufin[0]] << 2 + | pr2six[bufin[1]] >> 4); + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE( + pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2); + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE( + pr2six[bufin[2]] << 6 | pr2six[bufin[3]]); + bufin += 4; + nprbytes -= 4; + } + + if (nprbytes == 1) { + status = APR_BADCH; + } + if (nprbytes > 1) { + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE( + pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4); + } + if (nprbytes > 2) { + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE( + pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2); + } + if (nprbytes > 3) { + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE( + pr2six[bufin[2]] << 6 | pr2six[bufin[3]]); + } + + if (len) { + *len = bufout - (unsigned char *)dest; + } + + *(bufout++) = 0; + + return status; + } + + if (len) { + *len = (((int)slen + 3) / 4) * 3 + 1; + } + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_decode_base64_binary(unsigned char *dest, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len) +{ + if (!src) { + return APR_NOTFOUND; + } + + if (APR_ENCODE_STRING == slen) { + slen = strlen(src); + } + + if (dest) { + register const unsigned char *bufin; + register unsigned char *bufout; + register apr_size_t nprbytes; + register apr_size_t count = slen; + + apr_status_t status; + + bufin = (const unsigned char *)src; + while (pr2six[*(bufin++)] < 64 && count) + count--; + nprbytes = (bufin - (const unsigned char *)src) - 1; + while (pr2six[*(bufin++)] > 64 && count) + count--; + + status = flags & APR_ENCODE_RELAXED ? APR_SUCCESS : + count ? APR_BADCH : APR_SUCCESS; + + bufout = (unsigned char *)dest; + bufin = (const unsigned char *)src; + + while (nprbytes > 4) { + *(bufout++) = (unsigned char)(pr2six[bufin[0]] << 2 + | pr2six[bufin[1]] >> 4); + *(bufout++) = (unsigned char)(pr2six[bufin[1]] << 4 + | pr2six[bufin[2]] >> 2); + *(bufout++) = (unsigned char)(pr2six[bufin[2]] << 6 + | pr2six[bufin[3]]); + bufin += 4; + nprbytes -= 4; + } + + if (nprbytes == 1) { + status = APR_BADCH; + } + if (nprbytes > 1) { + *(bufout++) = (unsigned char)(pr2six[bufin[0]] << 2 + | pr2six[bufin[1]] >> 4); + } + if (nprbytes > 2) { + *(bufout++) = (unsigned char)(pr2six[bufin[1]] << 4 + | pr2six[bufin[2]] >> 2); + } + if (nprbytes > 3) { + *(bufout++) = (unsigned char)(pr2six[bufin[2]] << 6 + | pr2six[bufin[3]]); + } + + if (len) { + *len = bufout - dest; + } + + return status; + } + + if (len) { + *len = (((int)slen + 3) / 4) * 3; + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *)apr_pdecode_base64(apr_pool_t * p, const char *str, + apr_ssize_t slen, int flags, apr_size_t * len) +{ + apr_size_t size; + + switch (apr_decode_base64(NULL, str, slen, flags, &size)) { + case APR_SUCCESS:{ + void *cmd = apr_palloc(p, size); + apr_decode_base64(cmd, str, slen, flags, len); + return cmd; + } + case APR_BADCH: + case APR_NOTFOUND:{ + break; + } + } + + return NULL; +} + +APR_DECLARE(const unsigned char *)apr_pdecode_base64_binary(apr_pool_t * p, + const char *str, apr_ssize_t slen, int flags, apr_size_t * len) +{ + apr_size_t size; + + switch (apr_decode_base64_binary(NULL, str, slen, flags, &size)) { + case APR_SUCCESS:{ + unsigned char *cmd = apr_palloc(p, size + 1); + cmd[size] = 0; + apr_decode_base64_binary(cmd, str, slen, flags, len); + return cmd; + } + case APR_BADCH: + case APR_NOTFOUND:{ + break; + } + } + + return NULL; +} + +APR_DECLARE(apr_status_t) apr_encode_base32(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) +{ + const char *base; + + if (!src) { + return APR_NOTFOUND; + } + + if (APR_ENCODE_STRING == slen) { + slen = strlen(src); + } + + if (dest) { + register char *bufout = dest; + int i; + + if (!((flags & APR_ENCODE_BASE32HEX))) { + base = base32; + } + else { + base = base32hex; + } + + for (i = 0; i < slen - 4; i += 5) { + *bufout++ = base[ENCODE_TO_ASCII((src[i] >> 3) & 0x1F)]; + *bufout++ = base[ENCODE_TO_ASCII(((src[i] << 2) & 0x1C) + | ((src[i + 1] >> 6) & 0x3))]; + *bufout++ = base[ENCODE_TO_ASCII((src[i + 1] >> 1) & 0x1F)]; + *bufout++ = base[ENCODE_TO_ASCII(((src[i + 1] << 4) & 0x10) + | ((src[i + 2] >> 4) & 0xF))]; + *bufout++ = base[ENCODE_TO_ASCII(((src[i + 2] << 1) & 0x1E) + | ((src[i + 3] >> 7) & 0x1))]; + *bufout++ = base[ENCODE_TO_ASCII((src[i + 3] >> 2) & 0x1F)]; + *bufout++ = base[ENCODE_TO_ASCII(((src[i + 3] << 3) & 0x18) + | ((src[i + 4] >> 5) & 0x7))]; + *bufout++ = base[ENCODE_TO_ASCII(src[i + 4] & 0x1F)]; + } + if (i < slen) { + *bufout++ = base[ENCODE_TO_ASCII(src[i] >> 3) & 0x1F]; + if (i == (slen - 1)) { + *bufout++ = base[ENCODE_TO_ASCII((src[i] << 2) & 0x1C)]; + if (!(flags & APR_ENCODE_NOPADDING)) { + *bufout++ = '='; + *bufout++ = '='; + *bufout++ = '='; + *bufout++ = '='; + *bufout++ = '='; + *bufout++ = '='; + } + } + else if (i == (slen - 2)) { + *bufout++ = base[ENCODE_TO_ASCII(((src[i] << 2) & 0x1C) + | ((src[i + 1] >> 6) & 0x3))]; + *bufout++ = base[ENCODE_TO_ASCII((src[i + 1] >> 1) & 0x1F)]; + *bufout++ = base[ENCODE_TO_ASCII((src[i + 1] << 4) & 0x10)]; + if (!(flags & APR_ENCODE_NOPADDING)) { + *bufout++ = '='; + *bufout++ = '='; + *bufout++ = '='; + *bufout++ = '='; + } + } + else if (i == (slen - 3)) { + *bufout++ = base[ENCODE_TO_ASCII(((src[i] << 2) & 0x1C) + | ((src[i + 1] >> 6) & 0x3))]; + *bufout++ = base[ENCODE_TO_ASCII((src[i + 1] >> 1) & 0x1F)]; + *bufout++ = base[ENCODE_TO_ASCII(((src[i + 1] << 4) & 0x10) + | ((src[i + 2] >> 4) & 0xF))]; + *bufout++ = base[ENCODE_TO_ASCII((src[i + 2] << 1) & 0x1E)]; + if (!(flags & APR_ENCODE_NOPADDING)) { + *bufout++ = '='; + *bufout++ = '='; + *bufout++ = '='; + } + } + else { + *bufout++ = base[ENCODE_TO_ASCII(((src[i] << 2) & 0x1C) + | ((src[i + 1] >> 6) & 0x3))]; + *bufout++ = base[ENCODE_TO_ASCII((src[i + 1] >> 1) & 0x1F)]; + *bufout++ = base[ENCODE_TO_ASCII(((src[i + 1] << 4) & 0x10) + | ((src[i + 2] >> 4) & 0xF))]; + *bufout++ = base[ENCODE_TO_ASCII(((src[i + 2] << 1) & 0x1E) + | ((src[i + 3] >> 7) & 0x1))]; + *bufout++ = base[ENCODE_TO_ASCII((src[i + 3] >> 2) & 0x1F)]; + *bufout++ = base[ENCODE_TO_ASCII((src[i + 3] << 3) & 0x18)]; + if (!(flags & APR_ENCODE_NOPADDING)) { + *bufout++ = '='; + } + } + } + + if (len) { + *len = bufout - dest; + } + + *bufout++ = '\0'; + + return APR_SUCCESS; + } + + if (len) { + *len = ((slen + 2) / 3 * 4) + 1; + } + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_encode_base32_binary(char *dest, const unsigned char *src, + apr_ssize_t slen, int flags, apr_size_t * len) +{ + const char *base; + + if (!src) { + return APR_NOTFOUND; + } + + if (dest) { + register char *bufout = dest; + int i; + + if (!((flags & APR_ENCODE_BASE32HEX))) { + base = base32; + } + else { + base = base32hex; + } + + for (i = 0; i < slen - 4; i += 5) { + *bufout++ = base[((src[i] >> 3) & 0x1F)]; + *bufout++ = base[(((src[i] << 2) & 0x1C) + | ((src[i + 1] >> 6) & 0x3))]; + *bufout++ = base[((src[i + 1] >> 1) & 0x1F)]; + *bufout++ = base[(((src[i + 1] << 4) & 0x10) + | ((src[i + 2] >> 4) & 0xF))]; + *bufout++ = base[(((src[i + 2] << 1) & 0x1E) + | ((src[i + 3] >> 7) & 0x1))]; + *bufout++ = base[((src[i + 3] >> 2) & 0x1F)]; + *bufout++ = base[(((src[i + 3] << 3) & 0x18) + | ((src[i + 4] >> 5) & 0x7))]; + *bufout++ = base[(src[i + 4] & 0x1F)]; + } + if (i < slen) { + *bufout++ = base[(src[i] >> 3) & 0x1F]; + if (i == (slen - 1)) { + *bufout++ = base[((src[i] << 2) & 0x1C)]; + if (!(flags & APR_ENCODE_NOPADDING)) { + *bufout++ = '='; + *bufout++ = '='; + *bufout++ = '='; + *bufout++ = '='; + *bufout++ = '='; + *bufout++ = '='; + } + } + else if (i == (slen - 2)) { + *bufout++ = base[(((src[i] << 2) & 0x1C) + | ((src[i + 1] >> 6) & 0x3))]; + *bufout++ = base[((src[i + 1] >> 1) & 0x1F)]; + *bufout++ = base[((src[i + 1] << 4) & 0x10)]; + if (!(flags & APR_ENCODE_NOPADDING)) { + *bufout++ = '='; + *bufout++ = '='; + *bufout++ = '='; + *bufout++ = '='; + } + } + else if (i == (slen - 3)) { + *bufout++ = base[(((src[i] << 2) & 0x1C) + | ((src[i + 1] >> 6) & 0x3))]; + *bufout++ = base[((src[i + 1] >> 1) & 0x1F)]; + *bufout++ = base[(((src[i + 1] << 4) & 0x10) + | ((int)(src[i + 2] >> 4) & 0xF))]; + *bufout++ = base[((src[i + 2] << 1) & 0x1E)]; + if (!(flags & APR_ENCODE_NOPADDING)) { + *bufout++ = '='; + *bufout++ = '='; + *bufout++ = '='; + } + } + else { + *bufout++ = base[(((src[i] << 2) & 0x1C) + | ((src[i + 1] >> 6) & 0x3))]; + *bufout++ = base[((src[i + 1] >> 1) & 0x1F)]; + *bufout++ = base[(((src[i + 1] << 4) & 0x10) + | ((src[i + 2] >> 4) & 0xF))]; + *bufout++ = base[(((src[i + 2] << 1) & 0x1E) + | ((src[i + 3] >> 7) & 0x1))]; + *bufout++ = base[((src[i + 3] >> 2) & 0x1F)]; + *bufout++ = base[((src[i + 3] << 3) & 0x18)]; + if (!(flags & APR_ENCODE_NOPADDING)) { + *bufout++ = '='; + } + } + } + + if (len) { + *len = bufout - dest; + } + + *bufout++ = '\0'; + + return APR_SUCCESS; + } + + if (len) { + *len = ((slen + 4) / 5 * 8) + 1; + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *)apr_pencode_base32(apr_pool_t * p, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) +{ + apr_size_t size; + + switch (apr_encode_base32(NULL, src, slen, flags, &size)) { + case APR_SUCCESS:{ + char *cmd = apr_palloc(p, size); + apr_encode_base32(cmd, src, slen, flags, len); + return cmd; + } + case APR_NOTFOUND:{ + break; + } + } + + return NULL; +} + +APR_DECLARE(const char *)apr_pencode_base32_binary(apr_pool_t * p, const unsigned char *src, + apr_ssize_t slen, int flags, apr_size_t * len) +{ + apr_size_t size; + + switch (apr_encode_base32_binary(NULL, src, slen, flags, &size)) { + case APR_SUCCESS:{ + char *cmd = apr_palloc(p, size); + apr_encode_base32_binary(cmd, src, slen, flags, len); + return cmd; + } + case APR_NOTFOUND:{ + break; + } + } + + return NULL; +} + +APR_DECLARE(apr_status_t) apr_decode_base32(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) +{ + if (!src) { + return APR_NOTFOUND; + } + + if (APR_ENCODE_STRING == slen) { + slen = strlen(src); + } + + if (dest) { + register const unsigned char *bufin; + register unsigned char *bufout; + register apr_size_t nprbytes; + register apr_size_t count = slen; + + const unsigned char *pr2; + + apr_status_t status; + + if ((flags & APR_ENCODE_BASE32HEX)) { + pr2 = pr2fivehex; + } + else { + pr2 = pr2five; + } + + bufin = (const unsigned char *)src; + while (pr2[*(bufin++)] < 32 && count) + count--; + nprbytes = (bufin - (const unsigned char *)src) - 1; + while (pr2[*(bufin++)] > 32 && count) + count--; + + status = flags & APR_ENCODE_RELAXED ? APR_SUCCESS : + count ? APR_BADCH : APR_SUCCESS; + + bufout = (unsigned char *)dest; + bufin = (const unsigned char *)src; + + while (nprbytes > 8) { + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE(pr2[bufin[0]] << 3 + | pr2[bufin[1]] >> 2); + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE(pr2[bufin[1]] << 6 + | pr2[bufin[2]] << 1 | pr2[bufin[3]] >> 4); + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE(pr2[bufin[3]] << 4 + | pr2[bufin[4]] >> 1); + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE(pr2[bufin[4]] << 7 + | pr2[bufin[5]] << 2 | pr2[bufin[6]] >> 3); + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE(pr2[bufin[6]] << 5 + | pr2[bufin[7]]); + bufin += 8; + nprbytes -= 8; + } + + if (nprbytes == 1) { + status = APR_BADCH; + } + if (nprbytes >= 2) { + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE( + pr2[bufin[0]] << 3 | pr2[bufin[1]] >> 2); + } + if (nprbytes == 3) { + status = APR_BADCH; + } + if (nprbytes >= 4) { + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE( + pr2[bufin[1]] << 6 | pr2[bufin[2]] << 1 + | pr2[bufin[3]] >> 4); + } + if (nprbytes >= 5) { + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE(pr2[bufin[3]] << 4 + | pr2[bufin[4]] >> 1); + } + if (nprbytes == 6) { + status = APR_BADCH; + } + if (nprbytes >= 7) { + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE(pr2[bufin[4]] << 7 + | pr2[bufin[5]] << 2 | pr2[bufin[6]] >> 3); + } + if (nprbytes == 8) { + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE(pr2[bufin[6]] << 5 + | pr2[bufin[7]]); + } + + if (len) { + *len = bufout - (unsigned char *)dest; + } + + *(bufout++) = 0; + + return status; + } + + if (len) { + *len = (((int)slen + 7) / 8) * 5 + 1; + } + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_decode_base32_binary(unsigned char *dest, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len) +{ + if (!src) { + return APR_NOTFOUND; + } + + if (APR_ENCODE_STRING == slen) { + slen = strlen(src); + } + + if (dest) { + register const unsigned char *bufin; + register unsigned char *bufout; + register apr_size_t nprbytes; + register apr_size_t count = slen; + + const unsigned char *pr2; + + apr_status_t status; + + if ((flags & APR_ENCODE_BASE32HEX)) { + pr2 = pr2fivehex; + } + else { + pr2 = pr2five; + } + + bufin = (const unsigned char *)src; + while (pr2[*(bufin++)] < 32 && count) + count--; + nprbytes = (bufin - (const unsigned char *)src) - 1; + while (pr2[*(bufin++)] > 32 && count) + count--; + + status = flags & APR_ENCODE_RELAXED ? APR_SUCCESS : + count ? APR_BADCH : APR_SUCCESS; + + bufout = (unsigned char *)dest; + bufin = (const unsigned char *)src; + + while (nprbytes > 8) { + *(bufout++) = (unsigned char)(pr2[bufin[0]] << 3 + | pr2[bufin[1]] >> 2); + *(bufout++) = (unsigned char)(pr2[bufin[1]] << 6 + | pr2[bufin[2]] << 1 | pr2[bufin[3]] >> 4); + *(bufout++) = (unsigned char)(pr2[bufin[3]] << 4 + | pr2[bufin[4]] >> 1); + *(bufout++) = (unsigned char)(pr2[bufin[4]] << 7 + | pr2[bufin[5]] << 2 | pr2[bufin[6]] >> 3); + *(bufout++) = (unsigned char)(pr2[bufin[6]] << 5 + | pr2[bufin[7]]); + bufin += 8; + nprbytes -= 8; + } + + if (nprbytes == 1) { + status = APR_BADCH; + } + if (nprbytes >= 2) { + *(bufout++) = (unsigned char)( + pr2[bufin[0]] << 3 | pr2[bufin[1]] >> 2); + } + if (nprbytes == 3) { + status = APR_BADCH; + } + if (nprbytes >= 4) { + *(bufout++) = (unsigned char)( + pr2[bufin[1]] << 6 | pr2[bufin[2]] << 1 + | pr2[bufin[3]] >> 4); + } + if (nprbytes >= 5) { + *(bufout++) = (unsigned char)(pr2[bufin[3]] << 4 + | pr2[bufin[4]] >> 1); + } + if (nprbytes == 6) { + status = APR_BADCH; + } + if (nprbytes >= 7) { + *(bufout++) = (unsigned char)(pr2[bufin[4]] << 7 + | pr2[bufin[5]] << 2 | pr2[bufin[6]] >> 3); + } + if (nprbytes == 8) { + *(bufout++) = (unsigned char)(pr2[bufin[6]] << 5 + | pr2[bufin[7]]); + } + + if (len) { + *len = bufout - dest; + } + + return status; + } + + if (len) { + *len = (((int)slen + 7) / 8) * 5; + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *)apr_pdecode_base32(apr_pool_t * p, const char *str, + apr_ssize_t slen, int flags, apr_size_t * len) +{ + apr_size_t size; + + switch (apr_decode_base32(NULL, str, slen, flags, &size)) { + case APR_SUCCESS:{ + void *cmd = apr_palloc(p, size); + apr_decode_base32(cmd, str, slen, flags, len); + return cmd; + } + case APR_BADCH: + case APR_NOTFOUND:{ + break; + } + } + + return NULL; +} + +APR_DECLARE(const unsigned char *)apr_pdecode_base32_binary(apr_pool_t * p, + const char *str, apr_ssize_t slen, int flags, apr_size_t * len) +{ + apr_size_t size; + + switch (apr_decode_base32_binary(NULL, str, slen, flags, &size)) { + case APR_SUCCESS:{ + unsigned char *cmd = apr_palloc(p, size + 1); + cmd[size] = 0; + apr_decode_base32_binary(cmd, str, slen, flags, len); + return cmd; + } + case APR_BADCH: + case APR_NOTFOUND:{ + break; + } + } + + return NULL; +} + +APR_DECLARE(apr_status_t) apr_encode_base16(char *dest, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len) +{ + const char *in = src; + apr_size_t size; + + if (!src) { + return APR_NOTFOUND; + } + + if (dest) { + register char *bufout = dest; + const char *base; + + if ((flags & APR_ENCODE_LOWER)) { + base = base16lower; + } + else { + base = base16; + } + + for (size = 0; (APR_ENCODE_STRING == slen) ? in[size] : size < slen; size++) { + if ((flags & APR_ENCODE_COLON) && size) { + *(bufout++) = ':'; + } + *(bufout++) = base[(const unsigned char)(ENCODE_TO_ASCII(in[size])) >> 4]; + *(bufout++) = base[(const unsigned char)(ENCODE_TO_ASCII(in[size])) & 0xf]; + } + + if (len) { + *len = bufout - dest; + } + + *bufout = '\0'; + + return APR_SUCCESS; + } + + if (len) { + if (APR_ENCODE_STRING == slen) { + slen = strlen(src); + } + if ((flags & APR_ENCODE_COLON) && slen) { + *len = slen * 3; + } + else { + *len = slen * 2 + 1; + } + } + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_encode_base16_binary(char *dest, + const unsigned char *src, apr_ssize_t slen, int flags, apr_size_t * len) +{ + const unsigned char *in = src; + apr_size_t size; + + if (!src) { + return APR_NOTFOUND; + } + + if (dest) { + register char *bufout = dest; + const char *base; + + if ((flags & APR_ENCODE_LOWER)) { + base = base16lower; + } + else { + base = base16; + } + + for (size = 0; size < slen; size++) { + if ((flags & APR_ENCODE_COLON) && size) { + *(bufout++) = ':'; + } + *(bufout++) = base[in[size] >> 4]; + *(bufout++) = base[in[size] & 0xf]; + } + + if (len) { + *len = bufout - dest; + } + + *bufout = 0; + + return APR_SUCCESS; + } + + if (len) { + if ((flags & APR_ENCODE_COLON) && slen) { + *len = slen * 3; + } + else { + *len = slen * 2 + 1; + } + } + + return APR_SUCCESS; +} + +APR_DECLARE(const char *)apr_pencode_base16(apr_pool_t * p, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len) +{ + apr_size_t size; + + switch (apr_encode_base16(NULL, src, slen, flags, &size)) { + case APR_SUCCESS:{ + char *cmd = apr_palloc(p, size); + apr_encode_base16(cmd, src, slen, flags, len); + return cmd; + } + case APR_NOTFOUND:{ + break; + } + } + + return NULL; +} + +APR_DECLARE(const char *)apr_pencode_base16_binary(apr_pool_t * p, + const unsigned char *src, apr_ssize_t slen, int flags, + apr_size_t * len) +{ + apr_size_t size; + + switch (apr_encode_base16_binary(NULL, src, slen, flags, &size)) { + case APR_SUCCESS:{ + char *cmd = apr_palloc(p, size); + apr_encode_base16_binary(cmd, src, slen, flags, len); + return cmd; + } + case APR_NOTFOUND:{ + break; + } + } + + return NULL; +} + +APR_DECLARE(apr_status_t) apr_decode_base16(char *dest, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len) +{ + register const unsigned char *bufin; + register unsigned char *bufout; + register apr_size_t nprbytes; + register apr_size_t count; + + apr_status_t status; + + if (!src) { + return APR_NOTFOUND; + } + + if (APR_ENCODE_STRING == slen) { + slen = strlen(src); + } + + count = slen; + bufin = (const unsigned char *)src; + while (pr2two[*(bufin++)] != 16 && count) + count--; + nprbytes = (bufin - (const unsigned char *)src) - 1; + while (pr2two[*(bufin++)] > 16 && count) + count--; + + status = flags & APR_ENCODE_RELAXED ? APR_SUCCESS : + count ? APR_BADCH : APR_SUCCESS; + + if (dest) { + + bufout = (unsigned char *)dest; + bufin = (const unsigned char *)src; + + while (nprbytes >= 2) { + if (pr2two[bufin[0]] > 16) { + bufin += 1; + nprbytes -= 1; + } + else { + *(bufout++) = (unsigned char)ENCODE_TO_NATIVE( + pr2two[bufin[0]] << 4 | pr2two[bufin[1]]); + bufin += 2; + nprbytes -= 2; + } + } + + if (nprbytes == 1) { + status = APR_BADCH; + } + + if (len) { + *len = bufout - (unsigned char *)dest; + } + + *(bufout++) = 0; + + return status; + } + + else { + + count = 0; + bufin = (const unsigned char *)src; + + while (nprbytes >= 2) { + if (pr2two[bufin[0]] > 16) { + bufin += 1; + nprbytes -= 1; + } + else { + count++; + bufin += 2; + nprbytes -= 2; + } + } + + if (nprbytes == 1) { + status = APR_BADCH; + } + + if (len) { + *len = count + 1; + } + + return status; + } + +} + +APR_DECLARE(apr_status_t) apr_decode_base16_binary(unsigned char *dest, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len) +{ + register const unsigned char *bufin; + register unsigned char *bufout; + register apr_size_t nprbytes; + register apr_size_t count; + + apr_status_t status; + + if (!src) { + return APR_NOTFOUND; + } + + if (APR_ENCODE_STRING == slen) { + slen = strlen(src); + } + + count = slen; + bufin = (const unsigned char *)src; + while (pr2two[*(bufin++)] != 16 && count) + count--; + nprbytes = (bufin - (const unsigned char *)src) - 1; + while (pr2two[*(bufin++)] > 16 && count) + count--; + + status = flags & APR_ENCODE_RELAXED ? APR_SUCCESS : + count ? APR_BADCH : APR_SUCCESS; + + if (dest) { + + bufout = (unsigned char *)dest; + bufin = (const unsigned char *)src; + + while (nprbytes >= 2) { + if (pr2two[bufin[0]] > 16) { + bufin += 1; + nprbytes -= 1; + } + else { + *(bufout++) = (unsigned char)( + pr2two[bufin[0]] << 4 | pr2two[bufin[1]]); + bufin += 2; + nprbytes -= 2; + } + } + + if (nprbytes == 1) { + status = APR_BADCH; + } + + if (len) { + *len = bufout - (unsigned char *)dest; + } + + return status; + } + + else { + + count = 0; + bufin = (const unsigned char *)src; + + while (nprbytes >= 2) { + if (pr2two[bufin[0]] > 16) { + bufin += 1; + nprbytes -= 1; + } + else { + count++; + bufin += 2; + nprbytes -= 2; + } + } + + if (nprbytes == 1) { + status = APR_BADCH; + } + + if (len) { + *len = count; + } + + return status; + } +} + +APR_DECLARE(const char *)apr_pdecode_base16(apr_pool_t * p, + const char *str, apr_ssize_t slen, int flags, apr_size_t * len) +{ + apr_size_t size; + + switch (apr_decode_base16(NULL, str, slen, flags, &size)) { + case APR_SUCCESS:{ + void *cmd = apr_palloc(p, size); + apr_decode_base16(cmd, str, slen, flags, len); + return cmd; + } + case APR_BADCH: + case APR_NOTFOUND:{ + break; + } + } + + return NULL; +} + +APR_DECLARE(const unsigned char *)apr_pdecode_base16_binary(apr_pool_t * p, + const char *str, apr_ssize_t slen, int flags, apr_size_t * len) +{ + apr_size_t size; + + switch (apr_decode_base16_binary(NULL, str, slen, flags, &size)) { + case APR_SUCCESS:{ + unsigned char *cmd = apr_palloc(p, size + 1); + cmd[size] = 0; + apr_decode_base16_binary(cmd, str, slen, flags, len); + return cmd; + } + case APR_BADCH: + case APR_NOTFOUND:{ + break; + } + } + + return NULL; +} diff --git a/encoding/apr_escape.c b/encoding/apr_escape.c index 3be9eb99ec1..b3bc82d359f 100644 --- a/encoding/apr_escape.c +++ b/encoding/apr_escape.c @@ -27,50 +27,10 @@ #include "apr_escape.h" #include "apr_escape_test_char.h" +#include "apr_encode_private.h" #include "apr_lib.h" #include "apr_strings.h" -#if APR_CHARSET_EBCDIC -static int convert_a2e[256] = { - 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, - 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, - 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, - 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D, - 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x06, 0x17, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x09, 0x0A, 0x1B, - 0x30, 0x31, 0x1A, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3A, 0x3B, 0x04, 0x14, 0x3E, 0xFF, - 0x41, 0xAA, 0x4A, 0xB1, 0x9F, 0xB2, 0x6A, 0xB5, 0xBB, 0xB4, 0x9A, 0x8A, 0xB0, 0xCA, 0xAF, 0xBC, - 0x90, 0x8F, 0xEA, 0xFA, 0xBE, 0xA0, 0xB6, 0xB3, 0x9D, 0xDA, 0x9B, 0x8B, 0xB7, 0xB8, 0xB9, 0xAB, - 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9E, 0x68, 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, - 0xAC, 0x69, 0xED, 0xEE, 0xEB, 0xEF, 0xEC, 0xBF, 0x80, 0xFD, 0xFE, 0xFB, 0xFC, 0xBA, 0xAE, 0x59, - 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9C, 0x48, 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, - 0x8C, 0x49, 0xCD, 0xCE, 0xCB, 0xCF, 0xCC, 0xE1, 0x70, 0xDD, 0xDE, 0xDB, 0xDC, 0x8D, 0x8E, 0xDF }; - -static int convert_e2a[256] = { - 0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x9D, 0x0A, 0x08, 0x87, 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x17, 0x1B, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07, - 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, 0x98, 0x99, 0x9A, 0x9B, 0x14, 0x15, 0x9E, 0x1A, - 0x20, 0xA0, 0xE2, 0xE4, 0xE0, 0xE1, 0xE3, 0xE5, 0xE7, 0xF1, 0xA2, 0x2E, 0x3C, 0x28, 0x2B, 0x7C, - 0x26, 0xE9, 0xEA, 0xEB, 0xE8, 0xED,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_EBCDIC */ -#define RAW_ASCII_CHAR(ch) (ch) -#endif /* !APR_CHARSET_EBCDIC */ - /* we assume the folks using this ensure 0 <= c < 256... which means * you need a cast to (unsigned char) first, you can't just plug a * char in here and get it to work, because if char is signed then it @@ -171,7 +131,7 @@ static char x2c(const char *what) xstr[2]=what[0]; xstr[3]=what[1]; xstr[4]='\0'; - digit = convert_a2e[0xFF & strtol(xstr, NULL, 16)]; + digit = ENCODE_TO_NATIVE[0xFF & strtol(xstr, NULL, 16)]; #endif /*APR_CHARSET_EBCDIC*/ return (digit); } @@ -756,7 +716,7 @@ APR_DECLARE(apr_status_t) apr_unescape_entity(char *unescaped, const char *str, size--; } else { - *d = RAW_ASCII_CHAR(val); + *d = ENCODE_TO_ASCII(val); found = 1; } } @@ -777,7 +737,7 @@ APR_DECLARE(apr_status_t) apr_unescape_entity(char *unescaped, const char *str, *d = '&'; /* unknown */ } else { - *d = RAW_ASCII_CHAR(((const unsigned char *) ents)[j]); + *d = ENCODE_TO_ASCII(((const unsigned char *) ents)[j]); s += i; slen -= i; found = 1; diff --git a/include/apr_encode.h b/include/apr_encode.h new file mode 100644 index 00000000000..f2a66c6a76e --- /dev/null +++ b/include/apr_encode.h @@ -0,0 +1,569 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file apr_encode.h + * @brief APR-UTIL Encoding + */ +#ifndef APR_ENCODE_H +#define APR_ENCODE_H + +#include "apr.h" +#include "apr_general.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup APR_Util_Encode Base64/Base64Url/Base32/Base32Hex/Base16 Encoding + * @ingroup APR_Util + * @{ + */ + +/** + * RFC4648 and RFC7515 compliant BASE64, BASE64URL, BASE32, BASE32HEX + * and BASE16 encode/decode functions. + * + * The following encodings are supported: + * + * - Base 64 Encoding + * + * o Use flag APR_ENCODE_NONE + * o https://tools.ietf.org/html/rfc4648#section-4 + * + * - Base 64 Encoding with URL and Filename Safe Alphabet + * + * o Use flag APR_ENCODE_URL + * o https://tools.ietf.org/html/rfc4648#section-5 + * + * - Base 64 URL Encoding without Padding + * + * o Use flag APR_ENCODE_BASE64URL + * o https://tools.ietf.org/html/rfc7515#appendix-C + * + * - Base 32 Encoding + * + * o Use flag APR_ENCODE_NONE + * o https://tools.ietf.org/html/rfc4648#section-6 + * + * - Base 32 Encoding with Extended Hex Alphabet + * + * o Use flag APR_ENCODE_BASE32HEX + * o https://tools.ietf.org/html/rfc4648#section-7 + * + * - Base 16 Encoding + * + * o Use flags APR_ENCODE_NONE/APR_ENCODE_COLON + * o https://tools.ietf.org/html/rfc4648#section-8 + * + * If a non valid character of any kind including whitespace is passed to any + * of the decoder functions, APR_BADCH will be returned. In this case decoding + * will still take place, but the results can not be trusted. + * + * If APR_ENCODE_RELAXED is passed to the decoder functions, decoding will be + * attempted up until the first non valid character. If this results in an + * invalid state in the decoder, such as but not limited to an odd number of + * base16 characters, APR_BADCH will still be returned. + * + * If APR_ENCODE_RELAXED is not passed to a decoder function, the decoding will + * be done in constant time regardless of whether the result returns APR_SUCCESS + * or APR_BADCH. + * + * If the dest parameter is NULL, the maximum theoretical buffer size is + * returned in the len field, including space for a terminating zero character + * if the destination is a string. This value can be used to allocate buffers + * of a suitable safe size. + * + * If the dest parameter is provided, the encoding or decoding will take place, + * and the actual number of characters written is returned in the len field, + * ignoring any terminating zero. + * + * Plain strings are not assumed '\0' terminated unless APR_ENCODE_STRING is + * provided. + * + */ + +/** + * When passing a string to one of the encode functions, this value can be + * passed to indicate a string-valued key, and have the length computed + * automatically. + */ +#define APR_ENCODE_STRING (-1) + +/** + * Generate RFC4648 base16/base32/base64. + */ +#define APR_ENCODE_NONE 0 + +/** + * If relaxed, decode up until the first non base16/base32/base64 character. + */ +#define APR_ENCODE_RELAXED 1 + +/** + * Omit the padding character (=) while encoding. + */ +#define APR_ENCODE_NOPADDING 2 + +/** + * Generate RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet + */ +#define APR_ENCODE_URL 4 + +/** + * Generate RFC7515 BASE64URL + */ +#define APR_ENCODE_BASE64URL APR_ENCODE_NOPADDING | APR_ENCODE_URL + +/** + * Generate base32hex encoding instead of base32 encoding + */ +#define APR_ENCODE_BASE32HEX 8 + +/** + * Generate base16 with colons between each token. + */ +#define APR_ENCODE_COLON 16 + +/** + * Generate base16 with lower case characters. + */ +#define APR_ENCODE_LOWER 32 + +/** + * Convert text data to base64. + * @param dest The destination string, can be NULL. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, emit RFC4648 Base 64 Encoding. If + * APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_URL, + * use RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet. + * If APR_ENCODE_BASE64URL, use RFC7515 base64url Encoding. + * @param len If present and src is NULL, returns the maximum possible length + * of the destination string, including a zero pad. If present and src is + * not NULL, returns the number of characters actually written. + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL. + */ + APR_DECLARE(apr_status_t) apr_encode_base64(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len); + +/** + * Convert binary data to base64. + * @param dest The destination string, can be NULL. + * @param src The original buffer. + * @param slen The length of the original buffer. + * @param flags If APR_ENCODE_NONE, emit RFC4648 Base 64 Encoding. If + * APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_URL, + * use RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet. + * If APR_ENCODE_BASE64URL, use RFC7515 base64url Encoding. + * @param len If present and src is NULL, returns the maximum possible length + * of the destination string, including a zero pad. If present and src is + * not NULL, returns the number of characters actually written. + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL. + */ + APR_DECLARE(apr_status_t) apr_encode_base64_binary(char *dest, const unsigned char *src, + apr_ssize_t slen, int flags, apr_size_t * len); + +/** + * Convert text data to base64, and return the results from a pool. + * @param p Pool to allocate from. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, emit RFC4648 Base 64 Encoding. If + * APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_URL, + * use RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet. + * If APR_ENCODE_BASE64URL, use RFC7515 base64url Encoding. + * @param len If present, returns the number of characters written excluding + * the zero pad. + * @return A zero padded string allocated from the pool on success, or + * NULL if src was NULL. + */ + APR_DECLARE(const char *)apr_pencode_base64(apr_pool_t * p, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len)__attribute__((nonnull(1))); + +/** + * Convert binary data to base64, and return the results from a pool. + * @param p Pool to allocate from. + * @param src The original buffer. + * @param slen The length of the original buffer. + * @param flags If APR_ENCODE_NONE, emit RFC4648 Base 64 Encoding. If + * APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_URL, + * use RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet. + * If APR_ENCODE_BASE64URL, use RFC7515 base64url Encoding. + * @param len If present, returns the number of characters written excluding + * the zero pad. + * @return A zero padded string allocated from the pool on success, or + * NULL if src was NULL. + */ + APR_DECLARE(const char *)apr_pencode_base64_binary(apr_pool_t * p, const unsigned char *src, + apr_ssize_t slen, int flags, apr_size_t * len)__attribute__((nonnull(1))); + +/** + * Convert base64 or base64url with or without padding to text data. + * @param dest The destination string, can be NULL. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, attempt to decode the full original buffer, + * and return NULL if any bad character is detected. If APR_ENCODE_RELAXED, + * decode until the first non base64/base64url character. + * @param len If present and src is NULL, returns the maximum possible length + * of the destination string, including a zero pad. If present and src is + * not NULL, returns the number of characters actually written. + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH + * if a non hex character is present. + */ + APR_DECLARE(apr_status_t) apr_decode_base64(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len); + +/** + * Convert base64 or base64url with or without padding to binary data. + * @param dest The destination buffer, can be NULL. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, attempt to decode the full original buffer, + * and return NULL if any bad character is detected. If APR_ENCODE_RELAXED, + * decode until the first non base64/base64url character. + * @param len If present and src is NULL, returns the maximum possible length + * of the destination buffer, including a zero pad. If present and src is + * not NULL, returns the number of characters actually written. + * @return APR_SUCCESS, or APR_NOTFOUND if the src was NULL, or APR_BADCH + * if a non base64 character is present. + */ + APR_DECLARE(apr_status_t) apr_decode_base64_binary(unsigned char *dest, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len); + +/** + * Convert base64 or base64url with or without padding to text data, and + * return the results from a pool. + * @param p Pool to allocate from. + * @param src The base64 string to decode. + * @param slen The length of the base64 string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, attempt to decode the full original buffer, + * and return NULL if any bad character is detected. If APR_ENCODE_RELAXED, + * decode until the first non base64/base64url character. + * @param len If present, returns the number of characters written, excluding + * the zero padding. + * @return A string allocated from the pool containing the result with a zero + * pad. If src was NULL, or an error occurred, NULL is returned. + */ + APR_DECLARE(const char *)apr_pdecode_base64(apr_pool_t * p, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); + +/** + * Convert base64 or base64url with or without padding to binary data, and + * return the results from a pool. + * @param p Pool to allocate from. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, attempt to decode the full original buffer, + * and return NULL if any bad character is detected. If APR_ENCODE_RELAXED, + * decode until the first non base64/base64url character. + * @param len If present, returns the number of characters written, excluding + * the zero padding. + * @return A buffer allocated from the pool containing the result with a zero + * pad. If src was NULL, or an error occurred, NULL is returned. + */ + APR_DECLARE(const unsigned char *)apr_pdecode_base64_binary(apr_pool_t * p, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); + +/** + * Convert text data to base32. + * @param dest The destination string, can be NULL. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If + * APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX, + * use RFC4648 base32hex Encoding. + * @param len If present and src is NULL, returns the maximum possible length + * of the destination string, including a zero pad. If present and src is + * not NULL, returns the number of characters actually written. + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL. + */ + APR_DECLARE(apr_status_t) apr_encode_base32(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len); + +/** + * Convert binary data to base32. + * @param dest The destination string, can be NULL. + * @param src The original buffer. + * @param slen The length of the original buffer. + * @param flags If APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If + * APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX, + * use RFC4648 base32hex Encoding. + * @param len If present and src is NULL, returns the maximum possible length + * of the destination string, including a zero pad. If present and src is + * not NULL, returns the number of characters actually written. + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL. + */ + APR_DECLARE(apr_status_t) apr_encode_base32_binary(char *dest, const unsigned char *src, + apr_ssize_t slen, int flags, apr_size_t * len); + +/** + * Convert text data to base32, and return the results from a pool. + * @param p Pool to allocate from. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If + * APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX, + * use RFC4648 base32hex Encoding. + * @param len If present, returns the number of characters written excluding + * the zero pad. + * @return A zero padded string allocated from the pool on success, or + * NULL if src was NULL. + */ + APR_DECLARE(const char *)apr_pencode_base32(apr_pool_t * p, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); + +/** + * Convert binary data to base32, and return the results from a pool. + * @param p Pool to allocate from. + * @param src The original buffer. + * @param slen The length of the original buffer. + * @param flags If APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If + * APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX, + * use RFC7515 base32hex Encoding. + * @param len If present, returns the number of characters written excluding + * the zero pad. + * @return A zero padded string allocated from the pool on success, or + * NULL if src was NULL. + */ + APR_DECLARE(const char *)apr_pencode_base32_binary(apr_pool_t * p, const unsigned char *src, + apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); + +/** + * Convert base32 or base32hex with or without padding to text data. + * @param dest The destination string, can be NULL. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, parse RFC4648 Base 32 Encoding. If + * APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding. + * @param len If present and src is NULL, returns the maximum possible length + * of the destination buffer, including a zero pad. If present and src is + * not NULL, returns the number of characters actually written. + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH + * if a non base32 character is present. + */ + APR_DECLARE(apr_status_t) apr_decode_base32(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len); + +/** + * Convert base32 or base32hex with or without padding to binary data. + * @param dest The destination buffer, can be NULL. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, parse RFC4648 Base 32 Encoding. If + * APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding. + * @param len If present and src is NULL, returns the maximum possible length + * of the destination buffer, including a zero pad. If present and src is + * not NULL, returns the number of characters actually written. + * @return APR_SUCCESS, or APR_NOTFOUND if the src was NULL, or APR_BADCH + * if a non base32 character is present. + */ + APR_DECLARE(apr_status_t) apr_decode_base32_binary(unsigned char *dest, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len); + +/** + * Convert base32 or base32hex with or without padding to text data, and + * return the results from a pool. + * @param p Pool to allocate from. + * @param src The base32 string to decode. + * @param slen The length of the base32 string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, parse RFC4648 Base 32 Encoding. If + * APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding. + * @param len If present, returns the number of characters written, excluding + * the zero padding. + * @return A string allocated from the pool containing the result with a zero + * pad. If src was NULL, or an error occurred, NULL is returned. + */ + APR_DECLARE(const char *)apr_pdecode_base32(apr_pool_t * p, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); + +/** + * Convert base32 or base32hex with or without padding to binary data, and + * return the results from a pool. + * @param p Pool to allocate from. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, parse RFC4648 Base 32 Encoding. If + * APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding. + * @param len If present, returns the number of characters written, excluding + * the zero padding. + * @return A buffer allocated from the pool containing the result with a zero + * pad. If src was NULL, or an error occurred, NULL is returned. + */ + APR_DECLARE(const unsigned char *)apr_pdecode_base32_binary(apr_pool_t * p, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); + +/** + * Convert text data to base16 (hex). + * @param dest The destination string, can be NULL. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If + * APR_ENCODE_COLON, separate each token with a colon. + * @param len If present and src is NULL, returns the maximum possible length + * of the destination buffer, including a zero pad. If present and src is + * not NULL, returns the number of characters actually written. + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL. + */ + APR_DECLARE(apr_status_t) apr_encode_base16(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len); + +/** + * Convert binary data to base16 (hex). + * @param dest The destination string, can be NULL. + * @param src The original buffer. + * @param slen The length of the original buffer. + * @param flags If APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If + * APR_ENCODE_COLON, separate each token with a colon. + * @param len If present and src is NULL, returns the maximum possible length + * of the destination buffer, including a zero pad. If present and src is + * not NULL, returns the number of characters actually written. + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL. + */ + APR_DECLARE(apr_status_t) apr_encode_base16_binary(char *dest, + const unsigned char *src, apr_ssize_t slen, int flags, + apr_size_t * len); + +/** + * Convert text data to base16 (hex), and return the results from a + * pool. + * @param p Pool to allocate from. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If + * APR_ENCODE_COLON, separate each token with a colon. + * @param len If present, returns the number of characters written, excluding + * the zero padding. + * @return A string allocated from the pool containing the result with a zero + * pad. If src was NULL, or an error occurred, NULL is returned. + */ + APR_DECLARE(const char *)apr_pencode_base16(apr_pool_t * p, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); + +/** + * Convert binary data to base16 (hex), and return the results from a + * pool. + * @param p Pool to allocate from. + * @param src The original buffer. + * @param slen The length of the original buffer. + * @param flags If APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If + * APR_ENCODE_COLON, separate each token with a colon. + * @param len If present, returns the number of characters written, excluding + * the zero padding. + * @return A string allocated from the pool containing the result with a zero + * pad. If src was NULL, or an error occurred, NULL is returned. + */ + APR_DECLARE(const char *)apr_pencode_base16_binary(apr_pool_t * p, + const unsigned char *src, apr_ssize_t slen, + int flags, apr_size_t * len)__attribute__((nonnull(1))); + +/** + * Convert base16 (hex) to text data. + * @param dest The destination string, can be NULL. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, parse RFC4648 Base 16 Encoding. If + * APR_ENCODE_COLON, allow tokens to be separated with a colon. + * @param len If present and src is NULL, returns the maximum possible length + * of the destination buffer, including a zero pad. If present and src is + * not NULL, returns the number of characters actually written. + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH + * if a non hex character is present. A zero pad is appended to the buffer. + */ + APR_DECLARE(apr_status_t) apr_decode_base16(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len); + +/** + * Convert base16 (hex) to binary data. + * @param dest The destination buffer, can be NULL. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, parse RFC4648 Base 16 Encoding. If + * APR_ENCODE_COLON, allow tokens to be separated with a colon. + * @param len If present and src is NULL, returns the maximum possible length + * of the destination buffer, including a zero pad. If present and src is + * not NULL, returns the number of characters actually written. + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH + * if a non hex character is present. No zero pad is written to the buffer. + */ + APR_DECLARE(apr_status_t) apr_decode_base16_binary(unsigned char *dest, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len); + +/** + * Convert base16 (hex) and return the results from a pool. + * @param p Pool to allocate from. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, parse RFC4648 Base 16 Encoding. If + * APR_ENCODE_COLON, allow tokens to be separated with a colon. + * @param len If present, returns the number of characters written, excluding + * the zero padding. + * @return A buffer allocated from the pool containing the result with a zero + * pad. If src was NULL, or an error occurred, NULL is returned. + */ + APR_DECLARE(const char *)apr_pdecode_base16(apr_pool_t * p, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); + +/** + * Convert base16 (hex) to binary data, and return the results from a pool. + * @param p Pool to allocate from. + * @param src The original string. + * @param slen The length of the original string, or APR_ENCODE_STRING if + * NUL terminated. + * @param flags If APR_ENCODE_NONE, parse RFC4648 Base 16 Encoding. If + * APR_ENCODE_COLON, allow tokens to be separated with a colon. + * @param len If present, returns the number of characters written, excluding + * the zero padding. + * @return A buffer allocated from the pool containing the result with a zero + * pad. If src was NULL, or an error occurred, NULL is returned. + */ + APR_DECLARE(const unsigned char *)apr_pdecode_base16_binary(apr_pool_t * p, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* !APR_ENCODE_H */ diff --git a/include/apr_escape.h b/include/apr_escape.h index 6d4e08be0f3..b51f5bfc31f 100644 --- a/include/apr_escape.h +++ b/include/apr_escape.h @@ -32,6 +32,19 @@ extern "C" { */ /* Simple escape/unescape functions. + * + * The design goal of these functions are: + * + * - Avoid unnecessary work. + * + * In most cases the strings passed in do not need to be escaped at all. In + * these cases the original string will be returned. + * + * - Lowest possible memory footprint. + * + * The amount of memory allocated for a given encoding is calculated based + * on the exact amount of memory needed, and not the theoretical worst case + * scenario. * */ diff --git a/include/private/apr_encode_private.h b/include/private/apr_encode_private.h new file mode 100644 index 00000000000..8db2e016695 --- /dev/null +++ b/include/private/apr_encode_private.h @@ -0,0 +1,84 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file apr_encode_private.h + * @brief APR-UTIL Encoding Private + */ +#ifndef APR_ENCODE_PRIVATE_H +#define APR_ENCODE_PRIVATE_H + +#include "apr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup APR_Util_Encode_Private + * @ingroup APR_Util + * @{ + */ + +#if APR_CHARSET_EBCDIC + static int convert_a2e[256] = { + 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, + 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, + 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, + 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D, + 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, + 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x06, 0x17, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x09, 0x0A, 0x1B, + 0x30, 0x31, 0x1A, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3A, 0x3B, 0x04, 0x14, 0x3E, 0xFF, + 0x41, 0xAA, 0x4A, 0xB1, 0x9F, 0xB2, 0x6A, 0xB5, 0xBB, 0xB4, 0x9A, 0x8A, 0xB0, 0xCA, 0xAF, 0xBC, + 0x90, 0x8F, 0xEA, 0xFA, 0xBE, 0xA0, 0xB6, 0xB3, 0x9D, 0xDA, 0x9B, 0x8B, 0xB7, 0xB8, 0xB9, 0xAB, + 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9E, 0x68, 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, + 0xAC, 0x69, 0xED, 0xEE, 0xEB, 0xEF, 0xEC, 0xBF, 0x80, 0xFD, 0xFE, 0xFB, 0xFC, 0xBA, 0xAE, 0x59, + 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9C, 0x48, 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, + 0x8C, 0x49, 0xCD, 0xCE, 0xCB, 0xCF, 0xCC, 0xE1, 0x70, 0xDD, 0xDE, 0xDB, 0xDC, 0x8D, 0x8E, 0xDF}; + + static int convert_e2a[256] = { + 0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x9D, 0x0A, 0x08, 0x87, 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x17, 0x1B, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07, + 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, 0x98, 0x99, 0x9A, 0x9B, 0x14, 0x15, 0x9E, 0x1A, + 0x20, 0xA0, 0xE2, 0xE4, 0xE0, 0xE1, 0xE3, 0xE5, 0xE7, 0xF1, 0xA2, 0x2E, 0x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x9F}; +#define decode ENCODE_TO_ASCII(ch) convert_e2a[(unsigned char)ch] +#define decode ENCODE_TO_NATIVE(ch) convert_a2e[(unsigned char)ch] +#else /* APR_CHARSET_EBCDIC */ +#define ENCODE_TO_ASCII(ch) (ch) +#define ENCODE_TO_NATIVE(ch) (ch) +#endif /* !APR_CHARSET_EBCDIC */ + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* !APR_ENCODE_PRIVATE_H */ diff --git a/test/Makefile.in b/test/Makefile.in index 4fb4d94d36e..be2d65c4e9d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -37,7 +37,7 @@ TESTS = testtime.lo teststr.lo testvsn.lo testipsub.lo testshm.lo \ testbuckets.lo testxml.lo testdbm.lo testuuid.lo testmd5.lo \ testreslist.lo testbase64.lo testhooks.lo testlfsabi.lo \ testlfsabi32.lo testlfsabi64.lo testescape.lo testskiplist.lo \ - testsiphash.lo testredis.lo + testsiphash.lo testredis.lo testencode.lo OTHER_PROGRAMS = \ echod@EXEEXT@ \ diff --git a/test/abts_tests.h b/test/abts_tests.h index bfd83cf428d..31209866875 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -27,6 +27,7 @@ const struct testlist { {testdir}, {testdso}, {testdup}, + {testencode}, {testenv}, {testescape}, {testfile}, diff --git a/test/testencode.c b/test/testencode.c new file mode 100644 index 00000000000..46e694954cc --- /dev/null +++ b/test/testencode.c @@ -0,0 +1,1117 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "apr_encode.h" +#include "apr_strings.h" + +#include "abts.h" +#include "testutil.h" + +static void test_encode_base64(abts_case * tc, void *data) +{ + apr_pool_t *pool; + const char *src, *target; + const char *dest; + apr_size_t len; + + apr_pool_create(&pool, NULL); + + /* + * Test vectors from https://tools.ietf.org/html/rfc4648#section-10 + */ + src = ""; + target = ""; + dest = apr_pencode_base64(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "f"; + target = "Zg=="; + dest = apr_pencode_base64(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "f"; + target = "Zg"; + dest = apr_pencode_base64(pool, src, APR_ENCODE_STRING, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "fo"; + target = "Zm8="; + dest = apr_pencode_base64(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "fo"; + target = "Zm8"; + dest = apr_pencode_base64(pool, src, APR_ENCODE_STRING, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "foo"; + target = "Zm9v"; + dest = apr_pencode_base64(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "foo"; + target = "Zm9v"; + dest = apr_pencode_base64(pool, src, APR_ENCODE_STRING, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + apr_pool_destroy(pool); +} + +static void test_encode_base64_binary(abts_case * tc, void *data) +{ + apr_pool_t *pool; + const char *target; + const unsigned char *usrc; + const char *dest; + apr_size_t len; + + apr_pool_create(&pool, NULL); + + /* + * Test vectors from https://tools.ietf.org/html/rfc4648#section-10 + */ + usrc = (unsigned char[]){ + }; + target = ""; + dest = apr_pencode_base64_binary(pool, usrc, 0, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f' + }; + target = "Zg=="; + dest = apr_pencode_base64_binary(pool, usrc, 1, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f' + }; + target = "Zg"; + dest = apr_pencode_base64_binary(pool, usrc, 1, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o' + }; + target = "Zm8="; + dest = apr_pencode_base64_binary(pool, usrc, 2, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o' + }; + target = "Zm8"; + dest = apr_pencode_base64_binary(pool, usrc, 2, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o' + }; + target = "Zm9v"; + dest = apr_pencode_base64_binary(pool, usrc, 3, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o' + }; + target = "Zm9v"; + dest = apr_pencode_base64_binary(pool, usrc, 3, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + apr_pool_destroy(pool); +} + +static void test_decode_base64(abts_case * tc, void *data) +{ + apr_pool_t *pool; + const char *target, *src; + const char *dest; + apr_size_t len; + + apr_pool_create(&pool, NULL); + + /* + * Test vectors from https://tools.ietf.org/html/rfc4648#section-10 + */ + src = ""; + target = ""; + dest = apr_pdecode_base64(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, dest, target); + + src = "Zg=="; + target = "f"; + dest = apr_pdecode_base64(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, dest, target); + + src = "Zg"; + target = "f"; + dest = apr_pdecode_base64(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, dest, target); + + src = "Zm8="; + target = "fo"; + dest = apr_pdecode_base64(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, dest, target); + + src = "Zm8"; + target = "fo"; + dest = apr_pdecode_base64(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, dest, target); + + src = "Zm9v"; + target = "foo"; + dest = apr_pdecode_base64(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, dest, target); + + src = "Zm9v"; + target = "foo"; + dest = apr_pdecode_base64(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, dest, target); + + apr_pool_destroy(pool); +} + +static void test_decode_base64_binary(abts_case * tc, void *data) +{ + apr_pool_t *pool; + const char *src; + const unsigned char *utarget; + const unsigned char *udest; + apr_size_t len; + + apr_pool_create(&pool, NULL); + + /* + * Test vectors from https://tools.ietf.org/html/rfc4648#section-10 + */ + src = ""; + utarget = (unsigned char[]){ + }; + udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(utarget, udest, 0) == 0); + ABTS_INT_EQUAL(tc, len, 0); + + src = "Zg=="; + utarget = (unsigned char[]){ + 'f' + }; + udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(utarget, udest, 1) == 0); + ABTS_INT_EQUAL(tc, len, 1); + + src = "Zg"; + utarget = (unsigned char[]){ + 'f' + }; + udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(utarget, udest, 1) == 0); + ABTS_INT_EQUAL(tc, len, 1); + + src = "Zm8="; + utarget = (unsigned char[]){ + 'f', 'o' + }; + udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(utarget, udest, 2) == 0); + ABTS_INT_EQUAL(tc, len, 2); + + src = "Zm8"; + utarget = (unsigned char[]){ + 'f', 'o' + }; + udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(utarget, udest, 2) == 0); + ABTS_INT_EQUAL(tc, len, 2); + + src = "Zm9v"; + utarget = (unsigned char[]){ + 'f', 'o', 'o' + }; + udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(utarget, udest, 3) == 0); + ABTS_INT_EQUAL(tc, len, 3); + + src = "Zm9v"; + utarget = (unsigned char[]){ + 'f', 'o', 'o' + }; + udest = apr_pdecode_base64_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base64_binary target!=dest", memcmp(utarget, udest, 3) == 0); + ABTS_INT_EQUAL(tc, len, 3); + + apr_pool_destroy(pool); +} + +static void test_encode_base32(abts_case * tc, void *data) +{ + apr_pool_t *pool; + const char *src, *target; + const char *dest; + apr_size_t len; + + apr_pool_create(&pool, NULL); + + /* + * Test vectors from https://tools.ietf.org/html/rfc4648#section-10 + */ + src = ""; + target = ""; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "f"; + target = "MY======"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "f"; + target = "MY"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "f"; + target = "CO======"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "f"; + target = "CO"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX | APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "fo"; + target = "MZXQ===="; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "fo"; + target = "MZXQ"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "fo"; + target = "CPNG===="; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "fo"; + target = "CPNG"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX | APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "foo"; + target = "MZXW6==="; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "foo"; + target = "MZXW6"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "foo"; + target = "CPNMU==="; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "foo"; + target = "CPNMU"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX | APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "foob"; + target = "MZXW6YQ="; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "foob"; + target = "MZXW6YQ"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "foob"; + target = "CPNMUOG="; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "foob"; + target = "CPNMUOG"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX | APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "fooba"; + target = "MZXW6YTB"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "fooba"; + target = "MZXW6YTB"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "fooba"; + target = "CPNMUOJ1"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "fooba"; + target = "CPNMUOJ1"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX | APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "foobar"; + target = "MZXW6YTBOI======"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "foobar"; + target = "MZXW6YTBOI"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "foobar"; + target = "CPNMUOJ1E8======"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "foobar"; + target = "CPNMUOJ1E8"; + dest = apr_pencode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX | APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + apr_pool_destroy(pool); +} + +static void test_encode_base32_binary(abts_case * tc, void *data) +{ + apr_pool_t *pool; + const char *target; + const unsigned char *usrc; + const char *dest; + apr_size_t len; + + apr_pool_create(&pool, NULL); + + /* + * Test vectors from https://tools.ietf.org/html/rfc4648#section-10 + */ + usrc = (unsigned char[]){ + }; + target = ""; + dest = apr_pencode_base32_binary(pool, usrc, 0, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f' + }; + target = "MY======"; + dest = apr_pencode_base32_binary(pool, usrc, 1, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f' + }; + target = "MY"; + dest = apr_pencode_base32_binary(pool, usrc, 1, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f' + }; + target = "CO======"; + dest = apr_pencode_base32_binary(pool, usrc, 1, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f' + }; + target = "CO"; + dest = apr_pencode_base32_binary(pool, usrc, 1, APR_ENCODE_BASE32HEX | APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o' + }; + target = "MZXQ===="; + dest = apr_pencode_base32_binary(pool, usrc, 2, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o' + }; + target = "MZXQ"; + dest = apr_pencode_base32_binary(pool, usrc, 2, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o' + }; + target = "CPNG===="; + dest = apr_pencode_base32_binary(pool, usrc, 2, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o' + }; + target = "CPNG"; + dest = apr_pencode_base32_binary(pool, usrc, 2, APR_ENCODE_BASE32HEX | APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o' + }; + target = "MZXW6==="; + dest = apr_pencode_base32_binary(pool, usrc, 3, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o' + }; + target = "MZXW6"; + dest = apr_pencode_base32_binary(pool, usrc, 3, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o' + }; + target = "CPNMU==="; + dest = apr_pencode_base32_binary(pool, usrc, 3, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o' + }; + target = "CPNMU"; + dest = apr_pencode_base32_binary(pool, usrc, 3, APR_ENCODE_BASE32HEX | APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o', 'b' + }; + target = "MZXW6YQ="; + dest = apr_pencode_base32_binary(pool, usrc, 4, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o', 'b' + }; + target = "MZXW6YQ"; + dest = apr_pencode_base32_binary(pool, usrc, 4, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o', 'b' + }; + target = "CPNMUOG="; + dest = apr_pencode_base32_binary(pool, usrc, 4, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o', 'b' + }; + target = "CPNMUOG"; + dest = apr_pencode_base32_binary(pool, usrc, 4, APR_ENCODE_BASE32HEX | APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a' + }; + target = "MZXW6YTB"; + dest = apr_pencode_base32_binary(pool, usrc, 5, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a' + }; + target = "MZXW6YTB"; + dest = apr_pencode_base32_binary(pool, usrc, 5, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a' + }; + target = "CPNMUOJ1"; + dest = apr_pencode_base32_binary(pool, usrc, 5, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a' + }; + target = "CPNMUOJ1"; + dest = apr_pencode_base32_binary(pool, usrc, 5, APR_ENCODE_BASE32HEX | APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a', 'r' + }; + target = "MZXW6YTBOI======"; + dest = apr_pencode_base32_binary(pool, usrc, 6, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a', 'r' + }; + target = "MZXW6YTBOI"; + dest = apr_pencode_base32_binary(pool, usrc, 6, APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a', 'r' + }; + target = "CPNMUOJ1E8======"; + dest = apr_pencode_base32_binary(pool, usrc, 6, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + usrc = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a', 'r' + }; + target = "CPNMUOJ1E8"; + dest = apr_pencode_base32_binary(pool, usrc, 6, APR_ENCODE_BASE32HEX | APR_ENCODE_NOPADDING, &len); + ABTS_STR_EQUAL(tc, target, dest); + + apr_pool_destroy(pool); +} + +static void test_decode_base32(abts_case * tc, void *data) +{ + apr_pool_t *pool; + const char *target, *src; + const char *dest; + apr_size_t len; + + apr_pool_create(&pool, NULL); + + /* + * Test vectors from https://tools.ietf.org/html/rfc4648#section-10 + */ + src = ""; + target = ""; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "MY======"; + target = "f"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "MY"; + target = "f"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "CO======"; + target = "f"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "CO"; + target = "f"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "MZXQ===="; + target = "fo"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "MZXQ"; + target = "fo"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "CPNG===="; + target = "fo"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "CPNG"; + target = "fo"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "MZXW6==="; + target = "foo"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "MZXW6"; + target = "foo"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "CPNMU==="; + target = "foo"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "CPNMU"; + target = "foo"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "MZXW6YQ="; + target = "foob"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "MZXW6YQ="; + target = "foob"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "CPNMUOG="; + target = "foob"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "CPNMUOG"; + target = "foob"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "MZXW6YTB"; + target = "fooba"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "MZXW6YTB"; + target = "fooba"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "CPNMUOJ1"; + target = "fooba"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "CPNMUOJ1"; + target = "fooba"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "MZXW6YTBOI======"; + target = "foobar"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "MZXW6YTBOI"; + target = "foobar"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "CPNMUOJ1E8======"; + target = "foobar"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + src = "CPNMUOJ1E8"; + target = "foobar"; + dest = apr_pdecode_base32(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_STR_EQUAL(tc, target, dest); + + apr_pool_destroy(pool); +} + +static void test_decode_base32_binary(abts_case * tc, void *data) +{ + apr_pool_t *pool; + const char *src; + const unsigned char *utarget; + const unsigned char *udest; + apr_size_t len; + + apr_pool_create(&pool, NULL); + + /* + * Test vectors from https://tools.ietf.org/html/rfc4648#section-10 + */ + src = ""; + utarget = (unsigned char[]){ + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 0) == 0); + ABTS_INT_EQUAL(tc, 0, len); + + src = "MY======"; + utarget = (unsigned char[]){ + 'f' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 1) == 0); + ABTS_INT_EQUAL(tc, 1, len); + + src = "MY"; + utarget = (unsigned char[]){ + 'f' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 1) == 0); + ABTS_INT_EQUAL(tc, 1, len); + + src = "CO======"; + utarget = (unsigned char[]){ + 'f' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 1) == 0); + ABTS_INT_EQUAL(tc, 1, len); + + src = "CO"; + utarget = (unsigned char[]){ + 'f' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 1) == 0); + ABTS_INT_EQUAL(tc, 1, len); + + src = "MZXQ===="; + utarget = (unsigned char[]){ + 'f', 'o' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 2) == 0); + ABTS_INT_EQUAL(tc, 2, len); + + src = "MZXQ"; + utarget = (unsigned char[]){ + 'f', 'o' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 2) == 0); + ABTS_INT_EQUAL(tc, 2, len); + + src = "CPNG===="; + utarget = (unsigned char[]){ + 'f', 'o' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 2) == 0); + ABTS_INT_EQUAL(tc, 2, len); + + src = "CPNG"; + utarget = (unsigned char[]){ + 'f', 'o' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 2) == 0); + ABTS_INT_EQUAL(tc, 2, len); + + src = "MZXW6==="; + utarget = (unsigned char[]){ + 'f', 'o', 'o' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 3) == 0); + ABTS_INT_EQUAL(tc, 3, len); + + src = "MZXW6"; + utarget = (unsigned char[]){ + 'f', 'o', 'o' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 3) == 0); + ABTS_INT_EQUAL(tc, 3, len); + + src = "CPNMU==="; + utarget = (unsigned char[]){ + 'f', 'o', 'o' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 3) == 0); + ABTS_INT_EQUAL(tc, 3, len); + + src = "CPNMU"; + utarget = (unsigned char[]){ + 'f', 'o', 'o' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 3) == 0); + ABTS_INT_EQUAL(tc, 3, len); + + src = "MZXW6YQ="; + utarget = (unsigned char[]){ + 'f', 'o', 'o', 'b' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 4) == 0); + ABTS_INT_EQUAL(tc, 4, len); + + src = "MZXW6YQ="; + utarget = (unsigned char[]){ + 'f', 'o', 'o', 'b' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 4) == 0); + ABTS_INT_EQUAL(tc, 4, len); + + src = "CPNMUOG="; + utarget = (unsigned char[]){ + 'f', 'o', 'o', 'b' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 4) == 0); + ABTS_INT_EQUAL(tc, 4, len); + + src = "CPNMUOG"; + utarget = (unsigned char[]){ + 'f', 'o', 'o', 'b' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 4) == 0); + ABTS_INT_EQUAL(tc, 4, len); + + src = "MZXW6YTB"; + utarget = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 5) == 0); + ABTS_INT_EQUAL(tc, 5, len); + + src = "MZXW6YTB"; + utarget = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 5) == 0); + ABTS_INT_EQUAL(tc, 5, len); + + src = "CPNMUOJ1"; + utarget = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 5) == 0); + ABTS_INT_EQUAL(tc, 5, len); + + src = "CPNMUOJ1"; + utarget = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 5) == 0); + ABTS_INT_EQUAL(tc, 5, len); + + src = "MZXW6YTBOI======"; + utarget = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a', 'r' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 6) == 0); + ABTS_INT_EQUAL(tc, 6, len); + + src = "MZXW6YTBOI"; + utarget = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a', 'r' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 6) == 0); + ABTS_INT_EQUAL(tc, 6, len); + + src = "CPNMUOJ1E8======"; + utarget = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a', 'r' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 6) == 0); + ABTS_INT_EQUAL(tc, 6, len); + + src = "CPNMUOJ1E8"; + utarget = (unsigned char[]){ + 'f', 'o', 'o', 'b', 'a', 'r' + }; + udest = apr_pdecode_base32_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_BASE32HEX, &len); + ABTS_ASSERT(tc, "apr_pdecode_base32_binary target!=dest", memcmp(utarget, udest, 6) == 0); + ABTS_INT_EQUAL(tc, 6, len); + + apr_pool_destroy(pool); +} + +static void test_encode_base16(abts_case * tc, void *data) +{ + apr_pool_t *pool; + const char *src, *target; + const char *dest; + apr_size_t len; + + apr_pool_create(&pool, NULL); + + src = "foobar"; + target = "666f6f626172"; + dest = apr_pencode_base16(pool, src, APR_ENCODE_STRING, APR_ENCODE_LOWER, &len); + ABTS_STR_EQUAL(tc, target, dest); + apr_encode_base16(NULL, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "foobar"; + target = "666F6F626172"; + dest = apr_pencode_base16(pool, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + apr_encode_base16(NULL, src, APR_ENCODE_STRING, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "foobar"; + target = "66:6f:6f:62:61:72"; + dest = apr_pencode_base16(pool, src, APR_ENCODE_STRING, APR_ENCODE_COLON | APR_ENCODE_LOWER, &len); + ABTS_STR_EQUAL(tc, target, dest); + apr_encode_base16(NULL, src, APR_ENCODE_STRING, APR_ENCODE_COLON, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + src = "foobar"; + target = "66:6F:6F:62:61:72"; + dest = apr_pencode_base16(pool, src, APR_ENCODE_STRING, APR_ENCODE_COLON, &len); + ABTS_STR_EQUAL(tc, target, dest); + apr_encode_base16(NULL, src, APR_ENCODE_STRING, APR_ENCODE_COLON, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + apr_pool_destroy(pool); +} + +static void test_encode_base16_binary(abts_case * tc, void *data) +{ + apr_pool_t *pool; + const char *target; + const unsigned char *usrc; + const char *dest; + apr_size_t len; + + apr_pool_create(&pool, NULL); + + usrc = (unsigned char[]){ + 0xFF, 0x00, 0xFF, 0x00 + }; + target = "ff00ff00"; + dest = apr_pencode_base16_binary(pool, usrc, 4, APR_ENCODE_LOWER, &len); + ABTS_STR_EQUAL(tc, target, dest); + apr_encode_base16_binary(NULL, usrc, 4, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + usrc = (unsigned char[]){ + 0xFF, 0x00, 0xFF, 0x00 + }; + target = "FF00FF00"; + dest = apr_pencode_base16_binary(pool, usrc, 4, APR_ENCODE_NONE, &len); + ABTS_STR_EQUAL(tc, target, dest); + apr_encode_base16_binary(NULL, usrc, 4, APR_ENCODE_NONE, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + usrc = (unsigned char[]){ + 0xFF, 0x00, 0xFF, 0x00 + }; + target = "ff:00:ff:00"; + dest = apr_pencode_base16_binary(pool, usrc, 4, APR_ENCODE_COLON | APR_ENCODE_LOWER, &len); + ABTS_STR_EQUAL(tc, target, dest); + apr_encode_base16_binary(NULL, usrc, 4, APR_ENCODE_COLON, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + usrc = (unsigned char[]){ + 0xFF, 0x00, 0xFF, 0x00 + }; + target = "FF:00:FF:00"; + dest = apr_pencode_base16_binary(pool, usrc, 4, APR_ENCODE_COLON, &len); + ABTS_STR_EQUAL(tc, target, dest); + apr_encode_base16_binary(NULL, usrc, 4, APR_ENCODE_COLON, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, strlen(dest) + 1), + (len == strlen(dest) + 1)); + + apr_pool_destroy(pool); +} + +static void test_decode_base16(abts_case * tc, void *data) +{ + apr_pool_t *pool; + const char *src, *target; + const char *dest; + apr_size_t len; + + apr_pool_create(&pool, NULL); + + src = "3A:3B:3C:3D"; + target = ":;<="; + dest = apr_pdecode_base16(pool, src, APR_ENCODE_STRING, APR_ENCODE_COLON, &len); + ABTS_STR_EQUAL(tc, target, dest); + ABTS_INT_EQUAL(tc, 4, (int)len); + apr_decode_base16(NULL, src, APR_ENCODE_STRING, APR_ENCODE_COLON, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, (apr_size_t) 5), + (len == 5)); + + apr_pool_destroy(pool); +} + +static void test_decode_base16_binary(abts_case * tc, void *data) +{ + apr_pool_t *pool; + const char *src; + const unsigned char *utarget; + const unsigned char *udest; + apr_size_t len, vlen; + + apr_pool_create(&pool, NULL); + + src = "ff:00:ff:00"; + utarget = (unsigned char[]){ + 0xFF, 0x00, 0xFF, 0x00 + }; + udest = apr_pdecode_base16_binary(pool, src, APR_ENCODE_STRING, APR_ENCODE_COLON, &vlen); + ABTS_ASSERT(tc, "apr_pdecode_base16_binary target!=dest", memcmp(utarget, udest, 4) == 0); + ABTS_INT_EQUAL(tc, (int)vlen, 4); + apr_decode_base16_binary(NULL, src, APR_ENCODE_STRING, APR_ENCODE_COLON, &len); + ABTS_ASSERT(tc, + apr_psprintf(pool, "size mismatch (%" APR_SIZE_T_FMT "!=%" APR_SIZE_T_FMT ")", len, (apr_size_t) 4), + (len == 4)); + + apr_pool_destroy(pool); +} + +abts_suite *testencode(abts_suite * suite) +{ + suite = ADD_SUITE(suite); + + abts_run_test(suite, test_encode_base64, NULL); + abts_run_test(suite, test_encode_base64_binary, NULL); + abts_run_test(suite, test_decode_base64, NULL); + abts_run_test(suite, test_decode_base64_binary, NULL); + abts_run_test(suite, test_encode_base32, NULL); + abts_run_test(suite, test_encode_base32_binary, NULL); + abts_run_test(suite, test_decode_base32, NULL); + abts_run_test(suite, test_decode_base32_binary, NULL); + abts_run_test(suite, test_encode_base16, NULL); + abts_run_test(suite, test_encode_base16_binary, NULL); + abts_run_test(suite, test_decode_base16, NULL); + abts_run_test(suite, test_decode_base16_binary, NULL); + + return suite; +} diff --git a/test/testutil.h b/test/testutil.h index f2a66b585ec..3a3ad2416c6 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -70,6 +70,7 @@ abts_suite *testatomic(abts_suite *suite); abts_suite *testdir(abts_suite *suite); abts_suite *testdso(abts_suite *suite); abts_suite *testdup(abts_suite *suite); +abts_suite *testencode(abts_suite *suite); abts_suite *testenv(abts_suite *suite); abts_suite *testfile(abts_suite *suite); abts_suite *testfilecopy(abts_suite *suite); From 21c92adbca79c860e75a2723f45b800b964cc4fc Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 25 Jun 2018 21:00:43 +0000 Subject: [PATCH 7803/7878] FIx some formatting oddness introduced by the indent tool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834372 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_encode.h | 114 +++++++++++++++++++++---------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/include/apr_encode.h b/include/apr_encode.h index f2a66c6a76e..bfcaf893b3a 100644 --- a/include/apr_encode.h +++ b/include/apr_encode.h @@ -176,8 +176,8 @@ extern "C" { * not NULL, returns the number of characters actually written. * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL. */ - APR_DECLARE(apr_status_t) apr_encode_base64_binary(char *dest, const unsigned char *src, - apr_ssize_t slen, int flags, apr_size_t * len); +APR_DECLARE(apr_status_t) apr_encode_base64_binary(char *dest, const unsigned char *src, + apr_ssize_t slen, int flags, apr_size_t * len); /** * Convert text data to base64, and return the results from a pool. @@ -194,8 +194,8 @@ extern "C" { * @return A zero padded string allocated from the pool on success, or * NULL if src was NULL. */ - APR_DECLARE(const char *)apr_pencode_base64(apr_pool_t * p, const char *src, - apr_ssize_t slen, int flags, apr_size_t * len)__attribute__((nonnull(1))); +APR_DECLARE(const char *)apr_pencode_base64(apr_pool_t * p, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len)__attribute__((nonnull(1))); /** * Convert binary data to base64, and return the results from a pool. @@ -211,8 +211,8 @@ extern "C" { * @return A zero padded string allocated from the pool on success, or * NULL if src was NULL. */ - APR_DECLARE(const char *)apr_pencode_base64_binary(apr_pool_t * p, const unsigned char *src, - apr_ssize_t slen, int flags, apr_size_t * len)__attribute__((nonnull(1))); +APR_DECLARE(const char *)apr_pencode_base64_binary(apr_pool_t * p, const unsigned char *src, + apr_ssize_t slen, int flags, apr_size_t * len)__attribute__((nonnull(1))); /** * Convert base64 or base64url with or without padding to text data. @@ -229,8 +229,8 @@ extern "C" { * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH * if a non hex character is present. */ - APR_DECLARE(apr_status_t) apr_decode_base64(char *dest, const char *src, - apr_ssize_t slen, int flags, apr_size_t * len); +APR_DECLARE(apr_status_t) apr_decode_base64(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len); /** * Convert base64 or base64url with or without padding to binary data. @@ -247,8 +247,8 @@ extern "C" { * @return APR_SUCCESS, or APR_NOTFOUND if the src was NULL, or APR_BADCH * if a non base64 character is present. */ - APR_DECLARE(apr_status_t) apr_decode_base64_binary(unsigned char *dest, - const char *src, apr_ssize_t slen, int flags, apr_size_t * len); +APR_DECLARE(apr_status_t) apr_decode_base64_binary(unsigned char *dest, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len); /** * Convert base64 or base64url with or without padding to text data, and @@ -265,9 +265,9 @@ extern "C" { * @return A string allocated from the pool containing the result with a zero * pad. If src was NULL, or an error occurred, NULL is returned. */ - APR_DECLARE(const char *)apr_pdecode_base64(apr_pool_t * p, const char *src, - apr_ssize_t slen, int flags, apr_size_t * len) - __attribute__((nonnull(1))); +APR_DECLARE(const char *)apr_pdecode_base64(apr_pool_t * p, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); /** * Convert base64 or base64url with or without padding to binary data, and @@ -284,9 +284,9 @@ extern "C" { * @return A buffer allocated from the pool containing the result with a zero * pad. If src was NULL, or an error occurred, NULL is returned. */ - APR_DECLARE(const unsigned char *)apr_pdecode_base64_binary(apr_pool_t * p, - const char *src, apr_ssize_t slen, int flags, apr_size_t * len) - __attribute__((nonnull(1))); +APR_DECLARE(const unsigned char *)apr_pdecode_base64_binary(apr_pool_t * p, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); /** * Convert text data to base32. @@ -302,8 +302,8 @@ extern "C" { * not NULL, returns the number of characters actually written. * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL. */ - APR_DECLARE(apr_status_t) apr_encode_base32(char *dest, const char *src, - apr_ssize_t slen, int flags, apr_size_t * len); +APR_DECLARE(apr_status_t) apr_encode_base32(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len); /** * Convert binary data to base32. @@ -318,8 +318,8 @@ extern "C" { * not NULL, returns the number of characters actually written. * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL. */ - APR_DECLARE(apr_status_t) apr_encode_base32_binary(char *dest, const unsigned char *src, - apr_ssize_t slen, int flags, apr_size_t * len); +APR_DECLARE(apr_status_t) apr_encode_base32_binary(char *dest, const unsigned char *src, + apr_ssize_t slen, int flags, apr_size_t * len); /** * Convert text data to base32, and return the results from a pool. @@ -335,9 +335,9 @@ extern "C" { * @return A zero padded string allocated from the pool on success, or * NULL if src was NULL. */ - APR_DECLARE(const char *)apr_pencode_base32(apr_pool_t * p, const char *src, - apr_ssize_t slen, int flags, apr_size_t * len) - __attribute__((nonnull(1))); +APR_DECLARE(const char *)apr_pencode_base32(apr_pool_t * p, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); /** * Convert binary data to base32, and return the results from a pool. @@ -352,9 +352,9 @@ extern "C" { * @return A zero padded string allocated from the pool on success, or * NULL if src was NULL. */ - APR_DECLARE(const char *)apr_pencode_base32_binary(apr_pool_t * p, const unsigned char *src, - apr_ssize_t slen, int flags, apr_size_t * len) - __attribute__((nonnull(1))); +APR_DECLARE(const char *)apr_pencode_base32_binary(apr_pool_t * p, const unsigned char *src, + apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); /** * Convert base32 or base32hex with or without padding to text data. @@ -370,8 +370,8 @@ extern "C" { * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH * if a non base32 character is present. */ - APR_DECLARE(apr_status_t) apr_decode_base32(char *dest, const char *src, - apr_ssize_t slen, int flags, apr_size_t * len); +APR_DECLARE(apr_status_t) apr_decode_base32(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len); /** * Convert base32 or base32hex with or without padding to binary data. @@ -387,8 +387,8 @@ extern "C" { * @return APR_SUCCESS, or APR_NOTFOUND if the src was NULL, or APR_BADCH * if a non base32 character is present. */ - APR_DECLARE(apr_status_t) apr_decode_base32_binary(unsigned char *dest, - const char *src, apr_ssize_t slen, int flags, apr_size_t * len); +APR_DECLARE(apr_status_t) apr_decode_base32_binary(unsigned char *dest, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len); /** * Convert base32 or base32hex with or without padding to text data, and @@ -404,9 +404,9 @@ extern "C" { * @return A string allocated from the pool containing the result with a zero * pad. If src was NULL, or an error occurred, NULL is returned. */ - APR_DECLARE(const char *)apr_pdecode_base32(apr_pool_t * p, const char *src, - apr_ssize_t slen, int flags, apr_size_t * len) - __attribute__((nonnull(1))); +APR_DECLARE(const char *)apr_pdecode_base32(apr_pool_t * p, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); /** * Convert base32 or base32hex with or without padding to binary data, and @@ -422,9 +422,9 @@ extern "C" { * @return A buffer allocated from the pool containing the result with a zero * pad. If src was NULL, or an error occurred, NULL is returned. */ - APR_DECLARE(const unsigned char *)apr_pdecode_base32_binary(apr_pool_t * p, - const char *src, apr_ssize_t slen, int flags, apr_size_t * len) - __attribute__((nonnull(1))); +APR_DECLARE(const unsigned char *)apr_pdecode_base32_binary(apr_pool_t * p, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); /** * Convert text data to base16 (hex). @@ -439,8 +439,8 @@ extern "C" { * not NULL, returns the number of characters actually written. * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL. */ - APR_DECLARE(apr_status_t) apr_encode_base16(char *dest, const char *src, - apr_ssize_t slen, int flags, apr_size_t * len); +APR_DECLARE(apr_status_t) apr_encode_base16(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len); /** * Convert binary data to base16 (hex). @@ -454,9 +454,9 @@ extern "C" { * not NULL, returns the number of characters actually written. * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL. */ - APR_DECLARE(apr_status_t) apr_encode_base16_binary(char *dest, - const unsigned char *src, apr_ssize_t slen, int flags, - apr_size_t * len); +APR_DECLARE(apr_status_t) apr_encode_base16_binary(char *dest, + const unsigned char *src, apr_ssize_t slen, int flags, + apr_size_t * len); /** * Convert text data to base16 (hex), and return the results from a @@ -472,9 +472,9 @@ extern "C" { * @return A string allocated from the pool containing the result with a zero * pad. If src was NULL, or an error occurred, NULL is returned. */ - APR_DECLARE(const char *)apr_pencode_base16(apr_pool_t * p, const char *src, - apr_ssize_t slen, int flags, apr_size_t * len) - __attribute__((nonnull(1))); +APR_DECLARE(const char *)apr_pencode_base16(apr_pool_t * p, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); /** * Convert binary data to base16 (hex), and return the results from a @@ -489,9 +489,9 @@ extern "C" { * @return A string allocated from the pool containing the result with a zero * pad. If src was NULL, or an error occurred, NULL is returned. */ - APR_DECLARE(const char *)apr_pencode_base16_binary(apr_pool_t * p, - const unsigned char *src, apr_ssize_t slen, - int flags, apr_size_t * len)__attribute__((nonnull(1))); +APR_DECLARE(const char *)apr_pencode_base16_binary(apr_pool_t * p, + const unsigned char *src, apr_ssize_t slen, + int flags, apr_size_t * len)__attribute__((nonnull(1))); /** * Convert base16 (hex) to text data. @@ -507,8 +507,8 @@ extern "C" { * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH * if a non hex character is present. A zero pad is appended to the buffer. */ - APR_DECLARE(apr_status_t) apr_decode_base16(char *dest, const char *src, - apr_ssize_t slen, int flags, apr_size_t * len); +APR_DECLARE(apr_status_t) apr_decode_base16(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len); /** * Convert base16 (hex) to binary data. @@ -524,8 +524,8 @@ extern "C" { * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH * if a non hex character is present. No zero pad is written to the buffer. */ - APR_DECLARE(apr_status_t) apr_decode_base16_binary(unsigned char *dest, - const char *src, apr_ssize_t slen, int flags, apr_size_t * len); +APR_DECLARE(apr_status_t) apr_decode_base16_binary(unsigned char *dest, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len); /** * Convert base16 (hex) and return the results from a pool. @@ -540,9 +540,9 @@ extern "C" { * @return A buffer allocated from the pool containing the result with a zero * pad. If src was NULL, or an error occurred, NULL is returned. */ - APR_DECLARE(const char *)apr_pdecode_base16(apr_pool_t * p, const char *src, - apr_ssize_t slen, int flags, apr_size_t * len) - __attribute__((nonnull(1))); +APR_DECLARE(const char *)apr_pdecode_base16(apr_pool_t * p, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); /** * Convert base16 (hex) to binary data, and return the results from a pool. @@ -557,9 +557,9 @@ extern "C" { * @return A buffer allocated from the pool containing the result with a zero * pad. If src was NULL, or an error occurred, NULL is returned. */ - APR_DECLARE(const unsigned char *)apr_pdecode_base16_binary(apr_pool_t * p, - const char *src, apr_ssize_t slen, int flags, apr_size_t * len) - __attribute__((nonnull(1))); +APR_DECLARE(const unsigned char *)apr_pdecode_base16_binary(apr_pool_t * p, + const char *src, apr_ssize_t slen, int flags, apr_size_t * len) + __attribute__((nonnull(1))); /** @} */ #ifdef __cplusplus From 08b7647543c928cb95965f35f65791add4240d77 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 25 Jun 2018 21:07:24 +0000 Subject: [PATCH 7804/7878] FIx one more formatting oddness introduced by the indent tool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834376 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_encode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_encode.h b/include/apr_encode.h index bfcaf893b3a..ad3813961b5 100644 --- a/include/apr_encode.h +++ b/include/apr_encode.h @@ -159,8 +159,8 @@ extern "C" { * not NULL, returns the number of characters actually written. * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL. */ - APR_DECLARE(apr_status_t) apr_encode_base64(char *dest, const char *src, - apr_ssize_t slen, int flags, apr_size_t * len); +APR_DECLARE(apr_status_t) apr_encode_base64(char *dest, const char *src, + apr_ssize_t slen, int flags, apr_size_t * len); /** * Convert binary data to base64. From 3e9b793995ee2db25082d831ef76f09a21b564f0 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 27 Jun 2018 11:41:30 +0000 Subject: [PATCH 7805/7878] * build/buildcheck.sh, buildconf: Detect and run under Python 3 or 2, and respect $PYTHON. * build/gen-build.py: Fix various Python 3 compatibility issues. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834494 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 4 ++-- build/gen-build.py | 45 ++++++++++++++++++++++++--------------------- buildconf | 4 +++- 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index ab5df445c4a..76ff8cef285 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -4,14 +4,14 @@ echo "buildconf: checking installation..." res=0 # any python -python=`build/PrintPath python` +python=${PYTHON-`build/PrintPath python3 python2 python`} if test -z "$python"; then echo "buildconf: python not found." echo " You need python installed" echo " to build APR from SVN." res=1 else - py_version=`python -c 'import sys; print sys.version' 2>&1|sed 's/ .*//;q'` + py_version=`$python -c 'import sys; print(sys.version)' 2>&1|sed 's/ .*//;q'` echo "buildconf: python version $py_version (ok)" fi diff --git a/build/gen-build.py b/build/gen-build.py index 054422abcde..4874f0eb414 100755 --- a/build/gen-build.py +++ b/build/gen-build.py @@ -10,7 +10,10 @@ import os -import ConfigParser +try: + import configparser +except ImportError: + import ConfigParser as configparser import getopt import string import glob @@ -36,7 +39,7 @@ def main(): - parser = ConfigParser.ConfigParser() + parser = configparser.ConfigParser() parser.read('build.conf') if parser.has_option('options', 'dsp'): @@ -62,7 +65,7 @@ def main(): # write out the platform-independent files files = get_files(parser.get('options', 'paths')) objects, dirs = write_objects(f, legal_deps, h_deps, files) - f.write('\nOBJECTS_all = %s\n\n' % string.join(objects)) + f.write('\nOBJECTS_all = %s\n\n' % " ".join(objects)) # for each platform and each subdirectory holding platform-specific files, # write out their compilation rules, and an OBJECT__ symbol. @@ -86,11 +89,11 @@ def main(): inherit_files[-1] = inherit_files[-1][:-2] + '.lo' # replace the \\'s with /'s inherit_line = '/'.join(inherit_files) - if not inherit_parent.has_key(inherit_files[0]): + if inherit_files[0] not in inherit_parent: inherit_parent[inherit_files[0]] = [] inherit_parent[inherit_files[0]].append(inherit_line) - for subdir in string.split(parser.get('options', 'platform_dirs')): + for subdir in parser.get('options', 'platform_dirs').split(): path = '%s/%s' % (subdir, platform) if not os.path.exists(path): # this subdir doesn't have a subdir for this platform, so we'll @@ -106,7 +109,7 @@ def main(): files = get_files(path + '/*.c') objects, _unused = write_objects(f, legal_deps, h_deps, files) - if inherit_parent.has_key(subdir): + if subdir in inherit_parent: objects = objects + inherit_parent[subdir] symname = 'OBJECTS_%s_%s' % (subdir, platform) @@ -114,7 +117,7 @@ def main(): objects.sort() # and write the symbol for the whole group - f.write('\n%s = %s\n\n' % (symname, string.join(objects))) + f.write('\n%s = %s\n\n' % (symname, " ".join(objects))) # and include that symbol in the group group.append('$(%s)' % symname) @@ -122,18 +125,18 @@ def main(): group.sort() # write out a symbol which contains the necessary files - f.write('OBJECTS_%s = %s\n\n' % (platform, string.join(group))) + f.write('OBJECTS_%s = %s\n\n' % (platform, " ".join(group))) - f.write('HEADERS = $(top_srcdir)/%s\n\n' % string.join(headers, ' $(top_srcdir)/')) - f.write('SOURCE_DIRS = %s $(EXTRA_SOURCE_DIRS)\n\n' % string.join(dirs.keys())) + f.write('HEADERS = $(top_srcdir)/%s\n\n' % ' $(top_srcdir)/'.join(headers)) + f.write('SOURCE_DIRS = %s $(EXTRA_SOURCE_DIRS)\n\n' % " ".join(dirs.keys())) if parser.has_option('options', 'modules'): modules = parser.get('options', 'modules') - for mod in string.split(modules): + for mod in modules.split(): files = get_files(parser.get(mod, 'paths')) objects, _unused = write_objects(f, legal_deps, h_deps, files) - flat_objects = string.join(objects) + flat_objects = " ".join(objects) f.write('OBJECTS_%s = %s\n' % (mod, flat_objects)) if parser.has_option(mod, 'target'): @@ -147,10 +150,10 @@ def main(): if parser.has_option('options', 'libraries'): libs = parser.get('options', 'libraries') - for lib in string.split(libs): + for lib in libs.split(): files = get_files(parser.get(lib, 'paths')) objects, _unused = write_objects(f, legal_deps, h_deps, files) - flat_objects = string.join(objects) + flat_objects = " ".join(objects) f.write('OBJECTS_%s = %s\n' % (lib, flat_objects)) if parser.has_option(lib, 'target'): @@ -170,9 +173,9 @@ def main(): d = os.path.dirname(d) # Sort so 'foo' is before 'foo/bar' - keys = alldirs.keys() + keys = list(alldirs.keys()) keys.sort() - f.write('BUILD_DIRS = %s\n\n' % string.join(keys)) + f.write('BUILD_DIRS = %s\n\n' % " ".join(keys)) f.write('.make.dirs: $(srcdir)/build-outputs.mk\n' \ '\t@for d in $(BUILD_DIRS); do test -d $$d || mkdir $$d; done\n' \ @@ -194,12 +197,12 @@ def write_objects(f, legal_deps, h_deps, files): # what headers does this file include, along with the implied headers deps = extract_deps(file, legal_deps) - for hdr in deps.keys(): + for hdr in list(deps.keys()): deps.update(h_deps.get(hdr, {})) - vals = deps.values() + vals = list(deps.values()) vals.sort() - f.write('%s: %s .make.dirs %s\n' % (obj, file, string.join(vals))) + f.write('%s: %s .make.dirs %s\n' % (obj, file, " ".join(vals))) objects.sort() @@ -227,7 +230,7 @@ def resolve_deps(header_deps): for hdr, deps in header_deps.items(): # print hdr, deps start = len(deps) - for dep in deps.keys(): + for dep in list(deps.keys()): deps.update(header_deps.get(dep, {})) if len(deps) != start: altered = 1 @@ -237,7 +240,7 @@ def clean_path(path): def get_files(patterns): files = [ ] - for pat in string.split(patterns): + for pat in patterns.split(): files.extend(map(clean_path, glob.glob(pat))) files.sort() return files diff --git a/buildconf b/buildconf index 113c3c7f620..da8b3bd40be 100755 --- a/buildconf +++ b/buildconf @@ -112,8 +112,10 @@ ${AUTOCONF:-autoconf} $verbose # Remove autoconf 2.5x's cache directory rm -rf autom4te*.cache +PYTHON=${PYTHON-`build/PrintPath python3 python2 python`} + echo "buildconf: generating 'make' outputs ..." -build/gen-build.py $verbose make +${PYTHON} build/gen-build.py $verbose make # Create RPM Spec file if [ -f `which cut` ]; then From 44e52aecc9bb560577217e9d4c47c4aab0071c72 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 27 Jun 2018 20:25:09 +0000 Subject: [PATCH 7806/7878] Follow up to r1834371: enclose bitwise OR macro between parentheses. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834541 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_encode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_encode.h b/include/apr_encode.h index ad3813961b5..20fc932f6f5 100644 --- a/include/apr_encode.h +++ b/include/apr_encode.h @@ -127,7 +127,7 @@ extern "C" { /** * Generate RFC7515 BASE64URL */ -#define APR_ENCODE_BASE64URL APR_ENCODE_NOPADDING | APR_ENCODE_URL +#define APR_ENCODE_BASE64URL (APR_ENCODE_NOPADDING | APR_ENCODE_URL) /** * Generate base32hex encoding instead of base32 encoding From 42793423e104277803f9dcf23e2a5bc5e2810a26 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 27 Jun 2018 22:17:42 +0000 Subject: [PATCH 7807/7878] apr_crypto: follow up to r1833359: improve CPRNGs fork()ing. Rework apr_crypto_prng_after_fork() which now handles rekeying of all the CPRNGs created within apr_crypto, by maintaining them in a global APR_RING, with the notable exception of per-thread ones (never forked). For each maintained CPRNG, apr_crypto_prng_after_fork() will now first rekey both the parent and child processes (determined by the 'in_child' argument provided by the caller), and for the parent only rekey a second time so that the initial states finally differ for both processes. Once these new keys are committed to their respective CPRNGs, thanks to and in continuity with the forward secrecy construct of apr_crypto_prng, there will be no in memory key material or stream that one process can inherit or infer from the other. The user can also rekey a CPRNG explicitely by calling the new function apr_crypto_prng_rekey(), and this is done by apr_fork() implicitely before forking any child, thus for the parent process. This safe guard ensures both the clearing of the pooled random bytes (buffered keystream) and the renewal of key material (cheap and preventive against _atfork() handlers or alike). Rekeying is done by using each CPRNG's keystream directly, there isn't anymore the use of a PID (or SHA256 thereof) for children processes nor any extra reads from the system RNG. All the apr_crypto_prng API is now self contained and can work entirely with a single stream cipher as primitive (Chacha20 or AES256-CTR, in that order of availability) and the initial entropy of 32 bytes gathered from the system. IOW, there is only one call issued to the system RNG for the global CPRNG's initial key, and if more CPRNGs are created their own initial key is produced by the global CPRNG. The KAT arrays in the tests suite needed adjustment too because the initial seed (if provided, like the zeros-input for the KAT) is no more used directly as the first key. Instead the first 32 bytes of the keystream generated from the seed are, and the seed (like any just used key) is then cleared immediatly from internal memory. Finally some private APR_CRYPTO_PRNG_* macros (in .c file only) are renamed to CPRNG_* to shorten colomns and avoid multilines in several cases. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834551 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_prng.c | 446 ++++++++++++++++++++++++++++----------- include/apr_crypto.h | 41 ++-- test/testcrypto.c | 90 ++++---- threadproc/unix/proc.c | 17 +- 4 files changed, 420 insertions(+), 174 deletions(-) diff --git a/crypto/apr_crypto_prng.c b/crypto/apr_crypto_prng.c index 4b302fb3303..69e1de97623 100644 --- a/crypto/apr_crypto_prng.c +++ b/crypto/apr_crypto_prng.c @@ -18,6 +18,22 @@ * Cryptographic Pseudo Random Number Generator (CPRNG), based on * "Fast-key-erasure random-number generators" from D.J. Bernstein ([1]), * and public domain implementation in libpqcrypto's randombytes() ([2]). + * + * The CPRNG key is changed as soon as it's used to initialize the stream + * cipher, so it never resides in memory at the same time as the keystream + * it produced (a.k.a. the random bytes, which for efficiency are pooled). + * + * Likewise, the keystream is always cleared from the internal state before + * being returned to the user, thus there is no way to recover the produced + * random bytes afterward (e.g. from a memory/core dump after a crash). + * + * IOW, this CPRNG ensures forward secrecy, one may want to run it in a process + * and/or environment protected from live memory eavesdropping, thus keep the + * pooled/future random bytes secret by design, and use it as a replacement + * for some blocking/inefficient system RNG. The random bytes could then be + * serviced through a named pipe/socket, RPC, or any specific API. This is + * outside the scope of this/below code, though. + * * [1] https://blog.cr.yp.to/20170723-random.html * [2] https://libpqcrypto.org/ */ @@ -29,6 +45,7 @@ #if APU_HAVE_CRYPTO #if APU_HAVE_CRYPTO_PRNG +#include "apr_ring.h" #include "apr_pools.h" #include "apr_strings.h" #include "apr_thread_mutex.h" @@ -36,19 +53,28 @@ #include /* for malloc() */ -#define APR_CRYPTO_PRNG_KEY_SIZE 32 -#if APR_CRYPTO_PRNG_SEED_SIZE > APR_CRYPTO_PRNG_KEY_SIZE -#error apr_crypto_prng uses 256bit stream ciphers only +#define CPRNG_KEY_SIZE 32 + +/* Be consistent with the .h (the seed is xor-ed with key on reseed). */ +#if CPRNG_KEY_SIZE != APR_CRYPTO_PRNG_SEED_SIZE +#error apr_crypto_prng handles stream ciphers with 256bit keys only #endif -#define APR_CRYPTO_PRNG_BUF_SIZE_MIN (APR_CRYPTO_PRNG_KEY_SIZE * (8 - 1)) -#define APR_CRYPTO_PRNG_BUF_SIZE_DEF (APR_CRYPTO_PRNG_KEY_SIZE * (24 - 1)) +#define CPRNG_BUF_SIZE_MIN (CPRNG_KEY_SIZE * (8 - 1)) +#define CPRNG_BUF_SIZE_DEF (CPRNG_KEY_SIZE * (24 - 1)) #if APU_HAVE_OPENSSL #include #include +/* We only handle Chacha20 and AES256-CTR stream ciphers, for now. + * AES256-CTR should be in any openssl version of this century but is used + * only if Chacha20 is missing (openssl < 1.1). This is because Chacha20 is + * fast (enough) in software and timing attacks safe, though AES256-CTR can + * be faster and constant-time but only when the CPU (aesni) or some crypto + * hardware are in the place. + */ #include /* for NID_* */ #if !defined(NID_chacha20) && !defined(NID_aes_256_ctr) /* XXX: APU_HAVE_CRYPTO_PRNG && APU_HAVE_OPENSSL shoudn't be defined! */ @@ -93,30 +119,43 @@ void cprng_stream_ctx_free(cprng_stream_ctx_t *ctx) } static APR_INLINE -apr_status_t cprng_stream_ctx_mix(cprng_stream_ctx_t **pctx, - unsigned char *key, unsigned char *to, - const unsigned char *z, apr_size_t n) +apr_status_t cprng_stream_ctx_bytes(cprng_stream_ctx_t **pctx, + unsigned char *key, unsigned char *to, + apr_size_t n, const unsigned char *z) { cprng_stream_ctx_t *ctx = *pctx; int len; - EVP_EncryptInit_ex(ctx, NULL, NULL, key, NULL); - EVP_CIPHER_CTX_set_padding(ctx, 0); - - memset(key, 0, APR_CRYPTO_PRNG_KEY_SIZE); - EVP_EncryptUpdate(ctx, key, &len, key, APR_CRYPTO_PRNG_KEY_SIZE); - EVP_EncryptUpdate(ctx, to, &len, z, n); - - return APR_SUCCESS; -} - -static apr_status_t cprng_hash_to_seed(pid_t pid, unsigned char seed[]) -{ - SHA256_CTX ctx; + /* Can be called for rekeying (key != NULL), streaming more bytes + * with the current key (n != 0), or both successively in a one go. + */ + if (key) { + /* We never encrypt twice with the same key, so we can use an + * all zeros IV. Also EVP_EncryptInit() can be called multiple + * times and it will recycle its previous/replaced resources by + * itself, so since padding is disabled/irrelevant too we don't + * need EVP_EncryptFinish() after each call or before rekeying. + */ +#if defined(NID_chacha20) + /* With CHACHA20, iv=NULL is the same as zeros but it's faster + * to (re-)init; use that for efficiency. + */ + EVP_EncryptInit_ex(ctx, NULL, NULL, key, NULL); +#else + /* With AES256-CTR, iv=NULL seems to peek up and random one (for + * the initial CTR), while we can live with zeros (fixed CTR); + * efficiency still. + */ + EVP_EncryptInit_ex(ctx, NULL, NULL, key, z); +#endif + EVP_CIPHER_CTX_set_padding(ctx, 0); - SHA256_Init(&ctx); - SHA256_Update(&ctx, &pid, sizeof(pid)); - SHA256_Final(seed, &ctx); + memset(key, 0, CPRNG_KEY_SIZE); + EVP_EncryptUpdate(ctx, key, &len, key, CPRNG_KEY_SIZE); + } + if (n) { + EVP_EncryptUpdate(ctx, to, &len, z, n); + } return APR_SUCCESS; } @@ -129,10 +168,11 @@ static apr_status_t cprng_hash_to_seed(pid_t pid, unsigned char seed[]) #endif /* APU_HAVE_OPENSSL */ struct apr_crypto_prng_t { + APR_RING_ENTRY(apr_crypto_prng_t) link; apr_pool_t *pool; cprng_stream_ctx_t *ctx; #if APR_HAS_THREADS - apr_thread_mutex_t *lock; + apr_thread_mutex_t *mutex; #endif unsigned char *key, *buf; apr_size_t len, pos; @@ -140,10 +180,29 @@ struct apr_crypto_prng_t { }; static apr_crypto_prng_t *cprng_global = NULL; +static APR_RING_HEAD(apr_cprng_ring, apr_crypto_prng_t) *cprng_ring; #if APR_HAS_THREADS +static apr_thread_mutex_t *cprng_ring_mutex; + static apr_threadkey_t *cprng_thread_key = NULL; +#define cprng_lock(g) \ + if ((g)->mutex) \ + apr_thread_mutex_lock((g)->mutex) + +#define cprng_unlock(g) \ + if ((g)->mutex) \ + apr_thread_mutex_unlock((g)->mutex) + +#define cprng_ring_lock() \ + if (cprng_ring_mutex) \ + apr_thread_mutex_lock(cprng_ring_mutex) + +#define cprng_ring_unlock() \ + if (cprng_ring_mutex) \ + apr_thread_mutex_unlock(cprng_ring_mutex) + static void cprng_thread_destroy(void *cprng) { if (!cprng_global) { @@ -152,7 +211,13 @@ static void cprng_thread_destroy(void *cprng) } apr_crypto_prng_destroy(cprng); } -#endif + +#else /* !APR_HAS_THREADS */ +#define cprng_lock(g) +#define cprng_unlock(g) +#define cprng_ring_lock() +#define cprng_ring_unlock() +#endif /* !APR_HAS_THREADS */ APR_DECLARE(apr_status_t) apr_crypto_prng_init(apr_pool_t *pool, apr_size_t bufsize, @@ -182,10 +247,25 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_init(apr_pool_t *pool, #endif } + cprng_ring = apr_palloc(pool, sizeof(*cprng_ring)); + if (!cprng_ring) { + return APR_ENOMEM; + } + APR_RING_INIT(cprng_ring, apr_crypto_prng_t, link); + #if APR_HAS_THREADS - /* Global CPRNG is locked */ + rv = apr_thread_mutex_create(&cprng_ring_mutex, APR_THREAD_MUTEX_DEFAULT, + pool); + if (rv != APR_SUCCESS) { + apr_threadkey_private_delete(cprng_thread_key); + cprng_thread_key = NULL; + return rv; + } + + /* Global CPRNG is locked (and obviously not per-thread) */ flags = (flags | APR_CRYPTO_PRNG_LOCKED) & ~APR_CRYPTO_PRNG_PER_THREAD; #endif + return apr_crypto_prng_create(&cprng_global, bufsize, flags, seed, pool); } @@ -201,26 +281,6 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_term(void) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(apr_proc_t *proc) -{ - unsigned char seedb[APR_CRYPTO_PRNG_SEED_SIZE], *seed = NULL; - - if (!cprng_global) { - return APR_EINIT; - } - - if (proc) { - apr_status_t rv; - rv = cprng_hash_to_seed(proc->pid, seedb); - if (rv != APR_SUCCESS) { - return rv; - } - seed = seedb; - } - - return apr_crypto_prng_reseed(cprng_global, seed); -} - APR_DECLARE(apr_status_t) apr_crypto_random_bytes(void *buf, apr_size_t len) { if (!cprng_global) { @@ -249,7 +309,8 @@ APR_DECLARE(apr_status_t) apr_crypto_random_thread_bytes(void *buf, cprng = private; if (!cprng) { - rv = apr_crypto_prng_create(&cprng, 0, 0, NULL, NULL); + rv = apr_crypto_prng_create(&cprng, 0, APR_CRYPTO_PRNG_PER_THREAD, + NULL, NULL); if (rv != APR_SUCCESS) { return rv; } @@ -271,6 +332,15 @@ static apr_status_t cprng_cleanup(void *arg) if (cprng == cprng_global) { cprng_global = NULL; +#if APR_HAS_THREADS + cprng_ring_mutex = NULL; +#endif + cprng_ring = NULL; + } + else if (cprng_global && !(cprng->flags & APR_CRYPTO_PRNG_PER_THREAD)) { + cprng_ring_lock(); + APR_RING_REMOVE(cprng, link); + cprng_ring_unlock(); } if (cprng->ctx) { @@ -278,7 +348,7 @@ static apr_status_t cprng_cleanup(void *arg) } if (cprng->key) { - apr_crypto_memzero(cprng->key, APR_CRYPTO_PRNG_KEY_SIZE + cprng->len); + apr_crypto_memzero(cprng->key, CPRNG_KEY_SIZE + cprng->len); } if (!cprng->pool) { @@ -299,7 +369,11 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_create(apr_crypto_prng_t **pcprng, *pcprng = NULL; - if (bufsize > APR_INT32_MAX - APR_CRYPTO_PRNG_KEY_SIZE + if (!cprng_global && pcprng != &cprng_global) { + return APR_EINIT; + } + + if (bufsize > APR_INT32_MAX - CPRNG_KEY_SIZE || (flags & APR_CRYPTO_PRNG_LOCKED && !pool) || (flags & ~APR_CRYPTO_PRNG_MASK)) { return APR_EINVAL; @@ -324,30 +398,36 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_create(apr_crypto_prng_t **pcprng, cprng->pool = pool; if (bufsize == 0) { - bufsize = APR_CRYPTO_PRNG_BUF_SIZE_DEF; + bufsize = CPRNG_BUF_SIZE_DEF; } - else if (bufsize < APR_CRYPTO_PRNG_BUF_SIZE_MIN) { - bufsize = APR_CRYPTO_PRNG_BUF_SIZE_MIN; + else if (bufsize < CPRNG_BUF_SIZE_MIN) { + bufsize = CPRNG_BUF_SIZE_MIN; } - else if (bufsize % APR_CRYPTO_PRNG_KEY_SIZE) { - bufsize += APR_CRYPTO_PRNG_KEY_SIZE; - bufsize -= bufsize % APR_CRYPTO_PRNG_KEY_SIZE; + else if (bufsize % CPRNG_KEY_SIZE) { + bufsize += CPRNG_KEY_SIZE; + bufsize -= bufsize % CPRNG_KEY_SIZE; } if (pool) { - cprng->key = apr_palloc(pool, APR_CRYPTO_PRNG_KEY_SIZE + bufsize); + cprng->key = apr_palloc(pool, CPRNG_KEY_SIZE + bufsize); } else { - cprng->key = malloc(APR_CRYPTO_PRNG_KEY_SIZE + bufsize); + cprng->key = malloc(CPRNG_KEY_SIZE + bufsize); } if (!cprng->key) { cprng_cleanup(cprng); return APR_ENOMEM; } - cprng->buf = cprng->key + APR_CRYPTO_PRNG_KEY_SIZE; + cprng->buf = cprng->key + CPRNG_KEY_SIZE; cprng->len = bufsize; + rv = cprng_stream_ctx_make(&cprng->ctx); + if (rv != APR_SUCCESS) { + cprng_cleanup(cprng); + return rv; + } + if (seed) { - memset(cprng->key, 0, APR_CRYPTO_PRNG_KEY_SIZE); + memset(cprng->key, 0, CPRNG_KEY_SIZE); } rv = apr_crypto_prng_reseed(cprng, seed); if (rv != APR_SUCCESS) { @@ -357,7 +437,7 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_create(apr_crypto_prng_t **pcprng, #if APR_HAS_THREADS if (flags & APR_CRYPTO_PRNG_LOCKED) { - rv = apr_thread_mutex_create(&cprng->lock, APR_THREAD_MUTEX_DEFAULT, + rv = apr_thread_mutex_create(&cprng->mutex, APR_THREAD_MUTEX_DEFAULT, pool); if (rv != APR_SUCCESS) { cprng_cleanup(cprng); @@ -366,10 +446,13 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_create(apr_crypto_prng_t **pcprng, } #endif - rv = cprng_stream_ctx_make(&cprng->ctx); - if (rv != APR_SUCCESS) { - cprng_cleanup(cprng); - return rv; + if (cprng_global && !(flags & APR_CRYPTO_PRNG_PER_THREAD)) { + cprng_ring_lock(); + APR_RING_INSERT_TAIL(cprng_ring, cprng, apr_crypto_prng_t, link); + cprng_ring_unlock(); + } + else { + APR_RING_ELEM_INIT(cprng, link); } if (pool) { @@ -390,96 +473,106 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_destroy(apr_crypto_prng_t *cprng) return apr_pool_cleanup_run(cprng->pool, cprng, cprng_cleanup); } +static apr_status_t cprng_stream_bytes(apr_crypto_prng_t *cprng, + unsigned char *key, void *to, + size_t len) +{ + apr_status_t rv; + + rv = cprng_stream_ctx_bytes(&cprng->ctx, key, to, len, cprng->buf); + if (rv != APR_SUCCESS && len) { + apr_crypto_memzero(to, len); + } + return rv; +} + APR_DECLARE(apr_status_t) apr_crypto_prng_reseed(apr_crypto_prng_t *cprng, const unsigned char seed[]) { apr_status_t rv = APR_SUCCESS; -#if APR_HAS_THREADS - if (cprng->lock) { - rv = apr_thread_mutex_lock(cprng->lock); - if (rv != APR_SUCCESS) { - return rv; + if (!cprng) { + /* Fall through with global CPRNG. */ + cprng = cprng_global; + if (!cprng) { + return APR_EINIT; } } -#endif + cprng_lock(cprng); + + cprng->pos = cprng->len; + apr_crypto_memzero(cprng->buf, cprng->len); if (seed) { apr_size_t n = 0; do { cprng->key[n] ^= seed[n]; - } while (++n < APR_CRYPTO_PRNG_KEY_SIZE); + } while (++n < CPRNG_KEY_SIZE); + } + else if (cprng_global && cprng_global != cprng) { + /* Use the global CPRNG: no need for more than the initial entropy. */ + rv = apr_crypto_random_bytes(cprng->key, CPRNG_KEY_SIZE); } else { - rv = apr_generate_random_bytes(cprng->key, APR_CRYPTO_PRNG_KEY_SIZE); + /* Use the system entropy, i.e. one of "/dev/[u]random", getrandom(), + * arc4random()... This may block but still we really want to wait for + * the system to gather enough entropy for these 32 initial bytes, much + * more than we want non-random bytes, and that's once and for all! + */ + rv = apr_generate_random_bytes(cprng->key, CPRNG_KEY_SIZE); + } + if (rv == APR_SUCCESS) { + /* Init/set the stream with the new key, without buffering for now + * so that the buffer and/or the next random bytes won't be generated + * directly from this key but from the first stream bytes it generates, + * i.e. the next key is always extracted from the stream cipher state + * and cleared upon use. + */ + rv = cprng_stream_bytes(cprng, cprng->key, NULL, 0); } - apr_crypto_memzero(cprng->buf, cprng->len); - cprng->pos = cprng->len; -#if APR_HAS_THREADS - if (cprng->lock) { - apr_status_t rt = apr_thread_mutex_unlock(cprng->lock); - if (rv == APR_SUCCESS && rt != APR_SUCCESS) { - rv = rt; - } - } -#endif + cprng_unlock(cprng); return rv; } -static APR_INLINE -apr_status_t cprng_stream_mix(apr_crypto_prng_t *cprng, unsigned char *to) -{ - return cprng_stream_ctx_mix(&cprng->ctx, cprng->key, to, - cprng->buf, cprng->len); -} - -APR_DECLARE(apr_status_t) apr_crypto_prng_bytes(apr_crypto_prng_t *cprng, - void *buf, apr_size_t len) +static apr_status_t cprng_bytes(apr_crypto_prng_t *cprng, + void *buf, apr_size_t len) { unsigned char *ptr = buf; apr_status_t rv; apr_size_t n; -#if APR_HAS_THREADS - if (cprng->lock) { - rv = apr_thread_mutex_lock(cprng->lock); - if (rv != APR_SUCCESS) { - return rv; - } - } -#endif - while (len) { - if (cprng->pos == cprng->len) { - if (len >= cprng->len) { + n = cprng->len - cprng->pos; + if (n == 0) { + n = cprng->len; + if (len >= n) { do { - rv = cprng_stream_mix(cprng, ptr); + rv = cprng_stream_bytes(cprng, cprng->key, ptr, n); if (rv != APR_SUCCESS) { return rv; } - ptr += cprng->len; - len -= cprng->len; - } while (len >= cprng->len); + ptr += n; + len -= n; + } while (len >= n); if (!len) { break; } } - rv = cprng_stream_mix(cprng, cprng->buf); + rv = cprng_stream_bytes(cprng, cprng->key, cprng->buf, n); if (rv != APR_SUCCESS) { return rv; } cprng->pos = 0; } + if (n > len) { + n = len; + } /* Random bytes are consumed then zero-ed to ensure * both forward secrecy and cleared next mixed data. */ - n = cprng->len - cprng->pos; - if (n > len) { - n = len; - } memcpy(ptr, cprng->buf + cprng->pos, n); apr_crypto_memzero(cprng->buf + cprng->pos, n); cprng->pos += n; @@ -488,17 +581,132 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_bytes(apr_crypto_prng_t *cprng, len -= n; } -#if APR_HAS_THREADS - if (cprng->lock) { - apr_status_t rt = apr_thread_mutex_unlock(cprng->lock); - if (rv == APR_SUCCESS && rt != APR_SUCCESS) { - rv = rt; + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_crypto_prng_bytes(apr_crypto_prng_t *cprng, + void *buf, apr_size_t len) +{ + apr_status_t rv; + + if (!cprng) { + /* Fall through with global CPRNG. */ + cprng = cprng_global; + if (!cprng) { + return APR_EINIT; } } -#endif - return APR_SUCCESS; + cprng_lock(cprng); + + rv = cprng_bytes(cprng, buf, len); + + cprng_unlock(cprng); + + return rv; +} + +/* Reset the buffer and use the next stream bytes as the new key. */ +static apr_status_t cprng_newkey(apr_crypto_prng_t *cprng) +{ + cprng->pos = cprng->len; + apr_crypto_memzero(cprng->buf, cprng->len); + return cprng_stream_bytes(cprng, NULL, cprng->key, CPRNG_KEY_SIZE); +} + +APR_DECLARE(apr_status_t) apr_crypto_prng_rekey(apr_crypto_prng_t *cprng) +{ + apr_status_t rv; + + if (!cprng) { + /* Fall through with global CPRNG. */ + cprng = cprng_global; + if (!cprng) { + return APR_EINIT; + } + } + + cprng_lock(cprng); + + /* Renew and apply the new key. */ + rv = cprng_newkey(cprng); + if (rv == APR_SUCCESS) { + rv = cprng_stream_bytes(cprng, cprng->key, NULL, 0); + } + + cprng_unlock(cprng); + + if (cprng == cprng_global) { + /* Forward to all maintained CPRNGs. */ + cprng_ring_lock(); + for (cprng = APR_RING_FIRST(cprng_ring); + cprng != APR_RING_SENTINEL(cprng_ring, apr_crypto_prng_t, link); + cprng = APR_RING_NEXT(cprng, link)) { + apr_status_t rt = apr_crypto_prng_rekey(cprng); + if (rt != APR_SUCCESS && rv == APR_SUCCESS) { + rv = rt; + } + } + cprng_ring_unlock(); + } + + return rv; +} + +#if APR_HAS_FORK +APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(apr_crypto_prng_t *cprng, + int in_child) +{ + apr_status_t rv; + + if (!cprng) { + /* Fall through with global CPRNG. */ + cprng = cprng_global; + if (!cprng) { + return APR_EINIT; + } + } + + cprng_lock(cprng); + + /* Make sure the parent and child processes never share the same state, so + * renew the key first (also clears the buffer) for both parent and child, + * so that further fork()s (from parent or child) won't use the same state. + */ + rv = cprng_newkey(cprng); + if (rv == APR_SUCCESS && !in_child) { + /* For the parent process only, renew a second time to ensure that key + * material is different from the child. + */ + rv = cprng_stream_bytes(cprng, NULL, cprng->key, CPRNG_KEY_SIZE); + } + if (rv == APR_SUCCESS) { + /* Finally apply the new key, parent and child ones will now be + * different and unknown to each other (including at the stream ctx + * level). + */ + rv = cprng_stream_bytes(cprng, cprng->key, NULL, 0); + } + + cprng_unlock(cprng); + + if (cprng == cprng_global) { + /* Forward to all maintained CPRNGs. */ + cprng_ring_lock(); + for (cprng = APR_RING_FIRST(cprng_ring); + cprng != APR_RING_SENTINEL(cprng_ring, apr_crypto_prng_t, link); + cprng = APR_RING_NEXT(cprng, link)) { + apr_status_t rt = apr_crypto_prng_after_fork(cprng, in_child); + if (rt != APR_SUCCESS && rv == APR_SUCCESS) { + rv = rt; + } + } + cprng_ring_unlock(); + } + + return rv; } +#endif /* APR_HAS_FORK */ #endif /* APU_HAVE_CRYPTO_PRNG */ #endif /* APU_HAVE_CRYPTO */ diff --git a/include/apr_crypto.h b/include/apr_crypto.h index f8627b937bc..cd3e636d06c 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -552,15 +552,6 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_init(apr_pool_t *pool, */ APR_DECLARE(apr_status_t) apr_crypto_prng_term(void); -/** - * @brief Reseed global CPRNG after a process is fork()ed to avoid any - * duplicated state. - * - * @param proc The child process (including its PID). - * @return Any system error (APR_ENOMEM, ...). - */ -APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(apr_proc_t *proc); - /** * @brief Generate cryptographically secure random bytes from the global CPRNG. * @@ -618,9 +609,17 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_create(apr_crypto_prng_t **pcprng, APR_DECLARE(apr_status_t) apr_crypto_prng_destroy(apr_crypto_prng_t *cprng); /** - * @brief Reseed a standalone CPRNG. + * @brief Rekey a CPRNG. + * + * @param cprng The CPRNG, or NULL for all the created CPRNGs (but per-thread). + * @return Any system error (APR_ENOMEM, ...). + */ +APR_DECLARE(apr_status_t) apr_crypto_prng_rekey(apr_crypto_prng_t *cprng); + +/** + * @brief Reseed a CPRNG. * - * @param cprng The CPRNG to reseed. + * @param cprng The CPRNG to reseed, or NULL for the global CPRNG. * @param seed A custom seed of \ref APR_CRYPTO_PRNG_SEED_SIZE bytes, * or NULL for the seed to be gathered from system entropy. * @return Any system error (APR_ENOMEM, ...). @@ -628,16 +627,32 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_destroy(apr_crypto_prng_t *cprng); APR_DECLARE(apr_status_t) apr_crypto_prng_reseed(apr_crypto_prng_t *cprng, const unsigned char seed[]); +#if APR_HAS_FORK /** - * @brief Generate cryptographically secure random bytes a standalone CPRNG. + * @brief Rekey a CPRNG in the parent and/or child process after a fork(), + * so that they don't share the same state. + * + * @param cprng The CPRNG, or NULL for all the created CPRNGs (but per-thread). + * @param in_child Whether in the child process (non zero), or in the parent + * process otherwise (zero). * - * @param cprng The CPRNG. + * @return Any system error (APR_ENOMEM, ...). + */ +APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(apr_crypto_prng_t *cprng, + int in_child); +#endif + +/** + * @brief Generate cryptographically secure random bytes from a CPRNG. + * + * @param cprng The CPRNG, or NULL for the global CPRNG. * @param buf The destination buffer * @param len The destination length * @return Any system error (APR_ENOMEM, ...). */ APR_DECLARE(apr_status_t) apr_crypto_prng_bytes(apr_crypto_prng_t *cprng, void *buf, apr_size_t len); + #endif /* APU_HAVE_CRYPTO_PRNG */ #endif /* APU_HAVE_CRYPTO */ diff --git a/test/testcrypto.c b/test/testcrypto.c index 2789adcb065..9d95e10c2b9 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -1460,53 +1460,63 @@ static void test_crypto_equals(abts_case *tc, void *data) #endif #if defined(NID_chacha20) /* - * KAT for CHACHA20 with key, IV and plaintext full of zeros: - * $ openssl enc -chacha20 -in /dev/zero \ - * -K `printf "%.64d" 0` -iv `printf "%.32d" 0` \ - * -e | xxd -l128 -i -c8 + * KAT for CHACHA20: + * # iv=$(printf "%.32d" 0) + * # key=$(printf "%.64d" 0) + * # key=$(openssl enc -chacha20 -e \ + * -in /dev/zero -K $key -iv $iv \ + * | xxd -l32 -c64 -p) + * # openssl enc -chacha20 -e \ + * -in /dev/zero -K $key -iv $iv \ + * | xxd -l128 -c8 -i */ static const unsigned char test_PRNG_kat0[128] = { - 0x76, 0xb8, 0xe0, 0xad, 0xa0, 0xf1, 0x3d, 0x90, - 0x40, 0x5d, 0x6a, 0xe5, 0x53, 0x86, 0xbd, 0x28, - 0xbd, 0xd2, 0x19, 0xb8, 0xa0, 0x8d, 0xed, 0x1a, - 0xa8, 0x36, 0xef, 0xcc, 0x8b, 0x77, 0x0d, 0xc7, - 0xda, 0x41, 0x59, 0x7c, 0x51, 0x57, 0x48, 0x8d, - 0x77, 0x24, 0xe0, 0x3f, 0xb8, 0xd8, 0x4a, 0x37, - 0x6a, 0x43, 0xb8, 0xf4, 0x15, 0x18, 0xa1, 0x1c, - 0xc3, 0x87, 0xb6, 0x69, 0xb2, 0xee, 0x65, 0x86, - 0x9f, 0x07, 0xe7, 0xbe, 0x55, 0x51, 0x38, 0x7a, - 0x98, 0xba, 0x97, 0x7c, 0x73, 0x2d, 0x08, 0x0d, - 0xcb, 0x0f, 0x29, 0xa0, 0x48, 0xe3, 0x65, 0x69, - 0x12, 0xc6, 0x53, 0x3e, 0x32, 0xee, 0x7a, 0xed, - 0x29, 0xb7, 0x21, 0x76, 0x9c, 0xe6, 0x4e, 0x43, - 0xd5, 0x71, 0x33, 0xb0, 0x74, 0xd8, 0x39, 0xd5, - 0x31, 0xed, 0x1f, 0x28, 0x51, 0x0a, 0xfb, 0x45, - 0xac, 0xe1, 0x0a, 0x1f, 0x4b, 0x79, 0x4d, 0x6f + 0xb0, 0xfd, 0x14, 0xff, 0x96, 0xa0, 0xbd, 0xa1, + 0x54, 0xc3, 0x29, 0x08, 0x2c, 0x9c, 0x65, 0x33, + 0xbb, 0x4c, 0x94, 0x73, 0xbf, 0x5d, 0xde, 0x13, + 0x8f, 0x82, 0xc9, 0xac, 0x55, 0x53, 0xd9, 0x58, + 0xaf, 0xbd, 0xad, 0x28, 0x45, 0xb9, 0x3c, 0xdb, + 0xb2, 0xfe, 0x64, 0x63, 0xd2, 0xfe, 0x16, 0x2a, + 0xda, 0xe0, 0xf6, 0xe6, 0x76, 0xf0, 0x49, 0x42, + 0x18, 0xf5, 0xce, 0x05, 0x96, 0xe7, 0x9f, 0x5c, + 0x55, 0x1a, 0xaa, 0x9b, 0xa4, 0x6f, 0xaa, 0xd5, + 0x28, 0xf6, 0x76, 0x3d, 0xde, 0x93, 0xc0, 0x3f, + 0xa3, 0xb1, 0x21, 0xb2, 0xff, 0xc0, 0x53, 0x3a, + 0x69, 0x5e, 0xd5, 0x6e, 0x8f, 0xda, 0x05, 0x89, + 0xa2, 0xed, 0xeb, 0xfa, 0xd4, 0xae, 0xd3, 0x35, + 0x7c, 0x7a, 0xad, 0xad, 0x93, 0x28, 0x02, 0x7b, + 0xb8, 0x79, 0xb5, 0x57, 0x47, 0x97, 0xa1, 0xb7, + 0x3d, 0xce, 0x7c, 0xd0, 0x9f, 0x24, 0x51, 0x01 }; #else /* - * KAT for AES256-CTR with key, IV and plaintext full of zeros: - * $ openssl enc -aes-256-ctr -in /dev/zero \ - * -K `printf "%.64d" 0` -iv `printf "%.32d" 0` \ - * -e | xxd -l128 -i -c8 + * KAT for AES256-CTR: + * # iv=$(printf "%.32d" 0) + * # key=$(printf "%.64d" 0) + * # key=$(openssl enc -aes-256-ctr -e \ + * -in /dev/zero -K $key -iv $iv \ + * | xxd -l32 -c64 -p) + * # openssl enc -aes-256-ctr -e \ + * -in /dev/zero -K $key -iv $iv \ + * | xxd -l128 -c8 -i */ static const unsigned char test_PRNG_kat0[128] = { - 0xdc, 0x95, 0xc0, 0x78, 0xa2, 0x40, 0x89, 0x89, - 0xad, 0x48, 0xa2, 0x14, 0x92, 0x84, 0x20, 0x87, - 0x53, 0x0f, 0x8a, 0xfb, 0xc7, 0x45, 0x36, 0xb9, - 0xa9, 0x63, 0xb4, 0xf1, 0xc4, 0xcb, 0x73, 0x8b, - 0xce, 0xa7, 0x40, 0x3d, 0x4d, 0x60, 0x6b, 0x6e, - 0x07, 0x4e, 0xc5, 0xd3, 0xba, 0xf3, 0x9d, 0x18, - 0x72, 0x60, 0x03, 0xca, 0x37, 0xa6, 0x2a, 0x74, - 0xd1, 0xa2, 0xf5, 0x8e, 0x75, 0x06, 0x35, 0x8e, - 0xdd, 0x4a, 0xb1, 0x28, 0x4d, 0x4a, 0xe1, 0x7b, - 0x41, 0xe8, 0x59, 0x24, 0x47, 0x0c, 0x36, 0xf7, - 0x47, 0x41, 0xcb, 0xe1, 0x81, 0xbb, 0x7f, 0x30, - 0x61, 0x7c, 0x1d, 0xe3, 0xab, 0x0c, 0x3a, 0x1f, - 0xd0, 0xc4, 0x8f, 0x73, 0x21, 0xa8, 0x2d, 0x37, - 0x60, 0x95, 0xac, 0xe0, 0x41, 0x91, 0x67, 0xa0, - 0xbc, 0xaf, 0x49, 0xb0, 0xc0, 0xce, 0xa6, 0x2d, - 0xe6, 0xbc, 0x1c, 0x66, 0x54, 0x5e, 0x1d, 0xad + 0x79, 0x04, 0x2a, 0x33, 0xfa, 0x41, 0x1a, 0x37, + 0x97, 0x3a, 0xec, 0xa0, 0xfc, 0xde, 0x6b, 0x2b, + 0x16, 0xa4, 0x5f, 0xa1, 0x2a, 0xe3, 0xf5, 0x4c, + 0x84, 0x28, 0x83, 0xeb, 0x60, 0xce, 0x44, 0xe9, + 0x9c, 0x4c, 0xa2, 0x6e, 0x70, 0xcc, 0x26, 0x68, + 0xf8, 0x99, 0x5a, 0xa1, 0x9f, 0xde, 0x99, 0xb9, + 0x80, 0x0b, 0xb6, 0x83, 0x14, 0x9d, 0x72, 0x93, + 0xf4, 0xd1, 0x49, 0xf3, 0xf0, 0x9e, 0x49, 0x80, + 0x76, 0x84, 0x01, 0x1e, 0x79, 0x9e, 0x70, 0x70, + 0x61, 0x7c, 0x13, 0xce, 0x2d, 0x64, 0xca, 0x08, + 0xb7, 0xc1, 0xd5, 0x61, 0xf1, 0x95, 0x5d, 0x1b, + 0x92, 0x8c, 0xd2, 0x70, 0xef, 0x26, 0xfe, 0x24, + 0x01, 0xd8, 0x65, 0x63, 0x68, 0x71, 0x09, 0x4e, + 0x7b, 0x01, 0x36, 0x19, 0x85, 0x13, 0x16, 0xfd, + 0xc5, 0x0c, 0xe6, 0x71, 0x42, 0xbf, 0x81, 0xb0, + 0xd1, 0x59, 0x28, 0xa1, 0x04, 0xe9, 0x8d, 0xad }; #endif diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index f7d02d20470..950405c091c 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -223,22 +223,35 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) memset(proc, 0, sizeof(apr_proc_t)); + /* Rekey PRNG(s) to clear buffer(s) and make sure that the + * state(s) change between fork()s in any case. + */ +#if APU_HAVE_CRYPTO_PRNG + apr_crypto_prng_rekey(NULL); +#endif + if ((pid = fork()) < 0) { return errno; } else if (pid == 0) { proc->pid = getpid(); - apr_random_after_fork(proc); + /* Do the work needed for children PRNG(s). */ #if APU_HAVE_CRYPTO_PRNG - apr_crypto_prng_after_fork(proc); + apr_crypto_prng_after_fork(NULL, 1); #endif + apr_random_after_fork(proc); return APR_INCHILD; } proc->pid = pid; + /* Do the work needed for parent PRNG(s). */ +#if APU_HAVE_CRYPTO_PRNG + apr_crypto_prng_after_fork(NULL, 0); +#endif + return APR_INPARENT; } From 26e548d6e4a94e36446c68fd6ab9ecf136472ab4 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 28 Jun 2018 08:03:38 +0000 Subject: [PATCH 7808/7878] apr_crypto: follow up to r1833359: wipe the key from openssl internals. The key used to produce the keystream was left in openssl internals during the lifetime of its keystream, avoid this by forcing a key schedule with zeros once the keystream is pooled. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834578 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_prng.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/crypto/apr_crypto_prng.c b/crypto/apr_crypto_prng.c index 69e1de97623..b2190904058 100644 --- a/crypto/apr_crypto_prng.c +++ b/crypto/apr_crypto_prng.c @@ -130,11 +130,14 @@ apr_status_t cprng_stream_ctx_bytes(cprng_stream_ctx_t **pctx, * with the current key (n != 0), or both successively in a one go. */ if (key) { - /* We never encrypt twice with the same key, so we can use an - * all zeros IV. Also EVP_EncryptInit() can be called multiple - * times and it will recycle its previous/replaced resources by - * itself, so since padding is disabled/irrelevant too we don't - * need EVP_EncryptFinish() after each call or before rekeying. + /* We never encrypt twice with the same key, so no IV is needed (can + * be zeros). When EVP_EncryptInit() is called multiple times it clears + * its previous resources approprietly, and since we don't want the key + * and its keystream to reside in memory at the same time, we have to + * EVP_EncryptInit() twice: firstly to set the key and then finally to + * overwrite the key (with zeros) after the keystream is produced. + * As for EVP_EncryptFinish(), we don't need it either because padding + * is disabled (irrelevant for a stream cipher). */ #if defined(NID_chacha20) /* With CHACHA20, iv=NULL is the same as zeros but it's faster @@ -155,6 +158,13 @@ apr_status_t cprng_stream_ctx_bytes(cprng_stream_ctx_t **pctx, } if (n) { EVP_EncryptUpdate(ctx, to, &len, z, n); + + /* Burn the key in openssl internals */ +#if defined(NID_chacha20) + EVP_EncryptInit_ex(ctx, NULL, NULL, z, NULL); +#else + EVP_EncryptInit_ex(ctx, NULL, NULL, z, z); +#endif } return APR_SUCCESS; From b876309f5c07ccb66502e9601613b81fad13be92 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 28 Jun 2018 08:47:27 +0000 Subject: [PATCH 7809/7878] apr_crypto: follow up to r1833359: simpler cprng_stream[_ctx]_bytes interface. We always need the key since it's now wiped from openssl internals at each call so make it clear with an explicit 'rekey' flag whether is about rekeying first or generating stream bytes only. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834582 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_prng.c | 108 ++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 59 deletions(-) diff --git a/crypto/apr_crypto_prng.c b/crypto/apr_crypto_prng.c index b2190904058..178f581649f 100644 --- a/crypto/apr_crypto_prng.c +++ b/crypto/apr_crypto_prng.c @@ -118,54 +118,53 @@ void cprng_stream_ctx_free(cprng_stream_ctx_t *ctx) EVP_CIPHER_CTX_free(ctx); } +static APR_INLINE +void cprng_stream_setkey(cprng_stream_ctx_t *ctx, + const unsigned char *key, + const unsigned char *iv) +{ +#if defined(NID_chacha20) + /* With CHACHA20, iv=NULL is the same as zeros but it's faster + * to (re-)init; use that for efficiency. + */ + EVP_EncryptInit_ex(ctx, NULL, NULL, key, NULL); +#else + /* With AES256-CTR, iv=NULL seems to peek up and random one (for + * the initial CTR), while we can live with zeros (fixed CTR); + * efficiency still. + */ + EVP_EncryptInit_ex(ctx, NULL, NULL, key, iv); +#endif +} + static APR_INLINE apr_status_t cprng_stream_ctx_bytes(cprng_stream_ctx_t **pctx, - unsigned char *key, unsigned char *to, - apr_size_t n, const unsigned char *z) + unsigned char *key, int rekey, + unsigned char *to, apr_size_t n, + const unsigned char *z) { cprng_stream_ctx_t *ctx = *pctx; int len; - /* Can be called for rekeying (key != NULL), streaming more bytes - * with the current key (n != 0), or both successively in a one go. + /* We never encrypt twice with the same key, so no IV is needed (can + * be zeros). When EVP_EncryptInit() is called multiple times it clears + * its previous resources approprietly, and since we don't want the key + * and its keystream to reside in memory at the same time, we have to + * EVP_EncryptInit() twice: firstly to set the key and then finally to + * overwrite the key (with zeros) after the keystream is produced. + * As for EVP_EncryptFinish(), we don't need it either because padding + * is disabled (irrelevant for a stream cipher). */ - if (key) { - /* We never encrypt twice with the same key, so no IV is needed (can - * be zeros). When EVP_EncryptInit() is called multiple times it clears - * its previous resources approprietly, and since we don't want the key - * and its keystream to reside in memory at the same time, we have to - * EVP_EncryptInit() twice: firstly to set the key and then finally to - * overwrite the key (with zeros) after the keystream is produced. - * As for EVP_EncryptFinish(), we don't need it either because padding - * is disabled (irrelevant for a stream cipher). - */ -#if defined(NID_chacha20) - /* With CHACHA20, iv=NULL is the same as zeros but it's faster - * to (re-)init; use that for efficiency. - */ - EVP_EncryptInit_ex(ctx, NULL, NULL, key, NULL); -#else - /* With AES256-CTR, iv=NULL seems to peek up and random one (for - * the initial CTR), while we can live with zeros (fixed CTR); - * efficiency still. - */ - EVP_EncryptInit_ex(ctx, NULL, NULL, key, z); -#endif - EVP_CIPHER_CTX_set_padding(ctx, 0); - + cprng_stream_setkey(ctx, key, z); + EVP_CIPHER_CTX_set_padding(ctx, 0); + if (rekey) { memset(key, 0, CPRNG_KEY_SIZE); EVP_EncryptUpdate(ctx, key, &len, key, CPRNG_KEY_SIZE); } if (n) { EVP_EncryptUpdate(ctx, to, &len, z, n); - - /* Burn the key in openssl internals */ -#if defined(NID_chacha20) - EVP_EncryptInit_ex(ctx, NULL, NULL, z, NULL); -#else - EVP_EncryptInit_ex(ctx, NULL, NULL, z, z); -#endif } + cprng_stream_setkey(ctx, z, z); return APR_SUCCESS; } @@ -484,12 +483,13 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_destroy(apr_crypto_prng_t *cprng) } static apr_status_t cprng_stream_bytes(apr_crypto_prng_t *cprng, - unsigned char *key, void *to, - size_t len) + void *to, size_t len, + int rekey) { apr_status_t rv; - rv = cprng_stream_ctx_bytes(&cprng->ctx, key, to, len, cprng->buf); + rv = cprng_stream_ctx_bytes(&cprng->ctx, cprng->key, rekey, + to, len, cprng->buf); if (rv != APR_SUCCESS && len) { apr_crypto_memzero(to, len); } @@ -538,7 +538,7 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_reseed(apr_crypto_prng_t *cprng, * i.e. the next key is always extracted from the stream cipher state * and cleared upon use. */ - rv = cprng_stream_bytes(cprng, cprng->key, NULL, 0); + rv = cprng_stream_bytes(cprng, NULL, 0, 1); } cprng_unlock(cprng); @@ -559,7 +559,7 @@ static apr_status_t cprng_bytes(apr_crypto_prng_t *cprng, n = cprng->len; if (len >= n) { do { - rv = cprng_stream_bytes(cprng, cprng->key, ptr, n); + rv = cprng_stream_bytes(cprng, ptr, n, 1); if (rv != APR_SUCCESS) { return rv; } @@ -570,7 +570,7 @@ static apr_status_t cprng_bytes(apr_crypto_prng_t *cprng, break; } } - rv = cprng_stream_bytes(cprng, cprng->key, cprng->buf, n); + rv = cprng_stream_bytes(cprng, cprng->buf, n, 1); if (rv != APR_SUCCESS) { return rv; } @@ -617,11 +617,11 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_bytes(apr_crypto_prng_t *cprng, } /* Reset the buffer and use the next stream bytes as the new key. */ -static apr_status_t cprng_newkey(apr_crypto_prng_t *cprng) +static apr_status_t cprng_newkey(apr_crypto_prng_t *cprng, int rekey) { cprng->pos = cprng->len; apr_crypto_memzero(cprng->buf, cprng->len); - return cprng_stream_bytes(cprng, NULL, cprng->key, CPRNG_KEY_SIZE); + return cprng_stream_bytes(cprng, cprng->key, CPRNG_KEY_SIZE, rekey); } APR_DECLARE(apr_status_t) apr_crypto_prng_rekey(apr_crypto_prng_t *cprng) @@ -639,10 +639,7 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_rekey(apr_crypto_prng_t *cprng) cprng_lock(cprng); /* Renew and apply the new key. */ - rv = cprng_newkey(cprng); - if (rv == APR_SUCCESS) { - rv = cprng_stream_bytes(cprng, cprng->key, NULL, 0); - } + rv = cprng_newkey(cprng, 1); cprng_unlock(cprng); @@ -682,20 +679,13 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(apr_crypto_prng_t *cprng, /* Make sure the parent and child processes never share the same state, so * renew the key first (also clears the buffer) for both parent and child, * so that further fork()s (from parent or child) won't use the same state. + * For the parent process only, renew a second time to ensure that key + * material is different from the child. Finally parent and child keys will + * be different and unknown to each other processes. */ - rv = cprng_newkey(cprng); + rv = cprng_newkey(cprng, in_child); if (rv == APR_SUCCESS && !in_child) { - /* For the parent process only, renew a second time to ensure that key - * material is different from the child. - */ - rv = cprng_stream_bytes(cprng, NULL, cprng->key, CPRNG_KEY_SIZE); - } - if (rv == APR_SUCCESS) { - /* Finally apply the new key, parent and child ones will now be - * different and unknown to each other (including at the stream ctx - * level). - */ - rv = cprng_stream_bytes(cprng, cprng->key, NULL, 0); + rv = cprng_stream_bytes(cprng, cprng->key, CPRNG_KEY_SIZE, 1); } cprng_unlock(cprng); From 92d83746d510b8dee0a6a43001f348740904f89b Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 28 Jun 2018 08:54:13 +0000 Subject: [PATCH 7810/7878] apr_crypto: follow up to r1833359: save a memset(). We can avoid zeroing the key before overwriting it since we have plenty of zeros available in cprng->buf already. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834583 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_prng.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crypto/apr_crypto_prng.c b/crypto/apr_crypto_prng.c index 178f581649f..81363fd2e8f 100644 --- a/crypto/apr_crypto_prng.c +++ b/crypto/apr_crypto_prng.c @@ -158,8 +158,7 @@ apr_status_t cprng_stream_ctx_bytes(cprng_stream_ctx_t **pctx, cprng_stream_setkey(ctx, key, z); EVP_CIPHER_CTX_set_padding(ctx, 0); if (rekey) { - memset(key, 0, CPRNG_KEY_SIZE); - EVP_EncryptUpdate(ctx, key, &len, key, CPRNG_KEY_SIZE); + EVP_EncryptUpdate(ctx, key, &len, z, CPRNG_KEY_SIZE); } if (n) { EVP_EncryptUpdate(ctx, to, &len, z, n); From e3ad2c40c055b4c112007911c3a1ca12f6ecd1a9 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 28 Jun 2018 12:14:35 +0000 Subject: [PATCH 7811/7878] apr_crypto: follow up to r1833359: better cprng_stream_bytes() semantics. Make cprng_stream_ctx_bytes() rekey in any case, this is exactly what we need both when generating pooled random bytes and when handling fork() the parent and child key should not leak to each other. There is no use case for a keystream without setting the key first and burning it afterward, and there shouldn't be. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834600 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_prng.c | 57 ++++++++++++++++++++-------------------- include/apr_crypto.h | 5 +++- threadproc/unix/proc.c | 4 +-- 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/crypto/apr_crypto_prng.c b/crypto/apr_crypto_prng.c index 81363fd2e8f..ad9a8b8399d 100644 --- a/crypto/apr_crypto_prng.c +++ b/crypto/apr_crypto_prng.c @@ -139,9 +139,8 @@ void cprng_stream_setkey(cprng_stream_ctx_t *ctx, static APR_INLINE apr_status_t cprng_stream_ctx_bytes(cprng_stream_ctx_t **pctx, - unsigned char *key, int rekey, - unsigned char *to, apr_size_t n, - const unsigned char *z) + unsigned char *key, unsigned char *to, + apr_size_t n, const unsigned char *z) { cprng_stream_ctx_t *ctx = *pctx; int len; @@ -157,9 +156,7 @@ apr_status_t cprng_stream_ctx_bytes(cprng_stream_ctx_t **pctx, */ cprng_stream_setkey(ctx, key, z); EVP_CIPHER_CTX_set_padding(ctx, 0); - if (rekey) { - EVP_EncryptUpdate(ctx, key, &len, z, CPRNG_KEY_SIZE); - } + EVP_EncryptUpdate(ctx, key, &len, z, CPRNG_KEY_SIZE); if (n) { EVP_EncryptUpdate(ctx, to, &len, z, n); } @@ -482,13 +479,11 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_destroy(apr_crypto_prng_t *cprng) } static apr_status_t cprng_stream_bytes(apr_crypto_prng_t *cprng, - void *to, size_t len, - int rekey) + void *to, apr_size_t len) { apr_status_t rv; - rv = cprng_stream_ctx_bytes(&cprng->ctx, cprng->key, rekey, - to, len, cprng->buf); + rv = cprng_stream_ctx_bytes(&cprng->ctx, cprng->key, to, len, cprng->buf); if (rv != APR_SUCCESS && len) { apr_crypto_memzero(to, len); } @@ -537,7 +532,7 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_reseed(apr_crypto_prng_t *cprng, * i.e. the next key is always extracted from the stream cipher state * and cleared upon use. */ - rv = cprng_stream_bytes(cprng, NULL, 0, 1); + rv = cprng_stream_bytes(cprng, NULL, 0); } cprng_unlock(cprng); @@ -558,7 +553,7 @@ static apr_status_t cprng_bytes(apr_crypto_prng_t *cprng, n = cprng->len; if (len >= n) { do { - rv = cprng_stream_bytes(cprng, ptr, n, 1); + rv = cprng_stream_bytes(cprng, ptr, n); if (rv != APR_SUCCESS) { return rv; } @@ -569,7 +564,7 @@ static apr_status_t cprng_bytes(apr_crypto_prng_t *cprng, break; } } - rv = cprng_stream_bytes(cprng, cprng->buf, n, 1); + rv = cprng_stream_bytes(cprng, cprng->buf, n); if (rv != APR_SUCCESS) { return rv; } @@ -616,11 +611,12 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_bytes(apr_crypto_prng_t *cprng, } /* Reset the buffer and use the next stream bytes as the new key. */ -static apr_status_t cprng_newkey(apr_crypto_prng_t *cprng, int rekey) +static apr_status_t cprng_rekey(apr_crypto_prng_t *cprng, + unsigned char *newkey) { cprng->pos = cprng->len; apr_crypto_memzero(cprng->buf, cprng->len); - return cprng_stream_bytes(cprng, cprng->key, CPRNG_KEY_SIZE, rekey); + return cprng_stream_bytes(cprng, newkey, newkey ? CPRNG_KEY_SIZE : 0); } APR_DECLARE(apr_status_t) apr_crypto_prng_rekey(apr_crypto_prng_t *cprng) @@ -637,8 +633,8 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_rekey(apr_crypto_prng_t *cprng) cprng_lock(cprng); - /* Renew and apply the new key. */ - rv = cprng_newkey(cprng, 1); + /* Clear state and renew the key. */ + rv = cprng_rekey(cprng, NULL); cprng_unlock(cprng); @@ -661,9 +657,10 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_rekey(apr_crypto_prng_t *cprng) #if APR_HAS_FORK APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(apr_crypto_prng_t *cprng, - int in_child) + int flags) { apr_status_t rv; + int child = flags & APR_CRYPTO_FORK_INCHILD; if (!cprng) { /* Fall through with global CPRNG. */ @@ -675,16 +672,20 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(apr_crypto_prng_t *cprng, cprng_lock(cprng); - /* Make sure the parent and child processes never share the same state, so - * renew the key first (also clears the buffer) for both parent and child, - * so that further fork()s (from parent or child) won't use the same state. - * For the parent process only, renew a second time to ensure that key - * material is different from the child. Finally parent and child keys will - * be different and unknown to each other processes. + /* Make sure the parent and child processes never share the same state, + * and that further fork()s from either process will not either. + * This is done by rekeying (and clearing the buffers) in both processes, + * and by rekeying a second time in the parent process to ensure both that + * keys are different and that after apr_crypto_prng_after_fork() is called + * the keys are unknown to each other processes. + * The new key to be used by the parent process is generated in the same + * pass as the rekey, and since cprng_stream_bytes() is designed to burn + * and never reuse keys we are sure that this key is unique to the parent, + * and that nothing is left over from the initial state in both processes. */ - rv = cprng_newkey(cprng, in_child); - if (rv == APR_SUCCESS && !in_child) { - rv = cprng_stream_bytes(cprng, cprng->key, CPRNG_KEY_SIZE, 1); + rv = cprng_rekey(cprng, child ? NULL : cprng->key); + if (rv == APR_SUCCESS && !child) { + rv = cprng_rekey(cprng, NULL); } cprng_unlock(cprng); @@ -695,7 +696,7 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(apr_crypto_prng_t *cprng, for (cprng = APR_RING_FIRST(cprng_ring); cprng != APR_RING_SENTINEL(cprng_ring, apr_crypto_prng_t, link); cprng = APR_RING_NEXT(cprng, link)) { - apr_status_t rt = apr_crypto_prng_after_fork(cprng, in_child); + apr_status_t rt = apr_crypto_prng_after_fork(cprng, flags); if (rt != APR_SUCCESS && rv == APR_SUCCESS) { rv = rt; } diff --git a/include/apr_crypto.h b/include/apr_crypto.h index cd3e636d06c..bc92b31b5c4 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -628,6 +628,9 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_reseed(apr_crypto_prng_t *cprng, const unsigned char seed[]); #if APR_HAS_FORK +#define APR_CRYPTO_FORK_INPARENT 0 +#define APR_CRYPTO_FORK_INCHILD 1 + /** * @brief Rekey a CPRNG in the parent and/or child process after a fork(), * so that they don't share the same state. @@ -639,7 +642,7 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_reseed(apr_crypto_prng_t *cprng, * @return Any system error (APR_ENOMEM, ...). */ APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(apr_crypto_prng_t *cprng, - int in_child); + int flags); #endif /** diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 950405c091c..ed7a05fda5a 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -238,7 +238,7 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) /* Do the work needed for children PRNG(s). */ #if APU_HAVE_CRYPTO_PRNG - apr_crypto_prng_after_fork(NULL, 1); + apr_crypto_prng_after_fork(NULL, APR_CRYPTO_FORK_INCHILD); #endif apr_random_after_fork(proc); @@ -249,7 +249,7 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) /* Do the work needed for parent PRNG(s). */ #if APU_HAVE_CRYPTO_PRNG - apr_crypto_prng_after_fork(NULL, 0); + apr_crypto_prng_after_fork(NULL, APR_CRYPTO_FORK_INPARENT); #endif return APR_INPARENT; From a4846df3c9714da9951d553a2b3dbf272aa21482 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 28 Jun 2018 16:08:15 +0000 Subject: [PATCH 7812/7878] apr_crypto: follow up to r1833359: axe cprng_rekey() helper. We don't exactly need the same code in _rekey() and _after_fork(), and can avoid resetting cprng->buf twice in the latter (for the parent process). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1834622 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto_prng.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/crypto/apr_crypto_prng.c b/crypto/apr_crypto_prng.c index ad9a8b8399d..43cdfe7e665 100644 --- a/crypto/apr_crypto_prng.c +++ b/crypto/apr_crypto_prng.c @@ -610,15 +610,6 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_bytes(apr_crypto_prng_t *cprng, return rv; } -/* Reset the buffer and use the next stream bytes as the new key. */ -static apr_status_t cprng_rekey(apr_crypto_prng_t *cprng, - unsigned char *newkey) -{ - cprng->pos = cprng->len; - apr_crypto_memzero(cprng->buf, cprng->len); - return cprng_stream_bytes(cprng, newkey, newkey ? CPRNG_KEY_SIZE : 0); -} - APR_DECLARE(apr_status_t) apr_crypto_prng_rekey(apr_crypto_prng_t *cprng) { apr_status_t rv; @@ -634,7 +625,9 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_rekey(apr_crypto_prng_t *cprng) cprng_lock(cprng); /* Clear state and renew the key. */ - rv = cprng_rekey(cprng, NULL); + cprng->pos = cprng->len; + apr_crypto_memzero(cprng->buf, cprng->len); + rv = cprng_stream_bytes(cprng, NULL, 0); cprng_unlock(cprng); @@ -659,8 +652,8 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_rekey(apr_crypto_prng_t *cprng) APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(apr_crypto_prng_t *cprng, int flags) { - apr_status_t rv; - int child = flags & APR_CRYPTO_FORK_INCHILD; + apr_status_t rv = APR_SUCCESS; + int is_child = flags & APR_CRYPTO_FORK_INCHILD; if (!cprng) { /* Fall through with global CPRNG. */ @@ -683,9 +676,13 @@ APR_DECLARE(apr_status_t) apr_crypto_prng_after_fork(apr_crypto_prng_t *cprng, * and never reuse keys we are sure that this key is unique to the parent, * and that nothing is left over from the initial state in both processes. */ - rv = cprng_rekey(cprng, child ? NULL : cprng->key); - if (rv == APR_SUCCESS && !child) { - rv = cprng_rekey(cprng, NULL); + cprng->pos = cprng->len; + apr_crypto_memzero(cprng->buf, cprng->len); + if (!is_child) { + rv = cprng_stream_bytes(cprng, cprng->key, CPRNG_KEY_SIZE); + } + if (rv == APR_SUCCESS) { + rv = cprng_stream_bytes(cprng, NULL, 0); } cprng_unlock(cprng); From 759826dc415874a70696bd997a5dbe4d3af64f87 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 8 Jul 2018 11:26:00 +0000 Subject: [PATCH 7813/7878] apr_json: Add support for encoding and decoding RFC8259 JSON. Submitted by: Moriyoshi Koizumi git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1835348 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + build.conf | 1 + include/apr_json.h | 248 +++++++++++++ json/apr_json.c | 74 ++++ json/apr_json_decode.c | 819 +++++++++++++++++++++++++++++++++++++++++ json/apr_json_encode.c | 300 +++++++++++++++ test/Makefile.in | 2 +- test/abts_tests.h | 3 +- test/testjson.c | 139 +++++++ test/testutil.h | 1 + 10 files changed, 1588 insertions(+), 2 deletions(-) create mode 100644 include/apr_json.h create mode 100644 json/apr_json.c create mode 100644 json/apr_json_decode.c create mode 100644 json/apr_json_encode.c create mode 100644 test/testjson.c diff --git a/CHANGES b/CHANGES index ef289085569..d510cb342a9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_json: Add support for encoding and decoding RFC8259 JSON. + [Moriyoshi Koizumi ] + *) Add the apr_encode_* API that implements RFC4648 and RFC7515 compliant BASE64, BASE64URL, BASE32, BASE32HEX and BASE16 encode/decode functions. [Graham Leggett] diff --git a/build.conf b/build.conf index af1e99894bf..cea616aaaa8 100644 --- a/build.conf +++ b/build.conf @@ -26,6 +26,7 @@ paths = dbm/sdbm/*.c encoding/*.c hooks/*.c + json/*.c misc/*.c memcache/*.c redis/*.c diff --git a/include/apr_json.h b/include/apr_json.h new file mode 100644 index 00000000000..a1342c83639 --- /dev/null +++ b/include/apr_json.h @@ -0,0 +1,248 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file apr_json.h + * @brief APR-UTIL JSON Library + */ +#ifndef APR_JSON_H +#define APR_JSON_H + +/** + * @defgroup APR_Util_JSON JSON Encoding and Decoding + * @ingroup APR_Util + * @{ + */ +#include "apr.h" +#include "apr_pools.h" +#include "apr_tables.h" +#include "apr_hash.h" +#include "apr_strings.h" +#include "apr_buckets.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @package Apache JSON library + * + * RFC8259 compliant JSON encoding and decoding library. + * + * https://tools.ietf.org/html/rfc8259 + * + * This API generates UTF-8 encoded JSON, and writes it to the + * bucket brigade specified. All strings are verified as valid UTF-8 + * before processing, with invalid UTF-8 characters replaced. + * + * This API parses UTF-8 encoded JSON, and returns the result as + * a set of structures. All JSON strings are unescaped. Any bad + * characters or formatting will cause parsing to be terminated + * and an error returned, along with the offset of the error. + * + * Whitespace may be optionally preserved or ignored as required + * during generation and parsing. + * + * The ordering of object keys is preserved, allowing the decode and + * encode process to reproduce an identical result. This maintains + * stable behaviour during unit tests. + */ + +/** + * When passing a string to one of the encode functions, this value can be + * passed to indicate a string-valued key, and have the length computed + * automatically. + */ +#define APR_JSON_VALUE_STRING (-1) + +/** + * Flag indicating no special processing. + */ +#define APR_JSON_FLAGS_NONE 0 + +/** + * Flag indicating include whitespace. + */ +#define APR_JSON_FLAGS_WHITESPACE 1 + +/** + * A structure to hold a JSON object. + */ +typedef struct apr_json_object_t apr_json_object_t; + +/** + * Enum that represents the type of the given JSON value. + */ +typedef enum apr_json_type_e { + APR_JSON_OBJECT, + APR_JSON_ARRAY, + APR_JSON_STRING, + APR_JSON_LONG, + APR_JSON_DOUBLE, + APR_JSON_BOOLEAN, + APR_JSON_NULL +} apr_json_type_e; + +/** + * A structure to hold a UTF-8 encoded JSON string. + */ +typedef struct apr_json_string_t { + /** pointer to the string */ + const char *p; + /** string length */ + apr_size_t len; +} apr_json_string_t; + +/** + * A structure that holds a JSON value. + * + * Use apr_json_value_create() to allocate. + */ +typedef struct apr_json_value_t { + /** preceding whitespace, if any */ + const char *pre; + /** trailing whitespace, if any */ + const char *post; + /** type of the value */ + apr_json_type_e type; + /** actual value. which member is valid depends on type. */ + union { + /** JSON object */ + apr_json_object_t *object; + /** JSON array */ + apr_array_header_t *array; + /** JSON floating point value */ + double dnumber; + /** JSON long integer value */ + apr_int64_t lnumber; + /** JSON UTF-8 encoded string value */ + apr_json_string_t string; + /** JSON boolean value */ + int boolean; + } value; +} apr_json_value_t; + +/** + * A structure to hold a JSON object key value pair. + * + * Use apr_json_object_set() to allocate. + */ +typedef struct apr_json_kv_t { + /** Links to the rest of the kv pairs */ + APR_RING_ENTRY(apr_json_kv_t) link; + /** the key */ + apr_json_value_t *k; + /** the value */ + apr_json_value_t *v; +} apr_json_kv_t; + +/** + * A structure to hold a JSON object. + * + * Use apr_json_object_create() to allocate. + */ +typedef struct apr_json_object_t { + /** The key value pairs in the object are in this list */ + APR_RING_HEAD(apr_json_object_list_t, apr_json_kv_t) list; + /** JSON object */ + apr_hash_t *hash; +} apr_json_object_t; + +/** + * Allocate and return a apr_json_value_t structure. + * + * @param pool The pool to allocate from. + * @return The apr_json_value_t structure. + */ +APR_DECLARE(apr_json_value_t *) apr_json_value_create(apr_pool_t *pool) + __attribute__((nonnull(1))); + +/** + * Allocate and return a apr_json_object_t structure. + * + * @param pool The pool to allocate from. + * @return The apr_json_object_t structure. + */ +APR_DECLARE(apr_json_object_t *) apr_json_object_create(apr_pool_t *pool) + __attribute__((nonnull(1))); + +/** + * Associate a value with a key in a JSON object. + * @param obj The JSON object. + * @param key Pointer to the key. + * @param val Value to associate with the key. + * @remark If the value is NULL the key value pair is deleted. + */ +APR_DECLARE(void) apr_json_object_set(apr_json_object_t *obj, + apr_json_value_t *key, apr_json_value_t *val, + apr_pool_t *pool) __attribute__((nonnull(1, 2, 4))); + +/** + * Look up the value associated with a key in a JSON object. + * @param ht The hash table + * @param key Pointer to the key + * @return Returns NULL if the key is not present. + */ +APR_DECLARE(apr_json_kv_t *) + apr_json_object_get(apr_json_object_t *obj, const char *key) + __attribute__((nonnull(1, 2))); + +/** + * Decode utf8-encoded JSON string into apr_json_value_t. + * @param retval the result + * @param injson utf8-encoded JSON string. + * @param size length of the input string. + * @param offset number of characters processed. + * @param flags set to APR_JSON_FLAGS_WHITESPACE to preserve whitespace, + * or APR_JSON_FLAGS_NONE to filter whitespace. + * @param level maximum nesting level we are prepared to decode. + * @param pool pool used to allocate the result from. + * @return APR_SUCCESS on success, APR_EOF if the JSON text is truncated. + * APR_BADCH when a decoding error has occurred (the location of the error + * is at offset), APR_EINVAL if the level has been exceeded, or + * APR_ENOTIMPL on platforms where not implemented. + */ +APR_DECLARE(apr_status_t) apr_json_decode(apr_json_value_t ** retval, + const char *injson, apr_ssize_t size, apr_off_t * offset, + int flags, int level, apr_pool_t * pool) + __attribute__((nonnull(1, 2, 7))); + +/** + * Encode data represented as apr_json_value_t to utf8-encoded JSON string + * and append it to the specified brigade. + * + * All JSON strings are checked for invalid UTF-8 character sequences, + * and if found invalid sequences are replaced with the replacement + * character "�" (U+FFFD). + * + * @param brigade brigade the result will be appended to. + * @param flush optional flush function for the brigade. Can be NULL. + * @param ctx optional contaxt for the flush function. Can be NULL. + * @param json the JSON data. + * @param flags set to APR_JSON_FLAGS_WHITESPACE to preserve whitespace, + * or APR_JSON_FLAGS_NONE to filter whitespace. + * @param pool pool used to allocate the buckets from. + * @return APR_SUCCESS on success, or APR_ENOTIMPL on platforms where not + * implemented. + */ +APR_DECLARE(apr_status_t) apr_json_encode(apr_bucket_brigade * brigade, + apr_brigade_flush flush, void *ctx, const apr_json_value_t * json, + int flags, apr_pool_t * pool) __attribute__((nonnull(1, 4, 6))); + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif /* APR_JSON_H */ diff --git a/json/apr_json.c b/json/apr_json.c new file mode 100644 index 00000000000..98966659f67 --- /dev/null +++ b/json/apr_json.c @@ -0,0 +1,74 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "apr_json.h" + +#define APR_JSON_OBJECT_INSERT_TAIL(o, e) do { \ + apr_json_kv_t *ap__b = (e); \ + APR_RING_INSERT_TAIL(&(o)->list, ap__b, apr_json_kv_t, link); \ + APR_RING_CHECK_CONSISTENCY(&(o)->list, apr_json_kv_t, link); \ + } while (0) + +apr_json_value_t *apr_json_value_create(apr_pool_t *pool) +{ + return apr_pcalloc(pool, sizeof(apr_json_value_t)); +} + +apr_json_object_t *apr_json_object_create(apr_pool_t *pool) +{ + apr_json_object_t *object = apr_pcalloc(pool, + sizeof(apr_json_object_t)); + APR_RING_INIT(&object->list, apr_json_kv_t, link); + object->hash = apr_hash_make(pool); + + return object; +} + +void apr_json_object_set(apr_json_object_t *object, apr_json_value_t *key, + apr_json_value_t *val, apr_pool_t *pool) +{ + apr_json_kv_t *kv; + + kv = apr_hash_get(object->hash, key->value.string.p, key->value.string.len); + + if (!val) { + if (kv) { + apr_hash_set(object->hash, key->value.string.p, key->value.string.len, + NULL); + APR_RING_REMOVE((kv), link); + } + return; + } + + if (!kv) { + kv = apr_palloc(pool, sizeof(apr_json_kv_t)); + APR_RING_ELEM_INIT(kv, link); + APR_JSON_OBJECT_INSERT_TAIL(object, kv); + apr_hash_set(object->hash, key->value.string.p, key->value.string.len, + kv); + } + + kv->k = key; + kv->v = val; +} + +apr_json_kv_t *apr_json_object_get(apr_json_object_t *object, const char *key) +{ + return apr_hash_get(object->hash, key, APR_HASH_KEY_STRING); +} diff --git a/json/apr_json_decode.c b/json/apr_json_decode.c new file mode 100644 index 00000000000..ecb60c022d2 --- /dev/null +++ b/json/apr_json_decode.c @@ -0,0 +1,819 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "apr_json.h" + +#if !APR_CHARSET_EBCDIC + +typedef struct _json_link_t { + apr_json_value_t *value; + struct _json_link_t *next; +} json_link_t; + +typedef struct apr_json_scanner_t { + apr_pool_t *pool; + const char *p; + const char *e; + int flags; + int level; +} apr_json_scanner_t; + +static apr_status_t apr_json_decode_value(apr_json_scanner_t * self, apr_json_value_t ** retval); + +/* stolen from mod_mime_magic.c :) */ +/* Single hex char to int; -1 if not a hex char. */ +static int hex_to_int(int c) +{ + if (isdigit(c)) + return c - '0'; + if ((c >= 'a') && (c <= 'f')) + return c + 10 - 'a'; + if ((c >= 'A') && (c <= 'F')) + return c + 10 - 'A'; + return -1; +} + +static apr_ssize_t ucs4_to_utf8(char *out, int code) +{ + if (code < 0x00000080) { + out[0] = code; + return 1; + } + else if (code < 0x00000800) { + out[0] = 0xc0 + (code >> 6); + out[1] = 0x80 + (code & 0x3f); + return 2; + } + else if (code < 0x00010000) { + out[0] = 0xe0 + (code >> 12); + out[1] = 0x80 + ((code >> 6) & 0x3f); + out[2] = 0x80 + (code & 0x3f); + return 3; + } + else if (code < 0x00200000) { + out[0] = 0xd0 + (code >> 18); + out[1] = 0x80 + ((code >> 12) & 0x3f); + out[2] = 0x80 + ((code >> 6) & 0x3f); + out[3] = 0x80 + (code & 0x3F); + return 4; + } + return 0; +} + +static apr_status_t apr_json_decode_string(apr_json_scanner_t * self, apr_json_string_t * retval) +{ + apr_status_t status = APR_SUCCESS; + apr_json_string_t string; + const char *p = self->p; + const char *e; + char *q; + + if (self->p >= self->e) { + status = APR_EOF; + goto out; + } + + self->p++; /* eat the leading '"' */ + + /* advance past the \ " */ + string.len = 0; + for (p = self->p, e = self->e; p < e;) { + if (*p == '"') + break; + else if (*p == '\\') { + p++; + if (p >= e) { + status = APR_EOF; + goto out; + } + if (*p == 'u') { + if (p + 4 >= e) { + status = APR_EOF; + goto out; + } + p += 5; + string.len += 4;/* an UTF-8 character spans at most 4 bytes */ + break; + } + else { + string.len++; + p++; + } + } + else { + string.len++; + p++; + } + } + + string.p = q = apr_pcalloc(self->pool, string.len + 1); + e = p; + +#define VALIDATE_UTF8_SUCCEEDING_BYTE(p) \ + if (*(unsigned char *)(p) < 0x80 || *(unsigned char *)(p) >= 0xc0) { \ + status = APR_BADCH; \ + goto out; \ + } + + for (p = self->p; p < e;) { + switch (*(unsigned char *)p) { + case '\\': + p++; + switch (*p) { + case 'u': + /* THIS IS REQUIRED TO BE A 4 DIGIT HEX NUMBER */ + { + int cp = 0; + while (p < e) { + int d = hex_to_int(*p); + if (d < 0) { + status = APR_BADCH; + goto out; + } + cp = (cp << 4) | d; + p++; + } + if (cp >= 0xd800 && cp < 0xdc00) { + /* surrogate pair */ + int sc = 0; + if (p + 6 > e) { + status = APR_EOF; + goto out; + } + if (p[0] != '\\' && p[1] != 'u') { + status = APR_BADCH; + goto out; + } + while (p < e) { + int d = hex_to_int(*p); + if (d < 0) { + status = APR_BADCH; + goto out; + } + sc = (sc << 4) | d; + p++; + } + cp = ((cp & 0x3ff) << 10) | (sc & 0x3ff); + if ((cp >= 0xd800 && cp < 0xe000) || (cp >= 0x110000)) { + status = APR_BADCH; + goto out; + } + } + else if (cp >= 0xdc00 && cp < 0xe000) { + status = APR_BADCH; + goto out; + } + q += ucs4_to_utf8(q, cp); + } + break; + case '\\': + *q++ = '\\'; + p++; + break; + case '/': + *q++ = '/'; + p++; + break; + case 'n': + *q++ = '\n'; + p++; + break; + case 'r': + *q++ = '\r'; + p++; + break; + case 't': + *q++ = '\t'; + p++; + break; + case 'f': + *q++ = '\f'; + p++; + break; + case 'b': + *q++ = '\b'; + p++; + break; + case '"': + *q++ = '"'; + p++; + break; + default: + status = APR_BADCH; + goto out; + } + break; + + case 0xc0: + case 0xc1: + case 0xc2: + case 0xc3: + case 0xc4: + case 0xc5: + case 0xc6: + case 0xc7: + case 0xc8: + case 0xc9: + case 0xca: + case 0xcb: + case 0xcc: + case 0xcd: + case 0xce: + case 0xcf: + case 0xd0: + case 0xd1: + case 0xd2: + case 0xd3: + case 0xd4: + case 0xd5: + case 0xd6: + case 0xd7: + case 0xd8: + case 0xd9: + case 0xda: + case 0xdb: + case 0xdc: + case 0xdd: + case 0xde: + case 0xdf: + if (p + 1 >= e) { + status = APR_EOF; + goto out; + } + *q++ = *p++; + VALIDATE_UTF8_SUCCEEDING_BYTE(p); + *q++ = *p++; + break; + + case 0xe0: + case 0xe1: + case 0xe2: + case 0xe3: + case 0xe4: + case 0xe5: + case 0xe6: + case 0xe7: + case 0xe8: + case 0xe9: + case 0xea: + case 0xeb: + case 0xec: + case 0xed: + case 0xee: + case 0xef: + if (p + 2 >= e) { + status = APR_EOF; + goto out; + } + *q++ = *p++; + VALIDATE_UTF8_SUCCEEDING_BYTE(p); + *q++ = *p++; + VALIDATE_UTF8_SUCCEEDING_BYTE(p); + *q++ = *p++; + break; + + case 0xf0: + case 0xf1: + case 0xf2: + case 0xf3: + case 0xf4: + case 0xf5: + case 0xf6: + case 0xf7: + if (p + 3 >= e) { + status = APR_EOF; + goto out; + } + if (((unsigned char *)p)[0] >= 0xf5 || ((unsigned char *)p)[1] >= 0x90) { + status = APR_BADCH; + goto out; + } + *q++ = *p++; + VALIDATE_UTF8_SUCCEEDING_BYTE(p); + *q++ = *p++; + VALIDATE_UTF8_SUCCEEDING_BYTE(p); + *q++ = *p++; + VALIDATE_UTF8_SUCCEEDING_BYTE(p); + *q++ = *p++; + break; + + case 0xf8: + case 0xf9: + case 0xfa: + case 0xfb: + if (p + 4 >= e) { + status = APR_EOF; + goto out; + } + status = APR_BADCH; + goto out; + + case 0xfc: + case 0xfd: + if (p + 5 >= e) { + status = APR_EOF; + goto out; + } + status = APR_BADCH; + goto out; + + default: + *q++ = *p++; + break; + } + } +#undef VALIDATE_UTF8_SUCCEEDING_BYTE + p++; /* eat the trailing '"' */ + *retval = string; +out: + self->p = p; + return status; +} + +static apr_status_t apr_json_decode_array(apr_json_scanner_t * self, + apr_array_header_t ** retval) +{ + apr_status_t status = APR_SUCCESS; + apr_pool_t *link_pool = NULL; + json_link_t *head = NULL, *tail = NULL; + apr_size_t count = 0; + + if ((status = apr_pool_create(&link_pool, self->pool))) + return status; + + if (self->p >= self->e) { + status = APR_EOF; + goto out; + } + + self->level--; + if (self->level < 0) { + return APR_EINVAL; + } + + self->p++; /* toss of the leading [ */ + + for (;;) { + apr_json_value_t *element; + json_link_t *new_node; + + if (self->p == self->e) { + status = APR_EOF; + goto out; + } + + if (*self->p == ']') { + self->p++; + break; + } + + if (APR_SUCCESS != (status = apr_json_decode_value(self, &element))) { + goto out; + } + + new_node = apr_pcalloc(link_pool, sizeof(json_link_t)); + new_node->value = element; + if (tail) { + tail->next = new_node; + } + else { + head = new_node; + } + tail = new_node; + count++; + + if (self->p == self->e) { + status = APR_EOF; + goto out; + } + + if (*self->p == ',') { + self->p++; + } + else if (*self->p != ']') { + status = APR_BADCH; + goto out; + } + } + + { + json_link_t *node; + apr_array_header_t *array = apr_array_make(self->pool, count, sizeof(apr_json_value_t *)); + for (node = head; node; node = node->next) { + *((apr_json_value_t **) (apr_array_push(array))) = node->value; + } + *retval = array; + } + + self->level++; + +out: + if (link_pool) { + apr_pool_destroy(link_pool); + } + return status; +} + +static apr_status_t apr_json_decode_object(apr_json_scanner_t * self, + apr_json_object_t ** retval) +{ + apr_status_t status = APR_SUCCESS; + + apr_json_object_t *object = apr_json_object_create(self->pool); + + if (self->p >= self->e) { + return APR_EOF; + } + + self->level--; + if (self->level < 0) { + return APR_EINVAL; + } + + self->p++; /* toss of the leading { */ + + for (;;) { + apr_json_value_t *key; + apr_json_value_t *value; + + if (self->p == self->e) { + status = APR_EOF; + goto out; + } + + if (*self->p == '}') { + self->p++; + break; + } + + if ((status = apr_json_decode_value(self, &key))) + goto out; + + if (key->type != APR_JSON_STRING) { + status = APR_BADCH; + goto out; + } + + if (self->p == self->e) { + status = APR_EOF; + goto out; + } + + if (*self->p != ':') { + status = APR_BADCH; + goto out; + } + + self->p++; /* eat the ':' */ + + if (self->p == self->e) { + status = APR_EOF; + goto out; + } + + if ((status = apr_json_decode_value(self, &value))) + goto out; + + apr_json_object_set(object, key, value, self->pool); + + if (self->p == self->e) { + status = APR_EOF; + goto out; + } + + if (*self->p == ',') { + self->p++; + } + else if (*self->p != '}') { + status = APR_BADCH; + goto out; + } + } + + self->level++; + + *retval = object; +out: + return status; +} + +static apr_status_t apr_json_decode_boolean(apr_json_scanner_t * self, int *retval) +{ + if (self->p >= self->e) + return APR_EOF; + + if (self->e - self->p >= 4 && strncmp("true", self->p, 4) == 0 && + (self->p == self->e || + (!isalnum(((unsigned char *)self->p)[4]) && + ((unsigned char *)self->p)[4] != '_'))) { + self->p += 4; + *retval = 1; + return APR_SUCCESS; + } + else if (self->e - self->p >= 5 && strncmp("false", self->p, 5) == 0 && + (self->p == self->e || + (!isalnum(((unsigned char *)self->p)[5]) && + ((unsigned char *)self->p)[5] != '_'))) { + self->p += 5; + *retval = 0; + return APR_SUCCESS; + } + return APR_BADCH; +} + +static apr_status_t apr_json_decode_number(apr_json_scanner_t * self, apr_json_value_t * retval) +{ + apr_status_t status = APR_SUCCESS; + int treat_as_float = 0, exp_occurred = 0; + const char *p = self->p, *e = self->e; + + if (p >= e) + return APR_EOF; + + { + unsigned char c = *(unsigned char *)p; + if (c == '-') { + p++; + if (p >= e) + return APR_EOF; + c = *(unsigned char *)p; + } + if (c == '.') { + p++; + if (p >= e) + return APR_EOF; + c = *(unsigned char *)p; + treat_as_float = 1; + } + if (!isdigit(c)) { + status = APR_BADCH; + goto out; + } + p++; + } + + if (!treat_as_float) { + while (p < e) { + unsigned char c = *(unsigned char *)p; + if (c == 'e' || c == 'E') { + p++; + if (p >= e) + return APR_EOF; + c = *(unsigned char *)p; + if (c == '-') { + p++; + if (p >= e) + return APR_EOF; + c = *(unsigned char *)p; + } + if (!isdigit(c)) { + status = APR_BADCH; + goto out; + } + treat_as_float = 1; + exp_occurred = 1; + break; + } + else if (c == '.') { + p++; + treat_as_float = 1; + break; + } + else if (!isdigit(c)) + break; + p++; + } + } + else { + while (p < e) { + unsigned char c = *(unsigned char *)p; + if (c == 'e' || c == 'E') { + p++; + if (p >= e) + return APR_EOF; + c = *(unsigned char *)p; + if (c == '-') { + p++; + if (p >= e) + return APR_EOF; + c = *(unsigned char *)p; + } + if (!isdigit(c)) { + status = APR_BADCH; + goto out; + } + exp_occurred = 1; + break; + } + else if (!isdigit(c)) + break; + p++; + } + } + + if (treat_as_float) { + if (!exp_occurred) { + while (p < e) { + unsigned char c = *(unsigned char *)p; + if (c == 'e' || c == 'E') { + p++; + if (p >= e) + return APR_EOF; + c = *(unsigned char *)p; + if (c == '-') { + p++; + if (p >= e) + return APR_EOF; + c = *(unsigned char *)p; + } + if (!isdigit(c)) { + status = APR_BADCH; + goto out; + } + exp_occurred = 1; + break; + } + else if (!isdigit(c)) + break; + p++; + } + } + if (exp_occurred) { + if (p >= e || !isdigit(*(unsigned char *)p)) + return APR_EOF; + while (++p < e && isdigit(*(unsigned char *)p)); + } + } + + if (treat_as_float) { + retval->type = APR_JSON_DOUBLE; + retval->value.dnumber = strtod(self->p, NULL); + } + else { + retval->type = APR_JSON_LONG; + retval->value.lnumber = strtol(self->p, NULL, 10); + } + +out: + self->p = p; + return status; +} + +static apr_status_t apr_json_decode_null(apr_json_scanner_t * self) +{ + if (self->e - self->p >= 4 && strncmp("null", self->p, 4) == 0 && + (self->p == self->e || + (!isalnum(((unsigned char *)self->p)[4]) && + ((unsigned char *)self->p)[4] != '_'))) { + self->p += 4; + return APR_SUCCESS; + } + return APR_BADCH; +} + +static apr_status_t apr_json_decode_space(apr_json_scanner_t * self, + const char **space) +{ + const char *p = self->p; + char *s; + int len = 0; + + *space = NULL; + + if (self->p >= self->e) { + return APR_SUCCESS; + } + + while (p < self->e && isspace(*(unsigned char *)p)) { + p++; + len++; + } + + if (self->flags & APR_JSON_FLAGS_WHITESPACE) { + if (len) { + *space = s = apr_palloc(self->pool, len + 1); + + while (self->p < self->e && isspace(*(unsigned char *) self->p)) { + *s++ = *self->p++; + } + *s = 0; + + } + } else { + self->p = p; + } + + return APR_SUCCESS; +} + +static apr_status_t apr_json_decode_value(apr_json_scanner_t * self, apr_json_value_t ** retval) +{ + apr_json_value_t value; + apr_status_t status = APR_SUCCESS; + + status = apr_json_decode_space(self, &value.pre); + + if (status == APR_SUCCESS) { + switch (*(unsigned char *) self->p) { + case '"': + value.type = APR_JSON_STRING; + status = apr_json_decode_string(self, &value.value.string); + break; + case '[': + value.type = APR_JSON_ARRAY; + status = apr_json_decode_array(self, &value.value.array); + break; + case '{': + value.type = APR_JSON_OBJECT; + status = apr_json_decode_object(self, &value.value.object); + break; + case 'n': + value.type = APR_JSON_NULL; + status = apr_json_decode_null(self); + break; + case 't': + case 'f': + value.type = APR_JSON_BOOLEAN; + status = apr_json_decode_boolean(self, &value.value.boolean); + break; + case '-': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + status = apr_json_decode_number(self, &value); + break; + default: + status = APR_BADCH; + } + } + + if (status == APR_SUCCESS) { + status = apr_json_decode_space(self, &value.post); + } + + if (status == APR_SUCCESS) { + *retval = apr_json_value_create(self->pool); + **retval = value; + } + return status; +} + +apr_status_t apr_json_decode(apr_json_value_t ** retval, const char *injson, + apr_ssize_t injson_size, apr_off_t * offset, int flags, int level, + apr_pool_t * pool) +{ + apr_status_t status; + apr_json_scanner_t scanner; + + scanner.p = injson; + scanner.e = injson + + (injson_size == APR_JSON_VALUE_STRING ? strlen(injson) : injson_size); + scanner.pool = pool; + scanner.flags = flags; + scanner.level = level; + + if (APR_SUCCESS == (status = apr_json_decode_value(&scanner, retval))) { + if (scanner.p != scanner.e) { + /* trailing craft */ + status = APR_BADCH; + } + } + + if (offset) { + *offset = scanner.p - injson; + } + + return status; +} + +#else +/* we do not yet support JSON on EBCDIC platforms, but will do in future */ +apr_status_t apr_json_decode(apr_json_value_t ** retval, const char *injson, + apr_size_t injson_size, apr_pool_t * pool) +{ + return APR_ENOTIMPL; +} +#endif diff --git a/json/apr_json_encode.c b/json/apr_json_encode.c new file mode 100644 index 00000000000..444851173ed --- /dev/null +++ b/json/apr_json_encode.c @@ -0,0 +1,300 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_json.h" + +#if !APR_CHARSET_EBCDIC + +typedef struct apr_json_serializer_t { + apr_pool_t *pool; + apr_bucket_brigade *brigade; + apr_brigade_flush flush; + void *ctx; + int flags; +} apr_json_serializer_t; + +static apr_status_t apr_json_encode_value(apr_json_serializer_t * self, + const apr_json_value_t * value); + +static apr_status_t apr_json_brigade_write(apr_json_serializer_t * self, + const char *chunk, apr_size_t chunk_len, const char *escaped) +{ + apr_status_t status; + + status = apr_brigade_write(self->brigade, self->flush, self->ctx, chunk, chunk_len); + if (APR_SUCCESS == status) { + status = apr_brigade_puts(self->brigade, self->flush, self->ctx, escaped); + } + + return status; +} + +static apr_status_t apr_json_brigade_printf(apr_json_serializer_t * self, + const char *chunk, apr_size_t chunk_len, const char *fmt, ...) +{ + va_list ap; + apr_status_t status; + + status = apr_brigade_write(self->brigade, self->flush, self->ctx, chunk, + chunk_len); + if (APR_SUCCESS == status) { + va_start(ap, fmt); + status = apr_brigade_vprintf(self->brigade, self->flush, self->ctx, fmt, + ap); + va_end(ap); + } + + return status; +} + +static apr_status_t apr_json_encode_string(apr_json_serializer_t * self, + const apr_json_string_t * string) +{ + apr_status_t status; + const char *p, *e, *chunk; + const char invalid[4] = { 0xEF, 0xBF, 0xBD, 0x00 }; + unsigned char c; + + status = apr_brigade_putc(self->brigade, self->flush, self->ctx, '\"'); + if (APR_SUCCESS != status) { + return status; + } + + for (p = chunk = string->p, e = string->p + string->len; p < e; p++) { + switch (*p) { + case '\n': + status = apr_json_brigade_write(self, chunk, p - chunk, "\\n"); + chunk = p + 1; + break; + case '\r': + status = apr_json_brigade_write(self, chunk, p - chunk, "\\r"); + chunk = p + 1; + break; + case '\t': + status = apr_json_brigade_write(self, chunk, p - chunk, "\\t"); + chunk = p + 1; + break; + case '\b': + status = apr_json_brigade_write(self, chunk, p - chunk, "\\b"); + chunk = p + 1; + break; + case '\f': + status = apr_json_brigade_write(self, chunk, p - chunk, "\\f"); + chunk = p + 1; + break; + case '\\': + status = apr_json_brigade_write(self, chunk, p - chunk, "\\\\"); + chunk = p + 1; + break; + case '"': + status = apr_json_brigade_write(self, chunk, p - chunk, "\\\""); + chunk = p + 1; + break; + default: + c = (unsigned char)(*p); + apr_size_t left = e - p; + if (c < 0x20) { + status = apr_json_brigade_printf(self, chunk, p - chunk, + "\\u%04x", c); + chunk = p + 1; + } + else if (((c >> 7) == 0x00)) { + /* 1 byte */ + } + else if (left > 1 && ((c >> 5) == 0x06) && p[1]) { + /* 2 bytes */ + if (left < 2 || (p[1] >> 6) != 0x02) { + status = apr_json_brigade_write(self, chunk, p - chunk, + invalid); + chunk = p + 1; + } + } + else if (((c >> 4) == 0x0E)) { + /* 3 bytes */ + if (left < 3 || (p[1] >> 6) != 0x02 || (p[2] >> 6) != 0x02) { + status = apr_json_brigade_write(self, chunk, p - chunk, + invalid); + chunk = p + 1; + } + } + else if ((c >> 3) == 0x1E) { + /* 4 bytes */ + if (left < 4 || (p[1] >> 6) != 0x02 || (p[2] >> 6) != 0x02 || (p[3] >> 6) != 0x02) { + status = apr_json_brigade_write(self, chunk, p - chunk, + invalid); + chunk = p + 1; + } + } + else { + status = apr_json_brigade_write(self, chunk, p - chunk, + invalid); + chunk = p + 1; + } + break; + } + + if (APR_SUCCESS != status) { + return status; + } + } + + if (chunk < p) { + status = apr_brigade_write(self->brigade, self->flush, self->ctx, chunk, p - chunk); + if (APR_SUCCESS != status) { + return status; + } + } + + return apr_brigade_putc(self->brigade, self->flush, self->ctx, '\"'); +} + + +static apr_status_t apr_json_encode_array(apr_json_serializer_t * self, apr_array_header_t * array) +{ + apr_status_t status; + apr_size_t i; + + status = apr_brigade_putc(self->brigade, self->flush, self->ctx, '['); + if (APR_SUCCESS != status) { + return status; + } + + for (i = 0; i < array->nelts; i++) { + + if (i > 0) { + status = apr_brigade_putc(self->brigade, self->flush, self->ctx, ','); + if (APR_SUCCESS != status) { + return status; + } + } + + status = apr_json_encode_value(self, ((apr_json_value_t **) array->elts)[i]); + if (APR_SUCCESS != status) { + return status; + } + + } + + return apr_brigade_putc(self->brigade, self->flush, self->ctx, ']'); +} + +static apr_status_t apr_json_encode_object(apr_json_serializer_t * self, apr_json_object_t * object) +{ + apr_status_t status; + apr_json_kv_t *kv; + int first = 1; + status = apr_brigade_putc(self->brigade, self->flush, self->ctx, '{'); + if (APR_SUCCESS != status) { + return status; + } + + for (kv = APR_RING_FIRST(&(object)->list); + kv != APR_RING_SENTINEL(&(object)->list, apr_json_kv_t, link); + kv = APR_RING_NEXT((kv), link)) { + + if (!first) { + status = apr_brigade_putc(self->brigade, self->flush, self->ctx, ','); + if (APR_SUCCESS != status) { + return status; + } + } + + { + status = apr_json_encode_value(self, kv->k); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_brigade_putc(self->brigade, self->flush, self->ctx, ':'); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_json_encode_value(self, kv->v); + if (APR_SUCCESS != status) { + return status; + } + } + first = 0; + } + return apr_brigade_putc(self->brigade, self->flush, self->ctx, '}'); +} + +static apr_status_t apr_json_encode_value(apr_json_serializer_t * self, const apr_json_value_t * value) +{ + apr_status_t status = APR_SUCCESS; + + if (value->pre && (self->flags & APR_JSON_FLAGS_WHITESPACE)) { + status = apr_brigade_puts(self->brigade, self->flush, self->ctx, + value->pre); + } + + if (APR_SUCCESS == status) { + switch (value->type) { + case APR_JSON_STRING: + status = apr_json_encode_string(self, &value->value.string); + break; + case APR_JSON_LONG: + status = apr_brigade_printf(self->brigade, self->flush, self->ctx, + "%" APR_INT64_T_FMT, value->value.lnumber); + break; + case APR_JSON_DOUBLE: + status = apr_brigade_printf(self->brigade, self->flush, self->ctx, + "%lf", value->value.dnumber); + break; + case APR_JSON_BOOLEAN: + status = apr_brigade_puts(self->brigade, self->flush, self->ctx, + value->value.boolean ? "true" : "false"); + break; + case APR_JSON_NULL: + status = apr_brigade_puts(self->brigade, self->flush, self->ctx, + "null"); + break; + case APR_JSON_OBJECT: + status = apr_json_encode_object(self, value->value.object); + break; + case APR_JSON_ARRAY: + status = apr_json_encode_array(self, value->value.array); + break; + default: + return APR_EINVAL; + } + } + + if (APR_SUCCESS == status && value->post + && (self->flags & APR_JSON_FLAGS_WHITESPACE)) { + status = apr_brigade_puts(self->brigade, self->flush, self->ctx, + value->post); + } + + return status; +} + +apr_status_t apr_json_encode(apr_bucket_brigade * brigade, apr_brigade_flush flush, + void *ctx, const apr_json_value_t * json, int flags, apr_pool_t * pool) +{ + apr_json_serializer_t serializer = {pool, brigade, flush, ctx, flags}; + return apr_json_encode_value(&serializer, json); +} + +#else + /* we do not yet support JSON on EBCDIC platforms, but will do in future */ +apr_status_t apr_json_encode(apr_bucket_brigade * brigade, apr_brigade_flush flush, + void *ctx, const apr_json_value_t * json, apr_pool_t * pool) +{ + return APR_ENOTIMPL; +} +#endif diff --git a/test/Makefile.in b/test/Makefile.in index be2d65c4e9d..291a76e71e9 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -37,7 +37,7 @@ TESTS = testtime.lo teststr.lo testvsn.lo testipsub.lo testshm.lo \ testbuckets.lo testxml.lo testdbm.lo testuuid.lo testmd5.lo \ testreslist.lo testbase64.lo testhooks.lo testlfsabi.lo \ testlfsabi32.lo testlfsabi64.lo testescape.lo testskiplist.lo \ - testsiphash.lo testredis.lo testencode.lo + testsiphash.lo testredis.lo testencode.lo testjson.lo OTHER_PROGRAMS = \ echod@EXEEXT@ \ diff --git a/test/abts_tests.h b/test/abts_tests.h index 31209866875..82cce0ce2ab 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -91,7 +91,8 @@ const struct testlist { {testreslist}, {testlfsabi}, {testskiplist}, - {testsiphash} + {testsiphash}, + {testjson} }; #endif /* APR_TEST_INCLUDES */ diff --git a/test/testjson.c b/test/testjson.c new file mode 100644 index 00000000000..338149d4f64 --- /dev/null +++ b/test/testjson.c @@ -0,0 +1,139 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "apr_json.h" + +#include "abts.h" +#include "testutil.h" + +static void test_json_identity(abts_case * tc, void *data) +{ + apr_json_value_t *json = NULL; + apr_json_kv_t *image, *width, *ids, *title, + *animated, *thumbnail, *height; + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + const char *src; + char buf[1024]; + apr_size_t len = sizeof(buf); + apr_off_t offset = 0; + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + src = "{" + " \"Image\" : {" + " \"Width\" : 800 ," + " \"IDs\" : [116, 943, 234, 38793]," + " \"Title\" : \"View from 15th Floor\"," + " \"Animated\" : false," + " \"Thumbnail\" : {" + " \"Height\" : 125," + " \"Width\" : 100," + " \"Url\" : \"http://www.example.com/image/481989943\"" + " }," + " \"Height\" : 600 " + " }" + "}"; + + apr_json_decode(&json, src, APR_JSON_VALUE_STRING, &offset, APR_JSON_FLAGS_WHITESPACE, + 10, p); + apr_json_encode(bb, NULL, NULL, json, APR_JSON_FLAGS_WHITESPACE, p); + apr_brigade_flatten(bb, buf, &len); + apr_json_decode(&json, buf, len, &offset, APR_JSON_FLAGS_WHITESPACE, 10, p); + + ABTS_STR_NEQUAL(tc, src, buf, len); + + ABTS_INT_EQUAL(tc, len, offset); + ABTS_INT_EQUAL(tc, APR_JSON_OBJECT, json->type); + image = apr_hash_get(json->value.object->hash, "Image", 5); + ABTS_PTR_NOTNULL(tc, image); + width = apr_hash_get(image->v->value.object->hash, "Width", 5); + ABTS_PTR_NOTNULL(tc, width); + ABTS_INT_EQUAL(tc, APR_JSON_LONG, width->v->type); + ABTS_INT_EQUAL(tc, 800, width->v->value.lnumber); + ids = apr_hash_get(image->v->value.object->hash, "IDs", 3); + ABTS_PTR_NOTNULL(tc, ids); + ABTS_INT_EQUAL(tc, APR_JSON_ARRAY, ids->v->type); + title = apr_hash_get(image->v->value.object->hash, "Title", 5); + ABTS_PTR_NOTNULL(tc, title); + ABTS_INT_EQUAL(tc, APR_JSON_STRING, title->v->type); + animated = apr_hash_get(image->v->value.object->hash, "Animated", 8); + ABTS_PTR_NOTNULL(tc, animated); + ABTS_INT_EQUAL(tc, APR_JSON_BOOLEAN, animated->v->type); + ABTS_TRUE(tc, !animated->v->value.boolean); + thumbnail = apr_hash_get(image->v->value.object->hash, "Thumbnail", 9); + ABTS_PTR_NOTNULL(tc, thumbnail); + ABTS_INT_EQUAL(tc, APR_JSON_OBJECT, thumbnail->v->type); + height = apr_hash_get(image->v->value.object->hash, "Height", 6); + ABTS_PTR_NOTNULL(tc, height); + ABTS_INT_EQUAL(tc, APR_JSON_LONG, height->v->type); + ABTS_INT_EQUAL(tc, 600, height->v->value.lnumber); + +} + +static void test_json_level(abts_case * tc, void *data) +{ + apr_json_value_t *json = NULL; + apr_status_t status; + const char *src; + apr_off_t offset = 0; + + src = "{" + "\"One\":{" + "\"Two\":{" + "\"Three\":{"; + + status = apr_json_decode(&json, src, APR_JSON_VALUE_STRING, &offset, + APR_JSON_FLAGS_WHITESPACE, 2, p); + + ABTS_INT_EQUAL(tc, APR_EINVAL, status); + +} + +static void test_json_eof(abts_case * tc, void *data) +{ + apr_json_value_t *json = NULL; + apr_status_t status; + const char *src; + apr_off_t offset = 0; + + src = "{" + "\"One\":{" + "\"Two\":{" + "\"Three\":{"; + + status = apr_json_decode(&json, src, APR_JSON_VALUE_STRING, &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + + ABTS_INT_EQUAL(tc, APR_EOF, status); + +} + +abts_suite *testjson(abts_suite * suite) +{ + suite = ADD_SUITE(suite); + + abts_run_test(suite, test_json_identity, NULL); + abts_run_test(suite, test_json_level, NULL); + abts_run_test(suite, test_json_eof, NULL); + + return suite; +} diff --git a/test/testutil.h b/test/testutil.h index 3a3ad2416c6..261dfd2506b 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -134,5 +134,6 @@ abts_suite *testdbm(abts_suite *suite); abts_suite *testlfsabi(abts_suite *suite); abts_suite *testskiplist(abts_suite *suite); abts_suite *testsiphash(abts_suite *suite); +abts_suite *testjson(abts_suite *suite); #endif /* APR_TEST_INCLUDES */ From 124da287c26bea89efe9f723ba611157eafed09f Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 8 Jul 2018 15:14:25 +0000 Subject: [PATCH 7814/7878] Fix the string unescape logic for multiple escaped characters. Add a unit test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1835360 13f79535-47bb-0310-9956-ffa450edef68 --- json/apr_json_decode.c | 26 +++++++++++++------------- test/testjson.c | 23 +++++++++++++++++++++++ 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/json/apr_json_decode.c b/json/apr_json_decode.c index ecb60c022d2..0c441811c8b 100644 --- a/json/apr_json_decode.c +++ b/json/apr_json_decode.c @@ -83,6 +83,7 @@ static apr_status_t apr_json_decode_string(apr_json_scanner_t * self, apr_json_s const char *p = self->p; const char *e; char *q; + apr_size_t len; if (self->p >= self->e) { status = APR_EOF; @@ -92,7 +93,7 @@ static apr_status_t apr_json_decode_string(apr_json_scanner_t * self, apr_json_s self->p++; /* eat the leading '"' */ /* advance past the \ " */ - string.len = 0; + len = 0; for (p = self->p, e = self->e; p < e;) { if (*p == '"') break; @@ -108,21 +109,20 @@ static apr_status_t apr_json_decode_string(apr_json_scanner_t * self, apr_json_s goto out; } p += 5; - string.len += 4;/* an UTF-8 character spans at most 4 bytes */ - break; + len += 4;/* an UTF-8 character spans at most 4 bytes */ } else { - string.len++; + len++; p++; } } else { - string.len++; + len++; p++; } } - string.p = q = apr_pcalloc(self->pool, string.len + 1); + string.p = q = apr_pcalloc(self->pool, len + 1); e = p; #define VALIDATE_UTF8_SUCCEEDING_BYTE(p) \ @@ -139,15 +139,14 @@ static apr_status_t apr_json_decode_string(apr_json_scanner_t * self, apr_json_s case 'u': /* THIS IS REQUIRED TO BE A 4 DIGIT HEX NUMBER */ { - int cp = 0; - while (p < e) { - int d = hex_to_int(*p); + int i, d, cp = 0; + for (i = 0, p++; i < 4 && p < e; i++, p++) { + d = hex_to_int(*p); if (d < 0) { status = APR_BADCH; goto out; } cp = (cp << 4) | d; - p++; } if (cp >= 0xd800 && cp < 0xdc00) { /* surrogate pair */ @@ -160,14 +159,13 @@ static apr_status_t apr_json_decode_string(apr_json_scanner_t * self, apr_json_s status = APR_BADCH; goto out; } - while (p < e) { - int d = hex_to_int(*p); + for (i = 0, p += 2; i < 4 && p < e; i++, p++) { + d = hex_to_int(*p); if (d < 0) { status = APR_BADCH; goto out; } sc = (sc << 4) | d; - p++; } cp = ((cp & 0x3ff) << 10) | (sc & 0x3ff); if ((cp >= 0xd800 && cp < 0xe000) || (cp >= 0x110000)) { @@ -340,6 +338,8 @@ static apr_status_t apr_json_decode_string(apr_json_scanner_t * self, apr_json_s } #undef VALIDATE_UTF8_SUCCEEDING_BYTE p++; /* eat the trailing '"' */ + *q = 0; + string.len = q - string.p; *retval = string; out: self->p = p; diff --git a/test/testjson.c b/test/testjson.c index 338149d4f64..8ce9b148ce2 100644 --- a/test/testjson.c +++ b/test/testjson.c @@ -127,6 +127,28 @@ static void test_json_eof(abts_case * tc, void *data) } +static void test_json_string(abts_case * tc, void *data) +{ + apr_json_value_t *json = NULL; + apr_status_t status; + const char *src; + apr_off_t offset = 0; + + /* "턞\"\t/\b\f\n\r\t"; */ + const unsigned char expected[] = {237, 132, 158, 34, 9, 47, 8, 12, 10, 13, 9, 0}; + + src = "\"\\uD834\\uDD1E\\\"\\t\\/\\b\\f\\n\\r\\t\""; + + status = apr_json_decode(&json, src, APR_JSON_VALUE_STRING, &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + ABTS_INT_EQUAL(tc, APR_JSON_STRING, json->type); + + ABTS_ASSERT(tc, "check for string unescape match", + (memcmp(expected, json->value.string.p, json->value.string.len) == 0)); +} + abts_suite *testjson(abts_suite * suite) { suite = ADD_SUITE(suite); @@ -134,6 +156,7 @@ abts_suite *testjson(abts_suite * suite) abts_run_test(suite, test_json_identity, NULL); abts_run_test(suite, test_json_level, NULL); abts_run_test(suite, test_json_eof, NULL); + abts_run_test(suite, test_json_string, NULL); return suite; } From 9073d8398799009e2646e068b56be2060f0e77a3 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 8 Jul 2018 16:40:43 +0000 Subject: [PATCH 7815/7878] Create the subpool after the failure cases are all considerd. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1835364 13f79535-47bb-0310-9956-ffa450edef68 --- json/apr_json_decode.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/json/apr_json_decode.c b/json/apr_json_decode.c index 0c441811c8b..35476a8ee48 100644 --- a/json/apr_json_decode.c +++ b/json/apr_json_decode.c @@ -354,18 +354,19 @@ static apr_status_t apr_json_decode_array(apr_json_scanner_t * self, json_link_t *head = NULL, *tail = NULL; apr_size_t count = 0; - if ((status = apr_pool_create(&link_pool, self->pool))) - return status; - if (self->p >= self->e) { status = APR_EOF; goto out; } - self->level--; - if (self->level < 0) { + if (self->level <= 0) { return APR_EINVAL; } + self->level--; + + if ((status = apr_pool_create(&link_pool, self->pool))) { + return status; + } self->p++; /* toss of the leading [ */ @@ -441,10 +442,10 @@ static apr_status_t apr_json_decode_object(apr_json_scanner_t * self, return APR_EOF; } - self->level--; - if (self->level < 0) { + if (self->level <= 0) { return APR_EINVAL; } + self->level--; self->p++; /* toss of the leading { */ From 5120b7b238ac66c2b4e70b36388dbaa750eedf59 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 8 Jul 2018 17:27:08 +0000 Subject: [PATCH 7816/7878] Remove redundant checks, trailing garbage is caught elsewhere. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1835366 13f79535-47bb-0310-9956-ffa450edef68 --- json/apr_json_decode.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/json/apr_json_decode.c b/json/apr_json_decode.c index 35476a8ee48..7623dde1fc2 100644 --- a/json/apr_json_decode.c +++ b/json/apr_json_decode.c @@ -519,18 +519,12 @@ static apr_status_t apr_json_decode_boolean(apr_json_scanner_t * self, int *retv if (self->p >= self->e) return APR_EOF; - if (self->e - self->p >= 4 && strncmp("true", self->p, 4) == 0 && - (self->p == self->e || - (!isalnum(((unsigned char *)self->p)[4]) && - ((unsigned char *)self->p)[4] != '_'))) { + if (self->e - self->p >= 4 && strncmp("true", self->p, 4) == 0) { self->p += 4; *retval = 1; return APR_SUCCESS; } - else if (self->e - self->p >= 5 && strncmp("false", self->p, 5) == 0 && - (self->p == self->e || - (!isalnum(((unsigned char *)self->p)[5]) && - ((unsigned char *)self->p)[5] != '_'))) { + else if (self->e - self->p >= 5 && strncmp("false", self->p, 5) == 0) { self->p += 5; *retval = 0; return APR_SUCCESS; @@ -678,10 +672,7 @@ static apr_status_t apr_json_decode_number(apr_json_scanner_t * self, apr_json_v static apr_status_t apr_json_decode_null(apr_json_scanner_t * self) { - if (self->e - self->p >= 4 && strncmp("null", self->p, 4) == 0 && - (self->p == self->e || - (!isalnum(((unsigned char *)self->p)[4]) && - ((unsigned char *)self->p)[4] != '_'))) { + if (self->e - self->p >= 4 && strncmp("null", self->p, 4) == 0) { self->p += 4; return APR_SUCCESS; } From d1ffc44977c925713203eaa1007177db4adf80c2 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Mon, 9 Jul 2018 09:06:29 +0000 Subject: [PATCH 7817/7878] * We cannot define the type of apr_json_object_t twice, here and in line 83. As we need the typedef in line 83 for the structures above, don't typedef here again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1835392 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_json.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_json.h b/include/apr_json.h index a1342c83639..4c91a0375be 100644 --- a/include/apr_json.h +++ b/include/apr_json.h @@ -153,12 +153,12 @@ typedef struct apr_json_kv_t { * * Use apr_json_object_create() to allocate. */ -typedef struct apr_json_object_t { +struct apr_json_object_t { /** The key value pairs in the object are in this list */ APR_RING_HEAD(apr_json_object_list_t, apr_json_kv_t) list; /** JSON object */ apr_hash_t *hash; -} apr_json_object_t; +}; /** * Allocate and return a apr_json_value_t structure. From 330d305de07bb4af1aba4ec89aaffcb8c810182c Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 15 Jul 2018 14:00:04 +0000 Subject: [PATCH 7818/7878] Rework the create functions to create a JSON object for each JSON type. Simplifies code that uses the library. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1835979 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_json.h | 89 +++++++++++++++++++++++++++++---- json/apr_json.c | 111 +++++++++++++++++++++++++++++++++++++---- json/apr_json_decode.c | 16 +++--- json/apr_json_encode.c | 4 +- 4 files changed, 193 insertions(+), 27 deletions(-) diff --git a/include/apr_json.h b/include/apr_json.h index 4c91a0375be..91b7316f6ab 100644 --- a/include/apr_json.h +++ b/include/apr_json.h @@ -101,8 +101,8 @@ typedef enum apr_json_type_e { typedef struct apr_json_string_t { /** pointer to the string */ const char *p; - /** string length */ - apr_size_t len; + /** string length, or APR_JSON_VALUE_STRING to compute length automatically */ + apr_ssize_t len; } apr_json_string_t; /** @@ -170,29 +170,98 @@ APR_DECLARE(apr_json_value_t *) apr_json_value_create(apr_pool_t *pool) __attribute__((nonnull(1))); /** - * Allocate and return a apr_json_object_t structure. + * Allocate and return a JSON string with the given value. * * @param pool The pool to allocate from. - * @return The apr_json_object_t structure. + * @param val The UTF-8 encoded string value. + * @param len The length of the string, or APR_JSON_VALUE_STRING. + * @return The apr_json_value_t structure. + */ +APR_DECLARE(apr_json_value_t *) + apr_json_string_create(apr_pool_t *pool, const char *val, + apr_ssize_t len) __attribute__((nonnull(1))); + +/** + * Allocate and return a JSON array. + * + * @param pool The pool to allocate from. + * @param nelts the number of elements in the initial array + * @return The apr_json_value_t structure. + */ +APR_DECLARE(apr_json_value_t *) + apr_json_array_create(apr_pool_t *pool, int nelts) + __attribute__((nonnull(1))); + +/** + * Allocate and return a JSON object. + * + * @param pool The pool to allocate from. + * @return The apr_json_value_t structure. */ -APR_DECLARE(apr_json_object_t *) apr_json_object_create(apr_pool_t *pool) +APR_DECLARE(apr_json_value_t *) apr_json_object_create(apr_pool_t *pool) __attribute__((nonnull(1))); +/** + * Allocate and return a JSON long. + * + * @param pool The pool to allocate from. + * @param lnumber The long value. + * @return The apr_json_value_t structure. + */ +APR_DECLARE(apr_json_value_t *) + apr_json_long_create(apr_pool_t *pool, apr_int64_t lnumber) + __attribute__((nonnull(1))); + +/** + * Allocate and return a JSON double. + * + * @param pool The pool to allocate from. + * @param dnumber The double value. + * @return The apr_json_value_t structure. + */ +APR_DECLARE(apr_json_value_t *) + apr_json_double_create(apr_pool_t *pool, double dnumber) + __attribute__((nonnull(1))); + +/** + * Allocate and return a JSON boolean. + * + * @param pool The pool to allocate from. + * @param boolean The boolean value. + * @return The apr_json_value_t structure. + */ +APR_DECLARE(apr_json_value_t *) + apr_json_boolean_create(apr_pool_t *pool, int boolean) + __attribute__((nonnull(1))); + +/** + * Allocate and return a JSON null. + * + * @param pool The pool to allocate from. + * @return The apr_json_value_t structure. + */ +APR_DECLARE(apr_json_value_t *) + apr_json_null_create(apr_pool_t *pool) + __attribute__((nonnull(1))); + /** * Associate a value with a key in a JSON object. * @param obj The JSON object. - * @param key Pointer to the key. + * @param key Pointer to the key string. * @param val Value to associate with the key. + * @param pool Pool to use. + * @return APR_SUCCESS on success, APR_EINVAL if the key is + * NULL or not a string, or the object is not an APR_JSON_OBJECT. * @remark If the value is NULL the key value pair is deleted. */ -APR_DECLARE(void) apr_json_object_set(apr_json_object_t *obj, +APR_DECLARE(apr_status_t) apr_json_object_set(apr_json_value_t *obj, apr_json_value_t *key, apr_json_value_t *val, - apr_pool_t *pool) __attribute__((nonnull(1, 2, 4))); + apr_pool_t *pool) __attribute__((nonnull(1, 4))); /** * Look up the value associated with a key in a JSON object. - * @param ht The hash table - * @param key Pointer to the key + * @param obj The JSON object. + * @param key Pointer to the key. * @return Returns NULL if the key is not present. */ APR_DECLARE(apr_json_kv_t *) diff --git a/json/apr_json.c b/json/apr_json.c index 98966659f67..ebae3d92d51 100644 --- a/json/apr_json.c +++ b/json/apr_json.c @@ -30,42 +30,133 @@ apr_json_value_t *apr_json_value_create(apr_pool_t *pool) return apr_pcalloc(pool, sizeof(apr_json_value_t)); } -apr_json_object_t *apr_json_object_create(apr_pool_t *pool) +apr_json_value_t *apr_json_object_create(apr_pool_t *pool) { - apr_json_object_t *object = apr_pcalloc(pool, - sizeof(apr_json_object_t)); + apr_json_object_t *object; + + apr_json_value_t *json = apr_json_value_create(pool); + + json->type = APR_JSON_OBJECT; + json->value.object = object = apr_pcalloc(pool, sizeof(apr_json_object_t)); APR_RING_INIT(&object->list, apr_json_kv_t, link); object->hash = apr_hash_make(pool); - return object; + return json; +} + +apr_json_value_t *apr_json_string_create(apr_pool_t *pool, const char *val, + apr_ssize_t len) { + apr_json_value_t *json = apr_json_value_create(pool); + + if (json) { + if (val) { + json->type = APR_JSON_STRING; + json->value.string.p = val; + json->value.string.len = len; + } else { + json->type = APR_JSON_NULL; + } + } + + return json; +} + +apr_json_value_t *apr_json_array_create(apr_pool_t *pool, int nelts) +{ + apr_json_value_t *json = apr_json_value_create(pool); + + if (json) { + json->type = APR_JSON_ARRAY; + json->value.array = apr_array_make(pool, nelts, + sizeof(apr_json_value_t *)); + } + + return json; +} + +apr_json_value_t *apr_json_long_create(apr_pool_t *pool, apr_int64_t lnumber) +{ + apr_json_value_t *json = apr_json_value_create(pool); + + if (json) { + json->type = APR_JSON_LONG; + json->value.lnumber = lnumber; + } + + return json; +} + +apr_json_value_t *apr_json_double_create(apr_pool_t *pool, double dnumber) +{ + apr_json_value_t *json = apr_json_value_create(pool); + + if (json) { + json->type = APR_JSON_DOUBLE; + json->value.lnumber = dnumber; + } + + return json; +} + +apr_json_value_t *apr_json_boolean_create(apr_pool_t *pool, int boolean) +{ + apr_json_value_t *json = apr_json_value_create(pool); + + if (json) { + json->type = APR_JSON_BOOLEAN; + json->value.boolean = boolean; + } + + return json; } -void apr_json_object_set(apr_json_object_t *object, apr_json_value_t *key, +apr_json_value_t *apr_json_null_create(apr_pool_t *pool) +{ + apr_json_value_t *json = apr_json_value_create(pool); + + if (json) { + json->type = APR_JSON_NULL; + } + + return json; +} + +apr_status_t apr_json_object_set(apr_json_value_t *object, apr_json_value_t *key, apr_json_value_t *val, apr_pool_t *pool) { apr_json_kv_t *kv; + apr_hash_t *hash; + + if (object->type != APR_JSON_OBJECT || !key + || key->type != APR_JSON_STRING) { + return APR_EINVAL; + } - kv = apr_hash_get(object->hash, key->value.string.p, key->value.string.len); + hash = object->value.object->hash; + + kv = apr_hash_get(hash, key->value.string.p, key->value.string.len); if (!val) { if (kv) { - apr_hash_set(object->hash, key->value.string.p, key->value.string.len, + apr_hash_set(hash, key->value.string.p, key->value.string.len, NULL); APR_RING_REMOVE((kv), link); } - return; + return APR_SUCCESS; } if (!kv) { kv = apr_palloc(pool, sizeof(apr_json_kv_t)); APR_RING_ELEM_INIT(kv, link); - APR_JSON_OBJECT_INSERT_TAIL(object, kv); - apr_hash_set(object->hash, key->value.string.p, key->value.string.len, + APR_JSON_OBJECT_INSERT_TAIL(object->value.object, kv); + apr_hash_set(hash, key->value.string.p, key->value.string.len, kv); } kv->k = key; kv->v = val; + + return APR_SUCCESS; } apr_json_kv_t *apr_json_object_get(apr_json_object_t *object, const char *key) diff --git a/json/apr_json_decode.c b/json/apr_json_decode.c index 7623dde1fc2..940497a717c 100644 --- a/json/apr_json_decode.c +++ b/json/apr_json_decode.c @@ -83,7 +83,7 @@ static apr_status_t apr_json_decode_string(apr_json_scanner_t * self, apr_json_s const char *p = self->p; const char *e; char *q; - apr_size_t len; + apr_ssize_t len; if (self->p >= self->e) { status = APR_EOF; @@ -432,11 +432,16 @@ static apr_status_t apr_json_decode_array(apr_json_scanner_t * self, } static apr_status_t apr_json_decode_object(apr_json_scanner_t * self, - apr_json_object_t ** retval) + apr_json_value_t *json, apr_json_object_t ** retval) { apr_status_t status = APR_SUCCESS; - apr_json_object_t *object = apr_json_object_create(self->pool); + apr_json_object_t *object = apr_pcalloc(self->pool, + sizeof(apr_json_object_t)); + APR_RING_INIT(&object->list, apr_json_kv_t, link); + object->hash = apr_hash_make(self->pool); + + *retval = object; if (self->p >= self->e) { return APR_EOF; @@ -491,7 +496,7 @@ static apr_status_t apr_json_decode_object(apr_json_scanner_t * self, if ((status = apr_json_decode_value(self, &value))) goto out; - apr_json_object_set(object, key, value, self->pool); + apr_json_object_set(json, key, value, self->pool); if (self->p == self->e) { status = APR_EOF; @@ -509,7 +514,6 @@ static apr_status_t apr_json_decode_object(apr_json_scanner_t * self, self->level++; - *retval = object; out: return status; } @@ -733,7 +737,7 @@ static apr_status_t apr_json_decode_value(apr_json_scanner_t * self, apr_json_va break; case '{': value.type = APR_JSON_OBJECT; - status = apr_json_decode_object(self, &value.value.object); + status = apr_json_decode_object(self, &value, &value.value.object); break; case 'n': value.type = APR_JSON_NULL; diff --git a/json/apr_json_encode.c b/json/apr_json_encode.c index 444851173ed..8b4830c9d98 100644 --- a/json/apr_json_encode.c +++ b/json/apr_json_encode.c @@ -73,7 +73,9 @@ static apr_status_t apr_json_encode_string(apr_json_serializer_t * self, return status; } - for (p = chunk = string->p, e = string->p + string->len; p < e; p++) { + for (p = chunk = string->p, e = string->p + + (APR_JSON_VALUE_STRING == string->len ? + strlen(string->p) : string->len); p < e; p++) { switch (*p) { case '\n': status = apr_json_brigade_write(self, chunk, p - chunk, "\\n"); From 16865762395feea14e39471c57f7fb6520648e9d Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 15 Jul 2018 20:35:43 +0000 Subject: [PATCH 7819/7878] Document apr_xml_internal.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1835993 13f79535-47bb-0310-9956-ffa450edef68 --- xml/apr_xml_internal.h | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/xml/apr_xml_internal.h b/xml/apr_xml_internal.h index dfd191e3276..f501077f0b2 100644 --- a/xml/apr_xml_internal.h +++ b/xml/apr_xml_internal.h @@ -19,7 +19,9 @@ struct XMLParserImpl { + /** parse callback */ apr_status_t (*Parse)(apr_xml_parser*, const char*, apr_size_t, int); + /** cleanup callback */ apr_status_t (*cleanup)(void*); }; typedef struct XMLParserImpl XMLParserImpl; @@ -28,18 +30,25 @@ XMLParserImpl* apr_xml_get_parser_impl(void); /* the real (internal) definition of the parser context */ struct apr_xml_parser { - apr_xml_doc *doc; /* the doc we're parsing */ - apr_pool_t *p; /* the pool we allocate from */ - apr_xml_elem *cur_elem; /* current element */ - - int error; /* an error has occurred */ + /** the doc we're parsing */ + apr_xml_doc *doc; + /** the pool we allocate from */ + apr_pool_t *p; + /** current element */ + apr_xml_elem *cur_elem; + /** an error has occurred */ + int error; #define APR_XML_ERROR_EXPAT 1 #define APR_XML_ERROR_PARSE_DONE 2 /* also: public APR_XML_NS_ERROR_* values (if any) */ - XML_Parser xp; /* the actual (Expat) XML parser */ - XML_Error xp_err; /* stored Expat error code */ + /** the actual (Expat) XML parser */ + XML_Parser xp; + /** stored Expat error code */ + XML_Error xp_err; + /** message */ const char *xp_msg; + /** XML parser implementation */ XMLParserImpl *impl; }; From 7700e5b4033270780327c16898f647063cc0a464 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 16 Jul 2018 10:45:39 +0000 Subject: [PATCH 7820/7878] apr_json: strengthen decoding of float and object key. A float number can't start with a dot, and an object key is a string so we can avoid parsing any type before failing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836017 13f79535-47bb-0310-9956-ffa450edef68 --- json/apr_json_decode.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/json/apr_json_decode.c b/json/apr_json_decode.c index 940497a717c..0e0fa4d3dd4 100644 --- a/json/apr_json_decode.c +++ b/json/apr_json_decode.c @@ -34,7 +34,10 @@ typedef struct apr_json_scanner_t { int level; } apr_json_scanner_t; -static apr_status_t apr_json_decode_value(apr_json_scanner_t * self, apr_json_value_t ** retval); +static apr_status_t apr_json_decode_space(apr_json_scanner_t * self, + const char **space); +static apr_status_t apr_json_decode_value(apr_json_scanner_t * self, + apr_json_value_t ** retval); /* stolen from mod_mime_magic.c :) */ /* Single hex char to int; -1 if not a hex char. */ @@ -468,19 +471,30 @@ static apr_status_t apr_json_decode_object(apr_json_scanner_t * self, break; } - if ((status = apr_json_decode_value(self, &key))) + key = apr_json_value_create(self->pool); + if ((status = apr_json_decode_space(self, &key->pre))) goto out; - if (key->type != APR_JSON_STRING) { + if (self->p == self->e) { + status = APR_EOF; + goto out; + } + if (*self->p != '"') { status = APR_BADCH; goto out; } + key->type = APR_JSON_STRING; + if ((status = apr_json_decode_string(self, &key->value.string))) + goto out; + + if ((status = apr_json_decode_space(self, &key->post))) + goto out; + if (self->p == self->e) { status = APR_EOF; goto out; } - if (*self->p != ':') { status = APR_BADCH; goto out; @@ -553,13 +567,6 @@ static apr_status_t apr_json_decode_number(apr_json_scanner_t * self, apr_json_v return APR_EOF; c = *(unsigned char *)p; } - if (c == '.') { - p++; - if (p >= e) - return APR_EOF; - c = *(unsigned char *)p; - treat_as_float = 1; - } if (!isdigit(c)) { status = APR_BADCH; goto out; @@ -771,8 +778,10 @@ static apr_status_t apr_json_decode_value(apr_json_scanner_t * self, apr_json_va } if (status == APR_SUCCESS) { - *retval = apr_json_value_create(self->pool); - **retval = value; + *retval = apr_pmemdup(self->pool, &value, sizeof(value)); + } + else { + *retval = NULL; } return status; } From 46d1da12b0f43f44d5f48fd4b69275b9a7dc99c7 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Mon, 16 Jul 2018 12:32:57 +0000 Subject: [PATCH 7821/7878] Begone foul tabs, and blight not our shores. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836027 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_json.h | 24 +++++----- json/apr_json.c | 106 ++++++++++++++++++++--------------------- json/apr_json_decode.c | 4 +- test/testjson.c | 6 +-- 4 files changed, 70 insertions(+), 70 deletions(-) diff --git a/include/apr_json.h b/include/apr_json.h index 91b7316f6ab..6850feccd5c 100644 --- a/include/apr_json.h +++ b/include/apr_json.h @@ -178,8 +178,8 @@ APR_DECLARE(apr_json_value_t *) apr_json_value_create(apr_pool_t *pool) * @return The apr_json_value_t structure. */ APR_DECLARE(apr_json_value_t *) - apr_json_string_create(apr_pool_t *pool, const char *val, - apr_ssize_t len) __attribute__((nonnull(1))); + apr_json_string_create(apr_pool_t *pool, const char *val, + apr_ssize_t len) __attribute__((nonnull(1))); /** * Allocate and return a JSON array. @@ -189,8 +189,8 @@ APR_DECLARE(apr_json_value_t *) * @return The apr_json_value_t structure. */ APR_DECLARE(apr_json_value_t *) - apr_json_array_create(apr_pool_t *pool, int nelts) - __attribute__((nonnull(1))); + apr_json_array_create(apr_pool_t *pool, int nelts) + __attribute__((nonnull(1))); /** * Allocate and return a JSON object. @@ -209,8 +209,8 @@ APR_DECLARE(apr_json_value_t *) apr_json_object_create(apr_pool_t *pool) * @return The apr_json_value_t structure. */ APR_DECLARE(apr_json_value_t *) - apr_json_long_create(apr_pool_t *pool, apr_int64_t lnumber) - __attribute__((nonnull(1))); + apr_json_long_create(apr_pool_t *pool, apr_int64_t lnumber) + __attribute__((nonnull(1))); /** * Allocate and return a JSON double. @@ -220,8 +220,8 @@ APR_DECLARE(apr_json_value_t *) * @return The apr_json_value_t structure. */ APR_DECLARE(apr_json_value_t *) - apr_json_double_create(apr_pool_t *pool, double dnumber) - __attribute__((nonnull(1))); + apr_json_double_create(apr_pool_t *pool, double dnumber) + __attribute__((nonnull(1))); /** * Allocate and return a JSON boolean. @@ -231,8 +231,8 @@ APR_DECLARE(apr_json_value_t *) * @return The apr_json_value_t structure. */ APR_DECLARE(apr_json_value_t *) - apr_json_boolean_create(apr_pool_t *pool, int boolean) - __attribute__((nonnull(1))); + apr_json_boolean_create(apr_pool_t *pool, int boolean) + __attribute__((nonnull(1))); /** * Allocate and return a JSON null. @@ -241,8 +241,8 @@ APR_DECLARE(apr_json_value_t *) * @return The apr_json_value_t structure. */ APR_DECLARE(apr_json_value_t *) - apr_json_null_create(apr_pool_t *pool) - __attribute__((nonnull(1))); + apr_json_null_create(apr_pool_t *pool) + __attribute__((nonnull(1))); /** * Associate a value with a key in a JSON object. diff --git a/json/apr_json.c b/json/apr_json.c index ebae3d92d51..c7a6efee252 100644 --- a/json/apr_json.c +++ b/json/apr_json.c @@ -32,12 +32,12 @@ apr_json_value_t *apr_json_value_create(apr_pool_t *pool) apr_json_value_t *apr_json_object_create(apr_pool_t *pool) { - apr_json_object_t *object; + apr_json_object_t *object; - apr_json_value_t *json = apr_json_value_create(pool); + apr_json_value_t *json = apr_json_value_create(pool); - json->type = APR_JSON_OBJECT; - json->value.object = object = apr_pcalloc(pool, sizeof(apr_json_object_t)); + json->type = APR_JSON_OBJECT; + json->value.object = object = apr_pcalloc(pool, sizeof(apr_json_object_t)); APR_RING_INIT(&object->list, apr_json_kv_t, link); object->hash = apr_hash_make(pool); @@ -45,80 +45,80 @@ apr_json_value_t *apr_json_object_create(apr_pool_t *pool) } apr_json_value_t *apr_json_string_create(apr_pool_t *pool, const char *val, - apr_ssize_t len) { - apr_json_value_t *json = apr_json_value_create(pool); - - if (json) { - if (val) { - json->type = APR_JSON_STRING; - json->value.string.p = val; - json->value.string.len = len; - } else { - json->type = APR_JSON_NULL; - } - } - - return json; + apr_ssize_t len) { + apr_json_value_t *json = apr_json_value_create(pool); + + if (json) { + if (val) { + json->type = APR_JSON_STRING; + json->value.string.p = val; + json->value.string.len = len; + } else { + json->type = APR_JSON_NULL; + } + } + + return json; } apr_json_value_t *apr_json_array_create(apr_pool_t *pool, int nelts) { - apr_json_value_t *json = apr_json_value_create(pool); + apr_json_value_t *json = apr_json_value_create(pool); - if (json) { - json->type = APR_JSON_ARRAY; - json->value.array = apr_array_make(pool, nelts, - sizeof(apr_json_value_t *)); - } + if (json) { + json->type = APR_JSON_ARRAY; + json->value.array = apr_array_make(pool, nelts, + sizeof(apr_json_value_t *)); + } - return json; + return json; } apr_json_value_t *apr_json_long_create(apr_pool_t *pool, apr_int64_t lnumber) { - apr_json_value_t *json = apr_json_value_create(pool); + apr_json_value_t *json = apr_json_value_create(pool); - if (json) { - json->type = APR_JSON_LONG; - json->value.lnumber = lnumber; - } + if (json) { + json->type = APR_JSON_LONG; + json->value.lnumber = lnumber; + } - return json; + return json; } apr_json_value_t *apr_json_double_create(apr_pool_t *pool, double dnumber) { - apr_json_value_t *json = apr_json_value_create(pool); + apr_json_value_t *json = apr_json_value_create(pool); - if (json) { - json->type = APR_JSON_DOUBLE; - json->value.lnumber = dnumber; - } + if (json) { + json->type = APR_JSON_DOUBLE; + json->value.lnumber = dnumber; + } - return json; + return json; } apr_json_value_t *apr_json_boolean_create(apr_pool_t *pool, int boolean) { - apr_json_value_t *json = apr_json_value_create(pool); + apr_json_value_t *json = apr_json_value_create(pool); - if (json) { - json->type = APR_JSON_BOOLEAN; - json->value.boolean = boolean; - } + if (json) { + json->type = APR_JSON_BOOLEAN; + json->value.boolean = boolean; + } - return json; + return json; } apr_json_value_t *apr_json_null_create(apr_pool_t *pool) { - apr_json_value_t *json = apr_json_value_create(pool); + apr_json_value_t *json = apr_json_value_create(pool); - if (json) { - json->type = APR_JSON_NULL; - } + if (json) { + json->type = APR_JSON_NULL; + } - return json; + return json; } apr_status_t apr_json_object_set(apr_json_value_t *object, apr_json_value_t *key, @@ -127,12 +127,12 @@ apr_status_t apr_json_object_set(apr_json_value_t *object, apr_json_value_t *key apr_json_kv_t *kv; apr_hash_t *hash; - if (object->type != APR_JSON_OBJECT || !key - || key->type != APR_JSON_STRING) { - return APR_EINVAL; - } + if (object->type != APR_JSON_OBJECT || !key + || key->type != APR_JSON_STRING) { + return APR_EINVAL; + } - hash = object->value.object->hash; + hash = object->value.object->hash; kv = apr_hash_get(hash, key->value.string.p, key->value.string.len); diff --git a/json/apr_json_decode.c b/json/apr_json_decode.c index 0e0fa4d3dd4..c5ce25f4b2d 100644 --- a/json/apr_json_decode.c +++ b/json/apr_json_decode.c @@ -439,8 +439,8 @@ static apr_status_t apr_json_decode_object(apr_json_scanner_t * self, { apr_status_t status = APR_SUCCESS; - apr_json_object_t *object = apr_pcalloc(self->pool, - sizeof(apr_json_object_t)); + apr_json_object_t *object = apr_pcalloc(self->pool, + sizeof(apr_json_object_t)); APR_RING_INIT(&object->list, apr_json_kv_t, link); object->hash = apr_hash_make(self->pool); diff --git a/test/testjson.c b/test/testjson.c index 8ce9b148ce2..16bb5dce34e 100644 --- a/test/testjson.c +++ b/test/testjson.c @@ -135,7 +135,7 @@ static void test_json_string(abts_case * tc, void *data) apr_off_t offset = 0; /* "턞\"\t/\b\f\n\r\t"; */ - const unsigned char expected[] = {237, 132, 158, 34, 9, 47, 8, 12, 10, 13, 9, 0}; + const unsigned char expected[] = {237, 132, 158, 34, 9, 47, 8, 12, 10, 13, 9, 0}; src = "\"\\uD834\\uDD1E\\\"\\t\\/\\b\\f\\n\\r\\t\""; @@ -145,8 +145,8 @@ static void test_json_string(abts_case * tc, void *data) ABTS_INT_EQUAL(tc, APR_SUCCESS, status); ABTS_INT_EQUAL(tc, APR_JSON_STRING, json->type); - ABTS_ASSERT(tc, "check for string unescape match", - (memcmp(expected, json->value.string.p, json->value.string.len) == 0)); + ABTS_ASSERT(tc, "check for string unescape match", + (memcmp(expected, json->value.string.p, json->value.string.len) == 0)); } abts_suite *testjson(abts_suite * suite) From 42f4da4f9cc3dd4633af8995a99b8f80fbbadd41 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Wed, 18 Jul 2018 20:20:14 +0000 Subject: [PATCH 7822/7878] Remove dead assignments. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836229 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdbd.c | 2 +- test/testmemcache.c | 6 +++--- test/testredis.c | 4 ++-- test/testuri.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/testdbd.c b/test/testdbd.c index b94c491b932..6f0698a9517 100644 --- a/test/testdbd.c +++ b/test/testdbd.c @@ -154,7 +154,7 @@ static void test_dbd_generic(abts_case *tc, apr_dbd_t* handle, native = apr_dbd_native_handle(driver, handle); ABTS_PTR_NOTNULL(tc, native); - rv = apr_dbd_check_conn(driver, pool, handle); + apr_dbd_check_conn(driver, pool, handle); create_table(tc, handle, driver); select_rows(tc, handle, driver, 0); diff --git a/test/testmemcache.c b/test/testmemcache.c index 4ac3694dbfc..3912cc56fe6 100644 --- a/test/testmemcache.c +++ b/test/testmemcache.c @@ -259,10 +259,10 @@ static void test_memcache_meta(abts_case * tc, void *data) rv = apr_memcache_add_server(memcache, server); ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); - rv = apr_memcache_version(server, pool, &result); + apr_memcache_version(server, pool, &result); ABTS_PTR_NOTNULL(tc, result); - rv = apr_memcache_stats(server, p, &stats); + apr_memcache_stats(server, p, &stats); ABTS_PTR_NOTNULL(tc, stats); ABTS_STR_NEQUAL(tc, stats->version, result, 5); @@ -451,7 +451,7 @@ static void test_memcache_multiget(abts_case * tc, void *data) ABTS_ASSERT(tc, "set failed", rv == APR_SUCCESS); } - rv = apr_pool_create(&tmppool, pool); + apr_pool_create(&tmppool, pool); for (i = 0; i < TDATA_SET; i++) apr_memcache_add_multget_key(pool, apr_pstrcat(pool, prefix, diff --git a/test/testredis.c b/test/testredis.c index 4b654322f54..830c09a9d5d 100644 --- a/test/testredis.c +++ b/test/testredis.c @@ -259,10 +259,10 @@ static void test_redis_meta(abts_case * tc, void *data) rv = apr_redis_add_server(redis, server); ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); - rv = apr_redis_version(server, pool, &result); + apr_redis_version(server, pool, &result); ABTS_PTR_NOTNULL(tc, result); - rv = apr_redis_stats(server, p, &stats); + apr_redis_stats(server, p, &stats); ABTS_PTR_NOTNULL(tc, stats); /* diff --git a/test/testuri.c b/test/testuri.c index d0b51e16cfb..4c5405aeffe 100644 --- a/test/testuri.c +++ b/test/testuri.c @@ -284,7 +284,7 @@ static void test_aup(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, t->uri, s); s = apr_uri_unparse(p, &info, APR_URI_UNP_OMITSITEPART); - rv = apr_uri_parse(p, s, &info); + apr_uri_parse(p, s, &info); ABTS_STR_EQUAL(tc, info.scheme, NULL); ABTS_STR_EQUAL(tc, info.hostinfo, NULL); ABTS_STR_EQUAL(tc, info.user, NULL); From 549635f6ea618baeae3022ac806941676c74a439 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Wed, 18 Jul 2018 20:34:06 +0000 Subject: [PATCH 7823/7878] Remove dereference of null pointer. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836231 13f79535-47bb-0310-9956-ffa450edef68 --- hooks/apr_hooks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hooks/apr_hooks.c b/hooks/apr_hooks.c index 22045620433..988af0ef106 100644 --- a/hooks/apr_hooks.c +++ b/hooks/apr_hooks.c @@ -180,7 +180,8 @@ static TSort *tsort(TSort *pData,int nItems) break; } } - pTail->pNext=NULL; /* unfudge the tail */ + if(pTail) + pTail->pNext=NULL; /* unfudge the tail */ return pHead; } From 117be8f400c471720d031e2c9da74ae8d9962066 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Wed, 18 Jul 2018 21:17:43 +0000 Subject: [PATCH 7824/7878] Make sure rv is not used uninitialised. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836235 13f79535-47bb-0310-9956-ffa450edef68 --- test/sockperf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sockperf.c b/test/sockperf.c index a18d8ba3f98..28368efbc1a 100644 --- a/test/sockperf.c +++ b/test/sockperf.c @@ -183,7 +183,7 @@ static apr_status_t runTest(struct testSet *ts, struct testResult *res, apr_pool_t *pool) { char *buffer; - apr_status_t rv; + apr_status_t rv = APR_SUCCESS; int i; apr_size_t sz = ts->size * TEST_SIZE; From 3c0526902c4468bcf39adc8a0340d9c19553c6f2 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 22 Jul 2018 13:03:42 +0000 Subject: [PATCH 7825/7878] Make sure we compile in the absence of APU_HAVE_CRYPTO_PRNG. Make sure we don't segfault if the PRNG does not initialise. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836438 13f79535-47bb-0310-9956-ffa450edef68 --- crypto/apr_crypto.c | 6 +++++- test/testcrypto.c | 18 +++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index e7c11b73435..bda84b2a267 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -84,9 +84,11 @@ static apr_status_t apr_crypto_term(void *ptr) APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) { - apr_status_t rv; apr_pool_t *rootp; +#if APU_HAVE_CRYPTO_PRNG + apr_status_t rv; int flags = 0; +#endif if (drivers != NULL) { return APR_SUCCESS; @@ -109,6 +111,7 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) apr_pool_cleanup_register(rootp, NULL, apr_crypto_term, apr_pool_cleanup_null); +#if APU_HAVE_CRYPTO_PRNG /* apr_crypto_prng_init() may already have been called with * non-default parameters, so ignore APR_EREINIT. */ @@ -119,6 +122,7 @@ APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) if (rv != APR_SUCCESS && rv != APR_EREINIT) { return rv; } +#endif return APR_SUCCESS; } diff --git a/test/testcrypto.c b/test/testcrypto.c index 9d95e10c2b9..bfcb7366571 100644 --- a/test/testcrypto.c +++ b/test/testcrypto.c @@ -1455,6 +1455,7 @@ static void test_crypto_equals(abts_case *tc, void *data) TEST_SCALAR_MATCH(6, p, 0); } +#if APU_HAVE_CRYPTO_PRNG #if APU_HAVE_OPENSSL #include /* for NID_* */ #endif @@ -1523,7 +1524,7 @@ static const unsigned char test_PRNG_kat0[128] = { static void test_crypto_prng(abts_case *tc, void *data) { unsigned char randbytes[128], seed[APR_CRYPTO_PRNG_SEED_SIZE]; - apr_crypto_prng_t *cprng; + apr_crypto_prng_t *cprng = NULL; apr_pool_t *pool = NULL; apr_status_t rv; int i; @@ -1552,8 +1553,10 @@ static void test_crypto_prng(abts_case *tc, void *data) rv == APR_SUCCESS); } - rv = apr_crypto_prng_bytes(cprng, randbytes, 128 - 32); - ABTS_ASSERT(tc, "apr_crypto_prng_bytes failed", rv == APR_SUCCESS); + if (cprng) { + rv = apr_crypto_prng_bytes(cprng, randbytes, 128 - 32); + ABTS_ASSERT(tc, "apr_crypto_prng_bytes failed", rv == APR_SUCCESS); + } /* Should match the first time only */ if (i != 0) { @@ -1567,8 +1570,10 @@ static void test_crypto_prng(abts_case *tc, void *data) memcmp(randbytes, test_PRNG_kat0 + 32, 128 - 32) == 0); } - rv = apr_crypto_prng_destroy(cprng); - ABTS_ASSERT(tc, "apr_crypto_prng_destroy failed", rv == APR_SUCCESS); + if (cprng) { + rv = apr_crypto_prng_destroy(cprng); + ABTS_ASSERT(tc, "apr_crypto_prng_destroy failed", rv == APR_SUCCESS); + } } apr_pool_destroy(pool); @@ -1688,6 +1693,7 @@ static void test_crypto_thread_random(abts_case *tc, void *data) apr_pool_destroy(pool); } #endif +#endif abts_suite *testcrypto(abts_suite *suite) { @@ -1768,12 +1774,14 @@ abts_suite *testcrypto(abts_suite *suite) abts_run_test(suite, test_crypto_memzero, NULL); abts_run_test(suite, test_crypto_equals, NULL); +#if APU_HAVE_CRYPTO_PRNG abts_run_test(suite, test_crypto_prng, NULL); #if APR_HAS_FORK abts_run_test(suite, test_crypto_fork_random, NULL); #endif #if APR_HAS_THREADS abts_run_test(suite, test_crypto_thread_random, NULL); +#endif #endif return suite; From c0e5d956315bad00901e98e3334ebed62159c4e5 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 22 Jul 2018 13:11:32 +0000 Subject: [PATCH 7826/7878] apr_crypto: Add support for digest functions, with hashing, signing and verifying. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836439 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + crypto/apr_crypto.c | 74 ++ crypto/apr_crypto_commoncrypto.c | 969 +++++++++++++++++++----- crypto/apr_crypto_nss.c | 1005 ++++++++++++++++++++----- crypto/apr_crypto_openssl.c | 904 ++++++++++++++++++---- include/apr_crypto.h | 556 +++++++++++++- include/apu_errno.h | 7 + include/private/apr_crypto_internal.h | 77 ++ test/testcrypto.c | 948 ++++++++++++++++++++++- 9 files changed, 3981 insertions(+), 562 deletions(-) diff --git a/CHANGES b/CHANGES index d510cb342a9..b201082c7bc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_crypto: Add support for digest functions, with hashing, signing + and verifying. [Graham Leggett] + *) apr_json: Add support for encoding and decoding RFC8259 JSON. [Moriyoshi Koizumi ] diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index bda84b2a267..24e36f30adb 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -54,6 +54,12 @@ APR_TYPEDEF_STRUCT(apr_crypto_block_t, const apr_crypto_t *f; ) +APR_TYPEDEF_STRUCT(apr_crypto_digest_t, + apr_pool_t *pool; + apr_crypto_driver_t *provider; + const apr_crypto_t *f; +) + typedef struct apr_crypto_clear_t { void *buffer; apr_size_t size; @@ -199,6 +205,24 @@ APR_DECLARE(int) apr_crypto_equals(const void *buf1, const void *buf2, return 1 & ((diff - 1) >> 8); } +APR_DECLARE(apr_crypto_key_rec_t *) apr_crypto_key_rec_make( + apr_crypto_key_type ktype, apr_pool_t *p) +{ + apr_crypto_key_rec_t *key = apr_pcalloc(p, sizeof(apr_crypto_key_rec_t)); + key->ktype = ktype; + return key; +} + +APR_DECLARE(apr_crypto_digest_rec_t *) apr_crypto_digest_rec_make( + apr_crypto_digest_type_e dtype, apr_pool_t *p) +{ + apr_crypto_digest_rec_t *rec = apr_pcalloc(p, sizeof(apr_crypto_digest_rec_t)); + if (rec) { + rec->dtype = dtype; + } + return rec; +} + APR_DECLARE(apr_status_t) apr_crypto_get_driver( const apr_crypto_driver_t **driver, const char *name, const char *params, const apu_err_t **result, apr_pool_t *pool) @@ -644,6 +668,21 @@ APR_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, return driver->make(f, driver, params, pool); } +/** + * @brief Get a hash table of digests, keyed by the name of the digest against + * a pointer to apr_crypto_digest_t, which in turn begins with an + * integer. + * + * @param digests - hashtable of digests keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +APR_DECLARE(apr_status_t) apr_crypto_get_block_key_digests(apr_hash_t **digests, + const apr_crypto_t *f) +{ + return f->provider->get_block_key_digests(digests, f); +} + /** * @brief Get a hash table of key types, keyed by the name of the type against * a pointer to apr_crypto_block_key_type_t, which in turn begins with an @@ -876,6 +915,30 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish(unsigned char *out, return ctx->provider->block_decrypt_finish(out, outlen, ctx); } +APR_DECLARE(apr_status_t) apr_crypto_digest_init(apr_crypto_digest_t **d, + const apr_crypto_key_t *key, apr_crypto_digest_rec_t *rec, apr_pool_t *p) +{ + return key->provider->digest_init(d, key, rec, p); +} + +APR_DECLARE(apr_status_t) apr_crypto_digest_update(apr_crypto_digest_t *digest, + const unsigned char *in, apr_size_t inlen) +{ + return digest->provider->digest_update(digest, in, inlen); +} + +APR_DECLARE(apr_status_t) apr_crypto_digest_final(apr_crypto_digest_t *digest) +{ + return digest->provider->digest_final(digest); +} + +APR_DECLARE(apr_status_t) apr_crypto_digest(const apr_crypto_key_t *key, + apr_crypto_digest_rec_t *rec, const unsigned char *in, apr_size_t inlen, + apr_pool_t *p) +{ + return key->provider->digest(key, rec, in, inlen, p); +} + /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. @@ -887,6 +950,17 @@ APR_DECLARE(apr_status_t) apr_crypto_block_cleanup(apr_crypto_block_t *ctx) return ctx->provider->block_cleanup(ctx); } +/** + * @brief Clean sign / verify context. + * @note After cleanup, a context is free to be reused if necessary. + * @param ctx The digest context to use. + * @return Returns APR_ENOTIMPL if not supported. + */ +APR_DECLARE(apr_status_t) apr_crypto_digest_cleanup(apr_crypto_digest_t *ctx) +{ + return ctx->provider->digest_cleanup(ctx); +} + /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. diff --git a/crypto/apr_crypto_commoncrypto.c b/crypto/apr_crypto_commoncrypto.c index 83886bce3af..f2095bcd7ad 100644 --- a/crypto/apr_crypto_commoncrypto.c +++ b/crypto/apr_crypto_commoncrypto.c @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "apr.h" #include "apr_lib.h" #include "apu.h" #include "apr_private.h" @@ -33,6 +34,7 @@ #if APU_HAVE_CRYPTO #include +#include #define LOG_PREFIX "apr_crypto_commoncrypto: " @@ -41,6 +43,7 @@ struct apr_crypto_t apr_pool_t *pool; const apr_crypto_driver_t *provider; apu_err_t *result; + apr_hash_t *digests; apr_hash_t *types; apr_hash_t *modes; apr_random_t *rng; @@ -51,12 +54,16 @@ struct apr_crypto_key_t apr_pool_t *pool; const apr_crypto_driver_t *provider; const apr_crypto_t *f; + const apr_crypto_key_rec_t *rec; + unsigned char *key; + void *hash; CCAlgorithm algorithm; CCOptions options; - unsigned char *key; int keyLen; int ivSize; + CCHmacAlgorithm hmac; apr_size_t blockSize; + apr_size_t digestSize; }; struct apr_crypto_block_t @@ -68,6 +75,27 @@ struct apr_crypto_block_t CCCryptorRef ref; }; +struct apr_crypto_digest_t +{ + apr_pool_t *pool; + const apr_crypto_driver_t *provider; + const apr_crypto_t *f; + const apr_crypto_key_t *key; + apr_crypto_digest_rec_t *rec; + CCHmacContext *hmac; + void *hash; + unsigned char *md; +}; + +static struct apr_crypto_block_key_digest_t key_digests[] = +{ +{ APR_CRYPTO_DIGEST_MD5, 16, 64 }, +{ APR_CRYPTO_DIGEST_SHA1, 20, 64 }, +{ APR_CRYPTO_DIGEST_SHA224, 28, 64 }, +{ APR_CRYPTO_DIGEST_SHA256, 32, 64 }, +{ APR_CRYPTO_DIGEST_SHA384, 48, 128 }, +{ APR_CRYPTO_DIGEST_SHA512, 64, 128 } }; + static struct apr_crypto_block_key_type_t key_types[] = { { APR_KEY_3DES_192, 24, 8, 8 }, @@ -95,16 +123,25 @@ static apr_status_t crypto_error(const apu_err_t **result, */ static apr_status_t crypto_shutdown(void) { - return apr_crypto_lib_term("commoncrypto"); + return APR_SUCCESS; +} + +static apr_status_t crypto_shutdown_helper(void *data) +{ + return crypto_shutdown(); } /** * Initialise the crypto library and perform one time initialisation. */ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, - const apu_err_t **result) + const apu_err_t **result) { - return apr_crypto_lib_init("commoncrypto", params, result, pool); + + apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, + apr_pool_cleanup_null); + + return APR_SUCCESS; } /** @@ -131,6 +168,25 @@ static apr_status_t crypto_block_cleanup_helper(void *data) return crypto_block_cleanup(block); } +/** + * @brief Clean sign / verify context. + * @note After cleanup, a context is free to be reused if necessary. + * @param ctx The digest context to use. + * @return Returns APR_ENOTIMPL if not supported. + */ +static apr_status_t crypto_digest_cleanup(apr_crypto_digest_t *ctx) +{ + + return APR_SUCCESS; + +} + +static apr_status_t crypto_digest_cleanup_helper(void *data) +{ + apr_crypto_digest_t *digest = (apr_crypto_digest_t *) data; + return crypto_digest_cleanup(digest); +} + /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. @@ -168,6 +224,7 @@ static apr_status_t crypto_make(apr_crypto_t **ff, { apr_crypto_t *f = apr_pcalloc(pool, sizeof(apr_crypto_t)); apr_status_t rv; + int i; if (!f) { return APR_ENOMEM; @@ -196,21 +253,34 @@ static apr_status_t crypto_make(apr_crypto_t **ff, return APR_ENOMEM; } + f->digests = apr_hash_make(pool); + if (!f->digests) { + return APR_ENOMEM; + } + apr_hash_set(f->digests, "md2", APR_HASH_KEY_STRING, &(key_digests[i = 0])); + apr_hash_set(f->digests, "md4", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "md5", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "sha1", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "sha224", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "sha256", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "sha384", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "sha512", APR_HASH_KEY_STRING, &(key_digests[++i])); + f->types = apr_hash_make(pool); if (!f->types) { return APR_ENOMEM; } - apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_types[0])); - apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_types[1])); - apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_types[2])); - apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_types[3])); + apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_types[i = 0])); + apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_types[++i])); + apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_types[++i])); + apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_types[++i])); f->modes = apr_hash_make(pool); if (!f->modes) { return APR_ENOMEM; } - apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(key_modes[0])); - apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(key_modes[1])); + apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(key_modes[i = 0])); + apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(key_modes[++i])); apr_pool_cleanup_register(pool, f, crypto_cleanup_helper, apr_pool_cleanup_null); @@ -219,6 +289,21 @@ static apr_status_t crypto_make(apr_crypto_t **ff, } +/** + * @brief Get a hash table of key digests, keyed by the name of the digest against + * a pointer to apr_crypto_block_key_digest_t. + * + * @param digests - hashtable of key digests keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +static apr_status_t crypto_get_block_key_digests(apr_hash_t **digests, + const apr_crypto_t *f) +{ + *digests = f->digests; + return APR_SUCCESS; +} + /** * @brief Get a hash table of key types, keyed by the name of the type against * a pointer to apr_crypto_block_key_type_t. @@ -350,6 +435,36 @@ static apr_status_t crypto_cipher_mechanism(apr_crypto_key_t *key, return APR_SUCCESS; } +static apr_status_t crypto_digest_mechanism(apr_crypto_key_t *key, + const apr_crypto_block_key_digest_e digest, apr_pool_t *p) +{ + /* determine the digest algorithm to be used */ + switch (digest) { + case APR_CRYPTO_DIGEST_MD5: + key->digestSize = CC_MD5_DIGEST_LENGTH; + break; + case APR_CRYPTO_DIGEST_SHA1: + key->digestSize = CC_SHA1_DIGEST_LENGTH; + break; + case APR_CRYPTO_DIGEST_SHA224: + key->digestSize = CC_SHA224_DIGEST_LENGTH; + break; + case APR_CRYPTO_DIGEST_SHA256: + key->digestSize = CC_SHA256_DIGEST_LENGTH; + break; + case APR_CRYPTO_DIGEST_SHA384: + key->digestSize = CC_SHA384_DIGEST_LENGTH; + break; + case APR_CRYPTO_DIGEST_SHA512: + key->digestSize = CC_SHA512_DIGEST_LENGTH; + break; + default: + return APR_ENODIGEST; + } + + return APR_SUCCESS; +} + /** * @brief Create a key from the provided secret or passphrase. The key is cleaned * up when the context is cleaned, and may be reused with multiple encryption @@ -379,19 +494,21 @@ static apr_status_t crypto_key(apr_crypto_key_t **k, return APR_ENOMEM; } + key->pool = p; key->f = f; key->provider = f->provider; - - /* decide on what cipher mechanism we will be using */ - rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad, p); - if (APR_SUCCESS != rv) { - return rv; - } + key->rec = rec; switch (rec->ktype) { case APR_CRYPTO_KTYPE_PASSPHRASE: { + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad, p); + if (APR_SUCCESS != rv) { + return rv; + } + /* generate the key */ if ((f->result->rc = CCKeyDerivationPBKDF(kCCPBKDF2, rec->k.passphrase.pass, rec->k.passphrase.passLen, @@ -406,6 +523,12 @@ static apr_status_t crypto_key(apr_crypto_key_t **k, case APR_CRYPTO_KTYPE_SECRET: { + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad, p); + if (APR_SUCCESS != rv) { + return rv; + } + /* sanity check - key correct size? */ if (rec->k.secret.secretLen != key->keyLen) { return APR_EKEYLENGTH; @@ -417,6 +540,87 @@ static apr_status_t crypto_key(apr_crypto_key_t **k, break; } + case APR_CRYPTO_KTYPE_HASH: { + + /* decide on what digest mechanism we will be using */ + rv = crypto_digest_mechanism(key, rec->k.hash.digest, p); + if (APR_SUCCESS != rv) { + return rv; + } + + switch (rec->k.hash.digest) { + case APR_CRYPTO_DIGEST_MD5: + key->digestSize = CC_MD5_DIGEST_LENGTH; + break; + case APR_CRYPTO_DIGEST_SHA1: + key->digestSize = CC_SHA1_DIGEST_LENGTH; + break; + case APR_CRYPTO_DIGEST_SHA224: + key->digestSize = CC_SHA224_DIGEST_LENGTH; + break; + case APR_CRYPTO_DIGEST_SHA256: + key->digestSize = CC_SHA256_DIGEST_LENGTH; + break; + case APR_CRYPTO_DIGEST_SHA384: + key->digestSize = CC_SHA384_DIGEST_LENGTH; + break; + case APR_CRYPTO_DIGEST_SHA512: + key->digestSize = CC_SHA512_DIGEST_LENGTH; + break; + default: + return APR_ENODIGEST; + } + + break; + } + case APR_CRYPTO_KTYPE_HMAC: { + + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad, p); + if (APR_SUCCESS != rv) { + return rv; + } + + /* decide on what digest mechanism we will be using */ + rv = crypto_digest_mechanism(key, rec->k.hmac.digest, p); + if (APR_SUCCESS != rv) { + return rv; + } + + key->hmac = rec->k.hmac.digest; + + switch (rec->k.hmac.digest) { + case APR_CRYPTO_DIGEST_MD5: + key->hmac = kCCHmacAlgMD5; + break; + case APR_CRYPTO_DIGEST_SHA1: + key->hmac = kCCHmacAlgSHA1; + break; + case APR_CRYPTO_DIGEST_SHA224: + key->hmac = kCCHmacAlgSHA224; + break; + case APR_CRYPTO_DIGEST_SHA256: + key->hmac = kCCHmacAlgSHA256; + break; + case APR_CRYPTO_DIGEST_SHA384: + key->hmac = kCCHmacAlgSHA384; + break; + case APR_CRYPTO_DIGEST_SHA512: + key->hmac = kCCHmacAlgSHA512; + break; + default: + return APR_ENODIGEST; + } + + break; + } + + case APR_CRYPTO_KTYPE_CMAC: { + + return APR_ENOTIMPL; + + } + default: { return APR_ENOKEY; @@ -463,6 +667,7 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, { apr_status_t rv; apr_crypto_key_t *key = *k; + apr_crypto_key_rec_t *rec; if (!key) { *k = key = apr_pcalloc(p, sizeof *key); @@ -473,6 +678,11 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, key->f = f; key->provider = f->provider; + key->rec = rec = apr_pcalloc(p, sizeof(apr_crypto_key_rec_t)); + if (!key->rec) { + return APR_ENOMEM; + } + rec->ktype = APR_CRYPTO_KTYPE_PASSPHRASE; /* decide on what cipher mechanism we will be using */ rv = crypto_cipher_mechanism(key, type, mode, doPad, p); @@ -530,59 +740,72 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, apr_pool_cleanup_null); - /* generate an IV, if necessary */ - usedIv = NULL; - if (key->ivSize) { - if (iv == NULL) { - return APR_ENOIV; - } - if (*iv == NULL) { - apr_status_t status; - usedIv = apr_pcalloc(p, key->ivSize); - if (!usedIv) { - return APR_ENOMEM; + switch (key->rec->ktype) { + + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { + + /* generate an IV, if necessary */ + usedIv = NULL; + if (key->ivSize) { + if (iv == NULL) { + return APR_ENOIV; } - apr_crypto_clear(p, usedIv, key->ivSize); - status = apr_random_secure_bytes(block->f->rng, usedIv, - key->ivSize); - if (APR_SUCCESS != status) { - return status; + if (*iv == NULL) { + apr_status_t status; + usedIv = apr_pcalloc(p, key->ivSize); + if (!usedIv) { + return APR_ENOMEM; + } + apr_crypto_clear(p, usedIv, key->ivSize); + status = apr_random_secure_bytes(block->f->rng, usedIv, + key->ivSize); + if (APR_SUCCESS != status) { + return status; + } + *iv = usedIv; + } else { + usedIv = (unsigned char *) *iv; } - *iv = usedIv; } - else { - usedIv = (unsigned char *) *iv; + + /* create a new context for encryption */ + switch ((block->f->result->rc = CCCryptorCreate(kCCEncrypt, + key->algorithm, key->options, key->key, key->keyLen, usedIv, + &block->ref))) { + case kCCSuccess: { + break; + } + case kCCParamError: { + return APR_EINIT; + } + case kCCMemoryFailure: { + return APR_ENOMEM; + } + case kCCAlignmentError: { + return APR_EPADDING; + } + case kCCUnimplemented: { + return APR_ENOTIMPL; + } + default: { + return APR_EINIT; + } } - } - /* create a new context for encryption */ - switch ((block->f->result->rc = CCCryptorCreate(kCCEncrypt, key->algorithm, - key->options, key->key, key->keyLen, usedIv, &block->ref))) { - case kCCSuccess: { - break; - } - case kCCParamError: { - return APR_EINIT; - } - case kCCMemoryFailure: { - return APR_ENOMEM; - } - case kCCAlignmentError: { - return APR_EPADDING; - } - case kCCUnimplemented: { - return APR_ENOTIMPL; + if (blockSize) { + *blockSize = key->blockSize; + } + + return APR_SUCCESS; + } default: { - return APR_EINIT; - } - } - if (blockSize) { - *blockSize = key->blockSize; - } + return APR_EINVAL; - return APR_SUCCESS; + } + } } @@ -606,43 +829,56 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, */ static apr_status_t crypto_block_encrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, - apr_crypto_block_t *ctx) + apr_crypto_block_t *block) { - apr_size_t outl = *outlen; - unsigned char *buffer; + switch (block->key->rec->ktype) { - /* are we after the maximum size of the out buffer? */ - if (!out) { - *outlen = CCCryptorGetOutputLength(ctx->ref, inlen, 1); - return APR_SUCCESS; - } + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { - /* must we allocate the output buffer from a pool? */ - if (!*out) { - outl = CCCryptorGetOutputLength(ctx->ref, inlen, 1); - buffer = apr_palloc(ctx->pool, outl); - if (!buffer) { - return APR_ENOMEM; + apr_size_t outl = *outlen; + unsigned char *buffer; + + /* are we after the maximum size of the out buffer? */ + if (!out) { + *outlen = CCCryptorGetOutputLength(block->ref, inlen, 1); + return APR_SUCCESS; } - apr_crypto_clear(ctx->pool, buffer, outl); - *out = buffer; - } - switch ((ctx->f->result->rc = CCCryptorUpdate(ctx->ref, in, inlen, (*out), - outl, &outl))) { - case kCCSuccess: { - break; - } - case kCCBufferTooSmall: { - return APR_ENOSPACE; + /* must we allocate the output buffer from a pool? */ + if (!*out) { + outl = CCCryptorGetOutputLength(block->ref, inlen, 1); + buffer = apr_palloc(block->pool, outl); + if (!buffer) { + return APR_ENOMEM; + } + apr_crypto_clear(block->pool, buffer, outl); + *out = buffer; + } + + switch ((block->f->result->rc = CCCryptorUpdate(block->ref, in, inlen, (*out), + outl, &outl))) { + case kCCSuccess: { + break; + } + case kCCBufferTooSmall: { + return APR_ENOSPACE; + } + default: { + return APR_ECRYPT; + } + } + *outlen = outl; + + return APR_SUCCESS; + } default: { - return APR_ECRYPT; + + return APR_EINVAL; + } } - *outlen = outl; - - return APR_SUCCESS; } @@ -665,36 +901,49 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, * @return APR_ENOTIMPL if not implemented. */ static apr_status_t crypto_block_encrypt_finish(unsigned char *out, - apr_size_t *outlen, apr_crypto_block_t *ctx) + apr_size_t *outlen, apr_crypto_block_t *block) { - apr_size_t len = *outlen; + switch (block->key->rec->ktype) { - ctx->f->result->rc = CCCryptorFinal(ctx->ref, out, - CCCryptorGetOutputLength(ctx->ref, 0, 1), &len); + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { - /* always clean up */ - crypto_block_cleanup(ctx); + apr_size_t len = *outlen; + + block->f->result->rc = CCCryptorFinal(block->ref, out, + CCCryptorGetOutputLength(block->ref, 0, 1), &len); + + /* always clean up */ + crypto_block_cleanup(block); + + switch (block->f->result->rc) { + case kCCSuccess: { + break; + } + case kCCBufferTooSmall: { + return APR_ENOSPACE; + } + case kCCAlignmentError: { + return APR_EPADDING; + } + case kCCDecodeError: { + return APR_ECRYPT; + } + default: { + return APR_ECRYPT; + } + } + *outlen = len; + + return APR_SUCCESS; - switch (ctx->f->result->rc) { - case kCCSuccess: { - break; - } - case kCCBufferTooSmall: { - return APR_ENOSPACE; - } - case kCCAlignmentError: { - return APR_EPADDING; - } - case kCCDecodeError: { - return APR_ECRYPT; } default: { - return APR_ECRYPT; + + return APR_EINVAL; + } } - *outlen = len; - - return APR_SUCCESS; } @@ -717,55 +966,69 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, apr_size_t *blockSize, const unsigned char *iv, const apr_crypto_key_t *key, apr_pool_t *p) { - apr_crypto_block_t *block = *ctx; - if (!block) { - *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t)); - } - if (!block) { - return APR_ENOMEM; - } - block->f = key->f; - block->pool = p; - block->provider = key->provider; + switch (key->rec->ktype) { - apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, - apr_pool_cleanup_null); + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { - /* generate an IV, if necessary */ - if (key->ivSize) { - if (iv == NULL) { - return APR_ENOIV; + apr_crypto_block_t *block = *ctx; + if (!block) { + *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t)); + } + if (!block) { + return APR_ENOMEM; + } + block->f = key->f; + block->pool = p; + block->provider = key->provider; + block->key = key; + + apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, + apr_pool_cleanup_null); + + /* generate an IV, if necessary */ + if (key->ivSize) { + if (iv == NULL) { + return APR_ENOIV; + } } - } - /* create a new context for decryption */ - switch ((block->f->result->rc = CCCryptorCreate(kCCDecrypt, key->algorithm, - key->options, key->key, key->keyLen, iv, &block->ref))) { - case kCCSuccess: { - break; - } - case kCCParamError: { - return APR_EINIT; - } - case kCCMemoryFailure: { - return APR_ENOMEM; - } - case kCCAlignmentError: { - return APR_EPADDING; - } - case kCCUnimplemented: { - return APR_ENOTIMPL; + /* create a new context for decryption */ + switch ((block->f->result->rc = CCCryptorCreate(kCCDecrypt, key->algorithm, + key->options, key->key, key->keyLen, iv, &block->ref))) { + case kCCSuccess: { + break; + } + case kCCParamError: { + return APR_EINIT; + } + case kCCMemoryFailure: { + return APR_ENOMEM; + } + case kCCAlignmentError: { + return APR_EPADDING; + } + case kCCUnimplemented: { + return APR_ENOTIMPL; + } + default: { + return APR_EINIT; + } + } + + if (blockSize) { + *blockSize = key->blockSize; + } + + return APR_SUCCESS; + } default: { - return APR_EINIT; - } - } - if (blockSize) { - *blockSize = key->blockSize; - } + return APR_EINVAL; - return APR_SUCCESS; + } + } } @@ -789,43 +1052,56 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, */ static apr_status_t crypto_block_decrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, - apr_crypto_block_t *ctx) + apr_crypto_block_t *block) { - apr_size_t outl = *outlen; - unsigned char *buffer; + switch (block->key->rec->ktype) { - /* are we after the maximum size of the out buffer? */ - if (!out) { - *outlen = CCCryptorGetOutputLength(ctx->ref, inlen, 1); - return APR_SUCCESS; - } + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { - /* must we allocate the output buffer from a pool? */ - if (!*out) { - outl = CCCryptorGetOutputLength(ctx->ref, inlen, 1); - buffer = apr_palloc(ctx->pool, outl); - if (!buffer) { - return APR_ENOMEM; + apr_size_t outl = *outlen; + unsigned char *buffer; + + /* are we after the maximum size of the out buffer? */ + if (!out) { + *outlen = CCCryptorGetOutputLength(block->ref, inlen, 1); + return APR_SUCCESS; } - apr_crypto_clear(ctx->pool, buffer, outl); - *out = buffer; - } - switch ((ctx->f->result->rc = CCCryptorUpdate(ctx->ref, in, inlen, (*out), - outl, &outl))) { - case kCCSuccess: { - break; - } - case kCCBufferTooSmall: { - return APR_ENOSPACE; + /* must we allocate the output buffer from a pool? */ + if (!*out) { + outl = CCCryptorGetOutputLength(block->ref, inlen, 1); + buffer = apr_palloc(block->pool, outl); + if (!buffer) { + return APR_ENOMEM; + } + apr_crypto_clear(block->pool, buffer, outl); + *out = buffer; + } + + switch ((block->f->result->rc = CCCryptorUpdate(block->ref, in, inlen, (*out), + outl, &outl))) { + case kCCSuccess: { + break; + } + case kCCBufferTooSmall: { + return APR_ENOSPACE; + } + default: { + return APR_ECRYPT; + } + } + *outlen = outl; + + return APR_SUCCESS; + } default: { - return APR_ECRYPT; + + return APR_EINVAL; + } } - *outlen = outl; - - return APR_SUCCESS; } @@ -848,37 +1124,333 @@ static apr_status_t crypto_block_decrypt(unsigned char **out, * @return APR_ENOTIMPL if not implemented. */ static apr_status_t crypto_block_decrypt_finish(unsigned char *out, - apr_size_t *outlen, apr_crypto_block_t *ctx) + apr_size_t *outlen, apr_crypto_block_t *block) { - apr_size_t len = *outlen; + switch (block->key->rec->ktype) { + + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { + + apr_size_t len = *outlen; - ctx->f->result->rc = CCCryptorFinal(ctx->ref, out, - CCCryptorGetOutputLength(ctx->ref, 0, 1), &len); + block->f->result->rc = CCCryptorFinal(block->ref, out, + CCCryptorGetOutputLength(block->ref, 0, 1), &len); - /* always clean up */ - crypto_block_cleanup(ctx); + /* always clean up */ + crypto_block_cleanup(block); + + switch (block->f->result->rc) { + case kCCSuccess: { + break; + } + case kCCBufferTooSmall: { + return APR_ENOSPACE; + } + case kCCAlignmentError: { + return APR_EPADDING; + } + case kCCDecodeError: { + return APR_ECRYPT; + } + default: { + return APR_ECRYPT; + } + } + *outlen = len; + + return APR_SUCCESS; + + } + default: { + + return APR_EINVAL; + + } + } + +} + +static apr_status_t crypto_digest_init(apr_crypto_digest_t **ctx, + const apr_crypto_key_t *key, apr_crypto_digest_rec_t *rec, apr_pool_t *p) +{ + + apr_crypto_digest_t *digest = *ctx; + + if (!digest) { + *ctx = digest = apr_pcalloc(p, sizeof(apr_crypto_digest_t)); + } + if (!digest) { + return APR_ENOMEM; + } + digest->f = key->f; + digest->pool = p; + digest->provider = key->provider; + digest->key = key; + digest->rec = rec; + + apr_pool_cleanup_register(p, digest, crypto_digest_cleanup_helper, + apr_pool_cleanup_null); + + switch (digest->key->rec->ktype) { + + case APR_CRYPTO_KTYPE_HASH: { + + switch (key->rec->k.hash.digest) { + case APR_CRYPTO_DIGEST_MD5: + digest->hash = apr_pcalloc(p, sizeof(CC_MD5_CTX)); + CC_MD5_Init(digest->hash); + break; + case APR_CRYPTO_DIGEST_SHA1: + digest->hash = apr_pcalloc(p, sizeof(CC_SHA1_CTX)); + CC_SHA1_Init(digest->hash); + break; + case APR_CRYPTO_DIGEST_SHA224: + digest->hash = apr_pcalloc(p, sizeof(CC_SHA256_CTX)); + CC_SHA224_Init(digest->hash); + break; + case APR_CRYPTO_DIGEST_SHA256: + digest->hash = apr_pcalloc(p, sizeof(CC_SHA256_CTX)); + CC_SHA256_Init(digest->hash); + break; + case APR_CRYPTO_DIGEST_SHA384: + digest->hash = apr_pcalloc(p, sizeof(CC_SHA512_CTX)); + CC_SHA384_Init(digest->hash); + break; + case APR_CRYPTO_DIGEST_SHA512: + digest->hash = apr_pcalloc(p, sizeof(CC_SHA512_CTX)); + CC_SHA512_Init(digest->hash); + break; + default: + return APR_ENODIGEST; + } - switch (ctx->f->result->rc) { - case kCCSuccess: { break; } - case kCCBufferTooSmall: { - return APR_ENOSPACE; + case APR_CRYPTO_KTYPE_HMAC: { + + digest->hmac = apr_pcalloc(p, sizeof(CCHmacContext)); + if (!digest->hmac) { + return APR_ENOMEM; + } + + CCHmacInit(digest->hmac, key->hmac, key->rec->k.hmac.secret, + key->rec->k.hmac.secretLen); + + break; } - case kCCAlignmentError: { - return APR_EPADDING; + + case APR_CRYPTO_KTYPE_CMAC: { + + return APR_ENOTIMPL; + } - case kCCDecodeError: { - return APR_ECRYPT; + + default: { + + return APR_EINVAL; + } + } + + return APR_SUCCESS; +} + +static apr_status_t crypto_digest_update(apr_crypto_digest_t *digest, + const unsigned char *in, apr_size_t inlen) +{ + + switch (digest->key->rec->ktype) { + + case APR_CRYPTO_KTYPE_HASH: { + + switch (digest->key->rec->k.hash.digest) { + case APR_CRYPTO_DIGEST_MD5: + CC_MD5_Update(digest->hash, in, inlen); + break; + case APR_CRYPTO_DIGEST_SHA1: + CC_SHA1_Update(digest->hash, in, inlen); + break; + case APR_CRYPTO_DIGEST_SHA224: + CC_SHA224_Update(digest->hash, in, inlen); + break; + case APR_CRYPTO_DIGEST_SHA256: + CC_SHA256_Update(digest->hash, in, inlen); + break; + case APR_CRYPTO_DIGEST_SHA384: + CC_SHA384_Update(digest->hash, in, inlen); + break; + case APR_CRYPTO_DIGEST_SHA512: + CC_SHA512_Update(digest->hash, in, inlen); + break; + default: + return APR_ENODIGEST; + } + + break; + } + case APR_CRYPTO_KTYPE_HMAC: { + + CCHmacUpdate(digest->hmac, in, inlen); + + break; + } + + case APR_CRYPTO_KTYPE_CMAC: { + + return APR_ENOTIMPL; + + } + default: { - return APR_ECRYPT; + + return APR_EINVAL; + } } - *outlen = len; return APR_SUCCESS; +} + +static apr_status_t crypto_digest_final(apr_crypto_digest_t *digest) +{ + + switch (digest->key->rec->ktype) { + + case APR_CRYPTO_KTYPE_HASH: { + + size_t len = digest->key->digestSize; + + /* must we allocate the output buffer from a pool? */ + if (!digest->rec->d.hash.s || digest->rec->d.hash.slen != len) { + digest->rec->d.hash.slen = len; + digest->rec->d.hash.s = apr_palloc(digest->pool, len); + if (!digest->rec->d.hash.s) { + return APR_ENOMEM; + } + apr_crypto_clear(digest->pool, digest->rec->d.hash.s, len); + } + + switch (digest->key->rec->k.hash.digest) { + case APR_CRYPTO_DIGEST_MD5: + CC_MD5_Final(digest->rec->d.hash.s, digest->hash); + break; + case APR_CRYPTO_DIGEST_SHA1: + CC_SHA1_Final(digest->rec->d.hash.s, digest->hash); + break; + case APR_CRYPTO_DIGEST_SHA224: + CC_SHA224_Final(digest->rec->d.hash.s, digest->hash); + break; + case APR_CRYPTO_DIGEST_SHA256: + CC_SHA256_Final(digest->rec->d.hash.s, digest->hash); + break; + case APR_CRYPTO_DIGEST_SHA384: + CC_SHA384_Final(digest->rec->d.hash.s, digest->hash); + break; + case APR_CRYPTO_DIGEST_SHA512: + CC_SHA512_Final(digest->rec->d.hash.s, digest->hash); + break; + default: + return APR_ENODIGEST; + } + + break; + } + case APR_CRYPTO_KTYPE_HMAC: { + + apr_status_t status = APR_SUCCESS; + + size_t len = digest->key->digestSize; + + switch (digest->rec->dtype) { + case APR_CRYPTO_DTYPE_SIGN: { + + /* must we allocate the output buffer from a pool? */ + if (!digest->rec->d.sign.s || digest->rec->d.sign.slen != len) { + digest->rec->d.sign.slen = len; + digest->rec->d.sign.s = apr_palloc(digest->pool, len); + if (!digest->rec->d.sign.s) { + return APR_ENOMEM; + } + apr_crypto_clear(digest->pool, digest->rec->d.sign.s, len); + } + + /* then, determine the signature */ + CCHmacFinal(digest->hmac, digest->rec->d.sign.s); + + break; + } + case APR_CRYPTO_DTYPE_VERIFY: { + + /* must we allocate the output buffer from a pool? */ + if (!digest->rec->d.verify.s + || digest->rec->d.verify.slen != len) { + digest->rec->d.verify.slen = len; + digest->rec->d.verify.s = apr_palloc(digest->pool, len); + if (!digest->rec->d.verify.s) { + return APR_ENOMEM; + } + apr_crypto_clear(digest->pool, digest->rec->d.verify.s, + len); + } + + /* then, determine the signature */ + CCHmacFinal(digest->hmac, digest->rec->d.verify.s); + + if (digest->rec->d.verify.slen + == digest->rec->d.verify.vlen) { + status = + apr_crypto_equals(digest->rec->d.verify.s, + digest->rec->d.verify.v, + digest->rec->d.verify.slen) ? + APR_SUCCESS : APR_ENOVERIFY; + } else { + status = APR_ENOVERIFY; + } + + break; + } + default: { + status = APR_ENODIGEST; + break; + } + } + + return status; + + } + + case APR_CRYPTO_KTYPE_CMAC: { + + return APR_ENOTIMPL; + + } + + default: { + + return APR_EINVAL; + + } + } + + return APR_SUCCESS; +} + +static apr_status_t crypto_digest( + const apr_crypto_key_t *key, apr_crypto_digest_rec_t *rec, const unsigned char *in, + apr_size_t inlen, apr_pool_t *p) +{ + apr_crypto_digest_t *digest = NULL; + apr_status_t status = APR_SUCCESS; + + status = crypto_digest_init(&digest, key, rec, p); + if (APR_SUCCESS == status) { + status = crypto_digest_update(digest, in, inlen); + if (APR_SUCCESS == status) { + status = crypto_digest_final(digest); + } + } + return status; } /** @@ -886,11 +1458,14 @@ static apr_status_t crypto_block_decrypt_finish(unsigned char *out, */ APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_commoncrypto_driver = { - "commoncrypto", crypto_init, crypto_make, crypto_get_block_key_types, + "commoncrypto", crypto_init, crypto_make, + crypto_get_block_key_digests, crypto_get_block_key_types, crypto_get_block_key_modes, crypto_passphrase, crypto_block_encrypt_init, crypto_block_encrypt, crypto_block_encrypt_finish, crypto_block_decrypt_init, - crypto_block_decrypt, crypto_block_decrypt_finish, crypto_block_cleanup, + crypto_block_decrypt, crypto_block_decrypt_finish, + crypto_digest_init, crypto_digest_update, crypto_digest_final, + crypto_digest, crypto_block_cleanup, crypto_digest_cleanup, crypto_cleanup, crypto_shutdown, crypto_error, crypto_key }; diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c index 52898f69d16..37ffe086231 100644 --- a/crypto/apr_crypto_nss.c +++ b/crypto/apr_crypto_nss.c @@ -51,6 +51,7 @@ struct apr_crypto_t { const apr_crypto_driver_t *provider; apu_err_t *result; apr_crypto_config_t *config; + apr_hash_t *digests; apr_hash_t *types; apr_hash_t *modes; }; @@ -63,8 +64,11 @@ struct apr_crypto_key_t { apr_pool_t *pool; const apr_crypto_driver_t *provider; const apr_crypto_t *f; + const apr_crypto_key_rec_t *rec; CK_MECHANISM_TYPE cipherMech; + CK_MECHANISM_TYPE hashMech; SECOidTag cipherOid; + SECOidTag hashAlg; PK11SymKey *symKey; int ivSize; int keyLength; @@ -75,11 +79,30 @@ struct apr_crypto_block_t { const apr_crypto_driver_t *provider; const apr_crypto_t *f; PK11Context *ctx; - apr_crypto_key_t *key; + const apr_crypto_key_t *key; SECItem *secParam; int blockSize; }; +struct apr_crypto_digest_t { + apr_pool_t *pool; + const apr_crypto_driver_t *provider; + const apr_crypto_t *f; + apr_crypto_digest_rec_t *rec; + PK11Context *ctx; + const apr_crypto_key_t *key; + SECItem *secParam; +}; + +static struct apr_crypto_block_key_digest_t key_digests[] = +{ +{ APR_CRYPTO_DIGEST_MD5, 16, 64 }, +{ APR_CRYPTO_DIGEST_SHA1, 20, 64 }, +{ APR_CRYPTO_DIGEST_SHA224, 28, 64 }, +{ APR_CRYPTO_DIGEST_SHA256, 32, 64 }, +{ APR_CRYPTO_DIGEST_SHA384, 48, 128 }, +{ APR_CRYPTO_DIGEST_SHA512, 64, 128 } }; + static struct apr_crypto_block_key_type_t key_types[] = { { APR_KEY_3DES_192, 24, 8, 8 }, @@ -112,16 +135,128 @@ static apr_status_t crypto_error(const apu_err_t **result, */ static apr_status_t crypto_shutdown(void) { - return apr_crypto_lib_term("nss"); + if (NSS_IsInitialized()) { + SECStatus s = NSS_Shutdown(); + if (s != SECSuccess) { + fprintf(stderr, "NSS failed to shutdown, possible leak: %d: %s", + PR_GetError(), PR_ErrorToName(s)); + return APR_EINIT; + } + } + return APR_SUCCESS; +} + +static apr_status_t crypto_shutdown_helper(void *data) +{ + return crypto_shutdown(); } /** * Initialise the crypto library and perform one time initialisation. */ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, - const apu_err_t **result) + const apu_err_t **result) { - return apr_crypto_lib_init("nss", params, result, pool); + SECStatus s; + const char *dir = NULL; + const char *keyPrefix = NULL; + const char *certPrefix = NULL; + const char *secmod = NULL; + int noinit = 0; + PRUint32 flags = 0; + + struct { + const char *field; + const char *value; + int set; + } fields[] = { + { "dir", NULL, 0 }, + { "key3", NULL, 0 }, + { "cert7", NULL, 0 }, + { "secmod", NULL, 0 }, + { "noinit", NULL, 0 }, + { NULL, NULL, 0 } + }; + const char *ptr; + size_t klen; + char **elts = NULL; + char *elt; + int i = 0, j; + apr_status_t status; + + if (params) { + if (APR_SUCCESS != (status = apr_tokenize_to_argv(params, &elts, pool))) { + return status; + } + while ((elt = elts[i])) { + ptr = strchr(elt, '='); + if (ptr) { + for (klen = ptr - elt; klen && apr_isspace(elt[klen - 1]); --klen) + ; + ptr++; + } + else { + for (klen = strlen(elt); klen && apr_isspace(elt[klen - 1]); --klen) + ; + } + elt[klen] = 0; + + for (j = 0; fields[j].field != NULL; ++j) { + if (klen && !strcasecmp(fields[j].field, elt)) { + fields[j].set = 1; + if (ptr) { + fields[j].value = ptr; + } + break; + } + } + + i++; + } + dir = fields[0].value; + keyPrefix = fields[1].value; + certPrefix = fields[2].value; + secmod = fields[3].value; + noinit = fields[4].set; + } + + /* if we've been asked to bypass, do so here */ + if (noinit) { + return APR_SUCCESS; + } + + /* sanity check - we can only initialise NSS once */ + if (NSS_IsInitialized()) { + return APR_EREINIT; + } + + if (keyPrefix || certPrefix || secmod) { + s = NSS_Initialize(dir, certPrefix, keyPrefix, secmod, flags); + } + else if (dir) { + s = NSS_InitReadWrite(dir); + } + else { + s = NSS_NoDB_Init(NULL); + } + if (s != SECSuccess) { + if (result) { + /* Note: all memory must be owned by the caller, in case we're unloaded */ + apu_err_t *err = apr_pcalloc(pool, sizeof(apu_err_t)); + err->rc = PR_GetError(); + err->msg = apr_pstrdup(pool, PR_ErrorToName(s)); + err->reason = apr_pstrdup(pool, "Error during 'nss' initialisation"); + *result = err; + } + + return APR_ECRYPT; + } + + apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, + apr_pool_cleanup_null); + + return APR_SUCCESS; + } /** @@ -147,12 +282,41 @@ static apr_status_t crypto_block_cleanup(apr_crypto_block_t *block) } +/** + * @brief Clean sign / verify context. + * @note After cleanup, a context is free to be reused if necessary. + * @param f The context to use. + * @return Returns APR_ENOTIMPL if not supported. + */ +static apr_status_t crypto_digest_cleanup(apr_crypto_digest_t *digest) +{ + + if (digest->secParam) { + SECITEM_FreeItem(digest->secParam, PR_TRUE); + digest->secParam = NULL; + } + + if (digest->ctx) { + PK11_DestroyContext(digest->ctx, PR_TRUE); + digest->ctx = NULL; + } + + return APR_SUCCESS; + +} + static apr_status_t crypto_block_cleanup_helper(void *data) { apr_crypto_block_t *block = (apr_crypto_block_t *) data; return crypto_block_cleanup(block); } +static apr_status_t crypto_digest_cleanup_helper(void *data) +{ + apr_crypto_digest_t *digest = (apr_crypto_digest_t *) data; + return crypto_digest_cleanup(digest); +} + static apr_status_t crypto_key_cleanup(void *data) { apr_crypto_key_t *key = data; @@ -197,6 +361,7 @@ static apr_status_t crypto_make(apr_crypto_t **ff, { apr_crypto_config_t *config = NULL; apr_crypto_t *f; + int i; f = apr_pcalloc(pool, sizeof(apr_crypto_t)); if (!f) { @@ -214,21 +379,34 @@ static apr_status_t crypto_make(apr_crypto_t **ff, return APR_ENOMEM; } + f->digests = apr_hash_make(pool); + if (!f->digests) { + return APR_ENOMEM; + } + apr_hash_set(f->digests, "md2", APR_HASH_KEY_STRING, &(key_digests[i = 0])); + apr_hash_set(f->digests, "md4", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "md5", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "sha1", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "sha224", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "sha256", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "sha384", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "sha512", APR_HASH_KEY_STRING, &(key_digests[++i])); + f->types = apr_hash_make(pool); if (!f->types) { return APR_ENOMEM; } - apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_types[0])); - apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_types[1])); - apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_types[2])); - apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_types[3])); + apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_types[i = 0])); + apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_types[++i])); + apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_types[++i])); + apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_types[++i])); f->modes = apr_hash_make(pool); if (!f->modes) { return APR_ENOMEM; } - apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(key_modes[0])); - apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(key_modes[1])); + apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(key_modes[i = 0])); + apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(key_modes[++i])); apr_pool_cleanup_register(pool, f, crypto_cleanup_helper, apr_pool_cleanup_null); @@ -237,6 +415,21 @@ static apr_status_t crypto_make(apr_crypto_t **ff, } +/** + * @brief Get a hash table of key digests, keyed by the name of the digest against + * a pointer to apr_crypto_block_key_digest_t. + * + * @param digests - hashtable of key digests keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +static apr_status_t crypto_get_block_key_digests(apr_hash_t **digests, + const apr_crypto_t *f) +{ + *digests = f->digests; + return APR_SUCCESS; +} + /** * @brief Get a hash table of key types, keyed by the name of the type against * a pointer to apr_crypto_block_key_type_t. @@ -385,19 +578,21 @@ static apr_status_t crypto_key(apr_crypto_key_t **k, apr_pool_cleanup_null); } + key->pool = p; key->f = f; key->provider = f->provider; - - /* decide on what cipher mechanism we will be using */ - rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad); - if (APR_SUCCESS != rv) { - return rv; - } + key->rec = rec; switch (rec->ktype) { case APR_CRYPTO_KTYPE_PASSPHRASE: { + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad); + if (APR_SUCCESS != rv) { + return rv; + } + /* Turn the raw passphrase and salt into SECItems */ passItem.data = (unsigned char*) rec->k.passphrase.pass; passItem.len = rec->k.passphrase.passLen; @@ -419,11 +614,27 @@ static apr_status_t crypto_key(apr_crypto_key_t **k, SECOID_DestroyAlgorithmID(algid, PR_TRUE); } + /* sanity check? */ + if (!key->symKey) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + f->result->rc = perr; + f->result->msg = PR_ErrorToName(perr); + rv = APR_ENOKEY; + } + } + break; } case APR_CRYPTO_KTYPE_SECRET: { + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad); + if (APR_SUCCESS != rv) { + return rv; + } + /* * NSS is by default in FIPS mode, which disallows the use of unencrypted * symmetrical keys. As per http://permalink.gmane.org/gmane.comp.mozilla.crypto/7947 @@ -505,24 +716,115 @@ static apr_status_t crypto_key(apr_crypto_key_t **k, PK11_FreeSlot(slot); } + /* sanity check? */ + if (!key->symKey) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + f->result->rc = perr; + f->result->msg = PR_ErrorToName(perr); + rv = APR_ENOKEY; + } + } + break; } - default: { + case APR_CRYPTO_KTYPE_HASH: { + + switch (rec->k.hash.digest) { + case APR_CRYPTO_DIGEST_MD5: + key->hashAlg = SEC_OID_MD5; + break; + case APR_CRYPTO_DIGEST_SHA1: + key->hashAlg = SEC_OID_SHA1; + break; + case APR_CRYPTO_DIGEST_SHA224: + key->hashAlg = SEC_OID_SHA224; + break; + case APR_CRYPTO_DIGEST_SHA256: + key->hashAlg = SEC_OID_SHA256; + break; + case APR_CRYPTO_DIGEST_SHA384: + key->hashAlg = SEC_OID_SHA384; + break; + case APR_CRYPTO_DIGEST_SHA512: + key->hashAlg = SEC_OID_SHA512; + break; + default: + return APR_ENODIGEST; + } - return APR_ENOKEY; + break; + } + case APR_CRYPTO_KTYPE_HMAC: { + + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad); + if (APR_SUCCESS != rv) { + return rv; + } + + switch (rec->k.hmac.digest) { + case APR_CRYPTO_DIGEST_MD5: + key->hashMech = CKM_MD5_HMAC; + break; + case APR_CRYPTO_DIGEST_SHA1: + key->hashMech = CKM_SHA_1_HMAC; + break; + case APR_CRYPTO_DIGEST_SHA224: + key->hashMech = CKM_SHA224_HMAC; + break; + case APR_CRYPTO_DIGEST_SHA256: + key->hashMech = CKM_SHA256_HMAC; + break; + case APR_CRYPTO_DIGEST_SHA384: + key->hashMech = CKM_SHA384_HMAC; + break; + case APR_CRYPTO_DIGEST_SHA512: + key->hashMech = CKM_SHA512_HMAC; + break; + default: + return APR_ENODIGEST; + } + + /* generate the key */ + slot = PK11_GetBestSlot(key->hashMech, NULL); + if (slot) { + + /* prepare the key to wrap */ + secretItem.data = (unsigned char *) rec->k.hmac.secret; + secretItem.len = rec->k.hmac.secretLen; + + key->symKey = PK11_ImportSymKey(slot, key->hashMech, PK11_OriginDerive, + CKA_SIGN, &secretItem, NULL); + /* sanity check? */ + if (!key->symKey) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + f->result->rc = perr; + f->result->msg = PR_ErrorToName(perr); + rv = APR_ENOKEY; + } + } + + PK11_FreeSlot(slot); + } + + break; } + + case APR_CRYPTO_KTYPE_CMAC: { + + return APR_ENOTIMPL; + } - /* sanity check? */ - if (!key->symKey) { - PRErrorCode perr = PORT_GetError(); - if (perr) { - f->result->rc = perr; - f->result->msg = PR_ErrorToName(perr); - rv = APR_ENOKEY; - } + default: { + + return APR_ENOKEY; + + } } return rv; @@ -569,6 +871,7 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, SECAlgorithmID *algid; void *wincx = NULL; /* what is wincx? */ apr_crypto_key_t *key = *k; + apr_crypto_key_rec_t *rec; if (!key) { *k = key = apr_pcalloc(p, sizeof *key); @@ -581,6 +884,11 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, key->f = f; key->provider = f->provider; + key->rec = rec = apr_pcalloc(p, sizeof(apr_crypto_key_rec_t)); + if (!key->rec) { + return APR_ENOMEM; + } + rec->ktype = APR_CRYPTO_KTYPE_PASSPHRASE; /* decide on what cipher mechanism we will be using */ rv = crypto_cipher_mechanism(key, type, mode, doPad); @@ -658,54 +966,68 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, block->f = key->f; block->pool = p; block->provider = key->provider; + block->key = key; apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, apr_pool_cleanup_null); - if (key->ivSize) { - if (iv == NULL) { - return APR_ENOIV; - } - if (*iv == NULL) { - SECStatus s; - usedIv = apr_pcalloc(p, key->ivSize); - if (!usedIv) { - return APR_ENOMEM; - } - apr_crypto_clear(p, usedIv, key->ivSize); - s = PK11_GenerateRandom(usedIv, key->ivSize); - if (s != SECSuccess) { + switch (key->rec->ktype) { + + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { + + if (key->ivSize) { + if (iv == NULL) { return APR_ENOIV; } - *iv = usedIv; + if (*iv == NULL) { + SECStatus s; + usedIv = apr_pcalloc(p, key->ivSize); + if (!usedIv) { + return APR_ENOMEM; + } + apr_crypto_clear(p, usedIv, key->ivSize); + s = PK11_GenerateRandom(usedIv, key->ivSize); + if (s != SECSuccess) { + return APR_ENOIV; + } + *iv = usedIv; + } + else { + usedIv = (unsigned char *) *iv; + } + ivItem.data = usedIv; + ivItem.len = key->ivSize; + block->secParam = PK11_ParamFromIV(key->cipherMech, &ivItem); } else { - usedIv = (unsigned char *) *iv; + block->secParam = PK11_GenerateNewParam(key->cipherMech, key->symKey); + } + block->blockSize = PK11_GetBlockSize(key->cipherMech, block->secParam); + block->ctx = PK11_CreateContextBySymKey(key->cipherMech, CKA_ENCRYPT, + key->symKey, block->secParam); + + /* did an error occur? */ + perr = PORT_GetError(); + if (perr || !block->ctx) { + key->f->result->rc = perr; + key->f->result->msg = PR_ErrorToName(perr); + return APR_EINIT; } - ivItem.data = usedIv; - ivItem.len = key->ivSize; - block->secParam = PK11_ParamFromIV(key->cipherMech, &ivItem); - } - else { - block->secParam = PK11_GenerateNewParam(key->cipherMech, key->symKey); - } - block->blockSize = PK11_GetBlockSize(key->cipherMech, block->secParam); - block->ctx = PK11_CreateContextBySymKey(key->cipherMech, CKA_ENCRYPT, - key->symKey, block->secParam); - /* did an error occur? */ - perr = PORT_GetError(); - if (perr || !block->ctx) { - key->f->result->rc = perr; - key->f->result->msg = PR_ErrorToName(perr); - return APR_EINIT; - } + if (blockSize) { + *blockSize = PK11_GetBlockSize(key->cipherMech, block->secParam); + } + + return APR_SUCCESS; - if (blockSize) { - *blockSize = PK11_GetBlockSize(key->cipherMech, block->secParam); } + default: { - return APR_SUCCESS; + return APR_EINVAL; + + } + } } @@ -731,36 +1053,48 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *block) { + switch (block->key->rec->ktype) { - unsigned char *buffer; - int outl = (int) *outlen; - SECStatus s; - if (!out) { - *outlen = inlen + block->blockSize; - return APR_SUCCESS; - } - if (!*out) { - buffer = apr_palloc(block->pool, inlen + block->blockSize); - if (!buffer) { - return APR_ENOMEM; + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { + + unsigned char *buffer; + int outl = (int) *outlen; + SECStatus s; + if (!out) { + *outlen = inlen + block->blockSize; + return APR_SUCCESS; + } + if (!*out) { + buffer = apr_palloc(block->pool, inlen + block->blockSize); + if (!buffer) { + return APR_ENOMEM; + } + apr_crypto_clear(block->pool, buffer, inlen + block->blockSize); + *out = buffer; } - apr_crypto_clear(block->pool, buffer, inlen + block->blockSize); - *out = buffer; - } - s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*) in, - inlen); - if (s != SECSuccess) { - PRErrorCode perr = PORT_GetError(); - if (perr) { - block->f->result->rc = perr; - block->f->result->msg = PR_ErrorToName(perr); + s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*) in, + inlen); + if (s != SECSuccess) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + block->f->result->rc = perr; + block->f->result->msg = PR_ErrorToName(perr); + } + return APR_ECRYPT; } - return APR_ECRYPT; + *outlen = outl; + + return APR_SUCCESS; + } - *outlen = outl; + default: { - return APR_SUCCESS; + return APR_EINVAL; + + } + } } @@ -785,24 +1119,36 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, static apr_status_t crypto_block_encrypt_finish(unsigned char *out, apr_size_t *outlen, apr_crypto_block_t *block) { + switch (block->key->rec->ktype) { - apr_status_t rv = APR_SUCCESS; - unsigned int outl = *outlen; + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { - SECStatus s = PK11_DigestFinal(block->ctx, out, &outl, block->blockSize); - *outlen = outl; + apr_status_t rv = APR_SUCCESS; + unsigned int outl = *outlen; - if (s != SECSuccess) { - PRErrorCode perr = PORT_GetError(); - if (perr) { - block->f->result->rc = perr; - block->f->result->msg = PR_ErrorToName(perr); + SECStatus s = PK11_DigestFinal(block->ctx, out, &outl, block->blockSize); + *outlen = outl; + + if (s != SECSuccess) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + block->f->result->rc = perr; + block->f->result->msg = PR_ErrorToName(perr); + } + rv = APR_ECRYPT; } - rv = APR_ECRYPT; + crypto_block_cleanup(block); + + return rv; + } - crypto_block_cleanup(block); + default: { - return rv; + return APR_EINVAL; + + } + } } @@ -825,50 +1171,64 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, apr_size_t *blockSize, const unsigned char *iv, const apr_crypto_key_t *key, apr_pool_t *p) { - PRErrorCode perr; - apr_crypto_block_t *block = *ctx; - if (!block) { - *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t)); - } - if (!block) { - return APR_ENOMEM; - } - block->f = key->f; - block->pool = p; - block->provider = key->provider; + switch (key->rec->ktype) { - apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, - apr_pool_cleanup_null); + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { - if (key->ivSize) { - SECItem ivItem; - if (iv == NULL) { - return APR_ENOIV; /* Cannot initialise without an IV */ + PRErrorCode perr; + apr_crypto_block_t *block = *ctx; + if (!block) { + *ctx = block = apr_pcalloc(p, sizeof(apr_crypto_block_t)); + } + if (!block) { + return APR_ENOMEM; + } + block->f = key->f; + block->pool = p; + block->provider = key->provider; + block->key = key; + + apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, + apr_pool_cleanup_null); + + if (key->ivSize) { + SECItem ivItem; + if (iv == NULL) { + return APR_ENOIV; /* Cannot initialise without an IV */ + } + ivItem.data = (unsigned char*) iv; + ivItem.len = key->ivSize; + block->secParam = PK11_ParamFromIV(key->cipherMech, &ivItem); + } + else { + block->secParam = PK11_GenerateNewParam(key->cipherMech, key->symKey); + } + block->blockSize = PK11_GetBlockSize(key->cipherMech, block->secParam); + block->ctx = PK11_CreateContextBySymKey(key->cipherMech, CKA_DECRYPT, + key->symKey, block->secParam); + + /* did an error occur? */ + perr = PORT_GetError(); + if (perr || !block->ctx) { + key->f->result->rc = perr; + key->f->result->msg = PR_ErrorToName(perr); + return APR_EINIT; } - ivItem.data = (unsigned char*) iv; - ivItem.len = key->ivSize; - block->secParam = PK11_ParamFromIV(key->cipherMech, &ivItem); - } - else { - block->secParam = PK11_GenerateNewParam(key->cipherMech, key->symKey); - } - block->blockSize = PK11_GetBlockSize(key->cipherMech, block->secParam); - block->ctx = PK11_CreateContextBySymKey(key->cipherMech, CKA_DECRYPT, - key->symKey, block->secParam); - /* did an error occur? */ - perr = PORT_GetError(); - if (perr || !block->ctx) { - key->f->result->rc = perr; - key->f->result->msg = PR_ErrorToName(perr); - return APR_EINIT; - } + if (blockSize) { + *blockSize = PK11_GetBlockSize(key->cipherMech, block->secParam); + } + + return APR_SUCCESS; - if (blockSize) { - *blockSize = PK11_GetBlockSize(key->cipherMech, block->secParam); } + default: { - return APR_SUCCESS; + return APR_EINVAL; + + } + } } @@ -894,36 +1254,48 @@ static apr_status_t crypto_block_decrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *block) { + switch (block->key->rec->ktype) { - unsigned char *buffer; - int outl = (int) *outlen; - SECStatus s; - if (!out) { - *outlen = inlen + block->blockSize; - return APR_SUCCESS; - } - if (!*out) { - buffer = apr_palloc(block->pool, inlen + block->blockSize); - if (!buffer) { - return APR_ENOMEM; + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { + + unsigned char *buffer; + int outl = (int) *outlen; + SECStatus s; + if (!out) { + *outlen = inlen + block->blockSize; + return APR_SUCCESS; + } + if (!*out) { + buffer = apr_palloc(block->pool, inlen + block->blockSize); + if (!buffer) { + return APR_ENOMEM; + } + apr_crypto_clear(block->pool, buffer, inlen + block->blockSize); + *out = buffer; } - apr_crypto_clear(block->pool, buffer, inlen + block->blockSize); - *out = buffer; - } - s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*) in, - inlen); - if (s != SECSuccess) { - PRErrorCode perr = PORT_GetError(); - if (perr) { - block->f->result->rc = perr; - block->f->result->msg = PR_ErrorToName(perr); + s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*) in, + inlen); + if (s != SECSuccess) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + block->f->result->rc = perr; + block->f->result->msg = PR_ErrorToName(perr); + } + return APR_ECRYPT; } - return APR_ECRYPT; + *outlen = outl; + + return APR_SUCCESS; + } - *outlen = outl; + default: { - return APR_SUCCESS; + return APR_EINVAL; + + } + } } @@ -948,37 +1320,326 @@ static apr_status_t crypto_block_decrypt(unsigned char **out, static apr_status_t crypto_block_decrypt_finish(unsigned char *out, apr_size_t *outlen, apr_crypto_block_t *block) { + switch (block->key->rec->ktype) { - apr_status_t rv = APR_SUCCESS; - unsigned int outl = *outlen; + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { - SECStatus s = PK11_DigestFinal(block->ctx, out, &outl, block->blockSize); - *outlen = outl; + apr_status_t rv = APR_SUCCESS; + unsigned int outl = *outlen; - if (s != SECSuccess) { - PRErrorCode perr = PORT_GetError(); - if (perr) { - block->f->result->rc = perr; - block->f->result->msg = PR_ErrorToName(perr); + SECStatus s = PK11_DigestFinal(block->ctx, out, &outl, block->blockSize); + *outlen = outl; + + if (s != SECSuccess) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + block->f->result->rc = perr; + block->f->result->msg = PR_ErrorToName(perr); + } + rv = APR_ECRYPT; } - rv = APR_ECRYPT; + crypto_block_cleanup(block); + + return rv; + } - crypto_block_cleanup(block); + default: { - return rv; + return APR_EINVAL; + + } + } + +} + +static apr_status_t crypto_digest_init(apr_crypto_digest_t **d, + const apr_crypto_key_t *key, apr_crypto_digest_rec_t *rec, apr_pool_t *p) +{ + PRErrorCode perr; + SECStatus s; + apr_crypto_digest_t *digest = *d; + if (!digest) { + *d = digest = apr_pcalloc(p, sizeof(apr_crypto_digest_t)); + } + if (!digest) { + return APR_ENOMEM; + } + digest->f = key->f; + digest->pool = p; + digest->provider = key->provider; + digest->key = key; + digest->rec = rec; + + apr_pool_cleanup_register(p, digest, crypto_digest_cleanup_helper, + apr_pool_cleanup_null); + + switch (key->rec->ktype) { + + case APR_CRYPTO_KTYPE_HASH: { + + digest->ctx = PK11_CreateDigestContext(key->hashAlg); + + s = PK11_DigestBegin(digest->ctx); + if (s != SECSuccess) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + digest->f->result->rc = perr; + digest->f->result->msg = PR_ErrorToName(perr); + } + return APR_ECRYPT; + } + + return APR_SUCCESS; + + } + case APR_CRYPTO_KTYPE_HMAC: { + + digest->secParam = PK11_GenerateNewParam(key->cipherMech, key->symKey); + digest->ctx = PK11_CreateContextBySymKey(key->hashMech, CKA_SIGN, + key->symKey, digest->secParam); + + /* did an error occur? */ + perr = PORT_GetError(); + if (perr || !digest->ctx) { + key->f->result->rc = perr; + key->f->result->msg = PR_ErrorToName(perr); + return APR_EINIT; + } + + s = PK11_DigestBegin(digest->ctx); + if (s != SECSuccess) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + digest->f->result->rc = perr; + digest->f->result->msg = PR_ErrorToName(perr); + } + return APR_ECRYPT; + } + + return APR_SUCCESS; + + } + case APR_CRYPTO_KTYPE_CMAC: { + + return APR_ENOTIMPL; + + } + default: { + + return APR_EINVAL; + + } + } + +} + +static apr_status_t crypto_digest_update(apr_crypto_digest_t *digest, + const unsigned char *in, apr_size_t inlen) +{ + switch (digest->key->rec->ktype) { + + case APR_CRYPTO_KTYPE_HASH: + case APR_CRYPTO_KTYPE_HMAC: { + + SECStatus s; + + s = PK11_DigestOp(digest->ctx, (unsigned char*) in, + inlen); + if (s != SECSuccess) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + digest->f->result->rc = perr; + digest->f->result->msg = PR_ErrorToName(perr); + } + return APR_ECRYPT; + } + + return APR_SUCCESS; + + } + case APR_CRYPTO_KTYPE_CMAC: { + + return APR_ENOTIMPL; + + } + default: { + + return APR_EINVAL; + + } + } + +} + +static apr_status_t crypto_digest_final(apr_crypto_digest_t *digest) +{ + switch (digest->key->rec->ktype) { + + case APR_CRYPTO_KTYPE_HASH: + case APR_CRYPTO_KTYPE_HMAC: { + + apr_status_t status = APR_SUCCESS; + unsigned int len; + + /* first, determine the signature length */ + SECStatus s = PK11_DigestFinal(digest->ctx, NULL, &len, 0); + if (s != SECSuccess) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + digest->f->result->rc = perr; + digest->f->result->msg = PR_ErrorToName(perr); + } + status = APR_ECRYPT; + } + else { + + switch (digest->rec->dtype) { + case APR_CRYPTO_DTYPE_HASH: { + + /* must we allocate the output buffer from a pool? */ + if (!digest->rec->d.hash.s || digest->rec->d.hash.slen != len) { + digest->rec->d.hash.slen = len; + digest->rec->d.hash.s = apr_palloc(digest->pool, len); + if (!digest->rec->d.hash.s) { + return APR_ENOMEM; + } + apr_crypto_clear(digest->pool, digest->rec->d.hash.s, len); + } + + /* then, determine the signature */ + SECStatus s = PK11_DigestFinal(digest->ctx, + digest->rec->d.hash.s, &len, digest->rec->d.hash.slen); + if (s != SECSuccess) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + digest->f->result->rc = perr; + digest->f->result->msg = PR_ErrorToName(perr); + } + status = APR_ECRYPT; + } + + break; + } + case APR_CRYPTO_DTYPE_SIGN: { + + /* must we allocate the output buffer from a pool? */ + if (!digest->rec->d.sign.s || digest->rec->d.sign.slen != len) { + digest->rec->d.sign.slen = len; + digest->rec->d.sign.s = apr_palloc(digest->pool, len); + if (!digest->rec->d.sign.s) { + return APR_ENOMEM; + } + apr_crypto_clear(digest->pool, digest->rec->d.sign.s, len); + } + + /* then, determine the signature */ + SECStatus s = PK11_DigestFinal(digest->ctx, + digest->rec->d.sign.s, &len, digest->rec->d.sign.slen); + if (s != SECSuccess) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + digest->f->result->rc = perr; + digest->f->result->msg = PR_ErrorToName(perr); + } + status = APR_ECRYPT; + } + + break; + } + case APR_CRYPTO_DTYPE_VERIFY: { + + /* must we allocate the output buffer from a pool? */ + if (!digest->rec->d.verify.s + || digest->rec->d.verify.slen != len) { + digest->rec->d.verify.slen = len; + digest->rec->d.verify.s = apr_palloc(digest->pool, len); + if (!digest->rec->d.verify.s) { + return APR_ENOMEM; + } + apr_crypto_clear(digest->pool, digest->rec->d.verify.s, + len); + } + + /* then, determine the signature */ + SECStatus s = PK11_DigestFinal(digest->ctx, + digest->rec->d.verify.s, &len, + digest->rec->d.verify.slen); + if (s != SECSuccess) { + PRErrorCode perr = PORT_GetError(); + if (perr) { + digest->f->result->rc = perr; + digest->f->result->msg = PR_ErrorToName(perr); + } + status = APR_ECRYPT; + } else if (digest->rec->d.verify.slen + == digest->rec->d.verify.vlen) { + status = + apr_crypto_equals(digest->rec->d.verify.s, + digest->rec->d.verify.v, + digest->rec->d.verify.slen) ? + APR_SUCCESS : APR_ENOVERIFY; + } else { + status = APR_ENOVERIFY; + } + + break; + } + default: { + status = APR_ENODIGEST; + } + } + + } + + crypto_digest_cleanup(digest); + + return status; + + } + case APR_CRYPTO_KTYPE_CMAC: { + + return APR_ENOTIMPL; + + } + default: { + + return APR_EINVAL; + + } + } + +} + +static apr_status_t crypto_digest( + const apr_crypto_key_t *key, apr_crypto_digest_rec_t *rec, const unsigned char *in, + apr_size_t inlen, apr_pool_t *p) +{ + apr_crypto_digest_t *digest = NULL; + apr_status_t status = APR_SUCCESS; + + status = crypto_digest_init(&digest, key, rec, p); + if (APR_SUCCESS == status) { + status = crypto_digest_update(digest, in, inlen); + if (APR_SUCCESS == status) { + status = crypto_digest_final(digest); + } + } + return status; } /** * NSS module. */ APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_nss_driver = { - "nss", crypto_init, crypto_make, crypto_get_block_key_types, + "nss", crypto_init, crypto_make, crypto_get_block_key_digests, crypto_get_block_key_types, crypto_get_block_key_modes, crypto_passphrase, crypto_block_encrypt_init, crypto_block_encrypt, crypto_block_encrypt_finish, crypto_block_decrypt_init, crypto_block_decrypt, crypto_block_decrypt_finish, - crypto_block_cleanup, crypto_cleanup, crypto_shutdown, crypto_error, + crypto_digest_init, crypto_digest_update, crypto_digest_final, crypto_digest, + crypto_block_cleanup, crypto_digest_cleanup, crypto_cleanup, crypto_shutdown, crypto_error, crypto_key }; diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c index b7bed223a10..b1b5f9071f8 100644 --- a/crypto/apr_crypto_openssl.c +++ b/crypto/apr_crypto_openssl.c @@ -37,8 +37,20 @@ #define LOG_PREFIX "apr_crypto_openssl: " -#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) -#define EVP_CIPHER_CTX_reset EVP_CIPHER_CTX_cleanup +#ifndef APR_USE_OPENSSL_PRE_1_1_API +#if defined(LIBRESSL_VERSION_NUMBER) +/* LibreSSL declares OPENSSL_VERSION_NUMBER == 2.0 but does not include most + * changes from OpenSSL >= 1.1 (new functions, macros, deprecations, ...), so + * we have to work around this... + */ +#define APR_USE_OPENSSL_PRE_1_1_API (1) +#define APR_USE_OPENSSL_PRE_1_1_1_API (1) +#define APR_USE_OPENSSL_PRE_1_0_API (0) +#else +#define APR_USE_OPENSSL_PRE_1_1_API (OPENSSL_VERSION_NUMBER < 0x10100000L) +#define APR_USE_OPENSSL_PRE_1_1_1_API (OPENSSL_VERSION_NUMBER < 0x10101000L) +#define APR_USE_OPENSSL_PRE_1_0_API (OPENSSL_VERSION_NUMBER < 0x10000000L) +#endif #endif struct apr_crypto_t { @@ -48,6 +60,7 @@ struct apr_crypto_t { apr_crypto_config_t *config; apr_hash_t *types; apr_hash_t *modes; + apr_hash_t *digests; }; struct apr_crypto_config_t { @@ -58,7 +71,10 @@ struct apr_crypto_key_t { apr_pool_t *pool; const apr_crypto_driver_t *provider; const apr_crypto_t *f; - const EVP_CIPHER * cipher; + const apr_crypto_key_rec_t *rec; + const EVP_CIPHER *cipher; + const EVP_MD *hmac; + EVP_PKEY *pkey; unsigned char *key; int keyLen; int doPad; @@ -69,6 +85,7 @@ struct apr_crypto_block_t { apr_pool_t *pool; const apr_crypto_driver_t *provider; const apr_crypto_t *f; + const apr_crypto_key_t *key; EVP_CIPHER_CTX *cipherCtx; int initialised; int ivSize; @@ -76,6 +93,26 @@ struct apr_crypto_block_t { int doPad; }; +struct apr_crypto_digest_t { + apr_pool_t *pool; + const apr_crypto_driver_t *provider; + const apr_crypto_t *f; + const apr_crypto_key_t *key; + apr_crypto_digest_rec_t *rec; + EVP_MD_CTX *mdCtx; + int initialised; + int digestSize; +}; + +static struct apr_crypto_block_key_digest_t key_digests[] = +{ +{ APR_CRYPTO_DIGEST_MD5, 16, 64 }, +{ APR_CRYPTO_DIGEST_SHA1, 20, 64 }, +{ APR_CRYPTO_DIGEST_SHA224, 28, 64 }, +{ APR_CRYPTO_DIGEST_SHA256, 32, 64 }, +{ APR_CRYPTO_DIGEST_SHA384, 48, 128 }, +{ APR_CRYPTO_DIGEST_SHA512, 64, 128 } }; + static struct apr_crypto_block_key_type_t key_types[] = { { APR_KEY_3DES_192, 24, 8, 8 }, @@ -106,16 +143,87 @@ static apr_status_t crypto_error(const apu_err_t **result, */ static apr_status_t crypto_shutdown(void) { - return apr_crypto_lib_term("openssl"); + ERR_free_strings(); + EVP_cleanup(); + ENGINE_cleanup(); + return APR_SUCCESS; +} + +static apr_status_t crypto_shutdown_helper(void *data) +{ + return crypto_shutdown(); } /** * Initialise the crypto library and perform one time initialisation. */ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, - const apu_err_t **result) + const apu_err_t **result) { - return apr_crypto_lib_init("openssl", params, result, pool); +#if APR_USE_OPENSSL_PRE_1_1_API + (void)CRYPTO_malloc_init(); +#else + OPENSSL_malloc_init(); +#endif + ERR_load_crypto_strings(); + /* SSL_load_error_strings(); */ + OpenSSL_add_all_algorithms(); + ENGINE_load_builtin_engines(); + ENGINE_register_all_complete(); + + apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, + apr_pool_cleanup_null); + + return APR_SUCCESS; +} + +#if OPENSSL_VERSION_NUMBER < 0x0090802fL + +/* Code taken from OpenSSL 0.9.8b, see + * https://github.com/openssl/openssl/commit/cf6bc84148cb15af09b292394aaf2b45f0d5af0d + */ + +EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void) +{ + EVP_CIPHER_CTX *ctx = OPENSSL_malloc(sizeof *ctx); + if (ctx) + EVP_CIPHER_CTX_init(ctx); + return ctx; +} + +void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) +{ + if (ctx) { + EVP_CIPHER_CTX_cleanup(ctx); + OPENSSL_free(ctx); + } +} + +#endif + +#ifdef APR_USE_OPENSSL_PRE_1_1_API +#define EVP_MD_CTX_new EVP_MD_CTX_create +#define EVP_MD_CTX_free EVP_MD_CTX_destroy +#endif + +/** + * @brief Clean key. + * @param key The key to use. + * @return Returns APR_ENOTIMPL if not supported. + */ +static apr_status_t crypto_key_cleanup(apr_crypto_key_t *key) +{ + if (key->pkey) { + EVP_PKEY_free(key->pkey); + } + + return APR_SUCCESS; +} + +static apr_status_t crypto_key_cleanup_helper(void *data) +{ + apr_crypto_key_t *key = (apr_crypto_key_t *) data; + return crypto_key_cleanup(key); } /** @@ -128,7 +236,15 @@ static apr_status_t crypto_block_cleanup(apr_crypto_block_t *ctx) { if (ctx->initialised) { - EVP_CIPHER_CTX_free(ctx->cipherCtx); + if (ctx->cipherCtx) { +#if APR_USE_OPENSSL_PRE_1_1_API + EVP_CIPHER_CTX_cleanup(ctx->cipherCtx); +#else + EVP_CIPHER_CTX_reset(ctx->cipherCtx); + EVP_CIPHER_CTX_free(ctx->cipherCtx); +#endif + ctx->cipherCtx = NULL; + } ctx->initialised = 0; } @@ -142,6 +258,33 @@ static apr_status_t crypto_block_cleanup_helper(void *data) return crypto_block_cleanup(block); } +/** + * @brief Clean sign / verify context. + * @note After cleanup, a context is free to be reused if necessary. + * @param ctx The block context to use. + * @return Returns APR_ENOTIMPL if not supported. + */ +static apr_status_t crypto_digest_cleanup(apr_crypto_digest_t *ctx) +{ + + if (ctx->initialised) { + if (ctx->mdCtx) { + EVP_MD_CTX_free(ctx->mdCtx); + ctx->mdCtx = NULL; + } + ctx->initialised = 0; + } + + return APR_SUCCESS; + +} + +static apr_status_t crypto_digest_cleanup_helper(void *data) +{ + apr_crypto_digest_t *digest = (apr_crypto_digest_t *) data; + return crypto_digest_cleanup(digest); +} + /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. @@ -250,21 +393,37 @@ static apr_status_t crypto_make(apr_crypto_t **ff, return APR_ENOMEM; } + f->digests = apr_hash_make(pool); + if (!f->digests) { + return APR_ENOMEM; + } + apr_hash_set(f->digests, "md5", APR_HASH_KEY_STRING, &(key_digests[i = 0])); + apr_hash_set(f->digests, "sha1", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "sha224", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "sha256", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "sha384", APR_HASH_KEY_STRING, &(key_digests[++i])); + apr_hash_set(f->digests, "sha512", APR_HASH_KEY_STRING, &(key_digests[++i])); + f->types = apr_hash_make(pool); if (!f->types) { return APR_ENOMEM; } - apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_types[0])); - apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_types[1])); - apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_types[2])); - apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_types[3])); + apr_hash_set(f->types, "3des192", APR_HASH_KEY_STRING, &(key_types[i = 0])); + apr_hash_set(f->types, "aes128", APR_HASH_KEY_STRING, &(key_types[++i])); + apr_hash_set(f->types, "aes192", APR_HASH_KEY_STRING, &(key_types[++i])); + apr_hash_set(f->types, "aes256", APR_HASH_KEY_STRING, &(key_types[++i])); f->modes = apr_hash_make(pool); if (!f->modes) { return APR_ENOMEM; } - apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(key_modes[0])); - apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(key_modes[1])); + apr_hash_set(f->modes, "ecb", APR_HASH_KEY_STRING, &(key_modes[i = 0])); + apr_hash_set(f->modes, "cbc", APR_HASH_KEY_STRING, &(key_modes[++i])); + + f->digests = apr_hash_make(pool); + if (!f->digests) { + return APR_ENOMEM; + } apr_pool_cleanup_register(pool, f, crypto_cleanup_helper, apr_pool_cleanup_null); @@ -285,6 +444,21 @@ static apr_status_t crypto_make(apr_crypto_t **ff, } +/** + * @brief Get a hash table of key digests, keyed by the name of the digest against + * a pointer to apr_crypto_block_key_digest_t. + * + * @param digests - hashtable of key digests keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +static apr_status_t crypto_get_block_key_digests(apr_hash_t **digests, + const apr_crypto_t *f) +{ + *digests = f->digests; + return APR_SUCCESS; +} + /** * @brief Get a hash table of key types, keyed by the name of the type against * a pointer to apr_crypto_block_key_type_t. @@ -415,19 +589,24 @@ static apr_status_t crypto_key(apr_crypto_key_t **k, } } + apr_pool_cleanup_register(p, key, crypto_key_cleanup_helper, + apr_pool_cleanup_null); + + key->pool = p; key->f = f; key->provider = f->provider; - - /* decide on what cipher mechanism we will be using */ - rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad, p); - if (APR_SUCCESS != rv) { - return rv; - } + key->rec = rec; switch (rec->ktype) { case APR_CRYPTO_KTYPE_PASSPHRASE: { + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad, p); + if (APR_SUCCESS != rv) { + return rv; + } + /* generate the key */ if (PKCS5_PBKDF2_HMAC_SHA1(rec->k.passphrase.pass, rec->k.passphrase.passLen, @@ -442,6 +621,12 @@ static apr_status_t crypto_key(apr_crypto_key_t **k, case APR_CRYPTO_KTYPE_SECRET: { + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad, p); + if (APR_SUCCESS != rv) { + return rv; + } + /* sanity check - key correct size? */ if (rec->k.secret.secretLen != key->keyLen) { return APR_EKEYLENGTH; @@ -452,6 +637,115 @@ static apr_status_t crypto_key(apr_crypto_key_t **k, break; } + case APR_CRYPTO_KTYPE_HASH: { + + switch (rec->k.hash.digest) { + case APR_CRYPTO_DIGEST_MD5: + key->hmac = EVP_md5(); + break; + case APR_CRYPTO_DIGEST_SHA1: + key->hmac = EVP_sha1(); + break; + case APR_CRYPTO_DIGEST_SHA224: + key->hmac = EVP_sha224(); + break; + case APR_CRYPTO_DIGEST_SHA256: + key->hmac = EVP_sha256(); + break; + case APR_CRYPTO_DIGEST_SHA384: + key->hmac = EVP_sha384(); + break; + case APR_CRYPTO_DIGEST_SHA512: + key->hmac = EVP_sha512(); + break; + default: + return APR_ENODIGEST; + } + + break; + } + case APR_CRYPTO_KTYPE_HMAC: { + + apr_crypto_config_t *config = f->config; + + /* create hmac key */ + if (!(key->pkey = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, config->engine, + rec->k.hmac.secret, rec->k.hmac.secretLen))) { + return APR_ENOKEY; + } + + switch (rec->k.hmac.digest) { + case APR_CRYPTO_DIGEST_MD5: + key->hmac = EVP_md5(); + break; + case APR_CRYPTO_DIGEST_SHA1: + key->hmac = EVP_sha1(); + break; + case APR_CRYPTO_DIGEST_SHA224: + key->hmac = EVP_sha224(); + break; + case APR_CRYPTO_DIGEST_SHA256: + key->hmac = EVP_sha256(); + break; + case APR_CRYPTO_DIGEST_SHA384: + key->hmac = EVP_sha384(); + break; + case APR_CRYPTO_DIGEST_SHA512: + key->hmac = EVP_sha512(); + break; + default: + return APR_ENODIGEST; + } + + break; + } + + case APR_CRYPTO_KTYPE_CMAC: { + +#ifndef APR_USE_OPENSSL_PRE_1_1_1_API + apr_crypto_config_t *config = f->config; + + /* decide on what cipher mechanism we will be using */ + rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad, p); + if (APR_SUCCESS != rv) { + return rv; + } + + /* create cmac key */ + if (!(key->pkey = EVP_PKEY_new_CMAC_key(config->engine, + rec->k.cmac.secret, rec->k.cmac.secretLen, key->cipher))) { + return APR_ENOKEY; + } + + switch (rec->k.hmac.hmac) { + case APR_CRYPTO_DIGEST_MD5: + key->hmac = EVP_md5(); + break; + case APR_CRYPTO_DIGEST_SHA1: + key->hmac = EVP_sha1(); + break; + case APR_CRYPTO_DIGEST_SHA224: + key->hmac = EVP_sha224(); + break; + case APR_CRYPTO_DIGEST_SHA256: + key->hmac = EVP_sha256(); + break; + case APR_CRYPTO_DIGEST_SHA384: + key->hmac = EVP_sha384(); + break; + case APR_CRYPTO_DIGEST_SHA512: + key->hmac = EVP_sha512(); + break; + default: + return APR_ENODIGEST; + } + +#else + return APR_ENOTIMPL; +#endif + + break; + } default: { @@ -465,7 +759,7 @@ static apr_status_t crypto_key(apr_crypto_key_t **k, /* note: openssl incorrectly returns non zero IV size values for ECB * algorithms, so work around this by ignoring the IV size. */ - if (APR_MODE_ECB != rec->mode) { + if (APR_MODE_ECB != rec->mode && key->cipher) { key->ivSize = EVP_CIPHER_iv_length(key->cipher); } @@ -507,6 +801,7 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, const int iterations, const apr_crypto_t *f, apr_pool_t *p) { apr_crypto_key_t *key = *k; + apr_crypto_key_rec_t *rec; apr_status_t rv; if (!key) { @@ -518,6 +813,11 @@ static apr_status_t crypto_passphrase(apr_crypto_key_t **k, apr_size_t *ivSize, key->f = f; key->provider = f->provider; + key->rec = rec = apr_pcalloc(p, sizeof(apr_crypto_key_rec_t)); + if (!key->rec) { + return APR_ENOMEM; + } + rec->ktype = APR_CRYPTO_KTYPE_PASSPHRASE; /* decide on what cipher mechanism we will be using */ rv = crypto_cipher_mechanism(key, type, mode, doPad, p); @@ -578,59 +878,73 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, block->f = key->f; block->pool = p; block->provider = key->provider; + block->key = key; apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, apr_pool_cleanup_null); - /* create a new context for encryption */ - if (!block->initialised) { - block->cipherCtx = EVP_CIPHER_CTX_new(); - block->initialised = 1; - } + switch (key->rec->ktype) { - /* generate an IV, if necessary */ - usedIv = NULL; - if (key->ivSize) { - if (iv == NULL) { - return APR_ENOIV; + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { + + /* create a new context for encryption */ + if (!block->initialised) { + block->cipherCtx = EVP_CIPHER_CTX_new(); + block->initialised = 1; } - if (*iv == NULL) { - usedIv = apr_pcalloc(p, key->ivSize); - if (!usedIv) { - return APR_ENOMEM; - } - apr_crypto_clear(p, usedIv, key->ivSize); - if (!((RAND_status() == 1) - && (RAND_bytes(usedIv, key->ivSize) == 1))) { + + /* generate an IV, if necessary */ + usedIv = NULL; + if (key->ivSize) { + if (iv == NULL) { return APR_ENOIV; } - *iv = usedIv; - } - else { - usedIv = (unsigned char *) *iv; + if (*iv == NULL) { + usedIv = apr_pcalloc(p, key->ivSize); + if (!usedIv) { + return APR_ENOMEM; + } + apr_crypto_clear(p, usedIv, key->ivSize); + if (!((RAND_status() == 1) + && (RAND_bytes(usedIv, key->ivSize) == 1))) { + return APR_ENOIV; + } + *iv = usedIv; + } + else { + usedIv = (unsigned char *) *iv; + } } - } - /* set up our encryption context */ + /* set up our encryption context */ #if CRYPTO_OPENSSL_CONST_BUFFERS - if (!EVP_EncryptInit_ex(block->cipherCtx, key->cipher, config->engine, - key->key, usedIv)) { + if (!EVP_EncryptInit_ex(block->cipherCtx, key->cipher, config->engine, + key->key, usedIv)) { #else if (!EVP_EncryptInit_ex(block->cipherCtx, key->cipher, config->engine, (unsigned char *) key->key, (unsigned char *) usedIv)) { #endif - return APR_EINIT; - } + return APR_EINIT; + } - /* Clear up any read padding */ - if (!EVP_CIPHER_CTX_set_padding(block->cipherCtx, key->doPad)) { - return APR_EPADDING; - } + /* Clear up any read padding */ + if (!EVP_CIPHER_CTX_set_padding(block->cipherCtx, key->doPad)) { + return APR_EPADDING; + } + + if (blockSize) { + *blockSize = EVP_CIPHER_block_size(key->cipher); + } + + return APR_SUCCESS; - if (blockSize) { - *blockSize = EVP_CIPHER_block_size(key->cipher); } + default: { - return APR_SUCCESS; + return APR_EINVAL; + + } + } } @@ -654,39 +968,52 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx, */ static apr_status_t crypto_block_encrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, - apr_crypto_block_t *ctx) + apr_crypto_block_t *block) { - int outl = *outlen; - unsigned char *buffer; + switch (block->key->rec->ktype) { - /* are we after the maximum size of the out buffer? */ - if (!out) { - *outlen = inlen + EVP_MAX_BLOCK_LENGTH; - return APR_SUCCESS; - } + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { - /* must we allocate the output buffer from a pool? */ - if (!*out) { - buffer = apr_palloc(ctx->pool, inlen + EVP_MAX_BLOCK_LENGTH); - if (!buffer) { - return APR_ENOMEM; + int outl = *outlen; + unsigned char *buffer; + + /* are we after the maximum size of the out buffer? */ + if (!out) { + *outlen = inlen + EVP_MAX_BLOCK_LENGTH; + return APR_SUCCESS; + } + + /* must we allocate the output buffer from a pool? */ + if (!*out) { + buffer = apr_palloc(block->pool, inlen + EVP_MAX_BLOCK_LENGTH); + if (!buffer) { + return APR_ENOMEM; + } + apr_crypto_clear(block->pool, buffer, inlen + EVP_MAX_BLOCK_LENGTH); + *out = buffer; } - apr_crypto_clear(ctx->pool, buffer, inlen + EVP_MAX_BLOCK_LENGTH); - *out = buffer; - } #if CRYPT_OPENSSL_CONST_BUFFERS - if (!EVP_EncryptUpdate(ctx->cipherCtx, (*out), &outl, in, inlen)) { + if (!EVP_EncryptUpdate(block->cipherCtx, (*out), &outl, in, inlen)) { #else - if (!EVP_EncryptUpdate(ctx->cipherCtx, (*out), &outl, - (unsigned char *) in, inlen)) { + if (!EVP_EncryptUpdate(block->cipherCtx, (*out), &outl, + (unsigned char *) in, inlen)) { #endif - EVP_CIPHER_CTX_reset(ctx->cipherCtx); - return APR_ECRYPT; + crypto_block_cleanup(block); + return APR_ECRYPT; + } + *outlen = outl; + + return APR_SUCCESS; + } - *outlen = outl; + default: { - return APR_SUCCESS; + return APR_EINVAL; + + } + } } @@ -709,20 +1036,33 @@ static apr_status_t crypto_block_encrypt(unsigned char **out, * @return APR_ENOTIMPL if not implemented. */ static apr_status_t crypto_block_encrypt_finish(unsigned char *out, - apr_size_t *outlen, apr_crypto_block_t *ctx) + apr_size_t *outlen, apr_crypto_block_t *block) { - apr_status_t rc = APR_SUCCESS; - int len = *outlen; + switch (block->key->rec->ktype) { + + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { + + apr_status_t rc = APR_SUCCESS; + int len = *outlen; + + if (EVP_EncryptFinal_ex(block->cipherCtx, out, &len) == 0) { + rc = APR_EPADDING; + } + else { + *outlen = len; + } + crypto_block_cleanup(block); + + return rc; - if (EVP_EncryptFinal_ex(ctx->cipherCtx, out, &len) == 0) { - rc = APR_EPADDING; - } - else { - *outlen = len; } - EVP_CIPHER_CTX_reset(ctx->cipherCtx); + default: { + + return APR_EINVAL; - return rc; + } + } } @@ -756,43 +1096,57 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, block->f = key->f; block->pool = p; block->provider = key->provider; + block->key = key; apr_pool_cleanup_register(p, block, crypto_block_cleanup_helper, apr_pool_cleanup_null); - /* create a new context for encryption */ - if (!block->initialised) { - block->cipherCtx = EVP_CIPHER_CTX_new(); - block->initialised = 1; - } + switch (key->rec->ktype) { - /* generate an IV, if necessary */ - if (key->ivSize) { - if (iv == NULL) { - return APR_ENOIV; + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { + + /* create a new context for encryption */ + if (!block->initialised) { + block->cipherCtx = EVP_CIPHER_CTX_new(); + block->initialised = 1; } - } - /* set up our encryption context */ + /* generate an IV, if necessary */ + if (key->ivSize) { + if (iv == NULL) { + return APR_ENOIV; + } + } + + /* set up our encryption context */ #if CRYPTO_OPENSSL_CONST_BUFFERS - if (!EVP_DecryptInit_ex(block->cipherCtx, key->cipher, config->engine, - key->key, iv)) { + if (!EVP_DecryptInit_ex(block->cipherCtx, key->cipher, config->engine, + key->key, iv)) { #else - if (!EVP_DecryptInit_ex(block->cipherCtx, key->cipher, config->engine, (unsigned char *) key->key, (unsigned char *) iv)) { + if (!EVP_DecryptInit_ex(block->cipherCtx, key->cipher, config->engine, (unsigned char *) key->key, (unsigned char *) iv)) { #endif - return APR_EINIT; - } + return APR_EINIT; + } - /* Clear up any read padding */ - if (!EVP_CIPHER_CTX_set_padding(block->cipherCtx, key->doPad)) { - return APR_EPADDING; - } + /* Clear up any read padding */ + if (!EVP_CIPHER_CTX_set_padding(block->cipherCtx, key->doPad)) { + return APR_EPADDING; + } + + if (blockSize) { + *blockSize = EVP_CIPHER_block_size(key->cipher); + } + + return APR_SUCCESS; - if (blockSize) { - *blockSize = EVP_CIPHER_block_size(key->cipher); } + default: { - return APR_SUCCESS; + return APR_EINVAL; + + } + } } @@ -816,39 +1170,53 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx, */ static apr_status_t crypto_block_decrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, - apr_crypto_block_t *ctx) + apr_crypto_block_t *block) { - int outl = *outlen; - unsigned char *buffer; + switch (block->key->rec->ktype) { - /* are we after the maximum size of the out buffer? */ - if (!out) { - *outlen = inlen + EVP_MAX_BLOCK_LENGTH; - return APR_SUCCESS; - } + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { - /* must we allocate the output buffer from a pool? */ - if (!(*out)) { - buffer = apr_palloc(ctx->pool, inlen + EVP_MAX_BLOCK_LENGTH); - if (!buffer) { - return APR_ENOMEM; + int outl = *outlen; + unsigned char *buffer; + + /* are we after the maximum size of the out buffer? */ + if (!out) { + *outlen = inlen + EVP_MAX_BLOCK_LENGTH; + return APR_SUCCESS; + } + + /* must we allocate the output buffer from a pool? */ + if (!(*out)) { + buffer = apr_palloc(block->pool, inlen + EVP_MAX_BLOCK_LENGTH); + if (!buffer) { + return APR_ENOMEM; + } + apr_crypto_clear(block->pool, buffer, inlen + EVP_MAX_BLOCK_LENGTH); + *out = buffer; } - apr_crypto_clear(ctx->pool, buffer, inlen + EVP_MAX_BLOCK_LENGTH); - *out = buffer; - } #if CRYPT_OPENSSL_CONST_BUFFERS - if (!EVP_DecryptUpdate(ctx->cipherCtx, *out, &outl, in, inlen)) { + if (!EVP_DecryptUpdate(block->cipherCtx, *out, &outl, in, inlen)) { #else - if (!EVP_DecryptUpdate(ctx->cipherCtx, *out, &outl, (unsigned char *) in, - inlen)) { + if (!EVP_DecryptUpdate(block->cipherCtx, *out, &outl, (unsigned char *) in, + inlen)) { #endif - EVP_CIPHER_CTX_reset(ctx->cipherCtx); - return APR_ECRYPT; + crypto_block_cleanup(block); + + return APR_ECRYPT; + } + *outlen = outl; + + return APR_SUCCESS; + } - *outlen = outl; + default: { - return APR_SUCCESS; + return APR_EINVAL; + + } + } } @@ -871,33 +1239,279 @@ static apr_status_t crypto_block_decrypt(unsigned char **out, * @return APR_ENOTIMPL if not implemented. */ static apr_status_t crypto_block_decrypt_finish(unsigned char *out, - apr_size_t *outlen, apr_crypto_block_t *ctx) + apr_size_t *outlen, apr_crypto_block_t *block) { - apr_status_t rc = APR_SUCCESS; - int len = *outlen; + switch (block->key->rec->ktype) { + + case APR_CRYPTO_KTYPE_PASSPHRASE: + case APR_CRYPTO_KTYPE_SECRET: { + + apr_status_t rc = APR_SUCCESS; + int len = *outlen; + + if (EVP_DecryptFinal_ex(block->cipherCtx, out, &len) == 0) { + rc = APR_EPADDING; + } + else { + *outlen = len; + } + crypto_block_cleanup(block); + + return rc; - if (EVP_DecryptFinal_ex(ctx->cipherCtx, out, &len) == 0) { - rc = APR_EPADDING; } - else { - *outlen = len; + default: { + + return APR_EINVAL; + } - EVP_CIPHER_CTX_reset(ctx->cipherCtx); + } + +} - return rc; +static apr_status_t crypto_digest_init(apr_crypto_digest_t **d, + const apr_crypto_key_t *key, apr_crypto_digest_rec_t *rec, apr_pool_t *p) +{ + apr_crypto_config_t *config = key->f->config; + apr_crypto_digest_t *digest = *d; + if (!digest) { + *d = digest = apr_pcalloc(p, sizeof(apr_crypto_digest_t)); + } + if (!digest) { + return APR_ENOMEM; + } + digest->f = key->f; + digest->pool = p; + digest->provider = key->provider; + digest->key = key; + digest->rec = rec; + + /* create a new context for digest */ + if (!digest->initialised) { + digest->mdCtx = EVP_MD_CTX_new(); + digest->initialised = 1; + } + + apr_pool_cleanup_register(p, digest, crypto_digest_cleanup_helper, + apr_pool_cleanup_null); + + switch (key->rec->ktype) { + + case APR_CRYPTO_KTYPE_HASH: { + + if (1 + != EVP_DigestInit_ex(digest->mdCtx, key->hmac, + config->engine)) { + return APR_EINIT; + } + + break; + } + case APR_CRYPTO_KTYPE_HMAC: + case APR_CRYPTO_KTYPE_CMAC: { + if (1 + != EVP_DigestSignInit(digest->mdCtx, NULL, key->hmac, + config->engine, key->pkey)) { + return APR_EINIT; + } + break; + } + default: { + return APR_EINVAL; + } + } + + return APR_SUCCESS; + +} + +static apr_status_t crypto_digest_update(apr_crypto_digest_t *digest, + const unsigned char *in, apr_size_t inlen) +{ + switch (digest->key->rec->ktype) { + + case APR_CRYPTO_KTYPE_HASH: { + + if (1 != EVP_DigestUpdate(digest->mdCtx, in, inlen)) { + crypto_digest_cleanup(digest); + return APR_ECRYPT; + } + + return APR_SUCCESS; + + } + + case APR_CRYPTO_KTYPE_HMAC: + case APR_CRYPTO_KTYPE_CMAC: { + + if (1 != EVP_DigestSignUpdate(digest->mdCtx, in, inlen)) { + crypto_digest_cleanup(digest); + return APR_ECRYPT; + } + + return APR_SUCCESS; + + } + default: { + return APR_EINVAL; + } + } + +} + +static apr_status_t crypto_digest_final(apr_crypto_digest_t *digest) +{ + + switch (digest->key->rec->ktype) { + + case APR_CRYPTO_KTYPE_HASH: { + + apr_status_t status = APR_SUCCESS; + + unsigned int len = EVP_MD_CTX_size(digest->mdCtx); + + switch (digest->rec->dtype) { + case APR_CRYPTO_DTYPE_HASH: { + + /* must we allocate the output buffer from a pool? */ + if (!digest->rec->d.hash.s || digest->rec->d.hash.slen != len) { + digest->rec->d.hash.slen = len; + digest->rec->d.hash.s = apr_palloc(digest->pool, len); + if (!digest->rec->d.hash.s) { + return APR_ENOMEM; + } + apr_crypto_clear(digest->pool, digest->rec->d.hash.s, len); + } + + /* then, determine the signature */ + if (EVP_DigestFinal_ex(digest->mdCtx, digest->rec->d.hash.s, &len) + == 0) { + status = APR_ECRYPT; + } + + break; + } + default: + status = APR_ENODIGEST; + } + + crypto_digest_cleanup(digest); + + return status; + + } + + case APR_CRYPTO_KTYPE_HMAC: + case APR_CRYPTO_KTYPE_CMAC: { + + apr_status_t status = APR_SUCCESS; + + size_t len; + + /* first, determine the signature length */ + if (1 != EVP_DigestSignFinal(digest->mdCtx, NULL, &len)) { + status = APR_ECRYPT; + } else { + + switch (digest->rec->dtype) { + case APR_CRYPTO_DTYPE_SIGN: { + + /* must we allocate the output buffer from a pool? */ + if (!digest->rec->d.sign.s || digest->rec->d.sign.slen != len) { + digest->rec->d.sign.slen = len; + digest->rec->d.sign.s = apr_palloc(digest->pool, len); + if (!digest->rec->d.sign.s) { + return APR_ENOMEM; + } + apr_crypto_clear(digest->pool, digest->rec->d.sign.s, len); + } + + /* then, determine the signature */ + if (EVP_DigestSignFinal(digest->mdCtx, digest->rec->d.sign.s, + &len) == 0) { + status = APR_ECRYPT; + } + + break; + } + case APR_CRYPTO_DTYPE_VERIFY: { + + /* must we allocate the output buffer from a pool? */ + if (!digest->rec->d.verify.s + || digest->rec->d.verify.slen != len) { + digest->rec->d.verify.slen = len; + digest->rec->d.verify.s = apr_palloc(digest->pool, len); + if (!digest->rec->d.verify.s) { + return APR_ENOMEM; + } + apr_crypto_clear(digest->pool, digest->rec->d.verify.s, + len); + } + + /* then, determine the signature */ + if (EVP_DigestSignFinal(digest->mdCtx, digest->rec->d.verify.s, + &len) == 0) { + status = APR_ECRYPT; + } else if (digest->rec->d.verify.slen + == digest->rec->d.verify.vlen) { + status = + CRYPTO_memcmp(digest->rec->d.verify.s, + digest->rec->d.verify.v, + digest->rec->d.verify.slen) ? + APR_ENOVERIFY : APR_SUCCESS; + } else { + status = APR_ENOVERIFY; + } + + break; + } + default: + status = APR_ENODIGEST; + } + + } + + crypto_digest_cleanup(digest); + + return status; + + } + default: { + return APR_EINVAL; + } + } + +} + +static apr_status_t crypto_digest( + const apr_crypto_key_t *key, apr_crypto_digest_rec_t *rec, const unsigned char *in, + apr_size_t inlen, apr_pool_t *p) +{ + apr_crypto_digest_t *digest = NULL; + apr_status_t status = APR_SUCCESS; + + status = crypto_digest_init(&digest, key, rec, p); + if (APR_SUCCESS == status) { + status = crypto_digest_update(digest, in, inlen); + if (APR_SUCCESS == status) { + status = crypto_digest_final(digest); + } + } + return status; } /** * OpenSSL module. */ APR_MODULE_DECLARE_DATA const apr_crypto_driver_t apr_crypto_openssl_driver = { - "openssl", crypto_init, crypto_make, crypto_get_block_key_types, + "openssl", crypto_init, crypto_make, crypto_get_block_key_digests, crypto_get_block_key_types, crypto_get_block_key_modes, crypto_passphrase, crypto_block_encrypt_init, crypto_block_encrypt, crypto_block_encrypt_finish, crypto_block_decrypt_init, crypto_block_decrypt, crypto_block_decrypt_finish, - crypto_block_cleanup, crypto_cleanup, crypto_shutdown, crypto_error, + crypto_digest_init, crypto_digest_update, crypto_digest_final, crypto_digest, + crypto_block_cleanup, crypto_digest_cleanup, crypto_cleanup, crypto_shutdown, crypto_error, crypto_key }; diff --git a/include/apr_crypto.h b/include/apr_crypto.h index bc92b31b5c4..14ea44d51cd 100644 --- a/include/apr_crypto.h +++ b/include/apr_crypto.h @@ -42,17 +42,31 @@ extern "C" { #ifndef APU_CRYPTO_RECOMMENDED_DRIVER #if APU_HAVE_COMMONCRYPTO +/** Recommended driver for this platform */ #define APU_CRYPTO_RECOMMENDED_DRIVER "commoncrypto" -#elif APU_HAVE_OPENSSL +#else +#if APU_HAVE_OPENSSL +/** Recommended driver for this platform */ #define APU_CRYPTO_RECOMMENDED_DRIVER "openssl" -#elif APU_HAVE_NSS +#else +#if APU_HAVE_NSS +/** Recommended driver for this platform */ #define APU_CRYPTO_RECOMMENDED_DRIVER "nss" -#elif APU_HAVE_MSCNG +#else +#if APU_HAVE_MSCNG +/** Recommended driver for this platform */ #define APU_CRYPTO_RECOMMENDED_DRIVER "mscng" -#elif APU_HAVE_MSCAPI +#else +#if APU_HAVE_MSCAPI +/** Recommended driver for this platform */ #define APU_CRYPTO_RECOMMENDED_DRIVER "mscapi" +#else +#endif +#endif +#endif +#endif +#endif #endif -#endif /* APU_CRYPTO_RECOMMENDED_DRIVER */ /** * Symmetric Key types understood by the library. @@ -95,6 +109,9 @@ extern "C" { * aligned data, use 3DES_192/CBC, AES_256/CBC or AES_256/ECB. */ +/** + * Types of ciphers. + */ typedef enum { APR_KEY_NONE, APR_KEY_3DES_192, /** 192 bit (3-Key) 3DES */ @@ -104,6 +121,9 @@ typedef enum /** 256 bit AES */ } apr_crypto_block_key_type_e; +/** + * Types of modes supported by the ciphers. + */ typedef enum { APR_MODE_NONE, /** An error condition */ @@ -112,55 +132,369 @@ typedef enum /** Cipher Block Chaining */ } apr_crypto_block_key_mode_e; -/* These are opaque structs. Instantiation is up to each backend */ +/** + * Types of digests supported by the apr_crypto_key() function. + */ +typedef enum +{ + APR_CRYPTO_DIGEST_NONE, /** An error condition */ + APR_CRYPTO_DIGEST_MD5, /** MD5 */ + APR_CRYPTO_DIGEST_SHA1, /** SHA1 */ + APR_CRYPTO_DIGEST_SHA224, /** SHA224 */ + APR_CRYPTO_DIGEST_SHA256, /** SHA256 */ + APR_CRYPTO_DIGEST_SHA384, /** SHA384 */ + APR_CRYPTO_DIGEST_SHA512, /** SHA512 */ +} apr_crypto_block_key_digest_e; + +/** + * Structure returned by the crypto_get_block_key_digests() function. + */ +typedef struct apr_crypto_block_key_digest_t { + /** The digest used with this crypto operation. */ + apr_crypto_block_key_digest_e type; + /** The digest size used with this digest operation */ + int digestsize; + /** The block size used with this digest operation */ + int blocksize; +} apr_crypto_block_key_digest_t; + +/** + * Structure representing a backend crypto driver. + * + * This structure is created with apr_crypto_get_driver(). + */ typedef struct apr_crypto_driver_t apr_crypto_driver_t; + +/** + * Structure to support a group of crypto operations. + * + * This structure is created with apr_crypto_make(). + */ typedef struct apr_crypto_t apr_crypto_t; + +/** + * Structure representing the configuration of the given backend + * crypto library. + */ typedef struct apr_crypto_config_t apr_crypto_config_t; + +/** + * Structure representing a key prepared for encryption, decryption, + * signing or verifying. + * + * This structure is created using the apr_crypto_key() function. + */ typedef struct apr_crypto_key_t apr_crypto_key_t; + +/** + * Structure representing a block context for encryption, decryption, + * signing or verifying. + * + * This structure is created using the apr_crypto_block_encrypt_init() + * and apr_crypto_block_decrypt_init() functions. + */ typedef struct apr_crypto_block_t apr_crypto_block_t; +/** + * Structure representing a digest context for signing or verifying. + * + * This structure is created using the apr_crypto_digest_init() function. + */ +typedef struct apr_crypto_digest_t apr_crypto_digest_t; + +/** + * Structure returned by the crypto_get_block_key_types() function. + */ typedef struct apr_crypto_block_key_type_t { + /** The cipher used with this crypto operation. */ apr_crypto_block_key_type_e type; + /** The key size used with this crypto operation */ int keysize; + /** The block size used with this crypto operation */ int blocksize; + /** The initialisation vector size used with this crypto operation */ int ivsize; } apr_crypto_block_key_type_t; +/** + * Structure returned by the crypto_get_block_key_modes() function. + */ typedef struct apr_crypto_block_key_mode_t { + /** The mode used with this crypto operation. */ apr_crypto_block_key_mode_e mode; } apr_crypto_block_key_mode_t; +/** + * Structure describing a key to be derived from PBKDF2 to be passed by the + * apr_crypto_key() function. + * + * Derived keys are used for encryption and decryption. + * + * Implementations must use apr_crypto_key_rec_make() to allocate + * this structure. + */ typedef struct apr_crypto_passphrase_t { + /** The passphrase used by the key generation algorithm */ const char *pass; + /** The length of the passphrase */ apr_size_t passLen; + /** The salt used by the key derivation algorithm */ const unsigned char * salt; + /** The length of the salt. */ apr_size_t saltLen; + /** The number of iterations used by the key derivation function */ int iterations; } apr_crypto_passphrase_t; +/** + * Structure describing a raw key to be passed by the + * apr_crypto_key() function. + * + * Raw keys are used for encryption and decryption, and must match + * the correct sizes for each cipher. + * + * Implementations must use apr_crypto_key_rec_make() to allocate + * this structure. + */ typedef struct apr_crypto_secret_t { + /** The raw secret key used for encrypt / decrypt. Must be + * the same size as the block size of the cipher being used. + */ const unsigned char *secret; + /** The length of the secret key. */ apr_size_t secretLen; } apr_crypto_secret_t; +/** + * Structure describing a simple digest hash to be generated by the + * apr_crypto_key() function. + * + * Implementations must use apr_crypto_key_rec_make() to allocate + * this structure. + */ +typedef struct apr_crypto_key_hash_t { + /** The digest used for the HMAC. */ + apr_crypto_block_key_digest_e digest; +} apr_crypto_key_hash_t; + +/** + * Structure describing a HMAC key and digest to be generated by the + * apr_crypto_key() function. + * + * Implementations must use apr_crypto_key_rec_make() to allocate + * this structure. + */ +typedef struct apr_crypto_key_hmac_t { + /** The secret used for the HMAC */ + const unsigned char *secret; + /** The length of the secret used for the HMAC */ + apr_size_t secretLen; + /** The digest used for the HMAC. */ + apr_crypto_block_key_digest_e digest; +} apr_crypto_key_hmac_t; + +/** + * Structure describing a CMAC key and digest to be generated by the + * apr_crypto_key() function. + * + * Implementations must use apr_crypto_key_rec_make() to allocate + * this structure. + */ +typedef struct apr_crypto_key_cmac_t { + /** The secret used for the CMAC */ + const unsigned char *secret; + /** The length of the secret used for the CMAC */ + apr_size_t secretLen; + /** The digest used for the CMAC. */ + apr_crypto_block_key_digest_e digest; +} apr_crypto_key_cmac_t; + +/** + * Structure used to create a hashed digest. + * + * Implementations must use apr_crypto_digest_rec_make() to allocate + * this structure. + */ +typedef struct apr_crypto_digest_hash_t { + /** The message digest */ + unsigned char *s; + /** The length of the message digest */ + apr_size_t slen; + /** The digest algorithm */ + apr_crypto_block_key_digest_e digest; +} apr_crypto_digest_hash_t; + +/** + * Structure used to create a signature. + * + * Implementations must use apr_crypto_digest_rec_make() to allocate + * this structure. + */ +typedef struct apr_crypto_digest_sign_t { + /** The message digest */ + unsigned char *s; + /** The length of the message digest */ + apr_size_t slen; + /** The digest algorithm */ + apr_crypto_block_key_digest_e digest; +} apr_crypto_digest_sign_t; + +/** + * Structure used to create a signature for verification. + * + * Implementations must use apr_crypto_digest_rec_make() to allocate + * this structure. + */ +typedef struct apr_crypto_digest_verify_t { + /** The message digest generated */ + unsigned char *s; + /** The length of the message digest */ + apr_size_t slen; + /** The message digest to be verified against */ + const unsigned char *v; + /** The length of the message digest */ + apr_size_t vlen; + /** The digest algorithm */ + apr_crypto_block_key_digest_e digest; +} apr_crypto_digest_verify_t; + +/** + * Types of keys supported by the apr_crypto_key() function and the + * apr_crypto_key_rec_t structure. + */ typedef enum { - /** Key is derived from a passphrase */ + /** + * Key is derived from a passphrase. + * + * Used with the encrypt / decrypt functions. + */ APR_CRYPTO_KTYPE_PASSPHRASE = 1, - /** Key is derived from a raw key */ - APR_CRYPTO_KTYPE_SECRET = 2, + /** + * Key is derived from a raw key. + * + * Used with the encrypt / decrypt functions. + */ + APR_CRYPTO_KTYPE_SECRET = 2, + /** + * Simple digest, no key. + * + * Used with the digest functions. + */ + APR_CRYPTO_KTYPE_HASH = 3, + /** + * HMAC Key is derived from a raw key. + * + * Used with the digest functions. + */ + APR_CRYPTO_KTYPE_HMAC = 4, + /** + * CMAC Key is derived from a raw key. + * + * Used with the digest functions. + */ + APR_CRYPTO_KTYPE_CMAC = 5, } apr_crypto_key_type; +/** + * Types of digests supported by the apr_crypto_digest() functions and the + * apr_crypto_digest_rec_t structure. + */ +typedef enum { + /** + * Simple digest operation. + * + * Use with apr_crypto_key_rec_t APR_CRYPTO_KTYPE_HASH. + */ + APR_CRYPTO_DTYPE_HASH = 1, + /** + * Sign operation. + * + * Use with apr_crypto_key_rec_t APR_CRYPTO_KTYPE_HMAC or + * APR_CRYPTO_KTYPE_CMAC. + */ + APR_CRYPTO_DTYPE_SIGN = 2, + /** + * Verify operation. + * + * Use with apr_crypto_key_rec_t APR_CRYPTO_KTYPE_HMAC or + * APR_CRYPTO_KTYPE_CMAC. + */ + APR_CRYPTO_DTYPE_VERIFY = 3, +} apr_crypto_digest_type_e; + +/** + * Structure describing a key to be generated by the + * apr_crypto_key() function. + * + * Implementations must use apr_crypto_key_rec_make() to allocate + * this structure. + */ typedef struct apr_crypto_key_rec_t { + /** The type of the key. */ apr_crypto_key_type ktype; + /** The cipher used with this crypto operation. */ apr_crypto_block_key_type_e type; + /** The mode used with this crypto operation. */ apr_crypto_block_key_mode_e mode; + /** Non zero if padding should be used with this crypto operation. */ int pad; + /** Details of each key, based on the key type. */ union { + /** + * This key is generated using a PBE algorithm from a given + * passphrase, and can be used to encrypt / decrypt. + * + * Key type: APR_CRYPTO_KTYPE_PASSPHRASE + */ apr_crypto_passphrase_t passphrase; + /** + * This is a raw key matching the block size of the given + * cipher, and can be used to encrypt / decrypt. + * + * Key type: APR_CRYPTO_KTYPE_SECRET + */ apr_crypto_secret_t secret; + /** + * This represents a simple digest with no key. + * + * Key type: APR_CRYPTO_KTYPE_HASH + */ + apr_crypto_key_hash_t hash; + /** + * This is a key of arbitrary length used with an HMAC. + * + * Key type: APR_CRYPTO_KTYPE_HMAC + */ + apr_crypto_key_hmac_t hmac; + /** + * This is a key of arbitrary length used with a CMAC. + * + * Key type: APR_CRYPTO_KTYPE_CMAC + */ + apr_crypto_key_cmac_t cmac; } k; } apr_crypto_key_rec_t; +/** + * Structure describing a digest to be hashed, signed or verified. + * + * This structure is passed to the apr_crypto_digest_init() and + * apr_crypto_digest() functions. + * + * Implementations must use apr_crypto_digest_rec_make() to allocate + * this structure. + */ +typedef struct apr_crypto_digest_rec_t { + /** The type of the digest record. */ + apr_crypto_digest_type_e dtype; + /** Details of each digest, based on the digest type. */ + union { + apr_crypto_digest_hash_t hash; + apr_crypto_digest_sign_t sign; + apr_crypto_digest_verify_t verify; + } d; +} apr_crypto_digest_rec_t; + /** * @brief Perform once-only initialisation. Call once only. * @@ -229,8 +563,9 @@ APR_DECLARE(int) apr_crypto_equals(const void *buf1, const void *buf2, * @remarks OpenSSL: currently no params are supported. */ APR_DECLARE(apr_status_t) apr_crypto_get_driver( - const apr_crypto_driver_t **driver, const char *name, - const char *params, const apu_err_t **result, apr_pool_t *pool); + const apr_crypto_driver_t **driver, + const char *name, const char *params, const apu_err_t **result, + apr_pool_t *pool); /** * @brief Return the name of the driver. @@ -266,9 +601,21 @@ APR_DECLARE(apr_status_t) apr_crypto_error(const apu_err_t **result, * @remarks OpenSSL: the params can have "engine" as a key, followed by an equal * sign and a value. */ -APR_DECLARE(apr_status_t) - apr_crypto_make(apr_crypto_t **f, const apr_crypto_driver_t *driver, - const char *params, apr_pool_t *pool); +APR_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, + const apr_crypto_driver_t *driver, const char *params, + apr_pool_t *pool); + +/** + * @brief Get a hash table of key digests, keyed by the name of the digest against + * a pointer to apr_crypto_block_key_digest_t, which in turn begins with an + * integer. + * + * @param digests - hashtable of key digests keyed to constants. + * @param f - encryption context + * @return APR_SUCCESS for success + */ +APR_DECLARE(apr_status_t) apr_crypto_get_block_key_digests(apr_hash_t **digests, + const apr_crypto_t *f); /** * @brief Get a hash table of key types, keyed by the name of the type against @@ -294,21 +641,43 @@ APR_DECLARE(apr_status_t) apr_crypto_get_block_key_types(apr_hash_t **types, APR_DECLARE(apr_status_t) apr_crypto_get_block_key_modes(apr_hash_t **modes, const apr_crypto_t *f); +/** + * @brief Create a key record to be passed to apr_crypto_key(). + * @param ktype The apr_crypto_key_type to use. + * @param p The pool to use. + * @return Returns a blank structure of the correct size. + */ +APR_DECLARE(apr_crypto_key_rec_t *) apr_crypto_key_rec_make( + apr_crypto_key_type ktype, apr_pool_t *p); + +/** + * @brief Create a digest record to be passed to apr_crypto_digest_init(). + * @param dtype The type of digest record to create. + * @param p The pool to use. + * @return Returns a blank structure of the correct size. + */ +APR_DECLARE(apr_crypto_digest_rec_t *) apr_crypto_digest_rec_make( + apr_crypto_digest_type_e dtype, apr_pool_t *p); + /** * @brief Create a key from the provided secret or passphrase. The key is cleaned - * up when the context is cleaned, and may be reused with multiple encryption - * or decryption operations. + * up when the context is cleaned, and may be reused with multiple + * encryption, decryption, signing or verifying operations. The choice of + * key type much match the intended operation. * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If * *key is not NULL, *key must point at a previously created structure. * @param key The key returned, see note. * @param rec The key record, from which the key will be derived. * @param f The context to use. * @param p The pool to use. - * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend - * error occurred while generating the key. APR_ENOCIPHER if the type or mode - * is not supported by the particular backend. APR_EKEYTYPE if the key type is - * not known. APR_EPADDING if padding was requested but is not supported. - * APR_ENOTIMPL if not implemented. + * @return APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. + * @return APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. + * @return APR_EKEYTYPE if the key type is + * not known. + * @return APR_EPADDING if padding was requested but is not supported. + * @return APR_ENOTIMPL if not implemented. */ APR_DECLARE(apr_status_t) apr_crypto_key(apr_crypto_key_t **key, const apr_crypto_key_rec_t *rec, const apr_crypto_t *f, apr_pool_t *p); @@ -335,11 +704,14 @@ APR_DECLARE(apr_status_t) apr_crypto_key(apr_crypto_key_t **key, * @param iterations Number of iterations to use in algorithm * @param f The context to use. * @param p The pool to use. - * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend - * error occurred while generating the key. APR_ENOCIPHER if the type or mode - * is not supported by the particular backend. APR_EKEYTYPE if the key type is - * not known. APR_EPADDING if padding was requested but is not supported. - * APR_ENOTIMPL if not implemented. + * @return APR_ENOKEY if the pass phrase is missing or empty, or if a backend + * error occurred while generating the key. + * @return APR_ENOCIPHER if the type or mode + * is not supported by the particular backend. + * @return APR_EKEYTYPE if the key type is + * not known. + * @return APR_EPADDING if padding was requested but is not supported. + * @return APR_ENOTIMPL if not implemented. * @deprecated Replaced by apr_crypto_key(). */ APR_DECLARE(apr_status_t) apr_crypto_passphrase(apr_crypto_key_t **key, @@ -361,9 +733,10 @@ APR_DECLARE(apr_status_t) apr_crypto_passphrase(apr_crypto_key_t **key, * @param key The key structure to use. * @param blockSize The block size of the cipher. * @param p The pool to use. - * @return Returns APR_ENOIV if an initialisation vector is required but not specified. - * Returns APR_EINIT if the backend failed to initialise the context. Returns - * APR_ENOTIMPL if not implemented. + * @return APR_ENOIV if an initialisation vector is required but not specified. + * @return APR_EINIT if the backend failed to initialise the context. + * @return APR_ENOTIMPL if not implemented. + * @return APR_EINVAL if the key type does not support the given operation. */ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init( apr_crypto_block_t **ctx, const unsigned char **iv, @@ -384,8 +757,9 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_init( * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. * @param ctx The block context to use. - * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if - * not implemented. + * @return APR_ECRYPT if an error occurred. + * @return APR_ENOTIMPL if not implemented. + * @return APR_EINVAL if the key type does not support the given operation. */ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, @@ -401,13 +775,14 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt(unsigned char **out, * is cleaned and can be reused by apr_crypto_block_encrypt_init(). * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same - * buffer used by apr_evp_crypt(). See note. + * buffer used by apr_crypto_block_encrypt(). See note. * @param outlen Length of the output will be written here. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. + * @return APR_EINVAL if the key type does not support the given operation. */ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(unsigned char *out, apr_size_t *outlen, apr_crypto_block_t *ctx); @@ -421,9 +796,10 @@ APR_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(unsigned char *out, * @param iv Optional initialisation vector. * @param key The key structure to use. * @param p The pool to use. - * @return Returns APR_ENOIV if an initialisation vector is required but not specified. - * Returns APR_EINIT if the backend failed to initialise the context. Returns - * APR_ENOTIMPL if not implemented. + * @return APR_ENOIV if an initialisation vector is required but not specified. + * @return APR_EINIT if the backend failed to initialise the context. + * @return APR_ENOTIMPL if not implemented. + * @return APR_EINVAL if the key type does not support the given operation. */ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init( apr_crypto_block_t **ctx, apr_size_t *blockSize, @@ -444,8 +820,9 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_init( * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. * @param ctx The block context to use. - * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if - * not implemented. + * @return APR_ECRYPT if an error occurred. + * @return APR_ENOTIMPL if not implemented. + * @return APR_EINVAL if the key type does not support the given operation. */ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, @@ -461,13 +838,14 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt(unsigned char **out, * is cleaned and can be reused by apr_crypto_block_decrypt_init(). * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same - * buffer used by apr_evp_crypt(). See note. + * buffer used by apr_crypto_block_decrypt(). See note. * @param outlen Length of the output will be written here. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. + * @return APR_EINVAL if the key type does not support the given operation. */ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish(unsigned char *out, apr_size_t *outlen, apr_crypto_block_t *ctx); @@ -480,6 +858,103 @@ APR_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish(unsigned char *out, */ APR_DECLARE(apr_status_t) apr_crypto_block_cleanup(apr_crypto_block_t *ctx); +/** + * @brief Initialise a context for hashing, signing or verifying arbitrary + * data. + * + * This function supports: + * - Simple hashing (MD5, SHA1, SHA224, SHA256, SHA384, SHA512). + * - HMAC (with a secret key) + * - CMAC (with a secret key) + * + * Details of the key and the type of digest to be performed are + * passed in the constant apr_crypto_key_t structure, which can be + * reused by many calls to apr_crypto_digest_init(). + * + * Details of this particular operation are read from and written to + * the apr_crypto_digest_rec_t structure, which is expected to + * contain the message digest to be verified, as well as message + * digest generated during the hashing or signing process. This + * structure will be modified by each digest operation, and cannot be + * shared. + * @note If *d is NULL, a apr_crypto_digest_t will be created from a pool. If + * *d is not NULL, *d must point at a previously created structure. + * @param d The digest context returned, see note. + * @param key The key structure to use. + * @param rec The digest record indicating whether we want to sign or verify. + * This record contains digest we want to verify against, as well as + * the signature we have generated. + * @param p The pool to use. + * @return APR_SUCCESS if successful. + * @return APR_ENOIV if an initialisation vector is required but not specified. + * @return APR_EINIT if the backend failed to initialise the context. + * @return APR_ENOTIMPL if not implemented. + * @return APR_EINVAL if the key type does not support the given operation. + */ +APR_DECLARE(apr_status_t) apr_crypto_digest_init(apr_crypto_digest_t **d, + const apr_crypto_key_t *key, apr_crypto_digest_rec_t *rec, apr_pool_t *p); + +/** + * @brief Update the digest with data provided by in. + * @param digest The block context to use. + * @param in Address of the buffer to digest. + * @param inlen Length of the buffer to digest. + * @return APR_SUCCESS if successful. + * @return APR_ECRYPT if an error occurred. + * @return APR_ENOTIMPL if not implemented. + * @return APR_EINVAL if the key type does not support the given operation. + */ +APR_DECLARE(apr_status_t) apr_crypto_digest_update(apr_crypto_digest_t *digest, + const unsigned char *in, apr_size_t inlen); + +/** + * @brief Finalise the digest and write the result. + * + * The result is written to the apr_crypto_digest_rec_t structure + * passed into apr_crypto_digest_init(). + * + * If verification is requested, this function will return the + * result of the verification. + * @note After this call, the context is cleaned and can be reused by + * apr_crypto_digest_init(). + * @param digest The digest context to use. + * @return APR_SUCCESS if hash, signing or verification was successful. + * @return APR_ENOVERIFY if the verification failed. + * @return APR_ECRYPT if an error occurred. + * @return APR_EPADDING if padding was enabled and the block was incorrectly + * formatted. + * @return APR_ENOTIMPL if not implemented. + * @return APR_EINVAL if the key type does not support the given operation. + */ +APR_DECLARE(apr_status_t) apr_crypto_digest_final(apr_crypto_digest_t *digest); + +/** + * @brief One shot digest on a single memory buffer. + * @param key The key structure to use. + * @param rec The digest record indicating whether we want to sign or verify. + * This record contains digest we want to verify against, as well as + * the signature we have generated. This record will contain the digest + * calculated. + * @param in Address of the buffer to digest. + * @param inlen Length of the buffer to digest. + * @param p The pool to use. + * @return APR_ENOIV if an initialisation vector is required but not specified. + * @return APR_EINIT if the backend failed to initialise the context. + * @return APR_ENOTIMPL if not implemented. + * @return APR_EINVAL if the key type does not support the given operation. + */ +APR_DECLARE(apr_status_t) apr_crypto_digest(const apr_crypto_key_t *key, + apr_crypto_digest_rec_t *rec, const unsigned char *in, apr_size_t inlen, + apr_pool_t *p); + +/** + * @brief Clean digest context. + * @note After cleanup, a digest context is free to be reused if necessary. + * @param ctx The digest context to use. + * @return Returns APR_ENOTIMPL if not supported. + */ +APR_DECLARE(apr_status_t) apr_crypto_digest_cleanup(apr_crypto_digest_t *ctx); + /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. @@ -494,9 +969,8 @@ APR_DECLARE(apr_status_t) apr_crypto_cleanup(apr_crypto_t *f); * @param driver - driver to use * @return Returns APR_ENOTIMPL if not supported. */ -APR_DECLARE(apr_status_t) - apr_crypto_shutdown(const apr_crypto_driver_t *driver); - +APR_DECLARE(apr_status_t) apr_crypto_shutdown( + const apr_crypto_driver_t *driver); #if APU_HAVE_CRYPTO_PRNG diff --git a/include/apu_errno.h b/include/apu_errno.h index 58585b71483..7d967add6f1 100644 --- a/include/apu_errno.h +++ b/include/apu_errno.h @@ -51,6 +51,7 @@ extern "C" { * APR_ENOENGINE The engine provided was not recognised * APR_EINITENGINE The engine could not be initialised * APR_EREINIT Underlying crypto has already been initialised + * APR_ENOVERIFY The signature verification failed * * *

    @@ -83,6 +84,8 @@ extern "C" {
     #define APR_EINITENGINE      (APR_UTIL_START_STATUS + 11)
     /** @see APR_STATUS_IS_EREINIT */
     #define APR_EREINIT          (APR_UTIL_START_STATUS + 12)
    +/** @see APR_STATUS_IS_ENOVERIFY */
    +#define APR_ENOVERIFY        (APR_UTIL_START_STATUS + 13)
     /** @} */
     
     /**
    @@ -151,6 +154,10 @@ extern "C" {
      * Crypto has already been initialised
      */
     #define APR_STATUS_IS_EREINIT(s)        ((s) == APR_EREINIT)
    +/**
    + * The signature verification failed
    + */
    +#define APR_STATUS_IS_ENOVERIFY(s)        ((s) == APR_ENOVERIFY)
     /** @} */
     
     /**
    diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h
    index 77581bd156f..936d6dc504d 100644
    --- a/include/private/apr_crypto_internal.h
    +++ b/include/private/apr_crypto_internal.h
    @@ -57,6 +57,17 @@ struct apr_crypto_driver_t {
         apr_status_t (*make)(apr_crypto_t **f, const apr_crypto_driver_t *provider,
                 const char *params, apr_pool_t *pool);
     
    +    /**
    +     * @brief Get a hash table of key digests, keyed by the name of the digest against
    +     * a pointer to apr_crypto_block_key_digest_t.
    +     *
    +     * @param digests - hashtable of key digests keyed to constants.
    +     * @param f - encryption context
    +     * @return APR_SUCCESS for success
    +     */
    +    apr_status_t (*get_block_key_digests)(apr_hash_t **types,
    +            const apr_crypto_t *f);
    +
         /**
          * @brief Get a hash table of key types, keyed by the name of the type against
          * a pointer to apr_crypto_block_key_type_t.
    @@ -236,6 +247,64 @@ struct apr_crypto_driver_t {
         apr_status_t (*block_decrypt_finish)(unsigned char *out,
                 apr_size_t *outlen, apr_crypto_block_t *ctx);
     
    +    /**
    +     * @brief Initialise a context for signing or verifying arbitrary data using the
    +     *        given key.
    +     * @note If *d is NULL, a apr_crypto_digest_t will be created from a pool. If
    +     *       *d is not NULL, *d must point at a previously created structure.
    +     * @param d The digest context returned, see note.
    +     * @param key The key structure to use.
    +     * @param rec The digest record.
    +     * @param p The pool to use.
    +     * @return APR_ENOIV if an initialisation vector is required but not specified.
    +     * @return APR_EINIT if the backend failed to initialise the context.
    +     * @return APR_ENOTIMPL if not implemented.
    +     * @return APR_NOKEY if the key type does not support the given operation.
    +     */
    +    apr_status_t (*digest_init)(apr_crypto_digest_t **d,
    +            const apr_crypto_key_t *key, apr_crypto_digest_rec_t *rec, apr_pool_t *p);
    +
    +    /**
    +     * @brief Update the digest with data provided by in.
    +     * @param in Address of the buffer to read.
    +     * @param inlen Length of the buffer to read.
    +     * @param digest The digest context to use.
    +     * @return APR_ECRYPT if an error occurred.
    +     * @return APR_ENOTIMPL if not implemented.
    +     * @return APR_NOKEY if the key type does not support the given operation.
    +     */
    +    apr_status_t (*digest_update)(apr_crypto_digest_t *digest,
    +            const unsigned char *in, apr_size_t inlen);
    +
    +    /**
    +     * @brief Finalise the digest and write the result.
    +     * @note After this call, the context is cleaned and can be reused by
    +     *   apr_crypto_digest_init().
    +     * @param digest The digest context to use.
    +     * @return APR_ECRYPT if an error occurred.
    +     * @return APR_EPADDING if padding was enabled and the block was incorrectly
    +     *         formatted.
    +     * @return APR_ENOTIMPL if not implemented.
    +     * @return APR_NOKEY if the key type does not support the given operation.
    +     */
    +    apr_status_t (*digest_final)(apr_crypto_digest_t *digest);
    +
    +    /**
    +     * @brief One shot digest on a single memory buffer.
    +     * @param key The key structure to use.
    +     * @param rec The digest record.
    +     * @param in Address of the buffer to digest.
    +     * @param inlen Length of the buffer to digest.
    +     * @param p The pool to use.
    +     * @return APR_ENOIV if an initialisation vector is required but not specified.
    +     * @return APR_EINIT if the backend failed to initialise the context.
    +     * @return APR_ENOTIMPL if not implemented.
    +     * @return APR_NOKEY if the key type does not support the given operation.
    +     */
    +    apr_status_t (*digest)(const apr_crypto_key_t *key,
    +            apr_crypto_digest_rec_t *rec, const unsigned char *in,
    +            apr_size_t inlen, apr_pool_t *p);
    +
         /**
          * @brief Clean encryption / decryption context.
          * @note After cleanup, a context is free to be reused if necessary.
    @@ -244,6 +313,14 @@ struct apr_crypto_driver_t {
          */
         apr_status_t (*block_cleanup)(apr_crypto_block_t *ctx);
     
    +    /**
    +     * @brief Clean sign / verify context.
    +     * @note After cleanup, a context is free to be reused if necessary.
    +     * @param ctx The digest context to use.
    +     * @return Returns APR_ENOTIMPL if not supported.
    +     */
    +    apr_status_t (*digest_cleanup)(apr_crypto_digest_t *ctx);
    +
         /**
          * @brief Clean encryption / decryption context.
          * @note After cleanup, a context is free to be reused if necessary.
    diff --git a/test/testcrypto.c b/test/testcrypto.c
    index bfcb7366571..9261d1887cd 100644
    --- a/test/testcrypto.c
    +++ b/test/testcrypto.c
    @@ -113,6 +113,117 @@ static apr_crypto_t *make(abts_case *tc, apr_pool_t *pool,
     
     }
     
    +static const apr_crypto_key_t *keyhash(abts_case *tc, apr_pool_t *pool,
    +        const apr_crypto_driver_t *driver, const apr_crypto_t *f,
    +        apr_crypto_block_key_digest_e digest, const char *description)
    +{
    +    apr_crypto_key_t *key = NULL;
    +    const apu_err_t *result = NULL;
    +    apr_crypto_key_rec_t *rec = apr_crypto_key_rec_make(APR_CRYPTO_KTYPE_HASH,
    +            pool);
    +    apr_status_t rv;
    +
    +    if (!driver) {
    +        return NULL;
    +    }
    +
    +    if (!f) {
    +        return NULL;
    +    }
    +
    +    rec->k.hash.digest = digest;
    +
    +    /* init the key */
    +    rv = apr_crypto_key(&key, rec, f, pool);
    +    if (APR_ENOCIPHER == rv || APR_ENODIGEST == rv) {
    +        apr_crypto_error(&result, f);
    +        ABTS_NOT_IMPL(tc,
    +                apr_psprintf(pool, "skipped: %s %s key return APR_ENOTIMPL: error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", result->msg ? result->msg : ""));
    +        return NULL;
    +    }
    +    else {
    +        if (APR_SUCCESS != rv) {
    +            apr_crypto_error(&result, f);
    +            fprintf(stderr, "key: %s %s apr error %d / native error %d: %s (%s)\n",
    +                    description, apr_crypto_driver_name(driver), rv, result->rc,
    +                    result->reason ? result->reason : "",
    +                    result->msg ? result->msg : "");
    +        }
    +        ABTS_ASSERT(tc, "apr_crypto_key returned APR_EKEYLENGTH", rv != APR_EKEYLENGTH);
    +        ABTS_ASSERT(tc, "apr_crypto_key returned APR_ENOKEY", rv != APR_ENOKEY);
    +        ABTS_ASSERT(tc, "apr_crypto_key returned APR_EPADDING",
    +                rv != APR_EPADDING);
    +        ABTS_ASSERT(tc, "apr_crypto_key returned APR_EKEYTYPE",
    +                rv != APR_EKEYTYPE);
    +        ABTS_ASSERT(tc, "failed to apr_crypto_key", rv == APR_SUCCESS);
    +        ABTS_ASSERT(tc, "apr_crypto_key returned NULL context", key != NULL);
    +    }
    +    if (rv) {
    +        return NULL;
    +    }
    +    return key;
    +
    +}
    +
    +static const apr_crypto_key_t *keyhmac(abts_case *tc, apr_pool_t *pool,
    +        const apr_crypto_driver_t *driver, const apr_crypto_t *f,
    +        apr_crypto_block_key_digest_e digest, apr_crypto_block_key_type_e type,
    +        apr_crypto_block_key_mode_e mode, int doPad, apr_size_t secretLen,
    +        const char *description)
    +{
    +    apr_crypto_key_t *key = NULL;
    +    const apu_err_t *result = NULL;
    +    apr_crypto_key_rec_t *rec = apr_crypto_key_rec_make(APR_CRYPTO_KTYPE_HMAC,
    +            pool);
    +    apr_status_t rv;
    +
    +    if (!driver) {
    +        return NULL;
    +    }
    +
    +    if (!f) {
    +        return NULL;
    +    }
    +
    +    rec->type = type;
    +    rec->mode = mode;
    +    rec->pad = doPad;
    +    rec->k.hmac.digest = digest;
    +    rec->k.hmac.secret = apr_pcalloc(pool, secretLen);
    +    rec->k.hmac.secretLen = secretLen;
    +
    +    /* init the key */
    +    rv = apr_crypto_key(&key, rec, f, pool);
    +    if (APR_ENOCIPHER == rv || APR_ENODIGEST == rv) {
    +        apr_crypto_error(&result, f);
    +        ABTS_NOT_IMPL(tc,
    +                apr_psprintf(pool, "skipped: %s %s key return APR_ENOTIMPL: error %d: %s (%s)\n", description, apr_crypto_driver_name(driver), result->rc, result->reason ? result->reason : "", result->msg ? result->msg : ""));
    +        return NULL;
    +    }
    +    else {
    +        if (APR_SUCCESS != rv) {
    +            apr_crypto_error(&result, f);
    +            fprintf(stderr, "key: %s %s apr error %d / native error %d: %s (%s)\n",
    +                    description, apr_crypto_driver_name(driver), rv, result->rc,
    +                    result->reason ? result->reason : "",
    +                    result->msg ? result->msg : "");
    +        }
    +        ABTS_ASSERT(tc, "apr_crypto_key returned APR_EKEYLENGTH", rv != APR_EKEYLENGTH);
    +        ABTS_ASSERT(tc, "apr_crypto_key returned APR_ENOKEY", rv != APR_ENOKEY);
    +        ABTS_ASSERT(tc, "apr_crypto_key returned APR_EPADDING",
    +                rv != APR_EPADDING);
    +        ABTS_ASSERT(tc, "apr_crypto_key returned APR_EKEYTYPE",
    +                rv != APR_EKEYTYPE);
    +        ABTS_ASSERT(tc, "failed to apr_crypto_key", rv == APR_SUCCESS);
    +        ABTS_ASSERT(tc, "apr_crypto_key returned NULL context", key != NULL);
    +    }
    +    if (rv) {
    +        return NULL;
    +    }
    +    return key;
    +
    +}
    +
     static const apr_crypto_key_t *keysecret(abts_case *tc, apr_pool_t *pool,
             const apr_crypto_driver_t *driver, const apr_crypto_t *f,
             apr_crypto_block_key_type_e type, apr_crypto_block_key_mode_e mode,
    @@ -120,14 +231,18 @@ static const apr_crypto_key_t *keysecret(abts_case *tc, apr_pool_t *pool,
     {
         apr_crypto_key_t *key = NULL;
         const apu_err_t *result = NULL;
    -    apr_crypto_key_rec_t *rec = apr_pcalloc(pool, sizeof(apr_crypto_key_rec_t));
    +    apr_crypto_key_rec_t *rec = apr_crypto_key_rec_make(APR_CRYPTO_KTYPE_SECRET,
    +            pool);
         apr_status_t rv;
     
    +    if (!driver) {
    +        return NULL;
    +    }
    +
         if (!f) {
             return NULL;
         }
     
    -    rec->ktype = APR_CRYPTO_KTYPE_SECRET;
         rec->type = type;
         rec->mode = mode;
         rec->pad = doPad;
    @@ -178,6 +293,10 @@ static const apr_crypto_key_t *passphrase(abts_case *tc, apr_pool_t *pool,
         const char *salt = "salt";
         apr_status_t rv;
     
    +    if (!driver) {
    +        return NULL;
    +    }
    +
         if (!f) {
             return NULL;
         }
    @@ -228,6 +347,10 @@ static const apr_crypto_key_t *keypassphrase(abts_case *tc, apr_pool_t *pool,
         apr_crypto_key_rec_t *rec = apr_pcalloc(pool, sizeof(apr_crypto_key_rec_t));
         apr_status_t rv;
     
    +    if (!driver) {
    +        return NULL;
    +    }
    +
         if (!f) {
             return NULL;
         }
    @@ -450,6 +573,275 @@ static unsigned char *decrypt_block(abts_case *tc, apr_pool_t *pool,
     
     }
     
    +static apr_status_t sign_block(abts_case *tc, apr_pool_t *pool,
    +        const apr_crypto_driver_t *driver, const apr_crypto_t *f,
    +        const apr_crypto_key_t *key, const unsigned char *in,
    +        const apr_size_t inlen, unsigned char **signature,
    +        apr_size_t *signatureLen,
    +        apr_size_t *blockSize, const char *description)
    +{
    +
    +    apr_crypto_digest_t *digest = NULL;
    +    const apu_err_t *result = NULL;
    +    apr_crypto_digest_rec_t *rec = apr_crypto_digest_rec_make(
    +            APR_CRYPTO_DTYPE_SIGN, pool);
    +    apr_status_t rv;
    +
    +    if (!driver || !f || !key || !in) {
    +        return APR_EGENERAL;
    +    }
    +
    +    /* init the signature */
    +    rv = apr_crypto_digest_init(&digest, key, rec, pool);
    +    if (APR_ENOTIMPL == rv) {
    +        ABTS_NOT_IMPL(tc, "apr_crypto_digest_init returned APR_ENOTIMPL");
    +    }
    +    else {
    +        if (APR_SUCCESS != rv) {
    +            apr_crypto_error(&result, f);
    +            fprintf(stderr,
    +                    "sign_init: %s %s (APR %d) native error %d: %s (%s)\n",
    +                    description, apr_crypto_driver_name(driver), rv, result->rc,
    +                    result->reason ? result->reason : "",
    +                    result->msg ? result->msg : "");
    +        }
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned APR_ENOKEY",
    +                rv != APR_ENOKEY);
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned APR_ENOIV",
    +                rv != APR_ENOIV);
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned APR_EKEYTYPE",
    +                rv != APR_EKEYTYPE);
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned APR_EKEYLENGTH",
    +                rv != APR_EKEYLENGTH);
    +        ABTS_ASSERT(tc,
    +                "apr_crypto_digest_init returned APR_ENOTENOUGHENTROPY",
    +                rv != APR_ENOTENOUGHENTROPY);
    +        ABTS_ASSERT(tc, "failed to apr_crypto_digest_init",
    +                rv == APR_SUCCESS);
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned NULL context",
    +                digest != NULL);
    +    }
    +    if (!digest || rv) {
    +        return rv;
    +    }
    +
    +    /* sign the block */
    +    rv = apr_crypto_digest_update(digest, in, inlen);
    +    if (APR_SUCCESS != rv) {
    +        apr_crypto_error(&result, f);
    +        fprintf(stderr, "sign: %s %s (APR %d) native error %d: %s (%s)\n",
    +                description, apr_crypto_driver_name(driver), rv, result->rc,
    +                result->reason ? result->reason : "",
    +                result->msg ? result->msg : "");
    +    }
    +    ABTS_ASSERT(tc, "apr_crypto_digest returned APR_ECRYPT", rv != APR_ECRYPT);
    +    ABTS_ASSERT(tc, "failed to apr_crypto_digest", rv == APR_SUCCESS);
    +    if (rv) {
    +        return rv;
    +    }
    +
    +    /* finalise the sign */
    +    rv = apr_crypto_digest_final(digest);
    +    if (APR_SUCCESS != rv) {
    +        apr_crypto_error(&result, f);
    +        fprintf(stderr,
    +                "sign_finish: %s %s (APR %d) native error %d: %s (%s)\n",
    +                description, apr_crypto_driver_name(driver), rv, result->rc,
    +                result->reason ? result->reason : "",
    +                result->msg ? result->msg : "");
    +    }
    +    ABTS_ASSERT(tc, "apr_crypto_digest_final returned APR_ECRYPT", rv != APR_ECRYPT);
    +    ABTS_ASSERT(tc, "apr_crypto_digest_final returned APR_EPADDING", rv != APR_EPADDING);
    +    ABTS_ASSERT(tc, "apr_crypto_digest_final returned APR_ENOSPACE", rv != APR_ENOSPACE);
    +    ABTS_ASSERT(tc, "failed to apr_crypto_digest_final", rv == APR_SUCCESS);
    +    ABTS_ASSERT(tc, "apr_crypto_digest_final failed to allocate buffer", rec->d.sign.s != NULL);
    +
    +    apr_crypto_digest_cleanup(digest);
    +
    +    *signature = rec->d.sign.s;
    +    *signatureLen = rec->d.sign.slen;
    +
    +    return rv;
    +
    +}
    +
    +static apr_status_t hash_block(abts_case *tc, apr_pool_t *pool,
    +        const apr_crypto_driver_t *driver, const apr_crypto_t *f,
    +        const apr_crypto_key_t *key, const unsigned char *in,
    +        const apr_size_t inlen, unsigned char **hash,
    +        apr_size_t *hashLen,
    +        apr_size_t *blockSize, const char *description)
    +{
    +
    +    apr_crypto_digest_t *digest = NULL;
    +    const apu_err_t *result = NULL;
    +    apr_crypto_digest_rec_t *rec = apr_crypto_digest_rec_make(
    +            APR_CRYPTO_DTYPE_HASH, pool);
    +    apr_status_t rv;
    +
    +    if (!driver || !f || !key || !in) {
    +        return APR_EGENERAL;
    +    }
    +
    +    rec->d.hash.digest = APR_CRYPTO_DIGEST_SHA256;
    +
    +    /* init the signature */
    +    rv = apr_crypto_digest_init(&digest, key, rec, pool);
    +    if (APR_ENOTIMPL == rv) {
    +        ABTS_NOT_IMPL(tc, "apr_crypto_digest_init returned APR_ENOTIMPL");
    +    }
    +    else {
    +        if (APR_SUCCESS != rv) {
    +            apr_crypto_error(&result, f);
    +            fprintf(stderr,
    +                    "sign_init: %s %s (APR %d) native error %d: %s (%s)\n",
    +                    description, apr_crypto_driver_name(driver), rv, result->rc,
    +                    result->reason ? result->reason : "",
    +                    result->msg ? result->msg : "");
    +        }
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned APR_ENOKEY",
    +                rv != APR_ENOKEY);
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned APR_ENOIV",
    +                rv != APR_ENOIV);
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned APR_EKEYTYPE",
    +                rv != APR_EKEYTYPE);
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned APR_EKEYLENGTH",
    +                rv != APR_EKEYLENGTH);
    +        ABTS_ASSERT(tc,
    +                "apr_crypto_digest_init returned APR_ENOTENOUGHENTROPY",
    +                rv != APR_ENOTENOUGHENTROPY);
    +        ABTS_ASSERT(tc, "failed to apr_crypto_digest_init",
    +                rv == APR_SUCCESS);
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned NULL context",
    +                digest != NULL);
    +    }
    +    if (!digest || rv) {
    +        return rv;
    +    }
    +
    +    /* sign the block */
    +    rv = apr_crypto_digest_update(digest, in, inlen);
    +    if (APR_SUCCESS != rv) {
    +        apr_crypto_error(&result, f);
    +        fprintf(stderr, "sign: %s %s (APR %d) native error %d: %s (%s)\n",
    +                description, apr_crypto_driver_name(driver), rv, result->rc,
    +                result->reason ? result->reason : "",
    +                result->msg ? result->msg : "");
    +    }
    +    ABTS_ASSERT(tc, "apr_crypto_digest returned APR_ECRYPT", rv != APR_ECRYPT);
    +    ABTS_ASSERT(tc, "failed to apr_crypto_digest", rv == APR_SUCCESS);
    +    if (rv) {
    +        return rv;
    +    }
    +
    +    /* finalise the sign */
    +    rv = apr_crypto_digest_final(digest);
    +    if (APR_SUCCESS != rv) {
    +        apr_crypto_error(&result, f);
    +        fprintf(stderr,
    +                "sign_finish: %s %s (APR %d) native error %d: %s (%s)\n",
    +                description, apr_crypto_driver_name(driver), rv, result->rc,
    +                result->reason ? result->reason : "",
    +                result->msg ? result->msg : "");
    +    }
    +    ABTS_ASSERT(tc, "apr_crypto_digest_final returned APR_ECRYPT", rv != APR_ECRYPT);
    +    ABTS_ASSERT(tc, "apr_crypto_digest_final returned APR_EPADDING", rv != APR_EPADDING);
    +    ABTS_ASSERT(tc, "apr_crypto_digest_final returned APR_ENOSPACE", rv != APR_ENOSPACE);
    +    ABTS_ASSERT(tc, "failed to apr_crypto_digest_final", rv == APR_SUCCESS);
    +    ABTS_ASSERT(tc, "apr_crypto_digest_final failed to allocate buffer", rec->d.hash.s != NULL);
    +
    +    apr_crypto_digest_cleanup(digest);
    +
    +    *hash = rec->d.hash.s;
    +    *hashLen = rec->d.hash.slen;
    +
    +    return rv;
    +
    +}
    +
    +static apr_status_t verify_block(abts_case *tc, apr_pool_t *pool,
    +        const apr_crypto_driver_t *driver, const apr_crypto_t *f,
    +        const apr_crypto_key_t *key, const unsigned char *in,
    +        apr_size_t inlen, const unsigned char *signature,
    +        apr_size_t signatureLen,
    +        apr_size_t *blockSize, const char *description)
    +{
    +
    +    apr_crypto_digest_t *digest = NULL;
    +    const apu_err_t *result = NULL;
    +    apr_crypto_digest_rec_t *rec = apr_crypto_digest_rec_make(
    +            APR_CRYPTO_DTYPE_VERIFY, pool);
    +    apr_status_t rv;
    +
    +    if (!driver || !f || !key || !in || !signature) {
    +        return APR_EGENERAL;
    +    }
    +
    +    rec->d.verify.v = signature;
    +    rec->d.verify.vlen = signatureLen;
    +
    +    /* init the decryption */
    +    rv = apr_crypto_digest_init(&digest, key, rec, pool);
    +    if (APR_ENOTIMPL == rv) {
    +        ABTS_NOT_IMPL(tc, "apr_crypto_digest_init returned APR_ENOTIMPL");
    +    }
    +    else {
    +        if (APR_SUCCESS != rv) {
    +            apr_crypto_error(&result, f);
    +            fprintf(stderr,
    +                    "digest_init: %s %s (APR %d) native error %d: %s (%s)\n",
    +                    description, apr_crypto_driver_name(driver), rv, result->rc,
    +                    result->reason ? result->reason : "",
    +                    result->msg ? result->msg : "");
    +        }
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned APR_ENOKEY", rv != APR_ENOKEY);
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned APR_ENOIV", rv != APR_ENOIV);
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned APR_EKEYTYPE", rv != APR_EKEYTYPE);
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned APR_EKEYLENGTH", rv != APR_EKEYLENGTH);
    +        ABTS_ASSERT(tc, "failed to apr_crypto_digest_init", rv == APR_SUCCESS);
    +        ABTS_ASSERT(tc, "apr_crypto_digest_init returned NULL context", digest != NULL);
    +    }
    +    if (!digest || rv) {
    +        return APR_EGENERAL;
    +    }
    +
    +    /* decrypt the block */
    +    rv = apr_crypto_digest_update(digest, in, inlen);
    +    if (APR_SUCCESS != rv) {
    +        apr_crypto_error(&result, f);
    +        fprintf(stderr, "decrypt: %s %s (APR %d) native error %d: %s (%s)\n",
    +                description, apr_crypto_driver_name(driver), rv, result->rc,
    +                result->reason ? result->reason : "",
    +                result->msg ? result->msg : "");
    +    }
    +    ABTS_ASSERT(tc, "apr_crypto_digest returned APR_ECRYPT", rv != APR_ECRYPT);
    +    ABTS_ASSERT(tc, "failed to apr_crypto_digest", rv == APR_SUCCESS);
    +    ABTS_ASSERT(tc, "apr_crypto_digest failed to allocate buffer", signature != NULL);
    +    if (rv) {
    +        return APR_EGENERAL;
    +    }
    +
    +    /* finalise the decryption */
    +    rv = apr_crypto_digest_final(digest);
    +    if (APR_SUCCESS != rv) {
    +        apr_crypto_error(&result, f);
    +        fprintf(stderr,
    +                "verify_finish: %s %s (APR %d) native error %d: %s (%s)\n",
    +                description, apr_crypto_driver_name(driver), rv, result->rc,
    +                result->reason ? result->reason : "",
    +                result->msg ? result->msg : "");
    +    }
    +    ABTS_ASSERT(tc, "apr_crypto_digest_final returned APR_ECRYPT", rv != APR_ECRYPT);
    +    ABTS_ASSERT(tc, "apr_crypto_digest_final returned APR_EPADDING", rv != APR_EPADDING);
    +    ABTS_ASSERT(tc, "apr_crypto_digest_final returned APR_ENOSPACE", rv != APR_ENOSPACE);
    +    ABTS_ASSERT(tc, "failed to apr_crypto_digest_final", rv == APR_SUCCESS);
    +
    +    apr_crypto_digest_cleanup(digest);
    +
    +    return rv;
    +
    +}
    +
     /**
      * Interoperability test.
      *
    @@ -549,6 +941,130 @@ static void crypto_block_cross(abts_case *tc, apr_pool_t *pool,
     
     }
     
    +/**
    + * Interoperability test.
    + *
    + * data must point at an array of two driver structures. Data will be signed
    + * with the first driver, and verified with the second.
    + *
    + * If the two drivers interoperate, the test passes.
    + */
    +static void crypto_cross_hash(abts_case *tc, apr_pool_t *pool,
    +        const apr_crypto_driver_t **drivers,
    +        const apr_crypto_block_key_digest_e digest,
    +        const unsigned char *in, apr_size_t inlen,
    +        const char *description)
    +{
    +    const apr_crypto_driver_t *driver1 = drivers[0];
    +    const apr_crypto_driver_t *driver2 = drivers[1];
    +    apr_crypto_t *f1 = NULL;
    +    apr_crypto_t *f2 = NULL;
    +    const apr_crypto_key_t *key7 = NULL;
    +    const apr_crypto_key_t *key8 = NULL;
    +
    +    apr_size_t blockSize = 0;
    +    unsigned char *hash1 = NULL;
    +    unsigned char *hash2 = NULL;
    +    apr_size_t hash1Len = 0;
    +    apr_size_t hash2Len = 0;
    +
    +    apr_status_t rv;
    +
    +    f1 = make(tc, pool, driver1);
    +    f2 = make(tc, pool, driver2);
    +
    +    key7 = keyhash(tc, pool, driver1, f1, digest, description);
    +    key8 = keyhash(tc, pool, driver2, f2, digest, description);
    +
    +    blockSize = 0;
    +    rv = hash_block(tc, pool, driver1, f1, key7, in, inlen,
    +            &hash1, &hash1Len, &blockSize, description);
    +
    +    if (APR_SUCCESS != rv && driver1 && driver2) {
    +        fprintf(stderr, "key hash cross error %d: %s %s/%s\n", rv, description,
    +                apr_crypto_driver_name(driver1),
    +                apr_crypto_driver_name(driver2));
    +    }
    +
    +    rv = hash_block(tc, pool, driver2, f2, key8, in,
    +            inlen, &hash2, &hash2Len, &blockSize,
    +            description);
    +
    +    if (APR_SUCCESS != rv && driver1 && driver2) {
    +        fprintf(stderr, "key hash cross error %d: %s %s/%s\n", rv, description,
    +                apr_crypto_driver_name(driver1),
    +                apr_crypto_driver_name(driver2));
    +    }
    +
    +    if (driver1 && driver2
    +            && (!hash1 || !hash2 || hash1Len != hash2Len
    +                    || memcmp(hash1, hash2, hash1Len))) {
    +        fprintf(stderr, "key hash cross mismatch (hash): %s %s/%s\n", description,
    +                apr_crypto_driver_name(driver1),
    +                apr_crypto_driver_name(driver2));
    +    }
    +
    +}
    +
    +/**
    + * Interoperability test.
    + *
    + * data must point at an array of two driver structures. Data will be signed
    + * with the first driver, and verified with the second.
    + *
    + * If the two drivers interoperate, the test passes.
    + */
    +static void crypto_cross_sign(abts_case *tc, apr_pool_t *pool,
    +        const apr_crypto_driver_t **drivers,
    +        const apr_crypto_block_key_digest_e digest,
    +        const apr_crypto_block_key_type_e type,
    +        const apr_crypto_block_key_mode_e mode, int doPad,
    +        const unsigned char *in, apr_size_t inlen, apr_size_t secretLen,
    +        const char *description)
    +{
    +    const apr_crypto_driver_t *driver1 = drivers[0];
    +    const apr_crypto_driver_t *driver2 = drivers[1];
    +    apr_crypto_t *f1 = NULL;
    +    apr_crypto_t *f2 = NULL;
    +    const apr_crypto_key_t *key7 = NULL;
    +    const apr_crypto_key_t *key8 = NULL;
    +
    +    apr_size_t blockSize = 0;
    +    unsigned char *signature = NULL;
    +    apr_size_t signatureLen = 0;
    +
    +    apr_status_t rv;
    +
    +    f1 = make(tc, pool, driver1);
    +    f2 = make(tc, pool, driver2);
    +
    +    key7 = keyhmac(tc, pool, driver1, f1, digest, type, mode, doPad, secretLen,
    +            description);
    +    key8 = keyhmac(tc, pool, driver2, f2, digest, type, mode, doPad, secretLen,
    +            description);
    +
    +    blockSize = 0;
    +    rv = sign_block(tc, pool, driver1, f1, key7, in, inlen,
    +            &signature, &signatureLen, &blockSize, description);
    +
    +    if (APR_SUCCESS != rv && driver1 && driver2) {
    +        fprintf(stderr, "key hmac cross mismatch (sign): %s %s/%s\n", description,
    +                apr_crypto_driver_name(driver1),
    +                apr_crypto_driver_name(driver2));
    +    }
    +
    +    rv = verify_block(tc, pool, driver2, f2, key8, in,
    +            inlen, signature, signatureLen, &blockSize,
    +            description);
    +
    +    if (APR_SUCCESS != rv && driver1 && driver2) {
    +        fprintf(stderr, "key hmac cross mismatch (verify): %s %s/%s\n", description,
    +                apr_crypto_driver_name(driver1),
    +                apr_crypto_driver_name(driver2));
    +    }
    +
    +}
    +
     /**
      * Test initialisation.
      */
    @@ -559,10 +1075,7 @@ static void test_crypto_init(abts_case *tc, void *data)
     
         apr_pool_create(&pool, NULL);
     
    -    /* Use root pool (top level init) so that the crypto lib is
    -     * not cleanup on pool destroy below (e.g. openssl can't re-init).
    -     */
    -    rv = apr_crypto_init(apr_pool_parent_get(pool));
    +    rv = apr_crypto_init(pool);
         ABTS_ASSERT(tc, "failed to init apr_crypto", rv == APR_SUCCESS);
     
         apr_pool_destroy(pool);
    @@ -660,6 +1173,62 @@ static void test_crypto_block_openssl(abts_case *tc, void *data)
     
     }
     
    +/**
    + * Simple test of OpenSSL block signatures.
    + */
    +static void test_crypto_digest_openssl(abts_case *tc, void *data)
    +{
    +    apr_pool_t *pool = NULL;
    +    const apr_crypto_driver_t *drivers[] = { NULL, NULL };
    +
    +    const unsigned char *in = (const unsigned char *) ALIGNED_STRING;
    +    apr_size_t inlen = sizeof(ALIGNED_STRING);
    +
    +    apr_pool_create(&pool, NULL);
    +    drivers[0] = get_openssl_driver(tc, pool);
    +    drivers[1] = get_openssl_driver(tc, pool);
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, 24,
    +            "KEY_3DES_192/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_3DES_192, APR_MODE_ECB, 0, in, inlen, 24,
    +            "KEY_3DES_192/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, 32,
    +            "KEY_AES_256/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, 32,
    +            "KEY_AES_256/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_192, APR_MODE_CBC, 0, in, inlen, 24,
    +            "KEY_AES_192/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_192, APR_MODE_ECB, 0, in, inlen, 24,
    +            "KEY_AES_192/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_128, APR_MODE_CBC, 0, in, inlen, 16,
    +            "KEY_AES_128/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_128, APR_MODE_ECB, 0, in, inlen, 16,
    +            "KEY_AES_128/MODE_ECB");
    +
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_MD5, in, inlen,
    +            "DIGEST MD5");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA1, in, inlen,
    +            "DIGEST SHA1");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA224, in, inlen,
    +            "DIGEST SHA224");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256, in, inlen,
    +            "DIGEST SHA256");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA384, in, inlen,
    +            "DIGEST SHA384");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA512, in, inlen,
    +            "DIGEST SHA512");
    +
    +    apr_pool_destroy(pool);
    +
    +}
    +
     /**
      * Simple test of NSS block crypt.
      */
    @@ -694,6 +1263,61 @@ static void test_crypto_block_nss(abts_case *tc, void *data)
     
     }
     
    +/**
    + * Simple test of NSS block sign/verify.
    + */
    +static void test_crypto_digest_nss(abts_case *tc, void *data)
    +{
    +    apr_pool_t *pool = NULL;
    +    const apr_crypto_driver_t *drivers[] = { NULL, NULL };
    +
    +    const unsigned char *in = (const unsigned char *) ALIGNED_STRING;
    +    apr_size_t inlen = sizeof(ALIGNED_STRING);
    +
    +    apr_pool_create(&pool, NULL);
    +    drivers[0] = get_nss_driver(tc, pool);
    +    drivers[1] = get_nss_driver(tc, pool);
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, 24,
    +            "KEY_3DES_192/MODE_CBC");
    +    /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */
    +    /* crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256, KEY_3DES_192, MODE_ECB, 0, in, inlen, "KEY_3DES_192/MODE_ECB"); */
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, 32,
    +            "KEY_AES_256/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, 32,
    +            "KEY_AES_256/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_192, APR_MODE_CBC, 0, in, inlen, 24,
    +            "KEY_AES_192/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_192, APR_MODE_ECB, 0, in, inlen, 24,
    +            "KEY_AES_192/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_128, APR_MODE_CBC, 0, in, inlen, 16,
    +            "KEY_AES_128/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_128, APR_MODE_ECB, 0, in, inlen, 16,
    +            "KEY_AES_128/MODE_ECB");
    +
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_MD5, in, inlen,
    +            "DIGEST MD5");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA1, in, inlen,
    +            "DIGEST SHA1");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA224, in, inlen,
    +            "DIGEST SHA224");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256, in, inlen,
    +            "DIGEST SHA256");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA384, in, inlen,
    +            "DIGEST SHA384");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA512, in, inlen,
    +            "DIGEST SHA512");
    +
    +    apr_pool_destroy(pool);
    +
    +}
    +
     /**
      * Simple test of Common Crypto block crypt.
      */
    @@ -728,6 +1352,62 @@ static void test_crypto_block_commoncrypto(abts_case *tc, void *data)
     
     }
     
    +/**
    + * Simple test of Common Crypto block sign.
    + */
    +static void test_crypto_digest_commoncrypto(abts_case *tc, void *data)
    +{
    +    apr_pool_t *pool = NULL;
    +    const apr_crypto_driver_t *drivers[] = { NULL, NULL };
    +
    +    const unsigned char *in = (const unsigned char *) ALIGNED_STRING;
    +    apr_size_t inlen = sizeof(ALIGNED_STRING);
    +
    +    apr_pool_create(&pool, NULL);
    +    drivers[0] = get_commoncrypto_driver(tc, pool);
    +    drivers[1] = get_commoncrypto_driver(tc, pool);
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, 24,
    +            "KEY_3DES_192/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_3DES_192, APR_MODE_ECB, 0, in, inlen, 24,
    +            "KEY_3DES_192/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, 32,
    +            "KEY_AES_256/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, 32,
    +            "KEY_AES_256/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_192, APR_MODE_CBC, 0, in, inlen, 24,
    +            "KEY_AES_192/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_192, APR_MODE_ECB, 0, in, inlen, 24,
    +            "KEY_AES_192/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_128, APR_MODE_CBC, 0, in, inlen, 16,
    +            "KEY_AES_128/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_128, APR_MODE_ECB, 0, in, inlen, 16,
    +            "KEY_AES_128/MODE_ECB");
    +
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_MD5, in, inlen,
    +            "DIGEST MD5");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA1, in, inlen,
    +            "DIGEST SHA1");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA224, in, inlen,
    +            "DIGEST SHA224");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256, in, inlen,
    +            "DIGEST SHA256");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA384, in, inlen,
    +            "DIGEST SHA384");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA512, in, inlen,
    +            "DIGEST SHA512");
    +
    +    apr_pool_destroy(pool);
    +
    +}
    +
     /**
      * Encrypt NSS, decrypt OpenSSL.
      */
    @@ -800,6 +1480,120 @@ static void test_crypto_block_openssl_nss(abts_case *tc, void *data)
     
     }
     
    +/**
    + * Sign NSS, verify OpenSSL.
    + */
    +static void test_crypto_digest_nss_openssl(abts_case *tc, void *data)
    +{
    +    apr_pool_t *pool = NULL;
    +    const apr_crypto_driver_t *drivers[] = { NULL, NULL };
    +
    +    const unsigned char *in = (const unsigned char *) ALIGNED_STRING;
    +    apr_size_t inlen = sizeof(ALIGNED_STRING);
    +
    +    apr_pool_create(&pool, NULL);
    +    drivers[0] = get_nss_driver(tc, pool);
    +    drivers[1] = get_openssl_driver(tc, pool);
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, 24,
    +            "KEY_3DES_192/MODE_CBC");
    +    /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */
    +/*    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_3DES_192, APR_MODE_ECB, 0, in, inlen, 24,
    +            "KEY_3DES_192/MODE_ECB");*/
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, 32,
    +            "KEY_AES_256/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, 32,
    +            "KEY_AES_256/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_192, APR_MODE_CBC, 0, in, inlen, 24,
    +            "KEY_AES_192/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_192, APR_MODE_ECB, 0, in, inlen, 24,
    +            "KEY_AES_192/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_128, APR_MODE_CBC, 0, in, inlen, 16,
    +            "KEY_AES_128/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_128, APR_MODE_ECB, 0, in, inlen, 16,
    +            "KEY_AES_128/MODE_ECB");
    +
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_MD5, in, inlen,
    +            "DIGEST MD5");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA1, in, inlen,
    +            "DIGEST SHA1");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA224, in, inlen,
    +            "DIGEST SHA224");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256, in, inlen,
    +            "DIGEST SHA256");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA384, in, inlen,
    +            "DIGEST SHA384");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA512, in, inlen,
    +            "DIGEST SHA512");
    +
    +    apr_pool_destroy(pool);
    +
    +}
    +
    +/**
    + * Sign OpenSSL, verify NSS.
    + */
    +static void test_crypto_digest_openssl_nss(abts_case *tc, void *data)
    +{
    +    apr_pool_t *pool = NULL;
    +    const apr_crypto_driver_t *drivers[] = { NULL, NULL };
    +
    +    const unsigned char *in = (const unsigned char *) ALIGNED_STRING;
    +    apr_size_t inlen = sizeof(ALIGNED_STRING);
    +
    +    apr_pool_create(&pool, NULL);
    +    drivers[0] = get_openssl_driver(tc, pool);
    +    drivers[1] = get_nss_driver(tc, pool);
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, 24,
    +            "KEY_3DES_192/MODE_CBC");
    +    /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */
    +/*    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_3DES_192, APR_MODE_ECB, 0, in, inlen, 24,
    +            "KEY_3DES_192/MODE_ECB");*/
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, 32,
    +            "KEY_AES_256/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, 32,
    +            "KEY_AES_256/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_192, APR_MODE_CBC, 0, in, inlen, 24,
    +            "KEY_AES_192/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_192, APR_MODE_ECB, 0, in, inlen, 24,
    +            "KEY_AES_192/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_128, APR_MODE_CBC, 0, in, inlen, 16,
    +            "KEY_AES_128/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_128, APR_MODE_ECB, 0, in, inlen, 16,
    +            "KEY_AES_128/MODE_ECB");
    +
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_MD5, in, inlen,
    +            "DIGEST MD5");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA1, in, inlen,
    +            "DIGEST SHA1");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA224, in, inlen,
    +            "DIGEST SHA224");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256, in, inlen,
    +            "DIGEST SHA256");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA384, in, inlen,
    +            "DIGEST SHA384");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA512, in, inlen,
    +            "DIGEST SHA512");
    +
    +    apr_pool_destroy(pool);
    +
    +}
    +
     /**
      * Encrypt OpenSSL, decrypt CommonCrypto.
      */
    @@ -836,6 +1630,63 @@ static void test_crypto_block_openssl_commoncrypto(abts_case *tc, void *data)
     
     }
     
    +/**
    + * Sign OpenSSL, verify CommonCrypto.
    + */
    +static void test_crypto_digest_openssl_commoncrypto(abts_case *tc, void *data)
    +{
    +    apr_pool_t *pool = NULL;
    +    const apr_crypto_driver_t *drivers[] = { NULL, NULL };
    +
    +    const unsigned char *in = (const unsigned char *) ALIGNED_STRING;
    +    apr_size_t inlen = sizeof(ALIGNED_STRING);
    +
    +    apr_pool_create(&pool, NULL);
    +    drivers[0] = get_openssl_driver(tc, pool);
    +    drivers[1] = get_commoncrypto_driver(tc, pool);
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, 24,
    +            "KEY_3DES_192/MODE_CBC");
    +    /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */
    +/*    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_3DES_192, APR_MODE_ECB, 0, in, inlen, 24,
    +            "KEY_3DES_192/MODE_ECB");*/
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, 32,
    +            "KEY_AES_256/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, 32,
    +            "KEY_AES_256/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_192, APR_MODE_CBC, 0, in, inlen, 24,
    +            "KEY_AES_192/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_192, APR_MODE_ECB, 0, in, inlen, 24,
    +            "KEY_AES_192/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_128, APR_MODE_CBC, 0, in, inlen, 16,
    +            "KEY_AES_128/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_128, APR_MODE_ECB, 0, in, inlen, 16,
    +            "KEY_AES_128/MODE_ECB");
    +
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_MD5, in, inlen,
    +            "DIGEST MD5");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA1, in, inlen,
    +            "DIGEST SHA1");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA224, in, inlen,
    +            "DIGEST SHA224");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256, in, inlen,
    +            "DIGEST SHA256");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA384, in, inlen,
    +            "DIGEST SHA384");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA512, in, inlen,
    +            "DIGEST SHA512");
    +
    +    apr_pool_destroy(pool);
    +
    +}
    +
     /**
      * Encrypt OpenSSL, decrypt CommonCrypto.
      */
    @@ -872,6 +1723,63 @@ static void test_crypto_block_commoncrypto_openssl(abts_case *tc, void *data)
     
     }
     
    +/**
    + * Sign OpenSSL, verify CommonCrypto.
    + */
    +static void test_crypto_digest_commoncrypto_openssl(abts_case *tc, void *data)
    +{
    +    apr_pool_t *pool = NULL;
    +    const apr_crypto_driver_t *drivers[] = { NULL, NULL };
    +
    +    const unsigned char *in = (const unsigned char *) ALIGNED_STRING;
    +    apr_size_t inlen = sizeof(ALIGNED_STRING);
    +
    +    apr_pool_create(&pool, NULL);
    +    drivers[0] = get_commoncrypto_driver(tc, pool);
    +    drivers[1] = get_openssl_driver(tc, pool);
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_3DES_192, APR_MODE_CBC, 0, in, inlen, 24,
    +            "KEY_3DES_192/MODE_CBC");
    +    /* KEY_3DES_192 / MODE_ECB doesn't work on NSS */
    +/*    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_3DES_192, APR_MODE_ECB, 0, in, inlen, 24,
    +            "KEY_3DES_192/MODE_ECB");*/
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_256, APR_MODE_CBC, 0, in, inlen, 32,
    +            "KEY_AES_256/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_256, APR_MODE_ECB, 0, in, inlen, 32,
    +            "KEY_AES_256/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_192, APR_MODE_CBC, 0, in, inlen, 24,
    +            "KEY_AES_192/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_192, APR_MODE_ECB, 0, in, inlen, 24,
    +            "KEY_AES_192/MODE_ECB");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_128, APR_MODE_CBC, 0, in, inlen, 16,
    +            "KEY_AES_128/MODE_CBC");
    +    crypto_cross_sign(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256,
    +            APR_KEY_AES_128, APR_MODE_ECB, 0, in, inlen, 16,
    +            "KEY_AES_128/MODE_ECB");
    +
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_MD5, in, inlen,
    +            "DIGEST MD5");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA1, in, inlen,
    +            "DIGEST SHA1");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA224, in, inlen,
    +            "DIGEST SHA224");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA256, in, inlen,
    +            "DIGEST SHA256");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA384, in, inlen,
    +            "DIGEST SHA384");
    +    crypto_cross_hash(tc, pool, drivers, APR_CRYPTO_DIGEST_SHA512, in, inlen,
    +            "DIGEST SHA512");
    +
    +    apr_pool_destroy(pool);
    +
    +}
    +
     /**
      * Simple test of OpenSSL block crypt.
      */
    @@ -1699,7 +2607,7 @@ abts_suite *testcrypto(abts_suite *suite)
     {
         suite = ADD_SUITE(suite);
     
    -    /* test simple init and shutdown (keep first) */
    +    /* test simple init and shutdown */
         abts_run_test(suite, test_crypto_init, NULL);
     
         /* test key parsing - openssl */
    @@ -1714,45 +2622,71 @@ abts_suite *testcrypto(abts_suite *suite)
         /* test a simple encrypt / decrypt operation - openssl */
         abts_run_test(suite, test_crypto_block_openssl, NULL);
     
    +    /* test a simple sign / verify operation - openssl */
    +    abts_run_test(suite, test_crypto_digest_openssl, NULL);
    +
         /* test a padded encrypt / decrypt operation - openssl */
         abts_run_test(suite, test_crypto_block_openssl_pad, NULL);
     
         /* test a simple encrypt / decrypt operation - nss */
         abts_run_test(suite, test_crypto_block_nss, NULL);
     
    +    /* test a simple sign / verify operation - nss */
    +    abts_run_test(suite, test_crypto_digest_nss, NULL);
    +
         /* test a padded encrypt / decrypt operation - nss */
         abts_run_test(suite, test_crypto_block_nss_pad, NULL);
     
         /* test a simple encrypt / decrypt operation - commoncrypto */
         abts_run_test(suite, test_crypto_block_commoncrypto, NULL);
     
    +    /* test a simple sign / verify operation - commoncrypto */
    +    abts_run_test(suite, test_crypto_digest_commoncrypto, NULL);
    +
         /* test a padded encrypt / decrypt operation - commoncrypto */
         abts_run_test(suite, test_crypto_block_commoncrypto_pad, NULL);
     
    +
         /* test encrypt nss / decrypt openssl */
         abts_run_test(suite, test_crypto_block_nss_openssl, NULL);
     
         /* test padded encrypt nss / decrypt openssl */
         abts_run_test(suite, test_crypto_block_nss_openssl_pad, NULL);
     
    +    /* test sign nss / verify openssl */
    +    abts_run_test(suite, test_crypto_digest_nss_openssl, NULL);
    +
    +
         /* test encrypt openssl / decrypt nss */
         abts_run_test(suite, test_crypto_block_openssl_nss, NULL);
     
         /* test padded encrypt openssl / decrypt nss */
         abts_run_test(suite, test_crypto_block_openssl_nss_pad, NULL);
     
    +    /* test sign openssl / verify nss */
    +    abts_run_test(suite, test_crypto_digest_openssl_nss, NULL);
    +
    +
         /* test encrypt openssl / decrypt commoncrypto */
         abts_run_test(suite, test_crypto_block_openssl_commoncrypto, NULL);
     
         /* test padded encrypt openssl / decrypt commoncrypto */
         abts_run_test(suite, test_crypto_block_openssl_commoncrypto_pad, NULL);
     
    +    /* test sign openssl / verify commoncrypto */
    +    abts_run_test(suite, test_crypto_digest_openssl_commoncrypto, NULL);
    +
    +
         /* test encrypt commoncrypto / decrypt openssl */
         abts_run_test(suite, test_crypto_block_commoncrypto_openssl, NULL);
     
         /* test padded encrypt commoncrypto / decrypt openssl */
         abts_run_test(suite, test_crypto_block_commoncrypto_openssl_pad, NULL);
     
    +    /* test sign commoncrypto / verify openssl */
    +    abts_run_test(suite, test_crypto_digest_commoncrypto_openssl, NULL);
    +
    +
         /* test block key types openssl */
         abts_run_test(suite, test_crypto_get_block_key_types_openssl, NULL);
     
    
    From af517d9117ecf6bdb5693e110480ee45b0d2beb9 Mon Sep 17 00:00:00 2001
    From: Yann Ylavic 
    Date: Mon, 23 Jul 2018 14:06:08 +0000
    Subject: [PATCH 7827/7878] apr_crypto: follow up to r1836445: fix
     APR_USE_OPENSSL_PRE_1_1_API check.
    
    APR_USE_OPENSSL_PRE_1_1_API is always defined, change #ifdef to #if to build
    with openssl >= 1.1.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836496 13f79535-47bb-0310-9956-ffa450edef68
    ---
     crypto/apr_crypto_openssl.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c
    index b1b5f9071f8..82b3842f0a7 100644
    --- a/crypto/apr_crypto_openssl.c
    +++ b/crypto/apr_crypto_openssl.c
    @@ -201,7 +201,7 @@ void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx)
     
     #endif
     
    -#ifdef APR_USE_OPENSSL_PRE_1_1_API
    +#if APR_USE_OPENSSL_PRE_1_1_API
     #define EVP_MD_CTX_new EVP_MD_CTX_create
     #define EVP_MD_CTX_free EVP_MD_CTX_destroy
     #endif
    
    From a915da561cf810e0eb956c04e05e54b65e149e68 Mon Sep 17 00:00:00 2001
    From: Nick Kew 
    Date: Mon, 23 Jul 2018 22:28:23 +0000
    Subject: [PATCH 7828/7878] PR 62555: fix edge-case int overflow in apr_itoa
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836519 13f79535-47bb-0310-9956-ffa450edef68
    ---
     strings/apr_strings.c | 20 ++++++++++++--------
     1 file changed, 12 insertions(+), 8 deletions(-)
    
    diff --git a/strings/apr_strings.c b/strings/apr_strings.c
    index 0ba49c844c6..beca6d48007 100644
    --- a/strings/apr_strings.c
    +++ b/strings/apr_strings.c
    @@ -362,19 +362,21 @@ APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n)
         const int BUFFER_SIZE = sizeof(int) * 3 + 2;
         char *buf = apr_palloc(p, BUFFER_SIZE);
         char *start = buf + BUFFER_SIZE - 1;
    +    unsigned int un;
         int negative;
         if (n < 0) {
     	negative = 1;
    -	n = -n;
    +	un = -n;
         }
         else {
     	negative = 0;
    +        un = n;
         }
         *start = 0;
         do {
    -	*--start = '0' + (n % 10);
    -	n /= 10;
    -    } while (n);
    +	*--start = '0' + (un % 10);
    +	un /= 10;
    +    } while (un);
         if (negative) {
     	*--start = '-';
         }
    @@ -387,18 +389,20 @@ APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n)
         char *buf = apr_palloc(p, BUFFER_SIZE);
         char *start = buf + BUFFER_SIZE - 1;
         int negative;
    +    unsigned int un;
         if (n < 0) {
     	negative = 1;
    -	n = -n;
    +	un = -n;
         }
         else {
     	negative = 0;
    +        un = n;
         }
         *start = 0;
         do {
    -	*--start = (char)('0' + (n % 10));
    -	n /= 10;
    -    } while (n);
    +	*--start = (char)('0' + (un % 10));
    +	un /= 10;
    +    } while (un);
         if (negative) {
     	*--start = '-';
         }
    
    From 0121ed98b5dde62145ab0fa408d413316e009758 Mon Sep 17 00:00:00 2001
    From: Yann Ylavic 
    Date: Tue, 24 Jul 2018 11:01:59 +0000
    Subject: [PATCH 7829/7878] crypto: follow up to r1836439: restore
     apr_crypto_lib_init/term().
    
    Also restores apr_crypto_init()'s global pool in testcrypto to avoid
    segfaults because of openssl inability to re-init.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836539 13f79535-47bb-0310-9956-ffa450edef68
    ---
     crypto/apr_crypto_commoncrypto.c |  13 +---
     crypto/apr_crypto_nss.c          | 116 +------------------------------
     crypto/apr_crypto_openssl.c      |  27 +------
     test/testcrypto.c                |  14 ++--
     4 files changed, 12 insertions(+), 158 deletions(-)
    
    diff --git a/crypto/apr_crypto_commoncrypto.c b/crypto/apr_crypto_commoncrypto.c
    index f2095bcd7ad..421b0581a44 100644
    --- a/crypto/apr_crypto_commoncrypto.c
    +++ b/crypto/apr_crypto_commoncrypto.c
    @@ -123,12 +123,7 @@ static apr_status_t crypto_error(const apu_err_t **result,
      */
     static apr_status_t crypto_shutdown(void)
     {
    -    return APR_SUCCESS;
    -}
    -
    -static apr_status_t crypto_shutdown_helper(void *data)
    -{
    -    return crypto_shutdown();
    +    return apr_crypto_lib_term("commoncrypto");
     }
     
     /**
    @@ -137,11 +132,7 @@ static apr_status_t crypto_shutdown_helper(void *data)
     static apr_status_t crypto_init(apr_pool_t *pool, const char *params,
             const apu_err_t **result)
     {
    -
    -    apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper,
    -            apr_pool_cleanup_null);
    -
    -    return APR_SUCCESS;
    +    return apr_crypto_lib_init("commoncrypto", params, result, pool);
     }
     
     /**
    diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c
    index 37ffe086231..807ae58c54b 100644
    --- a/crypto/apr_crypto_nss.c
    +++ b/crypto/apr_crypto_nss.c
    @@ -135,20 +135,7 @@ static apr_status_t crypto_error(const apu_err_t **result,
      */
     static apr_status_t crypto_shutdown(void)
     {
    -    if (NSS_IsInitialized()) {
    -        SECStatus s = NSS_Shutdown();
    -        if (s != SECSuccess) {
    -            fprintf(stderr, "NSS failed to shutdown, possible leak: %d: %s",
    -                PR_GetError(), PR_ErrorToName(s));
    -            return APR_EINIT;
    -        }
    -    }
    -    return APR_SUCCESS;
    -}
    -
    -static apr_status_t crypto_shutdown_helper(void *data)
    -{
    -    return crypto_shutdown();
    +    return apr_crypto_lib_term("nss");
     }
     
     /**
    @@ -157,106 +144,7 @@ static apr_status_t crypto_shutdown_helper(void *data)
     static apr_status_t crypto_init(apr_pool_t *pool, const char *params,
             const apu_err_t **result)
     {
    -    SECStatus s;
    -    const char *dir = NULL;
    -    const char *keyPrefix = NULL;
    -    const char *certPrefix = NULL;
    -    const char *secmod = NULL;
    -    int noinit = 0;
    -    PRUint32 flags = 0;
    -
    -    struct {
    -        const char *field;
    -        const char *value;
    -        int set;
    -    } fields[] = {
    -        { "dir", NULL, 0 },
    -        { "key3", NULL, 0 },
    -        { "cert7", NULL, 0 },
    -        { "secmod", NULL, 0 },
    -        { "noinit", NULL, 0 },
    -        { NULL, NULL, 0 }
    -    };
    -    const char *ptr;
    -    size_t klen;
    -    char **elts = NULL;
    -    char *elt;
    -    int i = 0, j;
    -    apr_status_t status;
    -
    -    if (params) {
    -        if (APR_SUCCESS != (status = apr_tokenize_to_argv(params, &elts, pool))) {
    -            return status;
    -        }
    -        while ((elt = elts[i])) {
    -            ptr = strchr(elt, '=');
    -            if (ptr) {
    -                for (klen = ptr - elt; klen && apr_isspace(elt[klen - 1]); --klen)
    -                    ;
    -                ptr++;
    -            }
    -            else {
    -                for (klen = strlen(elt); klen && apr_isspace(elt[klen - 1]); --klen)
    -                    ;
    -            }
    -            elt[klen] = 0;
    -
    -            for (j = 0; fields[j].field != NULL; ++j) {
    -                if (klen && !strcasecmp(fields[j].field, elt)) {
    -                    fields[j].set = 1;
    -                    if (ptr) {
    -                        fields[j].value = ptr;
    -                    }
    -                    break;
    -                }
    -            }
    -
    -            i++;
    -        }
    -        dir = fields[0].value;
    -        keyPrefix = fields[1].value;
    -        certPrefix = fields[2].value;
    -        secmod = fields[3].value;
    -        noinit = fields[4].set;
    -    }
    -
    -    /* if we've been asked to bypass, do so here */
    -    if (noinit) {
    -        return APR_SUCCESS;
    -    }
    -
    -    /* sanity check - we can only initialise NSS once */
    -    if (NSS_IsInitialized()) {
    -        return APR_EREINIT;
    -    }
    -
    -    if (keyPrefix || certPrefix || secmod) {
    -        s = NSS_Initialize(dir, certPrefix, keyPrefix, secmod, flags);
    -    }
    -    else if (dir) {
    -        s = NSS_InitReadWrite(dir);
    -    }
    -    else {
    -        s = NSS_NoDB_Init(NULL);
    -    }
    -    if (s != SECSuccess) {
    -        if (result) {
    -            /* Note: all memory must be owned by the caller, in case we're unloaded */
    -            apu_err_t *err = apr_pcalloc(pool, sizeof(apu_err_t));
    -            err->rc = PR_GetError();
    -            err->msg = apr_pstrdup(pool, PR_ErrorToName(s));
    -            err->reason = apr_pstrdup(pool, "Error during 'nss' initialisation");
    -            *result = err;
    -        }
    -
    -        return APR_ECRYPT;
    -    }
    -
    -    apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper,
    -            apr_pool_cleanup_null);
    -
    -    return APR_SUCCESS;
    -
    +    return apr_crypto_lib_init("nss", params, result, pool);
     }
     
     /**
    diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c
    index 82b3842f0a7..5186e6b42e9 100644
    --- a/crypto/apr_crypto_openssl.c
    +++ b/crypto/apr_crypto_openssl.c
    @@ -34,6 +34,7 @@
     #include 
     #include 
     #include 
    +#include 
     
     #define LOG_PREFIX "apr_crypto_openssl: "
     
    @@ -143,15 +144,7 @@ static apr_status_t crypto_error(const apu_err_t **result,
      */
     static apr_status_t crypto_shutdown(void)
     {
    -    ERR_free_strings();
    -    EVP_cleanup();
    -    ENGINE_cleanup();
    -    return APR_SUCCESS;
    -}
    -
    -static apr_status_t crypto_shutdown_helper(void *data)
    -{
    -    return crypto_shutdown();
    +    return apr_crypto_lib_term("openssl");
     }
     
     /**
    @@ -160,21 +153,7 @@ static apr_status_t crypto_shutdown_helper(void *data)
     static apr_status_t crypto_init(apr_pool_t *pool, const char *params,
             const apu_err_t **result)
     {
    -#if APR_USE_OPENSSL_PRE_1_1_API
    -    (void)CRYPTO_malloc_init();
    -#else
    -    OPENSSL_malloc_init();
    -#endif
    -    ERR_load_crypto_strings();
    -    /* SSL_load_error_strings(); */
    -    OpenSSL_add_all_algorithms();
    -    ENGINE_load_builtin_engines();
    -    ENGINE_register_all_complete();
    -
    -    apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper,
    -            apr_pool_cleanup_null);
    -
    -    return APR_SUCCESS;
    +    return apr_crypto_lib_init("openssl", params, result, pool);
     }
     
     #if OPENSSL_VERSION_NUMBER < 0x0090802fL
    diff --git a/test/testcrypto.c b/test/testcrypto.c
    index 9261d1887cd..4c93a8b2caa 100644
    --- a/test/testcrypto.c
    +++ b/test/testcrypto.c
    @@ -1075,7 +1075,7 @@ static void test_crypto_init(abts_case *tc, void *data)
     
         apr_pool_create(&pool, NULL);
     
    -    rv = apr_crypto_init(pool);
    +    rv = apr_crypto_init(apr_pool_parent_get(pool));
         ABTS_ASSERT(tc, "failed to init apr_crypto", rv == APR_SUCCESS);
     
         apr_pool_destroy(pool);
    @@ -2461,10 +2461,8 @@ static void test_crypto_prng(abts_case *tc, void *data)
                             rv == APR_SUCCESS);
             }
     
    -        if (cprng) {
    -            rv = apr_crypto_prng_bytes(cprng, randbytes, 128 - 32);
    -            ABTS_ASSERT(tc, "apr_crypto_prng_bytes failed", rv == APR_SUCCESS);
    -        }
    +        rv = apr_crypto_prng_bytes(cprng, randbytes, 128 - 32);
    +        ABTS_ASSERT(tc, "apr_crypto_prng_bytes failed", rv == APR_SUCCESS);
     
             /* Should match the first time only */
             if (i != 0) {
    @@ -2478,10 +2476,8 @@ static void test_crypto_prng(abts_case *tc, void *data)
                             memcmp(randbytes, test_PRNG_kat0 + 32, 128 - 32) == 0);
             }
     
    -        if (cprng) {
    -            rv = apr_crypto_prng_destroy(cprng);
    -            ABTS_ASSERT(tc, "apr_crypto_prng_destroy failed", rv == APR_SUCCESS);
    -        }
    +        rv = apr_crypto_prng_destroy(cprng);
    +        ABTS_ASSERT(tc, "apr_crypto_prng_destroy failed", rv == APR_SUCCESS);
         }
     
         apr_pool_destroy(pool);
    
    From 7549f6cc57f00b7212c95238623504d5f20b8700 Mon Sep 17 00:00:00 2001
    From: Ruediger Pluem 
    Date: Wed, 25 Jul 2018 08:15:02 +0000
    Subject: [PATCH 7830/7878] * Scratch md2 and md4 as they are not part of
     key_digests array
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836610 13f79535-47bb-0310-9956-ffa450edef68
    ---
     crypto/apr_crypto_nss.c | 4 +---
     1 file changed, 1 insertion(+), 3 deletions(-)
    
    diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c
    index 807ae58c54b..59955b2fa4f 100644
    --- a/crypto/apr_crypto_nss.c
    +++ b/crypto/apr_crypto_nss.c
    @@ -271,9 +271,7 @@ static apr_status_t crypto_make(apr_crypto_t **ff,
         if (!f->digests) {
             return APR_ENOMEM;
         }
    -    apr_hash_set(f->digests, "md2", APR_HASH_KEY_STRING, &(key_digests[i = 0]));
    -    apr_hash_set(f->digests, "md4", APR_HASH_KEY_STRING, &(key_digests[++i]));
    -    apr_hash_set(f->digests, "md5", APR_HASH_KEY_STRING, &(key_digests[++i]));
    +    apr_hash_set(f->digests, "md5", APR_HASH_KEY_STRING, &(key_digests[i = 0]));
         apr_hash_set(f->digests, "sha1", APR_HASH_KEY_STRING, &(key_digests[++i]));
         apr_hash_set(f->digests, "sha224", APR_HASH_KEY_STRING, &(key_digests[++i]));
         apr_hash_set(f->digests, "sha256", APR_HASH_KEY_STRING, &(key_digests[++i]));
    
    From e619092257f494844051cb2adb30f9f8457e502d Mon Sep 17 00:00:00 2001
    From: Yann Ylavic 
    Date: Wed, 25 Jul 2018 10:58:07 +0000
    Subject: [PATCH 7831/7878] configure.in: match fallback apr_off_t type with
     the comment/format.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836615 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/configure.in b/configure.in
    index 4fc185c9450..9bcecd61ee9 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -1866,7 +1866,7 @@ elif test "$ac_cv_type_off_t" = "yes"; then
         esac
     else
         # Fallback on int
    -    off_t_value=apr_int64_t
    +    off_t_value=int
         off_t_fmt='#define APR_OFF_T_FMT "d"'
         off_t_strfn='strtoi'
     fi
    
    From 674aa3be29d32c7c41ba81613cbd2984b222552c Mon Sep 17 00:00:00 2001
    From: Yann Ylavic 
    Date: Wed, 25 Jul 2018 11:00:50 +0000
    Subject: [PATCH 7832/7878] Provide APR_SIZEOF_OFF_T.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836616 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in     | 7 +++++++
     include/apr.h.in | 1 +
     2 files changed, 8 insertions(+)
    
    diff --git a/configure.in b/configure.in
    index 9bcecd61ee9..6f56b8f9973 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -1832,6 +1832,7 @@ if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then
         off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT'
         off_t_value='off64_t'
         off_t_strfn='apr_strtoi64'
    +    off_t_size=8
     elif test "${ac_cv_sizeof_off_t}x${ac_cv_sizeof_long}" = "4x4"; then
         # Special case: off_t may change size with _FILE_OFFSET_BITS
         # on 32-bit systems with LFS support.  To avoid compatibility
    @@ -1840,8 +1841,10 @@ elif test "${ac_cv_sizeof_off_t}x${ac_cv_sizeof_long}" = "4x4"; then
         off_t_value=long
         off_t_fmt='#define APR_OFF_T_FMT "ld"'
         off_t_strfn='strtol'
    +    off_t_size="$ac_cv_sizeof_long"
     elif test "$ac_cv_type_off_t" = "yes"; then
         off_t_value=off_t
    +    off_t_size="$ac_cv_sizeof_off_t"
         # off_t is more commonly a long than an int; prefer that case
         # where int and long are the same size.
         if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then
    @@ -1862,6 +1865,7 @@ elif test "$ac_cv_type_off_t" = "yes"; then
             off_t_value=apr_int64_t
             off_t_fmt='#define APR_OFF_T_FMT "I64d"'
             off_t_strfn='_strtoi64'
    +        off_t_size=8
             ;;
         esac
     else
    @@ -1869,9 +1873,11 @@ else
         off_t_value=int
         off_t_fmt='#define APR_OFF_T_FMT "d"'
         off_t_strfn='strtoi'
    +    off_t_size=4
     fi
     AC_MSG_RESULT($off_t_value)
     
    +
     # Regardless of whether _LARGEFILE64_SOURCE is used, on some
     # platforms _FILE_OFFSET_BITS will affect the size of ino_t and hence
     # the build-time ABI may be different from the apparent ABI when using
    @@ -1942,6 +1948,7 @@ AC_SUBST(bigendian)
     AC_SUBST(aprlfs)
     AC_SUBST(have_iovec)
     AC_SUBST(ino_t_value)
    +AC_SUBST(off_t_size)
     
     dnl ----------------------------- Checking for string functions
     AC_CHECK_FUNCS(strnicmp, have_strnicmp="1", have_strnicmp="0")
    diff --git a/include/apr.h.in b/include/apr.h.in
    index 2cdb555e49b..e6211ec0347 100644
    --- a/include/apr.h.in
    +++ b/include/apr.h.in
    @@ -334,6 +334,7 @@ typedef  @int_value@             apr_int32_t;
     typedef  unsigned @int_value@    apr_uint32_t;
     
     #define APR_SIZEOF_VOIDP @voidp_size@
    +#define APR_SIZEOF_OFF_T @off_t_size@
     
     /*
      * Darwin 10's default compiler (gcc42) builds for both 64 and
    
    From 590d55844bcbbce3d33c1090b1531efa3b02b175 Mon Sep 17 00:00:00 2001
    From: Yann Ylavic 
    Date: Wed, 25 Jul 2018 11:18:22 +0000
    Subject: [PATCH 7833/7878] Follow up to r1836616: Provide APR_SIZEOF_OFF_T on
     Windows/Netware too.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836619 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr.hnw | 5 +++++
     include/apr.hw  | 5 +++++
     include/apr.hwc | 5 +++++
     3 files changed, 15 insertions(+)
    
    diff --git a/include/apr.hnw b/include/apr.hnw
    index 120201bcee5..3fda77e25eb 100644
    --- a/include/apr.hnw
    +++ b/include/apr.hnw
    @@ -266,6 +266,11 @@ typedef  apr_uint64_t      apr_ino_t;
     #else
     #define APR_SIZEOF_VOIDP   4
     #endif
    +#if APR_HAS_LARGE_FILES
    +#define APR_SIZEOF_OFF_T   8
    +#else
    +#define APR_SIZEOF_OFF_T   4
    +#endif
     
     #if APR_SIZEOF_VOIDP == 8
     typedef  apr_uint64_t            apr_uintptr_t;
    diff --git a/include/apr.hw b/include/apr.hw
    index 6366ba93290..4d74d2f9138 100644
    --- a/include/apr.hw
    +++ b/include/apr.hw
    @@ -404,6 +404,11 @@ typedef  apr_uint64_t      apr_ino_t;
     #else
     #define APR_SIZEOF_VOIDP   4
     #endif
    +#if APR_HAS_LARGE_FILES
    +#define APR_SIZEOF_OFF_T   8
    +#else
    +#define APR_SIZEOF_OFF_T   4
    +#endif
     
     #if APR_SIZEOF_VOIDP == 8
     typedef  apr_uint64_t            apr_uintptr_t;
    diff --git a/include/apr.hwc b/include/apr.hwc
    index 061a5299c0c..6f242a0ed4e 100644
    --- a/include/apr.hwc
    +++ b/include/apr.hwc
    @@ -404,6 +404,11 @@ typedef  apr_uint64_t      apr_ino_t;
     #else
     #define APR_SIZEOF_VOIDP   4
     #endif
    +#if APR_HAS_LARGE_FILES
    +#define APR_SIZEOF_OFF_T   8
    +#else
    +#define APR_SIZEOF_OFF_T   4
    +#endif
     
     #if APR_SIZEOF_VOIDP == 8
     typedef  apr_uint64_t            apr_uintptr_t;
    
    From e85c01bbd7361ce722703c9fb67d92e47a85d88f Mon Sep 17 00:00:00 2001
    From: Graham Leggett 
    Date: Thu, 2 Aug 2018 16:54:54 +0000
    Subject: [PATCH 7834/7878] Pass the apr_json_value_t into the
     apr_json_object_get() function to be consistent with the rest of the API.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1837327 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_json.h | 2 +-
     json/apr_json.c    | 8 ++++++--
     2 files changed, 7 insertions(+), 3 deletions(-)
    
    diff --git a/include/apr_json.h b/include/apr_json.h
    index 6850feccd5c..ea87a279309 100644
    --- a/include/apr_json.h
    +++ b/include/apr_json.h
    @@ -265,7 +265,7 @@ APR_DECLARE(apr_status_t) apr_json_object_set(apr_json_value_t *obj,
      * @return Returns NULL if the key is not present.
      */
     APR_DECLARE(apr_json_kv_t *)
    -        apr_json_object_get(apr_json_object_t *obj, const char *key)
    +        apr_json_object_get(apr_json_value_t *obj, const char *key)
             __attribute__((nonnull(1, 2)));
     
     /**
    diff --git a/json/apr_json.c b/json/apr_json.c
    index c7a6efee252..b035c435f6b 100644
    --- a/json/apr_json.c
    +++ b/json/apr_json.c
    @@ -159,7 +159,11 @@ apr_status_t apr_json_object_set(apr_json_value_t *object, apr_json_value_t *key
         return APR_SUCCESS;
     }
     
    -apr_json_kv_t *apr_json_object_get(apr_json_object_t *object, const char *key)
    +apr_json_kv_t *apr_json_object_get(apr_json_value_t *object, const char *key)
     {
    -    return apr_hash_get(object->hash, key, APR_HASH_KEY_STRING);
    +    if (object->type != APR_JSON_OBJECT) {
    +        return NULL;
    +    }
    +
    +    return apr_hash_get(object->value.object->hash, key, APR_HASH_KEY_STRING);
     }
    
    From d37c764dd2ed5929806a8cfd70efa705505baf7e Mon Sep 17 00:00:00 2001
    From: Graham Leggett 
    Date: Fri, 3 Aug 2018 16:29:59 +0000
    Subject: [PATCH 7835/7878] Add the ability to overlay one JSON object over
     another.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1837383 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_json.h | 29 ++++++++++++++++++++++++
     json/apr_json.c    | 56 ++++++++++++++++++++++++++++++++++++++++++++++
     test/testjson.c    | 30 +++++++++++++++++++++++++
     3 files changed, 115 insertions(+)
    
    diff --git a/include/apr_json.h b/include/apr_json.h
    index ea87a279309..3fc127e238a 100644
    --- a/include/apr_json.h
    +++ b/include/apr_json.h
    @@ -77,6 +77,11 @@ extern "C" {
      */
     #define APR_JSON_FLAGS_WHITESPACE 1
     
    +/**
    + * Flag indicating strict overlay.
    + */
    +#define APR_JSON_FLAGS_STRICT 2
    +
     /**
      * A structure to hold a JSON object.
      */
    @@ -310,6 +315,30 @@ APR_DECLARE(apr_status_t) apr_json_encode(apr_bucket_brigade * brigade,
             apr_brigade_flush flush, void *ctx, const apr_json_value_t * json,
             int flags, apr_pool_t * pool) __attribute__((nonnull(1, 4, 6)));
     
    +/**
    + * Overlay one JSON object over a second JSON object.
    + *
    + * If the values are objects, a new object will be returned containing
    + * all keys from the overlay superimposed on the base.
    + *
    + * Keys that appear in the overlay will replace keys in the base, unless
    + * APR_JSON_FLAGS_STRICT is specified, in which case NULL will be returned.
    + *
    + * If the base is not an object, overlay will be returned.
    + * @param p pool to use
    + * @param overlay the JSON object to overlay on top of base. If NULL, the
    + *   base will be returned.
    + * @param base the base JSON object. If NULL, the overlay will be returned.
    + * @param flags set to APR_JSON_FLAGS_STRICT to fail if object keys are not
    + *   unique, or APR_JSON_FLAGS_NONE to replace keys in base with overlay.
    + * @return A new object containing the result. If APR_JSON_FLAGS_STRICT was
    + *   specified and a key was present in overlay that was also present in base,
    + *   NULL will be returned.
    + */
    +APR_DECLARE(apr_json_value_t *) apr_json_overlay(apr_pool_t *p,
    +        apr_json_value_t *overlay, apr_json_value_t *base,
    +        int flags) __attribute__((nonnull(1)));;
    +
     #ifdef __cplusplus
     }
     #endif
    diff --git a/json/apr_json.c b/json/apr_json.c
    index b035c435f6b..4d671d1cd09 100644
    --- a/json/apr_json.c
    +++ b/json/apr_json.c
    @@ -167,3 +167,59 @@ apr_json_kv_t *apr_json_object_get(apr_json_value_t *object, const char *key)
     
         return apr_hash_get(object->value.object->hash, key, APR_HASH_KEY_STRING);
     }
    +
    +apr_json_value_t *apr_json_overlay(apr_pool_t *p,
    +        apr_json_value_t *overlay, apr_json_value_t *base,
    +        int flags)
    +{
    +    apr_json_value_t *res;
    +    apr_json_kv_t *kv;
    +    int oc, bc;
    +
    +    if (!base || base->type != APR_JSON_OBJECT) {
    +        return overlay;
    +    }
    +    if (!overlay) {
    +        return base;
    +    }
    +    if (overlay->type != APR_JSON_OBJECT) {
    +        return overlay;
    +    }
    +
    +    oc = apr_hash_count(overlay->value.object->hash);
    +    if (!oc) {
    +        return base;
    +    }
    +    bc = apr_hash_count(base->value.object->hash);
    +    if (!bc) {
    +        return overlay;
    +    }
    +
    +    res = apr_json_object_create(p);
    +
    +    for (kv = APR_RING_FIRST(&(base->value.object)->list);
    +         kv != APR_RING_SENTINEL(&(base->value.object)->list, apr_json_kv_t, link);
    +         kv = APR_RING_NEXT((kv), link)) {
    +
    +        if (!apr_hash_get(overlay->value.object->hash, kv->k->value.string.p,
    +                kv->k->value.string.len)) {
    +
    +            apr_json_object_set(res, kv->k, kv->v, p);
    +
    +        }
    +        else if (APR_JSON_FLAGS_STRICT & flags) {
    +            return NULL;
    +        }
    +
    +    }
    +
    +    for (kv = APR_RING_FIRST(&(overlay->value.object)->list);
    +         kv != APR_RING_SENTINEL(&(overlay->value.object)->list, apr_json_kv_t, link);
    +         kv = APR_RING_NEXT((kv), link)) {
    +
    +        apr_json_object_set(res, kv->k, kv->v, p);
    +
    +    }
    +
    +    return res;
    +}
    diff --git a/test/testjson.c b/test/testjson.c
    index 16bb5dce34e..0777eb14add 100644
    --- a/test/testjson.c
    +++ b/test/testjson.c
    @@ -149,6 +149,35 @@ static void test_json_string(abts_case * tc, void *data)
                 (memcmp(expected, json->value.string.p, json->value.string.len) == 0));
     }
     
    +static void test_json_overlay(abts_case * tc, void *data)
    +{
    +	const char *o = "{\"o1\":\"foo\",\"common\":\"bar\",\"o2\":\"baz\"}";
    +	const char *b = "{\"b1\":\"foo\",\"common\":\"bar\",\"b2\":\"baz\"}";
    +
    +	apr_json_value_t *res;
    +	apr_json_value_t *base;
    +	apr_json_value_t *overlay;
    +
    +	apr_off_t offset;
    +	apr_status_t status;
    +
    +    status = apr_json_decode(&base, b, APR_JSON_VALUE_STRING, &offset,
    +            APR_JSON_FLAGS_WHITESPACE, 10, p);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, status);
    +
    +    status = apr_json_decode(&overlay, o, APR_JSON_VALUE_STRING, &offset,
    +            APR_JSON_FLAGS_WHITESPACE, 10, p);
    +    ABTS_INT_EQUAL(tc, APR_SUCCESS, status);
    +
    +    res = apr_json_overlay(p, overlay, base, APR_JSON_FLAGS_NONE);
    +    ABTS_INT_EQUAL(tc, 5, apr_hash_count(res->value.object->hash));
    +
    +    res = apr_json_overlay(p, overlay, base, APR_JSON_FLAGS_STRICT);
    +    ABTS_ASSERT(tc, "overlay strict should return NULL",
    +            (res == NULL));
    +
    +}
    +
     abts_suite *testjson(abts_suite * suite)
     {
         suite = ADD_SUITE(suite);
    @@ -157,6 +186,7 @@ abts_suite *testjson(abts_suite * suite)
         abts_run_test(suite, test_json_level, NULL);
         abts_run_test(suite, test_json_eof, NULL);
         abts_run_test(suite, test_json_string, NULL);
    +    abts_run_test(suite, test_json_overlay, NULL);
     
         return suite;
     }
    
    From db8af37f6318956bcc0c2db6213a3511d03b574d Mon Sep 17 00:00:00 2001
    From: Yann Ylavic 
    Date: Sat, 4 Aug 2018 16:41:40 +0000
    Subject: [PATCH 7836/7878] crypto: move APR_USE_OPENSSL_PRE* definitions to
     apr_crypto_internal.h.
    
    They can (and will) be used by other openssl related code, so share them.
    
    s/#ifndef APR_USE_OPENSSL_PRE_1_1_1_API/#if !APR_USE_OPENSSL_PRE_1_1_1_API/ and
    fix revealed compilation error.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1837429 13f79535-47bb-0310-9956-ffa450edef68
    ---
     crypto/apr_crypto_openssl.c           | 20 ++------------------
     include/private/apr_crypto_internal.h | 18 ++++++++++++++++++
     2 files changed, 20 insertions(+), 18 deletions(-)
    
    diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c
    index 5186e6b42e9..dcaa01a3023 100644
    --- a/crypto/apr_crypto_openssl.c
    +++ b/crypto/apr_crypto_openssl.c
    @@ -38,22 +38,6 @@
     
     #define LOG_PREFIX "apr_crypto_openssl: "
     
    -#ifndef APR_USE_OPENSSL_PRE_1_1_API
    -#if defined(LIBRESSL_VERSION_NUMBER)
    -/* LibreSSL declares OPENSSL_VERSION_NUMBER == 2.0 but does not include most
    - * changes from OpenSSL >= 1.1 (new functions, macros, deprecations, ...), so
    - * we have to work around this...
    - */
    -#define APR_USE_OPENSSL_PRE_1_1_API (1)
    -#define APR_USE_OPENSSL_PRE_1_1_1_API (1)
    -#define APR_USE_OPENSSL_PRE_1_0_API (0)
    -#else
    -#define APR_USE_OPENSSL_PRE_1_1_API (OPENSSL_VERSION_NUMBER < 0x10100000L)
    -#define APR_USE_OPENSSL_PRE_1_1_1_API (OPENSSL_VERSION_NUMBER < 0x10101000L)
    -#define APR_USE_OPENSSL_PRE_1_0_API (OPENSSL_VERSION_NUMBER < 0x10000000L)
    -#endif
    -#endif
    -
     struct apr_crypto_t {
         apr_pool_t *pool;
         const apr_crypto_driver_t *provider;
    @@ -681,7 +665,7 @@ static apr_status_t crypto_key(apr_crypto_key_t **k,
     
         case APR_CRYPTO_KTYPE_CMAC: {
     
    -#ifndef APR_USE_OPENSSL_PRE_1_1_1_API
    +#if !APR_USE_OPENSSL_PRE_1_1_1_API
             apr_crypto_config_t *config = f->config;
     
             /* decide on what cipher mechanism we will be using */
    @@ -696,7 +680,7 @@ static apr_status_t crypto_key(apr_crypto_key_t **k,
                 return APR_ENOKEY;
             }
     
    -        switch (rec->k.hmac.hmac) {
    +        switch (rec->k.hmac.digest) {
             case APR_CRYPTO_DIGEST_MD5:
                 key->hmac = EVP_md5();
                 break;
    diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h
    index 936d6dc504d..eab92fef90d 100644
    --- a/include/private/apr_crypto_internal.h
    +++ b/include/private/apr_crypto_internal.h
    @@ -366,6 +366,24 @@ struct apr_crypto_driver_t {
     };
     
     #if APU_HAVE_OPENSSL
    +#include 
    +
    +#ifndef APR_USE_OPENSSL_PRE_1_1_API
    +#if defined(LIBRESSL_VERSION_NUMBER)
    +/* LibreSSL declares OPENSSL_VERSION_NUMBER == 2.0 but does not necessarily
    + * include changes from OpenSSL >= 1.1 (new functions, macros, * deprecations,
    + * ...), so we have to work around this...
    + */
    +#define APR_USE_OPENSSL_PRE_1_0_API     (0)
    +#define APR_USE_OPENSSL_PRE_1_1_API     (LIBRESSL_VERSION_NUMBER < 0x2070000f)
    +#define APR_USE_OPENSSL_PRE_1_1_1_API   (1)
    +#else  /* defined(LIBRESSL_VERSION_NUMBER) */
    +#define APR_USE_OPENSSL_PRE_1_0_API     (OPENSSL_VERSION_NUMBER < 0x10000000L)
    +#define APR_USE_OPENSSL_PRE_1_1_API     (OPENSSL_VERSION_NUMBER < 0x10100000L)
    +#define APR_USE_OPENSSL_PRE_1_1_1_API   (OPENSSL_VERSION_NUMBER < 0x10101000L)
    +#endif /* defined(LIBRESSL_VERSION_NUMBER) */
    +#endif /* ndef APR_USE_OPENSSL_PRE_1_1_API */
    +
     const char *apr__crypto_openssl_version(void);
     apr_status_t apr__crypto_openssl_init(const char *params,
                                           const apu_err_t **result,
    
    From fec21995ef214493650e39077d1267b55cc30f2c Mon Sep 17 00:00:00 2001
    From: Yann Ylavic 
    Date: Sat, 4 Aug 2018 16:48:20 +0000
    Subject: [PATCH 7837/7878] crypto: follow up to r1833421.
    
    Link with OpenSSL's libssl in addition to libcrypto, so that we can initialize
    and deinitialize them together (libssl can't do this independently).
    
    Also, for older OpenSSL versions, initialize the threading locks needed by the
    lib at runtime.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1837430 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/crypto.m4              |   2 +-
     crypto/apr_crypto_internal.c | 269 ++++++++++++++++++++++++++++++++++-
     2 files changed, 268 insertions(+), 3 deletions(-)
    
    diff --git a/build/crypto.m4 b/build/crypto.m4
    index d4719b34f33..1930452daa3 100644
    --- a/build/crypto.m4
    +++ b/build/crypto.m4
    @@ -132,7 +132,7 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [
       dnl Since we have already done the AC_CHECK_LIB tests, if we have it, 
       dnl we know the library is there.
       if test "$apu_have_openssl" = "1"; then
    -    APR_ADDTO(LDADD_crypto_openssl, [$openssl_LDFLAGS -lcrypto])
    +    APR_ADDTO(LDADD_crypto_openssl, [$openssl_LDFLAGS -lssl -lcrypto])
         apu_have_crypto=1
     
         AC_MSG_CHECKING([for const input buffers in OpenSSL])
    diff --git a/crypto/apr_crypto_internal.c b/crypto/apr_crypto_internal.c
    index 6b4c1c9eb32..ecec5a428f6 100644
    --- a/crypto/apr_crypto_internal.c
    +++ b/crypto/apr_crypto_internal.c
    @@ -24,12 +24,23 @@
     #if APU_HAVE_CRYPTO
     
     #if APU_HAVE_OPENSSL
    +#include "apr_thread_mutex.h"
     
     #include 
     #include 
     #include 
     #include 
     #include 
    +#include 
    +
    +#if APR_HAS_THREADS && APR_USE_OPENSSL_PRE_1_1_API
    +static apr_status_t ossl_thread_setup(apr_pool_t *pool);
    +#else
    +static APR_INLINE apr_status_t ossl_thread_setup(apr_pool_t *pool)
    +{
    +    return APR_SUCCESS;
    +}
    +#endif
     
     const char *apr__crypto_openssl_version(void)
     {
    @@ -51,7 +62,10 @@ apr_status_t apr__crypto_openssl_init(const char *params,
         ENGINE_load_builtin_engines();
         ENGINE_register_all_complete();
     
    -    return APR_SUCCESS;
    +    SSL_load_error_strings();
    +    SSL_library_init();
    +
    +    return ossl_thread_setup(pool);
     }
     
     apr_status_t apr__crypto_openssl_term(void)
    @@ -81,11 +95,262 @@ apr_status_t apr__crypto_openssl_term(void)
     
     #else   /* OPENSSL_VERSION_NUMBER >= 0x10100000L */
         OPENSSL_cleanup();
    -#endif	/* OPENSSL_VERSION_NUMBER >= 0x10100000L */
    +#endif  /* OPENSSL_VERSION_NUMBER >= 0x10100000L */
    +
    +    return APR_SUCCESS;
    +}
    +
    +/*
    + * To ensure thread-safetyness in OpenSSL - work in progress
    + * Taken from httpd's mod_ssl code.
    + */
    +
    +#if APR_HAS_THREADS && APR_USE_OPENSSL_PRE_1_1_API
    +
    +static apr_thread_mutex_t **ossl_locks;
    +static int                  ossl_num_locks;
    +
    +static void ossl_thread_locking(int mode, int type, const char *file, int line)
    +{
    +    if (type < ossl_num_locks) {
    +        if (mode & CRYPTO_LOCK) {
    +            (void)apr_thread_mutex_lock(ossl_locks[type]);
    +        }
    +        else {
    +            (void)apr_thread_mutex_unlock(ossl_locks[type]);
    +        }
    +    }
    +}
    +
    +/* Dynamic lock structure */
    +struct CRYPTO_dynlock_value {
    +    apr_pool_t *pool;
    +    apr_thread_mutex_t *mutex;
    +    const char* file;
    +    int line;
    +};
    +
    +/* Global reference to the pool passed into ossl_thread_setup() */
    +static apr_pool_t *ossl_dynlock_pool = NULL;
    +
    +/*
    + * Dynamic lock creation callback
    + */
    +static
    +struct CRYPTO_dynlock_value *ossl_dynlock_create(const char *file, int line)
    +{
    +    struct CRYPTO_dynlock_value *value;
    +    apr_status_t rv;
    +    apr_pool_t *p;
    +
    +    /*
    +     * We need a pool to allocate our mutex.  Since we can't clear
    +     * allocated memory from a pool, create a subpool that we can blow
    +     * away in the destruction callback.
    +     */
    +    rv = apr_pool_create(&p, ossl_dynlock_pool);
    +    if (rv != APR_SUCCESS) {
    +        return NULL;
    +    }
     
    +    value = apr_palloc(p, sizeof(*value));
    +
    +    rv = apr_thread_mutex_create(&value->mutex, APR_THREAD_MUTEX_DEFAULT, p);
    +    if (rv != APR_SUCCESS) {
    +        apr_pool_destroy(p);
    +        return NULL;
    +    }
    +
    +    /* Keep our own copy of the place from which we were created,
    +       using our own pool. */
    +    value->file = apr_pstrdup(p, file);
    +    value->line = line;
    +    value->pool = p;
    +    return value;
    +}
    +
    +/*
    + * Dynamic locking and unlocking function
    + */
    +
    +static void ossl_dynlock_locking(int mode, struct CRYPTO_dynlock_value *l,
    +                                 const char *file, int line)
    +{
    +    if (mode & CRYPTO_LOCK) {
    +        (void)apr_thread_mutex_lock(l->mutex);
    +    }
    +    else {
    +        (void)apr_thread_mutex_unlock(l->mutex);
    +    }
    +}
    +
    +/*
    + * Dynamic lock destruction callback
    + */
    +static void ossl_dynlock_destroy(struct CRYPTO_dynlock_value *l,
    +                                 const char *file, int line)
    +{
    +    /* Trust that whomever owned the CRYPTO_dynlock_value we were
    +     * passed has no future use for it...
    +     */
    +    apr_pool_destroy(l->pool);
    +}
    +
    +/* Windows and BeOS can use the default THREADID callback shipped with OpenSSL
    + * 1.0.x, as can any platform with a thread-safe errno.
    + */
    +#define OSSL_DEFAULT_THREADID_IS_SAFE (OPENSSL_VERSION_NUMBER >= 0x10000000L \
    +                                       && (defined(_REENTRANT) \
    +                                           || __BEOS__ \
    +                                           || _WIN32 \
    +                                           ))
    +#if OSSL_DEFAULT_THREADID_IS_SAFE
    +
    +/* We don't need to set up a threadid callback on this platform. */
    +static APR_INLINE apr_status_t ossl_thread_id_setup(apr_pool_t *pool)
    +{
         return APR_SUCCESS;
     }
     
    +static APR_INLINE apr_status_t ossl_thread_id_cleanup(void)
    +{
    +    return APR_SUCCESS;
    +}
    +
    +#else
    +
    +/**
    + * Used by both versions of ossl_thread_id(). Returns an unsigned long that
    + * should be unique to the currently executing thread.
    + */
    +static unsigned long ossl_thread_id_internal(void)
    +{
    +    /* OpenSSL needs this to return an unsigned long.  On OS/390, the pthread
    +     * id is a structure twice that big.  Use the TCB pointer instead as a
    +     * unique unsigned long.
    +     */
    +#ifdef __MVS__
    +    struct PSA {
    +        char unmapped[540]; /* PSATOLD is at offset 540 in the PSA */
    +        unsigned long PSATOLD;
    +    } *psaptr = 0; /* PSA is at address 0 */
    +
    +    return psaptr->PSATOLD;
    +#else
    +    return (unsigned long) apr_os_thread_current();
    +#endif
    +}
    +
    +#ifndef OPENSSL_NO_DEPRECATED
    +
    +static unsigned long ossl_thread_id(void)
    +{
    +    return ossl_thread_id_internal();
    +}
    +
    +#else
    +
    +static void ossl_thread_id(CRYPTO_THREADID *id)
    +{
    +    /* XXX Ideally we would be using the _set_pointer() callback on platforms
    +     * that have a pointer-based thread "identity". But this entire API is
    +     * fraught with problems (see PR60947) and has been removed completely in
    +     * OpenSSL 1.1.0, so I'm not too invested in fixing it right now. */
    +    CRYPTO_THREADID_set_numeric(id, ossl_thread_id_internal());
    +}
    +
    +#endif /* OPENSSL_NO_DEPRECATED */
    +
    +static apr_status_t ossl_thread_id_cleanup(void)
    +{
    +#ifndef OPENSSL_NO_DEPRECATED
    +    CRYPTO_set_id_callback(NULL);
    +#else
    +    /* XXX This does nothing. The new-style THREADID callback is write-once. */
    +    CRYPTO_THREADID_set_callback(NULL);
    +#endif
    +
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t ossl_thread_id_setup(apr_pool_t *pool)
    +{
    +#ifndef OPENSSL_NO_DEPRECATED
    +    /* This API is deprecated, but we prefer it to its replacement since it
    +     * allows us to unset the callback when this module is being unloaded. */
    +    CRYPTO_set_id_callback(ossl_thread_id);
    +#else
    +    /* This is a last resort. We can only set this once, which means that we'd
    +     * better not get reloaded into a different address. See PR60947.
    +     */
    +    CRYPTO_THREADID_set_callback(ossl_thread_id);
    +
    +    if (CRYPTO_THREADID_get_callback() != ossl_thread_id) {
    +        return APR_EGENERAL;
    +    }
    +#endif
    +
    +    return APR_SUCCESS;
    +}
    +
    +#endif /* OSSL_DEFAULT_THREADID_IS_SAFE */
    +
    +static apr_status_t ossl_thread_cleanup(void *data)
    +{
    +    CRYPTO_set_dynlock_create_callback(NULL);
    +    CRYPTO_set_dynlock_lock_callback(NULL);
    +    CRYPTO_set_dynlock_destroy_callback(NULL);
    +    ossl_dynlock_pool = NULL;
    +
    +    CRYPTO_set_locking_callback(NULL);
    +
    +    ossl_thread_id_cleanup();
    +
    +    return APR_SUCCESS;
    +}
    +
    +static apr_status_t ossl_thread_setup(apr_pool_t *pool)
    +{
    +    apr_status_t rv;
    +    int i, num_locks;
    +
    +    rv = ossl_thread_id_setup(pool);
    +    if (rv != APR_SUCCESS) {
    +        return rv;
    +    }
    +
    +    num_locks = CRYPTO_num_locks();
    +    ossl_locks = apr_palloc(pool, num_locks * sizeof(*ossl_locks));
    +    if (!ossl_locks) {
    +        return APR_ENOMEM;
    +    }
    +    for (i = 0; i < num_locks; i++) {
    +        rv = apr_thread_mutex_create(&ossl_locks[i],
    +                                     APR_THREAD_MUTEX_DEFAULT, pool);
    +        if (rv != APR_SUCCESS) {
    +            return rv;
    +        }
    +    }
    +    ossl_num_locks = num_locks;
    +
    +    CRYPTO_set_locking_callback(ossl_thread_locking);
    +
    +    /* Set up dynamic locking scaffolding for OpenSSL to use at its
    +     * convenience.
    +     */
    +    ossl_dynlock_pool = pool;
    +    CRYPTO_set_dynlock_create_callback(ossl_dynlock_create);
    +    CRYPTO_set_dynlock_lock_callback(ossl_dynlock_locking);
    +    CRYPTO_set_dynlock_destroy_callback(ossl_dynlock_destroy);
    +
    +    apr_pool_cleanup_register(pool, NULL, ossl_thread_cleanup,
    +                              apr_pool_cleanup_null);
    +    return APR_SUCCESS;
    +}
    +
    +#endif /* #if APR_HAS_THREADS && APR_USE_OPENSSL_PRE_1_1_API */
    +
    +
     #endif /* APU_HAVE_OPENSSL */
     
     
    
    From 1b501809e8860811f0816da07ba1d37af6c3c09d Mon Sep 17 00:00:00 2001
    From: Graham Leggett 
    Date: Sun, 19 Aug 2018 11:39:35 +0000
    Subject: [PATCH 7838/7878] Add apr_errprintf() as a convenience function to
     create and populate apu_err_t.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1838375 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES               |  3 +++
     include/apu_errno.h   | 22 +++++++++++++++++++++
     util-misc/apr_error.c | 45 +++++++++++++++++++++++++++++++++++++++++++
     3 files changed, 70 insertions(+)
     create mode 100644 util-misc/apr_error.c
    
    diff --git a/CHANGES b/CHANGES
    index b201082c7bc..0fa0648edee 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
     Changes for APR 2.0.0
     
    +  *) Add apr_errprintf() as a convenience function to create and
    +     populate apu_err_t. [Graham Leggett]
    +
       *) apr_crypto: Add support for digest functions, with hashing, signing
          and verifying. [Graham Leggett]
     
    diff --git a/include/apu_errno.h b/include/apu_errno.h
    index 7d967add6f1..5c309b4f223 100644
    --- a/include/apu_errno.h
    +++ b/include/apu_errno.h
    @@ -24,6 +24,7 @@
     
     #include "apr.h"
     #include "apr_errno.h"
    +#include "apr_pools.h"
     
     #ifdef __cplusplus
     extern "C" {
    @@ -171,6 +172,27 @@ typedef struct apu_err_t {
         int rc;
     } apu_err_t;
     
    +/**
    + * Populate a apu_err_t structure with the given error, allocated
    + * from the given pool.
    + *
    + * If the result parameter points at a NULL pointer, a apu_err_t
    + * structure will be allocated, otherwise the apu_err_t structure
    + * will be reused.
    + * @param result If points to NULL, the apu_err_t structure is
    + *   allocated and returned, otherwise the existing apu_err_t is used.
    + * @param p The pool to use.
    + * @param reason The reason string, may be NULL.
    + * @param rc The underlying result code.
    + * @param fmt The format of the string
    + * @param ... The arguments to use while printing the data
    + * @return APR_SUCCESS on success, APR_ENOMEM if out of memory.
    + */
    +APR_DECLARE_NONSTD(apr_status_t) apr_errprintf(apu_err_t **result,
    +        apr_pool_t *p, const char *reason, int rc, const char *fmt, ...)
    +        __attribute__((format(printf,5,6)))
    +        __attribute__((nonnull(1,2)));
    +
     /** @} */
     
     #ifdef __cplusplus
    diff --git a/util-misc/apr_error.c b/util-misc/apr_error.c
    new file mode 100644
    index 00000000000..a3835e1a98a
    --- /dev/null
    +++ b/util-misc/apr_error.c
    @@ -0,0 +1,45 @@
    +/* Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * levelations under the License.
    + */
    +
    +#include "apu.h"
    +#include "apr_strings.h"
    +#include "apr_pools.h"
    +#include "apu_errno.h"
    +
    +APR_DECLARE_NONSTD(apr_status_t) apr_errprintf(apu_err_t **result,
    +        apr_pool_t *p, const char *reason, int rc, const char *fmt, ...)
    +{
    +    va_list ap;
    +    apu_err_t *res;
    +
    +    res = *result;
    +    if (!res) {
    +        res = *result = apr_pcalloc(p, sizeof(apu_err_t));
    +        if (!res) {
    +            return APR_ENOMEM;
    +        }
    +    }
    +
    +    va_start(ap, fmt);
    +    res->msg = apr_pvsprintf(p, fmt, ap);
    +    va_end(ap);
    +
    +    res->reason = reason;
    +    res->rc = rc;
    +
    +    return APR_SUCCESS;
    +}
    +
    
    From af4a4147ec97f530f96acf0da6c31a263c0952d2 Mon Sep 17 00:00:00 2001
    From: Rainer Jung 
    Date: Sat, 25 Aug 2018 14:52:48 +0000
    Subject: [PATCH 7839/7878] If --with-installbuilddir is not supplied, it
     unconditially overrides the value set by APR_SET_LAYOUT. Disable that and
     stop showing an invalid default value.
    
    PR 56090.
    
    Patch provided by Michael Osipov.
    
    This fixes #11.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839068 13f79535-47bb-0310-9956-ffa450edef68
    ---
     Makefile.in   | 1 +
     config.layout | 1 +
     configure.in  | 4 ++--
     3 files changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/Makefile.in b/Makefile.in
    index c3c203bcf42..bf1b55b72d6 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -70,6 +70,7 @@ exec_prefix=@exec_prefix@
     bindir=@bindir@
     libdir=@libdir@
     includedir=@includedir@
    +datadir=@datadir@
     installbuilddir=@installbuilddir@
     
     LDADD_dbd_pgsql = @LDADD_dbd_pgsql@
    diff --git a/config.layout b/config.layout
    index 0f42e84e273..fb087a855af 100644
    --- a/config.layout
    +++ b/config.layout
    @@ -223,6 +223,7 @@
         libexecdir:    ${exec_prefix}/lib/apr/modules
         mandir:        ${exec_prefix}/share/man
         datadir:       ${exec_prefix}/share/apr
    +    installbuilddir: ${datadir}/build-${APR_MAJOR_VERSION}
         includedir:    ${exec_prefix}/include/apr-${APR_MAJOR_VERSION}
         localstatedir: ${prefix}/var/run
         runtimedir:    ${prefix}/var/run
    diff --git a/configure.in b/configure.in
    index 6f56b8f9973..58bd7983c31 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -286,8 +286,8 @@ AC_PROG_LIBTOOL
         ;;
     esac
     
    -AC_ARG_WITH(installbuilddir, [  --with-installbuilddir=DIR location to store APR build files (defaults to '${datadir}/build')],
    -  [ installbuilddir=$withval ], [ installbuilddir="${datadir}/build-${APR_MAJOR_VERSION}" ] )
    +AC_ARG_WITH(installbuilddir, [  --with-installbuilddir=DIR location to store APR build files],
    +  [ installbuilddir=$withval ] )
     AC_SUBST(installbuilddir)
     
     AC_ARG_WITH(libtool, [  --without-libtool       avoid using libtool to link the library],
    
    From ceb60174e3023e3b1c8bd592ec2497197e8fd4d9 Mon Sep 17 00:00:00 2001
    From: Christophe Jaillet 
    Date: Sat, 25 Aug 2018 20:58:49 +0000
    Subject: [PATCH 7840/7878] Follow-up to r1832203.
    
    Fix missing 'args' declaration
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839113 13f79535-47bb-0310-9956-ffa450edef68
    ---
     misc/win32/start.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/misc/win32/start.c b/misc/win32/start.c
    index 131d55622e1..2d7b5ff8f9a 100644
    --- a/misc/win32/start.c
    +++ b/misc/win32/start.c
    @@ -48,7 +48,7 @@ static int warrsztoastr(const char * const * *retarr,
         char **env;
         char *pstrs;
         char *strs;
    -    int arg;
    +    int arg, args;
     
         for (args = 1, wch = arrsz; wch[0] || wch[1]; ++wch)
             if (!*wch)
    
    From 57eb8dd6281c913dc44fc7eef6e3650c3ef69e3b Mon Sep 17 00:00:00 2001
    From: Christophe Jaillet 
    Date: Sun, 26 Aug 2018 10:00:53 +0000
    Subject: [PATCH 7841/7878] Slightly improve doxygen generated documentation.
    
    Add some links to function
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839182 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_atomic.h    |  2 +-
     include/apr_file_info.h |  4 ++--
     include/apr_general.h   | 25 +++++++++++++------------
     include/apr_portable.h  |  2 +-
     include/apr_strings.h   |  4 ++--
     include/apr_tables.h    |  8 ++++----
     6 files changed, 23 insertions(+), 22 deletions(-)
    
    diff --git a/include/apr_atomic.h b/include/apr_atomic.h
    index f34fdd2bd2e..4e7879000e9 100644
    --- a/include/apr_atomic.h
    +++ b/include/apr_atomic.h
    @@ -41,7 +41,7 @@ extern "C" {
      * @param p pool
      * @return APR_SUCCESS on successful completion
      * @remark Programs do NOT need to call this directly. APR will call this
    - *         automatically from apr_initialize.
    + *         automatically from apr_initialize().
      * @internal
      */
     APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p);
    diff --git a/include/apr_file_info.h b/include/apr_file_info.h
    index 1d19eb6a3f4..cfddc68da8b 100644
    --- a/include/apr_file_info.h
    +++ b/include/apr_file_info.h
    @@ -50,7 +50,7 @@ extern "C" {
     
     /** apr_filetype_e values for the filetype member of the 
      * apr_file_info_t structure
    - * @warning: Not all of the filetypes below can be determined.
    + * @warning Not all of the filetypes below can be determined.
      * For example, a given platform might not correctly report 
      * a socket descriptor as APR_SOCK if that type isn't 
      * well-identified on that platform.  In such cases where
    @@ -413,7 +413,7 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p);
      * Determine the encoding used internally by the FilePath functions
      * @param style points to a variable which receives the encoding style flag
      * @param p the pool to allocate any working storage
    - * @remark Use @c apr_os_locale_encoding and/or @c apr_os_default_encoding
    + * @remark Use apr_os_locale_encoding() and/or apr_os_default_encoding()
      * to get the name of the path encoding if it's not UTF-8.
      */
     APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p);
    diff --git a/include/apr_general.h b/include/apr_general.h
    index 07b49f59fbe..4f2a6e8c4be 100644
    --- a/include/apr_general.h
    +++ b/include/apr_general.h
    @@ -183,8 +183,8 @@ struct type { \
     /**
      * Setup any APR internal data structures.  This MUST be the first function 
      * called for any APR library. It is safe to call apr_initialize several
    - * times as long as apr_terminate is called the same number of times.
    - * @remark See apr_app_initialize if this is an application, rather than
    + * times as long as apr_terminate() is called the same number of times.
    + * @remark See apr_app_initialize() if this is an application, rather than
      * a library consumer of apr.
      */
     APR_DECLARE(apr_status_t) apr_initialize(void);
    @@ -197,9 +197,9 @@ APR_DECLARE(apr_status_t) apr_initialize(void);
      * @param argc Pointer to the argc that may be corrected
      * @param argv Pointer to the argv that may be corrected
      * @param env Pointer to the env that may be corrected, may be NULL
    - * @remark See apr_initialize if this is a library consumer of apr.
    - * Otherwise, this call is identical to apr_initialize, and must be closed
    - * with a call to apr_terminate at the end of program execution.
    + * @remark See apr_initialize() if this is a library consumer of apr.
    + * Otherwise, this call is identical to apr_initialize(), and must be closed
    + * with a call to apr_terminate() at the end of program execution.
      */
     APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, 
                                                  char const * const * *argv, 
    @@ -211,20 +211,21 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc,
      * apr_initialize() or apr_app_initialize().
      * @remark An APR program must call this function at termination once it 
      *         has stopped using APR services.  The APR developers suggest using
    - *         atexit to ensure this is called.  When using APR from a language
    - *         other than C that has problems with the calling convention, use
    - *         apr_terminate2() instead.
    + *         @c atexit(apr_terminate) to ensure this is called.  When using APR
    + *         from a language other than C that has problems with the calling
    + *         convention, use apr_terminate2() instead.
    + * @see apr_terminate2
      */
     APR_DECLARE_NONSTD(void) apr_terminate(void);
     
     /**
      * Tear down any APR internal data structures which aren't torn down 
    - * automatically, same as apr_terminate
    - * @remark An APR program must call either the apr_terminate or apr_terminate2 
    + * automatically, same as apr_terminate()
    + * @remark An APR program must call either the apr_terminate() or apr_terminate2
      *         function once it it has finished using APR services.  The APR 
    - *         developers suggest using atexit(apr_terminate) to ensure this is done.
    + *         developers suggest using @c atexit(apr_terminate) to ensure this is done.
      *         apr_terminate2 exists to allow non-c language apps to tear down apr, 
    - *         while apr_terminate is recommended from c language applications.
    + *         while apr_terminate() is recommended from c language applications.
      */
     APR_DECLARE(void) apr_terminate2(void);
     
    diff --git a/include/apr_portable.h b/include/apr_portable.h
    index 7bb7a3568e2..800a50dbc91 100644
    --- a/include/apr_portable.h
    +++ b/include/apr_portable.h
    @@ -528,7 +528,7 @@ APR_DECLARE(const char*) apr_os_default_encoding(apr_pool_t *pool);
     /**
      * Get the name of the current locale character set.
      * @param pool the pool to allocate the name from, if needed
    - * @remark Defers to apr_os_default_encoding if the current locale's
    + * @remark Defers to apr_os_default_encoding() if the current locale's
      * data can't be retrieved on this system.
      */
     APR_DECLARE(const char*) apr_os_locale_encoding(apr_pool_t *pool);
    diff --git a/include/apr_strings.h b/include/apr_strings.h
    index c0642adb211..d5f8719d2dc 100644
    --- a/include/apr_strings.h
    +++ b/include/apr_strings.h
    @@ -101,10 +101,10 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s);
      * @param s The block of characters to duplicate
      * @param n The number of characters to duplicate
      * @return The new string or NULL if s == NULL
    - * @remark This is a faster alternative to apr_pstrndup, for use
    + * @remark This is a faster alternative to apr_pstrndup(), for use
      *         when you know that the string being duplicated really
      *         has 'n' or more characters.  If the string might contain
    - *         fewer characters, use apr_pstrndup.
    + *         fewer characters, use apr_pstrndup().
      */
     APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n)
     #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
    diff --git a/include/apr_tables.h b/include/apr_tables.h
    index fe3084bd646..27974c0e8ca 100644
    --- a/include/apr_tables.h
    +++ b/include/apr_tables.h
    @@ -179,7 +179,7 @@ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst,
      * @param p The pool to allocate the copy of the array out of
      * @param arr The array to copy
      * @return An exact copy of the array passed in
    - * @remark The alternate apr_array_copy_hdr copies only the header, and arranges 
    + * @remark The alternate apr_array_copy_hdr() copies only the header, and arranges 
      *         for the elements to be copied if (and only if) the code subsequently
      *         does a push or arraycat.
      */
    @@ -191,7 +191,7 @@ APR_DECLARE(apr_array_header_t *) apr_array_copy(apr_pool_t *p,
      * @param p The pool to allocate the copy of the array out of
      * @param arr The array to copy
      * @return An exact copy of the array passed in
    - * @remark The alternate apr_array_copy copies the *entire* array.
    + * @remark The alternate apr_array_copy() copies the *entire* array.
      */
     APR_DECLARE(apr_array_header_t *) apr_array_copy_hdr(apr_pool_t *p,
                                           const apr_array_header_t *arr);
    @@ -318,7 +318,7 @@ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key);
      * @param t The table to search for the data
      * @param key The key to merge data for (case does not matter)
      * @param val The data to add
    - * @remark If the key is not found, then this function acts like apr_table_add
    + * @remark If the key is not found, then this function acts like apr_table_add()
      */
     APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key,
                                       const char *val);
    @@ -330,7 +330,7 @@ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key,
      * @param t The table to search for the data
      * @param key The key to merge data for (case does not matter)
      * @param val The data to add
    - * @remark If the key is not found, then this function acts like apr_table_addn
    + * @remark If the key is not found, then this function acts like apr_table_addn()
      */
     APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key,
                                        const char *val);
    
    From acd035295fec6511a4dc67f5717115752f6f9773 Mon Sep 17 00:00:00 2001
    From: Christophe Jaillet 
    Date: Sun, 26 Aug 2018 10:21:54 +0000
    Subject: [PATCH 7842/7878] Do not forget to escape characters in the
     documentation of functions that escape characters, otherwise they look as
     no-op :)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839186 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_escape.h | 10 +++++-----
     1 file changed, 5 insertions(+), 5 deletions(-)
    
    diff --git a/include/apr_escape.h b/include/apr_escape.h
    index b51f5bfc31f..7dafa4e1868 100644
    --- a/include/apr_escape.h
    +++ b/include/apr_escape.h
    @@ -236,8 +236,8 @@ APR_DECLARE(const char *) apr_pescape_urlencoded(apr_pool_t *p,
     
     /**
      * Apply entity encoding to a string. Characters are replaced as follows:
    - * '<' becomes '<', '>' becomes '>', '&' becomes '&', the
    - * double quote becomes '"" and the single quote becomes '''.
    + * '<' becomes '\<', '>' becomes '\>', '&' becomes '\&', the
    + * double quote becomes '\"" and the single quote becomes '\''.
      *
      * If toasc is not zero, any non ascii character will be encoded as
      * '%\#ddd;', where ddd is the decimal code of the character.
    @@ -255,9 +255,9 @@ APR_DECLARE(apr_status_t) apr_escape_entity(char *escaped, const char *str,
     
     /**
      * Apply entity encoding to a string, returning the result from a pool.
    - * Characters are replaced as follows: '<' becomes '<', '>' becomes
    - * '>', '&' becomes '&', the double quote becomes '"" and the
    - * single quote becomes '''.
    + * Characters are replaced as follows: '<' becomes '\<', '>' becomes
    + * '\>', '&' becomes '\&', the double quote becomes '\"" and the
    + * single quote becomes '\''.
      * @param p Pool to allocate from
      * @param str The original string
      * @param toasc If non zero, encode non ascii characters
    
    From 6661801dfe9923436a6d5197546fc7880342db2e Mon Sep 17 00:00:00 2001
    From: Christophe Jaillet 
    Date: Sun, 26 Aug 2018 10:48:31 +0000
    Subject: [PATCH 7843/7878] s/APR_NOTIMPL/APR_ENOTIMPL/
    
    But I've not found the code that returns APR_ENOTIMPL if not implemented. Did I miss something?
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839190 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_crypto.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr_crypto.h b/include/apr_crypto.h
    index 14ea44d51cd..6a82fe09d4d 100644
    --- a/include/apr_crypto.h
    +++ b/include/apr_crypto.h
    @@ -499,7 +499,7 @@ typedef struct apr_crypto_digest_rec_t {
      * @brief Perform once-only initialisation. Call once only.
      *
      * @param pool - pool to register any shutdown cleanups, etc
    - * @return APR_NOTIMPL in case of no crypto support.
    + * @return APR_ENOTIMPL in case of no crypto support.
      */
     APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool);
     
    
    From 1b51769a40da0cf43df36c84a5ab59c2b41ad66d Mon Sep 17 00:00:00 2001
    From: Christophe Jaillet 
    Date: Sun, 26 Aug 2018 10:56:15 +0000
    Subject: [PATCH 7844/7878] s/APR_NOKEY/APR_ENOKEY/
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839191 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/private/apr_crypto_internal.h | 8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/include/private/apr_crypto_internal.h b/include/private/apr_crypto_internal.h
    index eab92fef90d..b73477a3e39 100644
    --- a/include/private/apr_crypto_internal.h
    +++ b/include/private/apr_crypto_internal.h
    @@ -259,7 +259,7 @@ struct apr_crypto_driver_t {
          * @return APR_ENOIV if an initialisation vector is required but not specified.
          * @return APR_EINIT if the backend failed to initialise the context.
          * @return APR_ENOTIMPL if not implemented.
    -     * @return APR_NOKEY if the key type does not support the given operation.
    +     * @return APR_ENOKEY if the key type does not support the given operation.
          */
         apr_status_t (*digest_init)(apr_crypto_digest_t **d,
                 const apr_crypto_key_t *key, apr_crypto_digest_rec_t *rec, apr_pool_t *p);
    @@ -271,7 +271,7 @@ struct apr_crypto_driver_t {
          * @param digest The digest context to use.
          * @return APR_ECRYPT if an error occurred.
          * @return APR_ENOTIMPL if not implemented.
    -     * @return APR_NOKEY if the key type does not support the given operation.
    +     * @return APR_ENOKEY if the key type does not support the given operation.
          */
         apr_status_t (*digest_update)(apr_crypto_digest_t *digest,
                 const unsigned char *in, apr_size_t inlen);
    @@ -285,7 +285,7 @@ struct apr_crypto_driver_t {
          * @return APR_EPADDING if padding was enabled and the block was incorrectly
          *         formatted.
          * @return APR_ENOTIMPL if not implemented.
    -     * @return APR_NOKEY if the key type does not support the given operation.
    +     * @return APR_ENOKEY if the key type does not support the given operation.
          */
         apr_status_t (*digest_final)(apr_crypto_digest_t *digest);
     
    @@ -299,7 +299,7 @@ struct apr_crypto_driver_t {
          * @return APR_ENOIV if an initialisation vector is required but not specified.
          * @return APR_EINIT if the backend failed to initialise the context.
          * @return APR_ENOTIMPL if not implemented.
    -     * @return APR_NOKEY if the key type does not support the given operation.
    +     * @return APR_ENOKEY if the key type does not support the given operation.
          */
         apr_status_t (*digest)(const apr_crypto_key_t *key,
                 apr_crypto_digest_rec_t *rec, const unsigned char *in,
    
    From eee1cae4b983c15d98fd72bacd0622d054a0b69a Mon Sep 17 00:00:00 2001
    From: Christophe Jaillet 
    Date: Sun, 26 Aug 2018 11:58:59 +0000
    Subject: [PATCH 7845/7878] Let Doxygen build the crypto doc
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839203 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_crypto.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/apr_crypto.h b/include/apr_crypto.h
    index 6a82fe09d4d..7261d037245 100644
    --- a/include/apr_crypto.h
    +++ b/include/apr_crypto.h
    @@ -38,7 +38,7 @@ extern "C" {
      * @{
      */
     
    -#if APU_HAVE_CRYPTO
    +#if APU_HAVE_CRYPTO || defined(DOXYGEN)
     
     #ifndef APU_CRYPTO_RECOMMENDED_DRIVER
     #if APU_HAVE_COMMONCRYPTO
    
    From 9d7e9664a8665c1fdf7ccf053290f9999dab63f9 Mon Sep 17 00:00:00 2001
    From: Graham Leggett 
    Date: Mon, 27 Aug 2018 11:27:43 +0000
    Subject: [PATCH 7846/7878] Remove an unnecessary cipher lookup in the HMAC
     case.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839296 13f79535-47bb-0310-9956-ffa450edef68
    ---
     crypto/apr_crypto_commoncrypto.c | 6 ------
     crypto/apr_crypto_nss.c          | 6 ------
     2 files changed, 12 deletions(-)
    
    diff --git a/crypto/apr_crypto_commoncrypto.c b/crypto/apr_crypto_commoncrypto.c
    index 421b0581a44..df8b7e77e80 100644
    --- a/crypto/apr_crypto_commoncrypto.c
    +++ b/crypto/apr_crypto_commoncrypto.c
    @@ -566,12 +566,6 @@ static apr_status_t crypto_key(apr_crypto_key_t **k,
         }
         case APR_CRYPTO_KTYPE_HMAC: {
     
    -        /* decide on what cipher mechanism we will be using */
    -        rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad, p);
    -        if (APR_SUCCESS != rv) {
    -            return rv;
    -        }
    -
             /* decide on what digest mechanism we will be using */
             rv = crypto_digest_mechanism(key, rec->k.hmac.digest, p);
             if (APR_SUCCESS != rv) {
    diff --git a/crypto/apr_crypto_nss.c b/crypto/apr_crypto_nss.c
    index 59955b2fa4f..223da9eb5fe 100644
    --- a/crypto/apr_crypto_nss.c
    +++ b/crypto/apr_crypto_nss.c
    @@ -644,12 +644,6 @@ static apr_status_t crypto_key(apr_crypto_key_t **k,
         }
         case APR_CRYPTO_KTYPE_HMAC: {
     
    -        /* decide on what cipher mechanism we will be using */
    -        rv = crypto_cipher_mechanism(key, rec->type, rec->mode, rec->pad);
    -        if (APR_SUCCESS != rv) {
    -            return rv;
    -        }
    -
             switch (rec->k.hmac.digest) {
             case APR_CRYPTO_DIGEST_MD5:
                 key->hashMech = CKM_MD5_HMAC;
    
    From 74e04a2c0bc44a9deee45521a5a8269dcf3fed96 Mon Sep 17 00:00:00 2001
    From: Graham Leggett 
    Date: Mon, 27 Aug 2018 11:47:20 +0000
    Subject: [PATCH 7847/7878] Remove non existent digests.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839298 13f79535-47bb-0310-9956-ffa450edef68
    ---
     crypto/apr_crypto_commoncrypto.c | 4 +---
     1 file changed, 1 insertion(+), 3 deletions(-)
    
    diff --git a/crypto/apr_crypto_commoncrypto.c b/crypto/apr_crypto_commoncrypto.c
    index df8b7e77e80..94666d18484 100644
    --- a/crypto/apr_crypto_commoncrypto.c
    +++ b/crypto/apr_crypto_commoncrypto.c
    @@ -248,9 +248,7 @@ static apr_status_t crypto_make(apr_crypto_t **ff,
         if (!f->digests) {
             return APR_ENOMEM;
         }
    -    apr_hash_set(f->digests, "md2", APR_HASH_KEY_STRING, &(key_digests[i = 0]));
    -    apr_hash_set(f->digests, "md4", APR_HASH_KEY_STRING, &(key_digests[++i]));
    -    apr_hash_set(f->digests, "md5", APR_HASH_KEY_STRING, &(key_digests[++i]));
    +    apr_hash_set(f->digests, "md5", APR_HASH_KEY_STRING, &(key_digests[i = 0]));
         apr_hash_set(f->digests, "sha1", APR_HASH_KEY_STRING, &(key_digests[++i]));
         apr_hash_set(f->digests, "sha224", APR_HASH_KEY_STRING, &(key_digests[++i]));
         apr_hash_set(f->digests, "sha256", APR_HASH_KEY_STRING, &(key_digests[++i]));
    
    From f9a29a7f3acaa01224e4f30ed907426a82b5e190 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Tue, 28 Aug 2018 18:58:34 +0000
    Subject: [PATCH 7848/7878] Fix breakage on _WIN32_WINNT>=0x0600 due to
     if_indextoname, it is wrapped in a very odd way on Windows, both the includes
     and required libraries. Using a pragma to create a link time resolution for
     the required lib is simplest.
    
    Submitted by: jeking3
    https://github.com/apache/apr/pull/7/commits/1fb97b8bd0b02fe71945b03986f3c69fb4270b6b
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839493 13f79535-47bb-0310-9956-ffa450edef68
    ---
     network_io/unix/sockaddr.c | 5 +++++
     1 file changed, 5 insertions(+)
    
    diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
    index 8e4bde3e3b4..94b00983b41 100644
    --- a/network_io/unix/sockaddr.c
    +++ b/network_io/unix/sockaddr.c
    @@ -29,6 +29,11 @@
     #include 
     #endif
     
    +#if defined(HAVE_IF_INDEXTONAME) && defined(_MSC_VER)
    +#include 
    +#pragma comment(lib, "Iphlpapi.lib")
    +#endif
    +
     #define APR_WANT_STRFUNC
     #include "apr_want.h"
     
    
    From 9c9e45b67f0900ce1062b626aa016f0ccff57376 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 30 Aug 2018 02:46:58 +0000
    Subject: [PATCH 7849/7878] Spelling corrections in docs;
    
    Pull request #6
    docs/APRDesign.html
    docs/canonical_filenames.html
    docs/incomplete_types
    Submitted by: "Bruno P. Kinoshita" 
    
    Pull request #10
    misc/unix/errorcodes.c
    Submitted by: Jimmy Casey 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839622 13f79535-47bb-0310-9956-ffa450edef68
    ---
     docs/APRDesign.html           | 10 +++++-----
     docs/canonical_filenames.html | 26 +++++++++++++-------------
     docs/incomplete_types         |  6 +++---
     misc/unix/errorcodes.c        |  2 +-
     4 files changed, 22 insertions(+), 22 deletions(-)
    
    diff --git a/docs/APRDesign.html b/docs/APRDesign.html
    index 7d1caeb8d4e..0d6d6a5682e 100644
    --- a/docs/APRDesign.html
    +++ b/docs/APRDesign.html
    @@ -152,7 +152,7 @@ 

    Creating an APR Type

    The current design of APR requires that most APR types be incomplete. It is not possible to write flexible portable code if programs can access the internals of APR types. This is because different platforms are -likely to define different native types. There are only two execptions to +likely to define different native types. There are only two exceptions to this rule:

      @@ -227,7 +227,7 @@

      Documentation

      For an actual example, look at any file in the include directory. The reason the docs are in the header files is to ensure that the docs always -reflect the current code. If you change paramters or return values for a +reflect the current code. If you change parameters or return values for a function, please be sure to update the documentation.

      APR Error reporting

      @@ -246,7 +246,7 @@

      APR Error reporting

      All platforms return errno values unchanged. Each platform can also have one system error type, which can be returned after an offset is added. -There are five types of error values in APR, each with it's own offset.

      +There are five types of error values in APR, each with its own offset.

      @@ -277,7 +277,7 @@ 

      APR Error reporting

      The difference in naming between APR_OS_START_ERROR and APR_OS_START_STATUS mentioned above allows programmers to easily determine if -the error code indicates an error condition or a status codition. +the error code indicates an error condition or a status condition.

      If your function has multiple return codes that all indicate success, but with different results, or if your function can only return PASS/FAIL, you @@ -345,7 +345,7 @@

      APR Error reporting

      an error string. If we convert all errors to a common subset, we have four steps to output an error string:

      -

      The seocnd problem with option 1, is that it is a lossy conversion. For +

      The second problem with option 1, is that it is a lossy conversion. For example, Windows and OS/2 have a couple hundred error codes, but POSIX errno only defines about 50 errno values. This means that if we convert to a canonical error value immediately, there is no way for the programmer to diff --git a/docs/canonical_filenames.html b/docs/canonical_filenames.html index 2bd9bdba822..c1c03b1d543 100644 --- a/docs/canonical_filenames.html +++ b/docs/canonical_filenames.html @@ -8,10 +8,10 @@

      Requirements

      APR porters need to address the underlying discrepancies between file systems. To achieve a reasonable degree of security, the program depending upon APR needs to know that two paths may be -compared, and that a mismatch is guarenteed to reflect that the +compared, and that a mismatch is guaranteed to reflect that the two paths do not return the same resource

      . -

      The first discrepancy is in volume roots. Unix and pure deriviates +

      The first discrepancy is in volume roots. Unix and pure derivatives have only one root path, "/". Win32 and OS2 share root paths of the form "D:/", D: is the volume designation. However, this can be specified as "//./D:/" as well, indicating D: volume of the @@ -21,7 +21,7 @@

      Requirements

      form "server/volume:/", or the simpler "volume:/" syntax for 'this' machine. All these non-Unix file systems accept volume:path, without a slash following the colon, as a path relative to the -current working directory, which APR will treat as ambigious, that +current working directory, which APR will treat as ambiguous, that is, neither an absolute nor a relative path per se.

      The second discrepancy is in the meaning of the 'this' directory. @@ -39,35 +39,35 @@

      Requirements

      since the parent of the root is root. This gets tricky on the Win32 and OS2 platforms, since the ".." element is invalid before the "//server/share/" is complete, and the "//server/share/../" -seqence is the complete UNC root "//server/share/". In relative +sequence is the complete UNC root "//server/share/". In relative paths, leading ".." elements are significant, until they are merged with an absolute path. The relative form must only retain the ".." segments as leading segments, to be resolved once merged to another relative or an absolute path.

      The fourth discrepancy occurs with acceptance of alternate character -codes for the same element. Path seperators are not retained within +codes for the same element. Path separators are not retained within the APR canonical forms. The OS filesystem and APR (slashed) forms can both be returned as strings, to be used in the proper context. Unix, Win32 and Netware all accept slashes and backslashes as the -same path seperator symbol, although unix strictly accepts slashes. +same path separator symbol, although unix strictly accepts slashes. While the APR form of the name strictly uses slashes, always consider that there could be a platform that actually accepts slashes as a character within a segment name.

      -

      The fifth and worst discrepancy plauges Win32, OS2, Netware, and some +

      The fifth and worst discrepancy plagues Win32, OS2, Netware, and some filesystems mounted in Unix. Case insensitivity can permit the same file to slip through in both it's proper case and alternate cases. Simply changing the case is insufficient for any character set beyond -ASCII, since various dilectic forms of characters suffer from one to +ASCII, since various dialectic forms of characters suffer from one to many or many to one translations. An example would be u-umlaut, which might be accepted as a single character u-umlaut, a two character sequence u and the zero-width umlaut, the upper case form of the same, -or perhaps even a captial U alone. This can be handled in different +or perhaps even a capital U alone. This can be handled in different ways depending on the purposes of the APR based program, but the one requirement is that the path must be absolute in order to resolve these ambiguities. Methods employed include comparison of device and inode -file uniqifiers, which is a fairly fast operation, or quering the OS +file uniqifiers, which is a fairly fast operation, or querying the OS for the true form of the name, which can be much slower. Only the acknowledgement of the file names by the OS can validate the equality of two different cases of the same filename.

      @@ -76,7 +76,7 @@

      Requirements

      significant in non-unix file systems. Trailing periods are accepted but never stored, therefore trailing periods must be ignored for any form of comparison. And all OS's have certain expectations of what -characters are illegal (or undesireable due to confusion.)

      +characters are illegal (or undesirable due to confusion.)

      A final warning, canonical functions don't transform or resolve case or character ambiguity issues until they are resolved into an absolute @@ -111,10 +111,10 @@

      Canonical API

      In any case, returning the char* path, with a flag to request the proper case, forces the OS calls to resolve the true names of each segment. Where -there is a penality for this operation and the stat device and inode test +there is a penalty for this operation and the stat device and inode test is faster, case correction is postponed until the char* result is requested. On platforms that identify the inode, device, or proper name interchangably -with no penalities, this may occur when the name is initially processed.

      +with no penalties, this may occur when the name is initially processed.


      diff --git a/docs/incomplete_types b/docs/incomplete_types index cbed7774232..08b0c0a522e 100644 --- a/docs/incomplete_types +++ b/docs/incomplete_types @@ -38,7 +38,7 @@ typedef struct ap_file_t { #endif } ap_file_t; -This captures the essense of what is currently being defined for ap_file_t +This captures the essence of what is currently being defined for ap_file_t using incomplete types. However, using this structure leads developers to believe that they are safe accessing any of the fields in this structure. This is not true. On some platforms, such as Windows, about half of the @@ -53,7 +53,7 @@ macros, for example: #define filetype int #endif -And then in the defintion for ap_file_t, we could say: +And then in the definition for ap_file_t, we could say: filetype filedes; This gets rid of some of the complexity, by moving it off to the side, but @@ -73,7 +73,7 @@ Having said all of that, sometimes incomplete types just don't make sense. For example, the first implementation of time functions used incomplete types, which added a layer of complexity that turned out to be unnecessary. If a platform cannot provide a simple number that represents the number of seconds -elapsed since a specifed date and time, then APR doesn't really want to +elapsed since a specified date and time, then APR doesn't really want to provide support for that platform. APR is trying hard to provide a balance of incomplete and complete types, diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 4f9b1d92474..a45d43f528b 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -380,7 +380,7 @@ static char *native_strerror(apr_status_t statcode, char *buf, /* glibc style */ /* BeOS has the function available, but it doesn't provide - * the prototype publically (doh!), so to avoid a build warning + * the prototype publicly (doh!), so to avoid a build warning * we add a suitable prototype here. */ #if defined(BEOS) From ecba29a6838eed33f8fcb839636d78434efa3a43 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 30 Aug 2018 03:00:09 +0000 Subject: [PATCH 7850/7878] Submitted by: Hongxu Jia https://patch-diff.githubusercontent.com/raw/apache/apr/pull/8.patch While cross-compiling, the tools/gen_test_char could not be executed at build time, use AX_PROG_CC_FOR_BUILD to build native tools/gen_test_char Support explicit libtool by variable assigning before buildcheck.sh, it is helpful for cross-compiling (such as libtool=aarch64-linux-libtool) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839627 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 10 +++------- build/buildcheck.sh | 4 +++- configure.in | 3 +++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile.in b/Makefile.in index bf1b55b72d6..c6ce9944dca 100644 --- a/Makefile.in +++ b/Makefile.in @@ -53,7 +53,7 @@ LT_VERSION = @LT_VERSION@ CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ build/apr_rules.out tools/gen_test_char@EXEEXT@ \ - tools/gen_test_char.o tools/gen_test_char.lo \ + tools/gen_test_char.o \ include/private/apr_escape_test_char.h DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ @@ -162,13 +162,9 @@ check: $(TARGET_LIB) etags: etags `find . -name '*.[ch]'` -OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS) -tools/gen_test_char.lo: tools/gen_test_char.c +tools/gen_test_char@EXEEXT@: tools/gen_test_char.c $(APR_MKDIR) tools - $(LT_COMPILE) - -tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char) - $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS) + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $< -o $@ include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@ $(APR_MKDIR) include/private diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 76ff8cef285..44921b50234 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -40,7 +40,9 @@ fi # output is multiline from 1.5 onwards # Require libtool 1.4 or newer -libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14` +if test -z "$libtool"; then + libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14` +fi lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` if test -z "$lt_pversion"; then echo "buildconf: libtool not found." diff --git a/configure.in b/configure.in index 58bd7983c31..242b0165484 100644 --- a/configure.in +++ b/configure.in @@ -196,6 +196,9 @@ dnl can only be used once within a configure script, so this prevents a dnl preload section from invoking the macro to get compiler info. AC_PROG_CC +dnl Check build CC for gen_test_char compiling which is executed at build time. +AX_PROG_CC_FOR_BUILD + dnl AC_PROG_SED is only avaliable in recent autoconf versions. dnl Use AC_CHECK_PROG instead if AC_PROG_SED is not present. ifdef([AC_PROG_SED], From 9479a5a81259ad6711666a3474fa635e5a7dd011 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Thu, 30 Aug 2018 11:05:52 +0000 Subject: [PATCH 7851/7878] Teach apr_json_object_get() to support a length, to align with apr_hash_get(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839658 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_json.h | 5 ++++- json/apr_json.c | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/apr_json.h b/include/apr_json.h index 3fc127e238a..02e352161cc 100644 --- a/include/apr_json.h +++ b/include/apr_json.h @@ -267,10 +267,13 @@ APR_DECLARE(apr_status_t) apr_json_object_set(apr_json_value_t *obj, * Look up the value associated with a key in a JSON object. * @param obj The JSON object. * @param key Pointer to the key. + * @param klen Length of the key, or APR_JSON_VALUE_STRING if NUL + * terminated. * @return Returns NULL if the key is not present. */ APR_DECLARE(apr_json_kv_t *) - apr_json_object_get(apr_json_value_t *obj, const char *key) + apr_json_object_get(apr_json_value_t *obj, const char *key, + apr_ssize_t klen) __attribute__((nonnull(1, 2))); /** diff --git a/json/apr_json.c b/json/apr_json.c index 4d671d1cd09..5fb7b5f317a 100644 --- a/json/apr_json.c +++ b/json/apr_json.c @@ -159,13 +159,14 @@ apr_status_t apr_json_object_set(apr_json_value_t *object, apr_json_value_t *key return APR_SUCCESS; } -apr_json_kv_t *apr_json_object_get(apr_json_value_t *object, const char *key) +apr_json_kv_t *apr_json_object_get(apr_json_value_t *object, const char *key, + apr_ssize_t klen) { if (object->type != APR_JSON_OBJECT) { return NULL; } - return apr_hash_get(object->value.object->hash, key, APR_HASH_KEY_STRING); + return apr_hash_get(object->value.object->hash, key, klen); } apr_json_value_t *apr_json_overlay(apr_pool_t *p, From 0b7eee48b4c67f11c301a740a811d7cc743c40a6 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Thu, 30 Aug 2018 12:19:59 +0000 Subject: [PATCH 7852/7878] Clarify comments on apr_json functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839670 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_json.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/apr_json.h b/include/apr_json.h index 02e352161cc..ca0dfa02027 100644 --- a/include/apr_json.h +++ b/include/apr_json.h @@ -252,7 +252,8 @@ APR_DECLARE(apr_json_value_t *) /** * Associate a value with a key in a JSON object. * @param obj The JSON object. - * @param key Pointer to the key string. + * @param key Pointer to the key string, including any whitespace + * required. * @param val Value to associate with the key. * @param pool Pool to use. * @return APR_SUCCESS on success, APR_EINVAL if the key is @@ -319,7 +320,7 @@ APR_DECLARE(apr_status_t) apr_json_encode(apr_bucket_brigade * brigade, int flags, apr_pool_t * pool) __attribute__((nonnull(1, 4, 6))); /** - * Overlay one JSON object over a second JSON object. + * Overlay one JSON value over a second JSON value. * * If the values are objects, a new object will be returned containing * all keys from the overlay superimposed on the base. @@ -327,7 +328,8 @@ APR_DECLARE(apr_status_t) apr_json_encode(apr_bucket_brigade * brigade, * Keys that appear in the overlay will replace keys in the base, unless * APR_JSON_FLAGS_STRICT is specified, in which case NULL will be returned. * - * If the base is not an object, overlay will be returned. + * If either the base or the overlay are not objects, overlay will be + * returned. * @param p pool to use * @param overlay the JSON object to overlay on top of base. If NULL, the * base will be returned. From 8bd7fa82abfbd9328cb3b61dbe67a11278ed84b3 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Thu, 30 Aug 2018 12:35:05 +0000 Subject: [PATCH 7853/7878] Add apr_json_object_first() and apr_json_object_next(), allowing the caller to iterate through object key value pairs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839675 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_json.h | 25 +++++++++++++++++++++++++ json/apr_json.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/include/apr_json.h b/include/apr_json.h index ca0dfa02027..3b257539966 100644 --- a/include/apr_json.h +++ b/include/apr_json.h @@ -277,6 +277,31 @@ APR_DECLARE(apr_json_kv_t *) apr_ssize_t klen) __attribute__((nonnull(1, 2))); +/** + * Get the first value associated with an object. + * + * If the value is an object, this function returns the first key value pair. + * @param obj The JSON object. + * @return Returns the first value, or NULL if not an object, or the object is + * empty. + */ +APR_DECLARE(apr_json_kv_t *) apr_json_object_first(apr_json_value_t *obj) + __attribute__((nonnull(1)));; + +/** + * Get the next value associated with an object. + * + * This function returns the next key value pair, or NULL if no more pairs + * are present. + * @param obj The JSON object. + * @param kv The previous JSON key value pair. + * @return Returns the next key value pair, or NULL if not an object, or + * the object is empty. + */ +APR_DECLARE(apr_json_kv_t *) apr_json_object_next(apr_json_value_t *obj, + apr_json_kv_t *kv) + __attribute__((nonnull(1, 2)));; + /** * Decode utf8-encoded JSON string into apr_json_value_t. * @param retval the result diff --git a/json/apr_json.c b/json/apr_json.c index 5fb7b5f317a..8a4c91d6057 100644 --- a/json/apr_json.c +++ b/json/apr_json.c @@ -169,6 +169,42 @@ apr_json_kv_t *apr_json_object_get(apr_json_value_t *object, const char *key, return apr_hash_get(object->value.object->hash, key, klen); } +apr_json_kv_t *apr_json_object_first(apr_json_value_t *obj) +{ + apr_json_kv_t *kv; + + if (obj->type != APR_JSON_OBJECT) { + return NULL; + } + + kv = APR_RING_FIRST(&(obj->value.object)->list); + + if (kv != APR_RING_SENTINEL(&(obj->value.object)->list, apr_json_kv_t, link)) { + return kv; + } + else { + return NULL; + } +} + +apr_json_kv_t *apr_json_object_next(apr_json_value_t *obj, apr_json_kv_t *kv) +{ + apr_json_kv_t *next; + + if (obj->type != APR_JSON_OBJECT) { + return NULL; + } + + next = APR_RING_NEXT((kv), link); + + if (next != APR_RING_SENTINEL(&(obj->value.object)->list, apr_json_kv_t, link)) { + return next; + } + else { + return NULL; + } +} + apr_json_value_t *apr_json_overlay(apr_pool_t *p, apr_json_value_t *overlay, apr_json_value_t *base, int flags) From 8cbc10b4fc1c61b003b4c8ab5b2e9e1f62bcb11e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 30 Aug 2018 21:08:28 +0000 Subject: [PATCH 7854/7878] Revert 1839627, this macro does not result in a usable CC_FOR_BUILD git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839699 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 10 +++++++--- build/buildcheck.sh | 4 +--- configure.in | 3 --- locks/netware/proc_mutex.c | 2 +- test/testfnmatch.c | 13 +++++++++++++ time/win32/time.c | 10 +++++++--- 6 files changed, 29 insertions(+), 13 deletions(-) diff --git a/Makefile.in b/Makefile.in index c6ce9944dca..bf1b55b72d6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -53,7 +53,7 @@ LT_VERSION = @LT_VERSION@ CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ build/apr_rules.out tools/gen_test_char@EXEEXT@ \ - tools/gen_test_char.o \ + tools/gen_test_char.o tools/gen_test_char.lo \ include/private/apr_escape_test_char.h DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ @@ -162,9 +162,13 @@ check: $(TARGET_LIB) etags: etags `find . -name '*.[ch]'` -tools/gen_test_char@EXEEXT@: tools/gen_test_char.c +OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS) +tools/gen_test_char.lo: tools/gen_test_char.c $(APR_MKDIR) tools - $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $< -o $@ + $(LT_COMPILE) + +tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char) + $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS) include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@ $(APR_MKDIR) include/private diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 44921b50234..76ff8cef285 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -40,9 +40,7 @@ fi # output is multiline from 1.5 onwards # Require libtool 1.4 or newer -if test -z "$libtool"; then - libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14` -fi +libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14` lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` if test -z "$lt_pversion"; then echo "buildconf: libtool not found." diff --git a/configure.in b/configure.in index 242b0165484..58bd7983c31 100644 --- a/configure.in +++ b/configure.in @@ -196,9 +196,6 @@ dnl can only be used once within a configure script, so this prevents a dnl preload section from invoking the macro to get compiler info. AC_PROG_CC -dnl Check build CC for gen_test_char compiling which is executed at build time. -AX_PROG_CC_FOR_BUILD - dnl AC_PROG_SED is only avaliable in recent autoconf versions. dnl Use AC_CHECK_PROG instead if AC_PROG_SED is not present. ifdef([AC_PROG_SED], diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 287011b0683..9be5ac0944e 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -155,7 +155,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, if (pool == NULL) { return APR_ENOPOOL; } - if (mech != APR_LOCK_DEFAULT) { + if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) { return APR_ENOTIMPL; } diff --git a/test/testfnmatch.c b/test/testfnmatch.c index 1d1c0315dbd..d52f5a81684 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -135,6 +135,19 @@ static struct pattern_s { {"test/*", "test/.this", FAILS_IF(APR_FNM_PERIOD | APR_FNM_PATHNAME)}, {"test/?this", "test/.this", FAILS_IF(APR_FNM_PERIOD | APR_FNM_PATHNAME)}, {"test/[.]this", "test/.this", FAILS_IF(APR_FNM_PERIOD | APR_FNM_PATHNAME)}, + + {"foo[[]bar", "foo[bar", SUCCEEDS}, + {"foo]bar", "foo]bar", SUCCEEDS}, + {"foo[[]]bar", "foo[]bar", SUCCEEDS}, + + {"foo[]bar", "foobar", FAILS}, + {"foo[]]bar", "foo]bar", FAILS}, + {"foo[!]bar", "foobar", SUCCEEDS}, + {"foo[^]bar", "foobar", SUCCEEDS}, + {"foo[!]]bar", "foo]bar", SUCCEEDS}, + {"foo[^]]bar", "foo]bar", SUCCEEDS}, + {"foo[!]]bar", "fooXbar", FAILS}, + {"foo[^]]bar", "fooXbar", FAILS}, {NULL, NULL, 0} }; diff --git a/time/win32/time.c b/time/win32/time.c index 1a705443b2b..6f459054178 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -54,9 +54,6 @@ static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm) static const int dayoffset[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; - if (tm->wMonth < 1 || tm->wMonth > 12) - return APR_EBADDATE; - /* Note; the caller is responsible for filling in detailed tm_usec, * tm_gmtoff and tm_isdst data when applicable. */ @@ -111,6 +108,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, FileTimeToSystemTime(&ft, &st); /* The Platform SDK documents that SYSTEMTIME/FILETIME are * generally UTC, so no timezone info needed + * The time value makes a roundtrip, st cannot be invalid below. */ SystemTimeToAprExpTime(result, &st); result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC); @@ -127,6 +125,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, FileTimeToSystemTime(&ft, &st); /* The Platform SDK documents that SYSTEMTIME/FILETIME are * generally UTC, so we will simply note the offs used. + * The time value makes a roundtrip, st cannot be invalid below. */ SystemTimeToAprExpTime(result, &st); result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC); @@ -158,6 +157,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, * because FileTimeToLocalFileFime is documented that the * resulting time local file time would have DST relative * to the *present* date, not the date converted. + * The time value makes a roundtrip, localst cannot be invalid below. */ SystemTimeToTzSpecificLocalTime(tz, &st, &localst); SystemTimeToAprExpTime(result, &localst); @@ -187,6 +187,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, TIME_ZONE_INFORMATION tz; /* XXX: This code is simply *wrong*. The time converted will always * map to the *now current* status of daylight savings time. + * The time value makes a roundtrip, st cannot be invalid below. */ FileTimeToLocalFileTime(&ft, &localft); @@ -298,6 +299,9 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, /* The Platform SDK documents that SYSTEMTIME/FILETIME are * generally UTC, so no timezone info needed */ + if (tm->wMonth < 1 || tm->wMonth > 12) + return APR_EBADDATE; + SystemTimeToAprExpTime(aprtime, *ostime); return APR_SUCCESS; } From 8546ef9c8ae064437317f2c61a85a8bedbec2d04 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 30 Aug 2018 21:09:43 +0000 Subject: [PATCH 7855/7878] Revert 1839699, this contained unintended, additional noise. Re-correcting. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839700 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 10 +++------- build/buildcheck.sh | 4 +++- configure.in | 3 +++ locks/netware/proc_mutex.c | 2 +- test/testfnmatch.c | 13 ------------- time/win32/time.c | 10 +++------- 6 files changed, 13 insertions(+), 29 deletions(-) diff --git a/Makefile.in b/Makefile.in index bf1b55b72d6..c6ce9944dca 100644 --- a/Makefile.in +++ b/Makefile.in @@ -53,7 +53,7 @@ LT_VERSION = @LT_VERSION@ CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ build/apr_rules.out tools/gen_test_char@EXEEXT@ \ - tools/gen_test_char.o tools/gen_test_char.lo \ + tools/gen_test_char.o \ include/private/apr_escape_test_char.h DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ @@ -162,13 +162,9 @@ check: $(TARGET_LIB) etags: etags `find . -name '*.[ch]'` -OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS) -tools/gen_test_char.lo: tools/gen_test_char.c +tools/gen_test_char@EXEEXT@: tools/gen_test_char.c $(APR_MKDIR) tools - $(LT_COMPILE) - -tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char) - $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS) + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $< -o $@ include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@ $(APR_MKDIR) include/private diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 76ff8cef285..44921b50234 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -40,7 +40,9 @@ fi # output is multiline from 1.5 onwards # Require libtool 1.4 or newer -libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14` +if test -z "$libtool"; then + libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14` +fi lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` if test -z "$lt_pversion"; then echo "buildconf: libtool not found." diff --git a/configure.in b/configure.in index 58bd7983c31..242b0165484 100644 --- a/configure.in +++ b/configure.in @@ -196,6 +196,9 @@ dnl can only be used once within a configure script, so this prevents a dnl preload section from invoking the macro to get compiler info. AC_PROG_CC +dnl Check build CC for gen_test_char compiling which is executed at build time. +AX_PROG_CC_FOR_BUILD + dnl AC_PROG_SED is only avaliable in recent autoconf versions. dnl Use AC_CHECK_PROG instead if AC_PROG_SED is not present. ifdef([AC_PROG_SED], diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 9be5ac0944e..287011b0683 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -155,7 +155,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, if (pool == NULL) { return APR_ENOPOOL; } - if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) { + if (mech != APR_LOCK_DEFAULT) { return APR_ENOTIMPL; } diff --git a/test/testfnmatch.c b/test/testfnmatch.c index d52f5a81684..1d1c0315dbd 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -135,19 +135,6 @@ static struct pattern_s { {"test/*", "test/.this", FAILS_IF(APR_FNM_PERIOD | APR_FNM_PATHNAME)}, {"test/?this", "test/.this", FAILS_IF(APR_FNM_PERIOD | APR_FNM_PATHNAME)}, {"test/[.]this", "test/.this", FAILS_IF(APR_FNM_PERIOD | APR_FNM_PATHNAME)}, - - {"foo[[]bar", "foo[bar", SUCCEEDS}, - {"foo]bar", "foo]bar", SUCCEEDS}, - {"foo[[]]bar", "foo[]bar", SUCCEEDS}, - - {"foo[]bar", "foobar", FAILS}, - {"foo[]]bar", "foo]bar", FAILS}, - {"foo[!]bar", "foobar", SUCCEEDS}, - {"foo[^]bar", "foobar", SUCCEEDS}, - {"foo[!]]bar", "foo]bar", SUCCEEDS}, - {"foo[^]]bar", "foo]bar", SUCCEEDS}, - {"foo[!]]bar", "fooXbar", FAILS}, - {"foo[^]]bar", "fooXbar", FAILS}, {NULL, NULL, 0} }; diff --git a/time/win32/time.c b/time/win32/time.c index 6f459054178..1a705443b2b 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -54,6 +54,9 @@ static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm) static const int dayoffset[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; + if (tm->wMonth < 1 || tm->wMonth > 12) + return APR_EBADDATE; + /* Note; the caller is responsible for filling in detailed tm_usec, * tm_gmtoff and tm_isdst data when applicable. */ @@ -108,7 +111,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, FileTimeToSystemTime(&ft, &st); /* The Platform SDK documents that SYSTEMTIME/FILETIME are * generally UTC, so no timezone info needed - * The time value makes a roundtrip, st cannot be invalid below. */ SystemTimeToAprExpTime(result, &st); result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC); @@ -125,7 +127,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, FileTimeToSystemTime(&ft, &st); /* The Platform SDK documents that SYSTEMTIME/FILETIME are * generally UTC, so we will simply note the offs used. - * The time value makes a roundtrip, st cannot be invalid below. */ SystemTimeToAprExpTime(result, &st); result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC); @@ -157,7 +158,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, * because FileTimeToLocalFileFime is documented that the * resulting time local file time would have DST relative * to the *present* date, not the date converted. - * The time value makes a roundtrip, localst cannot be invalid below. */ SystemTimeToTzSpecificLocalTime(tz, &st, &localst); SystemTimeToAprExpTime(result, &localst); @@ -187,7 +187,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, TIME_ZONE_INFORMATION tz; /* XXX: This code is simply *wrong*. The time converted will always * map to the *now current* status of daylight savings time. - * The time value makes a roundtrip, st cannot be invalid below. */ FileTimeToLocalFileTime(&ft, &localft); @@ -299,9 +298,6 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, /* The Platform SDK documents that SYSTEMTIME/FILETIME are * generally UTC, so no timezone info needed */ - if (tm->wMonth < 1 || tm->wMonth > 12) - return APR_EBADDATE; - SystemTimeToAprExpTime(aprtime, *ostime); return APR_SUCCESS; } From ac8188de5e3a791b3ecdb328f97efc3a811a668f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 30 Aug 2018 21:10:24 +0000 Subject: [PATCH 7856/7878] Revert 1839699, this contained unintended, additional noise. Re-correcting. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839701 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 10 +++++++--- build/buildcheck.sh | 4 +--- configure.in | 3 --- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index c6ce9944dca..bf1b55b72d6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -53,7 +53,7 @@ LT_VERSION = @LT_VERSION@ CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ build/apr_rules.out tools/gen_test_char@EXEEXT@ \ - tools/gen_test_char.o \ + tools/gen_test_char.o tools/gen_test_char.lo \ include/private/apr_escape_test_char.h DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ @@ -162,9 +162,13 @@ check: $(TARGET_LIB) etags: etags `find . -name '*.[ch]'` -tools/gen_test_char@EXEEXT@: tools/gen_test_char.c +OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS) +tools/gen_test_char.lo: tools/gen_test_char.c $(APR_MKDIR) tools - $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $< -o $@ + $(LT_COMPILE) + +tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char) + $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS) include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@ $(APR_MKDIR) include/private diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 44921b50234..76ff8cef285 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -40,9 +40,7 @@ fi # output is multiline from 1.5 onwards # Require libtool 1.4 or newer -if test -z "$libtool"; then - libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14` -fi +libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14` lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'` if test -z "$lt_pversion"; then echo "buildconf: libtool not found." diff --git a/configure.in b/configure.in index 242b0165484..58bd7983c31 100644 --- a/configure.in +++ b/configure.in @@ -196,9 +196,6 @@ dnl can only be used once within a configure script, so this prevents a dnl preload section from invoking the macro to get compiler info. AC_PROG_CC -dnl Check build CC for gen_test_char compiling which is executed at build time. -AX_PROG_CC_FOR_BUILD - dnl AC_PROG_SED is only avaliable in recent autoconf versions. dnl Use AC_CHECK_PROG instead if AC_PROG_SED is not present. ifdef([AC_PROG_SED], From efbca1be4f3cf40eaa748990de70d6c0fc45790e Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Fri, 31 Aug 2018 09:24:04 +0000 Subject: [PATCH 7857/7878] Make it possible to iterate through JSON arrays as well as JSON objects. As a side effect, this removes the need for the temporary pool during JSON decoding. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839735 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_json.h | 70 ++++++++++++++++++++++++++++++++++-- json/apr_json.c | 81 ++++++++++++++++++++++++++++++++++++++++-- json/apr_json_decode.c | 57 +++++++++++++---------------- json/apr_json_encode.c | 17 +++++---- test/testjson.c | 68 +++++++++++++++++++++++++++++++---- 5 files changed, 242 insertions(+), 51 deletions(-) diff --git a/include/apr_json.h b/include/apr_json.h index 3b257539966..06ec58ebfd2 100644 --- a/include/apr_json.h +++ b/include/apr_json.h @@ -87,6 +87,11 @@ extern "C" { */ typedef struct apr_json_object_t apr_json_object_t; +/** + * A structure to hold a JSON array. + */ +typedef struct apr_json_array_t apr_json_array_t; + /** * Enum that represents the type of the given JSON value. */ @@ -116,6 +121,8 @@ typedef struct apr_json_string_t { * Use apr_json_value_create() to allocate. */ typedef struct apr_json_value_t { + /** Links to the rest of the values if in an array */ + APR_RING_ENTRY(apr_json_value_t) link; /** preceding whitespace, if any */ const char *pre; /** trailing whitespace, if any */ @@ -127,7 +134,7 @@ typedef struct apr_json_value_t { /** JSON object */ apr_json_object_t *object; /** JSON array */ - apr_array_header_t *array; + apr_json_array_t *array; /** JSON floating point value */ double dnumber; /** JSON long integer value */ @@ -165,6 +172,18 @@ struct apr_json_object_t { apr_hash_t *hash; }; +/** + * A structure to hold a JSON array. + * + * Use apr_json_array_create() to allocate. + */ +struct apr_json_array_t { + /** The key value pairs in the object are in this list */ + APR_RING_HEAD(apr_json_array_list_t, apr_json_value_t) list; + /** Array of JSON objects */ + apr_array_header_t *array; +}; + /** * Allocate and return a apr_json_value_t structure. * @@ -274,7 +293,7 @@ APR_DECLARE(apr_status_t) apr_json_object_set(apr_json_value_t *obj, */ APR_DECLARE(apr_json_kv_t *) apr_json_object_get(apr_json_value_t *obj, const char *key, - apr_ssize_t klen) + apr_ssize_t klen) __attribute__((nonnull(1, 2))); /** @@ -302,6 +321,53 @@ APR_DECLARE(apr_json_kv_t *) apr_json_object_next(apr_json_value_t *obj, apr_json_kv_t *kv) __attribute__((nonnull(1, 2)));; +/** + * Add the value to the end of this array. + * @param arr The JSON array. + * @param val Value to add to the array. + * @param pool Pool to use. + * @return APR_SUCCESS on success, APR_EINVAL if the array value is not + * an APR_JSON_ARRAY. + */ +APR_DECLARE(apr_status_t) apr_json_array_add(apr_json_value_t *arr, + apr_json_value_t *val, apr_pool_t *pool) + __attribute__((nonnull(1, 2, 3))); + +/** + * Look up the value associated with a key in a JSON object. + * @param arr The JSON array. + * @param index The index of the element in the array. + * @return Returns NULL if the element is out of bounds. + */ +APR_DECLARE(apr_json_value_t *) + apr_json_array_get(apr_json_value_t *arr, int index) + __attribute__((nonnull(1))); + +/** + * Get the first value associated with an array. + * + * If the value is an array, this function returns the first value. + * @param arr The JSON array. + * @return Returns the first value, or NULL if not an array, or the array is + * empty. + */ +APR_DECLARE(apr_json_value_t *) apr_json_array_first(const apr_json_value_t *obj) + __attribute__((nonnull(1)));; + +/** + * Get the next value associated with an array. + * + * This function returns the next value in the array, or NULL if no more + * values are present. + * @param arr The JSON array. + * @param val The previous element of the array. + * @return Returns the next value in the array, or NULL if not an array, or + * we have reached the end of the array. + */ +APR_DECLARE(apr_json_value_t *) apr_json_array_next(const apr_json_value_t *arr, + const apr_json_value_t *val) + __attribute__((nonnull(1, 2)));; + /** * Decode utf8-encoded JSON string into apr_json_value_t. * @param retval the result diff --git a/json/apr_json.c b/json/apr_json.c index 8a4c91d6057..b8b55fc9a98 100644 --- a/json/apr_json.c +++ b/json/apr_json.c @@ -25,6 +25,12 @@ APR_RING_CHECK_CONSISTENCY(&(o)->list, apr_json_kv_t, link); \ } while (0) +#define APR_JSON_ARRAY_INSERT_TAIL(o, e) do { \ + apr_json_value_t *ap__b = (e); \ + APR_RING_INSERT_TAIL(&(o)->list, ap__b, apr_json_value_t, link); \ + APR_RING_CHECK_CONSISTENCY(&(o)->list, apr_json_value_t, link); \ + } while (0) + apr_json_value_t *apr_json_value_create(apr_pool_t *pool) { return apr_pcalloc(pool, sizeof(apr_json_value_t)); @@ -67,7 +73,9 @@ apr_json_value_t *apr_json_array_create(apr_pool_t *pool, int nelts) if (json) { json->type = APR_JSON_ARRAY; - json->value.array = apr_array_make(pool, nelts, + json->value.array = apr_pcalloc(pool, sizeof(apr_json_array_t)); + APR_RING_INIT(&json->value.array->list, apr_json_value_t, link); + json->value.array->array = apr_array_make(pool, nelts, sizeof(apr_json_value_t *)); } @@ -159,8 +167,7 @@ apr_status_t apr_json_object_set(apr_json_value_t *object, apr_json_value_t *key return APR_SUCCESS; } -apr_json_kv_t *apr_json_object_get(apr_json_value_t *object, const char *key, - apr_ssize_t klen) +apr_json_kv_t *apr_json_object_get(apr_json_value_t *object, const char *key, apr_ssize_t klen) { if (object->type != APR_JSON_OBJECT) { return NULL; @@ -205,6 +212,74 @@ apr_json_kv_t *apr_json_object_next(apr_json_value_t *obj, apr_json_kv_t *kv) } } +apr_status_t apr_json_array_add(apr_json_value_t *arr, + apr_json_value_t *val, apr_pool_t *pool) +{ + apr_array_header_t *array; + + if (arr->type != APR_JSON_ARRAY) { + return APR_EINVAL; + } + + APR_RING_ELEM_INIT(val, link); + APR_JSON_ARRAY_INSERT_TAIL(arr->value.array, val); + + array = arr->value.array->array; + if (array) { + *((apr_json_value_t **) (apr_array_push(array))) = val; + } + + return APR_SUCCESS; +} + +apr_json_value_t *apr_json_array_get(apr_json_value_t *arr, int index) +{ + if (arr->type != APR_JSON_ARRAY) { + return NULL; + } + + return APR_ARRAY_IDX(arr->value.array->array, index, apr_json_value_t *); +} + +apr_json_value_t *apr_json_array_first(const apr_json_value_t *arr) +{ + apr_json_value_t *val; + + if (arr->type != APR_JSON_ARRAY) { + return NULL; + } + + val = APR_RING_FIRST(&(arr->value.array)->list); + + if (val + != APR_RING_SENTINEL(&(arr->value.object)->list, apr_json_value_t, + link)) { + return val; + } else { + return NULL; + } +} + +apr_json_value_t *apr_json_array_next(const apr_json_value_t *arr, + const apr_json_value_t *val) +{ + apr_json_value_t *next; + + if (arr->type != APR_JSON_ARRAY) { + return NULL; + } + + next = APR_RING_NEXT((val), link); + + if (next + != APR_RING_SENTINEL(&(arr->value.array)->list, apr_json_value_t, + link)) { + return next; + } else { + return NULL; + } +} + apr_json_value_t *apr_json_overlay(apr_pool_t *p, apr_json_value_t *overlay, apr_json_value_t *base, int flags) diff --git a/json/apr_json_decode.c b/json/apr_json_decode.c index c5ce25f4b2d..e8d44013b29 100644 --- a/json/apr_json_decode.c +++ b/json/apr_json_decode.c @@ -350,16 +350,13 @@ static apr_status_t apr_json_decode_string(apr_json_scanner_t * self, apr_json_s } static apr_status_t apr_json_decode_array(apr_json_scanner_t * self, - apr_array_header_t ** retval) + apr_json_value_t * array) { apr_status_t status = APR_SUCCESS; - apr_pool_t *link_pool = NULL; - json_link_t *head = NULL, *tail = NULL; apr_size_t count = 0; if (self->p >= self->e) { - status = APR_EOF; - goto out; + return APR_EOF; } if (self->level <= 0) { @@ -367,19 +364,21 @@ static apr_status_t apr_json_decode_array(apr_json_scanner_t * self, } self->level--; - if ((status = apr_pool_create(&link_pool, self->pool))) { - return status; + array->value.array = apr_pcalloc(self->pool, + sizeof(apr_json_array_t)); + if (!array) { + return APR_ENOMEM; } + APR_RING_INIT(&array->value.array->list, apr_json_value_t, link); + array->value.array->array = NULL; self->p++; /* toss of the leading [ */ for (;;) { apr_json_value_t *element; - json_link_t *new_node; if (self->p == self->e) { - status = APR_EOF; - goto out; + return APR_EOF; } if (*self->p == ']') { @@ -388,49 +387,41 @@ static apr_status_t apr_json_decode_array(apr_json_scanner_t * self, } if (APR_SUCCESS != (status = apr_json_decode_value(self, &element))) { - goto out; + return status; } - new_node = apr_pcalloc(link_pool, sizeof(json_link_t)); - new_node->value = element; - if (tail) { - tail->next = new_node; - } - else { - head = new_node; + if (APR_SUCCESS + != (status = apr_json_array_add(array, element, self->pool))) { + return status; } - tail = new_node; + count++; if (self->p == self->e) { - status = APR_EOF; - goto out; + return APR_EOF; } if (*self->p == ',') { self->p++; } else if (*self->p != ']') { - status = APR_BADCH; - goto out; + return APR_BADCH; } } { - json_link_t *node; - apr_array_header_t *array = apr_array_make(self->pool, count, sizeof(apr_json_value_t *)); - for (node = head; node; node = node->next) { - *((apr_json_value_t **) (apr_array_push(array))) = node->value; + apr_json_value_t *element = apr_json_array_first(array); + array->value.array->array = apr_array_make(self->pool, count, + sizeof(apr_json_value_t *)); + while (element) { + *((apr_json_value_t **) (apr_array_push(array->value.array->array))) = + element; + element = apr_json_array_next(array, element); } - *retval = array; } self->level++; -out: - if (link_pool) { - apr_pool_destroy(link_pool); - } return status; } @@ -740,7 +731,7 @@ static apr_status_t apr_json_decode_value(apr_json_scanner_t * self, apr_json_va break; case '[': value.type = APR_JSON_ARRAY; - status = apr_json_decode_array(self, &value.value.array); + status = apr_json_decode_array(self, &value); break; case '{': value.type = APR_JSON_OBJECT; diff --git a/json/apr_json_encode.c b/json/apr_json_encode.c index 8b4830c9d98..13b1e67a828 100644 --- a/json/apr_json_encode.c +++ b/json/apr_json_encode.c @@ -164,30 +164,35 @@ static apr_status_t apr_json_encode_string(apr_json_serializer_t * self, } -static apr_status_t apr_json_encode_array(apr_json_serializer_t * self, apr_array_header_t * array) +static apr_status_t apr_json_encode_array(apr_json_serializer_t * self, + const apr_json_value_t * array) { apr_status_t status; - apr_size_t i; + apr_json_value_t *val; + apr_size_t count = 0; status = apr_brigade_putc(self->brigade, self->flush, self->ctx, '['); if (APR_SUCCESS != status) { return status; } - for (i = 0; i < array->nelts; i++) { + val = apr_json_array_first(array); + while (val) { - if (i > 0) { + if (count > 0) { status = apr_brigade_putc(self->brigade, self->flush, self->ctx, ','); if (APR_SUCCESS != status) { return status; } } - status = apr_json_encode_value(self, ((apr_json_value_t **) array->elts)[i]); + status = apr_json_encode_value(self, val); if (APR_SUCCESS != status) { return status; } + val = apr_json_array_next(array, val); + count++; } return apr_brigade_putc(self->brigade, self->flush, self->ctx, ']'); @@ -269,7 +274,7 @@ static apr_status_t apr_json_encode_value(apr_json_serializer_t * self, const ap status = apr_json_encode_object(self, value->value.object); break; case APR_JSON_ARRAY: - status = apr_json_encode_array(self, value->value.array); + status = apr_json_encode_array(self, value); break; default: return APR_EINVAL; diff --git a/test/testjson.c b/test/testjson.c index 0777eb14add..f1c3e9f3c57 100644 --- a/test/testjson.c +++ b/test/testjson.c @@ -151,15 +151,15 @@ static void test_json_string(abts_case * tc, void *data) static void test_json_overlay(abts_case * tc, void *data) { - const char *o = "{\"o1\":\"foo\",\"common\":\"bar\",\"o2\":\"baz\"}"; - const char *b = "{\"b1\":\"foo\",\"common\":\"bar\",\"b2\":\"baz\"}"; + const char *o = "{\"o1\":\"foo\",\"common\":\"bar\",\"o2\":\"baz\"}"; + const char *b = "{\"b1\":\"foo\",\"common\":\"bar\",\"b2\":\"baz\"}"; - apr_json_value_t *res; - apr_json_value_t *base; - apr_json_value_t *overlay; + apr_json_value_t *res; + apr_json_value_t *base; + apr_json_value_t *overlay; - apr_off_t offset; - apr_status_t status; + apr_off_t offset; + apr_status_t status; status = apr_json_decode(&base, b, APR_JSON_VALUE_STRING, &offset, APR_JSON_FLAGS_WHITESPACE, 10, p); @@ -178,6 +178,58 @@ static void test_json_overlay(abts_case * tc, void *data) } +static void test_json_object_iterate(abts_case * tc, void *data) +{ + const char *o = "{\"o1\":\"foo\",\"o2\":\"bar\"}"; + + apr_json_value_t *val; + apr_json_kv_t *kv; + + apr_off_t offset; + apr_status_t status; + + status = apr_json_decode(&val, o, APR_JSON_VALUE_STRING, &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + + kv = apr_json_object_first(val); + ABTS_PTR_NOTNULL(tc, kv); + + kv = apr_json_object_next(val, kv); + ABTS_PTR_NOTNULL(tc, kv); + + kv = apr_json_object_next(val, kv); + ABTS_ASSERT(tc, "object next should return NULL", + (kv == NULL)); + +} + +static void test_json_array_iterate(abts_case * tc, void *data) +{ + const char *o = "[\"a1\",\"a2\"]"; + + apr_json_value_t *arr; + apr_json_value_t *val; + + apr_off_t offset; + apr_status_t status; + + status = apr_json_decode(&arr, o, APR_JSON_VALUE_STRING, &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + + val = apr_json_array_first(arr); + ABTS_PTR_NOTNULL(tc, val); + + val = apr_json_array_next(arr, val); + ABTS_PTR_NOTNULL(tc, val); + + val = apr_json_array_next(arr, val); + ABTS_ASSERT(tc, "array next should return NULL", + (val == NULL)); + +} + abts_suite *testjson(abts_suite * suite) { suite = ADD_SUITE(suite); @@ -187,6 +239,8 @@ abts_suite *testjson(abts_suite * suite) abts_run_test(suite, test_json_eof, NULL); abts_run_test(suite, test_json_string, NULL); abts_run_test(suite, test_json_overlay, NULL); + abts_run_test(suite, test_json_object_iterate, NULL); + abts_run_test(suite, test_json_array_iterate, NULL); return suite; } From 2b510a86d975b4a6e299cd0d15bac6fa05e8080e Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 31 Aug 2018 12:25:34 +0000 Subject: [PATCH 7858/7878] apr_json: object keys are strings. Make this clear in the API by requiring a usual string in apr_json_object_set() and creating the apr_json_string_t from it. It's also more user friendly as otherwise apr_json_string_create() is to be used when setting an entry. Also, axe the 'pool' arg from apr_json_array_add() since it's not needed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839755 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_json.h | 23 +++++++++++------------ json/apr_json.c | 26 ++++++++++++-------------- json/apr_json_decode.c | 6 +++--- 3 files changed, 26 insertions(+), 29 deletions(-) diff --git a/include/apr_json.h b/include/apr_json.h index 06ec58ebfd2..a41180eaefd 100644 --- a/include/apr_json.h +++ b/include/apr_json.h @@ -178,7 +178,7 @@ struct apr_json_object_t { * Use apr_json_array_create() to allocate. */ struct apr_json_array_t { - /** The key value pairs in the object are in this list */ + /** The values in the array are in this list */ APR_RING_HEAD(apr_json_array_list_t, apr_json_value_t) list; /** Array of JSON objects */ apr_array_header_t *array; @@ -271,8 +271,9 @@ APR_DECLARE(apr_json_value_t *) /** * Associate a value with a key in a JSON object. * @param obj The JSON object. - * @param key Pointer to the key string, including any whitespace - * required. + * @param key Pointer to the key. + * @param klen Length of the key, or APR_JSON_VALUE_STRING if NUL + * terminated. * @param val Value to associate with the key. * @param pool Pool to use. * @return APR_SUCCESS on success, APR_EINVAL if the key is @@ -280,20 +281,19 @@ APR_DECLARE(apr_json_value_t *) * @remark If the value is NULL the key value pair is deleted. */ APR_DECLARE(apr_status_t) apr_json_object_set(apr_json_value_t *obj, - apr_json_value_t *key, apr_json_value_t *val, - apr_pool_t *pool) __attribute__((nonnull(1, 4))); + const char *key, apr_ssize_t klen, apr_json_value_t *val, + apr_pool_t *pool) __attribute__((nonnull(1, 2, 5))); /** * Look up the value associated with a key in a JSON object. * @param obj The JSON object. * @param key Pointer to the key. * @param klen Length of the key, or APR_JSON_VALUE_STRING if NUL - * terminated. + * terminated. * @return Returns NULL if the key is not present. */ -APR_DECLARE(apr_json_kv_t *) - apr_json_object_get(apr_json_value_t *obj, const char *key, - apr_ssize_t klen) +APR_DECLARE(apr_json_kv_t *) apr_json_object_get(apr_json_value_t *obj, + const char *key, apr_ssize_t klen) __attribute__((nonnull(1, 2))); /** @@ -325,13 +325,12 @@ APR_DECLARE(apr_json_kv_t *) apr_json_object_next(apr_json_value_t *obj, * Add the value to the end of this array. * @param arr The JSON array. * @param val Value to add to the array. - * @param pool Pool to use. * @return APR_SUCCESS on success, APR_EINVAL if the array value is not * an APR_JSON_ARRAY. */ APR_DECLARE(apr_status_t) apr_json_array_add(apr_json_value_t *arr, - apr_json_value_t *val, apr_pool_t *pool) - __attribute__((nonnull(1, 2, 3))); + apr_json_value_t *val) + __attribute__((nonnull(1, 2))); /** * Look up the value associated with a key in a JSON object. diff --git a/json/apr_json.c b/json/apr_json.c index b8b55fc9a98..d3bc8329d7a 100644 --- a/json/apr_json.c +++ b/json/apr_json.c @@ -129,25 +129,23 @@ apr_json_value_t *apr_json_null_create(apr_pool_t *pool) return json; } -apr_status_t apr_json_object_set(apr_json_value_t *object, apr_json_value_t *key, - apr_json_value_t *val, apr_pool_t *pool) +apr_status_t apr_json_object_set(apr_json_value_t *object, const char *key, + apr_ssize_t klen, apr_json_value_t *val, apr_pool_t *pool) { apr_json_kv_t *kv; apr_hash_t *hash; - if (object->type != APR_JSON_OBJECT || !key - || key->type != APR_JSON_STRING) { + if (object->type != APR_JSON_OBJECT) { return APR_EINVAL; } hash = object->value.object->hash; - kv = apr_hash_get(hash, key->value.string.p, key->value.string.len); + kv = apr_hash_get(hash, key, klen); if (!val) { if (kv) { - apr_hash_set(hash, key->value.string.p, key->value.string.len, - NULL); + apr_hash_set(hash, key, klen, NULL); APR_RING_REMOVE((kv), link); } return APR_SUCCESS; @@ -157,11 +155,10 @@ apr_status_t apr_json_object_set(apr_json_value_t *object, apr_json_value_t *key kv = apr_palloc(pool, sizeof(apr_json_kv_t)); APR_RING_ELEM_INIT(kv, link); APR_JSON_OBJECT_INSERT_TAIL(object->value.object, kv); - apr_hash_set(hash, key->value.string.p, key->value.string.len, - kv); + kv->k = apr_json_string_create(pool, key, klen); + apr_hash_set(hash, kv->k->value.string.p, kv->k->value.string.len, kv); } - kv->k = key; kv->v = val; return APR_SUCCESS; @@ -212,8 +209,7 @@ apr_json_kv_t *apr_json_object_next(apr_json_value_t *obj, apr_json_kv_t *kv) } } -apr_status_t apr_json_array_add(apr_json_value_t *arr, - apr_json_value_t *val, apr_pool_t *pool) +apr_status_t apr_json_array_add(apr_json_value_t *arr, apr_json_value_t *val) { apr_array_header_t *array; @@ -316,7 +312,8 @@ apr_json_value_t *apr_json_overlay(apr_pool_t *p, if (!apr_hash_get(overlay->value.object->hash, kv->k->value.string.p, kv->k->value.string.len)) { - apr_json_object_set(res, kv->k, kv->v, p); + apr_json_object_set(res, kv->k->value.string.p, + kv->k->value.string.len, kv->v, p); } else if (APR_JSON_FLAGS_STRICT & flags) { @@ -329,7 +326,8 @@ apr_json_value_t *apr_json_overlay(apr_pool_t *p, kv != APR_RING_SENTINEL(&(overlay->value.object)->list, apr_json_kv_t, link); kv = APR_RING_NEXT((kv), link)) { - apr_json_object_set(res, kv->k, kv->v, p); + apr_json_object_set(res, kv->k->value.string.p, + kv->k->value.string.len, kv->v, p); } diff --git a/json/apr_json_decode.c b/json/apr_json_decode.c index e8d44013b29..d4b8b315d75 100644 --- a/json/apr_json_decode.c +++ b/json/apr_json_decode.c @@ -390,8 +390,7 @@ static apr_status_t apr_json_decode_array(apr_json_scanner_t * self, return status; } - if (APR_SUCCESS - != (status = apr_json_array_add(array, element, self->pool))) { + if (APR_SUCCESS != (status = apr_json_array_add(array, element))) { return status; } @@ -501,7 +500,8 @@ static apr_status_t apr_json_decode_object(apr_json_scanner_t * self, if ((status = apr_json_decode_value(self, &value))) goto out; - apr_json_object_set(json, key, value, self->pool); + apr_json_object_set(json, key->value.string.p, key->value.string.len, + value, self->pool); if (self->p == self->e) { status = APR_EOF; From cea12900a0521311615668e13e70eec6f54216de Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 31 Aug 2018 16:40:44 +0000 Subject: [PATCH 7859/7878] Resolve invalid rvalue from void() function, the test is only required in one single case of user-provided input, to avoid an index into invalid memory. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839769 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/time.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/time/win32/time.c b/time/win32/time.c index 1a705443b2b..6f459054178 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -54,9 +54,6 @@ static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm) static const int dayoffset[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; - if (tm->wMonth < 1 || tm->wMonth > 12) - return APR_EBADDATE; - /* Note; the caller is responsible for filling in detailed tm_usec, * tm_gmtoff and tm_isdst data when applicable. */ @@ -111,6 +108,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, FileTimeToSystemTime(&ft, &st); /* The Platform SDK documents that SYSTEMTIME/FILETIME are * generally UTC, so no timezone info needed + * The time value makes a roundtrip, st cannot be invalid below. */ SystemTimeToAprExpTime(result, &st); result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC); @@ -127,6 +125,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, FileTimeToSystemTime(&ft, &st); /* The Platform SDK documents that SYSTEMTIME/FILETIME are * generally UTC, so we will simply note the offs used. + * The time value makes a roundtrip, st cannot be invalid below. */ SystemTimeToAprExpTime(result, &st); result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC); @@ -158,6 +157,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, * because FileTimeToLocalFileFime is documented that the * resulting time local file time would have DST relative * to the *present* date, not the date converted. + * The time value makes a roundtrip, localst cannot be invalid below. */ SystemTimeToTzSpecificLocalTime(tz, &st, &localst); SystemTimeToAprExpTime(result, &localst); @@ -187,6 +187,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, TIME_ZONE_INFORMATION tz; /* XXX: This code is simply *wrong*. The time converted will always * map to the *now current* status of daylight savings time. + * The time value makes a roundtrip, st cannot be invalid below. */ FileTimeToLocalFileTime(&ft, &localft); @@ -298,6 +299,9 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, /* The Platform SDK documents that SYSTEMTIME/FILETIME are * generally UTC, so no timezone info needed */ + if (tm->wMonth < 1 || tm->wMonth > 12) + return APR_EBADDATE; + SystemTimeToAprExpTime(aprtime, *ostime); return APR_SUCCESS; } From 1b2a0b2794f01dea449d06b08ec83f1928b253ac Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 31 Aug 2018 17:56:40 +0000 Subject: [PATCH 7860/7878] apr_json: follow up to r1839755: preserve formatting when decoding object valueT The object key-value pair parsed by the JSON decoder contained pre/post spaces which we lost by changing the key type (to a C string) in apr_json_object_set(). Add a new/private apr__json_object_set() helper taking an apr_json_value_t key and use it in both apr_json_object_set() and apr_json_decode_object(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839779 13f79535-47bb-0310-9956-ffa450edef68 --- json/apr_json.c | 54 ++++++++++++++++++++++++++++++------------ json/apr_json_decode.c | 6 +++-- 2 files changed, 43 insertions(+), 17 deletions(-) diff --git a/json/apr_json.c b/json/apr_json.c index d3bc8329d7a..3ce2b87b43b 100644 --- a/json/apr_json.c +++ b/json/apr_json.c @@ -129,21 +129,50 @@ apr_json_value_t *apr_json_null_create(apr_pool_t *pool) return json; } -apr_status_t apr_json_object_set(apr_json_value_t *object, const char *key, - apr_ssize_t klen, apr_json_value_t *val, apr_pool_t *pool) +apr_status_t apr__json_object_set(apr_json_value_t *object, + apr_json_value_t *key, apr_json_value_t *val, apr_pool_t *pool); + +apr_status_t apr__json_object_set(apr_json_value_t *object, + apr_json_value_t *key, apr_json_value_t *val, apr_pool_t *pool) { apr_json_kv_t *kv; apr_hash_t *hash; - if (object->type != APR_JSON_OBJECT) { - return APR_EINVAL; + hash = object->value.object->hash; + + kv = apr_hash_get(hash, key->value.string.p, key->value.string.len); + if (!kv) { + kv = apr_palloc(pool, sizeof(apr_json_kv_t)); + if (!kv) { + return APR_ENOMEM; + } + + APR_RING_ELEM_INIT(kv, link); + APR_JSON_OBJECT_INSERT_TAIL(object->value.object, kv); + apr_hash_set(hash, key->value.string.p, key->value.string.len, kv); } - hash = object->value.object->hash; + kv->k = key; + kv->v = val; - kv = apr_hash_get(hash, key, klen); + return APR_SUCCESS; +} + +apr_status_t apr_json_object_set(apr_json_value_t *object, const char *key, + apr_ssize_t klen, apr_json_value_t *val, apr_pool_t *pool) +{ + apr_json_value_t *k; + + if (object->type != APR_JSON_OBJECT) { + return APR_EINVAL; + } if (!val) { + apr_hash_t *hash; + apr_json_kv_t *kv; + + hash = object->value.object->hash; + kv = apr_hash_get(hash, key, klen); if (kv) { apr_hash_set(hash, key, klen, NULL); APR_RING_REMOVE((kv), link); @@ -151,17 +180,12 @@ apr_status_t apr_json_object_set(apr_json_value_t *object, const char *key, return APR_SUCCESS; } - if (!kv) { - kv = apr_palloc(pool, sizeof(apr_json_kv_t)); - APR_RING_ELEM_INIT(kv, link); - APR_JSON_OBJECT_INSERT_TAIL(object->value.object, kv); - kv->k = apr_json_string_create(pool, key, klen); - apr_hash_set(hash, kv->k->value.string.p, kv->k->value.string.len, kv); + k = apr_json_string_create(pool, key, klen); + if (!k) { + return APR_ENOMEM; } - kv->v = val; - - return APR_SUCCESS; + return apr__json_object_set(object, k, val, pool); } apr_json_kv_t *apr_json_object_get(apr_json_value_t *object, const char *key, apr_ssize_t klen) diff --git a/json/apr_json_decode.c b/json/apr_json_decode.c index d4b8b315d75..1a03f2d638a 100644 --- a/json/apr_json_decode.c +++ b/json/apr_json_decode.c @@ -424,6 +424,9 @@ static apr_status_t apr_json_decode_array(apr_json_scanner_t * self, return status; } +apr_status_t apr__json_object_set(apr_json_value_t *object, + apr_json_value_t *key, apr_json_value_t *val, apr_pool_t *pool); + static apr_status_t apr_json_decode_object(apr_json_scanner_t * self, apr_json_value_t *json, apr_json_object_t ** retval) { @@ -500,8 +503,7 @@ static apr_status_t apr_json_decode_object(apr_json_scanner_t * self, if ((status = apr_json_decode_value(self, &value))) goto out; - apr_json_object_set(json, key->value.string.p, key->value.string.len, - value, self->pool); + apr__json_object_set(json, key, value, self->pool); if (self->p == self->e) { status = APR_EOF; From 169099d88a8d6a491f7da04e1536b2b2ce272f8d Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 1 Sep 2018 10:01:21 +0000 Subject: [PATCH 7861/7878] Revert 1839779 for now to unblock apr_jose.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839812 13f79535-47bb-0310-9956-ffa450edef68 --- json/apr_json.c | 54 ++++++++++++------------------------------ json/apr_json_decode.c | 6 ++--- 2 files changed, 17 insertions(+), 43 deletions(-) diff --git a/json/apr_json.c b/json/apr_json.c index 3ce2b87b43b..d3bc8329d7a 100644 --- a/json/apr_json.c +++ b/json/apr_json.c @@ -129,50 +129,21 @@ apr_json_value_t *apr_json_null_create(apr_pool_t *pool) return json; } -apr_status_t apr__json_object_set(apr_json_value_t *object, - apr_json_value_t *key, apr_json_value_t *val, apr_pool_t *pool); - -apr_status_t apr__json_object_set(apr_json_value_t *object, - apr_json_value_t *key, apr_json_value_t *val, apr_pool_t *pool) -{ - apr_json_kv_t *kv; - apr_hash_t *hash; - - hash = object->value.object->hash; - - kv = apr_hash_get(hash, key->value.string.p, key->value.string.len); - if (!kv) { - kv = apr_palloc(pool, sizeof(apr_json_kv_t)); - if (!kv) { - return APR_ENOMEM; - } - - APR_RING_ELEM_INIT(kv, link); - APR_JSON_OBJECT_INSERT_TAIL(object->value.object, kv); - apr_hash_set(hash, key->value.string.p, key->value.string.len, kv); - } - - kv->k = key; - kv->v = val; - - return APR_SUCCESS; -} - apr_status_t apr_json_object_set(apr_json_value_t *object, const char *key, apr_ssize_t klen, apr_json_value_t *val, apr_pool_t *pool) { - apr_json_value_t *k; + apr_json_kv_t *kv; + apr_hash_t *hash; if (object->type != APR_JSON_OBJECT) { return APR_EINVAL; } - if (!val) { - apr_hash_t *hash; - apr_json_kv_t *kv; + hash = object->value.object->hash; + + kv = apr_hash_get(hash, key, klen); - hash = object->value.object->hash; - kv = apr_hash_get(hash, key, klen); + if (!val) { if (kv) { apr_hash_set(hash, key, klen, NULL); APR_RING_REMOVE((kv), link); @@ -180,12 +151,17 @@ apr_status_t apr_json_object_set(apr_json_value_t *object, const char *key, return APR_SUCCESS; } - k = apr_json_string_create(pool, key, klen); - if (!k) { - return APR_ENOMEM; + if (!kv) { + kv = apr_palloc(pool, sizeof(apr_json_kv_t)); + APR_RING_ELEM_INIT(kv, link); + APR_JSON_OBJECT_INSERT_TAIL(object->value.object, kv); + kv->k = apr_json_string_create(pool, key, klen); + apr_hash_set(hash, kv->k->value.string.p, kv->k->value.string.len, kv); } - return apr__json_object_set(object, k, val, pool); + kv->v = val; + + return APR_SUCCESS; } apr_json_kv_t *apr_json_object_get(apr_json_value_t *object, const char *key, apr_ssize_t klen) diff --git a/json/apr_json_decode.c b/json/apr_json_decode.c index 1a03f2d638a..d4b8b315d75 100644 --- a/json/apr_json_decode.c +++ b/json/apr_json_decode.c @@ -424,9 +424,6 @@ static apr_status_t apr_json_decode_array(apr_json_scanner_t * self, return status; } -apr_status_t apr__json_object_set(apr_json_value_t *object, - apr_json_value_t *key, apr_json_value_t *val, apr_pool_t *pool); - static apr_status_t apr_json_decode_object(apr_json_scanner_t * self, apr_json_value_t *json, apr_json_object_t ** retval) { @@ -503,7 +500,8 @@ static apr_status_t apr_json_decode_object(apr_json_scanner_t * self, if ((status = apr_json_decode_value(self, &value))) goto out; - apr__json_object_set(json, key, value, self->pool); + apr_json_object_set(json, key->value.string.p, key->value.string.len, + value, self->pool); if (self->p == self->e) { status = APR_EOF; From fcc66777d0e2a8616030b46eee06a4e36515dcc9 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 1 Sep 2018 10:04:16 +0000 Subject: [PATCH 7862/7878] Revert 1839755 for now to unblock apr_jose.h. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839813 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_json.h | 23 ++++++++++++----------- json/apr_json.c | 26 ++++++++++++++------------ json/apr_json_decode.c | 6 +++--- 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/include/apr_json.h b/include/apr_json.h index a41180eaefd..06ec58ebfd2 100644 --- a/include/apr_json.h +++ b/include/apr_json.h @@ -178,7 +178,7 @@ struct apr_json_object_t { * Use apr_json_array_create() to allocate. */ struct apr_json_array_t { - /** The values in the array are in this list */ + /** The key value pairs in the object are in this list */ APR_RING_HEAD(apr_json_array_list_t, apr_json_value_t) list; /** Array of JSON objects */ apr_array_header_t *array; @@ -271,9 +271,8 @@ APR_DECLARE(apr_json_value_t *) /** * Associate a value with a key in a JSON object. * @param obj The JSON object. - * @param key Pointer to the key. - * @param klen Length of the key, or APR_JSON_VALUE_STRING if NUL - * terminated. + * @param key Pointer to the key string, including any whitespace + * required. * @param val Value to associate with the key. * @param pool Pool to use. * @return APR_SUCCESS on success, APR_EINVAL if the key is @@ -281,19 +280,20 @@ APR_DECLARE(apr_json_value_t *) * @remark If the value is NULL the key value pair is deleted. */ APR_DECLARE(apr_status_t) apr_json_object_set(apr_json_value_t *obj, - const char *key, apr_ssize_t klen, apr_json_value_t *val, - apr_pool_t *pool) __attribute__((nonnull(1, 2, 5))); + apr_json_value_t *key, apr_json_value_t *val, + apr_pool_t *pool) __attribute__((nonnull(1, 4))); /** * Look up the value associated with a key in a JSON object. * @param obj The JSON object. * @param key Pointer to the key. * @param klen Length of the key, or APR_JSON_VALUE_STRING if NUL - * terminated. + * terminated. * @return Returns NULL if the key is not present. */ -APR_DECLARE(apr_json_kv_t *) apr_json_object_get(apr_json_value_t *obj, - const char *key, apr_ssize_t klen) +APR_DECLARE(apr_json_kv_t *) + apr_json_object_get(apr_json_value_t *obj, const char *key, + apr_ssize_t klen) __attribute__((nonnull(1, 2))); /** @@ -325,12 +325,13 @@ APR_DECLARE(apr_json_kv_t *) apr_json_object_next(apr_json_value_t *obj, * Add the value to the end of this array. * @param arr The JSON array. * @param val Value to add to the array. + * @param pool Pool to use. * @return APR_SUCCESS on success, APR_EINVAL if the array value is not * an APR_JSON_ARRAY. */ APR_DECLARE(apr_status_t) apr_json_array_add(apr_json_value_t *arr, - apr_json_value_t *val) - __attribute__((nonnull(1, 2))); + apr_json_value_t *val, apr_pool_t *pool) + __attribute__((nonnull(1, 2, 3))); /** * Look up the value associated with a key in a JSON object. diff --git a/json/apr_json.c b/json/apr_json.c index d3bc8329d7a..b8b55fc9a98 100644 --- a/json/apr_json.c +++ b/json/apr_json.c @@ -129,23 +129,25 @@ apr_json_value_t *apr_json_null_create(apr_pool_t *pool) return json; } -apr_status_t apr_json_object_set(apr_json_value_t *object, const char *key, - apr_ssize_t klen, apr_json_value_t *val, apr_pool_t *pool) +apr_status_t apr_json_object_set(apr_json_value_t *object, apr_json_value_t *key, + apr_json_value_t *val, apr_pool_t *pool) { apr_json_kv_t *kv; apr_hash_t *hash; - if (object->type != APR_JSON_OBJECT) { + if (object->type != APR_JSON_OBJECT || !key + || key->type != APR_JSON_STRING) { return APR_EINVAL; } hash = object->value.object->hash; - kv = apr_hash_get(hash, key, klen); + kv = apr_hash_get(hash, key->value.string.p, key->value.string.len); if (!val) { if (kv) { - apr_hash_set(hash, key, klen, NULL); + apr_hash_set(hash, key->value.string.p, key->value.string.len, + NULL); APR_RING_REMOVE((kv), link); } return APR_SUCCESS; @@ -155,10 +157,11 @@ apr_status_t apr_json_object_set(apr_json_value_t *object, const char *key, kv = apr_palloc(pool, sizeof(apr_json_kv_t)); APR_RING_ELEM_INIT(kv, link); APR_JSON_OBJECT_INSERT_TAIL(object->value.object, kv); - kv->k = apr_json_string_create(pool, key, klen); - apr_hash_set(hash, kv->k->value.string.p, kv->k->value.string.len, kv); + apr_hash_set(hash, key->value.string.p, key->value.string.len, + kv); } + kv->k = key; kv->v = val; return APR_SUCCESS; @@ -209,7 +212,8 @@ apr_json_kv_t *apr_json_object_next(apr_json_value_t *obj, apr_json_kv_t *kv) } } -apr_status_t apr_json_array_add(apr_json_value_t *arr, apr_json_value_t *val) +apr_status_t apr_json_array_add(apr_json_value_t *arr, + apr_json_value_t *val, apr_pool_t *pool) { apr_array_header_t *array; @@ -312,8 +316,7 @@ apr_json_value_t *apr_json_overlay(apr_pool_t *p, if (!apr_hash_get(overlay->value.object->hash, kv->k->value.string.p, kv->k->value.string.len)) { - apr_json_object_set(res, kv->k->value.string.p, - kv->k->value.string.len, kv->v, p); + apr_json_object_set(res, kv->k, kv->v, p); } else if (APR_JSON_FLAGS_STRICT & flags) { @@ -326,8 +329,7 @@ apr_json_value_t *apr_json_overlay(apr_pool_t *p, kv != APR_RING_SENTINEL(&(overlay->value.object)->list, apr_json_kv_t, link); kv = APR_RING_NEXT((kv), link)) { - apr_json_object_set(res, kv->k->value.string.p, - kv->k->value.string.len, kv->v, p); + apr_json_object_set(res, kv->k, kv->v, p); } diff --git a/json/apr_json_decode.c b/json/apr_json_decode.c index d4b8b315d75..e8d44013b29 100644 --- a/json/apr_json_decode.c +++ b/json/apr_json_decode.c @@ -390,7 +390,8 @@ static apr_status_t apr_json_decode_array(apr_json_scanner_t * self, return status; } - if (APR_SUCCESS != (status = apr_json_array_add(array, element))) { + if (APR_SUCCESS + != (status = apr_json_array_add(array, element, self->pool))) { return status; } @@ -500,8 +501,7 @@ static apr_status_t apr_json_decode_object(apr_json_scanner_t * self, if ((status = apr_json_decode_value(self, &value))) goto out; - apr_json_object_set(json, key->value.string.p, key->value.string.len, - value, self->pool); + apr_json_object_set(json, key, value, self->pool); if (self->p == self->e) { status = APR_EOF; From 6a1b234c880ba2fafbab9ffb389e9b1cb8a539a9 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 1 Sep 2018 10:25:08 +0000 Subject: [PATCH 7863/7878] Simplify apr_errprintf() to return a structure instead of a status. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839815 13f79535-47bb-0310-9956-ffa450edef68 --- include/apu_errno.h | 10 +++++----- util-misc/apr_error.c | 20 +++++++++----------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/include/apu_errno.h b/include/apu_errno.h index 5c309b4f223..0a8824e69ac 100644 --- a/include/apu_errno.h +++ b/include/apu_errno.h @@ -179,19 +179,19 @@ typedef struct apu_err_t { * If the result parameter points at a NULL pointer, a apu_err_t * structure will be allocated, otherwise the apu_err_t structure * will be reused. - * @param result If points to NULL, the apu_err_t structure is - * allocated and returned, otherwise the existing apu_err_t is used. + * @param result If NULL, the apu_err_t structure is allocated and + * returned, otherwise the existing apu_err_t is used. * @param p The pool to use. * @param reason The reason string, may be NULL. * @param rc The underlying result code. * @param fmt The format of the string * @param ... The arguments to use while printing the data - * @return APR_SUCCESS on success, APR_ENOMEM if out of memory. + * @return The apu_err_t structure on success, NULL if out of memory. */ -APR_DECLARE_NONSTD(apr_status_t) apr_errprintf(apu_err_t **result, +APR_DECLARE_NONSTD(apu_err_t *) apr_errprintf(apu_err_t *result, apr_pool_t *p, const char *reason, int rc, const char *fmt, ...) __attribute__((format(printf,5,6))) - __attribute__((nonnull(1,2))); + __attribute__((nonnull(2))); /** @} */ diff --git a/util-misc/apr_error.c b/util-misc/apr_error.c index a3835e1a98a..7cb30cb4ee1 100644 --- a/util-misc/apr_error.c +++ b/util-misc/apr_error.c @@ -19,27 +19,25 @@ #include "apr_pools.h" #include "apu_errno.h" -APR_DECLARE_NONSTD(apr_status_t) apr_errprintf(apu_err_t **result, +APR_DECLARE_NONSTD(apu_err_t *) apr_errprintf(apu_err_t *result, apr_pool_t *p, const char *reason, int rc, const char *fmt, ...) { va_list ap; - apu_err_t *res; - res = *result; - if (!res) { - res = *result = apr_pcalloc(p, sizeof(apu_err_t)); - if (!res) { - return APR_ENOMEM; + if (!result) { + result = apr_pcalloc(p, sizeof(apu_err_t)); + if (!result) { + return NULL; } } va_start(ap, fmt); - res->msg = apr_pvsprintf(p, fmt, ap); + result->msg = apr_pvsprintf(p, fmt, ap); va_end(ap); - res->reason = reason; - res->rc = rc; + result->reason = reason; + result->rc = rc; - return APR_SUCCESS; + return result; } From 0f0e823bfa4caf99d3fbd73edb2c9e71fdd24926 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 1 Sep 2018 10:44:11 +0000 Subject: [PATCH 7864/7878] Axe the 'pool' arg from apr_json_array_add() since it's not needed. (Reinstated from 1839755) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839817 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_json.h | 5 ++--- json/apr_json.c | 2 +- json/apr_json_decode.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/apr_json.h b/include/apr_json.h index 06ec58ebfd2..c05f6704cee 100644 --- a/include/apr_json.h +++ b/include/apr_json.h @@ -325,13 +325,12 @@ APR_DECLARE(apr_json_kv_t *) apr_json_object_next(apr_json_value_t *obj, * Add the value to the end of this array. * @param arr The JSON array. * @param val Value to add to the array. - * @param pool Pool to use. * @return APR_SUCCESS on success, APR_EINVAL if the array value is not * an APR_JSON_ARRAY. */ APR_DECLARE(apr_status_t) apr_json_array_add(apr_json_value_t *arr, - apr_json_value_t *val, apr_pool_t *pool) - __attribute__((nonnull(1, 2, 3))); + apr_json_value_t *val) + __attribute__((nonnull(1, 2))); /** * Look up the value associated with a key in a JSON object. diff --git a/json/apr_json.c b/json/apr_json.c index b8b55fc9a98..ad4281cc24e 100644 --- a/json/apr_json.c +++ b/json/apr_json.c @@ -213,7 +213,7 @@ apr_json_kv_t *apr_json_object_next(apr_json_value_t *obj, apr_json_kv_t *kv) } apr_status_t apr_json_array_add(apr_json_value_t *arr, - apr_json_value_t *val, apr_pool_t *pool) + apr_json_value_t *val) { apr_array_header_t *array; diff --git a/json/apr_json_decode.c b/json/apr_json_decode.c index e8d44013b29..c790d6fdc39 100644 --- a/json/apr_json_decode.c +++ b/json/apr_json_decode.c @@ -391,7 +391,7 @@ static apr_status_t apr_json_decode_array(apr_json_scanner_t * self, } if (APR_SUCCESS - != (status = apr_json_array_add(array, element, self->pool))) { + != (status = apr_json_array_add(array, element))) { return status; } From 063caa5173e9b24d0a7730d239c7b4f8405dee6e Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 1 Sep 2018 11:17:14 +0000 Subject: [PATCH 7865/7878] apr_jose: Add support for encoding and decoding of JSON Object Signing and Encryption messages as per RFC7515, RFC7516, RFC7517 and RFC7519. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839819 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 + build.conf | 1 + jose/apr_jose.c | 353 +++++++++ jose/apr_jose_decode.c | 1694 ++++++++++++++++++++++++++++++++++++++++ jose/apr_jose_encode.c | 825 +++++++++++++++++++ test/Makefile.in | 3 +- test/abts_tests.h | 3 +- test/testutil.h | 1 + 8 files changed, 2882 insertions(+), 2 deletions(-) create mode 100644 jose/apr_jose.c create mode 100644 jose/apr_jose_decode.c create mode 100644 jose/apr_jose_encode.c diff --git a/CHANGES b/CHANGES index 0fa0648edee..1cc69afaedd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_jose: Add support for encoding and decoding of JSON Object + Signing and Encryption messages as per RFC7515, RFC7516, RFC7517 + and RFC7519. [Graham Leggett] + *) Add apr_errprintf() as a convenience function to create and populate apu_err_t. [Graham Leggett] diff --git a/build.conf b/build.conf index cea616aaaa8..5c846fa99d6 100644 --- a/build.conf +++ b/build.conf @@ -26,6 +26,7 @@ paths = dbm/sdbm/*.c encoding/*.c hooks/*.c + jose/*.c json/*.c misc/*.c memcache/*.c diff --git a/jose/apr_jose.c b/jose/apr_jose.c new file mode 100644 index 00000000000..26f6b0ffab8 --- /dev/null +++ b/jose/apr_jose.c @@ -0,0 +1,353 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_jose.h" + +APR_DECLARE(apu_err_t *) apr_jose_error(apr_jose_t *jose) +{ + return &jose->result; +} + +APR_DECLARE(apr_status_t) apr_jose_make(apr_jose_t **jose, apr_jose_type_e type, + apr_pool_t *pool) +{ + apr_jose_t *j; + + if (*jose) { + j = *jose; + } else { + *jose = j = apr_pcalloc(pool, sizeof(apr_jose_t)); + if (!j) { + return APR_ENOMEM; + } + } + + j->pool = pool; + j->type = type; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_jose_data_make(apr_jose_t **jose, const char *typ, + const unsigned char *in, apr_size_t inlen, apr_pool_t *pool) +{ + apr_jose_t *j; + apr_status_t status; + + status = apr_jose_make(jose, APR_JOSE_TYPE_DATA, pool); + if (APR_SUCCESS != status) { + return status; + } + j = *jose; + + j->typ = typ; + j->jose.data = apr_palloc(pool, sizeof(apr_jose_data_t)); + if (!j->jose.data) { + return APR_ENOMEM; + } + j->jose.data->data = in; + j->jose.data->len = inlen; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_jose_json_make(apr_jose_t **jose, const char *cty, + apr_json_value_t *json, apr_pool_t *pool) +{ + apr_jose_t *j; + apr_status_t status; + + status = apr_jose_make(jose, APR_JOSE_TYPE_JSON, pool); + if (APR_SUCCESS != status) { + return status; + } + j = *jose; + + j->cty = cty; + j->jose.json = apr_palloc(pool, sizeof(apr_jose_json_t)); + if (!j->jose.json) { + return APR_ENOMEM; + } + j->jose.json->json = json; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_jose_signature_make( + apr_jose_signature_t **signature, apr_json_value_t *header, + apr_json_value_t *protected, apr_pool_t *pool) +{ + apr_jose_signature_t *s; + + *signature = s = apr_pcalloc(pool, sizeof(apr_jose_signature_t)); + if (!s) { + return APR_ENOMEM; + } + + s->header = header; + s->protected_header = protected; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_jose_recipient_make( + apr_jose_recipient_t **recipient, apr_json_value_t *header, + apr_pool_t *pool) +{ + apr_jose_recipient_t *r; + + *recipient = r = apr_pcalloc(pool, sizeof(apr_jose_recipient_t)); + if (!r) { + return APR_ENOMEM; + } + + r->header = header; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_jose_encryption_make( + apr_jose_encryption_t **encryption, apr_json_value_t *header, + apr_json_value_t *protected_header, apr_pool_t *pool) +{ + apr_jose_encryption_t *e; + + *encryption = e = apr_pcalloc(pool, sizeof(apr_jose_encryption_t)); + if (!e) { + return APR_ENOMEM; + } + + e->unprotected = header; + e->protected = protected_header; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_jose_jwe_make(apr_jose_t **jose, + apr_jose_recipient_t *recipient, apr_array_header_t *recipients, + apr_jose_encryption_t *encryption, apr_jose_t *payload, + apr_pool_t *pool) +{ + apr_jose_t *j; + apr_jose_jwe_t *jwe; + apr_status_t status; + + status = apr_jose_make(jose, APR_JOSE_TYPE_JWE, pool); + if (APR_SUCCESS != status) { + return status; + } + j = *jose; + + j->cty = payload->cty; + + jwe = j->jose.jwe = apr_palloc(pool, sizeof(apr_jose_jwe_t)); + if (!jwe) { + return APR_ENOMEM; + } + + jwe->recipient = recipient; + jwe->recipients = recipients; + jwe->encryption = encryption; + jwe->payload = payload; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_jose_jwe_json_make(apr_jose_t **jose, + apr_jose_recipient_t *recipient, apr_array_header_t *recipients, + apr_jose_encryption_t *encryption, apr_jose_t *payload, + apr_pool_t *pool) +{ + apr_jose_t *j; + apr_jose_jwe_t *jwe; + apr_status_t status; + + status = apr_jose_make(jose, APR_JOSE_TYPE_JWE_JSON, pool); + if (APR_SUCCESS != status) { + return status; + } + j = *jose; + + if (payload) { + j->cty = payload->cty; + } + + jwe = j->jose.jwe = apr_palloc(pool, sizeof(apr_jose_jwe_t)); + if (!jwe) { + return APR_ENOMEM; + } + + jwe->recipient = recipient; + jwe->recipients = recipients; + jwe->encryption = encryption; + jwe->payload = payload; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_jose_jwk_make(apr_jose_t **jose, + apr_json_value_t *key, apr_pool_t *pool) +{ + apr_jose_t *j; + apr_jose_jwk_t *jwk; + apr_status_t status; + + status = apr_jose_make(jose, APR_JOSE_TYPE_JWK, pool); + if (APR_SUCCESS != status) { + return status; + } + j = *jose; + + jwk = j->jose.jwk = apr_palloc(pool, sizeof(apr_jose_jwk_t)); + if (!jwk) { + return APR_ENOMEM; + } + + jwk->key = key; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_jose_jwks_make(apr_jose_t **jose, + apr_json_value_t *keys, apr_pool_t *pool) +{ + apr_jose_t *j; + apr_jose_jwks_t *jwks; + apr_status_t status; + + status = apr_jose_make(jose, APR_JOSE_TYPE_JWKS, pool); + if (APR_SUCCESS != status) { + return status; + } + j = *jose; + + jwks = j->jose.jwks = apr_palloc(pool, sizeof(apr_jose_jwks_t)); + if (!jwks) { + return APR_ENOMEM; + } + + jwks->keys = keys; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_jose_jws_make(apr_jose_t **jose, + apr_jose_signature_t *signature, apr_array_header_t *signatures, + apr_jose_t *payload, apr_pool_t *pool) +{ + apr_jose_t *j; + apr_jose_jws_t *jws; + apr_status_t status; + + status = apr_jose_make(jose, APR_JOSE_TYPE_JWS, pool); + if (APR_SUCCESS != status) { + return status; + } + j = *jose; + + if (payload) { + j->cty = payload->cty; + } + + jws = j->jose.jws = apr_pcalloc(pool, sizeof(apr_jose_jws_t)); + if (!jws) { + return APR_ENOMEM; + } + + jws->signature = signature; + jws->signatures = signatures; + jws->payload = payload; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_jose_jws_json_make(apr_jose_t **jose, + apr_jose_signature_t *signature, apr_array_header_t *signatures, + apr_jose_t *payload, apr_pool_t *pool) +{ + apr_jose_t *j; + apr_jose_jws_t *jws; + apr_status_t status; + + status = apr_jose_make(jose, APR_JOSE_TYPE_JWS_JSON, pool); + if (APR_SUCCESS != status) { + return status; + } + j = *jose; + + if (payload) { + j->cty = payload->cty; + } + + jws = j->jose.jws = apr_pcalloc(pool, sizeof(apr_jose_jws_t)); + if (!jws) { + return APR_ENOMEM; + } + + jws->signature = signature; + jws->signatures = signatures; + jws->payload = payload; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_jose_jwt_make(apr_jose_t **jose, apr_json_value_t *claims, + apr_pool_t *pool) +{ + apr_jose_t *j; + apr_jose_jwt_t *jwt; + apr_status_t status; + + status = apr_jose_make(jose, APR_JOSE_TYPE_JWT, pool); + if (APR_SUCCESS != status) { + return status; + } + j = *jose; + + j->cty = "JWT"; + + jwt = j->jose.jwt = apr_palloc(pool, sizeof(apr_jose_jwt_t)); + if (!jwt) { + return APR_ENOMEM; + } + + jwt->claims = claims; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_jose_text_make(apr_jose_t **jose, const char *cty, + const char *in, apr_size_t inlen, apr_pool_t *pool) +{ + apr_jose_t *j; + apr_status_t status; + + status = apr_jose_make(jose, APR_JOSE_TYPE_TEXT, pool); + if (APR_SUCCESS != status) { + return status; + } + j = *jose; + + j->cty = cty; + j->jose.text = apr_palloc(pool, sizeof(apr_jose_text_t)); + if (!j->jose.text) { + return APR_ENOMEM; + } + j->jose.text->text = in; + j->jose.text->len = inlen; + + return APR_SUCCESS; +} diff --git a/jose/apr_jose_decode.c b/jose/apr_jose_decode.c new file mode 100644 index 00000000000..7d0b01d4913 --- /dev/null +++ b/jose/apr_jose_decode.c @@ -0,0 +1,1694 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * levelations under the License. + */ + +#include "apr_jose.h" +#include "apr_lib.h" +#include "apr_encode.h" + +apr_status_t apr_jose_flatten(apr_bucket_brigade *bb, apr_jose_text_t *in, + apr_pool_t *pool) +{ + apr_bucket *e; + + /* most common case - one pool bucket, avoid unnecessary duplication */ + e = APR_BRIGADE_FIRST(bb); + if (e != APR_BRIGADE_SENTINEL(bb)) { + if (!APR_BUCKET_NEXT(e) && APR_BUCKET_IS_POOL(e)) { + apr_bucket_pool *p = e->data; + if (pool == p->pool) { + return apr_bucket_read(e, &in->text, &in->len, APR_BLOCK_READ); + } + } + } + + return apr_brigade_pflatten(bb, (char **)&in->text, &in->len, pool); +} + +apr_status_t apr_jose_decode_jwk(apr_jose_t **jose, + const char *typ, apr_bucket_brigade *bb, apr_jose_cb_t *cb, + int level, int flags, apr_pool_t *pool) +{ + apr_jose_text_t in; + apr_off_t offset; + apr_status_t status; + + status = apr_jose_jwk_make(jose, NULL, pool); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_jose_flatten(bb, &in, pool); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_json_decode(&(*jose)->jose.jwk->key, in.text, in.len, &offset, + APR_JSON_FLAGS_WHITESPACE, level, pool); + + if (APR_SUCCESS != status) { + char buf[1024]; + apr_strerror(status, buf, sizeof(buf)); + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWK decoding failed at offset %" APR_OFF_T_FMT ": %s", + offset, buf); + + return status; + } + + return APR_SUCCESS; +} + +apr_status_t apr_jose_decode_jwks(apr_jose_t **jose, + const char *typ, apr_bucket_brigade *bb, apr_jose_cb_t *cb, + int level, int flags, apr_pool_t *pool) +{ + apr_jose_text_t in; + apr_off_t offset; + apr_status_t status; + + status = apr_jose_jwks_make(jose, NULL, pool); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_jose_flatten(bb, &in, pool); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_json_decode(&(*jose)->jose.jwks->keys, in.text, in.len, + &offset, APR_JSON_FLAGS_WHITESPACE, level, pool); + + if (APR_SUCCESS != status) { + char buf[1024]; + apr_strerror(status, buf, sizeof(buf)); + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWKS decoding failed at offset %" APR_OFF_T_FMT ": %s", + offset, buf); + + return status; + } + + if ((*jose)->jose.jwks->keys->type != APR_JSON_ARRAY) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWKS 'keys' is not an array"); + return APR_EINVAL; + } + + return APR_SUCCESS; +} + +apr_status_t apr_jose_decode_jwt(apr_jose_t **jose, + const char *typ, apr_bucket_brigade *bb, apr_jose_cb_t *cb, + int level, int flags, apr_pool_t *pool) +{ + apr_jose_text_t in; + apr_off_t offset; + apr_status_t status; + + status = apr_jose_jwt_make(jose, NULL, pool); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_jose_flatten(bb, &in, pool); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_json_decode(&(*jose)->jose.jwt->claims, in.text, in.len, &offset, + APR_JSON_FLAGS_WHITESPACE, level, pool); + + if (APR_SUCCESS != status) { + char buf[1024]; + apr_strerror(status, buf, sizeof(buf)); + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWT decoding failed at offset %" APR_OFF_T_FMT ": %s", + offset, buf); + + return status; + } + + return APR_SUCCESS; +} + +apr_status_t apr_jose_decode_data(apr_jose_t **jose, const char *typ, + apr_bucket_brigade *brigade, apr_jose_cb_t *cb, int level, int flags, + apr_pool_t *pool) +{ + apr_jose_text_t in; + apr_status_t status; + + status = apr_jose_flatten(brigade, &in, pool); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_jose_data_make(jose, typ, (const unsigned char *) in.text, in.len, + pool); + if (APR_SUCCESS != status) { + return status; + } + + return status; +} + +apr_status_t apr_jose_decode_jws_signature(apr_jose_t **jose, + apr_jose_signature_t *signature, const char *typ, const char *cty, + apr_jose_text_t *ph64, apr_jose_text_t *sig64, apr_jose_text_t *pl64, + apr_json_value_t *uh, apr_jose_cb_t *cb, int level, int *flags, + apr_pool_t *pool, apr_bucket_brigade *bb) +{ + const char *phs; + apr_size_t phlen; + apr_off_t offset; + apr_status_t status = APR_SUCCESS; + + /* + * Base64url-decode the encoded representation of the JWS Protected + * Header, following the restriction that no line breaks, + * whitespace, or other additional characters have been used. + */ + + phs = apr_pdecode_base64(pool, ph64->text, ph64->len, APR_ENCODE_BASE64URL, + &phlen); + + if (!phs) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'protected' is not valid base64url"); + return APR_EINVAL; + } + + /* + * Verify that the resulting octet sequence is a UTF-8-encoded + * representation of a completely valid JSON object conforming to + * RFC 7159 [RFC7159]; let the JWS Protected Header be this JSON + * object. + */ + + status = apr_json_decode(&signature->protected_header, phs, phlen, &offset, + APR_JSON_FLAGS_WHITESPACE, level, pool); + if (APR_SUCCESS != status) { + char buf[1024]; + apr_strerror(status, buf, sizeof(buf)); + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'protected' decoding failed at %" APR_OFF_T_FMT ": %s", + offset, buf); + + return status; + } + + /* + * If using the JWS Compact Serialization, let the JOSE Header be + * the JWS Protected Header. Otherwise, when using the JWS JSON + * Serialization, let the JOSE Header be the union of the members of + * the corresponding JWS Protected Header and JWS Unprotected + * Header, all of which must be completely valid JSON objects. + * During this step, verify that the resulting JOSE Header does not + * contain duplicate Header Parameter names. When using the JWS + * JSON Serialization, this restriction includes that the same + * Header Parameter name also MUST NOT occur in distinct JSON object + * values that together comprise the JOSE Header. + */ + + if (uh) { + signature->header = apr_json_overlay(pool, signature->protected_header, + uh, APR_JSON_FLAGS_STRICT); + } else { + signature->header = signature->protected_header; + } + + /* + * Verify that the implementation understands and can process all + * fields that it is required to support, whether required by this + * specification, by the algorithm being used, or by the "crit" + * Header Parameter value, and that the values of those parameters + * are also understood and supported. + */ + + /* + * Base64url-decode the encoded representation of the JWS Signature, + * following the restriction that no line breaks, whitespace, or + * other additional characters have been used. + */ + + signature->sig.data = apr_pdecode_base64_binary(pool, sig64->text, + sig64->len, + APR_ENCODE_BASE64URL, &signature->sig.len); + if (!signature->sig.data) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS signature decoding failed: bad character"); + return APR_BADCH; + } + + /* + * The verify function is expected to perform some or all of the + * following steps: + * + * FIXME fill in from RFC + */ + + status = cb->verify(bb, *jose, signature, cb->ctx, flags, pool); + + return status; +} + +apr_status_t apr_jose_decode_jwe_recipient(apr_jose_t **jose, + apr_bucket_brigade *bb, apr_jose_recipient_t *recipient, + apr_jose_encryption_t *encryption, const char *typ, const char *cty, + apr_jose_text_t *ph64, apr_jose_text_t *aad64, apr_jose_cb_t *cb, + int level, int *dflags, apr_pool_t *pool) +{ + apr_json_value_t *header; + apr_status_t status; + + /* + * If using the JWE Compact Serialization, let the JOSE Header be + * the JWE Protected Header. Otherwise, when using the JWE JSON + * Serialization, let the JOSE Header be the union of the members + * of the JWE Protected Header, the JWE Shared Unprotected Header + * and the corresponding JWE Per-Recipient Unprotected Header, all + * of which must be completely valid JSON objects. During this + * step, verify that the resulting JOSE Header does not contain + * duplicate Header Parameter names. When using the JWE JSON + * Serialization, this restriction includes that the same Header + * Parameter name also MUST NOT occur in distinct JSON object + * values that together comprise the JOSE Header. + */ + + header = apr_json_overlay(pool, recipient->header, + apr_json_overlay(pool, encryption->protected, + encryption->unprotected, APR_JSON_FLAGS_STRICT), + APR_JSON_FLAGS_STRICT); + + if (!header) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "JWE decryption failed: protected, unprotected and per " + "recipient headers had an overlapping element, or were all missing"); + return APR_EINVAL; + } + + /* + * Verify that the implementation understands and can process all + * fields that it is required to support, whether required by this + * specification, by the algorithms being used, or by the "crit" + * Header Parameter value, and that the values of those parameters + * are also understood and supported. + */ + + /* + * The decrypt function is expected to perform some or all of the + * following steps: + * + * 6. Determine the Key Management Mode employed by the algorithm + * specified by the "alg" (algorithm) Header Parameter. + * + * 7. Verify that the JWE uses a key known to the recipient. + * + * 8. When Direct Key Agreement or Key Agreement with Key Wrapping are + * employed, use the key agreement algorithm to compute the value + * of the agreed upon key. When Direct Key Agreement is employed, + * let the CEK be the agreed upon key. When Key Agreement with Key + * Wrapping is employed, the agreed upon key will be used to + * decrypt the JWE Encrypted Key. + * + * 9. When Key Wrapping, Key Encryption, or Key Agreement with Key + * Wrapping are employed, decrypt the JWE Encrypted Key to produce + * the CEK. The CEK MUST have a length equal to that required for + * the content encryption algorithm. Note that when there are + * multiple recipients, each recipient will only be able to decrypt + * JWE Encrypted Key values that were encrypted to a key in that + * recipient's possession. It is therefore normal to only be able + * to decrypt one of the per-recipient JWE Encrypted Key values to + * obtain the CEK value. Also, see Section 11.5 for security + * considerations on mitigating timing attacks. + * + * 10. When Direct Key Agreement or Direct Encryption are employed, + * verify that the JWE Encrypted Key value is an empty octet + * sequence. + * + * 11. When Direct Encryption is employed, let the CEK be the shared + * symmetric key. + * + * 12. Record whether the CEK could be successfully determined for this + * recipient or not. + * + * 13. If the JWE JSON Serialization is being used, repeat this process + * (steps 4-12) for each recipient contained in the representation. + * + * 14. Compute the Encoded Protected Header value BASE64URL(UTF8(JWE + * Protected Header)). If the JWE Protected Header is not present + * (which can only happen when using the JWE JSON Serialization and + * no "protected" member is present), let this value be the empty + * string. + * + * 15. Let the Additional Authenticated Data encryption parameter be + * ASCII(Encoded Protected Header). However, if a JWE AAD value is + * present (which can only be the case when using the JWE JSON + * Serialization), instead let the Additional Authenticated Data + * encryption parameter be ASCII(Encoded Protected Header || '.' || + * BASE64URL(JWE AAD)). + * + * 16. Decrypt the JWE Ciphertext using the CEK, the JWE Initialization + * Vector, the Additional Authenticated Data value, and the JWE + * Authentication Tag (which is the Authentication Tag input to the + * calculation) using the specified content encryption algorithm, + * returning the decrypted plaintext and validating the JWE + * Authentication Tag in the manner specified for the algorithm, + * rejecting the input without emitting any decrypted output if the + * JWE Authentication Tag is incorrect. + * + * 17. If a "zip" parameter was included, uncompress the decrypted + * plaintext using the specified compression algorithm. + */ + + status = cb->decrypt(bb, *jose, recipient, encryption, header, ph64, aad64, + cb->ctx, dflags, pool); + + recipient->status = status; + + return status; +} + +apr_status_t apr_jose_decode_compact_jws(apr_jose_t **jose, + const char *left, const char *right, + apr_json_value_t *ph, const char *typ, const char *cty, + apr_jose_text_t *in, apr_jose_text_t *ph64, apr_jose_cb_t *cb, + int level, int flags, apr_pool_t *pool, apr_bucket_brigade *bb) +{ + apr_jose_jws_t *jws; + apr_jose_text_t sig64; + apr_jose_text_t pl64; + apr_jose_text_t pls; + const char *dot; + apr_bucket *e; + apr_status_t status = APR_EINVAL; + int vflags = APR_JOSE_FLAG_NONE; + + if (!cb || !cb->verify) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Verification failed: no verify callback provided"); + return APR_EINIT; + } + + status = apr_jose_jws_make(jose, NULL, NULL, NULL, pool); + if (APR_SUCCESS != status) { + return status; + } + jws = (*jose)->jose.jws; + + /* + * If using the JWS Compact Serialization, let the JOSE Header be + * the JWS Protected Header. + */ + + status = apr_jose_signature_make(&jws->signature, NULL, ph, pool); + if (APR_SUCCESS != status) { + return status; + } + + dot = memchr(left, '.', right - left); + if (!dot) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS compact decoding failed: one lonely dot"); + return APR_BADCH; + } + + pl64.text = left; + pl64.len = dot - left; + + left = dot + 1; + + sig64.text = left; + sig64.len = right - left; + + /* + * Validate the JWS Signature against the JWS Signing Input + * ASCII(BASE64URL(UTF8(JWS Protected Header)) || '.' || + * BASE64URL(JWS Payload)) in the manner defined for the algorithm + * being used, which MUST be accurately represented by the value of + * the "alg" (algorithm) Header Parameter, which MUST be present. + * See Section 10.6 for security considerations on algorithm + * validation. Record whether the validation succeeded or not. + */ + + status = apr_brigade_write(bb, NULL, NULL, in->text, + sig64.text - in->text - 1); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_jose_decode_jws_signature(jose, jws->signature, + typ, cty, ph64, &sig64, &pl64, NULL, cb, level, &vflags, pool, bb); + + if (APR_SUCCESS != status) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "JWS verification failed: signature rejected"); + return status; + } + + /* + * Base64url-decode the encoded representation of the JWS Payload, + * following the restriction that no line breaks, whitespace, or + * other additional characters have been used. + */ + + pls.text = apr_pdecode_base64(pool, pl64.text, + pl64.len, APR_ENCODE_BASE64URL, &pls.len); + if (!pls.text) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'payload' is not valid base64url"); + return APR_BADCH; + } + + + apr_brigade_cleanup(bb); + e = apr_bucket_pool_create(pls.text, pls.len, pool, + bb->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(bb, e); + + return APR_SUCCESS; +} + +apr_status_t apr_jose_decode_compact_jwe(apr_jose_t **jose, const char *left, + const char *right, apr_json_value_t *ph, apr_json_value_t *enc, + const char *typ, const char *cty, apr_jose_text_t *ph64, + apr_jose_cb_t *cb, int level, int flags, apr_pool_t *pool, + apr_bucket_brigade *bb) +{ + const char *dot; + apr_jose_jwe_t *jwe; + apr_jose_text_t aad64; + apr_status_t status; + int dflags = APR_JOSE_FLAG_NONE; + + if (!cb || !cb->decrypt) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Decryption failed: no decrypt callback provided"); + return APR_EINIT; + } + + status = apr_jose_jwe_make(jose, NULL, NULL, NULL, NULL, pool); + if (APR_SUCCESS != status) { + return status; + } + jwe = (*jose)->jose.jwe; + + status = apr_jose_encryption_make(&jwe->encryption, NULL, + NULL, pool); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_jose_recipient_make(&jwe->recipient, NULL, pool); + if (APR_SUCCESS != status) { + return status; + } + + /* + * Parse the JWE representation to extract the serialized values + * for the components of the JWE. When using the JWE Compact + * Serialization, these components are the base64url-encoded + * representations of the JWE Protected Header, the JWE Encrypted + * Key, the JWE Initialization Vector, the JWE Ciphertext, and the + * JWE Authentication Tag, and when using the JWE JSON + * Serialization, these components also include the base64url- + * encoded representation of the JWE AAD and the unencoded JWE + * Shared Unprotected Header and JWE Per-Recipient Unprotected + * Header values. When using the JWE Compact Serialization, the + * JWE Protected Header, the JWE Encrypted Key, the JWE + * Initialization Vector, the JWE Ciphertext, and the JWE + * Authentication Tag are represented as base64url-encoded values + * in that order, with each value being separated from the next by + * a single period ('.') character, resulting in exactly four + * delimiting period characters being used. The JWE JSON + * Serialization is described in Section 7.2. + */ + + /* protected header */ + if (ph) { + jwe->encryption->protected = ph; + } + + /* encrypted key */ + dot = memchr(left, '.', right - left); + if (!dot) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: compact JWE decoding failed: one lonely dot"); + return APR_BADCH; + } + + jwe->recipient->ekey.data = apr_pdecode_base64_binary(pool, left, + dot - left, APR_ENCODE_BASE64URL, &jwe->recipient->ekey.len); + if (!jwe->recipient->ekey.data) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE ekey base64url decoding failed at %" APR_SIZE_T_FMT "", + jwe->recipient->ekey.len); + return APR_BADCH; + } + + left = dot + 1; + + /* iv */ + dot = memchr(left, '.', right - left); + if (!dot) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE compact decoding failed: only two dots"); + return APR_BADCH; + } + + jwe->encryption->iv.data = apr_pdecode_base64_binary(pool, left, + dot - left, APR_ENCODE_BASE64URL, &jwe->encryption->iv.len); + if (!jwe->encryption->iv.data) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE iv base64url decoding failed at %" APR_SIZE_T_FMT "", + jwe->encryption->iv.len); + return APR_BADCH; + } + + left = dot + 1; + + /* ciphertext */ + dot = memchr(left, '.', right - left); + if (!dot) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JOSE compact JWE decoding failed: only three dots"); + + return APR_BADCH; + } + + jwe->encryption->cipher.data = apr_pdecode_base64_binary(pool, left, + dot - left, APR_ENCODE_BASE64URL, &jwe->encryption->cipher.len); + if (!jwe->encryption->cipher.data) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE ciphertext base64url decoding failed at %" APR_SIZE_T_FMT "", + jwe->encryption->cipher.len); + + return APR_BADCH; + } + + left = dot + 1; + + /* tag */ + jwe->encryption->tag.data = apr_pdecode_base64_binary(pool, left, + dot - left, APR_ENCODE_BASE64URL, &jwe->encryption->tag.len); + if (!jwe->encryption->tag.data) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE tag base64url decoding failed at %" APR_SIZE_T_FMT "", + jwe->encryption->tag.len); + + return APR_BADCH; + } + + /* aad is the empty string in compact serialisation */ + memset(&aad64, 0, sizeof(apr_jose_text_t)); + + status = apr_jose_decode_jwe_recipient(jose, + bb, jwe->recipient, jwe->encryption, typ, cty, ph64, &aad64, cb, + level, &dflags, pool); + + if (APR_SUCCESS != status) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Decryption failed: JWE decryption failed"); + + return status; + } + + return APR_SUCCESS; +} + +apr_status_t apr_jose_decode_compact(apr_jose_t **jose, const char *typ, + apr_bucket_brigade *brigade, apr_jose_cb_t *cb, int level, int flags, + apr_pool_t *pool) +{ + apr_bucket_brigade *bb; + apr_jose_text_t in; + apr_jose_text_t ph64; + apr_jose_text_t phs; + apr_json_kv_t *kv; + apr_json_value_t *header; + const char *left; + const char *right; + const char *dot; + const char *cty = NULL; + apr_off_t offset; + apr_status_t status = APR_ENOTIMPL; + + status = apr_jose_flatten(brigade, &in, pool); + if (APR_SUCCESS != status) { + return status; + } + + left = in.text; + right = in.text + in.len; + + status = apr_jose_make(jose, APR_JOSE_TYPE_NONE, pool); + if (APR_SUCCESS != status) { + return status; + } + + bb = apr_brigade_create(pool, brigade->bucket_alloc); + if (!bb) { + return APR_ENOMEM; + } + + /* + * Use a heuristic to see whether this is a JWT, JWE or JWS. + * + * This is described in https://tools.ietf.org/html/rfc7519#section-7.2 + */ + + /* Verify that the JWT contains at least one period ('.') + * character. + */ + dot = memchr(left, '.', in.len); + if (!dot) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JOSE compact decoding failed: no dots found"); + + return APR_BADCH; + } + + ph64.text = in.text; + ph64.len = dot - in.text; + + left = dot + 1; + + /* + * Let the Encoded JOSE Header be the portion of the JWT before the + * first period ('.') character. + * + * Base64url decode the Encoded JOSE Header following the + * restriction that no line breaks, whitespace, or other additional + * characters have been used. + */ + + phs.text = apr_pdecode_base64(pool, ph64.text, ph64.len, APR_ENCODE_BASE64URL, + &phs.len); + if (!phs.text) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JOSE header base64url decoding failed at %" APR_SIZE_T_FMT "", + phs.len); + + return APR_BADCH; + } + + /* + * Verify that the resulting octet sequence is a UTF-8-encoded + * representation of a completely valid JSON object conforming to + * RFC 7159 [RFC7159]; let the JOSE Header be this JSON object. + */ + + status = apr_json_decode(&header, phs.text, phs.len, &offset, + APR_JSON_FLAGS_WHITESPACE, level, pool); + + if (APR_SUCCESS != status) { + char buf[1024]; + apr_strerror(status, buf, sizeof(buf)); + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JOSE header decoding failed at %" APR_OFF_T_FMT ": %s", + offset, buf); + + return status; + } + + kv = apr_json_object_get(header, APR_JOSE_JWSE_CONTENT_TYPE, + APR_JSON_VALUE_STRING); + if (kv) { + if (kv->v->type == APR_JSON_STRING) { + cty = apr_pstrndup(pool, kv->v->value.string.p, + kv->v->value.string.len); + } + } + + if (cty) { + if (!strcasecmp(cty, "JWT") || !strcasecmp(cty, "application/jwt")) { + typ = "JWT"; + } + } + + kv = apr_json_object_get(header, APR_JOSE_JWSE_TYPE, APR_JSON_VALUE_STRING); + if (kv) { + if (kv->v->type == APR_JSON_STRING) { + typ = apr_pstrndup(pool, kv->v->value.string.p, + kv->v->value.string.len); + } + } + + /* + * Determine whether the JWT is a JWS or a JWE using any of the + * methods described in Section 9 of [JWE]. + * + * The JOSE Header for a JWS can also be distinguished from the JOSE + * Header for a JWE by determining whether an "enc" (encryption + * algorithm) member exists. If the "enc" member exists, it is a + * JWE; otherwise, it is a JWS. + */ + + kv = apr_json_object_get(header, APR_JOSE_JWE_ENCRYPTION, + APR_JSON_VALUE_STRING); + if (kv) { + status = apr_jose_decode_compact_jwe(jose, left, right, header, kv->v, + typ, cty, &ph64, cb, level, flags, pool, bb); + } else { + status = apr_jose_decode_compact_jws(jose, left, right, header, typ, cty, &in, &ph64, + cb, level, flags, pool, bb); + } + + if (APR_SUCCESS == status) { + + /* + * JWT is an anomaly. + * + * If we have stripped off one level of JOSE, and the content-type + * is present and set to JWT, our payload is a next level JOSE. + * + * If we have stripped off one level of JOSE, and the content-type + * is not present but the type is present and set to JWT, our payload + * is a JSON object containing claims. + */ + + if (!cty && typ + && (!strcasecmp(typ, "JWT") + || !strcasecmp(typ, "application/jwt"))) { + + status = apr_jose_decode_jwt( + flags & APR_JOSE_FLAG_DECODE_ALL ? + &(*jose)->jose.jws->payload : jose, typ, bb, cb, + level, flags, pool); + + } + else { + + status = apr_jose_decode( + flags & APR_JOSE_FLAG_DECODE_ALL ? + &(*jose)->jose.jws->payload : jose, typ, bb, cb, + level, flags, pool); + } + + } + + return status; +} + +apr_status_t apr_jose_decode_json_jws(apr_jose_t **jose, apr_json_value_t *val, + const char *typ, const char *cty, apr_json_value_t *pl, + apr_jose_cb_t *cb, int level, int flags, apr_pool_t *pool, + apr_bucket_brigade *bb) +{ + apr_jose_text_t ph64; + apr_jose_text_t sig64; + apr_jose_text_t pl64; + apr_jose_text_t pls; + apr_jose_jws_t *jws; + apr_json_kv_t *kv; + apr_json_value_t *uh; + apr_bucket *e; + apr_status_t status = APR_EINVAL; + int vflags = APR_JOSE_FLAG_NONE; + + if (!cb || !cb->verify) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Verification failed: no verify callback provided"); + + return APR_EINIT; + } + + if (pl->type != APR_JSON_STRING) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'payload' is not a string"); + + return APR_EINVAL; + } + + pl64.text = pl->value.string.p; + pl64.len = pl->value.string.len; + + /* + * Base64url-decode the encoded representation of the JWS Payload, + * following the restriction that no line breaks, whitespace, or + * other additional characters have been used. + */ + + pls.text = apr_pdecode_base64(pool, pl64.text, + pl64.len, APR_ENCODE_BASE64URL, &pls.len); + if (!pls.text) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'payload' is not valid base64url"); + + return APR_BADCH; + } + + status = apr_jose_jws_json_make(jose, NULL, NULL, NULL, pool); + if (APR_SUCCESS != status) { + return status; + } + jws = (*jose)->jose.jws; + + /* for each signature in signatures... */ + kv = apr_json_object_get(val, APR_JOSE_JWS_SIGNATURES, + APR_JSON_VALUE_STRING); + if (kv) { + apr_json_value_t *sigs = kv->v; + int i; + int verified = 0; + + if (sigs->type != APR_JSON_ARRAY) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'signatures' is not an array"); + + return APR_EINVAL; + } + + jws->signatures = apr_array_make(pool, sigs->value.array->array->nelts, + sizeof(apr_jose_signature_t *)); + if (!jws->signatures) { + return APR_ENOMEM; + } + + /* + * If the JWS JSON Serialization is being used, repeat this process + * (steps 4-8) for each digital signature or MAC value contained in + * the representation. + */ + + for (i = 0; i < sigs->value.array->array->nelts; i++) { + apr_json_value_t *sig = apr_json_array_get(sigs, i); + + if (sig) { + apr_jose_signature_t **sp; + + if (sig->type != APR_JSON_OBJECT) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'signatures' array contains a non-object"); + + return APR_EINVAL; + } + + sp = apr_array_push(jws->signatures); + *sp = apr_pcalloc(pool, sizeof(apr_jose_signature_t)); + if (!*sp) { + return APR_ENOMEM; + } + + kv = apr_json_object_get(sig, APR_JOSE_JWSE_PROTECTED, + APR_JSON_VALUE_STRING); + if (!kv) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'protected' header is missing"); + + return APR_EINVAL; + } + + if (kv->v->type != APR_JSON_STRING) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'protected' is not a string"); + + return APR_EINVAL; + } + + ph64.text = kv->v->value.string.p; + ph64.len = kv->v->value.string.len; + + kv = apr_json_object_get(sig, APR_JOSE_JWSE_HEADER, + APR_JSON_VALUE_STRING); + if (kv) { + + if (kv->v->type != APR_JSON_OBJECT) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'header' is not an object"); + + return APR_EINVAL; + } + + uh = kv->v; + } + else { + uh = NULL; + } + + kv = apr_json_object_get(sig, APR_JOSE_JWS_SIGNATURE, + APR_JSON_VALUE_STRING); + if (!kv) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'signature' header is missing"); + + return APR_EINVAL; + } + + if (kv->v->type != APR_JSON_STRING) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'signature' is not a string"); + + return APR_EINVAL; + } + + sig64.text = kv->v->value.string.p; + sig64.len = kv->v->value.string.len; + + /* + * Validate the JWS Signature against the JWS Signing Input + * ASCII(BASE64URL(UTF8(JWS Protected Header)) || '.' || + * BASE64URL(JWS Payload)) in the manner defined for the algorithm + * being used, which MUST be accurately represented by the value of + * the "alg" (algorithm) Header Parameter, which MUST be present. + * See Section 10.6 for security considerations on algorithm + * validation. Record whether the validation succeeded or not. + */ + + apr_brigade_cleanup(bb); + + status = apr_brigade_write(bb, NULL, NULL, ph64.text, + ph64.len); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_brigade_putc(bb, NULL, NULL, '.'); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_brigade_write(bb, NULL, NULL, pl64.text, + pl64.len); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_jose_decode_jws_signature(jose, *sp, typ, cty, + &ph64, &sig64, &pl64, uh, cb, level, &vflags, pool, bb); + + if (APR_SUCCESS == status) { + + verified++; + + if (verified == 1) { + + apr_brigade_cleanup(bb); + e = apr_bucket_pool_create(pls.text, pls.len, pool, + bb->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(bb, e); + + status = apr_jose_decode( + flags & APR_JOSE_FLAG_DECODE_ALL ? + &(*jose)->jose.jwe->payload : jose, typ, + bb, cb, level, flags, pool); + + if (APR_SUCCESS != status) { + return status; + } + + } + + } + + if (!(vflags & APR_JOSE_FLAG_BREAK)) { + break; + } + + } + + } + + if (!verified) { + apr_jose_t *j = *jose; + + if (!j->result.msg) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "JWS verification failed: no signatures matched"); + } + + return APR_ENOVERIFY; + } + + return APR_SUCCESS; + } + + status = apr_jose_signature_make(&jws->signature, NULL, NULL, + pool); + if (APR_SUCCESS != status) { + return status; + } + + kv = apr_json_object_get(val, APR_JOSE_JWSE_PROTECTED, + APR_JSON_VALUE_STRING); + if (!kv) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'protected' header is missing"); + + return APR_EINVAL; + } + + if (kv->v->type != APR_JSON_STRING) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'protected' is not a string"); + + return APR_EINVAL; + } + + ph64.text = kv->v->value.string.p; + ph64.len = kv->v->value.string.len; + + kv = apr_json_object_get(val, APR_JOSE_JWSE_HEADER, APR_JSON_VALUE_STRING); + if (kv) { + + if (kv->v->type != APR_JSON_OBJECT) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'header' is not an object"); + + return APR_EINVAL; + } + + uh = kv->v; + } + else { + uh = NULL; + } + + kv = apr_json_object_get(val, APR_JOSE_JWS_SIGNATURE, + APR_JSON_VALUE_STRING); + if (!kv) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'signature' header is missing"); + + return APR_EINVAL; + } + + if (kv->v->type != APR_JSON_STRING) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWS 'signature' is not a string"); + + return APR_EINVAL; + } + + sig64.text = kv->v->value.string.p; + sig64.len = kv->v->value.string.len; + + /* + * Validate the JWS Signature against the JWS Signing Input + * ASCII(BASE64URL(UTF8(JWS Protected Header)) || '.' || + * BASE64URL(JWS Payload)) in the manner defined for the algorithm + * being used, which MUST be accurately represented by the value of + * the "alg" (algorithm) Header Parameter, which MUST be present. + * See Section 10.6 for security considerations on algorithm + * validation. Record whether the validation succeeded or not. + */ + + apr_brigade_cleanup(bb); + + status = apr_brigade_write(bb, NULL, NULL, ph64.text, + ph64.len); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_brigade_putc(bb, NULL, NULL, '.'); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_brigade_write(bb, NULL, NULL, pl64.text, + pl64.len); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_jose_decode_jws_signature(jose, jws->signature, typ, cty, + &ph64, &sig64, &pl64, uh, cb, level, &vflags, pool, bb); + + if (APR_SUCCESS != status) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "JWS verification failed: signature rejected"); + + return status; + } + + apr_brigade_cleanup(bb); + e = apr_bucket_pool_create(pls.text, pls.len, pool, + bb->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(bb, e); + + return apr_jose_decode( + flags & APR_JOSE_FLAG_DECODE_ALL ? + &(*jose)->jose.jws->payload : jose, typ, bb, cb, + level, flags, pool); +} + +apr_status_t apr_jose_decode_json_jwe(apr_jose_t **jose, apr_json_value_t *val, + const char *typ, const char *cty, apr_json_value_t *ct, + apr_jose_cb_t *cb, int level, int flags, apr_pool_t *pool, + apr_bucket_brigade *bb) +{ + apr_jose_text_t ph64; + apr_jose_text_t aad64; + apr_jose_jwe_t *jwe; + apr_json_kv_t *kv; + apr_status_t status = APR_EGENERAL; + int dflags = APR_JOSE_FLAG_NONE; + + if (!cb || !cb->decrypt) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Decryption failed: no decrypt callback provided"); + + return APR_EINIT; + } + + if (ct->type != APR_JSON_STRING) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'ciphertext' is not a string"); + + return APR_EINVAL; + } + + status = apr_jose_jwe_json_make(jose, NULL, NULL, NULL, NULL, pool); + if (APR_SUCCESS != status) { + return status; + } + jwe = (*jose)->jose.jwe; + + status = apr_jose_encryption_make(&jwe->encryption, NULL, + NULL, pool); + if (APR_SUCCESS != status) { + return status; + } + + /* + * Base64url decode the encoded representations of the JWE + * Protected Header, the JWE Encrypted Key, the JWE Initialization + * Vector, the JWE Ciphertext, the JWE Authentication Tag, and the + * JWE AAD, following the restriction that no line breaks, + * whitespace, or other additional characters have been used. + */ + + kv = apr_json_object_get(val, APR_JOSE_JWSE_PROTECTED, + APR_JSON_VALUE_STRING); + if (kv) { + const char *phs; + apr_size_t phlen; + apr_off_t offset; + + if (kv->v->type != APR_JSON_STRING) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'protected' is not a string"); + + return APR_EINVAL; + } + + /* + * Verify that the octet sequence resulting from decoding the + * encoded JWE Protected Header is a UTF-8-encoded representation + * of a completely valid JSON object conforming to RFC 7159 + * [RFC7159]; let the JWE Protected Header be this JSON object. + */ + + ph64.text = kv->v->value.string.p; + ph64.len = kv->v->value.string.len; + + phs = apr_pdecode_base64(pool, ph64.text, + ph64.len, APR_ENCODE_BASE64URL, &phlen); + + if (!phs) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'protected' is not valid base64url"); + + return APR_EINVAL; + } + + status = apr_json_decode(&jwe->encryption->protected, phs, phlen, &offset, + APR_JSON_FLAGS_WHITESPACE, level, pool); + if (APR_SUCCESS != status) { + char buf[1024]; + apr_strerror(status, buf, sizeof(buf)); + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'protected' decoding failed at %" APR_OFF_T_FMT ": %s", + offset, buf); + + return status; + } + + } + else { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'protected' header is missing"); + + return APR_EINVAL; + } + + /* unprotected */ + kv = apr_json_object_get(val, APR_JOSE_JWE_UNPROTECTED, + APR_JSON_VALUE_STRING); + if (kv) { + + if (kv->v->type != APR_JSON_OBJECT) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'unprotected' is not an object"); + + return APR_EINVAL; + } + + jwe->encryption->unprotected = kv->v; + } + + /* ciphertext */ + jwe->encryption->cipher.data = apr_pdecode_base64_binary(pool, + ct->value.string.p, ct->value.string.len, APR_ENCODE_BASE64URL, + &jwe->encryption->cipher.len); + if (!jwe->encryption->cipher.data) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'ciphertext' is not valid base64url"); + + return APR_BADCH; + } + + /* iv */ + kv = apr_json_object_get(val, APR_JOSE_JWE_IV, APR_JSON_VALUE_STRING); + if (kv) { + + if (kv->v->type != APR_JSON_STRING) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'iv' is not a string"); + + return APR_EINVAL; + } + + jwe->encryption->iv.data = apr_pdecode_base64_binary(pool, + kv->v->value.string.p, kv->v->value.string.len, APR_ENCODE_BASE64URL, + &jwe->encryption->iv.len); + if (!jwe->encryption->iv.data) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'iv' is not valid base64url"); + + return APR_BADCH; + } + + } + + /* tag */ + kv = apr_json_object_get(val, APR_JOSE_JWE_TAG, APR_JSON_VALUE_STRING); + if (kv) { + + if (kv->v->type != APR_JSON_STRING) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'tag' is not a string"); + + return APR_EINVAL; + } + + jwe->encryption->tag.data = apr_pdecode_base64_binary(pool, + kv->v->value.string.p, kv->v->value.string.len, APR_ENCODE_BASE64URL, + &jwe->encryption->tag.len); + if (!jwe->encryption->tag.data) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'tag' is not valid base64url"); + + return APR_BADCH; + } + + } + + /* aad */ + kv = apr_json_object_get(val, APR_JOSE_JWE_AAD, APR_JSON_VALUE_STRING); + if (kv) { + + if (kv->v->type != APR_JSON_STRING) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'aad' is not a string"); + + return APR_EINVAL; + } + + aad64.text = kv->v->value.string.p; + aad64.len = kv->v->value.string.len; + + jwe->encryption->aad.data = apr_pdecode_base64_binary(pool, + aad64.text, aad64.len, APR_ENCODE_BASE64URL, + &jwe->encryption->aad.len); + if (!jwe->encryption->aad.data) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'add' is not valid base64url"); + + return APR_BADCH; + } + + } + else { + memset(&aad64, 0, sizeof(apr_jose_text_t)); + } + + /* for each recipient in recipients... */ + kv = apr_json_object_get(val, APR_JOSE_JWE_RECIPIENTS, + APR_JSON_VALUE_STRING); + if (kv) { + apr_json_value_t *recips = kv->v; + int i; + int decrypt = 0; + + if (recips->type != APR_JSON_ARRAY) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'recipients' is not an array"); + + return APR_EINVAL; + } + + (*jose)->jose.jwe->recipients = apr_array_make(pool, + recips->value.array->array->nelts, sizeof(apr_jose_recipient_t *)); + if (!(*jose)->jose.jwe->recipients) { + return APR_ENOMEM; + } + + for (i = 0; i < recips->value.array->array->nelts; i++) { + apr_json_value_t *recip = apr_json_array_get(recips, i); + + if (recip) { + apr_jose_recipient_t **rp; + apr_jose_recipient_t *recipient; + + if (recip->type != APR_JSON_OBJECT) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'recipients' array contains a non-object"); + + return APR_EINVAL; + } + + rp = apr_array_push((*jose)->jose.jwe->recipients); + *rp = recipient = apr_pcalloc(pool, sizeof(apr_jose_recipient_t)); + if (!recipient) { + return APR_ENOMEM; + } + + /* unprotected */ + kv = apr_json_object_get(recip, APR_JOSE_JWSE_HEADER, + APR_JSON_VALUE_STRING); + if (kv) { + + if (kv->v->type != APR_JSON_OBJECT) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'header' is not an object"); + + return APR_EINVAL; + } + + recipient->header = kv->v; + } + + kv = apr_json_object_get(recip, APR_JOSE_JWE_EKEY, + APR_JSON_VALUE_STRING); + if (kv) { + + if (kv->v->type != APR_JSON_STRING) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'encrypted_key' element must be a string"); + + return APR_EINVAL; + } + + recipient->ekey.data = apr_pdecode_base64_binary(pool, + kv->v->value.string.p, kv->v->value.string.len, APR_ENCODE_BASE64URL, + &recipient->ekey.len); + if (!recipient->ekey.data) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'encrypted_key' is not valid base64url"); + + return APR_BADCH; + } + + } + + apr_brigade_cleanup(bb); + + status = apr_jose_decode_jwe_recipient(jose, bb, recipient, + jwe->encryption, typ, cty, &ph64, &aad64, cb, level, + &dflags, pool); + + if (APR_SUCCESS == status) { + + decrypt++; + + if (decrypt == 1) { + + status = apr_jose_decode( + flags & APR_JOSE_FLAG_DECODE_ALL ? + &(*jose)->jose.jwe->payload : jose, typ, + bb, cb, level, flags, pool); + + if (APR_SUCCESS != status) { + return status; + } + + } + + } + + if (!(dflags & APR_JOSE_FLAG_BREAK)) { + break; + } + + } + + } + + if (!decrypt) { + apr_jose_t *j = *jose; + + if (!j->result.msg) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "JWE decryption failed: no recipients matched"); + } + + return APR_ECRYPT; + } + + return APR_SUCCESS; + } + + /* ok, just one recipient */ + kv = apr_json_object_get(val, APR_JOSE_JWE_EKEY, APR_JSON_VALUE_STRING); + if (kv) { + apr_json_value_t *ekey = kv->v; + apr_jose_recipient_t *recipient; + + if (ekey->type != APR_JSON_STRING) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'encrypted_key' element must be a string"); + + return APR_EINVAL; + } + + recipient = apr_pcalloc(pool, sizeof(apr_jose_recipient_t)); + if (!recipient) { + return APR_ENOMEM; + } + + /* unprotected */ + kv = apr_json_object_get(val, APR_JOSE_JWSE_HEADER, + APR_JSON_VALUE_STRING); + if (kv) { + + if (kv->v->type != APR_JSON_OBJECT) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JWE 'header' is not an object"); + + return APR_EINVAL; + } + + recipient->header = kv->v; + } + + apr_brigade_cleanup(bb); + + status = apr_jose_decode_jwe_recipient(jose, bb, recipient, + jwe->encryption, typ, cty, &ph64, &aad64, cb, level, &dflags, + pool); + + if (APR_SUCCESS == status) { + + return apr_jose_decode( + flags & APR_JOSE_FLAG_DECODE_ALL ? + &(*jose)->jose.jwe->payload : jose, typ, bb, + cb, level, flags, pool); + + } + + if (APR_SUCCESS != status) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Decryption failed: JWE decryption failed"); + } + + } + + /* no recipient at all */ + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: No 'recipients' or 'encrypted_key' present"); + + return APR_EINVAL; + +} + +apr_status_t apr_jose_decode_json(apr_jose_t **jose, const char *typ, + apr_bucket_brigade *brigade, apr_jose_cb_t *cb, int level, + int flags, apr_pool_t *pool) +{ + apr_json_value_t *val; + apr_bucket_brigade *bb; + apr_jose_text_t in; + apr_off_t offset; + apr_status_t status; + + status = apr_jose_make(jose, APR_JOSE_TYPE_NONE, pool); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_jose_flatten(brigade, &in, pool); + if (APR_SUCCESS != status) { + return status; + } + + bb = apr_brigade_create(pool, brigade->bucket_alloc); + if (!bb) { + return APR_ENOMEM; + } + + /* + * Parse the JWS representation to extract the serialized values for + * the components of the JWS. When using the JWS Compact + * Serialization, these components are the base64url-encoded + * representations of the JWS Protected Header, the JWS Payload, and + * the JWS Signature, and when using the JWS JSON Serialization, + * these components also include the unencoded JWS Unprotected + * Header value. When using the JWS Compact Serialization, the JWS + * Protected Header, the JWS Payload, and the JWS Signature are + * represented as base64url-encoded values in that order, with each + * value being separated from the next by a single period ('.') + * character, resulting in exactly two delimiting period characters + * being used. The JWS JSON Serialization is described in + * Section 7.2. + */ + + status = apr_json_decode(&val, in.text, in.len, &offset, + APR_JSON_FLAGS_WHITESPACE, level, pool); + if (APR_SUCCESS == status) { + apr_json_kv_t *kv; + const char *cty = NULL; + + /* + * 9. Distinguishing between JWS and JWE Objects + * + * If the object is using the JWS JSON Serialization or the JWE JSON + * Serialization, the members used will be different. JWSs have a + * "payload" member and JWEs do not. JWEs have a "ciphertext" member + * and JWSs do not. + */ + + /* are we JWS? */ + kv = apr_json_object_get(val, APR_JOSE_JWS_PAYLOAD, + APR_JSON_VALUE_STRING); + if (kv) { + + return apr_jose_decode_json_jws(jose, val, typ, cty, + kv->v, cb, level, flags, pool, bb); + + } + + /* are we JWE? */ + kv = apr_json_object_get(val, APR_JOSE_JWE_CIPHERTEXT, + APR_JSON_VALUE_STRING); + if (kv) { + + return apr_jose_decode_json_jwe(jose, val, typ, cty, + kv->v, cb, level, flags, pool, bb); + + } + + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JOSE JSON contained neither a 'payload' nor a 'ciphertext'"); + + return APR_EINVAL; + + } + else { + char buf[1024]; + apr_strerror(status, buf, sizeof(buf)); + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: JOSE JSON decoding failed at character %" APR_OFF_T_FMT ": %s", + offset, buf); + } + + return status; +} + +apr_status_t apr_jose_decode(apr_jose_t **jose, const char *typ, + apr_bucket_brigade *brigade, apr_jose_cb_t *cb, int level, int flags, + apr_pool_t *pool) +{ + + /* handle JOSE and JOSE+JSON */ + if (typ) { + switch (typ[0]) { + case 'a': + case 'A': { + + if (!strncasecmp(typ, "application/", 12)) { + const char *sub = typ + 12; + + if (!strcasecmp(sub, "jwt")) { + return apr_jose_decode_compact(jose, typ, brigade, cb, + level, flags, pool); + } else if (!strcasecmp(sub, "jose")) { + return apr_jose_decode_compact(jose, NULL, brigade, cb, + level, flags, pool); + } else if (!strcasecmp(sub, "jose+json")) { + return apr_jose_decode_json(jose, NULL, brigade, cb, level, + flags, pool); + } else if (!strcasecmp(sub, "jwk+json")) { + return apr_jose_decode_jwk(jose, typ, brigade, cb, level, + flags, pool); + } else if (!strcasecmp(sub, "jwk-set+json")) { + return apr_jose_decode_jwks(jose, typ, brigade, cb, level, + flags, pool); + } + + } + + break; + } + case 'J': + case 'j': { + + if (!strcasecmp(typ, "JWT")) { + return apr_jose_decode_compact(jose, typ, brigade, cb, level, flags, + pool); + } else if (!strcasecmp(typ, "JOSE")) { + return apr_jose_decode_compact(jose, NULL, brigade, cb, level, + flags, pool); + } else if (!strcasecmp(typ, "JOSE+JSON")) { + return apr_jose_decode_json(jose, NULL, brigade, cb, level, flags, + pool); + } else if (!strcasecmp(typ, "JWK+JSON")) { + return apr_jose_decode_jwk(jose, typ, brigade, cb, level, flags, + pool); + } else if (!strcasecmp(typ, "JWK-SET+JSON")) { + return apr_jose_decode_jwks(jose, typ, brigade, cb, level, flags, + pool); + } + + break; + } + } + } + + return apr_jose_decode_data(jose, typ, brigade, cb, level, flags, pool); +} diff --git a/jose/apr_jose_encode.c b/jose/apr_jose_encode.c new file mode 100644 index 00000000000..43a4adc8b09 --- /dev/null +++ b/jose/apr_jose_encode.c @@ -0,0 +1,825 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_jose.h" +#include "apr_encode.h" + +static apr_status_t apr_jose_encode_base64_json(apr_bucket_brigade *brigade, + apr_brigade_flush flush, void *ctx, apr_json_value_t *json, + apr_pool_t *pool) +{ + apr_status_t status = APR_SUCCESS; + + if (json) { + + apr_bucket_brigade *bb; + + bb = apr_brigade_create(pool, brigade->bucket_alloc); + + status = apr_json_encode(bb, flush, ctx, json, + APR_JSON_FLAGS_WHITESPACE, pool); + if (APR_SUCCESS == status) { + + char *buf; + apr_size_t buflen; + const char *buf64; + apr_size_t buf64len; + + apr_brigade_pflatten(bb, &buf, &buflen, pool); + buf64 = apr_pencode_base64(pool, buf, buflen, APR_ENCODE_BASE64URL, + &buf64len); + status = apr_brigade_write(brigade, flush, ctx, buf64, buf64len); + + } + + } + + return status; +} + +static apr_status_t apr_jose_encode_compact_jwe(apr_bucket_brigade *brigade, + apr_brigade_flush flush, void *ctx, apr_jose_t *jose, apr_jose_cb_t *cb, + apr_pool_t *p) +{ + apr_bucket_brigade *bb = apr_brigade_create(p, + brigade->bucket_alloc); + + apr_jose_jwe_t *jwe = jose->jose.jwe; + + apr_status_t status = APR_SUCCESS; + + /* + * 7.1. JWE Compact Serialization + * + * The JWE Compact Serialization represents encrypted content as a + * compact, URL-safe string. This string is: + * + * BASE64URL(UTF8(JWE Protected Header)) || '.' || + */ + + status = apr_jose_encode_base64_json(brigade, flush, ctx, + jwe->encryption->protected, p); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_brigade_write(brigade, flush, ctx, ".", 1); + if (APR_SUCCESS != status) { + return status; + } + + if (cb && cb->encrypt) { + status = apr_jose_encode(bb, flush, ctx, jwe->payload, cb, p); + if (APR_SUCCESS != status) { + jose->result = jwe->payload->result; + return status; + } + status = cb->encrypt(bb, jose, jwe->recipient, jwe->encryption, + cb->ctx, p); + if (APR_SUCCESS != status) { + return status; + } + } + + if (APR_SUCCESS == status) { + + struct iovec vec[7]; + + /* + * 7. Compute the encoded key value BASE64URL(JWE Encrypted Key). + * + * 10. Compute the encoded Initialization Vector value BASE64URL(JWE + * Initialization Vector). + * + * 16. Compute the encoded ciphertext value BASE64URL(JWE Ciphertext). + * + * 17. Compute the encoded Authentication Tag value BASE64URL(JWE + * Authentication Tag). + * + * 18. If a JWE AAD value is present, compute the encoded AAD value + * BASE64URL(JWE AAD). + * + * 19. Create the desired serialized output. The Compact Serialization + * of this result is the string BASE64URL(UTF8(JWE Protected + * Header)) || '.' || BASE64URL(JWE Encrypted Key) || '.' || + * BASE64URL(JWE Initialization Vector) || '.' || BASE64URL(JWE + * Ciphertext) || '.' || BASE64URL(JWE Authentication Tag). The + * JWE JSON Serialization is described in Section 7.2. + */ + + /* + * BASE64URL(JWE Encrypted Key) || '.' || + */ + + vec[0].iov_base = (void *) apr_pencode_base64_binary(p, + jwe->recipient->ekey.data, jwe->recipient->ekey.len, + APR_ENCODE_BASE64URL, &vec[0].iov_len); + vec[1].iov_base = "."; + vec[1].iov_len = 1; + + /* + * BASE64URL(JWE Initialization Vector) || '.' || + */ + + vec[2].iov_base = (void *) apr_pencode_base64_binary(p, + jwe->encryption->iv.data, jwe->encryption->iv.len, + APR_ENCODE_BASE64URL, &vec[2].iov_len); + vec[3].iov_base = "."; + vec[3].iov_len = 1; + + /* + * BASE64URL(JWE Ciphertext) || '.' || + */ + + vec[4].iov_base = (void *) apr_pencode_base64_binary(p, + jwe->encryption->cipher.data, jwe->encryption->cipher.len, + APR_ENCODE_BASE64URL, &vec[4].iov_len); + vec[5].iov_base = "."; + vec[5].iov_len = 1; + + /* + * BASE64URL(JWE Authentication Tag) + */ + + vec[6].iov_base = (void *)apr_pencode_base64_binary(p, jwe->encryption->tag.data, jwe->encryption->tag.len, + APR_ENCODE_BASE64URL, &vec[6].iov_len); + + status = apr_brigade_writev(brigade, flush, ctx, vec, 7); + + } + + return status; +} + +static apr_status_t apr_jose_encode_compact_jws(apr_bucket_brigade *brigade, + apr_brigade_flush flush, void *ctx, apr_jose_t *jose, apr_jose_cb_t *cb, + apr_pool_t *p) +{ + apr_bucket *e; + apr_bucket_brigade *bb = apr_brigade_create(p, + brigade->bucket_alloc); + apr_jose_text_t payload; + apr_jose_text_t payload64; + + apr_jose_jws_t *jws = jose->jose.jws; + + apr_status_t status; + + status = apr_jose_encode(bb, flush, ctx, jws->payload, cb, p); + if (APR_SUCCESS != status) { + jose->result = jws->payload->result; + return status; + } + + status = apr_brigade_pflatten(bb, (char **)&payload.text, &payload.len, p); + if (APR_SUCCESS != status) { + return status; + } + + payload64.text = apr_pencode_base64(p, payload.text, payload.len, + APR_ENCODE_BASE64URL, &payload64.len); + + apr_brigade_cleanup(bb); + + /* + * 7.1. JWS Compact Serialization + * + * The JWS Compact Serialization represents digitally signed or MACed + * content as a compact, URL-safe string. This string is: + * + * BASE64URL(UTF8(JWS Protected Header)) || '.' || + */ + + if (jws->signature) { + status = apr_jose_encode_base64_json(bb, flush, ctx, + jws->signature->protected_header, p); + if (APR_SUCCESS != status) { + return status; + } + } + + status = apr_brigade_write(bb, flush, ctx, ".", 1); + if (APR_SUCCESS != status) { + return status; + } + + /* + * BASE64URL(JWS Payload) || + */ + + e = apr_bucket_pool_create(payload64.text, payload64.len, p, + bb->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(bb, e); + + /* + * '.' || BASE64URL(JWS Signature) + */ + + if (cb && cb->sign && jws->signature) { + status = cb->sign(bb, jose, jws->signature, cb->ctx, p); + if (APR_SUCCESS != status) { + return status; + } + } + + APR_BRIGADE_CONCAT(brigade, bb); + + status = apr_brigade_write(brigade, flush, ctx, ".", 1); + if (APR_SUCCESS != status) { + return status; + } + + if (jws->signature && jws->signature->sig.data && APR_SUCCESS == status) { + + const char *buf64; + apr_size_t buf64len; + + buf64 = apr_pencode_base64_binary(p, jws->signature->sig.data, + jws->signature->sig.len, + APR_ENCODE_BASE64URL, &buf64len); + status = apr_brigade_write(brigade, flush, ctx, buf64, + buf64len); + + } + + return status; +} + +static apr_status_t apr_jose_encode_json_jwe(apr_bucket_brigade *brigade, + apr_brigade_flush flush, void *ctx, apr_jose_t *jose, apr_jose_cb_t *cb, + apr_pool_t *p) +{ + + apr_json_value_t *json, *key, *val; + char *buf; + const char *buf64; + apr_size_t len; + apr_size_t len64; + + apr_bucket_brigade *bb = apr_brigade_create(p, + brigade->bucket_alloc); + + apr_jose_jwe_t *jwe = jose->jose.jwe; + + apr_status_t status = APR_SUCCESS; + + /* create our json */ + + json = apr_json_object_create(p); + + /* create protected header */ + + if (jwe->encryption) { + apr_jose_encryption_t *e = jwe->encryption; + + if (e->protected) { + + status = apr_jose_encode_base64_json(bb, flush, ctx, + e->protected, p); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_brigade_pflatten(bb, &buf, &len, p); + if (APR_SUCCESS != status) { + return status; + } + + apr_brigade_cleanup(bb); + + key = apr_json_string_create(p, "protected", + APR_JSON_VALUE_STRING); + val = apr_json_string_create(p, buf, len); + apr_json_object_set(json, key, val, p); + + } + + /* create unprotected header */ + + if (e->unprotected) { + + key = apr_json_string_create(p, "unprotected", + APR_JSON_VALUE_STRING); + apr_json_object_set(json, key, e->unprotected, p); + + } + + /* create recipient */ + if (jwe->recipient) { + + apr_jose_recipient_t *recip = jwe->recipient; + + /* create the payload */ + + status = apr_jose_encode(bb, flush, ctx, jwe->payload, cb, p); + if (APR_SUCCESS != status) { + jose->result = jwe->payload->result; + return status; + } + + if (cb && cb->encrypt && recip) { + status = cb->encrypt(bb, jose, recip, e, cb->ctx, p); + if (APR_SUCCESS != status) { + return status; + } + } + + apr_brigade_cleanup(bb); + + /* create header */ + + key = apr_json_string_create(p, "header", + APR_JSON_VALUE_STRING); + apr_json_object_set(json, key, recip->header, p); + + apr_brigade_cleanup(bb); + + /* create encrypted key */ + + buf64 = apr_pencode_base64_binary(p, recip->ekey.data, + recip->ekey.len, + APR_ENCODE_BASE64URL, &len64); + + key = apr_json_string_create(p, "encrypted_key", + APR_JSON_VALUE_STRING); + val = apr_json_string_create(p, buf64, len64); + apr_json_object_set(json, key, val, p); + + } + + /* create recipients */ + if (jwe->recipients) { + + apr_json_value_t *recips; + int i; + + /* create recipients element */ + + key = apr_json_string_create(p, "recipients", + APR_JSON_VALUE_STRING); + recips = apr_json_array_create(p, jwe->recipients->nelts); + apr_json_object_set(json, key, recips, p); + + /* populate each recipient */ + + for (i = 0; i < jwe->recipients->nelts; i++) { + apr_json_value_t *r = apr_json_object_create(p); + apr_jose_recipient_t *recip = APR_ARRAY_IDX( + jwe->recipients, i, apr_jose_recipient_t *); + + if (!recip) { + continue; + } + + apr_json_array_add(recips, r); + + /* create the payload */ + + status = apr_jose_encode(bb, flush, ctx, jwe->payload, cb, p); + if (APR_SUCCESS != status) { + jose->result = jwe->payload->result; + return status; + } + + if (cb && cb->encrypt && recip) { + status = cb->encrypt(bb, jose, recip, e, cb->ctx, p); + if (APR_SUCCESS != status) { + return status; + } + } + + apr_brigade_cleanup(bb); + + /* create header */ + + key = apr_json_string_create(p, "header", + APR_JSON_VALUE_STRING); + apr_json_object_set(r, key, recip->header, p); + + apr_brigade_cleanup(bb); + + /* create encrypted key */ + + buf64 = apr_pencode_base64_binary(p, recip->ekey.data, + recip->ekey.len, + APR_ENCODE_BASE64URL, &len64); + + key = apr_json_string_create(p, "encrypted_key", + APR_JSON_VALUE_STRING); + val = apr_json_string_create(p, buf64, len64); + apr_json_object_set(r, key, val, p); + + } + if (APR_SUCCESS != status) { + return status; + } + + } + + /* create iv */ + + if (e->iv.len) { + + buf64 = apr_pencode_base64_binary(p, e->iv.data, e->iv.len, + APR_ENCODE_BASE64URL, &len64); + + key = apr_json_string_create(p, "iv", APR_JSON_VALUE_STRING); + val = apr_json_string_create(p, buf64, len64); + apr_json_object_set(json, key, val, p); + } + + /* create aad */ + + if (e->aad.len) { + + buf64 = apr_pencode_base64_binary(p, e->aad.data, e->aad.len, + APR_ENCODE_BASE64URL, &len64); + + key = apr_json_string_create(p, "aad", APR_JSON_VALUE_STRING); + val = apr_json_string_create(p, buf64, len64); + apr_json_object_set(json, key, val, p); + } + + /* create ciphertext */ + + if (e->cipher.len) { + + buf64 = apr_pencode_base64_binary(p, e->cipher.data, e->cipher.len, + APR_ENCODE_BASE64URL, &len64); + + key = apr_json_string_create(p, "ciphertext", APR_JSON_VALUE_STRING); + val = apr_json_string_create(p, buf64, len64); + apr_json_object_set(json, key, val, p); + } + + /* create tag */ + + if (e->tag.len) { + + buf64 = apr_pencode_base64_binary(p, e->tag.data, e->tag.len, + APR_ENCODE_BASE64URL, &len64); + + key = apr_json_string_create(p, "tag", APR_JSON_VALUE_STRING); + val = apr_json_string_create(p, buf64, len64); + apr_json_object_set(json, key, val, p); + } + + } + + /* write out our final result */ + + if (json) { + status = apr_json_encode(brigade, flush, ctx, json, + APR_JSON_FLAGS_WHITESPACE, p); + } + + return status; +} + +static apr_status_t apr_jose_encode_json_jws(apr_bucket_brigade *brigade, + apr_brigade_flush flush, void *ctx, apr_jose_t *jose, apr_jose_cb_t *cb, + apr_pool_t *p) +{ + apr_json_value_t *json, *key, *val; + char *buf; + const char *buf64; + apr_size_t len; + apr_size_t len64; + + apr_bucket_brigade *bb = apr_brigade_create(p, + brigade->bucket_alloc); + + apr_jose_jws_t *jws = jose->jose.jws; + + apr_status_t status = APR_SUCCESS; + + /* create our json */ + + json = apr_json_object_create(p); + + /* calculate BASE64URL(JWS Payload) */ + + status = apr_jose_encode(bb, flush, ctx, jws->payload, cb, p); + if (APR_SUCCESS != status) { + jose->result = jws->payload->result; + return status; + } + + status = apr_brigade_pflatten(bb, &buf, &len, p); + if (APR_SUCCESS != status) { + return status; + } + + buf64 = apr_pencode_base64(p, buf, len, + APR_ENCODE_BASE64URL, &len64); + + apr_brigade_cleanup(bb); + + /* add the payload to our json */ + + key = apr_json_string_create(p, "payload", APR_JSON_VALUE_STRING); + val = apr_json_string_create(p, buf64, len64); + apr_json_object_set(json, key, val, p); + + /* calculate the flattened signature */ + + if (jws->signature) { + + /* create protected header */ + + status = apr_jose_encode_base64_json(bb, flush, ctx, + jws->signature->protected_header, p); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_brigade_pflatten(bb, &buf, &len, p); + if (APR_SUCCESS != status) { + return status; + } + + key = apr_json_string_create(p, "protected", APR_JSON_VALUE_STRING); + val = apr_json_string_create(p, buf, len); + apr_json_object_set(json, key, val, p); + + status = apr_brigade_write(bb, flush, ctx, ".", 1); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_brigade_write(bb, flush, ctx, buf64, len64); + if (APR_SUCCESS != status) { + return status; + } + + if (cb && cb->sign && jws->signature) { + status = cb->sign(bb, jose, jws->signature, cb->ctx, p); + if (APR_SUCCESS != status) { + return status; + } + } + + apr_brigade_cleanup(bb); + + /* create header */ + + key = apr_json_string_create(p, "header", APR_JSON_VALUE_STRING); + apr_json_object_set(json, key, jws->signature->header, p); + + apr_brigade_cleanup(bb); + + /* create signature */ + + buf64 = apr_pencode_base64_binary(p, + jws->signature->sig.data, jws->signature->sig.len, + APR_ENCODE_BASE64URL, &len64); + + key = apr_json_string_create(p, "signature", APR_JSON_VALUE_STRING); + val = apr_json_string_create(p, buf64, len64); + apr_json_object_set(json, key, val, p); + + } + + /* otherwise calculate the general signatures */ + + else if (jws->signatures) { + + apr_json_value_t *sigs; + int i; + + /* create signatures element */ + + key = apr_json_string_create(p, "signatures", APR_JSON_VALUE_STRING); + sigs = apr_json_array_create(p, jws->signatures->nelts); + apr_json_object_set(json, key, sigs, p); + + /* populate each signature */ + + for (i = 0; i < jws->signatures->nelts; i++) { + apr_json_value_t *s = apr_json_object_create(p); + apr_jose_signature_t *sig = APR_ARRAY_IDX( + jws->signatures, i, apr_jose_signature_t *); + + apr_json_array_add(sigs, s); + + /* create protected header */ + + status = apr_jose_encode_base64_json(bb, flush, ctx, + sig->protected_header, p); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_brigade_pflatten(bb, &buf, &len, p); + if (APR_SUCCESS != status) { + return status; + } + + /* add protected header to array */ + + key = apr_json_string_create(p, "protected", APR_JSON_VALUE_STRING); + val = apr_json_string_create(p, buf, len); + apr_json_object_set(s, key, val, p); + + status = apr_brigade_write(bb, flush, ctx, ".", 1); + if (APR_SUCCESS != status) { + return status; + } + + status = apr_brigade_write(bb, flush, ctx, buf64, len64); + if (APR_SUCCESS != status) { + return status; + } + + if (cb && cb->sign && sig) { + status = cb->sign(bb, jose, sig, cb->ctx, p); + if (APR_SUCCESS != status) { + return status; + } + } + + apr_brigade_cleanup(bb); + + /* create header */ + + key = apr_json_string_create(p, "header", APR_JSON_VALUE_STRING); + apr_json_object_set(s, key, sig->header, p); + + apr_brigade_cleanup(bb); + + /* create signature */ + + buf64 = apr_pencode_base64_binary(p, sig->sig.data, + sig->sig.len, + APR_ENCODE_BASE64URL, &len64); + + key = apr_json_string_create(p, "signature", APR_JSON_VALUE_STRING); + val = apr_json_string_create(p, buf64, len64); + apr_json_object_set(s, key, val, p); + + } + if (APR_SUCCESS != status) { + return status; + } + + } + + /* write out our final result */ + + if (json) { + status = apr_json_encode(brigade, flush, ctx, json, + APR_JSON_FLAGS_WHITESPACE, p); + } + + return status; +} + +apr_status_t apr_jose_encode(apr_bucket_brigade *brigade, + apr_brigade_flush flush, void *ctx, apr_jose_t *jose, apr_jose_cb_t *cb, + apr_pool_t *pool) +{ + apr_pool_t *p; + apr_status_t status = APR_EINVAL; + + /* if asked to encode nothing, encode nothing */ + if (jose == NULL) { + return APR_SUCCESS; + } + + apr_pool_create(&p, pool); + if (p == NULL) { + return APR_ENOMEM; + } + + /* first, generic data types */ + switch (jose->type) { + case APR_JOSE_TYPE_JWK: { + + /* do nothing for now */ + + break; + } + + case APR_JOSE_TYPE_JWKS: { + + /* do nothing for now */ + + break; + } + + case APR_JOSE_TYPE_DATA: { + + apr_jose_data_t *data = jose->jose.data; + + if (data) { + + struct iovec vec[1]; + + vec[0].iov_base = (void *)data->data; + vec[0].iov_len = data->len; + + status = apr_brigade_writev(brigade, flush, ctx, vec, 1); + if (APR_SUCCESS != status) { + break; + } + } + + break; + } + + case APR_JOSE_TYPE_TEXT: { + + apr_jose_text_t *text = jose->jose.text; + + if (text) { + status = apr_brigade_write(brigade, flush, ctx, text->text, + text->len); + if (APR_SUCCESS != status) { + break; + } + } + + break; + } + + case APR_JOSE_TYPE_JSON: { + + apr_json_value_t *json = jose->jose.json->json; + + if (json) { + status = apr_json_encode(brigade, flush, ctx, json, + APR_JSON_FLAGS_WHITESPACE, p); + } + + break; + } + + case APR_JOSE_TYPE_JWE: { + + status = apr_jose_encode_compact_jwe(brigade, flush, ctx, jose, cb, + p); + + break; + } + + case APR_JOSE_TYPE_JWE_JSON: { + + status = apr_jose_encode_json_jwe(brigade, flush, ctx, jose, cb, p); + + break; + } + + case APR_JOSE_TYPE_JWS: { + + status = apr_jose_encode_compact_jws(brigade, flush, ctx, jose, cb, + p); + + break; + } + + case APR_JOSE_TYPE_JWS_JSON: { + + status = apr_jose_encode_json_jws(brigade, flush, ctx, jose, cb, p); + + break; + } + + case APR_JOSE_TYPE_JWT: { + + apr_json_value_t *claims = jose->jose.jwt->claims; + + if (claims) { + status = apr_json_encode(brigade, flush, ctx, claims, + APR_JSON_FLAGS_WHITESPACE, p); + } + + break; + } + + default: { + apr_errprintf(&jose->result, pool, NULL, 0, + "JOSE type '%d' not recognised", jose->type); + + status = APR_ENOTIMPL; + + break; + } + } + + apr_pool_destroy(p); + + return status; +} diff --git a/test/Makefile.in b/test/Makefile.in index 291a76e71e9..efd1492fda8 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -37,7 +37,8 @@ TESTS = testtime.lo teststr.lo testvsn.lo testipsub.lo testshm.lo \ testbuckets.lo testxml.lo testdbm.lo testuuid.lo testmd5.lo \ testreslist.lo testbase64.lo testhooks.lo testlfsabi.lo \ testlfsabi32.lo testlfsabi64.lo testescape.lo testskiplist.lo \ - testsiphash.lo testredis.lo testencode.lo testjson.lo + testsiphash.lo testredis.lo testencode.lo testjson.lo \ + testjose.lo OTHER_PROGRAMS = \ echod@EXEEXT@ \ diff --git a/test/abts_tests.h b/test/abts_tests.h index 82cce0ce2ab..b0302067cd8 100644 --- a/test/abts_tests.h +++ b/test/abts_tests.h @@ -92,7 +92,8 @@ const struct testlist { {testlfsabi}, {testskiplist}, {testsiphash}, - {testjson} + {testjson}, + {testjose} }; #endif /* APR_TEST_INCLUDES */ diff --git a/test/testutil.h b/test/testutil.h index 261dfd2506b..fb9ccd02615 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -135,5 +135,6 @@ abts_suite *testlfsabi(abts_suite *suite); abts_suite *testskiplist(abts_suite *suite); abts_suite *testsiphash(abts_suite *suite); abts_suite *testjson(abts_suite *suite); +abts_suite *testjose(abts_suite *suite); #endif /* APR_TEST_INCLUDES */ From ea89fe02196176b31514c508453131a3aa5fbbb8 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 1 Sep 2018 19:42:30 +0000 Subject: [PATCH 7866/7878] Add header and tests for JOSE support. I need sleep. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839838 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_jose.h | 1139 +++++++++++++++++++++++++++++++++++ test/testjose.c | 1423 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2562 insertions(+) create mode 100644 include/apr_jose.h create mode 100644 test/testjose.c diff --git a/include/apr_jose.h b/include/apr_jose.h new file mode 100644 index 00000000000..7389d74ae5c --- /dev/null +++ b/include/apr_jose.h @@ -0,0 +1,1139 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file apr_jose.h + * @brief APR-UTIL JSON Object Signing and Encryption Library + */ +#ifndef APR_JOSE_H +#define APR_JOSE_H + +/** + * @defgroup APR_Util_JOSE JSON Object Signing and Encryption + * @ingroup APR_Util + * @{ + * + * The JOSE (JSON Object Signing and Encryption) library allows the encoding + * and decoding of JWS (JSON Web Signature), JWE (JSON Web Encryption), JWK + * (JSON Web Key) and JWT (JSON Web Token) objects, encoded using compact + * encoding, JSON encoding, or flattened JSON encoding. + * + * The following RFCs are supported: + * + * - https://tools.ietf.org/html/rfc7515 - JSON Web Signature (JWS) + * - https://tools.ietf.org/html/rfc7516 - JSON Web Encryption (JWE) + * - https://tools.ietf.org/html/rfc7517 - JSON Web Key (JWK) + * - https://tools.ietf.org/html/rfc7519 - JSON Web Token (JWT) + * + * Encryption, decryption, signing and verification are implemented as + * callbacks to the caller's specification, and are not included. + * + * When decrypting or verifying, the caller MUST verify that the 'alg' + * algorithm parameter in the JOSE message matches the algorithm expected + * by the implementation. + * + * It is recommended that the apr_crypto library be used to implement the + * callbacks, however an alternatively crypto library of the caller's choice + * may be used instead. + */ +#include "apr.h" +#include "apr_pools.h" +#include "apu_errno.h" +#include "apr_strings.h" +#include "apr_buckets.h" +#include "apr_json.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @package Apache JOSE library + * + */ + +/** + * HMAC using SHA-256 + * + * https://tools.ietf.org/html/rfc7518#section-3.1 + */ +#define APR_JOSE_JWA_HS256 "HS256" + +/** + * HMAC using SHA-384 + * + * https://tools.ietf.org/html/rfc7518#section-3.1 + */ +#define APR_JOSE_JWA_HS384 "HS384" + +/** + * HMAC using SHA-512 + * + * https://tools.ietf.org/html/rfc7518#section-3.1 + */ +#define APR_JOSE_JWA_HS512 "HS512" + +/** + * RSASSA-PKCS1-v1_5 using SHA-256 + * + * https://tools.ietf.org/html/rfc7518#section-3.1 + */ +#define APR_JOSE_JWA_RS256 "RS256" + +/** + * RSASSA-PKCS1-v1_5 using SHA-384 + * + * https://tools.ietf.org/html/rfc7518#section-3.1 + */ +#define APR_JOSE_JWA_RS384 "RS384" + +/** + * RSASSA-PKCS1-v1_5 using SHA-512 + * + * https://tools.ietf.org/html/rfc7518#section-3.1 + */ +#define APR_JOSE_JWA_RS512 "RS512" + +/** + * ECDSA using P-256 and SHA-256 + * + * https://tools.ietf.org/html/rfc7518#section-3.1 + */ +#define APR_JOSE_JWA_ES256 "ES256" + +/** + * ECDSA using P-384 and SHA-384 + * + * https://tools.ietf.org/html/rfc7518#section-3.1 + */ +#define APR_JOSE_JWA_ES384 "ES384" + +/** + * ECDSA using P-512 and SHA-512 + * + * https://tools.ietf.org/html/rfc7518#section-3.1 + */ +#define APR_JOSE_JWA_ES512 "ES512" + +/** + * RSASSA-PSS using SHA-256 and MGF1 with SHA-256 + * + * https://tools.ietf.org/html/rfc7518#section-3.1 + */ +#define APR_JOSE_JWA_PS256 "PS256" + +/** + * RSASSA-PSS using SHA-384 and MGF1 with SHA-384 + * + * https://tools.ietf.org/html/rfc7518#section-3.1 + */ +#define APR_JOSE_JWA_PS384 "PS384" + +/** + * RSASSA-PSS using SHA-512 and MGF1 with SHA-512 + * + * https://tools.ietf.org/html/rfc7518#section-3.1 + */ +#define APR_JOSE_JWA_PS512 "PS512" + +/** + * No digital signature or MAC performed + * + * https://tools.ietf.org/html/rfc7518#section-3.1 + */ +#define APR_JOSE_JWA_NONE "none" + +/** + * "kty" (Key Type) Parameter + * + * https://tools.ietf.org/html/rfc7517#section-4.1 + */ +#define APR_JOSE_JWK_KEY_TYPE "kty" + +/** + * "use" (Public Key Use) Parameter + * + * https://tools.ietf.org/html/rfc7517#section-4.2 + */ +#define APR_JOSE_JWK_PUBLIC_KEY_USE "use" + +/** + * "key_ops" (Key Operations) Parameter + * + * https://tools.ietf.org/html/rfc7517#section-4.3 + */ +#define APR_JOSE_JWK_KEY_OPERATIONS "key_ops" + +/** + * "keys" Parameter + * + * https://tools.ietf.org/html/rfc7517#section-5.1 + */ +#define APR_JOSE_JWK_KEYS "keys" + +/** + * "alg" (Algorithm) Parameter + * + * https://tools.ietf.org/html/rfc7515#section-4.1.1 + * https://tools.ietf.org/html/rfc7516#section-4.1.1 + * https://tools.ietf.org/html/rfc7517#section-4.4 + */ +#define APR_JOSE_JWKSE_ALGORITHM "alg" + +/** + * "enc" (Encryption Algorithm) Header Parameter + * + * https://tools.ietf.org/html/rfc7516#section-4.1.2 + */ +#define APR_JOSE_JWE_ENCRYPTION "enc" + +/** + * "zip" (Compression Algorithm) Header Parameter + * + * https://tools.ietf.org/html/rfc7516#section-4.1.3 + */ +#define APR_JOSE_JWE_COMPRESSION "zip" + +/** + * "jku" (JWK Set URL) Header Parameter + * + * https://tools.ietf.org/html/rfc7515#section-4.1.2 + * https://tools.ietf.org/html/rfc7516#section-4.1.4 + */ +#define APR_JOSE_JWSE_JWK_SET_URL "jku" + +/** + * "jwk" (JSON Web Key) Header Parameter + * + * https://tools.ietf.org/html/rfc7515#section-4.1.3 + * https://tools.ietf.org/html/rfc7516#section-4.1.5 + */ +#define APR_JOSE_JWSE_JWK "jwk" + +/** + * "kid" (Key ID) Header Parameter + * + * https://tools.ietf.org/html/rfc7515#section-4.1.4 + * https://tools.ietf.org/html/rfc7516#section-4.1.6 + */ +#define APR_JOSE_JWKSE_KEYID "kid" + +/** + * "x5u" (X.509 URL) Header Parameter + * + * https://tools.ietf.org/html/rfc7515#section-4.1.5 + * https://tools.ietf.org/html/rfc7516#section-4.1.7 + */ +#define APR_JOSE_JWKSE_X509_URL "x5u" + +/** + * "x5c" (X.509 Certificate Chain) Header Parameter + * + * https://tools.ietf.org/html/rfc7515#section-4.1.6 + * https://tools.ietf.org/html/rfc7516#section-4.1.8 + */ +#define APR_JOSE_JWKSE_X509_CHAIN "x5c" + +/** + * "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter + * + * https://tools.ietf.org/html/rfc7515#section-4.1.7 + * https://tools.ietf.org/html/rfc7516#section-4.1.9 + */ +#define APR_JOSE_JWKSE_X509_SHA1_THUMBPRINT "x5t" + +/** + *"x5t#S256" (X.509 Certificate SHA-256 Thumbprint) Header + * Parameter + * + * https://tools.ietf.org/html/rfc7515#section-4.1.8 + * https://tools.ietf.org/html/rfc7516#section-4.1.10 + */ +#define APR_JOSE_JWKSE_X509_SHA256_THUMBPRINT "x5t#S256" + +/** + * "typ" (Type) Header Parameter + * + * https://tools.ietf.org/html/rfc7515#section-4.1.9 + * https://tools.ietf.org/html/rfc7516#section-4.1.11 + */ +#define APR_JOSE_JWSE_TYPE "typ" + +/** + * "cty" (Content Type) Header Parameter + * + * https://tools.ietf.org/html/rfc7515#section-4.1.10 + * https://tools.ietf.org/html/rfc7516#section-4.1.12 + */ +#define APR_JOSE_JWSE_CONTENT_TYPE "cty" + +/** + * "crit" (Critical) Header Parameter + * + * https://tools.ietf.org/html/rfc7515#section-4.1.11 + * https://tools.ietf.org/html/rfc7516#section-4.1.13 + */ +#define APR_JOSE_JWSE_CRITICAL "crit" + +/** + * "payload" Parameter + * + * https://tools.ietf.org/html/rfc7515#section-7.2.1 + */ +#define APR_JOSE_JWS_PAYLOAD "payload" + +/** + * "signatures" Parameter + * + * https://tools.ietf.org/html/rfc7515#section-7.2.1 + */ +#define APR_JOSE_JWS_SIGNATURES "signatures" + +/** + * "protected" Parameter + * + * https://tools.ietf.org/html/rfc7515#section-7.2.1 + * https://tools.ietf.org/html/rfc7516#section-7.2.1 + */ +#define APR_JOSE_JWSE_PROTECTED "protected" + +/** + * "header" Parameter + * + * https://tools.ietf.org/html/rfc7515#section-7.2.1 + * https://tools.ietf.org/html/rfc7516#section-7.2.1 + */ +#define APR_JOSE_JWSE_HEADER "header" + +/** + * "signature" Parameter + * + * https://tools.ietf.org/html/rfc7515#section-7.2.1 + */ +#define APR_JOSE_JWS_SIGNATURE "signature" + +/** + * "unprotected" Parameter + * + * https://tools.ietf.org/html/rfc7516#section-7.2.1 + */ +#define APR_JOSE_JWE_UNPROTECTED "unprotected" + +/** + * "ciphertext" Parameter + * + * https://tools.ietf.org/html/rfc7516#section-7.2.1 + */ +#define APR_JOSE_JWE_CIPHERTEXT "ciphertext" + +/** + * "recipients" Parameter + * + * https://tools.ietf.org/html/rfc7516#section-7.2.1 + */ +#define APR_JOSE_JWE_RECIPIENTS "recipients" + +/** + * "encrypted_key" Parameter + * + * https://tools.ietf.org/html/rfc7516#section-7.2.1 + */ +#define APR_JOSE_JWE_EKEY "encrypted_key" + +/** + * "iv" Parameter + * + * https://tools.ietf.org/html/rfc7516#section-7.2.1 + */ +#define APR_JOSE_JWE_IV "iv" + +/** + * "tag" Parameter + * + * https://tools.ietf.org/html/rfc7516#section-7.2.1 + */ +#define APR_JOSE_JWE_TAG "tag" + +/** + * "aad" Parameter + * + * https://tools.ietf.org/html/rfc7516#section-7.2.1 + */ +#define APR_JOSE_JWE_AAD "aad" + +/** + * "iss" (Issuer) Claim + * + * https://tools.ietf.org/html/rfc7519#section-4.1.1 + */ +#define APR_JOSE_JWT_ISSUER "iss" + +/** + * "sub" (Subject) Claim + * + * https://tools.ietf.org/html/rfc7519#section-4.1.2 + */ +#define APR_JOSE_JWT_SUBJECT "sub" + +/** + * "aud" (Audience) Claim + * + * https://tools.ietf.org/html/rfc7519#section-4.1.3 + */ +#define APR_JOSE_JWT_AUDIENCE "aud" + +/** + * "exp" (Expiration Time) Claim + * + * https://tools.ietf.org/html/rfc7519#section-4.1.4 + */ +#define APR_JOSE_JWT_EXPIRATION_TIME "exp" + +/** + * "nbf" (Not Before) Claim + * + * https://tools.ietf.org/html/rfc7519#section-4.1.5 + */ +#define APR_JOSE_JWT_NOT_BEFORE "nbf" + +/** + * "iat" (Issued At) Claim + * + * https://tools.ietf.org/html/rfc7519#section-4.1.6 + */ +#define APR_JOSE_JWT_ISSUED_AT "iat" + +/** + * "jti" (JWT ID) Claim + * + * https://tools.ietf.org/html/rfc7519#section-4.1.7 + */ +#define APR_JOSE_JWT_ID "jti" + +/** + * "typ" (Type) Header Parameter representing a JWT + * + * https://tools.ietf.org/html/rfc7519#section-5.1 + */ +#define APR_JOSE_JWSE_TYPE_JWT "JWT" + +/** + * Default options. + */ +#define APR_JOSE_FLAG_NONE 0 + +/** + * Return the full JOSE structure, instead of innermost nested structure. + */ +#define APR_JOSE_FLAG_DECODE_ALL 1 + +/** + * When verifying or decrypting, break out of processing. + * + * If the verification or decryption failed, processing will be aborted + * with the given error. + * + * If the verification or decryption succeeded, processing will be considered + * successful and will move on to the nested structure. + */ +#define APR_JOSE_FLAG_BREAK 2 + +/** + * Forward declaration of the apr_jose_t structure. + */ +typedef struct apr_jose_t apr_jose_t; + +/** + * Enum that represents the type of JOSE object. + */ +typedef enum apr_jose_type_e { + /** No specific type. */ + APR_JOSE_TYPE_NONE = 0, + /** JSON Web Key (JWK) */ + APR_JOSE_TYPE_JWK = 1, + /** JSON Web Key Set (JWKS) */ + APR_JOSE_TYPE_JWKS, + /** JSON Web Signature (JWS) - compact encoding */ + APR_JOSE_TYPE_JWS, + /** JSON Web Signature (JWS) - JSON encoding */ + APR_JOSE_TYPE_JWS_JSON, + /** JSON Web Encryption (JWE) - compact encoding */ + APR_JOSE_TYPE_JWE, + /** JSON Web Encryption (JWE) - JSON encoding */ + APR_JOSE_TYPE_JWE_JSON, + /** JSON Web Token (JWT) */ + APR_JOSE_TYPE_JWT, + /** Generic binary data */ + APR_JOSE_TYPE_DATA, + /** Generic text data */ + APR_JOSE_TYPE_TEXT, + /** Generic JSON structure */ + APR_JOSE_TYPE_JSON +} apr_jose_type_e; + +/** + * Unsigned char data of a given length + */ +typedef struct apr_jose_data_t { + /** Pointer to the data */ + const unsigned char *data; + /** Length of the data */ + apr_size_t len; +} apr_jose_data_t; + +/** + * Signed char data of a given length + */ +typedef struct apr_jose_text_t { + /** Pointer to the text */ + const char *text; + /** Length of the text */ + apr_size_t len; +} apr_jose_text_t; + +/** + * JSON object + */ +typedef struct apr_jose_json_t { + /** Parsed JSON structure. */ + apr_json_value_t *json; +} apr_jose_json_t; + +/** + * A JSON web key + */ +typedef struct apr_jose_jwk_t { + /** Parsed JWK JSON structure */ + apr_json_value_t *key; +} apr_jose_jwk_t; + +/** + * A JSON web key set + */ +typedef struct apr_jose_jwks_t { + /** Parsed JWK set JSON structure containing a JSON array */ + apr_json_value_t *keys; +} apr_jose_jwks_t; + +/** + * A single signature within a a JSON web signature. + */ +typedef struct apr_jose_signature_t { + /** JWS Header */ + apr_json_value_t *header; + /** JWS Protected Header */ + apr_json_value_t *protected_header; + /** JWS Signature */ + apr_jose_data_t sig; + /** Result of verification for this signature */ + apr_status_t status; +} apr_jose_signature_t; + +/** + * A JSON web signature + */ +typedef struct apr_jose_jws_t { + /** JWS Compact / Flattened Signature */ + apr_jose_signature_t *signature; + /** JWS General Signatures */ + apr_array_header_t *signatures; + /** JWS Payload */ + apr_jose_t *payload; +} apr_jose_jws_t; + +/** + * An encrypted payload within a a JSON web encryption. + */ +typedef struct apr_jose_encryption_t { + /** JWE Shared Header */ + apr_json_value_t *unprotected; + /** JWE Protected Header */ + apr_json_value_t *protected; + /** JWE Protected Header (basde64url) */ + apr_jose_text_t protected64; + /** JWE Initialization Vector */ + apr_jose_data_t iv; + /** JWE AAD */ + apr_jose_data_t aad; + /** JWE AAD (base64url)*/ + apr_jose_text_t aad64; + /** JWE Ciphertext */ + apr_jose_data_t cipher; + /** JWE Authentication Tag */ + apr_jose_data_t tag; +} apr_jose_encryption_t; + +/** + * A single recipient within a a JSON web encryption. + */ +typedef struct apr_jose_recipient_t { + /** JWE Header */ + apr_json_value_t *header; + /** JWE Encrypted Key */ + apr_jose_data_t ekey; + /** Result of decryption for this recipient */ + apr_status_t status; +} apr_jose_recipient_t; + +/** + * A JSON web encryption + */ +typedef struct apr_jose_jwe_t { + /** JWE Compact / Flattened Recipient */ + apr_jose_recipient_t *recipient; + /** JWE General Recipients */ + apr_array_header_t *recipients; + /** JWE Encryption Parameters */ + apr_jose_encryption_t *encryption; + /** JWE Payload */ + apr_jose_t *payload; +} apr_jose_jwe_t; + +/** + * A JSON web token + */ +typedef struct apr_jose_jwt_t { + /** Claims associated with the JWT. */ + apr_json_value_t *claims; +} apr_jose_jwt_t; + +/** + * One JOSE structure to rule them all. + */ +struct apr_jose_t { + /** pool used for allocation */ + apr_pool_t *pool; + /** content type of this structure */ + const char *typ; + /** content type of the payload */ + const char *cty; + /** result of the operation */ + apu_err_t result; + /** type of the value */ + apr_jose_type_e type; + /** actual value, depending on the type */ + union { + apr_jose_jwk_t *jwk; + apr_jose_jwks_t *jwks; + apr_jose_jws_t *jws; + apr_jose_jwe_t *jwe; + apr_jose_jwt_t *jwt; + apr_jose_data_t *data; + apr_jose_text_t *text; + apr_jose_json_t *json; + } jose; +}; + +/** + * Callbacks for encryption, decryption, signing and verifying. + */ +typedef struct apr_jose_cb_t { + /** + * Callback that encrypts the content of the bucket brigade bb based + * on the parameters provided by the jwe->protected_header, and writes + * the resulting encrypted key to recipient->ekey, the initialisation vector + * to encryption->iv, the additional authentication data to encryption->aad, the + * cipher text to encryption->cipher, and the tag to encryption->tag. + * + * The encrypt function is expected to perform some or all of the + * following steps: + * + * 1. Determine the Key Management Mode employed by the algorithm used + * to determine the Content Encryption Key value. (This is the + * algorithm recorded in the "alg" (algorithm) Header Parameter of + * the resulting JWE.) + * + * 2. When Key Wrapping, Key Encryption, or Key Agreement with Key + * Wrapping are employed, generate a random CEK value. See RFC + * 4086 [RFC4086] for considerations on generating random values. + * The CEK MUST have a length equal to that required for the + * content encryption algorithm. + * + * 3. When Direct Key Agreement or Key Agreement with Key Wrapping are + * employed, use the key agreement algorithm to compute the value + * of the agreed upon key. When Direct Key Agreement is employed, + * let the CEK be the agreed upon key. When Key Agreement with Key + * Wrapping is employed, the agreed upon key will be used to wrap + * the CEK. + * + * 4. When Key Wrapping, Key Encryption, or Key Agreement with Key + * Wrapping are employed, encrypt the CEK to the recipient and let + * the result be the JWE Encrypted Key. + * + * 5. When Direct Key Agreement or Direct Encryption are employed, let + * the JWE Encrypted Key be the empty octet sequence. + * + * 6. When Direct Encryption is employed, let the CEK be the shared + * symmetric key. + * + * 8. If the JWE JSON Serialization is being used, repeat this process + * (steps 1-7) for each recipient. + * + * 9. Generate a random JWE Initialization Vector of the correct size + * for the content encryption algorithm (if required for the + * algorithm); otherwise, let the JWE Initialization Vector be the + * empty octet sequence. + * + * 11. If a "zip" parameter was included, compress the plaintext using + * the specified compression algorithm and let M be the octet + * sequence representing the compressed plaintext; otherwise, let M + * be the octet sequence representing the plaintext. + * + * 12. Create the JSON object(s) containing the desired set of Header + * Parameters, which together comprise the JOSE Header: one or more + * of the JWE Protected Header, the JWE Shared Unprotected Header, + * and the JWE Per-Recipient Unprotected Header. + * + * 13. Compute the Encoded Protected Header value BASE64URL(UTF8(JWE + * Protected Header)). If the JWE Protected Header is not present + * (which can only happen when using the JWE JSON Serialization and + * no "protected" member is present), let this value be the empty + * string. + * + * 14. Let the Additional Authenticated Data encryption parameter be + * ASCII(Encoded Protected Header). However, if a JWE AAD value is + * present (which can only be the case when using the JWE JSON + * Serialization), instead let the Additional Authenticated Data + * encryption parameter be ASCII(Encoded Protected Header || '.' || + * BASE64URL(JWE AAD)). + * + * 15. Encrypt M using the CEK, the JWE Initialization Vector, and the + * Additional Authenticated Data value using the specified content + * encryption algorithm to create the JWE Ciphertext value and the + * JWE Authentication Tag (which is the Authentication Tag output + * from the encryption operation). + * + * @param bb Brigade containing data to be encrypted. + * @param jose The JOSE structure. + * @param recipient Structure containing details of the recipient of + * this message. + * @param encryption Structure to be filled out by the callback + * containing the encrypted message. + * @param ctx A context. + * @param pool The pool to use. + * @return APR_SUCCESS if encrypted successfully, APR_ENOTIMPL if + * encryption is not supported, or any other suitable error. The + * jose->result structure may be filled out with further details of + * any error. + */ + apr_status_t (*encrypt)(apr_bucket_brigade *bb, apr_jose_t *jose, + apr_jose_recipient_t *recipient, apr_jose_encryption_t *encryption, + void *ctx, apr_pool_t *pool); + /** + * Callback that decrypts the ciphertext based + * on the parameters provided by the recipient and encryption parameters, and writes + * the resulting decrypted value to the bucket brigade. Base64url versions of the + * protected header and the aad are provided as part of the JWE decryption + * mechanism. + * + * For security reasons, this callback MUST verify that the algorithm + * present in the JWE matches the algorithm expected by the decoder. + * + * The decrypt function is expected to perform some or all of the + * following steps: + * + * 6. Determine the Key Management Mode employed by the algorithm + * specified by the "alg" (algorithm) Header Parameter. + * + * 7. Verify that the JWE uses a key known to the recipient. + * + * 8. When Direct Key Agreement or Key Agreement with Key Wrapping are + * employed, use the key agreement algorithm to compute the value + * of the agreed upon key. When Direct Key Agreement is employed, + * let the CEK be the agreed upon key. When Key Agreement with Key + * Wrapping is employed, the agreed upon key will be used to + * decrypt the JWE Encrypted Key. + * + * 9. When Key Wrapping, Key Encryption, or Key Agreement with Key + * Wrapping are employed, decrypt the JWE Encrypted Key to produce + * the CEK. The CEK MUST have a length equal to that required for + * the content encryption algorithm. Note that when there are + * multiple recipients, each recipient will only be able to decrypt + * JWE Encrypted Key values that were encrypted to a key in that + * recipient's possession. It is therefore normal to only be able + * to decrypt one of the per-recipient JWE Encrypted Key values to + * obtain the CEK value. Also, see Section 11.5 for security + * considerations on mitigating timing attacks. + * + * 10. When Direct Key Agreement or Direct Encryption are employed, + * verify that the JWE Encrypted Key value is an empty octet + * sequence. + * + * 11. When Direct Encryption is employed, let the CEK be the shared + * symmetric key. + * + * 12. Record whether the CEK could be successfully determined for this + * recipient or not. + * + * 13. If the JWE JSON Serialization is being used, repeat this process + * (steps 4-12) for each recipient contained in the representation. + * + * 14. Compute the Encoded Protected Header value BASE64URL(UTF8(JWE + * Protected Header)). If the JWE Protected Header is not present + * (which can only happen when using the JWE JSON Serialization and + * no "protected" member is present), let this value be the empty + * string. + * + * 15. Let the Additional Authenticated Data encryption parameter be + * ASCII(Encoded Protected Header). However, if a JWE AAD value is + * present (which can only be the case when using the JWE JSON + * Serialization), instead let the Additional Authenticated Data + * encryption parameter be ASCII(Encoded Protected Header || '.' || + * BASE64URL(JWE AAD)). + * + * 16. Decrypt the JWE Ciphertext using the CEK, the JWE Initialization + * Vector, the Additional Authenticated Data value, and the JWE + * Authentication Tag (which is the Authentication Tag input to the + * calculation) using the specified content encryption algorithm, + * returning the decrypted plaintext and validating the JWE + * Authentication Tag in the manner specified for the algorithm, + * rejecting the input without emitting any decrypted output if the + * JWE Authentication Tag is incorrect. + * + * 17. If a "zip" parameter was included, uncompress the decrypted + * plaintext using the specified compression algorithm. + * + * @param bb Brigade where decrypted data is to be written. + * @param jose The JOSE structure. + * @param recipient Structure containing details of the recipient of + * this message, to be used to decrypt the message. + * @param encryption Structure containing the encrypted message. + * @param header The JOSE protected header. + * @param p64 The JOSE protected header in original BASE64URL format, + * for use during decryption. + * @param aad64 The JOSE additional authenticated data in original + * BASE64URL format, for use during decryption. + * @param ctx A context. + * @param dflags A pointer to a flag. Set to APR_JOSE_FLAG_NONE for + * decryption to continue to the next recipient in the JWE, or + * APR_JOSE_FLAG_BREAK to stop decrypting further recipients. + * @param pool The pool to use. + * @return APR_SUCCESS if decrypted successfully, APR_ENOTIMPL if + * decryption is not supported, or any other suitable error. The + * jose->result structure may be filled out with further details of + * any error. + */ + apr_status_t (*decrypt)(apr_bucket_brigade *bb, apr_jose_t *jose, + apr_jose_recipient_t *recipient, apr_jose_encryption_t *encryption, + apr_json_value_t *header, apr_jose_text_t *ph64, + apr_jose_text_t *aad64, void *ctx, int *dflags, apr_pool_t *pool); + /** + * Callback that signs the content of the bucket brigade bb based + * on the parameters provided by the signature protected header, and writes + * the resulting binary signature to signature->sig. + * + * The sign function is expected to perform some or all of the + * following steps: + * + * 5. Compute the JWS Signature in the manner defined for the + * particular algorithm being used over the JWS Signing Input + * ASCII(BASE64URL(UTF8(JWS Protected Header)) || '.' || + * BASE64URL(JWS Payload)). The "alg" (algorithm) Header Parameter + * MUST be present in the JOSE Header, with the algorithm value + * accurately representing the algorithm used to construct the JWS + * Signature. + * + * @param bb Brigade containing data to be signed. + * @param jose The JOSE structure. + * @param signature Structure to be filled out by the callback + * containing the signature of the message. + * @param ctx A context. + * @param pool The pool to use. + * @return APR_SUCCESS if signed successfully, APR_ENOTIMPL if + * signing is not supported, or any other suitable error. The + * jose->result structure may be filled out with further details of + * any error. + */ + apr_status_t (*sign)(apr_bucket_brigade *bb, apr_jose_t *jose, + apr_jose_signature_t *signature, void *ctx, apr_pool_t *pool); + /** + * Callback that verifies the content of the bucket brigade bb based + * on the parameters provided by the signature protected header and + * signature->sig. + * + * For security reasons, this callback MUST verify that the algorithm + * present in the JWS matches the algorithm expected by the decoder. + * + * The verify function is expected to perform some or all of the + * following steps: + * + * 8. Validate the JWS Signature against the JWS Signing Input + * ASCII(BASE64URL(UTF8(JWS Protected Header)) || '.' || + * BASE64URL(JWS Payload)) in the manner defined for the algorithm + * being used, which MUST be accurately represented by the value of + * the "alg" (algorithm) Header Parameter, which MUST be present. + * See Section 10.6 for security considerations on algorithm + * validation. Record whether the validation succeeded or not. + * + * 9. If the JWS JSON Serialization is being used, repeat this process + * (steps 4-8) for each digital signature or MAC value contained in + * the representation. + * + * 10. If none of the validations in step 9 succeeded, then the JWS MUST + * be considered invalid. Otherwise, in the JWS JSON Serialization + * case, return a result to the application indicating which of the + * validations succeeded and failed. In the JWS Compact + * Serialization case, the result can simply indicate whether or not + * the JWS was successfully validated. + * + * @param bb Brigade containing data to be verified. + * @param jose The JOSE structure. + * @param signature Structure containing the signature to be verified. + * @param ctx A context. + * @param dflags A pointer to a flag. Set to APR_JOSE_FLAG_NONE for + * verification to continue to the next recipient in the JWE, or + * APR_JOSE_FLAG_BREAK to stop verifying further recipients. + * @param pool The pool to use. + * @return APR_SUCCESS if verified successfully, APR_ENOTIMPL if + * verification is not supported, or any other suitable error. The + * jose->result structure may be filled out with further details of + * any error. + */ + apr_status_t (*verify)(apr_bucket_brigade *bb, apr_jose_t *jose, + apr_jose_signature_t *signature, void *ctx, int *vflags, + apr_pool_t *pool); + /** Context to be passed to the callback. */ + void *ctx; +} apr_jose_cb_t; + +/** + * @brief Get the result of the last operation on the jose. If the result + * is NULL, the operation was successful. + * @param jose - context pointer + * @return The apu_err_t is returned. + */ +APR_DECLARE(apu_err_t *) apr_jose_error(apr_jose_t *jose); + +/** + * Make a generic JOSE structure. + * @param jose If jose points at NULL, a JOSE structure will be + * created. If the jose pointer is not NULL, the structure will + * be reused. + * @param type the type of structure to create. + * @param pool pool used to allocate the result from. + */ +APR_DECLARE(apr_status_t) apr_jose_make(apr_jose_t **jose, apr_jose_type_e type, + apr_pool_t *pool); + +/** + * Make a JSON Web Key for encoding or decoding. + * @param jose If jose points at NULL, a JOSE structure will be + * created. If the jose pointer is not NULL, the structure will + * be reused. + * @param key the json representing the key. May be NULL. + * @param pool pool used to allocate the result from. + */ +APR_DECLARE(apr_status_t) apr_jose_jwk_make(apr_jose_t **jose, + apr_json_value_t *key, apr_pool_t *pool); + +/** + * Make a JSON Web Key Set. + * @param jose If jose points at NULL, a JOSE structure will be + * created. If the jose pointer is not NULL, the structure will + * be reused. + * @param keys the array of keys in JSON format. May be NULL. + * @param pool pool used to allocate the result from. + */ +APR_DECLARE(apr_status_t) apr_jose_jwks_make(apr_jose_t **jose, + apr_json_value_t *keys, apr_pool_t *pool); + +/** + * Make a signature structure for JWS. + * + * @param signature the result. + * @param header the unprotected header. + * @param protected the protected header. + * @param pool the pool to use. + */ +APR_DECLARE(apr_status_t) apr_jose_signature_make( + apr_jose_signature_t **signature, apr_json_value_t *header, + apr_json_value_t *protected, apr_pool_t *pool); + +/** + * Make a recipient structure for JWE. + * + * @param recipient the result. + * @param unprotected the unprotected header. + * @param pool the pool to use. + */ +APR_DECLARE(apr_status_t) apr_jose_recipient_make(apr_jose_recipient_t **recipient, + apr_json_value_t *unprotected, apr_pool_t *pool); + +/** + * Make an encryption structure for JWE. + * + * @param encryption the result. + * @param unprotected the unprotected shared header. + * @param protected the protected header. + * @param pool the pool to use. + */ +APR_DECLARE(apr_status_t) apr_jose_encryption_make(apr_jose_encryption_t **encryption, + apr_json_value_t *unprotected, apr_json_value_t *protected, + apr_pool_t *pool); + +/** + * Make a compact encoded JWE. + * @param jose If jose points at NULL, a JOSE structure will be + * created. If the jose pointer is not NULL, the structure will + * be reused. + * @param recipient the recipient for compact / flattened JWE. + * @param recipients the recipients array for general JWE. + * @param encryption the encryption structure. + * @param payload the JOSE payload to encrypt. + * @param pool pool used to allocate the result from. + */ +APR_DECLARE(apr_status_t) apr_jose_jwe_make(apr_jose_t **jose, + apr_jose_recipient_t *recipient, apr_array_header_t *recipients, + apr_jose_encryption_t *encryption, apr_jose_t *payload, + apr_pool_t *pool); + +/** + * Make a JSON encoded JWE. + * @param jose If jose points at NULL, a JOSE structure will be + * created. If the jose pointer is not NULL, the structure will + * be reused. + * @param recipient the recipient for compact / flattened JWE. + * @param recipients the recipients array for general JWE. + * @param encryption the encryption structure. + * @param payload the JOSE payload to encrypt. + * @param pool pool used to allocate the result from. + */ +APR_DECLARE(apr_status_t) apr_jose_jwe_json_make(apr_jose_t **jose, + apr_jose_recipient_t *recipient, + apr_array_header_t *recipients, apr_jose_encryption_t *encryption, + apr_jose_t *payload, apr_pool_t *pool); + +/** + * Make a compact encoded JWS. + * @param jose If jose points at NULL, a JOSE structure will be + * created. If the jose pointer is not NULL, the structure will + * be reused. + * @param signature the header / protected header / signature used with compact or flattened syntax. May be NULL. + * @param signatures array of header / protected header / signature used with general JSON syntax. + * @param payload the payload to be wrapped by this JWS. + * @param pool pool used to allocate the result from. + */ +APR_DECLARE(apr_status_t) apr_jose_jws_make(apr_jose_t **jose, + apr_jose_signature_t *signature, apr_array_header_t *signatures, + apr_jose_t *payload, apr_pool_t *pool); + +/** + * Make a JSON encoded JWS. + * @param jose If jose points at NULL, a JOSE structure will be + * created. If the jose pointer is not NULL, the structure will + * be reused. + * @param signature the header / protected header / signature used with compact or flattened syntax. May be NULL. + * @param signatures array of header / protected header / signature used with general JSON syntax. + * @param payload the payload to be wrapped by this JWS. + * @param pool pool used to allocate the result from. + */ +APR_DECLARE(apr_status_t) apr_jose_jws_json_make(apr_jose_t **jose, + apr_jose_signature_t *signature, apr_array_header_t *signatures, + apr_jose_t *payload, apr_pool_t *pool); + +/** + * Make a JWT claims payload. + * + * To create a useful JWT, this payload needs to be wrapped in a JWS + * or JWE (or both), as required by the caller. + * @param jose If jose points at NULL, a JOSE structure will be + * created. If the jose pointer is not NULL, the structure will + * be reused. + * @param claims the claims to sign. + * @param pool pool used to allocate the result from. + */ +APR_DECLARE(apr_status_t) apr_jose_jwt_make(apr_jose_t **jose, + apr_json_value_t *claims, apr_pool_t *pool); + +/** + * Make a data buffer for encoding from the given data and length. + * @param jose If jose points at NULL, a JOSE structure will be + * created. If the jose pointer is not NULL, the structure will + * be reused. + * @param typ the content type of this data. + * @param in the plaintext to sign. + * @param inlen length of the plaintext. + * @param pool pool used to allocate the result from. + */ +APR_DECLARE(apr_status_t) apr_jose_data_make(apr_jose_t **jose, const char *typ, + const unsigned char *in, apr_size_t inlen, apr_pool_t *pool); + +/** + * Make a UTF-8 text buffer for encoding from the given string + * and length. + * @param jose If jose points at NULL, a JOSE structure will be + * created. If the jose pointer is not NULL, the structure will + * be reused. + * @param cty the content type. + * @param in the UTF-8 encoded text string. + * @param inlen length of the UTF-8 encoded text string. + * @param pool pool used to allocate the result from. + */ +APR_DECLARE(apr_status_t) apr_jose_text_make(apr_jose_t **jose, const char *cty, + const char *in, apr_size_t inlen, apr_pool_t *pool); + +/** + * Make a json structure for encoding. + * @param jose If jose points at NULL, a JOSE structure will be + * created. If the jose pointer is not NULL, the structure will + * be reused. + * @param cty the content type. + * @param json the json object to add. + * @param pool pool used to allocate the result from. + */ +APR_DECLARE(apr_status_t) apr_jose_json_make(apr_jose_t **jose, const char *cty, + apr_json_value_t *json, apr_pool_t *pool); + +/** + * Sign or encrypt the apr_jose_t, and write it to the brigade. + * @param brigade brigade the result will be appended to. + * @param flush The flush function to use if the brigade is full + * @param ctx The structure to pass to the flush function + * @param jose the JOSE to encode. + * @param cb callbacks for sign and encrypt. + * @param pool pool to be used. + * @return APR_SUCCESS is returned if encoding was successful, otherwise + * an APR status code, along with an apu_err_t with an explanation + * allocated from jose->pool. + */ +APR_DECLARE(apr_status_t) apr_jose_encode(apr_bucket_brigade *brigade, + apr_brigade_flush flush, void *ctx, apr_jose_t *jose, + apr_jose_cb_t *cb, apr_pool_t *pool); + +/** + * Decode, decrypt and verify the utf8-encoded JOSE string into apr_jose_t. + * + * The JOSE structure may be nested to the given limit. + * @param jose If jose points at NULL, a JOSE structure will be + * created. If the jose pointer is not NULL, the structure will + * be reused. + * @param typ content type of this object. + * @param brigade the JOSE structure to decode. + * @param cb callbacks for verify and decrypt. + * @param level depth limit of JOSE and JSON nesting. + * @param flags APR_JOSE_FLAG_NONE to return payload only. APR_JOSE_FLAG_DECODE_ALL + * to return the full JWS/JWE structure. + * @param pool pool used to allocate the result from. + */ +APR_DECLARE(apr_status_t) apr_jose_decode(apr_jose_t **jose, const char *typ, + apr_bucket_brigade *brigade, apr_jose_cb_t *cb, int level, int flags, + apr_pool_t *pool); + + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif /* APR_JOSE_H */ diff --git a/test/testjose.c b/test/testjose.c new file mode 100644 index 00000000000..411b7c5d010 --- /dev/null +++ b/test/testjose.c @@ -0,0 +1,1423 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "apr_jose.h" + +#include "abts.h" +#include "testutil.h" + + +static apr_status_t sign_cb(apr_bucket_brigade *bb, apr_jose_t *jose, + apr_jose_signature_t *signature, void *ctx, apr_pool_t *pool) +{ + abts_case *tc = ctx; + apr_json_kv_t *alg = NULL; + + if (signature) { + apr_json_value_t *ph = signature->protected_header; + + ABTS_INT_EQUAL(tc, APR_JSON_OBJECT, ph->type); + + if (ph->type == APR_JSON_OBJECT) { + alg = apr_json_object_get(ph, APR_JOSE_JWKSE_ALGORITHM, + APR_JSON_VALUE_STRING); + } + } + + if (alg) { + + ABTS_INT_EQUAL(tc, APR_JSON_STRING, alg->v->type); + + /* unsecured jws/jwt */ + if (alg->v->type == APR_JSON_STRING + && !strncmp(alg->v->value.string.p, "none", + alg->v->value.string.len)) { + + signature->sig.data = (unsigned const char *) ""; + signature->sig.len = 0; + + return APR_SUCCESS; + } + + /* hs256 jws - https://tools.ietf.org/html/rfc7515#appendix-A.1 */ + else if (alg->v->type == APR_JSON_STRING + && !strncmp(alg->v->value.string.p, "HS256", + alg->v->value.string.len)) { + + const unsigned char hs256[] = { 116, 24, 223, 180, 151, 153, 224, + 37, 79, 250, 96, 125, 216, 173, 187, 186, 22, 212, 37, 77, + 105, 214, 191, 240, 91, 88, 5, 88, 83, 132, 141, 121 }; + signature->sig.data = apr_pmemdup(p, hs256, sizeof(hs256)); + signature->sig.len = sizeof(hs256); + + return APR_SUCCESS; + } + + /* rs256 jws - https://tools.ietf.org/html/rfc7515#appendix-A.2 */ + else if (alg->v->type == APR_JSON_STRING + && !strncmp(alg->v->value.string.p, "RS256", + alg->v->value.string.len)) { + + const unsigned char rs256[] = { 112, 46, 33, 137, 67, 232, 143, 209, + 30, 181, 216, 45, 191, 120, 69, 243, 65, 6, 174, 27, 129, + 255, 247, 115, 17, 22, 173, 209, 113, 125, 131, 101, 109, + 66, 10, 253, 60, 150, 238, 221, 115, 162, 102, 62, 81, 102, + 104, 123, 0, 11, 135, 34, 110, 1, 135, 237, 16, 115, 249, + 69, 229, 130, 173, 252, 239, 22, 216, 90, 121, 142, 232, + 198, 109, 219, 61, 184, 151, 91, 23, 208, 148, 2, 190, 237, + 213, 217, 217, 112, 7, 16, 141, 178, 129, 96, 213, 248, 4, + 12, 167, 68, 87, 98, 184, 31, 190, 127, 249, 217, 46, 10, + 231, 111, 36, 242, 91, 51, 187, 230, 244, 74, 230, 30, 177, + 4, 10, 203, 32, 4, 77, 62, 249, 18, 142, 212, 1, 48, 121, + 91, 212, 189, 59, 65, 238, 202, 208, 102, 171, 101, 25, 129, + 253, 228, 141, 247, 127, 55, 45, 195, 139, 159, 175, 221, + 59, 239, 177, 139, 93, 163, 204, 60, 46, 176, 47, 158, 58, + 65, 214, 18, 202, 173, 21, 145, 18, 115, 160, 95, 35, 185, + 232, 56, 250, 175, 132, 157, 105, 132, 41, 239, 90, 30, 136, + 121, 130, 54, 195, 212, 14, 96, 69, 34, 165, 68, 200, 242, + 122, 122, 45, 184, 6, 99, 209, 108, 247, 202, 234, 86, 222, + 64, 92, 178, 33, 90, 69, 178, 194, 85, 102, 181, 90, 193, + 167, 72, 160, 112, 223, 200, 163, 42, 70, 149, 67, 208, 25, + 238, 251, 71 }; + signature->sig.data = apr_pmemdup(p, rs256, sizeof(rs256)); + signature->sig.len = sizeof(rs256); + + return APR_SUCCESS; + } + + /* es256 jws - https://tools.ietf.org/html/rfc7515#appendix-A.3 */ + else if (alg->v->type == APR_JSON_STRING + && !strncmp(alg->v->value.string.p, "ES256", + alg->v->value.string.len)) { + + const unsigned char es256[] = { 14, 209, 33, 83, 121, 99, 108, 72, + 60, 47, 127, 21, 88, 7, 212, 2, 163, 178, 40, 3, 58, 249, + 124, 126, 23, 129, 154, 195, 22, 158, 166, 101, 197, 10, 7, + 211, 140, 60, 112, 229, 216, 241, 45, 175, 8, 74, 84, 128, + 166, 101, 144, 197, 242, 147, 80, 154, 143, 63, 127, 138, + 131, 163, 84, 213 }; + signature->sig.data = apr_pmemdup(p, es256, sizeof(es256)); + signature->sig.len = sizeof(es256); + + return APR_SUCCESS; + } + + else { + apr_errprintf(&jose->result, jose->pool, NULL, 0, + "Header 'alg' not recognised: %.*s", + (int) alg->v->value.string.len, alg->v->value.string.p); + return APR_ENOTIMPL; + } + + } + + else { + apr_errprintf(&jose->result, jose->pool, NULL, 0, + "Header 'alg' missing"); + return APR_ENOTIMPL; + } + + return APR_ENOTIMPL; +} + +static apr_status_t verify_cb(apr_bucket_brigade *bb, + apr_jose_t *jose, apr_jose_signature_t *signature, void *ctx, + int *vflags, apr_pool_t *pool) +{ + abts_case *tc = ctx; + apr_json_kv_t *alg = NULL; + + *vflags = APR_JOSE_FLAG_NONE; + + if (signature) { + apr_json_value_t *ph = signature->protected_header; + + ABTS_INT_EQUAL(tc, APR_JSON_OBJECT, ph->type); + + alg = apr_json_object_get(ph, APR_JOSE_JWKSE_ALGORITHM, + APR_JSON_VALUE_STRING); + } + + if (alg) { + + ABTS_INT_EQUAL(tc, APR_JSON_STRING, alg->v->type); + + /* unsecured jws/jwt */ + if (alg->v->type == APR_JSON_STRING + && !strncmp(alg->v->value.string.p, "none", + alg->v->value.string.len)) { + + if (!memcmp(signature->sig.data, (unsigned const char *) "", + signature->sig.len)) { + return APR_SUCCESS; + } + } + + /* hs256 jws - https://tools.ietf.org/html/rfc7515#appendix-A.1 */ + else if (alg->v->type == APR_JSON_STRING + && !strncmp(alg->v->value.string.p, "HS256", + alg->v->value.string.len)) { + + const unsigned char hs256[] = { 116, 24, 223, 180, 151, 153, 224, + 37, 79, 250, 96, 125, 216, 173, 187, 186, 22, 212, 37, 77, + 105, 214, 191, 240, 91, 88, 5, 88, 83, 132, 141, 121 }; + + if (!memcmp(signature->sig.data, hs256, sizeof(hs256))) { + return APR_SUCCESS; + } + + } + + /* rs256 jws - https://tools.ietf.org/html/rfc7515#appendix-A.2 */ + else if (alg->v->type == APR_JSON_STRING + && !strncmp(alg->v->value.string.p, "RS256", + alg->v->value.string.len)) { + + const unsigned char rs256[] = { 112, 46, 33, 137, 67, 232, 143, 209, + 30, 181, 216, 45, 191, 120, 69, 243, 65, 6, 174, 27, 129, + 255, 247, 115, 17, 22, 173, 209, 113, 125, 131, 101, 109, + 66, 10, 253, 60, 150, 238, 221, 115, 162, 102, 62, 81, 102, + 104, 123, 0, 11, 135, 34, 110, 1, 135, 237, 16, 115, 249, + 69, 229, 130, 173, 252, 239, 22, 216, 90, 121, 142, 232, + 198, 109, 219, 61, 184, 151, 91, 23, 208, 148, 2, 190, 237, + 213, 217, 217, 112, 7, 16, 141, 178, 129, 96, 213, 248, 4, + 12, 167, 68, 87, 98, 184, 31, 190, 127, 249, 217, 46, 10, + 231, 111, 36, 242, 91, 51, 187, 230, 244, 74, 230, 30, 177, + 4, 10, 203, 32, 4, 77, 62, 249, 18, 142, 212, 1, 48, 121, + 91, 212, 189, 59, 65, 238, 202, 208, 102, 171, 101, 25, 129, + 253, 228, 141, 247, 127, 55, 45, 195, 139, 159, 175, 221, + 59, 239, 177, 139, 93, 163, 204, 60, 46, 176, 47, 158, 58, + 65, 214, 18, 202, 173, 21, 145, 18, 115, 160, 95, 35, 185, + 232, 56, 250, 175, 132, 157, 105, 132, 41, 239, 90, 30, 136, + 121, 130, 54, 195, 212, 14, 96, 69, 34, 165, 68, 200, 242, + 122, 122, 45, 184, 6, 99, 209, 108, 247, 202, 234, 86, 222, + 64, 92, 178, 33, 90, 69, 178, 194, 85, 102, 181, 90, 193, + 167, 72, 160, 112, 223, 200, 163, 42, 70, 149, 67, 208, 25, + 238, 251, 71 }; + + if (!memcmp(signature->sig.data, rs256, sizeof(rs256))) { + return APR_SUCCESS; + } + + } + + /* es256 jws - https://tools.ietf.org/html/rfc7515#appendix-A.3 */ + else if (alg->v->type == APR_JSON_STRING + && !strncmp(alg->v->value.string.p, "ES256", + alg->v->value.string.len)) { + + const unsigned char es256[] = { 14, 209, 33, 83, 121, 99, 108, 72, + 60, 47, 127, 21, 88, 7, 212, 2, 163, 178, 40, 3, 58, 249, + 124, 126, 23, 129, 154, 195, 22, 158, 166, 101, 197, 10, 7, + 211, 140, 60, 112, 229, 216, 241, 45, 175, 8, 74, 84, 128, + 166, 101, 144, 197, 242, 147, 80, 154, 143, 63, 127, 138, + 131, 163, 84, 213 }; + + if (!memcmp(signature->sig.data, es256, sizeof(es256))) { + return APR_SUCCESS; + } + + return APR_SUCCESS; + } + + else { + apr_errprintf(&jose->result, jose->pool, NULL, 0, + "Header 'alg' not recognised: %.*s", + (int) alg->v->value.string.len, alg->v->value.string.p); + return APR_ENOTIMPL; + } + + } + + else { + apr_errprintf(&jose->result, jose->pool, NULL, 0, + "Header 'alg' missing"); + return APR_ENOTIMPL; + } + + return APR_ENOTIMPL; +} + +static apr_status_t encrypt_cb(apr_bucket_brigade *brigade, apr_jose_t *jose, + apr_jose_recipient_t *recipient, apr_jose_encryption_t *encryption, + void *ctx, apr_pool_t *p) +{ + abts_case *tc = ctx; + apr_json_value_t *protected_header; + apr_json_value_t *header; + apr_json_kv_t *alg = NULL; + + if (encryption) { + + if (encryption->protected) { + + protected_header = encryption->protected; + if (protected_header) { + + char buf[1024]; + apr_size_t len = sizeof(buf); + + apr_bucket_brigade *bb = apr_brigade_create(p, + brigade->bucket_alloc); + + apr_json_encode(bb, NULL, NULL, protected_header, + APR_JSON_FLAGS_WHITESPACE, p); + + apr_brigade_flatten(bb, buf, &len); + + /* RSAES-OAEP and AES GCM jwe - https://tools.ietf.org/html/rfc7516#appendix-A.1 */ + if (!strncmp("{\"alg\":\"RSA-OAEP\",\"enc\":\"A256GCM\"}", buf, len)) { + + const unsigned char iv[] = { 227, 197, 117, 252, 2, 219, 233, + 68, 180, 225, 77, 219 }; + + const unsigned char aad[] = { 101, 121, 74, 104, 98, 71, 99, + 105, 79, 105, 74, 83, 85, 48, 69, 116, 84, 48, 70, 70, + 85, 67, 73, 115, 73, 109, 86, 117, 89, 121, 73, 54, 73, + 107, 69, 121, 78, 84, 90, 72, 81, 48, 48, 105, 102, 81 }; + + const unsigned char cipher[] = { 229, 236, 166, 241, 53, 191, + 115, 196, 174, 43, 73, 109, 39, 122, 233, 96, 140, 206, + 120, 52, 51, 237, 48, 11, 190, 219, 186, 80, 111, 104, + 50, 142, 47, 167, 59, 61, 181, 127, 196, 21, 40, 82, + 242, 32, 123, 143, 168, 226, 73, 216, 176, 144, 138, + 247, 106, 60, 16, 205, 160, 109, 64, 63, 192 }; + + const unsigned char tag[] = { 92, 80, 104, 49, 133, 25, 161, + 215, 173, 101, 219, 211, 136, 91, 210, 145 }; + + encryption->iv.data = apr_pmemdup(p, iv, sizeof(iv)); + encryption->iv.len = sizeof(iv); + + encryption->aad.data = apr_pmemdup(p, aad, sizeof(aad)); + encryption->aad.len = sizeof(aad); + + encryption->cipher.data = apr_pmemdup(p, cipher, sizeof(cipher)); + encryption->cipher.len = sizeof(cipher); + + encryption->tag.data = apr_pmemdup(p, tag, sizeof(tag)); + encryption->tag.len = sizeof(tag); + + } + + /* RSAES-PKCS1-v1_5 - https://tools.ietf.org/html/rfc7516#appendix-A.2 */ + else if (!strncmp("{\"alg\":\"RSA1_5\",\"enc\":\"A128CBC-HS256\"}", buf, len)) { + + const unsigned char iv[] = { 3, 22, 60, 12, 43, 67, 104, 105, + 108, 108, 105, 99, 111, 116, 104, 101 }; + + const unsigned char cipher[] = { 40, 57, 83, 181, 119, 33, 133, + 148, 198, 185, 243, 24, 152, 230, 6, 75, 129, 223, 127, + 19, 210, 82, 183, 230, 168, 33, 215, 104, 143, 112, 56, + 102 }; + + const unsigned char tag[] = { 246, 17, 244, 190, 4, 95, 98, 3, + 231, 0, 115, 157, 242, 203, 100, 191 }; + + encryption->iv.data = apr_pmemdup(p, iv, sizeof(iv)); + encryption->iv.len = sizeof(iv); + + encryption->cipher.data = apr_pmemdup(p, cipher, sizeof(cipher)); + encryption->cipher.len = sizeof(cipher); + + encryption->tag.data = apr_pmemdup(p, tag, sizeof(tag)); + encryption->tag.len = sizeof(tag); + + } + + /* A128KW A128CBC-HS256 - https://tools.ietf.org/html/rfc7516#appendix-A.3 */ + else if (!strncmp("{\"alg\":\"A128KW\",\"enc\":\"A128CBC-HS256\"}", buf, len)) { + + const unsigned char iv[] = { 3, 22, 60, 12, 43, 67, 104, 105, + 108, 108, 105, 99, 111, 116, 104, 101 }; + + const unsigned char cipher[] = { 40, 57, 83, 181, 119, 33, 133, + 148, 198, 185, 243, 24, 152, 230, 6, 75, 129, 223, 127, + 19, 210, 82, 183, 230, 168, 33, 215, 104, 143, 112, 56, + 102 }; + + const unsigned char tag[] = { 83, 73, 191, 98, 104, 205, 211, + 128, 201, 189, 199, 133, 32, 38, 194, 85 }; + + encryption->iv.data = apr_pmemdup(p, iv, sizeof(iv)); + encryption->iv.len = sizeof(iv); + + encryption->cipher.data = apr_pmemdup(p, cipher, sizeof(cipher)); + encryption->cipher.len = sizeof(cipher); + + encryption->tag.data = apr_pmemdup(p, tag, sizeof(tag)); + encryption->tag.len = sizeof(tag); + + } + + /* General JWE JSON - https://tools.ietf.org/html/rfc7516#appendix-A.4 */ + else if (!strncmp("{\"enc\":\"A128CBC-HS256\"}", buf, len)) { + + const unsigned char iv[] = { 3, 22, 60, 12, 43, 67, 104, 105, + 108, 108, 105, 99, 111, 116, 104, 101 }; + + const unsigned char cipher[] = { 40, 57, 83, 181, 119, 33, 133, + 148, 198, 185, 243, 24, 152, 230, 6, 75, 129, 223, 127, + 19, 210, 82, 183, 230, 168, 33, 215, 104, 143, 112, 56, + 102 }; + + const unsigned char tag[] = { 51, 63, 149, 60, 252, 148, + 225, 25, 92, 185, 139, 245, 35, 2, 47, 207 }; + + encryption->iv.data = apr_pmemdup(p, iv, sizeof(iv)); + encryption->iv.len = sizeof(iv); + + encryption->cipher.data = apr_pmemdup(p, cipher, sizeof(cipher)); + encryption->cipher.len = sizeof(cipher); + + encryption->tag.data = apr_pmemdup(p, tag, sizeof(tag)); + encryption->tag.len = sizeof(tag); + + } + + else { + apr_errprintf(&jose->result, jose->pool, NULL, 0, + "Protected header not recognised: %.*s", (int)len, buf); + return APR_ENOTIMPL; + } + + + } + } + + + if (recipient) { + header = recipient->header; + if (header) { + + ABTS_INT_EQUAL(tc, APR_JSON_OBJECT, header->type); + + alg = apr_json_object_get(header, APR_JOSE_JWKSE_ALGORITHM, + APR_JSON_VALUE_STRING); + } + } + + if (!alg) { + protected_header = encryption->protected; + if (protected_header) { + + ABTS_INT_EQUAL(tc, APR_JSON_OBJECT, protected_header->type); + + alg = apr_json_object_get(protected_header, + APR_JOSE_JWKSE_ALGORITHM, APR_JSON_VALUE_STRING); + } + } + + if (alg && recipient) { + + ABTS_INT_EQUAL(tc, APR_JSON_STRING, alg->v->type); + + /* RSAES-OAEP and AES GCM jwe - https://tools.ietf.org/html/rfc7516#appendix-A.1 */ + if (alg->v->type == APR_JSON_STRING + && !strncmp(alg->v->value.string.p, "RSA-OAEP", + alg->v->value.string.len)) { + + const unsigned char ekey[] = { 56, 163, 154, 192, 58, 53, 222, + 4, 105, 218, 136, 218, 29, 94, 203, 22, 150, 92, 129, + 94, 211, 232, 53, 89, 41, 60, 138, 56, 196, 216, 82, 98, + 168, 76, 37, 73, 70, 7, 36, 8, 191, 100, 136, 196, 244, + 220, 145, 158, 138, 155, 4, 117, 141, 230, 199, 247, + 173, 45, 182, 214, 74, 177, 107, 211, 153, 11, 205, 196, + 171, 226, 162, 128, 171, 182, 13, 237, 239, 99, 193, 4, + 91, 219, 121, 223, 107, 167, 61, 119, 228, 173, 156, + 137, 134, 200, 80, 219, 74, 253, 56, 185, 91, 177, 34, + 158, 89, 154, 205, 96, 55, 18, 138, 43, 96, 218, 215, + 128, 124, 75, 138, 243, 85, 25, 109, 117, 140, 26, 155, + 249, 67, 167, 149, 231, 100, 6, 41, 65, 214, 251, 232, + 87, 72, 40, 182, 149, 154, 168, 31, 193, 126, 215, 89, + 28, 111, 219, 125, 182, 139, 235, 195, 197, 23, 234, 55, + 58, 63, 180, 68, 202, 206, 149, 75, 205, 248, 176, 67, + 39, 178, 60, 98, 193, 32, 238, 122, 96, 158, 222, 57, + 183, 111, 210, 55, 188, 215, 206, 180, 166, 150, 166, + 106, 250, 55, 229, 72, 40, 69, 214, 216, 104, 23, 40, + 135, 212, 28, 127, 41, 80, 175, 174, 168, 115, 171, 197, + 89, 116, 92, 103, 246, 83, 216, 182, 176, 84, 37, 147, + 35, 45, 219, 172, 99, 226, 233, 73, 37, 124, 42, 72, 49, + 242, 35, 127, 184, 134, 117, 114, 135, 206 }; + + recipient->ekey.data = apr_pmemdup(p, ekey, sizeof(ekey)); + recipient->ekey.len = sizeof(ekey); + + return APR_SUCCESS; + } + + /* RSAES-PKCS1-v1_5 - https://tools.ietf.org/html/rfc7516#appendix-A.2 */ + if (alg->v->type == APR_JSON_STRING + && !strncmp(alg->v->value.string.p, "RSA1_5", + alg->v->value.string.len)) { + + const unsigned char ekey[] = { 80, 104, 72, 58, 11, 130, 236, + 139, 132, 189, 255, 205, 61, 86, 151, 176, 99, 40, 44, + 233, 176, 189, 205, 70, 202, 169, 72, 40, 226, 181, 156, + 223, 120, 156, 115, 232, 150, 209, 145, 133, 104, 112, + 237, 156, 116, 250, 65, 102, 212, 210, 103, 240, 177, + 61, 93, 40, 71, 231, 223, 226, 240, 157, 15, 31, 150, + 89, 200, 215, 198, 203, 108, 70, 117, 66, 212, 238, 193, + 205, 23, 161, 169, 218, 243, 203, 128, 214, 127, 253, + 215, 139, 43, 17, 135, 103, 179, 220, 28, 2, 212, 206, + 131, 158, 128, 66, 62, 240, 78, 186, 141, 125, 132, 227, + 60, 137, 43, 31, 152, 199, 54, 72, 34, 212, 115, 11, + 152, 101, 70, 42, 219, 233, 142, 66, 151, 250, 126, 146, + 141, 216, 190, 73, 50, 177, 146, 5, 52, 247, 28, 197, + 21, 59, 170, 247, 181, 89, 131, 241, 169, 182, 246, 99, + 15, 36, 102, 166, 182, 172, 197, 136, 230, 120, 60, 58, + 219, 243, 149, 94, 222, 150, 154, 194, 110, 227, 225, + 112, 39, 89, 233, 112, 207, 211, 241, 124, 174, 69, 221, + 179, 107, 196, 225, 127, 167, 112, 226, 12, 242, 16, 24, + 28, 120, 182, 244, 213, 244, 153, 194, 162, 69, 160, + 244, 248, 63, 165, 141, 4, 207, 249, 193, 79, 131, 0, + 169, 233, 127, 167, 101, 151, 125, 56, 112, 111, 248, + 29, 232, 90, 29, 147, 110, 169, 146, 114, 165, 204, 71, + 136, 41, 252 }; + + recipient->ekey.data = apr_pmemdup(p, ekey, sizeof(ekey)); + recipient->ekey.len = sizeof(ekey); + + return APR_SUCCESS; + } + + /* A128KW A128CBC-HS256 - https://tools.ietf.org/html/rfc7516#appendix-A.3 */ + if (alg->v->type == APR_JSON_STRING + && !strncmp(alg->v->value.string.p, "A128KW", + alg->v->value.string.len)) { + + const unsigned char ekey[] = { 232, 160, 123, 211, 183, 76, 245, + 132, 200, 128, 123, 75, 190, 216, 22, 67, 201, 138, 193, + 186, 9, 91, 122, 31, 246, 90, 28, 139, 57, 3, 76, 124, + 193, 11, 98, 37, 173, 61, 104, 57 }; + + recipient->ekey.data = apr_pmemdup(p, ekey, sizeof(ekey)); + recipient->ekey.len = sizeof(ekey); + + return APR_SUCCESS; + } + + } + } + + return APR_ENOTIMPL; +} + +static apr_status_t decrypt_cb(apr_bucket_brigade *brigade, apr_jose_t *jose, + apr_jose_recipient_t *recipient, apr_jose_encryption_t *encryption, + apr_json_value_t *header, apr_jose_text_t *ph64, apr_jose_text_t *aad64, + void *ctx, int *dflags, apr_pool_t *pool) +{ + + *dflags = APR_JOSE_FLAG_NONE; + + if (encryption && recipient && header) { + + char buf[1024]; + apr_size_t len = sizeof(buf); + + apr_bucket_brigade *bb = apr_brigade_create(p, + brigade->bucket_alloc); + + apr_json_encode(bb, NULL, NULL, header, + APR_JSON_FLAGS_WHITESPACE, p); + + apr_brigade_flatten(bb, buf, &len); + + /* RSAES-OAEP and AES GCM jwe - https://tools.ietf.org/html/rfc7516#appendix-A.1 */ + if (!strncmp("{\"alg\":\"RSA-OAEP\",\"enc\":\"A256GCM\"}", buf, len)) { + + const char plaintext[] = { 84, 104, 101, 32, 116, 114, 117, + 101, 32, 115, 105, 103, 110, 32, 111, 102, 32, 105, 110, + 116, 101, 108, 108, 105, 103, 101, 110, 99, 101, 32, 105, + 115, 32, 110, 111, 116, 32, 107, 110, 111, 119, 108, 101, + 100, 103, 101, 32, 98, 117, 116, 32, 105, 109, 97, 103, 105, + 110, 97, 116, 105, 111, 110, 46 }; + + apr_brigade_write(brigade, NULL, NULL, plaintext, sizeof(plaintext)); + + return APR_SUCCESS; + } + + /* RSAES-PKCS1-v1_5 - https://tools.ietf.org/html/rfc7516#appendix-A.2 */ + else if (!strncmp("{\"jku\":\"https://server.example.com/keys.jwks\",\"enc\":\"A128CBC-HS256\",\"alg\":\"RSA1_5\",\"kid\":\"2011-04-29\"}", buf, len)) { + + const char plaintext[] = { 76, 105, 118, 101, 32, 108, 111, 110, + 103, 32, 97, 110, 100, 32, 112, 114, 111, 115, 112, 101, + 114, 46 }; + + apr_brigade_write(brigade, NULL, NULL, plaintext, sizeof(plaintext)); + + return APR_SUCCESS; + } + + /* Flattened JWE JSON - https://tools.ietf.org/html/rfc7516#appendix-A.5 */ + else if (!strncmp("{\"jku\":\"https://server.example.com/keys.jwks\",\"enc\":\"A128CBC-HS256\",\"alg\":\"A128KW\",\"kid\":\"7\"}", buf, len)) { + + const char plaintext[] = { 76, 105, 118, 101, 32, 108, 111, 110, + 103, 32, 97, 110, 100, 32, 112, 114, 111, 115, 112, 101, + 114, 46 }; + + apr_brigade_write(brigade, NULL, NULL, plaintext, sizeof(plaintext)); + + return APR_SUCCESS; + } + + + else { + apr_errprintf(&jose->result, pool, NULL, 0, + "Header not recognised: %.*s", (int)len, buf); + return APR_ENOTIMPL; + } + + } + + return APR_ENOTIMPL; +} + +/** + * Test from https://tools.ietf.org/html/rfc7515#appendix-A.5 + */ +static void test_jose_encode_jws_compact_unsecured(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + apr_jose_t *jose = NULL; + apr_jose_t *jdata = NULL; + apr_jose_signature_t signature; + char buf[1024]; + apr_size_t len = sizeof(buf); + apr_off_t offset; + apr_status_t status; + + const char *ph = "{\"alg\":\"none\"}"; + const unsigned char pl[] = {123, 34, 105, 115, 115, 34, 58, 34, 106, 111, 101, 34, 44, 13, 10, + 32, 34, 101, 120, 112, 34, 58, 49, 51, 48, 48, 56, 49, 57, 51, 56, + 48, 44, 13, 10, 32, 34, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, + 109, 112, 108, 101, 46, 99, 111, 109, 47, 105, 115, 95, 114, 111, + 111, 116, 34, 58, 116, 114, 117, 101, 125}; + const char *expect = "eyJhbGciOiJub25lIn0" + "." + "eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt" + "cGxlLmNvbS9pc19yb290Ijp0cnVlfQ" + "."; + + apr_jose_cb_t cb; + + cb.sign = sign_cb; + cb.ctx = tc; + + signature.header = NULL; + apr_json_decode(&signature.protected_header, ph, APR_JSON_VALUE_STRING, &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + apr_jose_data_make(&jdata, "JWT", pl, sizeof(pl), p); + apr_jose_jws_make(&jose, &signature, NULL, jdata, p); + + status = apr_jose_encode(bb, NULL, NULL, jose, &cb, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + + apr_brigade_flatten(bb, buf, &len); + ABTS_STR_NEQUAL(tc, expect, buf, len); +} + +/** + * Test from https://tools.ietf.org/html/rfc7515#appendix-A.1 + */ +static void test_jose_encode_jws_compact_hs256(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + apr_jose_t *jose = NULL; + apr_jose_t *jdata = NULL; + apr_jose_signature_t signature; + char buf[1024]; + apr_size_t len = sizeof(buf); + apr_off_t offset; + apr_status_t status; + + const unsigned char ph[] = { 123, 34, 116, 121, 112, 34, 58, 34, 74, 87, 84, + 34, 44, 13, 10, 32, 34, 97, 108, 103, 34, 58, 34, 72, 83, 50, 53, + 54, 34, 125 }; + + const unsigned char pl[] = {123, 34, 105, 115, 115, 34, 58, 34, 106, 111, 101, 34, 44, 13, 10, + 32, 34, 101, 120, 112, 34, 58, 49, 51, 48, 48, 56, 49, 57, 51, 56, + 48, 44, 13, 10, 32, 34, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, + 109, 112, 108, 101, 46, 99, 111, 109, 47, 105, 115, 95, 114, 111, + 111, 116, 34, 58, 116, 114, 117, 101, 125}; + const char *expect = "eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9" + "." + "eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt" + "cGxlLmNvbS9pc19yb290Ijp0cnVlfQ" + "." + "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"; + + apr_jose_cb_t cb; + + cb.sign = sign_cb; + cb.ctx = tc; + + signature.header = NULL; + apr_json_decode(&signature.protected_header, (const char *) ph, sizeof(ph), &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + apr_jose_data_make(&jdata, "JWT", pl, sizeof(pl), p); + apr_jose_jws_make(&jose, &signature, NULL, jdata, p); + + status = apr_jose_encode(bb, NULL, NULL, jose, &cb, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + + apr_brigade_flatten(bb, buf, &len); + ABTS_STR_NEQUAL(tc, expect, buf, len); +} + +/** + * Test from https://tools.ietf.org/html/rfc7515#appendix-A.6 + */ +static void test_jose_encode_jws_json_general(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + apr_jose_t *jose = NULL; + apr_jose_t *jdata = NULL; + apr_jose_signature_t **signature; + apr_jose_signature_t signature1; + apr_jose_signature_t signature2; + apr_array_header_t *signatures = apr_array_make(p, 2, + sizeof(apr_jose_signature_t *)); + char buf[1024]; + apr_size_t len = sizeof(buf); + apr_off_t offset; + apr_status_t status; + + const unsigned char pl[] = { 123, 34, 105, 115, 115, 34, 58, 34, 106, 111, + 101, 34, 44, 13, 10, 32, 34, 101, 120, 112, 34, 58, 49, 51, 48, 48, + 56, 49, 57, 51, 56, 48, 44, 13, 10, 32, 34, 104, 116, 116, 112, 58, + 47, 47, 101, 120, 97, 109, 112, 108, 101, 46, 99, 111, 109, 47, 105, + 115, 95, 114, 111, 111, 116, 34, 58, 116, 114, 117, 101, 125 }; + + const char *s1h = "{\"kid\":\"2010-12-29\"}"; + const char *s1ph = "{\"alg\":\"RS256\"}"; + const char *s2h = "{\"kid\":\"e9bc097a-ce51-4036-9562-d2ade882db0d\"}"; + const char *s2ph = "{\"alg\":\"ES256\"}"; + + const char *expect = "{" + "\"payload\":" + "\"eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGF" + "tcGxlLmNvbS9pc19yb290Ijp0cnVlfQ\"," + "\"signatures\":[" + "{\"protected\":\"eyJhbGciOiJSUzI1NiJ9\"," + "\"header\":" + "{\"kid\":\"2010-12-29\"}," + "\"signature\":" + "\"cC4hiUPoj9Eetdgtv3hF80EGrhuB__dzERat0XF9g2VtQgr9PJbu3XOiZj5RZ" + "mh7AAuHIm4Bh-0Qc_lF5YKt_O8W2Fp5jujGbds9uJdbF9CUAr7t1dnZcAcQjb" + "KBYNX4BAynRFdiuB--f_nZLgrnbyTyWzO75vRK5h6xBArLIARNPvkSjtQBMHl" + "b1L07Qe7K0GarZRmB_eSN9383LcOLn6_dO--xi12jzDwusC-eOkHWEsqtFZES" + "c6BfI7noOPqvhJ1phCnvWh6IeYI2w9QOYEUipUTI8np6LbgGY9Fs98rqVt5AX" + "LIhWkWywlVmtVrBp0igcN_IoypGlUPQGe77Rw\"}," + "{\"protected\":\"eyJhbGciOiJFUzI1NiJ9\"," + "\"header\":" + "{\"kid\":\"e9bc097a-ce51-4036-9562-d2ade882db0d\"}," + "\"signature\":" + "\"DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8IS" + "lSApmWQxfKTUJqPP3-Kg6NU1Q\"}]" + "}"; + + apr_jose_cb_t cb; + + cb.sign = sign_cb; + cb.ctx = tc; + + apr_json_decode(&signature1.header, (const char *) s1h, strlen(s1h), &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + apr_json_decode(&signature1.protected_header, (const char *) s1ph, strlen(s1ph), &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + apr_json_decode(&signature2.header, (const char *) s2h, strlen(s2h), &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + apr_json_decode(&signature2.protected_header, (const char *) s2ph, strlen(s2ph), &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + + signature = apr_array_push(signatures); + *signature = &signature1; + signature = apr_array_push(signatures); + *signature = &signature2; + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + apr_jose_data_make(&jdata, "JWT", pl, sizeof(pl), p); + apr_jose_jws_json_make(&jose, NULL, signatures, jdata, p); + + status = apr_jose_encode(bb, NULL, NULL, jose, &cb, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + + apr_brigade_flatten(bb, buf, &len); + ABTS_STR_NEQUAL(tc, expect, buf, len); + +} + +/** + * Test from https://tools.ietf.org/html/rfc7515#appendix-A.7 + */ +static void test_jose_encode_jws_json_flattened(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + apr_jose_t *jose = NULL; + apr_jose_t *jdata = NULL; + apr_jose_signature_t signature2; + char buf[1024]; + apr_size_t len = sizeof(buf); + apr_off_t offset; + apr_status_t status; + + const unsigned char pl[] = { 123, 34, 105, 115, 115, 34, 58, 34, 106, 111, + 101, 34, 44, 13, 10, 32, 34, 101, 120, 112, 34, 58, 49, 51, 48, 48, + 56, 49, 57, 51, 56, 48, 44, 13, 10, 32, 34, 104, 116, 116, 112, 58, + 47, 47, 101, 120, 97, 109, 112, 108, 101, 46, 99, 111, 109, 47, 105, + 115, 95, 114, 111, 111, 116, 34, 58, 116, 114, 117, 101, 125 }; + + const char *s2h = "{\"kid\":\"e9bc097a-ce51-4036-9562-d2ade882db0d\"}"; + const char *s2ph = "{\"alg\":\"ES256\"}"; + + const char *expect = "{" + "\"payload\":" + "\"eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGF" + "tcGxlLmNvbS9pc19yb290Ijp0cnVlfQ\"," + "\"protected\":\"eyJhbGciOiJFUzI1NiJ9\"," + "\"header\":" + "{\"kid\":\"e9bc097a-ce51-4036-9562-d2ade882db0d\"}," + "\"signature\":" + "\"DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8IS" + "lSApmWQxfKTUJqPP3-Kg6NU1Q\"" + "}"; + + apr_jose_cb_t cb; + + cb.sign = sign_cb; + cb.ctx = tc; + + apr_json_decode(&signature2.header, (const char *) s2h, strlen(s2h), &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + apr_json_decode(&signature2.protected_header, (const char *) s2ph, strlen(s2ph), &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + apr_jose_data_make(&jdata, "JWT", pl, sizeof(pl), p); + apr_jose_jws_json_make(&jose, &signature2, NULL, jdata, p); + + status = apr_jose_encode(bb, NULL, NULL, jose, &cb, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + + apr_brigade_flatten(bb, buf, &len); + ABTS_STR_NEQUAL(tc, expect, buf, len); + +} + +/** + * Test from https://tools.ietf.org/html/rfc7516#appendix-A.1 + */ +static void test_jose_encode_jwe_compact_rsaes_oaep_aes_gcm(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + apr_jose_t *jose = NULL; + apr_jose_t *jdata = NULL; + apr_jose_encryption_t *encryption; + apr_jose_recipient_t *recipient; + apr_json_value_t *header = NULL; + apr_json_value_t *protected_header = NULL; + char buf[1024]; + apr_size_t len = sizeof(buf); + apr_off_t offset; + apr_status_t status; + + const char *ph = "{\"alg\":\"RSA-OAEP\",\"enc\":\"A256GCM\"}"; + + const unsigned char pl[] = { 84, 104, 101, 32, 116, 114, 117, 101, 32, 115, + 105, 103, 110, 32, 111, 102, 32, 105, 110, 116, 101, 108, 108, 105, + 103, 101, 110, 99, 101, 32, 105, 115, 32, 110, 111, 116, 32, 107, + 110, 111, 119, 108, 101, 100, 103, 101, 32, 98, 117, 116, 32, 105, + 109, 97, 103, 105, 110, 97, 116, 105, 111, 110, 46 }; + + const char *expect = "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ." + "OKOawDo13gRp2ojaHV7LFpZcgV7T6DVZKTyKOMTYUmKoTCVJRgckCL9kiMT03JGe" + "ipsEdY3mx_etLbbWSrFr05kLzcSr4qKAq7YN7e9jwQRb23nfa6c9d-StnImGyFDb" + "Sv04uVuxIp5Zms1gNxKKK2Da14B8S4rzVRltdYwam_lDp5XnZAYpQdb76FdIKLaV" + "mqgfwX7XWRxv2322i-vDxRfqNzo_tETKzpVLzfiwQyeyPGLBIO56YJ7eObdv0je8" + "1860ppamavo35UgoRdbYaBcoh9QcfylQr66oc6vFWXRcZ_ZT2LawVCWTIy3brGPi" + "6UklfCpIMfIjf7iGdXKHzg." + "48V1_ALb6US04U3b." + "5eym8TW_c8SuK0ltJ3rpYIzOeDQz7TALvtu6UG9oMo4vpzs9tX_EFShS8iB7j6ji" + "SdiwkIr3ajwQzaBtQD_A." + "XFBoMYUZodetZdvTiFvSkQ"; + + apr_jose_cb_t cb; + + cb.encrypt = encrypt_cb; + cb.ctx = tc; + + apr_json_decode(&protected_header, ph, APR_JSON_VALUE_STRING, &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + apr_jose_data_make(&jdata, "JWT", pl, sizeof(pl), p); + apr_jose_recipient_make(&recipient, header, p); + apr_jose_encryption_make(&encryption, NULL, protected_header, p); + apr_jose_jwe_make(&jose, recipient, NULL, encryption, jdata, p); + + status = apr_jose_encode(bb, NULL, NULL, jose, &cb, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + + apr_brigade_flatten(bb, buf, &len); + ABTS_STR_NEQUAL(tc, expect, buf, len); +} + +/** + * Test from https://tools.ietf.org/html/rfc7516#appendix-A.4 + */ +static void test_jose_encode_jwe_json_general(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + apr_jose_t *jose = NULL; + apr_jose_t *jdata = NULL; + apr_json_value_t *header = NULL; + apr_json_value_t *protected_header = NULL; + apr_jose_recipient_t **recipient; + apr_jose_recipient_t recipient1; + apr_jose_recipient_t recipient2; + apr_array_header_t *recipients = apr_array_make(p, 2, + sizeof(apr_jose_recipient_t *)); + apr_jose_encryption_t *encryption; + char buf[1024]; + apr_size_t len = sizeof(buf); + apr_off_t offset; + apr_status_t status; + + const char *r1h = "{\"alg\":\"RSA1_5\",\"kid\":\"2011-04-29\"}"; + const char *r2h = "{\"alg\":\"A128KW\",\"kid\":\"7\"}"; + + const char *ph = "{\"enc\":\"A128CBC-HS256\"}"; + const char *h = "{\"jku\":\"https://server.example.com/keys.jwks\"}"; + + const unsigned char pl[] = { 76, 105, 118, 101, 32, 108, 111, 110, 103, 32, + 97, 110, 100, 32, 112, 114, 111, 115, 112, 101, 114, 46 }; + + const char *expect = "{" + "\"protected\":" + "\"eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0\"," + "\"unprotected\":" + "{\"jku\":\"https://server.example.com/keys.jwks\"}," + "\"recipients\":[" + "{\"header\":" + "{\"alg\":\"RSA1_5\",\"kid\":\"2011-04-29\"}," + "\"encrypted_key\":" + "\"UGhIOguC7IuEvf_NPVaXsGMoLOmwvc1GyqlIKOK1nN94nHPoltGRhWhw7Zx0-" + "kFm1NJn8LE9XShH59_i8J0PH5ZZyNfGy2xGdULU7sHNF6Gp2vPLgNZ__deLKx" + "GHZ7PcHALUzoOegEI-8E66jX2E4zyJKx-YxzZIItRzC5hlRirb6Y5Cl_p-ko3" + "YvkkysZIFNPccxRU7qve1WYPxqbb2Yw8kZqa2rMWI5ng8OtvzlV7elprCbuPh" + "cCdZ6XDP0_F8rkXds2vE4X-ncOIM8hAYHHi29NX0mcKiRaD0-D-ljQTP-cFPg" + "wCp6X-nZZd9OHBv-B3oWh2TbqmScqXMR4gp_A\"}," + "{\"header\":" + "{\"alg\":\"A128KW\",\"kid\":\"7\"}," + "\"encrypted_key\":" + "\"6KB707dM9YTIgHtLvtgWQ8mKwboJW3of9locizkDTHzBC2IlrT1oOQ\"}]," + "\"iv\":" + "\"AxY8DCtDaGlsbGljb3RoZQ\"," + "\"ciphertext\":" + "\"KDlTtXchhZTGufMYmOYGS4HffxPSUrfmqCHXaI9wOGY\"," + "\"tag\":" + "\"Mz-VPPyU4RlcuYv1IwIvzw\"" + "}\";"; + + apr_jose_cb_t cb; + + cb.encrypt = encrypt_cb; + cb.ctx = tc; + + apr_json_decode(&recipient1.header, (const char *) r1h, strlen(r1h), &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + apr_json_decode(&recipient2.header, (const char *) r2h, strlen(r2h), &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + + recipient = apr_array_push(recipients); + *recipient = &recipient1; + recipient = apr_array_push(recipients); + *recipient = &recipient2; + + + + + apr_json_decode(&header, h, APR_JSON_VALUE_STRING, &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + apr_json_decode(&protected_header, ph, APR_JSON_VALUE_STRING, &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + apr_jose_data_make(&jdata, "plain", pl, sizeof(pl), p); + apr_jose_encryption_make(&encryption, header, protected_header, p); + apr_jose_jwe_json_make(&jose, NULL, recipients, encryption, jdata, p); + + status = apr_jose_encode(bb, NULL, NULL, jose, &cb, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + + apr_brigade_flatten(bb, buf, &len); + ABTS_STR_NEQUAL(tc, expect, buf, len); +} + +/** + * Test from https://tools.ietf.org/html/rfc7516#appendix-A.5 + */ +static void test_jose_encode_jwe_json_flattened(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + apr_jose_t *jose = NULL; + apr_jose_t *jdata = NULL; + apr_json_value_t *header = NULL; + apr_json_value_t *protected_header = NULL; + apr_jose_recipient_t recipient; + apr_jose_encryption_t *encryption; + char buf[1024]; + apr_size_t len = sizeof(buf); + apr_off_t offset; + apr_status_t status; + + const char *rh = "{\"alg\":\"A128KW\",\"kid\":\"7\"}"; + + const char *ph = "{\"enc\":\"A128CBC-HS256\"}"; + const char *h = "{\"jku\":\"https://server.example.com/keys.jwks\"}"; + + const unsigned char pl[] = { 76, 105, 118, 101, 32, 108, 111, 110, 103, 32, + 97, 110, 100, 32, 112, 114, 111, 115, 112, 101, 114, 46 }; + + const char *expect = "{" + "\"protected\":" + "\"eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0\"," + "\"unprotected\":" + "{\"jku\":\"https://server.example.com/keys.jwks\"}," + "\"header\":" + "{\"alg\":\"A128KW\",\"kid\":\"7\"}," + "\"encrypted_key\":" + "\"6KB707dM9YTIgHtLvtgWQ8mKwboJW3of9locizkDTHzBC2IlrT1oOQ\"," + "\"iv\":" + "\"AxY8DCtDaGlsbGljb3RoZQ\"," + "\"ciphertext\":" + "\"KDlTtXchhZTGufMYmOYGS4HffxPSUrfmqCHXaI9wOGY\"," + "\"tag\":" + "\"Mz-VPPyU4RlcuYv1IwIvzw\"" + "}"; + + apr_jose_cb_t cb; + + cb.encrypt = encrypt_cb; + cb.ctx = tc; + + apr_json_decode(&recipient.header, (const char *) rh, strlen(rh), &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + + apr_json_decode(&header, h, APR_JSON_VALUE_STRING, &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + apr_json_decode(&protected_header, ph, APR_JSON_VALUE_STRING, &offset, + APR_JSON_FLAGS_WHITESPACE, 10, p); + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + apr_jose_data_make(&jdata, "plain", pl, sizeof(pl), p); + apr_jose_encryption_make(&encryption, header, protected_header, p); + apr_jose_jwe_json_make(&jose, &recipient, NULL, encryption, jdata, p); + + status = apr_jose_encode(bb, NULL, NULL, jose, &cb, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + + apr_brigade_flatten(bb, buf, &len); + ABTS_STR_NEQUAL(tc, expect, buf, len); +} + +/** + * Test from https://tools.ietf.org/html/rfc7515#appendix-A.5 + */ +static void test_jose_decode_jws_compact_unsecured(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + apr_jose_t *jose = NULL; + apr_json_kv_t *kv; + apr_status_t status; + + const char *source = "eyJhbGciOiJub25lIn0" + "." + "eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt" + "cGxlLmNvbS9pc19yb290Ijp0cnVlfQ" + "."; + + apr_jose_cb_t cb; + + cb.verify = verify_cb; + cb.decrypt = decrypt_cb; + cb.ctx = tc; + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + apr_brigade_write(bb, NULL, NULL, source, strlen(source)); + + status = apr_jose_decode(&jose, "JWT", bb, &cb, 10, APR_JOSE_FLAG_NONE, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + ABTS_PTR_NOTNULL(tc, jose); + ABTS_INT_EQUAL(tc, APR_JOSE_TYPE_JWT, jose->type); + + kv = apr_json_object_get(jose->jose.jwt->claims, "iss", + APR_JSON_VALUE_STRING); + ABTS_PTR_NOTNULL(tc, kv); + ABTS_INT_EQUAL(tc, APR_JSON_STRING, kv->v->type); + +} + +/** + * Test from https://tools.ietf.org/html/rfc7515#appendix-A.1 + */ +static void test_jose_decode_jws_compact_hs256(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + apr_jose_t *jose = NULL; + apr_json_kv_t *kv; + apr_status_t status; + + const char *source = "eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9" + "." + "eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt" + "cGxlLmNvbS9pc19yb290Ijp0cnVlfQ" + "." + "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"; + + apr_jose_cb_t cb; + + cb.verify = verify_cb; + cb.decrypt = decrypt_cb; + cb.ctx = tc; + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + apr_brigade_write(bb, NULL, NULL, source, strlen(source)); + + status = apr_jose_decode(&jose, "JWT", bb, &cb, 10, APR_JOSE_FLAG_NONE, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + ABTS_PTR_NOTNULL(tc, jose); + ABTS_INT_EQUAL(tc, APR_JOSE_TYPE_JWT, jose->type); + + kv = apr_json_object_get(jose->jose.jwt->claims, "iss", + APR_JSON_VALUE_STRING); + ABTS_PTR_NOTNULL(tc, kv); + ABTS_INT_EQUAL(tc, APR_JSON_STRING, kv->v->type); + +} + +/** + * Test from https://tools.ietf.org/html/rfc7515#appendix-A.6 + */ +static void test_jose_decode_jws_json_general(abts_case *tc, void *data) +{ + const char *source = "{" + "\"payload\":" + "\"eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGF" + "tcGxlLmNvbS9pc19yb290Ijp0cnVlfQ\"," + "\"signatures\":[" + "{\"protected\":\"eyJhbGciOiJSUzI1NiJ9\"," + "\"header\":" + "{\"kid\":\"2010-12-29\"}," + "\"signature\":" + "\"cC4hiUPoj9Eetdgtv3hF80EGrhuB__dzERat0XF9g2VtQgr9PJbu3XOiZj5RZ" + "mh7AAuHIm4Bh-0Qc_lF5YKt_O8W2Fp5jujGbds9uJdbF9CUAr7t1dnZcAcQjb" + "KBYNX4BAynRFdiuB--f_nZLgrnbyTyWzO75vRK5h6xBArLIARNPvkSjtQBMHl" + "b1L07Qe7K0GarZRmB_eSN9383LcOLn6_dO--xi12jzDwusC-eOkHWEsqtFZES" + "c6BfI7noOPqvhJ1phCnvWh6IeYI2w9QOYEUipUTI8np6LbgGY9Fs98rqVt5AX" + "LIhWkWywlVmtVrBp0igcN_IoypGlUPQGe77Rw\"}," + "{\"protected\":\"eyJhbGciOiJFUzI1NiJ9\"," + "\"header\":" + "{\"kid\":\"e9bc097a-ce51-4036-9562-d2ade882db0d\"}," + "\"signature\":" + "\"DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8IS" + "lSApmWQxfKTUJqPP3-Kg6NU1Q\"}]" + "}"; + + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + apr_jose_t *jose = NULL; + apr_status_t status; + + apr_jose_cb_t cb; + + cb.verify = verify_cb; + cb.decrypt = decrypt_cb; + cb.ctx = tc; + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + apr_brigade_write(bb, NULL, NULL, source, strlen(source)); + + status = apr_jose_decode(&jose, "JOSE+JSON", bb, &cb, 10, APR_JOSE_FLAG_NONE, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + ABTS_PTR_NOTNULL(tc, jose); + + /* + * There is nothing in this structure to identify the MIME type of the payload, + * so raw data is returned. + */ + ABTS_INT_EQUAL(tc, APR_JOSE_TYPE_DATA, jose->type); + +} + +/** + * Test from https://tools.ietf.org/html/rfc7515#appendix-A.7 + */ +static void test_jose_decode_jws_json_flattened(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + apr_jose_t *jose = NULL; + apr_status_t status; + + const char *source = "{" + "\"payload\":" + "\"eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGF" + "tcGxlLmNvbS9pc19yb290Ijp0cnVlfQ\"," + "\"protected\":\"eyJhbGciOiJFUzI1NiJ9\"," + "\"header\":" + "{\"kid\":\"e9bc097a-ce51-4036-9562-d2ade882db0d\"}," + "\"signature\":" + "\"DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8IS" + "lSApmWQxfKTUJqPP3-Kg6NU1Q\"" + "}"; + + apr_jose_cb_t cb; + + cb.verify = verify_cb; + cb.decrypt = decrypt_cb; + cb.ctx = tc; + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + apr_brigade_write(bb, NULL, NULL, source, strlen(source)); + + status = apr_jose_decode(&jose, "JOSE+JSON", bb, &cb, 10, APR_JOSE_FLAG_NONE, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + ABTS_PTR_NOTNULL(tc, jose); + ABTS_INT_EQUAL(tc, APR_JOSE_TYPE_DATA, jose->type); + +} + +/** + * Test from https://tools.ietf.org/html/rfc7516#appendix-A.1 + */ +static void test_jose_decode_jwe_compact_rsaes_oaep_aes_gcm(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + apr_jose_t *jose = NULL; + apr_status_t status; + + const char *source = "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ." + "OKOawDo13gRp2ojaHV7LFpZcgV7T6DVZKTyKOMTYUmKoTCVJRgckCL9kiMT03JGe" + "ipsEdY3mx_etLbbWSrFr05kLzcSr4qKAq7YN7e9jwQRb23nfa6c9d-StnImGyFDb" + "Sv04uVuxIp5Zms1gNxKKK2Da14B8S4rzVRltdYwam_lDp5XnZAYpQdb76FdIKLaV" + "mqgfwX7XWRxv2322i-vDxRfqNzo_tETKzpVLzfiwQyeyPGLBIO56YJ7eObdv0je8" + "1860ppamavo35UgoRdbYaBcoh9QcfylQr66oc6vFWXRcZ_ZT2LawVCWTIy3brGPi" + "6UklfCpIMfIjf7iGdXKHzg." + "48V1_ALb6US04U3b." + "5eym8TW_c8SuK0ltJ3rpYIzOeDQz7TALvtu6UG9oMo4vpzs9tX_EFShS8iB7j6ji" + "SdiwkIr3ajwQzaBtQD_A." + "XFBoMYUZodetZdvTiFvSkQ"; + + apr_jose_cb_t cb; + + cb.verify = verify_cb; + cb.decrypt = decrypt_cb; + cb.ctx = tc; + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + apr_brigade_write(bb, NULL, NULL, source, strlen(source)); + + status = apr_jose_decode(&jose, "JWE", bb, &cb, 10, APR_JOSE_FLAG_NONE, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + ABTS_PTR_NOTNULL(tc, jose); + ABTS_INT_EQUAL(tc, APR_JOSE_TYPE_DATA, jose->type); + +} + +/** + * Test from https://tools.ietf.org/html/rfc7516#appendix-A.4 + */ +static void test_jose_decode_jwe_json_general(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + apr_jose_t *jose = NULL; + apr_status_t status; + + const char *source = "{" + "\"protected\":" + "\"eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0\"," + "\"unprotected\":" + "{\"jku\":\"https://server.example.com/keys.jwks\"}," + "\"recipients\":[" + "{\"header\":" + "{\"alg\":\"RSA1_5\",\"kid\":\"2011-04-29\"}," + "\"encrypted_key\":" + "\"UGhIOguC7IuEvf_NPVaXsGMoLOmwvc1GyqlIKOK1nN94nHPoltGRhWhw7Zx0-" + "kFm1NJn8LE9XShH59_i8J0PH5ZZyNfGy2xGdULU7sHNF6Gp2vPLgNZ__deLKx" + "GHZ7PcHALUzoOegEI-8E66jX2E4zyJKx-YxzZIItRzC5hlRirb6Y5Cl_p-ko3" + "YvkkysZIFNPccxRU7qve1WYPxqbb2Yw8kZqa2rMWI5ng8OtvzlV7elprCbuPh" + "cCdZ6XDP0_F8rkXds2vE4X-ncOIM8hAYHHi29NX0mcKiRaD0-D-ljQTP-cFPg" + "wCp6X-nZZd9OHBv-B3oWh2TbqmScqXMR4gp_A\"}," + "{\"header\":" + "{\"alg\":\"A128KW\",\"kid\":\"7\"}," + "\"encrypted_key\":" + "\"6KB707dM9YTIgHtLvtgWQ8mKwboJW3of9locizkDTHzBC2IlrT1oOQ\"}]," + "\"iv\":" + "\"AxY8DCtDaGlsbGljb3RoZQ\"," + "\"ciphertext\":" + "\"KDlTtXchhZTGufMYmOYGS4HffxPSUrfmqCHXaI9wOGY\"," + "\"tag\":" + "\"Mz-VPPyU4RlcuYv1IwIvzw\"" + "}"; + + apr_jose_cb_t cb; + + cb.verify = verify_cb; + cb.decrypt = decrypt_cb; + cb.ctx = tc; + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + apr_brigade_write(bb, NULL, NULL, source, strlen(source)); + + status = apr_jose_decode(&jose, "JOSE+JSON", bb, &cb, 10, + APR_JOSE_FLAG_NONE, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + ABTS_PTR_NOTNULL(tc, jose); + ABTS_INT_EQUAL(tc, APR_JOSE_TYPE_DATA, jose->type); + +} + +/** + * Test from https://tools.ietf.org/html/rfc7516#appendix-A.5 + */ +static void test_jose_decode_jwe_json_flattened(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba; + apr_bucket_brigade *bb; + apr_jose_t *jose = NULL; + apr_status_t status; + + const char *source = "{" + "\"protected\":" + "\"eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0\"," + "\"unprotected\":" + "{\"jku\":\"https://server.example.com/keys.jwks\"}," + "\"header\":" + "{\"alg\":\"A128KW\",\"kid\":\"7\"}," + "\"encrypted_key\":" + "\"6KB707dM9YTIgHtLvtgWQ8mKwboJW3of9locizkDTHzBC2IlrT1oOQ\"," + "\"iv\":" + "\"AxY8DCtDaGlsbGljb3RoZQ\"," + "\"ciphertext\":" + "\"KDlTtXchhZTGufMYmOYGS4HffxPSUrfmqCHXaI9wOGY\"," + "\"tag\":" + "\"Mz-VPPyU4RlcuYv1IwIvzw\"" + "}"; + + apr_jose_cb_t cb; + + cb.verify = verify_cb; + cb.decrypt = decrypt_cb; + cb.ctx = tc; + + ba = apr_bucket_alloc_create(p); + bb = apr_brigade_create(p, ba); + + apr_brigade_write(bb, NULL, NULL, source, strlen(source)); + + status = apr_jose_decode(&jose, "JOSE+JSON", bb, &cb, 10, + APR_JOSE_FLAG_NONE, p); + + ABTS_INT_EQUAL(tc, APR_SUCCESS, status); + ABTS_PTR_NOTNULL(tc, jose); + ABTS_INT_EQUAL(tc, APR_JOSE_TYPE_DATA, jose->type); + +} + +abts_suite *testjose(abts_suite *suite) +{ + suite = ADD_SUITE(suite); + + abts_run_test(suite, test_jose_decode_jws_compact_unsecured, NULL); + abts_run_test(suite, test_jose_decode_jws_compact_hs256, NULL); + abts_run_test(suite, test_jose_decode_jws_json_general, NULL); + abts_run_test(suite, test_jose_decode_jws_json_flattened, NULL); + abts_run_test(suite, test_jose_decode_jwe_compact_rsaes_oaep_aes_gcm, NULL); + abts_run_test(suite, test_jose_decode_jwe_json_general, NULL); + abts_run_test(suite, test_jose_decode_jwe_json_flattened, NULL); + + abts_run_test(suite, test_jose_encode_jws_compact_unsecured, NULL); + abts_run_test(suite, test_jose_encode_jws_compact_hs256, NULL); + abts_run_test(suite, test_jose_encode_jws_json_general, NULL); + abts_run_test(suite, test_jose_encode_jws_json_flattened, NULL); + abts_run_test(suite, test_jose_encode_jwe_compact_rsaes_oaep_aes_gcm, NULL); + abts_run_test(suite, test_jose_encode_jwe_json_general, NULL); + abts_run_test(suite, test_jose_encode_jwe_json_flattened, NULL); + + return suite; +} From 1ffadd51d5d84869096e33d9ec1675fe1c7333a3 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 1 Sep 2018 20:06:18 +0000 Subject: [PATCH 7867/7878] apr_json: Split apr_json_object_set() into apr_json_object_set() with a simple key, and apr_json_object_set() with the key as an apr_json_value_t, so the caller has a simpler interface to use to add a key value pair to an object. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839840 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_json.h | 20 +++++++- jose/apr_jose_encode.c | 102 +++++++++++++++++------------------------ json/apr_json.c | 52 +++++++++++++++++++-- json/apr_json_decode.c | 2 +- 4 files changed, 109 insertions(+), 67 deletions(-) diff --git a/include/apr_json.h b/include/apr_json.h index c05f6704cee..55c4806b509 100644 --- a/include/apr_json.h +++ b/include/apr_json.h @@ -271,6 +271,22 @@ APR_DECLARE(apr_json_value_t *) /** * Associate a value with a key in a JSON object. * @param obj The JSON object. + * @param key Pointer to the key string. + * @param klen Length of the key, or APR_JSON_VALUE_STRING if NUL + * terminated. + * @param val Value to associate with the key. + * @param pool Pool to use. + * @return APR_SUCCESS on success, APR_EINVAL if the key is + * NULL or not a string, or the object is not an APR_JSON_OBJECT. + * @remark If the value is NULL the key value pair is deleted. + */ +APR_DECLARE(apr_status_t) apr_json_object_set(apr_json_value_t *obj, + const char *key, apr_ssize_t klen, apr_json_value_t *val, + apr_pool_t *pool) __attribute__((nonnull(1, 2, 5))); + +/** + * Associate a value with a key in a JSON object, preserving whitespace. + * @param obj The JSON object. * @param key Pointer to the key string, including any whitespace * required. * @param val Value to associate with the key. @@ -279,9 +295,9 @@ APR_DECLARE(apr_json_value_t *) * NULL or not a string, or the object is not an APR_JSON_OBJECT. * @remark If the value is NULL the key value pair is deleted. */ -APR_DECLARE(apr_status_t) apr_json_object_set(apr_json_value_t *obj, +APR_DECLARE(apr_status_t) apr_json_object_set_ex(apr_json_value_t *obj, apr_json_value_t *key, apr_json_value_t *val, - apr_pool_t *pool) __attribute__((nonnull(1, 4))); + apr_pool_t *pool) __attribute__((nonnull(1, 2, 4))); /** * Look up the value associated with a key in a JSON object. diff --git a/jose/apr_jose_encode.c b/jose/apr_jose_encode.c index 43a4adc8b09..71088b8ca2b 100644 --- a/jose/apr_jose_encode.c +++ b/jose/apr_jose_encode.c @@ -263,7 +263,7 @@ static apr_status_t apr_jose_encode_json_jwe(apr_bucket_brigade *brigade, apr_pool_t *p) { - apr_json_value_t *json, *key, *val; + apr_json_value_t *json; char *buf; const char *buf64; apr_size_t len; @@ -300,10 +300,9 @@ static apr_status_t apr_jose_encode_json_jwe(apr_bucket_brigade *brigade, apr_brigade_cleanup(bb); - key = apr_json_string_create(p, "protected", - APR_JSON_VALUE_STRING); - val = apr_json_string_create(p, buf, len); - apr_json_object_set(json, key, val, p); + apr_json_object_set(json, "protected", + APR_JSON_VALUE_STRING, + apr_json_string_create(p, buf, len), p); } @@ -311,9 +310,8 @@ static apr_status_t apr_jose_encode_json_jwe(apr_bucket_brigade *brigade, if (e->unprotected) { - key = apr_json_string_create(p, "unprotected", - APR_JSON_VALUE_STRING); - apr_json_object_set(json, key, e->unprotected, p); + apr_json_object_set(json, "unprotected", + APR_JSON_VALUE_STRING, e->unprotected, p); } @@ -341,9 +339,8 @@ static apr_status_t apr_jose_encode_json_jwe(apr_bucket_brigade *brigade, /* create header */ - key = apr_json_string_create(p, "header", - APR_JSON_VALUE_STRING); - apr_json_object_set(json, key, recip->header, p); + apr_json_object_set(json, "header", + APR_JSON_VALUE_STRING, recip->header, p); apr_brigade_cleanup(bb); @@ -353,10 +350,9 @@ static apr_status_t apr_jose_encode_json_jwe(apr_bucket_brigade *brigade, recip->ekey.len, APR_ENCODE_BASE64URL, &len64); - key = apr_json_string_create(p, "encrypted_key", - APR_JSON_VALUE_STRING); - val = apr_json_string_create(p, buf64, len64); - apr_json_object_set(json, key, val, p); + apr_json_object_set(json, "encrypted_key", + APR_JSON_VALUE_STRING, + apr_json_string_create(p, buf64, len64), p); } @@ -368,10 +364,9 @@ static apr_status_t apr_jose_encode_json_jwe(apr_bucket_brigade *brigade, /* create recipients element */ - key = apr_json_string_create(p, "recipients", - APR_JSON_VALUE_STRING); recips = apr_json_array_create(p, jwe->recipients->nelts); - apr_json_object_set(json, key, recips, p); + apr_json_object_set(json, "recipients", + APR_JSON_VALUE_STRING, recips, p); /* populate each recipient */ @@ -405,9 +400,8 @@ static apr_status_t apr_jose_encode_json_jwe(apr_bucket_brigade *brigade, /* create header */ - key = apr_json_string_create(p, "header", - APR_JSON_VALUE_STRING); - apr_json_object_set(r, key, recip->header, p); + apr_json_object_set(r, "header", + APR_JSON_VALUE_STRING, recip->header, p); apr_brigade_cleanup(bb); @@ -417,10 +411,9 @@ static apr_status_t apr_jose_encode_json_jwe(apr_bucket_brigade *brigade, recip->ekey.len, APR_ENCODE_BASE64URL, &len64); - key = apr_json_string_create(p, "encrypted_key", - APR_JSON_VALUE_STRING); - val = apr_json_string_create(p, buf64, len64); - apr_json_object_set(r, key, val, p); + apr_json_object_set(r, "encrypted_key", + APR_JSON_VALUE_STRING, + apr_json_string_create(p, buf64, len64), p); } if (APR_SUCCESS != status) { @@ -436,9 +429,8 @@ static apr_status_t apr_jose_encode_json_jwe(apr_bucket_brigade *brigade, buf64 = apr_pencode_base64_binary(p, e->iv.data, e->iv.len, APR_ENCODE_BASE64URL, &len64); - key = apr_json_string_create(p, "iv", APR_JSON_VALUE_STRING); - val = apr_json_string_create(p, buf64, len64); - apr_json_object_set(json, key, val, p); + apr_json_object_set(json, "iv", APR_JSON_VALUE_STRING, + apr_json_string_create(p, buf64, len64), p); } /* create aad */ @@ -448,9 +440,8 @@ static apr_status_t apr_jose_encode_json_jwe(apr_bucket_brigade *brigade, buf64 = apr_pencode_base64_binary(p, e->aad.data, e->aad.len, APR_ENCODE_BASE64URL, &len64); - key = apr_json_string_create(p, "aad", APR_JSON_VALUE_STRING); - val = apr_json_string_create(p, buf64, len64); - apr_json_object_set(json, key, val, p); + apr_json_object_set(json, "aad", APR_JSON_VALUE_STRING, + apr_json_string_create(p, buf64, len64), p); } /* create ciphertext */ @@ -460,9 +451,8 @@ static apr_status_t apr_jose_encode_json_jwe(apr_bucket_brigade *brigade, buf64 = apr_pencode_base64_binary(p, e->cipher.data, e->cipher.len, APR_ENCODE_BASE64URL, &len64); - key = apr_json_string_create(p, "ciphertext", APR_JSON_VALUE_STRING); - val = apr_json_string_create(p, buf64, len64); - apr_json_object_set(json, key, val, p); + apr_json_object_set(json, "ciphertext", APR_JSON_VALUE_STRING, + apr_json_string_create(p, buf64, len64), p); } /* create tag */ @@ -472,9 +462,8 @@ static apr_status_t apr_jose_encode_json_jwe(apr_bucket_brigade *brigade, buf64 = apr_pencode_base64_binary(p, e->tag.data, e->tag.len, APR_ENCODE_BASE64URL, &len64); - key = apr_json_string_create(p, "tag", APR_JSON_VALUE_STRING); - val = apr_json_string_create(p, buf64, len64); - apr_json_object_set(json, key, val, p); + apr_json_object_set(json, "tag", APR_JSON_VALUE_STRING, + apr_json_string_create(p, buf64, len64), p); } } @@ -493,7 +482,7 @@ static apr_status_t apr_jose_encode_json_jws(apr_bucket_brigade *brigade, apr_brigade_flush flush, void *ctx, apr_jose_t *jose, apr_jose_cb_t *cb, apr_pool_t *p) { - apr_json_value_t *json, *key, *val; + apr_json_value_t *json; char *buf; const char *buf64; apr_size_t len; @@ -530,9 +519,8 @@ static apr_status_t apr_jose_encode_json_jws(apr_bucket_brigade *brigade, /* add the payload to our json */ - key = apr_json_string_create(p, "payload", APR_JSON_VALUE_STRING); - val = apr_json_string_create(p, buf64, len64); - apr_json_object_set(json, key, val, p); + apr_json_object_set(json, "payload", APR_JSON_VALUE_STRING, + apr_json_string_create(p, buf64, len64), p); /* calculate the flattened signature */ @@ -551,9 +539,8 @@ static apr_status_t apr_jose_encode_json_jws(apr_bucket_brigade *brigade, return status; } - key = apr_json_string_create(p, "protected", APR_JSON_VALUE_STRING); - val = apr_json_string_create(p, buf, len); - apr_json_object_set(json, key, val, p); + apr_json_object_set(json, "protected", APR_JSON_VALUE_STRING, + apr_json_string_create(p, buf, len), p); status = apr_brigade_write(bb, flush, ctx, ".", 1); if (APR_SUCCESS != status) { @@ -576,8 +563,8 @@ static apr_status_t apr_jose_encode_json_jws(apr_bucket_brigade *brigade, /* create header */ - key = apr_json_string_create(p, "header", APR_JSON_VALUE_STRING); - apr_json_object_set(json, key, jws->signature->header, p); + apr_json_object_set(json, "header", APR_JSON_VALUE_STRING, + jws->signature->header, p); apr_brigade_cleanup(bb); @@ -587,9 +574,8 @@ static apr_status_t apr_jose_encode_json_jws(apr_bucket_brigade *brigade, jws->signature->sig.data, jws->signature->sig.len, APR_ENCODE_BASE64URL, &len64); - key = apr_json_string_create(p, "signature", APR_JSON_VALUE_STRING); - val = apr_json_string_create(p, buf64, len64); - apr_json_object_set(json, key, val, p); + apr_json_object_set(json, "signature", APR_JSON_VALUE_STRING, + apr_json_string_create(p, buf64, len64), p); } @@ -602,9 +588,9 @@ static apr_status_t apr_jose_encode_json_jws(apr_bucket_brigade *brigade, /* create signatures element */ - key = apr_json_string_create(p, "signatures", APR_JSON_VALUE_STRING); sigs = apr_json_array_create(p, jws->signatures->nelts); - apr_json_object_set(json, key, sigs, p); + apr_json_object_set(json, "signatures", APR_JSON_VALUE_STRING, + sigs, p); /* populate each signature */ @@ -630,9 +616,8 @@ static apr_status_t apr_jose_encode_json_jws(apr_bucket_brigade *brigade, /* add protected header to array */ - key = apr_json_string_create(p, "protected", APR_JSON_VALUE_STRING); - val = apr_json_string_create(p, buf, len); - apr_json_object_set(s, key, val, p); + apr_json_object_set(s, "protected", APR_JSON_VALUE_STRING, + apr_json_string_create(p, buf, len), p); status = apr_brigade_write(bb, flush, ctx, ".", 1); if (APR_SUCCESS != status) { @@ -655,8 +640,8 @@ static apr_status_t apr_jose_encode_json_jws(apr_bucket_brigade *brigade, /* create header */ - key = apr_json_string_create(p, "header", APR_JSON_VALUE_STRING); - apr_json_object_set(s, key, sig->header, p); + apr_json_object_set(s, "header", APR_JSON_VALUE_STRING, + sig->header, p); apr_brigade_cleanup(bb); @@ -666,9 +651,8 @@ static apr_status_t apr_jose_encode_json_jws(apr_bucket_brigade *brigade, sig->sig.len, APR_ENCODE_BASE64URL, &len64); - key = apr_json_string_create(p, "signature", APR_JSON_VALUE_STRING); - val = apr_json_string_create(p, buf64, len64); - apr_json_object_set(s, key, val, p); + apr_json_object_set(s, "signature", APR_JSON_VALUE_STRING, + apr_json_string_create(p, buf64, len64), p); } if (APR_SUCCESS != status) { diff --git a/json/apr_json.c b/json/apr_json.c index ad4281cc24e..4b5867fc0cc 100644 --- a/json/apr_json.c +++ b/json/apr_json.c @@ -129,13 +129,55 @@ apr_json_value_t *apr_json_null_create(apr_pool_t *pool) return json; } -apr_status_t apr_json_object_set(apr_json_value_t *object, apr_json_value_t *key, - apr_json_value_t *val, apr_pool_t *pool) +apr_status_t apr_json_object_set(apr_json_value_t *object, + const char *key, apr_ssize_t klen, apr_json_value_t *val, + apr_pool_t *pool) { apr_json_kv_t *kv; apr_hash_t *hash; - if (object->type != APR_JSON_OBJECT || !key + if (object->type != APR_JSON_OBJECT) { + return APR_EINVAL; + } + + if (klen == APR_JSON_VALUE_STRING) { + klen = strlen(key); + } + + hash = object->value.object->hash; + + kv = apr_hash_get(hash, key, klen); + + if (!val) { + if (kv) { + apr_hash_set(hash, key, klen, NULL); + APR_RING_REMOVE((kv), link); + } + return APR_SUCCESS; + } + + if (!kv) { + kv = apr_palloc(pool, sizeof(apr_json_kv_t)); + APR_RING_ELEM_INIT(kv, link); + APR_JSON_OBJECT_INSERT_TAIL(object->value.object, kv); + apr_hash_set(hash, key, klen, + kv); + } + + kv->k = apr_json_string_create(pool, key, klen); + kv->v = val; + + return APR_SUCCESS; +} + +apr_status_t apr_json_object_set_ex(apr_json_value_t *object, + apr_json_value_t *key, apr_json_value_t *val, + apr_pool_t *pool) +{ + apr_json_kv_t *kv; + apr_hash_t *hash; + + if (object->type != APR_JSON_OBJECT || key->type != APR_JSON_STRING) { return APR_EINVAL; } @@ -316,7 +358,7 @@ apr_json_value_t *apr_json_overlay(apr_pool_t *p, if (!apr_hash_get(overlay->value.object->hash, kv->k->value.string.p, kv->k->value.string.len)) { - apr_json_object_set(res, kv->k, kv->v, p); + apr_json_object_set_ex(res, kv->k, kv->v, p); } else if (APR_JSON_FLAGS_STRICT & flags) { @@ -329,7 +371,7 @@ apr_json_value_t *apr_json_overlay(apr_pool_t *p, kv != APR_RING_SENTINEL(&(overlay->value.object)->list, apr_json_kv_t, link); kv = APR_RING_NEXT((kv), link)) { - apr_json_object_set(res, kv->k, kv->v, p); + apr_json_object_set_ex(res, kv->k, kv->v, p); } diff --git a/json/apr_json_decode.c b/json/apr_json_decode.c index c790d6fdc39..5ef2cb854f9 100644 --- a/json/apr_json_decode.c +++ b/json/apr_json_decode.c @@ -501,7 +501,7 @@ static apr_status_t apr_json_decode_object(apr_json_scanner_t * self, if ((status = apr_json_decode_value(self, &value))) goto out; - apr_json_object_set(json, key, value, self->pool); + apr_json_object_set_ex(json, key, value, self->pool); if (self->p == self->e) { status = APR_EOF; From 237e4e2353d9ec36464e0d8cb7f6b5540a1a1dec Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sat, 1 Sep 2018 22:08:02 +0000 Subject: [PATCH 7868/7878] apr_jose: Change the signature of apr_jose_make() so that it is no longer neceessary to pass in a pointer to a NULL pointer, but keep supporting the option to pre-allocate structures. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839859 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_jose.h | 44 +++--- jose/apr_jose.c | 298 ++++++++++++++++++++--------------------- jose/apr_jose_decode.c | 115 ++++++++-------- test/testjose.c | 81 ++++++----- 4 files changed, 271 insertions(+), 267 deletions(-) diff --git a/include/apr_jose.h b/include/apr_jose.h index 7389d74ae5c..5fd8931aa9a 100644 --- a/include/apr_jose.h +++ b/include/apr_jose.h @@ -923,8 +923,9 @@ APR_DECLARE(apu_err_t *) apr_jose_error(apr_jose_t *jose); * be reused. * @param type the type of structure to create. * @param pool pool used to allocate the result from. + * @return The apr_jose_t is returned. */ -APR_DECLARE(apr_status_t) apr_jose_make(apr_jose_t **jose, apr_jose_type_e type, +APR_DECLARE(apr_jose_t *) apr_jose_make(apr_jose_t *jose, apr_jose_type_e type, apr_pool_t *pool); /** @@ -934,8 +935,9 @@ APR_DECLARE(apr_status_t) apr_jose_make(apr_jose_t **jose, apr_jose_type_e type, * be reused. * @param key the json representing the key. May be NULL. * @param pool pool used to allocate the result from. + * @return The apr_jose_t is returned. */ -APR_DECLARE(apr_status_t) apr_jose_jwk_make(apr_jose_t **jose, +APR_DECLARE(apr_jose_t *) apr_jose_jwk_make(apr_jose_t *jose, apr_json_value_t *key, apr_pool_t *pool); /** @@ -945,8 +947,9 @@ APR_DECLARE(apr_status_t) apr_jose_jwk_make(apr_jose_t **jose, * be reused. * @param keys the array of keys in JSON format. May be NULL. * @param pool pool used to allocate the result from. + * @return The apr_jose_t is returned. */ -APR_DECLARE(apr_status_t) apr_jose_jwks_make(apr_jose_t **jose, +APR_DECLARE(apr_jose_t *) apr_jose_jwks_make(apr_jose_t *jose, apr_json_value_t *keys, apr_pool_t *pool); /** @@ -956,9 +959,10 @@ APR_DECLARE(apr_status_t) apr_jose_jwks_make(apr_jose_t **jose, * @param header the unprotected header. * @param protected the protected header. * @param pool the pool to use. + * @return The apr_jose_signature_t is returned. */ -APR_DECLARE(apr_status_t) apr_jose_signature_make( - apr_jose_signature_t **signature, apr_json_value_t *header, +APR_DECLARE(apr_jose_signature_t *) apr_jose_signature_make( + apr_jose_signature_t *signature, apr_json_value_t *header, apr_json_value_t *protected, apr_pool_t *pool); /** @@ -967,8 +971,9 @@ APR_DECLARE(apr_status_t) apr_jose_signature_make( * @param recipient the result. * @param unprotected the unprotected header. * @param pool the pool to use. + * @return The apr_jose_recipient_t is returned. */ -APR_DECLARE(apr_status_t) apr_jose_recipient_make(apr_jose_recipient_t **recipient, +APR_DECLARE(apr_jose_recipient_t *) apr_jose_recipient_make(apr_jose_recipient_t *recipient, apr_json_value_t *unprotected, apr_pool_t *pool); /** @@ -978,8 +983,9 @@ APR_DECLARE(apr_status_t) apr_jose_recipient_make(apr_jose_recipient_t **recipie * @param unprotected the unprotected shared header. * @param protected the protected header. * @param pool the pool to use. + * @return The apr_jose_encryption_t is returned. */ -APR_DECLARE(apr_status_t) apr_jose_encryption_make(apr_jose_encryption_t **encryption, +APR_DECLARE(apr_jose_encryption_t *) apr_jose_encryption_make(apr_jose_encryption_t *encryption, apr_json_value_t *unprotected, apr_json_value_t *protected, apr_pool_t *pool); @@ -993,8 +999,9 @@ APR_DECLARE(apr_status_t) apr_jose_encryption_make(apr_jose_encryption_t **encry * @param encryption the encryption structure. * @param payload the JOSE payload to encrypt. * @param pool pool used to allocate the result from. + * @return The apr_jose_t is returned. */ -APR_DECLARE(apr_status_t) apr_jose_jwe_make(apr_jose_t **jose, +APR_DECLARE(apr_jose_t *) apr_jose_jwe_make(apr_jose_t *jose, apr_jose_recipient_t *recipient, apr_array_header_t *recipients, apr_jose_encryption_t *encryption, apr_jose_t *payload, apr_pool_t *pool); @@ -1009,8 +1016,9 @@ APR_DECLARE(apr_status_t) apr_jose_jwe_make(apr_jose_t **jose, * @param encryption the encryption structure. * @param payload the JOSE payload to encrypt. * @param pool pool used to allocate the result from. + * @return The apr_jose_t is returned. */ -APR_DECLARE(apr_status_t) apr_jose_jwe_json_make(apr_jose_t **jose, +APR_DECLARE(apr_jose_t *) apr_jose_jwe_json_make(apr_jose_t *jose, apr_jose_recipient_t *recipient, apr_array_header_t *recipients, apr_jose_encryption_t *encryption, apr_jose_t *payload, apr_pool_t *pool); @@ -1024,8 +1032,9 @@ APR_DECLARE(apr_status_t) apr_jose_jwe_json_make(apr_jose_t **jose, * @param signatures array of header / protected header / signature used with general JSON syntax. * @param payload the payload to be wrapped by this JWS. * @param pool pool used to allocate the result from. + * @return The apr_jose_t is returned. */ -APR_DECLARE(apr_status_t) apr_jose_jws_make(apr_jose_t **jose, +APR_DECLARE(apr_jose_t *) apr_jose_jws_make(apr_jose_t *jose, apr_jose_signature_t *signature, apr_array_header_t *signatures, apr_jose_t *payload, apr_pool_t *pool); @@ -1038,8 +1047,9 @@ APR_DECLARE(apr_status_t) apr_jose_jws_make(apr_jose_t **jose, * @param signatures array of header / protected header / signature used with general JSON syntax. * @param payload the payload to be wrapped by this JWS. * @param pool pool used to allocate the result from. + * @return The apr_jose_t is returned. */ -APR_DECLARE(apr_status_t) apr_jose_jws_json_make(apr_jose_t **jose, +APR_DECLARE(apr_jose_t *) apr_jose_jws_json_make(apr_jose_t *jose, apr_jose_signature_t *signature, apr_array_header_t *signatures, apr_jose_t *payload, apr_pool_t *pool); @@ -1053,8 +1063,9 @@ APR_DECLARE(apr_status_t) apr_jose_jws_json_make(apr_jose_t **jose, * be reused. * @param claims the claims to sign. * @param pool pool used to allocate the result from. + * @return The apr_jose_t is returned. */ -APR_DECLARE(apr_status_t) apr_jose_jwt_make(apr_jose_t **jose, +APR_DECLARE(apr_jose_t *) apr_jose_jwt_make(apr_jose_t *jose, apr_json_value_t *claims, apr_pool_t *pool); /** @@ -1066,8 +1077,9 @@ APR_DECLARE(apr_status_t) apr_jose_jwt_make(apr_jose_t **jose, * @param in the plaintext to sign. * @param inlen length of the plaintext. * @param pool pool used to allocate the result from. + * @return The apr_jose_t is returned. */ -APR_DECLARE(apr_status_t) apr_jose_data_make(apr_jose_t **jose, const char *typ, +APR_DECLARE(apr_jose_t *) apr_jose_data_make(apr_jose_t *jose, const char *typ, const unsigned char *in, apr_size_t inlen, apr_pool_t *pool); /** @@ -1080,8 +1092,9 @@ APR_DECLARE(apr_status_t) apr_jose_data_make(apr_jose_t **jose, const char *typ, * @param in the UTF-8 encoded text string. * @param inlen length of the UTF-8 encoded text string. * @param pool pool used to allocate the result from. + * @return The apr_jose_t is returned. */ -APR_DECLARE(apr_status_t) apr_jose_text_make(apr_jose_t **jose, const char *cty, +APR_DECLARE(apr_jose_t *) apr_jose_text_make(apr_jose_t *jose, const char *cty, const char *in, apr_size_t inlen, apr_pool_t *pool); /** @@ -1092,8 +1105,9 @@ APR_DECLARE(apr_status_t) apr_jose_text_make(apr_jose_t **jose, const char *cty, * @param cty the content type. * @param json the json object to add. * @param pool pool used to allocate the result from. + * @return The apr_jose_t is returned. */ -APR_DECLARE(apr_status_t) apr_jose_json_make(apr_jose_t **jose, const char *cty, +APR_DECLARE(apr_jose_t *) apr_jose_json_make(apr_jose_t *jose, const char *cty, apr_json_value_t *json, apr_pool_t *pool); /** diff --git a/jose/apr_jose.c b/jose/apr_jose.c index 26f6b0ffab8..f48554b5435 100644 --- a/jose/apr_jose.c +++ b/jose/apr_jose.c @@ -21,141 +21,138 @@ APR_DECLARE(apu_err_t *) apr_jose_error(apr_jose_t *jose) return &jose->result; } -APR_DECLARE(apr_status_t) apr_jose_make(apr_jose_t **jose, apr_jose_type_e type, +APR_DECLARE(apr_jose_t *) apr_jose_make(apr_jose_t *jose, apr_jose_type_e type, apr_pool_t *pool) { - apr_jose_t *j; - - if (*jose) { - j = *jose; - } else { - *jose = j = apr_pcalloc(pool, sizeof(apr_jose_t)); - if (!j) { - return APR_ENOMEM; + + if (!jose) { + jose = apr_pcalloc(pool, sizeof(apr_jose_t)); + if (!jose) { + return NULL; } } - j->pool = pool; - j->type = type; + jose->pool = pool; + jose->type = type; - return APR_SUCCESS; + return jose; } -APR_DECLARE(apr_status_t) apr_jose_data_make(apr_jose_t **jose, const char *typ, +APR_DECLARE(apr_jose_t *) apr_jose_data_make(apr_jose_t *jose, const char *typ, const unsigned char *in, apr_size_t inlen, apr_pool_t *pool) { - apr_jose_t *j; - apr_status_t status; - status = apr_jose_make(jose, APR_JOSE_TYPE_DATA, pool); - if (APR_SUCCESS != status) { - return status; + if (!jose) { + jose = apr_jose_make(jose, APR_JOSE_TYPE_DATA, pool); + if (!jose) { + return NULL; + } } - j = *jose; - j->typ = typ; - j->jose.data = apr_palloc(pool, sizeof(apr_jose_data_t)); - if (!j->jose.data) { - return APR_ENOMEM; + jose->typ = typ; + jose->jose.data = apr_palloc(pool, sizeof(apr_jose_data_t)); + if (!jose->jose.data) { + return NULL; } - j->jose.data->data = in; - j->jose.data->len = inlen; + jose->jose.data->data = in; + jose->jose.data->len = inlen; - return APR_SUCCESS; + return jose; } -APR_DECLARE(apr_status_t) apr_jose_json_make(apr_jose_t **jose, const char *cty, +APR_DECLARE(apr_jose_t *) apr_jose_json_make(apr_jose_t *jose, const char *cty, apr_json_value_t *json, apr_pool_t *pool) { - apr_jose_t *j; - apr_status_t status; - status = apr_jose_make(jose, APR_JOSE_TYPE_JSON, pool); - if (APR_SUCCESS != status) { - return status; + if (!jose) { + jose = apr_jose_make(jose, APR_JOSE_TYPE_JSON, pool); + if (!jose) { + return NULL; + } } - j = *jose; - j->cty = cty; - j->jose.json = apr_palloc(pool, sizeof(apr_jose_json_t)); - if (!j->jose.json) { - return APR_ENOMEM; + jose->cty = cty; + jose->jose.json = apr_palloc(pool, sizeof(apr_jose_json_t)); + if (!jose->jose.json) { + return NULL; } - j->jose.json->json = json; + jose->jose.json->json = json; - return APR_SUCCESS; + return jose; } -APR_DECLARE(apr_status_t) apr_jose_signature_make( - apr_jose_signature_t **signature, apr_json_value_t *header, +APR_DECLARE(apr_jose_signature_t *) apr_jose_signature_make( + apr_jose_signature_t *signature, apr_json_value_t *header, apr_json_value_t *protected, apr_pool_t *pool) { - apr_jose_signature_t *s; - *signature = s = apr_pcalloc(pool, sizeof(apr_jose_signature_t)); - if (!s) { - return APR_ENOMEM; + if (!signature) { + signature = apr_pcalloc(pool, sizeof(apr_jose_signature_t)); + if (!signature) { + return NULL; + } } - s->header = header; - s->protected_header = protected; + signature->header = header; + signature->protected_header = protected; - return APR_SUCCESS; + return signature; } -APR_DECLARE(apr_status_t) apr_jose_recipient_make( - apr_jose_recipient_t **recipient, apr_json_value_t *header, +APR_DECLARE(apr_jose_recipient_t *) apr_jose_recipient_make( + apr_jose_recipient_t *recipient, apr_json_value_t *header, apr_pool_t *pool) { - apr_jose_recipient_t *r; - *recipient = r = apr_pcalloc(pool, sizeof(apr_jose_recipient_t)); - if (!r) { - return APR_ENOMEM; + if (!recipient) { + recipient = apr_pcalloc(pool, sizeof(apr_jose_recipient_t)); + if (!recipient) { + return NULL; + } } - r->header = header; + recipient->header = header; - return APR_SUCCESS; + return recipient; } -APR_DECLARE(apr_status_t) apr_jose_encryption_make( - apr_jose_encryption_t **encryption, apr_json_value_t *header, +APR_DECLARE(apr_jose_encryption_t *) apr_jose_encryption_make( + apr_jose_encryption_t *encryption, apr_json_value_t *header, apr_json_value_t *protected_header, apr_pool_t *pool) { - apr_jose_encryption_t *e; - *encryption = e = apr_pcalloc(pool, sizeof(apr_jose_encryption_t)); - if (!e) { - return APR_ENOMEM; + if (!encryption) { + encryption = apr_pcalloc(pool, sizeof(apr_jose_encryption_t)); + if (!encryption) { + return NULL; + } } - e->unprotected = header; - e->protected = protected_header; + encryption->unprotected = header; + encryption->protected = protected_header; - return APR_SUCCESS; + return encryption; } -APR_DECLARE(apr_status_t) apr_jose_jwe_make(apr_jose_t **jose, +APR_DECLARE(apr_jose_t *) apr_jose_jwe_make(apr_jose_t *jose, apr_jose_recipient_t *recipient, apr_array_header_t *recipients, apr_jose_encryption_t *encryption, apr_jose_t *payload, apr_pool_t *pool) { - apr_jose_t *j; apr_jose_jwe_t *jwe; - apr_status_t status; - status = apr_jose_make(jose, APR_JOSE_TYPE_JWE, pool); - if (APR_SUCCESS != status) { - return status; + if (!jose) { + jose = apr_jose_make(jose, APR_JOSE_TYPE_JWE, pool); + if (!jose) { + return NULL; + } } - j = *jose; - j->cty = payload->cty; + jose->cty = payload->cty; - jwe = j->jose.jwe = apr_palloc(pool, sizeof(apr_jose_jwe_t)); + jwe = jose->jose.jwe = apr_palloc(pool, sizeof(apr_jose_jwe_t)); if (!jwe) { - return APR_ENOMEM; + return NULL; } jwe->recipient = recipient; @@ -163,31 +160,30 @@ APR_DECLARE(apr_status_t) apr_jose_jwe_make(apr_jose_t **jose, jwe->encryption = encryption; jwe->payload = payload; - return APR_SUCCESS; + return jose; } -APR_DECLARE(apr_status_t) apr_jose_jwe_json_make(apr_jose_t **jose, +APR_DECLARE(apr_jose_t *) apr_jose_jwe_json_make(apr_jose_t *jose, apr_jose_recipient_t *recipient, apr_array_header_t *recipients, apr_jose_encryption_t *encryption, apr_jose_t *payload, apr_pool_t *pool) { - apr_jose_t *j; apr_jose_jwe_t *jwe; - apr_status_t status; - status = apr_jose_make(jose, APR_JOSE_TYPE_JWE_JSON, pool); - if (APR_SUCCESS != status) { - return status; + if (!jose) { + jose = apr_jose_make(jose, APR_JOSE_TYPE_JWE_JSON, pool); + if (!jose) { + return NULL; + } } - j = *jose; if (payload) { - j->cty = payload->cty; + jose->cty = payload->cty; } - jwe = j->jose.jwe = apr_palloc(pool, sizeof(apr_jose_jwe_t)); + jwe = jose->jose.jwe = apr_palloc(pool, sizeof(apr_jose_jwe_t)); if (!jwe) { - return APR_ENOMEM; + return NULL; } jwe->recipient = recipient; @@ -195,159 +191,153 @@ APR_DECLARE(apr_status_t) apr_jose_jwe_json_make(apr_jose_t **jose, jwe->encryption = encryption; jwe->payload = payload; - return APR_SUCCESS; + return jose; } -APR_DECLARE(apr_status_t) apr_jose_jwk_make(apr_jose_t **jose, +APR_DECLARE(apr_jose_t *) apr_jose_jwk_make(apr_jose_t *jose, apr_json_value_t *key, apr_pool_t *pool) { - apr_jose_t *j; apr_jose_jwk_t *jwk; - apr_status_t status; - status = apr_jose_make(jose, APR_JOSE_TYPE_JWK, pool); - if (APR_SUCCESS != status) { - return status; + if (!jose) { + jose = apr_jose_make(jose, APR_JOSE_TYPE_JWK, pool); + if (!jose) { + return NULL; + } } - j = *jose; - jwk = j->jose.jwk = apr_palloc(pool, sizeof(apr_jose_jwk_t)); + jwk = jose->jose.jwk = apr_palloc(pool, sizeof(apr_jose_jwk_t)); if (!jwk) { - return APR_ENOMEM; + return NULL; } jwk->key = key; - return APR_SUCCESS; + return jose; } -APR_DECLARE(apr_status_t) apr_jose_jwks_make(apr_jose_t **jose, +APR_DECLARE(apr_jose_t *) apr_jose_jwks_make(apr_jose_t *jose, apr_json_value_t *keys, apr_pool_t *pool) { - apr_jose_t *j; apr_jose_jwks_t *jwks; - apr_status_t status; - status = apr_jose_make(jose, APR_JOSE_TYPE_JWKS, pool); - if (APR_SUCCESS != status) { - return status; + if (!jose) { + jose = apr_jose_make(jose, APR_JOSE_TYPE_JWKS, pool); + if (!jose) { + return NULL; + } } - j = *jose; - jwks = j->jose.jwks = apr_palloc(pool, sizeof(apr_jose_jwks_t)); + jwks = jose->jose.jwks = apr_palloc(pool, sizeof(apr_jose_jwks_t)); if (!jwks) { - return APR_ENOMEM; + return NULL; } jwks->keys = keys; - return APR_SUCCESS; + return jose; } -APR_DECLARE(apr_status_t) apr_jose_jws_make(apr_jose_t **jose, +APR_DECLARE(apr_jose_t *) apr_jose_jws_make(apr_jose_t *jose, apr_jose_signature_t *signature, apr_array_header_t *signatures, apr_jose_t *payload, apr_pool_t *pool) { - apr_jose_t *j; apr_jose_jws_t *jws; - apr_status_t status; - status = apr_jose_make(jose, APR_JOSE_TYPE_JWS, pool); - if (APR_SUCCESS != status) { - return status; + if (!jose) { + jose = apr_jose_make(jose, APR_JOSE_TYPE_JWS, pool); + if (!jose) { + return NULL; + } } - j = *jose; if (payload) { - j->cty = payload->cty; + jose->cty = payload->cty; } - jws = j->jose.jws = apr_pcalloc(pool, sizeof(apr_jose_jws_t)); + jws = jose->jose.jws = apr_pcalloc(pool, sizeof(apr_jose_jws_t)); if (!jws) { - return APR_ENOMEM; + return NULL; } jws->signature = signature; jws->signatures = signatures; jws->payload = payload; - return APR_SUCCESS; + return jose; } -APR_DECLARE(apr_status_t) apr_jose_jws_json_make(apr_jose_t **jose, +APR_DECLARE(apr_jose_t *) apr_jose_jws_json_make(apr_jose_t *jose, apr_jose_signature_t *signature, apr_array_header_t *signatures, apr_jose_t *payload, apr_pool_t *pool) { - apr_jose_t *j; apr_jose_jws_t *jws; - apr_status_t status; - status = apr_jose_make(jose, APR_JOSE_TYPE_JWS_JSON, pool); - if (APR_SUCCESS != status) { - return status; + if (!jose) { + jose = apr_jose_make(jose, APR_JOSE_TYPE_JWS_JSON, pool); + if (!jose) { + return NULL; + } } - j = *jose; if (payload) { - j->cty = payload->cty; + jose->cty = payload->cty; } - jws = j->jose.jws = apr_pcalloc(pool, sizeof(apr_jose_jws_t)); + jws = jose->jose.jws = apr_pcalloc(pool, sizeof(apr_jose_jws_t)); if (!jws) { - return APR_ENOMEM; + return NULL; } jws->signature = signature; jws->signatures = signatures; jws->payload = payload; - return APR_SUCCESS; + return jose; } -APR_DECLARE(apr_status_t) apr_jose_jwt_make(apr_jose_t **jose, apr_json_value_t *claims, +APR_DECLARE(apr_jose_t *) apr_jose_jwt_make(apr_jose_t *jose, apr_json_value_t *claims, apr_pool_t *pool) { - apr_jose_t *j; apr_jose_jwt_t *jwt; - apr_status_t status; - status = apr_jose_make(jose, APR_JOSE_TYPE_JWT, pool); - if (APR_SUCCESS != status) { - return status; + if (!jose) { + jose = apr_jose_make(jose, APR_JOSE_TYPE_JWT, pool); + if (!jose) { + return NULL; + } } - j = *jose; - j->cty = "JWT"; + jose->cty = "JWT"; - jwt = j->jose.jwt = apr_palloc(pool, sizeof(apr_jose_jwt_t)); + jwt = jose->jose.jwt = apr_palloc(pool, sizeof(apr_jose_jwt_t)); if (!jwt) { - return APR_ENOMEM; + return NULL; } jwt->claims = claims; - return APR_SUCCESS; + return jose; } -APR_DECLARE(apr_status_t) apr_jose_text_make(apr_jose_t **jose, const char *cty, +APR_DECLARE(apr_jose_t *) apr_jose_text_make(apr_jose_t *jose, const char *cty, const char *in, apr_size_t inlen, apr_pool_t *pool) { - apr_jose_t *j; - apr_status_t status; - status = apr_jose_make(jose, APR_JOSE_TYPE_TEXT, pool); - if (APR_SUCCESS != status) { - return status; + if (!jose) { + jose = apr_jose_make(jose, APR_JOSE_TYPE_TEXT, pool); + if (!jose) { + return NULL; + } } - j = *jose; - j->cty = cty; - j->jose.text = apr_palloc(pool, sizeof(apr_jose_text_t)); - if (!j->jose.text) { - return APR_ENOMEM; + jose->cty = cty; + jose->jose.text = apr_palloc(pool, sizeof(apr_jose_text_t)); + if (!jose->jose.text) { + return NULL; } - j->jose.text->text = in; - j->jose.text->len = inlen; + jose->jose.text->text = in; + jose->jose.text->len = inlen; - return APR_SUCCESS; + return jose; } diff --git a/jose/apr_jose_decode.c b/jose/apr_jose_decode.c index 7d0b01d4913..defe06a3451 100644 --- a/jose/apr_jose_decode.c +++ b/jose/apr_jose_decode.c @@ -41,23 +41,24 @@ apr_status_t apr_jose_decode_jwk(apr_jose_t **jose, const char *typ, apr_bucket_brigade *bb, apr_jose_cb_t *cb, int level, int flags, apr_pool_t *pool) { + apr_json_value_t *key; apr_jose_text_t in; apr_off_t offset; apr_status_t status; - status = apr_jose_jwk_make(jose, NULL, pool); - if (APR_SUCCESS != status) { - return status; - } - status = apr_jose_flatten(bb, &in, pool); if (APR_SUCCESS != status) { return status; } - status = apr_json_decode(&(*jose)->jose.jwk->key, in.text, in.len, &offset, + status = apr_json_decode(&key, in.text, in.len, &offset, APR_JSON_FLAGS_WHITESPACE, level, pool); + *jose = apr_jose_jwk_make(NULL, key, pool); + if (!*jose) { + return APR_ENOMEM; + } + if (APR_SUCCESS != status) { char buf[1024]; apr_strerror(status, buf, sizeof(buf)); @@ -75,23 +76,24 @@ apr_status_t apr_jose_decode_jwks(apr_jose_t **jose, const char *typ, apr_bucket_brigade *bb, apr_jose_cb_t *cb, int level, int flags, apr_pool_t *pool) { + apr_json_value_t *keys; apr_jose_text_t in; apr_off_t offset; apr_status_t status; - status = apr_jose_jwks_make(jose, NULL, pool); - if (APR_SUCCESS != status) { - return status; - } - status = apr_jose_flatten(bb, &in, pool); if (APR_SUCCESS != status) { return status; } - status = apr_json_decode(&(*jose)->jose.jwks->keys, in.text, in.len, + status = apr_json_decode(&keys, in.text, in.len, &offset, APR_JSON_FLAGS_WHITESPACE, level, pool); + *jose = apr_jose_jwks_make(NULL, keys, pool); + if (!*jose) { + return APR_ENOMEM; + } + if (APR_SUCCESS != status) { char buf[1024]; apr_strerror(status, buf, sizeof(buf)); @@ -102,7 +104,7 @@ apr_status_t apr_jose_decode_jwks(apr_jose_t **jose, return status; } - if ((*jose)->jose.jwks->keys->type != APR_JSON_ARRAY) { + if (keys->type != APR_JSON_ARRAY) { apr_errprintf(&(*jose)->result, pool, NULL, 0, "Syntax error: JWKS 'keys' is not an array"); return APR_EINVAL; @@ -115,23 +117,24 @@ apr_status_t apr_jose_decode_jwt(apr_jose_t **jose, const char *typ, apr_bucket_brigade *bb, apr_jose_cb_t *cb, int level, int flags, apr_pool_t *pool) { + apr_json_value_t *claims; apr_jose_text_t in; apr_off_t offset; apr_status_t status; - status = apr_jose_jwt_make(jose, NULL, pool); - if (APR_SUCCESS != status) { - return status; - } - status = apr_jose_flatten(bb, &in, pool); if (APR_SUCCESS != status) { return status; } - status = apr_json_decode(&(*jose)->jose.jwt->claims, in.text, in.len, &offset, + status = apr_json_decode(&claims, in.text, in.len, &offset, APR_JSON_FLAGS_WHITESPACE, level, pool); + *jose = apr_jose_jwt_make(NULL, claims, pool); + if (!*jose) { + return APR_ENOMEM; + } + if (APR_SUCCESS != status) { char buf[1024]; apr_strerror(status, buf, sizeof(buf)); @@ -157,10 +160,10 @@ apr_status_t apr_jose_decode_data(apr_jose_t **jose, const char *typ, return status; } - status = apr_jose_data_make(jose, typ, (const unsigned char *) in.text, in.len, - pool); - if (APR_SUCCESS != status) { - return status; + *jose = apr_jose_data_make(NULL, typ, (const unsigned char *) in.text, + in.len, pool); + if (!*jose) { + return APR_ENOMEM; } return status; @@ -404,9 +407,9 @@ apr_status_t apr_jose_decode_compact_jws(apr_jose_t **jose, return APR_EINIT; } - status = apr_jose_jws_make(jose, NULL, NULL, NULL, pool); - if (APR_SUCCESS != status) { - return status; + *jose = apr_jose_jws_make(*jose, NULL, NULL, NULL, pool); + if (!*jose) { + return APR_ENOMEM; } jws = (*jose)->jose.jws; @@ -415,9 +418,9 @@ apr_status_t apr_jose_decode_compact_jws(apr_jose_t **jose, * the JWS Protected Header. */ - status = apr_jose_signature_make(&jws->signature, NULL, ph, pool); - if (APR_SUCCESS != status) { - return status; + jws->signature = apr_jose_signature_make(NULL, NULL, ph, pool); + if (!jws->signature) { + return APR_ENOMEM; } dot = memchr(left, '.', right - left); @@ -501,21 +504,21 @@ apr_status_t apr_jose_decode_compact_jwe(apr_jose_t **jose, const char *left, return APR_EINIT; } - status = apr_jose_jwe_make(jose, NULL, NULL, NULL, NULL, pool); - if (APR_SUCCESS != status) { - return status; + *jose = apr_jose_jwe_make(*jose, NULL, NULL, NULL, NULL, pool); + if (!*jose) { + return APR_ENOMEM; } jwe = (*jose)->jose.jwe; - status = apr_jose_encryption_make(&jwe->encryption, NULL, + jwe->encryption = apr_jose_encryption_make(NULL, NULL, NULL, pool); - if (APR_SUCCESS != status) { - return status; + if (!jwe->encryption) { + return APR_ENOMEM; } - status = apr_jose_recipient_make(&jwe->recipient, NULL, pool); - if (APR_SUCCESS != status) { - return status; + jwe->recipient = apr_jose_recipient_make(NULL, NULL, pool); + if (!jwe->recipient) { + return APR_ENOMEM; } /* @@ -655,9 +658,9 @@ apr_status_t apr_jose_decode_compact(apr_jose_t **jose, const char *typ, left = in.text; right = in.text + in.len; - status = apr_jose_make(jose, APR_JOSE_TYPE_NONE, pool); - if (APR_SUCCESS != status) { - return status; + *jose = apr_jose_make(NULL, APR_JOSE_TYPE_NONE, pool); + if (!*jose) { + return APR_ENOMEM; } bb = apr_brigade_create(pool, brigade->bucket_alloc); @@ -852,9 +855,9 @@ apr_status_t apr_jose_decode_json_jws(apr_jose_t **jose, apr_json_value_t *val, return APR_BADCH; } - status = apr_jose_jws_json_make(jose, NULL, NULL, NULL, pool); - if (APR_SUCCESS != status) { - return status; + *jose = apr_jose_jws_json_make(*jose, NULL, NULL, NULL, pool); + if (!*jose) { + return APR_ENOMEM; } jws = (*jose)->jose.jws; @@ -1037,10 +1040,10 @@ apr_status_t apr_jose_decode_json_jws(apr_jose_t **jose, apr_json_value_t *val, return APR_SUCCESS; } - status = apr_jose_signature_make(&jws->signature, NULL, NULL, + jws->signature = apr_jose_signature_make(NULL, NULL, NULL, pool); - if (APR_SUCCESS != status) { - return status; + if (!jws->signature) { + return APR_ENOMEM; } kv = apr_json_object_get(val, APR_JOSE_JWSE_PROTECTED, @@ -1173,16 +1176,16 @@ apr_status_t apr_jose_decode_json_jwe(apr_jose_t **jose, apr_json_value_t *val, return APR_EINVAL; } - status = apr_jose_jwe_json_make(jose, NULL, NULL, NULL, NULL, pool); - if (APR_SUCCESS != status) { - return status; + *jose = apr_jose_jwe_json_make(*jose, NULL, NULL, NULL, NULL, pool); + if (!*jose) { + return APR_ENOMEM; } jwe = (*jose)->jose.jwe; - status = apr_jose_encryption_make(&jwe->encryption, NULL, + jwe->encryption = apr_jose_encryption_make(NULL, NULL, NULL, pool); - if (APR_SUCCESS != status) { - return status; + if (!jwe->encryption) { + return APR_ENOMEM; } /* @@ -1547,9 +1550,9 @@ apr_status_t apr_jose_decode_json(apr_jose_t **jose, const char *typ, apr_off_t offset; apr_status_t status; - status = apr_jose_make(jose, APR_JOSE_TYPE_NONE, pool); - if (APR_SUCCESS != status) { - return status; + *jose = apr_jose_make(NULL, APR_JOSE_TYPE_NONE, pool); + if (!*jose) { + return APR_ENOMEM; } status = apr_jose_flatten(brigade, &in, pool); diff --git a/test/testjose.c b/test/testjose.c index 411b7c5d010..a804bbbaf19 100644 --- a/test/testjose.c +++ b/test/testjose.c @@ -599,8 +599,8 @@ static void test_jose_encode_jws_compact_unsecured(abts_case *tc, void *data) { apr_bucket_alloc_t *ba; apr_bucket_brigade *bb; - apr_jose_t *jose = NULL; - apr_jose_t *jdata = NULL; + apr_jose_t *jose; + apr_jose_t *jdata; apr_jose_signature_t signature; char buf[1024]; apr_size_t len = sizeof(buf); @@ -631,8 +631,8 @@ static void test_jose_encode_jws_compact_unsecured(abts_case *tc, void *data) ba = apr_bucket_alloc_create(p); bb = apr_brigade_create(p, ba); - apr_jose_data_make(&jdata, "JWT", pl, sizeof(pl), p); - apr_jose_jws_make(&jose, &signature, NULL, jdata, p); + jdata = apr_jose_data_make(NULL, "JWT", pl, sizeof(pl), p); + jose = apr_jose_jws_make(NULL, &signature, NULL, jdata, p); status = apr_jose_encode(bb, NULL, NULL, jose, &cb, p); @@ -649,8 +649,8 @@ static void test_jose_encode_jws_compact_hs256(abts_case *tc, void *data) { apr_bucket_alloc_t *ba; apr_bucket_brigade *bb; - apr_jose_t *jose = NULL; - apr_jose_t *jdata = NULL; + apr_jose_t *jose; + apr_jose_t *jdata; apr_jose_signature_t signature; char buf[1024]; apr_size_t len = sizeof(buf); @@ -685,8 +685,8 @@ static void test_jose_encode_jws_compact_hs256(abts_case *tc, void *data) ba = apr_bucket_alloc_create(p); bb = apr_brigade_create(p, ba); - apr_jose_data_make(&jdata, "JWT", pl, sizeof(pl), p); - apr_jose_jws_make(&jose, &signature, NULL, jdata, p); + jdata = apr_jose_data_make(NULL, "JWT", pl, sizeof(pl), p); + jose = apr_jose_jws_make(NULL, &signature, NULL, jdata, p); status = apr_jose_encode(bb, NULL, NULL, jose, &cb, p); @@ -703,8 +703,8 @@ static void test_jose_encode_jws_json_general(abts_case *tc, void *data) { apr_bucket_alloc_t *ba; apr_bucket_brigade *bb; - apr_jose_t *jose = NULL; - apr_jose_t *jdata = NULL; + apr_jose_t *jose; + apr_jose_t *jdata; apr_jose_signature_t **signature; apr_jose_signature_t signature1; apr_jose_signature_t signature2; @@ -771,8 +771,8 @@ static void test_jose_encode_jws_json_general(abts_case *tc, void *data) ba = apr_bucket_alloc_create(p); bb = apr_brigade_create(p, ba); - apr_jose_data_make(&jdata, "JWT", pl, sizeof(pl), p); - apr_jose_jws_json_make(&jose, NULL, signatures, jdata, p); + jdata = apr_jose_data_make(NULL, "JWT", pl, sizeof(pl), p); + jose = apr_jose_jws_json_make(NULL, NULL, signatures, jdata, p); status = apr_jose_encode(bb, NULL, NULL, jose, &cb, p); @@ -790,8 +790,8 @@ static void test_jose_encode_jws_json_flattened(abts_case *tc, void *data) { apr_bucket_alloc_t *ba; apr_bucket_brigade *bb; - apr_jose_t *jose = NULL; - apr_jose_t *jdata = NULL; + apr_jose_t *jose; + apr_jose_t *jdata; apr_jose_signature_t signature2; char buf[1024]; apr_size_t len = sizeof(buf); @@ -832,8 +832,8 @@ static void test_jose_encode_jws_json_flattened(abts_case *tc, void *data) ba = apr_bucket_alloc_create(p); bb = apr_brigade_create(p, ba); - apr_jose_data_make(&jdata, "JWT", pl, sizeof(pl), p); - apr_jose_jws_json_make(&jose, &signature2, NULL, jdata, p); + jdata = apr_jose_data_make(NULL, "JWT", pl, sizeof(pl), p); + jose = apr_jose_jws_json_make(NULL, &signature2, NULL, jdata, p); status = apr_jose_encode(bb, NULL, NULL, jose, &cb, p); @@ -851,8 +851,8 @@ static void test_jose_encode_jwe_compact_rsaes_oaep_aes_gcm(abts_case *tc, void { apr_bucket_alloc_t *ba; apr_bucket_brigade *bb; - apr_jose_t *jose = NULL; - apr_jose_t *jdata = NULL; + apr_jose_t *jose; + apr_jose_t *jdata; apr_jose_encryption_t *encryption; apr_jose_recipient_t *recipient; apr_json_value_t *header = NULL; @@ -893,10 +893,10 @@ static void test_jose_encode_jwe_compact_rsaes_oaep_aes_gcm(abts_case *tc, void ba = apr_bucket_alloc_create(p); bb = apr_brigade_create(p, ba); - apr_jose_data_make(&jdata, "JWT", pl, sizeof(pl), p); - apr_jose_recipient_make(&recipient, header, p); - apr_jose_encryption_make(&encryption, NULL, protected_header, p); - apr_jose_jwe_make(&jose, recipient, NULL, encryption, jdata, p); + jdata = apr_jose_data_make(NULL, "JWT", pl, sizeof(pl), p); + recipient = apr_jose_recipient_make(NULL, header, p); + encryption = apr_jose_encryption_make(NULL, NULL, protected_header, p); + jose = apr_jose_jwe_make(NULL, recipient, NULL, encryption, jdata, p); status = apr_jose_encode(bb, NULL, NULL, jose, &cb, p); @@ -913,8 +913,8 @@ static void test_jose_encode_jwe_json_general(abts_case *tc, void *data) { apr_bucket_alloc_t *ba; apr_bucket_brigade *bb; - apr_jose_t *jose = NULL; - apr_jose_t *jdata = NULL; + apr_jose_t *jose; + apr_jose_t *jdata; apr_json_value_t *header = NULL; apr_json_value_t *protected_header = NULL; apr_jose_recipient_t **recipient; @@ -979,9 +979,6 @@ static void test_jose_encode_jwe_json_general(abts_case *tc, void *data) recipient = apr_array_push(recipients); *recipient = &recipient2; - - - apr_json_decode(&header, h, APR_JSON_VALUE_STRING, &offset, APR_JSON_FLAGS_WHITESPACE, 10, p); apr_json_decode(&protected_header, ph, APR_JSON_VALUE_STRING, &offset, @@ -990,9 +987,9 @@ static void test_jose_encode_jwe_json_general(abts_case *tc, void *data) ba = apr_bucket_alloc_create(p); bb = apr_brigade_create(p, ba); - apr_jose_data_make(&jdata, "plain", pl, sizeof(pl), p); - apr_jose_encryption_make(&encryption, header, protected_header, p); - apr_jose_jwe_json_make(&jose, NULL, recipients, encryption, jdata, p); + jdata = apr_jose_data_make(NULL, "plain", pl, sizeof(pl), p); + encryption = apr_jose_encryption_make(NULL, header, protected_header, p); + jose = apr_jose_jwe_json_make(NULL, NULL, recipients, encryption, jdata, p); status = apr_jose_encode(bb, NULL, NULL, jose, &cb, p); @@ -1009,8 +1006,8 @@ static void test_jose_encode_jwe_json_flattened(abts_case *tc, void *data) { apr_bucket_alloc_t *ba; apr_bucket_brigade *bb; - apr_jose_t *jose = NULL; - apr_jose_t *jdata = NULL; + apr_jose_t *jose; + apr_jose_t *jdata; apr_json_value_t *header = NULL; apr_json_value_t *protected_header = NULL; apr_jose_recipient_t recipient; @@ -1061,9 +1058,9 @@ static void test_jose_encode_jwe_json_flattened(abts_case *tc, void *data) ba = apr_bucket_alloc_create(p); bb = apr_brigade_create(p, ba); - apr_jose_data_make(&jdata, "plain", pl, sizeof(pl), p); - apr_jose_encryption_make(&encryption, header, protected_header, p); - apr_jose_jwe_json_make(&jose, &recipient, NULL, encryption, jdata, p); + jdata = apr_jose_data_make(NULL, "plain", pl, sizeof(pl), p); + encryption = apr_jose_encryption_make(NULL, header, protected_header, p); + jose = apr_jose_jwe_json_make(NULL, &recipient, NULL, encryption, jdata, p); status = apr_jose_encode(bb, NULL, NULL, jose, &cb, p); @@ -1080,7 +1077,7 @@ static void test_jose_decode_jws_compact_unsecured(abts_case *tc, void *data) { apr_bucket_alloc_t *ba; apr_bucket_brigade *bb; - apr_jose_t *jose = NULL; + apr_jose_t *jose; apr_json_kv_t *kv; apr_status_t status; @@ -1121,7 +1118,7 @@ static void test_jose_decode_jws_compact_hs256(abts_case *tc, void *data) { apr_bucket_alloc_t *ba; apr_bucket_brigade *bb; - apr_jose_t *jose = NULL; + apr_jose_t *jose; apr_json_kv_t *kv; apr_status_t status; @@ -1186,7 +1183,7 @@ static void test_jose_decode_jws_json_general(abts_case *tc, void *data) apr_bucket_alloc_t *ba; apr_bucket_brigade *bb; - apr_jose_t *jose = NULL; + apr_jose_t *jose; apr_status_t status; apr_jose_cb_t cb; @@ -1220,7 +1217,7 @@ static void test_jose_decode_jws_json_flattened(abts_case *tc, void *data) { apr_bucket_alloc_t *ba; apr_bucket_brigade *bb; - apr_jose_t *jose = NULL; + apr_jose_t *jose; apr_status_t status; const char *source = "{" @@ -1261,7 +1258,7 @@ static void test_jose_decode_jwe_compact_rsaes_oaep_aes_gcm(abts_case *tc, void { apr_bucket_alloc_t *ba; apr_bucket_brigade *bb; - apr_jose_t *jose = NULL; + apr_jose_t *jose; apr_status_t status; const char *source = "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ." @@ -1302,7 +1299,7 @@ static void test_jose_decode_jwe_json_general(abts_case *tc, void *data) { apr_bucket_alloc_t *ba; apr_bucket_brigade *bb; - apr_jose_t *jose = NULL; + apr_jose_t *jose; apr_status_t status; const char *source = "{" @@ -1359,7 +1356,7 @@ static void test_jose_decode_jwe_json_flattened(abts_case *tc, void *data) { apr_bucket_alloc_t *ba; apr_bucket_brigade *bb; - apr_jose_t *jose = NULL; + apr_jose_t *jose; apr_status_t status; const char *source = "{" From ab2c12a3e6d500734414ca04ae9b8164e4f8f382 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Sun, 2 Sep 2018 07:57:22 +0000 Subject: [PATCH 7869/7878] Fix a doxygen warning git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839872 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_json.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_json.h b/include/apr_json.h index 55c4806b509..b0776551e3d 100644 --- a/include/apr_json.h +++ b/include/apr_json.h @@ -366,7 +366,7 @@ APR_DECLARE(apr_json_value_t *) * @return Returns the first value, or NULL if not an array, or the array is * empty. */ -APR_DECLARE(apr_json_value_t *) apr_json_array_first(const apr_json_value_t *obj) +APR_DECLARE(apr_json_value_t *) apr_json_array_first(const apr_json_value_t *arr) __attribute__((nonnull(1)));; /** From ebc3b1c2d2bda9dc14bfee64614a166a7b0d6f23 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 2 Sep 2018 20:50:16 +0000 Subject: [PATCH 7870/7878] Explicitly declare parameters as nonnull. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839894 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_jose.h | 51 ++++++++++++++++++++++++++++-------------- jose/apr_jose_encode.c | 5 ----- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/include/apr_jose.h b/include/apr_jose.h index 5fd8931aa9a..59d0dcac7a0 100644 --- a/include/apr_jose.h +++ b/include/apr_jose.h @@ -914,7 +914,8 @@ typedef struct apr_jose_cb_t { * @param jose - context pointer * @return The apu_err_t is returned. */ -APR_DECLARE(apu_err_t *) apr_jose_error(apr_jose_t *jose); +APR_DECLARE(apu_err_t *) apr_jose_error(apr_jose_t *jose) + __attribute__((nonnull(1))); /** * Make a generic JOSE structure. @@ -926,7 +927,8 @@ APR_DECLARE(apu_err_t *) apr_jose_error(apr_jose_t *jose); * @return The apr_jose_t is returned. */ APR_DECLARE(apr_jose_t *) apr_jose_make(apr_jose_t *jose, apr_jose_type_e type, - apr_pool_t *pool); + apr_pool_t *pool) + __attribute__((nonnull(3))); /** * Make a JSON Web Key for encoding or decoding. @@ -938,7 +940,8 @@ APR_DECLARE(apr_jose_t *) apr_jose_make(apr_jose_t *jose, apr_jose_type_e type, * @return The apr_jose_t is returned. */ APR_DECLARE(apr_jose_t *) apr_jose_jwk_make(apr_jose_t *jose, - apr_json_value_t *key, apr_pool_t *pool); + apr_json_value_t *key, apr_pool_t *pool) + __attribute__((nonnull(3))); /** * Make a JSON Web Key Set. @@ -950,7 +953,8 @@ APR_DECLARE(apr_jose_t *) apr_jose_jwk_make(apr_jose_t *jose, * @return The apr_jose_t is returned. */ APR_DECLARE(apr_jose_t *) apr_jose_jwks_make(apr_jose_t *jose, - apr_json_value_t *keys, apr_pool_t *pool); + apr_json_value_t *keys, apr_pool_t *pool) + __attribute__((nonnull(3))); /** * Make a signature structure for JWS. @@ -963,7 +967,8 @@ APR_DECLARE(apr_jose_t *) apr_jose_jwks_make(apr_jose_t *jose, */ APR_DECLARE(apr_jose_signature_t *) apr_jose_signature_make( apr_jose_signature_t *signature, apr_json_value_t *header, - apr_json_value_t *protected, apr_pool_t *pool); + apr_json_value_t *protected, apr_pool_t *pool) + __attribute__((nonnull(4))); /** * Make a recipient structure for JWE. @@ -974,7 +979,8 @@ APR_DECLARE(apr_jose_signature_t *) apr_jose_signature_make( * @return The apr_jose_recipient_t is returned. */ APR_DECLARE(apr_jose_recipient_t *) apr_jose_recipient_make(apr_jose_recipient_t *recipient, - apr_json_value_t *unprotected, apr_pool_t *pool); + apr_json_value_t *unprotected, apr_pool_t *pool) + __attribute__((nonnull(3))); /** * Make an encryption structure for JWE. @@ -987,7 +993,8 @@ APR_DECLARE(apr_jose_recipient_t *) apr_jose_recipient_make(apr_jose_recipient_t */ APR_DECLARE(apr_jose_encryption_t *) apr_jose_encryption_make(apr_jose_encryption_t *encryption, apr_json_value_t *unprotected, apr_json_value_t *protected, - apr_pool_t *pool); + apr_pool_t *pool) + __attribute__((nonnull(4))); /** * Make a compact encoded JWE. @@ -1004,7 +1011,8 @@ APR_DECLARE(apr_jose_encryption_t *) apr_jose_encryption_make(apr_jose_encryptio APR_DECLARE(apr_jose_t *) apr_jose_jwe_make(apr_jose_t *jose, apr_jose_recipient_t *recipient, apr_array_header_t *recipients, apr_jose_encryption_t *encryption, apr_jose_t *payload, - apr_pool_t *pool); + apr_pool_t *pool) + __attribute__((nonnull(6))); /** * Make a JSON encoded JWE. @@ -1021,7 +1029,8 @@ APR_DECLARE(apr_jose_t *) apr_jose_jwe_make(apr_jose_t *jose, APR_DECLARE(apr_jose_t *) apr_jose_jwe_json_make(apr_jose_t *jose, apr_jose_recipient_t *recipient, apr_array_header_t *recipients, apr_jose_encryption_t *encryption, - apr_jose_t *payload, apr_pool_t *pool); + apr_jose_t *payload, apr_pool_t *pool) + __attribute__((nonnull(6))); /** * Make a compact encoded JWS. @@ -1036,7 +1045,8 @@ APR_DECLARE(apr_jose_t *) apr_jose_jwe_json_make(apr_jose_t *jose, */ APR_DECLARE(apr_jose_t *) apr_jose_jws_make(apr_jose_t *jose, apr_jose_signature_t *signature, apr_array_header_t *signatures, - apr_jose_t *payload, apr_pool_t *pool); + apr_jose_t *payload, apr_pool_t *pool) + __attribute__((nonnull(5))); /** * Make a JSON encoded JWS. @@ -1051,7 +1061,8 @@ APR_DECLARE(apr_jose_t *) apr_jose_jws_make(apr_jose_t *jose, */ APR_DECLARE(apr_jose_t *) apr_jose_jws_json_make(apr_jose_t *jose, apr_jose_signature_t *signature, apr_array_header_t *signatures, - apr_jose_t *payload, apr_pool_t *pool); + apr_jose_t *payload, apr_pool_t *pool) + __attribute__((nonnull(5))); /** * Make a JWT claims payload. @@ -1066,7 +1077,8 @@ APR_DECLARE(apr_jose_t *) apr_jose_jws_json_make(apr_jose_t *jose, * @return The apr_jose_t is returned. */ APR_DECLARE(apr_jose_t *) apr_jose_jwt_make(apr_jose_t *jose, - apr_json_value_t *claims, apr_pool_t *pool); + apr_json_value_t *claims, apr_pool_t *pool) + __attribute__((nonnull(3))); /** * Make a data buffer for encoding from the given data and length. @@ -1080,7 +1092,8 @@ APR_DECLARE(apr_jose_t *) apr_jose_jwt_make(apr_jose_t *jose, * @return The apr_jose_t is returned. */ APR_DECLARE(apr_jose_t *) apr_jose_data_make(apr_jose_t *jose, const char *typ, - const unsigned char *in, apr_size_t inlen, apr_pool_t *pool); + const unsigned char *in, apr_size_t inlen, apr_pool_t *pool) + __attribute__((nonnull(5))); /** * Make a UTF-8 text buffer for encoding from the given string @@ -1095,7 +1108,8 @@ APR_DECLARE(apr_jose_t *) apr_jose_data_make(apr_jose_t *jose, const char *typ, * @return The apr_jose_t is returned. */ APR_DECLARE(apr_jose_t *) apr_jose_text_make(apr_jose_t *jose, const char *cty, - const char *in, apr_size_t inlen, apr_pool_t *pool); + const char *in, apr_size_t inlen, apr_pool_t *pool) + __attribute__((nonnull(5))); /** * Make a json structure for encoding. @@ -1108,7 +1122,8 @@ APR_DECLARE(apr_jose_t *) apr_jose_text_make(apr_jose_t *jose, const char *cty, * @return The apr_jose_t is returned. */ APR_DECLARE(apr_jose_t *) apr_jose_json_make(apr_jose_t *jose, const char *cty, - apr_json_value_t *json, apr_pool_t *pool); + apr_json_value_t *json, apr_pool_t *pool) + __attribute__((nonnull(4))); /** * Sign or encrypt the apr_jose_t, and write it to the brigade. @@ -1124,7 +1139,8 @@ APR_DECLARE(apr_jose_t *) apr_jose_json_make(apr_jose_t *jose, const char *cty, */ APR_DECLARE(apr_status_t) apr_jose_encode(apr_bucket_brigade *brigade, apr_brigade_flush flush, void *ctx, apr_jose_t *jose, - apr_jose_cb_t *cb, apr_pool_t *pool); + apr_jose_cb_t *cb, apr_pool_t *pool) + __attribute__((nonnull(1, 4, 6))); /** * Decode, decrypt and verify the utf8-encoded JOSE string into apr_jose_t. @@ -1143,7 +1159,8 @@ APR_DECLARE(apr_status_t) apr_jose_encode(apr_bucket_brigade *brigade, */ APR_DECLARE(apr_status_t) apr_jose_decode(apr_jose_t **jose, const char *typ, apr_bucket_brigade *brigade, apr_jose_cb_t *cb, int level, int flags, - apr_pool_t *pool); + apr_pool_t *pool) + __attribute__((nonnull(1, 3, 7))); #ifdef __cplusplus diff --git a/jose/apr_jose_encode.c b/jose/apr_jose_encode.c index 71088b8ca2b..220c6f2b8cd 100644 --- a/jose/apr_jose_encode.c +++ b/jose/apr_jose_encode.c @@ -678,11 +678,6 @@ apr_status_t apr_jose_encode(apr_bucket_brigade *brigade, apr_pool_t *p; apr_status_t status = APR_EINVAL; - /* if asked to encode nothing, encode nothing */ - if (jose == NULL) { - return APR_SUCCESS; - } - apr_pool_create(&p, pool); if (p == NULL) { return APR_ENOMEM; From 469644ad1ce8cd45861917a76319a1400a9c17f2 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Sun, 2 Sep 2018 22:30:43 +0000 Subject: [PATCH 7871/7878] Perform nesting level checks before each invocation of apr_jose_decode() (when a jose structure has been created to carry the error message). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839897 13f79535-47bb-0310-9956-ffa450edef68 --- jose/apr_jose_decode.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/jose/apr_jose_decode.c b/jose/apr_jose_decode.c index defe06a3451..7c1a9012579 100644 --- a/jose/apr_jose_decode.c +++ b/jose/apr_jose_decode.c @@ -796,6 +796,13 @@ apr_status_t apr_jose_decode_compact(apr_jose_t **jose, const char *typ, } else { + if (level <= 0) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: too many nested JOSE payloads"); + return APR_EINVAL; + } + level--; + status = apr_jose_decode( flags & APR_JOSE_FLAG_DECODE_ALL ? &(*jose)->jose.jws->payload : jose, typ, bb, cb, @@ -1005,6 +1012,13 @@ apr_status_t apr_jose_decode_json_jws(apr_jose_t **jose, apr_json_value_t *val, bb->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, e); + if (level <= 0) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: too many nested JOSE payloads"); + return APR_EINVAL; + } + level--; + status = apr_jose_decode( flags & APR_JOSE_FLAG_DECODE_ALL ? &(*jose)->jose.jwe->payload : jose, typ, @@ -1144,6 +1158,13 @@ apr_status_t apr_jose_decode_json_jws(apr_jose_t **jose, apr_json_value_t *val, bb->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, e); + if (level <= 0) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: too many nested JOSE payloads"); + return APR_EINVAL; + } + level--; + return apr_jose_decode( flags & APR_JOSE_FLAG_DECODE_ALL ? &(*jose)->jose.jws->payload : jose, typ, bb, cb, @@ -1442,6 +1463,13 @@ apr_status_t apr_jose_decode_json_jwe(apr_jose_t **jose, apr_json_value_t *val, if (decrypt == 1) { + if (level <= 0) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: too many nested JOSE payloads"); + return APR_EINVAL; + } + level--; + status = apr_jose_decode( flags & APR_JOSE_FLAG_DECODE_ALL ? &(*jose)->jose.jwe->payload : jose, typ, @@ -1518,6 +1546,13 @@ apr_status_t apr_jose_decode_json_jwe(apr_jose_t **jose, apr_json_value_t *val, if (APR_SUCCESS == status) { + if (level <= 0) { + apr_errprintf(&(*jose)->result, pool, NULL, 0, + "Syntax error: too many nested JOSE payloads"); + return APR_EINVAL; + } + level--; + return apr_jose_decode( flags & APR_JOSE_FLAG_DECODE_ALL ? &(*jose)->jose.jwe->payload : jose, typ, bb, From ed3d4ebd91de3e31f6c936d8b119b9966289e6d6 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Fri, 7 Sep 2018 19:01:36 +0000 Subject: [PATCH 7872/7878] Fix test coverage functionality git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1840316 13f79535-47bb-0310-9956-ffa450edef68 --- README | 2 +- build/run-gcov.sh | 51 +++++++++++++++++++++++++++++++++++++---------- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/README b/README index c97cd704601..8db12f9fa52 100644 --- a/README +++ b/README @@ -194,7 +194,7 @@ Generating Test Coverage information with gcc If you want to generate test coverage data, use the following steps: ./buildconf - CFLAGS="-fprofile-arcs -ftest-coverage" ./configure + CFLAGS="--coverage -fprofile-abs-path" LDFLAGS="--coverage" ./configure make cd test make diff --git a/build/run-gcov.sh b/build/run-gcov.sh index 98f911fc89a..d0e932d4f17 100755 --- a/build/run-gcov.sh +++ b/build/run-gcov.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash if [ ! -d coverage ]; then mkdir coverage @@ -85,20 +85,48 @@ but all tests should be moving to the unified framework, so this is correct.

    EOF -for i in `find .. -name "*.bb" -maxdepth 1 | sort`; do - percent=`gcov $i -o .. | grep "%" | awk -F'%' {'print $1'}` - name=`echo $i | awk -F'/' {'print $2'}` - basename=`echo $name | awk -F'.' {'print $1'}` +# Remind current dir, so that we can easily navigate in directories +pwd=`pwd` +# gcno files are created at compile time and gcna files at run-time +for i in `find ../.. -name "*.gcno" | sort`; do + # Skip test files + if [[ "$i" =~ "test" ]]; then + continue + fi + + # We are only intested in gcno files in .libs directories, because it there + # that we'll also find some gcna files + if ! [[ "$i" =~ "libs" ]]; then + continue + fi + + # Find the directory and base name of this gcno file + dir=`dirname -- "$i"` + basename=`basename "$i"` + filename="${basename%.*}" + + # Go to this directory + cd $dir + + # Get the % of test coverage for each of this file + percent=`gcov $filename.gcda | grep "%" | awk -F'%' {'print $1'} | awk -F':' {'print $2'}` + + # Come back to our base directory + cd $pwd + + # Process the data we have collected if [ "x$percent" = "x" ]; then echo "" >> index.html - echo "" >> index.html + echo "" >> index.html + continue; fi + intpercent=`echo "$percent/1" | bc` - if [ $intpercent -lt 33 ]; then + if [[ $intpercent -lt 33 ]]; then color="#ffaaaa" - else if [ $intpercent -lt 66 ]; then + else if [[ $intpercent -lt 66 ]]; then color="#ffff77" else color="#aaffaa" @@ -106,8 +134,9 @@ for i in `find .. -name "*.bb" -maxdepth 1 | sort`; do fi echo "" >> index.html - echo "" >> index.html + echo "" >> index.html + echo "" >> index.html done echo "
    Error generating data for $basename
    " >> index.html - continue; + echo "
    Error generating data for $filename
    $basename
    " >> index.html - echo "
    $percent% tested" >> index.html + echo "$filename$percent% tested

    Last generated `date`

    " >> index.html From 107602ab8ef69eb787b63747183d79163fdafe75 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 8 Sep 2018 18:07:36 +0000 Subject: [PATCH 7873/7878] Correct cut-n-paste assignment error. Submitted by: rjung git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1840372 13f79535-47bb-0310-9956-ffa450edef68 --- time/win32/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/time/win32/time.c b/time/win32/time.c index 6f459054178..02b272360ef 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -299,7 +299,7 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, /* The Platform SDK documents that SYSTEMTIME/FILETIME are * generally UTC, so no timezone info needed */ - if (tm->wMonth < 1 || tm->wMonth > 12) + if ((*ostime)->wMonth < 1 || (*ostime)->wMonth > 12) return APR_EBADDATE; SystemTimeToAprExpTime(aprtime, *ostime); From 2f61f960c81e4a45f3849baa7563812e7e526436 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 17 Sep 2018 15:50:19 +0000 Subject: [PATCH 7874/7878] Add in Atomics for 64bit ints git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1841078 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + apr.dsp | 4 + atomic/unix/builtins64.c | 64 +++++ atomic/unix/mutex64.c | 177 +++++++++++++ atomic/win32/apr_atomic64.c | 94 +++++++ include/apr_atomic.h | 67 +++++ include/arch/unix/apr_arch_atomic.h | 4 + test/testatomic.c | 387 ++++++++++++++++++++++++++++ 8 files changed, 799 insertions(+) create mode 100644 atomic/unix/builtins64.c create mode 100644 atomic/unix/mutex64.c create mode 100644 atomic/win32/apr_atomic64.c diff --git a/CHANGES b/CHANGES index 1cc69afaedd..88134dede72 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) Atomics: Support for 64bit ints. [Jim Jagielski] + *) apr_jose: Add support for encoding and decoding of JSON Object Signing and Encryption messages as per RFC7515, RFC7516, RFC7517 and RFC7519. [Graham Leggett] diff --git a/apr.dsp b/apr.dsp index c5b3f480d3f..38f3f1141c8 100644 --- a/apr.dsp +++ b/apr.dsp @@ -142,6 +142,10 @@ LIB32=link.exe -lib SOURCE=.\atomic\win32\apr_atomic.c # End Source File +# Begin Source File + +SOURCE=.\atomic\win32\apr_atomic64.c +# End Source File # End Group # Begin Group "buckets" diff --git a/atomic/unix/builtins64.c b/atomic/unix/builtins64.c new file mode 100644 index 00000000000..4a4b685c7ac --- /dev/null +++ b/atomic/unix/builtins64.c @@ -0,0 +1,64 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_arch_atomic.h" + +#ifdef USE_ATOMICS_BUILTINS + +APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem) +{ + return *mem; +} + +APR_DECLARE(void) apr_atomic_set64(volatile apr_uint64_t *mem, apr_uint64_t val) +{ + *mem = val; +} + +APR_DECLARE(apr_uint64_t) apr_atomic_add64(volatile apr_uint64_t *mem, apr_uint64_t val) +{ + return __sync_fetch_and_add(mem, val); +} + +APR_DECLARE(void) apr_atomic_sub64(volatile apr_uint64_t *mem, apr_uint64_t val) +{ + __sync_fetch_and_sub(mem, val); +} + +APR_DECLARE(apr_uint64_t) apr_atomic_inc64(volatile apr_uint64_t *mem) +{ + return __sync_fetch_and_add(mem, 1); +} + +APR_DECLARE(int) apr_atomic_dec64(volatile apr_uint64_t *mem) +{ + return __sync_sub_and_fetch(mem, 1); +} + +APR_DECLARE(apr_uint64_t) apr_atomic_cas64(volatile apr_uint64_t *mem, apr_uint64_t with, + apr_uint64_t cmp) +{ + return __sync_val_compare_and_swap(mem, cmp, with); +} + +APR_DECLARE(apr_uint64_t) apr_atomic_xchg64(volatile apr_uint64_t *mem, apr_uint64_t val) +{ + __sync_synchronize(); + + return __sync_lock_test_and_set(mem, val); +} + +#endif /* USE_ATOMICS_BUILTINS */ diff --git a/atomic/unix/mutex64.c b/atomic/unix/mutex64.c new file mode 100644 index 00000000000..10452413b4c --- /dev/null +++ b/atomic/unix/mutex64.c @@ -0,0 +1,177 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_arch_atomic.h" + +#if defined(USE_ATOMICS_GENERIC) || defined (NEED_ATOMICS_GENERIC64) + +#include + +#if APR_HAS_THREADS +# define DECLARE_MUTEX_LOCKED(name, mem) \ + apr_thread_mutex_t *name = mutex_hash(mem) +# define MUTEX_UNLOCK(name) \ + do { \ + if (apr_thread_mutex_unlock(name) != APR_SUCCESS) \ + abort(); \ + } while (0) +#else +# define DECLARE_MUTEX_LOCKED(name, mem) +# define MUTEX_UNLOCK(name) +# warning Be warned: using stubs for all atomic operations +#endif + +#if APR_HAS_THREADS + +static apr_thread_mutex_t **hash_mutex; + +#define NUM_ATOMIC_HASH 7 +/* shift by 2 to get rid of alignment issues */ +#define ATOMIC_HASH(x) (unsigned int)(((unsigned long)(x)>>2)%(unsigned int)NUM_ATOMIC_HASH) + +static apr_status_t atomic_cleanup(void *data) +{ + if (hash_mutex == data) + hash_mutex = NULL; + + return APR_SUCCESS; +} + +APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) +{ + int i; + apr_status_t rv; + + if (hash_mutex != NULL) + return APR_SUCCESS; + + hash_mutex = apr_palloc(p, sizeof(apr_thread_mutex_t*) * NUM_ATOMIC_HASH); + apr_pool_cleanup_register(p, hash_mutex, atomic_cleanup, + apr_pool_cleanup_null); + + for (i = 0; i < NUM_ATOMIC_HASH; i++) { + rv = apr_thread_mutex_create(&(hash_mutex[i]), + APR_THREAD_MUTEX_DEFAULT, p); + if (rv != APR_SUCCESS) { + return rv; + } + } + + return APR_SUCCESS; +} + +static APR_INLINE apr_thread_mutex_t *mutex_hash(volatile apr_uint64_t *mem) +{ + apr_thread_mutex_t *mutex = hash_mutex[ATOMIC_HASH(mem)]; + + if (apr_thread_mutex_lock(mutex) != APR_SUCCESS) { + abort(); + } + + return mutex; +} + +#else + +APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) +{ + return APR_SUCCESS; +} + +#endif /* APR_HAS_THREADS */ + +APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem) +{ + return *mem; +} + +APR_DECLARE(void) apr_atomic_set64(volatile apr_uint64_t *mem, apr_uint64_t val) +{ + DECLARE_MUTEX_LOCKED(mutex, mem); + + *mem = val; + + MUTEX_UNLOCK(mutex); +} + +APR_DECLARE(apr_uint64_t) apr_atomic_add64(volatile apr_uint64_t *mem, apr_uint64_t val) +{ + apr_uint64_t old_value; + DECLARE_MUTEX_LOCKED(mutex, mem); + + old_value = *mem; + *mem += val; + + MUTEX_UNLOCK(mutex); + + return old_value; +} + +APR_DECLARE(void) apr_atomic_sub64(volatile apr_uint64_t *mem, apr_uint64_t val) +{ + DECLARE_MUTEX_LOCKED(mutex, mem); + *mem -= val; + MUTEX_UNLOCK(mutex); +} + +APR_DECLARE(apr_uint64_t) apr_atomic_inc64(volatile apr_uint64_t *mem) +{ + return apr_atomic_add64(mem, 1); +} + +APR_DECLARE(int) apr_atomic_dec64(volatile apr_uint64_t *mem) +{ + apr_uint64_t new; + DECLARE_MUTEX_LOCKED(mutex, mem); + + (*mem)--; + new = *mem; + + MUTEX_UNLOCK(mutex); + + return new; +} + +APR_DECLARE(apr_uint64_t) apr_atomic_cas64(volatile apr_uint64_t *mem, apr_uint64_t with, + apr_uint64_t cmp) +{ + apr_uint64_t prev; + DECLARE_MUTEX_LOCKED(mutex, mem); + + prev = *mem; + if (prev == cmp) { + *mem = with; + } + + MUTEX_UNLOCK(mutex); + + return prev; +} + +APR_DECLARE(apr_uint64_t) apr_atomic_xchg64(volatile apr_uint64_t *mem, apr_uint64_t val) +{ + apr_uint64_t prev; + DECLARE_MUTEX_LOCKED(mutex, mem); + + prev = *mem; + *mem = val; + + MUTEX_UNLOCK(mutex); + + return prev; +} + +#endif /* USE_ATOMICS_GENERIC64 */ diff --git a/atomic/win32/apr_atomic64.c b/atomic/win32/apr_atomic64.c new file mode 100644 index 00000000000..a5acc945e40 --- /dev/null +++ b/atomic/win32/apr_atomic64.c @@ -0,0 +1,94 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr.h" +#include "apr_atomic.h" +#include "apr_thread_mutex.h" + +APR_DECLARE(apr_uint64_t) apr_atomic_add64(volatile apr_uint64_t *mem, apr_uint64_t val) +{ +#if (defined(_M_IA64) || defined(_M_AMD64)) + return InterlockedExchangeAdd64(mem, val); +#else + return InterlockedExchangeAdd64((long *)mem, val); +#endif +} + +/* Of course we want the 2's compliment of the unsigned value, val */ +#ifdef _MSC_VER +#pragma warning(disable: 4146) +#endif + +APR_DECLARE(void) apr_atomic_sub64(volatile apr_uint64_t *mem, apr_uint64_t val) +{ +#if (defined(_M_IA64) || defined(_M_AMD64)) + InterlockedExchangeAdd64(mem, -val); +#else + InterlockedExchangeAdd64((long *)mem, -val); +#endif +} + +APR_DECLARE(apr_uint64_t) apr_atomic_inc64(volatile apr_uint64_t *mem) +{ + /* we return old value, win64 returns new value :( */ +#if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) + return InterlockedIncrement64(mem) - 1; +#else + return InterlockedIncrement64((long *)mem) - 1; +#endif +} + +APR_DECLARE(int) apr_atomic_dec64(volatile apr_uint64_t *mem) +{ +#if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) + return InterlockedDecrement64(mem); +#else + return InterlockedDecrement64((long *)mem); +#endif +} + +APR_DECLARE(void) apr_atomic_set64(volatile apr_uint64_t *mem, apr_uint64_t val) +{ +#if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) + InterlockedExchange64(mem, val); +#else + InterlockedExchange64((long*)mem, val); +#endif +} + +APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem) +{ + return *mem; +} + +APR_DECLARE(apr_uint64_t) apr_atomic_cas64(volatile apr_uint64_t *mem, apr_uint64_t with, + apr_uint64_t cmp) +{ +#if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) + return InterlockedCompareExchange64(mem, with, cmp); +#else + return InterlockedCompareExchange64((long*)mem, with, cmp); +#endif +} + +APR_DECLARE(apr_uint64_t) apr_atomic_xchg64(volatile apr_uint64_t *mem, apr_uint64_t val) +{ +#if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) + return InterlockedExchange64(mem, val); +#else + return InterlockedExchange64((long *)mem, val); +#endif +} diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 4e7879000e9..7ac9aafc66c 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -113,6 +113,73 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3 */ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val); +/* + * Atomic operations on 64-bit values + * Note: Each of these functions internally implements a memory barrier + * on platforms that require it + */ + +/** + * atomically read an apr_uint64_t from memory + * @param mem the pointer + */ +APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem); + +/** + * atomically set an apr_uint64_t in memory + * @param mem pointer to the object + * @param val value that the object will assume + */ +APR_DECLARE(void) apr_atomic_set64(volatile apr_uint64_t *mem, apr_uint64_t val); + +/** + * atomically add 'val' to an apr_uint64_t + * @param mem pointer to the object + * @param val amount to add + * @return old value pointed to by mem + */ +APR_DECLARE(apr_uint64_t) apr_atomic_add64(volatile apr_uint64_t *mem, apr_uint64_t val); + +/** + * atomically subtract 'val' from an apr_uint64_t + * @param mem pointer to the object + * @param val amount to subtract + */ +APR_DECLARE(void) apr_atomic_sub64(volatile apr_uint64_t *mem, apr_uint64_t val); + +/** + * atomically increment an apr_uint64_t by 1 + * @param mem pointer to the object + * @return old value pointed to by mem + */ +APR_DECLARE(apr_uint64_t) apr_atomic_inc64(volatile apr_uint64_t *mem); + +/** + * atomically decrement an apr_uint64_t by 1 + * @param mem pointer to the atomic value + * @return zero if the value becomes zero on decrement, otherwise non-zero + */ +APR_DECLARE(int) apr_atomic_dec64(volatile apr_uint64_t *mem); + +/** + * compare an apr_uint64_t's value with 'cmp'. + * If they are the same swap the value with 'with' + * @param mem pointer to the value + * @param with what to swap it with + * @param cmp the value to compare it to + * @return the old value of *mem + */ +APR_DECLARE(apr_uint64_t) apr_atomic_cas64(volatile apr_uint64_t *mem, apr_uint64_t with, + apr_uint64_t cmp); + +/** + * exchange an apr_uint64_t's value with 'val'. + * @param mem pointer to the value + * @param val what to swap it with + * @return the old value of *mem + */ +APR_DECLARE(apr_uint64_t) apr_atomic_xchg64(volatile apr_uint64_t *mem, apr_uint64_t val); + /** * compare the pointer's value with cmp. * If they are the same swap the value with 'with' diff --git a/include/arch/unix/apr_arch_atomic.h b/include/arch/unix/apr_arch_atomic.h index f8019060e50..b590ab239db 100644 --- a/include/arch/unix/apr_arch_atomic.h +++ b/include/arch/unix/apr_arch_atomic.h @@ -34,12 +34,16 @@ # define USE_ATOMICS_SOLARIS #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) # define USE_ATOMICS_IA32 +# define NEED_ATOMICS_GENERIC64 #elif defined(__GNUC__) && (defined(__PPC__) || defined(__ppc__)) # define USE_ATOMICS_PPC +# define NEED_ATOMICS_GENERIC64 #elif defined(__GNUC__) && (defined(__s390__) || defined(__s390x__)) # define USE_ATOMICS_S390 +# define NEED_ATOMICS_GENERIC64 #else # define USE_ATOMICS_GENERIC +# define NEED_ATOMICS_GENERIC64 #endif #endif /* ATOMIC_H */ diff --git a/test/testatomic.c b/test/testatomic.c index 4bf2caa4688..e1213647794 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -230,15 +230,136 @@ static void test_inc_neg1(abts_case *tc, void *data) ABTS_ASSERT(tc, str, y32 == 0); } +static void test_set64(abts_case *tc, void *data) +{ + apr_uint64_t y64; + apr_atomic_set64(&y64, 2); + ABTS_INT_EQUAL(tc, 2, y64); +} + +static void test_read64(abts_case *tc, void *data) +{ + apr_uint64_t y64; + apr_atomic_set64(&y64, 2); + ABTS_INT_EQUAL(tc, 2, apr_atomic_read64(&y64)); +} + +static void test_dec64(abts_case *tc, void *data) +{ + apr_uint64_t y64; + int rv; + + apr_atomic_set64(&y64, 2); + + rv = apr_atomic_dec64(&y64); + ABTS_INT_EQUAL(tc, 1, y64); + ABTS_ASSERT(tc, "atomic_dec returned zero when it shouldn't", rv != 0); + + rv = apr_atomic_dec64(&y64); + ABTS_INT_EQUAL(tc, 0, y64); + ABTS_ASSERT(tc, "atomic_dec didn't returned zero when it should", rv == 0); +} + +static void test_xchg64(abts_case *tc, void *data) +{ + apr_uint64_t oldval; + apr_uint64_t y64; + + apr_atomic_set64(&y64, 100); + oldval = apr_atomic_xchg64(&y64, 50); + + ABTS_INT_EQUAL(tc, 100, oldval); + ABTS_INT_EQUAL(tc, 50, y64); +} + +static void test_add64(abts_case *tc, void *data) +{ + apr_uint64_t oldval; + apr_uint64_t y64; + + apr_atomic_set64(&y64, 23); + oldval = apr_atomic_add64(&y64, 4); + ABTS_INT_EQUAL(tc, 23, oldval); + ABTS_INT_EQUAL(tc, 27, y64); +} + +static void test_add64_neg(abts_case *tc, void *data) +{ + apr_uint64_t oldval; + apr_uint64_t y64; + + apr_atomic_set64(&y64, 23); + oldval = apr_atomic_add64(&y64, -10); + ABTS_INT_EQUAL(tc, 23, oldval); + ABTS_INT_EQUAL(tc, 13, y64); +} + +static void test_inc64(abts_case *tc, void *data) +{ + apr_uint64_t oldval; + apr_uint64_t y64; + + apr_atomic_set64(&y64, 23); + oldval = apr_atomic_inc64(&y64); + ABTS_INT_EQUAL(tc, 23, oldval); + ABTS_INT_EQUAL(tc, 24, y64); +} + +static void test_set_add_inc_sub64(abts_case *tc, void *data) +{ + apr_uint64_t y64; + + apr_atomic_set64(&y64, 0); + apr_atomic_add64(&y64, 20); + apr_atomic_inc64(&y64); + apr_atomic_sub64(&y64, 10); + + ABTS_INT_EQUAL(tc, 11, y64); +} + +static void test_wrap_zero64(abts_case *tc, void *data) +{ + apr_uint64_t y64; + apr_uint64_t rv; + apr_uint64_t minus1 = (apr_uint64_t)-1; + char *str; + + apr_atomic_set64(&y64, 0); + rv = apr_atomic_dec64(&y64); + + ABTS_ASSERT(tc, "apr_atomic_dec64 on zero returned zero.", rv != 0); + str = apr_psprintf(p, "zero wrap failed: 0 - 1 = %lu", y64); + ABTS_ASSERT(tc, str, y64 == minus1); +} + +static void test_inc_neg164(abts_case *tc, void *data) +{ + apr_uint64_t y64 = (apr_uint64_t)-1; + apr_uint64_t minus1 = (apr_uint64_t)-1; + apr_uint64_t rv; + char *str; + + rv = apr_atomic_inc64(&y64); + + ABTS_ASSERT(tc, "apr_atomic_inc64 didn't return the old value.", rv == minus1); + str = apr_psprintf(p, "zero wrap failed: -1 + 1 = %lu", y64); + ABTS_ASSERT(tc, str, y64 == 0); +} + #if APR_HAS_THREADS void *APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data); +void *APR_THREAD_FUNC thread_func_mutex64(apr_thread_t *thd, void *data); void *APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data); +void *APR_THREAD_FUNC thread_func_atomic64(apr_thread_t *thd, void *data); apr_thread_mutex_t *thread_lock; +apr_thread_mutex_t *thread_lock64; volatile apr_uint32_t mutex_locks = 0; +volatile apr_uint64_t mutex_locks64 = 0; volatile apr_uint32_t atomic_ops = 0; +volatile apr_uint64_t atomic_ops64 = 0; apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ #define NUM_THREADS 40 @@ -313,6 +434,7 @@ static void test_atomics_threaded(abts_case *tc, void *data) #define NUM_THREADS 7 typedef struct tbox_t tbox_t; +typedef struct tbox_t64 tbox_t64; struct tbox_t { abts_case *tc; @@ -501,6 +623,259 @@ static void test_atomics_busyloop_threaded(abts_case *tc, void *data) ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS); } +void *APR_THREAD_FUNC thread_func_mutex64(apr_thread_t *thd, void *data) +{ + int i; + + for (i = 0; i < NUM_ITERATIONS; i++) { + apr_thread_mutex_lock(thread_lock64); + mutex_locks64++; + apr_thread_mutex_unlock(thread_lock64); + } + apr_thread_exit(thd, exit_ret_val); + return NULL; +} + + +void *APR_THREAD_FUNC thread_func_atomic64(apr_thread_t *thd, void *data) +{ + int i; + + for (i = 0; i < NUM_ITERATIONS ; i++) { + apr_atomic_inc64(&atomic_ops64); + apr_atomic_add64(&atomic_ops64, 2); + apr_atomic_dec64(&atomic_ops64); + apr_atomic_dec64(&atomic_ops64); + } + apr_thread_exit(thd, exit_ret_val); + return NULL; +} + +static void test_atomics_threaded64(abts_case *tc, void *data) +{ + apr_thread_t *t1[NUM_THREADS]; + apr_thread_t *t2[NUM_THREADS]; + apr_status_t rv; + int i; + +#ifdef HAVE_PTHREAD_SETCONCURRENCY + pthread_setconcurrency(8); +#endif + + rv = apr_thread_mutex_create(&thread_lock64, APR_THREAD_MUTEX_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "Could not create lock", rv); + + for (i = 0; i < NUM_THREADS; i++) { + apr_status_t r1, r2; + r1 = apr_thread_create(&t1[i], NULL, thread_func_mutex64, NULL, p); + r2 = apr_thread_create(&t2[i], NULL, thread_func_atomic64, NULL, p); + ABTS_ASSERT(tc, "Failed creating threads", !r1 && !r2); + } + + for (i = 0; i < NUM_THREADS; i++) { + apr_status_t s1, s2; + apr_thread_join(&s1, t1[i]); + apr_thread_join(&s2, t2[i]); + + ABTS_ASSERT(tc, "Invalid return value from thread_join", + s1 == exit_ret_val && s2 == exit_ret_val); + } + + ABTS_INT_EQUAL(tc, NUM_THREADS * NUM_ITERATIONS, mutex_locks64); + ABTS_INT_EQUAL(tc, NUM_THREADS * NUM_ITERATIONS, + apr_atomic_read64(&atomic_ops64)); + + rv = apr_thread_mutex_destroy(thread_lock64); + ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS); +} + +struct tbox_t64 { + abts_case *tc; + apr_uint64_t *mem; + apr_uint64_t preval; + apr_uint64_t postval; + apr_uint64_t loop; + void (*func)(tbox_t64 *box); +}; + +static APR_INLINE void busyloop_read64(tbox_t64 *tbox) +{ + apr_uint64_t val; + + do { + val = apr_atomic_read64(tbox->mem); + + if (val != tbox->preval) + apr_thread_yield(); + else + break; + } while (1); +} + +static void busyloop_set64(tbox_t64 *tbox) +{ + do { + busyloop_read64(tbox); + apr_atomic_set64(tbox->mem, tbox->postval); + } while (--tbox->loop); +} + +static void busyloop_add64(tbox_t64 *tbox) +{ + apr_uint64_t val; + + do { + busyloop_read64(tbox); + val = apr_atomic_add64(tbox->mem, tbox->postval); + apr_thread_mutex_lock(thread_lock64); + ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); + apr_thread_mutex_unlock(thread_lock64); + } while (--tbox->loop); +} + +static void busyloop_sub64(tbox_t64 *tbox) +{ + do { + busyloop_read64(tbox); + apr_atomic_sub64(tbox->mem, tbox->postval); + } while (--tbox->loop); +} + +static void busyloop_inc64(tbox_t64 *tbox) +{ + apr_uint64_t val; + + do { + busyloop_read64(tbox); + val = apr_atomic_inc64(tbox->mem); + apr_thread_mutex_lock(thread_lock64); + ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); + apr_thread_mutex_unlock(thread_lock64); + } while (--tbox->loop); +} + +static void busyloop_dec64(tbox_t64 *tbox) +{ + apr_uint64_t val; + + do { + busyloop_read64(tbox); + val = apr_atomic_dec64(tbox->mem); + apr_thread_mutex_lock(thread_lock64); + ABTS_INT_NEQUAL(tbox->tc, 0, val); + apr_thread_mutex_unlock(thread_lock64); + } while (--tbox->loop); +} + +static void busyloop_cas64(tbox_t64 *tbox) +{ + apr_uint64_t val; + + do { + do { + val = apr_atomic_cas64(tbox->mem, tbox->postval, tbox->preval); + + if (val != tbox->preval) + apr_thread_yield(); + else + break; + } while (1); + } while (--tbox->loop); +} + +static void busyloop_xchg64(tbox_t64 *tbox) +{ + apr_uint64_t val; + + do { + busyloop_read64(tbox); + val = apr_atomic_xchg64(tbox->mem, tbox->postval); + apr_thread_mutex_lock(thread_lock64); + ABTS_INT_EQUAL(tbox->tc, val, tbox->preval); + apr_thread_mutex_unlock(thread_lock64); + } while (--tbox->loop); +} + +static void *APR_THREAD_FUNC thread_func_busyloop64(apr_thread_t *thd, void *data) +{ + tbox_t64 *tbox = data; + + tbox->func(tbox); + + apr_thread_exit(thd, 0); + + return NULL; +} + +static void test_atomics_busyloop_threaded64(abts_case *tc, void *data) +{ + unsigned int i; + apr_status_t rv; + apr_uint64_t count = 0; + tbox_t64 tbox[NUM_THREADS]; + apr_thread_t *thread[NUM_THREADS]; + + rv = apr_thread_mutex_create(&thread_lock64, APR_THREAD_MUTEX_DEFAULT, p); + APR_ASSERT_SUCCESS(tc, "Could not create lock", rv); + + /* get ready */ + for (i = 0; i < NUM_THREADS; i++) { + tbox[i].tc = tc; + tbox[i].mem = &count; + tbox[i].loop = 50; + } + + tbox[0].preval = 98; + tbox[0].postval = 3891; + tbox[0].func = busyloop_add64; + + tbox[1].preval = 3989; + tbox[1].postval = 1010; + tbox[1].func = busyloop_sub64; + + tbox[2].preval = 2979; + tbox[2].postval = 0; /* not used */ + tbox[2].func = busyloop_inc64; + + tbox[3].preval = 2980; + tbox[3].postval = 16384; + tbox[3].func = busyloop_set64; + + tbox[4].preval = 16384; + tbox[4].postval = 0; /* not used */ + tbox[4].func = busyloop_dec64; + + tbox[5].preval = 16383; + tbox[5].postval = 1048576; + tbox[5].func = busyloop_cas64; + + tbox[6].preval = 1048576; + tbox[6].postval = 98; /* goto tbox[0] */ + tbox[6].func = busyloop_xchg64; + + /* get set */ + for (i = 0; i < NUM_THREADS; i++) { + rv = apr_thread_create(&thread[i], NULL, thread_func_busyloop64, + &tbox[i], p); + ABTS_ASSERT(tc, "Failed creating thread", rv == APR_SUCCESS); + } + + /* go! */ + apr_atomic_set64(tbox->mem, 98); + + for (i = 0; i < NUM_THREADS; i++) { + apr_status_t retval; + rv = apr_thread_join(&retval, thread[i]); + ABTS_ASSERT(tc, "Thread join failed", rv == APR_SUCCESS); + ABTS_ASSERT(tc, "Invalid return value from thread_join", retval == 0); + } + + ABTS_INT_EQUAL(tbox->tc, 98, count); + + rv = apr_thread_mutex_destroy(thread_lock64); + ABTS_ASSERT(tc, "Failed creating threads", rv == APR_SUCCESS); +} + #endif /* !APR_HAS_THREADS */ abts_suite *testatomic(abts_suite *suite) @@ -525,10 +900,22 @@ abts_suite *testatomic(abts_suite *suite) abts_run_test(suite, test_set_add_inc_sub, NULL); abts_run_test(suite, test_wrap_zero, NULL); abts_run_test(suite, test_inc_neg1, NULL); + abts_run_test(suite, test_set64, NULL); + abts_run_test(suite, test_read64, NULL); + abts_run_test(suite, test_dec64, NULL); + abts_run_test(suite, test_xchg64, NULL); + abts_run_test(suite, test_add64, NULL); + abts_run_test(suite, test_add64_neg, NULL); + abts_run_test(suite, test_inc64, NULL); + abts_run_test(suite, test_set_add_inc_sub64, NULL); + abts_run_test(suite, test_wrap_zero64, NULL); + abts_run_test(suite, test_inc_neg164, NULL); #if APR_HAS_THREADS abts_run_test(suite, test_atomics_threaded, NULL); + abts_run_test(suite, test_atomics_threaded64, NULL); abts_run_test(suite, test_atomics_busyloop_threaded, NULL); + abts_run_test(suite, test_atomics_busyloop_threaded64, NULL); #endif return suite; From 4f0db3d425cdbad780b709164fdea2bb3621c203 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 4 Oct 2018 15:13:54 +0000 Subject: [PATCH 7875/7878] Untested but presumably this code was also -- found by Coverity: * dbd/apr_dbd_odbc.c (odbc_lob_bucket_read): Fix to allocate sizeof(apr_bucket) not sizeof(apr_bucket *). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1842824 13f79535-47bb-0310-9956-ffa450edef68 --- dbd/apr_dbd_odbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index 65306792026..552483d9baa 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -689,7 +689,7 @@ static apr_status_t odbc_lob_bucket_read(apr_bucket *e, const char **str, if (!eos) { /* Create a new LOB bucket to append and append it */ - nxt = apr_bucket_alloc(sizeof(apr_bucket *), e->list); + nxt = apr_bucket_alloc(sizeof *nxt, e->list); APR_BUCKET_INIT(nxt); nxt->length = -1; nxt->data = e->data; From 61d3533b23643dc308da8085abe44baf7d603a1e Mon Sep 17 00:00:00 2001 From: ckant787 <43432817+ckant787@users.noreply.github.com> Date: Thu, 18 Oct 2018 12:26:20 +0530 Subject: [PATCH 7876/7878] Update APRDesign.html --- docs/APRDesign.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/APRDesign.html b/docs/APRDesign.html index 0d6d6a5682e..e3bda91310f 100644 --- a/docs/APRDesign.html +++ b/docs/APRDesign.html @@ -114,7 +114,7 @@

    Directory Structure

    Each type has a base directory. Inside this base directory, are subdirectories, which contain the actual code. These subdirectories are named -after the platforms the are compiled on. Unix is also used as a common +after the platforms they are compiled on. Unix is also used as a common directory. If the code you are writing is POSIX based, you should look at the code in the unix directory. A good rule of thumb, is that if more than half your code needs to be ifdef'ed out, and the structures required for your code From b97f23765feb3aab72bc2f38f0b5e29df9d65bcd Mon Sep 17 00:00:00 2001 From: ckant787 <43432817+ckant787@users.noreply.github.com> Date: Thu, 25 Oct 2018 09:08:22 +0530 Subject: [PATCH 7877/7878] Update canonical_filenames.html --- docs/canonical_filenames.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/canonical_filenames.html b/docs/canonical_filenames.html index c1c03b1d543..41dbc8c422e 100644 --- a/docs/canonical_filenames.html +++ b/docs/canonical_filenames.html @@ -69,7 +69,7 @@

    Requirements

    ambiguities. Methods employed include comparison of device and inode file uniqifiers, which is a fairly fast operation, or querying the OS for the true form of the name, which can be much slower. Only the -acknowledgement of the file names by the OS can validate the equality +acknowledgment of the file names by the OS can validate the equality of two different cases of the same filename.

    The sixth discrepancy, illegal or insignificant characters, is especially From 12be8f95e7efd09dc477fb6ce8975e4964321840 Mon Sep 17 00:00:00 2001 From: ckant787 <43432817+ckant787@users.noreply.github.com> Date: Thu, 25 Oct 2018 09:14:33 +0530 Subject: [PATCH 7878/7878] Update incomplete_types --- docs/incomplete_types | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/incomplete_types b/docs/incomplete_types index 08b0c0a522e..ddea3f1f10c 100644 --- a/docs/incomplete_types +++ b/docs/incomplete_types @@ -57,7 +57,7 @@ And then in the definition for ap_file_t, we could say: filetype filedes; This gets rid of some of the complexity, by moving it off to the side, but -it is still not safe for a programmers to access the filedes field directly +it is still not safe for a programmer to access the filedes field directly outside of APR, because the programmer has no way of knowing what the actual type is. So for example printing the filedes using printf would yield wildly varying results on Windows and OS2 when compared to Unix.

      * rv = apr_proc_wait_all_procs(&proc, &exitcode, &status, APR_WAIT, p);
    @@ -699,18 +695,34 @@ APR_DECLARE(apr_status_t) apr_proc_other_child_alert(apr_proc_t *proc,
                                                          int reason,
                                                          int status);
     
    +/**
    + * Test one specific other child processes and invoke the maintenance callback 
    + * with the appropriate reason code, if still running, or the appropriate reason 
    + * code if the process is no longer healthy.
    + * @param ocr The registered other child
    + * @param reason The reason code (e.g. APR_OC_REASON_RESTART) if still running
    + */
     APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr,
                                                    int reason);
     
    +/**
    + * Test all registered other child processes and invoke the maintenance callback 
    + * with the appropriate reason code, if still running, or the appropriate reason 
    + * code if the process is no longer healthy.
    + * @param reason The reason code (e.g. APR_OC_REASON_RESTART) to running processes
    + */
     APR_DECLARE(void) apr_proc_other_child_refresh_all(int reason);
     
    -/** @deprecated 
    - * @see apr_proc_other_child_refresh_all(APR_OC_REASON_RESTART)
    +/** @deprecated @see apr_proc_other_child_refresh_all
    + * @remark Call apr_proc_other_child_refresh_all(APR_OC_REASON_RESTART)
    + * or apr_proc_other_child_refresh_all(APR_OC_REASON_RUNNING) instead.
    + * @bug The differing implementations of this function on Win32 (_RUNNING checks) 
    + * and Unix (used only for _RESTART) are the reason it will be dropped with APR 1.0.
      */
     APR_DECLARE(void) apr_proc_other_child_check(void);
     
    -/** @deprecated 
    - * @see apr_proc_other_child_alert()
    +/** @deprecated @see apr_proc_other_child_alert
    + * @bug This function's name had nothing to do with it's purpose
      */
     APR_DECLARE(apr_status_t) apr_proc_other_child_read(apr_proc_t *proc, int status);
     
    @@ -766,7 +778,9 @@ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum));
     APR_POOL_DECLARE_ACCESSOR(thread);
     
     #endif /* APR_HAS_THREADS */
    +
     /** @} */
    +
     #ifdef __cplusplus
     }
     #endif
    diff --git a/include/apr_thread_rwlock.h b/include/apr_thread_rwlock.h
    index 9f906abe74f..210d2ec1323 100644
    --- a/include/apr_thread_rwlock.h
    +++ b/include/apr_thread_rwlock.h
    @@ -55,6 +55,11 @@
     #ifndef APR_THREAD_RWLOCK_H
     #define APR_THREAD_RWLOCK_H
     
    +/**
    + * @file apr_thread_rwlock.h
    + * @brief APR Reader/Writer Lock Routines
    + */
    +
     #include "apr.h"
     #include "apr_pools.h"
     #include "apr_errno.h"
    @@ -66,13 +71,8 @@ extern "C" {
     #if APR_HAS_THREADS
     
     /**
    - * @file apr_thread_rwlock.h
    - * @brief APR Thread RWLock Routines
    - */
    -
    -/**
    - * @defgroup APR_ThreadRWLock Thread RWLock Routines
    - * @ingroup APR
    + * @defgroup apr_thread_rwlock Reader/Writer Lock Routines
    + * @ingroup APR 
      * @{
      */
     
    @@ -149,6 +149,8 @@ APR_POOL_DECLARE_ACCESSOR(thread_rwlock);
     
     #endif  /* APR_HAS_THREADS */
     
    +/** @} */
    +
     #ifdef __cplusplus
     }
     #endif
    diff --git a/include/apr_time.h b/include/apr_time.h
    index bc5a7f145a6..60ae2de866f 100644
    --- a/include/apr_time.h
    +++ b/include/apr_time.h
    @@ -55,6 +55,11 @@
     #ifndef APR_TIME_H
     #define APR_TIME_H
     
    +/**
    + * @file apr_time.h
    + * @brief APR Time Library
    + */
    +
     #include "apr.h"
     #include "apr_pools.h"
     #include "apr_errno.h"
    @@ -62,15 +67,13 @@
     #ifdef __cplusplus
     extern "C" {
     #endif /* __cplusplus */
    +
     /**
    - * @file apr_time.h
    - * @brief APR Time Library
    - */
    -/**
    - * @defgroup APR_Time Time Routines
    - * @ingroup APR
    + * @defgroup apr_time Time Routines
    + * @ingroup APR 
      * @{
      */
    +
     /** month names */
     APR_DECLARE_DATA extern const char apr_month_snames[12][4];
     /** day names */
    @@ -229,9 +232,9 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t);
     #define APR_RFC822_DATE_LEN (30)
     /**
      * apr_rfc822_date formats dates in the RFC822
    - * format in an efficient manner.  it is a fixed length
    - * format and requires the indicated amount of storage
    - * including trailing \0
    + * format in an efficient manner.  It is a fixed length
    + * format which requires the indicated amount of storage,
    + * including the trailing null byte.
      * @param date_str String to write to.
      * @param t the time to convert 
      */
    @@ -242,10 +245,10 @@ APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t);
     /**
      * apr_ctime formats dates in the ctime() format
      * in an efficient manner.  it is a fixed length format
    - * and requires the indicated amount of storage
    + * and requires the indicated amount of storage including
    + * the trailing null byte.
      * Unlike ANSI/ISO C ctime(), apr_ctime() does not include
      * a \n at the end of the string.
    - * including trailing \0 
      * @param date_str String to write to.
      * @param t the time to convert 
      */
    @@ -271,6 +274,8 @@ APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize,
      */
     APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p);
     
    +/** @} */
    +
     #ifdef __cplusplus
     }
     #endif
    diff --git a/include/apr_user.h b/include/apr_user.h
    index 3b8648ec53e..4b70c5c2437 100644
    --- a/include/apr_user.h
    +++ b/include/apr_user.h
    @@ -55,6 +55,11 @@
     #ifndef APR_USER_H
     #define APR_USER_H
     
    +/**
    + * @file apr_user.h
    + * @brief APR User ID Services 
    + */
    +
     #include "apr.h"
     #include "apr_errno.h"
     #include "apr_pools.h"
    @@ -64,12 +69,8 @@ extern "C" {
     #endif /* __cplusplus */
     
     /**
    - * @file apr_user.h
    - * @brief APR User ID Services 
    - */
    -/**
    - * @defgroup APR_User User id services
    - * @ingroup APR
    + * @defgroup apr_user User and Group ID Services
    + * @ingroup APR 
      * @{
      */
     
    @@ -224,6 +225,7 @@ APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right);
     #endif  /* ! APR_HAS_USER */
     
     /** @} */
    +
     #ifdef __cplusplus
     }
     #endif
    diff --git a/include/apr_version.h b/include/apr_version.h
    index 2629b840018..ce3fdc3e236 100644
    --- a/include/apr_version.h
    +++ b/include/apr_version.h
    @@ -63,7 +63,7 @@ extern "C" {
     
     /**
      * @file apr_version.h
    - * @brief 
    + * @brief APR Versioning Interface
      * 
      * APR's Version
      *
    diff --git a/include/apr_want.h b/include/apr_want.h
    index 7ab68109006..27a27be0b29 100644
    --- a/include/apr_want.h
    +++ b/include/apr_want.h
    @@ -55,7 +55,7 @@
     #include "apr.h"        /* configuration data */
     /**
      * @file apr_want.h
    - * @brief APR_WANT_HEADERS documentation
    + * @brief APR Standard Headers Support
      *
      * 
      * Features:
    
    From 3c967d961674ef91161f3c77de6f4a02a88c8f74 Mon Sep 17 00:00:00 2001
    From: Justin Erenkrantz 
    Date: Thu, 6 Mar 2003 00:14:41 +0000
    Subject: [PATCH 4378/7878] Add --installbuilddir option to apr-config
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64398 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr-config.in | 12 ++++++++++++
     1 file changed, 12 insertions(+)
    
    diff --git a/apr-config.in b/apr-config.in
    index 643d0d79d7b..ed7bbfabbc5 100644
    --- a/apr-config.in
    +++ b/apr-config.in
    @@ -95,6 +95,7 @@ Known values for OPTION are:
       --ldflags         print linker flags
       --libs            print additional libraries to link against
       --srcdir          print APR source directory
    +  --installbuilddir print APR build helper directory
       --link-ld         print link switch(es) for linking to APR
       --link-libtool    print the libtool inputs for linking to APR
       --shlib-path-var  print the name of the shared library path env var
    @@ -207,6 +208,17 @@ while test $# -gt 0; do
         echo $APR_SOURCE_DIR
         exit 0
         ;;
    +    --installbuilddir)
    +    if test "$location" = "installed"; then
    +        echo "${installbuilddir}"
    +    elif test "$location" = "source"; then
    +        echo "$APR_SOURCE_DIR/build"
    +    else
    +        # this is for VPATH builds
    +        echo "$thisdir/build"
    +    fi
    +    exit 0
    +    ;;
         --version)
         echo $APR_DOTTED_VERSION
         exit 0
    
    From 5f08ce3cd96e19839847cddde5bc0ed57c6f22a6 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Thu, 6 Mar 2003 01:33:30 +0000
    Subject: [PATCH 4379/7878]   Outch, these shouldn't vary, should be in alpha
     order, and most importantly,   anything in apr/include/*.h* should be in the
     list of public headers :-)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64399 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr.dsp    | 20 ++++++++++++++++++++
     libapr.dsp | 24 ++++++++++++++++++++++--
     2 files changed, 42 insertions(+), 2 deletions(-)
    
    diff --git a/apr.dsp b/apr.dsp
    index 5370abee4d4..dd63ecd3d09 100644
    --- a/apr.dsp
    +++ b/apr.dsp
    @@ -484,6 +484,14 @@ InputPath=.\include\apr.hw
     # End Source File
     # Begin Source File
     
    +SOURCE=.\include\apr_allocator.h
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\include\apr_atomic.h
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\apr_compat.h
     # End Source File
     # Begin Source File
    @@ -544,6 +552,10 @@ SOURCE=.\include\apr_network_io.h
     # End Source File
     # Begin Source File
     
    +SOURCE=.\include\apr_poll.h
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\apr_pools.h
     # End Source File
     # Begin Source File
    @@ -568,6 +580,10 @@ SOURCE=.\include\apr_signal.h
     # End Source File
     # Begin Source File
     
    +SOURCE=.\include\apr_support.h
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\apr_strings.h
     # End Source File
     # Begin Source File
    @@ -600,6 +616,10 @@ SOURCE=.\include\apr_user.h
     # End Source File
     # Begin Source File
     
    +SOURCE=.\include\apr_version.h
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\apr_want.h
     # End Source File
     # End Group
    diff --git a/libapr.dsp b/libapr.dsp
    index a8b3d7cc9a0..fec5db4960b 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -499,6 +499,14 @@ InputPath=.\include\apr.hw
     # End Source File
     # Begin Source File
     
    +SOURCE=.\include\apr_allocator.h
    +# End Source File
    +# Begin Source File
    +
    +SOURCE=.\include\apr_atomic.h
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\apr_compat.h
     # End Source File
     # Begin Source File
    @@ -507,11 +515,11 @@ SOURCE=.\include\apr_dso.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\apr_errno.h
    +SOURCE=.\include\apr_env.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\apr_env.h
    +SOURCE=.\include\apr_errno.h
     # End Source File
     # Begin Source File
     
    @@ -559,6 +567,10 @@ SOURCE=.\include\apr_network_io.h
     # End Source File
     # Begin Source File
     
    +SOURCE=.\include\apr_poll.h
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\apr_pools.h
     # End Source File
     # Begin Source File
    @@ -583,6 +595,10 @@ SOURCE=.\include\apr_signal.h
     # End Source File
     # Begin Source File
     
    +SOURCE=.\include\apr_support.h
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\apr_strings.h
     # End Source File
     # Begin Source File
    @@ -615,6 +631,10 @@ SOURCE=.\include\apr_user.h
     # End Source File
     # Begin Source File
     
    +SOURCE=.\include\apr_version.h
    +# End Source File
    +# Begin Source File
    +
     SOURCE=.\include\apr_want.h
     # End Source File
     # End Group
    
    From d7a2584b2ef9f6a9d5cf94c00481ad5f603962ce Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Thu, 6 Mar 2003 08:56:04 +0000
    Subject: [PATCH 4380/7878] Make apr_file_inherit_set/unset work for pipes
     created by Unix apr_file_pipe_create() implementation.
    
    Submitted by: Joe Orton, Bjoern A. Zeeb 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64400 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/pipe.c | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c
    index 8b6fe6b3441..97628682b67 100644
    --- a/file_io/unix/pipe.c
    +++ b/file_io/unix/pipe.c
    @@ -56,6 +56,8 @@
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    +#include "apr_arch_inherit.h"
    +
     /* Figure out how to get pipe block/nonblock on BeOS...
      * Basically, BONE7 changed things again so that ioctl didn't work,
      * but now fcntl does, hence we need to do this extra checking.
    @@ -208,6 +210,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out
         (*in)->blocking = BLK_ON;
         (*in)->timeout = -1;
         (*in)->ungetchar = -1;
    +    (*in)->flags = APR_INHERIT;
     #if APR_HAS_THREADS
         (*in)->thlock = NULL;
     #endif
    @@ -219,6 +222,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out
         (*out)->fname = NULL;
         (*out)->buffered = 0;
         (*out)->blocking = BLK_ON;
    +    (*out)->flags = APR_INHERIT;
         (*out)->timeout = -1;
     #if APR_HAS_THREADS
         (*out)->thlock = NULL;
    
    From f3a445c06f7abf5842f5c36941efe793f7a791c3 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Thu, 6 Mar 2003 09:21:24 +0000
    Subject: [PATCH 4381/7878] Fix the 'test_buffered_write_size' test by ensuring
     that buffered files are flushed before calling fstat.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64401 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/filestat.c | 6 ++++++
     1 file changed, 6 insertions(+)
    
    diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c
    index 26deb1413e9..0e0236e6bb4 100644
    --- a/file_io/unix/filestat.c
    +++ b/file_io/unix/filestat.c
    @@ -131,6 +131,12 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo,
     {
         struct stat info;
     
    +    if (thefile->buffered) {
    +        apr_status_t rv = apr_file_flush(thefile);
    +        if (rv != APR_SUCCESS)
    +            return rv;
    +    }
    +
         if (fstat(thefile->filedes, &info) == 0) {
             finfo->pool = thefile->pool;
             finfo->fname = thefile->fname;
    
    From 78607d203d98f9b808c63cea94b22338b7e0b2d7 Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Thu, 6 Mar 2003 09:24:17 +0000
    Subject: [PATCH 4382/7878] Eliminate a local variable in
     apr_unix_file_cleanup.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64402 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/unix/open.c | 4 +---
     1 file changed, 1 insertion(+), 3 deletions(-)
    
    diff --git a/file_io/unix/open.c b/file_io/unix/open.c
    index 3ced8dfc9cd..76a727adb89 100644
    --- a/file_io/unix/open.c
    +++ b/file_io/unix/open.c
    @@ -68,13 +68,11 @@ apr_status_t apr_unix_file_cleanup(void *thefile)
     {
         apr_file_t *file = thefile;
         apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS;
    -    int rc;
     
         if (file->buffered) {
             flush_rv = apr_file_flush(file);
         }
    -    rc = close(file->filedes);
    -    if (rc == 0) {
    +    if (close(file->filedes) == 0) {
             file->filedes = -1;
             if (file->flags & APR_DELONCLOSE) {
                 unlink(file->fname);
    
    From 0ab1fbe90dbcee19a1e242af5d2d8952ed18f3b1 Mon Sep 17 00:00:00 2001
    From: Sander Striker 
    Date: Thu, 6 Mar 2003 12:21:17 +0000
    Subject: [PATCH 4383/7878] Consistently fail on all platforms.
    
    * mmap/unix/mmap.c
    
      (apr_mmap_create): return APR_EINVAL when size == 0.
    
    * mmap/win32/mmap.c
    
      (apr_mmap_create): return APR_EINVAL when size == 0.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64403 13f79535-47bb-0310-9956-ffa450edef68
    ---
     mmap/unix/mmap.c  | 3 +++
     mmap/win32/mmap.c | 3 +++
     2 files changed, 6 insertions(+)
    
    diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c
    index e557f615dbc..2503f5438bf 100644
    --- a/mmap/unix/mmap.c
    +++ b/mmap/unix/mmap.c
    @@ -122,6 +122,9 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new,
         apr_int32_t native_flags = 0;
     #endif
     
    +    if (size == 0)
    +        return APR_EINVAL;
    +    
         if (file == NULL || file->filedes == -1 || file->buffered)
             return APR_EBADF;
         (*new) = (apr_mmap_t *)apr_pcalloc(cont, sizeof(apr_mmap_t));
    diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c
    index 993ef5fbf04..b8380d5cb19 100644
    --- a/mmap/win32/mmap.c
    +++ b/mmap/win32/mmap.c
    @@ -114,6 +114,9 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file,
         DWORD offlo;
         DWORD offhi;
     
    +    if (size == 0)
    +        return APR_EINVAL;
    +    
         if (flag & APR_MMAP_WRITE)
             fmaccess |= PAGE_READWRITE;
         else if (flag & APR_MMAP_READ)
    
    From 3359f6fc0e4cbc1ab0b05cacc0a0bc7a4abbcbd0 Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 7 Mar 2003 12:09:53 +0000
    Subject: [PATCH 4384/7878] un-rearrange some of the header file includes
    
    there is an interdependency between apr_allocator.h and
    apr_pools.h that must be resolved before the order
    restrictions can be removed
    
    prior to this commit, Apache's exports.c could fail to
    compile when building with an out-of-tree APR because
    the order of inclusion in that case exposed the problem
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64404 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_allocator.h | 5 +++--
     1 file changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/include/apr_allocator.h b/include/apr_allocator.h
    index a07cd65578b..cc58e647fe0 100644
    --- a/include/apr_allocator.h
    +++ b/include/apr_allocator.h
    @@ -64,8 +64,6 @@
     #include "apr_errno.h"
     #define APR_WANT_MEMFUNC /**< For no good reason? */
     #include "apr_want.h"
    -#include "apr_pools.h"
    -#include "apr_thread_mutex.h"
     
     #ifdef __cplusplus
     extern "C" {
    @@ -130,6 +128,7 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator,
     APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator,
                                          apr_memnode_t *memnode);
     
    +#include "apr_pools.h"
     
     /**
      * Set the owner of the allocator
    @@ -172,6 +171,8 @@ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator,
     APR_DECLARE(void) apr_allocator_set_max_free(apr_allocator_t *allocator,
                                                  apr_size_t size);
     
    +#include "apr_thread_mutex.h"
    +
     #if APR_HAS_THREADS
     /**
      * Set a mutex for the allocator to use
    
    From b79c1ebcfa1ea86ec9630803e42287b3b080f77c Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 7 Mar 2003 12:12:40 +0000
    Subject: [PATCH 4385/7878] change APR_CHECK_APR_DEFINE to find header files
     via the INCLUDES setting rather than via a path passed in via the caller
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64405 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_common.m4 | 15 ++++++++-------
     1 file changed, 8 insertions(+), 7 deletions(-)
    
    diff --git a/build/apr_common.m4 b/build/apr_common.m4
    index a3d90d63f8c..8cc16b37abe 100644
    --- a/build/apr_common.m4
    +++ b/build/apr_common.m4
    @@ -271,15 +271,16 @@ YES_IS_DEFINED
     ])
     
     dnl
    -dnl APR_CHECK_APR_DEFINE( symbol, path_to_apr )
    +dnl APR_CHECK_APR_DEFINE( symbol )
     dnl
     AC_DEFUN(APR_CHECK_APR_DEFINE,[
    -    AC_EGREP_CPP(YES_IS_DEFINED, [
    -#include "$2/include/apr.h"
    -#if $1
    -YES_IS_DEFINED
    -#endif
    -    ], ac_cv_define_$1=yes, ac_cv_define_$1=no)
    +apr_old_cppflags=$CPPFLAGS
    +CPPFLAGS="$CPPFLAGS $INCLUDES"
    +AC_TRY_COMPILE([#include ], [
    +#if !$1
    +#error APR does not have $1
    +#endif], ac_cv_define_$1=yes, ac_cv_define_$1=no)
    +CPPFLAGS=$apr_old_cppflags
     ])
     
     dnl APR_CHECK_FILE(filename); set ac_cv_file_filename to
    
    From 21ad310bd3189869af4cec06aead4fd55a728579 Mon Sep 17 00:00:00 2001
    From: Sander Striker 
    Date: Fri, 7 Mar 2003 12:12:43 +0000
    Subject: [PATCH 4386/7878] * memory/unix/apr_pools.c
    
      (apr_pool_check_integrity): Only log when being verbose.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64406 13f79535-47bb-0310-9956-ffa450edef68
    ---
     memory/unix/apr_pools.c | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
    index 0338233e2ef..22dad218fc9 100644
    --- a/memory/unix/apr_pools.c
    +++ b/memory/unix/apr_pools.c
    @@ -1219,9 +1219,10 @@ static void apr_pool_check_integrity(apr_pool_t *pool)
          */
     #if (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME)
         if (!apr_pool_is_child_of(pool, global_pool)) {
    +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
             apr_pool_log_event(pool, "LIFE",
                                __FILE__ ":apr_pool_integrity check", 0);
    -
    +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
             abort();
         }
     #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) */
    @@ -1229,8 +1230,10 @@ static void apr_pool_check_integrity(apr_pool_t *pool)
     #if (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER)
     #if APR_HAS_THREADS
         if (!apr_os_thread_equal(pool->owner, apr_os_thread_current())) {
    +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL)
             apr_pool_log_event(pool, "THREAD",
                                __FILE__ ":apr_pool_integrity check", 0);
    +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
             abort();
         }
     #endif /* APR_HAS_THREADS */
    
    From c1a0d7bd5d7354c7f926234a032ee7391dd67c8b Mon Sep 17 00:00:00 2001
    From: Jeff Trawick 
    Date: Fri, 7 Mar 2003 12:41:26 +0000
    Subject: [PATCH 4387/7878] don't compile for a test when preprocessing is
     sufficient
    
    Submitted by:	Joe Orton
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64407 13f79535-47bb-0310-9956-ffa450edef68
    ---
     build/apr_common.m4 | 10 ++++++----
     1 file changed, 6 insertions(+), 4 deletions(-)
    
    diff --git a/build/apr_common.m4 b/build/apr_common.m4
    index 8cc16b37abe..8dbe89423c5 100644
    --- a/build/apr_common.m4
    +++ b/build/apr_common.m4
    @@ -276,10 +276,12 @@ dnl
     AC_DEFUN(APR_CHECK_APR_DEFINE,[
     apr_old_cppflags=$CPPFLAGS
     CPPFLAGS="$CPPFLAGS $INCLUDES"
    -AC_TRY_COMPILE([#include ], [
    -#if !$1
    -#error APR does not have $1
    -#endif], ac_cv_define_$1=yes, ac_cv_define_$1=no)
    +AC_EGREP_CPP(YES_IS_DEFINED, [
    +#include 
    +#if $1
    +YES_IS_DEFINED
    +#endif
    +], ac_cv_define_$1=yes, ac_cv_define_$1=no)
     CPPFLAGS=$apr_old_cppflags
     ])
     
    
    From 11ef7bb7e9be4fce7ed2079dfd6efe59c760eed0 Mon Sep 17 00:00:00 2001
    From: Branko Cibej 
    Date: Fri, 7 Mar 2003 19:05:54 +0000
    Subject: [PATCH 4388/7878] Check for nl_langinfo and friends at configure
     time, and include apr_private.h in misc/unix/charset.c so that the Unix
     version of apr_os_locale_encoding actually has a chance to return something
     different from apr_os_default_encoding.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64408 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in        | 6 ++++++
     misc/unix/charset.c | 1 +
     2 files changed, 7 insertions(+)
    
    diff --git a/configure.in b/configure.in
    index 80432527561..52a4d9e680c 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -1833,6 +1833,12 @@ fi
     
     AC_SUBST(have_ipv6)
     
    +dnl Check for langinfo support
    +
    +APR_FLAG_HEADERS(langinfo.h)
    +APR_FLAG_FUNCS(nl_langinfo)
    +APR_CHECK_DEFINE(CODESET, langinfo.h, [CODESET defined in langinfo.h])
    +
     dnl ----------------------------- Finalize the variables
     
     echo "${nl}Restore user-defined environment settings..."
    diff --git a/misc/unix/charset.c b/misc/unix/charset.c
    index 96886485fee..aa41a79f414 100644
    --- a/misc/unix/charset.c
    +++ b/misc/unix/charset.c
    @@ -53,6 +53,7 @@
      */
     
     #include "apr.h"
    +#include "apr_private.h"
     #include "apr_strings.h"
     #include "apr_portable.h"
     
    
    From 8a28a96f584122f6e9134b29af4947dae793a1fe Mon Sep 17 00:00:00 2001
    From: Branko Cibej 
    Date: Fri, 7 Mar 2003 19:21:29 +0000
    Subject: [PATCH 4389/7878] Fix the 'test_buffered_write_size' test by ensuring
     that buffered files are flushed before calling fstat.
    
    [Port of jorton's rev. 1.65 commit of apr/file_io/unix/filestat.c]
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64409 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filestat.c | 6 ++++++
     1 file changed, 6 insertions(+)
    
    diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
    index a7f922d9cfa..f944171066c 100644
    --- a/file_io/win32/filestat.c
    +++ b/file_io/win32/filestat.c
    @@ -411,6 +411,12 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want
     {
         BY_HANDLE_FILE_INFORMATION FileInfo;
     
    +    if (thefile->buffered) {
    +        apr_status_t rv = apr_file_flush(thefile);
    +        if (rv != APR_SUCCESS)
    +            return rv;
    +    }
    +
         if (!GetFileInformationByHandle(thefile->filehand, &FileInfo)) {
             return apr_get_os_error();
         }
    
    From 0c9a106fe2817c6088c5418ee97800e93b40c74b Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Fri, 7 Mar 2003 21:38:40 +0000
    Subject: [PATCH 4390/7878]   One fewer namespace collisions (effective with
     1.0 of APR)
    
    Submitted by: Craig Rodrigues 
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64410 13f79535-47bb-0310-9956-ffa450edef68
    ---
     STATUS | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/STATUS b/STATUS
    index ef26c4d9306..e00bd33176d 100644
    --- a/STATUS
    +++ b/STATUS
    @@ -1,5 +1,5 @@
     APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS:			-*-text-*-
    -Last modified at [$Date: 2003/02/24 23:21:11 $]
    +Last modified at [$Date: 2003/03/07 21:38:40 $]
     
     Release:
     
    @@ -25,7 +25,6 @@ RELEASE SHOWSTOPPERS:
           (Those problems have been fixed, but it is a good example of
           what to look for.)
           Some headers with issues: 
    -        apr_md5.h             (MD5_DIGESTSIZE)
             apr.hnw               (READDIR_IS_THREAD_SAFE, ENUM_BITFIELD, 
                                   _POSIX_THREAD_SAFE_FUNCTIONS (?))
             apr.hw                (NO_USE_SIGACTION)
    
    From 14ccf3f07be393ba62848ca3c58c75fa761efeda Mon Sep 17 00:00:00 2001
    From: Joe Orton 
    Date: Mon, 10 Mar 2003 09:50:38 +0000
    Subject: [PATCH 4391/7878] Tidy up langinfo checks: the results of these
     checks aren't exported via apr.h, so there is no need to use APR_FLAG_*, and
     no need to check for CODESET in configure.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64411 13f79535-47bb-0310-9956-ffa450edef68
    ---
     configure.in        | 5 ++---
     misc/unix/charset.c | 2 +-
     2 files changed, 3 insertions(+), 4 deletions(-)
    
    diff --git a/configure.in b/configure.in
    index 52a4d9e680c..85074066f56 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -1835,9 +1835,8 @@ AC_SUBST(have_ipv6)
     
     dnl Check for langinfo support
     
    -APR_FLAG_HEADERS(langinfo.h)
    -APR_FLAG_FUNCS(nl_langinfo)
    -APR_CHECK_DEFINE(CODESET, langinfo.h, [CODESET defined in langinfo.h])
    +AC_CHECK_HEADERS(langinfo.h)
    +AC_CHECK_FUNCS(nl_langinfo)
     
     dnl ----------------------------- Finalize the variables
     
    diff --git a/misc/unix/charset.c b/misc/unix/charset.c
    index aa41a79f414..90528e0226f 100644
    --- a/misc/unix/charset.c
    +++ b/misc/unix/charset.c
    @@ -103,7 +103,7 @@ APR_DECLARE(const char*) apr_os_default_encoding (apr_pool_t *pool)
     
     APR_DECLARE(const char*) apr_os_locale_encoding (apr_pool_t *pool)
     {
    -#if defined(HAVE_NL_LANGINFO) && defined(HAVE_CODESET)
    +#if defined(HAVE_NL_LANGINFO) && defined(CODESET)
         const char *charset;
     
         charset = nl_langinfo(CODESET);
    
    From a73683799ea59664378473157d1d835d06078a4d Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 10 Mar 2003 18:17:14 +0000
    Subject: [PATCH 4392/7878]   Some sort of ctrl char bogosity to eliminate
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64412 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/CHANGES b/CHANGES
    index 6ff3100cdd9..f4cb02a85b2 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -8,7 +8,7 @@ Changes with APR 0.9.2
          close that system handle wherever an apr function would invoke the
          final waitpid() against a zombie process on Unix.  [William Rowe]
     
    -  *) APR_MAX_SECONDS_TO_LINGER
     and APR_FNM_* #defines replace their
    +  *) APR_MAX_SECONDS_TO_LINGER and APR_FNM_* #defines replace their
          old undecorated names (missing APR_ prefix).  The old names will
          disappear with APR 1.0.0.
          [Craig Rodrigues , William Rowe]
    
    From bbd7fbe9868e8a5977b281e663f127cdae9f73a0 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 10 Mar 2003 18:19:58 +0000
    Subject: [PATCH 4393/7878]   Misordered - back in sync with libapr.dsp
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64413 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr.dsp | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/apr.dsp b/apr.dsp
    index dd63ecd3d09..285694be8ab 100644
    --- a/apr.dsp
    +++ b/apr.dsp
    @@ -580,11 +580,11 @@ SOURCE=.\include\apr_signal.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\apr_support.h
    +SOURCE=.\include\apr_strings.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\apr_strings.h
    +SOURCE=.\include\apr_support.h
     # End Source File
     # Begin Source File
     
    
    From 9796ac54e661ff132f4b01953649820ff49b1fdd Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 10 Mar 2003 18:25:23 +0000
    Subject: [PATCH 4394/7878]   Drop .dbg extraction from libapr.dll.  Complete
     debug symbols are created   as libapr.pdb which is sufficient for 99% of all
     purposes (see dev@ dialog   on the problems and reasons for this change.)
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64414 13f79535-47bb-0310-9956-ffa450edef68
    ---
     libapr.dsp | 19 +++++--------------
     1 file changed, 5 insertions(+), 14 deletions(-)
    
    diff --git a/libapr.dsp b/libapr.dsp
    index fec5db4960b..95191f378ad 100644
    --- a/libapr.dsp
    +++ b/libapr.dsp
    @@ -52,17 +52,8 @@ BSC32=bscmake.exe
     # ADD BASE BSC32 /nologo
     # ADD BSC32 /nologo
     LINK32=link.exe
    -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /machine:I386
    -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /debug /debugtype:both /machine:I386 /pdbtype:sept
    -# Begin Custom Build - Extracting .dbg symbols from $(InputPath)
    -InputPath=.\Release\libapr.dll
    -SOURCE="$(InputPath)"
    -
    -".\Release\libapr.dbr" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
    -	rebase -q -p -b 0x6EEC0000 -x ".\Release" $(InputPath)
    -	echo rebased > ".\Release\libapr.dbr"
    -
    -# End Custom Build
    +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386 /opt:ref
    +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386 /opt:ref
     
     !ELSEIF  "$(CFG)" == "libapr - Win32 Debug"
     
    @@ -87,7 +78,7 @@ BSC32=bscmake.exe
     # ADD BASE BSC32 /nologo
     # ADD BSC32 /nologo
     LINK32=link.exe
    -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386
    +# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386
     # ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386
     
     !ENDIF 
    @@ -595,11 +586,11 @@ SOURCE=.\include\apr_signal.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\apr_support.h
    +SOURCE=.\include\apr_strings.h
     # End Source File
     # Begin Source File
     
    -SOURCE=.\include\apr_strings.h
    +SOURCE=.\include\apr_support.h
     # End Source File
     # Begin Source File
     
    
    From c53cea702093c3514b1cf9b20c164f83aaa1bfed Mon Sep 17 00:00:00 2001
    From: Sander Striker 
    Date: Mon, 10 Mar 2003 19:02:38 +0000
    Subject: [PATCH 4395/7878] * mmap/unix/mmap.c
    
      (apr_mmap_create): Return errno instead of APR_ENOMEM.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64415 13f79535-47bb-0310-9956-ffa450edef68
    ---
     mmap/unix/mmap.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c
    index 2503f5438bf..42d39caf301 100644
    --- a/mmap/unix/mmap.c
    +++ b/mmap/unix/mmap.c
    @@ -163,7 +163,7 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new,
     
         if (mm == (void *)-1) {
             /* we failed to get an mmap'd file... */
    -        return APR_ENOMEM;
    +        return errno;
         }
     #endif
     
    
    From 496e685f68adc6db93aaa32cd2ff2b362cccfb17 Mon Sep 17 00:00:00 2001
    From: "William A. Rowe Jr" 
    Date: Mon, 10 Mar 2003 20:32:29 +0000
    Subject: [PATCH 4396/7878]   A very fast pass through the new debugging
     symbols and top level projects.   Needs *much* more work.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64416 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES                |  6 ++--
     docs/win32_builds.html | 63 ++++++++++++++++++++++++++++++++++++++++++
     2 files changed, 65 insertions(+), 4 deletions(-)
     create mode 100644 docs/win32_builds.html
    
    diff --git a/CHANGES b/CHANGES
    index f4cb02a85b2..3f52339bda3 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -30,10 +30,8 @@ Changes with APR 0.9.2
       *) Introduce Release mode debugging symbols for Win32 builds of apr.
          All library builds gain /Zi for debug symbols (which are discarded
          at link time if some flavor of the /debug flag isn't passed to link)
    -     and .dll builds gain both .pdb and .dbg files (older debuggers and
    -     Dr. Watson-type utilities on WinNT or Win9x don't support the newer 
    -     .pdb symbol files.)  Documentation on how-to-use these symbol files
    -     will be forthcoming.  [Allen Edwards, William Rowe]
    +     and .dll builds gain .pdb symbols.  Documentation on how-to-use these 
    +     symbols will be forthcoming.  [Allen Edwards, William Rowe]
     
       *) Add two new proc attributes to improve diagnostics for 
          apr_proc_create() failures on platforms where fork()+exec() is used.
    diff --git a/docs/win32_builds.html b/docs/win32_builds.html
    new file mode 100644
    index 00000000000..2d72b9864b0
    --- /dev/null
    +++ b/docs/win32_builds.html
    @@ -0,0 +1,63 @@
    +
    +APR Win32 Builds and Debugging
    +
    +

    APR Win32 Builds and Debugging

    + +

    Configuration and Flavors

    + +

    The Win32 APR Developer Studio projects consist of

    + +
    +
    apr/apr.dsp
    + +
    Builds the static apr.lib library (-D APR_DECLARE_STATIC)
    +
    apr/libapr.dsp
    + +
    Builds the dynamic libapr.dll library (no define required)
    +
    apr-util/aprutil.dsp
    + +
    Builds the static aprutil.lib library (-D APU_DECLARE_STATIC)
    +
    apr-util/libaprutil.dsp
    + +
    Builds the dynamic libaprutil.dll library (no define required)
    +
    apr-iconv/apriconv.dsp
    + +
    Builds the static apriconv.lib library (-D API_DECLARE_STATIC)
    +
    apr-iconv/libapriconv.dsp
    + +
    Builds the dynamic libapriconv.dll library (no define required)
    +
    + +

    In order to prepare to use one of the static libraries above, + your application must be compiled with the define shown above, so that the + correct linkage is created. The APR authors intended the use of dynamic + libraries by default, so application authors do not need any special + defines in order to link to the dynamic library flavors.

    + +

    In order to build APR, you must use the proper dependencies. A good + example of those dependencies is given in the apr-util/aprutil.dsw + Developer Studio workspace. You can borrow the parts of that structure + your application needs, that workspace defines both the dynamic and static + library dependencies.

    + +

    The APR libraries (dynamic and static) are compiled with debugging symbols , + even in Release builds. The dynamic library symbols are always usable, + simply keep the correspond .pdb file in the same path as the library .dll. + (E.g. both libapr.dll and libapr.pdb should be copied to the same path.)

    + +

    The static symbols will only be fully usable if your application does not + link with the /pdbtype:sept flag! At the time your application links to + an APR library, the corresponding _src.pdb file should exist in the original + path the library was built, or it may be sufficient to keep the _src.pdb file + in the same path as the library file. (E.g. apr.lib and apr_src.pdb should + reside together in your lib directory.) The later option is unconfirmed.

    + +

    In order to keep the symbols compiled into the static library, your application + must use the linker's /debug flag. If you do not want the application to be + debuggable with its corresponding .pdb file, omit the /debug flag and all debug + symbolic information is discarded. Note that your application can only be + debugged with the corresponding .pdb file created by the linker, unless you use + /debugtype:coff or /debugtype:both in your link options.

    + + + From e39dd3e286554b80d4579fd41abb6aa4f1c37dc1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 10 Mar 2003 21:07:01 +0000 Subject: [PATCH 4397/7878] Hmmm... said docs exist now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64417 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 3f52339bda3..46620243d78 100644 --- a/CHANGES +++ b/CHANGES @@ -30,8 +30,7 @@ Changes with APR 0.9.2 *) Introduce Release mode debugging symbols for Win32 builds of apr. All library builds gain /Zi for debug symbols (which are discarded at link time if some flavor of the /debug flag isn't passed to link) - and .dll builds gain .pdb symbols. Documentation on how-to-use these - symbols will be forthcoming. [Allen Edwards, William Rowe] + and .dll builds gain .pdb symbols. [Allen Edwards, William Rowe] *) Add two new proc attributes to improve diagnostics for apr_proc_create() failures on platforms where fork()+exec() is used. From 0127853f3fe9d65d12f4dbe1534bc4a93ca23917 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 10 Mar 2003 23:40:57 +0000 Subject: [PATCH 4398/7878] Default spawned threads to detached so we avoid hanging on a waitpid() call since NetWare doesn't yet have a way to kill a spawned NLM. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64418 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 7b0b05baebc..35fb5fa05bb 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -84,7 +84,7 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new,apr_pool_t *p (*new)->cmdtype = APR_PROGRAM; /* Default to a current path since NetWare doesn't handle it very well */ apr_filepath_get(&((*new)->currdir), APR_FILEPATH_NATIVE, pool); -/* (*new)->detached = 1;*/ + (*new)->detached = 1; return APR_SUCCESS; } From f0d39678ca9f4bef0dde5646fbe5b852b48677a0 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Tue, 11 Mar 2003 20:02:06 +0000 Subject: [PATCH 4399/7878] * include/apr_pools.h Add a comment about the order in which cleanups are run. This has been the case for quite a while, but was never documented. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64419 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/apr_pools.h b/include/apr_pools.h index a08ae890724..a19fe5f1fe1 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -529,6 +529,9 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, /* * Cleanup + * + * Cleanups are performed in the reverse order they were registered. That is: + * Last In, First Out. */ /** From 23f8c5d82b9525f8226a664381b03926d7e3dde2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 17 Mar 2003 23:00:07 +0000 Subject: [PATCH 4400/7878] Just an observation pointed out by rbb. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64420 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_dso.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/apr_dso.h b/include/apr_dso.h index 5a5d73884c7..faa95c1431b 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -91,6 +91,8 @@ typedef void * apr_dso_handle_sym_t; * @param res_handle Location to store new handle for the DSO. * @param path Path to the DSO library * @param ctx Pool to use. + * @bug We aught to provide an alternative to RTLD_GLOBAL, which + * is the only supported method of loading DSOs today. */ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx); From f32136f78f84d905c3d33464f8005edaf4cffd77 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 18 Mar 2003 19:01:46 +0000 Subject: [PATCH 4401/7878] Document an obvious problem lacking a simple solution - if we simply propogate flags as passed without enforcing their values - the rest of APR code will make invalid assumptions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64421 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/mktemp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c index 0c2676c197c..1311a52216a 100644 --- a/file_io/unix/mktemp.c +++ b/file_io/unix/mktemp.c @@ -225,6 +225,13 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i if (fd == -1) { return errno; } + /* XXX: We must reset several flags values as passed-in, since + * mkstemp didn't subscribe to our preference flags. + * + * We either have to unset the flags, or fix up the fd and other + * xthread and inherit bits appropriately. Since gettemp() above + * calls apr_file_open, our flags are respected in that code path. + */ apr_os_file_put(fp, &fd, flags, p); (*fp)->fname = apr_pstrdup(p, template); From a20fc3e99f7382731527d803e1e395882e8ea21e Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Tue, 18 Mar 2003 23:10:14 +0000 Subject: [PATCH 4402/7878] Define a printf format and format length for apr_uint64_t. Also define APR_INT64_T_FMT_LEN on Windows and Netware; Unix already defines that symbol. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64422 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 14 ++++++++++++++ include/apr.h.in | 4 ++++ include/apr.hnw | 3 +++ include/apr.hw | 3 +++ 5 files changed, 27 insertions(+) diff --git a/CHANGES b/CHANGES index 46620243d78..d71a7629c57 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.2 + *) Define APR_UINT64_T_FMT and APR_UINT64_T_FMT_LEN. + Define APR_INT64_T_FMT_LEN on Windows and Netware. [Branko Cibej] + *) Correct apr_file_gets() on OS2 and Win32 so that '\r's are no longer eaten, and apr_file_gets() -> apr_file_puts() moves the contents uncorrupted. [William Rowe] diff --git a/configure.in b/configure.in index 85074066f56..50f74ecfb7d 100644 --- a/configure.in +++ b/configure.in @@ -1071,6 +1071,8 @@ if test "$ac_cv_sizeof_int" = "8"; then int64_literal='#define APR_INT64_C(val) (val)' int64_t_fmt='#define APR_INT64_T_FMT "d"' int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 1' + uint64_t_fmt='#define APR_UINT64_T_FMT "u"' + uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 1' int64_value="int" long_value=int int64_strfn="strtoi" @@ -1078,6 +1080,8 @@ elif test "$ac_cv_sizeof_long" = "8"; then int64_literal='#define APR_INT64_C(val) (val##L)' int64_t_fmt='#define APR_INT64_T_FMT "ld"' int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' + uint64_t_fmt='#define APR_UINT64_T_FMT "lu"' + uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 2' int64_value="long" long_value=long int64_strfn="strtol" @@ -1089,6 +1093,8 @@ elif test "$ac_cv_sizeof_long_long" = "8"; then # go to the OS-dependent section. int64_t_fmt='#define APR_INT64_T_FMT "lld"' int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 3' + uint64_t_fmt='#define APR_UINT64_T_FMT "llu"' + uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 3' int64_value="long long" long_value="long long" int64_strfn="strtoll" @@ -1096,6 +1102,8 @@ elif test "$ac_cv_sizeof_long_double" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LD)' int64_t_fmt='#define APR_INT64_T_FMT "Ld"' int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' + uint64_t_fmt='#define APR_UINT64_T_FMT "Lu"' + uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 2' int64_value="long double" long_value="long double" int64_strfn="strtoll" @@ -1103,6 +1111,8 @@ elif test "$ac_cv_sizeof_longlong" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LL)' int64_t_fmt='#define APR_INT64_T_FMT "qd"' int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' + uint64_t_fmt='#define APR_UINT64_T_FMT "qu"' + uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 2' int64_value="__int64" long_value="__int64" int64_strfn="strtoll" @@ -1112,6 +1122,8 @@ else int64_literal='#error Can not determine the proper size for apr_int64_t' int64_t_fmt='#error Can not determine the proper size for apr_int64_t' int64_t_fmt_len='#error Can not determine the proper size for apr_int64_t' + uint64_t_fmt='#error Can not determine the proper size for apr_int64_t' + uint64_t_fmt_len='#error Can not determine the proper size for apr_int64_t' fi # If present, allow the C99 macro INT64_C to override our conversion. @@ -1250,6 +1262,8 @@ AC_SUBST(ssize_t_value) AC_SUBST(socklen_t_value) AC_SUBST(int64_t_fmt) AC_SUBST(int64_t_fmt_len) +AC_SUBST(uint64_t_fmt) +AC_SUBST(uint64_t_fmt_len) AC_SUBST(ssize_t_fmt) AC_SUBST(size_t_fmt) AC_SUBST(off_t_fmt) diff --git a/include/apr.h.in b/include/apr.h.in index 74c232945f1..4947ddd4eed 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -390,6 +390,10 @@ typedef @socklen_t_value@ apr_socklen_t; @int64_t_fmt@ @int64_t_fmt_len@ +/* And APR_UINT64_T_FMT */ +@uint64_t_fmt@ +@uint64_t_fmt_len@ + /* Deal with atoi64 variables ... these should move to apr_private.h */ #define APR_HAVE_INT64_STRFN @have_int64_strfn@ #define APR_INT64_STRFN @int64_strfn@ diff --git a/include/apr.hnw b/include/apr.hnw index bbe4bf7bc66..7c3eb67454e 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -357,6 +357,9 @@ typedef int apr_wait_t; #define APR_PATH_MAX PATH_MAX #define APR_INT64_T_FMT "lld" +#define APR_INT64_T_FMT_LEN 3 +#define APR_UINT64_T_FMT "llu" +#define APR_UINT64_T_FMT_LEN 3 #define APR_TIME_T_FMT APR_INT64_T_FMT /* Deal with atoi64 variables ... these should move to apr_private.h */ diff --git a/include/apr.hw b/include/apr.hw index e01f8592534..78d3176d86d 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -490,6 +490,9 @@ typedef int gid_t; #define APR_PID_T_FMT "d" #define APR_INT64_T_FMT "I64d" +#define APR_INT64_T_FMT_LEN 4 +#define APR_UINT64_T_FMT "I64u" +#define APR_UINT64_T_FMT_LEN 4 /* Deal with atoi64 variables ... these should move to apr_private.h */ /* MSVC 7.0 introduced _strtoui64 */ From 4434598f4fc2f6f99c023d189bec2933041d60b1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Mar 2003 02:08:28 +0000 Subject: [PATCH 4403/7878] Bug Fix #1 .. Move the special-case of Netware into _dup_file() where it belongs (this will be evident in bug #2). The patch fixes a fd leak on Netware where each call to apr_file_dup2 failed to close the original fd. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64423 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 7083286fe3c..e5cc9462171 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -78,7 +78,15 @@ static apr_status_t _file_dup(apr_file_t **new_file, } if (which_dup == 2) { +#ifdef NETWARE + /* Apparently Netware doesn't support dup2... instead + * close() then dup() + */ + close((*new_file)->filedes); + rv = ((*new_file)->filedes = dup(old_file->filedes)); +#else rv = dup2(old_file->filedes, (*new_file)->filedes); +#endif } else { rv = ((*new_file)->filedes = dup(old_file->filedes)); } @@ -141,11 +149,7 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p) { -#ifdef NETWARE - return _file_dup(&new_file, old_file, p, 1); -#else return _file_dup(&new_file, old_file, p, 2); -#endif } APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, From 14768683824a73baa4c1a0e04eb85d7de022dc41 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Mar 2003 02:14:36 +0000 Subject: [PATCH 4404/7878] Break the initial *new_file NULL check apart to solve two major bugs. 1) APR attempts to defer creation of objects until the underlying atomic call actually succeeds - in this case, dup() for the apr_file_dup() flavor (which_dup == 1). 2) APR cannot trust the LHS point passed in via apr_file_dup(), nowhere else do we require the user to 'NULL' out the target variable. This patch always creates a new apr_pcalloc() for apr_file_dup() ignoring the old value of *new_file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64424 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index e5cc9462171..50c72f7b673 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -64,20 +64,11 @@ static apr_status_t _file_dup(apr_file_t **new_file, { int rv; - if ((*new_file) == NULL) { - if (which_dup == 1) { - (*new_file) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); - if ((*new_file) == NULL) { - return APR_ENOMEM; - } - (*new_file)->pool = p; - } else { + if (which_dup == 2) { + if ((*new_file) == NULL) { /* We can't dup2 unless we have a valid new_file */ return APR_EINVAL; } - } - - if (which_dup == 2) { #ifdef NETWARE /* Apparently Netware doesn't support dup2... instead * close() then dup() @@ -88,12 +79,21 @@ static apr_status_t _file_dup(apr_file_t **new_file, rv = dup2(old_file->filedes, (*new_file)->filedes); #endif } else { - rv = ((*new_file)->filedes = dup(old_file->filedes)); + rv = dup(old_file->filedes); } if (rv == -1) return errno; + if (which_dup == 1) { + (*new_file) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); + if ((*new_file) == NULL) { + return APR_ENOMEM; + } + (*new_file)->pool = p; + (*new_file)->filedes = rv; + } + (*new_file)->fname = apr_pstrdup(p, old_file->fname); (*new_file)->buffered = old_file->buffered; From 94e560c7a53adb2a1e02efbb19e0a87bd628377b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Mar 2003 02:16:37 +0000 Subject: [PATCH 4405/7878] apr_p[c]alloc always succeeds, exit()s or calls the user defined callback. APR_ENOMEM checks are noops. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64425 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 50c72f7b673..830840bf375 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -87,9 +87,6 @@ static apr_status_t _file_dup(apr_file_t **new_file, if (which_dup == 1) { (*new_file) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); - if ((*new_file) == NULL) { - return APR_ENOMEM; - } (*new_file)->pool = p; (*new_file)->filedes = rv; } From 70eb8119a2745a27b77422a737e98c56dd0ab633 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Mar 2003 02:26:34 +0000 Subject: [PATCH 4406/7878] Fix bug #4 of the evening; it is altogether possible for the user to have called apr_file_close() against the original handle, and then invoke apr_file_dup2(). However, in that case the apr_file_t has already been unregistered from the cleanups. Always register a cleanup within _file_dup(), yet kill any remaining cleanup for the existing apr_file_t in the apr_file_dup2() situation. This also prevents double-registration, but in a more robust manner. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64426 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 830840bf375..c5a6cd57b0c 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -122,6 +122,9 @@ static apr_status_t _file_dup(apr_file_t **new_file, */ (*new_file)->flags = old_file->flags & ~APR_INHERIT; + apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), + apr_unix_file_cleanup, apr_unix_file_cleanup); + return APR_SUCCESS; } @@ -131,21 +134,22 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_status_t rv; rv = _file_dup(new_file, old_file, p, 1); - if (rv != APR_SUCCESS) - return rv; - - /* we do this here as we don't want to double register an existing - * apr_file_t for cleanup - */ - apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), - apr_unix_file_cleanup, apr_unix_file_cleanup); return rv; - } APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p) { + apr_status_t rv; + + /* an existing apr_file_t may already be closed, and therefore + * have no cleanup remaining; but we don't want to double-register + * the same cleanup in _file_dup. Kill the existing cleanup before + * invoking _file_dup to the existing new_file. + */ + apr_pool_cleanup_kill(new_file->pool, (void *)(new_file), + apr_unix_file_cleanup); + return _file_dup(&new_file, old_file, p, 2); } From 4153d9484e01aedf8f32ce61eb44a31bf0b9e9f3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Mar 2003 02:31:15 +0000 Subject: [PATCH 4407/7878] Fix bug #5 of the evening; always register the proper child_cleanup in apr_file_setaside(), based on the ->flags of the fd being set-aside. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64427 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index c5a6cd57b0c..a2ad2cc9428 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -182,7 +182,9 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, if (!(old_file->flags & APR_FILE_NOCLEANUP)) { apr_pool_cleanup_register(p, (void *)(*new_file), apr_unix_file_cleanup, - apr_unix_file_cleanup); + ((*new_file)->flags & APR_INHERIT) + ? apr_pool_cleanup_null + : apr_unix_file_cleanup); } old_file->filedes = -1; From d2f9804eac89184f49af6e86da11cee596ba68fb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Mar 2003 03:34:47 +0000 Subject: [PATCH 4408/7878] A common sense logic change. If we are dup()ing or dup2()ing into one of the std[in|out|err] fd's - we should automatically toggle the inherit bit. If the user calls apr_file_inherit_set() again it will be a noop. This brings Unix into line with Win32's implementation of dup. If folks feel we should *only* apply this code to which_dup==2 cases, that's fine with me; although close(1); dup(n) would generally create a new fd 1 on unix, that code isn't portable to Win32 and should be strongly discouraged. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64428 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index a2ad2cc9428..cb7edde82b9 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -117,13 +117,23 @@ static apr_status_t _file_dup(apr_file_t **new_file, /* make sure unget behavior is consistent */ (*new_file)->ungetchar = old_file->ungetchar; - /* apr_file_dup() clears the inherit attribute, user must call - * apr_file_inherit_set() again on the dupped handle, as necessary. + /* apr_file_dup() clears the inherit attribute for normal files, + * but sets the inherit attribute for std[out,in,err] fd's. + * The user must call apr_file_inherit_[un]set() on the dupped + * apr_file_t when desired. */ - (*new_file)->flags = old_file->flags & ~APR_INHERIT; + if ((*new_file)->filedes <= 2) { + (*new_file)->flags = old_file->flags | APR_INHERIT; + } + else { + (*new_file)->flags = old_file->flags & ~APR_INHERIT; + } apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), - apr_unix_file_cleanup, apr_unix_file_cleanup); + apr_unix_file_cleanup, + ((*new_file)->flags & APR_INHERIT) + ? apr_pool_cleanup_null + : apr_unix_file_cleanup); return APR_SUCCESS; } From b862d31683eceee127c559499a3e6fecd0643e3f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Mar 2003 03:45:42 +0000 Subject: [PATCH 4409/7878] Clean up a runover line, and reflect that apr_os_file_put() does not register a cleanup whatsoever. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64429 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/open.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/file_io/unix/open.c b/file_io/unix/open.c index 76a727adb89..1f6473a1657 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -191,7 +191,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, if (!(flag & APR_FILE_NOCLEANUP)) { apr_pool_cleanup_register((*new)->pool, (void *)(*new), - apr_unix_file_cleanup, apr_unix_file_cleanup); + apr_unix_file_cleanup, + apr_unix_file_cleanup); } return APR_SUCCESS; } @@ -241,7 +242,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file)->timeout = -1; (*file)->ungetchar = -1; /* no char avail */ (*file)->filedes = *dafile; - (*file)->flags = flags; + (*file)->flags = flags | APR_FILE_NOCLEANUP; (*file)->buffered = (flags & APR_BUFFERED) > 0; if ((*file)->buffered) { From 7b2fec4ac64db197eb8d82128d2b33032c639ed2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Mar 2003 04:21:58 +0000 Subject: [PATCH 4410/7878] We register no cleanups for files with APR_FILE_NOCLEANUP - reflect that by returning APR_EINVAL if the user attempts to toggle the inherit state. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64430 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_inherit.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/arch/unix/apr_arch_inherit.h b/include/arch/unix/apr_arch_inherit.h index babb255283d..c4c72677047 100644 --- a/include/arch/unix/apr_arch_inherit.h +++ b/include/arch/unix/apr_arch_inherit.h @@ -62,6 +62,8 @@ #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \ { \ + if (the##name->flag & APR_FILE_NOCLEANUP) \ + return APR_EINVAL; \ if (!(the##name->flag & APR_INHERIT)) { \ the##name->flag |= APR_INHERIT; \ apr_pool_child_cleanup_set(the##name->pool, \ @@ -79,6 +81,8 @@ void apr_##name##_set_inherit(apr_##name##_t *the##name) \ #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \ { \ + if (the##name->flag & APR_FILE_NOCLEANUP) \ + return APR_EINVAL; \ if (the##name->flag & APR_INHERIT) { \ the##name->flag &= ~APR_INHERIT; \ apr_pool_child_cleanup_set(the##name->pool, \ From 36ed7ca31442887fb016d671f4fdcd4b03e43a74 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Mar 2003 04:25:38 +0000 Subject: [PATCH 4411/7878] Simply move a declaration to make the CLOEXEC patch much easier to read. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64431 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_inherit.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/include/arch/unix/apr_arch_inherit.h b/include/arch/unix/apr_arch_inherit.h index c4c72677047..57f9e687231 100644 --- a/include/arch/unix/apr_arch_inherit.h +++ b/include/arch/unix/apr_arch_inherit.h @@ -59,7 +59,7 @@ #define APR_INHERIT (1 << 24) /* Must not conflict with other bits */ -#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ +#define APR_IMPLEMENT_INHERIT_SET(name, flag, fd, pool, cleanup) \ apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \ { \ if (the##name->flag & APR_FILE_NOCLEANUP) \ @@ -71,14 +71,9 @@ apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \ cleanup, apr_pool_cleanup_null); \ } \ return APR_SUCCESS; \ -} \ -/* Deprecated */ \ -void apr_##name##_set_inherit(apr_##name##_t *the##name) \ -{ \ - apr_##name##_inherit_set(the##name); \ } -#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ +#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, fd, pool, cleanup) \ apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \ { \ if (the##name->flag & APR_FILE_NOCLEANUP) \ @@ -90,7 +85,14 @@ apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \ cleanup, cleanup); \ } \ return APR_SUCCESS; \ -} \ +} + +/* Deprecated */ \ +void apr_##name##_set_inherit(apr_##name##_t *the##name) \ +{ \ + apr_##name##_inherit_set(the##name); \ +} + /* Deprecated */ \ void apr_##name##_unset_inherit(apr_##name##_t *the##name) \ { \ From 57a139f0a5c2ef975c9db71ab24deab81a78b29b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Mar 2003 04:35:11 +0000 Subject: [PATCH 4412/7878] /me reverts an entirely moronic patch - this was a macro declaration and the exact sequence is critical. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64432 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_inherit.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/include/arch/unix/apr_arch_inherit.h b/include/arch/unix/apr_arch_inherit.h index 57f9e687231..c4c72677047 100644 --- a/include/arch/unix/apr_arch_inherit.h +++ b/include/arch/unix/apr_arch_inherit.h @@ -59,7 +59,7 @@ #define APR_INHERIT (1 << 24) /* Must not conflict with other bits */ -#define APR_IMPLEMENT_INHERIT_SET(name, flag, fd, pool, cleanup) \ +#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \ { \ if (the##name->flag & APR_FILE_NOCLEANUP) \ @@ -71,9 +71,14 @@ apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \ cleanup, apr_pool_cleanup_null); \ } \ return APR_SUCCESS; \ +} \ +/* Deprecated */ \ +void apr_##name##_set_inherit(apr_##name##_t *the##name) \ +{ \ + apr_##name##_inherit_set(the##name); \ } -#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, fd, pool, cleanup) \ +#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \ { \ if (the##name->flag & APR_FILE_NOCLEANUP) \ @@ -85,14 +90,7 @@ apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \ cleanup, cleanup); \ } \ return APR_SUCCESS; \ -} - -/* Deprecated */ \ -void apr_##name##_set_inherit(apr_##name##_t *the##name) \ -{ \ - apr_##name##_inherit_set(the##name); \ -} - +} \ /* Deprecated */ \ void apr_##name##_unset_inherit(apr_##name##_t *the##name) \ { \ From f79feae885297a47bf25c200388deb82fa9ed208 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Mar 2003 05:03:24 +0000 Subject: [PATCH 4413/7878] Keep screaming about these bogus assumptions until they disappear. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64433 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockets.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 3ae028d0823..dbc2d2eb2e6 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -377,6 +377,7 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { + /* XXX Bogus assumption that *sock points at anything legit */ if ((*sock) == NULL) { alloc_socket(sock, cont); /* XXX IPv6 figure out the family here! */ From 945783be734f6d8b397f57e53ee3ac2c91529f75 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Mar 2003 05:32:04 +0000 Subject: [PATCH 4414/7878] apr_os_pipe_put() (where is the _file in that symbol name?) registers no cleanup - so enforce APR_FILE_NOCLEANUP to force apr_file_inherit_[un]set to choke. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64434 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 97628682b67..1ee25660cc0 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -185,7 +185,7 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, (*file)->timeout = -1; (*file)->ungetchar = -1; /* no char avail */ (*file)->filedes = *dafile; - (*file)->flags = 0; + (*file)->flags = APR_FILE_NOCLEANUP; (*file)->buffered = 0; #if APR_HAS_THREADS (*file)->thlock = NULL; From 585ead755b68e08a69c83c894b2a04d23bb5a702 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 19 Mar 2003 05:35:08 +0000 Subject: [PATCH 4415/7878] Same fixes for netware as unix in pipe.c BTW - that code *definately* violates the style guide; either repeat the assignments or indent the second line!!! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64435 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 43b5a7e22fd..52c7253c4c9 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -149,7 +149,7 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, (*file)->timeout = -1; (*file)->ungetchar = -1; /* no char avail */ (*file)->filedes = *dafile; - (*file)->flags = 0; + (*file)->flags = APR_FILE_NOCLEANUP; (*file)->buffered = 0; #if APR_HAS_THREADS (*file)->thlock = NULL; @@ -173,6 +173,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*out)->pool = pool; (*in)->filedes = filedes[0]; (*out)->filedes = filedes[1]; + (*in)->flags = APR_INHERIT; + (*out)->flags = APR_INHERIT; (*in)->is_pipe = (*out)->is_pipe = 1; (*out)->fname = From 0ed1c421c43f62ec19681367574f103725f8065b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 19 Mar 2003 10:17:26 +0000 Subject: [PATCH 4416/7878] Fix "unused variable" compiler warning in apr_file_dup2 and eliminate local variable in apr_file_dup. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64436 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index cb7edde82b9..9395fb814a5 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -141,17 +141,12 @@ static apr_status_t _file_dup(apr_file_t **new_file, APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { - apr_status_t rv; - - rv = _file_dup(new_file, old_file, p, 1); - return rv; + return _file_dup(new_file, old_file, p, 1); } APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p) { - apr_status_t rv; - /* an existing apr_file_t may already be closed, and therefore * have no cleanup remaining; but we don't want to double-register * the same cleanup in _file_dup. Kill the existing cleanup before From 626496f095f65727a56beb6a94d27b56c6b5cb53 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 20 Mar 2003 16:17:49 +0000 Subject: [PATCH 4417/7878] Quick entry about the inheritence issues. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64437 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index d71a7629c57..597c622c7dd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR 0.9.2 + *) Numerous bug fixes for file and socket inheritence by child + processes on Unix, correcting bugs that affected the correct + behavior of apr_[file|socket]_inherit_[un]set() API. + [Bjoern A. Zeeb , William Rowe, Joe Orton] + *) Define APR_UINT64_T_FMT and APR_UINT64_T_FMT_LEN. Define APR_INT64_T_FMT_LEN on Windows and Netware. [Branko Cibej] From 8dbe6d65f41774896d8dc4d58169c19107a389ce Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 20 Mar 2003 16:36:51 +0000 Subject: [PATCH 4418/7878] Clean up status, noting the pending release, splitting showstoppers into 0.9 and 1.0 categories, and knocking off one issue on Win32 that was fixed by closing apr_proc_t::hproc under the same conditions as unix would prune zombie processes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64438 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/STATUS b/STATUS index e00bd33176d..19f9bb5b296 100644 --- a/STATUS +++ b/STATUS @@ -1,9 +1,9 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2003/03/07 21:38:40 $] +Last modified at [$Date: 2003/03/20 16:36:51 $] Release: - 0.9.2 : in progress + 0.9.2 : candidate tagged WAR_0_9_2_RC2, slated for release March 20 0.9.1 : released September 11, 2002 0.9.0 : released August 28, 2002 @@ -17,11 +17,17 @@ Release: 2.0a2 : released March 31, 2000 2.0a1 : released March 10, 2000 -RELEASE SHOWSTOPPERS: + +RELEASE 0.9 SHOWSTOPPERS: + + + +RELEASE 1.0 SHOWSTOPPERS: * Must namespace protect all include/apr_foo.h headers. Jon Travis has especially observed these including apr within Apache-1.3. Message-ID: <20020128100116.A4288@covalent.net> + Deprecating the symbols in 0.9, eliminating them with 1.0. (Those problems have been fixed, but it is a good example of what to look for.) Some headers with issues: @@ -29,8 +35,6 @@ RELEASE SHOWSTOPPERS: _POSIX_THREAD_SAFE_FUNCTIONS (?)) apr.hw (NO_USE_SIGACTION) - 1.0 showstopper (not 0.9.x): gstein, wrowe - [wrowe observed we have deprecated for now, not trashing old names.] * Flush out the test suite and make sure it passes on all platforms. We currently have about 450 functions in APR and 147 tests. That @@ -51,17 +55,6 @@ RELEASE SHOWSTOPPERS: Thom says: I think this is close to done; does anyone want to add any further renames? - 1.0 showstopper (not 0.9.x): gstein, wrowe - - * When Win32 apr_proc_create was fixed, the apr_proc_t hproc - member was added for that platform. That's a problem (and - was when pid was abused as well) since nobody goes and cleans - up hproc after the process is dead. Can't do a pool cleanup, - since apr_proc_create didn't allocate the apr_proc_t storage. - (Aren't transparent types swell?) Suggestions? - - 1.0 showstopper (not 0.9.x): gstein - CURRENT VOTES: From 6619574d5228f2c8ad73bfb58a68b261342c2169 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 20 Mar 2003 18:39:53 +0000 Subject: [PATCH 4419/7878] Need to resolve the #define APR_INHERIT that is being used as a flag git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64439 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 52c7253c4c9..89030853035 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -59,6 +59,7 @@ #include "apr_arch_file_io.h" #include "apr_strings.h" #include "apr_portable.h" +#include "apr_arch_inherit.h" static apr_status_t pipeblock(apr_file_t *thepipe) { From 992281b39b2fcbbbb52c24dcd82b568946b941c6 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 20 Mar 2003 22:04:01 +0000 Subject: [PATCH 4420/7878] dup2() is supported on NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64440 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 9395fb814a5..6a6f0d5eea4 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -69,15 +69,7 @@ static apr_status_t _file_dup(apr_file_t **new_file, /* We can't dup2 unless we have a valid new_file */ return APR_EINVAL; } -#ifdef NETWARE - /* Apparently Netware doesn't support dup2... instead - * close() then dup() - */ - close((*new_file)->filedes); - rv = ((*new_file)->filedes = dup(old_file->filedes)); -#else rv = dup2(old_file->filedes, (*new_file)->filedes); -#endif } else { rv = dup(old_file->filedes); } From 4fccd0d3a2c43d9db968ed02c4b5717015dd9251 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 22 Mar 2003 02:30:42 +0000 Subject: [PATCH 4421/7878] Given two solutions to the current mpm inheritence bugs, 1) track the target file's existing flags and register the proper sort of cleanup (a bug in the new design) or 2) revert to the previous behavior and retain the existing cleanup I've gone with option 2, since Joe Orton has expressed concern with introducing too many changes in the coming release. However, this implies that; apr_file_close(fd1); apr_file_dup2(fd1, fd2); is absolutely unsupported. Since it wouldn't work on Win32 in the first place, I'm not terribly concerned about this limitation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64441 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 6a6f0d5eea4..6997ff238a5 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -109,6 +109,16 @@ static apr_status_t _file_dup(apr_file_t **new_file, /* make sure unget behavior is consistent */ (*new_file)->ungetchar = old_file->ungetchar; + /* apr_file_dup2() retains the original cleanup, reflecting + * the existing inherit and nocleanup flags. This means, + * that apr_file_dup2() cannot be called against an apr_file_t + * already closed with apr_file_close, because the expected + * cleanup was already killed. + */ + if (which_dup == 2) { + return APR_SUCCESS; + } + /* apr_file_dup() clears the inherit attribute for normal files, * but sets the inherit attribute for std[out,in,err] fd's. * The user must call apr_file_inherit_[un]set() on the dupped @@ -139,14 +149,6 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p) { - /* an existing apr_file_t may already be closed, and therefore - * have no cleanup remaining; but we don't want to double-register - * the same cleanup in _file_dup. Kill the existing cleanup before - * invoking _file_dup to the existing new_file. - */ - apr_pool_cleanup_kill(new_file->pool, (void *)(new_file), - apr_unix_file_cleanup); - return _file_dup(&new_file, old_file, p, 2); } From 027360cd18ed06d5b5d6ad605fb8b26cb21a2e8c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 22 Mar 2003 02:33:50 +0000 Subject: [PATCH 4422/7878] Revert my recent change that concerns both Jeff Trawick and myself, we will make no presumtion that fd 0..2 are special cases from apr_file_dup(), and remain uninherited as in the previous release of APR. Although it's a common Unix construct to; close(2) fd = dup(2, x) it's certainly not portable and shouldn't be encouraged. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64442 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 6997ff238a5..34ca7de8258 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -119,23 +119,17 @@ static apr_status_t _file_dup(apr_file_t **new_file, return APR_SUCCESS; } - /* apr_file_dup() clears the inherit attribute for normal files, - * but sets the inherit attribute for std[out,in,err] fd's. - * The user must call apr_file_inherit_[un]set() on the dupped + /* apr_file_dup() retains all old_file flags with the exceptions + * of APR_INHERIT and APR_FILE_NOCLEANUP. + * The user must call apr_file_inherit_set() on the dupped * apr_file_t when desired. */ - if ((*new_file)->filedes <= 2) { - (*new_file)->flags = old_file->flags | APR_INHERIT; - } - else { - (*new_file)->flags = old_file->flags & ~APR_INHERIT; - } + (*new_file)->flags = old_file->flags + & ~(APR_INHERIT | APR_FILE_NOCLEANUP); apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), apr_unix_file_cleanup, - ((*new_file)->flags & APR_INHERIT) - ? apr_pool_cleanup_null - : apr_unix_file_cleanup); + apr_unix_file_cleanup); return APR_SUCCESS; } From d4098d0f3fe07655d933fd6f48ffe9aa9e6fbb9f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 22 Mar 2003 03:24:34 +0000 Subject: [PATCH 4423/7878] Prepare for 0.9.2 tag git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64443 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- include/apr_version.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 19f9bb5b296..8f08dea6358 100644 --- a/STATUS +++ b/STATUS @@ -1,9 +1,9 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2003/03/20 16:36:51 $] +Last modified at [$Date: 2003/03/22 03:24:33 $] Release: - 0.9.2 : candidate tagged WAR_0_9_2_RC2, slated for release March 20 + 0.9.2 : tagged March 21, 2003 0.9.1 : released September 11, 2002 0.9.0 : released August 28, 2002 diff --git a/include/apr_version.h b/include/apr_version.h index ce3fdc3e236..66e5313d6ae 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -106,7 +106,7 @@ extern "C" { * This symbol is defined for internal, "development" copies of APR. This * symbol will be #undef'd for releases. */ -#define APR_IS_DEV_VERSION +/* #undef APR_IS_DEV_VERSION */ /** The formatted string of APR's version */ #define APR_VERSION_STRING \ From 3bc34bb336c09711c12d3ca55d6ee8db207852e5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 22 Mar 2003 03:25:17 +0000 Subject: [PATCH 4424/7878] On to 0.9.3-dev git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64445 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_version.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 597c622c7dd..7969d7013c8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +Changes with APR 0.9.3 + + + Changes with APR 0.9.2 *) Numerous bug fixes for file and socket inheritence by child diff --git a/include/apr_version.h b/include/apr_version.h index 66e5313d6ae..dab0021b356 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -99,14 +99,14 @@ extern "C" { #define APR_MINOR_VERSION 9 /** patch level */ -#define APR_PATCH_VERSION 2 +#define APR_PATCH_VERSION 3 /** * This symbol is defined for internal, "development" copies of APR. This * symbol will be #undef'd for releases. */ -/* #undef APR_IS_DEV_VERSION */ +#define APR_IS_DEV_VERSION /** The formatted string of APR's version */ #define APR_VERSION_STRING \ From 767bce538ec91fc44354fee2a6a805a82d539305 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 23 Mar 2003 02:25:02 +0000 Subject: [PATCH 4425/7878] Fix for multiple fixes to __attribute__ which conflicts for 3rd party builds, such as mod_perl. Let's only override this tag if a macro workaround wasn't already defined. Submitted by: Stas Bekman git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64446 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 4 +++- include/apr.hnw | 2 ++ include/apr.hw | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/apr.h.in b/include/apr.h.in index 4947ddd4eed..cb223859c53 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -96,8 +96,10 @@ #if !defined(__GNUC__) || __GNUC__ < 2 || \ (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\ defined(NEXT) -#define APR_INLINE +#ifndef __attribute__ #define __attribute__(__x) +#endif +#define APR_INLINE #define APR_HAS_INLINE 0 #else #define APR_INLINE __inline__ diff --git a/include/apr.hnw b/include/apr.hnw index 7c3eb67454e..6af0bb01389 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -112,7 +112,9 @@ extern "C" { #define APR_INLINE #define APR_HAS_INLINE 0 +#ifndef __attribute__ #define __attribute__(__x) +#endif #define ENUM_BITFIELD(e,n,w) signed int n : w #define APR_HAVE_ARPA_INET_H 0 diff --git a/include/apr.hw b/include/apr.hw index 78d3176d86d..8f19469421a 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -139,7 +139,9 @@ #define APR_INLINE __inline #define APR_HAS_INLINE 1 +#ifndef __attribute__ #define __attribute__(__x) +#endif #define NO_USE_SIGACTION From 7240889dc652c1f32c3c4ed2893ad1765b888974 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 23 Mar 2003 03:29:23 +0000 Subject: [PATCH 4426/7878] Fix error in apr-config when symlinks are involved. Submitted by: Garrett Rooney Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64447 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 ++- apr-config.in | 15 +++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 7969d7013c8..ad56b3d949a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ Changes with APR 0.9.3 - + *) Fix error in apr-config when symlinks are involved. + [Garrett Rooney ] Changes with APR 0.9.2 diff --git a/apr-config.in b/apr-config.in index ed7bbfabbc5..0bb228c99af 100644 --- a/apr-config.in +++ b/apr-config.in @@ -123,17 +123,20 @@ fi thisdir="`dirname $0`" thisdir="`cd $thisdir && pwd`" -# If we have the realpath program, use it to resolve symlinks. -# Otherwise, being in a symlinked dir may result in incorrect output. -if test -x "`which realpath 2>/dev/null`"; then - thisdir="`realpath $thisdir`" - APR_SOURCE_DIR="`realpath $APR_SOURCE_DIR`" -fi if test -d $bindir; then tmpbindir="`cd $bindir && pwd`" else tmpbindir="" fi +# If we have the realpath program, use it to resolve symlinks +# Otherwise, being in a symlinked dir may result in incorrect output. +if test -x "`which realpath 2>/dev/null`"; then + thisdir="`realpath $thisdir`" + APR_SOURCE_DIR="`realpath $APR_SOURCE_DIR`" + if test -n $tmpbindir; then + tmpbindir="`realpath $tmpbindir`" + fi +fi if test "$tmpbindir" = "$thisdir"; then location=installed elif test "$APR_SOURCE_DIR" = "$thisdir"; then From f4068d208ad7e439950dce0db29084eb1bc0dca1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 24 Mar 2003 10:20:42 +0000 Subject: [PATCH 4427/7878] static main() doesn't work Submitted by: Craig Rodrigues Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64448 13f79535-47bb-0310-9956-ffa450edef68 --- test/testmutexscope.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testmutexscope.c b/test/testmutexscope.c index 5aaa37af082..99a97805b71 100644 --- a/test/testmutexscope.c +++ b/test/testmutexscope.c @@ -64,7 +64,7 @@ #include "apr_thread_proc.h" #if !APR_HAS_THREADS -static int main(void) +int main(void) { printf("This test requires APR thread support.\n"); return 0; From 7282ac9bf9103dbd78bed20801fcd49dd10c01a6 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 24 Mar 2003 17:14:43 +0000 Subject: [PATCH 4428/7878] Add tests for APR_{U,}INT64_T_FMT and apr_strerror. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64449 13f79535-47bb-0310-9956-ffa450edef68 --- test/teststr.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/teststr.c b/test/teststr.c index c92af8ff8c1..f8e0a31dd95 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -61,6 +61,7 @@ #include "apr_general.h" #include "apr_strings.h" +#include "apr_errno.h" /* I haven't bothered to check for APR_ENOTIMPL here, AFAIK, all string * functions exist on all platforms. @@ -163,6 +164,33 @@ static void snprintf_0nonNULL(CuTest *tc) CuAssert(tc, "buff unmangled", strcmp(buff, "FOOBAR") != 0); } +static void snprintf_int64(CuTest *tc) +{ + char buf[100]; + apr_int64_t i = APR_INT64_C(-42); + apr_uint64_t ui = APR_INT64_C(42); /* no APR_UINT64_C */ + apr_uint64_t big = APR_INT64_C(3141592653589793238); + + apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, i); + CuAssertStrEquals(tc, buf, "-42"); + + apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, ui); + CuAssertStrEquals(tc, buf, "42"); + + apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, big); + CuAssertStrEquals(tc, buf, "3141592653589793238"); +} + +static void string_error(CuTest *tc) +{ + char buf[128], *rv; + + rv = apr_strerror(APR_ENOENT, buf, sizeof buf); + CuAssertPtrEquals(tc, buf, rv); + /* ### relax this comparison. */ + CuAssertStrEquals(tc, "No such file or directory", buf); +} + CuSuite *teststr(void) { CuSuite *suite = CuSuiteNew("Strings"); @@ -170,7 +198,9 @@ CuSuite *teststr(void) SUITE_ADD_TEST(suite, snprintf_0NULL); SUITE_ADD_TEST(suite, snprintf_0nonNULL); SUITE_ADD_TEST(suite, snprintf_noNULL); + SUITE_ADD_TEST(suite, snprintf_int64); SUITE_ADD_TEST(suite, test_strtok); + SUITE_ADD_TEST(suite, string_error); return suite; } From 7bb5bfb5303745ca26d6193559dad9a2db18476f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Mar 2003 20:13:36 +0000 Subject: [PATCH 4429/7878] Ignore the availablity of threads on HPUX, they aren't trustworthy based on much discussion on dev@apr, and Madhu pointed out that they had their own threads implementation that was abandoned in HPUX 11, and therefore not worth implementing. PR: 9457 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64450 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ configure.in | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index ad56b3d949a..1580f65ec92 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR 0.9.3 + *) Default hpux 10.x to disable threading, since if it exists at all + the pthread implementation should not be trusted, while hpux 10 + had its own threads implementation that is no longer supported. + PR 9457 [William Rowe] + *) Fix error in apr-config when symlinks are involved. [Garrett Rooney ] diff --git a/configure.in b/configure.in index 50f74ecfb7d..1306b172adc 100644 --- a/configure.in +++ b/configure.in @@ -445,6 +445,11 @@ case $host in OSDIR="unix" eolstr="\\n" ;; + *hpux10* ) + enable_threads="no" + OSDIR="unix" + eolstr="\\n" + ;; *) OSDIR="unix" eolstr="\\n" From 406bd1b3bde87929be5bc2980359a0bb00a3a292 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 27 Mar 2003 18:39:03 +0000 Subject: [PATCH 4430/7878] Comment what res_name_from_filename is doing git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64451 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index 2f1ea94df92..21a1c43891f 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -136,6 +136,11 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return rv; } rv = apr_file_trunc(f, size); + + /* res_name_from_filename turns file into a pseudo-name + * without slashes or backslashes, and prepends the \global + * prefix on Win2K and later + */ mapkey = res_name_from_filename(file, 1, pool); } @@ -208,6 +213,10 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, return APR_EINVAL; } else { + /* res_name_from_filename turns file into a pseudo-name + * without slashes or backslashes, and prepends the \global + * prefix on Win2K and later + */ mapkey = res_name_from_filename(file, 1, pool); } From c823d8d1e5a21c5ec773dd728b547fdd16f43200 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 27 Mar 2003 19:51:12 +0000 Subject: [PATCH 4431/7878] Win32 needs to do nothing if the file handle is already open in a child process, and we are using anonymous proc_mutex or global_mutex methods, so win32 should return APR_SUCCESS for proc_mutex_child_init. We also introduced the kernel 'object' folding function for shared memory section names, so reuse that folding function here to provide reliable Win2K/XP names (prefixed with \global\) and fold away any slashes or backslashes from that path. Based on issues observed by "Andre Schild" with the httpd mod_ssl implementation for Win32, with input from Andre and JimJ. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64452 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/proc_mutex.c | 69 +++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 6c6cf26e938..37a1d0cecf0 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -57,6 +57,7 @@ #include "apr_general.h" #include "apr_strings.h" #include "apr_portable.h" +#include "apr_arch_file_io.h" #include "apr_arch_proc_mutex.h" #include "apr_arch_misc.h" @@ -64,8 +65,10 @@ static apr_status_t proc_mutex_cleanup(void *mutex_) { apr_proc_mutex_t *mutex = mutex_; - if (CloseHandle(mutex->handle) == 0) { - return apr_get_os_error(); + if (mutex->handle) { + if (CloseHandle(mutex->handle) == 0) { + return apr_get_os_error(); + } } return APR_SUCCESS; } @@ -76,21 +79,32 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, apr_pool_t *pool) { HANDLE hMutex; + void *mutexkey; - /* With Win2000 Terminal Services, the Mutex name can have a - * "Global\" or "Local\" prefix to explicitly create the object - * in the global or session name space. Without Terminal Service - * running on Win2000, Global\ and Local\ are ignored. These - * prefixes are only valid on Win2000+ + /* res_name_from_filename turns fname into a pseduo-name + * without slashes or backslashes, and prepends the \global + * prefix on Win2K and later */ if (fname) { - if (apr_os_level >= APR_WIN_2000) - fname = apr_pstrcat(pool, "Global\\", fname, NULL); - else - fname = apr_pstrdup(pool, fname); + mutexkey = res_name_from_filename(fname, 1, pool); + } + else { + mutexkey = NULL; } - hMutex = CreateMutex(NULL, FALSE, fname); +#if APR_HAS_UNICODE_FS + IF_WIN_OS_IS_UNICODE + { + hMutex = CreateMutexW(NULL, FALSE, mutexkey); + } +#endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI + { + hMutex = CreateMutexA(NULL, FALSE, mutexkey); + } +#endif + if (!hMutex) { return apr_get_os_error(); } @@ -109,13 +123,32 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, apr_pool_t *pool) { HANDLE hMutex; + void *mutexkey; - if (apr_os_level >= APR_WIN_2000) - fname = apr_pstrcat(pool, "Global\\", fname, NULL); - else - fname = apr_pstrdup(pool, fname); + if (!fname) { + /* Reinitializing unnamed mutexes is a noop in the Unix code. */ + return APR_SUCCESS; + } + + /* res_name_from_filename turns file into a pseudo-name + * without slashes or backslashes, and prepends the \global + * prefix on Win2K and later + */ + mutexkey = res_name_from_filename(fname, 1, pool); + +#if APR_HAS_UNICODE_FS + IF_WIN_OS_IS_UNICODE + { + hMutex = OpenMutexW(MUTEX_ALL_ACCESS, FALSE, mutexkey); + } +#endif +#if APR_HAS_ANSI_FS + ELSE_WIN_OS_IS_ANSI + { + hMutex = OpenMutexA(MUTEX_ALL_ACCESS, FALSE, mutexkey); + } +#endif - hMutex = OpenMutex(MUTEX_ALL_ACCESS, FALSE, fname); if (!hMutex) { return apr_get_os_error(); } @@ -174,7 +207,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) { - return "win32mutex"; + return mutex->fname; } APR_DECLARE(const char *) apr_proc_mutex_defname(void) From a2054924bf85bf5fd3f17f920217e304bb3a14c1 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 27 Mar 2003 20:10:35 +0000 Subject: [PATCH 4432/7878] Bugz 17186 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64453 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 2d3eebf2d5c..70bf7da8037 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -98,6 +98,7 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, new_mutex->interproc = apr_palloc(new_mutex->pool, sizeof(*new_mutex->interproc)); + new_mutex->interproc->filedes = -1; /* * This bogusness is to follow what appears to be the * lowest common denominator in Posix semaphore naming: From d33e1b929f32e5372e91a48f1b46b4c4d18b863b Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 27 Mar 2003 20:34:30 +0000 Subject: [PATCH 4433/7878] At configure time disable Posix sem for those platforms where we can't/shouldn't shove a sem_t * into an int -- bluntly reported by Joe Orton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64454 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index 1306b172adc..b9593528bd7 100644 --- a/configure.in +++ b/configure.in @@ -1422,6 +1422,8 @@ main() sem_t *psem; const char *sem_name = "/apr_autoconf"; + if (sizeof(int) < sizeof(sem_t *)) + exit(1); psem = sem_open(sem_name, O_CREAT, 0644, 1); if (psem == (sem_t *)SEM_FAILED) { exit(1); From f203259eedba827e26a6ec5729107acf3c0e3fcf Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 27 Mar 2003 20:45:35 +0000 Subject: [PATCH 4434/7878] Note the 2 posixsem patches git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64455 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 1580f65ec92..83e141373e6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR 0.9.3 + *) Don't enable posixsem, at build time, on systems where sem_t * + won't "fit" into an int (sizeof-wise). Also, better error handling + when we fail to create a posixsem. PR 17186 [Scott Herod + , Jim Jagielski] + *) Default hpux 10.x to disable threading, since if it exists at all the pthread implementation should not be trusted, while hpux 10 had its own threads implementation that is no longer supported. From a847c0e6417c8740de5b038ee378ac69bc546251 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Sun, 30 Mar 2003 23:11:38 +0000 Subject: [PATCH 4435/7878] We need to call apr_proc_mutex_child_init, which is not a noop for some mutexes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64456 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/global_mutex.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c index f288584d462..9ee0f20de5b 100644 --- a/locks/unix/global_mutex.c +++ b/locks/unix/global_mutex.c @@ -121,7 +121,10 @@ APR_DECLARE(apr_status_t) apr_global_mutex_child_init( const char *fname, apr_pool_t *pool) { - return APR_SUCCESS; + apr_status_t rv; + + rv = apr_proc_mutex_child_init(&((*mutex)->proc_mutex), fname, pool); + return rv; } APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) From b70f69ca93b2b7c889f77c39cf8e792fcb1ca26f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 31 Mar 2003 05:28:19 +0000 Subject: [PATCH 4436/7878] 0.9.3 is here, with build problems and global mutex issues resolved. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64457 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_version.h b/include/apr_version.h index dab0021b356..2664cd385b3 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -106,7 +106,7 @@ extern "C" { * This symbol is defined for internal, "development" copies of APR. This * symbol will be #undef'd for releases. */ -#define APR_IS_DEV_VERSION +/* #undef APR_IS_DEV_VERSION */ /** The formatted string of APR's version */ #define APR_VERSION_STRING \ From be0824c483cdba8aca17a66b6a1a5bbeebd572ea Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 31 Mar 2003 05:29:47 +0000 Subject: [PATCH 4437/7878] 0.9.3 was here, on to 0.9.4-dev git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64460 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_version.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 83e141373e6..65422c16d1f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +Changes with APR 0.9.4 + + + Changes with APR 0.9.3 *) Don't enable posixsem, at build time, on systems where sem_t * diff --git a/include/apr_version.h b/include/apr_version.h index 2664cd385b3..b56dde2f132 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -99,14 +99,14 @@ extern "C" { #define APR_MINOR_VERSION 9 /** patch level */ -#define APR_PATCH_VERSION 3 +#define APR_PATCH_VERSION 4 /** * This symbol is defined for internal, "development" copies of APR. This * symbol will be #undef'd for releases. */ -/* #undef APR_IS_DEV_VERSION */ +#define APR_IS_DEV_VERSION /** The formatted string of APR's version */ #define APR_VERSION_STRING \ From e2410058b0126cb7ca857cd7dcd86cc9cb0b7b22 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 31 Mar 2003 05:34:30 +0000 Subject: [PATCH 4438/7878] Notes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64461 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 8f08dea6358..d4540884dca 100644 --- a/STATUS +++ b/STATUS @@ -1,9 +1,10 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2003/03/22 03:24:33 $] +Last modified at [$Date: 2003/03/31 05:34:30 $] Release: - 0.9.2 : tagged March 21, 2003 + 0.9.3 : tagged March 30, 2003 + 0.9.2 : released March 22, 2003 0.9.1 : released September 11, 2002 0.9.0 : released August 28, 2002 From 0a142bf3311b8967105dff497332d1b68e8af254 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 31 Mar 2003 06:15:05 +0000 Subject: [PATCH 4439/7878] Fix another screwy line-ending git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64462 13f79535-47bb-0310-9956-ffa450edef68 --- docs/win32_builds.html | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/docs/win32_builds.html b/docs/win32_builds.html index 2d72b9864b0..ad57d8e1384 100644 --- a/docs/win32_builds.html +++ b/docs/win32_builds.html @@ -9,22 +9,16 @@

    Configuration and Flavors

    apr/apr.dsp
    -
    Builds the static apr.lib library (-D APR_DECLARE_STATIC)
    apr/libapr.dsp
    -
    Builds the dynamic libapr.dll library (no define required)
    apr-util/aprutil.dsp
    -
    Builds the static aprutil.lib library (-D APU_DECLARE_STATIC)
    apr-util/libaprutil.dsp
    -
    Builds the dynamic libaprutil.dll library (no define required)
    apr-iconv/apriconv.dsp
    -
    Builds the static apriconv.lib library (-D API_DECLARE_STATIC)
    apr-iconv/libapriconv.dsp
    -
    Builds the dynamic libapriconv.dll library (no define required)
    @@ -40,7 +34,7 @@

    Configuration and Flavors

    your application needs, that workspace defines both the dynamic and static library dependencies.

    -

    The APR libraries (dynamic and static) are compiled with debugging symbols , +

    The APR libraries (dynamic and static) are compiled with debugging symbols, even in Release builds. The dynamic library symbols are always usable, simply keep the correspond .pdb file in the same path as the library .dll. (E.g. both libapr.dll and libapr.pdb should be copied to the same path.)

    From 56cf58e1792a838f8d3aa90aba04335faaecfdc6 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 31 Mar 2003 12:31:40 +0000 Subject: [PATCH 4440/7878] OS/2: apr_stat() fixes - When a character device is stat'ed, fill in finfo.name if it was asked for. - return APR_INCOMPLETE when appropriate. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64463 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filestat.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index cfb232e4a26..7797a26b4fa 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -186,17 +186,21 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, finfo->valid |= APR_FINFO_NAME; } } - - return APR_SUCCESS; } else if (rc == ERROR_INVALID_ACCESS) { memset(finfo, 0, sizeof(apr_finfo_t)); finfo->valid = APR_FINFO_TYPE | APR_FINFO_PROT; finfo->protection = 0666; finfo->filetype = APR_CHR; - return APR_SUCCESS; + + if (wanted & APR_FINFO_NAME) { + finfo->name = apr_pstrdup(cont, fname); + finfo->valid |= APR_FINFO_NAME; + } + } else { + return APR_FROM_OS_ERROR(rc); } - - return APR_FROM_OS_ERROR(rc); + + return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; } From 3d79a0dc14f728944ddab88c1c15176f72c67f77 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Mon, 31 Mar 2003 12:39:51 +0000 Subject: [PATCH 4441/7878] OS/2: when parsing #! line, adjust for the fact that apr_file_gets() no longer removes CR characters. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64464 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/os2/proc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index b147ef285c9..0353000bd38 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -380,8 +380,13 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname if (status == APR_SUCCESS) { if (interpreter[0] == '#' && interpreter[1] == '!') { - /* delete newline */ - interpreter[strlen(interpreter) - 1] = '\0'; + /* delete CR/LF & any other whitespace off the end */ + int end = strlen(interpreter) - 1; + + while (end >= 0 && apr_isspace(interpreter[end])) { + interpreter[end] = '\0'; + end--; + } if (interpreter[2] != '/' && interpreter[2] != '\\' && interpreter[3] != ':') { char buffer[300]; From bfb0d88f3f12551fac87abf52f6a0366e28ae1e0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 1 Apr 2003 00:15:04 +0000 Subject: [PATCH 4442/7878] Solaris cc: Don't use the -mt option for threaded builds. That is for non-Posix threading, and the use of it prevented us from linking with -lpthread, which in turn caused weird problems for APR applications. Submitted by: Kristofer Spinka Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64465 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++++- build/apr_threads.m4 | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 65422c16d1f..9e5a6cb41d8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ Changes with APR 0.9.4 - + *) Solaris cc: Don't use the -mt option for threaded builds. That + is for non-Posix threading, and the use of it prevented us from + linking with -lpthread, which in turn caused weird problems for + APR applications. [Kristofer Spinka ] Changes with APR 0.9.3 diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index ba7644aa16b..83462d99ec0 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -117,7 +117,7 @@ APR_PTHREADS_CHECK_COMPILE AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[ ac_cv_pthreads_cflags="" if test "$pthreads_working" != "yes"; then - for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt; do + for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads; do ac_save="$CFLAGS" CFLAGS="$CFLAGS $flag" APR_PTHREADS_CHECK_COMPILE From c8a2dfe06818c2308a732069776395a0fc055d93 Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 1 Apr 2003 20:13:29 +0000 Subject: [PATCH 4443/7878] Make consistent with other platforms by not exporting apr_sendfile if no APR_HAS_SENDFILE. If it should be exported, then someone will have to remove the conditionals from the global include file and add stubs to the other platforms for apr_sendfile and apr_socket_sendfile. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64466 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 82d7af52e77..443a86c8181 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -994,25 +994,16 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, #error version of it for APR yet. To get past this, either write apr_sendfile #error or change APR_HAS_SENDFILE in apr.h to 0. #endif /* __linux__, __FreeBSD__, __HPUX__, _AIX, __MVS__, Tru64/OSF1 */ -#endif /* APR_HAS_SENDFILE */ - -#if !APR_HAS_SENDFILE -/* currently, exports.c includes a reference to apr_sendfile() even if - * apr_sendfile() doesn't work on the platform; - * this dummy version is just to get exports.c to compile/link - */ -apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, - apr_hdtr_t *hdtr, apr_off_t *offset, - apr_size_t *len, apr_int32_t flags); - /* avoid warning for no proto */ -apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, - apr_hdtr_t *hdtr, apr_off_t *offset, - apr_size_t *len, apr_int32_t flags) +/* deprecated */ +apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, + apr_int32_t flags) { - return APR_ENOTIMPL; + return apr_socket_sendfile(sock, file, hdtr, offset, len, flags); } -#endif + +#endif /* APR_HAS_SENDFILE */ /* deprecated */ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) @@ -1044,14 +1035,6 @@ apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, return apr_socket_recvfrom(from, sock, flags, buf, len); } -/* deprecated */ -apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, - apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, - apr_int32_t flags) -{ - return apr_socket_sendfile(sock, file, hdtr, offset, len, flags); -} - /* deprecated */ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) { From 12e373a3d1b8180fcb22535b7742bfff6b41f9ca Mon Sep 17 00:00:00 2001 From: "Roy T. Fielding" Date: Tue, 1 Apr 2003 22:28:35 +0000 Subject: [PATCH 4444/7878] Don't add the math library (-lm) if the modf() function is already available via libc. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64467 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 9e5a6cb41d8..bc4c8164816 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.4 + *) Don't add the math library (-lm) if the modf() function + is already available via libc. [Roy Fielding] + *) Solaris cc: Don't use the -mt option for threaded builds. That is for non-Posix threading, and the use of it prevented us from linking with -lpthread, which in turn caused weird problems for diff --git a/configure.in b/configure.in index b9593528bd7..bacbee63772 100644 --- a/configure.in +++ b/configure.in @@ -487,7 +487,7 @@ AC_SEARCH_LIBS(gethostname, nsl) AC_CHECK_LIB(socket, socket) AC_SEARCH_LIBS(crypt, crypt ufc) AC_CHECK_LIB(truerand, main) -AC_CHECK_LIB(m, modf) +AC_SEARCH_LIBS(modf, m) dnl ----------------------------- Checking for Threads echo "${nl}Checking for Threads..." From 0786e451fd881710b108c0986c74074546656623 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 2 Apr 2003 14:23:51 +0000 Subject: [PATCH 4445/7878] fix the required set of libraries determined by apr on systems where there is a modf in libc but sqrt is in libm git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64468 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index bacbee63772..7da151c6faa 100644 --- a/configure.in +++ b/configure.in @@ -488,6 +488,7 @@ AC_CHECK_LIB(socket, socket) AC_SEARCH_LIBS(crypt, crypt ufc) AC_CHECK_LIB(truerand, main) AC_SEARCH_LIBS(modf, m) +AC_SEARCH_LIBS(sqrt, m) dnl ----------------------------- Checking for Threads echo "${nl}Checking for Threads..." From b9ba46e5a57180813c71b944be77cc7b96340b42 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 3 Apr 2003 15:27:38 +0000 Subject: [PATCH 4446/7878] Call apr_file_flush() on a buffered file before getting the file info. Submitted by: Blair Zajac git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64469 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 7c23fa78f17..de5e1393288 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -115,6 +115,12 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, { struct stat info; + if (thefile->buffered) { + apr_status_t rv = apr_file_flush(thefile); + if (rv != APR_SUCCESS) + return rv; + } + if (fstat(thefile->filedes, &info) == 0) { finfo->pool = thefile->pool; finfo->fname = thefile->fname; From 6d798c430a8be5b62928cb5ae5325072ecc9d156 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 3 Apr 2003 23:20:05 +0000 Subject: [PATCH 4447/7878] add some additional information to the documentation of apr_file_gets() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64470 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 3f1184aa8f6..6a2800b5ac5 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -451,6 +451,10 @@ APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile); * @param str The buffer to store the string in. * @param len The length of the string * @param thefile The file descriptor to read from + * @remark APR_EOF will be returned if some characters are read but the end + * of file is reached before a newline is read. + * @remark The buffer will be '\0'-terminated if any characters are stored, + * even if something other than APR_SUCCESS is returned. */ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile); From 9531f04a9fcae92ab4c467392566ab82321802c9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 4 Apr 2003 04:16:00 +0000 Subject: [PATCH 4448/7878] don't bother j random user with missing function prototype warnings on AIX, particularly since we get a bunch of uninteresting ones related to errno; leave it for --enable-maintainer-mode git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64471 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- configure.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 356559fe6da..a93de9cfa3f 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -59,7 +59,7 @@ if test "x$apr_preload_done" != "xyes" ; then dnl If using xlc, remember it, and give it the right options. if $CC 2>&1 | grep 'xlc' > /dev/null; then APR_SETIFNULL(AIX_XLC, [yes]) - APR_ADDTO(CFLAGS, [-qHALT=E -qinfo=pro]) + APR_ADDTO(CFLAGS, [-qHALT=E]) fi APR_SETIFNULL(apr_iconv_inbuf_const, [1]) APR_SETIFNULL(apr_sysvsem_is_global, [yes]) diff --git a/configure.in b/configure.in index 7da151c6faa..1bf5d196993 100644 --- a/configure.in +++ b/configure.in @@ -226,7 +226,7 @@ AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations]) elif test "$AIX_XLC" = "yes"; then - APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE -qcheck=all) + APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE -qcheck=all -qinfo=pro) fi ])dnl From 64271535e08398ff17390097c5b765ea2675ef2b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 4 Apr 2003 11:47:40 +0000 Subject: [PATCH 4449/7878] Implement APR_SO_RCVBUF socket option on Unix. Submitted by: Adam Sussman Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64472 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ network_io/unix/sockopt.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGES b/CHANGES index bc4c8164816..ae33f812ab7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.4 + *) Implement APR_SO_RCVBUF socket option on Unix. + [Adam Sussman ] + *) Don't add the math library (-lm) if the modf() function is already available via libc. [Roy Fielding] diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 2e26659beda..51f9fd8fe6f 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -196,6 +196,18 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, } #else return APR_ENOTIMPL; +#endif + break; + case APR_SO_RCVBUF: +#ifdef SO_RCVBUF + if (apr_is_option_set(sock->netmask, APR_SO_RCVBUF) != on) { + if (setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVBUF, (void *)&on, sizeof(int)) == -1) { + return errno; + } + apr_set_option(&sock->netmask, APR_SO_RCVBUF, on); + } +#else + return APR_ENOTIMPL; #endif break; case APR_SO_NONBLOCK: From b37ee97f33e42259f1c85e5b2f434ae1776edc0f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 4 Apr 2003 12:05:53 +0000 Subject: [PATCH 4450/7878] update the name of a function in a comment Submitted by: Stas Bekman Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64473 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index f5108b0d0ec..2f1ae128ae8 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -361,7 +361,7 @@ APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, struct apr_table_t { /* This has to be first to promote backwards compatibility with * older modules which cast a apr_table_t * to an apr_array_header_t *... - * they should use the table_elts() function for most of the + * they should use the apr_table_elts() function for most of the * cases they do this for. */ /** The underlying array for the table */ From becd5ab448ab719492c8fb891159ef35a49161c3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 4 Apr 2003 12:46:01 +0000 Subject: [PATCH 4451/7878] update an entry on a solaris lock problem with information about the system tuning requirements for dealing with it Submitted by: Kristofer Spinka Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64474 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index d4540884dca..9eff903afa0 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2003/03/31 05:34:30 $] +Last modified at [$Date: 2003/04/04 12:46:01 $] Release: @@ -303,6 +303,27 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: This gives me more rationale for switching the default interprocess lock mechanism to pthread (if available). + Explanation: + ============ + The system imposed default limit of outstanding lock requests is + 512. + You can verify this by, in a contemporary version of Solaris: + + # mdb -k + > tune_t_flckrec/D + tune_t_flckrec: + tune_t_flckrec: 512 + + This can be increased by adding the following to /etc/system: + + set tune_t_flckrec=1024 + + and rebooting. + + Of course "1024" can be any reasonable limit, although we do not know + what "reasonable" should be, so be conservative, only increase this as + necessary. + * Generate a good bug report to send to the FreeBSD hackers that details the problems we have seen with threads and system calls (specifically sendfile data is corrupted). From our analysis so far, we don't think From fb60be89cd2a1323fa4b36a4d518f3ddbe42048b Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 5 Apr 2003 21:42:20 +0000 Subject: [PATCH 4452/7878] Add parameter to APR_SUBDIR_CONFIG to drop options passed to configure before the subdir's configure is invoked. Also, add documentation notes on what this macro does and autoconf version caveats that need to be watched out for! Inspired by: Jeff's patch to httpd-2.0 (which was inspired by me on dev@httpd) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64475 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ build/apr_common.m4 | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index ae33f812ab7..cd950d86c3a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR 0.9.4 + *) Add parameter to APR_SUBDIR_CONFIG to drop options passed to configure + before the subdir's configure is invoked. + [Jeff Trawick, Justin Erenkrantz] + *) Implement APR_SO_RCVBUF socket option on Unix. [Adam Sussman ] diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 8dbe89423c5..29e69bbbb73 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -74,7 +74,24 @@ AC_DEFUN(APR_MKDIR_P_CHECK,[ ]) dnl -dnl APR_SUBDIR_CONFIG(dir [, sub-package-cmdline-args]) +dnl APR_SUBDIR_CONFIG(dir [, sub-package-cmdline-args, args-to-drop]) +dnl +dnl dir: directory to find configure in +dnl sub-package-cmdline-args: arguments to add to the invocation (optional) +dnl args-to-drop: arguments to drop from the invocation (optional) +dnl +dnl Note: This macro relies on ac_configure_args being set properly. +dnl +dnl The args-to-drop argument is shoved into a case statement, so +dnl multiple arguments can be separated with a |. +dnl +dnl Note: Older versions of autoconf do not single-quote args, while 2.54+ +dnl places quotes around every argument. So, if you want to drop the +dnl argument called --enable-layout, you must pass the third argument as: +dnl [--enable-layout=*|\'--enable-layout=*] +dnl +dnl Trying to optimize this is left as an exercise to the reader who wants +dnl to put up with more autoconf craziness. I give up. dnl AC_DEFUN(APR_SUBDIR_CONFIG, [ # save our work to this point; this allows the sub-package to use it @@ -102,13 +119,27 @@ changequote([, ])dnl ac_sub_cache_file="$ac_popdir/$cache_file" ;; esac + ifelse($3, [], [apr_configure_args=$ac_configure_args],[ + apr_configure_args= + apr_sep= + for apr_configure_arg in $ac_configure_args + do + case "$apr_configure_arg" in + $3) + continue ;; + esac + apr_configure_args="$apr_configure_args$apr_sep'$apr_configure_arg'" + apr_sep=" " + done + ]) + dnl The eval makes quoting arguments work - specifically $2 where the dnl quoting mechanisms used is "" rather than []. dnl dnl We need to execute another shell because some autoconf/shell combinations dnl will choke after doing repeated APR_SUBDIR_CONFIG()s. (Namely Solaris dnl and autoconf-2.54+) - if eval $SHELL $ac_abs_srcdir/configure $ac_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $2 + if eval $SHELL $ac_abs_srcdir/configure $apr_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $2 then : echo "$1 configured properly" else From 025f8a7d7da5f86df9df4e309b240ebe1b8176a5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 10 Apr 2003 12:20:35 +0000 Subject: [PATCH 4453/7878] give some credit where credit is due git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64476 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STATUS b/STATUS index 9eff903afa0..02874f35ea6 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2003/04/04 12:46:01 $] +Last modified at [$Date: 2003/04/10 12:20:35 $] Release: @@ -303,7 +303,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: This gives me more rationale for switching the default interprocess lock mechanism to pthread (if available). - Explanation: + Explanation (from Kristofer Spinka ): ============ The system imposed default limit of outstanding lock requests is 512. From 67b463348d87907df8be6d2d5114e4f0edc6a3e2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 11 Apr 2003 20:27:37 +0000 Subject: [PATCH 4454/7878] Note bjh's patch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64477 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index cd950d86c3a..7f85f9dcaca 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,11 @@ Changes with APR 0.9.4 linking with -lpthread, which in turn caused weird problems for APR applications. [Kristofer Spinka ] + *) OS/2: apr_stat() fixes - When a character device is stat'ed, + fill in finfo.name if it was asked for. Return APR_INCOMPLETE + when appropriate. Addresses httpd incident [CAN-2003-0134]. + [Brian Havard] + Changes with APR 0.9.3 *) Don't enable posixsem, at build time, on systems where sem_t * From 71d685d3ab927cf85ff22486d850203adb4cac3b Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 12 Apr 2003 11:23:54 +0000 Subject: [PATCH 4455/7878] iov_len can be too big for an int (e.g., ia64 Linux) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64478 13f79535-47bb-0310-9956-ffa450edef68 --- test/sendfile.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/sendfile.c b/test/sendfile.c index 758a527e5a0..95e5c3ad545 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -356,15 +356,16 @@ static int client(client_socket_mode_t socket_mode, char *host) printf("Calling apr_socket_sendfile()...\n"); printf("Headers (%d):\n", hdtr.numheaders); for (i = 0; i < hdtr.numheaders; i++) { - printf("\t%d bytes (%c)\n", - hdtr.headers[i].iov_len, *(char *)hdtr.headers[i].iov_base); + printf("\t%ld bytes (%c)\n", + (long)hdtr.headers[i].iov_len, + *(char *)hdtr.headers[i].iov_base); } printf("File: %ld bytes from offset %ld\n", (long)tmplen, (long)current_file_offset); printf("Trailers (%d):\n", hdtr.numtrailers); for (i = 0; i < hdtr.numtrailers; i++) { - printf("\t%d bytes\n", - hdtr.trailers[i].iov_len); + printf("\t%ld bytes\n", + (long)hdtr.trailers[i].iov_len); } rv = apr_socket_sendfile(sock, f, &hdtr, ¤t_file_offset, &tmplen, 0); From 0b177f0ebdc1f1ae9270a97f7eddd5b55f1962db Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 12 Apr 2003 11:25:01 +0000 Subject: [PATCH 4456/7878] add some tests of apr_pollset_remove() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64479 13f79535-47bb-0310-9956-ffa450edef68 --- test/testpoll.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/test/testpoll.c b/test/testpoll.c index 2231dca6749..ccef578f139 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -452,6 +452,83 @@ static void close_all_sockets(CuTest *tc) } } +static void pollset_remove(CuTest *tc) +{ + apr_status_t rv; + apr_pollset_t *pollset; + const apr_pollfd_t *hot_files; + apr_pollfd_t pfd; + apr_int32_t num; + + rv = apr_pollset_create(&pollset, 5, p, 0); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + pfd.p = p; + pfd.desc_type = APR_POLL_SOCKET; + pfd.reqevents = APR_POLLOUT; + + pfd.desc.s = s[0]; + pfd.client_data = (void *)1; + rv = apr_pollset_add(pollset, &pfd); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + pfd.desc.s = s[1]; + pfd.client_data = (void *)2; + rv = apr_pollset_add(pollset, &pfd); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + pfd.desc.s = s[2]; + pfd.client_data = (void *)3; + rv = apr_pollset_add(pollset, &pfd); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + pfd.desc.s = s[1]; + pfd.client_data = (void *)4; + rv = apr_pollset_add(pollset, &pfd); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + pfd.desc.s = s[3]; + pfd.client_data = (void *)5; + rv = apr_pollset_add(pollset, &pfd); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 5, num); + + /* now remove the pollset elements referring to desc s[1] */ + pfd.desc.s = s[1]; + pfd.client_data = (void *)999; /* not used on this call */ + rv = apr_pollset_remove(pollset, &pfd); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + /* this time only three should match */ + rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 3, num); + CuAssertPtrEquals(tc, (void *)1, hot_files[0].client_data); + CuAssertPtrEquals(tc, s[0], hot_files[0].desc.s); + CuAssertPtrEquals(tc, (void *)3, hot_files[1].client_data); + CuAssertPtrEquals(tc, s[2], hot_files[1].desc.s); + CuAssertPtrEquals(tc, (void *)5, hot_files[2].client_data); + CuAssertPtrEquals(tc, s[3], hot_files[2].desc.s); + + /* now remove the pollset elements referring to desc s[2] */ + pfd.desc.s = s[2]; + pfd.client_data = (void *)999; /* not used on this call */ + rv = apr_pollset_remove(pollset, &pfd); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + /* this time only two should match */ + rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 2, num); + CuAssertPtrEquals(tc, (void *)1, hot_files[0].client_data); + CuAssertPtrEquals(tc, s[0], hot_files[0].desc.s); + CuAssertPtrEquals(tc, (void *)5, hot_files[1].client_data); + CuAssertPtrEquals(tc, s[3], hot_files[1].desc.s); +} + CuSuite *testpoll(void) { CuSuite *suite = CuSuiteNew("Poll"); @@ -478,6 +555,8 @@ CuSuite *testpoll(void) SUITE_ADD_TEST(suite, send_last_pollset); SUITE_ADD_TEST(suite, clear_last_pollset); + SUITE_ADD_TEST(suite, pollset_remove); + SUITE_ADD_TEST(suite, close_all_sockets); return suite; From 9c2566e2c678d7fad88f9a7f13880a42aca734a8 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 15 Apr 2003 21:45:58 +0000 Subject: [PATCH 4457/7878] implement APR_UINT64_T_HEX_FMT Reviewed by: Bill Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64480 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ configure.in | 7 +++++++ include/apr.h.in | 4 ++++ include/apr.hnw | 2 ++ include/apr.hw | 2 ++ test/testfmt.c | 20 ++++++++++++++++++++ 6 files changed, 37 insertions(+) diff --git a/CHANGES b/CHANGES index 7f85f9dcaca..31e5f35d227 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR 0.9.4 + *) Add APR_UINT64_T_HEX_FMT. [Jeff Trawick] + *) Add parameter to APR_SUBDIR_CONFIG to drop options passed to configure before the subdir's configure is invoked. [Jeff Trawick, Justin Erenkrantz] diff --git a/configure.in b/configure.in index 1bf5d196993..b12f50142d6 100644 --- a/configure.in +++ b/configure.in @@ -1079,6 +1079,7 @@ if test "$ac_cv_sizeof_int" = "8"; then int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 1' uint64_t_fmt='#define APR_UINT64_T_FMT "u"' uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 1' + uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "x"' int64_value="int" long_value=int int64_strfn="strtoi" @@ -1088,6 +1089,7 @@ elif test "$ac_cv_sizeof_long" = "8"; then int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' uint64_t_fmt='#define APR_UINT64_T_FMT "lu"' uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 2' + uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "lx"' int64_value="long" long_value=long int64_strfn="strtol" @@ -1101,6 +1103,7 @@ elif test "$ac_cv_sizeof_long_long" = "8"; then int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 3' uint64_t_fmt='#define APR_UINT64_T_FMT "llu"' uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 3' + uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "llx"' int64_value="long long" long_value="long long" int64_strfn="strtoll" @@ -1110,6 +1113,7 @@ elif test "$ac_cv_sizeof_long_double" = "8"; then int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' uint64_t_fmt='#define APR_UINT64_T_FMT "Lu"' uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 2' + uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "Lx"' int64_value="long double" long_value="long double" int64_strfn="strtoll" @@ -1119,6 +1123,7 @@ elif test "$ac_cv_sizeof_longlong" = "8"; then int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' uint64_t_fmt='#define APR_UINT64_T_FMT "qu"' uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 2' + uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "qx"' int64_value="__int64" long_value="__int64" int64_strfn="strtoll" @@ -1130,6 +1135,7 @@ else int64_t_fmt_len='#error Can not determine the proper size for apr_int64_t' uint64_t_fmt='#error Can not determine the proper size for apr_int64_t' uint64_t_fmt_len='#error Can not determine the proper size for apr_int64_t' + uint64_t_hex_fmt='#error Can not determine the proper size for apr_uint64_t' fi # If present, allow the C99 macro INT64_C to override our conversion. @@ -1270,6 +1276,7 @@ AC_SUBST(int64_t_fmt) AC_SUBST(int64_t_fmt_len) AC_SUBST(uint64_t_fmt) AC_SUBST(uint64_t_fmt_len) +AC_SUBST(uint64_t_hex_fmt) AC_SUBST(ssize_t_fmt) AC_SUBST(size_t_fmt) AC_SUBST(off_t_fmt) diff --git a/include/apr.h.in b/include/apr.h.in index cb223859c53..8a865a92b42 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -396,6 +396,10 @@ typedef @socklen_t_value@ apr_socklen_t; @uint64_t_fmt@ @uint64_t_fmt_len@ +/* And APR_UINT64_T_HEX_FMT */ +@uint64_t_hex_fmt@ +#define APR_UINT64_T_HEX_FMT_LEN (sizeof(APR_UINT64_T_HEX_FMT) - 1) + /* Deal with atoi64 variables ... these should move to apr_private.h */ #define APR_HAVE_INT64_STRFN @have_int64_strfn@ #define APR_INT64_STRFN @int64_strfn@ diff --git a/include/apr.hnw b/include/apr.hnw index 6af0bb01389..5687d7ee3f5 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -362,6 +362,8 @@ typedef int apr_wait_t; #define APR_INT64_T_FMT_LEN 3 #define APR_UINT64_T_FMT "llu" #define APR_UINT64_T_FMT_LEN 3 +#define APR_UINT64_T_HEX_FMT "llx" +#define APR_UINT64_T_HEX_FMT_LEN (sizeof(APR_UINT64_T_HEX_FMT) - 1) #define APR_TIME_T_FMT APR_INT64_T_FMT /* Deal with atoi64 variables ... these should move to apr_private.h */ diff --git a/include/apr.hw b/include/apr.hw index 8f19469421a..7ac2d29b570 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -495,6 +495,8 @@ typedef int gid_t; #define APR_INT64_T_FMT_LEN 4 #define APR_UINT64_T_FMT "I64u" #define APR_UINT64_T_FMT_LEN 4 +#define APR_UINT64_T_HEX_FMT "I64x" +#define APR_UINT64_T_HEX_FMT_LEN (sizeof(APR_UINT64_T_HEX_FMT) - 1) /* Deal with atoi64 variables ... these should move to apr_private.h */ /* MSVC 7.0 introduced _strtoui64 */ diff --git a/test/testfmt.c b/test/testfmt.c index aaa63529c18..6f1d7f365a9 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -102,6 +102,24 @@ static void int64_t_fmt(CuTest *tc) CuAssertStrEquals(tc, buf, "0"); } +static void uint64_t_fmt(CuTest *tc) +{ + char buf[100]; + apr_uint64_t var = 14000000; + + sprintf(buf, "%" APR_UINT64_T_FMT, var); + CuAssertStrEquals(tc, buf, "14000000"); +} + +static void uint64_t_hex_fmt(CuTest *tc) +{ + char buf[100]; + apr_uint64_t var = 14000000; + + sprintf(buf, "%" APR_UINT64_T_HEX_FMT, var); + CuAssertStrEquals(tc, buf, "d59f80"); +} + CuSuite *testfmt(void) { CuSuite *suite = CuSuiteNew("Formats"); @@ -111,6 +129,8 @@ CuSuite *testfmt(void) SUITE_ADD_TEST(suite, off_t_fmt); SUITE_ADD_TEST(suite, pid_t_fmt); SUITE_ADD_TEST(suite, int64_t_fmt); + SUITE_ADD_TEST(suite, uint64_t_fmt); + SUITE_ADD_TEST(suite, uint64_t_hex_fmt); return suite; } From 76b31a91b896a2763d2b75b5240c0b220c5203ee Mon Sep 17 00:00:00 2001 From: "Allan K. Edwards" Date: Tue, 15 Apr 2003 22:28:13 +0000 Subject: [PATCH 4458/7878] Add APR_TCP_NODELAY_INHERITED & APR_O_NONBLOCK_INHERITED to apr.hw git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64481 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr.hw | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGES b/CHANGES index 31e5f35d227..8463491f713 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.4 + *) Add APR_TCP_NODELAY_INHERITED & APR_O_NONBLOCK_INHERITED to apr.hw + [Allan Edwards] + *) Add APR_UINT64_T_HEX_FMT. [Jeff Trawick] *) Add parameter to APR_SUBDIR_CONFIG to drop options passed to configure diff --git a/include/apr.hw b/include/apr.hw index 7ac2d29b570..621ea50db46 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -342,6 +342,14 @@ extern "C" { */ #define APR_CHARSET_EBCDIC 0 +/* Is the TCP_NODELAY socket option inherited from listening sockets? + */ +#define APR_TCP_NODELAY_INHERITED 1 + +/* Is the O_NONBLOCK flag inherited from listening sockets? + */ +#define APR_O_NONBLOCK_INHERITED 1 + /* Typedefs that APR needs. */ typedef unsigned char apr_byte_t; From 1d6dce179a90f94225334aa8d78a4503d23d18fa Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 16 Apr 2003 01:26:14 +0000 Subject: [PATCH 4459/7878] since the string description for APR_ENOENT comes from the system library (on Unix-like systems, at least), don't assume that the message is always "No such file or directory" (it might not even be returned in English) for APR_ENOENT, just make sure we get some string back add a test for an APR-specific error code where we can expect a certain string from apr_strerror() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64482 13f79535-47bb-0310-9956-ffa450edef68 --- test/teststr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/teststr.c b/test/teststr.c index f8e0a31dd95..2c4a3c154a8 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -184,11 +184,15 @@ static void snprintf_int64(CuTest *tc) static void string_error(CuTest *tc) { char buf[128], *rv; - + + buf[0] = '\0'; rv = apr_strerror(APR_ENOENT, buf, sizeof buf); CuAssertPtrEquals(tc, buf, rv); - /* ### relax this comparison. */ - CuAssertStrEquals(tc, "No such file or directory", buf); + CuAssertTrue(tc, strlen(buf) > 0); + + rv = apr_strerror(APR_TIMEUP, buf, sizeof buf); + CuAssertPtrEquals(tc, buf, rv); + CuAssertStrEquals(tc, "The timeout specified has expired", buf); } CuSuite *teststr(void) From d947f698a20bc8798f6364c080975e1c92d7baf9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 16 Apr 2003 12:39:22 +0000 Subject: [PATCH 4460/7878] add a hint that may help somebod get apr_env_delete() working on their box git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64483 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/env.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/misc/unix/env.c b/misc/unix/env.c index f8ef3c2a220..b96be21cc88 100644 --- a/misc/unix/env.c +++ b/misc/unix/env.c @@ -123,6 +123,13 @@ APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool) return APR_SUCCESS; #else + /* hint: some platforms allow envvars to be unset via + * putenv("varname")... that isn't Single Unix spec, + * but if your platform doesn't have unsetenv() it is + * worth investigating and potentially adding a + * configure check to decide when to use that form of + * putenv() here + */ return APR_ENOTIMPL; #endif } From 56ca27271f4f2b017ffb1e55578c6c507e5bc07b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 16 Apr 2003 15:59:01 +0000 Subject: [PATCH 4461/7878] Add another hack to make testdso pass on BSD/OS; this needs fixing properly sometime as these workarounds will break with future libtool releases. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64484 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testdso.c b/test/testdso.c index 26768ff5991..2b88c356140 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -74,7 +74,7 @@ #elif defined(__hpux__) # define MOD_NAME ".libs/mod_test.sl" # define LIB_NAME ".libs/libmod_test.sl" -#elif defined(_AIX) +#elif defined(_AIX) || defined(__bsdi__) # define MOD_NAME ".libs/libmod_test.so" # define LIB_NAME ".libs/libmod_test.so" #else /* Every other Unix */ From d997e6f5275aa2a2d536116b47790e41a02eb433 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 17 Apr 2003 17:31:56 +0000 Subject: [PATCH 4462/7878] Add %pT support to apr_snprintf() for printing an apr_os_thread_t. (from a series of suggestions on #apr) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64485 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_lib.h | 2 ++ strings/apr_snprintf.c | 50 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/CHANGES b/CHANGES index 8463491f713..4a22ff882fc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.4 + *) Add %pT support to apr_snprintf() for printing an apr_os_thread_t. + [Jeff Trawick] + *) Add APR_TCP_NODELAY_INHERITED & APR_O_NONBLOCK_INHERITED to apr.hw [Allan Edwards] diff --git a/include/apr_lib.h b/include/apr_lib.h index a4c6b97776c..90fd6e56454 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -155,6 +155,8 @@ APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname); * %%pA takes a struct in_addr *, and prints it as a.b.c.d * %%pI takes an apr_sockaddr_t * and prints it as a.b.c.d:port or * [ipv6-address]:port + * %%pT takes an apr_os_thread_t * and prints it in decimal + * ('0' is printed if !APR_HAS_THREADS) * %%pp takes a void * and outputs it in hex * * The %%p hacks are to force gcc's printf warning code to skip diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 191503c3c54..dbf8a473aaf 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -62,6 +62,7 @@ #include "apr_lib.h" #include "apr_strings.h" #include "apr_network_io.h" +#include "apr_portable.h" #include #if APR_HAVE_CTYPE_H #include @@ -534,6 +535,30 @@ static char *conv_apr_sockaddr(apr_sockaddr_t *sa, char *buf_end, int *len) +#if APR_HAS_THREADS +static char *conv_os_thread_t(apr_os_thread_t *tid, char *buf_end, int *len) +{ + union { + apr_os_thread_t tid; + apr_uint64_t alignme; + } u; + int is_negative; + + u.tid = *tid; + switch(sizeof(u.tid)) { + case sizeof(apr_int32_t): + return conv_10(*(apr_uint32_t *)&u.tid, TRUE, &is_negative, buf_end, len); + case sizeof(apr_int64_t): + return conv_10_quad(*(apr_uint64_t *)&u.tid, TRUE, &is_negative, buf_end, len); + default: + /* not implemented; stick 0 in the buffer */ + return conv_10(0, TRUE, &is_negative, buf_end, len); + } +} +#endif + + + /* * Convert a floating point number to a string formats 'f', 'e' or 'E'. * The result is placed in buf, and len denotes the length of the string @@ -1160,6 +1185,31 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), } break; + case 'T': +#if APR_HAS_THREADS + { + apr_os_thread_t *tid; + + tid = va_arg(ap, apr_os_thread_t *); + if (tid != NULL) { + s = conv_os_thread_t(tid, &num_buf[NUM_BUF_SIZE], &s_len); + if (adjust_precision && precision < s_len) + s_len = precision; + } + else { + s = S_NULL; + s_len = S_NULL_LEN; + } + pad_char = ' '; + } +#else + char_buf[0] = '0'; + s = &char_buf[0]; + s_len = 1; + pad_char = ' '; +#endif + break; + case NUL: /* if %p ends the string, oh well ignore it */ continue; From 43339f9909faa6cdb71e47ab5a6b53360d5cff15 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Apr 2003 18:09:22 +0000 Subject: [PATCH 4463/7878] no need to list testall more than once git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64486 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 21cef88b55b..95ccb8773ce 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -33,8 +33,8 @@ INCLUDES=-I$(INCDIR) CFLAGS=$(MY_CFLAGS) -check: $(PROGRAMS) $(NONPORTABLE) testall - for prog in $(PROGRAMS) $(NONPORTABLE) testall; do \ +check: $(PROGRAMS) $(NONPORTABLE) + for prog in $(PROGRAMS) $(NONPORTABLE); do \ ./$$prog; \ if test $$? = 255; then \ echo "$$prog failed"; \ From 76c10bebed2daa15b19cd9c22e8409c28690e49f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Apr 2003 18:10:01 +0000 Subject: [PATCH 4464/7878] we already verify that apr-determined format strings work fine with the system library; might as well check that they work with apr_snprintf too git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64487 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfmt.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/test/testfmt.c b/test/testfmt.c index 6f1d7f365a9..e1eb72e0984 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -63,7 +63,9 @@ static void ssize_t_fmt(CuTest *tc) apr_ssize_t var = 0; sprintf(buf, "%" APR_SSIZE_T_FMT, var); - CuAssertStrEquals(tc, buf, "0"); + CuAssertStrEquals(tc, "0", buf); + apr_snprintf(buf, sizeof(buf), "%" APR_SSIZE_T_FMT, var); + CuAssertStrEquals(tc, "0", buf); } static void size_t_fmt(CuTest *tc) @@ -72,7 +74,9 @@ static void size_t_fmt(CuTest *tc) apr_size_t var = 0; sprintf(buf, "%" APR_SIZE_T_FMT, var); - CuAssertStrEquals(tc, buf, "0"); + CuAssertStrEquals(tc, "0", buf); + apr_snprintf(buf, sizeof(buf), "%" APR_SIZE_T_FMT, var); + CuAssertStrEquals(tc, "0", buf); } static void off_t_fmt(CuTest *tc) @@ -81,7 +85,9 @@ static void off_t_fmt(CuTest *tc) apr_off_t var = 0; sprintf(buf, "%" APR_OFF_T_FMT, var); - CuAssertStrEquals(tc, buf, "0"); + CuAssertStrEquals(tc, "0", buf); + apr_snprintf(buf, sizeof(buf), "%" APR_OFF_T_FMT, var); + CuAssertStrEquals(tc, "0", buf); } static void pid_t_fmt(CuTest *tc) @@ -90,7 +96,9 @@ static void pid_t_fmt(CuTest *tc) pid_t var = 0; sprintf(buf, "%" APR_PID_T_FMT, var); - CuAssertStrEquals(tc, buf, "0"); + CuAssertStrEquals(tc, "0", buf); + apr_snprintf(buf, sizeof(buf), "%" APR_PID_T_FMT, var); + CuAssertStrEquals(tc, "0", buf); } static void int64_t_fmt(CuTest *tc) @@ -99,7 +107,9 @@ static void int64_t_fmt(CuTest *tc) apr_int64_t var = 0; sprintf(buf, "%" APR_INT64_T_FMT, var); - CuAssertStrEquals(tc, buf, "0"); + CuAssertStrEquals(tc, "0", buf); + apr_snprintf(buf, sizeof(buf), "%" APR_INT64_T_FMT, var); + CuAssertStrEquals(tc, "0", buf); } static void uint64_t_fmt(CuTest *tc) @@ -108,7 +118,9 @@ static void uint64_t_fmt(CuTest *tc) apr_uint64_t var = 14000000; sprintf(buf, "%" APR_UINT64_T_FMT, var); - CuAssertStrEquals(tc, buf, "14000000"); + CuAssertStrEquals(tc, "14000000", buf); + apr_snprintf(buf, sizeof(buf), "%" APR_UINT64_T_FMT, var); + CuAssertStrEquals(tc, "14000000", buf); } static void uint64_t_hex_fmt(CuTest *tc) @@ -117,7 +129,9 @@ static void uint64_t_hex_fmt(CuTest *tc) apr_uint64_t var = 14000000; sprintf(buf, "%" APR_UINT64_T_HEX_FMT, var); - CuAssertStrEquals(tc, buf, "d59f80"); + CuAssertStrEquals(tc, "d59f80", buf); + apr_snprintf(buf, sizeof(buf), "%" APR_UINT64_T_HEX_FMT, var); + CuAssertStrEquals(tc, "d59f80", buf); } CuSuite *testfmt(void) From 734ad16a9b6fe8077ed13eee67acb2ffe81729bb Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 19 Apr 2003 02:33:13 +0000 Subject: [PATCH 4465/7878] Don't segfault trying to close a file in error paths of flock and fcntl mutex creation. PR: 19036 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64488 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ locks/unix/proc_mutex.c | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 4a22ff882fc..4cc983c1d0e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.4 + *) Don't segfault trying to close a file in error paths of flock + and fcntl mutex creation. PR 19036 [Jeff Trawick] + *) Add %pT support to apr_snprintf() for printing an apr_os_thread_t. [Jeff Trawick] diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 70bf7da8037..0a98e81f266 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -496,8 +496,9 @@ static apr_status_t proc_mutex_fcntl_cleanup(void *mutex_) if (status != APR_SUCCESS) return status; } - apr_file_close(mutex->interproc); - + if (mutex->interproc) { /* if it was opened successfully */ + apr_file_close(mutex->interproc); + } return APR_SUCCESS; } @@ -609,7 +610,9 @@ static apr_status_t proc_mutex_flock_cleanup(void *mutex_) if (status != APR_SUCCESS) return status; } - apr_file_close(mutex->interproc); + if (mutex->interproc) { /* if it was opened properly */ + apr_file_close(mutex->interproc); + } unlink(mutex->fname); return APR_SUCCESS; } From f6e7a4f8c90ae74e85bc450ff5be0512c8daa36e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 21 Apr 2003 14:21:59 +0000 Subject: [PATCH 4466/7878] Add --cc and --cpp flags to apr-config. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64489 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ apr-config.in | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGES b/CHANGES index 4cc983c1d0e..a083e759fd6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR 0.9.4 + *) Add --cc and --cpp flags to apr-config. [Jeff Trawick] + *) Don't segfault trying to close a file in error paths of flock and fcntl mutex creation. PR 19036 [Jeff Trawick] diff --git a/apr-config.in b/apr-config.in index 0bb228c99af..0593e48fcf7 100644 --- a/apr-config.in +++ b/apr-config.in @@ -89,6 +89,8 @@ Known values for OPTION are: --prefix[=DIR] change prefix to DIR --bindir print location where binaries are installed --includedir print location where headers are installed + --cc print C compiler name + --cpp print C preprocessor name and any required options --cflags print C compiler flags --cppflags print cpp flags --includes print include information @@ -185,6 +187,14 @@ while test $# -gt 0; do echo $flags exit 0 ;; + --cc) + echo $CC + exit 0 + ;; + --cpp) + echo $CPP + exit 0 + ;; --cflags) flags="$flags $CFLAGS" ;; From fddc916210c295f358e4c20eddf9e3ef583e4cc3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 21 Apr 2003 22:36:56 +0000 Subject: [PATCH 4467/7878] apr_proc_create() on Unix: Make the APR_SHELLCMD mode work when there is more than one program argument passed in. It worked before (and still does) if the app somehow knows to pass in a single arg which is a string containing the program name and all args, such as when calling system(). Now it works if the app passes the program arguments normally, such as when using other modes of apr_proc_create(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64490 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ threadproc/unix/proc.c | 44 ++++++++++++++++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index a083e759fd6..3bd68a8e9f7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR 0.9.4 + *) apr_proc_create() on Unix: Make the APR_SHELLCMD mode work + when there is more than one program argument passed in. + [Jeff Trawick] + *) Add --cc and --cpp flags to apr-config. [Jeff Trawick] *) Don't segfault trying to close a file in error paths of flock diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 015fe04c3fe..2fbcb2908c5 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -317,7 +317,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, apr_pool_t *pool) { int i; - const char **newargs; new->in = attr->parent_in; new->err = attr->parent_err; @@ -423,22 +422,51 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } if (attr->cmdtype == APR_SHELLCMD) { - i = 0; - while (args[i]) { - i++; - } + int onearg_len = 0; + const char *newargs[4]; - newargs = (const char **)apr_palloc(pool, sizeof (char *) * (i + 3)); newargs[0] = SHELL_PATH; newargs[1] = "-c"; i = 0; while (args[i]) { - newargs[i + 2] = args[i]; + onearg_len += strlen(args[i]); + onearg_len++; /* for space delimiter */ i++; } - newargs[i + 2] = NULL; + switch(i) { + case 0: + /* bad parameters; we're doomed */ + break; + case 1: + /* no args, or caller already built a single string from + * progname and args + */ + newargs[2] = args[0]; + break; + default: + { + char *ch, *onearg; + + ch = onearg = apr_palloc(pool, onearg_len); + i = 0; + while (args[i]) { + size_t len = strlen(args[i]); + + memcpy(ch, args[i], len); + ch += len; + *ch = ' '; + ++ch; + ++i; + } + --ch; /* back up to trailing blank */ + *ch = '\0'; + newargs[2] = onearg; + } + } + + newargs[3] = NULL; if (attr->detached) { apr_proc_detach(APR_PROC_DETACH_DAEMONIZE); From 857bd1c53938e0c9241c99fb8a5e731979fdec65 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 27 Apr 2003 15:40:16 +0000 Subject: [PATCH 4468/7878] get prototype for apr_snprintf() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64491 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testfmt.c b/test/testfmt.c index e1eb72e0984..db43836f8f8 100644 --- a/test/testfmt.c +++ b/test/testfmt.c @@ -55,7 +55,7 @@ #include "test_apr.h" #include "apr.h" #include "apr_portable.h" - +#include "apr_strings.h" static void ssize_t_fmt(CuTest *tc) { From 4cf1fe8ef3b4608f696e7efbcdefad4d2d879849 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 28 Apr 2003 19:32:39 +0000 Subject: [PATCH 4469/7878] Add the collection of licenses for the various bits of APR code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64492 13f79535-47bb-0310-9956-ffa450edef68 --- LICENSE | 183 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000000..aa4f091ea65 --- /dev/null +++ b/LICENSE @@ -0,0 +1,183 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + +From strings/apr_fnmatch.c, include/apr_fnmatch.h, misc/unix/getopt.c, +file_io/unix/mktemp.c, strings/apr_strings.c: + +/* + * Copyright (c) 1987, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + +From network_io/unix/inet_ntop.c, network_io/unix/inet_pton.c: + +/* Copyright (c) 1996 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +From atomic/solaris_sparc/apr_atomic_sparc.s: + +!* This code is based on the UltraSPARC atomics library by Mike Bennett +!* The Initial Developer of the Original Code is Mike Bennett, +!* mbennett@netcom.com, Copyright (C) 1999. All Rights Reserved. +!* This code is based on the sparc architecture Manual version 9 +!* section J.11 (page 333) + +From dso/aix/dso.c: + + * Based on libdl (dlfcn.c/dlfcn.h) which is + * Copyright (c) 1992,1993,1995,1996,1997,1988 + * Jens-Uwe Mager, Helios Software GmbH, Hannover, Germany. + * + * Not derived from licensed software. + * + * Permission is granted to freely use, copy, modify, and redistribute + * this software, provided that the author is not construed to be liable + * for any results of using the software, alterations are clearly marked + * as such, and this notice is not modified. + +From strings/apr_strnatcmp.c, include/apr_strings.h: + + strnatcmp.c -- Perform 'natural order' comparisons of strings in C. + Copyright (C) 2000 by Martin Pool + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + +From test/CuTest.c, test/CuTest.h: + +/* + * Copyright (c) 2002-2006 Asim Jalis + * + * This library is released under the zlib/libpng license as described at + * + * http://www.opensource.org/licenses/zlib-license.html + * + * Here is the statement of the license: + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in a + * product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + */ From 3e3ad56977023c8c08a18795ae2167b274ac9634 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 29 Apr 2003 19:25:08 +0000 Subject: [PATCH 4470/7878] Check for librt on all platforms not just Solaris. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64493 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index b12f50142d6..48dcf91d409 100644 --- a/configure.in +++ b/configure.in @@ -626,13 +626,9 @@ AC_CHECK_FUNCS([getpwnam_r getpwuid_r getgrnam_r getgrgid_r]) dnl ----------------------------- Checking for Shared Memory Support echo "${nl}Checking for Shared Memory Support..." -# The POSIX function are in librt on Solaris. This will -# also help us find sem_open when doing locking below -case $host in - *-solaris*) - AC_CHECK_LIB(rt, shm_open) - ;; -esac +# The real-time POSIX extensions (e.g. shm_*, sem_*) may only +# be available if linking against librt. +AC_SEARCH_LIBS(shm_open, rt) AC_CHECK_HEADERS([sys/mman.h sys/ipc.h sys/shm.h sys/file.h kernel/OS.h os2.h]) AC_CHECK_FUNCS([mmap munmap shm_open shm_unlink shmget shmat shmdt shmctl \ From 7685b92aa876417791ff678778b53584e042d310 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 29 Apr 2003 19:57:56 +0000 Subject: [PATCH 4471/7878] Localize the fudge added in r1.10 to Win32, since it makes the test return NotImpl if run as root on Unix. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64494 13f79535-47bb-0310-9956-ffa450edef68 --- test/testuser.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/testuser.c b/test/testuser.c index 62d6ffb017e..69f87a422f8 100644 --- a/test/testuser.c +++ b/test/testuser.c @@ -88,6 +88,9 @@ static void username(CuTest *tc) CuAssertIntEquals(tc, APR_SUCCESS, rv); CuAssertIntEquals(tc, APR_SUCCESS, apr_uid_compare(uid, retreived_uid)); +#ifdef WIN32 + /* ### this fudge was added for Win32 but makes the test return NotImpl + * on Unix if run as root, when !gid is also true. */ if (!gid || !retreived_gid) { /* The function had no way to recover the gid (this would have been * an ENOTIMPL if apr_uid_ functions didn't try to double-up and @@ -101,8 +104,11 @@ static void username(CuTest *tc) } } else { +#endif CuAssertIntEquals(tc, APR_SUCCESS, apr_gid_compare(gid, retreived_gid)); +#ifdef WIN32 } +#endif } static void groupname(CuTest *tc) From 7701a29334af6047d88da7fdbb00fcf0cc271f4b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 29 Apr 2003 20:32:06 +0000 Subject: [PATCH 4472/7878] Fail gracefully rather than SEGV if data/file_datafile.txt can't be opened. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64495 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/testfile.c b/test/testfile.c index 318b5c532f9..4dd30e7258a 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -120,6 +120,7 @@ static void test_read(CuTest *tc) APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); + apr_assert_success(tc, "Opening test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); CuAssertIntEquals(tc, APR_SUCCESS, rv); CuAssertIntEquals(tc, strlen(TESTSTR), nbytes); @@ -137,6 +138,7 @@ static void test_filename(CuTest *tc) rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); + apr_assert_success(tc, "Opening test file " FILENAME, rv); rv = apr_file_name_get(&str, filetest); CuAssertIntEquals(tc, rv, APR_SUCCESS); @@ -155,7 +157,7 @@ static void test_fileclose(CuTest *tc) rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); - + apr_assert_success(tc, "Opening test file " FILENAME, rv); rv = apr_file_close(filetest); CuAssertIntEquals(tc, rv, APR_SUCCESS); @@ -247,6 +249,7 @@ static void test_seek(CuTest *tc) rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); + apr_assert_success(tc, "Open test file " FILENAME, rv); rv = apr_file_read(filetest, str, &nbytes); CuAssertIntEquals(tc, APR_SUCCESS, rv); From 267c1c81e6c7988cbcffb55c218c9ca2707295ae Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 30 Apr 2003 08:19:22 +0000 Subject: [PATCH 4473/7878] This code was licensed under version 1.0 of the Mozilla Public License (which is a copyleft and a lot more restrictive than the ASL). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64496 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/apr_atomic_sparc.s | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/atomic/solaris_sparc/apr_atomic_sparc.s b/atomic/solaris_sparc/apr_atomic_sparc.s index 5361db6ebbc..08586bf4b26 100644 --- a/atomic/solaris_sparc/apr_atomic_sparc.s +++ b/atomic/solaris_sparc/apr_atomic_sparc.s @@ -55,8 +55,21 @@ !* !* !* This code is based on the UltraSPARC atomics library by Mike Bennett -!* The Initial Developer of the Original Code is Mike Bennett, +!* +!* The contents of this file are subject to the Mozilla Public License +!* Version 1.0 (the "License"); you may not use this file except in +!* compliance with the License. You may obtain a copy of the License at +!* http://www.mozilla.org/MPL/ +!* +!* Software distributed under the License is distributed on an "AS IS" +!* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +!* License for the specific language governing rights and limitations +!* under the License. +!* +!* The Original Code is UltraSPARC atomics library. +!* The Initial Developer of the Original Code is Mike Bennett, !* mbennett@netcom.com, Copyright (C) 1999. All Rights Reserved. +!* !* This code is based on the sparc architecture Manual version 9 !* section J.11 (page 333) ! From 770ebb7d112c8e86c7f11cbf6d206e24e7d3ce1f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 30 Apr 2003 17:28:26 +0000 Subject: [PATCH 4474/7878] fix some problems with undesired build droppings left around after "make [foo]clean" for make clean: zap all test programs, not just the ones we run from "make check" for make distclean: zap exports.c, export_vars.h instead of waiting for extraclean zap apr_rules.mk... fix the old rules.mk references that weren't changed when the file was renamed to rules.mk for make extraclen: zap ltmain.sh and libtool.m4 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64497 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 5 ++--- build/.cvsignore | 1 - build/Makefile.in | 4 ++-- test/Makefile.in | 35 +++++++++++++++++++++++------------ 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/Makefile.in b/Makefile.in index 9bd282e40f9..6402e79cec2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -34,9 +34,8 @@ TARGETS = delete-lib $(TARGET_LIB) delete-exports export_vars.h apr.exp CLEAN_TARGETS = DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ - libtool apr.exp apr-config -EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in \ - exports.c export_vars.h + libtool apr.exp apr-config exports.c export_vars.h +EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in prefix=@prefix@ exec_prefix=@exec_prefix@ diff --git a/build/.cvsignore b/build/.cvsignore index 7af82beb129..8beda2ae171 100644 --- a/build/.cvsignore +++ b/build/.cvsignore @@ -3,7 +3,6 @@ libtool.m4 ltconfig ltmain.sh ltcf-c.sh -rules.mk apr_rules.mk LibD LibR diff --git a/build/Makefile.in b/build/Makefile.in index f7fff70fca5..c05665a195e 100644 --- a/build/Makefile.in +++ b/build/Makefile.in @@ -3,8 +3,8 @@ VPATH = @srcdir@ TARGETS= INCLUDES= -DISTCLEAN_TARGETS = rules.mk -EXTRACLEAN_TARGETS = ltcf-c.sh +DISTCLEAN_TARGETS = apr_rules.mk +EXTRACLEAN_TARGETS = ltcf-c.sh ltmain.sh libtool.m4 # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/test/Makefile.in b/test/Makefile.in index 95ccb8773ce..a904434a90a 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,12 +1,16 @@ srcdir = @srcdir@ VPATH = @srcdir@ -NONPORTABLE = \ - testshm@EXEEXT@ \ - testprocmutex@EXEEXT@ \ - testglobalmutex@EXEEXT@ - -PROGRAMS = \ +# PROGRAMS includes all test programs built on this platform. +# STDTEST_PORTABLE +# test programs invoked via standard user interface, run on all platforms +# STDTEST_NONPORTABLE +# test programs invoked via standard user interface, not portable +# OTHER_PROGRAMS +# programs such as sendfile, that have to be invoked in a special sequence +# or with special parameters + +STDTEST_PORTABLE = \ testflock@EXEEXT@ \ testsock@EXEEXT@ \ testlockperf@EXEEXT@ \ @@ -16,25 +20,32 @@ PROGRAMS = \ testmutexscope@EXEEXT@ \ testall@EXEEXT@ +STDTEST_NONPORTABLE = \ + testshm@EXEEXT@ \ + testprocmutex@EXEEXT@ \ + testglobalmutex@EXEEXT@ + +OTHER_PROGRAMS = client@EXEEXT@ sendfile@EXEEXT@ \ + server@EXEEXT@ + +PROGRAMS = $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) $(OTHER_PROGRAMS) -TARGETS = $(PROGRAMS) $(NONPORTABLE) client@EXEEXT@ sendfile@EXEEXT@ \ - server@EXEEXT@ +TARGETS = $(PROGRAMS) # bring in rules.mk for standard functionality @INCLUDE_RULES@ LOCAL_LIBS=../lib@APR_LIBNAME@.la -CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \ - testprocmutex@EXEEXT@ testglobalmutex@EXEEXT@ testshm@EXEEXT@ +CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ INCDIR=../include INCLUDES=-I$(INCDIR) CFLAGS=$(MY_CFLAGS) -check: $(PROGRAMS) $(NONPORTABLE) - for prog in $(PROGRAMS) $(NONPORTABLE); do \ +check: $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) + for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \ ./$$prog; \ if test $$? = 255; then \ echo "$$prog failed"; \ From eba03e5b8a296c7cf1355c1f50ac8bf78ec7503c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 1 May 2003 03:16:30 +0000 Subject: [PATCH 4475/7878] apr_file_gets(): Return APR_SUCCESS if any characters are returned. Any I/O errors or EOF will be reported on the next call. Callers that are coded to expect returned data + APR_EOF when there is no final newline are affected by this change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64498 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ file_io/os2/readwrite.c | 6 ++++++ file_io/unix/readwrite.c | 9 ++++++++- file_io/win32/readwrite.c | 6 ++++++ include/apr_file_io.h | 5 +---- test/testfile.c | 11 +++++++---- 6 files changed, 34 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index 3bd68a8e9f7..d5def9ddb50 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR 0.9.4 + *) apr_file_gets(): Return APR_SUCCESS if any characters are + returned. Any I/O errors or EOF will be reported on the + next call. Callers that are coded to expect returned + data + APR_EOF when there is no final newline are affected + by this change. [Jeff Trawick] + *) apr_proc_create() on Unix: Make the APR_SHELLCMD mode work when there is more than one program argument passed in. [Jeff Trawick] diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 20c29874222..6121ebc5a1a 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -349,6 +349,12 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) } } str[i] = 0; + if (i > 0) { + /* we stored chars; don't report EOF or any other errors; + * the app will find out about that on the next call + */ + return APR_SUCCESS; + } return rv; } diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index db412ec06ed..c7782a35b32 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -330,6 +330,7 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) { apr_status_t rv = APR_SUCCESS; /* get rid of gcc warning */ apr_size_t nbytes; + const char *str_start = str; char *final = str + len - 1; if (len <= 1) { @@ -353,7 +354,13 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) /* We must store a terminating '\0' if we've stored any chars. We can * get away with storing it if we hit an error first. */ - *str = '\0'; + *str = '\0'; + if (str > str_start) { + /* we stored chars; don't report EOF or any other errors; + * the app will find out about that on the next call + */ + return APR_SUCCESS; + } return rv; } diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index c54878a528f..6c023b4848a 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -458,6 +458,12 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) } } str[i] = 0; + if (i > 0) { + /* we stored chars; don't report EOF or any other errors; + * the app will find out about that on the next call + */ + return APR_SUCCESS; + } return rv; } diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 6a2800b5ac5..3a4fcbd4b2a 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -451,10 +451,7 @@ APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile); * @param str The buffer to store the string in. * @param len The length of the string * @param thefile The file descriptor to read from - * @remark APR_EOF will be returned if some characters are read but the end - * of file is reached before a newline is read. - * @remark The buffer will be '\0'-terminated if any characters are stored, - * even if something other than APR_SUCCESS is returned. + * @remark The buffer will be '\0'-terminated if any characters are stored. */ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile); diff --git a/test/testfile.c b/test/testfile.c index 4dd30e7258a..0c350f46e3c 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -372,12 +372,15 @@ static void test_gets(CuTest *tc) CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = apr_file_gets(str, 256, f); - /* Only one line in the test file, so we should get the EOF on the first - * call to gets. + /* Only one line in the test file, so APR will encounter EOF on the first + * call to gets, but we should get APR_SUCCESS on this call and + * APR_EOF on the next. */ - CuAssertIntEquals(tc, APR_EOF, rv); + CuAssertIntEquals(tc, APR_SUCCESS, rv); CuAssertStrEquals(tc, TESTSTR, str); - + rv = apr_file_gets(str, 256, f); + CuAssertIntEquals(tc, APR_EOF, rv); + CuAssertStrEquals(tc, "", str); apr_file_close(f); } From db930130ca1300da0ae8c7db722a99271136efb8 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Fri, 2 May 2003 16:38:15 +0000 Subject: [PATCH 4476/7878] reflect actual host-triple git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64499 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index a93de9cfa3f..6747dc6f692 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -226,8 +226,11 @@ dnl # Not a problem in 10.20. Otherwise, who knows? TPF) APR_ADDTO(CPPFLAGS, [-DTPF -D_POSIX_SOURCE]) ;; - BS2000*-siemens-sysv4*) + bs2000*-siemens-sysv*) + APR_SETIFNULL(CFLAGS, [-O]) APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV]) + APR_ADDTO(LIBS, [-lsocket]) + APR_SETIFNULL(enable_threads, [no]) ;; *-siemens-sysv4*) APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT]) @@ -389,7 +392,7 @@ case "$host" in *-apple-aux3*) APR_SETIFNULL(CC, [gcc]) ;; - BS2000*-siemens-sysv4*) + bs2000*-siemens-sysv*) APR_SETIFNULL(CC, [c89 -XLLML -XLLMK -XL -Kno_integer_overflow]) ;; *convex-v11*) From bba9f70f41bf377b8b511c768c2e1cd989da36a1 Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Sat, 3 May 2003 04:11:07 +0000 Subject: [PATCH 4477/7878] removed the solaris specific atomic code. it was under the MPL 1.0 licence, which is incompatible with outs. tried contacting the author, with no response ;( git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64500 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 + atomic/solaris_sparc/apr_atomic_sparc.s | 132 ------------------------ configure.in | 40 ------- include/apr_atomic.h | 16 --- 4 files changed, 4 insertions(+), 188 deletions(-) delete mode 100644 atomic/solaris_sparc/apr_atomic_sparc.s diff --git a/CHANGES b/CHANGES index d5def9ddb50..8be47cbd312 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR 0.9.4 + *) Removed the solaris-specific atomic code, due to licence + concerns (it was MPL 1.0, and the author could not be contacted) + [Ian Holsman] + *) apr_file_gets(): Return APR_SUCCESS if any characters are returned. Any I/O errors or EOF will be reported on the next call. Callers that are coded to expect returned diff --git a/atomic/solaris_sparc/apr_atomic_sparc.s b/atomic/solaris_sparc/apr_atomic_sparc.s deleted file mode 100644 index 08586bf4b26..00000000000 --- a/atomic/solaris_sparc/apr_atomic_sparc.s +++ /dev/null @@ -1,132 +0,0 @@ -!* ==================================================================== -!* The Apache Software License, Version 1.1 -!* -!* Copyright (c) 2000-2003 The Apache Software Foundation. All rights -!* reserved. -!* -!* Redistribution and use in source and binary forms, with or without -!* modification, are permitted provided that the following conditions -!* are met: -!* -!* 1. Redistributions of source code must retain the above copyright -!* notice, this list of conditions and the following disclaimer. -!* -!* 2. Redistributions in binary form must reproduce the above copyright -!* notice, this list of conditions and the following disclaimer in -!* the documentation and/or other materials provided with the -!* distribution. -!* -!* 3. The end-user documentation included with the redistribution, -!* if any, must include the following acknowledgment: -!* "This product includes software developed by the -!* Apache Software Foundation (http://www.apache.org/)." -!* Alternately, this acknowledgment may appear in the software itself, -!* if and wherever such third-party acknowledgments normally appear. -!* -!* 4. The names "Apache" and "Apache Software Foundation" must -!* not be used to endorse or promote products derived from this -!* software without prior written permission. For written -!* permission, please contact apache@apache.org. -!* -!* 5. Products derived from this software may not be called "Apache", -!* nor may "Apache" appear in their name, without prior written -!* permission of the Apache Software Foundation. -!* -!* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED -!* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -!* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -!* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR -!* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -!* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -!* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -!* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -!* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -!* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -!* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -!* SUCH DAMAGE. -!* ==================================================================== -!* -!* This software consists of voluntary contributions made by many -!* individuals on behalf of the Apache Software Foundation. For more -!* information on the Apache Software Foundation, please see -!* . -!* - -!* -!* -!* This code is based on the UltraSPARC atomics library by Mike Bennett -!* -!* The contents of this file are subject to the Mozilla Public License -!* Version 1.0 (the "License"); you may not use this file except in -!* compliance with the License. You may obtain a copy of the License at -!* http://www.mozilla.org/MPL/ -!* -!* Software distributed under the License is distributed on an "AS IS" -!* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -!* License for the specific language governing rights and limitations -!* under the License. -!* -!* The Original Code is UltraSPARC atomics library. -!* The Initial Developer of the Original Code is Mike Bennett, -!* mbennett@netcom.com, Copyright (C) 1999. All Rights Reserved. -!* -!* This code is based on the sparc architecture Manual version 9 -!* section J.11 (page 333) -! -#include -! %o0 [input] - the address of the value to increment -! %o1 [input] - the increment delta value -! %o2 [local] - work register (was %l0 in book) -! %o3 [local] - work register (was %l1 in book) -! %o4 [local] - work register -! %o0 [output] - contains return value -! -! -! - ENTRY(apr_atomic_add_sparc) - - ld [%o0], %o2 ! set o2 to current value -_apr_atomic_add_sparc_loop: - add %o2, %o1, %o3 ! o3 = o2 + o1 - cas [%o0], %o2, %o3 ! if cur-val==o2 then cur-val=03 - cmp %o2, %o3 ! see if the CAS worked - bne,a _apr_atomic_add_sparc_loop ! if not try again - ld [%o0], %o2 ! return the previous value - retl - mov %o3, %o0 - - SET_SIZE(apr_atomic_add_sparc) -! -! -! - ENTRY(apr_atomic_sub_sparc) - - ld [%o0], %o2 -_apr_atomic_sub_sparc_loop: - sub %o2, %o1, %o3 - mov %o3, %o4 - cas [%o0], %o2, %o3 - cmp %o2, %o3 - bne,a _apr_atomic_sub_sparc_loop - nop - retl - mov %o4, %o0 - - SET_SIZE(apr_atomic_sub_sparc) -! -! -! -! %o0 [input] - the address of the value to compare -! %o1 [input] - the new value -! %o2 [input] - value to compare against -! %o0 [output] - the return value -! - ENTRY(apr_atomic_cas_sparc) - ENTRY(apr_atomic_casptr_sparc) - - cas [%o0], %o2, %o1 - retl - mov %o1, %o0 - - SET_SIZE(apr_atomic_cas_sparc) - diff --git a/configure.in b/configure.in index 48dcf91d409..b39dd5bf09d 100644 --- a/configure.in +++ b/configure.in @@ -393,46 +393,6 @@ case $host in enable_threads="no" eolstr="\\n" ;; - *sun*) - case $host_cpu in - *sparc*) - OSDIR="solaris_sparc" - eolstr="\\n" - if test "$nonportable_atomics_enabled" = 1; then - apr_atomic_sparc_compile=apr_atomic_sparc.lo - sparc_arch=`uname -m` - is_gnu_as=`${AS} --help 2>/dev/null | grep gnu.org` - case "$sparc_arch" in - sun4c|sun4m|sun4d|sun4t|sun4) - apr_force_atomic_generic=1 - apr_atomic_sparc_compile="" - ;; - *) - if test -n "$is_gnu_as"; then - ASFLAGS="-xarch=v8plus -K PIC" - ASCPPFLAGS="-traditional-cpp -D_ASM -D__STDC__=0" - ASCPP="gcc -E" - else - ASFLAGS="-K pic -P -D_ASM -D__STDC__=0 -xarch=v8plus" - ASCPPFLAGS="" - ASCPP="cat" - fi - ;; - esac - else - apr_force_atomic_generic=1 - apr_atomic_sparc_compile="" - fi - AC_SUBST(ASCPPFLAGS) - AC_SUBST(ASFLAGS) - AC_SUBST(apr_atomic_sparc_compile) - ;; - *) - OSDIR="unix" - eolstr="\\n" - ;; - esac - ;; *linux*) apr_force_atomic_generic=1 case $host_cpu in diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 58690364484..9f185e40297 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -247,22 +247,6 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) #define apr_atomic_read(mem) (*(mem)) #define apr_atomic_init(pool) APR_SUCCESS -#elif (defined(__sparc__) || defined(sparc)) && !APR_FORCE_ATOMIC_GENERIC - -#define apr_atomic_t apr_uint32_t -#define apr_atomic_read(p) *p - -#define apr_atomic_add(mem, val) apr_atomic_add_sparc(mem,val) -#define apr_atomic_dec(mem) apr_atomic_sub_sparc(mem,1) -#define apr_atomic_inc(mem) apr_atomic_add_sparc(mem,1) -#define apr_atomic_cas(mem,val,cond) apr_atomic_cas_sparc(mem,val,cond) -#define apr_atomic_set(mem, val) (*mem = val) -#define apr_atomic_init(pool) APR_SUCCESS - -apr_uint32_t apr_atomic_add_sparc(volatile apr_atomic_t *mem, apr_uint32_t add); -apr_uint32_t apr_atomic_sub_sparc(volatile apr_atomic_t *mem, apr_uint32_t sub); -apr_uint32_t apr_atomic_cas_sparc(volatile apr_uint32_t *mem, long with, long cmp); - #elif defined(__MVS__) /* OS/390 */ #define apr_atomic_t cs_t From 2c5cd9f343a096b1f4a4379cd6ba55be9149cd6b Mon Sep 17 00:00:00 2001 From: Thom May Date: Thu, 8 May 2003 08:51:02 +0000 Subject: [PATCH 4478/7878] (apr_proc_wait): Handle interrupted waitpid(2) calls by calling it repeatedly until it succeeds or fails with errno other than EINTR. This hides this UNIX-specific behavior from APR clients. Submitted by: Eric Gillespie Reviewed by: Thom May git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64501 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ threadproc/unix/proc.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8be47cbd312..e77161cb41b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR 0.9.4 + *) apr_proc_wait(): Handle interrupted waitpid(2) calls by calling + it repeatedly until it succeeds or fails with errno other than + EINTR. This hides this UNIX-specific behavior from APR clients. + *) Removed the solaris-specific atomic code, due to licence concerns (it was MPL 1.0, and the author could not be contacted) [Ian Holsman] diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 2fbcb2908c5..ecfeddea3da 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -556,7 +556,11 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, waitpid_options |= WNOHANG; } - if ((pstatus = waitpid(proc->pid, &exit_int, waitpid_options)) > 0) { + do { + pstatus = waitpid(proc->pid, &exit_int, waitpid_options); + } while (pstatus < 0 && errno == EINTR); + + if (pstatus > 0) { proc->pid = pstatus; if (WIFEXITED(exit_int)) { From e8327aa4168b62f2ecf95cb25bc8098de868fe6f Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 8 May 2003 16:44:08 +0000 Subject: [PATCH 4479/7878] Make sure that the current directory that is represented by the context is stat'ed if the resulting path is a single slash. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64502 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index de5e1393288..3bee79d4ae2 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -62,6 +62,8 @@ #include "apr_hash.h" #include "apr_thread_rwlock.h" +/*#define APR_HAS_PSA*/ + static apr_filetype_e filetype_from_mode(mode_t mode) { apr_filetype_e type = APR_NOFILE; @@ -192,6 +194,7 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, return apr_file_perms_set(fname, finfo.protection); } +#ifndef APR_HAS_PSA static apr_status_t stat_cache_cleanup(void *data) { apr_pool_t *p = (apr_pool_t *)getGlobalPool(); @@ -270,7 +273,16 @@ int cstat (NXPathCtx_t ctx, char *path, struct stat *buf, unsigned long requestm if (ptr[1] != '\0') { ptr++; } - pinfo = apr_pstrdup (p, ptr); + /* If the path ended in a trailing slash then our result path + will be a single slash. To avoid stat'ing the root with a + slash, we need to make sure we stat the current directory + with a dot */ + if (((*ptr == '/') || (*ptr == '\\')) && (*(ptr+1) == '\0')) { + pinfo = apr_pstrdup (p, "."); + } + else { + pinfo = apr_pstrdup (p, ptr); + } } /* If we have a statCache then try to pull the information @@ -297,7 +309,7 @@ int cstat (NXPathCtx_t ctx, char *path, struct stat *buf, unsigned long requestm } return getstat(ctx, path, buf, requestmap); } - +#endif APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, @@ -308,7 +320,11 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, NXPathCtx_t pathCtx = 0; getcwdpath(NULL, &pathCtx, CTX_ACTUAL_CWD); +#ifdef APR_HAS_PSA + srv = getstat(pathCtx, (char*)fname, &info, ST_STAT_BITS|ST_NAME_BIT); +#else srv = cstat(pathCtx, (char*)fname, &info, ST_STAT_BITS|ST_NAME_BIT, pool); +#endif errno = srv; if (srv == 0) { From c125c5c277dc6b1159db55edbb07e253af479e4f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 12 May 2003 10:49:42 +0000 Subject: [PATCH 4480/7878] remove an incorrect comment Submitted by: Stas Bekman Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64503 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/apr.h.in b/include/apr.h.in index 8a865a92b42..b2cead997d2 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -61,9 +61,7 @@ * You must modify apr.h.in instead. * * And please, make an effort to stub apr.hw and apr.hnw in the process. - * - * This is the Win32 specific version of apr.h. It is copied from - * apr.hw when building the apr.dsp or libapr.dsp project. */ + */ /** * @file apr.h From 3460a8c7288dd0560c12644ee2193e71355a6898 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 14 May 2003 03:52:15 +0000 Subject: [PATCH 4481/7878] Use $(LIBTOOL) instead of $(LINK) for the mod_test shared objects. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64504 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index a904434a90a..d94263e5adc 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -67,10 +67,10 @@ mod_test.slo: $(srcdir)/mod_test.c $(LIBTOOL) --mode=compile $(COMPILE) -prefer-pic -c $(srcdir)/mod_test.c && touch $@ mod_test.la: mod_test.slo $(LOCAL_LIBS) - $(LINK) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ + $(LIBTOOL) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ libmod_test.la: mod_test.slo $(LOCAL_LIBS) - $(LINK) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ + $(LIBTOOl) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS) $(LINK) testlockperf.lo $(LOCAL_LIBS) $(ALL_LIBS) From 47bb285d81b9e796f610e63589e7b1220b698901 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 15 May 2003 14:39:05 +0000 Subject: [PATCH 4482/7878] Fix typo. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64505 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.in b/test/Makefile.in index d94263e5adc..c5460ad2a3d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -70,7 +70,7 @@ mod_test.la: mod_test.slo $(LOCAL_LIBS) $(LIBTOOL) --mode=link $(COMPILE) -rpath `pwd` -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ libmod_test.la: mod_test.slo $(LOCAL_LIBS) - $(LIBTOOl) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ + $(LIBTOOL) --mode=link $(COMPILE) -rpath `pwd` -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ testlockperf@EXEEXT@: testlockperf.lo $(LOCAL_LIBS) $(LINK) testlockperf.lo $(LOCAL_LIBS) $(ALL_LIBS) From f6f2cd36d0dee10a7739a9e7682592bd4423857a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 16 May 2003 11:50:21 +0000 Subject: [PATCH 4483/7878] add -x option to exclude particular tests (e.g., "testall -x testrand testsleep") report some invalid invocations git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64506 13f79535-47bb-0310-9956-ffa450edef68 --- test/testall.c | 66 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 14 deletions(-) diff --git a/test/testall.c b/test/testall.c index cdf560fa9d8..cbaa4679e9b 100644 --- a/test/testall.c +++ b/test/testall.c @@ -116,7 +116,8 @@ int main(int argc, char *argv[]) CuSuiteList *alltests = NULL; CuString *output = CuStringNew(); int i; - int partial = 0; + int exclude = 0; + int list_provided = 0; apr_initialize(); atexit(apr_terminate); @@ -125,32 +126,69 @@ int main(int argc, char *argv[]) apr_pool_create(&p, NULL); - /* build the list of tests to run */ + /* see if we're in exclude mode, see if list of testcases provided */ for (i = 1; i < argc; i++) { - int j; if (!strcmp(argv[i], "-v")) { continue; } - for (j = 0; tests[j].func != NULL; j++) { - if (!strcmp(argv[i], tests[j].testname)) { - if (!partial) { - alltests = CuSuiteListNew("Partial APR Tests"); - partial = 1; - } - - CuSuiteListAdd(alltests, tests[j].func()); - break; - } + if (!strcmp(argv[i], "-x")) { + exclude = 1; + continue; + } + if (argv[i][0] == '-') { + fprintf(stderr, "invalid option: `%s'\n", argv[i]); + exit(1); } + list_provided = 1; } - if (!partial) { + if (!list_provided) { + /* add everything */ alltests = CuSuiteListNew("All APR Tests"); for (i = 0; tests[i].func != NULL; i++) { CuSuiteListAdd(alltests, tests[i].func()); } } + else if (exclude) { + /* add everything but the tests listed */ + alltests = CuSuiteListNew("Partial APR Tests"); + for (i = 0; tests[i].func != NULL; i++) { + int this_test_excluded = 0; + int j; + for (j = 1; j < argc && !this_test_excluded; j++) { + if (!strcmp(argv[j], tests[i].testname)) { + this_test_excluded = 1; + } + } + if (!this_test_excluded) { + CuSuiteListAdd(alltests, tests[i].func()); + } + } + } + else { + /* add only the tests listed */ + alltests = CuSuiteListNew("Partial APR Tests"); + for (i = 1; i < argc; i++) { + int j; + int found = 0; + + if (argv[i][0] == '-') { + continue; + } + for (j = 0; tests[j].func != NULL; j++) { + if (!strcmp(argv[i], tests[j].testname)) { + CuSuiteListAdd(alltests, tests[j].func()); + found = 1; + } + } + if (!found) { + fprintf(stderr, "invalid test name: `%s'\n", argv[i]); + exit(1); + } + } + } + CuSuiteListRunWithSummary(alltests); i = CuSuiteListDetails(alltests, output); printf("%s\n", output->buffer); From 659dbe2383443614f5b088fdd3b40c640e2c0c53 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 18 May 2003 12:50:49 +0000 Subject: [PATCH 4484/7878] add "-l" option for listing testcases to make it easier for a regression test to run them one at a time, since it avoids having to hard-code the testcase names git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64507 13f79535-47bb-0310-9956-ffa450edef68 --- test/testall.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/testall.c b/test/testall.c index cbaa4679e9b..a7d80306423 100644 --- a/test/testall.c +++ b/test/testall.c @@ -135,6 +135,12 @@ int main(int argc, char *argv[]) exclude = 1; continue; } + if (!strcmp(argv[i], "-l")) { + for (i = 0; tests[i].func != NULL; i++) { + printf("%s\n", tests[i].testname); + } + exit(0); + } if (argv[i][0] == '-') { fprintf(stderr, "invalid option: `%s'\n", argv[i]); exit(1); From ff4c928d8f0d6edd7c5e5b84ea8e1c6057a712bb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 19 May 2003 14:01:22 +0000 Subject: [PATCH 4485/7878] Unless we are actively looking for a symlink, don't inform the apr_finfo_t that the file is a Junction. PR: 8014 Submitted by: Kristofer Spinka git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64508 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filestat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index f944171066c..903780ec3c7 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -363,7 +363,8 @@ int fillin_fileinfo(apr_finfo_t *finfo, finfo->size = 0x7fffffff; #endif - if (wininfo->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { + if (wanted & APR_FINFO_LINK && + wininfo->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { finfo->filetype = APR_LNK; } else if (wininfo->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { From f1fddf5476385738aa7f0c0f939f8d7006a1376b Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 22 May 2003 19:15:29 +0000 Subject: [PATCH 4486/7878] Add the copyright notice in the NetWare make files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Submitted by: G�nter Knauf git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64509 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUtail.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index d60341037ab..8842f466ed6 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -24,6 +24,9 @@ ifndef NLM_SCREEN_NAME NLM_SCREEN_NAME = DEFAULT endif +ifndef NLM_COPYRIGHT +NLM_COPYRIGHT = Copyright (c) 2000-2003 The Apache Software Foundation. All rights reserved. +endif # # Create dependency lists based on the files available @@ -201,6 +204,8 @@ $(OBJDIR)\$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) @echo -o $(TARGET_nlm) >> $@ ifneq "$(FILE_nlm_copyright)" "" @-type $(FILE_nlm_copyright) >> $@ +else + @echo -copy "$(NLM_COPYRIGHT)" >> $@ endif ifeq "$(RELEASE)" "debug" @echo -g >> $@ From 91698ef4fbb1d0e900bf6aa26fa03010c5e98997 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Sat, 24 May 2003 10:30:40 +0000 Subject: [PATCH 4487/7878] Added flag APR_FILE_ATTR_HIDDEN for manipulating the "hidden" file attribute on Windows and OS/2. Also changed the apr_file_attrs_set implementations to not make any syscalls if the requested attributes are not supported on the platform. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64510 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/netware/filestat.c | 5 +++++ file_io/os2/filestat.c | 17 ++++++++++++++++- file_io/unix/filestat.c | 5 +++++ file_io/win32/filestat.c | 13 +++++++++++++ include/apr_file_io.h | 2 ++ 6 files changed, 44 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index e77161cb41b..063cc33a6eb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.4 + *) Added flag APR_FILE_ATTR_HIDDEN for manipulating the "hidden" + file attribute on Windows and OS/2. [Branko Cibej] + *) apr_proc_wait(): Handle interrupted waitpid(2) calls by calling it repeatedly until it succeeds or fails with errno other than EINTR. This hides this UNIX-specific behavior from APR clients. diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 3bee79d4ae2..55512a9129d 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -152,6 +152,11 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_status_t status; apr_finfo_t finfo; + /* Don't do anything if we can't handle the requested attributes */ + if (!(attr_mask & (APR_FILE_ATTR_READONLY + | APR_FILE_ATTR_EXECUTABLE))) + return APR_SUCCESS; + status = apr_stat(&finfo, fname, APR_FINFO_PROT, pool); if (!APR_STATUS_IS_SUCCESS(status)) return status; diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 7797a26b4fa..747f6e9cea3 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -219,8 +219,14 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_pool_t *cont) { FILESTATUS3 fs3; - ULONG rc = DosQueryPathInfo(fname, FIL_STANDARD, &fs3, sizeof(fs3)); + ULONG rc; + + /* Don't do anything if we can't handle the requested attributes */ + if (!(attr_mask & (APR_FILE_ATTR_READONLY + | APR_FILE_ATTR_HIDDEN))) + return APR_SUCCESS; + rc = DosQueryPathInfo(fname, FIL_STANDARD, &fs3, sizeof(fs3)); if (rc == 0) { ULONG old_attr = fs3.attrFile; @@ -233,6 +239,15 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, } } + if (attr_mask & APR_FILE_ATTR_HIDDEN) + { + if (attributes & APR_FILE_ATTR_HIDDEN) { + fs3.attrFile |= FILE_HIDDEN; + } else { + fs3.attrFile &= ~FILE_HIDDEN; + } + } + if (fs3.attrFile != old_attr) { rc = DosSetPathInfo(fname, FIL_STANDARD, &fs3, sizeof(fs3), 0); } diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 0e0236e6bb4..02a4df975a1 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -166,6 +166,11 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_status_t status; apr_finfo_t finfo; + /* Don't do anything if we can't handle the requested attributes */ + if (!(attr_mask & (APR_FILE_ATTR_READONLY + | APR_FILE_ATTR_EXECUTABLE))) + return APR_SUCCESS; + status = apr_stat(&finfo, fname, APR_FINFO_PROT, pool); if (!APR_STATUS_IS_SUCCESS(status)) return status; diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 903780ec3c7..91a7fc07a0b 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -703,6 +703,11 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_wchar_t wfname[APR_PATH_MAX]; #endif + /* Don't do anything if we can't handle the requested attributes */ + if (!(attr_mask & (APR_FILE_ATTR_READONLY + | APR_FILE_ATTR_HIDDEN))) + return APR_SUCCESS; + #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { @@ -731,6 +736,14 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, flags &= ~FILE_ATTRIBUTE_READONLY; } + if (attr_mask & APR_FILE_ATTR_HIDDEN) + { + if (attributes & APR_FILE_ATTR_HIDDEN) + flags |= FILE_ATTRIBUTE_HIDDEN; + else + flags &= ~FILE_ATTRIBUTE_HIDDEN; + } + #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 3a4fcbd4b2a..80e67fdc7b3 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -129,6 +129,7 @@ extern "C" { /* flags for apr_file_attrs_set */ #define APR_FILE_ATTR_READONLY 0x01 /**< File is read-only */ #define APR_FILE_ATTR_EXECUTABLE 0x02 /**< File is executable */ +#define APR_FILE_ATTR_HIDDEN 0x04 /**< File is hidden */ /** @} */ /** File attributes */ @@ -639,6 +640,7 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, *
      *            APR_FILE_ATTR_READONLY   - make the file readonly
      *            APR_FILE_ATTR_EXECUTABLE - make the file executable
    + *            APR_FILE_ATTR_HIDDEN     - make the file hidden
      * 
    * @param attr_mask Mask of valid bits in attributes. * @param cont the pool to use. From 49d7290154a87d7543e698e7049faccff0fce90a Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 28 May 2003 04:39:42 +0000 Subject: [PATCH 4488/7878] Fixed a bug that could be triggered remotely through mod_dav and possibly other mechanisms, causing an Apache child process to crash. The crash was first reported by David Endler and was researched and fixed by Joe Orton . Details will be released on 30 May 2003. CVE: CAN-2003-0245 Reported by: David Endler Submitted by: Joe Orton Reviewed by: Justin, Jim, Jeff git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64511 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++++-- memory/unix/apr_pools.c | 2 +- test/teststr.c | 12 ++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 063cc33a6eb..6660c54b79b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,11 @@ Changes with APR 0.9.4 - *) Added flag APR_FILE_ATTR_HIDDEN for manipulating the "hidden" - file attribute on Windows and OS/2. [Branko Cibej] + *) SECURITY [CAN-2003-0245]: Fixed a bug that could be triggered + remotely through mod_dav and possibly other mechanisms, causing + an Apache child process to crash. The crash was first reported + by David Endler and was researched and + fixed by Joe Orton . Details will be released + on 30 May 2003. *) apr_proc_wait(): Handle interrupted waitpid(2) calls by calling it repeatedly until it succeeds or fails with errno other than diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 22dad218fc9..de4fbbf1a26 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -976,7 +976,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) if (ps->got_a_new_node) { active->next = ps->free; - ps->free = node; + ps->free = active; } ps->got_a_new_node = 1; diff --git a/test/teststr.c b/test/teststr.c index 2c4a3c154a8..e38c1f37702 100644 --- a/test/teststr.c +++ b/test/teststr.c @@ -195,6 +195,17 @@ static void string_error(CuTest *tc) CuAssertStrEquals(tc, "The timeout specified has expired", buf); } +#define SIZE 180000 +static void string_long(CuTest *tc) +{ + char s[SIZE + 1]; + + memset(s, 'A', SIZE); + s[SIZE] = '\0'; + + apr_psprintf(p, "%s", s); +} + CuSuite *teststr(void) { CuSuite *suite = CuSuiteNew("Strings"); @@ -205,6 +216,7 @@ CuSuite *teststr(void) SUITE_ADD_TEST(suite, snprintf_int64); SUITE_ADD_TEST(suite, test_strtok); SUITE_ADD_TEST(suite, string_error); + SUITE_ADD_TEST(suite, string_long); return suite; } From a133a7d58cace5782e96d14d5ff7fd04ca1712fa Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 28 May 2003 05:07:04 +0000 Subject: [PATCH 4489/7878] Add back in an entry that was temporarily removed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64513 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 6660c54b79b..2401f9fab96 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.4 + *) Added flag APR_FILE_ATTR_HIDDEN for manipulating the "hidden" + file attribute on Windows and OS/2. [Branko Cibej] + *) SECURITY [CAN-2003-0245]: Fixed a bug that could be triggered remotely through mod_dav and possibly other mechanisms, causing an Apache child process to crash. The crash was first reported From e27a9fb8e5d71f1a8497a71351714586ca95d154 Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Wed, 28 May 2003 11:30:20 +0000 Subject: [PATCH 4490/7878] [PORTING] Improve detection of IPv6, Include for lock_t if available git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64514 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index b39dd5bf09d..c5f2714169a 100644 --- a/configure.in +++ b/configure.in @@ -590,7 +590,15 @@ echo "${nl}Checking for Shared Memory Support..." # be available if linking against librt. AC_SEARCH_LIBS(shm_open, rt) -AC_CHECK_HEADERS([sys/mman.h sys/ipc.h sys/shm.h sys/file.h kernel/OS.h os2.h]) +case $host in + *-sysv*) + ac_includes_default="$ac_includes_default +#if HAVE_SYS_MUTEX_H /* needed to define lock_t for sys/shm.h */ +# include +#endif";; +esac + +AC_CHECK_HEADERS([sys/mman.h sys/ipc.h sys/mutex.h sys/shm.h sys/file.h kernel/OS.h os2.h]) AC_CHECK_FUNCS([mmap munmap shm_open shm_unlink shmget shmat shmdt shmctl \ create_area]) APR_CHECK_DEFINE(MAP_ANON, sys/mman.h) @@ -1782,9 +1790,9 @@ case $host in broken_ipv6=0 esac -AC_SEARCH_LIBS(getaddrinfo, inet6) -AC_SEARCH_LIBS(gai_strerror, inet6) -AC_SEARCH_LIBS(getnameinfo, inet6) +AC_SEARCH_LIBS(getaddrinfo, socket inet6) +AC_SEARCH_LIBS(gai_strerror, socket inet6) +AC_SEARCH_LIBS(getnameinfo, socket inet6) AC_CHECK_FUNCS(gai_strerror) APR_CHECK_WORKING_GETADDRINFO APR_CHECK_NEGATIVE_EAI From 33fc63293517f10e7b0106873b67367413090c0a Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Wed, 28 May 2003 13:25:35 +0000 Subject: [PATCH 4491/7878] BS2000 needs an extra #define _KMEMUSER for git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64515 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 6747dc6f692..b4b4b4163fe 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -228,7 +228,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? ;; bs2000*-siemens-sysv*) APR_SETIFNULL(CFLAGS, [-O]) - APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV]) + APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV -D_KMEMUSER]) APR_ADDTO(LIBS, [-lsocket]) APR_SETIFNULL(enable_threads, [no]) ;; From f61258d655d9bba28240686aec82be235d2ee00a Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Wed, 28 May 2003 13:55:18 +0000 Subject: [PATCH 4492/7878] [PORTING] Bug workaround for OSD/POSIX git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64516 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/charset.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/misc/unix/charset.c b/misc/unix/charset.c index 90528e0226f..df49c9e84e2 100644 --- a/misc/unix/charset.c +++ b/misc/unix/charset.c @@ -107,7 +107,12 @@ APR_DECLARE(const char*) apr_os_locale_encoding (apr_pool_t *pool) const char *charset; charset = nl_langinfo(CODESET); - if (charset) { + if (charset && *charset) { +#ifdef _OSD_POSIX /* Bug workaround - delete as soon as fixed in OSD_POSIX */ + /* Some versions of OSD_POSIX return nl_langinfo(CODESET)="^[nN]" */ + /* Ignore the bogus information and use apr_os_default_encoding() */ + if (charset[0] != '^') +#endif return charset; } #endif From 902d7c519caed90697453d10bc8c2e038e029472 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 28 May 2003 18:24:13 +0000 Subject: [PATCH 4493/7878] get testdso to work with the vendor's compiler on HP-UX, which defines a different symbol than gcc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64517 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testdso.c b/test/testdso.c index 2b88c356140..468cf5eaf08 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -71,7 +71,7 @@ #elif defined(DARWIN) # define MOD_NAME ".libs/mod_test.so" # define LIB_NAME ".libs/libmod_test.dylib" -#elif defined(__hpux__) +#elif defined(__hpux__) || defined(__hpux) # define MOD_NAME ".libs/mod_test.sl" # define LIB_NAME ".libs/libmod_test.sl" #elif defined(_AIX) || defined(__bsdi__) From 0cc31b35d01c762bd23e80660548ad25d43d9d73 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 28 May 2003 19:25:33 +0000 Subject: [PATCH 4494/7878] fix some CuAssert calls that had the expected and actual values reversed git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64518 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testfile.c b/test/testfile.c index 0c350f46e3c..604ca605b9c 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -104,7 +104,7 @@ static void test_open_read(CuTest *tc) rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); - CuAssertIntEquals(tc, rv, APR_SUCCESS); + CuAssertIntEquals(tc, APR_SUCCESS, rv); CuAssertPtrNotNull(tc, filetest); apr_file_close(filetest); } @@ -141,7 +141,7 @@ static void test_filename(CuTest *tc) apr_assert_success(tc, "Opening test file " FILENAME, rv); rv = apr_file_name_get(&str, filetest); - CuAssertIntEquals(tc, rv, APR_SUCCESS); + CuAssertIntEquals(tc, APR_SUCCESS, rv); CuAssertStrEquals(tc, FILENAME, str); apr_file_close(filetest); @@ -160,7 +160,7 @@ static void test_fileclose(CuTest *tc) apr_assert_success(tc, "Opening test file " FILENAME, rv); rv = apr_file_close(filetest); - CuAssertIntEquals(tc, rv, APR_SUCCESS); + CuAssertIntEquals(tc, APR_SUCCESS, rv); /* We just closed the file, so this should fail */ rv = apr_file_read(filetest, &str, &one); CuAssertIntEquals(tc, 1, APR_STATUS_IS_EBADF(rv)); @@ -232,7 +232,7 @@ static void test_open_readwrite(CuTest *tc) rv = apr_file_open(&filetest, FILENAME, APR_READ | APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); - CuAssertIntEquals(tc, rv, APR_SUCCESS); + CuAssertIntEquals(tc, APR_SUCCESS, rv); CuAssertPtrNotNull(tc, filetest); apr_file_close(filetest); From 895162f810d04b4a80a5908a3cef893c00fab612 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 30 May 2003 02:26:31 +0000 Subject: [PATCH 4495/7878] describe the timeout parameter to apr_socket_timeout_set() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64519 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index baab12fc249..cad7118102d 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -676,6 +676,12 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, * Setup socket timeout for the specified socket * @param sock The socket to set up. * @param t Value for the timeout. + *
    + *   t > 0  -- read and write calls return APR_TIMEUP if specified time
    + *             elapsess with no data read or written
    + *   t == 0 -- read and write calls never block
    + *   t < 0  -- read and write calls block
    + * 
    */ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t); From 7b6cd8a196a85d55a7bb2f3f77cc65c9918c8a91 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 30 May 2003 12:15:12 +0000 Subject: [PATCH 4496/7878] Fix a bug in socket timeout handling on unix that left the socket non-blocking after disabling the timeout. Submitted by: Jacob Craig Lewallen Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64520 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ network_io/unix/sockopt.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 2401f9fab96..dcf247022bb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR 0.9.4 + *) Fix a bug in socket timeout handling on unix that left the + socket non-blocking after disabling the timeout. + [Jacob Craig Lewallen ] + *) Added flag APR_FILE_ATTR_HIDDEN for manipulating the "hidden" file attribute on Windows and OS/2. [Branko Cibej] diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 51f9fd8fe6f..de252606650 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -126,6 +126,7 @@ apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) { return stat; } + apr_set_option(&sock->netmask, APR_SO_NONBLOCK, 1); } } else if (t < 0 && sock->timeout >= 0) { @@ -133,6 +134,7 @@ apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) { return stat; } + apr_set_option(&sock->netmask, APR_SO_NONBLOCK, 0); } } /* must disable the incomplete read support if we change to a From 02526f4f3c90413a8a4f6643b93dfe5f9f7782fa Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 30 May 2003 12:28:44 +0000 Subject: [PATCH 4497/7878] fix some minor style problems (indention, curly braces) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64521 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 80 +++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 443a86c8181..f12aff86969 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -80,7 +80,7 @@ apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) - && sock->timeout != 0) { + && sock->timeout != 0) { apr_status_t arv; do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); @@ -99,7 +99,7 @@ apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, return errno; } if (sock->timeout && rv < *len) { - sock->netmask |= APR_INCOMPLETE_WRITE; + sock->netmask |= APR_INCOMPLETE_WRITE; } (*len) = rv; return APR_SUCCESS; @@ -111,7 +111,7 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len) apr_status_t arv; if (sock->netmask & APR_INCOMPLETE_READ) { - sock->netmask &= ~APR_INCOMPLETE_READ; + sock->netmask &= ~APR_INCOMPLETE_READ; goto do_select; } @@ -122,7 +122,7 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len) if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { do_select: - arv = apr_wait_for_io_or_timeout(NULL, sock, 1); + arv = apr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -138,7 +138,7 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len) return errno; } if (sock->timeout && rv < *len) { - sock->netmask |= APR_INCOMPLETE_READ; + sock->netmask |= APR_INCOMPLETE_READ; } (*len) = rv; if (rv == 0) { @@ -202,7 +202,7 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, do { rv = recvfrom(sock->socketdes, buf, (*len), flags, (struct sockaddr*)&from->sa, &from->salen); - } while (rv == -1 && errno == EINTR); + } while (rv == -1 && errno == EINTR); } } if (rv == -1) { @@ -211,8 +211,9 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, } (*len) = rv; - if (rv == 0 && sock->type == SOCK_STREAM) + if (rv == 0 && sock->type == SOCK_STREAM) { return APR_EOF; + } return APR_SUCCESS; } @@ -239,7 +240,7 @@ apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout != 0) { + sock->timeout != 0) { apr_status_t arv; do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); @@ -258,7 +259,7 @@ apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, return errno; } if (sock->timeout && rv < requested_len) { - sock->netmask |= APR_INCOMPLETE_WRITE; + sock->netmask |= APR_INCOMPLETE_WRITE; } (*len) = rv; return APR_SUCCESS; @@ -305,7 +306,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, arv = apr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); if (arv != APR_SUCCESS) { - *len = 0; + *len = 0; return errno; } nbytes += hdrbytes; @@ -331,33 +332,32 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, do { rv = sendfile(sock->socketdes, /* socket */ - file->filedes, /* open file descriptor of the file to be sent */ - &off, /* where in the file to start */ - *len /* number of bytes to send */ - ); + file->filedes, /* open file descriptor of the file to be sent */ + &off, /* where in the file to start */ + *len); /* number of bytes to send */ } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { do_select: - arv = apr_wait_for_io_or_timeout(NULL, sock, 0); - if (arv != APR_SUCCESS) { - *len = 0; - return arv; - } + arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + if (arv != APR_SUCCESS) { + *len = 0; + return arv; + } else { do { - rv = sendfile(sock->socketdes, /* socket */ - file->filedes, /* open file descriptor of the file to be sent */ - &off, /* where in the file to start */ - *len); /* number of bytes to send */ + rv = sendfile(sock->socketdes, /* socket */ + file->filedes, /* open file descriptor of the file to be sent */ + &off, /* where in the file to start */ + *len); /* number of bytes to send */ } while (rv == -1 && errno == EINTR); } } if (rv == -1) { - *len = nbytes; + *len = nbytes; rv = errno; apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); return rv; @@ -396,7 +396,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, &trbytes); nbytes += trbytes; if (arv != APR_SUCCESS) { - *len = nbytes; + *len = nbytes; rv = errno; apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); return rv; @@ -444,7 +444,7 @@ static int include_hdrs_in_length(void) kernel_version_size = sizeof(kernel_version); if (sysctlbyname("kern.osreldate", &kernel_version, &kernel_version_size, NULL, NULL) == 0 && - kernel_version < KERNEL_WITH_SENDFILE_LENGTH_FIX) { + kernel_version < KERNEL_WITH_SENDFILE_LENGTH_FIX) { api = OLD; return 1; } @@ -705,7 +705,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } if (rc == -1) { - *len = 0; + *len = 0; return errno; } @@ -795,7 +795,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, parms.trailer_data = tbuf; } } - else parms.trailer_data = NULL; + else { + parms.trailer_data = NULL; + } /* Whew! Headers and trailers set up. Now for the file data */ @@ -913,8 +915,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, curvec++; } - else + else { vecs--; + } /* Add the footers */ for (i = 0; i < hdtr->numtrailers; i++, curvec++) { @@ -955,17 +958,15 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, /* socket, vecs, number of vecs, bytes written */ rv = sendfilev(sock->socketdes, sfv, vecs, &nbytes); - if (rv == -1 && errno == EAGAIN) - { - if (nbytes) - rv = 0; + if (rv == -1 && errno == EAGAIN) { + if (nbytes) { + rv = 0; + } else if (!arv && - apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) == 1) - { + apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) == 1) { apr_status_t t = apr_wait_for_io_or_timeout(NULL, sock, 0); - if (t != APR_SUCCESS) - { + if (t != APR_SUCCESS) { *len = 0; return t; } @@ -976,8 +977,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } } while ((rv == -1 && errno == EINTR) || repeat); - if (rv == -1) - { + if (rv == -1) { *len = 0; return errno; } @@ -985,7 +985,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, /* Update how much we sent */ *len = nbytes; if (sock->timeout && (*len < requested_len)) { - sock->netmask |= APR_INCOMPLETE_WRITE; + sock->netmask |= APR_INCOMPLETE_WRITE; } return APR_SUCCESS; } From ec6478b2cfa7c218e5db19e2f6f87e73a7a351e0 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 30 May 2003 12:50:40 +0000 Subject: [PATCH 4498/7878] Fix some problems with non-blocking socket handling on unix that resulted in infinite timeouts being used for non-blocking sockets with apr_socket_connect() and some read/write calls. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64522 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ network_io/unix/sendrecv.c | 34 ++++++++++++++++++---------------- network_io/unix/sockets.c | 3 ++- network_io/unix/sockopt.c | 8 ++++---- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/CHANGES b/CHANGES index dcf247022bb..81776bd2bfd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR 0.9.4 + *) Fix some problems with non-blocking socket handling on unix + that resulted in infinite timeouts being used for non-blocking + sockets with apr_socket_connect() and some read/write calls. + [Jeff Trawick] + *) Fix a bug in socket timeout handling on unix that left the socket non-blocking after disabling the timeout. [Jacob Craig Lewallen ] diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index f12aff86969..46bbe72713a 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -80,7 +80,7 @@ apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) - && sock->timeout != 0) { + && apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { apr_status_t arv; do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); @@ -98,7 +98,7 @@ apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, *len = 0; return errno; } - if (sock->timeout && rv < *len) { + if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) && rv < *len) { sock->netmask |= APR_INCOMPLETE_WRITE; } (*len) = rv; @@ -120,7 +120,7 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len) } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout != 0) { + apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { @@ -137,7 +137,7 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len) (*len) = 0; return errno; } - if (sock->timeout && rv < *len) { + if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) && rv < *len) { sock->netmask |= APR_INCOMPLETE_READ; } (*len) = rv; @@ -160,7 +160,7 @@ apr_status_t apr_socket_sendto(apr_socket_t *sock, apr_sockaddr_t *where, } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) - && sock->timeout != 0) { + && apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -193,7 +193,7 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout != 0) { + apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { *len = 0; @@ -240,7 +240,7 @@ apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, } while (rv == -1 && errno == EINTR); if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout != 0) { + apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { apr_status_t arv; do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); @@ -258,7 +258,8 @@ apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, *len = 0; return errno; } - if (sock->timeout && rv < requested_len) { + if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) && + rv < requested_len) { sock->netmask |= APR_INCOMPLETE_WRITE; } (*len) = rv; @@ -339,7 +340,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout > 0) { + apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { @@ -374,7 +375,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, * partial byte count; this is a non-blocking socket. */ - if (sock->timeout) { + if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { sock->netmask |= APR_INCOMPLETE_WRITE; } return arv; @@ -522,7 +523,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, if (rv == -1) { if (errno == EAGAIN) { - if (sock->timeout) { + if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { sock->netmask |= APR_INCOMPLETE_WRITE; } /* FreeBSD's sendfile can return -1/EAGAIN even if it @@ -562,7 +563,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, } if (rv == -1 && errno == EAGAIN && - sock->timeout > 0) { + apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -680,7 +681,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, if (rc == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout > 0) { + apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { @@ -820,7 +821,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && - sock->timeout > 0) { + apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { do_select: arv = apr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { @@ -848,7 +849,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, return errno; } - if (sock->timeout && + if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) && (parms.bytes_sent < (parms.file_bytes + parms.header_length + parms.trailer_length))) { sock->netmask |= APR_INCOMPLETE_WRITE; } @@ -984,7 +985,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, /* Update how much we sent */ *len = nbytes; - if (sock->timeout && (*len < requested_len)) { + if (apr_is_option_set(sock->netmask, APR_SO_TIMEOUT) && + (*len < requested_len)) { sock->netmask |= APR_INCOMPLETE_WRITE; } return APR_SUCCESS; diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index dbc2d2eb2e6..e1d5c7e8019 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -271,7 +271,8 @@ apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) /* we can see EINPROGRESS the first time connect is called on a non-blocking * socket; if called again, we can see EALREADY */ - if (rc == -1 && (errno == EINPROGRESS || errno == EALREADY) && sock->timeout != 0) { + if (rc == -1 && (errno == EINPROGRESS || errno == EALREADY) && + apr_is_option_set(sock->netmask, APR_SO_TIMEOUT)) { rc = apr_wait_for_io_or_timeout(NULL, sock, 0); if (rc != APR_SUCCESS) { return rc; diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index de252606650..c346678cb69 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -137,14 +137,14 @@ apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) apr_set_option(&sock->netmask, APR_SO_NONBLOCK, 0); } } - /* must disable the incomplete read support if we change to a - * blocking socket. + /* must disable the incomplete read support if we disable + * a timeout */ - if (t == 0) { + if (t <= 0) { sock->netmask &= ~APR_INCOMPLETE_READ; } sock->timeout = t; - apr_set_option(&sock->netmask, APR_SO_TIMEOUT, t); + apr_set_option(&sock->netmask, APR_SO_TIMEOUT, t > 0); return APR_SUCCESS; } From bc0bf4d9d64f3ec90df59bd939b26efe4dccc400 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 30 May 2003 22:36:48 +0000 Subject: [PATCH 4499/7878] Fixing up the NetWare headers to be compatible with the GNU compiler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Submitted by: G�nter Knauf git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64523 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_arch_pre_nw.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/arch/netware/apr_arch_pre_nw.h b/include/arch/netware/apr_arch_pre_nw.h index 1078b1f16c3..22739f6c601 100644 --- a/include/arch/netware/apr_arch_pre_nw.h +++ b/include/arch/netware/apr_arch_pre_nw.h @@ -1,9 +1,13 @@ #ifndef __pre_nw__ #define __pre_nw__ +#include + +#ifndef __GNUC__ #pragma precompile_target "precomp.mch" -#define NETWARE +#endif +#define NETWARE #define N_PLAT_NLM @@ -21,19 +25,17 @@ /* if we have wchar_t enabled in C++, predefine this type to avoid a conflict in Novell's header files */ +#ifndef __GNUC__ #ifndef DOXYGEN #if (__option(cplusplus) && __option(wchar_type)) #define _WCHAR_T #endif #endif +#endif /* C9X defintion used by MSL C++ library */ #define DECIMAL_DIG 17 -/* define long long typedefs for Watcom compatiblity */ -typedef long long int64_t; -typedef unsigned long long uint64_t; - /* some code may want to use the MS convention for long long */ #ifndef __int64 #define __int64 long long From 7e12a8e315b5646e3c0225a6daca2319c3c1c9aa Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 2 Jun 2003 12:46:03 +0000 Subject: [PATCH 4500/7878] For apr_proc_detach(APR_PROC_DETACH_FOREGROUND), don't treat a setsid() failure as fatal, as the usual cause is that the caller is already a process group leader. PR: 18519 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64524 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ threadproc/unix/procsup.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 81776bd2bfd..a755f0b9683 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR 0.9.4 + *) For apr_proc_detach(APR_PROC_DETACH_FOREGROUND), don't treat + a setsid() failure as fatal, as the usual cause is that the + caller is already a process group leader. PR 18519 + [Jeff Trawick] + *) Fix some problems with non-blocking socket handling on unix that resulted in infinite timeouts being used for non-blocking sockets with apr_socket_connect() and some read/write calls. diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index a1d2a1c4cdc..25dbde658d0 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -76,7 +76,11 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) #endif #ifdef HAVE_SETSID - if (setsid() == -1) { + /* A setsid() failure is not fatal if we didn't just fork(). + * The calling process may be the process group leader, in + * which case setsid() will fail with EPERM. + */ + if (setsid() == -1 && daemonize) { return errno; } #elif defined(NEXT) || defined(NEWSOS) From cd5639f9c45b4b452a5c1b5f3db56a19bf808edb Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 2 Jun 2003 12:50:52 +0000 Subject: [PATCH 4501/7878] Add a check to see if the sourcedir actually exists. If it doesn't, which is likely when installed by a package, don't try and expand the path using realpath. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64525 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apr-config.in b/apr-config.in index 0593e48fcf7..6afeb00a1b2 100644 --- a/apr-config.in +++ b/apr-config.in @@ -134,7 +134,9 @@ fi # Otherwise, being in a symlinked dir may result in incorrect output. if test -x "`which realpath 2>/dev/null`"; then thisdir="`realpath $thisdir`" - APR_SOURCE_DIR="`realpath $APR_SOURCE_DIR`" + if test -d "$APR_SOURCE_DIR"; then + APR_SOURCE_DIR="`realpath $APR_SOURCE_DIR`" + fi if test -n $tmpbindir; then tmpbindir="`realpath $tmpbindir`" fi From 85da2b9e274ec8e3b95f10fc73d9248336474e48 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 2 Jun 2003 15:52:28 +0000 Subject: [PATCH 4502/7878] Define _THREAD_SAFE for all compilations on AIX. Previously those of us who used the vendor compiler had it defined implicitly and others did not. The difference became obvious with the recent thread safety fixes to apr_password_validate(). PR: 20420 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64526 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ build/apr_hints.m4 | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index a755f0b9683..cace705cbb1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR 0.9.4 + *) Define _THREAD_SAFE for all compilations on AIX. Previously + those of us who used the vendor compiler had it defined + implicitly and others did not. The difference became obvious + with the recent thread safety fixes to apr_password_validate(). + PR 20420 [Jeff Trawick] + *) For apr_proc_detach(APR_PROC_DETACH_FOREGROUND), don't treat a setsid() failure as fatal, as the usual cause is that the caller is already a process group leader. PR 18519 diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index b4b4b4163fe..bb99a998b27 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -43,7 +43,7 @@ if test "x$apr_preload_done" != "xyes" ; then APR_SETVAR(SHELL, [/bin/ksh]) ;; *-ibm-aix*) - APR_ADDTO(CPPFLAGS, [-U__STR__]) + APR_ADDTO(CPPFLAGS, [-U__STR__ -D_THREAD_SAFE]) dnl _USR_IRS gets us the hstrerror() proto in netdb.h case $host in *-ibm-aix4.3) From 1fe9eaebfe34af3e9ea6e675eee68e2d23626a02 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 5 Jun 2003 02:14:08 +0000 Subject: [PATCH 4503/7878] add a testcase to catch the problem seen with PR 20295, where apr_file_write_full() to pipe with timeout can return EAGAIN PR: 20295 (not fixed just yet) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64527 13f79535-47bb-0310-9956-ffa450edef68 --- test/.cvsignore | 1 + test/Makefile.in | 8 +++-- test/readchild.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++++ test/testpipe.c | 67 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 158 insertions(+), 2 deletions(-) create mode 100644 test/readchild.c diff --git a/test/.cvsignore b/test/.cvsignore index d37e3cf8d1f..4736de44928 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -11,6 +11,7 @@ testmd5 testmmap htdigest proctest +readchild testatomic testud testargs diff --git a/test/Makefile.in b/test/Makefile.in index c5460ad2a3d..096cf89d063 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -37,7 +37,8 @@ TARGETS = $(PROGRAMS) LOCAL_LIBS=../lib@APR_LIBNAME@.la -CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ +CLEAN_TARGETS = testfile.tmp mod_test.slo proc_child@EXEEXT@ occhild@EXEEXT@ \ +readchild@EXEEXT@ INCDIR=../include INCLUDES=-I$(INCDIR) @@ -59,6 +60,9 @@ testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS) occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS) $(LINK) occhild.lo $(LOCAL_LIBS) $(ALL_LIBS) +readchild@EXEEXT@: readchild.lo $(LOCAL_LIBS) + $(LINK) readchild.lo $(LOCAL_LIBS) $(ALL_LIBS) + proc_child@EXEEXT@: proc_child.lo $(LOCAL_LIBS) $(LINK) proc_child.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -117,7 +121,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testenv.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ - CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) + readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) $(LINK) $(TESTS) CuTest.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/readchild.c b/test/readchild.c new file mode 100644 index 00000000000..e20f6a3b60a --- /dev/null +++ b/test/readchild.c @@ -0,0 +1,84 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include + +#include "apr_file_io.h" + +int main(int argc, char *argv[]) +{ + apr_file_t *in, *out; + apr_size_t nbytes, total_bytes; + apr_pool_t *p; + char buf[128]; + apr_status_t rv; + + apr_initialize(); + atexit(apr_terminate); + apr_pool_create(&p, NULL); + + apr_file_open_stdin(&in, p); + apr_file_open_stdout(&out, p); + + total_bytes = 0; + nbytes = sizeof(buf); + while ((rv = apr_file_read(in, buf, &nbytes)) == APR_SUCCESS) { + total_bytes += nbytes; + nbytes = sizeof(buf); + } + + apr_file_printf(out, "%" APR_SIZE_T_FMT " bytes were read\n", + total_bytes); + return 0; +} diff --git a/test/testpipe.c b/test/testpipe.c index 14df56e01cc..98702c0f3c5 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -52,11 +52,15 @@ * . */ +#include + #include "test_apr.h" #include "apr_file_io.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" +#include "apr_thread_proc.h" +#include "apr_strings.h" static apr_file_t *readp = NULL; static apr_file_t *writep = NULL; @@ -157,6 +161,68 @@ static void read_write_notimeout(CuTest *tc) CuAssertStrEquals(tc, "this is a test", input); } +/* XXX FIXME */ +#ifdef WIN32 +#define EXTENSION ".exe" +#elif NETWARE +#define EXTENSION ".nlm" +#else +#define EXTENSION +#endif + +static void test_pipe_writefull(CuTest *tc) +{ + int iterations = 1000; + int i; + int bytes_per_iteration = 8000; + char *buf = (char *)malloc(bytes_per_iteration); + char responsebuf[128]; + apr_size_t nbytes; + int bytes_processed; + apr_proc_t proc = {0}; + apr_procattr_t *procattr; + const char *args[2]; + apr_status_t rv; + + rv = apr_procattr_create(&procattr, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_procattr_io_set(procattr, APR_CHILD_BLOCK, APR_CHILD_BLOCK, + APR_CHILD_BLOCK); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_procattr_error_check_set(procattr, 1); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + args[0] = "readchild" EXTENSION; + args[1] = NULL; + rv = apr_proc_create(&proc, "./readchild" EXTENSION, args, NULL, procattr, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_file_pipe_timeout_set(proc.in, apr_time_from_sec(10)); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_file_pipe_timeout_set(proc.out, apr_time_from_sec(10)); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + i = iterations; + do { + rv = apr_file_write_full(proc.in, buf, bytes_per_iteration, NULL); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + } while (--i); + + free(buf); + + rv = apr_file_close(proc.in); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + nbytes = sizeof(responsebuf); + rv = apr_file_read(proc.out, responsebuf, &nbytes); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + bytes_processed = (int)apr_strtoi64(responsebuf, NULL, 10); + CuAssertIntEquals(tc, iterations * bytes_per_iteration, bytes_processed); +} + CuSuite *testpipe(void) { CuSuite *suite = CuSuiteNew("Pipes"); @@ -166,6 +232,7 @@ CuSuite *testpipe(void) SUITE_ADD_TEST(suite, set_timeout); SUITE_ADD_TEST(suite, read_write); SUITE_ADD_TEST(suite, read_write_notimeout); + SUITE_ADD_TEST(suite, test_pipe_writefull); return suite; } From 6d66530c2c64a76a7ae0c736cb4412507e1ce568 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 5 Jun 2003 02:29:12 +0000 Subject: [PATCH 4504/7878] When writing to pipes with a timeout set, handle the situation where the kernel says the pipe is writable but an attempt to write <= PIPE_BUF bytes gets EAGAIN. APR will now write whatever data will fit. APR applications that relied on the atomic nature of relatively small pipe write requests may be affected. PR: 20295 First patch and lots of testing from: Mark Street git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64528 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 7 +++++++ file_io/unix/readwrite.c | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index cace705cbb1..e30f1d185ec 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,12 @@ Changes with APR 0.9.4 + *) When writing to pipes with a timeout set, handle the situation + where the kernel says the pipe is writable but an attempt to + write <= PIPE_BUF bytes gets EAGAIN. APR will now write whatever + data will fit. APR applications that relied on the atomic nature + of relatively small pipe write requests may be affected. + PR 20295 [Mark Street , Jeff Trawick] + *) Define _THREAD_SAFE for all compilations on AIX. Previously those of us who used the vendor compiler had it defined implicitly and others did not. The difference became obvious diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index c7782a35b32..98d86d5b1c4 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -243,8 +243,19 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } else { do { - rv = write(thefile->filedes, buf, *nbytes); - } while (rv == (apr_size_t)-1 && errno == EINTR); + do { + rv = write(thefile->filedes, buf, *nbytes); + } while (rv == (apr_size_t)-1 && errno == EINTR); + if (rv == (apr_size_t)-1 && + (errno == EAGAIN || errno == EWOULDBLOCK)) { + *nbytes /= 2; /* yes, we'll loop if kernel lied + * and we can't even write 1 byte + */ + } + else { + break; + } + } while (1); } } #endif From 8a83de9b6160fa8d2bbacc99d957fd4fb90a4c11 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 7 Jun 2003 12:04:43 +0000 Subject: [PATCH 4505/7878] When using a temporary file for flock- and fcntl-based mutexes, don't let the file be deleted on close. For flock-based mutexes, this corrects a fatal problem, since the file would disappear when a program was spawned and cleanup-for-exec was performed, and a subsequent attempt to perform child process mutex initialization would fail. For fcntl-based mutexes, this was a very minor issue that resulted in a failing unlink() when the file was closed, since fcntl lock initialization always removes the file immediately. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64529 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 10 ++++++++++ locks/unix/proc_mutex.c | 11 ++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index e30f1d185ec..8cce8100f1a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,15 @@ Changes with APR 0.9.4 + *) When using a temporary file for flock- and fcntl-based mutexes, + don't let the file be deleted on close. For flock-based mutexes, + this corrects a fatal problem, since the file would disappear + when a program was spawned and cleanup-for-exec was performed, + and a subsequent attempt to perform child process mutex + initialization would fail. For fcntl-based mutexes, this was a + very minor issue that resulted in a failing unlink() when the + file was closed, since fcntl lock initialization always removes + the file immediately. [Jeff Trawick] + *) When writing to pipes with a timeout set, handle the situation where the kernel says the pipe is writable but an attempt to write <= PIPE_BUF bytes gets EAGAIN. APR will now write whatever diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 0a98e81f266..1ad35de4a48 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -516,7 +516,8 @@ static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, } else { new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX"); - rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname, 0, + rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname, + APR_CREATE | APR_WRITE | APR_EXCL, new_mutex->pool); } @@ -526,11 +527,6 @@ static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, } new_mutex->curr_locked = 0; - /* XXX currently, apr_file_mktemp() always specifies that the file should - * be removed when closed; that unlink() will fail since we're - * removing it here; we want to remove it here since we don't need - * it visible and we want it cleaned up if we exit catastrophically - */ unlink(new_mutex->fname); apr_pool_cleanup_register(new_mutex->pool, (void*)new_mutex, @@ -631,7 +627,8 @@ static apr_status_t proc_mutex_flock_create(apr_proc_mutex_t *new_mutex, } else { new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX"); - rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname, 0, + rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname, + APR_CREATE | APR_WRITE | APR_EXCL, new_mutex->pool); } From b431029b0e384a105a0a14082ea691ce872284f3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 7 Jun 2003 12:37:48 +0000 Subject: [PATCH 4506/7878] Don't require the lock file name to be passed into apr_proc_mutex_child_init() or apr_global_mutex_child_init(). This allows child init to work when the lock file was a temp file created by APR. (The problem only occurred with flock- based mutexes.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64530 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ locks/unix/proc_mutex.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/CHANGES b/CHANGES index 8cce8100f1a..1ef63a9fc2c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR 0.9.4 + *) Don't require the lock file name to be passed into + apr_proc_mutex_child_init() or apr_global_mutex_child_init(). + This allows child init to work when the lock file was a temp + file created by APR. (The problem only occurred with flock- + based mutexes.) [Jeff Trawick] + *) When using a temporary file for flock- and fcntl-based mutexes, don't let the file be deleted on close. For flock-based mutexes, this corrects a fatal problem, since the file would disappear diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 1ad35de4a48..2f2a1a626cc 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -682,6 +682,9 @@ static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, memcpy(new_mutex, *mutex, sizeof *new_mutex); new_mutex->pool = pool; + if (!fname) { + fname = (*mutex)->fname; + } new_mutex->fname = apr_pstrdup(pool, fname); rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, APR_WRITE, 0, new_mutex->pool); From 7ceea6baee7341d4447754d089abba08810b118e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 7 Jun 2003 19:45:10 +0000 Subject: [PATCH 4507/7878] Add proc_mutex_lockfile() for retrieving the name of the file associated with a mutex. This is used in Apache to simplify the effort of getting permissions set properly on mutexes that will be created as root but used as non-root. For flock-based mutexes, chown() needs to be performed on the mutex file. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64531 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_proc_mutex.h | 7 +++++++ locks/beos/proc_mutex.c | 5 +++++ locks/netware/proc_mutex.c | 5 +++++ locks/os2/proc_mutex.c | 5 +++++ locks/unix/proc_mutex.c | 12 ++++++++++++ locks/win32/proc_mutex.c | 5 +++++ 7 files changed, 42 insertions(+) diff --git a/CHANGES b/CHANGES index 1ef63a9fc2c..48b02fa8a29 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.4 + *) Add apr_proc_mutex_lockfile() for retrieving the name of the + file associated with a mutex. [Jeff Trawick] + *) Don't require the lock file name to be passed into apr_proc_mutex_child_init() or apr_global_mutex_child_init(). This allows child init to work when the lock file was a temp diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index 197da270a1f..6cc6740ffb3 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -170,6 +170,13 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex); */ APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex); +/** + * Return the name of the lockfile for the mutex, or NULL + * if the mutex doesn't use a lock file + */ + +APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex); + /** * Display the name of the mutex, as it relates to the actual method used. * This matches the valid options for Apache's AcceptMutex directive diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index 405a0b15e57..bf4d7c3e5dd 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -157,6 +157,11 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return stat; } +APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) +{ + return NULL; +} + APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) { return "beossem"; diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 075d98305de..789f0f81edf 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -120,6 +120,11 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return APR_ENOLOCK; } +APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) +{ + return NULL; +} + APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) { return "netwarethread"; diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 23f0bdd692d..3a3c848aab3 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -93,6 +93,11 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *vmutex) return apr_proc_mutex_destroy(mutex); } +APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) +{ + return NULL; +} + APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) { return "os2sem"; diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 2f2a1a626cc..1fc630c38ad 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -877,6 +877,18 @@ APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) return mutex->meth->name; } +APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) +{ + /* posix sems use the fname field but don't use a file, + * so be careful + */ + if (!strcmp(mutex->meth->name, "flock") || + !strcmp(mutex->meth->name, "fcntl")) { + return mutex->fname; + } + return NULL; +} + APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 37a1d0cecf0..b490299ff05 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -205,6 +205,11 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return stat; } +APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) +{ + return NULL; +} + APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) { return mutex->fname; From b2e92fae62f098b2afb290f557e27e9a51e1a2ee Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 8 Jun 2003 13:29:22 +0000 Subject: [PATCH 4508/7878] POSIX says that passing a mutexattr object with default attributes to pthread_mutex_init() is equivalent to passing NULL: simplify apr_thread_mutex_create() to do the latter. Fixes build on BSD/OS 4.0, which prototypes but does not implement pthread_mutexattr_{init,destroy}, fooling the autoconf checks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64532 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_mutex.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 07ff34cd367..ba0140821a9 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -77,7 +77,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, apr_pool_t *pool) { apr_thread_mutex_t *new_mutex; - pthread_mutexattr_t mattr; apr_status_t rv; new_mutex = (apr_thread_mutex_t *)apr_pcalloc(pool, @@ -94,23 +93,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, */ new_mutex->nested = flags & APR_THREAD_MUTEX_NESTED; - if ((rv = pthread_mutexattr_init(&mattr))) { -#ifdef PTHREAD_SETS_ERRNO - rv = errno; -#endif - thread_mutex_cleanup(new_mutex); - return rv; - } - - if ((rv = pthread_mutex_init(&new_mutex->mutex, &mattr))) { -#ifdef PTHREAD_SETS_ERRNO - rv = errno; -#endif - thread_mutex_cleanup(new_mutex); - return rv; - } - - if ((rv = pthread_mutexattr_destroy(&mattr))) { + if ((rv = pthread_mutex_init(&new_mutex->mutex, NULL))) { #ifdef PTHREAD_SETS_ERRNO rv = errno; #endif From 628191bab81cac32c92b45ac95621ee03007de9f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 8 Jun 2003 13:36:32 +0000 Subject: [PATCH 4509/7878] Code style cleanups: remove unnecessary casts to and from void *; don't check for allocation failure. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64533 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_mutex.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index ba0140821a9..130a5cb980e 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -60,7 +60,7 @@ static apr_status_t thread_mutex_cleanup(void *data) { - apr_thread_mutex_t *mutex = (apr_thread_mutex_t *)data; + apr_thread_mutex_t *mutex = data; apr_status_t rv; rv = pthread_mutex_destroy(&mutex->mutex); @@ -79,12 +79,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, apr_thread_mutex_t *new_mutex; apr_status_t rv; - new_mutex = (apr_thread_mutex_t *)apr_pcalloc(pool, - sizeof(apr_thread_mutex_t)); - - if (new_mutex == NULL) { - return APR_ENOMEM; - } + new_mutex = apr_pcalloc(pool, sizeof(apr_thread_mutex_t)); new_mutex->pool = pool; @@ -102,7 +97,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, } apr_pool_cleanup_register(new_mutex->pool, - (void *)new_mutex, thread_mutex_cleanup, + new_mutex, thread_mutex_cleanup, apr_pool_cleanup_null); *mutex = new_mutex; From 87a6b36b6aec30602922778cca39835ccffe0846 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 8 Jun 2003 13:42:20 +0000 Subject: [PATCH 4510/7878] Error handling fix (unrelated to previous changes): don't call pthread_mutex_destroy(NULL) if pthread_mutex_init() fails. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64534 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_mutex.c | 1 - 1 file changed, 1 deletion(-) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 130a5cb980e..39062a2bd8e 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -92,7 +92,6 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, #ifdef PTHREAD_SETS_ERRNO rv = errno; #endif - thread_mutex_cleanup(new_mutex); return rv; } From 74157ea3b59b03629d6425ab71d0e120a1a20d7c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 11 Jun 2003 15:20:33 +0000 Subject: [PATCH 4511/7878] the setting of _THREAD_SAFE here is redundant git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64535 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 ------ 1 file changed, 6 deletions(-) diff --git a/configure.in b/configure.in index c5f2714169a..2ea66c18e01 100644 --- a/configure.in +++ b/configure.in @@ -554,12 +554,6 @@ if test "$threads" = "1"; then [Define if gethostbyaddr is thread safe]) fi AC_CHECK_FUNCS(gethostbyname_r gethostbyaddr_r) - - case "$host" in - *-ibm-aix*) - APR_ADDTO(CPPFLAGS, [-D_THREAD_SAFE]) - ;; - esac else echo "APR will be non-threaded" fi From 32d2f60212358006b33e9a657da8f0d443030051 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Fri, 13 Jun 2003 07:36:06 +0000 Subject: [PATCH 4512/7878] Fix a doc typo and clarify. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64536 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_rwlock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_rwlock.h b/include/apr_thread_rwlock.h index 210d2ec1323..26873793158 100644 --- a/include/apr_thread_rwlock.h +++ b/include/apr_thread_rwlock.h @@ -131,7 +131,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwloc /** * Release either the read or write lock currently held by the calling thread * associated with the given read-write lock. - * @param rwlock the read-write lock rom which to release the lock. + * @param rwlock the read-write lock to be released (unlocked). */ APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock); From 75e09e58bd230d8bf5e5ae5932aa05ca5d91f792 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sun, 15 Jun 2003 00:05:26 +0000 Subject: [PATCH 4513/7878] fix documentation for apr_file_getc() Submitted by: Joshua Moore-Oliva git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64537 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 80e67fdc7b3..8ff62117650 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -435,8 +435,8 @@ APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile); /** * get a character from the specified file. - * @param ch The character to write. - * @param thefile The file descriptor to write to + * @param ch The character to read into + * @param thefile The file descriptor to read from */ APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile); From 2cae385e538eca2ac58a7da9c8d23b689c9b42c7 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 16 Jun 2003 20:47:21 +0000 Subject: [PATCH 4514/7878] Take only the first line from libtool --version as 1.5 emits multi-line version information now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64538 13f79535-47bb-0310-9956-ffa450edef68 --- build/buildcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 0bc0be4fdfd..c6c6fbbbd06 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -22,7 +22,7 @@ fi # libtool 1.3.3 or newer libtool=`build/PrintPath glibtool libtool` -lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'` +lt_pversion=`$libtool --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'` if test -z "$lt_pversion"; then echo "buildconf: libtool not found." echo " You need libtool version 1.3.3 or newer installed" From 545426aede66dc56564f2a76256689150696d569 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 17 Jun 2003 20:44:25 +0000 Subject: [PATCH 4515/7878] Use the location of libtool.m4 given in the LIBTOOL_M4 environment variable, if set. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64539 13f79535-47bb-0310-9956-ffa450edef68 --- buildconf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/buildconf b/buildconf index f1c3235068c..cbc8f6a7759 100755 --- a/buildconf +++ b/buildconf @@ -81,13 +81,15 @@ echo "Copying libtool helper files ..." $libtoolize --copy --automake ltpath=`dirname $libtoolize` -ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4 +ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/libtool.m4} if [ ! -f $ltfile ]; then echo "$ltfile not found" exit 1 fi +echo "buildconf: Using libtool.m4 at ${ltfile}." + cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' > build/libtool.m4 # This is just temporary until people's workspaces are cleared -- remove From 3e5081c9e3fcb5bd2d526aa8f153aa48219515a3 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 18 Jun 2003 19:00:41 +0000 Subject: [PATCH 4516/7878] Win32: WAIT_ABANDONED should be treated as a success. WAIT_FAILED (the only other possible return code) should call GetLastError, canonicalize it then return that as apr_status git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64540 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/thread.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 7d48228dac1..bbc08d2fb75 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -167,15 +167,15 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { - apr_status_t stat; + apr_status_t rv; - if ((stat = WaitForSingleObject(thd->td, INFINITE)) == WAIT_OBJECT_0) { + rv = WaitForSingleObject(thd->td, INFINITE); + if ( rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) { *retval = thd->exitval; return APR_SUCCESS; } - else { - return stat; - } + /* Wait failed */ + return APR_FROM_OS_ERROR(GetLastError()); } APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) From 48e6847cb3464f2e6c1708a3dee1bc2b13627f8b Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 18 Jun 2003 19:13:48 +0000 Subject: [PATCH 4517/7878] Win32: Adopt Brian Havard's OS/2 rwlock implementation. Submitted by: Marc Adkins Reviewed by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64541 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + include/arch/win32/apr_arch_thread_rwlock.h | 8 +- locks/win32/thread_rwlock.c | 148 ++++++++++++++------ 3 files changed, 112 insertions(+), 46 deletions(-) diff --git a/CHANGES b/CHANGES index 48b02fa8a29..8fc36eee77b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ Changes with APR 0.9.4 + *) Win32: Adopt Brian Havard's OS/2 rwlock implementation for + Windows [Marc Adkins, Bill Stoddard] *) Add apr_proc_mutex_lockfile() for retrieving the name of the file associated with a mutex. [Jeff Trawick] diff --git a/include/arch/win32/apr_arch_thread_rwlock.h b/include/arch/win32/apr_arch_thread_rwlock.h index 50d0e6ce735..8124fe1ff79 100644 --- a/include/arch/win32/apr_arch_thread_rwlock.h +++ b/include/arch/win32/apr_arch_thread_rwlock.h @@ -59,11 +59,9 @@ struct apr_thread_rwlock_t { apr_pool_t *pool; - HANDLE readevent; - HANDLE mutex; - HANDLE writemutex; - int counter; - int wrcounter; + HANDLE write_mutex; + HANDLE read_event; + LONG readers; }; #endif /* THREAD_RWLOCK_H */ diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c index a8d6cf1bda9..0eda1d9b966 100644 --- a/locks/win32/thread_rwlock.c +++ b/locks/win32/thread_rwlock.c @@ -61,75 +61,141 @@ static apr_status_t thread_rwlock_cleanup(void *data) { - apr_thread_rwlock_t *rwlock = data; - CloseHandle(rwlock->readevent); - CloseHandle(rwlock->mutex); - CloseHandle(rwlock->writemutex); + return apr_thread_rwlock_destroy((apr_thread_rwlock_t *) data); +} + +APR_DECLARE(apr_status_t)apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, + apr_pool_t *pool) +{ + *rwlock = apr_palloc(pool, sizeof(**rwlock)); + + (*rwlock)->pool = pool; + (*rwlock)->readers = 0; + + if (! ((*rwlock)->read_event = CreateEvent(NULL, TRUE, FALSE, NULL))) { + *rwlock = NULL; + return APR_FROM_OS_ERROR(GetLastError()); + } + + if (! ((*rwlock)->write_mutex = CreateMutex(NULL, FALSE, NULL))) { + CloseHandle((*rwlock)->read_event); + *rwlock = NULL; + return APR_FROM_OS_ERROR(GetLastError()); + } + + apr_pool_cleanup_register(pool, *rwlock, thread_rwlock_cleanup, + apr_pool_cleanup_null); + return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, - apr_pool_t *pool) +static apr_status_t apr_thread_rwlock_rdlock_core(apr_thread_rwlock_t *rwlock, + DWORD milliseconds) { - (*rwlock) = apr_palloc(pool, sizeof(**rwlock)); - (*rwlock)->pool = pool; - (*rwlock)->readevent=CreateEvent(NULL,TRUE,FALSE,NULL); - (*rwlock)->mutex = CreateEvent(NULL,FALSE,TRUE,NULL); - (*rwlock)->writemutex = CreateMutex(NULL,FALSE,NULL); - (*rwlock)->counter = -1; - (*rwlock)->wrcounter = 0; + DWORD code = WaitForSingleObject(rwlock->write_mutex, milliseconds); + + if (code == WAIT_FAILED || code == WAIT_TIMEOUT) + return APR_FROM_OS_ERROR(code); + + /* We've successfully acquired the writer mutex, we can't be locked + * for write, so it's OK to add the reader lock. The writer mutex + * doubles as race condition protection for the readers counter. + */ + InterlockedIncrement(&rwlock->readers); + + if (! ResetEvent(rwlock->read_event)) + return APR_FROM_OS_ERROR(GetLastError()); + + if (! ReleaseMutex(rwlock->write_mutex)) + return APR_FROM_OS_ERROR(GetLastError()); + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) { - if (InterlockedIncrement(&rwlock->counter) == 0) { - WaitForSingleObject(rwlock->mutex, INFINITE); - SetEvent(rwlock->readevent); - } - WaitForSingleObject(rwlock->readevent,INFINITE); - return APR_SUCCESS; + return apr_thread_rwlock_rdlock_core(rwlock, INFINITE); } -APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(apr_status_t) +apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + return apr_thread_rwlock_rdlock_core(rwlock, 0); } -APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) +static apr_status_t +apr_thread_rwlock_wrlock_core(apr_thread_rwlock_t *rwlock, DWORD milliseconds) { - WaitForSingleObject(rwlock->writemutex,INFINITE); - WaitForSingleObject(rwlock->mutex, INFINITE); - rwlock->wrcounter++; + DWORD code = WaitForSingleObject(rwlock->write_mutex, milliseconds); + + if (code == WAIT_FAILED || code == WAIT_TIMEOUT) + return APR_FROM_OS_ERROR(code); + + /* We've got the writer lock but we have to wait for all readers to + * unlock before it's ok to use it. + */ + if (rwlock->readers) { + /* Must wait for readers to finish before returning, unless this + * is an trywrlock (milliseconds == 0): + */ + code = milliseconds + ? WaitForSingleObject(rwlock->read_event, milliseconds) + : WAIT_TIMEOUT; + + if (code == WAIT_FAILED || code == WAIT_TIMEOUT) { + /* Unable to wait for readers to finish, release write lock: */ + if (! ReleaseMutex(rwlock->write_mutex)) + return APR_FROM_OS_ERROR(GetLastError()); + + return APR_FROM_OS_ERROR(code); + } + } + return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) +{ + return apr_thread_rwlock_wrlock_core(rwlock, INFINITE); +} + +APR_DECLARE(apr_status_t)apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) { - return APR_ENOTIMPL; + return apr_thread_rwlock_wrlock_core(rwlock, 0); } APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) { - if (rwlock->wrcounter) { - /* If wrcounter is > 0, then we must have a writer lock */ - rwlock->wrcounter--; - SetEvent(rwlock->mutex); - ReleaseMutex(rwlock->writemutex); - } - else { - if (InterlockedDecrement(&rwlock->counter) < 0) { - ResetEvent(rwlock->readevent); - SetEvent(rwlock->mutex); + DWORD code = 0; + + /* First, guess that we're unlocking a writer */ + if (! ReleaseMutex(rwlock->write_mutex)) + code = GetLastError(); + + if (code == ERROR_NOT_OWNER) { + /* Nope, we must have a read lock */ + if (rwlock->readers && + ! InterlockedDecrement(&rwlock->readers) && + ! SetEvent(rwlock->read_event)) { + code = GetLastError(); } - } - return APR_SUCCESS; + else { + code = 0; + } + } + + return APR_FROM_OS_ERROR(code); } APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) { - return apr_pool_cleanup_run(rwlock->pool, rwlock, thread_rwlock_cleanup); + if (! CloseHandle(rwlock->read_event)) + return APR_FROM_OS_ERROR(GetLastError()); + + if (! CloseHandle(rwlock->write_mutex)) + return APR_FROM_OS_ERROR(GetLastError()); + + return APR_SUCCESS; } APR_POOL_IMPLEMENT_ACCESSOR(thread_rwlock) - From f32dfd8aeb3b5efa9d8867b2edcf17864b28a32b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 18 Jun 2003 22:31:08 +0000 Subject: [PATCH 4518/7878] Clean up a style issue; apr_get_os_error() is much cleaner. Note that the result from WaitFor{*}() calls is a rather special case, since it has other interesting details. These were not touched since they are clearer as-is. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64542 13f79535-47bb-0310-9956-ffa450edef68 --- locks/win32/thread_rwlock.c | 26 +++++++++++++------------- threadproc/win32/thread.c | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/locks/win32/thread_rwlock.c b/locks/win32/thread_rwlock.c index 0eda1d9b966..f5671ddbe47 100644 --- a/locks/win32/thread_rwlock.c +++ b/locks/win32/thread_rwlock.c @@ -74,13 +74,13 @@ APR_DECLARE(apr_status_t)apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, if (! ((*rwlock)->read_event = CreateEvent(NULL, TRUE, FALSE, NULL))) { *rwlock = NULL; - return APR_FROM_OS_ERROR(GetLastError()); + return apr_get_os_error(); } if (! ((*rwlock)->write_mutex = CreateMutex(NULL, FALSE, NULL))) { CloseHandle((*rwlock)->read_event); *rwlock = NULL; - return APR_FROM_OS_ERROR(GetLastError()); + return apr_get_os_error(); } apr_pool_cleanup_register(pool, *rwlock, thread_rwlock_cleanup, @@ -104,10 +104,10 @@ static apr_status_t apr_thread_rwlock_rdlock_core(apr_thread_rwlock_t *rwlock, InterlockedIncrement(&rwlock->readers); if (! ResetEvent(rwlock->read_event)) - return APR_FROM_OS_ERROR(GetLastError()); + return apr_get_os_error(); if (! ReleaseMutex(rwlock->write_mutex)) - return APR_FROM_OS_ERROR(GetLastError()); + return apr_get_os_error(); return APR_SUCCESS; } @@ -145,7 +145,7 @@ apr_thread_rwlock_wrlock_core(apr_thread_rwlock_t *rwlock, DWORD milliseconds) if (code == WAIT_FAILED || code == WAIT_TIMEOUT) { /* Unable to wait for readers to finish, release write lock: */ if (! ReleaseMutex(rwlock->write_mutex)) - return APR_FROM_OS_ERROR(GetLastError()); + return apr_get_os_error(); return APR_FROM_OS_ERROR(code); } @@ -166,34 +166,34 @@ APR_DECLARE(apr_status_t)apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) { - DWORD code = 0; + apr_status_t rv = 0; /* First, guess that we're unlocking a writer */ if (! ReleaseMutex(rwlock->write_mutex)) - code = GetLastError(); + rv = apr_get_os_error(); - if (code == ERROR_NOT_OWNER) { + if (rv == APR_FROM_OS_ERROR(ERROR_NOT_OWNER)) { /* Nope, we must have a read lock */ if (rwlock->readers && ! InterlockedDecrement(&rwlock->readers) && ! SetEvent(rwlock->read_event)) { - code = GetLastError(); + rv = apr_get_os_error(); } else { - code = 0; + rv = 0; } } - return APR_FROM_OS_ERROR(code); + return rv; } APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) { if (! CloseHandle(rwlock->read_event)) - return APR_FROM_OS_ERROR(GetLastError()); + return apr_get_os_error(); if (! CloseHandle(rwlock->write_mutex)) - return APR_FROM_OS_ERROR(GetLastError()); + return apr_get_os_error(); return APR_SUCCESS; } diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index bbc08d2fb75..e470710dd8d 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -175,7 +175,7 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, return APR_SUCCESS; } /* Wait failed */ - return APR_FROM_OS_ERROR(GetLastError()); + return apr_get_os_error();; } APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) From 7e88b0053df9724061c8c531694417e900ef2254 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 19 Jun 2003 11:03:09 +0000 Subject: [PATCH 4519/7878] tweak a comment to better describe what APR_SHELLCMD can handle git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64543 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 805b9185d43..1995b377fd0 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -468,7 +468,7 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, * @param attr The procattr we care about. * @param cmd The type of command. One of: *
    * @param perm Access permissions for file. * @param cont The pool to use. diff --git a/include/apr_network_io.h b/include/apr_network_io.h index dd18ed35903..e48f7309170 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -489,10 +489,6 @@ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, apr_size_t *len); -/** @deprecated @see apr_socket_send */ -APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, - apr_size_t *len); - /** * Send multiple packets of data over a network. * @param sock The socket to send the data over. @@ -514,11 +510,6 @@ APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len); -/** @deprecated @see apr_socket_sendv */ -APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, - const struct iovec *vec, - apr_int32_t nvec, apr_size_t *len); - /** * @param sock The socket to send from * @param where The apr_sockaddr_t describing where to send the data @@ -531,11 +522,6 @@ APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, apr_int32_t flags, const char *buf, apr_size_t *len); -/** @deprecated @see apr_socket_sendto */ -APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, - apr_size_t *len); - /** * @param from The apr_sockaddr_t to fill in the recipient info * @param sock The socket to use @@ -549,11 +535,6 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, apr_int32_t flags, char *buf, apr_size_t *len); -/** @deprecated @see apr_socket_recvfrom */ -APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, - apr_int32_t flags, char *buf, - apr_size_t *len); - #if APR_HAS_SENDFILE || defined(DOXYGEN) /** @@ -578,11 +559,6 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, apr_size_t *len, apr_int32_t flags); -/** @deprecated @see apr_socket_sendfile */ -APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, - apr_hdtr_t *hdtr, apr_off_t *offset, - apr_size_t *len, apr_int32_t flags); - #endif /* APR_HAS_SENDFILE */ /** @@ -606,10 +582,6 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len); -/** @deprecated @see apr_socket_recv */ -APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, - char *buf, apr_size_t *len); - /** * Setup socket options for the specified socket * @param sock The socket to set up. @@ -630,10 +602,6 @@ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on); -/** @deprecated @see apr_socket_opt_set */ -APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t on); - /** * Setup socket timeout for the specified socket * @param sock The socket to set up. @@ -670,10 +638,6 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on); -/** @deprecated @see apr_socket_opt_set */ -APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t *on); - /** * Query socket timeout for the specified socket * @param sock The socket to query @@ -812,17 +776,11 @@ APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, */ APR_DECLARE_INHERIT_SET(socket); -/** @deprecated @see apr_socket_inherit_set */ -APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *skt); - /** * Unset a socket from being inherited by child processes. */ APR_DECLARE_INHERIT_UNSET(socket); -/** @deprecated @see apr_socket_inherit_unset */ -APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *skt); - /** @} */ #ifdef __cplusplus diff --git a/include/arch/unix/apr_arch_inherit.h b/include/arch/unix/apr_arch_inherit.h index c4c72677047..7807d323038 100644 --- a/include/arch/unix/apr_arch_inherit.h +++ b/include/arch/unix/apr_arch_inherit.h @@ -71,11 +71,6 @@ apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \ cleanup, apr_pool_cleanup_null); \ } \ return APR_SUCCESS; \ -} \ -/* Deprecated */ \ -void apr_##name##_set_inherit(apr_##name##_t *the##name) \ -{ \ - apr_##name##_inherit_set(the##name); \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ @@ -90,11 +85,6 @@ apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \ cleanup, cleanup); \ } \ return APR_SUCCESS; \ -} \ -/* Deprecated */ \ -void apr_##name##_unset_inherit(apr_##name##_t *the##name) \ -{ \ - apr_##name##_inherit_unset(the##name); \ } #endif /* ! INHERIT_H */ diff --git a/include/arch/win32/apr_arch_inherit.h b/include/arch/win32/apr_arch_inherit.h index 4d0967bb1bd..6659df690d0 100644 --- a/include/arch/win32/apr_arch_inherit.h +++ b/include/arch/win32/apr_arch_inherit.h @@ -80,11 +80,6 @@ APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ the##name->filehand = temp; \ } \ return APR_SUCCESS; \ -} \ -/* Deprecated */ \ -APR_DECLARE(void) apr_##name##_set_inherit(apr_##name##_t *the##name) \ -{ \ - apr_##name##_inherit_set(the##name); \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ @@ -107,11 +102,6 @@ APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ the##name->filehand = temp; \ } \ return APR_SUCCESS; \ -} \ -/* Deprecated */ \ -APR_DECLARE(void) apr_##name##_unset_inherit(apr_##name##_t *the##name) \ -{ \ - apr_##name##_inherit_unset(the##name); \ } #endif /* ! INHERIT_H */ diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 45dc43587ac..965ea8857a2 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -249,42 +249,4 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, return APR_SUCCESS; } -/* deprecated */ -APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, - apr_size_t *len) -{ - return apr_socket_send(sock, buf, len); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t * sock, - const struct iovec *vec, - apr_int32_t nvec, apr_size_t *len) -{ - return apr_socket_sendv(sock, vec, nvec, len); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, - apr_size_t *len) -{ - return apr_socket_sendto(sock, where, flags, buf, len); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, - apr_int32_t flags, char *buf, - apr_size_t *len) -{ - return apr_socket_recvfrom(from, sock, flags, buf, len); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, - apr_size_t *len) -{ - return apr_socket_recv(sock, buf, len); -} - #endif diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index 654ba917aad..4983b897b7b 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -187,25 +187,3 @@ APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, *len = rv; return APR_SUCCESS; } - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, - apr_size_t *len) -{ - return apr_socket_send(sock, buf, len); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, - const struct iovec *vec, - apr_int32_t nvec, apr_size_t *len) -{ - return apr_socket_sendv(sock, vec, nvec, len); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, - apr_size_t *len) -{ - return apr_socket_recv(sock, buf, len); -} diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c index 55c7a9341c7..f296074581a 100644 --- a/network_io/os2/sendrecv_udp.c +++ b/network_io/os2/sendrecv_udp.c @@ -140,21 +140,3 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, return APR_SUCCESS; } - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, - apr_size_t *len) -{ - return apr_socket_sendto(sock, where, flags, buf, len); -} - - - -APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, - apr_socket_t *sock, - apr_int32_t flags, char *buf, - apr_size_t *len) -{ - return apr_socket_recvfrom(from, sock, flags, buf, len); -} diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 823036d71be..70bb4c0781e 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -156,20 +156,6 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, } -/* deprecated */ -APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t on) -{ - return apr_socket_opt_set(sock, opt, on); -} - -APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t *on) -{ - return apr_socket_opt_get(sock, opt, on); -} - - APR_DECLARE(apr_status_t) apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 58777418789..c684ce38779 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -1001,52 +1001,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } #else #error APR has detected sendfile on your system, but nobody has written a -#error version of it for APR yet. To get past this, either write apr_sendfile -#error or change APR_HAS_SENDFILE in apr.h to 0. +#error version of it for APR yet. To get past this, either write +#error apr_socket_sendfile or change APR_HAS_SENDFILE in apr.h to 0. #endif /* __linux__, __FreeBSD__, __HPUX__, _AIX, __MVS__, Tru64/OSF1 */ -/* deprecated */ -apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, - apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, - apr_int32_t flags) -{ - return apr_socket_sendfile(sock, file, hdtr, offset, len, flags); -} - #endif /* APR_HAS_SENDFILE */ - -/* deprecated */ -apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) -{ - return apr_socket_send(sock, buf, len); -} - -/* deprecated */ -#ifdef HAVE_WRITEV -apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, - apr_int32_t nvec, apr_size_t *len) -{ - return apr_socket_sendv(sock, vec, nvec, len); -} -#endif - -/* deprecated */ -apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, apr_size_t *len) -{ - return apr_socket_sendto(sock, where, flags, buf, len); -} - -/* deprecated */ -apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, - apr_int32_t flags, char *buf, - apr_size_t *len) -{ - return apr_socket_recvfrom(from, sock, flags, buf, len); -} - -/* deprecated */ -apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) -{ - return apr_socket_recv(sock, buf, len); -} diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index c346678cb69..cc181b6aac5 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -369,20 +369,6 @@ apr_status_t apr_socket_opt_get(apr_socket_t *sock, } -/* deprecated */ -apr_status_t apr_setsocketopt(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t on) -{ - return apr_socket_opt_set(sock, opt, on); -} - -apr_status_t apr_getsocketopt(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t *on) -{ - return apr_socket_opt_get(sock, opt, on); -} - - apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { if (gethostname(buf, len) == -1) { diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index c400d58a6fc..c5d6ec3de1b 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -332,7 +332,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, hdtrbuf, sizeof(hdtrbuf)); /* If not enough buffer, punt to sendv */ if (rv == APR_INCOMPLETE) { - rv = apr_sendv(sock, hdtr->headers, hdtr->numheaders, &nbytes); + rv = apr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, &nbytes); if (rv != APR_SUCCESS) return rv; *len += nbytes; @@ -436,7 +436,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, if (status == APR_SUCCESS) { if (sendv_trailers) { - rv = apr_sendv(sock, hdtr->trailers, hdtr->numtrailers, &nbytes); + rv = apr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, &nbytes); if (rv != APR_SUCCESS) return rv; *len += nbytes; @@ -460,51 +460,5 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, return status; } -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, - apr_hdtr_t *hdtr, apr_off_t *offset, - apr_size_t *len, apr_int32_t flags) -{ - return apr_socket_sendfile(sock, file, hdtr, offset, len, flags); -} - #endif -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, - apr_size_t *len) -{ - return apr_socket_send(sock, buf, len); -} - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, - const struct iovec *vec, - apr_int32_t nvec, apr_size_t *nbytes) -{ - return apr_socket_sendv(sock, vec, nvec, nbytes); -} - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, - apr_size_t *len) -{ - return apr_socket_sendto(sock, where, flags, buf, len); -} - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, - apr_socket_t *sock, - apr_int32_t flags, - char *buf, apr_size_t *len) -{ - return apr_socket_recvfrom(from, sock, flags, buf, len); -} - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, - apr_size_t *len) -{ - return apr_socket_recv(sock, buf, len); -} diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 46bdeb053c2..f19b4161739 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -510,19 +510,10 @@ APR_DECLARE(apr_status_t) apr_socket_inherit_set(apr_socket_t *socket) { return APR_ENOTIMPL; } -/* Deprecated */ -APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *socket) -{ - apr_socket_inherit_set(socket); -} APR_DECLARE(apr_status_t) apr_socket_inherit_unset(apr_socket_t *socket) { return APR_ENOTIMPL; } -/* Deprecated */ -APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *socket) -{ - apr_socket_inherit_unset(socket); -} + diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index aa9e0870c36..e86c6b8b279 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -262,20 +262,6 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, } -/* deprecated */ -APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t on) -{ - return apr_socket_opt_set(sock, opt, on); -} - -APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t *on) -{ - return apr_socket_opt_get(sock, opt, on); -} - - APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont) { From 5e1198ea785d4ff94cc5ef391cecf3275bcd5bec Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 3 Sep 2003 17:12:18 +0000 Subject: [PATCH 4581/7878] axe these deprecated functions: apr_allocator_get_mutex apr_allocator_get_owner apr_allocator_set_max_free apr_allocator_set_mutex apr_allocator_set_owner apr_pool_get_abort apr_pool_get_parent apr_pool_set_abort apr_pool_sub_make apr_signal_get_description git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64606 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 10 +++++++ include/apr_allocator.h | 20 ------------- include/apr_pools.h | 21 ------------- include/apr_signal.h | 3 -- memory/unix/apr_pools.c | 57 ------------------------------------ threadproc/netware/signals.c | 6 ---- threadproc/unix/signals.c | 6 ---- threadproc/win32/signals.c | 6 ---- 8 files changed, 10 insertions(+), 119 deletions(-) diff --git a/CHANGES b/CHANGES index 74dcf26df03..4a0bc2de1d1 100644 --- a/CHANGES +++ b/CHANGES @@ -3,10 +3,19 @@ Changes with APR 1.0 *) The following deprecated interfaces have been removed: apr_accept -> apr_socket_accept + apr_allocator_get_mutex -> apr_allocator_mutex_get + apr_allocator_get_owner -> apr_allocator_owner_get + apr_allocator_set_max_free -> apr_allocator_max_free_set + apr_allocator_set_mutex -> apr_allocator_mutex_set + apr_allocator_set_owner -> apr_allocator_owner_set apr_bind -> apr_socket_bind apr_connect -> apr_socket_connect apr_getsocketopt -> apr_socket_opt_get apr_listen -> apr_socket_listen + apr_pool_get_abort -> apr_pool_abort_get + apr_pool_get_parent -> apr_pool_parent_get + apr_pool_set_abort -> apr_pool_abort_set + apr_pool_sub_make -> apr_pool_create_ex apr_recv -> apr_socket_recv apr_recvfrom -> apr_socket_recvfrom apr_send -> apr_socket_send @@ -15,6 +24,7 @@ Changes with APR 1.0 apr_sendv -> apr_socket_sendv apr_setsocketopt -> apr_socket_opt_set apr_shutdown -> apr_socket_shutdown + apr_signal_get_description -> apr_signal_description_get apr_socket_create_ex -> apr_socket_create apr_socket_set_inherit -> apr_socket_inherit_set apr_socket_unset_inherit -> apr_socket_inherit_unset diff --git a/include/apr_allocator.h b/include/apr_allocator.h index cc58e647fe0..94d39177f35 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -144,20 +144,12 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator, apr_pool_t *pool); -/** @deprecated @see apr_allocator_owner_set */ -APR_DECLARE(void) apr_allocator_set_owner(apr_allocator_t *allocator, - apr_pool_t *pool); - /** * Get the current owner of the allocator * @param allocator The allocator to get the owner from */ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator); -/** @deprecated @see apr_allocator_owner_get */ -APR_DECLARE(apr_pool_t *) apr_allocator_get_owner( - apr_allocator_t *allocator); - /** * Set the current threshold at which the allocator should start * giving blocks back to the system. @@ -167,10 +159,6 @@ APR_DECLARE(apr_pool_t *) apr_allocator_get_owner( APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, apr_size_t size); -/** @deprecated @see apr_allocator_max_free_set */ -APR_DECLARE(void) apr_allocator_set_max_free(apr_allocator_t *allocator, - apr_size_t size); - #include "apr_thread_mutex.h" #if APR_HAS_THREADS @@ -182,10 +170,6 @@ APR_DECLARE(void) apr_allocator_set_max_free(apr_allocator_t *allocator, APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator, apr_thread_mutex_t *mutex); -/** @deprecated @see apr_allocator_mutex_set */ -APR_DECLARE(void) apr_allocator_set_mutex(apr_allocator_t *allocator, - apr_thread_mutex_t *mutex); - /** * Get the mutex currently set for the allocator * @param allocator The allocator @@ -193,10 +177,6 @@ APR_DECLARE(void) apr_allocator_set_mutex(apr_allocator_t *allocator, APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get( apr_allocator_t *allocator); -/** @deprecated @see apr_allocator_mutex_get */ -APR_DECLARE(apr_thread_mutex_t *) apr_allocator_get_mutex( - apr_allocator_t *allocator); - #endif /* APR_HAS_THREADS */ /** @} */ diff --git a/include/apr_pools.h b/include/apr_pools.h index a19fe5f1fe1..d43b83e7ce3 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -275,17 +275,6 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, #endif #endif -/** @deprecated @see apr_pool_create_ex */ -#if APR_POOL_DEBUG -#define apr_pool_sub_make(newpool, parent, abort_fn) \ - (void)apr_pool_create_ex_debug(newpool, parent, abort_fn, \ - NULL, \ - APR_POOL__FILE_LINE__) -#else -#define apr_pool_sub_make(newpool, parent, abort_fn) \ - (void)apr_pool_create_ex(newpool, parent, abort_fn, NULL) -#endif - /** * Find the pools allocator * @param pool The pool to get the allocator from. @@ -425,10 +414,6 @@ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size, APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc_t abortfunc, apr_pool_t *pool); -/** @deprecated @see apr_pool_abort_set */ -APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abortfunc, - apr_pool_t *pool); - /** * Get the abort function associated with the specified pool. * @param pool The pool for retrieving the abort function. @@ -436,9 +421,6 @@ APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abortfunc, */ APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool); -/** @deprecated @see apr_pool_abort_get */ -APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool); - /** * Get the parent pool of the specified pool. * @param pool The pool for retrieving the parent pool. @@ -446,9 +428,6 @@ APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool); */ APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool); -/** @deprecated @see apr_pool_parent_get */ -APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool); - /** * Determine if pool a is an ancestor of pool b * @param a The pool to search diff --git a/include/apr_signal.h b/include/apr_signal.h index 3ef45ec9779..8e4f1495f8c 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -117,9 +117,6 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func); */ APR_DECLARE(const char *) apr_signal_description_get(int signum); -/** @deprecated @see apr_signal_description_get */ -APR_DECLARE(const char *) apr_signal_get_description(int signum); - /** * APR-private function for initializing the signal package * @internal diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index d10012114c0..8f2372d768d 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -2228,60 +2228,3 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, } #endif /* APR_POOL_DEBUG */ - -/* Deprecated */ -APR_DECLARE(void) apr_allocator_set_max_free(apr_allocator_t *allocator, - apr_size_t size) -{ - apr_allocator_max_free_set(allocator, size); -} - -/* Deprecated */ -APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abort_fn, - apr_pool_t *pool) -{ - apr_pool_abort_set(abort_fn, pool); -} - -/* Deprecated */ -APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool) -{ - return apr_pool_abort_get(pool); -} - -/* Deprecated */ -APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool) -{ - return apr_pool_parent_get(pool); -} - -/* Deprecated */ -APR_DECLARE(void) apr_allocator_set_owner(apr_allocator_t *allocator, - apr_pool_t *pool) -{ - apr_allocator_owner_set(allocator, pool); -} - -/* Deprecated */ -APR_DECLARE(apr_pool_t *) apr_allocator_get_owner( - apr_allocator_t *allocator) -{ - return apr_allocator_owner_get(allocator); -} - -#if APR_HAS_THREADS -/* Deprecated */ -APR_DECLARE(apr_thread_mutex_t *) apr_allocator_get_mutex( - apr_allocator_t *allocator) -{ - return apr_allocator_mutex_get(allocator); -} - -/* Deprecated */ -APR_DECLARE(void) apr_allocator_set_mutex(apr_allocator_t *allocator, - apr_thread_mutex_t *mutex) -{ - apr_allocator_mutex_set(allocator, mutex); -} -#endif /* APR_HAS_THREADS */ - diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c index aacd96e355d..96c87868aad 100644 --- a/threadproc/netware/signals.c +++ b/threadproc/netware/signals.c @@ -108,9 +108,3 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) return rv; } - -/* Deprecated */ -const char *apr_signal_get_description(int signum) -{ - return apr_signal_description_get(signum); -} diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 0b7dbc33321..2ff3007c06a 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -463,9 +463,3 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) } #endif - -/* Deprecated */ -const char *apr_signal_get_description(int signum) -{ - return apr_signal_description_get(signum); -} diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index e83e009fb45..a94ad3a2e11 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -92,9 +92,3 @@ const char *apr_signal_description_get(int signum) { return "unknown signal (not supported)"; } - -/* Deprecated */ -const char *apr_signal_get_description(int signum) -{ - return apr_signal_description_get(signum); -} From cad0379a321b5d0d1e215c52865c4b55ed6a2ff9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 3 Sep 2003 18:26:58 +0000 Subject: [PATCH 4582/7878] remove these interfaces: apr_compare_groups apr_compare_users apr_current_userid apr_explode_localtime apr_explode_time apr_filename_of_pathname apr_get_groupid apr_get_groupname apr_get_home_directory apr_get_userid apr_get_username apr_group_name_get apr_implode_gmt apr_lstat FNM_NOMATCH FNM_NOESCAPE FNM_PATHNAME FNM_PERIOD FNM_CASE_BLIND change the function args to this interface: apr_mmap_dup this function's args changed in a previous commit, so mention that in CHANGES apr_socket_create git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64607 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 24 ++++++++++++++++++++++++ file_io/netware/filestat.c | 9 --------- file_io/os2/filestat.c | 8 -------- file_io/unix/dir.c | 2 +- file_io/unix/filestat.c | 7 ------- file_io/win32/filepath.c | 4 ++-- file_io/win32/filestat.c | 6 ------ include/apr_file_info.h | 14 -------------- include/apr_fnmatch.h | 6 ------ include/apr_general.h | 6 ------ include/apr_lib.h | 3 --- include/apr_mmap.h | 9 +-------- include/apr_time.h | 13 ------------- include/apr_user.h | 37 ------------------------------------- mmap/unix/mmap.c | 3 +-- mmap/win32/mmap.c | 3 +-- strings/apr_cpystrn.c | 6 ------ time/unix/time.c | 20 -------------------- time/win32/time.c | 24 ------------------------ user/netware/groupinfo.c | 19 ------------------- user/netware/userinfo.c | 28 ---------------------------- user/unix/groupinfo.c | 19 ------------------- user/unix/userinfo.c | 31 ------------------------------- user/win32/groupinfo.c | 24 ------------------------ user/win32/userinfo.c | 35 ----------------------------------- 25 files changed, 30 insertions(+), 330 deletions(-) diff --git a/CHANGES b/CHANGES index 4a0bc2de1d1..0f1b46a9161 100644 --- a/CHANGES +++ b/CHANGES @@ -9,9 +9,23 @@ Changes with APR 1.0 apr_allocator_set_mutex -> apr_allocator_mutex_set apr_allocator_set_owner -> apr_allocator_owner_set apr_bind -> apr_socket_bind + apr_compare_groups -> apr_gid_compare + apr_compare_users -> apr_uid_compare apr_connect -> apr_socket_connect + apr_current_userid -> apr_uid_current + apr_explode_localtime -> apr_time_exp_lt + apr_explode_time -> apr_time_exp_tz + apr_filename_of_pathname -> apr_filepath_name_get apr_getsocketopt -> apr_socket_opt_get + apr_get_groupid -> apr_gid_get + apr_get_groupname -> apr_gid_name_get + apr_get_home_directory -> apr_uid_homepath_get + apr_get_userid -> apr_uid_get + apr_get_username -> apr_uid_name_get + apr_group_name_get -> apr_gid_name_get + apr_implode_gmt -> apr_time_exp_gmt_get apr_listen -> apr_socket_listen + apr_lstat -> apr_stat apr_pool_get_abort -> apr_pool_abort_get apr_pool_get_parent -> apr_pool_parent_get apr_pool_set_abort -> apr_pool_abort_set @@ -28,8 +42,18 @@ Changes with APR 1.0 apr_socket_create_ex -> apr_socket_create apr_socket_set_inherit -> apr_socket_inherit_set apr_socket_unset_inherit -> apr_socket_inherit_unset + FNM_NOMATCH -> APR_FNM_NOMATCH + FNM_NOESCAPE -> APR_FNM_NOESCAPE + FNM_PATHNAME -> APR_FNM_PATHNAME + FNM_PERIOD -> APR_FNM_PERIOD + FNM_CASE_BLIND -> APR_FNM_CASE_BLIND MAX_SECONDS_TO_LINGER -> APR_MAX_SECONDS_TO_LINGER + The following interfaces have function argument changes: + + apr_mmap_dup + apr_socket_create + Changes with APR 0.9.4 *) Work around a bug in Darwin when calling getnameinfo() on IPv4-mapped diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index d02c77a8469..4b7d3f14dd6 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -383,15 +383,6 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, } } -/* Perhaps this becomes nothing but a macro? - */ -APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *pool) -{ - return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, pool); -} - - APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, apr_time_t mtime, apr_pool_t *pool) diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index f1c77ce36aa..5da100f83e9 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -205,14 +205,6 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, -APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) -{ - return apr_stat(finfo, fname, wanted, cont); -} - - - APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, apr_fileattrs_t attr_mask, diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index d8eafee55d2..4911974880a 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -244,7 +244,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if ((fspec[off - 1] != '/') && (off + 1 < sizeof(fspec))) fspec[off++] = '/'; apr_cpystrn(fspec + off, thedir->entry->d_name, sizeof(fspec) - off); - ret = apr_lstat(finfo, fspec, wanted, thedir->pool); + ret = apr_stat(finfo, fspec, APR_FINFO_LINK | wanted, thedir->pool); /* We passed a stack name that will disappear */ finfo->fname = NULL; } diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 54784ddaa0a..4b41e9b32b5 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -313,11 +313,4 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, } } -/* Perhaps this becomes nothing but a macro? - */ -APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *pool) -{ - return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, pool); -} diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index e72504ece7d..f0bc5740a31 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -874,8 +874,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } /* Null term for stat! */ path[keptlen + seglen] = '\0'; - if ((rv = apr_lstat(&finfo, path, - APR_FINFO_TYPE | APR_FINFO_NAME, p)) + if ((rv = apr_stat(&finfo, path, + APR_FINFO_LINK | APR_FINFO_TYPE | APR_FINFO_NAME, p)) == APR_SUCCESS) { apr_size_t namelen = strlen(finfo.name); diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 56217c70df1..812ff24c107 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -686,12 +686,6 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *pool) -{ - return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, pool); -} - APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, apr_fileattrs_t attr_mask, diff --git a/include/apr_file_info.h b/include/apr_file_info.h index a8914fa070f..e14fe0f6fbd 100644 --- a/include/apr_file_info.h +++ b/include/apr_file_info.h @@ -249,20 +249,6 @@ struct apr_finfo_t { APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *cont); -/** - * get the specified file's stats. The file is specified by filename, - * instead of using a pre-opened file. If the file is a symlink, this function - * will get the stats for the symlink not the file the symlink refers to. - * @param finfo Where to store the information about the file, which is - * never touched if the call fails. - * @param fname The name of the file to stat. - * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values - * @param cont the pool to use to allocate the new file. - * @deprecated This function is depreciated, it's equivilant to calling apr_stat with - * the wanted flag value APR_FINFO_LINK - */ -APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont); /** @} */ /** * @defgroup apr_dir Directory Manipulation Functions diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index 8be40fc82e0..04a3597d317 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -63,12 +63,6 @@ extern "C" { * @remark This flag is an Apache addition */ -#define FNM_NOMATCH APR_FNM_NOMATCH /**< @deprecated @see APR_FNM_NOMATCH */ -#define FNM_NOESCAPE APR_FNM_NOESCAPE /**< @deprecated @see APR_FNM_NOESCAPE */ -#define FNM_PATHNAME APR_FNM_PATHNAME /**< @deprecated @see APR_FNM_PATHNAME */ -#define FNM_PERIOD APR_FNM_PERIOD /**< @deprecated @see APR_FNM_PERIOD */ -#define FNM_CASE_BLIND APR_FNM_CASE_BLIND /**< @deprecated @see APR_FNM_CASE_BLIND */ - /** * Try to match the string to the given pattern, return APR_SUCCESS if * match, else return APR_FNM_NOMATCH. diff --git a/include/apr_general.h b/include/apr_general.h index 0881757252c..72ed83cf23c 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -147,12 +147,6 @@ typedef int apr_signum_t; #define APR_OFFSETOF(s_type,field) APR_OFFSET(s_type*,field) #endif -/** @deprecated @see APR_OFFSET */ -#define APR_XtOffset APR_OFFSET - -/** @deprecated @see APR_OFFSETOF */ -#define APR_XtOffsetOf APR_OFFSETOF - #ifndef DOXYGEN /* A couple of prototypes for functions in case some platform doesn't diff --git a/include/apr_lib.h b/include/apr_lib.h index 90fd6e56454..feac95ca86d 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -121,9 +121,6 @@ struct apr_vformatter_buff_t { */ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); -/** @deprecated @see apr_filepath_name_get */ -APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname); - /** * apr_killpg * Small utility macros to make things easier to read. Not usually a diff --git a/include/apr_mmap.h b/include/apr_mmap.h index f6255d0ae3e..d6deccf3127 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -118,9 +118,6 @@ struct apr_mmap_t { void *mm; /** The amount of data in the mmap */ apr_size_t size; - /** @deprecated this field is no longer used and will be removed - * in APR 1.0 */ - int unused; /** ring of apr_mmap_t's that reference the same * mmap'ed region; acts in place of a reference count */ APR_RING_ENTRY(apr_mmap_t) link; @@ -181,13 +178,10 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap, * @param new_mmap The structure to duplicate into. * @param old_mmap The mmap to duplicate. * @param p The pool to use for new_mmap. - * @param transfer_ownership DEPRECATED: this param is now ignored - * and should be removed prior to APR 1.0 */ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, apr_mmap_t *old_mmap, - apr_pool_t *p, - int transfer_ownership); + apr_pool_t *p); #if defined(DOXYGEN) /** @@ -195,7 +189,6 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, * @param new_mmap The structure to duplicate into. * @param old_mmap The file to transfer. * @param p The pool to use for new_mmap. - * @deprecated Just use apr_mmap_dup(). The transfer_ownership flag will * go away soon anyway. */ APR_DECLARE(apr_status_t) apr_mmap_setaside(apr_mmap_t **new_mmap, diff --git a/include/apr_time.h b/include/apr_time.h index 60ae2de866f..44ff6759777 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -174,11 +174,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, apr_time_t input, apr_int32_t offs); -/** @deprecated @see apr_time_exp_tz */ -APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, - apr_time_t input, - apr_int32_t offs); - /** * convert a time to its human readable components in GMT timezone * @param result the exploded time @@ -195,10 +190,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, apr_time_t input); -/** @deprecated @see apr_time_exp_lt */ -APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, - apr_time_t input); - /** * Convert time value from human readable format to a numeric apr_time_t * e.g. elapsed usec since epoch @@ -217,10 +208,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *result, APR_DECLARE(apr_status_t) apr_time_exp_gmt_get(apr_time_t *result, apr_time_exp_t *input); -/** @deprecated @see apr_time_exp_gmt_get */ -APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *result, - apr_time_exp_t *input); - /** * Sleep for the specified number of micro-seconds. * @param t desired amount of time to sleep. diff --git a/include/apr_user.h b/include/apr_user.h index 4b70c5c2437..d8027662dda 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -105,10 +105,6 @@ APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *userid, apr_gid_t *groupid, apr_pool_t *p); -/** @deprecated @see apr_uid_current */ -APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *userid, - apr_gid_t *groupid, - apr_pool_t *p); /** * Get the user name for a specified userid * @param username Pointer to new string containing user name (on output) @@ -119,9 +115,6 @@ APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *userid, APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, apr_pool_t *p); -/** @deprecated @see apr_uid_name_get */ -APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, - apr_pool_t *p); /** * Get the userid (and groupid) for the specified username * @param userid Returns the user id @@ -133,10 +126,6 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *userid, apr_gid_t *groupid, const char *username, apr_pool_t *p); -/** @deprecated @see apr_uid_get */ -APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *userid, apr_gid_t *groupid, - const char *username, apr_pool_t *p); - /** * Get the home directory for the named user * @param dirname Pointer to new string containing directory name (on output) @@ -148,11 +137,6 @@ APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, const char *username, apr_pool_t *p); -/** @deprecated @see apr_uid_homepath_get */ -APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, - const char *username, - apr_pool_t *p); - /** * Compare two user identifiers for equality. * @param left One uid to test @@ -163,13 +147,8 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, */ #if defined(WIN32) APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right); - -/** @deprecated @see apr_uid_compare */ -APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right); #else #define apr_uid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) -/** @deprecated @see apr_uid_compare */ -#define apr_compare_users(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) #endif /** @@ -182,14 +161,6 @@ APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right); APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p); -/** @deprecated @see apr_gid_name_get */ -APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, - apr_gid_t groupid, apr_pool_t *p); - -/** @deprecated @see apr_gid_name_get */ -APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, - apr_gid_t groupid, apr_pool_t *p); - /** * Get the groupid for a specified group name * @param groupid Pointer to the group id (on output) @@ -200,10 +171,6 @@ APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, const char *groupname, apr_pool_t *p); -/** @deprecated @see apr_gid_get */ -APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, - const char *groupname, apr_pool_t *p); - /** * Compare two group identifiers for equality. * @param left One gid to test @@ -214,12 +181,8 @@ APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, */ #if defined(WIN32) APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right); -/** @deprecated @see apr_gid_compare */ -APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right); #else #define apr_gid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) -/** @deprecated @see apr_gid_compare */ -#define apr_compare_groups(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) #endif #endif /* ! APR_HAS_USER */ diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 28f0f8b3b88..249b8c26bd6 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -182,8 +182,7 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, apr_mmap_t *old_mmap, - apr_pool_t *p, - int transfer_ownership) + apr_pool_t *p) { *new_mmap = (apr_mmap_t *)apr_pmemdup(p, old_mmap, sizeof(apr_mmap_t)); (*new_mmap)->cntxt = p; diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c index b8380d5cb19..1e34ba259b5 100644 --- a/mmap/win32/mmap.c +++ b/mmap/win32/mmap.c @@ -180,8 +180,7 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, apr_mmap_t *old_mmap, - apr_pool_t *p, - int transfer_ownership) + apr_pool_t *p) { *new_mmap = (apr_mmap_t *)apr_pmemdup(p, old_mmap, sizeof(apr_mmap_t)); (*new_mmap)->cntxt = p; diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index 90acf366629..dc82b2807d8 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -250,12 +250,6 @@ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname) return s ? ++s : pathname; } -/* deprecated */ -APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname) -{ - return apr_filepath_name_get(pathname); -} - /* length of dest assumed >= length of src * collapse in place (src == dest) is legal. * returns terminating null ptr to dest string. diff --git a/time/unix/time.c b/time/unix/time.c index 949b9ff2d3f..d2e55f0a7d9 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -371,24 +371,4 @@ APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p) return; } -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, - apr_time_t input, - apr_int32_t offs) -{ - return apr_time_exp_tz(result, input, offs); -} - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, - apr_time_t input) -{ - return apr_time_exp_lt(result, input); -} - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, apr_time_exp_t *xt) -{ - return apr_time_exp_gmt_get(t, xt); -} diff --git a/time/win32/time.c b/time/win32/time.c index b5beb4c71ed..3652828781e 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -368,27 +368,3 @@ APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p) apr_pool_cleanup_null); } } - - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, - apr_time_t input, - apr_int32_t offs) -{ - return apr_time_exp_tz(result, input, offs); -} - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, - apr_time_t input) -{ - return apr_time_exp_lt(result, input); -} - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, - apr_time_exp_t *xt) -{ - return apr_time_exp_gmt_get(t, xt); -} - diff --git a/user/netware/groupinfo.c b/user/netware/groupinfo.c index aac076ed54e..d2e45140237 100644 --- a/user/netware/groupinfo.c +++ b/user/netware/groupinfo.c @@ -77,22 +77,3 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, { return APR_ENOTIMPL; } - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, - apr_gid_t groupid, apr_pool_t *p) -{ - return apr_gid_name_get(groupname, groupid, p); -} - -APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, - apr_gid_t groupid, apr_pool_t *p) -{ - return apr_gid_name_get(groupname, groupid, p); -} - -APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, - const char *groupname, apr_pool_t *p) -{ - return apr_gid_get(groupid, groupname, p); -} diff --git a/user/netware/userinfo.c b/user/netware/userinfo.c index 63654f3ac53..fd0c65a032d 100644 --- a/user/netware/userinfo.c +++ b/user/netware/userinfo.c @@ -106,31 +106,3 @@ APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, return APR_ENOTIMPL; } -/* deprecated */ -APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, - const char *username, - apr_pool_t *p) -{ - return apr_uid_homepath_get(dirname, username, p); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, - const char *username, apr_pool_t *p) -{ - return apr_uid_get(uid, gid, username, p); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, - apr_gid_t *gid, - apr_pool_t *p) -{ - return apr_uid_current(uid, gid, p); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) -{ - return apr_uid_name_get(username, userid, p); -} diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index 852cc18e2cf..247cd6491dd 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -107,22 +107,3 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, #endif return APR_SUCCESS; } - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, - apr_gid_t groupid, apr_pool_t *p) -{ - return apr_gid_name_get(groupname, groupid, p); -} - -APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, - apr_gid_t groupid, apr_pool_t *p) -{ - return apr_gid_name_get(groupname, groupid, p); -} - -APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, - const char *groupname, apr_pool_t *p) -{ - return apr_gid_get(groupid, groupname, p); -} diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 1443fb27d76..7b0c3440ff1 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -162,34 +162,3 @@ APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, *username = apr_pstrdup(p, pw->pw_name); return APR_SUCCESS; } - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, - const char *username, - apr_pool_t *p) -{ - return apr_uid_homepath_get(dirname, username, p); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, - const char *username, apr_pool_t *p) -{ - return apr_uid_get(uid, gid, username, p); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, - apr_gid_t *gid, - apr_pool_t *p) -{ - return apr_uid_current(uid, gid, p); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, - apr_pool_t *p) -{ - return apr_uid_name_get(username, userid, p); -} - diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index dcddceacc6f..bfd38b63e3e 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -136,27 +136,3 @@ APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right) #endif return APR_SUCCESS; } - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, - apr_gid_t groupid, apr_pool_t *p) -{ - return apr_gid_name_get(groupname, groupid, p); -} - -APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, - apr_gid_t groupid, apr_pool_t *p) -{ - return apr_gid_name_get(groupname, groupid, p); -} - -APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *gid, - const char *groupname, apr_pool_t *p) -{ - return apr_gid_get(gid, groupname, p); -} - -APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right) -{ - return apr_gid_compare(left, right); -} diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index 84df21322b9..e6977b86378 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -317,38 +317,3 @@ APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right) return APR_SUCCESS; } -/* deprecated */ -APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, - const char *username, - apr_pool_t *p) -{ - return apr_uid_homepath_get(dirname, username, p); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, - const char *username, apr_pool_t *p) -{ - return apr_uid_get(uid, gid, username, p); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, - apr_gid_t *gid, - apr_pool_t *p) -{ - return apr_uid_current(uid, gid, p); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right) -{ - return apr_uid_compare(left, right); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, - apr_pool_t *p) -{ - return apr_uid_name_get(username, userid, p); -} From 5b5a119b9ab5e56bf14dfdac634930c1dd4e52c7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 3 Sep 2003 18:37:38 +0000 Subject: [PATCH 4583/7878] axe these deprecated functions: apr_is_fnmatch apr_file_set_inherit apr_file_unset_inherit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64608 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/apr_file_io.h | 6 ------ include/apr_fnmatch.h | 3 --- strings/apr_fnmatch.c | 6 ------ 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index 0f1b46a9161..0854d9960c2 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,8 @@ Changes with APR 1.0 apr_explode_localtime -> apr_time_exp_lt apr_explode_time -> apr_time_exp_tz apr_filename_of_pathname -> apr_filepath_name_get + apr_file_set_inherit -> apr_file_inherit_set + apr_file_unset_inherit -> apr_file_inherit_unset apr_getsocketopt -> apr_socket_opt_get apr_get_groupid -> apr_gid_get apr_get_groupname -> apr_gid_name_get @@ -24,6 +26,7 @@ Changes with APR 1.0 apr_get_username -> apr_uid_name_get apr_group_name_get -> apr_gid_name_get apr_implode_gmt -> apr_time_exp_gmt_get + apr_is_fnmatch -> apr_fnmatch_test apr_listen -> apr_socket_listen apr_lstat -> apr_stat apr_pool_get_abort -> apr_pool_abort_get diff --git a/include/apr_file_io.h b/include/apr_file_io.h index a33a5dab06d..e21d7c97752 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -734,17 +734,11 @@ APR_POOL_DECLARE_ACCESSOR(file); */ APR_DECLARE_INHERIT_SET(file); -/** @deprecated @see apr_file_inherit_set */ -APR_DECLARE(void) apr_file_set_inherit(apr_file_t *file); - /** * Unset a file from being inherited by child processes. */ APR_DECLARE_INHERIT_UNSET(file); -/** @deprecated @see apr_file_inherit_unset */ -APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); - /** * Open a temporary file * @param fp The apr file to use as a temporary file. diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index 04a3597d317..74a6572e589 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -87,9 +87,6 @@ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, */ APR_DECLARE(int) apr_fnmatch_test(const char *pattern); -/** @deprecated @see apr_fnmatch_test */ -APR_DECLARE(int) apr_is_fnmatch(const char *pattern); - /** @} */ #ifdef __cplusplus diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index 78b1cb511ed..08e2b9bc748 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -241,9 +241,3 @@ APR_DECLARE(int) apr_fnmatch_test(const char *pattern) } return 0; } - -/* Deprecated */ -APR_DECLARE(int) apr_is_fnmatch(const char *pattern) -{ - return apr_fnmatch_test(pattern); -} From 75a8472da49d1a90dbff8c2f02345d938a1bf1e6 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 3 Sep 2003 19:53:28 +0000 Subject: [PATCH 4584/7878] axe this entirely git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64609 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_mmap.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/include/apr_mmap.h b/include/apr_mmap.h index d6deccf3127..df380705dae 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -183,21 +183,6 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, apr_mmap_t *old_mmap, apr_pool_t *p); -#if defined(DOXYGEN) -/** - * Transfer the specified MMAP to a different pool - * @param new_mmap The structure to duplicate into. - * @param old_mmap The file to transfer. - * @param p The pool to use for new_mmap. - * go away soon anyway. - */ -APR_DECLARE(apr_status_t) apr_mmap_setaside(apr_mmap_t **new_mmap, - apr_mmap_t *old_mmap, - apr_pool_t *p); -#else -#define apr_mmap_setaside(new_mmap, old_mmap, p) apr_mmap_dup(new_mmap, old_mmap, p, 1) -#endif /* DOXYGEN */ - /** * Remove a mmap'ed. * @param mm The mmap'ed file. From e56cf5ac58551e0b0f30c25aaee9f9be93a2db18 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 5 Sep 2003 16:44:09 +0000 Subject: [PATCH 4585/7878] remove apr_compat.h as part of the transition to the 1.0 API git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64610 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 + include/apr_compat.h | 273 ------------------------------------------- 2 files changed, 4 insertions(+), 273 deletions(-) delete mode 100644 include/apr_compat.h diff --git a/CHANGES b/CHANGES index 0854d9960c2..3046a088b0f 100644 --- a/CHANGES +++ b/CHANGES @@ -57,6 +57,10 @@ Changes with APR 1.0 apr_mmap_dup apr_socket_create + The following header files have been removed: + + apr_compat.h + Changes with APR 0.9.4 *) Work around a bug in Darwin when calling getnameinfo() on IPv4-mapped diff --git a/include/apr_compat.h b/include/apr_compat.h deleted file mode 100644 index e51b79cf140..00000000000 --- a/include/apr_compat.h +++ /dev/null @@ -1,273 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#ifndef APR_COMPAT_H -#define APR_COMPAT_H - - /** - * @file apr_compat.h - * @brief APR Legacy Apache 1.3 Compatibility - * @deprecated These defines are only present for historical purposes - */ - -/** - * @defgroup apr_compat APR Legacy Apache 1.3 Compatibility - * @ingroup APR - * @{ - */ - -/* redefine 1.3.x symbols to those that now live in libapr */ - -/** @see APR_INLINE */ -#define ap_inline APR_INLINE - -/** @deprecated @see apr_md5_ctx_t */ -#define ap_md5_ctx_t apr_md5_ctx_t -/** @deprecated @see apr_md5_encode */ -#define ap_MD5Encode apr_md5_encode -/** @deprecated @see apr_md5_final */ -#define ap_MD5Final apr_md5_final -/** @deprecated @see apr_md5_init */ -#define ap_MD5Init apr_md5_init -/** @deprecated @see apr_md5_update */ -#define ap_MD5Update apr_md5_update -/** @deprecated @see apr_array_append */ -#define ap_append_arrays apr_array_append -/** @deprecated @see apr_array_cat */ -#define ap_array_cat apr_array_cat -/** @deprecated @see apr_array_header_t */ -#define ap_array_header_t apr_array_header_t -/** @deprecated @see apr_array_pstrcat */ -#define ap_array_pstrcat apr_array_pstrcat -/** @deprecated @see apr_pool_free_blocks_num_bytes */ -#define ap_bytes_in_free_blocks apr_pool_free_blocks_num_bytes -/** @deprecated @see apr_pool_num_bytes */ -#define ap_bytes_in_pool apr_pool_num_bytes -/** @deprecated @see apr_check_file_time */ -#define ap_check_file_time apr_check_file_time -/** @deprecated @see apr_filetype_e */ -#define ap_filetype_e apr_filetype_e -/** @deprecated @see apr_pool_cleanup_for_exec */ -#define ap_cleanup_for_exec apr_pool_cleanup_for_exec -/** @deprecated @see apr_pool_clear */ -#define ap_clear_pool apr_pool_clear -/** @deprecated @see apr_table_clear */ -#define ap_clear_table apr_table_clear -/** @deprecated @see apr_array_copy */ -#define ap_copy_array apr_array_copy -/** @deprecated @see apr_array_copy_hdr */ -#define ap_copy_array_hdr apr_array_copy_hdr -/** @deprecated @see apr_table_copy */ -#define ap_copy_table apr_table_copy -/** @deprecated @see apr_cpystrn */ -#define ap_cpystrn apr_cpystrn -/** @deprecated @see apr_day_snames */ -#define ap_day_snames apr_day_snames -/** @deprecated @see apr_pool_destroy */ -#define ap_destroy_pool apr_pool_destroy -/** @deprecated @see apr_time_exp_t */ -#define ap_exploded_time_t apr_time_exp_t -/** @deprecated @see apr_fnmatch */ -#define ap_fnmatch apr_fnmatch -/** @deprecated @see apr_getopt */ -#define ap_getopt apr_getopt -/** @deprecated @see apr_inet_addr */ -#define ap_inet_addr apr_inet_addr -/** @deprecated @see apr_pool_alloc_init */ -#define ap_init_alloc apr_pool_alloc_init -/** @deprecated @see apr_is_empty_table */ -#define ap_is_empty_table apr_is_empty_table -/** @deprecated @see apr_fnmatch_test */ -#define ap_is_fnmatch apr_fnmatch_test -/** @deprecated @see apr_pool_cleanup_kill */ -#define ap_kill_cleanup apr_pool_cleanup_kill -/** @deprecated @see apr_array_make */ -#define ap_make_array apr_array_make -/** @deprecated @see apr_pool_sub_make */ -#define ap_make_sub_pool apr_pool_sub_make -/** @deprecated @see apr_table_make */ -#define ap_make_table apr_table_make -/** @deprecated @see apr_month_snames */ -#define ap_month_snames apr_month_snames -/** @deprecated @see apr_pool_note_subprocess*/ -#define ap_note_subprocess apr_pool_note_subprocess -/** @deprecated @see apr_pool_cleanup_null */ -#define ap_null_cleanup apr_pool_cleanup_null -/** @deprecated @see apr_filepath_merge */ -#define ap_os_canonical_filename apr_filepath_merge -/** @deprecated @see apr_filepath_merge */ -#define ap_os_case_canonical_filename apr_filepath_merge -/** @deprecated @see apr_dso_load */ -#define ap_os_dso_load apr_dso_load -/** @deprecated @see apr_dso_unload */ -#define ap_os_dso_unload apr_dso_unload -/** @deprecated @see apr_dso_sym */ -#define ap_os_dso_sym apr_dso_sym -/** @deprecated @see apr_dso_error */ -#define ap_os_dso_error apr_dso_error -/** @deprecated @see apr_filepath_merge - * @warning apr_filepath_merge rejects invalid filenames */ -#define ap_os_is_filename_valid apr_filepath_merge -/** @deprecated @see apr_proc_kill */ -#define ap_os_kill apr_proc_kill -/** @deprecated @see apr_filepath_merge */ -#define ap_os_systemcase_canonical_filename apr_filepath_merge -/** @deprecated @see apr_table_overlap */ -#define ap_overlap_tables apr_table_overlap -/** @deprecated @see apr_table_overlay */ -#define ap_overlay_tables apr_table_overlay -/** @deprecated @see apr_palloc */ -#define ap_palloc apr_palloc -/** @deprecated @see apr_pcalloc */ -#define ap_pcalloc apr_pcalloc -/** @deprecated @see apr_pool_join */ -#define ap_pool_join apr_pool_join -/** @deprecated @see apr_psprintf */ -#define ap_psprintf apr_psprintf -/** @deprecated @see apr_pstrcat */ -#define ap_pstrcat apr_pstrcat -/** @deprecated @see apr_pstrdup */ -#define ap_pstrdup apr_pstrdup -/** @deprecated @see apr_pstrndup */ -#define ap_pstrndup apr_pstrndup -/** @deprecated @see apr_array_push */ -#define ap_push_array apr_array_push -/** @deprecated @see apr_pvsprintf */ -#define ap_pvsprintf apr_pvsprintf -/** @deprecated @see apr_pool_cleanup_register */ -#define ap_register_cleanup apr_pool_cleanup_register -/** @deprecated @see apr_proc_other_child_register */ -#define ap_register_other_child apr_proc_other_child_register -/** @deprecated @see apr_pool_cleanup_run */ -#define ap_run_cleanup apr_pool_cleanup_run -/** @deprecated @see apr_signal */ -#define ap_signal apr_signal -/** @deprecated @see apr_snprintf */ -#define ap_snprintf apr_snprintf -/** @deprecated @see apr_table_add */ -#define ap_table_add apr_table_add -/** @deprecated @see apr_table_addn */ -#define ap_table_addn apr_table_addn -/** @deprecated @see apr_table_do */ -#define ap_table_do apr_table_do -/** @deprecated @see apr_table_elts */ -#define ap_table_elts apr_table_elts -/** @deprecated @see apr_table_get */ -#define ap_table_get apr_table_get -/** @deprecated @see apr_table_merge */ -#define ap_table_merge apr_table_merge -/** @deprecated @see apr_table_mergen */ -#define ap_table_mergen apr_table_mergen -/** @deprecated @see apr_table_set */ -#define ap_table_set apr_table_set -/** @deprecated @see apr_table_setn */ -#define ap_table_setn apr_table_setn -/** @deprecated @see apr_table_unset */ -#define ap_table_unset apr_table_unset -/** @deprecated @see apr_proc_other_child_unregister */ -#define ap_unregister_other_child apr_proc_other_child_unregister -/** @deprecated @see apr_password_validate */ -#define ap_validate_password apr_password_validate -/** @deprecated @see apr_vformatter */ -#define ap_vformatter apr_vformatter -/** @deprecated @see apr_vsnprintf */ -#define ap_vsnprintf apr_vsnprintf -/** @deprecated @see apr_wait_t */ -#define ap_wait_t apr_wait_t - -/** @deprecated @see apr_isalnum */ -#define ap_isalnum apr_isalnum -/** @deprecated @see apr_isalpha*/ -#define ap_isalpha apr_isalpha -/** @deprecated @see apr_iscntrl */ -#define ap_iscntrl apr_iscntrl -/** @deprecated @see apr_isdigit */ -#define ap_isdigit apr_isdigit -/** @deprecated @see apr_isgraph */ -#define ap_isgraph apr_isgraph -/** @deprecated @see apr_islower */ -#define ap_islower apr_islower -/** @deprecated @see apr_isascii */ -#define ap_isascii apr_isascii -/** @deprecated @see apr_isprint */ -#define ap_isprint apr_isprint -/** @deprecated @see apr_ispunct */ -#define ap_ispunct apr_ispunct -/** @deprecated @see apr_isspace */ -#define ap_isspace apr_isspace -/** @deprecated @see apr_isupper */ -#define ap_isupper apr_isupper -/** @deprecated @see apr_isxdigit */ -#define ap_isxdigit apr_isxdigit -/** @deprecated @see apr_tolower */ -#define ap_tolower apr_tolower -/** @deprecated @see apr_toupper */ -#define ap_toupper apr_toupper - -/** @deprecated @see APR_USEC_PER_SEC */ -#define AP_USEC_PER_SEC APR_USEC_PER_SEC -/** @deprecated @see APR_RFC822_DATE_LEN */ -#define AP_RFC822_DATE_LEN APR_RFC822_DATE_LEN -/** @deprecated @see APR_OVERLAP_TABLES_MERGE */ -#define AP_OVERLAP_TABLES_MERGE APR_OVERLAP_TABLES_MERGE -/** @deprecated @see APR_OVERLAP_TABLES_SET */ -#define AP_OVERLAP_TABLES_SET APR_OVERLAP_TABLES_SET - -/** @} */ - -#endif /* APR_COMPAT_H */ From ab1021d4e818ccb3e944ea006ae259f6dc6abc62 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Sat, 6 Sep 2003 12:03:31 +0000 Subject: [PATCH 4586/7878] Pull apr_compat.h and apu_compat.h from the export list git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64611 13f79535-47bb-0310-9956-ffa450edef68 --- build/nw_export.inc | 2 -- 1 file changed, 2 deletions(-) diff --git a/build/nw_export.inc b/build/nw_export.inc index 731b8bc0bfe..2ac7ee8380c 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -12,7 +12,6 @@ /* Preprocess all of the standard APR headers. */ #include "apr_allocator.h" #include "apr_atomic.h" -#include "apr_compat.h" #include "apr_dso.h" #include "apr_env.h" #include "apr_errno.h" @@ -77,5 +76,4 @@ #include "apr_uuid.h" #include "apr_xlate.h" #include "apr_xml.h" -#include "apu_compat.h" #include "apu_want.h" From 5ce7b93834cfa7cde94c5cc11c1a6ad7c067794a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 8 Sep 2003 14:49:13 +0000 Subject: [PATCH 4587/7878] Several users (especially those building jk/ant) had observed that the APR 0.9 files didn't match on Win32 - they were explicitly trying to locate and bind to libapr-0.dll (to match unix libapr-0.so.) While binary compatibility prevented us from 'fixing' this discrepancy for our existing users - nothing prevents us from fixing this going forwards. This change allows us to locate APR 0.9 and 1.0 binaries and libraries in the same tree structure, as an added bonus. It would also allow the APR library to be installed in a common location, such as \windows\system32, without introducing conflicts between 0.9 and 1.0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64612 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ++-- build/apr_app.dsp | 4 ++-- build/libapr_app.dsp | 4 ++-- libapr.dsp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apr.dsp b/apr.dsp index b58c6f1b3f7..6f68981b020 100644 --- a/apr.dsp +++ b/apr.dsp @@ -49,7 +49,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo +# ADD LIB32 /nologo /out:"LibR\apr-1.lib" !ELSEIF "$(CFG)" == "apr - Win32 Debug" @@ -73,7 +73,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo +# ADD LIB32 /nologo /out:"LibD\apr-1.lib" !ENDIF diff --git a/build/apr_app.dsp b/build/apr_app.dsp index 91cb5bc7856..b0d88531a9b 100644 --- a/build/apr_app.dsp +++ b/build/apr_app.dsp @@ -49,7 +49,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo +# ADD LIB32 /nologo /out:"LibR\apr_app-1.lib" !ELSEIF "$(CFG)" == "apr_app - Win32 Debug" @@ -73,7 +73,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo +# ADD LIB32 /nologo /out:"LibD\apr_app-1.lib" !ENDIF diff --git a/build/libapr_app.dsp b/build/libapr_app.dsp index b1ccf7b7679..b780fc7dbe1 100644 --- a/build/libapr_app.dsp +++ b/build/libapr_app.dsp @@ -49,7 +49,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo +# ADD LIB32 /nologo /out:"Release\libapr_app-1.lib" !ELSEIF "$(CFG)" == "libapr_app - Win32 Debug" @@ -73,7 +73,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo +# ADD LIB32 /nologo /out:"Debug\libapr_app-1.lib" !ENDIF diff --git a/libapr.dsp b/libapr.dsp index 070f5ed5f63..8f278c9ac1c 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -53,7 +53,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386 /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386 /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386 /out:"Release/libapr-1.dll" /opt:ref !ELSEIF "$(CFG)" == "libapr - Win32 Debug" @@ -79,7 +79,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386 -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /debug /machine:I386 /out:"Debug/libapr-1.dll" !ENDIF From d8230eefa161111aa98196ebc23376bdd8e10c94 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 9 Sep 2003 18:37:12 +0000 Subject: [PATCH 4588/7878] work around a problem in current AIX getaddrinfo() it wasn't needed in previous releases of APR or Apache because we didn't call the resolver when hostname was NULL git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64613 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 765252b2e10..9f9bb85ed28 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -391,6 +391,16 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, /* getaddrinfo according to RFC 2553 must have either hostname * or servname non-NULL. */ +#ifdef _AIX + /* But current AIX getaddrinfo() doesn't like servname = "0"; + * the "1" won't hurt since we use the port parameter to fill + * in the returned socket addresses later + */ + if (!port) { + servname = "1"; + } + else +#endif servname = apr_itoa(p, port); } error = getaddrinfo(hostname, servname, &hints, &ai_list); From a7467ca1d9d5ef861fdd739d0461578911d01b3b Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 10 Sep 2003 09:18:59 +0000 Subject: [PATCH 4589/7878] Add a needed header file when we're using utime. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64616 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 4b41e9b32b5..86e3a639d50 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -58,6 +58,10 @@ #include "apr_strings.h" #include "apr_errno.h" +#ifdef HAVE_UTIME +#include +#endif + static apr_filetype_e filetype_from_mode(mode_t mode) { apr_filetype_e type; From 44ae76ada4bde6a3a4355aae50cd3bcff6cad094 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 11 Sep 2003 07:38:08 +0000 Subject: [PATCH 4590/7878] Fix copy-and-paste error - that should have been NI_NAMEREQD not NI_NUMERICHOST. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64617 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index f37e25c0dc8..f637c3db47c 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -187,7 +187,7 @@ void main(void) { error = getnameinfo((const struct sockaddr *)&sa, sizeof(sa), hbuf, sizeof(hbuf), NULL, 0, - NI_NUMERICHOST); + NI_NAMEREQD); if (error) { exit(1); } else { From b16318cd4d74841ce97b04f6f4f54501c345626a Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 13 Sep 2003 05:05:11 +0000 Subject: [PATCH 4591/7878] Faster code for apr_atomic_inc on x86 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64618 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 9f185e40297..c595cc11f6d 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -237,11 +237,10 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) (--last != 0); }) #define apr_atomic_inc(mem) \ -({ register apr_atomic_t last; \ - do { \ - last = *(mem); \ - } while (apr_atomic_cas((mem), last + 1, last) != last); \ - }) + asm volatile ("lock; incl %0" \ + : \ + : "m" (*(mem)) \ + : "memory"); #define apr_atomic_set(mem, val) (*(mem) = val) #define apr_atomic_read(mem) (*(mem)) From 214e9b4fe640b2bbca9b1443175c243c42e1afe7 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 14 Sep 2003 01:13:13 +0000 Subject: [PATCH 4592/7878] remove an extraneous semicolon after macro git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64619 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index c595cc11f6d..b98673b5b24 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -240,7 +240,7 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) asm volatile ("lock; incl %0" \ : \ : "m" (*(mem)) \ - : "memory"); + : "memory") #define apr_atomic_set(mem, val) (*(mem) = val) #define apr_atomic_read(mem) (*(mem)) From 88b9e07796a328a15d62fa9c8dd2d151e8b2bcee Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 14 Sep 2003 01:45:12 +0000 Subject: [PATCH 4593/7878] fix error message in add test git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64620 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/testatomic.c b/test/testatomic.c index bed3d93f810..024c9dd1555 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -68,6 +68,11 @@ #include #endif +static void foo(apr_atomic_t *bar, long xyzzy) +{ + apr_atomic_add(bar, xyzzy); +} + apr_pool_t *context; apr_atomic_t y; /* atomic locks */ @@ -143,7 +148,7 @@ static apr_status_t check_basic_atomics(volatile apr_atomic_t*p) printf("%-60s", "testing add"); apr_atomic_set(&y, 23); apr_atomic_add(&y, 4); - if (apr_atomic_read(&y) != 27) { + if ((oldval = apr_atomic_read(&y)) != 27) { fprintf(stderr, "Failed\nAtomic Add doesn't add up ;( expected 27 got %d\n", oldval); From 9fef075d3bbc540e1e09a7c24d08e8d33db91cff Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 14 Sep 2003 01:47:36 +0000 Subject: [PATCH 4594/7878] remove some debug code that leaked in to the last commit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64621 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index 024c9dd1555..4ad72dca41b 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -68,11 +68,6 @@ #include #endif -static void foo(apr_atomic_t *bar, long xyzzy) -{ - apr_atomic_add(bar, xyzzy); -} - apr_pool_t *context; apr_atomic_t y; /* atomic locks */ From a8a5081493eef8a2225695659e6e594d85644aac Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 14 Sep 2003 01:59:54 +0000 Subject: [PATCH 4595/7878] more efficient implementation of atomic add on x86 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64622 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index b98673b5b24..00dd9fac027 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -223,11 +223,10 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) prev;}) #define apr_atomic_add(mem, val) \ -({ register apr_atomic_t last; \ - do { \ - last = *(mem); \ - } while (apr_atomic_cas((mem), last + (val), last) != last); \ - }) + asm volatile ("lock; addl %1, %0" \ + : \ + : "m" (*(mem)), "r" (val) \ + : "memory") #define apr_atomic_dec(mem) \ ({ register apr_atomic_t last; \ From a9b53fa6f9bab99220096eb0ffe7a774efa115db Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 14 Sep 2003 02:53:50 +0000 Subject: [PATCH 4596/7878] run more loop iterations to better check for race conditions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64623 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testatomic.c b/test/testatomic.c index 4ad72dca41b..acc0be7e7eb 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -204,7 +204,7 @@ int value = 0; apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ #define NUM_THREADS 50 -#define NUM_ITERATIONS 20000 +#define NUM_ITERATIONS 200000 void * APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data) { int i; From ae5d3d2701e78ff7083bf98975a646e51d429aa6 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 14 Sep 2003 02:56:52 +0000 Subject: [PATCH 4597/7878] more efficient implementation of atomic_dec for x86 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64624 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 00dd9fac027..28733afbdf0 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -229,11 +229,15 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) : "memory") #define apr_atomic_dec(mem) \ -({ register apr_atomic_t last; \ - do { \ - last = *(mem); \ - } while (apr_atomic_cas((mem), last - 1, last) != last); \ - (--last != 0); }) +({ int prev; \ + asm volatile ("mov $0, %%eax;\n\t" \ + "lock; decl %1;\n\t" \ + "setnz %%al;\n\t" \ + "mov %%eax, %0" \ + : "=r" (prev) \ + : "m" (*(mem)) \ + : "memory", "%eax"); \ + prev;}) #define apr_atomic_inc(mem) \ asm volatile ("lock; incl %0" \ From 3bd499001791490cbfa415bb3ced7ad9f659fe74 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 17 Sep 2003 14:19:16 +0000 Subject: [PATCH 4598/7878] Move the 'sa' field to the end of the structure, to ensure binary compatibility between a libapr built with IPv6 support and one built without. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64625 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index e48f7309170..3cf8d4d5c03 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -239,15 +239,6 @@ struct apr_sockaddr_t { apr_port_t port; /** The family */ apr_int32_t family; - /** Union of either IPv4 or IPv6 sockaddr. */ - union { - /** IPv4 sockaddr structure */ - struct sockaddr_in sin; -#if APR_HAVE_IPV6 - /** IPv6 sockaddr structure */ - struct sockaddr_in6 sin6; -#endif - } sa; /** How big is the sockaddr we're using? */ apr_socklen_t salen; /** How big is the ip address structure we're using? */ @@ -261,6 +252,15 @@ struct apr_sockaddr_t { /** If multiple addresses were found by apr_sockaddr_info_get(), this * points to a representation of the next address. */ apr_sockaddr_t *next; + /** Union of either IPv4 or IPv6 sockaddr. */ + union { + /** IPv4 sockaddr structure */ + struct sockaddr_in sin; +#if APR_HAVE_IPV6 + /** IPv6 sockaddr structure */ + struct sockaddr_in6 sin6; +#endif + } sa; }; #if APR_HAS_SENDFILE From d0c6de943c7c59076ad638b6212e945d8586aa49 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Sep 2003 18:46:23 +0000 Subject: [PATCH 4599/7878] Yow! Another apr-1.lib required modification to get the test suite working once again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64626 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.win b/test/Makefile.win index 6ef18cdf7b7..c9c6eb96a5c 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -24,7 +24,7 @@ PROGRAMS = \ TARGETS = $(PROGRAMS) -LOCAL_LIBS=..\LibD\apr.lib +LOCAL_LIBS=..\LibD\apr-1.lib ALL_LIBS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib CLEAN_TARGETS = mod_test.lib mod_test.exp From 1592978239f47b561d802e319b67443540c6d770 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Sep 2003 19:05:43 +0000 Subject: [PATCH 4600/7878] Preserve leading '../' segments as when merging to an empty and unrooted path - fixes a bug observed in SVN with Win32/Netware/OS2. Submitted by: Mike Pilato , William Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64627 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++++-- file_io/win32/filepath.c | 29 +++++++++++++++++------------ test/testnames.c | 13 +++++++++++++ 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/CHANGES b/CHANGES index 3046a088b0f..d5b0e4d86a9 100644 --- a/CHANGES +++ b/CHANGES @@ -63,12 +63,16 @@ Changes with APR 1.0 Changes with APR 0.9.4 + *) Preserve leading '../' segments as when merging to an empty and + unrooted path - fixes a bug observed in SVN with Win32/Netware/OS2. + [Mike Pilato , William Rowe] + *) Work around a bug in Darwin when calling getnameinfo() on IPv4-mapped IPv6-addresses. [Colm MacCárthaigh , Jeff Trawick, Justin Erenkrantz] *) Add apr_temp_dir_get() for getting the most suitable temp directory - [CMike Pilato , Thom May] + [Mike Pilato , Thom May] *) Modify apr_sockaddr_info_get to call the resolver when we do not have a hostname. Also, fix bugs in the getaddrinfo() @@ -1462,7 +1466,7 @@ Changes with APR 0.9.0 [Mike Pilato ] *) Add apr_open_stdout. This mirrors apr_open_stderr, except it works - on stdout. [cmpilato@collab.net] + on stdout. [Mike Pilato ] *) Fix bug in file_io/unix/dir.c. There is no such thing as a dirent, it must be a struct dirent. diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index f0bc5740a31..f44f619ac24 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -706,8 +706,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, return APR_EBADPATH; #endif - /* backpath (../) */ - if (pathlen <= rootlen) + /* backpath (../) when an absolute path is given */ + if (rootlen && (pathlen <= rootlen)) { /* Attempt to move above root. Always die if the * APR_FILEPATH_SECUREROOTTEST flag is specified. @@ -736,9 +736,14 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, */ if (pathlen + 3 >= sizeof(path)) return APR_ENAMETOOLONG; - memcpy(path + pathlen, ((flags && APR_FILEPATH_NATIVE) + memcpy(path + pathlen, ((flags & APR_FILEPATH_NATIVE) ? "..\\" : "../"), 3); pathlen += 3; + /* The 'root' part of this path now includes the ../ path, + * because that backpath will not be parsed by the truename + * code below. + */ + keptlen = pathlen; } else { @@ -748,16 +753,16 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, --pathlen; } while (pathlen && path[pathlen - 1] != '/' && path[pathlen - 1] != '\\'); - } - /* Now test if we are above where we started and back up - * the keptlen offset to reflect the added/altered path. - */ - if (pathlen < keptlen) - { - if (flags & APR_FILEPATH_SECUREROOTTEST) - return APR_EABOVEROOT; - keptlen = pathlen; + /* Now test if we are above where we started and back up + * the keptlen offset to reflect the added/altered path. + */ + if (pathlen < keptlen) + { + if (flags & APR_FILEPATH_SECUREROOTTEST) + return APR_EABOVEROOT; + keptlen = pathlen; + } } } else /* not empty or dots */ diff --git a/test/testnames.c b/test/testnames.c index 196afce2dcc..3c5e3dfa29e 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -114,6 +114,19 @@ static void merge_dotdot(CuTest *tc) CuAssertPtrNotNull(tc, dstpath); CuAssertIntEquals(tc, APR_SUCCESS, rv); CuAssertStrEquals(tc, ABS_ROOT"foo/baz", dstpath); + + rv = apr_filepath_merge(&dstpath, "", "../test", 0, p); + CuAssertIntEquals(tc, 0, APR_SUCCESS); + CuAssertStrEquals(tc, "../test", dstpath); + + /* Very dangerous assumptions here about what the cwd is. However, let's assume + * that the testall is invoked from within apr/test/ so the following test should + * return ../test unless a previously fixed bug remains or the developer changes + * the case of the test directory: + */ + rv = apr_filepath_merge(&dstpath, "", "../test", APR_FILEPATH_TRUENAME, p); + CuAssertIntEquals(tc, 0, APR_SUCCESS); + CuAssertStrEquals(tc, "../test", dstpath); } static void merge_secure(CuTest *tc) From 66caefa46beef695ed48c683d04fd2677a7553e1 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 19 Sep 2003 03:33:23 +0000 Subject: [PATCH 4601/7878] remove an unused function argument git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64629 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index acc0be7e7eb..b53bbde701b 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -71,7 +71,7 @@ apr_pool_t *context; apr_atomic_t y; /* atomic locks */ -static apr_status_t check_basic_atomics(volatile apr_atomic_t*p) +static apr_status_t check_basic_atomics() { apr_atomic_t oldval; apr_uint32_t casval = 0; @@ -184,7 +184,7 @@ int main(void) fprintf(stderr, "Failed.\nCould not initialize atomics\n"); exit(-1); } - rv = check_basic_atomics(&y); + rv = check_basic_atomics(); if (rv != APR_SUCCESS) { fprintf(stderr, "Failed.\n"); exit(-1); From e17132c6fef6435b29b6b7c43e87864040f415ec Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 19 Sep 2003 04:15:52 +0000 Subject: [PATCH 4602/7878] remove an unused function argument git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64630 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testatomic.c b/test/testatomic.c index b53bbde701b..e0fe5f99e9c 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -295,7 +295,7 @@ int main(int argc, char**argv) } printf("OK\n"); - rv = check_basic_atomics(&y); + rv = check_basic_atomics(); if (rv != APR_SUCCESS) { fprintf(stderr, "Failed.\n"); exit(-1); From 2e4ba09348bcc71ada8854799632b83638267930 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 19 Sep 2003 14:32:54 +0000 Subject: [PATCH 4603/7878] minor syntax tweak git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64631 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testatomic.c b/test/testatomic.c index e0fe5f99e9c..de466956061 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -71,7 +71,7 @@ apr_pool_t *context; apr_atomic_t y; /* atomic locks */ -static apr_status_t check_basic_atomics() +static apr_status_t check_basic_atomics(void) { apr_atomic_t oldval; apr_uint32_t casval = 0; From 272f0ab9aa665a1b932bfc5beb6fac606979746f Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Fri, 19 Sep 2003 18:07:04 +0000 Subject: [PATCH 4604/7878] fix apr_file_dup() and apr_file_dup2() to dup the ungetchar member git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64632 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/win32/filedup.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index d5b0e4d86a9..7e18bfc3f3f 100644 --- a/CHANGES +++ b/CHANGES @@ -63,6 +63,9 @@ Changes with APR 1.0 Changes with APR 0.9.4 + *) fix apr_file_dup() and apr_file_dup2() to dup the ungetchar + member [Stas Bekman] + *) Preserve leading '../' segments as when merging to an empty and unrooted path - fixes a bug observed in SVN with Win32/Netware/OS2. [Mike Pilato , William Rowe] diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index e2c37034f20..f676daea20b 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -81,6 +81,7 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, (*new_file)->fname = apr_pstrdup(p, old_file->fname); (*new_file)->append = old_file->append; (*new_file)->buffered = FALSE; + (*new_file)->ungetchar = old_file->ungetchar; apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), file_cleanup, apr_pool_cleanup_null); @@ -150,6 +151,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, new_file->fname = apr_pstrdup(new_file->pool, old_file->fname); new_file->append = old_file->append; new_file->buffered = FALSE; + new_file->ungetchar = old_file->ungetchar; return APR_SUCCESS; #endif /* !defined(_WIN32_WCE) */ From 62d4e2c0d95636d362755ee2ff95efffebc43b9f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 19 Sep 2003 21:57:23 +0000 Subject: [PATCH 4605/7878] Enable use of atomics from MSVC C++ on WIN32. Submitted by: Mladen Turk Reviewed by: William Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64634 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 28733afbdf0..eeeee07beda 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -164,7 +164,7 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); #if defined(WIN32) -typedef LONG apr_atomic_t; +#define apr_atomic_t LONG #define apr_atomic_add(mem, val) InterlockedExchangeAdd(mem,val) #define apr_atomic_dec(mem) InterlockedDecrement(mem) From 971096e05abf3dd45dc724f00f457b64eee9b97b Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Mon, 22 Sep 2003 23:56:33 +0000 Subject: [PATCH 4606/7878] * build/PrintPath: Fix typo in comment. Submitted by: Blair Zajac git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64636 13f79535-47bb-0310-9956-ffa450edef68 --- build/PrintPath | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/PrintPath b/build/PrintPath index 68435f3744c..c5b5dff7e34 100755 --- a/build/PrintPath +++ b/build/PrintPath @@ -45,7 +45,7 @@ done # # First of all, all OS/2 programs have the '.exe' extension. # Next, we adjust PATH (or what was given to us as PATH) to -# be whitespace seperated directories. +# be whitespace separated directories. # Finally, we try to determine the best flag to use for # test/[] to look for an executable file. OS/2 just has '-r' # but with other OSs, we do some funny stuff to check to see From c474c76c7c889ca79aa1943304b8e779dd5a822d Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Tue, 23 Sep 2003 22:28:52 +0000 Subject: [PATCH 4607/7878] Fixed my own typo from way back when. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64638 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_errno.h b/include/apr_errno.h index ca7ecddb9c3..a4f22fb7046 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -314,7 +314,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * @warning For any particular error condition, more than one of these tests * may match. This is because platform-specific error codes may not * always match the semantics of the POSIX codes these tests (and the - * correcponding APR error codes) are named after. A notable example + * corresponding APR error codes) are named after. A notable example * are the APR_STATUS_IS_ENOENT and APR_STATUS_IS_ENOTDIR tests on * Win32 platforms. The programmer should always be aware of this and * adjust the order of the tests accordingly. From 168b47ec9352894f3625c0297d47680ab30c6ad4 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Thu, 25 Sep 2003 04:37:08 +0000 Subject: [PATCH 4608/7878] new version of atomic API that works specifically on apr_uint32_t values for greater portability git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64639 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + atomic/unix/apr_atomic.c | 135 ++++++++++++++++++++++++++++++++++++++- include/apr_atomic.h | 135 +++++++++++++++++++++++++++++++++++++-- test/testatomic.c | 83 ++++++++++++++++++++++++ 4 files changed, 351 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 7e18bfc3f3f..4f557127bb1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 1.0 + *) Added new versions of the apr_atomic functions for + use with 32-bit ints [Brian Pane] + *) The following deprecated interfaces have been removed: apr_accept -> apr_socket_accept diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 496f71b8c12..97bbb669d8c 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -184,6 +184,139 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp) } #endif /*!defined(apr_atomic_cas) && !defined(APR_OVERRIDE_ATOMIC_CAS) */ +#if !defined(apr_atomic_add32) && !defined(APR_OVERRIDE_ATOMIC_ADD32) +void apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ +#if APR_HAS_THREADS + apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + + if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { + *mem += val; + apr_thread_mutex_unlock(lock); + } +#else + *mem += val; +#endif /* APR_HAS_THREADS */ +} +#endif /*!defined(apr_atomic_sub32) && !defined(APR_OVERRIDE_ATOMIC_SUB32) */ + +#if !defined(apr_atomic_sub32) && !defined(APR_OVERRIDE_ATOMIC_SUB32) +void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ +#if APR_HAS_THREADS + apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + + if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { + *mem -= val; + apr_thread_mutex_unlock(lock); + } +#else + *mem -= val; +#endif /* APR_HAS_THREADS */ +} +#endif /*!defined(apr_atomic_sub32) && !defined(APR_OVERRIDE_ATOMIC_SUB32) */ + +#if !defined(apr_atomic_set32) && !defined(APR_OVERRIDE_ATOMIC_SET32) +void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ +#if APR_HAS_THREADS + apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + + if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { + *mem = val; + apr_thread_mutex_unlock(lock); + } +#else + *mem = val; +#endif /* APR_HAS_THREADS */ +} +#endif /*!defined(apr_atomic_set32) && !defined(APR_OVERRIDE_ATOMIC_SET32) */ + +#if !defined(apr_atomic_inc32) && !defined(APR_OVERRIDE_ATOMIC_INC32) +void apr_atomic_inc32(volatile apr_uint32_t *mem) +{ +#if APR_HAS_THREADS + apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + + if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { + (*mem)++; + apr_thread_mutex_unlock(lock); + } +#else + (*mem)++; +#endif /* APR_HAS_THREADS */ +} +#endif /*!defined(apr_atomic_inc32) && !defined(APR_OVERRIDE_ATOMIC_INC32) */ + +#if !defined(apr_atomic_dec32) && !defined(APR_OVERRIDE_ATOMIC_DEC32) +int apr_atomic_dec32(volatile apr_uint32_t *mem) +{ +#if APR_HAS_THREADS + apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + apr_uint32_t new; + + if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { + (*mem)--; + new = *mem; + apr_thread_mutex_unlock(lock); + return new; + } +#else + (*mem)--; +#endif /* APR_HAS_THREADS */ + return *mem; +} +#endif /*!defined(apr_atomic_dec32) && !defined(APR_OVERRIDE_ATOMIC_DEC32) */ + +#if !defined(apr_atomic_cas32) && !defined(APR_OVERRIDE_ATOMIC_CAS32) +apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, + apr_uint32_t cmp) +{ + apr_uint32_t prev; +#if APR_HAS_THREADS + apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + + if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { + prev = *mem; + if (prev == cmp) { + *mem = with; + } + apr_thread_mutex_unlock(lock); + return prev; + } + return *mem; +#else + prev = *mem; + if (prev == cmp) { + *mem = with; + } + return prev; +#endif /* APR_HAS_THREADS */ +} +#endif /*!defined(apr_atomic_cas32) && !defined(APR_OVERRIDE_ATOMIC_CAS32) */ + +#if !defined(apr_atomic_xchg32) && !defined(APR_OVERRIDE_ATOMIC_XCHG32) +apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +{ + apr_uint32_t prev; +#if APR_HAS_THREADS + apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + + if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { + prev = *mem; + *mem = val; + apr_thread_mutex_unlock(lock); + return val; + } + return *mem; +#else + prev = *mem; + *mem = val; + return prev; +#endif /* APR_HAS_THREADS */ +} +#endif /*!defined(apr_atomic_xchg32) && !defined(APR_OVERRIDE_ATOMIC_XCHG32) */ + #if !defined(apr_atomic_casptr) && !defined(APR_OVERRIDE_ATOMIC_CASPTR) void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) { @@ -208,4 +341,4 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) return prev; #endif /* APR_HAS_THREADS */ } -#endif /*!defined(apr_atomic_cas) && !defined(APR_OVERRIDE_ATOMIC_CAS) */ +#endif /*!defined(apr_atomic_casptr) && !defined(APR_OVERRIDE_ATOMIC_CASPTR) */ diff --git a/include/apr_atomic.h b/include/apr_atomic.h index eeeee07beda..bf4d9394327 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -104,24 +104,28 @@ apr_status_t apr_atomic_init(apr_pool_t *p); * @param mem the pointer * @warning on certain platforms this number is not stored * directly in the pointer. in others it is + * @deprecated */ apr_uint32_t apr_atomic_read(volatile apr_atomic_t *mem); /** * set the value for atomic. * @param mem the pointer * @param val the value + * @deprecated */ void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val); /** * Add 'val' to the atomic variable * @param mem pointer to the atomic value * @param val the addition + * @deprecated */ void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val); /** * increment the atomic variable by 1 * @param mem pointer to the atomic value + * @deprecated */ void apr_atomic_inc(volatile apr_atomic_t *mem); @@ -129,6 +133,7 @@ void apr_atomic_inc(volatile apr_atomic_t *mem); * decrement the atomic variable by 1 * @param mem pointer to the atomic value * @return zero if the value is zero, otherwise non-zero + * @deprecated */ int apr_atomic_dec(volatile apr_atomic_t *mem); @@ -140,10 +145,76 @@ int apr_atomic_dec(volatile apr_atomic_t *mem); * @param cmp the value to compare it to * @return the old value of the atomic * @warning do not mix apr_atomic's with the CAS function. + * @deprecated * on some platforms they may be implemented by different mechanisms */ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp); + +/* + * Atomic operations on 32-bit values + * Note: Each of these functions internally implements a memory barrier + * on platforms that require it + */ + +/** + * atomically read an apr_uint32_t from memory + * @param mem the pointer + */ +apr_uint32_t apr_atomic_read32(volatile apr_uint32_t *mem); + +/** + * atomically set an apr_uint32_t in memory + * @param mem pointer to the object + */ +void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val); + +/** + * atomically add 'val' to an apr_uint32_t + * @param mem pointer to the object + * @param val amount to add + */ +void apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val); + +/** + * atomically subtract 'val' from an apr_uint32_t + * @param mem pointer to the object + * @param val amount to subtract + */ +void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val); + +/** + * atomically increment an apr_uint32_t by 1 + * @param mem pointer to the object + */ +void apr_atomic_inc32(volatile apr_uint32_t *mem); + +/** + * atomically decrement an apr_uint32_t by 1 + * @param mem pointer to the atomic value + * @return zero if the value becomes zero on decrement, otherwise non-zero + */ +int apr_atomic_dec32(volatile apr_uint32_t *mem); + +/** + * compare an apr_uint32_t's value with 'cmp'. + * If they are the same swap the value with 'with' + * @param mem pointer to the value + * @param with what to swap it with + * @param cmp the value to compare it to + * @return the old value of *mem + */ +apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, + apr_uint32_t cmp); + +/** + * exchange an apr_uint32_t's value with 'val'. + * @param mem pointer to the value + * @param val what to swap it with + * @return the old value of *mem + */ +apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val); + /** * compare the pointer's value with cmp. * If they are the same swap the value with 'with' @@ -172,7 +243,7 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); #define apr_atomic_set(mem, val) InterlockedExchange(mem, val) #define apr_atomic_read(mem) (*mem) #define apr_atomic_cas(mem,with,cmp) InterlockedCompareExchange(mem,with,cmp) -#define apr_atomic_init(pool) APR_SUCCESS + /*#define apr_atomic_init(pool) APR_SUCCESS*/ #define apr_atomic_casptr(mem,with,cmp) InterlockedCompareExchangePointer(mem,with,cmp) #elif defined(NETWARE) @@ -183,7 +254,7 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); #define apr_atomic_inc(mem) atomic_inc(mem) #define apr_atomic_set(mem, val) (*mem = val) #define apr_atomic_read(mem) (*mem) -#define apr_atomic_init(pool) APR_SUCCESS + /*#define apr_atomic_init(pool) APR_SUCCESS*/ #define apr_atomic_cas(mem,with,cmp) atomic_cmpxchg((unsigned long *)(mem),(unsigned long)(cmp),(unsigned long)(with)) int apr_atomic_dec(apr_atomic_t *mem); @@ -211,6 +282,12 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) #define apr_atomic_set(mem, val) atomic_set_int(mem, val) #define apr_atomic_read(mem) (*mem) +#define apr_atomic_add32(mem, val) apr_atomic_add(mem, val) +#define apr_atomic_dec32(mem) apr_atomic_dec(mem) +#define apr_atomic_inc32(mem) apr_atomic_inc(mem) +#define apr_atomic_set32(mem) apr_atomic_set(mem) +#define apr_atomic_read32(mem) apr_atomic_read(mem) + #elif (defined(__linux__) || defined(__EMX__)) && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC #define apr_atomic_t apr_uint32_t @@ -228,6 +305,12 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) : "m" (*(mem)), "r" (val) \ : "memory") +#define apr_atomic_sub(mem, val) \ + asm volatile ("lock; subl %1, %0" \ + : \ + : "m" (*(mem)), "r" (val) \ + : "memory") + #define apr_atomic_dec(mem) \ ({ int prev; \ asm volatile ("mov $0, %%eax;\n\t" \ @@ -247,7 +330,16 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) #define apr_atomic_set(mem, val) (*(mem) = val) #define apr_atomic_read(mem) (*(mem)) -#define apr_atomic_init(pool) APR_SUCCESS + +#define apr_atomic_cas32(mem, with, cmp) apr_atomic_cas(mem, with, cmp) +#define apr_atomic_add32(mem, val) apr_atomic_add(mem, val) +#define apr_atomic_sub32(mem, val) apr_atomic_sub(mem, val) +#define apr_atomic_dec32(mem) apr_atomic_dec(mem) +#define apr_atomic_inc32(mem) apr_atomic_inc(mem) +#define apr_atomic_set32(mem, val) apr_atomic_set(mem, val) +#define apr_atomic_read32(mem) apr_atomic_read(mem) + +/*#define apr_atomic_init(pool) APR_SUCCESS*/ #elif defined(__MVS__) /* OS/390 */ @@ -261,7 +353,7 @@ apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem, apr_uint32_t swap, #define apr_atomic_inc(mem) apr_atomic_add(mem, 1) #define apr_atomic_dec(mem) apr_atomic_add(mem, -1) -#define apr_atomic_init(pool) APR_SUCCESS +/*#define apr_atomic_init(pool) APR_SUCCESS*/ /* warning: the following two operations, _read and _set, are atomic * if the memory variables are aligned (the usual case). @@ -325,6 +417,41 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #define APR_ATOMIC_NEED_DEFAULT_INIT 1 #endif +#if !defined(apr_atomic_read32) && !defined(APR_OVERRIDE_ATOMIC_READ32) +#define apr_atomic_read32(p) *p +#endif + +#if !defined(apr_atomic_set32) && !defined(APR_OVERRIDE_ATOMIC_SET32) +void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val); +#define APR_ATOMIC_NEED_DEFAULT_INIT 1 +#endif + +#if !defined(apr_atomic_add32) && !defined(APR_OVERRIDE_ATOMIC_ADD32) +void apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val); +#define APR_ATOMIC_NEED_DEFAULT_INIT 1 +#endif + +#if !defined(apr_atomic_inc32) && !defined(APR_OVERRIDE_ATOMIC_INC32) +void apr_atomic_inc32(volatile apr_uint32_t *mem); +#define APR_ATOMIC_NEED_DEFAULT_INIT 1 +#endif + +#if !defined(apr_atomic_dec32) && !defined(APR_OVERRIDE_ATOMIC_DEC32) +int apr_atomic_dec32(volatile apr_uint32_t *mem); +#define APR_ATOMIC_NEED_DEFAULT_INIT 1 +#endif + +#if !defined(apr_atomic_cas32) && !defined(APR_OVERRIDE_ATOMIC_CAS32) +apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, + apr_uint32_t cmp); +#define APR_ATOMIC_NEED_DEFAULT_INIT 1 +#endif + +#if !defined(apr_atomic_xchg32) && !defined(APR_OVERRIDE_ATOMIC_XCHG32) +apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val); +#define APR_ATOMIC_NEED_DEFAULT_INIT 1 +#endif + #if !defined(apr_atomic_casptr) && !defined(APR_OVERRIDE_ATOMIC_CASPTR) #if APR_SIZEOF_VOIDP == 4 #define apr_atomic_casptr(mem, with, cmp) (void *)apr_atomic_cas((apr_uint32_t *)(mem), (long)(with), (long)cmp) diff --git a/test/testatomic.c b/test/testatomic.c index de466956061..f7c1e9dc9f9 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -70,6 +70,7 @@ apr_pool_t *context; apr_atomic_t y; /* atomic locks */ +apr_uint32_t y32; static apr_status_t check_basic_atomics(void) { @@ -164,6 +165,75 @@ static apr_status_t check_basic_atomics(void) return APR_SUCCESS; } +static apr_status_t check_basic_atomics32() +{ + apr_uint32_t oldval; + apr_uint32_t casval = 0; + + apr_atomic_set32(&y32, 2); + printf("%-60s", "testing apr_atomic_dec32"); + if (apr_atomic_dec32(&y32) == 0) { + fprintf(stderr, "Failed\noldval =%d should not be zero\n", + apr_atomic_read32(&y32)); + return APR_EGENERAL; + } + if (apr_atomic_dec32(&y32) != 0) { + fprintf(stderr, "Failed\noldval =%d should be zero\n", + apr_atomic_read32(&y32)); + return APR_EGENERAL; + } + printf("OK\n"); + + printf("%-60s", "testing apr_atomic_cas32"); + oldval = apr_atomic_cas32(&casval, 12, 0); + if (oldval != 0) { + fprintf(stderr, "Failed\noldval =%d should be zero\n", oldval); + return APR_EGENERAL; + } + printf("OK\n"); + printf("%-60s", "testing apr_atomic_cas32 - match non-null"); + oldval = apr_atomic_cas32(&casval, 23, 12); + if (oldval != 12) { + fprintf(stderr, "Failed\noldval =%d should be 12 y=%d\n", + oldval, casval); + return APR_EGENERAL; + } + printf("OK\n"); + printf("%-60s", "testing apr_atomic_cas32 - no match"); + oldval = apr_atomic_cas32(&casval, 23, 12); + if (oldval != 23) { + fprintf(stderr, "Failed\noldval =%d should be 23 y=%d\n", + oldval, casval); + return APR_EGENERAL; + } + printf("OK\n"); + + printf("%-60s", "testing apr_atomic_add32"); + apr_atomic_set32(&y32, 23); + apr_atomic_add32(&y32, 4); + if ((oldval = apr_atomic_read32(&y32)) != 27) { + fprintf(stderr, + "Failed\nAtomic Add doesn't add up ;( expected 27 got %d\n", + oldval); + return APR_EGENERAL; + } + + printf("OK\n"); + printf("%-60s", "testing add32/inc32/sub32"); + apr_atomic_set32(&y32, 0); + apr_atomic_add32(&y32, 20); + apr_atomic_inc32(&y32); + apr_atomic_sub32(&y32, 10); + if (apr_atomic_read32(&y32) != 11) { + fprintf(stderr, "Failed.\natomics do not add up: expected 11 got %d\n", + apr_atomic_read32(&y32)); + return APR_EGENERAL; + } + fprintf(stdout, "OK\n"); + + return APR_SUCCESS; +} + #if !APR_HAS_THREADS int main(void) { @@ -189,6 +259,12 @@ int main(void) fprintf(stderr, "Failed.\n"); exit(-1); } + + rv = check_basic_atomics32(); + if (rv != APR_SUCCESS) { + fprintf(stderr, "Failed.\n"); + exit(-1); + } return 0; } #else /* !APR_HAS_THREADS */ @@ -302,6 +378,13 @@ int main(int argc, char**argv) } apr_atomic_set(&y, 0); + rv = check_basic_atomics32(); + if (rv != APR_SUCCESS) { + fprintf(stderr, "Failed.\n"); + exit(-1); + } + + printf("%-60s", "Starting all the threads"); for (i = 0; i < NUM_THREADS; i++) { r1[i] = apr_thread_create(&t1[i], NULL, From cb2fa676c4a3184666826c3ccfbc7ffbf8f92f31 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 25 Sep 2003 14:49:00 +0000 Subject: [PATCH 4609/7878] get prototype for default implementation of apr_atomic_sub32() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64640 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index bf4d9394327..2c36cdda9e1 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -431,6 +431,11 @@ void apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val); #define APR_ATOMIC_NEED_DEFAULT_INIT 1 #endif +#if !defined(apr_atomic_sub32) && !defined(APR_OVERRIDE_ATOMIC_SUB32) +void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val); +#define APR_ATOMIC_NEED_DEFAULT_INIT 1 +#endif + #if !defined(apr_atomic_inc32) && !defined(APR_OVERRIDE_ATOMIC_INC32) void apr_atomic_inc32(volatile apr_uint32_t *mem); #define APR_ATOMIC_NEED_DEFAULT_INIT 1 From ff9a895b0c6449441bce0e2dcd0531a6b4889f0c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 25 Sep 2003 14:49:55 +0000 Subject: [PATCH 4610/7878] make empty parameter list explicit to avoid compile warning git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64641 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testatomic.c b/test/testatomic.c index f7c1e9dc9f9..6603b6517f6 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -165,7 +165,7 @@ static apr_status_t check_basic_atomics(void) return APR_SUCCESS; } -static apr_status_t check_basic_atomics32() +static apr_status_t check_basic_atomics32(void) { apr_uint32_t oldval; apr_uint32_t casval = 0; From 0f3114ba1860259d7cdce74a132df8681177e55e Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 26 Sep 2003 01:51:53 +0000 Subject: [PATCH 4611/7878] Fix default impl of apr_atomic_xchg32, and add a test case for it git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64642 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 2 +- test/testatomic.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 97bbb669d8c..16912b9687d 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -306,7 +306,7 @@ apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) prev = *mem; *mem = val; apr_thread_mutex_unlock(lock); - return val; + return prev; } return *mem; #else diff --git a/test/testatomic.c b/test/testatomic.c index 6603b6517f6..2ad4a743b0d 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -184,6 +184,19 @@ static apr_status_t check_basic_atomics32(void) } printf("OK\n"); + printf("%-60s", "testing apr_atomic_xchg32"); + apr_atomic_set32(&y32, 100); + oldval = apr_atomic_xchg32(&y32, 50); + if (oldval != 100) { + fprintf(stderr, "Failed\noldval =%d should be 100\n", oldval); + return APR_EGENERAL; + } + if (y32 != 50) { + fprintf(stderr, "Failed\nnewval =%d should be 50\n", oldval); + return APR_EGENERAL; + } + printf("OK\n"); + printf("%-60s", "testing apr_atomic_cas32"); oldval = apr_atomic_cas32(&casval, 12, 0); if (oldval != 0) { From c7f4a7057ca8000989b3bef08c8ee6fa12b2941a Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 26 Sep 2003 02:34:10 +0000 Subject: [PATCH 4612/7878] Inline assembly version of apr_atomic_xchg32 for Linux/x86 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64643 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 2c36cdda9e1..097ac45e066 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -339,6 +339,14 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) #define apr_atomic_set32(mem, val) apr_atomic_set(mem, val) #define apr_atomic_read32(mem) apr_atomic_read(mem) +#define apr_atomic_xchg32(mem,val) \ +({ apr_uint32_t prev = val; \ + asm volatile ("lock; xchgl %0, %1" \ + : "=r" (prev) \ + : "m" (*(mem)), "0"(prev) \ + : "memory"); \ + prev;}) + /*#define apr_atomic_init(pool) APR_SUCCESS*/ #elif defined(__MVS__) /* OS/390 */ From 974a1602a5d54c59729c7edb34e87367d927a1d6 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 26 Sep 2003 07:40:31 +0000 Subject: [PATCH 4613/7878] Fix up make_exports.awk and friends to support apr-iconv. (Forward port from APR_0_9_BRANCH which needed this in order to build apr-iconv.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64649 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ build/make_exports.awk | 4 ++-- build/make_nw_export.awk | 6 +++--- build/make_var_export.awk | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 4f557127bb1..d3a1945d5f0 100644 --- a/CHANGES +++ b/CHANGES @@ -64,6 +64,10 @@ Changes with APR 1.0 apr_compat.h +Changes with APR 0.9.5 + + *) Fix make_exports.awk to work with apr-iconv. [Justin Erenkrantz] + Changes with APR 0.9.4 *) fix apr_file_dup() and apr_file_dup2() to dup the ungetchar diff --git a/build/make_exports.awk b/build/make_exports.awk index eefc1a94516..1d12fc65abe 100644 --- a/build/make_exports.awk +++ b/build/make_exports.awk @@ -76,8 +76,8 @@ function add_symbol(symbol) { } } -/^[ \t]*AP[RU]?_(CORE_)?DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ { - sub("[ \t]*AP[RU]?_(CORE_)?DECLARE[^(]*[(][^)]*[)][ \t]*", "") +/^[ \t]*AP[RUI]?_(CORE_)?DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ { + sub("[ \t]*AP[RUI]?_(CORE_)?DECLARE[^(]*[(][^)]*[)][ \t]*", "") sub("[(].*", "") sub("([^ ]* (^([ \t]*[(])))+", "") diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk index e0f273b0f9e..291ecc0b2c4 100644 --- a/build/make_nw_export.awk +++ b/build/make_nw_export.awk @@ -23,8 +23,8 @@ function add_symbol (sym_name) { } } -/^[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ { - sub("[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)][ \t]*", "") +/^[ \t]*AP[RUI]?_DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ { + sub("[ \t]*AP[RUI]?_DECLARE[^(]*[(][^)]*[)][ \t]*", "") sub("[(].*", "") sub("([^ ]* (^([ \t]*[(])))+", "") @@ -65,7 +65,7 @@ function add_symbol (sym_name) { next } -/^[ \t]*AP[RU]?_DECLARE_DATA .*;$/ { +/^[ \t]*AP[RUI]?_DECLARE_DATA .*;$/ { varname = $NF; gsub( /[*;]/, "", varname); gsub( /\[.*\]/, "", varname); diff --git a/build/make_var_export.awk b/build/make_var_export.awk index 1d6f76d8ff1..59922758d58 100644 --- a/build/make_var_export.awk +++ b/build/make_var_export.awk @@ -1,7 +1,7 @@ # Based on apr's make_export.awk, which is # based on Ryan Bloom's make_export.pl -/^#[ \t]*if(def)? (AP[RU]?_|!?defined).*/ { +/^#[ \t]*if(def)? (AP[RUI]?_|!?defined).*/ { if (old_filename != FILENAME) { if (old_filename != "") printf("%s", line) macro_no = 0 @@ -47,7 +47,7 @@ function add_symbol (sym_name) { } } -/^[ \t]*(extern[ \t]+)?AP[RU]?_DECLARE_DATA .*;$/ { +/^[ \t]*(extern[ \t]+)?AP[RUI]?_DECLARE_DATA .*;$/ { varname = $NF; gsub( /[*;]/, "", varname); gsub( /\[.*\]/, "", varname); From e490b472a71d8c7662e92d56211193147752ec0e Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 26 Sep 2003 07:42:49 +0000 Subject: [PATCH 4614/7878] Hmm. We're not on the 0.9.x branch. HEAD is 1.0-dev. (This may horribly break all of your programs, but it had to happen anyway when we went to 1.0. Better to find out now.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64650 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_version.h b/include/apr_version.h index b56dde2f132..ab01ccf1954 100644 --- a/include/apr_version.h +++ b/include/apr_version.h @@ -90,16 +90,16 @@ extern "C" { * programs such as structure size changes. No binary compatibility is * possible across a change in the major version. */ -#define APR_MAJOR_VERSION 0 +#define APR_MAJOR_VERSION 1 /** * Minor API changes that do not cause binary compatibility problems. * Should be reset to 0 when upgrading APR_MAJOR_VERSION */ -#define APR_MINOR_VERSION 9 +#define APR_MINOR_VERSION 0 /** patch level */ -#define APR_PATCH_VERSION 4 +#define APR_PATCH_VERSION 0 /** From 2cb14a6ab3963fa787401a2f06070ecc3890e6d2 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 26 Sep 2003 18:08:39 +0000 Subject: [PATCH 4615/7878] * include/apr_pools.h (apr_pool_userdata_set): Update documentation. Submitted by: Cliff Woolley git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64651 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index d43b83e7ce3..6dfff61ecf2 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -461,8 +461,11 @@ APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag); * Users of APR must take EXTREME care when choosing a key to * use for their data. It is possible to accidentally overwrite * data by choosing a key that another part of the program is using - * It is advised that steps are taken to ensure that a unique - * key is used at all times. + * It is advised that steps are taken to ensure that unique keys are + * used for all of the userdata objects in a given pool at all times. + * Careful namespace prefixing of key names typically helps to ensure this + * uniqueness. + * * @bug Specify how to ensure this uniqueness! */ APR_DECLARE(apr_status_t) apr_pool_userdata_set( From 4d43f02fde16bca8ddc9ae85237fd24966e7c8ed Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 26 Sep 2003 18:25:35 +0000 Subject: [PATCH 4616/7878] * include/apr_pools.h (apr_pool_userdata_set): Remove @bug line from the documentation. Users tend to be quite capable of making up key names. The warning should be enough. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64652 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 6dfff61ecf2..03f49836893 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -466,7 +466,6 @@ APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag); * Careful namespace prefixing of key names typically helps to ensure this * uniqueness. * - * @bug Specify how to ensure this uniqueness! */ APR_DECLARE(apr_status_t) apr_pool_userdata_set( const void *data, From ddb8c72c442af51981d4ffd5cd304c97842cd30d Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Fri, 26 Sep 2003 19:13:28 +0000 Subject: [PATCH 4617/7878] clarify docs. submitted by: stas git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64654 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 03f49836893..00cfa61493c 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -460,11 +460,12 @@ APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag); * * Users of APR must take EXTREME care when choosing a key to * use for their data. It is possible to accidentally overwrite - * data by choosing a key that another part of the program is using - * It is advised that steps are taken to ensure that unique keys are - * used for all of the userdata objects in a given pool at all times. - * Careful namespace prefixing of key names typically helps to ensure this - * uniqueness. + * data by choosing a key that another part of the program is using. + * Therefore it is advised that steps are taken to ensure that unique + * keys are used for all of the userdata objects in a particular pool + * (the same key in two different pools or a pool and one of its + * subpools is okay) at all times. Careful namespace prefixing of + * key names is a typical way to help ensure this uniqueness. * */ APR_DECLARE(apr_status_t) apr_pool_userdata_set( From 709ee1aaaf7596d1a55ba37323a06e315d290b34 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sat, 27 Sep 2003 23:51:46 +0000 Subject: [PATCH 4618/7878] * misc/unix/start.c (apr_initialize): Remove atomics initialization from this function. Due to circular dependency, doing it here is too late. * memory/unix/apr_pools.c (apr_pool_initialize): Add atomics initialization to the release and debug versions. This has to happen here, since pools rely on mutexes, which can be backed by atomics. Atomics initialization requires a pool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64655 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 14 ++++++++++++++ misc/unix/start.c | 9 ++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 8f2372d768d..caa8c8401b9 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -555,6 +555,13 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) apr_pool_tag(global_pool, "apr_global_pool"); + /* This has to happen here because mutexes might be backed by + * atomics. It used to be snug and safe in apr_initialize(). + */ + if ((rv = apr_atomic_init(global_pool)) != APR_SUCCESS) { + return rv; + } + #if APR_HAS_THREADS { apr_thread_mutex_t *mutex; @@ -1266,6 +1273,13 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) apr_pools_initialized = 1; + /* This has to happen here because mutexes might be backed by + * atomics. It used to be snug and safe in apr_initialize(). + */ + if ((rv = apr_atomic_init(global_pool)) != APR_SUCCESS) { + return rv; + } + #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) apr_file_open_stderr(&file_stderr, global_pool); if (file_stderr) { diff --git a/misc/unix/start.c b/misc/unix/start.c index 48c815651a0..2dce9831f46 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -99,9 +99,12 @@ APR_DECLARE(apr_status_t) apr_initialize(void) apr_pool_tag(pool, "apr_initialize"); - if ((status = apr_atomic_init(pool)) != APR_SUCCESS) { - return status; - } + /* apr_atomic_init() used to be called from here aswell. + * Pools rely on mutexes though, which can be backed by + * atomics. Due to this circular dependency + * apr_pool_initialize() is taking care of calling + * apr_atomic_init() at the correct time. + */ apr_signal_init(pool); From 074b5fc6cc95ca5920e3e6885ed86e3645b3d030 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sun, 28 Sep 2003 16:43:44 +0000 Subject: [PATCH 4619/7878] apr_pools.c: In function `apr_pool_initialize': apr_pools.c:561: warning: implicit declaration of function `apr_atomic_init' git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64657 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 1 + 1 file changed, 1 insertion(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index caa8c8401b9..f6f61f53950 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -55,6 +55,7 @@ #include "apr.h" #include "apr_private.h" +#include "apr_atomic.h" #include "apr_portable.h" /* for get_os_proc */ #include "apr_strings.h" #include "apr_general.h" From 0618e680ac25a3c6467147f3e8f19b14276af1dc Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sun, 28 Sep 2003 16:46:29 +0000 Subject: [PATCH 4620/7878] apr_compat.h no longer exists git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64658 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 4 ---- libapr.dsp | 4 ---- 2 files changed, 8 deletions(-) diff --git a/apr.dsp b/apr.dsp index 6f68981b020..0693a1862e0 100644 --- a/apr.dsp +++ b/apr.dsp @@ -496,10 +496,6 @@ SOURCE=.\include\apr_atomic.h # End Source File # Begin Source File -SOURCE=.\include\apr_compat.h -# End Source File -# Begin Source File - SOURCE=.\include\apr_dso.h # End Source File # Begin Source File diff --git a/libapr.dsp b/libapr.dsp index 8f278c9ac1c..6508da3b564 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -502,10 +502,6 @@ SOURCE=.\include\apr_atomic.h # End Source File # Begin Source File -SOURCE=.\include\apr_compat.h -# End Source File -# Begin Source File - SOURCE=.\include\apr_dso.h # End Source File # Begin Source File From b3a805ddffe3037b55eba84676b96c83314048e4 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 29 Sep 2003 11:31:59 +0000 Subject: [PATCH 4621/7878] Make use of the AI_ADDRCONFIG flag conditional (some versions of glibc 2.1 don't either support it or fail correctly): * build/apr_network.m4 (APR_CHECK_GETADDRINFO_ADDRCONFIG): New macro. * configure.in: Use APR_CHECK_GETADDRINFO_ADDRCONFIG. * network_io/unix/sockaddr.c (call_resolver): Only use the AI_ADDRCONFIG flag if HAVE_GAI_ADDRCONFIG is defined. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64661 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 34 ++++++++++++++++++++++++++++++++++ configure.in | 1 + network_io/unix/sockaddr.c | 4 ++-- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index f637c3db47c..691ef2f6ad2 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -57,6 +57,40 @@ if test "$ac_cv_working_getaddrinfo" = "yes"; then fi ]) +dnl Check whether the AI_ADDRCONFIG flag can be used with getaddrinfo +AC_DEFUN(APR_CHECK_GETADDRINFO_ADDRCONFIG, [ + AC_CACHE_CHECK(for working AI_ADDRCONFIG, apr_cv_gai_addrconfig, [ + AC_TRY_RUN([ +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +int main(int argc, char **argv) { + struct addrinfo hints, *ai; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_ADDRCONFIG; + return getaddrinfo("localhost", NULL, &hints, &ai) != 0; +}], [apr_cv_gai_addrconfig=yes], + [apr_cv_gai_addrconfig=no], + [apr_cv_gai_addrconfig=no])]) + +if test $apr_cv_gai_addrconfig = yes; then + AC_DEFINE(HAVE_GAI_ADDRCONFIG, 1, [Define if getaddrinfo accepts the AI_ADDRCONFIG flag]) +fi +]) + dnl dnl check for working getnameinfo() dnl diff --git a/configure.in b/configure.in index a5075ece651..717ed6582d4 100644 --- a/configure.in +++ b/configure.in @@ -1817,6 +1817,7 @@ else if test "x$ac_cv_working_getaddrinfo" = "xyes"; then if test "x$ac_cv_working_getnameinfo" = "xyes"; then APR_CHECK_GETNAMEINFO_IPV4_MAPPED + APR_CHECK_GETADDRINFO_ADDRCONFIG have_ipv6="1" ipv6_result="yes" else diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 9f9bb85ed28..24a7019ff6f 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -374,7 +374,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, memset(&hints, 0, sizeof(hints)); hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; -#ifdef AI_ADDRCONFIG +#ifdef HAVE_GAI_ADDRCONFIG if (family == AF_UNSPEC) { /* By default, only look up addresses using address types for * which a local interface is configured, i.e. no IPv6 if no @@ -404,7 +404,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, servname = apr_itoa(p, port); } error = getaddrinfo(hostname, servname, &hints, &ai_list); -#ifdef AI_ADDRCONFIG +#ifdef HAVE_GAI_ADDRCONFIG if (error == EAI_BADFLAGS && family == AF_UNSPEC) { /* Retry with no flags if AI_ADDRCONFIG was rejected. */ hints.ai_flags = 0; From bcbf68d0af18f47e89262b0a8b23406e81c9a625 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 29 Sep 2003 11:39:30 +0000 Subject: [PATCH 4622/7878] * misc/unix/rand.c, include/apr_general.h (apr_generate_random_bytes): Use apr_size_t for length parameter. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64662 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 7 +------ misc/unix/rand.c | 4 ---- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/include/apr_general.h b/include/apr_general.h index 72ed83cf23c..f24a122fd45 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -261,15 +261,10 @@ APR_DECLARE(void) apr_terminate2(void); /** * Generate random bytes. * @param buf Buffer to fill with random bytes - * @param length Length of buffer in bytes (becomes apr_size_t in APR 1.0) + * @param length Length of buffer in bytes */ -#ifdef APR_ENABLE_FOR_1_0 APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, apr_size_t length); -#else -APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, - int length); -#endif #endif /** @} */ diff --git a/misc/unix/rand.c b/misc/unix/rand.c index c8e920c2f16..0e0683beb28 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -81,11 +81,7 @@ #if APR_HAS_RANDOM APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, -#ifdef APR_ENABLE_FOR_1_0 apr_size_t length) -#else - int length) -#endif { #ifdef DEV_RANDOM From 20d6e40ebc398d3ec40020a9de8a1fe59d154d44 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 29 Sep 2003 12:35:32 +0000 Subject: [PATCH 4623/7878] * include/arch/unix/apr_arch_threadproc.h: Store a pthread_attr_t structure in apr_threadattr_t, rather than a pointer to one. * threadproc/unix/thread.c (apr_threadattr_create): Use a single palloc call, omit ENOMEM handling. (apr_threadattr_detach_set, apr_threadattr_detach_get, apr_thread_create): Adjust use of ->attr appropriately. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64663 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_threadproc.h | 2 +- threadproc/unix/thread.c | 22 +++++++++------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/include/arch/unix/apr_arch_threadproc.h b/include/arch/unix/apr_arch_threadproc.h index 6de6cc27525..38318174c1e 100644 --- a/include/arch/unix/apr_arch_threadproc.h +++ b/include/arch/unix/apr_arch_threadproc.h @@ -97,7 +97,7 @@ struct apr_thread_t { struct apr_threadattr_t { apr_pool_t *pool; - pthread_attr_t *attr; + pthread_attr_t attr; }; struct apr_threadkey_t { diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 062b3e930e9..68a59758c7d 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -58,21 +58,17 @@ #if APR_HAS_THREADS +/* XXX: missing a cleanup, pthread_attr_destroy is never called! */ + #if APR_HAVE_PTHREAD_H APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *pool) { apr_status_t stat; - (*new) = (apr_threadattr_t *)apr_pcalloc(pool, sizeof(apr_threadattr_t)); - (*new)->attr = (pthread_attr_t *)apr_pcalloc(pool, sizeof(pthread_attr_t)); - - if ((*new) == NULL || (*new)->attr == NULL) { - return APR_ENOMEM; - } - + (*new) = apr_palloc(pool, sizeof(apr_threadattr_t)); (*new)->pool = pool; - stat = pthread_attr_init((*new)->attr); + stat = pthread_attr_init(&(*new)->attr); if (stat == 0) { return APR_SUCCESS; @@ -91,9 +87,9 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, #ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR int arg = on; - if ((stat = pthread_attr_setdetachstate(attr->attr, &arg)) == 0) { + if ((stat = pthread_attr_setdetachstate(&attr->attr, &arg)) == 0) { #else - if ((stat = pthread_attr_setdetachstate(attr->attr, on)) == 0) { + if ((stat = pthread_attr_setdetachstate(&attr->attr, on)) == 0) { #endif return APR_SUCCESS; @@ -112,9 +108,9 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) int state; #ifdef PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG - state = pthread_attr_getdetachstate(attr->attr); + state = pthread_attr_getdetachstate(&attr->attr); #else - pthread_attr_getdetachstate(attr->attr, &state); + pthread_attr_getdetachstate(&attr->attr, &state); #endif if (state == 1) return APR_DETACH; @@ -153,7 +149,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, (*new)->func = func; if (attr) - temp = attr->attr; + temp = &attr->attr; else temp = NULL; From ecc95b095a208db2c857e5b506ed17084ad93d56 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 29 Sep 2003 14:20:02 +0000 Subject: [PATCH 4624/7878] Link libapr against the libraries on which it depends for all platforms, not just AIX. PR: 18420 * configure.in: Remove lib_target_libs setting for AIX. * Makefile.in ($(TARGET_LIB)): Use ALL_LIBS instead of configured lib_target_libs value in $(LINK) line. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64664 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- configure.in | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Makefile.in b/Makefile.in index 6402e79cec2..0c1bdc1740c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -100,7 +100,7 @@ install: $(TARGET_LIB) $(TARGET_LIB): @for i in $(SUBDIRS); do objects="$$objects $$i/*.@so_ext@"; done ; \ - tmpcmd="$(LINK) @lib_target@ @lib_target_libs@"; \ + tmpcmd="$(LINK) @lib_target@ $(ALL_LIBS)"; \ echo $$tmpcmd; \ $$tmpcmd && touch $@ diff --git a/configure.in b/configure.in index 717ed6582d4..e14cb3c0fae 100644 --- a/configure.in +++ b/configure.in @@ -186,12 +186,7 @@ else export_lib_target='' fi -# On AIX, libraries need to be specified on the link of lib_target -lib_target_libs="" case $host in - *aix*) - lib_target_libs="\$(EXTRA_LIBS)"; - ;; *-solaris2*) apr_platform_runtime_link_flag="-R" ;; @@ -207,7 +202,6 @@ AC_SUBST(export_lib_target) AC_SUBST(shlibpath_var) AC_SUBST(LTFLAGS) AC_SUBST(LT_LDFLAGS) -AC_SUBST(lib_target_libs) dnl ----------------------------- Checks for compiler flags nl=' From e98f8c600af0cca6b5ab4500ce88d7f46f096bdd Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 29 Sep 2003 16:10:00 +0000 Subject: [PATCH 4625/7878] Fix up the apr_atomic* APIs for NETWARE to conform to the latest changes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64665 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 097ac45e066..ac1e9d85b9f 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -250,19 +250,30 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); #define apr_atomic_t unsigned long -#define apr_atomic_add(mem, val) atomic_add(mem,val) -#define apr_atomic_inc(mem) atomic_inc(mem) -#define apr_atomic_set(mem, val) (*mem = val) -#define apr_atomic_read(mem) (*mem) - /*#define apr_atomic_init(pool) APR_SUCCESS*/ -#define apr_atomic_cas(mem,with,cmp) atomic_cmpxchg((unsigned long *)(mem),(unsigned long)(cmp),(unsigned long)(with)) +#define apr_atomic_init(pool) APR_SUCCESS +#define apr_atomic_add32(mem, val) atomic_add(mem,val) +#define apr_atomic_sub32(mem, val) atomic_sub(mem,val) +#define apr_atomic_inc32(mem) atomic_inc(mem) +#define apr_atomic_set32(mem, val) (*mem = val) +#define apr_atomic_read32(mem) (*mem) +#define apr_atomic_cas32(mem,with,cmp) atomic_cmpxchg((unsigned long *)(mem),(unsigned long)(cmp),(unsigned long)(with)) +#define apr_atomic_xchg32(mem, val) atomic_xchg(mem, val) -int apr_atomic_dec(apr_atomic_t *mem); +int apr_atomic_dec32(apr_atomic_t *mem); void *apr_atomic_casptr(void **mem, void *with, const void *cmp); -#define APR_OVERRIDE_ATOMIC_DEC 1 + +#define APR_OVERRIDE_ATOMIC_READ32 1 +#define APR_OVERRIDE_ATOMIC_SET32 1 +#define APR_OVERRIDE_ATOMIC_ADD32 1 +#define APR_OVERRIDE_ATOMIC_SUB32 1 +#define APR_OVERRIDE_ATOMIC_INC32 1 +#define APR_OVERRIDE_ATOMIC_DEC32 1 +#define APR_OVERRIDE_ATOMIC_CAS32 1 +#define APR_OVERRIDE_ATOMIC_XCHG32 1 + #define APR_OVERRIDE_ATOMIC_CASPTR 1 -inline int apr_atomic_dec(apr_atomic_t *mem) +inline int apr_atomic_dec32(apr_atomic_t *mem) { atomic_dec(mem); return *mem; @@ -273,6 +284,20 @@ inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) return (void*)atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with); } +#define apr_atomic_read(mem) apr_atomic_read32(mem) +#define apr_atomic_set(mem, val) apr_atomic_set32(mem, val) +#define apr_atomic_add(mem, val) apr_atomic_add32(mem,val) +#define apr_atomic_inc(mem) apr_atomic_inc32(mem) +#define apr_atomic_dec(mem) apr_atomic_dec32(mem) +#define apr_atomic_cas(mem,with,cmp) apr_atomic_cas32(mem,with,cmp) + +#define APR_OVERRIDE_ATOMIC_READ 1 +#define APR_OVERRIDE_ATOMIC_SET 1 +#define APR_OVERRIDE_ATOMIC_ADD 1 +#define APR_OVERRIDE_ATOMIC_INC 1 +#define APR_OVERRIDE_ATOMIC_DEC 1 +#define APR_OVERRIDE_ATOMIC_CAS 1 + #elif defined(__FreeBSD__) #define apr_atomic_t apr_uint32_t From 9c6b2f14910ea25f6c18bd4752e65ebda25ecfd7 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 29 Sep 2003 16:10:08 +0000 Subject: [PATCH 4626/7878] For platforms which have "struct sockaddr_stroage", allow apr_sockaddr_t to be extended in the future whilst retaining binary compatibility across builds with and without IPv6 enabled. * build/apr_network.m4 (APR_CHECK_SOCKADDR_STORAGE): New macro. * configure.in: Use it. * include/apr.h.in: Define APR_HAVE_SA_STORAGE. * include/apr_network_io.h: Add a "struct sockaddr_storage" field to the 'sa' union in apr_sockaddr_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64666 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 20 ++++++++++++++++++++ configure.in | 1 + include/apr.h.in | 1 + include/apr_network_io.h | 5 +++++ 4 files changed, 27 insertions(+) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 691ef2f6ad2..7f7fbaa95fb 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -640,6 +640,26 @@ else fi ]) +AC_DEFUN(APR_CHECK_SOCKADDR_STORAGE,[ +AC_CACHE_CHECK(for sockaddr_storage, apr_cv_define_sockaddr_storage,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +],[struct sockaddr_storage sa;], +[apr_cv_define_sockaddr_storage=yes], +[apr_cv_define_sockaddr_storage=no])]) + +if test "$apr_cv_define_sockaddr_storage" = "yes"; then + have_sa_storage=1 +else + have_sa_storage=0 +fi +AC_SUBST(have_sa_storage) +]) AC_DEFUN(APR_CHECK_SOCKADDR_IN6,[ AC_CACHE_CHECK(for sockaddr_in6, ac_cv_define_sockaddr_in6,[ diff --git a/configure.in b/configure.in index e14cb3c0fae..b0574369c50 100644 --- a/configure.in +++ b/configure.in @@ -1801,6 +1801,7 @@ APR_CHECK_WORKING_GETADDRINFO APR_CHECK_NEGATIVE_EAI APR_CHECK_WORKING_GETNAMEINFO APR_CHECK_SOCKADDR_IN6 +APR_CHECK_SOCKADDR_STORAGE have_ipv6="0" if test "$user_disabled_ipv6" = 1; then diff --git a/include/apr.h.in b/include/apr.h.in index b2cead997d2..e722b6aaeb6 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -230,6 +230,7 @@ extern "C" { #define APR_HAVE_SIGACTION @have_sigaction@ #define APR_HAVE_SIGSUSPEND @have_sigsuspend@ #define APR_HAVE_SIGWAIT @have_sigwait@ +#define APR_HAVE_SA_STORAGE @have_sa_storage@ #define APR_HAVE_STRCASECMP @have_strcasecmp@ #define APR_HAVE_STRDUP @have_strdup@ #define APR_HAVE_STRICMP @have_stricmp@ diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 3cf8d4d5c03..c66a76038ec 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -259,6 +259,11 @@ struct apr_sockaddr_t { #if APR_HAVE_IPV6 /** IPv6 sockaddr structure */ struct sockaddr_in6 sin6; +#endif +#if APR_HAVE_SA_STORAGE + /** Placeholder to ensure that the size of this union is not + * dependent on whether APR_HAVE_IPV6 is defined. */ + struct sockaddr_storage sas; #endif } sa; }; From 6641e0ff5508b3ec7bde0b8dfd0ab4c4882efddc Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 29 Sep 2003 19:38:35 +0000 Subject: [PATCH 4627/7878] Add comments for the sockaddr_{in6,storage} detection macros. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64668 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 7f7fbaa95fb..3eeb889d0ae 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -640,6 +640,7 @@ else fi ]) +dnl Check for presence of struct sockaddr_storage. AC_DEFUN(APR_CHECK_SOCKADDR_STORAGE,[ AC_CACHE_CHECK(for sockaddr_storage, apr_cv_define_sockaddr_storage,[ AC_TRY_COMPILE([ @@ -661,6 +662,7 @@ fi AC_SUBST(have_sa_storage) ]) +dnl Check for presence of struct sockaddr_in6. AC_DEFUN(APR_CHECK_SOCKADDR_IN6,[ AC_CACHE_CHECK(for sockaddr_in6, ac_cv_define_sockaddr_in6,[ AC_TRY_COMPILE([ From 615559dacd0839a9353570c46e2986592197a165 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 30 Sep 2003 17:00:36 +0000 Subject: [PATCH 4628/7878] Go ahead and sync up the API to the prototype since Codewarrior on NetWare won't compile with the mismatch git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64669 13f79535-47bb-0310-9956-ffa450edef68 --- misc/netware/rand.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/misc/netware/rand.c b/misc/netware/rand.c index 44425ea4a54..89a8f7a80ff 100644 --- a/misc/netware/rand.c +++ b/misc/netware/rand.c @@ -62,11 +62,7 @@ #include APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, -#ifdef APR_ENABLE_FOR_1_0 apr_size_t length) -#else - int length) -#endif { return NXSeedRandom(length, buf); } From f59b2c0f9d0b33f338179d88e3ebd3291b3e5d86 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 30 Sep 2003 18:55:00 +0000 Subject: [PATCH 4629/7878] Make sure that the types are correct when the native NetWare atomic API's are called git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64670 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index ac1e9d85b9f..8d6bdca6ad1 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -248,18 +248,16 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); #elif defined(NETWARE) -#define apr_atomic_t unsigned long - #define apr_atomic_init(pool) APR_SUCCESS -#define apr_atomic_add32(mem, val) atomic_add(mem,val) -#define apr_atomic_sub32(mem, val) atomic_sub(mem,val) -#define apr_atomic_inc32(mem) atomic_inc(mem) +#define apr_atomic_add32(mem, val) atomic_add((unsigned long *)(mem),(unsigned long)(val)) +#define apr_atomic_sub32(mem, val) atomic_sub((unsigned long *)(mem),(unsigned long)(val)) +#define apr_atomic_inc32(mem) atomic_inc((unsigned long *)(mem)) #define apr_atomic_set32(mem, val) (*mem = val) #define apr_atomic_read32(mem) (*mem) #define apr_atomic_cas32(mem,with,cmp) atomic_cmpxchg((unsigned long *)(mem),(unsigned long)(cmp),(unsigned long)(with)) -#define apr_atomic_xchg32(mem, val) atomic_xchg(mem, val) +#define apr_atomic_xchg32(mem, val) atomic_xchg((unsigned long *)(mem),(unsigned long)val) -int apr_atomic_dec32(apr_atomic_t *mem); +int apr_atomic_dec32(apr_uint32_t *mem); void *apr_atomic_casptr(void **mem, void *with, const void *cmp); #define APR_OVERRIDE_ATOMIC_READ32 1 @@ -273,9 +271,9 @@ void *apr_atomic_casptr(void **mem, void *with, const void *cmp); #define APR_OVERRIDE_ATOMIC_CASPTR 1 -inline int apr_atomic_dec32(apr_atomic_t *mem) +inline int apr_atomic_dec32(apr_uint32_t *mem) { - atomic_dec(mem); + atomic_dec((unsigned long *)mem); return *mem; } From ce508319484dca5792a953756d772f9d355c996a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 1 Oct 2003 13:19:43 +0000 Subject: [PATCH 4630/7878] * configure.in, build/apr_network.m4: Remove APR_INADDR_NONE macro. * include/apr.hw, include/apr.hnw, include/apr.h.in: Don't define APR_INADDR_NONE here. * include/apr_network_io.h: Define APR_INADDR_NONE here. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64671 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 35 ----------------------------------- configure.in | 2 -- include/apr.h.in | 5 ----- include/apr.hnw | 5 ----- include/apr.hw | 5 ----- include/apr_network_io.h | 10 ++++++++++ 6 files changed, 10 insertions(+), 52 deletions(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 3eeb889d0ae..9ce9aa6de09 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -688,41 +688,6 @@ else fi ]) -dnl -dnl APR_INADDR_NONE -dnl -dnl checks for missing INADDR_NONE macro -dnl -AC_DEFUN(APR_INADDR_NONE,[ - AC_CACHE_CHECK(whether system defines INADDR_NONE, ac_cv_inaddr_none,[ - AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -],[ -unsigned long foo = INADDR_NONE; -],[ - ac_cv_inaddr_none=yes -],[ - ac_cv_inaddr_none=no -])]) - if test "$ac_cv_inaddr_none" = "no"; then - apr_inaddr_none="((unsigned int) 0xffffffff)" - else - apr_inaddr_none="INADDR_NONE" - fi -]) - - dnl dnl APR_H_ERRNO_COMPILE_CHECK dnl diff --git a/configure.in b/configure.in index b0574369c50..8235b162d2a 100644 --- a/configure.in +++ b/configure.in @@ -1021,8 +1021,6 @@ AC_FUNC_SETPGRP APR_CHECK_SOCKLEN_T -APR_INADDR_NONE - dnl Checks for pointer size AC_CHECK_SIZEOF(void*, 4) diff --git a/include/apr.h.in b/include/apr.h.in index e722b6aaeb6..5301d2681ab 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -266,11 +266,6 @@ extern "C" { */ #define APR_FILES_AS_SOCKETS @file_as_socket@ -/* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE - * on all platforms. - */ -#define APR_INADDR_NONE @apr_inaddr_none@ - /* This macro indicates whether or not EBCDIC is the native character set. */ #define APR_CHARSET_EBCDIC @apr_charset_ebcdic@ diff --git a/include/apr.hnw b/include/apr.hnw index 5687d7ee3f5..2cad208f6a7 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -234,11 +234,6 @@ extern "C" { */ #define APR_FILES_AS_SOCKETS 1 -/* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE - * on all platforms. - */ -#define APR_INADDR_NONE INADDR_NONE - /* This macro indicates whether or not EBCDIC is the native character set. */ #define APR_CHARSET_EBCDIC 0 diff --git a/include/apr.hw b/include/apr.hw index 621ea50db46..f61ce9fbfcd 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -333,11 +333,6 @@ extern "C" { */ #define APR_FILES_AS_SOCKETS 0 -/* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE - * on all platforms. - */ -#define APR_INADDR_NONE INADDR_NONE - /* This macro indicates whether or not EBCDIC is the native character set. */ #define APR_CHARSET_EBCDIC 0 diff --git a/include/apr_network_io.h b/include/apr_network_io.h index c66a76038ec..b38fc9dc2a2 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -157,6 +157,16 @@ struct in_addr { }; #endif +/** @def APR_INADDR_NONE + * Not all platforms have a real INADDR_NONE. This macro replaces + * INADDR_NONE on all platforms. + */ +#ifdef INADDR_NONE +#define APR_INADDR_NONE INADDR_NONE +#else +#define APR_INADDR_NONE ((unsigned int) 0xffffffff) +#endif + /** * @def APR_INET * Not all platforms have these defined, so we'll define them here From 01842bf548181a4f902640c82fad5223cfe8016e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 1 Oct 2003 14:11:40 +0000 Subject: [PATCH 4631/7878] * configure.in, build/apr_network.m4: Remove "RESOLV_RETRANSRETRY" detection: the definition is not used inside APR nor exported outside APR. The BIND resolver can be configured via the RES_OPTIONS environment variable or resolv.conf anyway. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64672 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 30 ------------------------------ configure.in | 1 - 2 files changed, 31 deletions(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 9ce9aa6de09..a749ca7d2b9 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -241,36 +241,6 @@ if test "$ac_cv_getnameinfo_ipv4_mapped" = "no"; then fi ]) -dnl -dnl check for presence of retrans/retry variables in the res_state structure -dnl -AC_DEFUN(APR_CHECK_RESOLV_RETRANS,[ - AC_CACHE_CHECK(for presence of retrans/retry fields in res_state/resolv.h , ac_cv_retransretry,[ - AC_TRY_RUN( [ -#include -#if defined(__sun__) -#include -#endif -#include -/* _res is a global defined in resolv.h */ -int main(void) { - _res.retrans = 2; - _res.retry = 1; - exit(0); - return 0; -} -],[ - ac_cv_retransretry="yes" -],[ - ac_cv_retransretry="no" -],[ - ac_cv_retransretry="no" -])]) -if test "$ac_cv_retransretry" = "yes"; then - AC_DEFINE(RESOLV_RETRANSRETRY, 1, [Define if resolv.h's res_state has the fields retrans/rety]) -fi -]) - dnl dnl Checks the definition of gethostbyname_r and gethostbyaddr_r dnl which are different for glibc, solaris and assorted other operating diff --git a/configure.in b/configure.in index 8235b162d2a..027e8723bb7 100644 --- a/configure.in +++ b/configure.in @@ -1774,7 +1774,6 @@ AC_SUBST(acceptfilter) AC_SUBST(have_sctp) AC_CHECK_FUNCS(set_h_errno) -APR_CHECK_RESOLV_RETRANS echo "${nl}Checking for IPv6 Networking support..." dnl Start of checking for IPv6 support... From 4b1f3a0754912022a22ec640f4e708dde7070974 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 1 Oct 2003 17:06:42 +0000 Subject: [PATCH 4632/7878] * configure.in: Only look for hstrerror if IPv6 is not enabled; avoid linking against libresolv unless it is needed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64673 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 027e8723bb7..e30d6c60e42 100644 --- a/configure.in +++ b/configure.in @@ -457,7 +457,6 @@ dnl Note: Autoconf will always append LIBS with an extra " " in AC_CHECK_LIB. dnl It should check for LIBS being empty and set LIBS equal to the new value dnl without the extra " " in that case, but they didn't do that. So, we dnl end up LIBS="-lm -lcrypt -lnsl -ldl" which is an annoyance. -AC_CHECK_LIB(resolv, res_init) AC_CHECK_LIB(nsl, gethostbyname) AC_SEARCH_LIBS(gethostname, nsl) AC_CHECK_LIB(socket, socket) @@ -866,7 +865,7 @@ if test "$native_mmap_emul" = "1"; then mmap="1" fi AC_CHECK_FUNCS(memmove, [ have_memmove="1" ], [have_memmove="0" ]) -AC_CHECK_FUNCS([getpass getpassphrase gmtime_r localtime_r hstrerror mkstemp]) +AC_CHECK_FUNCS([getpass getpassphrase gmtime_r localtime_r mkstemp]) AC_SUBST(fork) AC_SUBST(have_inet_addr) @@ -1831,6 +1830,13 @@ AC_MSG_RESULT($ipv6_result) AC_SUBST(have_ipv6) +# hstrerror is only needed if IPv6 is not enabled, +# so getaddrinfo/gai_strerror are not used. +if test $have_ipv6 = 0; then + AC_CHECK_LIB(hstrerror, resolv) + AC_CHECK_FUNCS(hstrerror) +fi + dnl Check for langinfo support AC_CHECK_HEADERS(langinfo.h) From afe1d8b87f6d868452166c0ec7c8c1095fa6627e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 1 Oct 2003 17:36:37 +0000 Subject: [PATCH 4633/7878] * configure.in: Fix and simplify check for hstrerror in previous commit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64674 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index e30d6c60e42..61af1afa062 100644 --- a/configure.in +++ b/configure.in @@ -1833,8 +1833,8 @@ AC_SUBST(have_ipv6) # hstrerror is only needed if IPv6 is not enabled, # so getaddrinfo/gai_strerror are not used. if test $have_ipv6 = 0; then - AC_CHECK_LIB(hstrerror, resolv) - AC_CHECK_FUNCS(hstrerror) + AC_SEARCH_LIBS(hstrerror, resolv, + [AC_DEFINE(HAVE_HSTRERROR, 1, [Define if hstrerror is present])]) fi dnl Check for langinfo support From 7e0933eb48ac9297e221083ff020b2582fc0b7cc Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 1 Oct 2003 21:08:17 +0000 Subject: [PATCH 4634/7878] * configure.in, include/apr.h.in, include/apr.hw, include/apr.hnw: Remove definitions of APR_INT64_T_FMT_LEN, APR_UINT64_T_FMT_LEN and APR_UINT64_T_HEX_FMT_LEN. Die at configure-time if a 64-bit integer type is not found rather than placing "#error"s in apr.h. * strings/apr_snprintf.c (apr_vformatter): Rework to use sizeof() rather than APR_INT64_T_FMT_LEN. One (intensional) functional change, for the sizeof(int) == 8 case: previously the first if condition would always be true since strncmp(a, b, 0) == 0; now the condition will always be false. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64675 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 19 +------------------ include/apr.h.in | 3 --- include/apr.hnw | 3 --- include/apr.hw | 3 --- strings/apr_snprintf.c | 20 ++++++++++---------- 5 files changed, 11 insertions(+), 37 deletions(-) diff --git a/configure.in b/configure.in index 61af1afa062..0e21f9ea2be 100644 --- a/configure.in +++ b/configure.in @@ -1048,9 +1048,7 @@ fi if test "$ac_cv_sizeof_int" = "8"; then int64_literal='#define APR_INT64_C(val) (val)' int64_t_fmt='#define APR_INT64_T_FMT "d"' - int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 1' uint64_t_fmt='#define APR_UINT64_T_FMT "u"' - uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 1' uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "x"' int64_value="int" long_value=int @@ -1058,9 +1056,7 @@ if test "$ac_cv_sizeof_int" = "8"; then elif test "$ac_cv_sizeof_long" = "8"; then int64_literal='#define APR_INT64_C(val) (val##L)' int64_t_fmt='#define APR_INT64_T_FMT "ld"' - int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' uint64_t_fmt='#define APR_UINT64_T_FMT "lu"' - uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 2' uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "lx"' int64_value="long" long_value=long @@ -1072,9 +1068,7 @@ elif test "$ac_cv_sizeof_long_long" = "8"; then # doesn't support 'q'. Solaris wins. Exceptions can # go to the OS-dependent section. int64_t_fmt='#define APR_INT64_T_FMT "lld"' - int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 3' uint64_t_fmt='#define APR_UINT64_T_FMT "llu"' - uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 3' uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "llx"' int64_value="long long" long_value="long long" @@ -1082,9 +1076,7 @@ elif test "$ac_cv_sizeof_long_long" = "8"; then elif test "$ac_cv_sizeof_long_double" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LD)' int64_t_fmt='#define APR_INT64_T_FMT "Ld"' - int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' uint64_t_fmt='#define APR_UINT64_T_FMT "Lu"' - uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 2' uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "Lx"' int64_value="long double" long_value="long double" @@ -1092,9 +1084,7 @@ elif test "$ac_cv_sizeof_long_double" = "8"; then elif test "$ac_cv_sizeof_longlong" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LL)' int64_t_fmt='#define APR_INT64_T_FMT "qd"' - int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2' uint64_t_fmt='#define APR_UINT64_T_FMT "qu"' - uint64_t_fmt_len='#define APR_UINT64_T_FMT_LEN 2' uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "qx"' int64_value="__int64" long_value="__int64" @@ -1102,12 +1092,7 @@ elif test "$ac_cv_sizeof_longlong" = "8"; then else # int64_literal may be overriden if your compiler thinks you have # a 64-bit value but APR does not agree. - int64_literal='#error Can not determine the proper size for apr_int64_t' - int64_t_fmt='#error Can not determine the proper size for apr_int64_t' - int64_t_fmt_len='#error Can not determine the proper size for apr_int64_t' - uint64_t_fmt='#error Can not determine the proper size for apr_int64_t' - uint64_t_fmt_len='#error Can not determine the proper size for apr_int64_t' - uint64_t_hex_fmt='#error Can not determine the proper size for apr_uint64_t' + AC_ERROR([could not detect a 64-bit integer type]) fi # If present, allow the C99 macro INT64_C to override our conversion. @@ -1245,9 +1230,7 @@ AC_SUBST(size_t_value) AC_SUBST(ssize_t_value) AC_SUBST(socklen_t_value) AC_SUBST(int64_t_fmt) -AC_SUBST(int64_t_fmt_len) AC_SUBST(uint64_t_fmt) -AC_SUBST(uint64_t_fmt_len) AC_SUBST(uint64_t_hex_fmt) AC_SUBST(ssize_t_fmt) AC_SUBST(size_t_fmt) diff --git a/include/apr.h.in b/include/apr.h.in index 5301d2681ab..fe15ca1fd91 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -384,15 +384,12 @@ typedef @socklen_t_value@ apr_socklen_t; /* And APR_INT64_T_FMT */ @int64_t_fmt@ -@int64_t_fmt_len@ /* And APR_UINT64_T_FMT */ @uint64_t_fmt@ -@uint64_t_fmt_len@ /* And APR_UINT64_T_HEX_FMT */ @uint64_t_hex_fmt@ -#define APR_UINT64_T_HEX_FMT_LEN (sizeof(APR_UINT64_T_HEX_FMT) - 1) /* Deal with atoi64 variables ... these should move to apr_private.h */ #define APR_HAVE_INT64_STRFN @have_int64_strfn@ diff --git a/include/apr.hnw b/include/apr.hnw index 2cad208f6a7..8a150b76e60 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -354,11 +354,8 @@ typedef int apr_wait_t; #define APR_PATH_MAX PATH_MAX #define APR_INT64_T_FMT "lld" -#define APR_INT64_T_FMT_LEN 3 #define APR_UINT64_T_FMT "llu" -#define APR_UINT64_T_FMT_LEN 3 #define APR_UINT64_T_HEX_FMT "llx" -#define APR_UINT64_T_HEX_FMT_LEN (sizeof(APR_UINT64_T_HEX_FMT) - 1) #define APR_TIME_T_FMT APR_INT64_T_FMT /* Deal with atoi64 variables ... these should move to apr_private.h */ diff --git a/include/apr.hw b/include/apr.hw index f61ce9fbfcd..cc02a608769 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -495,11 +495,8 @@ typedef int gid_t; #define APR_PID_T_FMT "d" #define APR_INT64_T_FMT "I64d" -#define APR_INT64_T_FMT_LEN 4 #define APR_UINT64_T_FMT "I64u" -#define APR_UINT64_T_FMT_LEN 4 #define APR_UINT64_T_HEX_FMT "I64x" -#define APR_UINT64_T_HEX_FMT_LEN (sizeof(APR_UINT64_T_HEX_FMT) - 1) /* Deal with atoi64 variables ... these should move to apr_private.h */ /* MSVC 7.0 introduced _strtoui64 */ diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index cab36593642..7ac3d9b4796 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -838,17 +838,17 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), adjust_precision = adjust_width = NO; /* - * Modifier check + * Modifier check. Note that if APR_INT64_T_FMT is "d", + * the first if condition is never true. */ -#if defined(APR_INT64_T_FMT_LEN) && (APR_INT64_T_FMT_LEN == 3) - if ((*fmt == APR_INT64_T_FMT[0]) && - (fmt[1] == APR_INT64_T_FMT[1])) { -#elif defined(APR_INT64_T_FMT_LEN) && (APR_INT64_T_FMT_LEN == 2) - if (*fmt == APR_INT64_T_FMT[0]) { -#else - if (strncmp(fmt, APR_INT64_T_FMT, - sizeof(APR_INT64_T_FMT) - 2) == 0) { -#endif + if ((sizeof(APR_INT64_T_FMT) == 4 && + fmt[0] == APR_INT64_T_FMT[0] && + fmt[1] == APR_INT64_T_FMT[1]) || + (sizeof(APR_INT64_T_FMT) == 3 && + fmt[0] == APR_INT64_T_FMT[0]) || + (sizeof(APR_INT64_T_FMT) > 4 && + strncmp(fmt, APR_INT64_T_FMT, + sizeof(APR_INT64_T_FMT) - 2) == 0)) { /* Need to account for trailing 'd' and null in sizeof() */ var_type = IS_QUAD; fmt += (sizeof(APR_INT64_T_FMT) - 2); From a83759d37e216cc18768f90c6030e3ff55edc4ef Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 2 Oct 2003 14:48:45 +0000 Subject: [PATCH 4635/7878] Remove an unused system import from the NetWare build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64676 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 - include/arch/netware/apr_arch_file_io.h | 2 -- misc/netware/aprlib.def | 1 - 3 files changed, 4 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index 3f1083a032b..8e7ac9ae123 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -221,7 +221,6 @@ FILES_nlm_Ximports = \ @libc.imp \ @ws2nlm.imp \ @netware.imp \ - CpuCurrentProcessor \ $(EOLIST) # diff --git a/include/arch/netware/apr_arch_file_io.h b/include/arch/netware/apr_arch_file_io.h index 7779c2c208b..e17a7004edc 100644 --- a/include/arch/netware/apr_arch_file_io.h +++ b/include/arch/netware/apr_arch_file_io.h @@ -147,8 +147,6 @@ struct apr_stat_entry_t { NXPathCtx_t pathCtx; }; -extern apr_int32_t CpuCurrentProcessor; /* system variable */ - #define MAX_SERVER_NAME 64 #define MAX_VOLUME_NAME 64 #define MAX_PATH_NAME 256 diff --git a/misc/netware/aprlib.def b/misc/netware/aprlib.def index 973612427ba..0a2a01eb8f3 100644 --- a/misc/netware/aprlib.def +++ b/misc/netware/aprlib.def @@ -1,4 +1,3 @@ MODULE LIBC.NLM MODULE WS2_32.NLM -IMPORT CpuCurrentProcessor EXPORT @aprlib.imp From 4c8cf615b2a02b34bd1610d1c77c6e43e1bacd3e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 3 Oct 2003 13:37:34 +0000 Subject: [PATCH 4636/7878] Document operations which give undefined results in a POSIX threads implementation. Fix spelling mistakes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64678 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_thread_rwlock.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/include/apr_thread_rwlock.h b/include/apr_thread_rwlock.h index 26873793158..e5533fc9f4e 100644 --- a/include/apr_thread_rwlock.h +++ b/include/apr_thread_rwlock.h @@ -79,6 +79,15 @@ extern "C" { /** Opaque read-write thread-safe lock. */ typedef struct apr_thread_rwlock_t apr_thread_rwlock_t; +/** + * Note: The following operations have undefined results: unlocking a + * read-write lock which is not locked in the calling thread; write + * locking a read-write lock which is already locked by the calling + * thread; destroying a read-write lock more than once; clearing or + * destroying the pool from which a locked read-write lock is + * allocated. + */ + /** * Create and initialize a read-write lock that can be used to synchronize * threads. @@ -97,10 +106,10 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock); /** - * Attempt to acquire the shread-read lock on the given read-write lock. This - * is the same as apr_thread_rwlock_rdlock(), only that the funtion fails + * Attempt to acquire the shared-read lock on the given read-write lock. This + * is the same as apr_thread_rwlock_rdlock(), only that the function fails * if there is another thread holding the write lock, or if there are any - * write threads blocking on the lock. If the function failes for this case, + * write threads blocking on the lock. If the function fails for this case, * APR_EBUSY will be returned. Note: it is important that the * APR_STATUS_IS_EBUSY(s) macro be used to determine if the return value was * APR_EBUSY, for portability reasons. @@ -111,7 +120,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwloc /** * Acquire an exclusive-write lock on the given read-write lock. This will * allow only one single thread to enter the critical sections. If there - * are any threads currently holding thee read-lock, this thread is put to + * are any threads currently holding the read-lock, this thread is put to * sleep until it can have exclusive access to the lock. * @param rwlock the read-write lock on which to acquire the exclusive write. */ @@ -119,7 +128,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock); /** * Attempt to acquire the exclusive-write lock on the given read-write lock. - * This is the same as apr_thread_rwlock_wrlock(), only that the funtion fails + * This is the same as apr_thread_rwlock_wrlock(), only that the function fails * if there is any other thread holding the lock (for reading or writing), * in which case the function will return APR_EBUSY. Note: it is important * that the APR_STATUS_IS_EBUSY(s) macro be used to determine if the return From 87a73fb2762d4d2085b3e14adc6522f1b6c42865 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 3 Oct 2003 15:14:38 +0000 Subject: [PATCH 4637/7878] To produce results which are defined by POSIX, at time of cleanup the rwlock must be initialized but not locked by any thread. Accordingly, remove code which POSIX says gives undefined results: * locks/unix/thread_rwlock.c (thread_rwlock_cleanup): Don't unlock an unlocked lock. (apr_thread_rwlock_create): Don't destroy an uninitialized lock if _init fails. (apr_thread_rwlock_destroy): If cleanup fails, the lock must be in a bad state, so don't run cleanup again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64679 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_rwlock.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c index acbfceb50a1..056f5872132 100644 --- a/locks/unix/thread_rwlock.c +++ b/locks/unix/thread_rwlock.c @@ -59,12 +59,13 @@ #ifdef HAVE_PTHREAD_RWLOCK_INIT +/* The rwlock must be initialized but not locked by any thread when + * cleanup is called. */ static apr_status_t thread_rwlock_cleanup(void *data) { apr_thread_rwlock_t *rwlock = (apr_thread_rwlock_t *)data; apr_status_t stat; - pthread_rwlock_unlock(rwlock->rwlock); stat = pthread_rwlock_destroy(rwlock->rwlock); #ifdef PTHREAD_SETS_ERRNO if (stat) { @@ -99,7 +100,6 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, #ifdef PTHREAD_SETS_ERRNO stat = errno; #endif - thread_rwlock_cleanup(new_rwlock); return stat; } @@ -184,11 +184,8 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) { - apr_status_t stat; - if ((stat = thread_rwlock_cleanup(rwlock)) == APR_SUCCESS) { - apr_pool_cleanup_kill(rwlock->pool, rwlock, thread_rwlock_cleanup); - return APR_SUCCESS; - } + apr_status_t stat = thread_rwlock_cleanup(rwlock); + apr_pool_cleanup_kill(rwlock->pool, rwlock, thread_rwlock_cleanup); return stat; } From 948a902e1968b987a980db247bb39b714f990d44 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 3 Oct 2003 15:30:57 +0000 Subject: [PATCH 4638/7878] * locks/unix/thread_rwlock.c (apr_thread_rwlock_destroy): Simplify to use apr_pool_cleanup_run. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64680 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_rwlock.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c index 056f5872132..ad26e94883b 100644 --- a/locks/unix/thread_rwlock.c +++ b/locks/unix/thread_rwlock.c @@ -184,9 +184,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) { - apr_status_t stat = thread_rwlock_cleanup(rwlock); - apr_pool_cleanup_kill(rwlock->pool, rwlock, thread_rwlock_cleanup); - return stat; + return apr_pool_cleanup_run(rwlock->pool, rwlock, thread_rwlock_cleanup); } #else /* HAVE_PTHREAD_RWLOCK_INIT */ From f583ff8cd851ce6c85c98f75d489caeae0161c49 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 4 Oct 2003 11:46:24 +0000 Subject: [PATCH 4639/7878] * include/arch/unix/apr_arch_thread_rwlock.h: Store a pthread_rwlock_t object in struct apr_thread_rwlock_t rather than a pointer to one. * locks/unix/thread_rwlock.c (apr_thread_rwlock_create): Adjust use of ->rwlock, simplify to a single palloc call, and remove ENOMEM handling. (apr_thread_rwlock_rdlock, apr_thread_rwlock_tryrdlock, apr_thread_rwlock_wrlock, apr_thread_rwlock_trywrlock, apr_thread_rwlock_unlock): Adjust use of ->rwlock appropriately. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64681 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_thread_rwlock.h | 2 +- locks/unix/thread_rwlock.c | 28 +++++++--------------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/include/arch/unix/apr_arch_thread_rwlock.h b/include/arch/unix/apr_arch_thread_rwlock.h index c19cd371053..db69404804a 100644 --- a/include/arch/unix/apr_arch_thread_rwlock.h +++ b/include/arch/unix/apr_arch_thread_rwlock.h @@ -71,7 +71,7 @@ struct apr_thread_rwlock_t { apr_pool_t *pool; - pthread_rwlock_t *rwlock; + pthread_rwlock_t rwlock; }; #else diff --git a/locks/unix/thread_rwlock.c b/locks/unix/thread_rwlock.c index ad26e94883b..55a45e0fdb9 100644 --- a/locks/unix/thread_rwlock.c +++ b/locks/unix/thread_rwlock.c @@ -66,7 +66,7 @@ static apr_status_t thread_rwlock_cleanup(void *data) apr_thread_rwlock_t *rwlock = (apr_thread_rwlock_t *)data; apr_status_t stat; - stat = pthread_rwlock_destroy(rwlock->rwlock); + stat = pthread_rwlock_destroy(&rwlock->rwlock); #ifdef PTHREAD_SETS_ERRNO if (stat) { stat = errno; @@ -81,22 +81,10 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, apr_thread_rwlock_t *new_rwlock; apr_status_t stat; - new_rwlock = (apr_thread_rwlock_t *)apr_pcalloc(pool, - sizeof(apr_thread_rwlock_t)); - - if (new_rwlock == NULL) { - return APR_ENOMEM; - } - + new_rwlock = apr_palloc(pool, sizeof(apr_thread_rwlock_t)); new_rwlock->pool = pool; - new_rwlock->rwlock = (pthread_rwlock_t *)apr_palloc(pool, - sizeof(pthread_rwlock_t)); - - if (new_rwlock->rwlock == NULL) { - return APR_ENOMEM; - } - if ((stat = pthread_rwlock_init(new_rwlock->rwlock, NULL))) { + if ((stat = pthread_rwlock_init(&new_rwlock->rwlock, NULL))) { #ifdef PTHREAD_SETS_ERRNO stat = errno; #endif @@ -115,7 +103,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) { apr_status_t stat; - stat = pthread_rwlock_rdlock(rwlock->rwlock); + stat = pthread_rwlock_rdlock(&rwlock->rwlock); #ifdef PTHREAD_SETS_ERRNO if (stat) { stat = errno; @@ -128,7 +116,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwloc { apr_status_t stat; - stat = pthread_rwlock_tryrdlock(rwlock->rwlock); + stat = pthread_rwlock_tryrdlock(&rwlock->rwlock); #ifdef PTHREAD_SETS_ERRNO if (stat) { stat = errno; @@ -144,7 +132,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) { apr_status_t stat; - stat = pthread_rwlock_wrlock(rwlock->rwlock); + stat = pthread_rwlock_wrlock(&rwlock->rwlock); #ifdef PTHREAD_SETS_ERRNO if (stat) { stat = errno; @@ -157,7 +145,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwloc { apr_status_t stat; - stat = pthread_rwlock_trywrlock(rwlock->rwlock); + stat = pthread_rwlock_trywrlock(&rwlock->rwlock); #ifdef PTHREAD_SETS_ERRNO if (stat) { stat = errno; @@ -173,7 +161,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) { apr_status_t stat; - stat = pthread_rwlock_unlock(rwlock->rwlock); + stat = pthread_rwlock_unlock(&rwlock->rwlock); #ifdef PTHREAD_SETS_ERRNO if (stat) { stat = errno; From fc1aeae6a9cde4b4de82aee8350666adc365bcc7 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sat, 4 Oct 2003 11:56:50 +0000 Subject: [PATCH 4640/7878] * test/testrand.c (rand_exists): Don't ask for so much random data. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64682 13f79535-47bb-0310-9956-ffa450edef68 --- test/testrand.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/testrand.c b/test/testrand.c index 5d614791897..13fa08e7b79 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -63,17 +63,13 @@ static void rand_exists(CuTest *tc) #if !APR_HAS_RANDOM CuNotImpl(tc, "apr_generate_random_bytes"); #else - apr_status_t rv; - unsigned char c[2048]; - int i; + unsigned char c[42]; /* There must be a better way to test random-ness, but I don't know * what it is right now. */ - for (i = 1; i <= 8; i++) { - rv = apr_generate_random_bytes(c, i * 255); - apr_assert_success(tc, "apr_generate_random_bytes failed", rv); - } + apr_assert_success(tc, "apr_generate_random_bytes failed", + apr_generate_random_bytes(c, sizeof c)); #endif } From dd22b7c942ae73d3e65918fa867720de449e8ac0 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 5 Oct 2003 10:48:26 +0000 Subject: [PATCH 4641/7878] * test/testfileinfo.c (finfo_equal, test_stat_eq_finfo): Avoid triggering a gcc 2.9x structure passing bug on IA64 Linux by passing pointers to structures git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64683 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfileinfo.c | 60 ++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/test/testfileinfo.c b/test/testfileinfo.c index 3a7073b5320..6788d5c185f 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -86,59 +86,59 @@ static const struct view_fileinfo {0, NULL} }; -static void finfo_equal(CuTest *tc, apr_finfo_t f1, apr_finfo_t f2) +static void finfo_equal(CuTest *tc, apr_finfo_t *f1, apr_finfo_t *f2) { /* Minimum supported flags across all platforms (APR_FINFO_MIN) */ CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_TYPE", - (f1.valid & f2.valid & APR_FINFO_TYPE)); + (f1->valid & f2->valid & APR_FINFO_TYPE)); CuAssert(tc, "apr_stat and apr_getfileinfo differ in filetype", - f1.filetype == f2.filetype); + f1->filetype == f2->filetype); CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_SIZE", - (f1.valid & f2.valid & APR_FINFO_SIZE)); + (f1->valid & f2->valid & APR_FINFO_SIZE)); CuAssert(tc, "apr_stat and apr_getfileinfo differ in size", - f1.size == f2.size); + f1->size == f2->size); CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_ATIME", - (f1.valid & f2.valid & APR_FINFO_ATIME)); + (f1->valid & f2->valid & APR_FINFO_ATIME)); CuAssert(tc, "apr_stat and apr_getfileinfo differ in atime", - f1.atime == f2.atime); + f1->atime == f2->atime); CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_MTIME", - (f1.valid & f2.valid & APR_FINFO_MTIME)); + (f1->valid & f2->valid & APR_FINFO_MTIME)); CuAssert(tc, "apr_stat and apr_getfileinfo differ in mtime", - f1.mtime == f2.mtime); + f1->mtime == f2->mtime); CuAssert(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_CTIME", - (f1.valid & f2.valid & APR_FINFO_CTIME)); + (f1->valid & f2->valid & APR_FINFO_CTIME)); CuAssert(tc, "apr_stat and apr_getfileinfo differ in ctime", - f1.ctime == f2.ctime); + f1->ctime == f2->ctime); - if (f1.valid & f2.valid & APR_FINFO_NAME) + if (f1->valid & f2->valid & APR_FINFO_NAME) CuAssert(tc, "apr_stat and apr_getfileinfo differ in name", - !strcmp(f1.name, f2.name)); - if (f1.fname && f2.fname) + !strcmp(f1->name, f2->name)); + if (f1->fname && f2->fname) CuAssert(tc, "apr_stat and apr_getfileinfo differ in fname", - !strcmp(f1.fname, f2.fname)); + !strcmp(f1->fname, f2->fname)); /* Additional supported flags not supported on all platforms */ - if (f1.valid & f2.valid & APR_FINFO_USER) + if (f1->valid & f2->valid & APR_FINFO_USER) CuAssert(tc, "apr_stat and apr_getfileinfo differ in user", - !apr_uid_compare(f1.user, f2.user)); - if (f1.valid & f2.valid & APR_FINFO_GROUP) + !apr_uid_compare(f1->user, f2->user)); + if (f1->valid & f2->valid & APR_FINFO_GROUP) CuAssert(tc, "apr_stat and apr_getfileinfo differ in group", - !apr_gid_compare(f1.group, f2.group)); - if (f1.valid & f2.valid & APR_FINFO_INODE) + !apr_gid_compare(f1->group, f2->group)); + if (f1->valid & f2->valid & APR_FINFO_INODE) CuAssert(tc, "apr_stat and apr_getfileinfo differ in inode", - f1.inode == f2.inode); - if (f1.valid & f2.valid & APR_FINFO_DEV) + f1->inode == f2->inode); + if (f1->valid & f2->valid & APR_FINFO_DEV) CuAssert(tc, "apr_stat and apr_getfileinfo differ in device", - f1.device == f2.device); - if (f1.valid & f2.valid & APR_FINFO_NLINK) + f1->device == f2->device); + if (f1->valid & f2->valid & APR_FINFO_NLINK) CuAssert(tc, "apr_stat and apr_getfileinfo differ in nlink", - f1.nlink == f2.nlink); - if (f1.valid & f2.valid & APR_FINFO_CSIZE) + f1->nlink == f2->nlink); + if (f1->valid & f2->valid & APR_FINFO_CSIZE) CuAssert(tc, "apr_stat and apr_getfileinfo differ in csize", - f1.csize == f2.csize); - if (f1.valid & f2.valid & APR_FINFO_PROT) + f1->csize == f2->csize); + if (f1->valid & f2->valid & APR_FINFO_PROT) CuAssert(tc, "apr_stat and apr_getfileinfo differ in protection", - f1.protection == f2.protection); + f1->protection == f2->protection); } static void test_info_get(CuTest *tc) @@ -206,7 +206,7 @@ static void test_stat_eq_finfo(CuTest *tc) apr_file_close(thefile); - finfo_equal(tc, stat_finfo, finfo); + finfo_equal(tc, &stat_finfo, &finfo); } static void test_buffered_write_size(CuTest *tc) From 848305273d0bbe6f2583fc62004bfd9c6a407fd0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 14 Oct 2003 23:47:29 +0000 Subject: [PATCH 4642/7878] Implement apr_socket_atmark, similar to socket_atmark except 1) it's portable, and 2) the return value is passed by a boolean (int) ref, with errors returned as an apr_status_t. The question is, how portable? sys/sockio.h seems sufficent for me on hp/ux, solaris, linux, osx, and this works on Win32. The Netware and OS2 implementations are best guesses. Submitted by: Jim Jagielski and William Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64684 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 ++ include/apr.h.in | 1 + include/apr.hnw | 1 + include/apr.hw | 1 + include/apr_network_io.h | 9 +++++++++ include/arch/unix/apr_arch_networkio.h | 3 +++ network_io/os2/sockopt.c | 13 +++++++++++++ network_io/unix/sockopt.c | 14 ++++++++++++++ network_io/win32/sockopt.c | 13 +++++++++++++ 9 files changed, 57 insertions(+) diff --git a/configure.in b/configure.in index 0e21f9ea2be..4321b190622 100644 --- a/configure.in +++ b/configure.in @@ -939,6 +939,7 @@ APR_FLAG_HEADERS( sys/sendfile.h \ sys/signal.h \ sys/socket.h \ + sys/sockio.h \ sys/stat.h \ sys/sysctl.h \ sys/syslimits.h \ @@ -988,6 +989,7 @@ AC_SUBST(stringsh) AC_SUBST(sys_sendfileh) AC_SUBST(sys_signalh) AC_SUBST(sys_socketh) +AC_SUBST(sys_sockioh) AC_SUBST(sys_typesh) AC_SUBST(sys_timeh) AC_SUBST(sys_uioh) diff --git a/include/apr.h.in b/include/apr.h.in index fe15ca1fd91..4bd5c4b9a47 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -130,6 +130,7 @@ #define APR_HAVE_SYS_SENDFILE_H @sys_sendfileh@ #define APR_HAVE_SYS_SIGNAL_H @sys_signalh@ #define APR_HAVE_SYS_SOCKET_H @sys_socketh@ +#define APR_HAVE_SYS_SOCKIO_H @sys_sockioh@ #define APR_HAVE_SYS_SYSLIMITS_H @sys_syslimitsh@ #define APR_HAVE_SYS_TIME_H @sys_timeh@ #define APR_HAVE_SYS_TYPES_H @sys_typesh@ diff --git a/include/apr.hnw b/include/apr.hnw index 8a150b76e60..e93175dbdf8 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -143,6 +143,7 @@ extern "C" { #define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 +#define APR_HAVE_SYS_SOCKIO_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 #define APR_HAVE_SYS_TIME_H 0 #define APR_HAVE_SYS_TYPES_H 1 diff --git a/include/apr.hw b/include/apr.hw index cc02a608769..1ba302b319e 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -171,6 +171,7 @@ #define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 +#define APR_HAVE_SYS_SOCKIO_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 #define APR_HAVE_SYS_TIME_H 0 #define APR_HAVE_SYS_TYPES_H 1 diff --git a/include/apr_network_io.h b/include/apr_network_io.h index b38fc9dc2a2..52061d4f3fd 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -661,6 +661,15 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t); +/** + * Query the specified socket if at the OOB/Urgent data mark + * @param sock The socket to query + * @param atmark Is set to true if socket is at the OOB/urgent mark, + * otherwise is set to false. + */ +APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, + int *atmark); + /** * Return an apr_sockaddr_t from an apr_socket_t * @param sa The returned apr_sockaddr_t. diff --git a/include/arch/unix/apr_arch_networkio.h b/include/arch/unix/apr_arch_networkio.h index 8250324a086..bcce4fc534a 100644 --- a/include/arch/unix/apr_arch_networkio.h +++ b/include/arch/unix/apr_arch_networkio.h @@ -102,6 +102,9 @@ #if APR_HAVE_SYS_SOCKET_H #include #endif +#if APR_HAVE_SYS_SOCKIO_H +#include +#endif #if APR_HAVE_NETDB_H #include #endif diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 70bb4c0781e..0b11f202d24 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -156,6 +156,19 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, } +APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark) +{ + int oobmark; + + if (ioctl(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0) + return APR_OS2_STATUS(sock_errno());; + + *atmark = (oobmark != 0); + + return APR_SUCCESS; +} + + APR_DECLARE(apr_status_t) apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index cc181b6aac5..b4ac81e6064 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -55,6 +55,7 @@ #include "apr_arch_networkio.h" #include "apr_strings.h" + static apr_status_t soblock(int sd) { /* BeOS uses setsockopt at present for non blocking... */ @@ -369,6 +370,19 @@ apr_status_t apr_socket_opt_get(apr_socket_t *sock, } +apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark) +{ + int oobmark; + + if (ioctl(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0) + return apr_get_netos_error(); + + *atmark = (oobmark != 0); + + return APR_SUCCESS; +} + + apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { if (gethostname(buf, len) == -1) { diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index e86c6b8b279..4849bd8797a 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -262,6 +262,19 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, } +APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark) +{ + u_long oobmark; + + if (ioctlsocket(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0) + return apr_get_netos_error(); + + *atmark = (oobmark != 0); + + return APR_SUCCESS; +} + + APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont) { From 318b0c0eb9d2e28ae88fbe563cb0c19496b5ac1f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 15 Oct 2003 13:34:26 +0000 Subject: [PATCH 4643/7878] need for SIOCATMARK on at least AIX and z/OS (OS/390 (MVS)) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64685 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.h.in | 1 + include/arch/unix/apr_arch_networkio.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/apr.h.in b/include/apr.h.in index 4bd5c4b9a47..0cba978fe3a 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -127,6 +127,7 @@ #define APR_HAVE_STDLIB_H @stdlibh@ #define APR_HAVE_STRING_H @stringh@ #define APR_HAVE_STRINGS_H @stringsh@ +#define APR_HAVE_SYS_IOCTL_H @sys_ioctlh@ #define APR_HAVE_SYS_SENDFILE_H @sys_sendfileh@ #define APR_HAVE_SYS_SIGNAL_H @sys_signalh@ #define APR_HAVE_SYS_SOCKET_H @sys_socketh@ diff --git a/include/arch/unix/apr_arch_networkio.h b/include/arch/unix/apr_arch_networkio.h index bcce4fc534a..917d17f8238 100644 --- a/include/arch/unix/apr_arch_networkio.h +++ b/include/arch/unix/apr_arch_networkio.h @@ -114,6 +114,9 @@ #if APR_HAVE_SYS_SENDFILE_H #include #endif +#if APR_HAVE_SYS_IOCTL_H +#include +#endif /* End System Headers */ #ifndef HAVE_POLLIN From 97d7eb68c99562b769fe1ec1c9e19f8d7a9b6d7d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 15 Oct 2003 13:36:12 +0000 Subject: [PATCH 4644/7878] need for SIOCATMARK on at least AIX and z/OS (OS/390 (MVS)) (should have been in previous commit of apr.h.in, but got bit by bug in old cvs client) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64686 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index 4321b190622..f14216b30bd 100644 --- a/configure.in +++ b/configure.in @@ -931,6 +931,7 @@ APR_FLAG_HEADERS( netinet/sctp.h \ netinet/sctp_uio.h \ sys/file.h \ + sys/ioctl.h \ sys/mman.h \ sys/poll.h \ sys/resource.h \ @@ -986,6 +987,7 @@ AC_SUBST(stdioh) AC_SUBST(stdlibh) AC_SUBST(stringh) AC_SUBST(stringsh) +AC_SUBST(sys_ioctlh) AC_SUBST(sys_sendfileh) AC_SUBST(sys_signalh) AC_SUBST(sys_socketh) From 84c6d37e5343394a04345ae312ea129643677368 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 15 Oct 2003 20:39:34 +0000 Subject: [PATCH 4645/7878] Nothing to initialize on win32, this sure looks like the right answer for atomics. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64687 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 8d6bdca6ad1..8aa95249c7b 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -237,13 +237,13 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); #define apr_atomic_t LONG +#define apr_atomic_init(pool) APR_SUCCESS #define apr_atomic_add(mem, val) InterlockedExchangeAdd(mem,val) #define apr_atomic_dec(mem) InterlockedDecrement(mem) #define apr_atomic_inc(mem) InterlockedIncrement(mem) #define apr_atomic_set(mem, val) InterlockedExchange(mem, val) #define apr_atomic_read(mem) (*mem) #define apr_atomic_cas(mem,with,cmp) InterlockedCompareExchange(mem,with,cmp) - /*#define apr_atomic_init(pool) APR_SUCCESS*/ #define apr_atomic_casptr(mem,with,cmp) InterlockedCompareExchangePointer(mem,with,cmp) #elif defined(NETWARE) From bc3864b0922a055ff6d14fa9de2d3db923418a95 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 15 Oct 2003 20:41:44 +0000 Subject: [PATCH 4646/7878] Time to turn on the protocol member for APR 1.0. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64688 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_portable.h | 2 -- misc/win32/rand.c | 4 ---- network_io/os2/sockets.c | 4 ---- network_io/unix/sockets.c | 4 ---- network_io/win32/sockets.c | 4 ---- 5 files changed, 18 deletions(-) diff --git a/include/apr_portable.h b/include/apr_portable.h index 6f79f45cddf..3b7c9c7184a 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -221,9 +221,7 @@ struct apr_os_sock_info_t { struct sockaddr *remote; /**< NULL if not connected */ int family; /**< always required (APR_INET, APR_INET6, etc.) */ int type; /**< always required (SOCK_STREAM, SOCK_DGRAM, etc.) */ -#ifdef APR_ENABLE_FOR_1_0 /**< enable with APR 1.0 */ int protocol; /**< 0 or actual protocol (APR_PROTO_SCTP, APR_PROTO_TCP, etc.) */ -#endif }; typedef struct apr_os_sock_info_t apr_os_sock_info_t; diff --git a/misc/win32/rand.c b/misc/win32/rand.c index fa43aebd944..29999d61b14 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -61,11 +61,7 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, -#ifdef APR_ENABLE_FOR_1_0 apr_size_t length) -#else - int length) -#endif { HCRYPTPROV hProv; apr_status_t res = APR_SUCCESS; diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 899e312278d..5c13fe39f47 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -283,11 +283,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_pool_t *cont) { alloc_socket(apr_sock, cont); -#ifdef APR_ENABLE_FOR_1_0 /* no protocol field yet */ set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, os_sock_info->protocol); -#else - set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, 0); -#endif (*apr_sock)->timeout = -1; (*apr_sock)->socketdes = *os_sock_info->os_sock; if (os_sock_info->local) { diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 0c99393273f..0a8c890014d 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -356,11 +356,7 @@ apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_pool_t *cont) { alloc_socket(apr_sock, cont); -#ifdef APR_ENABLE_FOR_1_0 /* no protocol field yet */ set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, os_sock_info->protocol); -#else - set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, 0); -#endif (*apr_sock)->timeout = -1; (*apr_sock)->socketdes = *os_sock_info->os_sock; if (os_sock_info->local) { diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index f19b4161739..ee8d15a4f75 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -445,11 +445,7 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_pool_t *cont) { alloc_socket(apr_sock, cont); -#ifdef APR_ENABLE_FOR_1_0 /* no protocol field yet */ set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, os_sock_info->protocol); -#else - set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, 0); -#endif (*apr_sock)->timeout = -1; (*apr_sock)->disconnected = 0; (*apr_sock)->socketdes = *os_sock_info->os_sock; From e83acb45ffd94e77948093765eaf049678a69058 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 15 Oct 2003 21:33:22 +0000 Subject: [PATCH 4647/7878] Use function overrides to provide the correct argument types for our macro'ized atomic transliterations. This code is 100% safer than the equivilant argument and return value casts, because the user's first arg can't be forced from a value to a pointer, and conversly for more than one argument. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64689 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 8aa95249c7b..c06ffd70f55 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -239,13 +239,42 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); #define apr_atomic_init(pool) APR_SUCCESS #define apr_atomic_add(mem, val) InterlockedExchangeAdd(mem,val) -#define apr_atomic_dec(mem) InterlockedDecrement(mem) #define apr_atomic_inc(mem) InterlockedIncrement(mem) +#define apr_atomic_dec(mem) InterlockedDecrement(mem) #define apr_atomic_set(mem, val) InterlockedExchange(mem, val) #define apr_atomic_read(mem) (*mem) #define apr_atomic_cas(mem,with,cmp) InterlockedCompareExchange(mem,with,cmp) #define apr_atomic_casptr(mem,with,cmp) InterlockedCompareExchangePointer(mem,with,cmp) +/* + * Remapping function pointer type to accept apr_uint32_t's type-safely + * as the arguments for as our apr_atomic_foo32 Functions + */ +typedef WINBASEAPI apr_uint32_t (WINAPI apr_atomic_win32_ptr_fn) + (apr_uint32_t volatile *); +typedef WINBASEAPI apr_uint32_t (WINAPI apr_atomic_win32_ptr_val_fn) + (apr_uint32_t volatile *, + apr_uint32_t); +typedef WINBASEAPI apr_uint32_t (WINAPI apr_atomic_win32_ptr_val_val_fn) + (apr_uint32_t volatile *, + apr_uint32_t, apr_uint32_t); + +#define apr_atomic_add32(mem, val) \ + ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem,val) +#define apr_atomic_sub32(mem, val) \ + ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeSub)(mem,val) +#define apr_atomic_inc32(mem) \ + ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem) +#define apr_atomic_dec32(mem) \ + ((apr_atomic_win32_ptr_fn)InterlockedDecrement)(mem) +#define apr_atomic_set32(mem, val) \ + ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem,val) +#define apr_atomic_read32(mem) (*mem) +#define apr_atomic_cas32(mem,with,cmp) \ + ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem,val) +#define apr_atomic_xchg32(mem,val) \ + ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem,val) + #elif defined(NETWARE) #define apr_atomic_init(pool) APR_SUCCESS @@ -507,7 +536,7 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); */ #if APR_ATOMIC_NEED_DEFAULT_INIT #if defined(apr_atomic_init) || defined(APR_OVERRIDE_ATOMIC_INIT) -#error Platform has redefined apr_atomic_init, but other default default atomics require a default apr_atomic_init +#error Platform has redefined apr_atomic_init, but other default atomics require a default apr_atomic_init #endif #endif /* APR_ATOMIC_NEED_DEFAULT_INIT */ From 7e7bdb563a5de0bfd149abd1171b2bc5f1ae17f7 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Thu, 16 Oct 2003 10:54:45 +0000 Subject: [PATCH 4648/7878] OS/2: get apr_socket_atmark() to build, adding a required size parameter to the ioctl call. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64690 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/os2/sockopt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 0b11f202d24..b188f90ea5b 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -160,8 +160,9 @@ APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark) { int oobmark; - if (ioctl(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0) - return APR_OS2_STATUS(sock_errno());; + if (ioctl(sock->socketdes, SIOCATMARK, (void*)&oobmark, sizeof(oobmark)) < 0) { + return APR_OS2_STATUS(sock_errno()); + } *atmark = (oobmark != 0); From 4ca07cc852c13565b8941b65db57633b93b850ca Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 17 Oct 2003 20:23:38 +0000 Subject: [PATCH 4649/7878] Enable large file support for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64692 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr.hnw b/include/apr.hnw index e93175dbdf8..1d19892ec74 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -227,7 +227,7 @@ extern "C" { #define APR_HAS_UNICODE_FS 0 #define APR_HAS_PROC_INVOKED 0 #define APR_HAS_USER 1 -#define APR_HAS_LARGE_FILES 0 +#define APR_HAS_LARGE_FILES 1 #define APR_HAS_XTHREAD_FILES 0 #define APR_HAS_OS_UUID 0 @@ -262,7 +262,7 @@ typedef unsigned long long apr_uint64_t; typedef size_t apr_size_t; typedef ssize_t apr_ssize_t; -typedef off_t apr_off_t; +typedef off64_t apr_off_t; typedef int apr_socklen_t; #ifdef UNKNOWN_NETWARE_64BIT_FLAG_NEEDED From 7fb8b9cdb6d778445e759b179ec7a5a58313ab32 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Sun, 26 Oct 2003 23:22:16 +0000 Subject: [PATCH 4650/7878] Forward port from APR_0_9_BRANCH: Add apr_os_pipe_put_ex(), which allows the caller to tell APR to establish a cleanup on the pipe. Submitted by: Jeff Trawick, Brad Nicholes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64695 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ file_io/netware/pipe.c | 23 +++++++++++++++++++---- file_io/os2/pipe.c | 21 ++++++++++++++++++--- file_io/unix/pipe.c | 23 +++++++++++++++++++---- include/apr_portable.h | 15 +++++++++++++++ 5 files changed, 74 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index d3a1945d5f0..36f5d395143 100644 --- a/CHANGES +++ b/CHANGES @@ -66,6 +66,9 @@ Changes with APR 1.0 Changes with APR 0.9.5 + *) Add apr_os_pipe_put_ex(), which allows the caller to tell APR + to establish a cleanup on the pipe. [Jeff Trawick, Brad Nicholes] + *) Fix make_exports.awk to work with apr-iconv. [Justin Erenkrantz] Changes with APR 0.9.4 diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index 89030853035..8f3940836b5 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -136,9 +136,10 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int return APR_EINVAL; } -APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, - apr_os_file_t *thefile, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, + apr_os_file_t *thefile, + int register_cleanup, + apr_pool_t *pool) { int *dafile = thefile; @@ -150,14 +151,28 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, (*file)->timeout = -1; (*file)->ungetchar = -1; /* no char avail */ (*file)->filedes = *dafile; - (*file)->flags = APR_FILE_NOCLEANUP; + if (!register_cleanup) { + (*file)->flags = APR_FILE_NOCLEANUP; + } (*file)->buffered = 0; #if APR_HAS_THREADS (*file)->thlock = NULL; #endif + if (register_cleanup) { + apr_pool_cleanup_register((*file)->pool, (void *)(*file), + apr_unix_file_cleanup, + apr_pool_cleanup_null); + } return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, + apr_os_file_t *thefile, + apr_pool_t *pool) +{ + return apr_os_pipe_put_ex(file, thefile, 0, pool); +} + APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) { int filedes[2]; diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index ebd0d4cb4ff..decf88b45a8 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -184,9 +184,10 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int -APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, - apr_os_file_t *thefile, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, + apr_os_file_t *thefile, + int register_cleanup, + apr_pool_t *pool) { (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); (*file)->pool = pool; @@ -196,5 +197,19 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, (*file)->timeout = -1; (*file)->filedes = *thefile; + if (register_cleanup) { + apr_pool_cleanup_register(pool, *file, apr_file_cleanup, + apr_pool_cleanup_null); + } + return APR_SUCCESS; } + + + +APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, + apr_os_file_t *thefile, + apr_pool_t *pool) +{ + return apr_os_pipe_put_ex(file, thefile, 0, pool); +} diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 1ee25660cc0..41b6cfc4bf7 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -171,9 +171,10 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int return APR_EINVAL; } -APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, - apr_os_file_t *thefile, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, + apr_os_file_t *thefile, + int register_cleanup, + apr_pool_t *pool) { int *dafile = thefile; @@ -185,14 +186,28 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, (*file)->timeout = -1; (*file)->ungetchar = -1; /* no char avail */ (*file)->filedes = *dafile; - (*file)->flags = APR_FILE_NOCLEANUP; + if (!register_cleanup) { + (*file)->flags = APR_FILE_NOCLEANUP; + } (*file)->buffered = 0; #if APR_HAS_THREADS (*file)->thlock = NULL; #endif + if (register_cleanup) { + apr_pool_cleanup_register((*file)->pool, (void *)(*file), + apr_unix_file_cleanup, + apr_pool_cleanup_null); + } return APR_SUCCESS; } +APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, + apr_os_file_t *thefile, + apr_pool_t *pool) +{ + return apr_os_pipe_put_ex(file, thefile, 0, pool); +} + APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) { int filedes[2]; diff --git a/include/apr_portable.h b/include/apr_portable.h index 3b7c9c7184a..ac124a98fef 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -388,6 +388,21 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont); +/** + * convert the file from os specific type to apr type. + * @param file The apr file we are converting to. + * @param thefile The os specific pipe to convert + * @param register_cleanup A cleanup will be registered on the apr_file_t + * to issue apr_file_close(). + * @param cont The pool to use if it is needed. + * @remark On Unix, it is only possible to put a file descriptor into + * an apr file type. + */ +APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, + apr_os_file_t *thefile, + int register_cleanup, + apr_pool_t *cont); + /** * convert the dir from os specific type to apr type. * @param dir The apr dir we are converting to. From 1865df2d9aecb3e8e927a7165ee762640106fe2e Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Tue, 28 Oct 2003 11:11:08 +0000 Subject: [PATCH 4651/7878] Some functions in the interface had been marked @deprecated. Shift those to the end of the header, and eliminate their docco, to clarify their status as (not) part of the API. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64696 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_poll.h | 108 +++++++++++---------------------------------- 1 file changed, 25 insertions(+), 83 deletions(-) diff --git a/include/apr_poll.h b/include/apr_poll.h index bd15e6379da..54aafbd17fb 100644 --- a/include/apr_poll.h +++ b/include/apr_poll.h @@ -118,16 +118,6 @@ struct apr_pollfd_t { void *client_data; /**< allows app to associate context */ }; -/** - * Setup the memory required for poll to operate properly - * @param new_poll The poll structure to be used. - * @param num The number of socket descriptors to be polled. - * @param cont The pool to operate on. - * @deprecated This function is deprecated, APR applications should control the pollset memory themselves. - */ -APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new_poll, - apr_int32_t num, - apr_pool_t *cont); /** * Poll the sockets in the poll structure @@ -146,83 +136,11 @@ APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new_poll, * socket has been signalled, or the timeout has expired. *
    - *            APR_SHELLCMD     --  Shell script
    + *            APR_SHELLCMD     --  Anything that the shell can handle
      *            APR_PROGRAM      --  Executable program   (default) 
      *            APR_PROGRAM_ENV  --  Executable program, copy environment
      *            APR_PROGRAM_PATH --  Executable program on PATH, copy env
    
    From 2f9a772ef4056462ba5a74c64a90bab4a7ca6ebe Mon Sep 17 00:00:00 2001
    From: Martin Kraemer 
    Date: Fri, 20 Jun 2003 12:55:19 +0000
    Subject: [PATCH 4520/7878] Some SVR4 dialects need mutexes declared before
     including shm.h
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64544 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/arch/unix/apr_arch_shm.h | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/include/arch/unix/apr_arch_shm.h b/include/arch/unix/apr_arch_shm.h
    index 3a3764ecfd3..0dbd18da99e 100644
    --- a/include/arch/unix/apr_arch_shm.h
    +++ b/include/arch/unix/apr_arch_shm.h
    @@ -71,6 +71,9 @@
     #ifdef HAVE_SYS_IPC_H
     #include 
     #endif
    +#ifdef HAVE_SYS_MUTEX_H
    +#include 
    +#endif
     #ifdef HAVE_SYS_SHM_H
     #include 
     #endif
    
    From 2356cb2f18ed94d51028699b34caee347a2523b8 Mon Sep 17 00:00:00 2001
    From: Martin Kraemer 
    Date: Fri, 20 Jun 2003 12:56:52 +0000
    Subject: [PATCH 4521/7878] In the case of invalid %p formats, skip the bogus
     argument too when skipping the false format item
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64545 13f79535-47bb-0310-9956-ffa450edef68
    ---
     strings/apr_snprintf.c | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c
    index dbf8a473aaf..cab36593642 100644
    --- a/strings/apr_snprintf.c
    +++ b/strings/apr_snprintf.c
    @@ -1218,6 +1218,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *),
                         s = "bogus %p";
                         s_len = 8;
                         prefix_char = NUL;
    +                    (void)va_arg(ap, void *); /* skip the bogus argument on the stack */
                         break;
                     }
                     break;
    
    From a44905da54c16a6703f0d2936579e346bfc66331 Mon Sep 17 00:00:00 2001
    From: Thom May 
    Date: Fri, 20 Jun 2003 16:35:55 +0000
    Subject: [PATCH 4522/7878] Fix unquoted argument to test -n.
    
    PR: 20959
    Obtained from:
    Submitted by: max@faidor.de (Maximilian Kolmhuber)
    Reviewed by: Thom May
    
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64546 13f79535-47bb-0310-9956-ffa450edef68
    ---
     apr-config.in | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/apr-config.in b/apr-config.in
    index 6afeb00a1b2..797c1fe13fd 100644
    --- a/apr-config.in
    +++ b/apr-config.in
    @@ -137,7 +137,7 @@ if test -x "`which realpath 2>/dev/null`"; then
       if test -d "$APR_SOURCE_DIR"; then
         APR_SOURCE_DIR="`realpath $APR_SOURCE_DIR`"
       fi
    -  if test -n $tmpbindir; then
    +  if test -n "$tmpbindir"; then
         tmpbindir="`realpath $tmpbindir`"
       fi
     fi
    
    From 12faf882dc92ae42bb6a0e47cbf9ba1bf7cfe0cb Mon Sep 17 00:00:00 2001
    From: Brian Pane 
    Date: Sun, 22 Jun 2003 21:50:25 +0000
    Subject: [PATCH 4523/7878] Add an apr_table_compress() function to reconcile
     duplicate entries in a table, and replace the red-black trees in
     apr_table_overlap() with a less complex mergesort Submitted by:	Joe
     Schaefer  Reviewed by:	Brian Pane
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64547 13f79535-47bb-0310-9956-ffa450edef68
    ---
     include/apr_tables.h |  10 +
     tables/apr_tables.c  | 500 ++++++++++++++++++-------------------------
     2 files changed, 218 insertions(+), 292 deletions(-)
    
    diff --git a/include/apr_tables.h b/include/apr_tables.h
    index f6620f8f1ea..73a473957da 100644
    --- a/include/apr_tables.h
    +++ b/include/apr_tables.h
    @@ -441,6 +441,16 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp,
     APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b,
                                          unsigned flags);
     
    +/**
    + * Eliminate redunandant entries in a table by either overwriting
    + * or merging duplicates
    + *
    + * @param t Table.
    + * @param flags APR_OVERLAP_TABLES_MERGE to merge, or
    + *              APR_OVERLAP_TABLES_SET to overwrite
    + */
    +APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags);
    +
     /** @} */
     
     #ifdef __cplusplus
    diff --git a/tables/apr_tables.c b/tables/apr_tables.c
    index 2f1ae128ae8..885a282204e 100644
    --- a/tables/apr_tables.c
    +++ b/tables/apr_tables.c
    @@ -996,334 +996,250 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp,
         return vdorv;
     }
     
    -/* During apr_table_overlap(), we build an overlap key for
    - * each element in the two tables.
    - */
    -#define RED 0
    -#define BLACK 1
    -typedef struct overlap_key {
    -    /* The table element */
    -    apr_table_entry_t *elt;
    -
    -    /* 0 if from table 'a', 1 if from table 'b' */
    -    int level;
    -
    -    /* Whether to omit this element when building the result table */
    -    int skip;
    -
    -    /* overlap_keys can be assembled into a red-black tree */
    -    int black;
    -    struct overlap_key *tree_parent;
    -    struct overlap_key *tree_left;
    -    struct overlap_key *tree_right;
    -    int color;
    -
    -    /* List of multiple values for this key */
    -    struct overlap_key *merge_next;
    -    struct overlap_key *merge_last;
    -} overlap_key;
    -
    -/* Rotate a subtree of a red-black tree */
    -static void rotate_counterclockwise(overlap_key **root,
    -                                    overlap_key *rotate_node)
    -{
    -    overlap_key *child = rotate_node->tree_right;
    -    rotate_node->tree_right = child->tree_left;
    -    if (rotate_node->tree_right) {
    -        rotate_node->tree_right->tree_parent = rotate_node;
    -    }
    -    child->tree_parent = rotate_node->tree_parent;
    -    if (child->tree_parent == NULL) {
    -        *root = child;
    -    }
    -    else {
    -        if (rotate_node == rotate_node->tree_parent->tree_left) {
    -            rotate_node->tree_parent->tree_left = child;
    -        }
    -        else {
    -            rotate_node->tree_parent->tree_right = child;
    -        }
    -    }
    -    child->tree_left = rotate_node;
    -    rotate_node->tree_parent = child;
    -}
    -
    -static void rotate_clockwise(overlap_key **root, overlap_key *rotate_node)
    +static apr_table_entry_t **table_mergesort(apr_pool_t *pool,
    +                                           apr_table_entry_t **values, int n)
     {
    -    overlap_key *child = rotate_node->tree_left;
    -    rotate_node->tree_left = child->tree_right;
    -    if (rotate_node->tree_left) {
    -        rotate_node->tree_left->tree_parent = rotate_node;
    -    }
    -    child->tree_parent = rotate_node->tree_parent;
    -    if (child->tree_parent == NULL) {
    -        *root = child;
    -    }
    -    else {
    -        if (rotate_node == rotate_node->tree_parent->tree_left) {
    -            rotate_node->tree_parent->tree_left = child;
    -        }
    -        else {
    -            rotate_node->tree_parent->tree_right = child;
    +    /* Bottom-up mergesort, based on design in Sedgewick's "Algorithms
    +     * in C," chapter 8
    +     */
    +    apr_table_entry_t **values_tmp =
    +        (apr_table_entry_t **)apr_palloc(pool, n * sizeof(apr_table_entry_t*));
    +    int i;
    +    int blocksize;
    +
    +    /* First pass: sort pairs of elements (blocksize=1) */
    +    for (i = 0; i + 1 < n; i += 2) {
    +        if (strcasecmp(values[i]->key, values[i + 1]->key) > 0) {
    +            apr_table_entry_t *swap = values[i];
    +            values[i] = values[i + 1];
    +            values[i + 1] = swap;
             }
         }
    -    child->tree_right = rotate_node;
    -    rotate_node->tree_parent = child;
    -}
     
    +    /* Merge successively larger blocks */
    +    blocksize = 2;
    +    while (blocksize < n) {
    +        apr_table_entry_t **dst = values_tmp;
    +        int next_start;
    +        apr_table_entry_t **swap;
     
    -static void overlap_hash(overlap_key *elt,
    -                         overlap_key **hash_table, int nhash,
    -                         unsigned flags)
    -{
    -    /* Each bucket in the hash table holds a red-black tree
    -     * containing the overlap_keys that hash into that bucket
    -     */
    -    overlap_key **child = &(hash_table[elt->elt->key_checksum & (nhash - 1)]);
    -    overlap_key **root = child;
    -    overlap_key *parent = NULL;
    -    overlap_key *next;
    -
    -    /* Look for the element in the tree */
    -    while ((next = *child) != NULL) {
    -        int direction = strcasecmp(elt->elt->key, next->elt->key);
    -        if (direction < 0) {
    -            parent = next;
    -            child = &(next->tree_left);
    -        }
    -        else if (direction > 0) {
    -            parent = next;
    -            child = &(next->tree_right);
    -        }
    -        else {
    -            /* This is the key we're looking for */
    -            if (flags == APR_OVERLAP_TABLES_MERGE) {
    -                /* Just link this node at the end of the list
    -                 * of values for the key.  It doesn't need to
    -                 * be linked into the tree, because the node at
    -                 * the head of this key's value list is in the
    -                 * tree already.
    -                 */
    -                elt->skip = 1;
    -                elt->merge_next = NULL;
    -                if (next->merge_last) {
    -                    next->merge_last->merge_next = elt;
    -                }
    -                else {
    -                    next->merge_next = elt;
    -                }
    -                next->merge_last = elt;
    +        /* Merge consecutive pairs blocks of the next blocksize.
    +         * Within a block, elements are in sorted order due to
    +         * the previous iteration.
    +         */
    +        for (next_start = 0; next_start + blocksize < n;
    +             next_start += (blocksize + blocksize)) {
    +
    +            int block1_start = next_start;
    +            int block2_start = block1_start + blocksize;
    +            int block1_end = block2_start;
    +            int block2_end = block2_start + blocksize;
    +            if (block2_end > n) {
    +                /* The last block may be smaller than blocksize */
    +                block2_end = n;
                 }
    -            else {
    -                /* In the "set" case, don't bother storing
    -                 * this value in the tree if it's already
    -                 * there, except if the previous value was
    -                 * from table 'a' (level==0) and this value
    -                 * is from table 'b' (level==1)
    +            for (;;) {
    +
    +                /* Merge the next two blocks:
    +                 * Pick the smaller of the next element from
    +                 * block 1 and the next element from block 2.
    +                 * Once either of the blocks is emptied, copy
    +                 * over all the remaining elements from the
    +                 * other block
                      */
    -                if (elt->level > next->level) {
    -                    elt->tree_left = next->tree_left;
    -                    if (next->tree_left) {
    -                        next->tree_left->tree_parent = elt;
    +                apr_table_entry_t *lowest;
    +                if (block1_start == block1_end) {
    +                    for (; block2_start < block2_end; block2_start++) {
    +                        *dst++ = values[block2_start];
                         }
    -                    elt->tree_right = next->tree_right;
    -                    if (next->tree_right) {
    -                        next->tree_right->tree_parent = elt;
    +                    break;
    +                }
    +                else if (block2_start == block2_end) {
    +                    for (; block1_start < block1_end; block1_start++) {
    +                        *dst++ = values[block1_start];
                         }
    -                    elt->tree_parent = next->tree_parent;
    -                    elt->color = next->color;
    -                    (*child) = elt;
    -                    elt->merge_next = NULL;
    -                    elt->merge_last = NULL;
    -                    elt->skip = 0;
    -                    next->skip = 1;
    +                    break;
    +                }
    +                if (strcasecmp(values[block1_start]->key,
    +                               values[block2_start]->key) > 0) {
    +                    *dst++ = values[block2_start++];
                     }
                     else {
    -                    elt->skip = 1;
    +                    *dst++ = values[block1_start++];
                     }
                 }
    -            return;
             }
    +
    +        /* If n is not a multiple of 2*blocksize, some elements
    +         * will be left over at the end of the array.
    +         */
    +        for (i = dst - values_tmp; i < n; i++) {
    +            values_tmp[i] = values[i];
    +        }
    +
    +        /* The output array of this pass becomes the input
    +         * array of the next pass, and vice versa
    +         */
    +        swap = values_tmp;
    +        values_tmp = values;
    +        values = swap;
    +
    +        blocksize += blocksize;
         }
     
    -    /* The element wasn't in the tree, so add it */
    -    elt->tree_left = NULL;
    -    elt->tree_right = NULL;
    -    elt->tree_parent = parent;
    -    (*child) = elt;
    -    elt->merge_next = NULL;
    -    elt->merge_last = NULL;
    -    elt->skip = 0;
    -    elt->color = RED;
    -
    -    /* Shuffle the nodes to maintain the red-black tree's balanced
    -     * shape property.  (This is what guarantees O(n*log(n)) worst-case
    -     * performance for apr_table_overlap().)
    +    return values;
    +}
    +
    +APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags)
    +{
    +    apr_table_entry_t **sort_array;
    +    apr_table_entry_t **sort_next;
    +    apr_table_entry_t **sort_end;
    +    apr_table_entry_t *table_next;
    +    apr_table_entry_t **last;
    +    int i;
    +    int dups_found;
    +
    +    if (t->a.nelts <= 1) {
    +        return;
    +    }
    +
    +    /* Copy pointers to all the table elements into an
    +     * array and sort to allow for easy detection of
    +     * duplicate keys
          */
    -    next = elt;
    -    while ((next->tree_parent) && (next->tree_parent->color == RED)) {
    -        /* Note: Root is always black, and red and black nodes
    -         * alternate on any path down the tree.  So if we're inside
    -         * this block, the grandparent node is non-NULL.
    -         */
    -        overlap_key *grandparent = next->tree_parent->tree_parent;
    -        if (next->tree_parent == grandparent->tree_left) {
    -            overlap_key *parent_sibling = grandparent->tree_right;
    -            if (parent_sibling && (parent_sibling->color == RED)) {
    -                next->tree_parent->color = BLACK;
    -                parent_sibling->color = BLACK;
    -                grandparent->color = RED;
    -                next = grandparent;
    +    sort_array = (apr_table_entry_t **)
    +        apr_palloc(t->a.pool, t->a.nelts * sizeof(apr_table_entry_t*));
    +    sort_next = sort_array;
    +    table_next = (apr_table_entry_t *)t->a.elts;
    +    i = t->a.nelts;
    +    do {
    +        *sort_next++ = table_next++;
    +    } while (--i);
    +
    +    /* Note: the merge is done with mergesort instead of quicksort
    +     * because mergesort is a stable sort and runs in n*log(n)
    +     * time regardless of its inputs (quicksort is quadratic in
    +     * the worst case)
    +     */
    +    sort_array = table_mergesort(t->a.pool, sort_array, t->a.nelts);
    +
    +    /* Process any duplicate keys */
    +    dups_found = 0;
    +    sort_next = sort_array;
    +    sort_end = sort_array + t->a.nelts;
    +    last = sort_next;
    +    while (++sort_next < sort_end) {
    +        if (((*sort_next)->key_checksum == (*last)->key_checksum) &&
    +            !strcasecmp((*sort_next)->key, (*last)->key)) {
    +            apr_table_entry_t **dup_last = sort_next + 1;
    +            dups_found = 1;
    +            while ((dup_last < sort_end) &&
    +                   ((*dup_last)->key_checksum == (*last)->key_checksum) &&
    +                   !strcasecmp((*dup_last)->key, (*last)->key)) {
    +                dup_last++;
                 }
    -            else {
    -                if (next == next->tree_parent->tree_right) {
    -                    next = next->tree_parent;
    -                    rotate_counterclockwise(root, next);
    +            dup_last--; /* Elements from last through dup_last, inclusive,
    +                         * all have the same key
    +                         */
    +            if (flags == APR_OVERLAP_TABLES_MERGE) {
    +                apr_size_t len = 0;
    +                apr_table_entry_t **next = last;
    +                char *new_val;
    +                char *val_dst;
    +                do {
    +                    len += strlen((*next)->val);
    +                    len += 2; /* for ", " or trailing null */
    +                } while (++next <= dup_last);
    +                new_val = (char *)apr_palloc(t->a.pool, len);
    +                val_dst = new_val;
    +                next = last;
    +                for (;;) {
    +                    strcpy(val_dst, (*next)->val);
    +                    val_dst += strlen((*next)->val);
    +                    next++;
    +                    if (next > dup_last) {
    +                        *val_dst = 0;
    +                        break;
    +                    }
    +                    else {
    +                        *val_dst++ = ',';
    +                        *val_dst++ = ' ';
    +                    }
                     }
    -                next->tree_parent->color = BLACK;
    -                next->tree_parent->tree_parent->color = RED;
    -                rotate_clockwise(root, next->tree_parent->tree_parent);
    +                (*last)->val = new_val;
    +            }
    +            else { /* overwrite */
    +                (*last)->val = (*dup_last)->val;
                 }
    +            do {
    +                (*sort_next)->key = NULL;
    +            } while (++sort_next <= dup_last);
             }
             else {
    -            overlap_key *parent_sibling = grandparent->tree_left;
    -            if (parent_sibling && (parent_sibling->color == RED)) {
    -                next->tree_parent->color = BLACK;
    -                parent_sibling->color = BLACK;
    -                grandparent->color = RED;
    -                next = grandparent;
    +            last = sort_next;
    +        }
    +    }
    +
    +    /* Shift elements to the left to fill holes left by removing duplicates */
    +    if (dups_found) {
    +        apr_table_entry_t *src = (apr_table_entry_t *)t->a.elts;
    +        apr_table_entry_t *dst = (apr_table_entry_t *)t->a.elts;
    +        apr_table_entry_t *last_elt = src + t->a.nelts;
    +        do {
    +            if (src->key) {
    +                *dst++ = *src;
                 }
    -            else {
    -                if (next == next->tree_parent->tree_left) {
    -                    next = next->tree_parent;
    -                    rotate_clockwise(root, next);
    -                }
    -                next->tree_parent->color = BLACK;
    -                next->tree_parent->tree_parent->color = RED;
    -                rotate_counterclockwise(root, next->tree_parent->tree_parent);
    +        } while (++src < last_elt);
    +        t->a.nelts -= (last_elt - dst);
    +    }
    +
    +    table_reindex(t);
    +}
    +
    +APR_DECLARE(void) apr_table_cat(apr_table_t *t, const apr_table_t *s)
    +{
    +    const int n = t->a.nelts;
    +    register int idx;
    +
    +    apr_array_cat(&t->a,&s->a);
    +
    +    if (n == 0) {
    +        memcpy(t->index_first,s->index_first,sizeof(int) * TABLE_HASH_SIZE);
    +        memcpy(t->index_last, s->index_last, sizeof(int) * TABLE_HASH_SIZE);
    +        t->index_initialized = s->index_initialized;
    +        return;
    +    }
    +
    +    for (idx = 0; idx < TABLE_HASH_SIZE; ++idx) {
    +        if (TABLE_INDEX_IS_INITIALIZED(s, idx)) {
    +            t->index_last[idx] = s->index_last[idx] + n;
    +            if (!TABLE_INDEX_IS_INITIALIZED(t, idx)) {
    +                t->index_first[idx] = s->index_first[idx] + n;
                 }
             }
         }
    -    (*root)->color = BLACK;
    -}
     
    -/* Must be a power of 2 */
    -#define DEFAULT_HASH_SIZE 16
    +    t->index_initialized |= s->index_initialized;
    +}
     
     APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b,
     				    unsigned flags)
     {
    -    int max_keys;
    -    int nkeys;
    -    overlap_key *cat_keys; /* concatenation of the keys of a and b */
    -    overlap_key **hash_table;
    -    int nhash;
    -    int i;
    -    apr_table_entry_t *elts;
    -    apr_table_entry_t *dst_elt;
    +    const int m = a->a.nelts;
    +    const int n = b->a.nelts;
    +    apr_pool_t *p = b->a.pool;
     
    -    max_keys = a->a.nelts + b->a.nelts;
    -    if (!max_keys) {
    -        /* The following logic won't do anything harmful if we keep
    -         * going in this situation, but
    -         *
    -         *    1) certain memory debuggers don't like an alloc size of 0
    -         *       so we'd like to avoid that...
    -         *    2) this isn't all that rare a call anyway, so it is useful
    -         *       to skip the storage allocation and other checks in the
    -         *       following logic
    -         */
    +    if (m + n == 0) {
             return;
         }
    -    cat_keys = apr_palloc(b->a.pool, sizeof(overlap_key) * max_keys);
    -    nhash = DEFAULT_HASH_SIZE;
    -    while (nhash < max_keys) {
    -        nhash <<= 1;
    -    }
    -    hash_table = (overlap_key **)apr_pcalloc(b->a.pool,
    -                                             sizeof(overlap_key *) * nhash);
    -
    -    /* The cat_keys array contains an element for each entry in a,
    -     * followed by one for each in b.  While populating this array,
    -     * we also use it as:
    -     *  1) a hash table, to detect matching keys, and
    -     *  2) a linked list of multiple values for a given key (in the
    -     *     APR_OVERLAP_TABLES_MERGE case)
    -     */
     
    -    /* First, the elements of a */
    -    nkeys = 0;
    -    elts = (apr_table_entry_t *)a->a.elts;
    -    for (i = 0; i < a->a.nelts; i++, nkeys++) {
    -        cat_keys[nkeys].elt = &(elts[i]);
    -        cat_keys[nkeys].level = 0;
    -        overlap_hash(&(cat_keys[nkeys]), hash_table, nhash, flags);
    +    /* copy (extend) a using b's pool */
    +    if (a->a.pool != p) {
    +        make_array_core(&a->a, p, m+n, sizeof(apr_table_entry_t), 0);
         }
     
    -    /* Then the elements of b */
    -    elts = (apr_table_entry_t *)b->a.elts;
    -    for (i = 0; i < b->a.nelts; i++, nkeys++) {
    -        cat_keys[nkeys].elt = &(elts[i]);
    -        cat_keys[nkeys].level = 1;
    -        overlap_hash(&(cat_keys[nkeys]), hash_table, nhash, flags);
    -    }
    +    apr_table_cat(a, b);
     
    -    /* Copy concatenated list of elements into table a to
    -     * form the new table contents, but:
    -     *   1) omit the ones marked "skip," and
    -     *   2) merge values for the same key if needed
    -     */
    -    make_array_core(&a->a, b->a.pool, max_keys, sizeof(apr_table_entry_t), 0);
    -    nkeys = 0;
    -    dst_elt = (apr_table_entry_t *)a->a.elts;
    -    for (i = 0; i < max_keys; i++) {
    -        if (cat_keys[i].skip) {
    -            continue;
    -        }
    -        if (cat_keys[i].merge_next) {
    -            char *new_val;
    -            char *val_next;
    -            overlap_key *next = cat_keys[i].merge_next;
    -            int len = (cat_keys[i].elt->val ?
    -                       strlen(cat_keys[i].elt->val) : 0);
    -            do {
    -                len += 2;
    -                if (next->elt->val) {
    -                    len += strlen(next->elt->val);
    -                }
    -                next = next->merge_next;
    -            } while (next);
    -            len++;
    -            new_val = (char *)apr_palloc(b->a.pool, len);
    -            val_next = new_val;
    -            if (cat_keys[i].elt->val) {
    -                strcpy(val_next, cat_keys[i].elt->val);
    -                val_next += strlen(cat_keys[i].elt->val);
    -            }
    -            next = cat_keys[i].merge_next;
    -            do {
    -                *val_next++ = ',';
    -                *val_next++ = ' ';
    -                if (next->elt->val) {
    -                    strcpy(val_next, next->elt->val);
    -                    val_next += strlen(next->elt->val);
    -                }
    -                next = next->merge_next;
    -            } while (next);
    -            *val_next = 0;
    -            dst_elt->key = cat_keys[i].elt->key;
    -            dst_elt->val = new_val;
    -            dst_elt->key_checksum = cat_keys[i].elt->key_checksum;
    -            dst_elt++;
    -        }
    -        else {
    -            dst_elt->key = cat_keys[i].elt->key;
    -            dst_elt->val = cat_keys[i].elt->val;
    -            dst_elt->key_checksum = cat_keys[i].elt->key_checksum;
    -            dst_elt++;
    -        }
    -    }
    -    a->a.nelts = dst_elt - (apr_table_entry_t *)a->a.elts;
    -    table_reindex(a);
    +    apr_table_compress(a, flags);
     }
    -
    
    From e3ff91d66fe795891c69ec73f52706a202f00b22 Mon Sep 17 00:00:00 2001
    From: Brian Pane 
    Date: Sun, 22 Jun 2003 21:56:38 +0000
    Subject: [PATCH 4524/7878] document the addition of apr_table_compress()
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64548 13f79535-47bb-0310-9956-ffa450edef68
    ---
     CHANGES | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/CHANGES b/CHANGES
    index 8fc36eee77b..47ade20fbb7 100644
    --- a/CHANGES
    +++ b/CHANGES
    @@ -1,4 +1,8 @@
     Changes with APR 0.9.4
    +  *) Add new table function apr_table_compress() and replace
    +     red-black trees with mergesort in apr_table_overlap()
    +     [Joe Schaefer , Brian Pane]
    +
       *) Win32: Adopt Brian Havard's OS/2 rwlock implementation for
          Windows [Marc Adkins, Bill Stoddard]
     
    
    From 97d075a5249c961df0b532500529ee777fca2a37 Mon Sep 17 00:00:00 2001
    From: Brian Pane 
    Date: Tue, 24 Jun 2003 05:40:19 +0000
    Subject: [PATCH 4525/7878] fix some compiler warnings
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64549 13f79535-47bb-0310-9956-ffa450edef68
    ---
     tables/apr_tables.c | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/tables/apr_tables.c b/tables/apr_tables.c
    index 885a282204e..45e88172b45 100644
    --- a/tables/apr_tables.c
    +++ b/tables/apr_tables.c
    @@ -1047,7 +1047,6 @@ static apr_table_entry_t **table_mergesort(apr_pool_t *pool,
                      * over all the remaining elements from the
                      * other block
                      */
    -                apr_table_entry_t *lowest;
                     if (block1_start == block1_end) {
                         for (; block2_start < block2_end; block2_start++) {
                             *dst++ = values[block2_start];
    @@ -1197,7 +1196,7 @@ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags)
         table_reindex(t);
     }
     
    -APR_DECLARE(void) apr_table_cat(apr_table_t *t, const apr_table_t *s)
    +static void apr_table_cat(apr_table_t *t, const apr_table_t *s)
     {
         const int n = t->a.nelts;
         register int idx;
    
    From f68dc6bc7afc55f0e3a6fff62ff0756afb246d99 Mon Sep 17 00:00:00 2001
    From: Brian Pane 
    Date: Tue, 24 Jun 2003 06:56:40 +0000
    Subject: [PATCH 4526/7878] fixed the removal of duplicate key values in
     apr_table_compress() where one key has more than two values
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64550 13f79535-47bb-0310-9956-ffa450edef68
    ---
     tables/apr_tables.c | 7 ++++---
     1 file changed, 4 insertions(+), 3 deletions(-)
    
    diff --git a/tables/apr_tables.c b/tables/apr_tables.c
    index 45e88172b45..092bb3f68a0 100644
    --- a/tables/apr_tables.c
    +++ b/tables/apr_tables.c
    @@ -1,3 +1,4 @@
    +#include 
     /* ====================================================================
      * The Apache Software License, Version 1.1
      *
    @@ -1127,8 +1128,8 @@ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags)
         dups_found = 0;
         sort_next = sort_array;
         sort_end = sort_array + t->a.nelts;
    -    last = sort_next;
    -    while (++sort_next < sort_end) {
    +    last = sort_next++;
    +    while (sort_next < sort_end) {
             if (((*sort_next)->key_checksum == (*last)->key_checksum) &&
                 !strcasecmp((*sort_next)->key, (*last)->key)) {
                 apr_table_entry_t **dup_last = sort_next + 1;
    @@ -1176,7 +1177,7 @@ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags)
                 } while (++sort_next <= dup_last);
             }
             else {
    -            last = sort_next;
    +            last = sort_next++;
             }
         }
     
    
    From 57dd363c34365044cbc24c0b9bd31b1d248992d9 Mon Sep 17 00:00:00 2001
    From: Brian Pane 
    Date: Tue, 24 Jun 2003 07:28:41 +0000
    Subject: [PATCH 4527/7878] fix a bug in the table overlap test
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64551 13f79535-47bb-0310-9956-ffa450edef68
    ---
     test/testtable.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/test/testtable.c b/test/testtable.c
    index 7fc1399a9f1..8e7c35eb80c 100644
    --- a/test/testtable.c
    +++ b/test/testtable.c
    @@ -174,7 +174,7 @@ static void table_overlap(CuTest *tc)
         val = apr_table_get(t1, "a");
         CuAssertStrEquals(tc, val, "1");
         val = apr_table_get(t1, "b");
    -    CuAssertStrEquals(tc, val, "2");
    +    CuAssertStrEquals(tc, val, "2.");
         val = apr_table_get(t1, "c");
         CuAssertStrEquals(tc, val, "3");
         val = apr_table_get(t1, "d");
    
    From 1243cd409b096bcb74a66f24e4f0799406c994dc Mon Sep 17 00:00:00 2001
    From: Brian Pane 
    Date: Wed, 25 Jun 2003 07:02:48 +0000
    Subject: [PATCH 4528/7878] Change a declaration that wouldn't compile under
     Borland C++ Submitted by: Saxon Druce 
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64552 13f79535-47bb-0310-9956-ffa450edef68
    ---
     file_io/win32/filepath.c | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c
    index 874942ca056..e72504ece7d 100644
    --- a/file_io/win32/filepath.c
    +++ b/file_io/win32/filepath.c
    @@ -156,10 +156,13 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath,
     
     #else /* ndef(NETWARE) */
     
    -    char seperator[2] = { (flags & APR_FILEPATH_NATIVE) ? '\\' : '/', 0};
    +    char seperator[2];
         const char *delim1;
         const char *delim2;
     
    +    seperator[0] = (flags & APR_FILEPATH_NATIVE) ? '\\' : '/';
    +    seperator[1] = 0;
    +
         if (testpath[0] == '/' || testpath[0] == '\\') {
             if (testpath[1] == '/' || testpath[1] == '\\') {
     
    
    From 054ebd13a9a57498550847306d3a7baa01af59b4 Mon Sep 17 00:00:00 2001
    From: Greg Stein 
    Date: Wed, 25 Jun 2003 21:50:16 +0000
    Subject: [PATCH 4529/7878] move serf's pool-design.txt here as part of the
     actual APR docs.
    
    git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64553 13f79535-47bb-0310-9956-ffa450edef68
    ---
     docs/pool-design.html | 100 ++++++++++++++++++++++++++++++++++++++++++
     1 file changed, 100 insertions(+)
     create mode 100644 docs/pool-design.html
    
    diff --git a/docs/pool-design.html b/docs/pool-design.html
    new file mode 100644
    index 00000000000..cb6660aac8d
    --- /dev/null
    +++ b/docs/pool-design.html
    @@ -0,0 +1,100 @@
    +
    +
    +    Using APR Pools
    +  
    +  
    +    
    + Last modified at [$Date: 2003/06/25 21:50:16 $] +
    + +

    Using APR Pools

    + +

    + From Subversion, we + have learned a lot about how to use pools in a heavily + structured/object-based environment. + Apache httpd is a + completely different beast: "allocate a request pool. use + it. destroy it." +

    + +

    + In a complex app, that request-style of behavior is not + present. Luckily, the "proper" use of pools can be described in + just a few rules: +

    + +
      +
    • + Objects should not have their own pools. An object is + allocated into a pool defined by the constructor's caller. The + caller knows the lifetime of the object and + will manage it via the pool. Generally, this also means that + objects will not have a "close" or a "free" since those + operations will happen implicitly as part of the destruction + of the pool the objects live within. +
    • + +
    • +

      + Functions should not create/destroy pools for their + operation; they should use a pool provided by the + caller. Again, the caller knows more about + how the function will be used, how often, how many times, + etc. Thus, it should be in charge of the function's memory + usage. +

      +

      + As an example, the caller might know that the app will exit + upon the function's return. Thus, the function would be + creating extra work if it built and destroyed a + pool. Instead, it should use the passed-in pool, which the + caller is going to be tossing as part of app-exit anyways. +

      +
    • + +
    • +

      + Whenever an unbounded iteration occurs, a subpool should be + used. The general pattern is: +

      +
      +
      +subpool = apr_create_subpool(pool);
      +for (i = 0; i < n; ++i) {
      +  apr_pool_clear(subpool);
      +
      +  do_operation(..., subpool);
      +}
      +apr_pool_destroy(subpool);
      +
      +

      + This pattern prevents the 'pool' from growing unbounded and + consuming all of memory. Note that it is slightly more + optimal to clear the pool on loop-entry. This pattern also + allows for a 'continue' to occur within the loop, + yet still ensure the pool will be cleared. +

      +
    • + +
    • + Given all of the above, it is pretty well mandatory to pass a + pool to every function. Since objects are not + recording pools for themselves, and the caller is always + supposed to be managing memory, then each function needs a + pool, rather than relying on some hidden magic pool. In + limited cases, objects may record the pool used for their + construction so that they can construct sub-parts, but these + cases should be examined carefully. Internal pools can lead to + unbounded pool usage if the object is not careful. +
    • +
    + +
    +
    Greg Stein
    + + +Last modified: Wed Jun 25 14:50:19 PDT 2003 + + + From 4ec9d8cefd7f6bb5e679c191df3b1f4b86bd28e0 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Thu, 26 Jun 2003 18:17:44 +0000 Subject: [PATCH 4530/7878] Done git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64554 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 02874f35ea6..181b5d40725 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2003/04/10 12:20:35 $] +Last modified at [$Date: 2003/06/26 18:17:44 $] Release: @@ -112,8 +112,8 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: Beos: apr_thread_rwlock_try*lock() apr_proc_mutex_trylock() Unix: apr_thread_rwlock_*() for platforms w/o rwlocks in pthread - Win32: apr_thread_rwlock_try*lock(), apr_thread_cond_timedwait(), - apr_proc_mutex_*() (Is proc_mutex unnecessary on Win32?) + Win32: apr_thread_cond_timedwait(), apr_proc_mutex_*() + (Is proc_mutex unnecessary on Win32?) * Need to contemplate apr_strftime... platforms vary. OtherBill suggested this solution (but has no time to implement): From c500b00b2bd5984961a852b1e2d2d29da1786a27 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 2 Jul 2003 12:12:30 +0000 Subject: [PATCH 4531/7878] CuTest-ify and clean up the testprocmutex test: - make the increment operation use a slow load/increment/store cycle. - dropped support for specifying a lock filename, hopefully that is not critical - try using anonymous shm then name-based shm; fail gracefully rather than segfaulting if neither works. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64555 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 3 +- test/test_apr.h | 1 + test/testall.c | 1 + test/testprocmutex.c | 142 ++++++++++++++++--------------------------- 4 files changed, 56 insertions(+), 91 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 096cf89d063..f61f7d5f544 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -22,7 +22,6 @@ STDTEST_PORTABLE = \ STDTEST_NONPORTABLE = \ testshm@EXEEXT@ \ - testprocmutex@EXEEXT@ \ testglobalmutex@EXEEXT@ OTHER_PROGRAMS = client@EXEEXT@ sendfile@EXEEXT@ \ @@ -118,7 +117,7 @@ TESTS = testall.lo testtime.lo teststr.lo testvsn.lo testipsub.lo \ testdso.lo testoc.lo testdup.lo testsockets.lo testproc.lo \ testpoll.lo testlock.lo testsockopt.lo testpipe.lo testthread.lo \ testhash.lo testargs.lo testnames.lo testuser.lo testpath.lo \ - testenv.lo + testenv.lo testprocmutex.lo testall: $(TESTS) mod_test.la libmod_test.la occhild@EXEEXT@ \ readchild@EXEEXT@ CuTest.lo proc_child@EXEEXT@ $(LOCAL_LIBS) diff --git a/test/test_apr.h b/test/test_apr.h index 90c6ffabef8..b378d0cbc1b 100644 --- a/test/test_apr.h +++ b/test/test_apr.h @@ -86,6 +86,7 @@ CuSuite *testoc(void); CuSuite *testdup(void); CuSuite *testsockets(void); CuSuite *testproc(void); +CuSuite *testprocmutex(void); CuSuite *testpoll(void); CuSuite *testlock(void); CuSuite *testsockopt(void); diff --git a/test/testall.c b/test/testall.c index a7d80306423..169188d9eff 100644 --- a/test/testall.c +++ b/test/testall.c @@ -100,6 +100,7 @@ static const struct testlist { {"testsockets", testsockets}, {"testsockopt", testsockopt}, {"testproc", testproc}, + {"testprocmutex", testprocmutex}, {"testpoll", testpoll}, {"testlock", testlock}, {"testthread", testthread}, diff --git a/test/testprocmutex.c b/test/testprocmutex.c index fe8067c0484..2cf1ef8c769 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -64,15 +64,22 @@ #include #include "test_apr.h" +#if APR_HAS_FORK -#define MAX_ITER 4000 +#define MAX_ITER 200 #define MAX_COUNTER (MAX_ITER * 4) -apr_proc_mutex_t *proc_lock; -apr_pool_t *pool; -int *x; +static apr_proc_mutex_t *proc_lock; +static volatile int *x; -static int make_child(apr_proc_t **proc, apr_pool_t *p) +/* a slower more racy may to implement (*x)++ */ +static int increment(int n) +{ + apr_sleep(1); + return n+1; +} + +static void make_child(apr_proc_t **proc, apr_pool_t *p) { int i = 0; *proc = apr_pcalloc(p, sizeof(**proc)); @@ -91,112 +98,69 @@ static int make_child(apr_proc_t **proc, apr_pool_t *p) */ apr_initialize(); - while (1) { + do { apr_proc_mutex_lock(proc_lock); - if (i == MAX_ITER) { - apr_proc_mutex_unlock(proc_lock); - exit(1); - } i++; - (*x)++; + *x = increment(*x); apr_proc_mutex_unlock(proc_lock); - } + } while (i < MAX_ITER); exit(1); } - return APR_SUCCESS; } -static apr_status_t test_exclusive(const char *lockname) +static void test_exclusive(CuTest *tc, const char *lockname) { apr_proc_t *p1, *p2, *p3, *p4; - apr_status_t s1, s2, s3, s4; - - printf("Exclusive lock test\n"); - printf("%-60s", " Initializing the lock"); - s1 = apr_proc_mutex_create(&proc_lock, lockname, APR_LOCK_DEFAULT, pool); - - if (s1 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); + apr_status_t rv; - printf("%-60s", " Starting all of the processes"); - fflush(stdout); - s1 = make_child(&p1, pool); - s2 = make_child(&p2, pool); - s3 = make_child(&p3, pool); - s4 = make_child(&p4, pool); - if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || - s3 != APR_SUCCESS || s4 != APR_SUCCESS) { - printf("Failed!\n"); - return s1; - } - printf("OK\n"); + rv = apr_proc_mutex_create(&proc_lock, lockname, APR_LOCK_DEFAULT, p); + apr_assert_success(tc, "create the mutex", rv); - printf("%-60s", " Waiting for processes to exit"); - s1 = apr_proc_wait(p1, NULL, NULL, APR_WAIT); - s2 = apr_proc_wait(p2, NULL, NULL, APR_WAIT); - s3 = apr_proc_wait(p3, NULL, NULL, APR_WAIT); - s4 = apr_proc_wait(p4, NULL, NULL, APR_WAIT); - printf("OK\n"); + make_child(&p1, p); + make_child(&p2, p); + make_child(&p3, p); + make_child(&p4, p); - if ((*x) != MAX_COUNTER) { - fprintf(stderr, "Locks don't appear to work! x = %d instead of %d\n", - (*x), MAX_COUNTER); - } - else { - printf("Test passed\n"); - } - return APR_SUCCESS; + apr_proc_wait(p1, NULL, NULL, APR_WAIT); + apr_proc_wait(p2, NULL, NULL, APR_WAIT); + apr_proc_wait(p3, NULL, NULL, APR_WAIT); + apr_proc_wait(p4, NULL, NULL, APR_WAIT); + + CuAssert(tc, "Locks don't appear to work", *x == MAX_COUNTER); } +#endif -int main(int argc, const char * const *argv) +static void proc_mutex(CuTest *tc) { +#if APR_HAS_FORK apr_status_t rv; - char errmsg[200]; - const char *lockname = NULL; - const char *shmname = "shm.file"; - apr_getopt_t *opt; - char optchar; - const char *optarg; + const char *lockname = "tpm.lock"; + const char *shmname = "tpm.shm"; apr_shm_t *shm; - printf("APR Proc Mutex Test\n==============\n\n"); - - apr_initialize(); - atexit(apr_terminate); - - if (apr_pool_create(&pool, NULL) != APR_SUCCESS) - exit(-1); - - if ((rv = apr_getopt_init(&opt, pool, argc, argv)) != APR_SUCCESS) { - fprintf(stderr, "Could not set up to parse options: [%d] %s\n", - rv, apr_strerror(rv, errmsg, sizeof errmsg)); - exit(-1); - } - - while ((rv = apr_getopt(opt, "f:", &optchar, &optarg)) == APR_SUCCESS) { - if (optchar == 'f') { - lockname = optarg; - } + /* Use anonymous shm if available. */ + rv = apr_shm_create(&shm, sizeof(int), NULL, p); + if (rv == APR_ENOTIMPL) { + apr_file_remove(shmname, p); + rv = apr_shm_create(&shm, sizeof(int), shmname, p); } - if (rv != APR_SUCCESS && rv != APR_EOF) { - fprintf(stderr, "Could not parse options: [%d] %s\n", - rv, apr_strerror(rv, errmsg, sizeof errmsg)); - exit(-1); - } + apr_assert_success(tc, "create shm segment", rv); - apr_shm_create(&shm, sizeof(int), shmname, pool); x = apr_shm_baseaddr_get(shm); + test_exclusive(tc, lockname); +#else + CuNotImpl(tc, "APR lacks fork() support"); +#endif +} - if ((rv = test_exclusive(lockname)) != APR_SUCCESS) { - fprintf(stderr,"Exclusive Lock test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); - exit(-2); - } - - return 0; + +CuSuite *testprocmutex(void) +{ + CuSuite *suite = CuSuiteNew("Cross-Process Mutexes"); + + SUITE_ADD_TEST(suite, proc_mutex); + + return suite; } From 842050f5c8f8189663b392f5402c061181f312ab Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 2 Jul 2003 12:15:04 +0000 Subject: [PATCH 4532/7878] Fix typo. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64556 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index 2cf1ef8c769..a29b0504bf4 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -72,7 +72,7 @@ static apr_proc_mutex_t *proc_lock; static volatile int *x; -/* a slower more racy may to implement (*x)++ */ +/* a slower more racy way to implement (*x)++ */ static int increment(int n) { apr_sleep(1); From 6a410d56968f06a2c2d62d66d4ec3df7347f91c4 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 2 Jul 2003 19:44:38 +0000 Subject: [PATCH 4533/7878] Pass NULL to apr_proc_mutex_create rather than the invented filename as per the old code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64557 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index a29b0504bf4..ef1a3fcb141 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -134,7 +134,6 @@ static void proc_mutex(CuTest *tc) { #if APR_HAS_FORK apr_status_t rv; - const char *lockname = "tpm.lock"; const char *shmname = "tpm.shm"; apr_shm_t *shm; @@ -148,7 +147,7 @@ static void proc_mutex(CuTest *tc) apr_assert_success(tc, "create shm segment", rv); x = apr_shm_baseaddr_get(shm); - test_exclusive(tc, lockname); + test_exclusive(tc, NULL); #else CuNotImpl(tc, "APR lacks fork() support"); #endif From d5da02a5838e664a7c7c1495ba50e9bcfdd0e116 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 3 Jul 2003 09:14:16 +0000 Subject: [PATCH 4534/7878] - more cleanups, add more error checking - increase to using six children - add missing call to apr_proc_mutex_child_init() so the test works on platforms which use flock() locking (e.g. FreeBSD) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64559 13f79535-47bb-0310-9956-ffa450edef68 --- test/testprocmutex.c | 56 ++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/test/testprocmutex.c b/test/testprocmutex.c index ef1a3fcb141..895a5df7bda 100644 --- a/test/testprocmutex.c +++ b/test/testprocmutex.c @@ -67,7 +67,8 @@ #if APR_HAS_FORK #define MAX_ITER 200 -#define MAX_COUNTER (MAX_ITER * 4) +#define CHILDREN 6 +#define MAX_COUNTER (MAX_ITER * CHILDREN) static apr_proc_mutex_t *proc_lock; static volatile int *x; @@ -79,15 +80,18 @@ static int increment(int n) return n+1; } -static void make_child(apr_proc_t **proc, apr_pool_t *p) +static void make_child(CuTest *tc, apr_proc_t **proc, apr_pool_t *p) { - int i = 0; + apr_status_t rv; + *proc = apr_pcalloc(p, sizeof(**proc)); /* slight delay to allow things to settle */ apr_sleep (1); - if (apr_proc_fork(*proc, p) == APR_INCHILD) { + rv = apr_proc_fork(*proc, p); + if (rv == APR_INCHILD) { + int i = 0; /* The parent process has setup all processes to call apr_terminate * at exit. But, that means that all processes must also call * apr_initialize at startup. You cannot have an unequal number @@ -98,33 +102,49 @@ static void make_child(apr_proc_t **proc, apr_pool_t *p) */ apr_initialize(); + if (apr_proc_mutex_child_init(&proc_lock, NULL, p)) + exit(1); + do { - apr_proc_mutex_lock(proc_lock); + if (apr_proc_mutex_lock(proc_lock)) + exit(1); i++; *x = increment(*x); - apr_proc_mutex_unlock(proc_lock); + if (apr_proc_mutex_unlock(proc_lock)) + exit(1); } while (i < MAX_ITER); - exit(1); - } + exit(0); + } + + CuAssert(tc, "fork failed", rv == APR_INPARENT); +} + +/* Wait for a child process and check it terminated with success. */ +static void await_child(CuTest *tc, apr_proc_t *proc) +{ + int code; + apr_exit_why_e why; + apr_status_t rv; + + rv = apr_proc_wait(proc, &code, &why, APR_WAIT); + CuAssert(tc, "child did not terminate with success", + rv == APR_CHILD_DONE && why == APR_PROC_EXIT && code == 0); } static void test_exclusive(CuTest *tc, const char *lockname) { - apr_proc_t *p1, *p2, *p3, *p4; + apr_proc_t *child[CHILDREN]; apr_status_t rv; + int n; rv = apr_proc_mutex_create(&proc_lock, lockname, APR_LOCK_DEFAULT, p); apr_assert_success(tc, "create the mutex", rv); - make_child(&p1, p); - make_child(&p2, p); - make_child(&p3, p); - make_child(&p4, p); - - apr_proc_wait(p1, NULL, NULL, APR_WAIT); - apr_proc_wait(p2, NULL, NULL, APR_WAIT); - apr_proc_wait(p3, NULL, NULL, APR_WAIT); - apr_proc_wait(p4, NULL, NULL, APR_WAIT); + for (n = 0; n < CHILDREN; n++) + make_child(tc, &child[n], p); + + for (n = 0; n < CHILDREN; n++) + await_child(tc, child[n]); CuAssert(tc, "Locks don't appear to work", *x == MAX_COUNTER); } From a437568c8d07f4bfc2b989c71450632e3c776978 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Fri, 4 Jul 2003 01:54:07 +0000 Subject: [PATCH 4535/7878] Move testprocmutex from the nonportable list to testall.exe dependencies. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64560 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.win | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/Makefile.win b/test/Makefile.win index d1311d82f9c..6ef18cdf7b7 100644 --- a/test/Makefile.win +++ b/test/Makefile.win @@ -3,7 +3,6 @@ LINK=link /nologo NONPORTABLE = \ testshm.exe \ - testprocmutex.exe \ testglobalmutex.exe PROGRAMS = \ @@ -100,7 +99,7 @@ TESTS = testall.obj testtime.obj teststr.obj testvsn.obj testipsub.obj \ testdso.obj testoc.obj testdup.obj testsockets.obj testproc.obj \ testpoll.obj testlock.obj testsockopt.obj testpipe.obj testthread.obj \ testhash.obj testargs.obj testnames.obj testuser.obj testpath.obj \ - testenv.obj + testenv.obj testprocmutex.obj testall.exe: $(TESTS) CuTest.obj $(LOCAL_LIBS) $(LINK) /debug /subsystem:console /machine:I386 $(TESTS) CuTest.obj \ From 4e35a5c6c716d76274798907d4098a56f12e962d Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 6 Jul 2003 10:34:55 +0000 Subject: [PATCH 4536/7878] Silence a compiler warning on BeOS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64561 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/errorcodes.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index d4820a18412..cc199f5ee54 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -374,6 +374,15 @@ static char *native_strerror(apr_status_t statcode, char *buf, } #elif defined(HAVE_STRERROR_R) /* glibc style */ + +/* BeOS has the function available, but it doesn't provide + * the prototype publically (doh!), so to avoid a build warning + * we add a suitable prototype here. + */ +#if defined(BEOS) +const char *strerror_r(apr_status_t, char *, apr_size_t); +#endif + static char *native_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize) { From 06d244eb686b8e9c1d1ff763a27d5211d5285442 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 7 Jul 2003 14:49:48 +0000 Subject: [PATCH 4537/7878] Pick up the result of the AC_DECL_SYS_SIGLIST macro correctly with recent versions of autoconf. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64562 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index af22651fb6b..c2dd2775a7c 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -139,8 +139,9 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func) #endif /* HAVE_SIGACTION */ - -#ifdef SYS_SIGLIST_DECLARED +/* AC_DECL_SYS_SIGLIST defines either of these symbols depending + * on the version of autoconf used. */ +#if defined(SYS_SIGLIST_DECLARED) || defined(HAVE_DECL_SYS_SIGLIST) void apr_signal_init(apr_pool_t *pglobal) { @@ -150,7 +151,7 @@ const char *apr_signal_description_get(int signum) return sys_siglist[signum]; } -#else /* !SYS_SIGLIST_DECLARED */ +#else /* !(SYS_SIGLIST_DECLARED || HAVE_DECL_SYS_SIGLIST) */ /* we need to roll our own signal description stuff */ @@ -298,7 +299,7 @@ const char *apr_signal_description_get(int signum) : "unknown signal (number)"; } -#endif /* SYS_SIGLIST_DECLARED */ +#endif /* SYS_SIGLIST_DECLARED || HAVE_DECL_SYS_SIGLIST */ #if APR_HAS_THREADS && (HAVE_SIGSUSPEND || APR_HAVE_SIGWAIT) && !defined(OS2) From f9225f565b39d06be532372b96586b1053e9c560 Mon Sep 17 00:00:00 2001 From: Ben Collins-Sussman Date: Mon, 7 Jul 2003 22:44:11 +0000 Subject: [PATCH 4538/7878] New apr_file_mtime_set() API, implemented in unix and win32. Patches from Branko Cibej (brane) and Matt Kraai . * include/apr_file_io.h (apr_file_mtime_set): declare. * include/arch/win32/apr_arch_file_io.h: expand apr_file_open internal flags; add new APR_WRITEATTRS value. * file_io/win32/open.c (apr_file_open): honor APR_WRITEATTRS flag. * file_io/win32/filestat.c (apr_file_mtime_set): implement in win32. * file_io/unix/filestat.c (apr_file_mtime_set): implement in unix. * test/testfileinfo.c (test_mtime_set): new API test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64563 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filestat.c | 26 +++++++++++++++ file_io/win32/filestat.c | 34 +++++++++++++++++++ file_io/win32/open.c | 5 ++- include/apr_file_io.h | 12 +++++++ include/arch/win32/apr_arch_file_io.h | 9 ++--- test/testfileinfo.c | 48 +++++++++++++++++++++++++++ 6 files changed, 129 insertions(+), 5 deletions(-) diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 02a4df975a1..08646f10971 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -213,6 +213,32 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, return apr_file_perms_set(fname, finfo.protection); } + +APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, + apr_time_t mtime, + apr_pool_t *pool) +{ + apr_status_t status; + apr_finfo_t finfo; + struct timeval tvp[2]; + + status = apr_stat(&finfo, fname, APR_FINFO_ATIME, pool); + if (!APR_STATUS_IS_SUCCESS(status)) { + return status; + } + + tvp[0].tv_sec = apr_time_sec(finfo.atime); + tvp[0].tv_usec = apr_time_usec(finfo.atime); + tvp[1].tv_sec = apr_time_sec(mtime); + tvp[1].tv_usec = apr_time_usec(mtime); + + if (utimes(fname, tvp) == -1) { + return errno; + } + return APR_SUCCESS; +} + + APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *pool) diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index 91a7fc07a0b..56217c70df1 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -762,3 +762,37 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, return APR_SUCCESS; } + + +APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, + apr_time_t mtime, + apr_pool_t *pool) +{ + apr_file_t *thefile; + apr_status_t rv; + + rv = apr_file_open(&thefile, fname, + APR_READ | APR_WRITEATTRS, + APR_OS_DEFAULT, pool); + if (!rv) + { + FILETIME file_ctime; + FILETIME file_atime; + FILETIME file_mtime; + + if (!GetFileTime(thefile->filehand, + &file_ctime, &file_atime, &file_mtime)) + rv = apr_get_os_error(); + else + { + AprTimeToFileTime(&file_mtime, mtime); + if (!SetFileTime(thefile->filehand, + &file_ctime, &file_atime, &file_mtime)) + rv = apr_get_os_error(); + } + + apr_file_close(thefile); + } + + return rv; +} diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 2d59ee42327..550206b8825 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -309,7 +309,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, if (flag & APR_WRITE) { oflags |= GENERIC_WRITE; } - + if (flag & APR_WRITEATTRS) { + oflags |= FILE_WRITE_ATTRIBUTES; + } + if (apr_os_level >= APR_WIN_NT) sharemode |= FILE_SHARE_DELETE; diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 8ff62117650..3d9e40413c9 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -656,6 +656,18 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attr_mask, apr_pool_t *cont); +/** + * Set the mtime of the specified file. + * @param fname The full path to the file (using / on all systems) + * @param mtime The mtime to apply to the file. + * @param pool The pool to use. + * @warning Platforms which do not implement this feature will return + * APR_ENOTIMPL. + */ +APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, + apr_time_t mtime, + apr_pool_t *pool); + /** * Create a new directory on the file system. * @param path the path for the directory to be created. (use / on all systems) diff --git a/include/arch/win32/apr_arch_file_io.h b/include/arch/win32/apr_arch_file_io.h index 06e6e091c8b..30e863a8351 100644 --- a/include/arch/win32/apr_arch_file_io.h +++ b/include/arch/win32/apr_arch_file_io.h @@ -133,10 +133,11 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool); #endif /* Internal Flags for apr_file_open */ -#define APR_OPENINFO 0x4000 /* Open without READ or WRITE access */ -#define APR_OPENLINK 0x2000 /* Open a link itself, if supported */ -#define APR_READCONTROL 0x1000 /* Read the file's owner/perms */ -#define APR_WRITECONTROL 0x0800 /* Modifythe file's owner/perms */ +#define APR_OPENINFO 0x00100000 /* Open without READ or WRITE access */ +#define APR_OPENLINK 0x00200000 /* Open a link itself, if supported */ +#define APR_READCONTROL 0x00400000 /* Read the file's owner/perms */ +#define APR_WRITECONTROL 0x00800000 /* Modifythe file's owner/perms */ +#define APR_WRITEATTRS 0x01000000 /* Modify the file's attributes */ /* Entries missing from the MSVC 5.0 Win32 SDK: */ diff --git a/test/testfileinfo.c b/test/testfileinfo.c index a788193fbce..3a7073b5320 100644 --- a/test/testfileinfo.c +++ b/test/testfileinfo.c @@ -239,6 +239,53 @@ static void test_buffered_write_size(CuTest *tc) apr_file_close(thefile); } +static void test_mtime_set(CuTest *tc) +{ + apr_file_t *thefile; + apr_finfo_t finfo; + apr_time_t epoch = 0; + apr_status_t rv; + + /* This test sort of depends on the system clock being at least + * marginally ccorrect; We'll be setting the modification time to + * the epoch. + */ + rv = apr_file_open(&thefile, NEWFILENAME, + APR_READ | APR_WRITE | APR_CREATE | APR_TRUNCATE + | APR_BUFFERED | APR_DELONCLOSE, + APR_OS_DEFAULT, p); + apr_assert_success(tc, "open file", rv); + + /* Check that the current mtime is not the epoch */ + rv = apr_stat(&finfo, NEWFILENAME, APR_FINFO_MTIME, p); + if (rv == APR_INCOMPLETE) { + char *str; + int i; + str = apr_pstrdup(p, "APR_INCOMPLETE: Missing "); + for (i = 0; vfi[i].bits; ++i) { + if (vfi[i].bits & ~finfo.valid) { + str = apr_pstrcat(p, str, vfi[i].description, " ", NULL); + } + } + CuFail(tc, str); + } + apr_assert_success(tc, "get initial mtime", rv); + CuAssertTrue(tc, finfo.mtime != epoch); + + /* Reset the mtime to the epoch and verify the result. + * Note: we blindly assume that if the first apr_stat succeeded, + * the second one will, too. + */ + rv = apr_file_mtime_set(NEWFILENAME, epoch, p); + apr_assert_success(tc, "set mtime", rv); + + rv = apr_stat(&finfo, NEWFILENAME, APR_FINFO_MTIME, p); + apr_assert_success(tc, "get modified mtime", rv); + CuAssertTrue(tc, finfo.mtime == epoch); + + apr_file_close(thefile); +} + CuSuite *testfileinfo(void) { CuSuite *suite = CuSuiteNew("File Info"); @@ -247,6 +294,7 @@ CuSuite *testfileinfo(void) SUITE_ADD_TEST(suite, test_stat); SUITE_ADD_TEST(suite, test_stat_eq_finfo); SUITE_ADD_TEST(suite, test_buffered_write_size); + SUITE_ADD_TEST(suite, test_mtime_set); return suite; } From 05e57bc260f4538ebf58d3294c4c04ea19eace72 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Tue, 8 Jul 2003 06:26:48 +0000 Subject: [PATCH 4539/7878] Added a note to the apr_file_open_flags about the range of values reserved for the implementation, and changed the flag defines to use hex values instead of decimal for clarity. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64564 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 3d9e40413c9..68ad4b1c44e 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -86,25 +86,28 @@ extern "C" { * @{ */ -#define APR_READ 1 /**< Open the file for reading */ -#define APR_WRITE 2 /**< Open the file for writing */ -#define APR_CREATE 4 /**< Create the file if not there */ -#define APR_APPEND 8 /**< Append to the end of the file */ -#define APR_TRUNCATE 16 /**< Open the file and truncate to 0 length */ -#define APR_BINARY 32 /**< Open the file in binary mode */ -#define APR_EXCL 64 /**< Open should fail if APR_CREATE and file +/* Note to implementors: Values in the range 0x00100000--0x80000000 + are reserved for platform-specific values. */ + +#define APR_READ 0x00001 /**< Open the file for reading */ +#define APR_WRITE 0x00002 /**< Open the file for writing */ +#define APR_CREATE 0x00004 /**< Create the file if not there */ +#define APR_APPEND 0x00008 /**< Append to the end of the file */ +#define APR_TRUNCATE 0x00010 /**< Open the file and truncate to 0 length */ +#define APR_BINARY 0x00020 /**< Open the file in binary mode */ +#define APR_EXCL 0x00040 /**< Open should fail if APR_CREATE and file exists. */ -#define APR_BUFFERED 128 /**< Open the file for buffered I/O */ -#define APR_DELONCLOSE 256 /**< Delete the file after close */ -#define APR_XTHREAD 512 /**< Platform dependent tag to open the file +#define APR_BUFFERED 0x00080 /**< Open the file for buffered I/O */ +#define APR_DELONCLOSE 0x00100 /**< Delete the file after close */ +#define APR_XTHREAD 0x00200 /**< Platform dependent tag to open the file for use across multiple threads */ -#define APR_SHARELOCK 1024 /**< Platform dependent support for higher +#define APR_SHARELOCK 0x00400 /**< Platform dependent support for higher level locked read/write access to support writes across process/machines */ -#define APR_FILE_NOCLEANUP 2048 /**< Do not register a cleanup when the file +#define APR_FILE_NOCLEANUP 0x00800 /**< Do not register a cleanup when the file is opened */ -#define APR_SENDFILE_ENABLED 4096 /**< Advisory flag that this file should - support apr_sendfile operation */ +#define APR_SENDFILE_ENABLED 0x01000 /**< Advisory flag that this file should + support apr_sendfile operation */ /** @} */ /** From 3f275febfde672133120ef0433e3c8b5c600a18a Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 8 Jul 2003 12:53:12 +0000 Subject: [PATCH 4540/7878] apr_socket_data_set(): allow the same key to be used for multiple sockets in the same pool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64565 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/arch/os2/apr_arch_networkio.h | 8 +++++++ include/arch/unix/apr_arch_networkio.h | 8 +++++++ include/arch/win32/apr_arch_networkio.h | 8 +++++++ network_io/os2/sockets.c | 32 +++++++++++++++++++++---- network_io/unix/sockets.c | 30 ++++++++++++++++++++--- network_io/win32/sockets.c | 32 +++++++++++++++++++++---- test/testsockets.c | 28 ++++++++++++++++++++++ 8 files changed, 139 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index 47ade20fbb7..8dd240175fc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with APR 0.9.4 + + *) apr_socket_data_set(): allow the same key to be used for + multiple sockets in the same pool. [Jeff Trawick] + *) Add new table function apr_table_compress() and replace red-black trees with mergesort in apr_table_overlap() [Joe Schaefer , Brian Pane] diff --git a/include/arch/os2/apr_arch_networkio.h b/include/arch/os2/apr_arch_networkio.h index bd2900dc6d5..efd392a06da 100644 --- a/include/arch/os2/apr_arch_networkio.h +++ b/include/arch/os2/apr_arch_networkio.h @@ -63,6 +63,13 @@ #include #endif +typedef struct sock_userdata_t sock_userdata_t; +struct sock_userdata_t { + sock_userdata_t *next; + const char *key; + void *data; +}; + struct apr_socket_t { apr_pool_t *cntxt; int socketdes; @@ -77,6 +84,7 @@ struct apr_socket_t { int remote_addr_unknown; apr_int32_t netmask; apr_int32_t inherit; + sock_userdata_t *userdata; }; /* Error codes returned from sock_errno() */ diff --git a/include/arch/unix/apr_arch_networkio.h b/include/arch/unix/apr_arch_networkio.h index 9e95b9fd196..8250324a086 100644 --- a/include/arch/unix/apr_arch_networkio.h +++ b/include/arch/unix/apr_arch_networkio.h @@ -122,6 +122,13 @@ #define POLLNVAL 32 #endif +typedef struct sock_userdata_t sock_userdata_t; +struct sock_userdata_t { + sock_userdata_t *next; + const char *key; + void *data; +}; + struct apr_socket_t { apr_pool_t *cntxt; int socketdes; @@ -138,6 +145,7 @@ struct apr_socket_t { int remote_addr_unknown; apr_int32_t netmask; apr_int32_t inherit; + sock_userdata_t *userdata; }; const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); diff --git a/include/arch/win32/apr_arch_networkio.h b/include/arch/win32/apr_arch_networkio.h index db7fb5b3d58..8fe7e808bf6 100644 --- a/include/arch/win32/apr_arch_networkio.h +++ b/include/arch/win32/apr_arch_networkio.h @@ -58,6 +58,13 @@ #include "apr_network_io.h" #include "apr_general.h" +typedef struct sock_userdata_t sock_userdata_t; +struct sock_userdata_t { + sock_userdata_t *next; + const char *key; + void *data; +}; + struct apr_socket_t { apr_pool_t *cntxt; SOCKET socketdes; @@ -73,6 +80,7 @@ struct apr_socket_t { int remote_addr_unknown; apr_int32_t netmask; apr_int32_t inherit; + sock_userdata_t *userdata; }; #ifdef _WIN32_WCE diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index cd3b084f599..68061cd8df6 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -58,6 +58,7 @@ #include "apr_general.h" #include "apr_portable.h" #include "apr_lib.h" +#include "apr_strings.h" #include #include #include @@ -241,17 +242,40 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, - apr_socket_t *socket) + apr_socket_t *sock) { - return apr_pool_userdata_get(data, key, socket->cntxt); + sock_userdata_t *cur = sock->userdata; + + *data = NULL; + + while (cur) { + if (!strcmp(cur->key, key)) { + *data = cur->data; + break; + } + cur = cur->next; + } + + return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *socket, void *data, const char *key, +APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup) (void *)) { - return apr_pool_userdata_set(data, key, cleanup, socket->cntxt); + sock_userdata_t *new = apr_palloc(sock->cntxt, sizeof(sock_userdata_t)); + + new->key = apr_pstrdup(sock->cntxt, key); + new->data = data; + new->next = sock->userdata; + sock->userdata = new; + + if (cleanup) { + apr_pool_cleanup_register(sock->cntxt, data, cleanup, cleanup); + } + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index e1d5c7e8019..758be8a3868 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -54,6 +54,7 @@ #include "apr_arch_networkio.h" #include "apr_network_io.h" +#include "apr_strings.h" #include "apr_support.h" #include "apr_portable.h" #include "apr_arch_inherit.h" @@ -318,13 +319,36 @@ apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *sock) { - return apr_pool_userdata_get(data, key, sock->cntxt); + sock_userdata_t *cur = sock->userdata; + + *data = NULL; + + while (cur) { + if (!strcmp(cur->key, key)) { + *data = cur->data; + break; + } + cur = cur->next; + } + + return APR_SUCCESS; } apr_status_t apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, - apr_status_t (*cleanup) (void *)) + apr_status_t (*cleanup) (void *)) { - return apr_pool_userdata_set(data, key, cleanup, sock->cntxt); + sock_userdata_t *new = apr_palloc(sock->cntxt, sizeof(sock_userdata_t)); + + new->key = apr_pstrdup(sock->cntxt, key); + new->data = data; + new->next = sock->userdata; + sock->userdata = new; + + if (cleanup) { + apr_pool_cleanup_register(sock->cntxt, data, cleanup, cleanup); + } + + return APR_SUCCESS; } apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 10f648118ea..590e5758a00 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -57,6 +57,7 @@ #include "apr_general.h" #include "apr_lib.h" #include "apr_portable.h" +#include "apr_strings.h" #include #include "apr_arch_inherit.h" #include "apr_arch_misc.h" @@ -403,16 +404,39 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, } APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, - apr_socket_t *socket) + apr_socket_t *sock) { - return apr_pool_userdata_get(data, key, socket->cntxt); + sock_userdata_t *cur = sock->userdata; + + *data = NULL; + + while (cur) { + if (!strcmp(cur->key, key)) { + *data = cur->data; + break; + } + cur = cur->next; + } + + return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *socket, void *data, +APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup)(void *)) { - return apr_pool_userdata_set(data, key, cleanup, socket->cntxt); + sock_userdata_t *new = apr_palloc(sock->cntxt, sizeof(sock_userdata_t)); + + new->key = apr_pstrdup(sock->cntxt, key); + new->data = data; + new->next = sock->userdata; + sock->userdata = new; + + if (cleanup) { + apr_pool_cleanup_register(sock->cntxt, data, cleanup, cleanup); + } + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, diff --git a/test/testsockets.c b/test/testsockets.c index 2afa0ace7d0..860ef5964a3 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -168,6 +168,31 @@ static void sendto_receivefrom(CuTest *tc) apr_socket_close(sock2); } +static void socket_userdata(CuTest *tc) +{ + apr_socket_t *sock1, *sock2; + apr_status_t rv; + char *data; + const char *key = "GENERICKEY"; + + rv = apr_socket_create(&sock1, AF_INET, SOCK_STREAM, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_socket_create(&sock2, AF_INET, SOCK_STREAM, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_socket_data_set(sock1, "SOCK1", key, NULL); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + rv = apr_socket_data_set(sock2, "SOCK2", key, NULL); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_socket_data_get((void **)&data, key, sock1); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, "SOCK1", data); + rv = apr_socket_data_get((void **)&data, key, sock2); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertStrEquals(tc, "SOCK2", data); +} + CuSuite *testsockets(void) { CuSuite *suite = CuSuiteNew("Socket Creation"); @@ -179,6 +204,9 @@ CuSuite *testsockets(void) SUITE_ADD_TEST(suite, udp6_socket); SUITE_ADD_TEST(suite, sendto_receivefrom); + + SUITE_ADD_TEST(suite, socket_userdata); + return suite; } From 104a3a03eb97070712c62c96e6a80151d4ef5352 Mon Sep 17 00:00:00 2001 From: Ben Collins-Sussman Date: Tue, 8 Jul 2003 16:03:37 +0000 Subject: [PATCH 4541/7878] Finish the new timestamp-setting API, thanks to helpful tips from Brane and Cliff. Hopefully this will go out in httpd-2.0.48, and then subversion can make use of it. * configure.in: use AC_CHECK_FUNCS to look for utimes() and utime(). * file_io/unix/filestat.c (apr_file_mtime_set): use the new constants. * file_io/netware/filestat.c (apr_file_mtime_set): add dummy placeholder. * file_io/os2/filestat.c (apr_file_mtime_set): add dummy placeholder. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64566 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + file_io/netware/filestat.c | 8 ++++++++ file_io/os2/filestat.c | 9 +++++++++ file_io/unix/filestat.c | 33 ++++++++++++++++++++++++++------- 4 files changed, 44 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 2ea66c18e01..b60c8cfcb8e 100644 --- a/configure.in +++ b/configure.in @@ -788,6 +788,7 @@ AC_CHECK_FUNCS(writev) sendfile="0" AC_CHECK_LIB(sendfile, sendfilev) AC_CHECK_FUNCS(sendfile send_file sendfilev, [ sendfile="1" ]) +AC_CHECK_FUNCS(utime utimes) dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a dnl threaded poll() and we don't want to use sendfile on early FreeBSD diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 55512a9129d..ac3cbaeaf0b 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -387,3 +387,11 @@ APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, pool); } + +/* ### Somebody please write this! */ +APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, + apr_time_t mtime, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 747f6e9cea3..f1c77ce36aa 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -255,3 +255,12 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, return APR_FROM_OS_ERROR(rc); } + + +/* ### Somebody please write this! */ +APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, + apr_time_t mtime, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 08646f10971..54784ddaa0a 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -220,21 +220,40 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, { apr_status_t status; apr_finfo_t finfo; - struct timeval tvp[2]; status = apr_stat(&finfo, fname, APR_FINFO_ATIME, pool); if (!APR_STATUS_IS_SUCCESS(status)) { return status; } - tvp[0].tv_sec = apr_time_sec(finfo.atime); - tvp[0].tv_usec = apr_time_usec(finfo.atime); - tvp[1].tv_sec = apr_time_sec(mtime); - tvp[1].tv_usec = apr_time_usec(mtime); - - if (utimes(fname, tvp) == -1) { +#ifdef HAVE_UTIMES + { + struct timeval tvp[2]; + + tvp[0].tv_sec = apr_time_sec(finfo.atime); + tvp[0].tv_usec = apr_time_usec(finfo.atime); + tvp[1].tv_sec = apr_time_sec(mtime); + tvp[1].tv_usec = apr_time_usec(mtime); + + if (utimes(fname, tvp) == -1) { + return errno; + } + } +#elif defined(HAVE_UTIME) + { + struct utimbuf buf; + + buf.actime = (time_t) (finfo.atime / APR_USEC_PER_SEC); + buf.modtime = (time_t) (mtime / APR_USEC_PER_SEC); + + if (utime(fname, &buf) == -1) { return errno; + } } +#else + return APR_ENOTIMPL; +#endif + return APR_SUCCESS; } From c2460e8adf718b56dbc8275602a217efcf546346 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 10 Jul 2003 19:57:58 +0000 Subject: [PATCH 4542/7878] add a test that concentrates on APR_TRUNCATE git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64567 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/test/testfile.c b/test/testfile.c index 604ca605b9c..0bd4af9e089 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -506,6 +506,45 @@ static void test_mod_neg(CuTest *tc) CuAssertIntEquals(tc, APR_SUCCESS, rv); } +static void test_truncate(CuTest *tc) +{ + apr_status_t rv; + apr_file_t *f; + const char *fname = "data/testtruncate.dat"; + const char *s; + apr_size_t nbytes; + apr_finfo_t finfo; + + apr_file_remove(fname, p); + + rv = apr_file_open(&f, fname, + APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + s = "some data"; + nbytes = strlen(s); + rv = apr_file_write(f, s, &nbytes); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, strlen(s), nbytes); + + rv = apr_file_close(f); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_file_open(&f, fname, + APR_TRUNCATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_file_close(f); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + + rv = apr_stat(&finfo, fname, APR_FINFO_SIZE, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); + CuAssertIntEquals(tc, 0, finfo.size); + + rv = apr_file_remove(fname, p); + CuAssertIntEquals(tc, APR_SUCCESS, rv); +} + CuSuite *testfile(void) { CuSuite *suite = CuSuiteNew("File I/O"); @@ -530,6 +569,7 @@ CuSuite *testfile(void) SUITE_ADD_TEST(suite, test_gets); SUITE_ADD_TEST(suite, test_bigread); SUITE_ADD_TEST(suite, test_mod_neg); + SUITE_ADD_TEST(suite, test_truncate); return suite; } From 1e29897decfcdcdd129b5b4af0f44a4e04266561 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 14 Jul 2003 00:38:17 +0000 Subject: [PATCH 4543/7878] it's confusing as hell to get an allocated object back that's all zeros. yeah, yeah, we returned something other than APR_SUCCESS, but still. anyway, the win32 implementation already does this, so now we're consistent. Submitted by: Sander, Branko, Cliff git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64568 13f79535-47bb-0310-9956-ffa450edef68 --- mmap/unix/mmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index 42d39caf301..28f0f8b3b88 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -143,6 +143,7 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, if (aid < B_NO_ERROR) { /* we failed to get an area we can use... */ + *new = NULL; return APR_ENOMEM; } @@ -163,6 +164,7 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, if (mm == (void *)-1) { /* we failed to get an mmap'd file... */ + *new = NULL; return errno; } #endif From 7d3e94bd8f019e4abd514b78340696dad6e90b1e Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Jul 2003 09:00:55 +0000 Subject: [PATCH 4544/7878] Fix previous commit: HAVE_DECL_* is always defined, to 0 or 1. Submitted by: Max Bowsher git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64569 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/signals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index c2dd2775a7c..0b7dbc33321 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -141,7 +141,7 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func) /* AC_DECL_SYS_SIGLIST defines either of these symbols depending * on the version of autoconf used. */ -#if defined(SYS_SIGLIST_DECLARED) || defined(HAVE_DECL_SYS_SIGLIST) +#if defined(SYS_SIGLIST_DECLARED) || HAVE_DECL_SYS_SIGLIST void apr_signal_init(apr_pool_t *pglobal) { From 9ff016b91ec5e3fbf683f3396ad669f152de8586 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 14 Jul 2003 19:02:11 +0000 Subject: [PATCH 4545/7878] Implemented apr_file_mtime_set() for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64570 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 43 ++++++++++++++++++++++++++++-- include/arch/netware/apr_private.h | 2 ++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index ac3cbaeaf0b..d02c77a8469 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -62,6 +62,10 @@ #include "apr_hash.h" #include "apr_thread_rwlock.h" +#ifdef HAVE_UTIME_H +#include +#endif + /*#define APR_HAS_PSA*/ static apr_filetype_e filetype_from_mode(mode_t mode) @@ -388,10 +392,45 @@ APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, } -/* ### Somebody please write this! */ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, apr_time_t mtime, apr_pool_t *pool) { - return APR_ENOTIMPL; + apr_status_t status; + apr_finfo_t finfo; + + status = apr_stat(&finfo, fname, APR_FINFO_ATIME, pool); + if (!APR_STATUS_IS_SUCCESS(status)) { + return status; + } + +#ifdef HAVE_UTIMES + { + struct timeval tvp[2]; + + tvp[0].tv_sec = apr_time_sec(finfo.atime); + tvp[0].tv_usec = apr_time_usec(finfo.atime); + tvp[1].tv_sec = apr_time_sec(mtime); + tvp[1].tv_usec = apr_time_usec(mtime); + + if (utimes(fname, tvp) == -1) { + return errno; + } + } +#elif defined(HAVE_UTIME) + { + struct utimbuf buf; + + buf.actime = (time_t) (finfo.atime / APR_USEC_PER_SEC); + buf.modtime = (time_t) (mtime / APR_USEC_PER_SEC); + + if (utime(fname, &buf) == -1) { + return errno; + } + } +#else + return APR_ENOTIMPL; +#endif + + return APR_SUCCESS; } diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index fef19ecbc22..6eaf6030074 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -87,6 +87,7 @@ #define HAVE_SYS_MMAN_H 1 #define HAVE_FCNTL_H 1 #define HAVE_ICONV_H 1 +#define HAVE_UTIME_H 1 #define HAVE_STRICMP 1 #define HAVE_STRNICMP 1 @@ -94,6 +95,7 @@ #define HAVE_STRSTR 1 #define HAVE_MEMCHR 1 #define HAVE_CALLOC 1 +#define HAVE_UTIME 1 /*#define DSO_USE_DLFCN */ From 747c69135209343f8dadde65569e22674409572c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 17 Jul 2003 14:27:39 +0000 Subject: [PATCH 4546/7878] Use AI_ADDRCONFIG flag by default, where available. * sockaddr.c (call_resolver): For lookups of AF_UNSPEC addresses, set the AI_ADDRCONFIG flag; retry without the flag if getaddrinfo returns EAI_BADFLAGS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64571 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index ef0ec101047..c53ab48b178 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -373,7 +373,22 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, memset(&hints, 0, sizeof(hints)); hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; +#ifdef AI_ADDRCONFIG + if (family == AF_UNSPEC) { + /* By default, only look up addresses using address types for + * which a local interface is configured, i.e. no IPv6 if no + * IPv6 interfaces configured. */ + hints.ai_flags = AI_ADDRCONFIG; + } +#endif error = getaddrinfo(hostname, NULL, &hints, &ai_list); +#ifdef AI_ADDRCONFIG + if (error == EAI_BADFLAGS && family == AF_UNSPEC) { + /* Retry with no flags if AI_ADDRCONFIG was rejected. */ + hints.ai_flags = 0; + error = getaddrinfo(hostname, NULL, &hints, &ai_list); + } +#endif if (error) { #ifndef WIN32 if (error == EAI_SYSTEM) { From 3dbc232c374f1981ef9e3c7e300a84b5c5b52bbc Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Fri, 18 Jul 2003 23:10:04 +0000 Subject: [PATCH 4547/7878] * memory/unix/apr_pools.c (apr_pool_create_ex): Use the correct mutex when adding the pool to the pools parent child list. Submitted by: Brad Nicholes, Jean-Jacques Clar Reviewed by: Cliff Woolley, Sander Striker git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64572 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index de4fbbf1a26..d10012114c0 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -856,7 +856,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, #if APR_HAS_THREADS apr_thread_mutex_t *mutex; - if ((mutex = apr_allocator_mutex_get(allocator)) != NULL) + if ((mutex = apr_allocator_mutex_get(parent->allocator)) != NULL) apr_thread_mutex_lock(mutex); #endif /* APR_HAS_THREADS */ From b37aef2fc6f4ad8c9dd87e3c993f5c3cb53d8757 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 31 Jul 2003 17:44:36 +0000 Subject: [PATCH 4548/7878] Indicate that NetWare has the necessary environment functions to support the apr_env_*() functions git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64573 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/apr_private.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index 6eaf6030074..6ece404a966 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -97,6 +97,10 @@ #define HAVE_CALLOC 1 #define HAVE_UTIME 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_UNSETENV 1 + /*#define DSO_USE_DLFCN */ #ifdef NW_BUILD_IPV6 From 2c63a4dd6c205a345a05661793a771821aced634 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 31 Jul 2003 17:45:25 +0000 Subject: [PATCH 4549/7878] Increate the stack size of the apr test application to support some of the large stack allocations. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64574 13f79535-47bb-0310-9956-ffa450edef68 --- test/nwgnuaprtest | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/nwgnuaprtest b/test/nwgnuaprtest index 04a7d43ebd6..e3a71c83d5f 100644 --- a/test/nwgnuaprtest +++ b/test/nwgnuaprtest @@ -117,7 +117,7 @@ NLM_VERSION = 1,0,0 # # If this is specified, it will override the default of 64K # -NLM_STACK_SIZE = +NLM_STACK_SIZE = 524288 # # If this is specified it will be used by the link '-entry' directive @@ -188,6 +188,7 @@ FILES_nlm_objs = \ $(OBJDIR)/testpoll.o \ $(OBJDIR)/testpools.o \ $(OBJDIR)/testproc.o \ + $(OBJDIR)/testprocmutex.o \ $(OBJDIR)/testrand.o \ $(OBJDIR)/testsleep.o \ $(OBJDIR)/testsockets.o \ From 4bd7700fbf2a2721d10aa35cf851e33510197a43 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 31 Jul 2003 17:46:13 +0000 Subject: [PATCH 4550/7878] Add the multi-load flag to the proc_child test binary. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64575 13f79535-47bb-0310-9956-ffa450edef68 --- test/nwgnuproc_child | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/nwgnuproc_child b/test/nwgnuproc_child index 404e339fd71..51cffff21ce 100644 --- a/test/nwgnuproc_child +++ b/test/nwgnuproc_child @@ -141,7 +141,7 @@ NLM_CHECK_SYM = # # If this is specified it will be used by the link '-flags' directive # -NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION, MULTIPLE # # If this is specified it will be linked in with the XDCData option in the def From fc10ec4e18853e297de3f677805d1d1cc6663f3c Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 1 Aug 2003 11:06:52 +0000 Subject: [PATCH 4551/7878] leave a comment about an interesting and possibly unexpected behavior git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64576 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sendrecv.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 46bbe72713a..58777418789 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -741,6 +741,14 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, /* Ignore flags for now. */ flags = 0; + /* word to the wise: by default, AIX stores files sent by send_file() + * in the network buffer cache... there are supposedly scenarios + * where the most recent copy of the file won't be sent, but I can't + * recreate the potential problem, perhaps because of the way we + * use send_file()... if you suspect such a problem, try turning + * on the SF_SYNC_CACHE flag + */ + /* AIX can also send the headers/footers as part of the system call */ parms.header_length = 0; if (hdtr && hdtr->numheaders) { From aad4e59371da7a5e820810b2dc83fcca03f72746 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 6 Aug 2003 23:50:13 +0000 Subject: [PATCH 4552/7878] Invert the order of marking the lock as released. Since we first lock, then mark locked; instead mark as unlock (while the lock is still held) and then unlock. Serious change, this will mean that an unlock 'failure' will still set the unlocked flag. This is consistent with the fact that the lock probably is not held or valid anymore, and certainly shouldn't be re-unlocked when destroyed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64577 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 1fc630c38ad..8d020db2b87 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -165,10 +165,10 @@ static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) { int rc; + mutex->curr_locked = 0; if ((rc = sem_post((sem_t *)mutex->interproc->filedes)) < 0) { return errno; } - mutex->curr_locked = 0; return APR_SUCCESS; } @@ -269,13 +269,13 @@ static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex) { int rc; + mutex->curr_locked = 0; do { rc = semop(mutex->interproc->filedes, &proc_mutex_op_off, 1); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; } - mutex->curr_locked = 0; return APR_SUCCESS; } @@ -434,13 +434,13 @@ static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex) { apr_status_t rv; + mutex->curr_locked = 0; if ((rv = pthread_mutex_unlock(mutex->pthread_interproc))) { #ifdef PTHREAD_SETS_ERRNO rv = errno; #endif return rv; } - mutex->curr_locked = 0; return APR_SUCCESS; } @@ -553,13 +553,13 @@ static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex) { int rc; + mutex->curr_locked=0; do { rc = fcntl(mutex->interproc->filedes, F_SETLKW, &proc_mutex_unlock_it); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; } - mutex->curr_locked=0; return APR_SUCCESS; } @@ -661,13 +661,13 @@ static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *mutex) { int rc; + mutex->curr_locked = 0; do { rc = flock(mutex->interproc->filedes, LOCK_UN); } while (rc < 0 && errno == EINTR); if (rc < 0) { return errno; } - mutex->curr_locked = 0; return APR_SUCCESS; } From 93e7f76e2dedcccc99ca4b96b44ebc962ee198b6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 6 Aug 2003 23:54:31 +0000 Subject: [PATCH 4553/7878] Introduce the proc_mutex_no_tryacquire stub, returning APR_ENOTIMPL, for all unimplemented trylock vectors. Prevents us from simply segfaulting when a given proc_mutex style does not support trylock. No Apache HTTP Server code attempted an apr_proc_mutex_trylock, but this could affect other platforms, and was inconsistent with the implementations of other mutex methods and other platform implementations. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64578 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 8d020db2b87..e02796fe0e1 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -62,6 +62,10 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return apr_pool_cleanup_run(mutex->pool, mutex, apr_proc_mutex_cleanup); } +static apr_status_t proc_mutex_no_tryacquire(apr_proc_mutex_t *new_mutex) +{ + return APR_ENOTIMPL; +} #if APR_HAS_POSIXSEM_SERIALIZE @@ -188,7 +192,7 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_posix_methods = #endif proc_mutex_posix_create, proc_mutex_posix_acquire, - NULL, /* no tryacquire */ + proc_mutex_no_tryacquire, proc_mutex_posix_release, proc_mutex_posix_cleanup, proc_mutex_posix_child_init, @@ -293,7 +297,7 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods = #endif proc_mutex_sysv_create, proc_mutex_sysv_acquire, - NULL, /* no tryacquire */ + proc_mutex_no_tryacquire, proc_mutex_sysv_release, proc_mutex_sysv_cleanup, proc_mutex_sysv_child_init, @@ -456,7 +460,7 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_proc_pthread_method APR_PROCESS_LOCK_MECH_IS_GLOBAL, proc_mutex_proc_pthread_create, proc_mutex_proc_pthread_acquire, - NULL, /* no tryacquire */ + proc_mutex_no_tryacquire, proc_mutex_proc_pthread_release, proc_mutex_proc_pthread_cleanup, proc_mutex_proc_pthread_child_init, @@ -579,7 +583,7 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods = #endif proc_mutex_fcntl_create, proc_mutex_fcntl_acquire, - NULL, /* no tryacquire */ + proc_mutex_no_tryacquire, proc_mutex_fcntl_release, proc_mutex_fcntl_cleanup, proc_mutex_fcntl_child_init, @@ -705,7 +709,7 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_flock_methods = #endif proc_mutex_flock_create, proc_mutex_flock_acquire, - NULL, /* no tryacquire */ + proc_mutex_no_tryacquire, proc_mutex_flock_release, proc_mutex_flock_cleanup, proc_mutex_flock_child_init, From 1411cb3b6a7cd362d52f660fff2596b318e60abe Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 7 Aug 2003 22:16:24 +0000 Subject: [PATCH 4554/7878] Revamp apr_thread_mutex to be as thread safe, and occasionally as reentrant as possible. Switched to atomics to preserve the incr/decr integrity. Although we previously reset the thread_id to zero, it's been pointed out on list that this is less than desireable. However, negative one isn't necessarily a good choice because several platforms have unsigned thread_t's. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64579 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/unix/apr_arch_thread_mutex.h | 5 +- locks/unix/thread_mutex.c | 80 ++++++++++++++++------- 2 files changed, 60 insertions(+), 25 deletions(-) diff --git a/include/arch/unix/apr_arch_thread_mutex.h b/include/arch/unix/apr_arch_thread_mutex.h index 20e72a7ce26..a8171e0e4af 100644 --- a/include/arch/unix/apr_arch_thread_mutex.h +++ b/include/arch/unix/apr_arch_thread_mutex.h @@ -60,6 +60,7 @@ #include "apr_general.h" #include "apr_thread_mutex.h" #include "apr_portable.h" +#include "apr_atomic.h" #if APR_HAVE_PTHREAD_H #include @@ -69,8 +70,8 @@ struct apr_thread_mutex_t { apr_pool_t *pool; pthread_mutex_t mutex; - apr_os_thread_t owner; - int owner_ref; + volatile apr_os_thread_t owner; + volatile apr_atomic_t owner_ref; char nested; /* a boolean */ }; #endif diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index 39062a2bd8e..e304bcb5cb5 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -108,8 +108,13 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) apr_status_t rv; if (mutex->nested) { + /* + * Although threadsafe, this test is NOT reentrant. + * The thread's main and reentrant attempts will both mismatch + * testing the mutex is owned by this thread, so a deadlock is expected. + */ if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { - mutex->owner_ref++; + apr_atomic_inc(mutex->owner_ref); return APR_SUCCESS; } @@ -121,8 +126,17 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) return rv; } + if (apr_atomic_cas(&mutex->owner_ref, 1, 0) != 0) { + /* The owner_ref should be zero when the lock is not held, + * if owner_ref was non-zero we have a mutex reference bug. + * XXX: so now what? + */ + mutex->owner_ref = 1; + } + /* Note; do not claim ownership until the owner_ref has been + * incremented; limits a subtle race in reentrant code. + */ mutex->owner = apr_os_thread_current(); - mutex->owner_ref = 1; return rv; } else { @@ -141,8 +155,14 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) apr_status_t rv; if (mutex->nested) { + /* + * Although threadsafe, this test is NOT reentrant. + * The thread's main and reentrant attempts will both mismatch + * testing the mutex is owned by this thread, so one will fail + * the trylock. + */ if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { - mutex->owner_ref++; + apr_atomic_inc(mutex->owner_ref); return APR_SUCCESS; } @@ -154,8 +174,17 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) return (rv == EBUSY) ? APR_EBUSY : rv; } + if (apr_atomic_cas(&mutex->owner_ref, 1, 0) != 0) { + /* The owner_ref should be zero when the lock is not held, + * if owner_ref was non-zero we have a mutex reference bug. + * XXX: so now what? + */ + mutex->owner_ref = 1; + } + /* Note; do not claim ownership until the owner_ref has been + * incremented; limits a subtle race in reentrant code. + */ mutex->owner = apr_os_thread_current(); - mutex->owner_ref = 1; } else { rv = pthread_mutex_trylock(&mutex->mutex); @@ -175,32 +204,37 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) apr_status_t status; if (mutex->nested) { + /* + * The code below is threadsafe and reentrant. + */ if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { - mutex->owner_ref--; - if (mutex->owner_ref > 0) + /* + * This should never occur, and indicates an application error + */ + if (mutex->owner_ref == 0) { + return APR_EINVAL; + } + + if (apr_atomic_dec(mutex->owner_ref) != 0) return APR_SUCCESS; + mutex->owner = 0; } - status = pthread_mutex_unlock(&mutex->mutex); - if (status) { -#ifdef PTHREAD_SETS_ERRNO - status = errno; -#endif - return status; + /* + * This should never occur, and indicates an application error + */ + else { + return APR_EINVAL; } - - memset(&mutex->owner, 0, sizeof mutex->owner); - mutex->owner_ref = 0; - return status; } - else { - status = pthread_mutex_unlock(&mutex->mutex); + + status = pthread_mutex_unlock(&mutex->mutex); #ifdef PTHREAD_SETS_ERRNO - if (status) { - status = errno; - } -#endif - return status; + if (status) { + status = errno; } +#endif + + return status; } APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) From 10d65b0a1cf4571b80f3614930ffe44ec3d2f097 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 7 Aug 2003 23:20:02 +0000 Subject: [PATCH 4555/7878] Worth noting in case they had bitten anyone. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64580 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGES b/CHANGES index 8dd240175fc..7391520de65 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,14 @@ Changes with APR 0.9.4 + *) Change the behavior of unix process 'trylock's to return + APR_ENOTIMPL instead of segfaulting, consistent with the + other lock implementations. [William Rowe] + + *) Fix a subtle race where the ownership of a unix nested + thread lock could be corrupted when the prior owner released + the lock with another thread waiting on the same lock. + [William Rowe] + *) apr_socket_data_set(): allow the same key to be used for multiple sockets in the same pool. [Jeff Trawick] From 3945118eca137790597eb919e2d073c13048ffe2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 8 Aug 2003 19:20:23 +0000 Subject: [PATCH 4556/7878] Thanks to Jeff for pointing out I didn't point to the atomics. Fixes build breakage. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64581 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/thread_mutex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c index e304bcb5cb5..db637cdf0da 100644 --- a/locks/unix/thread_mutex.c +++ b/locks/unix/thread_mutex.c @@ -114,7 +114,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) * testing the mutex is owned by this thread, so a deadlock is expected. */ if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { - apr_atomic_inc(mutex->owner_ref); + apr_atomic_inc(&mutex->owner_ref); return APR_SUCCESS; } @@ -162,7 +162,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) * the trylock. */ if (apr_os_thread_equal(mutex->owner, apr_os_thread_current())) { - apr_atomic_inc(mutex->owner_ref); + apr_atomic_inc(&mutex->owner_ref); return APR_SUCCESS; } @@ -215,7 +215,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) return APR_EINVAL; } - if (apr_atomic_dec(mutex->owner_ref) != 0) + if (apr_atomic_dec(&mutex->owner_ref) != 0) return APR_SUCCESS; mutex->owner = 0; } From 2131cf04bd87b7d59dcd41ebfac02687818e31b3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 11 Aug 2003 17:40:38 +0000 Subject: [PATCH 4557/7878] HP-UX: don't specify generic code (+DAportable) if the user has set CFLAGS to indicate a specific archiecture no functional change; this just gets rid of some annoying warning messages from conflicting +DAarch options git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64582 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index b60c8cfcb8e..e163a281051 100644 --- a/configure.in +++ b/configure.in @@ -314,7 +314,11 @@ fi # combinations case "$host:$CC" in *-hp-hpux*:cc ) - APR_ADDTO(CFLAGS,[-Ae +DAportable +Z]) + APR_ADDTO(CFLAGS,[-Ae +Z]) + if echo "$CFLAGS " | grep '+DA' >/dev/null; then : + else + APR_ADDTO(CFLAGS,[+DAportable]) + fi ;; powerpc-*-beos:mwcc* ) APR_SETVAR(CPP,[mwcc -E]) From d4842bd23d8b93279f5c47e6a2b90e52806d13d4 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 11 Aug 2003 18:19:38 +0000 Subject: [PATCH 4558/7878] axe a mysterious rbb line that ignored user-specified CFLAGS when building the test programs git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64583 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index f61f7d5f544..463ac13955e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -42,8 +42,6 @@ readchild@EXEEXT@ INCDIR=../include INCLUDES=-I$(INCDIR) -CFLAGS=$(MY_CFLAGS) - check: $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE) for prog in $(STDTEST_PORTABLE) $(STDTEST_NONPORTABLE); do \ ./$$prog; \ From 1864ed4fa3e39990a88f777822c7f2a461116e32 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 13 Aug 2003 01:32:11 +0000 Subject: [PATCH 4559/7878] rename "this" to "here" since "this" is a reserved word in c++ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64584 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_ring.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/apr_ring.h b/include/apr_ring.h index 2f0984b2a05..25a1f20bed9 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -488,28 +488,28 @@ APR_RING_CHECK_ELEM(APR_RING_SENTINEL(hp, elem, link), elem, link, msg) #define APR_RING_CHECK_ELEM(ep, elem, link, msg) do { \ struct elem *start = (ep); \ - struct elem *this = start; \ + struct elem *here = start; \ fprintf(stderr, "*** ring check start -- %s\n", msg); \ do { \ - fprintf(stderr, "\telem %p\n", this); \ + fprintf(stderr, "\telem %p\n", here); \ fprintf(stderr, "\telem->next %p\n", \ - APR_RING_NEXT(this, link)); \ + APR_RING_NEXT(here, link)); \ fprintf(stderr, "\telem->prev %p\n", \ - APR_RING_PREV(this, link)); \ + APR_RING_PREV(here, link)); \ fprintf(stderr, "\telem->next->prev %p\n", \ - APR_RING_PREV(APR_RING_NEXT(this, link), link)); \ + APR_RING_PREV(APR_RING_NEXT(here, link), link)); \ fprintf(stderr, "\telem->prev->next %p\n", \ - APR_RING_NEXT(APR_RING_PREV(this, link), link)); \ - if (APR_RING_PREV(APR_RING_NEXT(this, link), link) != this) { \ - fprintf(stderr, "\t*** this->next->prev != this\n"); \ + APR_RING_NEXT(APR_RING_PREV(here, link), link)); \ + if (APR_RING_PREV(APR_RING_NEXT(here, link), link) != here) { \ + fprintf(stderr, "\t*** elem->next->prev != elem\n"); \ break; \ } \ - if (APR_RING_NEXT(APR_RING_PREV(this, link), link) != this) { \ - fprintf(stderr, "\t*** this->prev->next != this\n"); \ + if (APR_RING_NEXT(APR_RING_PREV(here, link), link) != here) { \ + fprintf(stderr, "\t*** elem->prev->next != elem\n"); \ break; \ } \ - this = APR_RING_NEXT(this, link); \ - } while (this != start); \ + here = APR_RING_NEXT(here, link); \ + } while (here != start); \ fprintf(stderr, "*** ring check end\n"); \ } while (0) #else From 2774b834a9c83076869cdcca8c184f6cfb34cbd3 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 13 Aug 2003 01:46:12 +0000 Subject: [PATCH 4560/7878] seemed like a handy tool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64585 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_ring.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/include/apr_ring.h b/include/apr_ring.h index 25a1f20bed9..6bb935bc3a9 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -482,10 +482,14 @@ #ifdef APR_RING_DEBUG #include +#include + #define APR_RING_CHECK_ONE(msg, ptr) \ fprintf(stderr, "*** %s %p\n", msg, ptr) + #define APR_RING_CHECK(hp, elem, link, msg) \ APR_RING_CHECK_ELEM(APR_RING_SENTINEL(hp, elem, link), elem, link, msg) + #define APR_RING_CHECK_ELEM(ep, elem, link, msg) do { \ struct elem *start = (ep); \ struct elem *here = start; \ @@ -512,6 +516,17 @@ } while (here != start); \ fprintf(stderr, "*** ring check end\n"); \ } while (0) + +#define APR_RING_CHECK_CONSISTENCY(hp, elem, link) do { \ + struct elem *start = APR_RING_SENTINEL(hp, elem, link); \ + struct elem *here = start; \ + do { \ + assert(APR_RING_PREV(APR_RING_NEXT(here, link), link) == here); \ + assert(APR_RING_NEXT(APR_RING_PREV(here, link), link) == here); \ + here = APR_RING_NEXT(here, link); \ + } while (here != start); \ + } while (0) + #else /** * Print a single pointer value to STDERR @@ -531,6 +546,16 @@ * @param msg Descriptive message */ #define APR_RING_CHECK(hp, elem, link, msg) +/** + * Loops around a ring and checks all the pointers for consistency. Pops + * an assertion if any inconsistency is found. Same idea as APR_RING_CHECK() + * except that it's silent if all is well. + * (This is a no-op unless APR_RING_DEBUG is defined.) + * @param hp Head of the ring + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_CHECK_CONSISTENCY(hp, elem, link) /** * Dump all ring pointers to STDERR, starting with the given element and * looping all the way around the ring back to that element. Aborts if From 8dabd2ca13b2aaacf9ef8f68f96247e2c89b2c88 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 13 Aug 2003 01:51:29 +0000 Subject: [PATCH 4561/7878] ha, then i go to try to use the thing and find out what APR_RING_CHECK_ELEM() was for in the first place. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64586 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_ring.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/include/apr_ring.h b/include/apr_ring.h index 6bb935bc3a9..c449eaa7675 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -517,8 +517,12 @@ fprintf(stderr, "*** ring check end\n"); \ } while (0) -#define APR_RING_CHECK_CONSISTENCY(hp, elem, link) do { \ - struct elem *start = APR_RING_SENTINEL(hp, elem, link); \ +#define APR_RING_CHECK_CONSISTENCY(hp, elem, link) \ + APR_RING_CHECK_ELEM_CONSISTENCY(APR_RING_SENTINEL(hp, elem, link),\ + elem, link) + +#define APR_RING_CHECK_ELEM_CONSISTENCY(ep, elem, link) do { \ + struct elem *start = (ep); \ struct elem *here = start; \ do { \ assert(APR_RING_PREV(APR_RING_NEXT(here, link), link) == here); \ @@ -567,6 +571,17 @@ * @param msg Descriptive message */ #define APR_RING_CHECK_ELEM(ep, elem, link, msg) +/** + * Loops around a ring, starting with the given element, and checks all + * the pointers for consistency. Pops an assertion if any inconsistency + * is found. Same idea as APR_RING_CHECK_ELEM() except that it's silent + * if all is well. + * (This is a no-op unless APR_RING_DEBUG is defined.) + * @param ep The element + * @param elem The name of the element struct + * @param link The name of the APR_RING_ENTRY in the element struct + */ +#define APR_RING_CHECK_ELEM_CONSISTENCY(ep, elem, link) #endif /** @} */ From ea9f61e3c9aa6b43d53e6512c080d1408def652f Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 13 Aug 2003 19:21:44 +0000 Subject: [PATCH 4562/7878] Modify apr_sockaddr_info_get to call the resolver when we do not have a hostname. Also, fix bugs in the getaddrinfo() implementation which are present when a hostname is not available. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Justin modified Colm's patch to set servname when we do not have a hostname. RFC 2553 requires one of them to be non-NULL, and Solaris enforces that.) Submitted by: Colm MacC�rthaigh Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64587 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ network_io/unix/sockaddr.c | 37 ++++++++++++++++++++----------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/CHANGES b/CHANGES index 7391520de65..ecc87693e63 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR 0.9.4 + *) Modify apr_sockaddr_info_get to call the resolver when we + do not have a hostname. Also, fix bugs in the getaddrinfo() + implementation. + [Colm MacCárthaigh , Justin Erenkrantz] + *) Change the behavior of unix process 'trylock's to return APR_ENOTIMPL instead of segfaulting, consistent with the other lock implementations. [William Rowe] diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index c53ab48b178..639303ab50c 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -369,6 +369,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, struct addrinfo hints, *ai, *ai_list; apr_sockaddr_t *prev_sa; int error; + char *servname = NULL; memset(&hints, 0, sizeof(hints)); hints.ai_family = family; @@ -381,12 +382,23 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, hints.ai_flags = AI_ADDRCONFIG; } #endif - error = getaddrinfo(hostname, NULL, &hints, &ai_list); + if(hostname == NULL) { +#ifdef AI_PASSIVE + /* If hostname is NULL, assume we are trying to bind to all + * interfaces. */ + hints.ai_flags |= AI_PASSIVE; +#endif + /* getaddrinfo according to RFC 2553 must have either hostname + * or servname non-NULL. + */ + servname = apr_itoa(p, port); + } + error = getaddrinfo(hostname, servname, &hints, &ai_list); #ifdef AI_ADDRCONFIG if (error == EAI_BADFLAGS && family == AF_UNSPEC) { /* Retry with no flags if AI_ADDRCONFIG was rejected. */ hints.ai_flags = 0; - error = getaddrinfo(hostname, NULL, &hints, &ai_list); + error = getaddrinfo(hostname, servname, &hints, &ai_list); } #endif if (error) { @@ -490,6 +502,11 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, struct in_addr ipaddr; char *addr_list[2]; + if (hostname == NULL) { + /* if we are given a NULL hostname, assume '0.0.0.0' */ + hostname = "0.0.0.0"; + } + if (*hostname >= '0' && *hostname <= '9' && strspn(hostname, "0123456789.") == strlen(hostname)) { @@ -580,21 +597,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, #endif } - if (hostname) { -#if !APR_HAVE_IPV6 - if (family == APR_UNSPEC) { - family = APR_INET; - } -#endif - return find_addresses(sa, hostname, family, port, flags, p); - } - - *sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); - (*sa)->pool = p; - apr_sockaddr_vars_set(*sa, - family == APR_UNSPEC ? APR_INET : family, - port); - return APR_SUCCESS; + return find_addresses(sa, hostname, family, port, flags, p); } APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, From ade05547ca33e36fa066d681019617ecc9be4162 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 14 Aug 2003 00:09:28 +0000 Subject: [PATCH 4563/7878] Make the getaddrinfo (IPv6) and gethostbyname (IPv4) implementations consistent in storing NULL values in the hostname if that is what was passed in by the caller. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64588 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 639303ab50c..e721ef5e3a0 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -431,7 +431,9 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, apr_sockaddr_vars_set(new_sa, ai->ai_family, port); if (!prev_sa) { /* first element in new list */ - new_sa->hostname = apr_pstrdup(p, hostname); + if (hostname) { + new_sa->hostname = apr_pstrdup(p, hostname); + } *sa = new_sa; } else { @@ -501,6 +503,7 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, struct hostent hs; struct in_addr ipaddr; char *addr_list[2]; + const char *orig_hostname = hostname; if (hostname == NULL) { /* if we are given a NULL hostname, assume '0.0.0.0' */ @@ -560,7 +563,9 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, apr_sockaddr_vars_set(new_sa, AF_INET, port); if (!prev_sa) { /* first element in new list */ - new_sa->hostname = apr_pstrdup(p, hostname); + if (orig_hostname) { + new_sa->hostname = apr_pstrdup(p, orig_hostname); + } *sa = new_sa; } else { From dd2b638df0f5b2196b1186e8727eff0b8dd799cd Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 14 Aug 2003 17:36:17 +0000 Subject: [PATCH 4564/7878] If we don't have IPv6 enabled within APR (even if the OS supports it), we need to fail over to APR_INET rather than passing APR_UNSPEC. (Justin tweaked the patch so this code would always execute and add a description why we need this because it's not exactly obvious.) Submitted by: Colm MacCarthaigh Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64589 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index e721ef5e3a0..8ce8a8fe70d 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -601,7 +601,17 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, } #endif } - +#if !APR_HAVE_IPV6 + /* What may happen is that APR is not IPv6-enabled, but we're still + * going to call getaddrinfo(), so we have to tell the OS we only + * want IPv4 addresses back since we won't know what to do with + * IPv6 addresses. + */ + if (family == APR_UNSPEC) { + family = APR_INET; + } +#endif + return find_addresses(sa, hostname, family, port, flags, p); } From 53bc369476129f509640bd55796b92344a03e980 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Fri, 15 Aug 2003 02:21:55 +0000 Subject: [PATCH 4565/7878] Set the hostnames on all apr_sockaddr_t's returned. Since we're at the same lifetime as the prev_sa, it's safe to just point to that one as well. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64590 13f79535-47bb-0310-9956-ffa450edef68 --- network_io/unix/sockaddr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 8ce8a8fe70d..7e111db18ce 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -437,6 +437,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, *sa = new_sa; } else { + new_sa->hostname = prev_sa->hostname; prev_sa->next = new_sa; } @@ -569,6 +570,7 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, *sa = new_sa; } else { + new_sa->hostname = prev_sa->hostname; prev_sa->next = new_sa; } From 1487045d2df4a935dc73e724d8c0c52b5318a778 Mon Sep 17 00:00:00 2001 From: Thom May Date: Sat, 23 Aug 2003 10:01:22 +0000 Subject: [PATCH 4566/7878] Add apr_temp_dir_get(), a function to get the most suitable directory to place temp files based on environment variables and other factors. Obtained from: C Mike Pilato Reviewed by: Thom May git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64591 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 1 + apr.dsp | 4 + file_io/unix/Makefile.in | 3 +- file_io/unix/tempdir.c | 166 +++++++++++++++++++++++++++++++++++++++ include/apr_file_io.h | 16 ++++ libapr.dsp | 4 + 6 files changed, 193 insertions(+), 1 deletion(-) create mode 100644 file_io/unix/tempdir.c diff --git a/NWGNUmakefile b/NWGNUmakefile index d70976ba629..3f1083a032b 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -286,6 +286,7 @@ FILES_lib_objs = \ $(OBJDIR)/sockets.o \ $(OBJDIR)/sockopt.o \ $(OBJDIR)/start.o \ + $(OBJDIR)/tempdir.o \ $(OBJDIR)/thread.o \ $(OBJDIR)/thread_cond.o \ $(OBJDIR)/thread_mutex.o \ diff --git a/apr.dsp b/apr.dsp index 285694be8ab..b58c6f1b3f7 100644 --- a/apr.dsp +++ b/apr.dsp @@ -155,6 +155,10 @@ SOURCE=.\file_io\win32\readwrite.c SOURCE=.\file_io\win32\seek.c # End Source File +# Begin Source File + +SOURCE=.\file_io\unix\tempdir.c +# End Source File # End Group # Begin Group "locks" diff --git a/file_io/unix/Makefile.in b/file_io/unix/Makefile.in index 01473a8011f..fbc93b1c775 100644 --- a/file_io/unix/Makefile.in +++ b/file_io/unix/Makefile.in @@ -15,7 +15,8 @@ TARGETS = \ pipe.lo \ readwrite.lo \ seek.lo \ - mktemp.lo + mktemp.lo \ + tempdir.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/file_io/unix/tempdir.c b/file_io/unix/tempdir.c new file mode 100644 index 00000000000..b9bc80a8b21 --- /dev/null +++ b/file_io/unix/tempdir.c @@ -0,0 +1,166 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ +#include "apr_private.h" +#include "apr_file_io.h" +#include "apr_strings.h" +#include "apr_env.h" + +/* + * FIXME + * Currently, this variable is a bit of misnomer. + * The intention is to have this in APR's global pool so that we don't have + * to go through this every time. + */ +static char global_temp_dir[APR_PATH_MAX+1] = { 0 }; + +/* Try to open a temporary file in the temporary dir, write to it, + and then close it. */ +static int test_tempdir(const char *temp_dir, apr_pool_t *p) +{ + apr_file_t *dummy_file; + const char *path = apr_pstrcat(p, temp_dir, "/apr-tmp", NULL); + + if (apr_file_mktemp(&dummy_file, (char *)path, 0, p) == APR_SUCCESS) { + if (apr_file_putc('!', dummy_file) == APR_SUCCESS) { + if (apr_file_close(dummy_file) == APR_SUCCESS) { + return 1; + } + } + } + return 0; +} + + +APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, + apr_pool_t *p) +{ + apr_status_t apr_err; + const char *try_dirs[] = { "/tmp", "/usr/tmp", "/var/tmp" }; + const char *try_envs[] = { "TMP", "TEMP", "TMPDIR" }; + char *cwd; + int i; + + /* Our goal is to find a temporary directory suitable for writing + into. We'll only pay the price once if we're successful -- we + cache our successful find. Here's the order in which we'll try + various paths: + + $TMP + $TEMP + $TMPDIR + "C:\TEMP" (windows only) + "/tmp" + "/var/tmp" + "/usr/tmp" + P_tmpdir (POSIX define) + `pwd` + + NOTE: This algorithm is basically the same one used by Python + 2.2's tempfile.py module. */ + + /* Try the environment first. */ + for (i = 0; i < (sizeof(try_envs) / sizeof(const char *)); i++) { + char *value; + apr_err = apr_env_get(&value, try_envs[i], p); + if ((apr_err == APR_SUCCESS) && value) { + apr_size_t len = strlen(value); + if (len && (len < APR_PATH_MAX) && test_tempdir(value, p)) { + memcpy(global_temp_dir, value, len + 1); + goto end; + } + } + } + +#ifdef WIN32 + /* Next, on Win32, try the C:\TEMP directory. */ + if (test_tempdir("C:\\TEMP", p)) { + memcpy(global_temp_dir, "C:\\TEMP", 7 + 1); + goto end; + } +#endif + + /* Next, try a set of hard-coded paths. */ + for (i = 0; i < (sizeof(try_dirs) / sizeof(const char *)); i++) { + if (test_tempdir(try_dirs[i], p)) { + memcpy(global_temp_dir, try_dirs[i], strlen(try_dirs[i]) + 1); + goto end; + } + } + +#ifdef P_tmpdir + /* + * If we have it, use the POSIX definition of where + * the tmpdir should be + */ + if (test_tempdir(P_tmpdir, p)) { + memcpy(global_temp_dir, P_tmpdir, strlen(P_tmpdir) +1); + goto end; + } +#endif + + /* Finally, try the current working directory. */ + if (APR_SUCCESS == apr_filepath_get(&cwd, APR_FILEPATH_NATIVE, p)) { + if (test_tempdir(cwd, p)) { + memcpy(global_temp_dir, cwd, strlen(cwd) + 1); + goto end; + } + } + +end: + if (global_temp_dir[0]) { + *temp_dir = apr_pstrdup(p, global_temp_dir); + return APR_SUCCESS; + } + return APR_EGENERAL; +} diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 68ad4b1c44e..dbc8d422dfa 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -764,6 +764,22 @@ APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *templ, apr_int32_t flags, apr_pool_t *p); + +/** + * Find an existing directory suitable as a temporary storage location. + * @param temp_dir The temp directory. + * @param p The pool to use for any necessary allocations. + * @remark + * This function uses an algorithm to search for a directory that an + * an application can use for temporary storage. Once such a + * directory is found, that location is cached by the library. Thus, + * callers only pay the cost of this algorithm once if that one time + * is successful. + * + */ +APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, + apr_pool_t *p); + /** @} */ #ifdef __cplusplus diff --git a/libapr.dsp b/libapr.dsp index 95191f378ad..070f5ed5f63 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -161,6 +161,10 @@ SOURCE=.\file_io\win32\readwrite.c SOURCE=.\file_io\win32\seek.c # End Source File +# Begin Source File + +SOURCE=.\file_io\unix\tempdir.c +# End Source File # End Group # Begin Group "locks" From a6a789def8cfc89a7d8261c9ae4ddda4a1ed600c Mon Sep 17 00:00:00 2001 From: Thom May Date: Sat, 23 Aug 2003 10:03:42 +0000 Subject: [PATCH 4567/7878] oops, need a CHANGES entry git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64592 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index ecc87693e63..91f2081457d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.4 + *) Add apr_temp_dir_get() for getting the most suitable temp directory + [CMike Pilato , Thom May] + *) Modify apr_sockaddr_info_get to call the resolver when we do not have a hostname. Also, fix bugs in the getaddrinfo() implementation. From ce855fa402f2cfcaaf4863ca21d803fbc400e801 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 24 Aug 2003 23:09:19 +0000 Subject: [PATCH 4568/7878] Re-enable IPv6 on Darwin 6.6 and beyond as it looks like getaddrinfo() now works with IPv4-mapped addresses. (It works here, but independent confirmation would be welcomed.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64593 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 91f2081457d..2ecde95a2ab 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR 0.9.4 + *) Re-enable IPv6 on Darwin 6.6 (and higher) as getaddrinfo() looks to be + doing the right things with IPv4-mapped addresses. [Justin Erenkrantz] + *) Add apr_temp_dir_get() for getting the most suitable temp directory [CMike Pilato , Thom May] diff --git a/configure.in b/configure.in index e163a281051..4955e285845 100644 --- a/configure.in +++ b/configure.in @@ -435,7 +435,10 @@ case $host in *linux*) os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/'` ;; - *) + *darwin*) + os_version=`uname -r | sed -e 's/\(.\)\.\(.\).*/\1\2/'` + ;; + *) os_version=OS_VERSION_IS_NOT_SET ;; esac @@ -1781,9 +1784,14 @@ AC_ARG_ENABLE(ipv6, case $host in *apple-darwin*) # It appears that Jaguar has all the right features, but - # getnameinfo() fails to find the hostname for a mapped + # getnameinfo() fails to find the hostname for an IPv4mapped # address. - broken_ipv6=1 + # All signs point that 6.6 (aka Mac OS 10.2.6+) is okay. + if test $os_version -lt "66"; then + broken_ipv6=1 + else + broken_ipv6=0 + fi ;; *) broken_ipv6=0 From df4d4f31fe22b20ca57dbd9a0791b7dc22f0c455 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 24 Aug 2003 23:10:25 +0000 Subject: [PATCH 4569/7878] Don't prefix $(SHELL) on the apr-libtool argument, as we're not guaranteed that libtool is a shell script. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64594 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apr-config.in b/apr-config.in index 797c1fe13fd..ae9ed4a5a2c 100644 --- a/apr-config.in +++ b/apr-config.in @@ -279,9 +279,9 @@ while test $# -gt 0; do ;; --apr-libtool) if test "$location" = "installed"; then - echo "${SHELL} ${installbuilddir}/libtool" + echo "${installbuilddir}/libtool" else - echo "${SHELL} $thisdir/libtool" + echo "$thisdir/libtool" fi exit 0 ;; From 850d14f76b071b031eee95678f5100972930cf2d Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 24 Aug 2003 23:18:22 +0000 Subject: [PATCH 4570/7878] Add an --experimental-libtool option that allows the user to specify an alternate libtool. (jlibtool.c isn't included with APR, but this just allows support for it by dropping it into the tree in the 'right' place alongside aplibtool.c.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64595 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 4955e285845..1b39a31a8ad 100644 --- a/configure.in +++ b/configure.in @@ -129,6 +129,9 @@ dnl prep libtool dnl echo "performing libtool configuration..." +AC_ARG_ENABLE(experimental-libtool,[ --experimental-libtool Use experimental custom libtool (not included in source distribution)], + [experimental_libtool=$enableval],[experimental_libtool=no]) + case $host in *os2*) # Use a custom-made libtool replacement @@ -136,15 +139,27 @@ case $host in LIBTOOL="$srcdir/build/aplibtool" gcc $CFLAGS $CPPFLAGS -o $LIBTOOL.exe $LIBTOOL.c ;; -*) dnl libtoolize requires that the following not be indented -AC_PROG_LIBTOOL +*) if test "x$LTFLAGS" = "x"; then LTFLAGS='--silent' fi - # get libtool's setting of shlibpath_var - eval `grep "^shlibpath_var=[[A-Z_]]*$" $apr_builddir/libtool` - if test "x$shlibpath_var" = "x"; then - shlibpath_var=REPLACE_WITH_YOUR_SHLIBPATH_VAR + if test "$experimental_libtool" = "yes"; then + # Use a custom-made libtool replacement + echo "using jlibtool" + LIBTOOL="$apr_builddir/libtool" + LIBTOOL_SRC="$apr_srcdir/build/jlibtool.c" + if test ! -f $LIBTOOL_SRC; then + AC_MSG_ERROR([Experimental libtool source not found. It is not included with APR by default.]) + fi + $CC $CFLAGS $CPPFLAGS -o $LIBTOOL $LIBTOOL_SRC + else + dnl libtoolize requires that the following not be indented +AC_PROG_LIBTOOL + # get libtool's setting of shlibpath_var + eval `grep "^shlibpath_var=[[A-Z_]]*$" $apr_builddir/libtool` + if test "x$shlibpath_var" = "x"; then + shlibpath_var=REPLACE_WITH_YOUR_SHLIBPATH_VAR + fi fi ;; esac From 922c274f6ce0bffb0c59caf04ff6d76a7a9f07da Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 25 Aug 2003 18:17:36 +0000 Subject: [PATCH 4571/7878] Merge the apu_want.hnw header processing into the NetWare build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64596 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUmakefile | 1 + build/nw_export.inc | 1 + build/prebuildNW.bat | 1 + 3 files changed, 3 insertions(+) diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index bbacbbf89a4..1c51bd00ca9 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -18,6 +18,7 @@ include $(APR_WORK)\build\NWGNUhead.inc FILES_prebuild_headers = \ $(APR)/include/apr.h \ $(APRUTIL)/include/apu.h \ + $(APRUTIL)/include/apu_want.h \ $(APRUTIL)/include/apr_ldap.h \ $(APRUTIL)/include/private/apu_config.h \ $(APRUTIL)/include/private/apu_select_dbm.h \ diff --git a/build/nw_export.inc b/build/nw_export.inc index 294e179a29f..731b8bc0bfe 100644 --- a/build/nw_export.inc +++ b/build/nw_export.inc @@ -78,3 +78,4 @@ #include "apr_xlate.h" #include "apr_xml.h" #include "apu_compat.h" +#include "apu_want.h" diff --git a/build/prebuildNW.bat b/build/prebuildNW.bat index 427aa25ece6..941d920c9bf 100755 --- a/build/prebuildNW.bat +++ b/build/prebuildNW.bat @@ -28,6 +28,7 @@ copy ..\include\apr.hnw ..\include\apr.h @echo Fixing up the APR-Util headers copy ..\..\apr-util\include\apu.hnw ..\..\apr-util\include\apu.h +copy ..\..\apr-util\include\apu_want.hnw ..\..\apr-util\include\apu_want.h copy ..\..\apr-util\include\apr_ldap.hnw ..\..\apr-util\include\apr_ldap.h copy ..\..\apr-util\include\private\apu_config.hw ..\..\apr-util\include\private\apu_config.h copy ..\..\apr-util\xml\expat\lib\expat.h.in ..\..\apr-util\xml\expat\lib\expat.h From 7817e104b9c94dfd9ea211dc1b92f6ab5a40abe9 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 25 Aug 2003 18:21:06 +0000 Subject: [PATCH 4572/7878] Add the path to the NetWare TMP directory to the list of test directories. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64597 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/tempdir.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/file_io/unix/tempdir.c b/file_io/unix/tempdir.c index b9bc80a8b21..c560c007c8a 100644 --- a/file_io/unix/tempdir.c +++ b/file_io/unix/tempdir.c @@ -100,6 +100,7 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, $TEMP $TMPDIR "C:\TEMP" (windows only) + "SYS:\TMP" (netware only) "/tmp" "/var/tmp" "/usr/tmp" @@ -129,6 +130,13 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, goto end; } #endif +#ifdef NETWARE + /* Next, on NetWare, try the SYS:/TMP directory. */ + if (test_tempdir("SYS:/TMP", p)) { + memcpy(global_temp_dir, "SYS:/TMP", 8 + 1); + goto end; + } +#endif /* Next, try a set of hard-coded paths. */ for (i = 0; i < (sizeof(try_dirs) / sizeof(const char *)); i++) { From 7311f4412626ecccc28c55fb11902aa1eb5bd403 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Fri, 29 Aug 2003 13:45:02 +0000 Subject: [PATCH 4573/7878] Include apr_temp_dir_get() in OS/2 build. One of TMP or TEMP will normally be defined on OS/2 so the code's fine as it is. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64598 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/Makefile.in | 3 ++- file_io/os2/tempdir.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 file_io/os2/tempdir.c diff --git a/file_io/os2/Makefile.in b/file_io/os2/Makefile.in index 33673e01477..a87f4242399 100644 --- a/file_io/os2/Makefile.in +++ b/file_io/os2/Makefile.in @@ -17,7 +17,8 @@ TARGETS = \ filepath_util.lo \ filesys.lo \ mktemp.lo \ - copy.lo + copy.lo \ + tempdir.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ diff --git a/file_io/os2/tempdir.c b/file_io/os2/tempdir.c new file mode 100644 index 00000000000..6823569f296 --- /dev/null +++ b/file_io/os2/tempdir.c @@ -0,0 +1 @@ +#include "../unix/tempdir.c" From ebd2fd9cc70eab604100ea0095e55800cba65d1d Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 31 Aug 2003 16:28:55 +0000 Subject: [PATCH 4574/7878] Attempt to put this Darwin getnameinfo() sillyness behind us forever. If future releases of Darwin get it 'right', then we'll detect that. Take Jeff's gni_mapped and rewrite it as an autoconf macro, so we can do configure-time detection of this brokenness and stop hardcoding Darwin's inability to do the drop down. Then, take Colm's patch and make it conditional on the autoconf macro above. Submitted by: Colm MacCarthaigh and Jeff Trawick Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64599 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +-- build/apr_network.m4 | 68 ++++++++++++++++++++++++++++++++++++++ configure.in | 28 ++++++---------- network_io/unix/sockaddr.c | 19 +++++++++++ 4 files changed, 100 insertions(+), 20 deletions(-) diff --git a/CHANGES b/CHANGES index 2ecde95a2ab..95777f51be8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,8 @@ Changes with APR 0.9.4 - *) Re-enable IPv6 on Darwin 6.6 (and higher) as getaddrinfo() looks to be - doing the right things with IPv4-mapped addresses. [Justin Erenkrantz] + *) Work around a bug in Darwin when calling getnameinfo() on IPv4-mapped + IPv6-addresses. [Colm MacCárthaigh , Jeff Trawick, + Justin Erenkrantz] *) Add apr_temp_dir_get() for getting the most suitable temp directory [CMike Pilato , Thom May] diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 73f69bfc6e9..9f2bb327eda 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -140,6 +140,74 @@ if test "$ac_cv_negative_eai" = "yes"; then fi ]) +dnl +dnl check for getnameinfo() that properly resolves IPv4-mapped IPv6 addresses +dnl +dnl Darwin is known not to map them correctly +dnl +AC_DEFUN(APR_CHECK_GETNAMEINFO_IPV4_MAPPED,[ + AC_CACHE_CHECK(whether getnameinfo resolves IPv4-mapped IPv6 addresses, + ac_cv_getnameinfo_ipv4_mapped,[ + AC_TRY_RUN( [ +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + +void main(void) { + struct sockaddr_in6 sa = {0}; + struct in_addr ipv4; + char hbuf[NI_MAXHOST]; + unsigned int *addr32; + int error; + + ipv4.s_addr = inet_addr("127.0.0.1"); + + sa.sin6_family = AF_INET6; + sa.sin6_port = 0; + + addr32 = (unsigned int *)&sa.sin6_addr; + addr32[2] = htonl(0x0000FFFF); + addr32[3] = ipv4.s_addr; + assert(IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)); + +#ifdef SIN6_LEN + sa.sin_len = sizeof(sa); +#endif + + error = getnameinfo((const struct sockaddr *)&sa, sizeof(sa), + hbuf, sizeof(hbuf), NULL, 0, + NI_NUMERICHOST); + if (error) { + exit(1); + } else { + exit(0); + } +} +],[ + ac_cv_getnameinfo_ipv4_mapped="yes" +],[ + ac_cv_getnameinfo_ipv4_mapped="no" +],[ + ac_cv_getnameinfo_ipv4_mapped="yes" +])]) +if test "$ac_cv_getnameinfo_ipv4_mapped" = "no"; then + AC_DEFINE(GETNAMEINFO_IPV4_MAPPED_FAILS, 1, + [Define if getnameinfo does not map IPv4 address correctly]) +fi +]) + dnl dnl check for presence of retrans/retry variables in the res_state structure dnl diff --git a/configure.in b/configure.in index 1b39a31a8ad..48b58bd4ccf 100644 --- a/configure.in +++ b/configure.in @@ -1797,17 +1797,6 @@ AC_ARG_ENABLE(ipv6, [ user_disabled_ipv6=0 ] ) case $host in - *apple-darwin*) - # It appears that Jaguar has all the right features, but - # getnameinfo() fails to find the hostname for an IPv4mapped - # address. - # All signs point that 6.6 (aka Mac OS 10.2.6+) is okay. - if test $os_version -lt "66"; then - broken_ipv6=1 - else - broken_ipv6=0 - fi - ;; *) broken_ipv6=0 esac @@ -1821,31 +1810,34 @@ APR_CHECK_NEGATIVE_EAI APR_CHECK_WORKING_GETNAMEINFO APR_CHECK_SOCKADDR_IN6 -AC_MSG_CHECKING(if APR supports IPv6) have_ipv6="0" if test "$user_disabled_ipv6" = 1; then - AC_MSG_RESULT([no -- disabled by user]) + ipv6_result="no -- disabled by user" else if test "x$broken_ipv6" = "x0"; then if test "x$have_sockaddr_in6" = "x1"; then if test "x$ac_cv_working_getaddrinfo" = "xyes"; then if test "x$ac_cv_working_getnameinfo" = "xyes"; then + APR_CHECK_GETNAMEINFO_IPV4_MAPPED have_ipv6="1" - AC_MSG_RESULT([yes]) + ipv6_result="yes" else - AC_MSG_RESULT([no -- no getnameinfo]) + ipv6_result="no -- no getnameinfo" fi else - AC_MSG_RESULT([no -- no working getaddrinfo]) + ipv6_result="no -- no working getaddrinfo" fi else - AC_MSG_RESULT([no -- no sockaddr_in6]) + ipv6_result="no -- no sockaddr_in6" fi else - AC_MSG_RESULT([no -- the platform has problems supporting IPv6]) + ipv6_result="no -- the platform has known problems supporting IPv6" fi fi +AC_MSG_CHECKING(if APR supports IPv6) +AC_MSG_RESULT($ipv6_result) + AC_SUBST(have_ipv6) dnl Check for langinfo support diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 7e111db18ce..765252b2e10 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -632,10 +632,29 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, /* don't know if it is portable for getnameinfo() to set h_errno; * clear it then see if it was set */ SET_H_ERRNO(0); + /* default flags are NI_NAMREQD; otherwise, getnameinfo() will return * a numeric address string if it fails to resolve the host name; * that is *not* what we want here + * + * Additionally, if we know getnameinfo() doesn't handle IPv4-mapped + * IPv6 addresses correctly, drop down to IPv4 before calling + * getnameinfo(). */ +#ifdef GETNAMEINFO_IPV4_MAPPED_FAILS + if (sockaddr->family == AF_INET6 && + IN6_IS_ADDR_V4MAPPED(&sockaddr->sa.sin6.sin6_addr)) { + struct apr_sockaddr_t tmpsa; + tmpsa.sa.sin.sin_family = AF_INET; + tmpsa.sa.sin.sin_addr.s_addr = ((uint32_t *)sockaddr->ipaddr_ptr)[3]; + + rc = getnameinfo((const struct sockaddr *)&tmpsa.sa, + sizeof(struct sockaddr_in), + tmphostname, sizeof(tmphostname), NULL, 0, + flags != 0 ? flags : NI_NAMEREQD); + } + else +#endif rc = getnameinfo((const struct sockaddr *)&sockaddr->sa, sockaddr->salen, tmphostname, sizeof(tmphostname), NULL, 0, flags != 0 ? flags : NI_NAMEREQD); From 1ea4d8e6bcdb886d03dc30114ddeb3531fd6d0e9 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 31 Aug 2003 18:14:38 +0000 Subject: [PATCH 4575/7878] Toss the assert for now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64600 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 1 - 1 file changed, 1 deletion(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 9f2bb327eda..5d07b68dd34 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -180,7 +180,6 @@ void main(void) { addr32 = (unsigned int *)&sa.sin6_addr; addr32[2] = htonl(0x0000FFFF); addr32[3] = ipv4.s_addr; - assert(IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)); #ifdef SIN6_LEN sa.sin_len = sizeof(sa); From 4f88ab263df7bdc403642c93a1a8bb09f729ac59 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 2 Sep 2003 08:17:01 +0000 Subject: [PATCH 4576/7878] Use correct _len field in APR_CHECK_WORKING_GETNAMEINFO. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64601 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 5d07b68dd34..745b9a9718a 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -182,7 +182,7 @@ void main(void) { addr32[3] = ipv4.s_addr; #ifdef SIN6_LEN - sa.sin_len = sizeof(sa); + sa.sin6_len = sizeof(sa); #endif error = getnameinfo((const struct sockaddr *)&sa, sizeof(sa), From 7ac1da5dbe9920d543425ce82c0b5e415fabf4ef Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 2 Sep 2003 08:42:56 +0000 Subject: [PATCH 4577/7878] Remove APR_CHECK_SOCKADDR_SA_LEN which survived since the first addition of IPv6 support to APR without its result being used. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64602 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 31 ------------------------------- configure.in | 2 -- 2 files changed, 33 deletions(-) diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 745b9a9718a..f37e25c0dc8 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -632,37 +632,6 @@ else fi ]) - -dnl -dnl Check to see if this platform includes sa_len in it's -dnl struct sockaddr. If it does it changes the length of sa_family -dnl which could cause us problems -dnl -AC_DEFUN(APR_CHECK_SOCKADDR_SA_LEN,[ -AC_CACHE_CHECK(for sockaddr sa_len, ac_cv_define_sockaddr_sa_len,[ -AC_TRY_COMPILE([ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -],[ -struct sockaddr_in sai; -int i = sai.sin_len; -],[ - ac_cv_define_sockaddr_sa_len=yes -],[ - ac_cv_define_sockaddr_sa_len=no -]) -]) - -if test "$ac_cv_define_sockaddr_sa_len" = "yes"; then - AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1 ,[Define if we have length field in sockaddr_in]) -fi -]) - - dnl dnl APR_INADDR_NONE dnl diff --git a/configure.in b/configure.in index 48b58bd4ccf..a5075ece651 100644 --- a/configure.in +++ b/configure.in @@ -1729,8 +1729,6 @@ fi AC_SUBST(have_in_addr) AC_SUBST(file_as_socket) -APR_CHECK_SOCKADDR_SA_LEN - # Check the types only if we have gethostbyname_r if test "$ac_cv_func_gethostbyname_r" = "yes"; then APR_CHECK_GETHOSTBYNAME_R_STYLE From 808dbec891d6a8b73a69007b4f92e5dfcf2d3d72 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 3 Sep 2003 04:30:50 +0000 Subject: [PATCH 4578/7878] style police git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64603 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/seek.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 708d81ab5c3..725e522ab45 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -114,7 +114,8 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh *offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; return rc; - } else { + } + else { rv = lseek(thefile->filedes, *offset, where); if (rv == -1) { From f282cbc983847092efa4a70b526aaf94697616b3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 3 Sep 2003 14:43:53 +0000 Subject: [PATCH 4579/7878] remove these deprecated interfaces: apr_accept, apr_bind, apr_connect, apr_listen, apr_shutdown, apr_socket_create_ex, MAX_SECONDS_TO_LINGER git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64604 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 12 +++++++++++ include/apr_network_io.h | 42 ++------------------------------------ network_io/os2/sockets.c | 41 ++----------------------------------- network_io/unix/sockets.c | 41 ++----------------------------------- network_io/win32/sockets.c | 42 +++----------------------------------- test/client.c | 2 +- test/sendfile.c | 2 +- test/server.c | 2 +- test/testpoll.c | 2 +- test/testsockets.c | 16 +++++++-------- test/testsockopt.c | 2 +- 11 files changed, 34 insertions(+), 170 deletions(-) diff --git a/CHANGES b/CHANGES index 95777f51be8..ce44e05cd42 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,15 @@ +Changes with APR 1.0 + + *) The following deprecated interfaces have been removed: + + apr_accept -> apr_socket_accept + apr_bind -> apr_socket_bind + apr_connect -> apr_socket_connect + apr_listen -> apr_socket_listen + apr_shutdown -> apr_socket_shutdown + apr_socket_create_ex -> apr_socket_create + MAX_SECONDS_TO_LINGER -> APR_MAX_SECONDS_TO_LINGER + Changes with APR 0.9.4 *) Work around a bug in Darwin when calling getnameinfo() on IPv4-mapped diff --git a/include/apr_network_io.h b/include/apr_network_io.h index cad7118102d..dd18ed35903 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -84,11 +84,6 @@ extern "C" { #define APR_MAX_SECS_TO_LINGER 30 #endif -#ifndef MAX_SECS_TO_LINGER -/** @deprecated @see APR_MAX_SECS_TO_LINGER */ -#define MAX_SECS_TO_LINGER APR_MAX_SECS_TO_LINGER -#endif - #ifndef APRMAXHOSTLEN /** Maximum hostname length */ #define APRMAXHOSTLEN 256 @@ -293,32 +288,17 @@ struct apr_hdtr_t { /** * Create a socket. - * @remark With APR 1.0, this function follows the prototype - * of apr_socket_create_ex. * @param new_sock The new socket that has been set up. * @param family The address family of the socket (e.g., APR_INET). * @param type The type of the socket (e.g., SOCK_STREAM). + * @param protocol The protocol of the socket (e.g., APR_PROTO_TCP). * @param cont The pool to use */ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, int family, int type, + int protocol, apr_pool_t *cont); -/** - * Create a socket. - * @remark With APR 1.0, this function is deprecated and apr_socket_create - * follows this prototype. - * @param new_sock The new socket that has been set up. - * @param family The address family of the socket (e.g., APR_INET). - * @param type The type of the socket (e.g., SOCK_STREAM). - * @param protocol The protocol of the socket (e.g., APR_PROTO_TCP). - * @param cont The pool to use - */ -APR_DECLARE(apr_status_t) apr_socket_create_ex(apr_socket_t **new_sock, - int family, int type, - int protocol, - apr_pool_t *cont); - /** * Shutdown either reading, writing, or both sides of a socket. * @param thesocket The socket to close @@ -335,10 +315,6 @@ APR_DECLARE(apr_status_t) apr_socket_create_ex(apr_socket_t **new_sock, APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how); -/** @deprecated @see apr_socket_shutdown */ -APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, - apr_shutdown_how_e how); - /** * Close a socket. * @param thesocket The socket to close @@ -355,9 +331,6 @@ APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket); APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, apr_sockaddr_t *sa); -/** @deprecated @see apr_socket_bind */ -APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa); - /** * Listen to a bound socket for connections. * @param sock The socket to listen on @@ -368,9 +341,6 @@ APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa); APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, apr_int32_t backlog); -/** @deprecated @see apr_socket_listen */ -APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog); - /** * Accept a new connection request * @param new_sock A copy of the socket that is connected to the socket that @@ -383,11 +353,6 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new_sock, apr_socket_t *sock, apr_pool_t *connection_pool); -/** @deprecated @see apr_socket_accept */ -APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new_sock, - apr_socket_t *sock, - apr_pool_t *connection_pool); - /** * Issue a connection request to a socket either on the same machine * or a different one. @@ -399,9 +364,6 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new_sock, APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa); -/** @deprecated @see apr_socket_connect */ -APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa); - /** * Create apr_sockaddr_t from hostname, address family, and port. * @param sa The new apr_sockaddr_t. diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 68061cd8df6..899e312278d 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -111,8 +111,8 @@ APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, int *proto return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_create_ex(apr_socket_t **new, int family, int type, - int protocol, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int type, + int protocol, apr_pool_t *cont) { int downgrade = (family == AF_UNSPEC); @@ -146,12 +146,6 @@ APR_DECLARE(apr_status_t) apr_socket_create_ex(apr_socket_t **new, int family, i return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int type, - apr_pool_t *cont) -{ - return apr_socket_create_ex(new, family, type, 0, cont); -} - APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { @@ -344,34 +338,3 @@ APR_IMPLEMENT_INHERIT_SET(socket, inherit, cntxt, socket_cleanup) APR_IMPLEMENT_INHERIT_UNSET(socket, inherit, cntxt, socket_cleanup) -/* deprecated */ -APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, - apr_shutdown_how_e how) -{ - return apr_socket_shutdown(thesocket, how); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) -{ - return apr_socket_bind(sock, sa); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) -{ - return apr_socket_listen(sock, backlog); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, - apr_pool_t *connection_context) -{ - return apr_socket_accept(new, sock, connection_context); -} - -/* deprecated */ -APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) -{ - return apr_socket_connect(sock, sa); -} diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 758be8a3868..0c99393273f 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -111,8 +111,8 @@ apr_status_t apr_socket_protocol_get(apr_socket_t *sock, int *protocol) return APR_SUCCESS; } -apr_status_t apr_socket_create_ex(apr_socket_t **new, int ofamily, int type, - int protocol, apr_pool_t *cont) +apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, + int protocol, apr_pool_t *cont) { int family = ofamily; @@ -147,12 +147,6 @@ apr_status_t apr_socket_create_ex(apr_socket_t **new, int ofamily, int type, return APR_SUCCESS; } -apr_status_t apr_socket_create(apr_socket_t **new, int family, int type, - apr_pool_t *cont) -{ - return apr_socket_create_ex(new, family, type, 0, cont); -} - apr_status_t apr_socket_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { @@ -420,34 +414,3 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, APR_IMPLEMENT_INHERIT_SET(socket, inherit, cntxt, socket_cleanup) APR_IMPLEMENT_INHERIT_UNSET(socket, inherit, cntxt, socket_cleanup) - -/* deprecated */ -apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) -{ - return apr_socket_shutdown(thesocket, how); -} - -/* deprecated */ -apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) -{ - return apr_socket_bind(sock, sa); -} - -/* deprecated */ -apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) -{ - return apr_socket_listen(sock, backlog); -} - -/* deprecated */ -apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, - apr_pool_t *connection_context) -{ - return apr_socket_accept(new, sock, connection_context); -} - -/* deprecated */ -apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) -{ - return apr_socket_connect(sock, sa); -} diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 590e5758a00..46bdeb053c2 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -103,9 +103,9 @@ APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_create_ex(apr_socket_t **new, int family, - int type, int protocol, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, + int type, int protocol, + apr_pool_t *cont) { int downgrade = (family == AF_UNSPEC); @@ -180,12 +180,6 @@ APR_DECLARE(apr_status_t) apr_socket_create_ex(apr_socket_t **new, int family, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, - int type, apr_pool_t *cont) -{ - return apr_socket_create_ex(new, family, type, 0, cont); -} - APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { @@ -531,34 +525,4 @@ APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *socket) { apr_socket_inherit_unset(socket); } -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, - apr_shutdown_how_e how) -{ - return apr_socket_shutdown(thesocket, how); -} - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa) -{ - return apr_socket_bind(sock, sa); -} -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog) -{ - return apr_socket_listen(sock, backlog); -} - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, - apr_pool_t *p) -{ - return apr_socket_accept(new, sock, p); -} - -/* Deprecated */ -APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) -{ - return apr_socket_connect(sock, sa); -} diff --git a/test/client.c b/test/client.c index ff85bb756c8..7e023a792e1 100644 --- a/test/client.c +++ b/test/client.c @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) fprintf(stdout,"OK\n"); fprintf(stdout, "\tClient: Creating new socket......."); - if (apr_socket_create(&sock, remote_sa->family, SOCK_STREAM, + if (apr_socket_create(&sock, remote_sa->family, SOCK_STREAM, 0, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); diff --git a/test/sendfile.c b/test/sendfile.c index 95e5c3ad545..34d8315c304 100644 --- a/test/sendfile.c +++ b/test/sendfile.c @@ -115,7 +115,7 @@ static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family) } *sock = NULL; - rv = apr_socket_create(sock, *family, SOCK_STREAM, *p); + rv = apr_socket_create(sock, *family, SOCK_STREAM, 0, *p); if (rv != APR_SUCCESS) { fprintf(stderr, "apr_socket_create()->%d/%s\n", rv, diff --git a/test/server.c b/test/server.c index da20d259860..5a8268fbe56 100644 --- a/test/server.c +++ b/test/server.c @@ -114,7 +114,7 @@ int main(int argc, const char * const argv[]) } APR_TEST_SUCCESS(rv, "Creating new socket", - apr_socket_create_ex(&sock, family, SOCK_STREAM, APR_PROTO_TCP, context)) + apr_socket_create(&sock, family, SOCK_STREAM, APR_PROTO_TCP, context)) APR_TEST_SUCCESS(rv, "Setting option APR_SO_NONBLOCK", apr_socket_opt_set(sock, APR_SO_NONBLOCK, 1)) diff --git a/test/testpoll.c b/test/testpoll.c index ccef578f139..c6b634d1a3c 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -81,7 +81,7 @@ static void make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, rv = apr_sockaddr_info_get(sa, "127.0.0.1", APR_UNSPEC, port, 0, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); - rv = apr_socket_create(sock, (*sa)->family, SOCK_DGRAM, p); + rv = apr_socket_create(sock, (*sa)->family, SOCK_DGRAM, 0, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); rv =apr_socket_bind((*sock), (*sa)); diff --git a/test/testsockets.c b/test/testsockets.c index 860ef5964a3..87f46a02769 100644 --- a/test/testsockets.c +++ b/test/testsockets.c @@ -73,7 +73,7 @@ static void tcp_socket(CuTest *tc) apr_status_t rv; apr_socket_t *sock = NULL; - rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, p); + rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, 0, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); CuAssertPtrNotNull(tc, sock); apr_socket_close(sock); @@ -84,7 +84,7 @@ static void udp_socket(CuTest *tc) apr_status_t rv; apr_socket_t *sock = NULL; - rv = apr_socket_create(&sock, APR_INET, SOCK_DGRAM, p); + rv = apr_socket_create(&sock, APR_INET, SOCK_DGRAM, 0, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); CuAssertPtrNotNull(tc, sock); apr_socket_close(sock); @@ -96,7 +96,7 @@ static void tcp6_socket(CuTest *tc) apr_status_t rv; apr_socket_t *sock = NULL; - rv = apr_socket_create(&sock, APR_INET6, SOCK_STREAM, p); + rv = apr_socket_create(&sock, APR_INET6, SOCK_STREAM, 0, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); CuAssertPtrNotNull(tc, sock); apr_socket_close(sock); @@ -111,7 +111,7 @@ static void udp6_socket(CuTest *tc) apr_status_t rv; apr_socket_t *sock = NULL; - rv = apr_socket_create(&sock, APR_INET6, SOCK_DGRAM, p); + rv = apr_socket_create(&sock, APR_INET6, SOCK_DGRAM, 0, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); CuAssertPtrNotNull(tc, sock); apr_socket_close(sock); @@ -133,9 +133,9 @@ static void sendto_receivefrom(CuTest *tc) apr_sockaddr_t *to; apr_size_t len = 30; - rv = apr_socket_create(&sock, FAMILY, SOCK_DGRAM, p); + rv = apr_socket_create(&sock, FAMILY, SOCK_DGRAM, 0, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); - rv = apr_socket_create(&sock2, FAMILY, SOCK_DGRAM, p); + rv = apr_socket_create(&sock2, FAMILY, SOCK_DGRAM, 0, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = apr_sockaddr_info_get(&to, US, APR_UNSPEC, 7772, 0, p); @@ -175,9 +175,9 @@ static void socket_userdata(CuTest *tc) char *data; const char *key = "GENERICKEY"; - rv = apr_socket_create(&sock1, AF_INET, SOCK_STREAM, p); + rv = apr_socket_create(&sock1, AF_INET, SOCK_STREAM, 0, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); - rv = apr_socket_create(&sock2, AF_INET, SOCK_STREAM, p); + rv = apr_socket_create(&sock2, AF_INET, SOCK_STREAM, 0, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = apr_socket_data_set(sock1, "SOCK1", key, NULL); diff --git a/test/testsockopt.c b/test/testsockopt.c index 18ace7fc96a..27c9e0f9cea 100644 --- a/test/testsockopt.c +++ b/test/testsockopt.c @@ -64,7 +64,7 @@ static void create_socket(CuTest *tc) { apr_status_t rv; - rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, p); + rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, 0, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); CuAssertPtrNotNull(tc, sock); } From fa0598d2f83d55c31a8141202450f39ab730ab67 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 3 Sep 2003 16:31:47 +0000 Subject: [PATCH 4580/7878] axe these deprecated functions: apr_getsocketopt, apr_recv, apr_recvfrom, apr_send, apr_sendfile, apr_sendto, apr_sendv, apr_setsocketopt, apr_socket_set_inherit, apr_socket_unset_inherit git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64605 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 10 ++++++ include/apr_file_io.h | 4 +-- include/apr_network_io.h | 42 ---------------------- include/arch/unix/apr_arch_inherit.h | 10 ------ include/arch/win32/apr_arch_inherit.h | 10 ------ network_io/beos/sendrecv.c | 38 -------------------- network_io/os2/sendrecv.c | 22 ------------ network_io/os2/sendrecv_udp.c | 18 ---------- network_io/os2/sockopt.c | 14 -------- network_io/unix/sendrecv.c | 48 ++----------------------- network_io/unix/sockopt.c | 14 -------- network_io/win32/sendrecv.c | 50 ++------------------------- network_io/win32/sockets.c | 11 +----- network_io/win32/sockopt.c | 14 -------- 14 files changed, 17 insertions(+), 288 deletions(-) diff --git a/CHANGES b/CHANGES index ce44e05cd42..74dcf26df03 100644 --- a/CHANGES +++ b/CHANGES @@ -5,9 +5,19 @@ Changes with APR 1.0 apr_accept -> apr_socket_accept apr_bind -> apr_socket_bind apr_connect -> apr_socket_connect + apr_getsocketopt -> apr_socket_opt_get apr_listen -> apr_socket_listen + apr_recv -> apr_socket_recv + apr_recvfrom -> apr_socket_recvfrom + apr_send -> apr_socket_send + apr_sendfile -> apr_socket_sendfile + apr_sendto -> apr_socket_sendto + apr_sendv -> apr_socket_sendv + apr_setsocketopt -> apr_socket_opt_set apr_shutdown -> apr_socket_shutdown apr_socket_create_ex -> apr_socket_create + apr_socket_set_inherit -> apr_socket_inherit_set + apr_socket_unset_inherit -> apr_socket_inherit_unset MAX_SECONDS_TO_LINGER -> APR_MAX_SECONDS_TO_LINGER Changes with APR 0.9.4 diff --git a/include/apr_file_io.h b/include/apr_file_io.h index dbc8d422dfa..a33a5dab06d 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -107,7 +107,7 @@ extern "C" { #define APR_FILE_NOCLEANUP 0x00800 /**< Do not register a cleanup when the file is opened */ #define APR_SENDFILE_ENABLED 0x01000 /**< Advisory flag that this file should - support apr_sendfile operation */ + support apr_socket_sendfile operation */ /** @} */ /** @@ -195,7 +195,7 @@ typedef struct apr_file_t apr_file_t; * be closed when the pool is destroyed. * APR_SENDFILE_ENABLED Open with appropriate platform semantics * for sendfile operations. Advisory only, - * apr_sendfile does not check this flag. + * apr_socket_sendfile does not check this flag. *
    */ +/* ### is this deprecated, too? */ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, apr_int32_t *nsds, apr_interval_time_t timeout); -/** - * Add a socket to the poll structure. - * @param aprset The poll structure we will be using. - * @param sock The socket to add to the current poll structure. - * @param event The events to look for when we do the poll. One of: - *
    - *            APR_POLLIN       signal if read will not block
    - *            APR_POLLPRI      signal if prioirty data is availble to be read
    - *            APR_POLLOUT      signal if write will not block
    - * 
    - * @deprecated This function is deprecated, APR applications should control the pollset memory themselves. - */ -APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, - apr_socket_t *sock, - apr_int16_t event); - -/** - * Modify a socket in the poll structure with mask. - * @param aprset The poll structure we will be using. - * @param sock The socket to modify in poll structure. - * @param events The events to stop looking for during the poll. One of: - *
    - *            APR_POLLIN       signal if read will not block
    - *            APR_POLLPRI      signal if priority data is available to be read
    - *            APR_POLLOUT      signal if write will not block
    - * 
    - * @deprecated This function is deprecated, APR applications should control the pollset memory themselves. - */ -APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, - apr_socket_t *sock, - apr_int16_t events); -/** - * Remove a socket from the poll structure. - * @param aprset The poll structure we will be using. - * @param sock The socket to remove from the current poll structure. - * @deprecated This function is deprecated, APR applications should control the pollset memory themselves. - */ -APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, - apr_socket_t *sock); - -/** - * Clear all events in the poll structure. - * @param aprset The poll structure we will be using. - * @param events The events to clear from all sockets. One of: - *
    - *            APR_POLLIN       signal if read will not block
    - *            APR_POLLPRI      signal if priority data is available to be read
    - *            APR_POLLOUT      signal if write will not block
    - * 
    - * @deprecated This function is deprecated, APR applications should control the pollset memory themselves. - */ -APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, - apr_int16_t events); - -/** - * Get the return events for the specified socket. - * @param event The returned events for the socket. One of: - *
    - *            APR_POLLIN       Data is available to be read 
    - *            APR_POLLPRI      Priority data is availble to be read
    - *            APR_POLLOUT      Write will succeed
    - *            APR_POLLERR      An error occurred on the socket
    - *            APR_POLLHUP      The connection has been terminated
    - *            APR_POLLNVAL     This is an invalid socket to poll on.
    - *                             Socket not open.
    - * 
    - * @param sock The socket we wish to get information about. - * @param aprset The poll structure we will be using. - * @deprecated This function is deprecated, APR applications should control the pollset memory themselves. - */ -APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, - apr_socket_t *sock, - apr_pollfd_t *aprset); /* General-purpose poll API for arbitrarily large numbers of * file descriptors @@ -283,6 +201,30 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, /** @} */ + +/* These functions are deprecated. If you want doc, then go to older + versions of this header file. + + ### should probably just be removed. +*/ +APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new_poll, + apr_int32_t num, + apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset, + apr_socket_t *sock, + apr_int16_t event); +APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, + apr_socket_t *sock, + apr_int16_t events); +APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset, + apr_socket_t *sock); +APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset, + apr_int16_t events); +APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, + apr_socket_t *sock, + apr_pollfd_t *aprset); + + #ifdef __cplusplus } #endif From 64eecceb2b2f96ae85dffa38474a545ece1ed595 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Tue, 28 Oct 2003 11:31:34 +0000 Subject: [PATCH 4652/7878] Avoid the temptation to remember the pool. That can lead to disaster. * poll/unix/poll.c: (struct apr_pollset_t): remove the 'pool' member (apr_pollset_create): do not store the pool into the new struct git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64697 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/poll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 20df621991a..05d30b7d160 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -329,7 +329,7 @@ struct apr_pollset_t { #endif apr_pollfd_t *query_set; apr_pollfd_t *result_set; - apr_pool_t *pool; + #ifdef NETWARE int set_type; #endif @@ -362,7 +362,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, #endif (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); - (*pollset)->pool = p; + return APR_SUCCESS; } From 4d0bc47eabe9ee5ce4a63decbc50723b62d5d2d5 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 29 Oct 2003 12:07:44 +0000 Subject: [PATCH 4653/7878] * configure.in: Fix "--enable-dso" and clean up DSO implementation detection: use AC_CHECK_FUNC(foo) not _FUNCS when HAVE_FOO symbols are not needed; don't rely on APR_ADDTO expanding with a leading newline; simplify logic. Fail if --enable-dso is passed an unknown implementation name, or if --disable-dso is not used and an implementation could not be detected. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64698 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 66 +++++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/configure.in b/configure.in index f14216b30bd..6846570afc5 100644 --- a/configure.in +++ b/configure.in @@ -1273,50 +1273,58 @@ dnl ----------------------------- Checking for DSO support echo "${nl}Checking for DSO..." AC_ARG_ENABLE(dso, [ --disable-dso Disable DSO support ], - [ tempdso=$enableval], - [ - AC_CHECK_FUNCS(NSLinkModule, [ tempdso="dyld" ], [ tempdso="no" ]) - if test "$tempdso" = "no"; then - AC_CHECK_LIB(dld, shl_load, [ tempdso="shl" APR_ADDTO(LIBS,-ldld) ], - tempdso="no") + [if test "x$enableval" = "xyes"; then + dsotype=any + else + dsotype=$enableval + fi + ], [dsotype=any]) + +if test "$dsotype" = "any"; then + # Darwin: + AC_CHECK_FUNC(NSLinkModule, [dsotype=dyld]) + if test "$dsotype" = "any"; then + # Original HP-UX: + AC_CHECK_LIB(dld, shl_load, [dsotype=shl; APR_ADDTO(LIBS,-ldld)]) fi - if test "$tempdso" = "no"; then - AC_CHECK_FUNCS(dlopen, [ tempdso="dlfcn" ], [ tempdso="no" ]) + # Normal POSIX: + if test "$dsotype" = "any"; then + AC_CHECK_FUNC(dlopen, [dsotype=dlfcn]) fi - if test "$tempdso" = "no"; then - AC_CHECK_LIB(dl, dlopen, [ tempdso="dlfcn" APR_ADDTO(LIBS,-ldl) ], - tempdso="no") + if test "$dsotype" = "any"; then + AC_CHECK_LIB(dl, dlopen, [dsotype=dlfcn; APR_ADDTO(LIBS,-ldl)]) fi - if test "$tempdso" = "dlfcn"; then + if test "$dsotype" = "dlfcn"; then # ReliantUnix has dlopen() in libc but dlsym() in libdl :( - AC_CHECK_FUNCS(dlsym, [ tempdso="dlfcn" ], [ tempdso="no" ]) - if test "$tempdso" = "no"; then - AC_CHECK_LIB(dl, dlsym, [ tempdso="dlfcn" APR_ADDTO(LIBS, -ldl) ], - tempdso="no") - fi - if test "$tempdso" = "no"; then - echo "Weird: dlopen() was found but dlsym() was not found!" - fi + AC_CHECK_FUNC(dlsym, [], + [AC_CHECK_LIB(dl, dlsym, + [APR_ADDTO(LIBS, -ldl)], + [dsotype=any + echo "Weird: dlopen() was found but dlsym() was not found!"])]) fi - if test "$tempdso" = "no"; then - AC_CHECK_LIB(root, load_image, tempdso="yes", tempdso="no") + if test "$dsotype" = "any"; then + # BeOS: + AC_CHECK_LIB(root, load_image, [dsotype=other]) fi - if test "$tempdso" = "no"; then + # Everything else: + if test "$dsotype" = "any"; then case $host in - *os390|*-os2*|*os400) - tempdso="yes" - ;; + *os390|*-os2*|*os400|*-aix*) dsotype=other ;; esac fi - ] ) +fi -if test "$tempdso" = "no"; then +if test "$dsotype" = "any"; then + AC_MSG_ERROR([Could not detect suitable DSO implementation]) +elif test "$dsotype" = "no"; then aprdso="0" else - case "$tempdso" in + case "$dsotype" in dlfcn) AC_DEFINE(DSO_USE_DLFCN, 1, [Define if DSO support uses dlfcn.h]);; shl) AC_DEFINE(DSO_USE_SHL, 1, [Define if DSO support uses shl_load]);; dyld) AC_DEFINE(DSO_USE_DYLD, 1, [Define if DSO support uses dyld.h]);; + other) ;; # Use whatever is in dso/OSDIR + *) AC_MSG_ERROR([Unknown DSO implementation "$dsotype"]);; esac aprdso="1" apr_modules="$apr_modules dso" From edce2cd29e60f56c3bc74140a79b4c1f546eec06 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 29 Oct 2003 16:30:15 +0000 Subject: [PATCH 4654/7878] * testdso.c: Fix build when --disable-dso is used. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64699 13f79535-47bb-0310-9956-ffa450edef68 --- test/testdso.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/testdso.c b/test/testdso.c index 468cf5eaf08..dd69a7d5954 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -64,6 +64,8 @@ #include #endif +#if APR_HAS_DSO + #ifdef NETWARE # define MOD_NAME "mod_test.nlm" #elif defined(BEOS) || defined(WIN32) @@ -257,10 +259,13 @@ static void test_load_notthere(CuTest *tc) CuAssertPtrNotNull(tc, h); } +#endif /* APR_HAS_DSO */ + CuSuite *testdso(void) { CuSuite *suite = CuSuiteNew("DSO"); +#if APR_HAS_DSO modname = apr_pcalloc(p, 256); getcwd(modname, 256); modname = apr_pstrcat(p, modname, "/", MOD_NAME, NULL); @@ -282,6 +287,7 @@ CuSuite *testdso(void) #endif SUITE_ADD_TEST(suite, test_load_notthere); +#endif /* APR_HAS_DSO */ return suite; } From 7d017343865c794927fbb96b4e6ca3959486fda0 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 29 Oct 2003 21:11:46 +0000 Subject: [PATCH 4655/7878] * build/apr_threads.m4: If -pthread is used to enable pthread support, also add -lpthread to LIBS to ensure that libapr depends on libpthread regardless of libtool and gcc versions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64700 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_threads.m4 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build/apr_threads.m4 b/build/apr_threads.m4 index 83462d99ec0..ed976a74973 100644 --- a/build/apr_threads.m4 +++ b/build/apr_threads.m4 @@ -130,6 +130,15 @@ if test "$pthreads_working" != "yes"; then fi ]) +# Some versions of libtool do not pass -pthread through +# to the compiler when given in a --mode=link line. Some +# versions of gcc ignore -pthread when linking a shared +# object. Hence, if using -pthread, always add -lpthread on +# the link line, to ensure that libapr depends on libpthread. +if test "x$ac_cv_pthreads_cflags" = "x-pthread"; then + APR_ADDTO(LIBS,[-lpthread]) +fi + AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[ ac_cv_pthreads_lib="" if test "$pthreads_working" != "yes"; then From 3d6ee03eadf5bdee1eb3260a47588371bf962d25 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 30 Oct 2003 11:29:17 +0000 Subject: [PATCH 4656/7878] Submitted by: Joe Orton Reviewed by: Greg Stein, Cliff Woolley, Sander Striker * memory/unix/apr_pools.c (list_insert, list_remove): new macros to do manipulation of lists throughout the pools code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64701 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 63 +++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 37 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index f6f61f53950..8d0e60b20fd 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -615,6 +615,21 @@ void netware_pool_proc_cleanup () } #endif /* defined(NETWARE) */ +/* Node list management helper macros; list_insert() inserts 'node' + * before 'point'. */ +#define list_insert(node, point) do { \ + node->ref = point->ref; \ + *node->ref = node; \ + node->next = point; \ + point->ref = &node->next; \ +} while (0) + +/* list_remove() removes 'node' from its list. */ +#define list_remove(node) do { \ + *node->ref = node->next; \ + node->next->ref = node->ref; \ +} while (0) + /* * Memory allocation */ @@ -638,8 +653,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) node = active->next; if (size < (apr_size_t)(node->endp - node->first_avail)) { - *node->ref = node->next; - node->next->ref = node->ref; + list_remove(node); } else { if ((node = allocator_alloc(pool->allocator, size)) == NULL) { @@ -655,10 +669,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) mem = node->first_avail; node->first_avail += size; - node->ref = active->ref; - *node->ref = node; - node->next = active; - active->ref = &node->next; + list_insert(node, active); pool->active = node; @@ -675,13 +686,8 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) } while (free_index < node->free_index); - *active->ref = active->next; - active->next->ref = active->ref; - - active->ref = node->ref; - *active->ref = active; - active->next = node; - node->ref = &active->next; + list_remove(active); + list_insert(active, node); return mem; } @@ -944,13 +950,9 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) node = active->next; if (!ps->got_a_new_node && size < (apr_size_t)(node->endp - node->first_avail)) { - *node->ref = node->next; - node->next->ref = node->ref; - node->ref = active->ref; - *node->ref = node; - node->next = active; - active->ref = &node->next; + list_remove(node); + list_insert(node, active); node->free_index = 0; @@ -967,13 +969,8 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) } while (free_index < node->free_index); - *active->ref = active->next; - active->next->ref = active->ref; - - active->ref = node->ref; - *active->ref = active; - active->next = node; - node->ref = &active->next; + list_remove(active); + list_insert(active, node); } node = pool->active; @@ -1058,10 +1055,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) node->free_index = 0; - node->ref = active->ref; - *node->ref = node; - node->next = active; - active->ref = &node->next; + list_insert(node, active); pool->active = node; @@ -1079,13 +1073,8 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) } while (free_index < node->free_index); - *active->ref = active->next; - active->next->ref = active->ref; - - active->ref = node->ref; - *active->ref = active; - active->next = node; - node->ref = &active->next; + list_remove(active); + list_insert(active, node); return strp; } From ea21e246239099f78d2662fcd0646aeb674d1063 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 30 Oct 2003 12:17:07 +0000 Subject: [PATCH 4657/7878] Submitted by: Julian Foad Reviewed by: Sander Striker * include/apr_pools.h Fix preprocessor magic when APR_POOL_DEBUG is defined, but is blank. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64703 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index 00cfa61493c..350660d9540 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -162,7 +162,8 @@ typedef struct apr_pool_t apr_pool_t; *

    WiUpodUfP#5Hk>^|8Uhz&4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9oWjcQMtwwn1* z#CzxdWNPGbM|Z&$LU7-re(Y>)IlPokz{4MNJkz~DZrnP8xsXt&QV@pRiRkO}TJE-# zZSmfNUV>W!_nKr7EFR$Of>YZoSbJat#u9Cl0|dj0k+Y{ZF!C7K>$-|4oLc5DOZOI5 zzL&7#^=_!f^vdZ1yJQ0n{#c|R3+Fy64P8GRY2ZM`y8OoWw0Rx)D9>v4pX&+09jNqs zAp>=3XEW7$8!{D;6o%=ZZrZD|zmYjFz~`O7T8 zTHIW*ES@}qvRGt(g0V8ZZfsQ`YmDdtmpfWHQR^DL`SUcR8Y!*)p#iws9WOm)z2Oot zq3t?A6WX4^0XT>IV#0~}ThCd6%Uksb&*G0@5S>=}lP9M~ojbi85~@Sr%$i^uW_!5V zo;P+8UjAn30dYpS7UVA`dso1Rc^!cG+)NtyMYM+iJZO)Pj?Z?@+F}9sRU*ixp87cXw^um7}hbHvxXPe1b!RB25Et X2mcF`-myjU*d}?R{{JeqT_XPnxAT=f From 1a94b4e5e2c316c885a225fc0a9b5750bc1cdf59 Mon Sep 17 00:00:00 2001 From: Brian Fitzpatrick Date: Fri, 31 May 2002 22:28:40 +0000 Subject: [PATCH 3447/7878] Needed a function in Subversion to behave like 'mkdir -p', and this seems like the logical place for it. * file_io/unix/dir.c: apr_dir_make_recursive: New function. (The following 2 are support for the above function. Perhaps one day they'll live in a path utilities file of their own?) path_canonicalize: New static function. path_remove_last_component: New static function. * include/apr_file_io.h: apr_dir_make_recursive: New declaration. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63457 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 56 +++++++++++++++++++++++++++++++++++++++++++ include/apr_file_io.h | 10 ++++++++ 2 files changed, 66 insertions(+) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index fe8003ed675..5f6779dab78 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -73,6 +73,39 @@ static apr_status_t dir_cleanup(void *thedir) } } +#define PATH_SEPARATOR '/' + +/* Remove trailing separators that don't affect the meaning of PATH. */ +static const char *path_canonicalize (const char *path, apr_pool_t *pool) +{ + /* At some point this could eliminate redundant components. For + * now, it just makes sure there is no trailing slash. */ + apr_size_t len = strlen (path); + apr_size_t orig_len = len; + + while ((len > 0) && (path[len - 1] == PATH_SEPARATOR)) + len--; + + if (len != orig_len) + return apr_pstrndup (pool, path, len); + else + return path; +} + +/* Remove one component off the end of PATH. */ +static char *path_remove_last_component (const char *path, apr_pool_t *pool) +{ + const char *newpath = path_canonicalize (path, pool); + int i; + + for (i = (strlen(newpath) - 1); i >= 0; i--) { + if (path[i] == PATH_SEPARATOR) + break; + } + + return apr_pstrndup (pool, path, (i < 0) ? 0 : i); +} + apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *pool) { /* On some platforms (e.g., Linux+GNU libc), d_name[] in struct @@ -204,6 +237,29 @@ apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *po } } +apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, + apr_pool_t *pool) +{ + apr_status_t apr_err = 0; + + apr_err = apr_dir_make (path, perm, pool); /* Try to make PATH right out */ + + if (apr_err == EEXIST) /* It's OK if PATH exists */ + return APR_SUCCESS; + + if (apr_err == ENOENT) { /* Missing an intermediate dir */ + char *dir; + + dir = path_remove_last_component(path, pool); + apr_err = apr_dir_make_recursive(dir, perm, pool); + + if (!apr_err) + apr_err = apr_dir_make (path, perm, pool); + } + + return apr_err; +} + apr_status_t apr_dir_remove(const char *path, apr_pool_t *pool) { if (rmdir(path) == 0) { diff --git a/include/apr_file_io.h b/include/apr_file_io.h index c0f4dc24462..f6af7d14093 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -613,6 +613,16 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont); +/** Creates a new directory on the file system, but behaves like + * 'mkdir -p'. Creates intermediate directories as required. No error + * will be reported if PATH already exists. + * @param path the path for the directory to be created. (use / on all systems) + * @param perm Permissions for the new direcoty. + * @param cont the pool to use. */ +APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, + apr_fileperms_t perm, + apr_pool_t *pool); + /** * Remove directory from the file system. * @param path the path for the directory to be removed. (use / on all systems) From 5a3b10650a8a871bf752dd98ddba51caa7d8cf65 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 3 Jun 2002 18:52:46 +0000 Subject: [PATCH 3448/7878] Updated to match the header change git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63458 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/pipe.c | 8 ++++---- include/arch/netware/fileio.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/file_io/netware/pipe.c b/file_io/netware/pipe.c index dc1b6245764..47c8648940b 100644 --- a/file_io/netware/pipe.c +++ b/file_io/netware/pipe.c @@ -108,7 +108,7 @@ static apr_status_t pipenonblock(apr_file_t *thepipe) APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) { - if (thepipe->pipe == 1) { + if (thepipe->is_pipe == 1) { thepipe->timeout = timeout; if (timeout >= 0) { if (thepipe->blocking != BLK_OFF) { /* blocking or unknown state */ @@ -127,7 +127,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_int APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) { - if (thepipe->pipe == 1) { + if (thepipe->is_pipe == 1) { *timeout = thepipe->timeout; return APR_SUCCESS; } @@ -150,8 +150,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*out)->pool = pool; (*in)->filedes = filedes[0]; (*out)->filedes = filedes[1]; - (*in)->pipe = - (*out)->pipe = 1; + (*in)->is_pipe = + (*out)->is_pipe = 1; (*out)->fname = (*in)->fname = NULL; (*in)->buffered = diff --git a/include/arch/netware/fileio.h b/include/arch/netware/fileio.h index 62db86e5e22..e5234d476ac 100644 --- a/include/arch/netware/fileio.h +++ b/include/arch/netware/fileio.h @@ -112,7 +112,7 @@ struct apr_file_t { char *fname; apr_int32_t flags; int eof_hit; - int pipe; + int is_pipe; apr_interval_time_t timeout; int buffered; enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; From e3a0ee01349e03e2bdb0126009cb9abf8edc5c2e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 3 Jun 2002 19:25:34 +0000 Subject: [PATCH 3449/7878] Needs research and a decision git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63459 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 6435aa133fe..2ec0ee72704 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -518,8 +518,15 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file)->pool = pool; (*file)->filehand = *thefile; (*file)->ungetchar = -1; /* no char avail */ - (*file)->flags; - (*file)->pipe; + + /* XXX... we pcalloc above so these are zeroed. Is zero really + * the right answer when we passed flags into os_file_put? + * Should we be testing if thefile is a handle to a PIPE and + * set up the mechanics appropriately? + * + * (*file)->flags; + * (*file)->pipe; + */ return APR_SUCCESS; } From fa160bbb8c853ff1fe85f4ecd27b03ef874df3d4 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 3 Jun 2002 21:24:23 +0000 Subject: [PATCH 3450/7878] these guys aren't in apr-util anymore :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63460 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_ring.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/apr_ring.h b/include/apr_ring.h index b10b778e2ab..e7373ea8af2 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -63,7 +63,7 @@ */ /** * @file apr_ring.h - * @brief APR-Util Rings + * @brief APR Rings */ #ifndef APR_RING_H #define APR_RING_H @@ -74,8 +74,8 @@ #include "apr_general.h" /** - * @defgroup APR_Util_Rings Rings - * @ingroup APR_Util + * @defgroup APR_Rings Rings + * @ingroup APR * @{ */ From 550bb3ecb67b2400646959f66b764d55710b11f4 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Mon, 3 Jun 2002 21:48:28 +0000 Subject: [PATCH 3451/7878] it's amazing the typos one can catch when one actually reads the docs. :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63461 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index 914e311d8fb..c789ba30456 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -145,7 +145,7 @@ struct apr_table_entry_t { /** * Determine if the table is empty * @param t The table to check - * @return True if empty, Falso otherwise + * @return True if empty, False otherwise */ #define apr_is_empty_table(t) (((t) == NULL) \ || (((apr_array_header_t *)(t))->nelts == 0)) From ad6c3aedb3c85b99bc891032daf47a6d1e8345c1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 4 Jun 2002 02:41:30 +0000 Subject: [PATCH 3452/7878] Answer half the questions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63462 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 2ec0ee72704..2303a4db265 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -518,13 +518,15 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file)->pool = pool; (*file)->filehand = *thefile; (*file)->ungetchar = -1; /* no char avail */ - - /* XXX... we pcalloc above so these are zeroed. Is zero really - * the right answer when we passed flags into os_file_put? - * Should we be testing if thefile is a handle to a PIPE and - * set up the mechanics appropriately? + (*file)->timeout = -1; + (*file)->flags = flags; + if (flags & APR_APPEND) + (*file)->append = 1; + + /* XXX... we pcalloc above so all others are zeroed. + * Should we be testing if thefile is a handle to + * a PIPE and set up the mechanics appropriately? * - * (*file)->flags; * (*file)->pipe; */ return APR_SUCCESS; From 35e4cfab8b98f7c4f0f8d0d5834ff02e5a69852a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 4 Jun 2002 02:49:51 +0000 Subject: [PATCH 3453/7878] Hands over my head... I surrender to the style police git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63463 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 2303a4db265..df7a959cfd4 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -521,7 +521,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file)->timeout = -1; (*file)->flags = flags; if (flags & APR_APPEND) - (*file)->append = 1; + (*file)->append = 1; /* XXX... we pcalloc above so all others are zeroed. * Should we be testing if thefile is a handle to From f51e48f577d92b4d41134c3ed84998471092ce00 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 4 Jun 2002 04:41:53 +0000 Subject: [PATCH 3454/7878] More WinCE Porting Antique patches that need to get out of my tree, into CVS. Submitted by: Mladen Turk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63464 13f79535-47bb-0310-9956-ffa450edef68 --- shmem/win32/shm.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c index ec0befa79b9..48f45a5fd17 100644 --- a/shmem/win32/shm.c +++ b/shmem/win32/shm.c @@ -118,12 +118,16 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, if (!file) { /* Do Anonymous, which will be an inherited handle */ +#ifndef _WIN32_WCE hFile = INVALID_HANDLE_VALUE; sec.nLength = sizeof(SECURITY_ATTRIBUTES); sec.lpSecurityDescriptor = NULL; sec.bInheritHandle = TRUE; - mapkey = NULL; psec = &sec; +#else + psec = NULL; +#endif + mapkey = NULL; } else { /* Do file backed, which is not an inherited handle @@ -218,7 +222,15 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { +#ifndef _WIN32_WCE hMap = OpenFileMappingW(FILE_MAP_READ | FILE_MAP_WRITE, FALSE, mapkey); +#else + /* The WCE 3.0 lacks OpenFileMapping. So we emulate one with + * opening the existing shmem and reading its size from the header + */ + hMap = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, + PAGE_READWRITE, 0, sizeof(apr_shm_t), mapkey); +#endif } #endif #if APR_HAS_ANSI_FS @@ -240,13 +252,28 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, *m = (apr_shm_t *) apr_palloc(pool, sizeof(apr_shm_t)); (*m)->pool = pool; - (*m)->hMap = hMap; (*m)->memblk = base; - (*m)->usrmem = (char*)base + sizeof(memblock_t); /* Real (*m)->mem->size could be recovered with VirtualQuery */ (*m)->size = (*m)->memblk->size; - (*m)->length = (*m)->memblk->length; +#if _WIN32_WCE + /* Reopen with real size */ + UnmapViewOfFile(base); + CloseHandle(hMap); + hMap = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, + PAGE_READWRITE, 0, (*m)->size, mapkey); + if (!hMap) { + return apr_get_os_error(); + } + base = MapViewOfFile(hMap, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0); + if (!base) { + CloseHandle(hMap); + return apr_get_os_error(); + } +#endif + (*m)->hMap = hMap; + (*m)->length = (*m)->memblk->length; + (*m)->usrmem = (char*)base + sizeof(memblock_t); apr_pool_cleanup_register((*m)->pool, *m, shm_cleanup, apr_pool_cleanup_null); return APR_SUCCESS; From c7f0656c2ccf6f233f15da31b30ccba50f5905dd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 4 Jun 2002 04:50:44 +0000 Subject: [PATCH 3455/7878] More of the WinCE port. except appears to be a bit too ambigous for the compiler. Submitted by: Mladen Turk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63465 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/networkio.h | 11 ++++++++++- network_io/win32/poll.c | 22 +++++++++++++++------- network_io/win32/sendrecv.c | 25 +++++++++++++++++++++++-- network_io/win32/sockaddr.c | 9 +++++++++ network_io/win32/sockets.c | 4 +++- 5 files changed, 60 insertions(+), 11 deletions(-) diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 370946c134b..1ee3d54a0df 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -78,10 +78,19 @@ struct apr_pollfd_t { int numread; fd_set *write; int numwrite; - fd_set *except; + fd_set *exception; int numexcept; }; +#ifdef _WIN32_WCE +#ifndef WSABUF +typedef struct _WSABUF { + u_long len; /* the length of the buffer */ + char FAR * buf; /* the pointer to the buffer */ +} WSABUF, FAR * LPWSABUF; +#endif +#endif + apr_status_t status_from_res_error(int); const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 234bf6364eb..de8ccccff0d 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -56,9 +56,12 @@ #include "apr_network_io.h" #include "apr_general.h" #include "apr_lib.h" +#if APR_HAVE_ERRNO_H #include +#endif +#if APR_HAVE_TIME_H #include - +#endif APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) @@ -70,12 +73,12 @@ APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, (*new)->cntxt = cont; (*new)->read = (fd_set *)apr_palloc(cont, sizeof(fd_set)); (*new)->write = (fd_set *)apr_palloc(cont, sizeof(fd_set)); - (*new)->except = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->exception = (fd_set *)apr_palloc(cont, sizeof(fd_set)); FD_ZERO((*new)->read); (*new)->numread = 0; FD_ZERO((*new)->write); (*new)->numwrite = 0; - FD_ZERO((*new)->except); + FD_ZERO((*new)->exception); (*new)->numexcept = 0; return APR_SUCCESS; } @@ -115,7 +118,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, newwrite = aprset->write; } if (aprset->numexcept != 0) { - newexcept = aprset->except; + newexcept = aprset->exception; } if (newread == NULL && newwrite == NULL && newexcept == NULL) { @@ -164,8 +167,13 @@ APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, if (FD_ISSET(sock->sock, aprset->read)) { revents |= APR_POLLIN; +#ifdef _WIN32_WCE + if (recv(sock->sock, data.buf, data.len, 0) == SOCKET_ERROR) +#else if (WSARecv(sock->sock, &data, 1, &dummy, &flags, NULL, - NULL) == SOCKET_ERROR) { + NULL) == SOCKET_ERROR) +#endif + { /* This is only legit since we don't return the error */ dummy = WSAGetLastError(); switch (dummy) { @@ -195,7 +203,7 @@ APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event, * connection on a non-blocking socket. Might be a bad assumption, but * it works for now. rbb. */ - if (FD_ISSET(sock->sock, aprset->except)) { + if (FD_ISSET(sock->sock, aprset->exception)) { revents |= APR_POLLPRI; } @@ -225,7 +233,7 @@ APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset, aprset->numread--; } if (events & APR_POLLPRI) { - FD_CLR(sock->sock, aprset->except); + FD_CLR(sock->sock, aprset->exception); aprset->numexcept--; } if (events & APR_POLLOUT) { diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 725278579cc..1c234ff5459 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -58,7 +58,9 @@ #include "apr_network_io.h" #include "apr_lib.h" #include "fileio.h" +#if APR_HAVE_TIME_H #include +#endif /* MAX_SEGMENT_SIZE is the maximum amount of data that will be sent to a client * in one call of TransmitFile. This number must be small enough to give the @@ -82,7 +84,12 @@ APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, wsaData.len = *len; wsaData.buf = (char*) buf; +#ifndef _WIN32_WCE rv = WSASend(sock->sock, &wsaData, 1, &dwBytes, 0, NULL, NULL); +#else + rv = send(sock->sock, wsaData.buf, wsaData.len, 0); + dwBytes = rv; +#endif if (rv == SOCKET_ERROR) { lasterror = apr_get_netos_error(); return lasterror; @@ -106,7 +113,12 @@ APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, wsaData.len = *len; wsaData.buf = (char*) buf; +#ifndef _WIN32_WCE rv = WSARecv(sock->sock, &wsaData, 1, &dwBytes, &flags, NULL, NULL); +#else + rv = recv(sock->sock, wsaData.buf, wsaData.len, 0); + dwBytes = rv; +#endif if (rv == SOCKET_ERROR) { lasterror = apr_get_netos_error(); *len = 0; @@ -138,12 +150,21 @@ APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock, pWsaBuf[i].buf = vec[i].iov_base; pWsaBuf[i].len = vec[i].iov_len; } - +#ifndef _WIN32_WCE rv = WSASend(sock->sock, pWsaBuf, nvec, &dwBytes, 0, NULL, NULL); if (rv == SOCKET_ERROR) { rc = apr_get_netos_error(); } - +#else + for (i = 0; i < nvec; i++) { + rv = send(sock->sock, pWsaBuf[i].buf, pWsaBuf[i].len, 0); + if (rv == SOCKET_ERROR) { + rc = apr_get_netos_error(); + break; + } + dwBytes += rv; + } +#endif if (nvec > WSABUF_ON_STACK) free(pWsaBuf); diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index 2e9304d3808..317721e77ea 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -57,6 +57,7 @@ #include "apr_general.h" #include "apr_strings.h" #include "apr_lib.h" +#include "apr_private.h" #include static apr_status_t get_local_addr(apr_socket_t *sock) @@ -74,6 +75,14 @@ static apr_status_t get_local_addr(apr_socket_t *sock) } } +#ifdef _WIN32_WCE +/* WCE lacks getservbyname */ +static void *getservbyname(const char *name, const char *proto) +{ + return NULL; +} + +#endif /* Include this here so we have get_local_addr defined... */ #include "../unix/sa_common.c" diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index b0dc99eb662..6b36608ee76 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -142,8 +142,9 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how) { - int winhow; + int winhow = 0; +#if SD_RECEIVE switch (how) { case APR_SHUTDOWN_READ: { winhow = SD_RECEIVE; @@ -160,6 +161,7 @@ APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket, default: return APR_BADARG; } +#endif if (shutdown(thesocket->sock, winhow) == 0) { return APR_SUCCESS; } From 81d3dd76faad8c4396a73f7271bd73906dae8029 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 4 Jun 2002 04:53:51 +0000 Subject: [PATCH 3456/7878] More CE porting, now we enter the strange stuff. I disagree with the special casing on the inherited bit, but I'm committing for further comment ... the rest of this is just CE exceptions. There are no pipes on WinCE 3.0. Submitted by: Mladen Turk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63466 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 45 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index fdce23856db..ccc3be8a4bc 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -61,10 +61,28 @@ #include "apr_strings.h" #include "apr_portable.h" #include +#if APR_HAVE_SIGNAL_H #include +#endif #include +#if APR_HAVE_PROCESS_H #include - +#endif + +#ifdef _WIN32_WCE +#ifndef DETACHED_PROCESS +#define DETACHED_PROCESS 0 +#endif +#ifndef CREATE_UNICODE_ENVIRONMENT +#define CREATE_UNICODE_ENVIRONMENT 0 +#endif +#ifndef STARTF_USESHOWWINDOW +#define STARTF_USESHOWWINDOW 0 +#endif +#ifndef SW_HIDE +#define SW_HIDE 0 +#endif +#endif /* * some of the ideas expressed herein are based off of Microsoft * Knowledge Base article: Q190351 @@ -112,6 +130,9 @@ static apr_status_t open_nt_process_pipe(apr_file_t **read, apr_file_t **write, static apr_status_t make_handle_private(apr_file_t *file) { +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else HANDLE hproc = GetCurrentProcess(); HANDLE filehand = file->filehand; @@ -129,11 +150,15 @@ static apr_status_t make_handle_private(apr_file_t *file) */ CloseHandle(filehand); return APR_SUCCESS; +#endif } static apr_status_t make_inheritable_duplicate(apr_file_t *original, apr_file_t *duplicate) { +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else if (original == NULL) return APR_SUCCESS; @@ -153,6 +178,7 @@ static apr_status_t make_inheritable_duplicate(apr_file_t *original, } return APR_SUCCESS; +#endif } APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, @@ -409,6 +435,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } } +#ifndef _WIN32_WCE if (attr->cmdtype == APR_SHELLCMD) { char *shellcmd = getenv("COMSPEC"); if (!shellcmd) { @@ -433,7 +460,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, cmdline = apr_pstrcat(pool, shellcmd, " /C \"", argv0, cmdline, "\"", NULL); } } - else { + else +#endif + { /* Win32 is _different_ than unix. While unix will find the given * program since it's already chdir'ed, Win32 cannot since the parent * attempts to open the program with it's own path. @@ -613,6 +642,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, si.dwFlags |= STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; } +#ifndef _WIN32_WCE if ((attr->child_in && attr->child_in->filehand) || (attr->child_out && attr->child_out->filehand) || (attr->child_err && attr->child_err->filehand)) @@ -625,7 +655,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->child_err) si.hStdError = attr->child_err->filehand; } - rv = CreateProcessW(wprg, wcmd, /* Executable & Command line */ NULL, NULL, /* Proc & thread security attributes */ TRUE, /* Inherit handles */ @@ -633,6 +662,16 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, pEnvBlock, /* Environment block */ wcwd, /* Current directory name */ &si, &pi); +#else + rv = CreateProcessW(wprg, wcmd, /* Executable & Command line */ + NULL, NULL, /* Proc & thread security attributes */ + FALSE, /* must be 0 */ + dwCreationFlags, /* Creation flags */ + NULL, /* Environment block must be NULL */ + NULL, /* Current directory name must be NULL*/ + NULL, /* STARTUPINFO not supported */ + &pi); +#endif } #endif /* APR_HAS_UNICODE_FS */ #if APR_HAS_ANSI_FS From 1715338eacae858ac47f45ca9963301d0e6110b1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 4 Jun 2002 04:57:22 +0000 Subject: [PATCH 3457/7878] More CE porting. I'd prefer to see us return a stock value of 0 for the user and group ID functions rather than returning ENOTIMPL. There are no groups or users on WinCE. Comments? Submitted by: Mladen Turk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63467 13f79535-47bb-0310-9956-ffa450edef68 --- user/win32/groupinfo.c | 10 ++++++++++ user/win32/userinfo.c | 23 ++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index edc2feb54d4..25c51af316c 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -63,6 +63,9 @@ APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *gid, const char *groupname, apr_pool_t *p) { +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else SID_NAME_USE sidtype; char anydomain[256]; char *domain; @@ -98,10 +101,14 @@ APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *gid, return apr_get_os_error(); } return APR_SUCCESS; +#endif } APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p) { +#ifdef _WIN32_WCE + *groupname = apr_pstrdup(p, "Administrators"); +#else SID_NAME_USE type; char name[MAX_PATH], domain[MAX_PATH]; DWORD cbname = sizeof(name), cbdomain = sizeof(domain); @@ -113,6 +120,7 @@ APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid && type != SidTypeAlias) return APR_EINVAL; *groupname = apr_pstrdup(p, name); +#endif return APR_SUCCESS; } @@ -120,9 +128,11 @@ APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right) { if (!left || !right) return APR_EINVAL; +#ifndef _WIN32_WCE if (!IsValidSid(left) || !IsValidSid(right)) return APR_EINVAL; if (!EqualSid(left, right)) return APR_EMISMATCH; +#endif return APR_SUCCESS; } diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c index f96117d73bd..28ae3ddd227 100644 --- a/user/win32/userinfo.c +++ b/user/win32/userinfo.c @@ -61,6 +61,7 @@ #include #endif +#ifndef _WIN32_WCE /* Internal sid binary to string translation, see MSKB Q131320. * Several user related operations require our SID to access * the registry, but in a string format. All error handling @@ -97,12 +98,16 @@ void get_sid_string(char *buf, int blen, apr_uid_t id) *GetSidSubAuthority(id, sa)); } } - +#endif /* Query the ProfileImagePath from the version-specific branch, where the * regkey uses the user's name on 9x, and user's sid string on NT. */ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *username, apr_pool_t *p) { +#ifdef _WIN32_WCE + *dirname = apr_pstrdup(p, "/My Documents"); + return APR_SUCCESS; +#else apr_status_t rv; char regkey[MAX_PATH * 2]; char *fixch; @@ -189,12 +194,16 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use if (*fixch == '\\') *fixch = '/'; return APR_SUCCESS; +#endif /* _WIN32_WCE */ } APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, apr_gid_t *gid, apr_pool_t *p) { +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else HANDLE threadtok; DWORD needed; TOKEN_USER *usr; @@ -222,11 +231,15 @@ APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid, return apr_get_os_error(); return APR_SUCCESS; +#endif } APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, const char *username, apr_pool_t *p) { +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else SID_NAME_USE sidtype; char anydomain[256]; char *domain; @@ -265,10 +278,15 @@ APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid, */ *gid = NULL; return APR_SUCCESS; +#endif } APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p) { +#ifdef _WIN32_WCE + *username = apr_pstrdup(p, "Administrator"); + return APR_SUCCESS; +#else SID_NAME_USE type; char name[MAX_PATH], domain[MAX_PATH]; DWORD cbname = sizeof(name), cbdomain = sizeof(domain); @@ -280,15 +298,18 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap return APR_EINVAL; *username = apr_pstrdup(p, name); return APR_SUCCESS; +#endif } APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right) { if (!left || !right) return APR_EINVAL; +#ifndef _WIN32_WCE if (!IsValidSid(left) || !IsValidSid(right)) return APR_EINVAL; if (!EqualSid(left, right)) return APR_EMISMATCH; +#endif return APR_SUCCESS; } From 2a97727ed4d422a3bfdf50008ecf81d9cc137cfb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 5 Jun 2002 14:56:44 +0000 Subject: [PATCH 3458/7878] cvs up/diff gets pretty hard to track with vc7 builds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63468 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.cvsignore b/.cvsignore index d638d3bea17..d266087965e 100644 --- a/.cvsignore +++ b/.cvsignore @@ -25,3 +25,8 @@ libapr.rc *.dep *.mak *.rc +BuildLog.htm +*.stc +*.stt +*.sto +*.vcproj From acf265e5f484f63843c55669ccfa3c73f3311675 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Thu, 6 Jun 2002 02:58:16 +0000 Subject: [PATCH 3459/7878] win32 now passes testsockopt. Merge the Netware codepath in apr_getsockopt with the win32 codepath. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63469 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/networkio.h | 9 ++++ network_io/win32/sockopt.c | 97 ++++++++++++++-------------------- 2 files changed, 48 insertions(+), 58 deletions(-) diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 1ee3d54a0df..6c351b510ce 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -97,5 +97,14 @@ const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); +#define apr_is_option_set(mask, option) ((mask & option) ==option) +#define apr_set_option(mask, option, on) \ + do { \ + if (on) \ + *mask |= option; \ + else \ + *mask &= ~option; \ + } while (0) + #endif /* ! NETWORK_IO_H */ diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 2d3f01c7395..745d23f33ed 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -124,43 +124,61 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, break; } case APR_SO_KEEPALIVE: - if (setsockopt(sock->sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { - return apr_get_netos_error(); + if (on != apr_is_option_set(sock->netmask, APR_SO_KEEPALIVE)) { + if (setsockopt(sock->sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { + return apr_get_netos_error(); + } + apr_set_option(&sock->netmask,APR_SO_KEEPALIVE, on); } break; case APR_SO_DEBUG: - if (setsockopt(sock->sock, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { - return apr_get_netos_error(); + if (on != apr_is_option_set(sock->netmask, APR_SO_DEBUG)) { + if (setsockopt(sock->sock, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { + return apr_get_netos_error(); + } + apr_set_option(&sock->netmask, APR_SO_DEBUG, on); } break; case APR_SO_REUSEADDR: - if (setsockopt(sock->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { - return apr_get_netos_error(); + if (on != apr_is_option_set(sock->netmask, APR_SO_REUSEADDR)){ + if (setsockopt(sock->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { + return apr_get_netos_error(); + } + apr_set_option(&sock->netmask, APR_SO_REUSEADDR, on); } break; case APR_SO_NONBLOCK: - if (on) { - if ((stat = sononblock(sock->sock)) != APR_SUCCESS) - return stat; - } - else { - if ((stat = soblock(sock->sock)) != APR_SUCCESS) - return stat; + if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) != on){ + if (on) { + if ((stat = sononblock(sock->sock)) != APR_SUCCESS) + return stat; + } + else { + if ((stat = soblock(sock->sock)) != APR_SUCCESS) + return stat; + } + apr_set_option(&sock->netmask, APR_SO_NONBLOCK, on); } break; case APR_SO_LINGER: { - struct linger li; - li.l_onoff = on; - li.l_linger = MAX_SECS_TO_LINGER; - if (setsockopt(sock->sock, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { - return apr_get_netos_error(); + if (apr_is_option_set(sock->netmask, APR_SO_LINGER) != on){ + struct linger li; + li.l_onoff = on; + li.l_linger = MAX_SECS_TO_LINGER; + if (setsockopt(sock->sock, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { + return apr_get_netos_error(); + } + apr_set_option(&sock->netmask, APR_SO_LINGER, on); } break; } case APR_TCP_NODELAY: - if (setsockopt(sock->sock, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { - return apr_get_netos_error(); + if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) != on){ + if (setsockopt(sock->sock, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(int)) == -1) { + return apr_get_netos_error(); + } + apr_set_option(&sock->netmask, APR_TCP_NODELAY, on); } break; default: @@ -173,9 +191,6 @@ APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock, APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { -#ifdef NETWARE - int sol_opt = 0; - switch (opt) { case APR_SO_TIMEOUT: /* Convert from milliseconds (windows units) to microseconds @@ -186,47 +201,13 @@ APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock, *on = sock->disconnected; break; case APR_SO_KEEPALIVE: - sol_opt = SO_KEEPALIVE; - break; case APR_SO_DEBUG: - sol_opt = SO_DEBUG; - break; case APR_SO_REUSEADDR: - sol_opt = SO_REUSEADDR; - break; case APR_SO_NONBLOCK: case APR_SO_LINGER: default: - return APR_ENOTIMPL; - break; - } - if (sol_opt) { - int sz = sizeof(apr_int32_t); - - if (getsockopt(sock->sock, SOL_SOCKET, sol_opt, (char *)on, &sz) == -1) { - return apr_get_netos_error(); - } - } -#else - switch (opt) { - case APR_SO_TIMEOUT: - /* Convert from milliseconds (windows units) to microseconds - * (APR units) */ - *on = (apr_int32_t)(sock->timeout * 1000); - break; - case APR_SO_DISCONNECTED: - *on = sock->disconnected; - break; - case APR_SO_KEEPALIVE: - case APR_SO_DEBUG: - case APR_SO_REUSEADDR: - case APR_SO_NONBLOCK: - case APR_SO_LINGER: - default: - return APR_ENOTIMPL; - break; + *on = apr_is_option_set(sock->netmask, opt); } -#endif return APR_SUCCESS; } From 84807ee06e7bb285bc0c77b349ce093a4ede726f Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 7 Jun 2002 14:04:34 +0000 Subject: [PATCH 3460/7878] Added 2 additional lock functions: apr_proc_mutex_name and apr_proc_mutex_defname which returns the type name of the mutex (eg: "sysvsem") as well as the default mutex type (APR_LOCK_DEFAULT). Mostly useful under Unix were the locktypes are selectable. apr_proc_mutex_name takes a *apr_proc_mutex_t argument, whereas apr_proc_mutex_defname takes (and requires) none. For those systems that don't have selectable mutex types, I've "thought up" names that made sense... feel free to modify :) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63470 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ include/apr_proc_mutex.h | 13 +++++++++++++ include/arch/unix/proc_mutex.h | 1 + locks/beos/proc_mutex.c | 10 ++++++++++ locks/netware/proc_mutex.c | 10 ++++++++++ locks/os2/proc_mutex.c | 9 +++++++++ locks/unix/proc_mutex.c | 33 ++++++++++++++++++++++++++++----- locks/win32/proc_mutex.c | 10 ++++++++++ 8 files changed, 87 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 0131b2272a5..49f08fc9063 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Changes with APR b1 + *) Added 2 additional lock functions: apr_proc_mutex_name and + apr_proc_mutex_defname which returns the type name of the mutex + (eg: "sysvsem") as well as the default mutex type (APR_LOCK_DEFAULT). + Mostly useful under Unix were the locktypes are selectable. + [Jim Jagielski] + *) Fixed apr_generate_random_bytes() for Win32 on Win NT or 9x by dropping the 0x40 bit (CRYPT_SILENT) for earlier OS'es. PR 9286 [William Rowe] diff --git a/include/apr_proc_mutex.h b/include/apr_proc_mutex.h index ea5225b5f5a..7bc84343105 100644 --- a/include/apr_proc_mutex.h +++ b/include/apr_proc_mutex.h @@ -150,6 +150,19 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex); */ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex); +/** + * Display the name of the mutex, as it relates to the actual method used. + * This matches the valid options for Apache's AcceptMutex directive + * @param mutex the name of the mutex + */ +APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex); + +/** + * Display the name of the default mutex: APR_LOCK_DEFAULT + * @param mutex the name of the default mutex + */ +APR_DECLARE(const char *) apr_proc_mutex_defname(void); + /** * Get the pool used by this proc_mutex. * @return apr_pool_t the pool diff --git a/include/arch/unix/proc_mutex.h b/include/arch/unix/proc_mutex.h index e55fdd59b84..d7760a73e73 100644 --- a/include/arch/unix/proc_mutex.h +++ b/include/arch/unix/proc_mutex.h @@ -113,6 +113,7 @@ struct apr_proc_mutex_unix_lock_methods_t { apr_status_t (*release)(apr_proc_mutex_t *); apr_status_t (*destroy)(apr_proc_mutex_t *); apr_status_t (*child_init)(apr_proc_mutex_t **, apr_pool_t *, const char *); + const char *name; }; typedef struct apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_lock_methods_t; diff --git a/locks/beos/proc_mutex.c b/locks/beos/proc_mutex.c index a5c68c8676b..4557714246e 100644 --- a/locks/beos/proc_mutex.c +++ b/locks/beos/proc_mutex.c @@ -157,6 +157,16 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return stat; } +APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) +{ + return "beossem"; +} + +APR_DECLARE(const char *) apr_proc_mutex_defname(void) +{ + return "beossem"; +} + APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 113c875cd02..e86802104b7 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -115,6 +115,16 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return APR_ENOLOCK; } +APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) +{ + return "netwarethread"; +} + +APR_DECLARE(const char *) apr_proc_mutex_defname(void) +{ + return "netwarethread"; +} + APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c index 7cc329cc527..7338e466b2d 100644 --- a/locks/os2/proc_mutex.c +++ b/locks/os2/proc_mutex.c @@ -93,6 +93,15 @@ static apr_status_t proc_mutex_cleanup(void *vmutex) return apr_proc_mutex_destroy(mutex); } +APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) +{ + return "os2sem"; +} + +APR_DECLARE(const char *) apr_proc_mutex_defname(void) +{ + return "os2sem"; +} APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 3fa707cdf97..e50499be73f 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -177,7 +177,8 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_posix_methods = NULL, /* no tryacquire */ proc_mutex_posix_release, proc_mutex_posix_destroy, - proc_mutex_posix_child_init + proc_mutex_posix_child_init, + "posixsem" }; #endif /* Posix sem implementation */ @@ -292,7 +293,8 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods = NULL, /* no tryacquire */ proc_mutex_sysv_release, proc_mutex_sysv_destroy, - proc_mutex_sysv_child_init + proc_mutex_sysv_child_init, + "sysvsem" }; #endif /* SysV sem implementation */ @@ -466,7 +468,8 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_proc_pthread_method NULL, /* no tryacquire */ proc_mutex_proc_pthread_release, proc_mutex_proc_pthread_destroy, - proc_mutex_proc_pthread_child_init + proc_mutex_proc_pthread_child_init, + "pthread" }; #endif @@ -601,7 +604,8 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods = NULL, /* no tryacquire */ proc_mutex_fcntl_release, proc_mutex_fcntl_destroy, - proc_mutex_fcntl_child_init + proc_mutex_fcntl_child_init, + "fcntl" }; #endif /* fcntl implementation */ @@ -730,7 +734,8 @@ const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_flock_methods = NULL, /* no tryacquire */ proc_mutex_flock_release, proc_mutex_flock_destroy, - proc_mutex_flock_child_init + proc_mutex_flock_child_init, + "flock" }; #endif /* flock implementation */ @@ -813,6 +818,19 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lo return APR_SUCCESS; } +APR_DECLARE(const char *) apr_proc_mutex_defname(void) +{ + apr_status_t rv; + apr_proc_mutex_t mutex; + + if ((rv = proc_mutex_choose_method(&mutex, APR_LOCK_DEFAULT)) != APR_SUCCESS) { + return "unknown"; + } + mutex.meth = mutex.inter_meth; + + return apr_proc_mutex_name(&mutex); +} + static apr_status_t proc_mutex_create(apr_proc_mutex_t *new_mutex, apr_lockmech_e mech, const char *fname) { apr_status_t rv; @@ -935,6 +953,11 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return mutex->meth->destroy(mutex); } +APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) +{ + return mutex->meth->name; +} + APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c index 92638211dda..19100cdd03c 100644 --- a/locks/win32/proc_mutex.c +++ b/locks/win32/proc_mutex.c @@ -176,6 +176,16 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) return stat; } +APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) +{ + return "win32mutex"; +} + +APR_DECLARE(const char *) apr_proc_mutex_defname(void) +{ + return "win32mutex"; +} + APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) /* Implement OS-specific accessors defined in apr_portable.h */ From 7cd2b2ea42293c52d54d15d690a4fc834ed17cc5 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 7 Jun 2002 21:17:19 +0000 Subject: [PATCH 3461/7878] Allows the internal socket netmask of the accepted socket to initialize itself correctly based on the inherited options of the parent socket. This fixes a blocking vs. non-blocking problem in NetWare due to the changes in apr_setsockopt() and apr_getsockopt(). Windows may also need to correctly define APR_TCP_NODELAY_INHERITED and APR_O_NONBLOCK_INHERITED git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63471 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hnw | 8 ++++++++ network_io/win32/sockets.c | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/apr.hnw b/include/apr.hnw index 5c257c3409a..009b883c80a 100644 --- a/include/apr.hnw +++ b/include/apr.hnw @@ -219,6 +219,14 @@ */ #define APR_CHARSET_EBCDIC 0 +/* Is the TCP_NODELAY socket option inherited from listening sockets? +*/ +#define APR_TCP_NODELAY_INHERITED 1 + +/* Is the O_NONBLOCK flag inherited from listening sockets? +*/ +#define APR_O_NONBLOCK_INHERITED 1 + /* Typedefs that APR needs. */ typedef unsigned char apr_byte_t; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 6b36608ee76..aa29168b0cc 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -247,6 +247,17 @@ APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock, (*new)->local_port_unknown = 1; } +#if APR_TCP_NODELAY_INHERITED + if (apr_is_option_set(sock->netmask, APR_TCP_NODELAY) == 1) { + apr_set_option(&(*new)->netmask, APR_TCP_NODELAY, 1); + } +#endif /* TCP_NODELAY_INHERITED */ +#if APR_O_NONBLOCK_INHERITED + if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) == 1) { + apr_set_option(&(*new)->netmask, APR_SO_NONBLOCK, 1); + } +#endif /* APR_O_NONBLOCK_INHERITED */ + if (sock->local_interface_unknown || !memcmp(sock->local_addr->ipaddr_ptr, generic_inaddr_any, From 9946b5b74f28f5ba9e29f6138a3993b7f1da3bf4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 8 Jun 2002 18:47:56 +0000 Subject: [PATCH 3462/7878] Some simple fn renames ... by the book [deprecated entry points retained] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63472 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_signal.h | 5 +++++ threadproc/netware/signals.c | 7 ++++++- threadproc/unix/signals.c | 10 ++++++++-- threadproc/win32/signals.c | 8 +++++++- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/include/apr_signal.h b/include/apr_signal.h index 9eaca111c39..ae00cb21f02 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -114,6 +114,11 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func); * @param signum The signal number * @return The description of the signal */ +APR_DECLARE(const char *) apr_signal_description_get(int signum); + +/** + * Deprecated: use apr_signal_description_get + */ APR_DECLARE(const char *) apr_signal_get_description(int signum); /** diff --git a/threadproc/netware/signals.c b/threadproc/netware/signals.c index 20f94641a3a..fb22ed5b44b 100644 --- a/threadproc/netware/signals.c +++ b/threadproc/netware/signals.c @@ -74,7 +74,7 @@ void apr_signal_init(apr_pool_t *pglobal) { } -const char *apr_signal_get_description(int signum) +const char *apr_signal_description_get(int signum) { switch (signum) { @@ -109,3 +109,8 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) return rv; } +/* Deprecated */ +const char *apr_signal_get_description(int signum) +{ + return apr_signal_description_get(signum); +} diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 5127868b969..61eb9f34828 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -145,7 +145,7 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func) void apr_signal_init(apr_pool_t *pglobal) { } -const char *apr_signal_get_description(int signum) +const char *apr_signal_description_get(int signum) { return sys_siglist[signum]; } @@ -284,7 +284,7 @@ void apr_signal_init(apr_pool_t *pglobal) signal_description[sig] = apr_psprintf(pglobal, "signal #%d", sig); } -const char *apr_signal_get_description(int signum) +const char *apr_signal_description_get(int signum) { return signum < APR_NUMSIG @@ -453,3 +453,9 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) } #endif + +/* Deprecated */ +const char *apr_signal_get_description(int signum) +{ + return apr_signal_description_get(signum); +} diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index ac62c94b122..779de33f5f4 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -81,7 +81,13 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signal) void apr_signal_init(apr_pool_t *pglobal) { } -const char *apr_signal_get_description(int signum) +const char *apr_signal_description_get(int signum) { return "unknown signal (not supported)"; } + +/* Deprecated */ +const char *apr_signal_get_description(int signum) +{ + return apr_signal_description_get(signum); +} From 0949cf2d4216313c4c43282f741ef2476c21bf0a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 8 Jun 2002 18:53:13 +0000 Subject: [PATCH 3463/7878] renames for apr_xlate_sb_get, which was far more complicated. It seems we are relying more and more on link entry points. We really can't be going about macroizing out NOTIMPL cases, since there is no way to later pick up the features when you replace with the same library built for support of a given feature, or swap it out later. So all platforms need to include unix/xlate.c with #define APR_HAS_XLATE 0 to at least gain the ENOTIMPL entry points. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63473 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/xlate.c | 44 +++++++++++++++++++++++++++++++++++++++++++- include/apr_xlate.h | 40 ++++++---------------------------------- passwd/apr_md5.c | 2 +- 3 files changed, 50 insertions(+), 36 deletions(-) diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 7d1a61cb92c..7ded783de48 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -276,7 +276,7 @@ apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, return status; } -apr_status_t apr_xlate_get_sb(apr_xlate_t *convset, int *onoff) +apr_status_t apr_xlate_sb_get(apr_xlate_t *convset, int *onoff) { *onoff = convset->sbcs_table != NULL; return APR_SUCCESS; @@ -360,4 +360,46 @@ apr_status_t apr_xlate_close(apr_xlate_t *convset) return apr_pool_cleanup_run(convset->pool, convset, apr_xlate_cleanup); } +#else /* !APR_HAS_XLATE */ + +APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, + const char *topage, + const char *frompage, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, + unsigned char inchar) +{ + return (-1); +} + +APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, + const char *inbuf, + apr_size_t *inbytes_left, + char *outbuf, + apr_size_t *outbytes_left) +{ + return APR_ENOTIMPL; +} + +APR_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset) +{ + return APR_ENOTIMPL; +} + #endif /* APR_HAS_XLATE */ + +/* Deprecated + */ +APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff) +{ + return apr_xlate_sb_get(convset, onoff); +} diff --git a/include/apr_xlate.h b/include/apr_xlate.h index 8fcb39cfa51..51744f73b4b 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -82,7 +82,6 @@ extern "C" { * APR_ENOTIMPL at run-time. */ -#if APR_HAS_XLATE typedef struct apr_xlate_t apr_xlate_t; /** @@ -130,7 +129,12 @@ APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, * parameters of conversion * @param onoff Output: whether or not the conversion is single-byte-only */ -APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff); +APR_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff); + +/** + * Deprecated: Use apr_xlate_sb_get() + */ +APR_DECLARE(void) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff); /** * Convert a buffer of text from one codepage to another. @@ -181,38 +185,6 @@ APR_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, */ APR_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset); -#else -/** - * handle for the Translation routines - * (currently not implemented) - */ -typedef void apr_xlate_t; - -/** - * For platforms where we don't bother with translating between charsets, - * these are macros which always return failure. - */ - -#define apr_xlate_open(convset, topage, frompage, pool) APR_ENOTIMPL - -#define apr_xlate_get_sb(convset, onoff) APR_ENOTIMPL - -#define apr_xlate_conv_buffer(convset, inbuf, inbytes_left, outbuf, \ - outbytes_left) APR_ENOTIMPL - -#define apr_xlate_conv_byte(convset, inchar) (-1) - -/** - * The purpose of apr_xlate_conv_char is to translate one character - * at a time. This needs to be written carefully so that it works - * with double-byte character sets. - */ -#define apr_xlate_conv_char(convset, inchar, outchar) APR_ENOTIMPL - -#define apr_xlate_close(convset) APR_ENOTIMPL - -#endif /* ! APR_HAS_XLATE */ - /** @} */ #ifdef __cplusplus } diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index 4c9ac4969b5..58d1119ee15 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -216,7 +216,7 @@ APR_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context, /* TODO: remove the single-byte-only restriction from this code */ - rv = apr_xlate_get_sb(xlate, &is_sb); + rv = apr_xlate_sb_get(xlate, &is_sb); if (rv != APR_SUCCESS) { return rv; } From 38287cb83914abd2bcb31f810b25b281aa53a8d2 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 8 Jun 2002 18:54:57 +0000 Subject: [PATCH 3464/7878] Include i18n/unix/xlate.c for ENOTIMPL entry points git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63474 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 1 - libapr.dsp | 1 - 2 files changed, 2 deletions(-) diff --git a/apr.dsp b/apr.dsp index 84c48cfd73a..d2a0177e4bc 100644 --- a/apr.dsp +++ b/apr.dsp @@ -162,7 +162,6 @@ SOURCE=.\i18n\unix\utf8_ucs2.c # Begin Source File SOURCE=.\i18n\unix\xlate.c -# PROP Exclude_From_Build 1 # End Source File # End Group # Begin Group "locks" diff --git a/libapr.dsp b/libapr.dsp index 6c66ff258f7..cdf3c5b2522 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -168,7 +168,6 @@ SOURCE=.\i18n\unix\utf8_ucs2.c # Begin Source File SOURCE=.\i18n\unix\xlate.c -# PROP Exclude_From_Build 1 # End Source File # End Group # Begin Group "locks" From 0a7da003016f24b5116e1044cc70efc13dea4e80 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 8 Jun 2002 20:04:26 +0000 Subject: [PATCH 3465/7878] Revert bogusness by providing proper stubs for functions that existed since the first indirect APR release [APACHE_2_0_35]. Fortunately, these appear to be the only bogusness detected between _35 and _36, and _37 must follow suit with stubs for newly deprecated symbols. Of course all stubs fall out with 1.0.0, which I picture Apache adopting with stronger version controls in APACHE_2_1_x, but we will see what concensus each project adopts between now and then. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63475 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_compat.h | 9 --------- include/apr_time.h | 9 +++++++++ include/apr_user.h | 8 +++++++- time/unix/time.c | 15 +++++++++++++++ time/win32/time.c | 15 +++++++++++++++ user/netware/groupinfo.c | 7 +++++++ user/unix/groupinfo.c | 7 +++++++ user/win32/groupinfo.c | 7 +++++++ 8 files changed, 67 insertions(+), 10 deletions(-) diff --git a/include/apr_compat.h b/include/apr_compat.h index a82cdc239bd..23a307ae09d 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -11,15 +11,6 @@ * @{ */ -/* changes between APACHE_2_0_35 and APACHE_2_0_36 */ - -/** @deprecated @see apr_time_exp_tz */ -#define apr_explode_time apr_time_exp_tz -/** @deprecated @see apr_time_exp_lt */ -#define apr_explode_localtime apr_time_exp_lt -/** @deprecated @see apr_group_name_get */ -#define apr_get_groupname apr_group_name_get - /* redefine 1.3.x symbols to those that now live in libapr */ /** @see APR_INLINE */ diff --git a/include/apr_time.h b/include/apr_time.h index 8b60133ea4a..a630abd9f9c 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -153,6 +153,11 @@ APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, apr_time_t input, apr_int32_t offs); +/** @deprecated @see apr_time_exp_tz */ +APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, + apr_time_t input, + apr_int32_t offs); + /** * convert a time to its human readable components in GMT timezone * @param result the exploded time @@ -167,6 +172,10 @@ APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, * @param input the time to explode */ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, + apr_time_t input); + +/** @deprecated @see apr_time_exp_lt */ +APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, apr_time_t input); /** diff --git a/include/apr_user.h b/include/apr_user.h index 3cc99e0db10..cda0d7c0b6a 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -154,7 +154,13 @@ APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right); * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ -APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, + apr_gid_t groupid, apr_pool_t *p); + +/** @deprecated @see apr_group_name_get */ +#define apr_get_groupname apr_group_name_get +APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, + apr_gid_t groupid, apr_pool_t *p); /** * Get the groupid for a specified group name diff --git a/time/unix/time.c b/time/unix/time.c index 9415b98a4b6..65b82b0aa36 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -363,3 +363,18 @@ APR_DECLARE(void) apr_unix_setup_time(void) } #endif + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, + apr_time_t input, + apr_int32_t offs) +{ + return apr_time_exp_tz(result, input, offs); +} + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, + apr_time_t input) +{ + return apr_time_exp_lt(result, input); +} diff --git a/time/win32/time.c b/time/win32/time.c index d8b0c4cf318..d10935829d2 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -279,3 +279,18 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t) */ Sleep((DWORD)(t / 1000)); } + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_explode_time(apr_time_exp_t *result, + apr_time_t input, + apr_int32_t offs) +{ + return apr_time_exp_tz(result, input, offs); +} + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_explode_localtime(apr_time_exp_t *result, + apr_time_t input) +{ + return apr_time_exp_lt(result, input); +} diff --git a/user/netware/groupinfo.c b/user/netware/groupinfo.c index 530f2588198..50b45bff675 100644 --- a/user/netware/groupinfo.c +++ b/user/netware/groupinfo.c @@ -75,3 +75,10 @@ APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, const char *groupn { return APR_ENOTIMPL; } + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, + apr_gid_t groupid, apr_pool_t *p) +{ + return apr_group_name_get(groupname, groupid, p); +} diff --git a/user/unix/groupinfo.c b/user/unix/groupinfo.c index a393a911a75..8519b838fff 100644 --- a/user/unix/groupinfo.c +++ b/user/unix/groupinfo.c @@ -105,3 +105,10 @@ APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, const char *groupn #endif return APR_SUCCESS; } + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, + apr_gid_t groupid, apr_pool_t *p) +{ + return apr_group_name_get(groupname, groupid, p); +} diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c index 25c51af316c..c0a2af4a3a2 100644 --- a/user/win32/groupinfo.c +++ b/user/win32/groupinfo.c @@ -136,3 +136,10 @@ APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right) #endif return APR_SUCCESS; } + +/* Deprecated */ +APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, + apr_gid_t groupid, apr_pool_t *p) +{ + return apr_group_name_get(groupname, groupid, p); +} From 9d70ef9d47304815015b0f2d888aed14ce596489 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 8 Jun 2002 20:26:44 +0000 Subject: [PATCH 3466/7878] Pedantic docs change git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63476 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/apr_general.h b/include/apr_general.h index 92dbd44d8a9..463f7362b29 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -150,8 +150,10 @@ typedef int apr_signum_t; #define APR_OFFSETOF(s_type,field) APR_OFFSET(s_type*,field) #endif -/** @deprecated */ +/** @deprecated @see APR_OFFSET */ #define APR_XtOffset APR_OFFSET + +/** @deprecated @see APR_OFFSETOF */ #define APR_XtOffsetOf APR_OFFSETOF From 4d445d035831fd94dfb195c2713132a2c3a0ac1c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 8 Jun 2002 20:27:42 +0000 Subject: [PATCH 3467/7878] More API get/set renames, and providing stubs for those previously renamed without thunks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63477 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 20 +++++++++++++ include/apr_pools.h | 19 +++++++------ memory/unix/apr_pools.c | 62 ++++++++++++++++++++++++++++++++++++++--- 3 files changed, 89 insertions(+), 12 deletions(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index fe548c6253c..25e635c08b6 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -147,12 +147,19 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator, apr_pool_t *pool); +/** @deprecated @see apr_allocator_owner_set */ +APR_DECLARE(void) apr_allocator_set_owner(apr_allocator_t *allocator, + apr_pool_t *pool); + /** * Get the current owner of the allocator * @param allocator The allocator to get the owner from */ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator); +/** @deprecated @see apr_allocator_owner_get */ +APR_DECLARE(apr_pool_t *pool) apr_allocator_get_owner( + apr_allocator_t *allocator); /** * Set the current threshold at which the allocator should start @@ -160,6 +167,10 @@ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator); * @param allocator The allocator the set the threshold on * @param size The threshold. 0 == unlimited. */ +APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, + apr_size_t size); + +/** @deprecated @see apr_allocator_max_free_set */ APR_DECLARE(void) apr_allocator_set_max_free(apr_allocator_t *allocator, apr_size_t size); @@ -174,12 +185,21 @@ APR_DECLARE(void) apr_allocator_set_max_free(apr_allocator_t *allocator, APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator, apr_thread_mutex_t *mutex); +/** @deprecated @see apr_allocator_mutex_set */ +APR_DECLARE(void) apr_allocator_set_mutex(apr_allocator_t *allocator, + apr_thread_mutex_t *mutex); + /** * Get the mutex currently set for the allocator * @param allocator The allocator */ APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get( apr_allocator_t *allocator); + +/** @deprecated @see apr_allocator_mutex_get */ +APR_DECLARE(apr_thread_mutex_t *) apr_allocator_get_mutex( + apr_allocator_t *allocator); + #endif /* APR_HAS_THREADS */ /** @} */ diff --git a/include/apr_pools.h b/include/apr_pools.h index e4bc5e5bdcf..fd6d82c7c8d 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -271,14 +271,7 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, #endif #endif -/** - * This function is deprecated. Use apr_pool_create_ex. - * @param newpool The new sub-pool - * @param parent The pool to use as a parent pool - * @param apr_abort A function to use if the pool cannot allocate more memory. - * @remark The @a apr_abort function provides a way to quit the program if the - * machine is out of memory. By default, APR will return on error. - */ +/** @deprecated @see apr_pool_create_ex */ #if APR_POOL_DEBUG #define apr_pool_sub_make(newpool, parent, abort_fn) \ (void)apr_pool_create_ex_debug(newpool, parent, abort_fn, \ @@ -425,6 +418,10 @@ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size, * then APR will return an error and expect the calling program to * deal with the error accordingly. */ +APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc_t abortfunc, + apr_pool_t *pool); + +/** @deprecated @see apr_pool_abort_set */ APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abortfunc, apr_pool_t *pool); @@ -433,6 +430,9 @@ APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abortfunc, * @param pool The pool for retrieving the abort function. * @return The abort function for the given pool. */ +APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool); + +/** @deprecated @see apr_pool_abort_get */ APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool); /** @@ -440,6 +440,9 @@ APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool); * @param pool The pool for retrieving the parent pool. * @return The parent of the given pool. */ +APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool); + +/** @deprecated @see apr_pool_parent_get */ APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool); /** diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index cdcc3a6025e..27fd52b0e86 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -166,7 +166,7 @@ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator) return allocator->owner; } -APR_DECLARE(void) apr_allocator_set_max_free(apr_allocator_t *allocator, +APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, apr_size_t size) { apr_uint32_t max_free_index; @@ -1734,18 +1734,18 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) * Pool Properties */ -APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abort_fn, +APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc_t abort_fn, apr_pool_t *pool) { pool->abort_fn = abort_fn; } -APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool) +APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool) { return pool->abort_fn; } -APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool) +APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool) { return pool->parent; } @@ -2172,3 +2172,57 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, } #endif /* APR_POOL_DEBUG */ + +/* Deprecated */ +APR_DECLARE(void) apr_allocator_set_max_free(apr_allocator_t *allocator, + apr_size_t size) +{ + apr_allocator_max_free_set(allocator, size); +} + +/* Deprecated */ +APR_DECLARE(void) apr_pool_set_abort(apr_abortfunc_t abort_fn, + apr_pool_t *pool) +{ + apr_pool_abort_set(abort_fn, pool); +} + +/* Deprecated */ +APR_DECLARE(apr_abortfunc_t) apr_pool_get_abort(apr_pool_t *pool) +{ + return apr_pool_abort_get(pool); +} + +/* Deprecated */ +APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool) +{ + return apr_pool_parent_get(pool); +} + +/* Deprecated */ +APR_DECLARE(void) apr_allocator_set_owner(apr_allocator_t *allocator, + apr_pool_t *pool) +{ + apr_allocator_owner_set(allocator, *pool); +} + +/* Deprecated */ +APR_DECLARE(apr_pool_t *pool) apr_allocator_get_owner( + apr_allocator_t *allocator); +{ + return apr_allocator_owner_get(allocator); +} + +/* Deprecated */ +APR_DECLARE(apr_thread_mutex_t *) apr_allocator_get_mutex( + apr_allocator_t *allocator) +{ + return apr_allocator_mutex_get(allocator); +} + +/* Deprecated */ +APR_DECLARE(void) apr_allocator_set_mutex(apr_allocator_t *allocator, + apr_thread_mutex_t *mutex) +{ + apr_allocator_mutex_set(allocator, mutex); +} From 644e517d4fd28695c962dcb7808a834aa1acfb5a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 8 Jun 2002 20:30:13 +0000 Subject: [PATCH 3468/7878] Nice tags, makes things easier to read [wish I noticed earlier] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63478 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_signal.h | 4 +--- include/apr_xlate.h | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/apr_signal.h b/include/apr_signal.h index ae00cb21f02..3a0a013b4dc 100644 --- a/include/apr_signal.h +++ b/include/apr_signal.h @@ -116,9 +116,7 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func); */ APR_DECLARE(const char *) apr_signal_description_get(int signum); -/** - * Deprecated: use apr_signal_description_get - */ +/** @deprecated @see apr_signal_description_get */ APR_DECLARE(const char *) apr_signal_get_description(int signum); /** diff --git a/include/apr_xlate.h b/include/apr_xlate.h index 51744f73b4b..0f96b33cc7a 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -131,9 +131,7 @@ APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, */ APR_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff); -/** - * Deprecated: Use apr_xlate_sb_get() - */ +/** @deprecated @see apr_xlate_sb_get */ APR_DECLARE(void) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff); /** From 48b7e5e9c9c62b8f2f9b11b19b9d47ff874693ef Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 8 Jun 2002 22:09:50 +0000 Subject: [PATCH 3469/7878] Seems I was cutting a pasting just a little over the speed limit. Thanks to Garrett for the fix. Submitted by: Garrett Rooney git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63479 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 2 +- include/apr_user.h | 1 - include/apr_xlate.h | 2 +- memory/unix/apr_pools.c | 6 +++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index 25e635c08b6..e5eba0a6212 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -158,7 +158,7 @@ APR_DECLARE(void) apr_allocator_set_owner(apr_allocator_t *allocator, APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator); /** @deprecated @see apr_allocator_owner_get */ -APR_DECLARE(apr_pool_t *pool) apr_allocator_get_owner( +APR_DECLARE(apr_pool_t *) apr_allocator_get_owner( apr_allocator_t *allocator); /** diff --git a/include/apr_user.h b/include/apr_user.h index cda0d7c0b6a..e54411043c6 100644 --- a/include/apr_user.h +++ b/include/apr_user.h @@ -158,7 +158,6 @@ APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p); /** @deprecated @see apr_group_name_get */ -#define apr_get_groupname apr_group_name_get APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p); diff --git a/include/apr_xlate.h b/include/apr_xlate.h index 0f96b33cc7a..f9c5040ee36 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -132,7 +132,7 @@ APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, APR_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff); /** @deprecated @see apr_xlate_sb_get */ -APR_DECLARE(void) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff); +APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff); /** * Convert a buffer of text from one codepage to another. diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 27fd52b0e86..6a2f2da93f9 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -2203,12 +2203,12 @@ APR_DECLARE(apr_pool_t *) apr_pool_get_parent(apr_pool_t *pool) APR_DECLARE(void) apr_allocator_set_owner(apr_allocator_t *allocator, apr_pool_t *pool) { - apr_allocator_owner_set(allocator, *pool); + apr_allocator_owner_set(allocator, pool); } /* Deprecated */ -APR_DECLARE(apr_pool_t *pool) apr_allocator_get_owner( - apr_allocator_t *allocator); +APR_DECLARE(apr_pool_t *) apr_allocator_get_owner( + apr_allocator_t *allocator) { return apr_allocator_owner_get(allocator); } From b33025d83bc5cbcf61abb368759334f76b31aaba Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 8 Jun 2002 22:19:51 +0000 Subject: [PATCH 3470/7878] Prepare for win32 inherit.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63480 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 2 +- include/arch/win32/inherit.h | 92 ++++++++++++++++++++++++++++++++++++ libapr.dsp | 2 +- 3 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 include/arch/win32/inherit.h diff --git a/apr.dsp b/apr.dsp index d2a0177e4bc..87d68a048a8 100644 --- a/apr.dsp +++ b/apr.dsp @@ -424,7 +424,7 @@ SOURCE=.\include\arch\unix\i18n.h # End Source File # Begin Source File -SOURCE=.\include\arch\unix\inherit.h +SOURCE=.\include\arch\win32\inherit.h # End Source File # Begin Source File diff --git a/include/arch/win32/inherit.h b/include/arch/win32/inherit.h new file mode 100644 index 00000000000..7bc46a0e98a --- /dev/null +++ b/include/arch/win32/inherit.h @@ -0,0 +1,92 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#ifndef INHERIT_H +#define INHERIT_H + +#include "apr_inherit.h" + +#define APR_INHERIT (2^24) /* Must not conflicts with other bits */ + +#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ +void apr_##name##_inherit_set(apr_##name##_t *name) \ +{ \ + if (!(name->flag & APR_INHERIT)) { \ + name->flag |= APR_INHERIT; \ + apr_pool_child_cleanup_set(name->pool, (void *)name, \ + cleanup, apr_pool_cleanup_null); \ + } \ +} \ +/* Deprecated */ \ +void apr_##name##_set_inherit(apr_##name##_t *name) \ +{ \ + apr_##name##_inherit_set(apr_##name##_t *name) \ +} + +#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ +void apr_##name##_inherit_unset(apr_##name##_t *name) \ +{ \ + if (name->flag & APR_INHERIT) { \ + name->flag &= ~APR_INHERIT; \ + apr_pool_child_cleanup_set(name->pool, (void *)name, \ + cleanup, cleanup); \ + } \ +} \ +/* Deprecated */ \ +void apr_##name##_unset_inherit(apr_##name##_t *name) \ +{ \ + apr_##name##_inherit_unset(apr_##name##_t *name) \ +} + +#endif /* ! INHERIT_H */ diff --git a/libapr.dsp b/libapr.dsp index cdf3c5b2522..eb63be9c3c9 100644 --- a/libapr.dsp +++ b/libapr.dsp @@ -430,7 +430,7 @@ SOURCE=.\include\arch\unix\i18n.h # End Source File # Begin Source File -SOURCE=.\include\arch\unix\inherit.h +SOURCE=.\include\arch\win32\inherit.h # End Source File # Begin Source File From ad3d8abb67fe746267245cb74f9674927c74f524 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sat, 8 Jun 2002 22:32:11 +0000 Subject: [PATCH 3471/7878] Last for today (compiles clean on Win32, hope the same for the rest of our builds.) Clean up inherit_[un]set and simplify win32 discrepancy with inherit.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63481 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/open.c | 4 ++-- file_io/unix/filedup.c | 2 +- file_io/unix/open.c | 4 ++-- file_io/win32/open.c | 11 ++++------- include/apr_file_io.h | 12 +++++++++--- include/apr_inherit.h | 11 ++++++----- include/apr_network_io.h | 8 +++++++- include/arch/unix/inherit.h | 18 ++++++++++++++---- include/arch/win32/inherit.h | 24 ++++++++---------------- network_io/os2/sockets.c | 4 ++-- network_io/unix/sockets.c | 4 ++-- network_io/win32/sockets.c | 9 +++------ 12 files changed, 60 insertions(+), 51 deletions(-) diff --git a/file_io/os2/open.c b/file_io/os2/open.c index cef62e53b0b..05301d815f4 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -267,7 +267,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t * APR_POOL_IMPLEMENT_ACCESSOR(file); -APR_IMPLEMENT_SET_INHERIT(file, flags, pool, apr_file_cleanup) +APR_IMPLEMENT_INHERIT_SET(file, flags, pool, apr_file_cleanup) -APR_IMPLEMENT_UNSET_INHERIT(file, flags, pool, apr_file_cleanup) +APR_IMPLEMENT_INHERIT_UNSET(file, flags, pool, apr_file_cleanup) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 8c43de810c8..67b5e497465 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -113,7 +113,7 @@ static apr_status_t _file_dup(apr_file_t **new_file, (*new_file)->ungetchar = old_file->ungetchar; /* apr_file_dup() clears the inherit attribute, user must call - * apr_file_set_inherit() again on the dupped handle, as necessary. + * apr_file_inherit_set() again on the dupped handle, as necessary. */ (*new_file)->flags = old_file->flags & ~APR_INHERIT; diff --git a/file_io/unix/open.c b/file_io/unix/open.c index f887c9a47c3..46882a1633f 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -272,8 +272,8 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, return apr_os_file_put(thefile, &fd, 0, pool); } -APR_IMPLEMENT_SET_INHERIT(file, flags, pool, apr_unix_file_cleanup) +APR_IMPLEMENT_INHERIT_SET(file, flags, pool, apr_unix_file_cleanup) -APR_IMPLEMENT_UNSET_INHERIT(file, flags, pool, apr_unix_file_cleanup) +APR_IMPLEMENT_INHERIT_UNSET(file, flags, pool, apr_unix_file_cleanup) APR_POOL_IMPLEMENT_ACCESSOR(file) diff --git a/file_io/win32/open.c b/file_io/win32/open.c index df7a959cfd4..796d0e45bc5 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -68,6 +68,7 @@ #include #endif #include "misc.h" +#include "inherit.h" #if APR_HAS_UNICODE_FS apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, @@ -605,10 +606,6 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t * APR_POOL_IMPLEMENT_ACCESSOR(file); -APR_DECLARE_SET_INHERIT(file) { - return; -} - -APR_DECLARE_UNSET_INHERIT(file) { - return; -} +APR_IMPLEMENT_INHERIT_SET(file, flags, pool, file_cleanup) + +APR_IMPLEMENT_INHERIT_UNSET(file, flags, pool, file_cleanup) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index f6af7d14093..b1775b45919 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -118,11 +118,11 @@ extern "C" { /** @} */ /** - * @defgroup APR_file_set_attributes File Attribute Flags + * @defgroup APR_file_attrs_set File Attribute Flags * @{ */ -/* flags for apr_file_set_attributes */ +/* flags for apr_file_attrs_set */ #define APR_FILE_ATTR_READONLY 0x01 /**< File is read-only */ #define APR_FILE_ATTR_EXECUTABLE 0x02 /**< File is executable */ /** @} */ @@ -666,12 +666,18 @@ APR_POOL_DECLARE_ACCESSOR(file); * @param file The file to enable inheritance. * */ -APR_DECLARE(void) apr_file_set_inherit(apr_file_t *file); +APR_DECLARE(void) apr_file_inherit_set(apr_file_t *file); /** * Unset a file from being inherited by child processes. * @param file The file to disable inheritance. */ +APR_DECLARE(void) apr_file_inherit_unset(apr_file_t *file); + +/** @deprecated @see apr_file_inherit_set */ +APR_DECLARE(void) apr_file_set_inherit(apr_file_t *file); + +/** @deprecated @see apr_file_inherit_unset */ APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); /** diff --git a/include/apr_inherit.h b/include/apr_inherit.h index 07b1d210319..d917b616fad 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -70,17 +70,18 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ + /** * @param name Set Inheritance for this Socket/File Handle */ -#define APR_DECLARE_SET_INHERIT(name) \ - APR_DECLARE(void) apr_##name##_set_inherit(apr_##name##_t *name) +#define APR_DECLARE_INHERIT_SET(name) \ + APR_DECLARE(void) apr_##name##_inherit_set(apr_##name##_t *name) + /** * @param name Unset Inheritance for this Socket/File Handle */ - -#define APR_DECLARE_UNSET_INHERIT(name) \ - APR_DECLARE(void) apr_##name##_unset_inherit(apr_##name##_t *name) +#define APR_DECLARE_INHERIT_UNSET(name) \ + APR_DECLARE(void) apr_##name##_inherit_unset(apr_##name##_t *name) #ifdef __cplusplus } diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 44e379221b9..723c6acbc61 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -811,13 +811,19 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, * Set a socket to be inherited by child processes. * @param socket The socket to enable inheritance. */ +APR_DECLARE(void) apr_socket_inherit_set(apr_socket_t *skt); + +/** @deprecated @see apr_socket_inherit_set */ APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *skt); /** * Unset a socket from being inherited by child processes. * @param socket The socket to disable inheritance. */ -APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *skt); +APR_DECLARE(void) apr_socket_inherit_unset(apr_socket_t *skt); + +/** @deprecated @see apr_socket_inherit_set */ +APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *skt); #ifdef __cplusplus } diff --git a/include/arch/unix/inherit.h b/include/arch/unix/inherit.h index 503daf61091..090835230e0 100644 --- a/include/arch/unix/inherit.h +++ b/include/arch/unix/inherit.h @@ -59,24 +59,34 @@ #define APR_INHERIT (2^24) /* Must not conflicts with other bits */ -#define APR_IMPLEMENT_SET_INHERIT(name, flag, pool, cleanup) \ -void apr_##name##_set_inherit(apr_##name##_t *name) \ +#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ +void apr_##name##_inherit_set(apr_##name##_t *name) \ { \ if (!(name->flag & APR_INHERIT)) { \ name->flag |= APR_INHERIT; \ apr_pool_child_cleanup_set(name->pool, (void *)name, \ cleanup, apr_pool_cleanup_null); \ } \ +} \ +/* Deprecated */ \ +void apr_##name##_set_inherit(apr_##name##_t *name) \ +{ \ + apr_##name##_inherit_set(name); \ } -#define APR_IMPLEMENT_UNSET_INHERIT(name, flag, pool, cleanup) \ -void apr_##name##_unset_inherit(apr_##name##_t *name) \ +#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ +void apr_##name##_inherit_unset(apr_##name##_t *name) \ { \ if (name->flag & APR_INHERIT) { \ name->flag &= ~APR_INHERIT; \ apr_pool_child_cleanup_set(name->pool, (void *)name, \ cleanup, cleanup); \ } \ +} \ +/* Deprecated */ \ +void apr_##name##_unset_inherit(apr_##name##_t *name) \ +{ \ + apr_##name##_inherit_unset(name); \ } #endif /* ! INHERIT_H */ diff --git a/include/arch/win32/inherit.h b/include/arch/win32/inherit.h index 7bc46a0e98a..577b9788e09 100644 --- a/include/arch/win32/inherit.h +++ b/include/arch/win32/inherit.h @@ -60,33 +60,25 @@ #define APR_INHERIT (2^24) /* Must not conflicts with other bits */ #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ -void apr_##name##_inherit_set(apr_##name##_t *name) \ +APR_DECLARE(void) apr_##name##_inherit_set(apr_##name##_t *name) \ { \ - if (!(name->flag & APR_INHERIT)) { \ - name->flag |= APR_INHERIT; \ - apr_pool_child_cleanup_set(name->pool, (void *)name, \ - cleanup, apr_pool_cleanup_null); \ - } \ + return; \ } \ /* Deprecated */ \ -void apr_##name##_set_inherit(apr_##name##_t *name) \ +APR_DECLARE(void) apr_##name##_set_inherit(apr_##name##_t *name) \ { \ - apr_##name##_inherit_set(apr_##name##_t *name) \ + apr_##name##_inherit_set(name); \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ -void apr_##name##_inherit_unset(apr_##name##_t *name) \ +APR_DECLARE(void) apr_##name##_inherit_unset(apr_##name##_t *name) \ { \ - if (name->flag & APR_INHERIT) { \ - name->flag &= ~APR_INHERIT; \ - apr_pool_child_cleanup_set(name->pool, (void *)name, \ - cleanup, cleanup); \ - } \ + return; \ } \ /* Deprecated */ \ -void apr_##name##_unset_inherit(apr_##name##_t *name) \ +APR_DECLARE(void) apr_##name##_unset_inherit(apr_##name##_t *name) \ { \ - apr_##name##_inherit_unset(apr_##name##_t *name) \ + apr_##name##_inherit_unset(name); \ } #endif /* ! INHERIT_H */ diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index c8109945aac..0c2d5baa3f6 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -296,6 +296,6 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *th return APR_SUCCESS; } -APR_IMPLEMENT_SET_INHERIT(socket, inherit, cntxt, socket_cleanup) +APR_IMPLEMENT_INHERIT_SET(socket, inherit, cntxt, socket_cleanup) -APR_IMPLEMENT_UNSET_INHERIT(socket, inherit, cntxt, socket_cleanup) +APR_IMPLEMENT_INHERIT_UNSET(socket, inherit, cntxt, socket_cleanup) diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 38426be8887..58f7fd246de 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -371,6 +371,6 @@ apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, return APR_SUCCESS; } -APR_IMPLEMENT_SET_INHERIT(socket, inherit, cntxt, socket_cleanup) +APR_IMPLEMENT_INHERIT_SET(socket, inherit, cntxt, socket_cleanup) -APR_IMPLEMENT_UNSET_INHERIT(socket, inherit, cntxt, socket_cleanup) +APR_IMPLEMENT_INHERIT_UNSET(socket, inherit, cntxt, socket_cleanup) diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index aa29168b0cc..32817f2f218 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -58,6 +58,7 @@ #include "apr_lib.h" #include "apr_portable.h" #include +#include "inherit.h" static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */ @@ -423,10 +424,6 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, return APR_SUCCESS; } -APR_DECLARE_SET_INHERIT(socket) { - return; -} +APR_IMPLEMENT_INHERIT_SET(socket, inherit, cntxt, socket_cleanup) -APR_DECLARE_UNSET_INHERIT(socket) { - return; -} +APR_IMPLEMENT_INHERIT_UNSET(socket, inherit, cntxt, socket_cleanup) From f30f5fef0f867df995dc591b81de06bde48f152a Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 9 Jun 2002 04:42:58 +0000 Subject: [PATCH 3472/7878] Remove one of the two declarations of apr_socket_inherit_set() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63482 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 723c6acbc61..14830832a01 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -822,9 +822,6 @@ APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *skt); */ APR_DECLARE(void) apr_socket_inherit_unset(apr_socket_t *skt); -/** @deprecated @see apr_socket_inherit_set */ -APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *skt); - #ifdef __cplusplus } #endif From 5cdcabe693187a6069e334f27a68387e5f95bdb0 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 9 Jun 2002 05:01:40 +0000 Subject: [PATCH 3473/7878] set/set, unset/unset. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63483 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_network_io.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 14830832a01..7664d7637ad 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -822,6 +822,9 @@ APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *skt); */ APR_DECLARE(void) apr_socket_inherit_unset(apr_socket_t *skt); +/** @deprecated @see apr_socket_inherit_unset */ +APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *skt); + #ifdef __cplusplus } #endif From 56cdc6946e817dc184a8025c3c28863aabcdb883 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Sun, 9 Jun 2002 18:50:47 +0000 Subject: [PATCH 3474/7878] Added support for building the tests when $objdir != $srcdir. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63484 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index f9bb7a4eb60..ce2440f3553 100644 --- a/configure.in +++ b/configure.in @@ -1763,7 +1763,7 @@ do fi done -if test -d ./test; then +if test -d $srcdir/test; then MAKEFILE3="test/Makefile" fi AC_SUBST(SUBDIRS) From af293e91c881ef57f77123d9d905574b12a9b3aa Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Sun, 9 Jun 2002 20:25:51 +0000 Subject: [PATCH 3475/7878] Fix calculation of tm_gmtoff on Windows, and add a test case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63485 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtime.c | 57 ++++++++++++++++++++++++++++++++++++++--------- time/win32/time.c | 10 +++++---- 2 files changed, 53 insertions(+), 14 deletions(-) diff --git a/test/testtime.c b/test/testtime.c index 39fcc5d6162..a1ee2ce7b7f 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -62,6 +62,23 @@ #define STR_SIZE 45 +static const char* print_time (apr_pool_t *pool, const apr_time_exp_t *xt) +{ + return apr_psprintf (pool, + "%04d-%02d-%02d %02d:%02d:%02d.%06d %+05d [%d %s]%s", + xt->tm_year + 1900, + xt->tm_mon, + xt->tm_mday, + xt->tm_hour, + xt->tm_min, + xt->tm_sec, + xt->tm_usec, + xt->tm_gmtoff, + xt->tm_yday + 1, + apr_day_snames[xt->tm_wday], + (xt->tm_isdst ? " DST" : "")); +} + int main(void) { apr_time_t now; @@ -84,20 +101,39 @@ int main(void) printf("OK\n"); STD_TEST_NEQ(" apr_time_exp_gmt", apr_time_exp_gmt(&xt, now)) - + printf(" (%s)\n", print_time(p, &xt)); + STD_TEST_NEQ(" apr_time_exp_lt", apr_time_exp_lt(&xt2, now)) + printf(" (%s)\n", print_time(p, &xt2)); STD_TEST_NEQ(" apr_time_exp_get (GMT)", apr_time_exp_get(&imp, &xt)) printf("%-60s", " checking GMT explode == implode"); - if (imp != now) { - printf("mismatch\n" + hr_off_64 = (apr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC; + if (imp != now + hr_off_64) { + printf("mismatch\n" "\t\tapr_now() %" APR_INT64_T_FMT "\n" "\t\tapr_implode() returned %" APR_INT64_T_FMT "\n" "\t\terror delta was %" APR_TIME_T_FMT "\n" - "\t\tshould have been 0\n", - now, imp, imp-now); - exit(-1); + "\t\tshould have been %" APR_INT64_T_FMT "\n", + now, imp, imp-now, hr_off_64); + exit(-1); + } + printf("OK\n"); + + STD_TEST_NEQ(" apr_time_exp_get (localtime)", + apr_time_exp_get(&imp, &xt2)) + + printf("%-60s", " checking localtime explode == implode"); + hr_off_64 = (apr_int64_t) xt2.tm_gmtoff * APR_USEC_PER_SEC; + if (imp != now + hr_off_64) { + printf("mismatch\n" + "\t\tapr_now() %" APR_INT64_T_FMT "\n" + "\t\tapr_implode() returned %" APR_INT64_T_FMT "\n" + "\t\terror delta was %" APR_TIME_T_FMT "\n" + "\t\tshould have been %" APR_INT64_T_FMT "\n", + now, imp, imp-now, hr_off_64); + exit(-1); } printf("OK\n"); @@ -121,13 +157,13 @@ int main(void) printf("%-60s", " checking localtime explode == GMT implode"); if (imp != now) { - printf("mismatch\n" + printf("mismatch\n" "\t\tapr_now() %" APR_INT64_T_FMT "\n" "\t\tapr_implode() returned %" APR_INT64_T_FMT "\n" "\t\terror delta was %" APR_TIME_T_FMT "\n" "\t\tshould have been 0\n", now, imp, imp-now); - exit(-1); + exit(-1); } printf("OK\n"); @@ -178,8 +214,9 @@ int main(void) exit(-1); } printf("OK\n"); - printf(" ( %lld - %lld = %lld )\n", imp, now, imp - now); - + printf(" ( %" APR_TIME_T_FMT " - %" APR_TIME_T_FMT + " = %" APR_INT64_T_FMT " )\n", imp, now, imp - now); + printf("\nTest Complete.\n"); return 0; } diff --git a/time/win32/time.c b/time/win32/time.c index d10935829d2..672b683cf2e 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -105,16 +105,19 @@ static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm, BOOL lt) rc = GetTimeZoneInformation(&tz); switch (rc) { case TIME_ZONE_ID_UNKNOWN: - case TIME_ZONE_ID_STANDARD: xt->tm_isdst = 0; /* Bias = UTC - local time in minutes * tm_gmtoff is seconds east of UTC */ xt->tm_gmtoff = tz.Bias * -60; break; + case TIME_ZONE_ID_STANDARD: + xt->tm_isdst = 0; + xt->tm_gmtoff = (tz.Bias + tz.StandardBias) * -60; + break; case TIME_ZONE_ID_DAYLIGHT: xt->tm_isdst = 1; - xt->tm_gmtoff = tz.Bias * -60; + xt->tm_gmtoff = (tz.Bias + tz.DaylightBias) * -60; break; default: xt->tm_isdst = 0; @@ -224,8 +227,7 @@ APR_DECLARE(apr_status_t) apr_implode_gmt(apr_time_t *t, { apr_status_t status = apr_time_exp_get(t, xt); if (status == APR_SUCCESS) - *t -= (apr_time_t) (xt->tm_isdst * 3600 - + xt->tm_gmtoff) * APR_USEC_PER_SEC; + *t -= (apr_time_t) xt->tm_gmtoff * APR_USEC_PER_SEC; return status; } From 507c21f5593d916191e0b6911364de74e2b71ae9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 10 Jun 2002 13:50:01 +0000 Subject: [PATCH 3476/7878] move some deprecated functions inside a check for APR_HAS_THREADS so a non-thread-capable APR can build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63486 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 6a2f2da93f9..e9afb0b395d 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -2213,6 +2213,7 @@ APR_DECLARE(apr_pool_t *) apr_allocator_get_owner( return apr_allocator_owner_get(allocator); } +#if APR_HAS_THREADS /* Deprecated */ APR_DECLARE(apr_thread_mutex_t *) apr_allocator_get_mutex( apr_allocator_t *allocator) @@ -2226,3 +2227,5 @@ APR_DECLARE(void) apr_allocator_set_mutex(apr_allocator_t *allocator, { apr_allocator_mutex_set(allocator, mutex); } +#endif /* APR_HAS_THREADS */ + From e00491406d63f28c22a3f8e451022e5a2f112ee1 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Mon, 10 Jun 2002 16:20:52 +0000 Subject: [PATCH 3477/7878] Check the detached flag and spawn the NLM appropriately. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63487 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/proc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 7a409160785..dd5dd953f9e 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -294,6 +294,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, apr_pool_t *pool) { wiring_t wire; + int addr_space; wire.infd = attr->child_in ? attr->child_in->filedes : FD_UNUSED; wire.outfd = attr->child_out ? attr->child_out->filedes : FD_UNUSED; @@ -303,9 +304,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, newproc->out = attr->parent_out; newproc->err = attr->parent_err; - /* XXX Switch to spawning in separate address spaces once the address - space shutdown problem is fixed. */ - if ((newproc->pid = processve(progname, PROC_CURRENT_SPACE, (const char**)env, &wire, + addr_space = attr->detached ? 0 : PROC_CURRENT_SPACE; + + if ((newproc->pid = processve(progname, addr_space, (const char**)env, &wire, NULL, NULL, (const char **)args)) == 0) { return errno; } From a819a52f88aac05445eae620035ee5b92c578b5d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 10 Jun 2002 18:51:13 +0000 Subject: [PATCH 3478/7878] It helps to document the actual option. :-) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63488 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index ce2440f3553..12d54896ef9 100644 --- a/configure.in +++ b/configure.in @@ -310,7 +310,7 @@ proc_mutex_is_global=0 user_disabled_optimized_atomics=0 AC_ARG_ENABLE(atomics, - [ --disable-optimized-atomics Turn off optimized atomic code], + [ --disable-atomics Turn off optimized atomic code], [ if test "$enableval" = "no"; then user_disabled_optimized_atomics=1 fi ] ) From 5d70191e2125c73e3d85f1883bbf62609ffeed5f Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Tue, 11 Jun 2002 10:35:20 +0000 Subject: [PATCH 3479/7878] OS/2: Fix build breakage due to missing apr_dir_make_recursive(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63489 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/dir.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 7c1bfe74824..9ccd8c55a40 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -175,6 +175,14 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, a +apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, + apr_pool_t *pool) +{ + return APR_ENOTIMPL; +} + + + APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool) { return APR_OS2_STATUS(DosDeleteDir(path)); From 28dd3229030b93c09616ffa84ec5ec4d5c5ce0e9 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 11 Jun 2002 15:34:26 +0000 Subject: [PATCH 3480/7878] Switch to a Reader/Writer lock to try to avoid lock contention when accessing the hash table. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63491 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/netware/filestat.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 22b885debcd..4b3c0155826 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -59,10 +59,13 @@ #include "apr_strings.h" #include "apr_errno.h" #include "apr_hash.h" -#define USE_CSTAT_MUTEX +#define USE_CSTAT_RWLOCK #ifdef USE_CSTAT_MUTEX #include "apr_thread_mutex.h" #endif +#ifdef USE_CSTAT_RWLOCK +#include "apr_thread_rwlock.h" +#endif static apr_filetype_e filetype_from_mode(mode_t mode) { @@ -226,6 +229,9 @@ struct apr_stat_cache_t { #ifdef USE_CSTAT_MUTEX apr_thread_mutex_t *statcache_mutex; #endif +#ifdef USE_CSTAT_RWLOCK + apr_thread_rwlock_t *statcache_mutex; +#endif }; int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *pool) @@ -234,6 +240,9 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo apr_hash_t *statCache = NULL; #ifdef USE_CSTAT_MUTEX apr_thread_mutex_t *statcache_mutex; +#endif +#ifdef USE_CSTAT_RWLOCK + apr_thread_rwlock_t *statcache_mutex; #endif apr_pool_t *gPool = (apr_pool_t *)getGlobalPool(); apr_stat_entry_t *stat_entry; @@ -259,7 +268,7 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo with a new mutex lock. */ if (statCacheData) { statCache = statCacheData->statCache; -#ifdef USE_CSTAT_MUTEX +#if defined(USE_CSTAT_MUTEX) || defined(USE_CSTAT_RWLOCK) statcache_mutex = statCacheData->statcache_mutex; #endif } @@ -269,6 +278,10 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo #ifdef USE_CSTAT_MUTEX apr_thread_mutex_create(&statcache_mutex, APR_THREAD_MUTEX_DEFAULT, gPool); statCacheData->statcache_mutex = statcache_mutex; +#endif +#ifdef USE_CSTAT_RWLOCK + apr_thread_rwlock_create(&statcache_mutex, gPool); + statCacheData->statcache_mutex = statcache_mutex; #endif statCacheData->statCache = statCache; setStatCache((void*)statCacheData); @@ -279,10 +292,16 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo if (statCache) { #ifdef USE_CSTAT_MUTEX apr_thread_mutex_lock(statcache_mutex); +#endif +#ifdef USE_CSTAT_RWLOCK + apr_thread_rwlock_rdlock(statcache_mutex); #endif stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, path, APR_HASH_KEY_STRING); #ifdef USE_CSTAT_MUTEX apr_thread_mutex_unlock(statcache_mutex); +#endif +#ifdef USE_CSTAT_RWLOCK + apr_thread_rwlock_unlock(statcache_mutex); #endif /* If we got an entry then check the expiration time. If the entry hasn't expired yet then copy the information and return. */ @@ -303,6 +322,9 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo *casedName = case_filename(pool, path); #ifdef USE_CSTAT_MUTEX apr_thread_mutex_lock(statcache_mutex); +#endif +#ifdef USE_CSTAT_RWLOCK + apr_thread_rwlock_wrlock(statcache_mutex); #endif /* If we don't have a stat_entry then create one, copy the data and add it to the hash table. */ @@ -329,6 +351,9 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo } #ifdef USE_CSTAT_MUTEX apr_thread_mutex_unlock(statcache_mutex); +#endif +#ifdef USE_CSTAT_RWLOCK + apr_thread_rwlock_unlock(statcache_mutex); #endif } else From 2a89acfc5830fefcfcc98179c00976bb3ed2d6f6 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 11 Jun 2002 15:35:25 +0000 Subject: [PATCH 3481/7878] Use the native cmpxchg() function for NetWare git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63492 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/netware/apr_atomic.c | 45 ------------------------------------- include/apr_atomic.h | 6 +---- 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index 7687a126d52..ff21945eb50 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -54,56 +54,11 @@ #include "apr.h" -#include "apr_thread_mutex.h" #include "apr_atomic.h" -#if APR_HAS_THREADS - -#if defined(APR_ATOMIC_NEED_DEFAULT) || defined(APR_ATOMIC_NEED_CAS_DEFAULT) - -#define NUM_ATOMIC_HASH 7 -/* shift by 2 to get rid of alignment issues */ -#define ATOMIC_HASH(x) (int)(((long)x>>2)%NUM_ATOMIC_HASH) -static apr_thread_mutex_t **hash_mutex; - -apr_status_t apr_atomic_init(apr_pool_t *p ) -{ - int i; - apr_status_t rv; - hash_mutex =apr_palloc(p,sizeof(apr_thread_mutex_t*) * NUM_ATOMIC_HASH); - for (i=0;i Date: Tue, 11 Jun 2002 18:07:03 +0000 Subject: [PATCH 3482/7878] Why was this in there? It generates a warning (deprecated header file) on FreeBSD 4.6-RC. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63493 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index da076058b62..9ed11d9c8c2 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -69,9 +69,6 @@ #if APR_HAVE_STDLIB_H #include #endif -#ifdef HAVE_MALLOC_H -#include -#endif #if APR_HAVE_STRING_H #include #endif From d5483399b11a20ad9ac87bd72fe64ca9d5cdbc23 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Tue, 11 Jun 2002 18:30:16 +0000 Subject: [PATCH 3483/7878] Create the distribution directory at the root of the project rather than above the root git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63494 13f79535-47bb-0310-9956-ffa450edef68 --- build/NWGNUenvironment.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index d515de27868..2131d032c42 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -178,8 +178,8 @@ endif endif ifndef INSTALL -INSTALL = $(APR_WORK)\..\Dist -INSTDIRS = $(APR_WORK)\..\Dist +INSTALL = $(APR_WORK)\Dist +INSTDIRS = $(APR_WORK)\Dist endif INSTDEVDIRS := \ From cb1b3f5ad4dc3f1d4efb7f1f4a590cf06ab974e2 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Wed, 12 Jun 2002 01:42:35 +0000 Subject: [PATCH 3484/7878] More conservative buffer overflow checking code for apr_filepath_merge(): fail immediately if the sum of the rootpath and addpath lengths is too long, rather than letting long strings pass through and checking for overflow at multiple points throughout the merge code. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63495 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filepath.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/file_io/unix/filepath.c b/file_io/unix/filepath.c index d84c4769432..5ab44cf5bfa 100644 --- a/file_io/unix/filepath.c +++ b/file_io/unix/filepath.c @@ -189,10 +189,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * root, and at end, plus trailing * null */ if (maxlen > APR_PATH_MAX) { - if (rootlen >= APR_PATH_MAX) { - return APR_ENAMETOOLONG; - } - maxlen = APR_PATH_MAX; + return APR_ENAMETOOLONG; } path = (char *)apr_palloc(p, maxlen); @@ -223,8 +220,6 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* Always '/' terminate the given root path */ if (keptlen && path[keptlen - 1] != '/') { - if (keptlen + 1 >= maxlen) - return APR_ENAMETOOLONG; path[keptlen++] = '/'; } pathlen = keptlen; @@ -271,9 +266,6 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* Otherwise append another backpath. */ - if (pathlen + 3 >= maxlen ) { - return APR_ENAMETOOLONG; - } memcpy(path + pathlen, "../", 3); pathlen += 3; } @@ -304,9 +296,6 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, if (*next) { seglen++; } - if (pathlen + seglen >= maxlen) { - return APR_ENAMETOOLONG; - } memcpy(path + pathlen, addpath, seglen); pathlen += seglen; } From 7d7d18183148ab7434a2f51f3fc789cf2da905c9 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 12 Jun 2002 01:45:04 +0000 Subject: [PATCH 3485/7878] fix typo git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63496 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/unix/start.c b/misc/unix/start.c index b1ad87528b0..94b34a0b2a0 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -96,7 +96,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_ENOPOOL; } - apr_pool_tag(pool, "apr_initilialize"); + apr_pool_tag(pool, "apr_initialize"); apr_signal_init(pool); From 91ff84e02b90273c4e6f26057859bc71b0a4a89e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 12 Jun 2002 07:39:31 +0000 Subject: [PATCH 3486/7878] To simplify future, experimental work with binary usec values, these are suggested wrappers for common uses of APR_USEC_PER_SEC. Comments welcome. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63497 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/apr_time.h b/include/apr_time.h index a630abd9f9c..64b8c125fa1 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -95,6 +95,13 @@ typedef apr_int32_t apr_short_interval_time_t; /** number of microseconds per second */ #define APR_USEC_PER_SEC APR_TIME_C(1000000) +#define APR_TIME_USEC(time) ((apr_int32_t)(time) % APR_USEC_PER_SEC) + +#define APR_TIME_SEC(time) ((apr_int64_t)(time) / APR_USEC_PER_SEC) + +#define APR_TIME_FROM_SEC(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC) + +#define APR_TIME_MAKE(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC + usec) /** * return the current time From f16e01ac3a435fd9241adf6dd203253f448fc5e9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 12 Jun 2002 16:45:21 +0000 Subject: [PATCH 3487/7878] get rid of a warning (unreferenced static function) for some pool-debug build flavors git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63498 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index e9afb0b395d..31a1ef7c9d5 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1153,6 +1153,7 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, } #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ +#if (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) static int pool_is_child_of(apr_pool_t *parent, void *data) { apr_pool_t *pool = (apr_pool_t *)data; @@ -1167,6 +1168,7 @@ static int apr_pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent) return apr_pool_walk_tree(parent, pool_is_child_of, pool); } +#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) */ static void apr_pool_check_integrity(apr_pool_t *pool) { From 5cb92651889e991c86158b5f1afdbca4f0e576d9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 12 Jun 2002 21:56:49 +0000 Subject: [PATCH 3488/7878] Fix a typo pointed out by Greg Marr [thx!] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63499 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apr_time.h b/include/apr_time.h index 64b8c125fa1..4125e6083c0 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -101,7 +101,8 @@ typedef apr_int32_t apr_short_interval_time_t; #define APR_TIME_FROM_SEC(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC) -#define APR_TIME_MAKE(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC + usec) +#define APR_TIME_MAKE(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC \ + + (apr_time_t)(usec)) /** * return the current time From 782cb009154039eec051dfc6b8c32328a2f6cd93 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 12 Jun 2002 22:23:56 +0000 Subject: [PATCH 3489/7878] Lowercase macros, per Roy Fielding's comments and general concensus. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63500 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr_time.h b/include/apr_time.h index 4125e6083c0..88d8c41b5f5 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -95,13 +95,13 @@ typedef apr_int32_t apr_short_interval_time_t; /** number of microseconds per second */ #define APR_USEC_PER_SEC APR_TIME_C(1000000) -#define APR_TIME_USEC(time) ((apr_int32_t)(time) % APR_USEC_PER_SEC) +#define apr_time_usec(time) ((apr_int32_t)(time) % APR_USEC_PER_SEC) -#define APR_TIME_SEC(time) ((apr_int64_t)(time) / APR_USEC_PER_SEC) +#define apr_time_sec(time) ((apr_int64_t)(time) / APR_USEC_PER_SEC) -#define APR_TIME_FROM_SEC(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC) +#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC) -#define APR_TIME_MAKE(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC \ +#define apr_time_make(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC \ + (apr_time_t)(usec)) /** From ddeed51a5786cad4f4b1d6dc67089e4763f39399 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 13 Jun 2002 00:40:50 +0000 Subject: [PATCH 3490/7878] Building the wrong dso.c in the make files. Switched to the Netware version. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63501 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index df06d8db63f..aeb2cd5f686 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -368,9 +368,9 @@ $(OBJDIR)/%.o: threadproc/netware/%.c $(OBJDIR)\cc.opt @echo Compiling $< $(CC) threadproc\netware\$( Date: Fri, 14 Jun 2002 01:24:02 +0000 Subject: [PATCH 3491/7878] Removed --disable-atomics flag and added --enable-nonportable-atomics, thereby defaulting to portable binaries on those systems that could be optimized at the expense of portability. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63502 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ configure.in | 16 +++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 49f08fc9063..131f8f36b2c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Removed --disable-atomics flag and added --enable-nonportable-atomics, + thereby defaulting to portable binaries on those systems that could + be optimized at the expense of portability. PR: 9507 [Aaron Bannert] + *) Added 2 additional lock functions: apr_proc_mutex_name and apr_proc_mutex_defname which returns the type name of the mutex (eg: "sysvsem") as well as the default mutex type (APR_LOCK_DEFAULT). diff --git a/configure.in b/configure.in index 12d54896ef9..b21d1a2400f 100644 --- a/configure.in +++ b/configure.in @@ -307,13 +307,15 @@ dnl we are using for the more up to date cpu/OS dnl (ie.. old sparcs) apr_force_atomic_generic=0 proc_mutex_is_global=0 -user_disabled_optimized_atomics=0 +enable_nonportable_atomics=0 -AC_ARG_ENABLE(atomics, - [ --disable-atomics Turn off optimized atomic code], - [ if test "$enableval" = "no"; then - user_disabled_optimized_atomics=1 - fi ] ) +AC_ARG_ENABLE(nonportable-atomics, +[ --enable-nonportable-atomics Turn on optimized atomic code which may produce nonportable binaries], +[ + if test "$enableval" = "yes"; then + enable_nonportable_atomics=1 + fi +]) config_subdirs="none" INSTALL_SUBDIRS="none" @@ -370,7 +372,7 @@ case $host in *sparc*) OSDIR="solaris_sparc" eolstr="\\n" - if test "$user_disabled_optimized_atomics" = 0; then + if test "$enable_nonportable_atomics" = 1; then apr_atomic_sparc_compile=apr_atomic_sparc.lo sparc_arch=`uname -m` is_gnu_as=`${AS} --help 2>/dev/null | grep gnu.org` From 3ad797ab202310dacc900d0320a3f3a8ffba0a98 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 15 Jun 2002 04:41:52 +0000 Subject: [PATCH 3492/7878] Allow 'make install DESTDIR=/path'. This allows packagers to install into a directory different from the one that was configured. This also mirrors the root= feature from 1.3. We cannot use prefix=, because both APR and APR-util resolve their installation paths at configuration time. This means that there is no variable prefix to replace. PR: 7803 Submitted by: Andreas Hasenack git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63503 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Makefile.in b/Makefile.in index df7ea01eaf3..40af0f38083 100644 --- a/Makefile.in +++ b/Makefile.in @@ -59,37 +59,37 @@ delete-lib: fi install: $(TARGET_LIB) - if [ ! -d $(includedir) ]; then \ - $(top_srcdir)/build/mkdir.sh $(includedir); \ + if [ ! -d $(DESTDIR)$(includedir) ]; then \ + $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(includedir); \ fi; - cp -p $(top_srcdir)/include/*.h $(includedir); + cp -p $(top_srcdir)/include/*.h $(DESTDIR)$(includedir); if test -n "$(top_blddir)"; then \ - cp -p $(top_blddir)/include/*.h $(includedir); \ + cp -p $(top_blddir)/include/*.h $(DESTDIR)$(includedir); \ fi; - if [ ! -d $(libdir) ]; then \ - $(top_srcdir)/build/mkdir.sh $(libdir); \ + if [ ! -d $(DESTDIR)$(libdir) ]; then \ + $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(libdir); \ fi; - $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(libdir) - $(LIBTOOL) --mode=install cp APRVARS $(libdir) - $(LIBTOOL) --mode=install cp apr.exp $(libdir) - if [ ! -d $(installbuilddir) ]; then \ - $(top_srcdir)/build/mkdir.sh $(installbuilddir); \ + $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(DESTDIR)$(libdir) + $(LIBTOOL) --mode=install cp APRVARS $(DESTDIR)$(libdir) + $(LIBTOOL) --mode=install cp apr.exp $(DESTDIR)$(libdir) + if [ ! -d $(DESTDIR)$(installbuilddir) ]; then \ + $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(installbuilddir); \ fi; if [ -f libtool ]; then \ - $(LIBTOOL) --mode=install cp libtool $(installbuilddir); \ + $(LIBTOOL) --mode=install cp libtool $(DESTDIR)$(installbuilddir); \ fi; if [ -f shlibtool ]; then \ - $(LIBTOOL) --mode=install cp shlibtool $(installbuilddir); \ + $(LIBTOOL) --mode=install cp shlibtool $(DESTDIR)$(installbuilddir); \ fi; - if [ ! -d $(bindir) ]; then \ - $(top_srcdir)/build/mkdir.sh $(bindir); \ + if [ ! -d $(DESTDIR)$(bindir) ]; then \ + $(top_srcdir)/build/mkdir.sh $(DESTDIR)$(bindir); \ fi; - $(LIBTOOL) --mode=install cp apr-config $(bindir) - chmod 755 $(bindir)/apr-config + $(LIBTOOL) --mode=install cp apr-config $(DESTDIR)$(bindir) + chmod 755 $(DESTDIR)$(bindir)/apr-config @if [ $(INSTALL_SUBDIRS) != "none" ]; then \ for i in $(INSTALL_SUBDIRS); do \ - ( cd $$i ; $(MAKE) install ); \ + ( cd $$i ; $(MAKE) root=$(DESTDIR) install ); \ done \ fi From 2983c1c9a5a9c2abd51ed988975954dc6f3aaab5 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 15 Jun 2002 06:00:15 +0000 Subject: [PATCH 3493/7878] Fix a couple of typos in some Makefiles. Submitted by: Cliff Woolley git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63504 13f79535-47bb-0310-9956-ffa450edef68 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 40af0f38083..10d4a53f772 100644 --- a/Makefile.in +++ b/Makefile.in @@ -89,7 +89,7 @@ install: $(TARGET_LIB) chmod 755 $(DESTDIR)$(bindir)/apr-config @if [ $(INSTALL_SUBDIRS) != "none" ]; then \ for i in $(INSTALL_SUBDIRS); do \ - ( cd $$i ; $(MAKE) root=$(DESTDIR) install ); \ + ( cd $$i ; $(MAKE) DESTDIR=$(DESTDIR) install ); \ done \ fi From 1da5368c329b4377b9e97ed875edbb534d8ed974 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 19 Jun 2002 19:51:04 +0000 Subject: [PATCH 3494/7878] Fix apr_file_seek() to unset the eof_hit flag. Submitted by: Stas Bekman Concept reviewed by: jwoolley, rbb, wrowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63507 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ file_io/os2/seek.c | 2 ++ file_io/unix/seek.c | 1 + file_io/win32/seek.c | 2 ++ 4 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index 131f8f36b2c..676517d5492 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Fixed apr_file_seek() to unset the eof_hit flag. [Stas Bekman] + *) Removed --disable-atomics flag and added --enable-nonportable-atomics, thereby defaulting to portable binaries on those systems that could be optimized at the expense of portability. PR: 9507 [Aaron Bannert] diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index 670eb0729cd..e0a1329e6e2 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -91,6 +91,8 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh return APR_EBADF; } + thefile->eof_hit = 0; + if (thefile->buffered) { int rc = EINVAL; apr_finfo_t finfo; diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index a74cd55d7f2..c3fe918b891 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -90,6 +90,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh { apr_off_t rv; + thefile->eof_hit = 0; if (thefile->buffered) { int rc = EINVAL; diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 2ebbc16e7ba..4388c38c560 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -96,6 +96,8 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh apr_finfo_t finfo; apr_status_t rc = APR_SUCCESS; + thefile->eof_hit = 0; + if (thefile->buffered) { switch (where) { case APR_SET: From 186f2a9bbd9e9dec82665cb1cde562f52e416c43 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Wed, 19 Jun 2002 20:06:58 +0000 Subject: [PATCH 3495/7878] Store CC in the config.nice too. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63508 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_common.m4 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 5be8b9eb867..d351e4ab6f1 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -14,6 +14,9 @@ AC_DEFUN(APR_CONFIG_NICE,[ # Created by configure EOF + if test -n "$CC"; then + echo "CC=\"$CC\"; export CC" >> $1 + fi if test -n "$CFLAGS"; then echo "CFLAGS=\"$CFLAGS\"; export CFLAGS" >> $1 fi From 1de759f9d8086cafc098732b1f2668eb76339e68 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 21 Jun 2002 11:33:55 +0000 Subject: [PATCH 3496/7878] Fix a compile error in the EGD support in rand.c on older Solaris versions. PR: 9976 Submitted by: Jim Morris Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63509 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ misc/unix/rand.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 676517d5492..3405cf476e0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Fix a compile error in the EGD support in rand.c on older Solaris + versions. PR 9976 [Jim Morris ] + *) Fixed apr_file_seek() to unset the eof_hit flag. [Stas Bekman] *) Removed --disable-atomics flag and added --enable-nonportable-atomics, diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 554ae8b3ca1..519d8f588ed 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -121,7 +121,7 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, */ int egd_socket, egd_path_len, rv; struct sockaddr_un addr; - socklen_t egd_addr_len; + apr_socklen_t egd_addr_len; size_t resp_expected; unsigned char req[2], resp[255]; char *curbuf = buf; From f7715710e7d5926cb7594e70cc0f92470ed2ba06 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 21 Jun 2002 14:24:25 +0000 Subject: [PATCH 3497/7878] fix a typo in a comment git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63510 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index c789ba30456..6f05848670a 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -275,7 +275,7 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, * Add a key/value pair to a table, if another element already exists with the * same key, this will over-write the old data. * @param t The table to add the data to. - * @param key The key fo use + * @param key The key to use * @param val The value to add * @warning When adding data, this function does not make a copy of the key or * the value, so care should be taken to ensure that the values will From 982d52efde1dc7e61b6c60e03b187109d31e9bda Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 21 Jun 2002 16:36:24 +0000 Subject: [PATCH 3498/7878] improve error reporting git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63511 13f79535-47bb-0310-9956-ffa450edef68 --- test/testrand.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/testrand.c b/test/testrand.c index 19bb16ea7e5..f57c9b3123b 100644 --- a/test/testrand.c +++ b/test/testrand.c @@ -81,9 +81,13 @@ int main(void) printf("%-5d %-55s", i * 255, "bytes"); rv = apr_generate_random_bytes(c, i * 255); if (rv != APR_SUCCESS) { - printf("Failed: %d\n", rv); + char msgbuf[120]; + + printf("Failed: %d %s\n", rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); + } + else { + printf("OK\n"); } - printf("OK\n"); } return 0; From eda2ef77fca0c0394c585ea869d1ea09402e4fc3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 21 Jun 2002 16:43:07 +0000 Subject: [PATCH 3499/7878] report the right error code after I/O with the EGD fails git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63512 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/rand.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 519d8f588ed..0c5acc5e521 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -141,8 +141,7 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, egd_socket = socket(PF_UNIX, SOCK_STREAM, 0); if (egd_socket == -1) { - /* Does socket set errno? */ - return APR_EGENERAL; + return errno; } rv = connect(egd_socket, (struct sockaddr*)&addr, egd_addr_len); @@ -159,9 +158,11 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, srv = write(egd_socket, req, 2); if (srv == -1) { + int bad_errno = errno; + shutdown(egd_socket, SHUT_RDWR); close(egd_socket); - return errno; + return bad_errno; } if (srv != 2) { @@ -173,9 +174,11 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, resp_expected = req[1]; srv = read(egd_socket, resp, resp_expected); if (srv == -1) { + int bad_errno = errno; + shutdown(egd_socket, SHUT_RDWR); close(egd_socket); - return errno; + return bad_errno; } memcpy(curbuf, resp, srv); From 978cf88d18a9bf4183ce333e35f82e1769f93377 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 22 Jun 2002 07:28:02 +0000 Subject: [PATCH 3500/7878] Fixed the check for --enable-nonportable-atomics The generated configure script contains an auto-generated variable called enable_nonportable_atomics that holds the argument value, so the "enable_nonportable_atomics=0" initialization was overwriting it git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63513 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index b21d1a2400f..75ea579ebf4 100644 --- a/configure.in +++ b/configure.in @@ -307,13 +307,13 @@ dnl we are using for the more up to date cpu/OS dnl (ie.. old sparcs) apr_force_atomic_generic=0 proc_mutex_is_global=0 -enable_nonportable_atomics=0 +nonportable_atomics_enabled=0 AC_ARG_ENABLE(nonportable-atomics, [ --enable-nonportable-atomics Turn on optimized atomic code which may produce nonportable binaries], [ if test "$enableval" = "yes"; then - enable_nonportable_atomics=1 + nonportable_atomics_enabled=1 fi ]) @@ -372,7 +372,7 @@ case $host in *sparc*) OSDIR="solaris_sparc" eolstr="\\n" - if test "$enable_nonportable_atomics" = 1; then + if test "$nonportable_atomics_enabled" = 1; then apr_atomic_sparc_compile=apr_atomic_sparc.lo sparc_arch=`uname -m` is_gnu_as=`${AS} --help 2>/dev/null | grep gnu.org` From afa14a9748375e85463a3e4a47873d9982d84fdd Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 22 Jun 2002 08:06:48 +0000 Subject: [PATCH 3501/7878] Optimized atomic CAS support for Linux/x86 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63514 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ configure.in | 10 ++++++++++ include/apr_atomic.h | 15 +++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/CHANGES b/CHANGES index 3405cf476e0..c5c141d8356 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Added optimized atomic CAS support for Linux/x86 (available only + when APR is configured with --enable-nonportable-atomics=yes) + [Brian Pane] + *) Fix a compile error in the EGD support in rand.c on older Solaris versions. PR 9976 [Jim Morris ] diff --git a/configure.in b/configure.in index 75ea579ebf4..6abbd8a1328 100644 --- a/configure.in +++ b/configure.in @@ -407,6 +407,16 @@ case $host in ;; esac ;; + *linux*) + apr_force_atomic_generic=1 + case $host_cpu in + i486|i586|i686) + if test "$nonportable_atomics_enabled" = 1; then + apr_force_atomic_generic=0 + fi + ;; + esac + ;; *) OSDIR="unix" eolstr="\\n" diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 09d042c6936..f4b80b93fa7 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -180,6 +180,21 @@ APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); #define APR_ATOMIC_NEED_CAS_DEFAULT 1 +#elif defined(__linux__) && defined(__i386__) +#define apr_atomic_t apr_uint32_t +#define apr_atomic_cas(mem,with,cmp) \ +({ apr_atomic_t prev; \ + asm ("lock; cmpxchgl %1, %2" \ + : "=a" (prev) \ + : "r" (with), "m" (*(mem)), "0"(cmp) \ + : "memory"); \ + prev;}) + +#define APR_ATOMIC_NEED_DEFAULT 1 +#if defined(APR_ATOMIC_NEED_CAS_DEFAULT) +#undef APR_ATOMIC_NEED_CAS_DEFAULT +#endif + #elif defined(__sparc__) || defined(sparc) #define apr_atomic_t apr_uint32_t #define apr_atomic_read(p) *p From a41eede219e43cb6ea83b215e089a3bfd7e91e1e Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 23 Jun 2002 06:19:34 +0000 Subject: [PATCH 3502/7878] Use apr_ischar() ... especially within apr itself! git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63515 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/misc.c | 5 +++-- test/testnames.c | 4 ++-- threadproc/win32/proc.c | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/misc/win32/misc.c b/misc/win32/misc.c index a60907a55f1..39a8b5d7d0d 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -57,6 +57,7 @@ #include "crtdbg.h" #include "fileio.h" #include "assert.h" +#include "apr_lib.h" apr_oslevel_e apr_os_level = APR_WIN_UNK; @@ -73,7 +74,7 @@ apr_status_t apr_get_oslevel(apr_pool_t *cont, apr_oslevel_e *level) static unsigned int servpack = 0; char *pservpack; if (pservpack = oslev.szCSDVersion) { - while (*pservpack && !isdigit(*pservpack)) { + while (*pservpack && !apr_isdigit(*pservpack)) { pservpack++; } if (*pservpack) @@ -129,7 +130,7 @@ apr_status_t apr_get_oslevel(apr_pool_t *cont, apr_oslevel_e *level) else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { char *prevision; if (prevision = oslev.szCSDVersion) { - while (*prevision && !isupper(*prevision)) { + while (*prevision && !apr_isupper(*prevision)) { prevision++; } } diff --git a/test/testnames.c b/test/testnames.c index 1740c42baeb..23f8ef929db 100644 --- a/test/testnames.c +++ b/test/testnames.c @@ -128,13 +128,13 @@ int main(void) if (!fgets(rootpath, 256, stdin)) exit(0); for (eos = strchr(rootpath, '\0'); --eos >= rootpath; ) - if (isspace(*eos)) + if (apr_isspace(*eos)) *eos = '\0'; fprintf(stdout, "Enter an add path$ "); if (!fgets(addpath, 256, stdin)) exit(0); for (eos = strchr(addpath, '\0'); --eos >= addpath; ) - if (isspace(*eos)) + if (apr_isspace(*eos)) *eos = '\0'; merge_result(rootpath, addpath, 0); merge_result(rootpath, addpath, APR_FILEPATH_NOTABOVEROOT); diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index ccc3be8a4bc..895da48a2e4 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -60,6 +60,7 @@ #include "apr_general.h" #include "apr_strings.h" #include "apr_portable.h" +#include "apr_lib.h" #include #if APR_HAVE_SIGNAL_H #include @@ -312,7 +313,7 @@ static const char* has_space(const char *str) { const char *ch; for (ch = str; *ch; ++ch) { - if (isspace(*ch)) { + if (apr_isspace(*ch)) { return ch; } } From 88f5e556bdd81bc6942df6716e484c3f19664ef0 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 23 Jun 2002 07:59:52 +0000 Subject: [PATCH 3503/7878] Fix setting of APR_EOL_STR for Linux (it wasn't getting set in configure.in due to yesterday's changes for x86 atomics) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63516 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index 6abbd8a1328..4fb3421728d 100644 --- a/configure.in +++ b/configure.in @@ -416,6 +416,8 @@ case $host in fi ;; esac + OSDIR="unix" + eolstr="\\n" ;; *) OSDIR="unix" From d49f2829010dd87a7d9b43a26996b890d2088670 Mon Sep 17 00:00:00 2001 From: Thom May Date: Sun, 23 Jun 2002 21:31:48 +0000 Subject: [PATCH 3504/7878] The Style Police come a knocking. No functional changes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63517 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/dir.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 5f6779dab78..8160a02be7b 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -106,7 +106,8 @@ static char *path_remove_last_component (const char *path, apr_pool_t *pool) return apr_pstrndup (pool, path, (i < 0) ? 0 : i); } -apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *pool) +apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, + apr_pool_t *pool) { /* On some platforms (e.g., Linux+GNU libc), d_name[] in struct * dirent is declared with enough storage for the name. On other @@ -129,7 +130,7 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *pool } else { apr_pool_cleanup_register((*new)->pool, (void *)(*new), dir_cleanup, - apr_pool_cleanup_null); + apr_pool_cleanup_null); return APR_SUCCESS; } } @@ -225,7 +226,8 @@ apr_status_t apr_dir_rewind(apr_dir_t *thedir) return APR_SUCCESS; } -apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *pool) +apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, + apr_pool_t *pool) { mode_t mode = apr_unix_perms2mode(perm); From 030b081fcc6291a9d0fa44c9dba65b846d5bb809 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Jun 2002 02:00:22 +0000 Subject: [PATCH 3505/7878] Aught to not nest extern "C" {} blocks, although this wasn't the bug I thought I discovered. It's still better form. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63518 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_pools.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/apr_pools.h b/include/apr_pools.h index fd6d82c7c8d..febdecb58dc 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -55,11 +55,16 @@ #ifndef APR_POOLS_H #define APR_POOLS_H +#include "apr.h" +#include "apr_errno.h" +#include "apr_general.h" /* for APR_STRINGIFY */ +#define APR_WANT_MEMFUNC +#include "apr_want.h" + #ifdef __cplusplus extern "C" { #endif - /** * @file apr_pools.h * @brief APR memory allocation @@ -81,11 +86,6 @@ extern "C" { * @ingroup APR * @{ */ -#include "apr.h" -#include "apr_errno.h" -#include "apr_general.h" /* for APR_STRINGIFY */ -#define APR_WANT_MEMFUNC -#include "apr_want.h" /** The fundamental pool type */ typedef struct apr_pool_t apr_pool_t; From 5cda95005493c975f44cc457b86d5c9e61f2835c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Jun 2002 02:07:28 +0000 Subject: [PATCH 3506/7878] Already exported on unix, we need this exported to write WinNT accessors for objects such as services and the registry that have no apr-izable concept for any other platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63519 13f79535-47bb-0310-9956-ffa450edef68 --- i18n/unix/utf8_ucs2.c | 12 ++++++++---- include/arch/unix/i18n.h | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/i18n/unix/utf8_ucs2.c b/i18n/unix/utf8_ucs2.c index 568da5a6dc5..3b9a5ec466b 100644 --- a/i18n/unix/utf8_ucs2.c +++ b/i18n/unix/utf8_ucs2.c @@ -98,8 +98,10 @@ * apr_conv_ucs2_to_utf8 out words:sizeof(in) / 2 <= Req <= sizeof(in) * 3 / 2 */ -apr_status_t apr_conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, - apr_wchar_t *out, apr_size_t *outwords) +APR_DECLARE(apr_status_t) apr_conv_utf8_to_ucs2(const char *in, + apr_size_t *inbytes, + apr_wchar_t *out, + apr_size_t *outwords) { apr_int64_t newch, mask; apr_size_t expect, eating; @@ -207,8 +209,10 @@ apr_status_t apr_conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, return APR_SUCCESS; } -apr_status_t apr_conv_ucs2_to_utf8(const apr_wchar_t *in, apr_size_t *inwords, - char *out, apr_size_t *outbytes) +APR_DECLARE(apr_status_t) apr_conv_ucs2_to_utf8(const apr_wchar_t *in, + apr_size_t *inwords, + char *out, + apr_size_t *outbytes) { apr_int64_t newch, require; apr_size_t need; diff --git a/include/arch/unix/i18n.h b/include/arch/unix/i18n.h index 81820c7c5eb..5273e0095c1 100644 --- a/include/arch/unix/i18n.h +++ b/include/arch/unix/i18n.h @@ -71,8 +71,10 @@ typedef apr_uint16_t apr_wchar_t; * when the character code is invalid (in or out of context) and the later * when more characters were expected, but insufficient characters remain. */ -apr_status_t apr_conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, - apr_wchar_t *out, apr_size_t *outwords); +APR_DECLARE(apr_status_t) apr_conv_utf8_to_ucs2(const char *in, + apr_size_t *inbytes, + apr_wchar_t *out, + apr_size_t *outwords); /** * An APR internal function for fast ucs-2 wide Unicode format conversion to @@ -83,7 +85,9 @@ apr_status_t apr_conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, * when the character code is invalid (in or out of context) and the later * when more words were expected, but insufficient words remain. */ -apr_status_t apr_conv_ucs2_to_utf8(const apr_wchar_t *in, apr_size_t *inwords, - char *out, apr_size_t *outbytes); +APR_DECLARE(apr_status_t) apr_conv_ucs2_to_utf8(const apr_wchar_t *in, + apr_size_t *inwords, + char *out, + apr_size_t *outbytes); #endif /* def I18N_H */ From 3a9c544fb61365bcf88696b7c9fe37bef005a3b1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 24 Jun 2002 02:13:44 +0000 Subject: [PATCH 3507/7878] Permit us to use very Win32 specific i18n macros and extensions so that registry, services and so forth can share well tested code. They are still not for general consumption, only for writing apr-like wrappers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63520 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/fileio.h | 2 +- include/arch/win32/misc.h | 2 +- misc/win32/misc.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 2cf398995b5..b0bb3acd072 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -86,7 +86,7 @@ #endif #if APR_HAS_UNICODE_FS -#include "i18n.h" +#include "arch/unix/i18n.h" #include typedef apr_uint16_t apr_wchar_t; diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 072dad16b57..68e636afd89 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -141,7 +141,7 @@ typedef enum { APR_WIN_XP = 60 } apr_oslevel_e; -extern apr_oslevel_e apr_os_level; +extern APR_DECLARE_DATA apr_oslevel_e apr_os_level; apr_status_t apr_get_oslevel(struct apr_pool_t *, apr_oslevel_e *); diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 39a8b5d7d0d..38a6f266205 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -59,7 +59,7 @@ #include "assert.h" #include "apr_lib.h" -apr_oslevel_e apr_os_level = APR_WIN_UNK; +APR_DECLARE_DATA apr_oslevel_e apr_os_level = APR_WIN_UNK; apr_status_t apr_get_oslevel(apr_pool_t *cont, apr_oslevel_e *level) { From 8e92c54a0da88ce8868ca68cd80d1858c28c133c Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Mon, 24 Jun 2002 07:01:19 +0000 Subject: [PATCH 3508/7878] Correct shared library support on Darwin to not fatally error out when a shared library does not exist. This does retain the Mach-O bundle and Mach-O dynamically linked shared library support on Darwin. Also improvements relating to testdso: - Get testdso to actually link. - Add support for a second DSO to load in testdso. - Build mod_test.slo and libmod_test.slo with and without the -module option. This checks that both types of dynamic libraries can be loaded. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63521 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ dso/unix/dso.c | 9 +++++++-- test/Makefile.in | 18 +++++++++++------ test/testdso.c | 51 ++++++++++++++++++++++++++++++++---------------- 4 files changed, 56 insertions(+), 25 deletions(-) diff --git a/CHANGES b/CHANGES index c5c141d8356..aec515a2670 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Correct shared library support on Darwin to not fatally error out + when a shared library does not exist. [Justin Erenkrantz] + *) Added optimized atomic CAS support for Linux/x86 (available only when APR is configured with --enable-nonportable-atomics=yes) [Brian Pane] diff --git a/dso/unix/dso.c b/dso/unix/dso.c index a6d3860e203..8f97b7555a4 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -124,8 +124,11 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, #elif defined(DSO_USE_DYLD) NSObjectFileImage image; NSModule os_handle = NULL; + NSObjectFileImageReturnCode dsoerr; char* err_msg = NULL; - if (NSCreateObjectFileImageFromFile(path, &image) == NSObjectFileImageSuccess) { + dsoerr = NSCreateObjectFileImageFromFile(path, &image); + + if (dsoerr == NSObjectFileImageSuccess) { #if defined(NSLINKMODULE_OPTION_RETURN_ON_ERROR) && defined(NSLINKMODULE_OPTION_NONE) os_handle = NSLinkModule(image, path, NSLINKMODULE_OPTION_RETURN_ON_ERROR | @@ -135,7 +138,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, #endif NSDestroyObjectFileImage(image); } - else if (NSAddLibrary(path) == TRUE) { + else if ((dsoerr == NSObjectFileImageFormat || + dsoerr == NSObjectFileImageInappropriateFile) && + NSAddLibrary(path) == TRUE) { os_handle = (NSModule)DYLD_LIBRARY_HANDLE; } else { diff --git a/test/Makefile.in b/test/Makefile.in index 1f0ff9151a3..5d670ded3ec 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -55,7 +55,7 @@ TARGETS = $(PROGRAMS) $(NONPORTABLE) LOCAL_LIBS=../libapr.la -CLEAN_TARGETS = testfile.tmp testdso@EXEEXT@ mod_test.so +CLEAN_TARGETS = testfile.tmp testdso@EXEEXT@ mod_test.slo INCDIR=../include INCLUDES=-I$(INCDIR) @@ -76,9 +76,8 @@ testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS) testfmt@EXEEXT@: testfmt.lo $(LOCAL_LIBS) $(LINK) testfmt.lo $(LOCAL_LIBS) $(ALL_LIBS) -### why the export-dynamic? -testdso@EXEEXT@: testdso.lo mod_test.so $(LOCAL_LIBS) - $(LINK) -export-dynamic testdso.lo $(LOCAL_LIBS) $(ALL_LIBS) +testdso@EXEEXT@: testdso.lo mod_test.la libmod_test.la $(LOCAL_LIBS) + $(LINK) testdso.lo $(LOCAL_LIBS) $(ALL_LIBS) testoc@EXEEXT@: testoc.lo occhild@EXEEXT@ $(LOCAL_LIBS) $(LINK) testoc.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -86,9 +85,16 @@ testoc@EXEEXT@: testoc.lo occhild@EXEEXT@ $(LOCAL_LIBS) occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS) $(LINK) occhild.lo $(LOCAL_LIBS) $(ALL_LIBS) -mod_test.so: mod_test.lo $(LOCAL_LIBS) - $(LINK) -shared mod_test.o $(LOCAL_LIBS) $(ALL_LIBS) +# FIXME: -prefer-pic is only supported with libtool-1.4+ +mod_test.slo: mod_test.c + $(LIBTOOL) --mode=compile $(COMPILE) -prefer-pic -c $< && touch $@ +mod_test.la: mod_test.slo $(LOCAL_LIBS) + $(LINK) --mode=link $(COMPILE) -rpath $(shell pwd) -avoid-version -module mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ + +libmod_test.la: mod_test.slo $(LOCAL_LIBS) + $(LINK) --mode=link $(COMPILE) -rpath $(shell pwd) -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ + testargs@EXEEXT@: testargs.lo $(LOCAL_LIBS) $(LINK) testargs.lo $(LOCAL_LIBS) $(ALL_LIBS) diff --git a/test/testdso.c b/test/testdso.c index 4231dcb0436..512f7298e49 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -65,22 +65,27 @@ #endif #ifdef NETWARE -#define LIB_NAME "mod_test.nlm" +# define LIB_NAME "mod_test.nlm" #else -# ifndef BEOS -# define LIB_NAME ".libs/mod_test.so" -# else +# ifdef BEOS # define LIB_NAME "mod_test.so" +# else +# ifdef DARWIN +# define LIB_NAME ".libs/mod_test.so" +# define LIB_NAME2 ".libs/libmod_test.dylib" +# else +# define LIB_NAME ".libs/mod_test.so" +# define LIB_NAME2 ".libs/libmod_test.so" +# endif # endif #endif -int main (int argc, char ** argv) +void test_shared_library(const char *libname, apr_pool_t *pool) { apr_dso_handle_t *h = NULL; apr_dso_handle_sym_t func1 = NULL; apr_dso_handle_sym_t func2 = NULL; apr_status_t status; - apr_pool_t *cont; void (*function)(void); void (*function1)(int); int *retval; @@ -88,19 +93,11 @@ int main (int argc, char ** argv) getcwd(filename, 256); strcat(filename, "/"); - strcat(filename, LIB_NAME); - - apr_initialize(); - atexit(apr_terminate); - - if (apr_pool_create(&cont, NULL) != APR_SUCCESS) { - fprintf(stderr, "Couldn't allocate context."); - exit(-1); - } + strcat(filename, libname); fprintf(stdout,"Trying to load DSO now....................."); fflush(stdout); - if ((status = apr_dso_load(&h, filename, cont)) != APR_SUCCESS){ + if ((status = apr_dso_load(&h, filename, pool)) != APR_SUCCESS){ char my_error[256]; apr_strerror(status, my_error, sizeof(my_error)); fprintf(stderr, "%s!\n", my_error); @@ -161,6 +158,26 @@ int main (int argc, char ** argv) exit (-1); } fprintf(stdout,"OK\n"); - +} + +int main (int argc, char ** argv) +{ + apr_pool_t *pool; + + apr_initialize(); + atexit(apr_terminate); + + if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { + fprintf(stderr, "Couldn't allocate context."); + exit(-1); + } + + fprintf(stdout,"=== Checking module library ===\n"); + test_shared_library(LIB_NAME, pool); +#ifdef LIB_NAME2 + fprintf(stdout,"=== Checking non-module library ===\n"); + test_shared_library(LIB_NAME2, pool); +#endif + return 0; } From 72e38fdc84c1ac50ef8554de29dc9918b4211e6b Mon Sep 17 00:00:00 2001 From: "Victor J. Orlikowski" Date: Tue, 25 Jun 2002 21:24:07 +0000 Subject: [PATCH 3509/7878] Type mismatch causes AIX build breakage....news at 11. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63522 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/rand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 0c5acc5e521..3cb9e7d204d 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -124,7 +124,7 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, apr_socklen_t egd_addr_len; size_t resp_expected; unsigned char req[2], resp[255]; - char *curbuf = buf; + unsigned char *curbuf = buf; egd_path_len = strlen(STR(EGD_DEFAULT_SOCKET)); From 8061a3f46107c6d410b2ad79593a79e971e3706c Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 26 Jun 2002 22:01:02 +0000 Subject: [PATCH 3510/7878] Removed the ReadWrite mutex that protects the stat cache table. Instead implemented separate stat cache tables per processor. This eliminates the lock contention that was occuring each time a cache node expired and had to be refreshed. Having a stat cache per processor may cause some data redundancy but ensures that no other thread will be refreshing a node at the same time a thread is reading it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63523 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 6 +-- file_io/netware/filestat.c | 81 +++++------------------------- include/arch/netware/apr_private.h | 4 +- misc/netware/aprlib.def | 1 + misc/netware/libprews.c | 23 ++++++--- 5 files changed, 34 insertions(+), 81 deletions(-) diff --git a/NWGNUmakefile b/NWGNUmakefile index aeb2cd5f686..63bd95915b2 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -220,10 +220,8 @@ FILE_nlm_copyright = FILES_nlm_Ximports = \ @libc.imp \ @ws2nlm.imp \ - @netware.imp \ - NXGetRandom \ - NXGetCtlInfo \ - NXSetCtlInfo \ + @netware.imp \ + CpuCurrentProcessor \ $(EOLIST) # diff --git a/file_io/netware/filestat.c b/file_io/netware/filestat.c index 4b3c0155826..8bffb5e02d5 100644 --- a/file_io/netware/filestat.c +++ b/file_io/netware/filestat.c @@ -59,13 +59,6 @@ #include "apr_strings.h" #include "apr_errno.h" #include "apr_hash.h" -#define USE_CSTAT_RWLOCK -#ifdef USE_CSTAT_MUTEX -#include "apr_thread_mutex.h" -#endif -#ifdef USE_CSTAT_RWLOCK -#include "apr_thread_rwlock.h" -#endif static apr_filetype_e filetype_from_mode(mode_t mode) { @@ -222,28 +215,11 @@ struct apr_stat_entry_t { apr_time_t expire; }; -typedef struct apr_stat_cache_t apr_stat_cache_t; - -struct apr_stat_cache_t { - apr_hash_t *statCache; -#ifdef USE_CSTAT_MUTEX - apr_thread_mutex_t *statcache_mutex; -#endif -#ifdef USE_CSTAT_RWLOCK - apr_thread_rwlock_t *statcache_mutex; -#endif -}; +extern apr_int32_t CpuCurrentProcessor; /* system variable */ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *pool) { - apr_stat_cache_t *statCacheData = (apr_stat_cache_t *)getStatCache(); - apr_hash_t *statCache = NULL; -#ifdef USE_CSTAT_MUTEX - apr_thread_mutex_t *statcache_mutex; -#endif -#ifdef USE_CSTAT_RWLOCK - apr_thread_rwlock_t *statcache_mutex; -#endif + apr_hash_t *statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor); apr_pool_t *gPool = (apr_pool_t *)getGlobalPool(); apr_stat_entry_t *stat_entry; struct stat *info; @@ -263,46 +239,18 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo return ret; } - /* If we have a statCacheData structure then use it. + /* If we have a statCache hash table then use it. Otherwise we need to create it and initialized it with a new mutex lock. */ - if (statCacheData) { - statCache = statCacheData->statCache; -#if defined(USE_CSTAT_MUTEX) || defined(USE_CSTAT_RWLOCK) - statcache_mutex = statCacheData->statcache_mutex; -#endif - } - else { - statCacheData = (apr_stat_cache_t *)apr_palloc (gPool, sizeof(apr_stat_cache_t)); + if (!statCache) { statCache = apr_hash_make(gPool); -#ifdef USE_CSTAT_MUTEX - apr_thread_mutex_create(&statcache_mutex, APR_THREAD_MUTEX_DEFAULT, gPool); - statCacheData->statcache_mutex = statcache_mutex; -#endif -#ifdef USE_CSTAT_RWLOCK - apr_thread_rwlock_create(&statcache_mutex, gPool); - statCacheData->statcache_mutex = statcache_mutex; -#endif - statCacheData->statCache = statCache; - setStatCache((void*)statCacheData); + setStatCache((void*)statCache, CpuCurrentProcessor); } /* If we have a statCache then try to pull the information from the cache. Otherwise just stat the file and return.*/ if (statCache) { -#ifdef USE_CSTAT_MUTEX - apr_thread_mutex_lock(statcache_mutex); -#endif -#ifdef USE_CSTAT_RWLOCK - apr_thread_rwlock_rdlock(statcache_mutex); -#endif stat_entry = (apr_stat_entry_t*) apr_hash_get(statCache, path, APR_HASH_KEY_STRING); -#ifdef USE_CSTAT_MUTEX - apr_thread_mutex_unlock(statcache_mutex); -#endif -#ifdef USE_CSTAT_RWLOCK - apr_thread_rwlock_unlock(statcache_mutex); -#endif /* If we got an entry then check the expiration time. If the entry hasn't expired yet then copy the information and return. */ if (stat_entry) { @@ -316,16 +264,16 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo } } + /* Since we are creating a separate stat cache for each processor, we + don't need to worry about locking the hash table before manipulating + it. */ if (!found) { + /* Bind the thread to the current cpu so that we don't wake + up on some other cpu and try to manipulate the wrong cache. */ + NXThreadBind (CpuCurrentProcessor); ret = stat(path, buf); if (ret == 0) { *casedName = case_filename(pool, path); -#ifdef USE_CSTAT_MUTEX - apr_thread_mutex_lock(statcache_mutex); -#endif -#ifdef USE_CSTAT_RWLOCK - apr_thread_rwlock_wrlock(statcache_mutex); -#endif /* If we don't have a stat_entry then create one, copy the data and add it to the hash table. */ if (!stat_entry) { @@ -349,12 +297,7 @@ int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *poo } stat_entry->expire = now; } -#ifdef USE_CSTAT_MUTEX - apr_thread_mutex_unlock(statcache_mutex); -#endif -#ifdef USE_CSTAT_RWLOCK - apr_thread_rwlock_unlock(statcache_mutex); -#endif + NXThreadBind (NX_THR_UNBOUND); } else return ret; diff --git a/include/arch/netware/apr_private.h b/include/arch/netware/apr_private.h index da6916313dd..29d396178b9 100644 --- a/include/arch/netware/apr_private.h +++ b/include/arch/netware/apr_private.h @@ -170,8 +170,8 @@ int unregister_NLM(void *NLMHandle); /* Application global data management */ int setGlobalPool(void *data); void* getGlobalPool(); -int setStatCache(void *data); -void* getStatCache(); +int setStatCache(void *data, int proc); +void* getStatCache(int proc); /* Redefine malloc to use the library malloc call so that all of the memory resources will be owned diff --git a/misc/netware/aprlib.def b/misc/netware/aprlib.def index 0a2a01eb8f3..973612427ba 100644 --- a/misc/netware/aprlib.def +++ b/misc/netware/aprlib.def @@ -1,3 +1,4 @@ MODULE LIBC.NLM MODULE WS2_32.NLM +IMPORT CpuCurrentProcessor EXPORT @aprlib.imp diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index fa17427fad3..8213636b858 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -15,10 +15,12 @@ #include "apr_pools.h" +#define MAX_PROCESSORS 128 + typedef struct app_data { int initialized; void* gPool; - void* statCache; + void* statCache[MAX_PROCESSORS]; } APP_DATA; /* library-private data...*/ @@ -174,26 +176,35 @@ void* getGlobalPool() return NULL; } -int setStatCache(void *data) +int setStatCache(void *data, int proc) { APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); + if ((proc < 0) || (proc > (MAX_PROCESSORS-1))) { + data = NULL; + return 0; + } + NXLock(gLibLock); - if (app_data && !app_data->statCache) { - app_data->statCache = data; + if (app_data && !app_data->statCache[proc]) { + app_data->statCache[proc] = data; } NXUnlock(gLibLock); return 1; } -void* getStatCache() +void* getStatCache(int proc) { APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); + if ((proc < 0) || (proc > (MAX_PROCESSORS-1))) { + return NULL; + } + if (app_data) { - return app_data->statCache; + return app_data->statCache[proc]; } return NULL; From 89ceee036d6247f87191787287b2655d881c51ca Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 27 Jun 2002 17:47:30 +0000 Subject: [PATCH 3511/7878] get APR closer to building on FreeBSD 4.6-STABLE git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63524 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + file_io/unix/dir.c | 3 +++ file_io/unix/fileacc.c | 3 +++ file_io/unix/filestat.c | 3 +++ include/apr.h.in | 1 + 5 files changed, 11 insertions(+) diff --git a/configure.in b/configure.in index 4fb3421728d..ca9943734c4 100644 --- a/configure.in +++ b/configure.in @@ -979,6 +979,7 @@ AC_SUBST(stringsh) AC_SUBST(sys_sendfileh) AC_SUBST(sys_signalh) AC_SUBST(sys_socketh) +AC_SUBST(sys_stath) AC_SUBST(sys_typesh) AC_SUBST(sys_timeh) AC_SUBST(sys_uioh) diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index 8160a02be7b..fa5989328e0 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -58,6 +58,9 @@ #if APR_HAVE_SYS_SYSLIMITS_H #include #endif +#if APR_HAVE_SYS_STAT_H +#include +#endif #if APR_HAVE_LIMITS_H #include #endif diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 8b50488bf95..a065d2075cf 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -54,6 +54,9 @@ #include "apr_strings.h" #include "fileio.h" +#if APR_HAVE_SYS_STAT_H +#include +#endif /* A file to put ALL of the accessor functions for apr_file_t types. */ diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 1ca88bbb9ef..27ff7770ca0 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -57,6 +57,9 @@ #include "apr_general.h" #include "apr_strings.h" #include "apr_errno.h" +#if APR_HAVE_SYS_STAT_H +#include +#endif static apr_filetype_e filetype_from_mode(mode_t mode) { diff --git a/include/apr.h.in b/include/apr.h.in index 432f1cb7eee..d6a3ce13a95 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -56,6 +56,7 @@ #define APR_HAVE_SYS_SENDFILE_H @sys_sendfileh@ #define APR_HAVE_SYS_SIGNAL_H @sys_signalh@ #define APR_HAVE_SYS_SOCKET_H @sys_socketh@ +#define APR_HAVE_SYS_STAT_H @sys_stath@ #define APR_HAVE_SYS_SYSLIMITS_H @sys_syslimitsh@ #define APR_HAVE_SYS_TIME_H @sys_timeh@ #define APR_HAVE_SYS_TYPES_H @sys_typesh@ From 5fc20f74200bdb24e7ca6da2831e0ee9205f47fc Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Thu, 27 Jun 2002 18:25:24 +0000 Subject: [PATCH 3512/7878] FreeBSD 4.6-STABLE: fix a warning pipe.c: In function `apr_file_namedpipe_create': pipe.c:216: warning: implicit declaration of function `mkfifo' git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63525 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/pipe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 93745b75539..3c2304114f8 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -54,6 +54,9 @@ #include "fileio.h" #include "apr_strings.h" +#if APR_HAVE_SYS_STAT_H +#include +#endif /* Figure out how to get pipe block/nonblock on BeOS... * Basically, BONE7 changed things again so that ioctl didn't work, From 6378be3738e44e3e915bab72d9c6760b033ad716 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 28 Jun 2002 11:38:50 +0000 Subject: [PATCH 3513/7878] Fix the definition of union semun so that it is valid on systems where sizeof(long) != sizeof(int). This resolves a hang on HP-UX/Itanium. Submitted by: Madhusudan Mathihalli Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63526 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ include/arch/unix/proc_mutex.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index aec515a2670..94cc6dd0c7c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Fix the definition of union semun so that it is valid on systems + where sizeof(long) != sizeof(int). This resolves a hang on + HP-UX/Itanium. + [Madhusudan Mathihalli ] + *) Correct shared library support on Darwin to not fatally error out when a shared library does not exist. [Justin Erenkrantz] diff --git a/include/arch/unix/proc_mutex.h b/include/arch/unix/proc_mutex.h index d7760a73e73..580e1e3911e 100644 --- a/include/arch/unix/proc_mutex.h +++ b/include/arch/unix/proc_mutex.h @@ -142,7 +142,7 @@ extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_rwlock_metho #if !APR_HAVE_UNION_SEMUN && defined(APR_HAS_SYSVSEM_SERIALIZE) union semun { - long val; + int val; struct semid_ds *buf; unsigned short *array; }; From c03ec976c57a4af7e9fc76c89ffe27d82857d432 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Jun 2002 14:04:36 +0000 Subject: [PATCH 3514/7878] Introduce apr_table_do_callback_fn_t as a prototype declaration, and consistify all broken APR_DECLARE() prototypes that were, in fact, always handled as APR_DECLARE_NONSTD() by the MSVC compiler. Unfortunately, no emit is raised when the compiler ignores our APR_DECLARE() semantic. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63527 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 3 ++- file_io/unix/readwrite.c | 3 ++- file_io/win32/readwrite.c | 3 ++- include/apr_file_io.h | 3 ++- include/apr_tables.h | 18 ++++++++++++++++-- tables/apr_tables.c | 9 +++++---- 6 files changed, 29 insertions(+), 10 deletions(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 21492e47c92..faeee1bb34b 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -351,7 +351,8 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) -APR_DECLARE(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, + const char *format, ...) { int cc; va_list ap; diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 2dede525046..f97b8745ef9 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -393,7 +393,8 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) return rv; } -APR_DECLARE(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, + const char *format, ...) { apr_status_t cc; va_list ap; diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index fa29734e760..76b6ba3dd75 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -465,7 +465,8 @@ static int printf_flush(apr_vformatter_buff_t *vbuff) return -1; } -APR_DECLARE(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, + const char *format, ...) { int cc; va_list ap; diff --git a/include/apr_file_io.h b/include/apr_file_io.h index b1775b45919..63da4497e29 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -566,7 +566,8 @@ APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, * @param ... The values to substitute in the format string * @return The number of bytes written */ -APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, + const char *format, ...) __attribute__((format(printf,2,3))); /** diff --git a/include/apr_tables.h b/include/apr_tables.h index 6f05848670a..8d10e4933ac 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -349,6 +349,19 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); +/** + * Declaration prototype for the iterator callback function of apr_table_do() + * and apr_table_vdo(). + * @param rec The data passed as the first argument to apr_table_[v]do() + * @param key The key from this iteration of the table + * @param key The value from this iteration of the table + * @remark Iteration continues while this callback function returns non-zero. + * To export the callback function for apr_table_[v]do() it must be declared + * in the _NONSTD convention. + */ +typedef int (apr_table_do_callback_fn_t)(void *rec, const char *key, + const char *value); + /** * Iterate over a table running the provided function once for every * element in the table. If there is data passed in as a vararg, then the @@ -361,8 +374,9 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, * @param ... The vararg. If this is NULL, then all elements in the table are * run through the function, otherwise only those whose key matches * are run. + * @see apr_table_do_callback_fn_t */ -APR_DECLARE_NONSTD(void) apr_table_do(int (*comp)(void *, const char *, const char *), +APR_DECLARE_NONSTD(void) apr_table_do(apr_table_do_callback_fn_t *comp, void *rec, const apr_table_t *t, ...); /** @@ -378,7 +392,7 @@ APR_DECLARE_NONSTD(void) apr_table_do(int (*comp)(void *, const char *, const ch * table are run through the function, otherwise only those * whose key matches are run. */ -APR_DECLARE(void) apr_table_vdo(int (*comp)(void *, const char *, const char *), +APR_DECLARE(void) apr_table_vdo(apr_table_do_callback_fn_t *comp, void *rec, const apr_table_t *t, va_list); /** flag for overlap to use apr_table_setn */ diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 9ed11d9c8c2..b143deb3a42 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -695,16 +695,17 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, * * So to make mod_file_cache easier to maintain, it's a good thing */ -APR_DECLARE(void) apr_table_do(int (*comp) (void *, const char *, const char *), - void *rec, const apr_table_t *t, ...) +APR_DECLARE_NONSTD(void) apr_table_do(apr_table_do_callback_fn_t *comp, + void *rec, const apr_table_t *t, ...) { va_list vp; va_start(vp, t); apr_table_vdo(comp, rec, t, vp); va_end(vp); } -APR_DECLARE(void) apr_table_vdo(int (*comp) (void *, const char *, const char *), - void *rec, const apr_table_t *t, va_list vp) + +APR_DECLARE(void) apr_table_vdo(apr_table_do_callback_fn_t *comp, + void *rec, const apr_table_t *t, va_list vp) { char *argp; apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; From 7d67f9cb4ad998cc51914be7b50464260ba2e7fb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Jun 2002 21:05:14 +0000 Subject: [PATCH 3515/7878] Well it appears that binary compatibility is already broken. This axes it for Win32, but it's a transition that was necessary [at some point in the future.] The change is a noop on all other platforms. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63528 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_strings.h | 4 ++-- strings/apr_strings.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apr_strings.h b/include/apr_strings.h index 8cb1e98a292..c33b835479b 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -179,8 +179,8 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...); * @param nbytes (output) strlen of new string (pass in NULL to omit) * @return The new string */ -APR_DECLARE_NONSTD(char *) apr_pstrcatv(apr_pool_t *p, const struct iovec *vec, - apr_size_t nvec, apr_size_t *nbytes); +APR_DECLARE(char *) apr_pstrcatv(apr_pool_t *p, const struct iovec *vec, + apr_size_t nvec, apr_size_t *nbytes); /** * printf-style style printing routine. The data is output to a string diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 9d884fd6f8a..9c6af2f0d36 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -177,8 +177,8 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) return res; } -APR_DECLARE_NONSTD(char *) apr_pstrcatv(apr_pool_t *a, const struct iovec *vec, - apr_size_t nvec, apr_size_t *nbytes) +APR_DECLARE(char *) apr_pstrcatv(apr_pool_t *a, const struct iovec *vec, + apr_size_t nvec, apr_size_t *nbytes) { apr_size_t i; apr_size_t len; From 8995b297d2e49f14ff329093fdb7d74810d9be19 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 28 Jun 2002 21:58:55 +0000 Subject: [PATCH 3516/7878] Added a call for votes on how to address the apr_time_t 64-bit division performance problems. (I listed the proposed solutions that I'm aware of from the dev@apr list.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63529 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/STATUS b/STATUS index 553b427be63..cfd7609a0b9 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/05/31 00:07:40 $] +Last modified at [$Date: 2002/06/28 21:58:55 $] Release: @@ -58,6 +58,16 @@ RELEASE SHOWSTOPPERS: CURRENT VOTES: + * apr_time_t has proven to be a performance problem in some key + apps (like httpd-2.0) due to the need for 64-bit division to + retrieve the seconds "field." Alternatives that have been + discussed on dev@apr are: + 1) Keep the 64-bit int, but change it to use binary microseconds + +1: BrianP + 2) Add a separate data type (and supporting functions) for seconds only + 3) Replace it with a struct with separate fields for sec and usec + -0: BrianP + * For the atomics code to be efficient it depends on instructions in newer sparc models. Unfortunately this means that binaries optimized at build-time for these architectures will not work From ede112a69ed577e77a77d79b71abc099879c486f Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Fri, 28 Jun 2002 22:12:09 +0000 Subject: [PATCH 3517/7878] mho git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63530 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/STATUS b/STATUS index cfd7609a0b9..87b9d0c4105 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/06/28 21:58:55 $] +Last modified at [$Date: 2002/06/28 22:12:09 $] Release: @@ -62,11 +62,14 @@ CURRENT VOTES: apps (like httpd-2.0) due to the need for 64-bit division to retrieve the seconds "field." Alternatives that have been discussed on dev@apr are: - 1) Keep the 64-bit int, but change it to use binary microseconds - +1: BrianP + 1) Keep the 64-bit int, but change it to use binary microseconds + (renaming the function to get rid of apr_time_t vs time_t confusion, + and having macros to convert BUSEC to USEC and back if need be) + +1: BrianP, Cliff 2) Add a separate data type (and supporting functions) for seconds only + -0: Cliff 3) Replace it with a struct with separate fields for sec and usec - -0: BrianP + -0: BrianP, Cliff * For the atomics code to be efficient it depends on instructions in newer sparc models. Unfortunately this means that binaries From c790ee74f170b82bb1daa31f5d7b5163c88e52cf Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Fri, 28 Jun 2002 22:45:38 +0000 Subject: [PATCH 3518/7878] A compromise for now: changing the return type of apr_table_do() and apr_table_vdo() to return int instead of void so that the caller can know whether or not any of the iterations trigged an "early return". However, I've left the wacky old semantics of _vdo for a while. This solves my immediate need at least. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63531 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/apr_tables.h | 13 +++++++---- tables/apr_tables.c | 54 ++++++++++++++++++++++++++++++++++++++------ 3 files changed, 60 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index 94cc6dd0c7c..97f049dde0a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) apr_table_do() and apr_table_vdo() now return an int rather than + void to indicate whether or not any of its iterations returned 0. + [Cliff Woolley] + *) Fix the definition of union semun so that it is valid on systems where sizeof(long) != sizeof(int). This resolves a hang on HP-UX/Itanium. diff --git a/include/apr_tables.h b/include/apr_tables.h index 8d10e4933ac..669aa9a5fa9 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -374,10 +374,12 @@ typedef int (apr_table_do_callback_fn_t)(void *rec, const char *key, * @param ... The vararg. If this is NULL, then all elements in the table are * run through the function, otherwise only those whose key matches * are run. + * @return FALSE if one of the comp() iterations returned zero; TRUE if all + * iterations returned non-zero * @see apr_table_do_callback_fn_t */ -APR_DECLARE_NONSTD(void) apr_table_do(apr_table_do_callback_fn_t *comp, - void *rec, const apr_table_t *t, ...); +APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, + void *rec, const apr_table_t *t, ...); /** * Iterate over a table running the provided function once for every @@ -391,9 +393,12 @@ APR_DECLARE_NONSTD(void) apr_table_do(apr_table_do_callback_fn_t *comp, * @param vp The vararg table. If this is NULL, then all elements in the * table are run through the function, otherwise only those * whose key matches are run. + * @return FALSE if one of the comp() iterations returned zero; TRUE if all + * iterations returned non-zero + * @see apr_table_do_callback_fn_t */ -APR_DECLARE(void) apr_table_vdo(apr_table_do_callback_fn_t *comp, - void *rec, const apr_table_t *t, va_list); +APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, + void *rec, const apr_table_t *t, va_list); /** flag for overlap to use apr_table_setn */ #define APR_OVERLAP_TABLES_SET (0) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index b143deb3a42..ad050c89c6c 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -695,21 +695,56 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, * * So to make mod_file_cache easier to maintain, it's a good thing */ -APR_DECLARE_NONSTD(void) apr_table_do(apr_table_do_callback_fn_t *comp, - void *rec, const apr_table_t *t, ...) +APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, + void *rec, const apr_table_t *t, ...) { + int rv; + va_list vp; va_start(vp, t); - apr_table_vdo(comp, rec, t, vp); - va_end(vp); + rv = apr_table_vdo(comp, rec, t, vp); + va_end(vp); + + return rv; } -APR_DECLARE(void) apr_table_vdo(apr_table_do_callback_fn_t *comp, - void *rec, const apr_table_t *t, va_list vp) +/* XXX: do the semantics of this routine make any sense? Right now, + * if the caller passed in a non-empty va_list of keys to search for, + * the "early termination" facility only terminates on *that* key; other + * keys will continue to process. Note that this only has any effect + * at all if there are multiple entries in the table with the same key, + * otherwise the called function can never effectively early-terminate + * this function, as the zero return value is effectively ignored. + * + * Note also that this behavior is at odds with the behavior seen if an + * empty va_list is passed in -- in that case, a zero return value terminates + * the entire apr_table_vdo (which is what I think should happen in + * both cases). + * + * If nobody objects soon, I'm going to change the order of the nested + * loops in this function so that any zero return value from the (*comp) + * function will cause a full termination of apr_table_vdo. I'm hesitant + * at the moment because these (funky) semantics have been around for a + * very long time, and although Apache doesn't seem to use them at all, + * some third-party vendor might. I can only think of one possible reason + * the existing semantics would make any sense, and it's very Apache-centric, + * which is this: if (*comp) is looking for matches of a particular + * substring in request headers (let's say it's looking for a particular + * cookie name in the Set-Cookie headers), then maybe it wants to be + * able to stop searching early as soon as it finds that one and move + * on to the next key. That's only an optimization of course, but changing + * the behavior of this function would mean that any code that tried + * to do that would stop working right. + * + * Sigh. --JCW, 06/28/02 + */ +APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, + void *rec, const apr_table_t *t, va_list vp) { char *argp; apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; - int rv, i; + int vdorv = 1, rv, i; + argp = va_arg(vp, char *); do { apr_uint32_t checksum = 0; @@ -723,7 +758,12 @@ APR_DECLARE(void) apr_table_vdo(apr_table_do_callback_fn_t *comp, rv = (*comp) (rec, elts[i].key, elts[i].val); } } + if (rv == 0) { + vdorv = 0; + } } while (argp && ((argp = va_arg(vp, char *)) != NULL)); + + return vdorv; } /* During apr_table_overlap(), we build an overlap key for From 9abed9d8cbfd9710f75b9686bacae25421d26f58 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Fri, 28 Jun 2002 22:49:24 +0000 Subject: [PATCH 3519/7878] yikes, didn't even notice those tabs there. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63532 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index ad050c89c6c..f23f8630b97 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -751,16 +751,16 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, if (argp) { COMPUTE_KEY_CHECKSUM(argp, checksum); } - for (rv = 1, i = 0; rv && (i < t->a.nelts); ++i) { - if (elts[i].key && (!argp || + for (rv = 1, i = 0; rv && (i < t->a.nelts); ++i) { + if (elts[i].key && (!argp || ((checksum == elts[i].key_checksum) && !strcasecmp(elts[i].key, argp)))) { - rv = (*comp) (rec, elts[i].key, elts[i].val); - } - } - if (rv == 0) { - vdorv = 0; - } + rv = (*comp) (rec, elts[i].key, elts[i].val); + } + } + if (rv == 0) { + vdorv = 0; + } } while (argp && ((argp = va_arg(vp, char *)) != NULL)); return vdorv; From 818bbf7dfc5ab75916e57fb4739f61842062a52f Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Fri, 28 Jun 2002 22:59:42 +0000 Subject: [PATCH 3520/7878] *** empty log message *** git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63533 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/STATUS b/STATUS index 87b9d0c4105..31e70c4bf18 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/06/28 22:12:09 $] +Last modified at [$Date: 2002/06/28 22:59:42 $] Release: @@ -65,11 +65,11 @@ CURRENT VOTES: 1) Keep the 64-bit int, but change it to use binary microseconds (renaming the function to get rid of apr_time_t vs time_t confusion, and having macros to convert BUSEC to USEC and back if need be) - +1: BrianP, Cliff + +1: BrianP, Cliff, Brane 2) Add a separate data type (and supporting functions) for seconds only - -0: Cliff + -0: Cliff, Brane 3) Replace it with a struct with separate fields for sec and usec - -0: BrianP, Cliff + -0: BrianP, Cliff, Brane * For the atomics code to be efficient it depends on instructions in newer sparc models. Unfortunately this means that binaries From ad354e632b145d1d548de8535c36b07006a83c5d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 28 Jun 2002 23:04:11 +0000 Subject: [PATCH 3521/7878] My votes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63534 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/STATUS b/STATUS index 31e70c4bf18..c7ca139abb4 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/06/28 22:59:42 $] +Last modified at [$Date: 2002/06/28 23:04:11 $] Release: @@ -65,11 +65,11 @@ CURRENT VOTES: 1) Keep the 64-bit int, but change it to use binary microseconds (renaming the function to get rid of apr_time_t vs time_t confusion, and having macros to convert BUSEC to USEC and back if need be) - +1: BrianP, Cliff, Brane + +1: BrianP, Cliff, Brane, rbb 2) Add a separate data type (and supporting functions) for seconds only - -0: Cliff, Brane + -0: Cliff, Brane, rbb 3) Replace it with a struct with separate fields for sec and usec - -0: BrianP, Cliff, Brane + -0: BrianP, Cliff, Brane, rbb * For the atomics code to be efficient it depends on instructions in newer sparc models. Unfortunately this means that binaries From 2f63cada84cfb528958cab3221264ea647f6728c Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 28 Jun 2002 23:09:42 +0000 Subject: [PATCH 3522/7878] Casting... git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63535 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index c7ca139abb4..19dac36e28f 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/06/28 23:04:11 $] +Last modified at [$Date: 2002/06/28 23:09:42 $] Release: @@ -65,9 +65,9 @@ CURRENT VOTES: 1) Keep the 64-bit int, but change it to use binary microseconds (renaming the function to get rid of apr_time_t vs time_t confusion, and having macros to convert BUSEC to USEC and back if need be) - +1: BrianP, Cliff, Brane, rbb + +1: BrianP, Cliff, Brane, rbb, Jim 2) Add a separate data type (and supporting functions) for seconds only - -0: Cliff, Brane, rbb + -0: Cliff, Brane, rbb, Jim 3) Replace it with a struct with separate fields for sec and usec -0: BrianP, Cliff, Brane, rbb From ef924fca6884cd91b553ea01352ad8c1b8743cd6 Mon Sep 17 00:00:00 2001 From: Thom May Date: Fri, 28 Jun 2002 23:15:19 +0000 Subject: [PATCH 3523/7878] Add my vote git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63536 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/STATUS b/STATUS index 19dac36e28f..0d7f404c0b5 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE PORTABLE RUNTIME (APR) LIBRARY STATUS: -*-text-*- -Last modified at [$Date: 2002/06/28 23:09:42 $] +Last modified at [$Date: 2002/06/28 23:15:19 $] Release: @@ -65,11 +65,11 @@ CURRENT VOTES: 1) Keep the 64-bit int, but change it to use binary microseconds (renaming the function to get rid of apr_time_t vs time_t confusion, and having macros to convert BUSEC to USEC and back if need be) - +1: BrianP, Cliff, Brane, rbb, Jim + +1: BrianP, Cliff, Brane, rbb, Jim, Thom 2) Add a separate data type (and supporting functions) for seconds only -0: Cliff, Brane, rbb, Jim 3) Replace it with a struct with separate fields for sec and usec - -0: BrianP, Cliff, Brane, rbb + -0: BrianP, Cliff, Brane, rbb, Thom * For the atomics code to be efficient it depends on instructions in newer sparc models. Unfortunately this means that binaries From 98ba6f4960581218192d0dd798135f0edb0297ee Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 29 Jun 2002 07:39:12 +0000 Subject: [PATCH 3524/7878] Add autom4te.cache to cvsignore files. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63537 13f79535-47bb-0310-9956-ffa450edef68 --- .cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.cvsignore b/.cvsignore index d266087965e..28bd8376994 100644 --- a/.cvsignore +++ b/.cvsignore @@ -30,3 +30,4 @@ BuildLog.htm *.stt *.sto *.vcproj +autom4te.cache From 1498102d24f42bbfbc3e7ade4b9b43ac7427e5a1 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 29 Jun 2002 22:53:30 +0000 Subject: [PATCH 3525/7878] Fixed some comments to reference the right parameter names git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63538 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 63da4497e29..811da726263 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -439,7 +439,7 @@ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile); * @param new_file The structure to duplicate into. * @param old_file The file to duplicate. * @param p The pool to use for the new file. - * @remark *arg1 must point to a valid apr_file_t, or point to NULL + * @remark *new_file must point to a valid apr_file_t, or point to NULL */ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, @@ -451,7 +451,7 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, * @param old_file The file to duplicate * @param p The pool to use for the new file * - * @remark *arg1 MUST point at a valid apr_file_t. It cannot point at NULL + * @remark new_file MUST point at a valid apr_file_t. It cannot be NULL */ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, From 6cca1e9574e87ed2e26bdfc4642b8b31f0abec74 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 30 Jun 2002 04:04:42 +0000 Subject: [PATCH 3526/7878] Replaced APR_USEC_PER_SEC division with the new apr_time_sec() macro git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63539 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 4 +++- locks/unix/thread_cond.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index e50499be73f..a2d2fbcc442 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -86,6 +86,7 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, sem_t *psem; apr_status_t stat; char semname[14]; + apr_time_t now; unsigned long epoch; new_mutex->interproc = apr_palloc(new_mutex->pool, @@ -107,7 +108,8 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, * the sem_open and the sem_unlink. Use of O_EXCL does not * help here however... */ - epoch = apr_time_now() / APR_USEC_PER_SEC; + now = apr_time_now(); + epoch = apr_time_sec(now); apr_snprintf(semname, sizeof(semname), "/ApR.%lx", epoch); psem = sem_open((const char *) semname, O_CREAT, 0644, 1); diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c index d0ebe7c42d7..2b53ff8b505 100644 --- a/locks/unix/thread_cond.c +++ b/locks/unix/thread_cond.c @@ -133,8 +133,8 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, struct timespec abstime; then = apr_time_now() + timeout; - abstime.tv_sec = then / APR_USEC_PER_SEC; - abstime.tv_nsec = (then % APR_USEC_PER_SEC) * 1000; /* nanoseconds */ + abstime.tv_sec = apr_time_sec(then); + abstime.tv_nsec = apr_time_usec(then) * 1000; /* nanoseconds */ rv = pthread_cond_timedwait(cond->cond, &mutex->mutex, &abstime); #ifdef PTHREAD_SETS_ERRNO From 8d16486b95c85d362c7d841e52d9053dbce16d84 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 30 Jun 2002 08:14:49 +0000 Subject: [PATCH 3527/7878] Fix missing NULL terminator for arg list when generating the import library. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63540 13f79535-47bb-0310-9956-ffa450edef68 --- build/aplibtool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/build/aplibtool.c b/build/aplibtool.c index 7412a5671ea..357393e847e 100644 --- a/build/aplibtool.c +++ b/build/aplibtool.c @@ -716,6 +716,7 @@ void generate_def_file(cmd_data_t *cmd_data) export_args[num_export_args++] = implib_file; export_args[num_export_args++] = def_file; + export_args[num_export_args++] = NULL; spawnvp(P_WAIT, export_args[0], export_args); } } From 92e28e4fddaa852500020fd2b1f28c54ab621baa Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Mon, 1 Jul 2002 14:04:58 +0000 Subject: [PATCH 3528/7878] back out the changes to #include sys/stat.h . This is unneccessary as long as HAVE_SYS_STAT_H is defined correctly in apr_private.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63541 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 - file_io/unix/dir.c | 3 --- file_io/unix/fileacc.c | 3 --- file_io/unix/filestat.c | 3 --- file_io/unix/pipe.c | 3 --- include/apr.h.in | 1 - 6 files changed, 14 deletions(-) diff --git a/configure.in b/configure.in index ca9943734c4..dd7acd62c62 100644 --- a/configure.in +++ b/configure.in @@ -933,7 +933,6 @@ APR_FLAG_HEADERS( sys/sendfile.h \ sys/signal.h \ sys/socket.h \ - sys/stat.h \ sys/syslimits.h \ sys/time.h \ sys/types.h \ diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index fa5989328e0..8160a02be7b 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -58,9 +58,6 @@ #if APR_HAVE_SYS_SYSLIMITS_H #include #endif -#if APR_HAVE_SYS_STAT_H -#include -#endif #if APR_HAVE_LIMITS_H #include #endif diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index a065d2075cf..8b50488bf95 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -54,9 +54,6 @@ #include "apr_strings.h" #include "fileio.h" -#if APR_HAVE_SYS_STAT_H -#include -#endif /* A file to put ALL of the accessor functions for apr_file_t types. */ diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 27ff7770ca0..1ca88bbb9ef 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -57,9 +57,6 @@ #include "apr_general.h" #include "apr_strings.h" #include "apr_errno.h" -#if APR_HAVE_SYS_STAT_H -#include -#endif static apr_filetype_e filetype_from_mode(mode_t mode) { diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 3c2304114f8..93745b75539 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -54,9 +54,6 @@ #include "fileio.h" #include "apr_strings.h" -#if APR_HAVE_SYS_STAT_H -#include -#endif /* Figure out how to get pipe block/nonblock on BeOS... * Basically, BONE7 changed things again so that ioctl didn't work, diff --git a/include/apr.h.in b/include/apr.h.in index d6a3ce13a95..432f1cb7eee 100644 --- a/include/apr.h.in +++ b/include/apr.h.in @@ -56,7 +56,6 @@ #define APR_HAVE_SYS_SENDFILE_H @sys_sendfileh@ #define APR_HAVE_SYS_SIGNAL_H @sys_signalh@ #define APR_HAVE_SYS_SOCKET_H @sys_socketh@ -#define APR_HAVE_SYS_STAT_H @sys_stath@ #define APR_HAVE_SYS_SYSLIMITS_H @sys_syslimitsh@ #define APR_HAVE_SYS_TIME_H @sys_timeh@ #define APR_HAVE_SYS_TYPES_H @sys_typesh@ From 6a06cfdc0baff8d7160e0bc92886f137b337ada8 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Mon, 1 Jul 2002 14:50:46 +0000 Subject: [PATCH 3529/7878] ooops, backed out the wrong line. Oddly enough, it built for me on Linux. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63542 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index dd7acd62c62..06278802f60 100644 --- a/configure.in +++ b/configure.in @@ -933,6 +933,7 @@ APR_FLAG_HEADERS( sys/sendfile.h \ sys/signal.h \ sys/socket.h \ + sys/stat.h \ sys/syslimits.h \ sys/time.h \ sys/types.h \ @@ -978,7 +979,6 @@ AC_SUBST(stringsh) AC_SUBST(sys_sendfileh) AC_SUBST(sys_signalh) AC_SUBST(sys_socketh) -AC_SUBST(sys_stath) AC_SUBST(sys_typesh) AC_SUBST(sys_timeh) AC_SUBST(sys_uioh) From 17ec184ab9578db96a310b90ab95e7067671edcb Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 1 Jul 2002 16:44:10 +0000 Subject: [PATCH 3530/7878] Fix the userid functions on Irix to handle the way that Irix reports a failure from getpwnam_r(). PR: 10095 Submitted by: Robert I. Cowles , Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63543 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ user/unix/userinfo.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 97f049dde0a..9e6051a1c2d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with APR b1 + *) Fix the userid functions on Irix to handle the way that Irix + reports a failure from getpwnam_r(). PR 10095. + [Robert I. Cowles , Jeff Trawick] + *) apr_table_do() and apr_table_vdo() now return an int rather than void to indicate whether or not any of its iterations returned 0. [Cliff Woolley] diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 603e4fa6850..1455c8f5e6a 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -76,7 +76,8 @@ static apr_status_t getpwnam_safe(const char *username, { struct passwd *pwptr; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) - if (!getpwnam_r(username, pw, pwbuf, PWBUF_SIZE, &pwptr)) { + /* IRIX getpwnam_r() returns 0 and sets pwptr to NULL on failure */ + if (!getpwnam_r(username, pw, pwbuf, PWBUF_SIZE, &pwptr) && pwptr) { /* nothing extra to do on success */ #else if ((pwptr = getpwnam(username)) != NULL) { From 6e72b80bc109c1e31b4179ba150e266905d5991d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 1 Jul 2002 17:14:21 +0000 Subject: [PATCH 3531/7878] Unix, NW and OS2 folks, please look at this change and consider similar patches. It seems like extreme overkill to create a pipe when we are only setting up a log fd for output, and similar cases. We waste an entire pipe resource just to attach (pipe) to a logfile? That seems goofy. We now have both _dup and _dup2, so we should take advantage of them. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63544 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 137 ++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 81 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 895da48a2e4..02c93d40fdb 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -154,135 +154,110 @@ static apr_status_t make_handle_private(apr_file_t *file) #endif } -static apr_status_t make_inheritable_duplicate(apr_file_t *original, - apr_file_t *duplicate) -{ -#ifdef _WIN32_WCE - return APR_ENOTIMPL; -#else - if (original == NULL) - return APR_SUCCESS; - - /* XXX: Can't use apr_file_dup here because it creates a non-inhertible - * handle, and apr_open_file'd apr_file_t's are non-inheritable, - * so we must assume we need to make an inheritable handle. - */ - if (!CloseHandle(duplicate->filehand)) - return apr_get_os_error(); - else - { - HANDLE hproc = GetCurrentProcess(); - if (!DuplicateHandle(hproc, original->filehand, - hproc, &duplicate->filehand, 0, - TRUE, DUPLICATE_SAME_ACCESS)) - return apr_get_os_error(); - } - - return APR_SUCCESS; -#endif -} - APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) { - apr_status_t stat; + apr_status_t stat = APR_SUCCESS; if (in) { stat = open_nt_process_pipe(&attr->child_in, &attr->parent_in, in, attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_in); - if (stat != APR_SUCCESS) - return stat; } - if (out) { + if (out && stat == APR_SUCCESS) { stat = open_nt_process_pipe(&attr->parent_out, &attr->child_out, out, attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_out); - if (stat != APR_SUCCESS) - return stat; } - if (err) { + if (err && stat == APR_SUCCESS) { stat = open_nt_process_pipe(&attr->parent_err, &attr->child_err, err, attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_err); - if (stat != APR_SUCCESS) - return stat; } - return APR_SUCCESS; + return stat; } APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { - apr_status_t stat; + apr_status_t rv = APR_SUCCESS; - if (attr->child_in == NULL && attr->parent_in == NULL) { - stat = open_nt_process_pipe(&attr->child_in, &attr->parent_in, - APR_FULL_BLOCK, - attr->pool); - if (stat == APR_SUCCESS) - stat = make_handle_private(attr->parent_in); - if (stat != APR_SUCCESS) - return stat; + if (child_in) { + if (attr->child_in == NULL) + rv = apr_file_dup(&attr->child_in, child_in, attr_pool); + else + rv = apr_file_dup2(attr->child_in, child_in, attr_pool); + + if (rv == APR_SUCCESS) + rv = apr_file_inherit_set(attr->child_in); } - stat = make_inheritable_duplicate (child_in, attr->child_in); - if (stat == APR_SUCCESS) - stat = make_inheritable_duplicate (parent_in, attr->parent_in); + if (parent_in && rv == APR_SUCCESS) { + if (attr->parent_in == NULL) + rv = apr_file_dup(&attr->parent_in, parent_in, attr_pool); + else + rv = apr_file_dup2(attr->parent_in, parent_in, attr_pool); + } - return stat; + return rv; } APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) { - apr_status_t stat; + apr_status_t rv = APR_SUCCESS; - if (attr->child_out == NULL && attr->parent_out == NULL) { - stat = open_nt_process_pipe(&attr->child_out, &attr->parent_out, - APR_FULL_BLOCK, - attr->pool); - if (stat == APR_SUCCESS) - stat = make_handle_private(attr->parent_out); - if (stat != APR_SUCCESS) - return stat; - } - - stat = make_inheritable_duplicate (child_out, attr->child_out); - if (stat == APR_SUCCESS) - stat = make_inheritable_duplicate (parent_out, attr->parent_out); + if (child_out) { + if (attr->child_out == NULL) + rv = apr_file_dup(&attr->child_out, child_out, attr_pool); + else + rv = apr_file_dup2(attr->child_out, child_out, attr_pool); - return stat; + if (rv == APR_SUCCESS) + rv = apr_file_inherit_set(attr->child_out); + } + + if (parent_out && rv == APR_SUCCESS) { + if (attr->parent_out == NULL) + rv = apr_file_dup(&attr->parent_out, parent_out, attr_pool); + else + rv = apr_file_dup2(attr->parent_out, parent_out, attr_pool); + } + + return rv; } APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) { - apr_status_t stat; + apr_status_t rv = APR_SUCCESS; - if (attr->child_err == NULL && attr->parent_err == NULL) { - stat = open_nt_process_pipe(&attr->child_err, &attr->parent_err, - APR_FULL_BLOCK, - attr->pool); - if (stat == APR_SUCCESS) - stat = make_handle_private(attr->parent_err); - if (stat != APR_SUCCESS) - return stat; - } - - stat = make_inheritable_duplicate (child_err, attr->child_err); - if (stat == APR_SUCCESS) - stat = make_inheritable_duplicate (parent_err, attr->parent_err); + if (child_err) { + if (attr->child_err == NULL) + rv = apr_file_dup(&attr->child_err, child_err, attr_pool); + else + rv = apr_file_dup2(attr->child_err, child_err, attr_pool); - return stat; + if (rv == APR_SUCCESS) + rv = apr_file_inherit_set(attr->child_err); + } + + if (parent_err && rv == APR_SUCCESS) { + if (attr->parent_err == NULL) + rv = apr_file_dup(&attr->parent_err, parent_err, attr_pool); + else + rv = apr_file_dup2(attr->parent_err, parent_err, attr_pool); + } + + return rv; } APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, From 6e88cc9f56d640853d77e45c5b31af98fd63861f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 1 Jul 2002 17:43:02 +0000 Subject: [PATCH 3532/7878] Fat Fingers. And inherit_set has no return value. Code compiles on win32 once again, sorry about that. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63545 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 02c93d40fdb..ffee9e79943 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -190,19 +190,19 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, if (child_in) { if (attr->child_in == NULL) - rv = apr_file_dup(&attr->child_in, child_in, attr_pool); + rv = apr_file_dup(&attr->child_in, child_in, attr->pool); else - rv = apr_file_dup2(attr->child_in, child_in, attr_pool); + rv = apr_file_dup2(attr->child_in, child_in, attr->pool); if (rv == APR_SUCCESS) - rv = apr_file_inherit_set(attr->child_in); + apr_file_inherit_set(attr->child_in); } if (parent_in && rv == APR_SUCCESS) { if (attr->parent_in == NULL) - rv = apr_file_dup(&attr->parent_in, parent_in, attr_pool); + rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool); else - rv = apr_file_dup2(attr->parent_in, parent_in, attr_pool); + rv = apr_file_dup2(attr->parent_in, parent_in, attr->pool); } return rv; @@ -216,19 +216,19 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, if (child_out) { if (attr->child_out == NULL) - rv = apr_file_dup(&attr->child_out, child_out, attr_pool); + rv = apr_file_dup(&attr->child_out, child_out, attr->pool); else - rv = apr_file_dup2(attr->child_out, child_out, attr_pool); + rv = apr_file_dup2(attr->child_out, child_out, attr->pool); if (rv == APR_SUCCESS) - rv = apr_file_inherit_set(attr->child_out); + apr_file_inherit_set(attr->child_out); } if (parent_out && rv == APR_SUCCESS) { if (attr->parent_out == NULL) - rv = apr_file_dup(&attr->parent_out, parent_out, attr_pool); + rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool); else - rv = apr_file_dup2(attr->parent_out, parent_out, attr_pool); + rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool); } return rv; @@ -242,19 +242,19 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, if (child_err) { if (attr->child_err == NULL) - rv = apr_file_dup(&attr->child_err, child_err, attr_pool); + rv = apr_file_dup(&attr->child_err, child_err, attr->pool); else - rv = apr_file_dup2(attr->child_err, child_err, attr_pool); + rv = apr_file_dup2(attr->child_err, child_err, attr->pool); if (rv == APR_SUCCESS) - rv = apr_file_inherit_set(attr->child_err); + apr_file_inherit_set(attr->child_err); } if (parent_err && rv == APR_SUCCESS) { if (attr->parent_err == NULL) - rv = apr_file_dup(&attr->parent_err, parent_err, attr_pool); + rv = apr_file_dup(&attr->parent_err, parent_err, attr->pool); else - rv = apr_file_dup2(attr->parent_err, parent_err, attr_pool); + rv = apr_file_dup2(attr->parent_err, parent_err, attr->pool); } return rv; From 71b677d12a10db23d7d0186dd5e5584c6466e3bb Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Tue, 2 Jul 2002 00:10:44 +0000 Subject: [PATCH 3533/7878] Added ERROR_PATH_NOT_FOUND to the Win32 APR_STATUS_IS_ENOENT test, and added docs explaining why. See also <3D1CBC64.3010404@xbc.nu> and thread. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63546 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_errno.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/apr_errno.h b/include/apr_errno.h index 12cdf35a999..7e10c551325 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -282,6 +282,16 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_EBADPATH (APR_OS_START_ERROR + 24) /* APR ERROR VALUE TESTS */ +/** + * @defgroup APRErrorValueTests Error Value Tests + * @remark For any particular error condition, more than one of these tests + * may match. This is because platform-specific error codes may not + * always match the semantics of the POSIX codes these tests (and the + * correcponding APR error codes) are named after. A notable example + * are the APR_STATUS_IS_ENOENT and APR_STATUS_IS_ENOTDIR tests on + * Win32 platforms. The programmer should always be aware of this and + * adjust the order of the tests accordingly. + */ /** * APR was unable to perform a stat on the file * @warning always use this test, as platform-specific variances may meet this @@ -923,6 +933,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, || (s) == APR_OS_START_SYSERR + WSAENAMETOOLONG) #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \ + || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \ || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES) #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR \ From 532c292a1163250d02d4036bfa9eea2ee6ba7aeb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 2 Jul 2002 15:12:03 +0000 Subject: [PATCH 3534/7878] Any $(shell foo) garbage makes win32 NMAKE choke. Just strip out all such invocations from the makefile. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63547 13f79535-47bb-0310-9956-ffa450edef68 --- test/MakeWin32Make.awk | 1 + 1 file changed, 1 insertion(+) diff --git a/test/MakeWin32Make.awk b/test/MakeWin32Make.awk index 8627b0a45c8..447fac1df9a 100644 --- a/test/MakeWin32Make.awk +++ b/test/MakeWin32Make.awk @@ -22,6 +22,7 @@ if ( match( $0, /\@CFLAGS\@/ ) ) { $0 = ""; } + gsub( /\$\([^\)]* [^\)]*\)/, "", $0 ); gsub( /\$\{LD_FLAGS\}/, "", $0 ); gsub( /\.\.\/libapr\.la/, "../LibD/apr.lib", $0 ); gsub( /\@RM\@/, "del", $0 ); From ac0442fe4adea731e11bc623f24be49407d68e69 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 2 Jul 2002 15:47:12 +0000 Subject: [PATCH 3535/7878] Solve Jeff Trawicks nsec failure, we were truncating to 32 bits before performing the modulos operation. While at it, add an apr_time_nsec helper for convenience. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63548 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_time.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/apr_time.h b/include/apr_time.h index 88d8c41b5f5..e284399aa98 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -95,9 +95,11 @@ typedef apr_int32_t apr_short_interval_time_t; /** number of microseconds per second */ #define APR_USEC_PER_SEC APR_TIME_C(1000000) -#define apr_time_usec(time) ((apr_int32_t)(time) % APR_USEC_PER_SEC) +#define apr_time_usec(time) ((apr_int32_t)((time) % APR_USEC_PER_SEC)) -#define apr_time_sec(time) ((apr_int64_t)(time) / APR_USEC_PER_SEC) +#define apr_time_nsec(time) ((apr_int32_t)((time) % APR_USEC_PER_SEC) * (apr_int32_t)1000) + +#define apr_time_sec(time) ((apr_int64_t)((time) / APR_USEC_PER_SEC)) #define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC) From 86a4375cac5871c8d2c71ee3b27b640b99e7ff79 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 2 Jul 2002 18:18:52 +0000 Subject: [PATCH 3536/7878] We shouldn't presume any specific int sizes here, no? git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63549 13f79535-47bb-0310-9956-ffa450edef68 --- test/testatomic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index a85fed6e7ae..84e82fb23ea 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -82,8 +82,8 @@ apr_atomic_t y; /* atomic locks */ static apr_status_t check_basic_atomics(volatile apr_atomic_t*p) { - apr_uint32_t oldval; - apr_uint32_t casval = 0; + apr_atomic_t oldval; + apr_atomic_t casval = 0; apr_atomic_set(&y, 2); printf("%-60s", "testing apr_atomic_dec"); if (apr_atomic_dec(&y) == 0) { From 932a79e917055acb5a7b2e0e3e9194468f58c27c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 2 Jul 2002 18:19:37 +0000 Subject: [PATCH 3537/7878] I committed this brokenness? Gheesh, aught to read "Modified Files:" more closely. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63550 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index f4b80b93fa7..b289923d9b3 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -144,7 +144,7 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem,long with,long cmp); #elif defined(WIN32) -#define apr_atomic_t LONG +typedef LONG apr_atomic_t; #define apr_atomic_add(mem, val) InterlockedExchangeAdd(mem,val) #define apr_atomic_dec(mem) InterlockedDecrement(mem) From f2cf0c688ef04679916219536d2721de2ebc0c90 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 2 Jul 2002 21:33:43 +0000 Subject: [PATCH 3538/7878] FreeBSD apr_sendfile: test for kernel version to determine whether to include headers in length due to 4.6-STABLE kernel patch. a few minor changes from what I posted due to feedback from Cliff & Jeff: * provide a URL to the kernel CVS for their sendfile patch * get rid of the 4.4 comment - the header & syscall exist in 3.4 FreeBSD :-) * initialize slow path variables explicitly after fast path test git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63551 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 1 + network_io/unix/sendrecv.c | 75 +++++++++++++++++++++++++++++++++----- 2 files changed, 67 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index 06278802f60..cda55f5d05a 100644 --- a/configure.in +++ b/configure.in @@ -934,6 +934,7 @@ APR_FLAG_HEADERS( sys/signal.h \ sys/socket.h \ sys/stat.h \ + sys/sysctl.h \ sys/syslimits.h \ sys/time.h \ sys/types.h \ diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 3537393ea30..172d1fe983a 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -59,6 +59,10 @@ #include "fileio.h" #endif /* APR_HAS_SENDFILE */ +#ifdef HAVE_SYS_SYSCTL_H +#include +#endif + apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read) { struct timeval tv, *tvptr; @@ -435,6 +439,54 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, #elif defined(__FreeBSD__) +static int include_hdrs_in_length(void) +{ +#ifdef HAVE_SYS_SYSCTL_H +/* this assumes: + * if the header exits, so does the sysctlbyname() syscall, and + * if the header doesn't exist, the kernel is really old + */ + +/* see + * http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/sys/param.h#rev1.61.2.29 + * for kernel version number + * + * http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/uipc_syscalls.c#rev1.65.2.10 + * for the sendfile patch + */ +#define KERNEL_WITH_SENDFILE_LENGTH_FIX 460001 + + typedef enum { UNKNOWN = 0, + NEW, + OLD + } api_e; + + static api_e api; + int kernel_version; + size_t kernel_version_size; + + if (api != UNKNOWN) { + return (api == OLD); + } + kernel_version = 0; /* silence compiler warning */ + kernel_version_size = sizeof(kernel_version); + if (sysctlbyname("kern.osreldate", &kernel_version, + &kernel_version_size, NULL, NULL) == 0 && + kernel_version < KERNEL_WITH_SENDFILE_LENGTH_FIX) { + api = OLD; + return 1; + } + /* size of kern.osreldate's output might change in the future + * causing the sysctlbyname to fail, + * but if it's the future, we should use the newer API + */ + api = NEW; + return 0; +#elif + /* the build system's kernel is older than 3.4. Use the old API */ + return 1; +#endif +} /* Release 3.1 or greater */ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, @@ -445,20 +497,25 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, struct sf_hdtr headerstruct; size_t bytes_to_send = *len; + /* Ignore flags for now. */ + flags = 0; + if (!hdtr) { hdtr = &no_hdtr; } - /* Ignore flags for now. */ - flags = 0; + else if (hdtr->numheaders && include_hdrs_in_length()) { - /* On FreeBSD, the number of bytes to send must include the length of - * the headers. Don't look at the man page for this :( Instead, look - * at the the logic in src/sys/kern/uipc_syscalls::sendfile(). - */ - - for (i = 0; i < hdtr->numheaders; i++) { - bytes_to_send += hdtr->headers[i].iov_len; + /* On early versions of FreeBSD sendfile, the number of bytes to send + * must include the length of the headers. Don't look at the man page + * for this :( Instead, look at the the logic in + * src/sys/kern/uipc_syscalls::sendfile(). + * + * This was fixed in the middle of 4.6-STABLE + */ + for (i = 0; i < hdtr->numheaders; i++) { + bytes_to_send += hdtr->headers[i].iov_len; + } } headerstruct.headers = hdtr->headers; From 3ac4650ab803aa48a58ac38b1ab12a426a7d877b Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Tue, 2 Jul 2002 22:25:52 +0000 Subject: [PATCH 3539/7878] Reverting the 1.76 and 1.77 changes, because they didn't work. The child handles weren't properly inheritable, and redirected command output got lost in the bit bucket. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63552 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 137 ++++++++++++++++++++++++---------------- 1 file changed, 81 insertions(+), 56 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index ffee9e79943..895da48a2e4 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -154,110 +154,135 @@ static apr_status_t make_handle_private(apr_file_t *file) #endif } +static apr_status_t make_inheritable_duplicate(apr_file_t *original, + apr_file_t *duplicate) +{ +#ifdef _WIN32_WCE + return APR_ENOTIMPL; +#else + if (original == NULL) + return APR_SUCCESS; + + /* XXX: Can't use apr_file_dup here because it creates a non-inhertible + * handle, and apr_open_file'd apr_file_t's are non-inheritable, + * so we must assume we need to make an inheritable handle. + */ + if (!CloseHandle(duplicate->filehand)) + return apr_get_os_error(); + else + { + HANDLE hproc = GetCurrentProcess(); + if (!DuplicateHandle(hproc, original->filehand, + hproc, &duplicate->filehand, 0, + TRUE, DUPLICATE_SAME_ACCESS)) + return apr_get_os_error(); + } + + return APR_SUCCESS; +#endif +} + APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) { - apr_status_t stat = APR_SUCCESS; + apr_status_t stat; if (in) { stat = open_nt_process_pipe(&attr->child_in, &attr->parent_in, in, attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_in); + if (stat != APR_SUCCESS) + return stat; } - if (out && stat == APR_SUCCESS) { + if (out) { stat = open_nt_process_pipe(&attr->parent_out, &attr->child_out, out, attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_out); + if (stat != APR_SUCCESS) + return stat; } - if (err && stat == APR_SUCCESS) { + if (err) { stat = open_nt_process_pipe(&attr->parent_err, &attr->child_err, err, attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_err); + if (stat != APR_SUCCESS) + return stat; } - return stat; + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { - apr_status_t rv = APR_SUCCESS; - - if (child_in) { - if (attr->child_in == NULL) - rv = apr_file_dup(&attr->child_in, child_in, attr->pool); - else - rv = apr_file_dup2(attr->child_in, child_in, attr->pool); + apr_status_t stat; - if (rv == APR_SUCCESS) - apr_file_inherit_set(attr->child_in); + if (attr->child_in == NULL && attr->parent_in == NULL) { + stat = open_nt_process_pipe(&attr->child_in, &attr->parent_in, + APR_FULL_BLOCK, + attr->pool); + if (stat == APR_SUCCESS) + stat = make_handle_private(attr->parent_in); + if (stat != APR_SUCCESS) + return stat; } - if (parent_in && rv == APR_SUCCESS) { - if (attr->parent_in == NULL) - rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool); - else - rv = apr_file_dup2(attr->parent_in, parent_in, attr->pool); - } + stat = make_inheritable_duplicate (child_in, attr->child_in); + if (stat == APR_SUCCESS) + stat = make_inheritable_duplicate (parent_in, attr->parent_in); - return rv; + return stat; } APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) { - apr_status_t rv = APR_SUCCESS; - - if (child_out) { - if (attr->child_out == NULL) - rv = apr_file_dup(&attr->child_out, child_out, attr->pool); - else - rv = apr_file_dup2(attr->child_out, child_out, attr->pool); - - if (rv == APR_SUCCESS) - apr_file_inherit_set(attr->child_out); - } + apr_status_t stat; - if (parent_out && rv == APR_SUCCESS) { - if (attr->parent_out == NULL) - rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool); - else - rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool); - } + if (attr->child_out == NULL && attr->parent_out == NULL) { + stat = open_nt_process_pipe(&attr->child_out, &attr->parent_out, + APR_FULL_BLOCK, + attr->pool); + if (stat == APR_SUCCESS) + stat = make_handle_private(attr->parent_out); + if (stat != APR_SUCCESS) + return stat; + } + + stat = make_inheritable_duplicate (child_out, attr->child_out); + if (stat == APR_SUCCESS) + stat = make_inheritable_duplicate (parent_out, attr->parent_out); - return rv; + return stat; } APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) { - apr_status_t rv = APR_SUCCESS; - - if (child_err) { - if (attr->child_err == NULL) - rv = apr_file_dup(&attr->child_err, child_err, attr->pool); - else - rv = apr_file_dup2(attr->child_err, child_err, attr->pool); - - if (rv == APR_SUCCESS) - apr_file_inherit_set(attr->child_err); - } + apr_status_t stat; - if (parent_err && rv == APR_SUCCESS) { - if (attr->parent_err == NULL) - rv = apr_file_dup(&attr->parent_err, parent_err, attr->pool); - else - rv = apr_file_dup2(attr->parent_err, parent_err, attr->pool); - } + if (attr->child_err == NULL && attr->parent_err == NULL) { + stat = open_nt_process_pipe(&attr->child_err, &attr->parent_err, + APR_FULL_BLOCK, + attr->pool); + if (stat == APR_SUCCESS) + stat = make_handle_private(attr->parent_err); + if (stat != APR_SUCCESS) + return stat; + } + + stat = make_inheritable_duplicate (child_err, attr->child_err); + if (stat == APR_SUCCESS) + stat = make_inheritable_duplicate (parent_err, attr->parent_err); - return rv; + return stat; } APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, From c56e9bebe454afed93fb984d3e98e8a29729f9ee Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Tue, 2 Jul 2002 23:40:37 +0000 Subject: [PATCH 3540/7878] Added apr_file_setaside() function to move an apr_file_t from one pool to another without a dup of the file descriptor. Also added apr_mmap_setaside() for consistency, per Cliff's suggestion git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63553 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 35 +++++++++++++++++++++++++++++++++++ file_io/win32/filedup.c | 35 +++++++++++++++++++++++++++++++++++ include/apr_file_io.h | 15 +++++++++++++++ include/apr_mmap.h | 20 ++++++++++++++++++-- 4 files changed, 103 insertions(+), 2 deletions(-) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index 67b5e497465..fb4c6d0274a 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -148,3 +148,38 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, #endif } +APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, + apr_file_t *old_file, + apr_pool_t *p) +{ + *new_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t)); + memcpy(*new_file, old_file, sizeof(apr_file_t)); + (*new_file)->pool = p; + if (old_file->buffered) { + (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); + if (old_file->direction == 1) { + memcpy((*new_file)->buffer, old_file->buffer, old_file->bufpos); + } + else { + memcpy((*new_file)->buffer, old_file->buffer, old_file->dataRead); + } + if (old_file->thlock) { + apr_thread_mutex_create(&((*new_file)->thlock), + APR_THREAD_MUTEX_DEFAULT, p); + apr_thread_mutex_destroy(old_file->thlock); + } + } + if (old_file->fname) { + (*new_file)->fname = apr_pstrdup(p, old_file->fname); + } + if (!(old_file->flags & APR_FILE_NOCLEANUP)) { + apr_pool_cleanup_register(p, (void *)(*new_file), + apr_unix_file_cleanup, + apr_unix_file_cleanup); + } + + old_file->filedes = -1; + apr_pool_cleanup_kill(old_file->pool, (void *)old_file, + apr_unix_file_cleanup); + return APR_SUCCESS; +} diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 524d1139479..e945d2fd472 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -150,3 +150,38 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, #endif /* !defined(_WIN32_WCE) */ } +APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, + apr_file_t *old_file, + apr_pool_t *p) +{ + *new_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t)); + memcpy(*new_file, old_file, sizeof(apr_file_t)); + (*new_file)->pool = p; + if (old_file->buffered) { + (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); + if (old_file->direction == 1) { + memcpy((*new_file)->buffer, old_file->buffer, old_file->bufpos); + } + else { + memcpy((*new_file)->buffer, old_file->buffer, old_file->dataRead); + } + if (old_file->thlock) { + apr_thread_mutex_create(&((*new_file)->thlock), + APR_THREAD_MUTEX_DEFAULT, p); + apr_thread_mutex_destroy(old_file->thlock); + } + } + if (old_file->fname) { + (*new_file)->fname = apr_pstrdup(p, old_file->fname); + } + if (!(old_file->flags & APR_FILE_NOCLEANUP)) { + apr_pool_cleanup_register(p, (void *)(*new_file), + file_cleanup, + file_cleanup); + } + + old_file->filedes = -1; + apr_pool_cleanup_kill(old_file->pool, (void *)old_file, + file_cleanup); + return APR_SUCCESS; +} diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 811da726263..a9cd181d138 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -457,6 +457,21 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p); +/** + * move the specified file descriptor to a new pool + * @param new_file Pointer in which to return the new apr_file_t + * @param old_file The file to move + * @param p The pool to which the descriptor is to be moved + * @remark Unlike apr_file_dup2(), this function doesn't do an + * OS dup() operation on the underlying descriptor; it just + * moves the descriptor's apr_file_t wrapper to a new pool. + * @remark The new pool need not be an ancestor of old_file's pool. + * @remark After calling this function, old_file may not be used + */ +APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, + apr_file_t *old_file, + apr_pool_t *p); + /** * Move the read/write file offset to a specified byte within a file. * @param thefile The file descriptor diff --git a/include/apr_mmap.h b/include/apr_mmap.h index e54db8d58e3..202062e8d49 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -163,8 +163,8 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap, /** * Duplicate the specified MMAP. * @param new_mmap The structure to duplicate into. - * @param old_mmap The file to duplicate. - * @param p The pool to use for the new file. + * @param old_mmap The mmap to duplicate. + * @param p The pool to use for new_mmap. * @param transfer_ownership Whether responsibility for destroying * the memory-mapped segment is transferred from old_mmap to new_mmap */ @@ -173,6 +173,22 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, apr_pool_t *p, int transfer_ownership); +#if defined(DOXYGEN) +/** + * Transfer the specified MMAP to a different pool + * @param new_mmap The structure to duplicate into. + * @param old_mmap The file to transfer. + * @param p The pool to use for new_mmap. + * @remark After this call, old_mmap cannot be used + */ +APR_DECLARE(apr_status_t) apr_mmap_setaside(apr_mmap_t **new_mmap, + apr_mmap_t *old_mmap, + apr_pool_t *p); +#else +#define apr_mmap_setaside(new_mmap, old_mmap, p) apr_mmap_dup(new_mmap, old_mmap, p, 1) +#endif /* DOXYGEN */ + + /** * Remove a mmap'ed. * @param mmap The mmap'ed file. From 97bbd9beec4f73936a999a962758196ff6d2e3b4 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Tue, 2 Jul 2002 23:59:26 +0000 Subject: [PATCH 3541/7878] Added ifdefs for platforms without threads git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63554 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/filedup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index fb4c6d0274a..aa21a77f688 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -163,11 +163,13 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, else { memcpy((*new_file)->buffer, old_file->buffer, old_file->dataRead); } +#if APR_HAS_THREADS if (old_file->thlock) { apr_thread_mutex_create(&((*new_file)->thlock), APR_THREAD_MUTEX_DEFAULT, p); apr_thread_mutex_destroy(old_file->thlock); } +#endif /* APR_HAS_THREADS */ } if (old_file->fname) { (*new_file)->fname = apr_pstrdup(p, old_file->fname); From df541344ac8d545a14f5bf5f3ebf93704aa7ad9d Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Wed, 3 Jul 2002 00:15:07 +0000 Subject: [PATCH 3542/7878] Let's get rid of these damned things once and for all... for every line of code they save, they seem to introduce two to three bugs. :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63555 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_ring.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/apr_ring.h b/include/apr_ring.h index e7373ea8af2..4f006e4fcdf 100644 --- a/include/apr_ring.h +++ b/include/apr_ring.h @@ -404,6 +404,10 @@ * APR_RING_REMOVE(ep, link); * } * + * @deprecated This macro causes more headaches than it's worth. Use + * one of the alternatives documented here instead; the clarity gained + * in what's really going on is well worth the extra line or two of code. + * This macro will be removed at some point in the future. */ #define APR_RING_FOREACH(ep, hp, elem, link) \ for ((ep) = APR_RING_FIRST((hp)); \ From cc75cfcf4f608dae2c5fd44a94255528765e3d6f Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 3 Jul 2002 00:16:55 +0000 Subject: [PATCH 3543/7878] Have inherit_set/unset work correctly. Sockets can't do this, so punt. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63556 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/inherit.h | 41 ++++++++++++++++++++++++++++++++---- network_io/win32/sockets.c | 26 +++++++++++++++++++++-- 2 files changed, 61 insertions(+), 6 deletions(-) diff --git a/include/arch/win32/inherit.h b/include/arch/win32/inherit.h index 577b9788e09..9fb3aa7f998 100644 --- a/include/arch/win32/inherit.h +++ b/include/arch/win32/inherit.h @@ -62,23 +62,56 @@ #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ APR_DECLARE(void) apr_##name##_inherit_set(apr_##name##_t *name) \ { \ - return; \ + IF_WIN_OS_IS_UNICODE \ + { \ + if (!SetHandleInformation(name->filehand, \ + HANDLE_FLAG_INHERIT, \ + HANDLE_FLAG_INHERIT)) \ + return /* apr_get_os_error() */; \ + } \ + ELSE_WIN_OS_IS_ANSI \ + { \ + HANDLE temp, hproc = GetCurrentProcess(); \ + if (!DuplicateHandle(hproc, name->filehand, \ + hproc, &temp, 0, TRUE, \ + DUPLICATE_SAME_ACCESS)) \ + return /* apr_get_os_error() */; \ + CloseHandle(name->filehand); \ + name->filehand = temp; \ + } \ + return /* APR_SUCCESS */; \ } \ /* Deprecated */ \ APR_DECLARE(void) apr_##name##_set_inherit(apr_##name##_t *name) \ { \ - apr_##name##_inherit_set(name); \ + /* return */ apr_##name##_inherit_set(name); \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ APR_DECLARE(void) apr_##name##_inherit_unset(apr_##name##_t *name) \ { \ - return; \ + IF_WIN_OS_IS_UNICODE \ + { \ + if (!SetHandleInformation(name->filehand, \ + HANDLE_FLAG_INHERIT, 0)) \ + return /* apr_get_os_error() */; \ + } \ + ELSE_WIN_OS_IS_ANSI \ + { \ + HANDLE temp, hproc = GetCurrentProcess(); \ + if (!DuplicateHandle(hproc, name->filehand, \ + hproc, &temp, 0, FALSE, \ + DUPLICATE_SAME_ACCESS)) \ + return /* apr_get_os_error() */; \ + CloseHandle(name->filehand); \ + name->filehand = temp; \ + } \ + return /* APR_SUCCESS */; \ } \ /* Deprecated */ \ APR_DECLARE(void) apr_##name##_unset_inherit(apr_##name##_t *name) \ { \ - apr_##name##_inherit_unset(name); \ + /* return */ apr_##name##_inherit_unset(name); \ } #endif /* ! INHERIT_H */ diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 32817f2f218..af0fc80355e 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -424,6 +424,28 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, return APR_SUCCESS; } -APR_IMPLEMENT_INHERIT_SET(socket, inherit, cntxt, socket_cleanup) -APR_IMPLEMENT_INHERIT_UNSET(socket, inherit, cntxt, socket_cleanup) +/* Sockets cannot be inherited through the standard sockets + * inheritence. WSADuplicateSocket must be used. + * This is not trivial to implement. + */ + +APR_DECLARE(void) apr_socket_inherit_set(apr_socket_t *socket) +{ + return /* APR_ENOTIMPL */; +} +/* Deprecated */ +APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *socket) +{ + /* return */ apr_socket_inherit_set(socket); +} + +APR_DECLARE(void) apr_socket_inherit_unset(apr_socket_t *socket) +{ + return /* APR_ENOTIMPL */; +} +/* Deprecated */ +APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *socket) +{ + /* return */ apr_socket_inherit_unset(socket); +} From cb30a1572de151ceeae3d8708bb725eddc53d360 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 3 Jul 2002 00:23:39 +0000 Subject: [PATCH 3544/7878] NEVER roll back more than one patch at a time. Reverting commit 1.78 which reverted 1.76 plus 1.77 ... this code is now restored to 1.77. This code should now behave as expected, since the include/arch/win32 flavor of inherit.h now makes handles inheritable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63557 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 137 ++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 81 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 895da48a2e4..ffee9e79943 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -154,135 +154,110 @@ static apr_status_t make_handle_private(apr_file_t *file) #endif } -static apr_status_t make_inheritable_duplicate(apr_file_t *original, - apr_file_t *duplicate) -{ -#ifdef _WIN32_WCE - return APR_ENOTIMPL; -#else - if (original == NULL) - return APR_SUCCESS; - - /* XXX: Can't use apr_file_dup here because it creates a non-inhertible - * handle, and apr_open_file'd apr_file_t's are non-inheritable, - * so we must assume we need to make an inheritable handle. - */ - if (!CloseHandle(duplicate->filehand)) - return apr_get_os_error(); - else - { - HANDLE hproc = GetCurrentProcess(); - if (!DuplicateHandle(hproc, original->filehand, - hproc, &duplicate->filehand, 0, - TRUE, DUPLICATE_SAME_ACCESS)) - return apr_get_os_error(); - } - - return APR_SUCCESS; -#endif -} - APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err) { - apr_status_t stat; + apr_status_t stat = APR_SUCCESS; if (in) { stat = open_nt_process_pipe(&attr->child_in, &attr->parent_in, in, attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_in); - if (stat != APR_SUCCESS) - return stat; } - if (out) { + if (out && stat == APR_SUCCESS) { stat = open_nt_process_pipe(&attr->parent_out, &attr->child_out, out, attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_out); - if (stat != APR_SUCCESS) - return stat; } - if (err) { + if (err && stat == APR_SUCCESS) { stat = open_nt_process_pipe(&attr->parent_err, &attr->child_err, err, attr->pool); if (stat == APR_SUCCESS) stat = make_handle_private(attr->parent_err); - if (stat != APR_SUCCESS) - return stat; } - return APR_SUCCESS; + return stat; } APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { - apr_status_t stat; + apr_status_t rv = APR_SUCCESS; - if (attr->child_in == NULL && attr->parent_in == NULL) { - stat = open_nt_process_pipe(&attr->child_in, &attr->parent_in, - APR_FULL_BLOCK, - attr->pool); - if (stat == APR_SUCCESS) - stat = make_handle_private(attr->parent_in); - if (stat != APR_SUCCESS) - return stat; + if (child_in) { + if (attr->child_in == NULL) + rv = apr_file_dup(&attr->child_in, child_in, attr->pool); + else + rv = apr_file_dup2(attr->child_in, child_in, attr->pool); + + if (rv == APR_SUCCESS) + apr_file_inherit_set(attr->child_in); } - stat = make_inheritable_duplicate (child_in, attr->child_in); - if (stat == APR_SUCCESS) - stat = make_inheritable_duplicate (parent_in, attr->parent_in); + if (parent_in && rv == APR_SUCCESS) { + if (attr->parent_in == NULL) + rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool); + else + rv = apr_file_dup2(attr->parent_in, parent_in, attr->pool); + } - return stat; + return rv; } APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out) { - apr_status_t stat; + apr_status_t rv = APR_SUCCESS; - if (attr->child_out == NULL && attr->parent_out == NULL) { - stat = open_nt_process_pipe(&attr->child_out, &attr->parent_out, - APR_FULL_BLOCK, - attr->pool); - if (stat == APR_SUCCESS) - stat = make_handle_private(attr->parent_out); - if (stat != APR_SUCCESS) - return stat; - } - - stat = make_inheritable_duplicate (child_out, attr->child_out); - if (stat == APR_SUCCESS) - stat = make_inheritable_duplicate (parent_out, attr->parent_out); + if (child_out) { + if (attr->child_out == NULL) + rv = apr_file_dup(&attr->child_out, child_out, attr->pool); + else + rv = apr_file_dup2(attr->child_out, child_out, attr->pool); - return stat; + if (rv == APR_SUCCESS) + apr_file_inherit_set(attr->child_out); + } + + if (parent_out && rv == APR_SUCCESS) { + if (attr->parent_out == NULL) + rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool); + else + rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool); + } + + return rv; } APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err) { - apr_status_t stat; + apr_status_t rv = APR_SUCCESS; - if (attr->child_err == NULL && attr->parent_err == NULL) { - stat = open_nt_process_pipe(&attr->child_err, &attr->parent_err, - APR_FULL_BLOCK, - attr->pool); - if (stat == APR_SUCCESS) - stat = make_handle_private(attr->parent_err); - if (stat != APR_SUCCESS) - return stat; - } - - stat = make_inheritable_duplicate (child_err, attr->child_err); - if (stat == APR_SUCCESS) - stat = make_inheritable_duplicate (parent_err, attr->parent_err); + if (child_err) { + if (attr->child_err == NULL) + rv = apr_file_dup(&attr->child_err, child_err, attr->pool); + else + rv = apr_file_dup2(attr->child_err, child_err, attr->pool); - return stat; + if (rv == APR_SUCCESS) + apr_file_inherit_set(attr->child_err); + } + + if (parent_err && rv == APR_SUCCESS) { + if (attr->parent_err == NULL) + rv = apr_file_dup(&attr->parent_err, parent_err, attr->pool); + else + rv = apr_file_dup2(attr->parent_err, parent_err, attr->pool); + } + + return rv; } APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, From 9275f251bc50879652d6e0d6eef60edd871ce5c5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 3 Jul 2002 00:55:30 +0000 Subject: [PATCH 3545/7878] This function isn't behaving itself. Comment it out for now to get the Win32 build building again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63558 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index e945d2fd472..8cfc71e0dd2 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -149,7 +149,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, return APR_SUCCESS; #endif /* !defined(_WIN32_WCE) */ } - +#ifdef UNBORKED APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) @@ -185,3 +185,6 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, file_cleanup); return APR_SUCCESS; } +#endif + +/* XXX Need to fix the function above... */ \ No newline at end of file From 309320d3b09d705fa894981c806e9010a0be26cc Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Wed, 3 Jul 2002 01:36:53 +0000 Subject: [PATCH 3546/7878] Fixed bad variable references in apr_file_setaside() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63559 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 8cfc71e0dd2..25c8cc6ce20 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -165,10 +165,10 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, else { memcpy((*new_file)->buffer, old_file->buffer, old_file->dataRead); } - if (old_file->thlock) { - apr_thread_mutex_create(&((*new_file)->thlock), + if (old_file->mutex) { + apr_thread_mutex_create(&((*new_file)->mutex), APR_THREAD_MUTEX_DEFAULT, p); - apr_thread_mutex_destroy(old_file->thlock); + apr_thread_mutex_destroy(old_file->mutex); } } if (old_file->fname) { @@ -180,11 +180,11 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, file_cleanup); } - old_file->filedes = -1; + old_file->filehand = INVALID_HANDLE_VALUE; apr_pool_cleanup_kill(old_file->pool, (void *)old_file, file_cleanup); return APR_SUCCESS; } #endif -/* XXX Need to fix the function above... */ \ No newline at end of file +/* XXX Need to fix the function above... */ From 9b85db9e6accb04f3ebcf062c9667c5a4c58847f Mon Sep 17 00:00:00 2001 From: Thom May Date: Wed, 3 Jul 2002 20:45:42 +0000 Subject: [PATCH 3547/7878] Since the rain is falling down in sheets, I'm updating renames_pending. I believe this is more or less the full list now. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63560 13f79535-47bb-0310-9956-ffa450edef68 --- renames_pending | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/renames_pending b/renames_pending index 108f0025073..20d4fc78d0c 100644 --- a/renames_pending +++ b/renames_pending @@ -4,3 +4,51 @@ apr_user_homedir_get from apr_get_home_directory apr_user_id_get from apr_get_userid apr_user_name_get from apr_get_username +---------------------------------------------------------- +apr_time_exp_gmt_get from apr_implode_gmt +apr_time_interval_t from apr_interval_time_t +apr_time_interval_short_t from apr_short_interval_time_t +apr_file_info_t from apr_finfo_t +apr_file_stat from apr_stat +apr_file_lstat from apr_lstat +apr_file_path_root from apr_filepath_root +apr_file_path_merge from apr_file_path_merge +apr_file_path_set from apr_filepath_set +apr_file_path_get from apr_filepath_get +apr_file_attrs_t from apr_fileattrs_t +apr_file_seek_where_t from apr_seek_where_t + +apr_fnmatch_test from apr_is_fnmatch + +apr_lock_scope_e from apr_lockscope_e +apr_lock_type_e from apr_locktype_e +apr_lock_mech_e from apr_lockmech_e +apr_lock_readerwriter_e from apr_readerwriter_e + +apr_socket_shutdown from apr_shutdown +apr_socket_bind from apr_bind +apr_socket_listen from apr_listen +apr_socket_accept from apr_accept +apr_socket_connect from apr_connect +apr_sockaddr_name_info_get from apr_getnameinfo +apr_port_addr_parse from apr_parse_addr_port +apr_hostname_get from apr_gethostname +apr_socket_send from apr_send +apr_socket_sendv from apr_sendv +apr_socket_sendto from apr_sendto +apr_socket_recv_from from apr_recvfrom +apr_socket_file_send from apr_sendfile +apr_socket_recv from apr_recv +apr_socket_opt_set from apr_setsocketopt +apr_socket_opt_get from apr_getsocketopt +apr_socket_file_create from apr_socket_from_file +apr_service_byname_get from apr_getservbyname +apr_socket_filter_accept from apr_socket_accept_filter +apr_socket_inherit_set from apr_socket_set_inherit +apr_socket_inherit_unset from apr_socket_unset_inherit + +apr_user_id_current from apr_current_userid +apr_user_compare from apr_compare_users +apr_group_id_get from apr_get_groupid +apr_group_compare from apr_compare_groups + From c6c89dff5212f3d94e35f02df508627d8ead2d74 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Thu, 4 Jul 2002 00:06:23 +0000 Subject: [PATCH 3548/7878] reenabled apr_file_setaside() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63561 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/filedup.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 25c8cc6ce20..e995de323d6 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -149,7 +149,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, return APR_SUCCESS; #endif /* !defined(_WIN32_WCE) */ } -#ifdef UNBORKED + APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) @@ -185,6 +185,3 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, file_cleanup); return APR_SUCCESS; } -#endif - -/* XXX Need to fix the function above... */ From 024a51fcd8983daf1e0e48b35c664683fdd142cd Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Thu, 4 Jul 2002 13:56:16 +0000 Subject: [PATCH 3549/7878] Make testproc work on Win32 -- the .exe extension is required. Add test for file redirection with apr_procattr_child_(in|out|err)_set. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63562 13f79535-47bb-0310-9956-ffa450edef68 --- test/testproc.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 114 insertions(+), 1 deletion(-) diff --git a/test/testproc.c b/test/testproc.c index 091aceb59ce..00585e3b90d 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -70,13 +70,23 @@ int test_filedel(void); int testdirs(void); +/* XXX I'm sure there has to be a better way to do this ... */ +#ifdef WIN32 +#define EXTENSION ".exe" +#else +#define EXTENSION +#endif + int main(int argc, char *argv[]) { apr_pool_t *pool; apr_proc_t newproc; apr_procattr_t *attr; apr_file_t *testfile = NULL; + apr_file_t *testout = NULL; + apr_file_t *testerr = NULL; apr_size_t length; + apr_off_t offset; char *buf; char msgbuf[120]; const char *args[3]; @@ -94,6 +104,8 @@ int main(int argc, char *argv[]) teststr = apr_palloc(pool, 256); teststr = fgets(teststr, 256, stdin); printf("%s", teststr); + if (!strcmp("--to-stderr", argv[1])) + fprintf(stderr, "%s", teststr); exit(1); } teststr = apr_pstrdup(pool, "Whooo Hoooo\0"); @@ -102,6 +114,11 @@ int main(int argc, char *argv[]) STD_TEST_NEQ("Creating directory for later use", apr_dir_make("proctest", APR_UREAD | APR_UWRITE | APR_UEXECUTE, pool)) + + /* =================================================================== */ + + printf("\nTesting process pipes ...\n\n"); + STD_TEST_NEQ("Creating procattr", apr_procattr_create(&attr, pool)) STD_TEST_NEQ("Setting attr pipes, all three", apr_procattr_io_set(attr, APR_FULL_BLOCK, APR_CHILD_BLOCK, APR_NO_PIPE)) @@ -113,7 +130,7 @@ int main(int argc, char *argv[]) args[2] = NULL; STD_TEST_NEQ("Creating a new process", apr_proc_create(&newproc, - "../testproc", args, NULL, attr, pool)) + "../testproc" EXTENSION, args, NULL, attr, pool)) printf("%-60s","Grabbing child's stdin"); testfile = newproc.in; @@ -149,6 +166,102 @@ int main(int argc, char *argv[]) TEST_NEQ("Waiting for child to die", apr_proc_wait(&newproc, NULL, NULL, APR_WAIT), APR_CHILD_DONE, "OK", "Failed") + + /* =================================================================== */ + + printf("\nTesting file redirection ...\n\n"); + + testfile = NULL; + STD_TEST_NEQ("Creating input file", + apr_file_open(&testfile, "proctest/stdin", + APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, + APR_OS_DEFAULT, pool)) + STD_TEST_NEQ("Creating output file", + apr_file_open(&testout, "proctest/stdout", + APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, + APR_OS_DEFAULT, pool)) + STD_TEST_NEQ("Creating error file", + apr_file_open(&testerr, "proctest/stderr", + APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, + APR_OS_DEFAULT, pool)) + + length = strlen(teststr); + STD_TEST_NEQ("Writing input file", + apr_file_write(testfile, teststr, &length)) + offset = 0; + STD_TEST_NEQ("Rewinding input file", + apr_file_seek(testfile, APR_SET, &offset)) + + STD_TEST_NEQ("Creating procattr", apr_procattr_create(&attr, pool)) + STD_TEST_NEQ("Setting attr input file", + apr_procattr_child_in_set(attr, testfile, NULL)) + STD_TEST_NEQ("Setting attr output file", + apr_procattr_child_out_set(attr, testout, NULL)) + STD_TEST_NEQ("Setting attr error file", + apr_procattr_child_err_set(attr, testerr, NULL)) + STD_TEST_NEQ("Setting attr dir", apr_procattr_dir_set(attr, "proctest")) + STD_TEST_NEQ("Setting attr cmd type", apr_procattr_cmdtype_set(attr, APR_PROGRAM)) + + args[0] = "testproc"; + args[1] = "--to-stderr"; + args[2] = NULL; + + STD_TEST_NEQ("Creating a new process", apr_proc_create(&newproc, + "../testproc" EXTENSION, args, NULL, attr, pool)) + + TEST_NEQ("Waiting for child to die", + apr_proc_wait(&newproc, NULL, NULL, APR_WAIT), + APR_CHILD_DONE, "OK", "Failed") + + offset = 0; + STD_TEST_NEQ("Rewinding output file", + apr_file_seek(testout, APR_SET, &offset)) + length = 256; + printf("%-60s", "Checking the data read from child's stdout"); + buf = apr_pcalloc(pool, length); + if ((rv = apr_file_read(testout, buf, &length)) == APR_SUCCESS) { + if (!strcmp(buf, teststr)) + printf("OK\n"); + else { + printf( "Uh-Oh\n"); + printf(" (I actually got %s_\n", buf); + } + } + else { + printf("Read failed - (%d) %s\n", + rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); + } + + offset = 0; + STD_TEST_NEQ("Rewinding error file", + apr_file_seek(testerr, APR_SET, &offset)) + length = 256; + printf("%-60s", "Checking the data read from child's stderr"); + buf = apr_pcalloc(pool, length); + if ((rv = apr_file_read(testerr, buf, &length)) == APR_SUCCESS) { + if (!strcmp(buf, teststr)) + printf("OK\n"); + else { + printf( "Uh-Oh\n"); + printf(" (I actually got %s_\n", buf); + } + } + else { + printf("Read failed - (%d) %s\n", + rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); + } + + STD_TEST_NEQ("Closing input file", apr_file_close(testfile)); + STD_TEST_NEQ("Closing output file", apr_file_close(testout)); + STD_TEST_NEQ("Closing error file", apr_file_close(testerr)); + + STD_TEST_NEQ("Removing input file", apr_file_remove("proctest/stdin", pool)); + STD_TEST_NEQ("Removing output file", apr_file_remove("proctest/stdout", pool)); + STD_TEST_NEQ("Removing error file", apr_file_remove("proctest/stderr", pool)); + + /* =================================================================== */ + + printf("\n"); STD_TEST_NEQ("Removing directory", apr_dir_remove("proctest", pool)) printf("\nTest completed succesfully\n"); From ea0f5f47c3a457a8c118753a8f44624018364125 Mon Sep 17 00:00:00 2001 From: Sander Striker Date: Thu, 4 Jul 2002 15:04:42 +0000 Subject: [PATCH 3550/7878] Introduce a new symbolic constant, effectively eliminating a magic number. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63563 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_allocator.h | 3 +++ memory/unix/apr_pools.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/apr_allocator.h b/include/apr_allocator.h index e5eba0a6212..2041fc43b47 100644 --- a/include/apr_allocator.h +++ b/include/apr_allocator.h @@ -92,6 +92,9 @@ struct apr_memnode_t { #define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t)) +/** Symbolic constants */ +#define APR_ALLOCATOR_MAX_FREE_UNLIMITED 0 + /** * Create a new allocator * @param allocator The allocator we have just created. diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 31a1ef7c9d5..cddd1b9876c 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -119,6 +119,7 @@ APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator) return APR_ENOMEM; memset(new_allocator, 0, SIZEOF_ALLOCATOR_T); + new_allocator->max_free_index = APR_ALLOCATOR_MAX_FREE_UNLIMITED; *allocator = new_allocator; @@ -351,7 +352,8 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) next = node->next; index = node->index; - if (max_free_index != 0 && index > current_free_index) { + if (max_free_index != APR_ALLOCATOR_MAX_FREE_UNLIMITED + && index > current_free_index) { node->next = freelist; freelist = node; } @@ -404,6 +406,7 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, } + /* * Debug level */ From 035c90ee130dec297feb75b970079c1c4af43ec3 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Thu, 4 Jul 2002 23:10:24 +0000 Subject: [PATCH 3551/7878] use the time conversion macros rather than dividing by APR_USEC_PER_SEC git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63564 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/readwrite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index f97b8745ef9..3963840a371 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -75,8 +75,8 @@ static apr_status_t wait_for_io_or_timeout(apr_file_t *file, int for_read) FD_ZERO(&fdset); FD_SET(file->filedes, &fdset); if (file->timeout >= 0) { - tv.tv_sec = file->timeout / APR_USEC_PER_SEC; - tv.tv_usec = file->timeout % APR_USEC_PER_SEC; + tv.tv_sec = apr_time_sec(file->timeout); + tv.tv_usec = apr_time_usec(file->timeout); tvptr = &tv; } else { From dd5217d6b7d8bfa88b9d1258a90132daab7df68d Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 5 Jul 2002 00:11:11 +0000 Subject: [PATCH 3552/7878] use new time conversion macros in place of APR_USEC_PER_SEC git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63565 13f79535-47bb-0310-9956-ffa450edef68 --- test/client.c | 2 +- test/testflock.c | 2 +- test/testlock.c | 2 +- test/testmutexscope.c | 2 +- test/testoc.c | 4 ++-- test/testpipe.c | 2 +- test/testshm.c | 7 ++++--- test/testshmconsumer.c | 5 +++-- test/testsleep.c | 2 +- 9 files changed, 15 insertions(+), 13 deletions(-) diff --git a/test/client.c b/test/client.c index c1a2fe46b35..98d50260618 100644 --- a/test/client.c +++ b/test/client.c @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) char *local_ipaddr, *remote_ipaddr; char *dest = "127.0.0.1"; apr_port_t local_port, remote_port; - apr_interval_time_t timeout = 2 * APR_USEC_PER_SEC; + apr_interval_time_t timeout = apr_time_from_sec(2); apr_sockaddr_t *local_sa, *remote_sa; setbuf(stdout, NULL); diff --git a/test/testflock.c b/test/testflock.c index 4f9ffe069c8..b1d0aa4fd47 100644 --- a/test/testflock.c +++ b/test/testflock.c @@ -147,7 +147,7 @@ static void do_write(void) printf("Lock created.\nSleeping..."); fflush(stdout); - apr_sleep(30 * APR_USEC_PER_SEC); + apr_sleep(apr_time_from_sec(30)); (void) apr_file_close(file); printf(" done.\nExiting.\n"); diff --git a/test/testlock.c b/test/testlock.c index 30a2257598c..d0996890dd1 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -395,7 +395,7 @@ apr_status_t test_timeoutcond(void) } printf("OK\n"); - timeout = 5 * APR_USEC_PER_SEC; + timeout = apr_time_from_sec(5); for (i = 0; i < MAX_RETRY; i++) { apr_thread_mutex_lock(timeout_mutex); diff --git a/test/testmutexscope.c b/test/testmutexscope.c index 9b85b28e1ec..1893302f700 100644 --- a/test/testmutexscope.c +++ b/test/testmutexscope.c @@ -174,7 +174,7 @@ static void test_mech_mode(apr_lockmech_e mech, const char *mech_name, ++i; } - apr_sleep(5 * APR_USEC_PER_SEC); + apr_sleep(apr_time_from_sec(5)); if (test_mode == TEST_PROC) { printf(" Mutex mechanism `%s' is %sglobal in scope on this platform.\n", diff --git a/test/testoc.c b/test/testoc.c index af228d36b92..e5254533dd0 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "[PARENT] Sending SIGKILL to child......"); fflush(stdout); - apr_sleep(1 * APR_USEC_PER_SEC); + apr_sleep(apr_time_from_sec(1)); if ((rv = apr_proc_kill(&newproc, SIGKILL)) != APR_SUCCESS) { char msgbuf[120]; @@ -154,7 +154,7 @@ int main(int argc, char *argv[]) fprintf(stdout,"OK\n"); /* allow time for things to settle... */ - apr_sleep(3 * APR_USEC_PER_SEC); + apr_sleep(apr_time_from_sec(3)); fprintf(stdout, "[PARENT] Checking on children..........\n"); apr_proc_other_child_check(); diff --git a/test/testpipe.c b/test/testpipe.c index 7b5e8bdaf96..8d57954b51b 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -95,7 +95,7 @@ int main(void) } fprintf(stdout, "\tSetting pipe timeout......."); - if ((rv = apr_file_pipe_timeout_set(readp, 1 * APR_USEC_PER_SEC)) != APR_SUCCESS) { + if ((rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1))) != APR_SUCCESS) { fprintf(stderr, "apr_file_pipe_timeout_set()->%d/%s\n", rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); exit(-1); diff --git a/test/testshm.c b/test/testshm.c index 347ec2a7bbb..bde95edb69b 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -82,7 +82,8 @@ static void msgwait(int sleep_sec, int first_box, int last_box) { int i; apr_time_t start = apr_time_now(); - while (apr_time_now() - start < sleep_sec * APR_USEC_PER_SEC) { + apr_interval_time_t sleep_duration = apr_time_from_sec(sleep_sec); + while (apr_time_now() - start < sleep_duration) { for (i = first_box; i < last_box; i++) { if (boxes[i].msgavail) { fprintf(stdout, "received a message in box %d, message was: %s\n", @@ -90,7 +91,7 @@ static void msgwait(int sleep_sec, int first_box, int last_box) boxes[i].msgavail = 0; /* reset back to 0 */ } } - apr_sleep(1*APR_USEC_PER_SEC/100); + apr_sleep(apr_time_make(0, 10000)); /* 10ms */ } fprintf(stdout, "done waiting on mailboxes...\n"); } @@ -157,7 +158,7 @@ static apr_status_t test_anon(apr_pool_t *parpool) i += N_BOXES; /* start over at the top */ } msgput(i, "Sending a message\n"); - apr_sleep(1*APR_USEC_PER_SEC/100); + apr_sleep(apr_time_make(0, 10000)); } } else { diff --git a/test/testshmconsumer.c b/test/testshmconsumer.c index d01467faaaa..673516624e1 100644 --- a/test/testshmconsumer.c +++ b/test/testshmconsumer.c @@ -81,7 +81,8 @@ static void msgwait(int sleep_sec, int first_box, int last_box) { int i; apr_time_t start = apr_time_now(); - while (apr_time_now() - start < sleep_sec * APR_USEC_PER_SEC) { + apr_interval_time_t sleep_duration = apr_time_from_sec(sleep_sec); + while (apr_time_now() - start < sleep_duration) { for (i = first_box; i < last_box; i++) { if (boxes[i].msgavail) { fprintf(stdout, "Consumer: received a message in box %d, message was: %s\n", @@ -89,7 +90,7 @@ static void msgwait(int sleep_sec, int first_box, int last_box) boxes[i].msgavail = 0; /* reset back to 0 */ } } - apr_sleep(1*APR_USEC_PER_SEC); + apr_sleep(apr_time_from_sec(1)); } fprintf(stdout, "Consumer: done waiting on mailboxes...\n"); } diff --git a/test/testsleep.c b/test/testsleep.c index 5d29fbb60e4..579a6866e3f 100644 --- a/test/testsleep.c +++ b/test/testsleep.c @@ -66,7 +66,7 @@ static void do_sleep(int howlong) { apr_time_t then, now, diff; - apr_time_t interval = howlong * APR_USEC_PER_SEC; + apr_time_t interval = apr_time_from_sec(howlong); printf(" I'm about to go to sleep!\n"); From 5435b0fc5755ba7273d82195910277cb4c0608a4 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 5 Jul 2002 00:26:37 +0000 Subject: [PATCH 3553/7878] use new time conversion macros in place of APR_USEC_PER_SEC git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63566 13f79535-47bb-0310-9956-ffa450edef68 --- memory/unix/apr_pools.c | 2 +- network_io/beos/poll.c | 4 ++-- network_io/unix/poll.c | 4 ++-- network_io/win32/poll.c | 4 ++-- test/testfile.c | 2 +- test/testshmproducer.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index cddd1b9876c..82a9f7b2e5a 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -2051,7 +2051,7 @@ static void free_proc_chain(struct process_chain *procs) /* Sleep only if we have to... */ if (need_timeout) - apr_sleep(3 * APR_USEC_PER_SEC); + apr_sleep(apr_time_from_sec(3)); /* OK, the scripts we just timed out for have had a chance to clean up * --- now, just get rid of them, and also clean up the system accounting diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index 96515612251..d794ee77cdf 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -166,8 +166,8 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, tvptr = NULL; } else { - tv.tv_sec = timeout / APR_USEC_PER_SEC; - tv.tv_usec = timeout % APR_USEC_PER_SEC; + tv.tv_sec = apr_time_sec(timeout); + tv.tv_usec = apr_time_usec(timeout); tvptr = &tv; } diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index 99be46fb886..5c15e015082 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -289,8 +289,8 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, tvptr = NULL; } else { - tv.tv_sec = timeout / APR_USEC_PER_SEC; - tv.tv_usec = timeout % APR_USEC_PER_SEC; + tv.tv_sec = apr_time_sec(timeout); + tv.tv_usec = apr_time_usec(timeout); tvptr = &tv; } diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index de8ccccff0d..d9c8cd1d2e4 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -134,8 +134,8 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, tvptr = NULL; } else { - tv.tv_sec = (long)(timeout / APR_USEC_PER_SEC); - tv.tv_usec = (long)(timeout % APR_USEC_PER_SEC); + tv.tv_sec = (long)apr_time_sec(timeout); + tv.tv_usec = (long)apr_time_usec(timeout); tvptr = &tv; } rv = select(500, /* ignored on Windows */ diff --git a/test/testfile.c b/test/testfile.c index a189dfd6c4b..25176baebcb 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -157,7 +157,7 @@ int main(void) apr_poll_socket_add(sdset, testsock, APR_POLLIN); num = 1; STD_TEST_NEQ(" Checking for incoming data", - apr_poll(sdset, &num, 1 * APR_USEC_PER_SEC)) + apr_poll(sdset, &num, apr_time_from_sec(1))); if (num == 0) { printf("** This platform doesn't return readability on a regular file.**\n"); } diff --git a/test/testshmproducer.c b/test/testshmproducer.c index 94e11e41b98..dde0d2e84c8 100644 --- a/test/testshmproducer.c +++ b/test/testshmproducer.c @@ -118,7 +118,7 @@ int main(void) /* produce messages on all of the boxes, in descending order */ for (i = N_BOXES - 1; i > 0; i--) { msgput(i, "Sending a message\n"); - apr_sleep(1*APR_USEC_PER_SEC); + apr_sleep(apr_time_from_sec(1)); } printf("Producer detaching from name-based shared memory...."); From e0363d5e3636ce5eaa47108a8ea4c5f13df2477b Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 5 Jul 2002 01:25:38 +0000 Subject: [PATCH 3554/7878] Call apr_atomic_init() during apr_initialize() in case we're on a platform where atomic ops are implemented using the fallback mutex implementation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63567 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/unix/start.c b/misc/unix/start.c index 94b34a0b2a0..b2872b47b0a 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -98,6 +98,10 @@ APR_DECLARE(apr_status_t) apr_initialize(void) apr_pool_tag(pool, "apr_initialize"); + if ((status = apr_atomic_init(pool)) != APR_SUCCESS) { + return status; + } + apr_signal_init(pool); return APR_SUCCESS; From 6472bb6360000842a87b5e7657da1ef4e00596ba Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 5 Jul 2002 01:26:09 +0000 Subject: [PATCH 3555/7878] Added apr_initialize() to uuid test program git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63568 13f79535-47bb-0310-9956-ffa450edef68 --- test/testuuid.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testuuid.c b/test/testuuid.c index cc19a7dc367..8cc6405d3d9 100644 --- a/test/testuuid.c +++ b/test/testuuid.c @@ -54,6 +54,7 @@ #include +#include "apr_general.h" #include "apr_uuid.h" @@ -64,6 +65,9 @@ int main(int argc, char **argv) char buf[APR_UUID_FORMATTED_LENGTH + 1]; int retcode = 0; + apr_initialize(); + atexit(apr_terminate); + apr_uuid_get(&uuid); apr_uuid_format(buf, &uuid); printf("UUID: %s\n", buf); From 74963ad6abbc3dd98649dac0883e512d37e1b210 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 5 Jul 2002 05:36:24 +0000 Subject: [PATCH 3556/7878] fix a compiler warning git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63569 13f79535-47bb-0310-9956-ffa450edef68 --- misc/unix/start.c | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/unix/start.c b/misc/unix/start.c index b2872b47b0a..63f15424cc2 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -56,6 +56,7 @@ #include "apr_general.h" #include "apr_pools.h" #include "apr_signal.h" +#include "apr_atomic.h" #include "proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ #include "internal_time.h" From 6083801193b417bfcbda5ab9b3e3e589a15e8f2e Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 5 Jul 2002 05:39:01 +0000 Subject: [PATCH 3557/7878] Moved the definition of apr_table_t's internals from apr_tables.h to apr_tables.c to strengthen its encapsulation git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63570 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_tables.h | 15 --------------- tables/apr_tables.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/apr_tables.h b/include/apr_tables.h index 669aa9a5fa9..0cabeefe4de 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -102,21 +102,6 @@ struct apr_array_header_t { char *elts; }; -/** The opaque string-content table type */ -struct apr_table_t { - /* This has to be first to promote backwards compatibility with - * older modules which cast a apr_table_t * to an apr_array_header_t *... - * they should use the table_elts() function for most of the - * cases they do this for. - */ - /** The underlying array for the table */ - apr_array_header_t a; -#ifdef MAKE_TABLE_PROFILE - /** Who created the array. */ - void *creator; -#endif -}; - /** * The (opaque) structure for string-content tables. */ diff --git a/tables/apr_tables.c b/tables/apr_tables.c index f23f8630b97..a6c1602c208 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -337,6 +337,21 @@ APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, checksum &= CASE_MASK; \ } +/** The opaque string-content table type */ +struct apr_table_t { + /* This has to be first to promote backwards compatibility with + * older modules which cast a apr_table_t * to an apr_array_header_t *... + * they should use the table_elts() function for most of the + * cases they do this for. + */ + /** The underlying array for the table */ + apr_array_header_t a; +#ifdef MAKE_TABLE_PROFILE + /** Who created the array. */ + void *creator; +#endif +}; + /* * XXX: if you tweak this you should look at is_empty_table() and table_elts() * in alloc.h From 6cc4b49e7658c7b682e3ca4626eed186f235bded Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 5 Jul 2002 08:20:43 +0000 Subject: [PATCH 3558/7878] Streamlined the code for apr_table_get() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63571 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index a6c1602c208..b27a027cb38 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -406,8 +406,8 @@ APR_DECLARE(void) apr_table_clear(apr_table_t *t) APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key) { - apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; - int i; + apr_table_entry_t *next_elt = (apr_table_entry_t *) t->a.elts; + apr_table_entry_t *last_elt = next_elt + t->a.nelts; apr_uint32_t checksum; if (key == NULL) { @@ -415,9 +415,10 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key) } COMPUTE_KEY_CHECKSUM(key, checksum); - for (i = 0; i < t->a.nelts; ++i) { - if ((checksum == elts[i].key_checksum) && !strcasecmp(elts[i].key, key)) { - return elts[i].val; + for (; next_elt < last_elt; next_elt++) { + if ((checksum == next_elt->key_checksum) && + !strcasecmp(next_elt->key, key)) { + return next_elt->val; } } From 83acb784b5a5288aa89884064d55a8a337fdeb51 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 5 Jul 2002 08:49:55 +0000 Subject: [PATCH 3559/7878] added table test program git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63572 13f79535-47bb-0310-9956-ffa450edef68 --- test/Makefile.in | 8 +++- test/testtable.c | 117 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 test/testtable.c diff --git a/test/Makefile.in b/test/Makefile.in index 5d670ded3ec..3db64c9dff0 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -45,7 +45,8 @@ PROGRAMS = \ testdup@EXEEXT@ \ testatomic@EXEEXT@ \ testpools@EXEEXT@ \ - testmutexscope@EXEEXT@ + testmutexscope@EXEEXT@ \ + testtable@EXEEXT@ TARGETS = $(PROGRAMS) $(NONPORTABLE) @@ -94,7 +95,7 @@ mod_test.la: mod_test.slo $(LOCAL_LIBS) libmod_test.la: mod_test.slo $(LOCAL_LIBS) $(LINK) --mode=link $(COMPILE) -rpath $(shell pwd) -avoid-version mod_test.lo $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ - + testargs@EXEEXT@: testargs.lo $(LOCAL_LIBS) $(LINK) testargs.lo $(LOCAL_LIBS) $(ALL_LIBS) @@ -200,4 +201,7 @@ testpools@EXEEXT@: testpools.lo $(LOCAL_LIBS) testmutexscope@EXEEXT@: testmutexscope.lo $(LOCAL_LIBS) $(LINK) testmutexscope.lo $(LOCAL_LIBS) $(ALL_LIBS) +testtable@EXEEXT@: testtable.lo $(LOCAL_LIBS) + $(LINK) testtable.lo $(LOCAL_LIBS) $(ALL_LIBS) + # DO NOT REMOVE diff --git a/test/testtable.c b/test/testtable.c new file mode 100644 index 00000000000..587142fe00b --- /dev/null +++ b/test/testtable.c @@ -0,0 +1,117 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +#include "apr.h" +#include "apr_strings.h" +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_tables.h" +#if APR_HAVE_STDIO_H +#include +#endif +#if APR_HAVE_STDLIB_H +#include +#endif +#if APR_HAVE_STRING_H +#include +#endif + +int main(int argc, const char *const argv[]) +{ + apr_pool_t *p; + apr_table_t *t1; + + const char *val; + + apr_initialize(); + atexit(apr_terminate); + + apr_pool_create(&p, NULL); + + t1 = apr_table_make(p, 5); + + fprintf(stderr, "Test 1: apr_table_set..."); + apr_table_set(t1, "foo", "bar"); + if (!(val = apr_table_get(t1, "foo")) || strcmp(val, "bar")) { + fprintf(stderr, "ERROR\n"); + exit(-1); + } + fprintf(stderr, "OK\n"); + + fprintf(stderr, "Test 2: apr_table_add..."); + apr_table_add(t1, "foo", "12345"); + if (!(val = apr_table_get(t1, "foo")) || strcmp(val, "bar")) { + fprintf(stderr, "ERROR\n"); + exit(-1); + } + fprintf(stderr, "OK\n"); + + fprintf(stderr, "Test 3: apr_table_set..."); + apr_table_set(t1, "abc", "def"); + apr_table_addn(t1, "foo", "dummy1"); + apr_table_addn(t1, "foo", "dummy2"); + apr_table_set(t1, "def", "abc"); + apr_table_set(t1, "foo", "zzz"); + if (!(val = apr_table_get(t1, "foo")) || strcmp(val, "zzz") || + (apr_table_elts(t1)->nelts != 3) || + !(val = apr_table_get(t1, "abc")) || strcmp(val, "def") || + !(val = apr_table_get(t1, "def")) || strcmp(val, "abc")) { + fprintf(stderr, "ERROR\n"); + exit(-1); + } + fprintf(stderr, "OK\n"); + + + return 0; +} From e2c9885b4f53ca5f51f504192f0d7e1a393ca9b1 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 5 Jul 2002 08:55:38 +0000 Subject: [PATCH 3560/7878] Optimized the apr_table_set* functions, and updated a variable name in apr_table_get() for consistency git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63573 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 + tables/apr_tables.c | 129 ++++++++++++++++++++------------------------ 2 files changed, 60 insertions(+), 71 deletions(-) diff --git a/CHANGES b/CHANGES index 9e6051a1c2d..0b21846b4f1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with APR b1 + *) Faster code for the apr_table get/set functions [Brian Pane] + *) Fix the userid functions on Irix to handle the way that Irix reports a failure from getpwnam_r(). PR 10095. [Robert I. Cowles , Jeff Trawick] diff --git a/tables/apr_tables.c b/tables/apr_tables.c index b27a027cb38..858d18f57c4 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -407,7 +407,7 @@ APR_DECLARE(void) apr_table_clear(apr_table_t *t) APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key) { apr_table_entry_t *next_elt = (apr_table_entry_t *) t->a.elts; - apr_table_entry_t *last_elt = next_elt + t->a.nelts; + apr_table_entry_t *end_elt = next_elt + t->a.nelts; apr_uint32_t checksum; if (key == NULL) { @@ -415,7 +415,7 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key) } COMPUTE_KEY_CHECKSUM(key, checksum); - for (; next_elt < last_elt; next_elt++) { + for (; next_elt < end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && !strcasecmp(next_elt->key, key)) { return next_elt->val; @@ -428,90 +428,77 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key) APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, const char *val) { - register int i, j, k; - apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; - int done = 0; + apr_table_entry_t *next_elt = (apr_table_entry_t *) t->a.elts; + apr_table_entry_t *end_elt = next_elt + t->a.nelts; + apr_table_entry_t *dst_elt; apr_uint32_t checksum; COMPUTE_KEY_CHECKSUM(key, checksum); - for (i = 0; i < t->a.nelts; ) { - if ((checksum == elts[i].key_checksum) && !strcasecmp(elts[i].key, key)) { - if (!done) { - elts[i].val = apr_pstrdup(t->a.pool, val); - done = 1; - ++i; - } - else { /* delete an extraneous element */ - for (j = i, k = i + 1; k < t->a.nelts; ++j, ++k) { - elts[j].key = elts[k].key; - elts[j].val = elts[k].val; - elts[j].key_checksum = elts[k].key_checksum; - } - --t->a.nelts; - } - } - else { - ++i; - } - } + for (; next_elt < end_elt; next_elt++) { + if ((checksum == next_elt->key_checksum) && + !strcasecmp(next_elt->key, key)) { + next_elt->val = apr_pstrdup(t->a.pool, val); + /* remove any other instances of this key */ + dst_elt = NULL; + for (next_elt++; next_elt < end_elt; next_elt++) { + if ((checksum == next_elt->key_checksum) && + !strcasecmp(next_elt->key, key)) { + t->a.nelts--; + if (!dst_elt) { + dst_elt = next_elt; + } + } + else if (dst_elt) { + *dst_elt++ = *next_elt; + } - if (!done) { - elts = (apr_table_entry_t *) table_push(t); - elts->key = apr_pstrdup(t->a.pool, key); - elts->val = apr_pstrdup(t->a.pool, val); - elts->key_checksum = checksum; + } + return; + } } + + next_elt = (apr_table_entry_t *) table_push(t); + next_elt->key = apr_pstrdup(t->a.pool, key); + next_elt->val = apr_pstrdup(t->a.pool, val); + next_elt->key_checksum = checksum; } APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, const char *val) { - register int i, j, k; - apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; - int done = 0; + apr_table_entry_t *next_elt = (apr_table_entry_t *) t->a.elts; + apr_table_entry_t *end_elt = next_elt + t->a.nelts; + apr_table_entry_t *dst_elt; apr_uint32_t checksum; -#ifdef POOL_DEBUG - { - if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) { - fprintf(stderr, "table_set: key not in ancestor pool of t\n"); - abort(); - } - if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) { - fprintf(stderr, "table_set: val not in ancestor pool of t\n"); - abort(); - } - } -#endif - COMPUTE_KEY_CHECKSUM(key, checksum); - for (i = 0; i < t->a.nelts; ) { - if ((checksum == elts[i].key_checksum) && !strcasecmp(elts[i].key, key)) { - if (!done) { - elts[i].val = (char *)val; - done = 1; - ++i; - } - else { /* delete an extraneous element */ - for (j = i, k = i + 1; k < t->a.nelts; ++j, ++k) { - elts[j].key = elts[k].key; - elts[j].val = elts[k].val; - elts[j].key_checksum = elts[k].key_checksum; - } - --t->a.nelts; - } - } - else { - ++i; - } - } + for (; next_elt < end_elt; next_elt++) { + if ((checksum == next_elt->key_checksum) && + !strcasecmp(next_elt->key, key)) { + next_elt->val = (char *)val; + /* remove any other instances of this key */ + dst_elt = NULL; + for (next_elt++; next_elt < end_elt; next_elt++) { + if ((checksum == next_elt->key_checksum) && + !strcasecmp(next_elt->key, key)) { + t->a.nelts--; + if (!dst_elt) { + dst_elt = next_elt; + } + } + else if (dst_elt) { + *dst_elt++ = *next_elt; + } - if (!done) { - elts = (apr_table_entry_t *) table_push(t); - elts->key = (char *)key; - elts->val = (char *)val; - elts->key_checksum = checksum; + } + return; + } } + + next_elt = (apr_table_entry_t *) table_push(t); + next_elt->key = (char *)key; + next_elt->val = (char *)val; + next_elt->key_checksum = checksum; } APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) From 6ba410a6b4a8cbb4d75c405e01fe720e46e30fee Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 5 Jul 2002 09:05:49 +0000 Subject: [PATCH 3561/7878] added test cases for apr_table_unset() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63574 13f79535-47bb-0310-9956-ffa450edef68 --- test/testtable.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/testtable.c b/test/testtable.c index 587142fe00b..5c26865cd89 100644 --- a/test/testtable.c +++ b/test/testtable.c @@ -112,6 +112,28 @@ int main(int argc, const char *const argv[]) } fprintf(stderr, "OK\n"); + fprintf(stderr, "Test 4: apr_table_unset..."); + apr_table_clear(t1); + apr_table_addn(t1, "a", "1"); + apr_table_addn(t1, "b", "2"); + apr_table_addn(t1, "c", "3"); + apr_table_addn(t1, "b", "2"); + apr_table_addn(t1, "d", "4"); + apr_table_addn(t1, "e", "5"); + apr_table_addn(t1, "b", "2"); + apr_table_addn(t1, "f", "6"); + apr_table_unset(t1, "b"); + if ((apr_table_elts(t1)->nelts != 5) || + !(val = apr_table_get(t1, "a")) || strcmp(val, "1") || + !(val = apr_table_get(t1, "c")) || strcmp(val, "3") || + !(val = apr_table_get(t1, "d")) || strcmp(val, "4") || + !(val = apr_table_get(t1, "e")) || strcmp(val, "5") || + !(val = apr_table_get(t1, "f")) || strcmp(val, "6") || + (apr_table_get(t1, "b") != NULL)) { + fprintf(stderr, "ERROR\n"); + exit(-1); + } + fprintf(stderr, "OK\n"); return 0; } From cf526b29cf222b7b8471bca05b3b90a51a6c8678 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 5 Jul 2002 09:09:11 +0000 Subject: [PATCH 3562/7878] Optimized apr_table_unset(): the loop is now O(n) instead of O(n^2) in the worst case git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63575 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 858d18f57c4..03e907f178b 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -503,29 +503,23 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) { - register int i, j, k; - apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; + apr_table_entry_t *next_elt = (apr_table_entry_t *) t->a.elts; + apr_table_entry_t *end_elt = next_elt + t->a.nelts; + apr_table_entry_t *dst_elt = NULL; apr_uint32_t checksum; COMPUTE_KEY_CHECKSUM(key, checksum); - for (i = 0; i < t->a.nelts; ) { - if ((checksum == elts[i].key_checksum) && !strcasecmp(elts[i].key, key)) { - - /* found an element to skip over - * there are any number of ways to remove an element from - * a contiguous block of memory. I've chosen one that - * doesn't do a memcpy/bcopy/array_delete, *shrug*... - */ - for (j = i, k = i + 1; k < t->a.nelts; ++j, ++k) { - elts[j].key = elts[k].key; - elts[j].val = elts[k].val; - elts[j].key_checksum = elts[k].key_checksum; - } - --t->a.nelts; - } - else { - ++i; - } + for (; next_elt < end_elt; next_elt++) { + if ((checksum == next_elt->key_checksum) && + !strcasecmp(next_elt->key, key)) { + t->a.nelts--; + if (!dst_elt) { + dst_elt = next_elt; + } + } + else if (dst_elt) { + *dst_elt++ = *next_elt; + } } } From cf10c19355881f4c5251536052716c7ff796c9e4 Mon Sep 17 00:00:00 2001 From: Branko Cibej Date: Fri, 5 Jul 2002 17:58:10 +0000 Subject: [PATCH 3563/7878] Changed the return values of the apr_*_inherit_(un)set functions from void to apr_status_t. The deprecated versios, apr_*_(un)set_inherit, are still void, so that we don't inadvertently break code that uses them. Updated all uses of apr_file_inherit_set in threadproc/win32/proc.c, and replaced make_handle_private with apr_file_inherit_unset. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63576 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_file_io.h | 10 +++++----- include/apr_inherit.h | 4 ++-- include/apr_network_io.h | 4 ++-- include/arch/unix/inherit.h | 8 +++++--- include/arch/win32/inherit.h | 22 +++++++++++----------- network_io/win32/sockets.c | 12 ++++++------ threadproc/win32/proc.c | 36 ++++++------------------------------ 7 files changed, 37 insertions(+), 59 deletions(-) diff --git a/include/apr_file_io.h b/include/apr_file_io.h index a9cd181d138..b9de5d75b3b 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -682,16 +682,16 @@ APR_POOL_DECLARE_ACCESSOR(file); * @param file The file to enable inheritance. * */ -APR_DECLARE(void) apr_file_inherit_set(apr_file_t *file); +APR_DECLARE_INHERIT_SET(file); + +/** @deprecated @see apr_file_inherit_set */ +APR_DECLARE(void) apr_file_set_inherit(apr_file_t *file); /** * Unset a file from being inherited by child processes. * @param file The file to disable inheritance. */ -APR_DECLARE(void) apr_file_inherit_unset(apr_file_t *file); - -/** @deprecated @see apr_file_inherit_set */ -APR_DECLARE(void) apr_file_set_inherit(apr_file_t *file); +APR_DECLARE_INHERIT_UNSET(file); /** @deprecated @see apr_file_inherit_unset */ APR_DECLARE(void) apr_file_unset_inherit(apr_file_t *file); diff --git a/include/apr_inherit.h b/include/apr_inherit.h index d917b616fad..1865a65f7cc 100644 --- a/include/apr_inherit.h +++ b/include/apr_inherit.h @@ -75,13 +75,13 @@ extern "C" { * @param name Set Inheritance for this Socket/File Handle */ #define APR_DECLARE_INHERIT_SET(name) \ - APR_DECLARE(void) apr_##name##_inherit_set(apr_##name##_t *name) + APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *name) /** * @param name Unset Inheritance for this Socket/File Handle */ #define APR_DECLARE_INHERIT_UNSET(name) \ - APR_DECLARE(void) apr_##name##_inherit_unset(apr_##name##_t *name) + APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *name) #ifdef __cplusplus } diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 7664d7637ad..fd4c20d3594 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -811,7 +811,7 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, * Set a socket to be inherited by child processes. * @param socket The socket to enable inheritance. */ -APR_DECLARE(void) apr_socket_inherit_set(apr_socket_t *skt); +APR_DECLARE_INHERIT_SET(socket); /** @deprecated @see apr_socket_inherit_set */ APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *skt); @@ -820,7 +820,7 @@ APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *skt); * Unset a socket from being inherited by child processes. * @param socket The socket to disable inheritance. */ -APR_DECLARE(void) apr_socket_inherit_unset(apr_socket_t *skt); +APR_DECLARE_INHERIT_UNSET(socket); /** @deprecated @see apr_socket_inherit_unset */ APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *skt); diff --git a/include/arch/unix/inherit.h b/include/arch/unix/inherit.h index 090835230e0..3ec4e370cf5 100644 --- a/include/arch/unix/inherit.h +++ b/include/arch/unix/inherit.h @@ -57,16 +57,17 @@ #include "apr_inherit.h" -#define APR_INHERIT (2^24) /* Must not conflicts with other bits */ +#define APR_INHERIT (1 << 24) /* Must not conflict with other bits */ #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ -void apr_##name##_inherit_set(apr_##name##_t *name) \ +apr_status_t apr_##name##_inherit_set(apr_##name##_t *name) \ { \ if (!(name->flag & APR_INHERIT)) { \ name->flag |= APR_INHERIT; \ apr_pool_child_cleanup_set(name->pool, (void *)name, \ cleanup, apr_pool_cleanup_null); \ } \ + return APR_SUCCESS; \ } \ /* Deprecated */ \ void apr_##name##_set_inherit(apr_##name##_t *name) \ @@ -75,13 +76,14 @@ void apr_##name##_set_inherit(apr_##name##_t *name) \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ -void apr_##name##_inherit_unset(apr_##name##_t *name) \ +apr_status_t apr_##name##_inherit_unset(apr_##name##_t *name) \ { \ if (name->flag & APR_INHERIT) { \ name->flag &= ~APR_INHERIT; \ apr_pool_child_cleanup_set(name->pool, (void *)name, \ cleanup, cleanup); \ } \ + return APR_SUCCESS; \ } \ /* Deprecated */ \ void apr_##name##_unset_inherit(apr_##name##_t *name) \ diff --git a/include/arch/win32/inherit.h b/include/arch/win32/inherit.h index 9fb3aa7f998..32ec740c4d5 100644 --- a/include/arch/win32/inherit.h +++ b/include/arch/win32/inherit.h @@ -57,17 +57,17 @@ #include "apr_inherit.h" -#define APR_INHERIT (2^24) /* Must not conflicts with other bits */ +#define APR_INHERIT (1 << 24) /* Must not conflict with other bits */ #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ -APR_DECLARE(void) apr_##name##_inherit_set(apr_##name##_t *name) \ +APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *name) \ { \ IF_WIN_OS_IS_UNICODE \ { \ if (!SetHandleInformation(name->filehand, \ HANDLE_FLAG_INHERIT, \ HANDLE_FLAG_INHERIT)) \ - return /* apr_get_os_error() */; \ + return apr_get_os_error(); \ } \ ELSE_WIN_OS_IS_ANSI \ { \ @@ -75,26 +75,26 @@ APR_DECLARE(void) apr_##name##_inherit_set(apr_##name##_t *name) \ if (!DuplicateHandle(hproc, name->filehand, \ hproc, &temp, 0, TRUE, \ DUPLICATE_SAME_ACCESS)) \ - return /* apr_get_os_error() */; \ + return apr_get_os_error(); \ CloseHandle(name->filehand); \ name->filehand = temp; \ } \ - return /* APR_SUCCESS */; \ + return APR_SUCCESS; \ } \ /* Deprecated */ \ APR_DECLARE(void) apr_##name##_set_inherit(apr_##name##_t *name) \ { \ - /* return */ apr_##name##_inherit_set(name); \ + apr_##name##_inherit_set(name); \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ -APR_DECLARE(void) apr_##name##_inherit_unset(apr_##name##_t *name) \ +APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *name) \ { \ IF_WIN_OS_IS_UNICODE \ { \ if (!SetHandleInformation(name->filehand, \ HANDLE_FLAG_INHERIT, 0)) \ - return /* apr_get_os_error() */; \ + return apr_get_os_error(); \ } \ ELSE_WIN_OS_IS_ANSI \ { \ @@ -102,16 +102,16 @@ APR_DECLARE(void) apr_##name##_inherit_unset(apr_##name##_t *name) \ if (!DuplicateHandle(hproc, name->filehand, \ hproc, &temp, 0, FALSE, \ DUPLICATE_SAME_ACCESS)) \ - return /* apr_get_os_error() */; \ + return apr_get_os_error(); \ CloseHandle(name->filehand); \ name->filehand = temp; \ } \ - return /* APR_SUCCESS */; \ + return APR_SUCCESS; \ } \ /* Deprecated */ \ APR_DECLARE(void) apr_##name##_unset_inherit(apr_##name##_t *name) \ { \ - /* return */ apr_##name##_inherit_unset(name); \ + apr_##name##_inherit_unset(name); \ } #endif /* ! INHERIT_H */ diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index af0fc80355e..0487a2be17f 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -430,22 +430,22 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, * This is not trivial to implement. */ -APR_DECLARE(void) apr_socket_inherit_set(apr_socket_t *socket) +APR_DECLARE(apr_status_t) apr_socket_inherit_set(apr_socket_t *socket) { - return /* APR_ENOTIMPL */; + return APR_ENOTIMPL; } /* Deprecated */ APR_DECLARE(void) apr_socket_set_inherit(apr_socket_t *socket) { - /* return */ apr_socket_inherit_set(socket); + apr_socket_inherit_set(socket); } -APR_DECLARE(void) apr_socket_inherit_unset(apr_socket_t *socket) +APR_DECLARE(apr_status_t) apr_socket_inherit_unset(apr_socket_t *socket) { - return /* APR_ENOTIMPL */; + return APR_ENOTIMPL; } /* Deprecated */ APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *socket) { - /* return */ apr_socket_inherit_unset(socket); + apr_socket_inherit_unset(socket); } diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index ffee9e79943..89b4933185e 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -129,30 +129,6 @@ static apr_status_t open_nt_process_pipe(apr_file_t **read, apr_file_t **write, return APR_SUCCESS; } -static apr_status_t make_handle_private(apr_file_t *file) -{ -#ifdef _WIN32_WCE - return APR_ENOTIMPL; -#else - HANDLE hproc = GetCurrentProcess(); - HANDLE filehand = file->filehand; - - /* Create new non-inheritable versions of handles that - * the child process doesn't care about. Otherwise, the child - * inherits these handles; resulting in non-closeable handles - * to the respective pipes. - */ - if (!DuplicateHandle(hproc, filehand, - hproc, &file->filehand, 0, - FALSE, DUPLICATE_SAME_ACCESS)) - return apr_get_os_error(); - /* - * Close the inerhitable handle we don't need anymore. - */ - CloseHandle(filehand); - return APR_SUCCESS; -#endif -} APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, @@ -165,19 +141,19 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, stat = open_nt_process_pipe(&attr->child_in, &attr->parent_in, in, attr->pool); if (stat == APR_SUCCESS) - stat = make_handle_private(attr->parent_in); + stat = apr_file_inherit_unset(attr->parent_in); } if (out && stat == APR_SUCCESS) { stat = open_nt_process_pipe(&attr->parent_out, &attr->child_out, out, attr->pool); if (stat == APR_SUCCESS) - stat = make_handle_private(attr->parent_out); + stat = apr_file_inherit_unset(attr->parent_out); } if (err && stat == APR_SUCCESS) { stat = open_nt_process_pipe(&attr->parent_err, &attr->child_err, err, attr->pool); if (stat == APR_SUCCESS) - stat = make_handle_private(attr->parent_err); + stat = apr_file_inherit_unset(attr->parent_err); } return stat; } @@ -195,7 +171,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, rv = apr_file_dup2(attr->child_in, child_in, attr->pool); if (rv == APR_SUCCESS) - apr_file_inherit_set(attr->child_in); + rv = apr_file_inherit_set(attr->child_in); } if (parent_in && rv == APR_SUCCESS) { @@ -221,7 +197,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, rv = apr_file_dup2(attr->child_out, child_out, attr->pool); if (rv == APR_SUCCESS) - apr_file_inherit_set(attr->child_out); + rv = apr_file_inherit_set(attr->child_out); } if (parent_out && rv == APR_SUCCESS) { @@ -247,7 +223,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, rv = apr_file_dup2(attr->child_err, child_err, attr->pool); if (rv == APR_SUCCESS) - apr_file_inherit_set(attr->child_err); + rv = apr_file_inherit_set(attr->child_err); } if (parent_err && rv == APR_SUCCESS) { From 0f7bd8bfeda1f2165f80c3b142b2b5448b54a9e8 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 5 Jul 2002 20:31:04 +0000 Subject: [PATCH 3564/7878] Added the missing definition of apr_atomic_init() for FreeBSD git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63577 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index b289923d9b3..04ff8842339 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -177,6 +177,7 @@ APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); #define apr_atomic_inc(mem) atomic_add_int(mem,1) #define apr_atomic_set(mem, val) atomic_set_int(mem, val) #define apr_atomic_read(mem) (*mem) +#define apr_atomic_init(pool) APR_SUCCESS #define APR_ATOMIC_NEED_CAS_DEFAULT 1 From a907b91adbd8a9e653e726104c3b18d6dc50701e Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 5 Jul 2002 20:51:39 +0000 Subject: [PATCH 3565/7878] reverting the last change because it caused another problem on FreeBSD git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63578 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_atomic.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 04ff8842339..b289923d9b3 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -177,7 +177,6 @@ APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); #define apr_atomic_inc(mem) atomic_add_int(mem,1) #define apr_atomic_set(mem, val) atomic_set_int(mem, val) #define apr_atomic_read(mem) (*mem) -#define apr_atomic_init(pool) APR_SUCCESS #define APR_ATOMIC_NEED_CAS_DEFAULT 1 From 10bb9e48e5dbb860b0e6de8153147ca58e0f7a4d Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Fri, 5 Jul 2002 21:10:10 +0000 Subject: [PATCH 3566/7878] fix apr_atomic_init() on systems without threads git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63579 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/unix/apr_atomic.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 9c27bf10f56..a17e1adaa73 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -153,5 +153,13 @@ apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp) } #endif /* APR_ATOMIC_NEED_CAS_DEFAULT */ +#else /* !APR_HAS_THREADS */ + +#if !defined(apr_atomic_init) +apr_status_t apr_atomic_init(apr_pool_t *p) +{ + return APR_SUCCESS; +} +#endif /* !defined(apr_atomic_init) */ #endif /* APR_HAS_THREADS */ From 54fc650c22c325ba5c2f56d202a0a5303696efdc Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 6 Jul 2002 08:13:35 +0000 Subject: [PATCH 3567/7878] Additional speedup for apr_table_unset(): don't start doing the check for dst_elt!=NULL on each iteration until we've seen the first instance of the target key git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63580 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_tables.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 03e907f178b..1949af9db08 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -505,7 +505,7 @@ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) { apr_table_entry_t *next_elt = (apr_table_entry_t *) t->a.elts; apr_table_entry_t *end_elt = next_elt + t->a.nelts; - apr_table_entry_t *dst_elt = NULL; + apr_table_entry_t *dst_elt; apr_uint32_t checksum; COMPUTE_KEY_CHECKSUM(key, checksum); @@ -513,12 +513,17 @@ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) if ((checksum == next_elt->key_checksum) && !strcasecmp(next_elt->key, key)) { t->a.nelts--; - if (!dst_elt) { - dst_elt = next_elt; + dst_elt = next_elt; + for (next_elt++; next_elt < end_elt; next_elt++) { + if ((checksum == next_elt->key_checksum) && + !strcasecmp(next_elt->key, key)) { + t->a.nelts--; + } + else { + *dst_elt++ = *next_elt; + } } - } - else if (dst_elt) { - *dst_elt++ = *next_elt; + break; } } } From ea8879bd56f7f460c6614af78cde3766541de5d5 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 8 Jul 2002 12:50:12 +0000 Subject: [PATCH 3568/7878] get the declaration for atexit() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63581 13f79535-47bb-0310-9956-ffa450edef68 --- test/testuuid.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testuuid.c b/test/testuuid.c index 8cc6405d3d9..8a691d812eb 100644 --- a/test/testuuid.c +++ b/test/testuuid.c @@ -53,6 +53,7 @@ */ #include +#include #include "apr_general.h" #include "apr_uuid.h" From a3cbdb10bb122fce52a6a239409efadfabd3201e Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Mon, 8 Jul 2002 15:32:43 +0000 Subject: [PATCH 3569/7878] forgot this file last week git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63582 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 0b21846b4f1..cf8ba88b02c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ Changes with APR b1 + + *) FreeBSD: change apr_sendfile to accomodate a 4.6 kernel patch. + [Greg Ames] *) Faster code for the apr_table get/set functions [Brian Pane] From dabe9c2148c8fb5ecaf78482473dfd91be557060 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 8 Jul 2002 16:58:03 +0000 Subject: [PATCH 3570/7878] apr_filepath_ functions do not operate on an apr_file_t, they should not have apr_file_ prefixes. apr_filepath_ is it's own prefix. apr functions should operate on the apr_foo_ type for which they are named. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63583 13f79535-47bb-0310-9956-ffa450edef68 --- renames_pending | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/renames_pending b/renames_pending index 20d4fc78d0c..5484bba3b0b 100644 --- a/renames_pending +++ b/renames_pending @@ -11,12 +11,10 @@ apr_time_interval_short_t from apr_short_interval_time_t apr_file_info_t from apr_finfo_t apr_file_stat from apr_stat apr_file_lstat from apr_lstat -apr_file_path_root from apr_filepath_root -apr_file_path_merge from apr_file_path_merge -apr_file_path_set from apr_filepath_set -apr_file_path_get from apr_filepath_get apr_file_attrs_t from apr_fileattrs_t apr_file_seek_where_t from apr_seek_where_t + +apr_filepath_merge from apr_file_path_merge apr_fnmatch_test from apr_is_fnmatch From 0be68b7833155249e046a2742b5e444a797d1e12 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 8 Jul 2002 17:00:56 +0000 Subject: [PATCH 3571/7878] filepath_merge already was. filename_of_pathname is definately in this family of functions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63584 13f79535-47bb-0310-9956-ffa450edef68 --- renames_pending | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renames_pending b/renames_pending index 5484bba3b0b..6f740621793 100644 --- a/renames_pending +++ b/renames_pending @@ -14,7 +14,7 @@ apr_file_lstat from apr_lstat apr_file_attrs_t from apr_fileattrs_t apr_file_seek_where_t from apr_seek_where_t -apr_filepath_merge from apr_file_path_merge +apr_filepath_name_get from apr_filename_of_pathname apr_fnmatch_test from apr_is_fnmatch From fa222bbfb877ae504b983cb7312831f2818629d6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 8 Jul 2002 17:30:56 +0000 Subject: [PATCH 3572/7878] Use apr_ flavor git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63585 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr.hw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr.hw b/include/apr.hw index cbdacbf00c1..207441454c1 100644 --- a/include/apr.hw +++ b/include/apr.hw @@ -419,8 +419,8 @@ typedef int apr_wait_t; /* struct iovec is needed to emulate Unix writev */ struct iovec { - char* iov_base; - size_t iov_len; + char* iov_base; + apr_size_t iov_len; }; /* Nasty Win32 .h ommissions we really need */ From d55e0201a699ea870e175dafb5c8fa5c6892db94 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 8 Jul 2002 17:34:24 +0000 Subject: [PATCH 3573/7878] Leftovers from my size_t hunt before the weekend. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63586 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_lib.h | 2 +- include/apr_md5.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/apr_lib.h b/include/apr_lib.h index 5685e8c30ef..15be50aa923 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -250,7 +250,7 @@ APR_DECLARE(apr_status_t) apr_password_validate(const char *passwd, * @param bufsize The length of the password buffer. */ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, - size_t *bufsize); + apr_size_t *bufsize); #ifdef __cplusplus } diff --git a/include/apr_md5.h b/include/apr_md5.h index cc2242cfcd2..a88199bfdcc 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -177,7 +177,7 @@ APR_DECLARE(apr_status_t) apr_md5(unsigned char digest[MD5_DIGESTSIZE], * @param nbytes The length of the string */ APR_DECLARE(apr_status_t) apr_md5_encode(const char *password, const char *salt, - char *result, size_t nbytes); + char *result, apr_size_t nbytes); /** @} */ #ifdef __cplusplus From 99c8612c662922f415beb089761489ea787744cd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 8 Jul 2002 17:34:54 +0000 Subject: [PATCH 3574/7878] Leftovers from my size_t hunt. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63587 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/netware/threadproc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arch/netware/threadproc.h b/include/arch/netware/threadproc.h index 9323ae5bd5d..3b57cd8e348 100644 --- a/include/arch/netware/threadproc.h +++ b/include/arch/netware/threadproc.h @@ -77,7 +77,7 @@ struct apr_thread_t { struct apr_threadattr_t { apr_pool_t *pool; - size_t stack_size; + apr_size_t stack_size; apr_int32_t detach; char *thread_name; }; From 8e0ae056cf5011157cf318f1246f19eebe59fbef Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 8 Jul 2002 17:39:29 +0000 Subject: [PATCH 3575/7878] The native c offsetof() was conflicting when trying to use the APR_OFFSETOF macros with c++ ... simply use our own implementation in that case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63588 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_general.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/apr_general.h b/include/apr_general.h index 463f7362b29..d32209d880c 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -144,7 +144,7 @@ typedef int apr_signum_t; * @param field data field within the structure * @return offset */ -#ifdef offsetof +#if defined(offsetof) && !defined(__cplusplus) #define APR_OFFSETOF(s_type,field) offsetof(s_type,field) #else #define APR_OFFSETOF(s_type,field) APR_OFFSET(s_type*,field) From 89106b01e868ac7b7d2abdc193a77db7d5ea9687 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 8 Jul 2002 17:41:25 +0000 Subject: [PATCH 3576/7878] Rename to apr_fnmatch_test git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63589 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_compat.h | 4 ++-- include/apr_fnmatch.h | 3 +++ renames_pending | 2 -- strings/apr_fnmatch.c | 8 +++++++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include/apr_compat.h b/include/apr_compat.h index 23a307ae09d..3651eba8063 100644 --- a/include/apr_compat.h +++ b/include/apr_compat.h @@ -72,8 +72,8 @@ #define ap_init_alloc apr_pool_alloc_init /** @deprecated @see apr_is_empty_table */ #define ap_is_empty_table apr_is_empty_table -/** @deprecated @see apr_is_fnmatch */ -#define ap_is_fnmatch apr_is_fnmatch +/** @deprecated @see apr_fnmatch_test */ +#define ap_is_fnmatch apr_fnmatch_test /** @deprecated @see apr_pool_cleanup_kill */ #define ap_kill_cleanup apr_pool_cleanup_kill /** @deprecated @see apr_array_make */ diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index 0e2f4db9be0..48fc4d9e7dc 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -83,6 +83,9 @@ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, * @param pattern The pattern to search for glob characters. * @return non-zero if pattern has any glob characters in it */ +APR_DECLARE(int) apr_fnmatch_test(const char *pattern); + +/** @deprecated @see apr_fnmatch_test */ APR_DECLARE(int) apr_is_fnmatch(const char *pattern); #ifdef __cplusplus diff --git a/renames_pending b/renames_pending index 6f740621793..e961e6c65ec 100644 --- a/renames_pending +++ b/renames_pending @@ -16,8 +16,6 @@ apr_file_seek_where_t from apr_seek_where_t apr_filepath_name_get from apr_filename_of_pathname -apr_fnmatch_test from apr_is_fnmatch - apr_lock_scope_e from apr_lockscope_e apr_lock_type_e from apr_locktype_e apr_lock_mech_e from apr_lockmech_e diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index f9a20c262c0..782d42a7250 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -210,7 +210,7 @@ static const char *rangematch(const char *pattern, int test, int flags) /* This function is an Apache addition */ /* return non-zero if pattern has any glob chars in it */ -APR_DECLARE(int) apr_is_fnmatch(const char *pattern) +APR_DECLARE(int) apr_fnmatch_test(const char *pattern) { int nesting; @@ -241,3 +241,9 @@ APR_DECLARE(int) apr_is_fnmatch(const char *pattern) } return 0; } + +/* Deprecated */ +APR_DECLARE(int) apr_is_fnmatch(const char *pattern) +{ + return apr_fnmatch_test(pattern); +} From 1dc753ab740d573e46b035f9a887d30aa83808b4 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 8 Jul 2002 20:28:56 +0000 Subject: [PATCH 3577/7878] Some platforms can't retrieve perms, APR_INCOMPLETE is fine [we strongly suspect that perms will always be set as completely as how perms may be retrieved.] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63590 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/unix/copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index c4b87b4c69a..86dc44b499d 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -74,7 +74,7 @@ static apr_status_t apr_file_transfer_contents(const char *from_path, /* Get its size. */ if (to_perms == APR_FILE_SOURCE_PERMS) { status = apr_file_info_get(&finfo, APR_FINFO_PROT, s); - if (status) { + if (status != APR_SUCCESS && status != APR_INCOMPLETE) { apr_file_close(s); /* toss any error */ return status; } From c19ede11e07e22bafbae501d88ea8c9a1d8c8be3 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Tue, 9 Jul 2002 01:33:42 +0000 Subject: [PATCH 3578/7878] added support for changing the limit on file descriptors per process git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63591 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 ++++- include/apr_thread_proc.h | 3 +++ include/arch/unix/threadproc.h | 3 +++ threadproc/unix/proc.c | 15 +++++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index cf8ba88b02c..73022c7a213 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 - + *) Added APR_LIMIT_NOFILE option to apr_procattr_limit_set() to + control the file descriptor limit on platforms that support + RLIMIT_NOFILE. [Brian Pane] + *) FreeBSD: change apr_sendfile to accomodate a 4.6 kernel patch. [Greg Ames] diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 27e09f59675..6735ddf040d 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -127,6 +127,8 @@ typedef enum { #define APR_LIMIT_MEM 1 /** @see apr_procattr_limit_set */ #define APR_LIMIT_NPROC 2 +/** @see apr_procattr_limit_set */ +#define APR_LIMIT_NOFILE 3 #if APR_HAS_OTHER_CHILD || defined(DOXYGEN) /** @@ -469,6 +471,7 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, * APR_LIMIT_CPU * APR_LIMIT_MEM * APR_LIMIT_NPROC + * APR_LIMIT_NOFILE * * @param limit Value to set the limit to. */ diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index c93c1909b69..ad68f5f37bc 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -131,6 +131,9 @@ struct apr_procattr_t { #ifdef RLIMIT_NPROC struct rlimit *limit_nproc; #endif +#ifdef RLIMIT_NOFILE + struct rlimit *limit_nofile; +#endif }; #endif /* ! THREAD_PROC_H */ diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index b0f41fd1f96..f2b94349583 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -260,6 +260,13 @@ static apr_status_t limit_proc(apr_procattr_t *attr) } } #endif +#ifdef RLIMIT_NOFILE + if (attr->limit_nofile != NULL) { + if ((setrlimit(RLIMIT_NOFILE, attr->limit_nofile)) != 0) { + return errno; + } + } +#endif #if defined(RLIMIT_AS) if (attr->limit_mem != NULL) { if ((setrlimit(RLIMIT_AS, attr->limit_mem)) != 0) { @@ -528,6 +535,14 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, return APR_ENOTIMPL; #endif + case APR_LIMIT_NOFILE: +#ifdef RLIMIT_NOFILE + attr->limit_nofile = limit; + break; +#else + return APR_ENOTIMPL; +#endif + } return APR_SUCCESS; From 6554efec7b94b4aa22653df34a364f7ffbdee9f9 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 9 Jul 2002 22:50:41 +0000 Subject: [PATCH 3579/7878] apr_oslevel_get() is an internal function. Correct it to no longer pass the pool* arg (which it never used), and call it before we begin with the apr_allocator cruft which would force a mutex (since WinNT v.s. 9x hadn't been determined), rather than a critical section on the global pool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63592 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/win32/misc.h | 2 +- misc/win32/misc.c | 2 +- misc/win32/start.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 68e636afd89..3f1e49dfb82 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -143,7 +143,7 @@ typedef enum { extern APR_DECLARE_DATA apr_oslevel_e apr_os_level; -apr_status_t apr_get_oslevel(struct apr_pool_t *, apr_oslevel_e *); +apr_status_t apr_get_oslevel(apr_oslevel_e *); /* The APR_HAS_ANSI_FS symbol is PRIVATE, and internal to APR. * APR only supports char data for filenames. Like most applications, diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 38a6f266205..644e3c6f0e1 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -61,7 +61,7 @@ APR_DECLARE_DATA apr_oslevel_e apr_os_level = APR_WIN_UNK; -apr_status_t apr_get_oslevel(apr_pool_t *cont, apr_oslevel_e *level) +apr_status_t apr_get_oslevel(apr_oslevel_e *level) { if (apr_os_level == APR_WIN_UNK) { diff --git a/misc/win32/start.c b/misc/win32/start.c index 340c62960ed..c80fdb03e71 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -199,6 +199,11 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_SUCCESS; } + /* Initialize apr_os_level global */ + if (apr_get_oslevel(NULL, &osver) != APR_SUCCESS) { + return APR_EEXIST; + } + if ((status = apr_pool_initialize()) != APR_SUCCESS) return status; @@ -206,13 +211,8 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_ENOPOOL; } - apr_pool_tag(pool, "apr_initilialize"); + apr_pool_tag(pool, "apr_initialize"); - /* Initialize apr_os_level global */ - if (apr_get_oslevel(pool, &osver) != APR_SUCCESS) { - return APR_EEXIST; - } - iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); err = WSAStartup((WORD) iVersionRequested, &wsaData); if (err) { From debf97d21b3dbd0a5be3c5d30fb374f58146c7ad Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 9 Jul 2002 22:52:06 +0000 Subject: [PATCH 3580/7878] Hadn't saved the file complete when committing. apr_oslevel_get will no longer take a pool* arg. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63593 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/start.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/win32/start.c b/misc/win32/start.c index c80fdb03e71..48c588cc3d4 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -200,7 +200,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) } /* Initialize apr_os_level global */ - if (apr_get_oslevel(NULL, &osver) != APR_SUCCESS) { + if (apr_get_oslevel(&osver) != APR_SUCCESS) { return APR_EEXIST; } From c851a7c88720109d6d0ba5d8b8136fa2068bce7b Mon Sep 17 00:00:00 2001 From: "Victor J. Orlikowski" Date: Wed, 10 Jul 2002 05:54:12 +0000 Subject: [PATCH 3581/7878] Inspired by the OpenSSL guys, this allows the --with-egd parameter to use defaults, if a socket is not specified. Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63594 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 11 +++-- misc/unix/rand.c | 121 ++++++++++++++++++++++++++--------------------- 2 files changed, 72 insertions(+), 60 deletions(-) diff --git a/configure.in b/configure.in index cda55f5d05a..d8c1e6c6cc2 100644 --- a/configure.in +++ b/configure.in @@ -1543,12 +1543,13 @@ dnl #----------------------------- Checking for /dev/random AC_MSG_CHECKING(for entropy source) AC_ARG_WITH(egd, - [ --with-egd= use egd-compatible socket], - [ if test "$withval" = "yes"; then - AC_ERROR([You must specify a default EGD socket path.]) + [ --with-egd[[=]] use egd-compatible socket], + [ AC_DEFINE(HAVE_EGD) + if test "$withval" = "yes"; then + AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, ["/var/run/egd-pool","/dev/egd-pool","/etc/egd-pool","/etc/entropy"]) + else + AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, ["$withval"]) fi - AC_DEFINE(HAVE_EGD) - AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, [$withval]) AC_MSG_RESULT(EGD-compatible daemon) rand="1" ]) diff --git a/misc/unix/rand.c b/misc/unix/rand.c index 3cb9e7d204d..94970dccb03 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -86,7 +86,7 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, #ifdef DEV_RANDOM int rnd; - size_t got, tot; + apr_size_t got, tot; if ((rnd = open(STR(DEV_RANDOM), O_RDONLY)) == -1) return errno; @@ -119,76 +119,87 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, * 0x04 (report PID) * 0xMM (length of PID string, not null-terminated) MM chars */ - int egd_socket, egd_path_len, rv; + static const char *egd_sockets[] = { EGD_DEFAULT_SOCKET, NULL }; + const char **egdsockname = NULL; + + int egd_socket, egd_path_len, rv, bad_errno; struct sockaddr_un addr; apr_socklen_t egd_addr_len; - size_t resp_expected; + apr_size_t resp_expected; unsigned char req[2], resp[255]; unsigned char *curbuf = buf; - egd_path_len = strlen(STR(EGD_DEFAULT_SOCKET)); - - if (egd_path_len > sizeof(addr.sun_path)) { - return APR_EINVAL; - } - - memset(&addr, 0, sizeof(struct sockaddr_un)); - addr.sun_family = AF_UNIX; - memcpy(addr.sun_path, STR(EGD_DEFAULT_SOCKET), egd_path_len); - egd_addr_len = APR_OFFSETOF(struct sockaddr_un, sun_path) + - egd_path_len; - - egd_socket = socket(PF_UNIX, SOCK_STREAM, 0); - - if (egd_socket == -1) { - return errno; - } - - rv = connect(egd_socket, (struct sockaddr*)&addr, egd_addr_len); - - if (rv == -1) { - return errno; - } + for (egdsockname = egd_sockets; *egdsockname && length > 0; egdsockname++) { + egd_path_len = strlen(*egdsockname); + + if (egd_path_len > sizeof(addr.sun_path)) { + return APR_EINVAL; + } - /* EGD can only return 255 bytes of data at a time. Silly. */ - while (length > 0) { - ssize_t srv; - req[0] = 2; /* We'll block for now. */ - req[1] = length > 255 ? 255: length; + memset(&addr, 0, sizeof(struct sockaddr_un)); + addr.sun_family = AF_UNIX; + memcpy(addr.sun_path, *egdsockname, egd_path_len); + egd_addr_len = APR_OFFSETOF(struct sockaddr_un, sun_path) + + egd_path_len; - srv = write(egd_socket, req, 2); - if (srv == -1) { - int bad_errno = errno; + egd_socket = socket(PF_UNIX, SOCK_STREAM, 0); - shutdown(egd_socket, SHUT_RDWR); - close(egd_socket); - return bad_errno; + if (egd_socket == -1) { + return errno; } - if (srv != 2) { - shutdown(egd_socket, SHUT_RDWR); - close(egd_socket); - return APR_EGENERAL; /* Try again. */ - } + rv = connect(egd_socket, (struct sockaddr*)&addr, egd_addr_len); - resp_expected = req[1]; - srv = read(egd_socket, resp, resp_expected); - if (srv == -1) { - int bad_errno = errno; + if (rv == -1) { + bad_errno = errno; + continue; + } - shutdown(egd_socket, SHUT_RDWR); - close(egd_socket); - return bad_errno; + /* EGD can only return 255 bytes of data at a time. Silly. */ + while (length > 0) { + apr_ssize_t srv; + req[0] = 2; /* We'll block for now. */ + req[1] = length > 255 ? 255: length; + + srv = write(egd_socket, req, 2); + if (srv == -1) { + bad_errno = errno; + shutdown(egd_socket, SHUT_RDWR); + close(egd_socket); + break; + } + + if (srv != 2) { + shutdown(egd_socket, SHUT_RDWR); + close(egd_socket); + return APR_EGENERAL; + } + + resp_expected = req[1]; + srv = read(egd_socket, resp, resp_expected); + if (srv == -1) { + bad_errno = errno; + shutdown(egd_socket, SHUT_RDWR); + close(egd_socket); + return bad_errno; + } + + memcpy(curbuf, resp, srv); + curbuf += srv; + length -= srv; } + + shutdown(egd_socket, SHUT_RDWR); + close(egd_socket); + } - memcpy(curbuf, resp, srv); - curbuf += srv; - length -= srv; + if (length > 0) { + /* We must have iterated through the list of sockets, + * and no go. Return the errno. + */ + return bad_errno; } - shutdown(egd_socket, SHUT_RDWR); - close(egd_socket); - #elif defined(HAVE_TRUERAND) /* use truerand */ extern int randbyte(void); /* from the truerand library */ From ea8260db7ea3f7a52fec63c8addbc9dd663ae216 Mon Sep 17 00:00:00 2001 From: "Victor J. Orlikowski" Date: Wed, 10 Jul 2002 06:01:13 +0000 Subject: [PATCH 3582/7878] Continue the Bill Rowe apr_size_t crusade. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63595 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/readwrite.c | 2 +- file_io/win32/filepath.c | 2 +- i18n/unix/xlate.c | 10 +++++----- misc/win32/internal.c | 10 +++++----- misc/win32/start.c | 6 +++--- network_io/beos/sendrecv.c | 6 +++--- network_io/os2/sendrecv.c | 4 ++-- network_io/os2/sendrecv_udp.c | 4 ++-- network_io/unix/inet_ntop.c | 2 +- network_io/unix/sendrecv.c | 18 +++++++++--------- passwd/apr_getpass.c | 2 +- passwd/apr_md5.c | 2 +- strings/apr_strings.c | 2 +- test/testmd5.c | 2 +- 14 files changed, 36 insertions(+), 36 deletions(-) diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index faeee1bb34b..1cf6cb836c3 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -325,7 +325,7 @@ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) { - size_t readlen; + apr_size_t readlen; apr_status_t rv = APR_SUCCESS; int i; diff --git a/file_io/win32/filepath.c b/file_io/win32/filepath.c index 42dfbe5ce58..13222b23236 100644 --- a/file_io/win32/filepath.c +++ b/file_io/win32/filepath.c @@ -871,7 +871,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, path[keptlen + seglen] = '\0'; if ((rv = apr_lstat(&finfo, path, APR_FINFO_TYPE | APR_FINFO_NAME, p)) == APR_SUCCESS) { - size_t namelen = strlen(finfo.name); + apr_size_t namelen = strlen(finfo.name); #if defined(OS2) || defined(NETWARE) /* only has case folding, never aliases that change the length */ diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index 7ded783de48..06644cb296f 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -191,9 +191,9 @@ static void check_sbcs(apr_xlate_t *convset) char inbuf[256], outbuf[256]; char *inbufptr = inbuf; char *outbufptr = outbuf; - size_t inbytes_left, outbytes_left; + apr_size_t inbytes_left, outbytes_left; int i; - size_t translated; + apr_size_t translated; for (i = 0; i < sizeof(inbuf); i++) { inbuf[i] = i; @@ -202,7 +202,7 @@ static void check_sbcs(apr_xlate_t *convset) inbytes_left = outbytes_left = sizeof(inbuf); translated = iconv(convset->ich, (ICONV_INBUF_TYPE)&inbufptr, &inbytes_left, &outbufptr, &outbytes_left); - if (translated != (size_t) -1 && + if (translated != (apr_size_t) -1 && inbytes_left == 0 && outbytes_left == 0) { /* hurray... this is simple translation; save the table, @@ -288,7 +288,7 @@ apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, { apr_status_t status = APR_SUCCESS; #ifdef HAVE_ICONV - size_t translated; + apr_size_t translated; if (convset->ich != (iconv_t)-1) { const char *inbufptr = inbuf; @@ -308,7 +308,7 @@ apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, * the last input character is incomplete) * c) the error condition where the input is invalid */ - if (translated == (size_t)-1) { + if (translated == (apr_size_t)-1) { switch (errno) { case E2BIG: /* out of space on output */ status = 0; /* change table lookup code below if you diff --git a/misc/win32/internal.c b/misc/win32/internal.c index 4ba6f70ba6d..df34a867544 100644 --- a/misc/win32/internal.c +++ b/misc/win32/internal.c @@ -79,7 +79,7 @@ int apr_wastrtoastr(char const * const * *retarr, wchar_t const * const *arr, int args) { - size_t elesize = 0; + apr_size_t elesize = 0; char **newarr; char *elements; char *ele; @@ -95,7 +95,7 @@ int apr_wastrtoastr(char const * const * *retarr, for (arg = 0; arg < args; ++arg) { newarr[arg] = (void*)(wcslen(arr[arg]) + 1); - elesize += (size_t)newarr[arg]; + elesize += (apr_size_t)newarr[arg]; } /* This is a safe max allocation, we will realloc after @@ -108,8 +108,8 @@ int apr_wastrtoastr(char const * const * *retarr, _CRT_BLOCK, __FILE__, __LINE__); for (arg = 0; arg < args; ++arg) { - size_t len = (size_t)newarr[arg]; - size_t newlen = elesize; + apr_size_t len = (apr_size_t)newarr[arg]; + apr_size_t newlen = elesize; newarr[arg] = ele; (void)apr_conv_ucs2_to_utf8(arr[arg], &len, @@ -129,7 +129,7 @@ int apr_wastrtoastr(char const * const * *retarr, _CRT_BLOCK, __FILE__, __LINE__); if (ele != elements) { - size_t diff = ele - elements; + apr_size_t diff = ele - elements; for (arg = 0; arg < args; ++arg) { newarr[arg] += diff; } diff --git a/misc/win32/start.c b/misc/win32/start.c index 48c588cc3d4..cd83860ddbf 100644 --- a/misc/win32/start.c +++ b/misc/win32/start.c @@ -79,9 +79,9 @@ static int warrsztoastr(const char * const * *retarr, const wchar_t * arrsz, int args) { const apr_wchar_t *wch; - size_t totlen; - size_t newlen; - size_t wsize; + apr_size_t totlen; + apr_size_t newlen; + apr_size_t wsize; char **newarr; int arg; diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index b520b3ae1b1..3762befbb86 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -97,7 +97,7 @@ apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read) APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { - ssize_t rv; + apr_ssize_t rv; do { rv = send(sock->socketdes, buf, (*len), 0); @@ -170,7 +170,7 @@ APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t * sock, const struct iovec *vec APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, apr_int32_t flags, const char *buf, apr_size_t *len) { - ssize_t rv; + apr_ssize_t rv; do { rv = sendto(sock->socketdes, buf, (*len), flags, @@ -204,7 +204,7 @@ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, apr_int32_t flags, char *buf, apr_size_t *len) { - ssize_t rv; + apr_ssize_t rv; if (from == NULL){ return APR_ENOMEM; diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index a059fb3b0ae..e3631dadf6c 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -61,7 +61,7 @@ APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { - ssize_t rv; + apr_ssize_t rv; int fds, err = 0; do { @@ -100,7 +100,7 @@ APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf, apr_size APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) { - ssize_t rv; + apr_ssize_t rv; int fds, err = 0; do { diff --git a/network_io/os2/sendrecv_udp.c b/network_io/os2/sendrecv_udp.c index 1cf97b1b487..480d8c41eb0 100644 --- a/network_io/os2/sendrecv_udp.c +++ b/network_io/os2/sendrecv_udp.c @@ -84,7 +84,7 @@ apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read) APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, apr_int32_t flags, const char *buf, apr_size_t *len) { - ssize_t rv; + apr_ssize_t rv; int serrno; do { @@ -123,7 +123,7 @@ APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, apr_int32_t flags, char *buf, apr_size_t *len) { - ssize_t rv; + apr_ssize_t rv; int serrno; do { diff --git a/network_io/unix/inet_ntop.c b/network_io/unix/inet_ntop.c index 15e2c452116..9cd78852e39 100644 --- a/network_io/unix/inet_ntop.c +++ b/network_io/unix/inet_ntop.c @@ -235,7 +235,7 @@ inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) /* * Check for overflow, copy, and we're done. */ - if ((size_t)(tp - tmp) > size) { + if ((apr_size_t)(tp - tmp) > size) { errno = ENOSPC; return (NULL); } diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 172d1fe983a..c2b9dd5a335 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -99,7 +99,7 @@ apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read) apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { - ssize_t rv; + apr_ssize_t rv; if (sock->netmask & APR_INCOMPLETE_WRITE) { sock->netmask &= ~APR_INCOMPLETE_WRITE; @@ -138,7 +138,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len) apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) { - ssize_t rv; + apr_ssize_t rv; apr_status_t arv; if (sock->netmask & APR_INCOMPLETE_READ) { @@ -181,7 +181,7 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len) apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where, apr_int32_t flags, const char *buf, apr_size_t *len) { - ssize_t rv; + apr_ssize_t rv; do { rv = sendto(sock->socketdes, buf, (*len), flags, @@ -215,7 +215,7 @@ apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, apr_int32_t flags, char *buf, apr_size_t *len) { - ssize_t rv; + apr_ssize_t rv; do { rv = recvfrom(sock->socketdes, buf, (*len), flags, @@ -463,7 +463,7 @@ static int include_hdrs_in_length(void) static api_e api; int kernel_version; - size_t kernel_version_size; + apr_size_t kernel_version_size; if (api != UNKNOWN) { return (api == OLD); @@ -495,7 +495,7 @@ apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file, off_t nbytes = 0; int rv, i; struct sf_hdtr headerstruct; - size_t bytes_to_send = *len; + apr_size_t bytes_to_send = *len; /* Ignore flags for now. */ flags = 0; @@ -625,8 +625,8 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_int32_t flags) { int i; - ssize_t rc; - size_t nbytes = *len, headerlen, trailerlen; + apr_ssize_t rc; + apr_size_t nbytes = *len, headerlen, trailerlen; struct iovec hdtrarray[2]; char *headerbuf, *trailerbuf; @@ -902,7 +902,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_int32_t flags) { apr_status_t rv, arv; - size_t nbytes; + apr_size_t nbytes; sendfilevec_t *sfv; int vecs, curvec, i, repeat; apr_size_t requested_len = 0; diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 199f4fc266a..cf84b7f1d78 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -223,7 +223,7 @@ static char *getpass(const char *prompt) * smaller than our own. */ -APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, size_t *bufsiz) +APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, apr_size_t *bufsiz) { char *pw_got = getpass(prompt); if (!pw_got) diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index 58d1119ee15..958400dbc76 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -520,7 +520,7 @@ static void to64(char *s, unsigned long v, int n) } APR_DECLARE(apr_status_t) apr_md5_encode(const char *pw, const char *salt, - char *result, size_t nbytes) + char *result, apr_size_t nbytes) { /* * Minimum size is 8 bytes for salt, plus 1 for the trailing NUL, diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 9c6af2f0d36..4dd000d6b84 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -71,7 +71,7 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *a, const char *s) { char *res; - size_t len; + apr_size_t len; if (s == NULL) { return NULL; diff --git a/test/testmd5.c b/test/testmd5.c index 1803ddab4f8..80aad42b367 100644 --- a/test/testmd5.c +++ b/test/testmd5.c @@ -86,7 +86,7 @@ struct testcase testcases[] = "\xd1\xa1\xc0\x97\x8a\x60\xbb\xfb\x2a\x25\x46\x9d\xa5\xae\xd0\xb0"} }; -static void try(const void *buf, size_t bufLen, apr_xlate_t *xlate, +static void try(const void *buf, apr_size_t bufLen, apr_xlate_t *xlate, const void *digest) { int i; From 89608e5e82932f129623a5665771b91c4435c2fc Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Wed, 10 Jul 2002 09:44:55 +0000 Subject: [PATCH 3583/7878] OS/2: Add implementation of apr_file_setaside(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63596 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filedup.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index 678f2dcc77b..08c6b9a17a2 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -117,3 +117,46 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_fi { return file_dup(&new_file, old_file, p); } + + + +APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, + apr_file_t *old_file, + apr_pool_t *p) +{ + *new_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t)); + memcpy(*new_file, old_file, sizeof(apr_file_t)); + (*new_file)->pool = p; + + if (old_file->buffered) { + (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); + + if (old_file->direction == 1) { + memcpy((*new_file)->buffer, old_file->buffer, old_file->bufpos); + } + else { + memcpy((*new_file)->buffer, old_file->buffer, old_file->dataRead); + } + + if (old_file->mutex) { + apr_thread_mutex_create(&((*new_file)->mutex), + APR_THREAD_MUTEX_DEFAULT, p); + apr_thread_mutex_destroy(old_file->mutex); + } + } + + if (old_file->fname) { + (*new_file)->fname = apr_pstrdup(p, old_file->fname); + } + + if (!(old_file->flags & APR_FILE_NOCLEANUP)) { + apr_pool_cleanup_register(p, (void *)(*new_file), + apr_file_cleanup, + apr_file_cleanup); + } + + old_file->filedes = -1; + apr_pool_cleanup_kill(old_file->pool, (void *)old_file, + apr_file_cleanup); + return APR_SUCCESS; +} From a74d92ab832e4e3861fb8d155224cc6764f6ad57 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 10 Jul 2002 16:45:12 +0000 Subject: [PATCH 3584/7878] Reformat the example. (no tabs and realign it.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63597 13f79535-47bb-0310-9956-ffa450edef68 --- include/apr_hash.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/apr_hash.h b/include/apr_hash.h index bedd62cc783..15a7f48c9a9 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -145,17 +145,17 @@ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, /** *

    U18o_@nbEPS48e&<0_+0P?>46TmG4~6mL!MPU#n|t#AJ9NhJ^VTll zo-kjue9h^WYWX#(Ky34Me)L=?rh?V?oy=?wkmE_rYK790Ja|B+BV8SL?p4tI^)nBs zo{pyBV+x6m*su^0LU$*N3t~%sE62d=&k9vDNx& zeNZfV>cCjZZ-WZC(Nys5h+z4Me5xh;MQgU|QMt8<$>?DJQCT5=#oDRQ^knw5K>4?$ z+8;-k=~@^c4R5Iiduu5$&*_zx&S-*9#i)+SC=UQe;G2xje>g|igipIFec71(x{(Ip z7TGdVz4h6&KZX3D17hk2mv!u=pGH5OT_9Avaj8L-!YkB8lTmf-y)x~ul)>dH-Zbg_ zcF+N-G26n{B)5^xhC4M9;YVUtdvi%YChFMV{*)>DWDgx+8vDv@r^)kSBBfkKjP{&} zgTr*tF)ON6FJnUV$u~J0@?F+|iSvZ8(|@gXB66P{9a(hbP`j~&2^gMYEl>Yz%@tUG zy~-#=wYvao-h2f(_z+0Y(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ab447a032 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 26 Mar 2002 19:54:56 +0000 Subject: [PATCH 3187/7878] Improve detection of the INT64_C macro to prevent problems with HP-UX's ANSI C compiler. PR: 8932 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63194 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ configure.in | 24 ++++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index ff8c3e1298a..b1b9bb2fc60 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with APR b1 + *) Improve detection of the INT64_C macro to prevent problems + with HP-UX's ANSI C compiler. PR 8932. [Justin Erenkrantz] + *) Make sure gethostbyname() can handle 255.255.255.255 if we are to trust it to handle numeric address strings in apr_sockaddr_info_get(). This fixes a problem on HP-UX diff --git a/configure.in b/configure.in index ce5fb969815..1a76f1bf1e7 100644 --- a/configure.in +++ b/configure.in @@ -993,12 +993,28 @@ else fi dnl # If present, allow the C99 macro INT64_C to override our conversion. -APR_CHECK_DEFINE(INT64_C, stdint.h) +dnl # +dnl # HP-UX's ANSI C compiler provides this without any includes, so we +dnl # will first look for INT64_C without adding stdint.h +AC_MSG_CHECKING(for INT64_C) +stdint=0 +AC_EGREP_CPP(YES_IS_DEFINED, +[#ifdef INT64_C +YES_IS_DEFINED +#endif +], +[ ac_cv_define_INT64_C=yes + AC_MSG_RESULT(yes) +], +[ ac_cv_define_INT64_C=no + AC_MSG_RESULT(no) + APR_CHECK_DEFINE(INT64_C, stdint.h) + if test "$ac_cv_define_INT64_C" = "yes"; then + stdint=1 + fi +]) if test "$ac_cv_define_INT64_C" = "yes"; then int64_literal='#define APR_INT64_C(val) INT64_C(val)' - stdint=1 -else - stdint=0 fi if test "$ac_cv_type_off_t" = "yes"; then From 9dbf42e783629f4e1de50cd06d63e4944521cd65 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 27 Mar 2002 14:18:12 +0000 Subject: [PATCH 3188/7878] Change the ordering of the lock method to what's been "standard" for Apache 1.3. This change will affect Apache2.0 so an entry in its CHANGES file will be added as well. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63195 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ configure.in | 19 +++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index b1b9bb2fc60..9bb19a13c3d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with APR b1 + *) Change the ordering of the apr_lock implementation method to + better match what's done in Apache 1.3. The ordering is + now (highest to lowest): pthread -> sysvsem -> fcntl -> flock. + [Jim Jagielski] + *) Improve detection of the INT64_C macro to prevent problems with HP-UX's ANSI C compiler. PR 8932. [Justin Erenkrantz] diff --git a/configure.in b/configure.in index 1a76f1bf1e7..46dfc802044 100644 --- a/configure.in +++ b/configure.in @@ -1328,19 +1328,22 @@ APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl APR_IFALLYES(struct:pthread_rw, hasrwlockser="1", hasrwlockser="0") # See which lock mechanism we'll select by default on this system. -# The last APR_DECIDE to execute sets the default +# The last APR_DECIDE to execute sets the default. +# At this stage, we match the ordering in Apache 1.3 +# which is (highest to lowest): pthread -> sysvsem -> fcntl -> flock +# APR_BEGIN_DECISION([apr_lock implementation method]) -APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, - APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) APR_IFALLYES(func:flock define:LOCK_EX, APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) +APR_IFALLYES(header:fcntl.h define:F_SETLK, + APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) +APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, + APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) # note: the current APR use of shared mutex requires /dev/zero APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl func:pthread_mutexattr_setpshared dnl file:/dev/zero, APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) -APR_IFALLYES(header:fcntl.h define:F_SETLK, - APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) fi @@ -1355,12 +1358,12 @@ case $ac_decision in USE_FLOCK_SERIALIZE ) flockser="1" ;; - USE_SYSVSEM_SERIALIZE ) - sysvser="1" - ;; USE_FCNTL_SERIALIZE ) fcntlser="1" ;; + USE_SYSVSEM_SERIALIZE ) + sysvser="1" + ;; USE_PROC_PTHREAD_SERIALIZE ) procpthreadser="1" ;; From 682b5686d6069c36818bbfa2cab714114f2455ee Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 27 Mar 2002 20:51:52 +0000 Subject: [PATCH 3189/7878] Would help to know the error :) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63196 13f79535-47bb-0310-9956-ffa450edef68 --- test/testshm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testshm.c b/test/testshm.c index 50cd31c44b7..347ec2a7bbb 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -314,7 +314,7 @@ int main(void) } printf("Anonymous shared memory test passed!\n"); - if (test_named(pool) != APR_SUCCESS) { + if ((rv = test_named(pool)) != APR_SUCCESS) { printf("Name-based shared memory test FAILED: [%d] %s \n", rv, apr_strerror(rv, errmsg, sizeof(errmsg))); exit(-3); From 6b2f8887587d4aad8cc0a628d4a7c5af1ce8dc1a Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 27 Mar 2002 23:51:51 +0000 Subject: [PATCH 3190/7878] Added the NetWare version of atomic.c to the build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63197 13f79535-47bb-0310-9956-ffa450edef68 --- NWGNUmakefile | 5 ++ atomic/netware/apr_atomic.c | 110 ++++++++++++++++++++++++++++++++++++ build/nw_export.inc | 1 + include/apr_atomic.h | 2 +- 4 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 atomic/netware/apr_atomic.c diff --git a/NWGNUmakefile b/NWGNUmakefile index c43193cfe18..4a674a844ab 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -238,6 +238,7 @@ FILES_nlm_exports = \ # Paths must all use the '/' character # FILES_lib_objs = \ + $(OBJDIR)/apr_atomic.o \ $(OBJDIR)/apr_cpystrn.o \ $(OBJDIR)/apr_fnmatch.o \ $(OBJDIR)/apr_getpass.o \ @@ -318,6 +319,10 @@ install :: nlms FORCE # Any specialized rules here # +$(OBJDIR)/%.o: atomic/netware/%.c $(OBJDIR)\cc.opt + @echo Compiling $< + $(CC) atomic\netware\$(. + */ + + +#include "apr.h" +#include "apr_lock.h" +#include "apr_thread_mutex.h" +#include "apr_atomic.h" + +#if APR_HAS_THREADS + +#if defined(APR_ATOMIC_NEED_DEFAULT) || defined(APR_ATOMIC_NEED_CAS_DEFAULT) + +#define NUM_ATOMIC_HASH 7 +/* shift by 2 to get rid of alignment issues */ +#define ATOMIC_HASH(x) (int)(((long)x>>2)%NUM_ATOMIC_HASH) +static apr_thread_mutex_t **hash_mutex; + +apr_status_t apr_atomic_init(apr_pool_t *p ) +{ + int i; + apr_status_t rv; + hash_mutex =apr_palloc(p,sizeof(apr_thread_mutex_t*) * NUM_ATOMIC_HASH); + for (i=0;i Date: Wed, 27 Mar 2002 23:52:12 +0000 Subject: [PATCH 3191/7878] Added the NetWare version of atomic.c to the project build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63198 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 199685 -> 198860 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index be6652b6cc23081857291b2e6835a82390345bb3..168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1R^4XBii1LX?lEiD3~%tF%Bd3TddwEezoSG#(t4Y{${y^ah+k@X zvBJbwOT~`Gu2kDX~8ma;`hu$Bcuc3YSJC10i_<}YkaY}l(TK-{4h@|mdC z!GE0LKsg2ZE~Uzvy2-G=$z1E2g-p{=e5}4~{ERqryo)2N)l30DX{vso7cbY$h*hV% zv)V-35pu!|)qA~GqJ)ZlWic>okx6s!AZTUD64rLbUY7;Z;6BfgT3D>{{FwICxfPBY zPSt%zY4B;v4VXb_wvn8lu-ETrnV<@@zhsUysFJX;I~3kIH{}rzDy>pui$bQfv8Jx9 zhL+Wkc@hxpZjMgWvx-EG#irWSv+5YocaiS(KUFqSx6zbaETRDB7pR~Qb9Mt606+mh2Bq9eCvc<)n<@!ohL1?9LSdZBnygy zI&3vxY2EA?6oOfiSPH{Dv~7rzl&j{VxprllXwK(!4L-%(4k>FcvXM^aMk64n zpGvY8BbW@SqNmTy_7L9AgD{A%EGRJLe{{R?BXLgj`tMK(Fp14x4N)jcT$S6h=4hYZ zRK4txgaHRP`pEsU34h0KGF0#HAn@<%1^pSZekDS$m?GjKSof{EsH&KAkiVS6JaYdJ zp5Mm84Lvr;2;*f2_a Date: Thu, 28 Mar 2002 15:10:51 +0000 Subject: [PATCH 3192/7878] define _XOPEN_SOURCE_EXTENDED on HP-UX 11; that gets us the socket interface that APR uses git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63199 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 31d1613ff01..38386120785 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -79,7 +79,7 @@ if test "x$apr_preload_done" != "xyes" ; then APR_ADDTO(CPPFLAGS, [-DHIUX]) ;; *-hp-hpux11.*) - APR_ADDTO(CPPFLAGS, [-DHPUX11 -D_REENTRANT]) + APR_ADDTO(CPPFLAGS, [-DHPUX11 -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED]) ;; *-hp-hpux10.*) case $host in From 0bf5d00ea92942cfd03dca97b08cc7115e548a6b Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Thu, 28 Mar 2002 15:30:10 +0000 Subject: [PATCH 3193/7878] Brain dead mistake. I meant to _dec instead of _inc git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63200 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/netware/apr_atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index bee38e754fc..5eecd079ad6 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -83,7 +83,7 @@ apr_status_t apr_atomic_init(apr_pool_t *p ) int apr_atomic_dec(apr_atomic_t *mem) { - atomic_inc(mem); + atomic_dec(mem); return *mem; } From 146aedd9f5693c2ef834992aa7b3c3b5ab702da3 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 28 Mar 2002 18:17:02 +0000 Subject: [PATCH 3194/7878] clean up the unix networking code by creating a new function to set basic info in apr_sockaddr_t and by reducing the amount of code that messes with the native sockaddrs within the apr_sockaddr_t prototypes for the new function -- apr_set_sockaddr_vars() -- were added for Win32 and OS/2 since otherwise they could get warnings for the lack of a prototype for the non-static function, which resides in sa_common.c for long-term, we need to look at using apr_set_sockaddr_vars() in Win32 and OS/2 code anyway git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63201 13f79535-47bb-0310-9956-ffa450edef68 --- include/arch/os2/networkio.h | 1 + include/arch/unix/networkio.h | 1 + include/arch/win32/networkio.h | 1 + network_io/unix/sa_common.c | 48 ++++++++++------------------ network_io/unix/sockets.c | 58 ++++++++-------------------------- 5 files changed, 34 insertions(+), 75 deletions(-) diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index 95c7c1f03e0..9434183e203 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -103,6 +103,7 @@ struct apr_pollfd_t { const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); +void apr_set_sockaddr_vars(apr_sockaddr_t *, int, apr_port_t); #endif /* ! NETWORK_IO_H */ diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index aa9e3853a14..d557cd9cd58 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -164,6 +164,7 @@ struct apr_pollfd_t { const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read); +void apr_set_sockaddr_vars(apr_sockaddr_t *, int, apr_port_t); #define apr_is_option_set(mask, option) ((mask & option) ==option) diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index a678139eec1..3014510680b 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -86,6 +86,7 @@ apr_status_t status_from_res_error(int); const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); +void apr_set_sockaddr_vars(apr_sockaddr_t *, int, apr_port_t); #endif /* ! NETWORK_IO_H */ diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index 2f62d612a9d..234b1661d4d 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -139,8 +139,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port, apr_sockaddr_t *sockaddr) { - /* XXX IPv6 - assumes sin_port and sin6_port at same offset */ - *port = ntohs(sockaddr->sa.sin.sin_port); + *port = sockaddr->port; return APR_SUCCESS; } @@ -148,12 +147,12 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr) { *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len); - apr_inet_ntop(sockaddr->sa.sin.sin_family, + apr_inet_ntop(sockaddr->family, sockaddr->ipaddr_ptr, *addr, sockaddr->addr_str_len); #if APR_HAVE_IPV6 - if (sockaddr->sa.sin.sin_family == AF_INET6 && + if (sockaddr->family == AF_INET6 && IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sockaddr->ipaddr_ptr)) { /* This is an IPv4-mapped IPv6 address; drop the leading * part of the address string so we're left with the familiar @@ -165,12 +164,15 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, return APR_SUCCESS; } -static void set_sockaddr_vars(apr_sockaddr_t *addr, int family) +void apr_set_sockaddr_vars(apr_sockaddr_t *addr, int family, apr_port_t port) { addr->family = family; - /* XXX IPv6: assumes sin_port and sin6_port at same offset */ - addr->port = ntohs(addr->sa.sin.sin_port); addr->sa.sin.sin_family = family; + if (port) { + /* XXX IPv6: assumes sin_port and sin6_port at same offset */ + addr->sa.sin.sin_port = htons(port); + addr->port = port; + } if (family == APR_INET) { addr->salen = sizeof(struct sockaddr_in); @@ -319,21 +321,16 @@ static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa, struct addrinfo *ai, apr_port_t port) { sa->pool = p; - sa->sa.sin.sin_family = ai->ai_family; memcpy(&sa->sa, ai->ai_addr, ai->ai_addrlen); - /* XXX IPv6: assumes sin_port and sin6_port at same offset */ - sa->sa.sin.sin_port = htons(port); - set_sockaddr_vars(sa, sa->sa.sin.sin_family); + apr_set_sockaddr_vars(sa, ai->ai_family, port); } #else static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa, struct in_addr ipaddr, apr_port_t port) { sa->pool = p; - sa->sa.sin.sin_family = AF_INET; sa->sa.sin.sin_addr = ipaddr; - sa->sa.sin.sin_port = htons(port); - set_sockaddr_vars(sa, sa->sa.sin.sin_family); + apr_set_sockaddr_vars(sa, AF_INET, port); } #endif @@ -395,16 +392,10 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, freeaddrinfo(ai_list); } else { - if (family == APR_UNSPEC) { - (*sa)->sa.sin.sin_family = APR_INET; - } - else { - (*sa)->sa.sin.sin_family = family; - } (*sa)->pool = p; - /* XXX IPv6: assumes sin_port and sin6_port at same offset */ - (*sa)->sa.sin.sin_port = htons(port); - set_sockaddr_vars(*sa, (*sa)->sa.sin.sin_family); + apr_set_sockaddr_vars(*sa, + family == APR_UNSPEC ? APR_INET : family, + port); } #else if (hostname != NULL) { @@ -488,15 +479,10 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, #endif } else { - if (family == APR_UNSPEC) { - (*sa)->sa.sin.sin_family = APR_INET; - } - else { - (*sa)->sa.sin.sin_family = family; - } (*sa)->pool = p; - (*sa)->sa.sin.sin_port = htons(port); - set_sockaddr_vars(*sa, (*sa)->sa.sin.sin_family); + apr_set_sockaddr_vars(*sa, + family == APR_UNSPEC ? APR_INET : family, + port); } #endif return APR_SUCCESS; diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index f77e2dcb90f..b0ca95183b8 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -57,15 +57,17 @@ #include "apr_portable.h" #include "inherit.h" +#if defined(BEOS) && !defined(BEOS_BONE) +#define close closesocket +#endif + +static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */ + static apr_status_t socket_cleanup(void *sock) { apr_socket_t *thesocket = sock; -#if defined(BEOS) && !defined(BEOS_BONE) - if (closesocket(thesocket->socketdes) == 0) { -#else if (close(thesocket->socketdes) == 0) { -#endif thesocket->socketdes = -1; return APR_SUCCESS; } @@ -77,35 +79,8 @@ static apr_status_t socket_cleanup(void *sock) static void set_socket_vars(apr_socket_t *sock, int family, int type) { sock->type = type; - sock->local_addr->family = family; - sock->local_addr->sa.sin.sin_family = family; - sock->remote_addr->family = family; - sock->remote_addr->sa.sin.sin_family = family; - - if (family == APR_INET) { - sock->local_addr->salen = sizeof(struct sockaddr_in); - sock->local_addr->addr_str_len = 16; - sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin.sin_addr); - sock->local_addr->ipaddr_len = sizeof(struct in_addr); - - sock->remote_addr->salen = sizeof(struct sockaddr_in); - sock->remote_addr->addr_str_len = 16; - sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin.sin_addr); - sock->remote_addr->ipaddr_len = sizeof(struct in_addr); - } -#if APR_HAVE_IPV6 - else if (family == APR_INET6) { - sock->local_addr->salen = sizeof(struct sockaddr_in6); - sock->local_addr->addr_str_len = 46; - sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin6.sin6_addr); - sock->local_addr->ipaddr_len = sizeof(struct in6_addr); - - sock->remote_addr->salen = sizeof(struct sockaddr_in6); - sock->remote_addr->addr_str_len = 46; - sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin6.sin6_addr); - sock->remote_addr->ipaddr_len = sizeof(struct in6_addr); - } -#endif + apr_set_sockaddr_vars(sock->local_addr, family, 0); + apr_set_sockaddr_vars(sock->remote_addr, family, 0); sock->netmask = 0; #if defined(BEOS) && !defined(BEOS_BONE) /* BeOS pre-BONE has TCP_NODELAY on by default and it can't be @@ -113,7 +88,8 @@ static void set_socket_vars(apr_socket_t *sock, int family, int type) */ sock->netmask |= APR_TCP_NODELAY; #endif -} +} + static void alloc_socket(apr_socket_t **new, apr_pool_t *p) { *new = (apr_socket_t *)apr_pcalloc(p, sizeof(apr_socket_t)); @@ -203,7 +179,6 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { - static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */ alloc_socket(new, connection_context); set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM); @@ -212,7 +187,6 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn #endif (*new)->timeout = -1; - (*new)->remote_addr->salen = sizeof((*new)->remote_addr->sa); (*new)->socketdes = accept(sock->socketdes, (struct sockaddr *)&(*new)->remote_addr->sa, &(*new)->remote_addr->salen); @@ -307,17 +281,13 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa) } sock->remote_addr = sa; - /* XXX IPv6 assumes sin_port and sin6_port at same offset */ - if (sock->local_addr->sa.sin.sin_port == 0) { + if (sock->local_addr->port == 0) { /* connect() got us an ephemeral port */ sock->local_port_unknown = 1; } - /* XXX IPv6 to be handled better later... */ - if ( -#if APR_HAVE_IPV6 - sock->local_addr->sa.sin.sin_family == APR_INET6 || -#endif - sock->local_addr->sa.sin.sin_addr.s_addr == 0) { + if (!memcmp(sock->local_addr->ipaddr_ptr, + generic_inaddr_any, + sock->local_addr->ipaddr_len)) { /* not bound to specific local interface; connect() had to assign * one for the socket */ From bdb171a90e74564d6344dfc5b437ba4630dadd99 Mon Sep 17 00:00:00 2001 From: Aaron Bannert Date: Thu, 28 Mar 2002 19:02:10 +0000 Subject: [PATCH 3195/7878] Get VPATH builds to work with solaris atomics again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63202 13f79535-47bb-0310-9956-ffa450edef68 --- atomic/solaris_sparc/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomic/solaris_sparc/Makefile.in b/atomic/solaris_sparc/Makefile.in index b0bc31de3b2..f88161f8995 100644 --- a/atomic/solaris_sparc/Makefile.in +++ b/atomic/solaris_sparc/Makefile.in @@ -9,8 +9,8 @@ ASCPP = @ASCPP@ # bring in rules.mk for standard functionality @INCLUDE_RULES@ -apr_atomic_sparc.lo: apr_atomic_sparc.s - $(ASCPP) $(ASCPPFLAGS) $*.s > $*.S +apr_atomic_sparc.lo: $(srcdir)/apr_atomic_sparc.s + $(ASCPP) $(ASCPPFLAGS) $(srcdir)/$*.s > $*.S $(AS) $(ASFLAGS) -o $@ $*.S From ecfef0225630e26db9e25aefd15e8c21244759a2 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 29 Mar 2002 16:57:59 +0000 Subject: [PATCH 3196/7878] Added apr_buckets_alloc.c to the project build git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63203 13f79535-47bb-0310-9956-ffa450edef68 --- libaprnw.mcp.zip | Bin 198860 -> 198998 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libaprnw.mcp.zip b/libaprnw.mcp.zip index 168e407e18ba924974b1dc9a339475c6fd6ec618..68b309ad0505eba05cd301bfa876fe8e340a3db2 100644 GIT binary patch delta 90578 zcmc$_byQSe_%});-CYVwDvdNFDlH8nl1hVg*BnB+q)SS=kq&_Yq*GFQ5CQ4IA!cA; z?)d%P_ulv3weH`SwfM|FPwss7KKtxFkxaUnLK@PH{j-9ILOb|zB&?8ZCUdI-n+0Gs zL>5f`xZ#v9)UnhE&1lw4qUF^o+~+=S)tqa2(rhXI!N)Gu`O?E@u56_AepKNv{Es)( zeIyiGgDe!n#1$31#Jnno27**dXe7Eva&uK6*LwDY#_Da)W#(0`r0d4iH)M}*uVk{H zoQ@0Q5NqZ;)KA$(Kbwm;R!IH4L=*Htn-}w7wmrHx?N}fk}EQ z4uF!toKa_UCb1`Dm$ZA?w(eTGLIHiiDa{h14Jl6rh&pgPwO-evc%(dArh#r3cy`Z( zX1uxGTj#RC;61^rp~_D(1@+1AtA!6(jGT$QK8BY#=Sp77*&GPkod>qe88BTpT@+}Q zkZOzugbbJseHOh?9%of>-OVGt{IJ}6fI7Yk-X09PH1k`;&cE-OM1v?f2JMP(9^`zq ziR?GKRhkI(JSou$J97Nabqz=xPr2`~XobFc8TshRlhL%z03H(7%wke;t0_V19-sB0 z1+u^78YV0HmEU7X=szeenxr1ZFW~+9flnmBeneW5LefegOaHjaxcNRK#X|-J%@+R6 zCOk8a_?%BR@-1atTIUBxQ)7^OUUuWJRn2OyeQtbaN7ia9zPZ?JK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